/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.128 * * Copyright 2011-2022 Cesium Contributors * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ import{a as R}from"./chunk-VC6LC2YG.js";import{a as ct}from"./chunk-YJ35UC5O.js";import{a as Z,b as H}from"./chunk-NPSDV7TS.js";import{a as V}from"./chunk-7MDSSANJ.js";import{a as U}from"./chunk-MWHUXN6D.js";import{b as ot}from"./chunk-YTKWBMG6.js";import{a as it}from"./chunk-OIUXC5BJ.js";import{a as nt}from"./chunk-CFEBEP3P.js";import{a as et}from"./chunk-MEQTML24.js";import{b as J,c as X,d as z}from"./chunk-D2WGDEJE.js";import{f as K}from"./chunk-GSQ5TTBU.js";import{a as k}from"./chunk-MCJA36VG.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-KLDIEE7M.js";import{a as I}from"./chunk-BF7B4FIR.js";import{e as x}from"./chunk-GDY26PU3.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r0?new Array(c):void 0;for(let o=0;oI.PI){let e=t;t=o,o=e}if(!(a.longitudeo))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;ri.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e=0&&e!==a&&o.lengthr.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T