UNPKG

@visitscotland/component-library

Version:
731 lines 1.18 MB
import { a5 as ia, H as jv, y as $v, a6 as Zv, a7 as Zf, a8 as kt, a9 as cu, aa as pu, ab as Gf, B as or, ac as is, ad as Tr, ae as lp, z as ns, af as hu, ag as Gv, ah as Oa, ai as Gx, D as fu, A as du, aj as Wx, ak as Wf, al as Hf, am as Wv, an as Hv, F as Al, ao as Hx, ap as cp, aq as Xx, C as Kx, ar as Jx, as as Xv, at as Xf, au as Yx, _ as Pn, c as Kf, P as Qx, u as Kv, v as e0, av as t0, t as r0, m as Jv, a as Yv, V as pp, a4 as i0, h as n0, g as a0, f as o0, o as ph } from "./LoadingSpinner-D3gnH_p2.mjs"; import { ref as gl, resolveComponent as qt, createElementBlock as Bt, openBlock as ut, normalizeClass as rn, createVNode as Wt, createBlock as ji, createElementVNode as $r, createTextVNode as nn, toDisplayString as ni, withKeys as Tl, createCommentVNode as kr, renderSlot as Sr, withCtx as Nt, h as s0, render as u0, Fragment as tn, renderList as Jc } from "vue"; import { defineStore as l0, mapState as as } from "pinia"; let rs = ""; typeof window < "u" && (rs = document.currentScript); const c0 = { /** * Default configuration options. */ options: { div: "map", logo: "os-logo-maps", // os-logo-maps | os-logo-maps-white statement: "Contains OS data &copy; Crown copyright and database rights YYYY", prefix: "", suffix: "" }, /** * Add the API logo and copyright statement. */ init(m) { if (rs !== "") { this.options.div = rs.getAttribute("data-div") || this.options.div, this.options.logo = rs.getAttribute("data-logo") || this.options.logo, this.options.statement = rs.getAttribute("data-statement") || this.options.statement, this.options.prefix = rs.getAttribute("data-prefix") || this.options.prefix, this.options.suffix = rs.getAttribute("data-suffix") || this.options.suffix, m = typeof m < "u" ? m : {}, Object.assign(this.options, m); const d = document.getElementById(this.options.div); let b = "os-api-branding logo"; this.options.logo === "os-logo-maps-white" && (b = "os-api-branding logo white"); let M = this.options.statement; M = M.replace("YYYY", (/* @__PURE__ */ new Date()).getFullYear()), this.options.prefix !== "" && (M = `${this.options.prefix}<span>|</span>${M}`), this.options.suffix !== "" && (M = `${M}<span>|</span>${this.options.suffix}`), document.querySelectorAll(`#${this.options.div} .os-api-branding`).forEach((u) => u.remove()); const F = document.createElement("div"); F.className = b, d.appendChild(F); const Z = document.createElement("div"); Z.className = "os-api-branding copyright", Z.innerHTML = M, d.appendChild(Z); } } }, an = l0("map", () => { const m = gl([]), d = gl([]), b = gl(null), M = gl(null), F = gl(null); function Z(Be) { m.value.push({ id: Be.id, filters: Be.filters, places: Be.places, activePins: Be.activePins, hovered: "", activePlace: null }); } function u(Be) { m.value.forEach((Ke) => { Ke.id === Be.mapId && (Ke.hovered = Be.hoveredFeature); }); } function ne(Be) { m.value.forEach((Ke) => { Ke.id === Be.mapId && (Ke.activePlace = Be.activeFeature); }); } function G(Be) { d.value = Be; } function me(Be) { b.value = Be; } function fe(Be) { M.value = Be; } function De(Be) { return m.value.find((Ke) => Ke.id === Be); } function oe(Be) { return m.value.find((Ne) => Ne.id === Be).hovered; } function ye(Be) { return m.value.find((Ne) => Ne.id === Be).activePlace; } return { maps: m, activeSubcatFilters: d, selectedSubCategory: b, activeMarkerPos: M, activePlace: F, addMapInstance: Z, setHoveredPlace: u, setActivePlace: ne, setActiveSubcatFilters: G, setSelectedSubcat: me, setActiveMarkerPos: fe, getMapById: De, getHoveredStop: oe, getActivePlace: ye }; }); var Qv = { exports: {} }; (function(m, d) { (function(b, M) { m.exports = M(); })(ia, function() { var b, M, F; function Z(u, ne) { if (!b) b = ne; else if (!M) M = ne; else { var G = "var sharedChunk = {}; (" + b + ")(sharedChunk); (" + M + ")(sharedChunk);", me = {}; b(me), F = ne(me), typeof window < "u" && (F.workerUrl = window.URL.createObjectURL(new Blob([G], { type: "text/javascript" }))); } } return Z(["exports"], function(u) { function ne(e, t) { return e(t = { exports: {} }, t.exports), t.exports; } var G = me; function me(e, t, r, o) { this.cx = 3 * e, this.bx = 3 * (r - e) - this.cx, this.ax = 1 - this.cx - this.bx, this.cy = 3 * t, this.by = 3 * (o - t) - this.cy, this.ay = 1 - this.cy - this.by, this.p1x = e, this.p1y = o, this.p2x = r, this.p2y = o; } me.prototype.sampleCurveX = function(e) { return ((this.ax * e + this.bx) * e + this.cx) * e; }, me.prototype.sampleCurveY = function(e) { return ((this.ay * e + this.by) * e + this.cy) * e; }, me.prototype.sampleCurveDerivativeX = function(e) { return (3 * this.ax * e + 2 * this.bx) * e + this.cx; }, me.prototype.solveCurveX = function(e, t) { var r, o, l, c, h; for (t === void 0 && (t = 1e-6), l = e, h = 0; h < 8; h++) { if (c = this.sampleCurveX(l) - e, Math.abs(c) < t) return l; var v = this.sampleCurveDerivativeX(l); if (Math.abs(v) < 1e-6) break; l -= c / v; } if ((l = e) < (r = 0)) return r; if (l > (o = 1)) return o; for (; r < o; ) { if (c = this.sampleCurveX(l), Math.abs(c - e) < t) return l; e > c ? r = l : o = l, l = 0.5 * (o - r) + r; } return l; }, me.prototype.solve = function(e, t) { return this.sampleCurveY(this.solveCurveX(e, t)); }; var fe = De; function De(e, t) { this.x = e, this.y = t; } De.prototype = { clone: function() { return new De(this.x, this.y); }, add: function(e) { return this.clone()._add(e); }, sub: function(e) { return this.clone()._sub(e); }, multByPoint: function(e) { return this.clone()._multByPoint(e); }, divByPoint: function(e) { return this.clone()._divByPoint(e); }, mult: function(e) { return this.clone()._mult(e); }, div: function(e) { return this.clone()._div(e); }, rotate: function(e) { return this.clone()._rotate(e); }, rotateAround: function(e, t) { return this.clone()._rotateAround(e, t); }, matMult: function(e) { return this.clone()._matMult(e); }, unit: function() { return this.clone()._unit(); }, perp: function() { return this.clone()._perp(); }, round: function() { return this.clone()._round(); }, mag: function() { return Math.sqrt(this.x * this.x + this.y * this.y); }, equals: function(e) { return this.x === e.x && this.y === e.y; }, dist: function(e) { return Math.sqrt(this.distSqr(e)); }, distSqr: function(e) { var t = e.x - this.x, r = e.y - this.y; return t * t + r * r; }, angle: function() { return Math.atan2(this.y, this.x); }, angleTo: function(e) { return Math.atan2(this.y - e.y, this.x - e.x); }, angleWith: function(e) { return this.angleWithSep(e.x, e.y); }, angleWithSep: function(e, t) { return Math.atan2(this.x * t - this.y * e, this.x * e + this.y * t); }, _matMult: function(e) { var t = e[2] * this.x + e[3] * this.y; return this.x = e[0] * this.x + e[1] * this.y, this.y = t, this; }, _add: function(e) { return this.x += e.x, this.y += e.y, this; }, _sub: function(e) { return this.x -= e.x, this.y -= e.y, this; }, _mult: function(e) { return this.x *= e, this.y *= e, this; }, _div: function(e) { return this.x /= e, this.y /= e, this; }, _multByPoint: function(e) { return this.x *= e.x, this.y *= e.y, this; }, _divByPoint: function(e) { return this.x /= e.x, this.y /= e.y, this; }, _unit: function() { return this._div(this.mag()), this; }, _perp: function() { var e = this.y; return this.y = this.x, this.x = -e, this; }, _rotate: function(e) { var t = Math.cos(e), r = Math.sin(e), o = r * this.x + t * this.y; return this.x = t * this.x - r * this.y, this.y = o, this; }, _rotateAround: function(e, t) { var r = Math.cos(e), o = Math.sin(e), l = t.y + o * (this.x - t.x) + r * (this.y - t.y); return this.x = t.x + r * (this.x - t.x) - o * (this.y - t.y), this.y = l, this; }, _round: function() { return this.x = Math.round(this.x), this.y = Math.round(this.y), this; } }, De.convert = function(e) { return e instanceof De ? e : Array.isArray(e) ? new De(e[0], e[1]) : e; }; var oe = typeof self < "u" ? self : {}, ye = Math.pow(2, 53) - 1; function Be(e, t, r, o) { var l = new G(e, t, r, o); return function(c) { return l.solve(c); }; } var Ke = Be(0.25, 0.1, 0.25, 1); function Ne(e, t, r) { return Math.min(r, Math.max(t, e)); } function Tt(e, t, r) { var o = r - t, l = ((e - t) % o + o) % o + t; return l === t ? r : l; } function Qe(e) { for (var t = [], r = arguments.length - 1; r-- > 0; ) t[r] = arguments[r + 1]; for (var o = 0, l = t; o < l.length; o += 1) { var c = l[o]; for (var h in c) e[h] = c[h]; } return e; } var ft = 1; function Lt() { return ft++; } function Qt() { return function e(t) { return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -[1e3] + -4e3 + -8e3 + -1e11).replace(/[018]/g, e); }(); } function er(e) { return !!e && /^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e); } function dr(e, t) { e.forEach(function(r) { t[r] && (t[r] = t[r].bind(t)); }); } function Mr(e, t) { return e.indexOf(t, e.length - t.length) !== -1; } function mr(e, t, r) { var o = {}; for (var l in e) o[l] = t.call(r || this, e[l], l, e); return o; } function ai(e, t, r) { var o = {}; for (var l in e) t.call(r || this, e[l], l, e) && (o[l] = e[l]); return o; } function Ir(e) { return Array.isArray(e) ? e.map(Ir) : typeof e == "object" && e ? mr(e, Ir) : e; } var Pi = {}; function Rt(e) { Pi[e] || (typeof console < "u" && console.warn(e), Pi[e] = !0); } function zr(e, t, r) { return (r.y - e.y) * (t.x - e.x) > (t.y - e.y) * (r.x - e.x); } function Va(e) { for (var t = 0, r = 0, o = e.length, l = o - 1, c = void 0, h = void 0; r < o; l = r++) t += ((h = e[l]).x - (c = e[r]).x) * (c.y + h.y); return t; } function fi() { return typeof WorkerGlobalScope < "u" && typeof self < "u" && self instanceof WorkerGlobalScope; } function Na(e) { var t = {}; if (e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g, function(o, l, c, h) { var v = c || h; return t[l] = !v || v.toLowerCase(), ""; }), t["max-age"]) { var r = parseInt(t["max-age"], 10); isNaN(r) ? delete t["max-age"] : t["max-age"] = r; } return t; } var qa = null; function us(e) { if (qa == null) { var t = e.navigator ? e.navigator.userAgent : null; qa = !!e.safari || !(!t || !(/\b(iPad|iPhone|iPod)\b/.test(t) || t.match("Safari") && !t.match("Chrome"))); } return qa; } function Cn(e) { try { var t = oe[e]; return t.setItem("_mapbox_test_", 1), t.removeItem("_mapbox_test_"), !0; } catch { return !1; } } var $i, on, na, aa, kn = oe.performance && oe.performance.now ? oe.performance.now.bind(oe.performance) : Date.now.bind(Date), xu = oe.requestAnimationFrame || oe.mozRequestAnimationFrame || oe.webkitRequestAnimationFrame || oe.msRequestAnimationFrame, Hr = oe.cancelAnimationFrame || oe.mozCancelAnimationFrame || oe.webkitCancelAnimationFrame || oe.msCancelAnimationFrame, vn = { now: kn, frame: function(e) { var t = xu(e); return { cancel: function() { return Hr(t); } }; }, getImageData: function(e, t) { t === void 0 && (t = 0); var r = oe.document.createElement("canvas"), o = r.getContext("2d"); if (!o) throw new Error("failed to create canvas 2d context"); return r.width = e.width, r.height = e.height, o.drawImage(e, 0, 0, e.width, e.height), o.getImageData(-t, -t, e.width + 2 * t, e.height + 2 * t); }, resolveURL: function(e) { return $i || ($i = oe.document.createElement("a")), $i.href = e, $i.href; }, hardwareConcurrency: oe.navigator && oe.navigator.hardwareConcurrency || 4, get devicePixelRatio() { return oe.devicePixelRatio; }, get prefersReducedMotion() { return !!oe.matchMedia && (on == null && (on = oe.matchMedia("(prefers-reduced-motion: reduce)")), on.matches); } }, Ft = { API_URL: "https://api.mapbox.com", get EVENTS_URL() { return this.API_URL ? this.API_URL.indexOf("https://api.mapbox.cn") === 0 ? "https://events.mapbox.cn/events/v2" : this.API_URL.indexOf("https://api.mapbox.com") === 0 ? "https://events.mapbox.com/events/v2" : null : null; }, FEEDBACK_URL: "https://apps.mapbox.com/feedback", REQUIRE_ACCESS_TOKEN: !0, ACCESS_TOKEN: null, MAX_PARALLEL_IMAGE_REQUESTS: 16 }, sn = { supported: !1, testSupport: function(e) { !ja && aa && (Zi ? mt(e) : na = e); } }, ja = !1, Zi = !1; function mt(e) { var t = e.createTexture(); e.bindTexture(e.TEXTURE_2D, t); try { if (e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, e.RGBA, e.UNSIGNED_BYTE, aa), e.isContextLost()) return; sn.supported = !0; } catch { } e.deleteTexture(t), ja = !0; } oe.document && ((aa = oe.document.createElement("img")).onload = function() { na && mt(na), na = null, Zi = !0; }, aa.onerror = function() { ja = !0, na = null; }, aa.src = "data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="); var Mn = "01", oi = function(e, t) { this._transformRequestFn = e, this._customAccessToken = t, this._createSkuToken(); }; function Ci(e) { return e.indexOf("mapbox:") === 0; } oi.prototype._createSkuToken = function() { var e = function() { for (var t = "", r = 0; r < 10; r++) t += "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62 * Math.random())]; return { token: ["1", Mn, t].join(""), tokenExpiresAt: Date.now() + 432e5 }; }(); this._skuToken = e.token, this._skuTokenExpiresAt = e.tokenExpiresAt; }, oi.prototype._isSkuTokenExpired = function() { return Date.now() > this._skuTokenExpiresAt; }, oi.prototype.transformRequest = function(e, t) { return this._transformRequestFn && this._transformRequestFn(e, t) || { url: e }; }, oi.prototype.normalizeStyleURL = function(e, t) { if (!Ci(e)) return e; var r = ki(e); return r.path = "/styles/v1" + r.path, this._makeAPIURL(r, this._customAccessToken || t); }, oi.prototype.normalizeGlyphsURL = function(e, t) { if (!Ci(e)) return e; var r = ki(e); return r.path = "/fonts/v1" + r.path, this._makeAPIURL(r, this._customAccessToken || t); }, oi.prototype.normalizeSourceURL = function(e, t) { if (!Ci(e)) return e; var r = ki(e); return r.path = "/v4/" + r.authority + ".json", r.params.push("secure"), this._makeAPIURL(r, this._customAccessToken || t); }, oi.prototype.normalizeSpriteURL = function(e, t, r, o) { var l = ki(e); return Ci(e) ? (l.path = "/styles/v1" + l.path + "/sprite" + t + r, this._makeAPIURL(l, this._customAccessToken || o)) : (l.path += "" + t + r, oa(l)); }, oi.prototype.normalizeTileURL = function(e, t) { if (this._isSkuTokenExpired() && this._createSkuToken(), e && !Ci(e)) return e; var r = ki(e); r.path = r.path.replace(/(\.(png|jpg)\d*)(?=$)/, (vn.devicePixelRatio >= 2 || t === 512 ? "@2x" : "") + (sn.supported ? ".webp" : "$1")), r.path = r.path.replace(/^.+\/v4\//, "/"), r.path = "/v4" + r.path; var o = this._customAccessToken || function(l) { for (var c = 0, h = l; c < h.length; c += 1) { var v = h[c].match(/^access_token=(.*)$/); if (v) return v[1]; } return null; }(r.params) || Ft.ACCESS_TOKEN; return Ft.REQUIRE_ACCESS_TOKEN && o && this._skuToken && r.params.push("sku=" + this._skuToken), this._makeAPIURL(r, o); }, oi.prototype.canonicalizeTileURL = function(e, t) { var r = ki(e); if (!r.path.match(/(^\/v4\/)/) || !r.path.match(/\.[\w]+$/)) return e; var o = "mapbox://tiles/"; o += r.path.replace("/v4/", ""); var l = r.params; return t && (l = l.filter(function(c) { return !c.match(/^access_token=/); })), l.length && (o += "?" + l.join("&")), o; }, oi.prototype.canonicalizeTileset = function(e, t) { for (var r = !!t && Ci(t), o = [], l = 0, c = e.tiles || []; l < c.length; l += 1) { var h = c[l]; Gi(h) ? o.push(this.canonicalizeTileURL(h, r)) : o.push(h); } return o; }, oi.prototype._makeAPIURL = function(e, t) { var r = "See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes", o = ki(Ft.API_URL); if (e.protocol = o.protocol, e.authority = o.authority, e.protocol === "http") { var l = e.params.indexOf("secure"); l >= 0 && e.params.splice(l, 1); } if (o.path !== "/" && (e.path = "" + o.path + e.path), !Ft.REQUIRE_ACCESS_TOKEN) return oa(e); if (!(t = t || Ft.ACCESS_TOKEN)) throw new Error("An API access token is required to use Mapbox GL. " + r); if (t[0] === "s") throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). " + r); return e.params = e.params.filter(function(c) { return c.indexOf("access_token") === -1; }), e.params.push("access_token=" + t), oa(e); }; var bu = /^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i; function Gi(e) { return bu.test(e); } var vo = /^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/; function ki(e) { var t = e.match(vo); if (!t) throw new Error("Unable to parse URL object"); return { protocol: t[1], authority: t[2], path: t[3] || "/", params: t[4] ? t[4].split("&") : [] }; } function oa(e) { var t = e.params.length ? "?" + e.params.join("&") : ""; return e.protocol + "://" + e.authority + e.path + t; } function $a(e) { if (!e) return null; var t = e.split("."); if (!t || t.length !== 3) return null; try { return JSON.parse(decodeURIComponent(oe.atob(t[1]).split("").map(function(r) { return "%" + ("00" + r.charCodeAt(0).toString(16)).slice(-2); }).join(""))); } catch { return null; } } var Mi = function(e) { this.type = e, this.anonId = null, this.eventData = {}, this.queue = [], this.pendingRequest = null; }; Mi.prototype.getStorageKey = function(e) { var t, r = $a(Ft.ACCESS_TOKEN); return t = r && r.u ? oe.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g, function(o, l) { return String.fromCharCode(+("0x" + l)); })) : Ft.ACCESS_TOKEN || "", e ? "mapbox.eventData." + e + ":" + t : "mapbox.eventData:" + t; }, Mi.prototype.fetchEventData = function() { var e = Cn("localStorage"), t = this.getStorageKey(), r = this.getStorageKey("uuid"); if (e) try { var o = oe.localStorage.getItem(t); o && (this.eventData = JSON.parse(o)); var l = oe.localStorage.getItem(r); l && (this.anonId = l); } catch { Rt("Unable to read from LocalStorage"); } }, Mi.prototype.saveEventData = function() { var e = Cn("localStorage"), t = this.getStorageKey(), r = this.getStorageKey("uuid"); if (e) try { oe.localStorage.setItem(r, this.anonId), Object.keys(this.eventData).length >= 1 && oe.localStorage.setItem(t, JSON.stringify(this.eventData)); } catch { Rt("Unable to write to LocalStorage"); } }, Mi.prototype.processRequests = function(e) { }, Mi.prototype.postEvent = function(e, t, r, o) { var l = this; if (Ft.EVENTS_URL) { var c = ki(Ft.EVENTS_URL); c.params.push("access_token=" + (o || Ft.ACCESS_TOKEN || "")); var h = { event: this.type, created: new Date(e).toISOString(), sdkIdentifier: "mapbox-gl-js", sdkVersion: "1.13.3", skuId: Mn, userId: this.anonId }, v = t ? Qe(h, t) : h, _ = { url: oa(c), headers: { "Content-Type": "text/plain" }, body: JSON.stringify([v]) }; this.pendingRequest = sr(_, function(x) { l.pendingRequest = null, r(x), l.saveEventData(), l.processRequests(o); }); } }, Mi.prototype.queueRequest = function(e, t) { this.queue.push(e), this.processRequests(t); }; var zi, sa, Wi = function(e) { function t() { e.call(this, "map.load"), this.success = {}, this.skuToken = ""; } return e && (t.__proto__ = e), (t.prototype = Object.create(e && e.prototype)).constructor = t, t.prototype.postMapLoadEvent = function(r, o, l, c) { this.skuToken = l; var h = !(!c && !Ft.ACCESS_TOKEN), v = Array.isArray(r) && r.some(function(_) { return Ci(_) || Gi(_); }); Ft.EVENTS_URL && h && v && this.queueRequest({ id: o, timestamp: Date.now() }, c); }, t.prototype.processRequests = function(r) { var o = this; if (!this.pendingRequest && this.queue.length !== 0) { var l = this.queue.shift(), c = l.id, h = l.timestamp; c && this.success[c] || (this.anonId || this.fetchEventData(), er(this.anonId) || (this.anonId = Qt()), this.postEvent(h, { skuToken: this.skuToken }, function(v) { v || c && (o.success[c] = !0); }, r)); } }, t; }(Mi), ls = new (function(e) { function t(r) { e.call(this, "appUserTurnstile"), this._customAccessToken = r; } return e && (t.__proto__ = e), (t.prototype = Object.create(e && e.prototype)).constructor = t, t.prototype.postTurnstileEvent = function(r, o) { Ft.EVENTS_URL && Ft.ACCESS_TOKEN && Array.isArray(r) && r.some(function(l) { return Ci(l) || Gi(l); }) && this.queueRequest(Date.now(), o); }, t.prototype.processRequests = function(r) { var o = this; if (!this.pendingRequest && this.queue.length !== 0) { this.anonId && this.eventData.lastSuccess && this.eventData.tokenU || this.fetchEventData(); var l = $a(Ft.ACCESS_TOKEN), c = l ? l.u : Ft.ACCESS_TOKEN, h = c !== this.eventData.tokenU; er(this.anonId) || (this.anonId = Qt(), h = !0); var v = this.queue.shift(); if (this.eventData.lastSuccess) { var _ = new Date(this.eventData.lastSuccess), x = new Date(v), S = (v - this.eventData.lastSuccess) / 864e5; h = h || S >= 1 || S < -1 || _.getDate() !== x.getDate(); } else h = !0; if (!h) return this.processRequests(); this.postEvent(v, { "enabled.telemetry": !1 }, function(T) { T || (o.eventData.lastSuccess = v, o.eventData.tokenU = c); }, r); } }, t; }(Mi))(), cs = ls.postTurnstileEvent.bind(ls), go = new Wi(), _o = go.postMapLoadEvent.bind(go), Za = 500, ps = 50; function Ga() { oe.caches && !zi && (zi = oe.caches.open("mapbox-tiles")); } function xo(e) { var t = e.indexOf("?"); return t < 0 ? e : e.slice(0, t); } var ua, bo = 1 / 0; function wo() { return ua == null && (ua = oe.OffscreenCanvas && new oe.OffscreenCanvas(1, 1).getContext("2d") && typeof oe.createImageBitmap == "function"), ua; } var hs = { Unknown: "Unknown", Style: "Style", Source: "Source", Tile: "Tile", Glyphs: "Glyphs", SpriteImage: "SpriteImage", SpriteJSON: "SpriteJSON", Image: "Image" }; typeof Object.freeze == "function" && Object.freeze(hs); var fs = function(e) { function t(r, o, l) { o === 401 && Gi(l) && (r += ": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"), e.call(this, r), this.status = o, this.url = l, this.name = this.constructor.name, this.message = r; } return e && (t.__proto__ = e), (t.prototype = Object.create(e && e.prototype)).constructor = t, t.prototype.toString = function() { return this.name + ": " + this.message + " (" + this.status + "): " + this.url; }, t; }(Error), la = fi() ? function() { return self.worker && self.worker.referrer; } : function() { return (oe.location.protocol === "blob:" ? oe.parent : oe).location.href; }, gn, _n, Wa = function(e, t) { if (!(/^file:/.test(r = e.url) || /^file:/.test(la()) && !/^\w+:/.test(r))) { if (oe.fetch && oe.Request && oe.AbortController && oe.Request.prototype.hasOwnProperty("signal")) return function(o, l) { var c, h = new oe.AbortController(), v = new oe.Request(o.url, { method: o.method || "GET", body: o.body, credentials: o.credentials, headers: o.headers, referrer: la(), signal: h.signal }), _ = !1, x = !1, S = (c = v.url).indexOf("sku=") > 0 && Gi(c); o.type === "json" && v.headers.set("Accept", "application/json"); var T = function(k, U, V) { if (!x) { if (k && k.message !== "SecurityError" && Rt(k), U && V) return E(U); var K = Date.now(); oe.fetch(v).then(function(W) { if (W.ok) { var ee = S ? W.clone() : null; return E(W, ee, K); } return l(new fs(W.statusText, W.status, o.url)); }).catch(function(W) { W.code !== 20 && l(new Error(W.message)); }); } }, E = function(k, U, V) { (o.type === "arrayBuffer" ? k.arrayBuffer() : o.type === "json" ? k.json() : k.text()).then(function(K) { x || (U && V && function(W, ee, ie) { if (Ga(), zi) { var ae = { status: ee.status, statusText: ee.statusText, headers: new oe.Headers() }; ee.headers.forEach(function(de, be) { return ae.headers.set(be, de); }); var ue = Na(ee.headers.get("Cache-Control") || ""); ue["no-store"] || (ue["max-age"] && ae.headers.set("Expires", new Date(ie + 1e3 * ue["max-age"]).toUTCString()), new Date(ae.headers.get("Expires")).getTime() - ie < 42e4 || function(de, be) { if (sa === void 0) try { new Response(new ReadableStream()), sa = !0; } catch { sa = !1; } sa ? be(de.body) : de.blob().then(be); }(ee, function(de) { var be = new oe.Response(de, ae); Ga(), zi && zi.then(function(Te) { return Te.put(xo(W.url), be); }).catch(function(Te) { return Rt(Te.message); }); })); } }(v, U, V), _ = !0, l(null, K, k.headers.get("Cache-Control"), k.headers.get("Expires"))); }).catch(function(K) { x || l(new Error(K.message)); }); }; return S ? function(k, U) { if (Ga(), !zi) return U(null); var V = xo(k.url); zi.then(function(K) { K.match(V).then(function(W) { var ee = function(ie) { if (!ie) return !1; var ae = new Date(ie.headers.get("Expires") || 0), ue = Na(ie.headers.get("Cache-Control") || ""); return ae > Date.now() && !ue["no-cache"]; }(W); K.delete(V), ee && K.put(V, W.clone()), U(null, W, ee); }).catch(U); }).catch(U); }(v, T) : T(null, null), { cancel: function() { x = !0, _ || h.abort(); } }; }(e, t); if (fi() && self.worker && self.worker.actor) return self.worker.actor.send("getResource", e, t, void 0, !0); } var r; return function(o, l) { var c = new oe.XMLHttpRequest(); for (var h in c.open(o.method || "GET", o.url, !0), o.type === "arrayBuffer" && (c.responseType = "arraybuffer"), o.headers) c.setRequestHeader(h, o.headers[h]); return o.type === "json" && (c.responseType = "text", c.setRequestHeader("Accept", "application/json")), c.withCredentials = o.credentials === "include", c.onerror = function() { l(new Error(c.statusText)); }, c.onload = function() { if ((c.status >= 200 && c.status < 300 || c.status === 0) && c.response !== null) { var v = c.response; if (o.type === "json") try { v = JSON.parse(c.response); } catch (_) { return l(_); } l(null, v, c.getResponseHeader("Cache-Control"), c.getResponseHeader("Expires")); } else l(new fs(c.statusText, c.status, o.url)); }, c.send(o.body), { cancel: function() { return c.abort(); } }; }(e, t); }, So = function(e, t) { return Wa(Qe(e, { type: "arrayBuffer" }), t); }, sr = function(e, t) { return Wa(Qe(e, { method: "POST" }), t); }, I = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="; gn = [], _n = 0; var P = function(e, t) { if (sn.supported && (e.headers || (e.headers = {}), e.headers.accept = "image/webp,*/*"), _n >= Ft.MAX_PARALLEL_IMAGE_REQUESTS) { var r = { requestParameters: e, callback: t, cancelled: !1, cancel: function() { this.cancelled = !0; } }; return gn.push(r), r; } _n++; var o = !1, l = function() { if (!o) for (o = !0, _n--; gn.length && _n < Ft.MAX_PARALLEL_IMAGE_REQUESTS; ) { var h = gn.shift(); h.cancelled || (h.cancel = P(h.requestParameters, h.callback).cancel); } }, c = So(e, function(h, v, _, x) { l(), h ? t(h) : v && (wo() ? function(S, T) { var E = new oe.Blob([new Uint8Array(S)], { type: "image/png" }); oe.createImageBitmap(E).then(function(k) { T(null, k); }).catch(function(k) { T(new Error("Could not load image because of " + k.message + ". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")); }); }(v, t) : function(S, T, E, k) { var U = new oe.Image(), V = oe.URL; U.onload = function() { T(null, U), V.revokeObjectURL(U.src), U.onload = null, oe.requestAnimationFrame(function() { U.src = I; }); }, U.onerror = function() { return T(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")); }; var K = new oe.Blob([new Uint8Array(S)], { type: "image/png" }); U.cacheControl = E, U.expires = k, U.src = S.byteLength ? V.createObjectURL(K) : I; }(v, t, _, x)); }); return { cancel: function() { c.cancel(), l(); } }; }; function C(e, t, r) { r[e] && r[e].indexOf(t) !== -1 || (r[e] = r[e] || [], r[e].push(t)); } function R(e, t, r) { if (r && r[e]) { var o = r[e].indexOf(t); o !== -1 && r[e].splice(o, 1); } } var q = function(e, t) { t === void 0 && (t = {}), Qe(this, t), this.type = e; }, J = function(e) { function t(r, o) { o === void 0 && (o = {}), e.call(this, "error", Qe({ error: r }, o)); } return e && (t.__proto__ = e), (t.prototype = Object.create(e && e.prototype)).constructor = t, t; }(q), Q = function() { }; Q.prototype.on = function(e, t) { return this._listeners = this._listeners || {}, C(e, t, this._listeners), this; }, Q.prototype.off = function(e, t) { return R(e, t, this._listeners), R(e, t, this._oneTimeListeners), this; }, Q.prototype.once = function(e, t) { return this._oneTimeListeners = this._oneTimeListeners || {}, C(e, t, this._oneTimeListeners), this; }, Q.prototype.fire = function(e, t) { typeof e == "string" && (e = new q(e, t || {})); var r = e.type; if (this.listens(r)) { e.target = this; for (var o = 0, l = this._listeners && this._listeners[r] ? this._listeners[r].slice() : []; o < l.length; o += 1) l[o].call(this, e); for (var c = 0, h = this._oneTimeListeners && this._oneTimeListeners[r] ? this._oneTimeListeners[r].slice() : []; c < h.length; c += 1) { var v = h[c]; R(r, v, this._oneTimeListeners), v.call(this, e); } var _ = this._eventedParent; _ && (Qe(e, typeof this._eventedParentData == "function" ? this._eventedParentData() : this._eventedParentData), _.fire(e)); } else e instanceof J && console.error(e.error); return this; }, Q.prototype.listens = function(e) { return this._listeners && this._listeners[e] && this._listeners[e].length > 0 || this._oneTimeListeners && this._oneTimeListeners[e] && this._oneTimeListeners[e].length > 0 || this._eventedParent && this._eventedParent.listens(e); }, Q.prototype.setEventedParent = function(e, t) { return this._eventedParent = e, this._eventedParentData = t, this; }; var D = { $version: 8, $root: { version: { required: !0, type: "enum", values: [8] }, name: { type: "string" }, metadata: { type: "*" }, center: { type: "array", value: "number" }, zoom: { type: "number" }, bearing: { type: "number", default: 0, period: 360, units: "degrees" }, pitch: { type: "number", default: 0, units: "degrees" }, light: { type: "light" }, sources: { required: !0, type: "sources" }, sprite: { type: "string" }, glyphs: { type: "string" }, transition: { type: "transition" }, layers: { required: !0, type: "array", value: "layer" } }, sources: { "*": { type: "source" } }, source: ["source_vector", "source_raster", "source_raster_dem", "source_geojson", "source_video", "source_image"], source_vector: { type: { required: !0, type: "enum", values: { vector: {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, scheme: { type: "enum", values: { xyz: {}, tms: {} }, default: "xyz" }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, attribution: { type: "string" }, promoteId: { type: "promoteId" }, volatile: { type: "boolean", default: !1 }, "*": { type: "*" } }, source_raster: { type: { required: !0, type: "enum", values: { raster: {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, tileSize: { type: "number", default: 512, units: "pixels" }, scheme: { type: "enum", values: { xyz: {}, tms: {} }, default: "xyz" }, attribution: { type: "string" }, volatile: { type: "boolean", default: !1 }, "*": { type: "*" } }, source_raster_dem: { type: { required: !0, type: "enum", values: { "raster-dem": {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, tileSize: { type: "number", default: 512, units: "pixels" }, attribution: { type: "string" }, encoding: { type: "enum", values: { terrarium: {}, mapbox: {} }, default: "mapbox" }, volatile: { type: "boolean", default: !1 }, "*": { type: "*" } }, source_geojson: { type: { required: !0, type: "enum", values: { geojson: {} } }, data: { type: "*" }, maxzoom: { type: "number", default: 18 }, attribution: { type: "string" }, buffer: { type: "number", default: 128, maximum: 512, minimum: 0 }, filter: { type: "*" }, tolerance: { type: "number", default: 0.375 }, cluster: { type: "boolean", default: !1 }, clusterRadius: { type: "number", default: 50, minimum: 0 }, clusterMaxZoom: { type: "number" }, clusterMinPoints: { type: "number" }, clusterProperties: { type: "*" }, lineMetrics: { type: "boolean", default: !1 }, generateId: { type: "boolean", default: !1 }, promoteId: { type: "promoteId" } }, source_video: { type: { required: !0, type: "enum", values: { video: {} } }, urls: { required: !0, type: "array", value: "string" }, coordinates: { required: !0, type: "array", length: 4, value: { type: "array", length: 2, value: "number" } } }, source_image: { type: { required: !0, type: "enum", values: { image: {} } }, url: { required: !0, type: "string" }, coordinates: { required: !0, type: "array", length: 4, value: { type: "array", length: 2, value: "number" } } }, layer: { id: { type: "string", required: !0 }, type: { type: "enum", values: { fill: {}, line: {}, symbol: {}, circle: {}, heatmap: {}, "fill-extrusion": {}, raster: {}, hillshade: {}, background: {} }, required: !0 }, metadata: { type: "*" }, source: { type: "string" }, "source-layer": { type: "string" }, minzoom: { type: "number", minimum: 0, maximum: 24 }, maxzoom: { type: "number", minimum: 0, maximum: 24 }, filter: { type: "filter" }, layout: { type: "layout" }, paint: { type: "paint" } }, layout: ["layout_fill", "layout_line", "layout_circle", "layout_heatmap", "layout_fill-extrusion", "layout_symbol", "layout_raster", "layout_hillshade", "layout_background"], layout_background: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_fill: { "fill-sort-key": { type: "number", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_circle: { "circle-sort-key": { type: "number", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_heatmap: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, "layout_fill-extrusion": { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_line: { "line-cap": { type: "enum", values: { butt: {}, round: {}, square: {} }, default: "butt", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-join": { type: "enum", values: { bevel: {}, round: {}, miter: {} }, default: "miter", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "line-miter-limit": { type: "number", default: 2, requires: [{ "line-join": "miter" }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-round-limit": { type: "number", default: 1.05, requires: [{ "line-join": "round" }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-sort-key": { type: "number", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_symbol: { "symbol-placement": { type: "enum", values: { point: {}, line: {}, "line-center": {} }, default: "point", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-spacing": { type: "number", default: 250, minimum: 1, units: "pixels", requires: [{ "symbol-placement": "line" }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-avoid-edges": { type: "boolean", default: !1, expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-sort-key": { type: "number", expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "symbol-z-order": { type: "enum", values: { auto: {}, "viewport-y": {}, source: {} }, default: "auto", expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-allow-overlap": { type: "boolean", default: !1, requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-ignore-placement": { type: "boolean", default: !1, requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-optional": { type: "boolean", default: !1, requires: ["icon-image", "text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-rotation-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-size": { type: "number", default: 1, minimum: 0, units: "factor of the original icon size", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-text-fit": { type: "enum", values: { none: {}, width: {}, height: {}, both: {} }, default: "none", requires: ["icon-image", "text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-text-fit-padding": { type: "array", value: "number", length: 4, default: [0, 0, 0, 0], units: "pixels", requires: ["icon-image", "text-field", { "icon-text-fit": ["both", "width", "height"] }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-image": { type: "resolvedImage", tokens: !0, expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-rotate": { type: "number", default: 0, period: 360, units: "degrees", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-padding": { type: "number", default: 2, minimum: 0, units: "pixels", requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-keep-upright": { type: "boolean", default: !1, requires: ["icon-image", { "icon-rotation-alignment": "map" }, { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-offset": { type: "array", value: "number", length: 2, default: [0, 0], requires: ["icon-image"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-anchor": { type: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, default: "center", requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-pitch-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["icon-image"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-pitch-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-rotation-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-field": { type: "formatted", default: "", tokens: !0, expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-font": { type: "array", value: "string", default: ["Open Sans Regular", "Arial Unicode MS Regular"], requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-size": { type: "number", default: 16, minimum: 0, units: "pixels", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-max-width": { type: "number", default: 10, minimum: 0, units: "ems", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-line-height": { type: "number", default: 1.2, units: "ems", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-letter-spacing": { type: "number", default: 0, units: "ems", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-justify": { type: "enum", values: { auto: {}, left: {}, center: {}, right: {} }, default: "center", requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-radial-offset": { type: "number", units: "ems", default: 0, requires: ["text-field"], "property-type": "data-driven", expression: { interpolated: !0, parameters: ["zoom", "feature"] } }, "text-variable-anchor": { type: "array", value: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, requires: ["text-field", { "symbol-placement": ["point"] }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-anchor": { type: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, default: "center", requires: ["text-field", { "!": "text-variable-anchor" }], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-max-angle": { type: "number", default: 45, units: "degrees", requires: ["text-field", { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-writing-mode": { type: "array", value: "enum", values: { horizontal: {}, vertical: {} }, requires: ["text-field", { "symbol-placement": ["point"] }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-rotate": { type: "number", default: 0, period: 360, units: "degrees", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-padding": { type: "number", default: 2, minimum: 0, units: "pixels", requires: ["text-field"], expression: { interpolated: !0, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-keep-upright": { type: "boolean", default: !0, requires: ["text-field", { "text-rotation-alignment": "map" }, { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-transform": { type: "enum", values: { none: {}, uppercase: {}, lowercase: {} }, default: "none", requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-offset": { type: "array", value: "number", units: "ems", length: 2, default: [0, 0], requires: ["text-field", { "!": "text-radial-offset" }], expression: { interpolated: !0, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-allow-overlap": { type: "boolean", default: !1, requires: ["text-field"], expression: { interpolated: !1, parameters: ["zoom"] }, "property-type":