|
import { |
|
VERSION |
|
} from "./chunk-2GBBIY5G.js"; |
|
import { |
|
__publicField |
|
} from "./chunk-TNDHKS54.js"; |
|
|
|
|
|
function noop() { |
|
} |
|
var identity = (x) => x; |
|
function assign(tar, src) { |
|
for (const k in src) tar[k] = src[k]; |
|
return ( |
|
|
|
tar |
|
); |
|
} |
|
function is_promise(value) { |
|
return !!value && (typeof value === "object" || typeof value === "function") && typeof |
|
value.then === "function"; |
|
} |
|
function add_location(element2, file, line, column, char) { |
|
element2.__svelte_meta = { |
|
loc: { file, line, column, char } |
|
}; |
|
} |
|
function run(fn) { |
|
return fn(); |
|
} |
|
function blank_object() { |
|
return Object.create(null); |
|
} |
|
function run_all(fns) { |
|
fns.forEach(run); |
|
} |
|
function is_function(thing) { |
|
return typeof thing === "function"; |
|
} |
|
function safe_not_equal(a, b) { |
|
return a != a ? b == b : a !== b || a && typeof a === "object" || typeof a === "function"; |
|
} |
|
var src_url_equal_anchor; |
|
function src_url_equal(element_src, url) { |
|
if (element_src === url) return true; |
|
if (!src_url_equal_anchor) { |
|
src_url_equal_anchor = document.createElement("a"); |
|
} |
|
src_url_equal_anchor.href = url; |
|
return element_src === src_url_equal_anchor.href; |
|
} |
|
function split_srcset(srcset) { |
|
return srcset.split(",").map((src) => src.trim().split(" ").filter(Boolean)); |
|
} |
|
function srcset_url_equal(element_srcset, srcset) { |
|
const element_urls = split_srcset(element_srcset.srcset); |
|
const urls = split_srcset(srcset || ""); |
|
return urls.length === element_urls.length && urls.every( |
|
([url, width], i) => width === element_urls[i][1] && |
|
|
|
|
|
|
|
|
|
(src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0])) |
|
); |
|
} |
|
function not_equal(a, b) { |
|
return a != a ? b == b : a !== b; |
|
} |
|
function is_empty(obj) { |
|
return Object.keys(obj).length === 0; |
|
} |
|
function validate_store(store, name) { |
|
if (store != null && typeof store.subscribe !== "function") { |
|
throw new Error(`'${name}' is not a store with a 'subscribe' method`); |
|
} |
|
} |
|
function subscribe(store, ...callbacks) { |
|
if (store == null) { |
|
for (const callback of callbacks) { |
|
callback(void 0); |
|
} |
|
return noop; |
|
} |
|
const unsub = store.subscribe(...callbacks); |
|
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub; |
|
} |
|
function get_store_value(store) { |
|
let value; |
|
subscribe(store, (_) => value = _)(); |
|
return value; |
|
} |
|
function component_subscribe(component, store, callback) { |
|
component.$$.on_destroy.push(subscribe(store, callback)); |
|
} |
|
function create_slot(definition, ctx, $$scope, fn) { |
|
if (definition) { |
|
const slot_ctx = get_slot_context(definition, ctx, $$scope, fn); |
|
return definition[0](slot_ctx); |
|
} |
|
} |
|
function get_slot_context(definition, ctx, $$scope, fn) { |
|
return definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx; |
|
} |
|
function get_slot_changes(definition, $$scope, dirty, fn) { |
|
if (definition[2] && fn) { |
|
const lets = definition[2](fn(dirty)); |
|
if ($$scope.dirty === void 0) { |
|
return lets; |
|
} |
|
if (typeof lets === "object") { |
|
const merged = []; |
|
const len = Math.max($$scope.dirty.length, lets.length); |
|
for (let i = 0; i < len; i += 1) { |
|
merged[i] = $$scope.dirty[i] | lets[i]; |
|
} |
|
return merged; |
|
} |
|
return $$scope.dirty | lets; |
|
} |
|
return $$scope.dirty; |
|
} |
|
function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) { |
|
if (slot_changes) { |
|
const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn); |
|
slot.p(slot_context, slot_changes); |
|
} |
|
} |
|
function update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) { |
|
const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn); |
|
update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn); |
|
} |
|
function get_all_dirty_from_scope($$scope) { |
|
if ($$scope.ctx.length > 32) { |
|
const dirty = []; |
|
const length = $$scope.ctx.length / 32; |
|
for (let i = 0; i < length; i++) { |
|
dirty[i] = -1; |
|
} |
|
return dirty; |
|
} |
|
return -1; |
|
} |
|
function exclude_internal_props(props) { |
|
const result = {}; |
|
for (const k in props) if (k[0] !== "$") result[k] = props[k]; |
|
return result; |
|
} |
|
function compute_rest_props(props, keys) { |
|
const rest = {}; |
|
keys = new Set(keys); |
|
for (const k in props) if (!keys.has(k) && k[0] !== "$") rest[k] = props[k]; |
|
return rest; |
|
} |
|
function compute_slots(slots) { |
|
const result = {}; |
|
for (const key in slots) { |
|
result[key] = true; |
|
} |
|
return result; |
|
} |
|
function once(fn) { |
|
let ran = false; |
|
return function(...args) { |
|
if (ran) return; |
|
ran = true; |
|
fn.call(this, ...args); |
|
}; |
|
} |
|
function null_to_empty(value) { |
|
return value == null ? "" : value; |
|
} |
|
function set_store_value(store, ret, value) { |
|
store.set(value); |
|
return ret; |
|
} |
|
var has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); |
|
function action_destroyer(action_result) { |
|
return action_result && is_function(action_result.destroy) ? action_result.destroy : noop; |
|
} |
|
function split_css_unit(value) { |
|
const split = typeof value === "string" && value.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/); |
|
return split ? [parseFloat(split[1]), split[2] || "px"] : [ |
|
|
|
value, |
|
"px" |
|
]; |
|
} |
|
var contenteditable_truthy_values = ["", true, 1, "true", "contenteditable"]; |
|
|
|
|
|
var is_client = typeof window !== "undefined"; |
|
var now = is_client ? () => window.performance.now() : () => Date.now(); |
|
var raf = is_client ? (cb) => requestAnimationFrame(cb) : noop; |
|
function set_now(fn) { |
|
now = fn; |
|
} |
|
function set_raf(fn) { |
|
raf = fn; |
|
} |
|
|
|
|
|
var tasks = new Set(); |
|
function run_tasks(now2) { |
|
tasks.forEach((task) => { |
|
if (!task.c(now2)) { |
|
tasks.delete(task); |
|
task.f(); |
|
} |
|
}); |
|
if (tasks.size !== 0) raf(run_tasks); |
|
} |
|
function clear_loops() { |
|
tasks.clear(); |
|
} |
|
function loop(callback) { |
|
let task; |
|
if (tasks.size === 0) raf(run_tasks); |
|
return { |
|
promise: new Promise((fulfill) => { |
|
tasks.add(task = { c: callback, f: fulfill }); |
|
}), |
|
abort() { |
|
tasks.delete(task); |
|
} |
|
}; |
|
} |
|
|
|
|
|
var globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : ( |
|
|
|
global |
|
); |
|
|
|
|
|
var ResizeObserverSingleton = class _ResizeObserverSingleton { |
|
|
|
constructor(options) { |
|
|
|
|
|
|
|
|
|
|
|
__publicField(this, "_listeners", "WeakMap" in globals ? new WeakMap() : void 0); |
|
|
|
|
|
|
|
|
|
__publicField(this, "_observer"); |
|
|
|
__publicField(this, "options"); |
|
this.options = options; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
observe(element2, listener) { |
|
this._listeners.set(element2, listener); |
|
this._getObserver().observe(element2, this.options); |
|
return () => { |
|
this._listeners.delete(element2); |
|
this._observer.unobserve(element2); |
|
}; |
|
} |
|
|
|
|
|
|
|
_getObserver() { |
|
return this._observer ?? (this._observer = new ResizeObserver((entries) => { |
|
var _a; |
|
for (const entry of entries) { |
|
_ResizeObserverSingleton.entries.set(entry.target, entry); |
|
(_a = this._listeners.get(entry.target)) == null ? void 0 : _a(entry); |
|
} |
|
})); |
|
} |
|
}; |
|
ResizeObserverSingleton.entries = "WeakMap" in globals ? new WeakMap() : void 0; |
|
|
|
|
|
var is_hydrating = false; |
|
function start_hydrating() { |
|
is_hydrating = true; |
|
} |
|
function end_hydrating() { |
|
is_hydrating = false; |
|
} |
|
function upper_bound(low, high, key, value) { |
|
while (low < high) { |
|
const mid = low + (high - low >> 1); |
|
if (key(mid) <= value) { |
|
low = mid + 1; |
|
} else { |
|
high = mid; |
|
} |
|
} |
|
return low; |
|
} |
|
function init_hydrate(target) { |
|
if (target.hydrate_init) return; |
|
target.hydrate_init = true; |
|
let children2 = ( |
|
|
|
target.childNodes |
|
); |
|
if (target.nodeName === "HEAD") { |
|
const my_children = []; |
|
for (let i = 0; i < children2.length; i++) { |
|
const node = children2[i]; |
|
if (node.claim_order !== void 0) { |
|
my_children.push(node); |
|
} |
|
} |
|
children2 = my_children; |
|
} |
|
const m = new Int32Array(children2.length + 1); |
|
const p = new Int32Array(children2.length); |
|
m[0] = -1; |
|
let longest = 0; |
|
for (let i = 0; i < children2.length; i++) { |
|
const current = children2[i].claim_order; |
|
const seq_len = (longest > 0 && children2[m[longest]].claim_order <= current ? longest + 1 : upper_bound(1, longest, (idx) => children2[m[idx]].claim_order, current)) - 1; |
|
p[i] = m[seq_len] + 1; |
|
const new_len = seq_len + 1; |
|
m[new_len] = i; |
|
longest = Math.max(new_len, longest); |
|
} |
|
const lis = []; |
|
const to_move = []; |
|
let last = children2.length - 1; |
|
for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) { |
|
lis.push(children2[cur - 1]); |
|
for (; last >= cur; last--) { |
|
to_move.push(children2[last]); |
|
} |
|
last--; |
|
} |
|
for (; last >= 0; last--) { |
|
to_move.push(children2[last]); |
|
} |
|
lis.reverse(); |
|
to_move.sort((a, b) => a.claim_order - b.claim_order); |
|
for (let i = 0, j = 0; i < to_move.length; i++) { |
|
while (j < lis.length && to_move[i].claim_order >= lis[j].claim_order) { |
|
j++; |
|
} |
|
const anchor = j < lis.length ? lis[j] : null; |
|
target.insertBefore(to_move[i], anchor); |
|
} |
|
} |
|
function append(target, node) { |
|
target.appendChild(node); |
|
} |
|
function append_styles(target, style_sheet_id, styles) { |
|
const append_styles_to = get_root_for_style(target); |
|
if (!append_styles_to.getElementById(style_sheet_id)) { |
|
const style = element("style"); |
|
style.id = style_sheet_id; |
|
style.textContent = styles; |
|
append_stylesheet(append_styles_to, style); |
|
} |
|
} |
|
function get_root_for_style(node) { |
|
if (!node) return document; |
|
const root = node.getRootNode ? node.getRootNode() : node.ownerDocument; |
|
if (root && |
|
root.host) { |
|
return ( |
|
|
|
root |
|
); |
|
} |
|
return node.ownerDocument; |
|
} |
|
function append_empty_stylesheet(node) { |
|
const style_element = element("style"); |
|
style_element.textContent = "/* empty */"; |
|
append_stylesheet(get_root_for_style(node), style_element); |
|
return style_element.sheet; |
|
} |
|
function append_stylesheet(node, style) { |
|
append( |
|
|
|
node.head || node, |
|
style |
|
); |
|
return style.sheet; |
|
} |
|
function append_hydration(target, node) { |
|
if (is_hydrating) { |
|
init_hydrate(target); |
|
if (target.actual_end_child === void 0 || target.actual_end_child !== null && target.actual_end_child.parentNode !== target) { |
|
target.actual_end_child = target.firstChild; |
|
} |
|
while (target.actual_end_child !== null && target.actual_end_child.claim_order === void 0) { |
|
target.actual_end_child = target.actual_end_child.nextSibling; |
|
} |
|
if (node !== target.actual_end_child) { |
|
if (node.claim_order !== void 0 || node.parentNode !== target) { |
|
target.insertBefore(node, target.actual_end_child); |
|
} |
|
} else { |
|
target.actual_end_child = node.nextSibling; |
|
} |
|
} else if (node.parentNode !== target || node.nextSibling !== null) { |
|
target.appendChild(node); |
|
} |
|
} |
|
function insert(target, node, anchor) { |
|
target.insertBefore(node, anchor || null); |
|
} |
|
function insert_hydration(target, node, anchor) { |
|
if (is_hydrating && !anchor) { |
|
append_hydration(target, node); |
|
} else if (node.parentNode !== target || node.nextSibling != anchor) { |
|
target.insertBefore(node, anchor || null); |
|
} |
|
} |
|
function detach(node) { |
|
if (node.parentNode) { |
|
node.parentNode.removeChild(node); |
|
} |
|
} |
|
function destroy_each(iterations, detaching) { |
|
for (let i = 0; i < iterations.length; i += 1) { |
|
if (iterations[i]) iterations[i].d(detaching); |
|
} |
|
} |
|
function element(name) { |
|
return document.createElement(name); |
|
} |
|
function element_is(name, is) { |
|
return document.createElement(name, { is }); |
|
} |
|
function object_without_properties(obj, exclude) { |
|
const target = ( |
|
|
|
{} |
|
); |
|
for (const k in obj) { |
|
if (has_prop(obj, k) && |
|
exclude.indexOf(k) === -1) { |
|
target[k] = obj[k]; |
|
} |
|
} |
|
return target; |
|
} |
|
function svg_element(name) { |
|
return document.createElementNS("http://www.w3.org/2000/svg", name); |
|
} |
|
function text(data) { |
|
return document.createTextNode(data); |
|
} |
|
function space() { |
|
return text(" "); |
|
} |
|
function empty() { |
|
return text(""); |
|
} |
|
function comment(content) { |
|
return document.createComment(content); |
|
} |
|
function listen(node, event, handler, options) { |
|
node.addEventListener(event, handler, options); |
|
return () => node.removeEventListener(event, handler, options); |
|
} |
|
function prevent_default(fn) { |
|
return function(event) { |
|
event.preventDefault(); |
|
return fn.call(this, event); |
|
}; |
|
} |
|
function stop_propagation(fn) { |
|
return function(event) { |
|
event.stopPropagation(); |
|
return fn.call(this, event); |
|
}; |
|
} |
|
function stop_immediate_propagation(fn) { |
|
return function(event) { |
|
event.stopImmediatePropagation(); |
|
return fn.call(this, event); |
|
}; |
|
} |
|
function self(fn) { |
|
return function(event) { |
|
if (event.target === this) fn.call(this, event); |
|
}; |
|
} |
|
function trusted(fn) { |
|
return function(event) { |
|
if (event.isTrusted) fn.call(this, event); |
|
}; |
|
} |
|
function attr(node, attribute, value) { |
|
if (value == null) node.removeAttribute(attribute); |
|
else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value); |
|
} |
|
var always_set_through_set_attribute = ["width", "height"]; |
|
function set_attributes(node, attributes) { |
|
const descriptors = Object.getOwnPropertyDescriptors(node.__proto__); |
|
for (const key in attributes) { |
|
if (attributes[key] == null) { |
|
node.removeAttribute(key); |
|
} else if (key === "style") { |
|
node.style.cssText = attributes[key]; |
|
} else if (key === "__value") { |
|
node.value = node[key] = attributes[key]; |
|
} else if (descriptors[key] && descriptors[key].set && always_set_through_set_attribute.indexOf(key) === -1) { |
|
node[key] = attributes[key]; |
|
} else { |
|
attr(node, key, attributes[key]); |
|
} |
|
} |
|
} |
|
function set_svg_attributes(node, attributes) { |
|
for (const key in attributes) { |
|
attr(node, key, attributes[key]); |
|
} |
|
} |
|
function set_custom_element_data_map(node, data_map) { |
|
Object.keys(data_map).forEach((key) => { |
|
set_custom_element_data(node, key, data_map[key]); |
|
}); |
|
} |
|
function set_custom_element_data(node, prop, value) { |
|
const lower = prop.toLowerCase(); |
|
if (lower in node) { |
|
node[lower] = typeof node[lower] === "boolean" && value === "" ? true : value; |
|
} else if (prop in node) { |
|
node[prop] = typeof node[prop] === "boolean" && value === "" ? true : value; |
|
} else { |
|
attr(node, prop, value); |
|
} |
|
} |
|
function set_dynamic_element_data(tag) { |
|
return /-/.test(tag) ? set_custom_element_data_map : set_attributes; |
|
} |
|
function xlink_attr(node, attribute, value) { |
|
node.setAttributeNS("http://www.w3.org/1999/xlink", attribute, value); |
|
} |
|
function get_svelte_dataset(node) { |
|
return node.dataset.svelteH; |
|
} |
|
function get_binding_group_value(group, __value, checked) { |
|
const value = new Set(); |
|
for (let i = 0; i < group.length; i += 1) { |
|
if (group[i].checked) value.add(group[i].__value); |
|
} |
|
if (!checked) { |
|
value.delete(__value); |
|
} |
|
return Array.from(value); |
|
} |
|
function init_binding_group(group) { |
|
let _inputs; |
|
return { |
|
|
|
p(...inputs) { |
|
_inputs = inputs; |
|
_inputs.forEach((input) => group.push(input)); |
|
}, |
|
|
|
r() { |
|
_inputs.forEach((input) => group.splice(group.indexOf(input), 1)); |
|
} |
|
}; |
|
} |
|
function init_binding_group_dynamic(group, indexes) { |
|
let _group = get_binding_group(group); |
|
let _inputs; |
|
function get_binding_group(group2) { |
|
for (let i = 0; i < indexes.length; i++) { |
|
group2 = group2[indexes[i]] = group2[indexes[i]] || []; |
|
} |
|
return group2; |
|
} |
|
function push() { |
|
_inputs.forEach((input) => _group.push(input)); |
|
} |
|
function remove() { |
|
_inputs.forEach((input) => _group.splice(_group.indexOf(input), 1)); |
|
} |
|
return { |
|
|
|
u(new_indexes) { |
|
indexes = new_indexes; |
|
const new_group = get_binding_group(group); |
|
if (new_group !== _group) { |
|
remove(); |
|
_group = new_group; |
|
push(); |
|
} |
|
}, |
|
|
|
p(...inputs) { |
|
_inputs = inputs; |
|
push(); |
|
}, |
|
|
|
r: remove |
|
}; |
|
} |
|
function to_number(value) { |
|
return value === "" ? null : +value; |
|
} |
|
function time_ranges_to_array(ranges) { |
|
const array = []; |
|
for (let i = 0; i < ranges.length; i += 1) { |
|
array.push({ start: ranges.start(i), end: ranges.end(i) }); |
|
} |
|
return array; |
|
} |
|
function children(element2) { |
|
return Array.from(element2.childNodes); |
|
} |
|
function init_claim_info(nodes) { |
|
if (nodes.claim_info === void 0) { |
|
nodes.claim_info = { last_index: 0, total_claimed: 0 }; |
|
} |
|
} |
|
function claim_node(nodes, predicate, process_node, create_node, dont_update_last_index = false) { |
|
init_claim_info(nodes); |
|
const result_node = (() => { |
|
for (let i = nodes.claim_info.last_index; i < nodes.length; i++) { |
|
const node = nodes[i]; |
|
if (predicate(node)) { |
|
const replacement = process_node(node); |
|
if (replacement === void 0) { |
|
nodes.splice(i, 1); |
|
} else { |
|
nodes[i] = replacement; |
|
} |
|
if (!dont_update_last_index) { |
|
nodes.claim_info.last_index = i; |
|
} |
|
return node; |
|
} |
|
} |
|
for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) { |
|
const node = nodes[i]; |
|
if (predicate(node)) { |
|
const replacement = process_node(node); |
|
if (replacement === void 0) { |
|
nodes.splice(i, 1); |
|
} else { |
|
nodes[i] = replacement; |
|
} |
|
if (!dont_update_last_index) { |
|
nodes.claim_info.last_index = i; |
|
} else if (replacement === void 0) { |
|
nodes.claim_info.last_index--; |
|
} |
|
return node; |
|
} |
|
} |
|
return create_node(); |
|
})(); |
|
result_node.claim_order = nodes.claim_info.total_claimed; |
|
nodes.claim_info.total_claimed += 1; |
|
return result_node; |
|
} |
|
function claim_element_base(nodes, name, attributes, create_element) { |
|
return claim_node( |
|
nodes, |
|
|
|
(node) => node.nodeName === name, |
|
|
|
(node) => { |
|
const remove = []; |
|
for (let j = 0; j < node.attributes.length; j++) { |
|
const attribute = node.attributes[j]; |
|
if (!attributes[attribute.name]) { |
|
remove.push(attribute.name); |
|
} |
|
} |
|
remove.forEach((v) => node.removeAttribute(v)); |
|
return void 0; |
|
}, |
|
() => create_element(name) |
|
); |
|
} |
|
function claim_element(nodes, name, attributes) { |
|
return claim_element_base(nodes, name, attributes, element); |
|
} |
|
function claim_svg_element(nodes, name, attributes) { |
|
return claim_element_base(nodes, name, attributes, svg_element); |
|
} |
|
function claim_text(nodes, data) { |
|
return claim_node( |
|
nodes, |
|
|
|
(node) => node.nodeType === 3, |
|
|
|
(node) => { |
|
const data_str = "" + data; |
|
if (node.data.startsWith(data_str)) { |
|
if (node.data.length !== data_str.length) { |
|
return node.splitText(data_str.length); |
|
} |
|
} else { |
|
node.data = data_str; |
|
} |
|
}, |
|
() => text(data), |
|
true |
|
|
|
); |
|
} |
|
function claim_space(nodes) { |
|
return claim_text(nodes, " "); |
|
} |
|
function claim_comment(nodes, data) { |
|
return claim_node( |
|
nodes, |
|
|
|
(node) => node.nodeType === 8, |
|
|
|
(node) => { |
|
node.data = "" + data; |
|
return void 0; |
|
}, |
|
() => comment(data), |
|
true |
|
); |
|
} |
|
function get_comment_idx(nodes, text2, start) { |
|
for (let i = start; i < nodes.length; i += 1) { |
|
const node = nodes[i]; |
|
if (node.nodeType === 8 && node.textContent.trim() === text2) { |
|
return i; |
|
} |
|
} |
|
return -1; |
|
} |
|
function claim_html_tag(nodes, is_svg) { |
|
const start_index = get_comment_idx(nodes, "HTML_TAG_START", 0); |
|
const end_index = get_comment_idx(nodes, "HTML_TAG_END", start_index + 1); |
|
if (start_index === -1 || end_index === -1) { |
|
return new HtmlTagHydration(is_svg); |
|
} |
|
init_claim_info(nodes); |
|
const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1); |
|
detach(html_tag_nodes[0]); |
|
detach(html_tag_nodes[html_tag_nodes.length - 1]); |
|
const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1); |
|
if (claimed_nodes.length === 0) { |
|
return new HtmlTagHydration(is_svg); |
|
} |
|
for (const n of claimed_nodes) { |
|
n.claim_order = nodes.claim_info.total_claimed; |
|
nodes.claim_info.total_claimed += 1; |
|
} |
|
return new HtmlTagHydration(is_svg, claimed_nodes); |
|
} |
|
function set_data(text2, data) { |
|
data = "" + data; |
|
if (text2.data === data) return; |
|
text2.data = |
|
data; |
|
} |
|
function set_data_contenteditable(text2, data) { |
|
data = "" + data; |
|
if (text2.wholeText === data) return; |
|
text2.data = |
|
data; |
|
} |
|
function set_data_maybe_contenteditable(text2, data, attr_value) { |
|
if (~contenteditable_truthy_values.indexOf(attr_value)) { |
|
set_data_contenteditable(text2, data); |
|
} else { |
|
set_data(text2, data); |
|
} |
|
} |
|
function set_input_value(input, value) { |
|
input.value = value == null ? "" : value; |
|
} |
|
function set_input_type(input, type) { |
|
try { |
|
input.type = type; |
|
} catch (e) { |
|
} |
|
} |
|
function set_style(node, key, value, important) { |
|
if (value == null) { |
|
node.style.removeProperty(key); |
|
} else { |
|
node.style.setProperty(key, value, important ? "important" : ""); |
|
} |
|
} |
|
function select_option(select, value, mounting) { |
|
for (let i = 0; i < select.options.length; i += 1) { |
|
const option = select.options[i]; |
|
if (option.__value === value) { |
|
option.selected = true; |
|
return; |
|
} |
|
} |
|
if (!mounting || value !== void 0) { |
|
select.selectedIndex = -1; |
|
} |
|
} |
|
function select_options(select, value) { |
|
for (let i = 0; i < select.options.length; i += 1) { |
|
const option = select.options[i]; |
|
option.selected = ~value.indexOf(option.__value); |
|
} |
|
} |
|
function select_value(select) { |
|
const selected_option = select.querySelector(":checked"); |
|
return selected_option && selected_option.__value; |
|
} |
|
function select_multiple_value(select) { |
|
return [].map.call(select.querySelectorAll(":checked"), (option) => option.__value); |
|
} |
|
var crossorigin; |
|
function is_crossorigin() { |
|
if (crossorigin === void 0) { |
|
crossorigin = false; |
|
try { |
|
if (typeof window !== "undefined" && window.parent) { |
|
void window.parent.document; |
|
} |
|
} catch (error) { |
|
crossorigin = true; |
|
} |
|
} |
|
return crossorigin; |
|
} |
|
function add_iframe_resize_listener(node, fn) { |
|
const computed_style = getComputedStyle(node); |
|
if (computed_style.position === "static") { |
|
node.style.position = "relative"; |
|
} |
|
const iframe = element("iframe"); |
|
iframe.setAttribute( |
|
"style", |
|
"display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;" |
|
); |
|
iframe.setAttribute("aria-hidden", "true"); |
|
iframe.tabIndex = -1; |
|
const crossorigin2 = is_crossorigin(); |
|
let unsubscribe; |
|
if (crossorigin2) { |
|
iframe.src = "data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>"; |
|
unsubscribe = listen( |
|
window, |
|
"message", |
|
|
|
(event) => { |
|
if (event.source === iframe.contentWindow) fn(); |
|
} |
|
); |
|
} else { |
|
iframe.src = "about:blank"; |
|
iframe.onload = () => { |
|
unsubscribe = listen(iframe.contentWindow, "resize", fn); |
|
fn(); |
|
}; |
|
} |
|
append(node, iframe); |
|
return () => { |
|
if (crossorigin2) { |
|
unsubscribe(); |
|
} else if (unsubscribe && iframe.contentWindow) { |
|
unsubscribe(); |
|
} |
|
detach(iframe); |
|
}; |
|
} |
|
var resize_observer_content_box = new ResizeObserverSingleton({ |
|
box: "content-box" |
|
}); |
|
var resize_observer_border_box = new ResizeObserverSingleton({ |
|
box: "border-box" |
|
}); |
|
var resize_observer_device_pixel_content_box = new ResizeObserverSingleton( |
|
{ box: "device-pixel-content-box" } |
|
); |
|
function toggle_class(element2, name, toggle) { |
|
element2.classList.toggle(name, !!toggle); |
|
} |
|
function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) { |
|
return new CustomEvent(type, { detail, bubbles, cancelable }); |
|
} |
|
function query_selector_all(selector, parent = document.body) { |
|
return Array.from(parent.querySelectorAll(selector)); |
|
} |
|
function head_selector(nodeId, head) { |
|
const result = []; |
|
let started = 0; |
|
for (const node of head.childNodes) { |
|
if (node.nodeType === 8) { |
|
const comment2 = node.textContent.trim(); |
|
if (comment2 === `HEAD_${nodeId}_END`) { |
|
started -= 1; |
|
result.push(node); |
|
} else if (comment2 === `HEAD_${nodeId}_START`) { |
|
started += 1; |
|
result.push(node); |
|
} |
|
} else if (started > 0) { |
|
result.push(node); |
|
} |
|
} |
|
return result; |
|
} |
|
var HtmlTag = class { |
|
constructor(is_svg = false) { |
|
|
|
|
|
|
|
|
|
__publicField(this, "is_svg", false); |
|
|
|
__publicField(this, "e"); |
|
|
|
__publicField(this, "n"); |
|
|
|
__publicField(this, "t"); |
|
|
|
__publicField(this, "a"); |
|
this.is_svg = is_svg; |
|
this.e = this.n = null; |
|
} |
|
|
|
|
|
|
|
|
|
c(html) { |
|
this.h(html); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
m(html, target, anchor = null) { |
|
if (!this.e) { |
|
if (this.is_svg) |
|
this.e = svg_element( |
|
|
|
target.nodeName |
|
); |
|
else |
|
this.e = element( |
|
|
|
target.nodeType === 11 ? "TEMPLATE" : target.nodeName |
|
); |
|
this.t = target.tagName !== "TEMPLATE" ? target : ( |
|
|
|
target.content |
|
); |
|
this.c(html); |
|
} |
|
this.i(anchor); |
|
} |
|
|
|
|
|
|
|
|
|
h(html) { |
|
this.e.innerHTML = html; |
|
this.n = Array.from( |
|
this.e.nodeName === "TEMPLATE" ? this.e.content.childNodes : this.e.childNodes |
|
); |
|
} |
|
|
|
|
|
i(anchor) { |
|
for (let i = 0; i < this.n.length; i += 1) { |
|
insert(this.t, this.n[i], anchor); |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
p(html) { |
|
this.d(); |
|
this.h(html); |
|
this.i(this.a); |
|
} |
|
|
|
|
|
d() { |
|
this.n.forEach(detach); |
|
} |
|
}; |
|
var HtmlTagHydration = class extends HtmlTag { |
|
constructor(is_svg = false, claimed_nodes) { |
|
super(is_svg); |
|
|
|
__publicField(this, "l"); |
|
this.e = this.n = null; |
|
this.l = claimed_nodes; |
|
} |
|
|
|
|
|
|
|
|
|
c(html) { |
|
if (this.l) { |
|
this.n = this.l; |
|
} else { |
|
super.c(html); |
|
} |
|
} |
|
|
|
|
|
i(anchor) { |
|
for (let i = 0; i < this.n.length; i += 1) { |
|
insert_hydration(this.t, this.n[i], anchor); |
|
} |
|
} |
|
}; |
|
function attribute_to_object(attributes) { |
|
const result = {}; |
|
for (const attribute of attributes) { |
|
result[attribute.name] = attribute.value; |
|
} |
|
return result; |
|
} |
|
var escaped = { |
|
'"': """, |
|
"&": "&", |
|
"<": "<" |
|
}; |
|
var regex_attribute_characters_to_escape = /["&<]/g; |
|
function escape_attribute(attribute) { |
|
return String(attribute).replace(regex_attribute_characters_to_escape, (match) => escaped[match]); |
|
} |
|
function stringify_spread(attributes) { |
|
let str = " "; |
|
for (const key in attributes) { |
|
if (attributes[key] != null) { |
|
str += `${key}="${escape_attribute(attributes[key])}" `; |
|
} |
|
} |
|
return str; |
|
} |
|
function get_custom_elements_slots(element2) { |
|
const result = {}; |
|
element2.childNodes.forEach( |
|
|
|
(node) => { |
|
result[node.slot || "default"] = true; |
|
} |
|
); |
|
return result; |
|
} |
|
function construct_svelte_component(component, props) { |
|
return new component(props); |
|
} |
|
|
|
|
|
var managed_styles = new Map(); |
|
var active = 0; |
|
function hash(str) { |
|
let hash2 = 5381; |
|
let i = str.length; |
|
while (i--) hash2 = (hash2 << 5) - hash2 ^ str.charCodeAt(i); |
|
return hash2 >>> 0; |
|
} |
|
function create_style_information(doc, node) { |
|
const info = { stylesheet: append_empty_stylesheet(node), rules: {} }; |
|
managed_styles.set(doc, info); |
|
return info; |
|
} |
|
function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) { |
|
const step = 16.666 / duration; |
|
let keyframes = "{\n"; |
|
for (let p = 0; p <= 1; p += step) { |
|
const t = a + (b - a) * ease(p); |
|
keyframes += p * 100 + `%{${fn(t, 1 - t)}} |
|
`; |
|
} |
|
const rule = keyframes + `100% {${fn(b, 1 - b)}} |
|
}`; |
|
const name = `__svelte_${hash(rule)}_${uid}`; |
|
const doc = get_root_for_style(node); |
|
const { stylesheet, rules } = managed_styles.get(doc) || create_style_information(doc, node); |
|
if (!rules[name]) { |
|
rules[name] = true; |
|
stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length); |
|
} |
|
const animation = node.style.animation || ""; |
|
node.style.animation = `${animation ? `${animation}, ` : ""}${name} ${duration}ms linear ${delay}ms 1 both`; |
|
active += 1; |
|
return name; |
|
} |
|
function delete_rule(node, name) { |
|
const previous = (node.style.animation || "").split(", "); |
|
const next = previous.filter( |
|
name ? (anim) => anim.indexOf(name) < 0 : (anim) => anim.indexOf("__svelte") === -1 |
|
|
|
); |
|
const deleted = previous.length - next.length; |
|
if (deleted) { |
|
node.style.animation = next.join(", "); |
|
active -= deleted; |
|
if (!active) clear_rules(); |
|
} |
|
} |
|
function clear_rules() { |
|
raf(() => { |
|
if (active) return; |
|
managed_styles.forEach((info) => { |
|
const { ownerNode } = info.stylesheet; |
|
if (ownerNode) detach(ownerNode); |
|
}); |
|
managed_styles.clear(); |
|
}); |
|
} |
|
|
|
|
|
function create_animation(node, from, fn, params) { |
|
if (!from) return noop; |
|
const to = node.getBoundingClientRect(); |
|
if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom) |
|
return noop; |
|
const { |
|
delay = 0, |
|
duration = 300, |
|
easing = identity, |
|
|
|
start: start_time = now() + delay, |
|
|
|
end = start_time + duration, |
|
tick: tick2 = noop, |
|
css |
|
} = fn(node, { from, to }, params); |
|
let running = true; |
|
let started = false; |
|
let name; |
|
function start() { |
|
if (css) { |
|
name = create_rule(node, 0, 1, duration, delay, easing, css); |
|
} |
|
if (!delay) { |
|
started = true; |
|
} |
|
} |
|
function stop() { |
|
if (css) delete_rule(node, name); |
|
running = false; |
|
} |
|
loop((now2) => { |
|
if (!started && now2 >= start_time) { |
|
started = true; |
|
} |
|
if (started && now2 >= end) { |
|
tick2(1, 0); |
|
stop(); |
|
} |
|
if (!running) { |
|
return false; |
|
} |
|
if (started) { |
|
const p = now2 - start_time; |
|
const t = 0 + 1 * easing(p / duration); |
|
tick2(t, 1 - t); |
|
} |
|
return true; |
|
}); |
|
start(); |
|
tick2(0, 1); |
|
return stop; |
|
} |
|
function fix_position(node) { |
|
const style = getComputedStyle(node); |
|
if (style.position !== "absolute" && style.position !== "fixed") { |
|
const { width, height } = style; |
|
const a = node.getBoundingClientRect(); |
|
node.style.position = "absolute"; |
|
node.style.width = width; |
|
node.style.height = height; |
|
add_transform(node, a); |
|
} |
|
} |
|
function add_transform(node, a) { |
|
const b = node.getBoundingClientRect(); |
|
if (a.left !== b.left || a.top !== b.top) { |
|
const style = getComputedStyle(node); |
|
const transform = style.transform === "none" ? "" : style.transform; |
|
node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`; |
|
} |
|
} |
|
|
|
|
|
var current_component; |
|
function set_current_component(component) { |
|
current_component = component; |
|
} |
|
function get_current_component() { |
|
if (!current_component) throw new Error("Function called outside component initialization"); |
|
return current_component; |
|
} |
|
function beforeUpdate(fn) { |
|
get_current_component().$$.before_update.push(fn); |
|
} |
|
function onMount(fn) { |
|
get_current_component().$$.on_mount.push(fn); |
|
} |
|
function afterUpdate(fn) { |
|
get_current_component().$$.after_update.push(fn); |
|
} |
|
function onDestroy(fn) { |
|
get_current_component().$$.on_destroy.push(fn); |
|
} |
|
function createEventDispatcher() { |
|
const component = get_current_component(); |
|
return (type, detail, { cancelable = false } = {}) => { |
|
const callbacks = component.$$.callbacks[type]; |
|
if (callbacks) { |
|
const event = custom_event( |
|
|
|
type, |
|
detail, |
|
{ cancelable } |
|
); |
|
callbacks.slice().forEach((fn) => { |
|
fn.call(component, event); |
|
}); |
|
return !event.defaultPrevented; |
|
} |
|
return true; |
|
}; |
|
} |
|
function setContext(key, context) { |
|
get_current_component().$$.context.set(key, context); |
|
return context; |
|
} |
|
function getContext(key) { |
|
return get_current_component().$$.context.get(key); |
|
} |
|
function getAllContexts() { |
|
return get_current_component().$$.context; |
|
} |
|
function hasContext(key) { |
|
return get_current_component().$$.context.has(key); |
|
} |
|
function bubble(component, event) { |
|
const callbacks = component.$$.callbacks[event.type]; |
|
if (callbacks) { |
|
callbacks.slice().forEach((fn) => fn.call(this, event)); |
|
} |
|
} |
|
|
|
|
|
var dirty_components = []; |
|
var intros = { enabled: false }; |
|
var binding_callbacks = []; |
|
var render_callbacks = []; |
|
var flush_callbacks = []; |
|
var resolved_promise = Promise.resolve(); |
|
var update_scheduled = false; |
|
function schedule_update() { |
|
if (!update_scheduled) { |
|
update_scheduled = true; |
|
resolved_promise.then(flush); |
|
} |
|
} |
|
function tick() { |
|
schedule_update(); |
|
return resolved_promise; |
|
} |
|
function add_render_callback(fn) { |
|
render_callbacks.push(fn); |
|
} |
|
function add_flush_callback(fn) { |
|
flush_callbacks.push(fn); |
|
} |
|
var seen_callbacks = new Set(); |
|
var flushidx = 0; |
|
function flush() { |
|
if (flushidx !== 0) { |
|
return; |
|
} |
|
const saved_component = current_component; |
|
do { |
|
try { |
|
while (flushidx < dirty_components.length) { |
|
const component = dirty_components[flushidx]; |
|
flushidx++; |
|
set_current_component(component); |
|
update(component.$$); |
|
} |
|
} catch (e) { |
|
dirty_components.length = 0; |
|
flushidx = 0; |
|
throw e; |
|
} |
|
set_current_component(null); |
|
dirty_components.length = 0; |
|
flushidx = 0; |
|
while (binding_callbacks.length) binding_callbacks.pop()(); |
|
for (let i = 0; i < render_callbacks.length; i += 1) { |
|
const callback = render_callbacks[i]; |
|
if (!seen_callbacks.has(callback)) { |
|
seen_callbacks.add(callback); |
|
callback(); |
|
} |
|
} |
|
render_callbacks.length = 0; |
|
} while (dirty_components.length); |
|
while (flush_callbacks.length) { |
|
flush_callbacks.pop()(); |
|
} |
|
update_scheduled = false; |
|
seen_callbacks.clear(); |
|
set_current_component(saved_component); |
|
} |
|
function update($$) { |
|
if ($$.fragment !== null) { |
|
$$.update(); |
|
run_all($$.before_update); |
|
const dirty = $$.dirty; |
|
$$.dirty = [-1]; |
|
$$.fragment && $$.fragment.p($$.ctx, dirty); |
|
$$.after_update.forEach(add_render_callback); |
|
} |
|
} |
|
function flush_render_callbacks(fns) { |
|
const filtered = []; |
|
const targets = []; |
|
render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c)); |
|
targets.forEach((c) => c()); |
|
render_callbacks = filtered; |
|
} |
|
|
|
|
|
var promise; |
|
function wait() { |
|
if (!promise) { |
|
promise = Promise.resolve(); |
|
promise.then(() => { |
|
promise = null; |
|
}); |
|
} |
|
return promise; |
|
} |
|
function dispatch(node, direction, kind) { |
|
node.dispatchEvent(custom_event(`${direction ? "intro" : "outro"}${kind}`)); |
|
} |
|
var outroing = new Set(); |
|
var outros; |
|
function group_outros() { |
|
outros = { |
|
r: 0, |
|
c: [], |
|
p: outros |
|
|
|
}; |
|
} |
|
function check_outros() { |
|
if (!outros.r) { |
|
run_all(outros.c); |
|
} |
|
outros = outros.p; |
|
} |
|
function transition_in(block, local) { |
|
if (block && block.i) { |
|
outroing.delete(block); |
|
block.i(local); |
|
} |
|
} |
|
function transition_out(block, local, detach2, callback) { |
|
if (block && block.o) { |
|
if (outroing.has(block)) return; |
|
outroing.add(block); |
|
outros.c.push(() => { |
|
outroing.delete(block); |
|
if (callback) { |
|
if (detach2) block.d(1); |
|
callback(); |
|
} |
|
}); |
|
block.o(local); |
|
} else if (callback) { |
|
callback(); |
|
} |
|
} |
|
var null_transition = { duration: 0 }; |
|
function create_in_transition(node, fn, params) { |
|
const options = { direction: "in" }; |
|
let config = fn(node, params, options); |
|
let running = false; |
|
let animation_name; |
|
let task; |
|
let uid = 0; |
|
function cleanup() { |
|
if (animation_name) delete_rule(node, animation_name); |
|
} |
|
function go() { |
|
const { |
|
delay = 0, |
|
duration = 300, |
|
easing = identity, |
|
tick: tick2 = noop, |
|
css |
|
} = config || null_transition; |
|
if (css) animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++); |
|
tick2(0, 1); |
|
const start_time = now() + delay; |
|
const end_time = start_time + duration; |
|
if (task) task.abort(); |
|
running = true; |
|
add_render_callback(() => dispatch(node, true, "start")); |
|
task = loop((now2) => { |
|
if (running) { |
|
if (now2 >= end_time) { |
|
tick2(1, 0); |
|
dispatch(node, true, "end"); |
|
cleanup(); |
|
return running = false; |
|
} |
|
if (now2 >= start_time) { |
|
const t = easing((now2 - start_time) / duration); |
|
tick2(t, 1 - t); |
|
} |
|
} |
|
return running; |
|
}); |
|
} |
|
let started = false; |
|
return { |
|
start() { |
|
if (started) return; |
|
started = true; |
|
delete_rule(node); |
|
if (is_function(config)) { |
|
config = config(options); |
|
wait().then(go); |
|
} else { |
|
go(); |
|
} |
|
}, |
|
invalidate() { |
|
started = false; |
|
}, |
|
end() { |
|
if (running) { |
|
cleanup(); |
|
running = false; |
|
} |
|
} |
|
}; |
|
} |
|
function create_out_transition(node, fn, params) { |
|
const options = { direction: "out" }; |
|
let config = fn(node, params, options); |
|
let running = true; |
|
let animation_name; |
|
const group = outros; |
|
group.r += 1; |
|
let original_inert_value; |
|
function go() { |
|
const { |
|
delay = 0, |
|
duration = 300, |
|
easing = identity, |
|
tick: tick2 = noop, |
|
css |
|
} = config || null_transition; |
|
if (css) animation_name = create_rule(node, 1, 0, duration, delay, easing, css); |
|
const start_time = now() + delay; |
|
const end_time = start_time + duration; |
|
add_render_callback(() => dispatch(node, false, "start")); |
|
if ("inert" in node) { |
|
original_inert_value = |
|
node.inert; |
|
node.inert = true; |
|
} |
|
loop((now2) => { |
|
if (running) { |
|
if (now2 >= end_time) { |
|
tick2(0, 1); |
|
dispatch(node, false, "end"); |
|
if (!--group.r) { |
|
run_all(group.c); |
|
} |
|
return false; |
|
} |
|
if (now2 >= start_time) { |
|
const t = easing((now2 - start_time) / duration); |
|
tick2(1 - t, t); |
|
} |
|
} |
|
return running; |
|
}); |
|
} |
|
if (is_function(config)) { |
|
wait().then(() => { |
|
config = config(options); |
|
go(); |
|
}); |
|
} else { |
|
go(); |
|
} |
|
return { |
|
end(reset) { |
|
if (reset && "inert" in node) { |
|
node.inert = original_inert_value; |
|
} |
|
if (reset && config.tick) { |
|
config.tick(1, 0); |
|
} |
|
if (running) { |
|
if (animation_name) delete_rule(node, animation_name); |
|
running = false; |
|
} |
|
} |
|
}; |
|
} |
|
function create_bidirectional_transition(node, fn, params, intro) { |
|
const options = { direction: "both" }; |
|
let config = fn(node, params, options); |
|
let t = intro ? 0 : 1; |
|
let running_program = null; |
|
let pending_program = null; |
|
let animation_name = null; |
|
let original_inert_value; |
|
function clear_animation() { |
|
if (animation_name) delete_rule(node, animation_name); |
|
} |
|
function init2(program, duration) { |
|
const d = ( |
|
|
|
program.b - t |
|
); |
|
duration *= Math.abs(d); |
|
return { |
|
a: t, |
|
b: program.b, |
|
d, |
|
duration, |
|
start: program.start, |
|
end: program.start + duration, |
|
group: program.group |
|
}; |
|
} |
|
function go(b) { |
|
const { |
|
delay = 0, |
|
duration = 300, |
|
easing = identity, |
|
tick: tick2 = noop, |
|
css |
|
} = config || null_transition; |
|
const program = { |
|
start: now() + delay, |
|
b |
|
}; |
|
if (!b) { |
|
program.group = outros; |
|
outros.r += 1; |
|
} |
|
if ("inert" in node) { |
|
if (b) { |
|
if (original_inert_value !== void 0) { |
|
node.inert = original_inert_value; |
|
} |
|
} else { |
|
original_inert_value = |
|
node.inert; |
|
node.inert = true; |
|
} |
|
} |
|
if (running_program || pending_program) { |
|
pending_program = program; |
|
} else { |
|
if (css) { |
|
clear_animation(); |
|
animation_name = create_rule(node, t, b, duration, delay, easing, css); |
|
} |
|
if (b) tick2(0, 1); |
|
running_program = init2(program, duration); |
|
add_render_callback(() => dispatch(node, b, "start")); |
|
loop((now2) => { |
|
if (pending_program && now2 > pending_program.start) { |
|
running_program = init2(pending_program, duration); |
|
pending_program = null; |
|
dispatch(node, running_program.b, "start"); |
|
if (css) { |
|
clear_animation(); |
|
animation_name = create_rule( |
|
node, |
|
t, |
|
running_program.b, |
|
running_program.duration, |
|
0, |
|
easing, |
|
config.css |
|
); |
|
} |
|
} |
|
if (running_program) { |
|
if (now2 >= running_program.end) { |
|
tick2(t = running_program.b, 1 - t); |
|
dispatch(node, running_program.b, "end"); |
|
if (!pending_program) { |
|
if (running_program.b) { |
|
clear_animation(); |
|
} else { |
|
if (!--running_program.group.r) run_all(running_program.group.c); |
|
} |
|
} |
|
running_program = null; |
|
} else if (now2 >= running_program.start) { |
|
const p = now2 - running_program.start; |
|
t = running_program.a + running_program.d * easing(p / running_program.duration); |
|
tick2(t, 1 - t); |
|
} |
|
} |
|
return !!(running_program || pending_program); |
|
}); |
|
} |
|
} |
|
return { |
|
run(b) { |
|
if (is_function(config)) { |
|
wait().then(() => { |
|
const opts = { direction: b ? "in" : "out" }; |
|
config = config(opts); |
|
go(b); |
|
}); |
|
} else { |
|
go(b); |
|
} |
|
}, |
|
end() { |
|
clear_animation(); |
|
running_program = pending_program = null; |
|
} |
|
}; |
|
} |
|
|
|
|
|
function handle_promise(promise2, info) { |
|
const token = info.token = {}; |
|
function update2(type, index, key, value) { |
|
if (info.token !== token) return; |
|
info.resolved = value; |
|
let child_ctx = info.ctx; |
|
if (key !== void 0) { |
|
child_ctx = child_ctx.slice(); |
|
child_ctx[key] = value; |
|
} |
|
const block = type && (info.current = type)(child_ctx); |
|
let needs_flush = false; |
|
if (info.block) { |
|
if (info.blocks) { |
|
info.blocks.forEach((block2, i) => { |
|
if (i !== index && block2) { |
|
group_outros(); |
|
transition_out(block2, 1, 1, () => { |
|
if (info.blocks[i] === block2) { |
|
info.blocks[i] = null; |
|
} |
|
}); |
|
check_outros(); |
|
} |
|
}); |
|
} else { |
|
info.block.d(1); |
|
} |
|
block.c(); |
|
transition_in(block, 1); |
|
block.m(info.mount(), info.anchor); |
|
needs_flush = true; |
|
} |
|
info.block = block; |
|
if (info.blocks) info.blocks[index] = block; |
|
if (needs_flush) { |
|
flush(); |
|
} |
|
} |
|
if (is_promise(promise2)) { |
|
const current_component2 = get_current_component(); |
|
promise2.then( |
|
(value) => { |
|
set_current_component(current_component2); |
|
update2(info.then, 1, info.value, value); |
|
set_current_component(null); |
|
}, |
|
(error) => { |
|
set_current_component(current_component2); |
|
update2(info.catch, 2, info.error, error); |
|
set_current_component(null); |
|
if (!info.hasCatch) { |
|
throw error; |
|
} |
|
} |
|
); |
|
if (info.current !== info.pending) { |
|
update2(info.pending, 0); |
|
return true; |
|
} |
|
} else { |
|
if (info.current !== info.then) { |
|
update2(info.then, 1, info.value, promise2); |
|
return true; |
|
} |
|
info.resolved = |
|
promise2; |
|
} |
|
} |
|
function update_await_block_branch(info, ctx, dirty) { |
|
const child_ctx = ctx.slice(); |
|
const { resolved } = info; |
|
if (info.current === info.then) { |
|
child_ctx[info.value] = resolved; |
|
} |
|
if (info.current === info.catch) { |
|
child_ctx[info.error] = resolved; |
|
} |
|
info.block.p(child_ctx, dirty); |
|
} |
|
|
|
|
|
function ensure_array_like(array_like_or_iterator) { |
|
return (array_like_or_iterator == null ? void 0 : array_like_or_iterator.length) !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator); |
|
} |
|
function destroy_block(block, lookup) { |
|
block.d(1); |
|
lookup.delete(block.key); |
|
} |
|
function outro_and_destroy_block(block, lookup) { |
|
transition_out(block, 1, 1, () => { |
|
lookup.delete(block.key); |
|
}); |
|
} |
|
function fix_and_destroy_block(block, lookup) { |
|
block.f(); |
|
destroy_block(block, lookup); |
|
} |
|
function fix_and_outro_and_destroy_block(block, lookup) { |
|
block.f(); |
|
outro_and_destroy_block(block, lookup); |
|
} |
|
function update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) { |
|
let o = old_blocks.length; |
|
let n = list.length; |
|
let i = o; |
|
const old_indexes = {}; |
|
while (i--) old_indexes[old_blocks[i].key] = i; |
|
const new_blocks = []; |
|
const new_lookup = new Map(); |
|
const deltas = new Map(); |
|
const updates = []; |
|
i = n; |
|
while (i--) { |
|
const child_ctx = get_context(ctx, list, i); |
|
const key = get_key(child_ctx); |
|
let block = lookup.get(key); |
|
if (!block) { |
|
block = create_each_block(key, child_ctx); |
|
block.c(); |
|
} else if (dynamic) { |
|
updates.push(() => block.p(child_ctx, dirty)); |
|
} |
|
new_lookup.set(key, new_blocks[i] = block); |
|
if (key in old_indexes) deltas.set(key, Math.abs(i - old_indexes[key])); |
|
} |
|
const will_move = new Set(); |
|
const did_move = new Set(); |
|
function insert2(block) { |
|
transition_in(block, 1); |
|
block.m(node, next); |
|
lookup.set(block.key, block); |
|
next = block.first; |
|
n--; |
|
} |
|
while (o && n) { |
|
const new_block = new_blocks[n - 1]; |
|
const old_block = old_blocks[o - 1]; |
|
const new_key = new_block.key; |
|
const old_key = old_block.key; |
|
if (new_block === old_block) { |
|
next = new_block.first; |
|
o--; |
|
n--; |
|
} else if (!new_lookup.has(old_key)) { |
|
destroy(old_block, lookup); |
|
o--; |
|
} else if (!lookup.has(new_key) || will_move.has(new_key)) { |
|
insert2(new_block); |
|
} else if (did_move.has(old_key)) { |
|
o--; |
|
} else if (deltas.get(new_key) > deltas.get(old_key)) { |
|
did_move.add(new_key); |
|
insert2(new_block); |
|
} else { |
|
will_move.add(old_key); |
|
o--; |
|
} |
|
} |
|
while (o--) { |
|
const old_block = old_blocks[o]; |
|
if (!new_lookup.has(old_block.key)) destroy(old_block, lookup); |
|
} |
|
while (n) insert2(new_blocks[n - 1]); |
|
run_all(updates); |
|
return new_blocks; |
|
} |
|
function validate_each_keys(ctx, list, get_context, get_key) { |
|
const keys = new Map(); |
|
for (let i = 0; i < list.length; i++) { |
|
const key = get_key(get_context(ctx, list, i)); |
|
if (keys.has(key)) { |
|
let value = ""; |
|
try { |
|
value = `with value '${String(key)}' `; |
|
} catch (e) { |
|
} |
|
throw new Error( |
|
`Cannot have duplicate keys in a keyed each: Keys at index ${keys.get( |
|
key |
|
)} and ${i} ${value}are duplicates` |
|
); |
|
} |
|
keys.set(key, i); |
|
} |
|
} |
|
|
|
|
|
function get_spread_update(levels, updates) { |
|
const update2 = {}; |
|
const to_null_out = {}; |
|
const accounted_for = { $$scope: 1 }; |
|
let i = levels.length; |
|
while (i--) { |
|
const o = levels[i]; |
|
const n = updates[i]; |
|
if (n) { |
|
for (const key in o) { |
|
if (!(key in n)) to_null_out[key] = 1; |
|
} |
|
for (const key in n) { |
|
if (!accounted_for[key]) { |
|
update2[key] = n[key]; |
|
accounted_for[key] = 1; |
|
} |
|
} |
|
levels[i] = n; |
|
} else { |
|
for (const key in o) { |
|
accounted_for[key] = 1; |
|
} |
|
} |
|
} |
|
for (const key in to_null_out) { |
|
if (!(key in update2)) update2[key] = void 0; |
|
} |
|
return update2; |
|
} |
|
function get_spread_object(spread_props) { |
|
return typeof spread_props === "object" && spread_props !== null ? spread_props : {}; |
|
} |
|
|
|
|
|
var _boolean_attributes = ( |
|
|
|
[ |
|
"allowfullscreen", |
|
"allowpaymentrequest", |
|
"async", |
|
"autofocus", |
|
"autoplay", |
|
"checked", |
|
"controls", |
|
"default", |
|
"defer", |
|
"disabled", |
|
"formnovalidate", |
|
"hidden", |
|
"inert", |
|
"ismap", |
|
"loop", |
|
"multiple", |
|
"muted", |
|
"nomodule", |
|
"novalidate", |
|
"open", |
|
"playsinline", |
|
"readonly", |
|
"required", |
|
"reversed", |
|
"selected" |
|
] |
|
); |
|
var boolean_attributes = new Set([..._boolean_attributes]); |
|
|
|
|
|
var ATTR_REGEX = /[&"<]/g; |
|
var CONTENT_REGEX = /[&<]/g; |
|
function escape(value, is_attr = false) { |
|
const str = String(value); |
|
const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX; |
|
pattern.lastIndex = 0; |
|
let escaped2 = ""; |
|
let last = 0; |
|
while (pattern.test(str)) { |
|
const i = pattern.lastIndex - 1; |
|
const ch = str[i]; |
|
escaped2 += str.substring(last, i) + (ch === "&" ? "&" : ch === '"' ? """ : "<"); |
|
last = i + 1; |
|
} |
|
return escaped2 + str.substring(last); |
|
} |
|
|
|
|
|
var void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/; |
|
function is_void(name) { |
|
return void_element_names.test(name) || name.toLowerCase() === "!doctype"; |
|
} |
|
|
|
|
|
var invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u; |
|
function spread(args, attrs_to_add) { |
|
const attributes = Object.assign({}, ...args); |
|
if (attrs_to_add) { |
|
const classes_to_add = attrs_to_add.classes; |
|
const styles_to_add = attrs_to_add.styles; |
|
if (classes_to_add) { |
|
if (attributes.class == null) { |
|
attributes.class = classes_to_add; |
|
} else { |
|
attributes.class += " " + classes_to_add; |
|
} |
|
} |
|
if (styles_to_add) { |
|
if (attributes.style == null) { |
|
attributes.style = style_object_to_string(styles_to_add); |
|
} else { |
|
attributes.style = style_object_to_string( |
|
merge_ssr_styles(attributes.style, styles_to_add) |
|
); |
|
} |
|
} |
|
} |
|
let str = ""; |
|
Object.keys(attributes).forEach((name) => { |
|
if (invalid_attribute_name_character.test(name)) return; |
|
const value = attributes[name]; |
|
if (value === true) str += " " + name; |
|
else if (boolean_attributes.has(name.toLowerCase())) { |
|
if (value) str += " " + name; |
|
} else if (value != null) { |
|
str += ` ${name}="${value}"`; |
|
} |
|
}); |
|
return str; |
|
} |
|
function merge_ssr_styles(style_attribute, style_directive) { |
|
const style_object = {}; |
|
for (const individual_style of style_attribute.split(";")) { |
|
const colon_index = individual_style.indexOf(":"); |
|
const name = individual_style.slice(0, colon_index).trim(); |
|
const value = individual_style.slice(colon_index + 1).trim(); |
|
if (!name) continue; |
|
style_object[name] = value; |
|
} |
|
for (const name in style_directive) { |
|
const value = style_directive[name]; |
|
if (value) { |
|
style_object[name] = value; |
|
} else { |
|
delete style_object[name]; |
|
} |
|
} |
|
return style_object; |
|
} |
|
function escape_attribute_value(value) { |
|
const should_escape = typeof value === "string" || value && typeof value === "object"; |
|
return should_escape ? escape(value, true) : value; |
|
} |
|
function escape_object(obj) { |
|
const result = {}; |
|
for (const key in obj) { |
|
result[key] = escape_attribute_value(obj[key]); |
|
} |
|
return result; |
|
} |
|
function each(items, fn) { |
|
items = ensure_array_like(items); |
|
let str = ""; |
|
for (let i = 0; i < items.length; i += 1) { |
|
str += fn(items[i], i); |
|
} |
|
return str; |
|
} |
|
var missing_component = { |
|
$$render: () => "" |
|
}; |
|
function validate_component(component, name) { |
|
if (!component || !component.$$render) { |
|
if (name === "svelte:component") name += " this={...}"; |
|
throw new Error( |
|
`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.` |
|
); |
|
} |
|
return component; |
|
} |
|
function debug(file, line, column, values) { |
|
console.log(`{@debug} ${file ? file + " " : ""}(${line}:${column})`); |
|
console.log(values); |
|
return ""; |
|
} |
|
var on_destroy; |
|
function create_ssr_component(fn) { |
|
function $$render(result, props, bindings, slots, context) { |
|
const parent_component = current_component; |
|
const $$ = { |
|
on_destroy, |
|
context: new Map(context || (parent_component ? parent_component.$$.context : [])), |
|
|
|
on_mount: [], |
|
before_update: [], |
|
after_update: [], |
|
callbacks: blank_object() |
|
}; |
|
set_current_component({ $$ }); |
|
const html = fn(result, props, bindings, slots); |
|
set_current_component(parent_component); |
|
return html; |
|
} |
|
return { |
|
render: (props = {}, { $$slots = {}, context = /* @__PURE__ */ new Map() } = {}) => { |
|
on_destroy = []; |
|
const result = { title: "", head: "", css: new Set() }; |
|
const html = $$render(result, props, {}, $$slots, context); |
|
run_all(on_destroy); |
|
return { |
|
html, |
|
css: { |
|
code: Array.from(result.css).map((css) => css.code).join("\n"), |
|
map: null |
|
|
|
}, |
|
head: result.title + result.head |
|
}; |
|
}, |
|
$$render |
|
}; |
|
} |
|
function add_attribute(name, value, boolean) { |
|
if (value == null || boolean && !value) return ""; |
|
const assignment = boolean && value === true ? "" : `="${escape(value, true)}"`; |
|
return ` ${name}${assignment}`; |
|
} |
|
function add_classes(classes) { |
|
return classes ? ` class="${classes}"` : ""; |
|
} |
|
function style_object_to_string(style_object) { |
|
return Object.keys(style_object).filter((key) => style_object[key] != null && style_object[key] !== "").map((key) => `${key}: ${escape_attribute_value(style_object[key])};`).join(" "); |
|
} |
|
function add_styles(style_object) { |
|
const styles = style_object_to_string(style_object); |
|
return styles ? ` style="${styles}"` : ""; |
|
} |
|
|
|
|
|
function bind(component, name, callback) { |
|
const index = component.$$.props[name]; |
|
if (index !== void 0) { |
|
component.$$.bound[index] = callback; |
|
callback(component.$$.ctx[index]); |
|
} |
|
} |
|
function create_component(block) { |
|
block && block.c(); |
|
} |
|
function claim_component(block, parent_nodes) { |
|
block && block.l(parent_nodes); |
|
} |
|
function mount_component(component, target, anchor) { |
|
const { fragment, after_update } = component.$$; |
|
fragment && fragment.m(target, anchor); |
|
add_render_callback(() => { |
|
const new_on_destroy = component.$$.on_mount.map(run).filter(is_function); |
|
if (component.$$.on_destroy) { |
|
component.$$.on_destroy.push(...new_on_destroy); |
|
} else { |
|
run_all(new_on_destroy); |
|
} |
|
component.$$.on_mount = []; |
|
}); |
|
after_update.forEach(add_render_callback); |
|
} |
|
function destroy_component(component, detaching) { |
|
const $$ = component.$$; |
|
if ($$.fragment !== null) { |
|
flush_render_callbacks($$.after_update); |
|
run_all($$.on_destroy); |
|
$$.fragment && $$.fragment.d(detaching); |
|
$$.on_destroy = $$.fragment = null; |
|
$$.ctx = []; |
|
} |
|
} |
|
function make_dirty(component, i) { |
|
if (component.$$.dirty[0] === -1) { |
|
dirty_components.push(component); |
|
schedule_update(); |
|
component.$$.dirty.fill(0); |
|
} |
|
component.$$.dirty[i / 31 | 0] |= 1 << i % 31; |
|
} |
|
function init(component, options, instance, create_fragment, not_equal2, props, append_styles2 = null, dirty = [-1]) { |
|
const parent_component = current_component; |
|
set_current_component(component); |
|
const $$ = component.$$ = { |
|
fragment: null, |
|
ctx: [], |
|
|
|
props, |
|
update: noop, |
|
not_equal: not_equal2, |
|
bound: blank_object(), |
|
|
|
on_mount: [], |
|
on_destroy: [], |
|
on_disconnect: [], |
|
before_update: [], |
|
after_update: [], |
|
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])), |
|
|
|
callbacks: blank_object(), |
|
dirty, |
|
skip_bound: false, |
|
root: options.target || parent_component.$$.root |
|
}; |
|
append_styles2 && append_styles2($$.root); |
|
let ready = false; |
|
$$.ctx = instance ? instance(component, options.props || {}, (i, ret, ...rest) => { |
|
const value = rest.length ? rest[0] : ret; |
|
if ($$.ctx && not_equal2($$.ctx[i], $$.ctx[i] = value)) { |
|
if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value); |
|
if (ready) make_dirty(component, i); |
|
} |
|
return ret; |
|
}) : []; |
|
$$.update(); |
|
ready = true; |
|
run_all($$.before_update); |
|
$$.fragment = create_fragment ? create_fragment($$.ctx) : false; |
|
if (options.target) { |
|
if (options.hydrate) { |
|
start_hydrating(); |
|
const nodes = children(options.target); |
|
$$.fragment && $$.fragment.l(nodes); |
|
nodes.forEach(detach); |
|
} else { |
|
$$.fragment && $$.fragment.c(); |
|
} |
|
if (options.intro) transition_in(component.$$.fragment); |
|
mount_component(component, options.target, options.anchor); |
|
end_hydrating(); |
|
flush(); |
|
} |
|
set_current_component(parent_component); |
|
} |
|
var SvelteElement; |
|
if (typeof HTMLElement === "function") { |
|
SvelteElement = class extends HTMLElement { |
|
constructor($$componentCtor, $$slots, use_shadow_dom) { |
|
super(); |
|
|
|
__publicField(this, "$$ctor"); |
|
|
|
__publicField(this, "$$s"); |
|
|
|
__publicField(this, "$$c"); |
|
|
|
__publicField(this, "$$cn", false); |
|
|
|
__publicField(this, "$$d", {}); |
|
|
|
__publicField(this, "$$r", false); |
|
|
|
__publicField(this, "$$p_d", {}); |
|
|
|
__publicField(this, "$$l", {}); |
|
|
|
__publicField(this, "$$l_u", new Map()); |
|
this.$$ctor = $$componentCtor; |
|
this.$$s = $$slots; |
|
if (use_shadow_dom) { |
|
this.attachShadow({ mode: "open" }); |
|
} |
|
} |
|
addEventListener(type, listener, options) { |
|
this.$$l[type] = this.$$l[type] || []; |
|
this.$$l[type].push(listener); |
|
if (this.$$c) { |
|
const unsub = this.$$c.$on(type, listener); |
|
this.$$l_u.set(listener, unsub); |
|
} |
|
super.addEventListener(type, listener, options); |
|
} |
|
removeEventListener(type, listener, options) { |
|
super.removeEventListener(type, listener, options); |
|
if (this.$$c) { |
|
const unsub = this.$$l_u.get(listener); |
|
if (unsub) { |
|
unsub(); |
|
this.$$l_u.delete(listener); |
|
} |
|
} |
|
} |
|
async connectedCallback() { |
|
this.$$cn = true; |
|
if (!this.$$c) { |
|
let create_slot2 = function(name) { |
|
return () => { |
|
let node; |
|
const obj = { |
|
c: function create() { |
|
node = element("slot"); |
|
if (name !== "default") { |
|
attr(node, "name", name); |
|
} |
|
}, |
|
|
|
|
|
|
|
|
|
m: function mount(target, anchor) { |
|
insert(target, node, anchor); |
|
}, |
|
d: function destroy(detaching) { |
|
if (detaching) { |
|
detach(node); |
|
} |
|
} |
|
}; |
|
return obj; |
|
}; |
|
}; |
|
await Promise.resolve(); |
|
if (!this.$$cn || this.$$c) { |
|
return; |
|
} |
|
const $$slots = {}; |
|
const existing_slots = get_custom_elements_slots(this); |
|
for (const name of this.$$s) { |
|
if (name in existing_slots) { |
|
$$slots[name] = [create_slot2(name)]; |
|
} |
|
} |
|
for (const attribute of this.attributes) { |
|
const name = this.$$g_p(attribute.name); |
|
if (!(name in this.$$d)) { |
|
this.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, "toProp"); |
|
} |
|
} |
|
for (const key in this.$$p_d) { |
|
if (!(key in this.$$d) && this[key] !== void 0) { |
|
this.$$d[key] = this[key]; |
|
delete this[key]; |
|
} |
|
} |
|
this.$$c = new this.$$ctor({ |
|
target: this.shadowRoot || this, |
|
props: { |
|
...this.$$d, |
|
$$slots, |
|
$$scope: { |
|
ctx: [] |
|
} |
|
} |
|
}); |
|
const reflect_attributes = () => { |
|
this.$$r = true; |
|
for (const key in this.$$p_d) { |
|
this.$$d[key] = this.$$c.$$.ctx[this.$$c.$$.props[key]]; |
|
if (this.$$p_d[key].reflect) { |
|
const attribute_value = get_custom_element_value( |
|
key, |
|
this.$$d[key], |
|
this.$$p_d, |
|
"toAttribute" |
|
); |
|
if (attribute_value == null) { |
|
this.removeAttribute(this.$$p_d[key].attribute || key); |
|
} else { |
|
this.setAttribute(this.$$p_d[key].attribute || key, attribute_value); |
|
} |
|
} |
|
} |
|
this.$$r = false; |
|
}; |
|
this.$$c.$$.after_update.push(reflect_attributes); |
|
reflect_attributes(); |
|
for (const type in this.$$l) { |
|
for (const listener of this.$$l[type]) { |
|
const unsub = this.$$c.$on(type, listener); |
|
this.$$l_u.set(listener, unsub); |
|
} |
|
} |
|
this.$$l = {}; |
|
} |
|
} |
|
|
|
|
|
attributeChangedCallback(attr2, _oldValue, newValue) { |
|
var _a; |
|
if (this.$$r) return; |
|
attr2 = this.$$g_p(attr2); |
|
this.$$d[attr2] = get_custom_element_value(attr2, newValue, this.$$p_d, "toProp"); |
|
(_a = this.$$c) == null ? void 0 : _a.$set({ [attr2]: this.$$d[attr2] }); |
|
} |
|
disconnectedCallback() { |
|
this.$$cn = false; |
|
Promise.resolve().then(() => { |
|
if (!this.$$cn && this.$$c) { |
|
this.$$c.$destroy(); |
|
this.$$c = void 0; |
|
} |
|
}); |
|
} |
|
$$g_p(attribute_name) { |
|
return Object.keys(this.$$p_d).find( |
|
(key) => this.$$p_d[key].attribute === attribute_name || !this.$$p_d[key].attribute && key.toLowerCase() === attribute_name |
|
) || attribute_name; |
|
} |
|
}; |
|
} |
|
function get_custom_element_value(prop, value, props_definition, transform) { |
|
var _a; |
|
const type = (_a = props_definition[prop]) == null ? void 0 : _a.type; |
|
value = type === "Boolean" && typeof value !== "boolean" ? value != null : value; |
|
if (!transform || !props_definition[prop]) { |
|
return value; |
|
} else if (transform === "toAttribute") { |
|
switch (type) { |
|
case "Object": |
|
case "Array": |
|
return value == null ? null : JSON.stringify(value); |
|
case "Boolean": |
|
return value ? "" : null; |
|
case "Number": |
|
return value == null ? null : value; |
|
default: |
|
return value; |
|
} |
|
} else { |
|
switch (type) { |
|
case "Object": |
|
case "Array": |
|
return value && JSON.parse(value); |
|
case "Boolean": |
|
return value; |
|
case "Number": |
|
return value != null ? +value : value; |
|
default: |
|
return value; |
|
} |
|
} |
|
} |
|
function create_custom_element(Component, props_definition, slots, accessors, use_shadow_dom, extend) { |
|
let Class = class extends SvelteElement { |
|
constructor() { |
|
super(Component, slots, use_shadow_dom); |
|
this.$$p_d = props_definition; |
|
} |
|
static get observedAttributes() { |
|
return Object.keys(props_definition).map( |
|
(key) => (props_definition[key].attribute || key).toLowerCase() |
|
); |
|
} |
|
}; |
|
Object.keys(props_definition).forEach((prop) => { |
|
Object.defineProperty(Class.prototype, prop, { |
|
get() { |
|
return this.$$c && prop in this.$$c ? this.$$c[prop] : this.$$d[prop]; |
|
}, |
|
set(value) { |
|
var _a; |
|
value = get_custom_element_value(prop, value, props_definition); |
|
this.$$d[prop] = value; |
|
(_a = this.$$c) == null ? void 0 : _a.$set({ [prop]: value }); |
|
} |
|
}); |
|
}); |
|
accessors.forEach((accessor) => { |
|
Object.defineProperty(Class.prototype, accessor, { |
|
get() { |
|
var _a; |
|
return (_a = this.$$c) == null ? void 0 : _a[accessor]; |
|
} |
|
}); |
|
}); |
|
if (extend) { |
|
Class = extend(Class); |
|
} |
|
Component.element = |
|
Class; |
|
return Class; |
|
} |
|
var SvelteComponent = class { |
|
constructor() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__publicField(this, "$$"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__publicField(this, "$$set"); |
|
} |
|
|
|
$destroy() { |
|
destroy_component(this, 1); |
|
this.$destroy = noop; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
$on(type, callback) { |
|
if (!is_function(callback)) { |
|
return noop; |
|
} |
|
const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []); |
|
callbacks.push(callback); |
|
return () => { |
|
const index = callbacks.indexOf(callback); |
|
if (index !== -1) callbacks.splice(index, 1); |
|
}; |
|
} |
|
|
|
|
|
|
|
|
|
$set(props) { |
|
if (this.$$set && !is_empty(props)) { |
|
this.$$.skip_bound = true; |
|
this.$$set(props); |
|
this.$$.skip_bound = false; |
|
} |
|
} |
|
}; |
|
|
|
|
|
function dispatch_dev(type, detail) { |
|
document.dispatchEvent(custom_event(type, { version: VERSION, ...detail }, { bubbles: true })); |
|
} |
|
function append_dev(target, node) { |
|
dispatch_dev("SvelteDOMInsert", { target, node }); |
|
append(target, node); |
|
} |
|
function append_hydration_dev(target, node) { |
|
dispatch_dev("SvelteDOMInsert", { target, node }); |
|
append_hydration(target, node); |
|
} |
|
function insert_dev(target, node, anchor) { |
|
dispatch_dev("SvelteDOMInsert", { target, node, anchor }); |
|
insert(target, node, anchor); |
|
} |
|
function insert_hydration_dev(target, node, anchor) { |
|
dispatch_dev("SvelteDOMInsert", { target, node, anchor }); |
|
insert_hydration(target, node, anchor); |
|
} |
|
function detach_dev(node) { |
|
dispatch_dev("SvelteDOMRemove", { node }); |
|
detach(node); |
|
} |
|
function detach_between_dev(before, after) { |
|
while (before.nextSibling && before.nextSibling !== after) { |
|
detach_dev(before.nextSibling); |
|
} |
|
} |
|
function detach_before_dev(after) { |
|
while (after.previousSibling) { |
|
detach_dev(after.previousSibling); |
|
} |
|
} |
|
function detach_after_dev(before) { |
|
while (before.nextSibling) { |
|
detach_dev(before.nextSibling); |
|
} |
|
} |
|
function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation, has_stop_immediate_propagation) { |
|
const modifiers = options === true ? ["capture"] : options ? Array.from(Object.keys(options)) : []; |
|
if (has_prevent_default) modifiers.push("preventDefault"); |
|
if (has_stop_propagation) modifiers.push("stopPropagation"); |
|
if (has_stop_immediate_propagation) modifiers.push("stopImmediatePropagation"); |
|
dispatch_dev("SvelteDOMAddEventListener", { node, event, handler, modifiers }); |
|
const dispose = listen(node, event, handler, options); |
|
return () => { |
|
dispatch_dev("SvelteDOMRemoveEventListener", { node, event, handler, modifiers }); |
|
dispose(); |
|
}; |
|
} |
|
function attr_dev(node, attribute, value) { |
|
attr(node, attribute, value); |
|
if (value == null) dispatch_dev("SvelteDOMRemoveAttribute", { node, attribute }); |
|
else dispatch_dev("SvelteDOMSetAttribute", { node, attribute, value }); |
|
} |
|
function prop_dev(node, property, value) { |
|
node[property] = value; |
|
dispatch_dev("SvelteDOMSetProperty", { node, property, value }); |
|
} |
|
function dataset_dev(node, property, value) { |
|
node.dataset[property] = value; |
|
dispatch_dev("SvelteDOMSetDataset", { node, property, value }); |
|
} |
|
function set_data_dev(text2, data) { |
|
data = "" + data; |
|
if (text2.data === data) return; |
|
dispatch_dev("SvelteDOMSetData", { node: text2, data }); |
|
text2.data = |
|
data; |
|
} |
|
function set_data_contenteditable_dev(text2, data) { |
|
data = "" + data; |
|
if (text2.wholeText === data) return; |
|
dispatch_dev("SvelteDOMSetData", { node: text2, data }); |
|
text2.data = |
|
data; |
|
} |
|
function set_data_maybe_contenteditable_dev(text2, data, attr_value) { |
|
if (~contenteditable_truthy_values.indexOf(attr_value)) { |
|
set_data_contenteditable_dev(text2, data); |
|
} else { |
|
set_data_dev(text2, data); |
|
} |
|
} |
|
function ensure_array_like_dev(arg) { |
|
if (typeof arg !== "string" && !(arg && typeof arg === "object" && "length" in arg) && !(typeof Symbol === "function" && arg && Symbol.iterator in arg)) { |
|
throw new Error("{#each} only works with iterable values."); |
|
} |
|
return ensure_array_like(arg); |
|
} |
|
function validate_slots(name, slot, keys) { |
|
for (const slot_key of Object.keys(slot)) { |
|
if (!~keys.indexOf(slot_key)) { |
|
console.warn(`<${name}> received an unexpected slot "${slot_key}".`); |
|
} |
|
} |
|
} |
|
function validate_dynamic_element(tag) { |
|
const is_string = typeof tag === "string"; |
|
if (tag && !is_string) { |
|
throw new Error('<svelte:element> expects "this" attribute to be a string.'); |
|
} |
|
} |
|
function validate_void_dynamic_element(tag) { |
|
if (tag && is_void(tag)) { |
|
console.warn(`<svelte:element this="${tag}"> is self-closing and cannot have content.`); |
|
} |
|
} |
|
function construct_svelte_component_dev(component, props) { |
|
const error_message = "this={...} of <svelte:component> should specify a Svelte component."; |
|
try { |
|
const instance = new component(props); |
|
if (!instance.$$ || !instance.$set || !instance.$on || !instance.$destroy) { |
|
throw new Error(error_message); |
|
} |
|
return instance; |
|
} catch (err) { |
|
const { message } = err; |
|
if (typeof message === "string" && message.indexOf("is not a constructor") !== -1) { |
|
throw new Error(error_message); |
|
} else { |
|
throw err; |
|
} |
|
} |
|
} |
|
var SvelteComponentDev = class extends SvelteComponent { |
|
|
|
constructor(options) { |
|
if (!options || !options.target && !options.$$inline) { |
|
throw new Error("'target' is a required option"); |
|
} |
|
super(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__publicField(this, "$$prop_def"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__publicField(this, "$$events_def"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__publicField(this, "$$slot_def"); |
|
} |
|
|
|
$destroy() { |
|
super.$destroy(); |
|
this.$destroy = () => { |
|
console.warn("Component was already destroyed"); |
|
}; |
|
} |
|
|
|
$capture_state() { |
|
} |
|
|
|
$inject_state() { |
|
} |
|
}; |
|
var SvelteComponentTyped = class extends SvelteComponentDev { |
|
}; |
|
function loop_guard(timeout) { |
|
const start = Date.now(); |
|
return () => { |
|
if (Date.now() - start > timeout) { |
|
throw new Error("Infinite loop detected"); |
|
} |
|
}; |
|
} |
|
|
|
export { |
|
noop, |
|
identity, |
|
assign, |
|
is_promise, |
|
add_location, |
|
run, |
|
blank_object, |
|
run_all, |
|
is_function, |
|
safe_not_equal, |
|
src_url_equal, |
|
srcset_url_equal, |
|
not_equal, |
|
is_empty, |
|
validate_store, |
|
subscribe, |
|
get_store_value, |
|
component_subscribe, |
|
create_slot, |
|
get_slot_changes, |
|
update_slot_base, |
|
update_slot, |
|
get_all_dirty_from_scope, |
|
exclude_internal_props, |
|
compute_rest_props, |
|
compute_slots, |
|
once, |
|
null_to_empty, |
|
set_store_value, |
|
has_prop, |
|
action_destroyer, |
|
split_css_unit, |
|
contenteditable_truthy_values, |
|
is_client, |
|
now, |
|
raf, |
|
set_now, |
|
set_raf, |
|
clear_loops, |
|
loop, |
|
globals, |
|
ResizeObserverSingleton, |
|
start_hydrating, |
|
end_hydrating, |
|
append, |
|
append_styles, |
|
get_root_for_style, |
|
append_empty_stylesheet, |
|
append_hydration, |
|
insert, |
|
insert_hydration, |
|
detach, |
|
destroy_each, |
|
element, |
|
element_is, |
|
object_without_properties, |
|
svg_element, |
|
text, |
|
space, |
|
empty, |
|
comment, |
|
listen, |
|
prevent_default, |
|
stop_propagation, |
|
stop_immediate_propagation, |
|
self, |
|
trusted, |
|
attr, |
|
set_attributes, |
|
set_svg_attributes, |
|
set_custom_element_data_map, |
|
set_custom_element_data, |
|
set_dynamic_element_data, |
|
xlink_attr, |
|
get_svelte_dataset, |
|
get_binding_group_value, |
|
init_binding_group, |
|
init_binding_group_dynamic, |
|
to_number, |
|
time_ranges_to_array, |
|
children, |
|
claim_element, |
|
claim_svg_element, |
|
claim_text, |
|
claim_space, |
|
claim_comment, |
|
claim_html_tag, |
|
set_data, |
|
set_data_contenteditable, |
|
set_data_maybe_contenteditable, |
|
set_input_value, |
|
set_input_type, |
|
set_style, |
|
select_option, |
|
select_options, |
|
select_value, |
|
select_multiple_value, |
|
is_crossorigin, |
|
add_iframe_resize_listener, |
|
resize_observer_content_box, |
|
resize_observer_border_box, |
|
resize_observer_device_pixel_content_box, |
|
toggle_class, |
|
custom_event, |
|
query_selector_all, |
|
head_selector, |
|
HtmlTag, |
|
HtmlTagHydration, |
|
attribute_to_object, |
|
stringify_spread, |
|
get_custom_elements_slots, |
|
construct_svelte_component, |
|
create_animation, |
|
fix_position, |
|
add_transform, |
|
current_component, |
|
set_current_component, |
|
get_current_component, |
|
beforeUpdate, |
|
onMount, |
|
afterUpdate, |
|
onDestroy, |
|
createEventDispatcher, |
|
setContext, |
|
getContext, |
|
getAllContexts, |
|
hasContext, |
|
bubble, |
|
dirty_components, |
|
intros, |
|
binding_callbacks, |
|
schedule_update, |
|
tick, |
|
add_render_callback, |
|
add_flush_callback, |
|
flush, |
|
flush_render_callbacks, |
|
group_outros, |
|
check_outros, |
|
transition_in, |
|
transition_out, |
|
create_in_transition, |
|
create_out_transition, |
|
create_bidirectional_transition, |
|
handle_promise, |
|
update_await_block_branch, |
|
ensure_array_like, |
|
destroy_block, |
|
outro_and_destroy_block, |
|
fix_and_destroy_block, |
|
fix_and_outro_and_destroy_block, |
|
update_keyed_each, |
|
validate_each_keys, |
|
get_spread_update, |
|
get_spread_object, |
|
escape, |
|
is_void, |
|
invalid_attribute_name_character, |
|
spread, |
|
merge_ssr_styles, |
|
escape_attribute_value, |
|
escape_object, |
|
each, |
|
missing_component, |
|
validate_component, |
|
debug, |
|
create_ssr_component, |
|
add_attribute, |
|
add_classes, |
|
add_styles, |
|
bind, |
|
create_component, |
|
claim_component, |
|
mount_component, |
|
destroy_component, |
|
init, |
|
SvelteElement, |
|
create_custom_element, |
|
SvelteComponent, |
|
dispatch_dev, |
|
append_dev, |
|
append_hydration_dev, |
|
insert_dev, |
|
insert_hydration_dev, |
|
detach_dev, |
|
detach_between_dev, |
|
detach_before_dev, |
|
detach_after_dev, |
|
listen_dev, |
|
attr_dev, |
|
prop_dev, |
|
dataset_dev, |
|
set_data_dev, |
|
set_data_contenteditable_dev, |
|
set_data_maybe_contenteditable_dev, |
|
ensure_array_like_dev, |
|
validate_slots, |
|
validate_dynamic_element, |
|
validate_void_dynamic_element, |
|
construct_svelte_component_dev, |
|
SvelteComponentDev, |
|
SvelteComponentTyped, |
|
loop_guard |
|
}; |
|
|
|
|