/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.110.1 * * 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 M}from"./chunk-LEGXNNON.js";import{a as st}from"./chunk-54EUFFXI.js";import{a as Z,b as H}from"./chunk-P2SABSEB.js";import{a as V}from"./chunk-FO3UCCVP.js";import{a as U}from"./chunk-GTKXIG42.js";import{b as it}from"./chunk-EVUMPJJC.js";import{a as ct}from"./chunk-BXMC6F3B.js";import{a as ot}from"./chunk-EUSUDYW7.js";import{a as nt}from"./chunk-XYZU5ZKW.js";import{b as K,c as X,d as z}from"./chunk-ADEEKX5Q.js";import{f as J}from"./chunk-O5E7EBKP.js";import{d as A}from"./chunk-GMFQULD7.js";import{a as k}from"./chunk-IS523WNE.js";import{a as w,b as q,c as et,d as F}from"./chunk-4ZQSV4FU.js";import{a as I}from"./chunk-CLQ5X6HS.js";import{a as tt}from"./chunk-FOJGNIAW.js";import{e as x}from"./chunk-BQUQ5TPM.js";function dt(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var rt=dt;function R(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(R.prototype,{length:{get:function(){return this._length}}});R.prototype.enqueue=function(n){this._array.push(n),this._length++};R.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};R.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};R.prototype.contains=function(n){return this._array.indexOf(n)!==-1};R.prototype.clear=function(){this._array.length=this._offset=this._length=0};R.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=R;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,c=[n];for(;c.length>0;){let r=c.pop();if(!x(r))continue;u+=2;let a=r.positions,t=r.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=r.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 s=0;s0?new Array(r):void 0;for(let o=0;oI.PI){let e=t;t=o,o=e}if(!(a.longitudeo))return u.cartographicToCartesian(a)}function Et(n,i,u,c){if(c===M.RHUMB)return Tt(n,i,u);let r=it.lineSegmentPlane(n,i,ct.ORIGIN_XY_PLANE);if(x(r))return u.scaleToGeodeticSurface(r,r)}var vt=new q;function Ct(n,i,u){let c=[],r,a,t,o,e,s=0;for(;si.cartesianToCartographic(h,vt).longitude;if(t===0)c.push({position:s,type:t,visited:!1,next:o,theta:l(r)});else if(o!==0){if(e=Et(r,a,i,u),++s,!x(e))continue;n.splice(s,0,e),c.push({position:s,type:t,visited:!1,next:o,theta:l(e)})}++s}return c}function lt(n,i,u,c,r,a,t){let o=[],e=a,s=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=c.findIndex(s(e)),g=c[f];if(!x(g)){++e;continue}let{visited:m,type:p,next:d}=g;if(g.visited=!0,p===0){if(d===0){let C=c[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&d>0||a===e&&!t&&d<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),S=c[L];if(!x(S)){++e;continue}e=S.position}while(e=0&&e!==a&&o.lengths.theta-l.theta);let e=t[0].z>=0;r=lt(c,r,t,o,1,0,e)}return c};b.polygonsFromHierarchy=function(n,i,u,c,r,a){let t=[],o=[],e=new $;e.enqueue(n);let s=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,g,m;if(c)for(m=h.length,g=0;g1){for(let v of P)e.enqueue(new rt(v,f));continue}}let L=h.slice(),S=x(f)?f.length:0,C=[],T;for(g=0;g