import{aas_}from"./chunk-AKRPIQPN.js";import{aaste}from"./chunk-P73YILG6.js";import{aasfe,basj,fasZ,gasme}from"./chunk-7YEOLR2L.js";import{aase,basie,casee,easO}from"./chunk-RH3GFHG2.js";import{aasQ}from"./chunk-FRWNWNYJ.js";import{aasse}from"./chunk-TA3RE4KQ.js";import{aasle}from"./chunk-RTY3VPG6.js";import{eas$}from"./chunk-LRNH5AEO.js";varSe={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Se);varue={};functionP(r,n){if(!$(r))thrownewle("identifier is required.");$(ue[r])||(ue[r]=!0,console.warn(se(n,r)))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";varhe=P;varw=[newe,newe],Te=newe,Be=newe,Ce=newe,ze=newe,Ae=newe,be=newe,Oe=newe,ve=newe,De=newe,I=newe,W=newe,R={},re=newie;functionje(r,n){leta=newArray(r.length);for(leto=0;o<r.length;o++){lett=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}returna}functionne(r,n,a,o){lett=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=newArray(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;returnm.push(a),m}letd=(a-n)/l;for(s=1;s<l;s++){letx=n+s*d;m[s]=x}returnm[0]=n,m.push(a),m}varX=newe,Y=newe;functionHe(r,n,a,o){lett=newte(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);returnf.x*c.y-f.y*c.x>=0?-l:l}varMe=newe(-1,0,0),H=newj,Ve=newj,oe=newO,Ne=O.IDENTITY.clone(),Fe=newe,Ge=newfe,de=newe;functionv(r,n,a,o,t,c,f,l){letm=Fe,s=Ge;H=me.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,Me,m),m=e.normalize(m,m);letS=He(m,n,r,t);oe=O.fromRotationZ(S,oe),de.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,de,Ve),H);letd=Ne;d[0]=f;for(letx=0;x<l;x++)for(leti=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);returno}varIe=newe;functionce(r,n,a,o,t,c,f){for(letl=0;l<r.length;l+=3){letm=e.fromArray(r,l,Ie);o=v(m,n,a,o,t,c[l/3],f,1)}returno}functionLe(r,n){leta=r.length,o=newArray(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(letm=1;m<a;m++){l=r[m];lets=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}returnl=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}functionge(r,n){leta=r.length,o=newArray(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(letl=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;returno}varye=newZ,we=newe,pe=newO;functionxe(r,n,a,o,t,c,f,l,m,s){letS=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ye),pe):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ye),pe);leti,g;if(n=e.clone(n,we),d>0){letD=s?2:1;for(lety=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}elsei=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,we),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);returnf}R.removeDuplicatesFromShape=function(r){letn=r.length,a=[];for(leto=n-1,t=0;t<n;o=t++){letc=r[o],f=r[t];ee.equals(c,f)||a.push(f)}returna};R.angleIsGreaterThanPi=function(r,n,a,o){lett=newte(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);returnf.x*c.y-