@arenarium/maps 1.2.21 → 1.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/main.css +1 -1
  2. package/dist/main.js +125 -152
  3. package/package.json +1 -1
package/dist/main.css CHANGED
@@ -1 +1 @@
1
- .pin.svelte-10kxbrm{position:absolute;border-style:solid;box-sizing:border-box;transform-origin:0% 0%;transform:translate(-50%,-50%);backface-visibility:hidden;will-change:scale}.pin.svelte-10kxbrm{display:none;content-visibility:hidden}.pin.displayed.svelte-10kxbrm{display:initial;content-visibility:initial}.pin.svelte-10kxbrm{opacity:1}.pin.suppressed.svelte-10kxbrm{opacity:.5;box-shadow:none!important}.element.svelte-1no6o2a{box-sizing:border-box}.anchor.svelte-1no6o2a{display:block;position:absolute;width:0px;height:0px;transition:filter ease-in-out 125ms}.anchor.svelte-1no6o2a>.pointer:where(.svelte-1no6o2a){position:absolute;left:0;top:0;transform-origin:0% 0%}.anchor.svelte-1no6o2a>.tooltip:where(.svelte-1no6o2a){position:absolute;left:0;top:0}.anchor.svelte-1no6o2a>.tooltip:where(.svelte-1no6o2a)>.body:where(.svelte-1no6o2a){cursor:pointer}.anchor.svelte-1no6o2a{opacity:0;will-change:opacity}.anchor.svelte-1no6o2a>.pointer:where(.svelte-1no6o2a){scale:0;transform-origin:0% 0%;will-change:transform,scale}.anchor.svelte-1no6o2a>.tooltip:where(.svelte-1no6o2a){scale:0;transform-origin:0% 0%;will-change:transform,scale}.anchor.svelte-1no6o2a>.tooltip:where(.svelte-1no6o2a)>.body:where(.svelte-1no6o2a){transform-origin:0% 0%;will-change:transform}.anchor.svelte-1no6o2a{display:none;content-visibility:hidden}.anchor.displayed.svelte-1no6o2a{display:initial;content-visibility:initial}.body.svelte-1no6o2a{backface-visibility:initial;transform-style:initial}.body.svelte-1no6o2a:hover{backface-visibility:hidden;transform-style:preserve-3d}
1
+ .pin.svelte-10kxbrm{position:absolute;border-style:solid;box-sizing:border-box;transform-origin:0% 0%;transform:translate(-50%,-50%);backface-visibility:hidden;will-change:scale}.pin.svelte-10kxbrm{display:none;content-visibility:hidden}.pin.displayed.svelte-10kxbrm{display:initial;content-visibility:initial}.pin.svelte-10kxbrm{opacity:1}.pin.suppressed.svelte-10kxbrm{opacity:.5;box-shadow:none!important}.element.svelte-1no6o2a{box-sizing:border-box;transform-style:flat}.anchor.svelte-1no6o2a{display:block;position:absolute;width:0px;height:0px;transition:filter ease-in-out 125ms}.pointer.svelte-1no6o2a{position:absolute;left:0;top:0;transform-origin:0% 0%}.tooltip.svelte-1no6o2a{position:absolute;left:0;top:0}.body.svelte-1no6o2a{cursor:pointer}.anchor.svelte-1no6o2a{opacity:0;will-change:opacity}.pointer.svelte-1no6o2a,.tooltip.svelte-1no6o2a{scale:0;transform-origin:0% 0%;will-change:transform,scale}.body.svelte-1no6o2a{transform-origin:0% 0%}.anchor.svelte-1no6o2a{display:none;content-visibility:hidden}.anchor.displayed.svelte-1no6o2a{display:initial;content-visibility:initial}.body.svelte-1no6o2a{backface-visibility:initial}.body.svelte-1no6o2a:hover{backface-visibility:hidden}
package/dist/main.js CHANGED
@@ -1,42 +1,20 @@
1
1
  class Bt {
2
- endtime = 0;
3
- lifespan;
4
- paused = !1;
5
- enqueued = !1;
2
+ invoked = !1;
6
3
  interval;
7
4
  timeout;
8
5
  callback;
9
- constructor(e, n, r) {
10
- if ((n ?? 0) < 0) throw new Error("Lifespan must be greater than 0");
11
- if ((r ?? 0) < 0) throw new Error("Interval must be greater than 0");
12
- const s = navigator?.hardwareConcurrency ? 200 / navigator.hardwareConcurrency : 100;
13
- this.interval = r ?? s;
14
- const i = this.interval;
15
- this.lifespan = n ?? i, this.callback = e;
16
- }
17
- async run() {
18
- const e = performance.now();
19
- if (this.enqueued && (this.endtime = e + this.lifespan, this.enqueued = !1), this.endtime < e) {
20
- this.stop();
21
- return;
22
- }
23
- if (this.paused == !1 && await this.callback() && !this.enqueued) {
24
- this.stop();
25
- return;
26
- }
27
- this.timeout = window.setTimeout(this.run.bind(this), this.interval);
28
- }
29
- start() {
30
- this.enqueued = !0, this.timeout || this.run();
6
+ constructor(e, n) {
7
+ if ((n ?? 0) < 0) throw new Error("Invalid interval");
8
+ this.interval = n ?? (navigator?.hardwareConcurrency ? 200 / navigator.hardwareConcurrency : 100), this.callback = e;
31
9
  }
32
- stop() {
33
- this.timeout && window.clearTimeout(this.timeout), this.timeout = void 0;
10
+ async process() {
11
+ this.invoked = !1, await this.callback() || !this.invoked ? this.stop() : this.timeout = window.setTimeout(this.process.bind(this), this.interval);
34
12
  }
35
- pause() {
36
- this.paused = !0;
13
+ run() {
14
+ this.invoked = !0, this.timeout || this.process();
37
15
  }
38
- resume() {
39
- this.paused = !1;
16
+ stop() {
17
+ this.invoked = !1, this.timeout && window.clearTimeout(this.timeout), this.timeout = void 0;
40
18
  }
41
19
  }
42
20
  class gs {
@@ -62,7 +40,7 @@ class ys {
62
40
  timeout;
63
41
  id;
64
42
  constructor(e, n) {
65
- if (n <= 0) throw new Error("Timeout must be greater than 0");
43
+ if (n <= 0) throw new Error("Invalid timeout");
66
44
  this.callback = e, this.timeout = n;
67
45
  }
68
46
  start() {
@@ -111,6 +89,7 @@ class ks {
111
89
  class Jn {
112
90
  worker;
113
91
  workerInvocations;
92
+ workerInvocationCounter = 0;
114
93
  constructor(e) {
115
94
  this.worker = e, this.workerInvocations = /* @__PURE__ */ new Map(), this.worker.onmessage = this.onmessage.bind(this), this.worker.onerror = this.onerror.bind(this);
116
95
  }
@@ -124,12 +103,12 @@ class Jn {
124
103
  }
125
104
  invoke(e, ...n) {
126
105
  return new Promise((r, s) => {
127
- const i = crypto.randomUUID(), a = { id: i, method: e, args: n };
106
+ const i = `${e.toString()}_${this.workerInvocationCounter++}_${performance.now()}`, a = { id: i, method: e.toString(), args: n };
128
107
  this.workerInvocations.set(i, { resolve: r, reject: s }), this.worker.postMessage(a);
129
108
  });
130
109
  }
131
110
  terminate() {
132
- this.workerInvocations.forEach((e) => e.reject(new Error("Terminated!"))), this.workerInvocations.clear(), this.worker.terminate();
111
+ this.workerInvocations.forEach((e) => e.reject(new Error("Terminated"))), this.workerInvocations.clear(), this.worker.terminate();
133
112
  }
134
113
  }
135
114
  class Be {
@@ -146,7 +125,7 @@ class Be {
146
125
  return new Be([], []);
147
126
  }
148
127
  }
149
- const Gn = '(function(){"use strict";function m(l,t,e){return{x:T(t)*e,y:I(l)*e}}function w(l,t,e){return{lat:R(t/e),lng:P(l/e)}}function T(l){return(180+l)/360}function I(l){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l*Math.PI/360)))/360}function P(l){return l*360-180}function R(l){return 360/Math.PI*Math.atan(Math.exp((180-l*360)*Math.PI/180))-90}class h{sw;ne;constructor(t,e,s,n){if(s<t)throw new Error(`Invalid bounds: ${t}, ${e}, ${s}, ${n}`);if(n<e)throw new Error(`Invalid bounds: ${t}, ${e}, ${s}, ${n}`);this.sw={lat:t,lng:e},this.ne={lat:s,lng:n}}contains(t,e){return!(t<this.sw.lat||this.ne.lat<t||e<this.sw.lng||this.ne.lng<e)}intersects(t){return!(t.ne.lat<this.sw.lat||this.ne.lat<t.sw.lat||t.ne.lng<this.sw.lng||this.ne.lng<t.sw.lng)}}class a{blockL;blockR;sw;ne;constructor(t,e,s,n){if(s<t)throw new Error(`Invalid bounds: ${t}, ${e}, ${s}, ${n}`);this.sw={lat:t,lng:e},this.ne={lat:s,lng:n},e<n?(this.blockL=new h(t,e,s,n),this.blockR=new h(0,0,0,0)):(this.blockL=new h(t,-180,s,n),this.blockR=new h(t,e,s,180))}static normalize(t){const e=t.bounds,s=t.center;if(Math.abs(e.ne.lng-s.lng)+Math.abs(e.sw.lng-s.lng)>360&&(e.sw.lng=-180,e.ne.lng=180),e.ne.lng-e.sw.lng>360){e.sw.lng=-180,e.ne.lng=180;return}e.sw.lng<-180&&(e.sw.lng+=360),e.sw.lng>180&&(e.sw.lng-=360),e.ne.lng<-180&&(e.ne.lng+=360),e.ne.lng>180&&(e.ne.lng-=360)}static bounds(t){this.normalize(t);const e=t.bounds,s=e.sw,n=e.ne;return new a(s.lat,s.lng,n.lat,n.lng)}static offset(t,e,s){this.normalize(t);const n=t.bounds,r=t.zoom,o=e*Math.pow(2,r),i=m(n.sw.lat,n.sw.lng,o),c=m(n.ne.lat,n.ne.lng,o);let f=Math.max(i.x-s.left,0),g=Math.min(i.y+s.bottom,o),D=Math.min(c.x+s.right,o),N=Math.max(c.y-s.top,0);const y=w(f,g,o),C=w(D,N,o);return new a(y.lat,y.lng,C.lat,C.lng)}contains(t,e){return this.blockL.contains(t,e)||this.blockR.contains(t,e)}intersects(t){return this.blockL.intersects(t)||this.blockR.intersects(t)}}class S{id;bounds;markers;constructor(t,e){this.id=t,this.bounds=e,this.markers=[]}belongs(t){const e=this.bounds.sw;if(t.lat<e.lat||t.lng<e.lng)return!1;const s=this.bounds.ne;return!(s.lat<t.lat||s.lng<t.lng)}neighbours(t,e){const s=Math.abs(t.id.length-this.id.length);if(s>e)return!1;const n=Math.min(this.id.length,t.id.length)-e+s;for(let r=0;r<n;r++)if(this.id[r]!=t.id[r])return!1;return!0}}class u{tree;zoom;cell;branches;constructor(t,e,s,n){this.tree=t,this.zoom=s,this.cell=new S(e,n),this.branches=new Array}split(){const t=this.cell.bounds,e=Math.pow(2,this.tree.depth),s=(t.ne.lat-t.sw.lat)/e,n=(t.ne.lng-t.sw.lng)/e;for(let r=0;r<e;r++)for(let o=0;o<e;o++){const i=t.sw.lat+r*s,c=t.sw.lng+o*n,f=i+s,g=c+n;this.branches.push(new u(this.tree,`${this.cell.id}${r*2+o}`,this.zoom+this.tree.depth,{sw:{lat:i,lng:c},ne:{lat:f,lng:g}}))}}add(t){if(this.cell.belongs(t)==!1)return!1;if(this.cell.markers.length<this.tree.capacity)return this.cell.markers.push(t),!0;this.branches.length==0&&this.split();for(let e=0;e<this.branches.length;e++)if(this.branches[e].add(t))return!0;throw new Error("Failed to add marker to branch")}compact(){if(this.branches.length==0)return;for(let n=0;n<this.branches.length;n++)this.branches[n].compact();const t=new Array,e=new Array;for(let n=0;n<this.branches.length;n++){const r=this.branches[n];t.push(...r.branches),e.push(...r.cell.markers)}const s=new u(this.tree,this.cell.id,this.zoom+this.tree.depth,this.cell.bounds);s.branches=t,s.cell.markers=e,this.branches=[s]}cells(t,e,s){if(t<this.zoom||e.intersects(this.cell.bounds)==!1)return s;s.push(this.cell);for(let n=0;n<this.branches.length;n++)this.branches[n].cells(t,e,s);return s}print(t){console.log(`${"---".repeat(t)}|${this.cell.id} zoom=[${this.zoom}] markers=[${this.cell.markers.length}]`);for(let e=0;e<this.branches.length;e++)this.branches[e].print(t+1)}count(){return this.cell.markers.length+this.branches.reduce((t,e)=>t+e.count(),0)}}class x{capacity;depth;root;constructor(t,e,s){this.capacity=s,this.depth=e,this.root=new u(this,"R",t,{sw:{lat:-90,lng:-180},ne:{lat:90,lng:180}})}add(t){return this.root.add(t)}compact(){this.root.compact()}cells(t,e){const s=new Array;return this.root.cells(t,e,s),s}print(){this.root.print(0)}}const A=16,p=2,k=1,M=A*4;let b,d,E=p,z=k,$=M;const _={update(l,t,e){const s=-Math.floor(Math.log2(l.mapSize/$)),n=new x(s,z,E);for(let o=0;o<t.length;o++){const i=t[o];if(!n.add(i))throw new Error("Failed to add marker to fill tree!")}const r=-s;for(let o=0;o<r;o++)n.compact();b=n,d=e},configure(l){E=l?.process?.visibility?.cell?.capacity??p,z=l?.process?.visibility?.cell?.depth??k,$=l?.process?.visibility?.cell?.size??M},filter(l,t){if(!b||!d)return[];const e=a.bounds(t);let s=[],n=t.zoom;for(;n<l.zoomMax&&s.length<d;)s=b.cells(n,e).flatMap(r=>r.markers),n++;return s.map(r=>r.index)}};class v{methods;constructor(t){this.methods=t}listen(){self.onmessage=this.onmessage.bind(this)}async onmessage(t){const{id:e,method:s,args:n}=t.data;try{const r=this.methods[s];if(typeof r!="function")throw new Error(`Unknown method: ${s}`);const o=await r(...n),i={id:e,result:o};self.postMessage(i)}catch(r){const o=r instanceof Error?r.message:String(r),i={id:e,error:o};self.postMessage(i)}}}new v(_).listen()})();\n', Sn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Gn], { type: "text/javascript;charset=utf-8" });
128
+ const Gn = '(function(){"use strict";function w(l,t,e){return{x:T(t)*e,y:I(l)*e}}function m(l,t,e){return{lat:R(t/e),lng:P(l/e)}}function T(l){return(180+l)/360}function I(l){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l*Math.PI/360)))/360}function P(l){return l*360-180}function R(l){return 360/Math.PI*Math.atan(Math.exp((180-l*360)*Math.PI/180))-90}class c{sw;ne;constructor(t,e,n,s){if(n<t)throw new Error(`Invalid bounds: ${t}, ${e}, ${n}, ${s}`);if(s<e)throw new Error(`Invalid bounds: ${t}, ${e}, ${n}, ${s}`);this.sw={lat:t,lng:e},this.ne={lat:n,lng:s}}contains(t,e){return!(t<this.sw.lat||this.ne.lat<t||e<this.sw.lng||this.ne.lng<e)}intersects(t){return!(t.ne.lat<this.sw.lat||this.ne.lat<t.sw.lat||t.ne.lng<this.sw.lng||this.ne.lng<t.sw.lng)}}class h{blockL;blockR;sw;ne;constructor(t,e,n,s){if(n<t)throw new Error(`Invalid bounds: ${t}, ${e}, ${n}, ${s}`);this.sw={lat:t,lng:e},this.ne={lat:n,lng:s},e<s?(this.blockL=new c(t,e,n,s),this.blockR=new c(0,0,0,0)):(this.blockL=new c(t,-180,n,s),this.blockR=new c(t,e,n,180))}static bounds(t){const e=t.bounds,n=t.center;return e.sw.lng<=n.lng&&e.ne.lng<=n.lng?{sw:{lat:e.sw.lat,lng:-180},ne:{lat:e.ne.lat,lng:180}}:e.sw.lng>=n.lng&&e.ne.lng>=n.lng?{sw:{lat:e.sw.lat,lng:-180},ne:{lat:e.ne.lat,lng:180}}:Math.abs(e.ne.lng-n.lng)+Math.abs(e.sw.lng-n.lng)>360?{sw:{lat:e.sw.lat,lng:-180},ne:{lat:e.ne.lat,lng:180}}:e.ne.lng-e.sw.lng>360?{sw:{lat:e.sw.lat,lng:-180},ne:{lat:e.ne.lat,lng:180}}:t.bounds}static create(t){const e=this.bounds(t),n=e.sw,s=e.ne;return new h(n.lat,n.lng,s.lat,s.lng)}static offset(t,e,n){const s=this.bounds(t),r=t.zoom,o=e*Math.pow(2,r),i=w(s.sw.lat,s.sw.lng,o),a=w(s.ne.lat,s.ne.lng,o);let g=Math.max(i.x-n.left,0),f=Math.min(i.y+n.bottom,o),D=Math.min(a.x+n.right,o),N=Math.max(a.y-n.top,0);const z=m(g,f,o),C=m(D,N,o);return new h(z.lat,z.lng,C.lat,C.lng)}contains(t,e){return this.blockL.contains(t,e)||this.blockR.contains(t,e)}intersects(t){return this.blockL.intersects(t)||this.blockR.intersects(t)}}class S{id;bounds;markers;constructor(t,e){this.id=t,this.bounds=e,this.markers=[]}belongs(t){const e=this.bounds.sw;if(t.lat<e.lat||t.lng<e.lng)return!1;const n=this.bounds.ne;return!(n.lat<t.lat||n.lng<t.lng)}neighbours(t,e){const n=Math.abs(t.id.length-this.id.length);if(n>e)return!1;const s=Math.min(this.id.length,t.id.length)-e+n;for(let r=0;r<s;r++)if(this.id[r]!=t.id[r])return!1;return!0}}class u{tree;zoom;cell;branches;constructor(t,e,n,s){this.tree=t,this.zoom=n,this.cell=new S(e,s),this.branches=new Array}split(){const t=this.cell.bounds,e=Math.pow(2,this.tree.depth),n=(t.ne.lat-t.sw.lat)/e,s=(t.ne.lng-t.sw.lng)/e;for(let r=0;r<e;r++)for(let o=0;o<e;o++){const i=t.sw.lat+r*n,a=t.sw.lng+o*s,g=i+n,f=a+s;this.branches.push(new u(this.tree,`${this.cell.id}${r*2+o}`,this.zoom+this.tree.depth,{sw:{lat:i,lng:a},ne:{lat:g,lng:f}}))}}add(t){if(this.cell.belongs(t)==!1)return!1;if(this.cell.markers.length<this.tree.capacity)return this.cell.markers.push(t),!0;this.branches.length==0&&this.split();for(let e=0;e<this.branches.length;e++)if(this.branches[e].add(t))return!0;throw new Error("Failed to add marker to branch")}compact(){if(this.branches.length==0)return;for(let s=0;s<this.branches.length;s++)this.branches[s].compact();const t=new Array,e=new Array;for(let s=0;s<this.branches.length;s++){const r=this.branches[s];t.push(...r.branches),e.push(...r.cell.markers)}const n=new u(this.tree,this.cell.id,this.zoom+this.tree.depth,this.cell.bounds);n.branches=t,n.cell.markers=e,this.branches=[n]}cells(t,e,n){if(t<this.zoom||e.intersects(this.cell.bounds)==!1)return n;n.push(this.cell);for(let s=0;s<this.branches.length;s++)this.branches[s].cells(t,e,n);return n}print(t){console.log(`${"---".repeat(t)}|${this.cell.id} zoom=[${this.zoom}] markers=[${this.cell.markers.length}]`);for(let e=0;e<this.branches.length;e++)this.branches[e].print(t+1)}count(){return this.cell.markers.length+this.branches.reduce((t,e)=>t+e.count(),0)}}class x{capacity;depth;root;constructor(t,e,n){this.capacity=n,this.depth=e,this.root=new u(this,"R",t,{sw:{lat:-90,lng:-180},ne:{lat:90,lng:180}})}add(t){return this.root.add(t)}compact(){this.root.compact()}cells(t,e){const n=new Array;return this.root.cells(t,e,n),n}print(){this.root.print(0)}}const A=16,p=2,k=1,M=A*4;let b,d,E=p,$=k,y=M;const v={update(l,t,e){const n=-Math.floor(Math.log2(l.mapSize/y)),s=new x(n,$,E);for(let o=0;o<t.length;o++){const i=t[o];if(!s.add(i))throw new Error("Failed to add marker to tree")}const r=-n;for(let o=0;o<r;o++)s.compact();b=s,d=e},configure(l){E=l?.process?.visibility?.cell?.capacity??p,$=l?.process?.visibility?.cell?.depth??k,y=l?.process?.visibility?.cell?.size??M},filter(l,t){if(!b||!d)return[];const e=h.create(t);let n=[],s=t.zoom;for(;s<l.zoomMax&&n.length<d;)n=b.cells(s,e).flatMap(r=>r.markers),s++;return n.map(r=>r.index)}};class _{methods;constructor(t){this.methods=t}listen(){self.onmessage=this.onmessage.bind(this)}async onmessage(t){const{id:e,method:n,args:s}=t.data;try{const r=this.methods[n];if(typeof r!="function")throw new Error(`Unknown method: ${n}`);const o=await r(...s),i={id:e,result:o};self.postMessage(i)}catch(r){const o=r instanceof Error?r.message:String(r),i={id:e,error:o};self.postMessage(i)}}}new _(v).listen()})();\n', Sn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Gn], { type: "text/javascript;charset=utf-8" });
150
129
  function _s(t) {
151
130
  let e;
152
131
  try {
@@ -208,17 +187,12 @@ class ot {
208
187
  if (r < e) throw new Error(`Invalid bounds: ${e}, ${n}, ${r}, ${s}`);
209
188
  this.sw = { lat: e, lng: n }, this.ne = { lat: r, lng: s }, n < s ? (this.blockL = new mt(e, n, r, s), this.blockR = new mt(0, 0, 0, 0)) : (this.blockL = new mt(e, -180, r, s), this.blockR = new mt(e, n, r, 180));
210
189
  }
211
- static normalize(e) {
190
+ static bounds(e) {
212
191
  const n = e.bounds, r = e.center;
213
- if (Math.abs(n.ne.lng - r.lng) + Math.abs(n.sw.lng - r.lng) > 360 && (n.sw.lng = -180, n.ne.lng = 180), n.ne.lng - n.sw.lng > 360) {
214
- n.sw.lng = -180, n.ne.lng = 180;
215
- return;
216
- }
217
- n.sw.lng < -180 && (n.sw.lng += 360), n.sw.lng > 180 && (n.sw.lng -= 360), n.ne.lng < -180 && (n.ne.lng += 360), n.ne.lng > 180 && (n.ne.lng -= 360);
192
+ return n.sw.lng <= r.lng && n.ne.lng <= r.lng ? { sw: { lat: n.sw.lat, lng: -180 }, ne: { lat: n.ne.lat, lng: 180 } } : n.sw.lng >= r.lng && n.ne.lng >= r.lng ? { sw: { lat: n.sw.lat, lng: -180 }, ne: { lat: n.ne.lat, lng: 180 } } : Math.abs(n.ne.lng - r.lng) + Math.abs(n.sw.lng - r.lng) > 360 ? { sw: { lat: n.sw.lat, lng: -180 }, ne: { lat: n.ne.lat, lng: 180 } } : n.ne.lng - n.sw.lng > 360 ? { sw: { lat: n.sw.lat, lng: -180 }, ne: { lat: n.ne.lat, lng: 180 } } : e.bounds;
218
193
  }
219
- static bounds(e) {
220
- this.normalize(e);
221
- const n = e.bounds, r = n.sw, s = n.ne;
194
+ static create(e) {
195
+ const n = this.bounds(e), r = n.sw, s = n.ne;
222
196
  return new ot(r.lat, r.lng, s.lat, s.lng);
223
197
  }
224
198
  /**
@@ -228,8 +202,7 @@ class ot {
228
202
  * @param offsetY - The y offset of the map in pixels at zoom level n.
229
203
  */
230
204
  static offset(e, n, r) {
231
- this.normalize(e);
232
- const s = e.bounds, i = e.zoom, a = n * Math.pow(2, i), o = st(s.sw.lat, s.sw.lng, a), l = st(s.ne.lat, s.ne.lng, a);
205
+ const s = this.bounds(e), i = e.zoom, a = n * Math.pow(2, i), o = st(s.sw.lat, s.sw.lng, a), l = st(s.ne.lat, s.ne.lng, a);
233
206
  let u = Math.max(o.x - r.left, 0), c = Math.min(o.y + r.bottom, a), f = Math.min(l.x + r.right, a), h = Math.max(l.y - r.top, 0);
234
207
  const m = Pn(u, c, a), p = Pn(f, h, a);
235
208
  return new ot(m.lat, m.lng, p.lat, p.lng);
@@ -241,7 +214,7 @@ class ot {
241
214
  return this.blockL.intersects(e) || this.blockR.intersects(e);
242
215
  }
243
216
  }
244
- const Ss = 75, Ps = 150, In = 25e-5, Is = 1e6, As = 2e6, An = 3e6, Kn = 10, Ut = 16, Qn = 2, $e = 0.5, Yt = "white", Ts = "darkgreen", er = "0px 2px 2px rgba(0, 0, 0, 0.5)", Tn = 1024;
217
+ const Ss = 75, Ps = 150, In = 25e-5, Is = 1e6, As = 2e6, An = 3e6, Kn = 10, Ut = 16, Qn = 2, Fe = 0.5, Yt = "white", Ts = "darkgreen", er = "0px 2px 2px rgba(0, 0, 0, 0.5)", Tn = 1024;
245
218
  class Ns {
246
219
  // Services
247
220
  provider;
@@ -283,8 +256,8 @@ class Ns {
283
256
  }
284
257
  }
285
258
  const Xt = !1;
286
- var Cs = Array.isArray, Rs = Array.prototype.indexOf, He = Array.prototype.includes, Ds = Array.from, Os = Object.defineProperty, it = Object.getOwnPropertyDescriptor, zs = Object.prototype, Ls = Array.prototype, $s = Object.getPrototypeOf, Nn = Object.isExtensible;
287
- function Fs(t) {
259
+ var Cs = Array.isArray, Rs = Array.prototype.indexOf, He = Array.prototype.includes, Ds = Array.from, Os = Object.defineProperty, it = Object.getOwnPropertyDescriptor, $s = Object.prototype, zs = Array.prototype, Fs = Object.getPrototypeOf, Nn = Object.isExtensible;
260
+ function Ls(t) {
288
261
  for (var e = 0; e < t.length; e++)
289
262
  t[e]();
290
263
  }
@@ -294,7 +267,7 @@ function tr() {
294
267
  });
295
268
  return { promise: n, resolve: t, reject: e };
296
269
  }
297
- const O = 2, Mt = 4, It = 8, nr = 1 << 24, ge = 16, Se = 32, ze = 64, nn = 128, J = 512, D = 1024, $ = 2048, se = 4096, _e = 8192, be = 16384, rr = 32768, Et = 65536, Cn = 1 << 17, sr = 1 << 18, Ge = 1 << 19, Vs = 1 << 20, Oe = 32768, Jt = 1 << 21, rn = 1 << 22, Me = 1 << 23, kt = /* @__PURE__ */ Symbol("$state"), Ve = new class extends Error {
270
+ const O = 2, Mt = 4, It = 8, nr = 1 << 24, ge = 16, Se = 32, $e = 64, nn = 128, J = 512, D = 1024, F = 2048, se = 4096, _e = 8192, be = 16384, rr = 32768, Et = 65536, Cn = 1 << 17, sr = 1 << 18, Ge = 1 << 19, Vs = 1 << 20, Oe = 32768, Jt = 1 << 21, rn = 1 << 22, Me = 1 << 23, kt = /* @__PURE__ */ Symbol("$state"), Ve = new class extends Error {
298
271
  name = "StaleReactionError";
299
272
  message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
300
273
  }();
@@ -357,7 +330,7 @@ function ar() {
357
330
  let je = [];
358
331
  function Xs() {
359
332
  var t = je;
360
- je = [], Fs(t);
333
+ je = [], Ls(t);
361
334
  }
362
335
  function Ne(t) {
363
336
  if (je.length === 0) {
@@ -408,7 +381,7 @@ function lr(t) {
408
381
  ));
409
382
  }
410
383
  function ur(t, e, n) {
411
- (t.f & $) !== 0 ? e.add(t) : (t.f & se) !== 0 && n.add(t), lr(t.deps), P(t, D);
384
+ (t.f & F) !== 0 ? e.add(t) : (t.f & se) !== 0 && n.add(t), lr(t.deps), P(t, D);
412
385
  }
413
386
  const vt = /* @__PURE__ */ new Set();
414
387
  let S = null, te = null, ee = [], ln = null, Gt = !1;
@@ -491,7 +464,7 @@ class Ee {
491
464
  if (n) {
492
465
  this.#t.delete(e);
493
466
  for (var r of n.d)
494
- P(r, $), oe(r);
467
+ P(r, F), oe(r);
495
468
  for (r of n.m)
496
469
  P(r, se), oe(r);
497
470
  }
@@ -525,7 +498,7 @@ class Ee {
525
498
  #l(e, n, r) {
526
499
  e.f ^= D;
527
500
  for (var s = e.first, i = null; s !== null; ) {
528
- var a = s.f, o = (a & (Se | ze)) !== 0, l = o && (a & D) !== 0, u = l || (a & _e) !== 0 || this.#t.has(s);
501
+ var a = s.f, o = (a & (Se | $e)) !== 0, l = o && (a & D) !== 0, u = l || (a & _e) !== 0 || this.#t.has(s);
529
502
  if (!u && s.fn !== null) {
530
503
  o ? s.f ^= D : i !== null && (a & (Mt | It | nr)) !== 0 ? i.b.defer_effect(s) : (a & Mt) !== 0 ? n.push(s) : ht(s) && ((a & ge) !== 0 && this.#e.add(s), lt(s));
531
504
  var c = s.first;
@@ -630,7 +603,7 @@ class Ee {
630
603
  }
631
604
  revive() {
632
605
  for (const e of this.#s)
633
- this.#e.delete(e), P(e, $), oe(e);
606
+ this.#e.delete(e), P(e, F), oe(e);
634
607
  for (const e of this.#e)
635
608
  P(e, se), oe(e);
636
609
  this.flush();
@@ -716,7 +689,7 @@ function cr(t, e, n, r) {
716
689
  e,
717
690
  n,
718
691
  r
719
- ) : (i & (rn | ge)) !== 0 && (i & $) === 0 && hr(s, e, r) && (P(s, $), oe(
692
+ ) : (i & (rn | ge)) !== 0 && (i & F) === 0 && hr(s, e, r) && (P(s, F), oe(
720
693
  /** @type {Effect} */
721
694
  s
722
695
  ));
@@ -749,7 +722,7 @@ function oe(t) {
749
722
  var n = e.f;
750
723
  if (Gt && e === _ && (n & ge) !== 0 && (n & sr) === 0)
751
724
  return;
752
- if ((n & (ze | Se)) !== 0) {
725
+ if ((n & ($e | Se)) !== 0) {
753
726
  if ((n & D) === 0) return;
754
727
  e.f ^= D;
755
728
  }
@@ -758,7 +731,7 @@ function oe(t) {
758
731
  }
759
732
  function fr(t, e) {
760
733
  if (!((t.f & Se) !== 0 && (t.f & D) !== 0)) {
761
- (t.f & $) !== 0 ? e.d.push(t) : (t.f & se) !== 0 && e.m.push(t), P(t, D);
734
+ (t.f & F) !== 0 ? e.d.push(t) : (t.f & se) !== 0 && e.m.push(t), P(t, D);
762
735
  for (var n = t.first; n !== null; )
763
736
  fr(n, e), n = n.next;
764
737
  }
@@ -921,7 +894,7 @@ class ni {
921
894
  if (this.#c += e, this.#c === 0) {
922
895
  this.is_pending = !1;
923
896
  for (const n of this.#m)
924
- P(n, $), oe(n);
897
+ P(n, F), oe(n);
925
898
  for (const n of this.#v)
926
899
  P(n, se), oe(n);
927
900
  this.#m.clear(), this.#v.clear(), this.#e && _t(this.#e, () => {
@@ -1032,7 +1005,7 @@ function Kt() {
1032
1005
  }
1033
1006
  // @__NO_SIDE_EFFECTS__
1034
1007
  function ii(t) {
1035
- var e = O | $, n = w !== null && (w.f & O) !== 0 ? (
1008
+ var e = O | F, n = w !== null && (w.f & O) !== 0 ? (
1036
1009
  /** @type {Derived} */
1037
1010
  w
1038
1011
  ) : null;
@@ -1193,9 +1166,9 @@ function xt(t, e) {
1193
1166
  /** @type {Derived} */
1194
1167
  t
1195
1168
  );
1196
- (t.f & $) !== 0 && un(s), on(s);
1169
+ (t.f & F) !== 0 && un(s), on(s);
1197
1170
  }
1198
- t.wv = Tr(), vr(t, $), _ !== null && (_.f & D) !== 0 && (_.f & (Se | ze)) === 0 && (X === null ? bi([t]) : X.push(t)), !r.is_fork && Qt.size > 0 && !mr && li();
1171
+ t.wv = Tr(), vr(t, F), _ !== null && (_.f & D) !== 0 && (_.f & (Se | $e)) === 0 && (X === null ? bi([t]) : X.push(t)), !r.is_fork && Qt.size > 0 && !mr && li();
1199
1172
  }
1200
1173
  return e;
1201
1174
  }
@@ -1212,7 +1185,7 @@ function vr(t, e) {
1212
1185
  var n = t.reactions;
1213
1186
  if (n !== null)
1214
1187
  for (var r = n.length, s = 0; s < r; s++) {
1215
- var i = n[s], a = i.f, o = (a & $) === 0;
1188
+ var i = n[s], a = i.f, o = (a & F) === 0;
1216
1189
  if (o && P(i, e), (a & O) !== 0) {
1217
1190
  var l = (
1218
1191
  /** @type {Derived} */
@@ -1231,16 +1204,16 @@ function vr(t, e) {
1231
1204
  function tt(t) {
1232
1205
  if (typeof t != "object" || t === null || kt in t)
1233
1206
  return t;
1234
- const e = $s(t);
1235
- if (e !== zs && e !== Ls)
1207
+ const e = Fs(t);
1208
+ if (e !== $s && e !== zs)
1236
1209
  return t;
1237
1210
  var n = /* @__PURE__ */ new Map(), r = Cs(t), s = /* @__PURE__ */ B(0), i = Ce, a = (o) => {
1238
1211
  if (Ce === i)
1239
1212
  return o();
1240
1213
  var l = w, u = Ce;
1241
- K(null), Ln(i);
1214
+ K(null), zn(i);
1242
1215
  var c = o();
1243
- return K(l), Ln(u), c;
1216
+ return K(l), zn(u), c;
1244
1217
  };
1245
1218
  return r && n.set("length", /* @__PURE__ */ B(
1246
1219
  /** @type {any[]} */
@@ -1412,7 +1385,7 @@ function ye(t, e, n) {
1412
1385
  ctx: ie,
1413
1386
  deps: null,
1414
1387
  nodes: null,
1415
- f: t | $ | J,
1388
+ f: t | F | J,
1416
1389
  first: null,
1417
1390
  fn: e,
1418
1391
  last: null,
@@ -1433,7 +1406,7 @@ function ye(t, e, n) {
1433
1406
  else e !== null && oe(s);
1434
1407
  var i = s;
1435
1408
  if (n && i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && // either `null`, or a singular child
1436
- (i.f & Ge) === 0 && (i = i.first, (t & ge) !== 0 && (t & Et) !== 0 && i !== null && (i.f |= Et)), i !== null && (i.parent = r, r !== null && hi(i, r), w !== null && (w.f & O) !== 0 && (t & ze) === 0)) {
1409
+ (i.f & Ge) === 0 && (i = i.first, (t & ge) !== 0 && (t & Et) !== 0 && i !== null && (i.f |= Et)), i !== null && (i.parent = r, r !== null && hi(i, r), w !== null && (w.f & O) !== 0 && (t & $e) === 0)) {
1437
1410
  var a = (
1438
1411
  /** @type {Derived} */
1439
1412
  w
@@ -1454,7 +1427,7 @@ function pi(t) {
1454
1427
  }
1455
1428
  function di(t) {
1456
1429
  Ee.ensure();
1457
- const e = ye(ze | Ge, t, !0);
1430
+ const e = ye($e | Ge, t, !0);
1458
1431
  return (n = {}) => new Promise((r) => {
1459
1432
  n.outro ? _t(e, () => {
1460
1433
  le(e), r(void 0);
@@ -1486,11 +1459,11 @@ function xr(t) {
1486
1459
  var e = t.teardown;
1487
1460
  if (e !== null) {
1488
1461
  const n = Xe, r = w;
1489
- zn(!0), K(null);
1462
+ $n(!0), K(null);
1490
1463
  try {
1491
1464
  e.call(null);
1492
1465
  } finally {
1493
- zn(n), K(r);
1466
+ $n(n), K(r);
1494
1467
  }
1495
1468
  }
1496
1469
  }
@@ -1502,7 +1475,7 @@ function Sr(t, e = !1) {
1502
1475
  s.abort(Ve);
1503
1476
  });
1504
1477
  var r = n.next;
1505
- (n.f & ze) !== 0 ? n.parent = null : le(n, e), n = r;
1478
+ (n.f & $e) !== 0 ? n.parent = null : le(n, e), n = r;
1506
1479
  }
1507
1480
  }
1508
1481
  function yi(t) {
@@ -1573,7 +1546,7 @@ function ki(t, e) {
1573
1546
  }
1574
1547
  }
1575
1548
  let bt = !1, Xe = !1;
1576
- function zn(t) {
1549
+ function $n(t) {
1577
1550
  Xe = t;
1578
1551
  }
1579
1552
  let w = null, ne = !1;
@@ -1593,7 +1566,7 @@ function bi(t) {
1593
1566
  X = t;
1594
1567
  }
1595
1568
  let Ar = 1, Te = 0, Ce = Te;
1596
- function Ln(t) {
1569
+ function zn(t) {
1597
1570
  Ce = t;
1598
1571
  }
1599
1572
  function Tr() {
@@ -1601,7 +1574,7 @@ function Tr() {
1601
1574
  }
1602
1575
  function ht(t) {
1603
1576
  var e = t.f;
1604
- if ((e & $) !== 0)
1577
+ if ((e & F) !== 0)
1605
1578
  return !0;
1606
1579
  if (e & O && (t.f &= ~Oe), (e & se) !== 0) {
1607
1580
  for (var n = (
@@ -1634,7 +1607,7 @@ function Nr(t, e, n = !0) {
1634
1607
  i,
1635
1608
  e,
1636
1609
  !1
1637
- ) : e === i && (n ? P(i, $) : (i.f & D) !== 0 && P(i, se), oe(
1610
+ ) : e === i && (n ? P(i, F) : (i.f & D) !== 0 && P(i, se), oe(
1638
1611
  /** @type {Effect} */
1639
1612
  i
1640
1613
  ));
@@ -1643,7 +1616,7 @@ function Nr(t, e, n = !0) {
1643
1616
  function Cr(t) {
1644
1617
  var e = U, n = Y, r = X, s = w, i = G, a = ie, o = ne, l = Ce, u = t.f;
1645
1618
  U = /** @type {null | Value[]} */
1646
- null, Y = 0, X = null, w = (u & (Se | ze)) === 0 ? t : null, G = null, Ze(t.ctx), ne = !1, Ce = ++Te, t.ac !== null && (br(() => {
1619
+ null, Y = 0, X = null, w = (u & (Se | $e)) === 0 ? t : null, G = null, Ze(t.ctx), ne = !1, Ce = ++Te, t.ac !== null && (br(() => {
1647
1620
  t.ac.abort(Ve);
1648
1621
  }), t.ac = null);
1649
1622
  try {
@@ -1663,7 +1636,7 @@ function Cr(t) {
1663
1636
  for (p = Y; p < h.length; p++)
1664
1637
  (h[p].reactions ??= []).push(t);
1665
1638
  } else !m && h !== null && Y < h.length && (St(t, Y), h.length = Y);
1666
- if (ar() && X !== null && !ne && h !== null && (t.f & (O | se | $)) === 0)
1639
+ if (ar() && X !== null && !ne && h !== null && (t.f & (O | se | F)) === 0)
1667
1640
  for (p = 0; p < /** @type {Source[]} */
1668
1641
  X.length; p++)
1669
1642
  Nr(
@@ -1725,7 +1698,7 @@ function lt(t) {
1725
1698
  var s = Cr(t);
1726
1699
  t.teardown = typeof s == "function" ? s : null, t.wv = Ar;
1727
1700
  var i;
1728
- Xt && Ys && (t.f & $) !== 0 && t.deps;
1701
+ Xt && Ys && (t.f & F) !== 0 && t.deps;
1729
1702
  } finally {
1730
1703
  bt = r, _ = n;
1731
1704
  }
@@ -1799,8 +1772,8 @@ const Ei = ["touchstart", "touchmove"];
1799
1772
  function xi(t) {
1800
1773
  return Ei.includes(t);
1801
1774
  }
1802
- const Si = /* @__PURE__ */ new Set(), $n = /* @__PURE__ */ new Set();
1803
- let Fn = null;
1775
+ const Si = /* @__PURE__ */ new Set(), Fn = /* @__PURE__ */ new Set();
1776
+ let Ln = null;
1804
1777
  function gt(t) {
1805
1778
  var e = this, n = (
1806
1779
  /** @type {Node} */
@@ -1809,8 +1782,8 @@ function gt(t) {
1809
1782
  /** @type {null | Element} */
1810
1783
  s[0] || t.target
1811
1784
  );
1812
- Fn = t;
1813
- var a = 0, o = Fn === t && t.__root;
1785
+ Ln = t;
1786
+ var a = 0, o = Ln === t && t.__root;
1814
1787
  if (o) {
1815
1788
  var l = s.indexOf(o);
1816
1789
  if (l !== -1 && (e === document || e === /** @type {any} */
@@ -1874,7 +1847,7 @@ function Ii(t, e) {
1874
1847
  n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null });
1875
1848
  }
1876
1849
  // @__NO_SIDE_EFFECTS__
1877
- function zr(t, e) {
1850
+ function $r(t, e) {
1878
1851
  var n, r = !t.startsWith("<!>");
1879
1852
  return () => {
1880
1853
  n === void 0 && (n = Pi(r ? t : "<!>" + t), n = /** @type {TemplateNode} */
@@ -1886,7 +1859,7 @@ function zr(t, e) {
1886
1859
  return Ii(s, s), s;
1887
1860
  };
1888
1861
  }
1889
- function Lr(t, e) {
1862
+ function zr(t, e) {
1890
1863
  t !== null && t.before(
1891
1864
  /** @type {Node} */
1892
1865
  e
@@ -1895,7 +1868,7 @@ function Lr(t, e) {
1895
1868
  function fn(t, e) {
1896
1869
  return Ai(t, e);
1897
1870
  }
1898
- const Fe = /* @__PURE__ */ new Map();
1871
+ const Le = /* @__PURE__ */ new Map();
1899
1872
  function Ai(t, { target: e, anchor: n, props: r = {}, events: s, context: i, intro: a = !0 }) {
1900
1873
  ui();
1901
1874
  var o = /* @__PURE__ */ new Set(), l = (f) => {
@@ -1905,12 +1878,12 @@ function Ai(t, { target: e, anchor: n, props: r = {}, events: s, context: i, int
1905
1878
  o.add(m);
1906
1879
  var p = xi(m);
1907
1880
  e.addEventListener(m, gt, { passive: p });
1908
- var v = Fe.get(m);
1909
- v === void 0 ? (document.addEventListener(m, gt, { passive: p }), Fe.set(m, 1)) : Fe.set(m, v + 1);
1881
+ var v = Le.get(m);
1882
+ v === void 0 ? (document.addEventListener(m, gt, { passive: p }), Le.set(m, 1)) : Le.set(m, v + 1);
1910
1883
  }
1911
1884
  }
1912
1885
  };
1913
- l(Ds(Si)), $n.add(l);
1886
+ l(Ds(Si)), Fn.add(l);
1914
1887
  var u = void 0, c = di(() => {
1915
1888
  var f = n ?? e.appendChild(kr());
1916
1889
  return ti(
@@ -1936,30 +1909,30 @@ function Ai(t, { target: e, anchor: n, props: r = {}, events: s, context: i, int
1936
1909
  e.removeEventListener(h, gt);
1937
1910
  var m = (
1938
1911
  /** @type {number} */
1939
- Fe.get(h)
1912
+ Le.get(h)
1940
1913
  );
1941
- --m === 0 ? (document.removeEventListener(h, gt), Fe.delete(h)) : Fe.set(h, m);
1914
+ --m === 0 ? (document.removeEventListener(h, gt), Le.delete(h)) : Le.set(h, m);
1942
1915
  }
1943
- $n.delete(l), f !== n && f.parentNode?.removeChild(f);
1916
+ Fn.delete(l), f !== n && f.parentNode?.removeChild(f);
1944
1917
  };
1945
1918
  });
1946
1919
  return Ti.set(u, c), u;
1947
1920
  }
1948
1921
  let Ti = /* @__PURE__ */ new WeakMap();
1949
- function $r(t) {
1922
+ function Fr(t) {
1950
1923
  var e, n, r = "";
1951
1924
  if (typeof t == "string" || typeof t == "number") r += t;
1952
1925
  else if (typeof t == "object") if (Array.isArray(t)) {
1953
1926
  var s = t.length;
1954
- for (e = 0; e < s; e++) t[e] && (n = $r(t[e])) && (r && (r += " "), r += n);
1927
+ for (e = 0; e < s; e++) t[e] && (n = Fr(t[e])) && (r && (r += " "), r += n);
1955
1928
  } else for (n in t) t[n] && (r && (r += " "), r += n);
1956
1929
  return r;
1957
1930
  }
1958
1931
  function Ni() {
1959
- for (var t, e, n = 0, r = "", s = arguments.length; n < s; n++) (t = arguments[n]) && (e = $r(t)) && (r && (r += " "), r += e);
1932
+ for (var t, e, n = 0, r = "", s = arguments.length; n < s; n++) (t = arguments[n]) && (e = Fr(t)) && (r && (r += " "), r += e);
1960
1933
  return r;
1961
1934
  }
1962
- function Fr(t) {
1935
+ function Lr(t) {
1963
1936
  return typeof t == "object" ? Ni(t) : t ?? "";
1964
1937
  }
1965
1938
  function Ci(t, e, n) {
@@ -2044,7 +2017,7 @@ class ft {
2044
2017
  rank;
2045
2018
  marker;
2046
2019
  constructor(e, n) {
2047
- if (new.target === ft) throw new Error("Cannot instantiate an abstract class directly.");
2020
+ if (new.target === ft) throw new Error("Unsupported code");
2048
2021
  this.shown = !0, this.id = e.id, this.lat = e.lat, this.lng = e.lng, this.rank = e.rank, this.marker = n;
2049
2022
  }
2050
2023
  }
@@ -2054,15 +2027,15 @@ function jr(t) {
2054
2027
  return -0.5 * (Math.cos(Math.PI * t) - 1);
2055
2028
  }
2056
2029
  class Br {
2057
- animationEasing;
2058
- animationRun;
2059
2030
  animating;
2031
+ animationEasing;
2032
+ animationCallback;
2060
2033
  value;
2061
2034
  time;
2062
2035
  constructor(e) {
2063
- if (e.max <= e.min) throw new Error("Min must be less than max");
2064
- if (e.value < e.min || e.max < e.value) throw new Error("Value must be between min and max");
2065
- this.animationEasing = e.easing, this.animationRun = e.callback, this.animating = !1, this.value = { current: e.value, start: e.value, end: e.value, min: e.min, max: e.max }, this.time = { start: 0, end: 0, span: e.timespan };
2036
+ if (e.max <= e.min) throw new Error("Invalid min or max");
2037
+ if (e.value < e.min || e.max < e.value) throw new Error("Invalid value");
2038
+ this.animationEasing = e.easing, this.animationCallback = e.callback, this.animating = !1, this.value = { current: e.value, start: e.value, end: e.value, min: e.min, max: e.max }, this.time = { start: 0, end: 0, span: e.timespan };
2066
2039
  }
2067
2040
  animationFrame() {
2068
2041
  const e = performance.now();
@@ -2072,7 +2045,7 @@ class Br {
2072
2045
  const n = (e - this.time.start) / (this.time.end - this.time.start), r = this.animationEasing(n);
2073
2046
  this.value.current = this.value.start + (this.value.end - this.value.start) * r;
2074
2047
  }
2075
- if (this.animationRun(this.value.current), this.value.current === this.value.end) {
2048
+ if (this.animationCallback(this.value.current), this.value.current === this.value.end) {
2076
2049
  this.animating = !1;
2077
2050
  return;
2078
2051
  }
@@ -2088,7 +2061,7 @@ class Br {
2088
2061
  if (e === this.value.end) return;
2089
2062
  this.value.current = e, this.value.start = e, this.value.end = e;
2090
2063
  const n = performance.now();
2091
- this.time.start = n, this.time.end = n, window.requestAnimationFrame(this.animationRun.bind(this, e));
2064
+ this.time.start = n, this.time.end = n, window.requestAnimationFrame(this.animationCallback.bind(this, e));
2092
2065
  }
2093
2066
  end() {
2094
2067
  this.set(this.value.end);
@@ -2097,12 +2070,12 @@ class Br {
2097
2070
  return performance.now() > this.time.end;
2098
2071
  }
2099
2072
  }
2100
- var Oi = /* @__PURE__ */ zr("<div></div>");
2101
- function zi(t, e) {
2073
+ var Oi = /* @__PURE__ */ $r("<div></div>");
2074
+ function $i(t, e) {
2102
2075
  sn(e, !0);
2103
2076
  let n = e.id, r = e.style, s = e.content, i = {
2104
2077
  setDisplayed: he,
2105
- getDisplayed: Le,
2078
+ getDisplayed: ze,
2106
2079
  setSuppressed: Ie,
2107
2080
  setCollapsed: fe,
2108
2081
  getCollapsed: we,
@@ -2125,12 +2098,12 @@ function zi(t, e) {
2125
2098
  k == !1 && Z.end();
2126
2099
  }
2127
2100
  }
2128
- function Le() {
2101
+ function ze() {
2129
2102
  return M(v);
2130
2103
  }
2131
2104
  let Pe = /* @__PURE__ */ B(!0);
2132
2105
  function Ie(k) {
2133
- k != M(Pe) && (W(Pe, k, !0), k && (Q = $e, Z.set($e)));
2106
+ k != M(Pe) && (W(Pe, k, !0), k && (Q = Fe, Z.set(Fe)));
2134
2107
  }
2135
2108
  let j = /* @__PURE__ */ B(!0);
2136
2109
  function fe(k) {
@@ -2139,8 +2112,8 @@ function zi(t, e) {
2139
2112
  function we() {
2140
2113
  return M(v) ? Z.expired() : !0;
2141
2114
  }
2142
- let Q = $e, Z = new Br({
2143
- value: $e,
2115
+ let Q = Fe, Z = new Br({
2116
+ value: Fe,
2144
2117
  min: 0,
2145
2118
  max: 1,
2146
2119
  timespan: Ss,
@@ -2163,7 +2136,7 @@ function zi(t, e) {
2163
2136
  Vr(
2164
2137
  pe,
2165
2138
  1,
2166
- Fr([
2139
+ Lr([
2167
2140
  "pin",
2168
2141
  M(v) && "displayed",
2169
2142
  M(Pe) && "suppressed"
@@ -2180,13 +2153,13 @@ function zi(t, e) {
2180
2153
  "background-color": m,
2181
2154
  "border-width": `${f}px`,
2182
2155
  "box-shadow": p,
2183
- scale: $e,
2184
- filter: `brightness(${pt($e)})`
2156
+ scale: Fe,
2157
+ filter: `brightness(${pt(Fe)})`
2185
2158
  })
2186
2159
  ]
2187
- ), Lr(t, pe), an(Ct);
2160
+ ), zr(t, pe), an(Ct);
2188
2161
  }
2189
- class Li extends ft {
2162
+ class zi extends ft {
2190
2163
  width;
2191
2164
  height;
2192
2165
  zoom;
@@ -2194,7 +2167,7 @@ class Li extends ft {
2194
2167
  constructor(e, n) {
2195
2168
  super(e, new pn(n, e.lat, e.lng, e.rank));
2196
2169
  const r = e.pin?.style.dimensions.width ?? Ut, s = e.pin?.style.dimensions.height ?? Ut, i = e.pin?.style.dimensions.padding ?? Qn, a = e.pin?.style.dimensions.radius ?? Ut / 2;
2197
- this.width = r, this.height = s, this.zoom = NaN, this.component = fn(zi, {
2170
+ this.width = r, this.height = s, this.zoom = NaN, this.component = fn($i, {
2198
2171
  target: this.marker.div,
2199
2172
  props: {
2200
2173
  id: this.id,
@@ -2274,7 +2247,7 @@ function en(t, e, n) {
2274
2247
  let r = t / 2, s = e / 2, i = Math.sqrt(r * r + s * s), a = Math.atan(s / r) * (180 / Math.PI), o = n * (Math.PI / 180);
2275
2248
  return n < 180 ? n < 90 ? n < a ? { x: 0, y: i * Math.sin(o) - s } : { x: i * Math.cos(o) - r, y: 0 } : n < 180 - a ? { x: i * Math.cos(o) - r, y: 0 } : { x: -t, y: i * Math.sin(o) - s } : n < 270 ? n < 180 + a ? { x: -t, y: i * Math.sin(o) - s } : { x: i * Math.cos(o) - r, y: -e } : n < 360 - a ? { x: i * Math.cos(o) - r, y: -e } : { x: 0, y: i * Math.sin(o) - s };
2276
2249
  }
2277
- var $i = /* @__PURE__ */ zr('<div><div class="element pointer svelte-1no6o2a"></div> <div class="element tooltip svelte-1no6o2a"><div class="element body svelte-1no6o2a"></div></div></div>');
2250
+ var Fi = /* @__PURE__ */ $r('<div><div class="element pointer svelte-1no6o2a"></div> <div class="element tooltip svelte-1no6o2a"><div class="element body svelte-1no6o2a"></div></div></div>');
2278
2251
  function Ur(t, e) {
2279
2252
  sn(e, !0);
2280
2253
  let n = e.id, r = e.style, s = e.content, i = {
@@ -2288,7 +2261,7 @@ function Ur(t, e) {
2288
2261
  function a() {
2289
2262
  return i;
2290
2263
  }
2291
- let o, l = r.colors?.shadow ?? er, u, c = Math.min(r.dimensions.width, r.dimensions.height) / Math.SQRT2 - r.dimensions.margin, f = r.colors?.background ?? Yt, h = Math.max(1, r.dimensions.radius / c), m, p = r.dimensions.width + 2 * r.dimensions.margin, v = r.dimensions.height + 2 * r.dimensions.margin, x = r.dimensions.margin, H, he = r.dimensions.width, Le = r.dimensions.height, Pe = r.dimensions.radius, Ie = r.colors?.background ?? Yt, j = /* @__PURE__ */ B(!1), fe = !1, we = !1;
2264
+ let o, l = r.colors?.shadow ?? er, u, c = Math.min(r.dimensions.width, r.dimensions.height) / Math.SQRT2 - r.dimensions.margin, f = r.colors?.background ?? Yt, h = Math.max(1, r.dimensions.radius / c), m, p = r.dimensions.width + 2 * r.dimensions.margin, v = r.dimensions.height + 2 * r.dimensions.margin, x = r.dimensions.margin, H, he = r.dimensions.width, ze = r.dimensions.height, Pe = r.dimensions.radius, Ie = r.colors?.background ?? Yt, j = /* @__PURE__ */ B(!1), fe = !1, we = !1;
2292
2265
  function Q(y) {
2293
2266
  if (y != M(j)) {
2294
2267
  if (W(j, y, !0), y) {
@@ -2366,37 +2339,37 @@ function Ur(t, e) {
2366
2339
  gn = y, yn();
2367
2340
  }
2368
2341
  function yn() {
2369
- const y = vn, de = gn, me = y + p / 2, Lt = de + v / 2, $t = v < p ? me * v / p : me, Ft = v > p ? Lt * p / v : Lt, fs = Math.atan2(Ft, $t) / Math.PI * 180 - 45, Vt = Math.sqrt($t * $t + Ft * Ft), et = Math.min(p, v) / 2, ps = et * Math.SQRT2, jt = (Vt - et) / (ps - et), En = 0, xn = En + jt * (22.5 - En), ds = Vt < et ? Vt / et : 1, ms = -x * (me / p) * jt, vs = -x * (Lt / v) * jt;
2370
- m.style.transform = `translate(${Math.round(y)}px, ${Math.round(de)}px)`, u.style.transform = `scale(${ds}) rotate(${fs}deg) skew(${xn}deg, ${xn}deg)`, H.style.transform = `translate(${ms}px, ${vs}px)`;
2342
+ const y = vn, de = gn, me = y + p / 2, zt = de + v / 2, Ft = v < p ? me * v / p : me, Lt = v > p ? zt * p / v : zt, fs = Math.atan2(Lt, Ft) / Math.PI * 180 - 45, Vt = Math.sqrt(Ft * Ft + Lt * Lt), et = Math.min(p, v) / 2, ps = et * Math.SQRT2, jt = (Vt - et) / (ps - et), En = 0, xn = En + jt * (22.5 - En), ds = Vt < et ? Vt / et : 1, ms = -x * (me / p) * jt, vs = -x * (zt / v) * jt;
2343
+ m.style.transform = `translate(${Math.round(y)}px, ${Math.round(de)}px)`, u.style.transform = `scale(${ds}) rotate(${fs}deg) skew(${xn}deg, ${xn}deg)`, H.style.transform = `translate(${Math.round(ms)}px, ${Math.round(vs)}px)`;
2371
2344
  }
2372
- var hs = { invoke: a }, Qe = $i();
2345
+ var hs = { invoke: a }, Qe = Fi();
2373
2346
  let wn;
2374
2347
  var Ot = On(Qe);
2375
2348
  let kn;
2376
2349
  rt(Ot, (y) => u = y, () => u);
2377
- var zt = ci(Ot, 2);
2350
+ var $t = ci(Ot, 2);
2378
2351
  let _n;
2379
- var bn = On(zt);
2352
+ var bn = On($t);
2380
2353
  let Mn;
2381
- return rt(bn, (y) => H = y, () => H), rt(zt, (y) => m = y, () => m), rt(Qe, (y) => o = y, () => o), Er(() => {
2382
- Vr(Qe, 1, Fr(["element anchor", M(j) && "displayed"]), "svelte-1no6o2a"), wn = nt(Qe, "", wn, { filter: `drop-shadow(${l})` }), kn = nt(Ot, "", kn, {
2354
+ return rt(bn, (y) => H = y, () => H), rt($t, (y) => m = y, () => m), rt(Qe, (y) => o = y, () => o), Er(() => {
2355
+ Vr(Qe, 1, Lr(["element anchor", M(j) && "displayed"]), "svelte-1no6o2a"), wn = nt(Qe, "", wn, { filter: `drop-shadow(${l})` }), kn = nt(Ot, "", kn, {
2383
2356
  width: `${c}px`,
2384
2357
  height: `${c}px`,
2385
2358
  "background-color": f,
2386
2359
  "border-radius": `${h}px`
2387
- }), _n = nt(zt, "", _n, {
2360
+ }), _n = nt($t, "", _n, {
2388
2361
  width: `${p}px`,
2389
2362
  height: `${v}px`,
2390
2363
  padding: `${x}px`
2391
2364
  }), Mn = nt(bn, "", Mn, {
2392
2365
  width: `${he}px`,
2393
- height: `${Le}px`,
2366
+ height: `${ze}px`,
2394
2367
  "border-radius": `${Pe}px`,
2395
2368
  "background-color": Ie
2396
2369
  });
2397
- }), Lr(t, Qe), an(hs);
2370
+ }), zr(t, Qe), an(hs);
2398
2371
  }
2399
- class Fi extends ft {
2372
+ class Li extends ft {
2400
2373
  width;
2401
2374
  height;
2402
2375
  zoom;
@@ -2445,7 +2418,7 @@ class ji {
2445
2418
  tooltip;
2446
2419
  popup;
2447
2420
  constructor(e, n) {
2448
- this.id = e.id, this.pin = new Li(e, n), this.tooltip = new Fi(e, n), e.popup != null && (this.popup = new Vi(e, n));
2421
+ this.id = e.id, this.pin = new zi(e, n), this.tooltip = new Li(e, n), e.popup != null && (this.popup = new Vi(e, n));
2449
2422
  }
2450
2423
  }
2451
2424
  const qt = 4;
@@ -2522,7 +2495,7 @@ class Wi {
2522
2495
  if (i.contains(a.lat, a.lng))
2523
2496
  if (Number.isNaN(a.zoom) == !1 && a.shown && a.zoom <= r) {
2524
2497
  const o = a.states.findLast((l) => l[0] <= r)?.[1];
2525
- if (o == null) throw new Error("Angle not found");
2498
+ if (o == null) throw new Error("Failed to find angle");
2526
2499
  a.angle = o, a.component.invoke().setDisplayed(!0), a.component.invoke().setCollapsed(!1), a.component.invoke().setAngle(o), a.marker.insert();
2527
2500
  } else
2528
2501
  a.component.invoke().setCollapsed(!0), a.component.invoke().getCollapsed() && (a.component.invoke().setDisplayed(!1), a.marker.remove());
@@ -2549,7 +2522,7 @@ class qi {
2549
2522
  }
2550
2523
  show(e, n) {
2551
2524
  if (!e.popup || !e.tooltip || !e.pin || (e.pin.shown = !1, e.tooltip.shown = !1, e.popup.angle = e.tooltip.angle, e.popup.shown = !0, this.pan == !1)) return;
2552
- const r = e.popup, s = n.getViewport(), i = s.bounds, a = s.zoom, l = n.getParameters().mapSize * Math.pow(2, a), u = st(i.ne.lat, i.sw.lng, l), c = st(i.sw.lat, i.ne.lng, l), f = c.x - u.x, h = c.y - u.y, m = r.width + r.margin * 8, p = r.height + r.margin * 8, v = st(r.lat, r.lng, l), x = en(m, p, e.tooltip.angle), H = v.x + x.x, he = H + m, Le = v.y + x.y, Pe = Le + p, Ie = H - u.x, j = c.x - he, fe = Le - u.y, we = c.y - Pe;
2525
+ const r = e.popup, s = n.getViewport(), i = s.bounds, a = s.zoom, l = n.getParameters().mapSize * Math.pow(2, a), u = st(i.ne.lat, i.sw.lng, l), c = st(i.sw.lat, i.ne.lng, l), f = c.x - u.x, h = c.y - u.y, m = r.width + r.margin * 8, p = r.height + r.margin * 8, v = st(r.lat, r.lng, l), x = en(m, p, e.tooltip.angle), H = v.x + x.x, he = H + m, ze = v.y + x.y, Pe = ze + p, Ie = H - u.x, j = c.x - he, fe = ze - u.y, we = c.y - Pe;
2553
2526
  let Q = 0;
2554
2527
  f < m ? Q = (Ie - j) / 2 : (Ie < 0 && (Q = Ie), j < 0 && (Q = -j));
2555
2528
  let Z = 0;
@@ -2830,11 +2803,11 @@ var Tt = class extends Error {
2830
2803
  }
2831
2804
  };
2832
2805
  // @__NO_SIDE_EFFECTS__
2833
- function z(t) {
2806
+ function $(t) {
2834
2807
  return {
2835
2808
  kind: "transformation",
2836
2809
  type: "args",
2837
- reference: z,
2810
+ reference: $,
2838
2811
  async: !1,
2839
2812
  schema: t,
2840
2813
  "~run"(e, n) {
@@ -2935,11 +2908,11 @@ function C(t, e) {
2935
2908
  };
2936
2909
  }
2937
2910
  // @__NO_SIDE_EFFECTS__
2938
- function F(t) {
2911
+ function L(t) {
2939
2912
  return {
2940
2913
  kind: "transformation",
2941
2914
  type: "returns",
2942
- reference: F,
2915
+ reference: L,
2943
2916
  async: !1,
2944
2917
  schema: t,
2945
2918
  "~run"(e, n) {
@@ -3215,11 +3188,11 @@ function ue(t) {
3215
3188
  };
3216
3189
  }
3217
3190
  // @__NO_SIDE_EFFECTS__
3218
- function L(t, e) {
3191
+ function z(t, e) {
3219
3192
  return {
3220
3193
  kind: "schema",
3221
3194
  type: "tuple",
3222
- reference: L,
3195
+ reference: z,
3223
3196
  expects: "Array",
3224
3197
  async: !1,
3225
3198
  items: t,
@@ -3360,7 +3333,7 @@ function pa(...t) {
3360
3333
  }
3361
3334
  };
3362
3335
  }
3363
- var da = /* @__PURE__ */ g(/* @__PURE__ */ ue(), /* @__PURE__ */ Gr(32)), ma = /* @__PURE__ */ g(/* @__PURE__ */ ue(), /* @__PURE__ */ dn(1)), ss = /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(-90), /* @__PURE__ */ ct(90)), is = /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(-180), /* @__PURE__ */ ct(180)), Pt = /* @__PURE__ */ R({ lat: ss, lng: is }), as = /* @__PURE__ */ R({ sw: Pt, ne: Pt }), va = /* @__PURE__ */ R({ bounds: as, center: Pt, zoom: /* @__PURE__ */ E() }), tn = /* @__PURE__ */ ns((t) => t instanceof HTMLElement, "Must be an HTMLElement"), ga = /* @__PURE__ */ R({ mapSize: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(1)), zoomMin: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), zoomMax: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), zoomScale: /* @__PURE__ */ mn([/* @__PURE__ */ Re(1), /* @__PURE__ */ Re(2), /* @__PURE__ */ Re(10)]) }), ya = /* @__PURE__ */ R({ inserted: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([])), /* @__PURE__ */ F(/* @__PURE__ */ ts())), insert: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([])), /* @__PURE__ */ F(/* @__PURE__ */ De())), remove: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([])), /* @__PURE__ */ F(/* @__PURE__ */ De())), update: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([/* @__PURE__ */ E()])), /* @__PURE__ */ F(/* @__PURE__ */ De())) }), Hn = /* @__PURE__ */ mn([/* @__PURE__ */ Re("idle"), /* @__PURE__ */ Re("move"), /* @__PURE__ */ Re("click")]), wa = /* @__PURE__ */ R({ getParameters: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([])), /* @__PURE__ */ F(ga)), getContainer: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([])), /* @__PURE__ */ F(tn)), getZoom: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([])), /* @__PURE__ */ F(/* @__PURE__ */ E())), getBounds: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([])), /* @__PURE__ */ F(as)), getCenter: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([])), /* @__PURE__ */ F(Pt)), getViewport: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([])), /* @__PURE__ */ F(va)), panBy: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([/* @__PURE__ */ E(), /* @__PURE__ */ E()])), /* @__PURE__ */ F(/* @__PURE__ */ De())), createMarker: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([tn, ss, is, /* @__PURE__ */ E()])), /* @__PURE__ */ F(ya)), subscribe: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([Hn, /* @__PURE__ */ A()])), /* @__PURE__ */ F(/* @__PURE__ */ De())), unsubscribe: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([Hn, /* @__PURE__ */ A()])), /* @__PURE__ */ F(/* @__PURE__ */ De())) }), Zt = /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ z(/* @__PURE__ */ L([/* @__PURE__ */ ue()])), /* @__PURE__ */ Kr(/* @__PURE__ */ pa(/* @__PURE__ */ rs(), /* @__PURE__ */ Xr(), tn))), ka = /* @__PURE__ */ R({ dimensions: /* @__PURE__ */ R({ width: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), height: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), padding: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), radius: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)) }), colors: /* @__PURE__ */ re(/* @__PURE__ */ R({ background: /* @__PURE__ */ re(/* @__PURE__ */ ue()), border: /* @__PURE__ */ re(/* @__PURE__ */ ue()), shadow: /* @__PURE__ */ re(/* @__PURE__ */ ue()) })) }), Zn = /* @__PURE__ */ R({ dimensions: /* @__PURE__ */ g(/* @__PURE__ */ R({ width: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), height: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), margin: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), radius: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)) }), /* @__PURE__ */ Jr((t) => Math.min(t.width, t.height) / t.margin >= 4, "Minimum of width or height must be greater than or equal to 4 * margin")), colors: /* @__PURE__ */ re(/* @__PURE__ */ R({ background: /* @__PURE__ */ re(/* @__PURE__ */ ue()), shadow: /* @__PURE__ */ re(/* @__PURE__ */ ue()) })) }), _a = /* @__PURE__ */ R({ id: /* @__PURE__ */ g(/* @__PURE__ */ ue(), /* @__PURE__ */ dn(1)), rank: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), lat: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(-90), /* @__PURE__ */ ct(90)), lng: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(-180), /* @__PURE__ */ ct(180)), tooltip: /* @__PURE__ */ R({ style: Zn, body: Zt }), pin: /* @__PURE__ */ re(/* @__PURE__ */ R({ style: ka, body: /* @__PURE__ */ re(Zt) })), popup: /* @__PURE__ */ re(/* @__PURE__ */ R({ style: Zn, body: Zt })) });
3336
+ var da = /* @__PURE__ */ g(/* @__PURE__ */ ue(), /* @__PURE__ */ Gr(32)), ma = /* @__PURE__ */ g(/* @__PURE__ */ ue(), /* @__PURE__ */ dn(1)), ss = /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(-90), /* @__PURE__ */ ct(90)), is = /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(-180), /* @__PURE__ */ ct(180)), Pt = /* @__PURE__ */ R({ lat: ss, lng: is }), as = /* @__PURE__ */ R({ sw: Pt, ne: Pt }), va = /* @__PURE__ */ R({ bounds: as, center: Pt, zoom: /* @__PURE__ */ E() }), tn = /* @__PURE__ */ ns((t) => t instanceof HTMLElement, "Must be an HTMLElement"), ga = /* @__PURE__ */ R({ mapSize: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(1)), zoomMin: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), zoomMax: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), zoomScale: /* @__PURE__ */ mn([/* @__PURE__ */ Re(1), /* @__PURE__ */ Re(2), /* @__PURE__ */ Re(10)]) }), ya = /* @__PURE__ */ R({ inserted: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(/* @__PURE__ */ ts())), insert: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(/* @__PURE__ */ De())), remove: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(/* @__PURE__ */ De())), update: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([/* @__PURE__ */ E()])), /* @__PURE__ */ L(/* @__PURE__ */ De())) }), Hn = /* @__PURE__ */ mn([/* @__PURE__ */ Re("idle"), /* @__PURE__ */ Re("move"), /* @__PURE__ */ Re("click")]), wa = /* @__PURE__ */ R({ getParameters: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(ga)), getContainer: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(tn)), getZoom: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(/* @__PURE__ */ E())), getBounds: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(as)), getCenter: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(Pt)), getViewport: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([])), /* @__PURE__ */ L(va)), panBy: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([/* @__PURE__ */ E(), /* @__PURE__ */ E()])), /* @__PURE__ */ L(/* @__PURE__ */ De())), createMarker: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([tn, ss, is, /* @__PURE__ */ E()])), /* @__PURE__ */ L(ya)), subscribe: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([Hn, /* @__PURE__ */ A()])), /* @__PURE__ */ L(/* @__PURE__ */ De())), unsubscribe: /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([Hn, /* @__PURE__ */ A()])), /* @__PURE__ */ L(/* @__PURE__ */ De())) }), Zt = /* @__PURE__ */ g(/* @__PURE__ */ A(), /* @__PURE__ */ $(/* @__PURE__ */ z([/* @__PURE__ */ ue()])), /* @__PURE__ */ Kr(/* @__PURE__ */ pa(/* @__PURE__ */ rs(), /* @__PURE__ */ Xr(), tn))), ka = /* @__PURE__ */ R({ dimensions: /* @__PURE__ */ R({ width: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), height: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), padding: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), radius: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)) }), colors: /* @__PURE__ */ re(/* @__PURE__ */ R({ background: /* @__PURE__ */ re(/* @__PURE__ */ ue()), border: /* @__PURE__ */ re(/* @__PURE__ */ ue()), shadow: /* @__PURE__ */ re(/* @__PURE__ */ ue()) })) }), Zn = /* @__PURE__ */ R({ dimensions: /* @__PURE__ */ g(/* @__PURE__ */ R({ width: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), height: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), margin: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), radius: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)) }), /* @__PURE__ */ Jr((t) => Math.min(t.width, t.height) / t.margin >= 4, "Minimum of width or height must be greater than or equal to 4 * margin")), colors: /* @__PURE__ */ re(/* @__PURE__ */ R({ background: /* @__PURE__ */ re(/* @__PURE__ */ ue()), shadow: /* @__PURE__ */ re(/* @__PURE__ */ ue()) })) }), _a = /* @__PURE__ */ R({ id: /* @__PURE__ */ g(/* @__PURE__ */ ue(), /* @__PURE__ */ dn(1)), rank: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(0)), lat: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(-90), /* @__PURE__ */ ct(90)), lng: /* @__PURE__ */ g(/* @__PURE__ */ E(), /* @__PURE__ */ C(-180), /* @__PURE__ */ ct(180)), tooltip: /* @__PURE__ */ R({ style: Zn, body: Zt }), pin: /* @__PURE__ */ re(/* @__PURE__ */ R({ style: ka, body: /* @__PURE__ */ re(Zt) })), popup: /* @__PURE__ */ re(/* @__PURE__ */ R({ style: Zn, body: Zt })) });
3364
3337
  class ba {
3365
3338
  apiKey;
3366
3339
  apiJwt;
@@ -3402,7 +3375,7 @@ class ba {
3402
3375
  return s.jwt && (this.apiJwt = s.jwt), s.states;
3403
3376
  }
3404
3377
  }
3405
- const Yn = "1.2.20", Ma = "https://maps.api.arenarium.dev/auth", Ea = "https://maps.api.arenarium.dev/log", Xn = 500;
3378
+ const Yn = "1.2.22", Ma = "https://maps.api.arenarium.dev/auth", Ea = "https://maps.api.arenarium.dev/log", Xn = 500;
3406
3379
  class os {
3407
3380
  apiKey;
3408
3381
  mapProvider;
@@ -3424,7 +3397,7 @@ class os {
3424
3397
  this.onMapMove.bind(this),
3425
3398
  this.onMapIdle.bind(this),
3426
3399
  this.onMapClick.bind(this)
3427
- ), this.markers = /* @__PURE__ */ new Map(), this.markerVisibilityManager = new Ns(this.mapProvider), this.markerElementsManager = new Hi(this.mapProvider), this.markerStatesManager = new ba(e, n), this.markerVisibilityProcessor = new Bt(this.onMarkersVisiblityProcess.bind(this), 0), this.markerElementsProcessor = new Bt(this.onMarkersRenderProcess.bind(this), 0), this.markerStateProcessor = new Bt(this.onMarkersStateProcess.bind(this), 0), this.configuration = s;
3400
+ ), this.markers = /* @__PURE__ */ new Map(), this.markerVisibilityManager = new Ns(this.mapProvider), this.markerElementsManager = new Hi(this.mapProvider), this.markerStatesManager = new ba(e, n), this.markerVisibilityProcessor = new Bt(this.onMarkersVisiblityProcess.bind(this)), this.markerElementsProcessor = new Bt(this.onMarkersRenderProcess.bind(this)), this.markerStateProcessor = new Bt(this.onMarkersStateProcess.bind(this)), this.configuration = s;
3428
3401
  }
3429
3402
  //#region Core
3430
3403
  static async create(e, n, r) {
@@ -3478,11 +3451,11 @@ class os {
3478
3451
  //#endregion
3479
3452
  //#region Events
3480
3453
  onMapMove() {
3481
- this.markerVisibilityProcessor.start();
3454
+ this.markerVisibilityProcessor.run();
3482
3455
  }
3483
3456
  onMapIdle() {
3484
- this.markerStatesProcessTimeout ? window.clearTimeout(this.markerStatesProcessTimeout) : this.markerStateProcessor.start(), this.markerStatesProcessTimeout = window.setTimeout(() => {
3485
- this.markerStateProcessor.start();
3457
+ this.markerStatesProcessTimeout ? window.clearTimeout(this.markerStatesProcessTimeout) : this.markerStateProcessor.run(), this.markerStatesProcessTimeout = window.setTimeout(() => {
3458
+ this.markerStateProcessor.run();
3486
3459
  }, this.markerStatesProcessDelay);
3487
3460
  }
3488
3461
  onMapClick() {
@@ -3495,7 +3468,7 @@ class os {
3495
3468
  try {
3496
3469
  if (this.detached()) return !0;
3497
3470
  const e = this.mapProvider.getParameters(), n = this.mapProvider.getViewport(), r = await this.markerVisibilityManager.getMarkersDelta(e, n);
3498
- return this.markerStatesManager.resetStates(r.remove), this.markerElementsManager.removeElements(r.remove), this.markerElementsManager.insertElements(r.insert, this.onMapMarkerClick.bind(this)), this.markerElementsProcessor.start(), this.mapStateProvider.idle() && this.onMapIdle(), !1;
3471
+ return this.markerStatesManager.resetStates(r.remove), this.markerElementsManager.removeElements(r.remove), this.markerElementsManager.insertElements(r.insert, this.onMapMarkerClick.bind(this)), this.markerElementsProcessor.run(), this.mapStateProvider.idle() && this.onMapIdle(), !1;
3499
3472
  } catch (e) {
3500
3473
  return this.clear(), this.error("Process markers visibility error", e), !0;
3501
3474
  }
@@ -3504,7 +3477,7 @@ class os {
3504
3477
  try {
3505
3478
  if (this.detached()) return !0;
3506
3479
  const e = this.mapProvider.getParameters(), n = this.markerVisibilityManager.getMarkers();
3507
- return await this.markerStatesManager.updateStates(n, e), this.markerElementsManager.updateElements(n), this.markerElementsProcessor.start(), !1;
3480
+ return await this.markerStatesManager.updateStates(n, e), this.markerElementsManager.updateElements(n), this.markerElementsProcessor.run(), !1;
3508
3481
  } catch (e) {
3509
3482
  return this.clear(), this.error("Process markers state error", e), !0;
3510
3483
  }
@@ -3527,7 +3500,7 @@ class os {
3527
3500
  for (const s of e)
3528
3501
  this.markers.has(s.id) == !1 && this.markers.set(s.id, new gs(s));
3529
3502
  const r = Array.from(this.markers.values());
3530
- r.sort((s, i) => i.data.rank - s.data.rank), await this.markerVisibilityManager.updateMarkers(n, r), this.mapStateProvider.start(), this.markerVisibilityProcessor.start(), this.markerStateProcessor.start(), this.markerElementsProcessor.start();
3503
+ r.sort((s, i) => i.data.rank - s.data.rank), await this.markerVisibilityManager.updateMarkers(n, r), this.mapStateProvider.start(), this.markerVisibilityProcessor.run(), this.markerStateProcessor.run(), this.markerElementsProcessor.run();
3531
3504
  } catch (n) {
3532
3505
  throw this.clear(), this.error("Failed to update markers", n), n;
3533
3506
  }
@@ -3546,7 +3519,7 @@ class os {
3546
3519
  } catch (n) {
3547
3520
  throw this.markerElementsManager.hidePopups(), this.error("Failed to show popup", n), n;
3548
3521
  } finally {
3549
- this.markerElementsProcessor.start();
3522
+ this.markerElementsProcessor.run();
3550
3523
  }
3551
3524
  }
3552
3525
  hidePopup() {
@@ -3556,7 +3529,7 @@ class os {
3556
3529
  } catch (e) {
3557
3530
  throw this.error("Failed to hide popup", e), e;
3558
3531
  } finally {
3559
- this.markerElementsProcessor.start();
3532
+ this.markerElementsProcessor.run();
3560
3533
  }
3561
3534
  }
3562
3535
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arenarium/maps",
3
- "version": "1.2.21",
3
+ "version": "1.2.23",
4
4
  "license": "MIT",
5
5
  "author": "arenarium",
6
6
  "description": "Visualize complex map markers clearly. A JavaScript library for effective display of map markers, compatible with MapLibre, Mapbox, and Google Maps.",