@maptiler/geocoding-control 0.0.31

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.
@@ -0,0 +1,995 @@
1
+ var Ve = (t, e, n) => {
2
+ if (!e.has(t))
3
+ throw TypeError("Cannot " + n);
4
+ };
5
+ var Z = (t, e, n) => (Ve(t, e, "read from private field"), n ? n.call(t) : e.get(t)), Ie = (t, e, n) => {
6
+ if (e.has(t))
7
+ throw TypeError("Cannot add the same private member more than once");
8
+ e instanceof WeakSet ? e.add(t) : e.set(t, n);
9
+ }, ke = (t, e, n, l) => (Ve(t, e, "write to private field"), l ? l.call(t, n) : e.set(t, n), n);
10
+ import { Evented as pt } from "maplibre-gl";
11
+ function v() {
12
+ }
13
+ function vt(t, e) {
14
+ for (const n in e)
15
+ t[n] = e[n];
16
+ return t;
17
+ }
18
+ function Fe(t) {
19
+ return t();
20
+ }
21
+ function Ue() {
22
+ return /* @__PURE__ */ Object.create(null);
23
+ }
24
+ function te(t) {
25
+ t.forEach(Fe);
26
+ }
27
+ function $e(t) {
28
+ return typeof t == "function";
29
+ }
30
+ function de(t, e) {
31
+ return t != t ? e == e : t !== e || t && typeof t == "object" || typeof t == "function";
32
+ }
33
+ function wt(t) {
34
+ return Object.keys(t).length === 0;
35
+ }
36
+ function kt(t, e, n, l) {
37
+ if (t) {
38
+ const r = et(t, e, n, l);
39
+ return t[0](r);
40
+ }
41
+ }
42
+ function et(t, e, n, l) {
43
+ return t[1] && l ? vt(n.ctx.slice(), t[1](l(e))) : n.ctx;
44
+ }
45
+ function Mt(t, e, n, l) {
46
+ if (t[2] && l) {
47
+ const r = t[2](l(n));
48
+ if (e.dirty === void 0)
49
+ return r;
50
+ if (typeof r == "object") {
51
+ const u = [], o = Math.max(e.dirty.length, r.length);
52
+ for (let i = 0; i < o; i += 1)
53
+ u[i] = e.dirty[i] | r[i];
54
+ return u;
55
+ }
56
+ return e.dirty | r;
57
+ }
58
+ return e.dirty;
59
+ }
60
+ function Ct(t, e, n, l, r, u) {
61
+ if (r) {
62
+ const o = et(e, n, l, u);
63
+ t.p(o, r);
64
+ }
65
+ }
66
+ function Tt(t) {
67
+ if (t.ctx.length > 32) {
68
+ const e = [], n = t.ctx.length / 32;
69
+ for (let l = 0; l < n; l++)
70
+ e[l] = -1;
71
+ return e;
72
+ }
73
+ return -1;
74
+ }
75
+ function We(t) {
76
+ return t == null ? "" : t;
77
+ }
78
+ function y(t, e) {
79
+ t.appendChild(e);
80
+ }
81
+ function U(t, e, n) {
82
+ t.insertBefore(e, n || null);
83
+ }
84
+ function K(t) {
85
+ t.parentNode.removeChild(t);
86
+ }
87
+ function Lt(t, e) {
88
+ for (let n = 0; n < t.length; n += 1)
89
+ t[n] && t[n].d(e);
90
+ }
91
+ function z(t) {
92
+ return document.createElement(t);
93
+ }
94
+ function ee(t) {
95
+ return document.createElementNS("http://www.w3.org/2000/svg", t);
96
+ }
97
+ function ie(t) {
98
+ return document.createTextNode(t);
99
+ }
100
+ function x() {
101
+ return ie(" ");
102
+ }
103
+ function V(t, e, n, l) {
104
+ return t.addEventListener(e, n, l), () => t.removeEventListener(e, n, l);
105
+ }
106
+ function Et(t) {
107
+ return function(e) {
108
+ return e.preventDefault(), t.call(this, e);
109
+ };
110
+ }
111
+ function c(t, e, n) {
112
+ n == null ? t.removeAttribute(e) : t.getAttribute(e) !== n && t.setAttribute(e, n);
113
+ }
114
+ function Rt(t) {
115
+ return Array.from(t.childNodes);
116
+ }
117
+ function pe(t, e) {
118
+ e = "" + e, t.wholeText !== e && (t.data = e);
119
+ }
120
+ function Ge(t, e) {
121
+ t.value = e == null ? "" : e;
122
+ }
123
+ function N(t, e, n) {
124
+ t.classList[n ? "add" : "remove"](e);
125
+ }
126
+ function St(t, e, { bubbles: n = !1, cancelable: l = !1 } = {}) {
127
+ const r = document.createEvent("CustomEvent");
128
+ return r.initCustomEvent(t, n, l, e), r;
129
+ }
130
+ let ve;
131
+ function be(t) {
132
+ ve = t;
133
+ }
134
+ function tt() {
135
+ if (!ve)
136
+ throw new Error("Function called outside component initialization");
137
+ return ve;
138
+ }
139
+ function It(t) {
140
+ tt().$$.on_destroy.push(t);
141
+ }
142
+ function Bt() {
143
+ const t = tt();
144
+ return (e, n, { cancelable: l = !1 } = {}) => {
145
+ const r = t.$$.callbacks[e];
146
+ if (r) {
147
+ const u = St(e, n, { cancelable: l });
148
+ return r.slice().forEach((o) => {
149
+ o.call(t, u);
150
+ }), !u.defaultPrevented;
151
+ }
152
+ return !0;
153
+ };
154
+ }
155
+ const ye = [], Ae = [], Ce = [], He = [], At = Promise.resolve();
156
+ let Pe = !1;
157
+ function Pt() {
158
+ Pe || (Pe = !0, At.then(nt));
159
+ }
160
+ function ze(t) {
161
+ Ce.push(t);
162
+ }
163
+ const Be = /* @__PURE__ */ new Set();
164
+ let Me = 0;
165
+ function nt() {
166
+ const t = ve;
167
+ do {
168
+ for (; Me < ye.length; ) {
169
+ const e = ye[Me];
170
+ Me++, be(e), zt(e.$$);
171
+ }
172
+ for (be(null), ye.length = 0, Me = 0; Ae.length; )
173
+ Ae.pop()();
174
+ for (let e = 0; e < Ce.length; e += 1) {
175
+ const n = Ce[e];
176
+ Be.has(n) || (Be.add(n), n());
177
+ }
178
+ Ce.length = 0;
179
+ } while (ye.length);
180
+ for (; He.length; )
181
+ He.pop()();
182
+ Pe = !1, Be.clear(), be(t);
183
+ }
184
+ function zt(t) {
185
+ if (t.fragment !== null) {
186
+ t.update(), te(t.before_update);
187
+ const e = t.dirty;
188
+ t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, e), t.after_update.forEach(ze);
189
+ }
190
+ }
191
+ const Te = /* @__PURE__ */ new Set();
192
+ let se;
193
+ function Le() {
194
+ se = {
195
+ r: 0,
196
+ c: [],
197
+ p: se
198
+ };
199
+ }
200
+ function Ee() {
201
+ se.r || te(se.c), se = se.p;
202
+ }
203
+ function P(t, e) {
204
+ t && t.i && (Te.delete(t), t.i(e));
205
+ }
206
+ function q(t, e, n, l) {
207
+ if (t && t.o) {
208
+ if (Te.has(t))
209
+ return;
210
+ Te.add(t), se.c.push(() => {
211
+ Te.delete(t), l && (n && t.d(1), l());
212
+ }), t.o(e);
213
+ } else
214
+ l && l();
215
+ }
216
+ function we(t) {
217
+ t && t.c();
218
+ }
219
+ function ue(t, e, n, l) {
220
+ const { fragment: r, after_update: u } = t.$$;
221
+ r && r.m(e, n), l || ze(() => {
222
+ const o = t.$$.on_mount.map(Fe).filter($e);
223
+ t.$$.on_destroy ? t.$$.on_destroy.push(...o) : te(o), t.$$.on_mount = [];
224
+ }), u.forEach(ze);
225
+ }
226
+ function ae(t, e) {
227
+ const n = t.$$;
228
+ n.fragment !== null && (te(n.on_destroy), n.fragment && n.fragment.d(e), n.on_destroy = n.fragment = null, n.ctx = []);
229
+ }
230
+ function jt(t, e) {
231
+ t.$$.dirty[0] === -1 && (ye.push(t), Pt(), t.$$.dirty.fill(0)), t.$$.dirty[e / 31 | 0] |= 1 << e % 31;
232
+ }
233
+ function he(t, e, n, l, r, u, o, i = [-1]) {
234
+ const f = ve;
235
+ be(t);
236
+ const a = t.$$ = {
237
+ fragment: null,
238
+ ctx: [],
239
+ props: u,
240
+ update: v,
241
+ not_equal: r,
242
+ bound: Ue(),
243
+ on_mount: [],
244
+ on_destroy: [],
245
+ on_disconnect: [],
246
+ before_update: [],
247
+ after_update: [],
248
+ context: new Map(e.context || (f ? f.$$.context : [])),
249
+ callbacks: Ue(),
250
+ dirty: i,
251
+ skip_bound: !1,
252
+ root: e.target || f.$$.root
253
+ };
254
+ o && o(a.root);
255
+ let d = !1;
256
+ if (a.ctx = n ? n(t, e.props || {}, (b, E, ...R) => {
257
+ const h = R.length ? R[0] : E;
258
+ return a.ctx && r(a.ctx[b], a.ctx[b] = h) && (!a.skip_bound && a.bound[b] && a.bound[b](h), d && jt(t, b)), E;
259
+ }) : [], a.update(), d = !0, te(a.before_update), a.fragment = l ? l(a.ctx) : !1, e.target) {
260
+ if (e.hydrate) {
261
+ const b = Rt(e.target);
262
+ a.fragment && a.fragment.l(b), b.forEach(K);
263
+ } else
264
+ a.fragment && a.fragment.c();
265
+ e.intro && P(t.$$.fragment), ue(t, e.target, e.anchor, e.customElement), nt();
266
+ }
267
+ be(f);
268
+ }
269
+ class _e {
270
+ $destroy() {
271
+ ae(this, 1), this.$destroy = v;
272
+ }
273
+ $on(e, n) {
274
+ if (!$e(n))
275
+ return v;
276
+ const l = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
277
+ return l.push(n), () => {
278
+ const r = l.indexOf(n);
279
+ r !== -1 && l.splice(r, 1);
280
+ };
281
+ }
282
+ $set(e) {
283
+ this.$$set && !wt(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
284
+ }
285
+ }
286
+ function Ot(t) {
287
+ let e, n;
288
+ return {
289
+ c() {
290
+ e = ee("svg"), n = ee("path"), c(n, "d", "M500 115.1c212.2 0 384.9 172.6 384.9 384.9 0 212.2-172.7 384.9-384.9 384.9S115.1 712.2 115.1 500c0-212.4 172.5-384.9 384.9-384.9M500 10C229.4 10 10 229.4 10 500s219.4 490 490 490 490-219.4 490-490c-.2-270.6-219.5-490-490-490zm0 315c96.5 0 175 78.4 175 175 0 96.5-78.4 175-175 175-96.5 0-175-78.4-175-175 0-96.5 78.4-175 175-175m0-105c-154.7 0-279.9 125.4-279.9 279.9 0 154.7 125.4 279.9 279.9 279.9 154.5 0 279.9-125.4 279.9-279.9C779.9 345.3 654.5 220 500 220zm70 280c0 38.7-31.3 70-70 70s-70-31.3-70-70 31.3-70 70-70 70 31.3 70 70z"), c(e, "viewBox", "0 0 1000 1000"), c(e, "width", "18px"), c(e, "height", "18px"), c(e, "class", "svelte-en2qvf");
291
+ },
292
+ m(l, r) {
293
+ U(l, e, r), y(e, n);
294
+ },
295
+ p: v,
296
+ i: v,
297
+ o: v,
298
+ d(l) {
299
+ l && K(e);
300
+ }
301
+ };
302
+ }
303
+ class Nt extends _e {
304
+ constructor(e) {
305
+ super(), he(this, e, null, Ot, de, {});
306
+ }
307
+ }
308
+ function Dt(t) {
309
+ let e, n;
310
+ return {
311
+ c() {
312
+ e = ee("svg"), n = ee("path"), c(n, "d", "M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"), c(e, "viewBox", "0 0 18 18"), c(e, "width", "16"), c(e, "height", "16"), c(e, "class", "svelte-en2qvf");
313
+ },
314
+ m(l, r) {
315
+ U(l, e, r), y(e, n);
316
+ },
317
+ p: v,
318
+ i: v,
319
+ o: v,
320
+ d(l) {
321
+ l && K(e);
322
+ }
323
+ };
324
+ }
325
+ class qt extends _e {
326
+ constructor(e) {
327
+ super(), he(this, e, null, Dt, de, {});
328
+ }
329
+ }
330
+ function Kt(t) {
331
+ let e;
332
+ return {
333
+ c() {
334
+ e = z("div"), e.innerHTML = '<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>', c(e, "class", "svelte-7cmwmc");
335
+ },
336
+ m(n, l) {
337
+ U(n, e, l);
338
+ },
339
+ p: v,
340
+ i: v,
341
+ o: v,
342
+ d(n) {
343
+ n && K(e);
344
+ }
345
+ };
346
+ }
347
+ class Qt extends _e {
348
+ constructor(e) {
349
+ super(), he(this, e, null, Kt, de, {});
350
+ }
351
+ }
352
+ function Vt(t) {
353
+ let e, n, l;
354
+ return {
355
+ c() {
356
+ e = ee("svg"), n = ee("path"), c(n, "stroke-width", "4"), c(n, "fill-rule", "evenodd"), c(n, "clip-rule", "evenodd"), c(n, "d", "M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"), c(n, "class", "svelte-656hh2"), c(e, "width", l = t[0] !== "list" ? void 0 : "20"), c(e, "viewBox", "0 0 70 85"), c(e, "fill", "none"), c(e, "class", "svelte-656hh2"), N(e, "in-map", t[0] !== "list"), N(e, "for-maplibre", t[0] === "maplibre"), N(e, "for-leaflet", t[0] === "leaflet"), N(e, "list-icon", t[0] === "list");
357
+ },
358
+ m(r, u) {
359
+ U(r, e, u), y(e, n);
360
+ },
361
+ p(r, [u]) {
362
+ u & 1 && l !== (l = r[0] !== "list" ? void 0 : "20") && c(e, "width", l), u & 1 && N(e, "in-map", r[0] !== "list"), u & 1 && N(e, "for-maplibre", r[0] === "maplibre"), u & 1 && N(e, "for-leaflet", r[0] === "leaflet"), u & 1 && N(e, "list-icon", r[0] === "list");
363
+ },
364
+ i: v,
365
+ o: v,
366
+ d(r) {
367
+ r && K(e);
368
+ }
369
+ };
370
+ }
371
+ function Ut(t, e, n) {
372
+ let { displayIn: l } = e;
373
+ return t.$$set = (r) => {
374
+ "displayIn" in r && n(0, l = r.displayIn);
375
+ }, [l];
376
+ }
377
+ class lt extends _e {
378
+ constructor(e) {
379
+ super(), he(this, e, Ut, Vt, de, { displayIn: 0 });
380
+ }
381
+ }
382
+ function Wt(t) {
383
+ let e, n;
384
+ return {
385
+ c() {
386
+ e = ee("svg"), n = ee("path"), c(n, "d", "M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"), c(e, "viewBox", "0 0 18 18"), c(e, "xml:space", "preserve"), c(e, "width", "20"), c(e, "class", "svelte-en2qvf");
387
+ },
388
+ m(l, r) {
389
+ U(l, e, r), y(e, n);
390
+ },
391
+ p: v,
392
+ i: v,
393
+ o: v,
394
+ d(l) {
395
+ l && K(e);
396
+ }
397
+ };
398
+ }
399
+ class Gt extends _e {
400
+ constructor(e) {
401
+ super(), he(this, e, null, Wt, de, {});
402
+ }
403
+ }
404
+ function Ze(t, e, n) {
405
+ const l = t.slice();
406
+ return l[59] = e[n], l[61] = n, l;
407
+ }
408
+ function xe(t) {
409
+ let e, n;
410
+ return e = new Qt({}), {
411
+ c() {
412
+ we(e.$$.fragment);
413
+ },
414
+ m(l, r) {
415
+ ue(e, l, r), n = !0;
416
+ },
417
+ i(l) {
418
+ n || (P(e.$$.fragment, l), n = !0);
419
+ },
420
+ o(l) {
421
+ q(e.$$.fragment, l), n = !1;
422
+ },
423
+ d(l) {
424
+ ae(e, l);
425
+ }
426
+ };
427
+ }
428
+ function Je(t) {
429
+ let e, n, l, r, u, o;
430
+ return n = new Nt({}), {
431
+ c() {
432
+ e = z("button"), we(n.$$.fragment), c(e, "type", "button"), c(e, "title", l = t[7] === !0 ? "toggle reverse geocoding" : t[7]), c(e, "class", "svelte-16s24r9"), N(e, "active", t[1]);
433
+ },
434
+ m(i, f) {
435
+ U(i, e, f), ue(n, e, null), r = !0, u || (o = V(e, "click", t[47]), u = !0);
436
+ },
437
+ p(i, f) {
438
+ (!r || f[0] & 128 && l !== (l = i[7] === !0 ? "toggle reverse geocoding" : i[7])) && c(e, "title", l), (!r || f[0] & 2) && N(e, "active", i[1]);
439
+ },
440
+ i(i) {
441
+ r || (P(n.$$.fragment, i), r = !0);
442
+ },
443
+ o(i) {
444
+ q(n.$$.fragment, i), r = !1;
445
+ },
446
+ d(i) {
447
+ i && K(e), ae(n), u = !1, o();
448
+ }
449
+ };
450
+ }
451
+ function Ht(t) {
452
+ let e, n, l, r, u = t[10], o = [];
453
+ for (let f = 0; f < u.length; f += 1)
454
+ o[f] = Ye(Ze(t, u, f));
455
+ const i = (f) => q(o[f], 1, 1, () => {
456
+ o[f] = null;
457
+ });
458
+ return {
459
+ c() {
460
+ e = z("ul");
461
+ for (let f = 0; f < o.length; f += 1)
462
+ o[f].c();
463
+ c(e, "class", "svelte-16s24r9");
464
+ },
465
+ m(f, a) {
466
+ U(f, e, a);
467
+ for (let d = 0; d < o.length; d += 1)
468
+ o[d].m(e, null);
469
+ n = !0, l || (r = [
470
+ V(e, "mouseout", t[50]),
471
+ V(e, "blur", t[51])
472
+ ], l = !0);
473
+ },
474
+ p(f, a) {
475
+ if (a[0] & 7425) {
476
+ u = f[10];
477
+ let d;
478
+ for (d = 0; d < u.length; d += 1) {
479
+ const b = Ze(f, u, d);
480
+ o[d] ? (o[d].p(b, a), P(o[d], 1)) : (o[d] = Ye(b), o[d].c(), P(o[d], 1), o[d].m(e, null));
481
+ }
482
+ for (Le(), d = u.length; d < o.length; d += 1)
483
+ i(d);
484
+ Ee();
485
+ }
486
+ },
487
+ i(f) {
488
+ if (!n) {
489
+ for (let a = 0; a < u.length; a += 1)
490
+ P(o[a]);
491
+ n = !0;
492
+ }
493
+ },
494
+ o(f) {
495
+ o = o.filter(Boolean);
496
+ for (let a = 0; a < o.length; a += 1)
497
+ q(o[a]);
498
+ n = !1;
499
+ },
500
+ d(f) {
501
+ f && K(e), Lt(o, f), l = !1, te(r);
502
+ }
503
+ };
504
+ }
505
+ function Zt(t) {
506
+ let e, n;
507
+ return {
508
+ c() {
509
+ e = z("div"), n = ie(t[5]), c(e, "class", "no-results svelte-16s24r9");
510
+ },
511
+ m(l, r) {
512
+ U(l, e, r), y(e, n);
513
+ },
514
+ p(l, r) {
515
+ r[0] & 32 && pe(n, l[5]);
516
+ },
517
+ i: v,
518
+ o: v,
519
+ d(l) {
520
+ l && K(e);
521
+ }
522
+ };
523
+ }
524
+ function xt(t) {
525
+ let e, n;
526
+ return {
527
+ c() {
528
+ e = z("div"), n = ie(t[4]), c(e, "class", "error svelte-16s24r9");
529
+ },
530
+ m(l, r) {
531
+ U(l, e, r), y(e, n);
532
+ },
533
+ p(l, r) {
534
+ r[0] & 16 && pe(n, l[4]);
535
+ },
536
+ i: v,
537
+ o: v,
538
+ d(l) {
539
+ l && K(e);
540
+ }
541
+ };
542
+ }
543
+ function Jt(t) {
544
+ let e = "", n;
545
+ return {
546
+ c() {
547
+ n = ie(e);
548
+ },
549
+ m(l, r) {
550
+ U(l, n, r);
551
+ },
552
+ p: v,
553
+ i: v,
554
+ o: v,
555
+ d(l) {
556
+ l && K(n);
557
+ }
558
+ };
559
+ }
560
+ function Xe(t) {
561
+ let e, n = t[59].place_type + "", l;
562
+ return {
563
+ c() {
564
+ e = z("span"), l = ie(n), c(e, "class", "svelte-16s24r9");
565
+ },
566
+ m(r, u) {
567
+ U(r, e, u), y(e, l);
568
+ },
569
+ p(r, u) {
570
+ u[0] & 1024 && n !== (n = r[59].place_type + "") && pe(l, n);
571
+ },
572
+ d(r) {
573
+ r && K(e);
574
+ }
575
+ };
576
+ }
577
+ function Ye(t) {
578
+ let e, n, l, r, u, o, i = t[59].place_name.replace(/,.*/, "") + "", f, a, d, b, E, R = t[59].place_name.replace(/[^,]*,?\s*/, "") + "", h, g, m, w, M, W;
579
+ n = new lt({ props: { displayIn: "list" } });
580
+ let C = t[8] && Xe(t);
581
+ function T() {
582
+ return t[48](t[61]);
583
+ }
584
+ function p() {
585
+ return t[49](t[59]);
586
+ }
587
+ return {
588
+ c() {
589
+ e = z("li"), we(n.$$.fragment), l = x(), r = z("span"), u = z("span"), o = z("span"), f = ie(i), a = x(), C && C.c(), d = x(), b = z("span"), E = z("span"), h = ie(R), g = x(), c(o, "class", "svelte-16s24r9"), c(u, "class", "svelte-16s24r9"), c(r, "class", "svelte-16s24r9"), c(E, "class", "svelte-16s24r9"), c(b, "class", "svelte-16s24r9"), c(e, "tabindex", "0"), c(e, "data-selected", m = t[12] === t[61]), c(e, "class", "svelte-16s24r9"), N(e, "selected", t[12] === t[61]);
590
+ },
591
+ m(O, k) {
592
+ U(O, e, k), ue(n, e, null), y(e, l), y(e, r), y(r, u), y(u, o), y(o, f), y(u, a), C && C.m(u, null), y(e, d), y(e, b), y(b, E), y(E, h), y(e, g), w = !0, M || (W = [
593
+ V(e, "mouseover", T),
594
+ V(e, "focus", p)
595
+ ], M = !0);
596
+ },
597
+ p(O, k) {
598
+ t = O, (!w || k[0] & 1024) && i !== (i = t[59].place_name.replace(/,.*/, "") + "") && pe(f, i), t[8] ? C ? C.p(t, k) : (C = Xe(t), C.c(), C.m(u, null)) : C && (C.d(1), C = null), (!w || k[0] & 1024) && R !== (R = t[59].place_name.replace(/[^,]*,?\s*/, "") + "") && pe(h, R), (!w || k[0] & 4096 && m !== (m = t[12] === t[61])) && c(e, "data-selected", m), (!w || k[0] & 4096) && N(e, "selected", t[12] === t[61]);
599
+ },
600
+ i(O) {
601
+ w || (P(n.$$.fragment, O), w = !0);
602
+ },
603
+ o(O) {
604
+ q(n.$$.fragment, O), w = !1;
605
+ },
606
+ d(O) {
607
+ O && K(e), ae(n), C && C.d(), M = !1, te(W);
608
+ }
609
+ };
610
+ }
611
+ function Xt(t) {
612
+ let e, n, l, r, u, o, i, f, a, d, b, E, R, h, g, m, w, M, W, C;
613
+ r = new Gt({}), d = new qt({});
614
+ let T = t[16] && xe(), p = t[7] && Je(t);
615
+ const O = t[39].default, k = kt(O, t, t[38], null), S = [Jt, xt, Zt, Ht], j = [];
616
+ function ge(_, I) {
617
+ var J, X;
618
+ return _[13] ? _[15] ? 1 : ((J = _[10]) == null ? void 0 : J.length) === 0 ? 2 : _[13] && ((X = _[10]) == null ? void 0 : X.length) ? 3 : -1 : 0;
619
+ }
620
+ return ~(g = ge(t)) && (m = j[g] = S[g](t)), {
621
+ c() {
622
+ e = z("form"), n = z("div"), l = z("button"), we(r.$$.fragment), u = x(), o = z("input"), i = x(), f = z("div"), a = z("button"), we(d.$$.fragment), b = x(), T && T.c(), E = x(), p && p.c(), R = x(), k && k.c(), h = x(), m && m.c(), c(l, "type", "button"), c(l, "class", "svelte-16s24r9"), c(o, "placeholder", t[3]), c(o, "aria-label", t[3]), c(o, "class", "svelte-16s24r9"), c(a, "type", "button"), c(a, "class", "svelte-16s24r9"), N(a, "displayable", t[0] !== ""), c(f, "class", "clear-button-container svelte-16s24r9"), c(n, "class", "input-group svelte-16s24r9"), c(e, "tabindex", "0"), c(e, "class", w = We(t[2]) + " svelte-16s24r9"), N(e, "can-collapse", t[6] && t[0] === "");
623
+ },
624
+ m(_, I) {
625
+ U(_, e, I), y(e, n), y(n, l), ue(r, l, null), y(n, u), y(n, o), t[41](o), Ge(o, t[0]), y(n, i), y(n, f), y(f, a), ue(d, a, null), y(f, b), T && T.m(f, null), y(n, E), p && p.m(n, null), y(n, R), k && k.m(n, null), y(e, h), ~g && j[g].m(e, null), M = !0, W || (C = [
626
+ V(l, "click", t[40]),
627
+ V(o, "input", t[42]),
628
+ V(o, "focus", t[43]),
629
+ V(o, "blur", t[44]),
630
+ V(o, "keydown", t[18]),
631
+ V(o, "input", t[45]),
632
+ V(a, "click", t[46]),
633
+ V(e, "submit", Et(t[17]))
634
+ ], W = !0);
635
+ },
636
+ p(_, I) {
637
+ (!M || I[0] & 8) && c(o, "placeholder", _[3]), (!M || I[0] & 8) && c(o, "aria-label", _[3]), I[0] & 1 && o.value !== _[0] && Ge(o, _[0]), (!M || I[0] & 1) && N(a, "displayable", _[0] !== ""), _[16] ? T ? I[0] & 65536 && P(T, 1) : (T = xe(), T.c(), P(T, 1), T.m(f, null)) : T && (Le(), q(T, 1, 1, () => {
638
+ T = null;
639
+ }), Ee()), _[7] ? p ? (p.p(_, I), I[0] & 128 && P(p, 1)) : (p = Je(_), p.c(), P(p, 1), p.m(n, R)) : p && (Le(), q(p, 1, 1, () => {
640
+ p = null;
641
+ }), Ee()), k && k.p && (!M || I[1] & 128) && Ct(
642
+ k,
643
+ O,
644
+ _,
645
+ _[38],
646
+ M ? Mt(O, _[38], I, null) : Tt(_[38]),
647
+ null
648
+ );
649
+ let J = g;
650
+ g = ge(_), g === J ? ~g && j[g].p(_, I) : (m && (Le(), q(j[J], 1, 1, () => {
651
+ j[J] = null;
652
+ }), Ee()), ~g ? (m = j[g], m ? m.p(_, I) : (m = j[g] = S[g](_), m.c()), P(m, 1), m.m(e, null)) : m = null), (!M || I[0] & 4 && w !== (w = We(_[2]) + " svelte-16s24r9")) && c(e, "class", w), (!M || I[0] & 69) && N(e, "can-collapse", _[6] && _[0] === "");
653
+ },
654
+ i(_) {
655
+ M || (P(r.$$.fragment, _), P(d.$$.fragment, _), P(T), P(p), P(k, _), P(m), M = !0);
656
+ },
657
+ o(_) {
658
+ q(r.$$.fragment, _), q(d.$$.fragment, _), q(T), q(p), q(k, _), q(m), M = !1;
659
+ },
660
+ d(_) {
661
+ _ && K(e), ae(r), t[41](null), ae(d), T && T.d(), p && p.d(), k && k.d(_), ~g && j[g].d(), W = !1, te(C);
662
+ }
663
+ };
664
+ }
665
+ function Yt(t, e, n) {
666
+ let l, { $$slots: r = {}, $$scope: u } = e, { class: o = void 0 } = e, { mapController: i = void 0 } = e, { apiKey: f } = e, { debounceSearch: a = 200 } = e, { placeholder: d = "Search" } = e, { errorMessage: b = "Searching failed" } = e, { noResultsMessage: E = "No results found" } = e, { proximity: R = void 0 } = e, { bbox: h = void 0 } = e, { trackProximity: g = !0 } = e, { minLength: m = 2 } = e, { language: w = void 0 } = e, { showResultsWhileTyping: M = !0 } = e, { zoom: W = 16 } = e, { flyTo: C = !0 } = e, { collapsed: T = !1 } = e, { clearOnBlur: p = !1 } = e, { enableReverse: O = !1 } = e, { filter: k = () => !0 } = e, { searchValue: S = "" } = e, { reverseActive: j = !1 } = e, { showPlaceType: ge = !1 } = e;
667
+ function _() {
668
+ Y.focus();
669
+ }
670
+ function I() {
671
+ Y.blur();
672
+ }
673
+ function J(s, Q = !0) {
674
+ n(0, S = s), Q && (n(12, A = -1), Ne());
675
+ }
676
+ let X = !1, L, D, B, je = "", Y, A = -1, ne, Oe = [], le, Re, Se;
677
+ const F = Bt();
678
+ It(() => {
679
+ i && (i.setProximityChangeHandler(void 0), i.setMapClickHandler(void 0), i.indicateReverse(!1), i.setSelectedMarker(-1), i.setMarkers(void 0, void 0));
680
+ });
681
+ function Ne() {
682
+ A > -1 && L ? (n(11, B = L[A]), n(0, S = B.place_name.replace(/,.*/, "")), n(15, ne = void 0), n(36, D = void 0), n(12, A = -1)) : S && De(S).then(() => {
683
+ n(36, D = L), n(11, B = void 0), rt();
684
+ }).catch((s) => n(15, ne = s));
685
+ }
686
+ async function De(s) {
687
+ n(15, ne = void 0);
688
+ const Q = /^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(s), H = new URLSearchParams();
689
+ H.set("key", f), w && H.set("language", String(w)), Q || (h && H.set("bbox", h.join(",")), R && H.set("proximity", R.join(",")));
690
+ const re = "https://api.maptiler.com/geocoding/" + encodeURIComponent(s) + ".json?" + H.toString();
691
+ if (re === je) {
692
+ n(10, L = Oe);
693
+ return;
694
+ }
695
+ je = re, le == null || le.abort(), n(16, le = new AbortController());
696
+ let ce;
697
+ try {
698
+ ce = await fetch(re, { signal: le.signal }).finally(() => {
699
+ n(16, le = void 0);
700
+ });
701
+ } catch (fe) {
702
+ if (fe && typeof fe == "object" && fe.name === "AbortError")
703
+ return;
704
+ throw new Error();
705
+ }
706
+ if (!ce.ok)
707
+ throw new Error();
708
+ const me = await ce.json();
709
+ F("response", { url: re, featureCollection: me }), n(10, L = me.features.filter(k)), Oe = L, Q && Y.focus();
710
+ }
711
+ function rt() {
712
+ var Q, H, re, ce, me, fe, Ke, Qe;
713
+ if (!(D != null && D.length) || !C)
714
+ return;
715
+ const s = [180, 90, -180, -90];
716
+ for (const $ of D)
717
+ s[0] = Math.min(s[0], (H = (Q = $.bbox) == null ? void 0 : Q[0]) != null ? H : $.center[0]), s[1] = Math.min(s[1], (ce = (re = $.bbox) == null ? void 0 : re[1]) != null ? ce : $.center[1]), s[2] = Math.max(s[2], (fe = (me = $.bbox) == null ? void 0 : me[2]) != null ? fe : $.center[0]), s[3] = Math.max(s[3], (Qe = (Ke = $.bbox) == null ? void 0 : Ke[3]) != null ? Qe : $.center[1]);
718
+ i && D.length > 0 && (B && s[0] === s[2] && s[1] === s[3] ? i.flyTo(B.center, W) : i.fitBounds(s, 50));
719
+ }
720
+ function st(s) {
721
+ n(1, j = !1), J(s[0].toFixed(6) + "," + s[1].toFixed(6));
722
+ }
723
+ function ot(s) {
724
+ if (!L)
725
+ return;
726
+ let Q = s.key === "ArrowDown" ? 1 : s.key === "ArrowUp" ? -1 : 0;
727
+ Q ? (A === -1 && Q === -1 && n(12, A = L.length), n(12, A += Q), A >= L.length && n(12, A = -1), s.preventDefault()) : ["ArrowLeft", "ArrowRight", "Home", "End"].includes(s.key) && n(12, A = -1);
728
+ }
729
+ function qe(s = !0) {
730
+ if (M && S.length > m) {
731
+ Re && clearTimeout(Re);
732
+ const Q = S;
733
+ Re = window.setTimeout(
734
+ () => {
735
+ De(Q).catch((H) => n(15, ne = H));
736
+ },
737
+ s ? a : 0
738
+ );
739
+ } else
740
+ n(10, L = void 0), n(15, ne = void 0);
741
+ }
742
+ const it = () => Y.focus();
743
+ function ct(s) {
744
+ Ae[s ? "unshift" : "push"](() => {
745
+ Y = s, n(14, Y);
746
+ });
747
+ }
748
+ function ft() {
749
+ S = this.value, n(0, S), n(9, X), n(31, p);
750
+ }
751
+ const ut = () => n(9, X = !0), at = () => n(9, X = !1), dt = () => qe(), ht = () => {
752
+ n(0, S = ""), Y.focus();
753
+ }, _t = () => n(1, j = !j), gt = (s) => n(12, A = s), mt = (s) => {
754
+ n(11, B = s), n(0, S = s.place_name.replace(/,.*/, "")), n(12, A = -1);
755
+ }, yt = () => n(12, A = -1), bt = () => {
756
+ };
757
+ return t.$$set = (s) => {
758
+ "class" in s && n(2, o = s.class), "mapController" in s && n(21, i = s.mapController), "apiKey" in s && n(22, f = s.apiKey), "debounceSearch" in s && n(23, a = s.debounceSearch), "placeholder" in s && n(3, d = s.placeholder), "errorMessage" in s && n(4, b = s.errorMessage), "noResultsMessage" in s && n(5, E = s.noResultsMessage), "proximity" in s && n(20, R = s.proximity), "bbox" in s && n(24, h = s.bbox), "trackProximity" in s && n(25, g = s.trackProximity), "minLength" in s && n(26, m = s.minLength), "language" in s && n(27, w = s.language), "showResultsWhileTyping" in s && n(28, M = s.showResultsWhileTyping), "zoom" in s && n(29, W = s.zoom), "flyTo" in s && n(30, C = s.flyTo), "collapsed" in s && n(6, T = s.collapsed), "clearOnBlur" in s && n(31, p = s.clearOnBlur), "enableReverse" in s && n(7, O = s.enableReverse), "filter" in s && n(32, k = s.filter), "searchValue" in s && n(0, S = s.searchValue), "reverseActive" in s && n(1, j = s.reverseActive), "showPlaceType" in s && n(8, ge = s.showPlaceType), "$$scope" in s && n(38, u = s.$$scope);
759
+ }, t.$$.update = () => {
760
+ t.$$.dirty[0] & 35651584 && i && i.setProximityChangeHandler(g ? (s) => {
761
+ n(20, R = s);
762
+ } : void 0), t.$$.dirty[0] & 33554432 && (g || n(20, R = void 0)), t.$$.dirty[0] & 512 | t.$$.dirty[1] & 1 && setTimeout(() => {
763
+ n(13, Se = X), p && !X && n(0, S = "");
764
+ }), t.$$.dirty[0] & 1025 && (S || (n(11, B = void 0), n(10, L = void 0), n(15, ne = void 0), n(36, D = L))), t.$$.dirty[0] & 1612711936 && i && B && C && (!B.bbox || B.bbox[0] === B.bbox[2] && B.bbox[1] === B.bbox[3] ? i.flyTo(B.center, W) : i.fitBounds(B.bbox, 0), n(10, L = void 0), n(36, D = void 0), n(12, A = -1)), t.$$.dirty[0] & 1024 | t.$$.dirty[1] & 32 && D !== L && n(36, D = void 0), t.$$.dirty[0] & 2099200 | t.$$.dirty[1] & 32 && i && i.setMarkers(D, B), t.$$.dirty[0] & 1 && n(12, A = -1), t.$$.dirty[0] & 2101248 && (i == null || i.setSelectedMarker(A)), t.$$.dirty[0] & 5120 && n(37, l = L == null ? void 0 : L[A]), t.$$.dirty[1] & 64 && F("select", l), t.$$.dirty[0] & 2048 && F("pick", B), t.$$.dirty[0] & 9216 && F("optionsVisibilityChange", Se && !!L), t.$$.dirty[0] & 1024 && F("featuresListed", L), t.$$.dirty[1] & 32 && F("featuresMarked", D), t.$$.dirty[0] & 2 && F("reverseToggle", j), t.$$.dirty[0] & 1 && F("queryChange", S), t.$$.dirty[0] & 2097154 && i && i.indicateReverse(j), t.$$.dirty[0] & 2097154 && i && i.setMapClickHandler(j ? st : void 0);
765
+ }, [
766
+ S,
767
+ j,
768
+ o,
769
+ d,
770
+ b,
771
+ E,
772
+ T,
773
+ O,
774
+ ge,
775
+ X,
776
+ L,
777
+ B,
778
+ A,
779
+ Se,
780
+ Y,
781
+ ne,
782
+ le,
783
+ Ne,
784
+ ot,
785
+ qe,
786
+ R,
787
+ i,
788
+ f,
789
+ a,
790
+ h,
791
+ g,
792
+ m,
793
+ w,
794
+ M,
795
+ W,
796
+ C,
797
+ p,
798
+ k,
799
+ _,
800
+ I,
801
+ J,
802
+ D,
803
+ l,
804
+ u,
805
+ r,
806
+ it,
807
+ ct,
808
+ ft,
809
+ ut,
810
+ at,
811
+ dt,
812
+ ht,
813
+ _t,
814
+ gt,
815
+ mt,
816
+ yt,
817
+ bt
818
+ ];
819
+ }
820
+ class Ft extends _e {
821
+ constructor(e) {
822
+ super(), he(
823
+ this,
824
+ e,
825
+ Yt,
826
+ Xt,
827
+ de,
828
+ {
829
+ class: 2,
830
+ mapController: 21,
831
+ apiKey: 22,
832
+ debounceSearch: 23,
833
+ placeholder: 3,
834
+ errorMessage: 4,
835
+ noResultsMessage: 5,
836
+ proximity: 20,
837
+ bbox: 24,
838
+ trackProximity: 25,
839
+ minLength: 26,
840
+ language: 27,
841
+ showResultsWhileTyping: 28,
842
+ zoom: 29,
843
+ flyTo: 30,
844
+ collapsed: 6,
845
+ clearOnBlur: 31,
846
+ enableReverse: 7,
847
+ filter: 32,
848
+ searchValue: 0,
849
+ reverseActive: 1,
850
+ showPlaceType: 8,
851
+ focus: 33,
852
+ blur: 34,
853
+ setQuery: 35
854
+ },
855
+ null,
856
+ [-1, -1]
857
+ );
858
+ }
859
+ get focus() {
860
+ return this.$$.ctx[33];
861
+ }
862
+ get blur() {
863
+ return this.$$.ctx[34];
864
+ }
865
+ get setQuery() {
866
+ return this.$$.ctx[35];
867
+ }
868
+ }
869
+ function $t(t, e, n = !0, l = !0, r = {}, u = {}) {
870
+ let o, i, f, a = [], d;
871
+ const b = (h) => {
872
+ i == null || i([h.lngLat.lng, h.lngLat.lat]);
873
+ }, E = () => {
874
+ let h;
875
+ const g = t.getZoom() > 9 ? [(h = t.getCenter().wrap()).lng, h.lat] : void 0;
876
+ f !== g && (f = g, o == null || o(g));
877
+ };
878
+ return {
879
+ setProximityChangeHandler(h) {
880
+ h ? (o = h, t.on("moveend", E), E()) : (t.off("moveend", E), o == null || o(void 0), o = void 0);
881
+ },
882
+ setMapClickHandler(h) {
883
+ i = h, i ? t.on("click", b) : t.off("click", b);
884
+ },
885
+ flyTo(h, g) {
886
+ t.flyTo({ center: h, zoom: g, ...r });
887
+ },
888
+ fitBounds(h, g) {
889
+ t.fitBounds(
890
+ [
891
+ [h[0], h[1]],
892
+ [h[2], h[3]]
893
+ ],
894
+ { ...u, padding: g }
895
+ );
896
+ },
897
+ indicateReverse(h) {
898
+ t.getCanvas().style.cursor = h ? "crosshair" : "";
899
+ },
900
+ setMarkers(h, g) {
901
+ for (const m of a)
902
+ m.remove();
903
+ if (a.length = 0, !!e)
904
+ for (const m of g ? [...h != null ? h : [], g] : h != null ? h : []) {
905
+ let w;
906
+ if (m === g && typeof n == "object")
907
+ w = new e.Marker(n);
908
+ else if (m !== g && typeof l == "object")
909
+ w = new e.Marker(l);
910
+ else {
911
+ const M = document.createElement("div");
912
+ new lt({ props: { displayIn: "maplibre" }, target: M }), w = new e.Marker({ element: M });
913
+ }
914
+ a.push(w.setLngLat(m.center).addTo(t));
915
+ }
916
+ },
917
+ setSelectedMarker(h) {
918
+ d && d.getElement().classList.toggle("marker-selected", !1), d = h > -1 ? a[h] : void 0, d == null || d.getElement().classList.toggle("marker-selected", !0);
919
+ }
920
+ };
921
+ }
922
+ var G, oe;
923
+ class nn extends pt {
924
+ constructor(n) {
925
+ super();
926
+ Ie(this, G, void 0);
927
+ Ie(this, oe, void 0);
928
+ ke(this, oe, n);
929
+ }
930
+ onAdd(n) {
931
+ const l = document.createElement("div");
932
+ l.className = "mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl";
933
+ const { maplibregl: r, marker: u, showResultMarkers: o, flyTo: i, ...f } = Z(this, oe), a = typeof i == "boolean" ? {} : i, d = $t(
934
+ n,
935
+ r,
936
+ u,
937
+ o,
938
+ a,
939
+ a
940
+ );
941
+ ke(this, G, new Ft({
942
+ target: l,
943
+ props: {
944
+ mapController: d,
945
+ flyTo: i === void 0 ? !0 : !!i,
946
+ ...f
947
+ }
948
+ }));
949
+ for (const b of [
950
+ "select",
951
+ "pick",
952
+ "featuresListed",
953
+ "featuresMarked",
954
+ "response",
955
+ "optionsVisibilityChange",
956
+ "reverseToggle",
957
+ "queryChange"
958
+ ])
959
+ Z(this, G).$on(
960
+ b,
961
+ (E) => this.fire(b.toLowerCase(), E.detail)
962
+ );
963
+ return l;
964
+ }
965
+ setOptions(n) {
966
+ var f;
967
+ ke(this, oe, n);
968
+ const { maplibregl: l, marker: r, showResultMarkers: u, flyTo: o, ...i } = Z(this, oe);
969
+ (f = Z(this, G)) == null || f.$set(i);
970
+ }
971
+ setQuery(n, l = !0) {
972
+ var r;
973
+ (r = Z(this, G)) == null || r.setQuery(n, l);
974
+ }
975
+ setReverseMode(n) {
976
+ var l;
977
+ (l = Z(this, G)) == null || l.$set({ reverseActive: n });
978
+ }
979
+ focus() {
980
+ var n;
981
+ (n = Z(this, G)) == null || n.focus();
982
+ }
983
+ blur() {
984
+ var n;
985
+ (n = Z(this, G)) == null || n.blur();
986
+ }
987
+ onRemove() {
988
+ var n;
989
+ (n = Z(this, G)) == null || n.$destroy();
990
+ }
991
+ }
992
+ G = new WeakMap(), oe = new WeakMap();
993
+ export {
994
+ nn as GeocodingControl
995
+ };