var vi = Object.defineProperty;
var Li = Object.getPrototypeOf;
var _i = Reflect.get;
var vt = (i) => {
  throw TypeError(i);
};
var yi = (i, e, t) => e in i ? vi(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
var rt = (i, e, t) => yi(i, typeof e != "symbol" ? e + "" : e, t), ot = (i, e, t) => e.has(i) || vt("Cannot " + t);
var ie = (i, e, t) => (ot(i, e, "read from private field"), t ? t.call(i) : e.get(i)), st = (i, e, t) => e.has(i) ? vt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), Lt = (i, e, t, n) => (ot(i, e, "write to private field"), n ? n.call(i, t) : e.set(i, t), t), _t = (i, e, t) => (ot(i, e, "access private method"), t);
var yt = (i, e, t) => _i(Li(i), t, e);
function A() {
}
function wi(i, e) {
  for (const t in e) i[t] = e[t];
  return (
    /** @type {T & S} */
    i
  );
}
function Pt(i) {
  return i();
}
function wt() {
  return /* @__PURE__ */ Object.create(null);
}
function ae(i) {
  i.forEach(Pt);
}
function jt(i) {
  return typeof i == "function";
}
function ve(i, e) {
  return i != i ? e == e : i !== e || i && typeof i == "object" || typeof i == "function";
}
let Pe;
function K(i, e) {
  return i === e ? !0 : (Pe || (Pe = document.createElement("a")), Pe.href = e, i === Pe.href);
}
function Ei(i) {
  return Object.keys(i).length === 0;
}
function Si(i, e, t, n) {
  if (i) {
    const r = Zt(i, e, t, n);
    return i[0](r);
  }
}
function Zt(i, e, t, n) {
  return i[1] && n ? wi(t.ctx.slice(), i[1](n(e))) : t.ctx;
}
function pi(i, e, t, n) {
  if (i[2] && n) {
    const r = i[2](n(t));
    if (e.dirty === void 0)
      return r;
    if (typeof r == "object") {
      const l = [], d = Math.max(e.dirty.length, r.length);
      for (let o = 0; o < d; o += 1)
        l[o] = e.dirty[o] | r[o];
      return l;
    }
    return e.dirty | r;
  }
  return e.dirty;
}
function Ti(i, e, t, n, r, l) {
  if (r) {
    const d = Zt(e, t, n, l);
    i.p(d, r);
  }
}
function Ni(i) {
  if (i.ctx.length > 32) {
    const e = [], t = i.ctx.length / 32;
    for (let n = 0; n < t; n++)
      e[n] = -1;
    return e;
  }
  return -1;
}
function Et(i) {
  return i ?? "";
}
function N(i, e) {
  i.appendChild(e);
}
function B(i, e, t) {
  i.insertBefore(e, t || null);
}
function O(i) {
  i.parentNode && i.parentNode.removeChild(i);
}
function W(i) {
  return document.createElement(i);
}
function re(i) {
  return document.createElementNS("http://www.w3.org/2000/svg", i);
}
function de(i) {
  return document.createTextNode(i);
}
function X() {
  return de(" ");
}
function ki() {
  return de("");
}
function V(i, e, t, n) {
  return i.addEventListener(e, t, n), () => i.removeEventListener(e, t, n);
}
function Mi(i) {
  return function(e) {
    return e.preventDefault(), i.call(this, e);
  };
}
function a(i, e, t) {
  t == null ? i.removeAttribute(e) : i.getAttribute(e) !== t && i.setAttribute(e, t);
}
function Ci(i) {
  return Array.from(i.childNodes);
}
function Re(i, e) {
  e = "" + e, i.data !== e && (i.data = /** @type {string} */
  e);
}
function St(i, e) {
  i.value = e ?? "";
}
function ce(i, e, t) {
  i.classList.toggle(e, !!t);
}
function Wi(i, e, { bubbles: t = !1, cancelable: n = !1 } = {}) {
  return new CustomEvent(i, { detail: e, bubbles: t, cancelable: n });
}
let De;
function ze(i) {
  De = i;
}
function qt() {
  if (!De) throw new Error("Function called outside component initialization");
  return De;
}
function zi(i) {
  qt().$$.on_destroy.push(i);
}
function Ri() {
  const i = qt();
  return (e, t, { cancelable: n = !1 } = {}) => {
    const r = i.$$.callbacks[e];
    if (r) {
      const l = Wi(
        /** @type {string} */
        e,
        t,
        { cancelable: n }
      );
      return r.slice().forEach((d) => {
        d.call(i, l);
      }), !l.defaultPrevented;
    }
    return !0;
  };
}
function pt(i, e) {
  const t = i.$$.callbacks[e.type];
  t && t.slice().forEach((n) => n.call(this, e));
}
const pe = [], lt = [];
let Te = [];
const Tt = [], Di = /* @__PURE__ */ Promise.resolve();
let ut = !1;
function Oi() {
  ut || (ut = !0, Di.then(Gt));
}
function ct(i) {
  Te.push(i);
}
const at = /* @__PURE__ */ new Set();
let Se = 0;
function Gt() {
  if (Se !== 0)
    return;
  const i = De;
  do {
    try {
      for (; Se < pe.length; ) {
        const e = pe[Se];
        Se++, ze(e), Ii(e.$$);
      }
    } catch (e) {
      throw pe.length = 0, Se = 0, e;
    }
    for (ze(null), pe.length = 0, Se = 0; lt.length; ) lt.pop()();
    for (let e = 0; e < Te.length; e += 1) {
      const t = Te[e];
      at.has(t) || (at.add(t), t());
    }
    Te.length = 0;
  } while (pe.length);
  for (; Tt.length; )
    Tt.pop()();
  ut = !1, at.clear(), ze(i);
}
function Ii(i) {
  if (i.fragment !== null) {
    i.update(), ae(i.before_update);
    const e = i.dirty;
    i.dirty = [-1], i.fragment && i.fragment.p(i.ctx, e), i.after_update.forEach(ct);
  }
}
function Ui(i) {
  const e = [], t = [];
  Te.forEach((n) => i.indexOf(n) === -1 ? e.push(n) : t.push(n)), t.forEach((n) => n()), Te = e;
}
const je = /* @__PURE__ */ new Set();
let be;
function Ze() {
  be = {
    r: 0,
    c: [],
    p: be
    // parent group
  };
}
function qe() {
  be.r || ae(be.c), be = be.p;
}
function F(i, e) {
  i && i.i && (je.delete(i), i.i(e));
}
function Q(i, e, t, n) {
  if (i && i.o) {
    if (je.has(i)) return;
    je.add(i), be.c.push(() => {
      je.delete(i), n && (t && i.d(1), n());
    }), i.o(e);
  } else n && n();
}
function Nt(i) {
  return (i == null ? void 0 : i.length) !== void 0 ? i : Array.from(i);
}
function Ai(i, e) {
  Q(i, 1, 1, () => {
    e.delete(i.key);
  });
}
function Bi(i, e, t, n, r, l, d, o, m, u, f, v) {
  let b = i.length, y = l.length, _ = b;
  const z = {};
  for (; _--; ) z[i[_].key] = _;
  const L = [], E = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), M = [];
  for (_ = y; _--; ) {
    const c = v(r, l, _), g = t(c);
    let k = d.get(g);
    k ? M.push(() => k.p(c, e)) : (k = u(g, c), k.c()), E.set(g, L[_] = k), g in z && C.set(g, Math.abs(_ - z[g]));
  }
  const p = /* @__PURE__ */ new Set(), H = /* @__PURE__ */ new Set();
  function R(c) {
    F(c, 1), c.m(o, f), d.set(c.key, c), f = c.first, y--;
  }
  for (; b && y; ) {
    const c = L[y - 1], g = i[b - 1], k = c.key, Z = g.key;
    c === g ? (f = c.first, b--, y--) : E.has(Z) ? !d.has(k) || p.has(k) ? R(c) : H.has(Z) ? b-- : C.get(k) > C.get(Z) ? (H.add(k), R(c)) : (p.add(Z), b--) : (m(g, d), b--);
  }
  for (; b--; ) {
    const c = i[b];
    E.has(c.key) || m(c, d);
  }
  for (; y; ) R(L[y - 1]);
  return ae(M), L;
}
function fe(i) {
  i && i.c();
}
function oe(i, e, t) {
  const { fragment: n, after_update: r } = i.$$;
  n && n.m(e, t), ct(() => {
    const l = i.$$.on_mount.map(Pt).filter(jt);
    i.$$.on_destroy ? i.$$.on_destroy.push(...l) : ae(l), i.$$.on_mount = [];
  }), r.forEach(ct);
}
function se(i, e) {
  const t = i.$$;
  t.fragment !== null && (Ui(t.after_update), ae(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
}
function Fi(i, e) {
  i.$$.dirty[0] === -1 && (pe.push(i), Oi(), i.$$.dirty.fill(0)), i.$$.dirty[e / 31 | 0] |= 1 << e % 31;
}
function Le(i, e, t, n, r, l, d = null, o = [-1]) {
  const m = De;
  ze(i);
  const u = i.$$ = {
    fragment: null,
    ctx: [],
    // state
    props: l,
    update: A,
    not_equal: r,
    bound: wt(),
    // lifecycle
    on_mount: [],
    on_destroy: [],
    on_disconnect: [],
    before_update: [],
    after_update: [],
    context: new Map(e.context || (m ? m.$$.context : [])),
    // everything else
    callbacks: wt(),
    dirty: o,
    skip_bound: !1,
    root: e.target || m.$$.root
  };
  d && d(u.root);
  let f = !1;
  if (u.ctx = t ? t(i, e.props || {}, (v, b, ...y) => {
    const _ = y.length ? y[0] : b;
    return u.ctx && r(u.ctx[v], u.ctx[v] = _) && (!u.skip_bound && u.bound[v] && u.bound[v](_), f && Fi(i, v)), b;
  }) : [], u.update(), f = !0, ae(u.before_update), u.fragment = n ? n(u.ctx) : !1, e.target) {
    if (e.hydrate) {
      const v = Ci(e.target);
      u.fragment && u.fragment.l(v), v.forEach(O);
    } else
      u.fragment && u.fragment.c();
    e.intro && F(i.$$.fragment), oe(i, e.target, e.anchor), Gt();
  }
  ze(m);
}
class _e {
  constructor() {
    /**
     * ### PRIVATE API
     *
     * Do not use, may change at any time
     *
     * @type {any}
     */
    rt(this, "$$");
    /**
     * ### PRIVATE API
     *
     * Do not use, may change at any time
     *
     * @type {any}
     */
    rt(this, "$$set");
  }
  /** @returns {void} */
  $destroy() {
    se(this, 1), this.$destroy = A;
  }
  /**
   * @template {Extract<keyof Events, string>} K
   * @param {K} type
   * @param {((e: Events[K]) => void) | null | undefined} callback
   * @returns {() => void}
   */
  $on(e, t) {
    if (!jt(t))
      return A;
    const n = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
    return n.push(t), () => {
      const r = n.indexOf(t);
      r !== -1 && n.splice(r, 1);
    };
  }
  /**
   * @param {Partial<Props>} props
   * @returns {void}
   */
  $set(e) {
    this.$$set && !Ei(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
  }
}
const Hi = "4";
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Hi);
function Pi(i) {
  let e, t;
  return {
    c() {
      e = re("svg"), t = re("path"), a(t, "d", "M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"), a(e, "viewBox", "0 0 14 14"), a(e, "width", "13"), a(e, "height", "13"), a(e, "class", "svelte-en2qvf");
    },
    m(n, r) {
      B(n, e, r), N(e, t);
    },
    p: A,
    i: A,
    o: A,
    d(n) {
      n && O(e);
    }
  };
}
class Qt extends _e {
  constructor(e) {
    super(), Le(this, e, null, Pi, ve, {});
  }
}
function ji(i) {
  let e, t;
  return {
    c() {
      e = re("svg"), t = re("path"), a(t, "d", "M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"), a(e, "viewBox", "0 0 30 30"), a(e, "fill", "none"), a(e, "xmlns", "http://www.w3.org/2000/svg"), a(e, "class", "svelte-d2loi5");
    },
    m(n, r) {
      B(n, e, r), N(e, t);
    },
    p: A,
    i: A,
    o: A,
    d(n) {
      n && O(e);
    }
  };
}
class Kt extends _e {
  constructor(e) {
    super(), Le(this, e, null, ji, ve, {});
  }
}
function Zi(i) {
  let e, t;
  return {
    c() {
      e = W("img"), K(e.src, t = /*iconsBaseUrl*/
      i[3] + "area.svg") || a(e, "src", t), a(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), a(e, "class", "svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r);
    },
    p(n, r) {
      r & /*iconsBaseUrl*/
      8 && !K(e.src, t = /*iconsBaseUrl*/
      n[3] + "area.svg") && a(e, "src", t), r & /*placeType*/
      64 && a(
        e,
        "alt",
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function qi(i) {
  let e, t;
  return {
    c() {
      e = W("img"), K(e.src, t = /*iconsBaseUrl*/
      i[3] + "reverse.svg") || a(e, "src", t), a(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), a(e, "class", "svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r);
    },
    p(n, r) {
      r & /*iconsBaseUrl*/
      8 && !K(e.src, t = /*iconsBaseUrl*/
      n[3] + "reverse.svg") && a(e, "src", t), r & /*placeType*/
      64 && a(
        e,
        "alt",
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function Gi(i) {
  let e, t;
  return {
    c() {
      e = W("img"), K(e.src, t = /*iconsBaseUrl*/
      i[3] + "poi.svg") || a(e, "src", t), a(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), a(e, "class", "svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r);
    },
    p(n, r) {
      r & /*iconsBaseUrl*/
      8 && !K(e.src, t = /*iconsBaseUrl*/
      n[3] + "poi.svg") && a(e, "src", t), r & /*placeType*/
      64 && a(
        e,
        "alt",
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function Qi(i) {
  let e, t;
  return {
    c() {
      e = W("img"), K(e.src, t = /*iconsBaseUrl*/
      i[3] + "postal_code.svg") || a(e, "src", t), a(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), a(e, "class", "svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r);
    },
    p(n, r) {
      r & /*iconsBaseUrl*/
      8 && !K(e.src, t = /*iconsBaseUrl*/
      n[3] + "postal_code.svg") && a(e, "src", t), r & /*placeType*/
      64 && a(
        e,
        "alt",
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function Ki(i) {
  let e, t;
  return {
    c() {
      e = W("img"), K(e.src, t = /*iconsBaseUrl*/
      i[3] + "street.svg") || a(e, "src", t), a(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), a(e, "class", "svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r);
    },
    p(n, r) {
      r & /*iconsBaseUrl*/
      8 && !K(e.src, t = /*iconsBaseUrl*/
      n[3] + "street.svg") && a(e, "src", t), r & /*placeType*/
      64 && a(
        e,
        "alt",
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function Vi(i) {
  let e, t;
  return {
    c() {
      e = W("img"), K(e.src, t = /*iconsBaseUrl*/
      i[3] + "road.svg") || a(e, "src", t), a(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), a(e, "class", "svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r);
    },
    p(n, r) {
      r & /*iconsBaseUrl*/
      8 && !K(e.src, t = /*iconsBaseUrl*/
      n[3] + "road.svg") && a(e, "src", t), r & /*placeType*/
      64 && a(
        e,
        "alt",
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function xi(i) {
  let e, t;
  return {
    c() {
      e = W("img"), K(e.src, t = /*iconsBaseUrl*/
      i[3] + "housenumber.svg") || a(e, "src", t), a(
        e,
        "alt",
        /*placeType*/
        i[6]
      ), a(e, "class", "svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r);
    },
    p(n, r) {
      r & /*iconsBaseUrl*/
      8 && !K(e.src, t = /*iconsBaseUrl*/
      n[3] + "housenumber.svg") && a(e, "src", t), r & /*placeType*/
      64 && a(
        e,
        "alt",
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function Ji(i) {
  let e, t, n, r;
  return {
    c() {
      e = W("img"), K(e.src, t = /*imageUrl*/
      i[5]) || a(e, "src", t), a(
        e,
        "alt",
        /*category*/
        i[4]
      ), a(e, "class", "svelte-ltkwvy");
    },
    m(l, d) {
      B(l, e, d), n || (r = V(
        e,
        "error",
        /*error_handler*/
        i[14]
      ), n = !0);
    },
    p(l, d) {
      d & /*imageUrl*/
      32 && !K(e.src, t = /*imageUrl*/
      l[5]) && a(e, "src", t), d & /*category*/
      16 && a(
        e,
        "alt",
        /*category*/
        l[4]
      );
    },
    d(l) {
      l && O(e), n = !1, r();
    }
  };
}
function kt(i) {
  let e, t;
  return {
    c() {
      e = W("span"), t = de(
        /*placeType*/
        i[6]
      ), a(e, "class", "secondary svelte-ltkwvy");
    },
    m(n, r) {
      B(n, e, r), N(e, t);
    },
    p(n, r) {
      r & /*placeType*/
      64 && Re(
        t,
        /*placeType*/
        n[6]
      );
    },
    d(n) {
      n && O(e);
    }
  };
}
function Xi(i) {
  let e, t, n, r, l, d, o, m, u, f = (
    /*isReverse*/
    (i[7] ? (
      /*feature*/
      i[0].place_name
    ) : (
      /*feature*/
      i[0].place_name.replace(/,.*/, "")
    )) + ""
  ), v, b, y = (
    /*showPlaceType*/
    i[2] === "always" || /*showPlaceType*/
    i[2] !== "never" && !/*feature*/
    i[0].address && !/*feature*/
    i[0].id.startsWith("road.") && !/*feature*/
    i[0].id.startsWith("address.") && !/*feature*/
    i[0].id.startsWith("postal_code.") && (!/*feature*/
    i[0].id.startsWith("poi.") || !/*imageUrl*/
    i[5]) && !/*isReverse*/
    i[7]
  ), _, z, L = (
    /*isReverse*/
    (i[7] ? "" : (
      /*feature*/
      i[0].place_name.replace(/[^,]*,?\s*/, "")
    )) + ""
  ), E, C, M;
  function p(g, k) {
    return k & /*feature*/
    1 && (t = null), k & /*feature*/
    1 && (n = null), k & /*feature*/
    1 && (r = null), k & /*feature*/
    1 && (l = null), /*imageUrl*/
    g[5] ? Ji : (
      /*feature*/
      g[0].address ? xi : (t == null && (t = !!/*feature*/
      g[0].id.startsWith("road.")), t ? Vi : (n == null && (n = !!/*feature*/
      g[0].id.startsWith("address.")), n ? Ki : (r == null && (r = !!/*feature*/
      g[0].id.startsWith("postal_code.")), r ? Qi : (l == null && (l = !!/*feature*/
      g[0].id.startsWith("poi.")), l ? Gi : (
        /*isReverse*/
        g[7] ? qi : Zi
      )))))
    );
  }
  let H = p(i, -1), R = H(i), c = y && kt(i);
  return {
    c() {
      e = W("li"), R.c(), d = X(), o = W("span"), m = W("span"), u = W("span"), v = de(f), b = X(), c && c.c(), _ = X(), z = W("span"), E = de(L), a(u, "class", "primary svelte-ltkwvy"), a(m, "class", "svelte-ltkwvy"), a(z, "class", "line2 svelte-ltkwvy"), a(o, "class", "texts svelte-ltkwvy"), a(e, "tabindex", "0"), a(
        e,
        "data-selected",
        /*selected*/
        i[1]
      ), a(e, "class", "svelte-ltkwvy"), ce(
        e,
        "selected",
        /*selected*/
        i[1]
      );
    },
    m(g, k) {
      B(g, e, k), R.m(e, null), N(e, d), N(e, o), N(o, m), N(m, u), N(u, v), N(m, b), c && c.m(m, null), N(o, _), N(o, z), N(z, E), C || (M = [
        V(
          e,
          "mouseenter",
          /*mouseenter_handler*/
          i[12]
        ),
        V(
          e,
          "focus",
          /*focus_handler*/
          i[13]
        )
      ], C = !0);
    },
    p(g, [k]) {
      H === (H = p(g, k)) && R ? R.p(g, k) : (R.d(1), R = H(g), R && (R.c(), R.m(e, d))), k & /*feature*/
      1 && f !== (f = /*isReverse*/
      (g[7] ? (
        /*feature*/
        g[0].place_name
      ) : (
        /*feature*/
        g[0].place_name.replace(/,.*/, "")
      )) + "") && Re(v, f), k & /*showPlaceType, feature, imageUrl*/
      37 && (y = /*showPlaceType*/
      g[2] === "always" || /*showPlaceType*/
      g[2] !== "never" && !/*feature*/
      g[0].address && !/*feature*/
      g[0].id.startsWith("road.") && !/*feature*/
      g[0].id.startsWith("address.") && !/*feature*/
      g[0].id.startsWith("postal_code.") && (!/*feature*/
      g[0].id.startsWith("poi.") || !/*imageUrl*/
      g[5]) && !/*isReverse*/
      g[7]), y ? c ? c.p(g, k) : (c = kt(g), c.c(), c.m(m, null)) : c && (c.d(1), c = null), k & /*feature*/
      1 && L !== (L = /*isReverse*/
      (g[7] ? "" : (
        /*feature*/
        g[0].place_name.replace(/[^,]*,?\s*/, "")
      )) + "") && Re(E, L), k & /*selected*/
      2 && a(
        e,
        "data-selected",
        /*selected*/
        g[1]
      ), k & /*selected*/
      2 && ce(
        e,
        "selected",
        /*selected*/
        g[1]
      );
    },
    i: A,
    o: A,
    d(g) {
      g && O(e), R.d(), c && c.d(), C = !1, ae(M);
    }
  };
}
function Yi(i, e, t) {
  var M;
  let n, r, { feature: l } = e, { selected: d = !1 } = e, { showPlaceType: o } = e, { missingIconsCache: m } = e, { iconsBaseUrl: u } = e;
  const f = (M = l.properties) == null ? void 0 : M.categories;
  let v, b, y = 0, _ = l.place_type[0] === "reverse";
  function z() {
    b && m.add(b), t(10, y++, y);
  }
  function L(p) {
    pt.call(this, i, p);
  }
  function E(p) {
    pt.call(this, i, p);
  }
  const C = () => z();
  return i.$$set = (p) => {
    "feature" in p && t(0, l = p.feature), "selected" in p && t(1, d = p.selected), "showPlaceType" in p && t(2, o = p.showPlaceType), "missingIconsCache" in p && t(9, m = p.missingIconsCache), "iconsBaseUrl" in p && t(3, u = p.iconsBaseUrl);
  }, i.$$.update = () => {
    var p, H, R, c;
    if (i.$$.dirty & /*loadIconAttempt, index, category, iconsBaseUrl, imageUrl, missingIconsCache*/
    3640)
      do
        t(11, n--, n), t(4, v = f == null ? void 0 : f[n]), t(5, b = v ? u + v.replace(/ /g, "_") + ".svg" : void 0);
      while (n > -1 && (!b || m.has(b)));
    i.$$.dirty & /*feature*/
    1 && t(6, r = ((H = (p = l.properties) == null ? void 0 : p.categories) == null ? void 0 : H.join(", ")) ?? ((c = (R = l.properties) == null ? void 0 : R.place_type_name) == null ? void 0 : c[0]) ?? l.place_type[0]);
  }, t(11, n = (f == null ? void 0 : f.length) ?? 0), [
    l,
    d,
    o,
    u,
    v,
    b,
    r,
    _,
    z,
    m,
    y,
    n,
    L,
    E,
    C
  ];
}
class $i extends _e {
  constructor(e) {
    super(), Le(this, e, Yi, Xi, ve, {
      feature: 0,
      selected: 1,
      showPlaceType: 2,
      missingIconsCache: 9,
      iconsBaseUrl: 3
    });
  }
}
function en(i) {
  let e;
  return {
    c() {
      e = W("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>', a(e, "class", "svelte-7cmwmc");
    },
    m(t, n) {
      B(t, e, n);
    },
    p: A,
    i: A,
    o: A,
    d(t) {
      t && O(e);
    }
  };
}
class tn extends _e {
  constructor(e) {
    super(), Le(this, e, null, en, ve, {});
  }
}
function nn(i) {
  let e, t;
  return {
    c() {
      e = re("svg"), t = re("path"), a(t, "d", "M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"), a(e, "viewBox", "0 0 60.006 21.412"), a(e, "width", "14"), a(e, "height", "20"), a(e, "class", "svelte-en2qvf");
    },
    m(n, r) {
      B(n, e, r), N(e, t);
    },
    p: A,
    i: A,
    o: A,
    d(n) {
      n && O(e);
    }
  };
}
class rn extends _e {
  constructor(e) {
    super(), Le(this, e, null, nn, ve, {});
  }
}
function on(i) {
  let e, t, n;
  return {
    c() {
      e = re("svg"), t = re("circle"), n = re("path"), a(t, "cx", "4.789"), a(t, "cy", "4.787"), a(t, "r", "3.85"), a(t, "class", "svelte-1aq105l"), a(n, "d", "M12.063 12.063 7.635 7.635"), a(n, "class", "svelte-1aq105l"), a(e, "xmlns", "http://www.w3.org/2000/svg"), a(e, "width", "13"), a(e, "height", "13"), a(e, "viewBox", "0 0 13 13"), a(e, "class", "svelte-1aq105l");
    },
    m(r, l) {
      B(r, e, l), N(e, t), N(e, n);
    },
    p: A,
    i: A,
    o: A,
    d(r) {
      r && O(e);
    }
  };
}
class sn extends _e {
  constructor(e) {
    super(), Le(this, e, null, on, ve, {});
  }
}
function an(i, e, t) {
  const n = e[1], r = e[0], l = n - r;
  return i === n && t ? i : ((i - r) % l + l) % l + r;
}
function Mt(i) {
  const e = [...i];
  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;
}
let Ce;
async function ln(i, e, t) {
  const n = i == null ? void 0 : i.getCenterAndZoom();
  for (const r of e ?? [])
    if (!(n && (r.minZoom != null && r.minZoom > n[0] || r.maxZoom != null && r.maxZoom < n[0]))) {
      if (r.type === "fixed")
        return r.coordinates.join(",");
      e: if (r.type === "client-geolocation") {
        if (Ce && r.cachedLocationExpiry && Ce.time + r.cachedLocationExpiry > Date.now()) {
          if (!Ce.coords)
            break e;
          return Ce.coords;
        }
        let l;
        try {
          return l = await new Promise((d, o) => {
            t.signal.addEventListener("abort", () => {
              o(Error("aborted"));
            }), navigator.geolocation.getCurrentPosition(
              (m) => {
                d(
                  [m.coords.longitude, m.coords.latitude].map((u) => u.toFixed(6)).join(",")
                );
              },
              (m) => {
                o(m);
              },
              r
            );
          }), l;
        } catch {
        } finally {
          r.cachedLocationExpiry && (Ce = {
            time: Date.now(),
            coords: l
          });
        }
        if (t.signal.aborted)
          return;
      }
      if (r.type === "server-geolocation")
        return "ip";
      if (n && r.type === "map-center")
        return n[1].toFixed(6) + "," + n[2].toFixed(6);
    }
}
const un = /^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i, Ct = /^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/, Wt = /^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i, zt = /^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i, Rt = /^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i, Dt = /^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;
function cn(i) {
  if (!["DMS", "DM", "DD"].includes(i))
    throw new Error("invalid format specified");
  if (this.decimalCoordinates && this.decimalCoordinates.trim()) {
    const e = this.decimalCoordinates.split(",").map((y) => Number(y.trim())), t = Number(e[0]), n = Number(e[1]), r = Math.abs(t), l = Math.abs(n), d = t > 0 ? "N" : "S", o = n > 0 ? "E" : "W";
    let m;
    i == "DD" && (m = `${r}° ${d}, ${l}° ${o}`);
    const u = Math.floor(r), f = Math.floor(l), v = (r - u) * 60, b = (l - f) * 60;
    if (i == "DM") {
      let y = Ot(v, 3).toFixed(3).padStart(6, "0"), _ = Ot(b, 3).toFixed(3).padStart(6, "0");
      y.endsWith(".000") && _.endsWith(".000") && (y = y.replace(/\.000$/, ""), _ = _.replace(/\.000$/, "")), m = `${u}° ${y}' ${d}, ${f}° ${_}' ${o}`;
    }
    if (i == "DMS") {
      const y = Math.floor(v), _ = Math.floor(b);
      let z = ((v - y) * 60).toFixed(1).padStart(4, "0"), L = ((b - _) * 60).toFixed(1).padStart(4, "0");
      const E = y.toString().padStart(2, "0"), C = _.toString().padStart(2, "0");
      z.endsWith(".0") && L.endsWith(".0") && (z = z.replace(/\.0$/, ""), L = L.replace(/\.0$/, "")), m = `${u}° ${E}' ${z}" ${d}, ${f}° ${C}' ${L}" ${o}`;
    }
    return m;
  } else
    throw new Error("no decimal coordinates to convert");
}
function Ot(i, e) {
  const t = Math.pow(10, e);
  return Math.round((i + Number.EPSILON) * t) / t;
}
function dt(i, e) {
  e || (e = 5), i = i.replace(/\s+/g, " ").trim();
  let t = null, n = null, r = "", l = "", d = null, o = [], m = !1;
  if (un.test(i))
    throw new Error("invalid coordinate value");
  if (Ct.test(i))
    if (o = Ct.exec(i), m = We(o), m)
      t = Math.abs(o[1]) + o[2] / 60, Number(o[1]) < 0 && (t *= -1), n = Math.abs(o[3]) + o[4] / 60, Number(o[3]) < 0 && (n *= -1), d = "DM";
    else
      throw new Error("invalid coordinate format");
  else if (Wt.test(i))
    if (o = Wt.exec(i), m = We(o), m) {
      if (t = o[2], n = o[6], t.includes(",") && (t = t.replace(",", ".")), n.includes(",") && (n = n.replace(",", ".")), d = "DD", Number(Math.round(t)) == Number(t))
        throw new Error("integer only coordinate provided");
      if (Number(Math.round(n)) == Number(n))
        throw new Error("integer only coordinate provided");
      o[1] ? (r = o[1], l = o[5]) : o[4] && (r = o[4], l = o[8]);
    } else
      throw new Error("invalid decimal coordinate format");
  else if (zt.test(i))
    if (o = zt.exec(i), m = We(o), m)
      t = Math.abs(parseInt(o[2])), o[4] && (t += o[4] / 60, d = "DM"), o[6] && (t += o[6].replace(",", ".") / 3600, d = "DMS"), parseInt(o[2]) < 0 && (t = -1 * t), n = Math.abs(parseInt(o[9])), o[11] && (n += o[11] / 60), o[13] && (n += o[13].replace(",", ".") / 3600), parseInt(o[9]) < 0 && (n = -1 * n), o[1] ? (r = o[1], l = o[8]) : o[7] && (r = o[7], l = o[14]);
    else
      throw new Error("invalid DMS coordinates format");
  else if (Rt.test(i))
    if (o = Rt.exec(i), m = We(o), m)
      t = Math.abs(parseInt(o[2])), o[4] && (t += o[4] / 60, d = "DM"), o[6] && (t += o[6] / 3600, d = "DMS"), parseInt(o[2]) < 0 && (t = -1 * t), n = Math.abs(parseInt(o[10])), o[12] && (n += o[12] / 60), o[14] && (n += o[14] / 3600), parseInt(o[10]) < 0 && (n = -1 * n), o[1] ? (r = o[1], l = o[9]) : o[8] && (r = o[8], l = o[16]);
    else
      throw new Error("invalid DMS coordinates format");
  else if (Dt.test(i)) {
    if (o = Dt.exec(i), m = We(o), o.filter((u) => u).length <= 5)
      throw new Error("invalid coordinates format");
    if (m)
      t = Math.abs(parseInt(o[2])), o[4] && (t += o[4].replace(",", ".") / 60, d = "DM"), o[6] && (t += o[6].replace(",", ".") / 3600, d = "DMS"), parseInt(o[2]) < 0 && (t = -1 * t), n = Math.abs(parseInt(o[10])), o[12] && (n += o[12].replace(",", ".") / 60), o[14] && (n += o[14].replace(",", ".") / 3600), parseInt(o[10]) < 0 && (n = -1 * n), o[1] ? (r = o[1], l = o[9]) : o[8] && (r = o[8], l = o[16]);
    else
      throw new Error("invalid coordinates format");
  }
  if (m) {
    if (Math.abs(n) >= 180)
      throw new Error("invalid longitude value");
    if (Math.abs(t) >= 90)
      throw new Error("invalid latitude value");
    if (r && !l || !r && l)
      throw new Error("invalid coordinates value");
    if (r && r == l)
      throw new Error("invalid coordinates format");
    t.toString().includes(",") && (t = t.replace(",", ".")), n.toString().includes(",") && (n = n.replace(",", "."));
    let u = /S|SOUTH/i;
    u.test(r) && t > 0 && (t = -1 * t), u = /W|WEST/i, u.test(l) && n > 0 && (n = -1 * n);
    const f = o[0].trim();
    let v, b;
    const y = /[,/;\u0020]/g, _ = f.match(y);
    if (_ == null) {
      const E = Math.floor(i.length / 2);
      v = f.substring(0, E).trim(), b = f.substring(E).trim();
    } else {
      let E;
      _.length % 2 == 1 ? E = Math.floor(_.length / 2) : E = _.length / 2 - 1;
      let C = 0;
      if (E == 0)
        C = f.indexOf(_[0]), v = f.substring(0, C).trim(), b = f.substring(C + 1).trim();
      else {
        let M = 0, p = 0;
        for (; M <= E; )
          C = f.indexOf(_[M], p), p = C + 1, M++;
        v = f.substring(0, C).trim(), b = f.substring(C + 1).trim();
      }
    }
    const z = v.split(".");
    if (z.length == 2 && z[1] == 0 && z[1].length != 2)
      throw new Error("invalid coordinates format");
    const L = b.split(".");
    if (L.length == 2 && L[1] == 0 && L[1].length != 2)
      throw new Error("invalid coordinates format");
    if (/^\d+$/.test(v) || /^\d+$/.test(b))
      throw new Error("degree only coordinate/s provided");
    return t = Number(Number(t).toFixed(e)), n = Number(Number(n).toFixed(e)), Object.freeze({
      verbatimCoordinates: f,
      verbatimLatitude: v,
      verbatimLongitude: b,
      decimalLatitude: t,
      decimalLongitude: n,
      decimalCoordinates: `${t},${n}`,
      originalFormat: d,
      closeEnough: dn,
      toCoordinateFormat: cn
    });
  } else
    throw new Error("coordinates pattern match failed");
}
function We(i) {
  if (!isNaN(i[0]))
    return !1;
  const e = [...i];
  if (e.shift(), e.length % 2 > 0)
    return !1;
  const t = /^[-+]?\d+([\.,]\d+)?$/, n = /[eastsouthnorthwest]+/i, r = e.length / 2;
  for (let l = 0; l < r; l++) {
    const d = e[l], o = e[l + r], m = t.test(d) && t.test(o), u = n.test(d) && n.test(o), f = d == o;
    if (!(d == null && o == null)) {
      if (d == null || o == null)
        return !1;
      if (m || u || f)
        continue;
      return !1;
    }
  }
  return !0;
}
function It(i, e) {
  const t = Math.abs(i - e);
  return Number(t.toFixed(6)) <= 1e-5;
}
function dn(i) {
  if (!i)
    throw new Error("coords must be provided");
  if (i.includes(",")) {
    const e = i.split(",");
    if (Number(e[0]) == NaN || Number(e[1]) == NaN)
      throw new Error("coords are not valid decimals");
    return It(this.decimalLatitude, Number(e[0])) && It(this.decimalLongitude, e[1]);
  } else
    throw new Error("coords being tested must be separated by a comma");
}
const fn = Object.freeze({
  DMS: "DMS",
  DM: "DM",
  DD: "DD"
});
dt.to = fn;
const mn = [
  {
    verbatimCoordinates: "40.123, -74.123",
    verbatimLatitude: "40.123",
    verbatimLongitude: "-74.123"
  },
  {
    verbatimCoordinates: "40.123° N 74.123° W",
    verbatimLatitude: "40.123° N",
    verbatimLongitude: "74.123° W"
  },
  {
    verbatimCoordinates: "40.123° N 74.123° W",
    verbatimLatitude: "40.123° N",
    verbatimLongitude: "74.123° W"
  },
  {
    verbatimCoordinates: '40° 7´ 22.8" N 74° 7´ 22.8" W',
    verbatimLatitude: '40° 7´ 22.8" N',
    verbatimLongitude: '74° 7´ 22.8" W'
  },
  {
    verbatimCoordinates: "40° 7.38’ , -74° 7.38’",
    verbatimLatitude: "40° 7.38’",
    verbatimLongitude: "-74° 7.38’"
  },
  {
    verbatimCoordinates: "N40°7’22.8’’, W74°7’22.8’’",
    verbatimLatitude: "N40°7’22.8’’",
    verbatimLongitude: "W74°7’22.8’’"
  },
  {
    verbatimCoordinates: '40°7’22.8"N, 74°7’22.8"W',
    verbatimLatitude: '40°7’22.8"N',
    verbatimLongitude: '74°7’22.8"W'
  },
  {
    verbatimCoordinates: `40°7'22.8"N, 74°7'22.8"W`,
    verbatimLatitude: `40°7'22.8"N`,
    verbatimLongitude: `74°7'22.8"W`
  },
  {
    verbatimCoordinates: "40 7 22.8, -74 7 22.8",
    verbatimLatitude: "40 7 22.8",
    verbatimLongitude: "-74 7 22.8"
  },
  {
    verbatimCoordinates: "40.123 -74.123",
    verbatimLatitude: "40.123",
    verbatimLongitude: "-74.123"
  },
  {
    verbatimCoordinates: "40.123°,-74.123°",
    verbatimLatitude: "40.123°",
    verbatimLongitude: "-74.123°"
  },
  {
    verbatimCoordinates: "40.123N74.123W",
    verbatimLatitude: "40.123N",
    verbatimLongitude: "74.123W"
  },
  {
    verbatimCoordinates: "4007.38N7407.38W",
    verbatimLatitude: "4007.38N",
    verbatimLongitude: "7407.38W"
  },
  {
    verbatimCoordinates: '40°7’22.8"N, 74°7’22.8"W',
    verbatimLatitude: '40°7’22.8"N',
    verbatimLongitude: '74°7’22.8"W'
  },
  {
    verbatimCoordinates: "400722.8N740722.8W",
    verbatimLatitude: "400722.8N",
    verbatimLongitude: "740722.8W"
  },
  {
    verbatimCoordinates: "N 40 7.38 W 74 7.38",
    verbatimLatitude: "N 40 7.38",
    verbatimLongitude: "W 74 7.38"
  },
  {
    verbatimCoordinates: "40:7:22.8N 74:7:22.8W",
    verbatimLatitude: "40:7:22.8N",
    verbatimLongitude: "74:7:22.8W"
  },
  {
    verbatimCoordinates: "40:7:23N,74:7:23W",
    verbatimLatitude: "40:7:23N",
    verbatimLongitude: "74:7:23W",
    decimalLatitude: 40.1230555555,
    decimalLongitude: -74.1230555555
  },
  {
    verbatimCoordinates: '40°7’23"N 74°7’23"W',
    verbatimLatitude: '40°7’23"N',
    verbatimLongitude: '74°7’23"W',
    decimalLatitude: 40.1230555555,
    decimalLongitude: -74.12305555555555
  },
  {
    verbatimCoordinates: '40°7’23"S 74°7’23"E',
    verbatimLatitude: '40°7’23"S',
    verbatimLongitude: '74°7’23"E',
    decimalLatitude: -40.1230555555,
    decimalLongitude: 74.12305555555555
  },
  {
    verbatimCoordinates: '40°7’23" -74°7’23"',
    verbatimLatitude: '40°7’23"',
    verbatimLongitude: '-74°7’23"',
    decimalLatitude: 40.1230555555,
    decimalLongitude: -74.123055555
  },
  {
    verbatimCoordinates: '40d 7’ 23" N 74d 7’ 23" W',
    verbatimLatitude: '40d 7’ 23" N',
    verbatimLongitude: '74d 7’ 23" W',
    decimalLatitude: 40.1230555555,
    decimalLongitude: -74.123055555
  },
  {
    verbatimCoordinates: "40.123N 74.123W",
    verbatimLatitude: "40.123N",
    verbatimLongitude: "74.123W"
  },
  {
    verbatimCoordinates: "40° 7.38, -74° 7.38",
    verbatimLatitude: "40° 7.38",
    verbatimLongitude: "-74° 7.38"
  },
  {
    verbatimCoordinates: "40° 7.38, -74° 7.38",
    verbatimLatitude: "40° 7.38",
    verbatimLongitude: "-74° 7.38"
  },
  {
    verbatimCoordinates: "40 7 22.8; -74 7 22.8",
    verbatimLatitude: "40 7 22.8",
    verbatimLongitude: "-74 7 22.8"
  }
], gn = {
  decimalLatitude: 40.123,
  decimalLongitude: -74.123
}, hn = [
  {
    verbatimCoordinates: `50°4'17.698"south, 14°24'2.826"east`,
    verbatimLatitude: `50°4'17.698"south`,
    verbatimLongitude: `14°24'2.826"east`,
    decimalLatitude: -50.07158277777778,
    decimalLongitude: 14.400785
  },
  {
    verbatimCoordinates: "50d4m17.698S 14d24m2.826E",
    verbatimLatitude: "50d4m17.698S",
    verbatimLongitude: "14d24m2.826E",
    decimalLatitude: -50.07158277777778,
    decimalLongitude: 14.400785
  },
  {
    verbatimCoordinates: "40:26:46N,79:56:55W",
    verbatimLatitude: "40:26:46N",
    verbatimLongitude: "79:56:55W",
    decimalLatitude: 40.44611111111111,
    decimalLongitude: -79.9486111111111
  },
  {
    verbatimCoordinates: "40:26:46.302N 79:56:55.903W",
    verbatimLatitude: "40:26:46.302N",
    verbatimLongitude: "79:56:55.903W",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.94886194444445
  },
  {
    verbatimCoordinates: "40°26′47″N 79°58′36″W",
    verbatimLatitude: "40°26′47″N",
    verbatimLongitude: "79°58′36″W",
    decimalLatitude: 40.44638888888889,
    decimalLongitude: -79.97666666666667
  },
  {
    verbatimCoordinates: "40d 26′ 47″ N 79d 58′ 36″ W",
    verbatimLatitude: "40d 26′ 47″ N",
    verbatimLongitude: "79d 58′ 36″ W",
    decimalLatitude: 40.44638888888889,
    decimalLongitude: -79.97666666666667
  },
  {
    verbatimCoordinates: "40.446195N 79.948862W",
    verbatimLatitude: "40.446195N",
    verbatimLongitude: "79.948862W",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.948862
  },
  {
    verbatimCoordinates: "40,446195° 79,948862°",
    verbatimLatitude: "40,446195°",
    verbatimLongitude: "79,948862°",
    decimalLatitude: 40.446195,
    decimalLongitude: 79.948862
  },
  {
    verbatimCoordinates: "40° 26.7717, -79° 56.93172",
    verbatimLatitude: "40° 26.7717",
    verbatimLongitude: "-79° 56.93172",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.948862
  },
  {
    verbatimCoordinates: "40.446195, -79.948862",
    verbatimLatitude: "40.446195",
    verbatimLongitude: "-79.948862",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.948862
  },
  {
    verbatimCoordinates: "40.123256; -74.123256",
    verbatimLatitude: "40.123256",
    verbatimLongitude: "-74.123256",
    decimalLatitude: 40.123256,
    decimalLongitude: -74.123256
  },
  {
    verbatimCoordinates: "18°24S 22°45E",
    verbatimLatitude: "18°24S",
    verbatimLongitude: "22°45E",
    decimalLatitude: -18.4,
    decimalLongitude: 22.75
  }
], bn = [
  {
    verbatimCoordinates: "10.432342S 10.6345345E",
    verbatimLatitude: "10.432342S",
    verbatimLongitude: "10.6345345E",
    decimalLatitude: -10.432342,
    decimalLongitude: 10.6345345
  },
  {
    verbatimCoordinates: "10.00S 10.00E",
    verbatimLatitude: "10.00S",
    verbatimLongitude: "10.00E",
    decimalLatitude: -10,
    decimalLongitude: 10
  },
  {
    verbatimCoordinates: "00.00S 01.00E",
    verbatimLatitude: "00.00S",
    verbatimLongitude: "01.00E",
    decimalLatitude: 0,
    decimalLongitude: 1
  },
  {
    verbatimCoordinates: "18.24S 22.45E",
    verbatimLatitude: "18.24S",
    verbatimLongitude: "22.45E",
    decimalLatitude: -18.4,
    decimalLongitude: 22.75
  },
  {
    verbatimCoordinates: "27deg 15min 45.2sec S 18deg 32min 53.7sec E",
    verbatimLatitude: "27deg 15min 45.2sec S",
    verbatimLongitude: "18deg 32min 53.7sec E",
    decimalLatitude: -27.262555555555554,
    decimalLongitude: 18.54825
  },
  {
    verbatimCoordinates: "-23.3245° S / 28.2344° E",
    verbatimLatitude: "-23.3245° S",
    verbatimLongitude: "28.2344° E",
    decimalLatitude: -23.3245,
    decimalLongitude: 28.2344
  },
  {
    verbatimCoordinates: "40° 26.7717 -79° 56.93172",
    verbatimLatitude: "40° 26.7717",
    verbatimLongitude: "-79° 56.93172",
    decimalLatitude: 40.446195,
    decimalLongitude: -79.948862
  },
  {
    verbatimCoordinates: "27.15.45S 18.32.53E",
    verbatimLatitude: "27.15.45S",
    verbatimLongitude: "18.32.53E",
    decimalLatitude: -27.2625,
    decimalLongitude: 18.548055
  },
  {
    verbatimCoordinates: "-27.15.45 18.32.53",
    verbatimLatitude: "-27.15.45",
    verbatimLongitude: "18.32.53",
    decimalLatitude: -27.2625,
    decimalLongitude: 18.548055
  },
  {
    verbatimCoordinates: "27.15.45.2S 18.32.53.4E",
    verbatimLatitude: "27.15.45.2S",
    verbatimLongitude: "18.32.53.4E",
    decimalLatitude: -27.262556,
    decimalLongitude: 18.548167
  },
  {
    verbatimCoordinates: "27.15.45,2S 18.32.53,4E",
    verbatimLatitude: "27.15.45,2S",
    verbatimLongitude: "18.32.53,4E",
    decimalLatitude: -27.262556,
    decimalLongitude: 18.548167
  },
  {
    verbatimCoordinates: "S23.43563 °  E22.45634 °",
    verbatimLatitude: "S23.43563 °",
    verbatimLongitude: "E22.45634 °",
    decimalLatitude: -23.43563,
    decimalLongitude: 22.45634
  },
  {
    verbatimCoordinates: "27,71372° S 23,07771° E",
    verbatimLatitude: "27,71372° S",
    verbatimLongitude: "23,07771° E",
    decimalLatitude: -27.71372,
    decimalLongitude: 23.07771
  },
  {
    verbatimCoordinates: "27.45.34 S 23.23.23 E",
    verbatimLatitude: "27.45.34 S",
    verbatimLongitude: "23.23.23 E",
    decimalLatitude: -27.759444,
    decimalLongitude: 23.38972222
  },
  {
    verbatimCoordinates: "S 27.45.34 E 23.23.23",
    verbatimLatitude: "S 27.45.34",
    verbatimLongitude: "E 23.23.23",
    decimalLatitude: -27.759444,
    decimalLongitude: 23.38972222
  },
  {
    verbatimCoordinates: "53 16.3863,4 52.8171",
    verbatimLatitude: "53 16.3863",
    verbatimLongitude: "4 52.8171",
    decimalLatitude: 53.273105,
    decimalLongitude: 4.88029
  },
  {
    verbatimCoordinates: "50 8.2914,-5 2.4447",
    verbatimLatitude: "50 8.2914",
    verbatimLongitude: "-5 2.4447",
    decimalLatitude: 50.13819,
    decimalLongitude: -5.040745
  },
  {
    verbatimCoordinates: "N 48° 30,6410', E 18° 57,4583'",
    verbatimLatitude: "N 48° 30,6410'",
    verbatimLongitude: "E 18° 57,4583'",
    decimalLatitude: 48.51068,
    decimalLongitude: 18.95764
  },
  {
    verbatimCoordinates: "1.23456, 18.33453",
    verbatimLatitude: "1.23456",
    verbatimLongitude: "18.33453",
    decimalLatitude: 1.23456,
    decimalLongitude: 18.33453
  }
];
function vn() {
  const i = [];
  return mn.forEach((e) => {
    e.decimalLatitude ? i.push(e) : i.push({ ...e, ...gn });
  }), [...i, ...hn, ...bn];
}
const Ln = vn();
dt.formats = Ln.map((i) => i.verbatimCoordinates);
const _n = dt;
function Ut(i, e, t) {
  const n = i.slice();
  return n[87] = e[t], n[89] = t, n;
}
function At(i) {
  let e, t;
  return e = new tn({}), {
    c() {
      fe(e.$$.fragment);
    },
    m(n, r) {
      oe(e, n, r), t = !0;
    },
    i(n) {
      t || (F(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Q(e.$$.fragment, n), t = !1;
    },
    d(n) {
      se(e, n);
    }
  };
}
function Bt(i) {
  let e, t, n, r, l;
  return t = new rn({}), {
    c() {
      e = W("button"), fe(t.$$.fragment), a(e, "type", "button"), a(
        e,
        "title",
        /*reverseButtonTitle*/
        i[9]
      ), a(e, "class", "svelte-bz0zu3"), ce(
        e,
        "active",
        /*reverseActive*/
        i[0]
      );
    },
    m(d, o) {
      B(d, e, o), oe(t, e, null), n = !0, r || (l = V(
        e,
        "click",
        /*click_handler_2*/
        i[71]
      ), r = !0);
    },
    p(d, o) {
      (!n || o[0] & /*reverseButtonTitle*/
      512) && a(
        e,
        "title",
        /*reverseButtonTitle*/
        d[9]
      ), (!n || o[0] & /*reverseActive*/
      1) && ce(
        e,
        "active",
        /*reverseActive*/
        d[0]
      );
    },
    i(d) {
      n || (F(t.$$.fragment, d), n = !0);
    },
    o(d) {
      Q(t.$$.fragment, d), n = !1;
    },
    d(d) {
      d && O(e), se(t), r = !1, l();
    }
  };
}
function yn(i) {
  let e, t = [], n = /* @__PURE__ */ new Map(), r, l, d, o = Nt(
    /*listFeatures*/
    i[14]
  );
  const m = (u) => (
    /*feature*/
    u[87].id + /*feature*/
    (u[87].address ? "," + /*feature*/
    u[87].address : "")
  );
  for (let u = 0; u < o.length; u += 1) {
    let f = Ut(i, o, u), v = m(f);
    n.set(v, t[u] = Ft(v, f));
  }
  return {
    c() {
      e = W("ul");
      for (let u = 0; u < t.length; u += 1)
        t[u].c();
      a(e, "class", "options svelte-bz0zu3");
    },
    m(u, f) {
      B(u, e, f);
      for (let v = 0; v < t.length; v += 1)
        t[v] && t[v].m(e, null);
      r = !0, l || (d = [
        V(
          e,
          "mouseleave",
          /*mouseleave_handler*/
          i[75]
        ),
        V(
          e,
          "blur",
          /*blur_handler_1*/
          i[76]
        )
      ], l = !0);
    },
    p(u, f) {
      f[0] & /*listFeatures, showPlaceType, selectedItemIndex, missingIconsCache, iconsBaseUrl, pick*/
      17880064 && (o = Nt(
        /*listFeatures*/
        u[14]
      ), Ze(), t = Bi(t, f, m, 1, u, o, n, e, Ai, Ft, null, Ut), qe());
    },
    i(u) {
      if (!r) {
        for (let f = 0; f < o.length; f += 1)
          F(t[f]);
        r = !0;
      }
    },
    o(u) {
      for (let f = 0; f < t.length; f += 1)
        Q(t[f]);
      r = !1;
    },
    d(u) {
      u && O(e);
      for (let f = 0; f < t.length; f += 1)
        t[f].d();
      l = !1, ae(d);
    }
  };
}
function wn(i) {
  let e, t, n, r, l, d;
  return t = new Kt({}), {
    c() {
      e = W("div"), fe(t.$$.fragment), n = X(), r = W("div"), l = de(
        /*noResultsMessage*/
        i[7]
      ), a(r, "class", "svelte-bz0zu3"), a(e, "class", "no-results svelte-bz0zu3");
    },
    m(o, m) {
      B(o, e, m), oe(t, e, null), N(e, n), N(e, r), N(r, l), d = !0;
    },
    p(o, m) {
      (!d || m[0] & /*noResultsMessage*/
      128) && Re(
        l,
        /*noResultsMessage*/
        o[7]
      );
    },
    i(o) {
      d || (F(t.$$.fragment, o), d = !0);
    },
    o(o) {
      Q(t.$$.fragment, o), d = !1;
    },
    d(o) {
      o && O(e), se(t);
    }
  };
}
function En(i) {
  let e = "", t;
  return {
    c() {
      t = de(e);
    },
    m(n, r) {
      B(n, t, r);
    },
    p: A,
    i: A,
    o: A,
    d(n) {
      n && O(t);
    }
  };
}
function Sn(i) {
  let e, t, n, r, l, d, o, m, u, f, v;
  return t = new Kt({}), m = new Qt({}), {
    c() {
      e = W("div"), fe(t.$$.fragment), n = X(), r = W("div"), l = de(
        /*errorMessage*/
        i[6]
      ), d = X(), o = W("button"), fe(m.$$.fragment), a(r, "class", "svelte-bz0zu3"), a(o, "class", "svelte-bz0zu3"), a(e, "class", "error svelte-bz0zu3");
    },
    m(b, y) {
      B(b, e, y), oe(t, e, null), N(e, n), N(e, r), N(r, l), N(e, d), N(e, o), oe(m, o, null), u = !0, f || (v = V(
        o,
        "click",
        /*click_handler_3*/
        i[72]
      ), f = !0);
    },
    p(b, y) {
      (!u || y[0] & /*errorMessage*/
      64) && Re(
        l,
        /*errorMessage*/
        b[6]
      );
    },
    i(b) {
      u || (F(t.$$.fragment, b), F(m.$$.fragment, b), u = !0);
    },
    o(b) {
      Q(t.$$.fragment, b), Q(m.$$.fragment, b), u = !1;
    },
    d(b) {
      b && O(e), se(t), se(m), f = !1, v();
    }
  };
}
function Ft(i, e) {
  let t, n, r;
  function l() {
    return (
      /*mouseenter_handler*/
      e[73](
        /*i*/
        e[89]
      )
    );
  }
  function d() {
    return (
      /*focus_handler_1*/
      e[74](
        /*feature*/
        e[87]
      )
    );
  }
  return n = new $i({
    props: {
      feature: (
        /*feature*/
        e[87]
      ),
      showPlaceType: (
        /*showPlaceType*/
        e[10]
      ),
      selected: (
        /*selectedItemIndex*/
        e[15] === /*i*/
        e[89]
      ),
      missingIconsCache: (
        /*missingIconsCache*/
        e[20]
      ),
      iconsBaseUrl: (
        /*iconsBaseUrl*/
        e[12]
      )
    }
  }), n.$on("mouseenter", l), n.$on("focus", d), {
    key: i,
    first: null,
    c() {
      t = ki(), fe(n.$$.fragment), this.first = t;
    },
    m(o, m) {
      B(o, t, m), oe(n, o, m), r = !0;
    },
    p(o, m) {
      e = o;
      const u = {};
      m[0] & /*listFeatures*/
      16384 && (u.feature = /*feature*/
      e[87]), m[0] & /*showPlaceType*/
      1024 && (u.showPlaceType = /*showPlaceType*/
      e[10]), m[0] & /*selectedItemIndex, listFeatures*/
      49152 && (u.selected = /*selectedItemIndex*/
      e[15] === /*i*/
      e[89]), m[0] & /*iconsBaseUrl*/
      4096 && (u.iconsBaseUrl = /*iconsBaseUrl*/
      e[12]), n.$set(u);
    },
    i(o) {
      r || (F(n.$$.fragment, o), r = !0);
    },
    o(o) {
      Q(n.$$.fragment, o), r = !1;
    },
    d(o) {
      o && O(t), se(n, o);
    }
  };
}
function pn(i) {
  let e, t, n, r, l, d, o, m, u, f, v, b, y, _, z, L, E, C, M, p, H, R = !1;
  l = new sn({}), v = new Qt({});
  let c = (
    /*abortController*/
    i[19] && At()
  ), g = (
    /*enableReverse*/
    i[5] === "button" && Bt(i)
  );
  const k = (
    /*#slots*/
    i[63].default
  ), Z = Si(
    k,
    i,
    /*$$scope*/
    i[62],
    null
  ), ye = [Sn, En, wn, yn], q = [];
  function Ne(h, I) {
    var ne, me;
    return (
      /*error*/
      h[18] ? 0 : (
        /*focusedDelayed*/
        h[16] ? (
          /*listFeatures*/
          ((ne = h[14]) == null ? void 0 : ne.length) === 0 ? 2 : (
            /*focusedDelayed*/
            h[16] && /*listFeatures*/
            ((me = h[14]) != null && me.length) ? 3 : -1
          )
        ) : 1
      )
    );
  }
  return ~(L = Ne(i)) && (E = q[L] = ye[L](i)), {
    c() {
      e = X(), t = W("form"), n = W("div"), r = W("button"), fe(l.$$.fragment), d = X(), o = W("input"), m = X(), u = W("div"), f = W("button"), fe(v.$$.fragment), b = X(), c && c.c(), y = X(), g && g.c(), _ = X(), Z && Z.c(), z = X(), E && E.c(), a(r, "class", "search-button svelte-bz0zu3"), a(r, "type", "button"), a(
        o,
        "placeholder",
        /*placeholder*/
        i[8]
      ), a(
        o,
        "aria-label",
        /*placeholder*/
        i[8]
      ), a(o, "class", "svelte-bz0zu3"), a(f, "type", "button"), a(
        f,
        "title",
        /*clearButtonTitle*/
        i[3]
      ), a(f, "class", "svelte-bz0zu3"), a(u, "class", "clear-button-container svelte-bz0zu3"), ce(
        u,
        "displayable",
        /*searchValue*/
        i[1] !== ""
      ), a(n, "class", "input-group svelte-bz0zu3"), a(t, "tabindex", "0"), a(t, "class", C = Et(
        /*className*/
        i[2]
      ) + " svelte-bz0zu3"), ce(
        t,
        "can-collapse",
        /*collapsed*/
        i[4] && /*searchValue*/
        i[1] === ""
      );
    },
    m(h, I) {
      B(h, e, I), B(h, t, I), N(t, n), N(n, r), oe(l, r, null), N(n, d), N(n, o), i[65](o), St(
        o,
        /*searchValue*/
        i[1]
      ), N(n, m), N(n, u), N(u, f), oe(v, f, null), N(u, b), c && c.m(u, null), N(n, y), g && g.m(n, null), N(n, _), Z && Z.m(n, null), N(t, z), ~L && q[L].m(t, null), M = !0, p || (H = [
        V(
          r,
          "click",
          /*click_handler*/
          i[64]
        ),
        V(
          o,
          "input",
          /*input_1_input_handler*/
          i[66]
        ),
        V(
          o,
          "focus",
          /*focus_handler*/
          i[67]
        ),
        V(
          o,
          "blur",
          /*blur_handler*/
          i[68]
        ),
        V(
          o,
          "keydown",
          /*handleKeyDown*/
          i[22]
        ),
        V(
          o,
          "input",
          /*input_handler*/
          i[69]
        ),
        V(
          f,
          "click",
          /*click_handler_1*/
          i[70]
        ),
        V(t, "submit", Mi(
          /*handleSubmit*/
          i[21]
        ))
      ], p = !0);
    },
    p(h, I) {
      (!M || I[0] & /*placeholder*/
      256) && a(
        o,
        "placeholder",
        /*placeholder*/
        h[8]
      ), (!M || I[0] & /*placeholder*/
      256) && a(
        o,
        "aria-label",
        /*placeholder*/
        h[8]
      ), I[0] & /*searchValue*/
      2 && o.value !== /*searchValue*/
      h[1] && St(
        o,
        /*searchValue*/
        h[1]
      ), (!M || I[0] & /*clearButtonTitle*/
      8) && a(
        f,
        "title",
        /*clearButtonTitle*/
        h[3]
      ), /*abortController*/
      h[19] ? c ? I[0] & /*abortController*/
      524288 && F(c, 1) : (c = At(), c.c(), F(c, 1), c.m(u, null)) : c && (Ze(), Q(c, 1, 1, () => {
        c = null;
      }), qe()), (!M || I[0] & /*searchValue*/
      2) && ce(
        u,
        "displayable",
        /*searchValue*/
        h[1] !== ""
      ), /*enableReverse*/
      h[5] === "button" ? g ? (g.p(h, I), I[0] & /*enableReverse*/
      32 && F(g, 1)) : (g = Bt(h), g.c(), F(g, 1), g.m(n, _)) : g && (Ze(), Q(g, 1, 1, () => {
        g = null;
      }), qe()), Z && Z.p && (!M || I[2] & /*$$scope*/
      1) && Ti(
        Z,
        k,
        h,
        /*$$scope*/
        h[62],
        M ? pi(
          k,
          /*$$scope*/
          h[62],
          I,
          null
        ) : Ni(
          /*$$scope*/
          h[62]
        ),
        null
      );
      let ne = L;
      L = Ne(h), L === ne ? ~L && q[L].p(h, I) : (E && (Ze(), Q(q[ne], 1, 1, () => {
        q[ne] = null;
      }), qe()), ~L ? (E = q[L], E ? E.p(h, I) : (E = q[L] = ye[L](h), E.c()), F(E, 1), E.m(t, null)) : E = null), (!M || I[0] & /*className*/
      4 && C !== (C = Et(
        /*className*/
        h[2]
      ) + " svelte-bz0zu3")) && a(t, "class", C), (!M || I[0] & /*className, collapsed, searchValue*/
      22) && ce(
        t,
        "can-collapse",
        /*collapsed*/
        h[4] && /*searchValue*/
        h[1] === ""
      );
    },
    i(h) {
      M || (F(R), F(l.$$.fragment, h), F(v.$$.fragment, h), F(c), F(g), F(Z, h), F(E), M = !0);
    },
    o(h) {
      Q(R), Q(l.$$.fragment, h), Q(v.$$.fragment, h), Q(c), Q(g), Q(Z, h), Q(E), M = !1;
    },
    d(h) {
      h && (O(e), O(t)), se(l), i[65](null), se(v), c && c.d(), g && g.d(), Z && Z.d(h), ~L && q[L].d(), p = !1, ae(H);
    }
  };
}
function Tn(i, e, t) {
  let n, r, { $$slots: l = {}, $$scope: d } = e;
  const o = {
    continental_marine: 4,
    country: 4,
    major_landform: 8,
    region: 5,
    subregion: 6,
    county: 7,
    joint_municipality: 8,
    joint_submunicipality: 9,
    municipality: 10,
    municipal_district: 11,
    locality: 12,
    neighbourhood: 13,
    place: 14,
    postal_code: 14,
    road: 16,
    poi: 17,
    address: 18,
    "poi.peak": 15,
    "poi.shop": 18,
    "poi.cafe": 18,
    "poi.restaurant": 18,
    "poi.aerodrome": 13
  };
  let { class: m = void 0 } = e, { apiKey: u } = e, { bbox: f = void 0 } = e, { clearButtonTitle: v = "clear" } = e, { clearOnBlur: b = !1 } = e, { collapsed: y = !1 } = e, { country: _ = void 0 } = e, { debounceSearch: z = 200 } = e, { enableReverse: L = "never" } = e, { errorMessage: E = "Something went wrong…" } = e, { filter: C = () => !0 } = e, { flyTo: M = !0 } = e, { fuzzyMatch: p = !0 } = e, { language: H = void 0 } = e, { limit: R = void 0 } = e, { mapController: c = void 0 } = e, { minLength: g = 2 } = e, { noResultsMessage: k = "Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!" } = e, { placeholder: Z = "Search" } = e, { proximity: ye = [{ type: "server-geolocation" }] } = e, { reverseActive: q = L === "always" } = e, { reverseButtonTitle: Ne = "toggle reverse geocoding" } = e, { searchValue: h = "" } = e, { pickedResultStyle: I = "full-geometry" } = e, { showPlaceType: ne = "if-needed" } = e, { showResultsWhileTyping: me = !0 } = e, { autocompleteTimeout: Qe = void 0 } = e, { selectFirst: we = !0 } = e, { flyToSelected: Ke = !1 } = e, { markerOnSelected: Oe = !0 } = e, { types: ge = void 0 } = e, { exhaustiveReverseGeocoding: Ve = !1 } = e, { excludeTypes: Ie = !1 } = e, { zoom: Ue = o } = e, { apiUrl: xe = "https://api.maptiler.com/geocoding" } = e, { fetchParameters: Je = {} } = e, { iconsBaseUrl: mt = "https://cdn.maptiler.com/maptiler-geocoding-control/v2.0.0-rc.9/icons/" } = e, { adjustUrlQuery: Xe = () => {
  } } = e;
  function xt() {
    ee.focus();
  }
  function Jt() {
    ee.blur();
  }
  function gt(s, U = !0, j = !1) {
    t(1, h = s), U ? (t(15, D = -1), bt()) : (et(!j, j), setTimeout(() => {
      ee.focus(), ee.select();
    }));
  }
  function Xt() {
    t(14, T = void 0), t(57, w = void 0), t(15, D = -1);
  }
  function Yt() {
    t(56, P = []), t(57, w = void 0);
  }
  let Ee = !1, T, P, w, ht = "", ee, D = -1, te, Ae = [], he, le, Y, Be, Ye;
  const $t = /* @__PURE__ */ new Set(), ue = Ri();
  function ei() {
    return !!Y;
  }
  zi(() => {
    c && (c.setEventHandler(void 0), c.indicateReverse(!1), c.setSelectedMarker(-1), c.setFeatures(void 0, void 0, !1));
  });
  function bt(s) {
    if (le && (window.clearTimeout(le), le = void 0), Y) {
      window.clearTimeout(Y), t(58, Y = void 0), ke(h, { appendSpace: !0 });
      return;
    }
    if (D > -1 && T)
      t(57, w = T[D]), t(1, h = w.place_type[0] === "reverse" ? w.place_name : w.place_name.replace(/,.*/, "")), t(18, te = void 0), t(56, P = void 0), t(15, D = -1);
    else if (h) {
      const U = s || !$e(h);
      ke(h, { exact: !0 }).then(() => {
        t(56, P = T), t(57, w = void 0), U && ti();
      }).catch((j) => t(18, te = j));
    }
  }
  function $e(s) {
    try {
      return _n(s, 6);
    } catch {
      return !1;
    }
  }
  async function ke(s, { byId: U = !1, exact: j = !1, appendSpace: $ = !1 } = {}) {
    t(18, te = void 0), he == null || he.abort();
    const x = new AbortController();
    t(19, he = x);
    try {
      const S = $e(s), G = new URLSearchParams();
      if (H !== void 0 && G.set("language", Array.isArray(H) ? H.join(",") : H ?? ""), ge && G.set("types", ge.join(",")), Ie && G.set("excludeTypes", String(Ie)), f && G.set("bbox", f.map((He) => He.toFixed(6)).join(",")), _ && G.set("country", Array.isArray(_) ? _.join(",") : _), !U && !S) {
        const He = await ln(c, ye, x);
        He && G.set("proximity", He), (j || !me) && G.set("autocomplete", "false"), G.set("fuzzyMatch", String(p));
      }
      R !== void 0 && (Ve || !S || (ge == null ? void 0 : ge.length) === 1) && G.set("limit", String(R)), G.set("key", u), Xe(G);
      const Fe = xe + "/" + encodeURIComponent(S ? S.decimalLongitude + "," + S.decimalLatitude : s + ($ ? " " : "")) + ".json?" + G.toString();
      if (Fe === ht) {
        U ? (t(14, T = void 0), t(57, w = Ae[0])) : t(14, T = Ae);
        return;
      }
      ht = Fe;
      const it = await fetch(Fe, { signal: x.signal, ...Je });
      if (!it.ok)
        throw new Error(await it.text());
      const nt = await it.json();
      ue("response", { url: Fe, featureCollection: nt }), U ? (t(14, T = void 0), t(57, w = nt.features[0]), Ae = [w]) : (t(14, T = nt.features.filter(C)), S && T.unshift({
        type: "Feature",
        properties: {},
        id: "reverse_" + S.decimalLongitude + "_" + S.decimalLatitude,
        text: S.decimalLatitude + ", " + S.decimalLongitude,
        place_name: S.decimalLatitude + ", " + S.decimalLongitude,
        place_type: ["reverse"],
        center: [S.decimalLongitude, S.decimalLatitude],
        bbox: [
          S.decimalLongitude,
          S.decimalLatitude,
          S.decimalLongitude,
          S.decimalLatitude
        ],
        geometry: {
          type: "Point",
          coordinates: [S.decimalLongitude, S.decimalLatitude]
        }
      }), Ae = T, S && ee.focus());
    } catch (S) {
      if (S && typeof S == "object" && "name" in S && S.name === "AbortError")
        return;
      throw S;
    } finally {
      x === he && t(19, he = void 0);
    }
  }
  function ti() {
    var $;
    if (!(P != null && P.length) || !M)
      return;
    const s = [180, 90, -180, -90], U = !P.some((x) => !x.matching_text);
    let j;
    for (const x of P) {
      const S = Me(x);
      if (j = j === void 0 ? S : S === void 0 ? j : Math.max(j, S), U || !x.matching_text)
        for (const G of [0, 1, 2, 3])
          s[G] = Math[G < 2 ? "min" : "max"](s[G], (($ = x.bbox) == null ? void 0 : $[G]) ?? x.center[G % 2]);
    }
    c && P.length > 0 && (w && s[0] === s[2] && s[1] === s[3] ? c.flyTo(w.center, Me(w)) : c.fitBounds(Mt(s), 50, j));
  }
  function Me(s) {
    var j;
    if (!s.bbox || s.bbox[0] !== s.bbox[2] && s.bbox[1] !== s.bbox[3])
      return;
    const U = s.id.replace(/\..*/, "");
    return (Array.isArray((j = s.properties) == null ? void 0 : j.categories) ? s.properties.categories.reduce(
      ($, x) => {
        const S = Ue[U + "." + x];
        return $ === void 0 ? S : S === void 0 ? $ : Math.max($, S);
      },
      void 0
    ) : void 0) ?? Ue[U];
  }
  function ii(s) {
    t(0, q = L === "always"), t(14, T = void 0), t(57, w = void 0), t(15, D = -1), gt(s[1].toFixed(6) + ", " + an(s[0], [-180, 180], !0).toFixed(6), !1, !0);
  }
  function ni(s) {
    if (!T)
      return;
    let U = s.key === "ArrowDown" ? 1 : s.key === "ArrowUp" ? -1 : 0;
    U && (D === (we ? 0 : -1) && U === -1 && t(15, D = T.length), t(15, D += U), D >= T.length && t(15, D = -1), D < 0 && we && t(15, D = 0), s.preventDefault());
  }
  function et(s = !0, U = !1) {
    if (t(18, te = void 0), le && (window.clearTimeout(le), le = void 0), Y && (window.clearTimeout(Y), t(58, Y = void 0)), !me && !U || h.length < g) {
      t(14, T = void 0);
      return;
    }
    const j = h;
    le = window.setTimeout(
      () => {
        le = void 0, ke(j).catch(($) => t(18, te = $));
      },
      s ? z : 0
    ), h.endsWith(" ") || t(58, Y = window.setTimeout(
      () => {
        t(58, Y = void 0), ke(j, { appendSpace: !0 }).catch(($) => t(18, te = $));
      },
      Qe
    ));
  }
  function tt(s) {
    t(57, w = s), t(1, h = s.place_name), t(15, D = -1);
  }
  const ri = () => ee.focus();
  function oi(s) {
    lt[s ? "unshift" : "push"](() => {
      ee = s, t(17, ee);
    });
  }
  function si() {
    h = this.value, t(1, h), t(13, Ee), t(28, b);
  }
  const ai = () => t(13, Ee = !0), li = () => t(13, Ee = !1), ui = () => et(), ci = () => {
    t(1, h = ""), ee.focus();
  }, di = () => t(0, q = !q), fi = () => t(18, te = void 0), mi = (s) => t(15, D = s), gi = (s) => tt(s), hi = () => {
    we || t(15, D = -1);
  }, bi = () => {
  };
  return i.$$set = (s) => {
    "class" in s && t(2, m = s.class), "apiKey" in s && t(26, u = s.apiKey), "bbox" in s && t(27, f = s.bbox), "clearButtonTitle" in s && t(3, v = s.clearButtonTitle), "clearOnBlur" in s && t(28, b = s.clearOnBlur), "collapsed" in s && t(4, y = s.collapsed), "country" in s && t(29, _ = s.country), "debounceSearch" in s && t(30, z = s.debounceSearch), "enableReverse" in s && t(5, L = s.enableReverse), "errorMessage" in s && t(6, E = s.errorMessage), "filter" in s && t(31, C = s.filter), "flyTo" in s && t(32, M = s.flyTo), "fuzzyMatch" in s && t(33, p = s.fuzzyMatch), "language" in s && t(34, H = s.language), "limit" in s && t(35, R = s.limit), "mapController" in s && t(36, c = s.mapController), "minLength" in s && t(37, g = s.minLength), "noResultsMessage" in s && t(7, k = s.noResultsMessage), "placeholder" in s && t(8, Z = s.placeholder), "proximity" in s && t(38, ye = s.proximity), "reverseActive" in s && t(0, q = s.reverseActive), "reverseButtonTitle" in s && t(9, Ne = s.reverseButtonTitle), "searchValue" in s && t(1, h = s.searchValue), "pickedResultStyle" in s && t(39, I = s.pickedResultStyle), "showPlaceType" in s && t(10, ne = s.showPlaceType), "showResultsWhileTyping" in s && t(40, me = s.showResultsWhileTyping), "autocompleteTimeout" in s && t(41, Qe = s.autocompleteTimeout), "selectFirst" in s && t(11, we = s.selectFirst), "flyToSelected" in s && t(42, Ke = s.flyToSelected), "markerOnSelected" in s && t(43, Oe = s.markerOnSelected), "types" in s && t(44, ge = s.types), "exhaustiveReverseGeocoding" in s && t(45, Ve = s.exhaustiveReverseGeocoding), "excludeTypes" in s && t(46, Ie = s.excludeTypes), "zoom" in s && t(47, Ue = s.zoom), "apiUrl" in s && t(48, xe = s.apiUrl), "fetchParameters" in s && t(49, Je = s.fetchParameters), "iconsBaseUrl" in s && t(12, mt = s.iconsBaseUrl), "adjustUrlQuery" in s && t(50, Xe = s.adjustUrlQuery), "$$scope" in s && t(62, d = s.$$scope);
  }, i.$$.update = () => {
    if (i.$$.dirty[0] & /*enableReverse*/
    32 && t(0, q = L === "always"), i.$$.dirty[0] & /*focused, clearOnBlur*/
    268443648 && setTimeout(() => {
      t(16, Be = Ee), b && !Ee && t(1, h = "");
    }), i.$$.dirty[0] & /*searchValue, listFeatures*/
    16386 | i.$$.dirty[1] & /*minLength*/
    64 && h.length < g && (t(57, w = void 0), t(14, T = void 0), t(18, te = void 0), t(56, P = T)), i.$$.dirty[1] & /*pickedResultStyle, picked*/
    67109120 && I !== "marker-only" && w && !w.address && w.geometry.type === "Point" && w.place_type[0] !== "reverse" && ke(w.id, { byId: !0 }).catch((s) => t(18, te = s)), i.$$.dirty[1] & /*mapController, picked, prevIdToFly, flyTo*/
    335544354 && (c && w && w.id !== Ye && M && (!w.bbox || w.bbox[0] === w.bbox[2] && w.bbox[1] === w.bbox[3] ? c.flyTo(w.center, Me(w)) : c.fitBounds(Mt(w.bbox), 50, Me(w)), t(14, T = void 0), t(56, P = void 0), t(15, D = -1)), t(59, Ye = w == null ? void 0 : w.id)), i.$$.dirty[0] & /*selectFirst, listFeatures*/
    18432 && we && T != null && T.length && (ei() || t(15, D = 0)), i.$$.dirty[0] & /*searchValue*/
    2 && t(15, D = -1), i.$$.dirty[0] & /*listFeatures*/
    16384 | i.$$.dirty[1] & /*markedFeatures*/
    33554432 && P !== T && t(56, P = void 0), i.$$.dirty[0] & /*reverseActive, listFeatures, focusedDelayed*/
    81921 | i.$$.dirty[1] & /*mapController, markedFeatures*/
    33554464 && c && c.setEventHandler((s) => {
      switch (s.type) {
        case "mapClick":
          q && ii(s.coordinates);
          break;
        case "markerClick":
          {
            const U = T == null ? void 0 : T.find((j) => j.id === s.id);
            U && tt(U);
          }
          break;
        case "markerMouseEnter":
          P && t(15, D = Be ? (T == null ? void 0 : T.findIndex((U) => U.id === s.id)) ?? -1 : -1);
          break;
        case "markerMouseLeave":
          P && t(15, D = -1);
          break;
      }
    }), i.$$.dirty[0] & /*listFeatures, selectedItemIndex*/
    49152 && t(60, r = T == null ? void 0 : T[D]), i.$$.dirty[1] & /*mapController, selected, flyTo, flyToSelected*/
    536872994 && c && r && M && Ke && c.flyTo(r.center, Me(r)), i.$$.dirty[1] & /*pickedResultStyle*/
    256 && t(61, n = I === "full-geometry-including-polygon-center-marker"), i.$$.dirty[1] & /*markerOnSelected, mapController, showPolygonMarker*/
    1073745952 && (Oe || c == null || c.setFeatures(void 0, void 0, n)), i.$$.dirty[1] & /*mapController, markerOnSelected, markedFeatures, selected, showPolygonMarker*/
    1644171296 && c && Oe && !P && (c.setFeatures(r ? [r] : void 0, void 0, n), c.setSelectedMarker(r ? 0 : -1)), i.$$.dirty[1] & /*mapController, markedFeatures, picked, showPolygonMarker*/
    1174405152 && c && c.setFeatures(P, w, n), i.$$.dirty[0] & /*selectedItemIndex*/
    32768 | i.$$.dirty[1] & /*markedFeatures, mapController*/
    33554464 && P && c && c.setSelectedMarker(D), i.$$.dirty[1] & /*selected, autocompleteTimeoutRef*/
    671088640 && r && (window.clearTimeout(Y), t(58, Y = void 0)), i.$$.dirty[0] & /*searchValue*/
    2 | i.$$.dirty[1] & /*mapController*/
    32 && c) {
      const s = $e(h);
      c.setReverseMarker(s ? [s.decimalLongitude, s.decimalLatitude] : void 0);
    }
    i.$$.dirty[1] & /*selected*/
    536870912 && ue("select", { feature: r }), i.$$.dirty[1] & /*picked*/
    67108864 && ue("pick", { feature: w }), i.$$.dirty[0] & /*focusedDelayed, listFeatures*/
    81920 && ue("optionsvisibilitychange", {
      optionsVisible: Be && !!T
    }), i.$$.dirty[0] & /*listFeatures*/
    16384 && ue("featureslisted", { features: T }), i.$$.dirty[1] & /*markedFeatures*/
    33554432 && ue("featuresmarked", { features: P }), i.$$.dirty[0] & /*reverseActive*/
    1 && ue("reversetoggle", { reverse: q }), i.$$.dirty[0] & /*searchValue*/
    2 && ue("querychange", { query: h }), i.$$.dirty[0] & /*reverseActive*/
    1 | i.$$.dirty[1] & /*mapController*/
    32 && c && c.indicateReverse(q);
  }, [
    q,
    h,
    m,
    v,
    y,
    L,
    E,
    k,
    Z,
    Ne,
    ne,
    we,
    mt,
    Ee,
    T,
    D,
    Be,
    ee,
    te,
    he,
    $t,
    bt,
    ni,
    et,
    tt,
    o,
    u,
    f,
    b,
    _,
    z,
    C,
    M,
    p,
    H,
    R,
    c,
    g,
    ye,
    I,
    me,
    Qe,
    Ke,
    Oe,
    ge,
    Ve,
    Ie,
    Ue,
    xe,
    Je,
    Xe,
    xt,
    Jt,
    gt,
    Xt,
    Yt,
    P,
    w,
    Y,
    Ye,
    r,
    n,
    d,
    l,
    ri,
    oi,
    si,
    ai,
    li,
    ui,
    ci,
    di,
    fi,
    mi,
    gi,
    hi,
    bi
  ];
}
let Nn = class extends _e {
  constructor(e) {
    super(), Le(
      this,
      e,
      Tn,
      pn,
      ve,
      {
        ZOOM_DEFAULTS: 25,
        class: 2,
        apiKey: 26,
        bbox: 27,
        clearButtonTitle: 3,
        clearOnBlur: 28,
        collapsed: 4,
        country: 29,
        debounceSearch: 30,
        enableReverse: 5,
        errorMessage: 6,
        filter: 31,
        flyTo: 32,
        fuzzyMatch: 33,
        language: 34,
        limit: 35,
        mapController: 36,
        minLength: 37,
        noResultsMessage: 7,
        placeholder: 8,
        proximity: 38,
        reverseActive: 0,
        reverseButtonTitle: 9,
        searchValue: 1,
        pickedResultStyle: 39,
        showPlaceType: 10,
        showResultsWhileTyping: 40,
        autocompleteTimeout: 41,
        selectFirst: 11,
        flyToSelected: 42,
        markerOnSelected: 43,
        types: 44,
        exhaustiveReverseGeocoding: 45,
        excludeTypes: 46,
        zoom: 47,
        apiUrl: 48,
        fetchParameters: 49,
        iconsBaseUrl: 12,
        adjustUrlQuery: 50,
        focus: 51,
        blur: 52,
        setQuery: 53,
        clearList: 54,
        clearMap: 55
      },
      null,
      [-1, -1, -1]
    );
  }
  get ZOOM_DEFAULTS() {
    return this.$$.ctx[25];
  }
  get focus() {
    return this.$$.ctx[51];
  }
  get blur() {
    return this.$$.ctx[52];
  }
  get setQuery() {
    return this.$$.ctx[53];
  }
  get clearList() {
    return this.$$.ctx[54];
  }
  get clearMap() {
    return this.$$.ctx[55];
  }
};
const kn = new FinalizationRegistry((i) => {
  i.$destroy();
});
var J, Ge, Vt;
const ft = class ft extends EventTarget {
  constructor({ target: t, ...n }) {
    super();
    st(this, Ge);
    st(this, J);
    Lt(this, J, new Nn({
      target: t,
      props: n
    }));
    for (const r of [
      "select",
      "pick",
      "featureslisted",
      "featuresmarked",
      "response",
      "optionsvisibilitychange",
      "reversetoggle",
      "querychange"
    ])
      ie(this, J).$on(r, (l) => {
        _t(this, Ge, Vt).call(this, r, l.detail);
      });
    ie(this, J).$on("select", (r) => {
      const l = new CustomEvent(r.type, {
        detail: r.detail
      });
      this.dispatchEvent(l);
    }), kn.register(this, ie(this, J));
  }
  setOptions(t) {
    ie(this, J).$set(t);
  }
  setQuery(t, n = !0) {
    var r;
    (r = ie(this, J)) == null || r.setQuery(t, n);
  }
  clearMap() {
    var t;
    (t = ie(this, J)) == null || t.clearMap();
  }
  clearList() {
    var t;
    (t = ie(this, J)) == null || t.clearList();
  }
  focus() {
    var t;
    (t = ie(this, J)) == null || t.focus();
  }
  blur() {
    var t;
    (t = ie(this, J)) == null || t.blur();
  }
  addEventListener(t, n, r) {
    super.addEventListener(t, n, r);
  }
  removeEventListener(t, n, r) {
    super.removeEventListener(t, n, r);
  }
  dispatchEvent(t) {
    return super.dispatchEvent(t);
  }
};
J = new WeakMap(), Ge = new WeakSet(), Vt = function(t, n) {
  return yt(ft.prototype, this, "dispatchEvent").call(
    this,
    new CustomEvent(t, {
      detail: n
    })
  );
};
let Ht = ft;
export {
  Ht as GeocodingControl
};
//# sourceMappingURL=vanilla.js.map
