PageSourceSearch

https://fosapp.manus.space/assets/HeatmapTest-BKEu6WNa.js

js fosapp.manus.space collected 2026-10-03 05:02:19 UTC 42,696 bytes, 18 lines download raw bytes

1import{r as A,t as Me,j as x,k as Se}from"./index-Df9RYwwb.js";import{N as Ae}from"./NavBar-BEECYtTm.js";import"./chevron-down-CzIExFpo.js";import"./shield-dAkSLspn.js";import"./sparkles-PwsV9uoO.js";import"./x-Dpi4zoMf.js";var ke=Object.getOwnPropertyNames,be=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty;function se(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function G(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);var o=s.cache,a=o.get(t),l=o.get(r);if(a&&l)return a===r&&l===t;o.set(t,r),o.set(r,t);var i=n(t,r,s);return o.delete(t),o.delete(r),i}}function Te(n){return n?.[Symbol.toStringTag]}function oe(n){return ke(n).concat(be(n))}var Oe=Object.hasOwn||(function(n,e){return Ce.call(n,e)});function R(n,e){return n===e||!n&&!e&&n!==n&&e!==e}var Ue="__v",_e="__o",Le="_owner",ie=Object.getOwnPropertyDescriptor,ae=Object.keys;function je(n,e,t){var r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function Re(n,e){return R(n.getTime(),e.getTime())}function Ie(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Pe(n,e){return n===e}function le(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var s=new Array(r),o=n.entries(),a,l,i=0;(a=o.next())&&!a.done;){for(var d=e.entries(),h=!1,u=0;(l=d.next())&&!l.done;){if(s[u]){u++;continue}var m=a.value,c=l.value;if(t.equals(m[0],c[0],i,u,n,e,t)&&t.equals(m[1],c[1],m[0],c[0],n,e,t)){h=s[u]=!0;break}u++}if(!h)return!1;i++}return!0}var Ne=R;function qe(n,e,t){var r=ae(n),s=r.length;if(ae(e).length!==s)return!1;for(;s-- >0;)if(!ye(n,e,t,r[s]))return!1;return!0}function N(n,e,t){var r=oe(n),s=r.length;if(oe(e).length!==s)return!1;for(var o,a,l;s-- >0;)if(o=r[s],!ye(n,e,t,o)||(a=ie(n,o),l=ie(e,o),(a||l)&&(!a||!l||a.configurable!==l.configurable||a.enumerable!==l.enumerable||a.writable!==l.writable)))return!1;return!0}function $e(n,e){return R(n.valueOf(),e.valueOf())}function ze(n,e){return n.source===e.source&&n.flags===e.flags}function ce(n,e,t){var r=n.size;if(r!==e.size)return!1;if(!r)return!0;for(var s=new Array(r),o=n.values(),a,l;(a=o.next())&&!a.done;){for(var i=e.values(),d=!1,h=0;(l=i.next())&&!l.done;){if(!s[h]&&t.equals(a.value,l.value,a.value,l.value,n,e,t)){d=s[h]=!0;break}h++}if(!d)return!1}return!0}function De(n,e){var t=n.length;if(e.length!==t)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function Be(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function ye(n,e,t,r){return(r===Le||r===_e||r===Ue)&&(n.$$typeof||e.$$typeof)?!0:Oe(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}var Fe="[object Arguments]",Ge="[object Boolean]",We="[object Date]",Ze="[object Error]",He="[object Map]",Ve="[object Number]",Ke="[object Object]",Ye="[object RegExp]",Je="[object Set]",Xe="[object String]",Qe="[object URL]",et=Array.isArray,ue=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,de=Object.assign,tt=Object.prototype.toString.call.bind(Object.prototype.toString);function rt(n){var e=n.areArraysEqual,t=n.areDatesEqual,r=n.areErrorsEqual,s=n.areFunctionsEqual,o=n.areMapsEqual,a=n.areNumbersEqual,l=n.areObjectsEqual,i=n.arePrimitiveWrappersEqual,d=n.areRegExpsEqual,h=n.areSetsEqual,u=n.areTypedArraysEqual,m=n.areUrlsEqual,c=n.unknownTagComparators;return function(f,p,g){if(f===p)return!0;if(f==null||p==null)return!1;var E=typeof f;if(E!==typeof p)return!1;if(E!=="object")return E==="number"?a(f,p,g):E==="function"?s(f,p,g):!1;var M=f.constructor;if(M!==p.constructor)return!1;if(M===Object)return l(f,p,g);if(et(f))return e(f,p,g);if(ue!=null&&ue(f))return u(f,p,g);if(M===Date)return t(f,p,g);if(M===RegExp)return d(f,p,g);if(M===Map)return o(f,p,g);if(M===Set)return h(f,p,g);var v=tt(f);if(v===We)return t(f,p,g);if(v===Ye)return d(f,p,g);if(v===He)return o(f,p,g);if(v===Je)return h(f,p,g);if(v===Ke)return typeof f.then!="function"&&typeof p.then!="function"&&l(f,p,g);if(v===Qe)return m(f,p,g);if(v===Ze)return r(f,p,g);if(v===Fe)return l(f,p,g);if(v===Ge||v===Ve||v===Xe)return i(f,p,g);if(c){var k=c[v];if(!k){var I=Te(f);I&&(k=c[I])}if(k)return k(f,p,g)}return!1}}function nt(n){var e=n.circular,t=n.createCustomConfig,r=n.strict,s={areArraysEqual:r?N:je,areDatesEqual:
1Re,areErrorsEqual:Ie,areFunctionsEqual:Pe,areMapsEqual:r?se(le,N):le,areNumbersEqual:Ne,areObjectsEqual:r?N:qe,arePrimitiveWrappersEqual:$e,areRegExpsEqual:ze,areSetsEqual:r?se(ce,N):ce,areTypedArraysEqual:r?N:De,areUrlsEqual:Be,unknownTagComparators:void 0};if(t&&(s=de({},s,t(s))),e){var o=G(s.areArraysEqual),a=G(s.areMapsEqual),l=G(s.areObjectsEqual),i=G(s.areSetsEqual);s=de({},s,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:l,areSetsEqual:i})}return s}function st(n){return function(e,t,r,s,o,a,l){return n(e,t,l)}}function ot(n){var e=n.circular,t=n.comparator,r=n.createState,s=n.equals,o=n.strict;if(r)return function(i,d){var h=r(),u=h.cache,m=u===void 0?e?new WeakMap:void 0:u,c=h.meta;return t(i,d,{cache:m,equals:s,meta:c,strict:o})};if(e)return function(i,d){return t(i,d,{cache:new WeakMap,equals:s,meta:void 0,strict:o})};var a={cache:void 0,equals:s,meta:void 0,strict:o};return function(i,d){return t(i,d,a)}}var he=_();_({strict:!0});_({circular:!0});_({circular:!0,strict:!0});_({createInternalComparator:function(){return R}});_({strict:!0,createInternalComparator:function(){return R}});_({circular:!0,createInternalComparator:function(){return R}});_({circular:!0,createInternalComparator:function(){return R},strict:!0});function _(n){n===void 0&&(n={});var e=n.circular,t=e===void 0?!1:e,r=n.createInternalComparator,s=n.createState,o=n.strict,a=o===void 0?!1:o,l=nt(n),i=rt(l),d=r?r(i):st(i);return ot({circular:t,comparator:i,createState:s,equals:d,strict:a})}const pe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],H=1,q=8,S=new Uint32Array(96);class ee{static from(e){if(!e||e.byteLength===void 0||e.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[t,r]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==H)throw new Error(`Got v${s} data when expected v${H}.`);const o=pe[r&15];if(!o)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(e,2,1),[l]=new Uint32Array(e,4,1);return new ee(l,a,o,void 0,e)}constructor(e,t=64,r=Float64Array,s=ArrayBuffer,o){if(isNaN(e)||e<0)throw new Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const a=pe.indexOf(this.ArrayType),l=e*2*this.ArrayType.BYTES_PER_ELEMENT,i=e*this.IndexArrayType.BYTES_PER_ELEMENT,d=(8-i%8)%8;if(a<0)throw new Error(`Unexpected typed array class: ${r}.`);if(o)this.data=o,this.ids=new this.IndexArrayType(o,q,e),this.coords=new r(o,q+i+d,e*2),this._pos=e*2,this._finished=!0;else{const h=this.data=new s(q+l+i+d);this.ids=new this.IndexArrayType(h,q,e),this.coords=new r(h,q+i+d,e*2),this._pos=0,this._finished=!1,new Uint8Array(h,0,2).set([219,(H<<4)+a]),new Uint16Array(h,2,1)[0]=t,new Uint32Array(h,4,1)[0]=e}}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return J(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:a,nodeSize:l}=this;S[0]=0,S[1]=o.length-1,S[2]=0;let i=3;const d=[];for(;i>0;){const h=S[--i],u=S[--i],m=S[--i];if(u-m<=l){for(let p=m;p<=u;p++){const g=a[2*p],E=a[2*p+1];g>=e&&g<=r&&E>=t&&E<=s&&d.push(o[p])}continue}const c=m+u>>1,y=a[2*c],f=a[2*c+1];y>=e&&y<=r&&f>=t&&f<=s&&d.push(o[c]),(h===0?e<=y:t<=f)&&(S[i++]=m,S[i++]=c-1,S[i++]=1-h),(h===0?r>=y:s>=f)&&(S[i++]=c+1,S[i++]=u,S[i++]=1-h)}return d}within(e,t,r){const s=[];return this.withinInto(e,t,r,s),s}withinInto(e,t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:a,nodeSize:l}=this;S[0]=0,S[1]=o.length-1,S[2]=0;let i=3,d=0;const h=r*r;for(;i>0;){const u=S[--i],m=S[--i],c=S[--i];if(m-c<=l){for(let g=c;g<=m;g++)fe(a[2*g],a[2*g+1],e,t)<=h&&(s[d++]=o[g]);continue}const y=c+m>>1,f=a[2*y],p=a[2*y+1];fe(f,p,e,t)<=h&&(s[d++]=o[y]),(u===0?e-r<=f:t-r<=p)&&(S[i++]=c,S[i++]=y-1,S[i++]=1-u),(u===0?e+r>=f:t+r>
1=p)&&(S[i++]=y+1,S[i++]=m,S[i++]=1-u)}return d}}function J(n,e,t,r,s,o){if(s-r<=t)return;const a=r+s>>1;xe(n,e,a,r,s,o),J(n,e,t,r,a-1,1-o),J(n,e,t,a+1,s,1-o)}function xe(n,e,t,r,s,o){for(;s>r;){if(s-r>600){const d=s-r+1,h=t-r+1,u=Math.log(d),m=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*m*(d-m)/d)*(h-d/2<0?-1:1),y=Math.max(r,Math.floor(t-h*m/d+c)),f=Math.min(s,Math.floor(t+(d-h)*m/d+c));xe(n,e,t,y,f,o)}const a=e[2*t+o];let l=r,i=s;for($(n,e,r,t),e[2*s+o]>a&&$(n,e,r,s);l<i;){for($(n,e,l,i),l++,i--;e[2*l+o]<a;)l++;for(;e[2*i+o]>a;)i--}e[2*r+o]===a?$(n,e,r,i):(i++,$(n,e,i,s)),i<=t&&(r=i+1),t<=i&&(s=i-1)}}function $(n,e,t,r){V(n,t,r),V(e,2*t,2*r),V(e,2*t+1,2*r+1)}function V(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function fe(n,e,t,r){const s=n-t,o=e-r;return s*s+o*o}const it={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:n=>n},ge=Math.fround||(n=>(e=>(n[0]=+e,n[0])))(new Float32Array(1)),L=2,U=3,K=4,O=5,ve=6;class at{constructor(e){this.options=Object.assign(Object.create(it),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:r,maxZoom:s}=this.options;t&&console.time("total time");const o=`prepare ${e.length} points`;t&&console.time(o),this.points=e;const a=[];for(let i=0;i<e.length;i++){const d=e[i];if(!d.geometry)continue;const[h,u]=d.geometry.coordinates,m=ge(W(h)),c=ge(Z(u));a.push(m,c,1/0,i,-1,1),this.options.reduce&&a.push(0)}let l=this.trees[s+1]=this._createTree(a);t&&console.timeEnd(o);for(let i=s;i>=r;i--){const d=+Date.now();l=this.trees[i]=this._createTree(this._cluster(l,i)),t&&console.log("z%d: %d clusters in %dms",i,l.numItems,+Date.now()-d)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[1]));let o=e[2]===180?180:((e[2]+180)%360+360)%360-180;const a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){const u=this.getClusters([r,s,180,a],t),m=this.getClusters([-180,s,o,a],t);return u.concat(m)}const l=this.trees[this._limitZoom(t)],i=l.range(W(r),Z(a),W(o),Z(s)),d=l.data,h=[];for(const u of i){const m=this.stride*u;h.push(d[m+O]>1?me(d,m,this.clusterProps):this.points[d[m+U]])}return h}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),s="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(s);const a=o.data;if(t*this.stride>=a.length)throw new Error(s);const l=this.options.radius/(this.options.extent*Math.pow(2,r-1)),i=a[t*this.stride],d=a[t*this.stride+1],h=o.within(i,d,l),u=[];for(const m of h){const c=m*this.stride;a[c+K]===e&&u.push(a[c+O]>1?me(a,c,this.clusterProps):this.points[a[c+U]])}if(u.length===0)throw new Error(s);return u}getLeaves(e,t,r){t=t||10,r=r||0;const s=[];return this._appendLeaves(s,e,t,r,0),s}getTile(e,t,r){const s=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:a,radius:l}=this.options,i=l/a,d=(r-i)/o,h=(r+1+i)/o,u={features:[]};return this._addTileFeatures(s.range((t-i)/o,d,(t+1+i)/o,h),s.data,t,r,o,u),t===0&&this._addTileFeatures(s.range(1-i/o,d,1,h),s.data,o,r,o,u),t===o-1&&this._addTileFeatures(s.range(0,d,i/o,h),s.data,-1,r,o,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,r.length!==1)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,s,o){const a=this.getChildren(t);for(const l of a){const i=l.properties;if(i&&i.cluster?o+i.point_count<=s?o+=i.point_count:o=this._appendLeaves(e,i.cluster_id,r,s,o):o<s?o++:e.push(l),e.length===r)break}return o}_createTree(e){const t=new ee(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,r,s,o,a){for(const l of e){const i=l*this.stride,d=t[i+O]>1;let h,u,m;if(d)h=we(t,i,this.clusterProps),u=t[i],m=t[i+1];else{const f=this.points[t[i+U]];h=f.properties;const[p,g]=f.geometry.coordinates;u=W(p),m=Z(g)}const c={type:1,geometry:[[Math.round(this.options.extent*(u*o-r)),Math.round(this.options.extent*(m*o-s))]],tags:h};let y;d||this.options.generateId?y=t[i+U]:y=this.points[t[i+U]].id,y!==void 0&&(c.id=y),a.features.push(c)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:r,extent:s,reduce:o,minPoints:a}=this.options,l=r/(s*Math.pow(2,t)),i=e.data,d=[],h=this.stride;for(let u=0;u<i.length;u+=h){if(i[u+L]<=t)continue;i[u+L]=t;const m=i[u],c=i[u+1],y=e.within(i[u],i[u+1],l),f=i[u+O];let p=f;for(const g of y){const E=g*h;i[E+L]>t&&(p+=i[E+O])}if(p>f&&p>=a){let g=m*f,E=c*f,M,v=-1;const k=((u/h|0)<<5)+(t+1)+this.points.length;for(const I of y){const T=I*h;if(i[T+L]<=t)continue;i[T+L]=t;const F=i[T+O];g+=i[T]*F,E+=i[T+1]*F,i[T+K]=k,o&&(M||(M=this._map(i,u,!0),v=this.clusterProps.length,this.clusterProps.push(M)),o(M,this._map(i,T)))}i[u+K]=k,d.push(g/p,E/p,1/0,k,-1,p),o&&d.push(v)}else{for(let g=0;g<h;g++)d.push(i[u+g]);if(p>1)for(const g of y){const E=g*h;if(!(i[E+L]<=t)){i[E+L]=t;
1for(let M=0;M<h;M++)d.push(i[E+M])}}}}return d}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+O]>1){const a=this.clusterProps[e[t+ve]];return r?Object.assign({},a):a}const s=this.points[e[t+U]].properties,o=this.options.map(s);return r&&o===s?Object.assign({},o):o}}function me(n,e,t){return{type:"Feature",id:n[e+U],properties:we(n,e,t),geometry:{type:"Point",coordinates:[lt(n[e]),ct(n[e+1])]}}}function we(n,e,t){const r=n[e+O],s=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,o=n[e+ve],a=o===-1?{}:Object.assign({},t[o]);return Object.assign(a,{cluster:!0,cluster_id:n[e+U],point_count:r,point_count_abbreviated:s})}function W(n){return n/360+.5}function Z(n){const e=Math.sin(n*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function lt(n){return(n-.5)*360}function ct(n){const e=(180-n*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function ut(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t}class C{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,t){this.isAdvancedMarker(e)?e.map=t:e.setMap(t)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(Number.isFinite(e.position.lat)&&Number.isFinite(e.position.lng))return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class X{constructor({markers:e,position:t}){this.markers=[],e&&(this.markers=e),t&&(t instanceof google.maps.LatLng?this._position=t:this._position=new google.maps.LatLng(t))}get bounds(){if(this.markers.length===0&&!this._position)return;const e=new google.maps.LatLngBounds(this._position,this._position);for(const t of this.markers)e.extend(C.getPosition(t));return e}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>C.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(C.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}function Q(n,e="assertion failed"){if(n==null)throw Error(e)}class dt{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return ht(e)}}const ht=n=>n.map(t=>new X({position:C.getPosition(t),markers:[t]}));class pt extends dt{constructor(e){var{maxZoom:t,radius:r=60}=e,s=ut(e,["maxZoom","radius"]);super({maxZoom:t}),this.markers=[],this.clusters=[],this.state={zoom:-1},this.superCluster=new at(Object.assign({maxZoom:this.maxZoom,radius:r},s))}calculate(e){let t=!1,r=e.map.getZoom();Q(r),r=Math.round(r);const s={zoom:r};if(!he(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const o=this.markers.map(a=>{const l=C.getPosition(a);return{type:"Feature",geometry:{type:"Point",coordinates:[l.lng(),l.lat()]},properties:{marker:a}}});this.superCluster.load(o)}return t||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(t=!he(this.state,s)),this.state=s,e.markers.length===0?(this.cluster
1s=[],{clusters:this.clusters,changed:t}):(t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t})}cluster({map:e}){const t=e.getZoom();return Q(t),this.superCluster.getClusters([-180,-90,180,90],Math.round(t)).map(r=>this.transformCluster(r))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new X({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(o=>o.properties.marker),position:{lat:t,lng:e}});const s=r.marker;return new X({markers:[s],position:C.getPosition(s)})}}class ft{constructor(e,t){this.markers={sum:e.length};const r=t.map(o=>o.count),s=r.reduce((o,a)=>o+a,0);this.clusters={count:t.length,markers:{mean:s/t.length,sum:s,min:Math.min(...r),max:Math.max(...r)}}}}class gt{render({count:e,position:t},r,s){const a=`<svg fill="${e>Math.max(10,r.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
2<circle cx="120" cy="120" opacity=".6" r="70" />
3<circle cx="120" cy="120" opacity=".3" r="90" />
4<circle cx="120" cy="120" opacity=".2" r="110" />
5<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>
6</svg>`,l=`Cluster of ${e} markers`,i=Number(google.maps.Marker.MAX_ZINDEX)+e;if(C.isAdvancedMarkerAvailable(s)){const u=new DOMParser().parseFromString(a,"image/svg+xml").documentElement;u.setAttribute("transform","translate(0 25)");const m={map:s,position:t,zIndex:i,title:l,content:u};return new google.maps.marker.AdvancedMarkerElement(m)}const d={position:t,zIndex:i,title:l,icon:{url:`data:image/svg+xml;base64,${btoa(a)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(d)}}function mt(n,e){for(let t in e.prototype)n.prototype[t]=e.prototype[t]}class te{constructor(){mt(te,google.maps.OverlayView)}}var j;(function(n){n.CLUSTERING_BEGIN="clusteringbegin",n.CLUSTERING_END="clusteringend",n.CLUSTER_CLICK="click",n.GMP_CLICK="gmp-click"})(j||(j={}));const yt=(n,e,t)=>{e.bounds&&t.fitBounds(e.bounds)};class xt extends te{constructor({map:e,markers:t=[],algorithmOptions:r={},algorithm:s=new pt(r),renderer:o=new gt,onClusterClick:a=yt}){super(),this.map=null,this.idleListener=null,this.markers=[...t],this.clusters=[],this.algorithm=s,this.renderer=o,this.onClusterClick=a,e&&this.setMap(e)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(r=>{this.addMarker(r,!0)}),t||this.render()}removeMarker(e,t){const r=this.markers.indexOf(e);return r===-1?!1:(C.setMap(e,null),this.markers.splice(r,1),t||this.render(),!0)}removeMarkers(e,t){let r=!1;return e.forEach(s=>{r=this.removeMarker(s,!0)||r}),r&&!t&&this.render(),r}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,j.CLUSTERING_BEGIN,this);const{clusters:t,changed:r}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(r||r==null){const s=new Set;for(const a of t)a.markers.length==1&&s.add(a.markers[0]);const o=[];for(const a of this.clusters)a.marker!=null&&(a.markers.length==1?s.has(a.marker)||C.setMap(a.marker,null):o.push(a.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>o.forEach(a=>C.setMap(a,null)))}google.maps.event.trigger(this,j.CLUSTERING_END,this)}}onAdd(){const e=this.getMap();Q(e),this.idleListener=e.addListener("idle",this.render.bind(this)),this.render()}onRemove(){this.idleListener&&google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>C.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new ft(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(r=>{if(r.markers.length===1)r.marker=r.markers[0];else if(r.marker=this.renderer.render(r,e,t),r.markers.forEach(s=>C.setMap(s,null)),this.onClusterClick){const s=C.isAdvancedMarker(r.marker)?j.GMP_CLICK:j.CLUSTER_CLICK;r.marker.addListener(s,o=>{google.maps.event.trigger(this,j.CLUSTER_CLICK,r),this.onClusterClick(o,r,t)})}C.setMap(r.marker,t)})}}const vt="LPj6zrBTBt3iZGBb6VYkfo",wt="https://forge.manus.ai",Et=`${wt}/v1/maps/proxy`,Mt=new Set(["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","N
6orth Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming","Georgia, USA","Indiana, USA","Virginia, USA"]),Ee={Georgia:"Georgia, USA","Georgia, USA":"Georgia, USA",Washington:"Washington state, USA",Indiana:"Indiana, USA",Virginia:"Virginia, USA",Delaware:"Delaware, USA",Maine:"Maine, USA",Montana:"Montana, USA",Nevada:"Nevada, USA",Kansas:"Kansas, USA",Oregon:"Oregon, USA",Florida:"Florida, USA",Alabama:"Alabama, USA",Mississippi:"Mississippi, USA",Louisiana:"Louisiana, USA",Arkansas:"Arkansas, USA",Missouri:"Missouri, USA",Tennessee:"Tennessee, USA",Kentucky:"Kentucky, USA",Ohio:"Ohio, USA",Michigan:"Michigan, USA",Wisconsin:"Wisconsin, USA",Minnesota:"Minnesota, USA",Iowa:"Iowa, USA",Illinois:"Illinois, USA",Pennsylvania:"Pennsylvania, USA","North Carolina":"North Carolina, USA","South Carolina":"South Carolina, USA","North Dakota":"North Dakota, USA","South Dakota":"South Dakota, USA","West Virginia":"West Virginia, USA",Texas:"Texas, USA",California:"California, USA",Alaska:"Alaska, USA",Hawaii:"Hawaii, USA",Arizona:"Arizona, USA","New Mexico":"New Mexico, USA",Oklahoma:"Oklahoma, USA",Idaho:"Idaho, USA",Utah:"Utah, USA",Colorado:"Colorado, USA",Wyoming:"Wyoming, USA",Nebraska:"Nebraska, USA",Vermont:"Vermont, USA","New Hampshire":"New Hampshire, USA",Connecticut:"Connecticut, USA","Rhode Island":"Rhode Island, USA","New Jersey":"New Jersey, USA","New York":"New York state, USA",Maryland:"Maryland, USA",Massachusetts:"Massachusetts, USA",Ontario:"Ontario, Canada",Quebec:"Quebec, Canada",Alberta:"Alberta, Canada",Manitoba:"Manitoba, Canada","British Columbia":"British Columbia, Canada",Saskatchewan:"Saskatchewan, Canada","Nova Scotia":"Nova Scotia, Canada","New Brunswick":"New Brunswick, Canada",Appalachia:"Appalachian Mountains, USA"},St={"New York":"New York",Washington:"Washington",Georgia:"Georgia",Virginia:"Virginia",Indiana:"Indiana","Georgia, USA":"Georgia","Washington state, USA":"Washington"},At=[{elementType:"geometry",stylers:[{color:"#1a1a2e"}]},{elementType:"labels.text.stroke",stylers:[{color:"#1a1a2e"}]},{elementType:"labels.text.fill",stylers:[{color:"#8a7a5a"}]},{featureType:"administrative.country",elementType:"geometry.stroke",stylers:[{color:"#4a3f2f"}]},{featureType:"administrative.province",elementType:"geometry.stroke",stylers:[{color:"#3a3020"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#0d0d1a"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#3a3a5a"}]},{featureType:"road",stylers:[{visibility:"off"}]},{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"transit",stylers:[{visibility:"off"}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#1e1e30"}]}];function B(n,e){if(n===0)return{fill:"rgba(0,0,0,0)",stroke:"transparent",hex:"#1e6fb5"};const t=Math.log(n+1)/Math.log(e+1);let r,s,o;if(t<.5){const l=t/.5;r=Math.round(30+170*l),s=Math.round(111+9*l),o=Math.round(181+-149*l)}else{const l=(t-.5)/.5;r=Math.round(200+-61*l),s=Math.round(120+-120*l),o=Math.round(32+-32*l)}const a=.225+.225*t;return{fill:`rgba(${r},${s},${o},${a})`,stroke:`rgba(${r},${s},${o},${Math.min(1,a+.25)})`,hex:`#${r.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}}function kt(n,e){const t=Math.log(n+1)/Math.log(e+1);return Math.round(12+52*t)}function bt(){return new Promise((n,e)=>{if(window.google?.maps){n();return}const t=document.getElementById("gmap-script");if(t){t.addEventListener("load",()=>n()),t.addEventListener("error",()=>e());return}const r=document.createElement("script");r.id="gmap-script",r.src=`${Et}/maps/api/js?key=${vt}&v=weekly&libraries=visualization,marker,geocoding`,r.async=!0,r.crossOrigin="anonymous",r.onload=()=>n(),r.onerror=()=>e(new Error("Maps failed")),document.head.appendChild(r)})}function Ct(){return class extends window.google.maps.OverlayView{constructor(e,t,r,s,o,a,l){super(),this.pos=e,this.radius=t,this.fill=r,this.stroke=s,this.label=o,this.onClick=a,this.onHover=l,this.div=null}onAdd(){const e=this.radius*2+4;this.div=document.createElement("div"),this.div.style.cssText=`position:absolute;width:${e}px;height:${e}px;transform:translate(-50%,-50%);cursor:pointer;`,this.div.innerHTML=`
7        <svg width="${e}" height="${e}" xmlns="http://www.w3.org/2000/svg">
8          <circle cx="${e/2}" cy="${e/2}" r="${this.radius}"
9            fill="${this.fill}" stroke="${this.stroke}" stroke-width="1.5"/>
10          <text x="${e/2}" y="${e/2}" text-anchor="middle" dominant-baseline="central"
11            font-family="'Cinzel',serif" font-weight="700" font-size="${Math.max(9,Math.min(16,Math.round(this.radius*.45)))}"
12            fill="#f0ece4" style="text-shadow:0 1px 3px rgba(0,0,0,0.9);">${this.label}</text>
13        </svg>`,this.div.addEventListener("click",this.onClick),this.div.addEventListener("mousemove",t=>this.onHover(t)),this.div.addEventListener("mouseleave",()=>this.onHover(null)),this.getPanes().overlayMouseTarget.appendChild(this.div)}draw(){if(!this.div)return;const e=this.getProjection().fromLatLngToDivPixel(this.pos);e&&(this.div.style.left=`${e.x}px`,this.div.style.top=`${e.y}px`)}onRemove(){this.div?.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null}}}const Y=new Map;async function re(n,e){const t=e;if(Y.has(t))return Y.get(t);const r=Ee[e]??e,o=Mt.has(e)?{address:r,componentRestrictions:{country:"US"}}:{address:r};return new Promise(a=>{n.geocode(o,(l,i)=>{const d=i==="OK"&&l?.[0]?l[0].geometry.location:null;Y.set(t,d),a(d)})})}function Tt({onRegionClick:n,overrideData:e,isFiltered:t}){const r=A.useRef(null),s=A.useRef(null),o=A.useRef(null),a=A.useRef([]),l=A.useRef(null),[i,d]=A.useState("bubbles"),[h,u]=A.useState(!1),[m,c]=A.useState(!1),[y,f]=A.useState(null),[p,g]=A.useState(!1),{data:E,isLoading:M}=Me.public.regionSightingCounts.useQuery(void 0,{staleTime:600*1e3,refetchOnWindowFocus:!1}),v=e??E,k=A.useMemo(()=>Math.max(...(v??[]).map(w=>w.count),1),[v]),I=A.useMemo(()=>(v??[]).slice(0,20),[v]),T=A.useMemo(()=>{const w=new Map;for(const{region:b,count:P}of v??[])w.set(b,P);return w},[v]);A.useEffect(()=>{let w=!1;return(async()=>
13{try{if(await bt(),w||!r.current)return;const b=new window.google.maps.Map(r.current,{zoom:3,center:{lat:42,lng:-96},minZoom:2,maxZoom:12,mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!0,zoomControl:!0,styles:At,backgroundColor:"#0d0d1a"});s.current=b,o.current=new window.google.maps.Geocoder,u(!0)}catch(b){console.error("MapExplorer init",b)}})(),()=>{w=!0}},[]);const F=A.useCallback(()=>{for(const w of a.current)w.remove();a.current=[],l.current&&(l.current.clearMarkers(),l.current=null),s.current&&s.current.data.forEach(w=>s.current.data.remove(w))},[]);A.useEffect(()=>{if(!h||!v||v.length===0)return;F(),c(!0);const w=s.current,b=o.current;i==="bubbles"?Ot(w,b,v,k,n,f,a,()=>c(!1)):i==="clusters"?Ut(w,b,v,k,n,f,a,l,()=>c(!1)):i==="choropleth"?jt(w,v,T,k,n,f,p,g,()=>c(!1)):i==="heatmap"&&Rt(w,b,v,k,n,f,a,()=>c(!1))},[h,i,v,k]);const ne=[{id:"bubbles",label:"🔵 Pixel Bubbles",desc:"Fixed-size circles on screen — size = count"},{id:"clusters",label:"📍 Marker Clusters",desc:"Individual pins that cluster at low zoom"},{id:"choropleth",label:"🗺 Choropleth",desc:"State/province outlines filled by intensity"},{id:"heatmap",label:"🟧 Rectangle Heatmap",desc:"Current style — bounding-box colour blocks"}];return x.jsxs("div",{"data-loc":"client/src/components/MapExplorer.tsx:309",style:{color:"#f0ece4",fontFamily:"'EB Garamond', Georgia, serif"},children:[x.jsx("div",{"data-loc":"client/src/components/MapExplorer.tsx:312",style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",marginBottom:"1rem"},children:ne.map(w=>x.jsx("button",{"data-loc":"client/src/components/MapExplorer.tsx:314",onClick:()=>d(w.id),title:w.desc,style:{padding:"0.4rem 0.85rem",borderRadius:20,border:i===w.id?"1px solid #f5c842":"1px solid rgba(245,200,66,0.25)",background:i===w.id?"rgba(245,200,66,0.15)":"rgba(255,255,255,0.04)",color:i===w.id?"#f5c842":"#a09880",fontFamily:"'Cinzel', serif",fontSize:"0.72rem",letterSpacing:"0.04em",cursor:"pointer",fontWeight:i===w.id?700:400,transition:"all 0.15s"},children:w.label},w.id))}),x.jsx("p",{"data-loc":"client/src/components/MapExplorer.tsx:336",style:{color:"#5a4f3a",fontSize:"0.78rem",margin:"0 0 0.75rem",fontStyle:"italic"},children:ne.find(w=>w.id===i)?.desc}),x.jsxs("p",{"data-loc":"client/src/components/MapExplorer.tsx:341",style:{color:"#a09880",fontSize:"0.88rem",margin:"0 0 0.85rem",display:"flex",alignItems:"center",gap:"0.5rem",flexWrap:"wrap"},children:[x.jsxs("span",{"data-loc":"client/src/components/MapExplorer.tsx:342",children:[v?`${v.length} regions · ${v.reduce((w,b)=>w+b.count,0).toLocaleString()} sightings`:"Loading…"," · ","Click any region to browse its sightings."]}),t&&x.jsx("span",{"data-loc":"client/src/components/MapExplorer.tsx:349",style:{display:"inline-flex",alignItems:"center",gap:"0.3rem",background:"rgba(245,200,66,0.12)",border:"1px solid rgba(245,200,66,0.4)",borderRadius:20,padding:"0.15rem 0.6rem",fontSize:"0.7rem",fontFamily:"'Cinzel', serif",letterSpacing:"0.08em",color:"#f5c842",fontWeight:700},children:"FILTERED"})]}),x.jsxs("div",{"data-loc":"client/src/components/MapExplorer.tsx:359",style:{display:"flex",gap:"1.25rem",flexWrap:"wrap"},children:[x.jsxs("div",{"data-loc":"client/src/components/MapExplorer.tsx:361",style:{flex:"1 1 520px",minWidth:0,position:"relative"},children:[x.jsx("div",{"data-loc":"client/src/components/MapExplorer.tsx:362",ref:r,style:{width:"100%",height:"clamp(400px, 60vh, 680px)",borderRadius:10,overflow:"hidden",border:"1px solid rgba(245,200,66,0.2)",background:"#0d0d1a"}}),(M||h&&m)&&x.jsx("div",{"data-loc":"client/src/components/MapExplorer.tsx:376",style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(13,13,26,0.7)",borderRadius:10,pointerEvents:"none"},children:x.jsxs("div",{"data-loc":"client/src/components/MapExplorer.tsx:380",style:{textAlign:"center"},children:[x.jsx("div",{"data-loc":"client/src/components/MapExplorer.tsx:381",style:{fontSize:"1.5rem",marginBottom:"0.5rem",animation:"spin 1.5s linear infinite",display:"inline-block"},children:"🌐"}),x.jsx("div",{"data-loc":"client/src/components/MapExplorer.tsx:382",style:{color:"#f5c842",fontFamily:"'Cinzel', serif",fontSize:"0.85rem",letterSpacing:"0.1em"},children:M?"LOADING DATA…":"DRAWING…"})]})}),y&&x.jsxs("div",{"data-loc":"client/src/components/MapExplorer.tsx:391",style:{position:"absolute",left:Math.min(y.x+14,(r.current?.offsetWidth??400)-160),top:y.y-10,background:"rgba(20,16,10,0.95)",border:"1px solid rgba(245,200,66,0.5)",borderRadius:8,padding:"0.45rem 0.75rem",pointerEvents:"none",zIndex:100,minWidth:140,boxSh
13adow:"0 4px 20px rgba(0,0,0,0.6)"},children:[x.jsx("div",{"data-loc":"client/src/components/MapExplorer.tsx:404",style:{fontFamily:"'Cinzel', serif",fontSize:"0.75rem",color:"#f5c842",letterSpacing:"0.08em",marginBottom:2},children:y.region}),x.jsxs("div",{"data-loc":"client/src/components/MapExplorer.tsx:407",style:{fontSize:"0.85rem",color:"#f0ece4"},children:[x.jsx("strong",{"data-loc":"client/src/components/MapExplorer.tsx:408",children:y.count.toLocaleString()})," sighting",y.count!==1?"s":""]}),x.jsx("div",{"data-loc":"client/src/components/MapExplorer.tsx:410",style:{fontSize:"0.7rem",color:"#a09880",marginTop:2},children:"Click to browse sightings →"})]}),x.jsxs("div",{"data-loc":"client/src/components/MapExplorer.tsx:415",style:{position:"absolute",bottom:14,left:14,background:"rgba(13,13,26,0.88)",border:"1px solid rgba(245,200,66,0.2)",borderRadius:8,padding:"0.45rem 0.65rem",display:"flex",alignItems:"center",gap:"0.5rem"},children:[x.jsx("span",{"data-loc":"client/src/components/MapExplorer.tsx:422",style:{fontSize:"0.65rem",color:"#a09880",fontFamily:"'Cinzel', serif",letterSpacing:"0.06em"},children:"FEW"}),x.jsx("div",{"data-loc":"client/src/components/MapExplorer.tsx:423",style:{width:80,height:8,borderRadius:4,background:"linear-gradient(to right, rgba(30,111,181,0.6), rgba(200,120,32,0.8), rgba(139,0,0,1))"}}),x.jsx("span",{"data-loc":"client/src/components/MapExplorer.tsx:424",style:{fontSize:"0.65rem",color:"#a09880",fontFamily:"'Cinzel', serif",letterSpacing:"0.06em"},children:"MANY"})]})]}),x.jsxs("div",{"data-loc":"client/src/components/MapExplorer.tsx:429",style:{flex:"0 0 220px",background:"rgba(255,255,255,0.03)",border:"1px solid rgba(245,200,66,0.15)",borderRadius:10,padding:"0.85rem",maxHeight:"clamp(400px, 60vh, 680px)",overflowY:"auto"},children:[x.jsxs("div",{"data-loc":"client/src/components/MapExplorer.tsx:438",style:{fontFamily:"'Cinzel', serif",fontSize:"0.65rem",letterSpacing:"0.12em",color:"#f5c842",marginBottom:"0.65rem",textTransform:"uppercase",display:"flex",justifyContent:"space-between"},children:[x.jsx("span",{"data-loc":"client/src/components/MapExplorer.tsx:439",children:"Top Regions"}),t&&x.jsx("span",{"data-loc":"client/src/components/MapExplorer.tsx:440",style:{fontSize:"0.6rem",opacity:.7},children:"filtered"})]}),I.map((w,b)=>x.jsxs("button",{"data-loc":"client/src/components/MapExplorer.tsx:443",onClick:()=>n(w.region),style:{display:"flex",alignItems:"center",gap:"0.4rem",width:"100%",background:"none",border:"none",cursor:"pointer",padding:"0.3rem 0.35rem",borderRadius:5,marginBottom:1,textAlign:"left",transition:"background 0.15s"},onMouseEnter:P=>P.currentTarget.style.background="rgba(245,200,66,0.08)",onMouseLeave:P=>P.currentTarget.style.background="none",children:[x.jsx("span",{"data-loc":"client/src/components/MapExplorer.tsx:448",style:{fontSize:"0.65rem",color:"#5a4f3a",width:16,flexShrink:0,textAlign:"right"},children:b+1}),x.jsx("span",{"data-loc":"client/src/components/MapExplorer.tsx:449",style:{flex:1,fontSize:"0.82rem",color:"#f0ece4",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w.region}),x.jsx("span",{"data-loc":"client/src/components/MapExplorer.tsx:450",style:{fontSize:"0.72rem",fontWeight:700,color:b<3?"#f5c842":"#a09880",flexShrink:0},children:w.count.toLocaleString()})]},w.region))]})]}),x.jsx("style",{"data-loc":"client/src/components/MapExplorer.tsx:456",children:"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"})]})}function Ot(n,e,t,r,s,o,a,l){const i=Ct();let d=t.length;const h=()=>{d--,d<=0&&l()};for(const{region:u,count:m}of t)re(e,u).then(c=>{if(c){const y=kt(m,r),{fill:f,stroke:p}=B(m,r),g=m>=1e3?`${(m/1e3).toFixed(m>=1e4?0:1)}k`:String(m),E=new i(c,y,f,p,g,()=>s(u),M=>{if(!M){o(null);return}const v=n.getDiv().getBoundingClientRect();o({x:M.clientX-v.left,y:M.clientY-v.top,region:u,count:m})});E.setMap(n),a.current.push({remove:()=>E.setMap(null)})}h()})}function Ut(n,e,t,r,s,o,a,l,i){const d=[];let h=t.length;const u=()=>{if(h--,h<=0){const m=new xt({map:n,markers:d,renderer:{render({count:c,position:y}){const f=Math.min(c/r,1),{hex:p}=B(c,r),g=Math.round(32+28*Math.log(c+1)/Math.log(r+1)),E=c>=1e3?`${(c/1e3).toFixed(0)}k`:String(c);return new window.google.maps.Marker({position:y,icon:{url:`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="${g}" height="${g}">
14                    <circle cx="${g/2}" cy="${g/2}" r="${g/2-2}" fill="${p}" fill-opacity="${.25+.2*f}" stroke="${p}" stroke-width="1.5"/>
15                    <text x="${g/2}" y="${g/2}" text-anchor="middle" dominant-baseline="central"
16                      font-family="Arial,sans-serif" font-weight="bold" font-size="${Math.max(9,Math.round(g*.3))}"
17                      fill="#f0ece4">${E}</text>
18                  </svg>`)}
18`,scaledSize:new window.google.maps.Size(g,g),anchor:new window.google.maps.Point(g/2,g/2)},zIndex:c})}}});l.current=m,i()}};for(const{region:m,count:c}of t)re(e,m).then(y=>{if(y){const{hex:f}=B(c,r),p=new window.google.maps.Marker({position:y,icon:{path:window.google.maps.SymbolPath.CIRCLE,scale:6,fillColor:f,fillOpacity:.9,strokeColor:"#f0ece4",strokeWeight:1},title:`${m}: ${c} sightings`});p.addListener("click",()=>s(m)),p.addListener("mouseover",g=>{const E=g.domEvent,M=n.getDiv().getBoundingClientRect();o({x:E.clientX-M.left,y:E.clientY-M.top,region:m,count:c})}),p.addListener("mouseout",()=>o(null)),d.push(p),a.current.push({remove:()=>p.setMap(null)})}u()})}let z=null,D=null;const _t="https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_50m_admin_1_states_provinces.geojson",Lt="https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_110m_admin_0_countries.geojson";function jt(n,e,t,r,s,o,a,l,i){const d=new Map;for(const[c,y]of Array.from(t.entries())){const f=Ee[c]??c,p=f.includes(",")?f.split(",")[0].trim():f,g=St[c]??p;d.set(g.toLowerCase(),{region:c,count:y}),d.set(p.toLowerCase(),{region:c,count:y}),d.set(c.toLowerCase(),{region:c,count:y})}const h=c=>{const y=c.getProperty("name")??c.getProperty("NAME")??c.getProperty("ADMIN")??"";return d.get(y.toLowerCase())},u=()=>{n.data.setStyle(c=>{const y=h(c);if(!y)return{fillColor:"#1a1a2e",fillOpacity:.15,strokeColor:"rgba(245,200,66,0.12)",strokeWeight:.4,clickable:!1,zIndex:0};const{fill:f,stroke:p}=B(y.count,r);return{fillColor:f,fillOpacity:.75,strokeColor:p,strokeWeight:1.2,clickable:!0,zIndex:y.count}}),n.data.addListener("click",c=>{const y=h(c.feature);y&&s(y.region)}),n.data.addListener("mouseover",c=>{const y=h(c.feature);if(!y)return;const f=c.domEvent,p=n.getDiv().getBoundingClientRect();o({x:f.clientX-p.left,y:f.clientY-p.top,region:y.region,count:y.count}),n.data.overrideStyle(c.feature,{strokeWeight:2.5,strokeColor:"#f5c842"})}),n.data.addListener("mouseout",c=>{o(null),n.data.revertStyle(c.feature)}),i()};z&&D?(n.data.addGeoJson(D),n.data.addGeoJson(z),u()):(async()=>{try{z||(z=await(await fetch(_t)).json()),D||(D=await(await fetch(Lt)).json()),n.data.addGeoJson(D),n.data.addGeoJson(z),u(),l(!0)}catch(c){console.error("GeoJSON load failed",c),i()}})()}function Rt(n,e,t,r,s,o,a,l){let i=t.length;const d=()=>{i--,i<=0&&l()};for(const{region:h,count:u}of t)re(e,h).then(m=>{if(m){const{fill:c,stroke:y}=B(u,r),p=1.5+8*(Math.log(u+1)/Math.log(r+1)),g=new window.google.maps.LatLng(m.lat()+p,m.lng()+p),E=new window.google.maps.LatLng(m.lat()-p,m.lng()-p),M=n.data.add(new window.google.maps.Data.Feature({geometry:new window.google.maps.Data.Polygon([[{lat:g.lat(),lng:E.lng()},{lat:g.lat(),lng:g.lng()},{lat:E.lat(),lng:g.lng()},{lat:E.lat(),lng:E.lng()}]]),properties:{region:h,count:u}}));n.data.overrideStyle(M,{fillColor:c,fillOpacity:1,strokeColor:y,strokeWeight:1,clickable:!0,zIndex:u}),a.current.push({remove:()=>n.data.remove(M)})}d()});n.data.addListener("click",h=>{const u=h.feature.getProperty("region");u&&s(u)}),n.data.addListener("mouseover",h=>{const u=h.feature.getProperty("region"),m=h.feature.getProperty("count");if(!u)return;const c=h.domEvent,y=n.getDiv().getBoundingClientRect();o({x:c.clientX-y.left,y:c.clientY-y.top,region:u,count:m})}),n.data.addListener("mouseout",()=>o(null))}function Bt(){const[,n]=Se(),e=t=>{n(`/discover?region=${encodeURIComponent(t)}&mode=sightings`)};return x.jsxs("div",{"data-loc":"client/src/pages/HeatmapTest.tsx:18",style:{minHeight:"100vh",background:"#0d0d1a",color:"#f0ece4"},children:[x.jsx(Ae,{"data-loc":"client/src/pages/HeatmapTest.tsx:19"}),x.jsxs("div",{"data-loc":"client/src/pages/HeatmapTest.tsx:20",style:{maxWidth:"1200px",margin:"0 auto",padding:"1.5rem 1rem 3rem"},children:[x.jsxs("div",{"data-loc":"client/src/pages/HeatmapTest.tsx:23",style:{marginBottom:"1.5rem"},children:[x.jsx("div",{"data-loc":"client/src/pages/HeatmapTest.tsx:24",style:{display:"inline-flex",alignItems:"center",gap:"0.4rem",background:"rgba(245,200,66,0.08)",border:"1px solid rgba(245,200,66,0.25)",borderRadius:"6px",padding:"0.2rem 0.6rem",marginBottom:"0.6rem",fontSize:"0.65rem",fontFamily:"'Cinzel', serif",letterSpacing:"0.12em",color:"#f5c842",fontWeight:700},children:"🧪 EXPERIMENTAL — MAP STYLE COMPARISON"}),x.jsx("h1",{"data-loc":"client/src/pages/HeatmapTest.tsx:33",style:{fontFamily:"'Cinzel', serif",fontSize:"clamp(1.4rem, 3vw, 2rem)",color:"#f5c842",margin:"0 0 0.4rem",letterSpacing:"0.06em"},children:"Sighting Distribution Map"}),x.jsx("p",{"data-loc":"client/src/pages/HeatmapTest.tsx:39",style:{color:"#a09880",fontSize:"0.88rem",margin:0},children:"Compare 4 map visualisation styles. Click the tabs to switch, then click any region to browse its sightings."})]}),x.jsx(Tt,{"data-loc":"client/src/pages/HeatmapTest.tsx:44",onReg
18ionClick:e})]})]})}export{Bt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.