//#region node_modules/svelte/src/internal/disclose-version.js
typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add("5");
//#endregion
//#region node_modules/svelte/src/constants.js
var e = {}, t = Symbol("uninitialized"), n = "http://www.w3.org/1999/xhtml", r = Array.isArray, i = Array.prototype.indexOf, a = Array.prototype.includes, o = Array.from, s = Object.keys, c = Object.defineProperty, l = Object.getOwnPropertyDescriptor, u = Object.getOwnPropertyDescriptors, d = Object.prototype, f = Array.prototype, p = Object.getPrototypeOf, m = Object.isExtensible, h = () => {};
function g(e) {
	for (var t = 0; t < e.length; t++) e[t]();
}
function _() {
	var e, t;
	return {
		promise: new Promise((n, r) => {
			e = n, t = r;
		}),
		resolve: e,
		reject: t
	};
}
var v = 1024, y = 2048, b = 4096, x = 8192, S = 16384, ee = 32768, C = 1 << 25, w = 65536, te = 1 << 19, ne = 1 << 20, re = 1 << 25, ie = 65536, ae = 1 << 21, oe = 1 << 22, se = 1 << 23, ce = Symbol("$state"), le = Symbol("legacy props"), ue = Symbol(""), de = Symbol("attributes"), fe = Symbol("class"), pe = Symbol("style"), me = Symbol("text"), he = new class extends Error {
	name = "StaleReactionError";
	message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
}(), ge = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
//#endregion
//#region node_modules/svelte/src/internal/client/errors.js
function _e() {
	throw Error("https://svelte.dev/e/async_derived_orphan");
}
function ve(e, t, n) {
	throw Error("https://svelte.dev/e/each_key_duplicate");
}
function ye() {
	throw Error("https://svelte.dev/e/effect_update_depth_exceeded");
}
function be() {
	throw Error("https://svelte.dev/e/hydration_failed");
}
function xe(e) {
	throw Error("https://svelte.dev/e/props_invalid_value");
}
function Se() {
	throw Error("https://svelte.dev/e/state_descriptors_fixed");
}
function Ce() {
	throw Error("https://svelte.dev/e/state_prototype_fixed");
}
function we() {
	throw Error("https://svelte.dev/e/state_unsafe_mutation");
}
function Te() {
	throw Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
}
function Ee() {
	console.warn("https://svelte.dev/e/derived_inert");
}
function De(e) {
	console.warn("https://svelte.dev/e/hydration_mismatch");
}
function Oe() {
	console.warn("https://svelte.dev/e/select_multiple_invalid_value");
}
function ke() {
	console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
}
//#endregion
//#region node_modules/svelte/src/internal/client/dom/hydration.js
var T = !1;
function Ae(e) {
	T = e;
}
var E;
function D(t) {
	if (t === null) throw De(), e;
	return E = t;
}
function je() {
	return D(/* @__PURE__ */ $t(E));
}
function O(t) {
	if (T) {
		if (/* @__PURE__ */ $t(E) !== null) throw De(), e;
		E = t;
	}
}
function Me(e = 1) {
	if (T) {
		for (var t = e, n = E; t--;) n = /* @__PURE__ */ $t(n);
		E = n;
	}
}
function Ne(e = !0) {
	for (var t = 0, n = E;;) {
		if (n.nodeType === 8) {
			var r = n.data;
			if (r === "]") {
				if (t === 0) return n;
				--t;
			} else (r === "[" || r === "[!" || r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1);
		}
		var i = /* @__PURE__ */ $t(n);
		e && n.remove(), n = i;
	}
}
function Pe(t) {
	if (!t || t.nodeType !== 8) throw De(), e;
	return t.data;
}
//#endregion
//#region node_modules/svelte/src/internal/client/reactivity/equality.js
function Fe(e) {
	return e === this.v;
}
function Ie(e, t) {
	return e == e ? e !== t || typeof e == "object" && !!e || typeof e == "function" : t == t;
}
function Le(e) {
	return !Ie(e, this.v);
}
//#endregion
//#region node_modules/svelte/src/internal/client/context.js
var Re = null;
function ze(e) {
	Re = e;
}
function Be(e, t = !1, n) {
	Re = {
		p: Re,
		i: !1,
		c: null,
		e: null,
		s: e,
		x: null,
		r: W,
		l: null
	};
}
function Ve(e) {
	var t = Re, n = t.e;
	if (n !== null) {
		t.e = null;
		for (var r of n) un(r);
	}
	return e !== void 0 && (t.x = e), t.i = !0, Re = t.p, e ?? {};
}
function He() {
	return !0;
}
//#endregion
//#region node_modules/svelte/src/internal/client/dom/task.js
var Ue = [];
function We() {
	var e = Ue;
	Ue = [], g(e);
}
function Ge(e) {
	if (Ue.length === 0 && !St) {
		var t = Ue;
		queueMicrotask(() => {
			t === Ue && We();
		});
	}
	Ue.push(e);
}
function Ke() {
	for (; Ue.length > 0;) We();
}
function qe(e) {
	var t = W;
	if (t === null) return H.f |= se, e;
	if (!(t.f & 32768) && !(t.f & 4)) throw e;
	Je(e, t);
}
function Je(e, t) {
	if (!(t !== null && t.f & 16384)) {
		for (; t !== null;) {
			if (t.f & 128) {
				if (!(t.f & 32768)) throw e;
				try {
					t.b.error(e);
					return;
				} catch (t) {
					e = t;
				}
			}
			t = t.parent;
		}
		throw e;
	}
}
//#endregion
//#region node_modules/svelte/src/internal/client/reactivity/status.js
var Ye = ~(y | b | v);
function k(e, t) {
	e.f = e.f & Ye | t;
}
function Xe(e) {
	e.f & 512 || e.deps === null ? k(e, v) : k(e, b);
}
//#endregion
//#region node_modules/svelte/src/internal/client/reactivity/utils.js
function Ze(e) {
	if (e !== null) for (let t of e) !(t.f & 2) || !(t.f & 65536) || (t.f ^= ie, Ze(t.deps));
}
function Qe(e, t, n) {
	e.f & 2048 ? t.add(e) : e.f & 4096 && n.add(e), Ze(e.deps), k(e, v);
}
//#endregion
//#region node_modules/svelte/src/internal/client/reactivity/store.js
var $e = !1;
function et(e) {
	var t = $e;
	try {
		return $e = !1, [e(), $e];
	} finally {
		$e = t;
	}
}
//#endregion
//#region node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
function tt(e) {
	var t = H, n = W;
	U(null), Mn(null);
	try {
		return e();
	} finally {
		U(t), Mn(n);
	}
}
//#endregion
//#region node_modules/svelte/src/reactivity/create-subscriber.js
function nt(e) {
	let t = 0, n = Rt(0), r;
	return () => {
		cn() && (J(n), hn(() => (t === 0 && (r = Yn(() => e(() => Ut(n)))), t += 1, () => {
			Ge(() => {
				--t, t === 0 && (r?.(), r = void 0, Ut(n));
			});
		})));
	};
}
//#endregion
//#region node_modules/svelte/src/internal/client/dom/blocks/boundary.js
var rt = w | te;
function it(e, t, n, r) {
	new at(e, t, n, r);
}
var at = class {
	parent;
	is_pending = !1;
	transform_error;
	#e;
	#t = T ? E : null;
	#n;
	#r;
	#i;
	#a = null;
	#o = null;
	#s = null;
	#c = null;
	#l = 0;
	#u = 0;
	#d = !1;
	#f = /* @__PURE__ */ new Set();
	#p = /* @__PURE__ */ new Set();
	#m = null;
	#h = nt(() => (this.#m = Rt(this.#l), () => {
		this.#m = null;
	}));
	constructor(e, t, n, r) {
		this.#e = e, this.#n = t, this.#r = (e) => {
			var t = W;
			t.b = this, t.f |= 128, n(e);
		}, this.parent = W.b, this.transform_error = r ?? this.parent?.transform_error ?? ((e) => e), this.#i = gn(() => {
			if (T) {
				let e = this.#t;
				je();
				let t = e.data === "[!";
				if (e.data.startsWith("[?")) {
					let t = JSON.parse(e.data.slice(2));
					this.#_(t);
				} else t ? this.#y() : this.#g();
			} else this.#b();
		}, rt), T && (this.#e = E);
	}
	#g() {
		try {
			this.#a = B(() => this.#r(this.#e));
		} catch (e) {
			this.error(e);
		}
	}
	#_(e) {
		let t = this.#n.failed, { reset: n, invoke_onerror: r } = this.#v(e);
		Ge(r), t && (this.#s = B(() => {
			t(this.#e, () => e, () => n);
		}));
	}
	#v(e) {
		var t = !1, n = !1;
		let r = () => {
			if (t) {
				ke();
				return;
			}
			t = !0, n && Te(), this.#s !== null && Sn(this.#s, () => {
				this.#s = null;
			}), this.#S(() => {
				this.#b();
			});
		};
		return {
			reset: r,
			invoke_onerror: () => {
				try {
					n = !0, this.#n.onerror?.(e, r), n = !1;
				} catch (e) {
					Je(e, this.#i && this.#i.parent);
				}
			}
		};
	}
	#y() {
		let e = this.#n.pending;
		e && (this.is_pending = !0, this.#o = B(() => e(this.#e)), Ge(() => {
			var e = this.#c = document.createDocumentFragment(), t = F();
			e.append(t), this.#a = this.#S(() => B(() => this.#r(t))), this.#u === 0 && (this.#e.before(e), this.#c = null, Sn(this.#o, () => {
				this.#o = null;
			}), this.#x(j));
		}));
	}
	#b() {
		try {
			if (this.is_pending = this.has_pending_snippet(), this.#u = 0, this.#l = 0, this.#a = B(() => {
				this.#r(this.#e);
			}), this.#u > 0) {
				var e = this.#c = document.createDocumentFragment();
				En(this.#a, e);
				let t = this.#n.pending;
				this.#o = B(() => t(this.#e));
			} else this.#x(j);
		} catch (e) {
			this.error(e);
		}
	}
	#x(e) {
		this.is_pending = !1, e.transfer_effects(this.#f, this.#p);
	}
	defer_effect(e) {
		Qe(e, this.#f, this.#p);
	}
	is_rendered() {
		return !this.is_pending && (!this.parent || this.parent.is_rendered());
	}
	has_pending_snippet() {
		return !!this.#n.pending;
	}
	#S(e) {
		var t = W, n = H, r = Re;
		Mn(this.#i), U(this.#i), ze(this.#i.ctx);
		try {
			return Ot.ensure(), e();
		} catch (e) {
			return qe(e), null;
		} finally {
			Mn(t), U(n), ze(r);
		}
	}
	#C(e, t) {
		if (!this.has_pending_snippet()) {
			this.parent && this.parent.#C(e, t);
			return;
		}
		this.#u += e, this.#u === 0 && (this.#x(t), this.#o && Sn(this.#o, () => {
			this.#o = null;
		}), this.#c &&= (this.#e.before(this.#c), null));
	}
	update_pending_count(e, t) {
		this.#C(e, t), this.#l += e, !(!this.#m || this.#d) && (this.#d = !0, Ge(() => {
			this.#d = !1, this.#m && Vt(this.#m, this.#l);
		}));
	}
	get_effect_pending() {
		return this.#h(), J(this.#m);
	}
	error(e) {
		if (!this.#n.onerror && !this.#n.failed) throw e;
		j?.is_fork ? (this.#a && j.skip_effect(this.#a), this.#o && j.skip_effect(this.#o), this.#s && j.skip_effect(this.#s), j.oncommit(() => {
			this.#w(e);
		})) : this.#w(e);
	}
	#w(e) {
		this.#a &&= (V(this.#a), null), this.#o &&= (V(this.#o), null), this.#s &&= (V(this.#s), null), T && (D(this.#t), Me(), D(Ne()));
		let t = this.#n.failed, n = (e) => {
			let { reset: n, invoke_onerror: r } = this.#v(e);
			r(), t && (this.#s = this.#S(() => {
				try {
					return B(() => {
						var r = W;
						r.b = this, r.f |= 128, t(this.#e, () => e, () => n);
					});
				} catch (e) {
					return Je(e, this.#i.parent), null;
				}
			}));
		};
		Ge(() => {
			var t;
			try {
				t = this.transform_error(e);
			} catch (e) {
				Je(e, this.#i && this.#i.parent);
				return;
			}
			typeof t == "object" && t && typeof t.then == "function" ? t.then(n, (e) => Je(e, this.#i && this.#i.parent)) : n(t);
		});
	}
};
//#endregion
//#region node_modules/svelte/src/internal/client/reactivity/async.js
function ot(e, t, n, r) {
	let i = He() ? ut : pt;
	var a = e.filter((e) => !e.settled), o = t.map(i);
	if (n.length === 0 && a.length === 0) {
		r(o);
		return;
	}
	var s = W, c = st(), l = a.length === 1 ? a[0].promise : a.length > 1 ? Promise.all(a.map((e) => e.promise)) : null;
	function u(e) {
		if (!(s.f & 16384)) {
			c();
			try {
				r([...o, ...e]);
			} catch (e) {
				Je(e, s);
			}
			ct();
		}
	}
	var d = lt();
	if (n.length === 0) {
		l.then(() => u([])).finally(d);
		return;
	}
	function f() {
		Promise.all(n.map((e) => /* @__PURE__ */ ft(e))).then(u).catch((e) => Je(e, s)).finally(d);
	}
	l ? l.then(() => {
		c(), f(), ct();
	}) : f();
}
function st() {
	var e = W, t = H, n = Re, r = j;
	return function(i = !0) {
		Mn(e), U(t), ze(n), i && !(e.f & 16384) && (r?.activate(), r?.apply());
	};
}
function ct(e = !0) {
	Mn(null), U(null), ze(null), e && j?.deactivate();
}
function lt() {
	var e = W, t = e.b, n = j, r = !!t?.is_rendered();
	return t?.update_pending_count(1, n), n.increment(r, e), () => {
		t?.update_pending_count(-1, n), n.decrement(r, e);
	};
}
/*#__NO_SIDE_EFFECTS__*/
function ut(e) {
	var n = 2 | y;
	return W !== null && (W.f |= te), {
		ctx: Re,
		deps: null,
		effects: null,
		equals: Fe,
		f: n,
		fn: e,
		reactions: null,
		rv: 0,
		v: t,
		wv: 0,
		parent: W,
		ac: null
	};
}
var dt = Symbol("obsolete");
/*#__NO_SIDE_EFFECTS__*/
function ft(e, n, r) {
	let i = W;
	i === null && _e();
	var a = void 0, o = Rt(t), s = !H, c = /* @__PURE__ */ new Set();
	return mn(() => {
		var t = W, n = _();
		a = n.promise;
		try {
			Promise.resolve(e()).then(n.resolve, (e) => {
				e !== he && n.reject(e);
			}).finally(ct);
		} catch (e) {
			n.reject(e), ct();
		}
		var r = j;
		if (s) {
			if (t.f & 32768) var l = lt();
			if (i.b?.is_rendered()) r.async_deriveds.get(t)?.reject(dt);
			else for (let e of c.values()) e.reject(dt);
			c.add(n), r.async_deriveds.set(t, n);
		}
		let u = (e, t = void 0) => {
			l?.(), c.delete(n), t !== dt && (r.activate(), t ? (o.f |= se, Vt(o, t)) : (o.f & 8388608 && (o.f ^= se), Vt(o, e)), r.deactivate());
		};
		n.promise.then(u, (e) => u(null, e || "unknown"));
	}), ln(() => {
		for (let e of c) e.reject(dt);
	}), new Promise((e) => {
		function t(n) {
			function r() {
				n === a ? e(o) : t(a);
			}
			n.then(r, r);
		}
		t(a);
	});
}
/*#__NO_SIDE_EFFECTS__*/
function A(e) {
	let t = /* @__PURE__ */ ut(e);
	return Pn(t), t;
}
/*#__NO_SIDE_EFFECTS__*/
function pt(e) {
	let t = /* @__PURE__ */ ut(e);
	return t.equals = Le, t;
}
function mt(e) {
	var t = e.effects;
	if (t !== null) {
		e.effects = null;
		for (var n = 0; n < t.length; n += 1) V(t[n]);
	}
}
function ht(e) {
	var n, r = W, i = e.parent;
	if (!kn && i !== null && e.v !== t && i.f & 24576) return Ee(), e.v;
	Mn(i);
	try {
		e.f &= ~ie, mt(e), n = Un(e);
	} finally {
		Mn(r);
	}
	return n;
}
function gt(e) {
	var t = ht(e);
	if (!e.equals(t) && (e.wv = Bn(), (!j?.is_fork || e.deps === null) && (j === null ? e.v = t : (j.capture(e, t, !0), bt?.capture(e, t, !0)), e.deps === null))) {
		k(e, v);
		return;
	}
	kn || (M === null ? Xe(e) : (cn() || j?.is_fork) && M.set(e, t));
}
function _t(e) {
	if (e.effects !== null) for (let t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac !== null && tt(() => {
		t.ac.abort(he), t.ac = null;
	}), t.fn !== null && (t.teardown = h), Gn(t, 0), vn(t));
}
function vt(e) {
	if (e.effects !== null) for (let t of e.effects) t.teardown && t.fn !== null && Kn(t);
}
//#endregion
//#region node_modules/svelte/src/internal/client/reactivity/batch.js
var yt = null, j = null, bt = null, M = null, xt = null, St = !1, Ct = !1, wt = null, Tt = null, Et = 0, Dt = 1, Ot = class e {
	id = Dt++;
	#e = !1;
	linked = !0;
	#t = null;
	#n = null;
	async_deriveds = /* @__PURE__ */ new Map();
	current = /* @__PURE__ */ new Map();
	previous = /* @__PURE__ */ new Map();
	#r = /* @__PURE__ */ new Set();
	#i = /* @__PURE__ */ new Set();
	#a = 0;
	#o = /* @__PURE__ */ new Map();
	#s = null;
	#c = [];
	#l = [];
	#u = /* @__PURE__ */ new Set();
	#d = /* @__PURE__ */ new Set();
	#f = /* @__PURE__ */ new Map();
	#p = /* @__PURE__ */ new Set();
	is_fork = !1;
	#m = !1;
	constructor() {
		yt === null ? yt = this : (yt.#n = this, this.#t = yt), yt = this;
	}
	#h() {
		if (this.is_fork) return !0;
		for (let n of this.#o.keys()) {
			for (var e = n, t = !1; e.parent !== null;) {
				if (this.#f.has(e)) {
					t = !0;
					break;
				}
				e = e.parent;
			}
			if (!t) return !0;
		}
		return !1;
	}
	skip_effect(e) {
		this.#f.has(e) || this.#f.set(e, {
			d: [],
			m: []
		}), this.#p.delete(e);
	}
	unskip_effect(e, t = (e) => this.schedule(e)) {
		var n = this.#f.get(e);
		if (n) {
			this.#f.delete(e);
			for (var r of n.d) k(r, y), t(r);
			for (r of n.m) k(r, b), t(r);
		}
		this.#p.add(e);
	}
	#g() {
		this.#e = !0, Et++ > 1e3 && (this.#x(), kt());
		for (let e of this.#u) this.#d.delete(e), k(e, y), this.schedule(e);
		for (let e of this.#d) k(e, b), this.schedule(e);
		let t = this.#c;
		this.#c = [], this.apply();
		var n = wt = [], r = [], i = Tt = [];
		for (let e of t) try {
			this.#_(e, n, r);
		} catch (t) {
			throw Pt(e), this.#h() || this.discard(), t;
		}
		if (j = null, i.length > 0) {
			var a = e.ensure();
			for (let e of i) a.schedule(e);
		}
		if (wt = null, Tt = null, this.#h()) {
			this.#b(r), this.#b(n);
			for (let [e, t] of this.#f) Nt(e, t);
			i.length > 0 && j.#g();
			return;
		}
		let o = this.#v();
		if (o) {
			this.#b(r), this.#b(n), o.#y(this);
			return;
		}
		this.#u.clear(), this.#d.clear();
		for (let e of this.#r) e(this);
		this.#r.clear(), bt = this, jt(r), jt(n), bt = null, this.#s?.resolve();
		var s = j;
		if (this.#a === 0 && (this.#c.length === 0 || s !== null) && this.#x(), this.#c.length > 0) {
			if (s !== null) {
				let e = s;
				e.#c.push(...this.#c.filter((t) => !e.#c.includes(t)));
			} else s = this;
		}
		s !== null && s.#g();
	}
	#_(e, t, n) {
		e.f ^= v;
		for (var r = e.first; r !== null;) {
			var i = r.f, a = !!(i & 96);
			if (!(a && i & 1024 || i & 8192 || this.#f.has(r)) && r.fn !== null) {
				a ? r.f ^= v : i & 4 ? t.push(r) : Vn(r) && (i & 16 && this.#d.add(r), Kn(r));
				var o = r.first;
				if (o !== null) {
					r = o;
					continue;
				}
			}
			for (; r !== null;) {
				var s = r.next;
				if (s !== null) {
					r = s;
					break;
				}
				r = r.parent;
			}
		}
	}
	#v() {
		for (var e = this.#t; e !== null;) {
			if (!e.is_fork) {
				for (let [t, [, n]] of this.current) if (e.current.has(t) && !n) return e;
			}
			e = e.#t;
		}
		return null;
	}
	#y(e) {
		for (let [t, n] of e.current) !this.previous.has(t) && e.previous.has(t) && this.previous.set(t, e.previous.get(t)), this.current.set(t, n);
		for (let [t, n] of e.async_deriveds) {
			let e = this.async_deriveds.get(t);
			e && n.promise.then(e.resolve).catch(e.reject);
		}
		e.async_deriveds.clear(), this.transfer_effects(e.#u, e.#d);
		let t = (e) => {
			var n = e.reactions;
			if (n !== null && !(e.f & 2 && !(e.f & 6144))) for (let e of n) {
				var r = e.f;
				if (r & 2) t(e);
				else {
					var i = e;
					r & 4194320 && !this.async_deriveds.has(i) && (this.#d.delete(i), k(i, y), this.schedule(i));
				}
			}
		};
		for (let e of this.current.keys()) t(e);
		this.oncommit(() => e.discard()), e.#x(), j = this, this.#g();
	}
	#b(e) {
		for (var t = 0; t < e.length; t += 1) Qe(e[t], this.#u, this.#d);
	}
	capture(e, n, r = !1) {
		e.v !== t && !this.previous.has(e) && this.previous.set(e, e.v), e.f & 8388608 || (this.current.set(e, [n, r]), M?.set(e, n)), this.is_fork || (e.v = n);
	}
	activate() {
		j = this;
	}
	deactivate() {
		j = null, M = null;
	}
	flush() {
		try {
			Ct = !0, j = this, this.#g();
		} finally {
			Et = 0, xt = null, wt = null, Tt = null, Ct = !1, j = null, M = null, It.clear();
		}
	}
	discard() {
		for (let e of this.#i) e(this);
		this.#i.clear();
		for (let e of this.async_deriveds.values()) e.reject(dt);
		this.#x(), this.#s?.resolve();
	}
	register_created_effect(e) {
		this.#l.push(e);
	}
	increment(e, t) {
		if (this.#a += 1, e) {
			let e = this.#o.get(t) ?? 0;
			this.#o.set(t, e + 1);
		}
	}
	decrement(e, t) {
		if (--this.#a, e) {
			let e = this.#o.get(t) ?? 0;
			e === 1 ? this.#o.delete(t) : this.#o.set(t, e - 1);
		}
		this.#m || (this.#m = !0, Ge(() => {
			this.#m = !1, this.linked && this.flush();
		}));
	}
	transfer_effects(e, t) {
		for (let t of e) this.#u.add(t);
		for (let e of t) this.#d.add(e);
		e.clear(), t.clear();
	}
	oncommit(e) {
		this.#r.add(e);
	}
	ondiscard(e) {
		this.#i.add(e);
	}
	settled() {
		return (this.#s ??= _()).promise;
	}
	static ensure() {
		if (j === null) {
			let t = j = new e();
			!Ct && !St && Ge(() => {
				t.#e || t.flush();
			});
		}
		return j;
	}
	apply() {
		M = null;
	}
	schedule(e) {
		if (xt = e, e.b?.is_pending && e.f & 16777228 && !(e.f & 32768)) {
			e.b.defer_effect(e);
			return;
		}
		for (var t = e; t.parent !== null;) {
			t = t.parent;
			var n = t.f;
			if (wt !== null && t === W && (H === null || !(H.f & 2))) return;
			if (n & 96) {
				if (!(n & 1024)) return;
				t.f ^= v;
			}
		}
		this.#c.push(t);
	}
	#x() {
		if (this.linked) {
			var e = this.#t, t = this.#n;
			e === null || (e.#n = t), t === null ? yt = e : t.#t = e, this.linked = !1;
		}
	}
};
function N(e) {
	var t = St;
	St = !0;
	try {
		var n;
		for (e && (j !== null && !j.is_fork && j.flush(), n = e());;) {
			if (Ke(), j === null) return n;
			j.flush();
		}
	} finally {
		St = t;
	}
}
function kt() {
	try {
		ye();
	} catch (e) {
		Je(e, xt);
	}
}
var At = null;
function jt(e) {
	var t = e.length;
	if (t !== 0) {
		for (var n = 0; n < t;) {
			var r = e[n++];
			if (!(r.f & 24576) && Vn(r) && (At = /* @__PURE__ */ new Set(), Kn(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && xn(r), At?.size > 0)) {
				It.clear();
				for (let e of At) {
					if (e.f & 24576) continue;
					let t = [e], n = e.parent;
					for (; n !== null;) At.has(n) && (At.delete(n), t.push(n)), n = n.parent;
					for (let e = t.length - 1; e >= 0; e--) {
						let n = t[e];
						n.f & 24576 || Kn(n);
					}
				}
				At.clear();
			}
		}
		At = null;
	}
}
function Mt(e) {
	j.schedule(e);
}
function Nt(e, t) {
	if (!(e.f & 32 && e.f & 1024)) {
		e.f & 2048 ? t.d.push(e) : e.f & 4096 && t.m.push(e), k(e, v);
		for (var n = e.first; n !== null;) Nt(n, t), n = n.next;
	}
}
function Pt(e) {
	k(e, v);
	for (var t = e.first; t !== null;) Pt(t), t = t.next;
}
//#endregion
//#region node_modules/svelte/src/internal/client/reactivity/sources.js
var Ft = /* @__PURE__ */ new Set(), It = /* @__PURE__ */ new Map(), Lt = !1;
function Rt(e, t) {
	return {
		f: 0,
		v: e,
		reactions: null,
		equals: Fe,
		rv: 0,
		wv: 0
	};
}
/*#__NO_SIDE_EFFECTS__*/
function zt(e, t) {
	let n = Rt(e, t);
	return Pn(n), n;
}
/*#__NO_SIDE_EFFECTS__*/
function Bt(e, t = !1, n = !0) {
	let r = Rt(e);
	return t || (r.equals = Le), r;
}
function P(e, t, n = !1) {
	return H !== null && (!jn || H.f & 131072) && He() && H.f & 4325394 && (Nn === null || !Nn.has(e)) && we(), Vt(e, n ? Gt(t) : t, Tt);
}
function Vt(e, t, n = null) {
	if (!e.equals(t)) {
		It.set(e, kn ? t : e.v);
		var r = Ot.ensure();
		if (r.capture(e, t), e.f & 2) {
			let t = e;
			e.f & 2048 && ht(t), M === null && Xe(t);
		}
		e.wv = Bn(), Wt(e, y, n), He() && W !== null && W.f & 1024 && !(W.f & 96) && (q === null ? Fn([e]) : q.push(e)), !r.is_fork && Ft.size > 0 && !Lt && Ht();
	}
	return t;
}
function Ht() {
	Lt = !1;
	for (let e of Ft) {
		e.f & 1024 && k(e, b);
		let t;
		try {
			t = Vn(e);
		} catch {
			t = !0;
		}
		t && Kn(e);
	}
	Ft.clear();
}
function Ut(e) {
	P(e, e.v + 1);
}
function Wt(e, t, n) {
	var r = e.reactions;
	if (r !== null) for (var i = He(), a = r.length, o = 0; o < a; o++) {
		var s = r[o], c = s.f;
		if (!(!i && s === W)) {
			var l = (c & y) === 0;
			if (l && k(s, t), c & 131072) Ft.add(s);
			else if (c & 2) {
				var u = s;
				M?.delete(u), c & 65536 || (c & 512 && (W === null || !(W.f & 2097152)) && (s.f |= ie), Wt(u, b, n));
			} else if (l) {
				var d = s;
				c & 16 && At !== null && At.add(d), n === null ? Mt(d) : n.push(d);
			}
		}
	}
}
function Gt(e) {
	if (typeof e != "object" || !e || ce in e) return e;
	let n = p(e);
	if (n !== d && n !== f) return e;
	var i = /* @__PURE__ */ new Map(), a = r(e), o = /* @__PURE__ */ zt(0), s = null, c = Rn, u = (e) => {
		if (Rn === c) return e();
		var t = H, n = Rn;
		U(null), zn(c);
		var r = e();
		return U(t), zn(n), r;
	};
	return a && i.set("length", /* @__PURE__ */ zt(e.length, s)), new Proxy(e, {
		defineProperty(e, t, n) {
			(!("value" in n) || n.configurable === !1 || n.enumerable === !1 || n.writable === !1) && Se();
			var r = i.get(t);
			return r === void 0 ? u(() => {
				var e = /* @__PURE__ */ zt(n.value, s);
				return i.set(t, e), e;
			}) : P(r, n.value, !0), !0;
		},
		deleteProperty(e, n) {
			var r = i.get(n);
			if (r === void 0) {
				if (n in e) {
					let e = u(() => /* @__PURE__ */ zt(t, s));
					i.set(n, e), Ut(o);
				}
			} else P(r, t), Ut(o);
			return !0;
		},
		get(n, r, a) {
			if (r === ce) return e;
			var o = i.get(r), c = r in n;
			if (o === void 0 && (!c || l(n, r)?.writable) && (o = u(() => /* @__PURE__ */ zt(Gt(c ? n[r] : t), s)), i.set(r, o)), o !== void 0) {
				var d = J(o);
				return d === t ? void 0 : d;
			}
			return Reflect.get(n, r, a);
		},
		getOwnPropertyDescriptor(e, n) {
			var r = Reflect.getOwnPropertyDescriptor(e, n);
			if (r && "value" in r) {
				var a = i.get(n);
				a && (r.value = J(a));
			} else if (r === void 0) {
				var o = i.get(n), s = o?.v;
				if (o !== void 0 && s !== t) return {
					enumerable: !0,
					configurable: !0,
					value: s,
					writable: !0
				};
			}
			return r;
		},
		has(e, n) {
			if (n === ce) return !0;
			var r = i.get(n), a = r !== void 0 && r.v !== t || Reflect.has(e, n);
			return (r !== void 0 || W !== null && (!a || l(e, n)?.writable)) && (r === void 0 && (r = u(() => /* @__PURE__ */ zt(a ? Gt(e[n]) : t, s)), i.set(n, r)), J(r) === t) ? !1 : a;
		},
		set(e, n, r, c) {
			var d = i.get(n), f = n in e;
			if (a && n === "length") for (var p = r; p < d.v; p += 1) {
				var m = i.get(p + "");
				m === void 0 ? p in e && (m = u(() => /* @__PURE__ */ zt(t, s)), i.set(p + "", m)) : P(m, t);
			}
			if (d === void 0) (!f || l(e, n)?.writable) && (d = u(() => /* @__PURE__ */ zt(void 0, s)), P(d, Gt(r)), i.set(n, d));
			else {
				f = d.v !== t;
				var h = u(() => Gt(r));
				P(d, h);
			}
			var g = Reflect.getOwnPropertyDescriptor(e, n);
			if (g?.set && g.set.call(c, r), !f) {
				if (a && typeof n == "string") {
					var _ = i.get("length"), v = Number(n);
					Number.isInteger(v) && v >= _.v && P(_, v + 1);
				}
				Ut(o);
			}
			return !0;
		},
		ownKeys(e) {
			J(o);
			var n = Reflect.ownKeys(e).filter((e) => {
				var n = i.get(e);
				return n === void 0 || n.v !== t;
			});
			for (var [r, a] of i) a.v !== t && !(r in e) && n.push(r);
			return n;
		},
		setPrototypeOf() {
			Ce();
		}
	});
}
function Kt(e) {
	try {
		if (typeof e == "object" && e && ce in e) return e[ce];
	} catch {}
	return e;
}
function qt(e, t) {
	return Object.is(Kt(e), Kt(t));
}
var Jt, Yt, Xt, Zt;
function Qt() {
	if (Jt === void 0) {
		Jt = window, Yt = /Firefox/.test(navigator.userAgent);
		var e = Element.prototype, t = Node.prototype, n = Text.prototype;
		Xt = l(t, "firstChild").get, Zt = l(t, "nextSibling").get, m(e) && (e[fe] = void 0, e[de] = null, e[pe] = void 0, e.__e = void 0), m(n) && (n[me] = void 0);
	}
}
function F(e = "") {
	return document.createTextNode(e);
}
/*@__NO_SIDE_EFFECTS__*/
function I(e) {
	return Xt.call(e);
}
/*@__NO_SIDE_EFFECTS__*/
function $t(e) {
	return Zt.call(e);
}
function L(e, t) {
	if (!T) return /* @__PURE__ */ I(e);
	var n = /* @__PURE__ */ I(E);
	if (n === null) n = E.appendChild(F());
	else if (t && n.nodeType !== 3) {
		var r = F();
		return n?.before(r), D(r), r;
	}
	return t && an(n), D(n), n;
}
function en(e, t = !1) {
	if (!T) {
		var n = /* @__PURE__ */ I(e);
		return n instanceof Comment && n.data === "" ? /* @__PURE__ */ $t(n) : n;
	}
	if (t) {
		if (E?.nodeType !== 3) {
			var r = F();
			return E?.before(r), D(r), r;
		}
		an(E);
	}
	return E;
}
function R(e, t = 1, n = !1) {
	let r = T ? E : e;
	for (var i; t--;) i = r, r = /* @__PURE__ */ $t(r);
	if (!T) return r;
	if (n) {
		if (r?.nodeType !== 3) {
			var a = F();
			return r === null ? i?.after(a) : r.before(a), D(a), a;
		}
		an(r);
	}
	return D(r), r;
}
function tn(e) {
	e.textContent = "";
}
function nn() {
	return !1;
}
function rn(e, t, n) {
	return t == null || t === "http://www.w3.org/1999/xhtml" ? n ? document.createElement(e, { is: n }) : document.createElement(e) : n ? document.createElementNS(t, e, { is: n }) : document.createElementNS(t, e);
}
function an(e) {
	if (e.nodeValue.length < 65536) return;
	let t = e.nextSibling;
	for (; t !== null && t.nodeType === 3;) t.remove(), e.nodeValue += t.nodeValue, t = e.nextSibling;
}
//#endregion
//#region node_modules/svelte/src/internal/client/reactivity/effects.js
function on(e, t) {
	var n = t.last;
	n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
}
function sn(e, t) {
	var n = W;
	n !== null && n.f & 8192 && (e |= x);
	var r = {
		ctx: Re,
		deps: null,
		nodes: null,
		f: e | y | 512,
		first: null,
		fn: t,
		last: null,
		next: null,
		parent: n,
		b: n && n.b,
		prev: null,
		teardown: null,
		wv: 0,
		ac: null
	};
	j?.register_created_effect(r);
	var i = r;
	if (e & 4) wt === null ? Ot.ensure().schedule(r) : wt.push(r);
	else if (t !== null) {
		try {
			Kn(r);
		} catch (e) {
			throw V(r), e;
		}
		i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && !(i.f & 524288) && (i = i.first, e & 16 && e & 65536 && i !== null && (i.f |= w));
	}
	if (i !== null && (i.parent = n, n !== null && on(i, n), H !== null && H.f & 2 && !(e & 64))) {
		var a = H;
		(a.effects ??= []).push(i);
	}
	return r;
}
function cn() {
	return H !== null && !jn;
}
function ln(e) {
	let t = sn(8, null);
	return k(t, v), t.teardown = e, t;
}
function un(e) {
	return sn(4 | ne, e);
}
function dn(e) {
	Ot.ensure();
	let t = sn(64 | te, e);
	return () => {
		V(t);
	};
}
function fn(e) {
	Ot.ensure();
	let t = sn(64 | te, e);
	return (e = {}) => new Promise((n) => {
		e.outro ? Sn(t, () => {
			V(t), n(void 0);
		}) : (V(t), n(void 0));
	});
}
function pn(e) {
	return sn(4, e);
}
function mn(e) {
	return sn(oe | te, e);
}
function hn(e, t = 0) {
	return sn(8 | t, e);
}
function z(e, t = [], n = [], r = []) {
	ot(r, t, n, (t) => {
		sn(8, () => {
			e(...t.map(J));
		});
	});
}
function gn(e, t = 0) {
	return sn(16 | t, e);
}
function B(e) {
	return sn(32 | te, e);
}
function _n(e) {
	var t = e.teardown;
	if (t !== null) {
		let e = kn, n = H;
		An(!0), U(null);
		try {
			t.call(null);
		} finally {
			An(e), U(n);
		}
	}
}
function vn(e, t = !1) {
	var n = e.first;
	for (e.first = e.last = null; n !== null;) {
		let e = n.ac;
		e !== null && tt(() => {
			e.abort(he);
		});
		var r = n.next;
		n.f & 64 ? n.parent = null : V(n, t), n = r;
	}
}
function yn(e) {
	for (var t = e.first; t !== null;) {
		var n = t.next;
		t.f & 32 || V(t), t = n;
	}
}
function V(e, t = !0) {
	var n = !1;
	(t || e.f & 262144) && e.nodes !== null && e.nodes.end !== null && (bn(e.nodes.start, e.nodes.end), n = !0), e.f |= C, vn(e, t && !n), Gn(e, 0);
	var r = e.nodes && e.nodes.t;
	if (r !== null) for (let e of r) e.stop();
	_n(e), e.f ^= C, e.f |= S;
	var i = e.parent;
	i !== null && i.first !== null && xn(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
}
function bn(e, t) {
	for (; e !== null;) {
		var n = e === t ? null : /* @__PURE__ */ $t(e);
		e.remove(), e = n;
	}
}
function xn(e) {
	var t = e.parent, n = e.prev, r = e.next;
	n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
}
function Sn(e, t, n = !0) {
	var r = [];
	Cn(e, r, !0);
	var i = () => {
		n && V(e), t && t();
	}, a = r.length;
	if (a > 0) {
		var o = () => --a || i();
		for (var s of r) s.out(o);
	} else i();
}
function Cn(e, t, n) {
	if (!(e.f & 8192)) {
		e.f ^= x;
		var r = e.nodes && e.nodes.t;
		if (r !== null) for (let e of r) (e.is_global || n) && t.push(e);
		for (var i = e.first; i !== null;) {
			var a = i.next;
			if (!(i.f & 64)) {
				var o = !!(i.f & 65536) || !!(i.f & 32) && !!(e.f & 16);
				Cn(i, t, o ? n : !1);
			}
			i = a;
		}
	}
}
function wn(e) {
	Tn(e, !0);
}
function Tn(e, t) {
	if (e.f & 8192) {
		e.f ^= x, e.f & 1024 || (k(e, y), Ot.ensure().schedule(e));
		for (var n = e.first; n !== null;) {
			var r = n.next, i = !!(n.f & 65536) || !!(n.f & 32);
			Tn(n, i ? t : !1), n = r;
		}
		var a = e.nodes && e.nodes.t;
		if (a !== null) for (let e of a) (e.is_global || t) && e.in();
	}
}
function En(e, t) {
	if (e.nodes) for (var n = e.nodes.start, r = e.nodes.end; n !== null;) {
		var i = n === r ? null : /* @__PURE__ */ $t(n);
		t.append(n), n = i;
	}
}
//#endregion
//#region node_modules/svelte/src/internal/client/legacy.js
var Dn = null, On = !1, kn = !1;
function An(e) {
	kn = e;
}
var H = null, jn = !1;
function U(e) {
	H = e;
}
var W = null;
function Mn(e) {
	W = e;
}
var Nn = null;
function Pn(e) {
	H !== null && (Nn ??= /* @__PURE__ */ new Set()).add(e);
}
var G = null, K = 0, q = null;
function Fn(e) {
	q = e;
}
var In = 1, Ln = 0, Rn = Ln;
function zn(e) {
	Rn = e;
}
function Bn() {
	return ++In;
}
function Vn(e) {
	var t = e.f;
	if (t & 2048) return !0;
	if (t & 2 && (e.f &= ~ie), t & 4096) {
		for (var n = e.deps, r = n.length, i = 0; i < r; i++) {
			var a = n[i];
			if (Vn(a) && gt(a), a.wv > e.wv) return !0;
		}
		t & 512 && M === null && k(e, v);
	}
	return !1;
}
function Hn(e, t, n = !0) {
	var r = e.reactions;
	if (r !== null && !(Nn !== null && Nn.has(e))) for (var i = 0; i < r.length; i++) {
		var a = r[i];
		a.f & 2 ? Hn(a, t, !1) : t === a && (n ? k(a, y) : a.f & 1024 && k(a, b), Mt(a));
	}
}
function Un(e) {
	var t = G, n = K, r = q, i = H, a = Nn, o = Re, s = jn, c = Rn, l = e.f;
	G = null, K = 0, q = null, H = l & 96 ? null : e, Nn = null, ze(e.ctx), jn = !1, Rn = ++Ln, e.ac !== null && (tt(() => {
		e.ac.abort(he);
	}), e.ac = null);
	try {
		e.f |= ae;
		var u = e.fn, d = u();
		e.f |= ee;
		var f = e.deps, p = j?.is_fork;
		if (G !== null) {
			var m;
			if (p || Gn(e, K), f !== null && K > 0) for (f.length = K + G.length, m = 0; m < G.length; m++) f[K + m] = G[m];
			else e.deps = f = G;
			if (cn() && e.f & 512) for (m = K; m < f.length; m++) (f[m].reactions ??= []).push(e);
		} else !p && f !== null && K < f.length && (Gn(e, K), f.length = K);
		if (He() && q !== null && !jn && f !== null && !(e.f & 6146)) for (m = 0; m < q.length; m++) Hn(q[m], e);
		if (i !== null && i !== e) {
			if (Ln++, i.deps !== null) for (let e = 0; e < n; e += 1) i.deps[e].rv = Ln;
			if (t !== null) for (let e of t) e.rv = Ln;
			q !== null && (r === null ? r = q : r.push(...q));
		}
		return e.f & 8388608 && (e.f ^= se), d;
	} catch (e) {
		return qe(e);
	} finally {
		e.f ^= ae, G = t, K = n, q = r, H = i, Nn = a, ze(o), jn = s, Rn = c;
	}
}
function Wn(e, n) {
	let r = n.reactions;
	if (r !== null) {
		var o = i.call(r, e);
		if (o !== -1) {
			var s = r.length - 1;
			s === 0 ? r = n.reactions = null : (r[o] = r[s], r.pop());
		}
	}
	if (r === null && n.f & 2 && (G === null || !a.call(G, n))) {
		var c = n;
		c.f & 512 && (c.f ^= 512, c.f &= ~ie), c.v !== t && Xe(c), c.ac !== null && tt(() => {
			c.ac.abort(he), c.ac = null, k(c, y);
		}), _t(c), Gn(c, 0);
	}
}
function Gn(e, t) {
	var n = e.deps;
	if (n !== null) for (var r = t; r < n.length; r++) Wn(e, n[r]);
}
function Kn(e) {
	var t = e.f;
	if (!(t & 16384)) {
		k(e, v);
		var n = W, r = On;
		W = e, On = !(t & 96);
		try {
			t & 16777232 ? yn(e) : vn(e), _n(e);
			var i = Un(e);
			e.teardown = typeof i == "function" ? i : null, e.wv = In;
		} finally {
			On = r, W = n;
		}
	}
}
function J(e) {
	var t = !!(e.f & 2);
	if (Dn?.add(e), H !== null && !jn && !(W !== null && W.f & 16384) && (Nn === null || !Nn.has(e))) {
		var n = H.deps;
		if (H.f & 2097152) e.rv < Ln && (e.rv = Ln, G === null && n !== null && n[K] === e ? K++ : G === null ? G = [e] : G.push(e));
		else {
			H.deps ??= [], a.call(H.deps, e) || H.deps.push(e);
			var r = e.reactions;
			r === null ? e.reactions = [H] : a.call(r, H) || r.push(H);
		}
	}
	if (kn && It.has(e)) return It.get(e);
	if (t) {
		var i = e;
		if (kn) {
			var o = i.v;
			return (!(i.f & 1024) && i.reactions !== null || Jn(i)) && (o = ht(i)), It.set(i, o), o;
		}
		var s = !(i.f & 512) && !jn && H !== null && (On || !!(H.f & 512)), c = (i.f & ee) === 0;
		Vn(i) && (s && (i.f |= 512), gt(i)), s && !c && (vt(i), qn(i));
	}
	if (M?.has(e)) return M.get(e);
	if (e.f & 8388608) throw e.v;
	return e.v;
}
function qn(e) {
	if (e.f |= 512, e.deps !== null) for (let t of e.deps) (t.reactions ??= []).push(e), t.f & 2 && !(t.f & 512) && (vt(t), qn(t));
}
function Jn(e) {
	if (e.v === t) return !0;
	if (e.deps === null) return !1;
	for (let t of e.deps) if (It.has(t) || t.f & 2 && Jn(t)) return !0;
	return !1;
}
function Yn(e) {
	var t = jn;
	try {
		return jn = !0, e();
	} finally {
		jn = t;
	}
}
function Xn(e) {
	if (!(typeof e != "object" || !e || e instanceof EventTarget)) {
		if (ce in e) Zn(e);
		else if (!Array.isArray(e)) for (let t in e) {
			let n = e[t];
			typeof n == "object" && n && ce in n && Zn(n);
		}
	}
}
function Zn(e, t = /* @__PURE__ */ new Set()) {
	if (typeof e == "object" && e && !(e instanceof EventTarget) && !t.has(e)) {
		t.add(e), e instanceof Date && e.getTime();
		for (let n in e) try {
			Zn(e[n], t);
		} catch {}
		let n = p(e);
		if (n !== Object.prototype && n !== Array.prototype && n !== Map.prototype && n !== Set.prototype && n !== Date.prototype) {
			let t = u(n);
			for (let n in t) {
				let r = t[n].get;
				if (r) try {
					r.call(e);
				} catch {}
			}
		}
	}
}
//#endregion
//#region node_modules/svelte/src/internal/client/dom/elements/events.js
var Qn = Symbol("events"), $n = /* @__PURE__ */ new Set(), er = /* @__PURE__ */ new Set();
function tr(e, t, n) {
	(t[Qn] ??= {})[e] = n;
}
function nr(e) {
	for (var t = 0; t < e.length; t++) $n.add(e[t]);
	for (var n of er) n(e);
}
var rr = null;
function ir(e) {
	var t = this, n = t.ownerDocument, r = e.type, i = e.composedPath?.() || [], a = i[0] || e.target;
	rr = e;
	var o = 0, s = rr === e && e[Qn];
	if (s) {
		var l = i.indexOf(s);
		if (l !== -1 && (t === document || t === window)) {
			e[Qn] = t;
			return;
		}
		var u = i.indexOf(t);
		if (u === -1) return;
		l <= u && (o = l);
	}
	if (a = i[o] || e.target, a !== t) {
		c(e, "currentTarget", {
			configurable: !0,
			get() {
				return a || n;
			}
		});
		var d = H, f = W;
		U(null), Mn(null);
		try {
			for (var p, m = []; a !== null && a !== t;) {
				try {
					var h = a[Qn]?.[r];
					h != null && (!a.disabled || e.target === a) && h.call(a, e);
				} catch (e) {
					p ? m.push(e) : p = e;
				}
				if (e.cancelBubble) break;
				o++, a = o < i.length ? i[o] : null;
			}
			if (p) {
				for (let e of m) queueMicrotask(() => {
					throw e;
				});
				throw p;
			}
		} finally {
			e[Qn] = t, delete e.currentTarget, U(d), Mn(f);
		}
	}
}
//#endregion
//#region node_modules/svelte/src/internal/client/dom/reconciler.js
var ar = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
function or(e) {
	return ar?.createHTML(e) ?? e;
}
function sr(e) {
	var t = rn("template");
	return t.innerHTML = or(e.replaceAll("<!>", "<!---->")), t.content;
}
//#endregion
//#region node_modules/svelte/src/internal/client/dom/template.js
function cr(e, t) {
	var n = W;
	n.nodes === null && (n.nodes = {
		start: e,
		end: t,
		a: null,
		t: null
	});
}
/*#__NO_SIDE_EFFECTS__*/
function Y(e, t) {
	var n = !!(t & 1), r = !!(t & 2), i, a = !e.startsWith("<!>");
	return () => {
		if (T) return cr(E, null), E;
		i === void 0 && (i = sr(a ? e : "<!>" + e), n || (i = /* @__PURE__ */ I(i)));
		var t = r || Yt ? document.importNode(i, !0) : i.cloneNode(!0);
		if (n) {
			var o = /* @__PURE__ */ I(t), s = t.lastChild;
			cr(o, s);
		} else cr(t, t);
		return t;
	};
}
/*#__NO_SIDE_EFFECTS__*/
function lr(e, t, n = "svg") {
	var r = !e.startsWith("<!>"), i = !!(t & 1), a = `<${n}>${r ? e : "<!>" + e}</${n}>`, o;
	return () => {
		if (T) return cr(E, null), E;
		if (!o) {
			var e = /* @__PURE__ */ I(sr(a));
			if (i) for (o = document.createDocumentFragment(); /* @__PURE__ */ I(e);) o.appendChild(/* @__PURE__ */ I(e));
			else o = /* @__PURE__ */ I(e);
		}
		var t = o.cloneNode(!0);
		if (i) {
			var n = /* @__PURE__ */ I(t), r = t.lastChild;
			cr(n, r);
		} else cr(t, t);
		return t;
	};
}
/*#__NO_SIDE_EFFECTS__*/
function ur(e, t) {
	return /* @__PURE__ */ lr(e, t, "svg");
}
function dr() {
	if (T) return cr(E, null), E;
	var e = document.createDocumentFragment(), t = document.createComment(""), n = F();
	return e.append(t, n), cr(t, n), e;
}
function X(e, t) {
	if (T) {
		var n = W;
		(!(n.f & 32768) || n.nodes.end === null) && (n.nodes.end = E), je();
		return;
	}
	e !== null && e.before(t);
}
[.../* @__PURE__ */ "allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback".split(".")];
var fr = ["touchstart", "touchmove"];
function pr(e) {
	return fr.includes(e);
}
function Z(e, t) {
	var n = t == null ? "" : typeof t == "object" ? `${t}` : t;
	n !== (e[me] ??= e.nodeValue) && (e[me] = n, e.nodeValue = `${n}`);
}
function mr(e, t) {
	return _r(e, t);
}
function hr(t, n) {
	Qt(), n.intro = n.intro ?? !1;
	let r = n.target, i = T, a = E;
	try {
		for (var o = /* @__PURE__ */ I(r); o && (o.nodeType !== 8 || o.data !== "[");) o = /* @__PURE__ */ $t(o);
		if (!o) throw e;
		Ae(!0), D(o);
		let i = _r(t, {
			...n,
			anchor: o
		});
		return Ae(!1), i;
	} catch (i) {
		if (i instanceof Error && i.message.split("\n").some((e) => e.startsWith("https://svelte.dev/e/"))) throw i;
		return i !== e && console.warn("Failed to hydrate: ", i), n.recover === !1 && be(), Qt(), tn(r), Ae(!1), mr(t, n);
	} finally {
		Ae(i), D(a);
	}
}
var gr = /* @__PURE__ */ new Map();
function _r(t, { target: n, anchor: r, props: i = {}, events: a, context: s, intro: c = !0, transformError: l }) {
	Qt();
	var u = void 0, d = fn(() => {
		var c = r ?? n.appendChild(F());
		it(c, { pending: () => {} }, (n) => {
			Be({});
			var r = Re;
			if (s && (r.c = s), a && (i.$$events = a), T && cr(n, null), u = t(n, i) || {}, T && (W.nodes.end = E, E === null || E.nodeType !== 8 || E.data !== "]")) throw De(), e;
			Ve();
		}, l);
		var d = /* @__PURE__ */ new Set(), f = (e) => {
			for (var t = 0; t < e.length; t++) {
				var r = e[t];
				if (!d.has(r)) {
					d.add(r);
					var i = pr(r);
					for (let e of [n, document]) {
						var a = gr.get(e);
						a === void 0 && (a = /* @__PURE__ */ new Map(), gr.set(e, a));
						var o = a.get(r);
						o === void 0 ? (e.addEventListener(r, ir, { passive: i }), a.set(r, 1)) : a.set(r, o + 1);
					}
				}
			}
		};
		return f(o($n)), er.add(f), () => {
			for (var e of d) for (let r of [n, document]) {
				var t = gr.get(r), i = t.get(e);
				--i == 0 ? (r.removeEventListener(e, ir), t.delete(e), t.size === 0 && gr.delete(r)) : t.set(e, i);
			}
			er.delete(f), c !== r && c.parentNode?.removeChild(c);
		};
	});
	return vr.set(u, d), u;
}
var vr = /* @__PURE__ */ new WeakMap();
function yr(e, t) {
	let n = vr.get(e);
	return n ? (vr.delete(e), n(t)) : Promise.resolve();
}
//#endregion
//#region node_modules/svelte/src/internal/client/dom/blocks/branches.js
var br = class {
	anchor;
	#e = /* @__PURE__ */ new Map();
	#t = /* @__PURE__ */ new Map();
	#n = /* @__PURE__ */ new Map();
	#r = /* @__PURE__ */ new Set();
	#i = !0;
	constructor(e, t = !0) {
		this.anchor = e, this.#i = t;
	}
	#a = (e) => {
		if (this.#e.has(e)) {
			var t = this.#e.get(e), n = this.#t.get(t);
			if (n) wn(n), this.#r.delete(t);
			else {
				var r = this.#n.get(t);
				r && (wn(r.effect), this.#t.set(t, r.effect), this.#n.delete(t), r.fragment.lastChild.remove(), this.anchor.before(r.fragment), n = r.effect);
			}
			for (let [t, n] of this.#e) {
				if (this.#e.delete(t), t === e) break;
				let r = this.#n.get(n);
				r && (V(r.effect), this.#n.delete(n));
			}
			for (let [e, r] of this.#t) {
				if (e === t || this.#r.has(e)) continue;
				let i = () => {
					if (Array.from(this.#e.values()).includes(e)) {
						var t = document.createDocumentFragment();
						En(r, t), t.append(F()), this.#n.set(e, {
							effect: r,
							fragment: t
						});
					} else V(r);
					this.#r.delete(e), this.#t.delete(e);
				};
				this.#i || !n ? (this.#r.add(e), Sn(r, i, !1)) : i();
			}
		}
	};
	#o = (e) => {
		this.#e.delete(e);
		let t = Array.from(this.#e.values());
		for (let [e, n] of this.#n) t.includes(e) || (V(n.effect), this.#n.delete(e));
	};
	ensure(e, t) {
		var n = j, r = nn();
		if (t && !this.#t.has(e) && !this.#n.has(e)) {
			if (r) {
				var i = document.createDocumentFragment(), a = F();
				i.append(a), this.#n.set(e, {
					effect: B(() => t(a)),
					fragment: i
				});
			} else this.#t.set(e, B(() => t(this.anchor)));
		}
		if (this.#e.set(n, e), r) {
			for (let [t, r] of this.#t) t === e ? n.unskip_effect(r) : n.skip_effect(r);
			for (let [t, r] of this.#n) t === e ? n.unskip_effect(r.effect) : n.skip_effect(r.effect);
			n.oncommit(this.#a), n.ondiscard(this.#o);
		} else T && (this.anchor = E), this.#a(n);
	}
};
//#endregion
//#region node_modules/svelte/src/internal/client/dom/blocks/if.js
function xr(e, t, n = !1) {
	var r;
	T && (r = E, je());
	var i = new br(e), a = n ? w : 0;
	function o(e, t) {
		if (T) {
			var n = Pe(r);
			if (e !== parseInt(n.substring(1))) {
				var a = Ne();
				D(a), i.anchor = a, Ae(!1), i.ensure(e, t), Ae(!0);
				return;
			}
		}
		i.ensure(e, t);
	}
	gn(() => {
		var e = !1;
		t((t, n = 0) => {
			e = !0, o(n, t);
		}), e || o(-1, null);
	}, a);
}
//#endregion
//#region node_modules/svelte/src/internal/client/dom/blocks/each.js
function Sr(e, t) {
	return t;
}
function Cr(e, t, n) {
	for (var r = [], i = t.length, a, s = t.length, c = 0; c < i; c++) {
		let n = t[c];
		Sn(n, () => {
			if (a) {
				if (a.pending.delete(n), a.done.add(n), a.pending.size === 0) {
					var t = e.outrogroups;
					wr(e, o(a.done)), t.delete(a), t.size === 0 && (e.outrogroups = null);
				}
			} else --s;
		}, !1);
	}
	if (s === 0) {
		var l = r.length === 0 && n !== null && e.pending.size === 0;
		if (l) {
			var u = n, d = u.parentNode;
			tn(d), d.append(u), e.items.clear();
		}
		wr(e, t, !l);
	} else a = {
		pending: new Set(t),
		done: /* @__PURE__ */ new Set()
	}, (e.outrogroups ??= /* @__PURE__ */ new Set()).add(a);
}
function wr(e, t, n = !0) {
	var r;
	if (e.pending.size > 0) {
		r = /* @__PURE__ */ new Set();
		for (let t of e.pending.values()) for (let n of t) r.add(e.items.get(n).e);
	}
	for (var i = 0; i < t.length; i++) {
		var a = t[i];
		r?.has(a) ? (a.f |= re, En(a, document.createDocumentFragment())) : V(t[i], n);
	}
}
var Tr;
function Er(e, t, n, i, a, s = null) {
	var c = e, l = /* @__PURE__ */ new Map();
	if (t & 4) {
		var u = e;
		c = T ? D(/* @__PURE__ */ I(u)) : u.appendChild(F());
	}
	T && je();
	var d = null, f = /* @__PURE__ */ pt(() => {
		var e = n();
		return r(e) ? e : e == null ? [] : o(e);
	}), p, m = /* @__PURE__ */ new Map(), h = !0;
	function g(e) {
		v.effect.f & 16384 || (v.pending.delete(e), v.fallback = d, Or(v, p, c, t, i), d !== null && (p.length === 0 ? d.f & 33554432 ? (d.f ^= re, Ar(d, null, c)) : wn(d) : Sn(d, () => {
			d = null;
		})));
	}
	function _(e) {
		v.pending.delete(e);
	}
	var v = {
		effect: gn(() => {
			p = J(f);
			var e = p.length;
			let r = !1;
			T && Pe(c) === "[!" != (e === 0) && (c = Ne(), D(c), Ae(!1), r = !0);
			for (var o = /* @__PURE__ */ new Set(), u = j, v = nn(), y = 0; y < e; y += 1) {
				T && E.nodeType === 8 && E.data === "]" && (c = E, r = !0, Ae(!1));
				var b = p[y], x = i(b, y), S = h ? null : l.get(x);
				S ? (S.v && Vt(S.v, b), S.i && Vt(S.i, y), v && u.unskip_effect(S.e)) : (S = kr(l, h ? c : Tr ??= F(), b, x, y, a, t, n), h || (S.e.f |= re), l.set(x, S)), o.add(x);
			}
			if (e === 0 && s && !d && (h ? d = B(() => s(c)) : (d = B(() => s(Tr ??= F())), d.f |= re)), e > o.size && ve("", "", ""), T && e > 0 && D(Ne()), !h) {
				if (m.set(u, o), v) {
					for (let [e, t] of l) o.has(e) || u.skip_effect(t.e);
					u.oncommit(g), u.ondiscard(_);
				} else g(u);
			}
			r && Ae(!0), J(f);
		}),
		flags: t,
		items: l,
		pending: m,
		outrogroups: null,
		fallback: d
	};
	h = !1, T && (c = E);
}
function Dr(e) {
	for (; e !== null && !(e.f & 32);) e = e.next;
	return e;
}
function Or(e, t, n, r, i) {
	var a = !!(r & 8), s = t.length, c = e.items, l = Dr(e.effect.first), u, d = null, f, p = [], m = [], h, g, _, v;
	if (a) for (v = 0; v < s; v += 1) h = t[v], g = i(h, v), _ = c.get(g).e, _.f & 33554432 || (_.nodes?.a?.measure(), (f ??= /* @__PURE__ */ new Set()).add(_));
	for (v = 0; v < s; v += 1) {
		if (h = t[v], g = i(h, v), _ = c.get(g).e, e.outrogroups !== null) for (let t of e.outrogroups) t.pending.delete(_), t.done.delete(_);
		if (_.f & 8192 && (wn(_), a && (_.nodes?.a?.unfix(), (f ??= /* @__PURE__ */ new Set()).delete(_))), _.f & 33554432) {
			if (_.f ^= re, _ === l) Ar(_, null, n);
			else {
				var y = d ? d.next : l;
				_ === e.effect.last && (e.effect.last = _.prev), _.prev && (_.prev.next = _.next), _.next && (_.next.prev = _.prev), jr(e, d, _), jr(e, _, y), Ar(_, y, n), d = _, p = [], m = [], l = Dr(d.next);
				continue;
			}
		}
		if (_ !== l) {
			if (u !== void 0 && u.has(_)) {
				if (p.length < m.length) {
					var b = m[0], x;
					d = b.prev;
					var S = p[0], ee = p[p.length - 1];
					for (x = 0; x < p.length; x += 1) Ar(p[x], b, n);
					for (x = 0; x < m.length; x += 1) u.delete(m[x]);
					jr(e, S.prev, ee.next), jr(e, d, S), jr(e, ee, b), l = b, d = ee, --v, p = [], m = [];
				} else u.delete(_), Ar(_, l, n), jr(e, _.prev, _.next), jr(e, _, d === null ? e.effect.first : d.next), jr(e, d, _), d = _;
				continue;
			}
			for (p = [], m = []; l !== null && l !== _;) (u ??= /* @__PURE__ */ new Set()).add(l), m.push(l), l = Dr(l.next);
			if (l === null) continue;
		}
		_.f & 33554432 || p.push(_), d = _, l = Dr(_.next);
	}
	if (e.outrogroups !== null) {
		for (let t of e.outrogroups) t.pending.size === 0 && (wr(e, o(t.done)), e.outrogroups?.delete(t));
		e.outrogroups.size === 0 && (e.outrogroups = null);
	}
	if (l !== null || u !== void 0) {
		var C = [];
		if (u !== void 0) for (_ of u) _.f & 8192 || C.push(_);
		for (; l !== null;) !(l.f & 8192) && l !== e.fallback && C.push(l), l = Dr(l.next);
		var w = C.length;
		if (w > 0) {
			var te = r & 4 && s === 0 ? n : null;
			if (a) {
				for (v = 0; v < w; v += 1) C[v].nodes?.a?.measure();
				for (v = 0; v < w; v += 1) C[v].nodes?.a?.fix();
			}
			Cr(e, C, te);
		}
	}
	a && Ge(() => {
		if (f !== void 0) for (_ of f) _.nodes?.a?.apply();
	});
}
function kr(e, t, n, r, i, a, o, s) {
	var c = o & 1 ? o & 16 ? Rt(n) : /* @__PURE__ */ Bt(n, !1, !1) : null, l = o & 2 ? Rt(i) : null;
	return {
		v: c,
		i: l,
		e: B(() => (a(t, c ?? n, l ?? i, s), () => {
			e.delete(r);
		}))
	};
}
function Ar(e, t, n) {
	if (e.nodes) for (var r = e.nodes.start, i = e.nodes.end, a = t && !(t.f & 33554432) ? t.nodes.start : n; r !== null;) {
		var o = /* @__PURE__ */ $t(r);
		if (a.before(r), r === i) return;
		r = o;
	}
}
function jr(e, t, n) {
	t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t;
}
//#endregion
//#region node_modules/svelte/src/internal/client/dom/elements/actions.js
function Mr(e, t, n) {
	pn(() => {
		var r = Yn(() => t(e, n?.()) || {});
		if (n && r?.update) {
			var i = !1, a = {};
			hn(() => {
				var e = n();
				Xn(e), i && Ie(a, e) && (a = e, r.update(e));
			}), i = !0;
		}
		if (r?.destroy) return () => r.destroy();
	});
}
//#endregion
//#region node_modules/svelte/src/internal/shared/attributes.js
var Nr = [..." 	\n\r\f\xA0\v﻿"];
function Pr(e, t, n) {
	var r = e == null ? "" : "" + e;
	if (t && (r = r ? r + " " + t : t), n) {
		for (var i of Object.keys(n)) if (n[i]) r = r ? r + " " + i : i;
		else if (r.length) for (var a = i.length, o = 0; (o = r.indexOf(i, o)) >= 0;) {
			var s = o + a;
			(o === 0 || Nr.includes(r[o - 1])) && (s === r.length || Nr.includes(r[s])) ? r = (o === 0 ? "" : r.substring(0, o)) + r.substring(s + 1) : o = s;
		}
	}
	return r === "" ? null : r;
}
//#endregion
//#region node_modules/svelte/src/internal/client/dom/elements/class.js
function Fr(e, t, n, r, i, a) {
	var o = e[fe];
	if (T || o !== n || o === void 0) {
		var s = Pr(n, r, a);
		(!T || s !== e.getAttribute("class")) && (s == null ? e.removeAttribute("class") : t ? e.className = s : e.setAttribute("class", s)), e[fe] = n;
	} else if (a && i !== a) for (var c in a) {
		var l = !!a[c];
		(i == null || l !== !!i[c]) && e.classList.toggle(c, l);
	}
	return a;
}
//#endregion
//#region node_modules/svelte/src/internal/client/dom/elements/bindings/select.js
function Ir(e, t, n = !1) {
	if (e.multiple) {
		if (t == null) return;
		if (!r(t)) return Oe();
		for (var i of e.options) i.selected = t.includes(Rr(i));
		return;
	}
	for (i of e.options) if (qt(Rr(i), t)) {
		i.selected = !0;
		return;
	}
	(!n || t !== void 0) && (e.selectedIndex = -1);
}
function Lr(e) {
	var t = new MutationObserver(() => {
		"__value" in e && Ir(e, e.__value);
	});
	t.observe(e, {
		childList: !0,
		subtree: !0,
		attributes: !0,
		attributeFilter: ["value"]
	}), ln(() => {
		t.disconnect();
	});
}
function Rr(e) {
	return "__value" in e ? e.__value : e.value;
}
//#endregion
//#region node_modules/svelte/src/internal/client/dom/elements/attributes.js
var zr = Symbol("is custom element"), Br = Symbol("is html"), Vr = ge ? "link" : "LINK";
function Hr(e, t, n, r) {
	var i = Ur(e);
	T && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === Vr) || i[t] !== (i[t] = n) && (t === "loading" && (e[ue] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && Gr(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
}
function Ur(e) {
	return e[de] ??= {
		[zr]: e.nodeName.includes("-"),
		[Br]: e.namespaceURI === n
	};
}
var Wr = /* @__PURE__ */ new Map();
function Gr(e) {
	var t = e.getAttribute("is") || e.nodeName, n = Wr.get(t);
	if (n) return n;
	Wr.set(t, n = []);
	for (var r, i = e, a = Element.prototype; a !== i;) {
		for (var o in r = u(i), r) r[o].set && o !== "innerHTML" && o !== "textContent" && o !== "innerText" && n.push(o);
		i = p(i);
	}
	return n;
}
//#endregion
//#region node_modules/svelte/src/internal/client/reactivity/props.js
function Kr(e, t, n, r) {
	var i = !0, a = !!(n & 8), o = !!(n & 16), s = r, c = !0, u = void 0, d = () => o && i ? (u ??= /* @__PURE__ */ ut(r), J(u)) : (c && (c = !1, s = o ? Yn(r) : r), s);
	let f;
	if (a) {
		var p = ce in e || le in e;
		f = l(e, t)?.set ?? (p && t in e ? (n) => e[t] = n : void 0);
	}
	var m, h = !1;
	a ? [m, h] = et(() => e[t]) : m = e[t], m === void 0 && r !== void 0 && (m = d(), f && (i && xe(t), f(m)));
	var g = i ? () => {
		var n = e[t];
		return n === void 0 ? d() : (c = !0, n);
	} : () => {
		var n = e[t];
		return n !== void 0 && (s = void 0), n === void 0 ? s : n;
	};
	if (i && !(n & 4)) return g;
	if (f) {
		var _ = e.$$legacy;
		return (function(e, t) {
			return arguments.length > 0 ? ((!i || !t || _ || h) && f(t ? g() : e), e) : g();
		});
	}
	var v = !1, y = (n & 1 ? ut : pt)(() => (v = !1, g()));
	a && J(y);
	var b = W;
	return (function(e, t) {
		if (arguments.length > 0) {
			let n = t ? J(y) : i && a ? Gt(e) : e;
			return P(y, n), v = !0, s !== void 0 && (s = n), e;
		}
		return kn && v || b.f & 16384 ? y.v : J(y);
	});
}
//#endregion
//#region node_modules/svelte/src/legacy/legacy-client.js
function qr(e) {
	return new Jr(e);
}
var Jr = class {
	#e;
	#t;
	constructor(e) {
		var t = /* @__PURE__ */ new Map(), n = (e, n) => {
			var r = /* @__PURE__ */ Bt(n, !1, !1);
			return t.set(e, r), r;
		};
		let r = new Proxy({
			...e.props || {},
			$$events: {}
		}, {
			get(e, r) {
				return J(t.get(r) ?? n(r, Reflect.get(e, r)));
			},
			has(e, r) {
				return r === le || (J(t.get(r) ?? n(r, Reflect.get(e, r))), Reflect.has(e, r));
			},
			set(e, r, i) {
				return P(t.get(r) ?? n(r, i), i), Reflect.set(e, r, i);
			}
		});
		this.#t = (e.hydrate ? hr : mr)(e.component, {
			target: e.target,
			anchor: e.anchor,
			props: r,
			context: e.context,
			intro: e.intro ?? !1,
			recover: e.recover,
			transformError: e.transformError
		}), (!e?.props?.$$host || e.sync === !1) && N(), this.#e = r.$$events;
		for (let e of Object.keys(this.#t)) e !== "$set" && e !== "$destroy" && e !== "$on" && c(this, e, {
			get() {
				return this.#t[e];
			},
			set(t) {
				this.#t[e] = t;
			},
			enumerable: !0
		});
		this.#t.$set = (e) => {
			Object.assign(r, e);
		}, this.#t.$destroy = () => {
			yr(this.#t);
		};
	}
	$set(e) {
		this.#t.$set(e);
	}
	$on(e, t) {
		this.#e[e] = this.#e[e] || [];
		let n = (...e) => t.call(this, ...e);
		return this.#e[e].push(n), () => {
			this.#e[e] = this.#e[e].filter((e) => e !== n);
		};
	}
	$destroy() {
		this.#t.$destroy();
	}
}, Yr;
typeof HTMLElement == "function" && (Yr = class extends HTMLElement {
	$$ctor;
	$$s;
	$$c;
	$$cn = !1;
	$$d = {};
	$$r = !1;
	$$p_d = {};
	$$l = {};
	$$l_u = /* @__PURE__ */ new Map();
	$$me;
	$$shadowRoot = null;
	constructor(e, t, n) {
		super(), this.$$ctor = e, this.$$s = t, n && (this.$$shadowRoot = this.attachShadow(n));
	}
	addEventListener(e, t, n) {
		if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(t), this.$$c) {
			let n = this.$$c.$on(e, t);
			this.$$l_u.set(t, n);
		}
		super.addEventListener(e, t, n);
	}
	removeEventListener(e, t, n) {
		if (super.removeEventListener(e, t, n), this.$$c) {
			let e = this.$$l_u.get(t);
			e && (e(), this.$$l_u.delete(t));
		}
	}
	async connectedCallback() {
		if (this.$$cn = !0, !this.$$c) {
			if (await Promise.resolve(), !this.$$cn || this.$$c) return;
			function e(e) {
				return (t) => {
					let n = rn("slot");
					e !== "default" && (n.name = e), X(t, n);
				};
			}
			let t = {}, n = Zr(this);
			for (let r of this.$$s) r in n && (r === "default" && !this.$$d.children ? (this.$$d.children = e(r), t.default = !0) : t[r] = e(r));
			for (let e of this.attributes) {
				let t = this.$$g_p(e.name);
				t in this.$$d || (this.$$d[t] = Xr(t, e.value, this.$$p_d, "toProp"));
			}
			for (let e in this.$$p_d) !(e in this.$$d) && this[e] !== void 0 && (this.$$d[e] = this[e], delete this[e]);
			this.$$c = qr({
				component: this.$$ctor,
				target: this.$$shadowRoot || this,
				props: {
					...this.$$d,
					$$slots: t,
					$$host: this
				}
			}), this.$$me = dn(() => {
				hn(() => {
					this.$$r = !0;
					for (let e of s(this.$$c)) {
						if (!this.$$p_d[e]?.reflect) continue;
						this.$$d[e] = this.$$c[e];
						let t = Xr(e, this.$$d[e], this.$$p_d, "toAttribute");
						t == null ? this.removeAttribute(this.$$p_d[e].attribute || e) : this.setAttribute(this.$$p_d[e].attribute || e, t);
					}
					this.$$r = !1;
				});
			});
			for (let e in this.$$l) for (let t of this.$$l[e]) {
				let n = this.$$c.$on(e, t);
				this.$$l_u.set(t, n);
			}
			this.$$l = {};
		}
	}
	attributeChangedCallback(e, t, n) {
		this.$$r || (e = this.$$g_p(e), this.$$d[e] = Xr(e, n, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
	}
	disconnectedCallback() {
		this.$$cn = !1, Promise.resolve().then(() => {
			!this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0);
		});
	}
	$$g_p(e) {
		return s(this.$$p_d).find((t) => this.$$p_d[t].attribute === e || !this.$$p_d[t].attribute && t.toLowerCase() === e) || e;
	}
});
function Xr(e, t, n, r) {
	let i = n[e]?.type;
	if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e]) return t;
	if (r === "toAttribute") switch (i) {
		case "Object":
		case "Array": return t == null ? null : JSON.stringify(t);
		case "Boolean": return t ? "" : null;
		case "Number": return t ?? null;
		default: return t;
	}
	else switch (i) {
		case "Object":
		case "Array": return t && JSON.parse(t);
		case "Boolean": return t;
		case "Number": return t == null ? t : +t;
		default: return t;
	}
}
function Zr(e) {
	let t = {};
	return e.childNodes.forEach((e) => {
		t[e.slot || "default"] = !0;
	}), t;
}
function Qr(e, t, n, r, i, a) {
	let o = class extends Yr {
		constructor() {
			super(e, n, i), this.$$p_d = t;
		}
		static get observedAttributes() {
			return s(t).map((e) => (t[e].attribute || e).toLowerCase());
		}
	};
	return s(t).forEach((e) => {
		c(o.prototype, e, {
			get() {
				return this.$$c && e in this.$$c ? this.$$c[e] : this.$$d[e];
			},
			set(n) {
				n = Xr(e, n, t), this.$$d[e] = n;
				var r = this.$$c;
				r && (l(r, e)?.get ? r[e] = n : r.$set({ [e]: n }));
			}
		});
	}), r.forEach((e) => {
		c(o.prototype, e, { get() {
			return this.$$c?.[e];
		} });
	}), a && (o = a(o)), e.element = o, o;
}
//#endregion
//#region src/lib/api/attachments.ts
function $r(e, t, n, r) {
	return `/api/v1/tables/${e}/records/${t}/attachments/${n}/${r}`;
}
function ei(e, t, n, r) {
	return `${$r(e, t, n, r)}/thumbnail`;
}
//#endregion
//#region src/lib/i18n/locale.svelte.ts
var ti = ["de", "en"], ni = "illusiondb-locale", ri = "de", ii = "illusiondb:locale-change";
function ai(e) {
	return ti.includes(e ?? "");
}
function oi() {
	if (typeof localStorage > "u") return ri;
	let e = localStorage.getItem(ni);
	return ai(e) ? e : ri;
}
function si(e) {
	typeof document < "u" && document.documentElement.setAttribute("lang", e);
}
var ci = Gt({ current: ri });
typeof window < "u" && (ci.current = oi(), si(ci.current), window.addEventListener(ii, (e) => {
	let t = e.detail;
	ai(t) && (ci.current = t);
}));
//#endregion
//#region src/lib/i18n/t.ts
var li = {
	de: {
		common: {
			username: "Benutzername",
			password: "Passwort",
			email: "E-Mail",
			name: "Name",
			role: "Rolle",
			createdAt: "Erstellt am",
			updatedAt: "Aktualisiert am",
			pleaseChoose: "Bitte wählen",
			close: "Schließen",
			cancel: "Abbrechen",
			save: "Speichern",
			saving: "Speichert…",
			edit: "Bearbeiten",
			delete: "Löschen",
			deleting: "Löscht…",
			create: "Anlegen",
			creating: "Anlegen…",
			back: "Zurück",
			next: "Weiter",
			remove: "Entfernen",
			errorLoading: "Fehler beim Laden",
			noResults: "Keine Treffer",
			search: "Suchen…",
			refineSearch: "Weitere Treffer – Suche eingrenzen",
			creatingAlt: "Legt an…",
			allDataSources: "Alle Data Sources",
			rangeOfTotal: "{{from}}–{{to}} von {{total}}",
			rangeEmpty: "0 von 0",
			yes: "Ja",
			no: "Nein"
		},
		auth: {
			login: {
				subtitle: "Bitte melde dich an.",
				submit: "Anmelden",
				submitting: "Anmelden…"
			},
			setup: {
				subtitle: "Willkommen! Lege den ersten Administrator-Account an.",
				passwordRepeat: "Passwort wiederholen",
				passwordMismatch: "Die Passwörter stimmen nicht überein.",
				submit: "Administrator anlegen",
				submitting: "Einrichten…"
			}
		},
		nav: {
			connections: "Verbindungen",
			newSqliteDatabase: "Neue SQLite-Datenbank anlegen",
			loading: "Lädt…",
			noTables: "Keine Tabellen",
			noViews: "Keine Ansichten",
			settings: "Einstellungen",
			logout: "Abmelden",
			openMenu: "Menü öffnen",
			collapseSidebar: "Menüleiste einklappen",
			expandSidebar: "Menüleiste ausklappen",
			expand: "{{name}} aufklappen",
			collapse: "{{name}} zuklappen",
			viewOptionsFor: "Optionen für Ansicht {{name}}",
			viewSettings: "Einstellungen",
			viewSettingsTitle: "View-Einstellungen: {{name}}",
			junctionTableChip: "Admin",
			junctionTableHint: "Nur für Admins sichtbar — Junction-Tabelle eines Links-Felds"
		},
		theme: {
			light: "Hell",
			dark: "Dunkel",
			system: "Systemstandard"
		},
		language: {
			label: "Sprache",
			de: "Deutsch",
			en: "Englisch"
		},
		settings: {
			title: "Einstellungen",
			tabs: {
				dataSources: "Data Sources",
				apiDocs: "API-Dokumentation",
				auditLog: "Audit Log",
				files: "Dateien",
				users: "Benutzer",
				groups: "Gruppen",
				scripts: "Skripte",
				documentTemplates: "Dokumenten-Templates",
				myAccount: "Mein Konto"
			},
			users: {
				subtitle: "Alle Benutzerkonten dieser Instanz",
				newUser: "Neuer Benutzer",
				confirmDelete: "Benutzer \"{{email}}\" wirklich löschen?",
				editUser: "Benutzer bearbeiten",
				resetPassword: "Passwort zurücksetzen",
				newPasswordPlaceholder: "Neues Passwort",
				setting: "Setzt…",
				set: "Setzen",
				loadingGroupMembership: "Lädt Gruppenzugehörigkeit…",
				memberOf: "Mitglied von: {{groups}}",
				managedUnderGroups: "— verwaltet unter Einstellungen → Gruppen"
			},
			account: {
				accountSection: "Konto",
				changeEmail: "E-Mail ändern",
				changePasswordSection: "Passwort ändern",
				passwordChanged: "Passwort erfolgreich geändert.",
				currentPassword: "Aktuelles Passwort",
				newPassword: "Neues Passwort",
				changing: "Ändert…",
				changePassword: "Passwort ändern",
				apiTokens: "API-Tokens",
				tokenCreatedNotice: "Token \"{{name}}\" angelegt — wird nur jetzt angezeigt, danach nicht mehr abrufbar:",
				hide: "Ausblenden",
				tokenNamePlaceholder: "z.B. n8n-Workflow",
				createToken: "Token anlegen",
				noTokens: "Noch keine API-Tokens angelegt.",
				lastUsed: "Zuletzt verwendet",
				confirmDeleteToken: "API-Token \"{{name}}\" wirklich löschen?"
			},
			datasources: {
				subtitle: "Verbundene Datenbanken und ihr Sync-Stand",
				newSqliteDatabase: "Neue SQLite-Datenbank",
				newDataSource: "Neue Data Source",
				noneYet: "Noch keine Data Source angelegt.",
				createFirst: "Erste Verbindung anlegen",
				type: "Typ",
				connection: "Verbindung",
				status: "Status",
				lastSync: "Letzter Sync",
				syncing: "Syncing…",
				sync: "Sync",
				confirmDelete: "Data Source \"{{name}}\" wirklich entfernen? Alle zugehörigen Tabellen, Ansichten, Berechtigungen, Webhooks und Anhänge in IllusionDB werden unwiderruflich mitgelöscht. Die externe Datenbank selbst bleibt unverändert.",
				namePlaceholder: "Produktions-CRM",
				filePath: "Datei-Pfad",
				database: "Datenbank",
				user: "Benutzer",
				sslMode: "SSL-Modus"
			},
			files: {
				subtitle: "Alle hochgeladenen Dateien über alle Data Sources hinweg",
				galleryView: "Galerie",
				listView: "Liste",
				allTables: "Alle Tabellen",
				allColumns: "Alle Spalten",
				allFileTypes: "Alle Dateitypen",
				filenamePlaceholder: "Dateiname…",
				filename: "Dateiname",
				tableColumn: "Tabelle.Spalte",
				size: "Größe",
				uploaded: "Hochgeladen",
				noFiles: "Keine Dateien gefunden.",
				confirmDelete: "Datei \"{{name}}\" wirklich löschen?"
			},
			auditLog: {
				subtitle: "Schema-Änderungen (Tabelle/Spalte anlegen/löschen) über alle Data Sources hinweg",
				allActions: "Alle Aktionen",
				timestamp: "Zeitpunkt",
				action: "Aktion",
				target: "Ziel",
				actor: "Akteur",
				details: "Details",
				noEntries: "Keine Einträge gefunden.",
				actionCreateTable: "Tabelle angelegt",
				actionAddColumn: "Spalte hinzugefügt",
				actionDropColumn: "Spalte gelöscht"
			},
			groups: {
				subtitle: "Tabellen-Berechtigungen als Bündel für mehrere Nutzer auf einmal",
				newGroup: "Neue Gruppe",
				noneYet: "Noch keine Gruppe angelegt.",
				createFirst: "Erste Gruppe anlegen",
				members: "Mitglieder",
				confirmDelete: "Gruppe \"{{name}}\" wirklich löschen?",
				namePlaceholder: "Vertrieb",
				editGroup: "Gruppe bearbeiten",
				noViewers: "Keine Viewer-Konten vorhanden.",
				saveMembers: "Mitglieder speichern"
			},
			scripts: {
				subtitle: "JavaScript-Skripte (goja) für eigene HTTP-Endpunkte und Event-Hooks",
				newScript: "Neues Skript",
				noneYet: "Noch kein Skript angelegt.",
				createFirst: "Erstes Skript anlegen",
				editScript: "Skript bearbeiten",
				confirmDelete: "Skript \"{{name}}\" wirklich löschen? Zugehörige Endpoints/Hooks werden mitgelöscht.",
				namePlaceholder: "z. B. hello-endpoint",
				codePlaceholder: "// Custom Endpoint: request/response verfügbar\n// Hook: event verfügbar\n// Beide: illusiondb.* und log(...)\n// Code läuft in einer Funktion -- return <wert> liefert das Ergebnis,\n// ohne return ist das Ergebnis undefined.\nreturn { ok: true };",
				enabled: "Aktiviert",
				code: "Code",
				endpointsTitle: "Custom Endpoints",
				endpointsSubtitle: "Erreichbar unter /api/v1/scripts/<pfad>, sofort und ohne Neustart",
				newEndpoint: "Neuer Endpoint",
				editEndpoint: "Endpoint bearbeiten",
				noneEndpointsYet: "Noch kein Endpoint registriert.",
				method: "Methode",
				path: "Pfad",
				pathPlaceholder: "/hello oder /users/:id",
				pathHint: ":name fängt ein Segment ein, ein abschließendes * den ganzen Rest. Bei Überlappung gewinnt der spezifischere Pfad (wörtlich > :name > *), bei Gleichstand der zuerst angelegte.",
				authMode: "Auth-Modus",
				authPublic: "Öffentlich",
				authAuthenticated: "Angemeldet",
				confirmDeleteEndpoint: "Endpoint \"{{method}} {{path}}\" wirklich löschen?",
				hooksTitle: "Event-Hooks",
				hooksSubtitle: "Läuft im Hintergrund nach einem Record-Write, blockiert den Request nicht",
				newHook: "Neuer Hook",
				editHook: "Hook bearbeiten",
				noneHooksYet: "Noch kein Hook gebunden.",
				event: "Ereignis",
				table: "Tabelle",
				allTables: "Alle Tabellen",
				position: "Position",
				confirmDeleteHook: "Hook wirklich löschen?",
				script: "Skript",
				selectScript: "Skript wählen…",
				noScriptsForBinding: "Erst ein Skript anlegen, um einen Endpoint/Hook zu binden.",
				testRun: "Testlauf",
				running: "Führt aus…",
				testRunHint: "Führt den aktuellen Code (auch ungespeichert) wirklich aus -- illusiondb.* hat vollen Zugriff, kein Sandbox-Dry-Run.",
				testRunLogs: "Konsole",
				testRunNoLogs: "Keine log(...)-Ausgabe.",
				testRunReturnValue: "Rückgabewert",
				testRunResponse: "Antwort",
				testRunError: "Fehler",
				testRunResultPanel: "Ergebnis",
				showOutput: "Ausgabe einblenden",
				hideOutput: "Ausgabe ausblenden",
				testRunPlaceholder: "Noch kein Testlauf.",
				testRunNoResult: "Kein Rückgabewert, keine Antwort.",
				apiSnippets: "illusiondb.*-API",
				download: "Download",
				import: "Importieren",
				importInvalidFile: "Die Datei konnte nicht gelesen werden.",
				importDropTitle: "Skript importieren",
				importDropHint: "Datei hierher ziehen oder klicken zum Auswählen",
				importDropHintSub: "Nur .js-Dateien"
			},
			documentTemplates: {
				subtitle: "Twig-Templates, die einen Datensatz als PDF/PNG/JPG rendern",
				newTemplate: "Neues Template",
				noneYet: "Noch kein Template angelegt.",
				createFirst: "Erstes Template anlegen",
				noTablesYet: "Erst eine Tabelle anlegen, bevor ein Dokumenten-Template erstellt werden kann.",
				editTemplate: "Template bearbeiten",
				confirmDelete: "Template \"{{name}}\" wirklich löschen?",
				namePlaceholder: "z. B. Rechnung",
				table: "Tabelle",
				visibility: "Sichtbarkeit",
				public: "Öffentlich",
				private: "Geschützt",
				isPublic: "Öffentlich abrufbar (ohne Bearer-Token)",
				isPublicHint: "Geschützte Templates verlangen beim Abruf über den Dokumenten-Endpunkt einen gültigen API-Token (Einstellungen → Mein Konto).",
				content: "Template (HTML/Twig)",
				contentPlaceholder: "<h1>Rechnung fuer {{ name }}</h1>\n<p>Betrag: {{ amount }} EUR</p>",
				fieldTags: "Felder der Tabelle",
				noFieldsYet: "Keine Felder gefunden.",
				testGenerate: "Testlauf",
				testGenerateHint: "Rendert das gespeicherte Template gegen einen ausgewählten Datensatz.",
				sampleRecord: "Datensatz",
				format: "Format",
				generate: "Generieren",
				generating: "Generiert…",
				publicUrl: "Öffentliche URL für diesen Datensatz",
				publicUrlHint: "Funktioniert ohne Anmeldung -- kann direkt weitergegeben werden (z. B. per E-Mail).",
				publicUrlNeedsPublic: "Nur für öffentliche Templates verfügbar -- oben \"Öffentlich abrufbar\" aktivieren."
			},
			datasourceDetail: {
				downloadSqlite: "Datenbank herunterladen",
				exportSchema: "Verbindungseinstellungen exportieren",
				importSchema: "Verbindungseinstellungen importieren",
				importSchemaHint: "JSON-Datei wählen, die zuvor über „Verbindungseinstellungen exportieren\" erzeugt wurde. Tabellen/Spalten müssen bereits existieren (per Sync) -- der Import legt keine neuen Datenbank-Spalten an, nur Formeln/Lookups/Rollups/Links/Dateifelder, Anzeige-Einstellungen und gespeicherte Ansichten.",
				importSchemaInvalidJson: "Die Datei enthält kein gültiges JSON.",
				importSchemaJsonOnly: "Nur .json-Dateien",
				importSchemaSummary: "{{matched}} Tabelle(n) zugeordnet, {{skipped}} übersprungen. {{created}} Spalte(n) neu angelegt, {{updated}} aktualisiert. {{viewsCreated}} Ansicht(en) neu angelegt, {{viewsUpdated}} aktualisiert.",
				sqlEditor: "SQL-Terminal",
				importCsv: "CSV importieren",
				importSql: "SQL importieren",
				newTable: "Neue Tabelle",
				noTablesYet: "Noch keine Tabellen bekannt.",
				hintBefore: "Auf der",
				hintLinkText: "Übersicht",
				hintAfter: "einmal „Sync\" ausführen.",
				schema: "Schema",
				table: "Tabelle",
				columns: "Spalten",
				lastSynced: "Zuletzt synchronisiert",
				webhooks: "Webhooks",
				manageWebhooks: "Webhooks verwalten",
				noWebhooks: "Noch kein Webhook für diese Verbindung eingerichtet.",
				webhooksCount: "{{count}} Webhook(s) eingerichtet.",
				createTableTitle: "Neue Tabelle anlegen",
				tableName: "Tabellenname",
				tableNamePlaceholder: "kunden",
				pkHintBefore: "Jede neue Tabelle bekommt automatisch eine UUID-Primärschlüsselspalte",
				pkHintAfter: "— nicht hier angeben.",
				columnNamePlaceholder: "Spaltenname",
				remove: "Entfernen",
				addColumn: "+ Spalte",
				createTable: "Tabelle anlegen"
			}
		},
		formats: {
			fieldType: {
				longText: "Langtext",
				number: "Zahl",
				decimal: "Dezimalzahl",
				boolean: "Wahrheitswert",
				date: "Datum",
				datetime: "Datum & Zeit",
				uuid: "UUID",
				json: "JSON",
				text: "Text",
				links: "Verknüpfung",
				attachment: "Anhang"
			},
			dateFormatName: {
				iso: "ISO",
				de: "Deutsch",
				us: "US",
				gb: "GB",
				long: "Ausgeschrieben"
			},
			timeFormatName: {
				"24h": "24-Stunden",
				"12h": "12-Stunden"
			},
			numberStyleName: {
				plain: "Standard",
				currency: "Währung",
				percent: "Prozent",
				temperature: "Temperatur"
			}
		},
		calendarView: {
			today: "Heute",
			previous: "Zurück",
			next: "Weiter",
			day: "Tag",
			week: "Woche",
			month: "Monat",
			year: "Jahr",
			notConfigured: "Von- und Bis-Feld noch nicht konfiguriert. In den View-Einstellungen einrichten."
		},
		documentsView: {
			noTemplateConfigured: "Kein Dokumenten-Template ausgewählt. In den View-Einstellungen konfigurieren.",
			generateAndDownload: "Generieren & herunterladen",
			generating: "Wird generiert…"
		},
		dataGrid: {
			columnOptionsFor: "Optionen für {{name}}",
			columnOptions: "Spaltenoptionen",
			resizeColumnFor: "Breite von {{name}} ändern",
			addField: "Neues Feld hinzufügen",
			displayColumn: "Anzeigespalte",
			openRecord: "Datensatz öffnen",
			loadingMoreRows: "Lädt weitere Zeilen…",
			endOfList: "– Ende der Liste –",
			defaultValue: "Default: {{value}}",
			automatic: "automatisch",
			newRow: "Neue Zeile",
			editSummaryFor: "Zusammenfassung für {{name}} bearbeiten",
			editSummary: "Zusammenfassung bearbeiten",
			noRows: "Keine Zeilen.",
			summary: "Zusammenfassung",
			column: "Spalte",
			unpinDisplay: "Anzeigefeld entfernen",
			pinDisplay: "Als Anzeigefeld setzen",
			hideInView: "In dieser Ansicht ausblenden",
			editField: "Feld bearbeiten",
			fieldName: "Feldname",
			physicalNameBefore: "Physischer Spaltenname:",
			physicalNameAfter: "-- leer lassen, um den Override zu entfernen.",
			formula: "Formel",
			fieldType: "Feldtyp",
			uiTypeOverrideHint: "Überschreibt die automatisch erkannte Darstellung -- z.B. um bei SQLite (kein natives Datum) trotzdem einen Datums-/Zeit-Picker zu erzwingen, oder um einer Formelspalte eine Zahlenformatierung zu ermöglichen.",
			originalUnformatted: "Original (unformatiert)",
			dateFormat: "Datumsformat",
			timeFormat: "Uhrzeitformat",
			style: "Stil",
			decimals: "Nachkommastellen",
			thousandsSeparator: "Tausendertrennzeichen",
			currency: "Währung",
			unit: "Einheit",
			chooseOtherFormat: "Anderes Format wählen",
			loadingValues: "Werte werden geladen…",
			value: "Wert",
			customColor: "Eigene Farbe",
			chooseCustomColor: "Eigene Farbe wählen",
			removeRow: "Zeile entfernen",
			reorderValue: "Wert verschieben",
			truncatedValues: "Nur die ersten {{count}} Werte übernommen — es gibt weitere.",
			addValue: "+ Wert",
			label: "Beschriftung",
			buttonLabelPlaceholder: "z.B. Rechnung öffnen",
			buttonFormulaHint: "Die Formel liefert das Klickziel (eine URL) -- der Button zeigt immer diesen festen Text, nicht das Formelergebnis.",
			target: "Ziel",
			newTab: "Neuer Tab",
			sameTab: "Gleicher Tab",
			plainText: "Normaler Text",
			labelFormat: "Label (Werte + Farben)",
			tagsFormat: "Tags (kommagetrennt)",
			emailFormat: "E-Mail-Adresse (Link)",
			phoneFormat: "Telefonnummer (Link)",
			urlFormat: "URL (Link)",
			colorFormat: "Farbe (Hexwert)",
			buttonFormat: "Button (feste Beschriftung, Formel als Klickziel)",
			numberFormat: "Zahl",
			dataSizeFormat: "Datengröße",
			durationFormat: "Zeit",
			emptyGroupLabel: "(leer)",
			summaryNone: "Keine",
			summarySum: "Summe",
			summaryCount: "Anzahl",
			summaryAvg: "Durchschnitt",
			summaryMin: "Minimum",
			summaryMax: "Maximum",
			rowCount: {
				one: "Zeile",
				other: "Zeilen"
			},
			linksEntryCount: {
				one: "Eintrag",
				other: "Einträge"
			}
		},
		recordForm: {
			record: "Datensatz",
			noPrimaryKey: "Diese Tabelle hat keinen eindeutigen Primärschlüssel und kann nicht als Formular geöffnet werden.",
			notFound: "Datensatz wurde nicht gefunden -- möglicherweise inzwischen gelöscht.",
			removeLink: "Verknüpfung zu {{label}} entfernen",
			open: "Öffnen",
			editMarkdown: "Markdown bearbeiten…"
		},
		tablePage: {
			tables: "Tabellen",
			columns: "Spalten",
			exportCsv: "CSV exportieren",
			confirmDeleteView: "Ansicht \"{{name}}\" wirklich löschen?",
			confirmDeleteRow: "Diese Zeile wirklich löschen?",
			confirmDropColumn: "Spalte \"{{name}}\" wirklich löschen? Das ändert das Schema der externen Datenbank dauerhaft.",
			readOnlyNoPk: "Diese Tabelle hat keinen oder einen zusammengesetzten Primärschlüssel — Zeilen anlegen, bearbeiten und löschen ist in dieser Version nicht möglich.",
			readOnlyViewer: "Du hast nur Lesezugriff auf diese Tabelle — Zeilen anlegen, bearbeiten und löschen ist nicht möglich.",
			deleteView: "Ansicht löschen",
			deleteViewFor: "Ansicht {{name}} löschen",
			saveViewShort: "+ Ansicht speichern",
			filter: "Filter",
			reset: "Zurücksetzen",
			group: "Gruppieren",
			searchPlaceholder: "Suchen…",
			loadedOfTotal: "{{loaded}} von {{total}} geladen",
			openApiDocs: "API-Dokumentation öffnen",
			openWebhooksForTable: "Webhooks für diese Tabelle öffnen",
			openSqlEditor: "SQL-Terminal öffnen",
			openTableSchema: "SQL-Schema anzeigen",
			createRow: "Zeile anlegen",
			apply: "Anwenden",
			noGroupLevels: "Noch keine Gruppierungsebene gewählt -- Zeilen werden ungruppiert angezeigt.",
			level: "Ebene {{n}}",
			moveLevelUp: "Ebene {{n}} nach oben verschieben",
			moveLevelDown: "Ebene {{n}} nach unten verschieben",
			addLevel: "+ Ebene hinzufügen",
			sort: "Sortieren",
			sortNone: "(keine Sortierung)",
			sortAscending: "Aufsteigend",
			sortDescending: "Absteigend",
			saveViewTitle: "Ansicht speichern",
			saveViewHint: "Speichert den aktuellen Filter, die Sortierung, die Seitengröße und die Zusammenfassungszeile als neue Ansicht.",
			saveViewNamePlaceholder: "z.B. Offene Bestellungen",
			manageColumnsTitle: "Spalten verwalten",
			viewScopeHint: "Sichtbarkeit und Reihenfolge unten gelten nur für die aktive Ansicht",
			moveColumn: "{{name}} verschieben",
			showInView: "{{name}} in dieser Ansicht anzeigen",
			tabPhysical: "Spalte",
			tabFormula: "Formel",
			tabLookup: "Lookup",
			tabRollup: "Rollup",
			tabLinks: "Links",
			tabForeignKey: "Verweis",
			tabAttachment: "Datei",
			tabAutoNumber: "Auto-Nummer",
			columnName: "Spaltenname",
			type: "Typ",
			addColumnHint: "Ändert das Schema der externen Datenbank (neue Spalte ist nullable).",
			autoNumberHint: "Vergibt automatisch fortlaufende Nummern (1, 2, 3, …). Bestehende Zeilen werden beim Anlegen einmalig befüllt.",
			foreignKeyHint: "Legt eine 1:n-Beziehung an (Verweis auf den Primärschlüssel der Zieltabelle) — nicht durch einen echten Datenbank-Constraint erzwungen. Darauf lassen sich anschließend Lookup- und Rollup-Felder aufbauen.",
			adding: "Fügt hinzu…",
			add: "Hinzufügen",
			expression: "Ausdruck",
			formulaPlaceholderExample: "IF(status == \"shipped\", \"Versandt\", \"Offen\")",
			fkColumn: "FK-Spalte",
			choose: "— wählen —",
			noMatchingColumn: "Keine passende Spalte vorhanden.",
			targetColumn: "Zielspalte",
			childTable: "Kind-Tabelle",
			fkBackToTable: "FK zurück auf diese Tabelle",
			columnToAggregate: "Zu aggregierende Spalte",
			function: "Funktion",
			columnNameHere: "Spaltenname (hier)",
			targetTable: "Zieltabelle",
			columnNameOnTarget: "Spaltenname (auf der Zieltabelle)",
			junctionTableLegend: "Junction-Tabelle",
			junctionModeGenerate: "Neu erzeugen",
			junctionModeExisting: "Bestehende verwenden",
			junctionExistingTable: "Junction-Tabelle",
			junctionColumnLocal: "Feld links (lokal)",
			junctionColumnRemote: "Feld rechts (remote)",
			maxFileSize: "Max. Dateigröße (MB, optional)",
			allowedMimeTypes: "Erlaubte Mime-Types (optional, komma-separiert)",
			viewType: "Ansichtstyp",
			viewTypeGrid: "Tabelle",
			viewTypeUnavailable: "Ansichtstyp \"{{type}}\" ist nicht verfügbar.",
			viewTypeUnavailableHint: "Das zugehörige Modul ist nicht geladen. Filter/Sortierung der Ansicht sind trotzdem gespeichert.",
			cmsNoImage: "Kein Bild",
			cmsPageSize: "Einträge pro Seite",
			cmsShowingRange: "{{from}}–{{to}} von {{total}}",
			cmsPrevPage: "Zurück",
			cmsNextPage: "Weiter",
			kanbanNoStatus: "Kein Status",
			kanbanShowMore: "{{n}} weitere anzeigen",
			kanbanDescriptionShowMore: "Mehr anzeigen",
			kanbanDescriptionShowLess: "Weniger anzeigen"
		},
		formulaDocs: {
			button: "Docs",
			title: "Formel-Referenz",
			intro: "Formeln beziehen sich auf Spalten der Tabelle über ihren Namen (kein Präfix, keine Anführungszeichen). Text steht in doppelten Anführungszeichen.",
			operatorsTitle: "Operatoren",
			opArithmetic: "Rechenoperatoren",
			opArithmeticDesc: "+  -  *  /  %  (Modulo)",
			opComparison: "Vergleich",
			opComparisonDesc: "==  !=  <  <=  >  >=",
			opLogical: "Logisch",
			opLogicalDesc: "&&  ||  !   (auch als and / or / not schreibbar)",
			opTernary: "Bedingter Ausdruck",
			opTernaryDesc: "bedingung ? dannWert : sonstWert",
			functionsTitle: "Funktionen",
			fnIfSignature: "IF(bedingung, dann, sonst)",
			fnIfDesc: "Liefert dann, wenn bedingung wahr ist, sonst sonst.",
			fnLenSignature: "LEN(text)",
			fnLenDesc: "Länge eines Textwerts in Zeichen.",
			fnUpperSignature: "UPPER(text)",
			fnUpperDesc: "Wandelt Text in Großbuchstaben um.",
			fnLowerSignature: "LOWER(text)",
			fnLowerDesc: "Wandelt Text in Kleinbuchstaben um."
		},
		tableSchema: {
			title: "SQL-Schema",
			loading: "Lädt…"
		},
		sqlEditor: {
			titlePrefix: "SQL-Terminal",
			warningBefore: "Führt SQL direkt gegen",
			warningAfter: "aus — SELECT, INSERT/UPDATE/DELETE und DDL (CREATE/ALTER/DROP) sind alle möglich. Es gibt kein Undo.",
			running: "Führt aus…",
			run: "Ausführen",
			confirmDestructive: "Dieses Statement verändert Daten oder Schema — wirklich ausführen?",
			confirmRun: "Ja, ausführen",
			executed: "Ausgeführt.",
			rowsAffected: "{{count}} Zeile(n) betroffen.",
			noRows: "0 Zeilen.",
			truncated: "Auf die ersten 1000 Zeilen gekürzt."
		},
		sqlImport: {
			title: "SQL importieren",
			file: "SQL-Datei",
			dropHint: "Datei hierher ziehen oder klicken zum Auswählen",
			dropHintSub: "Nur .sql-Dateien",
			analyzing: "Analysiere Datei…",
			noStatements: "Die Datei enthält keine ausführbaren SQL-Statements.",
			statementsDetected: "{{count}} Statement(s) erkannt.",
			warning: "Jedes Statement wird unabhängig ausgeführt (SELECT, INSERT/UPDATE/DELETE und DDL sind alle möglich, es gibt kein Undo). Schlägt eines fehl, laufen die übrigen trotzdem weiter -- am Ende siehst du eine vollständige Erfolg/Fehler-Liste.",
			unknownKind: "Statement",
			importing: "Importiert…",
			import: "Importieren",
			resultSummary: "{{succeeded}} von {{total}} Statement(s) erfolgreich.",
			statusOk: "OK",
			statusError: "Fehler"
		},
		webhooks: {
			title: "Webhooks",
			filterHintBefore: "Zeigt nur Webhooks, die für",
			filterHintAfter: "feuern (tabellenübergreifende eingeschlossen). Vollständige Verwaltung auf der Data-Source-Seite.",
			noneCount: "Kein Webhook",
			webhookCount: "{{count}} Webhook(s)",
			newWebhook: "Neuer Webhook",
			noneSetUp: "Noch kein passender Webhook eingerichtet.",
			targetUrl: "Ziel-URL",
			tables: "Tabellen",
			events: "Ereignisse",
			status: "Status",
			active: "Aktiv",
			disabledState: "Deaktiviert",
			notTriggeredYet: "noch nicht ausgelöst",
			error: "Fehler",
			allTables: "Alle Tabellen",
			eventCreated: "Datensatz angelegt",
			eventUpdated: "Datensatz geändert",
			eventDeleted: "Datensatz gelöscht",
			noTableSelectionHint: "Keine Auswahl = feuert für alle Tabellen der Verbindung.",
			secret: "Secret (optional)",
			secretPlaceholder: "Signiert den Payload per HMAC-SHA256",
			createWebhook: "Webhook anlegen"
		},
		createSqlite: {
			title: "Neue SQLite-Datenbank",
			namePlaceholder: "Meine neue Datenbank",
			filename: "Dateiname",
			filenamePlaceholder: "meine-datenbank",
			hint: "Wird als leere Datenbank angelegt -- die erste Tabelle legst du danach wie gewohnt über das SQL-Terminal oder CSV-Import an."
		},
		csvImport: {
			title: "CSV importieren",
			csvFile: "CSV-Datei",
			dropHint: "Datei hierher ziehen oder klicken zum Auswählen",
			dropHintSub: "Nur .csv-Dateien",
			analyzing: "Analysiere Datei…",
			rowsDetected: "{{count}} Zeile(n) erkannt, Trennzeichen",
			truncatedPreview: "Vorschau auf die ersten Zeilen gekürzt.",
			raggedRows: "{{count}} Zeile(n) mit abweichender Spaltenzahl (Zeile(n) {{rows}}) — diese schlagen beim Import fehl, sofern sie eine zugeordnete Spalte betreffen.",
			detectedColumns: "Erkannte Spalten",
			mapColumns: "Spalten zuordnen",
			skip: "Überspringen",
			rowsImported: "{{count}} Zeile(n) importiert.",
			rowsImportedInto: "{{count}} Zeile(n) importiert in \"{{schema}}.{{table}}\".",
			newTableFailureHint: "Schlägt eine Zeile fehl, wird der gesamte Import zurückgerollt -- die Tabelle selbst bleibt aber bestehen (leer), da das Anlegen der Tabelle nicht rückgängig gemacht werden kann.",
			existingTableFailureHint: "Schlägt eine Zeile fehl (z.B. Typkonflikt oder abweichende Spaltenzahl), wird der gesamte Import zurückgerollt -- es gibt kein DDL hier, der Import ist also vollständig atomar.",
			importing: "Importiert…",
			import: "Importieren"
		},
		tablePermissions: {
			title: "Tabellen-Berechtigungen",
			noneKnown: "Noch keine Tabellen bekannt.",
			inherit: "wie bisher",
			none: "kein Zugriff",
			read: "lesen",
			write: "schreiben",
			save: "Berechtigungen speichern"
		},
		filterBuilder: {
			and: "UND",
			or: "ODER",
			removeGroup: "Gruppe entfernen",
			removeCondition: "Bedingung entfernen",
			noConditions: "Keine Bedingungen -- diese Gruppe filtert nichts heraus.",
			addCondition: "+ Bedingung",
			addGroup: "+ Gruppe"
		},
		linksSelect: {
			addLink: "Verknüpfung hinzufügen",
			noPrimaryKey: "Zieltabelle hat keine Primärschlüsselspalte – Verknüpfung nicht möglich."
		},
		attachmentCell: {
			deleteFile: "{{name}} löschen",
			uploading: "Datei wird hochgeladen…",
			upload: "Datei hochladen"
		},
		fileDropzone: { changeFile: "Andere Datei wählen" },
		markdownEdit: {
			titlePrefix: "Markdown bearbeiten",
			placeholder: "# Überschrift\n\n**fett**, _kursiv_, - Liste …",
			previewPlaceholder: "Vorschau erscheint hier.",
			showPreview: "Vorschau einblenden",
			hidePreview: "Vorschau ausblenden",
			toolbar: {
				h1: "Überschrift 1",
				h2: "Überschrift 2",
				h3: "Überschrift 3",
				h4: "Überschrift 4",
				h5: "Überschrift 5",
				h6: "Überschrift 6",
				bold: "Fett",
				italic: "Kursiv",
				underline: "Unterstrichen",
				strikethrough: "Durchgestrichen",
				ul: "Aufzählungsliste",
				ol: "Nummerierte Liste",
				checklist: "Checkliste",
				table: "Tabelle einfügen"
			}
		},
		errors: {
			not_found: "Nicht gefunden.",
			invalid_credentials: "Ungültige Zugangsdaten.",
			forbidden: "Diese Aktion ist nicht erlaubt.",
			rate_limited: "Zu viele Versuche -- bitte später erneut versuchen.",
			last_admin: "Der letzte Administrator kann nicht entfernt oder herabgestuft werden.",
			duplicate_name: "Dieser Name ist bereits vergeben.",
			already_exists: "Existiert bereits.",
			cannot_delete_self: "Du kannst dein eigenes Konto nicht löschen.",
			cannot_drop_pk: "Die Primärschlüsselspalte kann nicht gelöscht werden.",
			invalid_body: "Ungültige Anfrage.",
			invalid_field: "Ungültiges Feld.",
			invalid_name: "Ungültiger Name.",
			invalid_expression: "Ungültiger Formel-Ausdruck.",
			circular_reference: "Zirkulärer Verweis erkannt.",
			file_too_large: "Datei ist zu groß.",
			unsupported_mime_type: "Dateityp wird nicht unterstützt.",
			empty_file: "Datei ist leer.",
			invalid_csv: "Ungültige CSV-Datei.",
			missing_field: "Pflichtfeld fehlt.",
			not_authenticated: "Bitte melde dich an.",
			invalid_token: "Sitzung ungültig oder abgelaufen.",
			no_columns: "Mindestens eine Spalte ist erforderlich.",
			not_editable: "Nicht bearbeitbar.",
			view_not_found: "Ansicht nicht gefunden.",
			unsupported_db_type: "Nicht unterstützter Datenbanktyp.",
			multiple_statements: "Nur eine SQL-Anweisung gleichzeitig erlaubt.",
			empty_mapping: "Keine Spalte zugeordnet.",
			column_count_mismatch: "Anzahl der Spalten stimmt nicht überein."
		},
		apiDocs: {
			title: "API-Dokumentation",
			description: "Allgemeine, nicht tabellenspezifische Endpunkte. Für Endpunkte einer konkreten Tabelle (Datensätze lesen/schreiben, Verknüpfungen, Anhänge) öffne die API-Dokumentation direkt in der jeweiligen Tabellenansicht. Alle Beispiele setzen einen gültigen API-Token voraus, siehe",
			myAccountLink: "Mein Konto",
			currentAccessBefore: "Dein aktueller Zugriff auf diese Tabelle:",
			readWrite: "Lesen & Schreiben",
			readOnly: "Nur Lesen",
			tableExamplesHint: "Alle Beispiele setzen einen gültigen API-Token voraus (siehe",
			noSinglePkWarning: "Diese Tabelle hat keinen oder einen zusammengesetzten Primärschlüssel — einzelne Zeilen können über die REST-API nicht gezielt angesprochen werden. Schreiben, Verknüpfungen und Anhänge sind deshalb hier nicht aufgeführt."
		}
	},
	en: {
		common: {
			username: "Username",
			password: "Password",
			email: "Email",
			name: "Name",
			role: "Role",
			createdAt: "Created at",
			updatedAt: "Updated at",
			pleaseChoose: "Please choose",
			close: "Close",
			cancel: "Cancel",
			save: "Save",
			saving: "Saving…",
			edit: "Edit",
			delete: "Delete",
			deleting: "Deleting…",
			create: "Create",
			creating: "Creating…",
			back: "Back",
			next: "Next",
			remove: "Remove",
			errorLoading: "Error loading",
			noResults: "No results",
			search: "Search…",
			refineSearch: "More results – refine your search",
			creatingAlt: "Creating…",
			allDataSources: "All data sources",
			rangeOfTotal: "{{from}}–{{to}} of {{total}}",
			rangeEmpty: "0 of 0",
			yes: "Yes",
			no: "No"
		},
		auth: {
			login: {
				subtitle: "Please sign in.",
				submit: "Sign in",
				submitting: "Signing in…"
			},
			setup: {
				subtitle: "Welcome! Create the first administrator account.",
				passwordRepeat: "Repeat password",
				passwordMismatch: "The passwords do not match.",
				submit: "Create administrator",
				submitting: "Setting up…"
			}
		},
		nav: {
			connections: "Connections",
			newSqliteDatabase: "Create new SQLite database",
			loading: "Loading…",
			noTables: "No tables",
			noViews: "No views",
			settings: "Settings",
			logout: "Log out",
			openMenu: "Open menu",
			collapseSidebar: "Collapse sidebar",
			expandSidebar: "Expand sidebar",
			expand: "Expand {{name}}",
			collapse: "Collapse {{name}}",
			viewOptionsFor: "Options for view {{name}}",
			viewSettings: "Settings",
			viewSettingsTitle: "View settings: {{name}}",
			junctionTableChip: "Admin",
			junctionTableHint: "Only visible to admins — junction table for a links field"
		},
		theme: {
			light: "Light",
			dark: "Dark",
			system: "System default"
		},
		language: {
			label: "Language",
			de: "German",
			en: "English"
		},
		settings: {
			title: "Settings",
			tabs: {
				dataSources: "Data Sources",
				apiDocs: "API Documentation",
				auditLog: "Audit Log",
				files: "Files",
				users: "Users",
				groups: "Groups",
				scripts: "Scripts",
				documentTemplates: "Document Templates",
				myAccount: "My Account"
			},
			users: {
				subtitle: "All user accounts on this instance",
				newUser: "New user",
				confirmDelete: "Really delete user \"{{email}}\"?",
				editUser: "Edit user",
				resetPassword: "Reset password",
				newPasswordPlaceholder: "New password",
				setting: "Setting…",
				set: "Set",
				loadingGroupMembership: "Loading group membership…",
				memberOf: "Member of: {{groups}}",
				managedUnderGroups: "— managed under Settings → Groups"
			},
			account: {
				accountSection: "Account",
				changeEmail: "Change email",
				changePasswordSection: "Change password",
				passwordChanged: "Password changed successfully.",
				currentPassword: "Current password",
				newPassword: "New password",
				changing: "Changing…",
				changePassword: "Change password",
				apiTokens: "API tokens",
				tokenCreatedNotice: "Token \"{{name}}\" created — shown only now, not retrievable afterwards:",
				hide: "Hide",
				tokenNamePlaceholder: "e.g. n8n workflow",
				createToken: "Create token",
				noTokens: "No API tokens created yet.",
				lastUsed: "Last used",
				confirmDeleteToken: "Really delete API token \"{{name}}\"?"
			},
			datasources: {
				subtitle: "Connected databases and their sync status",
				newSqliteDatabase: "New SQLite database",
				newDataSource: "New data source",
				noneYet: "No data source created yet.",
				createFirst: "Create first connection",
				type: "Type",
				connection: "Connection",
				status: "Status",
				lastSync: "Last sync",
				syncing: "Syncing…",
				sync: "Sync",
				confirmDelete: "Really remove data source \"{{name}}\"? All associated tables, views, permissions, webhooks and attachments in IllusionDB will be permanently deleted along with it. The external database itself remains unchanged.",
				namePlaceholder: "Production CRM",
				filePath: "File path",
				database: "Database",
				user: "User",
				sslMode: "SSL mode"
			},
			files: {
				subtitle: "All uploaded files across all data sources",
				galleryView: "Gallery",
				listView: "List",
				allTables: "All tables",
				allColumns: "All columns",
				allFileTypes: "All file types",
				filenamePlaceholder: "Filename…",
				filename: "Filename",
				tableColumn: "Table.Column",
				size: "Size",
				uploaded: "Uploaded",
				noFiles: "No files found.",
				confirmDelete: "Really delete file \"{{name}}\"?"
			},
			auditLog: {
				subtitle: "Schema changes (create/delete table/column) across all data sources",
				allActions: "All actions",
				timestamp: "Timestamp",
				action: "Action",
				target: "Target",
				actor: "Actor",
				details: "Details",
				noEntries: "No entries found.",
				actionCreateTable: "Table created",
				actionAddColumn: "Column added",
				actionDropColumn: "Column dropped"
			},
			groups: {
				subtitle: "Table permissions bundled for multiple users at once",
				newGroup: "New group",
				noneYet: "No group created yet.",
				createFirst: "Create first group",
				members: "Members",
				confirmDelete: "Really delete group \"{{name}}\"?",
				namePlaceholder: "Sales",
				editGroup: "Edit group",
				noViewers: "No viewer accounts exist.",
				saveMembers: "Save members"
			},
			scripts: {
				subtitle: "JavaScript scripts (goja) for custom HTTP endpoints and event hooks",
				newScript: "New script",
				noneYet: "No script created yet.",
				createFirst: "Create first script",
				editScript: "Edit script",
				confirmDelete: "Really delete script \"{{name}}\"? Associated endpoints/hooks are deleted with it.",
				namePlaceholder: "e.g. hello-endpoint",
				codePlaceholder: "// Custom endpoint: request/response available\n// Hook: event available\n// Both: illusiondb.* and log(...)\n// Code runs inside a function -- return <value> gives the result,\n// no return means the result is undefined.\nreturn { ok: true };",
				enabled: "Enabled",
				code: "Code",
				endpointsTitle: "Custom Endpoints",
				endpointsSubtitle: "Reachable at /api/v1/scripts/<path>, live, no restart",
				newEndpoint: "New endpoint",
				editEndpoint: "Edit endpoint",
				noneEndpointsYet: "No endpoint registered yet.",
				method: "Method",
				path: "Path",
				pathPlaceholder: "/hello or /users/:id",
				pathHint: ":name captures one segment, a trailing * captures everything remaining. On overlap the more specific path wins (literal > :name > *); ties go to whichever was created first.",
				authMode: "Auth mode",
				authPublic: "Public",
				authAuthenticated: "Authenticated",
				confirmDeleteEndpoint: "Really delete endpoint \"{{method}} {{path}}\"?",
				hooksTitle: "Event Hooks",
				hooksSubtitle: "Runs in the background after a record write, never blocks the request",
				newHook: "New hook",
				editHook: "Edit hook",
				noneHooksYet: "No hook bound yet.",
				event: "Event",
				table: "Table",
				allTables: "All tables",
				position: "Position",
				confirmDeleteHook: "Really delete this hook?",
				script: "Script",
				selectScript: "Select a script…",
				noScriptsForBinding: "Create a script first to bind an endpoint/hook to it.",
				testRun: "Test run",
				running: "Running…",
				testRunHint: "Really runs the current code (even unsaved) -- illusiondb.* has full access, this is not a sandboxed dry run.",
				testRunLogs: "Console",
				testRunNoLogs: "No log(...) output.",
				testRunReturnValue: "Return value",
				testRunResponse: "Response",
				testRunError: "Error",
				testRunResultPanel: "Result",
				showOutput: "Show output",
				hideOutput: "Hide output",
				testRunPlaceholder: "No test run yet.",
				testRunNoResult: "No return value, no response.",
				apiSnippets: "illusiondb.* API",
				download: "Download",
				import: "Import",
				importInvalidFile: "The file could not be read.",
				importDropTitle: "Import script",
				importDropHint: "Drop a file here or click to browse",
				importDropHintSub: "JS files only"
			},
			documentTemplates: {
				subtitle: "Twig templates that render a record as PDF/PNG/JPG",
				newTemplate: "New Template",
				noneYet: "No template created yet.",
				createFirst: "Create first template",
				noTablesYet: "Create a table first before adding a document template.",
				editTemplate: "Edit Template",
				confirmDelete: "Really delete template \"{{name}}\"?",
				namePlaceholder: "e.g. Invoice",
				table: "Table",
				visibility: "Visibility",
				public: "Public",
				private: "Private",
				isPublic: "Publicly accessible (no bearer token required)",
				isPublicHint: "Private templates require a valid API token when fetched through the document endpoint (Settings → My Account).",
				content: "Template (HTML/Twig)",
				contentPlaceholder: "<h1>Invoice for {{ name }}</h1>\n<p>Amount: {{ amount }} EUR</p>",
				fieldTags: "Table fields",
				noFieldsYet: "No fields found.",
				testGenerate: "Test run",
				testGenerateHint: "Renders the saved template against a chosen record.",
				sampleRecord: "Record",
				format: "Format",
				generate: "Generate",
				generating: "Generating…",
				publicUrl: "Public URL for this record",
				publicUrlHint: "Works without logging in -- can be shared directly (e.g. by email).",
				publicUrlNeedsPublic: "Only available for public templates -- enable \"Publicly accessible\" above."
			},
			datasourceDetail: {
				downloadSqlite: "Download database",
				exportSchema: "Export connection settings",
				importSchema: "Import connection settings",
				importSchemaHint: "Choose a JSON file previously created via \"Export connection settings\". Tables/columns must already exist (via Sync) -- import never creates new database columns, only formulas/lookups/rollups/links/file fields, display settings, and saved views.",
				importSchemaInvalidJson: "That file is not valid JSON.",
				importSchemaJsonOnly: "JSON files only",
				importSchemaSummary: "{{matched}} table(s) matched, {{skipped}} skipped. {{created}} column(s) created, {{updated}} updated. {{viewsCreated}} view(s) created, {{viewsUpdated}} updated.",
				sqlEditor: "SQL terminal",
				importCsv: "Import CSV",
				importSql: "Import SQL",
				newTable: "New table",
				noTablesYet: "No tables known yet.",
				hintBefore: "Run \"Sync\" once on the",
				hintLinkText: "overview",
				hintAfter: "page.",
				schema: "Schema",
				table: "Table",
				columns: "Columns",
				lastSynced: "Last synced",
				webhooks: "Webhooks",
				manageWebhooks: "Manage webhooks",
				noWebhooks: "No webhook set up for this connection yet.",
				webhooksCount: "{{count}} webhook(s) set up.",
				createTableTitle: "Create new table",
				tableName: "Table name",
				tableNamePlaceholder: "customers",
				pkHintBefore: "Every new table automatically gets a UUID primary key column",
				pkHintAfter: "— do not add it here.",
				columnNamePlaceholder: "Column name",
				remove: "Remove",
				addColumn: "+ Column",
				createTable: "Create table"
			}
		},
		formats: {
			fieldType: {
				longText: "Long text",
				number: "Number",
				decimal: "Decimal",
				boolean: "Boolean",
				date: "Date",
				datetime: "Date & time",
				uuid: "UUID",
				json: "JSON",
				text: "Text",
				links: "Link",
				attachment: "Attachment"
			},
			dateFormatName: {
				iso: "ISO",
				de: "German",
				us: "US",
				gb: "GB",
				long: "Long form"
			},
			timeFormatName: {
				"24h": "24-hour",
				"12h": "12-hour"
			},
			numberStyleName: {
				plain: "Plain",
				currency: "Currency",
				percent: "Percent",
				temperature: "Temperature"
			}
		},
		calendarView: {
			today: "Today",
			previous: "Previous",
			next: "Next",
			day: "Day",
			week: "Week",
			month: "Month",
			year: "Year",
			notConfigured: "Start and end field not configured yet. Set them up in the view settings."
		},
		documentsView: {
			noTemplateConfigured: "No document template selected. Configure it in the view settings.",
			generateAndDownload: "Generate & download",
			generating: "Generating…"
		},
		dataGrid: {
			columnOptionsFor: "Options for {{name}}",
			columnOptions: "Column options",
			resizeColumnFor: "Resize {{name}}",
			addField: "Add new field",
			displayColumn: "Display column",
			openRecord: "Open record",
			loadingMoreRows: "Loading more rows…",
			endOfList: "– End of list –",
			defaultValue: "Default: {{value}}",
			automatic: "automatic",
			newRow: "New row",
			editSummaryFor: "Edit summary for {{name}}",
			editSummary: "Edit summary",
			noRows: "No rows.",
			summary: "Summary",
			column: "Column",
			unpinDisplay: "Remove display field",
			pinDisplay: "Set as display field",
			hideInView: "Hide in this view",
			editField: "Edit field",
			fieldName: "Field name",
			physicalNameBefore: "Physical column name:",
			physicalNameAfter: "-- leave blank to remove the override.",
			formula: "Formula",
			fieldType: "Field type",
			uiTypeOverrideHint: "Overrides the auto-detected rendering -- e.g. to force a date/time picker on SQLite (which has no native date type), or to enable number formatting on a formula column.",
			originalUnformatted: "Original (unformatted)",
			dateFormat: "Date format",
			timeFormat: "Time format",
			style: "Style",
			decimals: "Decimal places",
			thousandsSeparator: "Thousands separator",
			currency: "Currency",
			unit: "Unit",
			chooseOtherFormat: "Choose a different format",
			loadingValues: "Loading values…",
			value: "Value",
			customColor: "Custom color",
			chooseCustomColor: "Choose custom color",
			removeRow: "Remove row",
			reorderValue: "Reorder value",
			truncatedValues: "Only the first {{count}} values were taken over — there are more.",
			addValue: "+ Value",
			label: "Label",
			buttonLabelPlaceholder: "e.g. Open invoice",
			buttonFormulaHint: "The formula supplies the click target (a URL) -- the button always shows this fixed text, not the formula result.",
			target: "Target",
			newTab: "New tab",
			sameTab: "Same tab",
			plainText: "Plain text",
			labelFormat: "Label (values + colors)",
			tagsFormat: "Tags (comma-separated)",
			emailFormat: "Email address (link)",
			phoneFormat: "Phone number (link)",
			urlFormat: "URL (link)",
			colorFormat: "Color (hex value)",
			buttonFormat: "Button (fixed label, formula as click target)",
			numberFormat: "Number",
			dataSizeFormat: "Data size",
			durationFormat: "Duration",
			emptyGroupLabel: "(empty)",
			summaryNone: "None",
			summarySum: "Sum",
			summaryCount: "Count",
			summaryAvg: "Average",
			summaryMin: "Minimum",
			summaryMax: "Maximum",
			rowCount: {
				one: "row",
				other: "rows"
			},
			linksEntryCount: {
				one: "entry",
				other: "entries"
			}
		},
		recordForm: {
			record: "Record",
			noPrimaryKey: "This table has no unique primary key and cannot be opened as a form.",
			notFound: "Record not found -- it may have been deleted since.",
			removeLink: "Remove link to {{label}}",
			open: "Open",
			editMarkdown: "Edit markdown…"
		},
		tablePage: {
			tables: "Tables",
			columns: "Columns",
			exportCsv: "Export CSV",
			confirmDeleteView: "Really delete view \"{{name}}\"?",
			confirmDeleteRow: "Really delete this row?",
			confirmDropColumn: "Really delete column \"{{name}}\"? This permanently changes the external database's schema.",
			readOnlyNoPk: "This table has no primary key or a composite one — creating, editing, and deleting rows is not possible in this version.",
			readOnlyViewer: "You only have read access to this table — creating, editing, and deleting rows is not possible.",
			deleteView: "Delete view",
			deleteViewFor: "Delete view {{name}}",
			saveViewShort: "+ Save view",
			filter: "Filter",
			reset: "Reset",
			group: "Group",
			searchPlaceholder: "Search…",
			loadedOfTotal: "{{loaded}} of {{total}} loaded",
			openApiDocs: "Open API documentation",
			openWebhooksForTable: "Open webhooks for this table",
			openSqlEditor: "Open SQL terminal",
			openTableSchema: "View SQL schema",
			createRow: "Create row",
			apply: "Apply",
			noGroupLevels: "No grouping level chosen yet -- rows are shown ungrouped.",
			level: "Level {{n}}",
			moveLevelUp: "Move level {{n}} up",
			moveLevelDown: "Move level {{n}} down",
			addLevel: "+ Add level",
			sort: "Sort",
			sortNone: "(no sorting)",
			sortAscending: "Ascending",
			sortDescending: "Descending",
			saveViewTitle: "Save view",
			saveViewHint: "Saves the current filter, sort order, page size, and summary row as a new view.",
			saveViewNamePlaceholder: "e.g. Open orders",
			manageColumnsTitle: "Manage columns",
			viewScopeHint: "Visibility and order below apply only to the active view",
			moveColumn: "Move {{name}}",
			showInView: "Show {{name}} in this view",
			tabPhysical: "Column",
			tabFormula: "Formula",
			tabLookup: "Lookup",
			tabRollup: "Rollup",
			tabLinks: "Links",
			tabForeignKey: "Reference",
			tabAttachment: "File",
			tabAutoNumber: "Auto number",
			columnName: "Column name",
			type: "Type",
			addColumnHint: "Changes the external database's schema (the new column is nullable).",
			autoNumberHint: "Automatically assigns sequential numbers (1, 2, 3, …). Existing rows are backfilled once when the column is created.",
			foreignKeyHint: "Creates a 1:n relationship (a reference to the target table's primary key) -- not enforced by a real database constraint. Lookup and rollup fields can be built on top of it afterward.",
			adding: "Adding…",
			add: "Add",
			expression: "Expression",
			formulaPlaceholderExample: "IF(status == \"shipped\", \"Shipped\", \"Open\")",
			fkColumn: "FK column",
			choose: "— choose —",
			noMatchingColumn: "No matching column available.",
			targetColumn: "Target column",
			childTable: "Child table",
			fkBackToTable: "FK back to this table",
			columnToAggregate: "Column to aggregate",
			function: "Function",
			columnNameHere: "Column name (here)",
			targetTable: "Target table",
			columnNameOnTarget: "Column name (on the target table)",
			junctionTableLegend: "Junction table",
			junctionModeGenerate: "Generate new",
			junctionModeExisting: "Use existing",
			junctionExistingTable: "Junction table",
			junctionColumnLocal: "Left field (local)",
			junctionColumnRemote: "Right field (remote)",
			maxFileSize: "Max. file size (MB, optional)",
			allowedMimeTypes: "Allowed MIME types (optional, comma-separated)",
			viewType: "View type",
			viewTypeGrid: "Grid",
			viewTypeUnavailable: "View type \"{{type}}\" is unavailable.",
			viewTypeUnavailableHint: "Its module isn't loaded. The view's filters/sort are still saved.",
			cmsNoImage: "No image",
			cmsPageSize: "Rows per page",
			cmsShowingRange: "{{from}}–{{to}} of {{total}}",
			cmsPrevPage: "Previous",
			cmsNextPage: "Next",
			kanbanNoStatus: "No status",
			kanbanShowMore: "Show {{n}} more",
			kanbanDescriptionShowMore: "Show more",
			kanbanDescriptionShowLess: "Show less"
		},
		formulaDocs: {
			button: "Docs",
			title: "Formula reference",
			intro: "Formulas refer to table columns by their plain name (no prefix, no quotes). Text values are written in double quotes.",
			operatorsTitle: "Operators",
			opArithmetic: "Arithmetic",
			opArithmeticDesc: "+  -  *  /  %  (modulo)",
			opComparison: "Comparison",
			opComparisonDesc: "==  !=  <  <=  >  >=",
			opLogical: "Logical",
			opLogicalDesc: "&&  ||  !   (also spelled and / or / not)",
			opTernary: "Conditional expression",
			opTernaryDesc: "condition ? thenValue : elseValue",
			functionsTitle: "Functions",
			fnIfSignature: "IF(condition, then, else)",
			fnIfDesc: "Returns then when condition is true, otherwise else.",
			fnLenSignature: "LEN(text)",
			fnLenDesc: "Length of a text value in characters.",
			fnUpperSignature: "UPPER(text)",
			fnUpperDesc: "Converts text to uppercase.",
			fnLowerSignature: "LOWER(text)",
			fnLowerDesc: "Converts text to lowercase."
		},
		tableSchema: {
			title: "SQL schema",
			loading: "Loading…"
		},
		sqlEditor: {
			titlePrefix: "SQL terminal",
			warningBefore: "Runs SQL directly against",
			warningAfter: "— SELECT, INSERT/UPDATE/DELETE and DDL (CREATE/ALTER/DROP) are all possible. There is no undo.",
			running: "Running…",
			run: "Run",
			confirmDestructive: "This statement changes data or schema — really run it?",
			confirmRun: "Yes, run it",
			executed: "Executed.",
			rowsAffected: "{{count}} row(s) affected.",
			noRows: "0 rows.",
			truncated: "Truncated to the first 1000 rows."
		},
		sqlImport: {
			title: "Import SQL",
			file: "SQL file",
			dropHint: "Drop a file here or click to browse",
			dropHintSub: "SQL files only",
			analyzing: "Analyzing file…",
			noStatements: "The file contains no executable SQL statements.",
			statementsDetected: "{{count}} statement(s) detected.",
			warning: "Each statement runs independently (SELECT, INSERT/UPDATE/DELETE and DDL are all possible, there is no undo). If one fails, the rest still run -- you get a full success/failure list at the end.",
			unknownKind: "Statement",
			importing: "Importing…",
			import: "Import",
			resultSummary: "{{succeeded}} of {{total}} statement(s) succeeded.",
			statusOk: "OK",
			statusError: "Error"
		},
		webhooks: {
			title: "Webhooks",
			filterHintBefore: "Shows only webhooks that fire for",
			filterHintAfter: "(including cross-table ones). Full management is on the data source page.",
			noneCount: "No webhooks",
			webhookCount: "{{count}} webhook(s)",
			newWebhook: "New webhook",
			noneSetUp: "No matching webhook set up yet.",
			targetUrl: "Target URL",
			tables: "Tables",
			events: "Events",
			status: "Status",
			active: "Active",
			disabledState: "Disabled",
			notTriggeredYet: "not triggered yet",
			error: "Error",
			allTables: "All tables",
			eventCreated: "Record created",
			eventUpdated: "Record updated",
			eventDeleted: "Record deleted",
			noTableSelectionHint: "No selection = fires for every table in the connection.",
			secret: "Secret (optional)",
			secretPlaceholder: "Signs the payload via HMAC-SHA256",
			createWebhook: "Create webhook"
		},
		createSqlite: {
			title: "New SQLite database",
			namePlaceholder: "My new database",
			filename: "Filename",
			filenamePlaceholder: "my-database",
			hint: "Created as an empty database -- create the first table afterwards as usual via the SQL terminal or CSV import."
		},
		csvImport: {
			title: "Import CSV",
			csvFile: "CSV file",
			dropHint: "Drop a file here or click to browse",
			dropHintSub: "CSV files only",
			analyzing: "Analyzing file…",
			rowsDetected: "{{count}} row(s) detected, delimiter",
			truncatedPreview: "Preview truncated to the first few rows.",
			raggedRows: "{{count}} row(s) with a differing column count (row(s) {{rows}}) — these will fail on import if they affect a mapped column.",
			detectedColumns: "Detected columns",
			mapColumns: "Map columns",
			skip: "Skip",
			rowsImported: "{{count}} row(s) imported.",
			rowsImportedInto: "{{count}} row(s) imported into \"{{schema}}.{{table}}\".",
			newTableFailureHint: "If a row fails, the whole import is rolled back -- the table itself remains (empty), since creating the table cannot be undone.",
			existingTableFailureHint: "If a row fails (e.g. a type conflict or differing column count), the whole import is rolled back -- there is no DDL here, so the import is fully atomic.",
			importing: "Importing…",
			import: "Import"
		},
		tablePermissions: {
			title: "Table permissions",
			noneKnown: "No tables known yet.",
			inherit: "as before",
			none: "no access",
			read: "read",
			write: "write",
			save: "Save permissions"
		},
		filterBuilder: {
			and: "AND",
			or: "OR",
			removeGroup: "Remove group",
			removeCondition: "Remove condition",
			noConditions: "No conditions -- this group filters nothing out.",
			addCondition: "+ Condition",
			addGroup: "+ Group"
		},
		linksSelect: {
			addLink: "Add link",
			noPrimaryKey: "Target table has no primary key column – linking is not possible."
		},
		attachmentCell: {
			deleteFile: "Delete {{name}}",
			uploading: "Uploading file…",
			upload: "Upload file"
		},
		fileDropzone: { changeFile: "Choose a different file" },
		markdownEdit: {
			titlePrefix: "Edit markdown",
			placeholder: "# Heading\n\n**bold**, _italic_, - list …",
			previewPlaceholder: "Preview appears here.",
			showPreview: "Show preview",
			hidePreview: "Hide preview",
			toolbar: {
				h1: "Heading 1",
				h2: "Heading 2",
				h3: "Heading 3",
				h4: "Heading 4",
				h5: "Heading 5",
				h6: "Heading 6",
				bold: "Bold",
				italic: "Italic",
				underline: "Underline",
				strikethrough: "Strikethrough",
				ul: "Bullet list",
				ol: "Numbered list",
				checklist: "Checklist",
				table: "Insert table"
			}
		},
		errors: {
			not_found: "Not found.",
			invalid_credentials: "Invalid credentials.",
			forbidden: "This action is not allowed.",
			rate_limited: "Too many attempts -- please try again later.",
			last_admin: "The last administrator cannot be removed or demoted.",
			duplicate_name: "This name is already taken.",
			already_exists: "Already exists.",
			cannot_delete_self: "You cannot delete your own account.",
			cannot_drop_pk: "The primary key column cannot be deleted.",
			invalid_body: "Invalid request.",
			invalid_field: "Invalid field.",
			invalid_name: "Invalid name.",
			invalid_expression: "Invalid formula expression.",
			circular_reference: "Circular reference detected.",
			file_too_large: "File is too large.",
			unsupported_mime_type: "File type not supported.",
			empty_file: "File is empty.",
			invalid_csv: "Invalid CSV file.",
			missing_field: "Required field is missing.",
			not_authenticated: "Please sign in.",
			invalid_token: "Session is invalid or has expired.",
			no_columns: "At least one column is required.",
			not_editable: "Not editable.",
			view_not_found: "View not found.",
			unsupported_db_type: "Unsupported database type.",
			multiple_statements: "Only one SQL statement is allowed at a time.",
			empty_mapping: "No column mapped.",
			column_count_mismatch: "Column count does not match."
		},
		apiDocs: {
			title: "API documentation",
			description: "General, non-table-specific endpoints. For endpoints of a specific table (reading/writing records, links, attachments), open the API documentation directly from that table view. All examples assume a valid API token, see",
			myAccountLink: "My account",
			currentAccessBefore: "Your current access to this table:",
			readWrite: "Read & write",
			readOnly: "Read only",
			tableExamplesHint: "All examples assume a valid API token (see",
			noSinglePkWarning: "This table has no primary key or a composite one — individual rows cannot be targeted via the REST API. Writes, links, and attachments are therefore not listed here."
		}
	}
};
function ui(e, t) {
	return t.reduce((e, t) => {
		if (!(typeof e != "object" || !e)) return e[t];
	}, e);
}
function di(e, t) {
	return t ? e.replace(/\{\{(\w+)\}\}/g, (e, n) => n in t ? String(t[n]) : `{{${n}}}`) : e;
}
function fi(e) {
	return typeof e == "object" && !!e && "one" in e && "other" in e;
}
function pi(e) {
	let t = e.split(".");
	return ui(li[ci.current], t) ?? ui(li.de, t);
}
function Q(e, t) {
	let n = pi(e);
	return typeof n == "string" ? di(n, t) : fi(n) ? di(n.other, t) : e;
}
//#endregion
//#region src/lib/formatters.ts
function mi() {
	return ci.current === "en" ? "en-US" : "de-DE";
}
function $(e) {
	return e == null ? "" : typeof e == "boolean" ? e ? "true" : "false" : typeof e == "object" ? JSON.stringify(e) : String(e);
}
function hi(e, t) {
	return e._fk_display?.[t.effective_name];
}
function gi(e, t) {
	return e._fk_display_format?.[t.effective_name];
}
function _i(e, t) {
	let n = hi(e, t);
	if (n === void 0) return;
	let r = gi(e, t);
	return r ? ki(n, r) : $(n);
}
function vi(e) {
	if (e === !0 || e === 1) return !0;
	if (typeof e == "string") {
		let t = e.trim().toLowerCase();
		return t === "1" || t === "true";
	}
	return !1;
}
function yi(e) {
	return $(e).split(",").map((e) => e.trim()).filter((e) => e.length > 0);
}
var bi = {
	de: [
		"Januar",
		"Februar",
		"März",
		"April",
		"Mai",
		"Juni",
		"Juli",
		"August",
		"September",
		"Oktober",
		"November",
		"Dezember"
	],
	en: [
		"January",
		"February",
		"March",
		"April",
		"May",
		"June",
		"July",
		"August",
		"September",
		"October",
		"November",
		"December"
	]
};
function xi(e, t, n, r) {
	switch (r) {
		case "de": return `${n}.${t}.${e}`;
		case "us": return `${t}/${n}/${e}`;
		case "gb": return `${n}/${t}/${e}`;
		case "long": return `${parseInt(n, 10)}. ${bi[ci.current][parseInt(t, 10) - 1] ?? t} ${e}`;
		default: return `${e}-${t}-${n}`;
	}
}
function Si(e, t, n) {
	if (n !== "12h") return `${e}:${t}`;
	let r = parseInt(e, 10), i = r < 12 ? "AM" : "PM";
	return `${r % 12 || 12}:${t} ${i}`;
}
function Ci(e, t) {
	let n = $(e);
	if (!n) return n;
	let r = xi(n.slice(0, 4), n.slice(5, 7), n.slice(8, 10), t.format_config.date_format ?? "iso");
	return t.ui_type !== "datetime" || !t.format_config.time_format ? r : `${r} ${Si(n.slice(11, 13), n.slice(14, 16), t.format_config.time_format)}`;
}
function wi(e, t) {
	if (e == null || e === "") return $(e);
	let n = typeof e == "number" ? e : parseFloat(String(e));
	if (Number.isNaN(n)) return $(e);
	let r = t.format_config, i = r.decimals ?? (t.ui_type === "decimal" ? 2 : 0), a = {
		minimumFractionDigits: i,
		maximumFractionDigits: i,
		useGrouping: r.thousands_separator ?? !0
	};
	switch (r.style) {
		case "currency": return new Intl.NumberFormat(mi(), {
			...a,
			style: "currency",
			currency: r.currency ?? "EUR"
		}).format(n);
		case "percent": return `${new Intl.NumberFormat(mi(), a).format(n)} %`;
		case "temperature": return `${new Intl.NumberFormat(mi(), a).format(n)} ${r.temperature_unit === "fahrenheit" ? "°F" : "°C"}`;
		default: return new Intl.NumberFormat(mi(), a).format(n);
	}
}
var Ti = {
	KB: 1024,
	MB: 1024 ** 2,
	GB: 1024 ** 3,
	TB: 1024 ** 4
};
function Ei(e, t) {
	if (e == null || e === "") return $(e);
	let n = typeof e == "number" ? e : parseFloat(String(e));
	if (Number.isNaN(n)) return $(e);
	let r = t.format_config.unit ?? "MB", i = n / (Ti[r] ?? Ti.MB);
	return `${new Intl.NumberFormat(mi(), {
		minimumFractionDigits: 2,
		maximumFractionDigits: 2
	}).format(i)} ${r}`;
}
var Di = {
	s: 1e3,
	min: 6e4,
	h: 36e5,
	d: 864e5
};
function Oi(e, t) {
	if (e == null || e === "") return $(e);
	let n = typeof e == "number" ? e : parseFloat(String(e));
	if (Number.isNaN(n)) return $(e);
	let r = t.format_config.unit ?? "s", i = n / (Di[r] ?? Di.s);
	return `${new Intl.NumberFormat(mi(), {
		minimumFractionDigits: 2,
		maximumFractionDigits: 2
	}).format(i)} ${r}`;
}
function ki(e, t) {
	return t.display_format === "date_format" ? Ci(e, t) : t.display_format === "number_format" ? wi(e, t) : t.display_format === "data_size" ? Ei(e, t) : t.display_format === "duration" ? Oi(e, t) : $(e);
}
function Ai(e) {
	return Array.isArray(e) ? e : [];
}
function ji(e) {
	return Array.isArray(e) ? e : [];
}
function Mi(e, t) {
	if (t.is_foreign_key) {
		let n = _i(e, t);
		return n === void 0 ? $(e[t.effective_name]) : n;
	}
	return t.field_kind === "links" ? Ai(e[t.effective_name]).map((e) => $(e.label)).join(", ") : t.ui_type === "boolean" ? vi(e[t.effective_name]) ? Q("common.yes") : Q("common.no") : t.display_format === "tags" ? yi(e[t.effective_name]).join(", ") : ki(e[t.effective_name], t);
}
//#endregion
//#region src/lib/overlayScroll.ts
function Ni(e) {
	let t;
	function n() {
		e.classList.add("is-scrolling"), clearTimeout(t), t = setTimeout(() => e.classList.remove("is-scrolling"), 800);
	}
	return e.addEventListener("scroll", n), { destroy() {
		e.removeEventListener("scroll", n), clearTimeout(t);
	} };
}
//#endregion
//#region src/lib/viewmodules/documents/DocumentsView.svelte
var Pi = /* @__PURE__ */ Y("<span class=\"px-1.5 text-sm text-ink-400\">…</span>"), Fi = /* @__PURE__ */ Y("<button type=\"button\"> </button>"), Ii = /* @__PURE__ */ Y("<div class=\"flex items-center justify-center gap-1 py-2\"><button type=\"button\" class=\"grid size-8 shrink-0 place-items-center rounded-md text-ink-500 hover:bg-ink-100 disabled:opacity-40\"><svg class=\"size-4\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"15 18 9 12 15 6\"></polyline></svg></button> <!> <button type=\"button\" class=\"grid size-8 shrink-0 place-items-center rounded-md text-ink-500 hover:bg-ink-100 disabled:opacity-40\"><svg class=\"size-4\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"9 18 15 12 9 6\"></polyline></svg></button></div>"), Li = /* @__PURE__ */ Y("<p class=\"px-4 py-10 text-center text-sm text-ink-500\"> </p>"), Ri = /* @__PURE__ */ Y("<img alt=\"\" loading=\"lazy\" class=\"size-full object-cover\"/>"), zi = /* @__PURE__ */ ur("<svg class=\"size-8 text-ink-300\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"></path><path d=\"M14 2v6h6\"></path></svg>"), Bi = /* @__PURE__ */ Y("<p class=\"line-clamp-2 text-xs leading-snug text-ink-500\"> </p>"), Vi = /* @__PURE__ */ Y("<span class=\"text-ink-500\"> </span>"), Hi = /* @__PURE__ */ Y("<span class=\"text-red-600\"> </span>"), Ui = /* @__PURE__ */ Y("<span class=\"text-brand-600 group-hover:underline\"> </span>"), Wi = /* @__PURE__ */ Y("<button type=\"button\" class=\"group flex cursor-pointer flex-col overflow-hidden rounded-lg border border-ink-200 bg-surface text-left transition-shadow hover:shadow-md disabled:cursor-default disabled:opacity-60\"><div class=\"grid aspect-video w-full shrink-0 place-items-center bg-ink-100\"><!></div> <div class=\"min-w-0 flex-1 space-y-1 px-4 py-3\"><h3 class=\"truncate text-sm font-semibold text-ink-900\"> </h3> <!></div> <div class=\"flex items-center gap-1.5 border-t border-ink-100 px-4 py-2 text-xs\"><!></div></button>"), Gi = /* @__PURE__ */ Y("<div class=\"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4\"></div>"), Ki = /* @__PURE__ */ Y("<option> </option>"), qi = /* @__PURE__ */ Y("<div class=\"flex h-full flex-col bg-ink-50\"><div class=\"shrink-0 border-b border-ink-200 bg-surface\"><!></div> <div class=\"overlay-scroll flex-1 overflow-y-auto p-4\"><!></div> <div class=\"shrink-0 border-t border-ink-200 bg-surface\"><div class=\"flex items-center justify-between px-4 py-2\"><div class=\"flex items-center gap-3 text-xs text-ink-500\"><label class=\"flex items-center gap-1.5\"> <select class=\"input w-16 py-1 text-xs\"></select></label> <span> </span></div> <div class=\"flex gap-2\"><button type=\"button\" class=\"btn btn-secondary\"> </button> <button type=\"button\" class=\"btn btn-secondary\"> </button></div></div> <!></div></div>");
function Ji(e, t) {
	Be(t, !0);
	let n = (e) => {
		var t = Ii(), n = L(t), r = R(n, 2);
		Er(r, 17, () => J(se), Sr, (e, t) => {
			var n = dr(), r = en(n), i = (e) => {
				X(e, Pi());
			}, a = (e) => {
				var n = Fi(), r = L(n, !0);
				O(n), z(() => {
					Fr(n, 1, `min-w-8 shrink-0 rounded-md px-2 py-1.5 text-sm font-medium transition-colors
						${J(t) === J(ie) ? "bg-brand-600 text-white" : "text-ink-600 hover:bg-ink-100"}`), Hr(n, "aria-current", J(t) === J(ie) ? "page" : void 0), Z(r, J(t));
				}), tr("click", n, () => f()?.(J(t))), X(e, n);
			};
			xr(r, (e) => {
				J(t) === "…" ? e(i) : e(a, -1);
			}), X(e, n);
		});
		var i = R(r, 2);
		O(t), z((e, t) => {
			Hr(n, "aria-label", e), n.disabled = J(ie) === 1, Hr(i, "aria-label", t), i.disabled = !l();
		}, [() => Q("tablePage.cmsPrevPage"), () => Q("tablePage.cmsNextPage")]), tr("click", n, function(...e) {
			u()?.apply(this, e);
		}), tr("click", i, function(...e) {
			d()?.apply(this, e);
		}), X(e, t);
	}, r = Kr(t, "rows", 7), i = Kr(t, "table", 7), a = Kr(t, "moduleConfig", 7), o = Kr(t, "offset", 7), s = Kr(t, "limit", 7), c = Kr(t, "totalRows", 7), l = Kr(t, "hasMore", 7), u = Kr(t, "onPrevPage", 7), d = Kr(t, "onNextPage", 7), f = Kr(t, "onGoToPage", 7), p = Kr(t, "onPageSizeChange", 7), m = [
		10,
		25,
		50,
		100
	], h = /* @__PURE__ */ A(() => {
		let e = i().columns.filter((e) => e.is_primary_key);
		return e.length === 1 ? e[0] : null;
	}), g = /* @__PURE__ */ A(() => i().columns.find((e) => e.id === a().image_column_id) ?? null), _ = /* @__PURE__ */ A(() => i().columns.find((e) => e.id === a().title_column_id) ?? null), v = /* @__PURE__ */ A(() => i().columns.find((e) => e.id === a().description_column_id) ?? null), y = /* @__PURE__ */ A(() => a().template_id ?? null);
	function b(e) {
		return e.mime_type.startsWith("image/") && e.has_thumbnail;
	}
	function x(e, t) {
		return ji(e[t.effective_name]).find(b);
	}
	function S(e) {
		return J(_) ? Mi(e, J(_)) : J(h) ? $(e[J(h).effective_name]) : "";
	}
	function ee(e) {
		return J(v) ? Mi(e, J(v)) : "";
	}
	let C = /* @__PURE__ */ zt(Gt({})), w = /* @__PURE__ */ zt(Gt({}));
	async function te(e) {
		if (!J(h) || !J(y)) return;
		let t = String(e[J(h).effective_name]);
		P(C, {
			...J(C),
			[t]: !0
		}, !0), P(w, {
			...J(w),
			[t]: ""
		}, !0);
		try {
			let n = await fetch(`/api/v1/endpoint-modules/documents/${i().id}/${encodeURIComponent(t)}?format=pdf&template=${encodeURIComponent(J(y))}`, { method: "GET" });
			if (!n.ok) {
				let e = await n.json().catch(() => null);
				throw Error(e?.error?.message ?? e?.error ?? n.statusText);
			}
			let r = await n.blob(), a = URL.createObjectURL(r), o = document.createElement("a");
			o.href = a, o.download = `${S(e) || t}.pdf`, o.click(), URL.revokeObjectURL(a);
		} catch (e) {
			P(w, {
				...J(w),
				[t]: e instanceof Error ? e.message : String(e)
			}, !0);
		} finally {
			P(C, {
				...J(C),
				[t]: !1
			}, !0);
		}
	}
	let ne = /* @__PURE__ */ A(() => r().length === 0 ? 0 : o() + 1), re = /* @__PURE__ */ A(() => o() + r().length), ie = /* @__PURE__ */ A(() => Math.floor(o() / s()) + 1), ae = /* @__PURE__ */ A(() => Math.max(1, Math.ceil(c() / s())));
	function oe(e, t) {
		let n = Array.from({ length: Math.min(2, t) }, (e, t) => t + 1), r = Array.from({ length: Math.min(2, t) }, (e, n) => t - 2 + 1 + n).filter((e) => e > 0), i = e > 2 && e <= t - 2 ? [e] : [], a = [];
		function o(e) {
			for (let t of e) {
				let e = a[a.length - 1];
				typeof e == "number" && (t - e > 1 && a.push("…"), t <= e) || a.push(t);
			}
		}
		return o(n), o(i), o(r), a;
	}
	let se = /* @__PURE__ */ A(() => oe(J(ie), J(ae)));
	var ce = {
		get rows() {
			return r();
		},
		set rows(e) {
			r(e), N();
		},
		get table() {
			return i();
		},
		set table(e) {
			i(e), N();
		},
		get moduleConfig() {
			return a();
		},
		set moduleConfig(e) {
			a(e), N();
		},
		get offset() {
			return o();
		},
		set offset(e) {
			o(e), N();
		},
		get limit() {
			return s();
		},
		set limit(e) {
			s(e), N();
		},
		get totalRows() {
			return c();
		},
		set totalRows(e) {
			c(e), N();
		},
		get hasMore() {
			return l();
		},
		set hasMore(e) {
			l(e), N();
		},
		get onPrevPage() {
			return u();
		},
		set onPrevPage(e) {
			u(e), N();
		},
		get onNextPage() {
			return d();
		},
		set onNextPage(e) {
			d(e), N();
		},
		get onGoToPage() {
			return f();
		},
		set onGoToPage(e) {
			f(e), N();
		},
		get onPageSizeChange() {
			return p();
		},
		set onPageSizeChange(e) {
			p(e), N();
		}
	}, le = qi(), ue = L(le);
	n(L(ue)), O(ue);
	var de = R(ue, 2), fe = L(de), pe = (e) => {
		var t = Li(), n = L(t, !0);
		O(t), z((e) => Z(n, e), [() => Q("documentsView.noTemplateConfigured")]), X(e, t);
	}, me = (e) => {
		var t = Li(), n = L(t, !0);
		O(t), z((e) => Z(n, e), [() => Q("dataGrid.noRows")]), X(e, t);
	}, he = (e) => {
		var t = Gi();
		Er(t, 23, r, (e, t) => J(h) ? e[J(h).effective_name] : t, (e, t, n) => {
			let r = /* @__PURE__ */ A(() => J(g) ? x(J(t), J(g)) : void 0), a = /* @__PURE__ */ A(() => J(h) ? String(J(t)[J(h).effective_name]) : String(J(n)));
			var o = Wi(), s = L(o), c = L(s), l = (e) => {
				var n = Ri();
				z((e) => Hr(n, "src", e), [() => ei(i().id, J(h) ? J(t)[J(h).effective_name] : "", J(g).id, J(r).id)]), X(e, n);
			}, u = (e) => {
				X(e, zi());
			};
			xr(c, (e) => {
				J(r) ? e(l) : e(u, -1);
			}), O(s);
			var d = R(s, 2), f = L(d), p = L(f, !0);
			O(f);
			var m = R(f, 2), _ = (e) => {
				var n = Bi(), r = L(n, !0);
				O(n), z((e) => Z(r, e), [() => ee(J(t))]), X(e, n);
			};
			xr(m, (e) => {
				J(v) && e(_);
			}), O(d);
			var y = R(d, 2), b = L(y), ne = (e) => {
				var t = Vi(), n = L(t, !0);
				O(t), z((e) => Z(n, e), [() => Q("documentsView.generating")]), X(e, t);
			}, re = (e) => {
				var t = Hi(), n = L(t, !0);
				O(t), z(() => Z(n, J(w)[J(a)])), X(e, t);
			}, ie = (e) => {
				var t = Ui(), n = L(t, !0);
				O(t), z((e) => Z(n, e), [() => Q("documentsView.generateAndDownload")]), X(e, t);
			};
			xr(b, (e) => {
				J(C)[J(a)] ? e(ne) : J(w)[J(a)] ? e(re, 1) : e(ie, -1);
			}), O(y), O(o), z((e) => {
				o.disabled = J(C)[J(a)], Z(p, e);
			}, [() => S(J(t))]), tr("click", o, () => te(J(t))), X(e, o);
		}), O(t), X(e, t);
	};
	xr(fe, (e) => {
		J(y) ? r().length === 0 ? e(me, 1) : e(he, -1) : e(pe);
	}), O(de), Mr(de, (e) => Ni?.(e));
	var ge = R(de, 2), _e = L(ge), ve = L(_e), ye = L(ve), be = L(ye), xe = R(be);
	Er(xe, 20, () => m, (e) => e, (e, t) => {
		var n = Ki(), r = L(n, !0);
		O(n);
		var i = {};
		z(() => {
			Z(r, t), i !== (i = t) && (n.value = (n.__value = t) ?? "");
		}), X(e, n);
	}), O(xe);
	var Se;
	Lr(xe), O(ye);
	var Ce = R(ye, 2), we = L(Ce, !0);
	O(Ce), O(ve);
	var Te = R(ve, 2), Ee = L(Te), De = L(Ee, !0);
	O(Ee);
	var Oe = R(Ee, 2), ke = L(Oe, !0);
	return O(Oe), O(Te), O(_e), n(R(_e, 2)), O(ge), O(le), z((e, t, n, r) => {
		Z(be, `${e ?? ""} `), Se !== (Se = s()) && (xe.value = (xe.__value = s()) ?? "", Ir(xe, s())), Z(we, t), Ee.disabled = o() === 0, Z(De, n), Oe.disabled = !l(), Z(ke, r);
	}, [
		() => Q("tablePage.cmsPageSize"),
		() => Q("tablePage.cmsShowingRange", {
			from: J(ne),
			to: J(re),
			total: c()
		}),
		() => Q("tablePage.cmsPrevPage"),
		() => Q("tablePage.cmsNextPage")
	]), tr("change", xe, (e) => p()?.(Number(e.currentTarget.value))), tr("click", Ee, function(...e) {
		u()?.apply(this, e);
	}), tr("click", Oe, function(...e) {
		d()?.apply(this, e);
	}), X(e, le), Ve(ce);
}
nr(["click", "change"]), customElements.define("documents-view", Qr(Ji, {
	rows: {},
	table: {},
	moduleConfig: {},
	offset: {},
	limit: {},
	totalRows: {},
	hasMore: {},
	onPrevPage: {},
	onNextPage: {},
	onGoToPage: {},
	onPageSizeChange: {}
}, [], []));
//#endregion
export { Ji as default };
