@arabold/docs-mcp-server 1.27.1 → 1.29.0
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 +6 -6
- package/dist/assets/main.css +1 -1
- package/dist/assets/main.js +357 -187
- package/dist/assets/main.js.map +1 -1
- package/dist/index.js +10358 -9449
- package/dist/index.js.map +1 -1
- package/package.json +46 -39
- package/public/assets/main.css +1 -1
- package/public/assets/main.js +357 -187
- package/public/assets/main.js.map +1 -1
package/dist/assets/main.js
CHANGED
|
@@ -257,7 +257,14 @@ function tryCatch(e, t, n, ...i) {
|
|
|
257
257
|
handleError(r, e, t);
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
function handleError(e
|
|
260
|
+
function handleError(...e) {
|
|
261
|
+
return errorHandler(...e);
|
|
262
|
+
}
|
|
263
|
+
var errorHandler = normalErrorHandler;
|
|
264
|
+
function setErrorHandler(e) {
|
|
265
|
+
errorHandler = e;
|
|
266
|
+
}
|
|
267
|
+
function normalErrorHandler(e, t, n = void 0) {
|
|
261
268
|
e = Object.assign(
|
|
262
269
|
e ?? { message: "No error message given." },
|
|
263
270
|
{ el: t, expression: n }
|
|
@@ -295,9 +302,9 @@ function normalEvaluator(e, t) {
|
|
|
295
302
|
}
|
|
296
303
|
function generateEvaluatorFromFunction(e, t) {
|
|
297
304
|
return (n = () => {
|
|
298
|
-
}, { scope: i = {}, params: r = [] } = {}) => {
|
|
299
|
-
let
|
|
300
|
-
runIfTypeOfFunction(n,
|
|
305
|
+
}, { scope: i = {}, params: r = [], context: a } = {}) => {
|
|
306
|
+
let s = t.apply(mergeProxies([i, ...e]), r);
|
|
307
|
+
runIfTypeOfFunction(n, s);
|
|
301
308
|
};
|
|
302
309
|
}
|
|
303
310
|
var evaluatorMemo = {};
|
|
@@ -323,14 +330,14 @@ function generateFunctionFromString(e, t) {
|
|
|
323
330
|
function generateEvaluatorFromString(e, t, n) {
|
|
324
331
|
let i = generateFunctionFromString(t, n);
|
|
325
332
|
return (r = () => {
|
|
326
|
-
}, { scope: a = {}, params: s = [] } = {}) => {
|
|
333
|
+
}, { scope: a = {}, params: s = [], context: o } = {}) => {
|
|
327
334
|
i.result = void 0, i.finished = !1;
|
|
328
|
-
let
|
|
335
|
+
let l = mergeProxies([a, ...e]);
|
|
329
336
|
if (typeof i == "function") {
|
|
330
|
-
let
|
|
331
|
-
i.finished ? (runIfTypeOfFunction(r, i.result,
|
|
332
|
-
runIfTypeOfFunction(r,
|
|
333
|
-
}).catch((
|
|
337
|
+
let c = i.call(o, i, l).catch((u) => handleError(u, n, t));
|
|
338
|
+
i.finished ? (runIfTypeOfFunction(r, i.result, l, s, n), i.result = void 0) : c.then((u) => {
|
|
339
|
+
runIfTypeOfFunction(r, u, l, s, n);
|
|
340
|
+
}).catch((u) => handleError(u, n, t)).finally(() => i.result = void 0);
|
|
334
341
|
}
|
|
335
342
|
};
|
|
336
343
|
}
|
|
@@ -975,9 +982,9 @@ function isRadio(e) {
|
|
|
975
982
|
return e.type === "radio" || e.localName === "ui-radio";
|
|
976
983
|
}
|
|
977
984
|
function debounce$1(e, t) {
|
|
978
|
-
|
|
985
|
+
let n;
|
|
979
986
|
return function() {
|
|
980
|
-
|
|
987
|
+
const i = this, r = arguments, a = function() {
|
|
981
988
|
n = null, e.apply(i, r);
|
|
982
989
|
};
|
|
983
990
|
clearTimeout(n), n = setTimeout(a, t);
|
|
@@ -1077,7 +1084,7 @@ var Alpine = {
|
|
|
1077
1084
|
get raw() {
|
|
1078
1085
|
return raw;
|
|
1079
1086
|
},
|
|
1080
|
-
version: "3.
|
|
1087
|
+
version: "3.15.2",
|
|
1081
1088
|
flushAndStopDeferringMutations,
|
|
1082
1089
|
dontAutoEvaluateFunctions,
|
|
1083
1090
|
disableEffectScheduling,
|
|
@@ -1091,6 +1098,7 @@ var Alpine = {
|
|
|
1091
1098
|
onlyDuringClone,
|
|
1092
1099
|
addRootSelector,
|
|
1093
1100
|
addInitSelector,
|
|
1101
|
+
setErrorHandler,
|
|
1094
1102
|
interceptClone,
|
|
1095
1103
|
addScopeToNode,
|
|
1096
1104
|
deferMutations,
|
|
@@ -1481,7 +1489,7 @@ function createInstrumentations() {
|
|
|
1481
1489
|
i
|
|
1482
1490
|
];
|
|
1483
1491
|
}
|
|
1484
|
-
var [mutableInstrumentations, readonlyInstrumentations
|
|
1492
|
+
var [mutableInstrumentations, readonlyInstrumentations] = /* @__PURE__ */ createInstrumentations();
|
|
1485
1493
|
function createInstrumentationGetter(e, t) {
|
|
1486
1494
|
const n = e ? readonlyInstrumentations : mutableInstrumentations;
|
|
1487
1495
|
return (i, r, a) => r === "__v_isReactive" ? !e : r === "__v_isReadonly" ? e : r === "__v_raw" ? i : Reflect.get(hasOwn(n, r) && r in i ? n : i, r, a);
|
|
@@ -1718,7 +1726,7 @@ function isClickEvent(e) {
|
|
|
1718
1726
|
return ["contextmenu", "click", "mouse"].some((t) => e.includes(t));
|
|
1719
1727
|
}
|
|
1720
1728
|
function isListeningForASpecificKeyThatHasntBeenPressed(e, t) {
|
|
1721
|
-
let n = t.filter((a) => !["window", "document", "prevent", "stop", "once", "capture", "self", "away", "outside", "passive"].includes(a));
|
|
1729
|
+
let n = t.filter((a) => !["window", "document", "prevent", "stop", "once", "capture", "self", "away", "outside", "passive", "preserve-scroll"].includes(a));
|
|
1722
1730
|
if (n.includes("debounce")) {
|
|
1723
1731
|
let a = n.indexOf("debounce");
|
|
1724
1732
|
n.splice(a, isNumeric((n[a + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1);
|
|
@@ -1777,8 +1785,7 @@ directive("model", (e, { modifiers: t, expression: n }, { effect: i, cleanup: r
|
|
|
1777
1785
|
typeof n == "string" && e.type === "radio" && mutateDom(() => {
|
|
1778
1786
|
e.hasAttribute("name") || e.setAttribute("name", n);
|
|
1779
1787
|
});
|
|
1780
|
-
|
|
1781
|
-
let d = isCloning ? () => {
|
|
1788
|
+
let u = e.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(e.type) || t.includes("lazy") ? "change" : "input", d = isCloning ? () => {
|
|
1782
1789
|
} : on(e, u, t, (f) => {
|
|
1783
1790
|
c(getInputValue(e, t, f, l()));
|
|
1784
1791
|
});
|
|
@@ -2009,9 +2016,9 @@ function loop(e, t, n, i) {
|
|
|
2009
2016
|
let [y, _] = d[h], b = y === "template" ? a : o[y];
|
|
2010
2017
|
b._x_currentIfEl && (b = b._x_currentIfEl);
|
|
2011
2018
|
let m = c[_], w = u[_], E = document.importNode(a.content, !0).firstElementChild, x = reactive(m);
|
|
2012
|
-
addScopeToNode(E, x, a), E._x_refreshXForScope = (
|
|
2013
|
-
Object.entries(
|
|
2014
|
-
x[
|
|
2019
|
+
addScopeToNode(E, x, a), E._x_refreshXForScope = (S) => {
|
|
2020
|
+
Object.entries(S).forEach(([A, D]) => {
|
|
2021
|
+
x[A] = D;
|
|
2015
2022
|
});
|
|
2016
2023
|
}, mutateDom(() => {
|
|
2017
2024
|
b.after(E), skipDuringClone(() => initTree(E))();
|
|
@@ -2175,8 +2182,8 @@ var __assign$d = function() {
|
|
|
2175
2182
|
}, __assign$d.apply(this, arguments);
|
|
2176
2183
|
}, Default$d = {
|
|
2177
2184
|
alwaysOpen: !1,
|
|
2178
|
-
activeClasses: "bg-
|
|
2179
|
-
inactiveClasses: "
|
|
2185
|
+
activeClasses: "bg-neutral-secondary-medium text-heading",
|
|
2186
|
+
inactiveClasses: "bg-neutral-primary text-body",
|
|
2180
2187
|
onOpen: function() {
|
|
2181
2188
|
},
|
|
2182
2189
|
onClose: function() {
|
|
@@ -2702,8 +2709,8 @@ var toPaddingObject = function(t, n) {
|
|
|
2702
2709
|
function arrow(e) {
|
|
2703
2710
|
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";
|
|
2704
2711
|
if (!(!a || !s)) {
|
|
2705
|
-
var d = toPaddingObject(r.padding, n), f = getLayoutRect(a), p = l === "y" ? top : left, g = l === "y" ? bottom : right, v = n.rects.reference[u] + n.rects.reference[l] - s[l] - n.rects.popper[u], h = s[l] - n.rects.reference[l], y = getOffsetParent(a), _ = y ? l === "y" ? y.clientHeight || 0 : y.clientWidth || 0 : 0, b = v / 2 - h / 2, m = d[p], w = _ - f[u] - d[g], E = _ / 2 - f[u] / 2 + b, x = within(m, E, w),
|
|
2706
|
-
n.modifiersData[i] = (t = {}, t[
|
|
2712
|
+
var d = toPaddingObject(r.padding, n), f = getLayoutRect(a), p = l === "y" ? top : left, g = l === "y" ? bottom : right, v = n.rects.reference[u] + n.rects.reference[l] - s[l] - n.rects.popper[u], h = s[l] - n.rects.reference[l], y = getOffsetParent(a), _ = y ? l === "y" ? y.clientHeight || 0 : y.clientWidth || 0 : 0, b = v / 2 - h / 2, m = d[p], w = _ - f[u] - d[g], E = _ / 2 - f[u] / 2 + b, x = within(m, E, w), S = l;
|
|
2713
|
+
n.modifiersData[i] = (t = {}, t[S] = x, t.centerOffset = x - E, t);
|
|
2707
2714
|
}
|
|
2708
2715
|
}
|
|
2709
2716
|
function effect$1(e) {
|
|
@@ -2746,34 +2753,34 @@ function mapToStyles(e) {
|
|
|
2746
2753
|
p = h.x, v = h.y;
|
|
2747
2754
|
var y = s.hasOwnProperty("x"), _ = s.hasOwnProperty("y"), b = left, m = top, w = window;
|
|
2748
2755
|
if (c) {
|
|
2749
|
-
var E = getOffsetParent(n), x = "clientHeight",
|
|
2750
|
-
if (E === getWindow(n) && (E = getDocumentElement(n), getComputedStyle$1(E).position !== "static" && o === "absolute" && (x = "scrollHeight",
|
|
2756
|
+
var E = getOffsetParent(n), x = "clientHeight", S = "clientWidth";
|
|
2757
|
+
if (E === getWindow(n) && (E = getDocumentElement(n), getComputedStyle$1(E).position !== "static" && o === "absolute" && (x = "scrollHeight", S = "scrollWidth")), E = E, r === top || (r === left || r === right) && a === end) {
|
|
2751
2758
|
m = bottom;
|
|
2752
|
-
var
|
|
2759
|
+
var A = d && E === w && w.visualViewport ? w.visualViewport.height : (
|
|
2753
2760
|
// $FlowFixMe[prop-missing]
|
|
2754
2761
|
E[x]
|
|
2755
2762
|
);
|
|
2756
|
-
v -=
|
|
2763
|
+
v -= A - i.height, v *= l ? 1 : -1;
|
|
2757
2764
|
}
|
|
2758
2765
|
if (r === left || (r === top || r === bottom) && a === end) {
|
|
2759
2766
|
b = right;
|
|
2760
|
-
var
|
|
2767
|
+
var D = d && E === w && w.visualViewport ? w.visualViewport.width : (
|
|
2761
2768
|
// $FlowFixMe[prop-missing]
|
|
2762
|
-
E[
|
|
2769
|
+
E[S]
|
|
2763
2770
|
);
|
|
2764
|
-
p -=
|
|
2771
|
+
p -= D - i.width, p *= l ? 1 : -1;
|
|
2765
2772
|
}
|
|
2766
2773
|
}
|
|
2767
2774
|
var O = Object.assign({
|
|
2768
2775
|
position: o
|
|
2769
|
-
}, c && unsetSides),
|
|
2776
|
+
}, c && unsetSides), H = u === !0 ? roundOffsetsByDPR({
|
|
2770
2777
|
x: p,
|
|
2771
2778
|
y: v
|
|
2772
2779
|
}, getWindow(n)) : {
|
|
2773
2780
|
x: p,
|
|
2774
2781
|
y: v
|
|
2775
2782
|
};
|
|
2776
|
-
if (p =
|
|
2783
|
+
if (p = H.x, v = H.y, l) {
|
|
2777
2784
|
var T;
|
|
2778
2785
|
return Object.assign({}, O, (T = {}, T[m] = _ ? "0" : "", T[b] = y ? "0" : "", T.transform = (w.devicePixelRatio || 1) <= 1 ? "translate(" + p + "px, " + v + "px)" : "translate3d(" + p + "px, " + v + "px, 0)", T));
|
|
2779
2786
|
}
|
|
@@ -2981,20 +2988,20 @@ function detectOverflow(e, t) {
|
|
|
2981
2988
|
reference: E,
|
|
2982
2989
|
element: b,
|
|
2983
2990
|
placement: r
|
|
2984
|
-
}),
|
|
2985
|
-
top: w.top -
|
|
2986
|
-
bottom:
|
|
2987
|
-
left: w.left -
|
|
2988
|
-
right:
|
|
2991
|
+
}), S = rectToClientRect(Object.assign({}, b, x)), A = f === popper ? S : E, D = {
|
|
2992
|
+
top: w.top - A.top + y.top,
|
|
2993
|
+
bottom: A.bottom - w.bottom + y.bottom,
|
|
2994
|
+
left: w.left - A.left + y.left,
|
|
2995
|
+
right: A.right - w.right + y.right
|
|
2989
2996
|
}, O = e.modifiersData.offset;
|
|
2990
2997
|
if (f === popper && O) {
|
|
2991
|
-
var
|
|
2992
|
-
Object.keys(
|
|
2998
|
+
var H = O[r];
|
|
2999
|
+
Object.keys(D).forEach(function(T) {
|
|
2993
3000
|
var F = [right, bottom].indexOf(T) >= 0 ? 1 : -1, I = [top, bottom].indexOf(T) >= 0 ? "y" : "x";
|
|
2994
|
-
|
|
3001
|
+
D[T] += H[I] * F;
|
|
2995
3002
|
});
|
|
2996
3003
|
}
|
|
2997
|
-
return
|
|
3004
|
+
return D;
|
|
2998
3005
|
}
|
|
2999
3006
|
function computeAutoPlacement(e, t) {
|
|
3000
3007
|
t === void 0 && (t = {});
|
|
@@ -3034,40 +3041,40 @@ function flip(e) {
|
|
|
3034
3041
|
flipVariations: g,
|
|
3035
3042
|
allowedAutoPlacements: v
|
|
3036
3043
|
}) : B);
|
|
3037
|
-
}, []), w = t.rects.reference, E = t.rects.popper, x = /* @__PURE__ */ new Map(),
|
|
3038
|
-
var O = m[
|
|
3044
|
+
}, []), w = t.rects.reference, E = t.rects.popper, x = /* @__PURE__ */ new Map(), S = !0, A = m[0], D = 0; D < m.length; D++) {
|
|
3045
|
+
var O = m[D], H = getBasePlacement(O), T = getVariation(O) === start, F = [top, bottom].indexOf(H) >= 0, I = F ? "width" : "height", R = detectOverflow(t, {
|
|
3039
3046
|
placement: O,
|
|
3040
3047
|
boundary: u,
|
|
3041
3048
|
rootBoundary: d,
|
|
3042
3049
|
altBoundary: f,
|
|
3043
3050
|
padding: c
|
|
3044
|
-
}),
|
|
3045
|
-
w[I] > E[I] && (
|
|
3046
|
-
var W = getOppositePlacement(
|
|
3047
|
-
if (a && $.push(R[
|
|
3051
|
+
}), k = F ? T ? right : left : T ? bottom : top;
|
|
3052
|
+
w[I] > E[I] && (k = getOppositePlacement(k));
|
|
3053
|
+
var W = getOppositePlacement(k), $ = [];
|
|
3054
|
+
if (a && $.push(R[H] <= 0), o && $.push(R[k] <= 0, R[W] <= 0), $.every(function(V) {
|
|
3048
3055
|
return V;
|
|
3049
3056
|
})) {
|
|
3050
|
-
|
|
3057
|
+
A = O, S = !1;
|
|
3051
3058
|
break;
|
|
3052
3059
|
}
|
|
3053
3060
|
x.set(O, $);
|
|
3054
3061
|
}
|
|
3055
|
-
if (
|
|
3062
|
+
if (S)
|
|
3056
3063
|
for (var q = g ? 3 : 1, N = function(B) {
|
|
3057
|
-
var
|
|
3058
|
-
var
|
|
3059
|
-
if (
|
|
3060
|
-
return
|
|
3064
|
+
var C = m.find(function(L) {
|
|
3065
|
+
var M = x.get(L);
|
|
3066
|
+
if (M)
|
|
3067
|
+
return M.slice(0, B).every(function(K) {
|
|
3061
3068
|
return K;
|
|
3062
3069
|
});
|
|
3063
3070
|
});
|
|
3064
|
-
if (
|
|
3065
|
-
return
|
|
3071
|
+
if (C)
|
|
3072
|
+
return A = C, "break";
|
|
3066
3073
|
}, P = q; P > 0; P--) {
|
|
3067
3074
|
var j = N(P);
|
|
3068
3075
|
if (j === "break") break;
|
|
3069
3076
|
}
|
|
3070
|
-
t.placement !==
|
|
3077
|
+
t.placement !== A && (t.modifiersData[i]._skip = !0, t.placement = A, t.reset = !0);
|
|
3071
3078
|
}
|
|
3072
3079
|
}
|
|
3073
3080
|
const flip$1 = {
|
|
@@ -3168,31 +3175,31 @@ function preventOverflow(e) {
|
|
|
3168
3175
|
rootBoundary: c,
|
|
3169
3176
|
padding: d,
|
|
3170
3177
|
altBoundary: u
|
|
3171
|
-
}), y = getBasePlacement(t.placement), _ = getVariation(t.placement), b = !_, m = getMainAxisFromPlacement(y), w = getAltAxis(m), E = t.modifiersData.popperOffsets, x = t.rects.reference,
|
|
3178
|
+
}), y = getBasePlacement(t.placement), _ = getVariation(t.placement), b = !_, m = getMainAxisFromPlacement(y), w = getAltAxis(m), E = t.modifiersData.popperOffsets, x = t.rects.reference, S = t.rects.popper, A = typeof v == "function" ? v(Object.assign({}, t.rects, {
|
|
3172
3179
|
placement: t.placement
|
|
3173
|
-
})) : v,
|
|
3174
|
-
mainAxis:
|
|
3175
|
-
altAxis:
|
|
3180
|
+
})) : v, D = typeof A == "number" ? {
|
|
3181
|
+
mainAxis: A,
|
|
3182
|
+
altAxis: A
|
|
3176
3183
|
} : Object.assign({
|
|
3177
3184
|
mainAxis: 0,
|
|
3178
3185
|
altAxis: 0
|
|
3179
|
-
},
|
|
3186
|
+
}, A), O = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, H = {
|
|
3180
3187
|
x: 0,
|
|
3181
3188
|
y: 0
|
|
3182
3189
|
};
|
|
3183
3190
|
if (E) {
|
|
3184
3191
|
if (a) {
|
|
3185
|
-
var T, F = m === "y" ? top : left, I = m === "y" ? bottom : right, R = m === "y" ? "height" : "width",
|
|
3192
|
+
var T, F = m === "y" ? top : left, I = m === "y" ? bottom : right, R = m === "y" ? "height" : "width", k = E[m], W = k + h[F], $ = k - h[I], q = p ? -S[R] / 2 : 0, N = _ === start ? x[R] : S[R], P = _ === start ? -S[R] : -x[R], j = t.elements.arrow, V = p && j ? getLayoutRect(j) : {
|
|
3186
3193
|
width: 0,
|
|
3187
3194
|
height: 0
|
|
3188
|
-
}, B = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : getFreshSideObject(),
|
|
3189
|
-
E[m] = G,
|
|
3195
|
+
}, B = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : getFreshSideObject(), C = B[F], L = B[I], M = within(0, x[R], V[R]), K = b ? x[R] / 2 - q - M - C - D.mainAxis : N - M - C - D.mainAxis, ae = b ? -x[R] / 2 + q + M + L + D.mainAxis : P + M + L + D.mainAxis, Y = t.elements.arrow && getOffsetParent(t.elements.arrow), se = Y ? m === "y" ? Y.clientTop || 0 : Y.clientLeft || 0 : 0, J = (T = O?.[m]) != null ? T : 0, oe = k + K - J - se, le = k + ae - J, G = within(p ? min(W, oe) : W, k, p ? max($, le) : $);
|
|
3196
|
+
E[m] = G, H[m] = G - k;
|
|
3190
3197
|
}
|
|
3191
3198
|
if (o) {
|
|
3192
|
-
var Z, ce = m === "x" ? top : left, ue = m === "x" ? bottom : right, z = E[w], U = w === "y" ? "height" : "width", Q = z + h[ce], ee = z - h[ue], X = [top, left].indexOf(y) !== -1, te = (Z = O?.[w]) != null ? Z : 0, ne = X ? Q : z - x[U] -
|
|
3193
|
-
E[w] = re,
|
|
3199
|
+
var Z, ce = m === "x" ? top : left, ue = m === "x" ? bottom : right, z = E[w], U = w === "y" ? "height" : "width", Q = z + h[ce], ee = z - h[ue], X = [top, left].indexOf(y) !== -1, te = (Z = O?.[w]) != null ? Z : 0, ne = X ? Q : z - x[U] - S[U] - te + D.altAxis, ie = X ? z + x[U] + S[U] - te - D.altAxis : ee, re = p && X ? withinMaxClamp(ne, z, ie) : within(p ? ne : Q, z, p ? ie : ee);
|
|
3200
|
+
E[w] = re, H[w] = re - z;
|
|
3194
3201
|
}
|
|
3195
|
-
t.modifiersData[i] =
|
|
3202
|
+
t.modifiersData[i] = H;
|
|
3196
3203
|
}
|
|
3197
3204
|
}
|
|
3198
3205
|
const preventOverflow$1 = {
|
|
@@ -3334,19 +3341,19 @@ function popperGenerator(e) {
|
|
|
3334
3341
|
u.rects = {
|
|
3335
3342
|
reference: getCompositeRect(_, getOffsetParent(b), u.options.strategy === "fixed"),
|
|
3336
3343
|
popper: getLayoutRect(b)
|
|
3337
|
-
}, u.reset = !1, u.placement = u.options.placement, u.orderedModifiers.forEach(function(
|
|
3338
|
-
return u.modifiersData[
|
|
3344
|
+
}, u.reset = !1, u.placement = u.options.placement, u.orderedModifiers.forEach(function(D) {
|
|
3345
|
+
return u.modifiersData[D.name] = Object.assign({}, D.data);
|
|
3339
3346
|
});
|
|
3340
3347
|
for (var m = 0; m < u.orderedModifiers.length; m++) {
|
|
3341
3348
|
if (u.reset === !0) {
|
|
3342
3349
|
u.reset = !1, m = -1;
|
|
3343
3350
|
continue;
|
|
3344
3351
|
}
|
|
3345
|
-
var w = u.orderedModifiers[m], E = w.fn, x = w.options,
|
|
3352
|
+
var w = u.orderedModifiers[m], E = w.fn, x = w.options, S = x === void 0 ? {} : x, A = w.name;
|
|
3346
3353
|
typeof E == "function" && (u = E({
|
|
3347
3354
|
state: u,
|
|
3348
|
-
options:
|
|
3349
|
-
name:
|
|
3355
|
+
options: S,
|
|
3356
|
+
name: A,
|
|
3350
3357
|
instance: p
|
|
3351
3358
|
}) || u);
|
|
3352
3359
|
}
|
|
@@ -3574,7 +3581,7 @@ var __assign$8 = function() {
|
|
|
3574
3581
|
}, __assign$8.apply(this, arguments);
|
|
3575
3582
|
}, Default$8 = {
|
|
3576
3583
|
placement: "center",
|
|
3577
|
-
backdropClasses: "bg-
|
|
3584
|
+
backdropClasses: "bg-dark-backdrop/70 fixed inset-0 z-40",
|
|
3578
3585
|
backdrop: "dynamic",
|
|
3579
3586
|
closable: !0,
|
|
3580
3587
|
onHide: function() {
|
|
@@ -3746,7 +3753,7 @@ var __assign$7 = function() {
|
|
|
3746
3753
|
backdrop: !0,
|
|
3747
3754
|
edge: !1,
|
|
3748
3755
|
edgeOffset: "bottom-[60px]",
|
|
3749
|
-
backdropClasses: "bg-
|
|
3756
|
+
backdropClasses: "bg-dark-backdrop/70 fixed inset-0 z-30",
|
|
3750
3757
|
onShow: function() {
|
|
3751
3758
|
},
|
|
3752
3759
|
onHide: function() {
|
|
@@ -3939,8 +3946,8 @@ var __assign$6 = function() {
|
|
|
3939
3946
|
}, __assign$6.apply(this, arguments);
|
|
3940
3947
|
}, Default$6 = {
|
|
3941
3948
|
defaultTabId: null,
|
|
3942
|
-
activeClasses: "text-
|
|
3943
|
-
inactiveClasses: "
|
|
3949
|
+
activeClasses: "text-fg-brand hover:text-fg-brand border-brand",
|
|
3950
|
+
inactiveClasses: "border-transparent text-body hover:text-heading border-soft hover:border-default",
|
|
3944
3951
|
onShow: function() {
|
|
3945
3952
|
}
|
|
3946
3953
|
}, DefaultInstanceOptions$6 = {
|
|
@@ -4962,10 +4969,10 @@ var locales = {
|
|
|
4962
4969
|
maxNumberOfDates: 1,
|
|
4963
4970
|
maxView: 3,
|
|
4964
4971
|
minDate: null,
|
|
4965
|
-
nextArrow: '<svg class="w-4 h-4 rtl:rotate-180
|
|
4972
|
+
nextArrow: '<svg class="w-4 h-4 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"/></svg>',
|
|
4966
4973
|
orientation: "auto",
|
|
4967
4974
|
pickLevel: 0,
|
|
4968
|
-
prevArrow: '<svg class="w-4 h-4 rtl:rotate-180
|
|
4975
|
+
prevArrow: '<svg class="w-4 h-4 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 5H1m0 0 4 4M1 5l4-4"/></svg>',
|
|
4969
4976
|
showDaysOfWeek: !0,
|
|
4970
4977
|
showOnClick: !0,
|
|
4971
4978
|
showOnFocus: !0,
|
|
@@ -5028,8 +5035,8 @@ function processOptions(e, t) {
|
|
|
5028
5035
|
}
|
|
5029
5036
|
var m = d, w = c;
|
|
5030
5037
|
if (n.minDate !== void 0 && (m = n.minDate === null ? dateValue(0, 0, 1) : validateDate(n.minDate, s, l, m), delete n.minDate), n.maxDate !== void 0 && (w = n.maxDate === null ? void 0 : validateDate(n.maxDate, s, l, w), delete n.maxDate), w < m ? (d = i.minDate = w, c = i.maxDate = m) : (d !== m && (d = i.minDate = m), c !== w && (c = i.maxDate = w)), n.datesDisabled && (i.datesDisabled = n.datesDisabled.reduce(function(I, R) {
|
|
5031
|
-
var
|
|
5032
|
-
return
|
|
5038
|
+
var k = parseDate(R, s, l);
|
|
5039
|
+
return k !== void 0 ? pushUnique(I, k) : I;
|
|
5033
5040
|
}, []), delete n.datesDisabled), n.defaultViewDate !== void 0) {
|
|
5034
5041
|
var E = parseDate(n.defaultViewDate, s, l);
|
|
5035
5042
|
E !== void 0 && (i.defaultViewDate = E), delete n.defaultViewDate;
|
|
@@ -5039,18 +5046,18 @@ function processOptions(e, t) {
|
|
|
5039
5046
|
isNaN(x) || (g = i.weekStart = x, i.weekEnd = calcEndOfWeek(x)), delete n.weekStart;
|
|
5040
5047
|
}
|
|
5041
5048
|
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) {
|
|
5042
|
-
var
|
|
5043
|
-
|
|
5049
|
+
var S = parseInt(n.maxNumberOfDates, 10);
|
|
5050
|
+
S >= 0 && (i.maxNumberOfDates = S, i.multidate = S !== 1), delete n.maxNumberOfDates;
|
|
5044
5051
|
}
|
|
5045
5052
|
n.dateDelimiter && (i.dateDelimiter = String(n.dateDelimiter), delete n.dateDelimiter);
|
|
5046
|
-
var
|
|
5047
|
-
n.pickLevel !== void 0 && (
|
|
5048
|
-
var
|
|
5049
|
-
n.maxView !== void 0 && (
|
|
5053
|
+
var A = f;
|
|
5054
|
+
n.pickLevel !== void 0 && (A = validateViewId(n.pickLevel, 2), delete n.pickLevel), A !== f && (f = i.pickLevel = A);
|
|
5055
|
+
var D = u;
|
|
5056
|
+
n.maxView !== void 0 && (D = validateViewId(n.maxView, u), delete n.maxView), D = f > D ? f : D, D !== u && (u = i.maxView = D);
|
|
5050
5057
|
var O = p;
|
|
5051
5058
|
if (n.startView !== void 0 && (O = validateViewId(n.startView, O), delete n.startView), O < f ? O = f : O > u && (O = u), O !== p && (i.startView = O), n.prevArrow) {
|
|
5052
|
-
var
|
|
5053
|
-
|
|
5059
|
+
var H = parseHTML(n.prevArrow);
|
|
5060
|
+
H.childNodes.length > 0 && (i.prevArrow = H.childNodes), delete n.prevArrow;
|
|
5054
5061
|
}
|
|
5055
5062
|
if (n.nextArrow) {
|
|
5056
5063
|
var T = parseHTML(n.nextArrow);
|
|
@@ -5080,34 +5087,34 @@ function processOptions(e, t) {
|
|
|
5080
5087
|
}), i;
|
|
5081
5088
|
}
|
|
5082
5089
|
var pickerTemplate = optimizeTemplateHTML(`<div class="datepicker hidden">
|
|
5083
|
-
<div class="datepicker-picker inline-block rounded-
|
|
5090
|
+
<div class="datepicker-picker inline-block rounded-base bg-neutral-primary-medium border border-default-medium p-4">
|
|
5084
5091
|
<div class="datepicker-header">
|
|
5085
|
-
<div class="datepicker-title bg-
|
|
5092
|
+
<div class="datepicker-title bg-neutral-primary-medium text-heading px-2 py-3 text-center font-medium"></div>
|
|
5086
5093
|
<div class="datepicker-controls flex justify-between mb-2">
|
|
5087
|
-
<button type="button" class="bg-
|
|
5088
|
-
<button type="button" class="text-sm rounded-
|
|
5089
|
-
<button type="button" class="bg-
|
|
5094
|
+
<button type="button" class="bg-neutral-primary-medium rounded-base text-body hover:bg-neutral-tertiary-medium hover:text-heading text-lg p-2.5 focus:outline-none focus:ring-2 focus:ring-neutral-tertiary prev-btn"></button>
|
|
5095
|
+
<button type="button" class="text-sm rounded-base text-heading bg-neutral-primary-medium font-medium py-2.5 px-5 hover:bg-neutral-tertiary-medium focus:outline-none focus:ring-2 focus:ring-neutral-tertiary view-switch"></button>
|
|
5096
|
+
<button type="button" class="bg-neutral-primary-medium rounded-base text-body hover:bg-neutral-tertiary-medium hover:text-heading text-lg p-2.5 focus:outline-none focus:ring-2 focus:ring-neutral-tertiary next-btn"></button>
|
|
5090
5097
|
</div>
|
|
5091
5098
|
</div>
|
|
5092
5099
|
<div class="datepicker-main p-1"></div>
|
|
5093
5100
|
<div class="datepicker-footer">
|
|
5094
5101
|
<div class="datepicker-controls flex space-x-2 rtl:space-x-reverse mt-2">
|
|
5095
|
-
<button type="button" class="%buttonClass% today-btn text-white bg-
|
|
5096
|
-
<button type="button" class="%buttonClass% clear-btn text-
|
|
5102
|
+
<button type="button" class="%buttonClass% today-btn text-white bg-brand hover:bg-brand-strong focus:ring-4 focus:ring-brand-medium font-medium rounded-base text-sm px-5 py-2 text-center w-1/2"></button>
|
|
5103
|
+
<button type="button" class="%buttonClass% clear-btn text-body bg-neutral-secondary-medium border border-default-medium hover:bg-neutral-tertiary-medium focus:ring-4 focus:ring-neutral-tertiary font-medium rounded-base text-sm px-5 py-2 text-center w-1/2"></button>
|
|
5097
5104
|
</div>
|
|
5098
5105
|
</div>
|
|
5099
5106
|
</div>
|
|
5100
5107
|
</div>`), daysTemplate = optimizeTemplateHTML(`<div class="days">
|
|
5101
5108
|
<div class="days-of-week grid grid-cols-7 mb-1">`.concat(createTagRepeat("span", 7, {
|
|
5102
|
-
class: "dow block flex-1 leading-9 border-0 rounded-
|
|
5109
|
+
class: "dow block flex-1 leading-9 border-0 rounded-base cursor-default text-center text-body font-medium text-sm"
|
|
5103
5110
|
}), `</div>
|
|
5104
5111
|
<div class="datepicker-grid w-64 grid grid-cols-7">`).concat(createTagRepeat("span", 42, {
|
|
5105
|
-
class: "block flex-1 leading-9 border-0 rounded-
|
|
5112
|
+
class: "block flex-1 leading-9 border-0 rounded-base cursor-default text-center text-body font-medium text-sm h-6 leading-6 text-sm font-medium text-fg-disabled"
|
|
5106
5113
|
}), `</div>
|
|
5107
5114
|
</div>`)), calendarWeeksTemplate = optimizeTemplateHTML(`<div class="calendar-weeks">
|
|
5108
|
-
<div class="days-of-week flex"><span class="dow h-6 leading-6 text-sm font-medium text-
|
|
5115
|
+
<div class="days-of-week flex"><span class="dow h-6 leading-6 text-sm font-medium text-fg-disabled"></span></div>
|
|
5109
5116
|
<div class="weeks">`.concat(createTagRepeat("span", 6, {
|
|
5110
|
-
class: "week block flex-1 leading-9 border-0 rounded-
|
|
5117
|
+
class: "week block flex-1 leading-9 border-0 rounded-base cursor-default text-center text-body font-medium text-sm"
|
|
5111
5118
|
}), `</div>
|
|
5112
5119
|
</div>`)), View = /* @__PURE__ */ (function() {
|
|
5113
5120
|
function e(t, n) {
|
|
@@ -5187,7 +5194,7 @@ var pickerTemplate = optimizeTemplateHTML(`<div class="datepicker hidden">
|
|
|
5187
5194
|
} else this.calendarWeeks && !i.calendarWeeks && (this.element.removeChild(this.calendarWeeks.element), this.calendarWeeks = null);
|
|
5188
5195
|
i.showDaysOfWeek !== void 0 && (i.showDaysOfWeek ? (showElement(this.dow), this.calendarWeeks && showElement(this.calendarWeeks.dow)) : (hideElement(this.dow), this.calendarWeeks && hideElement(this.calendarWeeks.dow))), a && Array.from(this.dow.children).forEach(function(l, c) {
|
|
5189
5196
|
var u = (r.weekStart + c) % 7;
|
|
5190
|
-
l.textContent = r.dayNames[u], l.className = r.daysOfWeekDisabled.includes(u) ? "dow disabled text-center h-6 leading-6 text-sm font-medium text-
|
|
5197
|
+
l.textContent = r.dayNames[u], l.className = r.daysOfWeekDisabled.includes(u) ? "dow disabled text-center h-6 leading-6 text-sm font-medium text-fg-disabled cursor-not-allowed" : "dow text-center h-6 leading-6 text-sm font-medium text-body";
|
|
5191
5198
|
});
|
|
5192
5199
|
}
|
|
5193
5200
|
// Apply update on the focused date to view's settings
|
|
@@ -5219,11 +5226,11 @@ var pickerTemplate = optimizeTemplateHTML(`<div class="datepicker hidden">
|
|
|
5219
5226
|
}
|
|
5220
5227
|
Array.from(this.grid.children).forEach(function(s, o) {
|
|
5221
5228
|
var l = s.classList, c = addDays(i.start, o), u = new Date(c), d = u.getDay();
|
|
5222
|
-
if (s.className = "datepicker-cell hover:bg-
|
|
5229
|
+
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) {
|
|
5223
5230
|
var f = _slicedToArray(i.range, 2), p = f[0], g = f[1];
|
|
5224
|
-
c > p && c < g && (l.add("range", "bg-
|
|
5231
|
+
c > p && c < g && (l.add("range", "bg-neutral-tertiary-medium"), l.remove("rounded-base", "rounded-s-base", "rounded-e-base")), c === p && (l.add("range-start", "bg-brand", "rounded-s-base"), l.remove("rounded-base", "rounded-e-base")), c === g && (l.add("range-end", "bg-neutral-tertiary-medium", "rounded-e-base"), l.remove("rounded-base", "rounded-s-base"));
|
|
5225
5232
|
}
|
|
5226
|
-
i.selected.includes(c) && (l.add("selected", "bg-
|
|
5233
|
+
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);
|
|
5227
5234
|
});
|
|
5228
5235
|
}
|
|
5229
5236
|
// Update the view UI by applying the changes of selected and focused items
|
|
@@ -5232,10 +5239,10 @@ var pickerTemplate = optimizeTemplateHTML(`<div class="datepicker hidden">
|
|
|
5232
5239
|
value: function() {
|
|
5233
5240
|
var i = this, r = this.range || [], a = _slicedToArray(r, 2), s = a[0], o = a[1];
|
|
5234
5241
|
this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach(function(l) {
|
|
5235
|
-
l.classList.remove("range", "range-start", "range-end", "selected", "bg-
|
|
5242
|
+
l.classList.remove("range", "range-start", "range-end", "selected", "bg-brand", "text-white", "focused"), l.classList.add("text-body", "rounded-base");
|
|
5236
5243
|
}), Array.from(this.grid.children).forEach(function(l) {
|
|
5237
5244
|
var c = Number(l.dataset.date), u = l.classList;
|
|
5238
|
-
u.remove("bg-
|
|
5245
|
+
u.remove("bg-neutral-tertiary-medium", "rounded-s-base", "rounded-e-base"), c > s && c < o && (u.add("range", "bg-neutral-tertiary-medium"), u.remove("rounded-base")), c === s && (u.add("range-start", "bg-brand", "text-white", "rounded-s-base"), u.remove("rounded-base")), c === o && (u.add("range-end", "bg-neutral-tertiary-medium", "rounded-e-base"), u.remove("rounded-base")), i.selected.includes(c) && (u.add("selected", "bg-brand", "text-white"), u.remove("text-body", "hover:bg-neutral-tertiary-medium", "bg-neutral-tertiary-medium")), c === i.focused && u.add("focused");
|
|
5239
5246
|
});
|
|
5240
5247
|
}
|
|
5241
5248
|
// Update the view UI by applying the change of focused item
|
|
@@ -5322,11 +5329,11 @@ var MonthsView = /* @__PURE__ */ (function(e) {
|
|
|
5322
5329
|
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);
|
|
5323
5330
|
Array.from(this.grid.children).forEach(function(c, u) {
|
|
5324
5331
|
var d = c.classList, f = dateValue(i.year, u, 1);
|
|
5325
|
-
if (c.className = "datepicker-cell hover:bg-
|
|
5332
|
+
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 = f), c.textContent = i.monthNames[u], (a || s && u < i.minMonth || o && u > i.maxMonth) && d.add("disabled"), l) {
|
|
5326
5333
|
var p = _slicedToArray(l, 2), g = p[0], v = p[1];
|
|
5327
5334
|
u > g && u < v && d.add("range"), u === g && d.add("range-start"), u === v && d.add("range-end");
|
|
5328
5335
|
}
|
|
5329
|
-
r.includes(u) && (d.add("selected", "bg-
|
|
5336
|
+
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, f);
|
|
5330
5337
|
});
|
|
5331
5338
|
}
|
|
5332
5339
|
// Update the view UI by applying the changes of selected and focused items
|
|
@@ -5335,10 +5342,10 @@ var MonthsView = /* @__PURE__ */ (function(e) {
|
|
|
5335
5342
|
value: function() {
|
|
5336
5343
|
var i = this, r = this.selected[this.year] || [], a = computeMonthRange(this.range, this.year) || [], s = _slicedToArray(a, 2), o = s[0], l = s[1];
|
|
5337
5344
|
this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach(function(c) {
|
|
5338
|
-
c.classList.remove("range", "range-start", "range-end", "selected", "bg-
|
|
5345
|
+
c.classList.remove("range", "range-start", "range-end", "selected", "bg-brand", "dark:text-white", "text-white", "focused"), c.classList.add("text-body", "hover:bg-neutral-tertiary-medium", "dark:text-white");
|
|
5339
5346
|
}), Array.from(this.grid.children).forEach(function(c, u) {
|
|
5340
5347
|
var d = c.classList;
|
|
5341
|
-
u > o && u < l && d.add("range"), u === o && d.add("range-start"), u === l && d.add("range-end"), r.includes(u) && (d.add("selected", "bg-
|
|
5348
|
+
u > o && u < l && d.add("range"), u === o && d.add("range-start"), u === l && d.add("range-end"), 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");
|
|
5342
5349
|
});
|
|
5343
5350
|
}
|
|
5344
5351
|
// Update the view UI by applying the change of focused item
|
|
@@ -5400,11 +5407,11 @@ var YearsView = /* @__PURE__ */ (function(e) {
|
|
|
5400
5407
|
var i = this;
|
|
5401
5408
|
this.disabled = [], this.picker.setViewSwitchLabel("".concat(this.first, "-").concat(this.last)), this.picker.setPrevBtnDisabled(this.first <= this.minYear), this.picker.setNextBtnDisabled(this.last >= this.maxYear), Array.from(this.grid.children).forEach(function(r, a) {
|
|
5402
5409
|
var s = r.classList, o = i.start + a * i.step, l = dateValue(o, 0, 1);
|
|
5403
|
-
if (r.className = "datepicker-cell hover:bg-
|
|
5410
|
+
if (r.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 && (r.dataset.date = l), r.textContent = r.dataset.year = o, a === 0 ? s.add("prev") : a === 11 && s.add("next"), (o < i.minYear || o > i.maxYear) && s.add("disabled"), i.range) {
|
|
5404
5411
|
var c = _slicedToArray(i.range, 2), u = c[0], d = c[1];
|
|
5405
5412
|
o > u && o < d && s.add("range"), o === u && s.add("range-start"), o === d && s.add("range-end");
|
|
5406
5413
|
}
|
|
5407
|
-
i.selected.includes(o) && (s.add("selected", "bg-
|
|
5414
|
+
i.selected.includes(o) && (s.add("selected", "bg-brand", "text-white", "dark:text-white"), s.remove("text-body", "hover:bg-neutral-tertiary-medium", "dark:text-white")), o === i.focused && s.add("focused"), i.beforeShow && i.performBeforeHook(r, o, l);
|
|
5408
5415
|
});
|
|
5409
5416
|
}
|
|
5410
5417
|
// Update the view UI by applying the changes of selected and focused items
|
|
@@ -5413,10 +5420,10 @@ var YearsView = /* @__PURE__ */ (function(e) {
|
|
|
5413
5420
|
value: function() {
|
|
5414
5421
|
var i = this, r = this.range || [], a = _slicedToArray(r, 2), s = a[0], o = a[1];
|
|
5415
5422
|
this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach(function(l) {
|
|
5416
|
-
l.classList.remove("range", "range-start", "range-end", "selected", "bg-
|
|
5423
|
+
l.classList.remove("range", "range-start", "range-end", "selected", "bg-brand", "text-white", "dark:text-white", "focused");
|
|
5417
5424
|
}), Array.from(this.grid.children).forEach(function(l) {
|
|
5418
5425
|
var c = Number(l.textContent), u = l.classList;
|
|
5419
|
-
c > s && c < o && u.add("range"), c === s && u.add("range-start"), c === o && u.add("range-end"), i.selected.includes(c) && (u.add("selected", "bg-
|
|
5426
|
+
c > s && c < o && u.add("range"), c === s && u.add("range-start"), c === o && u.add("range-end"), i.selected.includes(c) && (u.add("selected", "bg-brand", "text-white", "hover:text-heading"), u.remove("text-body", "hover:bg-neutral-tertiary-medium", "hover:text-heading")), c === i.focused && u.add("focused");
|
|
5420
5427
|
});
|
|
5421
5428
|
}
|
|
5422
5429
|
// Update the view UI by applying the change of focused item
|
|
@@ -5602,8 +5609,8 @@ var Picker = /* @__PURE__ */ (function() {
|
|
|
5602
5609
|
}, {
|
|
5603
5610
|
key: "place",
|
|
5604
5611
|
value: function() {
|
|
5605
|
-
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, f = l.getBoundingClientRect(), p = f.left, g = f.top, v = f.width, h = o.getBoundingClientRect(), y = h.left, _ = h.top, b = h.width, m = h.height, w = s.orientation, E = w.x, x = w.y,
|
|
5606
|
-
l === document.body ? (
|
|
5612
|
+
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, f = l.getBoundingClientRect(), p = f.left, g = f.top, v = f.width, h = o.getBoundingClientRect(), y = h.left, _ = h.top, b = h.width, m = h.height, w = s.orientation, E = w.x, x = w.y, S, A, D;
|
|
5613
|
+
l === document.body ? (S = window.scrollY, A = y + window.scrollX, D = _ + S) : (S = l.scrollTop, A = y - p, D = _ - g + S), E === "auto" && (A < 0 ? (E = "left", A = 10) : A + u > v ? E = "right" : E = getTextDirection(o) === "rtl" ? "right" : "left"), E === "right" && (A -= u - b), x === "auto" && (x = D - d < S ? "bottom" : "top"), x === "top" ? D -= d : D += m, i.remove("datepicker-orient-top", "datepicker-orient-bottom", "datepicker-orient-right", "datepicker-orient-left"), i.add("datepicker-orient-".concat(x), "datepicker-orient-".concat(E)), r.top = D && "".concat(D, "px"), r.left = A && "".concat(A, "px");
|
|
5607
5614
|
}
|
|
5608
5615
|
}, {
|
|
5609
5616
|
key: "setViewSwitchLabel",
|
|
@@ -6047,7 +6054,7 @@ var Datepicker$1 = /* @__PURE__ */ (function() {
|
|
|
6047
6054
|
}, {
|
|
6048
6055
|
key: "enterEditMode",
|
|
6049
6056
|
value: function() {
|
|
6050
|
-
this.inline || !this.picker.active || this.editMode || (this.editMode = !0, this.inputField.classList.add("in-edit", "border-
|
|
6057
|
+
this.inline || !this.picker.active || this.editMode || (this.editMode = !0, this.inputField.classList.add("in-edit", "border-brand"));
|
|
6051
6058
|
}
|
|
6052
6059
|
/**
|
|
6053
6060
|
* Exit from edit mode
|
|
@@ -6065,7 +6072,7 @@ var Datepicker$1 = /* @__PURE__ */ (function() {
|
|
|
6065
6072
|
var i = Object.assign({
|
|
6066
6073
|
update: !1
|
|
6067
6074
|
}, n);
|
|
6068
|
-
delete this.editMode, this.inputField.classList.remove("in-edit", "border-
|
|
6075
|
+
delete this.editMode, this.inputField.classList.remove("in-edit", "border-brand"), i.update && this.update(i);
|
|
6069
6076
|
}
|
|
6070
6077
|
}
|
|
6071
6078
|
}], [{
|
|
@@ -6615,7 +6622,14 @@ var htmx = (function() {
|
|
|
6615
6622
|
* @type boolean
|
|
6616
6623
|
* @default true
|
|
6617
6624
|
*/
|
|
6618
|
-
historyRestoreAsHxRequest: !0
|
|
6625
|
+
historyRestoreAsHxRequest: !0,
|
|
6626
|
+
/**
|
|
6627
|
+
* Whether to report input validation errors to the end user and update focus to the first input that fails validation.
|
|
6628
|
+
* This should always be enabled as this matches default browser form submit behaviour
|
|
6629
|
+
* @type boolean
|
|
6630
|
+
* @default false
|
|
6631
|
+
*/
|
|
6632
|
+
reportValidityOfForms: !1
|
|
6619
6633
|
},
|
|
6620
6634
|
/** @type {typeof parseInterval} */
|
|
6621
6635
|
parseInterval: null,
|
|
@@ -6626,7 +6640,7 @@ var htmx = (function() {
|
|
|
6626
6640
|
location,
|
|
6627
6641
|
/** @type {typeof internalEval} */
|
|
6628
6642
|
_: null,
|
|
6629
|
-
version: "2.0.
|
|
6643
|
+
version: "2.0.8"
|
|
6630
6644
|
};
|
|
6631
6645
|
htmx.onLoad = onLoadHelper, htmx.process = processNode, htmx.on = addEventListenerImpl, htmx.off = removeEventListenerImpl, htmx.trigger = triggerEvent, htmx.ajax = ajaxHelper, htmx.find = find, htmx.findAll = findAll, htmx.closest = closest, htmx.remove = removeElement, htmx.addClass = addClassToElement, htmx.removeClass = removeClassFromElement, htmx.toggleClass = toggleClassOnElement, htmx.takeClass = takeClassForElement, htmx.swap = swap, htmx.defineExtension = defineExtension, htmx.removeExtension = removeExtension, htmx.logAll = logAll, htmx.logNone = logNone, htmx.parseInterval = parseInterval, htmx._ = internalEval;
|
|
6632
6646
|
const internalAPI = {
|
|
@@ -6716,7 +6730,7 @@ var htmx = (function() {
|
|
|
6716
6730
|
return n ? n[1].toLowerCase() : "";
|
|
6717
6731
|
}
|
|
6718
6732
|
function parseHTML(e) {
|
|
6719
|
-
return new DOMParser().parseFromString(e, "text/html");
|
|
6733
|
+
return "parseHTMLUnsafe" in Document ? Document.parseHTMLUnsafe(e) : new DOMParser().parseFromString(e, "text/html");
|
|
6720
6734
|
}
|
|
6721
6735
|
function takeChildrenFor(e, t) {
|
|
6722
6736
|
for (; t.childNodes.length > 0; )
|
|
@@ -7020,7 +7034,7 @@ var htmx = (function() {
|
|
|
7020
7034
|
return htmx.config.attributesToSettle.includes(e);
|
|
7021
7035
|
}
|
|
7022
7036
|
function cloneAttributes(e, t) {
|
|
7023
|
-
forEach(e.attributes, function(n) {
|
|
7037
|
+
forEach(Array.from(e.attributes), function(n) {
|
|
7024
7038
|
!t.hasAttribute(n.name) && shouldSettleAttribute(n.name) && e.removeAttribute(n.name);
|
|
7025
7039
|
}), forEach(t.attributes, function(n) {
|
|
7026
7040
|
shouldSettleAttribute(n.name) && e.setAttribute(n.name, n.value);
|
|
@@ -7502,7 +7516,20 @@ var htmx = (function() {
|
|
|
7502
7516
|
}
|
|
7503
7517
|
}
|
|
7504
7518
|
function shouldCancel(e, t) {
|
|
7505
|
-
|
|
7519
|
+
if (e.type === "submit" && t.tagName === "FORM")
|
|
7520
|
+
return !0;
|
|
7521
|
+
if (e.type === "click") {
|
|
7522
|
+
const n = (
|
|
7523
|
+
/** @type {HTMLButtonElement|HTMLInputElement|null} */
|
|
7524
|
+
t.closest('input[type="submit"], button')
|
|
7525
|
+
);
|
|
7526
|
+
if (n && n.form && n.type === "submit")
|
|
7527
|
+
return !0;
|
|
7528
|
+
const i = t.closest("a"), r = /^#.+/;
|
|
7529
|
+
if (i && i.href && !r.test(i.getAttribute("href")))
|
|
7530
|
+
return !0;
|
|
7531
|
+
}
|
|
7532
|
+
return !1;
|
|
7506
7533
|
}
|
|
7507
7534
|
function ignoreBoostedAnchorCtrlClick(e, t) {
|
|
7508
7535
|
return getInternalData(e).boosted && e instanceof HTMLAnchorElement && t.type === "click" && // @ts-ignore this will resolve to undefined for events that don't define those properties, which is fine
|
|
@@ -7530,7 +7557,7 @@ var htmx = (function() {
|
|
|
7530
7557
|
o.removeEventListener(i.trigger, l);
|
|
7531
7558
|
return;
|
|
7532
7559
|
}
|
|
7533
|
-
if (ignoreBoostedAnchorCtrlClick(e, c) || ((r || shouldCancel(c,
|
|
7560
|
+
if (ignoreBoostedAnchorCtrlClick(e, c) || ((r || shouldCancel(c, o)) && c.preventDefault(), maybeFilterEvent(i, e, c)))
|
|
7534
7561
|
return;
|
|
7535
7562
|
const u = getInternalData(c);
|
|
7536
7563
|
if (u.triggerSpec = i, u.handledFor == null && (u.handledFor = []), u.handledFor.indexOf(e) < 0) {
|
|
@@ -7680,7 +7707,8 @@ var htmx = (function() {
|
|
|
7680
7707
|
if (!t)
|
|
7681
7708
|
return;
|
|
7682
7709
|
const n = getRelatedForm(t);
|
|
7683
|
-
|
|
7710
|
+
if (n)
|
|
7711
|
+
return getInternalData(n);
|
|
7684
7712
|
}
|
|
7685
7713
|
function initButtonTracking(e) {
|
|
7686
7714
|
e.addEventListener("click", maybeSetLastButtonClicked), e.addEventListener("focusin", maybeSetLastButtonClicked), e.addEventListener("focusout", maybeUnsetLastButtonClicked);
|
|
@@ -7775,10 +7803,11 @@ var htmx = (function() {
|
|
|
7775
7803
|
r = r && s.onEvent(t, i) !== !1 && !i.defaultPrevented;
|
|
7776
7804
|
}), r;
|
|
7777
7805
|
}
|
|
7778
|
-
let currentPathForHistory
|
|
7806
|
+
let currentPathForHistory;
|
|
7779
7807
|
function setCurrentPathForHistory(e) {
|
|
7780
7808
|
currentPathForHistory = e, canAccessLocalStorage() && sessionStorage.setItem("htmx-current-path-for-history", e);
|
|
7781
7809
|
}
|
|
7810
|
+
setCurrentPathForHistory(location.pathname + location.search);
|
|
7782
7811
|
function getHistoryElement() {
|
|
7783
7812
|
return getDocument().querySelector("[hx-history-elt],[data-hx-history-elt]") || getDocument().body;
|
|
7784
7813
|
}
|
|
@@ -7946,7 +7975,10 @@ var htmx = (function() {
|
|
|
7946
7975
|
/** @type {HTMLElement & ElementInternals} */
|
|
7947
7976
|
e
|
|
7948
7977
|
);
|
|
7949
|
-
n.willValidate && (triggerEvent(n, "htmx:validation:validate"), n.checkValidity() || (
|
|
7978
|
+
n.willValidate && (triggerEvent(n, "htmx:validation:validate"), n.checkValidity() || (triggerEvent(n, "htmx:validation:failed", {
|
|
7979
|
+
message: n.validationMessage,
|
|
7980
|
+
validity: n.validity
|
|
7981
|
+
}) && !t.length && htmx.config.reportValidityOfForms && n.reportValidity(), t.push({ elt: n, message: n.validationMessage, validity: n.validity })));
|
|
7950
7982
|
}
|
|
7951
7983
|
function overrideFormData(e, t) {
|
|
7952
7984
|
for (const n of t.keys())
|
|
@@ -8160,7 +8192,10 @@ var htmx = (function() {
|
|
|
8160
8192
|
targetOverride: i,
|
|
8161
8193
|
swapOverride: n.swap,
|
|
8162
8194
|
select: n.select,
|
|
8163
|
-
returnPromise: !0
|
|
8195
|
+
returnPromise: !0,
|
|
8196
|
+
push: n.push,
|
|
8197
|
+
replace: n.replace,
|
|
8198
|
+
selectOOB: n.selectOOB
|
|
8164
8199
|
}
|
|
8165
8200
|
);
|
|
8166
8201
|
}
|
|
@@ -8245,8 +8280,8 @@ var htmx = (function() {
|
|
|
8245
8280
|
function issueAjaxRequest(e, t, n, i, r, a) {
|
|
8246
8281
|
let s = null, o = null;
|
|
8247
8282
|
if (r = r ?? {}, r.returnPromise && typeof Promise < "u")
|
|
8248
|
-
var l = new Promise(function(
|
|
8249
|
-
s =
|
|
8283
|
+
var l = new Promise(function(C, L) {
|
|
8284
|
+
s = C, o = L;
|
|
8250
8285
|
});
|
|
8251
8286
|
n == null && (n = getDocument().body);
|
|
8252
8287
|
const c = r.handler || handleAjaxResponse, u = r.select || null;
|
|
@@ -8258,8 +8293,8 @@ var htmx = (function() {
|
|
|
8258
8293
|
let f = getInternalData(n);
|
|
8259
8294
|
const p = f.lastButtonClicked;
|
|
8260
8295
|
if (p) {
|
|
8261
|
-
const
|
|
8262
|
-
|
|
8296
|
+
const C = getRawAttribute(p, "formaction");
|
|
8297
|
+
C != null && (t = C);
|
|
8263
8298
|
const L = getRawAttribute(p, "formmethod");
|
|
8264
8299
|
if (L != null)
|
|
8265
8300
|
if (VERBS.includes(L.toLowerCase()))
|
|
@@ -8269,14 +8304,14 @@ var htmx = (function() {
|
|
|
8269
8304
|
return maybeCall(s), l;
|
|
8270
8305
|
}
|
|
8271
8306
|
const g = getClosestAttributeValue(n, "hx-confirm");
|
|
8272
|
-
if (a === void 0 && triggerEvent(n, "htmx:confirm", { target: d, elt: n, path: t, verb: e, triggeringEvent: i, etc: r, issueRequest: function(
|
|
8273
|
-
return issueAjaxRequest(e, t, n, i, r, !!
|
|
8307
|
+
if (a === void 0 && triggerEvent(n, "htmx:confirm", { target: d, elt: n, path: t, verb: e, triggeringEvent: i, etc: r, issueRequest: function(M) {
|
|
8308
|
+
return issueAjaxRequest(e, t, n, i, r, !!M);
|
|
8274
8309
|
}, question: g }) === !1)
|
|
8275
8310
|
return maybeCall(s), l;
|
|
8276
8311
|
let v = n, h = getClosestAttributeValue(n, "hx-sync"), y = null, _ = !1;
|
|
8277
8312
|
if (h) {
|
|
8278
|
-
const
|
|
8279
|
-
if (L === "this" ? v = findThisElement(n, "hx-sync") : v = asElement(querySelectorExt(n, L)), h = (
|
|
8313
|
+
const C = h.split(":"), L = C[0].trim();
|
|
8314
|
+
if (L === "this" ? v = findThisElement(n, "hx-sync") : v = asElement(querySelectorExt(n, L)), h = (C[1] || "drop").trim(), f = getInternalData(v), h === "drop" && f.xhr && f.abortable !== !0)
|
|
8280
8315
|
return maybeCall(s), l;
|
|
8281
8316
|
if (h === "abort") {
|
|
8282
8317
|
if (f.xhr)
|
|
@@ -8290,8 +8325,8 @@ var htmx = (function() {
|
|
|
8290
8325
|
else {
|
|
8291
8326
|
if (y == null) {
|
|
8292
8327
|
if (i) {
|
|
8293
|
-
const
|
|
8294
|
-
|
|
8328
|
+
const C = getInternalData(i);
|
|
8329
|
+
C && C.triggerSpec && C.triggerSpec.queue && (y = C.triggerSpec.queue);
|
|
8295
8330
|
}
|
|
8296
8331
|
y == null && (y = "last");
|
|
8297
8332
|
}
|
|
@@ -8317,51 +8352,51 @@ var htmx = (function() {
|
|
|
8317
8352
|
return maybeCall(s), m(), l;
|
|
8318
8353
|
let x = getHeaders(n, d, E);
|
|
8319
8354
|
e !== "get" && !usesFormData(n) && (x["Content-Type"] = "application/x-www-form-urlencoded"), r.headers && (x = mergeObjects(x, r.headers));
|
|
8320
|
-
const
|
|
8321
|
-
let
|
|
8322
|
-
const
|
|
8323
|
-
r.values && overrideFormData(
|
|
8324
|
-
const O = formDataFromObject(getExpressionVars(n, i)),
|
|
8325
|
-
let T = filterValues(
|
|
8355
|
+
const S = getInputValues(n, e);
|
|
8356
|
+
let A = S.errors;
|
|
8357
|
+
const D = S.formData;
|
|
8358
|
+
r.values && overrideFormData(D, formDataFromObject(r.values));
|
|
8359
|
+
const O = formDataFromObject(getExpressionVars(n, i)), H = overrideFormData(D, O);
|
|
8360
|
+
let T = filterValues(H, n);
|
|
8326
8361
|
htmx.config.getCacheBusterParam && e === "get" && T.set("org.htmx.cache-buster", getRawAttribute(d, "id") || "true"), (t == null || t === "") && (t = location.href);
|
|
8327
8362
|
const F = getValuesForElement(n, "hx-request"), I = getInternalData(n).boosted;
|
|
8328
8363
|
let R = htmx.config.methodsThatUseUrlParams.indexOf(e) >= 0;
|
|
8329
|
-
const
|
|
8364
|
+
const k = {
|
|
8330
8365
|
boosted: I,
|
|
8331
8366
|
useUrlParams: R,
|
|
8332
8367
|
formData: T,
|
|
8333
8368
|
parameters: formDataProxy(T),
|
|
8334
|
-
unfilteredFormData:
|
|
8335
|
-
unfilteredParameters: formDataProxy(
|
|
8369
|
+
unfilteredFormData: H,
|
|
8370
|
+
unfilteredParameters: formDataProxy(H),
|
|
8336
8371
|
headers: x,
|
|
8337
8372
|
elt: n,
|
|
8338
8373
|
target: d,
|
|
8339
8374
|
verb: e,
|
|
8340
|
-
errors:
|
|
8375
|
+
errors: A,
|
|
8341
8376
|
withCredentials: r.credentials || F.credentials || htmx.config.withCredentials,
|
|
8342
8377
|
timeout: r.timeout || F.timeout || htmx.config.timeout,
|
|
8343
8378
|
path: t,
|
|
8344
8379
|
triggeringEvent: i
|
|
8345
8380
|
};
|
|
8346
|
-
if (!triggerEvent(n, "htmx:configRequest",
|
|
8381
|
+
if (!triggerEvent(n, "htmx:configRequest", k))
|
|
8347
8382
|
return maybeCall(s), m(), l;
|
|
8348
|
-
if (t =
|
|
8349
|
-
return triggerEvent(n, "htmx:validation:halted",
|
|
8383
|
+
if (t = k.path, e = k.verb, x = k.headers, T = formDataFromObject(k.parameters), A = k.errors, R = k.useUrlParams, A && A.length > 0)
|
|
8384
|
+
return triggerEvent(n, "htmx:validation:halted", k), maybeCall(s), m(), l;
|
|
8350
8385
|
const W = t.split("#"), $ = W[0], q = W[1];
|
|
8351
8386
|
let N = t;
|
|
8352
|
-
if (R && (N = $, !T.keys().next().done && (N.indexOf("?") < 0 ? N += "?" : N += "&", N += urlEncode(T), q && (N += "#" + q))), !verifyPath(n, N,
|
|
8353
|
-
return triggerErrorEvent(n, "htmx:invalidPath",
|
|
8354
|
-
if (b.open(e.toUpperCase(), N, !0), b.overrideMimeType("text/html"), b.withCredentials =
|
|
8355
|
-
for (const
|
|
8356
|
-
if (x.hasOwnProperty(
|
|
8357
|
-
const L = x[
|
|
8358
|
-
safelySetHeaderValue(b,
|
|
8387
|
+
if (R && (N = $, !T.keys().next().done && (N.indexOf("?") < 0 ? N += "?" : N += "&", N += urlEncode(T), q && (N += "#" + q))), !verifyPath(n, N, k))
|
|
8388
|
+
return triggerErrorEvent(n, "htmx:invalidPath", k), maybeCall(o), m(), l;
|
|
8389
|
+
if (b.open(e.toUpperCase(), N, !0), b.overrideMimeType("text/html"), b.withCredentials = k.withCredentials, b.timeout = k.timeout, !F.noHeaders) {
|
|
8390
|
+
for (const C in x)
|
|
8391
|
+
if (x.hasOwnProperty(C)) {
|
|
8392
|
+
const L = x[C];
|
|
8393
|
+
safelySetHeaderValue(b, C, L);
|
|
8359
8394
|
}
|
|
8360
8395
|
}
|
|
8361
8396
|
const P = {
|
|
8362
8397
|
xhr: b,
|
|
8363
8398
|
target: d,
|
|
8364
|
-
requestConfig:
|
|
8399
|
+
requestConfig: k,
|
|
8365
8400
|
etc: r,
|
|
8366
8401
|
boosted: I,
|
|
8367
8402
|
select: u,
|
|
@@ -8374,18 +8409,18 @@ var htmx = (function() {
|
|
|
8374
8409
|
};
|
|
8375
8410
|
if (b.onload = function() {
|
|
8376
8411
|
try {
|
|
8377
|
-
const
|
|
8412
|
+
const C = hierarchyForElt(n);
|
|
8378
8413
|
if (P.pathInfo.responsePath = getPathFromResponse(b), c(n, P), P.keepIndicators !== !0 && removeRequestIndicators(j, V), triggerEvent(n, "htmx:afterRequest", P), triggerEvent(n, "htmx:afterOnLoad", P), !bodyContains(n)) {
|
|
8379
8414
|
let L = null;
|
|
8380
|
-
for (;
|
|
8381
|
-
const
|
|
8382
|
-
bodyContains(
|
|
8415
|
+
for (; C.length > 0 && L == null; ) {
|
|
8416
|
+
const M = C.shift();
|
|
8417
|
+
bodyContains(M) && (L = M);
|
|
8383
8418
|
}
|
|
8384
8419
|
L && (triggerEvent(L, "htmx:afterRequest", P), triggerEvent(L, "htmx:afterOnLoad", P));
|
|
8385
8420
|
}
|
|
8386
8421
|
maybeCall(s);
|
|
8387
|
-
} catch (
|
|
8388
|
-
throw triggerErrorEvent(n, "htmx:onLoadError", mergeObjects({ error:
|
|
8422
|
+
} catch (C) {
|
|
8423
|
+
throw triggerErrorEvent(n, "htmx:onLoadError", mergeObjects({ error: C }, P)), C;
|
|
8389
8424
|
} finally {
|
|
8390
8425
|
m();
|
|
8391
8426
|
}
|
|
@@ -8398,13 +8433,13 @@ var htmx = (function() {
|
|
|
8398
8433
|
}, !triggerEvent(n, "htmx:beforeRequest", P))
|
|
8399
8434
|
return maybeCall(s), m(), l;
|
|
8400
8435
|
var j = addRequestIndicatorClasses(n), V = disableElements(n);
|
|
8401
|
-
forEach(["loadstart", "loadend", "progress", "abort"], function(
|
|
8436
|
+
forEach(["loadstart", "loadend", "progress", "abort"], function(C) {
|
|
8402
8437
|
forEach([b, b.upload], function(L) {
|
|
8403
|
-
L.addEventListener(
|
|
8404
|
-
triggerEvent(n, "htmx:xhr:" +
|
|
8405
|
-
lengthComputable:
|
|
8406
|
-
loaded:
|
|
8407
|
-
total:
|
|
8438
|
+
L.addEventListener(C, function(M) {
|
|
8439
|
+
triggerEvent(n, "htmx:xhr:" + C, {
|
|
8440
|
+
lengthComputable: M.lengthComputable,
|
|
8441
|
+
loaded: M.loaded,
|
|
8442
|
+
total: M.total
|
|
8408
8443
|
});
|
|
8409
8444
|
});
|
|
8410
8445
|
});
|
|
@@ -8420,7 +8455,7 @@ var htmx = (function() {
|
|
|
8420
8455
|
type: r,
|
|
8421
8456
|
path: i
|
|
8422
8457
|
};
|
|
8423
|
-
const a = t.pathInfo.finalRequestPath, s = t.pathInfo.responsePath, o = getClosestAttributeValue(e, "hx-push-url"), l = getClosestAttributeValue(e, "hx-replace-url"), c = getInternalData(e).boosted;
|
|
8458
|
+
const a = t.pathInfo.finalRequestPath, s = t.pathInfo.responsePath, o = t.etc.push || getClosestAttributeValue(e, "hx-push-url"), l = t.etc.replace || getClosestAttributeValue(e, "hx-replace-url"), c = getInternalData(e).boosted;
|
|
8424
8459
|
let u = null, d = null;
|
|
8425
8460
|
return o ? (u = "push", d = o) : l ? (u = "replace", d = l) : c && (u = "push", d = s || a), d ? d === "false" ? {} : (d === "true" && (d = s || a), t.pathInfo.anchor && d.indexOf("#") === -1 && (d = d + "#" + t.pathInfo.anchor), {
|
|
8426
8461
|
type: u,
|
|
@@ -8461,12 +8496,9 @@ var htmx = (function() {
|
|
|
8461
8496
|
const r = t.etc, a = t.select;
|
|
8462
8497
|
if (!triggerEvent(e, "htmx:beforeOnLoad", t)) return;
|
|
8463
8498
|
if (hasHeader(n, /HX-Trigger:/i) && handleTriggerHeader(n, "HX-Trigger", e), hasHeader(n, /HX-Location:/i)) {
|
|
8464
|
-
saveCurrentPageToHistory();
|
|
8465
8499
|
let _ = n.getResponseHeader("HX-Location");
|
|
8466
|
-
var s;
|
|
8467
|
-
_.indexOf("{") === 0 && (s = parseJSON(_), _ = s.path, delete s.path), ajaxHelper("get", _, s)
|
|
8468
|
-
pushUrlIntoHistory(_);
|
|
8469
|
-
});
|
|
8500
|
+
var s = {};
|
|
8501
|
+
_.indexOf("{") === 0 && (s = parseJSON(_), _ = s.path, delete s.path), s.push = s.push || "true", ajaxHelper("get", _, s);
|
|
8470
8502
|
return;
|
|
8471
8503
|
}
|
|
8472
8504
|
const o = hasHeader(n, /HX-Refresh:/i) && n.getResponseHeader("HX-Refresh") === "true";
|
|
@@ -8498,7 +8530,7 @@ var htmx = (function() {
|
|
|
8498
8530
|
}), l.type && saveCurrentPageToHistory();
|
|
8499
8531
|
var y = getSwapSpecification(e, g);
|
|
8500
8532
|
y.hasOwnProperty("ignoreTitle") || (y.ignoreTitle = f), i.classList.add(htmx.config.swappingClass), a && (p = a), hasHeader(n, /HX-Reselect:/i) && (p = n.getResponseHeader("HX-Reselect"));
|
|
8501
|
-
const _ = getClosestAttributeValue(e, "hx-select-oob"), b = getClosestAttributeValue(e, "hx-select");
|
|
8533
|
+
const _ = r.selectOOB || getClosestAttributeValue(e, "hx-select-oob"), b = getClosestAttributeValue(e, "hx-select");
|
|
8502
8534
|
swap(i, v, y, {
|
|
8503
8535
|
select: p === "unset" ? null : p || b,
|
|
8504
8536
|
selectOOB: _,
|
|
@@ -8582,10 +8614,10 @@ var htmx = (function() {
|
|
|
8582
8614
|
}
|
|
8583
8615
|
function insertIndicatorStyles() {
|
|
8584
8616
|
if (htmx.config.includeIndicatorStyles !== !1) {
|
|
8585
|
-
const e = htmx.config.inlineStyleNonce ? ` nonce="${htmx.config.inlineStyleNonce}"` : "";
|
|
8617
|
+
const e = htmx.config.inlineStyleNonce ? ` nonce="${htmx.config.inlineStyleNonce}"` : "", t = htmx.config.indicatorClass, n = htmx.config.requestClass;
|
|
8586
8618
|
getDocument().head.insertAdjacentHTML(
|
|
8587
8619
|
"beforeend",
|
|
8588
|
-
|
|
8620
|
+
`<style${e}>.${t}{opacity:0;visibility: hidden} .${n} .${t}, .${n}.${t}{opacity:1;visibility: visible;transition: opacity 200ms ease-in}</style>`
|
|
8589
8621
|
);
|
|
8590
8622
|
}
|
|
8591
8623
|
}
|
|
@@ -8605,7 +8637,10 @@ var htmx = (function() {
|
|
|
8605
8637
|
"[hx-trigger='restored'],[data-hx-trigger='restored']"
|
|
8606
8638
|
);
|
|
8607
8639
|
e.addEventListener("htmx:abort", function(i) {
|
|
8608
|
-
const r =
|
|
8640
|
+
const r = (
|
|
8641
|
+
/** @type {CustomEvent} */
|
|
8642
|
+
i.detail.elt || i.target
|
|
8643
|
+
), a = getInternalData(r);
|
|
8609
8644
|
a && a.xhr && a.xhr.abort();
|
|
8610
8645
|
});
|
|
8611
8646
|
const n = window.onpopstate ? window.onpopstate.bind(window) : null;
|
|
@@ -8621,6 +8656,82 @@ var htmx = (function() {
|
|
|
8621
8656
|
}, 0);
|
|
8622
8657
|
}), htmx;
|
|
8623
8658
|
})();
|
|
8659
|
+
const ServerEventName = {
|
|
8660
|
+
JOB_STATUS_CHANGE: "job-status-change",
|
|
8661
|
+
JOB_PROGRESS: "job-progress",
|
|
8662
|
+
LIBRARY_CHANGE: "library-change",
|
|
8663
|
+
JOB_LIST_CHANGE: "job-list-change"
|
|
8664
|
+
};
|
|
8665
|
+
class EventClient {
|
|
8666
|
+
callbacks = /* @__PURE__ */ new Set();
|
|
8667
|
+
eventSource;
|
|
8668
|
+
reconnectTimeout;
|
|
8669
|
+
isConnected = !1;
|
|
8670
|
+
/**
|
|
8671
|
+
* Start the SSE connection.
|
|
8672
|
+
*/
|
|
8673
|
+
connect() {
|
|
8674
|
+
if (this.eventSource) {
|
|
8675
|
+
console.warn("EventClient already connected");
|
|
8676
|
+
return;
|
|
8677
|
+
}
|
|
8678
|
+
console.log("📡 Connecting to SSE endpoint..."), this.eventSource = new EventSource("/web/events"), this.eventSource.addEventListener("open", () => {
|
|
8679
|
+
console.log("📡 SSE connection established"), this.isConnected = !0;
|
|
8680
|
+
}), this.eventSource.addEventListener("error", (n) => {
|
|
8681
|
+
console.error("❌ SSE connection error:", n), this.isConnected = !1;
|
|
8682
|
+
});
|
|
8683
|
+
const t = Object.values(ServerEventName);
|
|
8684
|
+
console.log("🔧 Setting up event listeners", t);
|
|
8685
|
+
for (const n of t)
|
|
8686
|
+
this.eventSource.addEventListener(n, (i) => {
|
|
8687
|
+
try {
|
|
8688
|
+
const r = JSON.parse(i.data);
|
|
8689
|
+
this.notifyCallbacks({
|
|
8690
|
+
type: n,
|
|
8691
|
+
payload: r
|
|
8692
|
+
});
|
|
8693
|
+
} catch (r) {
|
|
8694
|
+
console.error(`Failed to parse SSE event data: ${r}`);
|
|
8695
|
+
}
|
|
8696
|
+
});
|
|
8697
|
+
this.eventSource.addEventListener("message", (n) => {
|
|
8698
|
+
console.log("📨 Generic message event received:", n.data);
|
|
8699
|
+
});
|
|
8700
|
+
}
|
|
8701
|
+
/**
|
|
8702
|
+
* Subscribe to events with a callback.
|
|
8703
|
+
* @param callback Function to call when events are received
|
|
8704
|
+
* @returns Unsubscribe function
|
|
8705
|
+
*/
|
|
8706
|
+
subscribe(t) {
|
|
8707
|
+
return this.callbacks.add(t), () => {
|
|
8708
|
+
this.callbacks.delete(t);
|
|
8709
|
+
};
|
|
8710
|
+
}
|
|
8711
|
+
/**
|
|
8712
|
+
* Disconnect and clean up resources.
|
|
8713
|
+
*/
|
|
8714
|
+
disconnect() {
|
|
8715
|
+
this.reconnectTimeout && (clearTimeout(this.reconnectTimeout), this.reconnectTimeout = void 0), this.eventSource && (this.eventSource.close(), this.eventSource = void 0), this.isConnected = !1;
|
|
8716
|
+
}
|
|
8717
|
+
/**
|
|
8718
|
+
* Notify all callbacks of an event.
|
|
8719
|
+
*/
|
|
8720
|
+
notifyCallbacks(t) {
|
|
8721
|
+
for (const n of this.callbacks)
|
|
8722
|
+
try {
|
|
8723
|
+
n(t);
|
|
8724
|
+
} catch (i) {
|
|
8725
|
+
console.error("Error in event callback:", i);
|
|
8726
|
+
}
|
|
8727
|
+
}
|
|
8728
|
+
/**
|
|
8729
|
+
* Check if the client is currently connected.
|
|
8730
|
+
*/
|
|
8731
|
+
isActive() {
|
|
8732
|
+
return this.isConnected;
|
|
8733
|
+
}
|
|
8734
|
+
}
|
|
8624
8735
|
const VERSION_PREFIX_PATTERN = /^v/i, normalizeVersionTag = (e) => {
|
|
8625
8736
|
if (typeof e != "string")
|
|
8626
8737
|
return null;
|
|
@@ -8713,17 +8824,50 @@ module_default.store("confirmingAction", {
|
|
|
8713
8824
|
timeoutId: null,
|
|
8714
8825
|
isDeleting: !1
|
|
8715
8826
|
});
|
|
8827
|
+
module_default.store("toast", {
|
|
8828
|
+
visible: !1,
|
|
8829
|
+
message: "",
|
|
8830
|
+
type: "info",
|
|
8831
|
+
timeoutId: null,
|
|
8832
|
+
show(e, t = "info", n = 5e3) {
|
|
8833
|
+
const i = module_default.store("toast");
|
|
8834
|
+
i.timeoutId !== null && (clearTimeout(i.timeoutId), i.timeoutId = null), i.message = e, i.type = t, i.visible = !0, i.timeoutId = window.setTimeout(() => {
|
|
8835
|
+
i.hide();
|
|
8836
|
+
}, n);
|
|
8837
|
+
},
|
|
8838
|
+
hide() {
|
|
8839
|
+
const e = module_default.store("toast");
|
|
8840
|
+
e.visible = !1, e.timeoutId !== null && (clearTimeout(e.timeoutId), e.timeoutId = null);
|
|
8841
|
+
}
|
|
8842
|
+
});
|
|
8716
8843
|
module_default.start();
|
|
8717
8844
|
initFlowbite();
|
|
8718
8845
|
document.addEventListener("job-list-refresh", () => {
|
|
8719
8846
|
htmx.ajax("get", "/web/jobs", "#job-queue");
|
|
8720
8847
|
});
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
-
}
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8848
|
+
document.addEventListener("job-status-change", () => {
|
|
8849
|
+
htmx.ajax("get", "/web/jobs", "#job-queue");
|
|
8850
|
+
});
|
|
8851
|
+
document.addEventListener("job-progress", () => {
|
|
8852
|
+
htmx.ajax("get", "/web/jobs", "#job-queue");
|
|
8853
|
+
});
|
|
8854
|
+
document.addEventListener("job-list-change", () => {
|
|
8855
|
+
htmx.ajax("get", "/web/jobs", "#job-queue");
|
|
8856
|
+
});
|
|
8857
|
+
document.addEventListener("library-change", () => {
|
|
8858
|
+
htmx.ajax("get", "/web/libraries", "#library-list");
|
|
8859
|
+
});
|
|
8860
|
+
const eventClient = new EventClient();
|
|
8861
|
+
eventClient.subscribe((e) => {
|
|
8862
|
+
console.log(`📋 Received event: ${e.type}`, e.payload), document.body.dispatchEvent(
|
|
8863
|
+
new CustomEvent(e.type, {
|
|
8864
|
+
detail: e.payload
|
|
8865
|
+
})
|
|
8866
|
+
);
|
|
8867
|
+
});
|
|
8868
|
+
eventClient.connect();
|
|
8869
|
+
window.addEventListener("beforeunload", () => {
|
|
8870
|
+
eventClient.disconnect();
|
|
8727
8871
|
});
|
|
8728
8872
|
document.addEventListener("version-list-refresh", (e) => {
|
|
8729
8873
|
const n = e.detail?.library;
|
|
@@ -8743,4 +8887,30 @@ document.body.addEventListener("htmx:afterSwap", (e) => {
|
|
|
8743
8887
|
) : window.location.reload();
|
|
8744
8888
|
}
|
|
8745
8889
|
});
|
|
8890
|
+
document.body.addEventListener("htmx:responseError", (e) => {
|
|
8891
|
+
const n = e.detail?.xhr;
|
|
8892
|
+
if (!n) return;
|
|
8893
|
+
let i = "An error occurred";
|
|
8894
|
+
try {
|
|
8895
|
+
if (n.getResponseHeader("content-type")?.includes("application/json")) {
|
|
8896
|
+
const s = JSON.parse(n.response);
|
|
8897
|
+
i = s.message || s.error || i;
|
|
8898
|
+
} else n.response && typeof n.response == "string" && (i = n.response);
|
|
8899
|
+
} catch {
|
|
8900
|
+
i = n.statusText || i;
|
|
8901
|
+
}
|
|
8902
|
+
module_default.store("toast").show(i, "error"), e.preventDefault();
|
|
8903
|
+
});
|
|
8904
|
+
document.body.addEventListener("htmx:afterRequest", (e) => {
|
|
8905
|
+
const n = e.detail?.xhr;
|
|
8906
|
+
if (!n || !n.getResponseHeader) return;
|
|
8907
|
+
const i = n.getResponseHeader("HX-Trigger");
|
|
8908
|
+
if (i)
|
|
8909
|
+
try {
|
|
8910
|
+
const r = JSON.parse(i);
|
|
8911
|
+
r.toast && module_default.store("toast").show(r.toast.message, r.toast.type || "info");
|
|
8912
|
+
} catch (r) {
|
|
8913
|
+
console.debug("Failed to parse HX-Trigger header", r);
|
|
8914
|
+
}
|
|
8915
|
+
});
|
|
8746
8916
|
//# sourceMappingURL=main.js.map
|