@photon-ai/pho-ui 4.11.0 → 4.13.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/chunks/animated-height-zr7BmFY1.js +56 -0
- package/dist/chunks/animated-height-zr7BmFY1.js.map +1 -0
- package/dist/chunks/basic-page-6dDfY33L.js +2197 -0
- package/dist/chunks/basic-page-6dDfY33L.js.map +1 -0
- package/dist/chunks/box-search-C9EVZgcb.js +56 -0
- package/dist/chunks/box-search-C9EVZgcb.js.map +1 -0
- package/dist/chunks/{chat-B0WIgEyM.js → chat-Bu8UyIbT.js} +207 -205
- package/dist/chunks/chat-Bu8UyIbT.js.map +1 -0
- package/dist/chunks/{checkbox-CLPmblNA.js → checkbox-CwvoEJhd.js} +2 -2
- package/dist/chunks/{checkbox-CLPmblNA.js.map → checkbox-CwvoEJhd.js.map} +1 -1
- package/dist/chunks/choice-card-_Ocs0iUj.js +17 -0
- package/dist/chunks/choice-card-_Ocs0iUj.js.map +1 -0
- package/dist/chunks/chrome-Ds7WykBJ.js +14 -0
- package/dist/chunks/chrome-Ds7WykBJ.js.map +1 -0
- package/dist/chunks/{command-iYvU6Mhf.js → command-D5g49VqR.js} +3 -3
- package/dist/chunks/{command-iYvU6Mhf.js.map → command-D5g49VqR.js.map} +1 -1
- package/dist/chunks/{data-table-B1dmrN6r.js → data-table-hzZb7Otx.js} +58 -56
- package/dist/chunks/{data-table-B1dmrN6r.js.map → data-table-hzZb7Otx.js.map} +1 -1
- package/dist/chunks/{dialog-MPvem7yV.js → dialog-ChS0tdHa.js} +120 -116
- package/dist/chunks/dialog-ChS0tdHa.js.map +1 -0
- package/dist/chunks/{filter-bar-B-oYYBsU.js → filter-bar-C4sPEjw1.js} +63 -66
- package/dist/chunks/filter-bar-C4sPEjw1.js.map +1 -0
- package/dist/chunks/ghost-search-8PzP73zS.js +50 -0
- package/dist/chunks/ghost-search-8PzP73zS.js.map +1 -0
- package/dist/chunks/{input-DjvZoF8v.js → input-fFWvPJOf.js} +2 -1
- package/dist/chunks/{input-DjvZoF8v.js.map → input-fFWvPJOf.js.map} +1 -1
- package/dist/chunks/{trace-D1fOFzJt.js → trace-DyjsBY-S.js} +15 -13
- package/dist/chunks/{trace-D1fOFzJt.js.map → trace-DyjsBY-S.js.map} +1 -1
- package/dist/components/chat.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/data-table.js +4 -3
- package/dist/components/dialog.js +1 -1
- package/dist/components/field.js +34 -29
- package/dist/components/field.js.map +1 -1
- package/dist/components/filter-bar.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/radio-group.js +64 -59
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/scope.js +418 -0
- package/dist/components/scope.js.map +1 -0
- package/dist/components/trace.js +1 -1
- package/dist/index.js +176 -175
- package/dist/motion.js +61 -36
- package/dist/motion.js.map +1 -1
- package/dist/sections/basic-page.js +2 -2
- package/dist/src/components/chat/chat.d.ts +7 -4
- package/dist/src/components/dialog/dialog.d.ts +9 -1
- package/dist/src/components/field/field.d.ts +11 -1
- package/dist/src/components/input-group/box-search.d.ts +29 -0
- package/dist/src/components/radio-group/radio-card.d.ts +11 -4
- package/dist/src/components/scope/index.d.ts +1 -0
- package/dist/src/components/scope/scope.d.ts +98 -0
- package/dist/src/motion/index.d.ts +52 -0
- package/dist/src/sections/basic-page/basic-page.d.ts +145 -15
- package/dist/src/sections/basic-page/index.d.ts +1 -1
- package/dist/src/utils/animated-height.d.ts +16 -7
- package/dist/src/utils/choice-card.d.ts +8 -1
- package/dist/src/utils/ghost-search.d.ts +19 -3
- package/package.json +5 -1
- package/dist/chunks/animated-height-I44sUq0n.js +0 -48
- package/dist/chunks/animated-height-I44sUq0n.js.map +0 -1
- package/dist/chunks/basic-page-B5FsORRi.js +0 -1885
- package/dist/chunks/basic-page-B5FsORRi.js.map +0 -1
- package/dist/chunks/chat-B0WIgEyM.js.map +0 -1
- package/dist/chunks/choice-card-BVNP1NB6.js +0 -17
- package/dist/chunks/choice-card-BVNP1NB6.js.map +0 -1
- package/dist/chunks/dialog-MPvem7yV.js.map +0 -1
- package/dist/chunks/filter-bar-B-oYYBsU.js.map +0 -1
- package/dist/chunks/ghost-search-CNVs9k1o.js +0 -34
- package/dist/chunks/ghost-search-CNVs9k1o.js.map +0 -1
|
@@ -1,144 +1,144 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as
|
|
3
|
-
import { a as
|
|
2
|
+
import { t as h } from "./cn-ChIgwEl3.js";
|
|
3
|
+
import { a as I } from "./button-C9VqBBIr.js";
|
|
4
4
|
import { t as P } from "./close-button-GvqWbLl0.js";
|
|
5
|
-
import { t as
|
|
5
|
+
import { t as _ } from "./animated-height-zr7BmFY1.js";
|
|
6
6
|
import { t as p } from "./scroll-area-DSwD9th7.js";
|
|
7
|
-
import { createContext as
|
|
8
|
-
import { jsx as e, jsxs as
|
|
7
|
+
import { createContext as F, useCallback as O, useContext as j, useEffect as T, useMemo as M, useRef as C, useState as R } from "react";
|
|
8
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
9
9
|
import { Dialog as f } from "@base-ui/react/dialog";
|
|
10
|
-
var w =
|
|
11
|
-
function
|
|
12
|
-
return
|
|
10
|
+
var w = F(null);
|
|
11
|
+
function re() {
|
|
12
|
+
return j(w)?.pending ?? !1;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const [r, a] =
|
|
16
|
-
|
|
14
|
+
function $({ onOpenChange: t, actionsRef: n, ...s }) {
|
|
15
|
+
const [r, a] = R(!1), i = C(!1), o = C(null);
|
|
16
|
+
T(() => {
|
|
17
17
|
if (n)
|
|
18
|
-
return n.current =
|
|
18
|
+
return n.current = o.current, () => {
|
|
19
19
|
n.current = null;
|
|
20
20
|
};
|
|
21
21
|
}, [n]);
|
|
22
|
-
const
|
|
23
|
-
if (!u &&
|
|
24
|
-
|
|
22
|
+
const d = O((u, g) => {
|
|
23
|
+
if (!u && i.current) {
|
|
24
|
+
g.cancel();
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
t?.(u,
|
|
28
|
-
}, [t]),
|
|
27
|
+
t?.(u, g);
|
|
28
|
+
}, [t]), c = M(() => ({
|
|
29
29
|
pending: r,
|
|
30
30
|
beginPending: () => {
|
|
31
|
-
|
|
31
|
+
i.current = !0, a(!0);
|
|
32
32
|
},
|
|
33
33
|
endPending: () => {
|
|
34
|
-
|
|
34
|
+
i.current = !1, a(!1);
|
|
35
35
|
},
|
|
36
|
-
close: () =>
|
|
36
|
+
close: () => o.current?.close()
|
|
37
37
|
}), [r]);
|
|
38
38
|
return /* @__PURE__ */ e(w.Provider, {
|
|
39
|
-
value:
|
|
39
|
+
value: c,
|
|
40
40
|
children: /* @__PURE__ */ e(f.Root, {
|
|
41
|
-
actionsRef:
|
|
42
|
-
onOpenChange:
|
|
43
|
-
...
|
|
41
|
+
actionsRef: o,
|
|
42
|
+
onOpenChange: d,
|
|
43
|
+
...s
|
|
44
44
|
})
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
var
|
|
48
|
-
function
|
|
47
|
+
var G = f.Trigger, x = f.Portal, y = f.Close;
|
|
48
|
+
function J(t) {
|
|
49
49
|
return t != null && typeof t.then == "function";
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const a =
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
function K({ onClick: t, loading: n, disabled: s, ...r }) {
|
|
52
|
+
const a = j(w), [i, o] = R(!1), d = C(!0);
|
|
53
|
+
T(() => (d.current = !0, () => {
|
|
54
|
+
d.current = !1;
|
|
55
55
|
}), []);
|
|
56
|
-
function
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
59
|
-
if (!
|
|
56
|
+
function c(g) {
|
|
57
|
+
if (i || n) return;
|
|
58
|
+
const m = t?.(g);
|
|
59
|
+
if (!J(m)) {
|
|
60
60
|
a?.close();
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
a?.endPending(),
|
|
65
|
-
}, (
|
|
66
|
-
a?.endPending(),
|
|
63
|
+
o(!0), a?.beginPending(), m.then(() => {
|
|
64
|
+
a?.endPending(), d.current && o(!1), a?.close();
|
|
65
|
+
}, (v) => {
|
|
66
|
+
a?.endPending(), d.current && o(!1), typeof process < "u" && process.env.NODE_ENV !== "production" && console.error("Dialog.Action: async onClick rejected —", v);
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
const u =
|
|
70
|
-
return /* @__PURE__ */ e(
|
|
69
|
+
const u = i || n;
|
|
70
|
+
return /* @__PURE__ */ e(I, {
|
|
71
71
|
...r,
|
|
72
|
-
disabled:
|
|
72
|
+
disabled: s || u,
|
|
73
73
|
loading: u,
|
|
74
|
-
onClick:
|
|
74
|
+
onClick: c
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
function z({ className: t, ...n }) {
|
|
78
78
|
return /* @__PURE__ */ e(f.Backdrop, {
|
|
79
|
-
className:
|
|
79
|
+
className: h("bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-200 ease-out", "data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0", t),
|
|
80
80
|
...n
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function A({ className: t, ...n }) {
|
|
84
84
|
return /* @__PURE__ */ e(f.Popup, {
|
|
85
|
-
className:
|
|
85
|
+
className: h("border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg border outline-none", "flex max-h-[calc(100dvh-2rem)] flex-col sm:max-h-[calc(100dvh-4rem)]", "transition-[opacity,scale] duration-200 ease-out", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:duration-150", t),
|
|
86
86
|
...n
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function N({ className: t, ...n }) {
|
|
90
90
|
return /* @__PURE__ */ e(f.Title, {
|
|
91
|
-
className:
|
|
91
|
+
className: h("text-pho-primary font-display text-display-sm font-medium text-balance", t),
|
|
92
92
|
...n
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function b({ className: t, ...n }) {
|
|
96
96
|
return /* @__PURE__ */ e(f.Description, {
|
|
97
|
-
className:
|
|
97
|
+
className: h("text-pho-description text-display-xs font-normal", t),
|
|
98
98
|
...n
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
function B({ children: t, size: n = "md" }) {
|
|
102
102
|
return /* @__PURE__ */ e("span", {
|
|
103
103
|
"aria-hidden": !0,
|
|
104
|
-
className:
|
|
104
|
+
className: h("text-pho-secondary mb-1", n === "lg" ? "[&>svg]:size-12" : "[&>svg]:size-8"),
|
|
105
105
|
children: t
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
const
|
|
110
|
-
return /* @__PURE__ */
|
|
111
|
-
className:
|
|
112
|
-
...
|
|
108
|
+
function L({ icon: t, title: n, description: s, consequences: r, warning: a, actions: i, caption: o, showClose: d = !0, children: c, className: u, ...g }) {
|
|
109
|
+
const m = i == null && d, v = !!(t || n || s || m), k = r != null && r.length > 0, D = k || a != null || c != null;
|
|
110
|
+
return /* @__PURE__ */ l(x, { children: [/* @__PURE__ */ e(z, {}), /* @__PURE__ */ l(A, {
|
|
111
|
+
className: u,
|
|
112
|
+
...g,
|
|
113
113
|
children: [
|
|
114
|
-
|
|
114
|
+
v && /* @__PURE__ */ l("div", {
|
|
115
115
|
className: "flex shrink-0 flex-col gap-2 px-6 pt-6",
|
|
116
116
|
children: [
|
|
117
117
|
t && /* @__PURE__ */ e(B, { children: t }),
|
|
118
|
-
(n ||
|
|
118
|
+
(n || m) && /* @__PURE__ */ l("div", {
|
|
119
119
|
className: "relative",
|
|
120
|
-
children: [n ? /* @__PURE__ */ e(
|
|
121
|
-
className:
|
|
120
|
+
children: [n ? /* @__PURE__ */ e(N, {
|
|
121
|
+
className: m ? "pr-12" : void 0,
|
|
122
122
|
children: n
|
|
123
123
|
}) : /* @__PURE__ */ e("div", {
|
|
124
124
|
className: "h-[1.625rem]",
|
|
125
125
|
"aria-hidden": "true"
|
|
126
|
-
}),
|
|
126
|
+
}), m && /* @__PURE__ */ e(y, { render: /* @__PURE__ */ e(P, { className: "absolute top-1/2 right-0 z-10 -translate-y-1/2" }) })]
|
|
127
127
|
}),
|
|
128
|
-
|
|
128
|
+
s && /* @__PURE__ */ e(b, { children: s })
|
|
129
129
|
]
|
|
130
130
|
}),
|
|
131
|
-
|
|
131
|
+
D && /* @__PURE__ */ l(p.Root, {
|
|
132
132
|
className: "min-h-0 flex-1",
|
|
133
|
-
children: [/* @__PURE__ */ e(p.Viewport, { children: /* @__PURE__ */
|
|
133
|
+
children: [/* @__PURE__ */ e(p.Viewport, { children: /* @__PURE__ */ l(p.Content, {
|
|
134
134
|
className: "flex flex-col gap-5 px-6 py-5",
|
|
135
135
|
children: [
|
|
136
|
-
|
|
136
|
+
k && /* @__PURE__ */ e("ul", {
|
|
137
137
|
className: "text-pho-description text-md [&_strong]:text-pho-secondary space-y-1 [&_strong]:font-medium",
|
|
138
|
-
children: r.map((
|
|
138
|
+
children: r.map((V, E) => /* @__PURE__ */ e("li", {
|
|
139
139
|
className: "relative pl-4 before:absolute before:top-2.5 before:left-1 before:size-1 before:rounded-full before:bg-current",
|
|
140
|
-
children:
|
|
141
|
-
},
|
|
140
|
+
children: V
|
|
141
|
+
}, E))
|
|
142
142
|
}),
|
|
143
143
|
a != null && /* @__PURE__ */ e("p", {
|
|
144
144
|
className: "text-pho-error text-display-xs font-medium",
|
|
@@ -148,47 +148,51 @@ function K({ icon: t, title: n, description: l, consequences: r, warning: a, act
|
|
|
148
148
|
]
|
|
149
149
|
}) }), /* @__PURE__ */ e(p.Scrollbar, { children: /* @__PURE__ */ e(p.Thumb, {}) })]
|
|
150
150
|
}),
|
|
151
|
-
o != null && /* @__PURE__ */
|
|
152
|
-
className:
|
|
153
|
-
children: o
|
|
151
|
+
(i != null || o != null) && /* @__PURE__ */ l("div", {
|
|
152
|
+
className: h("flex shrink-0 flex-wrap items-center justify-end gap-x-2 gap-y-3 px-6 pb-5", !D && "pt-5"),
|
|
153
|
+
children: [o != null && /* @__PURE__ */ e("p", {
|
|
154
|
+
"data-dialog-caption": "",
|
|
155
|
+
className: "text-pho-description min-w-48 flex-1 pr-2 text-xs",
|
|
156
|
+
children: o
|
|
157
|
+
}), i]
|
|
154
158
|
})
|
|
155
159
|
]
|
|
156
160
|
})] });
|
|
157
161
|
}
|
|
158
|
-
function
|
|
162
|
+
function H({ className: t, ...n }) {
|
|
159
163
|
return /* @__PURE__ */ e(f.Popup, {
|
|
160
|
-
className:
|
|
164
|
+
className: h("border-pho-secondary bg-pho-primary shadow-pho-xl fixed inset-4 z-50 flex flex-col overflow-hidden rounded-lg border outline-none sm:inset-8", "transition-[opacity,scale] duration-200 ease-out", "data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0", "data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[ending-style]:duration-150", t),
|
|
161
165
|
...n
|
|
162
166
|
});
|
|
163
167
|
}
|
|
164
|
-
function
|
|
165
|
-
const
|
|
166
|
-
return /* @__PURE__ */
|
|
167
|
-
className:
|
|
168
|
-
...
|
|
168
|
+
function Q({ icon: t, title: n, description: s, actions: r, showClose: a = !0, children: i, className: o, ...d }) {
|
|
169
|
+
const c = r == null && a;
|
|
170
|
+
return /* @__PURE__ */ l(x, { children: [/* @__PURE__ */ e(z, {}), /* @__PURE__ */ l(H, {
|
|
171
|
+
className: o,
|
|
172
|
+
...d,
|
|
169
173
|
children: [
|
|
170
|
-
!!(t || n ||
|
|
174
|
+
!!(t || n || s || c) && /* @__PURE__ */ l("div", {
|
|
171
175
|
className: "flex shrink-0 flex-col gap-2 px-6 pt-6",
|
|
172
176
|
children: [
|
|
173
177
|
t && /* @__PURE__ */ e(B, { children: t }),
|
|
174
|
-
(n ||
|
|
178
|
+
(n || c) && /* @__PURE__ */ l("div", {
|
|
175
179
|
className: "relative",
|
|
176
|
-
children: [n ? /* @__PURE__ */ e(
|
|
177
|
-
className:
|
|
180
|
+
children: [n ? /* @__PURE__ */ e(N, {
|
|
181
|
+
className: c ? "pr-12" : void 0,
|
|
178
182
|
children: n
|
|
179
183
|
}) : /* @__PURE__ */ e("div", {
|
|
180
184
|
className: "h-[1.625rem]",
|
|
181
185
|
"aria-hidden": "true"
|
|
182
|
-
}),
|
|
186
|
+
}), c && /* @__PURE__ */ e(y, { render: /* @__PURE__ */ e(P, { className: "absolute top-1/2 right-0 z-10 -translate-y-1/2" }) })]
|
|
183
187
|
}),
|
|
184
|
-
|
|
188
|
+
s && /* @__PURE__ */ e(b, { children: s })
|
|
185
189
|
]
|
|
186
190
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ l(p.Root, {
|
|
188
192
|
className: "min-h-0 flex-1",
|
|
189
193
|
children: [/* @__PURE__ */ e(p.Viewport, { children: /* @__PURE__ */ e(p.Content, {
|
|
190
194
|
className: "px-6 py-5",
|
|
191
|
-
children:
|
|
195
|
+
children: i
|
|
192
196
|
}) }), /* @__PURE__ */ e(p.Scrollbar, { children: /* @__PURE__ */ e(p.Thumb, {}) })]
|
|
193
197
|
}),
|
|
194
198
|
r != null && /* @__PURE__ */ e("div", {
|
|
@@ -198,34 +202,34 @@ function L({ icon: t, title: n, description: l, actions: r, showClose: a = !0, c
|
|
|
198
202
|
]
|
|
199
203
|
})] });
|
|
200
204
|
}
|
|
201
|
-
function
|
|
205
|
+
function S({ className: t, ...n }) {
|
|
202
206
|
return /* @__PURE__ */ e(f.Popup, {
|
|
203
|
-
className:
|
|
207
|
+
className: h("bg-pho-page fixed inset-0 z-50 overflow-y-auto outline-none", "transition-opacity duration-200 ease-out", "data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0", t),
|
|
204
208
|
...n
|
|
205
209
|
});
|
|
206
210
|
}
|
|
207
|
-
function
|
|
211
|
+
function U({ icon: t, title: n, description: s, actions: r, showClose: a = !0, frameClassName: i, children: o, className: d, ...c }) {
|
|
208
212
|
const u = r == null && a;
|
|
209
|
-
return /* @__PURE__ */ e(
|
|
210
|
-
className:
|
|
211
|
-
...
|
|
212
|
-
children: [u && /* @__PURE__ */ e(
|
|
213
|
-
className:
|
|
214
|
-
children: /* @__PURE__ */
|
|
213
|
+
return /* @__PURE__ */ e(x, { children: /* @__PURE__ */ l(S, {
|
|
214
|
+
className: d,
|
|
215
|
+
...c,
|
|
216
|
+
children: [u && /* @__PURE__ */ e(y, { render: /* @__PURE__ */ e(P, { className: "fixed top-4 right-4 z-10" }) }), /* @__PURE__ */ e("div", {
|
|
217
|
+
className: h("flex min-h-full items-center justify-center px-6 pt-6 pb-20", i),
|
|
218
|
+
children: /* @__PURE__ */ l("div", {
|
|
215
219
|
className: "w-full max-w-md",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
220
|
+
children: [/* @__PURE__ */ l(_, {
|
|
217
221
|
className: "flex flex-col gap-5",
|
|
218
|
-
children: [(t || n ||
|
|
222
|
+
children: [(t || n || s) && /* @__PURE__ */ l("div", {
|
|
219
223
|
className: "flex flex-col gap-2",
|
|
220
224
|
children: [
|
|
221
225
|
t && /* @__PURE__ */ e(B, {
|
|
222
226
|
size: "lg",
|
|
223
227
|
children: t
|
|
224
228
|
}),
|
|
225
|
-
n && /* @__PURE__ */ e(
|
|
226
|
-
|
|
229
|
+
n && /* @__PURE__ */ e(N, { children: n }),
|
|
230
|
+
s && /* @__PURE__ */ e(b, { children: s })
|
|
227
231
|
]
|
|
228
|
-
}),
|
|
232
|
+
}), o]
|
|
229
233
|
}), r != null && /* @__PURE__ */ e("div", {
|
|
230
234
|
className: "mt-5 flex items-center justify-end gap-2",
|
|
231
235
|
children: r
|
|
@@ -234,25 +238,25 @@ function Q({ icon: t, title: n, description: l, actions: r, showClose: a = !0, f
|
|
|
234
238
|
})]
|
|
235
239
|
}) });
|
|
236
240
|
}
|
|
237
|
-
var
|
|
238
|
-
Root:
|
|
239
|
-
Trigger:
|
|
240
|
-
Portal:
|
|
241
|
+
var ae = {
|
|
242
|
+
Root: $,
|
|
243
|
+
Trigger: G,
|
|
244
|
+
Portal: x,
|
|
241
245
|
Backdrop: z,
|
|
242
|
-
Popup:
|
|
243
|
-
InsetPopup:
|
|
244
|
-
FullscreenPopup:
|
|
245
|
-
Title:
|
|
246
|
-
Description:
|
|
247
|
-
Close:
|
|
248
|
-
Action:
|
|
249
|
-
Content:
|
|
250
|
-
InsetContent:
|
|
251
|
-
FullscreenContent:
|
|
246
|
+
Popup: A,
|
|
247
|
+
InsetPopup: H,
|
|
248
|
+
FullscreenPopup: S,
|
|
249
|
+
Title: N,
|
|
250
|
+
Description: b,
|
|
251
|
+
Close: y,
|
|
252
|
+
Action: K,
|
|
253
|
+
Content: L,
|
|
254
|
+
InsetContent: Q,
|
|
255
|
+
FullscreenContent: U
|
|
252
256
|
};
|
|
253
257
|
export {
|
|
254
|
-
|
|
255
|
-
|
|
258
|
+
re as n,
|
|
259
|
+
ae as t
|
|
256
260
|
};
|
|
257
261
|
|
|
258
|
-
//# sourceMappingURL=dialog-
|
|
262
|
+
//# sourceMappingURL=dialog-ChS0tdHa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog-ChS0tdHa.js","names":[],"sources":["../../src/components/dialog/dialog.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentProps,\n type ElementType,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n} from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { AnimatedHeight } from \"../../utils/animated-height\";\nimport { cn } from \"../../utils/cn\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { Button, type ButtonProps } from \"../button/button\";\nimport { CloseButton } from \"../button/close-button\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\n/* ========================== Async pending context ========================== */\n\n/** Imperative actions exposed by Base UI's `actionsRef`. */\ninterface RootActions {\n unmount: () => void;\n close: () => void;\n}\n\ninterface DialogPendingContextValue {\n /** True while a `Dialog.Action` promise is in flight. */\n pending: boolean;\n beginPending: () => void;\n endPending: () => void;\n /** Close the dialog imperatively (used by `Dialog.Action` on resolve). */\n close: () => void;\n}\n\nconst DialogPendingContext = createContext<DialogPendingContextValue | null>(\n null,\n);\n\n/**\n * Whether the surrounding dialog has a `Dialog.Action` promise in flight —\n * use it to disable secondary actions (Cancel etc.) while work is pending.\n * Returns `false` outside a `Dialog.Root`.\n */\nexport function useDialogPending(): boolean {\n return useContext(DialogPendingContext)?.pending ?? false;\n}\n\ntype RootProps = ComponentProps<typeof BaseDialog.Root>;\n\n/**\n * `Dialog.Root` with async awareness: while a `Dialog.Action` promise is\n * pending, every close request (outside press, Escape, `Dialog.Close`) is\n * cancelled so the dialog stays open until the work settles. Props pass\n * through to Base UI's `Dialog.Root` unchanged.\n */\nfunction Root({ onOpenChange, actionsRef, ...props }: RootProps) {\n const [pending, setPending] = useState(false);\n // Guard reads a ref so a resolve → close() in the same tick isn't blocked\n // by a not-yet-flushed state update.\n const pendingRef = useRef(false);\n const internalActionsRef = useRef<RootActions | null>(null);\n\n // Keep a caller-supplied actionsRef working alongside our internal one.\n useEffect(() => {\n if (!actionsRef) return;\n actionsRef.current = internalActionsRef.current;\n return () => {\n actionsRef.current = null;\n };\n }, [actionsRef]);\n\n const handleOpenChange = useCallback<NonNullable<RootProps[\"onOpenChange\"]>>(\n (open, eventDetails) => {\n if (!open && pendingRef.current) {\n eventDetails.cancel();\n return;\n }\n onOpenChange?.(open, eventDetails);\n },\n [onOpenChange],\n );\n\n const contextValue = useMemo<DialogPendingContextValue>(\n () => ({\n pending,\n beginPending: () => {\n pendingRef.current = true;\n setPending(true);\n },\n endPending: () => {\n pendingRef.current = false;\n setPending(false);\n },\n close: () => internalActionsRef.current?.close(),\n }),\n [pending],\n );\n\n return (\n <DialogPendingContext.Provider value={contextValue}>\n <BaseDialog.Root\n actionsRef={internalActionsRef}\n onOpenChange={handleOpenChange}\n {...props}\n />\n </DialogPendingContext.Provider>\n );\n}\n\nconst Trigger = BaseDialog.Trigger;\nconst Portal = BaseDialog.Portal;\nconst Close = BaseDialog.Close;\n\n/* ============================== Dialog.Action ============================== */\n\nexport interface DialogActionProps extends Omit<ButtonProps, \"onClick\"> {\n /**\n * Confirm handler. Return a promise to keep the dialog open while it runs:\n * the button shows `loading`, all dismissal is locked, and the dialog\n * closes when the promise resolves. On rejection the dialog stays open —\n * surface errors inside the handler. A non-promise return closes\n * immediately, like `Dialog.Close`.\n */\n onClick?: (\n event: ReactMouseEvent<HTMLButtonElement>,\n ) => void | Promise<unknown>;\n}\n\nfunction isThenable(value: unknown): value is Promise<unknown> {\n return (\n value != null && typeof (value as { then?: unknown }).then === \"function\"\n );\n}\n\n/**\n * The confirm button of an action row, with native promise support — a\n * `Button` that runs its (possibly async) `onClick` and closes the dialog\n * when the work settles successfully.\n */\nfunction Action({ onClick, loading, disabled, ...props }: DialogActionProps) {\n const pendingContext = useContext(DialogPendingContext);\n const [busy, setBusy] = useState(false);\n const mountedRef = useRef(true);\n\n useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n };\n }, []);\n\n function handleClick(event: ReactMouseEvent<HTMLButtonElement>) {\n if (busy || loading) return;\n const result = onClick?.(event);\n if (!isThenable(result)) {\n pendingContext?.close();\n return;\n }\n setBusy(true);\n pendingContext?.beginPending();\n result.then(\n () => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n pendingContext?.close();\n },\n (error: unknown) => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n if (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n ) {\n console.error(\"Dialog.Action: async onClick rejected —\", error);\n }\n },\n );\n }\n\n const inert = busy || loading;\n return (\n <Button\n {...props}\n disabled={disabled || inert}\n loading={inert}\n onClick={handleClick}\n />\n );\n}\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Backdrop>) {\n return (\n <BaseDialog.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n // Floating layer: bg-pho-primary + border-pho-secondary hairline, elevation kept.\n \"border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg border outline-none\",\n // Global height cap — the inset panel's footprint (inset-4 /\n // sm:inset-8). A flex column so the body region can shrink and\n // scroll while header and actions stay pinned.\n \"flex max-h-[calc(100dvh-2rem)] flex-col sm:max-h-[calc(100dvh-4rem)]\",\n // Opacity + scale only — leave translate centering alone (no transition-all).\n \"transition-[opacity,scale] duration-200 ease-out\",\n \"data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:duration-150\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseDialog.Title>) {\n return (\n <BaseDialog.Title\n className={cn(\n \"text-pho-primary font-display text-display-sm font-medium text-balance\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Description>) {\n return (\n <BaseDialog.Description\n className={cn(\n \"text-pho-description text-display-xs font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Header icon chrome: secondary ink, a hair of extra air before the title.\n * Panel dialogs use 32px (`size-8`); fullscreen gates step up to 48px\n * (`size-12`) so the glyph reads at viewport scale.\n */\nfunction DialogHeaderIcon({\n children,\n size = \"md\",\n}: {\n children: ReactNode;\n size?: \"md\" | \"lg\";\n}) {\n return (\n <span\n aria-hidden\n className={cn(\n \"text-pho-secondary mb-1\",\n size === \"lg\" ? \"[&>svg]:size-12\" : \"[&>svg]:size-8\",\n )}\n >\n {children}\n </span>\n );\n}\n\ninterface ContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /**\n * Decorative icon above the title — typically a Tabler outline icon.\n * Rendered aria-hidden in secondary ink at 32px (`[&>svg]:size-8`). Pass a\n * styled node to override the ink; the size is owned by the slot.\n */\n icon?: ReactNode;\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Consequence bullets rendered as a list at the top of the body — one item\n * per outcome (what is deleted, what survives, who loses access). Use on\n * destructive confirms where the one-line description undersells the\n * impact; keep each item to a single short sentence. Wrap the load-bearing\n * figure in `<strong>` (\"<strong>3 members</strong> lose access\") — the\n * list styles it (secondary ink, medium weight); no classes needed.\n */\n consequences?: ReactNode[];\n /**\n * Final cautionary line under `consequences` — error ink at description\n * size (e.g. \"It cannot be undone. Please be certain.\"). Reserve it for\n * irreversible actions; keep it short.\n */\n warning?: ReactNode;\n /**\n * Footer action row (Cancel / Confirm, etc.). Iron rule: when `actions` is\n * set, the header close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * A quiet footnote at the panel's foot — the limit, cost or policy that\n * frames the decision without being it (\"You may change these up to five\n * times a week.\"). Description ink at `text-xs`, at the action row's\n * start with the actions at its end; when the row runs short of room it\n * takes a line of its own above them. One short sentence.\n */\n caption?: ReactNode;\n /**\n * Header close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Convenience panel: renders the portal, backdrop, and styled popup with an\n * optional header (title/description + close) and optional action row. For\n * full control, compose the parts directly (`Dialog.Portal` /\n * `Dialog.Backdrop` / `Dialog.Popup`).\n */\nfunction Content({\n icon,\n title,\n description,\n consequences,\n warning,\n actions,\n caption,\n showClose = true,\n children,\n className,\n ...props\n}: ContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a header X.\n const showCloseButton = actions == null && showClose;\n const hasHeader = Boolean(icon || title || description || showCloseButton);\n const hasConsequences = consequences != null && consequences.length > 0;\n // The scrollable middle region — actions stay pinned below it.\n const hasScrollBody = hasConsequences || warning != null || children != null;\n\n return (\n <Portal>\n <Backdrop />\n <Popup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex shrink-0 flex-col gap-2 px-6 pt-6\">\n {icon && <DialogHeaderIcon>{icon}</DialogHeaderIcon>}\n {(title || showCloseButton) && (\n // Title row height = title only. Close is out of flow, centered\n // on the row, and may paint outside it (no clip, no stretch).\n <div className=\"relative\">\n {title ? (\n <Title className={showCloseButton ? \"pr-12\" : undefined}>\n {title}\n </Title>\n ) : (\n <div className=\"h-[1.625rem]\" aria-hidden=\"true\" />\n )}\n {showCloseButton && (\n <Close\n render={\n <CloseButton className=\"absolute top-1/2 right-0 z-10 -translate-y-1/2\" />\n }\n />\n )}\n </div>\n )}\n {description && <Description>{description}</Description>}\n </div>\n )}\n {hasScrollBody && (\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content className=\"flex flex-col gap-5 px-6 py-5\">\n {hasConsequences && (\n <ul className=\"text-pho-description text-md [&_strong]:text-pho-secondary space-y-1 [&_strong]:font-medium\">\n {consequences.map((item, index) => (\n // Hand-drawn marker: a 4px dot on the first line's center —\n // quieter than the browser disc, ink tracks the text.\n <li\n key={index}\n className=\"relative pl-4 before:absolute before:top-2.5 before:left-1 before:size-1 before:rounded-full before:bg-current\"\n >\n {item}\n </li>\n ))}\n </ul>\n )}\n {warning != null && (\n <p className=\"text-pho-error text-display-xs font-medium\">\n {warning}\n </p>\n )}\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n )}\n {(actions != null || caption != null) && (\n <div\n className={cn(\n \"flex shrink-0 flex-wrap items-center justify-end gap-x-2 gap-y-3 px-6 pb-5\",\n !hasScrollBody && \"pt-5\",\n )}\n >\n {caption != null && (\n // Grows into the row's free width, never under 12rem: below\n // that it wraps to a line of its own above the actions.\n <p\n data-dialog-caption=\"\"\n className=\"text-pho-description min-w-48 flex-1 pr-2 text-xs\"\n >\n {caption}\n </p>\n )}\n {actions}\n </div>\n )}\n </Popup>\n </Portal>\n );\n}\n\n/* =========================== Dialog.InsetContent =========================== */\n\n/**\n * Near-fullscreen popup — the viewport minus a breathing ring, floating over\n * a backdrop (the page stays visible through the gap, so it dims like any\n * floating layer). Still a card: border, elevation, rounded corners; the\n * scale gesture stays but shrinks to 98% — at this size 95% reads like a jump.\n */\nfunction InsetPopup({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n \"border-pho-secondary bg-pho-primary shadow-pho-xl fixed inset-4 z-50 flex flex-col overflow-hidden rounded-lg border outline-none sm:inset-8\",\n \"transition-[opacity,scale] duration-200 ease-out\",\n \"data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[ending-style]:duration-150\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface InsetContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /** Decorative icon above the title — same treatment as `Content`. */\n icon?: ReactNode;\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Bottom action row. Iron rule as `Content`: when `actions` is set, the\n * header close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Header close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Convenience near-fullscreen panel: header pinned on top, body filling and\n * scrolling on its own, optional action row pinned at the bottom. Sits\n * between `Content` (a focused card) and `FullscreenContent` (a page\n * takeover): use it for roomy working surfaces — pickers, editors, previews —\n * that still want the page peeking through an edge.\n */\nfunction InsetContent({\n icon,\n title,\n description,\n actions,\n showClose = true,\n children,\n className,\n ...props\n}: InsetContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a header X.\n const showCloseButton = actions == null && showClose;\n const hasHeader = Boolean(icon || title || description || showCloseButton);\n\n return (\n <Portal>\n <Backdrop />\n <InsetPopup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex shrink-0 flex-col gap-2 px-6 pt-6\">\n {icon && <DialogHeaderIcon>{icon}</DialogHeaderIcon>}\n {(title || showCloseButton) && (\n <div className=\"relative\">\n {title ? (\n <Title className={showCloseButton ? \"pr-12\" : undefined}>\n {title}\n </Title>\n ) : (\n <div className=\"h-[1.625rem]\" aria-hidden=\"true\" />\n )}\n {showCloseButton && (\n <Close\n render={\n <CloseButton className=\"absolute top-1/2 right-0 z-10 -translate-y-1/2\" />\n }\n />\n )}\n </div>\n )}\n {description && <Description>{description}</Description>}\n </div>\n )}\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content className=\"px-6 py-5\">\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n {actions != null && (\n <div className=\"flex shrink-0 items-center justify-end gap-2 px-6 pb-5\">\n {actions}\n </div>\n )}\n </InsetPopup>\n </Portal>\n );\n}\n\n/* ========================= Dialog.FullscreenContent ======================== */\n\n/**\n * Full-viewport popup — a page-surface takeover instead of a floating card.\n * No backdrop: the popup itself is the layer. Fade only; scale is a floating-\n * card gesture and reads wrong at viewport size.\n */\nfunction FullscreenPopup({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n \"bg-pho-page fixed inset-0 z-50 overflow-y-auto outline-none\",\n \"transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface FullscreenContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /**\n * Decorative icon above the title — same chrome as `Content`, but 48px\n * (`size-12`) for viewport-scale gates.\n */\n icon?: ReactNode;\n /** Heading of the takeover. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Action row under the body. Iron rule as `Content`: when `actions` is set,\n * the corner close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Corner close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n /**\n * Classes on the viewport-centering frame (the `min-h-full` flex host).\n * Use to drop the default optical `pb-20` when the stack grows (e.g. a\n * captcha) so true center stays put: `frameClassName=\"pb-6\"`.\n */\n frameClassName?: string;\n children?: ReactNode;\n}\n\n/**\n * Convenience full-screen panel: the whole viewport becomes the dialog, with\n * a centered column at the standalone-flow width (28rem — the same measure as\n * onboarding / invite cards). Column height follows its content through\n * `AnimatedHeight` (same spring as the Card shell), so step swaps — phone →\n * OTP → captcha — glide instead of jumping. Use for gates the visitor must\n * deal with before the page behind makes sense (e.g. binding a phone number);\n * prefer `Content` for everything conversational.\n */\nfunction FullscreenContent({\n icon,\n title,\n description,\n actions,\n showClose = true,\n frameClassName,\n children,\n className,\n ...props\n}: FullscreenContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a corner X.\n const showCloseButton = actions == null && showClose;\n\n return (\n <Portal>\n <FullscreenPopup className={className} {...props}>\n {showCloseButton && (\n <Close\n render={<CloseButton className=\"fixed top-4 right-4 z-10\" />}\n />\n )}\n {/* Default `pb-20` optically lifts the column above true center. */}\n <div\n className={cn(\n \"flex min-h-full items-center justify-center px-6 pt-6 pb-20\",\n frameClassName,\n )}\n >\n {/* Width stays on the outer host; AnimatedHeight measures the\n header + body stack and springs its own height on content\n changes. The action row sits below it, outside the clip: while\n the body grows the container is shorter than its content for a\n few frames, and a row inside it would be cut off at the bottom\n (a pressed \"Send code\" turning grey right as a captcha mounts).\n Outside, the row rides the spring instead. */}\n <div className=\"w-full max-w-md\">\n <AnimatedHeight className=\"flex flex-col gap-5\">\n {(icon || title || description) && (\n <div className=\"flex flex-col gap-2\">\n {icon && (\n <DialogHeaderIcon size=\"lg\">{icon}</DialogHeaderIcon>\n )}\n {title && <Title>{title}</Title>}\n {description && <Description>{description}</Description>}\n </div>\n )}\n {children}\n </AnimatedHeight>\n {actions != null && (\n <div className=\"mt-5 flex items-center justify-end gap-2\">\n {actions}\n </div>\n )}\n </div>\n </div>\n </FullscreenPopup>\n </Portal>\n );\n}\n\n/**\n * Modal dialog built on Base UI `Dialog`. Controlled or uncontrolled via\n * `Dialog.Root` (`open` / `onOpenChange` / `defaultOpen`). `Dialog.Action`\n * adds native promise support: an async confirm keeps the dialog open and\n * undismissable until the work resolves.\n */\nexport const Dialog = {\n Root,\n Trigger,\n Portal,\n Backdrop,\n Popup,\n InsetPopup,\n FullscreenPopup,\n Title,\n Description,\n Close,\n Action,\n Content,\n InsetContent,\n FullscreenContent,\n};\n"],"mappings":";;;;;;;;;AA6CA,IAAM,IAAuB,EAC3B,IACF;AAOA,SAAgB,KAA4B;AAC1C,SAAO,EAAW,CAAoB,GAAG,WAAW;AACtD;AAUA,SAAS,EAAK,EAAE,cAAA,GAAc,YAAA,GAAY,GAAG,EAAA,GAAoB;AAC/D,QAAM,CAAC,GAAS,CAAA,IAAc,EAAS,EAAK,GAGtC,IAAa,EAAO,EA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