var ln=Object.defineProperty,cn=Object.defineProperties;var un=Object.getOwnPropertyDescriptors;var mt=Object.getOwnPropertySymbols;var hn=Object.prototype.hasOwnProperty,fn=Object.prototype.propertyIsEnumerable;var We=(t,e)=>{if(e=Symbol[t])return e;throw Error("Symbol."+t+" is not defined")};var Fe=(t,e,n)=>e in t?ln(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,he=(t,e)=>{for(var n in e||(e={}))hn.call(e,n)&&Fe(t,n,e[n]);if(mt)for(var n of mt(e))fn.call(e,n)&&Fe(t,n,e[n]);return t},fe=(t,e)=>cn(t,un(e));var A=(t,e,n)=>(Fe(t,typeof e!="symbol"?e+"":e,n),n);var He=(t,e,n)=>new Promise((i,s)=>{var r=h=>{try{o(n.next(h))}catch(d){s(d)}},c=h=>{try{o(n.throw(h))}catch(d){s(d)}},o=h=>h.done?i(h.value):Promise.resolve(h.value).then(r,c);o((n=n.apply(t,e)).next())}),dn=function(t,e){this[0]=t,this[1]=e};var vt=t=>{var e=t[We("asyncIterator")],n=!1,i,s={};return e==null?(e=t[We("iterator")](),i=r=>s[r]=c=>e[r](c)):(e=e.call(t),i=r=>s[r]=c=>{if(n){if(n=!1,r==="throw")throw c;return c}return n=!0,{done:!1,value:new dn(new Promise(o=>{var h=e[r](c);if(!(h instanceof Object))throw TypeError("Object expected");o(h)}),1)}}),s[We("iterator")]=()=>s,i("next"),"throw"in e?i("throw"):s.throw=r=>{throw r},"return"in e&&i("return"),s};import{X as pn,Y as mn,S as vn,Z as gn,_ as wn,$ as yn,a0 as Ye,a1 as Sn,a2 as En,b as oe,C as Ke,V as k,a3 as xn,G as ye,a as Se,D as An,a4 as Mn,z as st,w as Be,m as kt,a5 as Wt,a6 as G,J as rt,y as Ft,O as ot,a7 as at,a8 as Pn,P as Cn,A as bn,t as Ln,a9 as On,aa as lt,ab as zn,I as gt,ac as Qe,ad as de,ae as Dn,af as Ht,ag as Te,ah as Re,ai as Yt,aj as Bn,ak as Ge,al as Tn,am as Rn,L as _n,x as Un,T as In,E as Nn,an as jn}from"./screen2Standard-03f7f908-1786807848259.js";import{E as ct,q as Vt}from"./TopicSwitcher-c91bad20-1786807848259.js";import{k as Gn,a8 as kn}from"./index-1786807848259.js";function Wn(t){let e=null,n=!1,i=!1;function s(){!n||i||(t(),e=requestAnimationFrame(s))}function r(){n||(n=!0,s())}function c(){n&&(n=!1,i=!0,cancelAnimationFrame(e))}function o(){!n&&i&&(n=!0,i=!1,s())}return{start:r,pause:c,resume:o,isActive:()=>n}}class Fn extends ct{constructor({canvas:e,config:n={}}){super(),this.canvas=e,this.config=n||{},this.maxPixelRatio=Number(this.config.maxPixelRatio)||2,this.handleResize=()=>{this.init(),this.emit("resize")},this.init(),window.addEventListener("resize",this.handleResize)}init(){var i;const e=((i=this.canvas)==null?void 0:i.parentNode)||this.canvas||document.documentElement;this.width=e.offsetWidth||window.innerWidth||1,this.height=e.offsetHeight||window.innerHeight||1;const n=Number(this.config.maxPixelRatio)||this.maxPixelRatio||2;this.maxPixelRatio=n,this.pixelRatio=Math.min(window.devicePixelRatio||1,n)}destroy(){window.removeEventListener("resize",this.handleResize),this.off("resize")}}class Hn extends ct{constructor(){super(),this.start=Date.now(),this.current=this.start,this.elapsed=0,this.delta=16,this.clock=new pn,this.raf=Wn(()=>this.tick()),this.raf.start()}tick(){const e=Date.now();this.delta=e-this.current,this.current=e,this.elapsed=this.current-this.start;const n=this.clock.getDelta(),i=this.clock.getElapsedTime();this.emit("tick",n,i)}destroy(){this.pause(),this.off("tick")}pause(){this.raf.pause()}resume(){this.raf.resume()}isActive(){this.raf.isActive()}}function Yn(t=10,e=62){var n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=[],s;if(e=e||n.length,t)for(s=0;sVn(typeof t=="string"?JSON.parse(t):t);function Vn(t){var n,i,s,r;let e=(t==null?void 0:t.features)||[];for(let c=0;c{this.canvas.style.cursor="grabbing"},this.handlePointerUp=()=>{this.canvas.style.cursor="grab"},this.canvas.style.cursor="grab",this.canvas.style.touchAction="none",this.canvas.addEventListener("pointerdown",this.handlePointerDown),window.addEventListener("pointerup",this.handlePointerUp),this.canvas.addEventListener("pointerleave",this.handlePointerUp))}resize(){let e=this.sizes.width/this.sizes.height;if(this.options.isOrthographic){let n=120;this.instance.left=-n*e,this.instance.right=n*e,this.instance.top=n,this.instance.bottom=-n}else this.instance.aspect=e;this.instance.updateProjectionMatrix()}update(){this.controls.update()}destroy(){var e,n,i,s;(n=(e=this.canvas)==null?void 0:e.removeEventListener)==null||n.call(e,"pointerdown",this.handlePointerDown),(s=(i=this.canvas)==null?void 0:i.removeEventListener)==null||s.call(i,"pointerleave",this.handlePointerUp),window.removeEventListener("pointerup",this.handlePointerUp),this.controls.dispose()}}class Xn{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let i=0;for(let s=0;s0){for(c=e[--n];n>0&&(i=c,s=e[--n],c=i+s,r=s-(c-i),!r););n>0&&(r<0&&e[n-1]<0||r>0&&e[n-1]>0)&&(s=r*2,i=c+s,s==i-c&&(c=i))}return c}}function*Kn(t){for(const e of t)yield*vt(e)}function Jt(t){return Array.from(Kn(t))}var B=1e-6,Qn=1e-12,b=Math.PI,q=b/2,wt=b/4,Z=b*2,Q=180/b,N=b/180,R=Math.abs,qt=Math.atan,Ee=Math.atan2,U=Math.cos,$n=Math.exp,Zn=Math.log,I=Math.sin,ei=Math.sign||function(t){return t>0?1:t<0?-1:0},ke=Math.sqrt,ti=Math.tan;function ni(t){return t>1?0:t<-1?b:Math.acos(t)}function xe(t){return t>1?q:t<-1?-q:Math.asin(t)}function ge(){}function Ue(t,e){t&&St.hasOwnProperty(t.type)&&St[t.type](t,e)}var yt={Feature:function(t,e){Ue(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,s=n.length;++ib&&(t-=Math.round(t/Z)*Z),[t,e]}nt.invert=nt;function Xt(t,e,n){return(t%=Z)?e||n?tt(At(t),Mt(e,n)):At(t):e||n?Mt(e,n):nt}function xt(t){return function(e,n){return e+=t,R(e)>b&&(e-=Math.round(e/Z)*Z),[e,n]}}function At(t){var e=xt(t);return e.invert=xt(-t),e}function Mt(t,e){var n=U(t),i=I(t),s=U(e),r=I(e);function c(o,h){var d=U(h),a=U(o)*d,l=I(o)*d,u=I(h),p=u*n+a*i;return[Ee(l*s-p*r,a*n-u*i),xe(p*s+l*r)]}return c.invert=function(o,h){var d=U(h),a=U(o)*d,l=I(o)*d,u=I(h),p=u*s-l*r;return[Ee(l*s+u*r,a*n+p*i),xe(p*n-a*i)]},c}function si(t){t=Xt(t[0]*N,t[1]*N,t.length>2?t[2]*N:0);function e(n){return n=t(n[0]*N,n[1]*N),n[0]*=Q,n[1]*=Q,n}return e.invert=function(n){return n=t.invert(n[0]*N,n[1]*N),n[0]*=Q,n[1]*=Q,n},e}function ri(t,e,n,i,s,r){if(n){var c=U(e),o=I(e),h=i*n;s==null?(s=e+i*Z,r=e-h/2):(s=Pt(c,s),r=Pt(c,r),(i>0?sr)&&(s+=i*Z));for(var d,a=s;i>0?a>r:a1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function _e(t,e){return R(t[0]-e[0])=0;--o)s.point((l=a[o])[0],l[1]);else i(u.x,u.p.x,-1,s);u=u.p}u=u.o,a=u.z,p=!p}while(!u.v);s.lineEnd()}}}function Ct(t){if(e=t.length){for(var e,n=0,i=t[0],s;++n=0?1:-1,T=z*O,M=T>b,Y=f*P;if(h.add(Ee(Y*z*I(T),E*L+Y*U(T))),c+=M?O+z*Z:O,M^m>=n^w>=n){var _=Ie(pe(p),pe(y));et(_);var D=Ie(r,_);et(D);var v=(M^O>=0?-1:1)*xe(D[2]);(i>v||i===v&&(_[0]||_[1]))&&(o+=M^O>=0?1:-1)}}return(c<-B||c0){for(h||(s.polygonStart(),h=!0),s.lineStart(),P=0;P1&&w&2&&x.push(x.pop().concat(x.shift())),a.push(x.filter(ai))}}return u}}function ai(t){return t.length>1}function li(t,e){return((t=t.x)[0]<0?t[1]-q-B:q-t[1])-((e=e.x)[0]<0?e[1]-q-B:q-e[1])}const bt=$t(function(){return!0},ci,hi,[-b,-q]);function ci(t){var e=NaN,n=NaN,i=NaN,s;return{lineStart:function(){t.lineStart(),s=1},point:function(r,c){var o=r>0?b:-b,h=R(r-e);R(h-b)0?q:-q),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(o,n),t.point(r,n),s=0):i!==o&&h>=b&&(R(e-i)B?qt((I(e)*(r=U(i))*I(n)-I(i)*(s=U(e))*I(t))/(s*r*c)):(e+i)/2}function hi(t,e,n,i){var s;if(t==null)s=n*q,i.point(-b,s),i.point(0,s),i.point(b,s),i.point(b,0),i.point(b,-s),i.point(0,-s),i.point(-b,-s),i.point(-b,0),i.point(-b,s);else if(R(t[0]-e[0])>B){var r=t[0]0,s=R(e)>B;function r(a,l,u,p){ri(p,t,n,u,a,l)}function c(a,l){return U(a)*U(l)>e}function o(a){var l,u,p,m,g;return{lineStart:function(){m=p=!1,g=1},point:function(f,E){var S=[f,E],y,w=c(f,E),x=i?w?0:d(f,E):w?d(f+(f<0?b:-b),E):0;if(!l&&(m=p=w)&&a.lineStart(),w!==p&&(y=h(l,S),(!y||_e(l,y)||_e(S,y))&&(S[2]=1)),w!==p)g=0,w?(a.lineStart(),y=h(S,l),a.point(y[0],y[1])):(y=h(l,S),a.point(y[0],y[1],2),a.lineEnd()),l=y;else if(s&&l&&i^w){var P;!(x&u)&&(P=h(S,l,!0))&&(g=0,i?(a.lineStart(),a.point(P[0][0],P[0][1]),a.point(P[1][0],P[1][1]),a.lineEnd()):(a.point(P[1][0],P[1][1]),a.lineEnd(),a.lineStart(),a.point(P[0][0],P[0][1],3)))}w&&(!l||!_e(l,S))&&a.point(S[0],S[1]),l=S,p=w,u=x},lineEnd:function(){p&&a.lineEnd(),l=null},clean:function(){return g|(m&&p)<<1}}}function h(a,l,u){var p=pe(a),m=pe(l),g=[1,0,0],f=Ie(p,m),E=Pe(f,f),S=f[0],y=E-S*S;if(!y)return!u&&a;var w=e*E/y,x=-e*S/y,P=Ie(g,f),L=Ce(g,w),O=Ce(f,x);Ve(L,O);var z=P,T=Pe(L,z),M=Pe(z,z),Y=T*T-M*(Pe(L,L)-1);if(!(Y<0)){var _=ke(Y),D=Ce(z,(-T-_)/M);if(Ve(D,L),D=Ze(D),!u)return D;var v=a[0],C=l[0],j=a[1],V=l[1],$;C0^D[1]<(R(D[0]-v)b^(v<=D[0]&&D[0]<=C)){var re=Ce(z,(-T+_)/M);return Ve(re,L),[D,Ze(re)]}}}function d(a,l){var u=i?t:b-t,p=0;return a<-u?p|=1:a>u&&(p|=2),l<-u?p|=4:l>u&&(p|=8),p}return $t(c,o,r,i?[0,-t]:[-b,t-b])}function di(t,e,n,i,s,r){var c=t[0],o=t[1],h=e[0],d=e[1],a=0,l=1,u=h-c,p=d-o,m;if(m=n-c,!(!u&&m>0)){if(m/=u,u<0){if(m0){if(m>l)return;m>a&&(a=m)}if(m=s-c,!(!u&&m<0)){if(m/=u,u<0){if(m>l)return;m>a&&(a=m)}else if(u>0){if(m0)){if(m/=p,p<0){if(m0){if(m>l)return;m>a&&(a=m)}if(m=r-o,!(!p&&m<0)){if(m/=p,p<0){if(m>l)return;m>a&&(a=m)}else if(p>0){if(m0&&(t[0]=c+a*u,t[1]=o+a*p),l<1&&(e[0]=c+l*u,e[1]=o+l*p),!0}}}}}var we=1e9,Le=-we;function pi(t,e,n,i){function s(d,a){return t<=d&&d<=n&&e<=a&&a<=i}function r(d,a,l,u){var p=0,m=0;if(d==null||(p=c(d,l))!==(m=c(a,l))||h(d,a)<0^l>0)do u.point(p===0||p===3?t:n,p>1?i:e);while((p=(p+l+4)%4)!==m);else u.point(a[0],a[1])}function c(d,a){return R(d[0]-t)0?0:3:R(d[0]-n)0?2:1:R(d[1]-e)0?1:0:a>0?3:2}function o(d,a){return h(d.x,a.x)}function h(d,a){var l=c(d,1),u=c(a,1);return l!==u?l-u:l===0?a[1]-d[1]:l===1?d[0]-a[0]:l===2?d[1]-a[1]:a[0]-d[0]}return function(d){var a=d,l=Kt(),u,p,m,g,f,E,S,y,w,x,P,L={point:O,lineStart:Y,lineEnd:_,polygonStart:T,polygonEnd:M};function O(v,C){s(v,C)&&a.point(v,C)}function z(){for(var v=0,C=0,j=p.length;Ci&&(Me-ae)*(i-re)>(ue-re)*(t-ae)&&++v:ue<=i&&(Me-ae)*(i-re)<(ue-re)*(t-ae)&&--v;return v}function T(){a=l,u=[],p=[],P=!0}function M(){var v=z(),C=P&&v,j=(u=Jt(u)).length;(C||j)&&(d.polygonStart(),C&&(d.lineStart(),r(null,null,1,d),d.lineEnd()),j&&Qt(u,o,v,r,d),d.polygonEnd()),a=d,u=p=m=null}function Y(){L.point=D,p&&p.push(m=[]),x=!0,w=!1,S=y=NaN}function _(){u&&(D(g,f),E&&w&&l.rejoin(),u.push(l.result())),L.point=O,w&&a.lineEnd()}function D(v,C){var j=s(v,C);if(p&&m.push([v,C]),x)g=v,f=C,E=j,x=!1,j&&(a.lineStart(),a.point(v,C));else if(j&&w)a.point(v,C);else{var V=[S=Math.max(Le,Math.min(we,S)),y=Math.max(Le,Math.min(we,y))],$=[v=Math.max(Le,Math.min(we,v)),C=Math.max(Le,Math.min(we,C))];di(V,$,t,e,n,i)?(w||(a.lineStart(),a.point(V[0],V[1])),a.point($[0],$[1]),j||a.lineEnd(),P=!1):j&&(a.lineStart(),a.point(v,C),P=!1)}S=v,y=C,w=j}return L}}const Lt=t=>t;var me=1/0,Ne=me,Ae=-me,je=Ae,mi={point:vi,lineStart:ge,lineEnd:ge,polygonStart:ge,polygonEnd:ge,result:function(){var t=[[me,Ne],[Ae,je]];return Ae=je=-(Ne=me=1/0),t}};function vi(t,e){tAe&&(Ae=t),eje&&(je=e)}const Ot=mi;function ht(t){return function(e){var n=new it;for(var i in t)n[i]=t[i];return n.stream=e,n}}function it(){}it.prototype={constructor:it,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function ft(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),i!=null&&t.clipExtent(null),ii(n,t.stream(Ot)),e(Ot.result()),i!=null&&t.clipExtent(i),t}function Zt(t,e,n){return ft(t,function(i){var s=e[1][0]-e[0][0],r=e[1][1]-e[0][1],c=Math.min(s/(i[1][0]-i[0][0]),r/(i[1][1]-i[0][1])),o=+e[0][0]+(s-c*(i[1][0]+i[0][0]))/2,h=+e[0][1]+(r-c*(i[1][1]+i[0][1]))/2;t.scale(150*c).translate([o,h])},n)}function gi(t,e,n){return Zt(t,[[0,0],e],n)}function wi(t,e,n){return ft(t,function(i){var s=+e,r=s/(i[1][0]-i[0][0]),c=(s-r*(i[1][0]+i[0][0]))/2,o=-r*i[0][1];t.scale(150*r).translate([c,o])},n)}function yi(t,e,n){return ft(t,function(i){var s=+e,r=s/(i[1][1]-i[0][1]),c=-r*i[0][0],o=(s-r*(i[1][1]+i[0][1]))/2;t.scale(150*r).translate([c,o])},n)}var zt=16,Si=U(30*N);function Dt(t,e){return+e?xi(t,e):Ei(t)}function Ei(t){return ht({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function xi(t,e){function n(i,s,r,c,o,h,d,a,l,u,p,m,g,f){var E=d-i,S=a-s,y=E*E+S*S;if(y>4*e&&g--){var w=c+u,x=o+p,P=h+m,L=ke(w*w+x*x+P*P),O=xe(P/=L),z=R(R(P)-1)e||R((E*_+S*D)/y-.5)>.3||c*u+o*p+h*m2?v[2]%360*N:0,_()):[o*Q,h*Q,d*Q]},M.angle=function(v){return arguments.length?(l=v%360*N,_()):l*Q},M.reflectX=function(v){return arguments.length?(u=v?-1:1,_()):u<0},M.reflectY=function(v){return arguments.length?(p=v?-1:1,_()):p<0},M.precision=function(v){return arguments.length?(P=Dt(L,x=v*v),D()):ke(x)},M.fitExtent=function(v,C){return Zt(M,v,C)},M.fitSize=function(v,C){return gi(M,v,C)},M.fitWidth=function(v,C){return wi(M,v,C)},M.fitHeight=function(v,C){return yi(M,v,C)};function _(){var v=Bt(n,0,0,u,p,l).apply(null,e(r,c)),C=Bt(n,i-v[0],s-v[1],u,p,l);return a=Xt(o,h,d),L=tt(e,C),O=tt(a,L),P=Dt(L,x),D()}function D(){return z=T=null,M}return function(){return e=t.apply(this,arguments),M.invert=e.invert&&Y,_()}}function dt(t,e){return[t,Zn(ti((q+e)/2))]}dt.invert=function(t,e){return[t,2*qt($n(e))-q]};function pt(){return Li(dt).scale(961/Z)}function Li(t){var e=Ci(t),n=e.center,i=e.scale,s=e.translate,r=e.clipExtent,c=null,o,h,d;e.scale=function(l){return arguments.length?(i(l),a()):i()},e.translate=function(l){return arguments.length?(s(l),a()):s()},e.center=function(l){return arguments.length?(n(l),a()):n()},e.clipExtent=function(l){return arguments.length?(l==null?c=o=h=d=null:(c=+l[0][0],o=+l[0][1],h=+l[1][0],d=+l[1][1]),a()):c==null?null:[[c,o],[h,d]]};function a(){var l=b*i(),u=e(si(e.rotate()).invert([0,0]));return r(c==null?[[u[0]-l,u[1]-l],[u[0]+l,u[1]+l]]:t===dt?[[Math.max(u[0]-l,c),o],[Math.min(u[0]+l,h),d]]:[[c,Math.max(u[1]-l,o)],[h,Math.min(u[1]+l,d)]])}return a()}class Ki extends ct{constructor(e,n={}){var s,r;super();let i={isOrthographic:!1};this.config=Object.assign({},i,n),this.canvas=e,this.scene=new Sn,this.sizes=new Fn(this),this.time=new Hn(this),this.camera=new qn(this,{isOrthographic:this.config.isOrthographic}),this.renderer=new Jn(this),this.handleControlsChange=()=>{var c,o,h;this.renderer.update(),(o=(c=this.label3d)==null?void 0:c.update)==null||o.call(c),(h=this.updateTownLabelScale)==null||h.call(this)},(r=(s=this.camera.controls)==null?void 0:s.addEventListener)==null||r.call(s,"change",this.handleControlsChange),this.sizes.on("resize",()=>{this.resize()}),this.time.on("tick",c=>{this.update(c)})}setAxesHelper(e=250){if(!e)return!1;let n=new En(e);this.scene.add(n)}resize(){this.camera.resize(),this.renderer.resize()}update(e){this.camera.update(e),this.renderer.update(e)}destroy(){var e,n,i,s;(n=(e=this.camera.controls)==null?void 0:e.removeEventListener)==null||n.call(e,"change",this.handleControlsChange),this.sizes.destroy(),this.time.destroy(),this.camera.destroy(),this.renderer.destroy(),this.scene.traverse(r=>{if(r instanceof oe){r.geometry.dispose();for(const c in r.material){const o=r.material[c];o&&typeof o.dispose=="function"&&o.dispose()}}}),(s=(i=this.canvas)==null?void 0:i.parentNode)==null||s.removeChild(this.canvas)}}class Qi{constructor({material:e,time:n,size:i,diffuseColor:s,diffuseSpeed:r,diffuseWidth:c,callback:o=()=>{}}){this.time=n,this.pointShader=null,this.callback=o;let h={size:100,diffuseSpeed:15,diffuseColor:9345950,diffuseWidth:10};this.options=Object.assign({},h,{material:e,size:i,diffuseColor:s,diffuseSpeed:r,diffuseWidth:c}),this.init()}init(){let{material:e,size:n,diffuseColor:i,diffuseSpeed:s,diffuseWidth:r}=this.options,c=n/s;e.onBeforeCompile=o=>{this.pointShader=o,this.callback(o,c),o.uniforms=fe(he({},o.uniforms),{uTime:{value:0},uSpeed:{value:s},uWidth:{value:r},uColor:{value:new Ke(i)}}),o.vertexShader=o.vertexShader.replace("void main() {",` varying vec3 vPosition; void main(){ vPosition = position; `),o.fragmentShader=o.fragmentShader.replace("void main() {",` uniform float uTime; uniform float uSpeed; uniform float uWidth; uniform vec3 uColor; varying vec3 vPosition; void main(){ `),o.fragmentShader=o.fragmentShader.replace("#include ",` #ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif float r = uTime * uSpeed; float w = uWidth; // if(w>uWidth){ // w = uWidth; // }else{ // w = uTime * 1.5; // } vec2 center = vec2(0.0, 0.0); float rDistance = distance(vPosition.xy, center); if(rDistance > r && rDistance < r + 2.0 * w) { float per = 0.0; if(rDistance < r + w) { float p = smoothstep(0.0,1.0,(rDistance - r) / w); p*=p; outgoingLight = mix(outgoingLight, uColor, p); } else { float p = smoothstep(0.0,1.0,(rDistance - r - w) / w); outgoingLight = mix(uColor, outgoingLight, p); } gl_FragColor = vec4(outgoingLight, diffuseColor.a); } else { gl_FragColor = vec4(outgoingLight, 0.0); } `)}}}class $i{constructor({scene:e,time:n},i){this.scene=e,this.time=n,this.instance=null;let s={position:new k(0,0,0),gridSize:100,gridDivision:20,gridColor:2635578,shapeSize:1,shapeColor:9345950,pointSize:.2,pointColor:2635578,pointLayout:{row:200,col:200},pointBlending:xn};this.options=Object.assign({},s,i),this.init()}init(){let e=new ye;e.name="Grid";let n=this.createGridHelp(),i=this.createShapes(),s=this.createPoint();e.add(n,i,s),e.position.copy(this.options.position),this.instance=e,this.scene.add(e)}createShapes(){let{gridSize:e,gridDivision:n,shapeSize:i,shapeColor:s}=this.options,r=e/n,c=e/2,o=new Se({color:s,side:An}),h=[];for(let l=0;l{this.update()}),this.sizes.on("resize",()=>{this.resize()})}create(e="",n="",i=!1){let s=document.createElement("div");s.innerHTML=e,s.className=n,s.style.visibility="hidden",s.style.position="absolute",n||(s.style.padding="10px",s.style.color="#fff",s.style.fontSize="12px",s.style.textAlign="center",s.style.background="rgba(0,0,0,0.6)",s.style.borderRadius="4px");let r=null;return i?r=new zi(s):r=new en(s),r.init=(c,o)=>{r.element.innerHTML=c,r.element.style.visibility="visible",r.position.copy(o)},r.hide=()=>{r.element.style.visibility="hidden"},r.scaleHide=()=>{r.element.classList.add("scale-hidden")},r.show=()=>{r.element.style.visibility="visible",r.element.classList.remove("scale-hidden")},r.setParent=c=>{this.parent=c,c.add(r)},r.remove=()=>{this.parent.remove(r)},r}setLabelStyle(e,n=.1,i="x",s=Math.PI/2,r="none"){e.element.style.pointerEvents=r,e.scale.set(n,n,n),e.rotation[i]=s}setRenderLevel(e){this.css3dRender.domElement.style.zIndex=e}update(){this.css3dRender.render(this.scene,this.camera.instance)}destroy(){if(this.css3dRender){let e=this.css3dRender.domElement;e.parentNode.removeChild(e)}}resize(){let{width:e,height:n}=this.sizes;this.css3dRender.setSize(e,n)}}class es{constructor({time:e},n){this.time=e,this.options=Object.assign({},{width:10,scale:1,position:new k(0,0,0),needRotate:!1,rotateSpeed:.001,material:new Se({transparent:!0,opacity:1,depthTest:!0})},n);let i=new Cn(this.options.width,this.options.width),s=new oe(i,this.options.material);s.position.copy(this.options.position),s.scale.set(this.options.scale,this.options.scale,this.options.scale),this.instance=s}setParent(e){e.add(this.instance),this.time.on("tick",()=>{this.update()})}update(){this.options.needRotate&&(this.instance.rotation.z+=this.options.rotateSpeed)}}class tn{constructor({time:e},n={}){this.instance=null,this.time=e,this.enable=!0,this.config=Object.assign({num:100,range:500,speed:.01,renderOrder:99,dir:"up",material:new kt({map:tn.createTexture(),size:20,color:16777215,transparent:!0,opacity:1,depthTest:!1,vertexColors:!0,blending:bn,sizeAttenuation:!0})},n),this.create()}create(){const{range:e,speed:n,dir:i,material:s,num:r,renderOrder:c}=this.config,o=[],h=[],d=[];for(let l=0;li/2&&c===1&&(u=-i/2),u<-i/2&&c==-1&&(u=i/2),o.setX(a,l),o.setZ(a,u),h.setX(a,p),h.setY(a,m)}o.needsUpdate=!0,h.needsUpdate=!0}setParent(e){e.add(this.instance),this.time.on("tick",(n,i)=>{this.enable&&this.update(n,i)})}}class ts{constructor({},e={}){this.mapGroup=new ye,this.coordinates=[],this.config=Object.assign({position:new k(0,0,0),geoProjectionCenter:new G(0,0),geoProjectionScale:120,data:"",renderOrder:1,merge:!1,material:new Se({color:1582651,transparent:!0,opacity:1})},e),this.mapGroup.position.copy(this.config.position);let n=ut(this.config.data);this.create(n)}geoProjection(e){return pt().center(this.config.geoProjectionCenter).scale(this.config.geoProjectionScale).translate([0,0])(e)}create(e){let{merge:n}=this.config,i=[];if(e.features.forEach(s=>{const r=new ot;let{name:c,center:o=[],centroid:h=[]}=s.properties;this.coordinates.push({name:c,center:o,centroid:h}),r.userData.name=c,s.geometry.coordinates.forEach(d=>{d.forEach(a=>{const l=new rt;for(let p=0;p{var d,a,l;const i=new ot;let{name:s,center:r=[],centroid:c=[]}=n.properties;this.coordinates.push({name:s,center:r,centroid:c});const o={depth:this.config.depth,bevelEnabled:(d=this.config.bevelEnabled)!=null?d:!0,bevelSegments:(a=this.config.bevelSegments)!=null?a:1,bevelThickness:(l=this.config.bevelThickness)!=null?l:.1};let h=[this.config.topFaceMaterial,this.config.sideMaterial];n.geometry.coordinates.forEach(u=>{u.forEach((p,m)=>{const g=new rt;for(let S=0;S #include #include #include #include uniform float linewidth; uniform vec2 resolution; attribute vec3 instanceStart; attribute vec3 instanceEnd; attribute vec3 instanceColorStart; attribute vec3 instanceColorEnd; #ifdef WORLD_UNITS varying vec4 worldPos; varying vec3 worldStart; varying vec3 worldEnd; #ifdef USE_DASH varying vec2 vUv; #endif #else varying vec2 vUv; #endif #ifdef USE_DASH uniform float dashScale; attribute float instanceDistanceStart; attribute float instanceDistanceEnd; varying float vLineDistance; #endif void trimSegment( const in vec4 start, inout vec4 end ) { // trim end segment so it terminates between the camera plane and the near plane // conservative estimate of the near plane float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column float nearEstimate = - 0.5 * b / a; float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); end.xyz = mix( start.xyz, end.xyz, alpha ); } void main() { #ifdef USE_COLOR vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; #endif #ifdef USE_DASH vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; vUv = uv; #endif float aspect = resolution.x / resolution.y; // camera space vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); #ifdef WORLD_UNITS worldStart = start.xyz; worldEnd = end.xyz; #else vUv = uv; #endif // special case for perspective projection, and segments that terminate either in, or behind, the camera plane // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space // but we need to perform ndc-space calculations in the shader, so we must address this issue directly // perhaps there is a more elegant solution -- WestLangley bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column if ( perspective ) { if ( start.z < 0.0 && end.z >= 0.0 ) { trimSegment( start, end ); } else if ( end.z < 0.0 && start.z >= 0.0 ) { trimSegment( end, start ); } } // clip space vec4 clipStart = projectionMatrix * start; vec4 clipEnd = projectionMatrix * end; // ndc space vec3 ndcStart = clipStart.xyz / clipStart.w; vec3 ndcEnd = clipEnd.xyz / clipEnd.w; // direction vec2 dir = ndcEnd.xy - ndcStart.xy; // account for clip-space aspect ratio dir.x *= aspect; dir = normalize( dir ); #ifdef WORLD_UNITS vec3 worldDir = normalize( end.xyz - start.xyz ); vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) ); vec3 worldUp = normalize( cross( worldDir, tmpFwd ) ); vec3 worldFwd = cross( worldDir, worldUp ); worldPos = position.y < 0.5 ? start: end; // height offset float hw = linewidth * 0.5; worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp; // don't extend the line if we're rendering dashes because we // won't be rendering the endcaps #ifndef USE_DASH // cap extension worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir; // add width to the box worldPos.xyz += worldFwd * hw; // endcaps if ( position.y > 1.0 || position.y < 0.0 ) { worldPos.xyz -= worldFwd * 2.0 * hw; } #endif // project the worldpos vec4 clip = projectionMatrix * worldPos; // shift the depth of the projected points so the line // segments overlap neatly vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd; clip.z = clipPose.z * clip.w; #else vec2 offset = vec2( dir.y, - dir.x ); // undo aspect ratio adjustment dir.x /= aspect; offset.x /= aspect; // sign flip if ( position.x < 0.0 ) offset *= - 1.0; // endcaps if ( position.y < 0.0 ) { offset += - dir; } else if ( position.y > 1.0 ) { offset += dir; } // adjust for linewidth offset *= linewidth; // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... offset /= resolution.y; // select end vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; // back to clip space offset *= clip.w; clip.xy += offset; #endif gl_Position = clip; vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation #include #include #include } `,fragmentShader:` uniform vec3 diffuse; uniform float opacity; uniform float linewidth; #ifdef USE_DASH uniform float dashOffset; uniform float dashSize; uniform float gapSize; #endif varying float vLineDistance; #ifdef WORLD_UNITS varying vec4 worldPos; varying vec3 worldStart; varying vec3 worldEnd; #ifdef USE_DASH varying vec2 vUv; #endif #else varying vec2 vUv; #endif #include #include #include #include #include vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) { float mua; float mub; vec3 p13 = p1 - p3; vec3 p43 = p4 - p3; vec3 p21 = p2 - p1; float d1343 = dot( p13, p43 ); float d4321 = dot( p43, p21 ); float d1321 = dot( p13, p21 ); float d4343 = dot( p43, p43 ); float d2121 = dot( p21, p21 ); float denom = d2121 * d4343 - d4321 * d4321; float numer = d1343 * d4321 - d1321 * d4343; mua = numer / denom; mua = clamp( mua, 0.0, 1.0 ); mub = ( d1343 + d4321 * ( mua ) ) / d4343; mub = clamp( mub, 0.0, 1.0 ); return vec2( mua, mub ); } void main() { #include #ifdef USE_DASH if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX #endif float alpha = opacity; #ifdef WORLD_UNITS // Find the closest points on the view ray and the line segment vec3 rayEnd = normalize( worldPos.xyz ) * 1e5; vec3 lineDir = worldEnd - worldStart; vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd ); vec3 p1 = worldStart + lineDir * params.x; vec3 p2 = rayEnd * params.y; vec3 delta = p1 - p2; float len = length( delta ); float norm = len / linewidth; #ifndef USE_DASH #ifdef USE_ALPHA_TO_COVERAGE float dnorm = fwidth( norm ); alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm ); #else if ( norm > 0.5 ) { discard; } #endif #endif #else #ifdef USE_ALPHA_TO_COVERAGE // artifacts appear on some hardware if a derivative is taken within a conditional float a = vUv.x; float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; float len2 = a * a + b * b; float dlen = fwidth( len2 ); if ( abs( vUv.y ) > 1.0 ) { alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); } #else if ( abs( vUv.y ) > 1.0 ) { float a = vUv.x; float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; float len2 = a * a + b * b; if ( len2 > 1.0 ) discard; } #endif #endif vec4 diffuseColor = vec4( diffuse, alpha ); #include #include gl_FragColor = vec4( diffuseColor.rgb, alpha ); #include #include #include #include } `};class sn extends Bn{constructor(e){super({type:"LineMaterial",uniforms:Yt.clone(Re.line.uniforms),vertexShader:Re.line.vertexShader,fragmentShader:Re.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1))}}const Ut=new k,It=new k,W=new Ge,F=new Ge,te=new Ge,qe=new k,Xe=new at,H=new Tn,Nt=new k,ze=new lt,De=new Ht,ne=new Ge;let ie,ce;function jt(t,e,n){return ne.set(0,0,-e,1).applyMatrix4(t.projectionMatrix),ne.multiplyScalar(1/ne.w),ne.x=ce/n.width,ne.y=ce/n.height,ne.applyMatrix4(t.projectionMatrixInverse),ne.multiplyScalar(1/ne.w),Math.abs(Math.max(ne.x,ne.y))}function Ti(t,e){const n=t.matrixWorld,i=t.geometry,s=i.attributes.instanceStart,r=i.attributes.instanceEnd,c=Math.min(i.instanceCount,s.count);for(let o=0,h=c;ol&&F.z>l)continue;if(W.z>l){const y=W.z-F.z,w=(W.z-l)/y;W.lerp(F,w)}else if(F.z>l){const y=F.z-W.z,w=(F.z-l)/y;F.lerp(W,w)}W.applyMatrix4(i),F.applyMatrix4(i),W.multiplyScalar(1/W.w),F.multiplyScalar(1/F.w),W.x*=r.x/2,W.y*=r.y/2,F.x*=r.x/2,F.y*=r.y/2,H.start.copy(W),H.start.z=0,H.end.copy(F),H.end.z=0;const g=H.closestPointToPointParameter(qe,!0);H.at(g,Nt);const f=Rn.lerp(W.z,F.z,g),E=f>=-1&&f<=1,S=qe.distanceTo(Nt){const a=[];let l=null;n==="Line2"?(d[0].forEach(u=>{const[p,m]=this.geoProjection(u);a.push(p,-m,0)}),l=this.createLine2(a)):n==="Line3"?(d[0].forEach(u=>{const[p,m]=this.geoProjection(u);a.push(new k(p,-m,0))}),l=this.createLine3(a)):d[0].forEach(u=>{const[p,m]=this.geoProjection(u);a.push(new k(p,-m,0)),l=this.createLine(a)}),h.add(l)}),r.add(h))}return r}createLine3(e){const n=this.config.tubeRadius,i=256*10,s=4,r=!1,{material:c,renderOrder:o}=this.config,h=new Un(e),d=new In(h,i,n,s,r),a=new oe(d,c);return a.name="mapLine3",a.renderOrder=o,a}createLine2(e){const{material:n,renderOrder:i}=this.config,s=new rn;s.setPositions(e);let r=new Ui(s,n);return r.name="mapLine2",r.renderOrder=i,r.computeLineDistances(),r}createLine(e){const{material:n,renderOrder:i,type:s}=this.config,r=new st;r.setFromPoints(e);let c=new Nn(r,n);return c.renderOrder=i,c.name="mapLine",c}setParent(e){e.add(this.lineGroup)}}class ss{constructor(e,n){this.shader=null,this.config=Object.assign({uColor1:2781042,uColor2:860197,size:15,dir:"x"},n),this.init(e)}init(e){let{uColor1:n,uColor2:i,dir:s,size:r}=this.config,c={x:1,y:2,z:3};e.onBeforeCompile=o=>{this.shader=o,o.uniforms=fe(he({},o.uniforms),{uColor1:{value:new Ke(n)},uColor2:{value:new Ke(i)},uDir:{value:c[s]},uSize:{value:r}}),o.vertexShader=o.vertexShader.replace("void main() {",` attribute float alpha; varying vec3 vPosition; varying float vAlpha; void main() { vAlpha = alpha; vPosition = position; `),o.fragmentShader=o.fragmentShader.replace("void main() {",` varying vec3 vPosition; varying float vAlpha; uniform vec3 uColor1; uniform vec3 uColor2; uniform float uDir; uniform float uSize; void main() { `),o.fragmentShader=o.fragmentShader.replace("#include ",` #ifdef OPAQUE diffuseColor.a = 1.0; #endif // https://github.com/mrdoob/three.js/pull/22425 #ifdef USE_TRANSMISSION diffuseColor.a *= transmissionAlpha + 0.1; #endif // vec3 gradient = mix(uColor1, uColor2, vPosition.x / 15.0); vec3 gradient = vec3(0.0,0.0,0.0); if(uDir==1.0){ gradient = mix(uColor1, uColor2, vPosition.x/ uSize); }else if(uDir==2.0){ gradient = mix(uColor1, uColor2, vPosition.z/ uSize); }else if(uDir==3.0){ gradient = mix(uColor1, uColor2, vPosition.y/ uSize); } outgoingLight = outgoingLight * gradient; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); `)}}}const rs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAK+SURBVHgB7dzNbdswGIdxSugCRtGBuklWSO17nXs/J0hHywA11AEMu3wDsLFT5WCJ5PtI/D8nQ5cA/FmxJJLqtofhHBSmPihUAoElEFgCgfVu7ODX95suqOKNXVDpDIElEFgCgSUQWAKBJRBYAoE1G2Q3DJ/j9fRjUGE7DI+f4niEGc0CMYzzKezjx7vWUQwjnMJdF8djDsq8M+QYLu/om0VJGP8OXI/LTc0C+fJhs4/fiIeLQ82hvMaI/zEevsVxCROb/RvSMkpuDCvLVVaLKCUwrGyXvS2hlMKwst6HtIBSEsPKfmO4ZpTSGFaRO/U1otTAsIo9OlkTSi0Mq+izrDWg1MSwij9cXDJKbQyrytPeJaJ4YFjVHr8vCcULw6o6H7IEFE8Mq/oEFRnFG8NymTEkohAwLLcpXBIKBcNynVMnoJAwLPdFDp4oNAwLserEA4WIYXVjK7C9Vr+fY8Gh7e8/Lhha/f5GhDMjJRBYAoElEFgCgSUQWAKBJRBYAoElEFgCgSUQWAKBJRBYAoElEFgCgSUQWAKBJRBYAoElEFgCgSUQWAKBJZDwvIIQs2kIA/K81tYvzKYhBMh/75vyCYHiDgLBSLmjuIK8xrBV6J1HoO11biCk/Rmk7XUuIMTNMhSU6iDUnUsWAaUqCBkj5Y1SDWQJGClPlCogS8JIeaEUB1kiRsoDpSjIkjFStVGKgawBI1UTpQjImjBStVCyg6wRI1UDJSvImjFSpVGygbSAkSqJkgWkJYxUKZTZIC1ipEqgzAJpGSOVG2UyiDBeyokyCWR3OOyFcd0Yyu4wfA83Ngnk2Pe/ziE82WdhvHSJYuNz7MPPcGOTQH5sNk+nPnyMf/xeGNcZSvyS3tv42DiFG0O94q+19Iq/BSQQWAKBJRBYAoElEFgCgSUQWKM3hsovnSGwBAJLILAEAusvLK6Na4P/Au0AAAAASUVORK5CYII=";var Gt=class{constructor(t,e){A(this,"target");A(this,"name");A(this,"intersected");A(this,"wasIntersected",!1);A(this,"wasIntersectedOnMouseDown",!1);A(this,"distance");this.target=t,this.name=e,this.intersected=!1,this.distance=0}},J=class{constructor(t,e=null){A(this,"type");A(this,"cancelBubble");A(this,"originalEvent");A(this,"coords",new G(0,0));A(this,"distance",0);A(this,"intersected",!1);A(this,"wasIntersected",!1);A(this,"wasIntersectedOnMouseDown",!1);this.cancelBubble=!1,this.type=t,this.originalEvent=e}stopPropagation(){this.cancelBubble=!0}},os=class{constructor(t,e,n,i){A(this,"renderer");A(this,"camera");A(this,"domElement");A(this,"bindEventsOnBodyElement");A(this,"autoAdd");A(this,"scene");A(this,"mouse");A(this,"supportsPointerEvents");A(this,"interactiveObjects");A(this,"closestObject");A(this,"raycaster");A(this,"treatTouchEventsAsMouseEvents");A(this,"dispose",()=>{this.domElement.removeEventListener("click",this.onMouseClick),this.supportsPointerEvents&&(this.bindEventsOnBodyElement?this.domElement.ownerDocument.removeEventListener("pointermove",this.onDocumentPointerMove):this.domElement.removeEventListener("pointermove",this.onDocumentPointerMove),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointerup",this.onPointerUp)),this.bindEventsOnBodyElement?this.domElement.ownerDocument.removeEventListener("mousemove",this.onDocumentMouseMove):this.domElement.removeEventListener("mousemove",this.onDocumentMouseMove),this.domElement.removeEventListener("mousedown",this.onMouseDown),this.domElement.removeEventListener("mouseup",this.onMouseUp),this.domElement.removeEventListener("touchstart",this.onTouchStart),this.domElement.removeEventListener("touchmove",this.onTouchMove),this.domElement.removeEventListener("touchend",this.onTouchEnd)});A(this,"add",(t,e=[])=>{if(t&&!this.interactiveObjects.find(n=>n.target===t))if(e.length>0)e.forEach(n=>{let i=t.getObjectByName(n);if(i){let s=new Gt(i,n);this.interactiveObjects.push(s)}});else{let n=new Gt(t,t.name);this.interactiveObjects.push(n)}});A(this,"remove",(t,e=[])=>{!t||(e.length>0?e.forEach(n=>{let i=t.getObjectByName(n);i&&(this.interactiveObjects=this.interactiveObjects.filter(s=>s.target!==i))}):this.interactiveObjects=this.interactiveObjects.filter(n=>n.target!==t))});A(this,"update",()=>{var i;this.raycaster.setFromCamera(this.mouse,this.camera),this.interactiveObjects.forEach(s=>{s.target&&this.checkIntersection(s)}),this.interactiveObjects.sort(function(s,r){return s.distance-r.distance});let t=(i=this.interactiveObjects.find(s=>s.intersected))!=null?i:null;if(t!=this.closestObject){if(this.closestObject){let s=new J("mouseout");this.dispatch(this.closestObject,s)}if(t){let s=new J("mouseover");this.dispatch(t,s)}this.closestObject=t}let e;this.interactiveObjects.forEach(s=>{!s.intersected&&s.wasIntersected&&(e||(e=new J("mouseleave")),this.dispatch(s,e))});let n;this.interactiveObjects.forEach(s=>{s.intersected&&!s.wasIntersected&&(n||(n=new J("mouseenter")),this.dispatch(s,n))})});A(this,"checkIntersection",t=>{let e=this.raycaster.intersectObjects([t.target],!0);if(t.wasIntersected=t.intersected,e.length>0){let n=e[0].distance;e.forEach(i=>{i.distance{this.mapPositionToPoint(this.mouse,t.clientX,t.clientY);let e=new J("mousemove",t);this.interactiveObjects.forEach(n=>{this.dispatch(n,e)})});A(this,"onDocumentPointerMove",t=>{this.mapPositionToPoint(this.mouse,t.clientX,t.clientY);let e=new J("pointermove",t);this.interactiveObjects.forEach(n=>{this.dispatch(n,e)})});A(this,"onTouchMove",t=>{t.touches.length>0&&this.mapPositionToPoint(this.mouse,t.touches[0].clientX,t.touches[0].clientY);let e=new J(this.treatTouchEventsAsMouseEvents?"mousemove":"touchmove",t);this.interactiveObjects.forEach(n=>{this.dispatch(n,e)})});A(this,"onMouseClick",t=>{this.update();let e=new J("click",t);this.interactiveObjects.forEach(n=>{n.intersected&&this.dispatch(n,e)})});A(this,"onMouseDown",t=>{this.mapPositionToPoint(this.mouse,t.clientX,t.clientY),this.update();let e=new J("mousedown",t);this.interactiveObjects.forEach(n=>{n.intersected?(n.wasIntersectedOnMouseDown=!0,this.dispatch(n,e)):n.wasIntersectedOnMouseDown=!1})});A(this,"onPointerDown",t=>{this.mapPositionToPoint(this.mouse,t.clientX,t.clientY),this.update();let e=new J("pointerdown",t);this.interactiveObjects.forEach(n=>{n.intersected&&this.dispatch(n,e)})});A(this,"onTouchStart",t=>{t.touches.length>0&&this.mapPositionToPoint(this.mouse,t.touches[0].clientX,t.touches[0].clientY),this.update();let e=new J(this.treatTouchEventsAsMouseEvents?"mousedown":"touchstart",t);this.interactiveObjects.forEach(n=>{n.intersected&&this.dispatch(n,e)})});A(this,"onMouseUp",t=>{let e=new J("mouseup",t);this.interactiveObjects.forEach(n=>{this.dispatch(n,e)})});A(this,"onPointerUp",t=>{let e=new J("pointerup",t);this.interactiveObjects.forEach(n=>{this.dispatch(n,e)})});A(this,"onTouchEnd",t=>{t.touches.length>0&&this.mapPositionToPoint(this.mouse,t.touches[0].clientX,t.touches[0].clientY),this.update();let e=new J(this.treatTouchEventsAsMouseEvents?"mouseup":"touchend",t);this.interactiveObjects.forEach(n=>{this.dispatch(n,e)})});A(this,"dispatch",(t,e)=>{t.target&&!e.cancelBubble&&(e.coords=this.mouse,e.distance=t.distance,e.intersected=t.intersected,e.wasIntersected=t.wasIntersected,e.wasIntersectedOnMouseDown=t.wasIntersectedOnMouseDown,t.target.dispatchEvent(e))});A(this,"mapPositionToPoint",(t,e,n)=>{let i=this.renderer.domElement.getBoundingClientRect();t.x=(e-i.left)/i.width*2-1,t.y=-((n-i.top)/i.height)*2+1});this.renderer=t,this.camera=e,this.domElement=n,this.bindEventsOnBodyElement=i&&typeof i.bindEventsOnBodyElement<"u"?i.bindEventsOnBodyElement:!0,this.scene=i&&typeof i.scene<"u"?i.scene:null,this.scene&&(this.scene.onBeforeRender=()=>{this.autoAdd&&this.scene!==null&&this.scene.traverse(s=>{this.add(s),s.addEventListener("removed",r=>{this.remove(r.target)})}),this.update()}),this.autoAdd=i&&typeof i.autoAdd<"u"?i.autoAdd:!1,this.autoAdd&&this.scene===null&&console.error("Attention: Options.scene needs to be set when using options.autoAdd"),this.mouse=new G(-1,1),this.supportsPointerEvents=!!window.PointerEvent,this.interactiveObjects=[],this.closestObject=null,this.raycaster=new jn,n.addEventListener("click",this.onMouseClick),this.supportsPointerEvents&&(this.bindEventsOnBodyElement?n.ownerDocument.addEventListener("pointermove",this.onDocumentPointerMove):n.addEventListener("pointermove",this.onDocumentPointerMove),n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointerup",this.onPointerUp)),this.bindEventsOnBodyElement?n.ownerDocument.addEventListener("mousemove",this.onDocumentMouseMove):n.addEventListener("mousemove",this.onDocumentMouseMove),n.addEventListener("mousedown",this.onMouseDown),n.addEventListener("mouseup",this.onMouseUp),n.addEventListener("touchstart",this.onTouchStart,{passive:!0}),n.addEventListener("touchmove",this.onTouchMove,{passive:!0}),n.addEventListener("touchend",this.onTouchEnd,{passive:!0}),this.treatTouchEventsAsMouseEvents=!0}};const X={}.VITE_OPEN_API_BASE||"/openApi",Ii=new Date().getFullYear();function Ni(t,e){return/^https?:\/\//.test(e)?e:`${t}${e.startsWith("/")?e:`/${e}`}`}function ji(t){if((t==null?void 0:t.success)===!1&&(t==null?void 0:t.code)!==void 0&&![0,200,"0","200"].includes(t.code))throw new Error((t==null?void 0:t.msg)||(t==null?void 0:t.message)||"接口请求失败");return kn(t)}function K(t,e,n,i={}){return Gn(Ni(t,e),{params:n,timeout:i.timeout||18e3}).then(ji)}function Gi(){return K(X,"/screen2/yak-management/distribution").then(t=>on(t))}function ki(){return K(X,"/screen2/yak-management/structure").then(t=>on(t))}function as(){return K(X,"/screen2/yak-management/profile").then(t=>t||{})}function ls(t=Ii){return K(X,"/screen2/yak-trade/dashboard",typeof t=="object"?t:{year:t}).then(Wi)}function cs(){return K(X,"/screen2/yak-trade/options").then(t=>t||{})}function us(t={}){return K(X,"/screen2/yak-trade/ledger",t).then(Fi)}function hs(t={}){return K(X,"/screen2/yak-slaughter/dashboard",t).then(e=>e||{})}function fs(){return K(X,"/screen2/yak-slaughter/options").then(t=>t||{})}function ds(t={}){return K(X,"/screen2/yak-slaughter/ledger",t).then(e=>e||{})}function Wi(t={}){var r,c;const e=Array.isArray(t.metrics)?t.metrics:[],n=o=>{var h;return Number(((h=e.find(d=>d.key===o))==null?void 0:h.value)||0)},i=Array.isArray(t.certificateStructure)?t.certificateStructure:[],s=(o,h)=>{var d;return Number(((d=i.find(a=>a.key===o))==null?void 0:d[h])||0)};return fe(he({},t),{hasData:(c=(r=t.requestedHasData)!=null?r:t.hasData)!=null?c:!1,year:t.displayYear,metrics:{headCount:n("headCount"),totalHeads:n("headCount"),recordCount:n("recordCount"),totalRecords:n("recordCount"),vehicleCount:n("vehicleCount"),outProvinceHeads:s("A证","value"),outProvinceCount:s("A证","recordCount"),aCertHeads:s("A证","value"),aCertCount:s("A证","recordCount"),inProvinceHeads:s("B证","value"),inProvinceCount:s("B证","recordCount"),bCertHeads:s("B证","value"),bCertCount:s("B证","recordCount")},startTownCounts:t.townRanking||[],usageCounts:t.usageStructure||[],transportNumberCounts:t.vehicleRanking||[],destinationCounts:t.destinationRanking||[]})}function Fi(t={}){const e=Array.isArray(t.rows)?t.rows.map(n=>({certId:n.recordKey,factoryCode:n.recordKey,certType:n.certType,certScopeName:n.certType,ownerName:n.ownerDisplay,ownerPhone:"",transportNumber:n.vehicleDisplay,amount:n.amount,unitName:n.unit||"头",animalTypeName:"",usageTypeName:n.usageType,startTown:n.startTown,startRegionFullName:n.startTown,destProvince:n.destProvince,destRegionFullName:n.destProvince,quarantineOfficerName:"",issueTime:n.issueDate,statusName:n.status})):[];return fe(he({},t),{rows:e})}function ps(t={}){return K(X,"/screen2/yak-management/epidemic/analysis",t).then(e=>e||{})}function ms(t={}){return K(X,"/screen2/yak-management/epidemic/records",t).then(e=>e||{})}function vs(t={}){return K(X,"/screen2/yak-management/epidemic/stats",t).then(e=>e||{})}function gs(t={}){return K(X,"/screen2/yak-management/epidemic/village-stats",t).then(e=>e||{})}function ws(t){return K(X,"/screen2/yak-management/epidemic/detail",{earTag:t}).then(e=>e||null)}function ys(){return He(this,null,function*(){return(yield Gi()).map((e,n)=>({key:le(e,["areaCode","area_code","code","id"],`yak-town-${n}`),name:le(e,["areaName","area_name","zoneName","townName","name"],`区域${n+1}`),value:an(le(e,["number","yakCount","yak_count","count","value"])),unit:"头"})).filter(e=>e.name&&Number.isFinite(e.value)).sort((e,n)=>n.value-e.value)})}function Ss(){return He(this,null,function*(){const e=(yield ki()).map((n,i)=>{const s=le(n,["sex","gender"],""),r=Yi(s),c=le(n,["ageRange","age_range","age","name","type"],""),o=[r,c].filter(Boolean).join(" ")||`结构${i+1}`;return{key:le(n,["id","key"],`${o}-${i}`),name:o,value:an(le(n,["number","count","value"])),unit:"头"}}).filter(n=>n.name&&Number.isFinite(n.value));return Hi(e)})}function on(t){return Array.isArray(t)?t:Array.isArray(t==null?void 0:t.rows)?t.rows:Array.isArray(t==null?void 0:t.list)?t.list:Array.isArray(t==null?void 0:t.records)?t.records:Array.isArray(t==null?void 0:t.data)?t.data:[]}function Hi(t=[]){const e=new Map;return t.forEach(n=>{const i=e.get(n.name)||fe(he({},n),{value:0});i.value+=n.value,e.set(n.name,i)}),[...e.values()].sort((n,i)=>i.value-n.value)}function le(t,e,n=""){for(const i of e){const s=t==null?void 0:t[i];if(s!=null&&s!=="")return s}return n}function Yi(t){return["boy","male","公","公牛"].includes(t)?"公牛":["girl","female","母","母牛"].includes(t)?"母牛":t||""}function an(t){if(t==null||t==="")return NaN;const e=Number(String(t).replace(/,/g,"").replace(/%/g,""));return Number.isFinite(e)?e:NaN}export{ts as B,Qi as D,ns as E,ss as G,Zi as L,Ki as M,es as P,is as a,$i as b,tn as c,ds as d,as as e,ys as f,pt as g,os as h,Ss as i,cs as j,ls as k,rs as l,us as m,hs as n,fs as o,ps as p,ms as q,vs as r,gs as s,ws as t};