@maptiler/geocoding-control 3.0.0-rc.5 → 3.0.0-rc.6

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.
@@ -1,21 +1,21 @@
1
1
  import { css as I, LitElement as O, svg as z, html as m, unsafeCSS as ce, nothing as X } from "lit";
2
- import { customElement as M, property as p, state as b, query as De } from "lit/decorators.js";
3
- import { convert as We } from "geo-coordinates-parser";
2
+ import { customElement as M, property as p, state as k, query as We } from "lit/decorators.js";
3
+ import { convert as Ve } from "geo-coordinates-parser";
4
4
  import { classMap as A } from "lit/directives/class-map.js";
5
- import { repeat as Ve } from "lit/directives/repeat.js";
5
+ import { repeat as qe } from "lit/directives/repeat.js";
6
6
  import "@turf/clone";
7
- import { styleMap as qe } from "lit/directives/style-map.js";
8
- import { config as Ne } from "@maptiler/sdk";
9
- import { featureCollection as q, polygon as Ze, feature as Ke } from "@turf/helpers";
10
- import Le from "@turf/union";
7
+ import { styleMap as Ne } from "lit/directives/style-map.js";
8
+ import { config as Ze } from "@maptiler/sdk";
9
+ import { featureCollection as q, polygon as Ke, feature as Qe } from "@turf/helpers";
10
+ import $e from "@turf/union";
11
11
  import he from "maplibre-gl";
12
- import be from "@turf/bbox";
13
- import Qe from "@turf/difference";
14
- import Ye from "@turf/flatten";
15
- var He = Object.getOwnPropertyDescriptor, Je = (t, e, i, o) => {
16
- for (var r = o > 1 ? void 0 : o ? He(e, i) : e, s = t.length - 1, a; s >= 0; s--)
17
- (a = t[s]) && (r = a(r) || r);
18
- return r;
12
+ import ke from "@turf/bbox";
13
+ import Ye from "@turf/difference";
14
+ import He from "@turf/flatten";
15
+ var Je = Object.getOwnPropertyDescriptor, Xe = (t, e, i, a) => {
16
+ for (var s = a > 1 ? void 0 : a ? Je(e, i) : e, o = t.length - 1, r; o >= 0; o--)
17
+ (r = t[o]) && (s = r(s) || s);
18
+ return s;
19
19
  };
20
20
  let ee = class extends O {
21
21
  render() {
@@ -34,13 +34,13 @@ ee.styles = I`
34
34
  fill: var(--color-icon-button);
35
35
  }
36
36
  `;
37
- ee = Je([
37
+ ee = Xe([
38
38
  M("maptiler-geocode-clear-icon")
39
39
  ], ee);
40
- var Xe = Object.getOwnPropertyDescriptor, et = (t, e, i, o) => {
41
- for (var r = o > 1 ? void 0 : o ? Xe(e, i) : e, s = t.length - 1, a; s >= 0; s--)
42
- (a = t[s]) && (r = a(r) || r);
43
- return r;
40
+ var et = Object.getOwnPropertyDescriptor, tt = (t, e, i, a) => {
41
+ for (var s = a > 1 ? void 0 : a ? et(e, i) : e, o = t.length - 1, r; o >= 0; o--)
42
+ (r = t[o]) && (s = r(s) || s);
43
+ return s;
44
44
  };
45
45
  let te = class extends O {
46
46
  render() {
@@ -59,13 +59,13 @@ te.styles = I`
59
59
  fill: #e15042;
60
60
  }
61
61
  `;
62
- te = et([
62
+ te = tt([
63
63
  M("maptiler-geocode-fail-icon")
64
64
  ], te);
65
- var tt = Object.getOwnPropertyDescriptor, it = (t, e, i, o) => {
66
- for (var r = o > 1 ? void 0 : o ? tt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
67
- (a = t[s]) && (r = a(r) || r);
68
- return r;
65
+ var it = Object.getOwnPropertyDescriptor, st = (t, e, i, a) => {
66
+ for (var s = a > 1 ? void 0 : a ? it(e, i) : e, o = t.length - 1, r; o >= 0; o--)
67
+ (r = t[o]) && (s = r(s) || s);
68
+ return s;
69
69
  };
70
70
  let ie = class extends O {
71
71
  render() {
@@ -106,13 +106,13 @@ ie.styles = I`
106
106
  }
107
107
  }
108
108
  `;
109
- ie = it([
109
+ ie = st([
110
110
  M("maptiler-geocode-loading-icon")
111
111
  ], ie);
112
- var st = Object.getOwnPropertyDescriptor, rt = (t, e, i, o) => {
113
- for (var r = o > 1 ? void 0 : o ? st(e, i) : e, s = t.length - 1, a; s >= 0; s--)
114
- (a = t[s]) && (r = a(r) || r);
115
- return r;
112
+ var rt = Object.getOwnPropertyDescriptor, ot = (t, e, i, a) => {
113
+ for (var s = a > 1 ? void 0 : a ? rt(e, i) : e, o = t.length - 1, r; o >= 0; o--)
114
+ (r = t[o]) && (s = r(s) || s);
115
+ return s;
116
116
  };
117
117
  let se = class extends O {
118
118
  render() {
@@ -131,13 +131,13 @@ se.styles = I`
131
131
  fill: var(--color-icon-button);
132
132
  }
133
133
  `;
134
- se = rt([
134
+ se = ot([
135
135
  M("maptiler-geocode-reverse-geocoding-icon")
136
136
  ], se);
137
- var ot = Object.getOwnPropertyDescriptor, at = (t, e, i, o) => {
138
- for (var r = o > 1 ? void 0 : o ? ot(e, i) : e, s = t.length - 1, a; s >= 0; s--)
139
- (a = t[s]) && (r = a(r) || r);
140
- return r;
137
+ var at = Object.getOwnPropertyDescriptor, lt = (t, e, i, a) => {
138
+ for (var s = a > 1 ? void 0 : a ? at(e, i) : e, o = t.length - 1, r; o >= 0; o--)
139
+ (r = t[o]) && (s = r(s) || s);
140
+ return s;
141
141
  };
142
142
  let re = class extends O {
143
143
  render() {
@@ -170,74 +170,74 @@ re.styles = I`
170
170
  stroke: var(--color-icon-button);
171
171
  }
172
172
  `;
173
- re = at([
173
+ re = lt([
174
174
  M("maptiler-geocode-search-icon")
175
175
  ], re);
176
- function lt(t, e, i) {
177
- const o = e[1], r = e[0], s = o - r;
178
- return t === o && i ? t : ((t - r) % s + s) % s + r;
176
+ function nt(t, e, i) {
177
+ const a = e[1], s = e[0], o = a - s;
178
+ return t === a && i ? t : ((t - s) % o + o) % o + s;
179
179
  }
180
180
  function N(t) {
181
181
  const e = [...t];
182
182
  return e[2] < e[0] && (Math.abs((e[0] + e[2] + 360) / 2) > Math.abs((e[0] - 360 + e[2]) / 2) ? e[0] -= 360 : e[2] += 360), e;
183
183
  }
184
184
  let U;
185
- async function nt(t, e, i) {
186
- for (const o of e ?? [])
187
- if (!(t && (o.minZoom != null && o.minZoom > t[0] || o.maxZoom != null && o.maxZoom < t[0]))) {
188
- if (o.type === "fixed")
189
- return o.coordinates.join(",");
190
- if (o.type === "client-geolocation")
191
- if (U && o.cachedLocationExpiry && U.time + o.cachedLocationExpiry > Date.now()) {
185
+ async function ct(t, e, i) {
186
+ for (const a of e ?? [])
187
+ if (!(t && (a.minZoom != null && a.minZoom > t[0] || a.maxZoom != null && a.maxZoom < t[0]))) {
188
+ if (a.type === "fixed")
189
+ return a.coordinates.join(",");
190
+ if (a.type === "client-geolocation")
191
+ if (U && a.cachedLocationExpiry && U.time + a.cachedLocationExpiry > Date.now()) {
192
192
  if (U.coords)
193
193
  return U.coords;
194
194
  } else {
195
- let r;
195
+ let s;
196
196
  try {
197
- return r = await new Promise((s, a) => {
197
+ return s = await new Promise((o, r) => {
198
198
  i.signal.addEventListener("abort", () => {
199
- a(Error("aborted"));
199
+ r(Error("aborted"));
200
200
  }), navigator.geolocation.getCurrentPosition(
201
- (f) => {
202
- s([f.coords.longitude, f.coords.latitude].map((L) => L.toFixed(6)).join(","));
201
+ (u) => {
202
+ o([u.coords.longitude, u.coords.latitude].map((y) => y.toFixed(6)).join(","));
203
203
  },
204
- (f) => {
205
- a(f);
204
+ (u) => {
205
+ r(u);
206
206
  },
207
- o
207
+ a
208
208
  );
209
- }), r;
209
+ }), s;
210
210
  } catch {
211
211
  } finally {
212
- o.cachedLocationExpiry && (U = {
212
+ a.cachedLocationExpiry && (U = {
213
213
  time: Date.now(),
214
- coords: r
214
+ coords: s
215
215
  });
216
216
  }
217
217
  if (i.signal.aborted)
218
218
  return;
219
219
  }
220
- if (o.type === "server-geolocation")
220
+ if (a.type === "server-geolocation")
221
221
  return "ip";
222
- if (t && o.type === "map-center")
222
+ if (t && a.type === "map-center")
223
223
  return t[1].toFixed(6) + "," + t[2].toFixed(6);
224
224
  }
225
225
  }
226
- const ct = ".sprite-icon{align-self:center;justify-self:center;opacity:.75;background-repeat:no-repeat}li{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content;outline:0}li:first-child{padding-top:10px}li:last-child{padding-bottom:10px}li.picked{background-color:#e7edff}li.picked .secondary{color:#96a4c7;padding-left:4px}li.picked .line2{color:#96a4c7}li.selected{background-color:#f3f6ff;animation:backAndForth 5s linear infinite}li.selected .primary{color:#2b8bfb}li.selected .secondary{color:#a2adc7;padding-left:4px}li.selected .line2{color:#a2adc7}li>img{align-self:center;justify-self:center;opacity:.75}.texts{padding:0 17px 0 0}.texts>*{white-space:nowrap;display:block;min-width:fit-content}.primary{font-weight:600}.secondary{color:#aeb6c7;padding-left:4px}.line2{color:#aeb6c7}@keyframes backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}";
227
- var ht = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, $e = (t) => {
226
+ const ht = ".sprite-icon{align-self:center;justify-self:center;opacity:.75;background-repeat:no-repeat}li{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content;outline:0}li:first-child{padding-top:10px}li:last-child{padding-bottom:10px}li.picked{background-color:#e7edff}li.picked .secondary{color:#96a4c7;padding-left:4px}li.picked .line2{color:#96a4c7}li.selected{background-color:#f3f6ff;animation:backAndForth 5s linear infinite}li.selected .primary{color:#2b8bfb}li.selected .secondary{color:#a2adc7;padding-left:4px}li.selected .line2{color:#a2adc7}li>img{align-self:center;justify-self:center;opacity:.75}.texts{padding:0 17px 0 0}.texts>*{white-space:nowrap;display:block;min-width:fit-content}.primary{font-weight:600}.secondary{color:#aeb6c7;padding-left:4px}.line2{color:#aeb6c7}@keyframes backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}";
227
+ var pt = Object.defineProperty, dt = Object.getOwnPropertyDescriptor, Ie = (t) => {
228
228
  throw TypeError(t);
229
- }, _ = (t, e, i, o) => {
230
- for (var r = o > 1 ? void 0 : o ? pt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
231
- (a = t[s]) && (r = (o ? a(e, i, r) : a(r)) || r);
232
- return o && r && ht(e, i, r), r;
233
- }, Ie = (t, e, i) => e.has(t) || $e("Cannot " + i), u = (t, e, i) => (Ie(t, e, "read from private field"), i ? i.call(t) : e.get(t)), dt = (t, e, i) => e.has(t) ? $e("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), E = (t, e, i) => (Ie(t, e, "access private method"), i), d, Z, G, g, Oe, Me, pe, oe;
234
- const Te = typeof devicePixelRatio > "u" || devicePixelRatio > 1.25, Se = Te ? "@2x" : "", C = Te ? 2 : 1;
235
- let T, Ce, k = class extends O {
229
+ }, L = (t, e, i, a) => {
230
+ for (var s = a > 1 ? void 0 : a ? dt(e, i) : e, o = t.length - 1, r; o >= 0; o--)
231
+ (r = t[o]) && (s = (a ? r(e, i, s) : r(s)) || s);
232
+ return a && s && pt(e, i, s), s;
233
+ }, Oe = (t, e, i) => e.has(t) || Ie("Cannot " + i), f = (t, e, i) => (Oe(t, e, "read from private field"), i ? i.call(t) : e.get(t)), ut = (t, e, i) => e.has(t) ? Ie("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), E = (t, e, i) => (Oe(t, e, "access private method"), i), d, Z, G, g, Me, Te, pe, oe;
234
+ const Fe = typeof devicePixelRatio > "u" || devicePixelRatio > 1.25, Se = Fe ? "@2x" : "", S = Fe ? 2 : 1;
235
+ let F, Ce, w = class extends O {
236
236
  constructor() {
237
- super(...arguments), dt(this, d), this.itemStyle = "default", this.showPlaceType = "if-needed", this.missingIconsCache = /* @__PURE__ */ new Set(), this.iconsBaseUrl = "", this.index = 0;
237
+ super(...arguments), ut(this, d), this.itemStyle = "default", this.showPlaceType = "if-needed", this.missingIconsCache = /* @__PURE__ */ new Set(), this.iconsBaseUrl = "", this.index = 0;
238
238
  }
239
239
  willUpdate(t) {
240
- t.has("feature") && u(this, d, Z) && (this.index = u(this, d, Z).length, E(this, d, pe).call(this));
240
+ t.has("feature") && f(this, d, Z) && (this.index = f(this, d, Z).length, E(this, d, pe).call(this));
241
241
  }
242
242
  render() {
243
243
  return m`
@@ -249,28 +249,28 @@ let T, Ce, k = class extends O {
249
249
  class=${this.itemStyle}
250
250
  @click=${() => this.dispatchEvent(new CustomEvent("select"))}
251
251
  >
252
- ${T && this.spriteIcon ? m`
252
+ ${F && this.spriteIcon ? m`
253
253
  <div
254
254
  class="sprite-icon"
255
- style=${qe({
256
- width: `${this.spriteIcon.width / C}px`,
257
- height: `${this.spriteIcon.height / C}px`,
255
+ style=${Ne({
256
+ width: `${this.spriteIcon.width / S}px`,
257
+ height: `${this.spriteIcon.height / S}px`,
258
258
  backgroundImage: `url(${this.iconsBaseUrl}sprite${Se}.png)`,
259
- backgroundPosition: `-${this.spriteIcon.x / C}px -${this.spriteIcon.y / C}px`,
260
- backgroundSize: `${T.width / C}px ${T.height / C}px`
259
+ backgroundPosition: `-${this.spriteIcon.x / S}px -${this.spriteIcon.y / S}px`,
260
+ backgroundSize: `${F.width / S}px ${F.height / S}px`
261
261
  })}
262
- title=${u(this, d, g)}
262
+ title=${f(this, d, g)}
263
263
  />
264
- ` : this.imageUrl ? m` <img src=${this.imageUrl} alt=${this.category} title=${u(this, d, g)} @error=${E(this, d, Me)} />` : this.feature?.address ? m` <img src=${this.iconsBaseUrl + "housenumber.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("road.") ? m` <img src=${this.iconsBaseUrl + "road.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("address.") ? m` <img src=${this.iconsBaseUrl + "street.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("postal_code.") ? m` <img src=${this.iconsBaseUrl + "postal_code.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("poi.") ? m` <img src=${this.iconsBaseUrl + "poi.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : u(this, d, G) ? m` <img src=${this.iconsBaseUrl + "reverse.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : m` <img src=${this.iconsBaseUrl + "area.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> `}
264
+ ` : this.imageUrl ? m` <img src=${this.imageUrl} alt=${this.category} title=${f(this, d, g)} @error=${E(this, d, Te)} />` : this.feature?.address ? m` <img src=${this.iconsBaseUrl + "housenumber.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : this.feature?.id.startsWith("road.") ? m` <img src=${this.iconsBaseUrl + "road.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : this.feature?.id.startsWith("address.") ? m` <img src=${this.iconsBaseUrl + "street.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : this.feature?.id.startsWith("postal_code.") ? m` <img src=${this.iconsBaseUrl + "postal_code.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : this.feature?.id.startsWith("poi.") ? m` <img src=${this.iconsBaseUrl + "poi.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : f(this, d, G) ? m` <img src=${this.iconsBaseUrl + "reverse.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> ` : m` <img src=${this.iconsBaseUrl + "area.svg"} alt=${f(this, d, g)} title=${f(this, d, g)} /> `}
265
265
 
266
266
  <span class="texts">
267
267
  <span>
268
- <span class="primary"> ${u(this, d, G) ? this.feature?.place_name : this.feature?.place_name.replace(/,.*/, "")} </span>
268
+ <span class="primary"> ${f(this, d, G) ? this.feature?.place_name : this.feature?.place_name.replace(/,.*/, "")} </span>
269
269
 
270
- ${this.showPlaceType === "always" || this.showPlaceType !== "never" && !this.feature?.address && !this.feature?.id.startsWith("road.") && !this.feature?.id.startsWith("address.") && !this.feature?.id.startsWith("postal_code.") && (!this.feature?.id.startsWith("poi.") || !this.imageUrl) && !u(this, d, G) ? m` <span class="secondary"> ${u(this, d, g)} </span> ` : X}
270
+ ${this.showPlaceType === "always" || this.showPlaceType !== "never" && !this.feature?.address && !this.feature?.id.startsWith("road.") && !this.feature?.id.startsWith("address.") && !this.feature?.id.startsWith("postal_code.") && (!this.feature?.id.startsWith("poi.") || !this.imageUrl) && !f(this, d, G) ? m` <span class="secondary"> ${f(this, d, g)} </span> ` : X}
271
271
  </span>
272
272
 
273
- <span class="line2"> ${u(this, d, G) ? this.feature?.text : this.feature?.place_name.replace(/[^,]*,?s*/, "")} </span>
273
+ <span class="line2"> ${f(this, d, G) ? this.feature?.text : this.feature?.place_name.replace(/[^,]*,?s*/, "")} </span>
274
274
  </span>
275
275
  </li>
276
276
  `;
@@ -286,72 +286,72 @@ G = function() {
286
286
  g = function() {
287
287
  return this.feature?.properties?.categories?.join(", ") ?? this.feature?.place_type_name?.[0] ?? this.feature?.place_type[0];
288
288
  };
289
- Oe = function() {
289
+ Me = function() {
290
290
  Ce ??= fetch(`${this.iconsBaseUrl}sprite${Se}.json`).then((t) => t.json()).then((t) => {
291
- T = t;
291
+ F = t;
292
292
  }).catch(() => {
293
- T = null;
293
+ F = null;
294
294
  });
295
295
  };
296
- Me = function() {
296
+ Te = function() {
297
297
  this.imageUrl && this.missingIconsCache.add(this.imageUrl), E(this, d, pe).call(this);
298
298
  };
299
299
  pe = function() {
300
- T !== void 0 ? E(this, d, oe).call(this) : (E(this, d, Oe).call(this), Ce?.then(() => {
300
+ F !== void 0 ? E(this, d, oe).call(this) : (E(this, d, Me).call(this), Ce?.then(() => {
301
301
  E(this, d, oe).call(this);
302
302
  }));
303
303
  };
304
304
  oe = function() {
305
305
  do {
306
- if (this.index--, this.category = u(this, d, Z)?.[this.index], this.spriteIcon = this.category ? T?.icons[this.category] : void 0, this.spriteIcon)
306
+ if (this.index--, this.category = f(this, d, Z)?.[this.index], this.spriteIcon = this.category ? F?.icons[this.category] : void 0, this.spriteIcon)
307
307
  break;
308
308
  this.imageUrl = this.category ? this.iconsBaseUrl + this.category.replace(/ /g, "_") + ".svg" : void 0;
309
309
  } while (this.index > -1 && (!this.imageUrl || this.missingIconsCache.has(this.imageUrl)));
310
310
  };
311
- k.styles = I`
312
- ${ce(ct)}
311
+ w.styles = I`
312
+ ${ce(ht)}
313
313
  `;
314
- _([
314
+ L([
315
315
  p({ type: Object })
316
- ], k.prototype, "feature", 2);
317
- _([
316
+ ], w.prototype, "feature", 2);
317
+ L([
318
318
  p({ type: String })
319
- ], k.prototype, "itemStyle", 2);
320
- _([
319
+ ], w.prototype, "itemStyle", 2);
320
+ L([
321
321
  p({ type: String })
322
- ], k.prototype, "showPlaceType", 2);
323
- _([
322
+ ], w.prototype, "showPlaceType", 2);
323
+ L([
324
324
  p({ attribute: !1 })
325
- ], k.prototype, "missingIconsCache", 2);
326
- _([
325
+ ], w.prototype, "missingIconsCache", 2);
326
+ L([
327
327
  p({ type: String })
328
- ], k.prototype, "iconsBaseUrl", 2);
329
- _([
330
- b()
331
- ], k.prototype, "category", 2);
332
- _([
333
- b()
334
- ], k.prototype, "imageUrl", 2);
335
- _([
336
- b()
337
- ], k.prototype, "spriteIcon", 2);
338
- _([
339
- b()
340
- ], k.prototype, "index", 2);
341
- k = _([
328
+ ], w.prototype, "iconsBaseUrl", 2);
329
+ L([
330
+ k()
331
+ ], w.prototype, "category", 2);
332
+ L([
333
+ k()
334
+ ], w.prototype, "imageUrl", 2);
335
+ L([
336
+ k()
337
+ ], w.prototype, "spriteIcon", 2);
338
+ L([
339
+ k()
340
+ ], w.prototype, "index", 2);
341
+ w = L([
342
342
  M("maptiler-geocoder-feature-item")
343
- ], k);
344
- const ut = "form{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;margin:0;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text: #444952;--color-icon-button: #444952;pointer-events:all}form,form *,form *:after,form *:before{box-sizing:border-box}form.can-collapse{max-width:29px}form.can-collapse input::placeholder{transition:opacity .25s;opacity:0}form{width:270px;max-width:270px}form:focus-within,form:hover{width:270px;max-width:270px}form input::placeholder,form:focus-within input::placeholder,form:hover input::placeholder{opacity:1}input{font:inherit;font-size:14px;flex-grow:1;min-height:29px;background-color:transparent;color:#444952;white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul,div.error,div.no-results{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:calc(100% + 6px);overflow:hidden}ul{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error,div.no-results{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error div{flex-grow:1}div.error maptiler-geocode-fail-icon{flex-shrink:0;width:20px;height:20px}div.error button{flex-shrink:0}div.error button maptiler-geocode-clear-icon{--color-icon-button: #e25041}div.error button:hover maptiler-geocode-clear-icon,div.error button:active maptiler-geocode-clear-icon{--color-icon-button: inherit}div.no-results{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results maptiler-geocode-fail-icon{margin-top:4px;flex-shrink:0;width:20px;height:20px}ul.options.open-on-top{top:auto;bottom:calc(100% + 6px)}button{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button:hover{background-color:transparent}button:hover,button:active{--color-icon-button: #2b8bfb}.input-group{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group:focus-within{outline:#2b8bfb solid 2px}.search-button{flex-shrink:0}.clear-button-container{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable{display:flex;flex-shrink:0}:host(.maptiler-geocoder):not(:empty){box-shadow:none}:host(.maptiler-geocoder) .input-group{border:white solid 2px}:host(.maptiler-geocoder) .input-group:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}:host(.maptiler-geocoder) form.can-collapse{max-width:33px}:host(.maptiler-geocoder) form,:host(.maptiler-geocoder) form:focus-within,:host(.maptiler-geocoder) form:hover{width:270px;max-width:270px}:host(.leaflet-geocoder) .input-group{border:white solid 1px}:host(.leaflet-geocoder) form.can-collapse{max-width:30px}";
345
- var ft = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, Fe = (t) => {
343
+ ], w);
344
+ const ft = "form{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;margin:0;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text: #444952;--color-icon-button: #444952;pointer-events:all}form,form *,form *:after,form *:before{box-sizing:border-box}form.can-collapse{max-width:29px}form.can-collapse input::placeholder{transition:opacity .25s;opacity:0}form{width:270px;max-width:270px}form:focus-within,form:hover{width:270px;max-width:270px}form input::placeholder,form:focus-within input::placeholder,form:hover input::placeholder{opacity:1}input{font:inherit;font-size:14px;flex-grow:1;min-height:29px;background-color:transparent;color:#444952;white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul,div.error,div.no-results{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:calc(100% + 6px);overflow:hidden}ul{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error,div.no-results{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error div{flex-grow:1}div.error maptiler-geocode-fail-icon{flex-shrink:0;width:20px;height:20px}div.error button{flex-shrink:0}div.error button maptiler-geocode-clear-icon{--color-icon-button: #e25041}div.error button:hover maptiler-geocode-clear-icon,div.error button:active maptiler-geocode-clear-icon{--color-icon-button: inherit}div.no-results{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results maptiler-geocode-fail-icon{margin-top:4px;flex-shrink:0;width:20px;height:20px}ul.options.open-on-top{top:auto;bottom:calc(100% + 6px)}button{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button:hover{background-color:transparent}button:hover,button:active{--color-icon-button: #2b8bfb}.input-group{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group:focus-within{outline:#2b8bfb solid 2px}.search-button{flex-shrink:0}.clear-button-container{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable{display:flex;flex-shrink:0}:host(.maptiler-geocoder):not(:empty){box-shadow:none}:host(.maptiler-geocoder) .input-group{border:white solid 2px}:host(.maptiler-geocoder) .input-group:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}:host(.maptiler-geocoder) form.can-collapse{max-width:33px}:host(.maptiler-geocoder) form,:host(.maptiler-geocoder) form:focus-within,:host(.maptiler-geocoder) form:hover{width:270px;max-width:270px}:host(.leaflet-geocoder) .input-group{border:white solid 1px}:host(.leaflet-geocoder) form.can-collapse{max-width:30px}";
345
+ var mt = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, Ee = (t) => {
346
346
  throw TypeError(t);
347
- }, c = (t, e, i, o) => {
348
- for (var r = o > 1 ? void 0 : o ? mt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
349
- (a = t[s]) && (r = (o ? a(e, i, r) : a(r)) || r);
350
- return o && r && ft(e, i, r), r;
351
- }, de = (t, e, i) => e.has(t) || Fe("Cannot " + i), x = (t, e, i) => (de(t, e, "read from private field"), i ? i.call(t) : e.get(t)), F = (t, e, i) => e.has(t) ? Fe("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), W = (t, e, i, o) => (de(t, e, "write to private field"), e.set(t, i), i), h = (t, e, i) => (de(t, e, "access private method"), i), K, V, B, ae, R, l, Q, Ee, Pe, ue, v, fe, Y, me, ge, $, ye, H, Ue, le, Ge, Be, Re, ze, je;
347
+ }, c = (t, e, i, a) => {
348
+ for (var s = a > 1 ? void 0 : a ? gt(e, i) : e, o = t.length - 1, r; o >= 0; o--)
349
+ (r = t[o]) && (s = (a ? r(e, i, s) : r(s)) || s);
350
+ return a && s && mt(e, i, s), s;
351
+ }, de = (t, e, i) => e.has(t) || Ee("Cannot " + i), b = (t, e, i) => (de(t, e, "read from private field"), i ? i.call(t) : e.get(t)), C = (t, e, i) => e.has(t) ? Ee("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), W = (t, e, i, a) => (de(t, e, "write to private field"), e.set(t, i), i), h = (t, e, i) => (de(t, e, "access private method"), i), K, V, B, ae, R, l, Q, Pe, Ue, ue, x, fe, Y, me, ge, $, ye, H, Ge, le, Be, Re, ze, je, Ae;
352
352
  let n = class extends O {
353
353
  constructor() {
354
- super(...arguments), F(this, l), this.clearListOnPick = !1, this.clearOnBlur = !1, this.collapsed = !1, this.excludeTypes = !1, this.exhaustiveReverseGeocoding = !1, this.fetchFullGeometryOnPick = !1, this.keepListOpen = !1, this.openListOnTop = !1, this.reverseActive = !1, this.searchValue = "", this.selectedItemIndex = -1, this.cachedFeatures = [], this.lastSearchUrl = "", this.focused = !1, this.focusedDelayed = !1, F(this, K, !1), F(this, V, !1), F(this, B), F(this, ae, /* @__PURE__ */ new Set()), F(this, R);
354
+ super(...arguments), C(this, l), this.clearListOnPick = !1, this.clearOnBlur = !1, this.collapsed = !1, this.excludeTypes = !1, this.exhaustiveReverseGeocoding = !1, this.fetchFullGeometryOnPick = !1, this.keepListOpen = !1, this.openListOnTop = !1, this.reverseActive = !1, this.searchValue = "", this.selectedItemIndex = -1, this.cachedFeatures = [], this.lastSearchUrl = "", this.focused = !1, this.focusedDelayed = !1, C(this, K, !1), C(this, V, !1), C(this, B), C(this, ae, /* @__PURE__ */ new Set()), C(this, R);
355
355
  }
356
356
  firstUpdated() {
357
357
  W(this, K, !0);
@@ -364,7 +364,7 @@ let n = class extends O {
364
364
  setOptions(t) {
365
365
  const e = { ...t };
366
366
  for (const i of Object.keys(e))
367
- gt.includes(i) || delete e[i];
367
+ yt.includes(i) || delete e[i];
368
368
  Object.assign(this, e);
369
369
  }
370
370
  /**
@@ -373,7 +373,7 @@ let n = class extends O {
373
373
  * @param value text to set
374
374
  */
375
375
  setQuery(t) {
376
- h(this, l, ge).call(this, t), h(this, l, me).call(this);
376
+ h(this, l, ge).call(this, t, { external: !0 }), h(this, l, me).call(this);
377
377
  }
378
378
  /**
379
379
  * Set the content of search input box and immediately submit it.
@@ -415,19 +415,19 @@ let n = class extends O {
415
415
  }
416
416
  /** @internal */
417
417
  handleMapClick(t) {
418
- this.reverseActive && h(this, l, Ue).call(this, t);
418
+ this.reverseActive && h(this, l, Ge).call(this, t);
419
419
  }
420
420
  willUpdate(t) {
421
- t.has("error") && this.error && console.error("[MapTilerGeocodingControl] Error:", this.error), t.has("enableReverse") && (this.reverseActive = this.enableReverse === "always"), ["picked"].some((e) => t.has(e)) && this.picked && (this.clearListOnPick && h(this, l, $).call(this), this.selectedItemIndex = -1), ["searchValue", "minLength"].some((e) => t.has(e)) && x(this, l, ue) && (h(this, l, $).call(this), this.error = void 0), ["focused"].some((e) => t.has(e)) && setTimeout(() => {
421
+ t.has("error") && this.error && console.error("[MapTilerGeocodingControl] Error:", this.error), t.has("enableReverse") && (this.reverseActive = this.enableReverse === "always"), ["picked"].some((e) => t.has(e)) && this.picked && (this.clearListOnPick && h(this, l, $).call(this), this.selectedItemIndex = -1), ["searchValue", "minLength"].some((e) => t.has(e)) && b(this, l, ue) && (h(this, l, $).call(this), this.error = void 0), ["focused"].some((e) => t.has(e)) && setTimeout(() => {
422
422
  this.focusedDelayed = this.focused, this.clearOnBlur && !this.focused && (this.searchValue = "");
423
- }, 100), ["selectFirst", "listFeatures", "selectedItemIndex", "picked"].some((e) => t.has(e)) && this.selectFirst !== !1 && this.listFeatures?.length && this.selectedItemIndex == -1 && !this.picked && (this.selectedItemIndex = 0), ["listFeatures", "selectedItemIndex"].some((e) => t.has(e)) && h(this, l, v).call(this, "select", { feature: x(this, l, Q) }), ["picked"].some((e) => t.has(e)) && this.picked && this.picked.id !== t.get("picked")?.id && (this.fetchFullGeometryOnPick && !this.picked.address && this.picked.geometry.type === "Point" && this.picked.place_type[0] !== "reverse" ? h(this, l, H).call(this, this.picked.id, { byId: !0 }) : Promise.resolve()).then(
423
+ }, 100), ["selectFirst", "listFeatures", "selectedItemIndex", "picked"].some((e) => t.has(e)) && this.selectFirst !== !1 && this.listFeatures?.length && this.selectedItemIndex == -1 && !this.picked && (this.selectedItemIndex = 0), ["listFeatures", "selectedItemIndex"].some((e) => t.has(e)) && h(this, l, x).call(this, "select", { feature: b(this, l, Q) }), ["picked"].some((e) => t.has(e)) && this.picked && this.picked.id !== t.get("picked")?.id && (this.fetchFullGeometryOnPick && !this.picked.address && this.picked.geometry.type === "Point" && this.picked.place_type[0] !== "reverse" ? h(this, l, H).call(this, this.picked.id, { byId: !0 }) : Promise.resolve()).then(
424
424
  () => {
425
- h(this, l, v).call(this, "pick", { feature: this.picked });
425
+ h(this, l, x).call(this, "pick", { feature: this.picked });
426
426
  },
427
427
  (e) => {
428
- e && typeof e == "object" && "name" in e && e.name === "AbortError" || (this.error = e, h(this, l, v).call(this, "pick", { feature: this.picked }));
428
+ e && typeof e == "object" && "name" in e && e.name === "AbortError" || (this.error = e, h(this, l, x).call(this, "pick", { feature: this.picked }));
429
429
  }
430
- ), ["listFeatures", "focusedDelayed"].some((e) => t.has(e)) && (x(this, l, Ee) ? (h(this, l, v).call(this, "featuresshow"), W(this, V, !0)) : x(this, V) && h(this, l, v).call(this, "featureshide")), ["reverseActive"].some((e) => t.has(e)) && h(this, l, v).call(this, "reversetoggle", { reverse: this.reverseActive });
430
+ ), ["listFeatures", "focusedDelayed"].some((e) => t.has(e)) && (b(this, l, Pe) ? (h(this, l, x).call(this, "featuresshow"), W(this, V, !0)) : b(this, V) && h(this, l, x).call(this, "featureshide")), ["reverseActive"].some((e) => t.has(e)) && h(this, l, x).call(this, "reversetoggle", { reverse: this.reverseActive });
431
431
  }
432
432
  render() {
433
433
  return m`
@@ -449,15 +449,15 @@ let n = class extends O {
449
449
  @blur=${() => this.focused = !1}
450
450
  @click=${() => this.focused = !0}
451
451
  @keydown=${h(this, l, le)}
452
- @input=${h(this, l, Ge)}
452
+ @input=${h(this, l, Be)}
453
453
  @change=${() => this.picked = void 0}
454
454
  placeholder=${this.placeholder ?? "Search"}
455
455
  aria-label=${this.placeholder ?? "Search"}
456
456
  />
457
457
 
458
458
  <div class="clear-button-container ${A({ displayable: this.searchValue !== "" })}">
459
- ${x(this, l, Pe) ? m`<maptiler-geocode-loading-icon></maptiler-geocode-loading-icon>` : m`
460
- <button type="button" @click=${h(this, l, je)} title=${this.clearButtonTitle ?? "clear"}>
459
+ ${b(this, l, Ue) ? m`<maptiler-geocode-loading-icon></maptiler-geocode-loading-icon>` : m`
460
+ <button type="button" @click=${h(this, l, Ae)} title=${this.clearButtonTitle ?? "clear"}>
461
461
  <maptiler-geocode-clear-icon></maptiler-geocode-clear-icon>
462
462
  </button>
463
463
  `}
@@ -496,8 +496,8 @@ let n = class extends O {
496
496
  </div>
497
497
  </div>
498
498
  ` : m`
499
- <ul class="options ${A({ "open-on-top": this.openListOnTop })}" @mouseleave=${h(this, l, ze)} @keydown=${h(this, l, le)} role="listbox">
500
- ${Ve(
499
+ <ul class="options ${A({ "open-on-top": this.openListOnTop })}" @mouseleave=${h(this, l, je)} @keydown=${h(this, l, le)} role="listbox">
500
+ ${qe(
501
501
  this.listFeatures,
502
502
  (t) => t.id + (t.address ? "," + t.address : ""),
503
503
  (t, e) => m`
@@ -506,13 +506,13 @@ let n = class extends O {
506
506
  .showPlaceType=${this.showPlaceType ?? "if-needed"}
507
507
  itemStyle=${this.selectedItemIndex === e ? "selected" : this.picked?.id === t.id ? "picked" : "default"}
508
508
  @mouseenter=${() => {
509
- h(this, l, Re).call(this, e);
509
+ h(this, l, ze).call(this, e);
510
510
  }}
511
511
  @select=${() => {
512
- h(this, l, Be).call(this, t);
512
+ h(this, l, Re).call(this, t);
513
513
  }}
514
- .missingIconsCache=${x(this, ae)}
515
- .iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.5/icons/"}
514
+ .missingIconsCache=${b(this, ae)}
515
+ .iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0-rc.6/icons/"}
516
516
  >
517
517
  ${t.place_name}
518
518
  </maptiler-geocoder-feature-item>
@@ -533,17 +533,17 @@ l = /* @__PURE__ */ new WeakSet();
533
533
  Q = function() {
534
534
  return this.listFeatures?.[this.selectedItemIndex];
535
535
  };
536
- Ee = function() {
536
+ Pe = function() {
537
537
  return !!this.listFeatures?.length && (this.focusedDelayed || this.keepListOpen);
538
538
  };
539
- Pe = function() {
539
+ Ue = function() {
540
540
  return this.abortController !== void 0;
541
541
  };
542
542
  ue = function() {
543
543
  return this.searchValue.length < (this.minLength ?? 2);
544
544
  };
545
- v = function(t, ...[e]) {
546
- x(this, K) && this.dispatchEvent(
545
+ x = function(t, ...[e]) {
546
+ b(this, K) && this.dispatchEvent(
547
547
  new CustomEvent(t, {
548
548
  bubbles: !0,
549
549
  composed: !0,
@@ -552,13 +552,13 @@ v = function(t, ...[e]) {
552
552
  );
553
553
  };
554
554
  fe = function(t) {
555
- t?.preventDefault(), this.focused = !1, clearTimeout(x(this, B)), this.selectedItemIndex > -1 && this.listFeatures ? (this.picked = this.listFeatures[this.selectedItemIndex], this.searchValue = this.picked.place_type[0] === "reverse" ? this.picked.place_name : this.picked.place_name.replace(/,.*/, ""), this.error = void 0, this.selectedItemIndex = -1) : this.searchValue && h(this, l, H).call(this, this.searchValue, { exact: !0 }).then(() => {
555
+ t?.preventDefault(), this.focused = !1, clearTimeout(b(this, B)), this.selectedItemIndex > -1 && this.listFeatures ? (this.picked = this.listFeatures[this.selectedItemIndex], this.searchValue = this.picked.place_type[0] === "reverse" ? this.picked.place_name : this.picked.place_name.replace(/,.*/, ""), this.error = void 0, this.selectedItemIndex = -1) : this.searchValue && h(this, l, H).call(this, this.searchValue, { exact: !0, external: t === void 0 }).then(() => {
556
556
  this.picked = void 0;
557
557
  }).catch((e) => this.error = e);
558
558
  };
559
559
  Y = function(t) {
560
560
  try {
561
- return We(t, 6);
561
+ return Ve(t, 6);
562
562
  } catch {
563
563
  return !1;
564
564
  }
@@ -568,87 +568,87 @@ me = function() {
568
568
  this.input.focus(), this.focused = !0, this.input.select();
569
569
  });
570
570
  };
571
- ge = function(t) {
572
- if (this.searchValue = t, h(this, l, v).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, l, Y).call(this, t) }), this.error = void 0, this.picked = void 0, this.showResultsWhileTyping !== !1) {
573
- if (clearTimeout(x(this, B)), x(this, l, ue))
571
+ ge = function(t, { external: e = !1 } = {}) {
572
+ if (this.searchValue = t, h(this, l, x).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, l, Y).call(this, t) }), this.error = void 0, this.picked = void 0, this.showResultsWhileTyping !== !1) {
573
+ if (clearTimeout(b(this, B)), b(this, l, ue))
574
574
  return;
575
- const e = this.searchValue;
575
+ const i = this.searchValue;
576
576
  W(this, B, window.setTimeout(() => {
577
- h(this, l, H).call(this, e).catch((i) => this.error = i);
577
+ h(this, l, H).call(this, i, { external: e }).catch((a) => this.error = a);
578
578
  }, this.debounceSearch ?? 200));
579
579
  } else
580
580
  h(this, l, $).call(this);
581
581
  };
582
582
  $ = function() {
583
- this.listFeatures !== void 0 && (this.listFeatures = void 0, h(this, l, v).call(this, "featuresclear"));
583
+ this.listFeatures !== void 0 && (this.listFeatures = void 0, h(this, l, x).call(this, "featuresclear"));
584
584
  };
585
585
  ye = function(t) {
586
- this.searchValue = t, h(this, l, v).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, l, Y).call(this, t) }), this.selectedItemIndex = -1, h(this, l, fe).call(this);
586
+ this.searchValue = t, h(this, l, x).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, l, Y).call(this, t) }), this.selectedItemIndex = -1, h(this, l, fe).call(this);
587
587
  };
588
- H = async function(t, { byId: e = !1, exact: i = !1 } = {}) {
588
+ H = async function(t, { byId: e = !1, exact: i = !1, external: a = !1 } = {}) {
589
589
  this.error = void 0, this.abortController?.abort();
590
- const o = new AbortController();
591
- this.abortController = o;
590
+ const s = new AbortController();
591
+ this.abortController = s;
592
592
  try {
593
- const r = this.apiUrl ?? "https://api.maptiler.com/geocoding", s = h(this, l, Y).call(this, t), a = new URL(r + "/" + encodeURIComponent(s ? `${s.decimalLongitude},${s.decimalLatitude}` : t) + ".json"), f = a.searchParams;
594
- this.language !== void 0 && f.set("language", Array.isArray(this.language) ? this.language.join(",") : this.language ?? "");
595
- const [L] = x(this, R) ?? [void 0];
596
- let w = (!s || this.reverseGeocodingTypes === void 0 ? this.types : this.reverseGeocodingTypes)?.map(
597
- (y) => typeof y == "string" ? y : L === void 0 || (y[0] ?? 0) <= L && L < (y[1] ?? 1 / 0) ? y[2] : void 0
598
- ).filter((y) => y !== void 0);
599
- w && (w = [...new Set(w)], f.set("types", w.join(",")));
600
- const S = !s || this.reverseGeocodingExcludeTypes === void 0 ? this.excludeTypes : this.reverseGeocodingExcludeTypes;
601
- if (S && f.set("excludeTypes", String(S)), this.bbox && f.set("bbox", this.bbox.map((y) => y.toFixed(6)).join(",")), this.country && f.set("country", Array.isArray(this.country) ? this.country.join(",") : this.country), this.worldview && f.set("worldview", this.worldview), !e && !s) {
602
- const y = this.proximity ?? [{ type: "server-geolocation" }], xe = await nt(x(this, R), y, o);
603
- xe && f.set("proximity", xe), (i || this.showResultsWhileTyping === !1) && f.set("autocomplete", "false"), f.set("fuzzyMatch", String(this.fuzzyMatch !== !1));
593
+ const o = this.apiUrl ?? "https://api.maptiler.com/geocoding", r = h(this, l, Y).call(this, t), u = new URL(o + "/" + encodeURIComponent(r ? `${r.decimalLongitude},${r.decimalLatitude}` : t) + ".json"), y = u.searchParams;
594
+ this.language !== void 0 && y.set("language", Array.isArray(this.language) ? this.language.join(",") : this.language ?? "");
595
+ const [T] = b(this, R) ?? [void 0];
596
+ let _ = (!r || this.reverseGeocodingTypes === void 0 ? this.types : this.reverseGeocodingTypes)?.map(
597
+ (v) => typeof v == "string" ? v : T === void 0 || (v[0] ?? 0) <= T && T < (v[1] ?? 1 / 0) ? v[2] : void 0
598
+ ).filter((v) => v !== void 0);
599
+ _ && (_ = [...new Set(_)], y.set("types", _.join(",")));
600
+ const ve = !r || this.reverseGeocodingExcludeTypes === void 0 ? this.excludeTypes : this.reverseGeocodingExcludeTypes;
601
+ if (ve && y.set("excludeTypes", String(ve)), this.bbox && y.set("bbox", this.bbox.map((v) => v.toFixed(6)).join(",")), this.country && y.set("country", Array.isArray(this.country) ? this.country.join(",") : this.country), this.worldview && y.set("worldview", this.worldview), !e && !r) {
602
+ const v = this.proximity ?? [{ type: "server-geolocation" }], be = await ct(b(this, R), v, s);
603
+ be && y.set("proximity", be), (i || this.showResultsWhileTyping === !1) && y.set("autocomplete", "false"), y.set("fuzzyMatch", String(this.fuzzyMatch !== !1));
604
604
  }
605
- const ve = this.limit ?? 5, J = this.reverseGeocodingLimit ?? ve;
606
- J > 1 && w?.length !== 1 && console.warn("[MapTilerGeocodingControl] Warning: For reverse geocoding when limit > 1 then types must contain single value."), s ? (J === 1 || this.exhaustiveReverseGeocoding || w?.length === 1) && f.set("limit", String(J)) : f.set("limit", String(ve)), this.apiKey && f.set("key", this.apiKey), this.adjustUrl?.(a);
607
- const Ae = a.searchParams.get("types") === "" && a.searchParams.get("excludeTypes") !== "true", j = a.toString();
605
+ const xe = this.limit ?? 5, J = this.reverseGeocodingLimit ?? xe;
606
+ J > 1 && _?.length !== 1 && console.warn("[MapTilerGeocodingControl] Warning: For reverse geocoding when limit > 1 then types must contain single value."), r ? (J === 1 || this.exhaustiveReverseGeocoding || _?.length === 1) && y.set("limit", String(J)) : y.set("limit", String(xe)), this.apiKey && y.set("key", this.apiKey), this.adjustUrl?.(u);
607
+ const De = u.searchParams.get("types") === "" && u.searchParams.get("excludeTypes") !== "true", j = u.toString();
608
608
  if (j === this.lastSearchUrl) {
609
- e ? (this.clearListOnPick && h(this, l, $).call(this), this.picked = this.cachedFeatures[0]) : (this.listFeatures = this.cachedFeatures, h(this, l, v).call(this, "featureslisted", { features: this.listFeatures }), this.listFeatures[this.selectedItemIndex]?.id !== x(this, l, Q)?.id && (this.selectedItemIndex = -1));
609
+ e ? (this.clearListOnPick && h(this, l, $).call(this), this.picked = this.cachedFeatures[0]) : (this.listFeatures = this.cachedFeatures, h(this, l, x).call(this, "featureslisted", { features: this.listFeatures, external: a }), this.listFeatures[this.selectedItemIndex]?.id !== b(this, l, Q)?.id && (this.selectedItemIndex = -1));
610
610
  return;
611
611
  }
612
- h(this, l, v).call(this, "request", { urlObj: a }), this.lastSearchUrl = j;
612
+ h(this, l, x).call(this, "request", { urlObj: u }), this.lastSearchUrl = j;
613
613
  let P;
614
- if (Ae)
614
+ if (De)
615
615
  P = { type: "FeatureCollection", features: [] };
616
616
  else {
617
- const y = await fetch(j, {
618
- signal: o.signal,
617
+ const v = await fetch(j, {
618
+ signal: s.signal,
619
619
  ...this.fetchParameters
620
620
  });
621
- if (!y.ok)
622
- throw new Error(await y.text());
623
- P = await y.json();
621
+ if (!v.ok)
622
+ throw new Error(await v.text());
623
+ P = await v.json();
624
624
  }
625
- h(this, l, v).call(this, "response", { url: j, featureCollection: P }), e ? (this.clearListOnPick && h(this, l, $).call(this), this.picked = P.features[0], this.cachedFeatures = [this.picked]) : (this.listFeatures = P.features.filter(this.filter ?? (() => !0)), s && this.listFeatures.unshift({
625
+ h(this, l, x).call(this, "response", { url: j, featureCollection: P }), e ? (this.clearListOnPick && h(this, l, $).call(this), this.picked = P.features[0], this.cachedFeatures = [this.picked]) : (this.listFeatures = P.features.filter(this.filter ?? (() => !0)), r && this.listFeatures.unshift({
626
626
  type: "Feature",
627
627
  properties: {},
628
628
  /* eslint-disable @typescript-eslint/restrict-template-expressions */
629
- id: `reverse_${s.decimalLongitude}_${s.decimalLatitude}`,
630
- text: `${s.decimalLatitude}, ${s.decimalLongitude}`,
631
- place_name: s.toCoordinateFormat("DMS"),
629
+ id: `reverse_${r.decimalLongitude}_${r.decimalLatitude}`,
630
+ text: `${r.decimalLatitude}, ${r.decimalLongitude}`,
631
+ place_name: r.toCoordinateFormat("DMS"),
632
632
  /* eslint-enable @typescript-eslint/restrict-template-expressions */
633
633
  place_type: ["reverse"],
634
634
  place_type_name: ["reverse"],
635
- center: [s.decimalLongitude, s.decimalLatitude],
636
- bbox: [s.decimalLongitude, s.decimalLatitude, s.decimalLongitude, s.decimalLatitude],
635
+ center: [r.decimalLongitude, r.decimalLatitude],
636
+ bbox: [r.decimalLongitude, r.decimalLatitude, r.decimalLongitude, r.decimalLatitude],
637
637
  geometry: {
638
638
  type: "Point",
639
- coordinates: [s.decimalLongitude, s.decimalLatitude]
639
+ coordinates: [r.decimalLongitude, r.decimalLatitude]
640
640
  }
641
- }), h(this, l, v).call(this, "featureslisted", { features: this.listFeatures }), this.cachedFeatures = this.listFeatures, this.listFeatures[this.selectedItemIndex]?.id !== x(this, l, Q)?.id && (this.selectedItemIndex = -1), s && this.input.focus());
642
- } catch (r) {
643
- if (r && typeof r == "object" && "name" in r && r.name === "AbortError")
641
+ }), h(this, l, x).call(this, "featureslisted", { features: this.listFeatures, external: a }), this.cachedFeatures = this.listFeatures, this.listFeatures[this.selectedItemIndex]?.id !== b(this, l, Q)?.id && (this.selectedItemIndex = -1), r && this.input.focus());
642
+ } catch (o) {
643
+ if (o && typeof o == "object" && "name" in o && o.name === "AbortError")
644
644
  return;
645
- throw r;
645
+ throw o;
646
646
  } finally {
647
- o === this.abortController && (this.abortController = void 0);
647
+ s === this.abortController && (this.abortController = void 0);
648
648
  }
649
649
  };
650
- Ue = function(t) {
651
- this.reverseActive = this.enableReverse === "always", h(this, l, $).call(this), this.picked = void 0, h(this, l, ye).call(this, `${t[1].toFixed(6)}, ${lt(t[0], [-180, 180], !0).toFixed(6)}`), h(this, l, me).call(this);
650
+ Ge = function(t) {
651
+ this.reverseActive = this.enableReverse === "always", h(this, l, $).call(this), this.picked = void 0, h(this, l, ye).call(this, `${t[1].toFixed(6)}, ${nt(t[0], [-180, 180], !0).toFixed(6)}`), h(this, l, me).call(this);
652
652
  };
653
653
  le = function(t) {
654
654
  if (!this.listFeatures)
@@ -656,23 +656,23 @@ le = function(t) {
656
656
  const e = t.key === "ArrowDown" ? 1 : t.key === "ArrowUp" ? -1 : 0;
657
657
  e && (this.input.focus(), this.focused = !0, t.preventDefault(), this.picked && this.selectedItemIndex === -1 && (this.selectedItemIndex = this.listFeatures.findIndex((i) => i.id === this.picked?.id)), this.selectedItemIndex === (this.picked || this.selectFirst !== !1 ? 0 : -1) && e === -1 && (this.selectedItemIndex = this.listFeatures.length), this.selectedItemIndex += e, this.selectedItemIndex >= this.listFeatures.length && (this.selectedItemIndex = -1), this.selectedItemIndex < 0 && (this.picked || this.selectFirst !== !1) && (this.selectedItemIndex = 0));
658
658
  };
659
- Ge = function(t) {
659
+ Be = function(t) {
660
660
  h(this, l, ge).call(this, t.target.value);
661
661
  };
662
- Be = function(t) {
662
+ Re = function(t) {
663
663
  (!this.picked || this.picked.id !== t.id) && (this.picked = t, this.searchValue = t.place_name);
664
664
  };
665
- Re = function(t) {
665
+ ze = function(t) {
666
666
  this.selectedItemIndex = t;
667
667
  };
668
- ze = function() {
668
+ je = function() {
669
669
  (!this.selectFirst || this.picked) && (this.selectedItemIndex = -1);
670
670
  };
671
- je = function() {
672
- this.searchValue = "", h(this, l, v).call(this, "queryclear"), this.picked = void 0, this.input.focus();
671
+ Ae = function() {
672
+ this.searchValue = "", h(this, l, x).call(this, "queryclear"), this.picked = void 0, this.input.focus();
673
673
  };
674
674
  n.styles = I`
675
- ${ce(ut)}
675
+ ${ce(ft)}
676
676
  `;
677
677
  c([
678
678
  p({ attribute: !1 })
@@ -786,42 +786,42 @@ c([
786
786
  p({ type: String })
787
787
  ], n.prototype, "worldview", 2);
788
788
  c([
789
- De("input")
789
+ We("input")
790
790
  ], n.prototype, "input", 2);
791
791
  c([
792
- b()
792
+ k()
793
793
  ], n.prototype, "searchValue", 2);
794
794
  c([
795
- b()
795
+ k()
796
796
  ], n.prototype, "listFeatures", 2);
797
797
  c([
798
- b()
798
+ k()
799
799
  ], n.prototype, "selectedItemIndex", 2);
800
800
  c([
801
- b()
801
+ k()
802
802
  ], n.prototype, "picked", 2);
803
803
  c([
804
- b()
804
+ k()
805
805
  ], n.prototype, "cachedFeatures", 2);
806
806
  c([
807
- b()
807
+ k()
808
808
  ], n.prototype, "lastSearchUrl", 2);
809
809
  c([
810
- b()
810
+ k()
811
811
  ], n.prototype, "error", 2);
812
812
  c([
813
- b()
813
+ k()
814
814
  ], n.prototype, "abortController", 2);
815
815
  c([
816
- b()
816
+ k()
817
817
  ], n.prototype, "focused", 2);
818
818
  c([
819
- b()
819
+ k()
820
820
  ], n.prototype, "focusedDelayed", 2);
821
821
  n = c([
822
822
  M("maptiler-geocoder")
823
823
  ], n);
824
- const gt = [
824
+ const yt = [
825
825
  "adjustUrl",
826
826
  "apiKey",
827
827
  "apiUrl",
@@ -859,11 +859,11 @@ const gt = [
859
859
  "types",
860
860
  "reverseGeocodingTypes",
861
861
  "worldview"
862
- ], yt = "svg{display:block;fill:var(--maptiler-geocode-marker-fill, #3170fe);stroke:var(--maptiler-geocode-marker-stroke, #3170fe);height:30px}:host(.marker-selected){z-index:2}:host(.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fill, #98b7ff);stroke:var(--maptiler-geocode-marker-selected-stroke, #3170fe)}:host(.marker-reverse) svg path{fill:var(--maptiler-geocode-marker-reverse-fill, silver);stroke:var(--maptiler-geocode-marker-reverse-stroke, gray)}:host(.marker-interactive){cursor:pointer!important}:host(.marker-fuzzy) svg path{fill:var(--maptiler-geocode-marker-fuzzy-fill, silver);stroke:var(--maptiler-geocode-marker-fuzzy-stroke, gray)}:host(.marker-fuzzy.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fuzzy-fill, #ddd);stroke:var(--maptiler-geocode-marker-selected-fuzzy-stroke, silver)}";
863
- var vt = Object.getOwnPropertyDescriptor, xt = (t, e, i, o) => {
864
- for (var r = o > 1 ? void 0 : o ? vt(e, i) : e, s = t.length - 1, a; s >= 0; s--)
865
- (a = t[s]) && (r = a(r) || r);
866
- return r;
862
+ ], vt = "svg{display:block;fill:var(--maptiler-geocode-marker-fill, #3170fe);stroke:var(--maptiler-geocode-marker-stroke, #3170fe);height:30px}:host(.marker-selected){z-index:2}:host(.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fill, #98b7ff);stroke:var(--maptiler-geocode-marker-selected-stroke, #3170fe)}:host(.marker-reverse) svg path{fill:var(--maptiler-geocode-marker-reverse-fill, silver);stroke:var(--maptiler-geocode-marker-reverse-stroke, gray)}:host(.marker-interactive){cursor:pointer!important}:host(.marker-fuzzy) svg path{fill:var(--maptiler-geocode-marker-fuzzy-fill, silver);stroke:var(--maptiler-geocode-marker-fuzzy-stroke, gray)}:host(.marker-fuzzy.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fuzzy-fill, #ddd);stroke:var(--maptiler-geocode-marker-selected-fuzzy-stroke, silver)}";
863
+ var xt = Object.getOwnPropertyDescriptor, bt = (t, e, i, a) => {
864
+ for (var s = a > 1 ? void 0 : a ? xt(e, i) : e, o = t.length - 1, r; o >= 0; o--)
865
+ (r = t[o]) && (s = r(s) || s);
866
+ return s;
867
867
  };
868
868
  let ne = class extends O {
869
869
  render() {
@@ -882,16 +882,16 @@ let ne = class extends O {
882
882
  }
883
883
  };
884
884
  ne.styles = I`
885
- ${ce(yt)}
885
+ ${ce(vt)}
886
886
  `;
887
- ne = xt([
887
+ ne = bt([
888
888
  M("maptiler-geocode-marker")
889
889
  ], ne);
890
- const bt = "@maptiler/geocoding-control", kt = "3.0.0-rc.5";
891
- function ke(t) {
892
- const e = Qe(
890
+ const kt = "@maptiler/geocoding-control", wt = "3.0.0-rc.6";
891
+ function we(t) {
892
+ const e = Ye(
893
893
  q([
894
- Ze([
894
+ Ke([
895
895
  [
896
896
  [180, 90],
897
897
  [-180, 90],
@@ -906,22 +906,22 @@ function ke(t) {
906
906
  if (!e)
907
907
  return;
908
908
  e.properties = { isMask: !0 };
909
- const i = N(be(t)), o = (i[2] - i[0]) / 360 / 1e3, r = i[0] < -180, s = i[2] > 180, a = Ye(t);
910
- if (a.features.length > 1 && (r || s))
911
- for (const f of a.features) {
912
- const L = N(be(f));
913
- if (s && L[0] < -180 + o)
914
- for (const w of f.geometry.coordinates)
915
- for (const S of w)
916
- S[0] += 360 - o;
917
- if (r && L[2] > 180 - o)
918
- for (const w of f.geometry.coordinates)
919
- for (const S of w)
920
- S[0] -= 360 - o;
909
+ const i = N(ke(t)), a = (i[2] - i[0]) / 360 / 1e3, s = i[0] < -180, o = i[2] > 180, r = He(t);
910
+ if (r.features.length > 1 && (s || o))
911
+ for (const u of r.features) {
912
+ const y = N(ke(u));
913
+ if (o && y[0] < -180 + a)
914
+ for (const T of u.geometry.coordinates)
915
+ for (const _ of T)
916
+ _[0] += 360 - a;
917
+ if (s && y[2] > 180 - a)
918
+ for (const T of u.geometry.coordinates)
919
+ for (const _ of T)
920
+ _[0] -= 360 - a;
921
921
  }
922
- return q([a.features.length < 2 ? t : Le(a) ?? t, e]);
922
+ return q([r.features.length < 2 ? t : $e(r) ?? t, e]);
923
923
  }
924
- const wt = {
924
+ const _t = {
925
925
  continental_marine: 4,
926
926
  country: 4,
927
927
  major_landform: 8,
@@ -945,7 +945,7 @@ const wt = {
945
945
  "poi.restaurant": 18,
946
946
  "poi.aerodrome": 13
947
947
  // TODO add many more
948
- }, _t = {
948
+ }, Lt = {
949
949
  fill: {
950
950
  paint: {
951
951
  "fill-color": "#000",
@@ -964,8 +964,8 @@ const wt = {
964
964
  },
965
965
  filter: ["!", ["has", "isMask"]]
966
966
  }
967
- }, D = "mtlr-gc-full-geom", we = "mtlr-gc-full-geom-fill", _e = "mtlr-gc-full-geom-line", Lt = he.Evented, $t = he.Marker, It = he.Popup;
968
- class Ot extends Lt {
967
+ }, D = "mtlr-gc-full-geom", _e = "mtlr-gc-full-geom-fill", Le = "mtlr-gc-full-geom-line", $t = he.Evented, It = he.Marker, Ot = he.Popup;
968
+ class Mt extends $t {
969
969
  #e = {};
970
970
  #t;
971
971
  #i;
@@ -1055,7 +1055,7 @@ class Ot extends Lt {
1055
1055
  },
1056
1056
  featureslisted: (e) => {
1057
1057
  const i = e.detail.features;
1058
- this.#o = i, this.#p(this.#o, void 0), this.#$(i), this.#s("featureslisted", e.detail);
1058
+ this.#o = i, this.#p(this.#o, void 0), this.#$(e), this.#s("featureslisted", e.detail);
1059
1059
  },
1060
1060
  featuresclear: () => {
1061
1061
  this.#o = void 0, this.#p(void 0, void 0), this.#s("featuresclear");
@@ -1106,22 +1106,23 @@ class Ot extends Lt {
1106
1106
  #L(e) {
1107
1107
  e.bbox[0] === e.bbox[2] && e.bbox[1] === e.bbox[3] ? this.#x(e.center, this.#h(e)) : this.#b(N(e.bbox), 50, this.#h(e));
1108
1108
  }
1109
- #$(e) {
1110
- if (!e || e.length === 0 || !this.#d) return;
1111
- const i = e.every((s) => s.matching_text), o = e.reduce(
1112
- (s, a) => i || !a.matching_text ? [Math.min(s[0], a.bbox[0]), Math.min(s[1], a.bbox[1]), Math.max(s[2], a.bbox[2]), Math.max(s[3], a.bbox[3])] : s,
1109
+ #$({ detail: { features: e, external: i } }) {
1110
+ if (!e || e.length === 0 || !this.#d || this.#e.flyToFeatures === !1 || this.#e.flyToFeatures === "never" || !i && (this.#e.flyToFeatures === void 0 || this.#e.flyToFeatures === "external"))
1111
+ return;
1112
+ const a = e.every((r) => r.matching_text), s = e.reduce(
1113
+ (r, u) => a || !u.matching_text ? [Math.min(r[0], u.bbox[0]), Math.min(r[1], u.bbox[1]), Math.max(r[2], u.bbox[2]), Math.max(r[3], u.bbox[3])] : r,
1113
1114
  [180, 90, -180, -90]
1114
- ), r = e.map((s) => this.#h(s)).filter((s) => s !== void 0).reduce((s, a) => s === void 0 ? a : Math.max(s, a), void 0);
1115
- this.#b(N(o), 50, r);
1115
+ ), o = e.map((r) => this.#h(r)).filter((r) => r !== void 0).reduce((r, u) => r === void 0 ? u : Math.max(r, u), void 0);
1116
+ this.#b(N(s), 50, o);
1116
1117
  }
1117
1118
  #h(e) {
1118
1119
  if (e.bbox[0] !== e.bbox[2] || e.bbox[1] !== e.bbox[3])
1119
1120
  return;
1120
- const i = e.id.replace(/\..*/, ""), o = this.#e.zoom ?? wt;
1121
- return (Array.isArray(e.properties?.categories) ? e.properties.categories.reduce((r, s) => {
1122
- const a = o[i + "." + s];
1123
- return r === void 0 ? a : a === void 0 ? r : Math.max(r, a);
1124
- }, void 0) : void 0) ?? o[i];
1121
+ const i = e.id.replace(/\..*/, ""), a = this.#e.zoom ?? _t;
1122
+ return (Array.isArray(e.properties?.categories) ? e.properties.categories.reduce((s, o) => {
1123
+ const r = a[i + "." + o];
1124
+ return s === void 0 ? r : r === void 0 ? s : Math.max(s, r);
1125
+ }, void 0) : void 0) ?? a[i];
1125
1126
  }
1126
1127
  get #d() {
1127
1128
  return !!this.#e.flyTo || this.#e.flyTo === void 0;
@@ -1135,13 +1136,13 @@ class Ot extends Lt {
1135
1136
  #x(e, i) {
1136
1137
  this.#t?.flyTo({ center: e, ...i ? { zoom: i } : {}, ...this.#I });
1137
1138
  }
1138
- #b(e, i, o) {
1139
+ #b(e, i, a) {
1139
1140
  this.#t?.fitBounds(
1140
1141
  [
1141
1142
  [e[0], e[1]],
1142
1143
  [e[2], e[3]]
1143
1144
  ],
1144
- { padding: i, ...o ? { maxZoom: o } : {}, ...this.#O }
1145
+ { padding: i, ...a ? { maxZoom: a } : {}, ...this.#O }
1145
1146
  );
1146
1147
  }
1147
1148
  #k(e) {
@@ -1156,62 +1157,62 @@ class Ot extends Lt {
1156
1157
  #p(e, i) {
1157
1158
  if (!this.#t)
1158
1159
  return;
1159
- for (const r of this.#l.values())
1160
- r.remove();
1160
+ for (const s of this.#l.values())
1161
+ s.remove();
1161
1162
  this.#l = /* @__PURE__ */ new Map(), this.#n(void 0);
1162
- const o = () => {
1163
+ const a = () => {
1163
1164
  if (!i || !this.#t || this.#e.marker === !1 || this.#e.marker === null) return;
1164
- const r = this.#e.marker instanceof Function ? this.#e.marker(this.#t, i) : this.#f(this.#e.marker).setLngLat(i.center).addTo(this.#t);
1165
- r && this.#l.set(i, r);
1165
+ const s = this.#e.marker instanceof Function ? this.#e.marker(this.#t, i) : this.#f(this.#e.marker).setLngLat(i.center).addTo(this.#t);
1166
+ s && this.#l.set(i, s);
1166
1167
  };
1167
1168
  if (i?.geometry.type === "GeometryCollection") {
1168
- const r = i.geometry.geometries.filter(
1169
- (s) => s.type === "Polygon" || s.type === "MultiPolygon"
1169
+ const s = i.geometry.geometries.filter(
1170
+ (o) => o.type === "Polygon" || o.type === "MultiPolygon"
1170
1171
  );
1171
- if (r.length > 0) {
1172
- const s = Le(q(r.map((a) => Ke(a))));
1173
- if (s) {
1174
- const a = ke({ ...i, geometry: s.geometry });
1175
- a && this.#n(a);
1172
+ if (s.length > 0) {
1173
+ const o = $e(q(s.map((r) => Qe(r))));
1174
+ if (o) {
1175
+ const r = we({ ...i, geometry: o.geometry });
1176
+ r && this.#n(r);
1176
1177
  }
1177
1178
  } else {
1178
- const s = i.geometry.geometries.filter(
1179
- (a) => a.type === "LineString" || a.type === "MultiLineString"
1179
+ const o = i.geometry.geometries.filter(
1180
+ (r) => r.type === "LineString" || r.type === "MultiLineString"
1180
1181
  );
1181
- s.length > 0 && this.#n({
1182
+ o.length > 0 && this.#n({
1182
1183
  ...i,
1183
- geometry: { type: "GeometryCollection", geometries: s }
1184
+ geometry: { type: "GeometryCollection", geometries: o }
1184
1185
  });
1185
1186
  }
1186
1187
  } else if (i?.geometry.type.endsWith("Polygon")) {
1187
- const r = ke(i);
1188
- r && this.#n(r), this.#e.pickedResultStyle === "full-geometry-including-polygon-center-marker" && o();
1189
- } else i?.geometry.type.endsWith("LineString") ? this.#n(i) : i?.geometry.type.endsWith("Point") && o();
1188
+ const s = we(i);
1189
+ s && this.#n(s), this.#e.pickedResultStyle === "full-geometry-including-polygon-center-marker" && a();
1190
+ } else i?.geometry.type.endsWith("LineString") ? this.#n(i) : i?.geometry.type.endsWith("Point") && a();
1190
1191
  if (this.#e.showResultMarkers !== !1 && this.#e.showResultMarkers !== null)
1191
- for (const r of e ?? []) {
1192
- if (r.id === i?.id || r.place_type.includes("reverse"))
1192
+ for (const s of e ?? []) {
1193
+ if (s.id === i?.id || s.place_type.includes("reverse"))
1193
1194
  continue;
1194
- let s;
1195
+ let o;
1195
1196
  if (this.#e.showResultMarkers instanceof Function) {
1196
- if (s = this.#e.showResultMarkers(this.#t, r), !s)
1197
+ if (o = this.#e.showResultMarkers(this.#t, s), !o)
1197
1198
  continue;
1198
1199
  } else
1199
- s = this.#f(this.#e.showResultMarkers).setLngLat(r.center).setPopup(
1200
- new It({
1200
+ o = this.#f(this.#e.showResultMarkers).setLngLat(s.center).setPopup(
1201
+ new Ot({
1201
1202
  offset: [1, -27],
1202
1203
  closeButton: !1,
1203
1204
  closeOnMove: !0,
1204
1205
  className: "maptiler-gc-popup"
1205
- }).setText(r.place_type[0] === "reverse" ? r.place_name : r.place_name.replace(/,.*/, ""))
1206
- ).addTo(this.#t), s.getElement().classList.add("marker-interactive");
1207
- const a = s.getElement();
1208
- a.addEventListener("click", (f) => {
1209
- f.stopPropagation(), this.#s("markerclick", { feature: r, marker: s });
1210
- }), a.addEventListener("mouseenter", () => {
1211
- this.#s("markermouseenter", { feature: r, marker: s }), s.togglePopup();
1212
- }), a.addEventListener("mouseleave", () => {
1213
- this.#s("markermouseleave", { feature: r, marker: s }), s.togglePopup();
1214
- }), a.classList.toggle("marker-fuzzy", !!r.matching_text), this.#l.set(r, s);
1206
+ }).setText(s.place_type[0] === "reverse" ? s.place_name : s.place_name.replace(/,.*/, ""))
1207
+ ).addTo(this.#t), o.getElement().classList.add("marker-interactive");
1208
+ const r = o.getElement();
1209
+ r.addEventListener("click", (u) => {
1210
+ u.stopPropagation(), this.#s("markerclick", { feature: s, marker: o });
1211
+ }), r.addEventListener("mouseenter", () => {
1212
+ this.#s("markermouseenter", { feature: s, marker: o }), o.togglePopup();
1213
+ }), r.addEventListener("mouseleave", () => {
1214
+ this.#s("markermouseleave", { feature: s, marker: o }), o.togglePopup();
1215
+ }), r.classList.toggle("marker-fuzzy", !!s.matching_text), this.#l.set(s, o);
1215
1216
  }
1216
1217
  }
1217
1218
  #M(e) {
@@ -1228,14 +1229,14 @@ class Ot extends Lt {
1228
1229
  !e?.fill && !e?.line || !i && !this.#a || (i ? i.setData(this.#a ?? q([])) : this.#a && this.#t.addSource(D, {
1229
1230
  type: "geojson",
1230
1231
  data: this.#a
1231
- }), !this.#t.getLayer(we) && e.fill && this.#t.addLayer({
1232
+ }), !this.#t.getLayer(_e) && e.fill && this.#t.addLayer({
1232
1233
  ...e.fill,
1233
- id: we,
1234
+ id: _e,
1234
1235
  type: "fill",
1235
1236
  source: D
1236
- }), !this.#t.getLayer(_e) && e.line && this.#t.addLayer({
1237
+ }), !this.#t.getLayer(Le) && e.line && this.#t.addLayer({
1237
1238
  ...e.line,
1238
- id: _e,
1239
+ id: Le,
1239
1240
  type: "line",
1240
1241
  source: D
1241
1242
  }));
@@ -1244,30 +1245,30 @@ class Ot extends Lt {
1244
1245
  this.#a = e, this.#u();
1245
1246
  }
1246
1247
  #f(e) {
1247
- return typeof e != "object" && (e = { element: this.#t?._container.ownerDocument.createElement("maptiler-geocode-marker"), offset: [1, -13] }), new $t(e);
1248
+ return typeof e != "object" && (e = { element: this.#t?._container.ownerDocument.createElement("maptiler-geocode-marker"), offset: [1, -13] }), new It(e);
1248
1249
  }
1249
1250
  #T() {
1250
1251
  const { fullGeometryStyle: e } = this.#e;
1251
- if (e === !0 || e === void 0) return _t;
1252
+ if (e === !0 || e === void 0) return Lt;
1252
1253
  if (!(e === !1 || e === null))
1253
1254
  return e;
1254
1255
  }
1255
1256
  }
1256
- class Dt extends Ot {
1257
+ class Wt extends Mt {
1257
1258
  #e;
1258
1259
  constructor(e = {}) {
1259
1260
  super(e);
1260
1261
  }
1261
1262
  /** @internal Not to be called directly */
1262
1263
  onAdd(e) {
1263
- this.#e = e, e.telemetry.registerModule(bt, kt);
1264
- const i = this.getOptions(), { primaryLanguage: o, apiKey: r } = e.getSdkConfig();
1265
- if (i.apiKey === void 0 && this.setOptions({ apiKey: r }), i.language === void 0) {
1266
- const a = o.code?.match(/^([a-z]{2,3})($|_|-)/);
1267
- a && this.setOptions({ language: a[1] });
1264
+ this.#e = e, e.telemetry.registerModule(kt, wt);
1265
+ const i = this.getOptions(), { primaryLanguage: a, apiKey: s } = e.getSdkConfig();
1266
+ if (i.apiKey === void 0 && this.setOptions({ apiKey: s }), i.language === void 0) {
1267
+ const r = a.code?.match(/^([a-z]{2,3})($|_|-)/);
1268
+ r && this.setOptions({ language: r[1] });
1268
1269
  }
1269
- const s = super.onAdd(e);
1270
- return s.classList.add("maptiler-ctrl-geocoder"), s.querySelector("maptiler-geocoder")?.classList.add("maptiler-geocoder"), s;
1270
+ const o = super.onAdd(e);
1271
+ return o.classList.add("maptiler-ctrl-geocoder"), o.querySelector("maptiler-geocoder")?.classList.add("maptiler-geocoder"), o;
1271
1272
  }
1272
1273
  /** @internal Not to be called directly */
1273
1274
  onRemove() {
@@ -1277,17 +1278,17 @@ class Dt extends Ot {
1277
1278
  const i = e.adjustUrl;
1278
1279
  super.setOptions({
1279
1280
  ...e,
1280
- adjustUrl: (o) => {
1281
- i?.(o);
1282
- const r = this.getOptions();
1283
- (Ne.session ? e.session !== !1 : e.session === !0) && this.#e && (!r.apiUrl || new URL(r.apiUrl).host === new URL("https://api.maptiler.com/geocoding").host) && o.searchParams.append("mtsid", this.#e.getMaptilerSessionId());
1281
+ adjustUrl: (a) => {
1282
+ i?.(a);
1283
+ const s = this.getOptions();
1284
+ (Ze.session ? e.session !== !1 : e.session === !0) && this.#e && (!s.apiUrl || new URL(s.apiUrl).host === new URL("https://api.maptiler.com/geocoding").host) && a.searchParams.append("mtsid", this.#e.getMaptilerSessionId());
1284
1285
  }
1285
1286
  });
1286
1287
  }
1287
1288
  }
1288
1289
  export {
1289
- _t as DEFAULT_GEOMETRY_STYLE,
1290
- Dt as GeocodingControl,
1290
+ Lt as DEFAULT_GEOMETRY_STYLE,
1291
+ Wt as GeocodingControl,
1291
1292
  ee as MaptilerGeocodeClearIconElement,
1292
1293
  te as MaptilerGeocodeFailIconElement,
1293
1294
  ie as MaptilerGeocodeLoadingIconElement,
@@ -1295,10 +1296,10 @@ export {
1295
1296
  se as MaptilerGeocodeReverseGeocodingIconElement,
1296
1297
  re as MaptilerGeocodeSearchIconElement,
1297
1298
  n as MaptilerGeocoderElement,
1298
- Dt as MaptilerGeocodingControl,
1299
- we as RESULT_LAYER_FILL,
1300
- _e as RESULT_LAYER_LINE,
1299
+ Wt as MaptilerGeocodingControl,
1300
+ _e as RESULT_LAYER_FILL,
1301
+ Le as RESULT_LAYER_LINE,
1301
1302
  D as RESULT_SOURCE,
1302
- wt as ZOOM_DEFAULTS
1303
+ _t as ZOOM_DEFAULTS
1303
1304
  };
1304
1305
  //# sourceMappingURL=maptilersdk.js.map