@arabold/docs-mcp-server 2.0.4 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -2
- package/db/migrations/012-add-source-content-type.sql +11 -0
- package/dist/assets/main.css +1 -1
- package/dist/assets/main.js +673 -630
- package/dist/assets/main.js.map +1 -1
- package/dist/index.js +7 -18952
- package/dist/index.js.map +1 -1
- package/dist/logger-CLtABTNb.js +99 -0
- package/dist/logger-CLtABTNb.js.map +1 -0
- package/dist/main-ntnRQ8Za.js +18182 -0
- package/dist/main-ntnRQ8Za.js.map +1 -0
- package/dist/utils-CZz1DsHw.js +1063 -0
- package/dist/utils-CZz1DsHw.js.map +1 -0
- package/package.json +48 -45
- package/public/assets/main.css +1 -1
- package/public/assets/main.js +673 -630
- package/public/assets/main.js.map +1 -1
package/public/assets/main.js
CHANGED
|
@@ -23,13 +23,13 @@ function src_default$1(e) {
|
|
|
23
23
|
s && (n.hidden = !1), s && (n.style.display = null);
|
|
24
24
|
let d = n.getBoundingClientRect().height;
|
|
25
25
|
n.style.height = "auto";
|
|
26
|
-
let
|
|
27
|
-
d ===
|
|
26
|
+
let p = n.getBoundingClientRect().height;
|
|
27
|
+
d === p && (d = a), e.transition(n, e.setStyles, {
|
|
28
28
|
during: l,
|
|
29
29
|
start: { height: d + "px" },
|
|
30
|
-
end: { height:
|
|
30
|
+
end: { height: p + "px" }
|
|
31
31
|
}, () => n._x_isShown = !0, () => {
|
|
32
|
-
Math.abs(n.getBoundingClientRect().height -
|
|
32
|
+
Math.abs(n.getBoundingClientRect().height - p) < 1 && (n.style.overflow = null);
|
|
33
33
|
});
|
|
34
34
|
},
|
|
35
35
|
out(c = () => {
|
|
@@ -65,10 +65,16 @@ function modifierValue$1(e, t, n) {
|
|
|
65
65
|
}
|
|
66
66
|
return i;
|
|
67
67
|
}
|
|
68
|
-
var module_default$1 = src_default$1, flushPending = !1, flushing = !1, queue = [], lastFlushedIndex = -1;
|
|
68
|
+
var module_default$1 = src_default$1, flushPending = !1, flushing = !1, queue = [], lastFlushedIndex = -1, transactionActive = !1;
|
|
69
69
|
function scheduler(e) {
|
|
70
70
|
queueJob(e);
|
|
71
71
|
}
|
|
72
|
+
function startTransaction() {
|
|
73
|
+
transactionActive = !0;
|
|
74
|
+
}
|
|
75
|
+
function commitTransaction() {
|
|
76
|
+
transactionActive = !1, queueFlush();
|
|
77
|
+
}
|
|
72
78
|
function queueJob(e) {
|
|
73
79
|
queue.includes(e) || queue.push(e), queueFlush();
|
|
74
80
|
}
|
|
@@ -77,7 +83,11 @@ function dequeueJob(e) {
|
|
|
77
83
|
t !== -1 && t > lastFlushedIndex && queue.splice(t, 1);
|
|
78
84
|
}
|
|
79
85
|
function queueFlush() {
|
|
80
|
-
!flushing && !flushPending
|
|
86
|
+
if (!flushing && !flushPending) {
|
|
87
|
+
if (transactionActive)
|
|
88
|
+
return;
|
|
89
|
+
flushPending = !0, queueMicrotask(flushJobs);
|
|
90
|
+
}
|
|
81
91
|
}
|
|
82
92
|
function flushJobs() {
|
|
83
93
|
flushPending = !1, flushing = !0;
|
|
@@ -114,12 +124,24 @@ function elementBoundEffect(e) {
|
|
|
114
124
|
function watch(e, t) {
|
|
115
125
|
let n = !0, i, r = effect$3(() => {
|
|
116
126
|
let a = e();
|
|
117
|
-
JSON.stringify(a), n
|
|
118
|
-
|
|
119
|
-
|
|
127
|
+
if (JSON.stringify(a), !n && (typeof a == "object" || a !== i)) {
|
|
128
|
+
let s = i;
|
|
129
|
+
queueMicrotask(() => {
|
|
130
|
+
t(a, s);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
i = a, n = !1;
|
|
120
134
|
});
|
|
121
135
|
return () => release(r);
|
|
122
136
|
}
|
|
137
|
+
async function transaction(e) {
|
|
138
|
+
startTransaction();
|
|
139
|
+
try {
|
|
140
|
+
await e(), await Promise.resolve();
|
|
141
|
+
} finally {
|
|
142
|
+
commitTransaction();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
123
145
|
var onAttributeAddeds = [], onElRemoveds = [], onElAddeds = [];
|
|
124
146
|
function onElAdded(e) {
|
|
125
147
|
onElAddeds.push(e);
|
|
@@ -532,6 +554,7 @@ function outNonAlpineAttributes({ name: e }) {
|
|
|
532
554
|
var alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\b`);
|
|
533
555
|
function toParsedDirectives(e, t) {
|
|
534
556
|
return ({ name: n, value: i }) => {
|
|
557
|
+
n === i && (i = "");
|
|
535
558
|
let r = n.match(alpineAttributeRegex()), a = n.match(/:([a-zA-Z0-9\-_:]+)/), s = n.match(/\.[^.\]]+(?=[^\]]*$)/g) || [], o = t || e[n] || n;
|
|
536
559
|
return {
|
|
537
560
|
type: r ? r[1] : null,
|
|
@@ -759,14 +782,14 @@ function registerTransitionsFromClassString(e, t, n) {
|
|
|
759
782
|
function registerTransitionsFromHelper(e, t, n) {
|
|
760
783
|
registerTransitionObject(e, setStyles);
|
|
761
784
|
let i = !t.includes("in") && !t.includes("out") && !n, r = i || t.includes("in") || ["enter"].includes(n), a = i || t.includes("out") || ["leave"].includes(n);
|
|
762
|
-
t.includes("in") && !i && (t = t.filter((
|
|
763
|
-
let s = !t.includes("opacity") && !t.includes("scale"), o = s || t.includes("opacity"), l = s || t.includes("scale"), c = o ? 0 : 1, u = l ? modifierValue(t, "scale", 95) / 100 : 1, d = modifierValue(t, "delay", 0) / 1e3,
|
|
785
|
+
t.includes("in") && !i && (t = t.filter((b, m) => m < t.indexOf("out"))), t.includes("out") && !i && (t = t.filter((b, m) => m > t.indexOf("out")));
|
|
786
|
+
let s = !t.includes("opacity") && !t.includes("scale"), o = s || t.includes("opacity"), l = s || t.includes("scale"), c = o ? 0 : 1, u = l ? modifierValue(t, "scale", 95) / 100 : 1, d = modifierValue(t, "delay", 0) / 1e3, p = modifierValue(t, "origin", "center"), x = "opacity, transform", v = modifierValue(t, "duration", 150) / 1e3, y = modifierValue(t, "duration", 75) / 1e3, h = "cubic-bezier(0.4, 0.0, 0.2, 1)";
|
|
764
787
|
r && (e._x_transition.enter.during = {
|
|
765
|
-
transformOrigin:
|
|
788
|
+
transformOrigin: p,
|
|
766
789
|
transitionDelay: `${d}s`,
|
|
767
|
-
transitionProperty:
|
|
790
|
+
transitionProperty: x,
|
|
768
791
|
transitionDuration: `${v}s`,
|
|
769
|
-
transitionTimingFunction:
|
|
792
|
+
transitionTimingFunction: h
|
|
770
793
|
}, e._x_transition.enter.start = {
|
|
771
794
|
opacity: c,
|
|
772
795
|
transform: `scale(${u})`
|
|
@@ -774,11 +797,11 @@ function registerTransitionsFromHelper(e, t, n) {
|
|
|
774
797
|
opacity: 1,
|
|
775
798
|
transform: "scale(1)"
|
|
776
799
|
}), a && (e._x_transition.leave.during = {
|
|
777
|
-
transformOrigin:
|
|
800
|
+
transformOrigin: p,
|
|
778
801
|
transitionDelay: `${d}s`,
|
|
779
|
-
transitionProperty:
|
|
780
|
-
transitionDuration: `${
|
|
781
|
-
transitionTimingFunction:
|
|
802
|
+
transitionProperty: x,
|
|
803
|
+
transitionDuration: `${y}s`,
|
|
804
|
+
transitionTimingFunction: h
|
|
782
805
|
}, e._x_transition.leave.start = {
|
|
783
806
|
opacity: 1,
|
|
784
807
|
transform: "scale(1)"
|
|
@@ -1183,7 +1206,10 @@ var Alpine = {
|
|
|
1183
1206
|
get raw() {
|
|
1184
1207
|
return raw;
|
|
1185
1208
|
},
|
|
1186
|
-
|
|
1209
|
+
get transaction() {
|
|
1210
|
+
return transaction;
|
|
1211
|
+
},
|
|
1212
|
+
version: "3.15.8",
|
|
1187
1213
|
flushAndStopDeferringMutations,
|
|
1188
1214
|
dontAutoEvaluateFunctions,
|
|
1189
1215
|
disableEffectScheduling,
|
|
@@ -1479,10 +1505,10 @@ function createIterableMethod(e, t, n) {
|
|
|
1479
1505
|
return !t && track(a, "iterate", l ? MAP_KEY_ITERATE_KEY : ITERATE_KEY), {
|
|
1480
1506
|
// iterator protocol
|
|
1481
1507
|
next() {
|
|
1482
|
-
const { value: d, done:
|
|
1483
|
-
return
|
|
1508
|
+
const { value: d, done: p } = c.next();
|
|
1509
|
+
return p ? { value: d, done: p } : {
|
|
1484
1510
|
value: o ? [u(d[0]), u(d[1])] : u(d),
|
|
1485
|
-
done:
|
|
1511
|
+
done: p
|
|
1486
1512
|
};
|
|
1487
1513
|
},
|
|
1488
1514
|
// iterable protocol
|
|
@@ -1719,25 +1745,25 @@ directive("modelable", (e, { expression: t }, { effect: n, evaluateLater: i, cle
|
|
|
1719
1745
|
if (!e._x_model)
|
|
1720
1746
|
return;
|
|
1721
1747
|
e._x_removeModelListeners.default();
|
|
1722
|
-
let u = e._x_model.get, d = e._x_model.set,
|
|
1748
|
+
let u = e._x_model.get, d = e._x_model.set, p = entangle(
|
|
1723
1749
|
{
|
|
1724
1750
|
get() {
|
|
1725
1751
|
return u();
|
|
1726
1752
|
},
|
|
1727
|
-
set(
|
|
1728
|
-
d(
|
|
1753
|
+
set(x) {
|
|
1754
|
+
d(x);
|
|
1729
1755
|
}
|
|
1730
1756
|
},
|
|
1731
1757
|
{
|
|
1732
1758
|
get() {
|
|
1733
1759
|
return s();
|
|
1734
1760
|
},
|
|
1735
|
-
set(
|
|
1736
|
-
l(
|
|
1761
|
+
set(x) {
|
|
1762
|
+
l(x);
|
|
1737
1763
|
}
|
|
1738
1764
|
}
|
|
1739
1765
|
);
|
|
1740
|
-
r(
|
|
1766
|
+
r(p);
|
|
1741
1767
|
});
|
|
1742
1768
|
});
|
|
1743
1769
|
directive("teleport", (e, { modifiers: t, expression: n }, { cleanup: i }) => {
|
|
@@ -1802,6 +1828,8 @@ function on(e, t, n, i) {
|
|
|
1802
1828
|
e.contains(c.target) || c.target.isConnected !== !1 && (e.offsetWidth < 1 && e.offsetHeight < 1 || e._x_isShown !== !1 && l(c));
|
|
1803
1829
|
})), n.includes("self") && (a = o(a, (l, c) => {
|
|
1804
1830
|
c.target === e && l(c);
|
|
1831
|
+
})), t === "submit" && (a = o(a, (l, c) => {
|
|
1832
|
+
c.target._x_pendingModelUpdates && c.target._x_pendingModelUpdates.forEach((u) => u()), l(c);
|
|
1805
1833
|
})), (isKeyEvent(t) || isClickEvent(t)) && (a = o(a, (l, c) => {
|
|
1806
1834
|
isListeningForASpecificKeyThatHasntBeenPressed(c, n) || l(c);
|
|
1807
1835
|
})), r.addEventListener(t, a, s), () => {
|
|
@@ -1829,7 +1857,7 @@ function isClickEvent(e) {
|
|
|
1829
1857
|
return ["contextmenu", "click", "mouse"].some((t) => e.includes(t));
|
|
1830
1858
|
}
|
|
1831
1859
|
function isListeningForASpecificKeyThatHasntBeenPressed(e, t) {
|
|
1832
|
-
let n = t.filter((a) => !["window", "document", "prevent", "stop", "once", "capture", "self", "away", "outside", "passive", "preserve-scroll"].includes(a));
|
|
1860
|
+
let n = t.filter((a) => !["window", "document", "prevent", "stop", "once", "capture", "self", "away", "outside", "passive", "preserve-scroll", "blur", "change", "lazy"].includes(a));
|
|
1833
1861
|
if (n.includes("debounce")) {
|
|
1834
1862
|
let a = n.indexOf("debounce");
|
|
1835
1863
|
n.splice(a, isNumeric((n[a + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1);
|
|
@@ -1876,42 +1904,57 @@ directive("model", (e, { modifiers: t, expression: n }, { effect: i, cleanup: r
|
|
|
1876
1904
|
typeof n == "string" ? o = evaluateLater(a, `${n} = __placeholder`) : typeof n == "function" && typeof n() == "string" ? o = evaluateLater(a, `${n()} = __placeholder`) : o = () => {
|
|
1877
1905
|
};
|
|
1878
1906
|
let l = () => {
|
|
1907
|
+
let y;
|
|
1908
|
+
return s((h) => y = h), isGetterSetter(y) ? y.get() : y;
|
|
1909
|
+
}, c = (y) => {
|
|
1879
1910
|
let h;
|
|
1880
|
-
|
|
1881
|
-
}, c = (h) => {
|
|
1882
|
-
let b;
|
|
1883
|
-
s((v) => b = v), isGetterSetter(b) ? b.set(h) : o(() => {
|
|
1911
|
+
s((b) => h = b), isGetterSetter(h) ? h.set(y) : o(() => {
|
|
1884
1912
|
}, {
|
|
1885
|
-
scope: { __placeholder:
|
|
1913
|
+
scope: { __placeholder: y }
|
|
1886
1914
|
});
|
|
1887
1915
|
};
|
|
1888
1916
|
typeof n == "string" && e.type === "radio" && mutateDom(() => {
|
|
1889
1917
|
e.hasAttribute("name") || e.setAttribute("name", n);
|
|
1890
1918
|
});
|
|
1891
|
-
let u =
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1919
|
+
let u = t.includes("change") || t.includes("lazy"), d = t.includes("blur"), p = t.includes("enter"), x = u || d || p, v;
|
|
1920
|
+
if (isCloning)
|
|
1921
|
+
v = () => {
|
|
1922
|
+
};
|
|
1923
|
+
else if (x) {
|
|
1924
|
+
let y = [], h = (b) => c(getInputValue(e, t, b, l()));
|
|
1925
|
+
if (u && y.push(on(e, "change", t, h)), d && (y.push(on(e, "blur", t, h)), e.form)) {
|
|
1926
|
+
let b = () => h({ target: e });
|
|
1927
|
+
e.form._x_pendingModelUpdates || (e.form._x_pendingModelUpdates = []), e.form._x_pendingModelUpdates.push(b), r(() => e.form._x_pendingModelUpdates.splice(e.form._x_pendingModelUpdates.indexOf(b), 1));
|
|
1928
|
+
}
|
|
1929
|
+
p && y.push(on(e, "keydown", t, (b) => {
|
|
1930
|
+
b.key === "Enter" && h(b);
|
|
1931
|
+
})), v = () => y.forEach((b) => b());
|
|
1932
|
+
} else {
|
|
1933
|
+
let y = e.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(e.type) ? "change" : "input";
|
|
1934
|
+
v = on(e, y, t, (h) => {
|
|
1935
|
+
c(getInputValue(e, t, h, l()));
|
|
1936
|
+
});
|
|
1937
|
+
}
|
|
1895
1938
|
if (t.includes("fill") && ([void 0, null, ""].includes(l()) || isCheckbox(e) && Array.isArray(l()) || e.tagName.toLowerCase() === "select" && e.multiple) && c(
|
|
1896
1939
|
getInputValue(e, t, { target: e }, l())
|
|
1897
|
-
), e._x_removeModelListeners || (e._x_removeModelListeners = {}), e._x_removeModelListeners.default =
|
|
1898
|
-
let
|
|
1940
|
+
), e._x_removeModelListeners || (e._x_removeModelListeners = {}), e._x_removeModelListeners.default = v, r(() => e._x_removeModelListeners.default()), e.form) {
|
|
1941
|
+
let y = on(e.form, "reset", [], (h) => {
|
|
1899
1942
|
nextTick(() => e._x_model && e._x_model.set(getInputValue(e, t, { target: e }, l())));
|
|
1900
1943
|
});
|
|
1901
|
-
r(() =>
|
|
1944
|
+
r(() => y());
|
|
1902
1945
|
}
|
|
1903
1946
|
e._x_model = {
|
|
1904
1947
|
get() {
|
|
1905
1948
|
return l();
|
|
1906
1949
|
},
|
|
1907
|
-
set(
|
|
1908
|
-
c(
|
|
1950
|
+
set(y) {
|
|
1951
|
+
c(y);
|
|
1909
1952
|
}
|
|
1910
|
-
}, e._x_forceModelUpdate = (
|
|
1911
|
-
|
|
1953
|
+
}, e._x_forceModelUpdate = (y) => {
|
|
1954
|
+
y === void 0 && typeof n == "string" && n.match(/\./) && (y = ""), window.fromModel = !0, mutateDom(() => bind(e, "value", y)), delete window.fromModel;
|
|
1912
1955
|
}, i(() => {
|
|
1913
|
-
let
|
|
1914
|
-
t.includes("unintrusive") && document.activeElement.isSameNode(e) || e._x_forceModelUpdate(
|
|
1956
|
+
let y = l();
|
|
1957
|
+
t.includes("unintrusive") && document.activeElement.isSameNode(e) || e._x_forceModelUpdate(y);
|
|
1915
1958
|
});
|
|
1916
1959
|
});
|
|
1917
1960
|
function getInputValue(e, t, n, i) {
|
|
@@ -2069,66 +2112,66 @@ directive("for", (e, { expression: t }, { effect: n, cleanup: i }) => {
|
|
|
2069
2112
|
function loop(e, t, n, i) {
|
|
2070
2113
|
let r = (s) => typeof s == "object" && !Array.isArray(s), a = e;
|
|
2071
2114
|
n((s) => {
|
|
2072
|
-
isNumeric3(s) && s >= 0 && (s = Array.from(Array(s).keys(), (
|
|
2115
|
+
isNumeric3(s) && s >= 0 && (s = Array.from(Array(s).keys(), (h) => h + 1)), s === void 0 && (s = []);
|
|
2073
2116
|
let o = e._x_lookup, l = e._x_prevKeys, c = [], u = [];
|
|
2074
2117
|
if (r(s))
|
|
2075
|
-
s = Object.entries(s).map(([
|
|
2076
|
-
let
|
|
2077
|
-
i((
|
|
2078
|
-
u.includes(
|
|
2079
|
-
}, { scope: { index:
|
|
2118
|
+
s = Object.entries(s).map(([h, b]) => {
|
|
2119
|
+
let m = getIterationScopeVariables(t, b, h, s);
|
|
2120
|
+
i((_) => {
|
|
2121
|
+
u.includes(_) && warn("Duplicate key on x-for", e), u.push(_);
|
|
2122
|
+
}, { scope: { index: h, ...m } }), c.push(m);
|
|
2080
2123
|
});
|
|
2081
2124
|
else
|
|
2082
|
-
for (let
|
|
2083
|
-
let
|
|
2084
|
-
i((
|
|
2085
|
-
u.includes(
|
|
2086
|
-
}, { scope: { index:
|
|
2125
|
+
for (let h = 0; h < s.length; h++) {
|
|
2126
|
+
let b = getIterationScopeVariables(t, s[h], h, s);
|
|
2127
|
+
i((m) => {
|
|
2128
|
+
u.includes(m) && warn("Duplicate key on x-for", e), u.push(m);
|
|
2129
|
+
}, { scope: { index: h, ...b } }), c.push(b);
|
|
2087
2130
|
}
|
|
2088
|
-
let d = [],
|
|
2089
|
-
for (let
|
|
2090
|
-
let
|
|
2091
|
-
u.indexOf(
|
|
2092
|
-
}
|
|
2093
|
-
l = l.filter((
|
|
2094
|
-
let
|
|
2095
|
-
for (let
|
|
2096
|
-
let
|
|
2097
|
-
if (
|
|
2098
|
-
l.splice(
|
|
2099
|
-
else if (
|
|
2100
|
-
let
|
|
2101
|
-
l.splice(
|
|
2131
|
+
let d = [], p = [], x = [], v = [];
|
|
2132
|
+
for (let h = 0; h < l.length; h++) {
|
|
2133
|
+
let b = l[h];
|
|
2134
|
+
u.indexOf(b) === -1 && x.push(b);
|
|
2135
|
+
}
|
|
2136
|
+
l = l.filter((h) => !x.includes(h));
|
|
2137
|
+
let y = "template";
|
|
2138
|
+
for (let h = 0; h < u.length; h++) {
|
|
2139
|
+
let b = u[h], m = l.indexOf(b);
|
|
2140
|
+
if (m === -1)
|
|
2141
|
+
l.splice(h, 0, b), d.push([y, h]);
|
|
2142
|
+
else if (m !== h) {
|
|
2143
|
+
let _ = l.splice(h, 1)[0], f = l.splice(m - 1, 1)[0];
|
|
2144
|
+
l.splice(h, 0, f), l.splice(m, 0, _), p.push([_, f]);
|
|
2102
2145
|
} else
|
|
2103
|
-
v.push(
|
|
2104
|
-
|
|
2146
|
+
v.push(b);
|
|
2147
|
+
y = b;
|
|
2105
2148
|
}
|
|
2106
|
-
for (let
|
|
2107
|
-
let
|
|
2108
|
-
|
|
2109
|
-
destroyTree(o[
|
|
2110
|
-
}), delete o[
|
|
2149
|
+
for (let h = 0; h < x.length; h++) {
|
|
2150
|
+
let b = x[h];
|
|
2151
|
+
b in o && (mutateDom(() => {
|
|
2152
|
+
destroyTree(o[b]), o[b].remove();
|
|
2153
|
+
}), delete o[b]);
|
|
2111
2154
|
}
|
|
2112
|
-
for (let
|
|
2113
|
-
let [
|
|
2155
|
+
for (let h = 0; h < p.length; h++) {
|
|
2156
|
+
let [b, m] = p[h], _ = o[b], f = o[m], g = document.createElement("div");
|
|
2114
2157
|
mutateDom(() => {
|
|
2115
|
-
f || warn('x-for ":key" is undefined or invalid', a,
|
|
2116
|
-
}), f._x_refreshXForScope(c[u.indexOf(
|
|
2117
|
-
}
|
|
2118
|
-
for (let
|
|
2119
|
-
let [
|
|
2120
|
-
|
|
2121
|
-
let f = c[
|
|
2122
|
-
addScopeToNode(
|
|
2123
|
-
Object.entries(D).forEach(([A,
|
|
2124
|
-
|
|
2158
|
+
f || warn('x-for ":key" is undefined or invalid', a, m, o), f.after(g), _.after(f), f._x_currentIfEl && f.after(f._x_currentIfEl), g.before(_), _._x_currentIfEl && _.after(_._x_currentIfEl), g.remove();
|
|
2159
|
+
}), f._x_refreshXForScope(c[u.indexOf(m)]);
|
|
2160
|
+
}
|
|
2161
|
+
for (let h = 0; h < d.length; h++) {
|
|
2162
|
+
let [b, m] = d[h], _ = b === "template" ? a : o[b];
|
|
2163
|
+
_._x_currentIfEl && (_ = _._x_currentIfEl);
|
|
2164
|
+
let f = c[m], g = u[m], w = document.importNode(a.content, !0).firstElementChild, E = reactive(f);
|
|
2165
|
+
addScopeToNode(w, E, a), w._x_refreshXForScope = (D) => {
|
|
2166
|
+
Object.entries(D).forEach(([A, C]) => {
|
|
2167
|
+
E[A] = C;
|
|
2125
2168
|
});
|
|
2126
2169
|
}, mutateDom(() => {
|
|
2127
|
-
|
|
2128
|
-
}), typeof
|
|
2170
|
+
_.after(w), skipDuringClone(() => initTree(w))();
|
|
2171
|
+
}), typeof g == "object" && warn("x-for key cannot be an object, it must be a string or an integer", a), o[g] = w;
|
|
2129
2172
|
}
|
|
2130
|
-
for (let
|
|
2131
|
-
o[v[
|
|
2173
|
+
for (let h = 0; h < v.length; h++)
|
|
2174
|
+
o[v[h]]._x_refreshXForScope(c[u.indexOf(v[h])]);
|
|
2132
2175
|
a._x_prevKeys = u;
|
|
2133
2176
|
});
|
|
2134
2177
|
}
|
|
@@ -2695,13 +2738,13 @@ function getBoundingClientRect(e, t, n) {
|
|
|
2695
2738
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
2696
2739
|
var i = e.getBoundingClientRect(), r = 1, a = 1;
|
|
2697
2740
|
t && isHTMLElement(e) && (r = e.offsetWidth > 0 && round(i.width) / e.offsetWidth || 1, a = e.offsetHeight > 0 && round(i.height) / e.offsetHeight || 1);
|
|
2698
|
-
var s = isElement(e) ? getWindow(e) : window, o = s.visualViewport, l = !isLayoutViewport() && n, c = (i.left + (l && o ? o.offsetLeft : 0)) / r, u = (i.top + (l && o ? o.offsetTop : 0)) / a, d = i.width / r,
|
|
2741
|
+
var s = isElement(e) ? getWindow(e) : window, o = s.visualViewport, l = !isLayoutViewport() && n, c = (i.left + (l && o ? o.offsetLeft : 0)) / r, u = (i.top + (l && o ? o.offsetTop : 0)) / a, d = i.width / r, p = i.height / a;
|
|
2699
2742
|
return {
|
|
2700
2743
|
width: d,
|
|
2701
|
-
height:
|
|
2744
|
+
height: p,
|
|
2702
2745
|
top: u,
|
|
2703
2746
|
right: c + d,
|
|
2704
|
-
bottom: u +
|
|
2747
|
+
bottom: u + p,
|
|
2705
2748
|
left: c,
|
|
2706
2749
|
x: c,
|
|
2707
2750
|
y: u
|
|
@@ -2813,8 +2856,8 @@ var toPaddingObject = function(t, n) {
|
|
|
2813
2856
|
function arrow(e) {
|
|
2814
2857
|
var t, n = e.state, i = e.name, r = e.options, a = n.elements.arrow, s = n.modifiersData.popperOffsets, o = getBasePlacement(n.placement), l = getMainAxisFromPlacement(o), c = [left, right].indexOf(o) >= 0, u = c ? "height" : "width";
|
|
2815
2858
|
if (!(!a || !s)) {
|
|
2816
|
-
var d = toPaddingObject(r.padding, n),
|
|
2817
|
-
n.modifiersData[i] = (t = {}, t[D] =
|
|
2859
|
+
var d = toPaddingObject(r.padding, n), p = getLayoutRect(a), x = l === "y" ? top : left, v = l === "y" ? bottom : right, y = n.rects.reference[u] + n.rects.reference[l] - s[l] - n.rects.popper[u], h = s[l] - n.rects.reference[l], b = getOffsetParent(a), m = b ? l === "y" ? b.clientHeight || 0 : b.clientWidth || 0 : 0, _ = y / 2 - h / 2, f = d[x], g = m - p[u] - d[v], w = m / 2 - p[u] / 2 + _, E = within(f, w, g), D = l;
|
|
2860
|
+
n.modifiersData[i] = (t = {}, t[D] = E, t.centerOffset = E - w, t);
|
|
2818
2861
|
}
|
|
2819
2862
|
}
|
|
2820
2863
|
function effect$1(e) {
|
|
@@ -2847,48 +2890,48 @@ function roundOffsetsByDPR(e, t) {
|
|
|
2847
2890
|
};
|
|
2848
2891
|
}
|
|
2849
2892
|
function mapToStyles(e) {
|
|
2850
|
-
var t, n = e.popper, i = e.popperRect, r = e.placement, a = e.variation, s = e.offsets, o = e.position, l = e.gpuAcceleration, c = e.adaptive, u = e.roundOffsets, d = e.isFixed,
|
|
2851
|
-
x
|
|
2852
|
-
y
|
|
2893
|
+
var t, n = e.popper, i = e.popperRect, r = e.placement, a = e.variation, s = e.offsets, o = e.position, l = e.gpuAcceleration, c = e.adaptive, u = e.roundOffsets, d = e.isFixed, p = s.x, x = p === void 0 ? 0 : p, v = s.y, y = v === void 0 ? 0 : v, h = typeof u == "function" ? u({
|
|
2894
|
+
x,
|
|
2895
|
+
y
|
|
2853
2896
|
}) : {
|
|
2854
|
-
x
|
|
2855
|
-
y
|
|
2897
|
+
x,
|
|
2898
|
+
y
|
|
2856
2899
|
};
|
|
2857
|
-
|
|
2858
|
-
var
|
|
2900
|
+
x = h.x, y = h.y;
|
|
2901
|
+
var b = s.hasOwnProperty("x"), m = s.hasOwnProperty("y"), _ = left, f = top, g = window;
|
|
2859
2902
|
if (c) {
|
|
2860
|
-
var
|
|
2861
|
-
if (
|
|
2903
|
+
var w = getOffsetParent(n), E = "clientHeight", D = "clientWidth";
|
|
2904
|
+
if (w === getWindow(n) && (w = getDocumentElement(n), getComputedStyle$1(w).position !== "static" && o === "absolute" && (E = "scrollHeight", D = "scrollWidth")), w = w, r === top || (r === left || r === right) && a === end) {
|
|
2862
2905
|
f = bottom;
|
|
2863
|
-
var A = d &&
|
|
2906
|
+
var A = d && w === g && g.visualViewport ? g.visualViewport.height : (
|
|
2864
2907
|
// $FlowFixMe[prop-missing]
|
|
2865
|
-
|
|
2908
|
+
w[E]
|
|
2866
2909
|
);
|
|
2867
|
-
|
|
2910
|
+
y -= A - i.height, y *= l ? 1 : -1;
|
|
2868
2911
|
}
|
|
2869
2912
|
if (r === left || (r === top || r === bottom) && a === end) {
|
|
2870
|
-
|
|
2871
|
-
var
|
|
2913
|
+
_ = right;
|
|
2914
|
+
var C = d && w === g && g.visualViewport ? g.visualViewport.width : (
|
|
2872
2915
|
// $FlowFixMe[prop-missing]
|
|
2873
|
-
|
|
2916
|
+
w[D]
|
|
2874
2917
|
);
|
|
2875
|
-
|
|
2918
|
+
x -= C - i.width, x *= l ? 1 : -1;
|
|
2876
2919
|
}
|
|
2877
2920
|
}
|
|
2878
|
-
var
|
|
2921
|
+
var S = Object.assign({
|
|
2879
2922
|
position: o
|
|
2880
2923
|
}, c && unsetSides), O = u === !0 ? roundOffsetsByDPR({
|
|
2881
|
-
x
|
|
2882
|
-
y
|
|
2924
|
+
x,
|
|
2925
|
+
y
|
|
2883
2926
|
}, getWindow(n)) : {
|
|
2884
|
-
x
|
|
2885
|
-
y
|
|
2927
|
+
x,
|
|
2928
|
+
y
|
|
2886
2929
|
};
|
|
2887
|
-
if (
|
|
2930
|
+
if (x = O.x, y = O.y, l) {
|
|
2888
2931
|
var T;
|
|
2889
|
-
return Object.assign({},
|
|
2932
|
+
return Object.assign({}, S, (T = {}, T[f] = m ? "0" : "", T[_] = b ? "0" : "", T.transform = (g.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", T));
|
|
2890
2933
|
}
|
|
2891
|
-
return Object.assign({},
|
|
2934
|
+
return Object.assign({}, S, (t = {}, t[f] = m ? y + "px" : "", t[_] = b ? x + "px" : "", t.transform = "", t));
|
|
2892
2935
|
}
|
|
2893
2936
|
function computeStyles(e) {
|
|
2894
2937
|
var t = e.state, n = e.options, i = n.gpuAcceleration, r = i === void 0 ? !0 : i, a = n.adaptive, s = a === void 0 ? !0 : a, o = n.roundOffsets, l = o === void 0 ? !0 : o, c = {
|
|
@@ -3088,43 +3131,43 @@ function computeOffsets(e) {
|
|
|
3088
3131
|
}
|
|
3089
3132
|
function detectOverflow(e, t) {
|
|
3090
3133
|
t === void 0 && (t = {});
|
|
3091
|
-
var n = t, i = n.placement, r = i === void 0 ? e.placement : i, a = n.strategy, s = a === void 0 ? e.strategy : a, o = n.boundary, l = o === void 0 ? clippingParents : o, c = n.rootBoundary, u = c === void 0 ? viewport : c, d = n.elementContext,
|
|
3092
|
-
reference:
|
|
3093
|
-
element:
|
|
3134
|
+
var n = t, i = n.placement, r = i === void 0 ? e.placement : i, a = n.strategy, s = a === void 0 ? e.strategy : a, o = n.boundary, l = o === void 0 ? clippingParents : o, c = n.rootBoundary, u = c === void 0 ? viewport : c, d = n.elementContext, p = d === void 0 ? popper : d, x = n.altBoundary, v = x === void 0 ? !1 : x, y = n.padding, h = y === void 0 ? 0 : y, b = mergePaddingObject(typeof h != "number" ? h : expandToHashMap(h, basePlacements)), m = p === popper ? reference : popper, _ = e.rects.popper, f = e.elements[v ? m : p], g = getClippingRect(isElement(f) ? f : f.contextElement || getDocumentElement(e.elements.popper), l, u, s), w = getBoundingClientRect(e.elements.reference), E = computeOffsets({
|
|
3135
|
+
reference: w,
|
|
3136
|
+
element: _,
|
|
3094
3137
|
placement: r
|
|
3095
|
-
}), D = rectToClientRect(Object.assign({},
|
|
3096
|
-
top:
|
|
3097
|
-
bottom: A.bottom -
|
|
3098
|
-
left:
|
|
3099
|
-
right: A.right -
|
|
3100
|
-
},
|
|
3101
|
-
if (
|
|
3102
|
-
var O =
|
|
3103
|
-
Object.keys(
|
|
3104
|
-
var L = [right, bottom].indexOf(T) >= 0 ? 1 : -1,
|
|
3105
|
-
|
|
3138
|
+
}), D = rectToClientRect(Object.assign({}, _, E)), A = p === popper ? D : w, C = {
|
|
3139
|
+
top: g.top - A.top + b.top,
|
|
3140
|
+
bottom: A.bottom - g.bottom + b.bottom,
|
|
3141
|
+
left: g.left - A.left + b.left,
|
|
3142
|
+
right: A.right - g.right + b.right
|
|
3143
|
+
}, S = e.modifiersData.offset;
|
|
3144
|
+
if (p === popper && S) {
|
|
3145
|
+
var O = S[r];
|
|
3146
|
+
Object.keys(C).forEach(function(T) {
|
|
3147
|
+
var L = [right, bottom].indexOf(T) >= 0 ? 1 : -1, M = [top, bottom].indexOf(T) >= 0 ? "y" : "x";
|
|
3148
|
+
C[T] += O[M] * L;
|
|
3106
3149
|
});
|
|
3107
3150
|
}
|
|
3108
|
-
return
|
|
3151
|
+
return C;
|
|
3109
3152
|
}
|
|
3110
3153
|
function computeAutoPlacement(e, t) {
|
|
3111
3154
|
t === void 0 && (t = {});
|
|
3112
3155
|
var n = t, i = n.placement, r = n.boundary, a = n.rootBoundary, s = n.padding, o = n.flipVariations, l = n.allowedAutoPlacements, c = l === void 0 ? placements : l, u = getVariation(i), d = u ? o ? variationPlacements : variationPlacements.filter(function(v) {
|
|
3113
3156
|
return getVariation(v) === u;
|
|
3114
|
-
}) : basePlacements,
|
|
3157
|
+
}) : basePlacements, p = d.filter(function(v) {
|
|
3115
3158
|
return c.indexOf(v) >= 0;
|
|
3116
3159
|
});
|
|
3117
|
-
|
|
3118
|
-
var
|
|
3119
|
-
return v[
|
|
3120
|
-
placement:
|
|
3160
|
+
p.length === 0 && (p = d);
|
|
3161
|
+
var x = p.reduce(function(v, y) {
|
|
3162
|
+
return v[y] = detectOverflow(e, {
|
|
3163
|
+
placement: y,
|
|
3121
3164
|
boundary: r,
|
|
3122
3165
|
rootBoundary: a,
|
|
3123
3166
|
padding: s
|
|
3124
|
-
})[getBasePlacement(
|
|
3167
|
+
})[getBasePlacement(y)], v;
|
|
3125
3168
|
}, {});
|
|
3126
|
-
return Object.keys(
|
|
3127
|
-
return
|
|
3169
|
+
return Object.keys(x).sort(function(v, y) {
|
|
3170
|
+
return x[v] - x[y];
|
|
3128
3171
|
});
|
|
3129
3172
|
}
|
|
3130
3173
|
function getExpandedFallbackPlacements(e) {
|
|
@@ -3136,37 +3179,37 @@ function getExpandedFallbackPlacements(e) {
|
|
|
3136
3179
|
function flip(e) {
|
|
3137
3180
|
var t = e.state, n = e.options, i = e.name;
|
|
3138
3181
|
if (!t.modifiersData[i]._skip) {
|
|
3139
|
-
for (var r = n.mainAxis, a = r === void 0 ? !0 : r, s = n.altAxis, o = s === void 0 ? !0 : s, l = n.fallbackPlacements, c = n.padding, u = n.boundary, d = n.rootBoundary,
|
|
3182
|
+
for (var r = n.mainAxis, a = r === void 0 ? !0 : r, s = n.altAxis, o = s === void 0 ? !0 : s, l = n.fallbackPlacements, c = n.padding, u = n.boundary, d = n.rootBoundary, p = n.altBoundary, x = n.flipVariations, v = x === void 0 ? !0 : x, y = n.allowedAutoPlacements, h = t.options.placement, b = getBasePlacement(h), m = b === h, _ = l || (m || !v ? [getOppositePlacement(h)] : getExpandedFallbackPlacements(h)), f = [h].concat(_).reduce(function(V, B) {
|
|
3140
3183
|
return V.concat(getBasePlacement(B) === auto ? computeAutoPlacement(t, {
|
|
3141
3184
|
placement: B,
|
|
3142
3185
|
boundary: u,
|
|
3143
3186
|
rootBoundary: d,
|
|
3144
3187
|
padding: c,
|
|
3145
3188
|
flipVariations: v,
|
|
3146
|
-
allowedAutoPlacements:
|
|
3189
|
+
allowedAutoPlacements: y
|
|
3147
3190
|
}) : B);
|
|
3148
|
-
}, []),
|
|
3149
|
-
var
|
|
3150
|
-
placement:
|
|
3191
|
+
}, []), g = t.rects.reference, w = t.rects.popper, E = /* @__PURE__ */ new Map(), D = !0, A = f[0], C = 0; C < f.length; C++) {
|
|
3192
|
+
var S = f[C], O = getBasePlacement(S), T = getVariation(S) === start, L = [top, bottom].indexOf(O) >= 0, M = L ? "width" : "height", H = detectOverflow(t, {
|
|
3193
|
+
placement: S,
|
|
3151
3194
|
boundary: u,
|
|
3152
3195
|
rootBoundary: d,
|
|
3153
|
-
altBoundary:
|
|
3196
|
+
altBoundary: p,
|
|
3154
3197
|
padding: c
|
|
3155
3198
|
}), I = L ? T ? right : left : T ? bottom : top;
|
|
3156
|
-
|
|
3199
|
+
g[M] > w[M] && (I = getOppositePlacement(I));
|
|
3157
3200
|
var W = getOppositePlacement(I), $ = [];
|
|
3158
3201
|
if (a && $.push(H[O] <= 0), o && $.push(H[I] <= 0, H[W] <= 0), $.every(function(V) {
|
|
3159
3202
|
return V;
|
|
3160
3203
|
})) {
|
|
3161
|
-
A =
|
|
3204
|
+
A = S, D = !1;
|
|
3162
3205
|
break;
|
|
3163
3206
|
}
|
|
3164
|
-
|
|
3207
|
+
E.set(S, $);
|
|
3165
3208
|
}
|
|
3166
3209
|
if (D)
|
|
3167
3210
|
for (var q = v ? 3 : 1, N = function(B) {
|
|
3168
|
-
var k = f.find(function(
|
|
3169
|
-
var F =
|
|
3211
|
+
var k = f.find(function(R) {
|
|
3212
|
+
var F = E.get(R);
|
|
3170
3213
|
if (F)
|
|
3171
3214
|
return F.slice(0, B).every(function(K) {
|
|
3172
3215
|
return K;
|
|
@@ -3274,34 +3317,34 @@ function getAltAxis(e) {
|
|
|
3274
3317
|
return e === "x" ? "y" : "x";
|
|
3275
3318
|
}
|
|
3276
3319
|
function preventOverflow(e) {
|
|
3277
|
-
var t = e.state, n = e.options, i = e.name, r = n.mainAxis, a = r === void 0 ? !0 : r, s = n.altAxis, o = s === void 0 ? !1 : s, l = n.boundary, c = n.rootBoundary, u = n.altBoundary, d = n.padding,
|
|
3320
|
+
var t = e.state, n = e.options, i = e.name, r = n.mainAxis, a = r === void 0 ? !0 : r, s = n.altAxis, o = s === void 0 ? !1 : s, l = n.boundary, c = n.rootBoundary, u = n.altBoundary, d = n.padding, p = n.tether, x = p === void 0 ? !0 : p, v = n.tetherOffset, y = v === void 0 ? 0 : v, h = detectOverflow(t, {
|
|
3278
3321
|
boundary: l,
|
|
3279
3322
|
rootBoundary: c,
|
|
3280
3323
|
padding: d,
|
|
3281
3324
|
altBoundary: u
|
|
3282
|
-
}),
|
|
3325
|
+
}), b = getBasePlacement(t.placement), m = getVariation(t.placement), _ = !m, f = getMainAxisFromPlacement(b), g = getAltAxis(f), w = t.modifiersData.popperOffsets, E = t.rects.reference, D = t.rects.popper, A = typeof y == "function" ? y(Object.assign({}, t.rects, {
|
|
3283
3326
|
placement: t.placement
|
|
3284
|
-
})) :
|
|
3327
|
+
})) : y, C = typeof A == "number" ? {
|
|
3285
3328
|
mainAxis: A,
|
|
3286
3329
|
altAxis: A
|
|
3287
3330
|
} : Object.assign({
|
|
3288
3331
|
mainAxis: 0,
|
|
3289
3332
|
altAxis: 0
|
|
3290
|
-
}, A),
|
|
3333
|
+
}, A), S = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, O = {
|
|
3291
3334
|
x: 0,
|
|
3292
3335
|
y: 0
|
|
3293
3336
|
};
|
|
3294
|
-
if (
|
|
3337
|
+
if (w) {
|
|
3295
3338
|
if (a) {
|
|
3296
|
-
var T, L = f === "y" ? top : left,
|
|
3339
|
+
var T, L = f === "y" ? top : left, M = f === "y" ? bottom : right, H = f === "y" ? "height" : "width", I = w[f], W = I + h[L], $ = I - h[M], q = x ? -D[H] / 2 : 0, N = m === start ? E[H] : D[H], P = m === start ? -D[H] : -E[H], j = t.elements.arrow, V = x && j ? getLayoutRect(j) : {
|
|
3297
3340
|
width: 0,
|
|
3298
3341
|
height: 0
|
|
3299
|
-
}, B = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : getFreshSideObject(), k = B[L],
|
|
3300
|
-
|
|
3342
|
+
}, B = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : getFreshSideObject(), k = B[L], R = B[M], F = within(0, E[H], V[H]), K = _ ? E[H] / 2 - q - F - k - C.mainAxis : N - F - k - C.mainAxis, ae = _ ? -E[H] / 2 + q + F + R + C.mainAxis : P + F + R + C.mainAxis, Y = t.elements.arrow && getOffsetParent(t.elements.arrow), se = Y ? f === "y" ? Y.clientTop || 0 : Y.clientLeft || 0 : 0, J = (T = S?.[f]) != null ? T : 0, oe = I + K - J - se, le = I + ae - J, G = within(x ? min(W, oe) : W, I, x ? max($, le) : $);
|
|
3343
|
+
w[f] = G, O[f] = G - I;
|
|
3301
3344
|
}
|
|
3302
3345
|
if (o) {
|
|
3303
|
-
var Z, ce = f === "x" ? top : left, ue = f === "x" ? bottom : right, z =
|
|
3304
|
-
|
|
3346
|
+
var Z, ce = f === "x" ? top : left, ue = f === "x" ? bottom : right, z = w[g], U = g === "y" ? "height" : "width", Q = z + h[ce], ee = z - h[ue], X = [top, left].indexOf(b) !== -1, te = (Z = S?.[g]) != null ? Z : 0, ne = X ? Q : z - E[U] - D[U] - te + C.altAxis, ie = X ? z + E[U] + D[U] - te - C.altAxis : ee, re = x && X ? withinMaxClamp(ne, z, ie) : within(x ? ne : Q, z, x ? ie : ee);
|
|
3347
|
+
w[g] = re, O[g] = re - z;
|
|
3305
3348
|
}
|
|
3306
3349
|
t.modifiersData[i] = O;
|
|
3307
3350
|
}
|
|
@@ -3420,18 +3463,18 @@ function popperGenerator(e) {
|
|
|
3420
3463
|
},
|
|
3421
3464
|
attributes: {},
|
|
3422
3465
|
styles: {}
|
|
3423
|
-
}, d = [],
|
|
3466
|
+
}, d = [], p = !1, x = {
|
|
3424
3467
|
state: u,
|
|
3425
|
-
setOptions: function(
|
|
3426
|
-
var
|
|
3427
|
-
|
|
3468
|
+
setOptions: function(b) {
|
|
3469
|
+
var m = typeof b == "function" ? b(u.options) : b;
|
|
3470
|
+
y(), u.options = Object.assign({}, a, u.options, m), u.scrollParents = {
|
|
3428
3471
|
reference: isElement(o) ? listScrollParents(o) : o.contextElement ? listScrollParents(o.contextElement) : [],
|
|
3429
3472
|
popper: listScrollParents(l)
|
|
3430
3473
|
};
|
|
3431
|
-
var
|
|
3432
|
-
return u.orderedModifiers =
|
|
3474
|
+
var _ = orderModifiers(mergeByName([].concat(i, u.options.modifiers)));
|
|
3475
|
+
return u.orderedModifiers = _.filter(function(f) {
|
|
3433
3476
|
return f.enabled;
|
|
3434
|
-
}), v(),
|
|
3477
|
+
}), v(), x.update();
|
|
3435
3478
|
},
|
|
3436
3479
|
// Sync update – it will always be executed, even if not necessary. This
|
|
3437
3480
|
// is useful for low frequency updates where sync behavior simplifies the
|
|
@@ -3439,26 +3482,26 @@ function popperGenerator(e) {
|
|
|
3439
3482
|
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
|
3440
3483
|
// prefer the async Popper#update method
|
|
3441
3484
|
forceUpdate: function() {
|
|
3442
|
-
if (!
|
|
3443
|
-
var
|
|
3444
|
-
if (areValidElements(
|
|
3485
|
+
if (!p) {
|
|
3486
|
+
var b = u.elements, m = b.reference, _ = b.popper;
|
|
3487
|
+
if (areValidElements(m, _)) {
|
|
3445
3488
|
u.rects = {
|
|
3446
|
-
reference: getCompositeRect(
|
|
3447
|
-
popper: getLayoutRect(
|
|
3448
|
-
}, u.reset = !1, u.placement = u.options.placement, u.orderedModifiers.forEach(function(
|
|
3449
|
-
return u.modifiersData[
|
|
3489
|
+
reference: getCompositeRect(m, getOffsetParent(_), u.options.strategy === "fixed"),
|
|
3490
|
+
popper: getLayoutRect(_)
|
|
3491
|
+
}, u.reset = !1, u.placement = u.options.placement, u.orderedModifiers.forEach(function(C) {
|
|
3492
|
+
return u.modifiersData[C.name] = Object.assign({}, C.data);
|
|
3450
3493
|
});
|
|
3451
3494
|
for (var f = 0; f < u.orderedModifiers.length; f++) {
|
|
3452
3495
|
if (u.reset === !0) {
|
|
3453
3496
|
u.reset = !1, f = -1;
|
|
3454
3497
|
continue;
|
|
3455
3498
|
}
|
|
3456
|
-
var
|
|
3457
|
-
typeof
|
|
3499
|
+
var g = u.orderedModifiers[f], w = g.fn, E = g.options, D = E === void 0 ? {} : E, A = g.name;
|
|
3500
|
+
typeof w == "function" && (u = w({
|
|
3458
3501
|
state: u,
|
|
3459
3502
|
options: D,
|
|
3460
3503
|
name: A,
|
|
3461
|
-
instance:
|
|
3504
|
+
instance: x
|
|
3462
3505
|
}) || u);
|
|
3463
3506
|
}
|
|
3464
3507
|
}
|
|
@@ -3467,40 +3510,40 @@ function popperGenerator(e) {
|
|
|
3467
3510
|
// Async and optimistically optimized update – it will not be executed if
|
|
3468
3511
|
// not necessary (debounced to run at most once-per-tick)
|
|
3469
3512
|
update: debounce(function() {
|
|
3470
|
-
return new Promise(function(
|
|
3471
|
-
|
|
3513
|
+
return new Promise(function(h) {
|
|
3514
|
+
x.forceUpdate(), h(u);
|
|
3472
3515
|
});
|
|
3473
3516
|
}),
|
|
3474
3517
|
destroy: function() {
|
|
3475
|
-
|
|
3518
|
+
y(), p = !0;
|
|
3476
3519
|
}
|
|
3477
3520
|
};
|
|
3478
3521
|
if (!areValidElements(o, l))
|
|
3479
|
-
return
|
|
3480
|
-
|
|
3481
|
-
!
|
|
3522
|
+
return x;
|
|
3523
|
+
x.setOptions(c).then(function(h) {
|
|
3524
|
+
!p && c.onFirstUpdate && c.onFirstUpdate(h);
|
|
3482
3525
|
});
|
|
3483
3526
|
function v() {
|
|
3484
|
-
u.orderedModifiers.forEach(function(
|
|
3485
|
-
var
|
|
3527
|
+
u.orderedModifiers.forEach(function(h) {
|
|
3528
|
+
var b = h.name, m = h.options, _ = m === void 0 ? {} : m, f = h.effect;
|
|
3486
3529
|
if (typeof f == "function") {
|
|
3487
|
-
var
|
|
3530
|
+
var g = f({
|
|
3488
3531
|
state: u,
|
|
3489
|
-
name:
|
|
3490
|
-
instance:
|
|
3491
|
-
options:
|
|
3492
|
-
}),
|
|
3532
|
+
name: b,
|
|
3533
|
+
instance: x,
|
|
3534
|
+
options: _
|
|
3535
|
+
}), w = function() {
|
|
3493
3536
|
};
|
|
3494
|
-
d.push(
|
|
3537
|
+
d.push(g || w);
|
|
3495
3538
|
}
|
|
3496
3539
|
});
|
|
3497
3540
|
}
|
|
3498
|
-
function
|
|
3499
|
-
d.forEach(function(
|
|
3500
|
-
return
|
|
3541
|
+
function y() {
|
|
3542
|
+
d.forEach(function(h) {
|
|
3543
|
+
return h();
|
|
3501
3544
|
}), d = [];
|
|
3502
3545
|
}
|
|
3503
|
-
return
|
|
3546
|
+
return x;
|
|
3504
3547
|
};
|
|
3505
3548
|
}
|
|
3506
3549
|
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1], createPopper = /* @__PURE__ */ popperGenerator({
|
|
@@ -4968,8 +5011,8 @@ function parseFormatString(e) {
|
|
|
4968
5011
|
parser: function(s, o) {
|
|
4969
5012
|
var l = s.split(reNonDateParts).reduce(function(c, u, d) {
|
|
4970
5013
|
if (u.length > 0 && n[d]) {
|
|
4971
|
-
var
|
|
4972
|
-
|
|
5014
|
+
var p = n[d][0];
|
|
5015
|
+
p === "M" ? c.m = u : p !== "D" && (c[p] = u);
|
|
4973
5016
|
}
|
|
4974
5017
|
return c;
|
|
4975
5018
|
}, {});
|
|
@@ -5121,45 +5164,45 @@ function validateViewId(e, t) {
|
|
|
5121
5164
|
return i >= 0 && i <= n ? i : t;
|
|
5122
5165
|
}
|
|
5123
5166
|
function processOptions(e, t) {
|
|
5124
|
-
var n = Object.assign({}, e), i = {}, r = t.constructor.locales, a = t.config || {}, s = a.format, o = a.language, l = a.locale, c = a.maxDate, u = a.maxView, d = a.minDate,
|
|
5167
|
+
var n = Object.assign({}, e), i = {}, r = t.constructor.locales, a = t.config || {}, s = a.format, o = a.language, l = a.locale, c = a.maxDate, u = a.maxView, d = a.minDate, p = a.pickLevel, x = a.startView, v = a.weekStart;
|
|
5125
5168
|
if (n.language) {
|
|
5126
|
-
var
|
|
5127
|
-
if (n.language !== o && (r[n.language] ?
|
|
5128
|
-
o = i.language =
|
|
5129
|
-
var
|
|
5169
|
+
var y;
|
|
5170
|
+
if (n.language !== o && (r[n.language] ? y = n.language : (y = n.language.split("-")[0], r[y] === void 0 && (y = !1))), delete n.language, y) {
|
|
5171
|
+
o = i.language = y;
|
|
5172
|
+
var h = l || r[defaultLang];
|
|
5130
5173
|
l = Object.assign({
|
|
5131
5174
|
format: defaultFormat,
|
|
5132
5175
|
weekStart: defaultWeekStart
|
|
5133
|
-
}, r[defaultLang]), o !== defaultLang && Object.assign(l, r[o]), i.locale = l, s ===
|
|
5176
|
+
}, r[defaultLang]), o !== defaultLang && Object.assign(l, r[o]), i.locale = l, s === h.format && (s = i.format = l.format), v === h.weekStart && (v = i.weekStart = l.weekStart, i.weekEnd = calcEndOfWeek(l.weekStart));
|
|
5134
5177
|
}
|
|
5135
5178
|
}
|
|
5136
5179
|
if (n.format) {
|
|
5137
|
-
var
|
|
5138
|
-
(
|
|
5180
|
+
var b = typeof n.format.toDisplay == "function", m = typeof n.format.toValue == "function", _ = reFormatTokens.test(n.format);
|
|
5181
|
+
(b && m || _) && (s = i.format = n.format), delete n.format;
|
|
5139
5182
|
}
|
|
5140
|
-
var f = d,
|
|
5141
|
-
if (n.minDate !== void 0 && (f = n.minDate === null ? dateValue(0, 0, 1) : validateDate(n.minDate, s, l, f), delete n.minDate), n.maxDate !== void 0 && (
|
|
5183
|
+
var f = d, g = c;
|
|
5184
|
+
if (n.minDate !== void 0 && (f = n.minDate === null ? dateValue(0, 0, 1) : validateDate(n.minDate, s, l, f), delete n.minDate), n.maxDate !== void 0 && (g = n.maxDate === null ? void 0 : validateDate(n.maxDate, s, l, g), delete n.maxDate), g < f ? (d = i.minDate = g, c = i.maxDate = f) : (d !== f && (d = i.minDate = f), c !== g && (c = i.maxDate = g)), n.datesDisabled && (i.datesDisabled = n.datesDisabled.reduce(function(M, H) {
|
|
5142
5185
|
var I = parseDate(H, s, l);
|
|
5143
|
-
return I !== void 0 ? pushUnique(
|
|
5186
|
+
return I !== void 0 ? pushUnique(M, I) : M;
|
|
5144
5187
|
}, []), delete n.datesDisabled), n.defaultViewDate !== void 0) {
|
|
5145
|
-
var
|
|
5146
|
-
|
|
5188
|
+
var w = parseDate(n.defaultViewDate, s, l);
|
|
5189
|
+
w !== void 0 && (i.defaultViewDate = w), delete n.defaultViewDate;
|
|
5147
5190
|
}
|
|
5148
5191
|
if (n.weekStart !== void 0) {
|
|
5149
|
-
var
|
|
5150
|
-
isNaN(
|
|
5192
|
+
var E = Number(n.weekStart) % 7;
|
|
5193
|
+
isNaN(E) || (v = i.weekStart = E, i.weekEnd = calcEndOfWeek(E)), delete n.weekStart;
|
|
5151
5194
|
}
|
|
5152
5195
|
if (n.daysOfWeekDisabled && (i.daysOfWeekDisabled = n.daysOfWeekDisabled.reduce(sanitizeDOW, []), delete n.daysOfWeekDisabled), n.daysOfWeekHighlighted && (i.daysOfWeekHighlighted = n.daysOfWeekHighlighted.reduce(sanitizeDOW, []), delete n.daysOfWeekHighlighted), n.maxNumberOfDates !== void 0) {
|
|
5153
5196
|
var D = parseInt(n.maxNumberOfDates, 10);
|
|
5154
5197
|
D >= 0 && (i.maxNumberOfDates = D, i.multidate = D !== 1), delete n.maxNumberOfDates;
|
|
5155
5198
|
}
|
|
5156
5199
|
n.dateDelimiter && (i.dateDelimiter = String(n.dateDelimiter), delete n.dateDelimiter);
|
|
5157
|
-
var A =
|
|
5158
|
-
n.pickLevel !== void 0 && (A = validateViewId(n.pickLevel, 2), delete n.pickLevel), A !==
|
|
5159
|
-
var
|
|
5160
|
-
n.maxView !== void 0 && (
|
|
5161
|
-
var
|
|
5162
|
-
if (n.startView !== void 0 && (
|
|
5200
|
+
var A = p;
|
|
5201
|
+
n.pickLevel !== void 0 && (A = validateViewId(n.pickLevel, 2), delete n.pickLevel), A !== p && (p = i.pickLevel = A);
|
|
5202
|
+
var C = u;
|
|
5203
|
+
n.maxView !== void 0 && (C = validateViewId(n.maxView, u), delete n.maxView), C = p > C ? p : C, C !== u && (u = i.maxView = C);
|
|
5204
|
+
var S = x;
|
|
5205
|
+
if (n.startView !== void 0 && (S = validateViewId(n.startView, S), delete n.startView), S < p ? S = p : S > u && (S = u), S !== x && (i.startView = S), n.prevArrow) {
|
|
5163
5206
|
var O = parseHTML(n.prevArrow);
|
|
5164
5207
|
O.childNodes.length > 0 && (i.prevArrow = O.childNodes), delete n.prevArrow;
|
|
5165
5208
|
}
|
|
@@ -5170,11 +5213,11 @@ function processOptions(e, t) {
|
|
|
5170
5213
|
if (n.disableTouchKeyboard !== void 0 && (i.disableTouchKeyboard = "ontouchstart" in document && !!n.disableTouchKeyboard, delete n.disableTouchKeyboard), n.orientation) {
|
|
5171
5214
|
var L = n.orientation.toLowerCase().split(/\s+/g);
|
|
5172
5215
|
i.orientation = {
|
|
5173
|
-
x: L.find(function(
|
|
5174
|
-
return
|
|
5216
|
+
x: L.find(function(M) {
|
|
5217
|
+
return M === "left" || M === "right";
|
|
5175
5218
|
}) || "auto",
|
|
5176
|
-
y: L.find(function(
|
|
5177
|
-
return
|
|
5219
|
+
y: L.find(function(M) {
|
|
5220
|
+
return M === "top" || M === "bottom";
|
|
5178
5221
|
}) || "auto"
|
|
5179
5222
|
}, delete n.orientation;
|
|
5180
5223
|
}
|
|
@@ -5186,8 +5229,8 @@ function processOptions(e, t) {
|
|
|
5186
5229
|
}
|
|
5187
5230
|
delete n.todayBtnMode;
|
|
5188
5231
|
}
|
|
5189
|
-
return Object.keys(n).forEach(function(
|
|
5190
|
-
n[
|
|
5232
|
+
return Object.keys(n).forEach(function(M) {
|
|
5233
|
+
n[M] !== void 0 && hasProperty(defaultOptions, M) && (i[M] = n[M]);
|
|
5191
5234
|
}), i;
|
|
5192
5235
|
}
|
|
5193
5236
|
var pickerTemplate = optimizeTemplateHTML(`<div class="datepicker hidden">
|
|
@@ -5331,8 +5374,8 @@ var pickerTemplate = optimizeTemplateHTML(`<div class="datepicker hidden">
|
|
|
5331
5374
|
Array.from(this.grid.children).forEach(function(s, o) {
|
|
5332
5375
|
var l = s.classList, c = addDays(i.start, o), u = new Date(c), d = u.getDay();
|
|
5333
5376
|
if (s.className = "datepicker-cell hover:bg-neutral-tertiary-medium block flex-1 leading-9 border-0 rounded-base cursor-pointer text-center text-body font-medium text-sm ".concat(i.cellClass), s.dataset.date = c, s.textContent = u.getDate(), c < i.first ? l.add("prev", "text-fg-disabled") : c > i.last && l.add("next", "text-fg-disabled"), i.today === c && l.add("today", "bg-gray-100", "dark:bg-gray-600"), (c < i.minDate || c > i.maxDate || i.disabled.includes(c)) && (l.add("disabled", "cursor-not-allowed", "text-fg-disabled"), l.remove("hover:bg-neutral-tertiary-medium", "text-body", "cursor-pointer")), i.daysOfWeekDisabled.includes(d) && (l.add("disabled", "cursor-not-allowed", "text-fg-disabled"), l.remove("hover:bg-neutral-tertiary-medium", "text-body", "cursor-pointer"), pushUnique(i.disabled, c)), i.daysOfWeekHighlighted.includes(d) && l.add("highlighted"), i.range) {
|
|
5334
|
-
var
|
|
5335
|
-
c >
|
|
5377
|
+
var p = _slicedToArray(i.range, 2), x = p[0], v = p[1];
|
|
5378
|
+
c > x && c < v && (l.add("range", "bg-neutral-tertiary-medium"), l.remove("rounded-base", "rounded-s-base", "rounded-e-base")), c === x && (l.add("range-start", "bg-brand", "rounded-s-base"), l.remove("rounded-base", "rounded-e-base")), c === v && (l.add("range-end", "bg-neutral-tertiary-medium", "rounded-e-base"), l.remove("rounded-base", "rounded-s-base"));
|
|
5336
5379
|
}
|
|
5337
5380
|
i.selected.includes(c) && (l.add("selected", "bg-brand", "text-white"), l.remove("text-body", "hover:bg-neutral-tertiary-medium", "bg-neutral-tertiary-medium")), c === i.focused && l.add("focused"), i.beforeShow && i.performBeforeHook(s, c, c);
|
|
5338
5381
|
});
|
|
@@ -5432,12 +5475,12 @@ var MonthsView = /* @__PURE__ */ (function(e) {
|
|
|
5432
5475
|
this.disabled = [], this.picker.setViewSwitchLabel(this.year), this.picker.setPrevBtnDisabled(this.year <= this.minYear), this.picker.setNextBtnDisabled(this.year >= this.maxYear);
|
|
5433
5476
|
var r = this.selected[this.year] || [], a = this.year < this.minYear || this.year > this.maxYear, s = this.year === this.minYear, o = this.year === this.maxYear, l = computeMonthRange(this.range, this.year);
|
|
5434
5477
|
Array.from(this.grid.children).forEach(function(c, u) {
|
|
5435
|
-
var d = c.classList,
|
|
5436
|
-
if (c.className = "datepicker-cell hover:bg-neutral-tertiary-medium block flex-1 leading-9 border-0 rounded-base cursor-pointer text-center text-body font-medium text-sm ".concat(i.cellClass), i.isMinView && (c.dataset.date =
|
|
5437
|
-
var
|
|
5438
|
-
u > v && u <
|
|
5478
|
+
var d = c.classList, p = dateValue(i.year, u, 1);
|
|
5479
|
+
if (c.className = "datepicker-cell hover:bg-neutral-tertiary-medium block flex-1 leading-9 border-0 rounded-base cursor-pointer text-center text-body font-medium text-sm ".concat(i.cellClass), i.isMinView && (c.dataset.date = p), c.textContent = i.monthNames[u], (a || s && u < i.minMonth || o && u > i.maxMonth) && d.add("disabled"), l) {
|
|
5480
|
+
var x = _slicedToArray(l, 2), v = x[0], y = x[1];
|
|
5481
|
+
u > v && u < y && d.add("range"), u === v && d.add("range-start"), u === y && d.add("range-end");
|
|
5439
5482
|
}
|
|
5440
|
-
r.includes(u) && (d.add("selected", "bg-brand", "text-white", "dark:text-white"), d.remove("text-body", "hover:bg-neutral-tertiary-medium", "dark:text-white")), u === i.focused && d.add("focused"), i.beforeShow && i.performBeforeHook(c, u,
|
|
5483
|
+
r.includes(u) && (d.add("selected", "bg-brand", "text-white", "dark:text-white"), d.remove("text-body", "hover:bg-neutral-tertiary-medium", "dark:text-white")), u === i.focused && d.add("focused"), i.beforeShow && i.performBeforeHook(c, u, p);
|
|
5441
5484
|
});
|
|
5442
5485
|
}
|
|
5443
5486
|
// Update the view UI by applying the changes of selected and focused items
|
|
@@ -5656,19 +5699,19 @@ function getTextDirection(e) {
|
|
|
5656
5699
|
var Picker = /* @__PURE__ */ (function() {
|
|
5657
5700
|
function e(t) {
|
|
5658
5701
|
_classCallCheck(this, e), this.datepicker = t;
|
|
5659
|
-
var n = pickerTemplate.replace(/%buttonClass%/g, t.config.buttonClass), i = this.element = parseHTML(n).firstChild, r = _slicedToArray(i.firstChild.children, 3), a = r[0], s = r[1], o = r[2], l = a.firstElementChild, c = _slicedToArray(a.lastElementChild.children, 3), u = c[0], d = c[1],
|
|
5702
|
+
var n = pickerTemplate.replace(/%buttonClass%/g, t.config.buttonClass), i = this.element = parseHTML(n).firstChild, r = _slicedToArray(i.firstChild.children, 3), a = r[0], s = r[1], o = r[2], l = a.firstElementChild, c = _slicedToArray(a.lastElementChild.children, 3), u = c[0], d = c[1], p = c[2], x = _slicedToArray(o.firstChild.children, 2), v = x[0], y = x[1], h = {
|
|
5660
5703
|
title: l,
|
|
5661
5704
|
prevBtn: u,
|
|
5662
5705
|
viewSwitch: d,
|
|
5663
|
-
nextBtn:
|
|
5706
|
+
nextBtn: p,
|
|
5664
5707
|
todayBtn: v,
|
|
5665
|
-
clearBtn:
|
|
5708
|
+
clearBtn: y
|
|
5666
5709
|
};
|
|
5667
|
-
this.main = s, this.controls =
|
|
5668
|
-
var
|
|
5669
|
-
i.classList.add("datepicker-".concat(
|
|
5710
|
+
this.main = s, this.controls = h;
|
|
5711
|
+
var b = t.inline ? "inline" : "dropdown";
|
|
5712
|
+
i.classList.add("datepicker-".concat(b)), b === "dropdown" && i.classList.add("dropdown", "absolute", "top-0", "left-0", "z-50", "pt-2"), processPickerOptions(this, t.config), this.viewDate = computeResetViewDate(t), registerListeners(t, [[i, "click", onClickPicker.bind(null, t), {
|
|
5670
5713
|
capture: !0
|
|
5671
|
-
}], [s, "click", onClickView.bind(null, t)], [
|
|
5714
|
+
}], [s, "click", onClickView.bind(null, t)], [h.viewSwitch, "click", onClickViewSwitch.bind(null, t)], [h.prevBtn, "click", onClickPrevBtn.bind(null, t)], [h.nextBtn, "click", onClickNextBtn.bind(null, t)], [h.todayBtn, "click", onClickTodayBtn.bind(null, t)], [h.clearBtn, "click", onClickClearBtn.bind(null, t)]]), this.views = [new DaysView(this), new MonthsView(this), new YearsView(this, {
|
|
5672
5715
|
id: 2,
|
|
5673
5716
|
name: "years",
|
|
5674
5717
|
cellClass: "year",
|
|
@@ -5713,8 +5756,8 @@ var Picker = /* @__PURE__ */ (function() {
|
|
|
5713
5756
|
}, {
|
|
5714
5757
|
key: "place",
|
|
5715
5758
|
value: function() {
|
|
5716
|
-
var n = this.element, i = n.classList, r = n.style, a = this.datepicker, s = a.config, o = a.inputField, l = s.container, c = this.element.getBoundingClientRect(), u = c.width, d = c.height,
|
|
5717
|
-
l === document.body ? (D = window.scrollY, A =
|
|
5759
|
+
var n = this.element, i = n.classList, r = n.style, a = this.datepicker, s = a.config, o = a.inputField, l = s.container, c = this.element.getBoundingClientRect(), u = c.width, d = c.height, p = l.getBoundingClientRect(), x = p.left, v = p.top, y = p.width, h = o.getBoundingClientRect(), b = h.left, m = h.top, _ = h.width, f = h.height, g = s.orientation, w = g.x, E = g.y, D, A, C;
|
|
5760
|
+
l === document.body ? (D = window.scrollY, A = b + window.scrollX, C = m + D) : (D = l.scrollTop, A = b - x, C = m - v + D), w === "auto" && (A < 0 ? (w = "left", A = 10) : A + u > y ? w = "right" : w = getTextDirection(o) === "rtl" ? "right" : "left"), w === "right" && (A -= u - _), E === "auto" && (E = C - d < D ? "bottom" : "top"), E === "top" ? C -= d : C += f, i.remove("datepicker-orient-top", "datepicker-orient-bottom", "datepicker-orient-right", "datepicker-orient-left"), i.add("datepicker-orient-".concat(E), "datepicker-orient-".concat(w)), r.top = C && "".concat(C, "px"), r.left = A && "".concat(A, "px");
|
|
5718
5761
|
}
|
|
5719
5762
|
}, {
|
|
5720
5763
|
key: "setViewSwitchLabel",
|
|
@@ -5782,8 +5825,8 @@ function moveByArrowKey(e, t, n, i) {
|
|
|
5782
5825
|
break;
|
|
5783
5826
|
case 1:
|
|
5784
5827
|
o = addMonths(o, i ? n * 4 : n), l = addMonths, c = function(d) {
|
|
5785
|
-
var
|
|
5786
|
-
return
|
|
5828
|
+
var p = new Date(d), x = a.year, v = a.disabled;
|
|
5829
|
+
return p.getFullYear() === x && v.includes(p.getMonth());
|
|
5787
5830
|
};
|
|
5788
5831
|
break;
|
|
5789
5832
|
default:
|
|
@@ -5974,11 +6017,11 @@ var Datepicker$1 = /* @__PURE__ */ (function() {
|
|
|
5974
6017
|
this.dates = [];
|
|
5975
6018
|
var d = processInputDates(this, o);
|
|
5976
6019
|
d && d.length > 0 && (this.dates = d), s && (s.value = stringifyDates(this.dates, r));
|
|
5977
|
-
var
|
|
6020
|
+
var p = this.picker = new Picker(this);
|
|
5978
6021
|
if (a)
|
|
5979
6022
|
this.show();
|
|
5980
6023
|
else {
|
|
5981
|
-
var
|
|
6024
|
+
var x = onClickOutside.bind(null, this), v = [[s, "keydown", onKeydown.bind(null, this)], [s, "focus", onFocus.bind(null, this)], [s, "mousedown", onMousedown.bind(null, this)], [s, "click", onClickInput.bind(null, this)], [s, "paste", onPaste.bind(null, this)], [document, "mousedown", x], [document, "touchstart", x], [window, "resize", p.place.bind(p)]];
|
|
5982
6025
|
registerListeners(this, v);
|
|
5983
6026
|
}
|
|
5984
6027
|
}
|
|
@@ -7367,68 +7410,68 @@ var htmx = (function() {
|
|
|
7367
7410
|
// @ts-ignore
|
|
7368
7411
|
end: u ? u.selectionEnd : null
|
|
7369
7412
|
};
|
|
7370
|
-
const
|
|
7413
|
+
const p = makeSettleInfo(e);
|
|
7371
7414
|
if (n.swapStyle === "textContent")
|
|
7372
7415
|
e.textContent = t;
|
|
7373
7416
|
else {
|
|
7374
7417
|
let v = makeFragment(t);
|
|
7375
|
-
if (
|
|
7376
|
-
const
|
|
7377
|
-
for (let
|
|
7378
|
-
const
|
|
7379
|
-
let
|
|
7380
|
-
|
|
7381
|
-
const
|
|
7382
|
-
f && oobSwap(
|
|
7418
|
+
if (p.title = i.title || v.title, i.historyRequest && (v = v.querySelector("[hx-history-elt],[data-hx-history-elt]") || v), i.selectOOB) {
|
|
7419
|
+
const y = i.selectOOB.split(",");
|
|
7420
|
+
for (let h = 0; h < y.length; h++) {
|
|
7421
|
+
const b = y[h].split(":", 2);
|
|
7422
|
+
let m = b[0].trim();
|
|
7423
|
+
m.indexOf("#") === 0 && (m = m.substring(1));
|
|
7424
|
+
const _ = b[1] || "true", f = v.querySelector("#" + m);
|
|
7425
|
+
f && oobSwap(_, f, p, c);
|
|
7383
7426
|
}
|
|
7384
7427
|
}
|
|
7385
|
-
if (findAndSwapOobElements(v,
|
|
7428
|
+
if (findAndSwapOobElements(v, p, c), forEach(
|
|
7386
7429
|
findAll(v, "template"),
|
|
7387
7430
|
/** @param {HTMLTemplateElement} template */
|
|
7388
|
-
function(
|
|
7389
|
-
|
|
7431
|
+
function(y) {
|
|
7432
|
+
y.content && findAndSwapOobElements(y.content, p, c) && y.remove();
|
|
7390
7433
|
}
|
|
7391
7434
|
), i.select) {
|
|
7392
|
-
const
|
|
7393
|
-
forEach(v.querySelectorAll(i.select), function(
|
|
7394
|
-
|
|
7395
|
-
}), v =
|
|
7435
|
+
const y = getDocument().createDocumentFragment();
|
|
7436
|
+
forEach(v.querySelectorAll(i.select), function(h) {
|
|
7437
|
+
y.appendChild(h);
|
|
7438
|
+
}), v = y;
|
|
7396
7439
|
}
|
|
7397
|
-
handlePreservedElements(v), swapWithStyle(n.swapStyle, i.contextElement, e, v,
|
|
7440
|
+
handlePreservedElements(v), swapWithStyle(n.swapStyle, i.contextElement, e, v, p), restorePreservedElements();
|
|
7398
7441
|
}
|
|
7399
7442
|
if (d.elt && !bodyContains(d.elt) && getRawAttribute(d.elt, "id")) {
|
|
7400
|
-
const v = document.getElementById(getRawAttribute(d.elt, "id")),
|
|
7443
|
+
const v = document.getElementById(getRawAttribute(d.elt, "id")), y = { preventScroll: n.focusScroll !== void 0 ? !n.focusScroll : !htmx.config.defaultFocusScroll };
|
|
7401
7444
|
if (v) {
|
|
7402
7445
|
if (d.start && v.setSelectionRange)
|
|
7403
7446
|
try {
|
|
7404
7447
|
v.setSelectionRange(d.start, d.end);
|
|
7405
7448
|
} catch {
|
|
7406
7449
|
}
|
|
7407
|
-
v.focus(
|
|
7450
|
+
v.focus(y);
|
|
7408
7451
|
}
|
|
7409
7452
|
}
|
|
7410
|
-
e.classList.remove(htmx.config.swappingClass), forEach(
|
|
7453
|
+
e.classList.remove(htmx.config.swappingClass), forEach(p.elts, function(v) {
|
|
7411
7454
|
v.classList && v.classList.add(htmx.config.settlingClass), triggerEvent(v, "htmx:afterSwap", i.eventInfo);
|
|
7412
|
-
}), maybeCall(i.afterSwapCallback), n.ignoreTitle || handleTitle(
|
|
7413
|
-
const
|
|
7414
|
-
if (forEach(
|
|
7455
|
+
}), maybeCall(i.afterSwapCallback), n.ignoreTitle || handleTitle(p.title);
|
|
7456
|
+
const x = function() {
|
|
7457
|
+
if (forEach(p.tasks, function(v) {
|
|
7415
7458
|
v.call();
|
|
7416
|
-
}), forEach(
|
|
7459
|
+
}), forEach(p.elts, function(v) {
|
|
7417
7460
|
v.classList && v.classList.remove(htmx.config.settlingClass), triggerEvent(v, "htmx:afterSettle", i.eventInfo);
|
|
7418
7461
|
}), i.anchor) {
|
|
7419
7462
|
const v = asElement(resolveTarget("#" + i.anchor));
|
|
7420
7463
|
v && v.scrollIntoView({ block: "start", behavior: "auto" });
|
|
7421
7464
|
}
|
|
7422
|
-
updateScrollState(
|
|
7465
|
+
updateScrollState(p.elts, n), maybeCall(i.afterSettleCallback), maybeCall(r);
|
|
7423
7466
|
};
|
|
7424
|
-
n.settleDelay > 0 ? getWindow().setTimeout(
|
|
7467
|
+
n.settleDelay > 0 ? getWindow().setTimeout(x, n.settleDelay) : x();
|
|
7425
7468
|
}, o = htmx.config.globalViewTransitions;
|
|
7426
7469
|
n.hasOwnProperty("transition") && (o = n.transition);
|
|
7427
7470
|
const l = i.contextElement || getDocument();
|
|
7428
7471
|
if (o && triggerEvent(l, "htmx:beforeTransition", i.eventInfo) && typeof Promise < "u" && // @ts-ignore experimental feature atm
|
|
7429
7472
|
document.startViewTransition) {
|
|
7430
|
-
const c = new Promise(function(d,
|
|
7431
|
-
r = d, a =
|
|
7473
|
+
const c = new Promise(function(d, p) {
|
|
7474
|
+
r = d, a = p;
|
|
7432
7475
|
}), u = s;
|
|
7433
7476
|
s = function() {
|
|
7434
7477
|
document.startViewTransition(function() {
|
|
@@ -7554,8 +7597,8 @@ var htmx = (function() {
|
|
|
7554
7597
|
var s = consumeUntil(r, WHITESPACE_OR_COMMA);
|
|
7555
7598
|
if (s === "closest" || s === "find" || s === "next" || s === "previous") {
|
|
7556
7599
|
r.shift();
|
|
7557
|
-
const
|
|
7558
|
-
|
|
7600
|
+
const x = consumeCSSSelector(r);
|
|
7601
|
+
x.length > 0 && (s += " " + x);
|
|
7559
7602
|
}
|
|
7560
7603
|
}
|
|
7561
7604
|
c.from = s;
|
|
@@ -7673,10 +7716,10 @@ var htmx = (function() {
|
|
|
7673
7716
|
a.triggeredOnce = !0;
|
|
7674
7717
|
}
|
|
7675
7718
|
if (i.changed) {
|
|
7676
|
-
const d = c.target,
|
|
7677
|
-
if (
|
|
7719
|
+
const d = c.target, p = d.value, x = a.lastValue.get(i);
|
|
7720
|
+
if (x.has(d) && x.get(d) === p)
|
|
7678
7721
|
return;
|
|
7679
|
-
|
|
7722
|
+
x.set(d, p);
|
|
7680
7723
|
}
|
|
7681
7724
|
if (a.delayed && clearTimeout(a.delayed), a.throttle)
|
|
7682
7725
|
return;
|
|
@@ -8384,8 +8427,8 @@ var htmx = (function() {
|
|
|
8384
8427
|
function issueAjaxRequest(e, t, n, i, r, a) {
|
|
8385
8428
|
let s = null, o = null;
|
|
8386
8429
|
if (r = r ?? {}, r.returnPromise && typeof Promise < "u")
|
|
8387
|
-
var l = new Promise(function(k,
|
|
8388
|
-
s = k, o =
|
|
8430
|
+
var l = new Promise(function(k, R) {
|
|
8431
|
+
s = k, o = R;
|
|
8389
8432
|
});
|
|
8390
8433
|
n == null && (n = getDocument().body);
|
|
8391
8434
|
const c = r.handler || handleAjaxResponse, u = r.select || null;
|
|
@@ -8394,16 +8437,16 @@ var htmx = (function() {
|
|
|
8394
8437
|
const d = r.targetOverride || asElement(getTarget(n));
|
|
8395
8438
|
if (d == null || d == DUMMY_ELT)
|
|
8396
8439
|
return triggerErrorEvent(n, "htmx:targetError", { target: getClosestAttributeValue(n, "hx-target") }), maybeCall(o), l;
|
|
8397
|
-
let
|
|
8398
|
-
const
|
|
8399
|
-
if (
|
|
8400
|
-
const k = getRawAttribute(
|
|
8440
|
+
let p = getInternalData(n);
|
|
8441
|
+
const x = p.lastButtonClicked;
|
|
8442
|
+
if (x) {
|
|
8443
|
+
const k = getRawAttribute(x, "formaction");
|
|
8401
8444
|
k != null && (t = k);
|
|
8402
|
-
const
|
|
8403
|
-
if (
|
|
8404
|
-
if (VERBS.includes(
|
|
8445
|
+
const R = getRawAttribute(x, "formmethod");
|
|
8446
|
+
if (R != null)
|
|
8447
|
+
if (VERBS.includes(R.toLowerCase()))
|
|
8405
8448
|
e = /** @type HttpVerb */
|
|
8406
|
-
|
|
8449
|
+
R;
|
|
8407
8450
|
else
|
|
8408
8451
|
return maybeCall(s), l;
|
|
8409
8452
|
}
|
|
@@ -8412,67 +8455,67 @@ var htmx = (function() {
|
|
|
8412
8455
|
return issueAjaxRequest(e, t, n, i, r, !!F);
|
|
8413
8456
|
}, question: v }) === !1)
|
|
8414
8457
|
return maybeCall(s), l;
|
|
8415
|
-
let
|
|
8416
|
-
if (
|
|
8417
|
-
const k =
|
|
8418
|
-
if (
|
|
8458
|
+
let y = n, h = getClosestAttributeValue(n, "hx-sync"), b = null, m = !1;
|
|
8459
|
+
if (h) {
|
|
8460
|
+
const k = h.split(":"), R = k[0].trim();
|
|
8461
|
+
if (R === "this" ? y = findThisElement(n, "hx-sync") : y = asElement(querySelectorExt(n, R)), h = (k[1] || "drop").trim(), p = getInternalData(y), h === "drop" && p.xhr && p.abortable !== !0)
|
|
8419
8462
|
return maybeCall(s), l;
|
|
8420
|
-
if (
|
|
8421
|
-
if (
|
|
8463
|
+
if (h === "abort") {
|
|
8464
|
+
if (p.xhr)
|
|
8422
8465
|
return maybeCall(s), l;
|
|
8423
|
-
|
|
8424
|
-
} else
|
|
8466
|
+
m = !0;
|
|
8467
|
+
} else h === "replace" ? triggerEvent(y, "htmx:abort") : h.indexOf("queue") === 0 && (b = (h.split(" ")[1] || "last").trim());
|
|
8425
8468
|
}
|
|
8426
|
-
if (
|
|
8427
|
-
if (
|
|
8428
|
-
triggerEvent(
|
|
8469
|
+
if (p.xhr)
|
|
8470
|
+
if (p.abortable)
|
|
8471
|
+
triggerEvent(y, "htmx:abort");
|
|
8429
8472
|
else {
|
|
8430
|
-
if (
|
|
8473
|
+
if (b == null) {
|
|
8431
8474
|
if (i) {
|
|
8432
8475
|
const k = getInternalData(i);
|
|
8433
|
-
k && k.triggerSpec && k.triggerSpec.queue && (
|
|
8476
|
+
k && k.triggerSpec && k.triggerSpec.queue && (b = k.triggerSpec.queue);
|
|
8434
8477
|
}
|
|
8435
|
-
|
|
8478
|
+
b == null && (b = "last");
|
|
8436
8479
|
}
|
|
8437
|
-
return
|
|
8480
|
+
return p.queuedRequests == null && (p.queuedRequests = []), b === "first" && p.queuedRequests.length === 0 ? p.queuedRequests.push(function() {
|
|
8438
8481
|
issueAjaxRequest(e, t, n, i, r);
|
|
8439
|
-
}) :
|
|
8482
|
+
}) : b === "all" ? p.queuedRequests.push(function() {
|
|
8440
8483
|
issueAjaxRequest(e, t, n, i, r);
|
|
8441
|
-
}) :
|
|
8484
|
+
}) : b === "last" && (p.queuedRequests = [], p.queuedRequests.push(function() {
|
|
8442
8485
|
issueAjaxRequest(e, t, n, i, r);
|
|
8443
8486
|
})), maybeCall(s), l;
|
|
8444
8487
|
}
|
|
8445
|
-
const
|
|
8446
|
-
|
|
8488
|
+
const _ = new XMLHttpRequest();
|
|
8489
|
+
p.xhr = _, p.abortable = m;
|
|
8447
8490
|
const f = function() {
|
|
8448
|
-
|
|
8449
|
-
},
|
|
8450
|
-
if (
|
|
8451
|
-
var
|
|
8452
|
-
if (
|
|
8491
|
+
p.xhr = null, p.abortable = !1, p.queuedRequests != null && p.queuedRequests.length > 0 && p.queuedRequests.shift()();
|
|
8492
|
+
}, g = getClosestAttributeValue(n, "hx-prompt");
|
|
8493
|
+
if (g) {
|
|
8494
|
+
var w = prompt(g);
|
|
8495
|
+
if (w === null || !triggerEvent(n, "htmx:prompt", { prompt: w, target: d }))
|
|
8453
8496
|
return maybeCall(s), f(), l;
|
|
8454
8497
|
}
|
|
8455
8498
|
if (v && !a && !confirm(v))
|
|
8456
8499
|
return maybeCall(s), f(), l;
|
|
8457
|
-
let
|
|
8458
|
-
e !== "get" && !usesFormData(n) && (
|
|
8500
|
+
let E = getHeaders(n, d, w);
|
|
8501
|
+
e !== "get" && !usesFormData(n) && (E["Content-Type"] = "application/x-www-form-urlencoded"), r.headers && (E = mergeObjects(E, r.headers));
|
|
8459
8502
|
const D = getInputValues(n, e);
|
|
8460
8503
|
let A = D.errors;
|
|
8461
|
-
const
|
|
8462
|
-
r.values && overrideFormData(
|
|
8463
|
-
const
|
|
8504
|
+
const C = D.formData;
|
|
8505
|
+
r.values && overrideFormData(C, formDataFromObject(r.values));
|
|
8506
|
+
const S = formDataFromObject(getExpressionVars(n, i)), O = overrideFormData(C, S);
|
|
8464
8507
|
let T = filterValues(O, n);
|
|
8465
8508
|
htmx.config.getCacheBusterParam && e === "get" && T.set("org.htmx.cache-buster", getRawAttribute(d, "id") || "true"), (t == null || t === "") && (t = location.href);
|
|
8466
|
-
const L = getValuesForElement(n, "hx-request"),
|
|
8509
|
+
const L = getValuesForElement(n, "hx-request"), M = getInternalData(n).boosted;
|
|
8467
8510
|
let H = htmx.config.methodsThatUseUrlParams.indexOf(e) >= 0;
|
|
8468
8511
|
const I = {
|
|
8469
|
-
boosted:
|
|
8512
|
+
boosted: M,
|
|
8470
8513
|
useUrlParams: H,
|
|
8471
8514
|
formData: T,
|
|
8472
8515
|
parameters: formDataProxy(T),
|
|
8473
8516
|
unfilteredFormData: O,
|
|
8474
8517
|
unfilteredParameters: formDataProxy(O),
|
|
8475
|
-
headers:
|
|
8518
|
+
headers: E,
|
|
8476
8519
|
elt: n,
|
|
8477
8520
|
target: d,
|
|
8478
8521
|
verb: e,
|
|
@@ -8484,25 +8527,25 @@ var htmx = (function() {
|
|
|
8484
8527
|
};
|
|
8485
8528
|
if (!triggerEvent(n, "htmx:configRequest", I))
|
|
8486
8529
|
return maybeCall(s), f(), l;
|
|
8487
|
-
if (t = I.path, e = I.verb,
|
|
8530
|
+
if (t = I.path, e = I.verb, E = I.headers, T = formDataFromObject(I.parameters), A = I.errors, H = I.useUrlParams, A && A.length > 0)
|
|
8488
8531
|
return triggerEvent(n, "htmx:validation:halted", I), maybeCall(s), f(), l;
|
|
8489
8532
|
const W = t.split("#"), $ = W[0], q = W[1];
|
|
8490
8533
|
let N = t;
|
|
8491
8534
|
if (H && (N = $, !T.keys().next().done && (N.indexOf("?") < 0 ? N += "?" : N += "&", N += urlEncode(T), q && (N += "#" + q))), !verifyPath(n, N, I))
|
|
8492
8535
|
return triggerErrorEvent(n, "htmx:invalidPath", I), maybeCall(o), f(), l;
|
|
8493
|
-
if (
|
|
8494
|
-
for (const k in
|
|
8495
|
-
if (
|
|
8496
|
-
const
|
|
8497
|
-
safelySetHeaderValue(
|
|
8536
|
+
if (_.open(e.toUpperCase(), N, !0), _.overrideMimeType("text/html"), _.withCredentials = I.withCredentials, _.timeout = I.timeout, !L.noHeaders) {
|
|
8537
|
+
for (const k in E)
|
|
8538
|
+
if (E.hasOwnProperty(k)) {
|
|
8539
|
+
const R = E[k];
|
|
8540
|
+
safelySetHeaderValue(_, k, R);
|
|
8498
8541
|
}
|
|
8499
8542
|
}
|
|
8500
8543
|
const P = {
|
|
8501
|
-
xhr:
|
|
8544
|
+
xhr: _,
|
|
8502
8545
|
target: d,
|
|
8503
8546
|
requestConfig: I,
|
|
8504
8547
|
etc: r,
|
|
8505
|
-
boosted:
|
|
8548
|
+
boosted: M,
|
|
8506
8549
|
select: u,
|
|
8507
8550
|
pathInfo: {
|
|
8508
8551
|
requestPath: t,
|
|
@@ -8511,16 +8554,16 @@ var htmx = (function() {
|
|
|
8511
8554
|
anchor: q
|
|
8512
8555
|
}
|
|
8513
8556
|
};
|
|
8514
|
-
if (
|
|
8557
|
+
if (_.onload = function() {
|
|
8515
8558
|
try {
|
|
8516
8559
|
const k = hierarchyForElt(n);
|
|
8517
|
-
if (P.pathInfo.responsePath = getPathFromResponse(
|
|
8518
|
-
let
|
|
8519
|
-
for (; k.length > 0 &&
|
|
8560
|
+
if (P.pathInfo.responsePath = getPathFromResponse(_), c(n, P), P.keepIndicators !== !0 && removeRequestIndicators(j, V), triggerEvent(n, "htmx:afterRequest", P), triggerEvent(n, "htmx:afterOnLoad", P), !bodyContains(n)) {
|
|
8561
|
+
let R = null;
|
|
8562
|
+
for (; k.length > 0 && R == null; ) {
|
|
8520
8563
|
const F = k.shift();
|
|
8521
|
-
bodyContains(F) && (
|
|
8564
|
+
bodyContains(F) && (R = F);
|
|
8522
8565
|
}
|
|
8523
|
-
|
|
8566
|
+
R && (triggerEvent(R, "htmx:afterRequest", P), triggerEvent(R, "htmx:afterOnLoad", P));
|
|
8524
8567
|
}
|
|
8525
8568
|
maybeCall(s);
|
|
8526
8569
|
} catch (k) {
|
|
@@ -8528,18 +8571,18 @@ var htmx = (function() {
|
|
|
8528
8571
|
} finally {
|
|
8529
8572
|
f();
|
|
8530
8573
|
}
|
|
8531
|
-
},
|
|
8574
|
+
}, _.onerror = function() {
|
|
8532
8575
|
removeRequestIndicators(j, V), triggerErrorEvent(n, "htmx:afterRequest", P), triggerErrorEvent(n, "htmx:sendError", P), maybeCall(o), f();
|
|
8533
|
-
},
|
|
8576
|
+
}, _.onabort = function() {
|
|
8534
8577
|
removeRequestIndicators(j, V), triggerErrorEvent(n, "htmx:afterRequest", P), triggerErrorEvent(n, "htmx:sendAbort", P), maybeCall(o), f();
|
|
8535
|
-
},
|
|
8578
|
+
}, _.ontimeout = function() {
|
|
8536
8579
|
removeRequestIndicators(j, V), triggerErrorEvent(n, "htmx:afterRequest", P), triggerErrorEvent(n, "htmx:timeout", P), maybeCall(o), f();
|
|
8537
8580
|
}, !triggerEvent(n, "htmx:beforeRequest", P))
|
|
8538
8581
|
return maybeCall(s), f(), l;
|
|
8539
8582
|
var j = addRequestIndicatorClasses(n), V = disableElements(n);
|
|
8540
8583
|
forEach(["loadstart", "loadend", "progress", "abort"], function(k) {
|
|
8541
|
-
forEach([
|
|
8542
|
-
|
|
8584
|
+
forEach([_, _.upload], function(R) {
|
|
8585
|
+
R.addEventListener(k, function(F) {
|
|
8543
8586
|
triggerEvent(n, "htmx:xhr:" + k, {
|
|
8544
8587
|
lengthComputable: F.lengthComputable,
|
|
8545
8588
|
loaded: F.loaded,
|
|
@@ -8548,8 +8591,8 @@ var htmx = (function() {
|
|
|
8548
8591
|
});
|
|
8549
8592
|
});
|
|
8550
8593
|
}), triggerEvent(n, "htmx:beforeSend", P);
|
|
8551
|
-
const B = H ? null : encodeParamsForBody(
|
|
8552
|
-
return
|
|
8594
|
+
const B = H ? null : encodeParamsForBody(_, n, T);
|
|
8595
|
+
return _.send(B), l;
|
|
8553
8596
|
}
|
|
8554
8597
|
function determineHistoryUpdates(e, t) {
|
|
8555
8598
|
const n = t.xhr;
|
|
@@ -8600,9 +8643,9 @@ var htmx = (function() {
|
|
|
8600
8643
|
const r = t.etc, a = t.select;
|
|
8601
8644
|
if (!triggerEvent(e, "htmx:beforeOnLoad", t)) return;
|
|
8602
8645
|
if (hasHeader(n, /HX-Trigger:/i) && handleTriggerHeader(n, "HX-Trigger", e), hasHeader(n, /HX-Location:/i)) {
|
|
8603
|
-
let
|
|
8646
|
+
let m = n.getResponseHeader("HX-Location");
|
|
8604
8647
|
var s = {};
|
|
8605
|
-
|
|
8648
|
+
m.indexOf("{") === 0 && (s = parseJSON(m), m = s.path, delete s.path), s.push = s.push || "true", ajaxHelper("get", m, s);
|
|
8606
8649
|
return;
|
|
8607
8650
|
}
|
|
8608
8651
|
const o = hasHeader(n, /HX-Refresh:/i) && n.getResponseHeader("HX-Refresh") === "true";
|
|
@@ -8615,29 +8658,29 @@ var htmx = (function() {
|
|
|
8615
8658
|
return;
|
|
8616
8659
|
}
|
|
8617
8660
|
const l = determineHistoryUpdates(e, t), c = resolveResponseHandling(n), u = c.swap;
|
|
8618
|
-
let d = !!c.error,
|
|
8661
|
+
let d = !!c.error, p = htmx.config.ignoreTitle || c.ignoreTitle, x = c.select;
|
|
8619
8662
|
c.target && (t.target = resolveRetarget(e, c.target));
|
|
8620
8663
|
var v = r.swapOverride;
|
|
8621
8664
|
v == null && c.swapOverride && (v = c.swapOverride), hasHeader(n, /HX-Retarget:/i) && (t.target = resolveRetarget(e, n.getResponseHeader("HX-Retarget"))), hasHeader(n, /HX-Reswap:/i) && (v = n.getResponseHeader("HX-Reswap"));
|
|
8622
|
-
var
|
|
8665
|
+
var y = n.response, h = mergeObjects({
|
|
8623
8666
|
shouldSwap: u,
|
|
8624
|
-
serverResponse:
|
|
8667
|
+
serverResponse: y,
|
|
8625
8668
|
isError: d,
|
|
8626
|
-
ignoreTitle:
|
|
8627
|
-
selectOverride:
|
|
8669
|
+
ignoreTitle: p,
|
|
8670
|
+
selectOverride: x,
|
|
8628
8671
|
swapOverride: v
|
|
8629
8672
|
}, t);
|
|
8630
|
-
if (!(c.event && !triggerEvent(i, c.event,
|
|
8631
|
-
if (i =
|
|
8673
|
+
if (!(c.event && !triggerEvent(i, c.event, h)) && triggerEvent(i, "htmx:beforeSwap", h)) {
|
|
8674
|
+
if (i = h.target, y = h.serverResponse, d = h.isError, p = h.ignoreTitle, x = h.selectOverride, v = h.swapOverride, t.target = i, t.failed = d, t.successful = !d, h.shouldSwap) {
|
|
8632
8675
|
n.status === 286 && cancelPolling(e), withExtensions(e, function(f) {
|
|
8633
|
-
|
|
8676
|
+
y = f.transformResponse(y, n, e);
|
|
8634
8677
|
}), l.type && saveCurrentPageToHistory();
|
|
8635
|
-
var
|
|
8636
|
-
|
|
8637
|
-
const
|
|
8638
|
-
swap(i,
|
|
8639
|
-
select:
|
|
8640
|
-
selectOOB:
|
|
8678
|
+
var b = getSwapSpecification(e, v);
|
|
8679
|
+
b.hasOwnProperty("ignoreTitle") || (b.ignoreTitle = p), i.classList.add(htmx.config.swappingClass), a && (x = a), hasHeader(n, /HX-Reselect:/i) && (x = n.getResponseHeader("HX-Reselect"));
|
|
8680
|
+
const m = r.selectOOB || getClosestAttributeValue(e, "hx-select-oob"), _ = getClosestAttributeValue(e, "hx-select");
|
|
8681
|
+
swap(i, y, b, {
|
|
8682
|
+
select: x === "unset" ? null : x || _,
|
|
8683
|
+
selectOOB: m,
|
|
8641
8684
|
eventInfo: t,
|
|
8642
8685
|
anchor: t.pathInfo.anchor,
|
|
8643
8686
|
contextElement: e,
|
|
@@ -8774,454 +8817,454 @@ var htmx = (function() {
|
|
|
8774
8817
|
},
|
|
8775
8818
|
head: {
|
|
8776
8819
|
style: "merge",
|
|
8777
|
-
shouldPreserve: (
|
|
8778
|
-
shouldReAppend: (
|
|
8820
|
+
shouldPreserve: (p) => p.getAttribute("im-preserve") === "true",
|
|
8821
|
+
shouldReAppend: (p) => p.getAttribute("im-re-append") === "true",
|
|
8779
8822
|
shouldRemove: e,
|
|
8780
8823
|
afterHeadMorphed: e
|
|
8781
8824
|
},
|
|
8782
8825
|
restoreFocus: !0
|
|
8783
8826
|
};
|
|
8784
|
-
function n(
|
|
8785
|
-
|
|
8786
|
-
const
|
|
8787
|
-
m,
|
|
8827
|
+
function n(p, x, v = {}) {
|
|
8828
|
+
p = u(p);
|
|
8829
|
+
const y = d(x), h = c(p, y, v), b = r(h, () => o(
|
|
8788
8830
|
h,
|
|
8789
|
-
|
|
8831
|
+
p,
|
|
8832
|
+
y,
|
|
8790
8833
|
/** @param {MorphContext} ctx */
|
|
8791
|
-
(
|
|
8834
|
+
(m) => m.morphStyle === "innerHTML" ? (a(m, p, y), Array.from(p.childNodes)) : i(m, p, y)
|
|
8792
8835
|
));
|
|
8793
|
-
return
|
|
8836
|
+
return h.pantry.remove(), b;
|
|
8794
8837
|
}
|
|
8795
|
-
function i(
|
|
8796
|
-
const
|
|
8838
|
+
function i(p, x, v) {
|
|
8839
|
+
const y = d(x);
|
|
8797
8840
|
return a(
|
|
8798
|
-
|
|
8799
|
-
|
|
8841
|
+
p,
|
|
8842
|
+
y,
|
|
8800
8843
|
v,
|
|
8801
8844
|
// these two optional params are the secret sauce
|
|
8802
|
-
|
|
8845
|
+
x,
|
|
8803
8846
|
// start point for iteration
|
|
8804
|
-
|
|
8847
|
+
x.nextSibling
|
|
8805
8848
|
// end point for iteration
|
|
8806
|
-
), Array.from(
|
|
8849
|
+
), Array.from(y.childNodes);
|
|
8807
8850
|
}
|
|
8808
|
-
function r(
|
|
8809
|
-
if (!
|
|
8851
|
+
function r(p, x) {
|
|
8852
|
+
if (!p.config.restoreFocus) return x();
|
|
8810
8853
|
let v = (
|
|
8811
8854
|
/** @type {HTMLInputElement|HTMLTextAreaElement|null} */
|
|
8812
8855
|
document.activeElement
|
|
8813
8856
|
);
|
|
8814
8857
|
if (!(v instanceof HTMLInputElement || v instanceof HTMLTextAreaElement))
|
|
8815
|
-
return
|
|
8816
|
-
const { id:
|
|
8817
|
-
return
|
|
8858
|
+
return x();
|
|
8859
|
+
const { id: y, selectionStart: h, selectionEnd: b } = v, m = x();
|
|
8860
|
+
return y && y !== document.activeElement?.getAttribute("id") && (v = p.target.querySelector(`[id="${y}"]`), v?.focus()), v && !v.selectionEnd && b && v.setSelectionRange(h, b), m;
|
|
8818
8861
|
}
|
|
8819
8862
|
const a = /* @__PURE__ */ (function() {
|
|
8820
|
-
function
|
|
8821
|
-
|
|
8822
|
-
for (const A of
|
|
8823
|
-
if (
|
|
8824
|
-
const
|
|
8863
|
+
function p(f, g, w, E = null, D = null) {
|
|
8864
|
+
g instanceof HTMLTemplateElement && w instanceof HTMLTemplateElement && (g = g.content, w = w.content), E ||= g.firstChild;
|
|
8865
|
+
for (const A of w.childNodes) {
|
|
8866
|
+
if (E && E != D) {
|
|
8867
|
+
const S = v(
|
|
8825
8868
|
f,
|
|
8826
8869
|
A,
|
|
8827
|
-
|
|
8870
|
+
E,
|
|
8828
8871
|
D
|
|
8829
8872
|
);
|
|
8830
|
-
if (
|
|
8831
|
-
|
|
8873
|
+
if (S) {
|
|
8874
|
+
S !== E && h(f, E, S), s(S, A, f), E = S.nextSibling;
|
|
8832
8875
|
continue;
|
|
8833
8876
|
}
|
|
8834
8877
|
}
|
|
8835
8878
|
if (A instanceof Element) {
|
|
8836
|
-
const
|
|
8879
|
+
const S = (
|
|
8837
8880
|
/** @type {String} */
|
|
8838
8881
|
A.getAttribute("id")
|
|
8839
8882
|
);
|
|
8840
|
-
if (f.persistentIds.has(
|
|
8841
|
-
const O =
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8883
|
+
if (f.persistentIds.has(S)) {
|
|
8884
|
+
const O = b(
|
|
8885
|
+
g,
|
|
8886
|
+
S,
|
|
8887
|
+
E,
|
|
8845
8888
|
f
|
|
8846
8889
|
);
|
|
8847
|
-
s(O, A, f),
|
|
8890
|
+
s(O, A, f), E = O.nextSibling;
|
|
8848
8891
|
continue;
|
|
8849
8892
|
}
|
|
8850
8893
|
}
|
|
8851
|
-
const
|
|
8852
|
-
|
|
8894
|
+
const C = x(
|
|
8895
|
+
g,
|
|
8853
8896
|
A,
|
|
8854
|
-
|
|
8897
|
+
E,
|
|
8855
8898
|
f
|
|
8856
8899
|
);
|
|
8857
|
-
|
|
8900
|
+
C && (E = C.nextSibling);
|
|
8858
8901
|
}
|
|
8859
|
-
for (;
|
|
8860
|
-
const A =
|
|
8861
|
-
|
|
8902
|
+
for (; E && E != D; ) {
|
|
8903
|
+
const A = E;
|
|
8904
|
+
E = E.nextSibling, y(f, A);
|
|
8862
8905
|
}
|
|
8863
8906
|
}
|
|
8864
|
-
function
|
|
8865
|
-
if (
|
|
8866
|
-
if (
|
|
8907
|
+
function x(f, g, w, E) {
|
|
8908
|
+
if (E.callbacks.beforeNodeAdded(g) === !1) return null;
|
|
8909
|
+
if (E.idMap.has(g)) {
|
|
8867
8910
|
const D = document.createElement(
|
|
8868
8911
|
/** @type {Element} */
|
|
8869
|
-
|
|
8912
|
+
g.tagName
|
|
8870
8913
|
);
|
|
8871
|
-
return f.insertBefore(D,
|
|
8914
|
+
return f.insertBefore(D, w), s(D, g, E), E.callbacks.afterNodeAdded(D), D;
|
|
8872
8915
|
} else {
|
|
8873
|
-
const D = document.importNode(
|
|
8874
|
-
return f.insertBefore(D,
|
|
8916
|
+
const D = document.importNode(g, !0);
|
|
8917
|
+
return f.insertBefore(D, w), E.callbacks.afterNodeAdded(D), D;
|
|
8875
8918
|
}
|
|
8876
8919
|
}
|
|
8877
8920
|
const v = /* @__PURE__ */ (function() {
|
|
8878
|
-
function f(
|
|
8879
|
-
let
|
|
8880
|
-
for (; L && L !=
|
|
8881
|
-
if (
|
|
8882
|
-
if (
|
|
8921
|
+
function f(E, D, A, C) {
|
|
8922
|
+
let S = null, O = D.nextSibling, T = 0, L = A;
|
|
8923
|
+
for (; L && L != C; ) {
|
|
8924
|
+
if (w(L, D)) {
|
|
8925
|
+
if (g(E, L, D))
|
|
8883
8926
|
return L;
|
|
8884
|
-
|
|
8927
|
+
S === null && (E.idMap.has(L) || (S = L));
|
|
8885
8928
|
}
|
|
8886
|
-
if (
|
|
8929
|
+
if (S === null && O && w(L, O) && (T++, O = O.nextSibling, T >= 2 && (S = void 0)), E.activeElementAndParents.includes(L)) break;
|
|
8887
8930
|
L = L.nextSibling;
|
|
8888
8931
|
}
|
|
8889
|
-
return
|
|
8932
|
+
return S || null;
|
|
8890
8933
|
}
|
|
8891
|
-
function
|
|
8892
|
-
let
|
|
8893
|
-
if (!
|
|
8894
|
-
for (const O of
|
|
8895
|
-
if (
|
|
8934
|
+
function g(E, D, A) {
|
|
8935
|
+
let C = E.idMap.get(D), S = E.idMap.get(A);
|
|
8936
|
+
if (!S || !C) return !1;
|
|
8937
|
+
for (const O of C)
|
|
8938
|
+
if (S.has(O))
|
|
8896
8939
|
return !0;
|
|
8897
8940
|
return !1;
|
|
8898
8941
|
}
|
|
8899
|
-
function
|
|
8942
|
+
function w(E, D) {
|
|
8900
8943
|
const A = (
|
|
8901
8944
|
/** @type {Element} */
|
|
8902
|
-
|
|
8903
|
-
),
|
|
8945
|
+
E
|
|
8946
|
+
), C = (
|
|
8904
8947
|
/** @type {Element} */
|
|
8905
8948
|
D
|
|
8906
8949
|
);
|
|
8907
|
-
return A.nodeType ===
|
|
8950
|
+
return A.nodeType === C.nodeType && A.tagName === C.tagName && // If oldElt has an `id` with possible state and it doesn't match newElt.id then avoid morphing.
|
|
8908
8951
|
// We'll still match an anonymous node with an IDed newElt, though, because if it got this far,
|
|
8909
8952
|
// its not persistent, and new nodes can't have any hidden state.
|
|
8910
8953
|
// We can't use .id because of form input shadowing, and we can't count on .getAttribute's presence because it could be a document-fragment
|
|
8911
|
-
(!A.getAttribute?.("id") || A.getAttribute?.("id") ===
|
|
8954
|
+
(!A.getAttribute?.("id") || A.getAttribute?.("id") === C.getAttribute?.("id"));
|
|
8912
8955
|
}
|
|
8913
8956
|
return f;
|
|
8914
8957
|
})();
|
|
8915
|
-
function
|
|
8916
|
-
if (f.idMap.has(
|
|
8917
|
-
|
|
8958
|
+
function y(f, g) {
|
|
8959
|
+
if (f.idMap.has(g))
|
|
8960
|
+
_(f.pantry, g, null);
|
|
8918
8961
|
else {
|
|
8919
|
-
if (f.callbacks.beforeNodeRemoved(
|
|
8920
|
-
|
|
8962
|
+
if (f.callbacks.beforeNodeRemoved(g) === !1) return;
|
|
8963
|
+
g.parentNode?.removeChild(g), f.callbacks.afterNodeRemoved(g);
|
|
8921
8964
|
}
|
|
8922
8965
|
}
|
|
8923
|
-
function
|
|
8924
|
-
let
|
|
8925
|
-
for (;
|
|
8966
|
+
function h(f, g, w) {
|
|
8967
|
+
let E = g;
|
|
8968
|
+
for (; E && E !== w; ) {
|
|
8926
8969
|
let D = (
|
|
8927
8970
|
/** @type {Node} */
|
|
8928
|
-
|
|
8971
|
+
E
|
|
8929
8972
|
);
|
|
8930
|
-
|
|
8973
|
+
E = E.nextSibling, y(f, D);
|
|
8931
8974
|
}
|
|
8932
|
-
return
|
|
8975
|
+
return E;
|
|
8933
8976
|
}
|
|
8934
|
-
function
|
|
8977
|
+
function b(f, g, w, E) {
|
|
8935
8978
|
const D = (
|
|
8936
8979
|
/** @type {Element} - will always be found */
|
|
8937
8980
|
// ctx.target.id unsafe because of form input shadowing
|
|
8938
8981
|
// ctx.target could be a document fragment which doesn't have `getAttribute`
|
|
8939
|
-
|
|
8982
|
+
E.target.getAttribute?.("id") === g && E.target || E.target.querySelector(`[id="${g}"]`) || E.pantry.querySelector(`[id="${g}"]`)
|
|
8940
8983
|
);
|
|
8941
|
-
return
|
|
8984
|
+
return m(D, E), _(f, D, w), D;
|
|
8942
8985
|
}
|
|
8943
|
-
function
|
|
8944
|
-
const
|
|
8986
|
+
function m(f, g) {
|
|
8987
|
+
const w = (
|
|
8945
8988
|
/** @type {String} */
|
|
8946
8989
|
f.getAttribute("id")
|
|
8947
8990
|
);
|
|
8948
8991
|
for (; f = f.parentNode; ) {
|
|
8949
|
-
let
|
|
8950
|
-
|
|
8992
|
+
let E = g.idMap.get(f);
|
|
8993
|
+
E && (E.delete(w), E.size || g.idMap.delete(f));
|
|
8951
8994
|
}
|
|
8952
8995
|
}
|
|
8953
|
-
function
|
|
8996
|
+
function _(f, g, w) {
|
|
8954
8997
|
if (f.moveBefore)
|
|
8955
8998
|
try {
|
|
8956
|
-
f.moveBefore(
|
|
8999
|
+
f.moveBefore(g, w);
|
|
8957
9000
|
} catch {
|
|
8958
|
-
f.insertBefore(
|
|
9001
|
+
f.insertBefore(g, w);
|
|
8959
9002
|
}
|
|
8960
9003
|
else
|
|
8961
|
-
f.insertBefore(
|
|
9004
|
+
f.insertBefore(g, w);
|
|
8962
9005
|
}
|
|
8963
|
-
return
|
|
9006
|
+
return p;
|
|
8964
9007
|
})(), s = /* @__PURE__ */ (function() {
|
|
8965
|
-
function
|
|
8966
|
-
return f.ignoreActive &&
|
|
8967
|
-
|
|
9008
|
+
function p(m, _, f) {
|
|
9009
|
+
return f.ignoreActive && m === document.activeElement ? null : (f.callbacks.beforeNodeMorphed(m, _) === !1 || (m instanceof HTMLHeadElement && f.head.ignore || (m instanceof HTMLHeadElement && f.head.style !== "morph" ? l(
|
|
9010
|
+
m,
|
|
8968
9011
|
/** @type {HTMLHeadElement} */
|
|
8969
|
-
|
|
9012
|
+
_,
|
|
8970
9013
|
f
|
|
8971
|
-
) : (
|
|
9014
|
+
) : (x(m, _, f), b(m, f) || a(f, m, _))), f.callbacks.afterNodeMorphed(m, _)), m);
|
|
8972
9015
|
}
|
|
8973
|
-
function
|
|
8974
|
-
let
|
|
8975
|
-
if (
|
|
8976
|
-
const
|
|
9016
|
+
function x(m, _, f) {
|
|
9017
|
+
let g = _.nodeType;
|
|
9018
|
+
if (g === 1) {
|
|
9019
|
+
const w = (
|
|
8977
9020
|
/** @type {Element} */
|
|
8978
|
-
|
|
8979
|
-
),
|
|
9021
|
+
m
|
|
9022
|
+
), E = (
|
|
8980
9023
|
/** @type {Element} */
|
|
8981
|
-
|
|
8982
|
-
), D =
|
|
8983
|
-
for (const
|
|
8984
|
-
|
|
8985
|
-
for (let
|
|
8986
|
-
const
|
|
8987
|
-
if (
|
|
8988
|
-
if (
|
|
9024
|
+
_
|
|
9025
|
+
), D = w.attributes, A = E.attributes;
|
|
9026
|
+
for (const C of A)
|
|
9027
|
+
h(C.name, w, "update", f) || w.getAttribute(C.name) !== C.value && w.setAttribute(C.name, C.value);
|
|
9028
|
+
for (let C = D.length - 1; 0 <= C; C--) {
|
|
9029
|
+
const S = D[C];
|
|
9030
|
+
if (S && !E.hasAttribute(S.name)) {
|
|
9031
|
+
if (h(S.name, w, "remove", f))
|
|
8989
9032
|
continue;
|
|
8990
|
-
|
|
9033
|
+
w.removeAttribute(S.name);
|
|
8991
9034
|
}
|
|
8992
9035
|
}
|
|
8993
|
-
|
|
9036
|
+
b(w, f) || v(w, E, f);
|
|
8994
9037
|
}
|
|
8995
|
-
(
|
|
8996
|
-
}
|
|
8997
|
-
function v(
|
|
8998
|
-
if (
|
|
8999
|
-
let
|
|
9000
|
-
|
|
9001
|
-
} else if (
|
|
9002
|
-
|
|
9003
|
-
else if (
|
|
9004
|
-
let
|
|
9005
|
-
if (
|
|
9038
|
+
(g === 8 || g === 3) && m.nodeValue !== _.nodeValue && (m.nodeValue = _.nodeValue);
|
|
9039
|
+
}
|
|
9040
|
+
function v(m, _, f) {
|
|
9041
|
+
if (m instanceof HTMLInputElement && _ instanceof HTMLInputElement && _.type !== "file") {
|
|
9042
|
+
let g = _.value, w = m.value;
|
|
9043
|
+
y(m, _, "checked", f), y(m, _, "disabled", f), _.hasAttribute("value") ? w !== g && (h("value", m, "update", f) || (m.setAttribute("value", g), m.value = g)) : h("value", m, "remove", f) || (m.value = "", m.removeAttribute("value"));
|
|
9044
|
+
} else if (m instanceof HTMLOptionElement && _ instanceof HTMLOptionElement)
|
|
9045
|
+
y(m, _, "selected", f);
|
|
9046
|
+
else if (m instanceof HTMLTextAreaElement && _ instanceof HTMLTextAreaElement) {
|
|
9047
|
+
let g = _.value, w = m.value;
|
|
9048
|
+
if (h("value", m, "update", f))
|
|
9006
9049
|
return;
|
|
9007
|
-
|
|
9050
|
+
g !== w && (m.value = g), m.firstChild && m.firstChild.nodeValue !== g && (m.firstChild.nodeValue = g);
|
|
9008
9051
|
}
|
|
9009
9052
|
}
|
|
9010
|
-
function
|
|
9011
|
-
const
|
|
9012
|
-
if (
|
|
9013
|
-
const D =
|
|
9053
|
+
function y(m, _, f, g) {
|
|
9054
|
+
const w = _[f], E = m[f];
|
|
9055
|
+
if (w !== E) {
|
|
9056
|
+
const D = h(
|
|
9014
9057
|
f,
|
|
9015
|
-
|
|
9058
|
+
m,
|
|
9016
9059
|
"update",
|
|
9017
|
-
|
|
9060
|
+
g
|
|
9018
9061
|
);
|
|
9019
|
-
D || (
|
|
9062
|
+
D || (m[f] = _[f]), w ? D || m.setAttribute(f, "") : h(f, m, "remove", g) || m.removeAttribute(f);
|
|
9020
9063
|
}
|
|
9021
9064
|
}
|
|
9022
|
-
function m
|
|
9023
|
-
return
|
|
9065
|
+
function h(m, _, f, g) {
|
|
9066
|
+
return m === "value" && g.ignoreActiveValue && _ === document.activeElement ? !0 : g.callbacks.beforeAttributeUpdated(m, _, f) === !1;
|
|
9024
9067
|
}
|
|
9025
|
-
function
|
|
9026
|
-
return !!
|
|
9068
|
+
function b(m, _) {
|
|
9069
|
+
return !!_.ignoreActiveValue && m === document.activeElement && m !== document.body;
|
|
9027
9070
|
}
|
|
9028
|
-
return
|
|
9071
|
+
return p;
|
|
9029
9072
|
})();
|
|
9030
|
-
function o(
|
|
9031
|
-
if (
|
|
9032
|
-
const
|
|
9033
|
-
if (
|
|
9034
|
-
const
|
|
9035
|
-
return Promise.all(
|
|
9036
|
-
const
|
|
9073
|
+
function o(p, x, v, y) {
|
|
9074
|
+
if (p.head.block) {
|
|
9075
|
+
const h = x.querySelector("head"), b = v.querySelector("head");
|
|
9076
|
+
if (h && b) {
|
|
9077
|
+
const m = l(h, b, p);
|
|
9078
|
+
return Promise.all(m).then(() => {
|
|
9079
|
+
const _ = Object.assign(p, {
|
|
9037
9080
|
head: {
|
|
9038
9081
|
block: !1,
|
|
9039
9082
|
ignore: !0
|
|
9040
9083
|
}
|
|
9041
9084
|
});
|
|
9042
|
-
return
|
|
9085
|
+
return y(_);
|
|
9043
9086
|
});
|
|
9044
9087
|
}
|
|
9045
9088
|
}
|
|
9046
|
-
return
|
|
9089
|
+
return y(p);
|
|
9047
9090
|
}
|
|
9048
|
-
function l(
|
|
9049
|
-
let
|
|
9050
|
-
for (const
|
|
9051
|
-
|
|
9052
|
-
for (const
|
|
9053
|
-
let
|
|
9054
|
-
|
|
9091
|
+
function l(p, x, v) {
|
|
9092
|
+
let y = [], h = [], b = [], m = [], _ = /* @__PURE__ */ new Map();
|
|
9093
|
+
for (const g of x.children)
|
|
9094
|
+
_.set(g.outerHTML, g);
|
|
9095
|
+
for (const g of p.children) {
|
|
9096
|
+
let w = _.has(g.outerHTML), E = v.head.shouldReAppend(g), D = v.head.shouldPreserve(g);
|
|
9097
|
+
w || D ? E ? h.push(g) : (_.delete(g.outerHTML), b.push(g)) : v.head.style === "append" ? E && (h.push(g), m.push(g)) : v.head.shouldRemove(g) !== !1 && h.push(g);
|
|
9055
9098
|
}
|
|
9056
|
-
|
|
9099
|
+
m.push(..._.values());
|
|
9057
9100
|
let f = [];
|
|
9058
|
-
for (const
|
|
9059
|
-
let
|
|
9101
|
+
for (const g of m) {
|
|
9102
|
+
let w = (
|
|
9060
9103
|
/** @type {ChildNode} */
|
|
9061
|
-
document.createRange().createContextualFragment(
|
|
9104
|
+
document.createRange().createContextualFragment(g.outerHTML).firstChild
|
|
9062
9105
|
);
|
|
9063
|
-
if (v.callbacks.beforeNodeAdded(
|
|
9064
|
-
if ("href" in
|
|
9065
|
-
let
|
|
9066
|
-
|
|
9106
|
+
if (v.callbacks.beforeNodeAdded(w) !== !1) {
|
|
9107
|
+
if ("href" in w && w.href || "src" in w && w.src) {
|
|
9108
|
+
let E, D = new Promise(function(A) {
|
|
9109
|
+
E = A;
|
|
9067
9110
|
});
|
|
9068
|
-
|
|
9069
|
-
|
|
9111
|
+
w.addEventListener("load", function() {
|
|
9112
|
+
E();
|
|
9070
9113
|
}), f.push(D);
|
|
9071
9114
|
}
|
|
9072
|
-
|
|
9115
|
+
p.appendChild(w), v.callbacks.afterNodeAdded(w), y.push(w);
|
|
9073
9116
|
}
|
|
9074
9117
|
}
|
|
9075
|
-
for (const
|
|
9076
|
-
v.callbacks.beforeNodeRemoved(
|
|
9077
|
-
return v.head.afterHeadMorphed(
|
|
9078
|
-
added:
|
|
9079
|
-
kept:
|
|
9080
|
-
removed:
|
|
9118
|
+
for (const g of h)
|
|
9119
|
+
v.callbacks.beforeNodeRemoved(g) !== !1 && (p.removeChild(g), v.callbacks.afterNodeRemoved(g));
|
|
9120
|
+
return v.head.afterHeadMorphed(p, {
|
|
9121
|
+
added: y,
|
|
9122
|
+
kept: b,
|
|
9123
|
+
removed: h
|
|
9081
9124
|
}), f;
|
|
9082
9125
|
}
|
|
9083
9126
|
const c = /* @__PURE__ */ (function() {
|
|
9084
|
-
function
|
|
9085
|
-
const { persistentIds:
|
|
9086
|
-
if (!["innerHTML", "outerHTML"].includes(
|
|
9087
|
-
throw `Do not understand how to morph style ${
|
|
9127
|
+
function p(f, g, w) {
|
|
9128
|
+
const { persistentIds: E, idMap: D } = m(f, g), A = x(w), C = A.morphStyle || "outerHTML";
|
|
9129
|
+
if (!["innerHTML", "outerHTML"].includes(C))
|
|
9130
|
+
throw `Do not understand how to morph style ${C}`;
|
|
9088
9131
|
return {
|
|
9089
9132
|
target: f,
|
|
9090
|
-
newContent:
|
|
9133
|
+
newContent: g,
|
|
9091
9134
|
config: A,
|
|
9092
|
-
morphStyle:
|
|
9135
|
+
morphStyle: C,
|
|
9093
9136
|
ignoreActive: A.ignoreActive,
|
|
9094
9137
|
ignoreActiveValue: A.ignoreActiveValue,
|
|
9095
9138
|
restoreFocus: A.restoreFocus,
|
|
9096
9139
|
idMap: D,
|
|
9097
|
-
persistentIds:
|
|
9140
|
+
persistentIds: E,
|
|
9098
9141
|
pantry: v(),
|
|
9099
|
-
activeElementAndParents:
|
|
9142
|
+
activeElementAndParents: y(f),
|
|
9100
9143
|
callbacks: A.callbacks,
|
|
9101
9144
|
head: A.head
|
|
9102
9145
|
};
|
|
9103
9146
|
}
|
|
9104
|
-
function
|
|
9105
|
-
let
|
|
9106
|
-
return Object.assign(
|
|
9147
|
+
function x(f) {
|
|
9148
|
+
let g = Object.assign({}, t);
|
|
9149
|
+
return Object.assign(g, f), g.callbacks = Object.assign(
|
|
9107
9150
|
{},
|
|
9108
9151
|
t.callbacks,
|
|
9109
9152
|
f.callbacks
|
|
9110
|
-
),
|
|
9153
|
+
), g.head = Object.assign({}, t.head, f.head), g;
|
|
9111
9154
|
}
|
|
9112
9155
|
function v() {
|
|
9113
9156
|
const f = document.createElement("div");
|
|
9114
9157
|
return f.hidden = !0, document.body.insertAdjacentElement("afterend", f), f;
|
|
9115
9158
|
}
|
|
9116
|
-
function
|
|
9117
|
-
let
|
|
9118
|
-
if (
|
|
9119
|
-
for (;
|
|
9120
|
-
|
|
9121
|
-
return
|
|
9122
|
-
}
|
|
9123
|
-
function
|
|
9124
|
-
let
|
|
9125
|
-
return f.getAttribute?.("id") &&
|
|
9126
|
-
}
|
|
9127
|
-
function
|
|
9128
|
-
for (const D of
|
|
9159
|
+
function y(f) {
|
|
9160
|
+
let g = [], w = document.activeElement;
|
|
9161
|
+
if (w?.tagName !== "BODY" && f.contains(w))
|
|
9162
|
+
for (; w && (g.push(w), w !== f); )
|
|
9163
|
+
w = w.parentElement;
|
|
9164
|
+
return g;
|
|
9165
|
+
}
|
|
9166
|
+
function h(f) {
|
|
9167
|
+
let g = Array.from(f.querySelectorAll("[id]"));
|
|
9168
|
+
return f.getAttribute?.("id") && g.push(f), g;
|
|
9169
|
+
}
|
|
9170
|
+
function b(f, g, w, E) {
|
|
9171
|
+
for (const D of E) {
|
|
9129
9172
|
const A = (
|
|
9130
9173
|
/** @type {String} */
|
|
9131
9174
|
D.getAttribute("id")
|
|
9132
9175
|
);
|
|
9133
|
-
if (
|
|
9134
|
-
let
|
|
9135
|
-
for (;
|
|
9136
|
-
let
|
|
9137
|
-
if (
|
|
9138
|
-
|
|
9176
|
+
if (g.has(A)) {
|
|
9177
|
+
let C = D;
|
|
9178
|
+
for (; C; ) {
|
|
9179
|
+
let S = f.get(C);
|
|
9180
|
+
if (S == null && (S = /* @__PURE__ */ new Set(), f.set(C, S)), S.add(A), C === w) break;
|
|
9181
|
+
C = C.parentElement;
|
|
9139
9182
|
}
|
|
9140
9183
|
}
|
|
9141
9184
|
}
|
|
9142
9185
|
}
|
|
9143
|
-
function
|
|
9144
|
-
const
|
|
9186
|
+
function m(f, g) {
|
|
9187
|
+
const w = h(f), E = h(g), D = _(w, E);
|
|
9145
9188
|
let A = /* @__PURE__ */ new Map();
|
|
9146
|
-
|
|
9147
|
-
const
|
|
9148
|
-
return
|
|
9149
|
-
}
|
|
9150
|
-
function
|
|
9151
|
-
let
|
|
9152
|
-
for (const { id: A, tagName:
|
|
9153
|
-
|
|
9189
|
+
b(A, D, f, w);
|
|
9190
|
+
const C = g.__idiomorphRoot || g;
|
|
9191
|
+
return b(A, D, C, E), { persistentIds: D, idMap: A };
|
|
9192
|
+
}
|
|
9193
|
+
function _(f, g) {
|
|
9194
|
+
let w = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Map();
|
|
9195
|
+
for (const { id: A, tagName: C } of f)
|
|
9196
|
+
E.has(A) ? w.add(A) : E.set(A, C);
|
|
9154
9197
|
let D = /* @__PURE__ */ new Set();
|
|
9155
|
-
for (const { id: A, tagName:
|
|
9156
|
-
D.has(A) ?
|
|
9157
|
-
for (const A of
|
|
9198
|
+
for (const { id: A, tagName: C } of g)
|
|
9199
|
+
D.has(A) ? w.add(A) : E.get(A) === C && D.add(A);
|
|
9200
|
+
for (const A of w)
|
|
9158
9201
|
D.delete(A);
|
|
9159
9202
|
return D;
|
|
9160
9203
|
}
|
|
9161
|
-
return
|
|
9204
|
+
return p;
|
|
9162
9205
|
})(), { normalizeElement: u, normalizeParent: d } = /* @__PURE__ */ (function() {
|
|
9163
|
-
const
|
|
9164
|
-
function b
|
|
9165
|
-
return
|
|
9206
|
+
const p = /* @__PURE__ */ new WeakSet();
|
|
9207
|
+
function x(b) {
|
|
9208
|
+
return b instanceof Document ? b.documentElement : b;
|
|
9166
9209
|
}
|
|
9167
|
-
function v(
|
|
9168
|
-
if (
|
|
9210
|
+
function v(b) {
|
|
9211
|
+
if (b == null)
|
|
9169
9212
|
return document.createElement("div");
|
|
9170
|
-
if (typeof
|
|
9171
|
-
return v(
|
|
9172
|
-
if (
|
|
9213
|
+
if (typeof b == "string")
|
|
9214
|
+
return v(h(b));
|
|
9215
|
+
if (p.has(
|
|
9173
9216
|
/** @type {Element} */
|
|
9174
|
-
|
|
9217
|
+
b
|
|
9175
9218
|
))
|
|
9176
9219
|
return (
|
|
9177
9220
|
/** @type {Element} */
|
|
9178
|
-
|
|
9221
|
+
b
|
|
9179
9222
|
);
|
|
9180
|
-
if (
|
|
9181
|
-
if (
|
|
9223
|
+
if (b instanceof Node) {
|
|
9224
|
+
if (b.parentNode)
|
|
9182
9225
|
return (
|
|
9183
9226
|
/** @type {any} */
|
|
9184
|
-
new
|
|
9227
|
+
new y(b)
|
|
9185
9228
|
);
|
|
9186
9229
|
{
|
|
9187
|
-
const
|
|
9188
|
-
return
|
|
9230
|
+
const m = document.createElement("div");
|
|
9231
|
+
return m.append(b), m;
|
|
9189
9232
|
}
|
|
9190
9233
|
} else {
|
|
9191
|
-
const
|
|
9192
|
-
for (const
|
|
9193
|
-
|
|
9194
|
-
return
|
|
9234
|
+
const m = document.createElement("div");
|
|
9235
|
+
for (const _ of [...b])
|
|
9236
|
+
m.append(_);
|
|
9237
|
+
return m;
|
|
9195
9238
|
}
|
|
9196
9239
|
}
|
|
9197
|
-
class
|
|
9240
|
+
class y {
|
|
9198
9241
|
/** @param {Node} node */
|
|
9199
|
-
constructor(
|
|
9200
|
-
this.originalNode =
|
|
9201
|
-
|
|
9242
|
+
constructor(m) {
|
|
9243
|
+
this.originalNode = m, this.realParentNode = /** @type {Element} */
|
|
9244
|
+
m.parentNode, this.previousSibling = m.previousSibling, this.nextSibling = m.nextSibling;
|
|
9202
9245
|
}
|
|
9203
9246
|
/** @returns {Node[]} */
|
|
9204
9247
|
get childNodes() {
|
|
9205
|
-
const
|
|
9206
|
-
let
|
|
9207
|
-
for (;
|
|
9208
|
-
|
|
9209
|
-
return
|
|
9248
|
+
const m = [];
|
|
9249
|
+
let _ = this.previousSibling ? this.previousSibling.nextSibling : this.realParentNode.firstChild;
|
|
9250
|
+
for (; _ && _ != this.nextSibling; )
|
|
9251
|
+
m.push(_), _ = _.nextSibling;
|
|
9252
|
+
return m;
|
|
9210
9253
|
}
|
|
9211
9254
|
/**
|
|
9212
9255
|
* @param {string} selector
|
|
9213
9256
|
* @returns {Element[]}
|
|
9214
9257
|
*/
|
|
9215
|
-
querySelectorAll(
|
|
9258
|
+
querySelectorAll(m) {
|
|
9216
9259
|
return this.childNodes.reduce(
|
|
9217
|
-
(
|
|
9260
|
+
(_, f) => {
|
|
9218
9261
|
if (f instanceof Element) {
|
|
9219
|
-
f.matches(
|
|
9220
|
-
const
|
|
9221
|
-
for (let
|
|
9222
|
-
|
|
9262
|
+
f.matches(m) && _.push(f);
|
|
9263
|
+
const g = f.querySelectorAll(m);
|
|
9264
|
+
for (let w = 0; w < g.length; w++)
|
|
9265
|
+
_.push(g[w]);
|
|
9223
9266
|
}
|
|
9224
|
-
return
|
|
9267
|
+
return _;
|
|
9225
9268
|
},
|
|
9226
9269
|
/** @type {Element[]} */
|
|
9227
9270
|
[]
|
|
@@ -9232,16 +9275,16 @@ var htmx = (function() {
|
|
|
9232
9275
|
* @param {Node} referenceNode
|
|
9233
9276
|
* @returns {Node}
|
|
9234
9277
|
*/
|
|
9235
|
-
insertBefore(
|
|
9236
|
-
return this.realParentNode.insertBefore(
|
|
9278
|
+
insertBefore(m, _) {
|
|
9279
|
+
return this.realParentNode.insertBefore(m, _);
|
|
9237
9280
|
}
|
|
9238
9281
|
/**
|
|
9239
9282
|
* @param {Node} node
|
|
9240
9283
|
* @param {Node} referenceNode
|
|
9241
9284
|
* @returns {Node}
|
|
9242
9285
|
*/
|
|
9243
|
-
moveBefore(
|
|
9244
|
-
return this.realParentNode.moveBefore(
|
|
9286
|
+
moveBefore(m, _) {
|
|
9287
|
+
return this.realParentNode.moveBefore(m, _);
|
|
9245
9288
|
}
|
|
9246
9289
|
/**
|
|
9247
9290
|
* for later use with populateIdMapWithTree to halt upwards iteration
|
|
@@ -9251,31 +9294,31 @@ var htmx = (function() {
|
|
|
9251
9294
|
return this.originalNode;
|
|
9252
9295
|
}
|
|
9253
9296
|
}
|
|
9254
|
-
function
|
|
9255
|
-
let
|
|
9297
|
+
function h(b) {
|
|
9298
|
+
let m = new DOMParser(), _ = b.replace(
|
|
9256
9299
|
/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,
|
|
9257
9300
|
""
|
|
9258
9301
|
);
|
|
9259
|
-
if (
|
|
9260
|
-
let f =
|
|
9261
|
-
if (
|
|
9262
|
-
return
|
|
9302
|
+
if (_.match(/<\/html>/) || _.match(/<\/head>/) || _.match(/<\/body>/)) {
|
|
9303
|
+
let f = m.parseFromString(b, "text/html");
|
|
9304
|
+
if (_.match(/<\/html>/))
|
|
9305
|
+
return p.add(f), f;
|
|
9263
9306
|
{
|
|
9264
|
-
let
|
|
9265
|
-
return
|
|
9307
|
+
let g = f.firstChild;
|
|
9308
|
+
return g && p.add(g), g;
|
|
9266
9309
|
}
|
|
9267
9310
|
} else {
|
|
9268
|
-
let
|
|
9311
|
+
let g = (
|
|
9269
9312
|
/** @type {HTMLTemplateElement} */
|
|
9270
|
-
|
|
9271
|
-
"<body><template>" +
|
|
9313
|
+
m.parseFromString(
|
|
9314
|
+
"<body><template>" + b + "</template></body>",
|
|
9272
9315
|
"text/html"
|
|
9273
9316
|
).body.querySelector("template").content
|
|
9274
9317
|
);
|
|
9275
|
-
return
|
|
9318
|
+
return p.add(g), g;
|
|
9276
9319
|
}
|
|
9277
9320
|
}
|
|
9278
|
-
return { normalizeElement:
|
|
9321
|
+
return { normalizeElement: x, normalizeParent: v };
|
|
9279
9322
|
})();
|
|
9280
9323
|
return {
|
|
9281
9324
|
morph: n,
|