asterui 0.12.70 → 0.12.71
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/DateOfBirth.d.ts +29 -0
- package/dist/components/DateOfBirth.js +157 -0
- package/dist/components/DateOfBirth.js.map +1 -0
- package/dist/components/DatePicker.js +183 -173
- package/dist/components/DatePicker.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +222 -220
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type DateOfBirthOrder = 'mdy' | 'dmy' | 'ymd';
|
|
3
|
+
export type DateOfBirthMonthStyle = 'select' | 'grid';
|
|
4
|
+
export type DateOfBirthYearStyle = 'select' | 'input';
|
|
5
|
+
export interface DateOfBirthValue {
|
|
6
|
+
month?: string;
|
|
7
|
+
day?: string;
|
|
8
|
+
year?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface DateOfBirthProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
11
|
+
value?: DateOfBirthValue;
|
|
12
|
+
defaultValue?: DateOfBirthValue;
|
|
13
|
+
onChange?: (value: DateOfBirthValue) => void;
|
|
14
|
+
yearSpan?: number;
|
|
15
|
+
minAge?: number;
|
|
16
|
+
maxAge?: number;
|
|
17
|
+
order?: DateOfBirthOrder;
|
|
18
|
+
monthStyle?: DateOfBirthMonthStyle;
|
|
19
|
+
yearStyle?: DateOfBirthYearStyle;
|
|
20
|
+
monthPlaceholder?: string;
|
|
21
|
+
dayPlaceholder?: string;
|
|
22
|
+
yearPlaceholder?: string;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Test ID prefix for child elements */
|
|
27
|
+
'data-testid'?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const DateOfBirth: React.FC<DateOfBirthProps>;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { jsxs as f, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as Q, useEffect as _, useMemo as M } from "react";
|
|
3
|
+
import { useConfig as X } from "../providers/ConfigProvider.js";
|
|
4
|
+
import { Button as Z } from "./Button.js";
|
|
5
|
+
import { Flex as A } from "./Flex.js";
|
|
6
|
+
import { InputNumber as P } from "./InputNumber.js";
|
|
7
|
+
import { Select as C } from "./Select.js";
|
|
8
|
+
import { Space as K } from "./Space.js";
|
|
9
|
+
const I = Array.from({ length: 12 }, (r, o) => String(o + 1));
|
|
10
|
+
function ee(r, o) {
|
|
11
|
+
const c = new Intl.DateTimeFormat(r, { month: o });
|
|
12
|
+
return I.map((m, s) => ({
|
|
13
|
+
value: m,
|
|
14
|
+
label: c.format(new Date(2020, s, 1))
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
function te(r, o) {
|
|
18
|
+
return new Date(r, o, 0).getDate();
|
|
19
|
+
}
|
|
20
|
+
function re(r, o, c) {
|
|
21
|
+
if (!r.year || !r.month || !r.day) return !0;
|
|
22
|
+
const m = Number(r.year), s = Number(r.month) - 1, N = Number(r.day), l = new Date(m, s, N);
|
|
23
|
+
if (Number.isNaN(l.getTime())) return !1;
|
|
24
|
+
const i = /* @__PURE__ */ new Date();
|
|
25
|
+
let u = i.getFullYear() - l.getFullYear();
|
|
26
|
+
return i.getMonth() > l.getMonth() || i.getMonth() === l.getMonth() && i.getDate() >= l.getDate() || (u -= 1), !(o !== void 0 && u < o || c !== void 0 && u > c);
|
|
27
|
+
}
|
|
28
|
+
const ne = ({
|
|
29
|
+
value: r,
|
|
30
|
+
defaultValue: o,
|
|
31
|
+
onChange: c,
|
|
32
|
+
yearSpan: m = 120,
|
|
33
|
+
minAge: s = 13,
|
|
34
|
+
maxAge: N,
|
|
35
|
+
order: l = "mdy",
|
|
36
|
+
monthStyle: i = "select",
|
|
37
|
+
yearStyle: u = "select",
|
|
38
|
+
monthPlaceholder: z = "Month",
|
|
39
|
+
dayPlaceholder: O = "Day",
|
|
40
|
+
yearPlaceholder: F = "Year",
|
|
41
|
+
disabled: h = !1,
|
|
42
|
+
size: H,
|
|
43
|
+
className: L = "",
|
|
44
|
+
"data-testid": a,
|
|
45
|
+
...j
|
|
46
|
+
}) => {
|
|
47
|
+
const { locale: E, componentSize: U } = X(), p = H ?? U ?? "md", v = r !== void 0, [W, S] = Q(
|
|
48
|
+
r ?? o ?? {}
|
|
49
|
+
);
|
|
50
|
+
_(() => {
|
|
51
|
+
v && S(r ?? {});
|
|
52
|
+
}, [v, r]);
|
|
53
|
+
const t = v ? r ?? {} : W, Y = E?.locale ?? "en-US", $ = M(
|
|
54
|
+
() => ee(Y, i === "grid" ? "short" : "long"),
|
|
55
|
+
[Y, i]
|
|
56
|
+
), y = M(() => {
|
|
57
|
+
const e = (/* @__PURE__ */ new Date()).getFullYear();
|
|
58
|
+
return Array.from({ length: m }, (g, b) => String(e - b));
|
|
59
|
+
}, [m]), D = M(() => {
|
|
60
|
+
if (!t.month) return Array.from({ length: 31 }, (J, w) => String(w + 1));
|
|
61
|
+
const e = Number(t.month), g = t.year ? Number(t.year) : 2e3, b = te(g, e);
|
|
62
|
+
return Array.from({ length: b }, (J, w) => String(w + 1));
|
|
63
|
+
}, [t.month, t.year]);
|
|
64
|
+
_(() => {
|
|
65
|
+
t.day && !D.includes(t.day) && d({ ...t, day: void 0 });
|
|
66
|
+
}, [t.day, D]);
|
|
67
|
+
const d = (e) => {
|
|
68
|
+
v || S(e), c?.(e);
|
|
69
|
+
}, x = () => i === "grid" ? /* @__PURE__ */ n("div", { className: "grid grid-cols-3 gap-2", children: $.map((e) => {
|
|
70
|
+
const g = t.month === e.value;
|
|
71
|
+
return /* @__PURE__ */ n(
|
|
72
|
+
Z,
|
|
73
|
+
{
|
|
74
|
+
htmlType: "button",
|
|
75
|
+
size: "sm",
|
|
76
|
+
color: g ? "primary" : void 0,
|
|
77
|
+
variant: g ? "solid" : "ghost",
|
|
78
|
+
disabled: h,
|
|
79
|
+
onClick: () => d({ ...t, month: e.value }),
|
|
80
|
+
"data-testid": a ? `${a}-month-${e.value}` : void 0,
|
|
81
|
+
children: e.label
|
|
82
|
+
},
|
|
83
|
+
e.value
|
|
84
|
+
);
|
|
85
|
+
}) }) : /* @__PURE__ */ f(
|
|
86
|
+
C,
|
|
87
|
+
{
|
|
88
|
+
value: t.month ?? "",
|
|
89
|
+
onChange: (e) => d({ ...t, month: e.target.value }),
|
|
90
|
+
disabled: h,
|
|
91
|
+
size: p,
|
|
92
|
+
"data-testid": a ? `${a}-month` : void 0,
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ n("option", { value: "", children: z }),
|
|
95
|
+
$.map((e) => /* @__PURE__ */ n("option", { value: e.value, children: e.label }, e.value))
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
), k = () => /* @__PURE__ */ f(
|
|
99
|
+
C,
|
|
100
|
+
{
|
|
101
|
+
value: t.day ?? "",
|
|
102
|
+
onChange: (e) => d({ ...t, day: e.target.value }),
|
|
103
|
+
disabled: h,
|
|
104
|
+
size: p,
|
|
105
|
+
"data-testid": a ? `${a}-day` : void 0,
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ n("option", { value: "", children: O }),
|
|
108
|
+
D.map((e) => /* @__PURE__ */ n("option", { value: e, children: e }, e))
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
), R = () => u === "input" ? /* @__PURE__ */ n(
|
|
112
|
+
P,
|
|
113
|
+
{
|
|
114
|
+
value: t.year ? Number(t.year) : void 0,
|
|
115
|
+
min: Number(y[y.length - 1]),
|
|
116
|
+
max: Number(y[0]),
|
|
117
|
+
placeholder: F,
|
|
118
|
+
disabled: h,
|
|
119
|
+
size: p,
|
|
120
|
+
onChange: (e) => d({ ...t, year: e ? String(e) : void 0 }),
|
|
121
|
+
"data-testid": a ? `${a}-year` : void 0
|
|
122
|
+
}
|
|
123
|
+
) : /* @__PURE__ */ f(
|
|
124
|
+
C,
|
|
125
|
+
{
|
|
126
|
+
value: t.year ?? "",
|
|
127
|
+
onChange: (e) => d({ ...t, year: e.target.value }),
|
|
128
|
+
disabled: h,
|
|
129
|
+
size: p,
|
|
130
|
+
"data-testid": a ? `${a}-year` : void 0,
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ n("option", { value: "", children: F }),
|
|
133
|
+
y.map((e) => /* @__PURE__ */ n("option", { value: e, children: e }, e))
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
), B = {
|
|
137
|
+
m: x(),
|
|
138
|
+
d: k(),
|
|
139
|
+
y: R()
|
|
140
|
+
}, V = l.split("").map((e) => e), q = l.split("").filter((e) => e !== "m").map((e) => e), T = {
|
|
141
|
+
m: "w-full sm:w-[7rem]",
|
|
142
|
+
d: "w-full sm:w-[5rem]",
|
|
143
|
+
y: "w-full sm:w-[5rem]"
|
|
144
|
+
}, G = t.year && t.month && t.day && !re(t, s, N);
|
|
145
|
+
return /* @__PURE__ */ f("div", { className: L, "data-testid": a, ...j, children: [
|
|
146
|
+
i === "grid" ? /* @__PURE__ */ f(K, { direction: "vertical", size: "sm", children: [
|
|
147
|
+
x(),
|
|
148
|
+
/* @__PURE__ */ n(A, { gap: "sm", children: q.map((e) => /* @__PURE__ */ n("div", { className: T[e], children: B[e] }, e)) })
|
|
149
|
+
] }) : /* @__PURE__ */ n(A, { wrap: "wrap", gap: "sm", children: V.map((e) => /* @__PURE__ */ n("div", { className: T[e], children: B[e] }, e)) }),
|
|
150
|
+
G && /* @__PURE__ */ n("div", { className: "text-xs text-error mt-2", children: s ? `You must be at least ${s} years old.` : "Date of birth is not valid." })
|
|
151
|
+
] });
|
|
152
|
+
};
|
|
153
|
+
ne.displayName = "DateOfBirth";
|
|
154
|
+
export {
|
|
155
|
+
ne as DateOfBirth
|
|
156
|
+
};
|
|
157
|
+
//# sourceMappingURL=DateOfBirth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateOfBirth.js","sources":["../../src/components/DateOfBirth.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react'\nimport { useConfig } from '../providers/ConfigProvider'\nimport { Button } from './Button'\nimport { Flex } from './Flex'\nimport { InputNumber } from './InputNumber'\nimport { Select } from './Select'\nimport { Space } from './Space'\n\nexport type DateOfBirthOrder = 'mdy' | 'dmy' | 'ymd'\nexport type DateOfBirthMonthStyle = 'select' | 'grid'\nexport type DateOfBirthYearStyle = 'select' | 'input'\n\nexport interface DateOfBirthValue {\n month?: string\n day?: string\n year?: string\n}\n\nexport interface DateOfBirthProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n value?: DateOfBirthValue\n defaultValue?: DateOfBirthValue\n onChange?: (value: DateOfBirthValue) => void\n yearSpan?: number\n minAge?: number\n maxAge?: number\n order?: DateOfBirthOrder\n monthStyle?: DateOfBirthMonthStyle\n yearStyle?: DateOfBirthYearStyle\n monthPlaceholder?: string\n dayPlaceholder?: string\n yearPlaceholder?: string\n disabled?: boolean\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n className?: string\n /** Test ID prefix for child elements */\n 'data-testid'?: string\n}\n\nconst DEFAULT_MONTHS = Array.from({ length: 12 }, (_, index) => String(index + 1))\n\nfunction getMonthLabels(locale: string, format: 'long' | 'short') {\n const formatter = new Intl.DateTimeFormat(locale, { month: format })\n return DEFAULT_MONTHS.map((value, index) => ({\n value,\n label: formatter.format(new Date(2020, index, 1)),\n }))\n}\n\nfunction getDaysInMonth(year: number, month: number) {\n return new Date(year, month, 0).getDate()\n}\n\nfunction validateAge(value: DateOfBirthValue, minAge?: number, maxAge?: number) {\n if (!value.year || !value.month || !value.day) return true\n const year = Number(value.year)\n const month = Number(value.month) - 1\n const day = Number(value.day)\n const birthDate = new Date(year, month, day)\n if (Number.isNaN(birthDate.getTime())) return false\n const today = new Date()\n let age = today.getFullYear() - birthDate.getFullYear()\n const hasHadBirthday =\n today.getMonth() > birthDate.getMonth() ||\n (today.getMonth() === birthDate.getMonth() && today.getDate() >= birthDate.getDate())\n if (!hasHadBirthday) age -= 1\n if (minAge !== undefined && age < minAge) return false\n if (maxAge !== undefined && age > maxAge) return false\n return true\n}\n\nexport const DateOfBirth: React.FC<DateOfBirthProps> = ({\n value,\n defaultValue,\n onChange,\n yearSpan = 120,\n minAge = 13,\n maxAge,\n order = 'mdy',\n monthStyle = 'select',\n yearStyle = 'select',\n monthPlaceholder = 'Month',\n dayPlaceholder = 'Day',\n yearPlaceholder = 'Year',\n disabled = false,\n size,\n className = '',\n 'data-testid': testId,\n ...rest\n}) => {\n const { locale, componentSize } = useConfig()\n const effectiveSize = size ?? componentSize ?? 'md'\n const isControlled = value !== undefined\n const [internalValue, setInternalValue] = useState<DateOfBirthValue>(\n value ?? defaultValue ?? {}\n )\n\n useEffect(() => {\n if (isControlled) {\n setInternalValue(value ?? {})\n }\n }, [isControlled, value])\n\n const currentValue = isControlled ? (value ?? {}) : internalValue\n const localeCode = locale?.locale ?? 'en-US'\n const monthLabels = useMemo(\n () => getMonthLabels(localeCode, monthStyle === 'grid' ? 'short' : 'long'),\n [localeCode, monthStyle]\n )\n\n const yearRange = useMemo(() => {\n const currentYear = new Date().getFullYear()\n return Array.from({ length: yearSpan }, (_, i) => String(currentYear - i))\n }, [yearSpan])\n\n const dayOptions = useMemo(() => {\n if (!currentValue.month) return Array.from({ length: 31 }, (_, i) => String(i + 1))\n const month = Number(currentValue.month)\n const year = currentValue.year ? Number(currentValue.year) : 2000\n const daysInMonth = getDaysInMonth(year, month)\n return Array.from({ length: daysInMonth }, (_, i) => String(i + 1))\n }, [currentValue.month, currentValue.year])\n\n useEffect(() => {\n if (currentValue.day && !dayOptions.includes(currentValue.day)) {\n handleChange({ ...currentValue, day: undefined })\n }\n }, [currentValue.day, dayOptions])\n\n const handleChange = (nextValue: DateOfBirthValue) => {\n if (!isControlled) {\n setInternalValue(nextValue)\n }\n onChange?.(nextValue)\n }\n\n const renderMonth = () => {\n if (monthStyle === 'grid') {\n return (\n <div className=\"grid grid-cols-3 gap-2\">\n {monthLabels.map((month) => {\n const isActive = currentValue.month === month.value\n return (\n <Button\n key={month.value}\n htmlType=\"button\"\n size=\"sm\"\n color={isActive ? 'primary' : undefined}\n variant={isActive ? 'solid' : 'ghost'}\n disabled={disabled}\n onClick={() => handleChange({ ...currentValue, month: month.value })}\n data-testid={testId ? `${testId}-month-${month.value}` : undefined}\n >\n {month.label}\n </Button>\n )\n })}\n </div>\n )\n }\n\n return (\n <Select\n value={currentValue.month ?? ''}\n onChange={(e) => handleChange({ ...currentValue, month: e.target.value })}\n disabled={disabled}\n size={effectiveSize}\n data-testid={testId ? `${testId}-month` : undefined}\n >\n <option value=\"\">{monthPlaceholder}</option>\n {monthLabels.map((month) => (\n <option key={month.value} value={month.value}>\n {month.label}\n </option>\n ))}\n </Select>\n )\n }\n\n const renderDay = () => (\n <Select\n value={currentValue.day ?? ''}\n onChange={(e) => handleChange({ ...currentValue, day: e.target.value })}\n disabled={disabled}\n size={effectiveSize}\n data-testid={testId ? `${testId}-day` : undefined}\n >\n <option value=\"\">{dayPlaceholder}</option>\n {dayOptions.map((day) => (\n <option key={day} value={day}>{day}</option>\n ))}\n </Select>\n )\n\n const renderYear = () => {\n if (yearStyle === 'input') {\n return (\n <InputNumber\n value={currentValue.year ? Number(currentValue.year) : undefined}\n min={Number(yearRange[yearRange.length - 1])}\n max={Number(yearRange[0])}\n placeholder={yearPlaceholder}\n disabled={disabled}\n size={effectiveSize}\n onChange={(nextValue) => handleChange({ ...currentValue, year: nextValue ? String(nextValue) : undefined })}\n data-testid={testId ? `${testId}-year` : undefined}\n />\n )\n }\n\n return (\n <Select\n value={currentValue.year ?? ''}\n onChange={(e) => handleChange({ ...currentValue, year: e.target.value })}\n disabled={disabled}\n size={effectiveSize}\n data-testid={testId ? `${testId}-year` : undefined}\n >\n <option value=\"\">{yearPlaceholder}</option>\n {yearRange.map((year) => (\n <option key={year} value={year}>{year}</option>\n ))}\n </Select>\n )\n }\n\n const fieldMap = {\n m: renderMonth(),\n d: renderDay(),\n y: renderYear(),\n }\n\n const orderedFields = order.split('').map((key) => key as keyof typeof fieldMap)\n const gridFields = order\n .split('')\n .filter((key) => key !== 'm')\n .map((key) => key as keyof typeof fieldMap)\n const fieldWidths: Record<'m' | 'd' | 'y', string> = {\n m: 'w-full sm:w-[7rem]',\n d: 'w-full sm:w-[5rem]',\n y: 'w-full sm:w-[5rem]',\n }\n\n const showAgeWarning = currentValue.year && currentValue.month && currentValue.day && !validateAge(currentValue, minAge, maxAge)\n\n return (\n <div className={className} data-testid={testId} {...rest}>\n {monthStyle === 'grid' ? (\n <Space direction=\"vertical\" size=\"sm\">\n {renderMonth()}\n <Flex gap=\"sm\">\n {gridFields.map((fieldKey) => (\n <div key={fieldKey} className={fieldWidths[fieldKey]}>\n {fieldMap[fieldKey]}\n </div>\n ))}\n </Flex>\n </Space>\n ) : (\n <Flex wrap=\"wrap\" gap=\"sm\">\n {orderedFields.map((fieldKey) => (\n <div key={fieldKey} className={fieldWidths[fieldKey]}>\n {fieldMap[fieldKey]}\n </div>\n ))}\n </Flex>\n )}\n\n {showAgeWarning && (\n <div className=\"text-xs text-error mt-2\">\n {minAge ? `You must be at least ${minAge} years old.` : 'Date of birth is not valid.'}\n </div>\n )}\n </div>\n )\n}\n\nDateOfBirth.displayName = 'DateOfBirth'\n"],"names":["DEFAULT_MONTHS","_","index","getMonthLabels","locale","format","formatter","value","getDaysInMonth","year","month","validateAge","minAge","maxAge","day","birthDate","today","age","DateOfBirth","defaultValue","onChange","yearSpan","order","monthStyle","yearStyle","monthPlaceholder","dayPlaceholder","yearPlaceholder","disabled","size","className","testId","rest","componentSize","useConfig","effectiveSize","isControlled","internalValue","setInternalValue","useState","useEffect","currentValue","localeCode","monthLabels","useMemo","yearRange","currentYear","i","dayOptions","daysInMonth","handleChange","nextValue","renderMonth","isActive","jsx","Button","jsxs","Select","renderDay","renderYear","InputNumber","fieldMap","orderedFields","key","gridFields","fieldWidths","showAgeWarning","Space","Flex","fieldKey"],"mappings":";;;;;;;;AAsCA,MAAMA,IAAiB,MAAM,KAAK,EAAE,QAAQ,GAAA,GAAM,CAACC,GAAGC,MAAU,OAAOA,IAAQ,CAAC,CAAC;AAEjF,SAASC,GAAeC,GAAgBC,GAA0B;AAChE,QAAMC,IAAY,IAAI,KAAK,eAAeF,GAAQ,EAAE,OAAOC,GAAQ;AACnE,SAAOL,EAAe,IAAI,CAACO,GAAOL,OAAW;AAAA,IAC3C,OAAAK;AAAA,IACA,OAAOD,EAAU,OAAO,IAAI,KAAK,MAAMJ,GAAO,CAAC,CAAC;AAAA,EAAA,EAChD;AACJ;AAEA,SAASM,GAAeC,GAAcC,GAAe;AACnD,SAAO,IAAI,KAAKD,GAAMC,GAAO,CAAC,EAAE,QAAA;AAClC;AAEA,SAASC,GAAYJ,GAAyBK,GAAiBC,GAAiB;AAC9E,MAAI,CAACN,EAAM,QAAQ,CAACA,EAAM,SAAS,CAACA,EAAM,IAAK,QAAO;AACtD,QAAME,IAAO,OAAOF,EAAM,IAAI,GACxBG,IAAQ,OAAOH,EAAM,KAAK,IAAI,GAC9BO,IAAM,OAAOP,EAAM,GAAG,GACtBQ,IAAY,IAAI,KAAKN,GAAMC,GAAOI,CAAG;AAC3C,MAAI,OAAO,MAAMC,EAAU,QAAA,CAAS,EAAG,QAAO;AAC9C,QAAMC,wBAAY,KAAA;AAClB,MAAIC,IAAMD,EAAM,YAAA,IAAgBD,EAAU,YAAA;AAM1C,SAJEC,EAAM,SAAA,IAAaD,EAAU,cAC5BC,EAAM,SAAA,MAAeD,EAAU,cAAcC,EAAM,QAAA,KAAaD,EAAU,QAAA,MACxDE,KAAO,IACxB,EAAAL,MAAW,UAAaK,IAAML,KAC9BC,MAAW,UAAaI,IAAMJ;AAEpC;AAEO,MAAMK,KAA0C,CAAC;AAAA,EACtD,OAAAX;AA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