asterui 0.12.28 → 0.12.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/TimePicker.d.ts +9 -1
- package/dist/index86.js +284 -148
- package/dist/index86.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,5 +8,13 @@ export interface TimePickerProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
10
10
|
showSeconds?: boolean;
|
|
11
|
+
allowClear?: boolean;
|
|
12
|
+
open?: boolean;
|
|
13
|
+
onOpenChange?: (open: boolean) => void;
|
|
14
|
+
hourStep?: number;
|
|
15
|
+
minuteStep?: number;
|
|
16
|
+
secondStep?: number;
|
|
17
|
+
status?: 'error' | 'warning';
|
|
18
|
+
'data-testid'?: string;
|
|
11
19
|
}
|
|
12
|
-
export declare const TimePicker: React.
|
|
20
|
+
export declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLDivElement>>;
|
package/dist/index86.js
CHANGED
|
@@ -1,164 +1,300 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Input as
|
|
4
|
-
function
|
|
5
|
-
if (!
|
|
6
|
-
let
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
const
|
|
10
|
-
return
|
|
1
|
+
import { jsxs as m, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as fe, useState as x, useRef as Z, useId as pe, useEffect as W, useCallback as _ } from "react";
|
|
3
|
+
import { Input as me } from "./index42.js";
|
|
4
|
+
function be(s, D = "24", M = !1) {
|
|
5
|
+
if (!s) return "";
|
|
6
|
+
let o = s.getHours();
|
|
7
|
+
const w = String(s.getMinutes()).padStart(2, "0"), y = String(s.getSeconds()).padStart(2, "0");
|
|
8
|
+
if (D === "12") {
|
|
9
|
+
const P = o >= 12 ? "PM" : "AM";
|
|
10
|
+
return o = o % 12 || 12, M ? `${o}:${w}:${y} ${P}` : `${o}:${w} ${P}`;
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
return
|
|
12
|
+
const A = String(o).padStart(2, "0");
|
|
13
|
+
return M ? `${A}:${w}:${y}` : `${A}:${w}`;
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
value:
|
|
17
|
-
defaultValue:
|
|
18
|
-
onChange:
|
|
19
|
-
format:
|
|
20
|
-
placeholder:
|
|
21
|
-
disabled:
|
|
22
|
-
className:
|
|
23
|
-
size:
|
|
24
|
-
showSeconds:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
15
|
+
const ge = fe(({
|
|
16
|
+
value: s,
|
|
17
|
+
defaultValue: D,
|
|
18
|
+
onChange: M,
|
|
19
|
+
format: o = "24",
|
|
20
|
+
placeholder: w = "Select time",
|
|
21
|
+
disabled: y = !1,
|
|
22
|
+
className: A,
|
|
23
|
+
size: P = "md",
|
|
24
|
+
showSeconds: v = !1,
|
|
25
|
+
allowClear: ee = !0,
|
|
26
|
+
open: H,
|
|
27
|
+
onOpenChange: Y,
|
|
28
|
+
hourStep: E = 1,
|
|
29
|
+
minuteStep: T = 1,
|
|
30
|
+
secondStep: F = 1,
|
|
31
|
+
status: G,
|
|
32
|
+
"data-testid": te,
|
|
33
|
+
...ne
|
|
34
|
+
}, S) => {
|
|
35
|
+
const [d, R] = x(
|
|
36
|
+
s !== void 0 ? s : D || null
|
|
37
|
+
), [oe, se] = x(!1), c = H !== void 0 ? H : oe, [p, N] = x(d ? d.getHours() : 0), [$, I] = x(d ? d.getMinutes() : 0), [k, L] = x(d ? d.getSeconds() : 0), [b, j] = x(
|
|
38
|
+
d && d.getHours() >= 12 ? "PM" : "AM"
|
|
39
|
+
), [g, B] = x("hour"), O = Z(null), ie = Z(null), K = pe(), l = te || "timepicker";
|
|
40
|
+
W(() => {
|
|
41
|
+
s !== void 0 && (R(s), s && (N(s.getHours()), I(s.getMinutes()), L(s.getSeconds()), j(s.getHours() >= 12 ? "PM" : "AM")));
|
|
42
|
+
}, [s]);
|
|
43
|
+
const h = _((e) => {
|
|
44
|
+
H === void 0 && se(e), Y?.(e);
|
|
45
|
+
}, [H, Y]);
|
|
46
|
+
W(() => {
|
|
47
|
+
function e(t) {
|
|
48
|
+
O.current && !O.current.contains(t.target) && h(!1);
|
|
37
49
|
}
|
|
38
|
-
if (
|
|
50
|
+
if (c)
|
|
39
51
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
40
|
-
}, [
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
52
|
+
}, [c, h]), W(() => {
|
|
53
|
+
if (!c) return;
|
|
54
|
+
const e = (t) => {
|
|
55
|
+
if (t.key === "Escape") {
|
|
56
|
+
h(!1);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (t.key !== "Tab") {
|
|
60
|
+
if (t.key === "ArrowUp" || t.key === "ArrowDown") {
|
|
61
|
+
t.preventDefault();
|
|
62
|
+
const i = t.key === "ArrowUp" ? -1 : 1;
|
|
63
|
+
if (g === "hour") {
|
|
64
|
+
const n = o === "12" ? 12 : 23, u = o === "12" ? 1 : 0;
|
|
65
|
+
let r = p + i * E;
|
|
66
|
+
r > n && (r = u), r < u && (r = n), J(r);
|
|
67
|
+
} else if (g === "minute") {
|
|
68
|
+
let n = $ + i * T;
|
|
69
|
+
n > 59 && (n = 0), n < 0 && (n = 59), Q(n);
|
|
70
|
+
} else if (g === "second") {
|
|
71
|
+
let n = k + i * F;
|
|
72
|
+
n > 59 && (n = 0), n < 0 && (n = 59), V(n);
|
|
73
|
+
} else g === "period" && U(b === "AM" ? "PM" : "AM");
|
|
74
|
+
}
|
|
75
|
+
if (t.key === "ArrowLeft" || t.key === "ArrowRight") {
|
|
76
|
+
t.preventDefault();
|
|
77
|
+
const i = ["hour", "minute"];
|
|
78
|
+
v && i.push("second"), o === "12" && i.push("period");
|
|
79
|
+
const n = i.indexOf(g), u = t.key === "ArrowLeft" ? -1 : 1;
|
|
80
|
+
let r = n + u;
|
|
81
|
+
r < 0 && (r = i.length - 1), r >= i.length && (r = 0), B(i[r]);
|
|
82
|
+
}
|
|
83
|
+
t.key === "Enter" && h(!1);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
87
|
+
}, [c, g, p, $, k, b, o, v, E, T, F, h]);
|
|
88
|
+
const re = _((e) => {
|
|
89
|
+
e.stopPropagation(), R(null), N(0), I(0), L(0), j("AM"), M?.(null);
|
|
90
|
+
}, [M]), C = (e, t, i) => {
|
|
91
|
+
const n = /* @__PURE__ */ new Date(), u = new Date(
|
|
92
|
+
n.getFullYear(),
|
|
93
|
+
n.getMonth(),
|
|
94
|
+
n.getDate(),
|
|
46
95
|
e,
|
|
47
|
-
|
|
48
|
-
|
|
96
|
+
t,
|
|
97
|
+
i
|
|
49
98
|
);
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
type: "button",
|
|
70
|
-
onClick: () => g(f),
|
|
71
|
-
className: `
|
|
72
|
-
w-full px-4 py-2 text-center hover:bg-base-200 transition-colors
|
|
73
|
-
${w === f ? "bg-primary text-primary-content" : ""}
|
|
74
|
-
`,
|
|
75
|
-
children: String(f).padStart(2, "0")
|
|
76
|
-
},
|
|
77
|
-
f
|
|
78
|
-
)) })
|
|
79
|
-
] });
|
|
80
|
-
}, z = n === "12" ? l % 12 || 12 : l;
|
|
81
|
-
return /* @__PURE__ */ c("div", { ref: A, className: `relative ${h}`, "data-state": u ? "open" : "closed", ...E, children: [
|
|
82
|
-
/* @__PURE__ */ r(
|
|
83
|
-
_,
|
|
99
|
+
R(u), M?.(u);
|
|
100
|
+
}, J = (e) => {
|
|
101
|
+
let t = e;
|
|
102
|
+
o === "12" && (t = b === "PM" ? e % 12 + 12 : e % 12), N(t), C(t, $, k);
|
|
103
|
+
}, Q = (e) => {
|
|
104
|
+
I(e), C(p, e, k);
|
|
105
|
+
}, V = (e) => {
|
|
106
|
+
L(e), C(p, $, e);
|
|
107
|
+
}, U = (e) => {
|
|
108
|
+
j(e);
|
|
109
|
+
const t = e === "PM" ? p % 12 + 12 : p % 12;
|
|
110
|
+
N(t), C(t, $, k);
|
|
111
|
+
}, q = (e, t, i, n, u, r = 1, de = 0) => {
|
|
112
|
+
const X = [];
|
|
113
|
+
for (let f = de; f <= i; f += r)
|
|
114
|
+
X.push(f);
|
|
115
|
+
const ce = `${K}-${e}-listbox`, ue = g === e;
|
|
116
|
+
return /* @__PURE__ */ m(
|
|
117
|
+
"div",
|
|
84
118
|
{
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"Hour",
|
|
98
|
-
n === "12" ? 12 : 23,
|
|
99
|
-
z,
|
|
100
|
-
I,
|
|
101
|
-
n === "12" ? 1 : 0
|
|
102
|
-
),
|
|
103
|
-
T("Min", 59, S, L),
|
|
104
|
-
$ && T("Sec", 59, y, R),
|
|
105
|
-
n === "12" && /* @__PURE__ */ c("div", { className: "flex flex-col", children: [
|
|
106
|
-
/* @__PURE__ */ r("div", { className: "text-xs font-semibold text-center text-base-content/60 py-2", children: "Period" }),
|
|
107
|
-
/* @__PURE__ */ c("div", { className: "flex-1 flex flex-col p-2 gap-2", children: [
|
|
108
|
-
/* @__PURE__ */ r(
|
|
109
|
-
"button",
|
|
110
|
-
{
|
|
111
|
-
type: "button",
|
|
112
|
-
onClick: () => D("AM"),
|
|
113
|
-
className: `
|
|
114
|
-
btn btn-sm
|
|
115
|
-
${P === "AM" ? "btn-primary" : "btn-ghost"}
|
|
116
|
-
`,
|
|
117
|
-
children: "AM"
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
/* @__PURE__ */ r(
|
|
119
|
+
className: "flex flex-col w-16",
|
|
120
|
+
role: "listbox",
|
|
121
|
+
"aria-label": `Select ${t.toLowerCase()}`,
|
|
122
|
+
id: ce,
|
|
123
|
+
"data-testid": `${l}-${e}-column`,
|
|
124
|
+
tabIndex: 0,
|
|
125
|
+
onFocus: () => B(e),
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ a("div", { className: "text-xs font-semibold text-center text-base-content/60 py-2", "aria-hidden": "true", children: t }),
|
|
128
|
+
/* @__PURE__ */ a("div", { className: "overflow-y-auto max-h-48", children: X.map((f) => {
|
|
129
|
+
const z = n === f;
|
|
130
|
+
return /* @__PURE__ */ a(
|
|
121
131
|
"button",
|
|
122
132
|
{
|
|
123
133
|
type: "button",
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
134
|
+
role: "option",
|
|
135
|
+
"aria-selected": z,
|
|
136
|
+
onClick: () => u(f),
|
|
137
|
+
"data-testid": `${l}-${e}-${f}`,
|
|
138
|
+
className: [
|
|
139
|
+
"w-full px-4 py-2 text-center hover:bg-base-200 transition-colors",
|
|
140
|
+
z ? "bg-primary text-primary-content" : "",
|
|
141
|
+
ue && z ? "ring-2 ring-primary ring-offset-1" : ""
|
|
142
|
+
].filter(Boolean).join(" "),
|
|
143
|
+
children: String(f).padStart(2, "0")
|
|
144
|
+
},
|
|
145
|
+
f
|
|
146
|
+
);
|
|
147
|
+
}) })
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
}, ae = o === "12" ? p % 12 || 12 : p, le = {
|
|
152
|
+
error: "input-error",
|
|
153
|
+
warning: "input-warning"
|
|
154
|
+
};
|
|
155
|
+
return /* @__PURE__ */ m(
|
|
156
|
+
"div",
|
|
157
|
+
{
|
|
158
|
+
ref: (e) => {
|
|
159
|
+
O.current = e, typeof S == "function" ? S(e) : S && (S.current = e);
|
|
160
|
+
},
|
|
161
|
+
className: ["relative", A].filter(Boolean).join(" "),
|
|
162
|
+
"data-testid": l,
|
|
163
|
+
"data-state": c ? "open" : "closed",
|
|
164
|
+
...ne,
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ m("div", { className: "relative", children: [
|
|
167
|
+
/* @__PURE__ */ a(
|
|
168
|
+
me,
|
|
169
|
+
{
|
|
170
|
+
value: be(d, o, v),
|
|
171
|
+
placeholder: w,
|
|
172
|
+
disabled: y,
|
|
173
|
+
size: P,
|
|
174
|
+
readOnly: !0,
|
|
175
|
+
onClick: () => !y && h(!c),
|
|
176
|
+
className: ["cursor-pointer pr-8", G ? le[G] : ""].filter(Boolean).join(" "),
|
|
177
|
+
"aria-haspopup": "listbox",
|
|
178
|
+
"aria-expanded": c,
|
|
179
|
+
"aria-controls": c ? `${K}-dropdown` : void 0,
|
|
180
|
+
"data-testid": `${l}-input`
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
ee && d && !y && /* @__PURE__ */ a(
|
|
184
|
+
"button",
|
|
185
|
+
{
|
|
186
|
+
type: "button",
|
|
187
|
+
onClick: re,
|
|
188
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 btn btn-ghost btn-xs btn-circle",
|
|
189
|
+
"aria-label": "Clear time",
|
|
190
|
+
"data-testid": `${l}-clear`,
|
|
191
|
+
children: /* @__PURE__ */ a("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
192
|
+
}
|
|
193
|
+
)
|
|
194
|
+
] }),
|
|
195
|
+
c && /* @__PURE__ */ m(
|
|
196
|
+
"div",
|
|
150
197
|
{
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
className: "
|
|
154
|
-
|
|
198
|
+
ref: ie,
|
|
199
|
+
id: `${K}-dropdown`,
|
|
200
|
+
className: "absolute top-full left-0 mt-2 bg-base-100 border border-base-300 rounded-lg shadow-xl z-[9999] w-fit",
|
|
201
|
+
role: "dialog",
|
|
202
|
+
"aria-label": "Time picker",
|
|
203
|
+
"data-testid": `${l}-dropdown`,
|
|
204
|
+
children: [
|
|
205
|
+
/* @__PURE__ */ m("div", { className: "flex divide-x divide-base-300", children: [
|
|
206
|
+
q(
|
|
207
|
+
"hour",
|
|
208
|
+
"Hour",
|
|
209
|
+
o === "12" ? 12 : 23,
|
|
210
|
+
ae,
|
|
211
|
+
J,
|
|
212
|
+
E,
|
|
213
|
+
o === "12" ? 1 : 0
|
|
214
|
+
),
|
|
215
|
+
q("minute", "Min", 59, $, Q, T),
|
|
216
|
+
v && q("second", "Sec", 59, k, V, F),
|
|
217
|
+
o === "12" && /* @__PURE__ */ m(
|
|
218
|
+
"div",
|
|
219
|
+
{
|
|
220
|
+
className: "flex flex-col w-16",
|
|
221
|
+
role: "listbox",
|
|
222
|
+
"aria-label": "Select period",
|
|
223
|
+
"data-testid": `${l}-period-column`,
|
|
224
|
+
tabIndex: 0,
|
|
225
|
+
onFocus: () => B("period"),
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ a("div", { className: "text-xs font-semibold text-center text-base-content/60 py-2", "aria-hidden": "true", children: "Period" }),
|
|
228
|
+
/* @__PURE__ */ m("div", { className: "flex flex-col p-2 gap-2", children: [
|
|
229
|
+
/* @__PURE__ */ a(
|
|
230
|
+
"button",
|
|
231
|
+
{
|
|
232
|
+
type: "button",
|
|
233
|
+
role: "option",
|
|
234
|
+
"aria-selected": b === "AM",
|
|
235
|
+
onClick: () => U("AM"),
|
|
236
|
+
"data-testid": `${l}-period-am`,
|
|
237
|
+
className: [
|
|
238
|
+
"btn btn-sm",
|
|
239
|
+
b === "AM" ? "btn-primary" : "btn-ghost"
|
|
240
|
+
].join(" "),
|
|
241
|
+
children: "AM"
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
/* @__PURE__ */ a(
|
|
245
|
+
"button",
|
|
246
|
+
{
|
|
247
|
+
type: "button",
|
|
248
|
+
role: "option",
|
|
249
|
+
"aria-selected": b === "PM",
|
|
250
|
+
onClick: () => U("PM"),
|
|
251
|
+
"data-testid": `${l}-period-pm`,
|
|
252
|
+
className: [
|
|
253
|
+
"btn btn-sm",
|
|
254
|
+
b === "PM" ? "btn-primary" : "btn-ghost"
|
|
255
|
+
].join(" "),
|
|
256
|
+
children: "PM"
|
|
257
|
+
}
|
|
258
|
+
)
|
|
259
|
+
] })
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
] }),
|
|
264
|
+
/* @__PURE__ */ m("div", { className: "flex justify-end gap-2 p-3 border-t border-base-300", children: [
|
|
265
|
+
/* @__PURE__ */ a(
|
|
266
|
+
"button",
|
|
267
|
+
{
|
|
268
|
+
type: "button",
|
|
269
|
+
onClick: () => {
|
|
270
|
+
const e = /* @__PURE__ */ new Date();
|
|
271
|
+
N(e.getHours()), I(e.getMinutes()), L(e.getSeconds()), j(e.getHours() >= 12 ? "PM" : "AM"), C(e.getHours(), e.getMinutes(), e.getSeconds());
|
|
272
|
+
},
|
|
273
|
+
className: "btn btn-ghost btn-sm",
|
|
274
|
+
"data-testid": `${l}-now`,
|
|
275
|
+
children: "Now"
|
|
276
|
+
}
|
|
277
|
+
),
|
|
278
|
+
/* @__PURE__ */ a(
|
|
279
|
+
"button",
|
|
280
|
+
{
|
|
281
|
+
type: "button",
|
|
282
|
+
onClick: () => h(!1),
|
|
283
|
+
className: "btn btn-primary btn-sm",
|
|
284
|
+
"data-testid": `${l}-ok`,
|
|
285
|
+
children: "OK"
|
|
286
|
+
}
|
|
287
|
+
)
|
|
288
|
+
] })
|
|
289
|
+
]
|
|
155
290
|
}
|
|
156
291
|
)
|
|
157
|
-
]
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
};
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
});
|
|
296
|
+
ge.displayName = "TimePicker";
|
|
161
297
|
export {
|
|
162
|
-
|
|
298
|
+
ge as TimePicker
|
|
163
299
|
};
|
|
164
300
|
//# sourceMappingURL=index86.js.map
|
package/dist/index86.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index86.js","sources":["../src/components/TimePicker.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\nimport { Input } from './Input'\n\nexport interface TimePickerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n value?: Date | null\n defaultValue?: Date | null\n onChange?: (date: Date | null) => void\n format?: '12' | '24'\n placeholder?: string\n disabled?: boolean\n size?: 'xs' | 'sm' | 'md' | 'lg'\n showSeconds?: boolean\n}\n\nfunction formatTime(date: Date | null, format: '12' | '24' = '24', showSeconds: boolean = false): string {\n if (!date) return ''\n\n let hours = date.getHours()\n const minutes = String(date.getMinutes()).padStart(2, '0')\n const seconds = String(date.getSeconds()).padStart(2, '0')\n\n if (format === '12') {\n const period = hours >= 12 ? 'PM' : 'AM'\n hours = hours % 12 || 12\n const timeStr = showSeconds\n ? `${hours}:${minutes}:${seconds} ${period}`\n : `${hours}:${minutes} ${period}`\n return timeStr\n }\n\n const hoursStr = String(hours).padStart(2, '0')\n return showSeconds ? `${hoursStr}:${minutes}:${seconds}` : `${hoursStr}:${minutes}`\n}\n\nexport const TimePicker: React.FC<TimePickerProps> = ({\n value,\n defaultValue,\n onChange,\n format = '24',\n placeholder = 'Select time',\n disabled = false,\n className = '',\n size = 'md',\n showSeconds = false,\n ...rest\n}) => {\n const [selectedTime, setSelectedTime] = useState<Date | null>(\n value || defaultValue || null\n )\n const [isOpen, setIsOpen] = useState(false)\n const [hours, setHours] = useState(selectedTime ? selectedTime.getHours() : 0)\n const [minutes, setMinutes] = useState(selectedTime ? selectedTime.getMinutes() : 0)\n const [seconds, setSeconds] = useState(selectedTime ? selectedTime.getSeconds() : 0)\n const [period, setPeriod] = useState<'AM' | 'PM'>(\n selectedTime && selectedTime.getHours() >= 12 ? 'PM' : 'AM'\n )\n\n const containerRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (value !== undefined) {\n setSelectedTime(value)\n if (value) {\n setHours(value.getHours())\n setMinutes(value.getMinutes())\n setSeconds(value.getSeconds())\n setPeriod(value.getHours() >= 12 ? 'PM' : 'AM')\n }\n }\n }, [value])\n\n useEffect(() => {\n function handleClickOutside(event: MouseEvent) {\n if (containerRef.current && !containerRef.current.contains(event.target as Node)) {\n setIsOpen(false)\n }\n }\n\n if (isOpen) {\n document.addEventListener('mousedown', handleClickOutside)\n return () => document.removeEventListener('mousedown', handleClickOutside)\n }\n }, [isOpen])\n\n const handleTimeChange = (newHours: number, newMinutes: number, newSeconds: number) => {\n const now = new Date()\n const newTime = new Date(\n now.getFullYear(),\n now.getMonth(),\n now.getDate(),\n newHours,\n newMinutes,\n newSeconds\n )\n setSelectedTime(newTime)\n onChange?.(newTime)\n }\n\n const handleHourChange = (newHour: number) => {\n let actualHour = newHour\n if (format === '12') {\n actualHour = period === 'PM' ? (newHour % 12) + 12 : newHour % 12\n }\n setHours(actualHour)\n handleTimeChange(actualHour, minutes, seconds)\n }\n\n const handleMinuteChange = (newMinute: number) => {\n setMinutes(newMinute)\n handleTimeChange(hours, newMinute, seconds)\n }\n\n const handleSecondChange = (newSecond: number) => {\n setSeconds(newSecond)\n handleTimeChange(hours, minutes, newSecond)\n }\n\n const handlePeriodChange = (newPeriod: 'AM' | 'PM') => {\n setPeriod(newPeriod)\n const newHours = newPeriod === 'PM'\n ? (hours % 12) + 12\n : hours % 12\n setHours(newHours)\n handleTimeChange(newHours, minutes, seconds)\n }\n\n const renderTimeColumn = (\n label: string,\n maxValue: number,\n currentValue: number,\n onChange: (value: number) => void,\n start: number = 0\n ) => {\n const items = Array.from({ length: maxValue - start + 1 }, (_, i) => start + i)\n\n return (\n <div className=\"flex flex-col\">\n <div className=\"text-xs font-semibold text-center text-base-content/60 py-2\">\n {label}\n </div>\n <div className=\"flex-1 overflow-y-auto max-h-48\">\n {items.map((item) => (\n <button\n key={item}\n type=\"button\"\n onClick={() => onChange(item)}\n className={`\n w-full px-4 py-2 text-center hover:bg-base-200 transition-colors\n ${currentValue === item ? 'bg-primary text-primary-content' : ''}\n `}\n >\n {String(item).padStart(2, '0')}\n </button>\n ))}\n </div>\n </div>\n )\n }\n\n const displayHours = format === '12' ? (hours % 12 || 12) : hours\n\n return (\n <div ref={containerRef} className={`relative ${className}`} data-state={isOpen ? 'open' : 'closed'} {...rest}>\n <Input\n value={formatTime(selectedTime, format, showSeconds)}\n placeholder={placeholder}\n disabled={disabled}\n size={size}\n readOnly\n onClick={() => !disabled && setIsOpen(!isOpen)}\n className=\"cursor-pointer\"\n />\n\n {isOpen && (\n <div className=\"absolute top-full left-0 mt-2 bg-base-100 border border-base-300 rounded-lg shadow-lg z-50\">\n <div className=\"flex divide-x divide-base-300\">\n {renderTimeColumn(\n 'Hour',\n format === '12' ? 12 : 23,\n displayHours,\n handleHourChange,\n format === '12' ? 1 : 0\n )}\n\n {renderTimeColumn('Min', 59, minutes, handleMinuteChange)}\n\n {showSeconds && renderTimeColumn('Sec', 59, seconds, handleSecondChange)}\n\n {format === '12' && (\n <div className=\"flex flex-col\">\n <div className=\"text-xs font-semibold text-center text-base-content/60 py-2\">\n Period\n </div>\n <div className=\"flex-1 flex flex-col p-2 gap-2\">\n <button\n type=\"button\"\n onClick={() => handlePeriodChange('AM')}\n className={`\n btn btn-sm\n ${period === 'AM' ? 'btn-primary' : 'btn-ghost'}\n `}\n >\n AM\n </button>\n <button\n type=\"button\"\n onClick={() => handlePeriodChange('PM')}\n className={`\n btn btn-sm\n ${period === 'PM' ? 'btn-primary' : 'btn-ghost'}\n `}\n >\n PM\n </button>\n </div>\n </div>\n )}\n </div>\n\n {/* Action buttons */}\n <div className=\"flex justify-end gap-2 p-3 border-t border-base-300\">\n <button\n type=\"button\"\n onClick={() => {\n const now = new Date()\n setHours(now.getHours())\n setMinutes(now.getMinutes())\n setSeconds(now.getSeconds())\n setPeriod(now.getHours() >= 12 ? 'PM' : 'AM')\n handleTimeChange(now.getHours(), now.getMinutes(), now.getSeconds())\n }}\n className=\"btn btn-ghost btn-sm\"\n >\n Now\n </button>\n <button\n type=\"button\"\n onClick={() => setIsOpen(false)}\n className=\"btn btn-primary btn-sm\"\n >\n OK\n </button>\n </div>\n </div>\n )}\n </div>\n )\n}\n"],"names":["formatTime","date","format","showSeconds","hours","minutes","seconds","period","hoursStr","TimePicker","value","defaultValue","onChange","placeholder","disabled","className","size","rest","selectedTime","setSelectedTime","useState","isOpen","setIsOpen","setHours","setMinutes","setSeconds","setPeriod","containerRef","useRef","useEffect","handleClickOutside","event","handleTimeChange","newHours","newMinutes","newSeconds","now","newTime","handleHourChange","newHour","actualHour","handleMinuteChange","newMinute","handleSecondChange","newSecond","handlePeriodChange","newPeriod","renderTimeColumn","label","maxValue","currentValue","start","items","_","i","jsxs","jsx","item","displayHours","Input"],"mappings":";;;AAcA,SAASA,EAAWC,GAAmBC,IAAsB,MAAMC,IAAuB,IAAe;A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AA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAS,MAAM;AACb,oBAAMpB,wBAAU,KAAA;AAChB,cAAAb,EAASa,EAAI,UAAU,GACvBZ,EAAWY,EAAI,YAAY,GAC3BX,EAAWW,EAAI,YAAY,GAC3BV,EAAUU,EAAI,SAAA,KAAc,KAAK,OAAO,IAAI,GAC5CJ,EAAiBI,EAAI,YAAYA,EAAI,cAAcA,EAAI,YAAY;AAAA,YACrE;AAAA,YACA,WAAU;AAAA,YACX,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAGD,gBAAAoB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAS,MAAMlC,EAAU,EAAK;AAAA,YAC9B,WAAU;AAAA,YACX,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAED,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"index86.js","sources":["../src/components/TimePicker.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, forwardRef, useCallback, useId } from 'react'\nimport { Input } from './Input'\n\nexport interface TimePickerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n value?: Date | null\n defaultValue?: Date | null\n onChange?: (date: Date | null) => void\n format?: '12' | '24'\n placeholder?: string\n disabled?: boolean\n size?: 'xs' | 'sm' | 'md' | 'lg'\n showSeconds?: boolean\n allowClear?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n hourStep?: number\n minuteStep?: number\n secondStep?: number\n status?: 'error' | 'warning'\n 'data-testid'?: string\n}\n\nfunction formatTime(date: Date | null, format: '12' | '24' = '24', showSeconds: boolean = false): string {\n if (!date) return ''\n\n let hours = date.getHours()\n const minutes = String(date.getMinutes()).padStart(2, '0')\n const seconds = String(date.getSeconds()).padStart(2, '0')\n\n if (format === '12') {\n const period = hours >= 12 ? 'PM' : 'AM'\n hours = hours % 12 || 12\n const timeStr = showSeconds\n ? `${hours}:${minutes}:${seconds} ${period}`\n : `${hours}:${minutes} ${period}`\n return timeStr\n }\n\n const hoursStr = String(hours).padStart(2, '0')\n return showSeconds ? `${hoursStr}:${minutes}:${seconds}` : `${hoursStr}:${minutes}`\n}\n\nexport const TimePicker = forwardRef<HTMLDivElement, TimePickerProps>(({\n value,\n defaultValue,\n onChange,\n format = '24',\n placeholder = 'Select time',\n disabled = false,\n className,\n size = 'md',\n showSeconds = false,\n allowClear = true,\n open: controlledOpen,\n onOpenChange,\n hourStep = 1,\n minuteStep = 1,\n secondStep = 1,\n status,\n 'data-testid': testId,\n ...rest\n}, ref) => {\n const [selectedTime, setSelectedTime] = useState<Date | null>(\n value !== undefined ? value : defaultValue || null\n )\n const [internalOpen, setInternalOpen] = useState(false)\n const isOpen = controlledOpen !== undefined ? controlledOpen : internalOpen\n const [hours, setHours] = useState(selectedTime ? selectedTime.getHours() : 0)\n const [minutes, setMinutes] = useState(selectedTime ? selectedTime.getMinutes() : 0)\n const [seconds, setSeconds] = useState(selectedTime ? selectedTime.getSeconds() : 0)\n const [period, setPeriod] = useState<'AM' | 'PM'>(\n selectedTime && selectedTime.getHours() >= 12 ? 'PM' : 'AM'\n )\n const [focusedColumn, setFocusedColumn] = useState<'hour' | 'minute' | 'second' | 'period'>('hour')\n\n const containerRef = useRef<HTMLDivElement>(null)\n const dropdownRef = useRef<HTMLDivElement>(null)\n const uniqueId = useId()\n const baseTestId = testId || 'timepicker'\n\n useEffect(() => {\n if (value !== undefined) {\n setSelectedTime(value)\n if (value) {\n setHours(value.getHours())\n setMinutes(value.getMinutes())\n setSeconds(value.getSeconds())\n setPeriod(value.getHours() >= 12 ? 'PM' : 'AM')\n }\n }\n }, [value])\n\n const setOpen = useCallback((newOpen: boolean) => {\n if (controlledOpen === undefined) {\n setInternalOpen(newOpen)\n }\n onOpenChange?.(newOpen)\n }, [controlledOpen, onOpenChange])\n\n useEffect(() => {\n function handleClickOutside(event: MouseEvent) {\n if (containerRef.current && !containerRef.current.contains(event.target as Node)) {\n setOpen(false)\n }\n }\n\n if (isOpen) {\n document.addEventListener('mousedown', handleClickOutside)\n return () => document.removeEventListener('mousedown', handleClickOutside)\n }\n }, [isOpen, setOpen])\n\n // Focus trap and keyboard navigation\n useEffect(() => {\n if (!isOpen) return\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n setOpen(false)\n return\n }\n\n if (e.key === 'Tab') {\n // Allow tab to cycle through columns\n return\n }\n\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault()\n const delta = e.key === 'ArrowUp' ? -1 : 1\n\n if (focusedColumn === 'hour') {\n const maxHour = format === '12' ? 12 : 23\n const minHour = format === '12' ? 1 : 0\n let newHour = hours + (delta * hourStep)\n if (newHour > maxHour) newHour = minHour\n if (newHour < minHour) newHour = maxHour\n handleHourChange(newHour)\n } else if (focusedColumn === 'minute') {\n let newMinute = minutes + (delta * minuteStep)\n if (newMinute > 59) newMinute = 0\n if (newMinute < 0) newMinute = 59\n handleMinuteChange(newMinute)\n } else if (focusedColumn === 'second') {\n let newSecond = seconds + (delta * secondStep)\n if (newSecond > 59) newSecond = 0\n if (newSecond < 0) newSecond = 59\n handleSecondChange(newSecond)\n } else if (focusedColumn === 'period') {\n handlePeriodChange(period === 'AM' ? 'PM' : 'AM')\n }\n }\n\n if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n e.preventDefault()\n const columns: Array<'hour' | 'minute' | 'second' | 'period'> = ['hour', 'minute']\n if (showSeconds) columns.push('second')\n if (format === '12') columns.push('period')\n\n const currentIndex = columns.indexOf(focusedColumn)\n const delta = e.key === 'ArrowLeft' ? -1 : 1\n let newIndex = currentIndex + delta\n if (newIndex < 0) newIndex = columns.length - 1\n if (newIndex >= columns.length) newIndex = 0\n setFocusedColumn(columns[newIndex])\n }\n\n if (e.key === 'Enter') {\n setOpen(false)\n }\n }\n\n document.addEventListener('keydown', handleKeyDown)\n return () => document.removeEventListener('keydown', handleKeyDown)\n }, [isOpen, focusedColumn, hours, minutes, seconds, period, format, showSeconds, hourStep, minuteStep, secondStep, setOpen])\n\n const handleClear = useCallback((e: React.MouseEvent) => {\n e.stopPropagation()\n setSelectedTime(null)\n setHours(0)\n setMinutes(0)\n setSeconds(0)\n setPeriod('AM')\n onChange?.(null)\n }, [onChange])\n\n const handleTimeChange = (newHours: number, newMinutes: number, newSeconds: number) => {\n const now = new Date()\n const newTime = new Date(\n now.getFullYear(),\n now.getMonth(),\n now.getDate(),\n newHours,\n newMinutes,\n newSeconds\n )\n setSelectedTime(newTime)\n onChange?.(newTime)\n }\n\n const handleHourChange = (newHour: number) => {\n let actualHour = newHour\n if (format === '12') {\n actualHour = period === 'PM' ? (newHour % 12) + 12 : newHour % 12\n }\n setHours(actualHour)\n handleTimeChange(actualHour, minutes, seconds)\n }\n\n const handleMinuteChange = (newMinute: number) => {\n setMinutes(newMinute)\n handleTimeChange(hours, newMinute, seconds)\n }\n\n const handleSecondChange = (newSecond: number) => {\n setSeconds(newSecond)\n handleTimeChange(hours, minutes, newSecond)\n }\n\n const handlePeriodChange = (newPeriod: 'AM' | 'PM') => {\n setPeriod(newPeriod)\n const newHours = newPeriod === 'PM'\n ? (hours % 12) + 12\n : hours % 12\n setHours(newHours)\n handleTimeChange(newHours, minutes, seconds)\n }\n\n const renderTimeColumn = (\n columnType: 'hour' | 'minute' | 'second',\n label: string,\n maxValue: number,\n currentValue: number,\n onChangeValue: (value: number) => void,\n step: number = 1,\n start: number = 0\n ) => {\n const items: number[] = []\n for (let i = start; i <= maxValue; i += step) {\n items.push(i)\n }\n const listboxId = `${uniqueId}-${columnType}-listbox`\n const isFocused = focusedColumn === columnType\n\n return (\n <div\n className=\"flex flex-col w-16\"\n role=\"listbox\"\n aria-label={`Select ${label.toLowerCase()}`}\n id={listboxId}\n data-testid={`${baseTestId}-${columnType}-column`}\n tabIndex={0}\n onFocus={() => setFocusedColumn(columnType)}\n >\n <div className=\"text-xs font-semibold text-center text-base-content/60 py-2\" aria-hidden=\"true\">\n {label}\n </div>\n <div className=\"overflow-y-auto max-h-48\">\n {items.map((item) => {\n const isSelected = currentValue === item\n return (\n <button\n key={item}\n type=\"button\"\n role=\"option\"\n aria-selected={isSelected}\n onClick={() => onChangeValue(item)}\n data-testid={`${baseTestId}-${columnType}-${item}`}\n className={[\n 'w-full px-4 py-2 text-center hover:bg-base-200 transition-colors',\n isSelected ? 'bg-primary text-primary-content' : '',\n isFocused && isSelected ? 'ring-2 ring-primary ring-offset-1' : ''\n ].filter(Boolean).join(' ')}\n >\n {String(item).padStart(2, '0')}\n </button>\n )\n })}\n </div>\n </div>\n )\n }\n\n const displayHours = format === '12' ? (hours % 12 || 12) : hours\n\n const statusClasses = {\n error: 'input-error',\n warning: 'input-warning',\n }\n\n return (\n <div\n ref={(node) => {\n containerRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n }}\n className={['relative', className].filter(Boolean).join(' ')}\n data-testid={baseTestId}\n data-state={isOpen ? 'open' : 'closed'}\n {...rest}\n >\n <div className=\"relative\">\n <Input\n value={formatTime(selectedTime, format, showSeconds)}\n placeholder={placeholder}\n disabled={disabled}\n size={size}\n readOnly\n onClick={() => !disabled && setOpen(!isOpen)}\n className={['cursor-pointer pr-8', status ? statusClasses[status] : ''].filter(Boolean).join(' ')}\n aria-haspopup=\"listbox\"\n aria-expanded={isOpen}\n aria-controls={isOpen ? `${uniqueId}-dropdown` : undefined}\n data-testid={`${baseTestId}-input`}\n />\n {allowClear && selectedTime && !disabled && (\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"absolute right-2 top-1/2 -translate-y-1/2 btn btn-ghost btn-xs btn-circle\"\n aria-label=\"Clear time\"\n data-testid={`${baseTestId}-clear`}\n >\n <svg className=\"w-3 h-3\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n )}\n </div>\n\n {isOpen && (\n <div\n ref={dropdownRef}\n id={`${uniqueId}-dropdown`}\n className=\"absolute top-full left-0 mt-2 bg-base-100 border border-base-300 rounded-lg shadow-xl z-[9999] w-fit\"\n role=\"dialog\"\n aria-label=\"Time picker\"\n data-testid={`${baseTestId}-dropdown`}\n >\n <div className=\"flex divide-x divide-base-300\">\n {renderTimeColumn(\n 'hour',\n 'Hour',\n format === '12' ? 12 : 23,\n displayHours,\n handleHourChange,\n hourStep,\n format === '12' ? 1 : 0\n )}\n\n {renderTimeColumn('minute', 'Min', 59, minutes, handleMinuteChange, minuteStep)}\n\n {showSeconds && renderTimeColumn('second', 'Sec', 59, seconds, handleSecondChange, secondStep)}\n\n {format === '12' && (\n <div\n className=\"flex flex-col w-16\"\n role=\"listbox\"\n aria-label=\"Select period\"\n data-testid={`${baseTestId}-period-column`}\n tabIndex={0}\n onFocus={() => setFocusedColumn('period')}\n >\n <div className=\"text-xs font-semibold text-center text-base-content/60 py-2\" aria-hidden=\"true\">\n Period\n </div>\n <div className=\"flex flex-col p-2 gap-2\">\n <button\n type=\"button\"\n role=\"option\"\n aria-selected={period === 'AM'}\n onClick={() => handlePeriodChange('AM')}\n data-testid={`${baseTestId}-period-am`}\n className={[\n 'btn btn-sm',\n period === 'AM' ? 'btn-primary' : 'btn-ghost'\n ].join(' ')}\n >\n AM\n </button>\n <button\n type=\"button\"\n role=\"option\"\n aria-selected={period === 'PM'}\n onClick={() => handlePeriodChange('PM')}\n data-testid={`${baseTestId}-period-pm`}\n className={[\n 'btn btn-sm',\n period === 'PM' ? 'btn-primary' : 'btn-ghost'\n ].join(' ')}\n >\n PM\n </button>\n </div>\n </div>\n )}\n </div>\n\n <div className=\"flex justify-end gap-2 p-3 border-t border-base-300\">\n <button\n type=\"button\"\n onClick={() => {\n const now = new Date()\n setHours(now.getHours())\n setMinutes(now.getMinutes())\n setSeconds(now.getSeconds())\n setPeriod(now.getHours() >= 12 ? 'PM' : 'AM')\n handleTimeChange(now.getHours(), now.getMinutes(), now.getSeconds())\n }}\n className=\"btn btn-ghost btn-sm\"\n data-testid={`${baseTestId}-now`}\n >\n Now\n </button>\n <button\n type=\"button\"\n onClick={() => setOpen(false)}\n className=\"btn btn-primary btn-sm\"\n data-testid={`${baseTestId}-ok`}\n >\n OK\n </button>\n </div>\n </div>\n )}\n </div>\n )\n})\n\nTimePicker.displayName = 'TimePicker'\n"],"names":["formatTime","date","format","showSeconds","hours","minutes","seconds","period","hoursStr","TimePicker","forwardRef","value","defaultValue","onChange","placeholder","disabled","className","size","allowClear","controlledOpen","onOpenChange","hourStep","minuteStep","secondStep","status","testId","rest","ref","selectedTime","setSelectedTime","useState","internalOpen","setInternalOpen","isOpen","setHours","setMinutes","setSeconds","setPeriod","focusedColumn","setFocusedColumn","containerRef","useRef","dropdownRef","uniqueId","useId","baseTestId","useEffect","setOpen","useCallback","newOpen","handleClickOutside","event","handleKeyDown","e","delta","maxHour","minHour","newHour","handleHourChange","newMinute","handleMinuteChange","newSecond","handleSecondChange","handlePeriodChange","columns","currentIndex","newIndex","handleClear","handleTimeChange","newHours","newMinutes","newSeconds","now","newTime","actualHour","newPeriod","renderTimeColumn","columnType","label","maxValue","currentValue","onChangeValue","step","start","items","i","listboxId","isFocused","jsxs","jsx","item","isSelected","displayHours","statusClasses","node","Input"],"mappings":";;;AAsBA,SAASA,GAAWC,GAAmBC,IAAsB,MAAMC,IAAuB,IAAe;AACvG,MAAI,CAACF,EAAM,QAAO;AAElB,MAAIG,IAAQH,EAAK,SAAA;AACjB,QAAMI,IAAU,OAAOJ,EAAK,WAAA,CAAY,EAAE,SAAS,GAAG,GAAG,GACnDK,IAAU,OAAOL,EAAK,WAAA,CAAY,EAAE,SAAS,GAAG,GAAG;AAEzD,MAAIC,MAAW,MAAM;AACnB,UAAMK,IAASH,KAAS,KAAK,OAAO;AACpC,WAAAA,IAAQA,IAAQ,MAAM,IACND,IACZ,GAAGC,CAAK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