@arenarium/maps 1.2.29 → 1.3.1
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.
- package/dist/main.d.ts +4 -3
- package/dist/main.js +1202 -1261
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
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
|
|
21
|
-
|
|
20
|
+
class Ei {
|
|
21
|
+
properites;
|
|
22
22
|
state;
|
|
23
|
-
constructor(e) {
|
|
24
|
-
this.
|
|
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:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
width:
|
|
33
|
-
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
|
|
38
|
+
class xi {
|
|
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
|
|
54
|
-
class
|
|
53
|
+
const Si = 100;
|
|
54
|
+
class Pi {
|
|
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,
|
|
65
|
-
this.provider = e, this.interval = new
|
|
64
|
+
constructor(e, n, r, i, s, a) {
|
|
65
|
+
this.provider = e, this.interval = new xi(this.onInterval.bind(this), Si / (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
|
|
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,
|
|
106
|
-
const
|
|
107
|
-
this.workerInvocations.set(
|
|
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
|
|
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),
|
|
122
|
-
return new
|
|
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
|
|
125
|
+
return new Ue([], []);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
const
|
|
129
|
-
function
|
|
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 Ti(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(
|
|
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
|
|
149
|
-
return { x:
|
|
148
|
+
function it(t, e, n) {
|
|
149
|
+
return { x: Ii(e) * n, y: Ai(t) * n };
|
|
150
150
|
}
|
|
151
151
|
function Rn(t, e, n) {
|
|
152
|
-
return { lat:
|
|
152
|
+
return { lat: Ci(e / n), lng: Ni(t / n) };
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function Ii(t) {
|
|
155
155
|
return (180 + t) / 360;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function Ai(t) {
|
|
158
158
|
return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + t * Math.PI / 360))) / 360;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function Ni(t) {
|
|
161
161
|
return t * 360 - 180;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Ci(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,
|
|
170
|
-
if (r < e) throw new Error(`Invalid bounds: ${e}, ${n}, ${r}, ${
|
|
171
|
-
if (
|
|
172
|
-
this.sw = { lat: e, lng: n }, this.ne = { lat: r, lng:
|
|
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,
|
|
187
|
-
if (r < e) throw new Error(`Invalid bounds: ${e}, ${n}, ${r}, ${
|
|
188
|
-
this.sw = { lat: e, lng: n }, this.ne = { lat: r, lng:
|
|
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,
|
|
196
|
-
return new ot(r.lat, r.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
|
|
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
|
|
218
|
-
class
|
|
219
|
-
// Services
|
|
220
|
-
provider;
|
|
217
|
+
const Ri = 75, Di = 150, Dn = 25e-5, zi = 1e6, Oi = 2e6, zn = 3e6, cr = 10, On = 16, Li = 8, Ln = 2, $e = 0.5, Fi = "0px 2px 2px rgba(0, 0, 0, 0.5)", Fn = 8, $i = 8, Vi = "drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.5))", $n = "white", Ui = "darkgreen", Vn = 1024;
|
|
218
|
+
class ji {
|
|
221
219
|
// State
|
|
222
220
|
markers;
|
|
223
221
|
markersVisible;
|
|
224
222
|
markerVisibilityTreeWorker;
|
|
225
223
|
markerVisibilityTreeWorkerClient;
|
|
226
|
-
markerVisibilityTreeLimit =
|
|
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 ??
|
|
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),
|
|
239
|
-
return this.markersVisible =
|
|
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,
|
|
242
|
-
return this.markersVisible =
|
|
236
|
+
const r = this.markersVisible, i = this.markers, s = Ue.from(r, i);
|
|
237
|
+
return this.markersVisible = i, s;
|
|
243
238
|
} else
|
|
244
|
-
return
|
|
239
|
+
return Ue.empty();
|
|
245
240
|
}
|
|
246
241
|
async updateMarkers(e, n) {
|
|
247
|
-
this.markers = n, n.length > this.markerVisibilityTreeLimit ? (this.markerVisibilityTreeWorker = new
|
|
242
|
+
this.markers = n, n.length > this.markerVisibilityTreeLimit ? (this.markerVisibilityTreeWorker = new Ti(), this.markerVisibilityTreeWorkerClient = new lr(this.markerVisibilityTreeWorker), await this.markerVisibilityTreeWorkerClient.invoke(
|
|
248
243
|
"update",
|
|
249
244
|
e,
|
|
250
|
-
n.map((r,
|
|
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
|
|
259
|
-
var
|
|
260
|
-
const
|
|
253
|
+
const Jt = !1;
|
|
254
|
+
var Bi = Array.isArray, Wi = Array.prototype.indexOf, qe = Array.prototype.includes, Hi = Array.from, qi = Object.defineProperty, st = Object.getOwnPropertyDescriptor, Yi = Object.prototype, Zi = Array.prototype, Xi = Object.getPrototypeOf, Un = Object.isExtensible;
|
|
255
|
+
const Ji = () => {
|
|
261
256
|
};
|
|
262
|
-
function
|
|
257
|
+
function Gi(t) {
|
|
263
258
|
for (var e = 0; e < t.length; e++)
|
|
264
259
|
t[e]();
|
|
265
260
|
}
|
|
266
|
-
function
|
|
267
|
-
var t, e, n = new Promise((r,
|
|
268
|
-
t = r, e =
|
|
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
|
|
267
|
+
const D = 2, lt = 4, At = 8, hr = 1 << 24, ve = 16, xe = 32, Oe = 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, Ki = 1 << 20, ze = 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
|
|
271
|
+
function Qi() {
|
|
277
272
|
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
278
273
|
}
|
|
279
|
-
function
|
|
274
|
+
function es() {
|
|
280
275
|
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
281
276
|
}
|
|
282
|
-
function
|
|
277
|
+
function ts() {
|
|
283
278
|
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
284
279
|
}
|
|
285
|
-
function
|
|
280
|
+
function ns() {
|
|
286
281
|
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
287
282
|
}
|
|
288
|
-
function
|
|
283
|
+
function rs() {
|
|
289
284
|
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
290
285
|
}
|
|
291
|
-
function
|
|
286
|
+
function is() {
|
|
292
287
|
throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
|
|
293
288
|
}
|
|
294
|
-
const
|
|
295
|
-
function
|
|
289
|
+
const ss = 1, as = 2, C = /* @__PURE__ */ Symbol(), os = "http://www.w3.org/1999/xhtml";
|
|
290
|
+
function ls() {
|
|
296
291
|
console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
|
|
297
292
|
}
|
|
298
|
-
function
|
|
293
|
+
function mr(t) {
|
|
299
294
|
return t === this.v;
|
|
300
295
|
}
|
|
301
|
-
let
|
|
302
|
-
function
|
|
303
|
-
|
|
296
|
+
let us = !1, ae = null;
|
|
297
|
+
function Ye(t) {
|
|
298
|
+
ae = t;
|
|
304
299
|
}
|
|
305
|
-
function
|
|
306
|
-
|
|
307
|
-
p:
|
|
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
|
|
311
|
+
function sn(t) {
|
|
317
312
|
var e = (
|
|
318
313
|
/** @type {ComponentContext} */
|
|
319
|
-
|
|
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
|
-
|
|
319
|
+
Cs(r);
|
|
325
320
|
}
|
|
326
|
-
return t !== void 0 && (e.x = t), e.i = !0,
|
|
321
|
+
return t !== void 0 && (e.x = t), e.i = !0, ae = e.p, t ?? /** @type {T} */
|
|
327
322
|
{};
|
|
328
323
|
}
|
|
329
|
-
function
|
|
324
|
+
function vr() {
|
|
330
325
|
return !0;
|
|
331
326
|
}
|
|
332
327
|
let Ve = [];
|
|
333
|
-
function
|
|
328
|
+
function cs() {
|
|
334
329
|
var t = Ve;
|
|
335
|
-
Ve = [],
|
|
330
|
+
Ve = [], Gi(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 &&
|
|
336
|
+
e === Ve && cs();
|
|
342
337
|
});
|
|
343
338
|
}
|
|
344
339
|
Ve.push(t);
|
|
345
340
|
}
|
|
346
|
-
function
|
|
347
|
-
var e =
|
|
341
|
+
function gr(t) {
|
|
342
|
+
var e = y;
|
|
348
343
|
if (e === null)
|
|
349
|
-
return
|
|
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 &
|
|
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
|
|
371
|
-
function
|
|
372
|
-
t.f = t.f &
|
|
365
|
+
const fs = -7169;
|
|
366
|
+
function S(t, e) {
|
|
367
|
+
t.f = t.f & fs | e;
|
|
373
368
|
}
|
|
374
|
-
function
|
|
375
|
-
(t.f &
|
|
369
|
+
function an(t) {
|
|
370
|
+
(t.f & Q) !== 0 || t.deps === null ? S(t, R) : S(t, se);
|
|
376
371
|
}
|
|
377
|
-
function
|
|
372
|
+
function wr(t) {
|
|
378
373
|
if (t !== null)
|
|
379
374
|
for (const e of t)
|
|
380
|
-
(e.f &
|
|
375
|
+
(e.f & D) === 0 || (e.f & ze) === 0 || (e.f ^= ze, wr(
|
|
381
376
|
/** @type {Derived} */
|
|
382
377
|
e.deps
|
|
383
378
|
));
|
|
384
379
|
}
|
|
385
|
-
function
|
|
386
|
-
(t.f &
|
|
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
|
|
389
|
-
let
|
|
390
|
-
class
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
|
|
464
|
+
S(r, L), le(r);
|
|
470
465
|
for (r of n.m)
|
|
471
|
-
|
|
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
|
-
|
|
474
|
+
K = [], this.apply();
|
|
480
475
|
var n = [], r = [];
|
|
481
|
-
for (const
|
|
482
|
-
this.#l(
|
|
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 [
|
|
486
|
-
|
|
480
|
+
for (const [i, s] of this.#t)
|
|
481
|
+
br(i, s);
|
|
487
482
|
} else {
|
|
488
|
-
for (const
|
|
489
|
-
this.#n.clear(), this.#r === 0 && this.#c(),
|
|
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
|
-
|
|
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 ^=
|
|
502
|
-
for (var
|
|
503
|
-
var a =
|
|
504
|
-
if (!u &&
|
|
505
|
-
o ?
|
|
506
|
-
var c =
|
|
496
|
+
e.f ^= R;
|
|
497
|
+
for (var i = e.first, s = null; i !== null; ) {
|
|
498
|
+
var a = i.f, o = (a & (xe | Oe)) !== 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
|
-
|
|
503
|
+
i = c;
|
|
509
504
|
continue;
|
|
510
505
|
}
|
|
511
506
|
}
|
|
512
|
-
var h =
|
|
513
|
-
for (
|
|
514
|
-
h ===
|
|
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
|
-
|
|
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 !==
|
|
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
|
-
|
|
529
|
+
x = this, this.apply();
|
|
535
530
|
}
|
|
536
531
|
deactivate() {
|
|
537
|
-
|
|
532
|
+
x === this && (x = null, re = null);
|
|
538
533
|
}
|
|
539
534
|
flush() {
|
|
540
|
-
if (this.activate(),
|
|
541
|
-
if (
|
|
535
|
+
if (this.activate(), K.length > 0) {
|
|
536
|
+
if (hs(), 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 (
|
|
546
|
+
if (kt.size > 1) {
|
|
552
547
|
this.previous.clear();
|
|
553
|
-
var e =
|
|
554
|
-
for (const
|
|
555
|
-
if (
|
|
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
|
|
554
|
+
const s = [];
|
|
560
555
|
for (const [o, l] of this.current) {
|
|
561
|
-
if (
|
|
562
|
-
if (n && l !==
|
|
563
|
-
|
|
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
|
-
|
|
561
|
+
s.push(o);
|
|
567
562
|
}
|
|
568
|
-
if (
|
|
563
|
+
if (s.length === 0)
|
|
569
564
|
continue;
|
|
570
|
-
const a = [...
|
|
565
|
+
const a = [...i.current.keys()].filter((o) => !this.current.has(o));
|
|
571
566
|
if (a.length > 0) {
|
|
572
|
-
var r =
|
|
573
|
-
|
|
567
|
+
var r = K;
|
|
568
|
+
K = [];
|
|
574
569
|
const o = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
|
|
575
|
-
for (const u of
|
|
576
|
-
|
|
577
|
-
if (
|
|
578
|
-
|
|
579
|
-
for (const u of
|
|
580
|
-
|
|
581
|
-
|
|
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
|
-
|
|
578
|
+
K = r;
|
|
584
579
|
}
|
|
585
580
|
}
|
|
586
|
-
|
|
581
|
+
x = null, re = e;
|
|
587
582
|
}
|
|
588
|
-
this.committed = !0,
|
|
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() ?
|
|
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.#
|
|
608
|
-
this.#e.delete(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
|
-
|
|
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.#
|
|
617
|
+
return (this.#s ??= fr()).promise;
|
|
623
618
|
}
|
|
624
619
|
static ensure() {
|
|
625
|
-
if (
|
|
626
|
-
const e =
|
|
627
|
-
|
|
628
|
-
|
|
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
|
|
626
|
+
return x;
|
|
632
627
|
}
|
|
633
628
|
apply() {
|
|
634
629
|
}
|
|
635
630
|
}
|
|
636
|
-
function
|
|
637
|
-
|
|
631
|
+
function hs() {
|
|
632
|
+
Kt = !0;
|
|
638
633
|
var t = null;
|
|
639
634
|
try {
|
|
640
|
-
for (var e = 0;
|
|
641
|
-
var n =
|
|
635
|
+
for (var e = 0; K.length > 0; ) {
|
|
636
|
+
var n = Me.ensure();
|
|
642
637
|
if (e++ > 1e3) {
|
|
643
|
-
var r,
|
|
644
|
-
|
|
638
|
+
var r, i;
|
|
639
|
+
ps();
|
|
645
640
|
}
|
|
646
|
-
n.process(
|
|
641
|
+
n.process(K), Ee.clear();
|
|
647
642
|
}
|
|
648
643
|
} finally {
|
|
649
|
-
|
|
644
|
+
K = [], Kt = !1, on = null;
|
|
650
645
|
}
|
|
651
646
|
}
|
|
652
|
-
function
|
|
647
|
+
function ps() {
|
|
653
648
|
try {
|
|
654
|
-
|
|
649
|
+
es();
|
|
655
650
|
} catch (t) {
|
|
656
|
-
Ze(t,
|
|
651
|
+
Ze(t, on);
|
|
657
652
|
}
|
|
658
653
|
}
|
|
659
|
-
let
|
|
660
|
-
function
|
|
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 & (
|
|
666
|
-
|
|
667
|
-
for (const
|
|
668
|
-
if ((
|
|
669
|
-
const
|
|
670
|
-
let a =
|
|
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 && zr(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
|
-
|
|
673
|
-
for (let o =
|
|
674
|
-
const l =
|
|
675
|
-
(l.f & (
|
|
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
|
-
|
|
673
|
+
de.clear();
|
|
679
674
|
}
|
|
680
675
|
}
|
|
681
|
-
|
|
676
|
+
de = null;
|
|
682
677
|
}
|
|
683
678
|
}
|
|
684
|
-
function
|
|
679
|
+
function yr(t, e, n, r) {
|
|
685
680
|
if (!n.has(t) && (n.add(t), t.reactions !== null))
|
|
686
|
-
for (const
|
|
687
|
-
const
|
|
688
|
-
(
|
|
681
|
+
for (const i of t.reactions) {
|
|
682
|
+
const s = i.f;
|
|
683
|
+
(s & D) !== 0 ? yr(
|
|
689
684
|
/** @type {Derived} */
|
|
690
|
-
|
|
685
|
+
i,
|
|
691
686
|
e,
|
|
692
687
|
n,
|
|
693
688
|
r
|
|
694
|
-
) : (
|
|
689
|
+
) : (s & (nn | ve)) !== 0 && (s & L) === 0 && _r(i, e, r) && (S(i, L), le(
|
|
695
690
|
/** @type {Effect} */
|
|
696
|
-
|
|
691
|
+
i
|
|
697
692
|
));
|
|
698
693
|
}
|
|
699
694
|
}
|
|
700
|
-
function
|
|
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
|
|
705
|
-
if (
|
|
699
|
+
for (const i of t.deps) {
|
|
700
|
+
if (qe.call(e, i))
|
|
706
701
|
return !0;
|
|
707
|
-
if ((
|
|
702
|
+
if ((i.f & D) !== 0 && _r(
|
|
708
703
|
/** @type {Derived} */
|
|
709
|
-
|
|
704
|
+
i,
|
|
710
705
|
e,
|
|
711
706
|
n
|
|
712
707
|
))
|
|
713
708
|
return n.set(
|
|
714
709
|
/** @type {Derived} */
|
|
715
|
-
|
|
710
|
+
i,
|
|
716
711
|
!0
|
|
717
712
|
), !0;
|
|
718
713
|
}
|
|
719
714
|
return n.set(t, !1), !1;
|
|
720
715
|
}
|
|
721
|
-
function
|
|
722
|
-
for (var e =
|
|
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 (
|
|
720
|
+
if (Kt && e === y && (n & ve) !== 0 && (n & dr) === 0)
|
|
726
721
|
return;
|
|
727
|
-
if ((n & (
|
|
728
|
-
if ((n &
|
|
729
|
-
e.f ^=
|
|
722
|
+
if ((n & (Oe | xe)) !== 0) {
|
|
723
|
+
if ((n & R) === 0) return;
|
|
724
|
+
e.f ^= R;
|
|
730
725
|
}
|
|
731
726
|
}
|
|
732
|
-
|
|
727
|
+
K.push(e);
|
|
733
728
|
}
|
|
734
|
-
function
|
|
735
|
-
if (!((t.f &
|
|
736
|
-
(t.f &
|
|
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
|
-
|
|
733
|
+
br(n, e), n = n.next;
|
|
739
734
|
}
|
|
740
735
|
}
|
|
741
|
-
function
|
|
736
|
+
function ds(t) {
|
|
742
737
|
let e = 0, n = Ct(0), r;
|
|
743
738
|
return () => {
|
|
744
|
-
|
|
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
|
|
752
|
-
function
|
|
753
|
-
new
|
|
746
|
+
var ms = St | Ke | pr;
|
|
747
|
+
function vs(t, e, n) {
|
|
748
|
+
new gs(t, e, n);
|
|
754
749
|
}
|
|
755
|
-
class
|
|
750
|
+
class gs {
|
|
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
|
-
#
|
|
763
|
+
#s;
|
|
769
764
|
/** @type {Effect | null} */
|
|
770
|
-
#
|
|
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
|
-
#
|
|
790
|
+
#_ = ds(() => (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
|
-
|
|
806
|
-
|
|
800
|
+
y.b, this.is_pending = !!this.#r.pending, this.#s = Os(() => {
|
|
801
|
+
y.b = this;
|
|
807
802
|
{
|
|
808
|
-
var
|
|
803
|
+
var i = this.#k();
|
|
809
804
|
try {
|
|
810
|
-
this.#
|
|
811
|
-
} catch (
|
|
812
|
-
this.error(
|
|
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
|
-
},
|
|
814
|
+
}, ms);
|
|
820
815
|
}
|
|
821
|
-
#
|
|
816
|
+
#b() {
|
|
822
817
|
try {
|
|
823
|
-
this.#
|
|
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 =
|
|
831
|
-
var n = this.#
|
|
832
|
-
this.#
|
|
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
|
-
#
|
|
836
|
+
#k() {
|
|
842
837
|
var e = this.#n;
|
|
843
|
-
return this.is_pending && (this.#l =
|
|
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
|
-
|
|
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 =
|
|
867
|
-
ce(this.#
|
|
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 (
|
|
871
|
-
return
|
|
865
|
+
} catch (s) {
|
|
866
|
+
return gr(s), null;
|
|
872
867
|
} finally {
|
|
873
|
-
ce(n),
|
|
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.#
|
|
876
|
+
this.#i !== null && (this.#a = document.createDocumentFragment(), this.#a.append(
|
|
882
877
|
/** @type {TemplateNode} */
|
|
883
878
|
this.#l
|
|
884
|
-
),
|
|
879
|
+
), $s(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
|
-
#
|
|
886
|
+
#y(e) {
|
|
892
887
|
if (!this.has_pending_snippet()) {
|
|
893
|
-
this.parent && this.parent.#
|
|
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
|
-
|
|
894
|
+
S(n, L), le(n);
|
|
900
895
|
for (const n of this.#v)
|
|
901
|
-
|
|
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.#
|
|
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.#
|
|
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.#
|
|
931
|
-
var
|
|
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 (
|
|
934
|
-
|
|
928
|
+
if (i) {
|
|
929
|
+
ls();
|
|
935
930
|
return;
|
|
936
931
|
}
|
|
937
|
-
|
|
932
|
+
i = !0, s && is(), 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.#
|
|
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
|
-
|
|
938
|
+
s = !0, n?.(e, a), s = !1;
|
|
944
939
|
} catch (o) {
|
|
945
|
-
Ze(o, this.#
|
|
940
|
+
Ze(o, this.#s && this.#s.parent);
|
|
946
941
|
}
|
|
947
942
|
r && (this.#t = this.#g(() => {
|
|
948
|
-
|
|
943
|
+
Me.ensure(), this.#p = !0;
|
|
949
944
|
try {
|
|
950
|
-
return
|
|
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.#
|
|
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
|
|
971
|
-
const
|
|
972
|
-
var
|
|
973
|
-
if (n.length === 0 &&
|
|
974
|
-
r(e.map(
|
|
965
|
+
function ws(t, e, n, r) {
|
|
966
|
+
const i = ys;
|
|
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 =
|
|
972
|
+
var a = x, o = (
|
|
978
973
|
/** @type {Effect} */
|
|
979
|
-
|
|
980
|
-
), l =
|
|
974
|
+
y
|
|
975
|
+
), l = ks(), 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 &
|
|
981
|
+
(o.f & _e) === 0 && Ze(d, o);
|
|
987
982
|
}
|
|
988
|
-
a?.deactivate(),
|
|
983
|
+
a?.deactivate(), Qt();
|
|
989
984
|
}
|
|
990
985
|
if (n.length === 0) {
|
|
991
|
-
u.then(() => c(e.map(
|
|
986
|
+
u.then(() => c(e.map(i)));
|
|
992
987
|
return;
|
|
993
988
|
}
|
|
994
989
|
function h() {
|
|
995
|
-
l(), Promise.all(n.map((f) => /* @__PURE__ */
|
|
990
|
+
l(), Promise.all(n.map((f) => /* @__PURE__ */ _s(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
|
|
1000
|
-
var t =
|
|
1001
|
-
return function(
|
|
1002
|
-
ce(t),
|
|
994
|
+
function ks() {
|
|
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
|
|
1006
|
-
ce(null),
|
|
1000
|
+
function Qt() {
|
|
1001
|
+
ce(null), te(null), Ye(null);
|
|
1007
1002
|
}
|
|
1008
1003
|
// @__NO_SIDE_EFFECTS__
|
|
1009
|
-
function
|
|
1010
|
-
var e =
|
|
1004
|
+
function ys(t) {
|
|
1005
|
+
var e = D | L, n = k !== null && (k.f & D) !== 0 ? (
|
|
1011
1006
|
/** @type {Derived} */
|
|
1012
|
-
|
|
1007
|
+
k
|
|
1013
1008
|
) : null;
|
|
1014
|
-
return
|
|
1015
|
-
ctx:
|
|
1009
|
+
return y !== null && (y.f |= Ke), {
|
|
1010
|
+
ctx: ae,
|
|
1016
1011
|
deps: null,
|
|
1017
1012
|
effects: null,
|
|
1018
|
-
equals:
|
|
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
|
-
|
|
1020
|
+
C
|
|
1026
1021
|
),
|
|
1027
1022
|
wv: 0,
|
|
1028
|
-
parent: n ??
|
|
1023
|
+
parent: n ?? y,
|
|
1029
1024
|
ac: null
|
|
1030
1025
|
};
|
|
1031
1026
|
}
|
|
1032
1027
|
// @__NO_SIDE_EFFECTS__
|
|
1033
|
-
function
|
|
1028
|
+
function _s(t, e, n) {
|
|
1034
1029
|
let r = (
|
|
1035
1030
|
/** @type {Effect | null} */
|
|
1036
|
-
|
|
1031
|
+
y
|
|
1037
1032
|
);
|
|
1038
|
-
r === null &&
|
|
1039
|
-
var
|
|
1033
|
+
r === null && Qi();
|
|
1034
|
+
var i = (
|
|
1040
1035
|
/** @type {Boundary} */
|
|
1041
1036
|
r.b
|
|
1042
|
-
),
|
|
1037
|
+
), s = (
|
|
1043
1038
|
/** @type {Promise<V>} */
|
|
1044
1039
|
/** @type {unknown} */
|
|
1045
1040
|
void 0
|
|
1046
1041
|
), a = Ct(
|
|
1047
1042
|
/** @type {V} */
|
|
1048
|
-
|
|
1049
|
-
), o = !
|
|
1050
|
-
return
|
|
1051
|
-
var u =
|
|
1052
|
-
|
|
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 ===
|
|
1050
|
+
c === x && c.committed && c.deactivate(), Qt();
|
|
1056
1051
|
});
|
|
1057
1052
|
} catch (d) {
|
|
1058
|
-
u.reject(d),
|
|
1053
|
+
u.reject(d), Qt();
|
|
1059
1054
|
}
|
|
1060
1055
|
var c = (
|
|
1061
1056
|
/** @type {Batch} */
|
|
1062
|
-
|
|
1057
|
+
x
|
|
1063
1058
|
);
|
|
1064
1059
|
if (o) {
|
|
1065
|
-
var h =
|
|
1066
|
-
|
|
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 !==
|
|
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(
|
|
1070
|
+
M.reject(Ie);
|
|
1076
1071
|
}
|
|
1077
1072
|
}
|
|
1078
|
-
o && (
|
|
1073
|
+
o && (i.update_pending_count(-1), c.decrement(h));
|
|
1079
1074
|
};
|
|
1080
1075
|
u.promise.then(f, (d) => f(null, d || "unknown"));
|
|
1081
|
-
}),
|
|
1076
|
+
}), Ns(() => {
|
|
1082
1077
|
for (const u of l.values())
|
|
1083
|
-
u.reject(
|
|
1078
|
+
u.reject(Ie);
|
|
1084
1079
|
}), new Promise((u) => {
|
|
1085
1080
|
function c(h) {
|
|
1086
1081
|
function f() {
|
|
1087
|
-
h ===
|
|
1082
|
+
h === s ? u(a) : c(s);
|
|
1088
1083
|
}
|
|
1089
1084
|
h.then(f, f);
|
|
1090
1085
|
}
|
|
1091
|
-
c(
|
|
1086
|
+
c(s);
|
|
1092
1087
|
});
|
|
1093
1088
|
}
|
|
1094
|
-
function
|
|
1089
|
+
function bs(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
|
-
|
|
1094
|
+
ue(
|
|
1100
1095
|
/** @type {Effect} */
|
|
1101
1096
|
e[n]
|
|
1102
1097
|
);
|
|
1103
1098
|
}
|
|
1104
1099
|
}
|
|
1105
|
-
function
|
|
1100
|
+
function Ms(t) {
|
|
1106
1101
|
for (var e = t.parent; e !== null; ) {
|
|
1107
|
-
if ((e.f &
|
|
1108
|
-
return (e.f &
|
|
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
|
|
1117
|
-
var e, n =
|
|
1118
|
-
ce(
|
|
1111
|
+
function ln(t) {
|
|
1112
|
+
var e, n = y;
|
|
1113
|
+
ce(Ms(t));
|
|
1119
1114
|
try {
|
|
1120
|
-
t.f &= ~
|
|
1115
|
+
t.f &= ~ze, bs(t), e = Vr(t);
|
|
1121
1116
|
} finally {
|
|
1122
1117
|
ce(n);
|
|
1123
1118
|
}
|
|
1124
1119
|
return e;
|
|
1125
1120
|
}
|
|
1126
|
-
function
|
|
1127
|
-
var e =
|
|
1128
|
-
if (!t.equals(e) && (t.wv =
|
|
1129
|
-
|
|
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
|
-
|
|
1127
|
+
Xe || (re !== null ? (un() || x?.is_fork) && re.set(t, e) : an(t));
|
|
1133
1128
|
}
|
|
1134
|
-
function
|
|
1129
|
+
function Es(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(
|
|
1132
|
+
(e.teardown || e.ac) && (e.teardown?.(), e.ac?.abort(Ie), e.teardown = Ji, e.ac = null, ut(e, 0), cn(e));
|
|
1138
1133
|
}
|
|
1139
|
-
function
|
|
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
|
|
1145
|
-
const
|
|
1146
|
-
let
|
|
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:
|
|
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
|
|
1155
|
+
function V(t, e) {
|
|
1161
1156
|
const n = Ct(t);
|
|
1162
|
-
return
|
|
1157
|
+
return Vs(n), n;
|
|
1163
1158
|
}
|
|
1164
|
-
function
|
|
1165
|
-
|
|
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
|
-
(!
|
|
1162
|
+
(!ie || (k.f & jn) !== 0) && vr() && (k.f & (D | ve | nn | jn)) !== 0 && (ee === null || !qe.call(ee, t)) && rs();
|
|
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
|
-
|
|
1175
|
-
var r =
|
|
1176
|
-
if (r.capture(t, n), (t.f &
|
|
1177
|
-
const
|
|
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 &
|
|
1176
|
+
(t.f & L) !== 0 && ln(i), an(i);
|
|
1182
1177
|
}
|
|
1183
|
-
t.wv =
|
|
1178
|
+
t.wv = Fr(), Sr(t, L), y !== null && (y.f & R) !== 0 && (y.f & (xe | Oe)) === 0 && (G === null ? Us([t]) : G.push(t)), !r.is_fork && en.size > 0 && !xr && xs();
|
|
1184
1179
|
}
|
|
1185
1180
|
return e;
|
|
1186
1181
|
}
|
|
1187
|
-
function
|
|
1188
|
-
|
|
1189
|
-
for (const t of
|
|
1190
|
-
(t.f &
|
|
1191
|
-
|
|
1182
|
+
function xs() {
|
|
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
|
-
|
|
1189
|
+
j(t, t.v + 1);
|
|
1195
1190
|
}
|
|
1196
|
-
function
|
|
1191
|
+
function Sr(t, e) {
|
|
1197
1192
|
var n = t.reactions;
|
|
1198
1193
|
if (n !== null)
|
|
1199
|
-
for (var r = n.length,
|
|
1200
|
-
var
|
|
1201
|
-
if (o &&
|
|
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
|
-
|
|
1199
|
+
s
|
|
1205
1200
|
);
|
|
1206
|
-
|
|
1207
|
-
} else o && ((a &
|
|
1201
|
+
re?.delete(l), (a & ze) === 0 && (a & Q && (s.f |= ze), Sr(l, se));
|
|
1202
|
+
} else o && ((a & ve) !== 0 && de !== null && de.add(
|
|
1208
1203
|
/** @type {Effect} */
|
|
1209
|
-
|
|
1210
|
-
),
|
|
1204
|
+
s
|
|
1205
|
+
), le(
|
|
1211
1206
|
/** @type {Effect} */
|
|
1212
|
-
|
|
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 =
|
|
1220
|
-
if (e !==
|
|
1214
|
+
const e = Xi(t);
|
|
1215
|
+
if (e !== Yi && e !== Zi)
|
|
1221
1216
|
return t;
|
|
1222
|
-
var n = /* @__PURE__ */ new Map(), r =
|
|
1223
|
-
if (Ce ===
|
|
1217
|
+
var n = /* @__PURE__ */ new Map(), r = Bi(t), i = /* @__PURE__ */ V(0), s = Ce, a = (o) => {
|
|
1218
|
+
if (Ce === s)
|
|
1224
1219
|
return o();
|
|
1225
|
-
var l =
|
|
1226
|
-
|
|
1220
|
+
var l = k, u = Ce;
|
|
1221
|
+
te(null), Yn(s);
|
|
1227
1222
|
var c = o();
|
|
1228
|
-
return
|
|
1223
|
+
return te(l), Yn(u), c;
|
|
1229
1224
|
};
|
|
1230
|
-
return r && n.set("length", /* @__PURE__ */
|
|
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) &&
|
|
1233
|
+
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && ts();
|
|
1239
1234
|
var c = n.get(l);
|
|
1240
1235
|
return c === void 0 ? a(() => {
|
|
1241
|
-
var h = /* @__PURE__ */
|
|
1236
|
+
var h = /* @__PURE__ */ V(u.value);
|
|
1242
1237
|
return n.set(l, h), h;
|
|
1243
|
-
}) :
|
|
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__ */
|
|
1250
|
-
n.set(l, c), at(
|
|
1244
|
+
const c = a(() => /* @__PURE__ */ V(C));
|
|
1245
|
+
n.set(l, c), at(i);
|
|
1251
1246
|
}
|
|
1252
1247
|
} else
|
|
1253
|
-
|
|
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 ||
|
|
1261
|
-
var d = tt(h ? o[l] :
|
|
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 ===
|
|
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 !==
|
|
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 !==
|
|
1290
|
-
if (u !== void 0 ||
|
|
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]) :
|
|
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 ===
|
|
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 ?
|
|
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 ||
|
|
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 !==
|
|
1307
|
+
f = h.v !== C;
|
|
1313
1308
|
var v = a(() => tt(u));
|
|
1314
|
-
|
|
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
|
|
1314
|
+
var $ = (
|
|
1320
1315
|
/** @type {Source<number>} */
|
|
1321
1316
|
n.get("length")
|
|
1322
|
-
),
|
|
1323
|
-
Number.isInteger(
|
|
1317
|
+
), X = Number(l);
|
|
1318
|
+
Number.isInteger(X) && X >= $.v && j($, X + 1);
|
|
1324
1319
|
}
|
|
1325
|
-
at(
|
|
1320
|
+
at(i);
|
|
1326
1321
|
}
|
|
1327
1322
|
return !0;
|
|
1328
1323
|
},
|
|
1329
1324
|
ownKeys(o) {
|
|
1330
|
-
E(
|
|
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 !==
|
|
1328
|
+
return f === void 0 || f.v !== C;
|
|
1334
1329
|
});
|
|
1335
1330
|
for (var [u, c] of n)
|
|
1336
|
-
c.v !==
|
|
1331
|
+
c.v !== C && !(u in o) && l.push(u);
|
|
1337
1332
|
return l;
|
|
1338
1333
|
},
|
|
1339
1334
|
setPrototypeOf() {
|
|
1340
|
-
|
|
1335
|
+
ns();
|
|
1341
1336
|
}
|
|
1342
1337
|
}
|
|
1343
1338
|
);
|
|
1344
1339
|
}
|
|
1345
|
-
var
|
|
1346
|
-
function
|
|
1347
|
-
if (
|
|
1348
|
-
|
|
1340
|
+
var Wn, Pr, Tr, Ir;
|
|
1341
|
+
function Ss() {
|
|
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
|
-
|
|
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
|
|
1348
|
+
function Ar(t = "") {
|
|
1354
1349
|
return document.createTextNode(t);
|
|
1355
1350
|
}
|
|
1356
1351
|
// @__NO_SIDE_EFFECTS__
|
|
1357
|
-
function
|
|
1352
|
+
function Tt(t) {
|
|
1358
1353
|
return (
|
|
1359
1354
|
/** @type {TemplateNode | null} */
|
|
1360
|
-
|
|
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
|
-
|
|
1362
|
+
Ir.call(t)
|
|
1368
1363
|
);
|
|
1369
1364
|
}
|
|
1370
|
-
function
|
|
1371
|
-
return /* @__PURE__ */
|
|
1365
|
+
function Ps(t, e) {
|
|
1366
|
+
return /* @__PURE__ */ Tt(t);
|
|
1372
1367
|
}
|
|
1373
|
-
function
|
|
1368
|
+
function Ts(t, e = !1) {
|
|
1374
1369
|
{
|
|
1375
|
-
var n = /* @__PURE__ */
|
|
1370
|
+
var n = /* @__PURE__ */ Tt(t);
|
|
1376
1371
|
return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Rt(n) : n;
|
|
1377
1372
|
}
|
|
1378
1373
|
}
|
|
1379
|
-
function
|
|
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
|
|
1381
|
+
function Is(t, e, n) {
|
|
1387
1382
|
return (
|
|
1388
1383
|
/** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */
|
|
1389
|
-
document.createElementNS(
|
|
1384
|
+
document.createElementNS(os, t, void 0)
|
|
1390
1385
|
);
|
|
1391
1386
|
}
|
|
1392
|
-
function
|
|
1393
|
-
var e =
|
|
1394
|
-
|
|
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
|
-
|
|
1393
|
+
te(e), ce(n);
|
|
1399
1394
|
}
|
|
1400
1395
|
}
|
|
1401
|
-
function
|
|
1396
|
+
function As(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
|
|
1406
|
-
var r =
|
|
1400
|
+
function ge(t, e, n) {
|
|
1401
|
+
var r = y;
|
|
1407
1402
|
r !== null && (r.f & ye) !== 0 && (t |= ye);
|
|
1408
|
-
var
|
|
1409
|
-
ctx:
|
|
1403
|
+
var i = {
|
|
1404
|
+
ctx: ae,
|
|
1410
1405
|
deps: null,
|
|
1411
1406
|
nodes: null,
|
|
1412
|
-
f: t |
|
|
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(
|
|
1421
|
+
Je(i);
|
|
1427
1422
|
} catch (o) {
|
|
1428
|
-
throw
|
|
1423
|
+
throw ue(i), o;
|
|
1429
1424
|
}
|
|
1430
|
-
else e !== null &&
|
|
1431
|
-
var
|
|
1432
|
-
if (n &&
|
|
1433
|
-
(
|
|
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 && As(s, r), k !== null && (k.f & D) !== 0 && (t & Oe) === 0)) {
|
|
1434
1429
|
var a = (
|
|
1435
1430
|
/** @type {Derived} */
|
|
1436
|
-
|
|
1431
|
+
k
|
|
1437
1432
|
);
|
|
1438
|
-
(a.effects ??= []).push(
|
|
1433
|
+
(a.effects ??= []).push(s);
|
|
1439
1434
|
}
|
|
1440
|
-
return
|
|
1435
|
+
return i;
|
|
1441
1436
|
}
|
|
1442
|
-
function
|
|
1443
|
-
return
|
|
1437
|
+
function un() {
|
|
1438
|
+
return k !== null && !ie;
|
|
1444
1439
|
}
|
|
1445
|
-
function
|
|
1446
|
-
const e =
|
|
1447
|
-
return
|
|
1440
|
+
function Ns(t) {
|
|
1441
|
+
const e = ge(At, null, !1);
|
|
1442
|
+
return S(e, R), e.teardown = t, e;
|
|
1448
1443
|
}
|
|
1449
|
-
function
|
|
1450
|
-
return
|
|
1444
|
+
function Cs(t) {
|
|
1445
|
+
return ge(lt | Ki, t, !1);
|
|
1451
1446
|
}
|
|
1452
|
-
function
|
|
1453
|
-
|
|
1454
|
-
const e =
|
|
1447
|
+
function Rs(t) {
|
|
1448
|
+
Me.ensure();
|
|
1449
|
+
const e = ge(Oe | Ke, t, !0);
|
|
1455
1450
|
return (n = {}) => new Promise((r) => {
|
|
1456
1451
|
n.outro ? Et(e, () => {
|
|
1457
|
-
|
|
1458
|
-
}) : (
|
|
1452
|
+
ue(e), r(void 0);
|
|
1453
|
+
}) : (ue(e), r(void 0));
|
|
1459
1454
|
});
|
|
1460
1455
|
}
|
|
1461
|
-
function
|
|
1462
|
-
return
|
|
1456
|
+
function Ds(t) {
|
|
1457
|
+
return ge(lt, t, !1);
|
|
1463
1458
|
}
|
|
1464
|
-
function
|
|
1465
|
-
return
|
|
1459
|
+
function zs(t) {
|
|
1460
|
+
return ge(nn | Ke, t, !0);
|
|
1466
1461
|
}
|
|
1467
|
-
function
|
|
1468
|
-
return
|
|
1462
|
+
function Cr(t, e = 0) {
|
|
1463
|
+
return ge(At | e, t, !0);
|
|
1469
1464
|
}
|
|
1470
|
-
function
|
|
1471
|
-
|
|
1472
|
-
|
|
1465
|
+
function Rr(t, e = [], n = [], r = []) {
|
|
1466
|
+
ws(r, e, n, (i) => {
|
|
1467
|
+
ge(At, () => t(...i.map(E)), !0);
|
|
1473
1468
|
});
|
|
1474
1469
|
}
|
|
1475
|
-
function
|
|
1476
|
-
var n =
|
|
1470
|
+
function Os(t, e = 0) {
|
|
1471
|
+
var n = ge(ve | e, t, !0);
|
|
1477
1472
|
return n;
|
|
1478
1473
|
}
|
|
1479
|
-
function
|
|
1480
|
-
return
|
|
1474
|
+
function Te(t) {
|
|
1475
|
+
return ge(xe | Ke, t, !0);
|
|
1481
1476
|
}
|
|
1482
|
-
function
|
|
1477
|
+
function Dr(t) {
|
|
1483
1478
|
var e = t.teardown;
|
|
1484
1479
|
if (e !== null) {
|
|
1485
|
-
const n =
|
|
1486
|
-
|
|
1480
|
+
const n = Xe, r = k;
|
|
1481
|
+
qn(!0), te(null);
|
|
1487
1482
|
try {
|
|
1488
1483
|
e.call(null);
|
|
1489
1484
|
} finally {
|
|
1490
|
-
|
|
1485
|
+
qn(n), te(r);
|
|
1491
1486
|
}
|
|
1492
1487
|
}
|
|
1493
1488
|
}
|
|
1494
|
-
function
|
|
1489
|
+
function cn(t, e = !1) {
|
|
1495
1490
|
var n = t.first;
|
|
1496
1491
|
for (t.first = t.last = null; n !== null; ) {
|
|
1497
|
-
const
|
|
1498
|
-
|
|
1499
|
-
|
|
1492
|
+
const i = n.ac;
|
|
1493
|
+
i !== null && Nr(() => {
|
|
1494
|
+
i.abort(Ie);
|
|
1500
1495
|
});
|
|
1501
1496
|
var r = n.next;
|
|
1502
|
-
(n.f &
|
|
1497
|
+
(n.f & Oe) !== 0 ? n.parent = null : ue(n, e), n = r;
|
|
1503
1498
|
}
|
|
1504
1499
|
}
|
|
1505
|
-
function
|
|
1500
|
+
function Ls(t) {
|
|
1506
1501
|
for (var e = t.first; e !== null; ) {
|
|
1507
1502
|
var n = e.next;
|
|
1508
|
-
(e.f &
|
|
1503
|
+
(e.f & xe) === 0 && ue(e), e = n;
|
|
1509
1504
|
}
|
|
1510
1505
|
}
|
|
1511
|
-
function
|
|
1506
|
+
function ue(t, e = !0) {
|
|
1512
1507
|
var n = !1;
|
|
1513
|
-
(e || (t.f &
|
|
1508
|
+
(e || (t.f & dr) !== 0) && t.nodes !== null && t.nodes.end !== null && (Fs(
|
|
1514
1509
|
t.nodes.start,
|
|
1515
1510
|
/** @type {TemplateNode} */
|
|
1516
1511
|
t.nodes.end
|
|
1517
|
-
), n = !0),
|
|
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
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
var
|
|
1524
|
-
|
|
1515
|
+
for (const s of r)
|
|
1516
|
+
s.stop();
|
|
1517
|
+
Dr(t);
|
|
1518
|
+
var i = t.parent;
|
|
1519
|
+
i !== null && i.first !== null && zr(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null;
|
|
1525
1520
|
}
|
|
1526
|
-
function
|
|
1521
|
+
function Fs(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
|
|
1527
|
+
function zr(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
|
-
|
|
1539
|
-
var
|
|
1540
|
-
n &&
|
|
1541
|
-
},
|
|
1542
|
-
if (
|
|
1543
|
-
var a = () => --
|
|
1533
|
+
Or(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
|
-
|
|
1542
|
+
i();
|
|
1548
1543
|
}
|
|
1549
|
-
function
|
|
1544
|
+
function Or(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
|
|
1557
|
-
var
|
|
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
|
-
(
|
|
1561
|
-
|
|
1555
|
+
(i.f & xe) !== 0 && (t.f & ve) !== 0;
|
|
1556
|
+
Or(i, e, a ? n : !1), i = s;
|
|
1562
1557
|
}
|
|
1563
1558
|
}
|
|
1564
1559
|
}
|
|
1565
|
-
function
|
|
1560
|
+
function $s(t, e) {
|
|
1566
1561
|
if (t.nodes)
|
|
1567
1562
|
for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) {
|
|
1568
|
-
var
|
|
1569
|
-
e.append(n), n =
|
|
1563
|
+
var i = n === r ? null : /* @__PURE__ */ Rt(n);
|
|
1564
|
+
e.append(n), n = i;
|
|
1570
1565
|
}
|
|
1571
1566
|
}
|
|
1572
|
-
let xt = !1,
|
|
1573
|
-
function
|
|
1574
|
-
|
|
1567
|
+
let xt = !1, Xe = !1;
|
|
1568
|
+
function qn(t) {
|
|
1569
|
+
Xe = t;
|
|
1575
1570
|
}
|
|
1576
|
-
let
|
|
1577
|
-
function
|
|
1578
|
-
|
|
1571
|
+
let k = null, ie = !1;
|
|
1572
|
+
function te(t) {
|
|
1573
|
+
k = t;
|
|
1579
1574
|
}
|
|
1580
|
-
let
|
|
1575
|
+
let y = null;
|
|
1581
1576
|
function ce(t) {
|
|
1582
|
-
|
|
1577
|
+
y = t;
|
|
1583
1578
|
}
|
|
1584
|
-
let
|
|
1585
|
-
function
|
|
1586
|
-
|
|
1579
|
+
let ee = null;
|
|
1580
|
+
function Vs(t) {
|
|
1581
|
+
k !== null && (ee === null ? ee = [t] : ee.push(t));
|
|
1587
1582
|
}
|
|
1588
|
-
let
|
|
1589
|
-
function
|
|
1590
|
-
|
|
1583
|
+
let U = null, Y = 0, G = null;
|
|
1584
|
+
function Us(t) {
|
|
1585
|
+
G = t;
|
|
1591
1586
|
}
|
|
1592
|
-
let
|
|
1593
|
-
function
|
|
1587
|
+
let Lr = 1, Ae = 0, Ce = Ae;
|
|
1588
|
+
function Yn(t) {
|
|
1594
1589
|
Ce = t;
|
|
1595
1590
|
}
|
|
1596
|
-
function
|
|
1597
|
-
return ++
|
|
1591
|
+
function Fr() {
|
|
1592
|
+
return ++Lr;
|
|
1598
1593
|
}
|
|
1599
1594
|
function ht(t) {
|
|
1600
1595
|
var e = t.f;
|
|
1601
|
-
if ((e &
|
|
1596
|
+
if ((e & L) !== 0)
|
|
1602
1597
|
return !0;
|
|
1603
|
-
if (e &
|
|
1598
|
+
if (e & D && (t.f &= ~ze), (e & se) !== 0) {
|
|
1604
1599
|
for (var n = (
|
|
1605
1600
|
/** @type {Value[]} */
|
|
1606
1601
|
t.deps
|
|
1607
|
-
), r = n.length,
|
|
1608
|
-
var
|
|
1602
|
+
), r = n.length, i = 0; i < r; i++) {
|
|
1603
|
+
var s = n[i];
|
|
1609
1604
|
if (ht(
|
|
1610
1605
|
/** @type {Derived} */
|
|
1611
|
-
|
|
1612
|
-
) &&
|
|
1606
|
+
s
|
|
1607
|
+
) && Mr(
|
|
1613
1608
|
/** @type {Derived} */
|
|
1614
|
-
|
|
1615
|
-
),
|
|
1609
|
+
s
|
|
1610
|
+
), s.wv > t.wv)
|
|
1616
1611
|
return !0;
|
|
1617
1612
|
}
|
|
1618
|
-
(e &
|
|
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
|
-
|
|
1615
|
+
re === null && S(t, R);
|
|
1621
1616
|
}
|
|
1622
1617
|
return !1;
|
|
1623
1618
|
}
|
|
1624
|
-
function
|
|
1619
|
+
function $r(t, e, n = !0) {
|
|
1625
1620
|
var r = t.reactions;
|
|
1626
|
-
if (r !== null && !(
|
|
1627
|
-
for (var
|
|
1628
|
-
var
|
|
1629
|
-
(
|
|
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
|
-
|
|
1626
|
+
s,
|
|
1632
1627
|
e,
|
|
1633
1628
|
!1
|
|
1634
|
-
) : e ===
|
|
1629
|
+
) : e === s && (n ? S(s, L) : (s.f & R) !== 0 && S(s, se), le(
|
|
1635
1630
|
/** @type {Effect} */
|
|
1636
|
-
|
|
1631
|
+
s
|
|
1637
1632
|
));
|
|
1638
1633
|
}
|
|
1639
1634
|
}
|
|
1640
|
-
function
|
|
1641
|
-
var e =
|
|
1642
|
-
|
|
1643
|
-
null, Y = 0,
|
|
1644
|
-
t.ac.abort(
|
|
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 | Oe)) === 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 |=
|
|
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 =
|
|
1654
|
-
if (
|
|
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 +
|
|
1658
|
-
f[Y + 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 =
|
|
1661
|
-
if (
|
|
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 (
|
|
1660
|
+
if (vr() && G !== null && !ie && f !== null && (t.f & (D | se | L)) === 0)
|
|
1666
1661
|
for (m = 0; m < /** @type {Source[]} */
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1662
|
+
G.length; m++)
|
|
1663
|
+
$r(
|
|
1664
|
+
G[m],
|
|
1670
1665
|
/** @type {Effect} */
|
|
1671
1666
|
t
|
|
1672
1667
|
);
|
|
1673
|
-
if (
|
|
1674
|
-
if (Ae++,
|
|
1668
|
+
if (i !== null && i !== t) {
|
|
1669
|
+
if (Ae++, i.deps !== null)
|
|
1675
1670
|
for (let v = 0; v < n; v += 1)
|
|
1676
|
-
|
|
1671
|
+
i.deps[v].rv = Ae;
|
|
1677
1672
|
if (e !== null)
|
|
1678
1673
|
for (const v of e)
|
|
1679
1674
|
v.rv = Ae;
|
|
1680
|
-
|
|
1681
|
-
|
|
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
|
|
1680
|
+
return gr(v);
|
|
1686
1681
|
} finally {
|
|
1687
|
-
t.f ^=
|
|
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
|
|
1685
|
+
function js(t, e) {
|
|
1691
1686
|
let n = e.reactions;
|
|
1692
1687
|
if (n !== null) {
|
|
1693
|
-
var r =
|
|
1688
|
+
var r = Wi.call(n, t);
|
|
1694
1689
|
if (r !== -1) {
|
|
1695
|
-
var
|
|
1696
|
-
|
|
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 &
|
|
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
|
-
(
|
|
1703
|
-
var
|
|
1697
|
+
(U === null || !qe.call(U, e))) {
|
|
1698
|
+
var s = (
|
|
1704
1699
|
/** @type {Derived} */
|
|
1705
1700
|
e
|
|
1706
1701
|
);
|
|
1707
|
-
(
|
|
1702
|
+
(s.f & Q) !== 0 && (s.f ^= Q, s.f &= ~ze), an(s), Es(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
|
-
|
|
1709
|
+
js(t, n[r]);
|
|
1715
1710
|
}
|
|
1716
1711
|
function Je(t) {
|
|
1717
1712
|
var e = t.f;
|
|
1718
|
-
if ((e &
|
|
1719
|
-
|
|
1720
|
-
var n =
|
|
1721
|
-
|
|
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 & (
|
|
1724
|
-
var
|
|
1725
|
-
t.teardown = typeof
|
|
1726
|
-
var
|
|
1727
|
-
|
|
1718
|
+
(e & (ve | hr)) !== 0 ? Ls(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 && us && (t.f & L) !== 0 && t.deps;
|
|
1728
1723
|
} finally {
|
|
1729
|
-
xt = r,
|
|
1724
|
+
xt = r, y = n;
|
|
1730
1725
|
}
|
|
1731
1726
|
}
|
|
1732
1727
|
}
|
|
1733
1728
|
function E(t) {
|
|
1734
|
-
var e = t.f, n = (e &
|
|
1735
|
-
if (
|
|
1736
|
-
var r =
|
|
1737
|
-
if (!r && (
|
|
1738
|
-
var
|
|
1739
|
-
if ((
|
|
1740
|
-
t.rv < Ae && (t.rv = Ae,
|
|
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
|
-
(
|
|
1743
|
-
var
|
|
1744
|
-
|
|
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 (
|
|
1749
|
-
return
|
|
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 (
|
|
1750
|
+
if (Xe) {
|
|
1756
1751
|
var o = a.v;
|
|
1757
|
-
return ((a.f &
|
|
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 &
|
|
1760
|
-
ht(a) && (l && (a.f |=
|
|
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 (
|
|
1763
|
-
return
|
|
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
|
|
1769
|
-
if (t.f |=
|
|
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 &
|
|
1766
|
+
(e.reactions ??= []).push(t), (e.f & D) !== 0 && (e.f & Q) === 0 && (Er(
|
|
1772
1767
|
/** @type {Derived} */
|
|
1773
1768
|
e
|
|
1774
|
-
),
|
|
1769
|
+
), Ur(
|
|
1775
1770
|
/** @type {Derived} */
|
|
1776
1771
|
e
|
|
1777
1772
|
));
|
|
1778
1773
|
}
|
|
1779
|
-
function
|
|
1780
|
-
if (t.v ===
|
|
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 (
|
|
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
|
|
1791
|
-
var e =
|
|
1785
|
+
function Br(t) {
|
|
1786
|
+
var e = ie;
|
|
1792
1787
|
try {
|
|
1793
|
-
return
|
|
1788
|
+
return ie = !0, t();
|
|
1794
1789
|
} finally {
|
|
1795
|
-
|
|
1790
|
+
ie = e;
|
|
1796
1791
|
}
|
|
1797
1792
|
}
|
|
1798
|
-
const
|
|
1799
|
-
function
|
|
1800
|
-
return
|
|
1793
|
+
const Bs = ["touchstart", "touchmove"];
|
|
1794
|
+
function Ws(t) {
|
|
1795
|
+
return Bs.includes(t);
|
|
1801
1796
|
}
|
|
1802
|
-
const
|
|
1803
|
-
let
|
|
1804
|
-
function
|
|
1797
|
+
const Hs = /* @__PURE__ */ Symbol("events"), qs = /* @__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,
|
|
1803
|
+
), r = t.type, i = t.composedPath?.() || [], s = (
|
|
1809
1804
|
/** @type {null | Element} */
|
|
1810
|
-
|
|
1805
|
+
i[0] || t.target
|
|
1811
1806
|
);
|
|
1812
|
-
|
|
1813
|
-
var a = 0, o =
|
|
1807
|
+
Xn = t;
|
|
1808
|
+
var a = 0, o = Xn === t && t.__root;
|
|
1814
1809
|
if (o) {
|
|
1815
|
-
var l =
|
|
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 =
|
|
1816
|
+
var u = i.indexOf(e);
|
|
1822
1817
|
if (u === -1)
|
|
1823
1818
|
return;
|
|
1824
1819
|
l <= u && (a = l);
|
|
1825
1820
|
}
|
|
1826
|
-
if (
|
|
1827
|
-
|
|
1828
|
-
|
|
1821
|
+
if (s = /** @type {Element} */
|
|
1822
|
+
i[a] || t.target, s !== e) {
|
|
1823
|
+
qi(t, "currentTarget", {
|
|
1829
1824
|
configurable: !0,
|
|
1830
1825
|
get() {
|
|
1831
|
-
return
|
|
1826
|
+
return s || n;
|
|
1832
1827
|
}
|
|
1833
1828
|
});
|
|
1834
|
-
var c =
|
|
1835
|
-
|
|
1829
|
+
var c = k, h = y;
|
|
1830
|
+
te(null), ce(null);
|
|
1836
1831
|
try {
|
|
1837
|
-
for (var f, d = [];
|
|
1838
|
-
var m =
|
|
1839
|
-
|
|
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 =
|
|
1836
|
+
var v = s[Hs]?.[r];
|
|
1842
1837
|
v != null && (!/** @type {any} */
|
|
1843
|
-
|
|
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 ===
|
|
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
|
-
|
|
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,
|
|
1856
|
+
t.__root = e, delete t.currentTarget, te(c), ce(h);
|
|
1862
1857
|
}
|
|
1863
1858
|
}
|
|
1864
1859
|
}
|
|
1865
|
-
const
|
|
1860
|
+
const Ys = /* @__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
|
|
1867
|
+
function Zs(t) {
|
|
1873
1868
|
return (
|
|
1874
1869
|
/** @type {string} */
|
|
1875
|
-
|
|
1870
|
+
Ys?.createHTML(t) ?? t
|
|
1876
1871
|
);
|
|
1877
1872
|
}
|
|
1878
|
-
function
|
|
1879
|
-
var n =
|
|
1880
|
-
return t = t.replaceAll("<!>", "<!---->"), n.innerHTML = e ?
|
|
1873
|
+
function Xs(t, e = !1) {
|
|
1874
|
+
var n = Is("template");
|
|
1875
|
+
return t = t.replaceAll("<!>", "<!---->"), n.innerHTML = e ? Zs(t) : t, n.content;
|
|
1881
1876
|
}
|
|
1882
|
-
function
|
|
1877
|
+
function Gn(t, e) {
|
|
1883
1878
|
var n = (
|
|
1884
1879
|
/** @type {Effect} */
|
|
1885
|
-
|
|
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
|
|
1891
|
-
var n = (e &
|
|
1885
|
+
function Wr(t, e) {
|
|
1886
|
+
var n = (e & ss) !== 0, r = (e & as) !== 0, i, s = !t.startsWith("<!>");
|
|
1892
1887
|
return () => {
|
|
1893
|
-
|
|
1894
|
-
/* @__PURE__ */
|
|
1888
|
+
i === void 0 && (i = Xs(s ? t : "<!>" + t, !0), n || (i = /** @type {TemplateNode} */
|
|
1889
|
+
/* @__PURE__ */ Tt(i)));
|
|
1895
1890
|
var a = (
|
|
1896
1891
|
/** @type {TemplateNode} */
|
|
1897
|
-
r ||
|
|
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__ */
|
|
1897
|
+
/* @__PURE__ */ Tt(a)
|
|
1903
1898
|
), l = (
|
|
1904
1899
|
/** @type {TemplateNode} */
|
|
1905
1900
|
a.lastChild
|
|
1906
1901
|
);
|
|
1907
|
-
|
|
1902
|
+
Gn(o, l);
|
|
1908
1903
|
} else
|
|
1909
|
-
|
|
1904
|
+
Gn(a, a);
|
|
1910
1905
|
return a;
|
|
1911
1906
|
};
|
|
1912
1907
|
}
|
|
1913
|
-
function
|
|
1908
|
+
function Hr(t, e) {
|
|
1914
1909
|
t !== null && t.before(
|
|
1915
1910
|
/** @type {Node} */
|
|
1916
1911
|
e
|
|
1917
1912
|
);
|
|
1918
1913
|
}
|
|
1919
|
-
function
|
|
1920
|
-
return
|
|
1914
|
+
function fn(t, e) {
|
|
1915
|
+
return Js(t, e);
|
|
1921
1916
|
}
|
|
1922
|
-
const
|
|
1923
|
-
function
|
|
1924
|
-
|
|
1917
|
+
const yt = /* @__PURE__ */ new Map();
|
|
1918
|
+
function Js(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) {
|
|
1919
|
+
Ss();
|
|
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 =
|
|
1931
|
-
for (const
|
|
1932
|
-
var v =
|
|
1933
|
-
v === void 0 && (v = /* @__PURE__ */ new Map(),
|
|
1925
|
+
var m = Ws(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 ? (
|
|
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(
|
|
1941
|
-
var u = void 0, c =
|
|
1942
|
-
var h = n ?? e.appendChild(
|
|
1943
|
-
return
|
|
1935
|
+
l(Hi(qs)), Zn.add(l);
|
|
1936
|
+
var u = void 0, c = Rs(() => {
|
|
1937
|
+
var h = n ?? e.appendChild(Ar());
|
|
1938
|
+
return vs(
|
|
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
|
-
|
|
1946
|
+
rn({});
|
|
1952
1947
|
var d = (
|
|
1953
1948
|
/** @type {ComponentContext} */
|
|
1954
|
-
|
|
1949
|
+
ae
|
|
1955
1950
|
);
|
|
1956
|
-
|
|
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
|
-
|
|
1958
|
+
yt.get(v)
|
|
1964
1959
|
), m = (
|
|
1965
1960
|
/** @type {number} */
|
|
1966
1961
|
d.get(f)
|
|
1967
1962
|
);
|
|
1968
|
-
--m == 0 ? (v.removeEventListener(f,
|
|
1963
|
+
--m == 0 ? (v.removeEventListener(f, Jn), d.delete(f), d.size === 0 && yt.delete(v)) : d.set(f, m);
|
|
1969
1964
|
}
|
|
1970
|
-
|
|
1965
|
+
Zn.delete(l), h !== n && h.parentNode?.removeChild(h);
|
|
1971
1966
|
};
|
|
1972
1967
|
});
|
|
1973
|
-
return
|
|
1968
|
+
return Gs.set(u, c), u;
|
|
1974
1969
|
}
|
|
1975
|
-
let
|
|
1976
|
-
function
|
|
1970
|
+
let Gs = /* @__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
|
|
1981
|
-
for (e = 0; e <
|
|
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
|
|
1986
|
-
for (var t, e, n = 0, r = "",
|
|
1980
|
+
function Ks() {
|
|
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
|
|
1990
|
-
return typeof t == "object" ?
|
|
1984
|
+
function Yr(t) {
|
|
1985
|
+
return typeof t == "object" ? Ks(t) : t ?? "";
|
|
1991
1986
|
}
|
|
1992
|
-
function
|
|
1987
|
+
function Qs(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
|
|
1991
|
+
function Kn(t, e = !1) {
|
|
1997
1992
|
var n = e ? " !important;" : ";", r = "";
|
|
1998
|
-
for (var
|
|
1999
|
-
var
|
|
2000
|
-
|
|
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
|
|
1999
|
+
function ea(t, e) {
|
|
2005
2000
|
if (e) {
|
|
2006
|
-
var n = "", r,
|
|
2007
|
-
return Array.isArray(e) ? (r = e[0],
|
|
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
|
|
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 =
|
|
2009
|
+
var o = Qs(n, r);
|
|
2015
2010
|
o == null ? t.removeAttribute("class") : t.className = o, t.__className = n;
|
|
2016
2011
|
}
|
|
2017
|
-
return
|
|
2012
|
+
return s;
|
|
2018
2013
|
}
|
|
2019
|
-
function
|
|
2020
|
-
for (var
|
|
2021
|
-
var
|
|
2022
|
-
e[
|
|
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
|
|
2027
|
-
if (
|
|
2028
|
-
var
|
|
2029
|
-
|
|
2030
|
-
} else r && (Array.isArray(r) ? (
|
|
2021
|
+
var i = t.__style;
|
|
2022
|
+
if (i !== e) {
|
|
2023
|
+
var s = ea(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
|
|
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
|
|
2038
|
-
var
|
|
2039
|
-
return
|
|
2040
|
-
|
|
2041
|
-
t !== n(...
|
|
2032
|
+
return Ds(() => {
|
|
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
|
-
|
|
2040
|
+
s && Qn(n(...s), t) && e(null, ...s);
|
|
2046
2041
|
});
|
|
2047
2042
|
};
|
|
2048
2043
|
}), t;
|
|
2049
2044
|
}
|
|
2050
|
-
class
|
|
2045
|
+
class hn {
|
|
2051
2046
|
div;
|
|
2052
2047
|
marker;
|
|
2053
|
-
constructor(e, n, r,
|
|
2054
|
-
this.div = document.createElement("div"), this.marker = e.createMarker(this.div, n, r,
|
|
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
|
|
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
|
|
2079
|
-
typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(
|
|
2080
|
-
function
|
|
2073
|
+
const ta = "5";
|
|
2074
|
+
typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(ta);
|
|
2075
|
+
function Xr(t) {
|
|
2081
2076
|
return -0.5 * (Math.cos(Math.PI * t) - 1);
|
|
2082
2077
|
}
|
|
2083
|
-
class
|
|
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),
|
|
2112
|
-
this.time.start = n, this.time.end = n + this.time.span * Math.sqrt(r /
|
|
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
|
|
2128
|
-
function
|
|
2129
|
-
|
|
2130
|
-
let n = e.id, r = e.style, s = e.
|
|
2131
|
-
setDisplayed:
|
|
2132
|
-
getDisplayed:
|
|
2133
|
-
setSuppressed:
|
|
2134
|
-
setCollapsed:
|
|
2135
|
-
getCollapsed:
|
|
2136
|
-
setScale:
|
|
2122
|
+
var na = /* @__PURE__ */ Wr("<div></div>");
|
|
2123
|
+
function ra(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
|
|
2139
|
-
return
|
|
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
|
-
|
|
2156
|
-
|
|
2136
|
+
let u, c = s.width, h = s.height, f = s.padding, d = i?.background ?? Ui, m = i?.radius ?? Li, v = i?.shadow ?? Fi, 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
|
-
|
|
2159
|
-
|
|
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
|
|
2163
|
-
function
|
|
2164
|
-
|
|
2143
|
+
let we = /* @__PURE__ */ V(!0);
|
|
2144
|
+
function ke(_) {
|
|
2145
|
+
_ != E(we) && (j(we, _, !0), _ && (ne = $e, q.set($e)));
|
|
2165
2146
|
}
|
|
2166
|
-
|
|
2167
|
-
|
|
2147
|
+
let fe = /* @__PURE__ */ V(!0);
|
|
2148
|
+
function Pe(_) {
|
|
2149
|
+
_ != E(fe) && (j(fe, _, !0), q.target(E(fe) ? 0 : ne));
|
|
2168
2150
|
}
|
|
2169
|
-
|
|
2170
|
-
|
|
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:
|
|
2174
|
-
easing:
|
|
2175
|
-
callback:
|
|
2158
|
+
timespan: Ri,
|
|
2159
|
+
easing: Xr,
|
|
2160
|
+
callback: dt
|
|
2176
2161
|
});
|
|
2177
|
-
function
|
|
2178
|
-
|
|
2162
|
+
function Dt(_) {
|
|
2163
|
+
ne = _, q.target(_);
|
|
2179
2164
|
}
|
|
2180
|
-
function
|
|
2181
|
-
|
|
2165
|
+
function dt(_) {
|
|
2166
|
+
u.style.scale = _.toString(), u.style.filter = `brightness(${he(_)})`;
|
|
2182
2167
|
}
|
|
2183
|
-
function
|
|
2184
|
-
return 0.25 + 0.75 *
|
|
2168
|
+
function he(_) {
|
|
2169
|
+
return 0.25 + 0.75 * _;
|
|
2185
2170
|
}
|
|
2186
|
-
var
|
|
2187
|
-
let
|
|
2188
|
-
return rt(
|
|
2189
|
-
(
|
|
2190
|
-
|
|
2191
|
-
|
|
2171
|
+
var zt = { invoke: l }, Le = na();
|
|
2172
|
+
let Fe;
|
|
2173
|
+
return rt(Le, (_) => u = _, () => u), Rr(
|
|
2174
|
+
(_) => {
|
|
2175
|
+
Zr(
|
|
2176
|
+
Le,
|
|
2192
2177
|
1,
|
|
2193
|
-
|
|
2178
|
+
Yr([
|
|
2194
2179
|
"pin",
|
|
2195
|
-
E(
|
|
2196
|
-
E(
|
|
2180
|
+
E(M) && "displayed",
|
|
2181
|
+
E(we) && "suppressed"
|
|
2197
2182
|
]),
|
|
2198
2183
|
"svelte-10kxbrm"
|
|
2199
|
-
),
|
|
2184
|
+
), Fe = nt(Le, "", Fe, _);
|
|
2200
2185
|
},
|
|
2201
2186
|
[
|
|
2202
2187
|
() => ({
|
|
2203
|
-
width: `${
|
|
2204
|
-
height: `${
|
|
2205
|
-
|
|
2206
|
-
"border-
|
|
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
|
-
"
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
filter: `brightness(${mt(Fe)})`
|
|
2193
|
+
"box-shadow": v,
|
|
2194
|
+
scale: $e,
|
|
2195
|
+
filter: `brightness(${he($e)})`
|
|
2212
2196
|
})
|
|
2213
2197
|
]
|
|
2214
|
-
),
|
|
2198
|
+
), Hr(t, Le), sn(zt);
|
|
2215
2199
|
}
|
|
2216
|
-
class
|
|
2200
|
+
class ia extends pt {
|
|
2217
2201
|
width;
|
|
2218
2202
|
height;
|
|
2219
2203
|
zoom;
|
|
2220
2204
|
component;
|
|
2221
|
-
constructor(e, n) {
|
|
2222
|
-
super(
|
|
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(ra, {
|
|
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 *
|
|
2212
|
+
return Number.isNaN(this.zoom) ? this.rank : Math.round(-this.zoom * cr) + zi;
|
|
2243
2213
|
}
|
|
2244
2214
|
}
|
|
2245
|
-
class
|
|
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
|
|
2268
|
-
if (this.speed.current +=
|
|
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,204 +2266,186 @@ class Xn {
|
|
|
2296
2266
|
return performance.now() > this.animationEnd;
|
|
2297
2267
|
}
|
|
2298
2268
|
}
|
|
2299
|
-
function
|
|
2269
|
+
function tn(t, e, n) {
|
|
2300
2270
|
if (t <= 0 || e <= 0) return { x: 0, y: 0 };
|
|
2301
|
-
let r = t / 2,
|
|
2302
|
-
return n < 180 ? n < 90 ? n < a ? { x: 0, y:
|
|
2303
|
-
}
|
|
2304
|
-
var
|
|
2305
|
-
function
|
|
2306
|
-
|
|
2307
|
-
let n = e.id, r = e.style, s = e.
|
|
2308
|
-
setDisplayed:
|
|
2309
|
-
getDisplayed:
|
|
2310
|
-
setCollapsed:
|
|
2311
|
-
getCollapsed:
|
|
2312
|
-
getExpanded:
|
|
2313
|
-
setAngle:
|
|
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 };
|
|
2273
|
+
}
|
|
2274
|
+
var sa = /* @__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 = {
|
|
2278
|
+
setDisplayed: zt,
|
|
2279
|
+
getDisplayed: Le,
|
|
2280
|
+
setCollapsed: _,
|
|
2281
|
+
getCollapsed: hi,
|
|
2282
|
+
getExpanded: pi,
|
|
2283
|
+
setAngle: mi
|
|
2314
2284
|
};
|
|
2315
|
-
function
|
|
2316
|
-
return
|
|
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;
|
|
2331
2287
|
}
|
|
2332
|
-
|
|
2333
|
-
|
|
2288
|
+
let u = s.width + 2 * s.padding, c = s.height + 2 * s.padding, h = s.padding, f, d = i?.filter ?? Vi, 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 zt(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()));
|
|
2334
2291
|
}
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2292
|
+
function Le() {
|
|
2293
|
+
return E(he);
|
|
2294
|
+
}
|
|
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
|
|
2340
|
-
return E(
|
|
2299
|
+
function hi() {
|
|
2300
|
+
return E(he) ? mt.expired() : !0;
|
|
2341
2301
|
}
|
|
2342
|
-
function
|
|
2343
|
-
return E(
|
|
2302
|
+
function pi() {
|
|
2303
|
+
return E(he) ? mt.expired() : !1;
|
|
2344
2304
|
}
|
|
2345
|
-
let
|
|
2305
|
+
let mt = new Jr({
|
|
2346
2306
|
value: 0,
|
|
2347
2307
|
min: 0,
|
|
2348
2308
|
max: 1,
|
|
2349
|
-
timespan:
|
|
2350
|
-
easing:
|
|
2351
|
-
callback:
|
|
2309
|
+
timespan: Di,
|
|
2310
|
+
easing: Xr,
|
|
2311
|
+
callback: di
|
|
2352
2312
|
});
|
|
2353
|
-
function
|
|
2354
|
-
|
|
2313
|
+
function di(g) {
|
|
2314
|
+
f.style.opacity = `${g}`, m.style.scale = `${g}`, X.style.scale = `${g}`, J.style.scale = `${g}`;
|
|
2355
2315
|
}
|
|
2356
|
-
let
|
|
2357
|
-
value: -
|
|
2358
|
-
min: -
|
|
2316
|
+
let vt = NaN, Ot = /* @__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:
|
|
2363
|
-
}),
|
|
2364
|
-
value: -
|
|
2365
|
-
min: -
|
|
2322
|
+
callback: vi
|
|
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:
|
|
2329
|
+
callback: gi
|
|
2370
2330
|
});
|
|
2371
|
-
function
|
|
2372
|
-
if (Number.isNaN(
|
|
2373
|
-
|
|
2331
|
+
function mi(g, gt) {
|
|
2332
|
+
if (Number.isNaN(g)) {
|
|
2333
|
+
vt = NaN, j(Ot, !1);
|
|
2374
2334
|
return;
|
|
2375
2335
|
}
|
|
2376
|
-
if (E(
|
|
2377
|
-
|
|
2378
|
-
const
|
|
2379
|
-
Lt.set(Math.round(
|
|
2336
|
+
if (E(Ot) == !1 || gt == !0) {
|
|
2337
|
+
j(Ot, !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 (
|
|
2383
|
-
|
|
2384
|
-
const
|
|
2385
|
-
Lt.target(Math.round(
|
|
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
|
|
2390
|
-
|
|
2349
|
+
function vi(g) {
|
|
2350
|
+
vn = g, wn();
|
|
2391
2351
|
}
|
|
2392
|
-
function
|
|
2393
|
-
|
|
2352
|
+
function gi(g) {
|
|
2353
|
+
gn = g, wn();
|
|
2394
2354
|
}
|
|
2395
|
-
function
|
|
2396
|
-
const
|
|
2397
|
-
|
|
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, ki = Math.atan2(jt, Ut) / Math.PI * 180 - 45, Bt = Math.sqrt(Ut * Ut + jt * jt), et = Math.min(u, c) / 2, yi = et * Math.SQRT2, Sn = (Bt - et) / (yi - et), Pn = 15, Tn = Pn + Sn * (22.5 - Pn), _i = Bt < et ? Bt / et : 1, bi = g + h, Mi = gt + h, In = h * 2 * fe * Sn, An = bi - In * (pe / u), Nn = Mi - In * (Vt / c);
|
|
2357
|
+
m.style.transform = `scale(${_i}) rotate(${ki}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
|
|
2359
|
+
var wi = { invoke: l }, kn = sa(), Qe = Ts(kn);
|
|
2360
|
+
let yn;
|
|
2361
|
+
var $t = Ps(Qe);
|
|
2400
2362
|
let _n;
|
|
2401
|
-
|
|
2363
|
+
rt($t, (g) => m = g, () => m);
|
|
2364
|
+
var bn = Hn($t, 2);
|
|
2402
2365
|
let Mn;
|
|
2403
|
-
rt(
|
|
2404
|
-
var En =
|
|
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, (
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
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: `${
|
|
2417
|
-
height: `${
|
|
2418
|
-
"border-radius": `${
|
|
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
|
-
}),
|
|
2385
|
+
}), Hr(t, kn), sn(wi);
|
|
2426
2386
|
}
|
|
2427
|
-
class
|
|
2387
|
+
class aa extends pt {
|
|
2428
2388
|
width;
|
|
2429
2389
|
height;
|
|
2430
2390
|
zoom;
|
|
2431
2391
|
angle;
|
|
2432
|
-
|
|
2392
|
+
directions;
|
|
2433
2393
|
component;
|
|
2434
|
-
constructor(e, n) {
|
|
2435
|
-
super(
|
|
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.directions = [], 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 *
|
|
2401
|
+
return Number.isNaN(this.zoom) ? this.rank : Math.round(-this.zoom * cr) + Oi;
|
|
2446
2402
|
}
|
|
2447
2403
|
}
|
|
2448
|
-
class
|
|
2404
|
+
class oa extends pt {
|
|
2449
2405
|
width;
|
|
2450
2406
|
height;
|
|
2451
|
-
|
|
2407
|
+
padding;
|
|
2452
2408
|
angle;
|
|
2453
2409
|
component;
|
|
2454
|
-
constructor(e, n) {
|
|
2455
|
-
|
|
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, zn)), 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
|
-
return
|
|
2417
|
+
return zn;
|
|
2467
2418
|
}
|
|
2468
2419
|
}
|
|
2469
|
-
class
|
|
2420
|
+
class la {
|
|
2470
2421
|
id;
|
|
2471
2422
|
state = void 0;
|
|
2472
2423
|
pin;
|
|
2473
2424
|
tooltip;
|
|
2474
2425
|
popup;
|
|
2475
2426
|
constructor(e, n) {
|
|
2476
|
-
|
|
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 ia(e, r, i, s, a, o), this.tooltip = new aa(e, r, i, s, a, l), this.popup = u ? new oa(e, r, i, s, a, u) : void 0;
|
|
2477
2429
|
}
|
|
2478
2430
|
}
|
|
2479
|
-
const
|
|
2480
|
-
class
|
|
2431
|
+
const qt = 4;
|
|
2432
|
+
class ua {
|
|
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 =
|
|
2488
|
-
pinZoomDelta =
|
|
2439
|
+
pinZoomMax = qt;
|
|
2440
|
+
pinZoomDelta = qt;
|
|
2489
2441
|
set configuration(e) {
|
|
2490
|
-
this.pinFade = e?.pin?.fade ?? !0, this.pinZoomMax = e?.pin?.maxZoom ??
|
|
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);
|
|
2494
2446
|
}
|
|
2495
2447
|
update(e, n) {
|
|
2496
|
-
e.zoom = n
|
|
2448
|
+
e.zoom = n?.zoom ?? NaN, e.marker.update(e.zIndex);
|
|
2497
2449
|
}
|
|
2498
2450
|
remove(e) {
|
|
2499
2451
|
e.shown = !0, e.zoom = NaN, e.component.invoke().setCollapsed(!1), e.component.invoke().setSuppressed(!0), e.component.invoke().setDisplayed(!1), e.marker.update(e.zIndex), e.marker.remove(), this.pins.delete(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,
|
|
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
|
-
|
|
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
|
|
2520
|
-
class
|
|
2471
|
+
var ca = (t) => 9;
|
|
2472
|
+
class fa {
|
|
2521
2473
|
// Elements
|
|
2522
2474
|
tooltips = /* @__PURE__ */ new Set();
|
|
2523
2475
|
// Configuration
|
|
@@ -2527,10 +2479,10 @@ class ia {
|
|
|
2527
2479
|
this.update(e, n), this.tooltips.add(e);
|
|
2528
2480
|
}
|
|
2529
2481
|
update(e, n) {
|
|
2530
|
-
n ? (e.zoom = n
|
|
2482
|
+
n ? (e.zoom = n.zoom, e.directions = n.directions) : (e.zoom = NaN, e.directions = []), e.marker.update(e.zIndex);
|
|
2531
2483
|
}
|
|
2532
2484
|
remove(e) {
|
|
2533
|
-
e.shown = !0, e.zoom = NaN, e.angle = NaN, e.
|
|
2485
|
+
e.shown = !0, e.zoom = NaN, e.angle = NaN, e.directions = [], 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);
|
|
2534
2486
|
}
|
|
2535
2487
|
clear() {
|
|
2536
2488
|
this.tooltips.forEach((e) => e.marker.remove()), this.tooltips.clear();
|
|
@@ -2540,16 +2492,16 @@ 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,
|
|
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 (
|
|
2502
|
+
if (s.contains(a.lat, a.lng))
|
|
2551
2503
|
if (Number.isNaN(a.zoom) == !1 && a.shown && a.zoom <= r) {
|
|
2552
|
-
const o = a.
|
|
2504
|
+
const o = a.directions.findLast((l) => l.zoom <= r)?.angle;
|
|
2553
2505
|
if (o == null) throw new Error("Failed to find angle");
|
|
2554
2506
|
a.angle = o, a.component.invoke().setDisplayed(!0), a.component.invoke().setCollapsed(!1), a.component.invoke().setAngle(o), a.marker.insert();
|
|
2555
2507
|
} else
|
|
@@ -2558,7 +2510,7 @@ class ia {
|
|
|
2558
2510
|
a.component.invoke().setDisplayed(!1), a.marker.remove();
|
|
2559
2511
|
}
|
|
2560
2512
|
}
|
|
2561
|
-
class
|
|
2513
|
+
class ha {
|
|
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,
|
|
2581
|
-
let
|
|
2582
|
-
h < d ?
|
|
2583
|
-
let
|
|
2584
|
-
f < m ?
|
|
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
|
|
2595
|
-
|
|
2546
|
+
class pa {
|
|
2547
|
+
provider;
|
|
2596
2548
|
pinManager;
|
|
2597
2549
|
tooltipManager;
|
|
2598
2550
|
popupManager;
|
|
2599
2551
|
elementsStore;
|
|
2600
2552
|
constructor(e) {
|
|
2601
|
-
this.
|
|
2553
|
+
this.provider = e, this.pinManager = new ua(), this.tooltipManager = new fa(), this.popupManager = new ha(), 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.
|
|
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.
|
|
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
|
|
2626
|
-
|
|
2577
|
+
let i = this.elementsStore.get(r.properites.id);
|
|
2578
|
+
i == null && (i = new la(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.
|
|
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
|
|
2652
|
-
function
|
|
2603
|
+
const Kr = '(function(){"use strict";var h=[0,30,60,90,120,150,180,210,240,270,300,330],l=",";function i(e,t){return parseFloat(e[t]+e[t+1]+"."+e[t+2])}function f(e,t){return h[parseInt(e[t],16)]}function m(e){if(!e||e.length===0)return[];let t=[],o=e.split(l);for(let n=0;n<o.length;n++){let s=o[n],r=i(s,0),a=[];for(let c=3;c<s.length;c+=4){let v=i(s,c),T=f(s,c+3);a.push({zoom:v,angle:T})}t.push({zoom:r,directions:a})}return t}var d=e=>new Promise(t=>setTimeout(t,e));async function u(e,t){let o=0,n=Math.max(1,t?.retry?.times??1);for(;o<n;)try{return{data:await e(),error:null}}catch(s){if(o++,o==n){if(s instanceof Error)return(!t?.exceptions||t.exceptions.some(r=>s instanceof r)==!1)&&t?.catch?.(s),{data:null,error:s};throw t?.catch?.(s),s}else t?.retry?.delay&&await d(t.retry.delay)}throw Error("Unreachable code")}async function w(e,t,o,n,s){let r=await u(async()=>await fetch(e,{...o,method:"POST",body:t?JSON.stringify(t):void 0,headers:{...o?.headers,"Content-Type":"application/json"}}),{retry:{times:n,delay:s}});if(r.error)throw r.error;let a=r.data;if(!a.ok)throw Error(await a.text());return await a.json()}const p="https://maps.api.arenarium.dev/states",y=3,E=500,S={async fetch(e){const o={headers:{"Cache-Control":self?.location.host.startsWith("localhost")||self?.location.host.startsWith("127.0.0.1")?"no-cache":""}},n=await w(p,e,o,y,E),s=m(n.states),r=n.jwt;return{states:s,jwt:r}}};class k{methods;constructor(t){this.methods=t}listen(){self.onmessage=this.onmessage.bind(this)}async onmessage(t){const{id:o,method:n,args:s}=t.data;try{const r=this.methods[n];if(typeof r!="function")throw new Error(`Unknown method: ${n}`);const a=await r(...s),c={id:o,result:a};self.postMessage(c)}catch(r){const a=r instanceof Error?r.message:String(r),c={id:o,error:a};self.postMessage(c)}}}new k(S).listen()})();\n', tr = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Kr], { type: "text/javascript;charset=utf-8" });
|
|
2604
|
+
function da(t) {
|
|
2653
2605
|
let e;
|
|
2654
2606
|
try {
|
|
2655
|
-
if (e =
|
|
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(
|
|
2616
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(Kr),
|
|
2665
2617
|
{
|
|
2666
2618
|
name: t?.name
|
|
2667
2619
|
}
|
|
2668
2620
|
);
|
|
2669
2621
|
}
|
|
2670
2622
|
}
|
|
2671
|
-
var
|
|
2672
|
-
async function
|
|
2623
|
+
var ma = (t) => new Promise((e) => setTimeout(e, t));
|
|
2624
|
+
async function Qr(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 (
|
|
2628
|
+
} catch (i) {
|
|
2677
2629
|
if (n++, n == r) {
|
|
2678
|
-
if (
|
|
2679
|
-
return (!e?.exceptions || e.exceptions.some((
|
|
2680
|
-
throw e?.catch?.(
|
|
2681
|
-
} else e?.retry?.delay && await
|
|
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 ma(e.retry.delay);
|
|
2682
2634
|
}
|
|
2683
2635
|
throw Error("Unreachable code");
|
|
2684
2636
|
}
|
|
2685
|
-
async function
|
|
2686
|
-
let
|
|
2687
|
-
if (
|
|
2688
|
-
let a =
|
|
2637
|
+
async function va(t, e, n, r, i) {
|
|
2638
|
+
let s = await Qr(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
|
|
2693
|
-
let
|
|
2694
|
-
if (
|
|
2695
|
-
let a =
|
|
2644
|
+
async function ga(t, e, n, r, i) {
|
|
2645
|
+
let s = await Qr(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
|
|
2650
|
+
const je = 0xc3a5c85c97cb3127n, oe = 0xb492b66fbe98f273n, Be = 0x9ae16a3b2f90404fn, ei = 0xc949d7c7509e6557n, B = 0xffffffffffffffffn;
|
|
2699
2651
|
function p(t) {
|
|
2700
|
-
return t &
|
|
2652
|
+
return t & B;
|
|
2701
2653
|
}
|
|
2702
2654
|
function A(t, e) {
|
|
2703
|
-
return e === 0 ? t &
|
|
2655
|
+
return e === 0 ? t & B : (t = t & B, (t >> BigInt(e) | t << BigInt(64 - e)) & B);
|
|
2704
2656
|
}
|
|
2705
|
-
function
|
|
2706
|
-
return t = t &
|
|
2657
|
+
function wa(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
|
|
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 &
|
|
2667
|
+
return n & B;
|
|
2716
2668
|
}
|
|
2717
|
-
function
|
|
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
|
|
2675
|
+
function ka(t) {
|
|
2724
2676
|
const e = 0x9ddfea08eb382d69n;
|
|
2725
|
-
let n = (t.first ^ t.second) * e &
|
|
2726
|
-
n ^= n >> 47n, n = n &
|
|
2727
|
-
let r = (t.second ^ n) * e &
|
|
2728
|
-
return r ^= r >> 47n, r = r * e &
|
|
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
|
|
2731
|
-
return
|
|
2682
|
+
function We(t, e) {
|
|
2683
|
+
return ka({ first: t, second: e });
|
|
2732
2684
|
}
|
|
2733
|
-
function
|
|
2685
|
+
function ya(t) {
|
|
2734
2686
|
const e = t.length;
|
|
2735
2687
|
if (e > 8) {
|
|
2736
|
-
const n =
|
|
2737
|
-
return (
|
|
2688
|
+
const n = b(t), r = b(t, e - 8);
|
|
2689
|
+
return (We(n, wa(r + BigInt(e) & B, e)) ^ r) & B;
|
|
2738
2690
|
}
|
|
2739
2691
|
if (e >= 4) {
|
|
2740
|
-
const n =
|
|
2741
|
-
return
|
|
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]),
|
|
2745
|
-
return p(ct(p(
|
|
2746
|
-
}
|
|
2747
|
-
return
|
|
2748
|
-
}
|
|
2749
|
-
function
|
|
2750
|
-
const e = t.length, n = p(
|
|
2751
|
-
return
|
|
2752
|
-
}
|
|
2753
|
-
function
|
|
2754
|
-
|
|
2755
|
-
const a =
|
|
2756
|
-
return
|
|
2757
|
-
}
|
|
2758
|
-
function
|
|
2759
|
-
return
|
|
2760
|
-
}
|
|
2761
|
-
function
|
|
2762
|
-
const e = t.length, n =
|
|
2763
|
-
let r = p(
|
|
2764
|
-
r = p(r +
|
|
2765
|
-
const a = p(r + n), o = p(
|
|
2766
|
-
r = p(
|
|
2767
|
-
const l =
|
|
2768
|
-
|
|
2769
|
-
const u = p(r + l), c = p(
|
|
2770
|
-
return p(ct(p(h *
|
|
2771
|
-
}
|
|
2772
|
-
function
|
|
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 * ei)) * Be);
|
|
2698
|
+
}
|
|
2699
|
+
return Be;
|
|
2700
|
+
}
|
|
2701
|
+
function _a(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 ^ ei, 20) - i + BigInt(e)));
|
|
2704
|
+
}
|
|
2705
|
+
function ba(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 ba(b(t, e), b(t, e + 8), b(t, e + 16), b(t, e + 24), n, r);
|
|
2712
|
+
}
|
|
2713
|
+
function Ma(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 Ea(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 ?
|
|
2729
|
+
return n <= 16 ? ya(e) : _a(e);
|
|
2778
2730
|
if (n <= 64)
|
|
2779
|
-
return
|
|
2780
|
-
let r =
|
|
2781
|
-
|
|
2731
|
+
return Ma(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 +
|
|
2785
|
-
return
|
|
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
|
|
2788
|
-
return
|
|
2739
|
+
function xa(t) {
|
|
2740
|
+
return Ea(JSON.stringify(t)).toString();
|
|
2789
2741
|
}
|
|
2790
|
-
let
|
|
2742
|
+
let Yt;
|
|
2791
2743
|
// @__NO_SIDE_EFFECTS__
|
|
2792
|
-
function
|
|
2744
|
+
function ti(t) {
|
|
2793
2745
|
return {
|
|
2794
|
-
lang:
|
|
2746
|
+
lang: Yt?.lang,
|
|
2795
2747
|
message: t?.message,
|
|
2796
|
-
abortEarly:
|
|
2797
|
-
abortPipeEarly:
|
|
2748
|
+
abortEarly: Yt?.abortEarly,
|
|
2749
|
+
abortPipeEarly: Yt?.abortPipeEarly
|
|
2798
2750
|
};
|
|
2799
2751
|
}
|
|
2800
|
-
let
|
|
2752
|
+
let Sa;
|
|
2801
2753
|
// @__NO_SIDE_EFFECTS__
|
|
2802
|
-
function
|
|
2803
|
-
return
|
|
2754
|
+
function Pa(t) {
|
|
2755
|
+
return Sa?.get(t);
|
|
2804
2756
|
}
|
|
2805
|
-
let
|
|
2757
|
+
let Ta;
|
|
2806
2758
|
// @__NO_SIDE_EFFECTS__
|
|
2807
|
-
function
|
|
2808
|
-
return
|
|
2759
|
+
function Ia(t) {
|
|
2760
|
+
return Ta?.get(t);
|
|
2809
2761
|
}
|
|
2810
|
-
let
|
|
2762
|
+
let Aa;
|
|
2811
2763
|
// @__NO_SIDE_EFFECTS__
|
|
2812
|
-
function
|
|
2813
|
-
return
|
|
2764
|
+
function Na(t, e) {
|
|
2765
|
+
return Aa?.get(t)?.get(e);
|
|
2814
2766
|
}
|
|
2815
2767
|
// @__NO_SIDE_EFFECTS__
|
|
2816
|
-
function
|
|
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
|
|
2821
|
-
const
|
|
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:
|
|
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:
|
|
2830
|
-
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 =
|
|
2786
|
+
}, u = t.kind === "schema", c = i?.message ?? t.message ?? /* @__PURE__ */ Na(t.reference, l.lang) ?? (u ? /* @__PURE__ */ Ia(l.lang) : null) ?? r.message ?? /* @__PURE__ */ Pa(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
|
|
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__ */
|
|
2795
|
+
return t["~run"]({ value: e }, /* @__PURE__ */ ti());
|
|
2844
2796
|
}
|
|
2845
2797
|
};
|
|
2846
2798
|
}
|
|
2847
2799
|
// @__NO_SIDE_EFFECTS__
|
|
2848
|
-
function
|
|
2800
|
+
function Ca(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
|
|
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
|
|
2815
|
+
function z(t) {
|
|
2864
2816
|
return {
|
|
2865
2817
|
kind: "transformation",
|
|
2866
2818
|
type: "args",
|
|
2867
|
-
reference:
|
|
2819
|
+
reference: z,
|
|
2868
2820
|
async: !1,
|
|
2869
2821
|
schema: t,
|
|
2870
2822
|
"~run"(e, n) {
|
|
2871
2823
|
const r = e.value;
|
|
2872
|
-
return e.value = (...
|
|
2873
|
-
const
|
|
2874
|
-
if (
|
|
2875
|
-
return r(...
|
|
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
|
|
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 ni(t, e) {
|
|
2894
2834
|
return {
|
|
2895
2835
|
kind: "validation",
|
|
2896
2836
|
type: "check",
|
|
2897
|
-
reference:
|
|
2837
|
+
reference: ni,
|
|
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) &&
|
|
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
|
|
2848
|
+
function ri(t, e) {
|
|
2909
2849
|
return {
|
|
2910
2850
|
kind: "validation",
|
|
2911
2851
|
type: "length",
|
|
2912
|
-
reference:
|
|
2852
|
+
reference: ri,
|
|
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 &&
|
|
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__ */
|
|
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) &&
|
|
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
|
|
2878
|
+
function dn(t, e) {
|
|
2939
2879
|
return {
|
|
2940
2880
|
kind: "validation",
|
|
2941
2881
|
type: "min_length",
|
|
2942
|
-
reference:
|
|
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 &&
|
|
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
|
|
2893
|
+
function H(t, e) {
|
|
2954
2894
|
return {
|
|
2955
2895
|
kind: "validation",
|
|
2956
2896
|
type: "min_value",
|
|
2957
|
-
reference:
|
|
2897
|
+
reference: H,
|
|
2958
2898
|
async: !1,
|
|
2959
|
-
expects: `>=${t instanceof Date ? t.toJSON() : /* @__PURE__ */
|
|
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) &&
|
|
2964
|
-
}
|
|
2965
|
-
};
|
|
2966
|
-
}
|
|
2967
|
-
// @__NO_SIDE_EFFECTS__
|
|
2968
|
-
function j(t) {
|
|
2969
|
-
return {
|
|
2970
|
-
kind: "transformation",
|
|
2971
|
-
type: "returns",
|
|
2972
|
-
reference: j,
|
|
2973
|
-
async: !1,
|
|
2974
|
-
schema: t,
|
|
2975
|
-
"~run"(e, n) {
|
|
2976
|
-
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;
|
|
2981
|
-
}, e;
|
|
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;
|
|
2982
2904
|
}
|
|
2983
2905
|
};
|
|
2984
2906
|
}
|
|
2985
2907
|
// @__NO_SIDE_EFFECTS__
|
|
2986
|
-
function
|
|
2908
|
+
function F(t) {
|
|
2987
2909
|
return {
|
|
2988
2910
|
kind: "transformation",
|
|
2989
2911
|
type: "returns",
|
|
2990
|
-
reference:
|
|
2912
|
+
reference: F,
|
|
2991
2913
|
async: !1,
|
|
2992
2914
|
schema: t,
|
|
2993
2915
|
"~run"(e, n) {
|
|
2994
2916
|
const r = e.value;
|
|
2995
|
-
return e.value =
|
|
2996
|
-
const
|
|
2997
|
-
if (
|
|
2998
|
-
return
|
|
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;
|
|
2999
2921
|
}, e;
|
|
3000
2922
|
}
|
|
3001
2923
|
};
|
|
3002
2924
|
}
|
|
3003
2925
|
// @__NO_SIDE_EFFECTS__
|
|
3004
|
-
function
|
|
2926
|
+
function Ra(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
|
|
2930
|
+
function ii(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
|
|
2934
|
+
function si(t, e) {
|
|
3013
2935
|
return {
|
|
3014
2936
|
kind: "schema",
|
|
3015
2937
|
type: "array",
|
|
3016
|
-
reference:
|
|
2938
|
+
reference: si,
|
|
3017
2939
|
expects: "Array",
|
|
3018
2940
|
async: !1,
|
|
3019
2941
|
item: t,
|
|
3020
2942
|
message: e,
|
|
3021
2943
|
get "~standard"() {
|
|
3022
|
-
return /* @__PURE__ */
|
|
2944
|
+
return /* @__PURE__ */ Z(this);
|
|
3023
2945
|
},
|
|
3024
2946
|
"~run"(n, r) {
|
|
3025
|
-
const
|
|
3026
|
-
if (Array.isArray(
|
|
2947
|
+
const i = n.value;
|
|
2948
|
+
if (Array.isArray(i)) {
|
|
3027
2949
|
n.typed = !0, n.value = [];
|
|
3028
|
-
for (let
|
|
3029
|
-
const a = s
|
|
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:
|
|
3035
|
-
key:
|
|
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
|
|
2969
|
+
} else N(this, "type", n, r);
|
|
3048
2970
|
return n;
|
|
3049
2971
|
}
|
|
3050
2972
|
};
|
|
3051
2973
|
}
|
|
3052
2974
|
// @__NO_SIDE_EFFECTS__
|
|
3053
|
-
function
|
|
2975
|
+
function ai(t) {
|
|
3054
2976
|
return {
|
|
3055
2977
|
kind: "schema",
|
|
3056
2978
|
type: "boolean",
|
|
3057
|
-
reference:
|
|
2979
|
+
reference: ai,
|
|
3058
2980
|
expects: "boolean",
|
|
3059
2981
|
async: !1,
|
|
3060
2982
|
message: t,
|
|
3061
2983
|
get "~standard"() {
|
|
3062
|
-
return /* @__PURE__ */
|
|
2984
|
+
return /* @__PURE__ */ Z(this);
|
|
3063
2985
|
},
|
|
3064
2986
|
"~run"(e, n) {
|
|
3065
|
-
return typeof e.value == "boolean" ? e.typed = !0 :
|
|
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
|
|
2992
|
+
function oi(t, e) {
|
|
3071
2993
|
return {
|
|
3072
2994
|
kind: "schema",
|
|
3073
2995
|
type: "custom",
|
|
3074
|
-
reference:
|
|
2996
|
+
reference: oi,
|
|
3075
2997
|
expects: "unknown",
|
|
3076
2998
|
async: !1,
|
|
3077
2999
|
check: t,
|
|
3078
3000
|
message: e,
|
|
3079
3001
|
get "~standard"() {
|
|
3080
|
-
return /* @__PURE__ */
|
|
3002
|
+
return /* @__PURE__ */ Z(this);
|
|
3081
3003
|
},
|
|
3082
3004
|
"~run"(n, r) {
|
|
3083
|
-
return this.check(n.value) ? n.typed = !0 :
|
|
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
|
|
3010
|
+
function I(t) {
|
|
3089
3011
|
return {
|
|
3090
3012
|
kind: "schema",
|
|
3091
3013
|
type: "function",
|
|
3092
|
-
reference:
|
|
3014
|
+
reference: I,
|
|
3093
3015
|
expects: "Function",
|
|
3094
3016
|
async: !1,
|
|
3095
3017
|
message: t,
|
|
3096
3018
|
get "~standard"() {
|
|
3097
|
-
return /* @__PURE__ */
|
|
3019
|
+
return /* @__PURE__ */ Z(this);
|
|
3098
3020
|
},
|
|
3099
3021
|
"~run"(e, n) {
|
|
3100
|
-
return typeof e.value == "function" ? e.typed = !0 :
|
|
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__ */
|
|
3032
|
+
expects: /* @__PURE__ */ Ge(t),
|
|
3111
3033
|
async: !1,
|
|
3112
3034
|
literal: t,
|
|
3113
3035
|
message: e,
|
|
3114
3036
|
get "~standard"() {
|
|
3115
|
-
return /* @__PURE__ */
|
|
3037
|
+
return /* @__PURE__ */ Z(this);
|
|
3116
3038
|
},
|
|
3117
3039
|
"~run"(n, r) {
|
|
3118
|
-
return n.value === this.literal ? n.typed = !0 :
|
|
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
|
|
3045
|
+
function P(t) {
|
|
3124
3046
|
return {
|
|
3125
3047
|
kind: "schema",
|
|
3126
3048
|
type: "number",
|
|
3127
|
-
reference:
|
|
3049
|
+
reference: P,
|
|
3128
3050
|
expects: "number",
|
|
3129
3051
|
async: !1,
|
|
3130
3052
|
message: t,
|
|
3131
3053
|
get "~standard"() {
|
|
3132
|
-
return /* @__PURE__ */
|
|
3054
|
+
return /* @__PURE__ */ Z(this);
|
|
3133
3055
|
},
|
|
3134
3056
|
"~run"(e, n) {
|
|
3135
|
-
return typeof e.value == "number" && !isNaN(e.value) ? e.typed = !0 :
|
|
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
|
|
3062
|
+
function W(t, e) {
|
|
3141
3063
|
return {
|
|
3142
3064
|
kind: "schema",
|
|
3143
3065
|
type: "object",
|
|
3144
|
-
reference:
|
|
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__ */
|
|
3072
|
+
return /* @__PURE__ */ Z(this);
|
|
3151
3073
|
},
|
|
3152
3074
|
"~run"(n, r) {
|
|
3153
|
-
const
|
|
3154
|
-
if (
|
|
3075
|
+
const i = n.value;
|
|
3076
|
+
if (i && typeof i == "object") {
|
|
3155
3077
|
n.typed = !0, n.value = {};
|
|
3156
|
-
for (const
|
|
3157
|
-
const a = this.entries[
|
|
3158
|
-
if (
|
|
3159
|
-
const o =
|
|
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__ */ ii(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:
|
|
3165
|
-
key:
|
|
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[
|
|
3176
|
-
} else if (a.fallback !== void 0) n.value[
|
|
3177
|
-
else if (a.type !== "exact_optional" && a.type !== "optional" && a.type !== "nullish" && (
|
|
3097
|
+
l.typed || (n.typed = !1), n.value[s] = l.value;
|
|
3098
|
+
} else if (a.fallback !== void 0) n.value[s] = /* @__PURE__ */ Ra(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: `"${
|
|
3101
|
+
expected: `"${s}"`,
|
|
3180
3102
|
path: [{
|
|
3181
3103
|
type: "object",
|
|
3182
3104
|
origin: "key",
|
|
3183
|
-
input:
|
|
3184
|
-
key:
|
|
3185
|
-
value: s
|
|
3105
|
+
input: i,
|
|
3106
|
+
key: s,
|
|
3107
|
+
value: i[s]
|
|
3186
3108
|
}]
|
|
3187
3109
|
}), r.abortEarly))
|
|
3188
3110
|
break;
|
|
3189
3111
|
}
|
|
3190
|
-
} else
|
|
3112
|
+
} else N(this, "type", n, r);
|
|
3191
3113
|
return n;
|
|
3192
3114
|
}
|
|
3193
3115
|
};
|
|
3194
3116
|
}
|
|
3195
3117
|
// @__NO_SIDE_EFFECTS__
|
|
3196
|
-
function
|
|
3118
|
+
function T(t, e) {
|
|
3197
3119
|
return {
|
|
3198
3120
|
kind: "schema",
|
|
3199
3121
|
type: "optional",
|
|
3200
|
-
reference:
|
|
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__ */
|
|
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__ */
|
|
3131
|
+
return n.value === void 0 && (this.default !== void 0 && (n.value = /* @__PURE__ */ ii(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
|
|
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:
|
|
3140
|
+
reference: me,
|
|
3236
3141
|
expects: "string",
|
|
3237
3142
|
async: !1,
|
|
3238
3143
|
message: t,
|
|
3239
3144
|
get "~standard"() {
|
|
3240
|
-
return /* @__PURE__ */
|
|
3145
|
+
return /* @__PURE__ */ Z(this);
|
|
3241
3146
|
},
|
|
3242
3147
|
"~run"(e, n) {
|
|
3243
|
-
return typeof e.value == "string" ? e.typed = !0 :
|
|
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
|
|
3153
|
+
function O(t, e) {
|
|
3249
3154
|
return {
|
|
3250
3155
|
kind: "schema",
|
|
3251
3156
|
type: "tuple",
|
|
3252
|
-
reference:
|
|
3157
|
+
reference: O,
|
|
3253
3158
|
expects: "Array",
|
|
3254
3159
|
async: !1,
|
|
3255
3160
|
items: t,
|
|
3256
3161
|
message: e,
|
|
3257
3162
|
get "~standard"() {
|
|
3258
|
-
return /* @__PURE__ */
|
|
3163
|
+
return /* @__PURE__ */ Z(this);
|
|
3259
3164
|
},
|
|
3260
3165
|
"~run"(n, r) {
|
|
3261
|
-
const
|
|
3262
|
-
if (Array.isArray(
|
|
3166
|
+
const i = n.value;
|
|
3167
|
+
if (Array.isArray(i)) {
|
|
3263
3168
|
n.typed = !0, n.value = [];
|
|
3264
|
-
for (let
|
|
3265
|
-
const a = s
|
|
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:
|
|
3271
|
-
key:
|
|
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
|
|
3188
|
+
} else N(this, "type", n, r);
|
|
3284
3189
|
return n;
|
|
3285
3190
|
}
|
|
3286
3191
|
};
|
|
3287
3192
|
}
|
|
3288
3193
|
// @__NO_SIDE_EFFECTS__
|
|
3289
|
-
function
|
|
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
|
|
3200
|
+
function mn(t, e) {
|
|
3296
3201
|
return {
|
|
3297
3202
|
kind: "schema",
|
|
3298
3203
|
type: "union",
|
|
3299
|
-
reference:
|
|
3300
|
-
expects: /* @__PURE__ */
|
|
3204
|
+
reference: mn,
|
|
3205
|
+
expects: /* @__PURE__ */ Ca(t.map((n) => n.expects), "|"),
|
|
3301
3206
|
async: !1,
|
|
3302
3207
|
options: t,
|
|
3303
3208
|
message: e,
|
|
3304
3209
|
get "~standard"() {
|
|
3305
|
-
return /* @__PURE__ */
|
|
3210
|
+
return /* @__PURE__ */ Z(this);
|
|
3306
3211
|
},
|
|
3307
3212
|
"~run"(n, r) {
|
|
3308
|
-
let
|
|
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)
|
|
3216
|
+
if (l.typed) if (l.issues) s ? s.push(l) : s = [l];
|
|
3312
3217
|
else {
|
|
3313
|
-
|
|
3218
|
+
i = l;
|
|
3314
3219
|
break;
|
|
3315
3220
|
}
|
|
3316
3221
|
else a ? a.push(l) : a = [l];
|
|
3317
3222
|
}
|
|
3318
|
-
if (
|
|
3319
|
-
if (
|
|
3320
|
-
if (
|
|
3321
|
-
|
|
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
|
-
|
|
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__ */
|
|
3245
|
+
return /* @__PURE__ */ Z(this);
|
|
3341
3246
|
},
|
|
3342
3247
|
"~run"(e, n) {
|
|
3343
|
-
return e.value === void 0 ? e.typed = !0 :
|
|
3248
|
+
return e.value === void 0 ? e.typed = !0 : N(this, "type", e, n), e;
|
|
3344
3249
|
}
|
|
3345
3250
|
};
|
|
3346
3251
|
}
|
|
3347
|
-
function
|
|
3348
|
-
const r = t["~run"]({ value: e }, /* @__PURE__ */
|
|
3349
|
-
if (r.issues) throw new
|
|
3252
|
+
function bt(t, e, n) {
|
|
3253
|
+
const r = t["~run"]({ value: e }, /* @__PURE__ */ ti(n));
|
|
3254
|
+
if (r.issues) throw new pn(r.issues);
|
|
3350
3255
|
return r.value;
|
|
3351
3256
|
}
|
|
3352
3257
|
// @__NO_SIDE_EFFECTS__
|
|
3353
|
-
function
|
|
3258
|
+
function w(...t) {
|
|
3354
3259
|
return {
|
|
3355
3260
|
...t[0],
|
|
3356
3261
|
pipe: t,
|
|
3357
3262
|
get "~standard"() {
|
|
3358
|
-
return /* @__PURE__ */
|
|
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,16 @@ function g(...t) {
|
|
|
3369
3274
|
}
|
|
3370
3275
|
};
|
|
3371
3276
|
}
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
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 li = /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(-90), /* @__PURE__ */ ft(90)), ui = /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(-180), /* @__PURE__ */ ft(180)), It = /* @__PURE__ */ W({ lat: li, lng: ui }), ci = /* @__PURE__ */ W({ sw: It, ne: It }), Da = /* @__PURE__ */ W({ bounds: ci, center: It, zoom: /* @__PURE__ */ P() }), He = /* @__PURE__ */ oi((t) => t instanceof HTMLElement, "Must be an HTMLElement"), za = /* @__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)]) }), Oa = /* @__PURE__ */ W({ inserted: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([])), /* @__PURE__ */ F(/* @__PURE__ */ ai())), insert: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([])), /* @__PURE__ */ F(/* @__PURE__ */ De())), remove: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([])), /* @__PURE__ */ F(/* @__PURE__ */ De())), update: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([/* @__PURE__ */ P()])), /* @__PURE__ */ F(/* @__PURE__ */ De())) }), ir = /* @__PURE__ */ mn([/* @__PURE__ */ Re("idle"), /* @__PURE__ */ Re("move"), /* @__PURE__ */ Re("click")]), La = /* @__PURE__ */ W({ getParameters: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([])), /* @__PURE__ */ F(za)), getContainer: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([])), /* @__PURE__ */ F(He)), getZoom: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([])), /* @__PURE__ */ F(/* @__PURE__ */ P())), getBounds: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([])), /* @__PURE__ */ F(ci)), getCenter: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([])), /* @__PURE__ */ F(It)), getViewport: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([])), /* @__PURE__ */ F(Da)), panBy: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([/* @__PURE__ */ P(), /* @__PURE__ */ P()])), /* @__PURE__ */ F(/* @__PURE__ */ De())), createMarker: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([He, li, ui, /* @__PURE__ */ P()])), /* @__PURE__ */ F(Oa)), subscribe: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([ir, /* @__PURE__ */ I()])), /* @__PURE__ */ F(/* @__PURE__ */ De())), unsubscribe: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([ir, /* @__PURE__ */ I()])), /* @__PURE__ */ F(/* @__PURE__ */ De())) }), Zt = /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ z(/* @__PURE__ */ O([/* @__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__ */ ni((t) => Math.min(t.width, t.height) / t.padding >= 4, "Minimum of width or height must be greater than or equal to 4 * padding")), Fa = /* @__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()) }), $a = /* @__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(Fa), 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) })) }), Va = /* @__PURE__ */ w(/* @__PURE__ */ me(), /* @__PURE__ */ ri(32)), Ua = /* @__PURE__ */ w(/* @__PURE__ */ me(), /* @__PURE__ */ dn(1));
|
|
3278
|
+
const ja = "1.3.0";
|
|
3279
|
+
class Ba {
|
|
3395
3280
|
apiKey;
|
|
3396
3281
|
apiJwt;
|
|
3397
3282
|
markerStatesStore;
|
|
3398
3283
|
markerStatesWorker;
|
|
3399
3284
|
markerStatesWorkerClient;
|
|
3400
3285
|
constructor(e, n) {
|
|
3401
|
-
this.apiKey = e, this.apiJwt = n, this.markerStatesStore = /* @__PURE__ */ new Map(), this.markerStatesWorker = new
|
|
3286
|
+
this.apiKey = e, this.apiJwt = n, this.markerStatesStore = /* @__PURE__ */ new Map(), this.markerStatesWorker = new da(), this.markerStatesWorkerClient = new lr(this.markerStatesWorker);
|
|
3402
3287
|
}
|
|
3403
3288
|
clearStates() {
|
|
3404
3289
|
this.markerStatesStore.clear();
|
|
@@ -3411,29 +3296,30 @@ class La {
|
|
|
3411
3296
|
}
|
|
3412
3297
|
async updateStates(e, n) {
|
|
3413
3298
|
if (e.length == 0) return;
|
|
3414
|
-
e.sort((a, o) => a.
|
|
3415
|
-
const r = e.map((a) => a.input),
|
|
3416
|
-
let
|
|
3417
|
-
|
|
3299
|
+
e.sort((a, o) => a.properites.id.localeCompare(o.properites.id));
|
|
3300
|
+
const r = e.map((a) => a.input), i = xa(r);
|
|
3301
|
+
let s = this.markerStatesStore.get(i);
|
|
3302
|
+
s == null && (s = await this.fetchStates(r, n), this.markerStatesStore.set(i, s));
|
|
3418
3303
|
for (let a = 0; a < e.length; a++) {
|
|
3419
3304
|
const o = e[a];
|
|
3420
|
-
o.state =
|
|
3305
|
+
o.state = s[a];
|
|
3421
3306
|
}
|
|
3422
3307
|
}
|
|
3423
3308
|
async fetchStates(e, n) {
|
|
3424
3309
|
if (e.length == 0) return [];
|
|
3425
|
-
if (e.length == 1) return [
|
|
3310
|
+
if (e.length == 1) return [{ zoom: 0, directions: [{ zoom: 0, angle: ca() }] }];
|
|
3426
3311
|
const r = {
|
|
3427
3312
|
key: this.apiKey,
|
|
3428
3313
|
jwt: this.apiJwt,
|
|
3314
|
+
version: ja,
|
|
3429
3315
|
input: e,
|
|
3430
3316
|
parameters: n
|
|
3431
|
-
},
|
|
3432
|
-
return
|
|
3317
|
+
}, i = await this.markerStatesWorkerClient.invoke("fetch", r);
|
|
3318
|
+
return i.jwt && (this.apiJwt = i.jwt), i.states;
|
|
3433
3319
|
}
|
|
3434
3320
|
}
|
|
3435
|
-
const
|
|
3436
|
-
class
|
|
3321
|
+
const ar = "1.3.0", Wa = "https://maps.api.arenarium.dev/auth", Ha = "https://maps.api.arenarium.dev/log", or = 500;
|
|
3322
|
+
class fi {
|
|
3437
3323
|
apiKey;
|
|
3438
3324
|
mapProvider;
|
|
3439
3325
|
mapStateProvider;
|
|
@@ -3444,26 +3330,26 @@ class ps {
|
|
|
3444
3330
|
markerVisibilityProcessor;
|
|
3445
3331
|
markerElementsProcessor;
|
|
3446
3332
|
markerStateProcessor;
|
|
3447
|
-
markerStatesProcessDelay =
|
|
3333
|
+
markerStatesProcessDelay = or;
|
|
3448
3334
|
markerStatesProcessTimeout = void 0;
|
|
3449
|
-
constructor(e, n, r,
|
|
3450
|
-
|
|
3335
|
+
constructor(e, n, r, i) {
|
|
3336
|
+
bt(Va, e), bt(Ua, n), bt(La, r), this.apiKey = e, this.mapProvider = r, this.mapStateProvider = new Pi(
|
|
3451
3337
|
this.mapProvider,
|
|
3452
3338
|
this.detached.bind(this),
|
|
3453
3339
|
this.error.bind(this),
|
|
3454
3340
|
this.onMapMove.bind(this),
|
|
3455
3341
|
this.onMapIdle.bind(this),
|
|
3456
3342
|
this.onMapClick.bind(this)
|
|
3457
|
-
), this.markers = /* @__PURE__ */ new Map(), this.markerVisibilityManager = new
|
|
3343
|
+
), this.markers = /* @__PURE__ */ new Map(), this.markerVisibilityManager = new ji(), this.markerElementsManager = new pa(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
3344
|
}
|
|
3459
3345
|
//#region Core
|
|
3460
3346
|
static async create(e, n, r) {
|
|
3461
|
-
let a = (await
|
|
3347
|
+
let a = (await va(Wa, { key: e, version: ar })).jwt;
|
|
3462
3348
|
if (!a) throw new Error("Failed to get api jwt");
|
|
3463
|
-
return new
|
|
3349
|
+
return new fi(e, a, n, r);
|
|
3464
3350
|
}
|
|
3465
3351
|
set configuration(e) {
|
|
3466
|
-
this.markerStatesProcessDelay = e?.process?.states?.delay ??
|
|
3352
|
+
this.markerStatesProcessDelay = e?.process?.states?.delay ?? or, this.markerVisibilityManager.configuration = e, this.markerElementsManager.configuration = e;
|
|
3467
3353
|
}
|
|
3468
3354
|
clear() {
|
|
3469
3355
|
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 +3374,11 @@ class ps {
|
|
|
3488
3374
|
}
|
|
3489
3375
|
if (r instanceof Error)
|
|
3490
3376
|
try {
|
|
3491
|
-
const
|
|
3377
|
+
const i = {
|
|
3492
3378
|
title: n,
|
|
3493
3379
|
level: e,
|
|
3494
3380
|
content: {
|
|
3495
|
-
version:
|
|
3381
|
+
version: ar,
|
|
3496
3382
|
key: this.apiKey,
|
|
3497
3383
|
name: r.name,
|
|
3498
3384
|
message: r.message,
|
|
@@ -3500,9 +3386,9 @@ class ps {
|
|
|
3500
3386
|
stack: r.stack
|
|
3501
3387
|
}
|
|
3502
3388
|
};
|
|
3503
|
-
await
|
|
3504
|
-
} catch (
|
|
3505
|
-
console.error(
|
|
3389
|
+
await ga(Ha, i);
|
|
3390
|
+
} catch (i) {
|
|
3391
|
+
console.error(i);
|
|
3506
3392
|
}
|
|
3507
3393
|
}
|
|
3508
3394
|
//#endregion
|
|
@@ -3549,15 +3435,68 @@ class ps {
|
|
|
3549
3435
|
}
|
|
3550
3436
|
}
|
|
3551
3437
|
//#endregion
|
|
3552
|
-
//#region
|
|
3438
|
+
//#region Markers
|
|
3439
|
+
getMarkers(e) {
|
|
3440
|
+
const n = new Array(), r = new Array();
|
|
3441
|
+
for (const s of e) {
|
|
3442
|
+
const a = this.markers.get(s.id);
|
|
3443
|
+
a ? n.push(a) : r.push(s);
|
|
3444
|
+
}
|
|
3445
|
+
const i = document.createElement("div");
|
|
3446
|
+
i.style.position = "absolute", i.style.visibility = "hidden", i.style.display = "flex";
|
|
3447
|
+
try {
|
|
3448
|
+
document.body.appendChild(i);
|
|
3449
|
+
for (const o of r) {
|
|
3450
|
+
const l = o.pin, u = o.tooltip, c = o.popup;
|
|
3451
|
+
l?.element && !l.dimensions && i.appendChild(l.element), u.element && !u.dimensions && i.appendChild(u.element), c?.element && !c.dimensions && i.appendChild(c.element);
|
|
3452
|
+
}
|
|
3453
|
+
const s = (o, l) => {
|
|
3454
|
+
if (l) return l;
|
|
3455
|
+
if (o) {
|
|
3456
|
+
const u = o.getBoundingClientRect();
|
|
3457
|
+
return { width: u.width, height: u.height, padding: Ln };
|
|
3458
|
+
} else
|
|
3459
|
+
return { width: On, height: On, padding: Ln };
|
|
3460
|
+
}, a = (o, l) => {
|
|
3461
|
+
if (l) return l;
|
|
3462
|
+
const u = o.getBoundingClientRect();
|
|
3463
|
+
return { width: u.width, height: u.height, padding: Math.max(Math.round(Math.min(u.width, u.height) / 4), $i) };
|
|
3464
|
+
};
|
|
3465
|
+
for (const o of r) {
|
|
3466
|
+
const l = o.id, u = o.lat, c = o.lng, h = o.rank;
|
|
3467
|
+
let f = {
|
|
3468
|
+
id: l,
|
|
3469
|
+
initialize: o.pin?.initialize,
|
|
3470
|
+
element: o.pin?.element,
|
|
3471
|
+
style: o.pin?.style,
|
|
3472
|
+
dimensions: s(o.pin?.element, o.pin?.dimensions)
|
|
3473
|
+
}, d = {
|
|
3474
|
+
id: l,
|
|
3475
|
+
initialize: o.tooltip.initialize,
|
|
3476
|
+
element: o.tooltip.element,
|
|
3477
|
+
style: o.tooltip.style,
|
|
3478
|
+
dimensions: a(o.tooltip.element, o.tooltip.dimensions)
|
|
3479
|
+
}, m;
|
|
3480
|
+
o.popup && (m = {
|
|
3481
|
+
id: l,
|
|
3482
|
+
initialize: o.popup.initialize,
|
|
3483
|
+
element: o.popup.element,
|
|
3484
|
+
style: o.popup.style,
|
|
3485
|
+
dimensions: a(o.popup.element, o.popup.dimensions)
|
|
3486
|
+
});
|
|
3487
|
+
const v = new Ei(l, u, c, h, f, d, m);
|
|
3488
|
+
n.push(v);
|
|
3489
|
+
}
|
|
3490
|
+
return n.forEach((o) => this.markers.set(o.properites.id, o)), n.sort((o, l) => l.properites.rank - o.properites.rank), n;
|
|
3491
|
+
} finally {
|
|
3492
|
+
i.replaceChildren(), document.body.removeChild(i);
|
|
3493
|
+
}
|
|
3494
|
+
}
|
|
3553
3495
|
async updateMarkers(e) {
|
|
3554
|
-
|
|
3496
|
+
bt(/* @__PURE__ */ si($a), e);
|
|
3555
3497
|
try {
|
|
3556
|
-
const n = this.mapProvider.getParameters();
|
|
3557
|
-
|
|
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();
|
|
3498
|
+
const n = this.mapProvider.getParameters(), r = this.getMarkers(e);
|
|
3499
|
+
await this.markerVisibilityManager.updateMarkers(n, r), this.mapStateProvider.start(), this.markerVisibilityProcessor.run(), this.markerStateProcessor.run(), this.markerElementsProcessor.run();
|
|
3561
3500
|
} catch (n) {
|
|
3562
3501
|
throw this.clear(), this.error("Failed to update markers", n), n;
|
|
3563
3502
|
}
|
|
@@ -3569,8 +3508,10 @@ class ps {
|
|
|
3569
3508
|
throw this.error("Failed to remove markers", e), e;
|
|
3570
3509
|
}
|
|
3571
3510
|
}
|
|
3511
|
+
//#endregion
|
|
3512
|
+
//#region Popups
|
|
3572
3513
|
showPopup(e) {
|
|
3573
|
-
if (!this.detached()
|
|
3514
|
+
if (!this.detached())
|
|
3574
3515
|
try {
|
|
3575
3516
|
this.markerElementsManager.showPopup(e);
|
|
3576
3517
|
} catch (n) {
|
|
@@ -3580,7 +3521,7 @@ class ps {
|
|
|
3580
3521
|
}
|
|
3581
3522
|
}
|
|
3582
3523
|
hidePopup() {
|
|
3583
|
-
if (!this.detached()
|
|
3524
|
+
if (!this.detached())
|
|
3584
3525
|
try {
|
|
3585
3526
|
this.markerElementsManager.hidePopups();
|
|
3586
3527
|
} catch (e) {
|
|
@@ -3592,5 +3533,5 @@ class ps {
|
|
|
3592
3533
|
//#endregion
|
|
3593
3534
|
}
|
|
3594
3535
|
export {
|
|
3595
|
-
|
|
3536
|
+
fi as MapManager
|
|
3596
3537
|
};
|