2023-09-05 09:25:47 +02:00
|
|
|
//deka-dom-el library is available via global namespace `dde`
|
|
|
|
(()=> {
|
2023-09-13 13:20:00 +02:00
|
|
|
// src/signals-common.js
|
2023-09-19 12:34:42 +02:00
|
|
|
var b = {
|
2023-09-13 13:20:00 +02:00
|
|
|
isTextContent(e) {
|
|
|
|
return typeof e == "string";
|
|
|
|
},
|
2023-09-19 12:34:42 +02:00
|
|
|
processReactiveAttribute(e, t, n, r) {
|
|
|
|
return n;
|
2023-09-13 13:20:00 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
function _(e, t = !0) {
|
2023-09-19 12:34:42 +02:00
|
|
|
return t ? Object.assign(b, e) : (Object.setPrototypeOf(e, b), e);
|
2023-09-13 13:20:00 +02:00
|
|
|
}
|
|
|
|
function N(e) {
|
2023-09-19 12:34:42 +02:00
|
|
|
return b.isPrototypeOf(e) && e !== b ? e : b;
|
2023-09-13 13:20:00 +02:00
|
|
|
}
|
|
|
|
|
2023-09-05 09:25:47 +02:00
|
|
|
// src/helpers.js
|
2023-09-11 18:32:05 +02:00
|
|
|
function m(e) {
|
2023-09-13 13:20:00 +02:00
|
|
|
return typeof e > "u";
|
|
|
|
}
|
|
|
|
function w(e) {
|
2023-09-05 09:25:47 +02:00
|
|
|
let t = typeof e;
|
|
|
|
return t !== "object" ? t : e === null ? "null" : Object.prototype.toString.call(e);
|
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function D(e, t) {
|
2023-09-09 21:15:43 +02:00
|
|
|
if (!e || !(e instanceof AbortSignal))
|
|
|
|
return !0;
|
|
|
|
if (!e.aborted)
|
|
|
|
return e.addEventListener("abort", t), function() {
|
|
|
|
e.removeEventListener("abort", t);
|
|
|
|
};
|
|
|
|
}
|
2023-09-05 09:25:47 +02:00
|
|
|
|
2023-09-13 13:20:00 +02:00
|
|
|
// src/dom-common.js
|
2023-09-19 12:34:42 +02:00
|
|
|
var x = new Map(JSON.parse('[["#text,textContent",true],["HTMLElement,textContent",true],["HTMLElement,className",true]]')), j = { setDeleteAttr: k };
|
|
|
|
function k(e, t, n) {
|
|
|
|
Reflect.set(e, t, n), m(n) && e.getAttribute(t) === "undefined" && e.removeAttribute(t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// src/dom.js
|
2023-09-13 13:20:00 +02:00
|
|
|
var S = "html";
|
2023-09-19 12:34:42 +02:00
|
|
|
function ce(e) {
|
2023-09-13 13:20:00 +02:00
|
|
|
return S = e === "svg" ? "http://www.w3.org/2000/svg" : e, {
|
2023-09-19 09:30:21 +02:00
|
|
|
append(...t) {
|
|
|
|
return S = "html", t.length === 1 ? t[0] : document.createDocumentFragment().append(...t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function ie(e, t, ...n) {
|
|
|
|
let r = N(this), o;
|
|
|
|
switch (r.isTextContent(t) && (t = { textContent: t }), !0) {
|
2023-09-09 21:15:43 +02:00
|
|
|
case typeof e == "function": {
|
2023-09-19 12:34:42 +02:00
|
|
|
o = e(t || void 0, (i) => i ? (n.unshift(i), void 0) : o);
|
2023-09-05 09:25:47 +02:00
|
|
|
break;
|
2023-09-09 21:15:43 +02:00
|
|
|
}
|
2023-09-05 09:25:47 +02:00
|
|
|
case e === "#text":
|
2023-09-13 13:20:00 +02:00
|
|
|
o = y(document.createTextNode(""), t);
|
2023-09-08 20:18:58 +02:00
|
|
|
break;
|
|
|
|
case e === "<>":
|
2023-09-13 13:20:00 +02:00
|
|
|
o = y(document.createDocumentFragment(), t);
|
2023-09-05 09:25:47 +02:00
|
|
|
break;
|
2023-09-13 13:20:00 +02:00
|
|
|
case S !== "html":
|
|
|
|
o = y(document.createElementNS(S, e), t);
|
2023-09-05 09:25:47 +02:00
|
|
|
break;
|
2023-09-06 14:54:28 +02:00
|
|
|
case !o:
|
2023-09-13 13:20:00 +02:00
|
|
|
o = y(document.createElement(e), t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
return n.forEach((a) => a(o)), o;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
var { setDeleteAttr: q } = j;
|
2023-09-13 13:20:00 +02:00
|
|
|
function y(e, ...t) {
|
2023-09-19 12:34:42 +02:00
|
|
|
let n = N(this);
|
2023-09-05 09:25:47 +02:00
|
|
|
if (!t.length)
|
|
|
|
return e;
|
2023-09-19 12:34:42 +02:00
|
|
|
let r = e instanceof SVGElement, o = (r ? I : T).bind(null, e, "Attribute");
|
2023-09-11 18:32:05 +02:00
|
|
|
return Object.entries(Object.assign({}, ...t)).forEach(function a([i, s]) {
|
2023-09-19 12:34:42 +02:00
|
|
|
s = n.processReactiveAttribute(e, i, s, a);
|
2023-09-11 18:32:05 +02:00
|
|
|
let [h] = i;
|
2023-09-08 10:52:45 +02:00
|
|
|
if (h === "=")
|
2023-09-11 18:32:05 +02:00
|
|
|
return o(i.slice(1), s);
|
2023-09-08 10:52:45 +02:00
|
|
|
if (h === ".")
|
2023-09-19 12:34:42 +02:00
|
|
|
return M(e, i.slice(1), s);
|
2023-09-11 18:32:05 +02:00
|
|
|
if (typeof s == "object")
|
|
|
|
switch (i) {
|
2023-09-05 09:25:47 +02:00
|
|
|
case "style":
|
2023-09-19 12:34:42 +02:00
|
|
|
return O(s, T.bind(null, e.style, "Property"));
|
2023-09-05 09:25:47 +02:00
|
|
|
case "dataset":
|
2023-09-19 12:34:42 +02:00
|
|
|
return O(s, M.bind(null, e.dataset));
|
2023-09-05 09:25:47 +02:00
|
|
|
case "ariaset":
|
2023-09-13 13:20:00 +02:00
|
|
|
return O(s, (E, v) => o("aria-" + E, v));
|
2023-09-05 09:25:47 +02:00
|
|
|
case "classList":
|
2023-09-19 12:34:42 +02:00
|
|
|
return J(e, s);
|
2023-09-05 09:25:47 +02:00
|
|
|
default:
|
2023-09-11 18:32:05 +02:00
|
|
|
return Reflect.set(e, i, s);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-11 18:32:05 +02:00
|
|
|
if (/(aria|data)([A-Z])/.test(i))
|
|
|
|
return i = i.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), o(i, s);
|
|
|
|
switch (i) {
|
2023-09-08 15:57:51 +02:00
|
|
|
case "href":
|
2023-09-11 18:32:05 +02:00
|
|
|
return o(i, s);
|
2023-09-05 09:25:47 +02:00
|
|
|
case "xlink:href":
|
2023-09-11 18:32:05 +02:00
|
|
|
return o(i, s, "http://www.w3.org/1999/xlink");
|
2023-09-05 09:25:47 +02:00
|
|
|
case "textContent":
|
2023-09-19 12:34:42 +02:00
|
|
|
if (!r)
|
2023-09-05 09:25:47 +02:00
|
|
|
break;
|
2023-09-11 18:32:05 +02:00
|
|
|
return e.appendChild(document.createTextNode(s));
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
return W(e, i) ? q(e, i, s) : o(i, s);
|
2023-09-05 09:25:47 +02:00
|
|
|
}), e;
|
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function J(e, t) {
|
2023-09-13 13:20:00 +02:00
|
|
|
return typeof t != "object" || O(
|
2023-09-05 09:25:47 +02:00
|
|
|
t,
|
2023-09-19 12:34:42 +02:00
|
|
|
(n, r) => e.classList.toggle(n, r === -1 ? void 0 : !!r)
|
2023-09-05 09:25:47 +02:00
|
|
|
), e;
|
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function fe(e) {
|
2023-09-05 09:25:47 +02:00
|
|
|
return Array.from(e.children).forEach((t) => t.remove()), e;
|
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function W(e, t) {
|
|
|
|
let n = "HTMLElement," + t;
|
|
|
|
if (e instanceof HTMLElement && x.has(n))
|
|
|
|
return x.get(n);
|
|
|
|
let r = e.nodeName + "," + t;
|
|
|
|
if (x.has(r))
|
|
|
|
return x.get(r);
|
2023-09-13 13:20:00 +02:00
|
|
|
let [o, a, i] = H(e, t), s = !m(o.set);
|
2023-09-19 12:34:42 +02:00
|
|
|
return (!s || a) && x.set(i === HTMLElement.prototype ? n : r, s), s;
|
2023-09-06 14:54:28 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function H(e, t, n = 0) {
|
2023-09-06 14:54:28 +02:00
|
|
|
if (e = Object.getPrototypeOf(e), !e)
|
2023-09-19 12:34:42 +02:00
|
|
|
return [{}, n, e];
|
|
|
|
let r = Object.getOwnPropertyDescriptor(e, t);
|
|
|
|
return r ? [r, n, e] : H(e, t, n + 1);
|
2023-09-06 14:54:28 +02:00
|
|
|
}
|
2023-09-13 13:20:00 +02:00
|
|
|
function O(e, t) {
|
2023-09-19 12:34:42 +02:00
|
|
|
return Object.entries(e).forEach(([n, r]) => n && t(n, r));
|
|
|
|
}
|
|
|
|
function T(e, t, n, r) {
|
|
|
|
return e[(m(r) ? "remove" : "set") + t](n, r);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function I(e, t, n, r, o = null) {
|
|
|
|
return e[(m(r) ? "remove" : "set") + t + "NS"](o, n, r);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function M(e, t, n) {
|
|
|
|
if (Reflect.set(e, t, n), !!m(n))
|
|
|
|
return Reflect.deleteProperty(e, t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// src/events.js
|
2023-09-19 12:34:42 +02:00
|
|
|
function de(e, t, ...n) {
|
|
|
|
let r = n.length ? new CustomEvent(t, { detail: n[0] }) : new Event(t);
|
|
|
|
return e.dispatchEvent(r);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function F(e, t, n) {
|
2023-09-09 21:15:43 +02:00
|
|
|
return function(o) {
|
2023-09-19 12:34:42 +02:00
|
|
|
return o.addEventListener(e, t, n), o;
|
2023-09-09 21:15:43 +02:00
|
|
|
};
|
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
var C = Z();
|
|
|
|
F.connected = function(e, t) {
|
|
|
|
return function(r) {
|
|
|
|
return typeof r.connectedCallback == "function" ? (r.addEventListener("dde:connected", e, t), r) : (D(t && t.signal, () => C.offConnected(r, e)) && (r.isConnected ? e(new Event("dde:connected")) : C.onConnected(r, e)), r);
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
|
|
|
};
|
2023-09-19 12:34:42 +02:00
|
|
|
F.disconnected = function(e, t) {
|
|
|
|
return function(r) {
|
|
|
|
return typeof r.disconnectedCallback == "function" ? (r.addEventListener("dde:disconnected", e, t), r) : (D(t && t.signal, () => C.offDisconnected(r, e)) && C.onDisconnected(r, e), r);
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
|
|
|
};
|
2023-09-19 12:34:42 +02:00
|
|
|
function Z() {
|
|
|
|
let e = /* @__PURE__ */ new Map(), t = !1, n = new MutationObserver(function(c) {
|
2023-09-09 21:15:43 +02:00
|
|
|
for (let f of c)
|
|
|
|
if (f.type === "childList") {
|
|
|
|
if (E(f.addedNodes, !0)) {
|
2023-09-11 18:32:05 +02:00
|
|
|
i();
|
2023-09-05 09:25:47 +02:00
|
|
|
continue;
|
|
|
|
}
|
2023-09-11 18:32:05 +02:00
|
|
|
v(f.removedNodes, !0) && i();
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
return {
|
2023-09-09 21:15:43 +02:00
|
|
|
onConnected(c, f) {
|
|
|
|
a(), o(c).connected.push(f);
|
2023-09-05 09:25:47 +02:00
|
|
|
},
|
2023-09-09 21:15:43 +02:00
|
|
|
offConnected(c, f) {
|
2023-09-05 09:25:47 +02:00
|
|
|
if (!e.has(c))
|
|
|
|
return;
|
2023-09-11 18:32:05 +02:00
|
|
|
let u = e.get(c), p = u.connected;
|
2023-09-19 12:34:42 +02:00
|
|
|
p.splice(p.indexOf(f), 1), r(c, u);
|
2023-09-05 09:25:47 +02:00
|
|
|
},
|
2023-09-09 21:15:43 +02:00
|
|
|
onDisconnected(c, f) {
|
|
|
|
a(), o(c).disconnected.push(f);
|
2023-09-05 09:25:47 +02:00
|
|
|
},
|
2023-09-09 21:15:43 +02:00
|
|
|
offDisconnected(c, f) {
|
2023-09-05 09:25:47 +02:00
|
|
|
if (!e.has(c))
|
|
|
|
return;
|
2023-09-11 18:32:05 +02:00
|
|
|
let u = e.get(c), p = u.disconnected;
|
2023-09-19 12:34:42 +02:00
|
|
|
p.splice(p.indexOf(f), 1), r(c, u);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
};
|
2023-09-19 12:34:42 +02:00
|
|
|
function r(c, f) {
|
2023-09-11 18:32:05 +02:00
|
|
|
f.connected.length || f.disconnected.length || (e.delete(c), i());
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
function o(c) {
|
|
|
|
if (e.has(c))
|
|
|
|
return e.get(c);
|
2023-09-09 21:15:43 +02:00
|
|
|
let f = { connected: [], disconnected: [] };
|
|
|
|
return e.set(c, f), f;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-07 13:52:09 +02:00
|
|
|
function a() {
|
2023-09-19 12:34:42 +02:00
|
|
|
t || (t = !0, n.observe(document.body, { childList: !0, subtree: !0 }));
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-09 21:15:43 +02:00
|
|
|
function i() {
|
2023-09-19 12:34:42 +02:00
|
|
|
!t || e.size || (t = !1, n.disconnect());
|
2023-09-11 18:32:05 +02:00
|
|
|
}
|
|
|
|
function s() {
|
2023-09-05 09:25:47 +02:00
|
|
|
return new Promise(function(c) {
|
|
|
|
(requestIdleCallback || requestAnimationFrame)(c);
|
|
|
|
});
|
|
|
|
}
|
2023-09-08 10:52:45 +02:00
|
|
|
async function h(c) {
|
2023-09-11 18:32:05 +02:00
|
|
|
e.size > 30 && await s();
|
2023-09-09 21:15:43 +02:00
|
|
|
let f = [];
|
2023-09-05 09:25:47 +02:00
|
|
|
if (!(c instanceof Node))
|
2023-09-09 21:15:43 +02:00
|
|
|
return f;
|
2023-09-07 17:35:23 +02:00
|
|
|
for (let u of e.keys())
|
2023-09-09 21:15:43 +02:00
|
|
|
u === c || !(u instanceof Node) || c.contains(u) && f.push(u);
|
|
|
|
return f;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-09 21:15:43 +02:00
|
|
|
function E(c, f) {
|
2023-09-07 17:35:23 +02:00
|
|
|
for (let u of c) {
|
2023-09-09 21:15:43 +02:00
|
|
|
if (f && h(u).then(E), !e.has(u))
|
|
|
|
continue;
|
2023-09-11 18:32:05 +02:00
|
|
|
let p = e.get(u);
|
2023-09-19 12:34:42 +02:00
|
|
|
return p.connected.forEach((L) => L(u)), p.connected.length = 0, p.disconnected.length || e.delete(u), !0;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-09 21:15:43 +02:00
|
|
|
return !1;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-09 21:15:43 +02:00
|
|
|
function v(c, f) {
|
2023-09-07 17:35:23 +02:00
|
|
|
for (let u of c) {
|
2023-09-09 21:15:43 +02:00
|
|
|
if (f && h(u).then(v), !e.has(u))
|
|
|
|
continue;
|
2023-09-11 18:32:05 +02:00
|
|
|
let p = e.get(u);
|
2023-09-19 12:34:42 +02:00
|
|
|
return p.disconnected.forEach((L) => L(u)), p.connected.length = 0, p.disconnected.length = 0, e.delete(u), !0;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-09 21:15:43 +02:00
|
|
|
return !1;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// index.js
|
|
|
|
[HTMLElement, DocumentFragment].forEach((e) => {
|
|
|
|
let { append: t } = e.prototype;
|
2023-09-19 12:34:42 +02:00
|
|
|
e.prototype.append = function(...n) {
|
|
|
|
return t.apply(this, n), this;
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
// src/signals-lib.js
|
2023-09-08 10:52:45 +02:00
|
|
|
var d = Symbol.for("Signal");
|
2023-09-19 12:34:42 +02:00
|
|
|
function R(e) {
|
2023-09-05 09:25:47 +02:00
|
|
|
try {
|
2023-09-08 10:52:45 +02:00
|
|
|
return Reflect.has(e, d);
|
2023-09-05 09:25:47 +02:00
|
|
|
} catch {
|
|
|
|
return !1;
|
|
|
|
}
|
|
|
|
}
|
2023-09-11 18:32:05 +02:00
|
|
|
var l = /* @__PURE__ */ new WeakMap();
|
|
|
|
function g(e, t) {
|
2023-09-05 09:25:47 +02:00
|
|
|
if (typeof e != "function")
|
2023-09-19 12:34:42 +02:00
|
|
|
return z(e, t);
|
|
|
|
if (R(e))
|
2023-09-05 09:25:47 +02:00
|
|
|
return e;
|
2023-09-19 12:34:42 +02:00
|
|
|
let n = z(""), r = () => n(e());
|
|
|
|
return l.set(r, /* @__PURE__ */ new Set([n])), V(r), n;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
g.action = function(e, t, ...n) {
|
|
|
|
let r = e[d], { actions: o } = r;
|
2023-09-05 09:25:47 +02:00
|
|
|
if (!o || !Reflect.has(o, t))
|
|
|
|
throw new Error(`'${e}' has no action with name '${t}'!`);
|
2023-09-19 12:34:42 +02:00
|
|
|
if (o[t].apply(r, n), r.skip)
|
|
|
|
return Reflect.deleteProperty(r, "skip");
|
|
|
|
r.listeners.forEach((a) => a(r.value));
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
2023-09-19 12:34:42 +02:00
|
|
|
g.on = function e(t, n, r = {}) {
|
|
|
|
let { signal: o } = r;
|
2023-09-07 17:35:23 +02:00
|
|
|
if (!(o && o.aborted)) {
|
|
|
|
if (Array.isArray(t))
|
2023-09-19 12:34:42 +02:00
|
|
|
return t.forEach((a) => e(a, n, r));
|
|
|
|
P(t, n), o && o.addEventListener("abort", () => $(t, n));
|
2023-09-07 17:35:23 +02:00
|
|
|
}
|
|
|
|
};
|
2023-09-11 18:32:05 +02:00
|
|
|
g.symbols = {
|
2023-09-08 10:52:45 +02:00
|
|
|
signal: d,
|
2023-09-07 17:35:23 +02:00
|
|
|
onclear: Symbol.for("Signal.onclear")
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
2023-09-11 18:32:05 +02:00
|
|
|
g.clear = function(...e) {
|
2023-09-19 12:34:42 +02:00
|
|
|
for (let n of e) {
|
|
|
|
Reflect.deleteProperty(n, "toJSON");
|
|
|
|
let r = n[d], { onclear: o } = g.symbols;
|
|
|
|
r.actions && r.actions[o] && r.actions[o].call(r), t(n, r), Reflect.deleteProperty(n, d);
|
2023-09-08 10:52:45 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function t(n, r) {
|
|
|
|
r.listeners.forEach((o) => {
|
|
|
|
if (r.listeners.delete(o), !l.has(o))
|
2023-09-08 10:52:45 +02:00
|
|
|
return;
|
2023-09-11 18:32:05 +02:00
|
|
|
let a = l.get(o);
|
2023-09-19 12:34:42 +02:00
|
|
|
a.delete(n), !(a.size > 1) && (g.clear(...a), l.delete(o));
|
2023-09-08 10:52:45 +02:00
|
|
|
});
|
2023-09-07 17:35:23 +02:00
|
|
|
}
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
2023-09-11 18:32:05 +02:00
|
|
|
g.el = function(e, t) {
|
2023-09-19 12:34:42 +02:00
|
|
|
let n = document.createComment("<#reactive>"), r = document.createComment("</#reactive>"), o = document.createDocumentFragment();
|
|
|
|
o.append(n, r);
|
2023-09-11 18:32:05 +02:00
|
|
|
let a = (i) => {
|
2023-09-19 12:34:42 +02:00
|
|
|
if (!n.parentNode || !r.parentNode)
|
|
|
|
return $(e, a);
|
2023-09-11 18:32:05 +02:00
|
|
|
let s = t(i);
|
|
|
|
Array.isArray(s) || (s = [s]);
|
2023-09-19 12:34:42 +02:00
|
|
|
let h = n;
|
|
|
|
for (; (h = n.nextSibling) !== r; )
|
2023-09-08 20:18:58 +02:00
|
|
|
h.remove();
|
2023-09-19 12:34:42 +02:00
|
|
|
n.after(...s);
|
2023-09-08 20:18:58 +02:00
|
|
|
};
|
2023-09-13 13:20:00 +02:00
|
|
|
return P(e, a), a(e()), o;
|
2023-09-08 20:18:58 +02:00
|
|
|
};
|
2023-09-19 12:34:42 +02:00
|
|
|
var U = {
|
2023-09-05 09:25:47 +02:00
|
|
|
isTextContent(e) {
|
2023-09-19 12:34:42 +02:00
|
|
|
return w(e) === "string" || R(e) && w(Y(e)) === "string";
|
2023-09-05 09:25:47 +02:00
|
|
|
},
|
2023-09-19 12:34:42 +02:00
|
|
|
processReactiveAttribute(e, t, n, r) {
|
|
|
|
return R(n) ? (P(n, (o) => r([t, o])), n()) : n;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
};
|
2023-09-19 12:34:42 +02:00
|
|
|
function z(e, t) {
|
|
|
|
let n = (...r) => r.length ? X(n, r[0]) : Q(n);
|
|
|
|
return G(n, e, t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
var B = Object.assign(/* @__PURE__ */ Object.create(null), {
|
2023-09-05 09:25:47 +02:00
|
|
|
stopPropagation() {
|
|
|
|
this.skip = !0;
|
|
|
|
}
|
|
|
|
});
|
2023-09-19 12:34:42 +02:00
|
|
|
function G(e, t, n) {
|
|
|
|
return w(n) !== "[object Object]" && (n = {}), e[d] = {
|
2023-09-05 09:25:47 +02:00
|
|
|
value: t,
|
2023-09-19 12:34:42 +02:00
|
|
|
actions: n,
|
2023-09-05 09:25:47 +02:00
|
|
|
listeners: /* @__PURE__ */ new Set()
|
2023-09-19 12:34:42 +02:00
|
|
|
}, e.toJSON = () => e(), Object.setPrototypeOf(e[d], B), e;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
var A = [];
|
|
|
|
function V(e) {
|
2023-09-05 09:25:47 +02:00
|
|
|
let t = function() {
|
2023-09-19 12:34:42 +02:00
|
|
|
A.push(t), e(), A.pop();
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
2023-09-11 18:32:05 +02:00
|
|
|
l.has(e) && (l.set(t, l.get(e)), l.delete(e)), t();
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function K() {
|
|
|
|
return A[A.length - 1];
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function Q(e) {
|
2023-09-08 10:52:45 +02:00
|
|
|
if (!e[d])
|
2023-09-05 09:25:47 +02:00
|
|
|
return;
|
2023-09-19 12:34:42 +02:00
|
|
|
let { value: t, listeners: n } = e[d], r = K();
|
|
|
|
return r && n.add(r), l.has(r) && l.get(r).add(e), t;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function X(e, t) {
|
2023-09-08 10:52:45 +02:00
|
|
|
if (!e[d])
|
2023-09-05 09:25:47 +02:00
|
|
|
return;
|
2023-09-19 12:34:42 +02:00
|
|
|
let n = e[d];
|
|
|
|
if (n.value !== t)
|
|
|
|
return n.value = t, n.listeners.forEach((r) => r(t)), t;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function Y(e) {
|
2023-09-08 10:52:45 +02:00
|
|
|
return e[d].value;
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-13 13:20:00 +02:00
|
|
|
function P(e, t) {
|
2023-09-09 21:15:43 +02:00
|
|
|
if (e[d])
|
|
|
|
return e[d].listeners.add(t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
2023-09-19 12:34:42 +02:00
|
|
|
function $(e, t) {
|
2023-09-09 21:15:43 +02:00
|
|
|
if (e[d])
|
|
|
|
return e[d].listeners.delete(t);
|
2023-09-05 09:25:47 +02:00
|
|
|
}
|
|
|
|
|
2023-09-19 09:30:21 +02:00
|
|
|
// signals.js
|
2023-09-19 12:34:42 +02:00
|
|
|
_(U);
|
2023-09-05 09:25:47 +02:00
|
|
|
|
|
|
|
globalThis.dde= {
|
2023-09-11 18:32:05 +02:00
|
|
|
S: g,
|
2023-09-13 13:20:00 +02:00
|
|
|
assign: y,
|
2023-09-19 12:34:42 +02:00
|
|
|
classListDeclarative: J,
|
|
|
|
createElement: ie,
|
|
|
|
dispatchEvent: de,
|
|
|
|
el: ie,
|
|
|
|
empty: fe,
|
|
|
|
isSignal: R,
|
|
|
|
namespace: ce,
|
|
|
|
on: F,
|
2023-09-13 13:20:00 +02:00
|
|
|
registerReactivity: _
|
2023-09-05 09:25:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
})();
|