@leonardaustin/ui 0.7.0 → 0.7.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/dist/components/ui/Card.d.ts.map +1 -1
- package/dist/components/ui/Dialog.d.ts +35 -4
- package/dist/components/ui/Dialog.d.ts.map +1 -1
- package/dist/components/ui/DialogActions.d.ts +14 -8
- package/dist/components/ui/DialogActions.d.ts.map +1 -1
- package/dist/components/ui/SideSheet.d.ts.map +1 -1
- package/dist/hooks/useDropUp.d.ts.map +1 -1
- package/dist/index.js +877 -707
- package/dist/lib/anchorPlacement.d.ts +44 -0
- package/dist/lib/anchorPlacement.d.ts.map +1 -0
- package/dist/lib/dialogDrag.d.ts +20 -11
- package/dist/lib/dialogDrag.d.ts.map +1 -1
- package/dist/lib/rect.d.ts +8 -0
- package/dist/lib/rect.d.ts.map +1 -0
- package/dist/styles.css +10 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2655,19 +2655,69 @@ function pn({ children: e, as: t = "h2", className: n, border: r = !0 }) {
|
|
|
2655
2655
|
});
|
|
2656
2656
|
}
|
|
2657
2657
|
//#endregion
|
|
2658
|
+
//#region src/lib/anchorPlacement.ts
|
|
2659
|
+
var mn = {
|
|
2660
|
+
top: "bottom",
|
|
2661
|
+
bottom: "top",
|
|
2662
|
+
left: "right",
|
|
2663
|
+
right: "left"
|
|
2664
|
+
}, hn = [
|
|
2665
|
+
"bottom",
|
|
2666
|
+
"top",
|
|
2667
|
+
"right",
|
|
2668
|
+
"left"
|
|
2669
|
+
];
|
|
2670
|
+
function gn(e, t, n) {
|
|
2671
|
+
switch (n) {
|
|
2672
|
+
case "top": return e.top - t.top;
|
|
2673
|
+
case "bottom": return t.bottom - e.bottom;
|
|
2674
|
+
case "left": return e.left - t.left;
|
|
2675
|
+
case "right": return t.right - e.right;
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
function _n(e, t, n, r) {
|
|
2679
|
+
return Math.min(Math.max(e, n), r - t);
|
|
2680
|
+
}
|
|
2681
|
+
function vn(e, t, { size: { width: n, height: r }, bounds: i, margin: a, gap: o }) {
|
|
2682
|
+
let s = i.left + a, c = i.right - a, l = i.top + a, u = i.bottom - a;
|
|
2683
|
+
if (n > c - s || r > u - l) return null;
|
|
2684
|
+
let d, f;
|
|
2685
|
+
return e === "top" || e === "bottom" ? (d = _n((t.left + t.right) / 2 - n / 2, n, s, c), f = e === "bottom" ? t.bottom + o : t.top - o - r) : (d = e === "right" ? t.right + o : t.left - o - n, f = _n((t.top + t.bottom) / 2 - r / 2, r, l, u)), d >= s && d + n <= c && f >= l && f + r <= u ? {
|
|
2686
|
+
side: e,
|
|
2687
|
+
left: d,
|
|
2688
|
+
top: f
|
|
2689
|
+
} : null;
|
|
2690
|
+
}
|
|
2691
|
+
function yn(e, t, n) {
|
|
2692
|
+
if (!t) return null;
|
|
2693
|
+
let { bounds: r } = n;
|
|
2694
|
+
if (!(t.right > r.left && t.left < r.right && t.bottom > r.top && t.top < r.bottom)) return null;
|
|
2695
|
+
let i = e === "auto" ? [...hn].sort((e, n) => gn(t, r, n) - gn(t, r, e)) : [e, mn[e]];
|
|
2696
|
+
for (let e of i) {
|
|
2697
|
+
let r = vn(e, t, n);
|
|
2698
|
+
if (r) return r;
|
|
2699
|
+
}
|
|
2700
|
+
return null;
|
|
2701
|
+
}
|
|
2702
|
+
//#endregion
|
|
2658
2703
|
//#region src/hooks/useDropUp.ts
|
|
2659
|
-
function
|
|
2704
|
+
function bn(e, t, n) {
|
|
2660
2705
|
let [r, i] = h(!1);
|
|
2661
2706
|
return f(() => {
|
|
2662
2707
|
if (!e || !n.current || !t.current) return;
|
|
2663
2708
|
let r = t.current.getBoundingClientRect(), a = n.current.getBoundingClientRect();
|
|
2664
|
-
i(
|
|
2709
|
+
i(gn(r, {
|
|
2710
|
+
left: 0,
|
|
2711
|
+
top: 0,
|
|
2712
|
+
right: window.innerWidth,
|
|
2713
|
+
bottom: window.innerHeight
|
|
2714
|
+
}, "bottom") < a.height + 8);
|
|
2665
2715
|
}, [e]), r;
|
|
2666
2716
|
}
|
|
2667
2717
|
//#endregion
|
|
2668
2718
|
//#region src/components/ui/SelectDropdown.tsx
|
|
2669
|
-
function
|
|
2670
|
-
let [c, l] = h(!1), [d, f] = h(-1), p = m(null), g = m(null), y =
|
|
2719
|
+
function xn({ options: e, value: t, onChange: n, label: r, placeholder: i = "Select...", className: a, size: o = "md" }) {
|
|
2720
|
+
let [c, l] = h(!1), [d, f] = h(-1), p = m(null), g = m(null), y = bn(c, p, g), b = u(), x = `${b}-listbox`, S = e.find((e) => e.value === t);
|
|
2671
2721
|
jt(c, s(() => l(!1), []), [p]);
|
|
2672
2722
|
function C() {
|
|
2673
2723
|
if (!c) {
|
|
@@ -2753,7 +2803,7 @@ function hn({ options: e, value: t, onChange: n, label: r, placeholder: i = "Sel
|
|
|
2753
2803
|
}
|
|
2754
2804
|
//#endregion
|
|
2755
2805
|
//#region src/components/ui/Slider.tsx
|
|
2756
|
-
function
|
|
2806
|
+
function Sn({ min: e, max: t, step: n = 1, value: r, onChange: i, onCommit: a, label: o, showValue: s, className: c }) {
|
|
2757
2807
|
let l = (r - e) / (t - e) * 100;
|
|
2758
2808
|
return /* @__PURE__ */ v("div", {
|
|
2759
2809
|
className: G("flex flex-col gap-1.5", c),
|
|
@@ -2781,7 +2831,7 @@ function gn({ min: e, max: t, step: n = 1, value: r, onChange: i, onCommit: a, l
|
|
|
2781
2831
|
}
|
|
2782
2832
|
//#endregion
|
|
2783
2833
|
//#region src/components/ui/ThemePreview.tsx
|
|
2784
|
-
function
|
|
2834
|
+
function Cn({ label: e, active: t, icon: n, preview: r, onClick: i, className: a }) {
|
|
2785
2835
|
return /* @__PURE__ */ v("button", {
|
|
2786
2836
|
type: "button",
|
|
2787
2837
|
onClick: i,
|
|
@@ -2804,7 +2854,7 @@ function _n({ label: e, active: t, icon: n, preview: r, onClick: i, className: a
|
|
|
2804
2854
|
}
|
|
2805
2855
|
//#endregion
|
|
2806
2856
|
//#region src/components/ui/Toggle.tsx
|
|
2807
|
-
function
|
|
2857
|
+
function wn({ checked: e, onChange: t, disabled: n, label: r, className: i }) {
|
|
2808
2858
|
return /* @__PURE__ */ v("label", {
|
|
2809
2859
|
className: G("flex w-fit items-center", n ? "cursor-not-allowed opacity-40" : "cursor-pointer", i),
|
|
2810
2860
|
style: { gap: 10 },
|
|
@@ -2837,13 +2887,13 @@ function vn({ checked: e, onChange: t, disabled: n, label: r, className: i }) {
|
|
|
2837
2887
|
}
|
|
2838
2888
|
//#endregion
|
|
2839
2889
|
//#region src/components/app-shell/themeMenuEvents.ts
|
|
2840
|
-
var
|
|
2841
|
-
function
|
|
2890
|
+
var Tn = "open-theme-menu";
|
|
2891
|
+
function En(e = Tn) {
|
|
2842
2892
|
typeof document > "u" || document.dispatchEvent(new CustomEvent(e));
|
|
2843
2893
|
}
|
|
2844
2894
|
//#endregion
|
|
2845
2895
|
//#region src/components/app-shell/ThemeMenu.tsx
|
|
2846
|
-
var
|
|
2896
|
+
var Dn = [
|
|
2847
2897
|
{
|
|
2848
2898
|
value: "dark",
|
|
2849
2899
|
label: "Dark",
|
|
@@ -2860,7 +2910,7 @@ var xn = [
|
|
|
2860
2910
|
Icon: ne
|
|
2861
2911
|
}
|
|
2862
2912
|
];
|
|
2863
|
-
function
|
|
2913
|
+
function On({ className: e, respondToOpenEvent: t = !0 }) {
|
|
2864
2914
|
let [n, r] = h(!1), [i, a] = h(!1), [o, c] = h({
|
|
2865
2915
|
top: 0,
|
|
2866
2916
|
right: 0
|
|
@@ -2888,7 +2938,7 @@ function Sn({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
2888
2938
|
let e = () => {
|
|
2889
2939
|
x(), r(!0), a(!0);
|
|
2890
2940
|
};
|
|
2891
|
-
return document.addEventListener(
|
|
2941
|
+
return document.addEventListener(Tn, e), () => document.removeEventListener(Tn, e);
|
|
2892
2942
|
}, [t, x]), l(() => {
|
|
2893
2943
|
if (n) return window.addEventListener("resize", x), window.addEventListener("scroll", x, !0), () => {
|
|
2894
2944
|
window.removeEventListener("resize", x), window.removeEventListener("scroll", x, !0);
|
|
@@ -2924,7 +2974,7 @@ function Sn({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
2924
2974
|
children: "Mode"
|
|
2925
2975
|
}), /* @__PURE__ */ _("div", {
|
|
2926
2976
|
className: "bg-bg-secondary border-border flex gap-1 rounded-md border p-1.5",
|
|
2927
|
-
children:
|
|
2977
|
+
children: Dn.map(({ value: e, label: t, Icon: n }) => /* @__PURE__ */ v("button", {
|
|
2928
2978
|
onClick: () => w(e),
|
|
2929
2979
|
className: G("font-navigation flex flex-1 cursor-pointer items-center justify-center gap-1.5 rounded px-2 py-1 text-xs transition-colors duration-[100ms]", C === e ? "bg-accent-muted text-accent" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
|
|
2930
2980
|
children: [/* @__PURE__ */ _(n, { className: "h-3.5 w-3.5" }), t]
|
|
@@ -2937,7 +2987,7 @@ function Sn({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
2937
2987
|
children: "Dark themes"
|
|
2938
2988
|
}), /* @__PURE__ */ _("div", {
|
|
2939
2989
|
className: "grid grid-cols-2 gap-2",
|
|
2940
|
-
children: Tt.map((e) => /* @__PURE__ */ _(
|
|
2990
|
+
children: Tt.map((e) => /* @__PURE__ */ _(Cn, {
|
|
2941
2991
|
label: e.label,
|
|
2942
2992
|
icon: e.icon,
|
|
2943
2993
|
preview: e.preview,
|
|
@@ -2952,7 +3002,7 @@ function Sn({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
2952
3002
|
children: "Light themes"
|
|
2953
3003
|
}), /* @__PURE__ */ _("div", {
|
|
2954
3004
|
className: "grid grid-cols-2 gap-2",
|
|
2955
|
-
children: wt.map((e) => /* @__PURE__ */ _(
|
|
3005
|
+
children: wt.map((e) => /* @__PURE__ */ _(Cn, {
|
|
2956
3006
|
label: e.label,
|
|
2957
3007
|
icon: e.icon,
|
|
2958
3008
|
preview: e.preview,
|
|
@@ -2986,28 +3036,28 @@ function Sn({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
2986
3036
|
}), /* @__PURE__ */ v("div", {
|
|
2987
3037
|
className: "grid grid-cols-2 gap-2",
|
|
2988
3038
|
children: [
|
|
2989
|
-
/* @__PURE__ */ _(
|
|
3039
|
+
/* @__PURE__ */ _(xn, {
|
|
2990
3040
|
label: "UI / Body",
|
|
2991
3041
|
size: "sm",
|
|
2992
3042
|
options: kt,
|
|
2993
3043
|
value: j,
|
|
2994
3044
|
onChange: (e) => M(e)
|
|
2995
3045
|
}),
|
|
2996
|
-
/* @__PURE__ */ _(
|
|
3046
|
+
/* @__PURE__ */ _(xn, {
|
|
2997
3047
|
label: "Headings",
|
|
2998
3048
|
size: "sm",
|
|
2999
3049
|
options: kt,
|
|
3000
3050
|
value: N,
|
|
3001
3051
|
onChange: (e) => P(e)
|
|
3002
3052
|
}),
|
|
3003
|
-
/* @__PURE__ */ _(
|
|
3053
|
+
/* @__PURE__ */ _(xn, {
|
|
3004
3054
|
label: "Prose",
|
|
3005
3055
|
size: "sm",
|
|
3006
3056
|
options: kt,
|
|
3007
3057
|
value: F,
|
|
3008
3058
|
onChange: (e) => I(e)
|
|
3009
3059
|
}),
|
|
3010
|
-
/* @__PURE__ */ _(
|
|
3060
|
+
/* @__PURE__ */ _(xn, {
|
|
3011
3061
|
label: "Code",
|
|
3012
3062
|
size: "sm",
|
|
3013
3063
|
options: kt,
|
|
@@ -3019,7 +3069,7 @@ function Sn({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
3019
3069
|
/* @__PURE__ */ v("div", {
|
|
3020
3070
|
className: "space-y-3",
|
|
3021
3071
|
children: [
|
|
3022
|
-
/* @__PURE__ */ _(
|
|
3072
|
+
/* @__PURE__ */ _(Sn, {
|
|
3023
3073
|
label: "Font size",
|
|
3024
3074
|
min: 11,
|
|
3025
3075
|
max: 18,
|
|
@@ -3027,7 +3077,7 @@ function Sn({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
3027
3077
|
onChange: A,
|
|
3028
3078
|
showValue: !0
|
|
3029
3079
|
}),
|
|
3030
|
-
/* @__PURE__ */ _(
|
|
3080
|
+
/* @__PURE__ */ _(Sn, {
|
|
3031
3081
|
label: "Corner radius",
|
|
3032
3082
|
min: 0,
|
|
3033
3083
|
max: 16,
|
|
@@ -3035,7 +3085,7 @@ function Sn({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
3035
3085
|
onChange: te,
|
|
3036
3086
|
showValue: !0
|
|
3037
3087
|
}),
|
|
3038
|
-
/* @__PURE__ */ _(
|
|
3088
|
+
/* @__PURE__ */ _(Sn, {
|
|
3039
3089
|
label: "Border width",
|
|
3040
3090
|
min: 1,
|
|
3041
3091
|
max: 3,
|
|
@@ -3043,7 +3093,7 @@ function Sn({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
3043
3093
|
onChange: re,
|
|
3044
3094
|
showValue: !0
|
|
3045
3095
|
}),
|
|
3046
|
-
/* @__PURE__ */ _(
|
|
3096
|
+
/* @__PURE__ */ _(Sn, {
|
|
3047
3097
|
label: "Letter spacing",
|
|
3048
3098
|
min: 0,
|
|
3049
3099
|
max: .3,
|
|
@@ -3052,7 +3102,7 @@ function Sn({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
3052
3102
|
onChange: ae,
|
|
3053
3103
|
showValue: !0
|
|
3054
3104
|
}),
|
|
3055
|
-
/* @__PURE__ */ _(
|
|
3105
|
+
/* @__PURE__ */ _(Sn, {
|
|
3056
3106
|
label: "Line height",
|
|
3057
3107
|
min: 1.2,
|
|
3058
3108
|
max: 2,
|
|
@@ -3061,7 +3111,7 @@ function Sn({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
3061
3111
|
onChange: oe,
|
|
3062
3112
|
showValue: !0
|
|
3063
3113
|
}),
|
|
3064
|
-
/* @__PURE__ */ _(
|
|
3114
|
+
/* @__PURE__ */ _(Sn, {
|
|
3065
3115
|
label: "Density",
|
|
3066
3116
|
min: .18,
|
|
3067
3117
|
max: .32,
|
|
@@ -3072,7 +3122,7 @@ function Sn({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
3072
3122
|
})
|
|
3073
3123
|
]
|
|
3074
3124
|
}),
|
|
3075
|
-
/* @__PURE__ */ _(
|
|
3125
|
+
/* @__PURE__ */ _(wn, {
|
|
3076
3126
|
label: "Reduced motion",
|
|
3077
3127
|
checked: V,
|
|
3078
3128
|
onChange: le
|
|
@@ -3103,25 +3153,25 @@ function Sn({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
3103
3153
|
}
|
|
3104
3154
|
//#endregion
|
|
3105
3155
|
//#region src/components/app-shell/TopBar.tsx
|
|
3106
|
-
var
|
|
3156
|
+
var kn = [
|
|
3107
3157
|
"dark",
|
|
3108
3158
|
"light",
|
|
3109
3159
|
"system"
|
|
3110
|
-
],
|
|
3160
|
+
], An = {
|
|
3111
3161
|
dark: re,
|
|
3112
3162
|
light: se,
|
|
3113
3163
|
system: ne
|
|
3114
|
-
},
|
|
3164
|
+
}, jn = {
|
|
3115
3165
|
dark: "Dark",
|
|
3116
3166
|
light: "Light",
|
|
3117
3167
|
system: "System"
|
|
3118
3168
|
};
|
|
3119
|
-
function
|
|
3169
|
+
function Mn({ onMobileMenuToggle: e, breadcrumbs: t, navItems: n = [], navLabel: r = "Primary", showCommandTrigger: i = !0, commandTriggerLabel: a = "Search", commandShortcut: o = mt, currentPath: s, onNavigate: c, onCommandTrigger: l, actions: u }) {
|
|
3120
3170
|
let { sidebarCollapsed: d, setSidebarCollapsed: f, colorMode: p, setColorMode: m } = Nt();
|
|
3121
3171
|
function h() {
|
|
3122
|
-
m(
|
|
3172
|
+
m(kn[(kn.indexOf(p) + 1) % kn.length]);
|
|
3123
3173
|
}
|
|
3124
|
-
let y =
|
|
3174
|
+
let y = An[p], b = n.length > 0;
|
|
3125
3175
|
return /* @__PURE__ */ v("header", {
|
|
3126
3176
|
className: "border-border bg-bg-secondary font-navigation flex h-9 shrink-0 items-center justify-between border-b px-3",
|
|
3127
3177
|
style: { height: "var(--topbar-height)" },
|
|
@@ -3140,7 +3190,7 @@ function En({ onMobileMenuToggle: e, breadcrumbs: t, navItems: n = [], navLabel:
|
|
|
3140
3190
|
"aria-label": d ? "Expand sidebar" : "Collapse sidebar",
|
|
3141
3191
|
children: _(d ? ae : ie, { className: "h-4 w-4" })
|
|
3142
3192
|
}),
|
|
3143
|
-
(b || t !== !1) && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", { className: "bg-border hidden h-4 w-px md:block" }), b ? /* @__PURE__ */ _(
|
|
3193
|
+
(b || t !== !1) && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", { className: "bg-border hidden h-4 w-px md:block" }), b ? /* @__PURE__ */ _(Nn, {
|
|
3144
3194
|
items: n,
|
|
3145
3195
|
label: r,
|
|
3146
3196
|
currentPath: s,
|
|
@@ -3173,16 +3223,16 @@ function En({ onMobileMenuToggle: e, breadcrumbs: t, navItems: n = [], navLabel:
|
|
|
3173
3223
|
/* @__PURE__ */ _("button", {
|
|
3174
3224
|
onClick: h,
|
|
3175
3225
|
className: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover flex h-7 w-7 cursor-pointer items-center justify-center rounded",
|
|
3176
|
-
"aria-label": `Color mode: ${
|
|
3177
|
-
title:
|
|
3226
|
+
"aria-label": `Color mode: ${jn[p]}. Click to cycle.`,
|
|
3227
|
+
title: jn[p],
|
|
3178
3228
|
children: /* @__PURE__ */ _(y, { className: "h-4 w-4" })
|
|
3179
3229
|
}),
|
|
3180
|
-
/* @__PURE__ */ _(
|
|
3230
|
+
/* @__PURE__ */ _(On, {})
|
|
3181
3231
|
]
|
|
3182
3232
|
})]
|
|
3183
3233
|
});
|
|
3184
3234
|
}
|
|
3185
|
-
function
|
|
3235
|
+
function Nn({ items: e, label: t, currentPath: n, onNavigate: r }) {
|
|
3186
3236
|
return /* @__PURE__ */ _("nav", {
|
|
3187
3237
|
className: "hidden min-w-0 items-center gap-1 md:flex",
|
|
3188
3238
|
"aria-label": t,
|
|
@@ -3214,7 +3264,7 @@ function Dn({ items: e, label: t, currentPath: n, onNavigate: r }) {
|
|
|
3214
3264
|
}
|
|
3215
3265
|
//#endregion
|
|
3216
3266
|
//#region src/components/app-shell/AppShell.tsx
|
|
3217
|
-
function
|
|
3267
|
+
function Pn({ children: e, navSections: t, brand: n, accounts: r, bottomNavItems: i = [], commandItems: a, breadcrumbs: o, initialAccountIndex: s, onAccountChange: c, onSignOut: l, signOutPath: u, signOutLabel: d, settingsPath: f, settingsLabel: m, onOpenSettings: g, showCommandPalette: y = !0, showCommandTrigger: b = !0, commandTriggerLabel: x, commandShortcut: S, sidebarHeaderActions: C, topBarActions: w, topBarNavItems: T, topBarNavLabel: E, currentPath: D, onNavigate: O, mainClassName: k, className: A }) {
|
|
3218
3268
|
let [j, M] = h(!1), N = p(() => t.flatMap((e) => e.items), [t]), P = a ?? N;
|
|
3219
3269
|
return /* @__PURE__ */ v("div", {
|
|
3220
3270
|
className: G("bg-bg-primary flex h-svh overflow-hidden", A),
|
|
@@ -3242,7 +3292,7 @@ function On({ children: e, navSections: t, brand: n, accounts: r, bottomNavItems
|
|
|
3242
3292
|
}),
|
|
3243
3293
|
/* @__PURE__ */ v("div", {
|
|
3244
3294
|
className: "flex min-w-0 flex-1 flex-col",
|
|
3245
|
-
children: [/* @__PURE__ */ _(
|
|
3295
|
+
children: [/* @__PURE__ */ _(Mn, {
|
|
3246
3296
|
onMobileMenuToggle: () => M(!0),
|
|
3247
3297
|
breadcrumbs: o,
|
|
3248
3298
|
showCommandTrigger: y && b,
|
|
@@ -3285,7 +3335,7 @@ function On({ children: e, navSections: t, brand: n, accounts: r, bottomNavItems
|
|
|
3285
3335
|
}
|
|
3286
3336
|
//#endregion
|
|
3287
3337
|
//#region src/components/app-shell/AuthLayout.tsx
|
|
3288
|
-
function
|
|
3338
|
+
function Fn({ children: e, className: t }) {
|
|
3289
3339
|
return /* @__PURE__ */ v("div", {
|
|
3290
3340
|
className: G("bg-bg-primary relative flex min-h-svh items-center justify-center p-4", t),
|
|
3291
3341
|
children: [/* @__PURE__ */ _("div", {
|
|
@@ -3296,7 +3346,7 @@ function kn({ children: e, className: t }) {
|
|
|
3296
3346
|
}
|
|
3297
3347
|
//#endregion
|
|
3298
3348
|
//#region src/components/app-shell/BackLink.tsx
|
|
3299
|
-
function
|
|
3349
|
+
function In({ to: e, children: t, onNavigate: n, className: r }) {
|
|
3300
3350
|
return /* @__PURE__ */ v("a", {
|
|
3301
3351
|
href: e,
|
|
3302
3352
|
onClick: (t) => ct(t, e, n),
|
|
@@ -3306,14 +3356,14 @@ function An({ to: e, children: t, onNavigate: n, className: r }) {
|
|
|
3306
3356
|
}
|
|
3307
3357
|
//#endregion
|
|
3308
3358
|
//#region src/components/ui/FieldContext.ts
|
|
3309
|
-
var
|
|
3310
|
-
function
|
|
3359
|
+
var Ln = r(null);
|
|
3360
|
+
function Rn(...e) {
|
|
3311
3361
|
return [...new Set(e.flatMap((e) => e?.split(/\s+/).filter(Boolean) ?? []))].join(" ") || void 0;
|
|
3312
3362
|
}
|
|
3313
3363
|
//#endregion
|
|
3314
3364
|
//#region src/components/ui/Checkbox.tsx
|
|
3315
|
-
var
|
|
3316
|
-
let x = u(), S = an(s), C = c(
|
|
3365
|
+
var zn = a(({ id: e, checked: t, indeterminate: n, onChange: r, label: i, ariaLabel: a, disabled: o, controlSize: s, className: d, "aria-label": f, "aria-describedby": p, "aria-invalid": h, required: g, ...y }, b) => {
|
|
3366
|
+
let x = u(), S = an(s), C = c(Ln), w = e ?? C?.id ?? x, T = m(null);
|
|
3317
3367
|
return l(() => {
|
|
3318
3368
|
T.current && (T.current.indeterminate = !!n);
|
|
3319
3369
|
}, [n]), /* @__PURE__ */ v("div", {
|
|
@@ -3332,7 +3382,7 @@ var Nn = a(({ id: e, checked: t, indeterminate: n, onChange: r, label: i, ariaLa
|
|
|
3332
3382
|
checked: t,
|
|
3333
3383
|
"aria-checked": n ? "mixed" : t,
|
|
3334
3384
|
"aria-label": f ?? a,
|
|
3335
|
-
"aria-describedby":
|
|
3385
|
+
"aria-describedby": Rn(p, C?.describedBy),
|
|
3336
3386
|
"aria-invalid": h ?? (C?.invalid || void 0),
|
|
3337
3387
|
disabled: o,
|
|
3338
3388
|
required: g ?? C?.required,
|
|
@@ -3350,10 +3400,10 @@ var Nn = a(({ id: e, checked: t, indeterminate: n, onChange: r, label: i, ariaLa
|
|
|
3350
3400
|
})]
|
|
3351
3401
|
});
|
|
3352
3402
|
});
|
|
3353
|
-
|
|
3403
|
+
zn.displayName = "Checkbox";
|
|
3354
3404
|
//#endregion
|
|
3355
3405
|
//#region src/components/ui/FilterButton.tsx
|
|
3356
|
-
var
|
|
3406
|
+
var Bn = a(function({ icon: e, children: t, className: n, ...r }, i) {
|
|
3357
3407
|
return /* @__PURE__ */ v("button", {
|
|
3358
3408
|
ref: i,
|
|
3359
3409
|
className: G("flex h-7 cursor-pointer items-center gap-1.5 rounded-md px-2.5", "border-border bg-bg-secondary text-text-secondary border", "hover:bg-bg-hover hover:border-border-strong", "text-xs", "transition-colors duration-[100ms]", n),
|
|
@@ -3366,15 +3416,15 @@ var Pn = a(function({ icon: e, children: t, className: n, ...r }, i) {
|
|
|
3366
3416
|
});
|
|
3367
3417
|
//#endregion
|
|
3368
3418
|
//#region src/components/tables/ColumnPicker.tsx
|
|
3369
|
-
function
|
|
3419
|
+
function Vn(e) {
|
|
3370
3420
|
return typeof e.header == "string" ? e.header : e.sortLabel ?? e.key;
|
|
3371
3421
|
}
|
|
3372
|
-
function
|
|
3422
|
+
function Hn({ columns: e, hidden: n, onToggle: r, label: i = "Columns", heading: a = "Toggle columns", icon: o = M, onOnly: c, onlyLabel: l = "Only", footer: u }) {
|
|
3373
3423
|
let [d, f] = h(!1), p = m(null);
|
|
3374
3424
|
return jt(d, s(() => f(!1), []), [p]), /* @__PURE__ */ v("div", {
|
|
3375
3425
|
className: "relative",
|
|
3376
3426
|
ref: p,
|
|
3377
|
-
children: [/* @__PURE__ */ _(
|
|
3427
|
+
children: [/* @__PURE__ */ _(Bn, {
|
|
3378
3428
|
icon: o,
|
|
3379
3429
|
onClick: () => f(!d),
|
|
3380
3430
|
children: i
|
|
@@ -3387,10 +3437,10 @@ function In({ columns: e, hidden: n, onToggle: r, label: i = "Columns", heading:
|
|
|
3387
3437
|
onClick: () => r(i.key),
|
|
3388
3438
|
className: "group text-text-secondary hover:text-text-primary hover:bg-bg-hover flex h-7 w-full cursor-pointer items-center gap-2.5 px-3 text-xs transition-colors duration-[100ms]",
|
|
3389
3439
|
children: [
|
|
3390
|
-
/* @__PURE__ */ _(
|
|
3440
|
+
/* @__PURE__ */ _(zn, {
|
|
3391
3441
|
checked: !n.has(i.key),
|
|
3392
3442
|
onChange: () => {},
|
|
3393
|
-
ariaLabel:
|
|
3443
|
+
ariaLabel: Vn(i)
|
|
3394
3444
|
}),
|
|
3395
3445
|
/* @__PURE__ */ _("span", {
|
|
3396
3446
|
className: "min-w-0 flex-1 truncate",
|
|
@@ -3398,7 +3448,7 @@ function In({ columns: e, hidden: n, onToggle: r, label: i = "Columns", heading:
|
|
|
3398
3448
|
}),
|
|
3399
3449
|
c && /* @__PURE__ */ _("button", {
|
|
3400
3450
|
type: "button",
|
|
3401
|
-
"aria-label": `${l}: ${
|
|
3451
|
+
"aria-label": `${l}: ${Vn(i)}`,
|
|
3402
3452
|
onClick: (e) => {
|
|
3403
3453
|
e.stopPropagation(), c(i.key);
|
|
3404
3454
|
},
|
|
@@ -3415,7 +3465,7 @@ function In({ columns: e, hidden: n, onToggle: r, label: i = "Columns", heading:
|
|
|
3415
3465
|
}
|
|
3416
3466
|
//#endregion
|
|
3417
3467
|
//#region src/components/tables/Pagination.tsx
|
|
3418
|
-
function
|
|
3468
|
+
function Un({ page: e, totalPages: t, onPageChange: n }) {
|
|
3419
3469
|
if (t <= 1) return null;
|
|
3420
3470
|
let r = [];
|
|
3421
3471
|
for (let n = 1; n <= t; n++) n === 1 || n === t || n >= e - 1 && n <= e + 1 ? r.push(n) : r[r.length - 1] !== "ellipsis" && r.push("ellipsis");
|
|
@@ -3449,7 +3499,7 @@ function Ln({ page: e, totalPages: t, onPageChange: n }) {
|
|
|
3449
3499
|
}
|
|
3450
3500
|
//#endregion
|
|
3451
3501
|
//#region src/components/tables/sortRows.ts
|
|
3452
|
-
function
|
|
3502
|
+
function Wn(e, t, n, r) {
|
|
3453
3503
|
if (!n) return e;
|
|
3454
3504
|
let i = t.find((e) => e.key === n)?.getValue;
|
|
3455
3505
|
return i ? [...e].sort((e, t) => {
|
|
@@ -3459,8 +3509,8 @@ function Rn(e, t, n, r) {
|
|
|
3459
3509
|
}
|
|
3460
3510
|
//#endregion
|
|
3461
3511
|
//#region src/components/tables/ResourceTable.tsx
|
|
3462
|
-
function
|
|
3463
|
-
let b = c !== void 0, [S, w] = h(null), [T, E] = h("asc"), D = b ? o ?? null : S, O = b ? s ?? "asc" : T, k = p(() => b ? e :
|
|
3512
|
+
function Gn({ data: e, columns: t, getRowId: n, onRowClick: r, emptyMessage: a = "No data", sortKey: o, sortDir: s, onSortChange: c, caption: l, loading: u = !1, loadingMessage: d = "Loading…", className: f, tableProps: m, getRowProps: g, isRowSelected: y }) {
|
|
3513
|
+
let b = c !== void 0, [S, w] = h(null), [T, E] = h("asc"), D = b ? o ?? null : S, O = b ? s ?? "asc" : T, k = p(() => b ? e : Wn(e, t, D, O), [
|
|
3464
3514
|
b,
|
|
3465
3515
|
e,
|
|
3466
3516
|
t,
|
|
@@ -3535,7 +3585,7 @@ function zn({ data: e, columns: t, getRowId: n, onRowClick: r, emptyMessage: a =
|
|
|
3535
3585
|
}
|
|
3536
3586
|
//#endregion
|
|
3537
3587
|
//#region src/components/ui/Alert.tsx
|
|
3538
|
-
var
|
|
3588
|
+
var Kn = {
|
|
3539
3589
|
success: {
|
|
3540
3590
|
bg: "bg-green-muted",
|
|
3541
3591
|
border: "border-green/30",
|
|
@@ -3561,10 +3611,10 @@ var Bn = {
|
|
|
3561
3611
|
iconColor: "text-blue"
|
|
3562
3612
|
}
|
|
3563
3613
|
};
|
|
3564
|
-
function
|
|
3614
|
+
function qn({ type: e, title: t, children: n, dismissible: r, className: i }) {
|
|
3565
3615
|
let [a, o] = h(!1);
|
|
3566
3616
|
if (a) return null;
|
|
3567
|
-
let s =
|
|
3617
|
+
let s = Kn[e], c = s.icon;
|
|
3568
3618
|
return /* @__PURE__ */ v("div", {
|
|
3569
3619
|
className: G("flex gap-2.5 rounded-md border p-3", s.bg, s.border, i),
|
|
3570
3620
|
children: [
|
|
@@ -3590,7 +3640,7 @@ function Vn({ type: e, title: t, children: n, dismissible: r, className: i }) {
|
|
|
3590
3640
|
}
|
|
3591
3641
|
//#endregion
|
|
3592
3642
|
//#region src/components/ui/AuthCard.tsx
|
|
3593
|
-
function
|
|
3643
|
+
function Jn({ title: e, subtitle: t, icon: n, children: r, footer: i, className: a }) {
|
|
3594
3644
|
return /* @__PURE__ */ _("div", {
|
|
3595
3645
|
className: G("relative z-10 w-full max-w-sm", a),
|
|
3596
3646
|
children: /* @__PURE__ */ v("div", {
|
|
@@ -3624,7 +3674,7 @@ function Hn({ title: e, subtitle: t, icon: n, children: r, footer: i, className:
|
|
|
3624
3674
|
}
|
|
3625
3675
|
//#endregion
|
|
3626
3676
|
//#region src/components/ui/AuthorByline.tsx
|
|
3627
|
-
function
|
|
3677
|
+
function Yn({ name: e, meta: t, nameAppend: n, size: r = "sm", className: i }) {
|
|
3628
3678
|
return /* @__PURE__ */ v("div", {
|
|
3629
3679
|
className: G("flex items-center gap-2", i),
|
|
3630
3680
|
children: [/* @__PURE__ */ _(Lt, {
|
|
@@ -3641,14 +3691,14 @@ function Un({ name: e, meta: t, nameAppend: n, size: r = "sm", className: i }) {
|
|
|
3641
3691
|
}
|
|
3642
3692
|
//#endregion
|
|
3643
3693
|
//#region src/components/ui/Badge.tsx
|
|
3644
|
-
var
|
|
3694
|
+
var Xn = {
|
|
3645
3695
|
green: "bg-green-muted text-green",
|
|
3646
3696
|
yellow: "bg-yellow-muted text-yellow",
|
|
3647
3697
|
red: "bg-red-muted text-red",
|
|
3648
3698
|
blue: "bg-blue-muted text-blue",
|
|
3649
3699
|
purple: "bg-purple-muted text-purple",
|
|
3650
3700
|
gray: "bg-bg-hover text-text-secondary"
|
|
3651
|
-
},
|
|
3701
|
+
}, Zn = {
|
|
3652
3702
|
green: "bg-green",
|
|
3653
3703
|
yellow: "bg-yellow",
|
|
3654
3704
|
red: "bg-red",
|
|
@@ -3656,15 +3706,15 @@ var Wn = {
|
|
|
3656
3706
|
purple: "bg-purple",
|
|
3657
3707
|
gray: "bg-text-tertiary"
|
|
3658
3708
|
};
|
|
3659
|
-
function
|
|
3709
|
+
function Qn({ color: e = "gray", dot: t, children: n, className: r }) {
|
|
3660
3710
|
return /* @__PURE__ */ v("span", {
|
|
3661
|
-
className: G("font-label text-2xs inline-flex items-center gap-1.5 rounded-md px-2 py-0.5 font-medium",
|
|
3662
|
-
children: [t && /* @__PURE__ */ _("span", { className: G("h-1.5 w-1.5 rounded-full",
|
|
3711
|
+
className: G("font-label text-2xs inline-flex items-center gap-1.5 rounded-md px-2 py-0.5 font-medium", Xn[e], r),
|
|
3712
|
+
children: [t && /* @__PURE__ */ _("span", { className: G("h-1.5 w-1.5 rounded-full", Zn[e]) }), n]
|
|
3663
3713
|
});
|
|
3664
3714
|
}
|
|
3665
3715
|
//#endregion
|
|
3666
3716
|
//#region src/lib/calendar.ts
|
|
3667
|
-
var
|
|
3717
|
+
var $n = /* @__PURE__ */ new Map();
|
|
3668
3718
|
function Z(e, t) {
|
|
3669
3719
|
if (!t) return {
|
|
3670
3720
|
year: e.getFullYear(),
|
|
@@ -3675,7 +3725,7 @@ function Z(e, t) {
|
|
|
3675
3725
|
second: e.getSeconds(),
|
|
3676
3726
|
millisecond: e.getMilliseconds()
|
|
3677
3727
|
};
|
|
3678
|
-
let n =
|
|
3728
|
+
let n = $n.get(t);
|
|
3679
3729
|
n || (n = new Intl.DateTimeFormat("en-GB-u-ca-iso8601-nu-latn", {
|
|
3680
3730
|
timeZone: t,
|
|
3681
3731
|
year: "numeric",
|
|
@@ -3685,7 +3735,7 @@ function Z(e, t) {
|
|
|
3685
3735
|
minute: "2-digit",
|
|
3686
3736
|
second: "2-digit",
|
|
3687
3737
|
hourCycle: "h23"
|
|
3688
|
-
}),
|
|
3738
|
+
}), $n.set(t, n));
|
|
3689
3739
|
let r = {};
|
|
3690
3740
|
for (let t of n.formatToParts(e)) t.type !== "literal" && (r[t.type] = Number(t.value));
|
|
3691
3741
|
return {
|
|
@@ -3698,12 +3748,12 @@ function Z(e, t) {
|
|
|
3698
3748
|
millisecond: e.getUTCMilliseconds()
|
|
3699
3749
|
};
|
|
3700
3750
|
}
|
|
3701
|
-
function
|
|
3751
|
+
function er(e) {
|
|
3702
3752
|
let t = /* @__PURE__ */ new Date(0);
|
|
3703
3753
|
return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(e.hour, e.minute, e.second, e.millisecond), t.getTime();
|
|
3704
3754
|
}
|
|
3705
|
-
function
|
|
3706
|
-
let r =
|
|
3755
|
+
function tr(e, t, n = "compatible") {
|
|
3756
|
+
let r = er(e), i = new Date(r);
|
|
3707
3757
|
if (!Object.values(e).every(Number.isInteger) || i.getUTCFullYear() !== e.year || i.getUTCMonth() + 1 !== e.month || i.getUTCDate() !== e.day || i.getUTCHours() !== e.hour || i.getUTCMinutes() !== e.minute || i.getUTCSeconds() !== e.second || i.getUTCMilliseconds() !== e.millisecond) throw RangeError("Invalid civil date and time");
|
|
3708
3758
|
if (!t) {
|
|
3709
3759
|
let t = /* @__PURE__ */ new Date(0);
|
|
@@ -3718,98 +3768,98 @@ function Yn(e, t, n = "compatible") {
|
|
|
3718
3768
|
48
|
|
3719
3769
|
]) {
|
|
3720
3770
|
let n = r + e * 36e5;
|
|
3721
|
-
a.add(
|
|
3771
|
+
a.add(er(Z(new Date(n), t)) - n);
|
|
3722
3772
|
}
|
|
3723
|
-
let o = [...a].map((e) => r - e).sort((e, t) => e - t), s = o.filter((e) =>
|
|
3773
|
+
let o = [...a].map((e) => r - e).sort((e, t) => e - t), s = o.filter((e) => er(Z(new Date(e), t)) === r);
|
|
3724
3774
|
if (s.length === 1) return new Date(s[0]);
|
|
3725
3775
|
if (n === "reject") throw RangeError(s.length ? "This time occurs twice in the selected timezone" : "This time does not exist in the selected timezone");
|
|
3726
3776
|
return s.length ? new Date(n === "later" ? s[s.length - 1] : s[0]) : new Date(n === "earlier" ? o[0] : o[o.length - 1]);
|
|
3727
3777
|
}
|
|
3728
|
-
var
|
|
3778
|
+
var nr = 1440, rr = 6e4, ir = [
|
|
3729
3779
|
1,
|
|
3730
3780
|
2,
|
|
3731
3781
|
3,
|
|
3732
3782
|
4,
|
|
3733
3783
|
5
|
|
3734
3784
|
];
|
|
3735
|
-
function
|
|
3785
|
+
function ar(e) {
|
|
3736
3786
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
3737
3787
|
}
|
|
3738
3788
|
function Q(e, t) {
|
|
3739
3789
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t, e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
|
|
3740
3790
|
}
|
|
3741
|
-
function
|
|
3791
|
+
function or(e, t) {
|
|
3742
3792
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes() + t, e.getSeconds(), e.getMilliseconds());
|
|
3743
3793
|
}
|
|
3744
|
-
function
|
|
3794
|
+
function sr(e, t) {
|
|
3745
3795
|
let n = new Date(e.getFullYear(), e.getMonth() + t, 1), r = new Date(n.getFullYear(), n.getMonth() + 1, 0).getDate();
|
|
3746
3796
|
return new Date(n.getFullYear(), n.getMonth(), Math.min(e.getDate(), r), e.getHours(), e.getMinutes());
|
|
3747
3797
|
}
|
|
3748
|
-
function
|
|
3749
|
-
let n =
|
|
3798
|
+
function cr(e, t = 1) {
|
|
3799
|
+
let n = ar(e);
|
|
3750
3800
|
return Q(n, -((n.getDay() - t + 7) % 7));
|
|
3751
3801
|
}
|
|
3752
|
-
function
|
|
3802
|
+
function lr(e) {
|
|
3753
3803
|
return new Date(e.getFullYear(), e.getMonth(), 1);
|
|
3754
3804
|
}
|
|
3755
|
-
function
|
|
3805
|
+
function ur(e, t) {
|
|
3756
3806
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
3757
3807
|
}
|
|
3758
|
-
function
|
|
3808
|
+
function dr(e, t) {
|
|
3759
3809
|
let n = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()), r = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
|
|
3760
3810
|
return Math.round((n - r) / 864e5);
|
|
3761
3811
|
}
|
|
3762
|
-
function
|
|
3763
|
-
return e.getHours() * 60 + e.getMinutes() + e.getSeconds() / 60 + e.getMilliseconds() /
|
|
3812
|
+
function fr(e) {
|
|
3813
|
+
return e.getHours() * 60 + e.getMinutes() + e.getSeconds() / 60 + e.getMilliseconds() / rr;
|
|
3764
3814
|
}
|
|
3765
|
-
function
|
|
3766
|
-
let n =
|
|
3767
|
-
if (!
|
|
3815
|
+
function pr(e, t) {
|
|
3816
|
+
let n = mr(e, t);
|
|
3817
|
+
if (!ur(n, e) || fr(n) <= t) return n;
|
|
3768
3818
|
let r = Math.floor(t);
|
|
3769
|
-
for (; r > 0 &&
|
|
3770
|
-
return /* @__PURE__ */ new Date(n.getTime() - (t - r) *
|
|
3819
|
+
for (; r > 0 && fr(mr(e, r - 1)) !== r - 1;) r--;
|
|
3820
|
+
return /* @__PURE__ */ new Date(n.getTime() - (t - r) * rr);
|
|
3771
3821
|
}
|
|
3772
|
-
function
|
|
3822
|
+
function mr(e, t) {
|
|
3773
3823
|
let n = Math.floor(t);
|
|
3774
3824
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate(), 0, n, Math.round((t - n) * 60));
|
|
3775
3825
|
}
|
|
3776
|
-
function
|
|
3826
|
+
function hr(e) {
|
|
3777
3827
|
let t = /^(\d{1,2}):(\d{2})$/.exec(e.trim());
|
|
3778
3828
|
if (!t) throw RangeError(`Invalid time "${e}", expected HH:mm`);
|
|
3779
3829
|
let n = Number(t[1]), r = Number(t[2]);
|
|
3780
3830
|
if (r > 59 || n > 24 || n === 24 && r > 0) throw RangeError(`Invalid time "${e}"`);
|
|
3781
3831
|
return n * 60 + r;
|
|
3782
3832
|
}
|
|
3783
|
-
function
|
|
3833
|
+
function gr(e) {
|
|
3784
3834
|
let t = Math.round(e), n = Math.floor(t / 60), r = t % 60;
|
|
3785
3835
|
return `${String(n).padStart(2, "0")}:${String(r).padStart(2, "0")}`;
|
|
3786
3836
|
}
|
|
3787
|
-
function
|
|
3837
|
+
function _r(e) {
|
|
3788
3838
|
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
3789
3839
|
}
|
|
3790
|
-
function
|
|
3840
|
+
function vr(e) {
|
|
3791
3841
|
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
|
|
3792
3842
|
if (!t) throw RangeError(`Invalid date key "${e}"`);
|
|
3793
3843
|
let n = new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3]));
|
|
3794
|
-
if (
|
|
3844
|
+
if (_r(n) !== e) throw RangeError(`Invalid date key "${e}"`);
|
|
3795
3845
|
return n;
|
|
3796
3846
|
}
|
|
3797
|
-
function
|
|
3847
|
+
function yr(e, t, n = "round") {
|
|
3798
3848
|
if (t <= 0) return e;
|
|
3799
3849
|
let r = n === "floor" ? Math.floor : n === "ceil" ? Math.ceil : Math.round, i = e / t;
|
|
3800
3850
|
return r(n === "floor" ? i + 1e-9 : n === "ceil" ? i - 1e-9 : i) * t;
|
|
3801
3851
|
}
|
|
3802
|
-
function
|
|
3803
|
-
return
|
|
3852
|
+
function br(e, t, n = "round") {
|
|
3853
|
+
return mr(ar(e), yr(fr(e), t, n));
|
|
3804
3854
|
}
|
|
3805
3855
|
function $(e, t, n) {
|
|
3806
3856
|
return Math.min(n, Math.max(t, e));
|
|
3807
3857
|
}
|
|
3808
|
-
function
|
|
3858
|
+
function xr(e) {
|
|
3809
3859
|
return e === "day" || e === "threeDay" || e === "workWeek" || e === "week";
|
|
3810
3860
|
}
|
|
3811
|
-
function
|
|
3812
|
-
let r = n.weekStartsOn ?? 1, i =
|
|
3861
|
+
function Sr(e, t, n = {}) {
|
|
3862
|
+
let r = n.weekStartsOn ?? 1, i = ar(t);
|
|
3813
3863
|
switch (e) {
|
|
3814
3864
|
case "day":
|
|
3815
3865
|
case "timeline": return [i];
|
|
@@ -3819,36 +3869,36 @@ function gr(e, t, n = {}) {
|
|
|
3819
3869
|
Q(i, 2)
|
|
3820
3870
|
];
|
|
3821
3871
|
case "week": {
|
|
3822
|
-
let e =
|
|
3872
|
+
let e = cr(i, r);
|
|
3823
3873
|
return Array.from({ length: 7 }, (t, n) => Q(e, n));
|
|
3824
3874
|
}
|
|
3825
3875
|
case "workWeek": {
|
|
3826
|
-
let e = new Set(n.workWeekDays ??
|
|
3876
|
+
let e = new Set(n.workWeekDays ?? ir), t = cr(i, r), a = Array.from({ length: 7 }, (e, n) => Q(t, n)).filter((t) => e.has(t.getDay()));
|
|
3827
3877
|
return a.length ? a : [i];
|
|
3828
3878
|
}
|
|
3829
3879
|
case "agenda": {
|
|
3830
3880
|
let e = Math.max(1, Math.floor(n.agendaDays ?? 7));
|
|
3831
3881
|
return Array.from({ length: e }, (e, t) => Q(i, t));
|
|
3832
3882
|
}
|
|
3833
|
-
case "month": return
|
|
3883
|
+
case "month": return Cr(t, r).flat();
|
|
3834
3884
|
}
|
|
3835
3885
|
}
|
|
3836
|
-
function
|
|
3837
|
-
let n =
|
|
3886
|
+
function Cr(e, t = 1) {
|
|
3887
|
+
let n = lr(e), r = new Date(n.getFullYear(), n.getMonth() + 1, 0), i = cr(n, t), a = [], o = i;
|
|
3838
3888
|
for (; o <= r || a.length === 0;) {
|
|
3839
3889
|
let e = Array.from({ length: 7 }, (e, t) => Q(o, t));
|
|
3840
3890
|
a.push(e), o = Q(o, 7);
|
|
3841
3891
|
}
|
|
3842
3892
|
return a;
|
|
3843
3893
|
}
|
|
3844
|
-
function
|
|
3845
|
-
let r =
|
|
3894
|
+
function wr(e, t, n = {}) {
|
|
3895
|
+
let r = Sr(e, t, n);
|
|
3846
3896
|
return {
|
|
3847
3897
|
start: r[0],
|
|
3848
3898
|
end: Q(r[r.length - 1], 1)
|
|
3849
3899
|
};
|
|
3850
3900
|
}
|
|
3851
|
-
function
|
|
3901
|
+
function Tr(e, t, n, r = {}) {
|
|
3852
3902
|
switch (e) {
|
|
3853
3903
|
case "day":
|
|
3854
3904
|
case "timeline": return Q(t, n);
|
|
@@ -3856,16 +3906,16 @@ function yr(e, t, n, r = {}) {
|
|
|
3856
3906
|
case "week":
|
|
3857
3907
|
case "workWeek": return Q(t, 7 * n);
|
|
3858
3908
|
case "agenda": return Q(t, Math.max(1, r.agendaDays ?? 7) * n);
|
|
3859
|
-
case "month": return
|
|
3909
|
+
case "month": return sr(t, n);
|
|
3860
3910
|
}
|
|
3861
3911
|
}
|
|
3862
|
-
var
|
|
3863
|
-
function
|
|
3864
|
-
let n = `${e}|${JSON.stringify(t)}`, r =
|
|
3865
|
-
return r || (r = new Intl.DateTimeFormat(e, t),
|
|
3912
|
+
var Er = /* @__PURE__ */ new Map();
|
|
3913
|
+
function Dr(e, t) {
|
|
3914
|
+
let n = `${e}|${JSON.stringify(t)}`, r = Er.get(n);
|
|
3915
|
+
return r || (r = new Intl.DateTimeFormat(e, t), Er.set(n, r)), r;
|
|
3866
3916
|
}
|
|
3867
|
-
function
|
|
3868
|
-
return
|
|
3917
|
+
function Or(e, t = {}) {
|
|
3918
|
+
return Dr(t.locale ?? "en-GB", {
|
|
3869
3919
|
timeZone: t.timeZone,
|
|
3870
3920
|
timeZoneName: t.timeZone ? "short" : void 0,
|
|
3871
3921
|
hour: t.hour12 ? "numeric" : "2-digit",
|
|
@@ -3873,71 +3923,71 @@ function Sr(e, t = {}) {
|
|
|
3873
3923
|
hourCycle: t.hour12 ? "h12" : "h23"
|
|
3874
3924
|
}).format(e);
|
|
3875
3925
|
}
|
|
3876
|
-
function
|
|
3877
|
-
return `${
|
|
3926
|
+
function kr(e, t, n = {}) {
|
|
3927
|
+
return `${Or(e, n)}–${Or(t, n)}`;
|
|
3878
3928
|
}
|
|
3879
|
-
function
|
|
3880
|
-
if (!t.hour12) return
|
|
3881
|
-
let n =
|
|
3882
|
-
return
|
|
3929
|
+
function Ar(e, t = {}) {
|
|
3930
|
+
if (!t.hour12) return gr(e);
|
|
3931
|
+
let n = mr(new Date(2e3, 0, 1), e);
|
|
3932
|
+
return Dr(t.locale ?? "en-GB", {
|
|
3883
3933
|
hour: "numeric",
|
|
3884
3934
|
minute: e % 60 ? "2-digit" : void 0,
|
|
3885
3935
|
hour12: !0
|
|
3886
3936
|
}).format(n);
|
|
3887
3937
|
}
|
|
3888
|
-
function
|
|
3889
|
-
return
|
|
3938
|
+
function jr(e, t = "en-GB") {
|
|
3939
|
+
return Dr(t, {
|
|
3890
3940
|
weekday: "long",
|
|
3891
3941
|
day: "numeric",
|
|
3892
3942
|
month: "long",
|
|
3893
3943
|
year: "numeric"
|
|
3894
3944
|
}).format(e);
|
|
3895
3945
|
}
|
|
3896
|
-
function
|
|
3946
|
+
function Mr(e, t, n = {}) {
|
|
3897
3947
|
let r = n.locale ?? "en-GB";
|
|
3898
|
-
if (e === "month") return
|
|
3948
|
+
if (e === "month") return Dr(r, {
|
|
3899
3949
|
month: "long",
|
|
3900
3950
|
year: "numeric"
|
|
3901
3951
|
}).format(t);
|
|
3902
|
-
let i =
|
|
3903
|
-
if (i.length === 1) return
|
|
3904
|
-
let s = a.getFullYear() === o.getFullYear(), c = s && a.getMonth() === o.getMonth(), l =
|
|
3952
|
+
let i = Sr(e, t, n), a = i[0], o = i[i.length - 1];
|
|
3953
|
+
if (i.length === 1) return jr(a, r);
|
|
3954
|
+
let s = a.getFullYear() === o.getFullYear(), c = s && a.getMonth() === o.getMonth(), l = Dr(r, {
|
|
3905
3955
|
day: "numeric",
|
|
3906
3956
|
month: "long",
|
|
3907
3957
|
year: "numeric"
|
|
3908
3958
|
});
|
|
3909
3959
|
if (c) return `${a.getDate()} – ${l.format(o)}`;
|
|
3910
|
-
let u =
|
|
3960
|
+
let u = Dr(r, s ? {
|
|
3911
3961
|
day: "numeric",
|
|
3912
3962
|
month: "short"
|
|
3913
3963
|
} : {
|
|
3914
3964
|
day: "numeric",
|
|
3915
3965
|
month: "short",
|
|
3916
3966
|
year: "numeric"
|
|
3917
|
-
}), d =
|
|
3967
|
+
}), d = Dr(r, {
|
|
3918
3968
|
day: "numeric",
|
|
3919
3969
|
month: "short",
|
|
3920
3970
|
year: "numeric"
|
|
3921
3971
|
});
|
|
3922
3972
|
return `${u.format(a)} – ${d.format(o)}`;
|
|
3923
3973
|
}
|
|
3924
|
-
function
|
|
3974
|
+
function Nr(e, t, n, r) {
|
|
3925
3975
|
return e < r && n < t;
|
|
3926
3976
|
}
|
|
3927
|
-
function
|
|
3928
|
-
let r =
|
|
3977
|
+
function Pr(e, t, n) {
|
|
3978
|
+
let r = ar(n), i = Q(r, 1), a = e.getTime(), o = Math.max(t.getTime(), a);
|
|
3929
3979
|
if (o === a) {
|
|
3930
3980
|
if (a < r.getTime() || a >= i.getTime()) return null;
|
|
3931
|
-
} else if (!
|
|
3981
|
+
} else if (!Nr(a, o, r.getTime(), i.getTime())) return null;
|
|
3932
3982
|
let s = a < r.getTime(), c = o > i.getTime();
|
|
3933
3983
|
return {
|
|
3934
|
-
startMinute: s ? 0 :
|
|
3935
|
-
endMinute: o >= i.getTime() ?
|
|
3984
|
+
startMinute: s ? 0 : fr(e),
|
|
3985
|
+
endMinute: o >= i.getTime() ? nr : Math.max(fr(t), s ? 0 : fr(e)),
|
|
3936
3986
|
continuesBefore: s,
|
|
3937
3987
|
continuesAfter: c
|
|
3938
3988
|
};
|
|
3939
3989
|
}
|
|
3940
|
-
function
|
|
3990
|
+
function Fr(e) {
|
|
3941
3991
|
let t = e.filter(([e, t]) => t > e).map(([e, t]) => [e, t]).sort((e, t) => e[0] - t[0]), n = [];
|
|
3942
3992
|
for (let [e, r] of t) {
|
|
3943
3993
|
let t = n[n.length - 1];
|
|
@@ -3945,12 +3995,12 @@ function kr(e) {
|
|
|
3945
3995
|
}
|
|
3946
3996
|
return n;
|
|
3947
3997
|
}
|
|
3948
|
-
function
|
|
3998
|
+
function Ir(e, t, n) {
|
|
3949
3999
|
let r = [], i = e;
|
|
3950
|
-
for (let [e, a] of
|
|
4000
|
+
for (let [e, a] of Fr(n)) if (!(a <= i) && (e >= t || (e > i && r.push([i, Math.min(e, t)]), i = Math.max(i, a), i >= t))) break;
|
|
3951
4001
|
return i < t && r.push([i, t]), r;
|
|
3952
4002
|
}
|
|
3953
|
-
function
|
|
4003
|
+
function Lr(e, t = 0) {
|
|
3954
4004
|
let n = e.map((e) => ({
|
|
3955
4005
|
id: e.id,
|
|
3956
4006
|
start: e.start,
|
|
@@ -3959,7 +4009,7 @@ function jr(e, t = 0) {
|
|
|
3959
4009
|
let e = a.length;
|
|
3960
4010
|
for (let t of i) {
|
|
3961
4011
|
let n = 1;
|
|
3962
|
-
for (let r = t.column + 1; r < e && !i.some((e) => e.column === r &&
|
|
4012
|
+
for (let r = t.column + 1; r < e && !i.some((e) => e.column === r && Nr(t.start, t.end, e.start, e.end)); r++) n++;
|
|
3963
4013
|
r.set(t.id, {
|
|
3964
4014
|
column: t.column,
|
|
3965
4015
|
columns: e,
|
|
@@ -3978,7 +4028,7 @@ function jr(e, t = 0) {
|
|
|
3978
4028
|
}
|
|
3979
4029
|
return s(), r;
|
|
3980
4030
|
}
|
|
3981
|
-
function
|
|
4031
|
+
function Rr(e) {
|
|
3982
4032
|
let t = [...e].sort((e, t) => e.start - t.start || t.end - e.end || (e.id < t.id ? -1 : 1)), n = [], r = /* @__PURE__ */ new Map();
|
|
3983
4033
|
for (let e of t) {
|
|
3984
4034
|
let t = Math.max(e.end, e.start + 1e-6), i = n.findIndex((t) => t <= e.start);
|
|
@@ -3989,34 +4039,34 @@ function Mr(e) {
|
|
|
3989
4039
|
count: n.length
|
|
3990
4040
|
};
|
|
3991
4041
|
}
|
|
3992
|
-
function
|
|
4042
|
+
function zr(e) {
|
|
3993
4043
|
return e === void 0 ? [] : typeof e == "string" ? [e] : e;
|
|
3994
4044
|
}
|
|
3995
|
-
function
|
|
4045
|
+
function Br(e, t, { emptyMatchesAll: n }) {
|
|
3996
4046
|
if (t === void 0) return !0;
|
|
3997
|
-
let r =
|
|
4047
|
+
let r = zr(e);
|
|
3998
4048
|
return r.length === 0 ? n : r.includes(t);
|
|
3999
4049
|
}
|
|
4000
|
-
function
|
|
4001
|
-
let r =
|
|
4050
|
+
function Vr(e, t, n) {
|
|
4051
|
+
let r = zr(e);
|
|
4002
4052
|
if (t === void 0 || n === void 0 || t === n) return r.length ? [...r] : void 0;
|
|
4003
4053
|
if (r.length === 0) return;
|
|
4004
4054
|
let i = r.map((e) => e === t ? n : e);
|
|
4005
4055
|
return [...new Set(i)];
|
|
4006
4056
|
}
|
|
4007
|
-
function
|
|
4057
|
+
function Hr(e, t, n = []) {
|
|
4008
4058
|
let r = /* @__PURE__ */ new Set(), i = e.start.getTime(), a = e.end.getTime();
|
|
4009
|
-
for (let e of [...t, ...n]) if (
|
|
4059
|
+
for (let e of [...t, ...n]) if (Nr(e.start.getTime(), e.end.getTime(), i, a) && !("kind" in e && e.kind === "unavailable")) for (let t of zr(e.resourceId)) r.add(t);
|
|
4010
4060
|
return r;
|
|
4011
4061
|
}
|
|
4012
|
-
function
|
|
4013
|
-
let { fromDateKey: r, wallDateAtMinutes: i, toDateKey: a, startOfWeek: o, startOfDay: s, addDays: c, differenceInDays: l, weekday: u } =
|
|
4062
|
+
function Ur(e, t, n = {}) {
|
|
4063
|
+
let { fromDateKey: r, wallDateAtMinutes: i, toDateKey: a, startOfWeek: o, startOfDay: s, addDays: c, differenceInDays: l, weekday: u } = Xr(n.timeZone), d = n.weekStartsOn ?? 1, f = [], p = t.start.getTime(), m = t.end.getTime();
|
|
4014
4064
|
for (let n of e) {
|
|
4015
|
-
let e =
|
|
4016
|
-
h <= e && (h +=
|
|
4065
|
+
let e = hr(n.startTime), h = hr(n.endTime);
|
|
4066
|
+
h <= e && (h += nr);
|
|
4017
4067
|
let g = r(n.startDate), _ = (t) => {
|
|
4018
4068
|
let r = i(t, e), o = i(t, h);
|
|
4019
|
-
if (o <= r || !
|
|
4069
|
+
if (o <= r || !Nr(r.getTime(), o.getTime(), p, m)) return;
|
|
4020
4070
|
let s = a(t);
|
|
4021
4071
|
f.push({
|
|
4022
4072
|
id: n.recurrence ? `${n.id}@${s}` : n.id,
|
|
@@ -4045,40 +4095,40 @@ function Lr(e, t, n = {}) {
|
|
|
4045
4095
|
}
|
|
4046
4096
|
return f.sort((e, t) => e.start.getTime() - t.start.getTime());
|
|
4047
4097
|
}
|
|
4048
|
-
function
|
|
4049
|
-
let a =
|
|
4050
|
-
return u <= l && (u = new Date(l.getTime() + r *
|
|
4098
|
+
function Wr(e, t, n, r, i) {
|
|
4099
|
+
let a = yr(t, r, "floor"), o = yr(n, r, "floor"), s = $(Math.min(a, o), i.min, i.max - r), c = $(Math.max(a, o) + r, s + r, i.max), l = pr(e, s), u = pr(e, c);
|
|
4100
|
+
return u <= l && (u = new Date(l.getTime() + r * rr)), {
|
|
4051
4101
|
start: l,
|
|
4052
4102
|
end: u
|
|
4053
4103
|
};
|
|
4054
4104
|
}
|
|
4055
|
-
function
|
|
4056
|
-
let o = (e.end.getTime() - e.start.getTime()) /
|
|
4105
|
+
function Gr(e, t, n, r, i, a) {
|
|
4106
|
+
let o = (e.end.getTime() - e.start.getTime()) / rr, s = yr(n - r, i), c = fr(e.start);
|
|
4057
4107
|
c >= a.min && c + o <= a.max && (s = $(s, a.min, a.max - o));
|
|
4058
|
-
let l =
|
|
4108
|
+
let l = mr(t, s);
|
|
4059
4109
|
return {
|
|
4060
4110
|
start: l,
|
|
4061
|
-
end: new Date(l.getTime() + o *
|
|
4111
|
+
end: new Date(l.getTime() + o * rr)
|
|
4062
4112
|
};
|
|
4063
4113
|
}
|
|
4064
|
-
function
|
|
4065
|
-
let a =
|
|
4066
|
-
return
|
|
4114
|
+
function Kr(e, t, n, r, i) {
|
|
4115
|
+
let a = ar(t), o = e.start.getTime() >= a.getTime() ? fr(e.start) + r : r;
|
|
4116
|
+
return pr(a, $(yr(n, r), Math.min(o, nr), Math.max(i.max, o)));
|
|
4067
4117
|
}
|
|
4068
|
-
function
|
|
4118
|
+
function qr(e, t) {
|
|
4069
4119
|
return {
|
|
4070
4120
|
start: Q(e.start, t),
|
|
4071
4121
|
end: Q(e.end, t)
|
|
4072
4122
|
};
|
|
4073
4123
|
}
|
|
4074
|
-
function
|
|
4124
|
+
function Jr(e, t) {
|
|
4075
4125
|
return e.start.getTime() === t.start.getTime() && e.end.getTime() === t.end.getTime();
|
|
4076
4126
|
}
|
|
4077
|
-
function
|
|
4127
|
+
function Yr(e) {
|
|
4078
4128
|
return e.allDay ? !0 : e.end.getTime() >= Q(e.start, 1).getTime();
|
|
4079
4129
|
}
|
|
4080
|
-
function
|
|
4081
|
-
let t = (t) => Z(t, e), n = (t) =>
|
|
4130
|
+
function Xr(e) {
|
|
4131
|
+
let t = (t) => Z(t, e), n = (t) => tr(t, e), r = (e) => {
|
|
4082
4132
|
let n = t(e);
|
|
4083
4133
|
return `${String(n.year).padStart(4, "0")}-${String(n.month).padStart(2, "0")}-${String(n.day).padStart(2, "0")}`;
|
|
4084
4134
|
}, i = (e) => n({
|
|
@@ -4114,7 +4164,7 @@ function Wr(e) {
|
|
|
4114
4164
|
let r = t(e), i = t(n);
|
|
4115
4165
|
return Math.round((Date.UTC(r.year, r.month - 1, r.day) - Date.UTC(i.year, i.month - 1, i.day)) / 864e5);
|
|
4116
4166
|
}, d = (e, r) => {
|
|
4117
|
-
let i = t(e), a = new Date(Date.UTC(i.year, i.month - 1, i.day, 0, Math.floor(r), 0, Math.round((r - Math.floor(r)) *
|
|
4167
|
+
let i = t(e), a = new Date(Date.UTC(i.year, i.month - 1, i.day, 0, Math.floor(r), 0, Math.round((r - Math.floor(r)) * rr)));
|
|
4118
4168
|
return n({
|
|
4119
4169
|
year: a.getUTCFullYear(),
|
|
4120
4170
|
month: a.getUTCMonth() + 1,
|
|
@@ -4126,11 +4176,11 @@ function Wr(e) {
|
|
|
4126
4176
|
});
|
|
4127
4177
|
}, f = (e, n) => {
|
|
4128
4178
|
let r = t(e);
|
|
4129
|
-
return u(e, n) *
|
|
4179
|
+
return u(e, n) * nr + r.hour * 60 + r.minute + r.second / 60 + r.millisecond / rr;
|
|
4130
4180
|
}, p = (t, n) => {
|
|
4131
4181
|
let r = d(t, n), i = f(r, t);
|
|
4132
4182
|
if (!e || i <= n + 1e-8) return r;
|
|
4133
|
-
let a = Math.floor(r.getTime() - (i - n) *
|
|
4183
|
+
let a = Math.floor(r.getTime() - (i - n) * rr), o = r.getTime();
|
|
4134
4184
|
for (; a < o;) {
|
|
4135
4185
|
let e = Math.floor((a + o) / 2);
|
|
4136
4186
|
f(new Date(e), t) < n ? a = e + 1 : o = e;
|
|
@@ -4138,7 +4188,7 @@ function Wr(e) {
|
|
|
4138
4188
|
return new Date(o);
|
|
4139
4189
|
}, m = (e) => {
|
|
4140
4190
|
if (!Number.isFinite(e.min) || !Number.isFinite(e.max) || e.max <= e.min) throw RangeError("Calendar time bounds must contain a positive interval of real instants");
|
|
4141
|
-
}, h = e ? (e, t) => new Date(i(e).getTime() + t *
|
|
4191
|
+
}, h = e ? (e, t) => new Date(i(e).getTime() + t * rr) : mr, g = e ? (e) => (e.getTime() - i(e).getTime()) / rr : fr, _ = e ? (e, t) => new Date(e.getTime() + t * rr) : or, v = (e) => {
|
|
4142
4192
|
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
|
|
4143
4193
|
if (!t) throw RangeError(`Invalid date key "${e}"`);
|
|
4144
4194
|
let i = n({
|
|
@@ -4162,21 +4212,21 @@ function Wr(e) {
|
|
|
4162
4212
|
if (e === "week" || e === "workWeek") {
|
|
4163
4213
|
let t = c(r, n.weekStartsOn), i = Array.from({ length: 7 }, (e, n) => a(t, n));
|
|
4164
4214
|
if (e === "week") return i;
|
|
4165
|
-
let o = new Set(n.workWeekDays ??
|
|
4215
|
+
let o = new Set(n.workWeekDays ?? ir), l = i.filter((e) => o.has(s(e)));
|
|
4166
4216
|
return l.length ? l : [r];
|
|
4167
4217
|
}
|
|
4168
4218
|
let o = e === "threeDay" ? 3 : e === "agenda" ? Math.max(1, Math.floor(n.agendaDays ?? 7)) : 1;
|
|
4169
4219
|
return Array.from({ length: o }, (e, t) => a(r, t));
|
|
4170
4220
|
}, x = (t, n, r) => {
|
|
4171
|
-
if (!e) return
|
|
4221
|
+
if (!e) return Pr(t, n, r);
|
|
4172
4222
|
let o = i(r).getTime(), s = a(i(r), 1).getTime(), c = t.getTime(), l = Math.max(c, n.getTime());
|
|
4173
|
-
return (l === c ? c < o || c >= s : !
|
|
4174
|
-
startMinute: Math.max(0, (c - o) /
|
|
4175
|
-
endMinute: Math.min(s - o, l - o) /
|
|
4223
|
+
return (l === c ? c < o || c >= s : !Nr(c, l, o, s)) ? null : {
|
|
4224
|
+
startMinute: Math.max(0, (c - o) / rr),
|
|
4225
|
+
endMinute: Math.min(s - o, l - o) / rr,
|
|
4176
4226
|
continuesBefore: c < o,
|
|
4177
4227
|
continuesAfter: l > s
|
|
4178
4228
|
};
|
|
4179
|
-
}, S = (e) => !!e.allDay || e.end >= a(e.start, 1), C = (t, n) =>
|
|
4229
|
+
}, S = (e) => !!e.allDay || e.end >= a(e.start, 1), C = (t, n) => Dr(t, {
|
|
4180
4230
|
...n,
|
|
4181
4231
|
...e ? { timeZone: e } : {}
|
|
4182
4232
|
}), w = (e, t = "en-GB") => C(t, {
|
|
@@ -4185,7 +4235,7 @@ function Wr(e) {
|
|
|
4185
4235
|
month: "long",
|
|
4186
4236
|
year: "numeric"
|
|
4187
4237
|
}).format(e), T = (n, r, i = {}) => {
|
|
4188
|
-
if (!e) return
|
|
4238
|
+
if (!e) return Mr(n, r, i);
|
|
4189
4239
|
let a = i.locale ?? "en-GB";
|
|
4190
4240
|
if (n === "month") return C(a, {
|
|
4191
4241
|
month: "long",
|
|
@@ -4208,11 +4258,11 @@ function Wr(e) {
|
|
|
4208
4258
|
year: "numeric"
|
|
4209
4259
|
}).format(c)}`;
|
|
4210
4260
|
}, E = (n, r, i, a, o, s) => {
|
|
4211
|
-
if (!e) return
|
|
4261
|
+
if (!e) return Gr(n, r, i, a, o, s);
|
|
4212
4262
|
m(s);
|
|
4213
|
-
let c = (n.end.getTime() - n.start.getTime()) /
|
|
4263
|
+
let c = (n.end.getTime() - n.start.getTime()) / rr, l = yr(i - a, o), f = (e) => {
|
|
4214
4264
|
let n = h(r, e), i = t(n);
|
|
4215
|
-
return u(n, r) *
|
|
4265
|
+
return u(n, r) * nr + i.hour * 60 + i.minute;
|
|
4216
4266
|
}, p = d(n.start, f(s.min)), g = d(n.start, f(s.max));
|
|
4217
4267
|
n.start >= p && n.end <= g && c <= s.max - s.min && (l = $(l, s.min, s.max - c));
|
|
4218
4268
|
let v = h(r, l);
|
|
@@ -4254,8 +4304,8 @@ function Wr(e) {
|
|
|
4254
4304
|
isAllDayLike: S,
|
|
4255
4305
|
eventsOnDay: (e, t) => e.filter((e) => x(e.start, e.end, t)).sort((e, t) => Number(S(t)) - Number(S(e)) || e.start.getTime() - t.start.getTime() || t.end.getTime() - e.end.getTime() || e.title.localeCompare(t.title)),
|
|
4256
4306
|
computeCreateRange: (t, n, r, i, a) => {
|
|
4257
|
-
if (!e) return
|
|
4258
|
-
let o =
|
|
4307
|
+
if (!e) return Wr(t, n, r, i, a);
|
|
4308
|
+
let o = yr(n, i, "floor"), s = yr(r, i, "floor");
|
|
4259
4309
|
m(a);
|
|
4260
4310
|
let c = Math.min(i, a.max - a.min), l = $(Math.min(o, s), a.min, a.max - c);
|
|
4261
4311
|
return {
|
|
@@ -4265,14 +4315,14 @@ function Wr(e) {
|
|
|
4265
4315
|
},
|
|
4266
4316
|
computeMoveRange: E,
|
|
4267
4317
|
computeResizeEnd: (t, n, r, a, o) => {
|
|
4268
|
-
if (!e) return
|
|
4318
|
+
if (!e) return Kr(t, n, r, a, o);
|
|
4269
4319
|
m(o);
|
|
4270
|
-
let s = Math.max(0, (t.start.getTime() - i(n).getTime()) /
|
|
4271
|
-
return h(n, $(
|
|
4320
|
+
let s = Math.max(0, (t.start.getTime() - i(n).getTime()) / rr) + a;
|
|
4321
|
+
return h(n, $(yr(r, a), s, Math.max(o.max, s)));
|
|
4272
4322
|
},
|
|
4273
4323
|
computeNudgeRange: (e, t, n) => E(e, i(e.start), g(e.start) + t, 0, 1, n),
|
|
4274
4324
|
shiftRangeDays: (t, n) => {
|
|
4275
|
-
if (!e) return
|
|
4325
|
+
if (!e) return qr(t, n);
|
|
4276
4326
|
if (t.allDay) return {
|
|
4277
4327
|
start: a(t.start, n),
|
|
4278
4328
|
end: a(t.end, n)
|
|
@@ -4286,8 +4336,8 @@ function Wr(e) {
|
|
|
4286
4336
|
dayBounds: (t, n) => {
|
|
4287
4337
|
if (!e) return n;
|
|
4288
4338
|
let r = i(t).getTime(), a = {
|
|
4289
|
-
min: (p(t, n.min).getTime() - r) /
|
|
4290
|
-
max: (p(t, n.max).getTime() - r) /
|
|
4339
|
+
min: (p(t, n.min).getTime() - r) / rr,
|
|
4340
|
+
max: (p(t, n.max).getTime() - r) / rr
|
|
4291
4341
|
};
|
|
4292
4342
|
return m(a), a;
|
|
4293
4343
|
}
|
|
@@ -4295,20 +4345,20 @@ function Wr(e) {
|
|
|
4295
4345
|
}
|
|
4296
4346
|
//#endregion
|
|
4297
4347
|
//#region src/components/ui/calendar/context.ts
|
|
4298
|
-
var
|
|
4299
|
-
function
|
|
4300
|
-
let e = c(
|
|
4348
|
+
var Zr = r(null);
|
|
4349
|
+
function Qr() {
|
|
4350
|
+
let e = c(Zr);
|
|
4301
4351
|
if (!e) throw Error("Calendar views must render inside <Calendar>");
|
|
4302
4352
|
return e;
|
|
4303
4353
|
}
|
|
4304
4354
|
//#endregion
|
|
4305
4355
|
//#region src/components/ui/calendar/AgendaView.tsx
|
|
4306
|
-
function
|
|
4307
|
-
let i =
|
|
4356
|
+
function $r({ days: e, events: t, availability: n, label: r }) {
|
|
4357
|
+
let i = Qr(), { daySegment: a, eventsOnDay: o, getFormatter: s, isAllDayLike: c, isSameDay: l, toDateKey: u } = i.dates, d = s(i.locale, {
|
|
4308
4358
|
weekday: "long",
|
|
4309
4359
|
day: "numeric",
|
|
4310
4360
|
month: "long"
|
|
4311
|
-
}), f = (e) =>
|
|
4361
|
+
}), f = (e) => zr(e).map((e) => i.resourceById.get(e)?.title).filter(Boolean).join(", ");
|
|
4312
4362
|
return /* @__PURE__ */ _("div", {
|
|
4313
4363
|
className: "ui-cal-scroll min-h-0 flex-1 overflow-y-auto",
|
|
4314
4364
|
"aria-label": r,
|
|
@@ -4345,10 +4395,10 @@ function qr({ days: e, events: t, availability: n, label: r }) {
|
|
|
4345
4395
|
children: i.labels.noEvents
|
|
4346
4396
|
}) : /* @__PURE__ */ _("ul", {
|
|
4347
4397
|
className: "divide-border divide-y border-border border-b",
|
|
4348
|
-
children: r.map((e) => /* @__PURE__ */ _("li", { children: e.type === "event" ? /* @__PURE__ */ _(
|
|
4398
|
+
children: r.map((e) => /* @__PURE__ */ _("li", { children: e.type === "event" ? /* @__PURE__ */ _(ei, {
|
|
4349
4399
|
event: e.value,
|
|
4350
4400
|
resources: f(e.value.resourceId)
|
|
4351
|
-
}) : /* @__PURE__ */ _(
|
|
4401
|
+
}) : /* @__PURE__ */ _(ti, {
|
|
4352
4402
|
block: e.value,
|
|
4353
4403
|
resources: f(e.value.resourceId)
|
|
4354
4404
|
}) }, `${e.type}:${e.value.id}`))
|
|
@@ -4357,8 +4407,8 @@ function qr({ days: e, events: t, availability: n, label: r }) {
|
|
|
4357
4407
|
})
|
|
4358
4408
|
});
|
|
4359
4409
|
}
|
|
4360
|
-
function
|
|
4361
|
-
let n =
|
|
4410
|
+
function ei({ event: e, resources: t }) {
|
|
4411
|
+
let n = Qr(), { isAllDayLike: r } = n.dates, i = n.statusLabel(e), a = r(e) ? n.labels.allDay : kr(e.start, e.end, n);
|
|
4362
4412
|
return /* @__PURE__ */ v("div", {
|
|
4363
4413
|
role: "button",
|
|
4364
4414
|
tabIndex: 0,
|
|
@@ -4405,8 +4455,8 @@ function Jr({ event: e, resources: t }) {
|
|
|
4405
4455
|
]
|
|
4406
4456
|
});
|
|
4407
4457
|
}
|
|
4408
|
-
function
|
|
4409
|
-
let n =
|
|
4458
|
+
function ti({ block: e, resources: t }) {
|
|
4459
|
+
let n = Qr(), r = e.kind ?? "available", i = r === "available" ? n.labels.available : n.labels.unavailable, a = n.hasBlockClick;
|
|
4410
4460
|
return /* @__PURE__ */ v("div", {
|
|
4411
4461
|
role: a ? "button" : void 0,
|
|
4412
4462
|
tabIndex: a ? 0 : void 0,
|
|
@@ -4419,7 +4469,7 @@ function Yr({ block: e, resources: t }) {
|
|
|
4419
4469
|
children: [
|
|
4420
4470
|
/* @__PURE__ */ _("span", {
|
|
4421
4471
|
className: "font-mono w-24 shrink-0",
|
|
4422
|
-
children:
|
|
4472
|
+
children: kr(e.start, e.end, n)
|
|
4423
4473
|
}),
|
|
4424
4474
|
/* @__PURE__ */ _("span", {
|
|
4425
4475
|
className: G("ui-cal-agenda-swatch mt-0.5", r === "unavailable" && "ui-cal-agenda-swatch-off"),
|
|
@@ -4438,12 +4488,12 @@ function Yr({ block: e, resources: t }) {
|
|
|
4438
4488
|
}
|
|
4439
4489
|
//#endregion
|
|
4440
4490
|
//#region src/components/ui/calendar/MonthView.tsx
|
|
4441
|
-
var
|
|
4442
|
-
function
|
|
4491
|
+
var ni = 96, ri = 224;
|
|
4492
|
+
function ii(e) {
|
|
4443
4493
|
return `${e.type}:${e.value.id}`;
|
|
4444
4494
|
}
|
|
4445
|
-
function
|
|
4446
|
-
let i =
|
|
4495
|
+
function ai({ date: e, events: t, availability: n, label: r }) {
|
|
4496
|
+
let i = Qr(), { addDays: a, daySegment: o, differenceInDays: c, eventsOnDay: u, formatLongDate: d, fromDateKey: g, getFormatter: y, getMonthWeeks: b, isAllDayLike: x, isSameDay: S, shiftRangeDays: C, toDateKey: w } = i.dates, T = p(() => b(e, i.weekStartsOn), [
|
|
4447
4497
|
e,
|
|
4448
4498
|
i.weekStartsOn,
|
|
4449
4499
|
b
|
|
@@ -4497,7 +4547,7 @@ function $r({ date: e, events: t, availability: n, label: r }) {
|
|
|
4497
4547
|
u,
|
|
4498
4548
|
o,
|
|
4499
4549
|
w
|
|
4500
|
-
]), ue = y(i.locale, { weekday: "short" }), de = i.monthMaxEvents ?? (ne ? Math.max(1, Math.floor((Math.max(ne / T.length,
|
|
4550
|
+
]), ue = y(i.locale, { weekday: "short" }), de = i.monthMaxEvents ?? (ne ? Math.max(1, Math.floor((Math.max(ne / T.length, ni) - 28) / 20)) : 3);
|
|
4501
4551
|
function U(e) {
|
|
4502
4552
|
let t = w(e);
|
|
4503
4553
|
k(t), requestAnimationFrame(() => {
|
|
@@ -4529,7 +4579,7 @@ function $r({ date: e, events: t, availability: n, label: r }) {
|
|
|
4529
4579
|
let n = {
|
|
4530
4580
|
action: "move",
|
|
4531
4581
|
...C(e.value, t),
|
|
4532
|
-
resourceIds:
|
|
4582
|
+
resourceIds: Vr(e.value.resourceId, void 0, void 0)
|
|
4533
4583
|
};
|
|
4534
4584
|
return e.type === "event" ? {
|
|
4535
4585
|
target: "event",
|
|
@@ -4551,7 +4601,7 @@ function $r({ date: e, events: t, availability: n, label: r }) {
|
|
|
4551
4601
|
if (!t || e.pointerId !== t.pointerId) return;
|
|
4552
4602
|
if (!t.started) {
|
|
4553
4603
|
if (Math.hypot(e.clientX - t.startX, e.clientY - t.startY) < 4) return;
|
|
4554
|
-
t.started = !0, L(
|
|
4604
|
+
t.started = !0, L(ii(t.item));
|
|
4555
4605
|
}
|
|
4556
4606
|
let n = document.elementFromPoint(e.clientX, e.clientY)?.closest("[data-cal-date]"), r = n && E.current?.contains(n) ? n.dataset.calDate ?? null : null;
|
|
4557
4607
|
t.overKey = r ?? void 0, F(r);
|
|
@@ -4604,7 +4654,7 @@ function $r({ date: e, events: t, availability: n, label: r }) {
|
|
|
4604
4654
|
}, "pointer");
|
|
4605
4655
|
}
|
|
4606
4656
|
let ye = (e, t) => {
|
|
4607
|
-
let n =
|
|
4657
|
+
let n = ii(e), r = e.value.placeholder ? {
|
|
4608
4658
|
"aria-hidden": !0,
|
|
4609
4659
|
"data-placeholder": !0
|
|
4610
4660
|
} : {
|
|
@@ -4624,7 +4674,7 @@ function $r({ date: e, events: t, availability: n, label: r }) {
|
|
|
4624
4674
|
...r,
|
|
4625
4675
|
children: [i.display.time && /* @__PURE__ */ _("span", {
|
|
4626
4676
|
className: "ui-cal-meta font-mono shrink-0",
|
|
4627
|
-
children:
|
|
4677
|
+
children: kr(t.start, t.end, i)
|
|
4628
4678
|
}), i.display.blockLabels && /* @__PURE__ */ _("span", {
|
|
4629
4679
|
className: "ui-cal-title",
|
|
4630
4680
|
children: t.label ?? ((t.kind ?? "available") === "available" ? i.labels.available : i.labels.unavailable)
|
|
@@ -4647,7 +4697,7 @@ function $r({ date: e, events: t, availability: n, label: r }) {
|
|
|
4647
4697
|
}),
|
|
4648
4698
|
!o && i.display.time && /* @__PURE__ */ _("span", {
|
|
4649
4699
|
className: "ui-cal-meta font-mono shrink-0",
|
|
4650
|
-
children:
|
|
4700
|
+
children: Or(a.start, i)
|
|
4651
4701
|
}),
|
|
4652
4702
|
/* @__PURE__ */ _("span", {
|
|
4653
4703
|
className: "ui-cal-title font-medium",
|
|
@@ -4709,7 +4759,7 @@ function $r({ date: e, events: t, availability: n, label: r }) {
|
|
|
4709
4759
|
onClick: (e) => {
|
|
4710
4760
|
let n = e.currentTarget.closest("[data-cal-date]")?.getBoundingClientRect();
|
|
4711
4761
|
if (n) {
|
|
4712
|
-
let e = Math.max(n.width,
|
|
4762
|
+
let e = Math.max(n.width, ri);
|
|
4713
4763
|
N({
|
|
4714
4764
|
top: Math.max(8, n.top),
|
|
4715
4765
|
left: Math.max(8, Math.min(n.left, window.innerWidth - e - 8)),
|
|
@@ -4752,8 +4802,8 @@ function $r({ date: e, events: t, availability: n, label: r }) {
|
|
|
4752
4802
|
}
|
|
4753
4803
|
//#endregion
|
|
4754
4804
|
//#region src/components/ui/calendar/items.tsx
|
|
4755
|
-
function
|
|
4756
|
-
let u =
|
|
4805
|
+
function oi({ event: e, style: t, resizeEdge: n, compact: r, dense: i, continuesBefore: a, continuesAfter: o, dragging: s, onKeyDown: c, onClick: l }) {
|
|
4806
|
+
let u = Qr(), d = u.canEditEvent(e), f = e.allDay ? u.labels.allDay : kr(e.start, e.end, u), { display: p } = u, m = p.status ? u.statusLabel(e) : void 0, h = [p.time && f, m].filter(Boolean).join(" · "), y = !!e.placeholder, b = u.renderEvent?.(e, {
|
|
4757
4807
|
view: u.view,
|
|
4758
4808
|
compact: r,
|
|
4759
4809
|
timeLabel: f,
|
|
@@ -4784,7 +4834,7 @@ function ei({ event: e, style: t, resizeEdge: n, compact: r, dense: i, continues
|
|
|
4784
4834
|
}), h && /* @__PURE__ */ _("span", {
|
|
4785
4835
|
className: "ui-cal-meta font-mono",
|
|
4786
4836
|
children: h
|
|
4787
|
-
})] }) : /* @__PURE__ */ _(
|
|
4837
|
+
})] }) : /* @__PURE__ */ _(si, {
|
|
4788
4838
|
event: e,
|
|
4789
4839
|
compact: r,
|
|
4790
4840
|
timeLabel: p.time ? f : void 0,
|
|
@@ -4799,7 +4849,7 @@ function ei({ event: e, style: t, resizeEdge: n, compact: r, dense: i, continues
|
|
|
4799
4849
|
})]
|
|
4800
4850
|
});
|
|
4801
4851
|
}
|
|
4802
|
-
function
|
|
4852
|
+
function si({ event: e, compact: t, timeLabel: n, statusLabel: r, description: i, badge: a }) {
|
|
4803
4853
|
return t ? /* @__PURE__ */ v("div", {
|
|
4804
4854
|
className: "flex min-w-0 items-center gap-1",
|
|
4805
4855
|
children: [/* @__PURE__ */ v("span", {
|
|
@@ -4837,8 +4887,8 @@ function ti({ event: e, compact: t, timeLabel: n, statusLabel: r, description: i
|
|
|
4837
4887
|
})
|
|
4838
4888
|
] });
|
|
4839
4889
|
}
|
|
4840
|
-
function
|
|
4841
|
-
let s =
|
|
4890
|
+
function ci({ block: e, style: t, resizeEdge: n, continuesAfter: r, dragging: i, onKeyDown: a, onClick: o }) {
|
|
4891
|
+
let s = Qr(), c = s.editLayer === "availability", l = c && s.canEditBlock(e), u = e.kind ?? "available", d = e.label ?? (u === "available" ? s.labels.available : s.labels.unavailable), f = c && !e.placeholder && (l || s.hasBlockClick);
|
|
4842
4892
|
return u === "available" && !c && !s.display.availableBlocks ? null : /* @__PURE__ */ v("div", {
|
|
4843
4893
|
role: f ? "button" : void 0,
|
|
4844
4894
|
tabIndex: f ? 0 : void 0,
|
|
@@ -4863,7 +4913,7 @@ function ni({ block: e, style: t, resizeEdge: n, continuesAfter: r, dragging: i,
|
|
|
4863
4913
|
}),
|
|
4864
4914
|
c && s.display.time && /* @__PURE__ */ _("span", {
|
|
4865
4915
|
className: "ui-cal-meta font-mono block",
|
|
4866
|
-
children:
|
|
4916
|
+
children: kr(e.start, e.end, s)
|
|
4867
4917
|
}),
|
|
4868
4918
|
n && l && !r && /* @__PURE__ */ _("div", {
|
|
4869
4919
|
"data-cal-resize": !0,
|
|
@@ -4874,8 +4924,8 @@ function ni({ block: e, style: t, resizeEdge: n, continuesAfter: r, dragging: i,
|
|
|
4874
4924
|
]
|
|
4875
4925
|
});
|
|
4876
4926
|
}
|
|
4877
|
-
function
|
|
4878
|
-
let r =
|
|
4927
|
+
function li({ draft: e, invalid: t, style: n }) {
|
|
4928
|
+
let r = Qr(), i = e.target === "event" ? e.event.title : e.target === "availability" ? e.availability.label ?? r.labels.available : void 0;
|
|
4879
4929
|
return /* @__PURE__ */ v("div", {
|
|
4880
4930
|
className: "ui-cal-ghost",
|
|
4881
4931
|
"data-invalid": t ? !0 : void 0,
|
|
@@ -4888,7 +4938,7 @@ function ri({ draft: e, invalid: t, style: n }) {
|
|
|
4888
4938
|
}),
|
|
4889
4939
|
/* @__PURE__ */ _("div", {
|
|
4890
4940
|
className: "font-mono",
|
|
4891
|
-
children:
|
|
4941
|
+
children: kr(e.start, e.end, r)
|
|
4892
4942
|
}),
|
|
4893
4943
|
t && /* @__PURE__ */ _("div", {
|
|
4894
4944
|
className: "text-red font-medium",
|
|
@@ -4899,15 +4949,15 @@ function ri({ draft: e, invalid: t, style: n }) {
|
|
|
4899
4949
|
}
|
|
4900
4950
|
//#endregion
|
|
4901
4951
|
//#region src/components/ui/calendar/useGridInteraction.ts
|
|
4902
|
-
var
|
|
4903
|
-
function
|
|
4904
|
-
let a =
|
|
4952
|
+
var ui = 4, di = 10, fi = 36;
|
|
4953
|
+
function pi(e, t, n, r, i) {
|
|
4954
|
+
let a = zr(e.value.resourceId).length > 0, o = {
|
|
4905
4955
|
action: t,
|
|
4906
4956
|
start: n.start,
|
|
4907
4957
|
end: n.end,
|
|
4908
4958
|
resourceId: a ? i : void 0,
|
|
4909
4959
|
previousResourceId: a ? r : void 0,
|
|
4910
|
-
resourceIds:
|
|
4960
|
+
resourceIds: Vr(e.value.resourceId, r, i)
|
|
4911
4961
|
};
|
|
4912
4962
|
return e.type === "event" ? {
|
|
4913
4963
|
target: "event",
|
|
@@ -4919,11 +4969,11 @@ function si(e, t, n, r, i) {
|
|
|
4919
4969
|
...o
|
|
4920
4970
|
};
|
|
4921
4971
|
}
|
|
4922
|
-
function
|
|
4923
|
-
return t.target === "selection" ? !1 :
|
|
4972
|
+
function mi(e, t) {
|
|
4973
|
+
return t.target === "selection" ? !1 : Jr(e.value, t) && (t.resourceId === void 0 || t.resourceId === t.previousResourceId);
|
|
4924
4974
|
}
|
|
4925
|
-
function
|
|
4926
|
-
let s =
|
|
4975
|
+
function hi({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, blocks: a, initialColumn: o }) {
|
|
4976
|
+
let s = Qr(), { addMinutes: c, computeNudgeRange: u, dateAtMinutes: d, differenceInDays: p, shiftRangeDays: g } = s.dates, [_, v] = h(null), [y, b] = h(null), x = m(null), S = m({
|
|
4927
4977
|
ctx: s,
|
|
4928
4978
|
columns: t,
|
|
4929
4979
|
axis: e,
|
|
@@ -4989,12 +5039,12 @@ function li({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, bloc
|
|
|
4989
5039
|
if (!r) return;
|
|
4990
5040
|
e.hover = r.index;
|
|
4991
5041
|
let a = n[r.index], c = i(e.item.value, a.day, T(r.el, e.lastX, e.lastY), e.grabOffset, o, t.dayBounds(a.day));
|
|
4992
|
-
l =
|
|
5042
|
+
l = pi(e.item, "move", c, s.resourceId, a.resourceId);
|
|
4993
5043
|
} else if (e.kind === "resize" && e.item) {
|
|
4994
5044
|
let t = w(e.origin);
|
|
4995
5045
|
if (!t) return;
|
|
4996
5046
|
let n = a(e.item.value, s.day, T(t, e.lastX, e.lastY), o, c);
|
|
4997
|
-
l =
|
|
5047
|
+
l = pi(e.item, "resize", {
|
|
4998
5048
|
start: e.item.value.start,
|
|
4999
5049
|
end: n
|
|
5000
5050
|
}, s.resourceId, s.resourceId);
|
|
@@ -5009,7 +5059,7 @@ function li({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, bloc
|
|
|
5009
5059
|
let t = r.current;
|
|
5010
5060
|
if (!t || !e.started) return;
|
|
5011
5061
|
let n = t.getBoundingClientRect(), i = 0, a = 0;
|
|
5012
|
-
if (e.lastY < n.top +
|
|
5062
|
+
if (e.lastY < n.top + fi ? a = -1 : e.lastY > n.bottom - fi && (a = 1), e.lastX < n.left + fi ? i = -1 : e.lastX > n.right - fi && (i = 1), !i && !a) {
|
|
5013
5063
|
e.frame = void 0;
|
|
5014
5064
|
return;
|
|
5015
5065
|
}
|
|
@@ -5022,7 +5072,7 @@ function li({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, bloc
|
|
|
5022
5072
|
if (a && (x.current = null, a.cleanup(), a.frame && cancelAnimationFrame(a.frame), v(null), e)) {
|
|
5023
5073
|
if (a.started) {
|
|
5024
5074
|
let e = a.current;
|
|
5025
|
-
if (!e || a.item &&
|
|
5075
|
+
if (!e || a.item && mi(a.item, e.draft)) return;
|
|
5026
5076
|
t.commit(e.draft, "pointer");
|
|
5027
5077
|
return;
|
|
5028
5078
|
}
|
|
@@ -5034,7 +5084,7 @@ function li({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, bloc
|
|
|
5034
5084
|
if (a.kind === "create") {
|
|
5035
5085
|
let e = n[a.origin];
|
|
5036
5086
|
if (!e) return;
|
|
5037
|
-
let o = t.dayBounds(e.day), s = Math.min(i, o.max - o.min), c = $(
|
|
5087
|
+
let o = t.dayBounds(e.day), s = Math.min(i, o.max - o.min), c = $(yr(a.anchorMinute, i, "floor"), o.min, o.max - s), l = Math.min(c + Math.max(i, t.clickCreateDuration), o.max);
|
|
5038
5088
|
t.commit({
|
|
5039
5089
|
target: "selection",
|
|
5040
5090
|
action: "create",
|
|
@@ -5084,11 +5134,11 @@ function li({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, bloc
|
|
|
5084
5134
|
let n = Math.hypot(e.clientX - t.startX, e.clientY - t.startY);
|
|
5085
5135
|
if (!t.started) {
|
|
5086
5136
|
if (t.pointerType === "touch") {
|
|
5087
|
-
n >
|
|
5137
|
+
n > di && (t.moved = !0);
|
|
5088
5138
|
return;
|
|
5089
5139
|
}
|
|
5090
|
-
if (t.kind === "click" || n <
|
|
5091
|
-
n >=
|
|
5140
|
+
if (t.kind === "click" || n < ui) {
|
|
5141
|
+
n >= ui && (t.moved = !0);
|
|
5092
5142
|
return;
|
|
5093
5143
|
}
|
|
5094
5144
|
t.started = !0, r.current?.setPointerCapture?.(t.pointerId);
|
|
@@ -5147,17 +5197,17 @@ function li({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, bloc
|
|
|
5147
5197
|
if (n.shiftKey) {
|
|
5148
5198
|
let t = c(d.end, e);
|
|
5149
5199
|
if (t.getTime() - d.start.getTime() < C * 6e4) return;
|
|
5150
|
-
v =
|
|
5200
|
+
v = pi(f, "resize", {
|
|
5151
5201
|
start: d.start,
|
|
5152
5202
|
end: t
|
|
5153
5203
|
}, _.resourceId, _.resourceId);
|
|
5154
|
-
} else v =
|
|
5204
|
+
} else v = pi(f, "move", u(d, e, s.dayBounds(d.start)), _.resourceId, _.resourceId);
|
|
5155
5205
|
} else if (h.includes(n.key) && !n.shiftKey) {
|
|
5156
5206
|
let e = t[l + (n.key === h[0] ? -1 : 1)];
|
|
5157
5207
|
if (!e) return;
|
|
5158
|
-
v =
|
|
5208
|
+
v = pi(f, "move", g(d, p(e.day, _.day)), _.resourceId, e.resourceId);
|
|
5159
5209
|
}
|
|
5160
|
-
v && (n.preventDefault(), !
|
|
5210
|
+
v && (n.preventDefault(), !mi(f, v) && s.commit(v, "keyboard") && j(o));
|
|
5161
5211
|
}
|
|
5162
5212
|
function N(e) {
|
|
5163
5213
|
if (e.target !== e.currentTarget || y) return;
|
|
@@ -5168,7 +5218,7 @@ function li({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, bloc
|
|
|
5168
5218
|
t && b(P());
|
|
5169
5219
|
}
|
|
5170
5220
|
function P() {
|
|
5171
|
-
let e = t[$(o, 0, Math.max(0, t.length - 1))], n = e ? s.dayBounds(e.day) : s.bounds, r = Math.min(C, n.max - n.min), i = $(
|
|
5221
|
+
let e = t[$(o, 0, Math.max(0, t.length - 1))], n = e ? s.dayBounds(e.day) : s.bounds, r = Math.min(C, n.max - n.min), i = $(yr((e && s.timeZone && s.scrollToMinute !== void 0 ? s.dates.minutesOfDay(s.dates.wallDateAtMinutes(e.day, s.scrollToMinute)) : s.scrollToMinute) ?? n.min, C, "floor"), n.min, n.max - r);
|
|
5172
5222
|
return {
|
|
5173
5223
|
column: $(o, 0, Math.max(0, t.length - 1)),
|
|
5174
5224
|
start: i,
|
|
@@ -5287,12 +5337,12 @@ function li({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, bloc
|
|
|
5287
5337
|
}
|
|
5288
5338
|
//#endregion
|
|
5289
5339
|
//#region src/components/ui/calendar/TimeGrid.tsx
|
|
5290
|
-
var
|
|
5291
|
-
function
|
|
5340
|
+
var gi = 22, _i = 3, vi = 18, yi = 36;
|
|
5341
|
+
function bi(e) {
|
|
5292
5342
|
let t = e.querySelector(".ui-cal-head")?.offsetHeight ?? 0;
|
|
5293
5343
|
return (e.clientHeight - t) / 2;
|
|
5294
5344
|
}
|
|
5295
|
-
function
|
|
5345
|
+
function xi(e, t, n, r, i) {
|
|
5296
5346
|
let a = i(e.start, e.end, t);
|
|
5297
5347
|
return a ? a.endMinute <= n && a.startMinute < n ? "before" : a.startMinute >= r ? "after" : {
|
|
5298
5348
|
item: e,
|
|
@@ -5302,8 +5352,8 @@ function hi(e, t, n, r, i) {
|
|
|
5302
5352
|
continuesAfter: a.continuesAfter || a.endMinute > r
|
|
5303
5353
|
} : null;
|
|
5304
5354
|
}
|
|
5305
|
-
function
|
|
5306
|
-
let i =
|
|
5355
|
+
function Si({ days: e, events: t, availability: n, label: r }) {
|
|
5356
|
+
let i = Qr(), { daySegment: a, formatLongDate: o, getFormatter: s, isAllDayLike: c, isSameDay: d, minutesOfDay: g, toDateKey: y } = i.dates, { bounds: b, resources: x, hourHeight: S } = i, C = S / 60, w = m(null), T = u(), [E, D] = h(!1), O = p(() => e.flatMap((e) => x.length ? x.map((t) => ({
|
|
5307
5357
|
key: `${y(e)}|${t.id}`,
|
|
5308
5358
|
day: e,
|
|
5309
5359
|
bounds: i.dates.dayBounds(e, i.bounds),
|
|
@@ -5318,7 +5368,7 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5318
5368
|
y,
|
|
5319
5369
|
i.dates,
|
|
5320
5370
|
i.bounds
|
|
5321
|
-
]), k = p(() => new Map(t.map((e) => [e.id, e])), [t]), A = p(() => new Map(n.map((e) => [e.id, e])), [n]), j = O.findIndex((e) => d(e.day, i.now)), M =
|
|
5371
|
+
]), k = p(() => new Map(t.map((e) => [e.id, e])), [t]), A = p(() => new Map(n.map((e) => [e.id, e])), [n]), j = O.findIndex((e) => d(e.day, i.now)), M = hi({
|
|
5322
5372
|
axis: "y",
|
|
5323
5373
|
columns: O,
|
|
5324
5374
|
pxPerMinute: C,
|
|
@@ -5327,30 +5377,30 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5327
5377
|
blocks: A,
|
|
5328
5378
|
initialColumn: Math.max(0, j)
|
|
5329
5379
|
}), { drag: N, cursor: P } = M, F = i.editLayer === "availability", I = p(() => {
|
|
5330
|
-
let e = t.filter((e) => !c(e)), r =
|
|
5380
|
+
let e = t.filter((e) => !c(e)), r = vi / C;
|
|
5331
5381
|
return O.map((t) => {
|
|
5332
5382
|
let o = t.bounds ?? i.bounds, s = 0, c = 0, l = [];
|
|
5333
5383
|
for (let n of e) {
|
|
5334
|
-
if (!
|
|
5335
|
-
let e =
|
|
5384
|
+
if (!Br(n.resourceId, t.resourceId, { emptyMatchesAll: !1 })) continue;
|
|
5385
|
+
let e = xi(n, t.day, o.min, o.max, a);
|
|
5336
5386
|
e === "before" ? s++ : e === "after" ? c++ : e && l.push(e);
|
|
5337
5387
|
}
|
|
5338
|
-
let u =
|
|
5388
|
+
let u = Lr(l.map((e) => ({
|
|
5339
5389
|
id: e.item.id,
|
|
5340
5390
|
start: e.start,
|
|
5341
5391
|
end: e.end
|
|
5342
5392
|
})), r), d = [];
|
|
5343
5393
|
for (let e of n) {
|
|
5344
|
-
if (!
|
|
5345
|
-
let n =
|
|
5394
|
+
if (!Br(e.resourceId, t.resourceId, { emptyMatchesAll: !0 })) continue;
|
|
5395
|
+
let n = xi(e, t.day, o.min, o.max, a);
|
|
5346
5396
|
n && typeof n == "object" && d.push(n);
|
|
5347
5397
|
}
|
|
5348
|
-
let f = F ?
|
|
5398
|
+
let f = F ? Lr(d.map((e) => ({
|
|
5349
5399
|
id: e.item.id,
|
|
5350
5400
|
start: e.start,
|
|
5351
5401
|
end: e.end
|
|
5352
5402
|
})), r) : null, p = [];
|
|
5353
|
-
return i.hasAvailability && i.shadeOutsideAvailability && (p =
|
|
5403
|
+
return i.hasAvailability && i.shadeOutsideAvailability && (p = Ir(o.min, o.max, d.map((e) => [e.start, e.end]))), {
|
|
5354
5404
|
placed: l,
|
|
5355
5405
|
layout: u,
|
|
5356
5406
|
blocks: d,
|
|
@@ -5377,7 +5427,7 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5377
5427
|
if (!c(n)) continue;
|
|
5378
5428
|
let t = -1;
|
|
5379
5429
|
O.forEach((r, i) => {
|
|
5380
|
-
let o = a(n.start, n.end, r.day) !== null &&
|
|
5430
|
+
let o = a(n.start, n.end, r.day) !== null && Br(n.resourceId, r.resourceId, { emptyMatchesAll: !1 });
|
|
5381
5431
|
o && t === -1 && (t = i);
|
|
5382
5432
|
let s = i === O.length - 1;
|
|
5383
5433
|
if (t !== -1 && (!o || s)) {
|
|
@@ -5391,7 +5441,7 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5391
5441
|
}
|
|
5392
5442
|
});
|
|
5393
5443
|
}
|
|
5394
|
-
let { lanes: n, count: r } =
|
|
5444
|
+
let { lanes: n, count: r } = Rr(e);
|
|
5395
5445
|
return {
|
|
5396
5446
|
runs: e,
|
|
5397
5447
|
lanes: n,
|
|
@@ -5402,12 +5452,12 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5402
5452
|
O,
|
|
5403
5453
|
a,
|
|
5404
5454
|
c
|
|
5405
|
-
]), R = E ? L.count : Math.min(L.count,
|
|
5455
|
+
]), R = E ? L.count : Math.min(L.count, _i), ee = L.runs.filter((e) => (L.lanes.get(e.id) ?? 0) >= R).length, te = m(C), ne = m(null);
|
|
5406
5456
|
l(() => {
|
|
5407
5457
|
let e = w.current;
|
|
5408
5458
|
if (!e) return;
|
|
5409
5459
|
let t = () => {
|
|
5410
|
-
ne.current = (e.scrollTop +
|
|
5460
|
+
ne.current = (e.scrollTop + bi(e)) / te.current;
|
|
5411
5461
|
};
|
|
5412
5462
|
return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
5413
5463
|
}, []), f(() => {
|
|
@@ -5415,7 +5465,7 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5415
5465
|
if (!e || te.current === C) return;
|
|
5416
5466
|
te.current = C;
|
|
5417
5467
|
let t = ne.current;
|
|
5418
|
-
t !== null && (e.scrollTop = Math.max(0, t * C -
|
|
5468
|
+
t !== null && (e.scrollTop = Math.max(0, t * C - bi(e)));
|
|
5419
5469
|
}, [C]);
|
|
5420
5470
|
let re = m(null), z = i.scrollToMinute, { dates: ie, timeZone: ae, now: B } = i, oe = i.scrollAlign;
|
|
5421
5471
|
l(() => {
|
|
@@ -5423,7 +5473,7 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5423
5473
|
if (!t || re.current === i.view) return;
|
|
5424
5474
|
re.current = i.view;
|
|
5425
5475
|
let n = e.find((e) => d(e, B)) ?? e[0], r = ae ? ie.minutesOfDay(ie.wallDateAtMinutes(n, z ?? 480)) : z ?? 480, a = ie.dayBounds(n, b), o = t.querySelector(".ui-cal-head"), s = () => {
|
|
5426
|
-
let e = oe === "center" ?
|
|
5476
|
+
let e = oe === "center" ? bi(t) : 8;
|
|
5427
5477
|
t.scrollTop = Math.max(0, (r - a.min) * C - e);
|
|
5428
5478
|
};
|
|
5429
5479
|
if (s(), typeof ResizeObserver > "u") return;
|
|
@@ -5469,7 +5519,7 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5469
5519
|
let e = O[P.column];
|
|
5470
5520
|
if (e) {
|
|
5471
5521
|
let t = e.resourceId ? i.resourceById.get(e.resourceId) : void 0;
|
|
5472
|
-
ge = `${o(e.day, i.locale)}, ${i.timeZone ?
|
|
5522
|
+
ge = `${o(e.day, i.locale)}, ${i.timeZone ? Or(i.dates.dateAtMinutes(e.day, P.start), i) : gr(P.start)} to ${i.timeZone ? Or(i.dates.dateAtMinutes(e.day, P.end), i) : gr(P.end)}${t ? `, ${t.title}` : ""}`;
|
|
5473
5523
|
}
|
|
5474
5524
|
}
|
|
5475
5525
|
return /* @__PURE__ */ _("div", {
|
|
@@ -5484,7 +5534,7 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5484
5534
|
children: [
|
|
5485
5535
|
se && /* @__PURE__ */ v("div", {
|
|
5486
5536
|
className: "flex",
|
|
5487
|
-
children: [/* @__PURE__ */ _("div", { className: "ui-cal-corner" }), e.map((e) => /* @__PURE__ */ _(
|
|
5537
|
+
children: [/* @__PURE__ */ _("div", { className: "ui-cal-corner" }), e.map((e) => /* @__PURE__ */ _(Ci, {
|
|
5488
5538
|
day: e,
|
|
5489
5539
|
weekday: W.format(e),
|
|
5490
5540
|
isToday: d(e, i.now),
|
|
@@ -5495,7 +5545,7 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5495
5545
|
}),
|
|
5496
5546
|
ce && /* @__PURE__ */ v("div", {
|
|
5497
5547
|
className: "flex",
|
|
5498
|
-
children: [/* @__PURE__ */ _("div", { className: "ui-cal-corner" }), O.map((e, t) => /* @__PURE__ */ _(
|
|
5548
|
+
children: [/* @__PURE__ */ _("div", { className: "ui-cal-corner" }), O.map((e, t) => /* @__PURE__ */ _(wi, {
|
|
5499
5549
|
resource: i.resourceById.get(e.resourceId ?? ""),
|
|
5500
5550
|
sub: t % x.length !== 0
|
|
5501
5551
|
}, e.key))]
|
|
@@ -5504,7 +5554,7 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5504
5554
|
className: "border-border flex border-t",
|
|
5505
5555
|
children: [/* @__PURE__ */ v("div", {
|
|
5506
5556
|
className: "ui-cal-corner text-text-tertiary flex flex-col items-end justify-center gap-0.5 pr-2 text-2xs",
|
|
5507
|
-
children: [/* @__PURE__ */ _("span", { children: i.labels.allDay }), L.count >
|
|
5557
|
+
children: [/* @__PURE__ */ _("span", { children: i.labels.allDay }), L.count > _i && /* @__PURE__ */ _("button", {
|
|
5508
5558
|
type: "button",
|
|
5509
5559
|
className: "text-accent cursor-pointer hover:underline",
|
|
5510
5560
|
"aria-expanded": E,
|
|
@@ -5513,19 +5563,19 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5513
5563
|
})]
|
|
5514
5564
|
}), /* @__PURE__ */ _("div", {
|
|
5515
5565
|
className: "relative flex-1",
|
|
5516
|
-
style: { height: R *
|
|
5566
|
+
style: { height: R * gi + 4 },
|
|
5517
5567
|
children: L.runs.map((e) => {
|
|
5518
5568
|
let t = L.lanes.get(e.id) ?? 0;
|
|
5519
5569
|
if (t >= R) return null;
|
|
5520
5570
|
let n = O[e.start], r = O[e.end - 1];
|
|
5521
|
-
return /* @__PURE__ */ _(
|
|
5571
|
+
return /* @__PURE__ */ _(oi, {
|
|
5522
5572
|
event: e.event,
|
|
5523
5573
|
compact: !0,
|
|
5524
5574
|
continuesBefore: !!n && a(e.event.start, e.event.end, n.day)?.continuesBefore,
|
|
5525
5575
|
continuesAfter: !!r && a(e.event.start, e.event.end, r.day)?.continuesAfter,
|
|
5526
5576
|
style: {
|
|
5527
|
-
top: t *
|
|
5528
|
-
height:
|
|
5577
|
+
top: t * gi + 2,
|
|
5578
|
+
height: gi - 3,
|
|
5529
5579
|
left: `calc(${e.start / O.length * 100}% + 2px)`,
|
|
5530
5580
|
width: `calc(${(e.end - e.start) / O.length * 100}% - 4px)`,
|
|
5531
5581
|
justifyContent: "center"
|
|
@@ -5548,7 +5598,7 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5548
5598
|
children: !i.timeZone && de.map((e) => /* @__PURE__ */ _("span", {
|
|
5549
5599
|
className: "text-text-tertiary font-mono absolute right-2 -translate-y-1/2 text-2xs",
|
|
5550
5600
|
style: { top: (e - b.min) * C },
|
|
5551
|
-
children:
|
|
5601
|
+
children: Ar(e, i)
|
|
5552
5602
|
}, e))
|
|
5553
5603
|
}), /* @__PURE__ */ v("div", {
|
|
5554
5604
|
role: "group",
|
|
@@ -5589,7 +5639,7 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5589
5639
|
className: "ui-cal-zone-label",
|
|
5590
5640
|
style: { top: (t - r.min) * C },
|
|
5591
5641
|
"aria-hidden": "true",
|
|
5592
|
-
children:
|
|
5642
|
+
children: Or(i.dates.dateAtMinutes(e.day, t), i)
|
|
5593
5643
|
}, `label-${t}`)),
|
|
5594
5644
|
n.outside.map(([e, t]) => /* @__PURE__ */ _("div", {
|
|
5595
5645
|
className: "ui-cal-outside",
|
|
@@ -5603,7 +5653,7 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5603
5653
|
}, `o${e}`)),
|
|
5604
5654
|
n.blocks.map((e) => {
|
|
5605
5655
|
let a = n.blockLayout?.get(e.item.id);
|
|
5606
|
-
return /* @__PURE__ */ _(
|
|
5656
|
+
return /* @__PURE__ */ _(ci, {
|
|
5607
5657
|
block: e.item,
|
|
5608
5658
|
resizeEdge: "bottom",
|
|
5609
5659
|
continuesAfter: e.continuesAfter,
|
|
@@ -5624,10 +5674,10 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5624
5674
|
style: V ? { left: V } : void 0,
|
|
5625
5675
|
className: G("absolute inset-0", F && "ui-cal-muted-layer"),
|
|
5626
5676
|
children: n.placed.map((e) => {
|
|
5627
|
-
let a = n.layout.get(e.item.id), o = Math.max((e.end - e.start) * C,
|
|
5628
|
-
return /* @__PURE__ */ _(
|
|
5677
|
+
let a = n.layout.get(e.item.id), o = Math.max((e.end - e.start) * C, vi);
|
|
5678
|
+
return /* @__PURE__ */ _(oi, {
|
|
5629
5679
|
event: e.item,
|
|
5630
|
-
compact: o <
|
|
5680
|
+
compact: o < yi,
|
|
5631
5681
|
resizeEdge: "bottom",
|
|
5632
5682
|
continuesBefore: e.continuesBefore,
|
|
5633
5683
|
continuesAfter: e.continuesAfter,
|
|
@@ -5663,14 +5713,14 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5663
5713
|
"data-dot": !c || void 0,
|
|
5664
5714
|
style: { top: (fe - r.min) * C }
|
|
5665
5715
|
}),
|
|
5666
|
-
me &&
|
|
5667
|
-
let t =
|
|
5668
|
-
return !t || typeof t != "object" ? null : /* @__PURE__ */ _(
|
|
5716
|
+
me && Br(he, e.resourceId, { emptyMatchesAll: !0 }) && (() => {
|
|
5717
|
+
let t = xi(me, e.day, r.min, r.max, a);
|
|
5718
|
+
return !t || typeof t != "object" ? null : /* @__PURE__ */ _(li, {
|
|
5669
5719
|
draft: me,
|
|
5670
5720
|
invalid: N?.invalid,
|
|
5671
5721
|
style: {
|
|
5672
5722
|
top: (t.start - r.min) * C + 1,
|
|
5673
|
-
height: Math.max((t.end - t.start) * C - 2,
|
|
5723
|
+
height: Math.max((t.end - t.start) * C - 2, vi),
|
|
5674
5724
|
left: V + 1,
|
|
5675
5725
|
right: 4
|
|
5676
5726
|
}
|
|
@@ -5695,8 +5745,8 @@ function gi({ days: e, events: t, availability: n, label: r }) {
|
|
|
5695
5745
|
})
|
|
5696
5746
|
});
|
|
5697
5747
|
}
|
|
5698
|
-
function
|
|
5699
|
-
let o =
|
|
5748
|
+
function Ci({ day: e, weekday: t, isToday: n, grow: r, bordered: i, onOpen: a }) {
|
|
5749
|
+
let o = Qr();
|
|
5700
5750
|
return /* @__PURE__ */ _("div", {
|
|
5701
5751
|
className: G("flex min-w-0 items-center justify-center py-1.5", i && "border-border border-l"),
|
|
5702
5752
|
style: { flex: `${r} 1 0` },
|
|
@@ -5716,8 +5766,8 @@ function _i({ day: e, weekday: t, isToday: n, grow: r, bordered: i, onOpen: a })
|
|
|
5716
5766
|
})
|
|
5717
5767
|
});
|
|
5718
5768
|
}
|
|
5719
|
-
function
|
|
5720
|
-
let n =
|
|
5769
|
+
function wi({ resource: e, sub: t }) {
|
|
5770
|
+
let n = Qr();
|
|
5721
5771
|
return /* @__PURE__ */ v("div", {
|
|
5722
5772
|
className: G("border-border flex min-w-0 flex-1 items-center gap-1.5 border-l px-2 py-1.5", t && "ui-cal-subhead"),
|
|
5723
5773
|
style: { minWidth: n.resourceMinWidth },
|
|
@@ -5739,8 +5789,8 @@ function vi({ resource: e, sub: t }) {
|
|
|
5739
5789
|
}
|
|
5740
5790
|
//#endregion
|
|
5741
5791
|
//#region src/components/ui/calendar/TimelineView.tsx
|
|
5742
|
-
var
|
|
5743
|
-
function
|
|
5792
|
+
var Ti = 34, Ei = 4, Di = 28;
|
|
5793
|
+
function Oi(e, t, n, r, i) {
|
|
5744
5794
|
let a = i(e.start, e.end, t);
|
|
5745
5795
|
return !a || a.endMinute <= n || a.startMinute >= r ? null : {
|
|
5746
5796
|
item: e,
|
|
@@ -5750,8 +5800,8 @@ function Si(e, t, n, r, i) {
|
|
|
5750
5800
|
continuesAfter: a.continuesAfter || a.endMinute > r
|
|
5751
5801
|
};
|
|
5752
5802
|
}
|
|
5753
|
-
function
|
|
5754
|
-
let i =
|
|
5803
|
+
function ki({ day: e, events: t, availability: n, label: r }) {
|
|
5804
|
+
let i = Qr(), { daySegment: a, isSameDay: o, minutesOfDay: s } = i.dates, c = i.dayBounds(e), d = m(null), f = i.resources.length === 0 && t.length === 0 && n.length === 0, [g, y] = h(0);
|
|
5755
5805
|
l(() => {
|
|
5756
5806
|
let e = d.current;
|
|
5757
5807
|
if (!e || typeof ResizeObserver > "u") return;
|
|
@@ -5782,7 +5832,7 @@ function Ci({ day: e, events: t, availability: n, label: r }) {
|
|
|
5782
5832
|
D,
|
|
5783
5833
|
T,
|
|
5784
5834
|
e
|
|
5785
|
-
]), j =
|
|
5835
|
+
]), j = hi({
|
|
5786
5836
|
axis: "x",
|
|
5787
5837
|
columns: k,
|
|
5788
5838
|
pxPerMinute: S,
|
|
@@ -5791,13 +5841,13 @@ function Ci({ day: e, events: t, availability: n, label: r }) {
|
|
|
5791
5841
|
blocks: p(() => new Map(n.map((e) => [e.id, e])), [n]),
|
|
5792
5842
|
initialColumn: 0
|
|
5793
5843
|
}), { drag: M, cursor: N } = j, P = i.editLayer === "availability", F = p(() => {
|
|
5794
|
-
let r =
|
|
5844
|
+
let r = Di / S;
|
|
5795
5845
|
return k.map((o) => {
|
|
5796
|
-
let s = t.filter((e) =>
|
|
5846
|
+
let s = t.filter((e) => Br(e.resourceId, o.resourceId, { emptyMatchesAll: !1 })).map((t) => Oi(t, e, c.min, c.max, a)).filter((e) => e !== null), l = Rr(s.map((e) => ({
|
|
5797
5847
|
id: e.item.id,
|
|
5798
5848
|
start: e.start,
|
|
5799
5849
|
end: Math.max(e.end, e.start + r)
|
|
5800
|
-
}))), u = n.filter((e) =>
|
|
5850
|
+
}))), u = n.filter((e) => Br(e.resourceId, o.resourceId, { emptyMatchesAll: !0 })).map((t) => Oi(t, e, c.min, c.max, a)).filter((e) => e !== null), d = P ? Rr(u.map((e) => ({
|
|
5801
5851
|
id: e.item.id,
|
|
5802
5852
|
start: e.start,
|
|
5803
5853
|
end: Math.max(e.end, e.start + r)
|
|
@@ -5807,7 +5857,7 @@ function Ci({ day: e, events: t, availability: n, label: r }) {
|
|
|
5807
5857
|
lanes: l,
|
|
5808
5858
|
blocks: u,
|
|
5809
5859
|
blockLanes: d,
|
|
5810
|
-
outside: i.hasAvailability && i.shadeOutsideAvailability ?
|
|
5860
|
+
outside: i.hasAvailability && i.shadeOutsideAvailability ? Ir(c.min, c.max, u.map((e) => [e.start, e.end])) : [],
|
|
5811
5861
|
laneCount: f
|
|
5812
5862
|
};
|
|
5813
5863
|
});
|
|
@@ -5844,7 +5894,7 @@ function Ci({ day: e, events: t, availability: n, label: r }) {
|
|
|
5844
5894
|
}, B = "";
|
|
5845
5895
|
if (N) {
|
|
5846
5896
|
let t = k[N.column], n = t?.resourceId ? i.resourceById.get(t.resourceId) : void 0;
|
|
5847
|
-
B = `${n ? `${n.title}, ` : ""}${i.timeZone ?
|
|
5897
|
+
B = `${n ? `${n.title}, ` : ""}${i.timeZone ? Or(i.dates.dateAtMinutes(e, N.start), i) : gr(N.start)} to ${i.timeZone ? Or(i.dates.dateAtMinutes(e, N.end), i) : gr(N.end)}`;
|
|
5848
5898
|
}
|
|
5849
5899
|
function oe(e) {
|
|
5850
5900
|
E((t) => {
|
|
@@ -5872,7 +5922,7 @@ function Ci({ day: e, events: t, availability: n, label: r }) {
|
|
|
5872
5922
|
children: ee.map((t) => /* @__PURE__ */ _("span", {
|
|
5873
5923
|
className: "text-text-tertiary font-mono absolute top-1.5 text-2xs",
|
|
5874
5924
|
style: { left: (t - c.min) * S + 4 },
|
|
5875
|
-
children: i.timeZone ?
|
|
5925
|
+
children: i.timeZone ? Or(i.dates.dateAtMinutes(e, t), i) : Ar(t, i)
|
|
5876
5926
|
}, t))
|
|
5877
5927
|
})]
|
|
5878
5928
|
}), /* @__PURE__ */ v("div", {
|
|
@@ -5918,7 +5968,7 @@ function Ci({ day: e, events: t, availability: n, label: r }) {
|
|
|
5918
5968
|
}), !n && t.resources.map((t) => {
|
|
5919
5969
|
let n = se++, r = F[n], o = k[n];
|
|
5920
5970
|
if (!r || !o) return null;
|
|
5921
|
-
let s = r.laneCount *
|
|
5971
|
+
let s = r.laneCount * Ti + Ei * 2;
|
|
5922
5972
|
return /* @__PURE__ */ v("div", {
|
|
5923
5973
|
className: "border-border flex border-b",
|
|
5924
5974
|
children: [/* @__PURE__ */ v("div", {
|
|
@@ -5958,7 +6008,7 @@ function Ci({ day: e, events: t, availability: n, label: r }) {
|
|
|
5958
6008
|
}, `o${e}`)),
|
|
5959
6009
|
r.blocks.map((e) => {
|
|
5960
6010
|
let t = r.blockLanes?.lanes.get(e.item.id);
|
|
5961
|
-
return /* @__PURE__ */ _(
|
|
6011
|
+
return /* @__PURE__ */ _(ci, {
|
|
5962
6012
|
block: e.item,
|
|
5963
6013
|
resizeEdge: "right",
|
|
5964
6014
|
continuesAfter: e.continuesAfter,
|
|
@@ -5966,8 +6016,8 @@ function Ci({ day: e, events: t, availability: n, label: r }) {
|
|
|
5966
6016
|
style: {
|
|
5967
6017
|
left: (e.start - c.min) * S,
|
|
5968
6018
|
width: Math.max((e.end - e.start) * S, 4),
|
|
5969
|
-
top: t === void 0 ? 0 :
|
|
5970
|
-
height: t === void 0 ? "100%" :
|
|
6019
|
+
top: t === void 0 ? 0 : Ei + t * Ti,
|
|
6020
|
+
height: t === void 0 ? "100%" : Ti - 3
|
|
5971
6021
|
},
|
|
5972
6022
|
onKeyDown: (t) => j.onItemKeyDown(t, "availability", e.item.id, n),
|
|
5973
6023
|
onClick: (t) => {
|
|
@@ -5979,7 +6029,7 @@ function Ci({ day: e, events: t, availability: n, label: r }) {
|
|
|
5979
6029
|
className: G("absolute inset-0", P && "ui-cal-muted-layer"),
|
|
5980
6030
|
children: r.placed.map((e) => {
|
|
5981
6031
|
let t = r.lanes.lanes.get(e.item.id) ?? 0;
|
|
5982
|
-
return /* @__PURE__ */ _(
|
|
6032
|
+
return /* @__PURE__ */ _(oi, {
|
|
5983
6033
|
event: e.item,
|
|
5984
6034
|
compact: !1,
|
|
5985
6035
|
dense: !0,
|
|
@@ -5989,9 +6039,9 @@ function Ci({ day: e, events: t, availability: n, label: r }) {
|
|
|
5989
6039
|
dragging: M?.itemId === e.item.id,
|
|
5990
6040
|
style: {
|
|
5991
6041
|
left: (e.start - c.min) * S + 1,
|
|
5992
|
-
width: Math.max((e.end - e.start) * S,
|
|
5993
|
-
top:
|
|
5994
|
-
height:
|
|
6042
|
+
width: Math.max((e.end - e.start) * S, Di) - 2,
|
|
6043
|
+
top: Ei + t * Ti,
|
|
6044
|
+
height: Ti - 3,
|
|
5995
6045
|
justifyContent: "center"
|
|
5996
6046
|
},
|
|
5997
6047
|
onKeyDown: (t) => j.onItemKeyDown(t, "event", e.item.id, n),
|
|
@@ -6006,16 +6056,16 @@ function Ci({ day: e, events: t, availability: n, label: r }) {
|
|
|
6006
6056
|
"data-axis": "x",
|
|
6007
6057
|
style: { left: (ne - c.min) * S }
|
|
6008
6058
|
}),
|
|
6009
|
-
z &&
|
|
6010
|
-
let t =
|
|
6011
|
-
return t ? /* @__PURE__ */ _(
|
|
6059
|
+
z && Br(ie, o.resourceId, { emptyMatchesAll: !0 }) && (() => {
|
|
6060
|
+
let t = Oi(z, e, c.min, c.max, a);
|
|
6061
|
+
return t ? /* @__PURE__ */ _(li, {
|
|
6012
6062
|
draft: z,
|
|
6013
6063
|
invalid: M?.invalid,
|
|
6014
6064
|
style: {
|
|
6015
6065
|
left: (t.start - c.min) * S + 1,
|
|
6016
|
-
width: Math.max((t.end - t.start) * S - 2,
|
|
6017
|
-
top:
|
|
6018
|
-
bottom:
|
|
6066
|
+
width: Math.max((t.end - t.start) * S - 2, Di),
|
|
6067
|
+
top: Ei,
|
|
6068
|
+
bottom: Ei
|
|
6019
6069
|
}
|
|
6020
6070
|
}) : null;
|
|
6021
6071
|
})(),
|
|
@@ -6041,7 +6091,7 @@ function Ci({ day: e, events: t, availability: n, label: r }) {
|
|
|
6041
6091
|
}
|
|
6042
6092
|
//#endregion
|
|
6043
6093
|
//#region src/components/ui/calendar/types.ts
|
|
6044
|
-
var
|
|
6094
|
+
var Ai = {
|
|
6045
6095
|
today: "Today",
|
|
6046
6096
|
previous: "Previous",
|
|
6047
6097
|
next: "Next",
|
|
@@ -6078,7 +6128,7 @@ var wi = {
|
|
|
6078
6128
|
};
|
|
6079
6129
|
//#endregion
|
|
6080
6130
|
//#region src/components/ui/RadioPill.tsx
|
|
6081
|
-
function
|
|
6131
|
+
function ji({ options: e, value: t, onChange: n, disabled: r, className: i, "aria-label": a }) {
|
|
6082
6132
|
return /* @__PURE__ */ _("div", {
|
|
6083
6133
|
role: "radiogroup",
|
|
6084
6134
|
"aria-label": a,
|
|
@@ -6095,25 +6145,25 @@ function Ti({ options: e, value: t, onChange: n, disabled: r, className: i, "ari
|
|
|
6095
6145
|
}
|
|
6096
6146
|
//#endregion
|
|
6097
6147
|
//#region src/components/ui/Calendar.tsx
|
|
6098
|
-
var
|
|
6148
|
+
var Mi = [
|
|
6099
6149
|
"day",
|
|
6100
6150
|
"threeDay",
|
|
6101
6151
|
"week",
|
|
6102
6152
|
"month",
|
|
6103
6153
|
"agenda"
|
|
6104
6154
|
];
|
|
6105
|
-
function
|
|
6155
|
+
function Ni() {
|
|
6106
6156
|
return /* @__PURE__ */ new Date();
|
|
6107
6157
|
}
|
|
6108
|
-
function
|
|
6109
|
-
let [t, n] = h(
|
|
6158
|
+
function Pi(e) {
|
|
6159
|
+
let [t, n] = h(Ni);
|
|
6110
6160
|
return l(() => {
|
|
6111
6161
|
if (e) return;
|
|
6112
|
-
let t = setInterval(() => n(
|
|
6162
|
+
let t = setInterval(() => n(Ni()), 3e4);
|
|
6113
6163
|
return () => clearInterval(t);
|
|
6114
6164
|
}, [e]), e ?? t;
|
|
6115
6165
|
}
|
|
6116
|
-
function
|
|
6166
|
+
function Fi(e) {
|
|
6117
6167
|
let [t, n] = h(null);
|
|
6118
6168
|
return l(() => {
|
|
6119
6169
|
let t = e.current;
|
|
@@ -6124,35 +6174,35 @@ function ki(e) {
|
|
|
6124
6174
|
return r.observe(t), () => r.disconnect();
|
|
6125
6175
|
}, [e]), t;
|
|
6126
6176
|
}
|
|
6127
|
-
var
|
|
6128
|
-
function
|
|
6177
|
+
var Ii = /* @__PURE__ */ new Set();
|
|
6178
|
+
function Li(e) {
|
|
6129
6179
|
let t = !1;
|
|
6130
6180
|
try {
|
|
6131
6181
|
t = process.env.NODE_ENV !== "production";
|
|
6132
6182
|
} catch {}
|
|
6133
|
-
!t ||
|
|
6183
|
+
!t || Ii.has(e) || (Ii.add(e), console.warn(`[Calendar] ${e}`));
|
|
6134
6184
|
}
|
|
6135
|
-
function
|
|
6185
|
+
function Ri(e, t, n) {
|
|
6136
6186
|
try {
|
|
6137
|
-
return
|
|
6187
|
+
return hr(t);
|
|
6138
6188
|
} catch {
|
|
6139
|
-
return
|
|
6189
|
+
return Li(`Invalid ${e} "${t}", expected HH:mm; using the default.`), n;
|
|
6140
6190
|
}
|
|
6141
6191
|
}
|
|
6142
|
-
function
|
|
6143
|
-
let ye = p(() =>
|
|
6192
|
+
function zi({ events: e = [], availability: t, resources: n = [], view: r, defaultView: i = "week", onViewChange: a, views: o = Mi, date: s, defaultDate: c, onDateChange: d, onRangeChange: g, weekStartsOn: y = 1, workWeekDays: b, agendaDays: x = 7, slotMinTime: S = "07:00", slotMaxTime: C = "20:00", slotDuration: w = 15, slotLabelInterval: T = 60, hourHeight: E = 48, timelineHourWidth: D = 96, resourceMinWidth: O = 120, scrollToTime: j, scrollAlign: M = "start", now: N, nowIndicator: P = !0, editLayer: F = "events", readOnly: I = !1, selectable: R, clickCreateDuration: ee = 30, shadeOutsideAvailability: te = !0, onCreate: ne, onEventClick: re, onEventChange: z, onAvailabilityClick: ie, onAvailabilityChange: ae, validate: B, onInvalidChange: oe, onDateClick: se, renderEvent: ce, monthMaxEvents: V, agendaShowAvailability: le = !0, display: ue, narrowView: H = "day", narrowWidth: de = 640, locale: U = "en-GB", timeZone: W, hour12: fe = !1, labels: pe, toolbar: me = !0, toolbarActions: he, loading: ge = !1, className: _e, "aria-label": ve }) {
|
|
6193
|
+
let ye = p(() => Xr(W), [W]), { addDays: be, formatLongDate: xe, formatRangeTitle: Se, getVisibleDays: Ce, minutesOfDay: we, shiftDate: Te } = ye, Ee = m(null), De = u(), Oe = Pi(N), ke = Fi(Ee), [Ae, je] = h(i), [Me, Ne] = h(() => c ?? Ni()), Pe = r ?? Ae, Fe = s ?? Me, K = (e) => {
|
|
6144
6194
|
r === void 0 && je(e), a?.(e);
|
|
6145
6195
|
}, Ie = (e) => {
|
|
6146
6196
|
s === void 0 && Ne(e), d?.(e);
|
|
6147
|
-
}, Le = ke !== null && ke < de && H !== !1 &&
|
|
6148
|
-
...
|
|
6197
|
+
}, Le = ke !== null && ke < de && H !== !1 && xr(Pe) && Pe !== "day" && H ? H : Pe, q = p(() => ({
|
|
6198
|
+
...Ai,
|
|
6149
6199
|
...pe,
|
|
6150
6200
|
views: {
|
|
6151
|
-
...
|
|
6201
|
+
...Ai.views,
|
|
6152
6202
|
...pe?.views
|
|
6153
6203
|
},
|
|
6154
6204
|
status: {
|
|
6155
|
-
...
|
|
6205
|
+
...Ai.status,
|
|
6156
6206
|
...pe?.status
|
|
6157
6207
|
}
|
|
6158
6208
|
}), [pe]), Re = p(() => ({
|
|
@@ -6182,16 +6232,16 @@ function Ni({ events: e = [], availability: t, resources: n = [], view: r, defau
|
|
|
6182
6232
|
Ue,
|
|
6183
6233
|
Le
|
|
6184
6234
|
]);
|
|
6185
|
-
let Ge = p(() => e.filter((e) =>
|
|
6235
|
+
let Ge = p(() => e.filter((e) => Nr(e.start.getTime(), Math.max(e.end.getTime(), e.start.getTime() + 1), He, Ue)), [
|
|
6186
6236
|
e,
|
|
6187
6237
|
He,
|
|
6188
6238
|
Ue
|
|
6189
|
-
]), Ke = p(() => (t ?? []).filter((e) =>
|
|
6239
|
+
]), Ke = p(() => (t ?? []).filter((e) => Nr(e.start.getTime(), e.end.getTime(), He, Ue)), [
|
|
6190
6240
|
t,
|
|
6191
6241
|
He,
|
|
6192
6242
|
Ue
|
|
6193
|
-
]), qe =
|
|
6194
|
-
Je <= qe &&
|
|
6243
|
+
]), qe = Ri("slotMinTime", S, 0), Je = Ri("slotMaxTime", C, 1440);
|
|
6244
|
+
Je <= qe && Li(`slotMaxTime "${C}" must be after slotMinTime "${S}"; showing the whole day.`);
|
|
6195
6245
|
let Ye = p(() => Je > qe ? {
|
|
6196
6246
|
min: qe,
|
|
6197
6247
|
max: Je
|
|
@@ -6199,7 +6249,7 @@ function Ni({ events: e = [], availability: t, resources: n = [], view: r, defau
|
|
|
6199
6249
|
min: 0,
|
|
6200
6250
|
max: 1440
|
|
6201
6251
|
}, [qe, Je]), Xe = Math.max(1, Math.round(w)), Y;
|
|
6202
|
-
if (j) Y =
|
|
6252
|
+
if (j) Y = Ri("scrollToTime", j, Ye.min);
|
|
6203
6253
|
else {
|
|
6204
6254
|
let e = Ke.filter((e) => (e.kind ?? "available") === "available").map((e) => W ? ye.parts(e.start).hour * 60 + ye.parts(e.start).minute : we(e.start)).filter((e) => e >= Ye.min && e < Ye.max);
|
|
6205
6255
|
e.length && (Y = Math.min(...e));
|
|
@@ -6211,8 +6261,8 @@ function Ni({ events: e = [], availability: t, resources: n = [], view: r, defau
|
|
|
6211
6261
|
locale: U,
|
|
6212
6262
|
hour12: fe,
|
|
6213
6263
|
timeZone: W
|
|
6214
|
-
}, et = (e) => Ze.get(
|
|
6215
|
-
let t =
|
|
6264
|
+
}, et = (e) => Ze.get(zr(e)[0] ?? ""), tt = (e) => {
|
|
6265
|
+
let t = zr(e).map((e) => Ze.get(e)?.title).filter(Boolean);
|
|
6216
6266
|
return t.length ? `, ${t.join(", ")}` : "";
|
|
6217
6267
|
}, nt = (e) => e.status && e.status !== "confirmed" ? q.status[e.status] : void 0, rt = (e) => {
|
|
6218
6268
|
let t = B?.(e);
|
|
@@ -6260,7 +6310,7 @@ function Ni({ events: e = [], availability: t, resources: n = [], view: r, defau
|
|
|
6260
6310
|
blockColor: (e) => e.color ?? et(e.resourceId)?.color ?? ((e.kind ?? "available") === "available" ? "green" : "gray"),
|
|
6261
6311
|
statusLabel: nt,
|
|
6262
6312
|
describeEvent: (e) => {
|
|
6263
|
-
let t = e.allDay ? `${xe(e.start, U)}, ${q.allDay}` : `${xe(e.start, U)}, ${
|
|
6313
|
+
let t = e.allDay ? `${xe(e.start, U)}, ${q.allDay}` : `${xe(e.start, U)}, ${kr(e.start, e.end, $e)}`, n = nt(e);
|
|
6264
6314
|
return [
|
|
6265
6315
|
e.title,
|
|
6266
6316
|
t,
|
|
@@ -6272,7 +6322,7 @@ function Ni({ events: e = [], availability: t, resources: n = [], view: r, defau
|
|
|
6272
6322
|
describeBlock: (e) => [
|
|
6273
6323
|
(e.kind ?? "available") === "available" ? q.available : q.unavailable,
|
|
6274
6324
|
e.label,
|
|
6275
|
-
`${xe(e.start, U)}, ${
|
|
6325
|
+
`${xe(e.start, U)}, ${kr(e.start, e.end, $e)}`
|
|
6276
6326
|
].filter(Boolean).join(", ").concat(tt(e.resourceId)),
|
|
6277
6327
|
renderEvent: ce,
|
|
6278
6328
|
hasEventClick: !!re,
|
|
@@ -6317,27 +6367,27 @@ function Ni({ events: e = [], availability: t, resources: n = [], view: r, defau
|
|
|
6317
6367
|
Xe,
|
|
6318
6368
|
n.map((e) => e.id)
|
|
6319
6369
|
]), st;
|
|
6320
|
-
return st = Le === "month" ? /* @__PURE__ */ _(
|
|
6370
|
+
return st = Le === "month" ? /* @__PURE__ */ _(ai, {
|
|
6321
6371
|
date: Fe,
|
|
6322
6372
|
events: Ge,
|
|
6323
6373
|
availability: Ke,
|
|
6324
6374
|
label: at
|
|
6325
|
-
}, W) : Le === "agenda" ? /* @__PURE__ */ _(
|
|
6375
|
+
}, W) : Le === "agenda" ? /* @__PURE__ */ _($r, {
|
|
6326
6376
|
days: J,
|
|
6327
6377
|
events: Ge.filter((e) => !e.placeholder),
|
|
6328
6378
|
availability: Ke.filter((e) => !e.placeholder),
|
|
6329
6379
|
label: at
|
|
6330
|
-
}, W) : Le === "timeline" ? /* @__PURE__ */ _(
|
|
6380
|
+
}, W) : Le === "timeline" ? /* @__PURE__ */ _(ki, {
|
|
6331
6381
|
day: J[0],
|
|
6332
6382
|
events: Ge,
|
|
6333
6383
|
availability: Ke,
|
|
6334
6384
|
label: at
|
|
6335
|
-
}, ot) : /* @__PURE__ */ _(
|
|
6385
|
+
}, ot) : /* @__PURE__ */ _(Si, {
|
|
6336
6386
|
days: J,
|
|
6337
6387
|
events: Ge,
|
|
6338
6388
|
availability: Ke,
|
|
6339
6389
|
label: at
|
|
6340
|
-
}, ot), /* @__PURE__ */ _(
|
|
6390
|
+
}, ot), /* @__PURE__ */ _(Zr.Provider, {
|
|
6341
6391
|
value: it,
|
|
6342
6392
|
children: /* @__PURE__ */ v("div", {
|
|
6343
6393
|
ref: Ee,
|
|
@@ -6386,12 +6436,12 @@ function Ni({ events: e = [], availability: t, resources: n = [], view: r, defau
|
|
|
6386
6436
|
]
|
|
6387
6437
|
}), /* @__PURE__ */ v("div", {
|
|
6388
6438
|
className: "flex items-center gap-1.5",
|
|
6389
|
-
children: [he, o.length > 1 && (ke === null || ke >= o.length * 80 + 420 ? /* @__PURE__ */ _(
|
|
6439
|
+
children: [he, o.length > 1 && (ke === null || ke >= o.length * 80 + 420 ? /* @__PURE__ */ _(ji, {
|
|
6390
6440
|
"aria-label": q.view,
|
|
6391
6441
|
options: X,
|
|
6392
6442
|
value: Pe,
|
|
6393
6443
|
onChange: K
|
|
6394
|
-
}) : /* @__PURE__ */ _(
|
|
6444
|
+
}) : /* @__PURE__ */ _(xn, {
|
|
6395
6445
|
className: "w-28",
|
|
6396
6446
|
size: "sm",
|
|
6397
6447
|
options: X,
|
|
@@ -6415,7 +6465,7 @@ function Ni({ events: e = [], availability: t, resources: n = [], view: r, defau
|
|
|
6415
6465
|
}
|
|
6416
6466
|
//#endregion
|
|
6417
6467
|
//#region src/components/ui/CalendarGrid.tsx
|
|
6418
|
-
var
|
|
6468
|
+
var Bi = [
|
|
6419
6469
|
"Mo",
|
|
6420
6470
|
"Tu",
|
|
6421
6471
|
"We",
|
|
@@ -6423,7 +6473,7 @@ var Pi = [
|
|
|
6423
6473
|
"Fr",
|
|
6424
6474
|
"Sa",
|
|
6425
6475
|
"Su"
|
|
6426
|
-
],
|
|
6476
|
+
], Vi = [
|
|
6427
6477
|
"January",
|
|
6428
6478
|
"February",
|
|
6429
6479
|
"March",
|
|
@@ -6437,24 +6487,24 @@ var Pi = [
|
|
|
6437
6487
|
"November",
|
|
6438
6488
|
"December"
|
|
6439
6489
|
];
|
|
6440
|
-
function
|
|
6490
|
+
function Hi(e, t, n) {
|
|
6441
6491
|
let r = Z(e, n), i = Z(t, n);
|
|
6442
6492
|
return r.year === i.year && r.month === i.month && r.day === i.day;
|
|
6443
6493
|
}
|
|
6444
|
-
function
|
|
6494
|
+
function Ui(e, t, n) {
|
|
6445
6495
|
if (!t || !n) return !1;
|
|
6446
6496
|
let r = e.getTime(), i = Math.min(t.getTime(), n.getTime()), a = Math.max(t.getTime(), n.getTime());
|
|
6447
6497
|
return r > i && r < a;
|
|
6448
6498
|
}
|
|
6449
|
-
function
|
|
6499
|
+
function Wi(e, t) {
|
|
6450
6500
|
return new Date(e, t + 1, 0).getDate();
|
|
6451
6501
|
}
|
|
6452
|
-
function
|
|
6502
|
+
function Gi(e, t) {
|
|
6453
6503
|
let n = new Date(e, t, 1).getDay();
|
|
6454
6504
|
return n === 0 ? 6 : n - 1;
|
|
6455
6505
|
}
|
|
6456
|
-
function
|
|
6457
|
-
let f =
|
|
6506
|
+
function Ki({ year: e, month: t, timeZone: n, selected: r, rangeStart: i, rangeEnd: a, hoverDate: o, onSelect: s, onMonthChange: c, onHover: l, minDate: u, maxDate: d }) {
|
|
6507
|
+
let f = Wi(e, t), p = Gi(e, t), g = /* @__PURE__ */ new Date(), y = m(null), [b, x] = h(null);
|
|
6458
6508
|
function S() {
|
|
6459
6509
|
return b !== null && b >= 1 && b <= f ? b : r && Z(r, n).year === e && Z(r, n).month - 1 === t ? Z(r, n).day : i && Z(i, n).year === e && Z(i, n).month - 1 === t ? Z(i, n).day : Z(g, n).year === e && Z(g, n).month - 1 === t ? Z(g, n).day : 1;
|
|
6460
6510
|
}
|
|
@@ -6506,7 +6556,7 @@ function Bi({ year: e, month: t, timeZone: n, selected: r, rangeStart: i, rangeE
|
|
|
6506
6556
|
className: "text-text-primary text-xs font-semibold",
|
|
6507
6557
|
"aria-live": "polite",
|
|
6508
6558
|
children: [
|
|
6509
|
-
|
|
6559
|
+
Vi[t],
|
|
6510
6560
|
" ",
|
|
6511
6561
|
e
|
|
6512
6562
|
]
|
|
@@ -6521,12 +6571,12 @@ function Bi({ year: e, month: t, timeZone: n, selected: r, rangeStart: i, rangeE
|
|
|
6521
6571
|
]
|
|
6522
6572
|
}), /* @__PURE__ */ v("div", {
|
|
6523
6573
|
className: "grid grid-cols-7 gap-0",
|
|
6524
|
-
children: [
|
|
6574
|
+
children: [Bi.map((e) => /* @__PURE__ */ _("div", {
|
|
6525
6575
|
className: "text-text-tertiary text-2xs flex h-8 items-center justify-center font-medium",
|
|
6526
6576
|
children: e
|
|
6527
6577
|
}, e)), D.map((c, f) => {
|
|
6528
6578
|
if (c === null) return /* @__PURE__ */ _("div", { className: "h-8" }, `empty-${f}`);
|
|
6529
|
-
let p =
|
|
6579
|
+
let p = tr({
|
|
6530
6580
|
year: e,
|
|
6531
6581
|
month: t + 1,
|
|
6532
6582
|
day: c,
|
|
@@ -6534,13 +6584,13 @@ function Bi({ year: e, month: t, timeZone: n, selected: r, rangeStart: i, rangeE
|
|
|
6534
6584
|
minute: 0,
|
|
6535
6585
|
second: 0,
|
|
6536
6586
|
millisecond: 0
|
|
6537
|
-
}, n), m =
|
|
6587
|
+
}, n), m = Hi(p, g, n), h = r ? Hi(p, r, n) : !1, v = i ? Hi(p, i, n) : !1, y = a ? Hi(p, a, n) : !1, b = Ui(p, i ?? null, a ?? o ?? null), x = u && p < u || d && p > d;
|
|
6538
6588
|
return /* @__PURE__ */ _("button", {
|
|
6539
6589
|
type: "button",
|
|
6540
6590
|
"data-day": c,
|
|
6541
6591
|
disabled: !!x,
|
|
6542
6592
|
tabIndex: c === C ? 0 : -1,
|
|
6543
|
-
"aria-label": `${
|
|
6593
|
+
"aria-label": `${Vi[t]} ${c}, ${e}`,
|
|
6544
6594
|
"aria-current": m ? "date" : void 0,
|
|
6545
6595
|
onClick: () => s(p),
|
|
6546
6596
|
onKeyDown: (e) => w(e, c),
|
|
@@ -6555,13 +6605,15 @@ function Bi({ year: e, month: t, timeZone: n, selected: r, rangeStart: i, rangeE
|
|
|
6555
6605
|
}
|
|
6556
6606
|
//#endregion
|
|
6557
6607
|
//#region src/components/ui/Card.tsx
|
|
6558
|
-
function
|
|
6608
|
+
function qi({ children: e, className: t, header: n, footer: r, as: i = "div", flush: a = !1, bodyClassName: o, ...s }) {
|
|
6609
|
+
let c = an();
|
|
6559
6610
|
return /* @__PURE__ */ v(i, {
|
|
6560
6611
|
...s,
|
|
6561
6612
|
className: G("bg-bg-secondary border-border overflow-hidden rounded-md border", t),
|
|
6562
6613
|
children: [
|
|
6563
6614
|
n && /* @__PURE__ */ _("div", {
|
|
6564
|
-
|
|
6615
|
+
"data-control-size": c,
|
|
6616
|
+
className: "ui-bar border-border flex flex-col justify-center border-b px-3 py-2.5",
|
|
6565
6617
|
children: n
|
|
6566
6618
|
}),
|
|
6567
6619
|
/* @__PURE__ */ _("div", {
|
|
@@ -6569,7 +6621,8 @@ function Vi({ children: e, className: t, header: n, footer: r, as: i = "div", fl
|
|
|
6569
6621
|
children: e
|
|
6570
6622
|
}),
|
|
6571
6623
|
r && /* @__PURE__ */ _("div", {
|
|
6572
|
-
|
|
6624
|
+
"data-control-size": c,
|
|
6625
|
+
className: "ui-bar border-border bg-bg-primary/50 flex flex-col justify-center border-t px-3 py-2.5",
|
|
6573
6626
|
children: r
|
|
6574
6627
|
})
|
|
6575
6628
|
]
|
|
@@ -6577,16 +6630,16 @@ function Vi({ children: e, className: t, header: n, footer: r, as: i = "div", fl
|
|
|
6577
6630
|
}
|
|
6578
6631
|
//#endregion
|
|
6579
6632
|
//#region src/lib/codeInput.ts
|
|
6580
|
-
function
|
|
6633
|
+
function Ji(e, t) {
|
|
6581
6634
|
let n = e.replace(/\D/g, "").slice(0, t);
|
|
6582
6635
|
return Array.from({ length: t }, (e, t) => n[t] ?? "");
|
|
6583
6636
|
}
|
|
6584
|
-
function
|
|
6637
|
+
function Yi(e, t, n) {
|
|
6585
6638
|
if (!t || e.length <= t.length) return e;
|
|
6586
6639
|
let r = e.length - t.length, i = n ?? e.length;
|
|
6587
6640
|
return i - r >= 0 ? e.slice(i - r, i) : e.slice(-r);
|
|
6588
6641
|
}
|
|
6589
|
-
function
|
|
6642
|
+
function Xi(e, t, n) {
|
|
6590
6643
|
let r = e.length, i = n.match(RegExp(`(?<!\\d)\\d{${r}}(?!\\d)`));
|
|
6591
6644
|
if (i) return {
|
|
6592
6645
|
slots: i[0].split(""),
|
|
@@ -6606,7 +6659,7 @@ function Wi(e, t, n) {
|
|
|
6606
6659
|
focus: Math.min(t + a.length, r - 1)
|
|
6607
6660
|
};
|
|
6608
6661
|
}
|
|
6609
|
-
function
|
|
6662
|
+
function Zi(e, t, n, r) {
|
|
6610
6663
|
if (n === "") {
|
|
6611
6664
|
let n = [...e];
|
|
6612
6665
|
return n[t] = "", {
|
|
@@ -6614,9 +6667,9 @@ function Gi(e, t, n, r) {
|
|
|
6614
6667
|
focus: t
|
|
6615
6668
|
};
|
|
6616
6669
|
}
|
|
6617
|
-
return
|
|
6670
|
+
return Xi(e, t, Yi(n, e[t], r));
|
|
6618
6671
|
}
|
|
6619
|
-
function
|
|
6672
|
+
function Qi(e, t) {
|
|
6620
6673
|
let n = e[t] ? t : t - 1;
|
|
6621
6674
|
if (n < 0) return null;
|
|
6622
6675
|
let r = [...e];
|
|
@@ -6627,15 +6680,15 @@ function Ki(e, t) {
|
|
|
6627
6680
|
}
|
|
6628
6681
|
//#endregion
|
|
6629
6682
|
//#region src/components/ui/CodeInput.tsx
|
|
6630
|
-
function
|
|
6631
|
-
let f = m([]), p = u(), g = a || !!i, [y, b] = h(() =>
|
|
6683
|
+
function $i({ value: e, onChange: t, onComplete: n, length: r = 6, error: i, invalid: a, disabled: o, autoFocus: s, name: c, "aria-label": l = "Verification code", className: d }) {
|
|
6684
|
+
let f = m([]), p = u(), g = a || !!i, [y, b] = h(() => Ji(e, r)), [x, S] = h({
|
|
6632
6685
|
value: e,
|
|
6633
6686
|
length: r
|
|
6634
6687
|
});
|
|
6635
6688
|
(x.value !== e || x.length !== r) && (S({
|
|
6636
6689
|
value: e,
|
|
6637
6690
|
length: r
|
|
6638
|
-
}), (y.length !== r || y.join("") !== e) && b(
|
|
6691
|
+
}), (y.length !== r || y.join("") !== e) && b(Ji(e, r)));
|
|
6639
6692
|
function C(e) {
|
|
6640
6693
|
let t = f.current[Math.max(0, Math.min(e, r - 1))];
|
|
6641
6694
|
t?.focus(), t?.select();
|
|
@@ -6647,7 +6700,7 @@ function qi({ value: e, onChange: t, onComplete: n, length: r = 6, error: i, inv
|
|
|
6647
6700
|
t(r), e.slots.every(Boolean) && n?.(r), C(e.focus);
|
|
6648
6701
|
}
|
|
6649
6702
|
function T(e, t) {
|
|
6650
|
-
t.key === "Backspace" ? (t.preventDefault(), w(
|
|
6703
|
+
t.key === "Backspace" ? (t.preventDefault(), w(Qi(y, e))) : t.key === "ArrowLeft" ? (t.preventDefault(), C(e - 1)) : t.key === "ArrowRight" && (t.preventDefault(), C(e + 1));
|
|
6651
6704
|
}
|
|
6652
6705
|
return /* @__PURE__ */ v("div", {
|
|
6653
6706
|
className: G("flex flex-col gap-1.5", d),
|
|
@@ -6670,10 +6723,10 @@ function qi({ value: e, onChange: t, onComplete: n, length: r = 6, error: i, inv
|
|
|
6670
6723
|
"aria-describedby": i ? p : void 0,
|
|
6671
6724
|
value: e,
|
|
6672
6725
|
onFocus: (e) => e.target.select(),
|
|
6673
|
-
onChange: (e) => w(
|
|
6726
|
+
onChange: (e) => w(Zi(y, t, e.target.value, e.target.selectionStart)),
|
|
6674
6727
|
onKeyDown: (e) => T(t, e),
|
|
6675
6728
|
onPaste: (e) => {
|
|
6676
|
-
e.preventDefault(), w(
|
|
6729
|
+
e.preventDefault(), w(Xi(y, t, e.clipboardData.getData("text")));
|
|
6677
6730
|
},
|
|
6678
6731
|
className: G("bg-bg-secondary text-text-primary h-10 w-10 rounded-md border text-center font-mono text-sm", "transition-colors duration-[100ms]", "focus:border-accent focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-40", g ? "border-red" : "border-border")
|
|
6679
6732
|
}, t))
|
|
@@ -6695,7 +6748,7 @@ function qi({ value: e, onChange: t, onComplete: n, length: r = 6, error: i, inv
|
|
|
6695
6748
|
}
|
|
6696
6749
|
//#endregion
|
|
6697
6750
|
//#region src/components/ui/Combobox.tsx
|
|
6698
|
-
function
|
|
6751
|
+
function ea({ options: e, value: t, onChange: n, onOptionChange: r, placeholder: i = "Select...", label: a, className: o, controlSize: c, id: l, name: d, disabled: f, "aria-label": p, "aria-describedby": g, "aria-invalid": y, query: b, onQueryChange: x, filterOptions: S = !0, selectedOption: C, renderOption: w, loading: T = !1, loadingMessage: D = "Loading results…", error: k, onRetry: A, emptyMessage: j = "No results", footer: M }) {
|
|
6699
6752
|
let N = an(c), [P, F] = h(!1), [I, L] = h(""), [R, ee] = h(0), [te, ne] = h(() => e.find((e) => e.value === t)), re = m(null), z = m(null), ie = m(null), ae = u(), oe = l ?? `${ae}-search`, se = `${ae}-label`, ce = `${ae}-selected`, V = `${ae}-listbox`, le = b ?? I, ue = e.find((e) => e.value === t) ?? (C?.value === t ? C : void 0) ?? (te?.value === t ? te : void 0), H = S ? e.filter((e) => e.label.toLowerCase().includes(le.toLowerCase())) : e, de = Math.min(R, Math.max(H.length - 1, 0)), U = H[de], W = P && !f;
|
|
6700
6753
|
function fe(e) {
|
|
6701
6754
|
b === void 0 && L(e), x?.(e), ee(0);
|
|
@@ -6860,7 +6913,7 @@ function Ji({ options: e, value: t, onChange: n, onOptionChange: r, placeholder:
|
|
|
6860
6913
|
}
|
|
6861
6914
|
//#endregion
|
|
6862
6915
|
//#region src/components/ui/DangerZone.tsx
|
|
6863
|
-
function
|
|
6916
|
+
function ta({ title: e = "Danger Zone", description: t, children: n, className: r }) {
|
|
6864
6917
|
return /* @__PURE__ */ v("div", {
|
|
6865
6918
|
className: G("border-border mt-8 border-t pt-6", r),
|
|
6866
6919
|
children: [
|
|
@@ -6878,7 +6931,7 @@ function Yi({ title: e = "Danger Zone", description: t, children: n, className:
|
|
|
6878
6931
|
}
|
|
6879
6932
|
//#endregion
|
|
6880
6933
|
//#region src/components/ui/DatePicker.tsx
|
|
6881
|
-
function
|
|
6934
|
+
function na(e) {
|
|
6882
6935
|
return `${[
|
|
6883
6936
|
"Jan",
|
|
6884
6937
|
"Feb",
|
|
@@ -6894,8 +6947,8 @@ function Xi(e) {
|
|
|
6894
6947
|
"Dec"
|
|
6895
6948
|
][e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`;
|
|
6896
6949
|
}
|
|
6897
|
-
function
|
|
6898
|
-
let c = an(e), [l, u] = h(!1), d = m(null), f = m(null), p =
|
|
6950
|
+
function ra({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, placeholder: a = "Select date...", format: o }) {
|
|
6951
|
+
let c = an(e), [l, u] = h(!1), d = m(null), f = m(null), p = bn(l, d, f), g = Z(r ?? /* @__PURE__ */ new Date(), n), [y, b] = h(g.year), [x, S] = h(g.month - 1);
|
|
6899
6952
|
jt(l, s(() => u(!1), []), [d]);
|
|
6900
6953
|
function C(e) {
|
|
6901
6954
|
i(e), u(!1);
|
|
@@ -6924,7 +6977,7 @@ function Zi({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
6924
6977
|
day: "numeric",
|
|
6925
6978
|
month: "short",
|
|
6926
6979
|
year: "numeric"
|
|
6927
|
-
}).format(r) :
|
|
6980
|
+
}).format(r) : na(r) : /* @__PURE__ */ _("span", {
|
|
6928
6981
|
className: "text-text-disabled",
|
|
6929
6982
|
children: a
|
|
6930
6983
|
})
|
|
@@ -6935,7 +6988,7 @@ function Zi({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
6935
6988
|
role: "dialog",
|
|
6936
6989
|
"aria-label": "Choose date",
|
|
6937
6990
|
className: G("bg-bg-tertiary border-border-strong animate-scale-in absolute left-0 z-[100] rounded-md border p-3 shadow-lg", p ? "bottom-full mb-1" : "top-full mt-1"),
|
|
6938
|
-
children: /* @__PURE__ */ _(
|
|
6991
|
+
children: /* @__PURE__ */ _(Ki, {
|
|
6939
6992
|
timeZone: n,
|
|
6940
6993
|
year: y,
|
|
6941
6994
|
month: x,
|
|
@@ -6952,7 +7005,7 @@ function Zi({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
6952
7005
|
}
|
|
6953
7006
|
//#endregion
|
|
6954
7007
|
//#region src/components/ui/DateRangePicker.tsx
|
|
6955
|
-
var
|
|
7008
|
+
var ia = [
|
|
6956
7009
|
"Jan",
|
|
6957
7010
|
"Feb",
|
|
6958
7011
|
"Mar",
|
|
@@ -6966,14 +7019,14 @@ var Qi = [
|
|
|
6966
7019
|
"Nov",
|
|
6967
7020
|
"Dec"
|
|
6968
7021
|
];
|
|
6969
|
-
function
|
|
6970
|
-
return `${
|
|
7022
|
+
function aa(e) {
|
|
7023
|
+
return `${ia[e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`;
|
|
6971
7024
|
}
|
|
6972
|
-
function
|
|
6973
|
-
return e.start && e.end ? `${
|
|
7025
|
+
function oa(e) {
|
|
7026
|
+
return e.start && e.end ? `${aa(e.start)} – ${aa(e.end)}` : e.start ? aa(e.start) : "";
|
|
6974
7027
|
}
|
|
6975
|
-
function
|
|
6976
|
-
let a = an(e), [o, c] = h(!1), l = m(null), u = m(null), d =
|
|
7028
|
+
function sa({ controlSize: e, label: t, value: n, onChange: r, placeholder: i = "Select date range..." }) {
|
|
7029
|
+
let a = an(e), [o, c] = h(!1), l = m(null), u = m(null), d = bn(o, l, u), f = /* @__PURE__ */ new Date(), [p, g] = h(n.start?.getFullYear() ?? f.getFullYear()), [y, b] = h(n.start?.getMonth() ?? f.getMonth()), [x, S] = h(null), [C, w] = h("start"), [E, D] = h(n.start), [O, k] = h(n.end);
|
|
6977
7030
|
jt(o, s(() => c(!1), []), [l]);
|
|
6978
7031
|
let A = y === 11 ? p + 1 : p, j = y === 11 ? 0 : y + 1;
|
|
6979
7032
|
function M() {
|
|
@@ -6991,7 +7044,7 @@ function ta({ controlSize: e, label: t, value: n, onChange: r, placeholder: i =
|
|
|
6991
7044
|
function F() {
|
|
6992
7045
|
y === 11 ? (g(p + 1), b(0)) : b(y + 1);
|
|
6993
7046
|
}
|
|
6994
|
-
let I = n.start || n.end ?
|
|
7047
|
+
let I = n.start || n.end ? oa(n) : "";
|
|
6995
7048
|
return /* @__PURE__ */ v("div", {
|
|
6996
7049
|
className: "flex flex-col gap-1.5",
|
|
6997
7050
|
ref: l,
|
|
@@ -7050,7 +7103,7 @@ function ta({ controlSize: e, label: t, value: n, onChange: r, placeholder: i =
|
|
|
7050
7103
|
]
|
|
7051
7104
|
}), /* @__PURE__ */ v("div", {
|
|
7052
7105
|
className: "flex gap-4",
|
|
7053
|
-
children: [/* @__PURE__ */ _(
|
|
7106
|
+
children: [/* @__PURE__ */ _(Ki, {
|
|
7054
7107
|
year: p,
|
|
7055
7108
|
month: y,
|
|
7056
7109
|
rangeStart: E,
|
|
@@ -7061,7 +7114,7 @@ function ta({ controlSize: e, label: t, value: n, onChange: r, placeholder: i =
|
|
|
7061
7114
|
g(e), b(t);
|
|
7062
7115
|
},
|
|
7063
7116
|
onHover: S
|
|
7064
|
-
}), /* @__PURE__ */ _(
|
|
7117
|
+
}), /* @__PURE__ */ _(Ki, {
|
|
7065
7118
|
year: A,
|
|
7066
7119
|
month: j,
|
|
7067
7120
|
rangeStart: E,
|
|
@@ -7081,7 +7134,7 @@ function ta({ controlSize: e, label: t, value: n, onChange: r, placeholder: i =
|
|
|
7081
7134
|
}
|
|
7082
7135
|
//#endregion
|
|
7083
7136
|
//#region src/components/ui/DateTimePicker.tsx
|
|
7084
|
-
var
|
|
7137
|
+
var ca = [
|
|
7085
7138
|
"Jan",
|
|
7086
7139
|
"Feb",
|
|
7087
7140
|
"Mar",
|
|
@@ -7095,7 +7148,7 @@ var na = [
|
|
|
7095
7148
|
"Nov",
|
|
7096
7149
|
"Dec"
|
|
7097
7150
|
];
|
|
7098
|
-
function
|
|
7151
|
+
function la(e) {
|
|
7099
7152
|
return e === 0 ? {
|
|
7100
7153
|
hour12: 12,
|
|
7101
7154
|
period: "AM"
|
|
@@ -7110,10 +7163,10 @@ function ra(e) {
|
|
|
7110
7163
|
period: "PM"
|
|
7111
7164
|
};
|
|
7112
7165
|
}
|
|
7113
|
-
function
|
|
7166
|
+
function ua(e, t) {
|
|
7114
7167
|
return t === "AM" ? e === 12 ? 0 : e : e === 12 ? 12 : e + 12;
|
|
7115
7168
|
}
|
|
7116
|
-
function
|
|
7169
|
+
function da(e, t) {
|
|
7117
7170
|
if (t) return new Intl.DateTimeFormat("en-GB", {
|
|
7118
7171
|
timeZone: t,
|
|
7119
7172
|
day: "numeric",
|
|
@@ -7124,20 +7177,20 @@ function aa(e, t) {
|
|
|
7124
7177
|
timeZoneName: "short",
|
|
7125
7178
|
hourCycle: "h23"
|
|
7126
7179
|
}).format(e);
|
|
7127
|
-
let n =
|
|
7180
|
+
let n = ca[e.getMonth()], r = e.getDate(), i = e.getFullYear(), { hour12: a, period: o } = la(e.getHours());
|
|
7128
7181
|
return `${n} ${r}, ${i} ${a}:${String(e.getMinutes()).padStart(2, "0")} ${o}`;
|
|
7129
7182
|
}
|
|
7130
|
-
function
|
|
7183
|
+
function fa(e) {
|
|
7131
7184
|
return String(e).padStart(2, "0");
|
|
7132
7185
|
}
|
|
7133
|
-
function
|
|
7134
|
-
return /* @__PURE__ */ _(
|
|
7186
|
+
function pa(e) {
|
|
7187
|
+
return /* @__PURE__ */ _(ma, { ...e }, e.timeZone ?? "browser-local");
|
|
7135
7188
|
}
|
|
7136
|
-
function
|
|
7137
|
-
let o = an(e), [c, l] = h(!1), [d, f] = h(null), [p, g] = h(!1), [y, b] = h("reject"), x = u(), S = m(null), C = m(null), w =
|
|
7189
|
+
function ma({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, placeholder: a = "Select date & time..." }) {
|
|
7190
|
+
let o = an(e), [c, l] = h(!1), [d, f] = h(null), [p, g] = h(!1), [y, b] = h("reject"), x = u(), S = m(null), C = m(null), w = bn(c, S, C), E = Z(r ?? /* @__PURE__ */ new Date(), n), D = r ? la(Z(r, n).hour) : {
|
|
7138
7191
|
hour12: 12,
|
|
7139
7192
|
period: "PM"
|
|
7140
|
-
}, [O, k] = h(E.year), [A, j] = h(E.month - 1), [M, N] = h(String(D.hour12)), [P, F] = h(r ?
|
|
7193
|
+
}, [O, k] = h(E.year), [A, j] = h(E.month - 1), [M, N] = h(String(D.hour12)), [P, F] = h(r ? fa(Z(r, n).minute) : "00"), [I, L] = h(D.period), [R, ee] = h(r);
|
|
7141
7194
|
jt(c, s(() => l(!1), []), [S]);
|
|
7142
7195
|
function te(e) {
|
|
7143
7196
|
ee(e);
|
|
@@ -7150,7 +7203,7 @@ function ca({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
7150
7203
|
}
|
|
7151
7204
|
function re() {
|
|
7152
7205
|
if (!R) return;
|
|
7153
|
-
let e = Math.max(1, Math.min(12, parseInt(M, 10) || 12)), t = Math.max(0, Math.min(59, parseInt(P, 10) || 0)), a =
|
|
7206
|
+
let e = Math.max(1, Math.min(12, parseInt(M, 10) || 12)), t = Math.max(0, Math.min(59, parseInt(P, 10) || 0)), a = ua(e, I), o = {
|
|
7154
7207
|
...Z(R, n),
|
|
7155
7208
|
hour: a,
|
|
7156
7209
|
minute: t,
|
|
@@ -7164,7 +7217,7 @@ function ca({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
7164
7217
|
"day",
|
|
7165
7218
|
"hour",
|
|
7166
7219
|
"minute"
|
|
7167
|
-
].every((e) => s[e] === o[e]) ? new Date(r) :
|
|
7220
|
+
].every((e) => s[e] === o[e]) ? new Date(r) : tr(o, n, y);
|
|
7168
7221
|
let e = Z(c, n);
|
|
7169
7222
|
if (e.hour !== a || e.minute !== t || e.day !== o.day) throw RangeError("This time does not exist in the selected timezone");
|
|
7170
7223
|
} catch (e) {
|
|
@@ -7177,13 +7230,13 @@ function ca({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
7177
7230
|
function z() {
|
|
7178
7231
|
if (!c && r) {
|
|
7179
7232
|
k(Z(r, n).year), j(Z(r, n).month - 1), ee(r);
|
|
7180
|
-
let e =
|
|
7181
|
-
N(String(e.hour12)), L(e.period), F(
|
|
7233
|
+
let e = la(Z(r, n).hour);
|
|
7234
|
+
N(String(e.hour12)), L(e.period), F(fa(Z(r, n).minute));
|
|
7182
7235
|
}
|
|
7183
7236
|
f(null);
|
|
7184
7237
|
let e = !1;
|
|
7185
7238
|
if (!c && r && n) try {
|
|
7186
|
-
|
|
7239
|
+
tr(Z(r, n), n, "reject");
|
|
7187
7240
|
} catch (t) {
|
|
7188
7241
|
e = t instanceof Error && t.message.includes("twice");
|
|
7189
7242
|
}
|
|
@@ -7205,7 +7258,7 @@ function ca({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
7205
7258
|
"aria-haspopup": "dialog",
|
|
7206
7259
|
"aria-expanded": c,
|
|
7207
7260
|
className: G("ui-sized-control flex h-7 w-full cursor-pointer items-center rounded-md text-xs", "bg-bg-secondary border-border text-text-primary border", "hover:bg-bg-hover hover:border-border-strong", "transition-colors duration-[100ms]", "px-2 pr-7"),
|
|
7208
|
-
children: r ?
|
|
7261
|
+
children: r ? da(r, n) : /* @__PURE__ */ _("span", {
|
|
7209
7262
|
className: "text-text-disabled",
|
|
7210
7263
|
children: a
|
|
7211
7264
|
})
|
|
@@ -7217,7 +7270,7 @@ function ca({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
7217
7270
|
"aria-label": "Choose date and time",
|
|
7218
7271
|
className: G("bg-bg-tertiary border-border-strong animate-scale-in absolute left-0 z-[100] rounded-md border p-3 shadow-lg", w ? "bottom-full mb-1" : "top-full mt-1"),
|
|
7219
7272
|
children: [
|
|
7220
|
-
/* @__PURE__ */ _(
|
|
7273
|
+
/* @__PURE__ */ _(Ki, {
|
|
7221
7274
|
timeZone: n,
|
|
7222
7275
|
year: O,
|
|
7223
7276
|
month: A,
|
|
@@ -7330,8 +7383,8 @@ function ca({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
7330
7383
|
}
|
|
7331
7384
|
//#endregion
|
|
7332
7385
|
//#region src/components/ui/DetailPanel.tsx
|
|
7333
|
-
var
|
|
7334
|
-
function
|
|
7386
|
+
var ha = 360, ga = 260, _a = 700;
|
|
7387
|
+
function va({ open: e, onClose: t, title: n, children: r, className: i, resizable: a = !0, defaultWidth: o = ha, minWidth: c = ga, maxWidth: u = _a }) {
|
|
7335
7388
|
let [d, f] = h(o), p = m(!1), g = m(0), y = m(0);
|
|
7336
7389
|
l(() => {
|
|
7337
7390
|
if (!e) return;
|
|
@@ -7382,26 +7435,32 @@ function fa({ open: e, onClose: t, title: n, children: r, className: i, resizabl
|
|
|
7382
7435
|
})
|
|
7383
7436
|
});
|
|
7384
7437
|
}
|
|
7385
|
-
function
|
|
7438
|
+
function ya(e, t) {
|
|
7439
|
+
let n = /^\s*(\d*\.?\d+)(px|rem)\s*$/.exec(e);
|
|
7440
|
+
if (!n) return 8;
|
|
7441
|
+
let r = Number(n[1]), i = n[2] === "rem" ? r * t : r;
|
|
7442
|
+
return Number.isFinite(i) && i >= 0 ? i * 2 : 8;
|
|
7443
|
+
}
|
|
7444
|
+
function ba(e, t, [n, r], [i, a], [o, s], c) {
|
|
7386
7445
|
let [l, u] = r - n <= s - o - c * 2 ? [n, r] : [i, a], d = t + (o + c - l), f = t + (s - c - u);
|
|
7387
7446
|
return f < d && (f = d), d = Math.min(d, 0), f = Math.max(f, 0), Math.min(f, Math.max(d, e));
|
|
7388
7447
|
}
|
|
7389
|
-
function
|
|
7448
|
+
function xa(e, t, n, r, i, a) {
|
|
7390
7449
|
return {
|
|
7391
|
-
x:
|
|
7392
|
-
y:
|
|
7450
|
+
x: ba(e.x, t.x, [n.left, n.right], [r.left, r.right], [i.left, i.right], a),
|
|
7451
|
+
y: ba(e.y, t.y, [n.top, n.bottom], [r.top, r.bottom], [i.top, i.bottom], a)
|
|
7393
7452
|
};
|
|
7394
7453
|
}
|
|
7395
|
-
function
|
|
7454
|
+
function Sa({ x: e, y: t }) {
|
|
7396
7455
|
return e === 0 && t === 0 ? "" : `${e}px ${t}px`;
|
|
7397
7456
|
}
|
|
7398
7457
|
//#endregion
|
|
7399
7458
|
//#region src/components/ui/Dialog.tsx
|
|
7400
|
-
var
|
|
7459
|
+
var Ca = "(min-width: 48rem)", wa = "a[href], button, input, select, textarea, label, summary, [contenteditable]:not([contenteditable=\"false\"]), [role=\"button\"], [role=\"link\"], [tabindex]:not([tabindex=\"-1\"])", Ta = {
|
|
7401
7460
|
x: 0,
|
|
7402
7461
|
y: 0
|
|
7403
7462
|
};
|
|
7404
|
-
function
|
|
7463
|
+
function Ea(e) {
|
|
7405
7464
|
let t = e.getBoundingClientRect();
|
|
7406
7465
|
return {
|
|
7407
7466
|
left: t.left,
|
|
@@ -7410,75 +7469,172 @@ function ya(e) {
|
|
|
7410
7469
|
bottom: t.top + e.clientHeight
|
|
7411
7470
|
};
|
|
7412
7471
|
}
|
|
7413
|
-
|
|
7414
|
-
|
|
7472
|
+
var Da = {
|
|
7473
|
+
top: "bottom",
|
|
7474
|
+
bottom: "top",
|
|
7475
|
+
left: "right",
|
|
7476
|
+
right: "left"
|
|
7477
|
+
};
|
|
7478
|
+
function Oa(e, t) {
|
|
7479
|
+
return {
|
|
7480
|
+
x: e.x + t.x,
|
|
7481
|
+
y: e.y + t.y
|
|
7482
|
+
};
|
|
7415
7483
|
}
|
|
7416
|
-
function
|
|
7417
|
-
let
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7484
|
+
function ka(e, t) {
|
|
7485
|
+
let n = t.getBoundingClientRect();
|
|
7486
|
+
return {
|
|
7487
|
+
left: n.left + e.offsetLeft - t.scrollLeft,
|
|
7488
|
+
top: n.top + e.offsetTop - t.scrollTop,
|
|
7489
|
+
width: e.offsetWidth,
|
|
7490
|
+
height: e.offsetHeight
|
|
7491
|
+
};
|
|
7492
|
+
}
|
|
7493
|
+
function Aa(e, t) {
|
|
7494
|
+
if (!(e instanceof HTMLElement) || !e.isConnected) return null;
|
|
7495
|
+
let n = e.ownerDocument;
|
|
7496
|
+
return e === n.body || e === n.documentElement || t.contains(e) ? null : e.getClientRects().length > 0 ? e : null;
|
|
7497
|
+
}
|
|
7498
|
+
function ja(e) {
|
|
7499
|
+
return e.ownerDocument.defaultView?.matchMedia(Ca).matches ?? !1;
|
|
7500
|
+
}
|
|
7501
|
+
function Ma(e) {
|
|
7502
|
+
let t = e.ownerDocument.defaultView;
|
|
7503
|
+
return t ? ya(t.getComputedStyle(e).getPropertyValue("--spacing"), parseFloat(t.getComputedStyle(e.ownerDocument.documentElement).fontSize)) : 8;
|
|
7504
|
+
}
|
|
7505
|
+
function Na({ open: e, draggable: t, remember: n, placement: r, anchorRef: i }, a, o) {
|
|
7506
|
+
let s = m(Ta), c = m(Ta), l = m(8), u = m(null), d = m(null), p = m(!1), h = e && t;
|
|
7507
|
+
f(() => {
|
|
7508
|
+
let f = a.current, m = h ? o.current : null, g = f?.parentElement, _ = f?.ownerDocument.defaultView, v = r !== "center";
|
|
7509
|
+
(!n || !t) && (d.current = null);
|
|
7510
|
+
let y = n && m !== null;
|
|
7511
|
+
if (!e || !f || !g || !_ || !m && !v) return;
|
|
7512
|
+
let b = v ? Aa(f.ownerDocument.activeElement, f) : null, x = () => v ? Aa(i?.current, f) ?? Aa(b, f) : null, S = () => Oa(c.current, m ? s.current : Ta), C = () => {
|
|
7513
|
+
f.style.translate = Sa(S());
|
|
7514
|
+
}, w = () => {
|
|
7515
|
+
let e = ka(f, g);
|
|
7516
|
+
if (p.current && d.current) {
|
|
7517
|
+
c.current = {
|
|
7518
|
+
x: d.current.left - e.left,
|
|
7519
|
+
y: d.current.top - e.top
|
|
7520
|
+
}, s.current = Ta, f.dataset.placement = "remembered", f.style.transformOrigin = "";
|
|
7426
7521
|
return;
|
|
7427
7522
|
}
|
|
7428
|
-
let
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7523
|
+
let t = ja(f) ? x() : null, n = v && t ? yn(r, t.getBoundingClientRect(), {
|
|
7524
|
+
size: {
|
|
7525
|
+
width: e.width,
|
|
7526
|
+
height: e.height
|
|
7527
|
+
},
|
|
7528
|
+
bounds: Ea(g),
|
|
7529
|
+
margin: l.current,
|
|
7530
|
+
gap: l.current
|
|
7531
|
+
}) : null;
|
|
7532
|
+
c.current = n ? {
|
|
7533
|
+
x: n.left - e.left,
|
|
7534
|
+
y: n.top - e.top
|
|
7535
|
+
} : Ta, f.dataset.placement = n?.side ?? "center", f.style.transformOrigin = n ? Da[n.side] : "";
|
|
7536
|
+
}, T = () => {
|
|
7537
|
+
let e = s.current;
|
|
7538
|
+
if (!m || !p.current && e.x === 0 && e.y === 0) return;
|
|
7539
|
+
let t = S(), n = xa(t, t, f.getBoundingClientRect(), m.getBoundingClientRect(), Ea(g), l.current);
|
|
7540
|
+
if (s.current = {
|
|
7541
|
+
x: n.x - c.current.x,
|
|
7542
|
+
y: n.y - c.current.y
|
|
7543
|
+
}, C(), p.current) {
|
|
7544
|
+
let e = ka(f, g);
|
|
7545
|
+
d.current = {
|
|
7546
|
+
left: e.left + n.x,
|
|
7547
|
+
top: e.top + n.y
|
|
7548
|
+
};
|
|
7549
|
+
}
|
|
7550
|
+
}, E = () => {
|
|
7551
|
+
l.current = Ma(f), ja(f) || (u.current = null, s.current = Ta, p.current = !1, d.current = null), u.current || w(), C(), T();
|
|
7552
|
+
}, D = 0, O = () => {
|
|
7553
|
+
D ||= _.requestAnimationFrame(() => {
|
|
7554
|
+
D = 0, E();
|
|
7555
|
+
});
|
|
7556
|
+
}, k = (e) => {
|
|
7557
|
+
e.target === f && T();
|
|
7558
|
+
}, A = "ResizeObserver" in _ ? new _.ResizeObserver(O) : null;
|
|
7559
|
+
return p.current = y && d.current !== null, E(), _.addEventListener("resize", O), _.addEventListener("scroll", O, {
|
|
7560
|
+
capture: !0,
|
|
7561
|
+
passive: !0
|
|
7562
|
+
}), f.addEventListener("animationend", k), A?.observe(f), () => {
|
|
7563
|
+
_.cancelAnimationFrame(D), _.removeEventListener("resize", O), _.removeEventListener("scroll", O, { capture: !0 }), f.removeEventListener("animationend", k), A?.disconnect(), u.current = null, c.current = Ta, s.current = Ta, p.current = !1, f.style.translate = "", f.style.transformOrigin = "", delete f.dataset.placement;
|
|
7433
7564
|
};
|
|
7434
7565
|
}, [
|
|
7435
7566
|
e,
|
|
7567
|
+
h,
|
|
7436
7568
|
t,
|
|
7437
|
-
n
|
|
7569
|
+
n,
|
|
7570
|
+
r,
|
|
7571
|
+
i,
|
|
7572
|
+
a,
|
|
7573
|
+
o
|
|
7438
7574
|
]);
|
|
7439
|
-
let
|
|
7440
|
-
let
|
|
7441
|
-
if (!
|
|
7442
|
-
let
|
|
7443
|
-
|
|
7575
|
+
let g = (e) => {
|
|
7576
|
+
let t = a.current, n = e.currentTarget, r = t?.parentElement;
|
|
7577
|
+
if (!t || !r || e.button !== 0 || !e.isPrimary) return;
|
|
7578
|
+
let i = e.target.closest(wa);
|
|
7579
|
+
i && n.contains(i) || !ja(t) || (e.preventDefault(), n.setPointerCapture(e.pointerId), u.current = {
|
|
7444
7580
|
pointerId: e.pointerId,
|
|
7445
7581
|
startX: e.clientX,
|
|
7446
7582
|
startY: e.clientY,
|
|
7447
|
-
origin:
|
|
7448
|
-
dialog:
|
|
7449
|
-
handle:
|
|
7450
|
-
bounds:
|
|
7583
|
+
origin: Oa(c.current, s.current),
|
|
7584
|
+
dialog: t.getBoundingClientRect(),
|
|
7585
|
+
handle: n.getBoundingClientRect(),
|
|
7586
|
+
bounds: Ea(r),
|
|
7587
|
+
margin: l.current,
|
|
7588
|
+
moved: !1
|
|
7451
7589
|
});
|
|
7452
|
-
},
|
|
7453
|
-
let
|
|
7454
|
-
if (!
|
|
7455
|
-
let
|
|
7456
|
-
x:
|
|
7457
|
-
y:
|
|
7458
|
-
},
|
|
7459
|
-
r.
|
|
7460
|
-
|
|
7461
|
-
|
|
7590
|
+
}, _ = (e) => {
|
|
7591
|
+
let t = u.current, n = a.current;
|
|
7592
|
+
if (!t || t.pointerId !== e.pointerId || !n) return;
|
|
7593
|
+
let r = xa({
|
|
7594
|
+
x: t.origin.x + e.clientX - t.startX,
|
|
7595
|
+
y: t.origin.y + e.clientY - t.startY
|
|
7596
|
+
}, t.origin, t.dialog, t.handle, t.bounds, t.margin);
|
|
7597
|
+
t.moved ||= r.x !== t.origin.x || r.y !== t.origin.y, s.current = {
|
|
7598
|
+
x: r.x - c.current.x,
|
|
7599
|
+
y: r.y - c.current.y
|
|
7600
|
+
}, n.style.translate = Sa(r);
|
|
7601
|
+
}, v = (e) => {
|
|
7602
|
+
let t = u.current;
|
|
7603
|
+
if (t?.pointerId !== e.pointerId) return;
|
|
7604
|
+
u.current = null;
|
|
7605
|
+
let r = a.current, i = r?.parentElement;
|
|
7606
|
+
if (!n || !t.moved || !r || !i) return;
|
|
7607
|
+
let o = Oa(c.current, s.current), l = ka(r, i);
|
|
7608
|
+
d.current = {
|
|
7609
|
+
left: l.left + o.x,
|
|
7610
|
+
top: l.top + o.y
|
|
7611
|
+
}, c.current = o, s.current = Ta, p.current = !0, r.dataset.placement = "remembered", r.style.transformOrigin = "";
|
|
7462
7612
|
};
|
|
7463
|
-
if (
|
|
7464
|
-
onPointerDown:
|
|
7465
|
-
onPointerMove:
|
|
7466
|
-
onPointerUp:
|
|
7467
|
-
onPointerCancel:
|
|
7468
|
-
onLostPointerCapture:
|
|
7613
|
+
if (h) return {
|
|
7614
|
+
onPointerDown: g,
|
|
7615
|
+
onPointerMove: _,
|
|
7616
|
+
onPointerUp: v,
|
|
7617
|
+
onPointerCancel: v,
|
|
7618
|
+
onLostPointerCapture: v
|
|
7469
7619
|
};
|
|
7470
7620
|
}
|
|
7471
|
-
function
|
|
7472
|
-
let
|
|
7473
|
-
ft(
|
|
7474
|
-
initialFocusRef:
|
|
7475
|
-
returnFocusRef:
|
|
7621
|
+
function Pa({ open: e, onClose: t, title: n, children: r, footer: i, className: a, draggable: o = !1, rememberPosition: s = !1, placement: c = "center", anchorRef: d, role: f = "dialog", description: p, "aria-label": h, "aria-describedby": g, initialFocusRef: y, returnFocusRef: b, busy: x = !1, closeOnEscape: S = !0, closeOnOverlayClick: C = !0, hideCloseButton: w = !1 }) {
|
|
7622
|
+
let T = an(), E = m(null), D = m(null), O = u(), k = u();
|
|
7623
|
+
ft(E, e, {
|
|
7624
|
+
initialFocusRef: y,
|
|
7625
|
+
returnFocusRef: b
|
|
7476
7626
|
});
|
|
7477
|
-
let
|
|
7627
|
+
let A = Na({
|
|
7628
|
+
open: e,
|
|
7629
|
+
draggable: o,
|
|
7630
|
+
remember: s,
|
|
7631
|
+
placement: c,
|
|
7632
|
+
anchorRef: d
|
|
7633
|
+
}, E, D);
|
|
7478
7634
|
return l(() => {
|
|
7479
7635
|
if (!e) return;
|
|
7480
7636
|
let n = (e) => {
|
|
7481
|
-
e.key === "Escape" &&
|
|
7637
|
+
e.key === "Escape" && S && !x && (e.preventDefault(), t());
|
|
7482
7638
|
};
|
|
7483
7639
|
document.addEventListener("keydown", n);
|
|
7484
7640
|
let r = document.body.style.overflow;
|
|
@@ -7488,60 +7644,69 @@ function Sa({ open: e, onClose: t, title: n, children: r, footer: i, className:
|
|
|
7488
7644
|
}, [
|
|
7489
7645
|
e,
|
|
7490
7646
|
t,
|
|
7491
|
-
|
|
7492
|
-
|
|
7647
|
+
S,
|
|
7648
|
+
x
|
|
7493
7649
|
]), e ? H(/* @__PURE__ */ v("div", {
|
|
7494
7650
|
className: "fixed inset-0 z-50 flex items-start justify-center overflow-y-auto pt-4 md:pt-[5vh]",
|
|
7495
7651
|
children: [/* @__PURE__ */ _("div", {
|
|
7496
7652
|
className: "bg-bg-overlay fixed inset-0",
|
|
7497
7653
|
onClick: () => {
|
|
7498
|
-
|
|
7654
|
+
C && !x && t();
|
|
7499
7655
|
},
|
|
7500
7656
|
"aria-hidden": "true"
|
|
7501
7657
|
}), /* @__PURE__ */ v("div", {
|
|
7502
|
-
ref:
|
|
7503
|
-
className: G("relative z-50 mx-
|
|
7504
|
-
role:
|
|
7658
|
+
ref: E,
|
|
7659
|
+
className: G("relative z-50 mx-1 mb-8 flex w-full max-w-[400px] flex-col", "bg-bg-secondary border-border rounded-lg border", "animate-scale-in shadow-lg", a),
|
|
7660
|
+
role: f,
|
|
7505
7661
|
tabIndex: -1,
|
|
7506
|
-
"aria-busy":
|
|
7662
|
+
"aria-busy": x || void 0,
|
|
7507
7663
|
"aria-modal": "true",
|
|
7508
|
-
"aria-labelledby": n ?
|
|
7509
|
-
"aria-label":
|
|
7510
|
-
"aria-describedby": [
|
|
7664
|
+
"aria-labelledby": n ? O : void 0,
|
|
7665
|
+
"aria-label": h ?? (n ? void 0 : "Dialog"),
|
|
7666
|
+
"aria-describedby": [p ? k : void 0, g].filter(Boolean).join(" ") || void 0,
|
|
7511
7667
|
children: [
|
|
7512
|
-
/* @__PURE__ */ v("div", {
|
|
7513
|
-
ref:
|
|
7514
|
-
|
|
7515
|
-
|
|
7668
|
+
(n || !w || o) && /* @__PURE__ */ v("div", {
|
|
7669
|
+
ref: D,
|
|
7670
|
+
"data-control-size": T,
|
|
7671
|
+
className: G("ui-bar border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2.5", o && "md:cursor-move md:touch-none md:select-none"),
|
|
7672
|
+
...A,
|
|
7516
7673
|
children: [n && /* @__PURE__ */ _("h3", {
|
|
7517
|
-
id:
|
|
7518
|
-
className: "text-text-primary text-sm font-
|
|
7674
|
+
id: O,
|
|
7675
|
+
className: "text-text-primary min-w-0 text-sm font-medium",
|
|
7519
7676
|
children: n
|
|
7520
|
-
}), !
|
|
7677
|
+
}), !w && /* @__PURE__ */ _(fn, {
|
|
7521
7678
|
type: "button",
|
|
7522
|
-
"
|
|
7679
|
+
variant: "icon",
|
|
7680
|
+
size: "sm",
|
|
7681
|
+
"aria-disabled": x || void 0,
|
|
7523
7682
|
onClick: () => {
|
|
7524
|
-
|
|
7683
|
+
x || t();
|
|
7525
7684
|
},
|
|
7526
|
-
className: "
|
|
7685
|
+
className: "ml-auto shrink-0",
|
|
7527
7686
|
"aria-label": "Close",
|
|
7528
7687
|
children: /* @__PURE__ */ _(V, { className: "h-4 w-4" })
|
|
7529
7688
|
})]
|
|
7530
7689
|
}),
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
|
|
7690
|
+
/* @__PURE__ */ v("div", {
|
|
7691
|
+
className: "p-3",
|
|
7692
|
+
children: [p && /* @__PURE__ */ _("div", {
|
|
7693
|
+
id: k,
|
|
7694
|
+
className: "text-text-secondary mb-3 text-xs",
|
|
7695
|
+
children: p
|
|
7696
|
+
}), r]
|
|
7535
7697
|
}),
|
|
7536
|
-
|
|
7537
|
-
|
|
7698
|
+
i && /* @__PURE__ */ _("div", {
|
|
7699
|
+
"data-control-size": T,
|
|
7700
|
+
className: "ui-bar border-border bg-bg-primary/50 flex shrink-0 flex-col justify-center rounded-b-lg border-t px-3 py-2.5",
|
|
7701
|
+
children: i
|
|
7702
|
+
})
|
|
7538
7703
|
]
|
|
7539
7704
|
})]
|
|
7540
7705
|
}), document.body) : null;
|
|
7541
7706
|
}
|
|
7542
7707
|
//#endregion
|
|
7543
7708
|
//#region src/components/ui/DialogActions.tsx
|
|
7544
|
-
function
|
|
7709
|
+
function Fa({ onCancel: e, onConfirm: t, cancelLabel: n = "Cancel", confirmLabel: r = "Confirm", confirmVariant: i = "primary", className: a, busy: o = !1, busyLabel: s = "Working…", cancelRef: c, confirmRef: l, confirmDisabled: u = !1 }) {
|
|
7545
7710
|
return /* @__PURE__ */ v("div", {
|
|
7546
7711
|
className: G("flex justify-end gap-2", a),
|
|
7547
7712
|
"aria-busy": o || void 0,
|
|
@@ -7570,7 +7735,7 @@ function Ca({ onCancel: e, onConfirm: t, cancelLabel: n = "Cancel", confirmLabel
|
|
|
7570
7735
|
}
|
|
7571
7736
|
//#endregion
|
|
7572
7737
|
//#region src/components/ui/DividerLabel.tsx
|
|
7573
|
-
function
|
|
7738
|
+
function Ia({ children: e, className: t }) {
|
|
7574
7739
|
return /* @__PURE__ */ v("div", {
|
|
7575
7740
|
className: G("my-6 flex items-center gap-3", t),
|
|
7576
7741
|
children: [
|
|
@@ -7585,7 +7750,7 @@ function wa({ children: e, className: t }) {
|
|
|
7585
7750
|
}
|
|
7586
7751
|
//#endregion
|
|
7587
7752
|
//#region src/components/ui/DropdownMenu.tsx
|
|
7588
|
-
function
|
|
7753
|
+
function La({ trigger: e, items: t, align: n = "right" }) {
|
|
7589
7754
|
let [r, i] = h(!1), [a, o] = h({
|
|
7590
7755
|
top: 0,
|
|
7591
7756
|
left: 0,
|
|
@@ -7666,7 +7831,7 @@ function Ta({ trigger: e, items: t, align: n = "right" }) {
|
|
|
7666
7831
|
}
|
|
7667
7832
|
//#endregion
|
|
7668
7833
|
//#region src/components/ui/EmptyState.tsx
|
|
7669
|
-
function
|
|
7834
|
+
function Ra({ icon: e, title: t, description: n, action: r, className: i }) {
|
|
7670
7835
|
return /* @__PURE__ */ v("div", {
|
|
7671
7836
|
className: G("flex flex-col items-center justify-center px-4 py-12", i),
|
|
7672
7837
|
children: [
|
|
@@ -7691,7 +7856,7 @@ function Ea({ icon: e, title: t, description: n, action: r, className: i }) {
|
|
|
7691
7856
|
}
|
|
7692
7857
|
//#endregion
|
|
7693
7858
|
//#region src/components/ui/ErrorBoundary.tsx
|
|
7694
|
-
var
|
|
7859
|
+
var za = class extends e {
|
|
7695
7860
|
state = {
|
|
7696
7861
|
hasError: !1,
|
|
7697
7862
|
error: null
|
|
@@ -7733,10 +7898,10 @@ var Da = class extends e {
|
|
|
7733
7898
|
};
|
|
7734
7899
|
//#endregion
|
|
7735
7900
|
//#region src/components/ui/FilterDropdown.tsx
|
|
7736
|
-
function
|
|
7737
|
-
return /* @__PURE__ */ _(
|
|
7901
|
+
function Ba({ icon: e, children: t, items: n, align: r, className: i }) {
|
|
7902
|
+
return /* @__PURE__ */ _(La, {
|
|
7738
7903
|
align: r,
|
|
7739
|
-
trigger: /* @__PURE__ */ _(
|
|
7904
|
+
trigger: /* @__PURE__ */ _(Bn, {
|
|
7740
7905
|
icon: e,
|
|
7741
7906
|
className: i,
|
|
7742
7907
|
children: t
|
|
@@ -7746,7 +7911,7 @@ function Oa({ icon: e, children: t, items: n, align: r, className: i }) {
|
|
|
7746
7911
|
}
|
|
7747
7912
|
//#endregion
|
|
7748
7913
|
//#region src/components/ui/Kbd.tsx
|
|
7749
|
-
function
|
|
7914
|
+
function Va({ children: e, className: t }) {
|
|
7750
7915
|
return /* @__PURE__ */ _("kbd", {
|
|
7751
7916
|
className: G("text-2xs inline-flex items-center px-1.5 py-0.5 font-mono font-medium", "bg-bg-tertiary text-text-secondary border-border rounded border", t),
|
|
7752
7917
|
children: e
|
|
@@ -7754,20 +7919,20 @@ function ka({ children: e, className: t }) {
|
|
|
7754
7919
|
}
|
|
7755
7920
|
//#endregion
|
|
7756
7921
|
//#region src/components/ui/LoadingSpinner.tsx
|
|
7757
|
-
var
|
|
7922
|
+
var Ha = {
|
|
7758
7923
|
sm: "w-4 h-4",
|
|
7759
7924
|
md: "w-6 h-6",
|
|
7760
7925
|
lg: "w-8 h-8"
|
|
7761
7926
|
};
|
|
7762
|
-
function
|
|
7927
|
+
function Ua({ className: e, size: t = "md" }) {
|
|
7763
7928
|
return /* @__PURE__ */ _("div", {
|
|
7764
7929
|
className: G("flex min-h-[200px] items-center justify-center", e),
|
|
7765
|
-
children: /* @__PURE__ */ _(L, { className: G("text-accent animate-spin",
|
|
7930
|
+
children: /* @__PURE__ */ _(L, { className: G("text-accent animate-spin", Ha[t]) })
|
|
7766
7931
|
});
|
|
7767
7932
|
}
|
|
7768
7933
|
//#endregion
|
|
7769
7934
|
//#region src/components/ui/MetadataGrid.tsx
|
|
7770
|
-
function
|
|
7935
|
+
function Wa({ items: e, labelWidth: n = "100px", className: r }) {
|
|
7771
7936
|
return /* @__PURE__ */ _("div", {
|
|
7772
7937
|
className: G("gap-x-3 gap-y-2 text-xs", r),
|
|
7773
7938
|
style: {
|
|
@@ -7785,7 +7950,7 @@ function Ma({ items: e, labelWidth: n = "100px", className: r }) {
|
|
|
7785
7950
|
}
|
|
7786
7951
|
//#endregion
|
|
7787
7952
|
//#region src/components/ui/MetricCard.tsx
|
|
7788
|
-
function
|
|
7953
|
+
function Ga({ label: e, value: t, sub: n, trend: r, bar: i, icon: a, iconColor: o, className: s }) {
|
|
7789
7954
|
let c = r?.tone === "positive" ? "text-green" : r?.tone === "negative" ? "text-red" : "text-text-tertiary";
|
|
7790
7955
|
return /* @__PURE__ */ v("div", {
|
|
7791
7956
|
className: G("bg-bg-secondary border-border relative overflow-hidden rounded-md border p-3", s),
|
|
@@ -7825,7 +7990,7 @@ function Na({ label: e, value: t, sub: n, trend: r, bar: i, icon: a, iconColor:
|
|
|
7825
7990
|
}
|
|
7826
7991
|
//#endregion
|
|
7827
7992
|
//#region src/components/ui/OAuthButton.tsx
|
|
7828
|
-
function
|
|
7993
|
+
function Ka() {
|
|
7829
7994
|
return /* @__PURE__ */ v("svg", {
|
|
7830
7995
|
className: "h-3.5 w-3.5",
|
|
7831
7996
|
viewBox: "0 0 24 24",
|
|
@@ -7850,7 +8015,7 @@ function Pa() {
|
|
|
7850
8015
|
]
|
|
7851
8016
|
});
|
|
7852
8017
|
}
|
|
7853
|
-
function
|
|
8018
|
+
function qa() {
|
|
7854
8019
|
return /* @__PURE__ */ _("svg", {
|
|
7855
8020
|
className: "h-3.5 w-3.5",
|
|
7856
8021
|
viewBox: "0 0 24 24",
|
|
@@ -7859,25 +8024,25 @@ function Fa() {
|
|
|
7859
8024
|
children: /* @__PURE__ */ _("path", { d: "M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" })
|
|
7860
8025
|
});
|
|
7861
8026
|
}
|
|
7862
|
-
var
|
|
8027
|
+
var Ja = {
|
|
7863
8028
|
github: "GitHub",
|
|
7864
8029
|
google: "Google"
|
|
7865
|
-
},
|
|
7866
|
-
github:
|
|
7867
|
-
google:
|
|
8030
|
+
}, Ya = {
|
|
8031
|
+
github: qa,
|
|
8032
|
+
google: Ka
|
|
7868
8033
|
};
|
|
7869
|
-
function
|
|
7870
|
-
let r =
|
|
8034
|
+
function Xa({ provider: e, children: t, ...n }) {
|
|
8035
|
+
let r = Ya[e];
|
|
7871
8036
|
return /* @__PURE__ */ v(fn, {
|
|
7872
8037
|
variant: "secondary",
|
|
7873
8038
|
size: "md",
|
|
7874
8039
|
...n,
|
|
7875
|
-
children: [/* @__PURE__ */ _(r, {}), t ??
|
|
8040
|
+
children: [/* @__PURE__ */ _(r, {}), t ?? Ja[e]]
|
|
7876
8041
|
});
|
|
7877
8042
|
}
|
|
7878
8043
|
//#endregion
|
|
7879
8044
|
//#region src/components/ui/PageHeader.tsx
|
|
7880
|
-
function
|
|
8045
|
+
function Za({ title: e, subtitle: t, actions: n, className: r, eyebrow: i, headingLevel: a = 1, wrap: o = !1 }) {
|
|
7881
8046
|
let s = `h${a}`;
|
|
7882
8047
|
return /* @__PURE__ */ v("div", {
|
|
7883
8048
|
className: G("flex items-center justify-between gap-3", o && "flex-wrap", r),
|
|
@@ -7905,7 +8070,7 @@ function za({ title: e, subtitle: t, actions: n, className: r, eyebrow: i, headi
|
|
|
7905
8070
|
}
|
|
7906
8071
|
//#endregion
|
|
7907
8072
|
//#region src/components/ui/PageSection.tsx
|
|
7908
|
-
function
|
|
8073
|
+
function Qa({ title: e, description: t, actions: n, children: r, as: i = "h2", className: a, headerClassName: o, contentClassName: s }) {
|
|
7909
8074
|
return /* @__PURE__ */ v("section", {
|
|
7910
8075
|
className: G("space-y-4", a),
|
|
7911
8076
|
children: [(e || t || n) && /* @__PURE__ */ v("div", {
|
|
@@ -7931,7 +8096,7 @@ function Ba({ title: e, description: t, actions: n, children: r, as: i = "h2", c
|
|
|
7931
8096
|
}
|
|
7932
8097
|
//#endregion
|
|
7933
8098
|
//#region src/components/ui/PaginationBar.tsx
|
|
7934
|
-
var
|
|
8099
|
+
var $a = [
|
|
7935
8100
|
{
|
|
7936
8101
|
value: "10",
|
|
7937
8102
|
label: "10 per page"
|
|
@@ -7945,13 +8110,13 @@ var Va = [
|
|
|
7945
8110
|
label: "50 per page"
|
|
7946
8111
|
}
|
|
7947
8112
|
];
|
|
7948
|
-
function
|
|
8113
|
+
function eo({ page: e, pageSize: t, total: n, pageSizeOptions: r = $a, onPageChange: i, onPageSizeChange: a, className: o }) {
|
|
7949
8114
|
let s = Math.ceil(n / t), c = Math.min((e - 1) * t + 1, n), l = Math.min(e * t, n);
|
|
7950
8115
|
return /* @__PURE__ */ v("div", {
|
|
7951
8116
|
className: G("flex items-center justify-between", o),
|
|
7952
8117
|
children: [/* @__PURE__ */ v("div", {
|
|
7953
8118
|
className: "flex items-center gap-3",
|
|
7954
|
-
children: [/* @__PURE__ */ _(
|
|
8119
|
+
children: [/* @__PURE__ */ _(xn, {
|
|
7955
8120
|
size: "sm",
|
|
7956
8121
|
value: String(t),
|
|
7957
8122
|
onChange: (e) => a(Number(e)),
|
|
@@ -7967,7 +8132,7 @@ function Ha({ page: e, pageSize: t, total: n, pageSizeOptions: r = Va, onPageCha
|
|
|
7967
8132
|
n
|
|
7968
8133
|
]
|
|
7969
8134
|
})]
|
|
7970
|
-
}), /* @__PURE__ */ _(
|
|
8135
|
+
}), /* @__PURE__ */ _(Un, {
|
|
7971
8136
|
page: e,
|
|
7972
8137
|
totalPages: s,
|
|
7973
8138
|
onPageChange: i
|
|
@@ -7976,21 +8141,21 @@ function Ha({ page: e, pageSize: t, total: n, pageSizeOptions: r = Va, onPageCha
|
|
|
7976
8141
|
}
|
|
7977
8142
|
//#endregion
|
|
7978
8143
|
//#region src/components/ui/useFieldControl.ts
|
|
7979
|
-
function
|
|
7980
|
-
let o = u(), s = c(
|
|
8144
|
+
function to({ id: e, error: t, hint: n, describedBy: r, invalid: i, required: a }) {
|
|
8145
|
+
let o = u(), s = c(Ln), l = e ?? s?.id ?? o, d = t ? `${l}-error` : void 0, f = n ? `${l}-hint` : void 0;
|
|
7981
8146
|
return {
|
|
7982
8147
|
inputId: l,
|
|
7983
8148
|
errorId: d,
|
|
7984
8149
|
hintId: f,
|
|
7985
|
-
describedBy:
|
|
8150
|
+
describedBy: Rn(r, s?.describedBy, f, d),
|
|
7986
8151
|
invalid: i ?? (!!t || s?.invalid || void 0),
|
|
7987
8152
|
required: a ?? s?.required
|
|
7988
8153
|
};
|
|
7989
8154
|
}
|
|
7990
8155
|
//#endregion
|
|
7991
8156
|
//#region src/components/ui/PasswordInput.tsx
|
|
7992
|
-
var
|
|
7993
|
-
let d =
|
|
8157
|
+
var no = a(({ label: e, error: t, className: n, id: r, hint: i, controlSize: a, required: o, "aria-describedby": s, "aria-invalid": c, ...l }, u) => {
|
|
8158
|
+
let d = to({
|
|
7994
8159
|
id: r,
|
|
7995
8160
|
error: t,
|
|
7996
8161
|
hint: i,
|
|
@@ -8042,8 +8207,8 @@ var Wa = a(({ label: e, error: t, className: n, id: r, hint: i, controlSize: a,
|
|
|
8042
8207
|
]
|
|
8043
8208
|
});
|
|
8044
8209
|
});
|
|
8045
|
-
|
|
8046
|
-
var
|
|
8210
|
+
no.displayName = "PasswordInput";
|
|
8211
|
+
var ro = Object.freeze([
|
|
8047
8212
|
{
|
|
8048
8213
|
label: "At least 8 characters",
|
|
8049
8214
|
test: (e) => e.length >= 8
|
|
@@ -8061,12 +8226,12 @@ var Ga = Object.freeze([
|
|
|
8061
8226
|
test: (e) => /\d/.test(e)
|
|
8062
8227
|
}
|
|
8063
8228
|
]);
|
|
8064
|
-
function
|
|
8229
|
+
function io(e, t = ro) {
|
|
8065
8230
|
return t.every((t) => t.test(e));
|
|
8066
8231
|
}
|
|
8067
8232
|
//#endregion
|
|
8068
8233
|
//#region src/components/ui/PasswordRequirements.tsx
|
|
8069
|
-
function
|
|
8234
|
+
function ao({ password: e, requirements: t = ro, showWhenEmpty: n = !1, className: r }) {
|
|
8070
8235
|
return !n && e.length === 0 ? null : /* @__PURE__ */ _("ul", {
|
|
8071
8236
|
"aria-label": "Password requirements",
|
|
8072
8237
|
className: G("space-y-1", r),
|
|
@@ -8093,7 +8258,7 @@ function qa({ password: e, requirements: t = Ga, showWhenEmpty: n = !1, classNam
|
|
|
8093
8258
|
}
|
|
8094
8259
|
//#endregion
|
|
8095
8260
|
//#region src/components/ui/ProfileHeader.tsx
|
|
8096
|
-
function
|
|
8261
|
+
function oo({ name: e, subtitle: t, badge: n, meta: r, action: i, className: a }) {
|
|
8097
8262
|
return /* @__PURE__ */ v("div", {
|
|
8098
8263
|
className: G("flex items-start gap-4", a),
|
|
8099
8264
|
children: [
|
|
@@ -8141,7 +8306,7 @@ function Ja({ name: e, subtitle: t, badge: n, meta: r, action: i, className: a }
|
|
|
8141
8306
|
}
|
|
8142
8307
|
//#endregion
|
|
8143
8308
|
//#region src/components/ui/ProseContent.tsx
|
|
8144
|
-
function
|
|
8309
|
+
function so({ children: e, className: t }) {
|
|
8145
8310
|
return /* @__PURE__ */ _("div", {
|
|
8146
8311
|
className: G("ui-prose", t),
|
|
8147
8312
|
children: e
|
|
@@ -8149,21 +8314,21 @@ function Ya({ children: e, className: t }) {
|
|
|
8149
8314
|
}
|
|
8150
8315
|
//#endregion
|
|
8151
8316
|
//#region src/lib/qrCode.ts
|
|
8152
|
-
var
|
|
8317
|
+
var co = class extends RangeError {
|
|
8153
8318
|
constructor() {
|
|
8154
8319
|
super("Text is too long to encode as a QR code"), this.name = "QrCapacityError";
|
|
8155
8320
|
}
|
|
8156
|
-
},
|
|
8321
|
+
}, lo = {
|
|
8157
8322
|
L: 0,
|
|
8158
8323
|
M: 1,
|
|
8159
8324
|
Q: 2,
|
|
8160
8325
|
H: 3
|
|
8161
|
-
},
|
|
8326
|
+
}, uo = {
|
|
8162
8327
|
L: 1,
|
|
8163
8328
|
M: 0,
|
|
8164
8329
|
Q: 3,
|
|
8165
8330
|
H: 2
|
|
8166
|
-
},
|
|
8331
|
+
}, fo = [
|
|
8167
8332
|
[
|
|
8168
8333
|
-1,
|
|
8169
8334
|
7,
|
|
@@ -8336,7 +8501,7 @@ var Xa = class extends RangeError {
|
|
|
8336
8501
|
30,
|
|
8337
8502
|
30
|
|
8338
8503
|
]
|
|
8339
|
-
],
|
|
8504
|
+
], po = [
|
|
8340
8505
|
[
|
|
8341
8506
|
-1,
|
|
8342
8507
|
1,
|
|
@@ -8510,7 +8675,7 @@ var Xa = class extends RangeError {
|
|
|
8510
8675
|
81
|
|
8511
8676
|
]
|
|
8512
8677
|
];
|
|
8513
|
-
function
|
|
8678
|
+
function mo(e) {
|
|
8514
8679
|
let t = (16 * e + 128) * e + 64;
|
|
8515
8680
|
if (e >= 2) {
|
|
8516
8681
|
let n = Math.floor(e / 7) + 2;
|
|
@@ -8518,43 +8683,43 @@ function to(e) {
|
|
|
8518
8683
|
}
|
|
8519
8684
|
return t;
|
|
8520
8685
|
}
|
|
8521
|
-
function
|
|
8522
|
-
let n =
|
|
8523
|
-
return Math.floor(
|
|
8686
|
+
function ho(e, t) {
|
|
8687
|
+
let n = lo[t];
|
|
8688
|
+
return Math.floor(mo(e) / 8) - fo[n][e] * po[n][e];
|
|
8524
8689
|
}
|
|
8525
|
-
function
|
|
8690
|
+
function go(e) {
|
|
8526
8691
|
if (e === 1) return [];
|
|
8527
8692
|
let t = Math.floor(e / 7) + 2, n = Math.floor((e * 8 + t * 3 + 5) / (t * 4 - 4)) * 2, r = [6];
|
|
8528
8693
|
for (let i = e * 4 + 17 - 7; r.length < t; i -= n) r.splice(1, 0, i);
|
|
8529
8694
|
return r;
|
|
8530
8695
|
}
|
|
8531
|
-
function
|
|
8696
|
+
function _o(e, t) {
|
|
8532
8697
|
let n = 0;
|
|
8533
8698
|
for (let r = 7; r >= 0; r--) n = n << 1 ^ (n >>> 7) * 285, n ^= (t >>> r & 1) * e;
|
|
8534
8699
|
return n;
|
|
8535
8700
|
}
|
|
8536
|
-
function
|
|
8701
|
+
function vo(e) {
|
|
8537
8702
|
let t = Array(e).fill(0);
|
|
8538
8703
|
t[e - 1] = 1;
|
|
8539
8704
|
let n = 1;
|
|
8540
8705
|
for (let r = 0; r < e; r++) {
|
|
8541
|
-
for (let e = 0; e < t.length; e++) t[e] =
|
|
8542
|
-
n =
|
|
8706
|
+
for (let e = 0; e < t.length; e++) t[e] = _o(t[e], n), e + 1 < t.length && (t[e] ^= t[e + 1]);
|
|
8707
|
+
n = _o(n, 2);
|
|
8543
8708
|
}
|
|
8544
8709
|
return t;
|
|
8545
8710
|
}
|
|
8546
|
-
function
|
|
8711
|
+
function yo(e, t) {
|
|
8547
8712
|
let n = Array(t.length).fill(0);
|
|
8548
8713
|
for (let r of e) {
|
|
8549
8714
|
let e = r ^ n.shift();
|
|
8550
8715
|
n.push(0), t.forEach((t, r) => {
|
|
8551
|
-
n[r] ^=
|
|
8716
|
+
n[r] ^= _o(t, e);
|
|
8552
8717
|
});
|
|
8553
8718
|
}
|
|
8554
8719
|
return n;
|
|
8555
8720
|
}
|
|
8556
|
-
function
|
|
8557
|
-
let r =
|
|
8721
|
+
function bo(e, t, n) {
|
|
8722
|
+
let r = ho(t, n) * 8, i = [], a = (e, t) => {
|
|
8558
8723
|
for (let n = t - 1; n >= 0; n--) i.push(e >>> n & 1);
|
|
8559
8724
|
};
|
|
8560
8725
|
a(4, 4), a(e.length, t <= 9 ? 8 : 16);
|
|
@@ -8565,12 +8730,12 @@ function so(e, t, n) {
|
|
|
8565
8730
|
for (let e = 0; e < i.length; e += 8) o.push(i.slice(e, e + 8).reduce((e, t) => e << 1 | t));
|
|
8566
8731
|
return o;
|
|
8567
8732
|
}
|
|
8568
|
-
function
|
|
8569
|
-
let r =
|
|
8733
|
+
function xo(e, t, n) {
|
|
8734
|
+
let r = lo[n], i = po[r][t], a = fo[r][t], o = Math.floor(mo(t) / 8), s = i - o % i, c = Math.floor(o / i), l = vo(a), u = [];
|
|
8570
8735
|
for (let t = 0, n = 0; t < i; t++) {
|
|
8571
8736
|
let r = c - a + (t < s ? 0 : 1), i = e.slice(n, n + r);
|
|
8572
8737
|
n += r;
|
|
8573
|
-
let o =
|
|
8738
|
+
let o = yo(i, l);
|
|
8574
8739
|
t < s && i.push(0), u.push(i.concat(o));
|
|
8575
8740
|
}
|
|
8576
8741
|
let d = [];
|
|
@@ -8579,7 +8744,7 @@ function co(e, t, n) {
|
|
|
8579
8744
|
});
|
|
8580
8745
|
return d;
|
|
8581
8746
|
}
|
|
8582
|
-
var
|
|
8747
|
+
var So = class {
|
|
8583
8748
|
size;
|
|
8584
8749
|
modules;
|
|
8585
8750
|
isFunction;
|
|
@@ -8590,7 +8755,7 @@ var lo = class {
|
|
|
8590
8755
|
this.modules[t][e] = n, this.isFunction[t][e] = !0;
|
|
8591
8756
|
}
|
|
8592
8757
|
};
|
|
8593
|
-
function
|
|
8758
|
+
function Co(e, t) {
|
|
8594
8759
|
let { size: n } = e;
|
|
8595
8760
|
for (let t = 0; t < n; t++) e.setFunction(6, t, t % 2 == 0), e.setFunction(t, 6, t % 2 == 0);
|
|
8596
8761
|
for (let [t, r] of [
|
|
@@ -8603,15 +8768,15 @@ function uo(e, t) {
|
|
|
8603
8768
|
let c = Math.max(Math.abs(a), Math.abs(i));
|
|
8604
8769
|
e.setFunction(o, s, c !== 2 && c !== 4);
|
|
8605
8770
|
}
|
|
8606
|
-
let r =
|
|
8771
|
+
let r = go(t), i = r.length - 1;
|
|
8607
8772
|
r.forEach((t, n) => {
|
|
8608
8773
|
r.forEach((r, a) => {
|
|
8609
8774
|
if (!(n === 0 && a === 0 || n === 0 && a === i || n === i && a === 0)) for (let n = -2; n <= 2; n++) for (let i = -2; i <= 2; i++) e.setFunction(t + i, r + n, Math.max(Math.abs(i), Math.abs(n)) !== 1);
|
|
8610
8775
|
});
|
|
8611
|
-
}),
|
|
8776
|
+
}), wo(e, "M", 0), To(e, t);
|
|
8612
8777
|
}
|
|
8613
|
-
function
|
|
8614
|
-
let r =
|
|
8778
|
+
function wo(e, t, n) {
|
|
8779
|
+
let r = uo[t] << 3 | n, i = r;
|
|
8615
8780
|
for (let e = 0; e < 10; e++) i = i << 1 ^ (i >>> 9) * 1335;
|
|
8616
8781
|
let a = (r << 10 | i) ^ 21522, o = (e) => (a >>> e & 1) != 0, { size: s } = e;
|
|
8617
8782
|
for (let t = 0; t <= 5; t++) e.setFunction(8, t, o(t));
|
|
@@ -8621,7 +8786,7 @@ function fo(e, t, n) {
|
|
|
8621
8786
|
for (let t = 8; t < 15; t++) e.setFunction(8, s - 15 + t, o(t));
|
|
8622
8787
|
e.setFunction(8, s - 8, !0);
|
|
8623
8788
|
}
|
|
8624
|
-
function
|
|
8789
|
+
function To(e, t) {
|
|
8625
8790
|
if (t < 7) return;
|
|
8626
8791
|
let n = t;
|
|
8627
8792
|
for (let e = 0; e < 12; e++) n = n << 1 ^ (n >>> 11) * 7973;
|
|
@@ -8631,7 +8796,7 @@ function po(e, t) {
|
|
|
8631
8796
|
e.setFunction(i, a, n), e.setFunction(a, i, n);
|
|
8632
8797
|
}
|
|
8633
8798
|
}
|
|
8634
|
-
function
|
|
8799
|
+
function Eo(e, t) {
|
|
8635
8800
|
let { size: n } = e, r = 0;
|
|
8636
8801
|
for (let i = n - 1; i >= 1; i -= 2) {
|
|
8637
8802
|
i === 6 && (i = 5);
|
|
@@ -8645,7 +8810,7 @@ function mo(e, t) {
|
|
|
8645
8810
|
}
|
|
8646
8811
|
}
|
|
8647
8812
|
}
|
|
8648
|
-
var
|
|
8813
|
+
var Do = [
|
|
8649
8814
|
(e, t) => (e + t) % 2 == 0,
|
|
8650
8815
|
(e, t) => t % 2 == 0,
|
|
8651
8816
|
(e) => e % 3 == 0,
|
|
@@ -8655,10 +8820,10 @@ var ho = [
|
|
|
8655
8820
|
(e, t) => (e * t % 2 + e * t % 3) % 2 == 0,
|
|
8656
8821
|
(e, t) => ((e + t) % 2 + e * t % 3) % 2 == 0
|
|
8657
8822
|
];
|
|
8658
|
-
function
|
|
8659
|
-
for (let n = 0; n < e.size; n++) for (let r = 0; r < e.size; r++) !e.isFunction[n][r] &&
|
|
8823
|
+
function Oo(e, t) {
|
|
8824
|
+
for (let n = 0; n < e.size; n++) for (let r = 0; r < e.size; r++) !e.isFunction[n][r] && Do[t](r, n) && (e.modules[n][r] = !e.modules[n][r]);
|
|
8660
8825
|
}
|
|
8661
|
-
var
|
|
8826
|
+
var ko = [[
|
|
8662
8827
|
!0,
|
|
8663
8828
|
!1,
|
|
8664
8829
|
!0,
|
|
@@ -8683,12 +8848,12 @@ var _o = [[
|
|
|
8683
8848
|
!1,
|
|
8684
8849
|
!0
|
|
8685
8850
|
]];
|
|
8686
|
-
function
|
|
8851
|
+
function Ao(e) {
|
|
8687
8852
|
let t = e.length, n = (t, n, r) => r ? e[t][n] : e[n][t], r = 0;
|
|
8688
8853
|
for (let e of [!1, !0]) for (let i = 0; i < t; i++) {
|
|
8689
8854
|
let a = 1;
|
|
8690
8855
|
for (let o = 1; o <= t; o++) o < t && n(o, i, e) === n(o - 1, i, e) ? a++ : (a >= 5 && (r += 3 + (a - 5)), a = 1);
|
|
8691
|
-
for (let a = 0; a + 11 <= t; a++) for (let t of
|
|
8856
|
+
for (let a = 0; a + 11 <= t; a++) for (let t of ko) t.every((t, r) => n(a + r, i, e) === t) && (r += 40);
|
|
8692
8857
|
}
|
|
8693
8858
|
for (let n = 0; n < t - 1; n++) for (let i = 0; i < t - 1; i++) {
|
|
8694
8859
|
let t = e[n][i];
|
|
@@ -8697,20 +8862,20 @@ function vo(e) {
|
|
|
8697
8862
|
let i = e.reduce((e, t) => e + t.filter(Boolean).length, 0) * 100 / (t * t);
|
|
8698
8863
|
return r += Math.floor(Math.abs(i - 50) / 5) * 10, r;
|
|
8699
8864
|
}
|
|
8700
|
-
function
|
|
8701
|
-
if (!Object.hasOwn(
|
|
8865
|
+
function jo(e, t = "M") {
|
|
8866
|
+
if (!Object.hasOwn(lo, t)) throw RangeError(`Invalid QR error correction level "${t}"; expected L, M, Q or H`);
|
|
8702
8867
|
let n = new TextEncoder().encode(e), r = 1;
|
|
8703
|
-
for (; r <= 40 && !(4 + (r <= 9 ? 8 : 16) + n.length * 8 <=
|
|
8704
|
-
if (r > 40) throw new
|
|
8705
|
-
let i =
|
|
8706
|
-
|
|
8868
|
+
for (; r <= 40 && !(4 + (r <= 9 ? 8 : 16) + n.length * 8 <= ho(r, t) * 8); r++);
|
|
8869
|
+
if (r > 40) throw new co();
|
|
8870
|
+
let i = xo(bo(n, r, t), r, t), a = new So(r * 4 + 17);
|
|
8871
|
+
Co(a, r), Eo(a, i);
|
|
8707
8872
|
let o = 0, s = Infinity;
|
|
8708
8873
|
for (let e = 0; e < 8; e++) {
|
|
8709
|
-
|
|
8710
|
-
let n =
|
|
8711
|
-
n < s && (s = n, o = e),
|
|
8874
|
+
Oo(a, e), wo(a, t, e);
|
|
8875
|
+
let n = Ao(a.modules);
|
|
8876
|
+
n < s && (s = n, o = e), Oo(a, e);
|
|
8712
8877
|
}
|
|
8713
|
-
return
|
|
8878
|
+
return Oo(a, o), wo(a, t, o), {
|
|
8714
8879
|
size: a.size,
|
|
8715
8880
|
version: r,
|
|
8716
8881
|
modules: a.modules
|
|
@@ -8718,13 +8883,13 @@ function yo(e, t = "M") {
|
|
|
8718
8883
|
}
|
|
8719
8884
|
//#endregion
|
|
8720
8885
|
//#region src/components/ui/QrCode.tsx
|
|
8721
|
-
function
|
|
8886
|
+
function Mo({ value: e, errorCorrection: t = "M", size: n = 160, margin: r = 4, "aria-label": i = "QR code", fallback: a = null, className: o }) {
|
|
8722
8887
|
let s = p(() => {
|
|
8723
8888
|
if (!e) return null;
|
|
8724
8889
|
try {
|
|
8725
|
-
return
|
|
8890
|
+
return jo(e, t);
|
|
8726
8891
|
} catch (e) {
|
|
8727
|
-
if (e instanceof
|
|
8892
|
+
if (e instanceof co) return "too-long";
|
|
8728
8893
|
throw e;
|
|
8729
8894
|
}
|
|
8730
8895
|
}, [e, t]);
|
|
@@ -8758,7 +8923,7 @@ function bo({ value: e, errorCorrection: t = "M", size: n = 160, margin: r = 4,
|
|
|
8758
8923
|
}
|
|
8759
8924
|
//#endregion
|
|
8760
8925
|
//#region src/components/ui/SearchInput.tsx
|
|
8761
|
-
function
|
|
8926
|
+
function No({ value: e, onChange: t, placeholder: n = "Search...", className: r }) {
|
|
8762
8927
|
return /* @__PURE__ */ v("div", {
|
|
8763
8928
|
className: G("relative", r),
|
|
8764
8929
|
children: [/* @__PURE__ */ _(B, { className: "text-text-tertiary absolute top-1/2 left-2 h-3.5 w-3.5 -translate-y-1/2" }), /* @__PURE__ */ _("input", {
|
|
@@ -8772,8 +8937,8 @@ function xo({ value: e, onChange: t, placeholder: n = "Search...", className: r
|
|
|
8772
8937
|
}
|
|
8773
8938
|
//#endregion
|
|
8774
8939
|
//#region src/components/ui/Select.tsx
|
|
8775
|
-
var
|
|
8776
|
-
let f =
|
|
8940
|
+
var Po = a(({ label: e, error: t, options: n, className: r, id: i, hint: a, controlSize: o, required: s, "aria-describedby": c, "aria-invalid": l, ...u }, d) => {
|
|
8941
|
+
let f = to({
|
|
8777
8942
|
id: i,
|
|
8778
8943
|
error: t,
|
|
8779
8944
|
hint: a,
|
|
@@ -8821,10 +8986,10 @@ var So = a(({ label: e, error: t, options: n, className: r, id: i, hint: a, cont
|
|
|
8821
8986
|
]
|
|
8822
8987
|
});
|
|
8823
8988
|
});
|
|
8824
|
-
|
|
8989
|
+
Po.displayName = "Select";
|
|
8825
8990
|
//#endregion
|
|
8826
8991
|
//#region src/components/ui/SettingRow.tsx
|
|
8827
|
-
function
|
|
8992
|
+
function Fo({ label: e, description: t, action: n, className: r }) {
|
|
8828
8993
|
return /* @__PURE__ */ v("div", {
|
|
8829
8994
|
className: G("border-border flex items-center justify-between border-b py-3", r),
|
|
8830
8995
|
children: [/* @__PURE__ */ v("div", {
|
|
@@ -8844,9 +9009,9 @@ function Co({ label: e, description: t, action: n, className: r }) {
|
|
|
8844
9009
|
}
|
|
8845
9010
|
//#endregion
|
|
8846
9011
|
//#region src/components/ui/SideSheet.tsx
|
|
8847
|
-
function
|
|
8848
|
-
let u = m(null);
|
|
8849
|
-
return ft(
|
|
9012
|
+
function Io({ open: e, onClose: t, title: n, children: r, footer: i, side: a = "right", widthClassName: o = "w-[360px]", className: s, contentClassName: c }) {
|
|
9013
|
+
let u = an(), d = m(null);
|
|
9014
|
+
return ft(d, e), l(() => {
|
|
8850
9015
|
if (!e) return;
|
|
8851
9016
|
let n = (e) => {
|
|
8852
9017
|
e.key === "Escape" && t();
|
|
@@ -8860,7 +9025,7 @@ function wo({ open: e, onClose: t, title: n, children: r, footer: i, side: a = "
|
|
|
8860
9025
|
className: "bg-bg-overlay animate-fade-in absolute inset-0",
|
|
8861
9026
|
onClick: t
|
|
8862
9027
|
}), /* @__PURE__ */ v("div", {
|
|
8863
|
-
ref:
|
|
9028
|
+
ref: d,
|
|
8864
9029
|
className: G("bg-bg-secondary border-border absolute inset-y-0 flex flex-col shadow-lg", o, a === "right" ? "animate-slide-in-right right-0 border-l" : "animate-slide-in-left left-0 border-r", s),
|
|
8865
9030
|
style: { maxWidth: "calc(100vw - 2rem)" },
|
|
8866
9031
|
role: "dialog",
|
|
@@ -8868,15 +9033,19 @@ function wo({ open: e, onClose: t, title: n, children: r, footer: i, side: a = "
|
|
|
8868
9033
|
"aria-label": typeof n == "string" ? n : "Panel",
|
|
8869
9034
|
children: [
|
|
8870
9035
|
/* @__PURE__ */ v("div", {
|
|
8871
|
-
|
|
9036
|
+
"data-control-size": u,
|
|
9037
|
+
className: "ui-bar border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2.5",
|
|
8872
9038
|
children: [n && /* @__PURE__ */ _("h3", {
|
|
8873
|
-
className: "text-text-primary truncate text-
|
|
9039
|
+
className: "text-text-primary truncate text-sm font-medium",
|
|
8874
9040
|
children: n
|
|
8875
|
-
}), /* @__PURE__ */ _(
|
|
9041
|
+
}), /* @__PURE__ */ _(fn, {
|
|
9042
|
+
type: "button",
|
|
9043
|
+
variant: "icon",
|
|
9044
|
+
size: "sm",
|
|
8876
9045
|
onClick: t,
|
|
8877
|
-
className: "
|
|
9046
|
+
className: "ml-auto shrink-0",
|
|
8878
9047
|
"aria-label": "Close",
|
|
8879
|
-
children: /* @__PURE__ */ _(V, { className: "h-
|
|
9048
|
+
children: /* @__PURE__ */ _(V, { className: "h-4 w-4" })
|
|
8880
9049
|
})]
|
|
8881
9050
|
}),
|
|
8882
9051
|
/* @__PURE__ */ _("div", {
|
|
@@ -8884,7 +9053,8 @@ function wo({ open: e, onClose: t, title: n, children: r, footer: i, side: a = "
|
|
|
8884
9053
|
children: r
|
|
8885
9054
|
}),
|
|
8886
9055
|
i && /* @__PURE__ */ _("div", {
|
|
8887
|
-
|
|
9056
|
+
"data-control-size": u,
|
|
9057
|
+
className: "ui-bar border-border bg-bg-primary/50 flex shrink-0 items-center gap-2 border-t px-3 py-2.5",
|
|
8888
9058
|
children: i
|
|
8889
9059
|
})
|
|
8890
9060
|
]
|
|
@@ -8893,41 +9063,41 @@ function wo({ open: e, onClose: t, title: n, children: r, footer: i, side: a = "
|
|
|
8893
9063
|
}
|
|
8894
9064
|
//#endregion
|
|
8895
9065
|
//#region src/components/ui/SplitPaneLayout.tsx
|
|
8896
|
-
function
|
|
9066
|
+
function Lo({ children: e, direction: t = "row", className: n }) {
|
|
8897
9067
|
return /* @__PURE__ */ _("div", {
|
|
8898
9068
|
className: G("-m-4 md:-m-6", "flex h-[calc(100vh-var(--topbar-height)-var(--bottomnav-height))] gap-0 md:h-[calc(100vh-var(--topbar-height))]", t === "column" && "flex-col", n),
|
|
8899
9069
|
children: e
|
|
8900
9070
|
});
|
|
8901
9071
|
}
|
|
8902
|
-
function
|
|
9072
|
+
function Ro({ children: e, className: t }) {
|
|
8903
9073
|
return /* @__PURE__ */ _("div", {
|
|
8904
9074
|
className: G("flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden", t),
|
|
8905
9075
|
children: e
|
|
8906
9076
|
});
|
|
8907
9077
|
}
|
|
8908
|
-
var
|
|
9078
|
+
var zo = Object.assign(Lo, { Main: Ro }), Bo = {
|
|
8909
9079
|
active: "bg-green",
|
|
8910
9080
|
inactive: "bg-text-tertiary",
|
|
8911
9081
|
pending: "bg-yellow animate-pulse-subtle",
|
|
8912
9082
|
error: "bg-red"
|
|
8913
|
-
},
|
|
9083
|
+
}, Vo = {
|
|
8914
9084
|
active: "text-green",
|
|
8915
9085
|
inactive: "text-text-tertiary",
|
|
8916
9086
|
pending: "text-yellow",
|
|
8917
9087
|
error: "text-red"
|
|
8918
9088
|
};
|
|
8919
|
-
function
|
|
9089
|
+
function Ho({ status: e, label: t, className: n }) {
|
|
8920
9090
|
return /* @__PURE__ */ v("span", {
|
|
8921
9091
|
className: G("inline-flex items-center gap-1.5", n),
|
|
8922
|
-
children: [/* @__PURE__ */ _("span", { className: G("h-2 w-2 rounded-full",
|
|
8923
|
-
className: G("text-xs",
|
|
9092
|
+
children: [/* @__PURE__ */ _("span", { className: G("h-2 w-2 rounded-full", Bo[e]) }), t && /* @__PURE__ */ _("span", {
|
|
9093
|
+
className: G("text-xs", Vo[e]),
|
|
8924
9094
|
children: t
|
|
8925
9095
|
})]
|
|
8926
9096
|
});
|
|
8927
9097
|
}
|
|
8928
9098
|
//#endregion
|
|
8929
9099
|
//#region src/components/ui/StepProgress.tsx
|
|
8930
|
-
function
|
|
9100
|
+
function Uo({ steps: e, currentStep: t, className: n }) {
|
|
8931
9101
|
return /* @__PURE__ */ _("div", {
|
|
8932
9102
|
className: G("flex items-center justify-between", n),
|
|
8933
9103
|
children: e.map((n, r) => /* @__PURE__ */ v("div", {
|
|
@@ -8954,7 +9124,7 @@ function jo({ steps: e, currentStep: t, className: n }) {
|
|
|
8954
9124
|
}
|
|
8955
9125
|
//#endregion
|
|
8956
9126
|
//#region src/components/ui/Tabs.tsx
|
|
8957
|
-
function
|
|
9127
|
+
function Wo({ tabs: e, defaultTab: t, value: n, onChange: r, className: i }) {
|
|
8958
9128
|
let [a, o] = h(t || e[0]?.key), s = n ?? a, c = e.some((e) => e.key === s) ? s : e[0]?.key, l = e.find((e) => e.key === c);
|
|
8959
9129
|
function d(e) {
|
|
8960
9130
|
n === void 0 && o(e), r?.(e);
|
|
@@ -8993,8 +9163,8 @@ function Mo({ tabs: e, defaultTab: t, value: n, onChange: r, className: i }) {
|
|
|
8993
9163
|
}
|
|
8994
9164
|
//#endregion
|
|
8995
9165
|
//#region src/components/ui/Textarea.tsx
|
|
8996
|
-
var
|
|
8997
|
-
let m =
|
|
9166
|
+
var Go = a(({ label: e, error: t, showCount: n, maxLength: r, value: i, className: a, id: o, hint: s, controlSize: c, required: l, "aria-describedby": u, "aria-invalid": d, ...f }, p) => {
|
|
9167
|
+
let m = to({
|
|
8998
9168
|
id: o,
|
|
8999
9169
|
error: t,
|
|
9000
9170
|
hint: s,
|
|
@@ -9045,11 +9215,11 @@ var No = a(({ label: e, error: t, showCount: n, maxLength: r, value: i, classNam
|
|
|
9045
9215
|
]
|
|
9046
9216
|
});
|
|
9047
9217
|
});
|
|
9048
|
-
|
|
9218
|
+
Go.displayName = "Textarea";
|
|
9049
9219
|
//#endregion
|
|
9050
9220
|
//#region src/components/ui/TextInput.tsx
|
|
9051
|
-
var
|
|
9052
|
-
let p =
|
|
9221
|
+
var Ko = a(({ label: e, error: t, icon: n, className: r, id: i, readOnly: a, hint: o, controlSize: s, required: c, "aria-describedby": l, "aria-invalid": u, ...d }, f) => {
|
|
9222
|
+
let p = to({
|
|
9053
9223
|
id: i,
|
|
9054
9224
|
error: t,
|
|
9055
9225
|
hint: o,
|
|
@@ -9098,10 +9268,10 @@ var Po = a(({ label: e, error: t, icon: n, className: r, id: i, readOnly: a, hin
|
|
|
9098
9268
|
]
|
|
9099
9269
|
});
|
|
9100
9270
|
});
|
|
9101
|
-
|
|
9271
|
+
Ko.displayName = "TextInput";
|
|
9102
9272
|
//#endregion
|
|
9103
9273
|
//#region src/components/ui/Timeline.tsx
|
|
9104
|
-
function
|
|
9274
|
+
function qo({ items: e, className: t }) {
|
|
9105
9275
|
return /* @__PURE__ */ _("div", {
|
|
9106
9276
|
className: G("space-y-0", t),
|
|
9107
9277
|
children: e.map((t, n) => /* @__PURE__ */ v("div", {
|
|
@@ -9124,16 +9294,16 @@ function Fo({ items: e, className: t }) {
|
|
|
9124
9294
|
}
|
|
9125
9295
|
//#endregion
|
|
9126
9296
|
//#region src/components/ui/Tooltip.tsx
|
|
9127
|
-
var
|
|
9297
|
+
var Jo = {
|
|
9128
9298
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
9129
9299
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
9130
9300
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
9131
9301
|
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
9132
9302
|
};
|
|
9133
|
-
function
|
|
9303
|
+
function Yo(e, t) {
|
|
9134
9304
|
return e ? `${e} ${t}` : t;
|
|
9135
9305
|
}
|
|
9136
|
-
function
|
|
9306
|
+
function Xo({ content: e, placement: t = "top", children: r }) {
|
|
9137
9307
|
let [i, a] = h(!1), s = u();
|
|
9138
9308
|
return /* @__PURE__ */ v("div", {
|
|
9139
9309
|
className: "relative inline-flex",
|
|
@@ -9141,9 +9311,9 @@ function Ro({ content: e, placement: t = "top", children: r }) {
|
|
|
9141
9311
|
onMouseLeave: () => a(!1),
|
|
9142
9312
|
onFocus: () => a(!0),
|
|
9143
9313
|
onBlur: () => a(!1),
|
|
9144
|
-
children: [o(r) ? n(r, { "aria-describedby":
|
|
9314
|
+
children: [o(r) ? n(r, { "aria-describedby": Yo(r.props["aria-describedby"], s) }) : r, i && /* @__PURE__ */ _("div", {
|
|
9145
9315
|
id: s,
|
|
9146
|
-
className: G("text-2xs absolute z-50 px-2 py-1 font-medium whitespace-nowrap", "bg-bg-tertiary text-text-primary border-border rounded border shadow-md", "animate-fade-in pointer-events-none",
|
|
9316
|
+
className: G("text-2xs absolute z-50 px-2 py-1 font-medium whitespace-nowrap", "bg-bg-tertiary text-text-primary border-border rounded border shadow-md", "animate-fade-in pointer-events-none", Jo[t]),
|
|
9147
9317
|
role: "tooltip",
|
|
9148
9318
|
children: e
|
|
9149
9319
|
})]
|
|
@@ -9151,7 +9321,7 @@ function Ro({ content: e, placement: t = "top", children: r }) {
|
|
|
9151
9321
|
}
|
|
9152
9322
|
//#endregion
|
|
9153
9323
|
//#region src/components/ui/Toolbar.tsx
|
|
9154
|
-
function
|
|
9324
|
+
function Zo({ start: e, end: t, children: n, className: r, startClassName: i, endClassName: a }) {
|
|
9155
9325
|
return /* @__PURE__ */ v("div", {
|
|
9156
9326
|
className: G("flex items-center justify-between gap-3", r),
|
|
9157
9327
|
children: [/* @__PURE__ */ _("div", {
|
|
@@ -9165,7 +9335,7 @@ function zo({ start: e, end: t, children: n, className: r, startClassName: i, en
|
|
|
9165
9335
|
}
|
|
9166
9336
|
//#endregion
|
|
9167
9337
|
//#region src/components/ui/UploadDropzone.tsx
|
|
9168
|
-
var
|
|
9338
|
+
var Qo = a(function({ title: e = "Drag and drop files here, or click to browse", description: t, icon: n, multiple: r, disabled: i, onChange: a, onFilesChange: o, className: s, id: c, "aria-describedby": l, ...f }, p) {
|
|
9169
9339
|
let h = m(null);
|
|
9170
9340
|
d(p, () => h.current, []);
|
|
9171
9341
|
let g = u(), y = `${c ?? g}-description`;
|
|
@@ -9212,15 +9382,15 @@ var Bo = a(function({ title: e = "Drag and drop files here, or click to browse",
|
|
|
9212
9382
|
})
|
|
9213
9383
|
]
|
|
9214
9384
|
});
|
|
9215
|
-
}),
|
|
9385
|
+
}), $o = r({ theme: "dark" });
|
|
9216
9386
|
//#endregion
|
|
9217
9387
|
//#region src/hooks/useTheme.ts
|
|
9218
|
-
function
|
|
9219
|
-
return c(
|
|
9388
|
+
function es() {
|
|
9389
|
+
return c($o);
|
|
9220
9390
|
}
|
|
9221
9391
|
//#endregion
|
|
9222
9392
|
//#region src/lib/formatDate.ts
|
|
9223
|
-
var
|
|
9393
|
+
var ts = [
|
|
9224
9394
|
"Jan",
|
|
9225
9395
|
"Feb",
|
|
9226
9396
|
"Mar",
|
|
@@ -9234,21 +9404,21 @@ var Uo = [
|
|
|
9234
9404
|
"Nov",
|
|
9235
9405
|
"Dec"
|
|
9236
9406
|
];
|
|
9237
|
-
function
|
|
9407
|
+
function ns(e) {
|
|
9238
9408
|
return (/* @__PURE__ */ new Date(e + "T00:00:00")).toLocaleDateString("en-US", {
|
|
9239
9409
|
month: "short",
|
|
9240
9410
|
day: "numeric",
|
|
9241
9411
|
year: "numeric"
|
|
9242
9412
|
});
|
|
9243
9413
|
}
|
|
9244
|
-
function
|
|
9414
|
+
function rs(e) {
|
|
9245
9415
|
return (/* @__PURE__ */ new Date(e + "T00:00:00")).toLocaleDateString("en-US", {
|
|
9246
9416
|
month: "long",
|
|
9247
9417
|
day: "numeric",
|
|
9248
9418
|
year: "numeric"
|
|
9249
9419
|
});
|
|
9250
9420
|
}
|
|
9251
|
-
function
|
|
9421
|
+
function is(e, t = /* @__PURE__ */ new Date()) {
|
|
9252
9422
|
let n = t.getTime() - e.getTime(), r = Math.floor(n / 1e3);
|
|
9253
9423
|
if (r < 60) return "just now";
|
|
9254
9424
|
let i = Math.floor(r / 60);
|
|
@@ -9256,18 +9426,18 @@ function Ko(e, t = /* @__PURE__ */ new Date()) {
|
|
|
9256
9426
|
let a = Math.floor(i / 60);
|
|
9257
9427
|
if (a < 24) return `${a}h ago`;
|
|
9258
9428
|
if (Math.floor(a / 24) === 1) return "yesterday";
|
|
9259
|
-
let o = `${
|
|
9429
|
+
let o = `${ts[e.getMonth()]} ${e.getDate()}`;
|
|
9260
9430
|
return e.getFullYear() === t.getFullYear() ? o : `${o}, ${e.getFullYear()}`;
|
|
9261
9431
|
}
|
|
9262
9432
|
//#endregion
|
|
9263
9433
|
//#region src/providers/SettingsProvider.tsx
|
|
9264
|
-
var
|
|
9434
|
+
var as = {
|
|
9265
9435
|
"archivo-expanded": "\"Archivo\", \"Arial Black\", \"Avenir Next Condensed\", \"HelveticaNeue-CondensedBold\", system-ui, sans-serif",
|
|
9266
9436
|
inter: "\"Inter\", system-ui, -apple-system, BlinkMacSystemFont, sans-serif",
|
|
9267
9437
|
"jetbrains-mono": "\"JetBrains Mono\", Menlo, Monaco, Consolas, monospace",
|
|
9268
9438
|
"pt-serif": "\"PT Serif\", Georgia, ui-serif, Cambria, \"Times New Roman\", Times, serif",
|
|
9269
9439
|
system: "system-ui, -apple-system, BlinkMacSystemFont, sans-serif"
|
|
9270
|
-
},
|
|
9440
|
+
}, os = {
|
|
9271
9441
|
purple: {
|
|
9272
9442
|
base: "#7C5CFC",
|
|
9273
9443
|
hover: "#6B4AEB",
|
|
@@ -9324,43 +9494,43 @@ var qo = {
|
|
|
9324
9494
|
muted: "rgba(99,102,241,0.15)",
|
|
9325
9495
|
subtle: "rgba(99,102,241,0.08)"
|
|
9326
9496
|
}
|
|
9327
|
-
},
|
|
9497
|
+
}, ss = "leonardaustin-ui-settings", cs = new Set(Object.keys(os)), ls = new Set(Object.keys(Ot)), us = new Set(Object.keys(as)), ds = new Set([
|
|
9328
9498
|
"light",
|
|
9329
9499
|
"dark",
|
|
9330
9500
|
"system"
|
|
9331
9501
|
]);
|
|
9332
|
-
function
|
|
9502
|
+
function fs(e, t, n, r) {
|
|
9333
9503
|
return typeof e != "number" || !isFinite(e) ? r : Math.min(n, Math.max(t, e));
|
|
9334
9504
|
}
|
|
9335
|
-
function
|
|
9505
|
+
function ps(e) {
|
|
9336
9506
|
let t = {};
|
|
9337
|
-
if (
|
|
9507
|
+
if (cs.has(e.accentColor) && (t.accentColor = e.accentColor), ds.has(e.colorMode) && (t.colorMode = e.colorMode), ls.has(e.preferredDarkTheme) && !Ct(e.preferredDarkTheme) && (t.preferredDarkTheme = e.preferredDarkTheme), ls.has(e.preferredLightTheme) && Ct(e.preferredLightTheme) && (t.preferredLightTheme = e.preferredLightTheme), typeof e.sidebarCollapsed == "boolean" && (t.sidebarCollapsed = e.sidebarCollapsed), typeof e.reducedMotion == "boolean" && (t.reducedMotion = e.reducedMotion), typeof e.sidebarWidth == "number" && (t.sidebarWidth = fs(e.sidebarWidth, 160, 400, 220)), e.themeOverrides && typeof e.themeOverrides == "object") {
|
|
9338
9508
|
let n = {};
|
|
9339
9509
|
for (let [t, r] of Object.entries(e.themeOverrides)) {
|
|
9340
|
-
if (!
|
|
9510
|
+
if (!ls.has(t) || !r || typeof r != "object") continue;
|
|
9341
9511
|
let e = r, i = Ot[t];
|
|
9342
9512
|
n[t] = {
|
|
9343
|
-
uiFont:
|
|
9344
|
-
headingFont:
|
|
9345
|
-
proseFont:
|
|
9346
|
-
controlFont:
|
|
9347
|
-
labelFont:
|
|
9348
|
-
navigationFont:
|
|
9349
|
-
dataFont:
|
|
9350
|
-
codeFont:
|
|
9351
|
-
fontSize:
|
|
9352
|
-
borderRadius:
|
|
9353
|
-
borderWidth:
|
|
9354
|
-
tracking:
|
|
9355
|
-
lineHeight:
|
|
9356
|
-
density:
|
|
9513
|
+
uiFont: us.has(e.uiFont) ? e.uiFont : i.uiFont,
|
|
9514
|
+
headingFont: us.has(e.headingFont) ? e.headingFont : i.headingFont,
|
|
9515
|
+
proseFont: us.has(e.proseFont) ? e.proseFont : i.proseFont,
|
|
9516
|
+
controlFont: us.has(e.controlFont) ? e.controlFont : i.controlFont,
|
|
9517
|
+
labelFont: us.has(e.labelFont) ? e.labelFont : i.labelFont,
|
|
9518
|
+
navigationFont: us.has(e.navigationFont) ? e.navigationFont : i.navigationFont,
|
|
9519
|
+
dataFont: us.has(e.dataFont) ? e.dataFont : i.dataFont,
|
|
9520
|
+
codeFont: us.has(e.codeFont) ? e.codeFont : i.codeFont,
|
|
9521
|
+
fontSize: fs(e.fontSize, 11, 18, i.fontSize),
|
|
9522
|
+
borderRadius: fs(e.borderRadius, 0, 16, i.borderRadius),
|
|
9523
|
+
borderWidth: fs(e.borderWidth, 1, 3, i.borderWidth),
|
|
9524
|
+
tracking: fs(e.tracking, 0, .3, i.tracking),
|
|
9525
|
+
lineHeight: fs(e.lineHeight, 1.2, 2, i.lineHeight),
|
|
9526
|
+
density: fs(e.density, .18, .32, i.density)
|
|
9357
9527
|
};
|
|
9358
9528
|
}
|
|
9359
9529
|
t.themeOverrides = n;
|
|
9360
9530
|
}
|
|
9361
9531
|
return t;
|
|
9362
9532
|
}
|
|
9363
|
-
var
|
|
9533
|
+
var ms = {
|
|
9364
9534
|
accentColor: "purple",
|
|
9365
9535
|
sidebarCollapsed: !1,
|
|
9366
9536
|
sidebarWidth: 220,
|
|
@@ -9370,35 +9540,35 @@ var ns = {
|
|
|
9370
9540
|
preferredLightTheme: "light",
|
|
9371
9541
|
themeOverrides: {}
|
|
9372
9542
|
};
|
|
9373
|
-
function
|
|
9543
|
+
function hs(e, t) {
|
|
9374
9544
|
let n = {
|
|
9375
|
-
...
|
|
9376
|
-
...
|
|
9545
|
+
...ms,
|
|
9546
|
+
...ps(t ?? {})
|
|
9377
9547
|
};
|
|
9378
9548
|
if (typeof localStorage > "u") return n;
|
|
9379
9549
|
try {
|
|
9380
9550
|
let t = localStorage.getItem(e);
|
|
9381
9551
|
if (t) return {
|
|
9382
9552
|
...n,
|
|
9383
|
-
...
|
|
9553
|
+
...ps(JSON.parse(t))
|
|
9384
9554
|
};
|
|
9385
9555
|
} catch (e) {
|
|
9386
9556
|
console.warn("[SettingsProvider] Failed to load settings:", e);
|
|
9387
9557
|
}
|
|
9388
9558
|
return n;
|
|
9389
9559
|
}
|
|
9390
|
-
function
|
|
9560
|
+
function gs(e, t) {
|
|
9391
9561
|
let n = Ot[e] ?? Ot.dark;
|
|
9392
9562
|
return t[e] ? {
|
|
9393
9563
|
...n,
|
|
9394
9564
|
...t[e]
|
|
9395
9565
|
} : n;
|
|
9396
9566
|
}
|
|
9397
|
-
function
|
|
9567
|
+
function _s(e, t) {
|
|
9398
9568
|
return e.uiFont === t.uiFont && e.headingFont === t.headingFont && e.proseFont === t.proseFont && e.controlFont === t.controlFont && e.labelFont === t.labelFont && e.navigationFont === t.navigationFont && e.dataFont === t.dataFont && e.codeFont === t.codeFont && e.fontSize === t.fontSize && e.borderRadius === t.borderRadius && e.borderWidth === t.borderWidth && e.tracking === t.tracking && e.lineHeight === t.lineHeight && e.density === t.density;
|
|
9399
9569
|
}
|
|
9400
|
-
function
|
|
9401
|
-
let [i, a] = h(() =>
|
|
9570
|
+
function vs({ children: e, storageKey: t = ss, initialSettings: n, forcedTheme: r }) {
|
|
9571
|
+
let [i, a] = h(() => hs(t, n)), [o, c] = h(() => typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches);
|
|
9402
9572
|
l(() => {
|
|
9403
9573
|
if (typeof window > "u") return;
|
|
9404
9574
|
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = (e) => c(e.matches);
|
|
@@ -9410,9 +9580,9 @@ function os({ children: e, storageKey: t = Yo, initialSettings: n, forcedTheme:
|
|
|
9410
9580
|
i.preferredDarkTheme,
|
|
9411
9581
|
i.preferredLightTheme,
|
|
9412
9582
|
o
|
|
9413
|
-
]), [d, f] = h(() =>
|
|
9583
|
+
]), [d, f] = h(() => gs(u, i.themeOverrides));
|
|
9414
9584
|
l(() => {
|
|
9415
|
-
f(
|
|
9585
|
+
f(gs(u, i.themeOverrides));
|
|
9416
9586
|
}, [u]);
|
|
9417
9587
|
let m = s((e) => {
|
|
9418
9588
|
a((n) => {
|
|
@@ -9429,15 +9599,15 @@ function os({ children: e, storageKey: t = Yo, initialSettings: n, forcedTheme:
|
|
|
9429
9599
|
});
|
|
9430
9600
|
}, [t]);
|
|
9431
9601
|
l(() => {
|
|
9432
|
-
let e = document.documentElement, t =
|
|
9602
|
+
let e = document.documentElement, t = os[i.accentColor];
|
|
9433
9603
|
e.style.setProperty("--accent", t.base), e.style.setProperty("--accent-hover", t.hover), e.style.setProperty("--accent-active", t.active), e.style.setProperty("--accent-muted", t.muted), e.style.setProperty("--accent-subtle", t.subtle);
|
|
9434
9604
|
}, [i.accentColor]), l(() => {
|
|
9435
9605
|
document.documentElement.classList.toggle("reduced-motion", i.reducedMotion);
|
|
9436
9606
|
}, [i.reducedMotion]), l(() => {
|
|
9437
9607
|
let e = document.documentElement, t = d.borderRadius;
|
|
9438
|
-
e.style.fontSize = `${d.fontSize / 13 * 100}%`, e.style.setProperty("--font-ui",
|
|
9608
|
+
e.style.fontSize = `${d.fontSize / 13 * 100}%`, e.style.setProperty("--font-ui", as[d.uiFont]), e.style.setProperty("--font-heading", as[d.headingFont]), e.style.setProperty("--font-prose", as[d.proseFont]), e.style.setProperty("--font-control", as[d.controlFont]), e.style.setProperty("--font-label", as[d.labelFont]), e.style.setProperty("--font-navigation", as[d.navigationFont]), e.style.setProperty("--font-data", as[d.dataFont]), e.style.setProperty("--font-code", as[d.codeFont]), e.style.setProperty("--ui-radius", t === 0 ? "0" : `${Math.round(t * 2 / 3)}px`), e.style.setProperty("--ui-radius-md", t === 0 ? "0" : `${t}px`), e.style.setProperty("--ui-radius-lg", t === 0 ? "0" : `${Math.round(t * 4 / 3)}px`), e.style.setProperty("--ui-radius-xl", t === 0 ? "0" : `${t * 2}px`), e.style.setProperty("--ui-border-width", `${d.borderWidth}px`), e.style.setProperty("--ui-tracking", `${d.tracking}em`), e.style.setProperty("--ui-line-height", String(d.lineHeight)), e.style.setProperty("--ui-density", `${d.density}rem`);
|
|
9439
9609
|
}, [d]);
|
|
9440
|
-
let g = p(() =>
|
|
9610
|
+
let g = p(() => gs(u, i.themeOverrides), [u, i.themeOverrides]), v = u in i.themeOverrides, y = !_s(d, g), b = s(() => {
|
|
9441
9611
|
m({ themeOverrides: {
|
|
9442
9612
|
...i.themeOverrides,
|
|
9443
9613
|
[u]: { ...d }
|
|
@@ -9561,7 +9731,7 @@ function os({ children: e, storageKey: t = Yo, initialSettings: n, forcedTheme:
|
|
|
9561
9731
|
}
|
|
9562
9732
|
//#endregion
|
|
9563
9733
|
//#region src/providers/ThemeProvider.tsx
|
|
9564
|
-
var
|
|
9734
|
+
var ys = {
|
|
9565
9735
|
dark: "",
|
|
9566
9736
|
light: "theme-light",
|
|
9567
9737
|
lightInverted: "theme-light-inverted",
|
|
@@ -9571,33 +9741,33 @@ var ss = {
|
|
|
9571
9741
|
cyberBrutalLight: "theme-cyber-brutal-light",
|
|
9572
9742
|
hashiTheme: "theme-hashi"
|
|
9573
9743
|
};
|
|
9574
|
-
function
|
|
9744
|
+
function bs({ children: e }) {
|
|
9575
9745
|
let { resolvedTheme: t } = c(Mt);
|
|
9576
9746
|
return l(() => {
|
|
9577
9747
|
let e = document.documentElement;
|
|
9578
|
-
Object.values(
|
|
9748
|
+
Object.values(ys).forEach((t) => {
|
|
9579
9749
|
t && e.classList.remove(t);
|
|
9580
9750
|
});
|
|
9581
|
-
let n =
|
|
9751
|
+
let n = ys[t];
|
|
9582
9752
|
n && e.classList.add(n);
|
|
9583
|
-
}, [t]), /* @__PURE__ */ _(
|
|
9753
|
+
}, [t]), /* @__PURE__ */ _($o.Provider, {
|
|
9584
9754
|
value: { theme: t },
|
|
9585
9755
|
children: e
|
|
9586
9756
|
});
|
|
9587
9757
|
}
|
|
9588
9758
|
//#endregion
|
|
9589
9759
|
//#region src/components/ui/FormField.tsx
|
|
9590
|
-
function
|
|
9760
|
+
function xs({ id: e, label: t, hint: n, error: r, required: i, optionalLabel: a, children: o, className: s, ...c }) {
|
|
9591
9761
|
let l = u(), d = e ?? l, f = n ? `${d}-hint` : void 0, p = r ? `${d}-error` : void 0, m = {
|
|
9592
9762
|
id: d,
|
|
9593
|
-
"aria-describedby":
|
|
9763
|
+
"aria-describedby": Rn(f, p),
|
|
9594
9764
|
"aria-invalid": !!r || void 0,
|
|
9595
9765
|
required: i
|
|
9596
9766
|
};
|
|
9597
|
-
return /* @__PURE__ */ _(
|
|
9767
|
+
return /* @__PURE__ */ _(Ln.Provider, {
|
|
9598
9768
|
value: {
|
|
9599
9769
|
id: d,
|
|
9600
|
-
describedBy:
|
|
9770
|
+
describedBy: Rn(f, p),
|
|
9601
9771
|
invalid: !!r,
|
|
9602
9772
|
required: i
|
|
9603
9773
|
},
|
|
@@ -9632,13 +9802,13 @@ function ls({ id: e, label: t, hint: n, error: r, required: i, optionalLabel: a,
|
|
|
9632
9802
|
})
|
|
9633
9803
|
});
|
|
9634
9804
|
}
|
|
9635
|
-
function
|
|
9805
|
+
function Ss({ className: e, ...t }) {
|
|
9636
9806
|
return /* @__PURE__ */ _("p", {
|
|
9637
9807
|
...t,
|
|
9638
9808
|
className: G("text-text-secondary text-xs", e)
|
|
9639
9809
|
});
|
|
9640
9810
|
}
|
|
9641
|
-
function
|
|
9811
|
+
function Cs({ className: e, ...t }) {
|
|
9642
9812
|
return /* @__PURE__ */ _("p", {
|
|
9643
9813
|
...t,
|
|
9644
9814
|
className: G("text-red text-xs", e)
|
|
@@ -9646,8 +9816,8 @@ function ds({ className: e, ...t }) {
|
|
|
9646
9816
|
}
|
|
9647
9817
|
//#endregion
|
|
9648
9818
|
//#region src/components/ui/Fieldset.tsx
|
|
9649
|
-
function
|
|
9650
|
-
let c = u(), l = e ?? c, d = n ? `${l}-hint` : void 0, f = r ? `${l}-error` : void 0, p =
|
|
9819
|
+
function ws({ id: e, legend: t, hint: n, error: r, children: i, className: a, "aria-describedby": o, ...s }) {
|
|
9820
|
+
let c = u(), l = e ?? c, d = n ? `${l}-hint` : void 0, f = r ? `${l}-error` : void 0, p = Rn(o, d, f);
|
|
9651
9821
|
return /* @__PURE__ */ v("fieldset", {
|
|
9652
9822
|
...s,
|
|
9653
9823
|
id: l,
|
|
@@ -9668,7 +9838,7 @@ function fs({ id: e, legend: t, hint: n, error: r, children: i, className: a, "a
|
|
|
9668
9838
|
className: "text-red text-xs",
|
|
9669
9839
|
children: r
|
|
9670
9840
|
}),
|
|
9671
|
-
/* @__PURE__ */ _(
|
|
9841
|
+
/* @__PURE__ */ _(Ln.Provider, {
|
|
9672
9842
|
value: {
|
|
9673
9843
|
describedBy: p,
|
|
9674
9844
|
invalid: !!r
|
|
@@ -9680,8 +9850,8 @@ function fs({ id: e, legend: t, hint: n, error: r, children: i, className: a, "a
|
|
|
9680
9850
|
}
|
|
9681
9851
|
//#endregion
|
|
9682
9852
|
//#region src/components/ui/Radio.tsx
|
|
9683
|
-
var
|
|
9684
|
-
let d = u(), f = an(n), p = c(
|
|
9853
|
+
var Ts = a(({ label: e, description: t, controlSize: n, className: r, id: i, "aria-describedby": a, "aria-invalid": o, ...s }, l) => {
|
|
9854
|
+
let d = u(), f = an(n), p = c(Ln), m = i ?? p?.id ?? d, h = t ? `${m}-description` : void 0;
|
|
9685
9855
|
return /* @__PURE__ */ v("label", {
|
|
9686
9856
|
className: G("ui-choice flex items-start gap-2.5", r),
|
|
9687
9857
|
"data-control-size": f,
|
|
@@ -9691,7 +9861,7 @@ var ps = a(({ label: e, description: t, controlSize: n, className: r, id: i, "ar
|
|
|
9691
9861
|
id: m,
|
|
9692
9862
|
type: "radio",
|
|
9693
9863
|
"aria-invalid": o ?? (p?.invalid || void 0),
|
|
9694
|
-
"aria-describedby":
|
|
9864
|
+
"aria-describedby": Rn(a, p?.describedBy, h),
|
|
9695
9865
|
className: "ui-native-choice"
|
|
9696
9866
|
}), /* @__PURE__ */ v("span", {
|
|
9697
9867
|
className: "text-text-primary text-xs",
|
|
@@ -9703,14 +9873,14 @@ var ps = a(({ label: e, description: t, controlSize: n, className: r, id: i, "ar
|
|
|
9703
9873
|
})]
|
|
9704
9874
|
});
|
|
9705
9875
|
});
|
|
9706
|
-
|
|
9707
|
-
function
|
|
9876
|
+
Ts.displayName = "Radio";
|
|
9877
|
+
function Es({ name: e, id: t, options: n, value: r, onChange: i, required: a, disabled: o, controlSize: s, ...c }) {
|
|
9708
9878
|
let l = u(), d = t ?? l;
|
|
9709
|
-
return /* @__PURE__ */ _(
|
|
9879
|
+
return /* @__PURE__ */ _(ws, {
|
|
9710
9880
|
...c,
|
|
9711
9881
|
id: d,
|
|
9712
9882
|
disabled: o,
|
|
9713
|
-
children: n.map((t, n) => /* @__PURE__ */ _(
|
|
9883
|
+
children: n.map((t, n) => /* @__PURE__ */ _(Ts, {
|
|
9714
9884
|
id: `${d}-${n}`,
|
|
9715
9885
|
name: e ?? d,
|
|
9716
9886
|
value: t.value,
|
|
@@ -9724,17 +9894,17 @@ function ms({ name: e, id: t, options: n, value: r, onChange: i, required: a, di
|
|
|
9724
9894
|
}, t.value))
|
|
9725
9895
|
});
|
|
9726
9896
|
}
|
|
9727
|
-
var
|
|
9897
|
+
var Ds = Object.assign(Ts, { Group: Es }), Os = {
|
|
9728
9898
|
pending: "Pending",
|
|
9729
9899
|
uploading: "Uploading",
|
|
9730
9900
|
processing: "Processing",
|
|
9731
9901
|
ready: "Ready",
|
|
9732
9902
|
error: "Upload failed"
|
|
9733
9903
|
};
|
|
9734
|
-
function
|
|
9904
|
+
function ks(e) {
|
|
9735
9905
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
9736
9906
|
}
|
|
9737
|
-
function
|
|
9907
|
+
function As({ name: e, size: t, status: n = "ready", statusLabel: r, error: i, onRetry: a, onRemove: o, onDownload: s, downloadHref: c, actionsDisabled: l, className: u, ...d }) {
|
|
9738
9908
|
return /* @__PURE__ */ v("li", {
|
|
9739
9909
|
...d,
|
|
9740
9910
|
className: G("ui-attachment-item border-border flex items-center justify-between gap-3 rounded-md border p-3", u),
|
|
@@ -9747,7 +9917,7 @@ function vs({ name: e, size: t, status: n = "ready", statusLabel: r, error: i, o
|
|
|
9747
9917
|
}),
|
|
9748
9918
|
t !== void 0 && /* @__PURE__ */ _("p", {
|
|
9749
9919
|
className: "text-text-tertiary text-2xs",
|
|
9750
|
-
children:
|
|
9920
|
+
children: ks(t)
|
|
9751
9921
|
}),
|
|
9752
9922
|
/* @__PURE__ */ v("div", {
|
|
9753
9923
|
role: "status",
|
|
@@ -9756,7 +9926,7 @@ function vs({ name: e, size: t, status: n = "ready", statusLabel: r, error: i, o
|
|
|
9756
9926
|
children: [
|
|
9757
9927
|
e,
|
|
9758
9928
|
": ",
|
|
9759
|
-
i ?? r ??
|
|
9929
|
+
i ?? r ?? Os[n]
|
|
9760
9930
|
]
|
|
9761
9931
|
})
|
|
9762
9932
|
]
|
|
@@ -9798,7 +9968,7 @@ function vs({ name: e, size: t, status: n = "ready", statusLabel: r, error: i, o
|
|
|
9798
9968
|
})]
|
|
9799
9969
|
});
|
|
9800
9970
|
}
|
|
9801
|
-
function
|
|
9971
|
+
function js({ children: e, className: t, "aria-label": n = "Attachments", ...r }) {
|
|
9802
9972
|
return /* @__PURE__ */ _("ul", {
|
|
9803
9973
|
...r,
|
|
9804
9974
|
"aria-label": n,
|
|
@@ -9808,7 +9978,7 @@ function ys({ children: e, className: t, "aria-label": n = "Attachments", ...r }
|
|
|
9808
9978
|
}
|
|
9809
9979
|
//#endregion
|
|
9810
9980
|
//#region src/lib/dateParts.ts
|
|
9811
|
-
function
|
|
9981
|
+
function Ms(e, { required: t = !1, minYear: n = 1900, maxYear: r = 2100 } = {}) {
|
|
9812
9982
|
let i = [
|
|
9813
9983
|
e.day,
|
|
9814
9984
|
e.month,
|
|
@@ -9838,10 +10008,10 @@ function bs(e, { required: t = !1, minYear: n = 1900, maxYear: r = 2100 } = {})
|
|
|
9838
10008
|
}
|
|
9839
10009
|
//#endregion
|
|
9840
10010
|
//#region src/components/ui/DatePartsInput.tsx
|
|
9841
|
-
function
|
|
10011
|
+
function Ns({ value: e, onChange: t, label: n, hint: r, error: i, id: a, name: o, disabled: s, required: c, className: d, inputProps: f, minYear: p = 1900, maxYear: g = 2100 }) {
|
|
9842
10012
|
let y = u(), b = m({}), [x, S] = h(!1);
|
|
9843
10013
|
if (!Number.isInteger(p) || !Number.isInteger(g) || p < 1 || g > 9999 || p > g) throw RangeError("DatePartsInput requires year bounds between 1 and 9999, with minYear <= maxYear");
|
|
9844
|
-
let C =
|
|
10014
|
+
let C = Ms(e, {
|
|
9845
10015
|
required: c,
|
|
9846
10016
|
minYear: p,
|
|
9847
10017
|
maxYear: g
|
|
@@ -9890,7 +10060,7 @@ function xs({ value: e, onChange: t, label: n, hint: r, error: i, id: a, name: o
|
|
|
9890
10060
|
"year"
|
|
9891
10061
|
].map((n) => /* @__PURE__ */ v("div", {
|
|
9892
10062
|
className: "ui-date-part",
|
|
9893
|
-
children: [/* @__PURE__ */ _(
|
|
10063
|
+
children: [/* @__PURE__ */ _(Ko, {
|
|
9894
10064
|
inputMode: "numeric",
|
|
9895
10065
|
"data-1p-ignore": "true",
|
|
9896
10066
|
...f?.[n],
|
|
@@ -9957,7 +10127,7 @@ function xs({ value: e, onChange: t, label: n, hint: r, error: i, id: a, name: o
|
|
|
9957
10127
|
}
|
|
9958
10128
|
//#endregion
|
|
9959
10129
|
//#region src/components/ui/Skeleton.tsx
|
|
9960
|
-
function
|
|
10130
|
+
function Ps({ className: e, width: t, height: n, style: r, ...i }) {
|
|
9961
10131
|
return /* @__PURE__ */ _("div", {
|
|
9962
10132
|
...i,
|
|
9963
10133
|
"aria-hidden": "true",
|
|
@@ -9971,7 +10141,7 @@ function Ss({ className: e, width: t, height: n, style: r, ...i }) {
|
|
|
9971
10141
|
}
|
|
9972
10142
|
//#endregion
|
|
9973
10143
|
//#region src/components/ui/NavTabs.tsx
|
|
9974
|
-
function
|
|
10144
|
+
function Fs({ items: e, activeKey: t, renderLink: n, className: r, "aria-label": i = "Sections", ...a }) {
|
|
9975
10145
|
return /* @__PURE__ */ _("nav", {
|
|
9976
10146
|
...a,
|
|
9977
10147
|
"aria-label": i,
|
|
@@ -9995,7 +10165,7 @@ function Cs({ items: e, activeKey: t, renderLink: n, className: r, "aria-label":
|
|
|
9995
10165
|
}
|
|
9996
10166
|
//#endregion
|
|
9997
10167
|
//#region src/components/ui/CharacterCount.tsx
|
|
9998
|
-
function
|
|
10168
|
+
function Is({ value: e, maxLength: t, announcementDelay: n = 1e3, className: r, ...i }) {
|
|
9999
10169
|
let a = t - e.length, o = Math.abs(a), s = `${o} ${o === 1 ? "character" : "characters"} ${a < 0 ? "over the limit" : "remaining"}`, [c, u] = h(s);
|
|
10000
10170
|
return l(() => {
|
|
10001
10171
|
let e = setTimeout(() => u(s), n);
|
|
@@ -10017,7 +10187,7 @@ function ws({ value: e, maxLength: t, announcementDelay: n = 1e3, className: r,
|
|
|
10017
10187
|
}
|
|
10018
10188
|
//#endregion
|
|
10019
10189
|
//#region src/providers/ControlSizeProvider.tsx
|
|
10020
|
-
function
|
|
10190
|
+
function Ls({ size: e, children: t }) {
|
|
10021
10191
|
return /* @__PURE__ */ _(rn.Provider, {
|
|
10022
10192
|
value: e,
|
|
10023
10193
|
children: t
|
|
@@ -10025,7 +10195,7 @@ function Ts({ size: e, children: t }) {
|
|
|
10025
10195
|
}
|
|
10026
10196
|
//#endregion
|
|
10027
10197
|
//#region src/components/ui/ProgressBar.tsx
|
|
10028
|
-
var
|
|
10198
|
+
var Rs = a(function({ label: e, value: t, min: n = 0, max: r = 100, color: i = "accent", striped: a = !1, animated: o = !1, id: s, className: c, ...l }, d) {
|
|
10029
10199
|
let f = u(), p = s ?? f;
|
|
10030
10200
|
if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) throw RangeError("ProgressBar requires a finite max greater than min");
|
|
10031
10201
|
if (t !== void 0 && !Number.isFinite(t)) throw RangeError("ProgressBar value must be finite");
|
|
@@ -10062,4 +10232,4 @@ var Es = a(function({ label: e, value: t, min: n = 0, max: r = 100, color: i = "
|
|
|
10062
10232
|
});
|
|
10063
10233
|
});
|
|
10064
10234
|
//#endregion
|
|
10065
|
-
export {
|
|
10235
|
+
export { qn as Alert, Pn as AppShell, He as AreaChart, As as AttachmentItem, js as AttachmentList, Jn as AuthCard, Fn as AuthLayout, Yn as AuthorByline, Lt as Avatar, In as BackLink, Qn as Badge, Ge as BarChart, ut as BottomNav, tn as Breadcrumbs, fn as Button, pt as COMMAND_PALETTE_EVENT, zi as Calendar, Ki as CalendarGrid, qi as Card, Is as CharacterCount, zn as Checkbox, $i as CodeInput, Hn as ColumnPicker, ea as Combobox, vt as CommandPalette, Ls as ControlSizeProvider, Ai as DEFAULT_CALENDAR_LABELS, mt as DEFAULT_COMMAND_PALETTE_SHORTCUT, ta as DangerZone, Ns as DatePartsInput, ra as DatePicker, sa as DateRangePicker, pa as DateTimePicker, va as DetailPanel, Pa as Dialog, Fa as DialogActions, Ia as DividerLabel, qe as DonutChart, La as DropdownMenu, Ra as EmptyState, za as ErrorBoundary, Cs as FieldError, Ss as FieldHint, ws as Fieldset, Bn as FilterButton, Ba as FilterDropdown, xs as FormField, Va as Kbd, Ua as LoadingSpinner, Wa as MetadataGrid, Ga as MetricCard, bt as MobileDrawer, Fs as NavTabs, Xa as OAuthButton, Za as PageHeader, Qa as PageSection, Un as Pagination, eo as PaginationBar, no as PasswordInput, ao as PasswordRequirements, oo as ProfileHeader, Rs as ProgressBar, so as ProseContent, co as QrCapacityError, Mo as QrCode, Je as RadarChart, Ye as RadialBarChart, Ds as Radio, ji as RadioPill, Gn as ResourceTable, No as SearchInput, pn as SectionHeader, Po as Select, xn as SelectDropdown, Fo as SettingRow, Mt as SettingsContext, vs as SettingsProvider, Io as SideSheet, $t as Sidebar, Ps as Skeleton, Sn as Slider, Xe as SparkLine, zo as SplitPaneLayout, rt as StackedBarChart, Ho as StatusDot, Uo as StepProgress, Tn as THEME_MENU_EVENT, Wo as Tabs, Ko as TextInput, Go as Textarea, $o as ThemeContext, On as ThemeMenu, Cn as ThemePreview, bs as ThemeProvider, qo as Timeline, Bt as ToastProvider, wn as Toggle, Zo as Toolbar, Xo as Tooltip, Mn as TopBar, Qo as UploadDropzone, ot as VerticalBarChart, At as accentItems, Q as addDays, or as addMinutes, sr as addMonths, tr as calendarDateFromParts, Z as calendarDateParts, G as cn, Xr as createCalendarDateMath, Tt as darkThemes, mr as dateAtMinutes, ro as defaultPasswordRequirements, dr as differenceInDays, jo as encodeQrCode, Ur as expandAvailabilityRules, kt as fontOptions, rs as formatDateLong, ns as formatDateShort, Mr as formatRangeTitle, is as formatRelative, Or as formatTime, gr as formatTimeOfDay, kr as formatTimeRange, vr as fromDateKey, Hr as getActiveResourceIds, wr as getViewRange, Sr as getVisibleDays, ct as handleAppShellNavigate, Yr as isAllDayLike, st as isAppShellPathActive, Ct as isLightTheme, ur as isSameDay, xr as isTimeGridView, Lr as layoutOverlaps, wt as lightThemes, gt as matchesCommandPaletteShortcut, io as meetsPasswordRequirements, fr as minutesOfDay, lt as navigateToPath, ht as openCommandPalette, En as openThemeMenu, hr as parseTime, Nr as rangesOverlap, Tr as shiftDate, br as snapDate, yr as snapMinutes, Wn as sortRows, ar as startOfDay, lr as startOfMonth, cr as startOfWeek, Ot as themeDefaults, xt as themeItems, _r as toDateKey, nn as useApplyTheme, an as useControlSize, jt as useDismiss, ft as useFocusTrap, Nt as useSettings, es as useTheme, zt as useToast };
|