@amateescu/portal-ui-components 0.0.33 → 0.0.35-beta0

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.
Files changed (35) hide show
  1. package/dist/{Box-D-aleOLf.js → Box-C-zPAMZN.js} +1 -1
  2. package/dist/{Button-xgiLW4_3.js → Button-DG4uye8X.js} +3 -3
  3. package/dist/{ButtonBase-DUKuDCWw.js → ButtonBase-DrxMtoTW.js} +1 -1
  4. package/dist/{CircularProgress-Dq_bUtxt.js → CircularProgress-DpvktFBW.js} +1 -1
  5. package/dist/{EllipsisOutlined-CmR4hXJ_.js → EllipsisOutlined-DfCu6q_b.js} +816 -816
  6. package/dist/{PurePanel-CykVuv66.js → PurePanel-DvQTygSo.js} +487 -491
  7. package/dist/{Skeleton-BBwDqRB3.js → Skeleton-Bh0A9xju.js} +15 -18
  8. package/dist/{UserInfoDropdown-GTCkmg6H.js → UserInfoDropdown-CWTcdnqL.js} +1186 -1221
  9. package/dist/components/ConfirmationModal/ConfirmationModal.js +1 -1
  10. package/dist/components/ConfirmationModal/ConfirmationModal.stories.js +1 -1
  11. package/dist/components/CustomButton/CustomButton.js +1 -1
  12. package/dist/components/CustomButton/CustomButton.stories.js +1 -1
  13. package/dist/components/CustomPagination/CustomPagination.js +4 -4
  14. package/dist/components/ErrorModal/ErrorModal.js +1 -1
  15. package/dist/components/ErrorModal/ErrorModal.stories.js +1 -1
  16. package/dist/components/InfoModal/InfoModal.js +1 -1
  17. package/dist/components/InfoModal/InfoModal.stories.js +1 -1
  18. package/dist/components/KpiCard/KpiCard.js +715 -682
  19. package/dist/components/LoadingAnimation/LoadingAnimation.js +2 -2
  20. package/dist/components/Login/Login.js +775 -760
  21. package/dist/components/Login/Login.stories.js +4 -1
  22. package/dist/components/SideMenu/SideMenu.js +9 -9
  23. package/dist/components/UserInfoDropdown/UserInfoDropdown.js +1 -1
  24. package/dist/components/UserInfoDropdown/UserInfoDropdown.stories.js +1 -1
  25. package/dist/components/index.js +1 -1
  26. package/dist/context-dCWAMvX5.js +7320 -0
  27. package/dist/createSimplePaletteValueFilter-CwLqlaaZ.js +3457 -0
  28. package/dist/{createSvgIcon-CgFXfzFk.js → createSvgIcon-DNSRtm3a.js} +1 -1
  29. package/dist/index-B00P9-H3.js +1681 -0
  30. package/dist/main.js +1 -1
  31. package/dist/{useSlot-Baxtq84W.js → useSlot-B4sbbhYz.js} +2 -2
  32. package/package.json +28 -28
  33. package/dist/context-4ttylmIf.js +0 -7356
  34. package/dist/createSimplePaletteValueFilter-evt-Xthj.js +0 -3444
  35. package/dist/index-Dz00OoV7.js +0 -1687
@@ -0,0 +1,1681 @@
1
+ import { L as Nn, G as se, I as de, e as M, l as z, H as Pn, K as Ue, J as In, n as Mn, c as T, h as Pe, _ as he, q as ke, M as Ie, N as Tn, O as Me, j as Te, P as jn, Q as Rn, k as Bn, R as Dn, S as Xe, g as xe, m as Ke, u as S, y as Fn, B as Ln, a as ue, v as $e, D as Qe, t as ce, T as _n, F as zn, C as Ze, U as Hn, W as Wn, X as Vn, Y as Ye } from "./context-dCWAMvX5.js";
2
+ import * as r from "react";
3
+ import b, { useContext as ae, useRef as V, useMemo as An, useEffect as je } from "react";
4
+ import { B as Ee, c as Je, i as Gn, u as qn, C as Un, z as kn, a as Xn, b as Kn, w as Qn } from "./PurePanel-DvQTygSo.js";
5
+ import { _ as R } from "./objectWithoutPropertiesLoose-BTau6TOn.js";
6
+ import { R as Se, S as Zn } from "./Skeleton-Bh0A9xju.js";
7
+ const fe = (e, n) => {
8
+ const t = r.useContext(Nn), o = r.useMemo(() => {
9
+ var l;
10
+ const i = n || se[e], d = (l = t == null ? void 0 : t[e]) !== null && l !== void 0 ? l : {};
11
+ return Object.assign(Object.assign({}, typeof i == "function" ? i() : i), d || {});
12
+ }, [e, n, t]), a = r.useMemo(() => {
13
+ const l = t == null ? void 0 : t.locale;
14
+ return t != null && t.exist && !l ? se.locale : l;
15
+ }, [t]);
16
+ return [o, a];
17
+ };
18
+ var Yn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, name: "check-circle", theme: "filled" }, Jn = function(n, t) {
19
+ return /* @__PURE__ */ r.createElement(de, R({}, n, {
20
+ ref: t,
21
+ icon: Yn
22
+ }));
23
+ }, en = /* @__PURE__ */ r.forwardRef(Jn);
24
+ process.env.NODE_ENV !== "production" && (en.displayName = "CheckCircleFilled");
25
+ var et = { icon: { tag: "svg", attrs: { "fill-rule": "evenodd", viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" } }] }, name: "close-circle", theme: "filled" }, nt = function(n, t) {
26
+ return /* @__PURE__ */ r.createElement(de, R({}, n, {
27
+ ref: t,
28
+ icon: et
29
+ }));
30
+ }, nn = /* @__PURE__ */ r.forwardRef(nt);
31
+ process.env.NODE_ENV !== "production" && (nn.displayName = "CloseCircleFilled");
32
+ var tt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, name: "exclamation-circle", theme: "filled" }, ot = function(n, t) {
33
+ return /* @__PURE__ */ r.createElement(de, R({}, n, {
34
+ ref: t,
35
+ icon: tt
36
+ }));
37
+ }, tn = /* @__PURE__ */ r.forwardRef(ot);
38
+ process.env.NODE_ENV !== "production" && (tn.displayName = "ExclamationCircleFilled");
39
+ var at = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, name: "info-circle", theme: "filled" }, rt = function(n, t) {
40
+ return /* @__PURE__ */ r.createElement(de, R({}, n, {
41
+ ref: t,
42
+ icon: at
43
+ }));
44
+ }, on = /* @__PURE__ */ r.forwardRef(rt);
45
+ process.env.NODE_ENV !== "production" && (on.displayName = "InfoCircleFilled");
46
+ var lt = `accept acceptCharset accessKey action allowFullScreen allowTransparency
47
+ alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
48
+ charSet checked classID className colSpan cols content contentEditable contextMenu
49
+ controls coords crossOrigin data dateTime default defer dir disabled download draggable
50
+ encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
51
+ headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
52
+ is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
53
+ mediaGroup method min minLength multiple muted name noValidate nonce open
54
+ optimum pattern placeholder poster preload radioGroup readOnly rel required
55
+ reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
56
+ shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
57
+ summary tabIndex target title type useMap value width wmode wrap`, it = `onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
58
+ onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
59
+ onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
60
+ onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
61
+ onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
62
+ onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
63
+ onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`, st = "".concat(lt, " ").concat(it).split(/[\s\n]+/), ct = "aria-", dt = "data-";
64
+ function Re(e, n) {
65
+ return e.indexOf(n) === 0;
66
+ }
67
+ function Oe(e) {
68
+ var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, t;
69
+ n === !1 ? t = {
70
+ aria: !0,
71
+ data: !0,
72
+ attr: !0
73
+ } : n === !0 ? t = {
74
+ aria: !0
75
+ } : t = M({}, n);
76
+ var o = {};
77
+ return Object.keys(e).forEach(function(a) {
78
+ // Aria
79
+ (t.aria && (a === "role" || Re(a, ct)) || // Data
80
+ t.data && Re(a, dt) || // Attr
81
+ t.attr && st.includes(a)) && (o[a] = e[a]);
82
+ }), o;
83
+ }
84
+ function ut() {
85
+ const [e, n] = r.useState([]), t = r.useCallback((o) => (n((a) => [].concat(z(a), [o])), () => {
86
+ n((a) => a.filter((l) => l !== o));
87
+ }), []);
88
+ return [e, t];
89
+ }
90
+ const ft = new Ue("antFadeIn", {
91
+ "0%": {
92
+ opacity: 0
93
+ },
94
+ "100%": {
95
+ opacity: 1
96
+ }
97
+ }), mt = new Ue("antFadeOut", {
98
+ "0%": {
99
+ opacity: 1
100
+ },
101
+ "100%": {
102
+ opacity: 0
103
+ }
104
+ }), gt = (e, n = !1) => {
105
+ const {
106
+ antCls: t
107
+ } = e, o = `${t}-fade`, a = n ? "&" : "";
108
+ return [Pn(o, ft, mt, e.motionDurationMid, n), {
109
+ [`
110
+ ${a}${o}-enter,
111
+ ${a}${o}-appear
112
+ `]: {
113
+ opacity: 0,
114
+ animationTimingFunction: "linear"
115
+ },
116
+ [`${a}${o}-leave`]: {
117
+ animationTimingFunction: "linear"
118
+ }
119
+ }];
120
+ };
121
+ function pe(e) {
122
+ return !!(e != null && e.then);
123
+ }
124
+ const an = (e) => {
125
+ const {
126
+ type: n,
127
+ children: t,
128
+ prefixCls: o,
129
+ buttonProps: a,
130
+ close: l,
131
+ autoFocus: i,
132
+ emitEvent: d,
133
+ isSilent: c,
134
+ quitOnNullishReturnValue: f,
135
+ actionFn: s
136
+ } = e, u = r.useRef(!1), m = r.useRef(null), [C, p] = In(!1), v = (...g) => {
137
+ l == null || l.apply(void 0, g);
138
+ };
139
+ r.useEffect(() => {
140
+ let g = null;
141
+ return i && (g = setTimeout(() => {
142
+ var y;
143
+ (y = m.current) === null || y === void 0 || y.focus({
144
+ preventScroll: !0
145
+ });
146
+ })), () => {
147
+ g && clearTimeout(g);
148
+ };
149
+ }, []);
150
+ const x = (g) => {
151
+ pe(g) && (p(!0), g.then((...y) => {
152
+ p(!1, !0), v.apply(void 0, y), u.current = !1;
153
+ }, (y) => {
154
+ if (p(!1, !0), u.current = !1, !(c != null && c()))
155
+ return Promise.reject(y);
156
+ }));
157
+ }, h = (g) => {
158
+ if (u.current)
159
+ return;
160
+ if (u.current = !0, !s) {
161
+ v();
162
+ return;
163
+ }
164
+ let y;
165
+ if (d) {
166
+ if (y = s(g), f && !pe(y)) {
167
+ u.current = !1, v(g);
168
+ return;
169
+ }
170
+ } else if (s.length)
171
+ y = s(l), u.current = !1;
172
+ else if (y = s(), !pe(y)) {
173
+ v();
174
+ return;
175
+ }
176
+ x(y);
177
+ };
178
+ return /* @__PURE__ */ r.createElement(Ee, Object.assign({}, Je(n), {
179
+ onClick: h,
180
+ loading: C,
181
+ prefixCls: o
182
+ }, a, {
183
+ ref: m
184
+ }), t);
185
+ }, re = /* @__PURE__ */ b.createContext({}), {
186
+ Provider: rn
187
+ } = re, Be = () => {
188
+ const {
189
+ autoFocusButton: e,
190
+ cancelButtonProps: n,
191
+ cancelTextLocale: t,
192
+ isSilent: o,
193
+ mergedOkCancel: a,
194
+ rootPrefixCls: l,
195
+ close: i,
196
+ onCancel: d,
197
+ onConfirm: c
198
+ } = ae(re);
199
+ return a ? /* @__PURE__ */ b.createElement(an, {
200
+ isSilent: o,
201
+ actionFn: d,
202
+ close: (...f) => {
203
+ i == null || i.apply(void 0, f), c == null || c(!1);
204
+ },
205
+ autoFocus: e === "cancel",
206
+ buttonProps: n,
207
+ prefixCls: `${l}-btn`
208
+ }, t) : null;
209
+ }, De = () => {
210
+ const {
211
+ autoFocusButton: e,
212
+ close: n,
213
+ isSilent: t,
214
+ okButtonProps: o,
215
+ rootPrefixCls: a,
216
+ okTextLocale: l,
217
+ okType: i,
218
+ onConfirm: d,
219
+ onOk: c
220
+ } = ae(re);
221
+ return /* @__PURE__ */ b.createElement(an, {
222
+ isSilent: t,
223
+ type: i || "primary",
224
+ actionFn: c,
225
+ close: (...f) => {
226
+ n == null || n.apply(void 0, f), d == null || d(!0);
227
+ },
228
+ autoFocus: e === "ok",
229
+ buttonProps: o,
230
+ prefixCls: `${a}-btn`
231
+ }, l);
232
+ };
233
+ var ln = /* @__PURE__ */ r.createContext({});
234
+ function Fe(e, n, t) {
235
+ var o = n;
236
+ return !o && t && (o = "".concat(e, "-").concat(t)), o;
237
+ }
238
+ function Le(e, n) {
239
+ var t = e["page".concat(n ? "Y" : "X", "Offset")], o = "scroll".concat(n ? "Top" : "Left");
240
+ if (typeof t != "number") {
241
+ var a = e.document;
242
+ t = a.documentElement[o], typeof t != "number" && (t = a.body[o]);
243
+ }
244
+ return t;
245
+ }
246
+ function vt(e) {
247
+ var n = e.getBoundingClientRect(), t = {
248
+ left: n.left,
249
+ top: n.top
250
+ }, o = e.ownerDocument, a = o.defaultView || o.parentWindow;
251
+ return t.left += Le(a), t.top += Le(a, !0), t;
252
+ }
253
+ const Ct = /* @__PURE__ */ r.memo(function(e) {
254
+ var n = e.children;
255
+ return n;
256
+ }, function(e, n) {
257
+ var t = n.shouldUpdate;
258
+ return !t;
259
+ });
260
+ var pt = {
261
+ width: 0,
262
+ height: 0,
263
+ overflow: "hidden",
264
+ outline: "none"
265
+ }, bt = {
266
+ outline: "none"
267
+ }, we = /* @__PURE__ */ b.forwardRef(function(e, n) {
268
+ var t = e.prefixCls, o = e.className, a = e.style, l = e.title, i = e.ariaId, d = e.footer, c = e.closable, f = e.closeIcon, s = e.onClose, u = e.children, m = e.bodyStyle, C = e.bodyProps, p = e.modalRender, v = e.onMouseDown, x = e.onMouseUp, h = e.holderRef, g = e.visible, y = e.forceRender, O = e.width, N = e.height, $ = e.classNames, P = e.styles, ne = b.useContext(ln), K = ne.panel, Q = Mn(h, K), H = V(), w = V();
269
+ b.useImperativeHandle(n, function() {
270
+ return {
271
+ focus: function() {
272
+ var B;
273
+ (B = H.current) === null || B === void 0 || B.focus({
274
+ preventScroll: !0
275
+ });
276
+ },
277
+ changeActive: function(B) {
278
+ var Y = document, U = Y.activeElement;
279
+ B && U === w.current ? H.current.focus({
280
+ preventScroll: !0
281
+ }) : !B && U === H.current && w.current.focus({
282
+ preventScroll: !0
283
+ });
284
+ }
285
+ };
286
+ });
287
+ var W = {};
288
+ O !== void 0 && (W.width = O), N !== void 0 && (W.height = N);
289
+ var F = d ? /* @__PURE__ */ b.createElement("div", {
290
+ className: T("".concat(t, "-footer"), $ == null ? void 0 : $.footer),
291
+ style: M({}, P == null ? void 0 : P.footer)
292
+ }, d) : null, I = l ? /* @__PURE__ */ b.createElement("div", {
293
+ className: T("".concat(t, "-header"), $ == null ? void 0 : $.header),
294
+ style: M({}, P == null ? void 0 : P.header)
295
+ }, /* @__PURE__ */ b.createElement("div", {
296
+ className: "".concat(t, "-title"),
297
+ id: i
298
+ }, l)) : null, L = An(function() {
299
+ return Pe(c) === "object" && c !== null ? c : c ? {
300
+ closeIcon: f ?? /* @__PURE__ */ b.createElement("span", {
301
+ className: "".concat(t, "-close-x")
302
+ })
303
+ } : {};
304
+ }, [c, f, t]), _ = Oe(L, !0), A = Pe(c) === "object" && c.disabled, Z = c ? /* @__PURE__ */ b.createElement("button", R({
305
+ type: "button",
306
+ onClick: s,
307
+ "aria-label": "Close"
308
+ }, _, {
309
+ className: "".concat(t, "-close"),
310
+ disabled: A
311
+ }), L.closeIcon) : null, G = /* @__PURE__ */ b.createElement("div", {
312
+ className: T("".concat(t, "-content"), $ == null ? void 0 : $.content),
313
+ style: P == null ? void 0 : P.content
314
+ }, Z, I, /* @__PURE__ */ b.createElement("div", R({
315
+ className: T("".concat(t, "-body"), $ == null ? void 0 : $.body),
316
+ style: M(M({}, m), P == null ? void 0 : P.body)
317
+ }, C), u), F);
318
+ return /* @__PURE__ */ b.createElement("div", {
319
+ key: "dialog-element",
320
+ role: "dialog",
321
+ "aria-labelledby": l ? i : null,
322
+ "aria-modal": "true",
323
+ ref: Q,
324
+ style: M(M({}, a), W),
325
+ className: T(t, o),
326
+ onMouseDown: v,
327
+ onMouseUp: x
328
+ }, /* @__PURE__ */ b.createElement("div", {
329
+ ref: H,
330
+ tabIndex: 0,
331
+ style: bt
332
+ }, /* @__PURE__ */ b.createElement(Ct, {
333
+ shouldUpdate: g || y
334
+ }, p ? p(G) : G)), /* @__PURE__ */ b.createElement("div", {
335
+ tabIndex: 0,
336
+ ref: w,
337
+ style: pt
338
+ }));
339
+ });
340
+ process.env.NODE_ENV !== "production" && (we.displayName = "Panel");
341
+ var sn = /* @__PURE__ */ r.forwardRef(function(e, n) {
342
+ var t = e.prefixCls, o = e.title, a = e.style, l = e.className, i = e.visible, d = e.forceRender, c = e.destroyOnClose, f = e.motionName, s = e.ariaId, u = e.onVisibleChanged, m = e.mousePosition, C = V(), p = r.useState(), v = he(p, 2), x = v[0], h = v[1], g = {};
343
+ x && (g.transformOrigin = x);
344
+ function y() {
345
+ var O = vt(C.current);
346
+ h(m && (m.x || m.y) ? "".concat(m.x - O.left, "px ").concat(m.y - O.top, "px") : "");
347
+ }
348
+ return /* @__PURE__ */ r.createElement(ke, {
349
+ visible: i,
350
+ onVisibleChanged: u,
351
+ onAppearPrepare: y,
352
+ onEnterPrepare: y,
353
+ forceRender: d,
354
+ motionName: f,
355
+ removeOnLeave: c,
356
+ ref: C
357
+ }, function(O, N) {
358
+ var $ = O.className, P = O.style;
359
+ return /* @__PURE__ */ r.createElement(we, R({}, e, {
360
+ ref: n,
361
+ title: o,
362
+ ariaId: s,
363
+ prefixCls: t,
364
+ holderRef: N,
365
+ style: M(M(M({}, P), a), g),
366
+ className: T(l, $)
367
+ }));
368
+ });
369
+ });
370
+ sn.displayName = "Content";
371
+ var yt = function(n) {
372
+ var t = n.prefixCls, o = n.style, a = n.visible, l = n.maskProps, i = n.motionName, d = n.className;
373
+ return /* @__PURE__ */ r.createElement(ke, {
374
+ key: "mask",
375
+ visible: a,
376
+ motionName: i,
377
+ leavedClassName: "".concat(t, "-mask-hidden")
378
+ }, function(c, f) {
379
+ var s = c.className, u = c.style;
380
+ return /* @__PURE__ */ r.createElement("div", R({
381
+ ref: f,
382
+ style: M(M({}, u), o),
383
+ className: T("".concat(t, "-mask"), s, d)
384
+ }, l));
385
+ });
386
+ }, ht = function(n) {
387
+ var t = n.prefixCls, o = t === void 0 ? "rc-dialog" : t, a = n.zIndex, l = n.visible, i = l === void 0 ? !1 : l, d = n.keyboard, c = d === void 0 ? !0 : d, f = n.focusTriggerAfterClose, s = f === void 0 ? !0 : f, u = n.wrapStyle, m = n.wrapClassName, C = n.wrapProps, p = n.onClose, v = n.afterOpenChange, x = n.afterClose, h = n.transitionName, g = n.animation, y = n.closable, O = y === void 0 ? !0 : y, N = n.mask, $ = N === void 0 ? !0 : N, P = n.maskTransitionName, ne = n.maskAnimation, K = n.maskClosable, Q = K === void 0 ? !0 : K, H = n.maskStyle, w = n.maskProps, W = n.rootClassName, F = n.classNames, I = n.styles;
388
+ process.env.NODE_ENV !== "production" && (["wrapStyle", "bodyStyle", "maskStyle"].forEach(function(E) {
389
+ Ie(!(E in n), "".concat(E, " is deprecated, please use styles instead."));
390
+ }), "wrapClassName" in n && Ie(!1, "wrapClassName is deprecated, please use classNames instead."));
391
+ var L = V(), _ = V(), A = V(), Z = r.useState(i), G = he(Z, 2), q = G[0], B = G[1], Y = Tn();
392
+ function U() {
393
+ Me(_.current, document.activeElement) || (L.current = document.activeElement);
394
+ }
395
+ function me() {
396
+ if (!Me(_.current, document.activeElement)) {
397
+ var E;
398
+ (E = A.current) === null || E === void 0 || E.focus();
399
+ }
400
+ }
401
+ function ge(E) {
402
+ if (E)
403
+ me();
404
+ else {
405
+ if (B(!1), $ && L.current && s) {
406
+ try {
407
+ L.current.focus({
408
+ preventScroll: !0
409
+ });
410
+ } catch {
411
+ }
412
+ L.current = null;
413
+ }
414
+ q && (x == null || x());
415
+ }
416
+ v == null || v(E);
417
+ }
418
+ function te(E) {
419
+ p == null || p(E);
420
+ }
421
+ var J = V(!1), oe = V(), ve = function() {
422
+ clearTimeout(oe.current), J.current = !0;
423
+ }, ee = function() {
424
+ oe.current = setTimeout(function() {
425
+ J.current = !1;
426
+ });
427
+ }, ie = null;
428
+ Q && (ie = function(Ce) {
429
+ J.current ? J.current = !1 : _.current === Ce.target && te(Ce);
430
+ });
431
+ function j(E) {
432
+ if (c && E.keyCode === Te.ESC) {
433
+ E.stopPropagation(), te(E);
434
+ return;
435
+ }
436
+ i && E.keyCode === Te.TAB && A.current.changeActive(!E.shiftKey);
437
+ }
438
+ je(function() {
439
+ i && (B(!0), U());
440
+ }, [i]), je(function() {
441
+ return function() {
442
+ clearTimeout(oe.current);
443
+ };
444
+ }, []);
445
+ var k = M(M(M({
446
+ zIndex: a
447
+ }, u), I == null ? void 0 : I.wrapper), {}, {
448
+ display: q ? null : "none"
449
+ });
450
+ return /* @__PURE__ */ r.createElement("div", R({
451
+ className: T("".concat(o, "-root"), W)
452
+ }, Oe(n, {
453
+ data: !0
454
+ })), /* @__PURE__ */ r.createElement(yt, {
455
+ prefixCls: o,
456
+ visible: $ && i,
457
+ motionName: Fe(o, P, ne),
458
+ style: M(M({
459
+ zIndex: a
460
+ }, H), I == null ? void 0 : I.mask),
461
+ maskProps: w,
462
+ className: F == null ? void 0 : F.mask
463
+ }), /* @__PURE__ */ r.createElement("div", R({
464
+ tabIndex: -1,
465
+ onKeyDown: j,
466
+ className: T("".concat(o, "-wrap"), m, F == null ? void 0 : F.wrapper),
467
+ ref: _,
468
+ onClick: ie,
469
+ style: k
470
+ }, C), /* @__PURE__ */ r.createElement(sn, R({}, n, {
471
+ onMouseDown: ve,
472
+ onMouseUp: ee,
473
+ ref: A,
474
+ closable: O,
475
+ ariaId: Y,
476
+ prefixCls: o,
477
+ visible: i && q,
478
+ onClose: te,
479
+ onVisibleChanged: ge,
480
+ motionName: Fe(o, h, g)
481
+ }))));
482
+ }, cn = function(n) {
483
+ var t = n.visible, o = n.getContainer, a = n.forceRender, l = n.destroyOnClose, i = l === void 0 ? !1 : l, d = n.afterClose, c = n.panelRef, f = r.useState(t), s = he(f, 2), u = s[0], m = s[1], C = r.useMemo(function() {
484
+ return {
485
+ panel: c
486
+ };
487
+ }, [c]);
488
+ return r.useEffect(function() {
489
+ t && m(!0);
490
+ }, [t]), !a && i && !u ? null : /* @__PURE__ */ r.createElement(ln.Provider, {
491
+ value: C
492
+ }, /* @__PURE__ */ r.createElement(jn, {
493
+ open: t || a || u,
494
+ autoDestroy: !1,
495
+ getContainer: o,
496
+ autoLock: t || u
497
+ }, /* @__PURE__ */ r.createElement(ht, R({}, n, {
498
+ destroyOnClose: i,
499
+ afterClose: function() {
500
+ d == null || d(), m(!1);
501
+ }
502
+ }))));
503
+ };
504
+ cn.displayName = "Dialog";
505
+ function _e(...e) {
506
+ const n = {};
507
+ return e.forEach((t) => {
508
+ t && Object.keys(t).forEach((o) => {
509
+ t[o] !== void 0 && (n[o] = t[o]);
510
+ });
511
+ }), n;
512
+ }
513
+ function ze(e) {
514
+ if (e)
515
+ return {
516
+ closable: e.closable,
517
+ closeIcon: e.closeIcon
518
+ };
519
+ }
520
+ function He(e) {
521
+ const {
522
+ closable: n,
523
+ closeIcon: t
524
+ } = e || {};
525
+ return b.useMemo(() => {
526
+ if (
527
+ // If `closable`, whatever rest be should be true
528
+ !n && (n === !1 || t === !1 || t === null)
529
+ )
530
+ return !1;
531
+ if (n === void 0 && t === void 0)
532
+ return null;
533
+ let o = {
534
+ closeIcon: typeof t != "boolean" && t !== null ? t : void 0
535
+ };
536
+ return n && typeof n == "object" && (o = Object.assign(Object.assign({}, o), n)), o;
537
+ }, [n, t]);
538
+ }
539
+ const xt = {};
540
+ function $t(e, n, t = xt) {
541
+ const o = He(e), a = He(n), [l] = fe("global", se.global), i = typeof o != "boolean" ? !!(o != null && o.disabled) : !1, d = b.useMemo(() => Object.assign({
542
+ closeIcon: /* @__PURE__ */ b.createElement(Se, null)
543
+ }, t), [t]), c = b.useMemo(() => o === !1 ? !1 : o ? _e(d, a, o) : a === !1 ? !1 : a ? _e(d, a) : d.closable ? d : !1, [o, a, d]);
544
+ return b.useMemo(() => {
545
+ if (c === !1)
546
+ return [!1, null, i, {}];
547
+ const {
548
+ closeIconRender: f
549
+ } = d, {
550
+ closeIcon: s
551
+ } = c;
552
+ let u = s;
553
+ const m = Oe(c, !0);
554
+ return u != null && (f && (u = f(s)), u = /* @__PURE__ */ b.isValidElement(u) ? /* @__PURE__ */ b.cloneElement(u, Object.assign({
555
+ "aria-label": l.close
556
+ }, m)) : /* @__PURE__ */ b.createElement("span", Object.assign({
557
+ "aria-label": l.close
558
+ }, m), u)), [!0, u, i, m];
559
+ }, [c, d]);
560
+ }
561
+ const Et = () => Rn() && window.document.documentElement;
562
+ function We() {
563
+ }
564
+ const St = /* @__PURE__ */ r.createContext({
565
+ add: We,
566
+ remove: We
567
+ });
568
+ function Ot(e) {
569
+ const n = r.useContext(St), t = r.useRef(null);
570
+ return Bn((a) => {
571
+ if (a) {
572
+ const l = e ? a.querySelector(e) : a;
573
+ n.add(l), t.current = l;
574
+ } else
575
+ n.remove(t.current);
576
+ });
577
+ }
578
+ const Ve = () => {
579
+ const {
580
+ cancelButtonProps: e,
581
+ cancelTextLocale: n,
582
+ onCancel: t
583
+ } = ae(re);
584
+ return /* @__PURE__ */ b.createElement(Ee, Object.assign({
585
+ onClick: t
586
+ }, e), n);
587
+ }, Ae = () => {
588
+ const {
589
+ confirmLoading: e,
590
+ okButtonProps: n,
591
+ okType: t,
592
+ okTextLocale: o,
593
+ onOk: a
594
+ } = ae(re);
595
+ return /* @__PURE__ */ b.createElement(Ee, Object.assign({}, Je(t), {
596
+ loading: e,
597
+ onClick: a
598
+ }, n), o);
599
+ };
600
+ function dn(e, n) {
601
+ return /* @__PURE__ */ b.createElement("span", {
602
+ className: `${e}-close-x`
603
+ }, n || /* @__PURE__ */ b.createElement(Se, {
604
+ className: `${e}-close-icon`
605
+ }));
606
+ }
607
+ const un = (e) => {
608
+ const {
609
+ okText: n,
610
+ okType: t = "primary",
611
+ cancelText: o,
612
+ confirmLoading: a,
613
+ onOk: l,
614
+ onCancel: i,
615
+ okButtonProps: d,
616
+ cancelButtonProps: c,
617
+ footer: f
618
+ } = e, [s] = fe("Modal", Xe()), u = n || (s == null ? void 0 : s.okText), m = o || (s == null ? void 0 : s.cancelText), C = {
619
+ confirmLoading: a,
620
+ okButtonProps: d,
621
+ cancelButtonProps: c,
622
+ okTextLocale: u,
623
+ cancelTextLocale: m,
624
+ okType: t,
625
+ onOk: l,
626
+ onCancel: i
627
+ }, p = b.useMemo(() => C, z(Object.values(C)));
628
+ let v;
629
+ return typeof f == "function" || typeof f > "u" ? (v = /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.createElement(Ve, null), /* @__PURE__ */ b.createElement(Ae, null)), typeof f == "function" && (v = f(v, {
630
+ OkBtn: Ae,
631
+ CancelBtn: Ve
632
+ })), v = /* @__PURE__ */ b.createElement(rn, {
633
+ value: p
634
+ }, v)) : v = f, /* @__PURE__ */ b.createElement(Dn, {
635
+ disabled: !1
636
+ }, v);
637
+ }, wt = (e) => {
638
+ const {
639
+ componentCls: n
640
+ } = e;
641
+ return {
642
+ // Grid system
643
+ [n]: {
644
+ display: "flex",
645
+ flexFlow: "row wrap",
646
+ minWidth: 0,
647
+ "&::before, &::after": {
648
+ display: "flex"
649
+ },
650
+ "&-no-wrap": {
651
+ flexWrap: "nowrap"
652
+ },
653
+ // The origin of the X-axis
654
+ "&-start": {
655
+ justifyContent: "flex-start"
656
+ },
657
+ // The center of the X-axis
658
+ "&-center": {
659
+ justifyContent: "center"
660
+ },
661
+ // The opposite of the X-axis
662
+ "&-end": {
663
+ justifyContent: "flex-end"
664
+ },
665
+ "&-space-between": {
666
+ justifyContent: "space-between"
667
+ },
668
+ "&-space-around": {
669
+ justifyContent: "space-around"
670
+ },
671
+ "&-space-evenly": {
672
+ justifyContent: "space-evenly"
673
+ },
674
+ // Align at the top
675
+ "&-top": {
676
+ alignItems: "flex-start"
677
+ },
678
+ // Align at the center
679
+ "&-middle": {
680
+ alignItems: "center"
681
+ },
682
+ "&-bottom": {
683
+ alignItems: "flex-end"
684
+ }
685
+ }
686
+ };
687
+ }, Nt = (e) => {
688
+ const {
689
+ componentCls: n
690
+ } = e;
691
+ return {
692
+ // Grid system
693
+ [n]: {
694
+ position: "relative",
695
+ maxWidth: "100%",
696
+ // Prevent columns from collapsing when empty
697
+ minHeight: 1
698
+ }
699
+ };
700
+ }, Pt = (e, n) => {
701
+ const {
702
+ prefixCls: t,
703
+ componentCls: o,
704
+ gridColumns: a
705
+ } = e, l = {};
706
+ for (let i = a; i >= 0; i--)
707
+ i === 0 ? (l[`${o}${n}-${i}`] = {
708
+ display: "none"
709
+ }, l[`${o}-push-${i}`] = {
710
+ insetInlineStart: "auto"
711
+ }, l[`${o}-pull-${i}`] = {
712
+ insetInlineEnd: "auto"
713
+ }, l[`${o}${n}-push-${i}`] = {
714
+ insetInlineStart: "auto"
715
+ }, l[`${o}${n}-pull-${i}`] = {
716
+ insetInlineEnd: "auto"
717
+ }, l[`${o}${n}-offset-${i}`] = {
718
+ marginInlineStart: 0
719
+ }, l[`${o}${n}-order-${i}`] = {
720
+ order: 0
721
+ }) : (l[`${o}${n}-${i}`] = [
722
+ // https://github.com/ant-design/ant-design/issues/44456
723
+ // Form set `display: flex` on Col which will override `display: block`.
724
+ // Let's get it from css variable to support override.
725
+ {
726
+ "--ant-display": "block",
727
+ // Fallback to display if variable not support
728
+ display: "block"
729
+ },
730
+ {
731
+ display: "var(--ant-display)",
732
+ flex: `0 0 ${i / a * 100}%`,
733
+ maxWidth: `${i / a * 100}%`
734
+ }
735
+ ], l[`${o}${n}-push-${i}`] = {
736
+ insetInlineStart: `${i / a * 100}%`
737
+ }, l[`${o}${n}-pull-${i}`] = {
738
+ insetInlineEnd: `${i / a * 100}%`
739
+ }, l[`${o}${n}-offset-${i}`] = {
740
+ marginInlineStart: `${i / a * 100}%`
741
+ }, l[`${o}${n}-order-${i}`] = {
742
+ order: i
743
+ });
744
+ return l[`${o}${n}-flex`] = {
745
+ flex: `var(--${t}${n}-flex)`
746
+ }, l;
747
+ }, be = (e, n) => Pt(e, n), It = (e, n, t) => ({
748
+ [`@media (min-width: ${S(n)})`]: Object.assign({}, be(e, t))
749
+ }), Mt = () => ({}), Tt = () => ({});
750
+ xe("Grid", wt, Mt);
751
+ const fn = (e) => ({
752
+ xs: e.screenXSMin,
753
+ sm: e.screenSMMin,
754
+ md: e.screenMDMin,
755
+ lg: e.screenLGMin,
756
+ xl: e.screenXLMin,
757
+ xxl: e.screenXXLMin
758
+ });
759
+ xe("Grid", (e) => {
760
+ const n = Ke(e, {
761
+ gridColumns: 24
762
+ // Row is divided into 24 parts in Grid
763
+ }), t = fn(n);
764
+ return delete t.xs, [Nt(n), be(n, ""), be(n, "-xs"), Object.keys(t).map((o) => It(n, t[o], `-${o}`)).reduce((o, a) => Object.assign(Object.assign({}, o), a), {})];
765
+ }, Tt);
766
+ function Ge(e) {
767
+ return {
768
+ position: e,
769
+ inset: 0
770
+ };
771
+ }
772
+ const jt = (e) => {
773
+ const {
774
+ componentCls: n,
775
+ antCls: t
776
+ } = e;
777
+ return [{
778
+ [`${n}-root`]: {
779
+ [`${n}${t}-zoom-enter, ${n}${t}-zoom-appear`]: {
780
+ // reset scale avoid mousePosition bug
781
+ transform: "none",
782
+ opacity: 0,
783
+ animationDuration: e.motionDurationSlow,
784
+ // https://github.com/ant-design/ant-design/issues/11777
785
+ userSelect: "none"
786
+ },
787
+ // https://github.com/ant-design/ant-design/issues/37329
788
+ // https://github.com/ant-design/ant-design/issues/40272
789
+ [`${n}${t}-zoom-leave ${n}-content`]: {
790
+ pointerEvents: "none"
791
+ },
792
+ [`${n}-mask`]: Object.assign(Object.assign({}, Ge("fixed")), {
793
+ zIndex: e.zIndexPopupBase,
794
+ height: "100%",
795
+ backgroundColor: e.colorBgMask,
796
+ pointerEvents: "none",
797
+ [`${n}-hidden`]: {
798
+ display: "none"
799
+ }
800
+ }),
801
+ [`${n}-wrap`]: Object.assign(Object.assign({}, Ge("fixed")), {
802
+ zIndex: e.zIndexPopupBase,
803
+ overflow: "auto",
804
+ outline: 0,
805
+ WebkitOverflowScrolling: "touch"
806
+ })
807
+ }
808
+ }, {
809
+ [`${n}-root`]: gt(e)
810
+ }];
811
+ }, Rt = (e) => {
812
+ const {
813
+ componentCls: n
814
+ } = e;
815
+ return [
816
+ // ======================== Root =========================
817
+ {
818
+ [`${n}-root`]: {
819
+ [`${n}-wrap-rtl`]: {
820
+ direction: "rtl"
821
+ },
822
+ [`${n}-centered`]: {
823
+ textAlign: "center",
824
+ "&::before": {
825
+ display: "inline-block",
826
+ width: 0,
827
+ height: "100%",
828
+ verticalAlign: "middle",
829
+ content: '""'
830
+ },
831
+ [n]: {
832
+ top: 0,
833
+ display: "inline-block",
834
+ paddingBottom: 0,
835
+ textAlign: "start",
836
+ verticalAlign: "middle"
837
+ }
838
+ },
839
+ [`@media (max-width: ${e.screenSMMax}px)`]: {
840
+ [n]: {
841
+ maxWidth: "calc(100vw - 16px)",
842
+ margin: `${S(e.marginXS)} auto`
843
+ },
844
+ [`${n}-centered`]: {
845
+ [n]: {
846
+ flex: 1
847
+ }
848
+ }
849
+ }
850
+ }
851
+ },
852
+ // ======================== Modal ========================
853
+ {
854
+ [n]: Object.assign(Object.assign({}, Fn(e)), {
855
+ pointerEvents: "none",
856
+ position: "relative",
857
+ top: 100,
858
+ width: "auto",
859
+ maxWidth: `calc(100vw - ${S(e.calc(e.margin).mul(2).equal())})`,
860
+ margin: "0 auto",
861
+ paddingBottom: e.paddingLG,
862
+ [`${n}-title`]: {
863
+ margin: 0,
864
+ color: e.titleColor,
865
+ fontWeight: e.fontWeightStrong,
866
+ fontSize: e.titleFontSize,
867
+ lineHeight: e.titleLineHeight,
868
+ wordWrap: "break-word"
869
+ },
870
+ [`${n}-content`]: {
871
+ position: "relative",
872
+ backgroundColor: e.contentBg,
873
+ backgroundClip: "padding-box",
874
+ border: 0,
875
+ borderRadius: e.borderRadiusLG,
876
+ boxShadow: e.boxShadow,
877
+ pointerEvents: "auto",
878
+ padding: e.contentPadding
879
+ },
880
+ [`${n}-close`]: Object.assign({
881
+ position: "absolute",
882
+ top: e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),
883
+ insetInlineEnd: e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),
884
+ zIndex: e.calc(e.zIndexPopupBase).add(10).equal(),
885
+ padding: 0,
886
+ color: e.modalCloseIconColor,
887
+ fontWeight: e.fontWeightStrong,
888
+ lineHeight: 1,
889
+ textDecoration: "none",
890
+ background: "transparent",
891
+ borderRadius: e.borderRadiusSM,
892
+ width: e.modalCloseBtnSize,
893
+ height: e.modalCloseBtnSize,
894
+ border: 0,
895
+ outline: 0,
896
+ cursor: "pointer",
897
+ transition: `color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,
898
+ "&-x": {
899
+ display: "flex",
900
+ fontSize: e.fontSizeLG,
901
+ fontStyle: "normal",
902
+ lineHeight: S(e.modalCloseBtnSize),
903
+ justifyContent: "center",
904
+ textTransform: "none",
905
+ textRendering: "auto"
906
+ },
907
+ "&:disabled": {
908
+ pointerEvents: "none"
909
+ },
910
+ "&:hover": {
911
+ color: e.modalCloseIconHoverColor,
912
+ backgroundColor: e.colorBgTextHover,
913
+ textDecoration: "none"
914
+ },
915
+ "&:active": {
916
+ backgroundColor: e.colorBgTextActive
917
+ }
918
+ }, Ln(e)),
919
+ [`${n}-header`]: {
920
+ color: e.colorText,
921
+ background: e.headerBg,
922
+ borderRadius: `${S(e.borderRadiusLG)} ${S(e.borderRadiusLG)} 0 0`,
923
+ marginBottom: e.headerMarginBottom,
924
+ padding: e.headerPadding,
925
+ borderBottom: e.headerBorderBottom
926
+ },
927
+ [`${n}-body`]: {
928
+ fontSize: e.fontSize,
929
+ lineHeight: e.lineHeight,
930
+ wordWrap: "break-word",
931
+ padding: e.bodyPadding,
932
+ [`${n}-body-skeleton`]: {
933
+ width: "100%",
934
+ height: "100%",
935
+ display: "flex",
936
+ justifyContent: "center",
937
+ alignItems: "center",
938
+ margin: `${S(e.margin)} auto`
939
+ }
940
+ },
941
+ [`${n}-footer`]: {
942
+ textAlign: "end",
943
+ background: e.footerBg,
944
+ marginTop: e.footerMarginTop,
945
+ padding: e.footerPadding,
946
+ borderTop: e.footerBorderTop,
947
+ borderRadius: e.footerBorderRadius,
948
+ [`> ${e.antCls}-btn + ${e.antCls}-btn`]: {
949
+ marginInlineStart: e.marginXS
950
+ }
951
+ },
952
+ [`${n}-open`]: {
953
+ overflow: "hidden"
954
+ }
955
+ })
956
+ },
957
+ // ======================== Pure =========================
958
+ {
959
+ [`${n}-pure-panel`]: {
960
+ top: "auto",
961
+ padding: 0,
962
+ display: "flex",
963
+ flexDirection: "column",
964
+ [`${n}-content,
965
+ ${n}-body,
966
+ ${n}-confirm-body-wrapper`]: {
967
+ display: "flex",
968
+ flexDirection: "column",
969
+ flex: "auto"
970
+ },
971
+ [`${n}-confirm-body`]: {
972
+ marginBottom: "auto"
973
+ }
974
+ }
975
+ }
976
+ ];
977
+ }, Bt = (e) => {
978
+ const {
979
+ componentCls: n
980
+ } = e;
981
+ return {
982
+ [`${n}-root`]: {
983
+ [`${n}-wrap-rtl`]: {
984
+ direction: "rtl",
985
+ [`${n}-confirm-body`]: {
986
+ direction: "rtl"
987
+ }
988
+ }
989
+ }
990
+ };
991
+ }, Dt = (e) => {
992
+ const {
993
+ componentCls: n
994
+ } = e, t = fn(e);
995
+ delete t.xs;
996
+ const o = Object.keys(t).map((a) => ({
997
+ [`@media (min-width: ${S(t[a])})`]: {
998
+ width: `var(--${n.replace(".", "")}-${a}-width)`
999
+ }
1000
+ }));
1001
+ return {
1002
+ [`${n}-root`]: {
1003
+ [n]: [{
1004
+ width: `var(--${n.replace(".", "")}-xs-width)`
1005
+ }].concat(z(o))
1006
+ }
1007
+ };
1008
+ }, mn = (e) => {
1009
+ const n = e.padding, t = e.fontSizeHeading5, o = e.lineHeightHeading5;
1010
+ return Ke(e, {
1011
+ modalHeaderHeight: e.calc(e.calc(o).mul(t).equal()).add(e.calc(n).mul(2).equal()).equal(),
1012
+ modalFooterBorderColorSplit: e.colorSplit,
1013
+ modalFooterBorderStyle: e.lineType,
1014
+ modalFooterBorderWidth: e.lineWidth,
1015
+ modalCloseIconColor: e.colorIcon,
1016
+ modalCloseIconHoverColor: e.colorIconHover,
1017
+ modalCloseBtnSize: e.controlHeight,
1018
+ modalConfirmIconSize: e.fontHeight,
1019
+ modalTitleHeight: e.calc(e.titleFontSize).mul(e.titleLineHeight).equal()
1020
+ });
1021
+ }, gn = (e) => ({
1022
+ footerBg: "transparent",
1023
+ headerBg: e.colorBgElevated,
1024
+ titleLineHeight: e.lineHeightHeading5,
1025
+ titleFontSize: e.fontSizeHeading5,
1026
+ contentBg: e.colorBgElevated,
1027
+ titleColor: e.colorTextHeading,
1028
+ // internal
1029
+ contentPadding: e.wireframe ? 0 : `${S(e.paddingMD)} ${S(e.paddingContentHorizontalLG)}`,
1030
+ headerPadding: e.wireframe ? `${S(e.padding)} ${S(e.paddingLG)}` : 0,
1031
+ headerBorderBottom: e.wireframe ? `${S(e.lineWidth)} ${e.lineType} ${e.colorSplit}` : "none",
1032
+ headerMarginBottom: e.wireframe ? 0 : e.marginXS,
1033
+ bodyPadding: e.wireframe ? e.paddingLG : 0,
1034
+ footerPadding: e.wireframe ? `${S(e.paddingXS)} ${S(e.padding)}` : 0,
1035
+ footerBorderTop: e.wireframe ? `${S(e.lineWidth)} ${e.lineType} ${e.colorSplit}` : "none",
1036
+ footerBorderRadius: e.wireframe ? `0 0 ${S(e.borderRadiusLG)} ${S(e.borderRadiusLG)}` : 0,
1037
+ footerMarginTop: e.wireframe ? 0 : e.marginSM,
1038
+ confirmBodyPadding: e.wireframe ? `${S(e.padding * 2)} ${S(e.padding * 2)} ${S(e.paddingLG)}` : 0,
1039
+ confirmIconMarginInlineEnd: e.wireframe ? e.margin : e.marginSM,
1040
+ confirmBtnsMarginTop: e.wireframe ? e.marginLG : e.marginSM
1041
+ }), vn = xe("Modal", (e) => {
1042
+ const n = mn(e);
1043
+ return [Rt(n), Bt(n), jt(n), Gn(n, "zoom"), Dt(n)];
1044
+ }, gn, {
1045
+ unitless: {
1046
+ titleLineHeight: !0
1047
+ }
1048
+ });
1049
+ var Ft = function(e, n) {
1050
+ var t = {};
1051
+ for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
1052
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
1053
+ n.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
1054
+ return t;
1055
+ };
1056
+ let ye;
1057
+ const Lt = (e) => {
1058
+ ye = {
1059
+ x: e.pageX,
1060
+ y: e.pageY
1061
+ }, setTimeout(() => {
1062
+ ye = null;
1063
+ }, 100);
1064
+ };
1065
+ Et() && document.documentElement.addEventListener("click", Lt, !0);
1066
+ const Cn = (e) => {
1067
+ const {
1068
+ prefixCls: n,
1069
+ className: t,
1070
+ rootClassName: o,
1071
+ open: a,
1072
+ wrapClassName: l,
1073
+ centered: i,
1074
+ getContainer: d,
1075
+ focusTriggerAfterClose: c = !0,
1076
+ style: f,
1077
+ // Deprecated
1078
+ visible: s,
1079
+ width: u = 520,
1080
+ footer: m,
1081
+ classNames: C,
1082
+ styles: p,
1083
+ children: v,
1084
+ loading: x,
1085
+ confirmLoading: h,
1086
+ zIndex: g,
1087
+ mousePosition: y,
1088
+ onOk: O,
1089
+ onCancel: N,
1090
+ destroyOnHidden: $,
1091
+ destroyOnClose: P
1092
+ } = e, ne = Ft(e, ["prefixCls", "className", "rootClassName", "open", "wrapClassName", "centered", "getContainer", "focusTriggerAfterClose", "style", "visible", "width", "footer", "classNames", "styles", "children", "loading", "confirmLoading", "zIndex", "mousePosition", "onOk", "onCancel", "destroyOnHidden", "destroyOnClose"]), {
1093
+ getPopupContainer: K,
1094
+ getPrefixCls: Q,
1095
+ direction: H,
1096
+ modal: w
1097
+ } = r.useContext(ue), W = (j) => {
1098
+ h || N == null || N(j);
1099
+ }, F = (j) => {
1100
+ O == null || O(j);
1101
+ };
1102
+ if (process.env.NODE_ENV !== "production") {
1103
+ const j = $e("Modal");
1104
+ [["visible", "open"], ["bodyStyle", "styles.body"], ["maskStyle", "styles.mask"], ["destroyOnClose", "destroyOnHidden"]].forEach(([k, E]) => {
1105
+ j.deprecated(!(k in e), k, E);
1106
+ });
1107
+ }
1108
+ const I = Q("modal", n), L = Q(), _ = Qe(I), [A, Z, G] = vn(I, _), q = T(l, {
1109
+ [`${I}-centered`]: i ?? (w == null ? void 0 : w.centered),
1110
+ [`${I}-wrap-rtl`]: H === "rtl"
1111
+ }), B = m !== null && !x ? /* @__PURE__ */ r.createElement(un, Object.assign({}, e, {
1112
+ onOk: F,
1113
+ onCancel: W
1114
+ })) : null, [Y, U, me, ge] = $t(ze(e), ze(w), {
1115
+ closable: !0,
1116
+ closeIcon: /* @__PURE__ */ r.createElement(Se, {
1117
+ className: `${I}-close-icon`
1118
+ }),
1119
+ closeIconRender: (j) => dn(I, j)
1120
+ }), te = Ot(`.${I}-content`), [J, oe] = qn("Modal", g), [ve, ee] = r.useMemo(() => u && typeof u == "object" ? [void 0, u] : [u, void 0], [u]), ie = r.useMemo(() => {
1121
+ const j = {};
1122
+ return ee && Object.keys(ee).forEach((k) => {
1123
+ const E = ee[k];
1124
+ E !== void 0 && (j[`--${I}-${k}-width`] = typeof E == "number" ? `${E}px` : E);
1125
+ }), j;
1126
+ }, [ee]);
1127
+ return A(/* @__PURE__ */ r.createElement(Un, {
1128
+ form: !0,
1129
+ space: !0
1130
+ }, /* @__PURE__ */ r.createElement(kn.Provider, {
1131
+ value: oe
1132
+ }, /* @__PURE__ */ r.createElement(cn, Object.assign({
1133
+ width: ve
1134
+ }, ne, {
1135
+ zIndex: J,
1136
+ getContainer: d === void 0 ? K : d,
1137
+ prefixCls: I,
1138
+ rootClassName: T(Z, o, G, _),
1139
+ footer: B,
1140
+ visible: a ?? s,
1141
+ mousePosition: y ?? ye,
1142
+ onClose: W,
1143
+ closable: Y && Object.assign({
1144
+ disabled: me,
1145
+ closeIcon: U
1146
+ }, ge),
1147
+ closeIcon: U,
1148
+ focusTriggerAfterClose: c,
1149
+ transitionName: ce(L, "zoom", e.transitionName),
1150
+ maskTransitionName: ce(L, "fade", e.maskTransitionName),
1151
+ className: T(Z, t, w == null ? void 0 : w.className),
1152
+ style: Object.assign(Object.assign(Object.assign({}, w == null ? void 0 : w.style), f), ie),
1153
+ classNames: Object.assign(Object.assign(Object.assign({}, w == null ? void 0 : w.classNames), C), {
1154
+ wrapper: T(q, C == null ? void 0 : C.wrapper)
1155
+ }),
1156
+ styles: Object.assign(Object.assign({}, w == null ? void 0 : w.styles), p),
1157
+ panelRef: te,
1158
+ // TODO: In the future, destroyOnClose in rc-dialog needs to be upgrade to destroyOnHidden
1159
+ destroyOnClose: $ ?? P
1160
+ }), x ? /* @__PURE__ */ r.createElement(Zn, {
1161
+ active: !0,
1162
+ title: !1,
1163
+ paragraph: {
1164
+ rows: 4
1165
+ },
1166
+ className: `${I}-body-skeleton`
1167
+ }) : v))));
1168
+ }, _t = (e) => {
1169
+ const {
1170
+ componentCls: n,
1171
+ titleFontSize: t,
1172
+ titleLineHeight: o,
1173
+ modalConfirmIconSize: a,
1174
+ fontSize: l,
1175
+ lineHeight: i,
1176
+ modalTitleHeight: d,
1177
+ fontHeight: c,
1178
+ confirmBodyPadding: f
1179
+ } = e, s = `${n}-confirm`;
1180
+ return {
1181
+ [s]: {
1182
+ "&-rtl": {
1183
+ direction: "rtl"
1184
+ },
1185
+ [`${e.antCls}-modal-header`]: {
1186
+ display: "none"
1187
+ },
1188
+ [`${s}-body-wrapper`]: Object.assign({}, zn()),
1189
+ [`&${n} ${n}-body`]: {
1190
+ padding: f
1191
+ },
1192
+ // ====================== Body ======================
1193
+ [`${s}-body`]: {
1194
+ display: "flex",
1195
+ flexWrap: "nowrap",
1196
+ alignItems: "start",
1197
+ [`> ${e.iconCls}`]: {
1198
+ flex: "none",
1199
+ fontSize: a,
1200
+ marginInlineEnd: e.confirmIconMarginInlineEnd,
1201
+ marginTop: e.calc(e.calc(c).sub(a).equal()).div(2).equal()
1202
+ },
1203
+ [`&-has-title > ${e.iconCls}`]: {
1204
+ marginTop: e.calc(e.calc(d).sub(a).equal()).div(2).equal()
1205
+ }
1206
+ },
1207
+ [`${s}-paragraph`]: {
1208
+ display: "flex",
1209
+ flexDirection: "column",
1210
+ flex: "auto",
1211
+ rowGap: e.marginXS,
1212
+ // https://github.com/ant-design/ant-design/issues/51912
1213
+ maxWidth: `calc(100% - ${S(e.marginSM)})`
1214
+ },
1215
+ // https://github.com/ant-design/ant-design/issues/48159
1216
+ [`${e.iconCls} + ${s}-paragraph`]: {
1217
+ maxWidth: `calc(100% - ${S(e.calc(e.modalConfirmIconSize).add(e.marginSM).equal())})`
1218
+ },
1219
+ [`${s}-title`]: {
1220
+ color: e.colorTextHeading,
1221
+ fontWeight: e.fontWeightStrong,
1222
+ fontSize: t,
1223
+ lineHeight: o
1224
+ },
1225
+ [`${s}-content`]: {
1226
+ color: e.colorText,
1227
+ fontSize: l,
1228
+ lineHeight: i
1229
+ },
1230
+ // ===================== Footer =====================
1231
+ [`${s}-btns`]: {
1232
+ textAlign: "end",
1233
+ marginTop: e.confirmBtnsMarginTop,
1234
+ [`${e.antCls}-btn + ${e.antCls}-btn`]: {
1235
+ marginBottom: 0,
1236
+ marginInlineStart: e.marginXS
1237
+ }
1238
+ }
1239
+ },
1240
+ [`${s}-error ${s}-body > ${e.iconCls}`]: {
1241
+ color: e.colorError
1242
+ },
1243
+ [`${s}-warning ${s}-body > ${e.iconCls},
1244
+ ${s}-confirm ${s}-body > ${e.iconCls}`]: {
1245
+ color: e.colorWarning
1246
+ },
1247
+ [`${s}-info ${s}-body > ${e.iconCls}`]: {
1248
+ color: e.colorInfo
1249
+ },
1250
+ [`${s}-success ${s}-body > ${e.iconCls}`]: {
1251
+ color: e.colorSuccess
1252
+ }
1253
+ };
1254
+ }, zt = _n(["Modal", "confirm"], (e) => {
1255
+ const n = mn(e);
1256
+ return [_t(n)];
1257
+ }, gn, {
1258
+ // confirm is weak than modal since no conflict here
1259
+ order: -1e3
1260
+ });
1261
+ var Ht = function(e, n) {
1262
+ var t = {};
1263
+ for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
1264
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
1265
+ n.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
1266
+ return t;
1267
+ };
1268
+ function pn(e) {
1269
+ const {
1270
+ prefixCls: n,
1271
+ icon: t,
1272
+ okText: o,
1273
+ cancelText: a,
1274
+ confirmPrefixCls: l,
1275
+ type: i,
1276
+ okCancel: d,
1277
+ footer: c,
1278
+ // Legacy for static function usage
1279
+ locale: f
1280
+ } = e, s = Ht(e, ["prefixCls", "icon", "okText", "cancelText", "confirmPrefixCls", "type", "okCancel", "footer", "locale"]);
1281
+ if (process.env.NODE_ENV !== "production") {
1282
+ const P = $e("Modal");
1283
+ process.env.NODE_ENV !== "production" && P(!(typeof t == "string" && t.length > 2), "breaking", `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${t}\` at https://ant.design/components/icon`);
1284
+ }
1285
+ let u = t;
1286
+ if (!t && t !== null)
1287
+ switch (i) {
1288
+ case "info":
1289
+ u = /* @__PURE__ */ r.createElement(on, null);
1290
+ break;
1291
+ case "success":
1292
+ u = /* @__PURE__ */ r.createElement(en, null);
1293
+ break;
1294
+ case "error":
1295
+ u = /* @__PURE__ */ r.createElement(nn, null);
1296
+ break;
1297
+ default:
1298
+ u = /* @__PURE__ */ r.createElement(tn, null);
1299
+ }
1300
+ const m = d ?? i === "confirm", C = e.autoFocusButton === null ? !1 : e.autoFocusButton || "ok", [p] = fe("Modal"), v = f || p, x = o || (m ? v == null ? void 0 : v.okText : v == null ? void 0 : v.justOkText), h = a || (v == null ? void 0 : v.cancelText), g = Object.assign({
1301
+ autoFocusButton: C,
1302
+ cancelTextLocale: h,
1303
+ okTextLocale: x,
1304
+ mergedOkCancel: m
1305
+ }, s), y = r.useMemo(() => g, z(Object.values(g))), O = /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(Be, null), /* @__PURE__ */ r.createElement(De, null)), N = e.title !== void 0 && e.title !== null, $ = `${l}-body`;
1306
+ return /* @__PURE__ */ r.createElement("div", {
1307
+ className: `${l}-body-wrapper`
1308
+ }, /* @__PURE__ */ r.createElement("div", {
1309
+ className: T($, {
1310
+ [`${$}-has-title`]: N
1311
+ })
1312
+ }, u, /* @__PURE__ */ r.createElement("div", {
1313
+ className: `${l}-paragraph`
1314
+ }, N && /* @__PURE__ */ r.createElement("span", {
1315
+ className: `${l}-title`
1316
+ }, e.title), /* @__PURE__ */ r.createElement("div", {
1317
+ className: `${l}-content`
1318
+ }, e.content))), c === void 0 || typeof c == "function" ? /* @__PURE__ */ r.createElement(rn, {
1319
+ value: y
1320
+ }, /* @__PURE__ */ r.createElement("div", {
1321
+ className: `${l}-btns`
1322
+ }, typeof c == "function" ? c(O, {
1323
+ OkBtn: De,
1324
+ CancelBtn: Be
1325
+ }) : O)) : c, /* @__PURE__ */ r.createElement(zt, {
1326
+ prefixCls: n
1327
+ }));
1328
+ }
1329
+ const bn = (e) => {
1330
+ const {
1331
+ close: n,
1332
+ zIndex: t,
1333
+ maskStyle: o,
1334
+ direction: a,
1335
+ prefixCls: l,
1336
+ wrapClassName: i,
1337
+ rootPrefixCls: d,
1338
+ bodyStyle: c,
1339
+ closable: f = !1,
1340
+ onConfirm: s,
1341
+ styles: u
1342
+ } = e;
1343
+ if (process.env.NODE_ENV !== "production") {
1344
+ const O = $e("Modal");
1345
+ [["visible", "open"], ["bodyStyle", "styles.body"], ["maskStyle", "styles.mask"]].forEach(([N, $]) => {
1346
+ O.deprecated(!(N in e), N, $);
1347
+ });
1348
+ }
1349
+ const m = `${l}-confirm`, C = e.width || 416, p = e.style || {}, v = e.mask === void 0 ? !0 : e.mask, x = e.maskClosable === void 0 ? !1 : e.maskClosable, h = T(m, `${m}-${e.type}`, {
1350
+ [`${m}-rtl`]: a === "rtl"
1351
+ }, e.className), [, g] = Hn(), y = r.useMemo(() => t !== void 0 ? t : g.zIndexPopupBase + Xn, [t, g]);
1352
+ return /* @__PURE__ */ r.createElement(Cn, Object.assign({}, e, {
1353
+ className: h,
1354
+ wrapClassName: T({
1355
+ [`${m}-centered`]: !!e.centered
1356
+ }, i),
1357
+ onCancel: () => {
1358
+ n == null || n({
1359
+ triggerCancel: !0
1360
+ }), s == null || s(!1);
1361
+ },
1362
+ title: "",
1363
+ footer: null,
1364
+ transitionName: ce(d || "", "zoom", e.transitionName),
1365
+ maskTransitionName: ce(d || "", "fade", e.maskTransitionName),
1366
+ mask: v,
1367
+ maskClosable: x,
1368
+ style: p,
1369
+ styles: Object.assign({
1370
+ body: c,
1371
+ mask: o
1372
+ }, u),
1373
+ width: C,
1374
+ zIndex: y,
1375
+ closable: f
1376
+ }), /* @__PURE__ */ r.createElement(pn, Object.assign({}, e, {
1377
+ confirmPrefixCls: m
1378
+ })));
1379
+ }, Ne = (e) => {
1380
+ const {
1381
+ rootPrefixCls: n,
1382
+ iconPrefixCls: t,
1383
+ direction: o,
1384
+ theme: a
1385
+ } = e;
1386
+ return /* @__PURE__ */ r.createElement(Ze, {
1387
+ prefixCls: n,
1388
+ iconPrefixCls: t,
1389
+ direction: o,
1390
+ theme: a
1391
+ }, /* @__PURE__ */ r.createElement(bn, Object.assign({}, e)));
1392
+ };
1393
+ process.env.NODE_ENV !== "production" && (bn.displayName = "ConfirmDialog", Ne.displayName = "ConfirmDialogWrapper");
1394
+ const X = [];
1395
+ let yn = "";
1396
+ function hn() {
1397
+ return yn;
1398
+ }
1399
+ const Wt = (e) => {
1400
+ var n, t;
1401
+ const {
1402
+ prefixCls: o,
1403
+ getContainer: a,
1404
+ direction: l
1405
+ } = e, i = Xe(), d = ae(ue), c = hn() || d.getPrefixCls(), f = o || `${c}-modal`;
1406
+ let s = a;
1407
+ return s === !1 && (s = void 0, process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "production" && Ye(!1, "Modal", "Static method not support `getContainer` to be `false` since it do not have context env.")), /* @__PURE__ */ b.createElement(Ne, Object.assign({}, e, {
1408
+ rootPrefixCls: c,
1409
+ prefixCls: f,
1410
+ iconPrefixCls: d.iconPrefixCls,
1411
+ theme: d.theme,
1412
+ direction: l ?? d.direction,
1413
+ locale: (t = (n = d.locale) === null || n === void 0 ? void 0 : n.Modal) !== null && t !== void 0 ? t : i,
1414
+ getContainer: s
1415
+ }));
1416
+ };
1417
+ function le(e) {
1418
+ const n = Wn();
1419
+ process.env.NODE_ENV !== "production" && !n.holderRender && Vn("Modal");
1420
+ const t = document.createDocumentFragment();
1421
+ let o = Object.assign(Object.assign({}, e), {
1422
+ close: c,
1423
+ open: !0
1424
+ }), a, l;
1425
+ function i(...s) {
1426
+ var u;
1427
+ if (s.some((p) => p == null ? void 0 : p.triggerCancel)) {
1428
+ var C;
1429
+ (u = e.onCancel) === null || u === void 0 || (C = u).call.apply(C, [e, () => {
1430
+ }].concat(z(s.slice(1))));
1431
+ }
1432
+ for (let p = 0; p < X.length; p++)
1433
+ if (X[p] === c) {
1434
+ X.splice(p, 1);
1435
+ break;
1436
+ }
1437
+ l();
1438
+ }
1439
+ function d(s) {
1440
+ clearTimeout(a), a = setTimeout(() => {
1441
+ const u = n.getPrefixCls(void 0, hn()), m = n.getIconPrefixCls(), C = n.getTheme(), p = /* @__PURE__ */ b.createElement(Wt, Object.assign({}, s));
1442
+ l = Kn()(/* @__PURE__ */ b.createElement(Ze, {
1443
+ prefixCls: u,
1444
+ iconPrefixCls: m,
1445
+ theme: C
1446
+ }, n.holderRender ? n.holderRender(p) : p), t);
1447
+ });
1448
+ }
1449
+ function c(...s) {
1450
+ o = Object.assign(Object.assign({}, o), {
1451
+ open: !1,
1452
+ afterClose: () => {
1453
+ typeof e.afterClose == "function" && e.afterClose(), i.apply(this, s);
1454
+ }
1455
+ }), o.visible && delete o.visible, d(o);
1456
+ }
1457
+ function f(s) {
1458
+ typeof s == "function" ? o = s(o) : o = Object.assign(Object.assign({}, o), s), d(o);
1459
+ }
1460
+ return d(o), X.push(c), {
1461
+ destroy: c,
1462
+ update: f
1463
+ };
1464
+ }
1465
+ function xn(e) {
1466
+ return Object.assign(Object.assign({}, e), {
1467
+ type: "warning"
1468
+ });
1469
+ }
1470
+ function $n(e) {
1471
+ return Object.assign(Object.assign({}, e), {
1472
+ type: "info"
1473
+ });
1474
+ }
1475
+ function En(e) {
1476
+ return Object.assign(Object.assign({}, e), {
1477
+ type: "success"
1478
+ });
1479
+ }
1480
+ function Sn(e) {
1481
+ return Object.assign(Object.assign({}, e), {
1482
+ type: "error"
1483
+ });
1484
+ }
1485
+ function On(e) {
1486
+ return Object.assign(Object.assign({}, e), {
1487
+ type: "confirm"
1488
+ });
1489
+ }
1490
+ function Vt({
1491
+ rootPrefixCls: e
1492
+ }) {
1493
+ process.env.NODE_ENV !== "production" && Ye(!1, "Modal", "Modal.config is deprecated. Please use ConfigProvider.config instead."), yn = e;
1494
+ }
1495
+ var At = function(e, n) {
1496
+ var t = {};
1497
+ for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
1498
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
1499
+ n.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
1500
+ return t;
1501
+ };
1502
+ const Gt = (e, n) => {
1503
+ var t, {
1504
+ afterClose: o,
1505
+ config: a
1506
+ } = e, l = At(e, ["afterClose", "config"]);
1507
+ const [i, d] = r.useState(!0), [c, f] = r.useState(a), {
1508
+ direction: s,
1509
+ getPrefixCls: u
1510
+ } = r.useContext(ue), m = u("modal"), C = u(), p = () => {
1511
+ var g;
1512
+ o(), (g = c.afterClose) === null || g === void 0 || g.call(c);
1513
+ }, v = (...g) => {
1514
+ var y;
1515
+ if (d(!1), g.some(($) => $ == null ? void 0 : $.triggerCancel)) {
1516
+ var N;
1517
+ (y = c.onCancel) === null || y === void 0 || (N = y).call.apply(N, [c, () => {
1518
+ }].concat(z(g.slice(1))));
1519
+ }
1520
+ };
1521
+ r.useImperativeHandle(n, () => ({
1522
+ destroy: v,
1523
+ update: (g) => {
1524
+ f((y) => {
1525
+ const O = typeof g == "function" ? g(y) : g;
1526
+ return Object.assign(Object.assign({}, y), O);
1527
+ });
1528
+ }
1529
+ }));
1530
+ const x = (t = c.okCancel) !== null && t !== void 0 ? t : c.type === "confirm", [h] = fe("Modal", se.Modal);
1531
+ return /* @__PURE__ */ r.createElement(Ne, Object.assign({
1532
+ prefixCls: m,
1533
+ rootPrefixCls: C
1534
+ }, c, {
1535
+ close: v,
1536
+ open: i,
1537
+ afterClose: p,
1538
+ okText: c.okText || (x ? h == null ? void 0 : h.okText : h == null ? void 0 : h.justOkText),
1539
+ direction: c.direction || s,
1540
+ cancelText: c.cancelText || (h == null ? void 0 : h.cancelText)
1541
+ }, l));
1542
+ }, qt = /* @__PURE__ */ r.forwardRef(Gt);
1543
+ let qe = 0;
1544
+ const Ut = /* @__PURE__ */ r.memo(/* @__PURE__ */ r.forwardRef((e, n) => {
1545
+ const [t, o] = ut();
1546
+ return r.useImperativeHandle(n, () => ({
1547
+ patchElement: o
1548
+ }), []), /* @__PURE__ */ r.createElement(r.Fragment, null, t);
1549
+ }));
1550
+ function kt() {
1551
+ const e = r.useRef(null), [n, t] = r.useState([]);
1552
+ r.useEffect(() => {
1553
+ n.length && (z(n).forEach((i) => {
1554
+ i();
1555
+ }), t([]));
1556
+ }, [n]);
1557
+ const o = r.useCallback((l) => function(d) {
1558
+ var c;
1559
+ qe += 1;
1560
+ const f = /* @__PURE__ */ r.createRef();
1561
+ let s;
1562
+ const u = new Promise((x) => {
1563
+ s = x;
1564
+ });
1565
+ let m = !1, C;
1566
+ const p = /* @__PURE__ */ r.createElement(qt, {
1567
+ key: `modal-${qe}`,
1568
+ config: l(d),
1569
+ ref: f,
1570
+ afterClose: () => {
1571
+ C == null || C();
1572
+ },
1573
+ isSilent: () => m,
1574
+ onConfirm: (x) => {
1575
+ s(x);
1576
+ }
1577
+ });
1578
+ return C = (c = e.current) === null || c === void 0 ? void 0 : c.patchElement(p), C && X.push(C), {
1579
+ destroy: () => {
1580
+ function x() {
1581
+ var h;
1582
+ (h = f.current) === null || h === void 0 || h.destroy();
1583
+ }
1584
+ f.current ? x() : t((h) => [].concat(z(h), [x]));
1585
+ },
1586
+ update: (x) => {
1587
+ function h() {
1588
+ var g;
1589
+ (g = f.current) === null || g === void 0 || g.update(x);
1590
+ }
1591
+ f.current ? h() : t((g) => [].concat(z(g), [h]));
1592
+ },
1593
+ then: (x) => (m = !0, u.then(x))
1594
+ };
1595
+ }, []);
1596
+ return [r.useMemo(() => ({
1597
+ info: o($n),
1598
+ success: o(En),
1599
+ error: o(Sn),
1600
+ warning: o(xn),
1601
+ confirm: o(On)
1602
+ }), []), /* @__PURE__ */ r.createElement(Ut, {
1603
+ key: "modal-holder",
1604
+ ref: e
1605
+ })];
1606
+ }
1607
+ var Xt = function(e, n) {
1608
+ var t = {};
1609
+ for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
1610
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
1611
+ n.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
1612
+ return t;
1613
+ };
1614
+ const Kt = (e) => {
1615
+ const {
1616
+ prefixCls: n,
1617
+ className: t,
1618
+ closeIcon: o,
1619
+ closable: a,
1620
+ type: l,
1621
+ title: i,
1622
+ children: d,
1623
+ footer: c
1624
+ } = e, f = Xt(e, ["prefixCls", "className", "closeIcon", "closable", "type", "title", "children", "footer"]), {
1625
+ getPrefixCls: s
1626
+ } = r.useContext(ue), u = s(), m = n || s("modal"), C = Qe(u), [p, v, x] = vn(m, C), h = `${m}-confirm`;
1627
+ let g = {};
1628
+ return l ? g = {
1629
+ closable: a ?? !1,
1630
+ title: "",
1631
+ footer: "",
1632
+ children: /* @__PURE__ */ r.createElement(pn, Object.assign({}, e, {
1633
+ prefixCls: m,
1634
+ confirmPrefixCls: h,
1635
+ rootPrefixCls: u,
1636
+ content: d
1637
+ }))
1638
+ } : g = {
1639
+ closable: a ?? !0,
1640
+ title: i,
1641
+ footer: c !== null && /* @__PURE__ */ r.createElement(un, Object.assign({}, e)),
1642
+ children: d
1643
+ }, p(/* @__PURE__ */ r.createElement(we, Object.assign({
1644
+ prefixCls: m,
1645
+ className: T(v, `${m}-pure-panel`, l && h, l && `${h}-${l}`, t, x, C)
1646
+ }, f, {
1647
+ closeIcon: dn(m, o),
1648
+ closable: a
1649
+ }, g)));
1650
+ }, Qt = Qn(Kt);
1651
+ function wn(e) {
1652
+ return le(xn(e));
1653
+ }
1654
+ const D = Cn;
1655
+ D.useModal = kt;
1656
+ D.info = function(n) {
1657
+ return le($n(n));
1658
+ };
1659
+ D.success = function(n) {
1660
+ return le(En(n));
1661
+ };
1662
+ D.error = function(n) {
1663
+ return le(Sn(n));
1664
+ };
1665
+ D.warning = wn;
1666
+ D.warn = wn;
1667
+ D.confirm = function(n) {
1668
+ return le(On(n));
1669
+ };
1670
+ D.destroyAll = function() {
1671
+ for (; X.length; ) {
1672
+ const n = X.pop();
1673
+ n && n();
1674
+ }
1675
+ };
1676
+ D.config = Vt;
1677
+ D._InternalPanelDoNotUseOrYouWillBeFired = Qt;
1678
+ process.env.NODE_ENV !== "production" && (D.displayName = "Modal");
1679
+ export {
1680
+ D as M
1681
+ };