@arenarium/maps 1.2.29 → 1.2.30

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.d.ts +4 -3
  2. package/dist/main.js +1191 -1252
  3. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -1,4 +1,4 @@
1
- class Ht {
1
+ class Wt {
2
2
  invoked = !1;
3
3
  interval;
4
4
  timeout;
@@ -17,25 +17,25 @@ class Ht {
17
17
  this.invoked = !1, this.timeout && window.clearTimeout(this.timeout), this.timeout = void 0;
18
18
  }
19
19
  }
20
- class _s {
21
- data;
20
+ class xi {
21
+ properites;
22
22
  state;
23
- constructor(e) {
24
- this.data = e, this.state = void 0;
23
+ constructor(e, n, r, i, s, a, o) {
24
+ this.properites = { id: e, lat: n, lng: r, rank: i, pin: s, tooltip: a, popup: o }, this.state = void 0;
25
25
  }
26
26
  get input() {
27
+ const e = this.properites, n = e.tooltip.dimensions;
27
28
  return {
28
- id: this.data.id,
29
- rank: this.data.rank,
30
- lat: this.data.lat,
31
- lng: this.data.lng,
32
- width: this.data.tooltip.style.dimensions.width,
33
- height: this.data.tooltip.style.dimensions.height,
34
- margin: this.data.tooltip.style.dimensions.margin
29
+ id: e.id,
30
+ lat: e.lat,
31
+ lng: e.lng,
32
+ rank: e.rank,
33
+ width: n.width + 2 * n.padding,
34
+ height: n.height + 2 * n.padding
35
35
  };
36
36
  }
37
37
  }
38
- class Ms {
38
+ class Si {
39
39
  callback;
40
40
  timeout;
41
41
  id;
@@ -50,8 +50,8 @@ class Ms {
50
50
  this.id != null && (window.clearInterval(this.id), this.id = void 0);
51
51
  }
52
52
  }
53
- const Es = 100;
54
- class xs {
53
+ const Pi = 100;
54
+ class Ti {
55
55
  viewport = void 0;
56
56
  state = "idle";
57
57
  provider;
@@ -61,8 +61,8 @@ class xs {
61
61
  onMove;
62
62
  onIdle;
63
63
  onClick;
64
- constructor(e, n, r, s, i, a) {
65
- this.provider = e, this.interval = new Ms(this.onInterval.bind(this), Es / (navigator?.hardwareConcurrency ?? 1)), this.onCancel = n, this.onError = r, this.onMove = s, this.onIdle = i, this.onClick = a;
64
+ constructor(e, n, r, i, s, a) {
65
+ this.provider = e, this.interval = new Si(this.onInterval.bind(this), Pi / (navigator?.hardwareConcurrency ?? 1)), this.onCancel = n, this.onError = r, this.onMove = i, this.onIdle = s, this.onClick = a;
66
66
  }
67
67
  start() {
68
68
  this.interval.start(), this.provider.getContainer().addEventListener("click", this.onClick.bind(this));
@@ -86,7 +86,7 @@ class xs {
86
86
  }
87
87
  }
88
88
  }
89
- class sr {
89
+ class lr {
90
90
  worker;
91
91
  workerInvocations;
92
92
  workerInvocationCounter = 0;
@@ -102,31 +102,31 @@ class sr {
102
102
  this.workerInvocations.forEach((n) => n.reject(new Error(e.message))), this.workerInvocations.clear();
103
103
  }
104
104
  invoke(e, ...n) {
105
- return new Promise((r, s) => {
106
- const i = `${e.toString()}_${this.workerInvocationCounter++}_${performance.now()}`, a = { id: i, method: e.toString(), args: n };
107
- this.workerInvocations.set(i, { resolve: r, reject: s }), this.worker.postMessage(a);
105
+ return new Promise((r, i) => {
106
+ const s = `${e.toString()}_${this.workerInvocationCounter++}_${performance.now()}`, a = { id: s, method: e.toString(), args: n };
107
+ this.workerInvocations.set(s, { resolve: r, reject: i }), this.worker.postMessage(a);
108
108
  });
109
109
  }
110
110
  terminate() {
111
111
  this.workerInvocations.forEach((e) => e.reject(new Error("Terminated"))), this.workerInvocations.clear(), this.worker.terminate();
112
112
  }
113
113
  }
114
- class je {
114
+ class Ue {
115
115
  remove;
116
116
  insert;
117
117
  constructor(e, n) {
118
118
  this.remove = e, this.insert = n;
119
119
  }
120
120
  static from(e, n) {
121
- const r = new Set(e), s = new Set(n), i = Array.from(r.difference(s)), a = Array.from(s.difference(r));
122
- return new je(i, a);
121
+ const r = new Set(e), i = new Set(n), s = Array.from(r.difference(i)), a = Array.from(i.difference(r));
122
+ return new Ue(s, a);
123
123
  }
124
124
  static empty() {
125
- return new je([], []);
125
+ return new Ue([], []);
126
126
  }
127
127
  }
128
- const ir = '(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', Cn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", ir], { type: "text/javascript;charset=utf-8" });
129
- function Ss(t) {
128
+ const ur = '(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', Cn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", ur], { type: "text/javascript;charset=utf-8" });
129
+ function Ii(t) {
130
130
  let e;
131
131
  try {
132
132
  if (e = Cn && (self.URL || self.webkitURL).createObjectURL(Cn), !e) throw "";
@@ -138,38 +138,38 @@ function Ss(t) {
138
138
  }), n;
139
139
  } catch {
140
140
  return new Worker(
141
- "data:text/javascript;charset=utf-8," + encodeURIComponent(ir),
141
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(ur),
142
142
  {
143
143
  name: t?.name
144
144
  }
145
145
  );
146
146
  }
147
147
  }
148
- function st(t, e, n) {
149
- return { x: Ps(e) * n, y: Is(t) * n };
148
+ function it(t, e, n) {
149
+ return { x: Ai(e) * n, y: Ni(t) * n };
150
150
  }
151
151
  function Rn(t, e, n) {
152
- return { lat: As(e / n), lng: Ts(t / n) };
152
+ return { lat: Ri(e / n), lng: Ci(t / n) };
153
153
  }
154
- function Ps(t) {
154
+ function Ai(t) {
155
155
  return (180 + t) / 360;
156
156
  }
157
- function Is(t) {
157
+ function Ni(t) {
158
158
  return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + t * Math.PI / 360))) / 360;
159
159
  }
160
- function Ts(t) {
160
+ function Ci(t) {
161
161
  return t * 360 - 180;
162
162
  }
163
- function As(t) {
163
+ function Ri(t) {
164
164
  return 360 / Math.PI * Math.atan(Math.exp((180 - t * 360) * Math.PI / 180)) - 90;
165
165
  }
166
166
  class wt {
167
167
  sw;
168
168
  ne;
169
- constructor(e, n, r, s) {
170
- if (r < e) throw new Error(`Invalid bounds: ${e}, ${n}, ${r}, ${s}`);
171
- if (s < n) throw new Error(`Invalid bounds: ${e}, ${n}, ${r}, ${s}`);
172
- this.sw = { lat: e, lng: n }, this.ne = { lat: r, lng: s };
169
+ constructor(e, n, r, i) {
170
+ if (r < e) throw new Error(`Invalid bounds: ${e}, ${n}, ${r}, ${i}`);
171
+ if (i < n) throw new Error(`Invalid bounds: ${e}, ${n}, ${r}, ${i}`);
172
+ this.sw = { lat: e, lng: n }, this.ne = { lat: r, lng: i };
173
173
  }
174
174
  contains(e, n) {
175
175
  return !(e < this.sw.lat || this.ne.lat < e || n < this.sw.lng || this.ne.lng < n);
@@ -183,17 +183,17 @@ class ot {
183
183
  blockR;
184
184
  sw;
185
185
  ne;
186
- constructor(e, n, r, s) {
187
- if (r < e) throw new Error(`Invalid bounds: ${e}, ${n}, ${r}, ${s}`);
188
- this.sw = { lat: e, lng: n }, this.ne = { lat: r, lng: s }, n < s ? (this.blockL = new wt(e, n, r, s), this.blockR = new wt(0, 0, 0, 0)) : (this.blockL = new wt(e, -180, r, s), this.blockR = new wt(e, n, r, 180));
186
+ constructor(e, n, r, i) {
187
+ if (r < e) throw new Error(`Invalid bounds: ${e}, ${n}, ${r}, ${i}`);
188
+ this.sw = { lat: e, lng: n }, this.ne = { lat: r, lng: i }, n < i ? (this.blockL = new wt(e, n, r, i), this.blockR = new wt(0, 0, 0, 0)) : (this.blockL = new wt(e, -180, r, i), this.blockR = new wt(e, n, r, 180));
189
189
  }
190
190
  static bounds(e) {
191
191
  const n = e.bounds, r = e.center;
192
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;
193
193
  }
194
194
  static create(e) {
195
- const n = this.bounds(e), r = n.sw, s = n.ne;
196
- return new ot(r.lat, r.lng, s.lat, s.lng);
195
+ const n = this.bounds(e), r = n.sw, i = n.ne;
196
+ return new ot(r.lat, r.lng, i.lat, i.lng);
197
197
  }
198
198
  /**
199
199
  * @param viewport - The viewport of the map.
@@ -202,7 +202,7 @@ class ot {
202
202
  * @param offsetY - The y offset of the map in pixels at zoom level n.
203
203
  */
204
204
  static offset(e, n, r) {
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);
205
+ const i = this.bounds(e), s = e.zoom, a = n * Math.pow(2, s), o = it(i.sw.lat, i.sw.lng, a), l = it(i.ne.lat, i.ne.lng, a);
206
206
  let u = Math.max(o.x - r.left, 0), c = Math.min(o.y + r.bottom, a), h = Math.min(l.x + r.right, a), f = Math.max(l.y - r.top, 0);
207
207
  const d = Rn(u, c, a), m = Rn(h, f, a);
208
208
  return new ot(d.lat, d.lng, m.lat, m.lng);
@@ -214,40 +214,35 @@ class ot {
214
214
  return this.blockL.intersects(e) || this.blockR.intersects(e);
215
215
  }
216
216
  }
217
- const Ns = 75, Cs = 150, Dn = 25e-5, Rs = 1e6, Ds = 2e6, On = 3e6, ar = 10, qt = 16, or = 2, Fe = 0.5, Gt = "white", Os = "darkgreen", lr = "drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.5))", zn = 1024;
218
- class zs {
219
- // Services
220
- provider;
217
+ const Di = 75, Oi = 150, Dn = 25e-5, zi = 1e6, Li = 2e6, On = 3e6, cr = 10, zn = 16, Fi = 8, Ln = 2, $e = 0.5, $i = "0px 2px 2px rgba(0, 0, 0, 0.5)", Fn = 8, Vi = 8, Ui = "drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.5))", $n = "white", ji = "darkgreen", Vn = 1024;
218
+ class Bi {
221
219
  // State
222
220
  markers;
223
221
  markersVisible;
224
222
  markerVisibilityTreeWorker;
225
223
  markerVisibilityTreeWorkerClient;
226
- markerVisibilityTreeLimit = zn;
227
- constructor(e) {
228
- this.provider = e;
229
- }
224
+ markerVisibilityTreeLimit = Vn;
230
225
  set configuration(e) {
231
- this.markerVisibilityTreeWorkerClient?.invoke("configure", e), this.markerVisibilityTreeLimit = e?.process?.visibility?.limit ?? zn;
226
+ this.markerVisibilityTreeWorkerClient?.invoke("configure", e), this.markerVisibilityTreeLimit = e?.process?.visibility?.limit ?? Vn;
232
227
  }
233
228
  getMarkers() {
234
229
  return Array.from(this.markersVisible ?? []);
235
230
  }
236
231
  async getMarkersDelta(e, n) {
237
232
  if (this.markerVisibilityTreeWorkerClient && this.markers) {
238
- const r = await this.markerVisibilityTreeWorkerClient.invoke("filter", e, n), s = this.markersVisible, i = r.map((o) => this.markers[o]), a = je.from(s, i);
239
- return this.markersVisible = i, a;
233
+ const r = await this.markerVisibilityTreeWorkerClient.invoke("filter", e, n), i = this.markersVisible, s = r.map((o) => this.markers[o]), a = Ue.from(i, s);
234
+ return this.markersVisible = s, a;
240
235
  } else if (this.markers != this.markersVisible) {
241
- const r = this.markersVisible, s = this.markers, i = je.from(r, s);
242
- return this.markersVisible = s, i;
236
+ const r = this.markersVisible, i = this.markers, s = Ue.from(r, i);
237
+ return this.markersVisible = i, s;
243
238
  } else
244
- return je.empty();
239
+ return Ue.empty();
245
240
  }
246
241
  async updateMarkers(e, n) {
247
- this.markers = n, n.length > this.markerVisibilityTreeLimit ? (this.markerVisibilityTreeWorker = new Ss(), this.markerVisibilityTreeWorkerClient = new sr(this.markerVisibilityTreeWorker), await this.markerVisibilityTreeWorkerClient.invoke(
242
+ this.markers = n, n.length > this.markerVisibilityTreeLimit ? (this.markerVisibilityTreeWorker = new Ii(), this.markerVisibilityTreeWorkerClient = new lr(this.markerVisibilityTreeWorker), await this.markerVisibilityTreeWorkerClient.invoke(
248
243
  "update",
249
244
  e,
250
- n.map((r, s) => ({ index: s, lat: r.data.lat, lng: r.data.lng })),
245
+ n.map((r, i) => ({ index: i, lat: r.properites.lat, lng: r.properites.lng })),
251
246
  this.markerVisibilityTreeLimit
252
247
  )) : (this.markerVisibilityTreeWorker = void 0, this.markerVisibilityTreeWorkerClient = void 0);
253
248
  }
@@ -255,56 +250,56 @@ class zs {
255
250
  this.markers = void 0, this.markersVisible = void 0, this.markerVisibilityTreeWorker = void 0, this.markerVisibilityTreeWorkerClient = void 0;
256
251
  }
257
252
  }
258
- const Kt = !1;
259
- var Ls = Array.isArray, $s = Array.prototype.indexOf, He = Array.prototype.includes, Fs = Array.from, Vs = Object.defineProperty, it = Object.getOwnPropertyDescriptor, js = Object.prototype, Us = Array.prototype, Ws = Object.getPrototypeOf, Ln = Object.isExtensible;
260
- const Bs = () => {
253
+ const Jt = !1;
254
+ var Wi = Array.isArray, Hi = Array.prototype.indexOf, qe = Array.prototype.includes, qi = Array.from, Yi = Object.defineProperty, st = Object.getOwnPropertyDescriptor, Zi = Object.prototype, Xi = Array.prototype, Ji = Object.getPrototypeOf, Un = Object.isExtensible;
255
+ const Gi = () => {
261
256
  };
262
- function Hs(t) {
257
+ function Ki(t) {
263
258
  for (var e = 0; e < t.length; e++)
264
259
  t[e]();
265
260
  }
266
- function ur() {
267
- var t, e, n = new Promise((r, s) => {
268
- t = r, e = s;
261
+ function fr() {
262
+ var t, e, n = new Promise((r, i) => {
263
+ t = r, e = i;
269
264
  });
270
265
  return { promise: n, resolve: t, reject: e };
271
266
  }
272
- const O = 2, lt = 4, At = 8, cr = 1 << 24, ge = 16, Ee = 32, ze = 64, fr = 128, G = 512, D = 1024, F = 2048, se = 4096, ye = 8192, ke = 16384, Nt = 32768, St = 65536, $n = 1 << 17, hr = 1 << 18, Ge = 1 << 19, qs = 1 << 20, Oe = 65536, Qt = 1 << 21, an = 1 << 22, be = 1 << 23, Mt = /* @__PURE__ */ Symbol("$state"), Te = new class extends Error {
267
+ const D = 2, lt = 4, At = 8, hr = 1 << 24, ve = 16, xe = 32, ze = 64, pr = 128, Q = 512, R = 1024, L = 2048, se = 4096, ye = 8192, _e = 16384, Nt = 32768, St = 65536, jn = 1 << 17, dr = 1 << 18, Ke = 1 << 19, Qi = 1 << 20, Oe = 65536, Gt = 1 << 21, nn = 1 << 22, be = 1 << 23, Mt = /* @__PURE__ */ Symbol("$state"), Ie = new class extends Error {
273
268
  name = "StaleReactionError";
274
269
  message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
275
270
  }();
276
- function Zs() {
271
+ function es() {
277
272
  throw new Error("https://svelte.dev/e/async_derived_orphan");
278
273
  }
279
- function Ys() {
274
+ function ts() {
280
275
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
281
276
  }
282
- function Js() {
277
+ function ns() {
283
278
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
284
279
  }
285
- function Xs() {
280
+ function rs() {
286
281
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
287
282
  }
288
- function Gs() {
283
+ function is() {
289
284
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
290
285
  }
291
- function Ks() {
286
+ function ss() {
292
287
  throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
293
288
  }
294
- const Qs = 1, ei = 2, N = /* @__PURE__ */ Symbol(), ti = "http://www.w3.org/1999/xhtml";
295
- function ni() {
289
+ const as = 1, os = 2, C = /* @__PURE__ */ Symbol(), ls = "http://www.w3.org/1999/xhtml";
290
+ function us() {
296
291
  console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
297
292
  }
298
- function pr(t) {
293
+ function mr(t) {
299
294
  return t === this.v;
300
295
  }
301
- let ri = !1, ie = null;
302
- function qe(t) {
303
- ie = t;
296
+ let cs = !1, ae = null;
297
+ function Ye(t) {
298
+ ae = t;
304
299
  }
305
- function on(t, e = !1, n) {
306
- ie = {
307
- p: ie,
300
+ function rn(t, e = !1, n) {
301
+ ae = {
302
+ p: ae,
308
303
  i: !1,
309
304
  c: null,
310
305
  e: null,
@@ -313,47 +308,47 @@ function on(t, e = !1, n) {
313
308
  l: null
314
309
  };
315
310
  }
316
- function ln(t) {
311
+ function sn(t) {
317
312
  var e = (
318
313
  /** @type {ComponentContext} */
319
- ie
314
+ ae
320
315
  ), n = e.e;
321
316
  if (n !== null) {
322
317
  e.e = null;
323
318
  for (var r of n)
324
- Si(r);
319
+ Rs(r);
325
320
  }
326
- return t !== void 0 && (e.x = t), e.i = !0, ie = e.p, t ?? /** @type {T} */
321
+ return t !== void 0 && (e.x = t), e.i = !0, ae = e.p, t ?? /** @type {T} */
327
322
  {};
328
323
  }
329
- function dr() {
324
+ function vr() {
330
325
  return !0;
331
326
  }
332
327
  let Ve = [];
333
- function si() {
328
+ function fs() {
334
329
  var t = Ve;
335
- Ve = [], Hs(t);
330
+ Ve = [], Ki(t);
336
331
  }
337
332
  function Ne(t) {
338
333
  if (Ve.length === 0) {
339
334
  var e = Ve;
340
335
  queueMicrotask(() => {
341
- e === Ve && si();
336
+ e === Ve && fs();
342
337
  });
343
338
  }
344
339
  Ve.push(t);
345
340
  }
346
- function mr(t) {
347
- var e = k;
341
+ function gr(t) {
342
+ var e = y;
348
343
  if (e === null)
349
- return y.f |= be, t;
344
+ return k.f |= be, t;
350
345
  if ((e.f & Nt) === 0 && (e.f & lt) === 0)
351
346
  throw t;
352
347
  Ze(t, e);
353
348
  }
354
349
  function Ze(t, e) {
355
350
  for (; e !== null; ) {
356
- if ((e.f & fr) !== 0) {
351
+ if ((e.f & pr) !== 0) {
357
352
  if ((e.f & Nt) === 0)
358
353
  throw t;
359
354
  try {
@@ -367,27 +362,27 @@ function Ze(t, e) {
367
362
  }
368
363
  throw t;
369
364
  }
370
- const ii = -7169;
371
- function P(t, e) {
372
- t.f = t.f & ii | e;
365
+ const hs = -7169;
366
+ function S(t, e) {
367
+ t.f = t.f & hs | e;
373
368
  }
374
- function un(t) {
375
- (t.f & G) !== 0 || t.deps === null ? P(t, D) : P(t, se);
369
+ function an(t) {
370
+ (t.f & Q) !== 0 || t.deps === null ? S(t, R) : S(t, se);
376
371
  }
377
- function vr(t) {
372
+ function wr(t) {
378
373
  if (t !== null)
379
374
  for (const e of t)
380
- (e.f & O) === 0 || (e.f & Oe) === 0 || (e.f ^= Oe, vr(
375
+ (e.f & D) === 0 || (e.f & Oe) === 0 || (e.f ^= Oe, wr(
381
376
  /** @type {Derived} */
382
377
  e.deps
383
378
  ));
384
379
  }
385
- function gr(t, e, n) {
386
- (t.f & F) !== 0 ? e.add(t) : (t.f & se) !== 0 && n.add(t), vr(t.deps), P(t, D);
380
+ function kr(t, e, n) {
381
+ (t.f & L) !== 0 ? e.add(t) : (t.f & se) !== 0 && n.add(t), wr(t.deps), S(t, R);
387
382
  }
388
- const yt = /* @__PURE__ */ new Set();
389
- let S = null, te = null, X = [], cn = null, en = !1;
390
- class _e {
383
+ const kt = /* @__PURE__ */ new Set();
384
+ let x = null, re = null, K = [], on = null, Kt = !1;
385
+ class Me {
391
386
  committed = !1;
392
387
  /**
393
388
  * The current values of any sources that are updated in this batch
@@ -425,12 +420,12 @@ class _e {
425
420
  * TODO replace with Promise.withResolvers once supported widely enough
426
421
  * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
427
422
  */
428
- #i = null;
423
+ #s = null;
429
424
  /**
430
425
  * Deferred effects (which run after async work has completed) that are DIRTY
431
426
  * @type {Set<Effect>}
432
427
  */
433
- #s = /* @__PURE__ */ new Set();
428
+ #i = /* @__PURE__ */ new Set();
434
429
  /**
435
430
  * Deferred effects that are MAYBE_DIRTY
436
431
  * @type {Set<Effect>}
@@ -466,9 +461,9 @@ class _e {
466
461
  if (n) {
467
462
  this.#t.delete(e);
468
463
  for (var r of n.d)
469
- P(r, F), oe(r);
464
+ S(r, L), le(r);
470
465
  for (r of n.m)
471
- P(r, se), oe(r);
466
+ S(r, se), le(r);
472
467
  }
473
468
  }
474
469
  /**
@@ -476,19 +471,19 @@ class _e {
476
471
  * @param {Effect[]} root_effects
477
472
  */
478
473
  process(e) {
479
- X = [], this.apply();
474
+ K = [], this.apply();
480
475
  var n = [], r = [];
481
- for (const s of e)
482
- this.#l(s, n, r);
476
+ for (const i of e)
477
+ this.#l(i, n, r);
483
478
  if (this.is_deferred()) {
484
479
  this.#u(r), this.#u(n);
485
- for (const [s, i] of this.#t)
486
- kr(s, i);
480
+ for (const [i, s] of this.#t)
481
+ br(i, s);
487
482
  } else {
488
- for (const s of this.#n) s();
489
- this.#n.clear(), this.#r === 0 && this.#c(), S = null, Fn(r), Fn(n), this.#i?.resolve();
483
+ for (const i of this.#n) i();
484
+ this.#n.clear(), this.#r === 0 && this.#c(), x = null, Bn(r), Bn(n), this.#s?.resolve();
490
485
  }
491
- te = null;
486
+ re = null;
492
487
  }
493
488
  /**
494
489
  * Traverse the effect tree, executing effects or stashing
@@ -498,20 +493,20 @@ class _e {
498
493
  * @param {Effect[]} render_effects
499
494
  */
500
495
  #l(e, n, r) {
501
- e.f ^= D;
502
- for (var s = e.first, i = null; s !== null; ) {
503
- var a = s.f, o = (a & (Ee | ze)) !== 0, l = o && (a & D) !== 0, u = l || (a & ye) !== 0 || this.#t.has(s);
504
- if (!u && s.fn !== null) {
505
- o ? s.f ^= D : i !== null && (a & (lt | At | cr)) !== 0 ? i.b.defer_effect(s) : (a & lt) !== 0 ? n.push(s) : ht(s) && ((a & ge) !== 0 && this.#e.add(s), Je(s));
506
- var c = s.first;
496
+ e.f ^= R;
497
+ for (var i = e.first, s = null; i !== null; ) {
498
+ var a = i.f, o = (a & (xe | ze)) !== 0, l = o && (a & R) !== 0, u = l || (a & ye) !== 0 || this.#t.has(i);
499
+ if (!u && i.fn !== null) {
500
+ o ? i.f ^= R : s !== null && (a & (lt | At | hr)) !== 0 ? s.b.defer_effect(i) : (a & lt) !== 0 ? n.push(i) : ht(i) && ((a & ve) !== 0 && this.#e.add(i), Je(i));
501
+ var c = i.first;
507
502
  if (c !== null) {
508
- s = c;
503
+ i = c;
509
504
  continue;
510
505
  }
511
506
  }
512
- var h = s.parent;
513
- for (s = s.next; s === null && h !== null; )
514
- h === i && (i = null), s = h.next, h = h.parent;
507
+ var h = i.parent;
508
+ for (i = i.next; i === null && h !== null; )
509
+ h === s && (s = null), i = h.next, h = h.parent;
515
510
  }
516
511
  }
517
512
  /**
@@ -519,7 +514,7 @@ class _e {
519
514
  */
520
515
  #u(e) {
521
516
  for (var n = 0; n < e.length; n += 1)
522
- gr(e[n], this.#s, this.#e);
517
+ kr(e[n], this.#i, this.#e);
523
518
  }
524
519
  /**
525
520
  * Associate a change to a given source with the current
@@ -528,17 +523,17 @@ class _e {
528
523
  * @param {any} value
529
524
  */
530
525
  capture(e, n) {
531
- n !== N && !this.previous.has(e) && this.previous.set(e, n), (e.f & be) === 0 && (this.current.set(e, e.v), te?.set(e, e.v));
526
+ n !== C && !this.previous.has(e) && this.previous.set(e, n), (e.f & be) === 0 && (this.current.set(e, e.v), re?.set(e, e.v));
532
527
  }
533
528
  activate() {
534
- S = this, this.apply();
529
+ x = this, this.apply();
535
530
  }
536
531
  deactivate() {
537
- S === this && (S = null, te = null);
532
+ x === this && (x = null, re = null);
538
533
  }
539
534
  flush() {
540
- if (this.activate(), X.length > 0) {
541
- if (ai(), S !== null && S !== this)
535
+ if (this.activate(), K.length > 0) {
536
+ if (ps(), x !== null && x !== this)
542
537
  return;
543
538
  } else this.#r === 0 && this.process([]);
544
539
  this.deactivate();
@@ -548,44 +543,44 @@ class _e {
548
543
  this.#h.clear();
549
544
  }
550
545
  #c() {
551
- if (yt.size > 1) {
546
+ if (kt.size > 1) {
552
547
  this.previous.clear();
553
- var e = te, n = !0;
554
- for (const s of yt) {
555
- if (s === this) {
548
+ var e = re, n = !0;
549
+ for (const i of kt) {
550
+ if (i === this) {
556
551
  n = !1;
557
552
  continue;
558
553
  }
559
- const i = [];
554
+ const s = [];
560
555
  for (const [o, l] of this.current) {
561
- if (s.current.has(o))
562
- if (n && l !== s.current.get(o))
563
- s.current.set(o, l);
556
+ if (i.current.has(o))
557
+ if (n && l !== i.current.get(o))
558
+ i.current.set(o, l);
564
559
  else
565
560
  continue;
566
- i.push(o);
561
+ s.push(o);
567
562
  }
568
- if (i.length === 0)
563
+ if (s.length === 0)
569
564
  continue;
570
- const a = [...s.current.keys()].filter((o) => !this.current.has(o));
565
+ const a = [...i.current.keys()].filter((o) => !this.current.has(o));
571
566
  if (a.length > 0) {
572
- var r = X;
573
- X = [];
567
+ var r = K;
568
+ K = [];
574
569
  const o = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
575
- for (const u of i)
576
- wr(u, a, o, l);
577
- if (X.length > 0) {
578
- S = s, s.apply();
579
- for (const u of X)
580
- s.#l(u, [], []);
581
- s.deactivate();
570
+ for (const u of s)
571
+ yr(u, a, o, l);
572
+ if (K.length > 0) {
573
+ x = i, i.apply();
574
+ for (const u of K)
575
+ i.#l(u, [], []);
576
+ i.deactivate();
582
577
  }
583
- X = r;
578
+ K = r;
584
579
  }
585
580
  }
586
- S = null, te = e;
581
+ x = null, re = e;
587
582
  }
588
- this.committed = !0, yt.delete(this);
583
+ this.committed = !0, kt.delete(this);
589
584
  }
590
585
  /**
591
586
  *
@@ -600,14 +595,14 @@ class _e {
600
595
  */
601
596
  decrement(e) {
602
597
  this.#r -= 1, e && (this.#o -= 1), !this.#a && (this.#a = !0, Ne(() => {
603
- this.#a = !1, this.is_deferred() ? X.length > 0 && this.flush() : this.revive();
598
+ this.#a = !1, this.is_deferred() ? K.length > 0 && this.flush() : this.revive();
604
599
  }));
605
600
  }
606
601
  revive() {
607
- for (const e of this.#s)
608
- this.#e.delete(e), P(e, F), oe(e);
602
+ for (const e of this.#i)
603
+ this.#e.delete(e), S(e, L), le(e);
609
604
  for (const e of this.#e)
610
- P(e, se), oe(e);
605
+ S(e, se), le(e);
611
606
  this.flush();
612
607
  }
613
608
  /** @param {() => void} fn */
@@ -619,140 +614,140 @@ class _e {
619
614
  this.#h.add(e);
620
615
  }
621
616
  settled() {
622
- return (this.#i ??= ur()).promise;
617
+ return (this.#s ??= fr()).promise;
623
618
  }
624
619
  static ensure() {
625
- if (S === null) {
626
- const e = S = new _e();
627
- yt.add(S), Ne(() => {
628
- S === e && e.flush();
620
+ if (x === null) {
621
+ const e = x = new Me();
622
+ kt.add(x), Ne(() => {
623
+ x === e && e.flush();
629
624
  });
630
625
  }
631
- return S;
626
+ return x;
632
627
  }
633
628
  apply() {
634
629
  }
635
630
  }
636
- function ai() {
637
- en = !0;
631
+ function ps() {
632
+ Kt = !0;
638
633
  var t = null;
639
634
  try {
640
- for (var e = 0; X.length > 0; ) {
641
- var n = _e.ensure();
635
+ for (var e = 0; K.length > 0; ) {
636
+ var n = Me.ensure();
642
637
  if (e++ > 1e3) {
643
- var r, s;
644
- oi();
638
+ var r, i;
639
+ ds();
645
640
  }
646
- n.process(X), Me.clear();
641
+ n.process(K), Ee.clear();
647
642
  }
648
643
  } finally {
649
- X = [], en = !1, cn = null;
644
+ K = [], Kt = !1, on = null;
650
645
  }
651
646
  }
652
- function oi() {
647
+ function ds() {
653
648
  try {
654
- Ys();
649
+ ts();
655
650
  } catch (t) {
656
- Ze(t, cn);
651
+ Ze(t, on);
657
652
  }
658
653
  }
659
- let ve = null;
660
- function Fn(t) {
654
+ let de = null;
655
+ function Bn(t) {
661
656
  var e = t.length;
662
657
  if (e !== 0) {
663
658
  for (var n = 0; n < e; ) {
664
659
  var r = t[n++];
665
- if ((r.f & (ke | ye)) === 0 && ht(r) && (ve = /* @__PURE__ */ new Set(), Je(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && Rr(r), ve?.size > 0)) {
666
- Me.clear();
667
- for (const s of ve) {
668
- if ((s.f & (ke | ye)) !== 0) continue;
669
- const i = [s];
670
- let a = s.parent;
660
+ if ((r.f & (_e | ye)) === 0 && ht(r) && (de = /* @__PURE__ */ new Set(), Je(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && Or(r), de?.size > 0)) {
661
+ Ee.clear();
662
+ for (const i of de) {
663
+ if ((i.f & (_e | ye)) !== 0) continue;
664
+ const s = [i];
665
+ let a = i.parent;
671
666
  for (; a !== null; )
672
- ve.has(a) && (ve.delete(a), i.push(a)), a = a.parent;
673
- for (let o = i.length - 1; o >= 0; o--) {
674
- const l = i[o];
675
- (l.f & (ke | ye)) === 0 && Je(l);
667
+ de.has(a) && (de.delete(a), s.push(a)), a = a.parent;
668
+ for (let o = s.length - 1; o >= 0; o--) {
669
+ const l = s[o];
670
+ (l.f & (_e | ye)) === 0 && Je(l);
676
671
  }
677
672
  }
678
- ve.clear();
673
+ de.clear();
679
674
  }
680
675
  }
681
- ve = null;
676
+ de = null;
682
677
  }
683
678
  }
684
- function wr(t, e, n, r) {
679
+ function yr(t, e, n, r) {
685
680
  if (!n.has(t) && (n.add(t), t.reactions !== null))
686
- for (const s of t.reactions) {
687
- const i = s.f;
688
- (i & O) !== 0 ? wr(
681
+ for (const i of t.reactions) {
682
+ const s = i.f;
683
+ (s & D) !== 0 ? yr(
689
684
  /** @type {Derived} */
690
- s,
685
+ i,
691
686
  e,
692
687
  n,
693
688
  r
694
- ) : (i & (an | ge)) !== 0 && (i & F) === 0 && yr(s, e, r) && (P(s, F), oe(
689
+ ) : (s & (nn | ve)) !== 0 && (s & L) === 0 && _r(i, e, r) && (S(i, L), le(
695
690
  /** @type {Effect} */
696
- s
691
+ i
697
692
  ));
698
693
  }
699
694
  }
700
- function yr(t, e, n) {
695
+ function _r(t, e, n) {
701
696
  const r = n.get(t);
702
697
  if (r !== void 0) return r;
703
698
  if (t.deps !== null)
704
- for (const s of t.deps) {
705
- if (He.call(e, s))
699
+ for (const i of t.deps) {
700
+ if (qe.call(e, i))
706
701
  return !0;
707
- if ((s.f & O) !== 0 && yr(
702
+ if ((i.f & D) !== 0 && _r(
708
703
  /** @type {Derived} */
709
- s,
704
+ i,
710
705
  e,
711
706
  n
712
707
  ))
713
708
  return n.set(
714
709
  /** @type {Derived} */
715
- s,
710
+ i,
716
711
  !0
717
712
  ), !0;
718
713
  }
719
714
  return n.set(t, !1), !1;
720
715
  }
721
- function oe(t) {
722
- for (var e = cn = t; e.parent !== null; ) {
716
+ function le(t) {
717
+ for (var e = on = t; e.parent !== null; ) {
723
718
  e = e.parent;
724
719
  var n = e.f;
725
- if (en && e === k && (n & ge) !== 0 && (n & hr) === 0)
720
+ if (Kt && e === y && (n & ve) !== 0 && (n & dr) === 0)
726
721
  return;
727
- if ((n & (ze | Ee)) !== 0) {
728
- if ((n & D) === 0) return;
729
- e.f ^= D;
722
+ if ((n & (ze | xe)) !== 0) {
723
+ if ((n & R) === 0) return;
724
+ e.f ^= R;
730
725
  }
731
726
  }
732
- X.push(e);
727
+ K.push(e);
733
728
  }
734
- function kr(t, e) {
735
- if (!((t.f & Ee) !== 0 && (t.f & D) !== 0)) {
736
- (t.f & F) !== 0 ? e.d.push(t) : (t.f & se) !== 0 && e.m.push(t), P(t, D);
729
+ function br(t, e) {
730
+ if (!((t.f & xe) !== 0 && (t.f & R) !== 0)) {
731
+ (t.f & L) !== 0 ? e.d.push(t) : (t.f & se) !== 0 && e.m.push(t), S(t, R);
737
732
  for (var n = t.first; n !== null; )
738
- kr(n, e), n = n.next;
733
+ br(n, e), n = n.next;
739
734
  }
740
735
  }
741
- function li(t) {
736
+ function ms(t) {
742
737
  let e = 0, n = Ct(0), r;
743
738
  return () => {
744
- hn() && (E(n), Ar(() => (e === 0 && (r = jr(() => t(() => at(n)))), e += 1, () => {
739
+ un() && (E(n), Cr(() => (e === 0 && (r = Br(() => t(() => at(n)))), e += 1, () => {
745
740
  Ne(() => {
746
741
  e -= 1, e === 0 && (r?.(), r = void 0, at(n));
747
742
  });
748
743
  })));
749
744
  };
750
745
  }
751
- var ui = St | Ge | fr;
752
- function ci(t, e, n) {
753
- new fi(t, e, n);
746
+ var vs = St | Ke | pr;
747
+ function gs(t, e, n) {
748
+ new ws(t, e, n);
754
749
  }
755
- class fi {
750
+ class ws {
756
751
  /** @type {Boundary | null} */
757
752
  parent;
758
753
  is_pending = !1;
@@ -765,9 +760,9 @@ class fi {
765
760
  /** @type {((anchor: Node) => void)} */
766
761
  #o;
767
762
  /** @type {Effect} */
768
- #i;
763
+ #s;
769
764
  /** @type {Effect | null} */
770
- #s = null;
765
+ #i = null;
771
766
  /** @type {Effect | null} */
772
767
  #e = null;
773
768
  /** @type {Effect | null} */
@@ -792,7 +787,7 @@ class fi {
792
787
  * @type {Source<number> | null}
793
788
  */
794
789
  #f = null;
795
- #b = li(() => (this.#f = Ct(this.#u), () => {
790
+ #_ = ms(() => (this.#f = Ct(this.#u), () => {
796
791
  this.#f = null;
797
792
  }));
798
793
  /**
@@ -802,34 +797,34 @@ class fi {
802
797
  */
803
798
  constructor(e, n, r) {
804
799
  this.#n = e, this.#r = n, this.#o = r, this.parent = /** @type {Effect} */
805
- k.b, this.is_pending = !!this.#r.pending, this.#i = Ai(() => {
806
- k.b = this;
800
+ y.b, this.is_pending = !!this.#r.pending, this.#s = Ls(() => {
801
+ y.b = this;
807
802
  {
808
- var s = this.#y();
803
+ var i = this.#k();
809
804
  try {
810
- this.#s = Ie(() => r(s));
811
- } catch (i) {
812
- this.error(i);
805
+ this.#i = Te(() => r(i));
806
+ } catch (s) {
807
+ this.error(s);
813
808
  }
814
809
  this.#c > 0 ? this.#w() : this.is_pending = !1;
815
810
  }
816
811
  return () => {
817
812
  this.#l?.remove();
818
813
  };
819
- }, ui);
814
+ }, vs);
820
815
  }
821
- #_() {
816
+ #b() {
822
817
  try {
823
- this.#s = Ie(() => this.#o(this.#n));
818
+ this.#i = Te(() => this.#o(this.#n));
824
819
  } catch (e) {
825
820
  this.error(e);
826
821
  }
827
822
  }
828
823
  #M() {
829
824
  const e = this.#r.pending;
830
- e && (this.#e = Ie(() => e(this.#n)), Ne(() => {
831
- var n = this.#y();
832
- this.#s = this.#g(() => (_e.ensure(), Ie(() => this.#o(n)))), this.#c > 0 ? this.#w() : (Et(
825
+ e && (this.#e = Te(() => e(this.#n)), Ne(() => {
826
+ var n = this.#k();
827
+ this.#i = this.#g(() => (Me.ensure(), Te(() => this.#o(n)))), this.#c > 0 ? this.#w() : (Et(
833
828
  /** @type {Effect} */
834
829
  this.#e,
835
830
  () => {
@@ -838,16 +833,16 @@ class fi {
838
833
  ), this.is_pending = !1);
839
834
  }));
840
835
  }
841
- #y() {
836
+ #k() {
842
837
  var e = this.#n;
843
- return this.is_pending && (this.#l = Ir(), this.#n.before(this.#l), e = this.#l), e;
838
+ return this.is_pending && (this.#l = Ar(), this.#n.before(this.#l), e = this.#l), e;
844
839
  }
845
840
  /**
846
841
  * Defer an effect inside a pending boundary until the boundary resolves
847
842
  * @param {Effect} effect
848
843
  */
849
844
  defer_effect(e) {
850
- gr(e, this.#m, this.#v);
845
+ kr(e, this.#m, this.#v);
851
846
  }
852
847
  /**
853
848
  * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
@@ -863,14 +858,14 @@ class fi {
863
858
  * @param {() => Effect | null} fn
864
859
  */
865
860
  #g(e) {
866
- var n = k, r = y, s = ie;
867
- ce(this.#i), Q(this.#i), qe(this.#i.ctx);
861
+ var n = y, r = k, i = ae;
862
+ ce(this.#s), te(this.#s), Ye(this.#s.ctx);
868
863
  try {
869
864
  return e();
870
- } catch (i) {
871
- return mr(i), null;
865
+ } catch (s) {
866
+ return gr(s), null;
872
867
  } finally {
873
- ce(n), Q(r), qe(s);
868
+ ce(n), te(r), Ye(i);
874
869
  }
875
870
  }
876
871
  #w() {
@@ -878,27 +873,27 @@ class fi {
878
873
  /** @type {(anchor: Node) => void} */
879
874
  this.#r.pending
880
875
  );
881
- this.#s !== null && (this.#a = document.createDocumentFragment(), this.#a.append(
876
+ this.#i !== null && (this.#a = document.createDocumentFragment(), this.#a.append(
882
877
  /** @type {TemplateNode} */
883
878
  this.#l
884
- ), Ri(this.#s, this.#a)), this.#e === null && (this.#e = Ie(() => e(this.#n)));
879
+ ), Vs(this.#i, this.#a)), this.#e === null && (this.#e = Te(() => e(this.#n)));
885
880
  }
886
881
  /**
887
882
  * Updates the pending count associated with the currently visible pending snippet,
888
883
  * if any, such that we can replace the snippet with content once work is done
889
884
  * @param {1 | -1} d
890
885
  */
891
- #k(e) {
886
+ #y(e) {
892
887
  if (!this.has_pending_snippet()) {
893
- this.parent && this.parent.#k(e);
888
+ this.parent && this.parent.#y(e);
894
889
  return;
895
890
  }
896
891
  if (this.#c += e, this.#c === 0) {
897
892
  this.is_pending = !1;
898
893
  for (const n of this.#m)
899
- P(n, F), oe(n);
894
+ S(n, L), le(n);
900
895
  for (const n of this.#v)
901
- P(n, se), oe(n);
896
+ S(n, se), le(n);
902
897
  this.#m.clear(), this.#v.clear(), this.#e && Et(this.#e, () => {
903
898
  this.#e = null;
904
899
  }), this.#a && (this.#n.before(this.#a), this.#a = null);
@@ -911,12 +906,12 @@ class fi {
911
906
  * @param {1 | -1} d
912
907
  */
913
908
  update_pending_count(e) {
914
- this.#k(e), this.#u += e, !(!this.#f || this.#d) && (this.#d = !0, Ne(() => {
909
+ this.#y(e), this.#u += e, !(!this.#f || this.#d) && (this.#d = !0, Ne(() => {
915
910
  this.#d = !1, this.#f && Pt(this.#f, this.#u);
916
911
  }));
917
912
  }
918
913
  get_effect_pending() {
919
- return this.#b(), E(
914
+ return this.#_(), E(
920
915
  /** @type {Source<number>} */
921
916
  this.#f
922
917
  );
@@ -927,27 +922,27 @@ class fi {
927
922
  let r = this.#r.failed;
928
923
  if (this.#p || !n && !r)
929
924
  throw e;
930
- this.#s && (le(this.#s), this.#s = null), this.#e && (le(this.#e), this.#e = null), this.#t && (le(this.#t), this.#t = null);
931
- var s = !1, i = !1;
925
+ this.#i && (ue(this.#i), this.#i = null), this.#e && (ue(this.#e), this.#e = null), this.#t && (ue(this.#t), this.#t = null);
926
+ var i = !1, s = !1;
932
927
  const a = () => {
933
- if (s) {
934
- ni();
928
+ if (i) {
929
+ us();
935
930
  return;
936
931
  }
937
- s = !0, i && Ks(), _e.ensure(), this.#u = 0, this.#t !== null && Et(this.#t, () => {
932
+ i = !0, s && ss(), Me.ensure(), this.#u = 0, this.#t !== null && Et(this.#t, () => {
938
933
  this.#t = null;
939
- }), this.is_pending = this.has_pending_snippet(), this.#s = this.#g(() => (this.#p = !1, Ie(() => this.#o(this.#n)))), this.#c > 0 ? this.#w() : this.is_pending = !1;
934
+ }), this.is_pending = this.has_pending_snippet(), this.#i = this.#g(() => (this.#p = !1, Te(() => this.#o(this.#n)))), this.#c > 0 ? this.#w() : this.is_pending = !1;
940
935
  };
941
936
  Ne(() => {
942
937
  try {
943
- i = !0, n?.(e, a), i = !1;
938
+ s = !0, n?.(e, a), s = !1;
944
939
  } catch (o) {
945
- Ze(o, this.#i && this.#i.parent);
940
+ Ze(o, this.#s && this.#s.parent);
946
941
  }
947
942
  r && (this.#t = this.#g(() => {
948
- _e.ensure(), this.#p = !0;
943
+ Me.ensure(), this.#p = !0;
949
944
  try {
950
- return Ie(() => {
945
+ return Te(() => {
951
946
  r(
952
947
  this.#n,
953
948
  () => e,
@@ -958,7 +953,7 @@ class fi {
958
953
  return Ze(
959
954
  o,
960
955
  /** @type {Effect} */
961
- this.#i.parent
956
+ this.#s.parent
962
957
  ), null;
963
958
  } finally {
964
959
  this.#p = !1;
@@ -967,145 +962,145 @@ class fi {
967
962
  });
968
963
  }
969
964
  }
970
- function hi(t, e, n, r) {
971
- const s = di;
972
- var i = t.filter((f) => !f.settled);
973
- if (n.length === 0 && i.length === 0) {
974
- r(e.map(s));
965
+ function ks(t, e, n, r) {
966
+ const i = _s;
967
+ var s = t.filter((f) => !f.settled);
968
+ if (n.length === 0 && s.length === 0) {
969
+ r(e.map(i));
975
970
  return;
976
971
  }
977
- var a = S, o = (
972
+ var a = x, o = (
978
973
  /** @type {Effect} */
979
- k
980
- ), l = pi(), u = i.length === 1 ? i[0].promise : i.length > 1 ? Promise.all(i.map((f) => f.promise)) : null;
974
+ y
975
+ ), l = ys(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((f) => f.promise)) : null;
981
976
  function c(f) {
982
977
  l();
983
978
  try {
984
979
  r(f);
985
980
  } catch (d) {
986
- (o.f & ke) === 0 && Ze(d, o);
981
+ (o.f & _e) === 0 && Ze(d, o);
987
982
  }
988
- a?.deactivate(), tn();
983
+ a?.deactivate(), Qt();
989
984
  }
990
985
  if (n.length === 0) {
991
- u.then(() => c(e.map(s)));
986
+ u.then(() => c(e.map(i)));
992
987
  return;
993
988
  }
994
989
  function h() {
995
- l(), Promise.all(n.map((f) => /* @__PURE__ */ mi(f))).then((f) => c([...e.map(s), ...f])).catch((f) => Ze(f, o));
990
+ l(), Promise.all(n.map((f) => /* @__PURE__ */ bs(f))).then((f) => c([...e.map(i), ...f])).catch((f) => Ze(f, o));
996
991
  }
997
992
  u ? u.then(h) : h();
998
993
  }
999
- function pi() {
1000
- var t = k, e = y, n = ie, r = S;
1001
- return function(i = !0) {
1002
- ce(t), Q(e), qe(n), i && r?.activate();
994
+ function ys() {
995
+ var t = y, e = k, n = ae, r = x;
996
+ return function(s = !0) {
997
+ ce(t), te(e), Ye(n), s && r?.activate();
1003
998
  };
1004
999
  }
1005
- function tn() {
1006
- ce(null), Q(null), qe(null);
1000
+ function Qt() {
1001
+ ce(null), te(null), Ye(null);
1007
1002
  }
1008
1003
  // @__NO_SIDE_EFFECTS__
1009
- function di(t) {
1010
- var e = O | F, n = y !== null && (y.f & O) !== 0 ? (
1004
+ function _s(t) {
1005
+ var e = D | L, n = k !== null && (k.f & D) !== 0 ? (
1011
1006
  /** @type {Derived} */
1012
- y
1007
+ k
1013
1008
  ) : null;
1014
- return k !== null && (k.f |= Ge), {
1015
- ctx: ie,
1009
+ return y !== null && (y.f |= Ke), {
1010
+ ctx: ae,
1016
1011
  deps: null,
1017
1012
  effects: null,
1018
- equals: pr,
1013
+ equals: mr,
1019
1014
  f: e,
1020
1015
  fn: t,
1021
1016
  reactions: null,
1022
1017
  rv: 0,
1023
1018
  v: (
1024
1019
  /** @type {V} */
1025
- N
1020
+ C
1026
1021
  ),
1027
1022
  wv: 0,
1028
- parent: n ?? k,
1023
+ parent: n ?? y,
1029
1024
  ac: null
1030
1025
  };
1031
1026
  }
1032
1027
  // @__NO_SIDE_EFFECTS__
1033
- function mi(t, e, n) {
1028
+ function bs(t, e, n) {
1034
1029
  let r = (
1035
1030
  /** @type {Effect | null} */
1036
- k
1031
+ y
1037
1032
  );
1038
- r === null && Zs();
1039
- var s = (
1033
+ r === null && es();
1034
+ var i = (
1040
1035
  /** @type {Boundary} */
1041
1036
  r.b
1042
- ), i = (
1037
+ ), s = (
1043
1038
  /** @type {Promise<V>} */
1044
1039
  /** @type {unknown} */
1045
1040
  void 0
1046
1041
  ), a = Ct(
1047
1042
  /** @type {V} */
1048
- N
1049
- ), o = !y, l = /* @__PURE__ */ new Map();
1050
- return Ti(() => {
1051
- var u = ur();
1052
- i = u.promise;
1043
+ C
1044
+ ), o = !k, l = /* @__PURE__ */ new Map();
1045
+ return zs(() => {
1046
+ var u = fr();
1047
+ s = u.promise;
1053
1048
  try {
1054
1049
  Promise.resolve(t()).then(u.resolve, u.reject).then(() => {
1055
- c === S && c.committed && c.deactivate(), tn();
1050
+ c === x && c.committed && c.deactivate(), Qt();
1056
1051
  });
1057
1052
  } catch (d) {
1058
- u.reject(d), tn();
1053
+ u.reject(d), Qt();
1059
1054
  }
1060
1055
  var c = (
1061
1056
  /** @type {Batch} */
1062
- S
1057
+ x
1063
1058
  );
1064
1059
  if (o) {
1065
- var h = s.is_rendered();
1066
- s.update_pending_count(1), c.increment(h), l.get(c)?.reject(Te), l.delete(c), l.set(c, u);
1060
+ var h = i.is_rendered();
1061
+ i.update_pending_count(1), c.increment(h), l.get(c)?.reject(Ie), l.delete(c), l.set(c, u);
1067
1062
  }
1068
1063
  const f = (d, m = void 0) => {
1069
1064
  if (c.activate(), m)
1070
- m !== Te && (a.f |= be, Pt(a, m));
1065
+ m !== Ie && (a.f |= be, Pt(a, m));
1071
1066
  else {
1072
1067
  (a.f & be) !== 0 && (a.f ^= be), Pt(a, d);
1073
1068
  for (const [v, M] of l) {
1074
1069
  if (l.delete(v), v === c) break;
1075
- M.reject(Te);
1070
+ M.reject(Ie);
1076
1071
  }
1077
1072
  }
1078
- o && (s.update_pending_count(-1), c.decrement(h));
1073
+ o && (i.update_pending_count(-1), c.decrement(h));
1079
1074
  };
1080
1075
  u.promise.then(f, (d) => f(null, d || "unknown"));
1081
- }), xi(() => {
1076
+ }), Cs(() => {
1082
1077
  for (const u of l.values())
1083
- u.reject(Te);
1078
+ u.reject(Ie);
1084
1079
  }), new Promise((u) => {
1085
1080
  function c(h) {
1086
1081
  function f() {
1087
- h === i ? u(a) : c(i);
1082
+ h === s ? u(a) : c(s);
1088
1083
  }
1089
1084
  h.then(f, f);
1090
1085
  }
1091
- c(i);
1086
+ c(s);
1092
1087
  });
1093
1088
  }
1094
- function vi(t) {
1089
+ function Ms(t) {
1095
1090
  var e = t.effects;
1096
1091
  if (e !== null) {
1097
1092
  t.effects = null;
1098
1093
  for (var n = 0; n < e.length; n += 1)
1099
- le(
1094
+ ue(
1100
1095
  /** @type {Effect} */
1101
1096
  e[n]
1102
1097
  );
1103
1098
  }
1104
1099
  }
1105
- function gi(t) {
1100
+ function Es(t) {
1106
1101
  for (var e = t.parent; e !== null; ) {
1107
- if ((e.f & O) === 0)
1108
- return (e.f & ke) === 0 ? (
1102
+ if ((e.f & D) === 0)
1103
+ return (e.f & _e) === 0 ? (
1109
1104
  /** @type {Effect} */
1110
1105
  e
1111
1106
  ) : null;
@@ -1113,121 +1108,121 @@ function gi(t) {
1113
1108
  }
1114
1109
  return null;
1115
1110
  }
1116
- function fn(t) {
1117
- var e, n = k;
1118
- ce(gi(t));
1111
+ function ln(t) {
1112
+ var e, n = y;
1113
+ ce(Es(t));
1119
1114
  try {
1120
- t.f &= ~Oe, vi(t), e = $r(t);
1115
+ t.f &= ~Oe, Ms(t), e = Vr(t);
1121
1116
  } finally {
1122
1117
  ce(n);
1123
1118
  }
1124
1119
  return e;
1125
1120
  }
1126
- function br(t) {
1127
- var e = fn(t);
1128
- if (!t.equals(e) && (t.wv = zr(), (!S?.is_fork || t.deps === null) && (t.v = e, t.deps === null))) {
1129
- P(t, D);
1121
+ function Mr(t) {
1122
+ var e = ln(t);
1123
+ if (!t.equals(e) && (t.wv = Fr(), (!x?.is_fork || t.deps === null) && (t.v = e, t.deps === null))) {
1124
+ S(t, R);
1130
1125
  return;
1131
1126
  }
1132
- Ye || (te !== null ? (hn() || S?.is_fork) && te.set(t, e) : un(t));
1127
+ Xe || (re !== null ? (un() || x?.is_fork) && re.set(t, e) : an(t));
1133
1128
  }
1134
- function wi(t) {
1129
+ function xs(t) {
1135
1130
  if (t.effects !== null)
1136
1131
  for (const e of t.effects)
1137
- (e.teardown || e.ac) && (e.teardown?.(), e.ac?.abort(Te), e.teardown = Bs, e.ac = null, ut(e, 0), pn(e));
1132
+ (e.teardown || e.ac) && (e.teardown?.(), e.ac?.abort(Ie), e.teardown = Gi, e.ac = null, ut(e, 0), cn(e));
1138
1133
  }
1139
- function _r(t) {
1134
+ function Er(t) {
1140
1135
  if (t.effects !== null)
1141
1136
  for (const e of t.effects)
1142
1137
  e.teardown && Je(e);
1143
1138
  }
1144
- let nn = /* @__PURE__ */ new Set();
1145
- const Me = /* @__PURE__ */ new Map();
1146
- let Mr = !1;
1139
+ let en = /* @__PURE__ */ new Set();
1140
+ const Ee = /* @__PURE__ */ new Map();
1141
+ let xr = !1;
1147
1142
  function Ct(t, e) {
1148
1143
  var n = {
1149
1144
  f: 0,
1150
1145
  // TODO ideally we could skip this altogether, but it causes type errors
1151
1146
  v: t,
1152
1147
  reactions: null,
1153
- equals: pr,
1148
+ equals: mr,
1154
1149
  rv: 0,
1155
1150
  wv: 0
1156
1151
  };
1157
1152
  return n;
1158
1153
  }
1159
1154
  // @__NO_SIDE_EFFECTS__
1160
- function B(t, e) {
1155
+ function V(t, e) {
1161
1156
  const n = Ct(t);
1162
- return Di(n), n;
1157
+ return Us(n), n;
1163
1158
  }
1164
- function q(t, e, n = !1) {
1165
- y !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
1159
+ function j(t, e, n = !1) {
1160
+ k !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
1166
1161
  // to ensure we error if state is set inside an inspect effect
1167
- (!ne || (y.f & $n) !== 0) && dr() && (y.f & (O | ge | an | $n)) !== 0 && (K === null || !He.call(K, t)) && Gs();
1162
+ (!ie || (k.f & jn) !== 0) && vr() && (k.f & (D | ve | nn | jn)) !== 0 && (ee === null || !qe.call(ee, t)) && is();
1168
1163
  let r = n ? tt(e) : e;
1169
1164
  return Pt(t, r);
1170
1165
  }
1171
1166
  function Pt(t, e) {
1172
1167
  if (!t.equals(e)) {
1173
1168
  var n = t.v;
1174
- Ye ? Me.set(t, e) : Me.set(t, n), t.v = e;
1175
- var r = _e.ensure();
1176
- if (r.capture(t, n), (t.f & O) !== 0) {
1177
- const s = (
1169
+ Xe ? Ee.set(t, e) : Ee.set(t, n), t.v = e;
1170
+ var r = Me.ensure();
1171
+ if (r.capture(t, n), (t.f & D) !== 0) {
1172
+ const i = (
1178
1173
  /** @type {Derived} */
1179
1174
  t
1180
1175
  );
1181
- (t.f & F) !== 0 && fn(s), un(s);
1176
+ (t.f & L) !== 0 && ln(i), an(i);
1182
1177
  }
1183
- t.wv = zr(), Er(t, F), k !== null && (k.f & D) !== 0 && (k.f & (Ee | ze)) === 0 && (J === null ? Oi([t]) : J.push(t)), !r.is_fork && nn.size > 0 && !Mr && yi();
1178
+ t.wv = Fr(), Sr(t, L), y !== null && (y.f & R) !== 0 && (y.f & (xe | ze)) === 0 && (G === null ? js([t]) : G.push(t)), !r.is_fork && en.size > 0 && !xr && Ss();
1184
1179
  }
1185
1180
  return e;
1186
1181
  }
1187
- function yi() {
1188
- Mr = !1;
1189
- for (const t of nn)
1190
- (t.f & D) !== 0 && P(t, se), ht(t) && Je(t);
1191
- nn.clear();
1182
+ function Ss() {
1183
+ xr = !1;
1184
+ for (const t of en)
1185
+ (t.f & R) !== 0 && S(t, se), ht(t) && Je(t);
1186
+ en.clear();
1192
1187
  }
1193
1188
  function at(t) {
1194
- q(t, t.v + 1);
1189
+ j(t, t.v + 1);
1195
1190
  }
1196
- function Er(t, e) {
1191
+ function Sr(t, e) {
1197
1192
  var n = t.reactions;
1198
1193
  if (n !== null)
1199
- for (var r = n.length, s = 0; s < r; s++) {
1200
- var i = n[s], a = i.f, o = (a & F) === 0;
1201
- if (o && P(i, e), (a & O) !== 0) {
1194
+ for (var r = n.length, i = 0; i < r; i++) {
1195
+ var s = n[i], a = s.f, o = (a & L) === 0;
1196
+ if (o && S(s, e), (a & D) !== 0) {
1202
1197
  var l = (
1203
1198
  /** @type {Derived} */
1204
- i
1199
+ s
1205
1200
  );
1206
- te?.delete(l), (a & Oe) === 0 && (a & G && (i.f |= Oe), Er(l, se));
1207
- } else o && ((a & ge) !== 0 && ve !== null && ve.add(
1201
+ re?.delete(l), (a & Oe) === 0 && (a & Q && (s.f |= Oe), Sr(l, se));
1202
+ } else o && ((a & ve) !== 0 && de !== null && de.add(
1208
1203
  /** @type {Effect} */
1209
- i
1210
- ), oe(
1204
+ s
1205
+ ), le(
1211
1206
  /** @type {Effect} */
1212
- i
1207
+ s
1213
1208
  ));
1214
1209
  }
1215
1210
  }
1216
1211
  function tt(t) {
1217
1212
  if (typeof t != "object" || t === null || Mt in t)
1218
1213
  return t;
1219
- const e = Ws(t);
1220
- if (e !== js && e !== Us)
1214
+ const e = Ji(t);
1215
+ if (e !== Zi && e !== Xi)
1221
1216
  return t;
1222
- var n = /* @__PURE__ */ new Map(), r = Ls(t), s = /* @__PURE__ */ B(0), i = Ce, a = (o) => {
1223
- if (Ce === i)
1217
+ var n = /* @__PURE__ */ new Map(), r = Wi(t), i = /* @__PURE__ */ V(0), s = Ce, a = (o) => {
1218
+ if (Ce === s)
1224
1219
  return o();
1225
- var l = y, u = Ce;
1226
- Q(null), Wn(i);
1220
+ var l = k, u = Ce;
1221
+ te(null), Yn(s);
1227
1222
  var c = o();
1228
- return Q(l), Wn(u), c;
1223
+ return te(l), Yn(u), c;
1229
1224
  };
1230
- return r && n.set("length", /* @__PURE__ */ B(
1225
+ return r && n.set("length", /* @__PURE__ */ V(
1231
1226
  /** @type {any[]} */
1232
1227
  t.length
1233
1228
  )), new Proxy(
@@ -1235,34 +1230,34 @@ function tt(t) {
1235
1230
  t,
1236
1231
  {
1237
1232
  defineProperty(o, l, u) {
1238
- (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Js();
1233
+ (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && ns();
1239
1234
  var c = n.get(l);
1240
1235
  return c === void 0 ? a(() => {
1241
- var h = /* @__PURE__ */ B(u.value);
1236
+ var h = /* @__PURE__ */ V(u.value);
1242
1237
  return n.set(l, h), h;
1243
- }) : q(c, u.value, !0), !0;
1238
+ }) : j(c, u.value, !0), !0;
1244
1239
  },
1245
1240
  deleteProperty(o, l) {
1246
1241
  var u = n.get(l);
1247
1242
  if (u === void 0) {
1248
1243
  if (l in o) {
1249
- const c = a(() => /* @__PURE__ */ B(N));
1250
- n.set(l, c), at(s);
1244
+ const c = a(() => /* @__PURE__ */ V(C));
1245
+ n.set(l, c), at(i);
1251
1246
  }
1252
1247
  } else
1253
- q(u, N), at(s);
1248
+ j(u, C), at(i);
1254
1249
  return !0;
1255
1250
  },
1256
1251
  get(o, l, u) {
1257
1252
  if (l === Mt)
1258
1253
  return t;
1259
1254
  var c = n.get(l), h = l in o;
1260
- if (c === void 0 && (!h || it(o, l)?.writable) && (c = a(() => {
1261
- var d = tt(h ? o[l] : N), m = /* @__PURE__ */ B(d);
1255
+ if (c === void 0 && (!h || st(o, l)?.writable) && (c = a(() => {
1256
+ var d = tt(h ? o[l] : C), m = /* @__PURE__ */ V(d);
1262
1257
  return m;
1263
1258
  }), n.set(l, c)), c !== void 0) {
1264
1259
  var f = E(c);
1265
- return f === N ? void 0 : f;
1260
+ return f === C ? void 0 : f;
1266
1261
  }
1267
1262
  return Reflect.get(o, l, u);
1268
1263
  },
@@ -1273,7 +1268,7 @@ function tt(t) {
1273
1268
  c && (u.value = E(c));
1274
1269
  } else if (u === void 0) {
1275
1270
  var h = n.get(l), f = h?.v;
1276
- if (h !== void 0 && f !== N)
1271
+ if (h !== void 0 && f !== C)
1277
1272
  return {
1278
1273
  enumerable: !0,
1279
1274
  configurable: !0,
@@ -1286,14 +1281,14 @@ function tt(t) {
1286
1281
  has(o, l) {
1287
1282
  if (l === Mt)
1288
1283
  return !0;
1289
- var u = n.get(l), c = u !== void 0 && u.v !== N || Reflect.has(o, l);
1290
- if (u !== void 0 || k !== null && (!c || it(o, l)?.writable)) {
1284
+ var u = n.get(l), c = u !== void 0 && u.v !== C || Reflect.has(o, l);
1285
+ if (u !== void 0 || y !== null && (!c || st(o, l)?.writable)) {
1291
1286
  u === void 0 && (u = a(() => {
1292
- var f = c ? tt(o[l]) : N, d = /* @__PURE__ */ B(f);
1287
+ var f = c ? tt(o[l]) : C, d = /* @__PURE__ */ V(f);
1293
1288
  return d;
1294
1289
  }), n.set(l, u));
1295
1290
  var h = E(u);
1296
- if (h === N)
1291
+ if (h === C)
1297
1292
  return !1;
1298
1293
  }
1299
1294
  return c;
@@ -1304,112 +1299,112 @@ function tt(t) {
1304
1299
  for (var d = u; d < /** @type {Source<number>} */
1305
1300
  h.v; d += 1) {
1306
1301
  var m = n.get(d + "");
1307
- m !== void 0 ? q(m, N) : d in o && (m = a(() => /* @__PURE__ */ B(N)), n.set(d + "", m));
1302
+ m !== void 0 ? j(m, C) : d in o && (m = a(() => /* @__PURE__ */ V(C)), n.set(d + "", m));
1308
1303
  }
1309
1304
  if (h === void 0)
1310
- (!f || it(o, l)?.writable) && (h = a(() => /* @__PURE__ */ B(void 0)), q(h, tt(u)), n.set(l, h));
1305
+ (!f || st(o, l)?.writable) && (h = a(() => /* @__PURE__ */ V(void 0)), j(h, tt(u)), n.set(l, h));
1311
1306
  else {
1312
- f = h.v !== N;
1307
+ f = h.v !== C;
1313
1308
  var v = a(() => tt(u));
1314
- q(h, v);
1309
+ j(h, v);
1315
1310
  }
1316
1311
  var M = Reflect.getOwnPropertyDescriptor(o, l);
1317
1312
  if (M?.set && M.set.call(c, u), !f) {
1318
1313
  if (r && typeof l == "string") {
1319
- var W = (
1314
+ var $ = (
1320
1315
  /** @type {Source<number>} */
1321
1316
  n.get("length")
1322
- ), fe = Number(l);
1323
- Number.isInteger(fe) && fe >= W.v && q(W, fe + 1);
1317
+ ), X = Number(l);
1318
+ Number.isInteger(X) && X >= $.v && j($, X + 1);
1324
1319
  }
1325
- at(s);
1320
+ at(i);
1326
1321
  }
1327
1322
  return !0;
1328
1323
  },
1329
1324
  ownKeys(o) {
1330
- E(s);
1325
+ E(i);
1331
1326
  var l = Reflect.ownKeys(o).filter((h) => {
1332
1327
  var f = n.get(h);
1333
- return f === void 0 || f.v !== N;
1328
+ return f === void 0 || f.v !== C;
1334
1329
  });
1335
1330
  for (var [u, c] of n)
1336
- c.v !== N && !(u in o) && l.push(u);
1331
+ c.v !== C && !(u in o) && l.push(u);
1337
1332
  return l;
1338
1333
  },
1339
1334
  setPrototypeOf() {
1340
- Xs();
1335
+ rs();
1341
1336
  }
1342
1337
  }
1343
1338
  );
1344
1339
  }
1345
- var Vn, xr, Sr, Pr;
1346
- function ki() {
1347
- if (Vn === void 0) {
1348
- Vn = window, xr = /Firefox/.test(navigator.userAgent);
1340
+ var Wn, Pr, Tr, Ir;
1341
+ function Ps() {
1342
+ if (Wn === void 0) {
1343
+ Wn = window, Pr = /Firefox/.test(navigator.userAgent);
1349
1344
  var t = Element.prototype, e = Node.prototype, n = Text.prototype;
1350
- Sr = it(e, "firstChild").get, Pr = it(e, "nextSibling").get, Ln(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Ln(n) && (n.__t = void 0);
1345
+ Tr = st(e, "firstChild").get, Ir = st(e, "nextSibling").get, Un(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Un(n) && (n.__t = void 0);
1351
1346
  }
1352
1347
  }
1353
- function Ir(t = "") {
1348
+ function Ar(t = "") {
1354
1349
  return document.createTextNode(t);
1355
1350
  }
1356
1351
  // @__NO_SIDE_EFFECTS__
1357
- function It(t) {
1352
+ function Tt(t) {
1358
1353
  return (
1359
1354
  /** @type {TemplateNode | null} */
1360
- Sr.call(t)
1355
+ Tr.call(t)
1361
1356
  );
1362
1357
  }
1363
1358
  // @__NO_SIDE_EFFECTS__
1364
1359
  function Rt(t) {
1365
1360
  return (
1366
1361
  /** @type {TemplateNode | null} */
1367
- Pr.call(t)
1362
+ Ir.call(t)
1368
1363
  );
1369
1364
  }
1370
- function bi(t, e) {
1371
- return /* @__PURE__ */ It(t);
1365
+ function Ts(t, e) {
1366
+ return /* @__PURE__ */ Tt(t);
1372
1367
  }
1373
- function _i(t, e = !1) {
1368
+ function Is(t, e = !1) {
1374
1369
  {
1375
- var n = /* @__PURE__ */ It(t);
1370
+ var n = /* @__PURE__ */ Tt(t);
1376
1371
  return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Rt(n) : n;
1377
1372
  }
1378
1373
  }
1379
- function jn(t, e = 1, n = !1) {
1374
+ function Hn(t, e = 1, n = !1) {
1380
1375
  let r = t;
1381
1376
  for (; e--; )
1382
1377
  r = /** @type {TemplateNode} */
1383
1378
  /* @__PURE__ */ Rt(r);
1384
1379
  return r;
1385
1380
  }
1386
- function Mi(t, e, n) {
1381
+ function As(t, e, n) {
1387
1382
  return (
1388
1383
  /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */
1389
- document.createElementNS(ti, t, void 0)
1384
+ document.createElementNS(ls, t, void 0)
1390
1385
  );
1391
1386
  }
1392
- function Tr(t) {
1393
- var e = y, n = k;
1394
- Q(null), ce(null);
1387
+ function Nr(t) {
1388
+ var e = k, n = y;
1389
+ te(null), ce(null);
1395
1390
  try {
1396
1391
  return t();
1397
1392
  } finally {
1398
- Q(e), ce(n);
1393
+ te(e), ce(n);
1399
1394
  }
1400
1395
  }
1401
- function Ei(t, e) {
1396
+ function Ns(t, e) {
1402
1397
  var n = e.last;
1403
1398
  n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t);
1404
1399
  }
1405
- function we(t, e, n) {
1406
- var r = k;
1400
+ function ge(t, e, n) {
1401
+ var r = y;
1407
1402
  r !== null && (r.f & ye) !== 0 && (t |= ye);
1408
- var s = {
1409
- ctx: ie,
1403
+ var i = {
1404
+ ctx: ae,
1410
1405
  deps: null,
1411
1406
  nodes: null,
1412
- f: t | F | G,
1407
+ f: t | L | Q,
1413
1408
  first: null,
1414
1409
  fn: e,
1415
1410
  last: null,
@@ -1423,432 +1418,432 @@ function we(t, e, n) {
1423
1418
  };
1424
1419
  if (n)
1425
1420
  try {
1426
- Je(s);
1421
+ Je(i);
1427
1422
  } catch (o) {
1428
- throw le(s), o;
1423
+ throw ue(i), o;
1429
1424
  }
1430
- else e !== null && oe(s);
1431
- var i = s;
1432
- if (n && i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && // either `null`, or a singular child
1433
- (i.f & Ge) === 0 && (i = i.first, (t & ge) !== 0 && (t & St) !== 0 && i !== null && (i.f |= St)), i !== null && (i.parent = r, r !== null && Ei(i, r), y !== null && (y.f & O) !== 0 && (t & ze) === 0)) {
1425
+ else e !== null && le(i);
1426
+ var s = i;
1427
+ if (n && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child
1428
+ (s.f & Ke) === 0 && (s = s.first, (t & ve) !== 0 && (t & St) !== 0 && s !== null && (s.f |= St)), s !== null && (s.parent = r, r !== null && Ns(s, r), k !== null && (k.f & D) !== 0 && (t & ze) === 0)) {
1434
1429
  var a = (
1435
1430
  /** @type {Derived} */
1436
- y
1431
+ k
1437
1432
  );
1438
- (a.effects ??= []).push(i);
1433
+ (a.effects ??= []).push(s);
1439
1434
  }
1440
- return s;
1435
+ return i;
1441
1436
  }
1442
- function hn() {
1443
- return y !== null && !ne;
1437
+ function un() {
1438
+ return k !== null && !ie;
1444
1439
  }
1445
- function xi(t) {
1446
- const e = we(At, null, !1);
1447
- return P(e, D), e.teardown = t, e;
1440
+ function Cs(t) {
1441
+ const e = ge(At, null, !1);
1442
+ return S(e, R), e.teardown = t, e;
1448
1443
  }
1449
- function Si(t) {
1450
- return we(lt | qs, t, !1);
1444
+ function Rs(t) {
1445
+ return ge(lt | Qi, t, !1);
1451
1446
  }
1452
- function Pi(t) {
1453
- _e.ensure();
1454
- const e = we(ze | Ge, t, !0);
1447
+ function Ds(t) {
1448
+ Me.ensure();
1449
+ const e = ge(ze | Ke, t, !0);
1455
1450
  return (n = {}) => new Promise((r) => {
1456
1451
  n.outro ? Et(e, () => {
1457
- le(e), r(void 0);
1458
- }) : (le(e), r(void 0));
1452
+ ue(e), r(void 0);
1453
+ }) : (ue(e), r(void 0));
1459
1454
  });
1460
1455
  }
1461
- function Ii(t) {
1462
- return we(lt, t, !1);
1456
+ function Os(t) {
1457
+ return ge(lt, t, !1);
1463
1458
  }
1464
- function Ti(t) {
1465
- return we(an | Ge, t, !0);
1459
+ function zs(t) {
1460
+ return ge(nn | Ke, t, !0);
1466
1461
  }
1467
- function Ar(t, e = 0) {
1468
- return we(At | e, t, !0);
1462
+ function Cr(t, e = 0) {
1463
+ return ge(At | e, t, !0);
1469
1464
  }
1470
- function Nr(t, e = [], n = [], r = []) {
1471
- hi(r, e, n, (s) => {
1472
- we(At, () => t(...s.map(E)), !0);
1465
+ function Rr(t, e = [], n = [], r = []) {
1466
+ ks(r, e, n, (i) => {
1467
+ ge(At, () => t(...i.map(E)), !0);
1473
1468
  });
1474
1469
  }
1475
- function Ai(t, e = 0) {
1476
- var n = we(ge | e, t, !0);
1470
+ function Ls(t, e = 0) {
1471
+ var n = ge(ve | e, t, !0);
1477
1472
  return n;
1478
1473
  }
1479
- function Ie(t) {
1480
- return we(Ee | Ge, t, !0);
1474
+ function Te(t) {
1475
+ return ge(xe | Ke, t, !0);
1481
1476
  }
1482
- function Cr(t) {
1477
+ function Dr(t) {
1483
1478
  var e = t.teardown;
1484
1479
  if (e !== null) {
1485
- const n = Ye, r = y;
1486
- Un(!0), Q(null);
1480
+ const n = Xe, r = k;
1481
+ qn(!0), te(null);
1487
1482
  try {
1488
1483
  e.call(null);
1489
1484
  } finally {
1490
- Un(n), Q(r);
1485
+ qn(n), te(r);
1491
1486
  }
1492
1487
  }
1493
1488
  }
1494
- function pn(t, e = !1) {
1489
+ function cn(t, e = !1) {
1495
1490
  var n = t.first;
1496
1491
  for (t.first = t.last = null; n !== null; ) {
1497
- const s = n.ac;
1498
- s !== null && Tr(() => {
1499
- s.abort(Te);
1492
+ const i = n.ac;
1493
+ i !== null && Nr(() => {
1494
+ i.abort(Ie);
1500
1495
  });
1501
1496
  var r = n.next;
1502
- (n.f & ze) !== 0 ? n.parent = null : le(n, e), n = r;
1497
+ (n.f & ze) !== 0 ? n.parent = null : ue(n, e), n = r;
1503
1498
  }
1504
1499
  }
1505
- function Ni(t) {
1500
+ function Fs(t) {
1506
1501
  for (var e = t.first; e !== null; ) {
1507
1502
  var n = e.next;
1508
- (e.f & Ee) === 0 && le(e), e = n;
1503
+ (e.f & xe) === 0 && ue(e), e = n;
1509
1504
  }
1510
1505
  }
1511
- function le(t, e = !0) {
1506
+ function ue(t, e = !0) {
1512
1507
  var n = !1;
1513
- (e || (t.f & hr) !== 0) && t.nodes !== null && t.nodes.end !== null && (Ci(
1508
+ (e || (t.f & dr) !== 0) && t.nodes !== null && t.nodes.end !== null && ($s(
1514
1509
  t.nodes.start,
1515
1510
  /** @type {TemplateNode} */
1516
1511
  t.nodes.end
1517
- ), n = !0), pn(t, e && !n), ut(t, 0), P(t, ke);
1512
+ ), n = !0), cn(t, e && !n), ut(t, 0), S(t, _e);
1518
1513
  var r = t.nodes && t.nodes.t;
1519
1514
  if (r !== null)
1520
- for (const i of r)
1521
- i.stop();
1522
- Cr(t);
1523
- var s = t.parent;
1524
- s !== null && s.first !== null && Rr(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null;
1515
+ for (const s of r)
1516
+ s.stop();
1517
+ Dr(t);
1518
+ var i = t.parent;
1519
+ i !== null && i.first !== null && Or(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null;
1525
1520
  }
1526
- function Ci(t, e) {
1521
+ function $s(t, e) {
1527
1522
  for (; t !== null; ) {
1528
1523
  var n = t === e ? null : /* @__PURE__ */ Rt(t);
1529
1524
  t.remove(), t = n;
1530
1525
  }
1531
1526
  }
1532
- function Rr(t) {
1527
+ function Or(t) {
1533
1528
  var e = t.parent, n = t.prev, r = t.next;
1534
1529
  n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n));
1535
1530
  }
1536
1531
  function Et(t, e, n = !0) {
1537
1532
  var r = [];
1538
- Dr(t, r, !0);
1539
- var s = () => {
1540
- n && le(t), e && e();
1541
- }, i = r.length;
1542
- if (i > 0) {
1543
- var a = () => --i || s();
1533
+ zr(t, r, !0);
1534
+ var i = () => {
1535
+ n && ue(t), e && e();
1536
+ }, s = r.length;
1537
+ if (s > 0) {
1538
+ var a = () => --s || i();
1544
1539
  for (var o of r)
1545
1540
  o.out(a);
1546
1541
  } else
1547
- s();
1542
+ i();
1548
1543
  }
1549
- function Dr(t, e, n) {
1544
+ function zr(t, e, n) {
1550
1545
  if ((t.f & ye) === 0) {
1551
1546
  t.f ^= ye;
1552
1547
  var r = t.nodes && t.nodes.t;
1553
1548
  if (r !== null)
1554
1549
  for (const o of r)
1555
1550
  (o.is_global || n) && e.push(o);
1556
- for (var s = t.first; s !== null; ) {
1557
- var i = s.next, a = (s.f & St) !== 0 || // If this is a branch effect without a block effect parent,
1551
+ for (var i = t.first; i !== null; ) {
1552
+ var s = i.next, a = (i.f & St) !== 0 || // If this is a branch effect without a block effect parent,
1558
1553
  // it means the parent block effect was pruned. In that case,
1559
1554
  // transparency information was transferred to the branch effect.
1560
- (s.f & Ee) !== 0 && (t.f & ge) !== 0;
1561
- Dr(s, e, a ? n : !1), s = i;
1555
+ (i.f & xe) !== 0 && (t.f & ve) !== 0;
1556
+ zr(i, e, a ? n : !1), i = s;
1562
1557
  }
1563
1558
  }
1564
1559
  }
1565
- function Ri(t, e) {
1560
+ function Vs(t, e) {
1566
1561
  if (t.nodes)
1567
1562
  for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) {
1568
- var s = n === r ? null : /* @__PURE__ */ Rt(n);
1569
- e.append(n), n = s;
1563
+ var i = n === r ? null : /* @__PURE__ */ Rt(n);
1564
+ e.append(n), n = i;
1570
1565
  }
1571
1566
  }
1572
- let xt = !1, Ye = !1;
1573
- function Un(t) {
1574
- Ye = t;
1567
+ let xt = !1, Xe = !1;
1568
+ function qn(t) {
1569
+ Xe = t;
1575
1570
  }
1576
- let y = null, ne = !1;
1577
- function Q(t) {
1578
- y = t;
1571
+ let k = null, ie = !1;
1572
+ function te(t) {
1573
+ k = t;
1579
1574
  }
1580
- let k = null;
1575
+ let y = null;
1581
1576
  function ce(t) {
1582
- k = t;
1577
+ y = t;
1583
1578
  }
1584
- let K = null;
1585
- function Di(t) {
1586
- y !== null && (K === null ? K = [t] : K.push(t));
1579
+ let ee = null;
1580
+ function Us(t) {
1581
+ k !== null && (ee === null ? ee = [t] : ee.push(t));
1587
1582
  }
1588
- let H = null, Y = 0, J = null;
1589
- function Oi(t) {
1590
- J = t;
1583
+ let U = null, Y = 0, G = null;
1584
+ function js(t) {
1585
+ G = t;
1591
1586
  }
1592
- let Or = 1, Ae = 0, Ce = Ae;
1593
- function Wn(t) {
1587
+ let Lr = 1, Ae = 0, Ce = Ae;
1588
+ function Yn(t) {
1594
1589
  Ce = t;
1595
1590
  }
1596
- function zr() {
1597
- return ++Or;
1591
+ function Fr() {
1592
+ return ++Lr;
1598
1593
  }
1599
1594
  function ht(t) {
1600
1595
  var e = t.f;
1601
- if ((e & F) !== 0)
1596
+ if ((e & L) !== 0)
1602
1597
  return !0;
1603
- if (e & O && (t.f &= ~Oe), (e & se) !== 0) {
1598
+ if (e & D && (t.f &= ~Oe), (e & se) !== 0) {
1604
1599
  for (var n = (
1605
1600
  /** @type {Value[]} */
1606
1601
  t.deps
1607
- ), r = n.length, s = 0; s < r; s++) {
1608
- var i = n[s];
1602
+ ), r = n.length, i = 0; i < r; i++) {
1603
+ var s = n[i];
1609
1604
  if (ht(
1610
1605
  /** @type {Derived} */
1611
- i
1612
- ) && br(
1606
+ s
1607
+ ) && Mr(
1613
1608
  /** @type {Derived} */
1614
- i
1615
- ), i.wv > t.wv)
1609
+ s
1610
+ ), s.wv > t.wv)
1616
1611
  return !0;
1617
1612
  }
1618
- (e & G) !== 0 && // During time traveling we don't want to reset the status so that
1613
+ (e & Q) !== 0 && // During time traveling we don't want to reset the status so that
1619
1614
  // traversal of the graph in the other batches still happens
1620
- te === null && P(t, D);
1615
+ re === null && S(t, R);
1621
1616
  }
1622
1617
  return !1;
1623
1618
  }
1624
- function Lr(t, e, n = !0) {
1619
+ function $r(t, e, n = !0) {
1625
1620
  var r = t.reactions;
1626
- if (r !== null && !(K !== null && He.call(K, t)))
1627
- for (var s = 0; s < r.length; s++) {
1628
- var i = r[s];
1629
- (i.f & O) !== 0 ? Lr(
1621
+ if (r !== null && !(ee !== null && qe.call(ee, t)))
1622
+ for (var i = 0; i < r.length; i++) {
1623
+ var s = r[i];
1624
+ (s.f & D) !== 0 ? $r(
1630
1625
  /** @type {Derived} */
1631
- i,
1626
+ s,
1632
1627
  e,
1633
1628
  !1
1634
- ) : e === i && (n ? P(i, F) : (i.f & D) !== 0 && P(i, se), oe(
1629
+ ) : e === s && (n ? S(s, L) : (s.f & R) !== 0 && S(s, se), le(
1635
1630
  /** @type {Effect} */
1636
- i
1631
+ s
1637
1632
  ));
1638
1633
  }
1639
1634
  }
1640
- function $r(t) {
1641
- var e = H, n = Y, r = J, s = y, i = K, a = ie, o = ne, l = Ce, u = t.f;
1642
- H = /** @type {null | Value[]} */
1643
- null, Y = 0, J = null, y = (u & (Ee | ze)) === 0 ? t : null, K = null, qe(t.ctx), ne = !1, Ce = ++Ae, t.ac !== null && (Tr(() => {
1644
- t.ac.abort(Te);
1635
+ function Vr(t) {
1636
+ var e = U, n = Y, r = G, i = k, s = ee, a = ae, o = ie, l = Ce, u = t.f;
1637
+ U = /** @type {null | Value[]} */
1638
+ null, Y = 0, G = null, k = (u & (xe | ze)) === 0 ? t : null, ee = null, Ye(t.ctx), ie = !1, Ce = ++Ae, t.ac !== null && (Nr(() => {
1639
+ t.ac.abort(Ie);
1645
1640
  }), t.ac = null);
1646
1641
  try {
1647
- t.f |= Qt;
1642
+ t.f |= Gt;
1648
1643
  var c = (
1649
1644
  /** @type {Function} */
1650
1645
  t.fn
1651
1646
  ), h = c();
1652
1647
  t.f |= Nt;
1653
- var f = t.deps, d = S?.is_fork;
1654
- if (H !== null) {
1648
+ var f = t.deps, d = x?.is_fork;
1649
+ if (U !== null) {
1655
1650
  var m;
1656
1651
  if (d || ut(t, Y), f !== null && Y > 0)
1657
- for (f.length = Y + H.length, m = 0; m < H.length; m++)
1658
- f[Y + m] = H[m];
1652
+ for (f.length = Y + U.length, m = 0; m < U.length; m++)
1653
+ f[Y + m] = U[m];
1659
1654
  else
1660
- t.deps = f = H;
1661
- if (hn() && (t.f & G) !== 0)
1655
+ t.deps = f = U;
1656
+ if (un() && (t.f & Q) !== 0)
1662
1657
  for (m = Y; m < f.length; m++)
1663
1658
  (f[m].reactions ??= []).push(t);
1664
1659
  } else !d && f !== null && Y < f.length && (ut(t, Y), f.length = Y);
1665
- if (dr() && J !== null && !ne && f !== null && (t.f & (O | se | F)) === 0)
1660
+ if (vr() && G !== null && !ie && f !== null && (t.f & (D | se | L)) === 0)
1666
1661
  for (m = 0; m < /** @type {Source[]} */
1667
- J.length; m++)
1668
- Lr(
1669
- J[m],
1662
+ G.length; m++)
1663
+ $r(
1664
+ G[m],
1670
1665
  /** @type {Effect} */
1671
1666
  t
1672
1667
  );
1673
- if (s !== null && s !== t) {
1674
- if (Ae++, s.deps !== null)
1668
+ if (i !== null && i !== t) {
1669
+ if (Ae++, i.deps !== null)
1675
1670
  for (let v = 0; v < n; v += 1)
1676
- s.deps[v].rv = Ae;
1671
+ i.deps[v].rv = Ae;
1677
1672
  if (e !== null)
1678
1673
  for (const v of e)
1679
1674
  v.rv = Ae;
1680
- J !== null && (r === null ? r = J : r.push(.../** @type {Source[]} */
1681
- J));
1675
+ G !== null && (r === null ? r = G : r.push(.../** @type {Source[]} */
1676
+ G));
1682
1677
  }
1683
1678
  return (t.f & be) !== 0 && (t.f ^= be), h;
1684
1679
  } catch (v) {
1685
- return mr(v);
1680
+ return gr(v);
1686
1681
  } finally {
1687
- t.f ^= Qt, H = e, Y = n, J = r, y = s, K = i, qe(a), ne = o, Ce = l;
1682
+ t.f ^= Gt, U = e, Y = n, G = r, k = i, ee = s, Ye(a), ie = o, Ce = l;
1688
1683
  }
1689
1684
  }
1690
- function zi(t, e) {
1685
+ function Bs(t, e) {
1691
1686
  let n = e.reactions;
1692
1687
  if (n !== null) {
1693
- var r = $s.call(n, t);
1688
+ var r = Hi.call(n, t);
1694
1689
  if (r !== -1) {
1695
- var s = n.length - 1;
1696
- s === 0 ? n = e.reactions = null : (n[r] = n[s], n.pop());
1690
+ var i = n.length - 1;
1691
+ i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop());
1697
1692
  }
1698
1693
  }
1699
- if (n === null && (e.f & O) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1694
+ if (n === null && (e.f & D) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1700
1695
  // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1701
1696
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1702
- (H === null || !He.call(H, e))) {
1703
- var i = (
1697
+ (U === null || !qe.call(U, e))) {
1698
+ var s = (
1704
1699
  /** @type {Derived} */
1705
1700
  e
1706
1701
  );
1707
- (i.f & G) !== 0 && (i.f ^= G, i.f &= ~Oe), un(i), wi(i), ut(i, 0);
1702
+ (s.f & Q) !== 0 && (s.f ^= Q, s.f &= ~Oe), an(s), xs(s), ut(s, 0);
1708
1703
  }
1709
1704
  }
1710
1705
  function ut(t, e) {
1711
1706
  var n = t.deps;
1712
1707
  if (n !== null)
1713
1708
  for (var r = e; r < n.length; r++)
1714
- zi(t, n[r]);
1709
+ Bs(t, n[r]);
1715
1710
  }
1716
1711
  function Je(t) {
1717
1712
  var e = t.f;
1718
- if ((e & ke) === 0) {
1719
- P(t, D);
1720
- var n = k, r = xt;
1721
- k = t, xt = !0;
1713
+ if ((e & _e) === 0) {
1714
+ S(t, R);
1715
+ var n = y, r = xt;
1716
+ y = t, xt = !0;
1722
1717
  try {
1723
- (e & (ge | cr)) !== 0 ? Ni(t) : pn(t), Cr(t);
1724
- var s = $r(t);
1725
- t.teardown = typeof s == "function" ? s : null, t.wv = Or;
1726
- var i;
1727
- Kt && ri && (t.f & F) !== 0 && t.deps;
1718
+ (e & (ve | hr)) !== 0 ? Fs(t) : cn(t), Dr(t);
1719
+ var i = Vr(t);
1720
+ t.teardown = typeof i == "function" ? i : null, t.wv = Lr;
1721
+ var s;
1722
+ Jt && cs && (t.f & L) !== 0 && t.deps;
1728
1723
  } finally {
1729
- xt = r, k = n;
1724
+ xt = r, y = n;
1730
1725
  }
1731
1726
  }
1732
1727
  }
1733
1728
  function E(t) {
1734
- var e = t.f, n = (e & O) !== 0;
1735
- if (y !== null && !ne) {
1736
- var r = k !== null && (k.f & ke) !== 0;
1737
- if (!r && (K === null || !He.call(K, t))) {
1738
- var s = y.deps;
1739
- if ((y.f & Qt) !== 0)
1740
- t.rv < Ae && (t.rv = Ae, H === null && s !== null && s[Y] === t ? Y++ : H === null ? H = [t] : H.push(t));
1729
+ var e = t.f, n = (e & D) !== 0;
1730
+ if (k !== null && !ie) {
1731
+ var r = y !== null && (y.f & _e) !== 0;
1732
+ if (!r && (ee === null || !qe.call(ee, t))) {
1733
+ var i = k.deps;
1734
+ if ((k.f & Gt) !== 0)
1735
+ t.rv < Ae && (t.rv = Ae, U === null && i !== null && i[Y] === t ? Y++ : U === null ? U = [t] : U.push(t));
1741
1736
  else {
1742
- (y.deps ??= []).push(t);
1743
- var i = t.reactions;
1744
- i === null ? t.reactions = [y] : He.call(i, y) || i.push(y);
1737
+ (k.deps ??= []).push(t);
1738
+ var s = t.reactions;
1739
+ s === null ? t.reactions = [k] : qe.call(s, k) || s.push(k);
1745
1740
  }
1746
1741
  }
1747
1742
  }
1748
- if (Ye && Me.has(t))
1749
- return Me.get(t);
1743
+ if (Xe && Ee.has(t))
1744
+ return Ee.get(t);
1750
1745
  if (n) {
1751
1746
  var a = (
1752
1747
  /** @type {Derived} */
1753
1748
  t
1754
1749
  );
1755
- if (Ye) {
1750
+ if (Xe) {
1756
1751
  var o = a.v;
1757
- return ((a.f & D) === 0 && a.reactions !== null || Vr(a)) && (o = fn(a)), Me.set(a, o), o;
1752
+ return ((a.f & R) === 0 && a.reactions !== null || jr(a)) && (o = ln(a)), Ee.set(a, o), o;
1758
1753
  }
1759
- var l = (a.f & G) === 0 && !ne && y !== null && (xt || (y.f & G) !== 0), u = (a.f & Nt) === 0;
1760
- ht(a) && (l && (a.f |= G), br(a)), l && !u && (_r(a), Fr(a));
1754
+ var l = (a.f & Q) === 0 && !ie && k !== null && (xt || (k.f & Q) !== 0), u = (a.f & Nt) === 0;
1755
+ ht(a) && (l && (a.f |= Q), Mr(a)), l && !u && (Er(a), Ur(a));
1761
1756
  }
1762
- if (te?.has(t))
1763
- return te.get(t);
1757
+ if (re?.has(t))
1758
+ return re.get(t);
1764
1759
  if ((t.f & be) !== 0)
1765
1760
  throw t.v;
1766
1761
  return t.v;
1767
1762
  }
1768
- function Fr(t) {
1769
- if (t.f |= G, t.deps !== null)
1763
+ function Ur(t) {
1764
+ if (t.f |= Q, t.deps !== null)
1770
1765
  for (const e of t.deps)
1771
- (e.reactions ??= []).push(t), (e.f & O) !== 0 && (e.f & G) === 0 && (_r(
1766
+ (e.reactions ??= []).push(t), (e.f & D) !== 0 && (e.f & Q) === 0 && (Er(
1772
1767
  /** @type {Derived} */
1773
1768
  e
1774
- ), Fr(
1769
+ ), Ur(
1775
1770
  /** @type {Derived} */
1776
1771
  e
1777
1772
  ));
1778
1773
  }
1779
- function Vr(t) {
1780
- if (t.v === N) return !0;
1774
+ function jr(t) {
1775
+ if (t.v === C) return !0;
1781
1776
  if (t.deps === null) return !1;
1782
1777
  for (const e of t.deps)
1783
- if (Me.has(e) || (e.f & O) !== 0 && Vr(
1778
+ if (Ee.has(e) || (e.f & D) !== 0 && jr(
1784
1779
  /** @type {Derived} */
1785
1780
  e
1786
1781
  ))
1787
1782
  return !0;
1788
1783
  return !1;
1789
1784
  }
1790
- function jr(t) {
1791
- var e = ne;
1785
+ function Br(t) {
1786
+ var e = ie;
1792
1787
  try {
1793
- return ne = !0, t();
1788
+ return ie = !0, t();
1794
1789
  } finally {
1795
- ne = e;
1790
+ ie = e;
1796
1791
  }
1797
1792
  }
1798
- const Li = ["touchstart", "touchmove"];
1799
- function $i(t) {
1800
- return Li.includes(t);
1793
+ const Ws = ["touchstart", "touchmove"];
1794
+ function Hs(t) {
1795
+ return Ws.includes(t);
1801
1796
  }
1802
- const Fi = /* @__PURE__ */ Symbol("events"), Vi = /* @__PURE__ */ new Set(), Bn = /* @__PURE__ */ new Set();
1803
- let Hn = null;
1804
- function qn(t) {
1797
+ const qs = /* @__PURE__ */ Symbol("events"), Ys = /* @__PURE__ */ new Set(), Zn = /* @__PURE__ */ new Set();
1798
+ let Xn = null;
1799
+ function Jn(t) {
1805
1800
  var e = this, n = (
1806
1801
  /** @type {Node} */
1807
1802
  e.ownerDocument
1808
- ), r = t.type, s = t.composedPath?.() || [], i = (
1803
+ ), r = t.type, i = t.composedPath?.() || [], s = (
1809
1804
  /** @type {null | Element} */
1810
- s[0] || t.target
1805
+ i[0] || t.target
1811
1806
  );
1812
- Hn = t;
1813
- var a = 0, o = Hn === t && t.__root;
1807
+ Xn = t;
1808
+ var a = 0, o = Xn === t && t.__root;
1814
1809
  if (o) {
1815
- var l = s.indexOf(o);
1810
+ var l = i.indexOf(o);
1816
1811
  if (l !== -1 && (e === document || e === /** @type {any} */
1817
1812
  window)) {
1818
1813
  t.__root = e;
1819
1814
  return;
1820
1815
  }
1821
- var u = s.indexOf(e);
1816
+ var u = i.indexOf(e);
1822
1817
  if (u === -1)
1823
1818
  return;
1824
1819
  l <= u && (a = l);
1825
1820
  }
1826
- if (i = /** @type {Element} */
1827
- s[a] || t.target, i !== e) {
1828
- Vs(t, "currentTarget", {
1821
+ if (s = /** @type {Element} */
1822
+ i[a] || t.target, s !== e) {
1823
+ Yi(t, "currentTarget", {
1829
1824
  configurable: !0,
1830
1825
  get() {
1831
- return i || n;
1826
+ return s || n;
1832
1827
  }
1833
1828
  });
1834
- var c = y, h = k;
1835
- Q(null), ce(null);
1829
+ var c = k, h = y;
1830
+ te(null), ce(null);
1836
1831
  try {
1837
- for (var f, d = []; i !== null; ) {
1838
- var m = i.assignedSlot || i.parentNode || /** @type {any} */
1839
- i.host || null;
1832
+ for (var f, d = []; s !== null; ) {
1833
+ var m = s.assignedSlot || s.parentNode || /** @type {any} */
1834
+ s.host || null;
1840
1835
  try {
1841
- var v = i[Fi]?.[r];
1836
+ var v = s[qs]?.[r];
1842
1837
  v != null && (!/** @type {any} */
1843
- i.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1838
+ s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1844
1839
  // -> the target could not have been disabled because it emits the event in the first place
1845
- t.target === i) && v.call(i, t);
1840
+ t.target === s) && v.call(s, t);
1846
1841
  } catch (M) {
1847
1842
  f ? d.push(M) : f = M;
1848
1843
  }
1849
1844
  if (t.cancelBubble || m === e || m === null)
1850
1845
  break;
1851
- i = m;
1846
+ s = m;
1852
1847
  }
1853
1848
  if (f) {
1854
1849
  for (let M of d)
@@ -1858,89 +1853,89 @@ function qn(t) {
1858
1853
  throw f;
1859
1854
  }
1860
1855
  } finally {
1861
- t.__root = e, delete t.currentTarget, Q(c), ce(h);
1856
+ t.__root = e, delete t.currentTarget, te(c), ce(h);
1862
1857
  }
1863
1858
  }
1864
1859
  }
1865
- const ji = /* @__PURE__ */ globalThis?.window?.trustedTypes?.createPolicy(
1860
+ const Zs = /* @__PURE__ */ globalThis?.window?.trustedTypes?.createPolicy(
1866
1861
  "svelte-trusted-html",
1867
1862
  {
1868
1863
  /** @param {string} html */
1869
1864
  createHTML: (t) => t
1870
1865
  }
1871
1866
  );
1872
- function Ui(t) {
1867
+ function Xs(t) {
1873
1868
  return (
1874
1869
  /** @type {string} */
1875
- ji?.createHTML(t) ?? t
1870
+ Zs?.createHTML(t) ?? t
1876
1871
  );
1877
1872
  }
1878
- function Wi(t, e = !1) {
1879
- var n = Mi("template");
1880
- return t = t.replaceAll("<!>", "<!---->"), n.innerHTML = e ? Ui(t) : t, n.content;
1873
+ function Js(t, e = !1) {
1874
+ var n = As("template");
1875
+ return t = t.replaceAll("<!>", "<!---->"), n.innerHTML = e ? Xs(t) : t, n.content;
1881
1876
  }
1882
- function Zn(t, e) {
1877
+ function Gn(t, e) {
1883
1878
  var n = (
1884
1879
  /** @type {Effect} */
1885
- k
1880
+ y
1886
1881
  );
1887
1882
  n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null });
1888
1883
  }
1889
1884
  // @__NO_SIDE_EFFECTS__
1890
- function Ur(t, e) {
1891
- var n = (e & Qs) !== 0, r = (e & ei) !== 0, s, i = !t.startsWith("<!>");
1885
+ function Wr(t, e) {
1886
+ var n = (e & as) !== 0, r = (e & os) !== 0, i, s = !t.startsWith("<!>");
1892
1887
  return () => {
1893
- s === void 0 && (s = Wi(i ? t : "<!>" + t, !0), n || (s = /** @type {TemplateNode} */
1894
- /* @__PURE__ */ It(s)));
1888
+ i === void 0 && (i = Js(s ? t : "<!>" + t, !0), n || (i = /** @type {TemplateNode} */
1889
+ /* @__PURE__ */ Tt(i)));
1895
1890
  var a = (
1896
1891
  /** @type {TemplateNode} */
1897
- r || xr ? document.importNode(s, !0) : s.cloneNode(!0)
1892
+ r || Pr ? document.importNode(i, !0) : i.cloneNode(!0)
1898
1893
  );
1899
1894
  if (n) {
1900
1895
  var o = (
1901
1896
  /** @type {TemplateNode} */
1902
- /* @__PURE__ */ It(a)
1897
+ /* @__PURE__ */ Tt(a)
1903
1898
  ), l = (
1904
1899
  /** @type {TemplateNode} */
1905
1900
  a.lastChild
1906
1901
  );
1907
- Zn(o, l);
1902
+ Gn(o, l);
1908
1903
  } else
1909
- Zn(a, a);
1904
+ Gn(a, a);
1910
1905
  return a;
1911
1906
  };
1912
1907
  }
1913
- function Wr(t, e) {
1908
+ function Hr(t, e) {
1914
1909
  t !== null && t.before(
1915
1910
  /** @type {Node} */
1916
1911
  e
1917
1912
  );
1918
1913
  }
1919
- function dn(t, e) {
1920
- return Bi(t, e);
1914
+ function fn(t, e) {
1915
+ return Gs(t, e);
1921
1916
  }
1922
- const kt = /* @__PURE__ */ new Map();
1923
- function Bi(t, { target: e, anchor: n, props: r = {}, events: s, context: i, intro: a = !0 }) {
1924
- ki();
1917
+ const yt = /* @__PURE__ */ new Map();
1918
+ function Gs(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) {
1919
+ Ps();
1925
1920
  var o = /* @__PURE__ */ new Set(), l = (h) => {
1926
1921
  for (var f = 0; f < h.length; f++) {
1927
1922
  var d = h[f];
1928
1923
  if (!o.has(d)) {
1929
1924
  o.add(d);
1930
- var m = $i(d);
1931
- for (const W of [e, document]) {
1932
- var v = kt.get(W);
1933
- v === void 0 && (v = /* @__PURE__ */ new Map(), kt.set(W, v));
1925
+ var m = Hs(d);
1926
+ for (const $ of [e, document]) {
1927
+ var v = yt.get($);
1928
+ v === void 0 && (v = /* @__PURE__ */ new Map(), yt.set($, v));
1934
1929
  var M = v.get(d);
1935
- M === void 0 ? (W.addEventListener(d, qn, { passive: m }), v.set(d, 1)) : v.set(d, M + 1);
1930
+ M === void 0 ? ($.addEventListener(d, Jn, { passive: m }), v.set(d, 1)) : v.set(d, M + 1);
1936
1931
  }
1937
1932
  }
1938
1933
  }
1939
1934
  };
1940
- l(Fs(Vi)), Bn.add(l);
1941
- var u = void 0, c = Pi(() => {
1942
- var h = n ?? e.appendChild(Ir());
1943
- return ci(
1935
+ l(qi(Ys)), Zn.add(l);
1936
+ var u = void 0, c = Ds(() => {
1937
+ var h = n ?? e.appendChild(Ar());
1938
+ return gs(
1944
1939
  /** @type {TemplateNode} */
1945
1940
  h,
1946
1941
  {
@@ -1948,110 +1943,110 @@ function Bi(t, { target: e, anchor: n, props: r = {}, events: s, context: i, int
1948
1943
  }
1949
1944
  },
1950
1945
  (f) => {
1951
- on({});
1946
+ rn({});
1952
1947
  var d = (
1953
1948
  /** @type {ComponentContext} */
1954
- ie
1949
+ ae
1955
1950
  );
1956
- i && (d.c = i), s && (r.$$events = s), u = t(f, r) || {}, ln();
1951
+ s && (d.c = s), i && (r.$$events = i), u = t(f, r) || {}, sn();
1957
1952
  }
1958
1953
  ), () => {
1959
1954
  for (var f of o)
1960
1955
  for (const v of [e, document]) {
1961
1956
  var d = (
1962
1957
  /** @type {Map<string, number>} */
1963
- kt.get(v)
1958
+ yt.get(v)
1964
1959
  ), m = (
1965
1960
  /** @type {number} */
1966
1961
  d.get(f)
1967
1962
  );
1968
- --m == 0 ? (v.removeEventListener(f, qn), d.delete(f), d.size === 0 && kt.delete(v)) : d.set(f, m);
1963
+ --m == 0 ? (v.removeEventListener(f, Jn), d.delete(f), d.size === 0 && yt.delete(v)) : d.set(f, m);
1969
1964
  }
1970
- Bn.delete(l), h !== n && h.parentNode?.removeChild(h);
1965
+ Zn.delete(l), h !== n && h.parentNode?.removeChild(h);
1971
1966
  };
1972
1967
  });
1973
- return Hi.set(u, c), u;
1968
+ return Ks.set(u, c), u;
1974
1969
  }
1975
- let Hi = /* @__PURE__ */ new WeakMap();
1976
- function Br(t) {
1970
+ let Ks = /* @__PURE__ */ new WeakMap();
1971
+ function qr(t) {
1977
1972
  var e, n, r = "";
1978
1973
  if (typeof t == "string" || typeof t == "number") r += t;
1979
1974
  else if (typeof t == "object") if (Array.isArray(t)) {
1980
- var s = t.length;
1981
- for (e = 0; e < s; e++) t[e] && (n = Br(t[e])) && (r && (r += " "), r += n);
1975
+ var i = t.length;
1976
+ for (e = 0; e < i; e++) t[e] && (n = qr(t[e])) && (r && (r += " "), r += n);
1982
1977
  } else for (n in t) t[n] && (r && (r += " "), r += n);
1983
1978
  return r;
1984
1979
  }
1985
- function qi() {
1986
- for (var t, e, n = 0, r = "", s = arguments.length; n < s; n++) (t = arguments[n]) && (e = Br(t)) && (r && (r += " "), r += e);
1980
+ function Qs() {
1981
+ for (var t, e, n = 0, r = "", i = arguments.length; n < i; n++) (t = arguments[n]) && (e = qr(t)) && (r && (r += " "), r += e);
1987
1982
  return r;
1988
1983
  }
1989
- function Hr(t) {
1990
- return typeof t == "object" ? qi(t) : t ?? "";
1984
+ function Yr(t) {
1985
+ return typeof t == "object" ? Qs(t) : t ?? "";
1991
1986
  }
1992
- function Zi(t, e, n) {
1987
+ function ea(t, e, n) {
1993
1988
  var r = t == null ? "" : "" + t;
1994
1989
  return e && (r = r ? r + " " + e : e), r === "" ? null : r;
1995
1990
  }
1996
- function Yn(t, e = !1) {
1991
+ function Kn(t, e = !1) {
1997
1992
  var n = e ? " !important;" : ";", r = "";
1998
- for (var s in t) {
1999
- var i = t[s];
2000
- i != null && i !== "" && (r += " " + s + ": " + i + n);
1993
+ for (var i in t) {
1994
+ var s = t[i];
1995
+ s != null && s !== "" && (r += " " + i + ": " + s + n);
2001
1996
  }
2002
1997
  return r;
2003
1998
  }
2004
- function Yi(t, e) {
1999
+ function ta(t, e) {
2005
2000
  if (e) {
2006
- var n = "", r, s;
2007
- return Array.isArray(e) ? (r = e[0], s = e[1]) : r = e, r && (n += Yn(r)), s && (n += Yn(s, !0)), n = n.trim(), n === "" ? null : n;
2001
+ var n = "", r, i;
2002
+ return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += Kn(r)), i && (n += Kn(i, !0)), n = n.trim(), n === "" ? null : n;
2008
2003
  }
2009
2004
  return String(t);
2010
2005
  }
2011
- function qr(t, e, n, r, s, i) {
2006
+ function Zr(t, e, n, r, i, s) {
2012
2007
  var a = t.__className;
2013
2008
  if (a !== n || a === void 0) {
2014
- var o = Zi(n, r);
2009
+ var o = ea(n, r);
2015
2010
  o == null ? t.removeAttribute("class") : t.className = o, t.__className = n;
2016
2011
  }
2017
- return i;
2012
+ return s;
2018
2013
  }
2019
- function Zt(t, e = {}, n, r) {
2020
- for (var s in n) {
2021
- var i = n[s];
2022
- e[s] !== i && (n[s] == null ? t.style.removeProperty(s) : t.style.setProperty(s, i, r));
2014
+ function Ht(t, e = {}, n, r) {
2015
+ for (var i in n) {
2016
+ var s = n[i];
2017
+ e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r));
2023
2018
  }
2024
2019
  }
2025
2020
  function nt(t, e, n, r) {
2026
- var s = t.__style;
2027
- if (s !== e) {
2028
- var i = Yi(e, r);
2029
- i == null ? t.removeAttribute("style") : t.style.cssText = i, t.__style = e;
2030
- } else r && (Array.isArray(r) ? (Zt(t, n?.[0], r[0]), Zt(t, n?.[1], r[1], "important")) : Zt(t, n, r));
2021
+ var i = t.__style;
2022
+ if (i !== e) {
2023
+ var s = ta(e, r);
2024
+ s == null ? t.removeAttribute("style") : t.style.cssText = s, t.__style = e;
2025
+ } else r && (Array.isArray(r) ? (Ht(t, n?.[0], r[0]), Ht(t, n?.[1], r[1], "important")) : Ht(t, n, r));
2031
2026
  return r;
2032
2027
  }
2033
- function Jn(t, e) {
2028
+ function Qn(t, e) {
2034
2029
  return t === e || t?.[Mt] === e;
2035
2030
  }
2036
2031
  function rt(t = {}, e, n, r) {
2037
- return Ii(() => {
2038
- var s, i;
2039
- return Ar(() => {
2040
- s = i, i = [], jr(() => {
2041
- t !== n(...i) && (e(t, ...i), s && Jn(n(...s), t) && e(null, ...s));
2032
+ return Os(() => {
2033
+ var i, s;
2034
+ return Cr(() => {
2035
+ i = s, s = [], Br(() => {
2036
+ t !== n(...s) && (e(t, ...s), i && Qn(n(...i), t) && e(null, ...i));
2042
2037
  });
2043
2038
  }), () => {
2044
2039
  Ne(() => {
2045
- i && Jn(n(...i), t) && e(null, ...i);
2040
+ s && Qn(n(...s), t) && e(null, ...s);
2046
2041
  });
2047
2042
  };
2048
2043
  }), t;
2049
2044
  }
2050
- class mn {
2045
+ class hn {
2051
2046
  div;
2052
2047
  marker;
2053
- constructor(e, n, r, s) {
2054
- this.div = document.createElement("div"), this.marker = e.createMarker(this.div, n, r, s);
2048
+ constructor(e, n, r, i) {
2049
+ this.div = document.createElement("div"), this.marker = e.createMarker(this.div, n, r, i);
2055
2050
  }
2056
2051
  insert() {
2057
2052
  this.marker.inserted() != !0 && this.marker.insert();
@@ -2070,17 +2065,17 @@ class pt {
2070
2065
  lng;
2071
2066
  rank;
2072
2067
  marker;
2073
- constructor(e, n) {
2068
+ constructor(e, n, r, i, s) {
2074
2069
  if (new.target === pt) throw new Error("Unsupported code");
2075
- this.shown = !0, this.id = e.id, this.lat = e.lat, this.lng = e.lng, this.rank = e.rank, this.marker = n;
2070
+ this.shown = !0, this.id = e, this.lat = n, this.lng = r, this.rank = i, this.marker = s;
2076
2071
  }
2077
2072
  }
2078
- const Ji = "5";
2079
- typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(Ji);
2080
- function Zr(t) {
2073
+ const na = "5";
2074
+ typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(na);
2075
+ function Xr(t) {
2081
2076
  return -0.5 * (Math.cos(Math.PI * t) - 1);
2082
2077
  }
2083
- class Yr {
2078
+ class Jr {
2084
2079
  animating;
2085
2080
  animationEasing;
2086
2081
  animationCallback;
@@ -2108,8 +2103,8 @@ class Yr {
2108
2103
  target(e) {
2109
2104
  if (e === this.value.end) return;
2110
2105
  this.value.start = this.value.current, this.value.end = e;
2111
- const n = performance.now(), r = Math.abs(this.value.start - this.value.end), s = this.value.max - this.value.min;
2112
- this.time.start = n, this.time.end = n + this.time.span * Math.sqrt(r / s), !this.animating && (this.animating = !0, window.requestAnimationFrame(this.animationFrame.bind(this)));
2106
+ const n = performance.now(), r = Math.abs(this.value.start - this.value.end), i = this.value.max - this.value.min;
2107
+ this.time.start = n, this.time.end = n + this.time.span * Math.sqrt(r / i), !this.animating && (this.animating = !0, window.requestAnimationFrame(this.animationFrame.bind(this)));
2113
2108
  }
2114
2109
  set(e) {
2115
2110
  if (e === this.value.end) return;
@@ -2124,125 +2119,100 @@ class Yr {
2124
2119
  return performance.now() > this.time.end;
2125
2120
  }
2126
2121
  }
2127
- var Xi = /* @__PURE__ */ Ur("<div></div>");
2128
- function Gi(t, e) {
2129
- on(e, !0);
2130
- let n = e.id, r = e.style, s = e.content, i = {
2131
- setDisplayed: fe,
2132
- getDisplayed: Le,
2133
- setSuppressed: ee,
2134
- setCollapsed: Se,
2135
- getCollapsed: Pe,
2136
- setScale: dt
2122
+ var ra = /* @__PURE__ */ Wr("<div></div>");
2123
+ function ia(t, e) {
2124
+ rn(e, !0);
2125
+ let n = e.id, r = e.element, i = e.style, s = e.dimensions, a = e.initialize, o = {
2126
+ setDisplayed: X,
2127
+ getDisplayed: Se,
2128
+ setSuppressed: ke,
2129
+ setCollapsed: Pe,
2130
+ getCollapsed: J,
2131
+ setScale: Dt
2137
2132
  };
2138
- function a() {
2139
- return i;
2140
- }
2141
- let o, l = r.dimensions.width, u = r.dimensions.height, c = r.dimensions.radius, h = r.dimensions.padding ?? or, f = r.colors?.border ?? Gt, d = r.colors?.background ?? Os, m = r.colors?.shadow ?? lr, v = /* @__PURE__ */ B(!1), M = !1, W = !1;
2142
- function fe(b) {
2143
- if (b != E(v)) {
2144
- if (q(v, b, !0), b == !0) {
2145
- if (s == null || W || M) return;
2146
- M = !0, s(n).then((pe) => {
2147
- pe instanceof HTMLElement ? o.appendChild(pe) : console.error("Failed to load pin content");
2148
- }).catch((pe) => console.error(pe)).finally(() => {
2149
- W = !0, M = !1;
2150
- });
2151
- }
2152
- b == !1 && V.end();
2153
- }
2133
+ function l() {
2134
+ return o;
2154
2135
  }
2155
- function Le() {
2156
- return E(v);
2136
+ let u, c = s.width, h = s.height, f = s.padding, d = i?.background ?? ji, m = i?.radius ?? Fi, v = i?.shadow ?? $i, M = /* @__PURE__ */ V(!1), $ = !1;
2137
+ function X(_) {
2138
+ _ == !0 && (u && r && r.parentElement != u && u.appendChild(r), $ == !1 && a && r && ($ = !0, setTimeout(async () => await a(n, r), 0))), _ != E(M) && (j(M, _, !0), _ == !1 && q.end());
2157
2139
  }
2158
- let xe = /* @__PURE__ */ B(!0);
2159
- function ee(b) {
2160
- b != E(xe) && (q(xe, b, !0), b && (z = Fe, V.set(Fe)));
2140
+ function Se() {
2141
+ return E(M);
2161
2142
  }
2162
- let he = /* @__PURE__ */ B(!0);
2163
- function Se(b) {
2164
- b != E(he) && (q(he, b, !0), V.target(E(he) ? 0 : z));
2143
+ let we = /* @__PURE__ */ V(!0);
2144
+ function ke(_) {
2145
+ _ != E(we) && (j(we, _, !0), _ && (ne = $e, q.set($e)));
2165
2146
  }
2166
- function Pe() {
2167
- return E(v) ? V.expired() : !0;
2147
+ let fe = /* @__PURE__ */ V(!0);
2148
+ function Pe(_) {
2149
+ _ != E(fe) && (j(fe, _, !0), q.target(E(fe) ? 0 : ne));
2168
2150
  }
2169
- let z = Fe, V = new Yr({
2170
- value: Fe,
2151
+ function J() {
2152
+ return E(M) ? q.expired() : !0;
2153
+ }
2154
+ let ne = $e, q = new Jr({
2155
+ value: $e,
2171
2156
  min: 0,
2172
2157
  max: 1,
2173
- timespan: Ns,
2174
- easing: Zr,
2175
- callback: Ot
2158
+ timespan: Di,
2159
+ easing: Xr,
2160
+ callback: dt
2176
2161
  });
2177
- function dt(b) {
2178
- z = b, V.target(b);
2162
+ function Dt(_) {
2163
+ ne = _, q.target(_);
2179
2164
  }
2180
- function Ot(b) {
2181
- o.style.scale = b.toString(), o.style.filter = `brightness(${mt(b)})`;
2165
+ function dt(_) {
2166
+ u.style.scale = _.toString(), u.style.filter = `brightness(${he(_)})`;
2182
2167
  }
2183
- function mt(b) {
2184
- return 0.25 + 0.75 * b;
2168
+ function he(_) {
2169
+ return 0.25 + 0.75 * _;
2185
2170
  }
2186
- var Ke = { invoke: a }, $e = Xi();
2187
- let vt;
2188
- return rt($e, (b) => o = b, () => o), Nr(
2189
- (b) => {
2190
- qr(
2191
- $e,
2171
+ var Ot = { invoke: l }, Le = ra();
2172
+ let Fe;
2173
+ return rt(Le, (_) => u = _, () => u), Rr(
2174
+ (_) => {
2175
+ Zr(
2176
+ Le,
2192
2177
  1,
2193
- Hr([
2178
+ Yr([
2194
2179
  "pin",
2195
- E(v) && "displayed",
2196
- E(xe) && "suppressed"
2180
+ E(M) && "displayed",
2181
+ E(we) && "suppressed"
2197
2182
  ]),
2198
2183
  "svelte-10kxbrm"
2199
- ), vt = nt($e, "", vt, b);
2184
+ ), Fe = nt(Le, "", Fe, _);
2200
2185
  },
2201
2186
  [
2202
2187
  () => ({
2203
- width: `${l}px`,
2204
- height: `${u}px`,
2205
- "border-radius": `${c}px`,
2206
- "border-color": f,
2188
+ width: `${c}px`,
2189
+ height: `${h}px`,
2190
+ padding: `${f}px`,
2191
+ "border-radius": `${m}px`,
2207
2192
  "background-color": `rgb(from ${d} r g b / 1)`,
2208
- "border-width": `${h}px`,
2209
- "box-shadow": m,
2210
- scale: Fe,
2211
- filter: `brightness(${mt(Fe)})`
2193
+ "box-shadow": v,
2194
+ scale: $e,
2195
+ filter: `brightness(${he($e)})`
2212
2196
  })
2213
2197
  ]
2214
- ), Wr(t, $e), ln(Ke);
2198
+ ), Hr(t, Le), sn(Ot);
2215
2199
  }
2216
- class Ki extends pt {
2200
+ class sa extends pt {
2217
2201
  width;
2218
2202
  height;
2219
2203
  zoom;
2220
2204
  component;
2221
- constructor(e, n) {
2222
- super(e, new mn(n, e.lat, e.lng, e.rank));
2223
- const r = e.pin?.style.dimensions.width ?? qt, s = e.pin?.style.dimensions.height ?? qt, i = e.pin?.style.dimensions.padding ?? or, a = e.pin?.style.dimensions.radius ?? qt / 2;
2224
- this.width = r, this.height = s, this.zoom = NaN, this.component = dn(Gi, {
2205
+ constructor(e, n, r, i, s, a) {
2206
+ super(n, r, i, s, new hn(e, r, i, s)), this.width = a.dimensions.width, this.height = a.dimensions.height, this.zoom = NaN, this.component = fn(ia, {
2225
2207
  target: this.marker.div,
2226
- props: {
2227
- id: this.id,
2228
- style: {
2229
- dimensions: {
2230
- width: r,
2231
- height: s,
2232
- padding: i,
2233
- radius: a
2234
- },
2235
- colors: e.pin?.style.colors
2236
- },
2237
- content: e.pin?.body
2238
- }
2208
+ props: a
2239
2209
  });
2240
2210
  }
2241
2211
  get zIndex() {
2242
- return Number.isNaN(this.zoom) ? this.rank : Math.round(-this.zoom * ar) + Rs;
2212
+ return Number.isNaN(this.zoom) ? this.rank : Math.round(-this.zoom * cr) + zi;
2243
2213
  }
2244
2214
  }
2245
- class Xn {
2215
+ class er {
2246
2216
  animating;
2247
2217
  animationTimestamp;
2248
2218
  animationEnd;
@@ -2264,8 +2234,8 @@ class Xn {
2264
2234
  this.speed.current = 0, this.value.current = this.value.target;
2265
2235
  return;
2266
2236
  }
2267
- const s = r * this.speed.spring.stiffness - this.speed.spring.damping * this.speed.current;
2268
- if (this.speed.current += s * n, this.value.current += this.speed.current * n, this.value.current < this.value.min) {
2237
+ const i = r * this.speed.spring.stiffness - this.speed.spring.damping * this.speed.current;
2238
+ if (this.speed.current += i * n, this.value.current += this.speed.current * n, this.value.current < this.value.min) {
2269
2239
  this.value.current = this.value.target, this.speed.current = 0;
2270
2240
  return;
2271
2241
  }
@@ -2296,198 +2266,180 @@ class Xn {
2296
2266
  return performance.now() > this.animationEnd;
2297
2267
  }
2298
2268
  }
2299
- function rn(t, e, n) {
2269
+ function tn(t, e, n) {
2300
2270
  if (t <= 0 || e <= 0) return { x: 0, y: 0 };
2301
- 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);
2302
- 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 };
2271
+ let r = t / 2, i = e / 2, s = Math.sqrt(r * r + i * i), a = Math.atan(i / r) * (180 / Math.PI), o = n * (Math.PI / 180);
2272
+ return n < 180 ? n < 90 ? n < a ? { x: 0, y: s * Math.sin(o) - i } : { x: s * Math.cos(o) - r, y: 0 } : n < 180 - a ? { x: s * Math.cos(o) - r, y: 0 } : { x: -t, y: s * Math.sin(o) - i } : n < 270 ? n < 180 + a ? { x: -t, y: s * Math.sin(o) - i } : { x: s * Math.cos(o) - r, y: -e } : n < 360 - a ? { x: s * Math.cos(o) - r, y: -e } : { x: 0, y: s * Math.sin(o) - i };
2303
2273
  }
2304
- var Qi = /* @__PURE__ */ Ur('<div><div class="element pointer svelte-1no6o2a"></div> <div class="element bubble svelte-1no6o2a"></div></div> <div class="element body svelte-1no6o2a"></div>', 1);
2305
- function Jr(t, e) {
2306
- on(e, !0);
2307
- let n = e.id, r = e.style, s = e.content, i = {
2274
+ var aa = /* @__PURE__ */ Wr('<div><div class="element pointer svelte-1no6o2a"></div> <div class="element bubble svelte-1no6o2a"></div></div> <div class="element body svelte-1no6o2a"></div>', 1);
2275
+ function Gr(t, e) {
2276
+ rn(e, !0);
2277
+ let n = e.id, r = e.element, i = e.style, s = e.dimensions, a = e.initialize, o = {
2308
2278
  setDisplayed: Ot,
2309
- getDisplayed: mt,
2310
- setCollapsed: $e,
2311
- getCollapsed: vt,
2312
- getExpanded: b,
2313
- setAngle: ms
2279
+ getDisplayed: Le,
2280
+ setCollapsed: _,
2281
+ getCollapsed: pi,
2282
+ getExpanded: di,
2283
+ setAngle: vi
2314
2284
  };
2315
- function a() {
2316
- return i;
2317
- }
2318
- let o = r.dimensions.width + 2 * r.dimensions.margin, l = r.dimensions.height + 2 * r.dimensions.margin, u = r.dimensions.margin, c, h = r.colors?.filter ?? lr, f, d = Math.min(r.dimensions.width, r.dimensions.height) / Math.SQRT2 - r.dimensions.margin, m = r.colors?.background ?? Gt, v = Math.max(1, r.dimensions.radius / d), M, W = r.dimensions.width, fe = r.dimensions.height, Le = r.dimensions.radius, xe = r.colors?.background ?? Gt, ee, he = r.dimensions.width, Se = r.dimensions.height, Pe = r.dimensions.radius, z = /* @__PURE__ */ B(!1), V = !1, dt = !1;
2319
- function Ot(w) {
2320
- if (w != E(z)) {
2321
- if (q(z, w, !0), w) {
2322
- if (s == null || dt || V) return;
2323
- V = !0, s(n).then((de) => {
2324
- de instanceof HTMLElement ? ee.appendChild(de) : console.error("Failed to load tooltip content");
2325
- }).catch((de) => console.error(de)).finally(() => {
2326
- dt = !0, V = !1;
2327
- });
2328
- }
2329
- w == !1 && (pe.end(), Lt.end(), $t.end());
2330
- }
2285
+ function l() {
2286
+ return o;
2287
+ }
2288
+ let u = s.width + 2 * s.padding, c = s.height + 2 * s.padding, h = s.padding, f, d = i?.filter ?? Ui, m, v = s.padding * 2, M = Math.max(2, (i?.radius ?? Fn) / v), $ = i?.background ?? $n, X, Se = s.width, we = s.height, ke = i?.radius ?? Fn, fe = Math.min(1, 2 * ke / Math.min(we, Se)), Pe = i?.background ?? $n, J, ne = s.width, q = s.height, Dt = i?.radius, dt = !1, he = /* @__PURE__ */ V(!1);
2289
+ function Ot(g) {
2290
+ g != E(he) && (j(he, g, !0), g == !0 && (r && r.parentElement != J && J.appendChild(r), dt == !1 && a && r && (dt = !0, setTimeout(async () => await a(n, r), 0))), g == !1 && (mt.end(), Lt.end(), Ft.end()));
2331
2291
  }
2332
- function mt() {
2333
- return E(z);
2292
+ function Le() {
2293
+ return E(he);
2334
2294
  }
2335
- let Ke = /* @__PURE__ */ B(!0);
2336
- function $e(w) {
2337
- w != E(Ke) && (q(Ke, w, !0), pe.target(E(Ke) ? 0 : 1));
2295
+ let Fe = /* @__PURE__ */ V(!0);
2296
+ function _(g) {
2297
+ g != E(Fe) && (j(Fe, g, !0), mt.target(E(Fe) ? 0 : 1));
2338
2298
  }
2339
- function vt() {
2340
- return E(z) ? pe.expired() : !0;
2299
+ function pi() {
2300
+ return E(he) ? mt.expired() : !0;
2341
2301
  }
2342
- function b() {
2343
- return E(z) ? pe.expired() : !1;
2302
+ function di() {
2303
+ return E(he) ? mt.expired() : !1;
2344
2304
  }
2345
- let pe = new Yr({
2305
+ let mt = new Jr({
2346
2306
  value: 0,
2347
2307
  min: 0,
2348
2308
  max: 1,
2349
- timespan: Cs,
2350
- easing: Zr,
2351
- callback: ds
2309
+ timespan: Oi,
2310
+ easing: Xr,
2311
+ callback: mi
2352
2312
  });
2353
- function ds(w) {
2354
- c.style.opacity = `${w}`, f.style.scale = `${w}`, M.style.scale = `${w}`, ee.style.scale = `${w}`;
2313
+ function mi(g) {
2314
+ f.style.opacity = `${g}`, m.style.scale = `${g}`, X.style.scale = `${g}`, J.style.scale = `${g}`;
2355
2315
  }
2356
- let gt = NaN, zt = /* @__PURE__ */ B(!1), wn = -o / 2, Lt = new Xn({
2357
- value: -o / 2,
2358
- min: -o,
2316
+ let vt = NaN, zt = /* @__PURE__ */ V(!1), vn = -u / 2, Lt = new er({
2317
+ value: -u / 2,
2318
+ min: -u,
2359
2319
  max: 0,
2360
2320
  precision: 1,
2361
2321
  stiffness: Dn,
2362
- callback: vs
2363
- }), yn = -l / 2, $t = new Xn({
2364
- value: -l / 2,
2365
- min: -l,
2322
+ callback: gi
2323
+ }), gn = -c / 2, Ft = new er({
2324
+ value: -c / 2,
2325
+ min: -c,
2366
2326
  max: 0,
2367
2327
  precision: 1,
2368
2328
  stiffness: Dn,
2369
- callback: gs
2329
+ callback: wi
2370
2330
  });
2371
- function ms(w, de) {
2372
- if (Number.isNaN(w)) {
2373
- gt = NaN, q(zt, !1);
2331
+ function vi(g, gt) {
2332
+ if (Number.isNaN(g)) {
2333
+ vt = NaN, j(zt, !1);
2374
2334
  return;
2375
2335
  }
2376
- if (E(zt) == !1 || de == !0) {
2377
- q(zt, !0), gt = w;
2378
- const me = rn(o, l, w);
2379
- Lt.set(Math.round(me.x)), $t.set(Math.round(me.y));
2336
+ if (E(zt) == !1 || gt == !0) {
2337
+ j(zt, !0), vt = g;
2338
+ const pe = tn(u, c, g);
2339
+ Lt.set(Math.round(pe.x)), Ft.set(Math.round(pe.y));
2380
2340
  return;
2381
2341
  }
2382
- if (gt != w) {
2383
- gt = w;
2384
- const me = rn(o, l, w);
2385
- Lt.target(Math.round(me.x)), $t.target(Math.round(me.y));
2342
+ if (vt != g) {
2343
+ vt = g;
2344
+ const pe = tn(u, c, g);
2345
+ Lt.target(Math.round(pe.x)), Ft.target(Math.round(pe.y));
2386
2346
  return;
2387
2347
  }
2388
2348
  }
2389
- function vs(w) {
2390
- wn = w, kn();
2349
+ function gi(g) {
2350
+ vn = g, wn();
2391
2351
  }
2392
- function gs(w) {
2393
- yn = w, kn();
2352
+ function wi(g) {
2353
+ gn = g, wn();
2394
2354
  }
2395
- function kn() {
2396
- const w = wn, de = yn, me = w + o / 2, Vt = de + l / 2, jt = l < o ? me * l / o : me, Ut = l > o ? Vt * o / l : Vt, ys = Math.atan2(Ut, jt) / Math.PI * 180 - 45, Wt = Math.sqrt(jt * jt + Ut * Ut), et = Math.min(o, l) / 2, ks = et * Math.SQRT2, Bt = (Wt - et) / (ks - et), In = 0, Tn = In + Bt * (22.5 - In), bs = Wt < et ? Wt / et : 1, An = w + u - u * (me / o) * Bt, Nn = de + u - u * (Vt / l) * Bt;
2397
- f.style.transform = `scale(${bs}) rotate(${ys}deg) skew(${Tn}deg, ${Tn}deg)`, M.style.transform = `translate(${Math.round(An)}px, ${Math.round(Nn)}px)`, ee.style.transform = `translate(${Math.round(An)}px, ${Math.round(Nn)}px)`;
2355
+ function wn() {
2356
+ const g = vn, gt = gn, pe = g + u / 2, Vt = gt + c / 2, Ut = c < u ? pe * c / u : pe, jt = c > u ? Vt * u / c : Vt, yi = Math.atan2(jt, Ut) / Math.PI * 180 - 45, Bt = Math.sqrt(Ut * Ut + jt * jt), et = Math.min(u, c) / 2, _i = et * Math.SQRT2, Sn = (Bt - et) / (_i - et), Pn = 15, Tn = Pn + Sn * (22.5 - Pn), bi = Bt < et ? Bt / et : 1, Mi = g + h, Ei = gt + h, In = h * 2 * fe * Sn, An = Mi - In * (pe / u), Nn = Ei - In * (Vt / c);
2357
+ m.style.transform = `scale(${bi}) rotate(${yi}deg) skew(${Tn}deg, ${Tn}deg)`, X.style.transform = `translate(${Math.round(An)}px, ${Math.round(Nn)}px)`, J.style.transform = `translate(${Math.round(An)}px, ${Math.round(Nn)}px)`;
2398
2358
  }
2399
- var ws = { invoke: a }, bn = Qi(), Qe = _i(bn);
2359
+ var ki = { invoke: l }, kn = aa(), Qe = Is(kn);
2360
+ let yn;
2361
+ var $t = Ts(Qe);
2400
2362
  let _n;
2401
- var Ft = bi(Qe);
2363
+ rt($t, (g) => m = g, () => m);
2364
+ var bn = Hn($t, 2);
2402
2365
  let Mn;
2403
- rt(Ft, (w) => f = w, () => f);
2404
- var En = jn(Ft, 2);
2366
+ rt(bn, (g) => X = g, () => X), rt(Qe, (g) => f = g, () => f);
2367
+ var En = Hn(Qe, 2);
2405
2368
  let xn;
2406
- rt(En, (w) => M = w, () => M), rt(Qe, (w) => c = w, () => c);
2407
- var Sn = jn(Qe, 2);
2408
- let Pn;
2409
- return rt(Sn, (w) => ee = w, () => ee), Nr(() => {
2410
- qr(Qe, 1, Hr(["element anchor", E(z) && "displayed"]), "svelte-1no6o2a"), _n = nt(Qe, "", _n, { filter: h }), Mn = nt(Ft, "", Mn, {
2411
- width: `${d}px`,
2412
- height: `${d}px`,
2413
- "border-radius": `${v}px`,
2414
- "background-color": `rgb(from ${m} r g b / 1)`
2369
+ return rt(En, (g) => J = g, () => J), Rr(() => {
2370
+ Zr(Qe, 1, Yr(["element anchor", E(he) && "displayed"]), "svelte-1no6o2a"), yn = nt(Qe, "", yn, { filter: d }), _n = nt($t, "", _n, {
2371
+ width: `${v}px`,
2372
+ height: `${v}px`,
2373
+ "border-radius": `${M}px`,
2374
+ "background-color": `rgb(from ${$} r g b / 1)`
2375
+ }), Mn = nt(bn, "", Mn, {
2376
+ width: `${Se}px`,
2377
+ height: `${we}px`,
2378
+ "border-radius": `${ke}px`,
2379
+ "background-color": `rgb(from ${Pe} r g b / 1)`
2415
2380
  }), xn = nt(En, "", xn, {
2416
- width: `${W}px`,
2417
- height: `${fe}px`,
2418
- "border-radius": `${Le}px`,
2419
- "background-color": `rgb(from ${xe} r g b / 1)`
2420
- }), Pn = nt(Sn, "", Pn, {
2421
- width: `${he}px`,
2422
- height: `${Se}px`,
2423
- "border-radius": `${Pe}px`
2381
+ width: `${ne}px`,
2382
+ height: `${q}px`,
2383
+ "border-radius": `${Dt}px`
2424
2384
  });
2425
- }), Wr(t, bn), ln(ws);
2385
+ }), Hr(t, kn), sn(ki);
2426
2386
  }
2427
- class ea extends pt {
2387
+ class oa extends pt {
2428
2388
  width;
2429
2389
  height;
2430
2390
  zoom;
2431
2391
  angle;
2432
2392
  states;
2433
2393
  component;
2434
- constructor(e, n) {
2435
- super(e, new mn(n, e.lat, e.lng, e.rank)), this.width = e.tooltip.style.dimensions.width + e.tooltip.style.dimensions.margin * 2, this.height = e.tooltip.style.dimensions.height + e.tooltip.style.dimensions.margin * 2, this.zoom = NaN, this.angle = NaN, this.states = [], this.component = dn(Jr, {
2394
+ constructor(e, n, r, i, s, a) {
2395
+ super(n, r, i, s, new hn(e, r, i, s)), this.width = a.dimensions.width + a.dimensions.padding * 2, this.height = a.dimensions.height + a.dimensions.padding * 2, this.zoom = NaN, this.angle = NaN, this.states = [], this.component = fn(Gr, {
2436
2396
  target: this.marker.div,
2437
- props: {
2438
- id: this.id,
2439
- style: e.tooltip.style,
2440
- content: e.tooltip.body
2441
- }
2397
+ props: a
2442
2398
  });
2443
2399
  }
2444
2400
  get zIndex() {
2445
- return Number.isNaN(this.zoom) ? this.rank : Math.round(-this.zoom * ar) + Ds;
2401
+ return Number.isNaN(this.zoom) ? this.rank : Math.round(-this.zoom * cr) + Li;
2446
2402
  }
2447
2403
  }
2448
- class ta extends pt {
2404
+ class la extends pt {
2449
2405
  width;
2450
2406
  height;
2451
- margin;
2407
+ padding;
2452
2408
  angle;
2453
2409
  component;
2454
- constructor(e, n) {
2455
- if (e.popup == null) throw new Error("Failed to create popup");
2456
- super(e, new mn(n, e.lat, e.lng, On)), this.width = e.popup.style.dimensions.width, this.height = e.popup.style.dimensions.height, this.margin = e.popup.style.dimensions.margin, this.angle = NaN, this.shown = !1, this.component = dn(Jr, {
2410
+ constructor(e, n, r, i, s, a) {
2411
+ super(n, r, i, s, new hn(e, r, i, On)), this.width = a.dimensions.width, this.height = a.dimensions.height, this.padding = a.dimensions.padding, this.angle = NaN, this.shown = !1, this.component = fn(Gr, {
2457
2412
  target: this.marker.div,
2458
- props: {
2459
- id: this.id,
2460
- style: e.popup.style,
2461
- content: e.popup.body
2462
- }
2413
+ props: a
2463
2414
  });
2464
2415
  }
2465
2416
  get zIndex() {
2466
2417
  return On;
2467
2418
  }
2468
2419
  }
2469
- class na {
2420
+ class ua {
2470
2421
  id;
2471
2422
  state = void 0;
2472
2423
  pin;
2473
2424
  tooltip;
2474
2425
  popup;
2475
2426
  constructor(e, n) {
2476
- this.id = e.id, this.pin = new Ki(e, n), this.tooltip = new ea(e, n), e.popup != null && (this.popup = new ta(e, n));
2427
+ const r = n.properites.id, i = n.properites.lat, s = n.properites.lng, a = n.properites.rank, o = n.properites.pin, l = n.properites.tooltip, u = n.properites.popup;
2428
+ this.id = r, this.pin = new sa(e, r, i, s, a, o), this.tooltip = new oa(e, r, i, s, a, l), this.popup = u ? new la(e, r, i, s, a, u) : void 0;
2477
2429
  }
2478
2430
  }
2479
- const Yt = 4;
2480
- class ra {
2431
+ const qt = 4;
2432
+ class ca {
2481
2433
  // Elements
2482
2434
  pins = /* @__PURE__ */ new Set();
2483
2435
  // Configuration
2484
2436
  pinMaxWidth = 0;
2485
2437
  pinMaxHeight = 0;
2486
2438
  pinFade = !1;
2487
- pinZoomMax = Yt;
2488
- pinZoomDelta = Yt;
2439
+ pinZoomMax = qt;
2440
+ pinZoomDelta = qt;
2489
2441
  set configuration(e) {
2490
- this.pinFade = e?.pin?.fade ?? !0, this.pinZoomMax = e?.pin?.maxZoom ?? Yt, this.pinZoomDelta = this.pinZoomMax;
2442
+ this.pinFade = e?.pin?.fade ?? !0, this.pinZoomMax = e?.pin?.maxZoom ?? qt, this.pinZoomDelta = this.pinZoomMax;
2491
2443
  }
2492
2444
  insert(e, n) {
2493
2445
  this.update(e, n), this.pins.add(e);
@@ -2506,18 +2458,18 @@ class ra {
2506
2458
  this.pinMaxWidth = e.reduce((n, r) => Math.max(n, r.width), 0), this.pinMaxHeight = e.reduce((n, r) => Math.max(n, r.height), 0), this.pinZoomDelta = Math.max(1, this.pinZoomMax - Math.log10(e.length));
2507
2459
  }
2508
2460
  render(e, n) {
2509
- const r = e.zoom, s = n.mapSize, i = ot.offset(e, s, {
2461
+ const r = e.zoom, i = n.mapSize, s = ot.offset(e, i, {
2510
2462
  top: this.pinMaxHeight,
2511
2463
  bottom: this.pinMaxHeight,
2512
2464
  right: this.pinMaxWidth,
2513
2465
  left: this.pinMaxWidth
2514
2466
  });
2515
2467
  for (const a of this.pins)
2516
- i.contains(a.lat, a.lng) ? Number.isNaN(a.zoom) ? (a.component.invoke().setDisplayed(!0), a.component.invoke().setSuppressed(!0), a.component.invoke().setCollapsed(!1), a.marker.insert()) : (a.component.invoke().setSuppressed(!1), a.shown && r < a.zoom && a.zoom < r + this.pinZoomDelta ? (a.component.invoke().setDisplayed(!0), a.component.invoke().setCollapsed(!1), a.component.invoke().setScale(this.pinFade ? Math.max(0, 1 - (a.zoom - r) * 0.2) : 1), a.marker.insert()) : (a.component.invoke().setCollapsed(!0), a.component.invoke().getCollapsed() && (a.component.invoke().setDisplayed(!1), a.marker.remove()))) : (a.component.invoke().setDisplayed(!1), a.marker.remove());
2468
+ s.contains(a.lat, a.lng) ? Number.isNaN(a.zoom) ? (a.component.invoke().setDisplayed(!0), a.component.invoke().setSuppressed(!0), a.component.invoke().setCollapsed(!1), a.marker.insert()) : (a.component.invoke().setSuppressed(!1), a.shown && r < a.zoom && a.zoom < r + this.pinZoomDelta ? (a.component.invoke().setDisplayed(!0), a.component.invoke().setCollapsed(!1), a.component.invoke().setScale(this.pinFade ? Math.max(0, 1 - (a.zoom - r) * 0.2) : 1), a.marker.insert()) : (a.component.invoke().setCollapsed(!0), a.component.invoke().getCollapsed() && (a.component.invoke().setDisplayed(!1), a.marker.remove()))) : (a.component.invoke().setDisplayed(!1), a.marker.remove());
2517
2469
  }
2518
2470
  }
2519
- var Xr = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330], sa = 270;
2520
- class ia {
2471
+ var Kr = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330], fa = 270;
2472
+ class ha {
2521
2473
  // Elements
2522
2474
  tooltips = /* @__PURE__ */ new Set();
2523
2475
  // Configuration
@@ -2527,7 +2479,7 @@ class ia {
2527
2479
  this.update(e, n), this.tooltips.add(e);
2528
2480
  }
2529
2481
  update(e, n) {
2530
- n ? (e.zoom = n[0], e.states = n[1].map((r) => [r[0], Xr[r[1]]])) : (e.zoom = NaN, e.states = []), e.marker.update(e.zIndex);
2482
+ n ? (e.zoom = n[0], e.states = n[1].map((r) => [r[0], Kr[r[1]]])) : (e.zoom = NaN, e.states = []), e.marker.update(e.zIndex);
2531
2483
  }
2532
2484
  remove(e) {
2533
2485
  e.shown = !0, e.zoom = NaN, e.angle = NaN, e.states = [], e.component.invoke().setAngle(NaN), e.component.invoke().setCollapsed(!0), e.component.invoke().setDisplayed(!1), e.marker.update(e.zIndex), e.marker.remove(), this.tooltips.delete(e);
@@ -2540,14 +2492,14 @@ class ia {
2540
2492
  this.tooltipMaxWidth = e.reduce((n, r) => Math.max(n, r.width), 0), this.tooltipMaxHeight = e.reduce((n, r) => Math.max(n, r.height), 0);
2541
2493
  }
2542
2494
  render(e, n) {
2543
- const r = e.zoom, s = n.mapSize, i = ot.offset(e, s, {
2495
+ const r = e.zoom, i = n.mapSize, s = ot.offset(e, i, {
2544
2496
  top: this.tooltipMaxHeight,
2545
2497
  bottom: this.tooltipMaxHeight,
2546
2498
  right: this.tooltipMaxWidth,
2547
2499
  left: this.tooltipMaxWidth
2548
2500
  });
2549
2501
  for (const a of this.tooltips)
2550
- if (i.contains(a.lat, a.lng))
2502
+ if (s.contains(a.lat, a.lng))
2551
2503
  if (Number.isNaN(a.zoom) == !1 && a.shown && a.zoom <= r) {
2552
2504
  const o = a.states.findLast((l) => l[0] <= r)?.[1];
2553
2505
  if (o == null) throw new Error("Failed to find angle");
@@ -2558,7 +2510,7 @@ class ia {
2558
2510
  a.component.invoke().setDisplayed(!1), a.marker.remove();
2559
2511
  }
2560
2512
  }
2561
- class aa {
2513
+ class pa {
2562
2514
  // Elements
2563
2515
  popups = /* @__PURE__ */ new Set();
2564
2516
  // Configuration
@@ -2577,11 +2529,11 @@ class aa {
2577
2529
  }
2578
2530
  show(e, n) {
2579
2531
  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;
2580
- 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), h = c.x - u.x, f = c.y - u.y, d = r.width + r.margin * 8, m = r.height + r.margin * 8, v = st(r.lat, r.lng, l), M = rn(d, m, e.tooltip.angle), W = v.x + M.x, fe = W + d, Le = v.y + M.y, xe = Le + m, ee = W - u.x, he = c.x - fe, Se = Le - u.y, Pe = c.y - xe;
2581
- let z = 0;
2582
- h < d ? z = (ee - he) / 2 : (ee < 0 && (z = ee), he < 0 && (z = -he));
2583
- let V = 0;
2584
- f < m ? V = (Se - Pe) / 2 : (Se < 0 && (V = Se), Pe < 0 && (V = -Pe)), (z != 0 || V != 0) && n.panBy(z, V);
2532
+ const r = e.popup, i = n.getViewport(), s = i.bounds, a = i.zoom, l = n.getParameters().mapSize * Math.pow(2, a), u = it(s.ne.lat, s.sw.lng, l), c = it(s.sw.lat, s.ne.lng, l), h = c.x - u.x, f = c.y - u.y, d = r.width + r.padding * 8, m = r.height + r.padding * 8, v = it(r.lat, r.lng, l), M = tn(d, m, e.tooltip.angle), $ = v.x + M.x, X = $ + d, Se = v.y + M.y, we = Se + m, ke = $ - u.x, fe = c.x - X, Pe = Se - u.y, J = c.y - we;
2533
+ let ne = 0;
2534
+ h < d ? ne = (ke - fe) / 2 : (ke < 0 && (ne = ke), fe < 0 && (ne = -fe));
2535
+ let q = 0;
2536
+ f < m ? q = (Pe - J) / 2 : (Pe < 0 && (q = Pe), J < 0 && (q = -J)), (ne != 0 || q != 0) && n.panBy(ne, q);
2585
2537
  }
2586
2538
  hide(e) {
2587
2539
  !e.popup || !e.tooltip || !e.pin || (e.pin.shown = !0, e.tooltip.shown = !0, e.popup.shown = !1);
@@ -2591,14 +2543,14 @@ class aa {
2591
2543
  e.shown ? (e.component.invoke().setDisplayed(!0), e.component.invoke().setCollapsed(!1), e.component.invoke().setAngle(e.angle, !0), e.marker.insert()) : (e.component.invoke().setCollapsed(!0), e.component.invoke().getCollapsed() && (e.component.invoke().setDisplayed(!1), e.marker.remove()));
2592
2544
  }
2593
2545
  }
2594
- class oa {
2595
- mapProvider;
2546
+ class da {
2547
+ provider;
2596
2548
  pinManager;
2597
2549
  tooltipManager;
2598
2550
  popupManager;
2599
2551
  elementsStore;
2600
2552
  constructor(e) {
2601
- this.mapProvider = e, this.pinManager = new ra(), this.tooltipManager = new ia(), this.popupManager = new aa(), this.elementsStore = /* @__PURE__ */ new Map();
2553
+ this.provider = e, this.pinManager = new ca(), this.tooltipManager = new ha(), this.popupManager = new pa(), this.elementsStore = /* @__PURE__ */ new Map();
2602
2554
  }
2603
2555
  set configuration(e) {
2604
2556
  this.pinManager.configuration = e, this.popupManager.configuration = e;
@@ -2609,21 +2561,21 @@ class oa {
2609
2561
  }
2610
2562
  removeElements(e) {
2611
2563
  for (const n of e) {
2612
- let r = this.elementsStore.get(n.data.id);
2564
+ let r = this.elementsStore.get(n.properites.id);
2613
2565
  r != null && (this.pinManager.remove(r.pin), this.tooltipManager.remove(r.tooltip), r.popup != null && this.popupManager.remove(r.popup));
2614
2566
  }
2615
2567
  this.pinManager.refresh(), this.tooltipManager.refresh();
2616
2568
  }
2617
2569
  updateElements(e) {
2618
2570
  for (const n of e) {
2619
- let r = this.elementsStore.get(n.data.id);
2571
+ let r = this.elementsStore.get(n.properites.id);
2620
2572
  r != null && (this.pinManager.update(r.pin, n.state), this.tooltipManager.update(r.tooltip, n.state));
2621
2573
  }
2622
2574
  }
2623
2575
  insertElements(e, n) {
2624
2576
  for (const r of e) {
2625
- let s = this.elementsStore.get(r.data.id);
2626
- s == null && (s = new na(r.data, this.mapProvider), s.tooltip.marker.div.addEventListener("click", (i) => n(i, r.data.id)), this.elementsStore.set(r.data.id, s)), this.pinManager.insert(s.pin, r.state), this.tooltipManager.insert(s.tooltip, r.state), s.popup != null && this.popupManager.insert(s.popup);
2577
+ let i = this.elementsStore.get(r.properites.id);
2578
+ i == null && (i = new ua(this.provider, r), i.tooltip.marker.div.addEventListener("click", (s) => n(s, r.properites.id)), this.elementsStore.set(r.properites.id, i)), this.pinManager.insert(i.pin, r.state), this.tooltipManager.insert(i.tooltip, r.state), i.popup != null && this.popupManager.insert(i.popup);
2627
2579
  }
2628
2580
  this.pinManager.refresh(), this.tooltipManager.refresh();
2629
2581
  }
@@ -2635,7 +2587,7 @@ class oa {
2635
2587
  showPopup(e) {
2636
2588
  const n = this.elementsStore.values();
2637
2589
  for (const r of n)
2638
- r.id == e ? this.popupManager.show(r, this.mapProvider) : this.popupManager.hide(r);
2590
+ r.id == e ? this.popupManager.show(r, this.provider) : this.popupManager.hide(r);
2639
2591
  }
2640
2592
  hidePopup(e) {
2641
2593
  const n = this.elementsStore.get(e);
@@ -2648,11 +2600,11 @@ class oa {
2648
2600
  }
2649
2601
  //#endregion
2650
2602
  }
2651
- const Gr = '(function(){"use strict";var i=a=>new Promise(t=>setTimeout(t,a));async function h(a,t){let s=0,o=Math.max(1,t?.retry?.times??1);for(;s<o;)try{return{data:await a(),error:null}}catch(r){if(s++,s==o){if(r instanceof Error)return(!t?.exceptions||t.exceptions.some(e=>r instanceof e)==!1)&&t?.catch?.(r),{data:null,error:r};throw t?.catch?.(r),r}else t?.retry?.delay&&await i(t.retry.delay)}throw Error("Unreachable code")}async function l(a,t,s,o,r){let e=await h(async()=>await fetch(a,{...s,method:"POST",body:t?JSON.stringify(t):void 0,headers:{...s?.headers,"Content-Type":"application/json"}}),{retry:{times:o,delay:r}});if(e.error)throw e.error;let n=e.data;if(!n.ok)throw Error(await n.text());return await n.json()}const f="https://maps.api.arenarium.dev/states",m=3,d=500,u={async fetch(a){const s={headers:{"Cache-Control":self?.location.host.startsWith("localhost")||self?.location.host.startsWith("127.0.0.1")?"no-cache":""}};return await l(f,a,s,m,d)}};class w{methods;constructor(t){this.methods=t}listen(){self.onmessage=this.onmessage.bind(this)}async onmessage(t){const{id:s,method:o,args:r}=t.data;try{const e=this.methods[o];if(typeof e!="function")throw new Error(`Unknown method: ${o}`);const n=await e(...r),c={id:s,result:n};self.postMessage(c)}catch(e){const n=e instanceof Error?e.message:String(e),c={id:s,error:n};self.postMessage(c)}}}new w(u).listen()})();\n', Gn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Gr], { type: "text/javascript;charset=utf-8" });
2652
- function la(t) {
2603
+ const Qr = '(function(){"use strict";var i=a=>new Promise(t=>setTimeout(t,a));async function h(a,t){let s=0,o=Math.max(1,t?.retry?.times??1);for(;s<o;)try{return{data:await a(),error:null}}catch(r){if(s++,s==o){if(r instanceof Error)return(!t?.exceptions||t.exceptions.some(e=>r instanceof e)==!1)&&t?.catch?.(r),{data:null,error:r};throw t?.catch?.(r),r}else t?.retry?.delay&&await i(t.retry.delay)}throw Error("Unreachable code")}async function l(a,t,s,o,r){let e=await h(async()=>await fetch(a,{...s,method:"POST",body:t?JSON.stringify(t):void 0,headers:{...s?.headers,"Content-Type":"application/json"}}),{retry:{times:o,delay:r}});if(e.error)throw e.error;let n=e.data;if(!n.ok)throw Error(await n.text());return await n.json()}const f="https://maps.api.arenarium.dev/states",m=3,d=500,u={async fetch(a){const s={headers:{"Cache-Control":self?.location.host.startsWith("localhost")||self?.location.host.startsWith("127.0.0.1")?"no-cache":""}};return await l(f,a,s,m,d)}};class w{methods;constructor(t){this.methods=t}listen(){self.onmessage=this.onmessage.bind(this)}async onmessage(t){const{id:s,method:o,args:r}=t.data;try{const e=this.methods[o];if(typeof e!="function")throw new Error(`Unknown method: ${o}`);const n=await e(...r),c={id:s,result:n};self.postMessage(c)}catch(e){const n=e instanceof Error?e.message:String(e),c={id:s,error:n};self.postMessage(c)}}}new w(u).listen()})();\n', tr = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Qr], { type: "text/javascript;charset=utf-8" });
2604
+ function ma(t) {
2653
2605
  let e;
2654
2606
  try {
2655
- if (e = Gn && (self.URL || self.webkitURL).createObjectURL(Gn), !e) throw "";
2607
+ if (e = tr && (self.URL || self.webkitURL).createObjectURL(tr), !e) throw "";
2656
2608
  const n = new Worker(e, {
2657
2609
  name: t?.name
2658
2610
  });
@@ -2661,195 +2613,195 @@ function la(t) {
2661
2613
  }), n;
2662
2614
  } catch {
2663
2615
  return new Worker(
2664
- "data:text/javascript;charset=utf-8," + encodeURIComponent(Gr),
2616
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(Qr),
2665
2617
  {
2666
2618
  name: t?.name
2667
2619
  }
2668
2620
  );
2669
2621
  }
2670
2622
  }
2671
- var ua = (t) => new Promise((e) => setTimeout(e, t));
2672
- async function Kr(t, e) {
2623
+ var va = (t) => new Promise((e) => setTimeout(e, t));
2624
+ async function ei(t, e) {
2673
2625
  let n = 0, r = Math.max(1, e?.retry?.times ?? 1);
2674
2626
  for (; n < r; ) try {
2675
2627
  return { data: await t(), error: null };
2676
- } catch (s) {
2628
+ } catch (i) {
2677
2629
  if (n++, n == r) {
2678
- if (s instanceof Error)
2679
- return (!e?.exceptions || e.exceptions.some((i) => s instanceof i) == !1) && e?.catch?.(s), { data: null, error: s };
2680
- throw e?.catch?.(s), s;
2681
- } else e?.retry?.delay && await ua(e.retry.delay);
2630
+ if (i instanceof Error)
2631
+ return (!e?.exceptions || e.exceptions.some((s) => i instanceof s) == !1) && e?.catch?.(i), { data: null, error: i };
2632
+ throw e?.catch?.(i), i;
2633
+ } else e?.retry?.delay && await va(e.retry.delay);
2682
2634
  }
2683
2635
  throw Error("Unreachable code");
2684
2636
  }
2685
- async function ca(t, e, n, r, s) {
2686
- let i = await Kr(async () => await fetch(t, { ...n, method: "POST", body: e ? JSON.stringify(e) : void 0, headers: { ...n?.headers, "Content-Type": "application/json" } }), { retry: { times: r, delay: s } });
2687
- if (i.error) throw i.error;
2688
- let a = i.data;
2637
+ async function ga(t, e, n, r, i) {
2638
+ let s = await ei(async () => await fetch(t, { ...n, method: "POST", body: e ? JSON.stringify(e) : void 0, headers: { ...n?.headers, "Content-Type": "application/json" } }), { retry: { times: r, delay: i } });
2639
+ if (s.error) throw s.error;
2640
+ let a = s.data;
2689
2641
  if (!a.ok) throw Error(await a.text());
2690
2642
  return await a.json();
2691
2643
  }
2692
- async function fa(t, e, n, r, s) {
2693
- let i = await Kr(async () => await fetch(t, { ...n, method: "PUT", body: e ? JSON.stringify(e) : void 0, headers: { ...n?.headers, "Content-Type": "application/json" } }), { retry: { times: r, delay: s } });
2694
- if (i.error) throw i.error;
2695
- let a = i.data;
2644
+ async function wa(t, e, n, r, i) {
2645
+ let s = await ei(async () => await fetch(t, { ...n, method: "PUT", body: e ? JSON.stringify(e) : void 0, headers: { ...n?.headers, "Content-Type": "application/json" } }), { retry: { times: r, delay: i } });
2646
+ if (s.error) throw s.error;
2647
+ let a = s.data;
2696
2648
  if (!a.ok) throw Error(await a.text());
2697
2649
  }
2698
- const Ue = 0xc3a5c85c97cb3127n, ae = 0xb492b66fbe98f273n, We = 0x9ae16a3b2f90404fn, Qr = 0xc949d7c7509e6557n, Z = 0xffffffffffffffffn;
2650
+ const je = 0xc3a5c85c97cb3127n, oe = 0xb492b66fbe98f273n, Be = 0x9ae16a3b2f90404fn, ti = 0xc949d7c7509e6557n, B = 0xffffffffffffffffn;
2699
2651
  function p(t) {
2700
- return t & Z;
2652
+ return t & B;
2701
2653
  }
2702
2654
  function A(t, e) {
2703
- return e === 0 ? t & Z : (t = t & Z, (t >> BigInt(e) | t << BigInt(64 - e)) & Z);
2655
+ return e === 0 ? t & B : (t = t & B, (t >> BigInt(e) | t << BigInt(64 - e)) & B);
2704
2656
  }
2705
- function ha(t, e) {
2706
- return t = t & Z, (t >> BigInt(e) | t << BigInt(64 - e)) & Z;
2657
+ function ka(t, e) {
2658
+ return t = t & B, (t >> BigInt(e) | t << BigInt(64 - e)) & B;
2707
2659
  }
2708
2660
  function ct(t) {
2709
2661
  return p(t ^ t >> 47n);
2710
2662
  }
2711
- function _(t, e = 0) {
2663
+ function b(t, e = 0) {
2712
2664
  let n = 0n;
2713
2665
  for (let r = 0; r < 8; r++)
2714
2666
  e + r < t.length && (n |= BigInt(t[e + r]) << BigInt(r * 8));
2715
- return n & Z;
2667
+ return n & B;
2716
2668
  }
2717
- function Kn(t, e = 0) {
2669
+ function nr(t, e = 0) {
2718
2670
  let n = 0n;
2719
2671
  for (let r = 0; r < 4; r++)
2720
2672
  e + r < t.length && (n |= BigInt(t[e + r]) << BigInt(r * 8));
2721
2673
  return n & 0xffffffffn;
2722
2674
  }
2723
- function pa(t) {
2675
+ function ya(t) {
2724
2676
  const e = 0x9ddfea08eb382d69n;
2725
- let n = (t.first ^ t.second) * e & Z;
2726
- n ^= n >> 47n, n = n & Z;
2727
- let r = (t.second ^ n) * e & Z;
2728
- return r ^= r >> 47n, r = r * e & Z, r;
2677
+ let n = (t.first ^ t.second) * e & B;
2678
+ n ^= n >> 47n, n = n & B;
2679
+ let r = (t.second ^ n) * e & B;
2680
+ return r ^= r >> 47n, r = r * e & B, r;
2729
2681
  }
2730
- function Be(t, e) {
2731
- return pa({ first: t, second: e });
2682
+ function We(t, e) {
2683
+ return ya({ first: t, second: e });
2732
2684
  }
2733
- function da(t) {
2685
+ function _a(t) {
2734
2686
  const e = t.length;
2735
2687
  if (e > 8) {
2736
- const n = _(t), r = _(t, e - 8);
2737
- return (Be(n, ha(r + BigInt(e) & Z, e)) ^ r) & Z;
2688
+ const n = b(t), r = b(t, e - 8);
2689
+ return (We(n, ka(r + BigInt(e) & B, e)) ^ r) & B;
2738
2690
  }
2739
2691
  if (e >= 4) {
2740
- const n = Kn(t);
2741
- return Be(BigInt(e) + (n << 3n) & Z, Kn(t, e - 4));
2692
+ const n = nr(t);
2693
+ return We(BigInt(e) + (n << 3n) & B, nr(t, e - 4));
2742
2694
  }
2743
2695
  if (e > 0) {
2744
- const n = BigInt(t[0]), r = BigInt(t[e >> 1]), s = BigInt(t[e - 1]), i = p(n + (r << 8n)), a = p(BigInt(e) + (s << 2n));
2745
- return p(ct(p(i * We) ^ p(a * Qr)) * We);
2696
+ const n = BigInt(t[0]), r = BigInt(t[e >> 1]), i = BigInt(t[e - 1]), s = p(n + (r << 8n)), a = p(BigInt(e) + (i << 2n));
2697
+ return p(ct(p(s * Be) ^ p(a * ti)) * Be);
2746
2698
  }
2747
- return We;
2699
+ return Be;
2748
2700
  }
2749
- function ma(t) {
2750
- const e = t.length, n = p(_(t) * ae), r = _(t, 8), s = p(_(t, e - 8) * We), i = p(_(t, e - 16) * Ue);
2751
- return Be(p(A(p(n - r), 43) + A(s, 30) + i), p(n + A(r ^ Qr, 20) - s + BigInt(e)));
2752
- }
2753
- function va(t, e, n, r, s, i) {
2754
- s = p(s + t), i = A(p(i + s + r), 21);
2755
- const a = s;
2756
- return s = p(s + e), s = p(s + n), i = p(i + A(s, 44)), { first: p(s + r), second: p(i + a) };
2757
- }
2758
- function bt(t, e, n, r) {
2759
- return va(_(t, e), _(t, e + 8), _(t, e + 16), _(t, e + 24), n, r);
2760
- }
2761
- function ga(t) {
2762
- const e = t.length, n = _(t, 24);
2763
- let r = p(_(t) + p((BigInt(e) + _(t, e - 16)) * Ue)), s = A(p(r + n), 52), i = A(r, 37);
2764
- r = p(r + _(t, 8)), i = p(i + A(r, 7)), r = p(r + _(t, 16));
2765
- const a = p(r + n), o = p(s + A(r, 31) + i);
2766
- r = p(_(t, 16) + _(t, e - 32));
2767
- const l = _(t, e - 8);
2768
- s = A(p(r + l), 52), i = A(r, 37), r = p(r + _(t, e - 24)), i = p(i + A(r, 7)), r = p(r + _(t, e - 16));
2769
- const u = p(r + l), c = p(s + A(r, 31) + i), h = ct(p(p(a + c) * We + p(u + o) * Ue));
2770
- return p(ct(p(h * Ue + o)) * We);
2771
- }
2772
- function wa(t) {
2701
+ function ba(t) {
2702
+ const e = t.length, n = p(b(t) * oe), r = b(t, 8), i = p(b(t, e - 8) * Be), s = p(b(t, e - 16) * je);
2703
+ return We(p(A(p(n - r), 43) + A(i, 30) + s), p(n + A(r ^ ti, 20) - i + BigInt(e)));
2704
+ }
2705
+ function Ma(t, e, n, r, i, s) {
2706
+ i = p(i + t), s = A(p(s + i + r), 21);
2707
+ const a = i;
2708
+ return i = p(i + e), i = p(i + n), s = p(s + A(i, 44)), { first: p(i + r), second: p(s + a) };
2709
+ }
2710
+ function _t(t, e, n, r) {
2711
+ return Ma(b(t, e), b(t, e + 8), b(t, e + 16), b(t, e + 24), n, r);
2712
+ }
2713
+ function Ea(t) {
2714
+ const e = t.length, n = b(t, 24);
2715
+ let r = p(b(t) + p((BigInt(e) + b(t, e - 16)) * je)), i = A(p(r + n), 52), s = A(r, 37);
2716
+ r = p(r + b(t, 8)), s = p(s + A(r, 7)), r = p(r + b(t, 16));
2717
+ const a = p(r + n), o = p(i + A(r, 31) + s);
2718
+ r = p(b(t, 16) + b(t, e - 32));
2719
+ const l = b(t, e - 8);
2720
+ i = A(p(r + l), 52), s = A(r, 37), r = p(r + b(t, e - 24)), s = p(s + A(r, 7)), r = p(r + b(t, e - 16));
2721
+ const u = p(r + l), c = p(i + A(r, 31) + s), h = ct(p(p(a + c) * Be + p(u + o) * je));
2722
+ return p(ct(p(h * je + o)) * Be);
2723
+ }
2724
+ function xa(t) {
2773
2725
  let e;
2774
2726
  typeof t == "string" ? e = new TextEncoder().encode(t) : e = t;
2775
2727
  const n = e.length;
2776
2728
  if (n <= 32)
2777
- return n <= 16 ? da(e) : ma(e);
2729
+ return n <= 16 ? _a(e) : ba(e);
2778
2730
  if (n <= 64)
2779
- return ga(e);
2780
- let r = _(e), s = p(_(e, n - 16) ^ ae), i = p(_(e, n - 56) ^ Ue), a = bt(e, n - 64, BigInt(n), s), o = bt(e, n - 32, p(BigInt(n) * ae), Ue);
2781
- i = p(i + ct(a.second) * ae), r = p(A(p(i + r), 39) * ae), s = p(A(s, 33) * ae);
2731
+ return Ea(e);
2732
+ let r = b(e), i = p(b(e, n - 16) ^ oe), s = p(b(e, n - 56) ^ je), a = _t(e, n - 64, BigInt(n), i), o = _t(e, n - 32, p(BigInt(n) * oe), je);
2733
+ s = p(s + ct(a.second) * oe), r = p(A(p(s + r), 39) * oe), i = p(A(i, 33) * oe);
2782
2734
  let l = n - 1 & -64, u = 0;
2783
2735
  for (; l > 0; )
2784
- r = p(A(p(r + s + a.first + _(e, u + 16)), 37) * ae), s = p(A(p(s + a.second + _(e, u + 48)), 42) * ae), r ^= o.second, s ^= a.first, i = A(i ^ o.first, 33), a = bt(e, u, p(a.second * ae), p(r + o.first)), o = bt(e, u + 32, p(i + o.second), s), [i, r] = [r, i], u += 64, l -= 64;
2785
- return Be(Be(a.first, o.first) + p(ct(s) * ae) + i, Be(a.second, o.second) + r);
2736
+ r = p(A(p(r + i + a.first + b(e, u + 16)), 37) * oe), i = p(A(p(i + a.second + b(e, u + 48)), 42) * oe), r ^= o.second, i ^= a.first, s = A(s ^ o.first, 33), a = _t(e, u, p(a.second * oe), p(r + o.first)), o = _t(e, u + 32, p(s + o.second), i), [s, r] = [r, s], u += 64, l -= 64;
2737
+ return We(We(a.first, o.first) + p(ct(i) * oe) + s, We(a.second, o.second) + r);
2786
2738
  }
2787
- function ya(t) {
2788
- return wa(JSON.stringify(t)).toString();
2739
+ function Sa(t) {
2740
+ return xa(JSON.stringify(t)).toString();
2789
2741
  }
2790
- let Jt;
2742
+ let Yt;
2791
2743
  // @__NO_SIDE_EFFECTS__
2792
- function es(t) {
2744
+ function ni(t) {
2793
2745
  return {
2794
- lang: Jt?.lang,
2746
+ lang: Yt?.lang,
2795
2747
  message: t?.message,
2796
- abortEarly: Jt?.abortEarly,
2797
- abortPipeEarly: Jt?.abortPipeEarly
2748
+ abortEarly: Yt?.abortEarly,
2749
+ abortPipeEarly: Yt?.abortPipeEarly
2798
2750
  };
2799
2751
  }
2800
- let ka;
2752
+ let Pa;
2801
2753
  // @__NO_SIDE_EFFECTS__
2802
- function ba(t) {
2803
- return ka?.get(t);
2754
+ function Ta(t) {
2755
+ return Pa?.get(t);
2804
2756
  }
2805
- let _a;
2757
+ let Ia;
2806
2758
  // @__NO_SIDE_EFFECTS__
2807
- function Ma(t) {
2808
- return _a?.get(t);
2759
+ function Aa(t) {
2760
+ return Ia?.get(t);
2809
2761
  }
2810
- let Ea;
2762
+ let Na;
2811
2763
  // @__NO_SIDE_EFFECTS__
2812
- function xa(t, e) {
2813
- return Ea?.get(t)?.get(e);
2764
+ function Ca(t, e) {
2765
+ return Na?.get(t)?.get(e);
2814
2766
  }
2815
2767
  // @__NO_SIDE_EFFECTS__
2816
- function Xe(t) {
2768
+ function Ge(t) {
2817
2769
  const e = typeof t;
2818
2770
  return e === "string" ? `"${t}"` : e === "number" || e === "bigint" || e === "boolean" ? `${t}` : e === "object" || e === "function" ? (t && Object.getPrototypeOf(t)?.constructor?.name) ?? "null" : e;
2819
2771
  }
2820
- function I(t, e, n, r, s) {
2821
- const i = s && "input" in s ? s.input : n.value, a = s?.expected ?? t.expects ?? null, o = s?.received ?? /* @__PURE__ */ Xe(i), l = {
2772
+ function N(t, e, n, r, i) {
2773
+ const s = i && "input" in i ? i.input : n.value, a = i?.expected ?? t.expects ?? null, o = i?.received ?? /* @__PURE__ */ Ge(s), l = {
2822
2774
  kind: t.kind,
2823
2775
  type: t.type,
2824
- input: i,
2776
+ input: s,
2825
2777
  expected: a,
2826
2778
  received: o,
2827
2779
  message: `Invalid ${e}: ${a ? `Expected ${a} but r` : "R"}eceived ${o}`,
2828
2780
  requirement: t.requirement,
2829
- path: s?.path,
2830
- issues: s?.issues,
2781
+ path: i?.path,
2782
+ issues: i?.issues,
2831
2783
  lang: r.lang,
2832
2784
  abortEarly: r.abortEarly,
2833
2785
  abortPipeEarly: r.abortPipeEarly
2834
- }, u = t.kind === "schema", c = s?.message ?? t.message ?? /* @__PURE__ */ xa(t.reference, l.lang) ?? (u ? /* @__PURE__ */ Ma(l.lang) : null) ?? r.message ?? /* @__PURE__ */ ba(l.lang);
2786
+ }, u = t.kind === "schema", c = i?.message ?? t.message ?? /* @__PURE__ */ Ca(t.reference, l.lang) ?? (u ? /* @__PURE__ */ Aa(l.lang) : null) ?? r.message ?? /* @__PURE__ */ Ta(l.lang);
2835
2787
  c !== void 0 && (l.message = typeof c == "function" ? c(l) : c), u && (n.typed = !1), n.issues ? n.issues.push(l) : n.issues = [l];
2836
2788
  }
2837
2789
  // @__NO_SIDE_EFFECTS__
2838
- function U(t) {
2790
+ function Z(t) {
2839
2791
  return {
2840
2792
  version: 1,
2841
2793
  vendor: "valibot",
2842
2794
  validate(e) {
2843
- return t["~run"]({ value: e }, /* @__PURE__ */ es());
2795
+ return t["~run"]({ value: e }, /* @__PURE__ */ ni());
2844
2796
  }
2845
2797
  };
2846
2798
  }
2847
2799
  // @__NO_SIDE_EFFECTS__
2848
- function Sa(t, e) {
2800
+ function Ra(t, e) {
2849
2801
  const n = [...new Set(t)];
2850
2802
  return n.length > 1 ? `(${n.join(` ${e} `)})` : n[0] ?? "never";
2851
2803
  }
2852
- var Dt = class extends Error {
2804
+ var pn = class extends Error {
2853
2805
  /**
2854
2806
  * Creates a Valibot error with useful information.
2855
2807
  *
@@ -2860,62 +2812,50 @@ var Dt = class extends Error {
2860
2812
  }
2861
2813
  };
2862
2814
  // @__NO_SIDE_EFFECTS__
2863
- function L(t) {
2815
+ function O(t) {
2864
2816
  return {
2865
2817
  kind: "transformation",
2866
2818
  type: "args",
2867
- reference: L,
2819
+ reference: O,
2868
2820
  async: !1,
2869
2821
  schema: t,
2870
2822
  "~run"(e, n) {
2871
2823
  const r = e.value;
2872
- return e.value = (...s) => {
2873
- const i = this.schema["~run"]({ value: s }, n);
2874
- if (i.issues) throw new Dt(i.issues);
2875
- return r(...i.value);
2824
+ return e.value = (...i) => {
2825
+ const s = this.schema["~run"]({ value: i }, n);
2826
+ if (s.issues) throw new pn(s.issues);
2827
+ return r(...s.value);
2876
2828
  }, e;
2877
2829
  }
2878
2830
  };
2879
2831
  }
2880
2832
  // @__NO_SIDE_EFFECTS__
2881
- function ts() {
2882
- return {
2883
- kind: "transformation",
2884
- type: "await",
2885
- reference: ts,
2886
- async: !0,
2887
- async "~run"(t) {
2888
- return t.value = await t.value, t;
2889
- }
2890
- };
2891
- }
2892
- // @__NO_SIDE_EFFECTS__
2893
- function ns(t, e) {
2833
+ function ri(t, e) {
2894
2834
  return {
2895
2835
  kind: "validation",
2896
2836
  type: "check",
2897
- reference: ns,
2837
+ reference: ri,
2898
2838
  async: !1,
2899
2839
  expects: null,
2900
2840
  requirement: t,
2901
2841
  message: e,
2902
2842
  "~run"(n, r) {
2903
- return n.typed && !this.requirement(n.value) && I(this, "input", n, r), n;
2843
+ return n.typed && !this.requirement(n.value) && N(this, "input", n, r), n;
2904
2844
  }
2905
2845
  };
2906
2846
  }
2907
2847
  // @__NO_SIDE_EFFECTS__
2908
- function rs(t, e) {
2848
+ function ii(t, e) {
2909
2849
  return {
2910
2850
  kind: "validation",
2911
2851
  type: "length",
2912
- reference: rs,
2852
+ reference: ii,
2913
2853
  async: !1,
2914
2854
  expects: `${t}`,
2915
2855
  requirement: t,
2916
2856
  message: e,
2917
2857
  "~run"(n, r) {
2918
- return n.typed && n.value.length !== this.requirement && I(this, "length", n, r, { received: `${n.value.length}` }), n;
2858
+ return n.typed && n.value.length !== this.requirement && N(this, "length", n, r, { received: `${n.value.length}` }), n;
2919
2859
  }
2920
2860
  };
2921
2861
  }
@@ -2926,113 +2866,95 @@ function ft(t, e) {
2926
2866
  type: "max_value",
2927
2867
  reference: ft,
2928
2868
  async: !1,
2929
- expects: `<=${t instanceof Date ? t.toJSON() : /* @__PURE__ */ Xe(t)}`,
2869
+ expects: `<=${t instanceof Date ? t.toJSON() : /* @__PURE__ */ Ge(t)}`,
2930
2870
  requirement: t,
2931
2871
  message: e,
2932
2872
  "~run"(n, r) {
2933
- return n.typed && !(n.value <= this.requirement) && I(this, "value", n, r, { received: n.value instanceof Date ? n.value.toJSON() : /* @__PURE__ */ Xe(n.value) }), n;
2873
+ return n.typed && !(n.value <= this.requirement) && N(this, "value", n, r, { received: n.value instanceof Date ? n.value.toJSON() : /* @__PURE__ */ Ge(n.value) }), n;
2934
2874
  }
2935
2875
  };
2936
2876
  }
2937
2877
  // @__NO_SIDE_EFFECTS__
2938
- function vn(t, e) {
2878
+ function dn(t, e) {
2939
2879
  return {
2940
2880
  kind: "validation",
2941
2881
  type: "min_length",
2942
- reference: vn,
2882
+ reference: dn,
2943
2883
  async: !1,
2944
2884
  expects: `>=${t}`,
2945
2885
  requirement: t,
2946
2886
  message: e,
2947
2887
  "~run"(n, r) {
2948
- return n.typed && n.value.length < this.requirement && I(this, "length", n, r, { received: `${n.value.length}` }), n;
2888
+ return n.typed && n.value.length < this.requirement && N(this, "length", n, r, { received: `${n.value.length}` }), n;
2949
2889
  }
2950
2890
  };
2951
2891
  }
2952
2892
  // @__NO_SIDE_EFFECTS__
2953
- function C(t, e) {
2893
+ function H(t, e) {
2954
2894
  return {
2955
2895
  kind: "validation",
2956
2896
  type: "min_value",
2957
- reference: C,
2897
+ reference: H,
2958
2898
  async: !1,
2959
- expects: `>=${t instanceof Date ? t.toJSON() : /* @__PURE__ */ Xe(t)}`,
2899
+ expects: `>=${t instanceof Date ? t.toJSON() : /* @__PURE__ */ Ge(t)}`,
2960
2900
  requirement: t,
2961
2901
  message: e,
2962
2902
  "~run"(n, r) {
2963
- return n.typed && !(n.value >= this.requirement) && I(this, "value", n, r, { received: n.value instanceof Date ? n.value.toJSON() : /* @__PURE__ */ Xe(n.value) }), n;
2903
+ return n.typed && !(n.value >= this.requirement) && N(this, "value", n, r, { received: n.value instanceof Date ? n.value.toJSON() : /* @__PURE__ */ Ge(n.value) }), n;
2964
2904
  }
2965
2905
  };
2966
2906
  }
2967
2907
  // @__NO_SIDE_EFFECTS__
2968
- function j(t) {
2908
+ function F(t) {
2969
2909
  return {
2970
2910
  kind: "transformation",
2971
2911
  type: "returns",
2972
- reference: j,
2912
+ reference: F,
2973
2913
  async: !1,
2974
2914
  schema: t,
2975
2915
  "~run"(e, n) {
2976
2916
  const r = e.value;
2977
- return e.value = (...s) => {
2978
- const i = this.schema["~run"]({ value: r(...s) }, n);
2979
- if (i.issues) throw new Dt(i.issues);
2980
- return i.value;
2917
+ return e.value = (...i) => {
2918
+ const s = this.schema["~run"]({ value: r(...i) }, n);
2919
+ if (s.issues) throw new pn(s.issues);
2920
+ return s.value;
2981
2921
  }, e;
2982
2922
  }
2983
2923
  };
2984
2924
  }
2985
2925
  // @__NO_SIDE_EFFECTS__
2986
- function ss(t) {
2987
- return {
2988
- kind: "transformation",
2989
- type: "returns",
2990
- reference: ss,
2991
- async: !1,
2992
- schema: t,
2993
- "~run"(e, n) {
2994
- const r = e.value;
2995
- return e.value = async (...s) => {
2996
- const i = await this.schema["~run"]({ value: await r(...s) }, n);
2997
- if (i.issues) throw new Dt(i.issues);
2998
- return i.value;
2999
- }, e;
3000
- }
3001
- };
3002
- }
3003
- // @__NO_SIDE_EFFECTS__
3004
- function Pa(t, e, n) {
2926
+ function Da(t, e, n) {
3005
2927
  return typeof t.fallback == "function" ? t.fallback(e, n) : t.fallback;
3006
2928
  }
3007
2929
  // @__NO_SIDE_EFFECTS__
3008
- function is(t, e, n) {
2930
+ function si(t, e, n) {
3009
2931
  return typeof t.default == "function" ? t.default(e, n) : t.default;
3010
2932
  }
3011
2933
  // @__NO_SIDE_EFFECTS__
3012
- function as(t, e) {
2934
+ function ai(t, e) {
3013
2935
  return {
3014
2936
  kind: "schema",
3015
2937
  type: "array",
3016
- reference: as,
2938
+ reference: ai,
3017
2939
  expects: "Array",
3018
2940
  async: !1,
3019
2941
  item: t,
3020
2942
  message: e,
3021
2943
  get "~standard"() {
3022
- return /* @__PURE__ */ U(this);
2944
+ return /* @__PURE__ */ Z(this);
3023
2945
  },
3024
2946
  "~run"(n, r) {
3025
- const s = n.value;
3026
- if (Array.isArray(s)) {
2947
+ const i = n.value;
2948
+ if (Array.isArray(i)) {
3027
2949
  n.typed = !0, n.value = [];
3028
- for (let i = 0; i < s.length; i++) {
3029
- const a = s[i], o = this.item["~run"]({ value: a }, r);
2950
+ for (let s = 0; s < i.length; s++) {
2951
+ const a = i[s], o = this.item["~run"]({ value: a }, r);
3030
2952
  if (o.issues) {
3031
2953
  const l = {
3032
2954
  type: "array",
3033
2955
  origin: "value",
3034
- input: s,
3035
- key: i,
2956
+ input: i,
2957
+ key: s,
3036
2958
  value: a
3037
2959
  };
3038
2960
  for (const u of o.issues)
@@ -3044,60 +2966,60 @@ function as(t, e) {
3044
2966
  }
3045
2967
  o.typed || (n.typed = !1), n.value.push(o.value);
3046
2968
  }
3047
- } else I(this, "type", n, r);
2969
+ } else N(this, "type", n, r);
3048
2970
  return n;
3049
2971
  }
3050
2972
  };
3051
2973
  }
3052
2974
  // @__NO_SIDE_EFFECTS__
3053
- function os(t) {
2975
+ function oi(t) {
3054
2976
  return {
3055
2977
  kind: "schema",
3056
2978
  type: "boolean",
3057
- reference: os,
2979
+ reference: oi,
3058
2980
  expects: "boolean",
3059
2981
  async: !1,
3060
2982
  message: t,
3061
2983
  get "~standard"() {
3062
- return /* @__PURE__ */ U(this);
2984
+ return /* @__PURE__ */ Z(this);
3063
2985
  },
3064
2986
  "~run"(e, n) {
3065
- return typeof e.value == "boolean" ? e.typed = !0 : I(this, "type", e, n), e;
2987
+ return typeof e.value == "boolean" ? e.typed = !0 : N(this, "type", e, n), e;
3066
2988
  }
3067
2989
  };
3068
2990
  }
3069
2991
  // @__NO_SIDE_EFFECTS__
3070
- function ls(t, e) {
2992
+ function li(t, e) {
3071
2993
  return {
3072
2994
  kind: "schema",
3073
2995
  type: "custom",
3074
- reference: ls,
2996
+ reference: li,
3075
2997
  expects: "unknown",
3076
2998
  async: !1,
3077
2999
  check: t,
3078
3000
  message: e,
3079
3001
  get "~standard"() {
3080
- return /* @__PURE__ */ U(this);
3002
+ return /* @__PURE__ */ Z(this);
3081
3003
  },
3082
3004
  "~run"(n, r) {
3083
- return this.check(n.value) ? n.typed = !0 : I(this, "type", n, r), n;
3005
+ return this.check(n.value) ? n.typed = !0 : N(this, "type", n, r), n;
3084
3006
  }
3085
3007
  };
3086
3008
  }
3087
3009
  // @__NO_SIDE_EFFECTS__
3088
- function T(t) {
3010
+ function I(t) {
3089
3011
  return {
3090
3012
  kind: "schema",
3091
3013
  type: "function",
3092
- reference: T,
3014
+ reference: I,
3093
3015
  expects: "Function",
3094
3016
  async: !1,
3095
3017
  message: t,
3096
3018
  get "~standard"() {
3097
- return /* @__PURE__ */ U(this);
3019
+ return /* @__PURE__ */ Z(this);
3098
3020
  },
3099
3021
  "~run"(e, n) {
3100
- return typeof e.value == "function" ? e.typed = !0 : I(this, "type", e, n), e;
3022
+ return typeof e.value == "function" ? e.typed = !0 : N(this, "type", e, n), e;
3101
3023
  }
3102
3024
  };
3103
3025
  }
@@ -3107,62 +3029,62 @@ function Re(t, e) {
3107
3029
  kind: "schema",
3108
3030
  type: "literal",
3109
3031
  reference: Re,
3110
- expects: /* @__PURE__ */ Xe(t),
3032
+ expects: /* @__PURE__ */ Ge(t),
3111
3033
  async: !1,
3112
3034
  literal: t,
3113
3035
  message: e,
3114
3036
  get "~standard"() {
3115
- return /* @__PURE__ */ U(this);
3037
+ return /* @__PURE__ */ Z(this);
3116
3038
  },
3117
3039
  "~run"(n, r) {
3118
- return n.value === this.literal ? n.typed = !0 : I(this, "type", n, r), n;
3040
+ return n.value === this.literal ? n.typed = !0 : N(this, "type", n, r), n;
3119
3041
  }
3120
3042
  };
3121
3043
  }
3122
3044
  // @__NO_SIDE_EFFECTS__
3123
- function x(t) {
3045
+ function P(t) {
3124
3046
  return {
3125
3047
  kind: "schema",
3126
3048
  type: "number",
3127
- reference: x,
3049
+ reference: P,
3128
3050
  expects: "number",
3129
3051
  async: !1,
3130
3052
  message: t,
3131
3053
  get "~standard"() {
3132
- return /* @__PURE__ */ U(this);
3054
+ return /* @__PURE__ */ Z(this);
3133
3055
  },
3134
3056
  "~run"(e, n) {
3135
- return typeof e.value == "number" && !isNaN(e.value) ? e.typed = !0 : I(this, "type", e, n), e;
3057
+ return typeof e.value == "number" && !isNaN(e.value) ? e.typed = !0 : N(this, "type", e, n), e;
3136
3058
  }
3137
3059
  };
3138
3060
  }
3139
3061
  // @__NO_SIDE_EFFECTS__
3140
- function R(t, e) {
3062
+ function W(t, e) {
3141
3063
  return {
3142
3064
  kind: "schema",
3143
3065
  type: "object",
3144
- reference: R,
3066
+ reference: W,
3145
3067
  expects: "Object",
3146
3068
  async: !1,
3147
3069
  entries: t,
3148
3070
  message: e,
3149
3071
  get "~standard"() {
3150
- return /* @__PURE__ */ U(this);
3072
+ return /* @__PURE__ */ Z(this);
3151
3073
  },
3152
3074
  "~run"(n, r) {
3153
- const s = n.value;
3154
- if (s && typeof s == "object") {
3075
+ const i = n.value;
3076
+ if (i && typeof i == "object") {
3155
3077
  n.typed = !0, n.value = {};
3156
- for (const i in this.entries) {
3157
- const a = this.entries[i];
3158
- if (i in s || (a.type === "exact_optional" || a.type === "optional" || a.type === "nullish") && a.default !== void 0) {
3159
- const o = i in s ? s[i] : /* @__PURE__ */ is(a), l = a["~run"]({ value: o }, r);
3078
+ for (const s in this.entries) {
3079
+ const a = this.entries[s];
3080
+ if (s in i || (a.type === "exact_optional" || a.type === "optional" || a.type === "nullish") && a.default !== void 0) {
3081
+ const o = s in i ? i[s] : /* @__PURE__ */ si(a), l = a["~run"]({ value: o }, r);
3160
3082
  if (l.issues) {
3161
3083
  const u = {
3162
3084
  type: "object",
3163
3085
  origin: "value",
3164
- input: s,
3165
- key: i,
3086
+ input: i,
3087
+ key: s,
3166
3088
  value: o
3167
3089
  };
3168
3090
  for (const c of l.issues)
@@ -3172,103 +3094,86 @@ function R(t, e) {
3172
3094
  break;
3173
3095
  }
3174
3096
  }
3175
- l.typed || (n.typed = !1), n.value[i] = l.value;
3176
- } else if (a.fallback !== void 0) n.value[i] = /* @__PURE__ */ Pa(a);
3177
- else if (a.type !== "exact_optional" && a.type !== "optional" && a.type !== "nullish" && (I(this, "key", n, r, {
3097
+ l.typed || (n.typed = !1), n.value[s] = l.value;
3098
+ } else if (a.fallback !== void 0) n.value[s] = /* @__PURE__ */ Da(a);
3099
+ else if (a.type !== "exact_optional" && a.type !== "optional" && a.type !== "nullish" && (N(this, "key", n, r, {
3178
3100
  input: void 0,
3179
- expected: `"${i}"`,
3101
+ expected: `"${s}"`,
3180
3102
  path: [{
3181
3103
  type: "object",
3182
3104
  origin: "key",
3183
- input: s,
3184
- key: i,
3185
- value: s[i]
3105
+ input: i,
3106
+ key: s,
3107
+ value: i[s]
3186
3108
  }]
3187
3109
  }), r.abortEarly))
3188
3110
  break;
3189
3111
  }
3190
- } else I(this, "type", n, r);
3112
+ } else N(this, "type", n, r);
3191
3113
  return n;
3192
3114
  }
3193
3115
  };
3194
3116
  }
3195
3117
  // @__NO_SIDE_EFFECTS__
3196
- function re(t, e) {
3118
+ function T(t, e) {
3197
3119
  return {
3198
3120
  kind: "schema",
3199
3121
  type: "optional",
3200
- reference: re,
3122
+ reference: T,
3201
3123
  expects: `(${t.expects} | undefined)`,
3202
3124
  async: !1,
3203
3125
  wrapped: t,
3204
3126
  default: e,
3205
3127
  get "~standard"() {
3206
- return /* @__PURE__ */ U(this);
3128
+ return /* @__PURE__ */ Z(this);
3207
3129
  },
3208
3130
  "~run"(n, r) {
3209
- return n.value === void 0 && (this.default !== void 0 && (n.value = /* @__PURE__ */ is(this, n, r)), n.value === void 0) ? (n.typed = !0, n) : this.wrapped["~run"](n, r);
3131
+ return n.value === void 0 && (this.default !== void 0 && (n.value = /* @__PURE__ */ si(this, n, r)), n.value === void 0) ? (n.typed = !0, n) : this.wrapped["~run"](n, r);
3210
3132
  }
3211
3133
  };
3212
3134
  }
3213
3135
  // @__NO_SIDE_EFFECTS__
3214
- function us(t) {
3215
- return {
3216
- kind: "schema",
3217
- type: "promise",
3218
- reference: us,
3219
- expects: "Promise",
3220
- async: !1,
3221
- message: t,
3222
- get "~standard"() {
3223
- return /* @__PURE__ */ U(this);
3224
- },
3225
- "~run"(e, n) {
3226
- return e.value instanceof Promise ? e.typed = !0 : I(this, "type", e, n), e;
3227
- }
3228
- };
3229
- }
3230
- // @__NO_SIDE_EFFECTS__
3231
- function ue(t) {
3136
+ function me(t) {
3232
3137
  return {
3233
3138
  kind: "schema",
3234
3139
  type: "string",
3235
- reference: ue,
3140
+ reference: me,
3236
3141
  expects: "string",
3237
3142
  async: !1,
3238
3143
  message: t,
3239
3144
  get "~standard"() {
3240
- return /* @__PURE__ */ U(this);
3145
+ return /* @__PURE__ */ Z(this);
3241
3146
  },
3242
3147
  "~run"(e, n) {
3243
- return typeof e.value == "string" ? e.typed = !0 : I(this, "type", e, n), e;
3148
+ return typeof e.value == "string" ? e.typed = !0 : N(this, "type", e, n), e;
3244
3149
  }
3245
3150
  };
3246
3151
  }
3247
3152
  // @__NO_SIDE_EFFECTS__
3248
- function $(t, e) {
3153
+ function z(t, e) {
3249
3154
  return {
3250
3155
  kind: "schema",
3251
3156
  type: "tuple",
3252
- reference: $,
3157
+ reference: z,
3253
3158
  expects: "Array",
3254
3159
  async: !1,
3255
3160
  items: t,
3256
3161
  message: e,
3257
3162
  get "~standard"() {
3258
- return /* @__PURE__ */ U(this);
3163
+ return /* @__PURE__ */ Z(this);
3259
3164
  },
3260
3165
  "~run"(n, r) {
3261
- const s = n.value;
3262
- if (Array.isArray(s)) {
3166
+ const i = n.value;
3167
+ if (Array.isArray(i)) {
3263
3168
  n.typed = !0, n.value = [];
3264
- for (let i = 0; i < this.items.length; i++) {
3265
- const a = s[i], o = this.items[i]["~run"]({ value: a }, r);
3169
+ for (let s = 0; s < this.items.length; s++) {
3170
+ const a = i[s], o = this.items[s]["~run"]({ value: a }, r);
3266
3171
  if (o.issues) {
3267
3172
  const l = {
3268
3173
  type: "array",
3269
3174
  origin: "value",
3270
- input: s,
3271
- key: i,
3175
+ input: i,
3176
+ key: s,
3272
3177
  value: a
3273
3178
  };
3274
3179
  for (const u of o.issues)
@@ -3280,48 +3185,48 @@ function $(t, e) {
3280
3185
  }
3281
3186
  o.typed || (n.typed = !1), n.value.push(o.value);
3282
3187
  }
3283
- } else I(this, "type", n, r);
3188
+ } else N(this, "type", n, r);
3284
3189
  return n;
3285
3190
  }
3286
3191
  };
3287
3192
  }
3288
3193
  // @__NO_SIDE_EFFECTS__
3289
- function Qn(t) {
3194
+ function rr(t) {
3290
3195
  let e;
3291
3196
  if (t) for (const n of t) e ? e.push(...n.issues) : e = n.issues;
3292
3197
  return e;
3293
3198
  }
3294
3199
  // @__NO_SIDE_EFFECTS__
3295
- function gn(t, e) {
3200
+ function mn(t, e) {
3296
3201
  return {
3297
3202
  kind: "schema",
3298
3203
  type: "union",
3299
- reference: gn,
3300
- expects: /* @__PURE__ */ Sa(t.map((n) => n.expects), "|"),
3204
+ reference: mn,
3205
+ expects: /* @__PURE__ */ Ra(t.map((n) => n.expects), "|"),
3301
3206
  async: !1,
3302
3207
  options: t,
3303
3208
  message: e,
3304
3209
  get "~standard"() {
3305
- return /* @__PURE__ */ U(this);
3210
+ return /* @__PURE__ */ Z(this);
3306
3211
  },
3307
3212
  "~run"(n, r) {
3308
- let s, i, a;
3213
+ let i, s, a;
3309
3214
  for (const o of this.options) {
3310
3215
  const l = o["~run"]({ value: n.value }, r);
3311
- if (l.typed) if (l.issues) i ? i.push(l) : i = [l];
3216
+ if (l.typed) if (l.issues) s ? s.push(l) : s = [l];
3312
3217
  else {
3313
- s = l;
3218
+ i = l;
3314
3219
  break;
3315
3220
  }
3316
3221
  else a ? a.push(l) : a = [l];
3317
3222
  }
3318
- if (s) return s;
3319
- if (i) {
3320
- if (i.length === 1) return i[0];
3321
- I(this, "type", n, r, { issues: /* @__PURE__ */ Qn(i) }), n.typed = !0;
3223
+ if (i) return i;
3224
+ if (s) {
3225
+ if (s.length === 1) return s[0];
3226
+ N(this, "type", n, r, { issues: /* @__PURE__ */ rr(s) }), n.typed = !0;
3322
3227
  } else {
3323
3228
  if (a?.length === 1) return a[0];
3324
- I(this, "type", n, r, { issues: /* @__PURE__ */ Qn(a) });
3229
+ N(this, "type", n, r, { issues: /* @__PURE__ */ rr(a) });
3325
3230
  }
3326
3231
  return n;
3327
3232
  }
@@ -3337,25 +3242,25 @@ function De(t) {
3337
3242
  async: !1,
3338
3243
  message: t,
3339
3244
  get "~standard"() {
3340
- return /* @__PURE__ */ U(this);
3245
+ return /* @__PURE__ */ Z(this);
3341
3246
  },
3342
3247
  "~run"(e, n) {
3343
- return e.value === void 0 ? e.typed = !0 : I(this, "type", e, n), e;
3248
+ return e.value === void 0 ? e.typed = !0 : N(this, "type", e, n), e;
3344
3249
  }
3345
3250
  };
3346
3251
  }
3347
- function _t(t, e, n) {
3348
- const r = t["~run"]({ value: e }, /* @__PURE__ */ es(n));
3349
- if (r.issues) throw new Dt(r.issues);
3252
+ function bt(t, e, n) {
3253
+ const r = t["~run"]({ value: e }, /* @__PURE__ */ ni(n));
3254
+ if (r.issues) throw new pn(r.issues);
3350
3255
  return r.value;
3351
3256
  }
3352
3257
  // @__NO_SIDE_EFFECTS__
3353
- function g(...t) {
3258
+ function w(...t) {
3354
3259
  return {
3355
3260
  ...t[0],
3356
3261
  pipe: t,
3357
3262
  get "~standard"() {
3358
- return /* @__PURE__ */ U(this);
3263
+ return /* @__PURE__ */ Z(this);
3359
3264
  },
3360
3265
  "~run"(e, n) {
3361
3266
  for (const r of t) if (r.kind !== "metadata") {
@@ -3369,36 +3274,15 @@ function g(...t) {
3369
3274
  }
3370
3275
  };
3371
3276
  }
3372
- // @__NO_SIDE_EFFECTS__
3373
- function Ia(...t) {
3374
- return {
3375
- ...t[0],
3376
- pipe: t,
3377
- async: !0,
3378
- get "~standard"() {
3379
- return /* @__PURE__ */ U(this);
3380
- },
3381
- async "~run"(e, n) {
3382
- for (const r of t) if (r.kind !== "metadata") {
3383
- if (e.issues && (r.kind === "schema" || r.kind === "transformation")) {
3384
- e.typed = !1;
3385
- break;
3386
- }
3387
- (!e.issues || !n.abortEarly && !n.abortPipeEarly) && (e = await r["~run"](e, n));
3388
- }
3389
- return e;
3390
- }
3391
- };
3392
- }
3393
- var Ta = /* @__PURE__ */ g(/* @__PURE__ */ ue(), /* @__PURE__ */ rs(32)), Aa = /* @__PURE__ */ g(/* @__PURE__ */ ue(), /* @__PURE__ */ vn(1)), cs = /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(-90), /* @__PURE__ */ ft(90)), fs = /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(-180), /* @__PURE__ */ ft(180)), Tt = /* @__PURE__ */ R({ lat: cs, lng: fs }), hs = /* @__PURE__ */ R({ sw: Tt, ne: Tt }), Na = /* @__PURE__ */ R({ bounds: hs, center: Tt, zoom: /* @__PURE__ */ x() }), sn = /* @__PURE__ */ ls((t) => t instanceof HTMLElement, "Must be an HTMLElement"), Ca = /* @__PURE__ */ R({ mapSize: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(1)), zoomMin: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), zoomMax: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), zoomScale: /* @__PURE__ */ gn([/* @__PURE__ */ Re(1), /* @__PURE__ */ Re(2), /* @__PURE__ */ Re(10)]) }), Ra = /* @__PURE__ */ R({ inserted: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([])), /* @__PURE__ */ j(/* @__PURE__ */ os())), insert: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([])), /* @__PURE__ */ j(/* @__PURE__ */ De())), remove: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([])), /* @__PURE__ */ j(/* @__PURE__ */ De())), update: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([/* @__PURE__ */ x()])), /* @__PURE__ */ j(/* @__PURE__ */ De())) }), er = /* @__PURE__ */ gn([/* @__PURE__ */ Re("idle"), /* @__PURE__ */ Re("move"), /* @__PURE__ */ Re("click")]), Da = /* @__PURE__ */ R({ getParameters: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([])), /* @__PURE__ */ j(Ca)), getContainer: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([])), /* @__PURE__ */ j(sn)), getZoom: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([])), /* @__PURE__ */ j(/* @__PURE__ */ x())), getBounds: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([])), /* @__PURE__ */ j(hs)), getCenter: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([])), /* @__PURE__ */ j(Tt)), getViewport: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([])), /* @__PURE__ */ j(Na)), panBy: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([/* @__PURE__ */ x(), /* @__PURE__ */ x()])), /* @__PURE__ */ j(/* @__PURE__ */ De())), createMarker: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([sn, cs, fs, /* @__PURE__ */ x()])), /* @__PURE__ */ j(Ra)), subscribe: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([er, /* @__PURE__ */ T()])), /* @__PURE__ */ j(/* @__PURE__ */ De())), unsubscribe: /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([er, /* @__PURE__ */ T()])), /* @__PURE__ */ j(/* @__PURE__ */ De())) }), Xt = /* @__PURE__ */ g(/* @__PURE__ */ T(), /* @__PURE__ */ L(/* @__PURE__ */ $([/* @__PURE__ */ ue()])), /* @__PURE__ */ ss(/* @__PURE__ */ Ia(/* @__PURE__ */ us(), /* @__PURE__ */ ts(), sn))), Oa = /* @__PURE__ */ R({ dimensions: /* @__PURE__ */ R({ width: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), height: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), padding: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), radius: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)) }), colors: /* @__PURE__ */ re(/* @__PURE__ */ R({ background: /* @__PURE__ */ re(/* @__PURE__ */ ue()), border: /* @__PURE__ */ re(/* @__PURE__ */ ue()), shadow: /* @__PURE__ */ re(/* @__PURE__ */ ue()) })) }), tr = /* @__PURE__ */ R({ dimensions: /* @__PURE__ */ g(/* @__PURE__ */ R({ width: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), height: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), margin: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), radius: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)) }), /* @__PURE__ */ ns((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()), filter: /* @__PURE__ */ re(/* @__PURE__ */ ue()) })) }), za = /* @__PURE__ */ R({ id: /* @__PURE__ */ g(/* @__PURE__ */ ue(), /* @__PURE__ */ vn(1)), rank: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(0)), lat: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(-90), /* @__PURE__ */ ft(90)), lng: /* @__PURE__ */ g(/* @__PURE__ */ x(), /* @__PURE__ */ C(-180), /* @__PURE__ */ ft(180)), tooltip: /* @__PURE__ */ R({ style: tr, body: Xt }), pin: /* @__PURE__ */ re(/* @__PURE__ */ R({ style: Oa, body: /* @__PURE__ */ re(Xt) })), popup: /* @__PURE__ */ re(/* @__PURE__ */ R({ style: tr, body: Xt })) });
3394
- class La {
3277
+ var Oa = /* @__PURE__ */ w(/* @__PURE__ */ me(), /* @__PURE__ */ ii(32)), za = /* @__PURE__ */ w(/* @__PURE__ */ me(), /* @__PURE__ */ dn(1)), ui = /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(-90), /* @__PURE__ */ ft(90)), ci = /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(-180), /* @__PURE__ */ ft(180)), It = /* @__PURE__ */ W({ lat: ui, lng: ci }), fi = /* @__PURE__ */ W({ sw: It, ne: It }), La = /* @__PURE__ */ W({ bounds: fi, center: It, zoom: /* @__PURE__ */ P() }), He = /* @__PURE__ */ li((t) => t instanceof HTMLElement, "Must be an HTMLElement"), Fa = /* @__PURE__ */ W({ mapSize: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(1)), zoomMin: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0)), zoomMax: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0)), zoomScale: /* @__PURE__ */ mn([/* @__PURE__ */ Re(1), /* @__PURE__ */ Re(2), /* @__PURE__ */ Re(10)]) }), $a = /* @__PURE__ */ W({ inserted: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([])), /* @__PURE__ */ F(/* @__PURE__ */ oi())), insert: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([])), /* @__PURE__ */ F(/* @__PURE__ */ De())), remove: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([])), /* @__PURE__ */ F(/* @__PURE__ */ De())), update: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([/* @__PURE__ */ P()])), /* @__PURE__ */ F(/* @__PURE__ */ De())) }), ir = /* @__PURE__ */ mn([/* @__PURE__ */ Re("idle"), /* @__PURE__ */ Re("move"), /* @__PURE__ */ Re("click")]), Va = /* @__PURE__ */ W({ getParameters: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([])), /* @__PURE__ */ F(Fa)), getContainer: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([])), /* @__PURE__ */ F(He)), getZoom: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([])), /* @__PURE__ */ F(/* @__PURE__ */ P())), getBounds: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([])), /* @__PURE__ */ F(fi)), getCenter: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([])), /* @__PURE__ */ F(It)), getViewport: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([])), /* @__PURE__ */ F(La)), panBy: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([/* @__PURE__ */ P(), /* @__PURE__ */ P()])), /* @__PURE__ */ F(/* @__PURE__ */ De())), createMarker: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([He, ui, ci, /* @__PURE__ */ P()])), /* @__PURE__ */ F($a)), subscribe: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([ir, /* @__PURE__ */ I()])), /* @__PURE__ */ F(/* @__PURE__ */ De())), unsubscribe: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([ir, /* @__PURE__ */ I()])), /* @__PURE__ */ F(/* @__PURE__ */ De())) }), Zt = /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ z([/* @__PURE__ */ me(), He]))), Xt = /* @__PURE__ */ w(/* @__PURE__ */ W({ width: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0)), height: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0)), padding: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0)) }), /* @__PURE__ */ ri((t) => Math.min(t.width, t.height) / t.padding >= 4, "Minimum of width or height must be greater than or equal to 4 * padding")), Ua = /* @__PURE__ */ W({ background: /* @__PURE__ */ T(/* @__PURE__ */ me()), radius: /* @__PURE__ */ T(/* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0))), shadow: /* @__PURE__ */ T(/* @__PURE__ */ me()) }), sr = /* @__PURE__ */ W({ background: /* @__PURE__ */ T(/* @__PURE__ */ me()), radius: /* @__PURE__ */ T(/* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0))), filter: /* @__PURE__ */ T(/* @__PURE__ */ me()) }), ja = /* @__PURE__ */ W({ id: /* @__PURE__ */ w(/* @__PURE__ */ me(), /* @__PURE__ */ dn(1)), rank: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0)), lat: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(-90), /* @__PURE__ */ ft(90)), lng: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(-180), /* @__PURE__ */ ft(180)), tooltip: /* @__PURE__ */ W({ element: He, style: /* @__PURE__ */ T(sr), dimensions: /* @__PURE__ */ T(Xt), initialize: /* @__PURE__ */ T(Zt) }), pin: /* @__PURE__ */ T(/* @__PURE__ */ W({ element: /* @__PURE__ */ T(He), style: /* @__PURE__ */ T(Ua), dimensions: /* @__PURE__ */ T(Xt), initialize: /* @__PURE__ */ T(Zt) })), popup: /* @__PURE__ */ T(/* @__PURE__ */ W({ element: He, style: /* @__PURE__ */ T(sr), dimensions: /* @__PURE__ */ T(Xt), initialize: /* @__PURE__ */ T(Zt) })) });
3278
+ class Ba {
3395
3279
  apiKey;
3396
3280
  apiJwt;
3397
3281
  markerStatesStore;
3398
3282
  markerStatesWorker;
3399
3283
  markerStatesWorkerClient;
3400
3284
  constructor(e, n) {
3401
- this.apiKey = e, this.apiJwt = n, this.markerStatesStore = /* @__PURE__ */ new Map(), this.markerStatesWorker = new la(), this.markerStatesWorkerClient = new sr(this.markerStatesWorker);
3285
+ this.apiKey = e, this.apiJwt = n, this.markerStatesStore = /* @__PURE__ */ new Map(), this.markerStatesWorker = new ma(), this.markerStatesWorkerClient = new lr(this.markerStatesWorker);
3402
3286
  }
3403
3287
  clearStates() {
3404
3288
  this.markerStatesStore.clear();
@@ -3411,29 +3295,29 @@ class La {
3411
3295
  }
3412
3296
  async updateStates(e, n) {
3413
3297
  if (e.length == 0) return;
3414
- e.sort((a, o) => a.data.id.localeCompare(o.data.id));
3415
- const r = e.map((a) => a.input), s = ya(r);
3416
- let i = this.markerStatesStore.get(s);
3417
- i == null && (i = await this.fetchStates(r, n), this.markerStatesStore.set(s, i));
3298
+ e.sort((a, o) => a.properites.id.localeCompare(o.properites.id));
3299
+ const r = e.map((a) => a.input), i = Sa(r);
3300
+ let s = this.markerStatesStore.get(i);
3301
+ s == null && (s = await this.fetchStates(r, n), this.markerStatesStore.set(i, s));
3418
3302
  for (let a = 0; a < e.length; a++) {
3419
3303
  const o = e[a];
3420
- o.state = i[a];
3304
+ o.state = s[a];
3421
3305
  }
3422
3306
  }
3423
3307
  async fetchStates(e, n) {
3424
3308
  if (e.length == 0) return [];
3425
- if (e.length == 1) return [[0, [[0, Xr.indexOf(sa)]]]];
3309
+ if (e.length == 1) return [[0, [[0, Kr.indexOf(fa)]]]];
3426
3310
  const r = {
3427
3311
  key: this.apiKey,
3428
3312
  jwt: this.apiJwt,
3429
3313
  input: e,
3430
3314
  parameters: n
3431
- }, s = await this.markerStatesWorkerClient.invoke("fetch", r);
3432
- return s.jwt && (this.apiJwt = s.jwt), s.states;
3315
+ }, i = await this.markerStatesWorkerClient.invoke("fetch", r);
3316
+ return i.jwt && (this.apiJwt = i.jwt), i.states;
3433
3317
  }
3434
3318
  }
3435
- const nr = "1.2.28", $a = "https://maps.api.arenarium.dev/auth", Fa = "https://maps.api.arenarium.dev/log", rr = 500;
3436
- class ps {
3319
+ const ar = "1.2.29", Wa = "https://maps.api.arenarium.dev/auth", Ha = "https://maps.api.arenarium.dev/log", or = 500;
3320
+ class hi {
3437
3321
  apiKey;
3438
3322
  mapProvider;
3439
3323
  mapStateProvider;
@@ -3444,26 +3328,26 @@ class ps {
3444
3328
  markerVisibilityProcessor;
3445
3329
  markerElementsProcessor;
3446
3330
  markerStateProcessor;
3447
- markerStatesProcessDelay = rr;
3331
+ markerStatesProcessDelay = or;
3448
3332
  markerStatesProcessTimeout = void 0;
3449
- constructor(e, n, r, s) {
3450
- _t(Ta, e), _t(Aa, n), _t(Da, r), this.apiKey = e, this.mapProvider = r, this.mapStateProvider = new xs(
3333
+ constructor(e, n, r, i) {
3334
+ bt(Oa, e), bt(za, n), bt(Va, r), this.apiKey = e, this.mapProvider = r, this.mapStateProvider = new Ti(
3451
3335
  this.mapProvider,
3452
3336
  this.detached.bind(this),
3453
3337
  this.error.bind(this),
3454
3338
  this.onMapMove.bind(this),
3455
3339
  this.onMapIdle.bind(this),
3456
3340
  this.onMapClick.bind(this)
3457
- ), this.markers = /* @__PURE__ */ new Map(), this.markerVisibilityManager = new zs(this.mapProvider), this.markerElementsManager = new oa(this.mapProvider), this.markerStatesManager = new La(e, n), this.markerVisibilityProcessor = new Ht(this.onMarkersVisiblityProcess.bind(this)), this.markerElementsProcessor = new Ht(this.onMarkersRenderProcess.bind(this)), this.markerStateProcessor = new Ht(this.onMarkersStateProcess.bind(this)), this.configuration = s;
3341
+ ), this.markers = /* @__PURE__ */ new Map(), this.markerVisibilityManager = new Bi(), this.markerElementsManager = new da(this.mapProvider), this.markerStatesManager = new Ba(e, n), this.markerVisibilityProcessor = new Wt(this.onMarkersVisiblityProcess.bind(this)), this.markerElementsProcessor = new Wt(this.onMarkersRenderProcess.bind(this)), this.markerStateProcessor = new Wt(this.onMarkersStateProcess.bind(this)), this.configuration = i;
3458
3342
  }
3459
3343
  //#region Core
3460
3344
  static async create(e, n, r) {
3461
- let a = (await ca($a, { key: e, version: nr })).jwt;
3345
+ let a = (await ga(Wa, { key: e, version: ar })).jwt;
3462
3346
  if (!a) throw new Error("Failed to get api jwt");
3463
- return new ps(e, a, n, r);
3347
+ return new hi(e, a, n, r);
3464
3348
  }
3465
3349
  set configuration(e) {
3466
- this.markerStatesProcessDelay = e?.process?.states?.delay ?? rr, this.markerVisibilityManager.configuration = e, this.markerElementsManager.configuration = e;
3350
+ this.markerStatesProcessDelay = e?.process?.states?.delay ?? or, this.markerVisibilityManager.configuration = e, this.markerElementsManager.configuration = e;
3467
3351
  }
3468
3352
  clear() {
3469
3353
  this.markers.clear(), this.markerVisibilityManager.clearMarkers(), this.markerStatesManager.clearStates(), this.markerElementsManager.clearElements(), this.mapStateProvider.stop(), this.markerVisibilityProcessor.stop(), this.markerStateProcessor.stop(), this.markerElementsProcessor.stop();
@@ -3488,11 +3372,11 @@ class ps {
3488
3372
  }
3489
3373
  if (r instanceof Error)
3490
3374
  try {
3491
- const s = {
3375
+ const i = {
3492
3376
  title: n,
3493
3377
  level: e,
3494
3378
  content: {
3495
- version: nr,
3379
+ version: ar,
3496
3380
  key: this.apiKey,
3497
3381
  name: r.name,
3498
3382
  message: r.message,
@@ -3500,9 +3384,9 @@ class ps {
3500
3384
  stack: r.stack
3501
3385
  }
3502
3386
  };
3503
- await fa(Fa, s);
3504
- } catch (s) {
3505
- console.error(s);
3387
+ await wa(Ha, i);
3388
+ } catch (i) {
3389
+ console.error(i);
3506
3390
  }
3507
3391
  }
3508
3392
  //#endregion
@@ -3549,15 +3433,68 @@ class ps {
3549
3433
  }
3550
3434
  }
3551
3435
  //#endregion
3552
- //#region Public
3436
+ //#region Markers
3437
+ getMarkers(e) {
3438
+ const n = new Array(), r = new Array();
3439
+ for (const s of e) {
3440
+ const a = this.markers.get(s.id);
3441
+ a ? n.push(a) : r.push(s);
3442
+ }
3443
+ const i = document.createElement("div");
3444
+ i.style.position = "absolute", i.style.visibility = "hidden", i.style.display = "flex";
3445
+ try {
3446
+ document.body.appendChild(i);
3447
+ for (const o of r) {
3448
+ const l = o.pin, u = o.tooltip, c = o.popup;
3449
+ l?.element && !l.dimensions && i.appendChild(l.element), u.element && !u.dimensions && i.appendChild(u.element), c?.element && !c.dimensions && i.appendChild(c.element);
3450
+ }
3451
+ const s = (o, l) => {
3452
+ if (l) return l;
3453
+ if (o) {
3454
+ const u = o.getBoundingClientRect();
3455
+ return { width: u.width, height: u.height, padding: Ln };
3456
+ } else
3457
+ return { width: zn, height: zn, padding: Ln };
3458
+ }, a = (o, l) => {
3459
+ if (l) return l;
3460
+ const u = o.getBoundingClientRect();
3461
+ return { width: u.width, height: u.height, padding: Math.max(Math.round(Math.min(u.width, u.height) / 4), Vi) };
3462
+ };
3463
+ for (const o of r) {
3464
+ const l = o.id, u = o.lat, c = o.lng, h = o.rank;
3465
+ let f = {
3466
+ id: l,
3467
+ initialize: o.pin?.initialize,
3468
+ element: o.pin?.element,
3469
+ style: o.pin?.style,
3470
+ dimensions: s(o.pin?.element, o.pin?.dimensions)
3471
+ }, d = {
3472
+ id: l,
3473
+ initialize: o.tooltip.initialize,
3474
+ element: o.tooltip.element,
3475
+ style: o.tooltip.style,
3476
+ dimensions: a(o.tooltip.element, o.tooltip.dimensions)
3477
+ }, m;
3478
+ o.popup && (m = {
3479
+ id: l,
3480
+ initialize: o.popup.initialize,
3481
+ element: o.popup.element,
3482
+ style: o.popup.style,
3483
+ dimensions: a(o.popup.element, o.popup.dimensions)
3484
+ });
3485
+ const v = new xi(l, u, c, h, f, d, m);
3486
+ n.push(v);
3487
+ }
3488
+ return n.forEach((o) => this.markers.set(o.properites.id, o)), n.sort((o, l) => l.properites.rank - o.properites.rank), n;
3489
+ } finally {
3490
+ i.replaceChildren(), document.body.removeChild(i);
3491
+ }
3492
+ }
3553
3493
  async updateMarkers(e) {
3554
- _t(/* @__PURE__ */ as(za), e);
3494
+ bt(/* @__PURE__ */ ai(ja), e);
3555
3495
  try {
3556
- const n = this.mapProvider.getParameters();
3557
- for (const s of e)
3558
- this.markers.has(s.id) == !1 && this.markers.set(s.id, new _s(s));
3559
- const r = Array.from(this.markers.values());
3560
- 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();
3496
+ const n = this.mapProvider.getParameters(), r = this.getMarkers(e);
3497
+ await this.markerVisibilityManager.updateMarkers(n, r), this.mapStateProvider.start(), this.markerVisibilityProcessor.run(), this.markerStateProcessor.run(), this.markerElementsProcessor.run();
3561
3498
  } catch (n) {
3562
3499
  throw this.clear(), this.error("Failed to update markers", n), n;
3563
3500
  }
@@ -3569,8 +3506,10 @@ class ps {
3569
3506
  throw this.error("Failed to remove markers", e), e;
3570
3507
  }
3571
3508
  }
3509
+ //#endregion
3510
+ //#region Popups
3572
3511
  showPopup(e) {
3573
- if (!this.detached() && this.markers.size != 0)
3512
+ if (!this.detached())
3574
3513
  try {
3575
3514
  this.markerElementsManager.showPopup(e);
3576
3515
  } catch (n) {
@@ -3580,7 +3519,7 @@ class ps {
3580
3519
  }
3581
3520
  }
3582
3521
  hidePopup() {
3583
- if (!this.detached() && this.markers.size != 0)
3522
+ if (!this.detached())
3584
3523
  try {
3585
3524
  this.markerElementsManager.hidePopups();
3586
3525
  } catch (e) {
@@ -3592,5 +3531,5 @@ class ps {
3592
3531
  //#endregion
3593
3532
  }
3594
3533
  export {
3595
- ps as MapManager
3534
+ hi as MapManager
3596
3535
  };