@maptiler/geocoding-control 2.1.3-rc1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/leaflet.js +914 -931
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +13 -13
- package/leaflet.umd.js.map +1 -1
- package/maplibregl.js +911 -928
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +13 -13
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +912 -929
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +13 -13
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers.js +932 -949
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +13 -13
- package/openlayers.umd.js.map +1 -1
- package/package.json +1 -1
- package/react.js +642 -659
- package/react.js.map +1 -1
- package/react.umd.js +13 -13
- package/react.umd.js.map +1 -1
- package/svelte/FeatureItem.svelte +1 -1
- package/svelte/GeocodingControl.svelte +17 -45
- package/svelte/GeocodingControl.svelte.d.ts +0 -1
- package/svelte/info.json +1 -1
- package/svelte/types.d.ts +0 -1
- package/types.d.ts +0 -1
- package/vanilla.js +770 -787
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +12 -12
- package/vanilla.umd.js.map +1 -1
package/vanilla.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vanilla.js","sources":["../node_modules/svelte/src/runtime/internal/utils.js","../node_modules/svelte/src/runtime/internal/dom.js","../node_modules/svelte/src/runtime/internal/lifecycle.js","../node_modules/svelte/src/runtime/internal/scheduler.js","../node_modules/svelte/src/runtime/internal/transitions.js","../node_modules/svelte/src/runtime/internal/each.js","../node_modules/svelte/src/runtime/internal/Component.js","../node_modules/svelte/src/shared/version.js","../node_modules/svelte/src/runtime/internal/disclose-version/index.js","../src/ClearIcon.svelte","../src/FailIcon.svelte","../src/FeatureItem.svelte","../src/LoadingIcon.svelte","../src/ReverseGeocodingIcon.svelte","../src/SearchIcon.svelte","../src/geoUtils.ts","../src/proximity.ts","../node_modules/geo-coordinates-parser/dist/mjs/regex.js","../node_modules/geo-coordinates-parser/dist/mjs/toCoordinateFormat.js","../node_modules/geo-coordinates-parser/dist/mjs/converter.js","../node_modules/geo-coordinates-parser/dist/mjs/tests/testformats.js","../node_modules/geo-coordinates-parser/dist/mjs/merge.js","../src/GeocodingControl.svelte","../src/vanilla.ts"],"sourcesContent":["/** @returns {void} */\nexport function noop() {}\n\nexport const identity = (x) => x;\n\n/**\n * @template T\n * @template S\n * @param {T} tar\n * @param {S} src\n * @returns {T & S}\n */\nexport function assign(tar, src) {\n\t// @ts-ignore\n\tfor (const k in src) tar[k] = src[k];\n\treturn /** @type {T & S} */ (tar);\n}\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n/**\n * @param {any} value\n * @returns {value is PromiseLike<any>}\n */\nexport function is_promise(value) {\n\treturn (\n\t\t!!value &&\n\t\t(typeof value === 'object' || typeof value === 'function') &&\n\t\ttypeof (/** @type {any} */ (value).then) === 'function'\n\t);\n}\n\n/** @returns {void} */\nexport function add_location(element, file, line, column, char) {\n\telement.__svelte_meta = {\n\t\tloc: { file, line, column, char }\n\t};\n}\n\nexport function run(fn) {\n\treturn fn();\n}\n\nexport function blank_object() {\n\treturn Object.create(null);\n}\n\n/**\n * @param {Function[]} fns\n * @returns {void}\n */\nexport function run_all(fns) {\n\tfns.forEach(run);\n}\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\n/** @returns {boolean} */\nexport function safe_not_equal(a, b) {\n\treturn a != a ? b == b : a !== b || (a && typeof a === 'object') || typeof a === 'function';\n}\n\nlet src_url_equal_anchor;\n\n/**\n * @param {string} element_src\n * @param {string} url\n * @returns {boolean}\n */\nexport function src_url_equal(element_src, url) {\n\tif (element_src === url) return true;\n\tif (!src_url_equal_anchor) {\n\t\tsrc_url_equal_anchor = document.createElement('a');\n\t}\n\t// This is actually faster than doing URL(..).href\n\tsrc_url_equal_anchor.href = url;\n\treturn element_src === src_url_equal_anchor.href;\n}\n\n/** @param {string} srcset */\nfunction split_srcset(srcset) {\n\treturn srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean));\n}\n\n/**\n * @param {HTMLSourceElement | HTMLImageElement} element_srcset\n * @param {string | undefined | null} srcset\n * @returns {boolean}\n */\nexport function srcset_url_equal(element_srcset, srcset) {\n\tconst element_urls = split_srcset(element_srcset.srcset);\n\tconst urls = split_srcset(srcset || '');\n\n\treturn (\n\t\turls.length === element_urls.length &&\n\t\turls.every(\n\t\t\t([url, width], i) =>\n\t\t\t\twidth === element_urls[i][1] &&\n\t\t\t\t// We need to test both ways because Vite will create an a full URL with\n\t\t\t\t// `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the\n\t\t\t\t// relative URLs inside srcset are not automatically resolved to absolute URLs by\n\t\t\t\t// browsers (in contrast to img.src). This means both SSR and DOM code could\n\t\t\t\t// contain relative or absolute URLs.\n\t\t\t\t(src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0]))\n\t\t)\n\t);\n}\n\n/** @returns {boolean} */\nexport function not_equal(a, b) {\n\treturn a != a ? b == b : a !== b;\n}\n\n/** @returns {boolean} */\nexport function is_empty(obj) {\n\treturn Object.keys(obj).length === 0;\n}\n\n/** @returns {void} */\nexport function validate_store(store, name) {\n\tif (store != null && typeof store.subscribe !== 'function') {\n\t\tthrow new Error(`'${name}' is not a store with a 'subscribe' method`);\n\t}\n}\n\nexport function subscribe(store, ...callbacks) {\n\tif (store == null) {\n\t\tfor (const callback of callbacks) {\n\t\t\tcallback(undefined);\n\t\t}\n\t\treturn noop;\n\t}\n\tconst unsub = store.subscribe(...callbacks);\n\treturn unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\n\n/**\n * Get the current value from a store by subscribing and immediately unsubscribing.\n *\n * https://svelte.dev/docs/svelte-store#get\n * @template T\n * @param {import('../store/public.js').Readable<T>} store\n * @returns {T}\n */\nexport function get_store_value(store) {\n\tlet value;\n\tsubscribe(store, (_) => (value = _))();\n\treturn value;\n}\n\n/** @returns {void} */\nexport function component_subscribe(component, store, callback) {\n\tcomponent.$$.on_destroy.push(subscribe(store, callback));\n}\n\nexport function create_slot(definition, ctx, $$scope, fn) {\n\tif (definition) {\n\t\tconst slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n\t\treturn definition[0](slot_ctx);\n\t}\n}\n\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n\treturn definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx;\n}\n\nexport function get_slot_changes(definition, $$scope, dirty, fn) {\n\tif (definition[2] && fn) {\n\t\tconst lets = definition[2](fn(dirty));\n\t\tif ($$scope.dirty === undefined) {\n\t\t\treturn lets;\n\t\t}\n\t\tif (typeof lets === 'object') {\n\t\t\tconst merged = [];\n\t\t\tconst len = Math.max($$scope.dirty.length, lets.length);\n\t\t\tfor (let i = 0; i < len; i += 1) {\n\t\t\t\tmerged[i] = $$scope.dirty[i] | lets[i];\n\t\t\t}\n\t\t\treturn merged;\n\t\t}\n\t\treturn $$scope.dirty | lets;\n\t}\n\treturn $$scope.dirty;\n}\n\n/** @returns {void} */\nexport function update_slot_base(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tslot_changes,\n\tget_slot_context_fn\n) {\n\tif (slot_changes) {\n\t\tconst slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n\t\tslot.p(slot_context, slot_changes);\n\t}\n}\n\n/** @returns {void} */\nexport function update_slot(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tdirty,\n\tget_slot_changes_fn,\n\tget_slot_context_fn\n) {\n\tconst slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n\tupdate_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\n\n/** @returns {any[] | -1} */\nexport function get_all_dirty_from_scope($$scope) {\n\tif ($$scope.ctx.length > 32) {\n\t\tconst dirty = [];\n\t\tconst length = $$scope.ctx.length / 32;\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tdirty[i] = -1;\n\t\t}\n\t\treturn dirty;\n\t}\n\treturn -1;\n}\n\n/** @returns {{}} */\nexport function exclude_internal_props(props) {\n\tconst result = {};\n\tfor (const k in props) if (k[0] !== '$') result[k] = props[k];\n\treturn result;\n}\n\n/** @returns {{}} */\nexport function compute_rest_props(props, keys) {\n\tconst rest = {};\n\tkeys = new Set(keys);\n\tfor (const k in props) if (!keys.has(k) && k[0] !== '$') rest[k] = props[k];\n\treturn rest;\n}\n\n/** @returns {{}} */\nexport function compute_slots(slots) {\n\tconst result = {};\n\tfor (const key in slots) {\n\t\tresult[key] = true;\n\t}\n\treturn result;\n}\n\n/** @returns {(this: any, ...args: any[]) => void} */\nexport function once(fn) {\n\tlet ran = false;\n\treturn function (...args) {\n\t\tif (ran) return;\n\t\tran = true;\n\t\tfn.call(this, ...args);\n\t};\n}\n\nexport function null_to_empty(value) {\n\treturn value == null ? '' : value;\n}\n\nexport function set_store_value(store, ret, value) {\n\tstore.set(value);\n\treturn ret;\n}\n\nexport const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\n\nexport function action_destroyer(action_result) {\n\treturn action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\n\n/** @param {number | string} value\n * @returns {[number, string]}\n */\nexport function split_css_unit(value) {\n\tconst split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n\treturn split ? [parseFloat(split[1]), split[2] || 'px'] : [/** @type {number} */ (value), 'px'];\n}\n\nexport const contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n","import { contenteditable_truthy_values, has_prop } from './utils.js';\n\nimport { ResizeObserverSingleton } from './ResizeObserverSingleton.js';\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\n\n/**\n * @returns {void}\n */\nexport function start_hydrating() {\n\tis_hydrating = true;\n}\n\n/**\n * @returns {void}\n */\nexport function end_hydrating() {\n\tis_hydrating = false;\n}\n\n/**\n * @param {number} low\n * @param {number} high\n * @param {(index: number) => number} key\n * @param {number} value\n * @returns {number}\n */\nfunction upper_bound(low, high, key, value) {\n\t// Return first index of value larger than input value in the range [low, high)\n\twhile (low < high) {\n\t\tconst mid = low + ((high - low) >> 1);\n\t\tif (key(mid) <= value) {\n\t\t\tlow = mid + 1;\n\t\t} else {\n\t\t\thigh = mid;\n\t\t}\n\t}\n\treturn low;\n}\n\n/**\n * @param {NodeEx} target\n * @returns {void}\n */\nfunction init_hydrate(target) {\n\tif (target.hydrate_init) return;\n\ttarget.hydrate_init = true;\n\t// We know that all children have claim_order values since the unclaimed have been detached if target is not <head>\n\n\tlet children = /** @type {ArrayLike<NodeEx2>} */ (target.childNodes);\n\t// If target is <head>, there may be children without claim_order\n\tif (target.nodeName === 'HEAD') {\n\t\tconst my_children = [];\n\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\tconst node = children[i];\n\t\t\tif (node.claim_order !== undefined) {\n\t\t\t\tmy_children.push(node);\n\t\t\t}\n\t\t}\n\t\tchildren = my_children;\n\t}\n\t/*\n\t * Reorder claimed children optimally.\n\t * We can reorder claimed children optimally by finding the longest subsequence of\n\t * nodes that are already claimed in order and only moving the rest. The longest\n\t * subsequence of nodes that are claimed in order can be found by\n\t * computing the longest increasing subsequence of .claim_order values.\n\t *\n\t * This algorithm is optimal in generating the least amount of reorder operations\n\t * possible.\n\t *\n\t * Proof:\n\t * We know that, given a set of reordering operations, the nodes that do not move\n\t * always form an increasing subsequence, since they do not move among each other\n\t * meaning that they must be already ordered among each other. Thus, the maximal\n\t * set of nodes that do not move form a longest increasing subsequence.\n\t */\n\t// Compute longest increasing subsequence\n\t// m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n\tconst m = new Int32Array(children.length + 1);\n\t// Predecessor indices + 1\n\tconst p = new Int32Array(children.length);\n\tm[0] = -1;\n\tlet longest = 0;\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst current = children[i].claim_order;\n\t\t// Find the largest subsequence length such that it ends in a value less than our current value\n\t\t// upper_bound returns first greater value, so we subtract one\n\t\t// with fast path for when we are on the current longest subsequence\n\t\tconst seq_len =\n\t\t\t(longest > 0 && children[m[longest]].claim_order <= current\n\t\t\t\t? longest + 1\n\t\t\t\t: upper_bound(1, longest, (idx) => children[m[idx]].claim_order, current)) - 1;\n\t\tp[i] = m[seq_len] + 1;\n\t\tconst new_len = seq_len + 1;\n\t\t// We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n\t\tm[new_len] = i;\n\t\tlongest = Math.max(new_len, longest);\n\t}\n\t// The longest increasing subsequence of nodes (initially reversed)\n\n\t/**\n\t * @type {NodeEx2[]}\n\t */\n\tconst lis = [];\n\t// The rest of the nodes, nodes that will be moved\n\n\t/**\n\t * @type {NodeEx2[]}\n\t */\n\tconst to_move = [];\n\tlet last = children.length - 1;\n\tfor (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n\t\tlis.push(children[cur - 1]);\n\t\tfor (; last >= cur; last--) {\n\t\t\tto_move.push(children[last]);\n\t\t}\n\t\tlast--;\n\t}\n\tfor (; last >= 0; last--) {\n\t\tto_move.push(children[last]);\n\t}\n\tlis.reverse();\n\t// We sort the nodes being moved to guarantee that their insertion order matches the claim order\n\tto_move.sort((a, b) => a.claim_order - b.claim_order);\n\t// Finally, we move the nodes\n\tfor (let i = 0, j = 0; i < to_move.length; i++) {\n\t\twhile (j < lis.length && to_move[i].claim_order >= lis[j].claim_order) {\n\t\t\tj++;\n\t\t}\n\t\tconst anchor = j < lis.length ? lis[j] : null;\n\t\ttarget.insertBefore(to_move[i], anchor);\n\t}\n}\n\n/**\n * @param {Node} target\n * @param {Node} node\n * @returns {void}\n */\nexport function append(target, node) {\n\ttarget.appendChild(node);\n}\n\n/**\n * @param {Node} target\n * @param {string} style_sheet_id\n * @param {string} styles\n * @returns {void}\n */\nexport function append_styles(target, style_sheet_id, styles) {\n\tconst append_styles_to = get_root_for_style(target);\n\tif (!append_styles_to.getElementById(style_sheet_id)) {\n\t\tconst style = element('style');\n\t\tstyle.id = style_sheet_id;\n\t\tstyle.textContent = styles;\n\t\tappend_stylesheet(append_styles_to, style);\n\t}\n}\n\n/**\n * @param {Node} node\n * @returns {ShadowRoot | Document}\n */\nexport function get_root_for_style(node) {\n\tif (!node) return document;\n\tconst root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n\tif (root && /** @type {ShadowRoot} */ (root).host) {\n\t\treturn /** @type {ShadowRoot} */ (root);\n\t}\n\treturn node.ownerDocument;\n}\n\n/**\n * @param {Node} node\n * @returns {CSSStyleSheet}\n */\nexport function append_empty_stylesheet(node) {\n\tconst style_element = element('style');\n\t// For transitions to work without 'style-src: unsafe-inline' Content Security Policy,\n\t// these empty tags need to be allowed with a hash as a workaround until we move to the Web Animations API.\n\t// Using the hash for the empty string (for an empty tag) works in all browsers except Safari.\n\t// So as a workaround for the workaround, when we append empty style tags we set their content to /* empty */.\n\t// The hash 'sha256-9OlNO0DNEeaVzHL4RZwCLsBHA8WBQ8toBp/4F5XV2nc=' will then work even in Safari.\n\tstyle_element.textContent = '/* empty */';\n\tappend_stylesheet(get_root_for_style(node), style_element);\n\treturn style_element.sheet;\n}\n\n/**\n * @param {ShadowRoot | Document} node\n * @param {HTMLStyleElement} style\n * @returns {CSSStyleSheet}\n */\nfunction append_stylesheet(node, style) {\n\tappend(/** @type {Document} */ (node).head || node, style);\n\treturn style.sheet;\n}\n\n/**\n * @param {NodeEx} target\n * @param {NodeEx} node\n * @returns {void}\n */\nexport function append_hydration(target, node) {\n\tif (is_hydrating) {\n\t\tinit_hydrate(target);\n\t\tif (\n\t\t\ttarget.actual_end_child === undefined ||\n\t\t\t(target.actual_end_child !== null && target.actual_end_child.parentNode !== target)\n\t\t) {\n\t\t\ttarget.actual_end_child = target.firstChild;\n\t\t}\n\t\t// Skip nodes of undefined ordering\n\t\twhile (target.actual_end_child !== null && target.actual_end_child.claim_order === undefined) {\n\t\t\ttarget.actual_end_child = target.actual_end_child.nextSibling;\n\t\t}\n\t\tif (node !== target.actual_end_child) {\n\t\t\t// We only insert if the ordering of this node should be modified or the parent node is not target\n\t\t\tif (node.claim_order !== undefined || node.parentNode !== target) {\n\t\t\t\ttarget.insertBefore(node, target.actual_end_child);\n\t\t\t}\n\t\t} else {\n\t\t\ttarget.actual_end_child = node.nextSibling;\n\t\t}\n\t} else if (node.parentNode !== target || node.nextSibling !== null) {\n\t\ttarget.appendChild(node);\n\t}\n}\n\n/**\n * @param {Node} target\n * @param {Node} node\n * @param {Node} [anchor]\n * @returns {void}\n */\nexport function insert(target, node, anchor) {\n\ttarget.insertBefore(node, anchor || null);\n}\n\n/**\n * @param {NodeEx} target\n * @param {NodeEx} node\n * @param {NodeEx} [anchor]\n * @returns {void}\n */\nexport function insert_hydration(target, node, anchor) {\n\tif (is_hydrating && !anchor) {\n\t\tappend_hydration(target, node);\n\t} else if (node.parentNode !== target || node.nextSibling != anchor) {\n\t\ttarget.insertBefore(node, anchor || null);\n\t}\n}\n\n/**\n * @param {Node} node\n * @returns {void}\n */\nexport function detach(node) {\n\tif (node.parentNode) {\n\t\tnode.parentNode.removeChild(node);\n\t}\n}\n\n/**\n * @returns {void} */\nexport function destroy_each(iterations, detaching) {\n\tfor (let i = 0; i < iterations.length; i += 1) {\n\t\tif (iterations[i]) iterations[i].d(detaching);\n\t}\n}\n\n/**\n * @template {keyof HTMLElementTagNameMap} K\n * @param {K} name\n * @returns {HTMLElementTagNameMap[K]}\n */\nexport function element(name) {\n\treturn document.createElement(name);\n}\n\n/**\n * @template {keyof HTMLElementTagNameMap} K\n * @param {K} name\n * @param {string} is\n * @returns {HTMLElementTagNameMap[K]}\n */\nexport function element_is(name, is) {\n\treturn document.createElement(name, { is });\n}\n\n/**\n * @template T\n * @template {keyof T} K\n * @param {T} obj\n * @param {K[]} exclude\n * @returns {Pick<T, Exclude<keyof T, K>>}\n */\nexport function object_without_properties(obj, exclude) {\n\tconst target = /** @type {Pick<T, Exclude<keyof T, K>>} */ ({});\n\tfor (const k in obj) {\n\t\tif (\n\t\t\thas_prop(obj, k) &&\n\t\t\t// @ts-ignore\n\t\t\texclude.indexOf(k) === -1\n\t\t) {\n\t\t\t// @ts-ignore\n\t\t\ttarget[k] = obj[k];\n\t\t}\n\t}\n\treturn target;\n}\n\n/**\n * @template {keyof SVGElementTagNameMap} K\n * @param {K} name\n * @returns {SVGElement}\n */\nexport function svg_element(name) {\n\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n}\n\n/**\n * @param {string} data\n * @returns {Text}\n */\nexport function text(data) {\n\treturn document.createTextNode(data);\n}\n\n/**\n * @returns {Text} */\nexport function space() {\n\treturn text(' ');\n}\n\n/**\n * @returns {Text} */\nexport function empty() {\n\treturn text('');\n}\n\n/**\n * @param {string} content\n * @returns {Comment}\n */\nexport function comment(content) {\n\treturn document.createComment(content);\n}\n\n/**\n * @param {EventTarget} node\n * @param {string} event\n * @param {EventListenerOrEventListenerObject} handler\n * @param {boolean | AddEventListenerOptions | EventListenerOptions} [options]\n * @returns {() => void}\n */\nexport function listen(node, event, handler, options) {\n\tnode.addEventListener(event, handler, options);\n\treturn () => node.removeEventListener(event, handler, options);\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function prevent_default(fn) {\n\treturn function (event) {\n\t\tevent.preventDefault();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function stop_propagation(fn) {\n\treturn function (event) {\n\t\tevent.stopPropagation();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function stop_immediate_propagation(fn) {\n\treturn function (event) {\n\t\tevent.stopImmediatePropagation();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => void} */\nexport function self(fn) {\n\treturn function (event) {\n\t\t// @ts-ignore\n\t\tif (event.target === this) fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => void} */\nexport function trusted(fn) {\n\treturn function (event) {\n\t\t// @ts-ignore\n\t\tif (event.isTrusted) fn.call(this, event);\n\t};\n}\n\n/**\n * @param {Element} node\n * @param {string} attribute\n * @param {string} [value]\n * @returns {void}\n */\nexport function attr(node, attribute, value) {\n\tif (value == null) node.removeAttribute(attribute);\n\telse if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);\n}\n/**\n * List of attributes that should always be set through the attr method,\n * because updating them through the property setter doesn't work reliably.\n * In the example of `width`/`height`, the problem is that the setter only\n * accepts numeric values, but the attribute can also be set to a string like `50%`.\n * If this list becomes too big, rethink this approach.\n */\nconst always_set_through_set_attribute = ['width', 'height'];\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {{ [x: string]: string }} attributes\n * @returns {void}\n */\nexport function set_attributes(node, attributes) {\n\t// @ts-ignore\n\tconst descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n\tfor (const key in attributes) {\n\t\tif (attributes[key] == null) {\n\t\t\tnode.removeAttribute(key);\n\t\t} else if (key === 'style') {\n\t\t\tnode.style.cssText = attributes[key];\n\t\t} else if (key === '__value') {\n\t\t\t/** @type {any} */ (node).value = node[key] = attributes[key];\n\t\t} else if (\n\t\t\tdescriptors[key] &&\n\t\t\tdescriptors[key].set &&\n\t\t\talways_set_through_set_attribute.indexOf(key) === -1\n\t\t) {\n\t\t\tnode[key] = attributes[key];\n\t\t} else {\n\t\t\tattr(node, key, attributes[key]);\n\t\t}\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {{ [x: string]: string }} attributes\n * @returns {void}\n */\nexport function set_svg_attributes(node, attributes) {\n\tfor (const key in attributes) {\n\t\tattr(node, key, attributes[key]);\n\t}\n}\n\n/**\n * @param {Record<string, unknown>} data_map\n * @returns {void}\n */\nexport function set_custom_element_data_map(node, data_map) {\n\tObject.keys(data_map).forEach((key) => {\n\t\tset_custom_element_data(node, key, data_map[key]);\n\t});\n}\n\n/**\n * @returns {void} */\nexport function set_custom_element_data(node, prop, value) {\n\tconst lower = prop.toLowerCase(); // for backwards compatibility with existing behavior we do lowercase first\n\tif (lower in node) {\n\t\tnode[lower] = typeof node[lower] === 'boolean' && value === '' ? true : value;\n\t} else if (prop in node) {\n\t\tnode[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n\t} else {\n\t\tattr(node, prop, value);\n\t}\n}\n\n/**\n * @param {string} tag\n */\nexport function set_dynamic_element_data(tag) {\n\treturn /-/.test(tag) ? set_custom_element_data_map : set_attributes;\n}\n\n/**\n * @returns {void}\n */\nexport function xlink_attr(node, attribute, value) {\n\tnode.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @returns {string}\n */\nexport function get_svelte_dataset(node) {\n\treturn node.dataset.svelteH;\n}\n\n/**\n * @returns {unknown[]} */\nexport function get_binding_group_value(group, __value, checked) {\n\tconst value = new Set();\n\tfor (let i = 0; i < group.length; i += 1) {\n\t\tif (group[i].checked) value.add(group[i].__value);\n\t}\n\tif (!checked) {\n\t\tvalue.delete(__value);\n\t}\n\treturn Array.from(value);\n}\n\n/**\n * @param {HTMLInputElement[]} group\n * @returns {{ p(...inputs: HTMLInputElement[]): void; r(): void; }}\n */\nexport function init_binding_group(group) {\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _inputs;\n\treturn {\n\t\t/* push */ p(...inputs) {\n\t\t\t_inputs = inputs;\n\t\t\t_inputs.forEach((input) => group.push(input));\n\t\t},\n\t\t/* remove */ r() {\n\t\t\t_inputs.forEach((input) => group.splice(group.indexOf(input), 1));\n\t\t}\n\t};\n}\n\n/**\n * @param {number[]} indexes\n * @returns {{ u(new_indexes: number[]): void; p(...inputs: HTMLInputElement[]): void; r: () => void; }}\n */\nexport function init_binding_group_dynamic(group, indexes) {\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _group = get_binding_group(group);\n\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _inputs;\n\n\tfunction get_binding_group(group) {\n\t\tfor (let i = 0; i < indexes.length; i++) {\n\t\t\tgroup = group[indexes[i]] = group[indexes[i]] || [];\n\t\t}\n\t\treturn group;\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction push() {\n\t\t_inputs.forEach((input) => _group.push(input));\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction remove() {\n\t\t_inputs.forEach((input) => _group.splice(_group.indexOf(input), 1));\n\t}\n\treturn {\n\t\t/* update */ u(new_indexes) {\n\t\t\tindexes = new_indexes;\n\t\t\tconst new_group = get_binding_group(group);\n\t\t\tif (new_group !== _group) {\n\t\t\t\tremove();\n\t\t\t\t_group = new_group;\n\t\t\t\tpush();\n\t\t\t}\n\t\t},\n\t\t/* push */ p(...inputs) {\n\t\t\t_inputs = inputs;\n\t\t\tpush();\n\t\t},\n\t\t/* remove */ r: remove\n\t};\n}\n\n/** @returns {number} */\nexport function to_number(value) {\n\treturn value === '' ? null : +value;\n}\n\n/** @returns {any[]} */\nexport function time_ranges_to_array(ranges) {\n\tconst array = [];\n\tfor (let i = 0; i < ranges.length; i += 1) {\n\t\tarray.push({ start: ranges.start(i), end: ranges.end(i) });\n\t}\n\treturn array;\n}\n\n/**\n * @param {Element} element\n * @returns {ChildNode[]}\n */\nexport function children(element) {\n\treturn Array.from(element.childNodes);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {void}\n */\nfunction init_claim_info(nodes) {\n\tif (nodes.claim_info === undefined) {\n\t\tnodes.claim_info = { last_index: 0, total_claimed: 0 };\n\t}\n}\n\n/**\n * @template {ChildNodeEx} R\n * @param {ChildNodeArray} nodes\n * @param {(node: ChildNodeEx) => node is R} predicate\n * @param {(node: ChildNodeEx) => ChildNodeEx | undefined} process_node\n * @param {() => R} create_node\n * @param {boolean} dont_update_last_index\n * @returns {R}\n */\nfunction claim_node(nodes, predicate, process_node, create_node, dont_update_last_index = false) {\n\t// Try to find nodes in an order such that we lengthen the longest increasing subsequence\n\tinit_claim_info(nodes);\n\tconst result_node = (() => {\n\t\t// We first try to find an element after the previous one\n\t\tfor (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (predicate(node)) {\n\t\t\t\tconst replacement = process_node(node);\n\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\tnodes.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnodes[i] = replacement;\n\t\t\t\t}\n\t\t\t\tif (!dont_update_last_index) {\n\t\t\t\t\tnodes.claim_info.last_index = i;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\t// Otherwise, we try to find one before\n\t\t// We iterate in reverse so that we don't go too far back\n\t\tfor (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (predicate(node)) {\n\t\t\t\tconst replacement = process_node(node);\n\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\tnodes.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnodes[i] = replacement;\n\t\t\t\t}\n\t\t\t\tif (!dont_update_last_index) {\n\t\t\t\t\tnodes.claim_info.last_index = i;\n\t\t\t\t} else if (replacement === undefined) {\n\t\t\t\t\t// Since we spliced before the last_index, we decrease it\n\t\t\t\t\tnodes.claim_info.last_index--;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\t// If we can't find any matching node, we create a new one\n\t\treturn create_node();\n\t})();\n\tresult_node.claim_order = nodes.claim_info.total_claimed;\n\tnodes.claim_info.total_claimed += 1;\n\treturn result_node;\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @param {(name: string) => Element | SVGElement} create_element\n * @returns {Element | SVGElement}\n */\nfunction claim_element_base(nodes, name, attributes, create_element) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Element | SVGElement} */\n\t\t(node) => node.nodeName === name,\n\t\t/** @param {Element} node */\n\t\t(node) => {\n\t\t\tconst remove = [];\n\t\t\tfor (let j = 0; j < node.attributes.length; j++) {\n\t\t\t\tconst attribute = node.attributes[j];\n\t\t\t\tif (!attributes[attribute.name]) {\n\t\t\t\t\tremove.push(attribute.name);\n\t\t\t\t}\n\t\t\t}\n\t\t\tremove.forEach((v) => node.removeAttribute(v));\n\t\t\treturn undefined;\n\t\t},\n\t\t() => create_element(name)\n\t);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @returns {Element | SVGElement}\n */\nexport function claim_element(nodes, name, attributes) {\n\treturn claim_element_base(nodes, name, attributes, element);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @returns {Element | SVGElement}\n */\nexport function claim_svg_element(nodes, name, attributes) {\n\treturn claim_element_base(nodes, name, attributes, svg_element);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {Text}\n */\nexport function claim_text(nodes, data) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Text} */\n\t\t(node) => node.nodeType === 3,\n\t\t/** @param {Text} node */\n\t\t(node) => {\n\t\t\tconst data_str = '' + data;\n\t\t\tif (node.data.startsWith(data_str)) {\n\t\t\t\tif (node.data.length !== data_str.length) {\n\t\t\t\t\treturn node.splitText(data_str.length);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode.data = data_str;\n\t\t\t}\n\t\t},\n\t\t() => text(data),\n\t\ttrue // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n\t);\n}\n\n/**\n * @returns {Text} */\nexport function claim_space(nodes) {\n\treturn claim_text(nodes, ' ');\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {Comment}\n */\nexport function claim_comment(nodes, data) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Comment} */\n\t\t(node) => node.nodeType === 8,\n\t\t/** @param {Comment} node */\n\t\t(node) => {\n\t\t\tnode.data = '' + data;\n\t\t\treturn undefined;\n\t\t},\n\t\t() => comment(data),\n\t\ttrue\n\t);\n}\n\nfunction get_comment_idx(nodes, text, start) {\n\tfor (let i = start; i < nodes.length; i += 1) {\n\t\tconst node = nodes[i];\n\t\tif (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n * @param {boolean} is_svg\n * @returns {HtmlTagHydration}\n */\nexport function claim_html_tag(nodes, is_svg) {\n\t// find html opening tag\n\tconst start_index = get_comment_idx(nodes, 'HTML_TAG_START', 0);\n\tconst end_index = get_comment_idx(nodes, 'HTML_TAG_END', start_index + 1);\n\tif (start_index === -1 || end_index === -1) {\n\t\treturn new HtmlTagHydration(is_svg);\n\t}\n\n\tinit_claim_info(nodes);\n\tconst html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n\tdetach(html_tag_nodes[0]);\n\tdetach(html_tag_nodes[html_tag_nodes.length - 1]);\n\tconst claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n\tif (claimed_nodes.length === 0) {\n\t\treturn new HtmlTagHydration(is_svg);\n\t}\n\tfor (const n of claimed_nodes) {\n\t\tn.claim_order = nodes.claim_info.total_claimed;\n\t\tnodes.claim_info.total_claimed += 1;\n\t}\n\treturn new HtmlTagHydration(is_svg, claimed_nodes);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @returns {void}\n */\nexport function set_data(text, data) {\n\tdata = '' + data;\n\tif (text.data === data) return;\n\ttext.data = /** @type {string} */ (data);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @returns {void}\n */\nexport function set_data_contenteditable(text, data) {\n\tdata = '' + data;\n\tif (text.wholeText === data) return;\n\ttext.data = /** @type {string} */ (data);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @param {string} attr_value\n * @returns {void}\n */\nexport function set_data_maybe_contenteditable(text, data, attr_value) {\n\tif (~contenteditable_truthy_values.indexOf(attr_value)) {\n\t\tset_data_contenteditable(text, data);\n\t} else {\n\t\tset_data(text, data);\n\t}\n}\n\n/**\n * @returns {void} */\nexport function set_input_value(input, value) {\n\tinput.value = value == null ? '' : value;\n}\n\n/**\n * @returns {void} */\nexport function set_input_type(input, type) {\n\ttry {\n\t\tinput.type = type;\n\t} catch (e) {\n\t\t// do nothing\n\t}\n}\n\n/**\n * @returns {void} */\nexport function set_style(node, key, value, important) {\n\tif (value == null) {\n\t\tnode.style.removeProperty(key);\n\t} else {\n\t\tnode.style.setProperty(key, value, important ? 'important' : '');\n\t}\n}\n\n/**\n * @returns {void} */\nexport function select_option(select, value, mounting) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\tif (option.__value === value) {\n\t\t\toption.selected = true;\n\t\t\treturn;\n\t\t}\n\t}\n\tif (!mounting || value !== undefined) {\n\t\tselect.selectedIndex = -1; // no option should be selected\n\t}\n}\n\n/**\n * @returns {void} */\nexport function select_options(select, value) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\toption.selected = ~value.indexOf(option.__value);\n\t}\n}\n\nexport function select_value(select) {\n\tconst selected_option = select.querySelector(':checked');\n\treturn selected_option && selected_option.__value;\n}\n\nexport function select_multiple_value(select) {\n\treturn [].map.call(select.querySelectorAll(':checked'), (option) => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\n\n/**\n * @type {boolean} */\nlet crossorigin;\n\n/**\n * @returns {boolean} */\nexport function is_crossorigin() {\n\tif (crossorigin === undefined) {\n\t\tcrossorigin = false;\n\t\ttry {\n\t\t\tif (typeof window !== 'undefined' && window.parent) {\n\t\t\t\tvoid window.parent.document;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tcrossorigin = true;\n\t\t}\n\t}\n\treturn crossorigin;\n}\n\n/**\n * @param {HTMLElement} node\n * @param {() => void} fn\n * @returns {() => void}\n */\nexport function add_iframe_resize_listener(node, fn) {\n\tconst computed_style = getComputedStyle(node);\n\tif (computed_style.position === 'static') {\n\t\tnode.style.position = 'relative';\n\t}\n\tconst iframe = element('iframe');\n\tiframe.setAttribute(\n\t\t'style',\n\t\t'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n\t\t\t'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;'\n\t);\n\tiframe.setAttribute('aria-hidden', 'true');\n\tiframe.tabIndex = -1;\n\tconst crossorigin = is_crossorigin();\n\n\t/**\n\t * @type {() => void}\n\t */\n\tlet unsubscribe;\n\tif (crossorigin) {\n\t\tiframe.src = \"data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}</script>\";\n\t\tunsubscribe = listen(\n\t\t\twindow,\n\t\t\t'message',\n\t\t\t/** @param {MessageEvent} event */ (event) => {\n\t\t\t\tif (event.source === iframe.contentWindow) fn();\n\t\t\t}\n\t\t);\n\t} else {\n\t\tiframe.src = 'about:blank';\n\t\tiframe.onload = () => {\n\t\t\tunsubscribe = listen(iframe.contentWindow, 'resize', fn);\n\t\t\t// make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n\t\t\t// see https://github.com/sveltejs/svelte/issues/4233\n\t\t\tfn();\n\t\t};\n\t}\n\tappend(node, iframe);\n\treturn () => {\n\t\tif (crossorigin) {\n\t\t\tunsubscribe();\n\t\t} else if (unsubscribe && iframe.contentWindow) {\n\t\t\tunsubscribe();\n\t\t}\n\t\tdetach(iframe);\n\t};\n}\nexport const resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'content-box'\n});\nexport const resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'border-box'\n});\nexport const resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton(\n\t{ box: 'device-pixel-content-box' }\n);\nexport { ResizeObserverSingleton };\n\n/**\n * @returns {void} */\nexport function toggle_class(element, name, toggle) {\n\t// The `!!` is required because an `undefined` flag means flipping the current state.\n\telement.classList.toggle(name, !!toggle);\n}\n\n/**\n * @template T\n * @param {string} type\n * @param {T} [detail]\n * @param {{ bubbles?: boolean, cancelable?: boolean }} [options]\n * @returns {CustomEvent<T>}\n */\nexport function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n\treturn new CustomEvent(type, { detail, bubbles, cancelable });\n}\n\n/**\n * @param {string} selector\n * @param {HTMLElement} parent\n * @returns {ChildNodeArray}\n */\nexport function query_selector_all(selector, parent = document.body) {\n\treturn Array.from(parent.querySelectorAll(selector));\n}\n\n/**\n * @param {string} nodeId\n * @param {HTMLElement} head\n * @returns {any[]}\n */\nexport function head_selector(nodeId, head) {\n\tconst result = [];\n\tlet started = 0;\n\tfor (const node of head.childNodes) {\n\t\tif (node.nodeType === 8 /* comment node */) {\n\t\t\tconst comment = node.textContent.trim();\n\t\t\tif (comment === `HEAD_${nodeId}_END`) {\n\t\t\t\tstarted -= 1;\n\t\t\t\tresult.push(node);\n\t\t\t} else if (comment === `HEAD_${nodeId}_START`) {\n\t\t\t\tstarted += 1;\n\t\t\t\tresult.push(node);\n\t\t\t}\n\t\t} else if (started > 0) {\n\t\t\tresult.push(node);\n\t\t}\n\t}\n\treturn result;\n}\n/** */\nexport class HtmlTag {\n\t/**\n\t * @private\n\t * @default false\n\t */\n\tis_svg = false;\n\t/** parent for creating node */\n\te = undefined;\n\t/** html tag nodes */\n\tn = undefined;\n\t/** target */\n\tt = undefined;\n\t/** anchor */\n\ta = undefined;\n\tconstructor(is_svg = false) {\n\t\tthis.is_svg = is_svg;\n\t\tthis.e = this.n = null;\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tc(html) {\n\t\tthis.h(html);\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @param {HTMLElement | SVGElement} target\n\t * @param {HTMLElement | SVGElement} anchor\n\t * @returns {void}\n\t */\n\tm(html, target, anchor = null) {\n\t\tif (!this.e) {\n\t\t\tif (this.is_svg)\n\t\t\t\tthis.e = svg_element(/** @type {keyof SVGElementTagNameMap} */ (target.nodeName));\n\t\t\t/** #7364 target for <template> may be provided as #document-fragment(11) */ else\n\t\t\t\tthis.e = element(\n\t\t\t\t\t/** @type {keyof HTMLElementTagNameMap} */ (\n\t\t\t\t\t\ttarget.nodeType === 11 ? 'TEMPLATE' : target.nodeName\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\tthis.t =\n\t\t\t\ttarget.tagName !== 'TEMPLATE'\n\t\t\t\t\t? target\n\t\t\t\t\t: /** @type {HTMLTemplateElement} */ (target).content;\n\t\t\tthis.c(html);\n\t\t}\n\t\tthis.i(anchor);\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\th(html) {\n\t\tthis.e.innerHTML = html;\n\t\tthis.n = Array.from(\n\t\t\tthis.e.nodeName === 'TEMPLATE' ? this.e.content.childNodes : this.e.childNodes\n\t\t);\n\t}\n\n\t/**\n\t * @returns {void} */\n\ti(anchor) {\n\t\tfor (let i = 0; i < this.n.length; i += 1) {\n\t\t\tinsert(this.t, this.n[i], anchor);\n\t\t}\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tp(html) {\n\t\tthis.d();\n\t\tthis.h(html);\n\t\tthis.i(this.a);\n\t}\n\n\t/**\n\t * @returns {void} */\n\td() {\n\t\tthis.n.forEach(detach);\n\t}\n}\n\nexport class HtmlTagHydration extends HtmlTag {\n\t/** @type {Element[]} hydration claimed nodes */\n\tl = undefined;\n\n\tconstructor(is_svg = false, claimed_nodes) {\n\t\tsuper(is_svg);\n\t\tthis.e = this.n = null;\n\t\tthis.l = claimed_nodes;\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tc(html) {\n\t\tif (this.l) {\n\t\t\tthis.n = this.l;\n\t\t} else {\n\t\t\tsuper.c(html);\n\t\t}\n\t}\n\n\t/**\n\t * @returns {void} */\n\ti(anchor) {\n\t\tfor (let i = 0; i < this.n.length; i += 1) {\n\t\t\tinsert_hydration(this.t, this.n[i], anchor);\n\t\t}\n\t}\n}\n\n/**\n * @param {NamedNodeMap} attributes\n * @returns {{}}\n */\nexport function attribute_to_object(attributes) {\n\tconst result = {};\n\tfor (const attribute of attributes) {\n\t\tresult[attribute.name] = attribute.value;\n\t}\n\treturn result;\n}\n\nconst escaped = {\n\t'\"': '"',\n\t'&': '&',\n\t'<': '<'\n};\n\nconst regex_attribute_characters_to_escape = /[\"&<]/g;\n\n/**\n * Note that the attribute itself should be surrounded in double quotes\n * @param {any} attribute\n */\nfunction escape_attribute(attribute) {\n\treturn String(attribute).replace(regex_attribute_characters_to_escape, (match) => escaped[match]);\n}\n\n/**\n * @param {Record<string, string>} attributes\n */\nexport function stringify_spread(attributes) {\n\tlet str = ' ';\n\tfor (const key in attributes) {\n\t\tif (attributes[key] != null) {\n\t\t\tstr += `${key}=\"${escape_attribute(attributes[key])}\" `;\n\t\t}\n\t}\n\n\treturn str;\n}\n\n/**\n * @param {HTMLElement} element\n * @returns {{}}\n */\nexport function get_custom_elements_slots(element) {\n\tconst result = {};\n\telement.childNodes.forEach(\n\t\t/** @param {Element} node */ (node) => {\n\t\t\tresult[node.slot || 'default'] = true;\n\t\t}\n\t);\n\treturn result;\n}\n\nexport function construct_svelte_component(component, props) {\n\treturn new component(props);\n}\n\n/**\n * @typedef {Node & {\n * \tclaim_order?: number;\n * \thydrate_init?: true;\n * \tactual_end_child?: NodeEx;\n * \tchildNodes: NodeListOf<NodeEx>;\n * }} NodeEx\n */\n\n/** @typedef {ChildNode & NodeEx} ChildNodeEx */\n\n/** @typedef {NodeEx & { claim_order: number }} NodeEx2 */\n\n/**\n * @typedef {ChildNodeEx[] & {\n * \tclaim_info?: {\n * \t\tlast_index: number;\n * \t\ttotal_claimed: number;\n * \t};\n * }} ChildNodeArray\n */\n","import { custom_event } from './dom.js';\n\nexport let current_component;\n\n/** @returns {void} */\nexport function set_current_component(component) {\n\tcurrent_component = component;\n}\n\nexport function get_current_component() {\n\tif (!current_component) throw new Error('Function called outside component initialization');\n\treturn current_component;\n}\n\n/**\n * Schedules a callback to run immediately before the component is updated after any state change.\n *\n * The first time the callback runs will be before the initial `onMount`\n *\n * https://svelte.dev/docs/svelte#beforeupdate\n * @param {() => any} fn\n * @returns {void}\n */\nexport function beforeUpdate(fn) {\n\tget_current_component().$$.before_update.push(fn);\n}\n\n/**\n * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.\n * It must be called during the component's initialisation (but doesn't need to live *inside* the component;\n * it can be called from an external module).\n *\n * If a function is returned _synchronously_ from `onMount`, it will be called when the component is unmounted.\n *\n * `onMount` does not run inside a [server-side component](https://svelte.dev/docs#run-time-server-side-component-api).\n *\n * https://svelte.dev/docs/svelte#onmount\n * @template T\n * @param {() => import('./private.js').NotFunction<T> | Promise<import('./private.js').NotFunction<T>> | (() => any)} fn\n * @returns {void}\n */\nexport function onMount(fn) {\n\tget_current_component().$$.on_mount.push(fn);\n}\n\n/**\n * Schedules a callback to run immediately after the component has been updated.\n *\n * The first time the callback runs will be after the initial `onMount`\n *\n * https://svelte.dev/docs/svelte#afterupdate\n * @param {() => any} fn\n * @returns {void}\n */\nexport function afterUpdate(fn) {\n\tget_current_component().$$.after_update.push(fn);\n}\n\n/**\n * Schedules a callback to run immediately before the component is unmounted.\n *\n * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the\n * only one that runs inside a server-side component.\n *\n * https://svelte.dev/docs/svelte#ondestroy\n * @param {() => any} fn\n * @returns {void}\n */\nexport function onDestroy(fn) {\n\tget_current_component().$$.on_destroy.push(fn);\n}\n\n/**\n * Creates an event dispatcher that can be used to dispatch [component events](https://svelte.dev/docs#template-syntax-component-directives-on-eventname).\n * Event dispatchers are functions that can take two arguments: `name` and `detail`.\n *\n * Component events created with `createEventDispatcher` create a\n * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).\n * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).\n * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)\n * property and can contain any type of data.\n *\n * The event dispatcher can be typed to narrow the allowed event names and the type of the `detail` argument:\n * ```ts\n * const dispatch = createEventDispatcher<{\n * loaded: never; // does not take a detail argument\n * change: string; // takes a detail argument of type string, which is required\n * optional: number | null; // takes an optional detail argument of type number\n * }>();\n * ```\n *\n * https://svelte.dev/docs/svelte#createeventdispatcher\n * @template {Record<string, any>} [EventMap=any]\n * @returns {import('./public.js').EventDispatcher<EventMap>}\n */\nexport function createEventDispatcher() {\n\tconst component = get_current_component();\n\treturn (type, detail, { cancelable = false } = {}) => {\n\t\tconst callbacks = component.$$.callbacks[type];\n\t\tif (callbacks) {\n\t\t\t// TODO are there situations where events could be dispatched\n\t\t\t// in a server (non-DOM) environment?\n\t\t\tconst event = custom_event(/** @type {string} */ (type), detail, { cancelable });\n\t\t\tcallbacks.slice().forEach((fn) => {\n\t\t\t\tfn.call(component, event);\n\t\t\t});\n\t\t\treturn !event.defaultPrevented;\n\t\t}\n\t\treturn true;\n\t};\n}\n\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#setcontext\n * @template T\n * @param {any} key\n * @param {T} context\n * @returns {T}\n */\nexport function setContext(key, context) {\n\tget_current_component().$$.context.set(key, context);\n\treturn context;\n}\n\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#getcontext\n * @template T\n * @param {any} key\n * @returns {T}\n */\nexport function getContext(key) {\n\treturn get_current_component().$$.context.get(key);\n}\n\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * https://svelte.dev/docs/svelte#getallcontexts\n * @template {Map<any, any>} [T=Map<any, any>]\n * @returns {T}\n */\nexport function getAllContexts() {\n\treturn get_current_component().$$.context;\n}\n\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#hascontext\n * @param {any} key\n * @returns {boolean}\n */\nexport function hasContext(key) {\n\treturn get_current_component().$$.context.has(key);\n}\n\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\n/**\n * @param component\n * @param event\n * @returns {void}\n */\nexport function bubble(component, event) {\n\tconst callbacks = component.$$.callbacks[event.type];\n\tif (callbacks) {\n\t\t// @ts-ignore\n\t\tcallbacks.slice().forEach((fn) => fn.call(this, event));\n\t}\n}\n","import { run_all } from './utils.js';\nimport { current_component, set_current_component } from './lifecycle.js';\n\nexport const dirty_components = [];\nexport const intros = { enabled: false };\nexport const binding_callbacks = [];\n\nlet render_callbacks = [];\n\nconst flush_callbacks = [];\n\nconst resolved_promise = /* @__PURE__ */ Promise.resolve();\n\nlet update_scheduled = false;\n\n/** @returns {void} */\nexport function schedule_update() {\n\tif (!update_scheduled) {\n\t\tupdate_scheduled = true;\n\t\tresolved_promise.then(flush);\n\t}\n}\n\n/** @returns {Promise<void>} */\nexport function tick() {\n\tschedule_update();\n\treturn resolved_promise;\n}\n\n/** @returns {void} */\nexport function add_render_callback(fn) {\n\trender_callbacks.push(fn);\n}\n\n/** @returns {void} */\nexport function add_flush_callback(fn) {\n\tflush_callbacks.push(fn);\n}\n\n// flush() calls callbacks in this order:\n// 1. All beforeUpdate callbacks, in order: parents before children\n// 2. All bind:this callbacks, in reverse order: children before parents.\n// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT\n// for afterUpdates called during the initial onMount, which are called in\n// reverse order: children before parents.\n// Since callbacks might update component values, which could trigger another\n// call to flush(), the following steps guard against this:\n// 1. During beforeUpdate, any updated components will be added to the\n// dirty_components array and will cause a reentrant call to flush(). Because\n// the flush index is kept outside the function, the reentrant call will pick\n// up where the earlier call left off and go through all dirty components. The\n// current_component value is saved and restored so that the reentrant call will\n// not interfere with the \"parent\" flush() call.\n// 2. bind:this callbacks cannot trigger new flush() calls.\n// 3. During afterUpdate, any updated components will NOT have their afterUpdate\n// callback called a second time; the seen_callbacks set, outside the flush()\n// function, guarantees this behavior.\nconst seen_callbacks = new Set();\n\nlet flushidx = 0; // Do *not* move this inside the flush() function\n\n/** @returns {void} */\nexport function flush() {\n\t// Do not reenter flush while dirty components are updated, as this can\n\t// result in an infinite loop. Instead, let the inner flush handle it.\n\t// Reentrancy is ok afterwards for bindings etc.\n\tif (flushidx !== 0) {\n\t\treturn;\n\t}\n\tconst saved_component = current_component;\n\tdo {\n\t\t// first, call beforeUpdate functions\n\t\t// and update components\n\t\ttry {\n\t\t\twhile (flushidx < dirty_components.length) {\n\t\t\t\tconst component = dirty_components[flushidx];\n\t\t\t\tflushidx++;\n\t\t\t\tset_current_component(component);\n\t\t\t\tupdate(component.$$);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// reset dirty state to not end up in a deadlocked state and then rethrow\n\t\t\tdirty_components.length = 0;\n\t\t\tflushidx = 0;\n\t\t\tthrow e;\n\t\t}\n\t\tset_current_component(null);\n\t\tdirty_components.length = 0;\n\t\tflushidx = 0;\n\t\twhile (binding_callbacks.length) binding_callbacks.pop()();\n\t\t// then, once components are updated, call\n\t\t// afterUpdate functions. This may cause\n\t\t// subsequent updates...\n\t\tfor (let i = 0; i < render_callbacks.length; i += 1) {\n\t\t\tconst callback = render_callbacks[i];\n\t\t\tif (!seen_callbacks.has(callback)) {\n\t\t\t\t// ...so guard against infinite loops\n\t\t\t\tseen_callbacks.add(callback);\n\t\t\t\tcallback();\n\t\t\t}\n\t\t}\n\t\trender_callbacks.length = 0;\n\t} while (dirty_components.length);\n\twhile (flush_callbacks.length) {\n\t\tflush_callbacks.pop()();\n\t}\n\tupdate_scheduled = false;\n\tseen_callbacks.clear();\n\tset_current_component(saved_component);\n}\n\n/** @returns {void} */\nfunction update($$) {\n\tif ($$.fragment !== null) {\n\t\t$$.update();\n\t\trun_all($$.before_update);\n\t\tconst dirty = $$.dirty;\n\t\t$$.dirty = [-1];\n\t\t$$.fragment && $$.fragment.p($$.ctx, dirty);\n\t\t$$.after_update.forEach(add_render_callback);\n\t}\n}\n\n/**\n * Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.\n * @param {Function[]} fns\n * @returns {void}\n */\nexport function flush_render_callbacks(fns) {\n\tconst filtered = [];\n\tconst targets = [];\n\trender_callbacks.forEach((c) => (fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c)));\n\ttargets.forEach((c) => c());\n\trender_callbacks = filtered;\n}\n","import { identity as linear, is_function, noop, run_all } from './utils.js';\nimport { now } from './environment.js';\nimport { loop } from './loop.js';\nimport { create_rule, delete_rule } from './style_manager.js';\nimport { custom_event } from './dom.js';\nimport { add_render_callback } from './scheduler.js';\n\n/**\n * @type {Promise<void> | null}\n */\nlet promise;\n\n/**\n * @returns {Promise<void>}\n */\nfunction wait() {\n\tif (!promise) {\n\t\tpromise = Promise.resolve();\n\t\tpromise.then(() => {\n\t\t\tpromise = null;\n\t\t});\n\t}\n\treturn promise;\n}\n\n/**\n * @param {Element} node\n * @param {INTRO | OUTRO | boolean} direction\n * @param {'start' | 'end'} kind\n * @returns {void}\n */\nfunction dispatch(node, direction, kind) {\n\tnode.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\n\nconst outroing = new Set();\n\n/**\n * @type {Outro}\n */\nlet outros;\n\n/**\n * @returns {void} */\nexport function group_outros() {\n\toutros = {\n\t\tr: 0,\n\t\tc: [],\n\t\tp: outros // parent group\n\t};\n}\n\n/**\n * @returns {void} */\nexport function check_outros() {\n\tif (!outros.r) {\n\t\trun_all(outros.c);\n\t}\n\toutros = outros.p;\n}\n\n/**\n * @param {import('./private.js').Fragment} block\n * @param {0 | 1} [local]\n * @returns {void}\n */\nexport function transition_in(block, local) {\n\tif (block && block.i) {\n\t\toutroing.delete(block);\n\t\tblock.i(local);\n\t}\n}\n\n/**\n * @param {import('./private.js').Fragment} block\n * @param {0 | 1} local\n * @param {0 | 1} [detach]\n * @param {() => void} [callback]\n * @returns {void}\n */\nexport function transition_out(block, local, detach, callback) {\n\tif (block && block.o) {\n\t\tif (outroing.has(block)) return;\n\t\toutroing.add(block);\n\t\toutros.c.push(() => {\n\t\t\toutroing.delete(block);\n\t\t\tif (callback) {\n\t\t\t\tif (detach) block.d(1);\n\t\t\t\tcallback();\n\t\t\t}\n\t\t});\n\t\tblock.o(local);\n\t} else if (callback) {\n\t\tcallback();\n\t}\n}\n\n/**\n * @type {import('../transition/public.js').TransitionConfig}\n */\nconst null_transition = { duration: 0 };\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @returns {{ start(): void; invalidate(): void; end(): void; }}\n */\nexport function create_in_transition(node, fn, params) {\n\t/**\n\t * @type {TransitionOptions} */\n\tconst options = { direction: 'in' };\n\tlet config = fn(node, params, options);\n\tlet running = false;\n\tlet animation_name;\n\tlet task;\n\tlet uid = 0;\n\n\t/**\n\t * @returns {void} */\n\tfunction cleanup() {\n\t\tif (animation_name) delete_rule(node, animation_name);\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction go() {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\t\tif (css) animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n\t\ttick(0, 1);\n\t\tconst start_time = now() + delay;\n\t\tconst end_time = start_time + duration;\n\t\tif (task) task.abort();\n\t\trunning = true;\n\t\tadd_render_callback(() => dispatch(node, true, 'start'));\n\t\ttask = loop((now) => {\n\t\t\tif (running) {\n\t\t\t\tif (now >= end_time) {\n\t\t\t\t\ttick(1, 0);\n\t\t\t\t\tdispatch(node, true, 'end');\n\t\t\t\t\tcleanup();\n\t\t\t\t\treturn (running = false);\n\t\t\t\t}\n\t\t\t\tif (now >= start_time) {\n\t\t\t\t\tconst t = easing((now - start_time) / duration);\n\t\t\t\t\ttick(t, 1 - t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn running;\n\t\t});\n\t}\n\tlet started = false;\n\treturn {\n\t\tstart() {\n\t\t\tif (started) return;\n\t\t\tstarted = true;\n\t\t\tdelete_rule(node);\n\t\t\tif (is_function(config)) {\n\t\t\t\tconfig = config(options);\n\t\t\t\twait().then(go);\n\t\t\t} else {\n\t\t\t\tgo();\n\t\t\t}\n\t\t},\n\t\tinvalidate() {\n\t\t\tstarted = false;\n\t\t},\n\t\tend() {\n\t\t\tif (running) {\n\t\t\t\tcleanup();\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @returns {{ end(reset: any): void; }}\n */\nexport function create_out_transition(node, fn, params) {\n\t/** @type {TransitionOptions} */\n\tconst options = { direction: 'out' };\n\tlet config = fn(node, params, options);\n\tlet running = true;\n\tlet animation_name;\n\tconst group = outros;\n\tgroup.r += 1;\n\t/** @type {boolean} */\n\tlet original_inert_value;\n\n\t/**\n\t * @returns {void} */\n\tfunction go() {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\n\t\tif (css) animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n\n\t\tconst start_time = now() + delay;\n\t\tconst end_time = start_time + duration;\n\t\tadd_render_callback(() => dispatch(node, false, 'start'));\n\n\t\tif ('inert' in node) {\n\t\t\toriginal_inert_value = /** @type {HTMLElement} */ (node).inert;\n\t\t\tnode.inert = true;\n\t\t}\n\n\t\tloop((now) => {\n\t\t\tif (running) {\n\t\t\t\tif (now >= end_time) {\n\t\t\t\t\ttick(0, 1);\n\t\t\t\t\tdispatch(node, false, 'end');\n\t\t\t\t\tif (!--group.r) {\n\t\t\t\t\t\t// this will result in `end()` being called,\n\t\t\t\t\t\t// so we don't need to clean up here\n\t\t\t\t\t\trun_all(group.c);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (now >= start_time) {\n\t\t\t\t\tconst t = easing((now - start_time) / duration);\n\t\t\t\t\ttick(1 - t, t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn running;\n\t\t});\n\t}\n\n\tif (is_function(config)) {\n\t\twait().then(() => {\n\t\t\t// @ts-ignore\n\t\t\tconfig = config(options);\n\t\t\tgo();\n\t\t});\n\t} else {\n\t\tgo();\n\t}\n\n\treturn {\n\t\tend(reset) {\n\t\t\tif (reset && 'inert' in node) {\n\t\t\t\tnode.inert = original_inert_value;\n\t\t\t}\n\t\t\tif (reset && config.tick) {\n\t\t\t\tconfig.tick(1, 0);\n\t\t\t}\n\t\t\tif (running) {\n\t\t\t\tif (animation_name) delete_rule(node, animation_name);\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @param {boolean} intro\n * @returns {{ run(b: 0 | 1): void; end(): void; }}\n */\nexport function create_bidirectional_transition(node, fn, params, intro) {\n\t/**\n\t * @type {TransitionOptions} */\n\tconst options = { direction: 'both' };\n\tlet config = fn(node, params, options);\n\tlet t = intro ? 0 : 1;\n\n\t/**\n\t * @type {Program | null} */\n\tlet running_program = null;\n\n\t/**\n\t * @type {PendingProgram | null} */\n\tlet pending_program = null;\n\tlet animation_name = null;\n\n\t/** @type {boolean} */\n\tlet original_inert_value;\n\n\t/**\n\t * @returns {void} */\n\tfunction clear_animation() {\n\t\tif (animation_name) delete_rule(node, animation_name);\n\t}\n\n\t/**\n\t * @param {PendingProgram} program\n\t * @param {number} duration\n\t * @returns {Program}\n\t */\n\tfunction init(program, duration) {\n\t\tconst d = /** @type {Program['d']} */ (program.b - t);\n\t\tduration *= Math.abs(d);\n\t\treturn {\n\t\t\ta: t,\n\t\t\tb: program.b,\n\t\t\td,\n\t\t\tduration,\n\t\t\tstart: program.start,\n\t\t\tend: program.start + duration,\n\t\t\tgroup: program.group\n\t\t};\n\t}\n\n\t/**\n\t * @param {INTRO | OUTRO} b\n\t * @returns {void}\n\t */\n\tfunction go(b) {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\n\t\t/**\n\t\t * @type {PendingProgram} */\n\t\tconst program = {\n\t\t\tstart: now() + delay,\n\t\t\tb\n\t\t};\n\n\t\tif (!b) {\n\t\t\t// @ts-ignore todo: improve typings\n\t\t\tprogram.group = outros;\n\t\t\toutros.r += 1;\n\t\t}\n\n\t\tif ('inert' in node) {\n\t\t\tif (b) {\n\t\t\t\tif (original_inert_value !== undefined) {\n\t\t\t\t\t// aborted/reversed outro — restore previous inert value\n\t\t\t\t\tnode.inert = original_inert_value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toriginal_inert_value = /** @type {HTMLElement} */ (node).inert;\n\t\t\t\tnode.inert = true;\n\t\t\t}\n\t\t}\n\n\t\tif (running_program || pending_program) {\n\t\t\tpending_program = program;\n\t\t} else {\n\t\t\t// if this is an intro, and there's a delay, we need to do\n\t\t\t// an initial tick and/or apply CSS animation immediately\n\t\t\tif (css) {\n\t\t\t\tclear_animation();\n\t\t\t\tanimation_name = create_rule(node, t, b, duration, delay, easing, css);\n\t\t\t}\n\t\t\tif (b) tick(0, 1);\n\t\t\trunning_program = init(program, duration);\n\t\t\tadd_render_callback(() => dispatch(node, b, 'start'));\n\t\t\tloop((now) => {\n\t\t\t\tif (pending_program && now > pending_program.start) {\n\t\t\t\t\trunning_program = init(pending_program, duration);\n\t\t\t\t\tpending_program = null;\n\t\t\t\t\tdispatch(node, running_program.b, 'start');\n\t\t\t\t\tif (css) {\n\t\t\t\t\t\tclear_animation();\n\t\t\t\t\t\tanimation_name = create_rule(\n\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\tt,\n\t\t\t\t\t\t\trunning_program.b,\n\t\t\t\t\t\t\trunning_program.duration,\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\teasing,\n\t\t\t\t\t\t\tconfig.css\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (running_program) {\n\t\t\t\t\tif (now >= running_program.end) {\n\t\t\t\t\t\ttick((t = running_program.b), 1 - t);\n\t\t\t\t\t\tdispatch(node, running_program.b, 'end');\n\t\t\t\t\t\tif (!pending_program) {\n\t\t\t\t\t\t\t// we're done\n\t\t\t\t\t\t\tif (running_program.b) {\n\t\t\t\t\t\t\t\t// intro — we can tidy up immediately\n\t\t\t\t\t\t\t\tclear_animation();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// outro — needs to be coordinated\n\t\t\t\t\t\t\t\tif (!--running_program.group.r) run_all(running_program.group.c);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trunning_program = null;\n\t\t\t\t\t} else if (now >= running_program.start) {\n\t\t\t\t\t\tconst p = now - running_program.start;\n\t\t\t\t\t\tt = running_program.a + running_program.d * easing(p / running_program.duration);\n\t\t\t\t\t\ttick(t, 1 - t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn !!(running_program || pending_program);\n\t\t\t});\n\t\t}\n\t}\n\treturn {\n\t\trun(b) {\n\t\t\tif (is_function(config)) {\n\t\t\t\twait().then(() => {\n\t\t\t\t\tconst opts = { direction: b ? 'in' : 'out' };\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tconfig = config(opts);\n\t\t\t\t\tgo(b);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tgo(b);\n\t\t\t}\n\t\t},\n\t\tend() {\n\t\t\tclear_animation();\n\t\t\trunning_program = pending_program = null;\n\t\t}\n\t};\n}\n\n/** @typedef {1} INTRO */\n/** @typedef {0} OUTRO */\n/** @typedef {{ direction: 'in' | 'out' | 'both' }} TransitionOptions */\n/** @typedef {(node: Element, params: any, options: TransitionOptions) => import('../transition/public.js').TransitionConfig} TransitionFn */\n\n/**\n * @typedef {Object} Outro\n * @property {number} r\n * @property {Function[]} c\n * @property {Object} p\n */\n\n/**\n * @typedef {Object} PendingProgram\n * @property {number} start\n * @property {INTRO|OUTRO} b\n * @property {Outro} [group]\n */\n\n/**\n * @typedef {Object} Program\n * @property {number} a\n * @property {INTRO|OUTRO} b\n * @property {1|-1} d\n * @property {number} duration\n * @property {number} start\n * @property {number} end\n * @property {Outro} [group]\n */\n","import { transition_in, transition_out } from './transitions.js';\nimport { run_all } from './utils.js';\n\n// general each functions:\n\nexport function ensure_array_like(array_like_or_iterator) {\n\treturn array_like_or_iterator?.length !== undefined\n\t\t? array_like_or_iterator\n\t\t: Array.from(array_like_or_iterator);\n}\n\n// keyed each functions:\n\n/** @returns {void} */\nexport function destroy_block(block, lookup) {\n\tblock.d(1);\n\tlookup.delete(block.key);\n}\n\n/** @returns {void} */\nexport function outro_and_destroy_block(block, lookup) {\n\ttransition_out(block, 1, 1, () => {\n\t\tlookup.delete(block.key);\n\t});\n}\n\n/** @returns {void} */\nexport function fix_and_destroy_block(block, lookup) {\n\tblock.f();\n\tdestroy_block(block, lookup);\n}\n\n/** @returns {void} */\nexport function fix_and_outro_and_destroy_block(block, lookup) {\n\tblock.f();\n\toutro_and_destroy_block(block, lookup);\n}\n\n/** @returns {any[]} */\nexport function update_keyed_each(\n\told_blocks,\n\tdirty,\n\tget_key,\n\tdynamic,\n\tctx,\n\tlist,\n\tlookup,\n\tnode,\n\tdestroy,\n\tcreate_each_block,\n\tnext,\n\tget_context\n) {\n\tlet o = old_blocks.length;\n\tlet n = list.length;\n\tlet i = o;\n\tconst old_indexes = {};\n\twhile (i--) old_indexes[old_blocks[i].key] = i;\n\tconst new_blocks = [];\n\tconst new_lookup = new Map();\n\tconst deltas = new Map();\n\tconst updates = [];\n\ti = n;\n\twhile (i--) {\n\t\tconst child_ctx = get_context(ctx, list, i);\n\t\tconst key = get_key(child_ctx);\n\t\tlet block = lookup.get(key);\n\t\tif (!block) {\n\t\t\tblock = create_each_block(key, child_ctx);\n\t\t\tblock.c();\n\t\t} else if (dynamic) {\n\t\t\t// defer updates until all the DOM shuffling is done\n\t\t\tupdates.push(() => block.p(child_ctx, dirty));\n\t\t}\n\t\tnew_lookup.set(key, (new_blocks[i] = block));\n\t\tif (key in old_indexes) deltas.set(key, Math.abs(i - old_indexes[key]));\n\t}\n\tconst will_move = new Set();\n\tconst did_move = new Set();\n\t/** @returns {void} */\n\tfunction insert(block) {\n\t\ttransition_in(block, 1);\n\t\tblock.m(node, next);\n\t\tlookup.set(block.key, block);\n\t\tnext = block.first;\n\t\tn--;\n\t}\n\twhile (o && n) {\n\t\tconst new_block = new_blocks[n - 1];\n\t\tconst old_block = old_blocks[o - 1];\n\t\tconst new_key = new_block.key;\n\t\tconst old_key = old_block.key;\n\t\tif (new_block === old_block) {\n\t\t\t// do nothing\n\t\t\tnext = new_block.first;\n\t\t\to--;\n\t\t\tn--;\n\t\t} else if (!new_lookup.has(old_key)) {\n\t\t\t// remove old block\n\t\t\tdestroy(old_block, lookup);\n\t\t\to--;\n\t\t} else if (!lookup.has(new_key) || will_move.has(new_key)) {\n\t\t\tinsert(new_block);\n\t\t} else if (did_move.has(old_key)) {\n\t\t\to--;\n\t\t} else if (deltas.get(new_key) > deltas.get(old_key)) {\n\t\t\tdid_move.add(new_key);\n\t\t\tinsert(new_block);\n\t\t} else {\n\t\t\twill_move.add(old_key);\n\t\t\to--;\n\t\t}\n\t}\n\twhile (o--) {\n\t\tconst old_block = old_blocks[o];\n\t\tif (!new_lookup.has(old_block.key)) destroy(old_block, lookup);\n\t}\n\twhile (n) insert(new_blocks[n - 1]);\n\trun_all(updates);\n\treturn new_blocks;\n}\n\n/** @returns {void} */\nexport function validate_each_keys(ctx, list, get_context, get_key) {\n\tconst keys = new Map();\n\tfor (let i = 0; i < list.length; i++) {\n\t\tconst key = get_key(get_context(ctx, list, i));\n\t\tif (keys.has(key)) {\n\t\t\tlet value = '';\n\t\t\ttry {\n\t\t\t\tvalue = `with value '${String(key)}' `;\n\t\t\t} catch (e) {\n\t\t\t\t// can't stringify\n\t\t\t}\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot have duplicate keys in a keyed each: Keys at index ${keys.get(\n\t\t\t\t\tkey\n\t\t\t\t)} and ${i} ${value}are duplicates`\n\t\t\t);\n\t\t}\n\t\tkeys.set(key, i);\n\t}\n}\n","import {\n\tadd_render_callback,\n\tflush,\n\tflush_render_callbacks,\n\tschedule_update,\n\tdirty_components\n} from './scheduler.js';\nimport { current_component, set_current_component } from './lifecycle.js';\nimport { blank_object, is_empty, is_function, run, run_all, noop } from './utils.js';\nimport {\n\tchildren,\n\tdetach,\n\tstart_hydrating,\n\tend_hydrating,\n\tget_custom_elements_slots,\n\tinsert,\n\telement,\n\tattr\n} from './dom.js';\nimport { transition_in } from './transitions.js';\n\n/** @returns {void} */\nexport function bind(component, name, callback) {\n\tconst index = component.$$.props[name];\n\tif (index !== undefined) {\n\t\tcomponent.$$.bound[index] = callback;\n\t\tcallback(component.$$.ctx[index]);\n\t}\n}\n\n/** @returns {void} */\nexport function create_component(block) {\n\tblock && block.c();\n}\n\n/** @returns {void} */\nexport function claim_component(block, parent_nodes) {\n\tblock && block.l(parent_nodes);\n}\n\n/** @returns {void} */\nexport function mount_component(component, target, anchor) {\n\tconst { fragment, after_update } = component.$$;\n\tfragment && fragment.m(target, anchor);\n\t// onMount happens before the initial afterUpdate\n\tadd_render_callback(() => {\n\t\tconst new_on_destroy = component.$$.on_mount.map(run).filter(is_function);\n\t\t// if the component was destroyed immediately\n\t\t// it will update the `$$.on_destroy` reference to `null`.\n\t\t// the destructured on_destroy may still reference to the old array\n\t\tif (component.$$.on_destroy) {\n\t\t\tcomponent.$$.on_destroy.push(...new_on_destroy);\n\t\t} else {\n\t\t\t// Edge case - component was destroyed immediately,\n\t\t\t// most likely as a result of a binding initialising\n\t\t\trun_all(new_on_destroy);\n\t\t}\n\t\tcomponent.$$.on_mount = [];\n\t});\n\tafter_update.forEach(add_render_callback);\n}\n\n/** @returns {void} */\nexport function destroy_component(component, detaching) {\n\tconst $$ = component.$$;\n\tif ($$.fragment !== null) {\n\t\tflush_render_callbacks($$.after_update);\n\t\trun_all($$.on_destroy);\n\t\t$$.fragment && $$.fragment.d(detaching);\n\t\t// TODO null out other refs, including component.$$ (but need to\n\t\t// preserve final state?)\n\t\t$$.on_destroy = $$.fragment = null;\n\t\t$$.ctx = [];\n\t}\n}\n\n/** @returns {void} */\nfunction make_dirty(component, i) {\n\tif (component.$$.dirty[0] === -1) {\n\t\tdirty_components.push(component);\n\t\tschedule_update();\n\t\tcomponent.$$.dirty.fill(0);\n\t}\n\tcomponent.$$.dirty[(i / 31) | 0] |= 1 << i % 31;\n}\n\n// TODO: Document the other params\n/**\n * @param {SvelteComponent} component\n * @param {import('./public.js').ComponentConstructorOptions} options\n *\n * @param {import('./utils.js')['not_equal']} not_equal Used to compare props and state values.\n * @param {(target: Element | ShadowRoot) => void} [append_styles] Function that appends styles to the DOM when the component is first initialised.\n * This will be the `add_css` function from the compiled component.\n *\n * @returns {void}\n */\nexport function init(\n\tcomponent,\n\toptions,\n\tinstance,\n\tcreate_fragment,\n\tnot_equal,\n\tprops,\n\tappend_styles = null,\n\tdirty = [-1]\n) {\n\tconst parent_component = current_component;\n\tset_current_component(component);\n\t/** @type {import('./private.js').T$$} */\n\tconst $$ = (component.$$ = {\n\t\tfragment: null,\n\t\tctx: [],\n\t\t// state\n\t\tprops,\n\t\tupdate: noop,\n\t\tnot_equal,\n\t\tbound: blank_object(),\n\t\t// lifecycle\n\t\ton_mount: [],\n\t\ton_destroy: [],\n\t\ton_disconnect: [],\n\t\tbefore_update: [],\n\t\tafter_update: [],\n\t\tcontext: new Map(options.context || (parent_component ? parent_component.$$.context : [])),\n\t\t// everything else\n\t\tcallbacks: blank_object(),\n\t\tdirty,\n\t\tskip_bound: false,\n\t\troot: options.target || parent_component.$$.root\n\t});\n\tappend_styles && append_styles($$.root);\n\tlet ready = false;\n\t$$.ctx = instance\n\t\t? instance(component, options.props || {}, (i, ret, ...rest) => {\n\t\t\t\tconst value = rest.length ? rest[0] : ret;\n\t\t\t\tif ($$.ctx && not_equal($$.ctx[i], ($$.ctx[i] = value))) {\n\t\t\t\t\tif (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);\n\t\t\t\t\tif (ready) make_dirty(component, i);\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t })\n\t\t: [];\n\t$$.update();\n\tready = true;\n\trun_all($$.before_update);\n\t// `false` as a special case of no DOM component\n\t$$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n\tif (options.target) {\n\t\tif (options.hydrate) {\n\t\t\tstart_hydrating();\n\t\t\t// TODO: what is the correct type here?\n\t\t\t// @ts-expect-error\n\t\t\tconst nodes = children(options.target);\n\t\t\t$$.fragment && $$.fragment.l(nodes);\n\t\t\tnodes.forEach(detach);\n\t\t} else {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t$$.fragment && $$.fragment.c();\n\t\t}\n\t\tif (options.intro) transition_in(component.$$.fragment);\n\t\tmount_component(component, options.target, options.anchor);\n\t\tend_hydrating();\n\t\tflush();\n\t}\n\tset_current_component(parent_component);\n}\n\nexport let SvelteElement;\n\nif (typeof HTMLElement === 'function') {\n\tSvelteElement = class extends HTMLElement {\n\t\t/** The Svelte component constructor */\n\t\t$$ctor;\n\t\t/** Slots */\n\t\t$$s;\n\t\t/** The Svelte component instance */\n\t\t$$c;\n\t\t/** Whether or not the custom element is connected */\n\t\t$$cn = false;\n\t\t/** Component props data */\n\t\t$$d = {};\n\t\t/** `true` if currently in the process of reflecting component props back to attributes */\n\t\t$$r = false;\n\t\t/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */\n\t\t$$p_d = {};\n\t\t/** @type {Record<string, Function[]>} Event listeners */\n\t\t$$l = {};\n\t\t/** @type {Map<Function, Function>} Event listener unsubscribe functions */\n\t\t$$l_u = new Map();\n\n\t\tconstructor($$componentCtor, $$slots, use_shadow_dom) {\n\t\t\tsuper();\n\t\t\tthis.$$ctor = $$componentCtor;\n\t\t\tthis.$$s = $$slots;\n\t\t\tif (use_shadow_dom) {\n\t\t\t\tthis.attachShadow({ mode: 'open' });\n\t\t\t}\n\t\t}\n\n\t\taddEventListener(type, listener, options) {\n\t\t\t// We can't determine upfront if the event is a custom event or not, so we have to\n\t\t\t// listen to both. If someone uses a custom event with the same name as a regular\n\t\t\t// browser event, this fires twice - we can't avoid that.\n\t\t\tthis.$$l[type] = this.$$l[type] || [];\n\t\t\tthis.$$l[type].push(listener);\n\t\t\tif (this.$$c) {\n\t\t\t\tconst unsub = this.$$c.$on(type, listener);\n\t\t\t\tthis.$$l_u.set(listener, unsub);\n\t\t\t}\n\t\t\tsuper.addEventListener(type, listener, options);\n\t\t}\n\n\t\tremoveEventListener(type, listener, options) {\n\t\t\tsuper.removeEventListener(type, listener, options);\n\t\t\tif (this.$$c) {\n\t\t\t\tconst unsub = this.$$l_u.get(listener);\n\t\t\t\tif (unsub) {\n\t\t\t\t\tunsub();\n\t\t\t\t\tthis.$$l_u.delete(listener);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tasync connectedCallback() {\n\t\t\tthis.$$cn = true;\n\t\t\tif (!this.$$c) {\n\t\t\t\t// We wait one tick to let possible child slot elements be created/mounted\n\t\t\t\tawait Promise.resolve();\n\t\t\t\tif (!this.$$cn || this.$$c) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfunction create_slot(name) {\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tlet node;\n\t\t\t\t\t\tconst obj = {\n\t\t\t\t\t\t\tc: function create() {\n\t\t\t\t\t\t\t\tnode = element('slot');\n\t\t\t\t\t\t\t\tif (name !== 'default') {\n\t\t\t\t\t\t\t\t\tattr(node, 'name', name);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * @param {HTMLElement} target\n\t\t\t\t\t\t\t * @param {HTMLElement} [anchor]\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tm: function mount(target, anchor) {\n\t\t\t\t\t\t\t\tinsert(target, node, anchor);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\td: function destroy(detaching) {\n\t\t\t\t\t\t\t\tif (detaching) {\n\t\t\t\t\t\t\t\t\tdetach(node);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn obj;\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst $$slots = {};\n\t\t\t\tconst existing_slots = get_custom_elements_slots(this);\n\t\t\t\tfor (const name of this.$$s) {\n\t\t\t\t\tif (name in existing_slots) {\n\t\t\t\t\t\t$$slots[name] = [create_slot(name)];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const attribute of this.attributes) {\n\t\t\t\t\t// this.$$data takes precedence over this.attributes\n\t\t\t\t\tconst name = this.$$g_p(attribute.name);\n\t\t\t\t\tif (!(name in this.$$d)) {\n\t\t\t\t\t\tthis.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, 'toProp');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Port over props that were set programmatically before ce was initialized\n\t\t\t\tfor (const key in this.$$p_d) {\n\t\t\t\t\tif (!(key in this.$$d) && this[key] !== undefined) {\n\t\t\t\t\t\tthis.$$d[key] = this[key]; // don't transform, these were set through JavaScript\n\t\t\t\t\t\tdelete this[key]; // remove the property that shadows the getter/setter\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.$$c = new this.$$ctor({\n\t\t\t\t\ttarget: this.shadowRoot || this,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...this.$$d,\n\t\t\t\t\t\t$$slots,\n\t\t\t\t\t\t$$scope: {\n\t\t\t\t\t\t\tctx: []\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Reflect component props as attributes\n\t\t\t\tconst reflect_attributes = () => {\n\t\t\t\t\tthis.$$r = true;\n\t\t\t\t\tfor (const key in this.$$p_d) {\n\t\t\t\t\t\tthis.$$d[key] = this.$$c.$$.ctx[this.$$c.$$.props[key]];\n\t\t\t\t\t\tif (this.$$p_d[key].reflect) {\n\t\t\t\t\t\t\tconst attribute_value = get_custom_element_value(\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tthis.$$d[key],\n\t\t\t\t\t\t\t\tthis.$$p_d,\n\t\t\t\t\t\t\t\t'toAttribute'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (attribute_value == null) {\n\t\t\t\t\t\t\t\tthis.removeAttribute(this.$$p_d[key].attribute || key);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.setAttribute(this.$$p_d[key].attribute || key, attribute_value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.$$r = false;\n\t\t\t\t};\n\t\t\t\tthis.$$c.$$.after_update.push(reflect_attributes);\n\t\t\t\treflect_attributes(); // once initially because after_update is added too late for first render\n\n\t\t\t\tfor (const type in this.$$l) {\n\t\t\t\t\tfor (const listener of this.$$l[type]) {\n\t\t\t\t\t\tconst unsub = this.$$c.$on(type, listener);\n\t\t\t\t\t\tthis.$$l_u.set(listener, unsub);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.$$l = {};\n\t\t\t}\n\t\t}\n\n\t\t// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte\n\t\t// and setting attributes through setAttribute etc, this is helpful\n\t\tattributeChangedCallback(attr, _oldValue, newValue) {\n\t\t\tif (this.$$r) return;\n\t\t\tattr = this.$$g_p(attr);\n\t\t\tthis.$$d[attr] = get_custom_element_value(attr, newValue, this.$$p_d, 'toProp');\n\t\t\tthis.$$c?.$set({ [attr]: this.$$d[attr] });\n\t\t}\n\n\t\tdisconnectedCallback() {\n\t\t\tthis.$$cn = false;\n\t\t\t// In a microtask, because this could be a move within the DOM\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tif (!this.$$cn && this.$$c) {\n\t\t\t\t\tthis.$$c.$destroy();\n\t\t\t\t\tthis.$$c = undefined;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t$$g_p(attribute_name) {\n\t\t\treturn (\n\t\t\t\tObject.keys(this.$$p_d).find(\n\t\t\t\t\t(key) =>\n\t\t\t\t\t\tthis.$$p_d[key].attribute === attribute_name ||\n\t\t\t\t\t\t(!this.$$p_d[key].attribute && key.toLowerCase() === attribute_name)\n\t\t\t\t) || attribute_name\n\t\t\t);\n\t\t}\n\t};\n}\n\n/**\n * @param {string} prop\n * @param {any} value\n * @param {Record<string, CustomElementPropDefinition>} props_definition\n * @param {'toAttribute' | 'toProp'} [transform]\n */\nfunction get_custom_element_value(prop, value, props_definition, transform) {\n\tconst type = props_definition[prop]?.type;\n\tvalue = type === 'Boolean' && typeof value !== 'boolean' ? value != null : value;\n\tif (!transform || !props_definition[prop]) {\n\t\treturn value;\n\t} else if (transform === 'toAttribute') {\n\t\tswitch (type) {\n\t\t\tcase 'Object':\n\t\t\tcase 'Array':\n\t\t\t\treturn value == null ? null : JSON.stringify(value);\n\t\t\tcase 'Boolean':\n\t\t\t\treturn value ? '' : null;\n\t\t\tcase 'Number':\n\t\t\t\treturn value == null ? null : value;\n\t\t\tdefault:\n\t\t\t\treturn value;\n\t\t}\n\t} else {\n\t\tswitch (type) {\n\t\t\tcase 'Object':\n\t\t\tcase 'Array':\n\t\t\t\treturn value && JSON.parse(value);\n\t\t\tcase 'Boolean':\n\t\t\t\treturn value; // conversion already handled above\n\t\t\tcase 'Number':\n\t\t\t\treturn value != null ? +value : value;\n\t\t\tdefault:\n\t\t\t\treturn value;\n\t\t}\n\t}\n}\n\n/**\n * @internal\n *\n * Turn a Svelte component into a custom element.\n * @param {import('./public.js').ComponentType} Component A Svelte component constructor\n * @param {Record<string, CustomElementPropDefinition>} props_definition The props to observe\n * @param {string[]} slots The slots to create\n * @param {string[]} accessors Other accessors besides the ones for props the component has\n * @param {boolean} use_shadow_dom Whether to use shadow DOM\n * @param {(ce: new () => HTMLElement) => new () => HTMLElement} [extend]\n */\nexport function create_custom_element(\n\tComponent,\n\tprops_definition,\n\tslots,\n\taccessors,\n\tuse_shadow_dom,\n\textend\n) {\n\tlet Class = class extends SvelteElement {\n\t\tconstructor() {\n\t\t\tsuper(Component, slots, use_shadow_dom);\n\t\t\tthis.$$p_d = props_definition;\n\t\t}\n\t\tstatic get observedAttributes() {\n\t\t\treturn Object.keys(props_definition).map((key) =>\n\t\t\t\t(props_definition[key].attribute || key).toLowerCase()\n\t\t\t);\n\t\t}\n\t};\n\tObject.keys(props_definition).forEach((prop) => {\n\t\tObject.defineProperty(Class.prototype, prop, {\n\t\t\tget() {\n\t\t\t\treturn this.$$c && prop in this.$$c ? this.$$c[prop] : this.$$d[prop];\n\t\t\t},\n\t\t\tset(value) {\n\t\t\t\tvalue = get_custom_element_value(prop, value, props_definition);\n\t\t\t\tthis.$$d[prop] = value;\n\t\t\t\tthis.$$c?.$set({ [prop]: value });\n\t\t\t}\n\t\t});\n\t});\n\taccessors.forEach((accessor) => {\n\t\tObject.defineProperty(Class.prototype, accessor, {\n\t\t\tget() {\n\t\t\t\treturn this.$$c?.[accessor];\n\t\t\t}\n\t\t});\n\t});\n\tif (extend) {\n\t\t// @ts-expect-error - assigning here is fine\n\t\tClass = extend(Class);\n\t}\n\tComponent.element = /** @type {any} */ (Class);\n\treturn Class;\n}\n\n/**\n * Base class for Svelte components. Used when dev=false.\n *\n * @template {Record<string, any>} [Props=any]\n * @template {Record<string, any>} [Events=any]\n */\nexport class SvelteComponent {\n\t/**\n\t * ### PRIVATE API\n\t *\n\t * Do not use, may change at any time\n\t *\n\t * @type {any}\n\t */\n\t$$ = undefined;\n\t/**\n\t * ### PRIVATE API\n\t *\n\t * Do not use, may change at any time\n\t *\n\t * @type {any}\n\t */\n\t$$set = undefined;\n\n\t/** @returns {void} */\n\t$destroy() {\n\t\tdestroy_component(this, 1);\n\t\tthis.$destroy = noop;\n\t}\n\n\t/**\n\t * @template {Extract<keyof Events, string>} K\n\t * @param {K} type\n\t * @param {((e: Events[K]) => void) | null | undefined} callback\n\t * @returns {() => void}\n\t */\n\t$on(type, callback) {\n\t\tif (!is_function(callback)) {\n\t\t\treturn noop;\n\t\t}\n\t\tconst callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);\n\t\tcallbacks.push(callback);\n\t\treturn () => {\n\t\t\tconst index = callbacks.indexOf(callback);\n\t\t\tif (index !== -1) callbacks.splice(index, 1);\n\t\t};\n\t}\n\n\t/**\n\t * @param {Partial<Props>} props\n\t * @returns {void}\n\t */\n\t$set(props) {\n\t\tif (this.$$set && !is_empty(props)) {\n\t\t\tthis.$$.skip_bound = true;\n\t\t\tthis.$$set(props);\n\t\t\tthis.$$.skip_bound = false;\n\t\t}\n\t}\n}\n\n/**\n * @typedef {Object} CustomElementPropDefinition\n * @property {string} [attribute]\n * @property {boolean} [reflect]\n * @property {'String'|'Boolean'|'Number'|'Array'|'Object'} [type]\n */\n","// generated during release, do not modify\n\n/**\n * The current version, as set in package.json.\n *\n * https://svelte.dev/docs/svelte-compiler#svelte-version\n * @type {string}\n */\nexport const VERSION = '4.2.19';\nexport const PUBLIC_VERSION = '4';\n","import { PUBLIC_VERSION } from '../../../shared/version.js';\n\nif (typeof window !== 'undefined')\n\t// @ts-ignore\n\t(window.__svelte || (window.__svelte = { v: new Set() })).v.add(PUBLIC_VERSION);\n","<svg viewBox=\"0 0 14 14\" width=\"13\" height=\"13\">\n <path\n 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\"\n />\n</svg>\n\n<style>\n svg {\n display: block;\n fill: var(--color-icon-button);\n }\n</style>\n","<svg viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n 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\"\n />\n</svg>\n\n<style>\n svg {\n display: block;\n fill: #e15042;\n }\n</style>\n","<script context=\"module\" lang=\"ts\">\n type SpriteIcon = { width: number; height: number; x: number; y: number };\n\n const hidpi = devicePixelRatio > 1.25;\n\n const scaleUrl = hidpi ? \"@2x\" : \"\";\n\n const scaleFactor = hidpi ? 2 : 1;\n\n let sprites:\n | undefined\n | null\n | { width: number; height: number; icons: Record<string, SpriteIcon> };\n\n let spritePromise: Promise<void> | undefined;\n</script>\n\n<script lang=\"ts\">\n import { createEventDispatcher } from \"svelte\";\n import type { Feature, ShowPlaceType } from \"./types\";\n\n export let feature: Feature;\n\n export let style: \"selected\" | \"picked\" | \"default\" = \"default\";\n\n export let showPlaceType: ShowPlaceType;\n\n export let missingIconsCache: Set<string>;\n\n export let iconsBaseUrl: string;\n\n $: categories = feature.properties?.categories;\n\n $: isReverse = feature.place_type[0] === \"reverse\";\n\n const dispatch = createEventDispatcher<{ select: undefined }>();\n\n let category: string | undefined;\n\n let imageUrl: string | undefined;\n\n let spriteIcon: SpriteIcon | undefined;\n\n let index: number;\n\n $: placeType =\n feature.properties?.categories?.join(\", \") ??\n feature.properties?.place_type_name?.[0] ??\n feature.place_type[0];\n\n $: {\n index = categories?.length ?? 0;\n\n loadIcon();\n }\n\n function loadSprites() {\n spritePromise ??= fetch(`${iconsBaseUrl}/sprite${scaleUrl}.json`)\n .then((response) => response.json())\n .then((data) => {\n sprites = data;\n })\n .catch(() => {\n sprites = null;\n });\n }\n\n function handleImgError() {\n if (imageUrl) {\n missingIconsCache.add(imageUrl);\n }\n\n loadIcon();\n }\n\n function loadIcon() {\n if (sprites !== undefined) {\n loadIcon2();\n } else {\n loadSprites();\n\n spritePromise?.then(loadIcon2);\n }\n }\n\n function loadIcon2() {\n do {\n index--;\n\n category = categories?.[index];\n\n spriteIcon = category ? sprites?.icons[category] : undefined;\n\n if (spriteIcon) {\n break;\n }\n\n imageUrl = category\n ? iconsBaseUrl + category.replace(/ /g, \"_\") + \".svg\"\n : undefined;\n } while (index > -1 && (!imageUrl || missingIconsCache.has(imageUrl)));\n }\n</script>\n\n<!-- svelte-ignore a11y-click-events-have-key-events -->\n<li\n tabindex=\"-1\"\n role=\"option\"\n aria-selected={style === \"selected\"}\n aria-checked={style === \"picked\"}\n class={style}\n on:mouseenter\n on:focus={() => dispatch(\"select\", undefined)}\n on:click={(ev) => {\n // this is to trigger the event if we click on focused item\n if (document.activeElement !== ev.target) {\n dispatch(\"select\", undefined);\n }\n }}\n>\n {#if sprites && spriteIcon}\n <div\n class=\"sprite-icon\"\n style={`\n width: ${spriteIcon.width / scaleFactor}px;\n height: ${spriteIcon.height / scaleFactor}px;\n background-image: url(${iconsBaseUrl}sprite${scaleUrl}.png);\n background-position: -${spriteIcon.x / scaleFactor}px -${spriteIcon.y / scaleFactor}px;\n background-size: ${sprites.width / scaleFactor}px ${sprites.height / scaleFactor}px;\n `}\n title={placeType}\n />\n {:else if imageUrl}\n <img\n src={imageUrl}\n alt={category}\n title={placeType}\n on:error={() => handleImgError()}\n />\n {:else if feature.address}\n <img\n src={iconsBaseUrl + \"housenumber.svg\"}\n alt={placeType}\n title={placeType}\n />\n {:else if feature.id.startsWith(\"road.\")}\n <img src={iconsBaseUrl + \"road.svg\"} alt={placeType} title={placeType} />\n {:else if feature.id.startsWith(\"address.\")}\n <img src={iconsBaseUrl + \"street.svg\"} alt={placeType} title={placeType} />\n {:else if feature.id.startsWith(\"postal_code.\")}\n <img\n src={iconsBaseUrl + \"postal_code.svg\"}\n alt={placeType}\n title={placeType}\n />\n {:else if feature.id.startsWith(\"poi.\")}\n <img src={iconsBaseUrl + \"poi.svg\"} alt={placeType} title={placeType} />\n {:else if isReverse}\n <img src={iconsBaseUrl + \"reverse.svg\"} alt={placeType} title={placeType} />\n {:else}\n <img src={iconsBaseUrl + \"area.svg\"} alt={placeType} title={placeType} />\n {/if}\n\n <span class=\"texts\">\n <span>\n <span class=\"primary\">\n {isReverse ? feature.place_name : feature.place_name.replace(/,.*/, \"\")}\n </span>\n\n {#if showPlaceType === \"always\" || (showPlaceType !== \"never\" && !feature.address && !feature.id.startsWith(\"road.\") && !feature.id.startsWith(\"address.\") && !feature.id.startsWith(\"postal_code.\") && (!feature.id.startsWith(\"poi.\") || !imageUrl) && !isReverse)}\n <span class=\"secondary\">\n {placeType}\n </span>\n {/if}\n </span>\n\n <span class=\"line2\">\n {isReverse ? \"\" : feature.place_name.replace(/[^,]*,?\\s*/, \"\")}\n </span>\n </span>\n</li>\n\n<style lang=\"scss\">\n .sprite-icon {\n align-self: center;\n justify-self: center;\n opacity: 0.75;\n background-repeat: no-repeat;\n }\n\n li {\n text-align: left;\n cursor: default;\n display: grid;\n grid-template-columns: 40px 1fr;\n color: var(--color-text);\n padding: 8px 0px;\n font-size: 14px;\n line-height: 18px;\n min-width: fit-content;\n outline: 0;\n\n &:first-child {\n padding-top: 10px;\n }\n\n &:last-child {\n padding-bottom: 10px;\n }\n\n &.picked {\n background-color: #e7edff;\n\n .secondary {\n color: #96a4c7;\n padding-left: 4px;\n }\n\n .line2 {\n color: #96a4c7;\n }\n }\n\n &.selected {\n background-color: #f3f6ff;\n\n & {\n animation: backAndForth 5s linear infinite;\n }\n\n & .primary {\n color: #2b8bfb;\n }\n\n .secondary {\n color: #a2adc7;\n padding-left: 4px;\n }\n\n .line2 {\n color: #a2adc7;\n }\n }\n\n & > img {\n align-self: center;\n justify-self: center;\n opacity: 0.75;\n }\n }\n\n .texts {\n padding: 0 17px 0 0;\n\n & > * {\n white-space: nowrap;\n display: block;\n min-width: fit-content;\n }\n }\n\n .primary {\n font-weight: 600;\n }\n\n .secondary {\n color: #aeb6c7;\n padding-left: 4px;\n }\n\n .line2 {\n color: #aeb6c7;\n }\n\n @keyframes backAndForth {\n 0% {\n transform: translateX(0);\n }\n 10% {\n transform: translateX(0);\n }\n 45% {\n transform: translateX(calc(-100% + 270px));\n }\n 55% {\n transform: translateX(calc(-100% + 270px));\n }\n 90% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(0);\n }\n }\n</style>\n","<div>\n <svg viewBox=\"0 0 18 18\" width=\"24\" height=\"24\">\n <path\n fill=\"#333\"\n 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\"\n />\n <path\n opacity=\".1\"\n 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\"\n />\n </svg>\n</div>\n\n<style>\n div {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n pointer-events: none;\n\n display: flex;\n align-items: center;\n }\n\n svg {\n animation: rotate 0.8s infinite cubic-bezier(0.45, 0.05, 0.55, 0.95);\n }\n\n @keyframes rotate {\n from {\n -webkit-transform: rotate(0);\n transform: rotate(0);\n }\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n</style>\n","<svg viewBox=\"0 0 60.006 21.412\" width=\"14\" height=\"20\">\n <path\n 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\"\n />\n</svg>\n\n<style>\n svg {\n display: block;\n fill: var(--color-icon-button);\n }\n</style>\n","<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"13\"\n height=\"13\"\n viewBox=\"0 0 13 13\"\n>\n <circle cx=\"4.789\" cy=\"4.787\" r=\"3.85\" />\n <path d=\"M12.063 12.063 7.635 7.635\" />\n</svg>\n\n<style>\n circle {\n stroke-width: 1.875;\n fill: none;\n }\n\n path {\n stroke-width: 1.875;\n stroke-linecap: round;\n }\n\n svg {\n display: block;\n stroke: var(--color-icon-button);\n }\n</style>\n","import type { BBox } from \"./types\";\n\n// taken from Leaflet\nexport function wrapNum(\n x: number,\n range: [number, number],\n includeMax: boolean,\n) {\n const max = range[1],\n min = range[0],\n d = max - min;\n\n return x === max && includeMax ? x : ((((x - min) % d) + d) % d) + min;\n}\n\nexport function unwrapBbox(bbox0: BBox): BBox {\n const bbox = [...bbox0] satisfies BBox;\n\n if (bbox[2] < bbox[0]) {\n if (\n Math.abs((bbox[0] + bbox[2] + 360) / 2) >\n Math.abs((bbox[0] - 360 + bbox[2]) / 2)\n ) {\n bbox[0] -= 360;\n } else {\n bbox[2] += 360;\n }\n }\n\n return bbox;\n}\n","import type { MapController, ProximityRule } from \"./types\";\n\nlet cachedLocation: { time: number; coords: undefined | string } | undefined;\n\nexport async function getProximity(\n mapController: MapController | undefined,\n proximity: ProximityRule[] | null | undefined,\n ac: AbortController,\n) {\n const centerAndZoom = mapController?.getCenterAndZoom();\n\n for (const rule of proximity ?? []) {\n if (\n centerAndZoom &&\n ((rule.minZoom != undefined && rule.minZoom > centerAndZoom[0]) ||\n (rule.maxZoom != undefined && rule.maxZoom < centerAndZoom[0]))\n ) {\n continue;\n }\n\n if (rule.type === \"fixed\") {\n return rule.coordinates.join(\",\");\n }\n\n cg: if (rule.type === \"client-geolocation\") {\n if (\n cachedLocation &&\n rule.cachedLocationExpiry &&\n cachedLocation.time + rule.cachedLocationExpiry > Date.now()\n ) {\n if (!cachedLocation.coords) {\n break cg;\n }\n\n return cachedLocation.coords;\n }\n\n let coords: string | undefined;\n\n try {\n coords = await new Promise<string>((resolve, reject) => {\n ac.signal.addEventListener(\"abort\", () => {\n reject(Error(\"aborted\"));\n });\n\n navigator.geolocation.getCurrentPosition(\n (pos) => {\n resolve(\n [pos.coords.longitude, pos.coords.latitude]\n .map((c) => c.toFixed(6))\n .join(\",\"),\n );\n },\n (err) => {\n reject(err);\n },\n rule,\n );\n });\n\n return coords;\n } catch {\n // ignore\n } finally {\n if (rule.cachedLocationExpiry) {\n cachedLocation = {\n time: Date.now(),\n coords,\n };\n }\n }\n\n if (ac.signal.aborted) {\n return;\n }\n }\n\n if (rule.type === \"server-geolocation\") {\n return \"ip\";\n }\n\n if (centerAndZoom && rule.type === \"map-center\") {\n return centerAndZoom[1].toFixed(6) + \",\" + centerAndZoom[2].toFixed(6);\n }\n }\n}\n","//Coordinates pattern matching regex\n//DM with invalid minutes (goes to coords_other); this is just a shortened version of that to create a guard condition\nconst dm_invalid = /^(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;\n//DM as numbers only - see issue #15\nconst dm_numbers = /^([+-]?[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,})$/;\n//decimal degrees\nconst dd_re = /^(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;\n//degrees minutes seconds with '.' as separator - gives array with 15 values\nconst dms_periods = /^(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;\n//degrees minutes seconds with words 'degrees, minutes, seconds' as separators (needed because the s of seconds messes with the S of SOUTH) - gives array of 17 values\nconst dms_abbr = /^(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;\n//everything else - gives array of 17 values \nconst coords_other = /^(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;\nexport { dm_invalid, dm_numbers, dd_re, dms_periods, dms_abbr, coords_other };\n","//borrowed from https://www.codegrepper.com/code-examples/javascript/javascript+converting+latitude+longitude+to+gps+coordinates\n/**\n * Converts decimalCoordinates to commonly used string formats\n * Note that this will add degree and direction symbols to decimal coordinates\n * @param {string} format Either DMS or DM\n * @returns {string}\n */\nfunction toCoordinateFormat(format) {\n if (!['DMS', 'DM', 'DD'].includes(format))\n throw new Error('invalid format specified');\n if (this.decimalCoordinates && this.decimalCoordinates.trim()) {\n const parts = this.decimalCoordinates.split(',').map(x => Number(x.trim()));\n const decimalLatitude = Number(parts[0]);\n const decimalLongitude = Number(parts[1]);\n const absoluteLatitude = Math.abs(decimalLatitude);\n const absoluteLongitude = Math.abs(decimalLongitude);\n const latDir = decimalLatitude > 0 ? \"N\" : \"S\";\n const longDir = decimalLongitude > 0 ? \"E\" : \"W\";\n let result;\n if (format == 'DD') {\n result = `${absoluteLatitude}° ${latDir}, ${absoluteLongitude}° ${longDir}`;\n }\n //else we need some more things\n const degreesLatitude = Math.floor(absoluteLatitude);\n const degreesLongitude = Math.floor(absoluteLongitude);\n const minutesLatitudeNotTruncated = (absoluteLatitude - degreesLatitude) * 60;\n const minutesLongitudeNotTruncated = (absoluteLongitude - degreesLongitude) * 60;\n if (format == 'DM') {\n let dmMinsLatitude = round(minutesLatitudeNotTruncated, 3).toFixed(3).padStart(6, '0');\n let dmMinsLongitude = round(minutesLongitudeNotTruncated, 3).toFixed(3).padStart(6, '0');\n if (dmMinsLatitude.endsWith('.000') && dmMinsLongitude.endsWith('.000')) {\n dmMinsLatitude = dmMinsLatitude.replace(/\\.000$/, '');\n dmMinsLongitude = dmMinsLongitude.replace(/\\.000$/, '');\n }\n result = `${degreesLatitude}° ${dmMinsLatitude}' ${latDir}, ${degreesLongitude}° ${dmMinsLongitude}' ${longDir}`;\n }\n if (format == \"DMS\") {\n const latMinutes = Math.floor(minutesLatitudeNotTruncated);\n const longMinutes = Math.floor(minutesLongitudeNotTruncated);\n let latSeconds = ((minutesLatitudeNotTruncated - latMinutes) * 60).toFixed(1).padStart(4, '0');\n let longSeconds = ((minutesLongitudeNotTruncated - longMinutes) * 60).toFixed(1).padStart(4, '0');\n const latMinutesString = latMinutes.toString().padStart(2, '0');\n const longMinutesString = longMinutes.toString().padStart(2, '0');\n // if they both end in .0 we drop the .0\n if (latSeconds.endsWith('.0') && longSeconds.endsWith('.0')) {\n latSeconds = latSeconds.replace(/\\.0$/, '');\n longSeconds = longSeconds.replace(/\\.0$/, '');\n }\n result = `${degreesLatitude}° ${latMinutesString}' ${latSeconds}\" ${latDir}, ${degreesLongitude}° ${longMinutesString}' ${longSeconds}\" ${longDir}`;\n }\n return result;\n }\n else {\n throw new Error('no decimal coordinates to convert');\n }\n}\nfunction round(num, places) {\n const d = Math.pow(10, places);\n return Math.round((num + Number.EPSILON) * d) / d;\n}\nexport default toCoordinateFormat;\n","//function for converting coordinates from a string to decimal and verbatim\n//this is just a comment\nimport { dm_invalid, dm_numbers, dd_re, dms_periods, dms_abbr, coords_other } from './regex.js';\nimport toCoordinateFormat from './toCoordinateFormat.js';\n/**\n * Function for converting coordinates in a variety of formats to decimal coordinates\n * @param {string} coordsString The coordinates string to convert\n * @param {number} [decimalPlaces] The number of decimal places for converted coordinates; default is 5\n * @returns {{verbatimCoordinates: string, decimalCoordinates: string, decimalLatitude: number, decimalLongitude: number, closeEnough: function(string): boolean, toCoordinateFormat: toCoordinateFormat}}\n */\nfunction converter(coordsString, decimalPlaces) {\n //TODO add exact match to entered string, so that it can be used to filter out superflous text around it\n if (!decimalPlaces) {\n decimalPlaces = 5;\n }\n coordsString = coordsString.replace(/\\s+/g, ' ').trim(); //just to tidy up whitespaces\n let ddLat = null;\n let ddLng = null;\n let latdir = \"\";\n let lngdir = \"\";\n let originalFormat = null;\n let match = [];\n let matchSuccess = false;\n if (dm_invalid.test(coordsString)) {\n throw new Error(\"invalid coordinate value\");\n }\n if (dm_numbers.test(coordsString)) {\n match = dm_numbers.exec(coordsString);\n matchSuccess = checkMatch(match);\n if (matchSuccess) {\n ddLat = Math.abs(match[1]) + match[2] / 60;\n if (Number(match[1]) < 0) {\n ddLat *= -1;\n }\n ddLng = Math.abs(match[3]) + match[4] / 60;\n if (Number(match[3]) < 0) {\n ddLng *= -1;\n }\n originalFormat = \"DM\";\n }\n else {\n throw new Error(\"invalid coordinate format\");\n }\n }\n else if (dd_re.test(coordsString)) {\n match = dd_re.exec(coordsString);\n matchSuccess = checkMatch(match);\n if (matchSuccess) {\n ddLat = match[2];\n ddLng = match[6];\n //need to fix if there are ','s instead of '.'\n if (ddLat.includes(',')) {\n ddLat = ddLat.replace(',', '.');\n }\n if (ddLng.includes(',')) {\n ddLng = ddLng.replace(',', '.');\n }\n originalFormat = \"DD\";\n //validation, we don't want things like 23.00000\n //some more validation: no zero coords or degrees only\n if (Number(Math.round(ddLat)) == Number(ddLat)) {\n throw new Error('integer only coordinate provided');\n }\n if (Number(Math.round(ddLng)) == Number(ddLng)) {\n throw new Error('integer only coordinate provided');\n }\n //get directions\n if (match[1]) {\n latdir = match[1];\n lngdir = match[5];\n }\n else if (match[4]) {\n latdir = match[4];\n lngdir = match[8];\n }\n }\n else {\n throw new Error(\"invalid decimal coordinate format\");\n }\n }\n else if (dms_periods.test(coordsString)) {\n match = dms_periods.exec(coordsString);\n matchSuccess = checkMatch(match);\n if (matchSuccess) {\n ddLat = Math.abs(parseInt(match[2]));\n if (match[4]) {\n ddLat += match[4] / 60;\n originalFormat = \"DM\";\n }\n if (match[6]) {\n ddLat += match[6].replace(',', '.') / 3600;\n originalFormat = \"DMS\";\n }\n if (parseInt(match[2]) < 0) {\n ddLat = -1 * ddLat;\n }\n ddLng = Math.abs(parseInt(match[9]));\n if (match[11]) {\n ddLng += match[11] / 60;\n }\n if (match[13]) {\n ddLng += match[13].replace(',', '.') / 3600;\n }\n if (parseInt(match[9]) < 0) {\n ddLng = -1 * ddLng;\n }\n //the compass directions\n if (match[1]) {\n latdir = match[1];\n lngdir = match[8];\n }\n else if (match[7]) {\n latdir = match[7];\n lngdir = match[14];\n }\n }\n else {\n throw new Error(\"invalid DMS coordinates format\");\n }\n }\n else if (dms_abbr.test(coordsString)) {\n match = dms_abbr.exec(coordsString);\n matchSuccess = checkMatch(match);\n if (matchSuccess) {\n ddLat = Math.abs(parseInt(match[2]));\n if (match[4]) {\n ddLat += match[4] / 60;\n originalFormat = \"DM\";\n }\n if (match[6]) {\n ddLat += match[6] / 3600;\n originalFormat = \"DMS\";\n }\n if (parseInt(match[2]) < 0) {\n ddLat = -1 * ddLat;\n }\n ddLng = Math.abs(parseInt(match[10]));\n if (match[12]) {\n ddLng += match[12] / 60;\n }\n if (match[14]) {\n ddLng += match[14] / 3600;\n }\n if (parseInt(match[10]) < 0) {\n ddLng = -1 * ddLng;\n }\n //the compass directions\n if (match[1]) {\n latdir = match[1];\n lngdir = match[9];\n }\n else if (match[8]) {\n latdir = match[8];\n lngdir = match[16];\n }\n }\n else {\n throw new Error(\"invalid DMS coordinates format\");\n }\n }\n else if (coords_other.test(coordsString)) {\n match = coords_other.exec(coordsString);\n matchSuccess = checkMatch(match);\n // we need an extra check here for things that matched that shouldn't have\n if (match.filter(x => x).length <= 5) {\n throw new Error(\"invalid coordinates format\");\n }\n if (matchSuccess) {\n ddLat = Math.abs(parseInt(match[2]));\n if (match[4]) {\n ddLat += match[4].replace(',', '.') / 60;\n originalFormat = \"DM\";\n }\n if (match[6]) {\n ddLat += match[6].replace(',', '.') / 3600;\n originalFormat = \"DMS\";\n }\n if (parseInt(match[2]) < 0) {\n ddLat = -1 * ddLat;\n }\n ddLng = Math.abs(parseInt(match[10]));\n if (match[12]) {\n ddLng += match[12].replace(',', '.') / 60;\n }\n if (match[14]) {\n ddLng += match[14].replace(',', '.') / 3600;\n }\n if (parseInt(match[10]) < 0) {\n ddLng = -1 * ddLng;\n }\n //the compass directions\n if (match[1]) {\n latdir = match[1];\n lngdir = match[9];\n }\n else if (match[8]) {\n latdir = match[8];\n lngdir = match[16];\n }\n }\n else {\n throw new Error(\"invalid coordinates format\");\n }\n }\n if (matchSuccess) {\n //more validation....\n //check longitude value - it can be wrong!\n if (Math.abs(ddLng) >= 180) {\n throw new Error(\"invalid longitude value\");\n }\n //just to be safe check latitude also...\n if (Math.abs(ddLat) >= 90) {\n throw new Error(\"invalid latitude value\");\n }\n //if we have one direction we must have the other\n if ((latdir && !lngdir) || (!latdir && lngdir)) {\n throw new Error(\"invalid coordinates value\");\n }\n //the directions can't be the same\n if (latdir && latdir == lngdir) {\n throw new Error(\"invalid coordinates format\");\n }\n // a bit of tidying up...\n if (ddLat.toString().includes(',')) {\n ddLat = ddLat.replace(',', '.');\n }\n if (ddLng.toString().includes(',')) {\n ddLng = ddLng.replace(',', '.');\n }\n //make sure the signs and cardinal directions match\n let patt = /S|SOUTH/i;\n if (patt.test(latdir)) {\n if (ddLat > 0) {\n ddLat = -1 * ddLat;\n }\n }\n patt = /W|WEST/i;\n if (patt.test(lngdir)) {\n if (ddLng > 0) {\n ddLng = -1 * ddLng;\n }\n }\n //we need to get the verbatim coords from the string\n //we can't split down the middle because if there are decimals they may have different numbers on each side\n //so we need to find the separating character, or if none, use the match values to split down the middle\n const verbatimCoordinates = match[0].trim();\n let verbatimLat;\n let verbatimLng;\n const sepChars = /[,/;\\u0020]/g; //comma, forward slash and spacebar\n const seps = verbatimCoordinates.match(sepChars);\n if (seps == null) {\n //split down the middle\n const middle = Math.floor(coordsString.length / 2);\n verbatimLat = verbatimCoordinates.substring(0, middle).trim();\n verbatimLng = verbatimCoordinates.substring(middle).trim();\n }\n else { //if length is odd then find the index of the middle value\n //get the middle index\n let middle;\n //easy for odd numbers\n if (seps.length % 2 == 1) {\n middle = Math.floor(seps.length / 2);\n }\n else {\n middle = (seps.length / 2) - 1;\n }\n //walk through seps until we get to the middle\n let splitIndex = 0;\n //it might be only one value\n if (middle == 0) {\n splitIndex = verbatimCoordinates.indexOf(seps[0]);\n verbatimLat = verbatimCoordinates.substring(0, splitIndex).trim();\n verbatimLng = verbatimCoordinates.substring(splitIndex + 1).trim();\n }\n else {\n let currSepIndex = 0;\n let startSearchIndex = 0;\n while (currSepIndex <= middle) {\n splitIndex = verbatimCoordinates.indexOf(seps[currSepIndex], startSearchIndex);\n startSearchIndex = splitIndex + 1;\n currSepIndex++;\n }\n verbatimLat = verbatimCoordinates.substring(0, splitIndex).trim();\n verbatimLng = verbatimCoordinates.substring(splitIndex + 1).trim();\n }\n }\n //validation again...\n //we only allow zeros after the period if its DM\n const splitLat = verbatimLat.split('.');\n if (splitLat.length == 2) {\n if (splitLat[1] == 0 && splitLat[1].length != 2) {\n throw new Error('invalid coordinates format');\n }\n }\n const splitLon = verbatimLng.split('.');\n if (splitLon.length == 2) {\n if (splitLon[1] == 0 && splitLon[1].length != 2) {\n throw new Error('invalid coordinates format');\n }\n }\n //no integer coords allowed\n if (/^\\d+$/.test(verbatimLat) || /^\\d+$/.test(verbatimLng)) {\n throw new Error('degree only coordinate/s provided');\n }\n //all done!!\n //just truncate the decimals appropriately\n ddLat = Number(Number(ddLat).toFixed(decimalPlaces));\n ddLng = Number(Number(ddLng).toFixed(decimalPlaces));\n return Object.freeze({\n verbatimCoordinates,\n verbatimLatitude: verbatimLat,\n verbatimLongitude: verbatimLng,\n decimalLatitude: ddLat,\n decimalLongitude: ddLng,\n decimalCoordinates: `${ddLat},${ddLng}`,\n originalFormat,\n closeEnough: coordsCloseEnough,\n toCoordinateFormat\n });\n }\n else {\n throw new Error(\"coordinates pattern match failed\");\n }\n}\nfunction checkMatch(match) {\n if (!isNaN(match[0])) { //we've matched a number, not what we want....\n return false;\n }\n //first remove the empty values from the array\n const filteredMatch = [...match];\n //we need to shift the array because it contains the whole coordinates string in the first item\n filteredMatch.shift();\n //check the array length is an even number\n if (filteredMatch.length % 2 > 0) {\n return false;\n }\n // regex for testing corresponding values match\n const numerictest = /^[-+]?\\d+([\\.,]\\d+)?$/; //for testing numeric values\n const stringtest = /[eastsouthnorthwest]+/i; //for testing string values (north, south, etc)\n const halflen = filteredMatch.length / 2;\n for (let i = 0; i < halflen; i++) {\n const leftside = filteredMatch[i];\n const rightside = filteredMatch[i + halflen];\n const bothAreNumbers = numerictest.test(leftside) && numerictest.test(rightside);\n const bothAreStrings = stringtest.test(leftside) && stringtest.test(rightside);\n const valuesAreEqual = leftside == rightside;\n if (leftside == undefined && rightside == undefined) { //we have to handle undefined because regex converts it to string 'undefined'!!\n continue;\n }\n else if (leftside == undefined || rightside == undefined) { //no we need to handle the case where one is and the other not...\n return false;\n }\n else if (bothAreNumbers || bothAreStrings || valuesAreEqual) {\n continue;\n }\n else {\n return false;\n }\n }\n return true;\n}\n//functions for coordinate validation\n//as decimal arithmetic is not straightforward, we approximate\nfunction decimalsCloseEnough(dec1, dec2) {\n const originaldiff = Math.abs(dec1 - dec2);\n const diff = Number(originaldiff.toFixed(6));\n if (diff <= 0.00001) {\n return true;\n }\n else {\n return false;\n }\n}\nfunction coordsCloseEnough(coordsToTest) {\n if (!coordsToTest) {\n throw new Error('coords must be provided');\n }\n if (coordsToTest.includes(',')) {\n const coords = coordsToTest.split(',');\n if (Number(coords[0]) == NaN || Number(coords[1]) == NaN) {\n throw new Error(\"coords are not valid decimals\");\n }\n else {\n return decimalsCloseEnough(this.decimalLatitude, Number(coords[0])) && decimalsCloseEnough(this.decimalLongitude, coords[1]); //this here will be the converted coordinates object\n }\n }\n else {\n throw new Error(\"coords being tested must be separated by a comma\");\n }\n}\n// An enum for coordinates formats\nconst to = Object.freeze({\n DMS: 'DMS',\n DM: 'DM',\n DD: 'DD'\n});\nconverter.to = to;\nexport default converter;\n","//return an array of coordinate strings for testing\n//coordinations-parser formats\n//https://www.npmjs.com/package/coordinate-parser\nconst coordsParserFormats = [\n {\n verbatimCoordinates: '40.123, -74.123',\n verbatimLatitude: '40.123',\n verbatimLongitude: '-74.123'\n },\n {\n verbatimCoordinates: '40.123° N 74.123° W',\n verbatimLatitude: '40.123° N',\n verbatimLongitude: '74.123° W'\n },\n {\n verbatimCoordinates: '40.123° N 74.123° W',\n verbatimLatitude: '40.123° N',\n verbatimLongitude: '74.123° W'\n },\n {\n verbatimCoordinates: '40° 7´ 22.8\" N 74° 7´ 22.8\" W',\n verbatimLatitude: '40° 7´ 22.8\" N',\n verbatimLongitude: '74° 7´ 22.8\" W'\n },\n {\n verbatimCoordinates: '40° 7.38’ , -74° 7.38’',\n verbatimLatitude: '40° 7.38’',\n verbatimLongitude: '-74° 7.38’'\n },\n {\n verbatimCoordinates: 'N40°7’22.8’’, W74°7’22.8’’',\n verbatimLatitude: 'N40°7’22.8’’',\n verbatimLongitude: 'W74°7’22.8’’'\n },\n {\n verbatimCoordinates: '40°7’22.8\"N, 74°7’22.8\"W',\n verbatimLatitude: '40°7’22.8\"N',\n verbatimLongitude: '74°7’22.8\"W'\n },\n {\n verbatimCoordinates: '40°7\\'22.8\"N, 74°7\\'22.8\"W',\n verbatimLatitude: '40°7\\'22.8\"N',\n verbatimLongitude: '74°7\\'22.8\"W'\n },\n {\n verbatimCoordinates: '40 7 22.8, -74 7 22.8',\n verbatimLatitude: '40 7 22.8',\n verbatimLongitude: '-74 7 22.8'\n },\n {\n verbatimCoordinates: '40.123 -74.123',\n verbatimLatitude: '40.123',\n verbatimLongitude: '-74.123'\n },\n {\n verbatimCoordinates: '40.123°,-74.123°',\n verbatimLatitude: '40.123°',\n verbatimLongitude: '-74.123°'\n },\n {\n verbatimCoordinates: '40.123N74.123W',\n verbatimLatitude: '40.123N',\n verbatimLongitude: '74.123W'\n },\n {\n verbatimCoordinates: '4007.38N7407.38W',\n verbatimLatitude: '4007.38N',\n verbatimLongitude: '7407.38W'\n },\n {\n verbatimCoordinates: '40°7’22.8\"N, 74°7’22.8\"W',\n verbatimLatitude: '40°7’22.8\"N',\n verbatimLongitude: '74°7’22.8\"W'\n },\n {\n verbatimCoordinates: '400722.8N740722.8W',\n verbatimLatitude: '400722.8N',\n verbatimLongitude: '740722.8W'\n },\n {\n verbatimCoordinates: 'N 40 7.38 W 74 7.38',\n verbatimLatitude: 'N 40 7.38',\n verbatimLongitude: 'W 74 7.38'\n },\n {\n verbatimCoordinates: '40:7:22.8N 74:7:22.8W',\n verbatimLatitude: '40:7:22.8N',\n verbatimLongitude: '74:7:22.8W'\n },\n {\n verbatimCoordinates: '40:7:23N,74:7:23W',\n verbatimLatitude: '40:7:23N',\n verbatimLongitude: '74:7:23W',\n decimalLatitude: 40.1230555555,\n decimalLongitude: -74.1230555555\n },\n {\n verbatimCoordinates: '40°7’23\"N 74°7’23\"W',\n verbatimLatitude: '40°7’23\"N',\n verbatimLongitude: '74°7’23\"W',\n decimalLatitude: 40.1230555555,\n decimalLongitude: -74.12305555555555\n },\n {\n verbatimCoordinates: '40°7’23\"S 74°7’23\"E',\n verbatimLatitude: '40°7’23\"S',\n verbatimLongitude: '74°7’23\"E',\n decimalLatitude: -40.1230555555,\n decimalLongitude: 74.12305555555555\n },\n {\n verbatimCoordinates: '40°7’23\" -74°7’23\"',\n verbatimLatitude: '40°7’23\"',\n verbatimLongitude: '-74°7’23\"',\n decimalLatitude: 40.1230555555,\n decimalLongitude: -74.123055555\n },\n {\n verbatimCoordinates: '40d 7’ 23\" N 74d 7’ 23\" W',\n verbatimLatitude: '40d 7’ 23\" N',\n verbatimLongitude: '74d 7’ 23\" W',\n decimalLatitude: 40.1230555555,\n decimalLongitude: -74.123055555\n },\n {\n verbatimCoordinates: '40.123N 74.123W',\n verbatimLatitude: '40.123N',\n verbatimLongitude: '74.123W'\n },\n {\n verbatimCoordinates: '40° 7.38, -74° 7.38',\n verbatimLatitude: '40° 7.38',\n verbatimLongitude: '-74° 7.38'\n },\n {\n verbatimCoordinates: '40° 7.38, -74° 7.38',\n verbatimLatitude: '40° 7.38',\n verbatimLongitude: '-74° 7.38'\n },\n {\n verbatimCoordinates: '40 7 22.8; -74 7 22.8',\n verbatimLatitude: '40 7 22.8',\n verbatimLongitude: '-74 7 22.8'\n }\n];\nconst coordsParserDecimals = {\n decimalLatitude: 40.123,\n decimalLongitude: -74.123\n};\n//formats from https://gist.github.com/moole/3707127/337bd31d813a10abcf55084381803e5bbb0b20dc \nconst coordsRegexFormats = [\n {\n verbatimCoordinates: '50°4\\'17.698\"south, 14°24\\'2.826\"east',\n verbatimLatitude: '50°4\\'17.698\"south',\n verbatimLongitude: '14°24\\'2.826\"east',\n decimalLatitude: -50.0715827777777778,\n decimalLongitude: 14.400785\n },\n {\n verbatimCoordinates: '50d4m17.698S 14d24m2.826E',\n verbatimLatitude: '50d4m17.698S',\n verbatimLongitude: '14d24m2.826E',\n decimalLatitude: -50.0715827777777778,\n decimalLongitude: 14.400785\n },\n {\n verbatimCoordinates: '40:26:46N,79:56:55W',\n verbatimLatitude: '40:26:46N',\n verbatimLongitude: '79:56:55W',\n decimalLatitude: 40.4461111111111111,\n decimalLongitude: -79.9486111111111111\n },\n {\n verbatimCoordinates: '40:26:46.302N 79:56:55.903W',\n verbatimLatitude: '40:26:46.302N',\n verbatimLongitude: '79:56:55.903W',\n decimalLatitude: 40.446195,\n decimalLongitude: -79.9488619444444444\n },\n {\n verbatimCoordinates: '40°26′47″N 79°58′36″W',\n verbatimLatitude: '40°26′47″N',\n verbatimLongitude: '79°58′36″W',\n decimalLatitude: 40.4463888888888889,\n decimalLongitude: -79.9766666666666667\n },\n {\n verbatimCoordinates: '40d 26′ 47″ N 79d 58′ 36″ W',\n verbatimLatitude: '40d 26′ 47″ N',\n verbatimLongitude: '79d 58′ 36″ W',\n decimalLatitude: 40.4463888888888889,\n decimalLongitude: -79.9766666666666667\n },\n {\n verbatimCoordinates: '40.446195N 79.948862W',\n verbatimLatitude: '40.446195N',\n verbatimLongitude: '79.948862W',\n decimalLatitude: 40.446195,\n decimalLongitude: -79.948862\n },\n {\n verbatimCoordinates: '40,446195° 79,948862°',\n verbatimLatitude: '40,446195°',\n verbatimLongitude: '79,948862°',\n decimalLatitude: 40.446195,\n decimalLongitude: 79.948862\n },\n {\n verbatimCoordinates: '40° 26.7717, -79° 56.93172',\n verbatimLatitude: '40° 26.7717',\n verbatimLongitude: '-79° 56.93172',\n decimalLatitude: 40.446195,\n decimalLongitude: -79.948862\n },\n {\n verbatimCoordinates: '40.446195, -79.948862',\n verbatimLatitude: '40.446195',\n verbatimLongitude: '-79.948862',\n decimalLatitude: 40.446195,\n decimalLongitude: -79.948862\n },\n {\n verbatimCoordinates: '40.123256; -74.123256',\n verbatimLatitude: '40.123256',\n verbatimLongitude: '-74.123256',\n decimalLatitude: 40.123256,\n decimalLongitude: -74.123256\n },\n {\n verbatimCoordinates: '18°24S 22°45E',\n verbatimLatitude: '18°24S',\n verbatimLongitude: '22°45E',\n decimalLatitude: -18.4,\n decimalLongitude: 22.75\n }\n];\n// additional formats we've encountered\nconst otherFormats = [\n {\n verbatimCoordinates: '10.432342S 10.6345345E',\n verbatimLatitude: '10.432342S',\n verbatimLongitude: '10.6345345E',\n decimalLatitude: -10.432342,\n decimalLongitude: 10.6345345\n },\n {\n verbatimCoordinates: '10.00S 10.00E',\n verbatimLatitude: '10.00S',\n verbatimLongitude: '10.00E',\n decimalLatitude: -10.00000,\n decimalLongitude: 10.00000\n },\n {\n verbatimCoordinates: '00.00S 01.00E',\n verbatimLatitude: '00.00S',\n verbatimLongitude: '01.00E',\n decimalLatitude: 0.00000,\n decimalLongitude: 1.00000\n },\n {\n verbatimCoordinates: '18.24S 22.45E',\n verbatimLatitude: '18.24S',\n verbatimLongitude: '22.45E',\n decimalLatitude: -18.4,\n decimalLongitude: 22.75\n },\n {\n verbatimCoordinates: '27deg 15min 45.2sec S 18deg 32min 53.7sec E',\n verbatimLatitude: '27deg 15min 45.2sec S',\n verbatimLongitude: '18deg 32min 53.7sec E',\n decimalLatitude: -27.2625555555555556,\n decimalLongitude: 18.54825\n },\n {\n verbatimCoordinates: '-23.3245° S / 28.2344° E',\n verbatimLatitude: '-23.3245° S',\n verbatimLongitude: '28.2344° E',\n decimalLatitude: -23.3245,\n decimalLongitude: 28.2344\n },\n {\n verbatimCoordinates: '40° 26.7717 -79° 56.93172',\n verbatimLatitude: '40° 26.7717',\n verbatimLongitude: '-79° 56.93172',\n decimalLatitude: 40.446195,\n decimalLongitude: -79.948862\n },\n {\n verbatimCoordinates: '27.15.45S 18.32.53E',\n verbatimLatitude: '27.15.45S',\n verbatimLongitude: '18.32.53E',\n decimalLatitude: -27.2625,\n decimalLongitude: 18.548055\n },\n {\n verbatimCoordinates: '-27.15.45 18.32.53',\n verbatimLatitude: '-27.15.45',\n verbatimLongitude: '18.32.53',\n decimalLatitude: -27.2625,\n decimalLongitude: 18.548055\n },\n {\n verbatimCoordinates: '27.15.45.2S 18.32.53.4E',\n verbatimLatitude: '27.15.45.2S',\n verbatimLongitude: '18.32.53.4E',\n decimalLatitude: -27.262556,\n decimalLongitude: 18.548167\n },\n {\n verbatimCoordinates: '27.15.45,2S 18.32.53,4E',\n verbatimLatitude: '27.15.45,2S',\n verbatimLongitude: '18.32.53,4E',\n decimalLatitude: -27.262556,\n decimalLongitude: 18.548167\n },\n {\n verbatimCoordinates: 'S23.43563 ° E22.45634 °',\n verbatimLatitude: 'S23.43563 °',\n verbatimLongitude: 'E22.45634 °',\n decimalLatitude: -23.43563,\n decimalLongitude: 22.45634\n },\n {\n verbatimCoordinates: '27,71372° S 23,07771° E',\n verbatimLatitude: '27,71372° S',\n verbatimLongitude: '23,07771° E',\n decimalLatitude: -27.71372,\n decimalLongitude: 23.07771\n },\n {\n verbatimCoordinates: '27.45.34 S 23.23.23 E',\n verbatimLatitude: '27.45.34 S',\n verbatimLongitude: '23.23.23 E',\n decimalLatitude: -27.759444,\n decimalLongitude: 23.38972222\n },\n {\n verbatimCoordinates: 'S 27.45.34 E 23.23.23',\n verbatimLatitude: 'S 27.45.34',\n verbatimLongitude: 'E 23.23.23',\n decimalLatitude: -27.759444,\n decimalLongitude: 23.38972222\n },\n {\n verbatimCoordinates: '53 16.3863,4 52.8171',\n verbatimLatitude: '53 16.3863',\n verbatimLongitude: '4 52.8171',\n decimalLatitude: 53.273105,\n decimalLongitude: 4.88029\n },\n {\n verbatimCoordinates: '50 8.2914,-5 2.4447',\n verbatimLatitude: '50 8.2914',\n verbatimLongitude: '-5 2.4447',\n decimalLatitude: 50.13819,\n decimalLongitude: -5.040745\n },\n {\n verbatimCoordinates: `N 48° 30,6410', E 18° 57,4583'`,\n verbatimLatitude: `N 48° 30,6410'`,\n verbatimLongitude: `E 18° 57,4583'`,\n decimalLatitude: 48.51068,\n decimalLongitude: 18.95764\n },\n {\n verbatimCoordinates: `1.23456, 18.33453`,\n verbatimLatitude: `1.23456`,\n verbatimLongitude: `18.33453`,\n decimalLatitude: 1.23456,\n decimalLongitude: 18.33453\n }\n];\nfunction getAllTestFormats() {\n const arr1 = [];\n coordsParserFormats.forEach(item => {\n if (item.decimalLatitude) {\n arr1.push(item);\n }\n else {\n arr1.push({ ...item, ...coordsParserDecimals });\n }\n });\n return [...arr1, ...coordsRegexFormats, ...otherFormats];\n}\nexport default getAllTestFormats();\n","//adds the formats to the convert object\n//we need to use this as the source for the npm package so that the formats are not included in the bundle\nimport converter from './converter.js';\nimport testFormats from './tests/testformats.js';\nconverter.formats = testFormats.map(format => format.verbatimCoordinates);\nexport const convert = converter;\n","<script lang=\"ts\">\n import { createEventDispatcher, onDestroy } from \"svelte\";\n import { default as ClearIcon } from \"./ClearIcon.svelte\";\n import { default as FailIcon } from \"./FailIcon.svelte\";\n import { default as FeatureItem } from \"./FeatureItem.svelte\";\n import { default as LoadingIcon } from \"./LoadingIcon.svelte\";\n import MarkerIcon from \"./MarkerIcon.svelte\";\n import { default as ReverseGeocodingIcon } from \"./ReverseGeocodingIcon.svelte\";\n import { default as SearchIcon } from \"./SearchIcon.svelte\";\n import { unwrapBbox, wrapNum } from \"./geoUtils\";\n import { getProximity } from \"./proximity\";\n import { convert } from \"geo-coordinates-parser\";\n import type {\n BBox,\n DispatcherType,\n EnableReverse,\n Feature,\n FeatureCollection,\n MapController,\n PickedResultStyle,\n ProximityRule,\n ShowPlaceType,\n TypeRule,\n } from \"./types\";\n\n export const ZOOM_DEFAULTS: Record<string, number> = {\n continental_marine: 4,\n country: 4,\n major_landform: 8,\n region: 5,\n subregion: 6,\n county: 7,\n joint_municipality: 8,\n joint_submunicipality: 9,\n municipality: 10,\n municipal_district: 11,\n locality: 12,\n neighbourhood: 13,\n place: 14,\n postal_code: 14,\n road: 16,\n poi: 17,\n address: 18,\n \"poi.peak\": 15,\n \"poi.shop\": 18,\n \"poi.cafe\": 18,\n \"poi.restaurant\": 18,\n \"poi.aerodrome\": 13,\n // TODO add many more\n };\n\n let className: string | undefined = undefined;\n\n export { className as class };\n\n export let apiKey: string;\n\n export let bbox: BBox | undefined = undefined;\n\n export let clearButtonTitle = \"clear\";\n\n export let clearOnBlur = false;\n\n export let clearListOnPick = false;\n\n export let keepListOpen = false;\n\n export let collapsed = false;\n\n export let country: string | string[] | undefined = undefined;\n\n export let debounceSearch = 200;\n\n export let enableReverse: EnableReverse = \"never\";\n\n export let errorMessage = \"Something went wrong…\";\n\n export let filter: (feature: Feature) => boolean = () => true;\n\n export let flyTo = true;\n\n export let fuzzyMatch = true;\n\n export let language: string | string[] | null | undefined = undefined;\n\n export let limit: number | undefined = undefined;\n\n const COPY_LIMIT = +41415112612;\n\n export let reverseGeocodingLimit: number | undefined = COPY_LIMIT;\n\n export let mapController: MapController | undefined = undefined;\n\n export let minLength = 2;\n\n export let noResultsMessage =\n \"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!\";\n\n export let placeholder = \"Search\";\n\n export let proximity: ProximityRule[] | null | undefined = [\n { type: \"server-geolocation\" },\n ];\n\n export let reverseActive = enableReverse === \"always\";\n\n export let reverseButtonTitle = \"toggle reverse geocoding\";\n\n export let searchValue = \"\";\n\n export let pickedResultStyle: PickedResultStyle = \"full-geometry\";\n\n export let showPlaceType: ShowPlaceType = \"if-needed\";\n\n export let showResultsWhileTyping = true;\n\n export let autocompleteTimeout: number | undefined = undefined;\n\n export let selectFirst = true;\n\n export let flyToSelected = false;\n\n export let markerOnSelected = true;\n\n export let types: TypeRule[] | undefined = undefined;\n\n const COPY_TYPES: TypeRule[] = [];\n\n export let reverseGeocodingTypes: TypeRule[] | undefined = COPY_TYPES;\n\n export let exhaustiveReverseGeocoding = false;\n\n export let excludeTypes = false;\n\n const COPY_EXCLUDE_TYPES = undefined;\n\n export let reverseGeocodingExcludeTypes: boolean | undefined =\n COPY_EXCLUDE_TYPES;\n\n export let zoom: Record<string, number> = ZOOM_DEFAULTS;\n\n export let apiUrl: string = import.meta.env.VITE_API_URL;\n\n export let fetchParameters: RequestInit = {};\n\n export let iconsBaseUrl =\n \"https://cdn.maptiler.com/maptiler-geocoding-control/v\" +\n import.meta.env.VITE_LIB_VERSION +\n \"/icons/\";\n\n /**\n * @deprecated use `adjustUrl`\n */\n export let adjustUrlQuery: (sp: URLSearchParams) => void = () => {};\n\n /**\n * Adjust geocoding URL before the fetch.\n */\n export let adjustUrl: (url: URL) => void = () => {};\n\n /**\n * Focus the search input box.\n *\n * @param options [FocusOptions](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)\n */\n export function focus(options?: FocusOptions) {\n input.focus(options);\n }\n\n /**\n * Blur the search input box.\n */\n export function blur() {\n input.blur();\n }\n\n /**\n * Set the content of search input box.\n *\n * @param value text to set\n * @param submit perform the search\n */\n export function setQuery(value: string, submit = true, reverse = false) {\n searchValue = value;\n\n if (submit) {\n selectedItemIndex = -1;\n\n handleSubmit();\n } else {\n handleInput(undefined, !reverse, reverse);\n\n setTimeout(() => {\n input.focus();\n input.select();\n });\n }\n }\n\n /**\n * Clear search result list.\n */\n export function clearList() {\n listFeatures = undefined;\n picked = undefined;\n selectedItemIndex = -1;\n }\n\n /**\n * Clear geocoding search results from the map.\n */\n export function clearMap() {\n markedFeatures = [];\n picked = undefined;\n }\n\n let listFeatures: Feature[] | undefined;\n\n let markedFeatures: Feature[] | undefined;\n\n let picked: Feature | undefined;\n\n let lastSearchUrl = \"\";\n\n let input: HTMLInputElement;\n\n let selectedItemIndex = -1;\n\n let error: unknown;\n\n let cachedFeatures: Feature[] = [];\n\n let abortController: AbortController | undefined;\n\n let searchTimeoutRef: number | undefined;\n\n let autocompleteTimeoutRef: number | undefined;\n\n let focusedDelayed: boolean;\n\n let prevIdToFly: string | undefined;\n\n let focused = false;\n\n const missingIconsCache = new Set<string>();\n\n const dispatch = createEventDispatcher<DispatcherType>();\n\n $: reverseActive = enableReverse === \"always\";\n\n $: if (\n pickedResultStyle !== \"marker-only\" &&\n picked &&\n !picked.address &&\n picked.geometry.type === \"Point\" &&\n picked.place_type[0] !== \"reverse\"\n ) {\n search(picked.id, { byId: true }).catch((err) => (error = err));\n }\n\n $: {\n if (mapController && picked && picked.id !== prevIdToFly && flyTo) {\n goToPicked();\n\n if (clearListOnPick) {\n listFeatures = undefined;\n }\n\n markedFeatures = undefined;\n selectedItemIndex = -1;\n }\n\n prevIdToFly = picked?.id;\n }\n\n $: if (mapController && selected && flyTo && flyToSelected) {\n mapController.flyTo(selected.center, computeZoom(selected));\n }\n\n $: showPolygonMarker =\n pickedResultStyle === \"full-geometry-including-polygon-center-marker\";\n\n // if markerOnSelected was dynamically changed to false\n $: if (!markerOnSelected) {\n mapController?.setFeatures(undefined, undefined, showPolygonMarker);\n }\n\n $: if (mapController && markerOnSelected && !markedFeatures) {\n mapController.setFeatures(\n selected ? [selected] : undefined,\n picked,\n showPolygonMarker,\n );\n\n mapController.setSelectedMarker(selected ? 0 : -1);\n }\n\n $: if (markedFeatures !== listFeatures) {\n markedFeatures = undefined;\n }\n\n $: if (mapController) {\n mapController.setFeatures(markedFeatures, picked, showPolygonMarker);\n }\n\n $: if (searchValue.length < minLength) {\n listFeatures = undefined;\n error = undefined;\n markedFeatures = listFeatures;\n }\n\n // highlight selected marker\n $: if (markedFeatures && mapController) {\n mapController.setSelectedMarker(selectedItemIndex);\n }\n\n // close dropdown in the next cycle so that the selected item event has the chance to fire\n $: setTimeout(() => {\n focusedDelayed = focused;\n\n if (clearOnBlur && !focusedDelayed) {\n searchValue = \"\";\n }\n });\n\n function isInAutocompleteTimeout() {\n return !!autocompleteTimeoutRef;\n }\n\n $: if (selectFirst && listFeatures?.length) {\n if (!isInAutocompleteTimeout()) {\n selectedItemIndex = 0;\n }\n }\n\n $: if (\n selectFirst &&\n listFeatures?.length &&\n selectedItemIndex == -1 &&\n !picked\n ) {\n selectedItemIndex = 0;\n }\n\n $: selected = listFeatures?.[selectedItemIndex];\n\n $: if (selected) {\n window.clearTimeout(autocompleteTimeoutRef);\n\n autocompleteTimeoutRef = undefined;\n }\n\n $: if (mapController) {\n const coords = isQueryReverse(searchValue);\n\n mapController.setReverseMarker(\n coords ? [coords.decimalLongitude, coords.decimalLatitude] : undefined,\n );\n }\n\n $: dispatch(\"select\", { feature: selected });\n\n $: dispatch(\"pick\", { feature: picked });\n\n $: optionsVisible =\n !!listFeatures?.length && (focusedDelayed || keepListOpen);\n\n $: dispatch(\"optionsvisibilitychange\", { optionsVisible });\n\n $: dispatch(\"featureslisted\", { features: listFeatures });\n\n $: dispatch(\"featuresmarked\", { features: markedFeatures });\n\n $: dispatch(\"reversetoggle\", { reverse: reverseActive });\n\n $: dispatch(\"querychange\", { query: searchValue });\n\n $: if (mapController) {\n mapController.indicateReverse(reverseActive);\n }\n\n $: if (mapController) {\n mapController.setEventHandler((e) => {\n switch (e.type) {\n case \"mapClick\":\n if (reverseActive) {\n handleReverse(e.coordinates);\n }\n\n break;\n case \"markerClick\":\n {\n const feature = listFeatures?.find(\n (feature) => feature.id === e.id,\n );\n\n if (feature) {\n pick(feature);\n }\n }\n\n break;\n case \"markerMouseEnter\":\n if (markedFeatures) {\n selectedItemIndex = !focusedDelayed\n ? -1\n : (listFeatures?.findIndex((feature) => feature.id === e.id) ??\n -1);\n }\n\n break;\n case \"markerMouseLeave\":\n if (markedFeatures) {\n selectedItemIndex = -1;\n }\n\n break;\n }\n });\n }\n\n onDestroy(() => {\n if (mapController) {\n mapController.setEventHandler(undefined);\n mapController.indicateReverse(false);\n mapController.setSelectedMarker(-1);\n mapController.setFeatures(undefined, undefined, false);\n }\n });\n\n function handleSubmit(event?: unknown) {\n focused = false;\n\n if (searchTimeoutRef) {\n window.clearTimeout(searchTimeoutRef);\n\n searchTimeoutRef = undefined;\n }\n\n if (autocompleteTimeoutRef) {\n window.clearTimeout(autocompleteTimeoutRef);\n\n autocompleteTimeoutRef = undefined;\n\n search(searchValue, { appendSpace: true });\n\n return;\n }\n\n if (selectedItemIndex > -1 && listFeatures) {\n picked = listFeatures[selectedItemIndex];\n\n searchValue =\n picked.place_type[0] === \"reverse\"\n ? picked.place_name\n : picked.place_name.replace(/,.*/, \"\");\n\n error = undefined;\n\n markedFeatures = undefined;\n\n selectedItemIndex = -1;\n } else if (searchValue) {\n const zoomTo = event || !isQueryReverse(searchValue);\n\n search(searchValue, { exact: true })\n .then(() => {\n markedFeatures = listFeatures;\n\n picked = undefined;\n\n if (zoomTo) {\n zoomToResults();\n }\n })\n .catch((err) => (error = err));\n }\n }\n\n function isQueryReverse(searchValue: string) {\n try {\n return convert(searchValue, 6);\n } catch {\n return false;\n }\n }\n\n async function search(\n searchValue: string,\n {\n byId = false,\n exact = false,\n appendSpace = false,\n }:\n | undefined\n | {\n byId?: boolean;\n exact?: boolean;\n appendSpace?: boolean;\n } = {},\n ) {\n error = undefined;\n\n abortController?.abort();\n\n const ac = new AbortController();\n\n abortController = ac;\n\n try {\n const isReverse = isQueryReverse(searchValue);\n\n const urlObj = new URL(\n apiUrl +\n \"/\" +\n encodeURIComponent(\n isReverse\n ? isReverse.decimalLongitude + \",\" + isReverse.decimalLatitude\n : searchValue + (appendSpace ? \" \" : \"\"),\n ) +\n \".json\",\n );\n\n const sp = urlObj.searchParams;\n\n if (language !== undefined) {\n sp.set(\n \"language\",\n Array.isArray(language) ? language.join(\",\") : (language ?? \"\"),\n );\n }\n\n const [zoom] = mapController?.getCenterAndZoom() ?? [];\n\n let effTypes = (\n !isReverse || reverseGeocodingTypes === COPY_TYPES\n ? types\n : reverseGeocodingTypes\n )\n ?.map((typeRule) =>\n typeof typeRule === \"string\"\n ? typeRule\n : zoom === undefined ||\n ((typeRule[0] ?? 0) <= zoom && zoom < (typeRule[1] ?? Infinity))\n ? typeRule[2]\n : undefined,\n )\n .filter((type) => type !== undefined);\n\n if (effTypes) {\n effTypes = [...new Set(effTypes)];\n\n sp.set(\"types\", effTypes.join(\",\"));\n }\n\n const effExcludeTypes =\n !isReverse || reverseGeocodingExcludeTypes === COPY_EXCLUDE_TYPES\n ? excludeTypes\n : reverseGeocodingExcludeTypes;\n\n if (effExcludeTypes) {\n sp.set(\"excludeTypes\", String(effExcludeTypes));\n }\n\n if (bbox) {\n sp.set(\"bbox\", bbox.map((c) => c.toFixed(6)).join(\",\"));\n }\n\n if (country) {\n sp.set(\"country\", Array.isArray(country) ? country.join(\",\") : country);\n }\n\n if (!byId && !isReverse) {\n const coords = await getProximity(mapController, proximity, ac);\n\n if (coords) {\n sp.set(\"proximity\", coords);\n }\n\n if (exact || !showResultsWhileTyping) {\n sp.set(\"autocomplete\", \"false\");\n }\n\n sp.set(\"fuzzyMatch\", String(fuzzyMatch));\n }\n\n const effReverseGeocodingLimit =\n reverseGeocodingLimit === COPY_LIMIT ? limit : reverseGeocodingLimit;\n\n if (\n effReverseGeocodingLimit !== undefined &&\n effReverseGeocodingLimit > 1 &&\n effTypes?.length !== 1\n ) {\n console.warn(\n \"For reverse geocoding when limit > 1 then types must contain single value.\",\n );\n }\n\n if (isReverse) {\n if (\n effReverseGeocodingLimit === 1 ||\n (effReverseGeocodingLimit !== undefined &&\n (exhaustiveReverseGeocoding || effTypes?.length === 1))\n ) {\n sp.set(\"limit\", String(effReverseGeocodingLimit));\n }\n } else if (limit !== undefined) {\n sp.set(\"limit\", String(limit));\n }\n\n sp.set(\"key\", apiKey);\n\n adjustUrlQuery(sp);\n\n adjustUrl(urlObj);\n\n const noTypes =\n urlObj.searchParams.get(\"types\") === \"\" &&\n urlObj.searchParams.get(\"excludeTypes\") !== \"true\";\n\n const url = urlObj.toString();\n\n if (url === lastSearchUrl) {\n if (byId) {\n if (clearListOnPick) {\n listFeatures = undefined;\n }\n\n picked = cachedFeatures[0];\n } else {\n listFeatures = cachedFeatures;\n\n if (listFeatures[selectedItemIndex]?.id !== selected?.id) {\n selectedItemIndex = -1;\n }\n }\n\n return;\n }\n\n lastSearchUrl = url;\n\n let featureCollection: FeatureCollection;\n\n if (noTypes) {\n featureCollection = { type: \"FeatureCollection\", features: [] };\n } else {\n const res = await fetch(url, {\n signal: ac.signal,\n ...fetchParameters,\n });\n\n if (!res.ok) {\n throw new Error(await res.text());\n }\n\n featureCollection = await res.json();\n }\n\n dispatch(\"response\", { url, featureCollection });\n\n if (byId) {\n if (clearListOnPick) {\n listFeatures = undefined;\n }\n\n picked = featureCollection.features[0];\n\n cachedFeatures = [picked];\n } else {\n listFeatures = featureCollection.features.filter(filter);\n\n if (isReverse) {\n listFeatures.unshift({\n type: \"Feature\",\n properties: {},\n id:\n \"reverse_\" +\n isReverse.decimalLongitude +\n \"_\" +\n isReverse.decimalLatitude,\n text: isReverse.decimalLatitude + \", \" + isReverse.decimalLongitude,\n place_name:\n isReverse.decimalLatitude + \", \" + isReverse.decimalLongitude,\n place_type: [\"reverse\"],\n center: [isReverse.decimalLongitude, isReverse.decimalLatitude],\n bbox: [\n isReverse.decimalLongitude,\n isReverse.decimalLatitude,\n isReverse.decimalLongitude,\n isReverse.decimalLatitude,\n ],\n geometry: {\n type: \"Point\",\n coordinates: [\n isReverse.decimalLongitude,\n isReverse.decimalLatitude,\n ],\n },\n });\n }\n\n cachedFeatures = listFeatures;\n\n if (listFeatures[selectedItemIndex]?.id !== selected?.id) {\n selectedItemIndex = -1;\n }\n\n if (isReverse) {\n input.focus();\n }\n }\n } catch (e) {\n if (\n e &&\n typeof e === \"object\" &&\n \"name\" in e &&\n e.name === \"AbortError\"\n ) {\n return;\n }\n\n throw e;\n } finally {\n if (ac === abortController) {\n abortController = undefined;\n }\n }\n }\n\n function zoomToResults() {\n if (!markedFeatures?.length || !flyTo) {\n return;\n }\n\n const bbox: BBox = [180, 90, -180, -90];\n\n const fuzzyOnly = !markedFeatures.some((feature) => !feature.matching_text);\n\n let allZoom: number | undefined;\n\n for (const feature of markedFeatures) {\n const featZoom = computeZoom(feature);\n\n allZoom =\n allZoom === undefined\n ? featZoom\n : featZoom === undefined\n ? allZoom\n : Math.max(allZoom, featZoom);\n\n if (fuzzyOnly || !feature.matching_text) {\n for (const i of [0, 1, 2, 3] as const) {\n bbox[i] = Math[i < 2 ? \"min\" : \"max\"](\n bbox[i],\n feature.bbox?.[i] ?? feature.center[i % 2],\n );\n }\n }\n }\n\n if (mapController && markedFeatures.length > 0) {\n if (picked && bbox[0] === bbox[2] && bbox[1] === bbox[3]) {\n mapController.flyTo(picked.center, computeZoom(picked));\n } else {\n mapController.fitBounds(unwrapBbox(bbox), 50, allZoom);\n }\n }\n }\n\n function goToPicked() {\n if (!picked || !mapController) {\n return;\n }\n\n if (\n !picked.bbox ||\n (picked.bbox[0] === picked.bbox[2] && picked.bbox[1] === picked.bbox[3])\n ) {\n mapController.flyTo(picked.center, computeZoom(picked));\n } else {\n mapController.fitBounds(unwrapBbox(picked.bbox), 50, computeZoom(picked));\n }\n }\n\n function computeZoom(feature: Feature): number | undefined {\n if (\n !feature.bbox ||\n (feature.bbox[0] !== feature.bbox[2] &&\n feature.bbox[1] !== feature.bbox[3])\n ) {\n return undefined;\n }\n\n const index = feature.id.replace(/\\..*/, \"\");\n\n return (\n (Array.isArray(feature.properties?.categories)\n ? (feature.properties.categories as string[]).reduce(\n (a, category) => {\n const b = zoom[index + \".\" + category];\n\n return a === undefined ? b : b === undefined ? a : Math.max(a, b);\n },\n undefined as undefined | number,\n )\n : undefined) ?? zoom[index]\n );\n }\n\n function handleReverse(coordinates: [lng: number, lat: number]) {\n reverseActive = enableReverse === \"always\";\n\n listFeatures = undefined;\n picked = undefined;\n selectedItemIndex = -1;\n\n setQuery(\n coordinates[1].toFixed(6) +\n \", \" +\n wrapNum(coordinates[0], [-180, 180], true).toFixed(6),\n false,\n true,\n );\n }\n\n function handleKeyDown(e: KeyboardEvent) {\n if (!listFeatures) {\n return;\n }\n\n let dir = e.key === \"ArrowDown\" ? 1 : e.key === \"ArrowUp\" ? -1 : 0;\n\n if (!dir) {\n return;\n }\n\n input.focus();\n\n focused = true;\n\n e.preventDefault();\n\n if (picked && selectedItemIndex === -1) {\n selectedItemIndex = listFeatures.findIndex(\n (listFeature) => listFeature.id === picked?.id,\n );\n }\n\n if (selectedItemIndex === (picked || selectFirst ? 0 : -1) && dir === -1) {\n selectedItemIndex = listFeatures.length;\n }\n\n selectedItemIndex += dir;\n\n if (selectedItemIndex >= listFeatures.length) {\n selectedItemIndex = -1;\n }\n\n if (selectedItemIndex < 0 && (picked || selectFirst)) {\n selectedItemIndex = 0;\n }\n }\n\n function handleInput(_?: Event, debounce = true, reverse = false) {\n error = undefined;\n picked = undefined;\n focused = true;\n\n if (searchTimeoutRef) {\n window.clearTimeout(searchTimeoutRef);\n\n searchTimeoutRef = undefined;\n }\n\n if (autocompleteTimeoutRef) {\n window.clearTimeout(autocompleteTimeoutRef);\n\n autocompleteTimeoutRef = undefined;\n }\n\n if (\n (!showResultsWhileTyping && !reverse) ||\n searchValue.length < minLength\n ) {\n listFeatures = undefined;\n\n return;\n }\n\n const sv = searchValue;\n\n searchTimeoutRef = window.setTimeout(\n () => {\n searchTimeoutRef = undefined;\n\n search(sv).catch((err) => (error = err));\n },\n debounce ? debounceSearch : 0,\n );\n\n if (!searchValue.endsWith(\" \")) {\n autocompleteTimeoutRef = window.setTimeout(() => {\n autocompleteTimeoutRef = undefined;\n\n search(sv, { appendSpace: true }).catch((err) => (error = err));\n }, autocompleteTimeout);\n }\n }\n\n function pick(feature: Feature) {\n if (picked && picked?.id === feature?.id) {\n goToPicked();\n } else {\n picked = feature;\n searchValue = feature.place_name;\n }\n }\n\n function handleMouseEnter(index: number) {\n selectedItemIndex = index;\n }\n\n function handleMouseLeave() {\n if (!selectFirst || picked) {\n selectedItemIndex = -1;\n }\n\n // re-focus on picked\n if (flyToSelected) {\n goToPicked();\n }\n }\n</script>\n\n{#if false}\n <!-- This workaround is just to use marker styles. Bug in svlete/vite? Investigate. -->\n <MarkerIcon displayIn=\"list\" />\n{/if}\n\n<form\n on:submit|preventDefault={handleSubmit}\n class:can-collapse={collapsed && searchValue === \"\"}\n class={className}\n>\n <div class=\"input-group\">\n <button class=\"search-button\" type=\"button\" on:click={() => input.focus()}>\n <SearchIcon />\n </button>\n\n <input\n bind:this={input}\n bind:value={searchValue}\n on:focus={() => (focused = true)}\n on:blur={() => (focused = false)}\n on:click={() => (focused = true)}\n on:keydown={handleKeyDown}\n on:input={handleInput}\n on:change={() => (picked = undefined)}\n {placeholder}\n aria-label={placeholder}\n />\n\n <div class=\"clear-button-container\" class:displayable={searchValue !== \"\"}>\n <button\n type=\"button\"\n on:click={() => {\n searchValue = \"\";\n picked = undefined;\n input.focus();\n }}\n title={clearButtonTitle}\n >\n <ClearIcon />\n </button>\n\n {#if abortController}\n <LoadingIcon />\n {/if}\n </div>\n\n {#if enableReverse === \"button\"}\n <button\n type=\"button\"\n class:active={reverseActive}\n title={reverseButtonTitle}\n on:click={() => (reverseActive = !reverseActive)}\n >\n <ReverseGeocodingIcon />\n </button>\n {/if}\n\n <slot />\n </div>\n\n {#if error}\n <div class=\"error\">\n <FailIcon />\n\n <div>{errorMessage}</div>\n\n <button on:click={() => (error = undefined)}>\n <ClearIcon />\n </button>\n </div>\n {:else if !focusedDelayed && !keepListOpen}\n {\"\"}\n {:else if listFeatures?.length === 0}\n <div class=\"no-results\">\n <FailIcon />\n\n <div>{noResultsMessage}</div>\n </div>\n {:else if listFeatures?.length && (focusedDelayed || keepListOpen)}\n <ul\n class=\"options\"\n on:mouseleave={handleMouseLeave}\n on:blur={() => undefined}\n on:keydown={handleKeyDown}\n role=\"listbox\"\n >\n {#each listFeatures as feature, i (feature.id + (feature.address ? \",\" + feature.address : \"\"))}\n <FeatureItem\n {feature}\n {showPlaceType}\n style={selectedItemIndex === i\n ? \"selected\"\n : picked?.id === feature.id\n ? \"picked\"\n : \"default\"}\n on:mouseenter={() => handleMouseEnter(i)}\n on:select={() => pick(feature)}\n {missingIconsCache}\n {iconsBaseUrl}\n />\n {/each}\n </ul>\n {/if}\n</form>\n\n<style lang=\"scss\">\n form {\n font-family: \"Open Sans\", \"Ubuntu\", \"Helvetica Neue\", Arial, Helvetica,\n sans-serif;\n position: relative;\n background-color: #fff;\n z-index: 10;\n border-radius: 4px;\n margin: 0;\n transition: max-width 0.25s;\n box-shadow: 0px 2px 5px rgba(51, 51, 89, 0.15);\n --color-text: #444952;\n --color-icon-button: #444952;\n\n &,\n & *,\n & *:after,\n & *:before {\n box-sizing: border-box;\n }\n\n &.can-collapse {\n max-width: 29px;\n\n & input::placeholder {\n transition: opacity 0.25s;\n opacity: 0;\n }\n }\n\n &,\n &:focus-within,\n &:hover {\n width: 270px;\n max-width: 270px;\n\n & input::placeholder {\n opacity: 1;\n }\n }\n }\n\n input {\n font: inherit;\n font-size: 14px;\n flex-grow: 1;\n min-height: 29px;\n background-color: transparent;\n color: #444952;\n white-space: nowrap;\n overflow: hidden;\n border: 0;\n margin: 0;\n padding: 0;\n\n &:focus {\n color: #444952;\n outline: 0;\n outline: none;\n box-shadow: none;\n }\n }\n\n ul,\n div.error,\n div.no-results {\n background-color: #fff;\n border-radius: 4px;\n left: 0;\n list-style: none;\n margin: 0;\n padding: 0;\n position: absolute;\n width: 100%;\n top: calc(100% + 6px);\n overflow: hidden;\n }\n\n ul {\n font-size: 14px;\n line-height: 16px;\n box-shadow: 0px 5px 10px rgba(51, 51, 89, 0.15);\n }\n\n div.error,\n div.no-results {\n font: inherit;\n line-height: 18px;\n font-size: 12px;\n display: flex;\n gap: 16px;\n }\n\n div.error {\n padding: 16px;\n font-weight: 600;\n color: #e25041;\n background-color: #fbeae8;\n\n div {\n flex-grow: 1;\n }\n\n :global(svg) {\n flex-shrink: 0;\n width: 20px;\n height: 20px;\n }\n\n button {\n flex-shrink: 0;\n & > :global(svg) {\n width: 13px;\n fill: #e25041;\n }\n\n &:hover :global(svg),\n &:active :global(svg) {\n fill: #444952;\n }\n }\n }\n\n div.no-results {\n padding: 14px 24px 14px 16px;\n font-weight: 400;\n color: #6b7c93;\n box-shadow: 0px 5px 10px rgba(51, 51, 89, 0.15);\n\n :global(svg) {\n margin-top: 4px;\n flex-shrink: 0;\n width: 20px;\n height: 20px;\n width: 30px;\n height: 30px;\n }\n }\n\n :global(.leaflet-bottom) ul.options,\n :global(.maplibregl-ctrl-bottom-left) ul.options,\n :global(.maplibregl-ctrl-bottom-right) ul.options {\n top: auto;\n bottom: calc(100% + 6px);\n }\n\n button {\n padding: 0;\n margin: 0;\n border: 0;\n background-color: transparent;\n height: auto;\n width: auto;\n\n &:hover {\n background-color: transparent;\n }\n }\n\n button:hover :global(svg),\n button:active :global(svg) {\n fill: #2b8bfb;\n }\n\n .input-group {\n display: flex;\n align-items: stretch;\n gap: 7px;\n padding-inline: 8px;\n border-radius: 4px;\n overflow: hidden;\n\n &:focus-within {\n outline: #2b8bfb solid 2px;\n }\n }\n\n .search-button {\n flex-shrink: 0;\n }\n\n :global(.maplibregl-ctrl-geocoder:not(.maptiler-ctrl) .search-button svg) {\n width: 12px !important;\n transform: translate(0.5px, 0);\n }\n\n .clear-button-container {\n display: flex;\n display: none;\n position: relative;\n align-items: stretch;\n\n &.displayable {\n display: flex;\n flex-shrink: 0;\n }\n }\n\n :global(.maplibregl-ctrl-geocoder) {\n position: relative;\n z-index: 3;\n }\n\n :global(.maptiler-ctrl) {\n &:not(:empty) {\n box-shadow: none;\n }\n\n & .input-group {\n padding-inline: 8px;\n border: white solid 2px;\n\n &:focus-within {\n border: #2b8bfb solid 2px;\n outline: 0;\n outline: none;\n }\n }\n\n & form {\n &.can-collapse {\n max-width: 33px;\n }\n\n &,\n &:focus-within,\n &:hover {\n width: 270px;\n max-width: 270px;\n }\n }\n }\n</style>\n","import GeocodingControlComponent from \"./GeocodingControl.svelte\";\nimport type { ControlOptions, DispatcherType, MapController } from \"./types\";\n\nconst finalizationRegistry =\n new FinalizationRegistry<GeocodingControlComponent>((gc) => {\n gc.$destroy();\n });\n\ntype Options = ControlOptions & { mapController?: MapController };\n\ninterface GeocodingControlEvent<T> extends CustomEvent<T> {\n readonly target: GeocodingControl;\n readonly currentTarget: GeocodingControl;\n}\n\ntype CustomEventListenerOrEventListenerObject<K extends keyof CustomEventMap> =\n | ((evt: CustomEventMap[K]) => void)\n | { handleEvent(object: CustomEventMap[K]): void };\n\ntype CustomEventMap = {\n [T in keyof DispatcherType]: GeocodingControlEvent<DispatcherType[T]>;\n};\n\nexport class GeocodingControl extends EventTarget {\n #gc: GeocodingControlComponent;\n\n constructor({ target, ...options }: Options & { target: HTMLElement }) {\n super();\n\n this.#gc = new GeocodingControlComponent({\n target,\n props: options,\n });\n\n for (const eventName of [\n \"select\",\n \"pick\",\n \"featureslisted\",\n \"featuresmarked\",\n \"response\",\n \"optionsvisibilitychange\",\n \"reversetoggle\",\n \"querychange\",\n ] as const) {\n this.#gc.$on(eventName, (event) => {\n // Use the new `emit` method for type-safe dispatching\n this.#emit(eventName, event.detail);\n });\n }\n\n this.#gc.$on(\"select\", (event) => {\n const geocodingEvent = new CustomEvent(event.type, {\n detail: event.detail,\n }) as GeocodingControlEvent<CustomEventMap[\"select\"][\"detail\"]>;\n\n this.dispatchEvent(geocodingEvent);\n });\n\n finalizationRegistry.register(this, this.#gc);\n }\n\n /**\n * Update the control options.\n *\n * @param options options to update\n */\n setOptions(options: Partial<Options>) {\n this.#gc.$set(options);\n }\n\n /**\n * Set the content of search input box.\n *\n * @param value text to set\n * @param submit perform the search\n */\n setQuery(value: string, submit = true) {\n this.#gc?.setQuery(value, submit);\n }\n\n /**\n * Clear geocoding search results from the map.\n */\n clearMap() {\n this.#gc?.clearMap();\n }\n\n /**\n * Clear search result list.\n */\n clearList() {\n this.#gc?.clearList();\n }\n\n /**\n * Set reverse geocoding mode.\n *\n * @param reverseActive reverse geocoding active\n */\n setReverseMode(reverseActive: boolean) {\n this.#gc?.$set({ reverseActive });\n }\n\n /**\n * Focus the search input box.\n *\n * @param options [FocusOptions](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)\n */\n focus(options?: FocusOptions) {\n this.#gc?.focus(options);\n }\n\n /**\n * Blur the search input box.\n */\n blur() {\n this.#gc?.blur();\n }\n\n addEventListener<K extends keyof CustomEventMap>(\n type: K,\n callback: CustomEventListenerOrEventListenerObject<K> | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n\n addEventListener(\n type: string,\n callback: EventListenerOrEventListenerObject | null,\n options?: AddEventListenerOptions | boolean,\n ): void {\n super.addEventListener(type, callback, options);\n }\n\n removeEventListener<K extends keyof CustomEventMap>(\n type: K,\n callback: CustomEventListenerOrEventListenerObject<K> | null,\n options?: EventListenerOptions | boolean,\n ): void;\n\n removeEventListener(\n type: string,\n callback: EventListenerOrEventListenerObject | null,\n options?: EventListenerOptions | boolean,\n ): void {\n super.removeEventListener(type, callback, options);\n }\n\n dispatchEvent<K extends keyof CustomEventMap>(\n event: CustomEventMap[K],\n ): boolean;\n\n dispatchEvent(event: Event): boolean {\n return super.dispatchEvent(event);\n }\n\n #emit<K extends keyof CustomEventMap>(\n type: K,\n detail: CustomEventMap[K][\"detail\"],\n ): boolean {\n return super.dispatchEvent(\n new CustomEvent(type, {\n detail,\n }) as GeocodingControlEvent<CustomEventMap[K][\"detail\"]>,\n );\n }\n}\n"],"names":["noop","assign","tar","src","k","run","fn","blank_object","run_all","fns","is_function","thing","safe_not_equal","a","b","src_url_equal_anchor","src_url_equal","element_src","url","is_empty","obj","create_slot","definition","ctx","$$scope","slot_ctx","get_slot_context","get_slot_changes","dirty","update_slot_base","slot","slot_definition","slot_changes","get_slot_context_fn","slot_context","get_all_dirty_from_scope","length","i","null_to_empty","value","append","target","node","insert","anchor","detach","element","name","svg_element","text","data","space","empty","listen","event","handler","options","prevent_default","attr","attribute","children","set_data","set_input_value","input","toggle_class","toggle","custom_event","type","detail","bubbles","cancelable","current_component","set_current_component","component","get_current_component","onDestroy","createEventDispatcher","callbacks","bubble","dirty_components","binding_callbacks","render_callbacks","flush_callbacks","resolved_promise","update_scheduled","schedule_update","flush","add_render_callback","seen_callbacks","flushidx","saved_component","update","callback","$$","flush_render_callbacks","filtered","targets","c","outroing","outros","group_outros","check_outros","transition_in","block","local","transition_out","ensure_array_like","array_like_or_iterator","outro_and_destroy_block","lookup","update_keyed_each","old_blocks","get_key","dynamic","list","destroy","create_each_block","next","get_context","o","n","old_indexes","new_blocks","new_lookup","deltas","updates","child_ctx","key","will_move","did_move","new_block","old_block","new_key","old_key","create_component","mount_component","fragment","after_update","new_on_destroy","destroy_component","detaching","make_dirty","init","instance","create_fragment","not_equal","props","append_styles","parent_component","ready","ret","rest","nodes","SvelteComponent","__publicField","index","PUBLIC_VERSION","svg","path","img","img_src_value","scaleFactor","scaleUrl","sprites","div","span","create_if_block_1","create_if_block_2","create_if_block_3","show_if_1","show_if_2","show_if_3","show_if_4","create_if_block_8","li","li_aria_selected_value","li_aria_checked_value","span3","span1","span0","span2","t1","t1_value","t4","t4_value","hidpi","spritePromise","feature","$$props","style","showPlaceType","missingIconsCache","iconsBaseUrl","dispatch","category","imageUrl","spriteIcon","loadSprites","response","handleImgError","loadIcon","loadIcon2","categories","$$invalidate","ev","_a","_b","_c","_d","_e","isReverse","placeType","circle","wrapNum","x","range","includeMax","max","min","d","unwrapBbox","bbox0","bbox","cachedLocation","getProximity","mapController","proximity","ac","centerAndZoom","rule","cg","coords","resolve","reject","pos","err","dm_invalid","dm_numbers","dd_re","dms_periods","dms_abbr","coords_other","toCoordinateFormat","format","parts","decimalLatitude","decimalLongitude","absoluteLatitude","absoluteLongitude","latDir","longDir","result","degreesLatitude","degreesLongitude","minutesLatitudeNotTruncated","minutesLongitudeNotTruncated","dmMinsLatitude","round","dmMinsLongitude","latMinutes","longMinutes","latSeconds","longSeconds","latMinutesString","longMinutesString","num","places","converter","coordsString","decimalPlaces","ddLat","ddLng","latdir","lngdir","originalFormat","match","matchSuccess","checkMatch","patt","verbatimCoordinates","verbatimLat","verbatimLng","sepChars","seps","middle","splitIndex","currSepIndex","startSearchIndex","splitLat","splitLon","coordsCloseEnough","filteredMatch","numerictest","stringtest","halflen","leftside","rightside","bothAreNumbers","bothAreStrings","valuesAreEqual","decimalsCloseEnough","dec1","dec2","originaldiff","coordsToTest","to","coordsParserFormats","coordsParserDecimals","coordsRegexFormats","otherFormats","getAllTestFormats","arr1","item","testFormats","convert","button","ul","div1","div0","featureitem_changes","create_if_block_5","if_block2","create_if_block_4","form","button0","input_1","button1","ZOOM_DEFAULTS","className","apiKey","clearButtonTitle","clearOnBlur","clearListOnPick","keepListOpen","collapsed","country","debounceSearch","enableReverse","errorMessage","filter","flyTo","fuzzyMatch","language","limit","COPY_LIMIT","reverseGeocodingLimit","minLength","noResultsMessage","placeholder","reverseActive","reverseButtonTitle","searchValue","pickedResultStyle","showResultsWhileTyping","autocompleteTimeout","selectFirst","flyToSelected","markerOnSelected","types","COPY_TYPES","reverseGeocodingTypes","exhaustiveReverseGeocoding","excludeTypes","COPY_EXCLUDE_TYPES","reverseGeocodingExcludeTypes","zoom","apiUrl","fetchParameters","adjustUrlQuery","adjustUrl","focus","blur","setQuery","submit","reverse","selectedItemIndex","handleSubmit","handleInput","clearList","listFeatures","picked","clearMap","markedFeatures","lastSearchUrl","error","cachedFeatures","abortController","searchTimeoutRef","autocompleteTimeoutRef","focusedDelayed","prevIdToFly","focused","isInAutocompleteTimeout","search","zoomTo","isQueryReverse","zoomToResults","byId","exact","appendSpace","urlObj","sp","effTypes","typeRule","effExcludeTypes","effReverseGeocodingLimit","noTypes","selected","featureCollection","res","e","fuzzyOnly","allZoom","featZoom","computeZoom","goToPicked","handleReverse","coordinates","handleKeyDown","dir","listFeature","_","debounce","sv","pick","handleMouseEnter","handleMouseLeave","click_handler","$$value","focus_handler","blur_handler","click_handler_1","change_handler","click_handler_3","click_handler_4","mouseenter_handler","select_handler","showPolygonMarker","optionsVisible","finalizationRegistry","gc","_gc","_GeocodingControl_instances","emit_fn","_GeocodingControl","__privateAdd","__privateSet","GeocodingControlComponent","eventName","__privateGet","__privateMethod","geocodingEvent","__superGet","GeocodingControl"],"mappings":";;;;;;;;;;AACO,SAASA,IAAO;AAAA;AAWhB,SAASC,GAAOC,GAAKC,GAAK;AAEhC,aAAWC,KAAKD,EAAK,CAAAD,EAAIE,CAAC,IAAID,EAAIC,CAAC;AACnC;AAAA;AAAA,IAA6BF;AAAA;AAC9B;AAuBO,SAASG,GAAIC,GAAI;AACvB,SAAOA,EAAI;AACZ;AAEO,SAASC,KAAe;AAC9B,SAAO,uBAAO,OAAO,IAAI;AAC1B;AAMO,SAASC,GAAQC,GAAK;AAC5B,EAAAA,EAAI,QAAQJ,EAAG;AAChB;AAMO,SAASK,GAAYC,GAAO;AAClC,SAAO,OAAOA,KAAU;AACzB;AAGO,SAASC,GAAeC,GAAGC,GAAG;AACpC,SAAOD,KAAKA,IAAIC,KAAKA,IAAID,MAAMC,KAAMD,KAAK,OAAOA,KAAM,YAAa,OAAOA,KAAM;AAClF;AAEA,IAAIE;AAOG,SAASC,EAAcC,GAAaC,GAAK;AAC/C,SAAID,MAAgBC,IAAY,MA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ACEW,GACAyB,GACApC,GACM;AACA,UAAA,oBAAoBW,GAAMyB,GAAUpC,CAAO;AAAA,EAAA;AAAA,EAOnD,cAAcF,GAAuB;AAC5B,WAAA,MAAM,cAAcA,CAAK;AAAA,EAAA;AAapC;AA7IEmY,IAAA,eADKC,KAAA,eAoILC,KAAA,SACExX,GACAC,GACS;AACT,SAAOgY,GAAAR,GAAA,iBAAM;AAAA,IAAN;AAAA,IACL,IAAI,YAAYzX,GAAM;AAAA,MACpB,QAAAC;AAAA,IACD,CAAA;AAAA,EACH;AAAA;AA5IG,IAAMiY,KAANT;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,17,18,19,20,21]}
|
|
1
|
+
{"version":3,"file":"vanilla.js","sources":["../node_modules/svelte/src/runtime/internal/utils.js","../node_modules/svelte/src/runtime/internal/dom.js","../node_modules/svelte/src/runtime/internal/lifecycle.js","../node_modules/svelte/src/runtime/internal/scheduler.js","../node_modules/svelte/src/runtime/internal/transitions.js","../node_modules/svelte/src/runtime/internal/each.js","../node_modules/svelte/src/runtime/internal/Component.js","../node_modules/svelte/src/shared/version.js","../node_modules/svelte/src/runtime/internal/disclose-version/index.js","../src/ClearIcon.svelte","../src/FailIcon.svelte","../src/FeatureItem.svelte","../src/LoadingIcon.svelte","../src/ReverseGeocodingIcon.svelte","../src/SearchIcon.svelte","../src/geoUtils.ts","../src/proximity.ts","../node_modules/geo-coordinates-parser/dist/mjs/regex.js","../node_modules/geo-coordinates-parser/dist/mjs/toCoordinateFormat.js","../node_modules/geo-coordinates-parser/dist/mjs/converter.js","../node_modules/geo-coordinates-parser/dist/mjs/tests/testformats.js","../node_modules/geo-coordinates-parser/dist/mjs/merge.js","../src/GeocodingControl.svelte","../src/vanilla.ts"],"sourcesContent":["/** @returns {void} */\nexport function noop() {}\n\nexport const identity = (x) => x;\n\n/**\n * @template T\n * @template S\n * @param {T} tar\n * @param {S} src\n * @returns {T & S}\n */\nexport function assign(tar, src) {\n\t// @ts-ignore\n\tfor (const k in src) tar[k] = src[k];\n\treturn /** @type {T & S} */ (tar);\n}\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n/**\n * @param {any} value\n * @returns {value is PromiseLike<any>}\n */\nexport function is_promise(value) {\n\treturn (\n\t\t!!value &&\n\t\t(typeof value === 'object' || typeof value === 'function') &&\n\t\ttypeof (/** @type {any} */ (value).then) === 'function'\n\t);\n}\n\n/** @returns {void} */\nexport function add_location(element, file, line, column, char) {\n\telement.__svelte_meta = {\n\t\tloc: { file, line, column, char }\n\t};\n}\n\nexport function run(fn) {\n\treturn fn();\n}\n\nexport function blank_object() {\n\treturn Object.create(null);\n}\n\n/**\n * @param {Function[]} fns\n * @returns {void}\n */\nexport function run_all(fns) {\n\tfns.forEach(run);\n}\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\n/** @returns {boolean} */\nexport function safe_not_equal(a, b) {\n\treturn a != a ? b == b : a !== b || (a && typeof a === 'object') || typeof a === 'function';\n}\n\nlet src_url_equal_anchor;\n\n/**\n * @param {string} element_src\n * @param {string} url\n * @returns {boolean}\n */\nexport function src_url_equal(element_src, url) {\n\tif (element_src === url) return true;\n\tif (!src_url_equal_anchor) {\n\t\tsrc_url_equal_anchor = document.createElement('a');\n\t}\n\t// This is actually faster than doing URL(..).href\n\tsrc_url_equal_anchor.href = url;\n\treturn element_src === src_url_equal_anchor.href;\n}\n\n/** @param {string} srcset */\nfunction split_srcset(srcset) {\n\treturn srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean));\n}\n\n/**\n * @param {HTMLSourceElement | HTMLImageElement} element_srcset\n * @param {string | undefined | null} srcset\n * @returns {boolean}\n */\nexport function srcset_url_equal(element_srcset, srcset) {\n\tconst element_urls = split_srcset(element_srcset.srcset);\n\tconst urls = split_srcset(srcset || '');\n\n\treturn (\n\t\turls.length === element_urls.length &&\n\t\turls.every(\n\t\t\t([url, width], i) =>\n\t\t\t\twidth === element_urls[i][1] &&\n\t\t\t\t// We need to test both ways because Vite will create an a full URL with\n\t\t\t\t// `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the\n\t\t\t\t// relative URLs inside srcset are not automatically resolved to absolute URLs by\n\t\t\t\t// browsers (in contrast to img.src). This means both SSR and DOM code could\n\t\t\t\t// contain relative or absolute URLs.\n\t\t\t\t(src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0]))\n\t\t)\n\t);\n}\n\n/** @returns {boolean} */\nexport function not_equal(a, b) {\n\treturn a != a ? b == b : a !== b;\n}\n\n/** @returns {boolean} */\nexport function is_empty(obj) {\n\treturn Object.keys(obj).length === 0;\n}\n\n/** @returns {void} */\nexport function validate_store(store, name) {\n\tif (store != null && typeof store.subscribe !== 'function') {\n\t\tthrow new Error(`'${name}' is not a store with a 'subscribe' method`);\n\t}\n}\n\nexport function subscribe(store, ...callbacks) {\n\tif (store == null) {\n\t\tfor (const callback of callbacks) {\n\t\t\tcallback(undefined);\n\t\t}\n\t\treturn noop;\n\t}\n\tconst unsub = store.subscribe(...callbacks);\n\treturn unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\n\n/**\n * Get the current value from a store by subscribing and immediately unsubscribing.\n *\n * https://svelte.dev/docs/svelte-store#get\n * @template T\n * @param {import('../store/public.js').Readable<T>} store\n * @returns {T}\n */\nexport function get_store_value(store) {\n\tlet value;\n\tsubscribe(store, (_) => (value = _))();\n\treturn value;\n}\n\n/** @returns {void} */\nexport function component_subscribe(component, store, callback) {\n\tcomponent.$$.on_destroy.push(subscribe(store, callback));\n}\n\nexport function create_slot(definition, ctx, $$scope, fn) {\n\tif (definition) {\n\t\tconst slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n\t\treturn definition[0](slot_ctx);\n\t}\n}\n\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n\treturn definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx;\n}\n\nexport function get_slot_changes(definition, $$scope, dirty, fn) {\n\tif (definition[2] && fn) {\n\t\tconst lets = definition[2](fn(dirty));\n\t\tif ($$scope.dirty === undefined) {\n\t\t\treturn lets;\n\t\t}\n\t\tif (typeof lets === 'object') {\n\t\t\tconst merged = [];\n\t\t\tconst len = Math.max($$scope.dirty.length, lets.length);\n\t\t\tfor (let i = 0; i < len; i += 1) {\n\t\t\t\tmerged[i] = $$scope.dirty[i] | lets[i];\n\t\t\t}\n\t\t\treturn merged;\n\t\t}\n\t\treturn $$scope.dirty | lets;\n\t}\n\treturn $$scope.dirty;\n}\n\n/** @returns {void} */\nexport function update_slot_base(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tslot_changes,\n\tget_slot_context_fn\n) {\n\tif (slot_changes) {\n\t\tconst slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n\t\tslot.p(slot_context, slot_changes);\n\t}\n}\n\n/** @returns {void} */\nexport function update_slot(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tdirty,\n\tget_slot_changes_fn,\n\tget_slot_context_fn\n) {\n\tconst slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n\tupdate_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\n\n/** @returns {any[] | -1} */\nexport function get_all_dirty_from_scope($$scope) {\n\tif ($$scope.ctx.length > 32) {\n\t\tconst dirty = [];\n\t\tconst length = $$scope.ctx.length / 32;\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tdirty[i] = -1;\n\t\t}\n\t\treturn dirty;\n\t}\n\treturn -1;\n}\n\n/** @returns {{}} */\nexport function exclude_internal_props(props) {\n\tconst result = {};\n\tfor (const k in props) if (k[0] !== '$') result[k] = props[k];\n\treturn result;\n}\n\n/** @returns {{}} */\nexport function compute_rest_props(props, keys) {\n\tconst rest = {};\n\tkeys = new Set(keys);\n\tfor (const k in props) if (!keys.has(k) && k[0] !== '$') rest[k] = props[k];\n\treturn rest;\n}\n\n/** @returns {{}} */\nexport function compute_slots(slots) {\n\tconst result = {};\n\tfor (const key in slots) {\n\t\tresult[key] = true;\n\t}\n\treturn result;\n}\n\n/** @returns {(this: any, ...args: any[]) => void} */\nexport function once(fn) {\n\tlet ran = false;\n\treturn function (...args) {\n\t\tif (ran) return;\n\t\tran = true;\n\t\tfn.call(this, ...args);\n\t};\n}\n\nexport function null_to_empty(value) {\n\treturn value == null ? '' : value;\n}\n\nexport function set_store_value(store, ret, value) {\n\tstore.set(value);\n\treturn ret;\n}\n\nexport const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\n\nexport function action_destroyer(action_result) {\n\treturn action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\n\n/** @param {number | string} value\n * @returns {[number, string]}\n */\nexport function split_css_unit(value) {\n\tconst split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n\treturn split ? [parseFloat(split[1]), split[2] || 'px'] : [/** @type {number} */ (value), 'px'];\n}\n\nexport const contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n","import { contenteditable_truthy_values, has_prop } from './utils.js';\n\nimport { ResizeObserverSingleton } from './ResizeObserverSingleton.js';\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\n\n/**\n * @returns {void}\n */\nexport function start_hydrating() {\n\tis_hydrating = true;\n}\n\n/**\n * @returns {void}\n */\nexport function end_hydrating() {\n\tis_hydrating = false;\n}\n\n/**\n * @param {number} low\n * @param {number} high\n * @param {(index: number) => number} key\n * @param {number} value\n * @returns {number}\n */\nfunction upper_bound(low, high, key, value) {\n\t// Return first index of value larger than input value in the range [low, high)\n\twhile (low < high) {\n\t\tconst mid = low + ((high - low) >> 1);\n\t\tif (key(mid) <= value) {\n\t\t\tlow = mid + 1;\n\t\t} else {\n\t\t\thigh = mid;\n\t\t}\n\t}\n\treturn low;\n}\n\n/**\n * @param {NodeEx} target\n * @returns {void}\n */\nfunction init_hydrate(target) {\n\tif (target.hydrate_init) return;\n\ttarget.hydrate_init = true;\n\t// We know that all children have claim_order values since the unclaimed have been detached if target is not <head>\n\n\tlet children = /** @type {ArrayLike<NodeEx2>} */ (target.childNodes);\n\t// If target is <head>, there may be children without claim_order\n\tif (target.nodeName === 'HEAD') {\n\t\tconst my_children = [];\n\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\tconst node = children[i];\n\t\t\tif (node.claim_order !== undefined) {\n\t\t\t\tmy_children.push(node);\n\t\t\t}\n\t\t}\n\t\tchildren = my_children;\n\t}\n\t/*\n\t * Reorder claimed children optimally.\n\t * We can reorder claimed children optimally by finding the longest subsequence of\n\t * nodes that are already claimed in order and only moving the rest. The longest\n\t * subsequence of nodes that are claimed in order can be found by\n\t * computing the longest increasing subsequence of .claim_order values.\n\t *\n\t * This algorithm is optimal in generating the least amount of reorder operations\n\t * possible.\n\t *\n\t * Proof:\n\t * We know that, given a set of reordering operations, the nodes that do not move\n\t * always form an increasing subsequence, since they do not move among each other\n\t * meaning that they must be already ordered among each other. Thus, the maximal\n\t * set of nodes that do not move form a longest increasing subsequence.\n\t */\n\t// Compute longest increasing subsequence\n\t// m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n\tconst m = new Int32Array(children.length + 1);\n\t// Predecessor indices + 1\n\tconst p = new Int32Array(children.length);\n\tm[0] = -1;\n\tlet longest = 0;\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst current = children[i].claim_order;\n\t\t// Find the largest subsequence length such that it ends in a value less than our current value\n\t\t// upper_bound returns first greater value, so we subtract one\n\t\t// with fast path for when we are on the current longest subsequence\n\t\tconst seq_len =\n\t\t\t(longest > 0 && children[m[longest]].claim_order <= current\n\t\t\t\t? longest + 1\n\t\t\t\t: upper_bound(1, longest, (idx) => children[m[idx]].claim_order, current)) - 1;\n\t\tp[i] = m[seq_len] + 1;\n\t\tconst new_len = seq_len + 1;\n\t\t// We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n\t\tm[new_len] = i;\n\t\tlongest = Math.max(new_len, longest);\n\t}\n\t// The longest increasing subsequence of nodes (initially reversed)\n\n\t/**\n\t * @type {NodeEx2[]}\n\t */\n\tconst lis = [];\n\t// The rest of the nodes, nodes that will be moved\n\n\t/**\n\t * @type {NodeEx2[]}\n\t */\n\tconst to_move = [];\n\tlet last = children.length - 1;\n\tfor (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n\t\tlis.push(children[cur - 1]);\n\t\tfor (; last >= cur; last--) {\n\t\t\tto_move.push(children[last]);\n\t\t}\n\t\tlast--;\n\t}\n\tfor (; last >= 0; last--) {\n\t\tto_move.push(children[last]);\n\t}\n\tlis.reverse();\n\t// We sort the nodes being moved to guarantee that their insertion order matches the claim order\n\tto_move.sort((a, b) => a.claim_order - b.claim_order);\n\t// Finally, we move the nodes\n\tfor (let i = 0, j = 0; i < to_move.length; i++) {\n\t\twhile (j < lis.length && to_move[i].claim_order >= lis[j].claim_order) {\n\t\t\tj++;\n\t\t}\n\t\tconst anchor = j < lis.length ? lis[j] : null;\n\t\ttarget.insertBefore(to_move[i], anchor);\n\t}\n}\n\n/**\n * @param {Node} target\n * @param {Node} node\n * @returns {void}\n */\nexport function append(target, node) {\n\ttarget.appendChild(node);\n}\n\n/**\n * @param {Node} target\n * @param {string} style_sheet_id\n * @param {string} styles\n * @returns {void}\n */\nexport function append_styles(target, style_sheet_id, styles) {\n\tconst append_styles_to = get_root_for_style(target);\n\tif (!append_styles_to.getElementById(style_sheet_id)) {\n\t\tconst style = element('style');\n\t\tstyle.id = style_sheet_id;\n\t\tstyle.textContent = styles;\n\t\tappend_stylesheet(append_styles_to, style);\n\t}\n}\n\n/**\n * @param {Node} node\n * @returns {ShadowRoot | Document}\n */\nexport function get_root_for_style(node) {\n\tif (!node) return document;\n\tconst root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n\tif (root && /** @type {ShadowRoot} */ (root).host) {\n\t\treturn /** @type {ShadowRoot} */ (root);\n\t}\n\treturn node.ownerDocument;\n}\n\n/**\n * @param {Node} node\n * @returns {CSSStyleSheet}\n */\nexport function append_empty_stylesheet(node) {\n\tconst style_element = element('style');\n\t// For transitions to work without 'style-src: unsafe-inline' Content Security Policy,\n\t// these empty tags need to be allowed with a hash as a workaround until we move to the Web Animations API.\n\t// Using the hash for the empty string (for an empty tag) works in all browsers except Safari.\n\t// So as a workaround for the workaround, when we append empty style tags we set their content to /* empty */.\n\t// The hash 'sha256-9OlNO0DNEeaVzHL4RZwCLsBHA8WBQ8toBp/4F5XV2nc=' will then work even in Safari.\n\tstyle_element.textContent = '/* empty */';\n\tappend_stylesheet(get_root_for_style(node), style_element);\n\treturn style_element.sheet;\n}\n\n/**\n * @param {ShadowRoot | Document} node\n * @param {HTMLStyleElement} style\n * @returns {CSSStyleSheet}\n */\nfunction append_stylesheet(node, style) {\n\tappend(/** @type {Document} */ (node).head || node, style);\n\treturn style.sheet;\n}\n\n/**\n * @param {NodeEx} target\n * @param {NodeEx} node\n * @returns {void}\n */\nexport function append_hydration(target, node) {\n\tif (is_hydrating) {\n\t\tinit_hydrate(target);\n\t\tif (\n\t\t\ttarget.actual_end_child === undefined ||\n\t\t\t(target.actual_end_child !== null && target.actual_end_child.parentNode !== target)\n\t\t) {\n\t\t\ttarget.actual_end_child = target.firstChild;\n\t\t}\n\t\t// Skip nodes of undefined ordering\n\t\twhile (target.actual_end_child !== null && target.actual_end_child.claim_order === undefined) {\n\t\t\ttarget.actual_end_child = target.actual_end_child.nextSibling;\n\t\t}\n\t\tif (node !== target.actual_end_child) {\n\t\t\t// We only insert if the ordering of this node should be modified or the parent node is not target\n\t\t\tif (node.claim_order !== undefined || node.parentNode !== target) {\n\t\t\t\ttarget.insertBefore(node, target.actual_end_child);\n\t\t\t}\n\t\t} else {\n\t\t\ttarget.actual_end_child = node.nextSibling;\n\t\t}\n\t} else if (node.parentNode !== target || node.nextSibling !== null) {\n\t\ttarget.appendChild(node);\n\t}\n}\n\n/**\n * @param {Node} target\n * @param {Node} node\n * @param {Node} [anchor]\n * @returns {void}\n */\nexport function insert(target, node, anchor) {\n\ttarget.insertBefore(node, anchor || null);\n}\n\n/**\n * @param {NodeEx} target\n * @param {NodeEx} node\n * @param {NodeEx} [anchor]\n * @returns {void}\n */\nexport function insert_hydration(target, node, anchor) {\n\tif (is_hydrating && !anchor) {\n\t\tappend_hydration(target, node);\n\t} else if (node.parentNode !== target || node.nextSibling != anchor) {\n\t\ttarget.insertBefore(node, anchor || null);\n\t}\n}\n\n/**\n * @param {Node} node\n * @returns {void}\n */\nexport function detach(node) {\n\tif (node.parentNode) {\n\t\tnode.parentNode.removeChild(node);\n\t}\n}\n\n/**\n * @returns {void} */\nexport function destroy_each(iterations, detaching) {\n\tfor (let i = 0; i < iterations.length; i += 1) {\n\t\tif (iterations[i]) iterations[i].d(detaching);\n\t}\n}\n\n/**\n * @template {keyof HTMLElementTagNameMap} K\n * @param {K} name\n * @returns {HTMLElementTagNameMap[K]}\n */\nexport function element(name) {\n\treturn document.createElement(name);\n}\n\n/**\n * @template {keyof HTMLElementTagNameMap} K\n * @param {K} name\n * @param {string} is\n * @returns {HTMLElementTagNameMap[K]}\n */\nexport function element_is(name, is) {\n\treturn document.createElement(name, { is });\n}\n\n/**\n * @template T\n * @template {keyof T} K\n * @param {T} obj\n * @param {K[]} exclude\n * @returns {Pick<T, Exclude<keyof T, K>>}\n */\nexport function object_without_properties(obj, exclude) {\n\tconst target = /** @type {Pick<T, Exclude<keyof T, K>>} */ ({});\n\tfor (const k in obj) {\n\t\tif (\n\t\t\thas_prop(obj, k) &&\n\t\t\t// @ts-ignore\n\t\t\texclude.indexOf(k) === -1\n\t\t) {\n\t\t\t// @ts-ignore\n\t\t\ttarget[k] = obj[k];\n\t\t}\n\t}\n\treturn target;\n}\n\n/**\n * @template {keyof SVGElementTagNameMap} K\n * @param {K} name\n * @returns {SVGElement}\n */\nexport function svg_element(name) {\n\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n}\n\n/**\n * @param {string} data\n * @returns {Text}\n */\nexport function text(data) {\n\treturn document.createTextNode(data);\n}\n\n/**\n * @returns {Text} */\nexport function space() {\n\treturn text(' ');\n}\n\n/**\n * @returns {Text} */\nexport function empty() {\n\treturn text('');\n}\n\n/**\n * @param {string} content\n * @returns {Comment}\n */\nexport function comment(content) {\n\treturn document.createComment(content);\n}\n\n/**\n * @param {EventTarget} node\n * @param {string} event\n * @param {EventListenerOrEventListenerObject} handler\n * @param {boolean | AddEventListenerOptions | EventListenerOptions} [options]\n * @returns {() => void}\n */\nexport function listen(node, event, handler, options) {\n\tnode.addEventListener(event, handler, options);\n\treturn () => node.removeEventListener(event, handler, options);\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function prevent_default(fn) {\n\treturn function (event) {\n\t\tevent.preventDefault();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function stop_propagation(fn) {\n\treturn function (event) {\n\t\tevent.stopPropagation();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function stop_immediate_propagation(fn) {\n\treturn function (event) {\n\t\tevent.stopImmediatePropagation();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => void} */\nexport function self(fn) {\n\treturn function (event) {\n\t\t// @ts-ignore\n\t\tif (event.target === this) fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => void} */\nexport function trusted(fn) {\n\treturn function (event) {\n\t\t// @ts-ignore\n\t\tif (event.isTrusted) fn.call(this, event);\n\t};\n}\n\n/**\n * @param {Element} node\n * @param {string} attribute\n * @param {string} [value]\n * @returns {void}\n */\nexport function attr(node, attribute, value) {\n\tif (value == null) node.removeAttribute(attribute);\n\telse if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);\n}\n/**\n * List of attributes that should always be set through the attr method,\n * because updating them through the property setter doesn't work reliably.\n * In the example of `width`/`height`, the problem is that the setter only\n * accepts numeric values, but the attribute can also be set to a string like `50%`.\n * If this list becomes too big, rethink this approach.\n */\nconst always_set_through_set_attribute = ['width', 'height'];\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {{ [x: string]: string }} attributes\n * @returns {void}\n */\nexport function set_attributes(node, attributes) {\n\t// @ts-ignore\n\tconst descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n\tfor (const key in attributes) {\n\t\tif (attributes[key] == null) {\n\t\t\tnode.removeAttribute(key);\n\t\t} else if (key === 'style') {\n\t\t\tnode.style.cssText = attributes[key];\n\t\t} else if (key === '__value') {\n\t\t\t/** @type {any} */ (node).value = node[key] = attributes[key];\n\t\t} else if (\n\t\t\tdescriptors[key] &&\n\t\t\tdescriptors[key].set &&\n\t\t\talways_set_through_set_attribute.indexOf(key) === -1\n\t\t) {\n\t\t\tnode[key] = attributes[key];\n\t\t} else {\n\t\t\tattr(node, key, attributes[key]);\n\t\t}\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {{ [x: string]: string }} attributes\n * @returns {void}\n */\nexport function set_svg_attributes(node, attributes) {\n\tfor (const key in attributes) {\n\t\tattr(node, key, attributes[key]);\n\t}\n}\n\n/**\n * @param {Record<string, unknown>} data_map\n * @returns {void}\n */\nexport function set_custom_element_data_map(node, data_map) {\n\tObject.keys(data_map).forEach((key) => {\n\t\tset_custom_element_data(node, key, data_map[key]);\n\t});\n}\n\n/**\n * @returns {void} */\nexport function set_custom_element_data(node, prop, value) {\n\tconst lower = prop.toLowerCase(); // for backwards compatibility with existing behavior we do lowercase first\n\tif (lower in node) {\n\t\tnode[lower] = typeof node[lower] === 'boolean' && value === '' ? true : value;\n\t} else if (prop in node) {\n\t\tnode[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n\t} else {\n\t\tattr(node, prop, value);\n\t}\n}\n\n/**\n * @param {string} tag\n */\nexport function set_dynamic_element_data(tag) {\n\treturn /-/.test(tag) ? set_custom_element_data_map : set_attributes;\n}\n\n/**\n * @returns {void}\n */\nexport function xlink_attr(node, attribute, value) {\n\tnode.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @returns {string}\n */\nexport function get_svelte_dataset(node) {\n\treturn node.dataset.svelteH;\n}\n\n/**\n * @returns {unknown[]} */\nexport function get_binding_group_value(group, __value, checked) {\n\tconst value = new Set();\n\tfor (let i = 0; i < group.length; i += 1) {\n\t\tif (group[i].checked) value.add(group[i].__value);\n\t}\n\tif (!checked) {\n\t\tvalue.delete(__value);\n\t}\n\treturn Array.from(value);\n}\n\n/**\n * @param {HTMLInputElement[]} group\n * @returns {{ p(...inputs: HTMLInputElement[]): void; r(): void; }}\n */\nexport function init_binding_group(group) {\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _inputs;\n\treturn {\n\t\t/* push */ p(...inputs) {\n\t\t\t_inputs = inputs;\n\t\t\t_inputs.forEach((input) => group.push(input));\n\t\t},\n\t\t/* remove */ r() {\n\t\t\t_inputs.forEach((input) => group.splice(group.indexOf(input), 1));\n\t\t}\n\t};\n}\n\n/**\n * @param {number[]} indexes\n * @returns {{ u(new_indexes: number[]): void; p(...inputs: HTMLInputElement[]): void; r: () => void; }}\n */\nexport function init_binding_group_dynamic(group, indexes) {\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _group = get_binding_group(group);\n\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _inputs;\n\n\tfunction get_binding_group(group) {\n\t\tfor (let i = 0; i < indexes.length; i++) {\n\t\t\tgroup = group[indexes[i]] = group[indexes[i]] || [];\n\t\t}\n\t\treturn group;\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction push() {\n\t\t_inputs.forEach((input) => _group.push(input));\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction remove() {\n\t\t_inputs.forEach((input) => _group.splice(_group.indexOf(input), 1));\n\t}\n\treturn {\n\t\t/* update */ u(new_indexes) {\n\t\t\tindexes = new_indexes;\n\t\t\tconst new_group = get_binding_group(group);\n\t\t\tif (new_group !== _group) {\n\t\t\t\tremove();\n\t\t\t\t_group = new_group;\n\t\t\t\tpush();\n\t\t\t}\n\t\t},\n\t\t/* push */ p(...inputs) {\n\t\t\t_inputs = inputs;\n\t\t\tpush();\n\t\t},\n\t\t/* remove */ r: remove\n\t};\n}\n\n/** @returns {number} */\nexport function to_number(value) {\n\treturn value === '' ? null : +value;\n}\n\n/** @returns {any[]} */\nexport function time_ranges_to_array(ranges) {\n\tconst array = [];\n\tfor (let i = 0; i < ranges.length; i += 1) {\n\t\tarray.push({ start: ranges.start(i), end: ranges.end(i) });\n\t}\n\treturn array;\n}\n\n/**\n * @param {Element} element\n * @returns {ChildNode[]}\n */\nexport function children(element) {\n\treturn Array.from(element.childNodes);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {void}\n */\nfunction init_claim_info(nodes) {\n\tif (nodes.claim_info === undefined) {\n\t\tnodes.claim_info = { last_index: 0, total_claimed: 0 };\n\t}\n}\n\n/**\n * @template {ChildNodeEx} R\n * @param {ChildNodeArray} nodes\n * @param {(node: ChildNodeEx) => node is R} predicate\n * @param {(node: ChildNodeEx) => ChildNodeEx | undefined} process_node\n * @param {() => R} create_node\n * @param {boolean} dont_update_last_index\n * @returns {R}\n */\nfunction claim_node(nodes, predicate, process_node, create_node, dont_update_last_index = false) {\n\t// Try to find nodes in an order such that we lengthen the longest increasing subsequence\n\tinit_claim_info(nodes);\n\tconst result_node = (() => {\n\t\t// We first try to find an element after the previous one\n\t\tfor (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (predicate(node)) {\n\t\t\t\tconst replacement = process_node(node);\n\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\tnodes.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnodes[i] = replacement;\n\t\t\t\t}\n\t\t\t\tif (!dont_update_last_index) {\n\t\t\t\t\tnodes.claim_info.last_index = i;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\t// Otherwise, we try to find one before\n\t\t// We iterate in reverse so that we don't go too far back\n\t\tfor (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (predicate(node)) {\n\t\t\t\tconst replacement = process_node(node);\n\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\tnodes.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnodes[i] = replacement;\n\t\t\t\t}\n\t\t\t\tif (!dont_update_last_index) {\n\t\t\t\t\tnodes.claim_info.last_index = i;\n\t\t\t\t} else if (replacement === undefined) {\n\t\t\t\t\t// Since we spliced before the last_index, we decrease it\n\t\t\t\t\tnodes.claim_info.last_index--;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\t// If we can't find any matching node, we create a new one\n\t\treturn create_node();\n\t})();\n\tresult_node.claim_order = nodes.claim_info.total_claimed;\n\tnodes.claim_info.total_claimed += 1;\n\treturn result_node;\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @param {(name: string) => Element | SVGElement} create_element\n * @returns {Element | SVGElement}\n */\nfunction claim_element_base(nodes, name, attributes, create_element) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Element | SVGElement} */\n\t\t(node) => node.nodeName === name,\n\t\t/** @param {Element} node */\n\t\t(node) => {\n\t\t\tconst remove = [];\n\t\t\tfor (let j = 0; j < node.attributes.length; j++) {\n\t\t\t\tconst attribute = node.attributes[j];\n\t\t\t\tif (!attributes[attribute.name]) {\n\t\t\t\t\tremove.push(attribute.name);\n\t\t\t\t}\n\t\t\t}\n\t\t\tremove.forEach((v) => node.removeAttribute(v));\n\t\t\treturn undefined;\n\t\t},\n\t\t() => create_element(name)\n\t);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @returns {Element | SVGElement}\n */\nexport function claim_element(nodes, name, attributes) {\n\treturn claim_element_base(nodes, name, attributes, element);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @returns {Element | SVGElement}\n */\nexport function claim_svg_element(nodes, name, attributes) {\n\treturn claim_element_base(nodes, name, attributes, svg_element);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {Text}\n */\nexport function claim_text(nodes, data) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Text} */\n\t\t(node) => node.nodeType === 3,\n\t\t/** @param {Text} node */\n\t\t(node) => {\n\t\t\tconst data_str = '' + data;\n\t\t\tif (node.data.startsWith(data_str)) {\n\t\t\t\tif (node.data.length !== data_str.length) {\n\t\t\t\t\treturn node.splitText(data_str.length);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode.data = data_str;\n\t\t\t}\n\t\t},\n\t\t() => text(data),\n\t\ttrue // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n\t);\n}\n\n/**\n * @returns {Text} */\nexport function claim_space(nodes) {\n\treturn claim_text(nodes, ' ');\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {Comment}\n */\nexport function claim_comment(nodes, data) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Comment} */\n\t\t(node) => node.nodeType === 8,\n\t\t/** @param {Comment} node */\n\t\t(node) => {\n\t\t\tnode.data = '' + data;\n\t\t\treturn undefined;\n\t\t},\n\t\t() => comment(data),\n\t\ttrue\n\t);\n}\n\nfunction get_comment_idx(nodes, text, start) {\n\tfor (let i = start; i < nodes.length; i += 1) {\n\t\tconst node = nodes[i];\n\t\tif (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n * @param {boolean} is_svg\n * @returns {HtmlTagHydration}\n */\nexport function claim_html_tag(nodes, is_svg) {\n\t// find html opening tag\n\tconst start_index = get_comment_idx(nodes, 'HTML_TAG_START', 0);\n\tconst end_index = get_comment_idx(nodes, 'HTML_TAG_END', start_index + 1);\n\tif (start_index === -1 || end_index === -1) {\n\t\treturn new HtmlTagHydration(is_svg);\n\t}\n\n\tinit_claim_info(nodes);\n\tconst html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n\tdetach(html_tag_nodes[0]);\n\tdetach(html_tag_nodes[html_tag_nodes.length - 1]);\n\tconst claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n\tif (claimed_nodes.length === 0) {\n\t\treturn new HtmlTagHydration(is_svg);\n\t}\n\tfor (const n of claimed_nodes) {\n\t\tn.claim_order = nodes.claim_info.total_claimed;\n\t\tnodes.claim_info.total_claimed += 1;\n\t}\n\treturn new HtmlTagHydration(is_svg, claimed_nodes);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @returns {void}\n */\nexport function set_data(text, data) {\n\tdata = '' + data;\n\tif (text.data === data) return;\n\ttext.data = /** @type {string} */ (data);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @returns {void}\n */\nexport function set_data_contenteditable(text, data) {\n\tdata = '' + data;\n\tif (text.wholeText === data) return;\n\ttext.data = /** @type {string} */ (data);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @param {string} attr_value\n * @returns {void}\n */\nexport function set_data_maybe_contenteditable(text, data, attr_value) {\n\tif (~contenteditable_truthy_values.indexOf(attr_value)) {\n\t\tset_data_contenteditable(text, data);\n\t} else {\n\t\tset_data(text, data);\n\t}\n}\n\n/**\n * @returns {void} */\nexport function set_input_value(input, value) {\n\tinput.value = value == null ? '' : value;\n}\n\n/**\n * @returns {void} */\nexport function set_input_type(input, type) {\n\ttry {\n\t\tinput.type = type;\n\t} catch (e) {\n\t\t// do nothing\n\t}\n}\n\n/**\n * @returns {void} */\nexport function set_style(node, key, value, important) {\n\tif (value == null) {\n\t\tnode.style.removeProperty(key);\n\t} else {\n\t\tnode.style.setProperty(key, value, important ? 'important' : '');\n\t}\n}\n\n/**\n * @returns {void} */\nexport function select_option(select, value, mounting) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\tif (option.__value === value) {\n\t\t\toption.selected = true;\n\t\t\treturn;\n\t\t}\n\t}\n\tif (!mounting || value !== undefined) {\n\t\tselect.selectedIndex = -1; // no option should be selected\n\t}\n}\n\n/**\n * @returns {void} */\nexport function select_options(select, value) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\toption.selected = ~value.indexOf(option.__value);\n\t}\n}\n\nexport function select_value(select) {\n\tconst selected_option = select.querySelector(':checked');\n\treturn selected_option && selected_option.__value;\n}\n\nexport function select_multiple_value(select) {\n\treturn [].map.call(select.querySelectorAll(':checked'), (option) => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\n\n/**\n * @type {boolean} */\nlet crossorigin;\n\n/**\n * @returns {boolean} */\nexport function is_crossorigin() {\n\tif (crossorigin === undefined) {\n\t\tcrossorigin = false;\n\t\ttry {\n\t\t\tif (typeof window !== 'undefined' && window.parent) {\n\t\t\t\tvoid window.parent.document;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tcrossorigin = true;\n\t\t}\n\t}\n\treturn crossorigin;\n}\n\n/**\n * @param {HTMLElement} node\n * @param {() => void} fn\n * @returns {() => void}\n */\nexport function add_iframe_resize_listener(node, fn) {\n\tconst computed_style = getComputedStyle(node);\n\tif (computed_style.position === 'static') {\n\t\tnode.style.position = 'relative';\n\t}\n\tconst iframe = element('iframe');\n\tiframe.setAttribute(\n\t\t'style',\n\t\t'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n\t\t\t'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;'\n\t);\n\tiframe.setAttribute('aria-hidden', 'true');\n\tiframe.tabIndex = -1;\n\tconst crossorigin = is_crossorigin();\n\n\t/**\n\t * @type {() => void}\n\t */\n\tlet unsubscribe;\n\tif (crossorigin) {\n\t\tiframe.src = \"data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}</script>\";\n\t\tunsubscribe = listen(\n\t\t\twindow,\n\t\t\t'message',\n\t\t\t/** @param {MessageEvent} event */ (event) => {\n\t\t\t\tif (event.source === iframe.contentWindow) fn();\n\t\t\t}\n\t\t);\n\t} else {\n\t\tiframe.src = 'about:blank';\n\t\tiframe.onload = () => {\n\t\t\tunsubscribe = listen(iframe.contentWindow, 'resize', fn);\n\t\t\t// make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n\t\t\t// see https://github.com/sveltejs/svelte/issues/4233\n\t\t\tfn();\n\t\t};\n\t}\n\tappend(node, iframe);\n\treturn () => {\n\t\tif (crossorigin) {\n\t\t\tunsubscribe();\n\t\t} else if (unsubscribe && iframe.contentWindow) {\n\t\t\tunsubscribe();\n\t\t}\n\t\tdetach(iframe);\n\t};\n}\nexport const resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'content-box'\n});\nexport const resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'border-box'\n});\nexport const resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton(\n\t{ box: 'device-pixel-content-box' }\n);\nexport { ResizeObserverSingleton };\n\n/**\n * @returns {void} */\nexport function toggle_class(element, name, toggle) {\n\t// The `!!` is required because an `undefined` flag means flipping the current state.\n\telement.classList.toggle(name, !!toggle);\n}\n\n/**\n * @template T\n * @param {string} type\n * @param {T} [detail]\n * @param {{ bubbles?: boolean, cancelable?: boolean }} [options]\n * @returns {CustomEvent<T>}\n */\nexport function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n\treturn new CustomEvent(type, { detail, bubbles, cancelable });\n}\n\n/**\n * @param {string} selector\n * @param {HTMLElement} parent\n * @returns {ChildNodeArray}\n */\nexport function query_selector_all(selector, parent = document.body) {\n\treturn Array.from(parent.querySelectorAll(selector));\n}\n\n/**\n * @param {string} nodeId\n * @param {HTMLElement} head\n * @returns {any[]}\n */\nexport function head_selector(nodeId, head) {\n\tconst result = [];\n\tlet started = 0;\n\tfor (const node of head.childNodes) {\n\t\tif (node.nodeType === 8 /* comment node */) {\n\t\t\tconst comment = node.textContent.trim();\n\t\t\tif (comment === `HEAD_${nodeId}_END`) {\n\t\t\t\tstarted -= 1;\n\t\t\t\tresult.push(node);\n\t\t\t} else if (comment === `HEAD_${nodeId}_START`) {\n\t\t\t\tstarted += 1;\n\t\t\t\tresult.push(node);\n\t\t\t}\n\t\t} else if (started > 0) {\n\t\t\tresult.push(node);\n\t\t}\n\t}\n\treturn result;\n}\n/** */\nexport class HtmlTag {\n\t/**\n\t * @private\n\t * @default false\n\t */\n\tis_svg = false;\n\t/** parent for creating node */\n\te = undefined;\n\t/** html tag nodes */\n\tn = undefined;\n\t/** target */\n\tt = undefined;\n\t/** anchor */\n\ta = undefined;\n\tconstructor(is_svg = false) {\n\t\tthis.is_svg = is_svg;\n\t\tthis.e = this.n = null;\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tc(html) {\n\t\tthis.h(html);\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @param {HTMLElement | SVGElement} target\n\t * @param {HTMLElement | SVGElement} anchor\n\t * @returns {void}\n\t */\n\tm(html, target, anchor = null) {\n\t\tif (!this.e) {\n\t\t\tif (this.is_svg)\n\t\t\t\tthis.e = svg_element(/** @type {keyof SVGElementTagNameMap} */ (target.nodeName));\n\t\t\t/** #7364 target for <template> may be provided as #document-fragment(11) */ else\n\t\t\t\tthis.e = element(\n\t\t\t\t\t/** @type {keyof HTMLElementTagNameMap} */ (\n\t\t\t\t\t\ttarget.nodeType === 11 ? 'TEMPLATE' : target.nodeName\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\tthis.t =\n\t\t\t\ttarget.tagName !== 'TEMPLATE'\n\t\t\t\t\t? target\n\t\t\t\t\t: /** @type {HTMLTemplateElement} */ (target).content;\n\t\t\tthis.c(html);\n\t\t}\n\t\tthis.i(anchor);\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\th(html) {\n\t\tthis.e.innerHTML = html;\n\t\tthis.n = Array.from(\n\t\t\tthis.e.nodeName === 'TEMPLATE' ? this.e.content.childNodes : this.e.childNodes\n\t\t);\n\t}\n\n\t/**\n\t * @returns {void} */\n\ti(anchor) {\n\t\tfor (let i = 0; i < this.n.length; i += 1) {\n\t\t\tinsert(this.t, this.n[i], anchor);\n\t\t}\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tp(html) {\n\t\tthis.d();\n\t\tthis.h(html);\n\t\tthis.i(this.a);\n\t}\n\n\t/**\n\t * @returns {void} */\n\td() {\n\t\tthis.n.forEach(detach);\n\t}\n}\n\nexport class HtmlTagHydration extends HtmlTag {\n\t/** @type {Element[]} hydration claimed nodes */\n\tl = undefined;\n\n\tconstructor(is_svg = false, claimed_nodes) {\n\t\tsuper(is_svg);\n\t\tthis.e = this.n = null;\n\t\tthis.l = claimed_nodes;\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tc(html) {\n\t\tif (this.l) {\n\t\t\tthis.n = this.l;\n\t\t} else {\n\t\t\tsuper.c(html);\n\t\t}\n\t}\n\n\t/**\n\t * @returns {void} */\n\ti(anchor) {\n\t\tfor (let i = 0; i < this.n.length; i += 1) {\n\t\t\tinsert_hydration(this.t, this.n[i], anchor);\n\t\t}\n\t}\n}\n\n/**\n * @param {NamedNodeMap} attributes\n * @returns {{}}\n */\nexport function attribute_to_object(attributes) {\n\tconst result = {};\n\tfor (const attribute of attributes) {\n\t\tresult[attribute.name] = attribute.value;\n\t}\n\treturn result;\n}\n\nconst escaped = {\n\t'\"': '"',\n\t'&': '&',\n\t'<': '<'\n};\n\nconst regex_attribute_characters_to_escape = /[\"&<]/g;\n\n/**\n * Note that the attribute itself should be surrounded in double quotes\n * @param {any} attribute\n */\nfunction escape_attribute(attribute) {\n\treturn String(attribute).replace(regex_attribute_characters_to_escape, (match) => escaped[match]);\n}\n\n/**\n * @param {Record<string, string>} attributes\n */\nexport function stringify_spread(attributes) {\n\tlet str = ' ';\n\tfor (const key in attributes) {\n\t\tif (attributes[key] != null) {\n\t\t\tstr += `${key}=\"${escape_attribute(attributes[key])}\" `;\n\t\t}\n\t}\n\n\treturn str;\n}\n\n/**\n * @param {HTMLElement} element\n * @returns {{}}\n */\nexport function get_custom_elements_slots(element) {\n\tconst result = {};\n\telement.childNodes.forEach(\n\t\t/** @param {Element} node */ (node) => {\n\t\t\tresult[node.slot || 'default'] = true;\n\t\t}\n\t);\n\treturn result;\n}\n\nexport function construct_svelte_component(component, props) {\n\treturn new component(props);\n}\n\n/**\n * @typedef {Node & {\n * \tclaim_order?: number;\n * \thydrate_init?: true;\n * \tactual_end_child?: NodeEx;\n * \tchildNodes: NodeListOf<NodeEx>;\n * }} NodeEx\n */\n\n/** @typedef {ChildNode & NodeEx} ChildNodeEx */\n\n/** @typedef {NodeEx & { claim_order: number }} NodeEx2 */\n\n/**\n * @typedef {ChildNodeEx[] & {\n * \tclaim_info?: {\n * \t\tlast_index: number;\n * \t\ttotal_claimed: number;\n * \t};\n * }} ChildNodeArray\n */\n","import { custom_event } from './dom.js';\n\nexport let current_component;\n\n/** @returns {void} */\nexport function set_current_component(component) {\n\tcurrent_component = component;\n}\n\nexport function get_current_component() {\n\tif (!current_component) throw new Error('Function called outside component initialization');\n\treturn current_component;\n}\n\n/**\n * Schedules a callback to run immediately before the component is updated after any state change.\n *\n * The first time the callback runs will be before the initial `onMount`\n *\n * https://svelte.dev/docs/svelte#beforeupdate\n * @param {() => any} fn\n * @returns {void}\n */\nexport function beforeUpdate(fn) {\n\tget_current_component().$$.before_update.push(fn);\n}\n\n/**\n * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.\n * It must be called during the component's initialisation (but doesn't need to live *inside* the component;\n * it can be called from an external module).\n *\n * If a function is returned _synchronously_ from `onMount`, it will be called when the component is unmounted.\n *\n * `onMount` does not run inside a [server-side component](https://svelte.dev/docs#run-time-server-side-component-api).\n *\n * https://svelte.dev/docs/svelte#onmount\n * @template T\n * @param {() => import('./private.js').NotFunction<T> | Promise<import('./private.js').NotFunction<T>> | (() => any)} fn\n * @returns {void}\n */\nexport function onMount(fn) {\n\tget_current_component().$$.on_mount.push(fn);\n}\n\n/**\n * Schedules a callback to run immediately after the component has been updated.\n *\n * The first time the callback runs will be after the initial `onMount`\n *\n * https://svelte.dev/docs/svelte#afterupdate\n * @param {() => any} fn\n * @returns {void}\n */\nexport function afterUpdate(fn) {\n\tget_current_component().$$.after_update.push(fn);\n}\n\n/**\n * Schedules a callback to run immediately before the component is unmounted.\n *\n * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the\n * only one that runs inside a server-side component.\n *\n * https://svelte.dev/docs/svelte#ondestroy\n * @param {() => any} fn\n * @returns {void}\n */\nexport function onDestroy(fn) {\n\tget_current_component().$$.on_destroy.push(fn);\n}\n\n/**\n * Creates an event dispatcher that can be used to dispatch [component events](https://svelte.dev/docs#template-syntax-component-directives-on-eventname).\n * Event dispatchers are functions that can take two arguments: `name` and `detail`.\n *\n * Component events created with `createEventDispatcher` create a\n * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).\n * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).\n * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)\n * property and can contain any type of data.\n *\n * The event dispatcher can be typed to narrow the allowed event names and the type of the `detail` argument:\n * ```ts\n * const dispatch = createEventDispatcher<{\n * loaded: never; // does not take a detail argument\n * change: string; // takes a detail argument of type string, which is required\n * optional: number | null; // takes an optional detail argument of type number\n * }>();\n * ```\n *\n * https://svelte.dev/docs/svelte#createeventdispatcher\n * @template {Record<string, any>} [EventMap=any]\n * @returns {import('./public.js').EventDispatcher<EventMap>}\n */\nexport function createEventDispatcher() {\n\tconst component = get_current_component();\n\treturn (type, detail, { cancelable = false } = {}) => {\n\t\tconst callbacks = component.$$.callbacks[type];\n\t\tif (callbacks) {\n\t\t\t// TODO are there situations where events could be dispatched\n\t\t\t// in a server (non-DOM) environment?\n\t\t\tconst event = custom_event(/** @type {string} */ (type), detail, { cancelable });\n\t\t\tcallbacks.slice().forEach((fn) => {\n\t\t\t\tfn.call(component, event);\n\t\t\t});\n\t\t\treturn !event.defaultPrevented;\n\t\t}\n\t\treturn true;\n\t};\n}\n\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#setcontext\n * @template T\n * @param {any} key\n * @param {T} context\n * @returns {T}\n */\nexport function setContext(key, context) {\n\tget_current_component().$$.context.set(key, context);\n\treturn context;\n}\n\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#getcontext\n * @template T\n * @param {any} key\n * @returns {T}\n */\nexport function getContext(key) {\n\treturn get_current_component().$$.context.get(key);\n}\n\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * https://svelte.dev/docs/svelte#getallcontexts\n * @template {Map<any, any>} [T=Map<any, any>]\n * @returns {T}\n */\nexport function getAllContexts() {\n\treturn get_current_component().$$.context;\n}\n\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs/svelte#hascontext\n * @param {any} key\n * @returns {boolean}\n */\nexport function hasContext(key) {\n\treturn get_current_component().$$.context.has(key);\n}\n\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\n/**\n * @param component\n * @param event\n * @returns {void}\n */\nexport function bubble(component, event) {\n\tconst callbacks = component.$$.callbacks[event.type];\n\tif (callbacks) {\n\t\t// @ts-ignore\n\t\tcallbacks.slice().forEach((fn) => fn.call(this, event));\n\t}\n}\n","import { run_all } from './utils.js';\nimport { current_component, set_current_component } from './lifecycle.js';\n\nexport const dirty_components = [];\nexport const intros = { enabled: false };\nexport const binding_callbacks = [];\n\nlet render_callbacks = [];\n\nconst flush_callbacks = [];\n\nconst resolved_promise = /* @__PURE__ */ Promise.resolve();\n\nlet update_scheduled = false;\n\n/** @returns {void} */\nexport function schedule_update() {\n\tif (!update_scheduled) {\n\t\tupdate_scheduled = true;\n\t\tresolved_promise.then(flush);\n\t}\n}\n\n/** @returns {Promise<void>} */\nexport function tick() {\n\tschedule_update();\n\treturn resolved_promise;\n}\n\n/** @returns {void} */\nexport function add_render_callback(fn) {\n\trender_callbacks.push(fn);\n}\n\n/** @returns {void} */\nexport function add_flush_callback(fn) {\n\tflush_callbacks.push(fn);\n}\n\n// flush() calls callbacks in this order:\n// 1. All beforeUpdate callbacks, in order: parents before children\n// 2. All bind:this callbacks, in reverse order: children before parents.\n// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT\n// for afterUpdates called during the initial onMount, which are called in\n// reverse order: children before parents.\n// Since callbacks might update component values, which could trigger another\n// call to flush(), the following steps guard against this:\n// 1. During beforeUpdate, any updated components will be added to the\n// dirty_components array and will cause a reentrant call to flush(). Because\n// the flush index is kept outside the function, the reentrant call will pick\n// up where the earlier call left off and go through all dirty components. The\n// current_component value is saved and restored so that the reentrant call will\n// not interfere with the \"parent\" flush() call.\n// 2. bind:this callbacks cannot trigger new flush() calls.\n// 3. During afterUpdate, any updated components will NOT have their afterUpdate\n// callback called a second time; the seen_callbacks set, outside the flush()\n// function, guarantees this behavior.\nconst seen_callbacks = new Set();\n\nlet flushidx = 0; // Do *not* move this inside the flush() function\n\n/** @returns {void} */\nexport function flush() {\n\t// Do not reenter flush while dirty components are updated, as this can\n\t// result in an infinite loop. Instead, let the inner flush handle it.\n\t// Reentrancy is ok afterwards for bindings etc.\n\tif (flushidx !== 0) {\n\t\treturn;\n\t}\n\tconst saved_component = current_component;\n\tdo {\n\t\t// first, call beforeUpdate functions\n\t\t// and update components\n\t\ttry {\n\t\t\twhile (flushidx < dirty_components.length) {\n\t\t\t\tconst component = dirty_components[flushidx];\n\t\t\t\tflushidx++;\n\t\t\t\tset_current_component(component);\n\t\t\t\tupdate(component.$$);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// reset dirty state to not end up in a deadlocked state and then rethrow\n\t\t\tdirty_components.length = 0;\n\t\t\tflushidx = 0;\n\t\t\tthrow e;\n\t\t}\n\t\tset_current_component(null);\n\t\tdirty_components.length = 0;\n\t\tflushidx = 0;\n\t\twhile (binding_callbacks.length) binding_callbacks.pop()();\n\t\t// then, once components are updated, call\n\t\t// afterUpdate functions. This may cause\n\t\t// subsequent updates...\n\t\tfor (let i = 0; i < render_callbacks.length; i += 1) {\n\t\t\tconst callback = render_callbacks[i];\n\t\t\tif (!seen_callbacks.has(callback)) {\n\t\t\t\t// ...so guard against infinite loops\n\t\t\t\tseen_callbacks.add(callback);\n\t\t\t\tcallback();\n\t\t\t}\n\t\t}\n\t\trender_callbacks.length = 0;\n\t} while (dirty_components.length);\n\twhile (flush_callbacks.length) {\n\t\tflush_callbacks.pop()();\n\t}\n\tupdate_scheduled = false;\n\tseen_callbacks.clear();\n\tset_current_component(saved_component);\n}\n\n/** @returns {void} */\nfunction update($$) {\n\tif ($$.fragment !== null) {\n\t\t$$.update();\n\t\trun_all($$.before_update);\n\t\tconst dirty = $$.dirty;\n\t\t$$.dirty = [-1];\n\t\t$$.fragment && $$.fragment.p($$.ctx, dirty);\n\t\t$$.after_update.forEach(add_render_callback);\n\t}\n}\n\n/**\n * Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.\n * @param {Function[]} fns\n * @returns {void}\n */\nexport function flush_render_callbacks(fns) {\n\tconst filtered = [];\n\tconst targets = [];\n\trender_callbacks.forEach((c) => (fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c)));\n\ttargets.forEach((c) => c());\n\trender_callbacks = filtered;\n}\n","import { identity as linear, is_function, noop, run_all } from './utils.js';\nimport { now } from './environment.js';\nimport { loop } from './loop.js';\nimport { create_rule, delete_rule } from './style_manager.js';\nimport { custom_event } from './dom.js';\nimport { add_render_callback } from './scheduler.js';\n\n/**\n * @type {Promise<void> | null}\n */\nlet promise;\n\n/**\n * @returns {Promise<void>}\n */\nfunction wait() {\n\tif (!promise) {\n\t\tpromise = Promise.resolve();\n\t\tpromise.then(() => {\n\t\t\tpromise = null;\n\t\t});\n\t}\n\treturn promise;\n}\n\n/**\n * @param {Element} node\n * @param {INTRO | OUTRO | boolean} direction\n * @param {'start' | 'end'} kind\n * @returns {void}\n */\nfunction dispatch(node, direction, kind) {\n\tnode.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\n\nconst outroing = new Set();\n\n/**\n * @type {Outro}\n */\nlet outros;\n\n/**\n * @returns {void} */\nexport function group_outros() {\n\toutros = {\n\t\tr: 0,\n\t\tc: [],\n\t\tp: outros // parent group\n\t};\n}\n\n/**\n * @returns {void} */\nexport function check_outros() {\n\tif (!outros.r) {\n\t\trun_all(outros.c);\n\t}\n\toutros = outros.p;\n}\n\n/**\n * @param {import('./private.js').Fragment} block\n * @param {0 | 1} [local]\n * @returns {void}\n */\nexport function transition_in(block, local) {\n\tif (block && block.i) {\n\t\toutroing.delete(block);\n\t\tblock.i(local);\n\t}\n}\n\n/**\n * @param {import('./private.js').Fragment} block\n * @param {0 | 1} local\n * @param {0 | 1} [detach]\n * @param {() => void} [callback]\n * @returns {void}\n */\nexport function transition_out(block, local, detach, callback) {\n\tif (block && block.o) {\n\t\tif (outroing.has(block)) return;\n\t\toutroing.add(block);\n\t\toutros.c.push(() => {\n\t\t\toutroing.delete(block);\n\t\t\tif (callback) {\n\t\t\t\tif (detach) block.d(1);\n\t\t\t\tcallback();\n\t\t\t}\n\t\t});\n\t\tblock.o(local);\n\t} else if (callback) {\n\t\tcallback();\n\t}\n}\n\n/**\n * @type {import('../transition/public.js').TransitionConfig}\n */\nconst null_transition = { duration: 0 };\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @returns {{ start(): void; invalidate(): void; end(): void; }}\n */\nexport function create_in_transition(node, fn, params) {\n\t/**\n\t * @type {TransitionOptions} */\n\tconst options = { direction: 'in' };\n\tlet config = fn(node, params, options);\n\tlet running = false;\n\tlet animation_name;\n\tlet task;\n\tlet uid = 0;\n\n\t/**\n\t * @returns {void} */\n\tfunction cleanup() {\n\t\tif (animation_name) delete_rule(node, animation_name);\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction go() {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\t\tif (css) animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n\t\ttick(0, 1);\n\t\tconst start_time = now() + delay;\n\t\tconst end_time = start_time + duration;\n\t\tif (task) task.abort();\n\t\trunning = true;\n\t\tadd_render_callback(() => dispatch(node, true, 'start'));\n\t\ttask = loop((now) => {\n\t\t\tif (running) {\n\t\t\t\tif (now >= end_time) {\n\t\t\t\t\ttick(1, 0);\n\t\t\t\t\tdispatch(node, true, 'end');\n\t\t\t\t\tcleanup();\n\t\t\t\t\treturn (running = false);\n\t\t\t\t}\n\t\t\t\tif (now >= start_time) {\n\t\t\t\t\tconst t = easing((now - start_time) / duration);\n\t\t\t\t\ttick(t, 1 - t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn running;\n\t\t});\n\t}\n\tlet started = false;\n\treturn {\n\t\tstart() {\n\t\t\tif (started) return;\n\t\t\tstarted = true;\n\t\t\tdelete_rule(node);\n\t\t\tif (is_function(config)) {\n\t\t\t\tconfig = config(options);\n\t\t\t\twait().then(go);\n\t\t\t} else {\n\t\t\t\tgo();\n\t\t\t}\n\t\t},\n\t\tinvalidate() {\n\t\t\tstarted = false;\n\t\t},\n\t\tend() {\n\t\t\tif (running) {\n\t\t\t\tcleanup();\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @returns {{ end(reset: any): void; }}\n */\nexport function create_out_transition(node, fn, params) {\n\t/** @type {TransitionOptions} */\n\tconst options = { direction: 'out' };\n\tlet config = fn(node, params, options);\n\tlet running = true;\n\tlet animation_name;\n\tconst group = outros;\n\tgroup.r += 1;\n\t/** @type {boolean} */\n\tlet original_inert_value;\n\n\t/**\n\t * @returns {void} */\n\tfunction go() {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\n\t\tif (css) animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n\n\t\tconst start_time = now() + delay;\n\t\tconst end_time = start_time + duration;\n\t\tadd_render_callback(() => dispatch(node, false, 'start'));\n\n\t\tif ('inert' in node) {\n\t\t\toriginal_inert_value = /** @type {HTMLElement} */ (node).inert;\n\t\t\tnode.inert = true;\n\t\t}\n\n\t\tloop((now) => {\n\t\t\tif (running) {\n\t\t\t\tif (now >= end_time) {\n\t\t\t\t\ttick(0, 1);\n\t\t\t\t\tdispatch(node, false, 'end');\n\t\t\t\t\tif (!--group.r) {\n\t\t\t\t\t\t// this will result in `end()` being called,\n\t\t\t\t\t\t// so we don't need to clean up here\n\t\t\t\t\t\trun_all(group.c);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (now >= start_time) {\n\t\t\t\t\tconst t = easing((now - start_time) / duration);\n\t\t\t\t\ttick(1 - t, t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn running;\n\t\t});\n\t}\n\n\tif (is_function(config)) {\n\t\twait().then(() => {\n\t\t\t// @ts-ignore\n\t\t\tconfig = config(options);\n\t\t\tgo();\n\t\t});\n\t} else {\n\t\tgo();\n\t}\n\n\treturn {\n\t\tend(reset) {\n\t\t\tif (reset && 'inert' in node) {\n\t\t\t\tnode.inert = original_inert_value;\n\t\t\t}\n\t\t\tif (reset && config.tick) {\n\t\t\t\tconfig.tick(1, 0);\n\t\t\t}\n\t\t\tif (running) {\n\t\t\t\tif (animation_name) delete_rule(node, animation_name);\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {TransitionFn} fn\n * @param {any} params\n * @param {boolean} intro\n * @returns {{ run(b: 0 | 1): void; end(): void; }}\n */\nexport function create_bidirectional_transition(node, fn, params, intro) {\n\t/**\n\t * @type {TransitionOptions} */\n\tconst options = { direction: 'both' };\n\tlet config = fn(node, params, options);\n\tlet t = intro ? 0 : 1;\n\n\t/**\n\t * @type {Program | null} */\n\tlet running_program = null;\n\n\t/**\n\t * @type {PendingProgram | null} */\n\tlet pending_program = null;\n\tlet animation_name = null;\n\n\t/** @type {boolean} */\n\tlet original_inert_value;\n\n\t/**\n\t * @returns {void} */\n\tfunction clear_animation() {\n\t\tif (animation_name) delete_rule(node, animation_name);\n\t}\n\n\t/**\n\t * @param {PendingProgram} program\n\t * @param {number} duration\n\t * @returns {Program}\n\t */\n\tfunction init(program, duration) {\n\t\tconst d = /** @type {Program['d']} */ (program.b - t);\n\t\tduration *= Math.abs(d);\n\t\treturn {\n\t\t\ta: t,\n\t\t\tb: program.b,\n\t\t\td,\n\t\t\tduration,\n\t\t\tstart: program.start,\n\t\t\tend: program.start + duration,\n\t\t\tgroup: program.group\n\t\t};\n\t}\n\n\t/**\n\t * @param {INTRO | OUTRO} b\n\t * @returns {void}\n\t */\n\tfunction go(b) {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = linear,\n\t\t\ttick = noop,\n\t\t\tcss\n\t\t} = config || null_transition;\n\n\t\t/**\n\t\t * @type {PendingProgram} */\n\t\tconst program = {\n\t\t\tstart: now() + delay,\n\t\t\tb\n\t\t};\n\n\t\tif (!b) {\n\t\t\t// @ts-ignore todo: improve typings\n\t\t\tprogram.group = outros;\n\t\t\toutros.r += 1;\n\t\t}\n\n\t\tif ('inert' in node) {\n\t\t\tif (b) {\n\t\t\t\tif (original_inert_value !== undefined) {\n\t\t\t\t\t// aborted/reversed outro — restore previous inert value\n\t\t\t\t\tnode.inert = original_inert_value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toriginal_inert_value = /** @type {HTMLElement} */ (node).inert;\n\t\t\t\tnode.inert = true;\n\t\t\t}\n\t\t}\n\n\t\tif (running_program || pending_program) {\n\t\t\tpending_program = program;\n\t\t} else {\n\t\t\t// if this is an intro, and there's a delay, we need to do\n\t\t\t// an initial tick and/or apply CSS animation immediately\n\t\t\tif (css) {\n\t\t\t\tclear_animation();\n\t\t\t\tanimation_name = create_rule(node, t, b, duration, delay, easing, css);\n\t\t\t}\n\t\t\tif (b) tick(0, 1);\n\t\t\trunning_program = init(program, duration);\n\t\t\tadd_render_callback(() => dispatch(node, b, 'start'));\n\t\t\tloop((now) => {\n\t\t\t\tif (pending_program && now > pending_program.start) {\n\t\t\t\t\trunning_program = init(pending_program, duration);\n\t\t\t\t\tpending_program = null;\n\t\t\t\t\tdispatch(node, running_program.b, 'start');\n\t\t\t\t\tif (css) {\n\t\t\t\t\t\tclear_animation();\n\t\t\t\t\t\tanimation_name = create_rule(\n\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\tt,\n\t\t\t\t\t\t\trunning_program.b,\n\t\t\t\t\t\t\trunning_program.duration,\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\teasing,\n\t\t\t\t\t\t\tconfig.css\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (running_program) {\n\t\t\t\t\tif (now >= running_program.end) {\n\t\t\t\t\t\ttick((t = running_program.b), 1 - t);\n\t\t\t\t\t\tdispatch(node, running_program.b, 'end');\n\t\t\t\t\t\tif (!pending_program) {\n\t\t\t\t\t\t\t// we're done\n\t\t\t\t\t\t\tif (running_program.b) {\n\t\t\t\t\t\t\t\t// intro — we can tidy up immediately\n\t\t\t\t\t\t\t\tclear_animation();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// outro — needs to be coordinated\n\t\t\t\t\t\t\t\tif (!--running_program.group.r) run_all(running_program.group.c);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trunning_program = null;\n\t\t\t\t\t} else if (now >= running_program.start) {\n\t\t\t\t\t\tconst p = now - running_program.start;\n\t\t\t\t\t\tt = running_program.a + running_program.d * easing(p / running_program.duration);\n\t\t\t\t\t\ttick(t, 1 - t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn !!(running_program || pending_program);\n\t\t\t});\n\t\t}\n\t}\n\treturn {\n\t\trun(b) {\n\t\t\tif (is_function(config)) {\n\t\t\t\twait().then(() => {\n\t\t\t\t\tconst opts = { direction: b ? 'in' : 'out' };\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tconfig = config(opts);\n\t\t\t\t\tgo(b);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tgo(b);\n\t\t\t}\n\t\t},\n\t\tend() {\n\t\t\tclear_animation();\n\t\t\trunning_program = pending_program = null;\n\t\t}\n\t};\n}\n\n/** @typedef {1} INTRO */\n/** @typedef {0} OUTRO */\n/** @typedef {{ direction: 'in' | 'out' | 'both' }} TransitionOptions */\n/** @typedef {(node: Element, params: any, options: TransitionOptions) => import('../transition/public.js').TransitionConfig} TransitionFn */\n\n/**\n * @typedef {Object} Outro\n * @property {number} r\n * @property {Function[]} c\n * @property {Object} p\n */\n\n/**\n * @typedef {Object} PendingProgram\n * @property {number} start\n * @property {INTRO|OUTRO} b\n * @property {Outro} [group]\n */\n\n/**\n * @typedef {Object} Program\n * @property {number} a\n * @property {INTRO|OUTRO} b\n * @property {1|-1} d\n * @property {number} duration\n * @property {number} start\n * @property {number} end\n * @property {Outro} [group]\n */\n","import { transition_in, transition_out } from './transitions.js';\nimport { run_all } from './utils.js';\n\n// general each functions:\n\nexport function ensure_array_like(array_like_or_iterator) {\n\treturn array_like_or_iterator?.length !== undefined\n\t\t? array_like_or_iterator\n\t\t: Array.from(array_like_or_iterator);\n}\n\n// keyed each functions:\n\n/** @returns {void} */\nexport function destroy_block(block, lookup) {\n\tblock.d(1);\n\tlookup.delete(block.key);\n}\n\n/** @returns {void} */\nexport function outro_and_destroy_block(block, lookup) {\n\ttransition_out(block, 1, 1, () => {\n\t\tlookup.delete(block.key);\n\t});\n}\n\n/** @returns {void} */\nexport function fix_and_destroy_block(block, lookup) {\n\tblock.f();\n\tdestroy_block(block, lookup);\n}\n\n/** @returns {void} */\nexport function fix_and_outro_and_destroy_block(block, lookup) {\n\tblock.f();\n\toutro_and_destroy_block(block, lookup);\n}\n\n/** @returns {any[]} */\nexport function update_keyed_each(\n\told_blocks,\n\tdirty,\n\tget_key,\n\tdynamic,\n\tctx,\n\tlist,\n\tlookup,\n\tnode,\n\tdestroy,\n\tcreate_each_block,\n\tnext,\n\tget_context\n) {\n\tlet o = old_blocks.length;\n\tlet n = list.length;\n\tlet i = o;\n\tconst old_indexes = {};\n\twhile (i--) old_indexes[old_blocks[i].key] = i;\n\tconst new_blocks = [];\n\tconst new_lookup = new Map();\n\tconst deltas = new Map();\n\tconst updates = [];\n\ti = n;\n\twhile (i--) {\n\t\tconst child_ctx = get_context(ctx, list, i);\n\t\tconst key = get_key(child_ctx);\n\t\tlet block = lookup.get(key);\n\t\tif (!block) {\n\t\t\tblock = create_each_block(key, child_ctx);\n\t\t\tblock.c();\n\t\t} else if (dynamic) {\n\t\t\t// defer updates until all the DOM shuffling is done\n\t\t\tupdates.push(() => block.p(child_ctx, dirty));\n\t\t}\n\t\tnew_lookup.set(key, (new_blocks[i] = block));\n\t\tif (key in old_indexes) deltas.set(key, Math.abs(i - old_indexes[key]));\n\t}\n\tconst will_move = new Set();\n\tconst did_move = new Set();\n\t/** @returns {void} */\n\tfunction insert(block) {\n\t\ttransition_in(block, 1);\n\t\tblock.m(node, next);\n\t\tlookup.set(block.key, block);\n\t\tnext = block.first;\n\t\tn--;\n\t}\n\twhile (o && n) {\n\t\tconst new_block = new_blocks[n - 1];\n\t\tconst old_block = old_blocks[o - 1];\n\t\tconst new_key = new_block.key;\n\t\tconst old_key = old_block.key;\n\t\tif (new_block === old_block) {\n\t\t\t// do nothing\n\t\t\tnext = new_block.first;\n\t\t\to--;\n\t\t\tn--;\n\t\t} else if (!new_lookup.has(old_key)) {\n\t\t\t// remove old block\n\t\t\tdestroy(old_block, lookup);\n\t\t\to--;\n\t\t} else if (!lookup.has(new_key) || will_move.has(new_key)) {\n\t\t\tinsert(new_block);\n\t\t} else if (did_move.has(old_key)) {\n\t\t\to--;\n\t\t} else if (deltas.get(new_key) > deltas.get(old_key)) {\n\t\t\tdid_move.add(new_key);\n\t\t\tinsert(new_block);\n\t\t} else {\n\t\t\twill_move.add(old_key);\n\t\t\to--;\n\t\t}\n\t}\n\twhile (o--) {\n\t\tconst old_block = old_blocks[o];\n\t\tif (!new_lookup.has(old_block.key)) destroy(old_block, lookup);\n\t}\n\twhile (n) insert(new_blocks[n - 1]);\n\trun_all(updates);\n\treturn new_blocks;\n}\n\n/** @returns {void} */\nexport function validate_each_keys(ctx, list, get_context, get_key) {\n\tconst keys = new Map();\n\tfor (let i = 0; i < list.length; i++) {\n\t\tconst key = get_key(get_context(ctx, list, i));\n\t\tif (keys.has(key)) {\n\t\t\tlet value = '';\n\t\t\ttry {\n\t\t\t\tvalue = `with value '${String(key)}' `;\n\t\t\t} catch (e) {\n\t\t\t\t// can't stringify\n\t\t\t}\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot have duplicate keys in a keyed each: Keys at index ${keys.get(\n\t\t\t\t\tkey\n\t\t\t\t)} and ${i} ${value}are duplicates`\n\t\t\t);\n\t\t}\n\t\tkeys.set(key, i);\n\t}\n}\n","import {\n\tadd_render_callback,\n\tflush,\n\tflush_render_callbacks,\n\tschedule_update,\n\tdirty_components\n} from './scheduler.js';\nimport { current_component, set_current_component } from './lifecycle.js';\nimport { blank_object, is_empty, is_function, run, run_all, noop } from './utils.js';\nimport {\n\tchildren,\n\tdetach,\n\tstart_hydrating,\n\tend_hydrating,\n\tget_custom_elements_slots,\n\tinsert,\n\telement,\n\tattr\n} from './dom.js';\nimport { transition_in } from './transitions.js';\n\n/** @returns {void} */\nexport function bind(component, name, callback) {\n\tconst index = component.$$.props[name];\n\tif (index !== undefined) {\n\t\tcomponent.$$.bound[index] = callback;\n\t\tcallback(component.$$.ctx[index]);\n\t}\n}\n\n/** @returns {void} */\nexport function create_component(block) {\n\tblock && block.c();\n}\n\n/** @returns {void} */\nexport function claim_component(block, parent_nodes) {\n\tblock && block.l(parent_nodes);\n}\n\n/** @returns {void} */\nexport function mount_component(component, target, anchor) {\n\tconst { fragment, after_update } = component.$$;\n\tfragment && fragment.m(target, anchor);\n\t// onMount happens before the initial afterUpdate\n\tadd_render_callback(() => {\n\t\tconst new_on_destroy = component.$$.on_mount.map(run).filter(is_function);\n\t\t// if the component was destroyed immediately\n\t\t// it will update the `$$.on_destroy` reference to `null`.\n\t\t// the destructured on_destroy may still reference to the old array\n\t\tif (component.$$.on_destroy) {\n\t\t\tcomponent.$$.on_destroy.push(...new_on_destroy);\n\t\t} else {\n\t\t\t// Edge case - component was destroyed immediately,\n\t\t\t// most likely as a result of a binding initialising\n\t\t\trun_all(new_on_destroy);\n\t\t}\n\t\tcomponent.$$.on_mount = [];\n\t});\n\tafter_update.forEach(add_render_callback);\n}\n\n/** @returns {void} */\nexport function destroy_component(component, detaching) {\n\tconst $$ = component.$$;\n\tif ($$.fragment !== null) {\n\t\tflush_render_callbacks($$.after_update);\n\t\trun_all($$.on_destroy);\n\t\t$$.fragment && $$.fragment.d(detaching);\n\t\t// TODO null out other refs, including component.$$ (but need to\n\t\t// preserve final state?)\n\t\t$$.on_destroy = $$.fragment = null;\n\t\t$$.ctx = [];\n\t}\n}\n\n/** @returns {void} */\nfunction make_dirty(component, i) {\n\tif (component.$$.dirty[0] === -1) {\n\t\tdirty_components.push(component);\n\t\tschedule_update();\n\t\tcomponent.$$.dirty.fill(0);\n\t}\n\tcomponent.$$.dirty[(i / 31) | 0] |= 1 << i % 31;\n}\n\n// TODO: Document the other params\n/**\n * @param {SvelteComponent} component\n * @param {import('./public.js').ComponentConstructorOptions} options\n *\n * @param {import('./utils.js')['not_equal']} not_equal Used to compare props and state values.\n * @param {(target: Element | ShadowRoot) => void} [append_styles] Function that appends styles to the DOM when the component is first initialised.\n * This will be the `add_css` function from the compiled component.\n *\n * @returns {void}\n */\nexport function init(\n\tcomponent,\n\toptions,\n\tinstance,\n\tcreate_fragment,\n\tnot_equal,\n\tprops,\n\tappend_styles = null,\n\tdirty = [-1]\n) {\n\tconst parent_component = current_component;\n\tset_current_component(component);\n\t/** @type {import('./private.js').T$$} */\n\tconst $$ = (component.$$ = {\n\t\tfragment: null,\n\t\tctx: [],\n\t\t// state\n\t\tprops,\n\t\tupdate: noop,\n\t\tnot_equal,\n\t\tbound: blank_object(),\n\t\t// lifecycle\n\t\ton_mount: [],\n\t\ton_destroy: [],\n\t\ton_disconnect: [],\n\t\tbefore_update: [],\n\t\tafter_update: [],\n\t\tcontext: new Map(options.context || (parent_component ? parent_component.$$.context : [])),\n\t\t// everything else\n\t\tcallbacks: blank_object(),\n\t\tdirty,\n\t\tskip_bound: false,\n\t\troot: options.target || parent_component.$$.root\n\t});\n\tappend_styles && append_styles($$.root);\n\tlet ready = false;\n\t$$.ctx = instance\n\t\t? instance(component, options.props || {}, (i, ret, ...rest) => {\n\t\t\t\tconst value = rest.length ? rest[0] : ret;\n\t\t\t\tif ($$.ctx && not_equal($$.ctx[i], ($$.ctx[i] = value))) {\n\t\t\t\t\tif (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);\n\t\t\t\t\tif (ready) make_dirty(component, i);\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t })\n\t\t: [];\n\t$$.update();\n\tready = true;\n\trun_all($$.before_update);\n\t// `false` as a special case of no DOM component\n\t$$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n\tif (options.target) {\n\t\tif (options.hydrate) {\n\t\t\tstart_hydrating();\n\t\t\t// TODO: what is the correct type here?\n\t\t\t// @ts-expect-error\n\t\t\tconst nodes = children(options.target);\n\t\t\t$$.fragment && $$.fragment.l(nodes);\n\t\t\tnodes.forEach(detach);\n\t\t} else {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t$$.fragment && $$.fragment.c();\n\t\t}\n\t\tif (options.intro) transition_in(component.$$.fragment);\n\t\tmount_component(component, options.target, options.anchor);\n\t\tend_hydrating();\n\t\tflush();\n\t}\n\tset_current_component(parent_component);\n}\n\nexport let SvelteElement;\n\nif (typeof HTMLElement === 'function') {\n\tSvelteElement = class extends HTMLElement {\n\t\t/** The Svelte component constructor */\n\t\t$$ctor;\n\t\t/** Slots */\n\t\t$$s;\n\t\t/** The Svelte component instance */\n\t\t$$c;\n\t\t/** Whether or not the custom element is connected */\n\t\t$$cn = false;\n\t\t/** Component props data */\n\t\t$$d = {};\n\t\t/** `true` if currently in the process of reflecting component props back to attributes */\n\t\t$$r = false;\n\t\t/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */\n\t\t$$p_d = {};\n\t\t/** @type {Record<string, Function[]>} Event listeners */\n\t\t$$l = {};\n\t\t/** @type {Map<Function, Function>} Event listener unsubscribe functions */\n\t\t$$l_u = new Map();\n\n\t\tconstructor($$componentCtor, $$slots, use_shadow_dom) {\n\t\t\tsuper();\n\t\t\tthis.$$ctor = $$componentCtor;\n\t\t\tthis.$$s = $$slots;\n\t\t\tif (use_shadow_dom) {\n\t\t\t\tthis.attachShadow({ mode: 'open' });\n\t\t\t}\n\t\t}\n\n\t\taddEventListener(type, listener, options) {\n\t\t\t// We can't determine upfront if the event is a custom event or not, so we have to\n\t\t\t// listen to both. If someone uses a custom event with the same name as a regular\n\t\t\t// browser event, this fires twice - we can't avoid that.\n\t\t\tthis.$$l[type] = this.$$l[type] || [];\n\t\t\tthis.$$l[type].push(listener);\n\t\t\tif (this.$$c) {\n\t\t\t\tconst unsub = this.$$c.$on(type, listener);\n\t\t\t\tthis.$$l_u.set(listener, unsub);\n\t\t\t}\n\t\t\tsuper.addEventListener(type, listener, options);\n\t\t}\n\n\t\tremoveEventListener(type, listener, options) {\n\t\t\tsuper.removeEventListener(type, listener, options);\n\t\t\tif (this.$$c) {\n\t\t\t\tconst unsub = this.$$l_u.get(listener);\n\t\t\t\tif (unsub) {\n\t\t\t\t\tunsub();\n\t\t\t\t\tthis.$$l_u.delete(listener);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tasync connectedCallback() {\n\t\t\tthis.$$cn = true;\n\t\t\tif (!this.$$c) {\n\t\t\t\t// We wait one tick to let possible child slot elements be created/mounted\n\t\t\t\tawait Promise.resolve();\n\t\t\t\tif (!this.$$cn || this.$$c) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfunction create_slot(name) {\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tlet node;\n\t\t\t\t\t\tconst obj = {\n\t\t\t\t\t\t\tc: function create() {\n\t\t\t\t\t\t\t\tnode = element('slot');\n\t\t\t\t\t\t\t\tif (name !== 'default') {\n\t\t\t\t\t\t\t\t\tattr(node, 'name', name);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * @param {HTMLElement} target\n\t\t\t\t\t\t\t * @param {HTMLElement} [anchor]\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tm: function mount(target, anchor) {\n\t\t\t\t\t\t\t\tinsert(target, node, anchor);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\td: function destroy(detaching) {\n\t\t\t\t\t\t\t\tif (detaching) {\n\t\t\t\t\t\t\t\t\tdetach(node);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn obj;\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst $$slots = {};\n\t\t\t\tconst existing_slots = get_custom_elements_slots(this);\n\t\t\t\tfor (const name of this.$$s) {\n\t\t\t\t\tif (name in existing_slots) {\n\t\t\t\t\t\t$$slots[name] = [create_slot(name)];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const attribute of this.attributes) {\n\t\t\t\t\t// this.$$data takes precedence over this.attributes\n\t\t\t\t\tconst name = this.$$g_p(attribute.name);\n\t\t\t\t\tif (!(name in this.$$d)) {\n\t\t\t\t\t\tthis.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, 'toProp');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Port over props that were set programmatically before ce was initialized\n\t\t\t\tfor (const key in this.$$p_d) {\n\t\t\t\t\tif (!(key in this.$$d) && this[key] !== undefined) {\n\t\t\t\t\t\tthis.$$d[key] = this[key]; // don't transform, these were set through JavaScript\n\t\t\t\t\t\tdelete this[key]; // remove the property that shadows the getter/setter\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.$$c = new this.$$ctor({\n\t\t\t\t\ttarget: this.shadowRoot || this,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...this.$$d,\n\t\t\t\t\t\t$$slots,\n\t\t\t\t\t\t$$scope: {\n\t\t\t\t\t\t\tctx: []\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Reflect component props as attributes\n\t\t\t\tconst reflect_attributes = () => {\n\t\t\t\t\tthis.$$r = true;\n\t\t\t\t\tfor (const key in this.$$p_d) {\n\t\t\t\t\t\tthis.$$d[key] = this.$$c.$$.ctx[this.$$c.$$.props[key]];\n\t\t\t\t\t\tif (this.$$p_d[key].reflect) {\n\t\t\t\t\t\t\tconst attribute_value = get_custom_element_value(\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tthis.$$d[key],\n\t\t\t\t\t\t\t\tthis.$$p_d,\n\t\t\t\t\t\t\t\t'toAttribute'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (attribute_value == null) {\n\t\t\t\t\t\t\t\tthis.removeAttribute(this.$$p_d[key].attribute || key);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.setAttribute(this.$$p_d[key].attribute || key, attribute_value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.$$r = false;\n\t\t\t\t};\n\t\t\t\tthis.$$c.$$.after_update.push(reflect_attributes);\n\t\t\t\treflect_attributes(); // once initially because after_update is added too late for first render\n\n\t\t\t\tfor (const type in this.$$l) {\n\t\t\t\t\tfor (const listener of this.$$l[type]) {\n\t\t\t\t\t\tconst unsub = this.$$c.$on(type, listener);\n\t\t\t\t\t\tthis.$$l_u.set(listener, unsub);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.$$l = {};\n\t\t\t}\n\t\t}\n\n\t\t// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte\n\t\t// and setting attributes through setAttribute etc, this is helpful\n\t\tattributeChangedCallback(attr, _oldValue, newValue) {\n\t\t\tif (this.$$r) return;\n\t\t\tattr = this.$$g_p(attr);\n\t\t\tthis.$$d[attr] = get_custom_element_value(attr, newValue, this.$$p_d, 'toProp');\n\t\t\tthis.$$c?.$set({ [attr]: this.$$d[attr] });\n\t\t}\n\n\t\tdisconnectedCallback() {\n\t\t\tthis.$$cn = false;\n\t\t\t// In a microtask, because this could be a move within the DOM\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tif (!this.$$cn && this.$$c) {\n\t\t\t\t\tthis.$$c.$destroy();\n\t\t\t\t\tthis.$$c = undefined;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t$$g_p(attribute_name) {\n\t\t\treturn (\n\t\t\t\tObject.keys(this.$$p_d).find(\n\t\t\t\t\t(key) =>\n\t\t\t\t\t\tthis.$$p_d[key].attribute === attribute_name ||\n\t\t\t\t\t\t(!this.$$p_d[key].attribute && key.toLowerCase() === attribute_name)\n\t\t\t\t) || attribute_name\n\t\t\t);\n\t\t}\n\t};\n}\n\n/**\n * @param {string} prop\n * @param {any} value\n * @param {Record<string, CustomElementPropDefinition>} props_definition\n * @param {'toAttribute' | 'toProp'} [transform]\n */\nfunction get_custom_element_value(prop, value, props_definition, transform) {\n\tconst type = props_definition[prop]?.type;\n\tvalue = type === 'Boolean' && typeof value !== 'boolean' ? value != null : value;\n\tif (!transform || !props_definition[prop]) {\n\t\treturn value;\n\t} else if (transform === 'toAttribute') {\n\t\tswitch (type) {\n\t\t\tcase 'Object':\n\t\t\tcase 'Array':\n\t\t\t\treturn value == null ? null : JSON.stringify(value);\n\t\t\tcase 'Boolean':\n\t\t\t\treturn value ? '' : null;\n\t\t\tcase 'Number':\n\t\t\t\treturn value == null ? null : value;\n\t\t\tdefault:\n\t\t\t\treturn value;\n\t\t}\n\t} else {\n\t\tswitch (type) {\n\t\t\tcase 'Object':\n\t\t\tcase 'Array':\n\t\t\t\treturn value && JSON.parse(value);\n\t\t\tcase 'Boolean':\n\t\t\t\treturn value; // conversion already handled above\n\t\t\tcase 'Number':\n\t\t\t\treturn value != null ? +value : value;\n\t\t\tdefault:\n\t\t\t\treturn value;\n\t\t}\n\t}\n}\n\n/**\n * @internal\n *\n * Turn a Svelte component into a custom element.\n * @param {import('./public.js').ComponentType} Component A Svelte component constructor\n * @param {Record<string, CustomElementPropDefinition>} props_definition The props to observe\n * @param {string[]} slots The slots to create\n * @param {string[]} accessors Other accessors besides the ones for props the component has\n * @param {boolean} use_shadow_dom Whether to use shadow DOM\n * @param {(ce: new () => HTMLElement) => new () => HTMLElement} [extend]\n */\nexport function create_custom_element(\n\tComponent,\n\tprops_definition,\n\tslots,\n\taccessors,\n\tuse_shadow_dom,\n\textend\n) {\n\tlet Class = class extends SvelteElement {\n\t\tconstructor() {\n\t\t\tsuper(Component, slots, use_shadow_dom);\n\t\t\tthis.$$p_d = props_definition;\n\t\t}\n\t\tstatic get observedAttributes() {\n\t\t\treturn Object.keys(props_definition).map((key) =>\n\t\t\t\t(props_definition[key].attribute || key).toLowerCase()\n\t\t\t);\n\t\t}\n\t};\n\tObject.keys(props_definition).forEach((prop) => {\n\t\tObject.defineProperty(Class.prototype, prop, {\n\t\t\tget() {\n\t\t\t\treturn this.$$c && prop in this.$$c ? this.$$c[prop] : this.$$d[prop];\n\t\t\t},\n\t\t\tset(value) {\n\t\t\t\tvalue = get_custom_element_value(prop, value, props_definition);\n\t\t\t\tthis.$$d[prop] = value;\n\t\t\t\tthis.$$c?.$set({ [prop]: value });\n\t\t\t}\n\t\t});\n\t});\n\taccessors.forEach((accessor) => {\n\t\tObject.defineProperty(Class.prototype, accessor, {\n\t\t\tget() {\n\t\t\t\treturn this.$$c?.[accessor];\n\t\t\t}\n\t\t});\n\t});\n\tif (extend) {\n\t\t// @ts-expect-error - assigning here is fine\n\t\tClass = extend(Class);\n\t}\n\tComponent.element = /** @type {any} */ (Class);\n\treturn Class;\n}\n\n/**\n * Base class for Svelte components. Used when dev=false.\n *\n * @template {Record<string, any>} [Props=any]\n * @template {Record<string, any>} [Events=any]\n */\nexport class SvelteComponent {\n\t/**\n\t * ### PRIVATE API\n\t *\n\t * Do not use, may change at any time\n\t *\n\t * @type {any}\n\t */\n\t$$ = undefined;\n\t/**\n\t * ### PRIVATE API\n\t *\n\t * Do not use, may change at any time\n\t *\n\t * @type {any}\n\t */\n\t$$set = undefined;\n\n\t/** @returns {void} */\n\t$destroy() {\n\t\tdestroy_component(this, 1);\n\t\tthis.$destroy = noop;\n\t}\n\n\t/**\n\t * @template {Extract<keyof Events, string>} K\n\t * @param {K} type\n\t * @param {((e: Events[K]) => void) | null | undefined} callback\n\t * @returns {() => void}\n\t */\n\t$on(type, callback) {\n\t\tif (!is_function(callback)) {\n\t\t\treturn noop;\n\t\t}\n\t\tconst callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);\n\t\tcallbacks.push(callback);\n\t\treturn () => {\n\t\t\tconst index = callbacks.indexOf(callback);\n\t\t\tif (index !== -1) callbacks.splice(index, 1);\n\t\t};\n\t}\n\n\t/**\n\t * @param {Partial<Props>} props\n\t * @returns {void}\n\t */\n\t$set(props) {\n\t\tif (this.$$set && !is_empty(props)) {\n\t\t\tthis.$$.skip_bound = true;\n\t\t\tthis.$$set(props);\n\t\t\tthis.$$.skip_bound = false;\n\t\t}\n\t}\n}\n\n/**\n * @typedef {Object} CustomElementPropDefinition\n * @property {string} [attribute]\n * @property {boolean} [reflect]\n * @property {'String'|'Boolean'|'Number'|'Array'|'Object'} [type]\n */\n","// generated during release, do not modify\n\n/**\n * The current version, as set in package.json.\n *\n * https://svelte.dev/docs/svelte-compiler#svelte-version\n * @type {string}\n */\nexport const VERSION = '4.2.19';\nexport const PUBLIC_VERSION = '4';\n","import { PUBLIC_VERSION } from '../../../shared/version.js';\n\nif (typeof window !== 'undefined')\n\t// @ts-ignore\n\t(window.__svelte || (window.__svelte = { v: new Set() })).v.add(PUBLIC_VERSION);\n","<svg viewBox=\"0 0 14 14\" width=\"13\" height=\"13\">\n <path\n 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\"\n />\n</svg>\n\n<style>\n svg {\n display: block;\n fill: var(--color-icon-button);\n }\n</style>\n","<svg viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n 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\"\n />\n</svg>\n\n<style>\n svg {\n display: block;\n fill: #e15042;\n }\n</style>\n","<script context=\"module\" lang=\"ts\">\n type SpriteIcon = { width: number; height: number; x: number; y: number };\n\n const hidpi = devicePixelRatio > 1.25;\n\n const scaleUrl = hidpi ? \"@2x\" : \"\";\n\n const scaleFactor = hidpi ? 2 : 1;\n\n let sprites:\n | undefined\n | null\n | { width: number; height: number; icons: Record<string, SpriteIcon> };\n\n let spritePromise: Promise<void> | undefined;\n</script>\n\n<script lang=\"ts\">\n import { createEventDispatcher } from \"svelte\";\n import type { Feature, ShowPlaceType } from \"./types\";\n\n export let feature: Feature;\n\n export let style: \"selected\" | \"picked\" | \"default\" = \"default\";\n\n export let showPlaceType: ShowPlaceType;\n\n export let missingIconsCache: Set<string>;\n\n export let iconsBaseUrl: string;\n\n $: categories = feature.properties?.categories;\n\n $: isReverse = feature.place_type[0] === \"reverse\";\n\n const dispatch = createEventDispatcher<{ select: undefined }>();\n\n let category: string | undefined;\n\n let imageUrl: string | undefined;\n\n let spriteIcon: SpriteIcon | undefined;\n\n let index: number;\n\n $: placeType =\n feature.properties?.categories?.join(\", \") ??\n feature.properties?.place_type_name?.[0] ??\n feature.place_type[0];\n\n $: {\n index = categories?.length ?? 0;\n\n loadIcon();\n }\n\n function loadSprites() {\n spritePromise ??= fetch(`${iconsBaseUrl}sprite${scaleUrl}.json`)\n .then((response) => response.json())\n .then((data) => {\n sprites = data;\n })\n .catch(() => {\n sprites = null;\n });\n }\n\n function handleImgError() {\n if (imageUrl) {\n missingIconsCache.add(imageUrl);\n }\n\n loadIcon();\n }\n\n function loadIcon() {\n if (sprites !== undefined) {\n loadIcon2();\n } else {\n loadSprites();\n\n spritePromise?.then(loadIcon2);\n }\n }\n\n function loadIcon2() {\n do {\n index--;\n\n category = categories?.[index];\n\n spriteIcon = category ? sprites?.icons[category] : undefined;\n\n if (spriteIcon) {\n break;\n }\n\n imageUrl = category\n ? iconsBaseUrl + category.replace(/ /g, \"_\") + \".svg\"\n : undefined;\n } while (index > -1 && (!imageUrl || missingIconsCache.has(imageUrl)));\n }\n</script>\n\n<!-- svelte-ignore a11y-click-events-have-key-events -->\n<li\n tabindex=\"-1\"\n role=\"option\"\n aria-selected={style === \"selected\"}\n aria-checked={style === \"picked\"}\n class={style}\n on:mouseenter\n on:focus={() => dispatch(\"select\", undefined)}\n on:click={(ev) => {\n // this is to trigger the event if we click on focused item\n if (document.activeElement !== ev.target) {\n dispatch(\"select\", undefined);\n }\n }}\n>\n {#if sprites && spriteIcon}\n <div\n class=\"sprite-icon\"\n style={`\n width: ${spriteIcon.width / scaleFactor}px;\n height: ${spriteIcon.height / scaleFactor}px;\n background-image: url(${iconsBaseUrl}sprite${scaleUrl}.png);\n background-position: -${spriteIcon.x / scaleFactor}px -${spriteIcon.y / scaleFactor}px;\n background-size: ${sprites.width / scaleFactor}px ${sprites.height / scaleFactor}px;\n `}\n title={placeType}\n />\n {:else if imageUrl}\n <img\n src={imageUrl}\n alt={category}\n title={placeType}\n on:error={() => handleImgError()}\n />\n {:else if feature.address}\n <img\n src={iconsBaseUrl + \"housenumber.svg\"}\n alt={placeType}\n title={placeType}\n />\n {:else if feature.id.startsWith(\"road.\")}\n <img src={iconsBaseUrl + \"road.svg\"} alt={placeType} title={placeType} />\n {:else if feature.id.startsWith(\"address.\")}\n <img src={iconsBaseUrl + \"street.svg\"} alt={placeType} title={placeType} />\n {:else if feature.id.startsWith(\"postal_code.\")}\n <img\n src={iconsBaseUrl + \"postal_code.svg\"}\n alt={placeType}\n title={placeType}\n />\n {:else if feature.id.startsWith(\"poi.\")}\n <img src={iconsBaseUrl + \"poi.svg\"} alt={placeType} title={placeType} />\n {:else if isReverse}\n <img src={iconsBaseUrl + \"reverse.svg\"} alt={placeType} title={placeType} />\n {:else}\n <img src={iconsBaseUrl + \"area.svg\"} alt={placeType} title={placeType} />\n {/if}\n\n <span class=\"texts\">\n <span>\n <span class=\"primary\">\n {isReverse ? feature.place_name : feature.place_name.replace(/,.*/, \"\")}\n </span>\n\n {#if showPlaceType === \"always\" || (showPlaceType !== \"never\" && !feature.address && !feature.id.startsWith(\"road.\") && !feature.id.startsWith(\"address.\") && !feature.id.startsWith(\"postal_code.\") && (!feature.id.startsWith(\"poi.\") || !imageUrl) && !isReverse)}\n <span class=\"secondary\">\n {placeType}\n </span>\n {/if}\n </span>\n\n <span class=\"line2\">\n {isReverse ? \"\" : feature.place_name.replace(/[^,]*,?\\s*/, \"\")}\n </span>\n </span>\n</li>\n\n<style lang=\"scss\">\n .sprite-icon {\n align-self: center;\n justify-self: center;\n opacity: 0.75;\n background-repeat: no-repeat;\n }\n\n li {\n text-align: left;\n cursor: default;\n display: grid;\n grid-template-columns: 40px 1fr;\n color: var(--color-text);\n padding: 8px 0px;\n font-size: 14px;\n line-height: 18px;\n min-width: fit-content;\n outline: 0;\n\n &:first-child {\n padding-top: 10px;\n }\n\n &:last-child {\n padding-bottom: 10px;\n }\n\n &.picked {\n background-color: #e7edff;\n\n .secondary {\n color: #96a4c7;\n padding-left: 4px;\n }\n\n .line2 {\n color: #96a4c7;\n }\n }\n\n &.selected {\n background-color: #f3f6ff;\n\n & {\n animation: backAndForth 5s linear infinite;\n }\n\n & .primary {\n color: #2b8bfb;\n }\n\n .secondary {\n color: #a2adc7;\n padding-left: 4px;\n }\n\n .line2 {\n color: #a2adc7;\n }\n }\n\n & > img {\n align-self: center;\n justify-self: center;\n opacity: 0.75;\n }\n }\n\n .texts {\n padding: 0 17px 0 0;\n\n & > * {\n white-space: nowrap;\n display: block;\n min-width: fit-content;\n }\n }\n\n .primary {\n font-weight: 600;\n }\n\n .secondary {\n color: #aeb6c7;\n padding-left: 4px;\n }\n\n .line2 {\n color: #aeb6c7;\n }\n\n @keyframes backAndForth {\n 0% {\n transform: translateX(0);\n }\n 10% {\n transform: translateX(0);\n }\n 45% {\n transform: translateX(calc(-100% + 270px));\n }\n 55% {\n transform: translateX(calc(-100% + 270px));\n }\n 90% {\n transform: translateX(0);\n }\n 100% {\n transform: translateX(0);\n }\n }\n</style>\n","<div>\n <svg viewBox=\"0 0 18 18\" width=\"24\" height=\"24\">\n <path\n fill=\"#333\"\n 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\"\n />\n <path\n opacity=\".1\"\n 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\"\n />\n </svg>\n</div>\n\n<style>\n div {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n pointer-events: none;\n\n display: flex;\n align-items: center;\n }\n\n svg {\n animation: rotate 0.8s infinite cubic-bezier(0.45, 0.05, 0.55, 0.95);\n }\n\n @keyframes rotate {\n from {\n -webkit-transform: rotate(0);\n transform: rotate(0);\n }\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n</style>\n","<svg viewBox=\"0 0 60.006 21.412\" width=\"14\" height=\"20\">\n <path\n 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\"\n />\n</svg>\n\n<style>\n svg {\n display: block;\n fill: var(--color-icon-button);\n }\n</style>\n","<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"13\"\n height=\"13\"\n viewBox=\"0 0 13 13\"\n>\n <circle cx=\"4.789\" cy=\"4.787\" r=\"3.85\" />\n <path d=\"M12.063 12.063 7.635 7.635\" />\n</svg>\n\n<style>\n circle {\n stroke-width: 1.875;\n fill: none;\n }\n\n path {\n stroke-width: 1.875;\n stroke-linecap: round;\n }\n\n svg {\n display: block;\n stroke: var(--color-icon-button);\n }\n</style>\n","import type { BBox } from \"./types\";\n\n// taken from Leaflet\nexport function wrapNum(\n x: number,\n range: [number, number],\n includeMax: boolean,\n) {\n const max = range[1],\n min = range[0],\n d = max - min;\n\n return x === max && includeMax ? x : ((((x - min) % d) + d) % d) + min;\n}\n\nexport function unwrapBbox(bbox0: BBox): BBox {\n const bbox = [...bbox0] satisfies BBox;\n\n if (bbox[2] < bbox[0]) {\n if (\n Math.abs((bbox[0] + bbox[2] + 360) / 2) >\n Math.abs((bbox[0] - 360 + bbox[2]) / 2)\n ) {\n bbox[0] -= 360;\n } else {\n bbox[2] += 360;\n }\n }\n\n return bbox;\n}\n","import type { MapController, ProximityRule } from \"./types\";\n\nlet cachedLocation: { time: number; coords: undefined | string } | undefined;\n\nexport async function getProximity(\n mapController: MapController | undefined,\n proximity: ProximityRule[] | null | undefined,\n ac: AbortController,\n) {\n const centerAndZoom = mapController?.getCenterAndZoom();\n\n for (const rule of proximity ?? []) {\n if (\n centerAndZoom &&\n ((rule.minZoom != undefined && rule.minZoom > centerAndZoom[0]) ||\n (rule.maxZoom != undefined && rule.maxZoom < centerAndZoom[0]))\n ) {\n continue;\n }\n\n if (rule.type === \"fixed\") {\n return rule.coordinates.join(\",\");\n }\n\n cg: if (rule.type === \"client-geolocation\") {\n if (\n cachedLocation &&\n rule.cachedLocationExpiry &&\n cachedLocation.time + rule.cachedLocationExpiry > Date.now()\n ) {\n if (!cachedLocation.coords) {\n break cg;\n }\n\n return cachedLocation.coords;\n }\n\n let coords: string | undefined;\n\n try {\n coords = await new Promise<string>((resolve, reject) => {\n ac.signal.addEventListener(\"abort\", () => {\n reject(Error(\"aborted\"));\n });\n\n navigator.geolocation.getCurrentPosition(\n (pos) => {\n resolve(\n [pos.coords.longitude, pos.coords.latitude]\n .map((c) => c.toFixed(6))\n .join(\",\"),\n );\n },\n (err) => {\n reject(err);\n },\n rule,\n );\n });\n\n return coords;\n } catch {\n // ignore\n } finally {\n if (rule.cachedLocationExpiry) {\n cachedLocation = {\n time: Date.now(),\n coords,\n };\n }\n }\n\n if (ac.signal.aborted) {\n return;\n }\n }\n\n if (rule.type === \"server-geolocation\") {\n return \"ip\";\n }\n\n if (centerAndZoom && rule.type === \"map-center\") {\n return centerAndZoom[1].toFixed(6) + \",\" + centerAndZoom[2].toFixed(6);\n }\n }\n}\n","//Coordinates pattern matching regex\n//DM with invalid minutes (goes to coords_other); this is just a shortened version of that to create a guard condition\nconst dm_invalid = /^(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;\n//DM as numbers only - see issue #15\nconst dm_numbers = /^([+-]?[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,})$/;\n//decimal degrees\nconst dd_re = /^(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;\n//degrees minutes seconds with '.' as separator - gives array with 15 values\nconst dms_periods = /^(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;\n//degrees minutes seconds with words 'degrees, minutes, seconds' as separators (needed because the s of seconds messes with the S of SOUTH) - gives array of 17 values\nconst dms_abbr = /^(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;\n//everything else - gives array of 17 values \nconst coords_other = /^(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;\nexport { dm_invalid, dm_numbers, dd_re, dms_periods, dms_abbr, coords_other };\n","//borrowed from https://www.codegrepper.com/code-examples/javascript/javascript+converting+latitude+longitude+to+gps+coordinates\n/**\n * Converts decimalCoordinates to commonly used string formats\n * Note that this will add degree and direction symbols to decimal coordinates\n * @param {string} format Either DMS or DM\n * @returns {string}\n */\nfunction toCoordinateFormat(format) {\n if (!['DMS', 'DM', 'DD'].includes(format))\n throw new Error('invalid format specified');\n if (this.decimalCoordinates && this.decimalCoordinates.trim()) {\n const parts = this.decimalCoordinates.split(',').map(x => Number(x.trim()));\n const decimalLatitude = Number(parts[0]);\n const decimalLongitude = Number(parts[1]);\n const absoluteLatitude = Math.abs(decimalLatitude);\n const absoluteLongitude = Math.abs(decimalLongitude);\n const latDir = decimalLatitude > 0 ? \"N\" : \"S\";\n const longDir = decimalLongitude > 0 ? \"E\" : \"W\";\n let result;\n if (format == 'DD') {\n result = `${absoluteLatitude}° ${latDir}, ${absoluteLongitude}° ${longDir}`;\n }\n //else we need some more things\n const degreesLatitude = Math.floor(absoluteLatitude);\n const degreesLongitude = Math.floor(absoluteLongitude);\n const minutesLatitudeNotTruncated = (absoluteLatitude - degreesLatitude) * 60;\n const minutesLongitudeNotTruncated = (absoluteLongitude - degreesLongitude) * 60;\n if (format == 'DM') {\n let dmMinsLatitude = round(minutesLatitudeNotTruncated, 3).toFixed(3).padStart(6, '0');\n let dmMinsLongitude = round(minutesLongitudeNotTruncated, 3).toFixed(3).padStart(6, '0');\n if (dmMinsLatitude.endsWith('.000') && dmMinsLongitude.endsWith('.000')) {\n dmMinsLatitude = dmMinsLatitude.replace(/\\.000$/, '');\n dmMinsLongitude = dmMinsLongitude.replace(/\\.000$/, '');\n }\n result = `${degreesLatitude}° ${dmMinsLatitude}' ${latDir}, ${degreesLongitude}° ${dmMinsLongitude}' ${longDir}`;\n }\n if (format == \"DMS\") {\n const latMinutes = Math.floor(minutesLatitudeNotTruncated);\n const longMinutes = Math.floor(minutesLongitudeNotTruncated);\n let latSeconds = ((minutesLatitudeNotTruncated - latMinutes) * 60).toFixed(1).padStart(4, '0');\n let longSeconds = ((minutesLongitudeNotTruncated - longMinutes) * 60).toFixed(1).padStart(4, '0');\n const latMinutesString = latMinutes.toString().padStart(2, '0');\n const longMinutesString = longMinutes.toString().padStart(2, '0');\n // if they both end in .0 we drop the .0\n if (latSeconds.endsWith('.0') && longSeconds.endsWith('.0')) {\n latSeconds = latSeconds.replace(/\\.0$/, '');\n longSeconds = longSeconds.replace(/\\.0$/, '');\n }\n result = `${degreesLatitude}° ${latMinutesString}' ${latSeconds}\" ${latDir}, ${degreesLongitude}° ${longMinutesString}' ${longSeconds}\" ${longDir}`;\n }\n return result;\n }\n else {\n throw new Error('no decimal coordinates to convert');\n }\n}\nfunction round(num, places) {\n const d = Math.pow(10, places);\n return Math.round((num + Number.EPSILON) * d) / d;\n}\nexport default toCoordinateFormat;\n","//function for converting coordinates from a string to decimal and verbatim\n//this is just a comment\nimport { dm_invalid, dm_numbers, dd_re, dms_periods, dms_abbr, coords_other } from './regex.js';\nimport toCoordinateFormat from './toCoordinateFormat.js';\n/**\n * Function for converting coordinates in a variety of formats to decimal coordinates\n * @param {string} coordsString The coordinates string to convert\n * @param {number} [decimalPlaces] The number of decimal places for converted coordinates; default is 5\n * @returns {{verbatimCoordinates: string, decimalCoordinates: string, decimalLatitude: number, decimalLongitude: number, closeEnough: function(string): boolean, toCoordinateFormat: toCoordinateFormat}}\n */\nfunction converter(coordsString, decimalPlaces) {\n //TODO add exact match to entered string, so that it can be used to filter out superflous text around it\n if (!decimalPlaces) {\n decimalPlaces = 5;\n }\n coordsString = coordsString.replace(/\\s+/g, ' ').trim(); //just to tidy up whitespaces\n let ddLat = null;\n let ddLng = null;\n let latdir = \"\";\n let lngdir = \"\";\n let originalFormat = null;\n let match = [];\n let matchSuccess = false;\n if (dm_invalid.test(coordsString)) {\n throw new Error(\"invalid coordinate value\");\n }\n if (dm_numbers.test(coordsString)) {\n match = dm_numbers.exec(coordsString);\n matchSuccess = checkMatch(match);\n if (matchSuccess) {\n ddLat = Math.abs(match[1]) + match[2] / 60;\n if (Number(match[1]) < 0) {\n ddLat *= -1;\n }\n ddLng = Math.abs(match[3]) + match[4] / 60;\n if (Number(match[3]) < 0) {\n ddLng *= -1;\n }\n originalFormat = \"DM\";\n }\n else {\n throw new Error(\"invalid coordinate format\");\n }\n }\n else if (dd_re.test(coordsString)) {\n match = dd_re.exec(coordsString);\n matchSuccess = checkMatch(match);\n if (matchSuccess) {\n ddLat = match[2];\n ddLng = match[6];\n //need to fix if there are ','s instead of '.'\n if (ddLat.includes(',')) {\n ddLat = ddLat.replace(',', '.');\n }\n if (ddLng.includes(',')) {\n ddLng = ddLng.replace(',', '.');\n }\n originalFormat = \"DD\";\n //validation, we don't want things like 23.00000\n //some more validation: no zero coords or degrees only\n if (Number(Math.round(ddLat)) == Number(ddLat)) {\n throw new Error('integer only coordinate provided');\n }\n if (Number(Math.round(ddLng)) == Number(ddLng)) {\n throw new Error('integer only coordinate provided');\n }\n //get directions\n if (match[1]) {\n latdir = match[1];\n lngdir = match[5];\n }\n else if (match[4]) {\n latdir = match[4];\n lngdir = match[8];\n }\n }\n else {\n throw new Error(\"invalid decimal coordinate format\");\n }\n }\n else if (dms_periods.test(coordsString)) {\n match = dms_periods.exec(coordsString);\n matchSuccess = checkMatch(match);\n if (matchSuccess) {\n ddLat = Math.abs(parseInt(match[2]));\n if (match[4]) {\n ddLat += match[4] / 60;\n originalFormat = \"DM\";\n }\n if (match[6]) {\n ddLat += match[6].replace(',', '.') / 3600;\n originalFormat = \"DMS\";\n }\n if (parseInt(match[2]) < 0) {\n ddLat = -1 * ddLat;\n }\n ddLng = Math.abs(parseInt(match[9]));\n if (match[11]) {\n ddLng += match[11] / 60;\n }\n if (match[13]) {\n ddLng += match[13].replace(',', '.') / 3600;\n }\n if (parseInt(match[9]) < 0) {\n ddLng = -1 * ddLng;\n }\n //the compass directions\n if (match[1]) {\n latdir = match[1];\n lngdir = match[8];\n }\n else if (match[7]) {\n latdir = match[7];\n lngdir = match[14];\n }\n }\n else {\n throw new Error(\"invalid DMS coordinates format\");\n }\n }\n else if (dms_abbr.test(coordsString)) {\n match = dms_abbr.exec(coordsString);\n matchSuccess = checkMatch(match);\n if (matchSuccess) {\n ddLat = Math.abs(parseInt(match[2]));\n if (match[4]) {\n ddLat += match[4] / 60;\n originalFormat = \"DM\";\n }\n if (match[6]) {\n ddLat += match[6] / 3600;\n originalFormat = \"DMS\";\n }\n if (parseInt(match[2]) < 0) {\n ddLat = -1 * ddLat;\n }\n ddLng = Math.abs(parseInt(match[10]));\n if (match[12]) {\n ddLng += match[12] / 60;\n }\n if (match[14]) {\n ddLng += match[14] / 3600;\n }\n if (parseInt(match[10]) < 0) {\n ddLng = -1 * ddLng;\n }\n //the compass directions\n if (match[1]) {\n latdir = match[1];\n lngdir = match[9];\n }\n else if (match[8]) {\n latdir = match[8];\n lngdir = match[16];\n }\n }\n else {\n throw new Error(\"invalid DMS coordinates format\");\n }\n }\n else if (coords_other.test(coordsString)) {\n match = coords_other.exec(coordsString);\n matchSuccess = checkMatch(match);\n // we need an extra check here for things that matched that shouldn't have\n if (match.filter(x => x).length <= 5) {\n throw new Error(\"invalid coordinates format\");\n }\n if (matchSuccess) {\n ddLat = Math.abs(parseInt(match[2]));\n if (match[4]) {\n ddLat += match[4].replace(',', '.') / 60;\n originalFormat = \"DM\";\n }\n if (match[6]) {\n ddLat += match[6].replace(',', '.') / 3600;\n originalFormat = \"DMS\";\n }\n if (parseInt(match[2]) < 0) {\n ddLat = -1 * ddLat;\n }\n ddLng = Math.abs(parseInt(match[10]));\n if (match[12]) {\n ddLng += match[12].replace(',', '.') / 60;\n }\n if (match[14]) {\n ddLng += match[14].replace(',', '.') / 3600;\n }\n if (parseInt(match[10]) < 0) {\n ddLng = -1 * ddLng;\n }\n //the compass directions\n if (match[1]) {\n latdir = match[1];\n lngdir = match[9];\n }\n else if (match[8]) {\n latdir = match[8];\n lngdir = match[16];\n }\n }\n else {\n throw new Error(\"invalid coordinates format\");\n }\n }\n if (matchSuccess) {\n //more validation....\n //check longitude value - it can be wrong!\n if (Math.abs(ddLng) >= 180) {\n throw new Error(\"invalid longitude value\");\n }\n //just to be safe check latitude also...\n if (Math.abs(ddLat) >= 90) {\n throw new Error(\"invalid latitude value\");\n }\n //if we have one direction we must have the other\n if ((latdir && !lngdir) || (!latdir && lngdir)) {\n throw new Error(\"invalid coordinates value\");\n }\n //the directions can't be the same\n if (latdir && latdir == lngdir) {\n throw new Error(\"invalid coordinates format\");\n }\n // a bit of tidying up...\n if (ddLat.toString().includes(',')) {\n ddLat = ddLat.replace(',', '.');\n }\n if (ddLng.toString().includes(',')) {\n ddLng = ddLng.replace(',', '.');\n }\n //make sure the signs and cardinal directions match\n let patt = /S|SOUTH/i;\n if (patt.test(latdir)) {\n if (ddLat > 0) {\n ddLat = -1 * ddLat;\n }\n }\n patt = /W|WEST/i;\n if (patt.test(lngdir)) {\n if (ddLng > 0) {\n ddLng = -1 * ddLng;\n }\n }\n //we need to get the verbatim coords from the string\n //we can't split down the middle because if there are decimals they may have different numbers on each side\n //so we need to find the separating character, or if none, use the match values to split down the middle\n const verbatimCoordinates = match[0].trim();\n let verbatimLat;\n let verbatimLng;\n const sepChars = /[,/;\\u0020]/g; //comma, forward slash and spacebar\n const seps = verbatimCoordinates.match(sepChars);\n if (seps == null) {\n //split down the middle\n const middle = Math.floor(coordsString.length / 2);\n verbatimLat = verbatimCoordinates.substring(0, middle).trim();\n verbatimLng = verbatimCoordinates.substring(middle).trim();\n }\n else { //if length is odd then find the index of the middle value\n //get the middle index\n let middle;\n //easy for odd numbers\n if (seps.length % 2 == 1) {\n middle = Math.floor(seps.length / 2);\n }\n else {\n middle = (seps.length / 2) - 1;\n }\n //walk through seps until we get to the middle\n let splitIndex = 0;\n //it might be only one value\n if (middle == 0) {\n splitIndex = verbatimCoordinates.indexOf(seps[0]);\n verbatimLat = verbatimCoordinates.substring(0, splitIndex).trim();\n verbatimLng = verbatimCoordinates.substring(splitIndex + 1).trim();\n }\n else {\n let currSepIndex = 0;\n let startSearchIndex = 0;\n while (currSepIndex <= middle) {\n splitIndex = verbatimCoordinates.indexOf(seps[currSepIndex], startSearchIndex);\n startSearchIndex = splitIndex + 1;\n currSepIndex++;\n }\n verbatimLat = verbatimCoordinates.substring(0, splitIndex).trim();\n verbatimLng = verbatimCoordinates.substring(splitIndex + 1).trim();\n }\n }\n //validation again...\n //we only allow zeros after the period if its DM\n const splitLat = verbatimLat.split('.');\n if (splitLat.length == 2) {\n if (splitLat[1] == 0 && splitLat[1].length != 2) {\n throw new Error('invalid coordinates format');\n }\n }\n const splitLon = verbatimLng.split('.');\n if (splitLon.length == 2) {\n if (splitLon[1] == 0 && splitLon[1].length != 2) {\n throw new Error('invalid coordinates format');\n }\n }\n //no integer coords allowed\n if (/^\\d+$/.test(verbatimLat) || /^\\d+$/.test(verbatimLng)) {\n throw new Error('degree only coordinate/s provided');\n }\n //all done!!\n //just truncate the decimals appropriately\n ddLat = Number(Number(ddLat).toFixed(decimalPlaces));\n ddLng = Number(Number(ddLng).toFixed(decimalPlaces));\n return Object.freeze({\n verbatimCoordinates,\n verbatimLatitude: verbatimLat,\n verbatimLongitude: verbatimLng,\n decimalLatitude: ddLat,\n decimalLongitude: ddLng,\n decimalCoordinates: `${ddLat},${ddLng}`,\n originalFormat,\n closeEnough: coordsCloseEnough,\n toCoordinateFormat\n });\n }\n else {\n throw new Error(\"coordinates pattern match failed\");\n }\n}\nfunction checkMatch(match) {\n if (!isNaN(match[0])) { //we've matched a number, not what we want....\n return false;\n }\n //first remove the empty values from the array\n const filteredMatch = [...match];\n //we need to shift the array because it contains the whole coordinates string in the first item\n filteredMatch.shift();\n //check the array length is an even number\n if (filteredMatch.length % 2 > 0) {\n return false;\n }\n // regex for testing corresponding values match\n const numerictest = /^[-+]?\\d+([\\.,]\\d+)?$/; //for testing numeric values\n const stringtest = /[eastsouthnorthwest]+/i; //for testing string values (north, south, etc)\n const halflen = filteredMatch.length / 2;\n for (let i = 0; i < halflen; i++) {\n const leftside = filteredMatch[i];\n const rightside = filteredMatch[i + halflen];\n const bothAreNumbers = numerictest.test(leftside) && numerictest.test(rightside);\n const bothAreStrings = stringtest.test(leftside) && stringtest.test(rightside);\n const valuesAreEqual = leftside == rightside;\n if (leftside == undefined && rightside == undefined) { //we have to handle undefined because regex converts it to string 'undefined'!!\n continue;\n }\n else if (leftside == undefined || rightside == undefined) { //no we need to handle the case where one is and the other not...\n return false;\n }\n else if (bothAreNumbers || bothAreStrings || valuesAreEqual) {\n continue;\n }\n else {\n return false;\n }\n }\n return true;\n}\n//functions for coordinate validation\n//as decimal arithmetic is not straightforward, we approximate\nfunction decimalsCloseEnough(dec1, dec2) {\n const originaldiff = Math.abs(dec1 - dec2);\n const diff = Number(originaldiff.toFixed(6));\n if (diff <= 0.00001) {\n return true;\n }\n else {\n return false;\n }\n}\nfunction coordsCloseEnough(coordsToTest) {\n if (!coordsToTest) {\n throw new Error('coords must be provided');\n }\n if (coordsToTest.includes(',')) {\n const coords = coordsToTest.split(',');\n if (Number(coords[0]) == NaN || Number(coords[1]) == NaN) {\n throw new Error(\"coords are not valid decimals\");\n }\n else {\n return decimalsCloseEnough(this.decimalLatitude, Number(coords[0])) && decimalsCloseEnough(this.decimalLongitude, coords[1]); //this here will be the converted coordinates object\n }\n }\n else {\n throw new Error(\"coords being tested must be separated by a comma\");\n }\n}\n// An enum for coordinates formats\nconst to = Object.freeze({\n DMS: 'DMS',\n DM: 'DM',\n DD: 'DD'\n});\nconverter.to = to;\nexport default converter;\n","//return an array of coordinate strings for testing\n//coordinations-parser formats\n//https://www.npmjs.com/package/coordinate-parser\nconst coordsParserFormats = [\n {\n verbatimCoordinates: '40.123, -74.123',\n verbatimLatitude: '40.123',\n verbatimLongitude: '-74.123'\n },\n {\n verbatimCoordinates: '40.123° N 74.123° W',\n verbatimLatitude: '40.123° N',\n verbatimLongitude: '74.123° W'\n },\n {\n verbatimCoordinates: '40.123° N 74.123° W',\n verbatimLatitude: '40.123° N',\n verbatimLongitude: '74.123° W'\n },\n {\n verbatimCoordinates: '40° 7´ 22.8\" N 74° 7´ 22.8\" W',\n verbatimLatitude: '40° 7´ 22.8\" N',\n verbatimLongitude: '74° 7´ 22.8\" W'\n },\n {\n verbatimCoordinates: '40° 7.38’ , -74° 7.38’',\n verbatimLatitude: '40° 7.38’',\n verbatimLongitude: '-74° 7.38’'\n },\n {\n verbatimCoordinates: 'N40°7’22.8’’, W74°7’22.8’’',\n verbatimLatitude: 'N40°7’22.8’’',\n verbatimLongitude: 'W74°7’22.8’’'\n },\n {\n verbatimCoordinates: '40°7’22.8\"N, 74°7’22.8\"W',\n verbatimLatitude: '40°7’22.8\"N',\n verbatimLongitude: '74°7’22.8\"W'\n },\n {\n verbatimCoordinates: '40°7\\'22.8\"N, 74°7\\'22.8\"W',\n verbatimLatitude: '40°7\\'22.8\"N',\n verbatimLongitude: '74°7\\'22.8\"W'\n },\n {\n verbatimCoordinates: '40 7 22.8, -74 7 22.8',\n verbatimLatitude: '40 7 22.8',\n verbatimLongitude: '-74 7 22.8'\n },\n {\n verbatimCoordinates: '40.123 -74.123',\n verbatimLatitude: '40.123',\n verbatimLongitude: '-74.123'\n },\n {\n verbatimCoordinates: '40.123°,-74.123°',\n verbatimLatitude: '40.123°',\n verbatimLongitude: '-74.123°'\n },\n {\n verbatimCoordinates: '40.123N74.123W',\n verbatimLatitude: '40.123N',\n verbatimLongitude: '74.123W'\n },\n {\n verbatimCoordinates: '4007.38N7407.38W',\n verbatimLatitude: '4007.38N',\n verbatimLongitude: '7407.38W'\n },\n {\n verbatimCoordinates: '40°7’22.8\"N, 74°7’22.8\"W',\n verbatimLatitude: '40°7’22.8\"N',\n verbatimLongitude: '74°7’22.8\"W'\n },\n {\n verbatimCoordinates: '400722.8N740722.8W',\n verbatimLatitude: '400722.8N',\n verbatimLongitude: '740722.8W'\n },\n {\n verbatimCoordinates: 'N 40 7.38 W 74 7.38',\n verbatimLatitude: 'N 40 7.38',\n verbatimLongitude: 'W 74 7.38'\n },\n {\n verbatimCoordinates: '40:7:22.8N 74:7:22.8W',\n verbatimLatitude: '40:7:22.8N',\n verbatimLongitude: '74:7:22.8W'\n },\n {\n verbatimCoordinates: '40:7:23N,74:7:23W',\n verbatimLatitude: '40:7:23N',\n verbatimLongitude: '74:7:23W',\n decimalLatitude: 40.1230555555,\n decimalLongitude: -74.1230555555\n },\n {\n verbatimCoordinates: '40°7’23\"N 74°7’23\"W',\n verbatimLatitude: '40°7’23\"N',\n verbatimLongitude: '74°7’23\"W',\n decimalLatitude: 40.1230555555,\n decimalLongitude: -74.12305555555555\n },\n {\n verbatimCoordinates: '40°7’23\"S 74°7’23\"E',\n verbatimLatitude: '40°7’23\"S',\n verbatimLongitude: '74°7’23\"E',\n decimalLatitude: -40.1230555555,\n decimalLongitude: 74.12305555555555\n },\n {\n verbatimCoordinates: '40°7’23\" -74°7’23\"',\n verbatimLatitude: '40°7’23\"',\n verbatimLongitude: '-74°7’23\"',\n decimalLatitude: 40.1230555555,\n decimalLongitude: -74.123055555\n },\n {\n verbatimCoordinates: '40d 7’ 23\" N 74d 7’ 23\" W',\n verbatimLatitude: '40d 7’ 23\" N',\n verbatimLongitude: '74d 7’ 23\" W',\n decimalLatitude: 40.1230555555,\n decimalLongitude: -74.123055555\n },\n {\n verbatimCoordinates: '40.123N 74.123W',\n verbatimLatitude: '40.123N',\n verbatimLongitude: '74.123W'\n },\n {\n verbatimCoordinates: '40° 7.38, -74° 7.38',\n verbatimLatitude: '40° 7.38',\n verbatimLongitude: '-74° 7.38'\n },\n {\n verbatimCoordinates: '40° 7.38, -74° 7.38',\n verbatimLatitude: '40° 7.38',\n verbatimLongitude: '-74° 7.38'\n },\n {\n verbatimCoordinates: '40 7 22.8; -74 7 22.8',\n verbatimLatitude: '40 7 22.8',\n verbatimLongitude: '-74 7 22.8'\n }\n];\nconst coordsParserDecimals = {\n decimalLatitude: 40.123,\n decimalLongitude: -74.123\n};\n//formats from https://gist.github.com/moole/3707127/337bd31d813a10abcf55084381803e5bbb0b20dc \nconst coordsRegexFormats = [\n {\n verbatimCoordinates: '50°4\\'17.698\"south, 14°24\\'2.826\"east',\n verbatimLatitude: '50°4\\'17.698\"south',\n verbatimLongitude: '14°24\\'2.826\"east',\n decimalLatitude: -50.0715827777777778,\n decimalLongitude: 14.400785\n },\n {\n verbatimCoordinates: '50d4m17.698S 14d24m2.826E',\n verbatimLatitude: '50d4m17.698S',\n verbatimLongitude: '14d24m2.826E',\n decimalLatitude: -50.0715827777777778,\n decimalLongitude: 14.400785\n },\n {\n verbatimCoordinates: '40:26:46N,79:56:55W',\n verbatimLatitude: '40:26:46N',\n verbatimLongitude: '79:56:55W',\n decimalLatitude: 40.4461111111111111,\n decimalLongitude: -79.9486111111111111\n },\n {\n verbatimCoordinates: '40:26:46.302N 79:56:55.903W',\n verbatimLatitude: '40:26:46.302N',\n verbatimLongitude: '79:56:55.903W',\n decimalLatitude: 40.446195,\n decimalLongitude: -79.9488619444444444\n },\n {\n verbatimCoordinates: '40°26′47″N 79°58′36″W',\n verbatimLatitude: '40°26′47″N',\n verbatimLongitude: '79°58′36″W',\n decimalLatitude: 40.4463888888888889,\n decimalLongitude: -79.9766666666666667\n },\n {\n verbatimCoordinates: '40d 26′ 47″ N 79d 58′ 36″ W',\n verbatimLatitude: '40d 26′ 47″ N',\n verbatimLongitude: '79d 58′ 36″ W',\n decimalLatitude: 40.4463888888888889,\n decimalLongitude: -79.9766666666666667\n },\n {\n verbatimCoordinates: '40.446195N 79.948862W',\n verbatimLatitude: '40.446195N',\n verbatimLongitude: '79.948862W',\n decimalLatitude: 40.446195,\n decimalLongitude: -79.948862\n },\n {\n verbatimCoordinates: '40,446195° 79,948862°',\n verbatimLatitude: '40,446195°',\n verbatimLongitude: '79,948862°',\n decimalLatitude: 40.446195,\n decimalLongitude: 79.948862\n },\n {\n verbatimCoordinates: '40° 26.7717, -79° 56.93172',\n verbatimLatitude: '40° 26.7717',\n verbatimLongitude: '-79° 56.93172',\n decimalLatitude: 40.446195,\n decimalLongitude: -79.948862\n },\n {\n verbatimCoordinates: '40.446195, -79.948862',\n verbatimLatitude: '40.446195',\n verbatimLongitude: '-79.948862',\n decimalLatitude: 40.446195,\n decimalLongitude: -79.948862\n },\n {\n verbatimCoordinates: '40.123256; -74.123256',\n verbatimLatitude: '40.123256',\n verbatimLongitude: '-74.123256',\n decimalLatitude: 40.123256,\n decimalLongitude: -74.123256\n },\n {\n verbatimCoordinates: '18°24S 22°45E',\n verbatimLatitude: '18°24S',\n verbatimLongitude: '22°45E',\n decimalLatitude: -18.4,\n decimalLongitude: 22.75\n }\n];\n// additional formats we've encountered\nconst otherFormats = [\n {\n verbatimCoordinates: '10.432342S 10.6345345E',\n verbatimLatitude: '10.432342S',\n verbatimLongitude: '10.6345345E',\n decimalLatitude: -10.432342,\n decimalLongitude: 10.6345345\n },\n {\n verbatimCoordinates: '10.00S 10.00E',\n verbatimLatitude: '10.00S',\n verbatimLongitude: '10.00E',\n decimalLatitude: -10.00000,\n decimalLongitude: 10.00000\n },\n {\n verbatimCoordinates: '00.00S 01.00E',\n verbatimLatitude: '00.00S',\n verbatimLongitude: '01.00E',\n decimalLatitude: 0.00000,\n decimalLongitude: 1.00000\n },\n {\n verbatimCoordinates: '18.24S 22.45E',\n verbatimLatitude: '18.24S',\n verbatimLongitude: '22.45E',\n decimalLatitude: -18.4,\n decimalLongitude: 22.75\n },\n {\n verbatimCoordinates: '27deg 15min 45.2sec S 18deg 32min 53.7sec E',\n verbatimLatitude: '27deg 15min 45.2sec S',\n verbatimLongitude: '18deg 32min 53.7sec E',\n decimalLatitude: -27.2625555555555556,\n decimalLongitude: 18.54825\n },\n {\n verbatimCoordinates: '-23.3245° S / 28.2344° E',\n verbatimLatitude: '-23.3245° S',\n verbatimLongitude: '28.2344° E',\n decimalLatitude: -23.3245,\n decimalLongitude: 28.2344\n },\n {\n verbatimCoordinates: '40° 26.7717 -79° 56.93172',\n verbatimLatitude: '40° 26.7717',\n verbatimLongitude: '-79° 56.93172',\n decimalLatitude: 40.446195,\n decimalLongitude: -79.948862\n },\n {\n verbatimCoordinates: '27.15.45S 18.32.53E',\n verbatimLatitude: '27.15.45S',\n verbatimLongitude: '18.32.53E',\n decimalLatitude: -27.2625,\n decimalLongitude: 18.548055\n },\n {\n verbatimCoordinates: '-27.15.45 18.32.53',\n verbatimLatitude: '-27.15.45',\n verbatimLongitude: '18.32.53',\n decimalLatitude: -27.2625,\n decimalLongitude: 18.548055\n },\n {\n verbatimCoordinates: '27.15.45.2S 18.32.53.4E',\n verbatimLatitude: '27.15.45.2S',\n verbatimLongitude: '18.32.53.4E',\n decimalLatitude: -27.262556,\n decimalLongitude: 18.548167\n },\n {\n verbatimCoordinates: '27.15.45,2S 18.32.53,4E',\n verbatimLatitude: '27.15.45,2S',\n verbatimLongitude: '18.32.53,4E',\n decimalLatitude: -27.262556,\n decimalLongitude: 18.548167\n },\n {\n verbatimCoordinates: 'S23.43563 ° E22.45634 °',\n verbatimLatitude: 'S23.43563 °',\n verbatimLongitude: 'E22.45634 °',\n decimalLatitude: -23.43563,\n decimalLongitude: 22.45634\n },\n {\n verbatimCoordinates: '27,71372° S 23,07771° E',\n verbatimLatitude: '27,71372° S',\n verbatimLongitude: '23,07771° E',\n decimalLatitude: -27.71372,\n decimalLongitude: 23.07771\n },\n {\n verbatimCoordinates: '27.45.34 S 23.23.23 E',\n verbatimLatitude: '27.45.34 S',\n verbatimLongitude: '23.23.23 E',\n decimalLatitude: -27.759444,\n decimalLongitude: 23.38972222\n },\n {\n verbatimCoordinates: 'S 27.45.34 E 23.23.23',\n verbatimLatitude: 'S 27.45.34',\n verbatimLongitude: 'E 23.23.23',\n decimalLatitude: -27.759444,\n decimalLongitude: 23.38972222\n },\n {\n verbatimCoordinates: '53 16.3863,4 52.8171',\n verbatimLatitude: '53 16.3863',\n verbatimLongitude: '4 52.8171',\n decimalLatitude: 53.273105,\n decimalLongitude: 4.88029\n },\n {\n verbatimCoordinates: '50 8.2914,-5 2.4447',\n verbatimLatitude: '50 8.2914',\n verbatimLongitude: '-5 2.4447',\n decimalLatitude: 50.13819,\n decimalLongitude: -5.040745\n },\n {\n verbatimCoordinates: `N 48° 30,6410', E 18° 57,4583'`,\n verbatimLatitude: `N 48° 30,6410'`,\n verbatimLongitude: `E 18° 57,4583'`,\n decimalLatitude: 48.51068,\n decimalLongitude: 18.95764\n },\n {\n verbatimCoordinates: `1.23456, 18.33453`,\n verbatimLatitude: `1.23456`,\n verbatimLongitude: `18.33453`,\n decimalLatitude: 1.23456,\n decimalLongitude: 18.33453\n }\n];\nfunction getAllTestFormats() {\n const arr1 = [];\n coordsParserFormats.forEach(item => {\n if (item.decimalLatitude) {\n arr1.push(item);\n }\n else {\n arr1.push({ ...item, ...coordsParserDecimals });\n }\n });\n return [...arr1, ...coordsRegexFormats, ...otherFormats];\n}\nexport default getAllTestFormats();\n","//adds the formats to the convert object\n//we need to use this as the source for the npm package so that the formats are not included in the bundle\nimport converter from './converter.js';\nimport testFormats from './tests/testformats.js';\nconverter.formats = testFormats.map(format => format.verbatimCoordinates);\nexport const convert = converter;\n","<script lang=\"ts\">\n import { createEventDispatcher, onDestroy } from \"svelte\";\n import { default as ClearIcon } from \"./ClearIcon.svelte\";\n import { default as FailIcon } from \"./FailIcon.svelte\";\n import { default as FeatureItem } from \"./FeatureItem.svelte\";\n import { default as LoadingIcon } from \"./LoadingIcon.svelte\";\n import MarkerIcon from \"./MarkerIcon.svelte\";\n import { default as ReverseGeocodingIcon } from \"./ReverseGeocodingIcon.svelte\";\n import { default as SearchIcon } from \"./SearchIcon.svelte\";\n import { unwrapBbox, wrapNum } from \"./geoUtils\";\n import { getProximity } from \"./proximity\";\n import { convert } from \"geo-coordinates-parser\";\n import type {\n BBox,\n DispatcherType,\n EnableReverse,\n Feature,\n FeatureCollection,\n MapController,\n PickedResultStyle,\n ProximityRule,\n ShowPlaceType,\n TypeRule,\n } from \"./types\";\n\n export const ZOOM_DEFAULTS: Record<string, number> = {\n continental_marine: 4,\n country: 4,\n major_landform: 8,\n region: 5,\n subregion: 6,\n county: 7,\n joint_municipality: 8,\n joint_submunicipality: 9,\n municipality: 10,\n municipal_district: 11,\n locality: 12,\n neighbourhood: 13,\n place: 14,\n postal_code: 14,\n road: 16,\n poi: 17,\n address: 18,\n \"poi.peak\": 15,\n \"poi.shop\": 18,\n \"poi.cafe\": 18,\n \"poi.restaurant\": 18,\n \"poi.aerodrome\": 13,\n // TODO add many more\n };\n\n let className: string | undefined = undefined;\n\n export { className as class };\n\n export let apiKey: string;\n\n export let bbox: BBox | undefined = undefined;\n\n export let clearButtonTitle = \"clear\";\n\n export let clearOnBlur = false;\n\n export let clearListOnPick = false;\n\n export let keepListOpen = false;\n\n export let collapsed = false;\n\n export let country: string | string[] | undefined = undefined;\n\n export let debounceSearch = 200;\n\n export let enableReverse: EnableReverse = \"never\";\n\n export let errorMessage = \"Something went wrong…\";\n\n export let filter: (feature: Feature) => boolean = () => true;\n\n export let flyTo = true;\n\n export let fuzzyMatch = true;\n\n export let language: string | string[] | null | undefined = undefined;\n\n export let limit: number | undefined = undefined;\n\n const COPY_LIMIT = +41415112612;\n\n export let reverseGeocodingLimit: number | undefined = COPY_LIMIT;\n\n export let mapController: MapController | undefined = undefined;\n\n export let minLength = 2;\n\n export let noResultsMessage =\n \"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!\";\n\n export let placeholder = \"Search\";\n\n export let proximity: ProximityRule[] | null | undefined = [\n { type: \"server-geolocation\" },\n ];\n\n export let reverseActive = enableReverse === \"always\";\n\n export let reverseButtonTitle = \"toggle reverse geocoding\";\n\n export let searchValue = \"\";\n\n export let pickedResultStyle: PickedResultStyle = \"full-geometry\";\n\n export let showPlaceType: ShowPlaceType = \"if-needed\";\n\n export let showResultsWhileTyping = true;\n\n export let selectFirst = true;\n\n export let flyToSelected = false;\n\n export let markerOnSelected = true;\n\n export let types: TypeRule[] | undefined = undefined;\n\n const COPY_TYPES: TypeRule[] = [];\n\n export let reverseGeocodingTypes: TypeRule[] | undefined = COPY_TYPES;\n\n export let exhaustiveReverseGeocoding = false;\n\n export let excludeTypes = false;\n\n const COPY_EXCLUDE_TYPES = undefined;\n\n export let reverseGeocodingExcludeTypes: boolean | undefined =\n COPY_EXCLUDE_TYPES;\n\n export let zoom: Record<string, number> = ZOOM_DEFAULTS;\n\n export let apiUrl: string = import.meta.env.VITE_API_URL;\n\n export let fetchParameters: RequestInit = {};\n\n export let iconsBaseUrl =\n \"https://cdn.maptiler.com/maptiler-geocoding-control/v\" +\n import.meta.env.VITE_LIB_VERSION +\n \"/icons/\";\n\n /**\n * @deprecated use `adjustUrl`\n */\n export let adjustUrlQuery: (sp: URLSearchParams) => void = () => {};\n\n /**\n * Adjust geocoding URL before the fetch.\n */\n export let adjustUrl: (url: URL) => void = () => {};\n\n /**\n * Focus the search input box.\n *\n * @param options [FocusOptions](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)\n */\n export function focus(options?: FocusOptions) {\n input.focus(options);\n }\n\n /**\n * Blur the search input box.\n */\n export function blur() {\n input.blur();\n }\n\n /**\n * Set the content of search input box.\n *\n * @param value text to set\n * @param submit perform the search\n */\n export function setQuery(value: string, submit = true, reverse = false) {\n searchValue = value;\n\n if (submit) {\n selectedItemIndex = -1;\n\n handleSubmit();\n } else {\n handleInput(undefined, !reverse, reverse);\n\n setTimeout(() => {\n input.focus();\n input.select();\n });\n }\n }\n\n /**\n * Clear search result list.\n */\n export function clearList() {\n listFeatures = undefined;\n picked = undefined;\n selectedItemIndex = -1;\n }\n\n /**\n * Clear geocoding search results from the map.\n */\n export function clearMap() {\n markedFeatures = [];\n picked = undefined;\n }\n\n let listFeatures: Feature[] | undefined;\n\n let markedFeatures: Feature[] | undefined;\n\n let picked: Feature | undefined;\n\n let lastSearchUrl = \"\";\n\n let input: HTMLInputElement;\n\n let selectedItemIndex = -1;\n\n let error: unknown;\n\n let cachedFeatures: Feature[] = [];\n\n let abortController: AbortController | undefined;\n\n let searchTimeoutRef: number | undefined;\n\n let focusedDelayed: boolean;\n\n let prevIdToFly: string | undefined;\n\n let focused = false;\n\n const missingIconsCache = new Set<string>();\n\n const dispatch = createEventDispatcher<DispatcherType>();\n\n $: reverseActive = enableReverse === \"always\";\n\n $: if (\n pickedResultStyle !== \"marker-only\" &&\n picked &&\n !picked.address &&\n picked.geometry.type === \"Point\" &&\n picked.place_type[0] !== \"reverse\"\n ) {\n search(picked.id, { byId: true }).catch((err) => (error = err));\n }\n\n $: {\n if (mapController && picked && picked.id !== prevIdToFly && flyTo) {\n goToPicked();\n\n if (clearListOnPick) {\n listFeatures = undefined;\n }\n\n markedFeatures = undefined;\n selectedItemIndex = -1;\n }\n\n prevIdToFly = picked?.id;\n }\n\n $: if (mapController && selected && flyTo && flyToSelected) {\n mapController.flyTo(selected.center, computeZoom(selected));\n }\n\n $: showPolygonMarker =\n pickedResultStyle === \"full-geometry-including-polygon-center-marker\";\n\n // if markerOnSelected was dynamically changed to false\n $: if (!markerOnSelected) {\n mapController?.setFeatures(undefined, undefined, showPolygonMarker);\n }\n\n $: if (mapController && markerOnSelected && !markedFeatures) {\n mapController.setFeatures(\n selected ? [selected] : undefined,\n picked,\n showPolygonMarker,\n );\n\n mapController.setSelectedMarker(selected ? 0 : -1);\n }\n\n $: if (markedFeatures !== listFeatures) {\n markedFeatures = undefined;\n }\n\n $: if (mapController) {\n mapController.setFeatures(markedFeatures, picked, showPolygonMarker);\n }\n\n $: if (searchValue.length < minLength) {\n listFeatures = undefined;\n error = undefined;\n markedFeatures = listFeatures;\n }\n\n // highlight selected marker\n $: if (markedFeatures && mapController) {\n mapController.setSelectedMarker(selectedItemIndex);\n }\n\n // close dropdown in the next cycle so that the selected item event has the chance to fire\n $: setTimeout(() => {\n focusedDelayed = focused;\n\n if (clearOnBlur && !focusedDelayed) {\n searchValue = \"\";\n }\n });\n\n $: if (\n selectFirst &&\n listFeatures?.length &&\n selectedItemIndex == -1 &&\n !picked\n ) {\n selectedItemIndex = 0;\n }\n\n $: selected = listFeatures?.[selectedItemIndex];\n\n $: if (mapController) {\n const coords = isQueryReverse(searchValue);\n\n mapController.setReverseMarker(\n coords ? [coords.decimalLongitude, coords.decimalLatitude] : undefined,\n );\n }\n\n $: dispatch(\"select\", { feature: selected });\n\n $: dispatch(\"pick\", { feature: picked });\n\n $: optionsVisible =\n !!listFeatures?.length && (focusedDelayed || keepListOpen);\n\n $: dispatch(\"optionsvisibilitychange\", { optionsVisible });\n\n $: dispatch(\"featureslisted\", { features: listFeatures });\n\n $: dispatch(\"featuresmarked\", { features: markedFeatures });\n\n $: dispatch(\"reversetoggle\", { reverse: reverseActive });\n\n $: dispatch(\"querychange\", { query: searchValue });\n\n $: if (mapController) {\n mapController.indicateReverse(reverseActive);\n }\n\n $: if (mapController) {\n mapController.setEventHandler((e) => {\n switch (e.type) {\n case \"mapClick\":\n if (reverseActive) {\n handleReverse(e.coordinates);\n }\n\n break;\n case \"markerClick\":\n {\n const feature = listFeatures?.find(\n (feature) => feature.id === e.id,\n );\n\n if (feature) {\n pick(feature);\n }\n }\n\n break;\n case \"markerMouseEnter\":\n if (markedFeatures) {\n selectedItemIndex = !focusedDelayed\n ? -1\n : (listFeatures?.findIndex((feature) => feature.id === e.id) ??\n -1);\n }\n\n break;\n case \"markerMouseLeave\":\n if (markedFeatures) {\n selectedItemIndex = -1;\n }\n\n break;\n }\n });\n }\n\n onDestroy(() => {\n if (mapController) {\n mapController.setEventHandler(undefined);\n mapController.indicateReverse(false);\n mapController.setSelectedMarker(-1);\n mapController.setFeatures(undefined, undefined, false);\n }\n });\n\n function handleSubmit(event?: unknown) {\n focused = false;\n\n if (searchTimeoutRef) {\n clearTimeout(searchTimeoutRef);\n\n searchTimeoutRef = undefined;\n }\n\n if (selectedItemIndex > -1 && listFeatures) {\n picked = listFeatures[selectedItemIndex];\n\n searchValue =\n picked.place_type[0] === \"reverse\"\n ? picked.place_name\n : picked.place_name.replace(/,.*/, \"\");\n\n error = undefined;\n\n markedFeatures = undefined;\n\n selectedItemIndex = -1;\n } else if (searchValue) {\n const zoomTo = event || !isQueryReverse(searchValue);\n\n search(searchValue, { exact: true })\n .then(() => {\n markedFeatures = listFeatures;\n\n picked = undefined;\n\n if (zoomTo) {\n zoomToResults();\n }\n })\n .catch((err) => (error = err));\n }\n }\n\n function isQueryReverse(searchValue: string) {\n try {\n return convert(searchValue, 6);\n } catch {\n return false;\n }\n }\n\n async function search(\n searchValue: string,\n {\n byId = false,\n exact = false,\n }: undefined | { byId?: boolean; exact?: boolean } = {},\n ) {\n error = undefined;\n\n abortController?.abort();\n\n const ac = new AbortController();\n\n abortController = ac;\n\n try {\n const isReverse = isQueryReverse(searchValue);\n\n const urlObj = new URL(\n apiUrl +\n \"/\" +\n encodeURIComponent(\n isReverse\n ? isReverse.decimalLongitude + \",\" + isReverse.decimalLatitude\n : searchValue,\n ) +\n \".json\",\n );\n\n const sp = urlObj.searchParams;\n\n if (language !== undefined) {\n sp.set(\n \"language\",\n Array.isArray(language) ? language.join(\",\") : (language ?? \"\"),\n );\n }\n\n const [zoom] = mapController?.getCenterAndZoom() ?? [];\n\n let effTypes = (\n !isReverse || reverseGeocodingTypes === COPY_TYPES\n ? types\n : reverseGeocodingTypes\n )\n ?.map((typeRule) =>\n typeof typeRule === \"string\"\n ? typeRule\n : zoom === undefined ||\n ((typeRule[0] ?? 0) <= zoom && zoom < (typeRule[1] ?? Infinity))\n ? typeRule[2]\n : undefined,\n )\n .filter((type) => type !== undefined);\n\n if (effTypes) {\n effTypes = [...new Set(effTypes)];\n\n sp.set(\"types\", effTypes.join(\",\"));\n }\n\n const effExcludeTypes =\n !isReverse || reverseGeocodingExcludeTypes === COPY_EXCLUDE_TYPES\n ? excludeTypes\n : reverseGeocodingExcludeTypes;\n\n if (effExcludeTypes) {\n sp.set(\"excludeTypes\", String(effExcludeTypes));\n }\n\n if (bbox) {\n sp.set(\"bbox\", bbox.map((c) => c.toFixed(6)).join(\",\"));\n }\n\n if (country) {\n sp.set(\"country\", Array.isArray(country) ? country.join(\",\") : country);\n }\n\n if (!byId && !isReverse) {\n const coords = await getProximity(mapController, proximity, ac);\n\n if (coords) {\n sp.set(\"proximity\", coords);\n }\n\n if (exact || !showResultsWhileTyping) {\n sp.set(\"autocomplete\", \"false\");\n }\n\n sp.set(\"fuzzyMatch\", String(fuzzyMatch));\n }\n\n const effReverseGeocodingLimit =\n reverseGeocodingLimit === COPY_LIMIT ? limit : reverseGeocodingLimit;\n\n if (\n effReverseGeocodingLimit !== undefined &&\n effReverseGeocodingLimit > 1 &&\n effTypes?.length !== 1\n ) {\n console.warn(\n \"For reverse geocoding when limit > 1 then types must contain single value.\",\n );\n }\n\n if (isReverse) {\n if (\n effReverseGeocodingLimit === 1 ||\n (effReverseGeocodingLimit !== undefined &&\n (exhaustiveReverseGeocoding || effTypes?.length === 1))\n ) {\n sp.set(\"limit\", String(effReverseGeocodingLimit));\n }\n } else if (limit !== undefined) {\n sp.set(\"limit\", String(limit));\n }\n\n sp.set(\"key\", apiKey);\n\n adjustUrlQuery(sp);\n\n adjustUrl(urlObj);\n\n const noTypes =\n urlObj.searchParams.get(\"types\") === \"\" &&\n urlObj.searchParams.get(\"excludeTypes\") !== \"true\";\n\n const url = urlObj.toString();\n\n if (url === lastSearchUrl) {\n if (byId) {\n if (clearListOnPick) {\n listFeatures = undefined;\n }\n\n picked = cachedFeatures[0];\n } else {\n listFeatures = cachedFeatures;\n\n if (listFeatures[selectedItemIndex]?.id !== selected?.id) {\n selectedItemIndex = -1;\n }\n }\n\n return;\n }\n\n lastSearchUrl = url;\n\n let featureCollection: FeatureCollection;\n\n if (noTypes) {\n featureCollection = { type: \"FeatureCollection\", features: [] };\n } else {\n const res = await fetch(url, {\n signal: ac.signal,\n ...fetchParameters,\n });\n\n if (!res.ok) {\n throw new Error(await res.text());\n }\n\n featureCollection = await res.json();\n }\n\n dispatch(\"response\", { url, featureCollection });\n\n if (byId) {\n if (clearListOnPick) {\n listFeatures = undefined;\n }\n\n picked = featureCollection.features[0];\n\n cachedFeatures = [picked];\n } else {\n listFeatures = featureCollection.features.filter(filter);\n\n if (isReverse) {\n listFeatures.unshift({\n type: \"Feature\",\n properties: {},\n id:\n \"reverse_\" +\n isReverse.decimalLongitude +\n \"_\" +\n isReverse.decimalLatitude,\n text: isReverse.decimalLatitude + \", \" + isReverse.decimalLongitude,\n place_name:\n isReverse.decimalLatitude + \", \" + isReverse.decimalLongitude,\n place_type: [\"reverse\"],\n center: [isReverse.decimalLongitude, isReverse.decimalLatitude],\n bbox: [\n isReverse.decimalLongitude,\n isReverse.decimalLatitude,\n isReverse.decimalLongitude,\n isReverse.decimalLatitude,\n ],\n geometry: {\n type: \"Point\",\n coordinates: [\n isReverse.decimalLongitude,\n isReverse.decimalLatitude,\n ],\n },\n });\n }\n\n cachedFeatures = listFeatures;\n\n if (listFeatures[selectedItemIndex]?.id !== selected?.id) {\n selectedItemIndex = -1;\n }\n\n if (isReverse) {\n input.focus();\n }\n }\n } catch (e) {\n if (\n e &&\n typeof e === \"object\" &&\n \"name\" in e &&\n e.name === \"AbortError\"\n ) {\n return;\n }\n\n throw e;\n } finally {\n if (ac === abortController) {\n abortController = undefined;\n }\n }\n }\n\n function zoomToResults() {\n if (!markedFeatures?.length || !flyTo) {\n return;\n }\n\n const bbox: BBox = [180, 90, -180, -90];\n\n const fuzzyOnly = !markedFeatures.some((feature) => !feature.matching_text);\n\n let allZoom: number | undefined;\n\n for (const feature of markedFeatures) {\n const featZoom = computeZoom(feature);\n\n allZoom =\n allZoom === undefined\n ? featZoom\n : featZoom === undefined\n ? allZoom\n : Math.max(allZoom, featZoom);\n\n if (fuzzyOnly || !feature.matching_text) {\n for (const i of [0, 1, 2, 3] as const) {\n bbox[i] = Math[i < 2 ? \"min\" : \"max\"](\n bbox[i],\n feature.bbox?.[i] ?? feature.center[i % 2],\n );\n }\n }\n }\n\n if (mapController && markedFeatures.length > 0) {\n if (picked && bbox[0] === bbox[2] && bbox[1] === bbox[3]) {\n mapController.flyTo(picked.center, computeZoom(picked));\n } else {\n mapController.fitBounds(unwrapBbox(bbox), 50, allZoom);\n }\n }\n }\n\n function goToPicked() {\n if (!picked || !mapController) {\n return;\n }\n\n if (\n !picked.bbox ||\n (picked.bbox[0] === picked.bbox[2] && picked.bbox[1] === picked.bbox[3])\n ) {\n mapController.flyTo(picked.center, computeZoom(picked));\n } else {\n mapController.fitBounds(unwrapBbox(picked.bbox), 50, computeZoom(picked));\n }\n }\n\n function computeZoom(feature: Feature): number | undefined {\n if (\n !feature.bbox ||\n (feature.bbox[0] !== feature.bbox[2] &&\n feature.bbox[1] !== feature.bbox[3])\n ) {\n return undefined;\n }\n\n const index = feature.id.replace(/\\..*/, \"\");\n\n return (\n (Array.isArray(feature.properties?.categories)\n ? (feature.properties.categories as string[]).reduce(\n (a, category) => {\n const b = zoom[index + \".\" + category];\n\n return a === undefined ? b : b === undefined ? a : Math.max(a, b);\n },\n undefined as undefined | number,\n )\n : undefined) ?? zoom[index]\n );\n }\n\n function handleReverse(coordinates: [lng: number, lat: number]) {\n reverseActive = enableReverse === \"always\";\n\n listFeatures = undefined;\n picked = undefined;\n selectedItemIndex = -1;\n\n setQuery(\n coordinates[1].toFixed(6) +\n \", \" +\n wrapNum(coordinates[0], [-180, 180], true).toFixed(6),\n false,\n true,\n );\n }\n\n function handleKeyDown(e: KeyboardEvent) {\n if (!listFeatures) {\n return;\n }\n\n let dir = e.key === \"ArrowDown\" ? 1 : e.key === \"ArrowUp\" ? -1 : 0;\n\n if (!dir) {\n return;\n }\n\n input.focus();\n\n focused = true;\n\n e.preventDefault();\n\n if (picked && selectedItemIndex === -1) {\n selectedItemIndex = listFeatures.findIndex(\n (listFeature) => listFeature.id === picked?.id,\n );\n }\n\n if (selectedItemIndex === (picked || selectFirst ? 0 : -1) && dir === -1) {\n selectedItemIndex = listFeatures.length;\n }\n\n selectedItemIndex += dir;\n\n if (selectedItemIndex >= listFeatures.length) {\n selectedItemIndex = -1;\n }\n\n if (selectedItemIndex < 0 && (picked || selectFirst)) {\n selectedItemIndex = 0;\n }\n }\n\n function handleInput(_?: Event, debounce = true, reverse = false) {\n error = undefined;\n picked = undefined;\n focused = true;\n\n if (showResultsWhileTyping || reverse) {\n if (searchTimeoutRef) {\n clearTimeout(searchTimeoutRef);\n }\n\n if (searchValue.length < minLength) {\n return;\n }\n\n const sv = searchValue;\n\n searchTimeoutRef = window.setTimeout(\n () => {\n search(sv).catch((err) => (error = err));\n },\n debounce ? debounceSearch : 0,\n );\n } else {\n listFeatures = undefined;\n error = undefined;\n }\n }\n\n function pick(feature: Feature) {\n if (picked && picked?.id === feature?.id) {\n goToPicked();\n } else {\n picked = feature;\n searchValue = feature.place_name;\n }\n }\n\n function handleMouseEnter(index: number) {\n selectedItemIndex = index;\n }\n\n function handleMouseLeave() {\n if (!selectFirst || picked) {\n selectedItemIndex = -1;\n }\n\n // re-focus on picked\n if (flyToSelected) {\n goToPicked();\n }\n }\n</script>\n\n{#if false}\n <!-- This workaround is just to use marker styles. Bug in svlete/vite? Investigate. -->\n <MarkerIcon displayIn=\"list\" />\n{/if}\n\n<form\n on:submit|preventDefault={handleSubmit}\n class:can-collapse={collapsed && searchValue === \"\"}\n class={className}\n>\n <div class=\"input-group\">\n <button class=\"search-button\" type=\"button\" on:click={() => input.focus()}>\n <SearchIcon />\n </button>\n\n <input\n bind:this={input}\n bind:value={searchValue}\n on:focus={() => (focused = true)}\n on:blur={() => (focused = false)}\n on:click={() => (focused = true)}\n on:keydown={handleKeyDown}\n on:input={handleInput}\n on:change={() => (picked = undefined)}\n {placeholder}\n aria-label={placeholder}\n />\n\n <div class=\"clear-button-container\" class:displayable={searchValue !== \"\"}>\n <button\n type=\"button\"\n on:click={() => {\n searchValue = \"\";\n picked = undefined;\n input.focus();\n }}\n title={clearButtonTitle}\n >\n <ClearIcon />\n </button>\n\n {#if abortController}\n <LoadingIcon />\n {/if}\n </div>\n\n {#if enableReverse === \"button\"}\n <button\n type=\"button\"\n class:active={reverseActive}\n title={reverseButtonTitle}\n on:click={() => (reverseActive = !reverseActive)}\n >\n <ReverseGeocodingIcon />\n </button>\n {/if}\n\n <slot />\n </div>\n\n {#if error}\n <div class=\"error\">\n <FailIcon />\n\n <div>{errorMessage}</div>\n\n <button on:click={() => (error = undefined)}>\n <ClearIcon />\n </button>\n </div>\n {:else if !focusedDelayed && !keepListOpen}\n {\"\"}\n {:else if listFeatures?.length === 0}\n <div class=\"no-results\">\n <FailIcon />\n\n <div>{noResultsMessage}</div>\n </div>\n {:else if listFeatures?.length && (focusedDelayed || keepListOpen)}\n <ul\n class=\"options\"\n on:mouseleave={handleMouseLeave}\n on:blur={() => undefined}\n on:keydown={handleKeyDown}\n role=\"listbox\"\n >\n {#each listFeatures as feature, i (feature.id + (feature.address ? \",\" + feature.address : \"\"))}\n <FeatureItem\n {feature}\n {showPlaceType}\n style={selectedItemIndex === i\n ? \"selected\"\n : picked?.id === feature.id\n ? \"picked\"\n : \"default\"}\n on:mouseenter={() => handleMouseEnter(i)}\n on:select={() => pick(feature)}\n {missingIconsCache}\n {iconsBaseUrl}\n />\n {/each}\n </ul>\n {/if}\n</form>\n\n<style lang=\"scss\">\n form {\n font-family: \"Open Sans\", \"Ubuntu\", \"Helvetica Neue\", Arial, Helvetica,\n sans-serif;\n position: relative;\n background-color: #fff;\n z-index: 10;\n border-radius: 4px;\n margin: 0;\n transition: max-width 0.25s;\n box-shadow: 0px 2px 5px rgba(51, 51, 89, 0.15);\n --color-text: #444952;\n --color-icon-button: #444952;\n\n &,\n & *,\n & *:after,\n & *:before {\n box-sizing: border-box;\n }\n\n &.can-collapse {\n max-width: 29px;\n\n & input::placeholder {\n transition: opacity 0.25s;\n opacity: 0;\n }\n }\n\n &,\n &:focus-within,\n &:hover {\n width: 270px;\n max-width: 270px;\n\n & input::placeholder {\n opacity: 1;\n }\n }\n }\n\n input {\n font: inherit;\n font-size: 14px;\n flex-grow: 1;\n min-height: 29px;\n background-color: transparent;\n color: #444952;\n white-space: nowrap;\n overflow: hidden;\n border: 0;\n margin: 0;\n padding: 0;\n\n &:focus {\n color: #444952;\n outline: 0;\n outline: none;\n box-shadow: none;\n }\n }\n\n ul,\n div.error,\n div.no-results {\n background-color: #fff;\n border-radius: 4px;\n left: 0;\n list-style: none;\n margin: 0;\n padding: 0;\n position: absolute;\n width: 100%;\n top: calc(100% + 6px);\n overflow: hidden;\n }\n\n ul {\n font-size: 14px;\n line-height: 16px;\n box-shadow: 0px 5px 10px rgba(51, 51, 89, 0.15);\n }\n\n div.error,\n div.no-results {\n font: inherit;\n line-height: 18px;\n font-size: 12px;\n display: flex;\n gap: 16px;\n }\n\n div.error {\n padding: 16px;\n font-weight: 600;\n color: #e25041;\n background-color: #fbeae8;\n\n div {\n flex-grow: 1;\n }\n\n :global(svg) {\n flex-shrink: 0;\n width: 20px;\n height: 20px;\n }\n\n button {\n flex-shrink: 0;\n & > :global(svg) {\n width: 13px;\n fill: #e25041;\n }\n\n &:hover :global(svg),\n &:active :global(svg) {\n fill: #444952;\n }\n }\n }\n\n div.no-results {\n padding: 14px 24px 14px 16px;\n font-weight: 400;\n color: #6b7c93;\n box-shadow: 0px 5px 10px rgba(51, 51, 89, 0.15);\n\n :global(svg) {\n margin-top: 4px;\n flex-shrink: 0;\n width: 20px;\n height: 20px;\n width: 30px;\n height: 30px;\n }\n }\n\n :global(.leaflet-bottom) ul.options,\n :global(.maplibregl-ctrl-bottom-left) ul.options,\n :global(.maplibregl-ctrl-bottom-right) ul.options {\n top: auto;\n bottom: calc(100% + 6px);\n }\n\n button {\n padding: 0;\n margin: 0;\n border: 0;\n background-color: transparent;\n height: auto;\n width: auto;\n\n &:hover {\n background-color: transparent;\n }\n }\n\n button:hover :global(svg),\n button:active :global(svg) {\n fill: #2b8bfb;\n }\n\n .input-group {\n display: flex;\n align-items: stretch;\n gap: 7px;\n padding-inline: 8px;\n border-radius: 4px;\n overflow: hidden;\n\n &:focus-within {\n outline: #2b8bfb solid 2px;\n }\n }\n\n .search-button {\n flex-shrink: 0;\n }\n\n :global(.maplibregl-ctrl-geocoder:not(.maptiler-ctrl) .search-button svg) {\n width: 12px !important;\n transform: translate(0.5px, 0);\n }\n\n .clear-button-container {\n display: flex;\n display: none;\n position: relative;\n align-items: stretch;\n\n &.displayable {\n display: flex;\n flex-shrink: 0;\n }\n }\n\n :global(.maplibregl-ctrl-geocoder) {\n position: relative;\n z-index: 3;\n }\n\n :global(.maptiler-ctrl) {\n &:not(:empty) {\n box-shadow: none;\n }\n\n & .input-group {\n padding-inline: 8px;\n border: white solid 2px;\n\n &:focus-within {\n border: #2b8bfb solid 2px;\n outline: 0;\n outline: none;\n }\n }\n\n & form {\n &.can-collapse {\n max-width: 33px;\n }\n\n &,\n &:focus-within,\n &:hover {\n width: 270px;\n max-width: 270px;\n }\n }\n }\n</style>\n","import GeocodingControlComponent from \"./GeocodingControl.svelte\";\nimport type { ControlOptions, DispatcherType, MapController } from \"./types\";\n\nconst finalizationRegistry =\n new FinalizationRegistry<GeocodingControlComponent>((gc) => {\n gc.$destroy();\n });\n\ntype Options = ControlOptions & { mapController?: MapController };\n\ninterface GeocodingControlEvent<T> extends CustomEvent<T> {\n readonly target: GeocodingControl;\n readonly currentTarget: GeocodingControl;\n}\n\ntype CustomEventListenerOrEventListenerObject<K extends keyof CustomEventMap> =\n | ((evt: CustomEventMap[K]) => void)\n | { handleEvent(object: CustomEventMap[K]): void };\n\ntype CustomEventMap = {\n [T in keyof DispatcherType]: GeocodingControlEvent<DispatcherType[T]>;\n};\n\nexport class GeocodingControl extends EventTarget {\n #gc: GeocodingControlComponent;\n\n constructor({ target, ...options }: Options & { target: HTMLElement }) {\n super();\n\n this.#gc = new GeocodingControlComponent({\n target,\n props: options,\n });\n\n for (const eventName of [\n \"select\",\n \"pick\",\n \"featureslisted\",\n \"featuresmarked\",\n \"response\",\n \"optionsvisibilitychange\",\n \"reversetoggle\",\n \"querychange\",\n ] as const) {\n this.#gc.$on(eventName, (event) => {\n // Use the new `emit` method for type-safe dispatching\n this.#emit(eventName, event.detail);\n });\n }\n\n this.#gc.$on(\"select\", (event) => {\n const geocodingEvent = new CustomEvent(event.type, {\n detail: event.detail,\n }) as GeocodingControlEvent<CustomEventMap[\"select\"][\"detail\"]>;\n\n this.dispatchEvent(geocodingEvent);\n });\n\n finalizationRegistry.register(this, this.#gc);\n }\n\n /**\n * Update the control options.\n *\n * @param options options to update\n */\n setOptions(options: Partial<Options>) {\n this.#gc.$set(options);\n }\n\n /**\n * Set the content of search input box.\n *\n * @param value text to set\n * @param submit perform the search\n */\n setQuery(value: string, submit = true) {\n this.#gc?.setQuery(value, submit);\n }\n\n /**\n * Clear geocoding search results from the map.\n */\n clearMap() {\n this.#gc?.clearMap();\n }\n\n /**\n * Clear search result list.\n */\n clearList() {\n this.#gc?.clearList();\n }\n\n /**\n * Set reverse geocoding mode.\n *\n * @param reverseActive reverse geocoding active\n */\n setReverseMode(reverseActive: boolean) {\n this.#gc?.$set({ reverseActive });\n }\n\n /**\n * Focus the search input box.\n *\n * @param options [FocusOptions](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)\n */\n focus(options?: FocusOptions) {\n this.#gc?.focus(options);\n }\n\n /**\n * Blur the search input box.\n */\n blur() {\n this.#gc?.blur();\n }\n\n addEventListener<K extends keyof CustomEventMap>(\n type: K,\n callback: CustomEventListenerOrEventListenerObject<K> | null,\n options?: AddEventListenerOptions | boolean,\n ): void;\n\n addEventListener(\n type: string,\n callback: EventListenerOrEventListenerObject | null,\n options?: AddEventListenerOptions | boolean,\n ): void {\n super.addEventListener(type, callback, options);\n }\n\n removeEventListener<K extends keyof CustomEventMap>(\n type: K,\n callback: CustomEventListenerOrEventListenerObject<K> | null,\n options?: EventListenerOptions | boolean,\n ): void;\n\n removeEventListener(\n type: string,\n callback: EventListenerOrEventListenerObject | null,\n options?: EventListenerOptions | boolean,\n ): void {\n super.removeEventListener(type, callback, options);\n }\n\n dispatchEvent<K extends keyof CustomEventMap>(\n event: CustomEventMap[K],\n ): boolean;\n\n dispatchEvent(event: Event): boolean {\n return super.dispatchEvent(event);\n }\n\n #emit<K extends keyof CustomEventMap>(\n type: K,\n detail: CustomEventMap[K][\"detail\"],\n ): boolean {\n return super.dispatchEvent(\n new CustomEvent(type, {\n detail,\n }) as GeocodingControlEvent<CustomEventMap[K][\"detail\"]>,\n );\n }\n}\n"],"names":["noop","assign","tar","src","k","run","fn","blank_object","run_all","fns","is_function","thing","safe_not_equal","a","b","src_url_equal_anchor","src_url_equal","element_src","url","is_empty","obj","create_slot","definition","ctx","$$scope","slot_ctx","get_slot_context","get_slot_changes","dirty","update_slot_base","slot","slot_definition","slot_changes","get_slot_context_fn","slot_context","get_all_dirty_from_scope","length","i","null_to_empty","value","append","target","node","insert","anchor","detach","element","name","svg_element","text","data","space","empty","listen","event","handler","options","prevent_default","attr","attribute","children","set_data","set_input_value","input","toggle_class","toggle","custom_event","type","detail","bubbles","cancelable","current_component","set_current_component","component","get_current_component","onDestroy","createEventDispatcher","callbacks","bubble","dirty_components","binding_callbacks","render_callbacks","flush_callbacks","resolved_promise","update_scheduled","schedule_update","flush","add_render_callback","seen_callbacks","flushidx","saved_component","update","callback","$$","flush_render_callbacks","filtered","targets","c","outroing","outros","group_outros","check_outros","transition_in","block","local","transition_out","ensure_array_like","array_like_or_iterator","outro_and_destroy_block","lookup","update_keyed_each","old_blocks","get_key","dynamic","list","destroy","create_each_block","next","get_context","o","n","old_indexes","new_blocks","new_lookup","deltas","updates","child_ctx","key","will_move","did_move","new_block","old_block","new_key","old_key","create_component","mount_component","fragment","after_update","new_on_destroy","destroy_component","detaching","make_dirty","init","instance","create_fragment","not_equal","props","append_styles","parent_component","ready","ret","rest","nodes","SvelteComponent","__publicField","index","PUBLIC_VERSION","svg","path","img","img_src_value","scaleFactor","scaleUrl","sprites","div","span","create_if_block_1","create_if_block_2","create_if_block_3","show_if_1","show_if_2","show_if_3","show_if_4","create_if_block_8","li","li_aria_selected_value","li_aria_checked_value","span3","span1","span0","span2","t1","t1_value","t4","t4_value","hidpi","spritePromise","feature","$$props","style","showPlaceType","missingIconsCache","iconsBaseUrl","dispatch","category","imageUrl","spriteIcon","loadSprites","response","handleImgError","loadIcon","loadIcon2","categories","$$invalidate","ev","_a","_b","_c","_d","_e","isReverse","placeType","circle","wrapNum","x","range","includeMax","max","min","d","unwrapBbox","bbox0","bbox","cachedLocation","getProximity","mapController","proximity","ac","centerAndZoom","rule","cg","coords","resolve","reject","pos","err","dm_invalid","dm_numbers","dd_re","dms_periods","dms_abbr","coords_other","toCoordinateFormat","format","parts","decimalLatitude","decimalLongitude","absoluteLatitude","absoluteLongitude","latDir","longDir","result","degreesLatitude","degreesLongitude","minutesLatitudeNotTruncated","minutesLongitudeNotTruncated","dmMinsLatitude","round","dmMinsLongitude","latMinutes","longMinutes","latSeconds","longSeconds","latMinutesString","longMinutesString","num","places","converter","coordsString","decimalPlaces","ddLat","ddLng","latdir","lngdir","originalFormat","match","matchSuccess","checkMatch","patt","verbatimCoordinates","verbatimLat","verbatimLng","sepChars","seps","middle","splitIndex","currSepIndex","startSearchIndex","splitLat","splitLon","coordsCloseEnough","filteredMatch","numerictest","stringtest","halflen","leftside","rightside","bothAreNumbers","bothAreStrings","valuesAreEqual","decimalsCloseEnough","dec1","dec2","originaldiff","coordsToTest","to","coordsParserFormats","coordsParserDecimals","coordsRegexFormats","otherFormats","getAllTestFormats","arr1","item","testFormats","convert","button","ul","div1","div0","featureitem_changes","create_if_block_5","if_block2","create_if_block_4","form","button0","input_1","button1","ZOOM_DEFAULTS","className","apiKey","clearButtonTitle","clearOnBlur","clearListOnPick","keepListOpen","collapsed","country","debounceSearch","enableReverse","errorMessage","filter","flyTo","fuzzyMatch","language","limit","COPY_LIMIT","reverseGeocodingLimit","minLength","noResultsMessage","placeholder","reverseActive","reverseButtonTitle","searchValue","pickedResultStyle","showResultsWhileTyping","selectFirst","flyToSelected","markerOnSelected","types","COPY_TYPES","reverseGeocodingTypes","exhaustiveReverseGeocoding","excludeTypes","COPY_EXCLUDE_TYPES","reverseGeocodingExcludeTypes","zoom","apiUrl","fetchParameters","adjustUrlQuery","adjustUrl","focus","blur","setQuery","submit","reverse","selectedItemIndex","handleSubmit","handleInput","clearList","listFeatures","picked","clearMap","markedFeatures","lastSearchUrl","error","cachedFeatures","abortController","searchTimeoutRef","focusedDelayed","prevIdToFly","focused","zoomTo","isQueryReverse","search","zoomToResults","byId","exact","urlObj","sp","effTypes","typeRule","effExcludeTypes","effReverseGeocodingLimit","noTypes","selected","featureCollection","res","e","fuzzyOnly","allZoom","featZoom","computeZoom","goToPicked","handleReverse","coordinates","handleKeyDown","dir","listFeature","_","debounce","sv","pick","handleMouseEnter","handleMouseLeave","click_handler","$$value","focus_handler","blur_handler","click_handler_1","change_handler","click_handler_3","click_handler_4","mouseenter_handler","select_handler","showPolygonMarker","optionsVisible","finalizationRegistry","gc","_gc","_GeocodingControl_instances","emit_fn","_GeocodingControl","__privateAdd","__privateSet","GeocodingControlComponent","eventName","__privateGet","__privateMethod","geocodingEvent","__superGet","GeocodingControl"],"mappings":";;;;;;;;;;AACO,SAASA,IAAO;AAAA;AAWhB,SAASC,GAAOC,GAAKC,GAAK;AAEhC,aAAWC,KAAKD,EAAK,CAAAD,EAAIE,CAAC,IAAID,EAAIC,CAAC;AACnC;AAAA;AAAA,IAA6BF;AAAA;AAC9B;AAuBO,SAASG,GAAIC,GAAI;AACvB,SAAOA,EAAI;AACZ;AAEO,SAASC,KAAe;AAC9B,SAAO,uBAAO,OAAO,IAAI;AAC1B;AAMO,SAASC,GAAQC,GAAK;AAC5B,EAAAA,EAAI,QAAQJ,EAAG;AAChB;AAMO,SAASK,GAAYC,GAAO;AAClC,SAAO,OAAOA,KAAU;AACzB;AAGO,SAASC,GAAeC,GAAGC,GAAG;AACpC,SAAOD,KAAKA,IAAIC,KAAKA,IAAID,MAAMC,KAAMD,KAAK,OAAOA,KAAM,YAAa,OAAOA,KAAM;AAClF;AAEA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