@tempots/beatui 1.7.5 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ar-Wr6gMs-M.cjs → ar-CEzAem0F.cjs} +1 -1
- package/dist/{ar-fdUqbCvM.js → ar-CQieaqsq.js} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/auth-divider-B8yr-E_b.cjs +1 -0
- package/dist/{auth-divider-D9KnNeyF.js → auth-divider-Byh5BWLc.js} +91 -88
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +27 -26
- package/dist/card-BkA7Wvbh.cjs +1 -0
- package/dist/card-DX1DwGbL.js +62 -0
- package/dist/{colors-C2sgnzFH.js → colors-CyMhfbJi.js} +64 -58
- package/dist/{colors-DPCHjRMj.cjs → colors-IXZF9U-s.cjs} +1 -1
- package/dist/control-hqEuMzyI.js +343 -0
- package/dist/control-muup9GF1.cjs +1 -0
- package/dist/custom-validation-BA9iJWl_.cjs +1 -0
- package/dist/custom-validation-BOBoUwHY.js +181 -0
- package/dist/{de-C5-k5Eov.js → de-CBIwvkAH.js} +1 -1
- package/dist/{de-DZqdSEta.cjs → de-DdfxrlT3.cjs} +1 -1
- package/dist/deep-merge-8fwp1z4X.js +1346 -0
- package/dist/deep-merge-VDGE_HQD.cjs +1 -0
- package/dist/duration-input-DmsljXl3.cjs +1 -0
- package/dist/{duration-input-D4V_PHIg.js → duration-input-ZQlcqdXU.js} +32 -31
- package/dist/{editor-toolbar-group-FpOHrmtx.js → editor-toolbar-group-BNTBMJCe.js} +2 -2
- package/dist/{editor-toolbar-group-C_ft_T8D.cjs → editor-toolbar-group-DiMzqYgz.cjs} +1 -1
- package/dist/{es-h6jmoF4X.js → es--9HaEj2D.js} +1 -1
- package/dist/{es-CJgYfRap.cjs → es-DSdljxFJ.cjs} +1 -1
- package/dist/{fa-BuxK837l.js → fa-1Z-akcW7.js} +1 -1
- package/dist/{fa-BQ5PzwNY.cjs → fa-BolmeWRT.cjs} +1 -1
- package/dist/flyout-CuKFh_T7.js +151 -0
- package/dist/flyout-DC_tKaTG.cjs +1 -0
- package/dist/{fr-Bv3TG44U.cjs → fr-CODgUuoZ.cjs} +1 -1
- package/dist/{fr-BwILQ9G2.js → fr-DhHM9rou.js} +1 -1
- package/dist/{he-yC9Sc7JD.js → he-CBamXbGJ.js} +1 -1
- package/dist/{he-5LbvgMCC.cjs → he-Juw-dr28.cjs} +1 -1
- package/dist/{hi-Da7rcCpP.js → hi-DvvcX-Ra.js} +1 -1
- package/dist/{hi-YWhWcG_L.cjs → hi-R749jeg-.cjs} +1 -1
- package/dist/{index-CvU9E9wd.js → index-BfQaT5Jy.js} +104 -104
- package/dist/{index-XogEKwdt.cjs → index-Dv7nPuwA.cjs} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +6713 -9831
- package/dist/{input-container-CyOgiiQD.cjs → input-container-BaWQLWB6.cjs} +1 -1
- package/dist/{input-container-8JFB11xN.js → input-container-DCS5oJ4S.js} +4 -4
- package/dist/{it-BxOIJE45.cjs → it-DT5oRZDH.cjs} +1 -1
- package/dist/{it-Yeklau78.js → it-aV6i8Qxz.js} +1 -1
- package/dist/{ja-Dxj9Q5Yd.js → ja-CuLhGnJX.js} +1 -1
- package/dist/{ja-CNhjK06P.cjs → ja-CwKaCYLB.cjs} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +83 -79
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +2 -2
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +74 -72
- package/dist/{ko-DgkqcXTs.cjs → ko-Bucro9ID.cjs} +1 -1
- package/dist/{ko-gn_MsegK.js → ko-D-66BsEX.js} +1 -1
- package/dist/lexical/index.cjs.js +1 -1
- package/dist/lexical/index.es.js +5 -5
- package/dist/menu-BFLFKceF.cjs +1 -0
- package/dist/menu-BO6zqyfq.js +220 -0
- package/dist/modal-6Mq3vS5r.js +309 -0
- package/dist/modal-d77-TMc4.cjs +1 -0
- package/dist/{nl-vHNFtXXb.js → nl-CAny6wvm.js} +1 -1
- package/dist/{nl-Dy9lmbBO.cjs → nl-D7vHpehb.cjs} +1 -1
- package/dist/notice-BNGx86Yg.js +110 -0
- package/dist/notice-iF6zBMq9.cjs +1 -0
- package/dist/{oneof-branch-detection-Q_jxvJIA.js → oneof-branch-detection-Bm17RhC2.js} +27 -26
- package/dist/oneof-branch-detection-DZ4MrfBp.cjs +1 -0
- package/dist/openui/index.cjs.js +9 -0
- package/dist/openui/index.es.js +2174 -0
- package/dist/password-input-Bipt7Wsu.cjs +1 -0
- package/dist/password-input-mkRmrEPq.js +105 -0
- package/dist/{pl-BtYbtsmG.cjs → pl-CSiXoOKT.cjs} +1 -1
- package/dist/{pl-C0UdHla0.js → pl-rmZLgQ_V.js} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +4 -4
- package/dist/{pt-CtNmqQ1X.cjs → pt-CJT-iq4y.cjs} +1 -1
- package/dist/{pt-DGKtfN0d.js → pt-DHnajqAi.js} +1 -1
- package/dist/{ru-CpXYLt-v.js → ru-C_E8OZNE.js} +1 -1
- package/dist/{ru-BaL_NPRU.cjs → ru-G3sr_ctV.cjs} +1 -1
- package/dist/slider-input-SLguFA0d.cjs +1 -0
- package/dist/slider-input-VYAMm7pE.js +285 -0
- package/dist/stepper-24p16Zsv.cjs +1 -0
- package/dist/stepper-TlzbfYWa.js +3222 -0
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +38 -40
- package/dist/tailwind/vite-plugin.cjs.js +14 -12
- package/dist/tailwind/vite-plugin.es.js +317 -246
- package/dist/text-area-BdemKQ_w.cjs +1 -0
- package/dist/text-area-Br83-_PQ.js +431 -0
- package/dist/{text-input-NJypZSnE.js → text-input-ByuxdX8w.js} +5 -5
- package/dist/{text-input-DS5zlXb2.cjs → text-input-MjlUC_9u.cjs} +1 -1
- package/dist/{toolbar-BF2L6WKC.js → toolbar-CEBTTjHh.js} +1 -1
- package/dist/{toolbar-BBwfe8U9.cjs → toolbar-DWawYFFX.cjs} +1 -1
- package/dist/{tr-DwOd87oB.cjs → tr-DcxLHHTC.cjs} +1 -1
- package/dist/{tr-DIFZDFW_.js → tr-bVXwloKC.js} +1 -1
- package/dist/{translations-EwEmHe3v.cjs → translations-D3xqZUTA.cjs} +1 -1
- package/dist/{translations-BCMP-h52.js → translations-DU9wTV1y.js} +20 -19
- package/dist/{translations-5cXBrENb.js → translations-RT_UN8ny.js} +1 -1
- package/dist/{translations-BqWc0ZHz.cjs → translations-qljG2Chq.cjs} +1 -1
- package/dist/types/components/navigation/stepper.d.ts +4 -4
- package/dist/types/openui/index.d.ts +28 -0
- package/dist/types/openui/library/define-component.d.ts +15 -0
- package/dist/types/openui/library/library.d.ts +7 -0
- package/dist/types/openui/library/prompt-generator.d.ts +5 -0
- package/dist/types/openui/library/types.d.ts +33 -0
- package/dist/types/openui/parser/parser.d.ts +8 -0
- package/dist/types/openui/parser/streaming-parser.d.ts +14 -0
- package/dist/types/openui/parser/tokenizer.d.ts +9 -0
- package/dist/types/openui/parser/types.d.ts +46 -0
- package/dist/types/openui/registry/button.d.ts +148 -0
- package/dist/types/openui/registry/data.d.ts +177 -0
- package/dist/types/openui/registry/form.d.ts +65 -0
- package/dist/types/openui/registry/format.d.ts +67 -0
- package/dist/types/openui/registry/index.d.ts +9 -0
- package/dist/types/openui/registry/layout.d.ts +45 -0
- package/dist/types/openui/registry/navigation.d.ts +149 -0
- package/dist/types/openui/registry/overlay.d.ts +56 -0
- package/dist/types/openui/registry/typography.d.ts +17 -0
- package/dist/types/openui/renderer/action-context.d.ts +24 -0
- package/dist/types/openui/renderer/node-resolver.d.ts +9 -0
- package/dist/types/openui/renderer/openui-renderer.d.ts +32 -0
- package/dist/types/openui/renderer/skeleton.d.ts +2 -0
- package/dist/types/openui/streaming/from-fetch.d.ts +7 -0
- package/dist/types/openui/streaming/from-sse.d.ts +7 -0
- package/dist/types/openui/streaming/from-websocket.d.ts +10 -0
- package/dist/types/openui/streaming/types.d.ts +5 -0
- package/dist/types/tailwind/preset.d.ts +25 -4
- package/dist/types/tailwind/vite-plugin.d.ts +17 -5
- package/dist/types/tokens/colors.d.ts +87 -9
- package/dist/types/tokens/index.d.ts +7 -6
- package/dist/{ur-DBst-TXc.js → ur-Dls2qb4V.js} +1 -1
- package/dist/{ur-D9nLchps.cjs → ur-IRQoHh1E.cjs} +1 -1
- package/dist/use-form-BZ8vDYOv.cjs +2 -0
- package/dist/use-form-DsCzINfm.js +750 -0
- package/dist/utils-D3-NApSw.cjs +1 -0
- package/dist/utils-Nbh7yQ73.js +105 -0
- package/dist/{vi-Dg1aiMr5.cjs → vi-Bi9SvVCP.cjs} +1 -1
- package/dist/{vi-DQOJp32U.js → vi-C3mTzj50.js} +1 -1
- package/dist/widget-customization-BV6XB2v_.cjs +1 -0
- package/dist/widget-customization-Bso45ONQ.js +1198 -0
- package/dist/{zh-DPK4HXl2.js → zh-B4JRJBt2.js} +1 -1
- package/dist/{zh-tbwSTbmn.cjs → zh-BMU5rYu1.cjs} +1 -1
- package/package.json +31 -20
- package/dist/auth-divider-CjcrgXmq.cjs +0 -1
- package/dist/custom-validation-7por5nJN.js +0 -488
- package/dist/custom-validation-CLscGHY4.cjs +0 -1
- package/dist/deep-merge-D90SW1Ci.cjs +0 -1
- package/dist/deep-merge-DT2H9AGq.js +0 -1765
- package/dist/duration-input-4AQnQpyo.cjs +0 -1
- package/dist/menu-B60Q9j3-.cjs +0 -1
- package/dist/menu-BkqFGcXg.js +0 -366
- package/dist/notice-CQGJyZ8o.js +0 -211
- package/dist/notice-p2IqXS5-.cjs +0 -1
- package/dist/oneof-branch-detection-xDDDdYRk.cjs +0 -1
- package/dist/use-form-8NnZ-KHk.js +0 -1090
- package/dist/use-form-Dcra7GeE.cjs +0 -2
- package/dist/utils-DmEuG3Np.cjs +0 -1
- package/dist/utils-vUtP6iPG.js +0 -165
- package/dist/widget-customization-BIBva3f-.js +0 -1458
- package/dist/widget-customization-pqmtsraC.cjs +0 -1
|
@@ -0,0 +1,3222 @@
|
|
|
1
|
+
import { Value as m, html as d, attr as s, computedOf as k, Ensure as ct, prop as V, When as I, WithElement as q, OnDispose as tt, Empty as N, Use as R, aria as D, on as T, ForEach as Q, style as dt, Repeat as Ct, Fragment as Y, svg as bt, svgAttr as gt, input as xt, emitValue as at, dataAttr as $t, Provide as Mt, makeProviderMark as Pt } from "@tempots/dom";
|
|
2
|
+
import { I as U, b as F, B as J, h as z, t as j, a as W, L as et, f as Ut } from "./translations-DU9wTV1y.js";
|
|
3
|
+
import { g as P } from "./colors-CyMhfbJi.js";
|
|
4
|
+
import { B as st, a as Gt } from "./input-container-DCS5oJ4S.js";
|
|
5
|
+
import { delayedAnimationFrame as ut } from "@tempots/std";
|
|
6
|
+
import { F as wt } from "./flyout-CuKFh_T7.js";
|
|
7
|
+
import { s as K } from "./session-id-3KiilioY.js";
|
|
8
|
+
import { C as Vt } from "./text-input-ByuxdX8w.js";
|
|
9
|
+
import { O as Nt, F as Ht } from "./modal-6Mq3vS5r.js";
|
|
10
|
+
import { u as Dt } from "./use-animated-toggle-C3asw_Sg.js";
|
|
11
|
+
import { C as Wt } from "./control-hqEuMzyI.js";
|
|
12
|
+
import { S as Zt } from "./stack-BLMteGTn.js";
|
|
13
|
+
import { ElementRect as qt, Anchor as St, Location as Lt } from "@tempots/ui";
|
|
14
|
+
const Kt = {
|
|
15
|
+
xs: "xs",
|
|
16
|
+
sm: "sm",
|
|
17
|
+
md: "md",
|
|
18
|
+
lg: "lg",
|
|
19
|
+
xl: "xl",
|
|
20
|
+
"2xl": "xl"
|
|
21
|
+
};
|
|
22
|
+
function Jt(e) {
|
|
23
|
+
const t = e.trim().split(/\s+/);
|
|
24
|
+
return t.length === 1 ? t[0][0].toUpperCase() : (t[0][0] + t[t.length - 1][0]).toUpperCase();
|
|
25
|
+
}
|
|
26
|
+
function Qt(e) {
|
|
27
|
+
const t = F(e, "solid", "light"), a = F(e, "solid", "dark");
|
|
28
|
+
return [
|
|
29
|
+
`--avatar-bg: ${t.backgroundColor}`,
|
|
30
|
+
`--avatar-text: ${t.textColor}`,
|
|
31
|
+
`--avatar-bg-dark: ${a.backgroundColor}`,
|
|
32
|
+
`--avatar-text-dark: ${a.textColor}`
|
|
33
|
+
].join("; ");
|
|
34
|
+
}
|
|
35
|
+
function Xt(e, t, a) {
|
|
36
|
+
const n = [
|
|
37
|
+
"bc-avatar",
|
|
38
|
+
`bc-avatar--size-${e}`,
|
|
39
|
+
`bc-avatar--${t}`
|
|
40
|
+
];
|
|
41
|
+
return a && n.push("bc-avatar--bordered"), n.join(" ");
|
|
42
|
+
}
|
|
43
|
+
function la({
|
|
44
|
+
src: e,
|
|
45
|
+
name: t,
|
|
46
|
+
icon: a,
|
|
47
|
+
size: n = "md",
|
|
48
|
+
variant: r = "circle",
|
|
49
|
+
color: c = "base",
|
|
50
|
+
bordered: o = !1,
|
|
51
|
+
borderColor: i
|
|
52
|
+
}, ...l) {
|
|
53
|
+
const u = m.map(
|
|
54
|
+
m.toSignal(n),
|
|
55
|
+
(f) => Kt[f ?? "md"]
|
|
56
|
+
), b = d.span(
|
|
57
|
+
s.class("bc-avatar__icon"),
|
|
58
|
+
U({ icon: "mdi:account", size: u })
|
|
59
|
+
);
|
|
60
|
+
return d.div(
|
|
61
|
+
s.class(
|
|
62
|
+
k(
|
|
63
|
+
n,
|
|
64
|
+
r,
|
|
65
|
+
o,
|
|
66
|
+
i
|
|
67
|
+
)(
|
|
68
|
+
(f, g, p, h) => Xt(
|
|
69
|
+
f ?? "md",
|
|
70
|
+
g ?? "circle",
|
|
71
|
+
(p ?? !1) || h != null
|
|
72
|
+
)
|
|
73
|
+
)
|
|
74
|
+
),
|
|
75
|
+
s.style(
|
|
76
|
+
k(
|
|
77
|
+
c,
|
|
78
|
+
i
|
|
79
|
+
)((f, g) => {
|
|
80
|
+
const p = Qt(f ?? "base");
|
|
81
|
+
if (g == null) return p;
|
|
82
|
+
const h = P(g, 500), v = P(g, 400);
|
|
83
|
+
return `${p}; --avatar-border-color: ${h}; --avatar-border-color-dark: ${v}`;
|
|
84
|
+
})
|
|
85
|
+
),
|
|
86
|
+
// Fallback chain: src → name (initials) → icon → default icon
|
|
87
|
+
ct(
|
|
88
|
+
e,
|
|
89
|
+
(f) => d.img(
|
|
90
|
+
s.class("bc-avatar__image"),
|
|
91
|
+
s.src(f),
|
|
92
|
+
s.alt(
|
|
93
|
+
t != null ? m.map(t, (g) => g ?? "Avatar") : "Avatar"
|
|
94
|
+
)
|
|
95
|
+
),
|
|
96
|
+
() => ct(
|
|
97
|
+
t,
|
|
98
|
+
(f) => d.span(
|
|
99
|
+
s.class("bc-avatar__initials"),
|
|
100
|
+
f.map(Jt)
|
|
101
|
+
),
|
|
102
|
+
() => ct(
|
|
103
|
+
a,
|
|
104
|
+
(f) => d.span(
|
|
105
|
+
s.class("bc-avatar__icon"),
|
|
106
|
+
U({ icon: f, size: u })
|
|
107
|
+
),
|
|
108
|
+
() => b
|
|
109
|
+
)
|
|
110
|
+
)
|
|
111
|
+
),
|
|
112
|
+
...l
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
function Yt(e) {
|
|
116
|
+
const t = F(e, "solid", "light"), a = F(e, "solid", "dark");
|
|
117
|
+
return [
|
|
118
|
+
`--avatar-bg: ${t.backgroundColor}`,
|
|
119
|
+
`--avatar-text: ${t.textColor}`,
|
|
120
|
+
`--avatar-bg-dark: ${a.backgroundColor}`,
|
|
121
|
+
`--avatar-text-dark: ${a.textColor}`
|
|
122
|
+
].join("; ");
|
|
123
|
+
}
|
|
124
|
+
function da({ size: e = "md", spacing: t = "tight" }, ...a) {
|
|
125
|
+
return d.div(
|
|
126
|
+
s.class(
|
|
127
|
+
k(
|
|
128
|
+
e,
|
|
129
|
+
t
|
|
130
|
+
)(
|
|
131
|
+
(n, r) => [
|
|
132
|
+
"bc-avatar-group",
|
|
133
|
+
`bc-avatar-group--size-${n ?? "md"}`,
|
|
134
|
+
`bc-avatar-group--spacing-${r ?? "tight"}`
|
|
135
|
+
].join(" ")
|
|
136
|
+
)
|
|
137
|
+
),
|
|
138
|
+
...a
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
function ua({
|
|
142
|
+
count: e,
|
|
143
|
+
size: t = "md",
|
|
144
|
+
color: a = "base"
|
|
145
|
+
}) {
|
|
146
|
+
return d.div(
|
|
147
|
+
s.class(
|
|
148
|
+
m.map(
|
|
149
|
+
t,
|
|
150
|
+
(n) => [
|
|
151
|
+
"bc-avatar",
|
|
152
|
+
`bc-avatar--size-${n ?? "md"}`,
|
|
153
|
+
"bc-avatar--circle",
|
|
154
|
+
"bc-avatar-group__overflow"
|
|
155
|
+
].join(" ")
|
|
156
|
+
)
|
|
157
|
+
),
|
|
158
|
+
s.style(
|
|
159
|
+
m.map(
|
|
160
|
+
a,
|
|
161
|
+
(n) => Yt(n ?? "base")
|
|
162
|
+
)
|
|
163
|
+
),
|
|
164
|
+
d.span(
|
|
165
|
+
s.class("bc-avatar__initials"),
|
|
166
|
+
m.map(e, (n) => `+${n ?? 0}`)
|
|
167
|
+
)
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
const pt = { min: 0, max: 360 }, ft = { min: 50, max: 80 }, mt = { min: 40, max: 65 };
|
|
171
|
+
function te(e) {
|
|
172
|
+
let t = 5381;
|
|
173
|
+
for (let a = 0; a < e.length; a++)
|
|
174
|
+
t = (t << 5) + t + e.charCodeAt(a) | 0;
|
|
175
|
+
return t >>> 0;
|
|
176
|
+
}
|
|
177
|
+
function lt(e, t, a, n) {
|
|
178
|
+
const r = (e * 2654435761 + t * 2246822519 >>> 0) % 1e4;
|
|
179
|
+
return a + r / 1e4 * (n - a);
|
|
180
|
+
}
|
|
181
|
+
function ee(e) {
|
|
182
|
+
return e > 56 ? "#000" : "#fff";
|
|
183
|
+
}
|
|
184
|
+
function ae(e, t, a, n) {
|
|
185
|
+
const r = e.trim();
|
|
186
|
+
if (r === "") return "";
|
|
187
|
+
const c = te(r), o = lt(c, 1, t.min, t.max), i = lt(c, 2, a.min, a.max), l = lt(c, 3, n.min, n.max), u = ee(l);
|
|
188
|
+
return `background-color: hsl(${o.toFixed(1)} ${i.toFixed(1)}% ${l.toFixed(1)}%); color: ${u}`;
|
|
189
|
+
}
|
|
190
|
+
function se(e, t) {
|
|
191
|
+
return [
|
|
192
|
+
"bc-auto-color-badge",
|
|
193
|
+
`bc-badge--size-${e}`,
|
|
194
|
+
`bc-control--rounded-${t}`
|
|
195
|
+
].join(" ");
|
|
196
|
+
}
|
|
197
|
+
function ba(e = {}, ...t) {
|
|
198
|
+
const {
|
|
199
|
+
size: a = "md",
|
|
200
|
+
roundedness: n = "full",
|
|
201
|
+
text: r,
|
|
202
|
+
hue: c = pt,
|
|
203
|
+
saturation: o = ft,
|
|
204
|
+
lightness: i = mt
|
|
205
|
+
} = e, l = r ?? V(""), u = k(
|
|
206
|
+
l,
|
|
207
|
+
c,
|
|
208
|
+
o,
|
|
209
|
+
i
|
|
210
|
+
)(
|
|
211
|
+
(b, f, g, p) => ae(
|
|
212
|
+
b ?? "",
|
|
213
|
+
f ?? pt,
|
|
214
|
+
g ?? ft,
|
|
215
|
+
p ?? mt
|
|
216
|
+
)
|
|
217
|
+
);
|
|
218
|
+
return d.span(
|
|
219
|
+
s.class(
|
|
220
|
+
k(
|
|
221
|
+
a,
|
|
222
|
+
n
|
|
223
|
+
)((b, f) => se(b ?? "md", f ?? "full"))
|
|
224
|
+
),
|
|
225
|
+
s.style(u),
|
|
226
|
+
d.span(s.class("bc-badge__content"), ...t),
|
|
227
|
+
// Only observe DOM mutations when no explicit text is provided
|
|
228
|
+
I(
|
|
229
|
+
m.map(r, (b) => b == null),
|
|
230
|
+
() => q((b) => {
|
|
231
|
+
const f = l;
|
|
232
|
+
f.set(b.textContent ?? "");
|
|
233
|
+
const g = new MutationObserver(() => {
|
|
234
|
+
f.set(b.textContent ?? "");
|
|
235
|
+
});
|
|
236
|
+
return g.observe(b, {
|
|
237
|
+
childList: !0,
|
|
238
|
+
subtree: !0,
|
|
239
|
+
characterData: !0
|
|
240
|
+
}), tt(() => g.disconnect());
|
|
241
|
+
})
|
|
242
|
+
)
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
function re(e, t, a, n, r) {
|
|
246
|
+
const c = [
|
|
247
|
+
"bc-badge",
|
|
248
|
+
`bc-badge--size-${e}`,
|
|
249
|
+
`bc-control--rounded-${t}`
|
|
250
|
+
];
|
|
251
|
+
return a && c.push("bc-badge--circle"), n && c.push("bc-badge--full-width"), r && c.push("bc-badge--disabled"), c.join(" ");
|
|
252
|
+
}
|
|
253
|
+
function ne(e, t) {
|
|
254
|
+
const a = /* @__PURE__ */ new Map(), n = (r, c, o, i) => {
|
|
255
|
+
a.set("--badge-bg-hover", r), a.set("--badge-text-hover", o), a.set("--badge-bg-hover-dark", c), a.set("--badge-text-hover-dark", i);
|
|
256
|
+
};
|
|
257
|
+
switch (e) {
|
|
258
|
+
case "filled": {
|
|
259
|
+
const r = F(t, "solid", "light"), c = F(t, "solid", "dark"), o = z(t, "soft", "light"), i = z(t, "soft", "dark");
|
|
260
|
+
a.set("--badge-bg", r.backgroundColor), a.set("--badge-text", r.textColor), a.set("--badge-bg-dark", c.backgroundColor), a.set("--badge-text-dark", c.textColor), a.set("--badge-border", "transparent"), a.set("--badge-border-dark", "transparent"), n(
|
|
261
|
+
o.backgroundColor,
|
|
262
|
+
i.backgroundColor,
|
|
263
|
+
o.textColor,
|
|
264
|
+
i.textColor
|
|
265
|
+
);
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
case "light": {
|
|
269
|
+
const r = F(t, "light", "light"), c = F(t, "light", "dark"), o = z(t, "light", "light"), i = z(t, "light", "dark");
|
|
270
|
+
a.set("--badge-bg", r.backgroundColor), a.set("--badge-text", r.textColor), a.set("--badge-bg-dark", c.backgroundColor), a.set("--badge-text-dark", c.textColor), a.set("--badge-border", "transparent"), a.set("--badge-border-dark", "transparent"), n(
|
|
271
|
+
o.backgroundColor,
|
|
272
|
+
i.backgroundColor,
|
|
273
|
+
o.textColor,
|
|
274
|
+
i.textColor
|
|
275
|
+
);
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
case "outline": {
|
|
279
|
+
const r = j(t, "light"), c = j(t, "dark"), o = W(t, "light"), i = W(t, "dark"), l = z(t, "light", "light"), u = z(t, "light", "dark");
|
|
280
|
+
a.set("--badge-bg", "transparent"), a.set("--badge-text", r), a.set("--badge-bg-dark", "transparent"), a.set("--badge-text-dark", c), a.set("--badge-border", o), a.set("--badge-border-dark", i), n(
|
|
281
|
+
l.backgroundColor,
|
|
282
|
+
u.backgroundColor,
|
|
283
|
+
l.textColor,
|
|
284
|
+
u.textColor
|
|
285
|
+
);
|
|
286
|
+
break;
|
|
287
|
+
}
|
|
288
|
+
case "default": {
|
|
289
|
+
const r = j(t, "light"), c = j(t, "dark"), o = z(t, "light", "light"), i = z(t, "light", "dark");
|
|
290
|
+
a.set("--badge-bg", "var(--bg-background-light)"), a.set("--badge-text", r), a.set("--badge-bg-dark", "var(--bg-background-dark)"), a.set("--badge-text-dark", c), a.set("--badge-border", "var(--border-border-light)"), a.set("--badge-border-dark", "var(--border-border-dark)"), n(
|
|
291
|
+
o.backgroundColor,
|
|
292
|
+
i.backgroundColor,
|
|
293
|
+
o.textColor,
|
|
294
|
+
i.textColor
|
|
295
|
+
);
|
|
296
|
+
break;
|
|
297
|
+
}
|
|
298
|
+
case "dashed": {
|
|
299
|
+
const r = j(t, "light"), c = j(t, "dark"), o = W(t, "light"), i = W(t, "dark"), l = z(t, "light", "light"), u = z(t, "light", "dark");
|
|
300
|
+
a.set("--badge-bg", "transparent"), a.set("--badge-text", r), a.set("--badge-bg-dark", "transparent"), a.set("--badge-text-dark", c), a.set("--badge-border", o), a.set("--badge-border-dark", i), a.set("--badge-border-style", "dashed"), n(
|
|
301
|
+
l.backgroundColor,
|
|
302
|
+
u.backgroundColor,
|
|
303
|
+
l.textColor,
|
|
304
|
+
u.textColor
|
|
305
|
+
);
|
|
306
|
+
break;
|
|
307
|
+
}
|
|
308
|
+
case "subtle": {
|
|
309
|
+
const r = j(t, "light"), c = j(t, "dark"), o = z(t, "light", "light"), i = z(t, "light", "dark");
|
|
310
|
+
a.set("--badge-bg", "transparent"), a.set("--badge-text", r), a.set("--badge-bg-dark", "transparent"), a.set("--badge-text-dark", c), a.set("--badge-border", "transparent"), a.set("--badge-border-dark", "transparent"), n(
|
|
311
|
+
o.backgroundColor,
|
|
312
|
+
i.backgroundColor,
|
|
313
|
+
o.textColor,
|
|
314
|
+
i.textColor
|
|
315
|
+
);
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
case "text": {
|
|
319
|
+
const r = j(t, "light"), c = j(t, "dark"), o = z(t, "light", "light"), i = z(t, "light", "dark");
|
|
320
|
+
a.set("--badge-bg", "transparent"), a.set("--badge-text", r), a.set("--badge-bg-dark", "transparent"), a.set("--badge-text-dark", c), a.set("--badge-border", "transparent"), a.set("--badge-border-dark", "transparent"), n(
|
|
321
|
+
o.backgroundColor,
|
|
322
|
+
i.backgroundColor,
|
|
323
|
+
o.textColor,
|
|
324
|
+
i.textColor
|
|
325
|
+
);
|
|
326
|
+
break;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return Array.from(a.entries()).map(([r, c]) => `${r}: ${c}`).join("; ");
|
|
330
|
+
}
|
|
331
|
+
function ga({
|
|
332
|
+
variant: e = "filled",
|
|
333
|
+
size: t = "md",
|
|
334
|
+
color: a = "base",
|
|
335
|
+
roundedness: n = "full",
|
|
336
|
+
circle: r = !1,
|
|
337
|
+
fullWidth: c = !1,
|
|
338
|
+
onClose: o,
|
|
339
|
+
disabled: i = !1
|
|
340
|
+
}, ...l) {
|
|
341
|
+
return d.span(
|
|
342
|
+
s.class(
|
|
343
|
+
k(
|
|
344
|
+
t,
|
|
345
|
+
n,
|
|
346
|
+
r,
|
|
347
|
+
c,
|
|
348
|
+
i
|
|
349
|
+
)(
|
|
350
|
+
(u, b, f, g, p) => re(
|
|
351
|
+
u ?? "md",
|
|
352
|
+
b ?? "sm",
|
|
353
|
+
f ?? !1,
|
|
354
|
+
g ?? !1,
|
|
355
|
+
p ?? !1
|
|
356
|
+
)
|
|
357
|
+
)
|
|
358
|
+
),
|
|
359
|
+
s.style(
|
|
360
|
+
k(
|
|
361
|
+
e,
|
|
362
|
+
a
|
|
363
|
+
)(
|
|
364
|
+
(u, b) => ne(
|
|
365
|
+
u ?? "filled",
|
|
366
|
+
b ?? "base"
|
|
367
|
+
)
|
|
368
|
+
)
|
|
369
|
+
),
|
|
370
|
+
d.span(s.class("bc-badge__content"), ...l),
|
|
371
|
+
o != null ? R(
|
|
372
|
+
J,
|
|
373
|
+
(u) => d.button(
|
|
374
|
+
s.class("bc-badge__close"),
|
|
375
|
+
s.type("button"),
|
|
376
|
+
s.disabled(i),
|
|
377
|
+
D.label(u.$.removeItem),
|
|
378
|
+
T.click((b) => {
|
|
379
|
+
b.stopPropagation(), o();
|
|
380
|
+
}),
|
|
381
|
+
// × character as lightweight close indicator
|
|
382
|
+
"×"
|
|
383
|
+
)
|
|
384
|
+
) : N
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
function pa(e) {
|
|
388
|
+
const { entries: t, filters: a } = e, n = V("all"), r = k(
|
|
389
|
+
t,
|
|
390
|
+
n
|
|
391
|
+
)((i, l) => l === "all" ? i : i.filter((u) => {
|
|
392
|
+
const b = u.action.toLowerCase();
|
|
393
|
+
switch (l) {
|
|
394
|
+
case "deletions":
|
|
395
|
+
return b.includes("delet");
|
|
396
|
+
case "edits":
|
|
397
|
+
return b.includes("edit");
|
|
398
|
+
case "schema":
|
|
399
|
+
return b.includes("schema");
|
|
400
|
+
case "restorable":
|
|
401
|
+
return u.restorable === !0;
|
|
402
|
+
default:
|
|
403
|
+
return !0;
|
|
404
|
+
}
|
|
405
|
+
})), o = a ?? [
|
|
406
|
+
{ value: "all", label: "All" },
|
|
407
|
+
{ value: "deletions", label: "Deletions" },
|
|
408
|
+
{ value: "edits", label: "Edits" },
|
|
409
|
+
{ value: "schema", label: "Schema changes" },
|
|
410
|
+
{ value: "restorable", label: "Restorable" }
|
|
411
|
+
];
|
|
412
|
+
return d.div(
|
|
413
|
+
s.class("bc-history-timeline"),
|
|
414
|
+
// Filter chips
|
|
415
|
+
d.div(
|
|
416
|
+
s.class("bc-history-timeline__filters"),
|
|
417
|
+
...o.map(
|
|
418
|
+
(i) => d.button(
|
|
419
|
+
s.type("button"),
|
|
420
|
+
s.class(
|
|
421
|
+
k(n)(
|
|
422
|
+
(l) => l === i.value ? "bc-history-timeline__filter bc-history-timeline__filter--active" : "bc-history-timeline__filter"
|
|
423
|
+
)
|
|
424
|
+
),
|
|
425
|
+
T.click(() => n.set(i.value)),
|
|
426
|
+
i.label
|
|
427
|
+
)
|
|
428
|
+
)
|
|
429
|
+
),
|
|
430
|
+
// Timeline entries
|
|
431
|
+
d.div(
|
|
432
|
+
s.class("bc-history-timeline__list"),
|
|
433
|
+
Q(r, (i) => d.div(
|
|
434
|
+
s.class("bc-history-timeline__entry"),
|
|
435
|
+
// Timeline dot + line
|
|
436
|
+
d.div(
|
|
437
|
+
s.class("bc-history-timeline__line"),
|
|
438
|
+
d.div(
|
|
439
|
+
s.class("bc-history-timeline__dot"),
|
|
440
|
+
s.style(i.map((l) => `background: ${l.actionColor}`))
|
|
441
|
+
)
|
|
442
|
+
),
|
|
443
|
+
// Entry content
|
|
444
|
+
d.div(
|
|
445
|
+
s.class("bc-history-timeline__content"),
|
|
446
|
+
d.div(
|
|
447
|
+
s.class("bc-history-timeline__content-header"),
|
|
448
|
+
d.span(
|
|
449
|
+
s.class("bc-history-timeline__action"),
|
|
450
|
+
s.style(i.map((l) => `color: ${l.actionColor}`)),
|
|
451
|
+
i.$.action
|
|
452
|
+
),
|
|
453
|
+
d.span(s.class("bc-history-timeline__time"), i.$.time)
|
|
454
|
+
),
|
|
455
|
+
d.div(
|
|
456
|
+
s.class("bc-history-timeline__target"),
|
|
457
|
+
U({ icon: i.$.targetIcon, size: "xs" }),
|
|
458
|
+
d.span(i.$.target)
|
|
459
|
+
),
|
|
460
|
+
d.div(s.class("bc-history-timeline__detail"), i.$.detail),
|
|
461
|
+
d.div(
|
|
462
|
+
s.class("bc-history-timeline__footer"),
|
|
463
|
+
d.div(
|
|
464
|
+
s.class("bc-history-timeline__actor"),
|
|
465
|
+
d.div(
|
|
466
|
+
s.class("bc-history-timeline__avatar"),
|
|
467
|
+
i.$.actor.$.initials
|
|
468
|
+
),
|
|
469
|
+
d.span(i.$.actor.$.name)
|
|
470
|
+
),
|
|
471
|
+
I(
|
|
472
|
+
i.map((l) => l.restorable === !0 && l.onRestore != null),
|
|
473
|
+
() => st(
|
|
474
|
+
{
|
|
475
|
+
variant: "outline",
|
|
476
|
+
size: "xs",
|
|
477
|
+
onClick: () => i.value.onRestore?.()
|
|
478
|
+
},
|
|
479
|
+
U({ icon: "lucide:rotate-ccw", size: "xs" }),
|
|
480
|
+
"Restore"
|
|
481
|
+
)
|
|
482
|
+
)
|
|
483
|
+
)
|
|
484
|
+
)
|
|
485
|
+
)),
|
|
486
|
+
// Empty state
|
|
487
|
+
I(
|
|
488
|
+
k(r)((i) => i.length === 0),
|
|
489
|
+
() => d.div(
|
|
490
|
+
s.class("bc-history-timeline__empty"),
|
|
491
|
+
"No matching history entries"
|
|
492
|
+
)
|
|
493
|
+
)
|
|
494
|
+
)
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
function oe(e, t, a) {
|
|
498
|
+
const n = [
|
|
499
|
+
"bc-indicator__badge",
|
|
500
|
+
`bc-indicator--${e}`,
|
|
501
|
+
`bc-indicator--size-${t}`
|
|
502
|
+
];
|
|
503
|
+
return a ? n.push("bc-indicator--dot") : n.push("bc-indicator--count"), n.join(" ");
|
|
504
|
+
}
|
|
505
|
+
function ie(e) {
|
|
506
|
+
const t = F(e, "solid", "light"), a = F(e, "solid", "dark");
|
|
507
|
+
return [
|
|
508
|
+
`--indicator-bg: ${t.backgroundColor}`,
|
|
509
|
+
`--indicator-text: ${t.textColor}`,
|
|
510
|
+
`--indicator-bg-dark: ${a.backgroundColor}`,
|
|
511
|
+
`--indicator-text-dark: ${a.textColor}`
|
|
512
|
+
].join("; ");
|
|
513
|
+
}
|
|
514
|
+
function fa({
|
|
515
|
+
show: e = !0,
|
|
516
|
+
count: t,
|
|
517
|
+
maxCount: a = 9,
|
|
518
|
+
color: n = "danger",
|
|
519
|
+
placement: r = "top-right",
|
|
520
|
+
size: c = "sm"
|
|
521
|
+
}, ...o) {
|
|
522
|
+
const i = k(
|
|
523
|
+
e,
|
|
524
|
+
t ?? 0
|
|
525
|
+
)((b, f) => (b ?? !0) || f > 0), l = k(t ?? 0)((b) => b <= 0), u = k(
|
|
526
|
+
t ?? 0,
|
|
527
|
+
a
|
|
528
|
+
)((b, f) => b <= 0 ? "" : b > (f ?? 9) ? `${f ?? 9}+` : String(b));
|
|
529
|
+
return d.span(
|
|
530
|
+
s.class("bc-indicator"),
|
|
531
|
+
...o,
|
|
532
|
+
I(
|
|
533
|
+
i,
|
|
534
|
+
() => d.span(
|
|
535
|
+
s.class(
|
|
536
|
+
k(
|
|
537
|
+
r,
|
|
538
|
+
c,
|
|
539
|
+
l
|
|
540
|
+
)(
|
|
541
|
+
(b, f, g) => oe(
|
|
542
|
+
b ?? "top-right",
|
|
543
|
+
f ?? "sm",
|
|
544
|
+
g ?? !0
|
|
545
|
+
)
|
|
546
|
+
)
|
|
547
|
+
),
|
|
548
|
+
s.style(
|
|
549
|
+
k(n)(
|
|
550
|
+
(b) => ie(b ?? "danger")
|
|
551
|
+
)
|
|
552
|
+
),
|
|
553
|
+
u
|
|
554
|
+
)
|
|
555
|
+
)
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
function ce(e, t, a) {
|
|
559
|
+
const n = [
|
|
560
|
+
"bc-progress-bar",
|
|
561
|
+
`bc-progress-bar--size-${e}`,
|
|
562
|
+
`bc-control--rounded-${a}`
|
|
563
|
+
];
|
|
564
|
+
return t && n.push("bc-progress-bar--indeterminate"), n.join(" ");
|
|
565
|
+
}
|
|
566
|
+
function le(e) {
|
|
567
|
+
const t = /* @__PURE__ */ new Map(), a = F(e, "solid", "light"), n = F(e, "solid", "dark");
|
|
568
|
+
return t.set("--progress-fill", a.backgroundColor), t.set("--progress-fill-dark", n.backgroundColor), Array.from(t.entries()).map(([r, c]) => `${r}: ${c}`).join("; ");
|
|
569
|
+
}
|
|
570
|
+
function ma({
|
|
571
|
+
value: e = 0,
|
|
572
|
+
max: t = 100,
|
|
573
|
+
size: a = "md",
|
|
574
|
+
color: n = "primary",
|
|
575
|
+
indeterminate: r = !1,
|
|
576
|
+
showLabel: c = !1,
|
|
577
|
+
roundedness: o = "full"
|
|
578
|
+
}) {
|
|
579
|
+
const i = k(
|
|
580
|
+
e,
|
|
581
|
+
t
|
|
582
|
+
)((b, f) => {
|
|
583
|
+
const g = b ?? 0, p = f ?? 100;
|
|
584
|
+
return p > 0 ? Math.min(Math.max(g / p * 100, 0), 100) : 0;
|
|
585
|
+
}), l = m.map(i, (b) => `${Math.round(b)}%`), u = k(
|
|
586
|
+
i,
|
|
587
|
+
r
|
|
588
|
+
)((b, f) => f ?? !1 ? "" : `${b}%`);
|
|
589
|
+
return d.div(
|
|
590
|
+
s.class("bc-progress-bar-wrapper"),
|
|
591
|
+
d.div(
|
|
592
|
+
s.class(
|
|
593
|
+
k(
|
|
594
|
+
a,
|
|
595
|
+
r,
|
|
596
|
+
o
|
|
597
|
+
)(
|
|
598
|
+
(b, f, g) => ce(b ?? "md", f ?? !1, g ?? "full")
|
|
599
|
+
)
|
|
600
|
+
),
|
|
601
|
+
s.style(
|
|
602
|
+
m.map(
|
|
603
|
+
n,
|
|
604
|
+
(b) => le(b ?? "primary")
|
|
605
|
+
)
|
|
606
|
+
),
|
|
607
|
+
s.role("progressbar"),
|
|
608
|
+
D.valuemin(0),
|
|
609
|
+
D.valuemax(t),
|
|
610
|
+
D.valuenow(e),
|
|
611
|
+
D.valuetext(l),
|
|
612
|
+
d.div(
|
|
613
|
+
s.class("bc-progress-bar__track"),
|
|
614
|
+
d.div(s.class("bc-progress-bar__fill"), dt.width(u))
|
|
615
|
+
)
|
|
616
|
+
),
|
|
617
|
+
// Optional label
|
|
618
|
+
I(
|
|
619
|
+
c,
|
|
620
|
+
() => d.div(
|
|
621
|
+
s.class("bc-progress-bar__label"),
|
|
622
|
+
D.hidden(!0),
|
|
623
|
+
l
|
|
624
|
+
),
|
|
625
|
+
() => {
|
|
626
|
+
}
|
|
627
|
+
)
|
|
628
|
+
);
|
|
629
|
+
}
|
|
630
|
+
function ht(e, t, a) {
|
|
631
|
+
const n = [
|
|
632
|
+
"bc-skeleton",
|
|
633
|
+
`bc-skeleton--${e}`,
|
|
634
|
+
`bc-control--rounded-${a}`
|
|
635
|
+
];
|
|
636
|
+
return t && n.push("bc-skeleton--animate"), e === "circle" && n.push("bc-skeleton--circle"), n.join(" ");
|
|
637
|
+
}
|
|
638
|
+
function de(e, t, a) {
|
|
639
|
+
const n = [];
|
|
640
|
+
return e !== void 0 && n.push(`width: ${e}`), t !== void 0 ? n.push(`height: ${t}`) : a === "text" ? n.push("height: 1em") : a === "circle" && e !== void 0 && n.push(`height: ${e}`), n.join("; ");
|
|
641
|
+
}
|
|
642
|
+
function ha({
|
|
643
|
+
variant: e = "text",
|
|
644
|
+
width: t,
|
|
645
|
+
height: a,
|
|
646
|
+
lines: n = 1,
|
|
647
|
+
animate: r = !0,
|
|
648
|
+
roundedness: c = "sm"
|
|
649
|
+
}) {
|
|
650
|
+
const o = k(
|
|
651
|
+
e,
|
|
652
|
+
n
|
|
653
|
+
)((i, l) => i === "text" && (l ?? 1) > 1);
|
|
654
|
+
return I(
|
|
655
|
+
o,
|
|
656
|
+
// Multi-line text skeleton
|
|
657
|
+
() => d.div(
|
|
658
|
+
s.class("bc-skeleton__lines-container"),
|
|
659
|
+
Ct(
|
|
660
|
+
n,
|
|
661
|
+
(i) => d.div(
|
|
662
|
+
s.class(
|
|
663
|
+
k(
|
|
664
|
+
r,
|
|
665
|
+
c
|
|
666
|
+
)(
|
|
667
|
+
(l, u) => ht("text", l ?? !0, u ?? "sm") + " bc-skeleton__line"
|
|
668
|
+
)
|
|
669
|
+
),
|
|
670
|
+
dt.width(
|
|
671
|
+
k(
|
|
672
|
+
i.isLast,
|
|
673
|
+
t
|
|
674
|
+
)(
|
|
675
|
+
(l, u) => l && u === void 0 ? "80%" : u !== void 0 ? u : ""
|
|
676
|
+
)
|
|
677
|
+
)
|
|
678
|
+
)
|
|
679
|
+
)
|
|
680
|
+
),
|
|
681
|
+
// Single skeleton element
|
|
682
|
+
() => d.div(
|
|
683
|
+
s.class(
|
|
684
|
+
k(
|
|
685
|
+
e,
|
|
686
|
+
r,
|
|
687
|
+
c
|
|
688
|
+
)(
|
|
689
|
+
(i, l, u) => ht(i ?? "text", l ?? !0, u ?? "sm")
|
|
690
|
+
)
|
|
691
|
+
),
|
|
692
|
+
s.style(
|
|
693
|
+
k(
|
|
694
|
+
t,
|
|
695
|
+
a,
|
|
696
|
+
e
|
|
697
|
+
)((i, l, u) => de(i, l, u ?? "text"))
|
|
698
|
+
),
|
|
699
|
+
D.hidden(!0)
|
|
700
|
+
)
|
|
701
|
+
);
|
|
702
|
+
}
|
|
703
|
+
function ue(e, t, a) {
|
|
704
|
+
const n = [], r = Math.max(1, e - a), c = Math.min(t, e + a);
|
|
705
|
+
r > 1 && (n.push(1), r > 2 && n.push("dots"));
|
|
706
|
+
for (let o = r; o <= c; o++)
|
|
707
|
+
n.push(o);
|
|
708
|
+
return c < t && (c < t - 1 && n.push("dots"), n.push(t)), n;
|
|
709
|
+
}
|
|
710
|
+
function be(e, t) {
|
|
711
|
+
const a = /* @__PURE__ */ new Map();
|
|
712
|
+
switch (e) {
|
|
713
|
+
case "filled":
|
|
714
|
+
case "pill": {
|
|
715
|
+
const c = F(t, "solid", "light"), o = F(t, "solid", "dark");
|
|
716
|
+
a.set("--pagination-active-bg", c.backgroundColor), a.set("--pagination-active-text", c.textColor), a.set("--pagination-active-bg-dark", o.backgroundColor), a.set("--pagination-active-text-dark", o.textColor);
|
|
717
|
+
break;
|
|
718
|
+
}
|
|
719
|
+
case "outline": {
|
|
720
|
+
a.set("--pagination-active-bg", "transparent"), a.set("--pagination-active-text", j(t, "light")), a.set("--pagination-active-border", W(t, "light")), a.set("--pagination-active-bg-dark", "transparent"), a.set("--pagination-active-text-dark", j(t, "dark")), a.set(
|
|
721
|
+
"--pagination-active-border-dark",
|
|
722
|
+
W(t, "dark")
|
|
723
|
+
), a.set("--pagination-item-border", P("base", 300)), a.set("--pagination-item-border-dark", P("base", 600));
|
|
724
|
+
break;
|
|
725
|
+
}
|
|
726
|
+
case "light": {
|
|
727
|
+
const c = F(t, "light", "light"), o = F(t, "light", "dark");
|
|
728
|
+
a.set("--pagination-active-bg", c.backgroundColor), a.set("--pagination-active-text", j(t, "light")), a.set("--pagination-active-bg-dark", o.backgroundColor), a.set("--pagination-active-text-dark", j(t, "dark")), a.set("--pagination-item-bg", P("base", 100)), a.set("--pagination-item-bg-dark", P("base", 800));
|
|
729
|
+
break;
|
|
730
|
+
}
|
|
731
|
+
case "subtle": {
|
|
732
|
+
a.set("--pagination-active-bg", "transparent"), a.set("--pagination-active-text", j(t, "light")), a.set("--pagination-active-bg-dark", "transparent"), a.set("--pagination-active-text-dark", j(t, "dark"));
|
|
733
|
+
break;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
const n = P("base", 100), r = P("base", 700);
|
|
737
|
+
return a.set("--pagination-hover-bg", n), a.set("--pagination-hover-bg-dark", r), Array.from(a.entries()).map(([c, o]) => `${c}: ${o}`).join("; ");
|
|
738
|
+
}
|
|
739
|
+
function va({
|
|
740
|
+
currentPage: e,
|
|
741
|
+
totalPages: t,
|
|
742
|
+
onChange: a,
|
|
743
|
+
siblings: n = 1,
|
|
744
|
+
showPrevNext: r = !0,
|
|
745
|
+
showFirstLast: c = !1,
|
|
746
|
+
size: o = "md",
|
|
747
|
+
variant: i = "filled",
|
|
748
|
+
color: l = "primary",
|
|
749
|
+
justify: u = !1,
|
|
750
|
+
responsive: b = !1
|
|
751
|
+
}) {
|
|
752
|
+
const f = m.deriveProp(n), g = k(
|
|
753
|
+
b,
|
|
754
|
+
f,
|
|
755
|
+
n
|
|
756
|
+
)((p, h, v) => p ? h : v);
|
|
757
|
+
return R(
|
|
758
|
+
J,
|
|
759
|
+
(p) => d.nav(
|
|
760
|
+
s.class(
|
|
761
|
+
k(
|
|
762
|
+
o,
|
|
763
|
+
i,
|
|
764
|
+
u
|
|
765
|
+
)((h, v, S) => {
|
|
766
|
+
const x = [
|
|
767
|
+
"bc-pagination",
|
|
768
|
+
`bc-pagination--size-${h}`,
|
|
769
|
+
`bc-pagination--variant-${v}`
|
|
770
|
+
];
|
|
771
|
+
return S && x.push("bc-pagination--justify"), x.join(" ");
|
|
772
|
+
})
|
|
773
|
+
),
|
|
774
|
+
s.style(
|
|
775
|
+
k(i, l)((h, v) => be(h, v))
|
|
776
|
+
),
|
|
777
|
+
D.label(p.$.paginationLabel),
|
|
778
|
+
// Responsive ResizeObserver setup
|
|
779
|
+
I(
|
|
780
|
+
b,
|
|
781
|
+
() => q((h) => {
|
|
782
|
+
const v = () => {
|
|
783
|
+
const x = h.clientWidth;
|
|
784
|
+
if (x === 0) return;
|
|
785
|
+
const A = h.querySelector(
|
|
786
|
+
".bc-pagination__item"
|
|
787
|
+
);
|
|
788
|
+
if (!A) return;
|
|
789
|
+
const B = A.offsetWidth, C = parseFloat(getComputedStyle(h).gap) || 0, $ = B + C, w = Math.floor(
|
|
790
|
+
(x + C) / $
|
|
791
|
+
), y = (m.get(r) ? 2 : 0) + (m.get(c) ? 2 : 0), _ = m.get(t), L = w - y, E = Math.max(
|
|
792
|
+
0,
|
|
793
|
+
Math.floor((L - 5) / 2)
|
|
794
|
+
), O = Math.floor((_ - 3) / 2);
|
|
795
|
+
f.set(Math.min(E, Math.max(0, O)));
|
|
796
|
+
}, S = new ResizeObserver(v);
|
|
797
|
+
return S.observe(h), ut(v), tt(() => S.disconnect());
|
|
798
|
+
})
|
|
799
|
+
),
|
|
800
|
+
// First page button
|
|
801
|
+
I(
|
|
802
|
+
c,
|
|
803
|
+
() => d.button(
|
|
804
|
+
s.class("bc-pagination__item"),
|
|
805
|
+
s.disabled(
|
|
806
|
+
k(
|
|
807
|
+
e,
|
|
808
|
+
t
|
|
809
|
+
)((h, v) => h <= 1 || v <= 1)
|
|
810
|
+
),
|
|
811
|
+
D.label(p.$.firstPage),
|
|
812
|
+
T.click((h) => {
|
|
813
|
+
h.preventDefault(), m.get(t) > 1 && a(1);
|
|
814
|
+
}),
|
|
815
|
+
"«"
|
|
816
|
+
// «
|
|
817
|
+
)
|
|
818
|
+
),
|
|
819
|
+
// Previous page button
|
|
820
|
+
I(
|
|
821
|
+
r,
|
|
822
|
+
() => d.button(
|
|
823
|
+
s.class("bc-pagination__item"),
|
|
824
|
+
s.disabled(
|
|
825
|
+
k(
|
|
826
|
+
e,
|
|
827
|
+
t
|
|
828
|
+
)((h, v) => h <= 1 || v <= 1)
|
|
829
|
+
),
|
|
830
|
+
D.label(p.$.previousPage),
|
|
831
|
+
T.click((h) => {
|
|
832
|
+
h.preventDefault();
|
|
833
|
+
const v = m.get(e);
|
|
834
|
+
v > 1 && a(v - 1);
|
|
835
|
+
}),
|
|
836
|
+
"‹"
|
|
837
|
+
// ‹
|
|
838
|
+
)
|
|
839
|
+
),
|
|
840
|
+
// Page numbers and ellipsis
|
|
841
|
+
Q(
|
|
842
|
+
k(
|
|
843
|
+
e,
|
|
844
|
+
t,
|
|
845
|
+
g
|
|
846
|
+
)(
|
|
847
|
+
(h, v, S) => ue(h, v, S)
|
|
848
|
+
),
|
|
849
|
+
(h) => {
|
|
850
|
+
const v = h.map((x) => x === "dots"), S = k(
|
|
851
|
+
h,
|
|
852
|
+
e
|
|
853
|
+
)((x, A) => x === A);
|
|
854
|
+
return I(
|
|
855
|
+
v,
|
|
856
|
+
() => d.span(s.class("bc-pagination__dots"), "…"),
|
|
857
|
+
() => d.button(
|
|
858
|
+
s.class(
|
|
859
|
+
m.map(
|
|
860
|
+
S,
|
|
861
|
+
(x) => x ? "bc-pagination__item bc-pagination__item--active" : "bc-pagination__item"
|
|
862
|
+
)
|
|
863
|
+
),
|
|
864
|
+
q((x) => {
|
|
865
|
+
m.on(S, (A) => {
|
|
866
|
+
A ? x.setAttribute("aria-current", "page") : x.removeAttribute("aria-current");
|
|
867
|
+
});
|
|
868
|
+
}),
|
|
869
|
+
T.click((x) => {
|
|
870
|
+
x.preventDefault();
|
|
871
|
+
const A = m.get(h);
|
|
872
|
+
A !== "dots" && A !== m.get(e) && a(A);
|
|
873
|
+
}),
|
|
874
|
+
h.map((x) => String(x))
|
|
875
|
+
)
|
|
876
|
+
);
|
|
877
|
+
}
|
|
878
|
+
),
|
|
879
|
+
// Next page button
|
|
880
|
+
I(
|
|
881
|
+
r,
|
|
882
|
+
() => d.button(
|
|
883
|
+
s.class("bc-pagination__item"),
|
|
884
|
+
s.disabled(
|
|
885
|
+
k(
|
|
886
|
+
e,
|
|
887
|
+
t
|
|
888
|
+
)((h, v) => h >= v || v <= 1)
|
|
889
|
+
),
|
|
890
|
+
D.label(p.$.nextPage),
|
|
891
|
+
T.click((h) => {
|
|
892
|
+
h.preventDefault();
|
|
893
|
+
const v = m.get(e), S = m.get(t);
|
|
894
|
+
v < S && a(v + 1);
|
|
895
|
+
}),
|
|
896
|
+
"›"
|
|
897
|
+
)
|
|
898
|
+
),
|
|
899
|
+
// Last page button
|
|
900
|
+
I(
|
|
901
|
+
c,
|
|
902
|
+
() => d.button(
|
|
903
|
+
s.class("bc-pagination__item"),
|
|
904
|
+
s.disabled(
|
|
905
|
+
k(
|
|
906
|
+
e,
|
|
907
|
+
t
|
|
908
|
+
)((h, v) => h >= v || v <= 1)
|
|
909
|
+
),
|
|
910
|
+
D.label(p.$.lastPage),
|
|
911
|
+
T.click((h) => {
|
|
912
|
+
h.preventDefault();
|
|
913
|
+
const v = m.get(t);
|
|
914
|
+
v > 1 && a(v);
|
|
915
|
+
}),
|
|
916
|
+
"»"
|
|
917
|
+
// »
|
|
918
|
+
)
|
|
919
|
+
)
|
|
920
|
+
)
|
|
921
|
+
);
|
|
922
|
+
}
|
|
923
|
+
function ge(e) {
|
|
924
|
+
const t = {
|
|
925
|
+
up: "M0 16 L8 10 L16 16 Z",
|
|
926
|
+
down: "M0 0 L8 6 L16 0 Z",
|
|
927
|
+
left: "M16 0 L10 8 L16 16 Z",
|
|
928
|
+
right: "M0 0 L6 8 L0 16 Z"
|
|
929
|
+
};
|
|
930
|
+
return bt.svg(
|
|
931
|
+
gt.viewBox("0 0 16 16"),
|
|
932
|
+
bt.path(gt.d(e.map((a) => t[a])))
|
|
933
|
+
);
|
|
934
|
+
}
|
|
935
|
+
function ka(e) {
|
|
936
|
+
const {
|
|
937
|
+
content: t,
|
|
938
|
+
placement: a = "top",
|
|
939
|
+
showDelay: n = 250,
|
|
940
|
+
hideDelay: r = 500,
|
|
941
|
+
mainAxisOffset: c = 8,
|
|
942
|
+
crossAxisOffset: o = 0,
|
|
943
|
+
showOn: i = "hover-focus"
|
|
944
|
+
} = e, l = K("tooltip");
|
|
945
|
+
return Y(
|
|
946
|
+
D.describedby(l),
|
|
947
|
+
wt({
|
|
948
|
+
content: () => Y(
|
|
949
|
+
s.class("bc-tooltip"),
|
|
950
|
+
s.role("tooltip"),
|
|
951
|
+
s.id(l),
|
|
952
|
+
t
|
|
953
|
+
),
|
|
954
|
+
placement: a,
|
|
955
|
+
showDelay: n,
|
|
956
|
+
hideDelay: r,
|
|
957
|
+
mainAxisOffset: c,
|
|
958
|
+
crossAxisOffset: o,
|
|
959
|
+
showOn: i,
|
|
960
|
+
closable: !0,
|
|
961
|
+
role: "tooltip",
|
|
962
|
+
// Override the default dialog role for tooltips
|
|
963
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
964
|
+
arrow: (u) => {
|
|
965
|
+
const b = u.map(
|
|
966
|
+
({
|
|
967
|
+
placement: f
|
|
968
|
+
}) => f.includes("top") ? "down" : f.includes("bottom") ? "up" : f.includes("left") ? "right" : f.includes("right") ? "left" : "up"
|
|
969
|
+
);
|
|
970
|
+
return Y(
|
|
971
|
+
s.class("bc-tooltip__arrow"),
|
|
972
|
+
s.class(b.map((f) => `bc-tooltip__arrow-${f}`)),
|
|
973
|
+
dt.transform(
|
|
974
|
+
u.map(({ x: f, y: g }) => f == null && g == null ? "" : f != null ? `translate(${f}px, 0)` : `translate(0, ${g}px)`)
|
|
975
|
+
),
|
|
976
|
+
ge(b)
|
|
977
|
+
);
|
|
978
|
+
}
|
|
979
|
+
})
|
|
980
|
+
);
|
|
981
|
+
}
|
|
982
|
+
function Tt({ open: e }, ...t) {
|
|
983
|
+
return q((a) => {
|
|
984
|
+
const { status: n, setOpen: r, dispose: c } = Dt({
|
|
985
|
+
initialStatus: m.get(e) ? "opened" : "closed",
|
|
986
|
+
element: a
|
|
987
|
+
});
|
|
988
|
+
return m.on(e, r), qt((o) => {
|
|
989
|
+
const i = V(null);
|
|
990
|
+
return k(
|
|
991
|
+
n,
|
|
992
|
+
o.$.height
|
|
993
|
+
)((u, b) => u === "opened" && b > 0 ? b : null).on((u) => {
|
|
994
|
+
u != null && i.set(u);
|
|
995
|
+
}), n.on((u) => {
|
|
996
|
+
if (a && u === "start-opening") {
|
|
997
|
+
const b = a.style.height, f = a.style.transition;
|
|
998
|
+
a.style.transition = "none", a.style.height = "auto", a.offsetHeight;
|
|
999
|
+
const g = a.scrollHeight;
|
|
1000
|
+
g > 0 && i.set(g), a.style.height = b, a.style.transition = f, a.offsetHeight;
|
|
1001
|
+
}
|
|
1002
|
+
}), Y(
|
|
1003
|
+
tt(c),
|
|
1004
|
+
s.style(
|
|
1005
|
+
i.map((u) => `--collapse-height: ${u != null ? `${u}px` : "auto"}`)
|
|
1006
|
+
),
|
|
1007
|
+
s.class(n.map((u) => `bc-collapse bc-collapse--${u}`)),
|
|
1008
|
+
...t
|
|
1009
|
+
);
|
|
1010
|
+
});
|
|
1011
|
+
});
|
|
1012
|
+
}
|
|
1013
|
+
function pe(e, t) {
|
|
1014
|
+
return [
|
|
1015
|
+
"bc-accordion",
|
|
1016
|
+
`bc-accordion--size-${e}`,
|
|
1017
|
+
`bc-accordion--${t}`
|
|
1018
|
+
].join(" ");
|
|
1019
|
+
}
|
|
1020
|
+
function _a({
|
|
1021
|
+
items: e,
|
|
1022
|
+
multiple: t = !1,
|
|
1023
|
+
size: a = "md",
|
|
1024
|
+
variant: n = "default"
|
|
1025
|
+
}) {
|
|
1026
|
+
const r = K("accordion"), c = /* @__PURE__ */ new Map();
|
|
1027
|
+
for (const i of e)
|
|
1028
|
+
c.set(i.key, V(i.defaultOpen ?? !1));
|
|
1029
|
+
const o = (i) => {
|
|
1030
|
+
const l = c.get(i);
|
|
1031
|
+
if (l != null) {
|
|
1032
|
+
if (!m.get(t))
|
|
1033
|
+
for (const [u, b] of c)
|
|
1034
|
+
u !== i && b.set(!1);
|
|
1035
|
+
l.update((u) => !u);
|
|
1036
|
+
}
|
|
1037
|
+
};
|
|
1038
|
+
return d.div(
|
|
1039
|
+
s.class(k(a, n)(pe)),
|
|
1040
|
+
s.role("presentation"),
|
|
1041
|
+
...e.map((i, l) => {
|
|
1042
|
+
const u = c.get(i.key), b = `${r}-header-${l}`, f = `${r}-panel-${l}`;
|
|
1043
|
+
return d.div(
|
|
1044
|
+
s.class("bc-accordion__item"),
|
|
1045
|
+
s.class(
|
|
1046
|
+
u.map(
|
|
1047
|
+
(g) => g ? "bc-accordion__item--open" : "bc-accordion__item--closed"
|
|
1048
|
+
)
|
|
1049
|
+
),
|
|
1050
|
+
i.disabled ? s.class("bc-accordion__item--disabled") : N,
|
|
1051
|
+
// Header / trigger
|
|
1052
|
+
d.button(
|
|
1053
|
+
s.type("button"),
|
|
1054
|
+
s.class("bc-accordion__header"),
|
|
1055
|
+
s.id(b),
|
|
1056
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1057
|
+
D.expanded(u),
|
|
1058
|
+
D.controls(f),
|
|
1059
|
+
s.disabled(i.disabled ?? !1),
|
|
1060
|
+
T.click((g) => {
|
|
1061
|
+
g.preventDefault(), i.disabled || o(i.key);
|
|
1062
|
+
}),
|
|
1063
|
+
d.span(s.class("bc-accordion__header-content"), i.header),
|
|
1064
|
+
d.span(
|
|
1065
|
+
s.class("bc-accordion__chevron"),
|
|
1066
|
+
s.class(
|
|
1067
|
+
u.map(
|
|
1068
|
+
(g) => g ? "bc-accordion__chevron--open" : "bc-accordion__chevron--closed"
|
|
1069
|
+
)
|
|
1070
|
+
),
|
|
1071
|
+
// CSS-only chevron via border trick
|
|
1072
|
+
d.span(s.class("bc-accordion__chevron-icon"))
|
|
1073
|
+
)
|
|
1074
|
+
),
|
|
1075
|
+
// Panel
|
|
1076
|
+
d.div(
|
|
1077
|
+
s.id(f),
|
|
1078
|
+
s.role("region"),
|
|
1079
|
+
D.labelledby(b),
|
|
1080
|
+
d.div(
|
|
1081
|
+
Tt(
|
|
1082
|
+
{ open: u },
|
|
1083
|
+
d.div(s.class("bc-accordion__body"), i.body)
|
|
1084
|
+
)
|
|
1085
|
+
)
|
|
1086
|
+
)
|
|
1087
|
+
);
|
|
1088
|
+
})
|
|
1089
|
+
);
|
|
1090
|
+
}
|
|
1091
|
+
async function fe(e) {
|
|
1092
|
+
try {
|
|
1093
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
1094
|
+
} catch {
|
|
1095
|
+
try {
|
|
1096
|
+
const t = document.createElement("textarea");
|
|
1097
|
+
return t.value = e, t.style.position = "fixed", t.style.opacity = "0", document.body.appendChild(t), t.select(), document.execCommand("copy"), document.body.removeChild(t), !0;
|
|
1098
|
+
} catch {
|
|
1099
|
+
return !1;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
function ya({
|
|
1104
|
+
text: e,
|
|
1105
|
+
size: t = "sm",
|
|
1106
|
+
color: a = "base",
|
|
1107
|
+
variant: n = "subtle",
|
|
1108
|
+
roundedness: r = "sm",
|
|
1109
|
+
disabled: c = !1,
|
|
1110
|
+
timeout: o = 2e3
|
|
1111
|
+
}, ...i) {
|
|
1112
|
+
const l = V("idle");
|
|
1113
|
+
let u;
|
|
1114
|
+
return R(J, (b) => {
|
|
1115
|
+
const f = m.map(l, (h) => h === "copied"), g = k(
|
|
1116
|
+
l,
|
|
1117
|
+
b.$.copyButton.$.copied,
|
|
1118
|
+
b.$.copyButton.$.copyToClipboard
|
|
1119
|
+
)((h, v, S) => h === "copied" ? v : S), p = async () => {
|
|
1120
|
+
if (m.get(c)) return;
|
|
1121
|
+
await fe(m.get(e)) && (u != null && clearTimeout(u), l.set("copied"), u = setTimeout(() => l.set("idle"), m.get(o)));
|
|
1122
|
+
};
|
|
1123
|
+
return d.span(
|
|
1124
|
+
s.class(
|
|
1125
|
+
m.map(
|
|
1126
|
+
l,
|
|
1127
|
+
(h) => h === "copied" ? "bc-copy-button bc-copy-button--copied" : "bc-copy-button"
|
|
1128
|
+
)
|
|
1129
|
+
),
|
|
1130
|
+
tt(() => {
|
|
1131
|
+
u != null && clearTimeout(u);
|
|
1132
|
+
}),
|
|
1133
|
+
st(
|
|
1134
|
+
{
|
|
1135
|
+
variant: n,
|
|
1136
|
+
size: t,
|
|
1137
|
+
roundedness: r,
|
|
1138
|
+
disabled: c,
|
|
1139
|
+
color: a,
|
|
1140
|
+
onClick: p
|
|
1141
|
+
},
|
|
1142
|
+
D.label(g),
|
|
1143
|
+
s.title(g),
|
|
1144
|
+
I(
|
|
1145
|
+
f,
|
|
1146
|
+
() => U({ icon: "lucide:check", size: t }),
|
|
1147
|
+
() => U({ icon: "lucide:copy", size: t })
|
|
1148
|
+
),
|
|
1149
|
+
...i
|
|
1150
|
+
)
|
|
1151
|
+
);
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
function me(e, t, a, n) {
|
|
1155
|
+
const r = [
|
|
1156
|
+
"bc-toggle-button",
|
|
1157
|
+
`bc-toggle-button--size-${e}`,
|
|
1158
|
+
`bc-control--padding-${e}`,
|
|
1159
|
+
`bc-control--rounded-${t}`
|
|
1160
|
+
];
|
|
1161
|
+
return a && r.push("bc-toggle-button--full-width"), n && r.push("bc-toggle-button--pressed"), r.join(" ");
|
|
1162
|
+
}
|
|
1163
|
+
function he(e, t, a, n) {
|
|
1164
|
+
const r = /* @__PURE__ */ new Map();
|
|
1165
|
+
r.set("--toggle-text-shadow", "var(--text-shadow-none)"), r.set("--toggle-text-shadow-dark", "var(--text-shadow-none)");
|
|
1166
|
+
const c = (o, i, l, u) => {
|
|
1167
|
+
n || (r.set("--toggle-bg-hover", o), r.set("--toggle-text-hover", l), r.set("--toggle-bg-hover-dark", i), r.set("--toggle-text-hover-dark", u));
|
|
1168
|
+
};
|
|
1169
|
+
if (a) {
|
|
1170
|
+
const o = F(t, "solid", "light"), i = F(t, "solid", "dark");
|
|
1171
|
+
r.set("--toggle-bg", o.backgroundColor), r.set("--toggle-text", o.textColor), r.set("--toggle-bg-dark", i.backgroundColor), r.set("--toggle-text-dark", i.textColor), r.set("--toggle-border", o.backgroundColor), r.set("--toggle-border-dark", i.backgroundColor), r.set(
|
|
1172
|
+
"--toggle-text-shadow",
|
|
1173
|
+
"var(--text-shadow-button-filled, var(--text-shadow-sm))"
|
|
1174
|
+
), r.set(
|
|
1175
|
+
"--toggle-text-shadow-dark",
|
|
1176
|
+
"var(--text-shadow-button-filled, var(--text-shadow-sm))"
|
|
1177
|
+
);
|
|
1178
|
+
const l = z(t, "solid", "light"), u = z(t, "solid", "dark");
|
|
1179
|
+
c(
|
|
1180
|
+
l.backgroundColor,
|
|
1181
|
+
u.backgroundColor,
|
|
1182
|
+
l.textColor,
|
|
1183
|
+
u.textColor
|
|
1184
|
+
);
|
|
1185
|
+
} else
|
|
1186
|
+
switch (e) {
|
|
1187
|
+
case "outline":
|
|
1188
|
+
case "dashed": {
|
|
1189
|
+
r.set("--toggle-bg", "transparent"), r.set("--toggle-bg-dark", "transparent"), r.set("--toggle-border", W(t, "light")), r.set("--toggle-border-dark", W(t, "dark")), r.set("--toggle-text", j(t, "light")), r.set("--toggle-text-dark", j(t, "dark")), e === "dashed" && r.set("--toggle-border-style", "dashed");
|
|
1190
|
+
const o = z(t, "light", "light"), i = z(t, "light", "dark");
|
|
1191
|
+
c(
|
|
1192
|
+
o.backgroundColor,
|
|
1193
|
+
i.backgroundColor,
|
|
1194
|
+
o.textColor,
|
|
1195
|
+
i.textColor
|
|
1196
|
+
);
|
|
1197
|
+
break;
|
|
1198
|
+
}
|
|
1199
|
+
case "light": {
|
|
1200
|
+
const o = F(t, "light", "light"), i = F(t, "light", "dark");
|
|
1201
|
+
r.set("--toggle-bg", o.backgroundColor), r.set("--toggle-text", o.textColor), r.set("--toggle-bg-dark", i.backgroundColor), r.set("--toggle-text-dark", i.textColor);
|
|
1202
|
+
const l = z(t, "light", "light"), u = z(t, "light", "dark");
|
|
1203
|
+
c(
|
|
1204
|
+
l.backgroundColor,
|
|
1205
|
+
u.backgroundColor,
|
|
1206
|
+
l.textColor,
|
|
1207
|
+
u.textColor
|
|
1208
|
+
);
|
|
1209
|
+
break;
|
|
1210
|
+
}
|
|
1211
|
+
case "filled": {
|
|
1212
|
+
const o = F("neutral", "light", "light"), i = F("neutral", "light", "dark");
|
|
1213
|
+
r.set("--toggle-bg", o.backgroundColor), r.set("--toggle-text", j(t, "light")), r.set("--toggle-bg-dark", i.backgroundColor), r.set("--toggle-text-dark", j(t, "dark"));
|
|
1214
|
+
const l = z("base", "light", "light"), u = z("base", "light", "dark");
|
|
1215
|
+
c(
|
|
1216
|
+
l.backgroundColor,
|
|
1217
|
+
u.backgroundColor,
|
|
1218
|
+
r.get("--toggle-text") ?? o.textColor,
|
|
1219
|
+
r.get("--toggle-text-dark") ?? i.textColor
|
|
1220
|
+
);
|
|
1221
|
+
break;
|
|
1222
|
+
}
|
|
1223
|
+
case "default": {
|
|
1224
|
+
const o = F("neutral", "light", "light"), i = F("neutral", "light", "dark");
|
|
1225
|
+
r.set("--toggle-bg", o.backgroundColor), r.set("--toggle-text", j(t, "light")), r.set("--toggle-bg-dark", i.backgroundColor), r.set("--toggle-text-dark", j(t, "dark")), r.set("--toggle-border", P("neutral", 300)), r.set("--toggle-border-dark", P("neutral", 700));
|
|
1226
|
+
const l = z("base", "light", "light"), u = z("base", "light", "dark");
|
|
1227
|
+
c(
|
|
1228
|
+
l.backgroundColor,
|
|
1229
|
+
u.backgroundColor,
|
|
1230
|
+
r.get("--toggle-text") ?? o.textColor,
|
|
1231
|
+
r.get("--toggle-text-dark") ?? i.textColor
|
|
1232
|
+
);
|
|
1233
|
+
break;
|
|
1234
|
+
}
|
|
1235
|
+
case "subtle": {
|
|
1236
|
+
r.set("--toggle-bg", "transparent"), r.set("--toggle-bg-dark", "transparent"), r.set("--toggle-text", j(t, "light")), r.set("--toggle-text-dark", j(t, "dark"));
|
|
1237
|
+
const o = z(t, "light", "light"), i = z(t, "light", "dark");
|
|
1238
|
+
c(
|
|
1239
|
+
o.backgroundColor,
|
|
1240
|
+
i.backgroundColor,
|
|
1241
|
+
o.textColor,
|
|
1242
|
+
i.textColor
|
|
1243
|
+
);
|
|
1244
|
+
break;
|
|
1245
|
+
}
|
|
1246
|
+
default: {
|
|
1247
|
+
const o = F("neutral", "light", "light"), i = F("neutral", "light", "dark");
|
|
1248
|
+
r.set("--toggle-bg", o.backgroundColor), r.set("--toggle-text", j(t, "light")), r.set("--toggle-bg-dark", i.backgroundColor), r.set("--toggle-text-dark", j(t, "dark"));
|
|
1249
|
+
const l = z("base", "light", "light"), u = z("base", "light", "dark");
|
|
1250
|
+
c(
|
|
1251
|
+
l.backgroundColor,
|
|
1252
|
+
u.backgroundColor,
|
|
1253
|
+
r.get("--toggle-text") ?? o.textColor,
|
|
1254
|
+
r.get("--toggle-text-dark") ?? i.textColor
|
|
1255
|
+
);
|
|
1256
|
+
break;
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
return Array.from(r.entries()).map(([o, i]) => `${o}: ${i}`).join("; ");
|
|
1260
|
+
}
|
|
1261
|
+
function ve({
|
|
1262
|
+
pressed: e,
|
|
1263
|
+
onChange: t,
|
|
1264
|
+
disabled: a = !1,
|
|
1265
|
+
variant: n = "outline",
|
|
1266
|
+
size: r = "md",
|
|
1267
|
+
color: c = "primary",
|
|
1268
|
+
roundedness: o = "sm",
|
|
1269
|
+
fullWidth: i = !1
|
|
1270
|
+
}, ...l) {
|
|
1271
|
+
return d.button(
|
|
1272
|
+
s.type("button"),
|
|
1273
|
+
s.disabled(a),
|
|
1274
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1275
|
+
D.pressed(e),
|
|
1276
|
+
s.class(
|
|
1277
|
+
k(
|
|
1278
|
+
r,
|
|
1279
|
+
o,
|
|
1280
|
+
i,
|
|
1281
|
+
e
|
|
1282
|
+
)(me)
|
|
1283
|
+
),
|
|
1284
|
+
s.style(
|
|
1285
|
+
k(n, c, e, a)(he)
|
|
1286
|
+
),
|
|
1287
|
+
T.click((u) => {
|
|
1288
|
+
u.preventDefault(), u.stopPropagation(), m.get(a) || t?.(!m.get(e));
|
|
1289
|
+
}),
|
|
1290
|
+
...l
|
|
1291
|
+
);
|
|
1292
|
+
}
|
|
1293
|
+
function ke(e, t) {
|
|
1294
|
+
return [
|
|
1295
|
+
"bc-toggle-button-group",
|
|
1296
|
+
`bc-toggle-button-group--${e}`,
|
|
1297
|
+
`bc-toggle-button-group--rounded-${t}`
|
|
1298
|
+
].join(" ");
|
|
1299
|
+
}
|
|
1300
|
+
function Ca({
|
|
1301
|
+
items: e,
|
|
1302
|
+
value: t,
|
|
1303
|
+
onChange: a,
|
|
1304
|
+
multiple: n = !1,
|
|
1305
|
+
disabled: r = !1,
|
|
1306
|
+
variant: c = "outline",
|
|
1307
|
+
size: o = "md",
|
|
1308
|
+
color: i = "primary",
|
|
1309
|
+
roundedness: l = "sm",
|
|
1310
|
+
orientation: u = "horizontal"
|
|
1311
|
+
}) {
|
|
1312
|
+
const b = (f, g) => {
|
|
1313
|
+
const p = m.get(t), h = m.get(n);
|
|
1314
|
+
let v;
|
|
1315
|
+
h ? v = g ? [...p, f] : p.filter((S) => S !== f) : v = g ? [f] : [], a?.(v);
|
|
1316
|
+
};
|
|
1317
|
+
return d.div(
|
|
1318
|
+
s.role("group"),
|
|
1319
|
+
s.class(k(u, l)(ke)),
|
|
1320
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1321
|
+
D.orientation(u),
|
|
1322
|
+
...e.map((f) => {
|
|
1323
|
+
const g = m.map(t, (h) => h.includes(f.key)), p = f.disabled ? m.map(r, (h) => h || f.disabled) : r;
|
|
1324
|
+
return ve(
|
|
1325
|
+
{
|
|
1326
|
+
pressed: g,
|
|
1327
|
+
onChange: (h) => b(f.key, h),
|
|
1328
|
+
disabled: p,
|
|
1329
|
+
variant: c,
|
|
1330
|
+
size: o,
|
|
1331
|
+
color: i,
|
|
1332
|
+
roundedness: "none",
|
|
1333
|
+
fullWidth: !1
|
|
1334
|
+
},
|
|
1335
|
+
f.label
|
|
1336
|
+
);
|
|
1337
|
+
})
|
|
1338
|
+
);
|
|
1339
|
+
}
|
|
1340
|
+
function xa(...e) {
|
|
1341
|
+
return d.div(
|
|
1342
|
+
s.class("bc-center-h"),
|
|
1343
|
+
d.div(s.class("bc-center__content"), ...e)
|
|
1344
|
+
);
|
|
1345
|
+
}
|
|
1346
|
+
function _e(e) {
|
|
1347
|
+
const t = ["bc-center"];
|
|
1348
|
+
return e !== "lg" && t.push(`bc-center--gap-${e}`), t.join(" ");
|
|
1349
|
+
}
|
|
1350
|
+
function $a({ gap: e = "lg" } = {}, ...t) {
|
|
1351
|
+
return d.div(
|
|
1352
|
+
s.class(k(e)((a) => _e(a ?? "lg"))),
|
|
1353
|
+
...t
|
|
1354
|
+
);
|
|
1355
|
+
}
|
|
1356
|
+
function vt(e, t, a, n, r) {
|
|
1357
|
+
const c = ["bc-divider"];
|
|
1358
|
+
return e === "vertical" && c.push("bc-divider--vertical"), t !== "solid" && c.push(`bc-divider--${t}`), a !== "default" && c.push(`bc-divider--tone-${a}`), n && (c.push("bc-divider--labeled"), r !== "center" && c.push(`bc-divider--labeled-${r}`)), c.join(" ");
|
|
1359
|
+
}
|
|
1360
|
+
function wa({
|
|
1361
|
+
orientation: e = "horizontal",
|
|
1362
|
+
variant: t = "solid",
|
|
1363
|
+
tone: a = "default",
|
|
1364
|
+
label: n,
|
|
1365
|
+
labelAlign: r = "center"
|
|
1366
|
+
} = {}) {
|
|
1367
|
+
return n != null ? d.div(
|
|
1368
|
+
s.class(
|
|
1369
|
+
k(
|
|
1370
|
+
e,
|
|
1371
|
+
t,
|
|
1372
|
+
a,
|
|
1373
|
+
r
|
|
1374
|
+
)(
|
|
1375
|
+
(o, i, l, u) => vt(
|
|
1376
|
+
o ?? "horizontal",
|
|
1377
|
+
i ?? "solid",
|
|
1378
|
+
l ?? "default",
|
|
1379
|
+
!0,
|
|
1380
|
+
u ?? "center"
|
|
1381
|
+
)
|
|
1382
|
+
)
|
|
1383
|
+
),
|
|
1384
|
+
s.role("separator"),
|
|
1385
|
+
d.span(s.class("bc-divider__line")),
|
|
1386
|
+
d.span(s.class("bc-divider__label"), n),
|
|
1387
|
+
d.span(s.class("bc-divider__line"))
|
|
1388
|
+
) : d.hr(
|
|
1389
|
+
s.class(
|
|
1390
|
+
k(
|
|
1391
|
+
e,
|
|
1392
|
+
t,
|
|
1393
|
+
a
|
|
1394
|
+
)(
|
|
1395
|
+
(o, i, l) => vt(
|
|
1396
|
+
o ?? "horizontal",
|
|
1397
|
+
i ?? "solid",
|
|
1398
|
+
l ?? "default",
|
|
1399
|
+
!1,
|
|
1400
|
+
"center"
|
|
1401
|
+
)
|
|
1402
|
+
)
|
|
1403
|
+
),
|
|
1404
|
+
s.role("separator")
|
|
1405
|
+
);
|
|
1406
|
+
}
|
|
1407
|
+
function Da(e) {
|
|
1408
|
+
return s.class(`bc-flex--gap-${e}`);
|
|
1409
|
+
}
|
|
1410
|
+
function Sa(e) {
|
|
1411
|
+
return s.class(`bc-flex--align-${e}`);
|
|
1412
|
+
}
|
|
1413
|
+
function La(e) {
|
|
1414
|
+
return s.class(`bc-flex--justify-${e}`);
|
|
1415
|
+
}
|
|
1416
|
+
const Ta = s.class("bc-flex--wrap"), Ia = s.class("bc-flex--nowrap"), Aa = s.class("bc-flex--grow");
|
|
1417
|
+
function kt({ header: e, footer: t, body: a, shadowOnScroll: n = !0 }, ...r) {
|
|
1418
|
+
const c = V("none");
|
|
1419
|
+
function o(l) {
|
|
1420
|
+
const u = l.scrollTop <= 1, b = l.scrollTop + l.clientHeight >= l.scrollHeight - 2;
|
|
1421
|
+
u && b ? c.set("none") : u ? c.set("bottom") : b ? c.set("top") : c.set("both");
|
|
1422
|
+
}
|
|
1423
|
+
return d.div(
|
|
1424
|
+
s.class(
|
|
1425
|
+
k(
|
|
1426
|
+
c,
|
|
1427
|
+
n
|
|
1428
|
+
)((l, u) => {
|
|
1429
|
+
const b = ["bc-scrollable-panel"];
|
|
1430
|
+
return u && ((l === "top" || l === "both") && b.push("bc-scrollable-panel--scrolled-down"), (l === "bottom" || l === "both") && b.push("bc-scrollable-panel--scrolled-up")), b.join(" ");
|
|
1431
|
+
})
|
|
1432
|
+
),
|
|
1433
|
+
e && d.div(s.class("bc-scrollable-panel__header"), e),
|
|
1434
|
+
d.div(s.class("bc-scrollable-panel--header-shadow"), d.div()),
|
|
1435
|
+
d.div(
|
|
1436
|
+
s.class("bc-scrollable-panel__body"),
|
|
1437
|
+
q((l) => {
|
|
1438
|
+
o(l);
|
|
1439
|
+
const u = new ResizeObserver(() => o(l));
|
|
1440
|
+
u.observe(l);
|
|
1441
|
+
const b = new MutationObserver(() => {
|
|
1442
|
+
requestAnimationFrame(() => o(l));
|
|
1443
|
+
});
|
|
1444
|
+
return b.observe(l, { childList: !0, subtree: !0 }), tt(() => {
|
|
1445
|
+
u.disconnect(), b.disconnect();
|
|
1446
|
+
});
|
|
1447
|
+
}),
|
|
1448
|
+
T.scroll((l) => {
|
|
1449
|
+
const u = l.target;
|
|
1450
|
+
o(u);
|
|
1451
|
+
}),
|
|
1452
|
+
a
|
|
1453
|
+
),
|
|
1454
|
+
d.div(s.class("bc-scrollable-panel--footer-shadow"), d.div()),
|
|
1455
|
+
t && d.div(s.class("bc-scrollable-panel__footer"), t),
|
|
1456
|
+
...r
|
|
1457
|
+
);
|
|
1458
|
+
}
|
|
1459
|
+
function ye(e, t) {
|
|
1460
|
+
const a = ["bc-stat-card"];
|
|
1461
|
+
return e !== "default" && a.push(`bc-stat-card--${e}`), t !== "md" && a.push(`bc-stat-card--padding-${t}`), a.join(" ");
|
|
1462
|
+
}
|
|
1463
|
+
function za({ variant: e = "default", size: t = "md", color: a = "primary" } = {}, ...n) {
|
|
1464
|
+
return d.div(
|
|
1465
|
+
s.role("group"),
|
|
1466
|
+
s.class(k(e, t)(ye)),
|
|
1467
|
+
s.style(
|
|
1468
|
+
m.map(a, (r) => `--stat-card-accent: var(--color-${r}-500)`)
|
|
1469
|
+
),
|
|
1470
|
+
...n
|
|
1471
|
+
);
|
|
1472
|
+
}
|
|
1473
|
+
function Fa({ class: e } = {}, ...t) {
|
|
1474
|
+
return d.div(
|
|
1475
|
+
s.class("bc-stat-card__value"),
|
|
1476
|
+
s.class(e),
|
|
1477
|
+
...t
|
|
1478
|
+
);
|
|
1479
|
+
}
|
|
1480
|
+
function ja({ class: e } = {}, ...t) {
|
|
1481
|
+
return d.div(
|
|
1482
|
+
s.class("bc-stat-card__label"),
|
|
1483
|
+
s.class(e),
|
|
1484
|
+
...t
|
|
1485
|
+
);
|
|
1486
|
+
}
|
|
1487
|
+
function Ea(e) {
|
|
1488
|
+
const { value: t, direction: a, color: n } = e;
|
|
1489
|
+
return R(J, (r) => {
|
|
1490
|
+
const c = n ?? m.map(
|
|
1491
|
+
a,
|
|
1492
|
+
(l) => l === "up" ? "success" : l === "down" ? "danger" : "neutral"
|
|
1493
|
+
), o = m.map(
|
|
1494
|
+
a,
|
|
1495
|
+
(l) => l === "up" ? "lucide:trending-up" : l === "down" ? "lucide:trending-down" : "lucide:minus"
|
|
1496
|
+
), i = k(
|
|
1497
|
+
a,
|
|
1498
|
+
t,
|
|
1499
|
+
r.$.statCard.$.trendUp,
|
|
1500
|
+
r.$.statCard.$.trendDown,
|
|
1501
|
+
r.$.statCard.$.trendFlat
|
|
1502
|
+
)(
|
|
1503
|
+
(l, u, b, f, g) => `${l === "up" ? b : l === "down" ? f : g}: ${u}`
|
|
1504
|
+
);
|
|
1505
|
+
return d.span(
|
|
1506
|
+
s.role("status"),
|
|
1507
|
+
s.class(
|
|
1508
|
+
m.map(
|
|
1509
|
+
a,
|
|
1510
|
+
(l) => `bc-stat-card__trend bc-stat-card__trend--${l}`
|
|
1511
|
+
)
|
|
1512
|
+
),
|
|
1513
|
+
s.style(
|
|
1514
|
+
m.map(
|
|
1515
|
+
c,
|
|
1516
|
+
(l) => `--stat-card-trend-color: var(--color-${l}-600); --stat-card-trend-color-dark: var(--color-${l}-400)`
|
|
1517
|
+
)
|
|
1518
|
+
),
|
|
1519
|
+
D.label(i),
|
|
1520
|
+
U({ icon: o, size: "xs" }),
|
|
1521
|
+
d.span(
|
|
1522
|
+
s.class("bc-stat-card__trend-value"),
|
|
1523
|
+
m.map(t, String)
|
|
1524
|
+
)
|
|
1525
|
+
);
|
|
1526
|
+
});
|
|
1527
|
+
}
|
|
1528
|
+
function Ba({ class: e } = {}, ...t) {
|
|
1529
|
+
return d.div(
|
|
1530
|
+
s.class("bc-stat-card__icon"),
|
|
1531
|
+
s.class(e),
|
|
1532
|
+
...t
|
|
1533
|
+
);
|
|
1534
|
+
}
|
|
1535
|
+
function Oa({ class: e } = {}, ...t) {
|
|
1536
|
+
return d.div(
|
|
1537
|
+
s.class("bc-stat-card__sparkline"),
|
|
1538
|
+
s.class(e),
|
|
1539
|
+
...t
|
|
1540
|
+
);
|
|
1541
|
+
}
|
|
1542
|
+
function Ce({
|
|
1543
|
+
value: e,
|
|
1544
|
+
onChange: t,
|
|
1545
|
+
onInput: a
|
|
1546
|
+
}) {
|
|
1547
|
+
return d.div(
|
|
1548
|
+
s.class("bc-color-input__swatch-container"),
|
|
1549
|
+
d.span(
|
|
1550
|
+
s.class("bc-color-input__swatch"),
|
|
1551
|
+
xt.color(
|
|
1552
|
+
s.class("bc-color-input__swatch-native"),
|
|
1553
|
+
s.value(e),
|
|
1554
|
+
t != null ? T.change(at(t)) : N,
|
|
1555
|
+
a != null ? T.input(at(a)) : N
|
|
1556
|
+
),
|
|
1557
|
+
s.style(m.map(e, (n) => `background-color: ${n}`))
|
|
1558
|
+
)
|
|
1559
|
+
);
|
|
1560
|
+
}
|
|
1561
|
+
function Ra(e) {
|
|
1562
|
+
const {
|
|
1563
|
+
value: t = "#000000",
|
|
1564
|
+
onBlur: a,
|
|
1565
|
+
onChange: n,
|
|
1566
|
+
onInput: r,
|
|
1567
|
+
swatchSize: c,
|
|
1568
|
+
...o
|
|
1569
|
+
} = e;
|
|
1570
|
+
return Gt(
|
|
1571
|
+
{
|
|
1572
|
+
...o,
|
|
1573
|
+
input: xt.text(
|
|
1574
|
+
Vt(e),
|
|
1575
|
+
s.value(t),
|
|
1576
|
+
a != null ? T.blur(at(a)) : N,
|
|
1577
|
+
n != null ? T.change(at(n)) : N,
|
|
1578
|
+
r != null ? T.input(at(r)) : N
|
|
1579
|
+
)
|
|
1580
|
+
},
|
|
1581
|
+
s.class("bc-color-input"),
|
|
1582
|
+
Ce({ value: t, onChange: e.onChange, onInput: e.onInput })
|
|
1583
|
+
);
|
|
1584
|
+
}
|
|
1585
|
+
function xe(e) {
|
|
1586
|
+
return `bc-kbd bc-kbd--size-${e}`;
|
|
1587
|
+
}
|
|
1588
|
+
function Ma({ size: e = "sm" } = {}, ...t) {
|
|
1589
|
+
return d.kbd(
|
|
1590
|
+
s.class(m.map(e, (a) => xe(a ?? "sm"))),
|
|
1591
|
+
...t
|
|
1592
|
+
);
|
|
1593
|
+
}
|
|
1594
|
+
function Pa(e) {
|
|
1595
|
+
return Nt((t, a) => {
|
|
1596
|
+
let n = a;
|
|
1597
|
+
const r = () => n();
|
|
1598
|
+
return e((i) => {
|
|
1599
|
+
const {
|
|
1600
|
+
size: l = "md",
|
|
1601
|
+
side: u = "right",
|
|
1602
|
+
dismissable: b = !0,
|
|
1603
|
+
showCloseButton: f = !0,
|
|
1604
|
+
onClose: g,
|
|
1605
|
+
overlayEffect: p = "opaque",
|
|
1606
|
+
container: h = "body",
|
|
1607
|
+
header: v,
|
|
1608
|
+
body: S,
|
|
1609
|
+
footer: x
|
|
1610
|
+
} = i;
|
|
1611
|
+
n = a;
|
|
1612
|
+
const A = V("capturing");
|
|
1613
|
+
m.on(b, ($) => {
|
|
1614
|
+
A.set($ ? "capturing" : "non-capturing");
|
|
1615
|
+
});
|
|
1616
|
+
const B = k(
|
|
1617
|
+
v != null,
|
|
1618
|
+
f
|
|
1619
|
+
)(($, w) => $ || w), C = q(($) => {
|
|
1620
|
+
const w = Dt({
|
|
1621
|
+
initialStatus: "closed",
|
|
1622
|
+
element: $
|
|
1623
|
+
});
|
|
1624
|
+
w.listenOnClosed(() => {
|
|
1625
|
+
a();
|
|
1626
|
+
}), n = () => {
|
|
1627
|
+
w.close();
|
|
1628
|
+
}, ut(() => w.open());
|
|
1629
|
+
const _ = K("drawer"), L = v != null ? `${_}-header` : void 0, E = `${_}-body`;
|
|
1630
|
+
return d.div(
|
|
1631
|
+
s.class(
|
|
1632
|
+
k(
|
|
1633
|
+
l,
|
|
1634
|
+
u,
|
|
1635
|
+
w.status
|
|
1636
|
+
)(
|
|
1637
|
+
(O, nt, ot) => `bc-drawer bc-drawer--size-${O} bc-drawer--container-${h} bc-drawer--side-${nt} bc-drawer--status-${ot}`
|
|
1638
|
+
)
|
|
1639
|
+
),
|
|
1640
|
+
// Essential ARIA attributes for drawer dialog
|
|
1641
|
+
s.role("dialog"),
|
|
1642
|
+
D.modal(!0),
|
|
1643
|
+
...L ? [D.labelledby(L)] : [],
|
|
1644
|
+
D.describedby(E),
|
|
1645
|
+
s.tabindex(-1),
|
|
1646
|
+
// Make drawer focusable for initial focus
|
|
1647
|
+
s.id(_),
|
|
1648
|
+
$t("focus-trap", "true"),
|
|
1649
|
+
// Mark as focus trap container
|
|
1650
|
+
// Focus trap for keyboard navigation
|
|
1651
|
+
Ht({
|
|
1652
|
+
active: !0,
|
|
1653
|
+
escapeDeactivates: !1,
|
|
1654
|
+
// Let Overlay handle escape key
|
|
1655
|
+
initialFocus: () => document.querySelector(
|
|
1656
|
+
`#${_} [aria-label="Close drawer"]`
|
|
1657
|
+
) || null
|
|
1658
|
+
}),
|
|
1659
|
+
T.mousedown((O) => O.stopPropagation()),
|
|
1660
|
+
// Prevent overlay click-outside when clicking drawer content
|
|
1661
|
+
// Drawer content container
|
|
1662
|
+
I(
|
|
1663
|
+
B,
|
|
1664
|
+
() => kt({
|
|
1665
|
+
header: d.div(
|
|
1666
|
+
s.class("bc-drawer__header"),
|
|
1667
|
+
d.div(s.id(L), v),
|
|
1668
|
+
I(
|
|
1669
|
+
f,
|
|
1670
|
+
() => R(
|
|
1671
|
+
J,
|
|
1672
|
+
(O) => Wt({
|
|
1673
|
+
size: "sm",
|
|
1674
|
+
onClick: r,
|
|
1675
|
+
label: O.$.closeDrawer
|
|
1676
|
+
})
|
|
1677
|
+
)
|
|
1678
|
+
)
|
|
1679
|
+
),
|
|
1680
|
+
body: d.div(
|
|
1681
|
+
s.class("bc-drawer__body"),
|
|
1682
|
+
s.id(E),
|
|
1683
|
+
S
|
|
1684
|
+
),
|
|
1685
|
+
footer: x && d.div(s.class("bc-drawer__footer"), x)
|
|
1686
|
+
}),
|
|
1687
|
+
() => kt({
|
|
1688
|
+
body: d.div(
|
|
1689
|
+
s.class("bc-drawer__body"),
|
|
1690
|
+
s.id(E),
|
|
1691
|
+
S
|
|
1692
|
+
),
|
|
1693
|
+
footer: x && d.div(s.class("bc-drawer__footer"), x)
|
|
1694
|
+
})
|
|
1695
|
+
)
|
|
1696
|
+
);
|
|
1697
|
+
});
|
|
1698
|
+
t({
|
|
1699
|
+
mode: A,
|
|
1700
|
+
effect: p ?? "opaque",
|
|
1701
|
+
container: h,
|
|
1702
|
+
content: C,
|
|
1703
|
+
onClickOutside: () => {
|
|
1704
|
+
g?.(), r();
|
|
1705
|
+
},
|
|
1706
|
+
onEscape: () => {
|
|
1707
|
+
g?.(), r();
|
|
1708
|
+
}
|
|
1709
|
+
});
|
|
1710
|
+
}, () => {
|
|
1711
|
+
r();
|
|
1712
|
+
});
|
|
1713
|
+
});
|
|
1714
|
+
}
|
|
1715
|
+
function Ua(e) {
|
|
1716
|
+
const {
|
|
1717
|
+
content: t,
|
|
1718
|
+
placement: a = "bottom",
|
|
1719
|
+
showDelay: n = 0,
|
|
1720
|
+
hideDelay: r = 0,
|
|
1721
|
+
mainAxisOffset: c = 8,
|
|
1722
|
+
crossAxisOffset: o = 0,
|
|
1723
|
+
showOn: i = "click",
|
|
1724
|
+
closable: l = !0,
|
|
1725
|
+
role: u = "dialog",
|
|
1726
|
+
hasPopup: b = "dialog"
|
|
1727
|
+
} = e, f = K("popover"), g = typeof t == "function" ? t : () => t;
|
|
1728
|
+
return Y(
|
|
1729
|
+
D.describedby(f),
|
|
1730
|
+
wt({
|
|
1731
|
+
content: () => Y(
|
|
1732
|
+
s.class("bc-popover"),
|
|
1733
|
+
s.role(u),
|
|
1734
|
+
s.id(f),
|
|
1735
|
+
g()
|
|
1736
|
+
),
|
|
1737
|
+
placement: a,
|
|
1738
|
+
showDelay: n,
|
|
1739
|
+
hideDelay: r,
|
|
1740
|
+
mainAxisOffset: c,
|
|
1741
|
+
crossAxisOffset: o,
|
|
1742
|
+
showOn: i,
|
|
1743
|
+
closable: l,
|
|
1744
|
+
role: u,
|
|
1745
|
+
hasPopup: b
|
|
1746
|
+
})
|
|
1747
|
+
);
|
|
1748
|
+
}
|
|
1749
|
+
function $e(e, t, a) {
|
|
1750
|
+
const n = ["bc-tag-input", `bc-tag-input--${e}`];
|
|
1751
|
+
return t && n.push("bc-tag-input--disabled"), a && n.push("bc-tag-input--error"), n.join(" ");
|
|
1752
|
+
}
|
|
1753
|
+
function Ga(e) {
|
|
1754
|
+
const {
|
|
1755
|
+
values: t,
|
|
1756
|
+
onChange: a,
|
|
1757
|
+
placeholder: n = "Add...",
|
|
1758
|
+
size: r = "md",
|
|
1759
|
+
disabled: c = !1,
|
|
1760
|
+
maxTags: o,
|
|
1761
|
+
hasError: i = !1
|
|
1762
|
+
} = e, l = V(""), u = (g) => {
|
|
1763
|
+
const h = m.get(t).filter((v) => v !== g);
|
|
1764
|
+
a?.(h);
|
|
1765
|
+
}, b = (g) => {
|
|
1766
|
+
const p = g.trim();
|
|
1767
|
+
if (!p) return;
|
|
1768
|
+
const h = m.get(t), v = m.get(o ?? 1 / 0);
|
|
1769
|
+
h.includes(p) || h.length >= v || (a?.([...h, p]), l.set(""));
|
|
1770
|
+
}, f = (g) => {
|
|
1771
|
+
if (g.key === "Enter" || g.key === ",")
|
|
1772
|
+
g.preventDefault(), b(l.value);
|
|
1773
|
+
else if (g.key === "Backspace" && l.value === "") {
|
|
1774
|
+
const p = m.get(t);
|
|
1775
|
+
p.length > 0 && u(p[p.length - 1]);
|
|
1776
|
+
}
|
|
1777
|
+
};
|
|
1778
|
+
return d.div(
|
|
1779
|
+
s.class(
|
|
1780
|
+
k(
|
|
1781
|
+
r,
|
|
1782
|
+
c,
|
|
1783
|
+
i
|
|
1784
|
+
)((g, p, h) => $e(g ?? "md", p ?? !1, h ?? !1))
|
|
1785
|
+
),
|
|
1786
|
+
Q(
|
|
1787
|
+
t,
|
|
1788
|
+
(g) => d.span(
|
|
1789
|
+
s.class("bc-tag-input__tag"),
|
|
1790
|
+
d.span(s.class("bc-tag-input__tag-text"), g),
|
|
1791
|
+
I(
|
|
1792
|
+
k(c)((p) => !(p ?? !1)),
|
|
1793
|
+
() => d.button(
|
|
1794
|
+
s.type("button"),
|
|
1795
|
+
s.class("bc-tag-input__tag-remove"),
|
|
1796
|
+
T.click((p) => {
|
|
1797
|
+
p.stopPropagation(), u(g.value);
|
|
1798
|
+
}),
|
|
1799
|
+
"×"
|
|
1800
|
+
),
|
|
1801
|
+
() => N
|
|
1802
|
+
)
|
|
1803
|
+
)
|
|
1804
|
+
),
|
|
1805
|
+
d.input(
|
|
1806
|
+
s.class("bc-tag-input__input"),
|
|
1807
|
+
s.type("text"),
|
|
1808
|
+
s.placeholder(
|
|
1809
|
+
k(
|
|
1810
|
+
t,
|
|
1811
|
+
n
|
|
1812
|
+
)((g, p) => g.length === 0 ? p ?? "Add..." : "")
|
|
1813
|
+
),
|
|
1814
|
+
s.disabled(c),
|
|
1815
|
+
s.value(l),
|
|
1816
|
+
T.input((g) => {
|
|
1817
|
+
const p = g.target;
|
|
1818
|
+
l.set(p.value);
|
|
1819
|
+
}),
|
|
1820
|
+
T.keydown(f),
|
|
1821
|
+
T.blur(() => {
|
|
1822
|
+
l.value.trim() && b(l.value);
|
|
1823
|
+
})
|
|
1824
|
+
)
|
|
1825
|
+
);
|
|
1826
|
+
}
|
|
1827
|
+
function we(e, t) {
|
|
1828
|
+
const a = ["bc-radio-group", `bc-radio-group--${e}`];
|
|
1829
|
+
return t && t.length > 0 && a.push(t), a.join(" ");
|
|
1830
|
+
}
|
|
1831
|
+
function De(e, t, a) {
|
|
1832
|
+
const n = ["bc-radio-group__item", `bc-radio-group__item--size-${e}`];
|
|
1833
|
+
return (t || a) && n.push("bc-radio-group__item--disabled"), n.join(" ");
|
|
1834
|
+
}
|
|
1835
|
+
function Va({
|
|
1836
|
+
options: e,
|
|
1837
|
+
value: t,
|
|
1838
|
+
onChange: a,
|
|
1839
|
+
name: n,
|
|
1840
|
+
disabled: r = !1,
|
|
1841
|
+
orientation: c = "vertical",
|
|
1842
|
+
size: o = "md",
|
|
1843
|
+
class: i
|
|
1844
|
+
}) {
|
|
1845
|
+
const l = n ?? K("radio-group");
|
|
1846
|
+
return d.div(
|
|
1847
|
+
s.class(
|
|
1848
|
+
k(
|
|
1849
|
+
c,
|
|
1850
|
+
i
|
|
1851
|
+
)(
|
|
1852
|
+
(u, b) => we(u ?? "vertical", b)
|
|
1853
|
+
)
|
|
1854
|
+
),
|
|
1855
|
+
s.role("radiogroup"),
|
|
1856
|
+
// Render each radio option
|
|
1857
|
+
Q(e, (u) => {
|
|
1858
|
+
const b = u.map((g) => g.disabled ?? !1), f = K("radio");
|
|
1859
|
+
return d.label(
|
|
1860
|
+
s.class(
|
|
1861
|
+
k(
|
|
1862
|
+
o,
|
|
1863
|
+
r,
|
|
1864
|
+
b
|
|
1865
|
+
)(
|
|
1866
|
+
(g, p, h) => De(
|
|
1867
|
+
g ?? "md",
|
|
1868
|
+
h ?? !1,
|
|
1869
|
+
p ?? !1
|
|
1870
|
+
)
|
|
1871
|
+
)
|
|
1872
|
+
),
|
|
1873
|
+
// Native radio input (visually hidden)
|
|
1874
|
+
d.input(
|
|
1875
|
+
s.type("radio"),
|
|
1876
|
+
s.name(l),
|
|
1877
|
+
s.id(f),
|
|
1878
|
+
s.value(u.map((g) => String(g.value))),
|
|
1879
|
+
s.class("bc-radio-group__input"),
|
|
1880
|
+
s.checked(
|
|
1881
|
+
k(t, u)((g, p) => g === p.value)
|
|
1882
|
+
),
|
|
1883
|
+
s.disabled(
|
|
1884
|
+
k(
|
|
1885
|
+
r,
|
|
1886
|
+
b
|
|
1887
|
+
)((g, p) => (g ?? !1) || (p ?? !1))
|
|
1888
|
+
),
|
|
1889
|
+
T.change(() => {
|
|
1890
|
+
m.get(r) || (m.get(u).disabled ?? !1) || a?.(m.get(u).value);
|
|
1891
|
+
}),
|
|
1892
|
+
D.disabled(
|
|
1893
|
+
k(
|
|
1894
|
+
r,
|
|
1895
|
+
b
|
|
1896
|
+
)((g, p) => (g ?? !1) || (p ?? !1))
|
|
1897
|
+
)
|
|
1898
|
+
),
|
|
1899
|
+
// Custom radio indicator
|
|
1900
|
+
d.span(s.class("bc-radio-group__indicator")),
|
|
1901
|
+
// Label and description
|
|
1902
|
+
d.span(
|
|
1903
|
+
s.class("bc-radio-group__label-container"),
|
|
1904
|
+
d.span(
|
|
1905
|
+
s.class("bc-radio-group__label"),
|
|
1906
|
+
u.map((g) => g.label)
|
|
1907
|
+
),
|
|
1908
|
+
d.span(
|
|
1909
|
+
s.class("bc-radio-group__description"),
|
|
1910
|
+
u.map((g) => g.description ?? "")
|
|
1911
|
+
)
|
|
1912
|
+
)
|
|
1913
|
+
);
|
|
1914
|
+
})
|
|
1915
|
+
);
|
|
1916
|
+
}
|
|
1917
|
+
function Se(e, t) {
|
|
1918
|
+
const a = ["bc-otp-input", `bc-otp-input--size-${e}`];
|
|
1919
|
+
return t && a.push("bc-otp-input--disabled"), a.join(" ");
|
|
1920
|
+
}
|
|
1921
|
+
function Le(e) {
|
|
1922
|
+
const t = F(e, "solid", "light"), a = F(e, "solid", "dark"), n = /* @__PURE__ */ new Map();
|
|
1923
|
+
return n.set("--otp-focus-color", t.backgroundColor), n.set("--otp-focus-color-dark", a.backgroundColor), n.set("--otp-focus-border", W(e, "light")), n.set("--otp-focus-border-dark", W(e, "dark")), Array.from(n.entries()).map(([r, c]) => `${r}: ${c}`).join("; ");
|
|
1924
|
+
}
|
|
1925
|
+
function Te(e, t) {
|
|
1926
|
+
return t === "numeric" ? /^\d$/.test(e) : /^[a-zA-Z0-9]$/.test(e);
|
|
1927
|
+
}
|
|
1928
|
+
function Na({
|
|
1929
|
+
length: e = 6,
|
|
1930
|
+
value: t = "",
|
|
1931
|
+
onChange: a,
|
|
1932
|
+
onComplete: n,
|
|
1933
|
+
disabled: r = !1,
|
|
1934
|
+
mask: c = !1,
|
|
1935
|
+
type: o = "numeric",
|
|
1936
|
+
size: i = "md",
|
|
1937
|
+
color: l = "primary",
|
|
1938
|
+
placeholder: u = "",
|
|
1939
|
+
autoFocus: b = !1
|
|
1940
|
+
} = {}) {
|
|
1941
|
+
const f = K("otp"), g = k(
|
|
1942
|
+
e,
|
|
1943
|
+
t
|
|
1944
|
+
)((C, $) => {
|
|
1945
|
+
const w = new Array(C).fill("");
|
|
1946
|
+
for (let y = 0; y < Math.min($.length, C); y++)
|
|
1947
|
+
w[y] = $[y];
|
|
1948
|
+
return w;
|
|
1949
|
+
}).deriveProp(), p = V(null), h = [];
|
|
1950
|
+
function v(C) {
|
|
1951
|
+
const $ = h[C];
|
|
1952
|
+
$ != null && ($.focus(), $.select());
|
|
1953
|
+
}
|
|
1954
|
+
function S() {
|
|
1955
|
+
const C = g.value.join("");
|
|
1956
|
+
a?.(C), C.length === e && C.split("").every(($) => $ !== "") && n?.(C);
|
|
1957
|
+
}
|
|
1958
|
+
function x(C, $) {
|
|
1959
|
+
if (m.get(r)) return;
|
|
1960
|
+
const w = m.get(o), y = $.split("").filter((_) => Te(_, w));
|
|
1961
|
+
if (y.length > 1) {
|
|
1962
|
+
const _ = [...g.value];
|
|
1963
|
+
for (let E = 0; E < y.length && C + E < m.get(e); E++)
|
|
1964
|
+
_[C + E] = y[E];
|
|
1965
|
+
g.set(_), S();
|
|
1966
|
+
const L = Math.min(C + y.length, m.get(e) - 1);
|
|
1967
|
+
v(L);
|
|
1968
|
+
return;
|
|
1969
|
+
}
|
|
1970
|
+
if (y.length === 1) {
|
|
1971
|
+
const _ = [...g.value];
|
|
1972
|
+
_[C] = y[0], g.set(_), S(), C < m.get(e) - 1 && v(C + 1);
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
function A(C, $) {
|
|
1976
|
+
if (!m.get(r))
|
|
1977
|
+
switch ($.key) {
|
|
1978
|
+
case "Backspace": {
|
|
1979
|
+
$.preventDefault();
|
|
1980
|
+
const w = [...g.value];
|
|
1981
|
+
w[C] !== "" ? (w[C] = "", g.set(w), S()) : C > 0 && (w[C - 1] = "", g.set(w), S(), v(C - 1));
|
|
1982
|
+
break;
|
|
1983
|
+
}
|
|
1984
|
+
case "ArrowLeft":
|
|
1985
|
+
$.preventDefault(), C > 0 && v(C - 1);
|
|
1986
|
+
break;
|
|
1987
|
+
case "ArrowRight":
|
|
1988
|
+
$.preventDefault(), C < m.get(e) - 1 && v(C + 1);
|
|
1989
|
+
break;
|
|
1990
|
+
case "Delete": {
|
|
1991
|
+
$.preventDefault();
|
|
1992
|
+
const w = [...g.value];
|
|
1993
|
+
w[C] = "", g.set(w), S();
|
|
1994
|
+
break;
|
|
1995
|
+
}
|
|
1996
|
+
case "Home":
|
|
1997
|
+
$.preventDefault(), v(0);
|
|
1998
|
+
break;
|
|
1999
|
+
case "End":
|
|
2000
|
+
$.preventDefault(), v(m.get(e) - 1);
|
|
2001
|
+
break;
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
function B(C, $) {
|
|
2005
|
+
$.preventDefault();
|
|
2006
|
+
const w = $.clipboardData?.getData("text") ?? "";
|
|
2007
|
+
x(C, w);
|
|
2008
|
+
}
|
|
2009
|
+
return R(
|
|
2010
|
+
J,
|
|
2011
|
+
(C) => d.div(
|
|
2012
|
+
s.class(k(i, r)(Se)),
|
|
2013
|
+
s.style(m.map(l, Le)),
|
|
2014
|
+
s.role("group"),
|
|
2015
|
+
D.label(C.$.otpInputLabel),
|
|
2016
|
+
Ct(e, ($) => {
|
|
2017
|
+
const w = $.index, y = `${f}-cell-${w}`;
|
|
2018
|
+
return d.input(
|
|
2019
|
+
q((_) => (h[w] = _, b && w === 0 && ut(() => _.focus()), N)),
|
|
2020
|
+
s.id(y),
|
|
2021
|
+
s.type(
|
|
2022
|
+
m.map(c, (_) => _ ? "password" : "text")
|
|
2023
|
+
),
|
|
2024
|
+
s.inputmode(
|
|
2025
|
+
m.map(
|
|
2026
|
+
o,
|
|
2027
|
+
(_) => _ === "numeric" ? "numeric" : "text"
|
|
2028
|
+
)
|
|
2029
|
+
),
|
|
2030
|
+
s.maxlength(1),
|
|
2031
|
+
s.autocomplete("one-time-code"),
|
|
2032
|
+
s.class("bc-otp-input__cell"),
|
|
2033
|
+
s.class(
|
|
2034
|
+
p.map(
|
|
2035
|
+
(_) => _ === w ? "bc-otp-input__cell--focused" : ""
|
|
2036
|
+
)
|
|
2037
|
+
),
|
|
2038
|
+
s.placeholder(u),
|
|
2039
|
+
s.disabled(r),
|
|
2040
|
+
D.label(C.$.otpDigitLabel.map((_) => _(w + 1, m.get(e)))),
|
|
2041
|
+
s.value(g.map((_) => _[w] ?? "")),
|
|
2042
|
+
T.focus(() => {
|
|
2043
|
+
p.set(w);
|
|
2044
|
+
const _ = h[w];
|
|
2045
|
+
_?.select();
|
|
2046
|
+
}),
|
|
2047
|
+
T.blur(() => {
|
|
2048
|
+
p.set(null);
|
|
2049
|
+
}),
|
|
2050
|
+
T.input((_) => {
|
|
2051
|
+
const L = _.target;
|
|
2052
|
+
x(w, L.value);
|
|
2053
|
+
}),
|
|
2054
|
+
T.keydown((_) => A(w, _)),
|
|
2055
|
+
T.paste((_) => B(w, _))
|
|
2056
|
+
);
|
|
2057
|
+
})
|
|
2058
|
+
)
|
|
2059
|
+
);
|
|
2060
|
+
}
|
|
2061
|
+
function G(e) {
|
|
2062
|
+
return e !== void 0 ? m.get(e) : void 0;
|
|
2063
|
+
}
|
|
2064
|
+
function Ie(e) {
|
|
2065
|
+
const t = {}, a = G(e.style), n = G(e.currency), r = G(e.currencyDisplay), c = G(e.signDisplay), o = G(e.notation), i = G(e.compactDisplay), l = G(e.unit), u = G(e.unitDisplay), b = G(e.useGrouping), f = G(e.minimumIntegerDigits), g = G(e.minimumFractionDigits), p = G(e.maximumFractionDigits), h = G(e.minimumSignificantDigits), v = G(e.maximumSignificantDigits);
|
|
2066
|
+
return a !== void 0 && (t.style = a), n !== void 0 && (t.currency = n), r !== void 0 && (t.currencyDisplay = r), c !== void 0 && (t.signDisplay = c), o !== void 0 && (t.notation = o), i !== void 0 && (t.compactDisplay = i), l !== void 0 && (t.unit = l), u !== void 0 && (t.unitDisplay = u), b !== void 0 && (t.useGrouping = b), f !== void 0 && (t.minimumIntegerDigits = f), g !== void 0 && (t.minimumFractionDigits = g), p !== void 0 && (t.maximumFractionDigits = p), h !== void 0 && (t.minimumSignificantDigits = h), v !== void 0 && (t.maximumSignificantDigits = v), t;
|
|
2067
|
+
}
|
|
2068
|
+
function Ha(e, t, a) {
|
|
2069
|
+
return new Intl.NumberFormat(t, a).format(e);
|
|
2070
|
+
}
|
|
2071
|
+
function Wa(e) {
|
|
2072
|
+
const { value: t, locale: a } = e, n = (r, c) => {
|
|
2073
|
+
const o = Ie(e);
|
|
2074
|
+
return new Intl.NumberFormat(r, o).format(c);
|
|
2075
|
+
};
|
|
2076
|
+
if (a !== void 0) {
|
|
2077
|
+
const r = k(a, t)(n);
|
|
2078
|
+
return d.span(s.class("bc-format-number"), r);
|
|
2079
|
+
}
|
|
2080
|
+
return R(et, ({ locale: r }) => {
|
|
2081
|
+
const c = k(r, t)(n);
|
|
2082
|
+
return d.span(s.class("bc-format-number"), c);
|
|
2083
|
+
});
|
|
2084
|
+
}
|
|
2085
|
+
function It(e) {
|
|
2086
|
+
return typeof e == "object" && e !== null && !(e instanceof Date) && "toLocaleString" in e;
|
|
2087
|
+
}
|
|
2088
|
+
function At(e) {
|
|
2089
|
+
return e instanceof Date ? e : new Date(e);
|
|
2090
|
+
}
|
|
2091
|
+
function Z(e) {
|
|
2092
|
+
return e !== void 0 ? m.get(e) : void 0;
|
|
2093
|
+
}
|
|
2094
|
+
function Ae(e) {
|
|
2095
|
+
const t = {}, a = Z(e.dateStyle), n = Z(e.calendar), r = Z(e.numberingSystem), c = Z(e.timeZone), o = Z(e.weekday), i = Z(e.year), l = Z(e.month), u = Z(e.day), b = Z(e.era);
|
|
2096
|
+
return o !== void 0 || i !== void 0 || l !== void 0 || u !== void 0 || b !== void 0 ? (o !== void 0 && (t.weekday = o), i !== void 0 && (t.year = i), l !== void 0 && (t.month = l), u !== void 0 && (t.day = u), b !== void 0 && (t.era = b)) : t.dateStyle = a ?? "medium", n !== void 0 && (t.calendar = n), r !== void 0 && (t.numberingSystem = r), c !== void 0 && (t.timeZone = c), t;
|
|
2097
|
+
}
|
|
2098
|
+
function Za(e, t, a) {
|
|
2099
|
+
return It(e) ? e.toLocaleString(t, a) : new Intl.DateTimeFormat(t, a).format(At(e));
|
|
2100
|
+
}
|
|
2101
|
+
function qa(e) {
|
|
2102
|
+
const { value: t, locale: a } = e, n = (r, c) => {
|
|
2103
|
+
const o = Ae(e);
|
|
2104
|
+
return It(c) ? c.toLocaleString(r, o) : new Intl.DateTimeFormat(r, o).format(At(c));
|
|
2105
|
+
};
|
|
2106
|
+
if (a !== void 0) {
|
|
2107
|
+
const r = k(a, t)(n);
|
|
2108
|
+
return d.span(s.class("bc-format-date"), r);
|
|
2109
|
+
}
|
|
2110
|
+
return R(et, ({ locale: r }) => {
|
|
2111
|
+
const c = k(r, t)(n);
|
|
2112
|
+
return d.span(s.class("bc-format-date"), c);
|
|
2113
|
+
});
|
|
2114
|
+
}
|
|
2115
|
+
function zt(e) {
|
|
2116
|
+
return typeof e == "object" && e !== null && !(e instanceof Date) && "toLocaleString" in e;
|
|
2117
|
+
}
|
|
2118
|
+
function Ft(e) {
|
|
2119
|
+
return e instanceof Date ? e : new Date(e);
|
|
2120
|
+
}
|
|
2121
|
+
function H(e) {
|
|
2122
|
+
return e !== void 0 ? m.get(e) : void 0;
|
|
2123
|
+
}
|
|
2124
|
+
function ze(e) {
|
|
2125
|
+
const t = {}, a = H(e.timeStyle), n = H(e.timeZone), r = H(e.hour12), c = H(e.hourCycle), o = H(e.hour), i = H(e.minute), l = H(e.second), u = H(e.fractionalSecondDigits), b = H(e.timeZoneName), f = H(e.dayPeriod);
|
|
2126
|
+
return o !== void 0 || i !== void 0 || l !== void 0 || u !== void 0 || b !== void 0 || f !== void 0 ? (o !== void 0 && (t.hour = o), i !== void 0 && (t.minute = i), l !== void 0 && (t.second = l), u !== void 0 && (t.fractionalSecondDigits = u), b !== void 0 && (t.timeZoneName = b), f !== void 0 && (t.dayPeriod = f)) : t.timeStyle = a ?? "medium", n !== void 0 && (t.timeZone = n), r !== void 0 && (t.hour12 = r), c !== void 0 && (t.hourCycle = c), t;
|
|
2127
|
+
}
|
|
2128
|
+
function Ka(e, t, a) {
|
|
2129
|
+
return zt(e) ? e.toLocaleString(t, a) : new Intl.DateTimeFormat(t, a).format(Ft(e));
|
|
2130
|
+
}
|
|
2131
|
+
function Ja(e) {
|
|
2132
|
+
const { value: t, locale: a } = e, n = (r, c) => {
|
|
2133
|
+
const o = ze(e);
|
|
2134
|
+
return zt(c) ? c.toLocaleString(r, o) : new Intl.DateTimeFormat(r, o).format(Ft(c));
|
|
2135
|
+
};
|
|
2136
|
+
if (a !== void 0) {
|
|
2137
|
+
const r = k(a, t)(n);
|
|
2138
|
+
return d.span(s.class("bc-format-time"), r);
|
|
2139
|
+
}
|
|
2140
|
+
return R(et, ({ locale: r }) => {
|
|
2141
|
+
const c = k(r, t)(n);
|
|
2142
|
+
return d.span(s.class("bc-format-time"), c);
|
|
2143
|
+
});
|
|
2144
|
+
}
|
|
2145
|
+
function jt(e) {
|
|
2146
|
+
return typeof e == "object" && e !== null && !(e instanceof Date) && "toLocaleString" in e;
|
|
2147
|
+
}
|
|
2148
|
+
function Et(e) {
|
|
2149
|
+
return e instanceof Date ? e : new Date(e);
|
|
2150
|
+
}
|
|
2151
|
+
function X(e) {
|
|
2152
|
+
return e !== void 0 ? m.get(e) : void 0;
|
|
2153
|
+
}
|
|
2154
|
+
function Fe(e) {
|
|
2155
|
+
const t = X(e.dateStyle), a = X(e.timeStyle), n = X(e.timeZone), r = X(e.calendar), c = X(e.hour12), o = X(e.hourCycle), i = {
|
|
2156
|
+
dateStyle: t ?? "medium",
|
|
2157
|
+
timeStyle: a ?? "short"
|
|
2158
|
+
};
|
|
2159
|
+
return n !== void 0 && (i.timeZone = n), r !== void 0 && (i.calendar = r), c !== void 0 && (i.hour12 = c), o !== void 0 && (i.hourCycle = o), i;
|
|
2160
|
+
}
|
|
2161
|
+
function Qa(e, t, a) {
|
|
2162
|
+
return jt(e) ? e.toLocaleString(t, a) : new Intl.DateTimeFormat(t, a).format(Et(e));
|
|
2163
|
+
}
|
|
2164
|
+
function Xa(e) {
|
|
2165
|
+
const { value: t, locale: a } = e, n = (r, c) => {
|
|
2166
|
+
const o = Fe(e);
|
|
2167
|
+
return jt(c) ? c.toLocaleString(r, o) : new Intl.DateTimeFormat(r, o).format(Et(c));
|
|
2168
|
+
};
|
|
2169
|
+
if (a !== void 0) {
|
|
2170
|
+
const r = k(a, t)(n);
|
|
2171
|
+
return d.span(s.class("bc-format-date-time"), r);
|
|
2172
|
+
}
|
|
2173
|
+
return R(et, ({ locale: r }) => {
|
|
2174
|
+
const c = k(r, t)(n);
|
|
2175
|
+
return d.span(s.class("bc-format-date-time"), c);
|
|
2176
|
+
});
|
|
2177
|
+
}
|
|
2178
|
+
function Ya(e, t, a, n) {
|
|
2179
|
+
return new Intl.RelativeTimeFormat(a, n).format(e, t);
|
|
2180
|
+
}
|
|
2181
|
+
function ts(e) {
|
|
2182
|
+
const { value: t, unit: a, locale: n } = e, r = (o) => o !== void 0 ? m.get(o) : void 0, c = (o, i, l) => {
|
|
2183
|
+
const u = {}, b = r(e.numeric), f = r(e.style);
|
|
2184
|
+
return b !== void 0 && (u.numeric = b), f !== void 0 && (u.style = f), new Intl.RelativeTimeFormat(o, u).format(i, l);
|
|
2185
|
+
};
|
|
2186
|
+
if (n !== void 0) {
|
|
2187
|
+
const o = k(n, t, a)(c);
|
|
2188
|
+
return d.span(s.class("bc-format-relative-time"), o);
|
|
2189
|
+
}
|
|
2190
|
+
return R(et, ({ locale: o }) => {
|
|
2191
|
+
const i = k(o, t, a)(c);
|
|
2192
|
+
return d.span(s.class("bc-format-relative-time"), i);
|
|
2193
|
+
});
|
|
2194
|
+
}
|
|
2195
|
+
function es(e) {
|
|
2196
|
+
const { value: t, locale: a, units: n } = e, r = (c, o) => Ut(o, {
|
|
2197
|
+
locale: c,
|
|
2198
|
+
units: n,
|
|
2199
|
+
decimalPlaces: e.decimalPlaces !== void 0 ? m.get(e.decimalPlaces) : void 0
|
|
2200
|
+
});
|
|
2201
|
+
if (a !== void 0) {
|
|
2202
|
+
const c = k(a, t)(r);
|
|
2203
|
+
return d.span(s.class("bc-format-file-size"), c);
|
|
2204
|
+
}
|
|
2205
|
+
return R(et, ({ locale: c }) => {
|
|
2206
|
+
const o = k(c, t)(r);
|
|
2207
|
+
return d.span(s.class("bc-format-file-size"), o);
|
|
2208
|
+
});
|
|
2209
|
+
}
|
|
2210
|
+
function je(e) {
|
|
2211
|
+
return ["bc-breadcrumbs", `bc-breadcrumbs--size-${e}`].join(" ");
|
|
2212
|
+
}
|
|
2213
|
+
function Ee(e, t) {
|
|
2214
|
+
if (e.length <= t)
|
|
2215
|
+
return e;
|
|
2216
|
+
const a = e[0], n = e.slice(-(t - 1));
|
|
2217
|
+
return [a, { isEllipsis: !0 }, ...n];
|
|
2218
|
+
}
|
|
2219
|
+
function as({
|
|
2220
|
+
items: e,
|
|
2221
|
+
separator: t = "›",
|
|
2222
|
+
maxItems: a,
|
|
2223
|
+
size: n = "md"
|
|
2224
|
+
}) {
|
|
2225
|
+
const r = a != null ? k(
|
|
2226
|
+
e,
|
|
2227
|
+
a
|
|
2228
|
+
)((c, o) => o && o > 0 ? Ee(c, o) : c) : m.map(
|
|
2229
|
+
e,
|
|
2230
|
+
(c) => c
|
|
2231
|
+
);
|
|
2232
|
+
return R(
|
|
2233
|
+
J,
|
|
2234
|
+
(c) => d.nav(
|
|
2235
|
+
s.class(m.map(n, (o) => je(o ?? "md"))),
|
|
2236
|
+
D.label(c.$.breadcrumbs),
|
|
2237
|
+
d.ol(
|
|
2238
|
+
s.class("bc-breadcrumbs__list"),
|
|
2239
|
+
Q(
|
|
2240
|
+
r,
|
|
2241
|
+
(o) => {
|
|
2242
|
+
const i = o.map(
|
|
2243
|
+
(u) => "isEllipsis" in u && u.isEllipsis === !0
|
|
2244
|
+
), l = o.map(
|
|
2245
|
+
(u) => !("isEllipsis" in u) && u.current === !0
|
|
2246
|
+
);
|
|
2247
|
+
return I(
|
|
2248
|
+
i,
|
|
2249
|
+
() => d.li(
|
|
2250
|
+
s.class("bc-breadcrumbs__item bc-breadcrumbs__ellipsis"),
|
|
2251
|
+
D.hidden(!0),
|
|
2252
|
+
"..."
|
|
2253
|
+
),
|
|
2254
|
+
() => {
|
|
2255
|
+
const u = o.map(
|
|
2256
|
+
(p) => !("isEllipsis" in p) && p.href != null
|
|
2257
|
+
), b = o.map(
|
|
2258
|
+
(p) => !("isEllipsis" in p) && p.href == null && p.onClick != null
|
|
2259
|
+
), f = o.map(
|
|
2260
|
+
(p) => !("isEllipsis" in p) && p.icon != null
|
|
2261
|
+
), g = (p) => [
|
|
2262
|
+
s.class(p),
|
|
2263
|
+
I(
|
|
2264
|
+
f,
|
|
2265
|
+
() => U({
|
|
2266
|
+
icon: o.map(
|
|
2267
|
+
(h) => "isEllipsis" in h ? "" : h.icon ?? ""
|
|
2268
|
+
),
|
|
2269
|
+
size: n,
|
|
2270
|
+
accessibility: "decorative"
|
|
2271
|
+
})
|
|
2272
|
+
),
|
|
2273
|
+
d.span(
|
|
2274
|
+
o.map((h) => "isEllipsis" in h ? "" : h.label)
|
|
2275
|
+
)
|
|
2276
|
+
];
|
|
2277
|
+
return d.li(
|
|
2278
|
+
s.class(
|
|
2279
|
+
m.map(
|
|
2280
|
+
l,
|
|
2281
|
+
(p) => p ? "bc-breadcrumbs__item bc-breadcrumbs__item--current" : "bc-breadcrumbs__item"
|
|
2282
|
+
)
|
|
2283
|
+
),
|
|
2284
|
+
I(l, () => D.current("page")),
|
|
2285
|
+
// Render as link, button, or span based on item properties
|
|
2286
|
+
I(
|
|
2287
|
+
u,
|
|
2288
|
+
() => d.a(
|
|
2289
|
+
s.href(
|
|
2290
|
+
o.map(
|
|
2291
|
+
(p) => "isEllipsis" in p ? "" : p.href ?? ""
|
|
2292
|
+
)
|
|
2293
|
+
),
|
|
2294
|
+
...g("bc-breadcrumbs__link")
|
|
2295
|
+
),
|
|
2296
|
+
() => I(
|
|
2297
|
+
b,
|
|
2298
|
+
() => d.button(
|
|
2299
|
+
s.type("button"),
|
|
2300
|
+
T.click(() => {
|
|
2301
|
+
const p = m.get(o);
|
|
2302
|
+
"isEllipsis" in p || p.onClick?.();
|
|
2303
|
+
}),
|
|
2304
|
+
...g("bc-breadcrumbs__button")
|
|
2305
|
+
),
|
|
2306
|
+
() => d.span(...g("bc-breadcrumbs__text"))
|
|
2307
|
+
)
|
|
2308
|
+
)
|
|
2309
|
+
);
|
|
2310
|
+
}
|
|
2311
|
+
);
|
|
2312
|
+
},
|
|
2313
|
+
// Native separator between items
|
|
2314
|
+
() => d.li(
|
|
2315
|
+
s.class("bc-breadcrumbs__separator"),
|
|
2316
|
+
D.hidden(!0),
|
|
2317
|
+
t
|
|
2318
|
+
)
|
|
2319
|
+
)
|
|
2320
|
+
)
|
|
2321
|
+
)
|
|
2322
|
+
);
|
|
2323
|
+
}
|
|
2324
|
+
const Bt = ({
|
|
2325
|
+
viewTransition: e,
|
|
2326
|
+
state: t,
|
|
2327
|
+
scroll: a,
|
|
2328
|
+
replace: n
|
|
2329
|
+
}) => {
|
|
2330
|
+
const r = {};
|
|
2331
|
+
return t !== void 0 && (r.state = t), a !== void 0 && (r.scroll = a), n !== void 0 && (r.replace = n), e !== void 0 && (r.viewTransition = e), r;
|
|
2332
|
+
};
|
|
2333
|
+
function _t(e, t) {
|
|
2334
|
+
const a = ["bc-link"];
|
|
2335
|
+
if (t)
|
|
2336
|
+
a.push("bc-link--disabled");
|
|
2337
|
+
else
|
|
2338
|
+
switch (e) {
|
|
2339
|
+
case "plain":
|
|
2340
|
+
a.push("bc-link--plain");
|
|
2341
|
+
break;
|
|
2342
|
+
case "hover":
|
|
2343
|
+
a.push("bc-link--hover");
|
|
2344
|
+
break;
|
|
2345
|
+
default:
|
|
2346
|
+
a.push("bc-link--default");
|
|
2347
|
+
break;
|
|
2348
|
+
}
|
|
2349
|
+
return a.join(" ");
|
|
2350
|
+
}
|
|
2351
|
+
function yt(e) {
|
|
2352
|
+
const t = j(e, "light"), a = j(e, "dark");
|
|
2353
|
+
return [
|
|
2354
|
+
`--link-color: ${t}`,
|
|
2355
|
+
`--link-color-dark: ${a}`,
|
|
2356
|
+
`--link-hover-color: ${t}`,
|
|
2357
|
+
`--link-hover-color-dark: ${a}`
|
|
2358
|
+
].join("; ");
|
|
2359
|
+
}
|
|
2360
|
+
function Be({
|
|
2361
|
+
href: e,
|
|
2362
|
+
variant: t = "default",
|
|
2363
|
+
color: a = "primary",
|
|
2364
|
+
colorDisabled: n = "base",
|
|
2365
|
+
disabled: r = !1,
|
|
2366
|
+
viewTransition: c = !0,
|
|
2367
|
+
state: o,
|
|
2368
|
+
scroll: i,
|
|
2369
|
+
replace: l,
|
|
2370
|
+
target: u,
|
|
2371
|
+
rel: b
|
|
2372
|
+
}, ...f) {
|
|
2373
|
+
return I(
|
|
2374
|
+
r,
|
|
2375
|
+
() => d.span(
|
|
2376
|
+
s.class(
|
|
2377
|
+
k(
|
|
2378
|
+
t,
|
|
2379
|
+
r
|
|
2380
|
+
)((g, p) => _t(g, p))
|
|
2381
|
+
),
|
|
2382
|
+
s.style(
|
|
2383
|
+
k(n)(
|
|
2384
|
+
(g) => yt(g ?? "base")
|
|
2385
|
+
)
|
|
2386
|
+
),
|
|
2387
|
+
...f
|
|
2388
|
+
),
|
|
2389
|
+
() => St(
|
|
2390
|
+
{
|
|
2391
|
+
href: e,
|
|
2392
|
+
...Bt({
|
|
2393
|
+
viewTransition: c,
|
|
2394
|
+
state: o,
|
|
2395
|
+
scroll: i,
|
|
2396
|
+
replace: l
|
|
2397
|
+
})
|
|
2398
|
+
},
|
|
2399
|
+
s.class(
|
|
2400
|
+
k(
|
|
2401
|
+
t,
|
|
2402
|
+
r
|
|
2403
|
+
)((g, p) => _t(g, p))
|
|
2404
|
+
),
|
|
2405
|
+
s.style(
|
|
2406
|
+
k(a)((g) => yt(g ?? "primary"))
|
|
2407
|
+
),
|
|
2408
|
+
u ? s.target(u) : null,
|
|
2409
|
+
b ? s.rel(b) : null,
|
|
2410
|
+
...f
|
|
2411
|
+
)
|
|
2412
|
+
);
|
|
2413
|
+
}
|
|
2414
|
+
const Oe = (e) => e ? e.startsWith("#") ? e : `#${e}` : "", Re = (e) => {
|
|
2415
|
+
if (!e) return new URLSearchParams();
|
|
2416
|
+
if (typeof e == "string") {
|
|
2417
|
+
const t = e.startsWith("?") ? e.slice(1) : e;
|
|
2418
|
+
return new URLSearchParams(t);
|
|
2419
|
+
}
|
|
2420
|
+
return e instanceof URLSearchParams ? new URLSearchParams(e) : new URLSearchParams(e);
|
|
2421
|
+
};
|
|
2422
|
+
function Me(e, t, a) {
|
|
2423
|
+
const n = Re(e.search), r = n.toString(), c = r ? `?${r}` : "", o = Oe(e.hash);
|
|
2424
|
+
switch (a) {
|
|
2425
|
+
case "exact":
|
|
2426
|
+
return e.pathname + c + o === t;
|
|
2427
|
+
case "prefix":
|
|
2428
|
+
return e.pathname.startsWith(t) || (e.pathname + c).startsWith(t);
|
|
2429
|
+
case "params":
|
|
2430
|
+
try {
|
|
2431
|
+
const i = typeof document < "u" && document.baseURI ? document.baseURI : "http://localhost/", l = new URL(t, i);
|
|
2432
|
+
if (e.pathname !== l.pathname)
|
|
2433
|
+
return !1;
|
|
2434
|
+
const u = Array.from(
|
|
2435
|
+
new URLSearchParams(l.search).entries()
|
|
2436
|
+
).sort(), b = Array.from(n.entries()).sort();
|
|
2437
|
+
return u.length !== b.length ? !1 : u.every(([f, g], p) => {
|
|
2438
|
+
const [h, v] = b[p];
|
|
2439
|
+
return f === h && g === v;
|
|
2440
|
+
});
|
|
2441
|
+
} catch {
|
|
2442
|
+
return e.pathname === t;
|
|
2443
|
+
}
|
|
2444
|
+
default:
|
|
2445
|
+
return !1;
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
function Ot(e, t) {
|
|
2449
|
+
return t === "exact" ? k(e)((a) => a) : k(e)(
|
|
2450
|
+
(a) => (n) => Me(n, a, t)
|
|
2451
|
+
);
|
|
2452
|
+
}
|
|
2453
|
+
function ss({
|
|
2454
|
+
href: e,
|
|
2455
|
+
matchMode: t = "exact",
|
|
2456
|
+
disableWhenActive: a = !0,
|
|
2457
|
+
...n
|
|
2458
|
+
}, ...r) {
|
|
2459
|
+
return R(Lt, (c) => {
|
|
2460
|
+
const o = c.matchSignal(
|
|
2461
|
+
Ot(e, t)
|
|
2462
|
+
), i = k(
|
|
2463
|
+
o,
|
|
2464
|
+
a
|
|
2465
|
+
)((l, u) => u ?? !0 ? l : !1);
|
|
2466
|
+
return Be(
|
|
2467
|
+
{
|
|
2468
|
+
...n,
|
|
2469
|
+
href: e,
|
|
2470
|
+
disabled: i
|
|
2471
|
+
},
|
|
2472
|
+
...r
|
|
2473
|
+
);
|
|
2474
|
+
});
|
|
2475
|
+
}
|
|
2476
|
+
const Pe = {
|
|
2477
|
+
mark: Pt("SidebarContext"),
|
|
2478
|
+
create: (e) => ({
|
|
2479
|
+
value: {
|
|
2480
|
+
backgroundMode: "light"
|
|
2481
|
+
},
|
|
2482
|
+
dispose: () => {
|
|
2483
|
+
}
|
|
2484
|
+
})
|
|
2485
|
+
};
|
|
2486
|
+
function rs({ backgroundMode: e = "light" }, ...t) {
|
|
2487
|
+
return Mt(
|
|
2488
|
+
Pe,
|
|
2489
|
+
m.map(
|
|
2490
|
+
e,
|
|
2491
|
+
(a) => ({
|
|
2492
|
+
backgroundMode: a
|
|
2493
|
+
})
|
|
2494
|
+
),
|
|
2495
|
+
() => d.div(
|
|
2496
|
+
s.class("bc-sidebar"),
|
|
2497
|
+
s.class(
|
|
2498
|
+
m.map(
|
|
2499
|
+
e,
|
|
2500
|
+
(a) => a === "dark" ? "bc-sidebar--dark-bg" : ""
|
|
2501
|
+
)
|
|
2502
|
+
),
|
|
2503
|
+
...t
|
|
2504
|
+
)
|
|
2505
|
+
);
|
|
2506
|
+
}
|
|
2507
|
+
function ns({ rail: e, header: t }, ...a) {
|
|
2508
|
+
return Zt(
|
|
2509
|
+
t != null ? d.div(s.class("bc-sidebar-group__header"), t) : null,
|
|
2510
|
+
d.div(
|
|
2511
|
+
s.class(
|
|
2512
|
+
m.map(
|
|
2513
|
+
e ?? !1,
|
|
2514
|
+
(n) => n ? "bc-sidebar-group--rail" : ""
|
|
2515
|
+
)
|
|
2516
|
+
),
|
|
2517
|
+
s.class("bc-sidebar-group"),
|
|
2518
|
+
...a
|
|
2519
|
+
)
|
|
2520
|
+
);
|
|
2521
|
+
}
|
|
2522
|
+
function Ue(e, ...t) {
|
|
2523
|
+
const a = Bt({
|
|
2524
|
+
viewTransition: e.viewTransition ?? !0,
|
|
2525
|
+
state: e.state,
|
|
2526
|
+
scroll: e.scroll,
|
|
2527
|
+
replace: e.replace
|
|
2528
|
+
});
|
|
2529
|
+
return St({ href: e.href, ...a }, ...t);
|
|
2530
|
+
}
|
|
2531
|
+
function Ge(...e) {
|
|
2532
|
+
return d.span(...e);
|
|
2533
|
+
}
|
|
2534
|
+
function Ve(e, ...t) {
|
|
2535
|
+
return d.button(
|
|
2536
|
+
s.type("button"),
|
|
2537
|
+
T.click(e.onClick),
|
|
2538
|
+
e.ariaExpanded != null ? D.expanded(
|
|
2539
|
+
m.map(
|
|
2540
|
+
e.ariaExpanded,
|
|
2541
|
+
(a) => a
|
|
2542
|
+
)
|
|
2543
|
+
) : null,
|
|
2544
|
+
e.ariaControls != null ? D.controls(e.ariaControls) : null,
|
|
2545
|
+
e.ariaLabel != null ? D.label(e.ariaLabel) : null,
|
|
2546
|
+
...t
|
|
2547
|
+
);
|
|
2548
|
+
}
|
|
2549
|
+
function os(e) {
|
|
2550
|
+
const t = [s.class("bc-sidebar-link")];
|
|
2551
|
+
return e.icon != null && t.push(
|
|
2552
|
+
d.span(
|
|
2553
|
+
s.class("bc-sidebar-link--icon"),
|
|
2554
|
+
U({ icon: e.icon })
|
|
2555
|
+
)
|
|
2556
|
+
), t.push(
|
|
2557
|
+
d.span(s.class("bc-sidebar-link__content"), e.content)
|
|
2558
|
+
), e.after != null && t.push(
|
|
2559
|
+
d.span(s.class("bc-sidebar-link__right"), e.after)
|
|
2560
|
+
), e.action != null && t.push(
|
|
2561
|
+
d.button(
|
|
2562
|
+
s.type("button"),
|
|
2563
|
+
s.class("bc-sidebar-link--action"),
|
|
2564
|
+
T.click((a, n) => {
|
|
2565
|
+
e.action?.onClick?.(n);
|
|
2566
|
+
}),
|
|
2567
|
+
U({ icon: e.action?.icon })
|
|
2568
|
+
)
|
|
2569
|
+
), "onClick" in e ? Ve(e, ...t) : R(Lt, (a) => {
|
|
2570
|
+
const n = a.matchSignal(
|
|
2571
|
+
Ot(e.href, "exact"),
|
|
2572
|
+
{
|
|
2573
|
+
includeSearch: !1,
|
|
2574
|
+
includeHash: !1
|
|
2575
|
+
}
|
|
2576
|
+
);
|
|
2577
|
+
return I(
|
|
2578
|
+
n,
|
|
2579
|
+
() => Ge(...t),
|
|
2580
|
+
() => Ue(e, ...t)
|
|
2581
|
+
);
|
|
2582
|
+
});
|
|
2583
|
+
}
|
|
2584
|
+
function Ne(e, t, a, n) {
|
|
2585
|
+
const r = ["bc-tabs", `bc-tabs--${e}`, `bc-tabs--${t}`];
|
|
2586
|
+
return a && r.push("bc-tabs--disabled"), n != null && n !== "default" && r.push(`bc-tabs--variant-${n}`), r.join(" ");
|
|
2587
|
+
}
|
|
2588
|
+
function He(e, t) {
|
|
2589
|
+
const a = /* @__PURE__ */ new Map(), n = t === "white" || t === "black" || t === "transparent" ? "var(--color-primary-600)" : P(t, 600), r = t === "white" || t === "black" || t === "transparent" ? "var(--color-primary-400)" : P(t, 400), c = t === "white" || t === "black" || t === "transparent" ? "var(--color-primary-500)" : P(t, 500), o = t === "white" || t === "black" || t === "transparent" ? "var(--color-primary-400)" : P(t, 400);
|
|
2590
|
+
if (a.set("--tabs-active-color", n), a.set("--tabs-active-color-dark", r), a.set("--tabs-indicator-color", c), a.set("--tabs-indicator-color-dark", o), e === "filled") {
|
|
2591
|
+
const i = F(t, "solid", "light"), l = F(t, "solid", "dark");
|
|
2592
|
+
a.set("--tabs-filled-inactive-bg", i.backgroundColor), a.set("--tabs-filled-inactive-text", "var(--color-white)");
|
|
2593
|
+
const u = z(t, "solid", "light");
|
|
2594
|
+
a.set("--tabs-filled-inactive-bg-hover", u.backgroundColor);
|
|
2595
|
+
const b = z(t, "solid", "dark");
|
|
2596
|
+
a.set(
|
|
2597
|
+
"--tabs-filled-inactive-bg-dark-hover",
|
|
2598
|
+
b.backgroundColor
|
|
2599
|
+
), a.set("--tabs-filled-inactive-bg-dark", l.backgroundColor), a.set("--tabs-filled-inactive-text-dark", l.textColor), a.set("--tabs-filled-active-bg", "var(--color-white)"), a.set("--tabs-filled-active-text", "var(--color-base-800)"), a.set("--tabs-filled-active-bg-dark", "var(--color-base-900)"), a.set("--tabs-filled-active-text-dark", r);
|
|
2600
|
+
}
|
|
2601
|
+
return e === "outline" && (a.set("--tabs-outline-active-border", o), a.set(
|
|
2602
|
+
"--tabs-outline-active-border-dark",
|
|
2603
|
+
P(
|
|
2604
|
+
t === "white" || t === "black" || t === "transparent" ? "primary" : t,
|
|
2605
|
+
600
|
|
2606
|
+
)
|
|
2607
|
+
)), Array.from(a.entries()).map(([i, l]) => `${i}: ${l}`).join("; ");
|
|
2608
|
+
}
|
|
2609
|
+
function We(e, t, a) {
|
|
2610
|
+
const n = ["bc-tab", `bc-tab--${e}`];
|
|
2611
|
+
return t && n.push("bc-tab--active"), a && n.push("bc-tab--disabled"), n.join(" ");
|
|
2612
|
+
}
|
|
2613
|
+
function rt(e, t, a) {
|
|
2614
|
+
const n = t.length;
|
|
2615
|
+
let r = e + a;
|
|
2616
|
+
r >= n ? r = 0 : r < 0 && (r = n - 1);
|
|
2617
|
+
let c = 0;
|
|
2618
|
+
for (; c < n; ) {
|
|
2619
|
+
const o = t[r];
|
|
2620
|
+
if (!m.get(o.disabled ?? !1))
|
|
2621
|
+
return r;
|
|
2622
|
+
r += a, r >= n ? r = 0 : r < 0 && (r = n - 1), c++;
|
|
2623
|
+
}
|
|
2624
|
+
return e;
|
|
2625
|
+
}
|
|
2626
|
+
function is(e) {
|
|
2627
|
+
const {
|
|
2628
|
+
items: t,
|
|
2629
|
+
value: a,
|
|
2630
|
+
onChange: n,
|
|
2631
|
+
size: r = "md",
|
|
2632
|
+
variant: c = "default",
|
|
2633
|
+
color: o = "primary",
|
|
2634
|
+
disabled: i = !1,
|
|
2635
|
+
orientation: l = "horizontal",
|
|
2636
|
+
showContent: u = !0,
|
|
2637
|
+
ariaLabel: b
|
|
2638
|
+
} = e, f = K("tablist"), g = V(-1), p = t.map((v, S) => {
|
|
2639
|
+
const x = k(a)(($) => $ === v.key), A = k(
|
|
2640
|
+
i,
|
|
2641
|
+
v.disabled
|
|
2642
|
+
)(($, w) => $ || w), B = `${f}-tab-${v.key}`, C = `${f}-panel-${v.key}`;
|
|
2643
|
+
return { item: v, index: S, isActive: x, isTabDisabled: A, tabId: B, panelId: C };
|
|
2644
|
+
}), h = (v) => {
|
|
2645
|
+
if (m.get(i)) return;
|
|
2646
|
+
const x = g.value, A = m.get(l) === "horizontal";
|
|
2647
|
+
let B = x;
|
|
2648
|
+
switch (v.key) {
|
|
2649
|
+
case (A ? "ArrowRight" : "ArrowDown"):
|
|
2650
|
+
v.preventDefault(), B = rt(x, t, 1);
|
|
2651
|
+
break;
|
|
2652
|
+
case (A ? "ArrowLeft" : "ArrowUp"):
|
|
2653
|
+
v.preventDefault(), B = rt(x, t, -1);
|
|
2654
|
+
break;
|
|
2655
|
+
case "Home":
|
|
2656
|
+
v.preventDefault(), B = rt(-1, t, 1);
|
|
2657
|
+
break;
|
|
2658
|
+
case "End":
|
|
2659
|
+
v.preventDefault(), B = rt(t.length, t, -1);
|
|
2660
|
+
break;
|
|
2661
|
+
case "Enter":
|
|
2662
|
+
case " ":
|
|
2663
|
+
if (v.preventDefault(), x >= 0 && x < t.length) {
|
|
2664
|
+
const C = t[x];
|
|
2665
|
+
m.get(C.disabled ?? !1) || n?.(C.key);
|
|
2666
|
+
}
|
|
2667
|
+
break;
|
|
2668
|
+
}
|
|
2669
|
+
B !== x && B >= 0 && B < t.length && (g.set(B), setTimeout(() => {
|
|
2670
|
+
const C = document.querySelector(
|
|
2671
|
+
`[data-tab-index="${B}"]`
|
|
2672
|
+
);
|
|
2673
|
+
C && C.focus();
|
|
2674
|
+
}, 0));
|
|
2675
|
+
};
|
|
2676
|
+
return d.div(
|
|
2677
|
+
s.class(
|
|
2678
|
+
k(
|
|
2679
|
+
r,
|
|
2680
|
+
l,
|
|
2681
|
+
i,
|
|
2682
|
+
c
|
|
2683
|
+
)(
|
|
2684
|
+
(v, S, x, A) => Ne(
|
|
2685
|
+
v ?? "md",
|
|
2686
|
+
S ?? "horizontal",
|
|
2687
|
+
x ?? !1,
|
|
2688
|
+
A ?? "default"
|
|
2689
|
+
)
|
|
2690
|
+
)
|
|
2691
|
+
),
|
|
2692
|
+
s.style(
|
|
2693
|
+
k(
|
|
2694
|
+
c,
|
|
2695
|
+
o
|
|
2696
|
+
)(
|
|
2697
|
+
(v, S) => He(v ?? "default", S ?? "primary")
|
|
2698
|
+
)
|
|
2699
|
+
),
|
|
2700
|
+
// Tab list
|
|
2701
|
+
d.div(
|
|
2702
|
+
s.class("bc-tabs__list"),
|
|
2703
|
+
s.role("tablist"),
|
|
2704
|
+
s.id(f),
|
|
2705
|
+
D.orientation(
|
|
2706
|
+
l ?? "horizontal"
|
|
2707
|
+
),
|
|
2708
|
+
D.label(b),
|
|
2709
|
+
T.keydown(h),
|
|
2710
|
+
...p.map(
|
|
2711
|
+
({ item: v, index: S, isActive: x, isTabDisabled: A, tabId: B, panelId: C }) => d.button(
|
|
2712
|
+
s.type("button"),
|
|
2713
|
+
s.class(
|
|
2714
|
+
k(
|
|
2715
|
+
r,
|
|
2716
|
+
x,
|
|
2717
|
+
A
|
|
2718
|
+
)(
|
|
2719
|
+
($, w, y) => We(
|
|
2720
|
+
$ ?? "md",
|
|
2721
|
+
w ?? !1,
|
|
2722
|
+
y ?? !1
|
|
2723
|
+
)
|
|
2724
|
+
)
|
|
2725
|
+
),
|
|
2726
|
+
s.id(B),
|
|
2727
|
+
s.role("tab"),
|
|
2728
|
+
s.tabindex(
|
|
2729
|
+
k(
|
|
2730
|
+
x,
|
|
2731
|
+
g
|
|
2732
|
+
)(($, w) => $ || w === S ? 0 : -1)
|
|
2733
|
+
),
|
|
2734
|
+
D.selected(x),
|
|
2735
|
+
D.controls(C),
|
|
2736
|
+
D.disabled(A),
|
|
2737
|
+
s.disabled(A),
|
|
2738
|
+
$t("tab-index", String(S)),
|
|
2739
|
+
D.label(v.ariaLabel),
|
|
2740
|
+
T.click(($) => {
|
|
2741
|
+
$.preventDefault(), m.get(v.disabled ?? !1) || m.get(i) || (n?.(v.key), g.set(S));
|
|
2742
|
+
}),
|
|
2743
|
+
T.focus(() => {
|
|
2744
|
+
g.set(S);
|
|
2745
|
+
}),
|
|
2746
|
+
v.label
|
|
2747
|
+
)
|
|
2748
|
+
)
|
|
2749
|
+
),
|
|
2750
|
+
// Panels
|
|
2751
|
+
I(
|
|
2752
|
+
u ?? !0,
|
|
2753
|
+
() => d.div(
|
|
2754
|
+
s.class("bc-tabs__panels"),
|
|
2755
|
+
...p.map(
|
|
2756
|
+
({ item: v, isActive: S, tabId: x, panelId: A }) => I(
|
|
2757
|
+
S,
|
|
2758
|
+
() => d.div(
|
|
2759
|
+
s.class("bc-tabs__panel"),
|
|
2760
|
+
s.id(A),
|
|
2761
|
+
s.role("tabpanel"),
|
|
2762
|
+
s.tabindex(0),
|
|
2763
|
+
D.labelledby(x),
|
|
2764
|
+
v.content()
|
|
2765
|
+
)
|
|
2766
|
+
)
|
|
2767
|
+
)
|
|
2768
|
+
)
|
|
2769
|
+
)
|
|
2770
|
+
);
|
|
2771
|
+
}
|
|
2772
|
+
function Rt(e, t, a, n, r, c, o) {
|
|
2773
|
+
const i = e.map(
|
|
2774
|
+
(p) => p.children != null && p.children.length > 0
|
|
2775
|
+
), l = k(
|
|
2776
|
+
n,
|
|
2777
|
+
e
|
|
2778
|
+
)((p, h) => p.has(h.id)), u = k(
|
|
2779
|
+
a,
|
|
2780
|
+
e
|
|
2781
|
+
)((p, h) => p === h.id), b = e.map((p) => p.children ?? []), f = () => {
|
|
2782
|
+
r?.(m.get(e).id);
|
|
2783
|
+
}, g = (p) => {
|
|
2784
|
+
p.stopPropagation(), c(m.get(e).id);
|
|
2785
|
+
};
|
|
2786
|
+
return d.div(
|
|
2787
|
+
s.class("bc-tree-item"),
|
|
2788
|
+
// The clickable row
|
|
2789
|
+
d.div(
|
|
2790
|
+
s.class(
|
|
2791
|
+
k(
|
|
2792
|
+
u,
|
|
2793
|
+
o
|
|
2794
|
+
)(
|
|
2795
|
+
(p, h) => [
|
|
2796
|
+
"bc-tree-item__row",
|
|
2797
|
+
`bc-tree-item__row--size-${h ?? "md"}`,
|
|
2798
|
+
p ? "bc-tree-item__row--selected" : ""
|
|
2799
|
+
].filter(Boolean).join(" ")
|
|
2800
|
+
)
|
|
2801
|
+
),
|
|
2802
|
+
s.style(`padding-left: ${t * 20 + 8}px`),
|
|
2803
|
+
s.role("treeitem"),
|
|
2804
|
+
s.tabindex(0),
|
|
2805
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2806
|
+
D.selected(u),
|
|
2807
|
+
q((p) => {
|
|
2808
|
+
const h = k(
|
|
2809
|
+
i,
|
|
2810
|
+
l
|
|
2811
|
+
)((v, S) => v ? String(S) : null);
|
|
2812
|
+
m.on(h, (v) => {
|
|
2813
|
+
v != null ? p.setAttribute("aria-expanded", v) : p.removeAttribute("aria-expanded");
|
|
2814
|
+
});
|
|
2815
|
+
}),
|
|
2816
|
+
T.click(f),
|
|
2817
|
+
// Expand/collapse chevron
|
|
2818
|
+
I(
|
|
2819
|
+
i,
|
|
2820
|
+
() => d.span(
|
|
2821
|
+
s.class(
|
|
2822
|
+
m.map(
|
|
2823
|
+
l,
|
|
2824
|
+
(p) => [
|
|
2825
|
+
"bc-tree-item__toggle",
|
|
2826
|
+
p ? "bc-tree-item__toggle--expanded" : ""
|
|
2827
|
+
].filter(Boolean).join(" ")
|
|
2828
|
+
)
|
|
2829
|
+
),
|
|
2830
|
+
T.click(g),
|
|
2831
|
+
U({
|
|
2832
|
+
icon: "mdi:chevron-right",
|
|
2833
|
+
size: "sm",
|
|
2834
|
+
accessibility: "decorative"
|
|
2835
|
+
})
|
|
2836
|
+
),
|
|
2837
|
+
() => d.span(s.class("bc-tree-item__toggle-spacer"))
|
|
2838
|
+
),
|
|
2839
|
+
// Icon
|
|
2840
|
+
I(
|
|
2841
|
+
e.map((p) => p.icon != null),
|
|
2842
|
+
() => d.span(
|
|
2843
|
+
s.class("bc-tree-item__icon"),
|
|
2844
|
+
U({
|
|
2845
|
+
icon: e.map((p) => p.icon ?? ""),
|
|
2846
|
+
size: "sm",
|
|
2847
|
+
accessibility: "decorative"
|
|
2848
|
+
})
|
|
2849
|
+
),
|
|
2850
|
+
() => N
|
|
2851
|
+
),
|
|
2852
|
+
// Label
|
|
2853
|
+
d.span(
|
|
2854
|
+
s.class("bc-tree-item__label"),
|
|
2855
|
+
e.map((p) => p.label)
|
|
2856
|
+
),
|
|
2857
|
+
// Badge
|
|
2858
|
+
I(
|
|
2859
|
+
e.map((p) => p.badge != null),
|
|
2860
|
+
() => d.span(
|
|
2861
|
+
s.class("bc-tree-item__badge"),
|
|
2862
|
+
e.map((p) => p.badge ?? "")
|
|
2863
|
+
),
|
|
2864
|
+
() => N
|
|
2865
|
+
)
|
|
2866
|
+
),
|
|
2867
|
+
// Children (collapsible) — Collapse uses WithElement which modifies its
|
|
2868
|
+
// parent element, so it must be wrapped in its own div to avoid hiding
|
|
2869
|
+
// the entire tree item row when collapsed.
|
|
2870
|
+
I(
|
|
2871
|
+
i,
|
|
2872
|
+
() => d.div(
|
|
2873
|
+
Tt(
|
|
2874
|
+
{ open: l },
|
|
2875
|
+
d.div(
|
|
2876
|
+
s.class("bc-tree-item__children"),
|
|
2877
|
+
s.role("group"),
|
|
2878
|
+
Q(
|
|
2879
|
+
b,
|
|
2880
|
+
(p) => Rt(
|
|
2881
|
+
p,
|
|
2882
|
+
t + 1,
|
|
2883
|
+
a,
|
|
2884
|
+
n,
|
|
2885
|
+
r,
|
|
2886
|
+
c,
|
|
2887
|
+
o
|
|
2888
|
+
)
|
|
2889
|
+
)
|
|
2890
|
+
)
|
|
2891
|
+
)
|
|
2892
|
+
),
|
|
2893
|
+
() => N
|
|
2894
|
+
)
|
|
2895
|
+
);
|
|
2896
|
+
}
|
|
2897
|
+
function cs({
|
|
2898
|
+
items: e,
|
|
2899
|
+
selectedId: t,
|
|
2900
|
+
onSelect: a,
|
|
2901
|
+
expandedIds: n,
|
|
2902
|
+
onToggle: r,
|
|
2903
|
+
size: c = "md"
|
|
2904
|
+
}, ...o) {
|
|
2905
|
+
const i = V(/* @__PURE__ */ new Set()), l = n ?? i, u = t ?? V(void 0), b = (f) => {
|
|
2906
|
+
const g = m.get(l), p = !g.has(f);
|
|
2907
|
+
if (n == null) {
|
|
2908
|
+
const h = new Set(g);
|
|
2909
|
+
p ? h.add(f) : h.delete(f), i.set(h);
|
|
2910
|
+
}
|
|
2911
|
+
r?.(f, p);
|
|
2912
|
+
};
|
|
2913
|
+
return d.div(
|
|
2914
|
+
s.class(
|
|
2915
|
+
m.map(c, (f) => `bc-tree-view bc-tree-view--size-${f ?? "md"}`)
|
|
2916
|
+
),
|
|
2917
|
+
s.role("tree"),
|
|
2918
|
+
Q(
|
|
2919
|
+
e,
|
|
2920
|
+
(f) => Rt(
|
|
2921
|
+
f,
|
|
2922
|
+
0,
|
|
2923
|
+
u,
|
|
2924
|
+
l,
|
|
2925
|
+
a,
|
|
2926
|
+
b,
|
|
2927
|
+
c
|
|
2928
|
+
)
|
|
2929
|
+
),
|
|
2930
|
+
...o
|
|
2931
|
+
);
|
|
2932
|
+
}
|
|
2933
|
+
function Ze(e, t, a, n) {
|
|
2934
|
+
const r = [
|
|
2935
|
+
"bc-stepper",
|
|
2936
|
+
`bc-stepper--${e}`,
|
|
2937
|
+
`bc-stepper--size-${a}`
|
|
2938
|
+
];
|
|
2939
|
+
return t !== "default" && r.push(`bc-stepper--${t}`), n && r.push("bc-stepper--disabled"), r.join(" ");
|
|
2940
|
+
}
|
|
2941
|
+
function qe(e) {
|
|
2942
|
+
const {
|
|
2943
|
+
steps: t,
|
|
2944
|
+
value: a = 0,
|
|
2945
|
+
onChange: n,
|
|
2946
|
+
orientation: r = "horizontal",
|
|
2947
|
+
variant: c = "default",
|
|
2948
|
+
size: o = "md",
|
|
2949
|
+
color: i = "primary",
|
|
2950
|
+
disabled: l = !1,
|
|
2951
|
+
showNavigation: u = !1
|
|
2952
|
+
} = e, b = V(m.get(a)), f = m.on(a, (y) => b.set(y)), g = V(/* @__PURE__ */ new Set()), p = (y) => {
|
|
2953
|
+
b.set(y), n?.(y);
|
|
2954
|
+
}, h = async (y, _) => {
|
|
2955
|
+
for (let L = y; L < _; L++) {
|
|
2956
|
+
const E = t[L].beforeNext;
|
|
2957
|
+
if (E && !await E())
|
|
2958
|
+
return !1;
|
|
2959
|
+
}
|
|
2960
|
+
return !0;
|
|
2961
|
+
}, v = async (y) => {
|
|
2962
|
+
if (y < 0 || y >= t.length || m.get(l)) return !1;
|
|
2963
|
+
const _ = b.value;
|
|
2964
|
+
return y === _ ? !0 : y < _ || await h(_, y) ? (p(y), !0) : !1;
|
|
2965
|
+
}, S = async () => {
|
|
2966
|
+
if (m.get(l)) return !1;
|
|
2967
|
+
const y = b.value;
|
|
2968
|
+
if (y >= t.length - 1) return !1;
|
|
2969
|
+
const _ = t[y];
|
|
2970
|
+
return _.beforeNext && !await _.beforeNext() ? !1 : (p(y + 1), !0);
|
|
2971
|
+
}, x = () => {
|
|
2972
|
+
const y = b.value;
|
|
2973
|
+
y > 0 && p(y - 1);
|
|
2974
|
+
}, A = async () => {
|
|
2975
|
+
if (m.get(l)) return !1;
|
|
2976
|
+
const y = b.value;
|
|
2977
|
+
return await h(y, t.length) ? (p(t.length), !0) : !1;
|
|
2978
|
+
}, $ = {
|
|
2979
|
+
goTo: v,
|
|
2980
|
+
next: S,
|
|
2981
|
+
prev: x,
|
|
2982
|
+
complete: A,
|
|
2983
|
+
currentStep: b,
|
|
2984
|
+
setError: (y) => {
|
|
2985
|
+
const _ = new Set(g.value);
|
|
2986
|
+
_.add(y), g.set(_);
|
|
2987
|
+
},
|
|
2988
|
+
clearError: (y) => {
|
|
2989
|
+
const _ = new Set(g.value);
|
|
2990
|
+
_.delete(y), g.set(_);
|
|
2991
|
+
}
|
|
2992
|
+
};
|
|
2993
|
+
return [R(J, (y) => {
|
|
2994
|
+
const _ = (L, E, O) => O.has(L) ? "error" : L < E ? "completed" : L === E ? "active" : "pending";
|
|
2995
|
+
return d.div(
|
|
2996
|
+
tt(f),
|
|
2997
|
+
s.class(
|
|
2998
|
+
k(r, c, o, l)(Ze)
|
|
2999
|
+
),
|
|
3000
|
+
s.style(
|
|
3001
|
+
m.map(
|
|
3002
|
+
i,
|
|
3003
|
+
(L) => `--stepper-color: var(--color-${L}-500); --stepper-color-dark: var(--color-${L}-400)`
|
|
3004
|
+
)
|
|
3005
|
+
),
|
|
3006
|
+
s.role("group"),
|
|
3007
|
+
D.label(
|
|
3008
|
+
k(y.$.stepper.$.step)((L) => `${L} progress`)
|
|
3009
|
+
),
|
|
3010
|
+
// Step indicators
|
|
3011
|
+
d.div(
|
|
3012
|
+
s.class("bc-stepper__indicators"),
|
|
3013
|
+
...t.map((L, E) => {
|
|
3014
|
+
const O = k(
|
|
3015
|
+
b,
|
|
3016
|
+
g
|
|
3017
|
+
)(
|
|
3018
|
+
(M, it) => _(E, M, it)
|
|
3019
|
+
), nt = m.map(
|
|
3020
|
+
O,
|
|
3021
|
+
(M) => `bc-stepper__step bc-stepper__step--${M}`
|
|
3022
|
+
), ot = L.icon ? U({ icon: L.icon, size: "xs" }) : I(
|
|
3023
|
+
m.map(O, (M) => M === "completed"),
|
|
3024
|
+
() => U({ icon: "lucide:check", size: "xs" }),
|
|
3025
|
+
() => I(
|
|
3026
|
+
m.map(O, (M) => M === "error"),
|
|
3027
|
+
() => U({ icon: "lucide:alert-triangle", size: "xs" }),
|
|
3028
|
+
() => d.span(String(E + 1))
|
|
3029
|
+
)
|
|
3030
|
+
);
|
|
3031
|
+
return [
|
|
3032
|
+
// Connector line (before each step except first)
|
|
3033
|
+
...E > 0 ? [
|
|
3034
|
+
d.div(
|
|
3035
|
+
s.class(
|
|
3036
|
+
k(
|
|
3037
|
+
b,
|
|
3038
|
+
g
|
|
3039
|
+
)((M, it) => _(
|
|
3040
|
+
E - 1,
|
|
3041
|
+
M,
|
|
3042
|
+
it
|
|
3043
|
+
) === "completed" ? "bc-stepper__connector bc-stepper__connector--completed" : "bc-stepper__connector")
|
|
3044
|
+
)
|
|
3045
|
+
)
|
|
3046
|
+
] : [],
|
|
3047
|
+
// Step indicator
|
|
3048
|
+
d.div(
|
|
3049
|
+
s.class(nt),
|
|
3050
|
+
T.click(() => {
|
|
3051
|
+
m.get(l) || v(E);
|
|
3052
|
+
}),
|
|
3053
|
+
s.role("button"),
|
|
3054
|
+
s.tabindex(0),
|
|
3055
|
+
D.label(
|
|
3056
|
+
k(y.$.stepper.$.stepOfTotal)(
|
|
3057
|
+
(M) => M(E + 1, t.length)
|
|
3058
|
+
)
|
|
3059
|
+
),
|
|
3060
|
+
T.keydown((M) => {
|
|
3061
|
+
(M.key === "Enter" || M.key === " ") && (M.preventDefault(), m.get(l) || v(E));
|
|
3062
|
+
}),
|
|
3063
|
+
d.div(s.class("bc-stepper__circle"), ot),
|
|
3064
|
+
d.div(
|
|
3065
|
+
s.class("bc-stepper__label"),
|
|
3066
|
+
d.span(s.class("bc-stepper__label-text"), L.label),
|
|
3067
|
+
L.description ? d.span(
|
|
3068
|
+
s.class("bc-stepper__label-description"),
|
|
3069
|
+
L.description
|
|
3070
|
+
) : null
|
|
3071
|
+
)
|
|
3072
|
+
)
|
|
3073
|
+
];
|
|
3074
|
+
}).flat()
|
|
3075
|
+
),
|
|
3076
|
+
// Step content
|
|
3077
|
+
d.div(
|
|
3078
|
+
s.class("bc-stepper__content"),
|
|
3079
|
+
...t.map(
|
|
3080
|
+
(L, E) => L.content ? I(
|
|
3081
|
+
m.map(b, (O) => O === E),
|
|
3082
|
+
() => L.content($),
|
|
3083
|
+
() => null
|
|
3084
|
+
) : null
|
|
3085
|
+
)
|
|
3086
|
+
),
|
|
3087
|
+
// Navigation buttons
|
|
3088
|
+
I(
|
|
3089
|
+
u,
|
|
3090
|
+
() => d.div(
|
|
3091
|
+
s.class("bc-stepper__navigation"),
|
|
3092
|
+
I(
|
|
3093
|
+
m.map(b, (L) => L > 0),
|
|
3094
|
+
() => st(
|
|
3095
|
+
{
|
|
3096
|
+
variant: "outline",
|
|
3097
|
+
size: o,
|
|
3098
|
+
color: i,
|
|
3099
|
+
disabled: l,
|
|
3100
|
+
onClick: x
|
|
3101
|
+
},
|
|
3102
|
+
y.$.stepper.$.previous
|
|
3103
|
+
),
|
|
3104
|
+
() => null
|
|
3105
|
+
),
|
|
3106
|
+
d.span(s.class("bc-stepper__spacer")),
|
|
3107
|
+
I(
|
|
3108
|
+
m.map(b, (L) => L < t.length - 1),
|
|
3109
|
+
() => st(
|
|
3110
|
+
{
|
|
3111
|
+
variant: "filled",
|
|
3112
|
+
size: o,
|
|
3113
|
+
color: i,
|
|
3114
|
+
disabled: l,
|
|
3115
|
+
onClick: () => {
|
|
3116
|
+
S();
|
|
3117
|
+
}
|
|
3118
|
+
},
|
|
3119
|
+
y.$.stepper.$.next
|
|
3120
|
+
),
|
|
3121
|
+
() => st(
|
|
3122
|
+
{
|
|
3123
|
+
variant: "filled",
|
|
3124
|
+
size: o,
|
|
3125
|
+
color: i,
|
|
3126
|
+
disabled: l,
|
|
3127
|
+
onClick: () => {
|
|
3128
|
+
A();
|
|
3129
|
+
}
|
|
3130
|
+
},
|
|
3131
|
+
y.$.stepper.$.complete
|
|
3132
|
+
)
|
|
3133
|
+
)
|
|
3134
|
+
),
|
|
3135
|
+
() => null
|
|
3136
|
+
)
|
|
3137
|
+
);
|
|
3138
|
+
}), $];
|
|
3139
|
+
}
|
|
3140
|
+
function ls(e) {
|
|
3141
|
+
const [t] = qe(e);
|
|
3142
|
+
return t;
|
|
3143
|
+
}
|
|
3144
|
+
export {
|
|
3145
|
+
Ge as $,
|
|
3146
|
+
_a as A,
|
|
3147
|
+
ga as B,
|
|
3148
|
+
$a as C,
|
|
3149
|
+
wa as D,
|
|
3150
|
+
Xa as E,
|
|
3151
|
+
Wa as F,
|
|
3152
|
+
Da as G,
|
|
3153
|
+
pa as H,
|
|
3154
|
+
fa as I,
|
|
3155
|
+
ts as J,
|
|
3156
|
+
es as K,
|
|
3157
|
+
Ma as L,
|
|
3158
|
+
Ot as M,
|
|
3159
|
+
Bt as N,
|
|
3160
|
+
Na as O,
|
|
3161
|
+
ma as P,
|
|
3162
|
+
Sa as Q,
|
|
3163
|
+
Va as R,
|
|
3164
|
+
za as S,
|
|
3165
|
+
ve as T,
|
|
3166
|
+
xa as U,
|
|
3167
|
+
Aa as V,
|
|
3168
|
+
La as W,
|
|
3169
|
+
Be as X,
|
|
3170
|
+
ss as Y,
|
|
3171
|
+
Ia as Z,
|
|
3172
|
+
kt as _,
|
|
3173
|
+
Tt as a,
|
|
3174
|
+
Ve as a0,
|
|
3175
|
+
Pe as a1,
|
|
3176
|
+
Ue as a2,
|
|
3177
|
+
Ba as a3,
|
|
3178
|
+
Oa as a4,
|
|
3179
|
+
Ta as a5,
|
|
3180
|
+
qe as a6,
|
|
3181
|
+
Za as a7,
|
|
3182
|
+
Qa as a8,
|
|
3183
|
+
Ha as a9,
|
|
3184
|
+
Ya as aa,
|
|
3185
|
+
Ka as ab,
|
|
3186
|
+
re as ac,
|
|
3187
|
+
ne as ad,
|
|
3188
|
+
_t as ae,
|
|
3189
|
+
yt as af,
|
|
3190
|
+
ue as ag,
|
|
3191
|
+
be as ah,
|
|
3192
|
+
ce as ai,
|
|
3193
|
+
le as aj,
|
|
3194
|
+
ht as ak,
|
|
3195
|
+
de as al,
|
|
3196
|
+
Me as am,
|
|
3197
|
+
ya as b,
|
|
3198
|
+
Ca as c,
|
|
3199
|
+
Ea as d,
|
|
3200
|
+
Fa as e,
|
|
3201
|
+
ja as f,
|
|
3202
|
+
ba as g,
|
|
3203
|
+
la as h,
|
|
3204
|
+
da as i,
|
|
3205
|
+
ua as j,
|
|
3206
|
+
ha as k,
|
|
3207
|
+
Ra as l,
|
|
3208
|
+
Ga as m,
|
|
3209
|
+
is as n,
|
|
3210
|
+
as as o,
|
|
3211
|
+
va as p,
|
|
3212
|
+
ls as q,
|
|
3213
|
+
cs as r,
|
|
3214
|
+
rs as s,
|
|
3215
|
+
ns as t,
|
|
3216
|
+
os as u,
|
|
3217
|
+
Pa as v,
|
|
3218
|
+
ka as w,
|
|
3219
|
+
Ua as x,
|
|
3220
|
+
qa as y,
|
|
3221
|
+
Ja as z
|
|
3222
|
+
};
|