var __defProp = Object.defineProperty; var __markAsModule = (target) => __defProp(target, "__esModule", {value: true}); var __export = (target, all) => { for (var name in all) __defProp(target, name, {get: all[name], enumerable: true}); }; __markAsModule(exports); __export(exports, { CUSTOM_TYPES: () => xe, Comment: () => zt, Component: () => Ot, CustomEvent: () => $, Document: () => Et, DocumentFragment: () => gh, Easer: () => Br, Element: () => v, ElementRoute: () => tr, ElementRouteTo: () => bi, Event: () => z, EventHandler: () => Gr, Fragment: () => st, HTMLButtonElement: () => wr, HTMLElement: () => Kt, HTMLHtmlElement: () => ph, HTMLInputElement: () => xr, HTMLOptionElement: () => Er, HTMLScriptElement: () => mh, HTMLSelectElement: () => vr, HTMLTextAreaElement: () => Sr, ImbaElement: () => su, IntersectionEventDefaults: () => Ke, KeyboardEvent: () => br, LazyProxy: () => or, MouseEvent: () => yr, Node: () => I, PointerEvent: () => _r, RenderContext: () => U, Router: () => Ze, SVGElement: () => Tr, Scheduler: () => ur, ShadowRoot: () => yh, TYPES: () => ve, Text: () => be, UIEvent: () => dh, Window: () => _h, asset: () => Gl, autorun: () => Va, clearInterval: () => ji, clearTimeout: () => qi, colors: () => fu, commit: () => P, createComment: () => Z, createComponent: () => Os, createDynamic: () => Ch, createElement: () => Sh, createFragment: () => Eh, createIndexedList: () => Wh, createKeyedList: () => Qh, createLiveFragment: () => qh, createRenderContext: () => dr, createSVGElement: () => wh, createSlot: () => Ht, createTextNode: () => Se, customElements: () => bh, defineTag: () => Ph, deserializeData: () => Kl, emit: () => A, events: () => Du, getDeepPropertyDescriptor: () => It, getRenderContext: () => Zl, getSuperTagType: () => $h, getTagType: () => Cs, get_document: () => Vt, hooks: () => fr, hotkeys: () => Eo, hydrate: () => iu, listen: () => D, manifest: () => ar, mount: () => cn, observable: () => Ha, once: () => F, parseTime: () => yt, patchManifest: () => Vl, process: () => Wl, proxy: () => lr, render: () => pu, renderContext: () => C, renderer: () => xt, router: () => Ra, run: () => Ua, scheduler: () => O, serializeData: () => zl, setInterval: () => Ri, setTimeout: () => Ai, styles: () => un, toCamelCase: () => Hl, transitions: () => Ae, unlisten: () => ct, unmount: () => dn, use_dom_bind: () => mu, use_dom_teleport: () => Tu, use_dom_transitions: () => Pu, use_events: () => Au, use_events_hotkey: () => ba, use_events_intersect: () => Wu, use_events_keyboard: () => Yr, use_events_mouse: () => Wt, use_events_pointer: () => qu, use_events_resize: () => ta, use_events_selection: () => ia, use_events_touch: () => Hu, use_hooks: () => Xl, use_router: () => Aa, use_slots: () => Rh, use_styles: () => cu, use_window: () => vh, \u03B1action: () => Xa, \u03B1autorun: () => Ga, \u03B1computed: () => Ba, \u03B1lazy: () => Ql, \u03B1observable: () => Ya, \u03B1ref: () => Wa }); var Pl = Object.create, nr = Object.defineProperty, kl = Object.getPrototypeOf, Ll = Object.prototype.hasOwnProperty, Ml = Object.getOwnPropertyNames, Fl = Object.getOwnPropertyDescriptor; var Il = (i) => nr(i, "__esModule", {value: true}); var Dl = (i, t) => () => (t || (t = {exports: {}}, i(t.exports, t)), t.exports); var Al = (i, t, e) => { if (t && typeof t == "object" || typeof t == "function") for (let r of Ml(t)) !Ll.call(i, r) && r !== "default" && nr(i, r, {get: () => t[r], enumerable: !(e = Fl(t, r)) || e.enumerable}); return i; }, Rl = (i) => Al(Il(nr(i != null ? Pl(kl(i)) : {}, "default", i && i.__esModule && "default" in i ? {get: () => i.default, enumerable: true} : {value: i, enumerable: true})), i); var Do = Dl((td, hi) => { "use strict"; var Pt = typeof Reflect == "object" ? Reflect : null, Oo = Pt && typeof Pt.apply == "function" ? Pt.apply : function(t, e, r) { return Function.prototype.apply.call(t, e, r); }, He; Pt && typeof Pt.ownKeys == "function" ? He = Pt.ownKeys : Object.getOwnPropertySymbols ? He = function(t) { return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)); } : He = function(t) { return Object.getOwnPropertyNames(t); }; function xa(i) { console && console.warn && console.warn(i); } var Co = Number.isNaN || function(t) { return t !== t; }; function S() { S.init.call(this); } hi.exports = S; hi.exports.once = Sa; S.EventEmitter = S; S.prototype._events = void 0; S.prototype._eventsCount = 0; S.prototype._maxListeners = void 0; var $o = 10; function Ue(i) { if (typeof i != "function") throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof i); } Object.defineProperty(S, "defaultMaxListeners", {enumerable: true, get: function() { return $o; }, set: function(i) { if (typeof i != "number" || i < 0 || Co(i)) throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + i + "."); $o = i; }}); S.init = function() { (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0; }; S.prototype.setMaxListeners = function(t) { if (typeof t != "number" || t < 0 || Co(t)) throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t + "."); return this._maxListeners = t, this; }; function Po(i) { return i._maxListeners === void 0 ? S.defaultMaxListeners : i._maxListeners; } S.prototype.getMaxListeners = function() { return Po(this); }; S.prototype.emit = function(t) { for (var e = [], r = 1; r < arguments.length; r++) e.push(arguments[r]); var s = t === "error", n = this._events; if (n !== void 0) s = s && n.error === void 0; else if (!s) return false; if (s) { var o; if (e.length > 0 && (o = e[0]), o instanceof Error) throw o; var l = new Error("Unhandled error." + (o ? " (" + o.message + ")" : "")); throw l.context = o, l; } var h = n[t]; if (h === void 0) return false; if (typeof h == "function") Oo(h, this, e); else for (var a = h.length, c = ko(h, a), r = 0; r < a; ++r) Oo(c[r], this, e); return true; }; function Lo(i, t, e, r) { var s, n, o; if (Ue(e), n = i._events, n === void 0 ? (n = i._events = Object.create(null), i._eventsCount = 0) : (n.newListener !== void 0 && (i.emit("newListener", t, e.listener ? e.listener : e), n = i._events), o = n[t]), o === void 0) o = n[t] = e, ++i._eventsCount; else if (typeof o == "function" ? o = n[t] = r ? [e, o] : [o, e] : r ? o.unshift(e) : o.push(e), s = Po(i), s > 0 && o.length > s && !o.warned) { o.warned = true; var l = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit"); l.name = "MaxListenersExceededWarning", l.emitter = i, l.type = t, l.count = o.length, xa(l); } return i; } S.prototype.addListener = function(t, e) { return Lo(this, t, e, false); }; S.prototype.on = S.prototype.addListener; S.prototype.prependListener = function(t, e) { return Lo(this, t, e, true); }; function wa() { if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = true, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments); } function Mo(i, t, e) { var r = {fired: false, wrapFn: void 0, target: i, type: t, listener: e}, s = wa.bind(r); return s.listener = e, r.wrapFn = s, s; } S.prototype.once = function(t, e) { return Ue(e), this.on(t, Mo(this, t, e)), this; }; S.prototype.prependOnceListener = function(t, e) { return Ue(e), this.prependListener(t, Mo(this, t, e)), this; }; S.prototype.removeListener = function(t, e) { var r, s, n, o, l; if (Ue(e), s = this._events, s === void 0) return this; if (r = s[t], r === void 0) return this; if (r === e || r.listener === e) --this._eventsCount == 0 ? this._events = Object.create(null) : (delete s[t], s.removeListener && this.emit("removeListener", t, r.listener || e)); else if (typeof r != "function") { for (n = -1, o = r.length - 1; o >= 0; o--) if (r[o] === e || r[o].listener === e) { l = r[o].listener, n = o; break; } if (n < 0) return this; n === 0 ? r.shift() : Ea(r, n), r.length === 1 && (s[t] = r[0]), s.removeListener !== void 0 && this.emit("removeListener", t, l || e); } return this; }; S.prototype.off = S.prototype.removeListener; S.prototype.removeAllListeners = function(t) { var e, r, s; if (r = this._events, r === void 0) return this; if (r.removeListener === void 0) return arguments.length === 0 ? (this._events = Object.create(null), this._eventsCount = 0) : r[t] !== void 0 && (--this._eventsCount == 0 ? this._events = Object.create(null) : delete r[t]), this; if (arguments.length === 0) { var n = Object.keys(r), o; for (s = 0; s < n.length; ++s) o = n[s], o !== "removeListener" && this.removeAllListeners(o); return this.removeAllListeners("removeListener"), this._events = Object.create(null), this._eventsCount = 0, this; } if (e = r[t], typeof e == "function") this.removeListener(t, e); else if (e !== void 0) for (s = e.length - 1; s >= 0; s--) this.removeListener(t, e[s]); return this; }; function Fo(i, t, e) { var r = i._events; if (r === void 0) return []; var s = r[t]; return s === void 0 ? [] : typeof s == "function" ? e ? [s.listener || s] : [s] : e ? Ta(s) : ko(s, s.length); } S.prototype.listeners = function(t) { return Fo(this, t, true); }; S.prototype.rawListeners = function(t) { return Fo(this, t, false); }; S.listenerCount = function(i, t) { return typeof i.listenerCount == "function" ? i.listenerCount(t) : Io.call(i, t); }; S.prototype.listenerCount = Io; function Io(i) { var t = this._events; if (t !== void 0) { var e = t[i]; if (typeof e == "function") return 1; if (e !== void 0) return e.length; } return 0; } S.prototype.eventNames = function() { return this._eventsCount > 0 ? He(this._events) : []; }; function ko(i, t) { for (var e = new Array(t), r = 0; r < t; ++r) e[r] = i[r]; return e; } function Ea(i, t) { for (; t + 1 < i.length; t++) i[t] = i[t + 1]; i.pop(); } function Ta(i) { for (var t = new Array(i.length), e = 0; e < t.length; ++e) t[e] = i[e].listener || i[e]; return t; } function Sa(i, t) { return new Promise(function(e, r) { function s() { n !== void 0 && i.removeListener("error", n), e([].slice.call(arguments)); } var n; t !== "error" && (n = function(l) { i.removeListener(t, s), r(l); }, i.once("error", n)), i.once(t, s); }); } }); function ae(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } var Za = Symbol.for("#__initor__"), tf = Symbol.for("#__inited__"), jl = Symbol.for("#type"), fe = Symbol.for("#__listeners__"), ql = /-./g, or = class { static for(t) { return new Proxy({}, new this(t)); } constructor(t) { this.getter = t; } get target() { return this.getter(); } get(t, e) { return this.target[e]; } set(t, e, r) { return this.target[e] = r, true; } }; function lr(i, t = {}) { return new Proxy(t, new or(i)); } function yt(i) { let t = typeof i; if (t == "number") return i; if (t == "string") { if (/^\d+fps$/.test(i)) return 1e3 / parseFloat(i); if (/^([-+]?[\d\.]+)s$/.test(i)) return parseFloat(i) * 1e3; if (/^([-+]?[\d\.]+)ms$/.test(i)) return parseFloat(i); } return null; } function zl(i) { let t = new Map(), e = [], r = false, s = function(h, a) { if (a && a[jl] && h !== "") { let c = t.get(a); return t.has(a) || (t.set(a, c = "$$" + e.length + "$$"), e.push(a)), h == null ? a : c; } return a; }, n = JSON.stringify(i, s, 2), o = 0; for (r = true; o < e.length; ) e[o] = JSON.stringify(e[o], s, 2), o++; let l = ""; for (let h = 0, a = ae(e), c = a.length; h < c; h++) { let u = a[h]; l += '"$$' + h + '$$":' + u + `, `; } return n = "{" + l + n.slice(1), n; } function Kl(i, t = null) { let e = {}, r = /\$\$\d+\$\$/, s = function(l) { return e[l] || (e[l] = t ? t(l) : {}); }, n = function(l, h) { if (typeof h == "string") { if (h[0] == "$" && r.test(h)) return s(h); } else if (typeof l == "string" && l[0] == "$" && r.test(l)) { let a = s(l); return Object.assign(a, h), a; } return h; }; return JSON.parse(i, n); } function Vl(i, t) { var e, r, s, n; let o = {}, l = {added: [], changed: [], removed: [], all: [], urls: {}}; if (i.assets) for (let h = 0, a = ae(i.assets), c = a.length; h < c; h++) { let u = a[h], d = u.originalPath || u.path; o[d] = u, u.url && ((e = t.urls)[r = u.url] || (e[r] = u)); } for (let h = 0, a = ae(t.assets || []), c = a.length; h < c; h++) { let u = a[h], d = u.originalPath || u.path, b = o[d]; u.url && i.urls && (i.urls[u.url] = u), b ? (b.hash != u.hash && (b.invalidated = Date.now(), b.replacedBy = u, u.replaces = b, l.changed.push(u), l.all.push(u), b == i.main && (l.main = u)), s = o[d], delete o[d]) : (l.added.push(u), l.all.push(u)); } for (let h = 0, a = Object.keys(o), c = a.length, u, d; h < c; h++) u = a[h], d = o[u], d.removed = Date.now(), l.all.push(d); for (let h = 0, a = ae(l.all), c = a.length; h < c; h++) { let u = a[h]; (l[n = u.type] || (l[n] = [])).push(u); } return l.removed = Object.values(o), t.changes = l, t; } function Hl(i) { return i.indexOf("-") >= 0 ? i.replace(ql, function(t) { return t.charAt(1).toUpperCase(); }) : i; } function It(i, t, e) { if (!i) return; let r = Object.getOwnPropertyDescriptor(i, t); return r || i == e ? r || void 0 : It(Reflect.getPrototypeOf(i), t, e); } var Li = function(i, t, e) { let r, s, n; for (; (r = e) && (e = e.next); ) (s = e.listener) && (e.path && s[e.path] ? n = t ? s[e.path].apply(s, t) : s[e.path]() : n = t ? s.apply(e, t) : s.call(e)), e.times && --e.times <= 0 && (r.next = e.next, e.listener = null); }; function D(i, t, e, r) { var s; let n, o, l; return n = i[fe] || (i[fe] = {}), o = n[t] || (n[t] = {}), l = o.tail || (o.tail = o.next = {}), l.listener = e, l.path = r, o.tail = l.next = {}, l; } function F(i, t, e) { let r = D(i, t, e); return r.times = 1, r; } function ct(i, t, e, r) { let s, n, o = i[fe]; if (!!o && (s = o[t])) { for (; (n = s) && (s = s.next); ) if (s == e || s.listener == e) { n.next = s.next, s.listener = null; break; } } } function A(i, t, e) { let r; (r = i[fe]) && (r[t] && Li(t, e, r[t]), r.all && Li(t, [t, e], r.all)); } function Ul(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } var Mi = Symbol.for("#__init__"), rf = Symbol.for("#__initor__"), sf = Symbol.for("#__inited__"), Fi = Symbol.for("#schedule"), hr = Symbol.for("#frames"), ce = Symbol.for("#interval"), _t = Symbol.for("#stage"), bt = Symbol.for("#scheduled"), de = Symbol.for("#version"), Bl = Symbol.for("#fps"), Ii = Symbol.for("#ticker"), Yl = globalThis.requestAnimationFrame || function(i) { return globalThis.setTimeout(i, 1e3 / 60); }; var nf = 1 / 60, Di = class { constructor(t = null) { this[Mi](t); } [Mi](t = null) { var e; this.owner = t && (e = t.owner) !== void 0 ? e : null, this.target = t && (e = t.target) !== void 0 ? e : null, this.active = t && (e = t.active) !== void 0 ? e : false, this.value = t && (e = t.value) !== void 0 ? e : void 0, this.skip = t && (e = t.skip) !== void 0 ? e : 0, this.last = t && (e = t.last) !== void 0 ? e : 0; } tick(t, e) { return this.last = this.owner[hr], this.target.tick(this, e), 1; } update(t, e) { let r = this.active, s = t.value; return this.value != s && (this.deactivate(), this.value = s), (this.value || r || e) && this.activate(), this; } queue() { this.owner.add(this); } activate() { return this.value === true ? this.owner.on("commit", this) : this.value === false || typeof this.value == "number" && (this.value / (1e3 / 60) <= 2 ? this.owner.on("raf", this) : this[ce] = globalThis.setInterval(this.queue.bind(this), this.value)), this.active = true, this; } deactivate() { return this.value === true && this.owner.un("commit", this), this.owner.un("raf", this), this[ce] && (globalThis.clearInterval(this[ce]), this[ce] = null), this.active = false, this; } }, ur = class { constructor() { var t = this; this.id = Symbol(), this.queue = [], this.stage = -1, this[_t] = -1, this[hr] = 0, this[bt] = false, this[de] = 0, this.listeners = {}, this.intervals = {}, t.commit = function() { return t.add("commit"), t; }, this[Bl] = 0, t.$promise = null, t.$resolve = null, this[Ii] = function(e) { return t[bt] = false, t.tick(e); }; } touch() { return this[de]++; } get version() { return this[de]; } add(t, e) { return (e || this.queue.indexOf(t) == -1) && this.queue.push(t), this[bt] || this[Fi](), this; } get committing\u03A6() { return this.queue.indexOf("commit") >= 0; } get syncing\u03A6() { return this[_t] == 1; } listen(t, e) { let r = this.listeners[t], s = !r; return r || (r = this.listeners[t] = new Set()), r.add(e), t == "raf" && s && this.add("raf"), this; } unlisten(t, e) { var r; let s = this.listeners[t]; return s && s.delete(e), t == "raf" && s && s.size == 0 && (r = this.listeners.raf, delete this.listeners.raf), this; } on(t, e) { return this.listen(t, e); } un(t, e) { return this.unlisten(t, e); } get promise() { var t = this; return t.$promise || (t.$promise = new Promise(function(e) { return t.$resolve = e; })); } tick(t) { var e = this; let r = this.queue, s = this[hr]++; if (this.ts || (this.ts = t), this.dt = t - this.ts, this.ts = t, this.queue = [], this[_t] = 1, this[de]++, r.length) for (let n = 0, o = Ul(r), l = o.length; n < l; n++) { let h = o[n]; typeof h == "string" && this.listeners[h] ? e.listeners[h].forEach(function(a) { if (a.tick instanceof Function) return a.tick(e, h); if (a instanceof Function) return a(e, h); }) : h instanceof Function ? h(e.dt, e) : h.tick && h.tick(e.dt, e); } return this[_t] = this[bt] ? 0 : -1, e.$promise && (e.$resolve(e), e.$promise = e.$resolve = null), e.listeners.raf && e.add("raf"), e; } [Fi]() { return this[bt] || (this[bt] = true, this[_t] == -1 && (this[_t] = 0), Yl(this[Ii])), this; } schedule(t, e) { var r, s; return e || (e = t[r = this.id] || (t[r] = {value: true})), (e[s = this.id] || (e[s] = new Di({owner: this, target: t}))).update(e, true); } unschedule(t, e = {}) { e || (e = t[this.id]); let r = e && e[this.id]; return r && r.active && r.deactivate(), this; } }, O = new ur(); function P() { return O.add("commit").promise; } function Ai(i, t) { return globalThis.setTimeout(function() { i(), P(); }, t); } function Ri(i, t) { return globalThis.setInterval(function() { i(), P(); }, t); } var ji = globalThis.clearInterval, qi = globalThis.clearTimeout, Dt = globalThis.imba || (globalThis.imba = {}); Dt.commit = P; Dt.setTimeout = Ai; Dt.setInterval = Ri; Dt.clearInterval = ji; Dt.clearTimeout = qi; var lf = Symbol.for("#__initor__"), hf = Symbol.for("#__inited__"), zi = class { constructor() { this.data = {}; } }, ar = new zi(); var Wl = {}; var cf = Symbol.for("#__initor__"), df = Symbol.for("#__inited__"), Ki = Symbol.for("#__init__"), Vi = Symbol.for("#warned"), vt = Symbol.for("#asset"), pe = class { static wrap(t) { let e = new pe(t); return new Proxy(e, e); } constructor(t) { this.meta = t; } get input() { return ar.inputs[this.meta.input]; } get asset() { return globalThis._MF_ ? this.meta : this.input ? this.input.asset : null; } set(t, e, r) { return true; } get(t, e) { return this.meta.meta && this.meta.meta[e] != null ? this.meta.meta[e] : this.asset ? e == "absPath" && !this.asset.absPath ? this.asset.url : this.asset[e] : ((this.meta[Vi] != true ? (this.meta[Vi] = true, true) : false) && console.warn("Asset for '" + this.meta.input + "' not found"), e == "valueOf" ? function() { return ""; } : null); } }, Hi = class { constructor(t = null) { this[Ki](t); } [Ki](t = null) { this.url = t ? t.url : void 0, this.meta = t ? t.meta : void 0; } adoptNode(t) { var e; if ((e = this.meta) == null ? void 0 : e.content) { for (let r = this.meta.attributes, s = 0, n = Object.keys(r), o = n.length, l, h; s < o; s++) l = n[s], h = r[l], t.setAttribute(l, h); t.innerHTML = this.meta.content; } return this; } toString() { return this.url; } toStyleString() { return "url(" + this.url + ")"; } }; function Gl(i) { var t, e; if (i[vt]) return i[vt]; if (i.type == "svg") return i[vt] || (i[vt] = new Hi(i)); if (i.input) { let r = globalThis._MF_ && globalThis._MF_[i.input]; return r && (Object.assign(i, r), i.toString = function() { return this.absPath; }), i[vt] || (i[vt] = pe.wrap(i)); } return i; } var fr = {on: function(i, t) { return D(this, i, t); }, inited: function(i) { return A(this, "inited", [i]); }}; function Xl() { return true; } function Ql(i, t, e) { if (e.get) { let r = e.get; e.get = function() { let s = r.call(this); return Object.defineProperty(this, t, {enumerable: false, value: s}), s; }; } return e; } var Ui = Symbol.for("#toStringDeopt"), _f = Symbol.for("#__initor__"), bf = Symbol.for("#__inited__"), Bi = Symbol.for("#symbols"), Yi = Symbol.for("#batches"), Wi = Symbol.for("#extras"), Gi = Symbol.for("#stacks"), At = class { constructor(t) { this.dom = t, this.string = ""; } contains(t) { return this.dom.classList.contains(t); } add(t) { return this.contains(t) ? this : (this.string += (this.string ? " " : "") + t, this.dom.classList.add(t), this); } remove(t) { if (!this.contains(t)) return this; let e = new RegExp("(^|\\s)" + t + "(?=\\s|$)", "g"); return this.string = this.string.replace(e, ""), this.dom.classList.remove(t), this; } toggle(t, e) { return e === void 0 && (e = !this.contains(t)), e ? this.add(t) : this.remove(t); } incr(t, e = 0) { var r = this; let s = this.stacks, n = s[t] || 0; return n < 1 && this.add(t), e > 0 && setTimeout(function() { return r.decr(t); }, e), s[t] = Math.max(n, 0) + 1; } decr(t) { let e = this.stacks, r = e[t] || 0; return r == 1 && this.remove(t), e[t] = Math.max(r, 1) - 1; } reconcile(t, e) { let r = this[Bi], s = this[Yi], n = true; if (!r) r = this[Bi] = [t], s = this[Yi] = [e || ""], this.toString = this.valueOf = this[Ui]; else { let o = r.indexOf(t), l = e || ""; o == -1 ? (r.push(t), s.push(l)) : s[o] != l ? s[o] = l : n = false; } n && (this[Wi] = " " + s.join(" "), this.sync()); } valueOf() { return this.string; } toString() { return this.string; } [Ui]() { return this.string + (this[Wi] || ""); } sync() { return this.dom.flagSync$(); } get stacks() { return this[Gi] || (this[Gi] = {}); } }; var me = Symbol.for("#__init__"), Xi = Symbol.for("#__initor__"), Qi = Symbol.for("#__inited__"), cr = Symbol.for("#getRenderContext"), Jl = Symbol.for("#getDynamicContext"), Ji = Symbol(), C = {context: null}, Zi = class { constructor(t = null) { this[me](t); } [me](t = null) { var e; this.stack = t && (e = t.stack) !== void 0 ? e : []; } push(t) { return this.stack.push(t); } pop(t) { return this.stack.pop(); } }, xt = new Zi(), U = class extends Map { static [me]() { return this.prototype[Xi] = Ji, this; } constructor(t, e = null) { super(); this._ = t, this.sym = e, this[Xi] === Ji && this[Qi] && this[Qi](); } pop() { return C.context = null; } [cr](t) { let e = this.get(t); return e || this.set(t, e = new U(this._, t)), C.context = e; } [Jl](t, e) { return this[cr](t)[cr](e); } run(t) { return this.value = t, C.context == this && (C.context = null), this.get(t); } cache(t) { return this.set(this.value, t), t; } }; U[me](); function dr(i, t = Symbol(), e = i) { return C.context = i[t] || (i[t] = new U(e, t)); } function Zl() { let i = C.context, t = i || new U(null); return globalThis.DEBUG_IMBA && !i && xt.stack.length > 0 && console.warn("detected unmemoized nodes in", xt.stack, "see https://imba.io", t), i && (C.context = null), t; } function Rt(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } function th(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } var ge = Symbol.for("#parent"), ts = Symbol.for("#closestNode"), eh = Symbol.for("#parentNode"), rh = Symbol.for("#context"), ye = Symbol.for("#__init__"), es = Symbol.for("##inited"), pr = Symbol.for("#getRenderContext"), ih = Symbol.for("#getDynamicContext"), rs = Symbol.for("#insertChild"), jt = Symbol.for("#appendChild"), mr = Symbol.for("#replaceChild"), is = Symbol.for("#removeChild"), J = Symbol.for("#insertInto"), ss = Symbol.for("#insertIntoDeopt"), qt = Symbol.for("#removeFrom"), ns = Symbol.for("#removeFromDeopt"), St = Symbol.for("#replaceWith"), os = Symbol.for("#replaceWithDeopt"), gr = Symbol.for("#placeholderNode"), sh = Symbol.for("#attachToParent"), nh = Symbol.for("#detachFromParent"), oh = Symbol.for("#placeChild"), lh = Symbol.for("#beforeReconcile"), hh = Symbol.for("#afterReconcile"), uh = Symbol.for("#afterVisit"), ls = Symbol.for("#__initor__"), hs = Symbol.for("#__inited__"), us = Symbol.for("##parent"), ah = Symbol.for("##up"), as = Symbol.for("##context"), dt = Symbol.for("#domNode"), _e = Symbol.for("##placeholderNode"), fs = Symbol.for("#domDeopt"), cs = Symbol.for("#isRichElement"), ds = Symbol.for("#src"), wt = Symbol.for("#htmlNodeName"), fh = Symbol.for("#getSlot"), ps = Symbol.for("#ImbaElement"), ms = Symbol.for("#cssns"), ch = Symbol.for("#cssid"), gs = Symbol(), {Event: z, UIEvent: dh, MouseEvent: yr, PointerEvent: _r, KeyboardEvent: br, CustomEvent: $, Node: I, Comment: zt, Text: be, Element: v, HTMLElement: Kt, HTMLHtmlElement: ph, HTMLSelectElement: vr, HTMLInputElement: xr, HTMLTextAreaElement: Sr, HTMLButtonElement: wr, HTMLOptionElement: Er, HTMLScriptElement: mh, SVGElement: Tr, DocumentFragment: gh, ShadowRoot: yh, Document: Et, Window: _h, customElements: bh} = globalThis.window, ys = {}; function _s(i, t, e) { if (!i) return e[t] = null; if (e[t] !== void 0) return e[t]; let r = Object.getOwnPropertyDescriptor(i, t); return r !== void 0 || i == Tr ? e[t] = r || null : _s(Reflect.getPrototypeOf(i), t, e); } var Nr = {}, Or = {}, ve = {}, xe = {}; function Vt() { return globalThis.document; } function vh() { return true; } var xh = {get(i, t) { let e = i, r; for (; e && r == null; ) (e = e[ge]) && (r = e[t]); return r; }, set(i, t, e) { let r = i, s; for (; r && s == null; ) { if (It(r, t, v)) return r[t] = e, true; r = r[ge]; } return true; }}, bs = class { get flags() { return this.documentElement.flags; } }; Rt(Et.prototype, bs.prototype); var vs = class { get [ge]() { return this[us] || this.parentNode || this[ah]; } get [ts]() { return this; } get [eh]() { return this[ge][ts]; } get [rh]() { return this[as] || (this[as] = new Proxy(this, xh)); } [ye]() { return this; } [es]() { return this; } [pr](t) { return dr(this, t); } [ih](t, e) { return this[pr](t)[pr](e); } [rs](t, e) { return t[J](this, e); } [jt](t) { return t[J](this, null); } [mr](t, e) { let r = this[rs](t, e); return this[is](e), r; } [is](t) { return t[qt](this); } [J](t, e = null) { return e ? t.insertBefore(this, e) : t.appendChild(this), this; } [ss](t, e) { return e ? t.insertBefore(this[dt] || this, e) : t.appendChild(this[dt] || this), this; } [qt](t) { return t.removeChild(this); } [ns](t) { return t.removeChild(this[dt] || this); } [St](t, e) { return e[mr](t, this); } [os](t, e) { return e[mr](t, this[dt] || this); } get [gr]() { return this[_e] || (this[_e] = globalThis.document.createComment("placeholder")); } set [gr](t) { let e = this[_e]; this[_e] = t, e && e != t && e.parentNode && e[St](t); } [sh]() { let t = this[dt], e = t && t.parentNode; return t && e && t != this && (this[dt] = null, this[J](e, t), t[qt](e)), this; } [nh]() { (this[fs] != true ? (this[fs] = true, true) : false) && (this[St] = this[os], this[qt] = this[ns], this[J] = this[ss]); let t = this[gr]; return this.parentNode && t != this && (t[J](this.parentNode, this), this[qt](this.parentNode)), this[dt] = t, this; } [oh](t, e, r) { let s = typeof t; if (s === "undefined" || t === null) { if (r && r instanceof zt) return r; let n = globalThis.document.createComment(""); return r ? r[St](n, this) : n[J](this, null); } if (t === r) return t; if (s !== "object") { let n, o = t; return e & 128 && e & 256, r ? r instanceof be ? (r.textContent = o, r) : (n = globalThis.document.createTextNode(o), r[St](n, this), n) : (this.appendChild(n = globalThis.document.createTextNode(o)), n); } else { if (globalThis.DEBUG_IMBA && !t[J]) throw console.warn("Tried to insert", t, "into", this), new TypeError("Only DOM Nodes can be inserted into DOM"); return r ? r[St](t, this) : t[J](this, null); } } }; Rt(I.prototype, vs.prototype); var xs = class { log(...t) { return console.log(...t), this; } emit(t, e, r = {bubbles: true, cancelable: true}) { e != null && (r.detail = e); let s = new $(t, r), n = this.dispatchEvent(s); return s; } text$(t) { return this.textContent = t, this; } [lh]() { return this; } [hh]() { return this; } [uh]() { this.render && this.render(); } get flags() { return this.$flags || (this.$flags = new At(this), this.flag$ == v.prototype.flag$ && (this.flags$ext = this.className), this.flagDeopt$()), this.$flags; } flag$(t) { let e = this.flags$ns; this.className = e ? e + (this.flags$ext = t) : this.flags$ext = t; } flagDeopt$() { var t = this; this.flag$ = this.flagExt$, t.flagSelf$ = function(e) { return t.flagSync$(t.flags$own = e); }; } flagExt$(t) { return this.flagSync$(this.flags$ext = t); } flagSelf$(t) { return this.flagDeopt$(), this.flagSelf$(t); } flagSync$() { return this.className = (this.flags$ns || "") + (this.flags$ext || "") + " " + (this.flags$own || "") + " " + (this.$flags || ""); } set$(t, e) { let r = It(this, t, v); !r || !r.set ? this.setAttribute(t, e) : this[t] = e; } get richValue() { return this.value; } set richValue(t) { this.value = t; } }; Rt(v.prototype, xs.prototype); v.prototype.setns$ = v.prototype.setAttributeNS; v.prototype[cs] = true; function Sh(i, t, e, r) { let s = globalThis.document.createElement(i); return e && (s.className = e), r !== null && s.text$(r), t && t[jt] && t[jt](s), s; } var Ss = class { set$(t, e) { var r; let s = ys[r = this.nodeName] || (ys[r] = {}), n = _s(this, t, s); !n || !n.set ? this.setAttribute(t, e) : this[t] = e; } flag$(t) { let e = this.flags$ns; this.setAttribute("class", e ? e + (this.flags$ext = t) : this.flags$ext = t); } flagSelf$(t) { var e = this; return e.flag$ = function(r) { return e.flagSync$(e.flags$ext = r); }, e.flagSelf$ = function(r) { return e.flagSync$(e.flags$own = r); }, e.flagSelf$(t); } flagSync$() { return this.setAttribute("class", (this.flags$ns || "") + (this.flags$ext || "") + " " + (this.flags$own || "") + " " + (this.$flags || "")); } }; Rt(Tr.prototype, Ss.prototype); var ws = class { set src(t) { if ((this[ds] != t ? (this[ds] = t, true) : false) && t) { if (t.adoptNode) t.adoptNode(this); else if (t.content) { for (let e = t.attributes, r = 0, s = Object.keys(e), n = s.length, o, l; r < n; r++) o = s[r], l = e[o], this.setAttribute(o, l); this.innerHTML = t.content; } } } }; Rt(SVGSVGElement.prototype, ws.prototype); function wh(i, t, e, r, s) { let n = globalThis.document.createElementNS("http://www.w3.org/2000/svg", i); return e && (n.className.baseVal = e), t && t[jt] && t[jt](n), r && (n.textContent = r), n; } function Z(i) { return globalThis.document.createComment(i); } function Se(i) { return globalThis.document.createTextNode(i); } function Eh() { return globalThis.document.createDocumentFragment(); } var we = globalThis.navigator, Th = we && we.vendor || "", Es = we && we.userAgent || "", Nh = Th.indexOf("Apple") > -1 || Es.indexOf("CriOS") >= 0 || Es.indexOf("FxiOS") >= 0, Ee = !Nh, Ts = new Map(), Ns = class extends Kt { connectedCallback() { return Ee ? this.parentNode.removeChild(this) : this.parentNode.connectedCallback(); } disconnectedCallback() { if (!Ee) return this.parentNode.disconnectedCallback(); } }; window.customElements.define("i-hook", Ns); function Oh(i, t) { let e = Ts.get(t); if (!e) { e = {}; let r = t.prototype, s = [r]; for (; (r = r && Object.getPrototypeOf(r)) && r.constructor != i.constructor; ) s.unshift(r); for (let n = 0, o = th(s), l = o.length; n < l; n++) { let h = o[n], a = Object.getOwnPropertyDescriptors(h); Object.assign(e, a); } Ts.set(t, e); } return e; } function Os(i, t, e, r, s) { let n; typeof i != "string" && i && i.nodeName && (i = i.nodeName); let o = Or[i] || i; if (Nr[i]) { let l = Nr[i], h = l.prototype[wt]; if (h && Ee) n = globalThis.document.createElement(h, {is: i}); else if (l.create$ && h) { n = globalThis.document.createElement(h), n.setAttribute("is", o); let a = Oh(n, l); Object.defineProperties(n, a), n.__slots = {}, n.appendChild(globalThis.document.createElement("i-hook")); } else l.create$ ? (n = l.create$(n), n.__slots = {}) : console.warn("could not create tag " + i); } else n = globalThis.document.createElement(Or[i] || i); return n[us] = t, n[ye](), n[es](), r !== null && n[fh]("__").text$(r), (e || n.flags$ns) && n.flag$(e || ""), n; } function Ch(i, t, e, r) { if (i == null || i == null) return Z(""); if (i instanceof I) return i; if (i[cs]) return i; if (typeof i == "string" || i && i.prototype instanceof I) return Os(i, t, e, r); } function Cs(i, t) { if (ve[i]) return ve[i]; if (window[t]) return window[t]; if (window[i]) return window[i]; } function $h(i, t, e) { let r = Cs(i, t); if (!(r == e || r.prototype instanceof e || r.prototype[wt])) { let n = r.prototype[ps]; if (!n) { n = class extends r { static [ye]() { return this.prototype[ls] = gs, this; } constructor() { super(...arguments); this.__slots = {}, this.__F = 0, this[ls] === gs && this[hs] && this[hs](); } }[ye](), r.prototype[ps] = n; let o = Object.getOwnPropertyDescriptors(e.prototype); Object.defineProperties(n.prototype, o), n.prototype[wt] = i; } return n; } return r; } function Ph(i, t, e = {}) { ve[i] = xe[i] = t, t.nodeName = i; let r = i, s = t.prototype; if (i.indexOf("-") == -1 && (r = "" + i + "-tag", Or[i] = r), e.cssns) { let n = (s._ns_ || s[ms] || "") + " " + (e.cssns || ""); s._ns_ = n.trim() + " ", s[ms] = e.cssns; } if (e.cssid) { let n = (s.flags$ns || "") + " " + e.cssid; s[ch] = e.cssid, s.flags$ns = n.trim() + " "; } return s[wt] && !e.extends && (e.extends = s[wt]), e.extends ? (s[wt] = e.extends, Nr[i] = t, Ee && window.customElements.define(r, t, {extends: e.extends})) : window.customElements.define(r, t), t; } var kh = globalThis.imba || (globalThis.imba = {}); kh.document = globalThis.document; function Cr(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } function Lh(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } var Te = Symbol.for("#parent"), $s = Symbol.for("#closestNode"), Mh = Symbol.for("#isRichElement"), Fh = Symbol.for("#afterVisit"), Ps = Symbol.for("#__initor__"), ks = Symbol.for("#__inited__"), Ls = Symbol.for("#appendChild"), Ms = Symbol.for("#removeChild"), tt = Symbol.for("#insertInto"), Ne = Symbol.for("#replaceWith"), Fs = Symbol.for("#insertChild"), Oe = Symbol.for("#removeFrom"), Is = Symbol.for("#placeChild"), Ds = Symbol.for("#__init__"), Ih = Symbol.for("#registerFunctionalSlot"), Dh = Symbol.for("#getFunctionalSlot"), As = Symbol.for("#getSlot"), $r = Symbol.for("##parent"), Ce = Symbol.for("##up"), Rs = Symbol.for("##flags"), Ah = Symbol.for("#domFlags"), K = Symbol.for("#end"), js = Symbol.for("#textContent"), $e = Symbol.for("#textNode"), Pr = Symbol.for("#functionalSlots"), qs = Symbol(); function Rh() { return true; } var st = class { constructor() { this.childNodes = []; } log(...t) { } hasChildNodes() { return false; } set [Te](t) { this[$r] = t; } get [Te]() { return this[$r] || this[Ce]; } get [$s]() { return this[Te][$s]; } get [Mh]() { return true; } get flags() { return this[Rs] || (this[Rs] = new At(this)); } flagSync$() { return this; } [Fh]() { return this; } }, jh = 0, Pe = class extends st { static [Ds]() { return this.prototype[Ps] = qs, this; } constructor(t, e) { super(...arguments); this[Ce] = e, this.parentNode = null, this[Ah] = t, this.childNodes = [], this[K] = Z("slot" + jh++), e && e[Ls](this), this[Ps] === qs && this[ks] && this[ks](); } get [Te]() { return this[$r] || this.parentNode || this[Ce]; } set textContent(t) { this[js] = t; } get textContent() { return this[js]; } hasChildNodes() { for (let t = 0, e = Cr(this.childNodes), r = e.length; t < r; t++) { let s = e[t]; if (s instanceof st && s.hasChildNodes()) return true; if (!(s instanceof zt)) { if (s instanceof I) return true; } } return false; } text$(t) { return this[$e] ? this[$e].textContent = t : this[$e] = this[Is](t), this[$e]; } appendChild(t) { return this.parentNode && t[tt](this.parentNode, this[K]), this.childNodes.push(t); } [Ls](t) { return this.parentNode && t[tt](this.parentNode, this[K]), this.childNodes.push(t); } insertBefore(t, e) { this.parentNode && this.parentNode[Fs](t, e); let r = this.childNodes.indexOf(e); return r >= 0 && this.childNodes.splice(r, 0, t), t; } [Ms](t) { this.parentNode && this.parentNode[Ms](t); let e = this.childNodes.indexOf(t); e >= 0 && this.childNodes.splice(e, 1); } [tt](t, e) { let r = this.parentNode; if (this.parentNode != t ? (this.parentNode = t, true) : false) { this[K] && (e = this[K][tt](t, e)); for (let s = 0, n = Cr(this.childNodes), o = n.length; s < o; s++) n[s][tt](t, e); } return this; } [Ne](t, e) { let r = t[tt](e, this[K]); return this[Oe](e), r; } [Fs](t, e) { if (this.parentNode && this.insertBefore(t, e || this[K]), e) { let r = this.childNodes.indexOf(e); r >= 0 && this.childNodes.splice(r, 0, t); } else this.childNodes.push(t); return t; } [Oe](t) { for (let e = 0, r = Cr(this.childNodes), s = r.length; e < s; e++) r[e][Oe](t); return this[K] && this[K][Oe](t), this.parentNode = null, this; } [Is](t, e, r) { let s = this.parentNode, n = typeof t; if (n === "undefined" || t === null) { if (r && r instanceof zt) return r; let o = Z(""); if (r) { let l = this.childNodes.indexOf(r); return this.childNodes.splice(l, 1, o), s && r[Ne](o, s), o; } return this.childNodes.push(o), s && o[tt](s, this[K]), o; } if (t === r) return t; if (n !== "object") { let o, l = t; if (r) { if (r instanceof be) return r.textContent = l, r; { o = Se(l); let h = this.childNodes.indexOf(r); return this.childNodes.splice(h, 1, o), s && r[Ne](o, s), o; } } else return this.childNodes.push(o = Se(l)), s && o[tt](s, this[K]), o; } else if (r) { let o = this.childNodes.indexOf(r); return this.childNodes.splice(o, 1, t), s && r[Ne](t, s), t; } else return this.childNodes.push(t), s && t[tt](s, this[K]), t; } }; Pe[Ds](); function qh(i, t) { return new Pe(i, t); } function Ht(i, t) { let e = new Pe(i, null); return e[Ce] = t, e; } var zs = class { [Ih](t) { let e = this[Pr] || (this[Pr] = {}); return e[t] || (e[t] = Ht(0, this)); } [Dh](t, e) { let r = this[Pr]; return r && r[t] || this[As](t, e); } [As](t, e) { var r; return t == "__" && !this.render ? this : (r = this.__slots)[t] || (r[t] = Ht(0, this)); } }; Lh(I.prototype, zs.prototype); function zh(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } var Kh = Symbol.for("#afterVisit"), ke = Symbol.for("#insertInto"), Ks = Symbol.for("#appendChild"), Vh = Symbol.for("#replaceWith"), kr = Symbol.for("#removeFrom"), Vs = Symbol.for("#__initor__"), Hs = Symbol.for("#__inited__"), Us = Symbol.for("#__init__"), Hh = Symbol.for("#domFlags"), Uh = Symbol.for("##parent"), nt = Symbol.for("#end"), Bh = Symbol.for("#removeChild"), Yh = Symbol.for("#insertChild"), Bs = Symbol(), Lr = class extends st { static [Us]() { return this.prototype[Vs] = Bs, this; } constructor(t, e) { super(...arguments); this[Hh] = t, this[Uh] = e, t & 256 || (this[nt] = Z("list")), this.$ = this.childNodes, this.length = 0, e && e[Ks](this), this[Vs] === Bs && this[Hs] && this[Hs](); } hasChildNodes() { return this.length != 0; } [Kh](t) { let e = this.length; if (this.length = t, e == t) return; let r = this.parentNode; if (!r) return; let s = this.childNodes, n = this[nt]; if (e > t) for (; e > t; ) r[Bh](s[--e]); else if (t > e) for (; t > e; ) r[Yh](s[e++], n); this.length = t; } [ke](t, e) { this.parentNode = t, this[nt] && this[nt][ke](t, e), e = this[nt]; for (let r = 0, s = zh(this.childNodes), n = s.length; r < n; r++) { let o = s[r]; if (r == this.length) break; o[ke](t, e); } return this; } [Ks](t) { } [Vh](t, e) { let r = t[ke](e, this[nt]); return this[kr](e), r; } [kr](t) { let e = this.length; for (; e > 0; ) this.childNodes[--e][kr](t); this[nt] && t.removeChild(this[nt]), this.parentNode = null; } }; Lr[Us](); function Wh(i, t) { return new Lr(i, t); } function Ys(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } var Mr = Symbol.for("#appendChild"), Le = Symbol.for("#insertChild"), Gh = Symbol.for("#replaceWith"), Me = Symbol.for("#insertInto"), Fr = Symbol.for("#removeFrom"), Xh = Symbol.for("#afterVisit"), Ws = Symbol.for("#__initor__"), Gs = Symbol.for("#__inited__"), Xs = Symbol.for("#__init__"), Fe = Symbol.for("#domFlags"), Qs = Symbol.for("##parent"), ot = Symbol.for("#end"), Js = Symbol.for("#removeChild"), Zs = Symbol(), Ir = class extends st { static [Xs]() { return this.prototype[Ws] = Zs, this; } constructor(t, e) { super(...arguments); this[Fe] = t, this[Qs] = e, this.changes = new Map(), this.dirty = false, this.array = this.childNodes, this.$ = new U(this, Symbol()), t & 256 || (this[ot] = Z("map")), e && e[Mr](this), this[Ws] === Zs && this[Gs] && this[Gs](); } [Mr](t) { if (this.parentNode) return this.parentNode[Le](t, this[ot]); } hasChildNodes() { return this.childNodes.length != 0; } push(t, e) { if (!(this[Fe] & 1)) { this.array.push(t), this[Mr](t); return; } let r = this.array[e]; if (r !== t) { this.dirty = true; let s = this.array.indexOf(t), n = this.changes.get(t); s === -1 ? (this.array.splice(e, 0, t), this.insertChild(t, e, s)) : s === e + 1 ? (r && this.changes.set(r, -1), this.array.splice(e, 1)) : (s >= 0 && this.array.splice(s, 1), this.array.splice(e, 0, t), this.moveChild(t, e, s)), n == -1 && this.changes.delete(t); } } insertChild(t, e, r) { let s = this.parentNode; if (!!s) if (e > 0) { let n = this.array[e - 1]; s[Le](t, n.nextSibling); } else s[Le](t, this.childNodes[e + 1] || this[ot]); } moveChild(t, e, r) { return this.insertChild(t, e, r); } removeChild(t, e) { t.parentNode && t[Fr](t.parentNode); } [Le](t, e) { } [Gh](t, e) { let r = t[Me](e, this[ot]); return this[Fr](e), r; } [Me](t, e) { this[Qs] = t; let r = this.parentNode; if (t != r) { this.parentNode = t; for (let s = 0, n = Ys(this.array), o = n.length; s < o; s++) n[s][Me](t, e); this[ot] && this[ot][Me](t, e); } return this; } [Fr](t) { for (let e = 0, r = Ys(this.array), s = r.length; e < s; e++) { let n = r[e]; t[Js](n); } return this[ot] && t[Js](this[ot]), this.parentNode = null; } [Xh](t) { var e = this; if (!(this[Fe] & 1)) { this[Fe] |= 1; return; } if (this.dirty && (e.changes.forEach(function(r, s) { if (r == -1) return e.removeChild(s); }), e.changes.clear(), e.dirty = false), e.array.length > t) for (; e.array.length > t; ) { let r = e.array.pop(); e.removeChild(r); } } }; Ir[Xs](); function Qh(i, t) { return new Ir(i, t); } function Jh(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } var Tt = Symbol.for("#__init__"), tn = Symbol.for("#__initor__"), en = Symbol.for("#__inited__"), Zh = Symbol.for("##inited"), tu = Symbol.for("#afterVisit"), eu = Symbol.for("#beforeReconcile"), ru = Symbol.for("#afterReconcile"), Dr = Symbol.for("#count"), rn = Symbol.for("#__hooks__"), Nt = Symbol.for("#autorender"), sn = Symbol(), nn = new class { constructor(i = null) { this[Tt](i); } [Tt](i = null) { var t; this.items = i && (t = i.items) !== void 0 ? t : [], this.current = i && (t = i.current) !== void 0 ? t : null, this.lastQueued = i && (t = i.lastQueued) !== void 0 ? t : null, this.tests = i && (t = i.tests) !== void 0 ? t : 0; } flush() { let i = null; for (; i = this.items.shift(); ) { if (!i.parentNode || i.hydrated\u03A6) continue; let t = this.current; this.current = i, i.__F |= 1024, i.connectedCallback(), this.current = t; } } queue(i) { var t = this; let e = this.items.length, r = 0, s = this.lastQueued; this.lastQueued = i; let n = I.DOCUMENT_POSITION_PRECEDING, o = I.DOCUMENT_POSITION_FOLLOWING; if (e) { let l = this.items.indexOf(s), h = l, a = function(u, d) { return t.tests++, u.compareDocumentPosition(d); }; (l == -1 || s.nodeName != i.nodeName) && (h = l = 0); let c = t.items[h]; for (; c && a(c, i) & o; ) c = t.items[++h]; if (h != l) c ? t.items.splice(h, 0, i) : t.items.push(i); else { for (; c && a(c, i) & n; ) c = t.items[--h]; h != l && (c ? t.items.splice(h + 1, 0, i) : t.items.unshift(i)); } } else t.items.push(i), t.current || globalThis.queueMicrotask(t.flush.bind(t)); } run(i) { var t, e; if (this.active) return; this.active = true; let r = globalThis.document.querySelectorAll(".__ssr"); console.log("running hydrator", i, r.length, Array.from(r)); for (let s = 0, n = Jh(r), o = n.length; s < o; s++) { let l = n[s]; l[Dr] || (l[Dr] = 1), l[Dr]++; let h = l.nodeName, a = (e = this.map)[h] || (e[h] = globalThis.window.customElements.get(h.toLowerCase()) || Kt); console.log("item type", h, a, !!xe[h.toLowerCase()]), !(!l.connectedCallback || !l.parentNode || l.hydrated\u03A6) && console.log("hydrate", l); } return this.active = false; } }(); function iu() { return nn.flush(); } var Ot = class extends Kt { static [Tt]() { return this.prototype[tn] = sn, this; } constructor() { super(); this.flags$ns && (this.flag$ = this.flagExt$), this.setup$(), this.build(), this[tn] === sn && this[en] && this[en](); } setup$() { return this.__slots = {}, this.__F = 0; } [Tt]() { return this.__F |= 1 | 2, this; } [Zh]() { if (this[rn]) return this[rn].inited(this); } flag$(t) { this.className = this.flags$ext = t; } build() { return this; } awaken() { return this; } mount() { return this; } unmount() { return this; } rendered() { return this; } dehydrate() { return this; } hydrate() { return this.autoschedule = true, this; } tick() { return this.commit(); } visit() { return this.commit(); } commit() { return this.render\u03A6 ? (this.__F |= 256, this.render && this.render(), this.rendered(), this.__F = (this.__F | 512) & ~256 & ~8192) : (this.__F |= 8192, this); } get autoschedule() { return (this.__F & 64) != 0; } set autoschedule(t) { t ? this.__F |= 64 : this.__F &= ~64; } set autorender(t) { let e = this[Nt] || (this[Nt] = {}); e.value = t, this.mounted\u03A6 && O.schedule(this, e); } get render\u03A6() { return !this.suspended\u03A6; } get mounting\u03A6() { return (this.__F & 16) != 0; } get mounted\u03A6() { return (this.__F & 32) != 0; } get awakened\u03A6() { return (this.__F & 8) != 0; } get rendered\u03A6() { return (this.__F & 512) != 0; } get suspended\u03A6() { return (this.__F & 4096) != 0; } get rendering\u03A6() { return (this.__F & 256) != 0; } get scheduled\u03A6() { return (this.__F & 128) != 0; } get hydrated\u03A6() { return (this.__F & 2) != 0; } get ssr\u03A6() { return (this.__F & 1024) != 0; } schedule() { return O.on("commit", this), this.__F |= 128, this; } unschedule() { return O.un("commit", this), this.__F &= ~128, this; } async suspend(t = null) { let e = this.flags.incr("_suspended_"); return this.__F |= 4096, t instanceof Function && (await t(), this.unsuspend()), this; } unsuspend() { return this.flags.decr("_suspended_") == 0 && (this.__F &= ~4096, this.commit()), this; } [tu]() { return this.visit(); } [eu]() { return this.__F & 1024 && (this.__F = this.__F & ~1024, this.classList.remove("_ssr_"), this.flags$ext && this.flags$ext.indexOf("_ssr_") == 0 && (this.flags$ext = this.flags$ext.slice(5)), this.__F & 512 || (this.innerHTML = "")), globalThis.DEBUG_IMBA && xt.push(this), this; } [ru]() { return globalThis.DEBUG_IMBA && xt.pop(this), this; } connectedCallback() { let t = this.__F, e = t & 1, r = t & 8; if (!e && !(t & 1024)) { nn.queue(this); return; } if (t & (16 | 32)) return; this.__F |= 16, e || this[Tt](), t & 2 || (this.flags$ext = this.className, this.__F |= 2, this.hydrate(), this.commit()), r || (this.awaken(), this.__F |= 8), A(this, "mount"); let s = this.mount(); return s && s.then instanceof Function && s.then(O.commit), t = this.__F = (this.__F | 32) & ~16, t & 64 && this.schedule(), this[Nt] && O.schedule(this, this[Nt]), this; } disconnectedCallback() { if (this.__F = this.__F & (~32 & ~16), this.__F & 128 && this.unschedule(), A(this, "unmount"), this.unmount(), this[Nt]) return O.unschedule(this, this[Nt]); } }; Ot[Tt](); var su = Ot; function nu(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } var on = Symbol.for("#__init__"), Uf = Symbol.for("#__initor__"), Bf = Symbol.for("#__inited__"), ou = {cm: 1, mm: 1, Q: 1, pc: 1, pt: 1, px: 1, em: 1, ex: 1, ch: 1, rem: 1, vw: 1, vh: 1, vmin: 1, vmax: 1, s: 1, ms: 1, fr: 1, "%": 1, in: 1, turn: 1, grad: 1, rad: 1, deg: 1, Hz: 1, kHz: 1}; var ln = {prefix: 1, suffix: 1, content: 1}, Ar = {rose: [[356, 100, 97], [356, 100, 95], [353, 96, 90], [353, 96, 82], [351, 95, 71], [350, 89, 60], [347, 77, 50], [345, 83, 41], [343, 80, 35], [342, 75, 30]], pink: [[327, 73, 97], [326, 78, 95], [326, 85, 90], [327, 87, 82], [329, 86, 70], [330, 81, 60], [333, 71, 51], [335, 78, 42], [336, 74, 35], [336, 69, 30]], fuchsia: [[289, 100, 98], [287, 100, 95], [288, 96, 91], [291, 93, 83], [292, 91, 73], [292, 84, 61], [293, 69, 49], [295, 72, 40], [295, 70, 33], [297, 64, 28]], purple: [[270, 100, 98], [269, 100, 95], [269, 100, 92], [269, 97, 85], [270, 95, 75], [271, 91, 65], [271, 81, 56], [272, 72, 47], [273, 67, 39], [274, 66, 32]], violet: [[250, 100, 98], [251, 91, 95], [251, 95, 92], [252, 95, 85], [255, 92, 76], [258, 90, 66], [262, 83, 58], [263, 70, 50], [263, 69, 42], [264, 67, 35]], indigo: [[226, 100, 97], [226, 100, 94], [228, 96, 89], [230, 94, 82], [234, 89, 74], [239, 84, 67], [243, 75, 59], [245, 58, 51], [244, 55, 41], [242, 47, 34]], blue: [[214, 100, 97], [214, 95, 93], [213, 97, 87], [212, 96, 78], [213, 94, 68], [217, 91, 60], [221, 83, 53], [224, 76, 48], [226, 71, 40], [224, 64, 33]], sky: [[204, 100, 97], [204, 94, 94], [201, 94, 86], [199, 95, 74], [198, 93, 60], [199, 89, 48], [200, 98, 39], [201, 96, 32], [201, 90, 27], [202, 80, 24]], cyan: [[183, 100, 96], [185, 96, 90], [186, 94, 82], [187, 92, 69], [188, 86, 53], [189, 94, 43], [192, 91, 36], [193, 82, 31], [194, 70, 27], [196, 64, 24]], teal: [[166, 76, 97], [167, 85, 89], [168, 84, 78], [171, 77, 64], [172, 66, 50], [173, 80, 40], [175, 84, 32], [175, 77, 26], [176, 69, 22], [176, 61, 19]], emerald: [[152, 81, 96], [149, 80, 90], [152, 76, 80], [156, 72, 67], [158, 64, 52], [160, 84, 39], [161, 94, 30], [163, 94, 24], [163, 88, 20], [164, 86, 16]], green: [[138, 76, 97], [141, 84, 93], [141, 79, 85], [142, 77, 73], [142, 69, 58], [142, 71, 45], [142, 76, 36], [142, 72, 29], [143, 64, 24], [144, 61, 20]], lime: [[78, 92, 95], [80, 89, 89], [81, 88, 80], [82, 85, 67], [83, 78, 55], [84, 81, 44], [85, 85, 35], [86, 78, 27], [86, 69, 23], [88, 61, 20]], yellow: [[55, 92, 95], [55, 97, 88], [53, 98, 77], [50, 98, 64], [48, 96, 53], [45, 93, 47], [41, 96, 40], [35, 92, 33], [32, 81, 29], [28, 73, 26]], amber: [[48, 100, 96], [48, 96, 89], [48, 97, 77], [46, 97, 65], [43, 96, 56], [38, 92, 50], [32, 95, 44], [26, 90, 37], [23, 83, 31], [22, 78, 26]], orange: [[33, 100, 96], [34, 100, 92], [32, 98, 83], [31, 97, 72], [27, 96, 61], [25, 95, 53], [21, 90, 48], [17, 88, 40], [15, 79, 34], [15, 75, 28]], red: [[0, 86, 97], [0, 93, 94], [0, 96, 89], [0, 94, 82], [0, 91, 71], [0, 84, 60], [0, 72, 51], [0, 74, 42], [0, 70, 35], [0, 63, 31]], warmer: [[60, 9, 98], [60, 5, 96], [20, 6, 90], [24, 6, 83], [24, 5, 64], [25, 5, 45], [33, 5, 32], [30, 6, 25], [12, 6, 15], [24, 10, 10]], warm: [[0, 0, 98], [0, 0, 96], [0, 0, 90], [0, 0, 83], [0, 0, 64], [0, 0, 45], [0, 0, 32], [0, 0, 25], [0, 0, 15], [0, 0, 9]], gray: [[0, 0, 98], [240, 5, 96], [240, 6, 90], [240, 5, 84], [240, 5, 65], [240, 4, 46], [240, 5, 34], [240, 5, 26], [240, 4, 16], [240, 6, 10]], cool: [[210, 20, 98], [220, 14, 96], [220, 13, 91], [216, 12, 84], [218, 11, 65], [220, 9, 46], [215, 14, 34], [217, 19, 27], [215, 28, 17], [221, 39, 11]], cooler: [[210, 40, 98], [210, 40, 96], [214, 32, 91], [213, 27, 84], [215, 20, 65], [215, 16, 47], [215, 19, 35], [215, 25, 27], [217, 33, 17], [222, 47, 11]]}, lu = new RegExp("^(" + Object.keys(Ar).join("|") + ")(\\d+(?:\\.\\d+)?)$"), hu = /^([xyz])$/, uu = /^([tlbr]|size|[whtlbr]|[mps][tlbrxy]?|[rcxy]?[gs])$/, au = `*,::before,::after { box-sizing: border-box; border-width: 0; border-style: solid; border-color: currentColor; }`, hn = class { constructor(t = null) { this[on](t); } [on](t = null) { var e; this.entries = t && (e = t.entries) !== void 0 ? e : {}; } register(t, e) { let r = this.entries[t]; r ? r && (r.css = e, r.node && (r.node.textContent = e)) : (r = this.entries[t] = {sourceId: t, css: e}, this.entries.resets || this.register("resets", au), r.node = globalThis.document.createElement("style"), r.node.setAttribute("data-id", t), r.node.textContent = r.css, globalThis.document.head.appendChild(r.node)); } toString() { return Object.values(this.entries).map(function(t) { return t.css; }).join(` `); } toValue(t, e, r, s = null) { let n; ln[r] && (t = String(t)); let o = typeof t; if (o == "number") { if (e || (hu.test(r) ? e = "px" : uu.test(r) ? e = "u" : r == "rotate" && (e = "turn", t = (t % 1).toFixed(4))), e) return ou[e] ? t + e : e == "u" ? t * 4 + "px" : "calc(var(--u_" + e + ",1px) * " + t + ")"; } else if (o == "string") { if (r && ln[r] && t[0] != '"' && t[0] != "'" && (t.indexOf('"') >= 0 ? t.indexOf("'") == -1 && (t = "'" + t + "'") : t = '"' + t + '"'), n = t.match(lu)) { let h = Ar[n[1]][parseInt(n[2])], a = "100%"; if (typeof s == "number" ? a = s + "%" : typeof s == "string" && (a = s), h) return "hsla(" + h[0] + "," + h[1] + "%," + h[2] + "%," + a + ")"; } } else if (t && t.toStyleString instanceof Function) return t.toStyleString(); return t; } parseDimension(t) { if (typeof t == "string") { let [e, r, s] = t.match(/^([-+]?[\d\.]+)(%|\w+)$/); return [parseFloat(r), s]; } else if (typeof t == "number") return [t]; } }, un = new hn(), fu = Object.keys(Ar); function cu() { return true; } var an = class { css$(t, e, r) { return this.style[t] = e; } css$var(t, e, r, s, n = null) { let o = un.toValue(e, r, s, n); this.style.setProperty(t, o); } }; nu(v.prototype, an.prototype); var du = Symbol.for("#insertInto"), fn = Symbol.for("#removeFrom"); function pu(i, t = {}) { let e = C.context; C.context = t; let r = i(t); return C.context == t && (C.context = e), r; } function cn(i, t) { let e = t || globalThis.document.body, r = i; if (i instanceof Function) { let s = new U(e, null), n = function() { let o = C.context; C.context = s; let l = i(s); return C.context == s && (C.context = o), l; }; r = n(), O.listen("commit", n); } else r.__F |= 64; return r[du](e), r; } function dn(i) { return i && i[fn] && i[fn](i.parentNode), i; } var pn = globalThis.imba || (globalThis.imba = {}); pn.mount = cn; pn.unmount = dn; function Ct(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } function Ut(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } var Bt = Symbol.for("#afterVisit"); function mu() { return true; } var gu = {INPUT: true, SELECT: true, TEXTAREA: true, BUTTON: true}, Rr = function(i) { return i instanceof Array || i && i.has instanceof Function; }, jr = function(i, t) { return i == t ? true : i instanceof Array ? i.indexOf(t) >= 0 : i && i.has instanceof Function ? i.has(t) : i && i.contains instanceof Function ? i.contains(t) : false; }, qr = function(i, t) { if (i instanceof Array) return i.push(t); if (i && i.add instanceof Function) return i.add(t); }, zr = function(i, t) { if (i instanceof Array) { let e = i.indexOf(t); if (e >= 0) return i.splice(e, 1); } else if (i && i.delete instanceof Function) return i.delete(t); }; function yu(i) { function t() { return i[0] ? i[0][i[1]] : void 0; } function e(r) { return i[0] ? i[0][i[1]] = r : null; } return {get: t, set: e}; } var mn = class { getRichValue() { return this.value; } setRichValue(t) { return this.value = t; } bind$(t, e) { let r = e || []; return t == "data" && !this.$$bound && gu[this.nodeName] && (this.$$bound = true, this.change$ && this.addEventListener("change", this.change$ = this.change$.bind(this)), this.input$ && this.addEventListener("input", this.input$ = this.input$.bind(this), {capture: true}), this.click$ && this.addEventListener("click", this.click$ = this.click$.bind(this), {capture: true})), Object.defineProperty(this, t, r instanceof Array ? yu(r) : r), r; } }; Ct(v.prototype, mn.prototype); Object.defineProperty(v.prototype, "richValue", {get: function() { return this.getRichValue(); }, set: function(i) { return this.setRichValue(i); }}); var gn = class { change$(t) { let e = this.data, r = this.$$value; this.$$value = void 0; let s = this.getRichValue(); if (this.multiple) { if (r) for (let n = 0, o = Ut(r), l = o.length; n < l; n++) { let h = o[n]; s.indexOf(h) == -1 && zr(e, h); } for (let n = 0, o = Ut(s), l = o.length; n < l; n++) { let h = o[n]; (!r || r.indexOf(h) == -1) && qr(e, h); } } else this.data = s[0]; return P(), this; } getRichValue() { var t; if (this.$$value) return this.$$value; t = []; for (let e = 0, r = Ut(this.selectedOptions), s = r.length; e < s; e++) { let n = r[e]; t.push(n.richValue); } return this.$$value = t; } syncValue() { let t = this.data; if (this.multiple) { let e = []; for (let r = 0, s = Ut(this.options), n = s.length; r < n; r++) { let o = s[r], l = o.richValue, h = jr(t, l); o.selected = h, h && e.push(l); } this.$$value = e; } else for (let e = 0, r = Ut(this.options), s = r.length; e < s; e++) { let o = r[e].richValue; if (o == t) { this.$$value = [o], this.selectedIndex = e; break; } } } [Bt]() { return this.syncValue(); } }; Ct(vr.prototype, gn.prototype); var yn = class { setRichValue(t) { return this.$$value = t, this.value = t; } getRichValue() { return this.$$value !== void 0 ? this.$$value : this.value; } }; Ct(Er.prototype, yn.prototype); var _n = class { setRichValue(t) { return this.$$value = t, this.value = t; } getRichValue() { return this.$$value !== void 0 ? this.$$value : this.value; } input$(t) { return this.data = this.value, P(); } [Bt]() { let t = this.data; if (t == null && (t = ""), this.$$bound && this.value != t) return this.value = t; } }; Ct(Sr.prototype, _n.prototype); var bn = class { input$(t) { let e = this.type; if (!(e == "checkbox" || e == "radio")) return this.$$value = void 0, this.data = this.richValue, P(); } change$(t) { let e = this.data, r = this.richValue; if (this.type == "checkbox" || this.type == "radio") { let s = this.checked; Rr(e) ? s ? qr(e, r) : zr(e, r) : this.data = s ? r : false; } return P(); } setRichValue(t) { this.$$value !== t && (this.$$value = t, this.value !== t && (this.value = t)); } getRichValue() { if (this.$$value !== void 0) return this.$$value; let t = this.value, e = this.type; return e == "range" || e == "number" ? (t = this.valueAsNumber, Number.isNaN(t) && (t = null)) : e == "checkbox" && (t == null || t === "on") && (t = true), t; } [Bt]() { if (this.$$bound) { let t = this.type; if (t == "checkbox" || t == "radio") { let e = this.data; e === true || e === false || e == null ? this.checked = !!e : this.checked = jr(e, this.richValue); } else this.richValue = this.data; } } }; Ct(xr.prototype, bn.prototype); var vn = class { get checked() { return this.$checked; } set checked(t) { t != this.$checked && (this.$checked = t, this.flags.toggle("checked", !!t)); } setRichValue(t) { return this.$$value = t, this.value = t; } getRichValue() { return this.$$value !== void 0 ? this.$$value : this.value; } click$(t) { let e = this.data, r = this.checked, s = this.richValue; return Rr(e) ? r ? zr(e, s) : qr(e, s) : this.$$value == null ? this.data = !r : this.data = r ? null : s, this[Bt](), P(); } [Bt]() { if (this.$$bound) { let t = this.data, e = this.$$value == null ? true : this.$$value; Rr(t) ? this.checked = jr(t, e) : this.checked = t == e; } } }; Ct(wr.prototype, vn.prototype); function xn(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } var _u = Symbol.for("#getSlot"), bu = Symbol.for("#container"), vu = Symbol.for("#afterVisit"), pt = Symbol.for("#__init__"), Sn = Symbol.for("#__initor__"), wn = Symbol.for("#__inited__"), Ie = Symbol.for("#listeners"), Y = Symbol.for("#slot"), xu = Symbol.for("#parent"), R = Symbol.for("##container"), Kr = Symbol.for("#domTarget"), En = Symbol.for("#insertInto"), Su = Symbol.for("#removeFrom"), wu = Symbol.for("#self"), Eu = Symbol.for("#target"), Tn = Symbol(), De = class extends Ot { static [pt]() { return this.prototype[Sn] = Tn, this; } constructor() { super(...arguments); super[pt] || this[pt](), this[Sn] === Tn && this[wn] && this[wn](); } [pt](t = null) { super[pt] && super[pt](...arguments), this.to = t ? t.to : void 0; } build() { return this[Ie] = [], this.win = globalThis, this.doc = globalThis.document; } setup() { return this.setAttribute("style", "display:none !important;"); } [_u](t, e) { return this[Y] || (this[Y] = Ht(0, this[xu])), this[Y]; } get [bu]() { if (!this[R]) { let t = this.className; this[R] = this.doc.createElement("div"), this[R].className = t, this[R].style.cssText = "display:contents !important;"; } return this[R]; } get domTarget() { return this[Kr] || (this[Kr] = this.to instanceof v ? this.to : this.closest(this.to) || this.doc.querySelector(this.to)); } get eventTarget() { return this.domTarget; } get style() { return this[R] ? this[R].style : super.style; } get classList() { return this[R] ? this[R].classList : super.classList; } get className() { return this[R] ? this[R].className : super.className; } set className(t) { this[R] ? this[R].className = t : super.className = t; } [vu]() { if (this.mounted\u03A6 && this[Y] && !this[Y].parentNode) return this[Y][En](this.target); } mount() { for (let e = 0, r = xn(this[Ie]), s = r.length; e < s; e++) { let [n, o, l] = r[e]; this.eventTarget.addEventListener(n, o, l); } let t = this.domTarget; return this[Y] && this[Y][En](t), this; } unmount() { for (let t = 0, e = xn(this[Ie]), r = e.length; t < r; t++) { let [s, n, o] = e[t]; this.eventTarget.removeEventListener(s, n, o); } return this[Y] && this[Y][Su](this.domTarget), this[Kr] = null, this; } addEventListener(t, e, r = {}) { var s; if (e[wu] = this, this[Ie].push([t, e, r]), this.mounted\u03A6 && ((s = this.eventTarget) == null ? void 0 : s.addEventListener)) return this.eventTarget.addEventListener(t, e, r); } }; De[pt](); var Nn = class extends De { get domTarget() { return this.doc.body; } get eventTarget() { return this.win; } addEventListener(t, e, r = {}) { return e[Eu] = this.domTarget.parentNode, super.addEventListener(...arguments); } on$resize(t, e, r, s) { return this.addEventListener("resize", r, s), r; } }; globalThis.customElements && (globalThis.customElements.define("i-teleport", De), globalThis.customElements.define("i-global", Nn)); function Tu() { return true; } function mt(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } function Nu(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } var On = Symbol.for("#__init__"), nc = Symbol.for("#__initor__"), oc = Symbol.for("#__inited__"), Vr = Symbol.for("#insertInto"), Hr = Symbol.for("#removeFrom"), Ou = Symbol.for("#all"), Yt = Symbol.for("#phase"), et = Symbol.for("#nodes"), Cu = Symbol.for("#sizes"), Cn = Symbol.for("#mode"), $n = Symbol.for("#enabled"), Pn = Symbol.for("#anims"), Ur = Symbol.for("#_easer_"), kn = class { constructor(t = null) { this[On](t); } [On](t = null) { var e; this.selectors = t && (e = t.selectors) !== void 0 ? e : {}; } addSelectors(t, e) { var r; return ((r = this.selectors)[e] || (r[e] = [])).push(...t), true; } getSelectors(...t) { let e = []; for (let r = 0, s = mt(t), n = s.length; r < n; r++) { let o = s[r]; this.selectors[o] && e.push(...this.selectors[o]); } return e && e.length ? e.join(",") : null; } nodesForBase(t, e = "transition") { let r = [t], s = (this.selectors[e] || []).join(","); if (s == "") return r; let n = t.querySelectorAll(s); for (let o = 0, l = mt(n), h = l.length; o < h; o++) { let a = l[o]; a.closest("._ease_") == t && r.push(a); } return r[Ou] = n, r; } nodesWithSize(t, e = "in") { let r = this.getSelectors("_off_sized", "_" + e + "_sized"); return r ? t.filter(function(s) { return s.matches(r); }) : []; } }, Ae = new kn(), $u = globalThis.imba || (globalThis.imba = {}); $u.transitions = Ae; var Br = class { constructor(t) { this.dom = t, this[Yt] = null, this[et] = [], this[Cu] = new Map(); } log(...t) { } get flags() { return this.dom.flags; } flag(t) { for (let e = 0, r = mt(this[et]), s = r.length; e < s; e++) r[e].flags.add(t); return this; } unflag(t) { for (let e = 0, r = mt(this[et]), s = r.length; e < s; e++) r[e].flags.remove(t); return this; } commit() { return this.dom.offsetWidth; } enable(t) { return t && (this[Cn] = t), (this[$n] != true ? (this[$n] = true, true) : false) ? (this.dom[Vr] = this[Vr].bind(this), this.dom[Hr] = this[Hr].bind(this), this.flags.add("_ease_")) : this; } disable() { return this.flags.unflag("_ease_"), true; } set phase(t) { var r, s, n, o, l, h, a, c, u, d, b, f; let e = this[Yt]; (this[Yt] != t ? (this[Yt] = t, true) : false) && (e && this.flags.remove("_" + e + "_"), t && this.flags.add("_" + t + "_"), this.flags.toggle("_easing_", !!t), t || (this.unflag("_out_"), this.unflag("_in_"), this.unflag("_off_"), this[et] = null), t == "enter" && e == "leave" && ((s = (r = this.dom) == null ? void 0 : r.transition\u039Eout\u039Ecancel) == null || s.call(r, this)), t == "leave" && e == "enter" && ((o = (n = this.dom) == null ? void 0 : n.transition\u039Ein\u039Ecancel) == null || o.call(n, this)), t == "enter" && ((h = (l = this.dom) == null ? void 0 : l.transition\u039Ein) == null || h.call(l, this)), t == "leave" && ((c = (a = this.dom) == null ? void 0 : a.transition\u039Eout) == null || c.call(a, this)), e == "leave" && !t && ((d = (u = this.dom) == null ? void 0 : u.transition\u039Eout\u039Eend) == null || d.call(u, this)), e == "enter" && !t && ((f = (b = this.dom) == null ? void 0 : b.transition\u039Ein\u039Eend) == null || f.call(b, this))); } get phase() { return this[Yt]; } get leaving\u03A6() { return this.phase == "leave"; } get entering\u03A6() { return this.phase == "enter"; } get idle\u03A6() { return this.phase == null; } track(t) { var e = this; let r = {before: Vt().getAnimations()}; return this.commit(), t(), this.commit(), r.after = Vt().getAnimations(), r.fresh = r.after.filter(function(s) { return r.before.indexOf(s) == -1; }), r.deep = r.fresh.filter(function(s) { let n; return !!((n = s.effect.target) && n.closest("._ease_") != e.dom); }), r.own = r.fresh.filter(function(s) { return r.deep.indexOf(s) == -1; }), r.finished = Promise.all(r.own.map(function(s) { return s.finished; })), r; } getAnimatedNodes() { return Ae.nodesForBase(this.dom); } getNodeSizes(t = "in", e = this[et]) { let r = Ae.nodesWithSize(e, t), s = new Map(); for (let n = 0, o = mt(r), l = o.length; n < l; n++) { let h = o[n], a = window.getComputedStyle(h); s.set(h, {width: a.width, height: a.height}); } return s; } applyNodeSizes(t) { for (let [e, r] of mt(t)) e.style.width = r.width, e.style.height = r.height; return t; } clearNodeSizes(t) { for (let [e, r] of mt(t)) e.style.removeProperty("width"), e.style.removeProperty("height"); return t; } [Vr](t, e) { var h, a; var r = this; let s; if (this.entering\u03A6) return this.dom; let n = function() { if (s && r.clearNodeSizes(s), r.entering\u03A6) return r.phase = null; }; if (r.leaving\u03A6) return r.track(function() { return r.phase = "enter", r.unflag("_off_"), r.unflag("_out_"); }).finished.then(n, function(u) { return r.log("error cancel leave", u); }), r.dom; let o = Vt().contains(t); return e ? t.insertBefore(r.dom, e) : t.appendChild(r.dom), this[et] = r.getAnimatedNodes(), r.flag("_instant_"), r.unflag("_out_"), r.commit(), s = this[et].sized = r.getNodeSizes("in"), (a = (h = r.dom) == null ? void 0 : h.transition\u039Ein\u039Einit) == null || a.call(h, r), r.flag("_off_"), r.flag("_in_"), r.commit(), r.unflag("_instant_"), (this[Pn] = r.track(function() { return r.phase = "enter", r.applyNodeSizes(s), r.unflag("_off_"), r.unflag("_in_"); })).finished.then(n, function(c) { return r.clearNodeSizes(s), r.log("cancelled insert into", c); }), r.dom; } [Hr](t) { var e = this; if (this.leaving\u03A6) return; let r, s = function() { if (e.phase == "leave") return t.removeChild(e.dom), e.phase = null; }; if (e.entering\u03A6 && this[Cn] != "forward") { let o = e.track(function() { return e.flag("_off_"), e.flag("_in_"), e.unflag("_out_"), e.phase = "leave", e.clearNodeSizes(e[et].sized); }); e.log("cancel enter anims own", o.own, o), o.finished.then(s, function(l) { return e.log("error cancel entering", l); }); return; } this[et] = e.getAnimatedNodes(), r = e.getNodeSizes("out"), e.applyNodeSizes(r); let n = this[Pn] = e.track(function() { return e.phase = "leave", e.flag("_off_"), e.flag("_out_"), e.clearNodeSizes(r); }); if (!n.own.length) { s(); return; } n.finished.then(s, function() { return true; }); } }, Ln = class { transition\u039Ein\u039Einit(t) { return true; } transition\u039Ein(t) { return true; } transition\u039Ein\u039Eend(t) { return true; } transition\u039Ein\u039Ecancel(t) { return true; } transition\u039Eout(t) { return true; } transition\u039Eout\u039Eend(t) { return true; } transition\u039Eout\u039Ecancel(t) { return true; } get ease() { return this[Ur] || (this[Ur] = new Br(this)); } set ease(t) { var e, r; if (t == false) { (r = (e = this[Ur]) == null ? void 0 : e.disable) == null || r.call(e); return; } this.ease.enable(t); } }; Nu(v.prototype, Ln.prototype); function Pu() { return true; } function ku(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } function Yr() { return true; } var Mn = class { \u03B1esc() { return this.keyCode == 27; } \u03B1tab() { return this.keyCode == 9; } \u03B1enter() { return this.keyCode == 13; } \u03B1space() { return this.keyCode == 32; } \u03B1up() { return this.keyCode == 38; } \u03B1down() { return this.keyCode == 40; } \u03B1left() { return this.keyCode == 37; } \u03B1right() { return this.keyCode == 39; } \u03B1del() { return this.keyCode == 8 || this.keyCode == 46; } \u03B1key(t) { if (typeof t == "string") return this.key == t; if (typeof t == "number") return this.keyCode == t; } }; ku(br.prototype, Mn.prototype); function Lu(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } function Wt() { return true; } var Fn = class { \u03B1left() { return this.button == 0; } \u03B1middle() { return this.button == 1; } \u03B1right() { return this.button == 2; } \u03B1shift() { return !!this.shiftKey; } \u03B1alt() { return !!this.altKey; } \u03B1ctrl() { return !!this.ctrlKey; } \u03B1meta() { return !!this.metaKey; } \u03B1mod() { let t = globalThis.navigator.platform; return /^(Mac|iPhone|iPad|iPod)/.test(t || "") ? !!this.metaKey : !!this.ctrlKey; } }; Lu(yr.prototype, Fn.prototype); function Wr(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } function In(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } var Mu = Symbol.for("#extendType"), Fu = Symbol.for("#modifierState"), Re = Symbol.for("#sharedModifierState"), Dn = Symbol.for("#onceHandlerEnd"), bc = Symbol.for("#__initor__"), vc = Symbol.for("#__inited__"), An = Symbol.for("#extendDescriptors"), j = Symbol.for("#context"), Rn = Symbol.for("#self"), Iu = Symbol.for("#target"), jn = Symbol.for("#stopPropagation"), qn = Symbol.for("#defaultPrevented"); Yr(); Wt(); var zn = class { [Mu](t) { var e, r, s; let n = t[An] || (t[An] = (r = Object.getOwnPropertyDescriptors(t.prototype), s = r.constructor, delete r.constructor, r)); return Object.defineProperties(this, n); } }; Wr($.prototype, zn.prototype); var Kn = class { get [Fu]() { var t, e; return (t = this[j])[e = this[j].step] || (t[e] = {}); } get [Re]() { var t, e; return (t = this[j].handler)[e = this[j].step] || (t[e] = {}); } [Dn](t) { return F(this[j], "end", t); } \u03B1sel(t) { return !!this.target.matches(String(t)); } \u03B1closest(t) { return !!this.target.closest(String(t)); } \u03B1log(...t) { return console.info(...t), true; } \u03B1trusted() { return !!this.isTrusted; } \u03B1if(t) { return !!t; } \u03B1wait(t = 250) { return new Promise(function(e) { return setTimeout(e, yt(t)); }); } \u03B1self() { return this.target == this[j].element; } \u03B1cooldown(t = 250) { let e = this[Re]; return e.active ? false : (e.active = true, e.target = this[j].element, e.target.flags.incr("cooldown"), this[Dn](function() { return setTimeout(function() { return e.target.flags.decr("cooldown"), e.active = false; }, yt(t)); }), true); } \u03B1throttle(t = 250) { let e = this[Re]; return e.active ? (e.next && e.next(false), new Promise(function(r) { return e.next = function(s) { return e.next = null, r(s); }; })) : (e.active = true, e.el || (e.el = this[j].element), e.el.flags.incr("throttled"), F(this[j], "end", function() { let r = yt(t); return e.interval = setInterval(function() { e.next ? e.next(true) : (clearInterval(e.interval), e.el.flags.decr("throttled"), e.active = false); }, r); }), true); } \u03B1debounce(t = 250) { let e = this[Re], r = this; return e.queue || (e.queue = []), e.queue.push(e.last = r), new Promise(function(s) { return setTimeout(function() { return e.last == r ? (r.debounced = e.queue, e.last = null, e.queue = [], s(true)) : s(false); }, yt(t)); }); } \u03B1flag(t, e) { let {element: r, step: s, state: n, id: o, current: l} = this[j], h = e instanceof v ? e : e ? r.closest(e) : r; if (!h) return true; this[j].commit = true, n[s] = o, h.flags.incr(t); let a = Date.now(); return F(l, "end", function() { let c = Date.now() - a, u = Math.max(250 - c, 0); return setTimeout(function() { return h.flags.decr(t); }, u); }), true; } \u03B1busy(t) { return this.\u03B1flag("busy", t); } \u03B1mod(t) { return this.\u03B1flag("mod-" + t, globalThis.document.documentElement); } \u03B1outside() { let {handler: t} = this[j]; if (t && t[Rn]) return !t[Rn].parentNode.contains(this.target); } }; Wr(z.prototype, Kn.prototype); var Du = {}; function Au() { return true; } var Gr = class { constructor(t, e) { this.params = t, this.closure = e; } getHandlerForMethod(t, e) { return t ? t[e] ? t : this.getHandlerForMethod(t.parentNode, e) : null; } emit(t, ...e) { return A(this, t, e); } on(t, ...e) { return D(this, t, ...e); } once(t, ...e) { return F(this, t, ...e); } un(t, ...e) { return ct(this, t, ...e); } get passive\u03A6() { return this.params.passive; } get capture\u03A6() { return this.params.capture; } get silent\u03A6() { return this.params.silent; } get global\u03A6() { return this.params.global; } async handleEvent(t) { let e = this[Iu] || t.currentTarget, r = this.params, s = null, n = r.silence || r.silent; this.count || (this.count = 0), this.state || (this.state = {}); let o = {element: e, event: t, modifiers: r, handler: this, id: ++this.count, step: -1, state: this.state, commit: null, current: null}; if (o.current = o, t.handle$mod && t.handle$mod.apply(o, r.options || []) == false) return; let l = z[this.type + "$handle"] || z[t.type + "$handle"] || t.handle$mod; if (!(l && l.apply(o, r.options || []) == false)) { this.currentEvents || (this.currentEvents = new Set()), this.currentEvents.add(t); for (let h = 0, a = Object.keys(r), c = a.length, u, d; h < c; h++) { if (u = a[h], d = r[u], o.step++, u[0] == "_") continue; u.indexOf("~") > 0 && (u = u.split("~")[0]); let b = null, f = [t, o], p, m = null, g, _ = false, w = typeof u == "string"; if (u[0] == "$" && u[1] == "_" && d[0] instanceof Function) u = d[0], u.passive || (o.commit = true), f = [t, o].concat(d.slice(1)), m = e; else if (d instanceof Array) { f = d.slice(), b = f; for (let y = 0, x = In(f), N = x.length; y < N; y++) { let M = x[y]; if (typeof M == "string" && M[0] == "~" && M[1] == "$") { let he = M.slice(2).split("."), ue = o[he.shift()] || t; for (let sr = 0, ki = In(he), Cl = ki.length; sr < Cl; sr++) { let $l = ki[sr]; ue = ue ? ue[$l] : void 0; } f[y] = ue; } } } if (typeof u == "string" && (g = u.match(/^(emit|flag|mod|moved|pin|fit|refit|map|remap|css)-(.+)$/)) && (b || (b = f = []), f.unshift(g[2]), u = g[1]), u == "trap") t[jn] = true, t.stopImmediatePropagation(), t[qn] = true, t.preventDefault(); else if (u == "stop") t[jn] = true, t.stopImmediatePropagation(); else if (u == "prevent") t[qn] = true, t.preventDefault(); else if (u == "commit") o.commit = true; else if (u == "once") e.removeEventListener(t.type, this); else { if (u == "options" || u == "silence" || u == "silent") continue; if (u == "emit") { let y = f[0], x = f[1], N = new $(y, {bubbles: true, detail: x}); N.originalEvent = t; let M = e.dispatchEvent(N); } else if (typeof u == "string") { u[0] == "!" && (_ = true, u = u.slice(1)); let y = "\u03B1" + u, x = t[y]; x || (x = this.type && z[this.type + "$" + u + "$mod"]), x || (x = t[u + "$mod"] || z[t.type + "$" + u] || z[u + "$mod"]), x instanceof Function ? (u = x, m = o, f = b || [], t[y] && (m = t, t[j] = o)) : u[0] == "_" ? (u = u.slice(1), m = this.closure) : m = this.getHandlerForMethod(e, u); } } try { u instanceof Function ? p = u.apply(m || e, f) : m && (p = m[u].apply(m, f)), p && p.then instanceof Function && p != O.$promise && (o.commit && !n && O.commit(), p = await p); } catch (y) { s = y; break; } if (_ && p === true || !_ && p === false) break; o.value = p; } if (A(o, "end", o), o.commit && !n && O.commit(), this.currentEvents.delete(t), this.currentEvents.size == 0 && this.emit("idle"), s) throw s; } } }, Vn = class { on$(t, e, r) { let s = "on$" + t, n; n = new Gr(e, r); let o = e.capture || false, l = e.passive, h = o; return l && (h = {passive: l, capture: o}), this[s] instanceof Function ? n = this[s](e, r, n, h) : this.addEventListener(t, n, h), n; } }; Wr(v.prototype, Vn.prototype); var je = new class { get ios\u03A6() { let i = globalThis.navigator.platform || ""; return !!(i.match(/iPhone|iPod|iPad/) || i == "MacIntel" && globalThis.navigator.maxTouchPoints > 2); } }(); function $t(i, t) { let e = t; return i instanceof Element ? i : typeof i == "string" ? i == "this" || i == "" ? e : i == "up" ? e.parentNode : i == "op" ? e.offsetParent : e.closest(i) || e.querySelector(i) || globalThis.document.querySelector(i) : null; } function lt(i) { if (typeof i == "string") { let [t, e, r] = i.match(/^([-+]?[\d\.]+)(%|\w+)$/); return [parseFloat(e), r]; } else if (typeof i == "number") return [i]; } function qe(i, t = 1) { let e = 1 / t; return Math.round(i * e) / e; } function Ru(i, t, e) { return t > e ? Math.max(e, Math.min(t, i)) : Math.min(e, Math.max(t, i)); } function Xr(i, t, e, r, s = 0.1) { let [n, o] = lt(e), [l, h] = lt(r), [a, c] = lt(s); return o == "%" && (n = (t - i) * (n / 100)), h == "%" && (l = (t - i) * (l / 100)), c == "%" && (a = (l - n) * (a / 100)), function(u, d) { let b = (u - i) / (t - i), f = n + (l - n) * b; return s && (f = qe(f, a)), d && (f = Ru(f, n, l)), f; }; } function ju(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } Wt(); function qu() { return true; } var Hn = class { \u03B1primary() { return !!this.isPrimary; } \u03B1mouse() { return this.pointerType == "mouse"; } \u03B1pen() { return this.pointerType == "pen"; } \u03B1touch() { return this.pointerType == "touch"; } \u03B1pressure(t = 0.5) { return this.pressure >= t; } \u03B1lock() { return true; } }; ju(_r.prototype, Hn.prototype); function zu(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } var Un = Symbol.for("#capture"), W = Symbol.for("#step"), Ku = Symbol.for("#cancel"), Qr = Symbol.for("#reframe"), Lc = Symbol.for("#__initor__"), Mc = Symbol.for("#__inited__"), Bn = Symbol.for("#mods"), Jr = Symbol.for("#dx"), Zr = Symbol.for("#dy"), ht = Symbol.for("#context"), ze = Symbol.for("#locked"), Yn = Symbol.for("#teardown"), Wn = Symbol.for("#x"), Gn = Symbol.for("#y"), Vu = Symbol.for("#pinTarget"); function Hu() { return true; } var Xn = null, Qn = class { constructor(t, e, r) { this.phase = "init", this.events = [], this.originalEvent = t, this.handler = e, this.target = this.currentTarget = r, this[Bn] = {}; } set event(t) { this.events.push(t); } get ctrlKey() { return this.originalEvent.ctrlKey; } get altKey() { return this.originalEvent.altKey; } get shiftKey() { return this.originalEvent.shiftKey; } get metaKey() { return this.originalEvent.metaKey; } get isPrimary() { return this.originalEvent.isPrimary; } get pointerType() { return this.originalEvent.pointerType; } get start() { return this.originalEvent; } get originalTarget() { return this.originalEvent.target; } get event() { return this.events[this.events.length - 1]; } get elapsed() { return this.event.timeStamp - this.events[0].timeStamp; } get type() { return this.event.type; } get pointerId() { return this.originalEvent.pointerId; } get pressure() { return this.event.pressure; } get clientX() { return this.event.clientX; } get clientY() { return this.event.clientY; } get offsetX() { return this.event.offsetX; } get offsetY() { return this.event.offsetY; } get active\u03A6() { return this.phase != "ended"; } get ended\u03A6() { return this.phase == "ended"; } get dx() { return this[Jr] == null ? this.event.x - this.start.x : this[Jr]; } get dy() { return this[Zr] == null ? this.event.y - this.start.y : this[Zr]; } stopImmediatePropagation() { return this.cancelBubble = true, this.event.stopImmediatePropagation(), this; } stopPropagation() { return this.cancelBubble = true, this.event.stopPropagation(), this; } preventDefault() { return this.defaultPrevented = true, this.event.preventDefault(); } emit(t, ...e) { return A(this, t, e); } on(t, ...e) { return D(this, t, ...e); } once(t, ...e) { return F(this, t, ...e); } un(t, ...e) { return ct(this, t, ...e); } \u03B1flag(t, e) { let {element: r} = this[ht], s = Date.now(), n = e instanceof v ? e : e ? r.closest(e) : r; return (this[W].setup != true ? (this[W].setup = true, true) : false) && (n.flags.incr(t), F(this, "end", function() { return n.flags.decr(t); })), true; } \u03B1lock() { return this[Un](), true; } [Un]() { if (this[ze] != true ? (this[ze] = true, true) : false) return this[ht].element.setPointerCapture(this.pointerId); } get [W]() { var t, e; return (t = this[Bn])[e = this[ht].step] || (t[e] = {}); } [Ku]() { return this[Yn](); } \u03B1moved(t, e) { let r = this[W], {element: s, state: n, event: o} = this[ht]; if (!r.setup) { let u = t || 4; typeof t == "string" && t.match(/^(up|down|left|right|x|y)$/) && (r.dir = t, u = e || 4), typeof e == "string" && e.match(/^(up|down|left|right|x|y)$/) && (r.dir = e), r.setup = true; let [d, b] = lt(u); r.threshold = d, r.sy = d, r.x0 = this.x, r.y0 = this.y, r.dir || (r.dir = "dist"), r.x = r.left = r.right = r.y = r.up = r.down = r.dist = 0, b && b != "px" && console.warn("only px threshold allowed in @touch.moved"); } if (r.active) return true; if (r.cancelled) return false; let l = r.threshold, h = this.x - r.x0, a = this.y - r.y0; r.x = Math.max(r.x, Math.abs(h)), r.y = Math.max(r.y, Math.abs(a)), r.left = Math.max(r.left, -h), r.right = Math.max(r.right, h), r.up = Math.max(r.up, -a), r.down = Math.max(r.down, a), r.dist = Math.max(r.dist, Math.sqrt(h * h + a * a)); let c = r[r.dir]; if (c > l && c >= r.x && c >= r.y) { r.active = true; let u = n.pinTarget; return s.flags.incr("_move_"), u && u.flags.incr("_move_"), this.preventDefault(), F(this, "end", function() { return u && u.flags.decr("_move_"), s.flags.decr("_move_"); }), true; } else if (r.x > l || r.y > l) return r.cancelled = true, false; return false; } \u03B1hold(t = 250) { var e = this; let r = this[W], s = this[ht].element; if (r.cancelled) return false; if (r.setup && !r.active) { let n = this.clientX, o = this.clientY, l = n - r.x, h = o - r.y; Math.sqrt(l * l + h * h) > 5 && !r.cancelled && (clearTimeout(r.timeout), r.cancelled = true); } return (r.setup != true ? (r.setup = true, true) : false) && (r.active = false, r.x = this.clientX, r.y = this.clientY, r.timeout = setTimeout(function() { return r.active = true, e.preventDefault(), s.flags.incr("_hold_"); }, t), F(e, "end", function() { return r.active && s.flags.decr("_hold_"), clearTimeout(r.timeout); })), r.active; } \u03B1sync(t, e = "x", r = "y") { let s = this[W]; return (s.setup != true ? (s.setup = true, true) : false) ? (s.x = t[e] || 0, s.y = t[r] || 0, s.tx = this.x, s.ty = this.y) : (e && (t[e] = s.x + (this.x - s.tx)), r && (t[r] = s.y + (this.y - s.ty))), this[ht].commit = true, true; } \u03B1apply(t, e = "x", r = "y") { return e && (t[e] = this.x), r && (t[r] = this.y), this[ht].commit = true, true; } \u03B1css(t = "x", e = "y") { let r = this[W]; if (r.setup != true ? (r.setup = true, true) : false) r.el = this[ht].element, r.x = r.el[Wn] || 0, r.y = r.el[Gn] || 0, r.tx = this.x, r.ty = this.y; else { let s = r.el[Wn] = r.x + (this.x - r.tx), n = r.el[Gn] = r.y + (this.y - r.ty); t && r.el.style.setProperty("--x", s + "px"), e && r.el.style.setProperty("--y", n + "px"); } return true; } \u03B1end() { return this.phase == "ended"; } \u03B1shift() { return !!this.shiftKey; } \u03B1alt() { return !!this.altKey; } \u03B1ctrl() { return !!this.ctrlKey; } \u03B1meta() { return !!this.metaKey; } \u03B1primary() { return !!this.isPrimary; } \u03B1mouse() { return this.pointerType == "mouse"; } \u03B1pen() { return this.pointerType == "pen"; } \u03B1touch() { return this.pointerType == "touch"; } \u03B1pressure(t = 0.5) { return this.pressure >= t; } \u03B1log(...t) { return console.info(...t), true; } \u03B1left() { return this.originalEvent.button == 0; } \u03B1middle() { return this.originalEvent.button == 1; } \u03B1right() { return this.originalEvent.button == 2; } \u03B1round(t = 1, e = t) { return this.x = qe(this.x, t), this.y = qe(this.y, e), true; } [Qr](...t) { let e = this[W]; if (e.setup != true ? (e.setup = true, true) : false) { let r = this.target, s = t.length, n = t[0], o = 0, l = "100%", h = 0, a = typeof n; a == "number" || a == "string" && /^([-+]?\d[\d\.]*)(%|\w+)$/.test(n) || n instanceof Array ? n = null : a == "string" && (n == "this" || n == "" ? n = r : n == "up" ? n = r.parentNode : n == "op" ? n = r.offsetParent : n = r.closest(n) || r.querySelector(n)), n == null && (s++, t.unshift(n = r)), s == 2 ? h = t[1] : s > 2 && ([o, l, h = 0] = t.slice(1)); let c = n.getBoundingClientRect(); o instanceof Array || (o = [o, o]), l instanceof Array || (l = [l, l]), h instanceof Array || (h = [h, h]), e.rect = c, e.x = Xr(c.left, c.right, o[0], l[0], h[0]), e.y = Xr(c.top, c.bottom, o[1], l[1], h[1]), this.x0 = this.x = e.x(this.x, e.clamp), this.y0 = this.y = e.y(this.y, e.clamp); } else { let r = this.x = e.x(this.x, e.clamp), s = this.y = e.y(this.y, e.clamp); this[Jr] = r - this.x0, this[Zr] = s - this.y0; } return true; } \u03B1fit(...t) { return this[W].clamp = true, this[Qr](...t); } \u03B1reframe(...t) { return this[Qr](...t); } \u03B1pin(...t) { let e = this[W]; if (e.setup != true ? (e.setup = true, true) : false) { let r = $t(t[0], this.target); r instanceof v || t.unshift(r = this.target); let s = t[1] || 0, n = t[2] == null ? t[2] = s : t[2], o = r.getBoundingClientRect(); e.x = this.clientX - (o.left + o.width * s), e.y = this.clientY - (o.top + o.height * n), r && (this[Vu] = r, r.flags.incr("_touch_"), F(this, "end", function() { return r.flags.decr("_touch_"); })); } return this.x -= e.x, this.y -= e.y, true; } }, Jn = class { on$touch(t, e, r, s) { return r.type = "touch", this.addEventListener("pointerdown", r, {passive: false}), je.ios\u03A6 && globalThis.parent != globalThis && (Xn != true ? (Xn = true, true) : false) && globalThis.parent.postMessage("setupTouchFix"), r; } }; zu(v.prototype, Jn.prototype); if (globalThis.parent == globalThis && je.ios\u03A6) { let i = function(t) { if (t.data == "setupTouchFix") return globalThis.addEventListener("touchmove", function() { return false; }, {passive: false}), globalThis.removeEventListener("message", i); }; globalThis.addEventListener("message", i); } z.touch$handle = function() { let i = this.event, t = this.element, e = this.state.pointerId, r = this.modifiers, s = this.handler, n = je.ios\u03A6; if (this.current = this.state, e != null) return e == i.pointerId; if (r.ctrl && !i.ctrlKey || r.alt && !i.altKey || r.meta && !i.metaKey || r.shift && !i.shiftKey || r.if && !r.if[0] || r.self && i.target != t || r.primary && !i.isPrimary || r.pen && i.pointerType != "pen" || r.mouse && i.pointerType != "mouse" || r.touch && i.pointerType != "touch" || r.sel && !i.target.matches(String(r.sel[0]))) return; let o = this.state = s.state = this.current = new Qn(i, s, t); e = o.pointerId; let l = function(f) { return f.preventDefault(), false; }, h = null, a = Symbol(), c = function(f) { let p = o.clientX, m = o.clientY, g = f.clientX, _ = f.clientY; (o[ze] || o.defaultPrevented) && (f.pointerId == o.pointerId || p == g && m == _) && (f.preventDefault(), f.stopPropagation()), c && (globalThis.removeEventListener("click", c, {capture: true}), c = null); }, u = function(f) { if (!(o.type == "touchmove" && f.changedTouches[0].identifier != e) && (o.defaultPrevented || o[ze])) return f.preventDefault(); }, d = function(f) { let p = f.type, m = o.phase; if (f.pointerId && o.pointerId != f.pointerId || f[a]) return; f[a] = true; let g = p == "pointerup" || p == "pointercancel"; if (f.pressure == 0 && f.pointerType == "mouse" && p == "pointermove" && o.originalEvent.pressure > 0) return h(f); p == "pointercancel" ? (o.x = o.clientX, o.y = o.clientY) : (o.x = f.clientX, o.y = f.clientY), o.event = f, g && (o.phase = "ended"); try { s.handleEvent(o); } catch (_) { } if (m == "init" && !g && (o.phase = "active"), g && h) return h(f); }, b = false; return h = function(f) { if (!b && (b = true, t.flags.decr("_touch_"), o.phase != "ended" && (o.phase = "ended", o.x = o.clientX, o.y = o.clientY, s.handleEvent(o)), o.emit("end"), r.passive || --s.prevents == 0 && t.style.removeProperty("touch-action"), s.state = {}, globalThis.removeEventListener("pointermove", d, {passive: !!r.passive}), globalThis.removeEventListener("pointerup", d), globalThis.removeEventListener("pointercancel", d), setTimeout(function() { if (c && (globalThis.removeEventListener("click", c, {capture: true}), c = null), n && u) return globalThis.removeEventListener("touchend", u), globalThis.removeEventListener("touchmove", u, {passive: false}), u = null; }, 100), !r.passive)) return globalThis.document.removeEventListener("selectstart", l, {capture: true}); }, o[Yn] = h, r.passive || (s.prevents || (s.prevents = 0), s.prevents++, t.style.setProperty("touch-action", "none"), t.offsetWidth), t.flags.incr("_touch_"), globalThis.addEventListener("pointermove", d, {passive: !!r.passive}), globalThis.addEventListener("pointerup", d), globalThis.addEventListener("pointercancel", d), globalThis.addEventListener("click", c, {capture: true}), n && !r.passive && (globalThis.addEventListener("touchend", u), globalThis.addEventListener("touchmove", u, {passive: false})), r.passive || globalThis.document.addEventListener("selectstart", l, {capture: true}), d(i), false; }; function Zn(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } function Uu(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } var Bu = Symbol.for("#context"), Yu = Symbol.for("#extendType"); function Wu() { return true; } var to = new (globalThis.WeakMap || Map)(), Ke = {threshold: [0]}, Gu = {}; z.intersect$handle = function() { let i = this.event.detail.observer; return this.modifiers._observer == i; }; var eo = class extends $ { \u03B1in() { return this.delta >= 0 && this.entry.isIntersecting; } \u03B1out() { return this.delta < 0; } \u03B1css(t = "ratio") { return this.target.style.setProperty("--ratio", this.ratio), true; } \u03B1flag(t, e) { let {state: r, step: s} = this[Bu], n = $t(e || "", this.target); return this.isIntersecting && !r[s] ? (n.flags.incr(t), r[s] = true) : r[s] && !this.isIntersecting && (n.flags.decr(t), r[s] = false), true; } }; function Xu(i, t) { return function(e, r) { let s = r.prevRatios || (r.prevRatios = new WeakMap()); for (let n = 0, o = Zn(e), l = o.length; n < l; n++) { let h = o[n], a = s.get(h.target) || 0, c = h.intersectionRatio, u = {entry: h, ratio: c, from: a, delta: c - a, observer: r}, d = new $(i, {bubbles: false, detail: u}); d[Yu](eo), d.entry = h, d.isIntersecting = h.isIntersecting, d.delta = u.delta, d.ratio = u.ratio, s.set(h.target, c), h.target.dispatchEvent(d); } }; } function ro(i = Ke) { let t = i.threshold.join("-") + i.rootMargin; !i.root && Ke.root && (i.root || (i.root = Ke.root)); let e = i.root || Gu, r = to.get(e); return r || to.set(e, r = {}), r[t] || (r[t] = new IntersectionObserver(Xu("intersect", t), i)); } var io = class { on$intersect(t, e, r, s) { let n; if (t.options) { let o = [], l = {threshold: o}; for (let h = 0, a = Zn(t.options), c = a.length; h < c; h++) { let u = a[h]; u instanceof v || u instanceof Et ? l.root = u : typeof u == "number" ? o.push(u) : typeof u == "string" ? l.rootMargin = u : typeof u == "object" && Object.assign(l, u); } if (o.length == 1) { let h = o[0]; if (h > 1) for (o[0] = 0; o.length < h; ) o.push(o.length / (h - 1)); } o.length == 0 && o.push(0), n = ro(l); } else n = ro(); return t._observer = n, n.observe(this), this.addEventListener("intersect", r, s), r; } }; Uu(v.prototype, io.prototype); function Qu(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } function Ju(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } var Zu = Symbol.for("#extendType"); function ta() { return true; } var Ve = null, so = class extends $ { \u03B1css(t = "1elw", e = "1elh", r = "") { let s = this.target; if (s.offsetParent) { let n = lt(t), o = lt(e), l = $t(r, s), h = n ? "--u_" + n[1] : "--" + t, a = o ? "--u_" + o[1] : "--" + e, c = n ? this.width / n[0] : this.width, u = o ? this.height / o[0] : this.height; l.style.setProperty(h, c), l.style.setProperty(a, u); } return true; } }; function ea() { return globalThis.ResizeObserver || Ve || (console.warn(":resize not supported in this browser"), Ve = {observe: function() { return true; }}), Ve || (Ve = new ResizeObserver(function(i) { for (let t = 0, e = Qu(i), r = e.length; t < r; t++) { let s = e[t], n = new $("resize", {bubbles: false, detail: s}); n.entry = s, n.rect = s.contentRect, n.width = s.target.offsetWidth, n.height = s.target.offsetHeight, n[Zu](so), s.target.dispatchEvent(n); let o = new $("resized", {bubbles: true, detail: s}); s.target.dispatchEvent(o); } })); } var no = class { on$resize(t, e, r, s) { return ea().observe(this), this.addEventListener("resize", r, s), r; } }; Ju(v.prototype, no.prototype); function ra(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } function ia() { return true; } var ti, oo = Symbol(); function sa() { if (!ti) return ti = function(i) { if (i[oo]) return; i[oo] = true; let t = globalThis.document.activeElement; if (t && t.matches("input,textarea")) { let e = new $("selection", {detail: {start: t.selectionStart, end: t.selectionEnd}}); return t.dispatchEvent(e); } }, globalThis.document.addEventListener("selectionchange", ti); } var lo = class { on$selection(t, e, r, s) { return sa(), this.addEventListener("selection", r, s), r; } }; ra(v.prototype, lo.prototype); var ho = Symbol.for("#string"), uo = Symbol.for("#html"), G = {win: {sep: "+", name: "win", order: ["meta", "ctrl", "mod", "alt", "option", "shift"].reverse(), labels: {option: "alt", mod: "ctrl", meta: "win"}}, mac: {sep: "", name: "mac", order: ["ctrl", "alt", "option", "shift", "mod", "command"].reverse(), labels: {left: "\u2192", up: "\u2191", down: "\u2193", right: "\u2190", plus: "+", tab: "\u21E5", meta: "\u2318", mod: "\u2318", ctrl: "\u2303", option: "\u2325", alt: "\u2325", del: "\u2326", shift: "\u21E7", enter: "\u21A9", esc: "\u238B", backspace: "\u232B"}}}; G.auto = G.win; (globalThis.navigator.platform || "").match(/iPhone|iPod|iPad|Mac/) && (G.auto = G.mac); var ei = {}; function ao(i, t = "auto") { let e = "" + i + ":" + t; if (ei[e]) return ei[e]; let r = G[t] || G.win, s = i.split(" ").map(function(n) { return n.split("+").sort(function(a, c) { return r.order.indexOf(c) - r.order.indexOf(a); }).map(function(a) { let c = r.labels[a] || a; return c = c[0].toUpperCase() + (c.slice(1) || ""); }); }); return ei[e] = s; } function fo(i, t) { var e; let r = ao(i, t), s = G[t] || G.win; return r[ho] || (r[ho] = r.map(function(n) { return n.join(s.sep); }).join(" ")); } function co(i, t) { var e; let r = ao(i, t), s = G[t] || G.win; return r[uo] || (r[uo] = r.map(function(n) { return "" + n.map(function(o) { return "" + o + ""; }).join("") + ""; }).join(" ")); } var ut = {8: "backspace", 9: "tab", 13: "enter", 16: "shift", 17: "ctrl", 18: "alt", 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", 37: "left", 38: "up", 39: "right", 40: "down", 45: "ins", 46: "del", 91: "meta", 93: "meta", 224: "meta"}, po = {106: "*", 107: "+", 109: "-", 110: ".", 111: "/", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 221: "]", 222: "'"}, mo = {"~": "`", "!": "1", "@": "2", "#": "3", $: "4", "%": "5", "^": "6", "&": "7", "*": "8", "(": "9", ")": "0", _: "-", "+": "=", ":": ";", '"': "'", "<": ",", ">": ".", "?": "/", "|": "\\"}, go = {option: "alt", command: "meta", return: "enter", escape: "esc", plus: "+", mod: /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? "meta" : "ctrl"}, Gt; for (var rt = 1; rt < 20; ++rt) ut[111 + rt] = "f" + rt; for (rt = 0; rt <= 9; ++rt) ut[rt + 96] = rt.toString(); function ri(i, t, e) { if (i.addEventListener) { i.addEventListener(t, e, false); return; } i.attachEvent("on" + t, e); } function ii(i, t, e) { if (i.removeEventListener) { i.removeEventListener(t, e, false); return; } i.detachEvent("on" + t, e); } function yo(i) { if (i.type == "keypress") { var t = String.fromCharCode(i.which); return i.shiftKey || (t = t.toLowerCase()), t; } return ut[i.which] ? ut[i.which] : po[i.which] ? po[i.which] : String.fromCharCode(i.which).toLowerCase(); } function na(i, t) { return i.sort().join(",") === t.sort().join(","); } function oa(i) { var t = []; return i.shiftKey && t.push("shift"), i.altKey && t.push("alt"), i.ctrlKey && t.push("ctrl"), i.metaKey && t.push("meta"), t; } function la(i) { if (i.preventDefault) { i.preventDefault(); return; } i.returnValue = false; } function ha(i) { if (i.stopPropagation) { i.stopPropagation(); return; } i.cancelBubble = true; } function si(i) { return i == "shift" || i == "ctrl" || i == "alt" || i == "meta"; } function ua() { if (!Gt) { Gt = {}; for (var i in ut) i > 95 && i < 112 || ut.hasOwnProperty(i) && (Gt[ut[i]] = i); } return Gt; } function aa(i, t, e) { return e || (e = ua()[i] ? "keydown" : "keypress"), e == "keypress" && t.length && (e = "keydown"), e; } function fa(i) { return i === "+" ? ["+"] : (i = i.replace(/\+{2}/g, "+plus"), i.split("+")); } function _o(i, t) { var e, r, s, n = []; for (e = fa(i), s = 0; s < e.length; ++s) r = e[s], go[r] && (r = go[r]), t && t != "keypress" && mo[r] && (r = mo[r], n.push("shift")), si(r) && n.push(r); return t = aa(r, n, t), {key: r, modifiers: n, action: t}; } function bo(i, t) { return i === null || i === document ? false : i === t ? true : bo(i.parentNode, t); } function k(i) { var t = this; if (i = i || document, !(t instanceof k)) return new k(i); t.target = i, t._callbacks = {}, t._directMap = {}; var e = {}, r, s = false, n = false, o = false; function l(f) { f = f || {}; var p = false, m; for (m in e) { if (f[m]) { p = true; continue; } e[m] = 0; } p || (o = false); } function h(f, p, m, g, _, w) { var y, x, N = [], M = m.type; if (!t._callbacks[f]) return []; for (M == "keyup" && si(f) && (p = [f]), y = 0; y < t._callbacks[f].length; ++y) if (x = t._callbacks[f][y], !(!g && x.seq && e[x.seq] != x.level) && M == x.action && (M == "keypress" && !m.metaKey && !m.ctrlKey || na(p, x.modifiers))) { var Pi = !g && x.combo == _, he = g && x.seq == g && x.level == w; (Pi || he) && t._callbacks[f].splice(y, 1), N.push(x); } return N; } function a(f, p, m, g) { t.stopCallback(p, p.target || p.srcElement, m, g) || f(p, m) === false && (la(p), ha(p)); } t._handleKey = function(f, p, m) { var g = h(f, p, m), _, w = {}, y = 0, x = false; for (_ = 0; _ < g.length; ++_) g[_].seq && (y = Math.max(y, g[_].level)); for (_ = 0; _ < g.length; ++_) { if (g[_].seq) { if (g[_].level != y) continue; x = true, w[g[_].seq] = 1, a(g[_].callback, m, g[_].combo, g[_].seq); continue; } x || a(g[_].callback, m, g[_].combo); } var N = m.type == "keypress" && n; m.type == o && !si(f) && !N && l(w), n = x && m.type == "keydown"; }; function c(f) { typeof f.which != "number" && (f.which = f.keyCode); var p = yo(f); if (!!p) { if (f.type == "keyup" && s === p) { s = false; return; } t.handleKey(p, oa(f), f); } } function u() { clearTimeout(r), r = setTimeout(l, 1e3); } function d(f, p, m, g) { e[f] = 0; function _(M) { return function() { o = M, ++e[f], u(); }; } function w(M) { a(m, M, f), g !== "keyup" && (s = yo(M)), setTimeout(l, 10); } for (var y = 0; y < p.length; ++y) { var x = y + 1 === p.length, N = x ? w : _(g || _o(p[y + 1]).action); b(p[y], N, g, f, y); } } function b(f, p, m, g, _) { t._directMap[f + ":" + m] = p, f = f.replace(/\s+/g, " "); var w = f.split(" "), y; if (w.length > 1) { d(f, w, p, m); return; } y = _o(f, m), t._callbacks[y.key] = t._callbacks[y.key] || [], h(y.key, y.modifiers, {type: y.action}, g, f, _), t._callbacks[y.key][g ? "unshift" : "push"]({callback: p, modifiers: y.modifiers, action: y.action, seq: g, level: _, combo: f}); } t._bindMultiple = function(f, p, m) { for (var g = 0; g < f.length; ++g) b(f[g], p, m); }, t.enable = function() { ri(i, "keypress", c), ri(i, "keydown", c), ri(i, "keyup", c); }, t.disable = function() { ii(i, "keypress", c), ii(i, "keydown", c), ii(i, "keyup", c); }, t.enable(); } k.prototype.bind = function(i, t, e) { var r = this; return i = i instanceof Array ? i : [i], r._bindMultiple.call(r, i, t, e), r; }; k.prototype.unbind = function(i, t) { var e = this; return e.bind.call(e, i, function() { }, t); }; k.prototype.trigger = function(i, t) { var e = this; return e._directMap[i + ":" + t] && e._directMap[i + ":" + t]({}, i), e; }; k.prototype.reset = function() { var i = this; return i._callbacks = {}, i._directMap = {}, i; }; k.prototype.stopCallback = function(i, t) { var e = this; return (" " + t.className + " ").indexOf(" mousetrap ") > -1 || bo(t, e.target) ? false : t.tagName == "INPUT" || t.tagName == "SELECT" || t.tagName == "TEXTAREA" || t.isContentEditable; }; k.prototype.handleKey = function() { var i = this; return i._handleKey.apply(i, arguments); }; k.addKeycodes = function(i) { for (var t in i) i.hasOwnProperty(t) && (ut[t] = i[t]); Gt = null; }; k.init = function() { var i = k(document); for (var t in i) t.charAt(0) !== "_" && (k[t] = function(e) { return function() { return i[e].apply(i, arguments); }; }(t)); }; function Xt(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } function ca(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } var Qc = Symbol.for("#__initor__"), Jc = Symbol.for("#__inited__"), ni = Symbol.for("#updateHotKeys"), da = Symbol.for("#inInput"), oi = Symbol.for("#inEditable"), pa = Symbol.for("#hotkeyTarget"), vo = Symbol.for("#hotkeyCombos"), ma = Symbol.for("#extendType"), Qt = Symbol.for("#combos"), xo = Symbol.for("#target"), Jt = Symbol.for("#hotkeyHandlers"), ga = Symbol.for("#defaultPrevented"), ya = Symbol.for("#visit"), So = Symbol.for("#key"), _a; try { _a = (globalThis.navigator.platform || "").match(/iPhone|iPod|iPad|Mac/); } catch (i) { } function ba() { return true; } var li = {esc: true}, wo = class extends $ { \u03B1focus(t) { let e = this.target, r = e.ownerDocument; return t && (e = e.querySelector(t) || e.closest(t) || r.querySelector(t)), e == r.body ? r.activeElement != r.body && r.activeElement.blur() : e.focus(), true; } \u03B1repeat() { return true; } }, va = function(i, t, e) { return t.tagName == "INPUT" && (e == "down" || e == "up") ? false : t.tagName == "INPUT" || t.tagName == "SELECT" || t.tagName == "TEXTAREA" ? li[e] ? (i[da] = true, i[oi] = true, false) : true : t.contentEditable && (t.contentEditable == "true" || t.contentEditable == "plaintext-only") ? li[e] ? (i[oi] = true, false) : true : false; }, Eo = new class { constructor() { this.combos = {"*": {}}, this.identifiers = {}, this.labels = {}, this.handler = this.handle.bind(this), this.mousetrap = null, this.hothandler = this.handle.bind(this); } trigger(t) { var e, r; return (r = (e = this.mousetrap) == null ? void 0 : e.trigger) == null ? void 0 : r.call(e, t); } register(t, e = {}) { return this.mousetrap || (this.mousetrap = k(globalThis.document), this.mousetrap.stopCallback = va), this.combos[t] || (this.combos[t] = true, this.mousetrap.bind(t, this.handler)), (e.capture || e.force) && (li[t] = true), this; } comboIdentifier(t) { var e; return (e = this.identifiers)[t] || (e[t] = t.replace(/\+/g, "_").replace(/\ /g, "-").replace(/\*/g, "all").replace(/\|/g, " ")); } humanize(t, e = "auto") { return fo(t, e); } htmlify(t, e = "auto") { return co(t, e); } matchCombo(t) { return true; } handle(t, e) { var c; let r = t.target && t.target[pa] || t.target || globalThis.document.body, s = Array.from(globalThis.document.querySelectorAll("[data-hotkey]")), n = r.ownerDocument, o = r; for (; o && o != n && o.hotkeys !== true; ) o = o.parentNode; if (s = s.reverse().filter(function(u) { let d = u[vo]; if (!(d && (d[e] || d["*"]))) return false; let b = u; for (; b && b != n; ) { if (b.hotkeys === false) return false; b = b.parentNode; } return true; }), !s.length) return; let l = {combo: e, originalEvent: t, targets: s}, h = new $("hotkey", {bubbles: true, detail: l}); h[ma](wo), h.originalEvent = t, h.hotkey = e, r.dispatchEvent(h); let a = []; for (let u = 0, d = Xt(s), b = d.length; u < b; u++) { let f = d[u]; for (let p = 0, m = Xt(f[Jt]), g = m.length; p < g; p++) { let _ = m[p]; if ((_[Qt][e] || _[Qt]["*"]) && (!t[oi] || _.capture\u03A6 || _.params.force)) { let w = _[xo]; (o.contains(w) || w.contains(o) || _.global\u03A6) && a.push(_); } } } for (let u = 0, d = Xt(a), b = d.length; u < b; u++) { let f = d[u]; if ((!t.repeat || f.params.repeat) && f.handleEvent(h), (!f.passive\u03A6 || h[ga]) && ((c = t == null ? void 0 : t.preventDefault) == null || c.call(t)), !f.passive\u03A6) break; } return this; } }(), To = function(i, t) { let e = t.element; e instanceof v && (e.matches("input,textarea,select,option") ? e.focus() : e.click()); }; To.passive = true; var No = class { on$hotkey(t, e, r, s) { var n = this; return this[Jt] || (this[Jt] = []), this[Jt].push(r), r[xo] = this, t.$_ || (t.$_ = [To]), t[ya] = function() { return n[ni](); }, this[ni](), r; } [ni]() { let t = {}; for (let e = 0, r = Xt(this[Jt]), s = r.length; e < s; e++) { let n = r[e], o = n.params, l = o.options[0]; if (n[So] != l ? (n[So] = l, true) : false) { n[Qt] = {}; for (let h = 0, a = Xt(l.split("|")), c = a.length; h < c; h++) { let u = a[h]; Eo.register(u, o), n[Qt][u] = true; } } Object.assign(t, n[Qt]); } return this[vo] = t, this.dataset.hotkey = Object.keys(t).join(" "), this; } }; ca(v.prototype, No.prototype); var Yo = Rl(Do()); var ui = Symbol.for("#getQueryParam"), Ao = Symbol.for("#setQueryParam"), rd = Symbol.for("#__initor__"), id = Symbol.for("#__inited__"), Ro = Symbol.for("#query"); var B = class { static parse(t, e) { return t instanceof B ? t : new B(t, e); } constructor(t, e) { this.router = e, this.parse(t); } parse(t) { var r; let e; return t instanceof URL || (t = new URL(t, this.router.origin)), (e = (r = this.router) == null ? void 0 : r.aliases[t.pathname]) && (t.pathname = e), this.url = t, this; } get active\u03A6() { return this.router.location == this; } reparse() { return this.parse(this.url); } get searchParams() { return this.url.searchParams; } search() { let t = this.searchParams ? this.searchParams.toString() : ""; return t ? "?" + t : ""; } update(t) { if (t instanceof Object) for (let e = 0, r = Object.keys(t), s = r.length, n, o; e < s; e++) n = r[e], o = t[n], this.searchParams.set(n, o); else typeof t == "string" && this.parse(t); return this; } clone() { return new B(this.url.href, this.router); } equals(t) { return this.toString() == String(t); } get href() { return this.url.href; } get path() { return this.url.href.slice(this.url.origin.length); } get pathname() { return this.url.pathname; } get query() { return this[Ro] || (this[Ro] = new Proxy({}, {get: this[ui].bind(this), set: this[Ao].bind(this)})); } toString() { return this.href; } [ui](t, e) { return this.searchParams.get(e); } [Ao](t, e, r) { return this[ui](t, e) != r && (r == null || r == "" ? this.searchParams.delete(e) : this.searchParams.set(e, r), this.active\u03A6 && (this.router.history.replaceState({}, null, this.url.toString()), this.router.touch())), true; } }; var od = Symbol.for("#__initor__"), ld = Symbol.for("#__inited__"), Be = class { constructor(t, e, r) { this.router = t, e && (this.location = B.parse(e), this.original = this.location.clone()), this.referrer = r; } redirect(t) { var e, r; return (r = (e = this.location) == null ? void 0 : e.update) == null || r.call(e, t), this; } get path() { var t; return (t = this.location) == null ? void 0 : t.path; } get url() { var t, e; return (e = (t = this.location) == null ? void 0 : t.toString) == null ? void 0 : e.call(t); } set path(t) { this.location.path = t; } abort(t = false) { return this.aborted = true, t && (this.forceAbort = t), this; } match(t) { return this.location ? this.router.route(t).match(this.path) : null; } }; function jo(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } var ud = Symbol.for("#__initor__"), ad = Symbol.for("#__inited__"), Ye = Symbol.for("#routes"), ai = Symbol.for("#match"), Na = Symbol.for("#symbol"), qo = Symbol.for("#matches"), fi = new Map(), ci = {}, zo = {}; function Oa(i) { if (!fi.has(i)) { let t = new Map(); return fi.set(i, t), t; } return fi.get(i); } function Ca(i, t) { let e = Oa(i); if (!e.has(t)) { let r = Object.create(i); return Object.assign(r, t), e.set(t, r), r; } return e.get(t); } var Ko = class { }; function $a(i) { if (ci[i]) return ci[i]; let t = ci[i] = {url: i}, e = i.indexOf("?"), r = i.indexOf("#"); if (r >= 0 && (t.hash = i.slice(r + 1), i = t.url = i.slice(0, r)), e >= 0) { let s = t.query = i.slice(e + 1); i = i.slice(0, e), t.query = zo[s] || (zo[s] = new URLSearchParams(s)); } return t.path = i, t; } var di = class { constructor(t) { this.router = t, this.fullPath = "", this[Ye] = {}, this[ai] = new Ko(), this[ai].path = ""; } route(t) { var e; return (e = this[Ye])[t] || (e[t] = new We(this.router, t, this)); } match() { return this[ai]; } resolve(t) { return "/"; } }, We = class { constructor(t, e, r) { this.parent = r || t.rootRoute, this.router = t, this.status = 200, this.path = e, this[Na] = Symbol(), this[qo] = {}, this[Ye] = {}; } route(t) { var e; return (e = this[Ye])[t] || (e[t] = new We(this.router, t, this)); } get fullPath() { return "" + this.parent.fullPath + "/" + this.$path; } load(t) { return this.router.queue.add(t); } set path(t) { var e = this; if (this.$path == t) return; if (this.raw = t, this.$path = t, this.groups = [], this.cache = {}, this.dynamic = false, t.indexOf("?") >= 0) { let s = t.split("?"); t = s.shift(), this.query = {}; for (let n = 0, o = jo(s.join("?").split("&")), l = o.length; n < l; n++) { let h = o[n]; if (!h) continue; let [a, c] = h.split("="); a[0] == "!" && (this.dynamic = true, a = a.slice(1), c = false), c === "" && (c = false), c && c[0] == ":" && (this.dynamic = true), this.query[a] = c || c !== false; } } if (t = t.replace(/\:(\w+|\*)(\.)?/g, function(s, n, o) { return e.dynamic = true, n != "*" && e.groups.push(n), o ? "([^/#.?]+)." : "([^/#?]+)"; }), t == "" && e.query) return; t = "^" + t; let r = t[t.length - 1]; r == "$" && (t = t.slice(0, -1) + "(?=/?[#?]|/?$)"), r != "/" && r != "$" && t != "^/" && (t = t + "(?=[/#?]|$)"), e.regex = new RegExp(t); } match(t = this.router.path) { var h, a; var e, r; let s = this.parent.match(t); if (!s) return null; let n = $a(t), o = n.url, l = ""; if (s.path && n.path.indexOf(s.path) == 0 && (l = s.path + "/", o = o.slice(l.length)), e = this.regex ? o.match(this.regex) : [""]) { let c = l + e[0], u = [this.$path], d = {}; if (this.groups.length) for (let p = 0, m = jo(e), g = m.length, _; p < g; p++) { let w = m[p]; (_ = this.groups[p - 1]) && (d[_] = w, u.push(w)); } if (this.query) for (let p = this.query, m = 0, g = Object.keys(p), _ = g.length, w, y; m < _; m++) { w = g[m], y = p[w]; let x = w, N = (a = (h = n.query) == null ? void 0 : h.get) == null ? void 0 : a.call(h, w); if (y === false) { if (N) return null; u.push("1"); continue; } if (y[0] == ":" && (x = y.slice(1), y = true), y == true && N || y == N) d[x] = N, u.push(N); else return null; } let b = u.join("*"); d = (r = this[qo])[b] || (r[b] = d); let f = Ca(s, d); return f.path = c, f; } return null; } resolve(t = this.router.path) { if (this.raw[0] == "/" && !this.dynamic) return this.raw.replace(/\$/g, ""); let e = this.parent.match(t), r = this.parent.resolve(t), s; if (this.dynamic) { let n = this.match(t); return n ? n.path : null; } return this.raw[0] == "?" ? s = (r || "/") + this.raw : s = r + "/" + this.raw, s.replace(/\$/g, "").replace(/\/\/+/g, "/"); } }; var Vo = Symbol.for("#__initor__"), Ho = Symbol.for("#__inited__"), Uo = Symbol.for("#__init__"), Ge = Symbol.for("#idler"), Zt = Symbol.for("#resolve"), Bo = Symbol(), Xe = class extends Set { static [Uo]() { return this.prototype[Vo] = Bo, this; } constructor() { super(); this[Ge] = Promise.resolve(this), this[Vo] === Bo && this[Ho] && this[Ho](); } emit(t, ...e) { return A(this, t, e); } on(t, ...e) { return D(this, t, ...e); } once(t, ...e) { return F(this, t, ...e); } un(t, ...e) { return ct(this, t, ...e); } add(t) { var e = this; if (t instanceof Function && (t = t()), !this.has(t)) { t.then(function() { return e.delete(t); }); let r = e.size == 0; super.add(t), r && (this[Ge] = this[Zt] = null, e.emit("busy", e)); } return t; } delete(t) { return super.delete(t) ? (this.size == 0 && (this[Zt] && (this[Zt](this), this[Zt] = null), this.emit("idle", this)), true) : false; } get idle() { var t = this; return this[Ge] || (this[Ge] = new Promise(function(e) { return t[Zt] = e; })); } }; Xe[Uo](); function pi(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } var Wo = Symbol.for("#__initor__"), Go = Symbol.for("#__inited__"), Xo = Symbol.for("#__init__"), mi = Symbol.for("#enter"), gi = Symbol.for("#resolved"), yi = Symbol.for("#leave"), Qo = Symbol.for("#router"), Pa = Symbol.for("#routes"), at = Symbol.for("#version"), kt = Symbol.for("#doc"), Jo = Symbol.for("#origin"), _i = Symbol.for("#request"), te = Symbol.for("#hash"), V = Symbol.for("#routeTo"), Qe = Symbol.for("#path"), X = Symbol.for("#match"), ee = Symbol.for("#options"), ka = Symbol.for("#cache"), Zo = Symbol.for("#unmatched"), re = Symbol.for("#active"), La = Symbol.for("#resolvedPath"), Ma = Symbol.for("#dataKey"), Fa = Symbol.for("#activeKey"), ie = Symbol.for("#urlKey"), Lt = Symbol.for("#dataMap"), Je = Symbol.for("#href"), ft = Symbol.for("#route"), tl = Symbol.for("#context"), el = Symbol.for("#afterVisit"), rl = Symbol.for("#routeHandler"), Ia = Symbol.for("#attachToParent"), Da = Symbol.for("#detachFromParent"), il = Symbol(); var sl = class { get router() { return this[Qo] || (this[Qo] = new Ze(this)); } }; pi(Et.prototype, sl.prototype); function Aa() { return true; } var Ra = lr(function() { return globalThis.document.router; }), Ze = class extends Yo.EventEmitter { static [Xo]() { return this.prototype[Wo] = il, this; } constructor(t, e = {}) { super(); this[Pa] = {}, this.aliases = {}, this.redirects = {}, this.rules = {}, this.options = e, this.busy = [], this[at] = 0, this[kt] = t, this.queue = new Xe(), this.web\u03A6 = !!t.defaultView, this.root = new di(this), this.history = globalThis.window.history, this.location = new B(e.url || t.location.href, this), this.mode = e.mode || "history", this.queue.on("busy", function() { return globalThis.document.flags.incr("_routing_"); }), this.queue.on("idle", function() { return globalThis.document.flags.decr("_routing_"), P(); }), this.setup(), this[Wo] === il && this[Go] && this[Go](); } get origin() { return this[Jo] || (this[Jo] = this[kt].location.origin); } get query() { return this.location.query; } init() { return this.refresh({mode: "replace"}), this; } alias(t, e) { return this.aliases[t] = e, this.location.reparse(), this; } touch() { return this[at]++; } option(t, e) { return e == null ? this.options[t] : (this.options[t] = e, this); } get realpath() { let t = this[kt].location; return t.href.slice(t.origin.length); } get state() { return {}; } get ctx() { return this[_i]; } pushState(t, e, r) { return this.history.pushState(t, e || null, String(r)); } replaceState(t, e, r) { return this.history.replaceState(t, e || null, String(r)); } refresh(t = {}) { var e = this; if (this.refreshing) return; this.refreshing = true; let r = this.location, s = B.parse(t.location || this.realpath, this), n = t.mode, o = this[_i]; if (!s.equals(r) || !o) { let l = new Be(this, s, r); l.mode = n, this[_i] = l, this.emit("beforechange", l), l.aborted && (!l.forceAbort && globalThis.window.confirm("Are you sure you want to leave? You might have unsaved changes") ? l.aborted = false : n == "pop" ? this.pushState(this.state, null, String(r)) : n == "replace" && this.replaceState(this.state, null, String(r))), l.aborted || (this.location = l.location, n == "push" ? this.pushState(t.state || this.state, null, String(this.location)) : n == "replace" && this.replaceState(t.state || this.state, null, String(this.location)), this.location.state = globalThis.window.history.state, this.emit("change", l), this.touch(), P()); } return O.add(function() { let l = e[kt].location.hash; if (l != e[te]) return e.emit("hashchange", e[te] = l); }), e.refreshing = false, e; } onpopstate(t) { return this.refresh({pop: true, mode: "pop"}), this; } onbeforeunload(t) { let e = new Be(this, null, this.location); if (this.emit("beforechange", e), e.aborted) return true; } onhashchange(t) { return this.emit("hashchange", this[te] = this[kt].location.hash), P(); } setup() { this.onclick = this.onclick.bind(this), this.onhashchange = this.onhashchange.bind(this); let t = globalThis.window; return this[te] = this[kt].location.hash, this.location = B.parse(this.realpath, this), this.history.replaceState(this.state, null, String(this.location)), t.onpopstate = this.onpopstate.bind(this), t.onbeforeunload = this.onbeforeunload.bind(this), t.addEventListener("hashchange", this.onhashchange), t.addEventListener("click", this.onclick, {capture: true}), t.document.documentElement.emit("routerinit", this), this.refresh, this; } onclick(t) { if (t.metaKey || t.altKey) return; let e = null, r = null, s = t.target; for (; s && (!e || !r); ) !e && s.nodeName == "A" && (e = s), !r && s[V] && (r = s), s = s.parentNode; if (e && r != e && (!r || r.contains(e))) { let n = e.getAttribute("href"); n && !n.match(/\:\/\//) && (!e.getAttribute("target") || e.getAttribute("target") == "_self") && !e.classList.contains("external") && e.addEventListener("click", this.onclicklink.bind(this), {once: true}); } return true; } onclicklink(t) { let e = t.currentTarget || t.target; e[V] && e[V].resolve(); let r = e.getAttribute("href"), s = new URL(e.href), n = s.href.slice(s.origin.length), o = this.realpath.split("#")[0], l = n.split("#")[0]; return o == l ? globalThis.document.location.hash = s.hash : e[V] ? e[V].go() : this.go(n), t.stopPropagation(), t.preventDefault(); } get url() { return this.location.url; } get path() { let t = this.location.path; return this.aliases[t] || t; } get pathname() { return this.location.pathname; } serializeParams(t) { var e; if (t instanceof Object) { e = []; for (let s = 0, n = Object.keys(t), o = n.length, l, h; s < o; s++) l = n[s], h = t[l], e.push([l, globalThis.encodeURI(h)].join("=")); return e.join("&"); } return t || ""; } get hash() { return this[te]; } set hash(t) { this.history.replaceState({}, null, "#" + this.serializeParams(t)); } match(t) { return this.route(t).match(this.path); } route(t) { return this.root.route(t); } go(t, e = {}) { let r = this.location.clone().update(t, e); return this.refresh({push: true, mode: "push", location: r, state: e}), this; } replace(t, e = {}) { let r = this.location.clone().update(t, e); return this.refresh({replace: true, mode: "replace", location: r, state: e}); } }; Ze[Xo](); var tr = class { constructor(t, e, r, s = {}) { this.parent = r, this.node = t, this[Qe] = e, this[X] = null, this[ee] = s, this[ka] = {}, this[Zo] = {}, this[re] = null, this[La] = null, this[Ma] = Symbol(), this[Fa] = Symbol(), this[ie] = Symbol(); } get router() { return this.node.ownerDocument.router; } get route() { return (this.parent ? this.parent.route : this.router).route(this[Qe]); } get match() { return this[X]; } get params() { return this[X] || this[Zo]; } get state() { let t = this[Lt] || (this[Lt] = new Map()), e = this.params, r = this[Lt].get(e); return r || this[Lt].set(e, r = {}), r; } set state(t) { (this[Lt] || (this[Lt] = new Map())).set(this.params, t); } set path(t) { (this[Qe] != t ? (this[Qe] = t, true) : false) && this.router.touch(); } get isActive() { return !!this[re]; } resolve() { let t = this.router[at]; if (!(this[at] != t ? (this[at] = t, true) : false)) return; let e = this.route, r = this[ee], s = this.router.path, n = e.match(s), o = this[re], l = this[X], h = n != l, a = n && n[this[ie]]; return n && (this[re] = true, this[X] = n, n[this[ie]] = s), n && (h || a != s) && this[gi](n, l, a), !o && n && this[mi](), !n && (o || o === null) && (this[re] = false, this[yi]()), this[X]; } [mi]() { var t, e; return this.node.flags.remove("not-routed"), this.node.flags.add("routed"), (e = (t = this.node) == null ? void 0 : t.routeDidEnter) == null ? void 0 : e.call(t, this); } [gi](t, e, r = "") { var s, n; return (n = (s = this.node) == null ? void 0 : s.routeDidResolve) == null ? void 0 : n.call(s, this, t, e, r); } [yi]() { var t, e; return this.node.flags.add("not-routed"), this.node.flags.remove("routed"), (e = (t = this.node) == null ? void 0 : t.routeDidLeave) == null ? void 0 : e.call(t, this); } }, bi = class extends tr { [mi]() { return this; } [gi]() { return this; } [yi]() { return this; } resolve() { let t = this.router[at]; if (!(this[at] != t ? (this[at] = t, true) : false)) return; let e = this[ee], r = this.route, s = this.router.path, n = this.route.resolve(s), o = this.route.match(s); o && (this[X] = o, this[X][this[ie]] = s), e.sticky && this[X] && (n = this[X][this[ie]]), (this[Je] != n ? (this[Je] = n, true) : false) && this.node.nodeName == "A" && this.node.setAttribute("href", n), this.node.flags.toggle("active", !!o); } go() { return this.resolve(), this[ee] && this[ee].replace ? this.router.replace(this[Je]) : this.router.go(this[Je]); } }, nl = class { get router() { return this.ownerDocument.router; } }; pi(I.prototype, nl.prototype); var ol = class { set route(t) { if (this[ft]) { this[ft].path = t; return; } let e = t[0] != "/" ? this[tl].route : null; this[ft] = new tr(this, t, e, this.route__), this[el] = this.end$routed; } get route() { return this[ft]; } set route\u039Eto(t) { var e = this; if (this[V]) { this[V].path = t; return; } let r = t[0] != "/" ? this[tl].route : null; this[ft] = this[V] = new bi(this, t, r, this.routeTo__), this[el] = this.end$routeTo, e.onclick = function(s) { if (!s.altKey && !s.metaKey && !s[rl]) return s.preventDefault(), s[rl] = e[V], e[V].go(); }; } end$routed() { if (!(this[ft] && (this[ft].resolve(), !this[ft].isActive)) && this.visit) return this.visit(); } end$routeTo() { if (this[V] && this[V].resolve(), this.visit) return this.visit(); } routeDidEnter(t) { return this[Ia](); } routeDidLeave(t) { return this[Da](); } routeDidResolve(t, e, r) { var s = this; this.routed instanceof Function && e != r && s.router.queue.add(async function() { s.suspend(); let n = await s.routed(e, t.state, r); return s.unsuspend(); }); } }; pi(v.prototype, ol.prototype); function Q(i) { let t; return i ? (t = i.toIterable) ? t.call(i) : i : []; } function vi(i, t) { let e = Object.getOwnPropertyDescriptors(t); return delete e.constructor, Object.defineProperties(i, e), i; } var kd = Symbol.for("#__initor__"), Ld = Symbol.for("#__inited__"), se = Symbol.for("##reactive"), gt = Symbol.for("##referenced"), ne = Symbol.for("##dereferenced"), er = Symbol.for("#map"), ll = Symbol.for("#__init__"), hl = Symbol.for("#child"), oe = Symbol.for("#reactions"), T = {TOUCHING: 1 << 1, STALE: 1 << 2, OBJECT: 1 << 3, RUNNING: 1 << 4, INVALIDATING: 1 << 5, POSSIBLY_STALE: 1 << 6, AUTORUN: 1 << 7}, q = 0, ul = false; var ja = 0; var xi = {META: new Map(), VALUE: new Map(), REF: new Map()}, it = Symbol.for("~"), al = Symbol.for("~~"), Si = function(i, t) { return t.has(i) || t.set(i, Symbol()), t.get(i); }, wi = function(i) { return typeof i == "symbol" ? Si(i, xi.VALUE) : Symbol.for(i); }, Ei = function(i) { return typeof i == "symbol" ? Si(i, xi.META) : Symbol.for("#" + i + "__"); }, Ti = function(i) { return typeof i == "symbol" ? Si(i, xi.REF) : Symbol.for("~" + i); }, L = function(i, t) { return q && E.add(i[it]), t; }, H = function(i, t) { return i[it].invalidated(0), t; }, Mt = function(i, t, e) { let r = i[it]; return r || (r = i[it] = new Ni(T.OBJECT), Object.defineProperties(i, e)), t && r.addSubscriber(t), i; }, Oi = function(i, t) { let e = i[it]; return e && e.removeSubscriber(t), i; }, fl = class { constructor(t) { this.changes = new Map(), this.cleanup(), t && this.reset(t); } reset(t = []) { return this.array = t, this.initialLength = t.length; } cleanup() { return this.idx = 0, this.array = null, this.changes.clear(), this.dirty = false; } push(t) { if (this.initialLength == 0) { this.array.indexOf(t) < 0 && (this.changes.set(t, 1), this.array.push(t), this.idx++); return; } let e = this.array[this.idx]; if (e === t) return ++this.idx; { let r = this.array.indexOf(t), s = this.changes.get(t); if (r === -1) this.array.splice(this.idx, 0, t), this.changes.set(t, 1), this.idx++; else if (r === this.idx + 1) e && this.changes.set(e, -1), this.array.splice(this.idx, 1), ++this.idx; else { if (r < this.idx) return; r > this.idx && this.array.splice(r, 1), this.array.splice(this.idx, 0, t); } if (s == -1) return this.changes.delete(t); } } end() { if (this.array.length >= this.idx) for (; this.array.length > this.idx; ) this.changes.set(this.array.pop(), -1); return this.array; } patch() { return this.end(); } }; function Ci(i) { var t, e; let r = Object.getOwnPropertyDescriptors(i.prototype); return t = r.name, delete r.name, e = r.constructor, delete r.constructor, r; } function qa() { if (!!(ul != true ? (ul = true, true) : false)) return fr.on("inited", function(i) { let t = i[al]; if (t) { let e = i instanceof I, r = i[it] || (i[it] = {}); for (let s = 0, n = Object.keys(t), o = n.length, l, h; s < o; s++) { l = n[s], h = t[l]; let a = r[l] = new le(i[l], i, h); e || a.call(); } e && (D(i, "mount", function() { var s; s = []; for (let n = 0, o = Q(Object.values(r)), l = o.length; n < l; n++) { let h = o[n]; s.push(h instanceof le && h.activate()); } return s; }), D(i, "unmount", function() { var s; s = []; for (let n = 0, o = Q(Object.values(r)), l = o.length; n < l; n++) { let h = o[n]; s.push(h instanceof le && h.deactivate()); } return s; })); } }); } function za(i, t = al) { return i.hasOwnProperty(t) || (i[t] = Object.assign({}, i[t] || {})), i[t]; } var rr = class { constructor(t, e = 0) { this.depth = e, this.parent = t, this.target = null, this.patcher = new fl(); } get active\u03A6() { return E == this; } get root\u03A6() { return this == Ft; } reset(t) { return this.tracking = true, this.target = t, this.beacon = t.beacon, this.patcher.reset(t.observing || (t.observing = [])), this; } add(t) { if (this.tracking && t) return this.patcher.push(t); } react(t) { return Ft.reactions.add(t); } push(t) { return E = this.child.reset(t); } pop() { let t = null; if (this.beacon) { t = this.patcher.end(); let e = this.patcher.changes; if (e.size) for (let [s, n] of Q(e)) n === 1 ? s.addSubscriber(this.beacon) : s.removeSubscriber(this.beacon); } return this.patcher.cleanup(), this.target = this.beacon = null, E = this.parent, E == Ft && Ft.flush(), t; } get child() { return this[hl] || (this[hl] = new rr(this, this.depth + 1)); } get reactions() { return this[oe] || (this[oe] = new Set()); } flush() { if (!this[oe]) return; let t = this[oe]; this[oe] = null; for (let e of Q(t)) e.call(); } }, cl = class extends rr { add() { return true; } }, E = new cl(null, 0), Ft = E, Ka = function() { return E.tracking = false; }, dl = function(i, t, e, r, s) { let n = i[e], o = i[s]; return o || (o = i[s] = new Ni(0, r, n)), E.add(o, i), n; }, pl = function(i, t, e, r, s, n) { let o = i[e]; if (r != o) { i[e] = r; let l = i[n]; l && l.changed(0, r, o); } }, Ni = class { constructor(t, e, r) { return this.observer = null, this.observers = null, r && r[gt] && r[gt](this), this; } changed(t, e, r) { if (ja++, r && r[ne] && r[ne](this, e), e && e[gt] && e[gt](this, r), this.observer && this.observer.invalidated(t + 1, this, e, r), this.observers) for (let s = 0, n = Q(this.observers), o = n.length; s < o; s++) n[s].invalidated(t + 1, this, e, r); E == Ft && E.flush(); } invalidated(t, e) { if (this.observer && this.observer.invalidated(t + 1, this), this.observers) for (let r = 0, s = Q(this.observers), n = s.length; r < n; r++) s[r].invalidated(t + 1, this); return t == 0 && E == Ft && E.flush(), true; } addSubscriber(t) { this.observer ? (this.observers || (this.observers = []), this.observers.push(t)) : this.observer = t; } removeSubscriber(t) { if (this.observer == t) return this.observer = null; let e = this.observers, r = e.indexOf(this); r >= 0 && e.splice(r, 1); } }, ml = class extends Array { push() { return H(this, super.push(...arguments)); } pop() { return H(this, super.pop(...arguments)); } unshift() { return H(this, super.unshift(...arguments)); } shift() { return H(this, super.shift(...arguments)); } splice() { return H(this, super.splice(...arguments)); } map() { return L(this, super.map(...arguments)); } filter() { return L(this, super.filter(...arguments)); } find() { return L(this, super.find(...arguments)); } slice() { return L(this, super.slice(...arguments)); } get len() { return L(this, this.length); } set len(t) { this.length = t, H(this); } toIterable() { return q && E.add(this[it]), this; } }, gl = Ci(ml), yl = class { get len() { return this.length; } set len(t) { this.length = t; } get [se]() { return Mt(this, null, gl); } [gt](t) { return Mt(this, t, gl); } [ne](t) { return Oi(this, t); } }; vi(Array.prototype, yl.prototype); var _l = class extends Set { has() { return L(this, super.has(...arguments)); } keys() { return L(this, super.keys(...arguments)); } values() { return L(this, super.values(...arguments)); } entries() { return L(this, super.entries(...arguments)); } add() { return H(this, super.add(...arguments)); } clear() { return H(this, super.clear(...arguments)); } delete() { return H(this, super.delete(...arguments)); } }, bl = Ci(_l), vl = class { get [se]() { return Mt(this, null, bl); } [gt](t) { return Mt(this, t, bl); } [ne](t) { return Oi(this, t); } }; vi(Set.prototype, vl.prototype); var xl = class extends Map { get() { return L(this, super.get(...arguments)); } has() { return L(this, super.has(...arguments)); } keys() { return L(this, super.keys(...arguments)); } values() { return L(this, super.values(...arguments)); } entries() { return L(this, super.entries(...arguments)); } set() { return H(this, super.set(...arguments)); } clear() { return H(this, super.clear(...arguments)); } delete() { return H(this, super.delete(...arguments)); } }, Sl = Ci(xl), wl = class { get [se]() { return Mt(this, null, Sl); } [gt](t) { return Mt(this, t, Sl); } [ne](t) { return Oi(this, t); } }; vi(Map.prototype, wl.prototype); var El = class { constructor(t, e, r = {}) { var s = this, n; this.name = t, this.key = e, this.options = r; let o = Ti(t), l = s.descriptor = {enumerable: (n = r.enumerable) != null ? n : true, configurable: false, get: function() { return q ? dl(this, t, e, s, o) : this[e]; }, set: function(a) { return q || !!this[o] ? pl(this, t, e, a, s, o) : this[e] = a; }}, h = s.lazyDescriptor = {enumerable: false, configurable: true, get: function() { return this[e]; }, set: function(a) { return this[e] = a, this[o] = null, Object.defineProperty(this, t, l); }}; } }, Tl = class { constructor(t = null) { this[ll](t); } [ll](t = null) { var e; this[er] = t && (e = t[er]) !== void 0 ? e : new Map(); } for(t) { let e = this[er].get(t); return e || this[er].set(t, e = []), e; } get(t) { let e = this.for(t); return e[it] || e[se], q && L(e), e; } add(t, e) { return this.for(t).push(e); } delete(t, e) { let r = this.for(t), s = r.indexOf(e); r.splice(s, 1); } }, Nl = class { constructor(t, e) { var r = this; this.name = t, this.key = e, this.index = new Tl(); let s = Ti(t), n = r.descriptor = {enumerable: true, configurable: false, get: function() { return q ? dl(this, t, e, r, s) : this[e]; }, set: function(l) { let h = this[e]; if (q || !!this[s] ? pl(this, t, e, l, r, s) : this[e] = l, h != l && (h && r.index.delete(h, this), l)) return r.index.add(l, this); }}, o = r.lazyDescriptor = {set: function(l) { return this[e] = l, l && r.index.add(l, this), Object.defineProperty(this, t, n), this[s] = null; }}; } where(t) { return this.index.get(t); } }, ir = class { constructor(t, e, r) { this.observing = null, this.observers = null, this.flags = 68, this.target = t, this.func = e, this.vkey = r, this.version = 0; } get beacon() { return this; } addSubscriber(t) { this.observer ? (this.observers || (this.observers = []), this.observers.push(t)) : this.observer = t; } removeSubscriber(t) { if (this.observer == t) return this.observer = null; let e = this.observers, r = e.indexOf(this); r >= 0 && e.splice(r, 1); } invalidated(t, e) { if (this.flags |= T.STALE | T.POSSIBLY_STALE, this.observer && this.observer.invalidated(t, this), !!this.observers) { for (let r = 0, s = Q(this.observers), n = s.length; r < n; r++) s[r].invalidated(t, this); return this; } } value() { if (q && E.add(this), (this.flags & T.POSSIBLY_STALE) == 0) return this.target[this.vkey]; q++, this.flags |= T.RUNNING, E.push(this); let t = this.func.call(this.target); E.pop(this); let e = this.target[this.vkey]; return this.target[this.vkey] = t, this.flags &= ~(T.STALE | T.POSSIBLY_STALE | T.RUNNING), t !== e && this.version++, q--, t; } }, Ol = class { constructor(t, e) { this.name = t; let r = Ti(t), s = wi(t), n = this.descriptor = {enumerable: false, configurable: false, get: function() { return this[r].value(); }}, o = this.lazyDescriptor = {enumerable: false, get: function() { let l = this[r] = new ir(this, e, s); return Object.defineProperty(this, t, n), l.value(); }}; } }, le = class { get beacon() { return this; } constructor(t, e, r = {}) { this.cb = t, this.context = e, this.options = r, this.flags = 0, this.cachedComputedVersions = new WeakMap(), this.checkComputedValues = new Set(), this.observing = [], this.timeout = null; } get running\u03A6() { return this.flags & T.RUNNING; } invalidated(t, e) { return e instanceof ir ? (this.flags |= T.POSSIBLY_STALE, this.checkComputedValues.add(e)) : this.flags |= T.STALE, E.react(this); } activate() { return this.observing = [], this.cachedComputedVersions = new WeakMap(), this.checkComputedValues = new Set(), this.call(), this; } deactivate() { return this.dispose(); } call() { var t = this; if (q) { console.warn("should not call reaction inside an autorunning context?"); return; } if (this.flags & T.POSSIBLY_STALE && (this.flags & T.STALE) == 0) { let e = false; for (let r of Q(this.checkComputedValues)) { let s = this.cachedComputedVersions.get(r); r.value(); let n = r.version; if (s != n) { e = true; break; } } if (!e) { this.flags &= ~T.POSSIBLY_STALE, this.checkComputedValues.clear(); return; } } if (this.options.delay) { clearTimeout(this.timeout); let e = this.options.delay; typeof e != "number" && (e = 1e3), t.timeout = setTimeout(function() { return t.run(); }, e); return; } return t.run(); } run() { q++, this.flags |= T.RUNNING; let t = E.push(this), e = this.cb.call(this.context, Ka), r = E.pop(this); this.observing = r, this.checkComputedValues.clear(); for (let s = 0, n = Q(r), o = n.length; s < o; s++) { let l = n[s]; l instanceof ir && this.cachedComputedVersions.set(l, l.version); } return this.flags &= ~(T.RUNNING | T.STALE | T.POSSIBLY_STALE), q--, P(), e; } dispose() { this.timeout && clearTimeout(this.timeout); for (let t = 0, e = Q(this.observing), r = e.length; t < r; t++) e[t].removeSubscriber(this); return this.observing = this.context = this.cb = this.checkComputedValues = this.cachedComputedVersions = null, this; } }, $i = class { constructor(t, e) { this.context = e, this.cb = t; } run(t = this.context, e = []) { E.push(this); let r = this.cb.apply(t, e); return E.pop(this), r; } }; function Va(i, t = {}) { let e = new le(i, globalThis, t); return e.call(), e; } function Ha(i) { return i[se]; } function Ua(i) { return new $i(i, globalThis).run(); } function Ba(i, t, e) { let r = Ei(t); return (i[r] = new Ol(t, e.get)).lazyDescriptor; } function Ya(i, t, e) { let r = Ei(t), s = wi(t), n = this[0] || {}, o = i[r] = new El(t, s, n); return e ? (Object.defineProperty(i, s, Object.assign({}, e)), o.lazyDescriptor) : (Object.defineProperty(i, t, o.lazyDescriptor), null); } function Wa(i, t, e) { let r = Ei(t); return i.constructor[t], (i[r] = new Nl(t, wi(t))).lazyDescriptor; } function Ga(i, t, e) { let r = za(i), s = this[0] || {}; return s.flags = T.AUTORUN, qa(), r[t] = s, e; } function Xa(i, t, e) { if (e.value) { let r = new $i(e.value, null); e.value = function() { return r.run(this, arguments); }; } return e; }