@amateescu/portal-ui-components 0.0.23 → 0.0.25-react19

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