bi-components-library 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,8 +1,8 @@
1
- import Ne, { useState as z, useRef as W, useMemo as Ce, useCallback as B, useEffect as J } from "react";
2
- import { Button as le, Card as he, Modal as qe, Table as we, Flex as ge, Spin as Se, Empty as $e, Select as Ee, Form as ue, Input as ke, Space as Re, Dropdown as Ae, Tooltip as _e, theme as je } from "antd";
3
- import { createFromIconfontCN as Ie, LeftOutlined as Le, SearchOutlined as Ve, ReloadOutlined as Oe, SendOutlined as Pe, PauseCircleOutlined as Me, PlayCircleOutlined as De } from "@ant-design/icons";
4
- import { createPortal as Ge } from "react-dom";
5
- var de = { exports: {} }, ie = {};
1
+ import Ae, { useState as z, useRef as Y, useMemo as _e, useCallback as F, useEffect as te } from "react";
2
+ import { Button as fe, Card as Ee, Modal as Ie, Table as qe, Flex as ke, Spin as je, Empty as Le, Select as Se, Form as he, Input as $e, Space as Ve, Dropdown as Oe, Tooltip as Me, theme as Pe } from "antd";
3
+ import { createFromIconfontCN as De, LeftOutlined as Be, SearchOutlined as Ge, ReloadOutlined as Fe, SendOutlined as ze, PauseCircleOutlined as He, PlayCircleOutlined as We } from "@ant-design/icons";
4
+ import { createPortal as Xe } from "react-dom";
5
+ var ge = { exports: {} }, me = {};
6
6
  /**
7
7
  * @license React
8
8
  * react-jsx-runtime.production.js
@@ -12,29 +12,29 @@ var de = { exports: {} }, ie = {};
12
12
  * This source code is licensed under the MIT license found in the
13
13
  * LICENSE file in the root directory of this source tree.
14
14
  */
15
- var be;
16
- function Fe() {
17
- if (be) return ie;
18
- be = 1;
19
- var n = Symbol.for("react.transitional.element"), m = Symbol.for("react.fragment");
20
- function c(a, o, h) {
21
- var q = null;
22
- if (h !== void 0 && (q = "" + h), o.key !== void 0 && (q = "" + o.key), "key" in o) {
23
- h = {};
24
- for (var p in o)
25
- p !== "key" && (h[p] = o[p]);
26
- } else h = o;
27
- return o = h.ref, {
28
- $$typeof: n,
29
- type: a,
30
- key: q,
31
- ref: o !== void 0 ? o : null,
32
- props: h
15
+ var Te;
16
+ function Ke() {
17
+ if (Te) return me;
18
+ Te = 1;
19
+ var t = Symbol.for("react.transitional.element"), p = Symbol.for("react.fragment");
20
+ function c(s, l, f) {
21
+ var T = null;
22
+ if (f !== void 0 && (T = "" + f), l.key !== void 0 && (T = "" + l.key), "key" in l) {
23
+ f = {};
24
+ for (var y in l)
25
+ y !== "key" && (f[y] = l[y]);
26
+ } else f = l;
27
+ return l = f.ref, {
28
+ $$typeof: t,
29
+ type: s,
30
+ key: T,
31
+ ref: l !== void 0 ? l : null,
32
+ props: f
33
33
  };
34
34
  }
35
- return ie.Fragment = m, ie.jsx = c, ie.jsxs = c, ie;
35
+ return me.Fragment = p, me.jsx = c, me.jsxs = c, me;
36
36
  }
37
- var ce = {};
37
+ var ye = {};
38
38
  /**
39
39
  * @license React
40
40
  * react-jsx-runtime.development.js
@@ -44,252 +44,252 @@ var ce = {};
44
44
  * This source code is licensed under the MIT license found in the
45
45
  * LICENSE file in the root directory of this source tree.
46
46
  */
47
- var xe;
48
- function Be() {
49
- return xe || (xe = 1, process.env.NODE_ENV !== "production" && function() {
50
- function n(l) {
51
- if (l == null) return null;
52
- if (typeof l == "function")
53
- return l.$$typeof === H ? null : l.displayName || l.name || null;
54
- if (typeof l == "string") return l;
55
- switch (l) {
56
- case v:
47
+ var Ne;
48
+ function Ye() {
49
+ return Ne || (Ne = 1, process.env.NODE_ENV !== "production" && function() {
50
+ function t(i) {
51
+ if (i == null) return null;
52
+ if (typeof i == "function")
53
+ return i.$$typeof === W ? null : i.displayName || i.name || null;
54
+ if (typeof i == "string") return i;
55
+ switch (i) {
56
+ case x:
57
57
  return "Fragment";
58
- case w:
58
+ case v:
59
59
  return "Profiler";
60
- case x:
60
+ case h:
61
61
  return "StrictMode";
62
- case C:
62
+ case w:
63
63
  return "Suspense";
64
- case O:
64
+ case L:
65
65
  return "SuspenseList";
66
66
  case P:
67
67
  return "Activity";
68
68
  }
69
- if (typeof l == "object")
70
- switch (typeof l.tag == "number" && console.error(
69
+ if (typeof i == "object")
70
+ switch (typeof i.tag == "number" && console.error(
71
71
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
72
- ), l.$$typeof) {
73
- case R:
72
+ ), i.$$typeof) {
73
+ case S:
74
74
  return "Portal";
75
+ case g:
76
+ return (i.displayName || "Context") + ".Provider";
75
77
  case $:
76
- return (l.displayName || "Context") + ".Provider";
77
- case A:
78
- return (l._context.displayName || "Context") + ".Consumer";
79
- case S:
80
- var r = l.render;
81
- return l = l.displayName, l || (l = r.displayName || r.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
82
- case I:
83
- return r = l.displayName || null, r !== null ? r : n(l.type) || "Memo";
84
- case D:
85
- r = l._payload, l = l._init;
78
+ return (i._context.displayName || "Context") + ".Consumer";
79
+ case k:
80
+ var I = i.render;
81
+ return i = i.displayName, i || (i = I.displayName || I.name || "", i = i !== "" ? "ForwardRef(" + i + ")" : "ForwardRef"), i;
82
+ case O:
83
+ return I = i.displayName || null, I !== null ? I : t(i.type) || "Memo";
84
+ case M:
85
+ I = i._payload, i = i._init;
86
86
  try {
87
- return n(l(r));
87
+ return t(i(I));
88
88
  } catch {
89
89
  }
90
90
  }
91
91
  return null;
92
92
  }
93
- function m(l) {
94
- return "" + l;
93
+ function p(i) {
94
+ return "" + i;
95
95
  }
96
- function c(l) {
96
+ function c(i) {
97
97
  try {
98
- m(l);
99
- var r = !1;
98
+ p(i);
99
+ var I = !1;
100
100
  } catch {
101
- r = !0;
101
+ I = !0;
102
102
  }
103
- if (r) {
104
- r = console;
105
- var i = r.error, y = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
106
- return i.call(
107
- r,
103
+ if (I) {
104
+ I = console;
105
+ var B = I.error, J = typeof Symbol == "function" && Symbol.toStringTag && i[Symbol.toStringTag] || i.constructor.name || "Object";
106
+ return B.call(
107
+ I,
108
108
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
109
- y
110
- ), m(l);
109
+ J
110
+ ), p(i);
111
111
  }
112
112
  }
113
- function a(l) {
114
- if (l === v) return "<>";
115
- if (typeof l == "object" && l !== null && l.$$typeof === D)
113
+ function s(i) {
114
+ if (i === x) return "<>";
115
+ if (typeof i == "object" && i !== null && i.$$typeof === M)
116
116
  return "<...>";
117
117
  try {
118
- var r = n(l);
119
- return r ? "<" + r + ">" : "<...>";
118
+ var I = t(i);
119
+ return I ? "<" + I + ">" : "<...>";
120
120
  } catch {
121
121
  return "<...>";
122
122
  }
123
123
  }
124
- function o() {
125
- var l = G.A;
126
- return l === null ? null : l.getOwner();
124
+ function l() {
125
+ var i = D.A;
126
+ return i === null ? null : i.getOwner();
127
127
  }
128
- function h() {
128
+ function f() {
129
129
  return Error("react-stack-top-frame");
130
130
  }
131
- function q(l) {
132
- if (K.call(l, "key")) {
133
- var r = Object.getOwnPropertyDescriptor(l, "key").get;
134
- if (r && r.isReactWarning) return !1;
131
+ function T(i) {
132
+ if (X.call(i, "key")) {
133
+ var I = Object.getOwnPropertyDescriptor(i, "key").get;
134
+ if (I && I.isReactWarning) return !1;
135
135
  }
136
- return l.key !== void 0;
136
+ return i.key !== void 0;
137
137
  }
138
- function p(l, r) {
139
- function i() {
138
+ function y(i, I) {
139
+ function B() {
140
140
  _ || (_ = !0, console.error(
141
141
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
142
- r
142
+ I
143
143
  ));
144
144
  }
145
- i.isReactWarning = !0, Object.defineProperty(l, "key", {
146
- get: i,
145
+ B.isReactWarning = !0, Object.defineProperty(i, "key", {
146
+ get: B,
147
147
  configurable: !0
148
148
  });
149
149
  }
150
150
  function e() {
151
- var l = n(this.type);
152
- return F[l] || (F[l] = !0, console.error(
151
+ var i = t(this.type);
152
+ return K[i] || (K[i] = !0, console.error(
153
153
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
154
- )), l = this.props.ref, l !== void 0 ? l : null;
155
- }
156
- function t(l, r, i, y, T, g, L, f) {
157
- return i = g.ref, l = {
158
- $$typeof: d,
159
- type: l,
160
- key: r,
161
- props: g,
162
- _owner: T
163
- }, (i !== void 0 ? i : null) !== null ? Object.defineProperty(l, "ref", {
154
+ )), i = this.props.ref, i !== void 0 ? i : null;
155
+ }
156
+ function a(i, I, B, J, se, ee, de, r) {
157
+ return B = ee.ref, i = {
158
+ $$typeof: n,
159
+ type: i,
160
+ key: I,
161
+ props: ee,
162
+ _owner: se
163
+ }, (B !== void 0 ? B : null) !== null ? Object.defineProperty(i, "ref", {
164
164
  enumerable: !1,
165
165
  get: e
166
- }) : Object.defineProperty(l, "ref", { enumerable: !1, value: null }), l._store = {}, Object.defineProperty(l._store, "validated", {
166
+ }) : Object.defineProperty(i, "ref", { enumerable: !1, value: null }), i._store = {}, Object.defineProperty(i._store, "validated", {
167
167
  configurable: !1,
168
168
  enumerable: !1,
169
169
  writable: !0,
170
170
  value: 0
171
- }), Object.defineProperty(l, "_debugInfo", {
171
+ }), Object.defineProperty(i, "_debugInfo", {
172
172
  configurable: !1,
173
173
  enumerable: !1,
174
174
  writable: !0,
175
175
  value: null
176
- }), Object.defineProperty(l, "_debugStack", {
176
+ }), Object.defineProperty(i, "_debugStack", {
177
177
  configurable: !1,
178
178
  enumerable: !1,
179
179
  writable: !0,
180
- value: L
181
- }), Object.defineProperty(l, "_debugTask", {
180
+ value: de
181
+ }), Object.defineProperty(i, "_debugTask", {
182
182
  configurable: !1,
183
183
  enumerable: !1,
184
184
  writable: !0,
185
- value: f
186
- }), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
187
- }
188
- function N(l, r, i, y, T, g, L, f) {
189
- var b = r.children;
190
- if (b !== void 0)
191
- if (y)
192
- if (Q(b)) {
193
- for (y = 0; y < b.length; y++)
194
- s(b[y]);
195
- Object.freeze && Object.freeze(b);
185
+ value: r
186
+ }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
187
+ }
188
+ function N(i, I, B, J, se, ee, de, r) {
189
+ var o = I.children;
190
+ if (o !== void 0)
191
+ if (J)
192
+ if (Z(o)) {
193
+ for (J = 0; J < o.length; J++)
194
+ d(o[J]);
195
+ Object.freeze && Object.freeze(o);
196
196
  } else
197
197
  console.error(
198
198
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
199
199
  );
200
- else s(b);
201
- if (K.call(r, "key")) {
202
- b = n(l);
203
- var V = Object.keys(r).filter(function(Y) {
204
- return Y !== "key";
200
+ else d(o);
201
+ if (X.call(I, "key")) {
202
+ o = t(i);
203
+ var m = Object.keys(I).filter(function(b) {
204
+ return b !== "key";
205
205
  });
206
- y = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", re[b + y] || (V = 0 < V.length ? "{" + V.join(": ..., ") + ": ...}" : "{}", console.error(
206
+ J = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", ie[o + J] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error(
207
207
  `A props object containing a "key" prop is being spread into JSX:
208
208
  let props = %s;
209
209
  <%s {...props} />
210
210
  React keys must be passed directly to JSX without using spread:
211
211
  let props = %s;
212
212
  <%s key={someKey} {...props} />`,
213
- y,
214
- b,
215
- V,
216
- b
217
- ), re[b + y] = !0);
213
+ J,
214
+ o,
215
+ m,
216
+ o
217
+ ), ie[o + J] = !0);
218
218
  }
219
- if (b = null, i !== void 0 && (c(i), b = "" + i), q(r) && (c(r.key), b = "" + r.key), "key" in r) {
220
- i = {};
221
- for (var j in r)
222
- j !== "key" && (i[j] = r[j]);
223
- } else i = r;
224
- return b && p(
219
+ if (o = null, B !== void 0 && (c(B), o = "" + B), T(I) && (c(I.key), o = "" + I.key), "key" in I) {
220
+ B = {};
221
+ for (var q in I)
222
+ q !== "key" && (B[q] = I[q]);
223
+ } else B = I;
224
+ return o && y(
225
+ B,
226
+ typeof i == "function" ? i.displayName || i.name || "Unknown" : i
227
+ ), a(
225
228
  i,
226
- typeof l == "function" ? l.displayName || l.name || "Unknown" : l
227
- ), t(
228
- l,
229
- b,
230
- g,
231
- T,
232
- o(),
233
- i,
234
- L,
235
- f
229
+ o,
230
+ ee,
231
+ se,
232
+ l(),
233
+ B,
234
+ de,
235
+ r
236
236
  );
237
237
  }
238
- function s(l) {
239
- typeof l == "object" && l !== null && l.$$typeof === d && l._store && (l._store.validated = 1);
238
+ function d(i) {
239
+ typeof i == "object" && i !== null && i.$$typeof === n && i._store && (i._store.validated = 1);
240
240
  }
241
- var k = Ne, d = Symbol.for("react.transitional.element"), R = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), O = Symbol.for("react.suspense_list"), I = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), H = Symbol.for("react.client.reference"), G = k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, K = Object.prototype.hasOwnProperty, Q = Array.isArray, E = console.createTask ? console.createTask : function() {
241
+ var C = Ae, n = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), $ = Symbol.for("react.consumer"), g = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), L = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), M = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), W = Symbol.for("react.client.reference"), D = C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, Z = Array.isArray, E = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
- k = {
245
- react_stack_bottom_frame: function(l) {
246
- return l();
244
+ C = {
245
+ react_stack_bottom_frame: function(i) {
246
+ return i();
247
247
  }
248
248
  };
249
- var _, F = {}, X = k.react_stack_bottom_frame.bind(
250
- k,
251
- h
252
- )(), ne = E(a(h)), re = {};
253
- ce.Fragment = v, ce.jsx = function(l, r, i, y, T) {
254
- var g = 1e4 > G.recentlyCreatedOwnerStacks++;
249
+ var _, K = {}, U = C.react_stack_bottom_frame.bind(
250
+ C,
251
+ f
252
+ )(), le = E(s(f)), ie = {};
253
+ ye.Fragment = x, ye.jsx = function(i, I, B, J, se) {
254
+ var ee = 1e4 > D.recentlyCreatedOwnerStacks++;
255
255
  return N(
256
- l,
257
- r,
258
256
  i,
257
+ I,
258
+ B,
259
259
  !1,
260
- y,
261
- T,
262
- g ? Error("react-stack-top-frame") : X,
263
- g ? E(a(l)) : ne
260
+ J,
261
+ se,
262
+ ee ? Error("react-stack-top-frame") : U,
263
+ ee ? E(s(i)) : le
264
264
  );
265
- }, ce.jsxs = function(l, r, i, y, T) {
266
- var g = 1e4 > G.recentlyCreatedOwnerStacks++;
265
+ }, ye.jsxs = function(i, I, B, J, se) {
266
+ var ee = 1e4 > D.recentlyCreatedOwnerStacks++;
267
267
  return N(
268
- l,
269
- r,
270
268
  i,
269
+ I,
270
+ B,
271
271
  !0,
272
- y,
273
- T,
274
- g ? Error("react-stack-top-frame") : X,
275
- g ? E(a(l)) : ne
272
+ J,
273
+ se,
274
+ ee ? Error("react-stack-top-frame") : U,
275
+ ee ? E(s(i)) : le
276
276
  );
277
277
  };
278
- }()), ce;
278
+ }()), ye;
279
279
  }
280
- var ve;
281
- function ze() {
282
- return ve || (ve = 1, process.env.NODE_ENV === "production" ? de.exports = Fe() : de.exports = Be()), de.exports;
280
+ var Ce;
281
+ function Ue() {
282
+ return Ce || (Ce = 1, process.env.NODE_ENV === "production" ? ge.exports = Ke() : ge.exports = Ye()), ge.exports;
283
283
  }
284
- var u = ze();
285
- const He = ({
286
- variant: n = "primary",
287
- loading: m = !1,
284
+ var u = Ue();
285
+ const Je = ({
286
+ variant: t = "primary",
287
+ loading: p = !1,
288
288
  children: c,
289
- ...a
289
+ ...s
290
290
  }) => {
291
- const o = (h) => {
292
- switch (h) {
291
+ const l = (f) => {
292
+ switch (f) {
293
293
  case "primary":
294
294
  return "primary";
295
295
  case "ghost":
@@ -305,17 +305,17 @@ const He = ({
305
305
  }
306
306
  };
307
307
  return /* @__PURE__ */ u.jsx(
308
- le,
308
+ fe,
309
309
  {
310
- ...a,
311
- type: o(n),
312
- loading: m,
313
- ghost: n === "ghost",
310
+ ...s,
311
+ type: l(t),
312
+ loading: p,
313
+ ghost: t === "ghost",
314
314
  children: c
315
315
  }
316
316
  );
317
317
  };
318
- He.__docgenInfo = {
318
+ Je.__docgenInfo = {
319
319
  displayName: "Button",
320
320
  description: "基础按钮,用于触发操作",
321
321
  props: {
@@ -359,25 +359,25 @@ He.__docgenInfo = {
359
359
  }
360
360
  }
361
361
  };
362
- const We = ({
363
- title: n,
364
- children: m,
362
+ const Qe = ({
363
+ title: t,
364
+ children: p,
365
365
  bordered: c = !0,
366
- hoverable: a = !1,
367
- size: o = "default",
368
- ...h
366
+ hoverable: s = !1,
367
+ size: l = "default",
368
+ ...f
369
369
  }) => /* @__PURE__ */ u.jsx(
370
- he,
370
+ Ee,
371
371
  {
372
- ...h,
373
- title: n,
372
+ ...f,
373
+ title: t,
374
374
  bordered: c,
375
- hoverable: a,
376
- size: o,
377
- children: m
375
+ hoverable: s,
376
+ size: l,
377
+ children: p
378
378
  }
379
379
  );
380
- We.__docgenInfo = {
380
+ Qe.__docgenInfo = {
381
381
  displayName: "Card",
382
382
  description: "卡片容器,用于分组内容",
383
383
  props: {
@@ -428,23 +428,23 @@ We.__docgenInfo = {
428
428
  }
429
429
  }
430
430
  };
431
- const Ke = ({
432
- showDefaultFooter: n = !0,
433
- ...m
431
+ const Ze = ({
432
+ showDefaultFooter: t = !0,
433
+ ...p
434
434
  }) => {
435
- const c = m.footer !== void 0 ? m.footer : n ? (a, { OkBtn: o, CancelBtn: h }) => /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
436
- /* @__PURE__ */ u.jsx(o, {}),
437
- /* @__PURE__ */ u.jsx(h, {})
435
+ const c = p.footer !== void 0 ? p.footer : t ? (s, { OkBtn: l, CancelBtn: f }) => /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
436
+ /* @__PURE__ */ u.jsx(l, {}),
437
+ /* @__PURE__ */ u.jsx(f, {})
438
438
  ] }) : null;
439
439
  return /* @__PURE__ */ u.jsx(
440
- qe,
440
+ Ie,
441
441
  {
442
- ...m,
442
+ ...p,
443
443
  footer: c
444
444
  }
445
445
  );
446
446
  };
447
- Ke.__docgenInfo = {
447
+ Ze.__docgenInfo = {
448
448
  displayName: "AppModal",
449
449
  description: "应用级模态框组件,基于 Ant Design Modal 封装",
450
450
  props: {
@@ -505,29 +505,29 @@ Ke.__docgenInfo = {
505
505
  }
506
506
  }
507
507
  };
508
- const Xe = ({
509
- scrollX: n,
510
- showPagination: m = !0,
508
+ const et = ({
509
+ scrollX: t,
510
+ showPagination: p = !0,
511
511
  defaultPageSize: c = 10,
512
- ...a
512
+ ...s
513
513
  }) => /* @__PURE__ */ u.jsx(
514
- we,
514
+ qe,
515
515
  {
516
- ...a,
516
+ ...s,
517
517
  scroll: {
518
- x: n || "max-content",
518
+ x: t || "max-content",
519
519
  y: "50vh"
520
520
  },
521
- pagination: m ? {
521
+ pagination: p ? {
522
522
  hideOnSinglePage: !0,
523
523
  showSizeChanger: !0,
524
524
  showQuickJumper: !0,
525
525
  defaultPageSize: c,
526
- ...a.pagination
526
+ ...s.pagination
527
527
  } : !1
528
528
  }
529
529
  );
530
- Xe.__docgenInfo = {
530
+ et.__docgenInfo = {
531
531
  displayName: "PageTable",
532
532
  description: "页面级表格组件,高度铺满容器,自动滚动",
533
533
  props: {
@@ -577,30 +577,30 @@ Xe.__docgenInfo = {
577
577
  }
578
578
  }
579
579
  };
580
- const Ye = Ie({
580
+ const tt = De({
581
581
  scriptUrl: ["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]
582
- }), Ue = ({
583
- name: n,
584
- size: m,
582
+ }), nt = ({
583
+ name: t,
584
+ size: p,
585
585
  color: c,
586
- style: a,
587
- ...o
586
+ style: s,
587
+ ...l
588
588
  }) => {
589
- const h = {
590
- fontSize: m,
589
+ const f = {
590
+ fontSize: p,
591
591
  color: c,
592
- ...a
592
+ ...s
593
593
  };
594
594
  return /* @__PURE__ */ u.jsx(
595
- Ye,
595
+ tt,
596
596
  {
597
- ...o,
598
- type: n,
599
- style: h
597
+ ...l,
598
+ type: t,
599
+ style: f
600
600
  }
601
601
  );
602
602
  };
603
- Ue.__docgenInfo = {
603
+ nt.__docgenInfo = {
604
604
  displayName: "XcIcon",
605
605
  description: "自定义图标组件,基于 iconfont",
606
606
  props: {
@@ -636,43 +636,43 @@ Ue.__docgenInfo = {
636
636
  }
637
637
  }
638
638
  };
639
- const Je = ({
640
- loading: n,
641
- description: m = "暂无数据",
639
+ const rt = ({
640
+ loading: t,
641
+ description: p = "暂无数据",
642
642
  className: c,
643
- emptyChildren: a,
644
- loadingText: o,
645
- emptyImage: h
646
- }) => n ? /* @__PURE__ */ u.jsxs(
647
- ge,
643
+ emptyChildren: s,
644
+ loadingText: l,
645
+ emptyImage: f
646
+ }) => t ? /* @__PURE__ */ u.jsxs(
647
+ ke,
648
648
  {
649
649
  className: `pt-10 w-full ${c || ""}`,
650
650
  align: "center",
651
651
  justify: "center",
652
652
  vertical: !0,
653
653
  children: [
654
- /* @__PURE__ */ u.jsx(Se, { size: "large" }),
655
- o && /* @__PURE__ */ u.jsx("div", { className: "mt-4 text-gray-500", children: o })
654
+ /* @__PURE__ */ u.jsx(je, { size: "large" }),
655
+ l && /* @__PURE__ */ u.jsx("div", { className: "mt-4 text-gray-500", children: l })
656
656
  ]
657
657
  }
658
658
  ) : /* @__PURE__ */ u.jsx(
659
- ge,
659
+ ke,
660
660
  {
661
661
  className: `pt-10 w-full ${c || ""}`,
662
662
  align: "center",
663
663
  justify: "center",
664
664
  children: /* @__PURE__ */ u.jsx(
665
- $e,
665
+ Le,
666
666
  {
667
- image: h,
668
- description: m,
667
+ image: f,
668
+ description: p,
669
669
  imageStyle: { height: 180 },
670
- children: a
670
+ children: s
671
671
  }
672
672
  )
673
673
  }
674
674
  );
675
- Je.__docgenInfo = {
675
+ rt.__docgenInfo = {
676
676
  displayName: "EmptyAndSpin",
677
677
  description: "空状态和加载状态组合组件",
678
678
  props: {
@@ -715,24 +715,24 @@ Je.__docgenInfo = {
715
715
  }
716
716
  }
717
717
  };
718
- const Qe = ({
719
- onClick: n,
720
- showText: m = !1,
718
+ const at = ({
719
+ onClick: t,
720
+ showText: p = !1,
721
721
  className: c,
722
- size: a = "small",
723
- type: o = "default"
722
+ size: s = "small",
723
+ type: l = "default"
724
724
  }) => /* @__PURE__ */ u.jsx(
725
- le,
725
+ fe,
726
726
  {
727
- size: a,
728
- type: o,
729
- icon: /* @__PURE__ */ u.jsx(Le, {}),
727
+ size: s,
728
+ type: l,
729
+ icon: /* @__PURE__ */ u.jsx(Be, {}),
730
730
  className: `cursor-pointer ${c || ""}`,
731
- onClick: n,
732
- children: m && "返回"
731
+ onClick: t,
732
+ children: p && "返回"
733
733
  }
734
734
  );
735
- Qe.__docgenInfo = {
735
+ at.__docgenInfo = {
736
736
  displayName: "BackButton",
737
737
  description: "返回按钮组件",
738
738
  props: {
@@ -771,23 +771,23 @@ Qe.__docgenInfo = {
771
771
  }
772
772
  }
773
773
  };
774
- const Ze = ({
775
- removePadding: n = !0,
776
- className: m,
774
+ const ot = ({
775
+ removePadding: t = !0,
776
+ className: p,
777
777
  ...c
778
778
  }) => {
779
- const a = n ? `px-0 h-auto ${m || ""}` : m;
779
+ const s = t ? `px-0 h-auto ${p || ""}` : p;
780
780
  return /* @__PURE__ */ u.jsx(
781
- le,
781
+ fe,
782
782
  {
783
783
  type: "link",
784
784
  ...c,
785
- className: a,
785
+ className: s,
786
786
  children: c.children
787
787
  }
788
788
  );
789
789
  };
790
- Ze.__docgenInfo = {
790
+ ot.__docgenInfo = {
791
791
  displayName: "LinkButton",
792
792
  description: "链接样式按钮组件,适用于表格操作列",
793
793
  props: {
@@ -824,129 +824,129 @@ Ze.__docgenInfo = {
824
824
  }
825
825
  }
826
826
  };
827
- const { Option: et } = Ee, tt = ({
828
- columns: n,
829
- request: m,
827
+ const { Option: st } = Se, lt = ({
828
+ columns: t,
829
+ request: p,
830
830
  searchFields: c = [],
831
- showSearch: a = !0,
832
- showRefresh: o = !0,
833
- defaultPageSize: h = 10,
834
- pageSizeOptions: q = ["10", "20", "50", "100"],
835
- autoLoad: p = !0,
831
+ showSearch: s = !0,
832
+ showRefresh: l = !0,
833
+ defaultPageSize: f = 10,
834
+ pageSizeOptions: T = ["10", "20", "50", "100"],
835
+ autoLoad: y = !0,
836
836
  externalParams: e = {},
837
- ...t
837
+ ...a
838
838
  }) => {
839
- const [N, s] = z([]), [k, d] = z(!1), [R, v] = z({
839
+ const [N, d] = z([]), [C, n] = z(!1), [S, x] = z({
840
840
  current: 1,
841
- pageSize: h,
841
+ pageSize: f,
842
842
  total: 0
843
- }), [x, w] = z({}), [A, $] = z({}), [S] = ue.useForm(), C = W(R);
844
- C.current = R;
845
- const O = W(e);
846
- O.current = e;
847
- const I = W(!1), D = Ce(() => n.map((E) => {
848
- const { sortable: _, render: F, ...X } = E;
843
+ }), [h, v] = z({}), [$, g] = z({}), [k] = he.useForm(), w = Y(S);
844
+ w.current = S;
845
+ const L = Y(e);
846
+ L.current = e;
847
+ const O = Y(!1), M = _e(() => t.map((E) => {
848
+ const { sortable: _, render: K, ...U } = E;
849
849
  return {
850
- ...X,
850
+ ...U,
851
851
  sorter: _ ? !0 : void 0,
852
- render: F || ((ne) => ne)
852
+ render: K || ((le) => le)
853
853
  };
854
- }), [n]), P = B(async (E = {}) => {
855
- if (m) {
856
- d(!0);
854
+ }), [t]), P = F(async (E = {}) => {
855
+ if (p) {
856
+ n(!0);
857
857
  try {
858
858
  const _ = {
859
- page: C.current.current,
860
- pageSize: C.current.pageSize,
861
- sortField: A.field,
862
- sortOrder: A.order,
863
- searchParams: { ...x, ...O.current },
859
+ page: w.current.current,
860
+ pageSize: w.current.pageSize,
861
+ sortField: $.field,
862
+ sortOrder: $.order,
863
+ searchParams: { ...h, ...L.current },
864
864
  ...E
865
- }, F = await m(_);
866
- F.success && (s(F.data), v((X) => ({
867
- ...X,
868
- total: F.total,
869
- current: _.page || X.current
865
+ }, K = await p(_);
866
+ K.success && (d(K.data), x((U) => ({
867
+ ...U,
868
+ total: K.total,
869
+ current: _.page || U.current
870
870
  })));
871
871
  } catch (_) {
872
872
  console.error("加载数据失败:", _);
873
873
  } finally {
874
- d(!1);
874
+ n(!1);
875
875
  }
876
876
  }
877
- }, [m, A, x]), H = B((E) => {
878
- w(E), v((_) => ({ ..._, current: 1 }));
879
- }, []), G = B(() => {
880
- S.resetFields(), w({}), v((E) => ({ ...E, current: 1 }));
881
- }, [S]), K = B(() => {
877
+ }, [p, $, h]), W = F((E) => {
878
+ v(E), x((_) => ({ ..._, current: 1 }));
879
+ }, []), D = F(() => {
880
+ k.resetFields(), v({}), x((E) => ({ ...E, current: 1 }));
881
+ }, [k]), X = F(() => {
882
882
  P();
883
- }, [P]), Q = B((E, _, F) => {
884
- const X = {
883
+ }, [P]), Z = F((E, _, K) => {
884
+ const U = {
885
885
  current: E.current || 1,
886
- pageSize: E.pageSize || h,
886
+ pageSize: E.pageSize || f,
887
887
  total: E.total || 0
888
- }, ne = {
889
- field: F?.field,
890
- order: F?.order
888
+ }, le = {
889
+ field: K?.field,
890
+ order: K?.order
891
891
  };
892
- v(X), $(ne);
893
- }, [h]);
894
- return J(() => {
892
+ x(U), g(le);
893
+ }, [f]);
894
+ return te(() => {
895
895
  const E = Object.keys(e).length > 0;
896
- (p && !I.current || E) && (P(), I.current = !0);
897
- }, [p, e, P]), /* @__PURE__ */ u.jsxs("div", { children: [
898
- a && c.length > 0 && /* @__PURE__ */ u.jsx(he, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ u.jsxs(
899
- ue,
896
+ (y && !O.current || E) && (P(), O.current = !0);
897
+ }, [y, e, P]), /* @__PURE__ */ u.jsxs("div", { children: [
898
+ s && c.length > 0 && /* @__PURE__ */ u.jsx(Ee, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ u.jsxs(
899
+ he,
900
900
  {
901
- form: S,
901
+ form: k,
902
902
  layout: "inline",
903
- onFinish: H,
903
+ onFinish: W,
904
904
  initialValues: c.reduce((E, _) => (_.defaultValue !== void 0 && (E[_.key] = _.defaultValue), E), {}),
905
905
  children: [
906
- c.map((E) => /* @__PURE__ */ u.jsx(ue.Item, { name: E.key, label: E.label, children: E.type === "input" ? /* @__PURE__ */ u.jsx(
907
- ke,
906
+ c.map((E) => /* @__PURE__ */ u.jsx(he.Item, { name: E.key, label: E.label, children: E.type === "input" ? /* @__PURE__ */ u.jsx(
907
+ $e,
908
908
  {
909
909
  placeholder: E.placeholder || `请输入${E.label}`,
910
910
  style: { width: 200 }
911
911
  }
912
912
  ) : /* @__PURE__ */ u.jsx(
913
- Ee,
913
+ Se,
914
914
  {
915
915
  placeholder: E.placeholder || `请选择${E.label}`,
916
916
  style: { width: 200 },
917
917
  allowClear: !0,
918
- children: E.options?.map((_) => /* @__PURE__ */ u.jsx(et, { value: _.value, children: _.label }, _.value))
918
+ children: E.options?.map((_) => /* @__PURE__ */ u.jsx(st, { value: _.value, children: _.label }, _.value))
919
919
  }
920
920
  ) }, E.key)),
921
- /* @__PURE__ */ u.jsx(ue.Item, { children: /* @__PURE__ */ u.jsxs(Re, { children: [
922
- /* @__PURE__ */ u.jsx(le, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ u.jsx(Ve, {}), children: "查询" }),
923
- /* @__PURE__ */ u.jsx(le, { onClick: G, children: "重置" }),
924
- o && /* @__PURE__ */ u.jsx(le, { icon: /* @__PURE__ */ u.jsx(Oe, {}), onClick: K, children: "刷新" })
921
+ /* @__PURE__ */ u.jsx(he.Item, { children: /* @__PURE__ */ u.jsxs(Ve, { children: [
922
+ /* @__PURE__ */ u.jsx(fe, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ u.jsx(Ge, {}), children: "查询" }),
923
+ /* @__PURE__ */ u.jsx(fe, { onClick: D, children: "重置" }),
924
+ l && /* @__PURE__ */ u.jsx(fe, { icon: /* @__PURE__ */ u.jsx(Fe, {}), onClick: X, children: "刷新" })
925
925
  ] }) })
926
926
  ]
927
927
  }
928
928
  ) }),
929
929
  /* @__PURE__ */ u.jsx(
930
- we,
930
+ qe,
931
931
  {
932
- ...t,
933
- columns: D,
932
+ ...a,
933
+ columns: M,
934
934
  dataSource: N,
935
- loading: k,
935
+ loading: C,
936
936
  pagination: {
937
- ...R,
937
+ ...S,
938
938
  showSizeChanger: !0,
939
939
  showQuickJumper: !0,
940
940
  showTotal: (E, _) => `第 ${_[0]}-${_[1]} 条/共 ${E} 条`,
941
- pageSizeOptions: q
941
+ pageSizeOptions: T
942
942
  },
943
- onChange: Q,
943
+ onChange: Z,
944
944
  scroll: { x: "max-content", y: "50vh" }
945
945
  }
946
946
  )
947
947
  ] });
948
948
  };
949
- tt.__docgenInfo = {
949
+ lt.__docgenInfo = {
950
950
  displayName: "AdvancedTable",
951
951
  description: "高阶表格组件,支持异步请求、搜索、排序等功能",
952
952
  props: {
@@ -1013,177 +1013,186 @@ tt.__docgenInfo = {
1013
1013
  }
1014
1014
  }
1015
1015
  };
1016
- function me(n, m, c) {
1017
- if (!n.current) return;
1018
- const a = /* @__PURE__ */ new Set(), o = {};
1019
- for (const s of m)
1020
- s.exclusionGroup && s.exclusionGroup !== "separator" && (a.add(s.exclusionGroup), o[s.exclusionGroup] || (o[s.exclusionGroup] = []), o[s.exclusionGroup].push({
1021
- type: s.type,
1022
- key: s.key,
1023
- exclusionGroup: s.exclusionGroup
1016
+ function ve(t, p, c) {
1017
+ if (!t.current) return;
1018
+ const s = /* @__PURE__ */ new Set(), l = {};
1019
+ for (const d of p)
1020
+ d.exclusionGroup && d.exclusionGroup !== "separator" && (s.add(d.exclusionGroup), l[d.exclusionGroup] || (l[d.exclusionGroup] = []), l[d.exclusionGroup].push({
1021
+ type: d.type,
1022
+ key: d.key,
1023
+ exclusionGroup: d.exclusionGroup
1024
1024
  }));
1025
- const h = {};
1026
- for (const s of a) {
1027
- h[s] = !1;
1028
- for (const k of o[s])
1029
- if (k.type === "upload" && k.key) {
1030
- if (c[k.key] !== null && c[k.key] !== void 0) {
1031
- h[s] = !0;
1025
+ const f = {};
1026
+ for (const d of s) {
1027
+ f[d] = !1;
1028
+ for (const C of l[d])
1029
+ if (C.type === "upload" && C.key) {
1030
+ if (c[C.key] !== null && c[C.key] !== void 0) {
1031
+ f[d] = !0;
1032
1032
  break;
1033
1033
  }
1034
- } else if (k.type === "variable" && k.key) {
1035
- const d = n.current.querySelector(
1036
- `[data-type="variable"][data-key="${k.key}"]`
1034
+ } else if (C.type === "variable" && C.key) {
1035
+ const n = t.current.querySelector(
1036
+ `[data-type="variable"][data-key="${C.key}"]`
1037
1037
  );
1038
- if (d && d.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1039
- h[s] = !0;
1038
+ if (n && n.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1039
+ f[d] = !0;
1040
1040
  break;
1041
1041
  }
1042
1042
  }
1043
1043
  }
1044
- const q = m.some((s) => s.exclusionGroup === "separator"), e = Object.keys(h).filter(
1045
- (s) => h[s]
1044
+ const T = p.some((d) => d.exclusionGroup === "separator"), e = Object.keys(f).filter(
1045
+ (d) => f[d]
1046
1046
  ).length > 0;
1047
- let t = null;
1048
- if (e && q) {
1049
- for (const s of m)
1050
- if (s.exclusionGroup && s.exclusionGroup !== "separator" && h[s.exclusionGroup]) {
1051
- t = s.exclusionGroup;
1047
+ let a = null;
1048
+ if (e && T) {
1049
+ for (const d of p)
1050
+ if (d.exclusionGroup && d.exclusionGroup !== "separator" && f[d.exclusionGroup]) {
1051
+ a = d.exclusionGroup;
1052
1052
  break;
1053
1053
  }
1054
1054
  }
1055
- for (const s of a) {
1056
- const k = n.current.querySelectorAll(
1057
- `[data-group="${s}"]`
1055
+ for (const d of s) {
1056
+ const C = t.current.querySelectorAll(
1057
+ `[data-group="${d}"]`
1058
1058
  );
1059
- q && e && t ? s === t ? k.forEach((d) => {
1060
- d.classList.contains("required-upload-group") ? d.style.setProperty("display", "inline-flex", "important") : (d.classList.contains("exclusion-wrapper"), d.style.setProperty("display", "inline-block", "important"));
1061
- }) : k.forEach((d) => {
1062
- d.style.display = "none", d.style.setProperty("display", "none", "important");
1063
- }) : k.forEach((d) => {
1064
- d.classList.contains("required-upload-group") ? d.style.setProperty("display", "inline-flex", "important") : (d.classList.contains("exclusion-wrapper"), d.style.setProperty("display", "inline-block", "important"));
1059
+ T && e && a ? d === a ? C.forEach((n) => {
1060
+ n.classList.contains("required-upload-group") ? n.style.setProperty("display", "inline-flex", "important") : (n.classList.contains("exclusion-wrapper"), n.style.setProperty("display", "inline-block", "important"));
1061
+ }) : C.forEach((n) => {
1062
+ n.style.display = "none", n.style.setProperty("display", "none", "important");
1063
+ }) : C.forEach((n) => {
1064
+ n.classList.contains("required-upload-group") ? n.style.setProperty("display", "inline-flex", "important") : (n.classList.contains("exclusion-wrapper"), n.style.setProperty("display", "inline-block", "important"));
1065
1065
  });
1066
1066
  }
1067
- n.current.querySelectorAll(
1067
+ t.current.querySelectorAll(
1068
1068
  '[data-group="separator"]'
1069
- ).forEach((s) => {
1070
- s.style.display = e ? "none" : "inline";
1069
+ ).forEach((d) => {
1070
+ d.style.display = e ? "none" : "inline";
1071
1071
  });
1072
1072
  }
1073
- function ye(n, m, c, a) {
1074
- if (!n.current) {
1075
- a(!1);
1073
+ function we(t, p, c, s) {
1074
+ if (!t.current) {
1075
+ s(!1);
1076
1076
  return;
1077
1077
  }
1078
- const o = [];
1079
- for (let e = 0; e < m.length; e++) {
1080
- const t = m[e];
1081
- if ((t.type === "variable" || t.type === "upload" || t.type === "multi-variable") && t.required && t.key) {
1082
- o.push({
1083
- exclusionGroup: t.exclusionGroup || "",
1084
- key: t.key,
1085
- type: t.type === "multi-variable" ? "variable" : t.type,
1086
- isMultiVariable: t.type === "multi-variable"
1078
+ const l = [];
1079
+ for (let e = 0; e < p.length; e++) {
1080
+ const a = p[e];
1081
+ if ((a.type === "variable" || a.type === "upload" || a.type === "multi-variable") && a.required && a.key) {
1082
+ l.push({
1083
+ exclusionGroup: a.exclusionGroup || "",
1084
+ key: a.key,
1085
+ type: a.type === "multi-variable" ? "variable" : a.type,
1086
+ isMultiVariable: a.type === "multi-variable"
1087
1087
  });
1088
1088
  continue;
1089
1089
  }
1090
- if (t.type === "text" && t.className?.includes("rte-text-required") && t.exclusionGroup)
1091
- for (let N = e + 1; N < m.length; N++) {
1092
- const s = m[N];
1093
- if (s.exclusionGroup === t.exclusionGroup && (s.type === "variable" || s.type === "upload") && s.key) {
1094
- o.push({
1095
- exclusionGroup: t.exclusionGroup,
1096
- key: s.key,
1097
- type: s.type
1090
+ if (a.type === "text" && a.className?.includes("rte-text-required") && a.exclusionGroup)
1091
+ for (let N = e + 1; N < p.length; N++) {
1092
+ const d = p[N];
1093
+ if (d.exclusionGroup === a.exclusionGroup && (d.type === "variable" || d.type === "upload") && d.key) {
1094
+ l.push({
1095
+ exclusionGroup: a.exclusionGroup,
1096
+ key: d.key,
1097
+ type: d.type
1098
1098
  });
1099
1099
  break;
1100
1100
  }
1101
1101
  }
1102
1102
  }
1103
- const h = m.some((e) => e.exclusionGroup === "separator");
1104
- let q = !1;
1105
- if (h && o.length > 1) {
1106
- const e = m.findIndex((s) => s.exclusionGroup === "separator"), t = o.filter((s) => m.findIndex(
1107
- (d) => (d.type === "variable" || d.type === "upload") && d.key === s.key && d.exclusionGroup === s.exclusionGroup
1108
- ) < e), N = o.filter((s) => m.findIndex(
1109
- (d) => (d.type === "variable" || d.type === "upload") && d.key === s.key && d.exclusionGroup === s.exclusionGroup
1103
+ const f = p.some((e) => e.exclusionGroup === "separator");
1104
+ let T = !1;
1105
+ if (f && l.length > 1) {
1106
+ const e = p.findIndex((d) => d.exclusionGroup === "separator"), a = l.filter((d) => p.findIndex(
1107
+ (n) => (n.type === "variable" || n.type === "upload") && n.key === d.key && n.exclusionGroup === d.exclusionGroup
1108
+ ) < e), N = l.filter((d) => p.findIndex(
1109
+ (n) => (n.type === "variable" || n.type === "upload") && n.key === d.key && n.exclusionGroup === d.exclusionGroup
1110
1110
  ) > e);
1111
- q = t.length > 0 && N.length > 0;
1111
+ T = a.length > 0 && N.length > 0;
1112
1112
  }
1113
- if (o.length === 0) {
1114
- a(!0);
1113
+ if (l.length === 0) {
1114
+ if (p.length === 0) {
1115
+ if (!t.current) {
1116
+ s(!1);
1117
+ return;
1118
+ }
1119
+ const e = t.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
1120
+ s(e.length > 0);
1121
+ return;
1122
+ }
1123
+ s(!0);
1115
1124
  return;
1116
1125
  }
1117
- const p = o.filter((e) => {
1118
- if (!n.current) return !1;
1119
- const t = n.current.querySelectorAll(
1126
+ const y = l.filter((e) => {
1127
+ if (!t.current) return !1;
1128
+ const a = t.current.querySelectorAll(
1120
1129
  `[data-group="${e.exclusionGroup}"]`
1121
1130
  );
1122
- return t.length === 0 ? !1 : t[0].style.display !== "none";
1131
+ return a.length === 0 ? !1 : a[0].style.display !== "none";
1123
1132
  });
1124
- if (p.length === 0) {
1125
- a(!0);
1133
+ if (y.length === 0) {
1134
+ s(!0);
1126
1135
  return;
1127
1136
  }
1128
- if (q) {
1137
+ if (T) {
1129
1138
  let e = !1;
1130
- for (const t of p)
1131
- if (t.type === "upload" && t.key) {
1132
- if (c[t.key] !== null && c[t.key] !== void 0) {
1139
+ for (const a of y)
1140
+ if (a.type === "upload" && a.key) {
1141
+ if (c[a.key] !== null && c[a.key] !== void 0) {
1133
1142
  e = !0;
1134
1143
  break;
1135
1144
  }
1136
- } else if (t.type === "variable" && t.key)
1137
- if (t.isMultiVariable) {
1138
- const N = n.current.querySelectorAll(
1139
- `[data-type="variable"][data-multi-key="${t.key}"]`
1145
+ } else if (a.type === "variable" && a.key)
1146
+ if (a.isMultiVariable) {
1147
+ const N = t.current.querySelectorAll(
1148
+ `[data-type="variable"][data-multi-key="${a.key}"]`
1140
1149
  );
1141
- let s = !1;
1142
- for (const k of Array.from(N))
1143
- if (k.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1144
- s = !0;
1150
+ let d = !1;
1151
+ for (const C of Array.from(N))
1152
+ if (C.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1153
+ d = !0;
1145
1154
  break;
1146
1155
  }
1147
- if (s) {
1156
+ if (d) {
1148
1157
  e = !0;
1149
1158
  break;
1150
1159
  }
1151
1160
  } else {
1152
- const N = n.current.querySelector(
1153
- `[data-type="variable"][data-key="${t.key}"]`
1161
+ const N = t.current.querySelector(
1162
+ `[data-type="variable"][data-key="${a.key}"]`
1154
1163
  );
1155
1164
  if (N && N.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1156
1165
  e = !0;
1157
1166
  break;
1158
1167
  }
1159
1168
  }
1160
- a(e);
1169
+ s(e);
1161
1170
  } else {
1162
1171
  let e = !0;
1163
- for (const t of p)
1164
- if (t.type === "upload" && t.key) {
1165
- if (c[t.key] === null || c[t.key] === void 0) {
1172
+ for (const a of y)
1173
+ if (a.type === "upload" && a.key) {
1174
+ if (c[a.key] === null || c[a.key] === void 0) {
1166
1175
  e = !1;
1167
1176
  break;
1168
1177
  }
1169
- } else if (t.type === "variable" && t.key)
1170
- if (t.isMultiVariable) {
1171
- const N = n.current.querySelectorAll(
1172
- `[data-type="variable"][data-multi-key="${t.key}"]`
1178
+ } else if (a.type === "variable" && a.key)
1179
+ if (a.isMultiVariable) {
1180
+ const N = t.current.querySelectorAll(
1181
+ `[data-type="variable"][data-multi-key="${a.key}"]`
1173
1182
  );
1174
- let s = !1;
1175
- for (const k of Array.from(N))
1176
- if (k.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1177
- s = !0;
1183
+ let d = !1;
1184
+ for (const C of Array.from(N))
1185
+ if (C.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1186
+ d = !0;
1178
1187
  break;
1179
1188
  }
1180
- if (!s) {
1189
+ if (!d) {
1181
1190
  e = !1;
1182
1191
  break;
1183
1192
  }
1184
1193
  } else {
1185
- const N = n.current.querySelector(
1186
- `[data-type="variable"][data-key="${t.key}"]`
1194
+ const N = t.current.querySelector(
1195
+ `[data-type="variable"][data-key="${a.key}"]`
1187
1196
  );
1188
1197
  if (!N) {
1189
1198
  e = !1;
@@ -1194,338 +1203,384 @@ function ye(n, m, c, a) {
1194
1203
  break;
1195
1204
  }
1196
1205
  }
1197
- a(e);
1206
+ s(e);
1198
1207
  }
1199
1208
  }
1200
- function fe(n, m) {
1201
- if (!n.current) return;
1202
- n.current.querySelectorAll('[data-type="variable"]').forEach((a) => {
1203
- const o = a.innerText.replace(/\n/g, "");
1204
- o.replace(/\u200B/g, "") ? a.classList.remove("show-placeholder") : (o !== "​" && (a.innerText = "​"), a.classList.add("show-placeholder"));
1209
+ function be(t, p) {
1210
+ if (!t.current) return;
1211
+ t.current.querySelectorAll('[data-type="variable"]').forEach((s) => {
1212
+ const l = s.innerText.replace(/\n/g, "");
1213
+ l.replace(/\u200B/g, "") ? s.classList.remove("show-placeholder") : (l !== "​" && (s.innerText = "​"), s.classList.add("show-placeholder"));
1205
1214
  });
1206
1215
  }
1207
- function nt(n, m, c, a, o, h = {}) {
1208
- if (!n.current) return;
1209
- let q = "", p = 0;
1210
- for (; p < m.length; ) {
1211
- const e = m[p], t = p + 1 < m.length ? m[p + 1] : null;
1212
- if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && t) {
1213
- const v = t.type === "upload" && t.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === t.exclusionGroup, x = t.type === "variable" && t.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === t.exclusionGroup;
1214
- if (v) {
1215
- const A = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, $ = "</span>";
1216
- let S = "";
1217
- e.className ? S = `<span class="${e.className}">${e.text ?? ""}</span>` : S = e.text ?? "";
1218
- const C = t, O = c[C.key] !== null && c[C.key] !== void 0, I = O ? c[C.key]?.name : C.text, D = O ? "" : "hidden", P = C.tooltip && !O ? "" : "hidden", H = O ? "has-file" : "", G = O && I ? ` data-file-name="${I.replace(/"/g, "&quot;")}"` : "", K = `<span contenteditable="false" data-type="upload" data-key="${C.key}" class="upload-chip"><span class="upload-inner-wrapper ${H}"><span class="upload-icon">${O ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${G}>${I || C.text}</span>${C.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${P}" data-upload-key="${C.key}" data-tooltip="${C.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${D}" title="移除文件">×</span></span></span>`;
1219
- q += A + S + K + $, p += 2;
1216
+ function it(t, p, c, s, l, f = {}) {
1217
+ if (!t.current) return;
1218
+ let T = "", y = 0;
1219
+ for (; y < p.length; ) {
1220
+ const e = p[y], a = y + 1 < p.length ? p[y + 1] : null;
1221
+ if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && a) {
1222
+ const x = a.type === "upload" && a.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === a.exclusionGroup, h = a.type === "variable" && a.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === a.exclusionGroup;
1223
+ if (x) {
1224
+ const $ = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, g = "</span>";
1225
+ let k = "";
1226
+ e.className ? k = `<span class="${e.className}">${e.text ?? ""}</span>` : k = e.text ?? "";
1227
+ const w = a, L = c[w.key] !== null && c[w.key] !== void 0, O = L ? c[w.key]?.name : w.text, M = L ? "" : "hidden", P = w.tooltip && !L ? "" : "hidden", W = L ? "has-file" : "", D = L && O ? ` data-file-name="${O.replace(/"/g, "&quot;")}"` : "", X = `<span contenteditable="false" data-type="upload" data-key="${w.key}" class="upload-chip"><span class="upload-inner-wrapper ${W}"><span class="upload-icon">${L ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${D}>${O || w.text}</span>${w.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${P}" data-upload-key="${w.key}" data-tooltip="${w.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${M}" title="移除文件">×</span></span></span>`;
1228
+ T += $ + k + X + g, y += 2;
1220
1229
  continue;
1221
1230
  }
1222
- if (x) {
1223
- const A = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, $ = "</span>";
1224
- let S = "";
1225
- e.className ? S = `<span class="${e.className}">${e.text ?? ""}</span>` : S = e.text ?? "";
1226
- const C = t, I = (C.key ? o[C.key] : void 0) || C.text || "", D = !I, P = D ? "​" : I, H = D ? "show-placeholder" : "", G = C.exclusionGroup ? ` data-group="${C.exclusionGroup}"` : "", K = C.tooltip ? ` data-tooltip="${C.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${C.key || ""}"` : "", Q = C.tooltip && D ? "" : "hidden", E = `<span contenteditable="true" data-type="variable" data-key="${C.key}" data-placeholder="${C.placeholder || ""}"${G}${K} class="variable-chip ${H}">${P}${C.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${Q}" data-variable-key="${C.key}" data-tooltip="${C.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1227
- q += A + S + E + $, p += 2;
1231
+ if (h) {
1232
+ const $ = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, g = "</span>";
1233
+ let k = "";
1234
+ e.className ? k = `<span class="${e.className}">${e.text ?? ""}</span>` : k = e.text ?? "";
1235
+ const w = a, O = (w.key ? l[w.key] : void 0) || w.text || "", M = !O, P = M ? "​" : O, W = M ? "show-placeholder" : "", D = w.exclusionGroup ? ` data-group="${w.exclusionGroup}"` : "", X = w.tooltip ? ` data-tooltip="${w.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${w.key || ""}"` : "", Z = w.tooltip && M ? "" : "hidden", E = `<span contenteditable="true" data-type="variable" data-key="${w.key}" data-placeholder="${w.placeholder || ""}"${D}${X} class="variable-chip ${W}">${P}${w.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${Z}" data-variable-key="${w.key}" data-tooltip="${w.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1236
+ T += $ + k + E + g, y += 2;
1228
1237
  continue;
1229
1238
  }
1230
1239
  }
1231
- const s = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", k = e.exclusionGroup ? `<span ${s} class="exclusion-wrapper">` : "", d = e.exclusionGroup ? "</span>" : "";
1232
- let R = "";
1240
+ const d = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", C = e.exclusionGroup ? `<span ${d} class="exclusion-wrapper">` : "", n = e.exclusionGroup ? "</span>" : "";
1241
+ let S = "";
1233
1242
  if (e.type === "tag") {
1234
- const v = a ? "" : '<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>', x = a ? ' data-locked="true"' : "", w = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-tag-key="${e.key || ""}"` : "";
1235
- R = `<span contenteditable="false" class="tag-node group"${x}${w}><span class="tag-label">${e.text}</span>${v}</span>`;
1243
+ const x = s ? "" : '<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>', h = s ? ' data-locked="true"' : "", v = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-tag-key="${e.key || ""}"` : "";
1244
+ S = `<span contenteditable="false" class="tag-node group"${h}${v}><span class="tag-label">${e.text}</span>${x}</span>`;
1236
1245
  } else if (e.type === "text") {
1237
- const v = a ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"';
1238
- e.className ? R = `<span class="${e.className}"${v}>${e.text ?? ""}</span>` : R = a ? `<span${v}>${e.text ?? ""}</span>` : `<span contenteditable="false">${e.text ?? ""}</span>`;
1246
+ const x = s ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"';
1247
+ e.className ? S = `<span class="${e.className}"${x}>${e.text ?? ""}</span>` : S = s ? `<span${x}>${e.text ?? ""}</span>` : `<span contenteditable="false">${e.text ?? ""}</span>`;
1239
1248
  } else if (e.type === "variable" && e.key) {
1240
- const x = o[e.key] || e.text || "", w = !x, A = w ? "​" : x, $ = w ? "show-placeholder" : "", S = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", C = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", O = e.tooltip && w ? "" : "hidden", I = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${S}${C} class="variable-chip ${$}">${A}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${O}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1241
- e.required ? R = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${I}</span>` : R = I;
1249
+ const h = l[e.key] || e.text || "", v = !h, $ = v ? "​" : h, g = v ? "show-placeholder" : "", k = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", w = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", L = e.tooltip && v ? "" : "hidden", O = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${k}${w} class="variable-chip ${g}">${$}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${L}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1250
+ e.required ? S = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${O}</span>` : S = O;
1242
1251
  } else if (e.type === "upload" && e.key) {
1243
- const v = c[e.key] !== null && c[e.key] !== void 0, x = v ? c[e.key]?.name : e.text, w = v ? "" : "hidden", A = e.tooltip && !v ? "" : "hidden", $ = v ? "has-file" : "", S = v && x ? ` data-file-name="${x.replace(/"/g, "&quot;")}"` : "", C = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${$}"><span class="upload-icon">${v ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${S}>${x || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${A}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${w}" title="移除文件">×</span></span></span>`;
1244
- e.required ? R = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${C}</span>` : R = C;
1252
+ const x = c[e.key] !== null && c[e.key] !== void 0, h = x ? c[e.key]?.name : e.text, v = x ? "" : "hidden", $ = e.tooltip && !x ? "" : "hidden", g = x ? "has-file" : "", k = x && h ? ` data-file-name="${h.replace(/"/g, "&quot;")}"` : "", w = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${g}"><span class="upload-icon">${x ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${k}>${h || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${$}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${v}" title="移除文件">×</span></span></span>`;
1253
+ e.required ? S = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${w}</span>` : S = w;
1245
1254
  } else if (e.type === "multi-variable" && e.key) {
1246
- const v = e.maxCount || 9, x = h[e.key] || 1, w = Math.min(x, v);
1247
- let A = "";
1248
- for (let $ = 0; $ < w; $++) {
1249
- const S = `${e.key}_${$}`, C = o[S] || "", O = !C, I = O ? "​" : C, D = O ? "show-placeholder" : "", P = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", H = e.tooltip && O ? "" : "hidden", G = `<span contenteditable="true" data-type="variable" data-key="${S}" data-multi-key="${e.key}" data-index="${$}" data-placeholder="${e.placeholder || ""}"${P} class="variable-chip ${D}">${I}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${H}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1250
- A += G;
1255
+ const x = e.maxCount || 9, h = f[e.key] || 1, v = Math.min(h, x);
1256
+ let $ = "";
1257
+ for (let g = 0; g < v; g++) {
1258
+ const k = `${e.key}_${g}`, w = l[k] || "", L = !w, O = L ? "​" : w, M = L ? "show-placeholder" : "", P = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", W = e.tooltip && L ? "" : "hidden", D = `<span contenteditable="true" data-type="variable" data-key="${k}" data-multi-key="${e.key}" data-index="${g}" data-placeholder="${e.placeholder || ""}"${P} class="variable-chip ${M}">${O}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${W}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1259
+ $ += D;
1251
1260
  }
1252
- e.required ? R = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${A}</span>` : R = A;
1261
+ e.required ? S = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${$}</span>` : S = $;
1253
1262
  }
1254
- q += k + R + d, p++;
1263
+ T += C + S + n, y++;
1255
1264
  }
1256
- n.current && (n.current.innerHTML = q, setTimeout(() => {
1257
- if (!n.current) return;
1258
- n.current.querySelectorAll('[data-type="variable"]').forEach((t) => {
1259
- const N = t.innerText.replace(/\n/g, "");
1260
- N.replace(/\u200B/g, "") ? t.classList.remove("show-placeholder") : (N !== "​" && (t.innerText = "​"), t.classList.add("show-placeholder"));
1265
+ t.current && (t.current.innerHTML = T, setTimeout(() => {
1266
+ if (!t.current) return;
1267
+ t.current.querySelectorAll('[data-type="variable"]').forEach((a) => {
1268
+ const N = a.innerText.replace(/\n/g, "");
1269
+ N.replace(/\u200B/g, "") ? a.classList.remove("show-placeholder") : (N !== "​" && (a.innerText = "​"), a.classList.add("show-placeholder"));
1261
1270
  });
1262
1271
  }, 0));
1263
1272
  }
1264
- function rt(n, m, c, a, o = {}, h, q) {
1265
- const p = B(() => {
1266
- if (!n.current) return;
1273
+ function ct(t, p, c, s, l = {}, f, T) {
1274
+ const y = F(() => {
1275
+ if (!t.current) return;
1276
+ if (p.length === 0) {
1277
+ t.current.innerHTML = "";
1278
+ return;
1279
+ }
1267
1280
  let e = {};
1268
- const t = n.current, N = t.__tempVariableValues;
1269
- if (N ? (e = N, delete t.__tempVariableValues) : n.current.querySelectorAll(
1281
+ const a = t.current, N = a.__tempVariableValues;
1282
+ if (N ? (e = N, delete a.__tempVariableValues) : t.current.querySelectorAll(
1270
1283
  '[data-type="variable"]'
1271
- ).forEach((k) => {
1272
- const d = k.dataset.key;
1273
- if (d) {
1274
- const R = k.innerText.replace(/[\u200B\n]/g, "").trim();
1275
- R && (e[d] = R);
1284
+ ).forEach((C) => {
1285
+ const n = C.dataset.key;
1286
+ if (n) {
1287
+ const S = C.innerText.replace(/[\u200B\n]/g, "").trim();
1288
+ S && (e[n] = S);
1276
1289
  }
1277
- }), nt(n, m, c, a, e, o), h?.current) {
1278
- const { key: s, offset: k } = h.current;
1290
+ }), it(t, p, c, s, e, l), f?.current) {
1291
+ const { key: d, offset: C } = f.current;
1279
1292
  setTimeout(() => {
1280
- if (!n.current) return;
1281
- const d = n.current.querySelector(
1282
- `[data-type="variable"][data-key="${s}"]`
1293
+ if (!t.current) return;
1294
+ const n = t.current.querySelector(
1295
+ `[data-type="variable"][data-key="${d}"]`
1283
1296
  );
1284
- if (d) {
1297
+ if (n) {
1285
1298
  try {
1286
- const R = document.createRange(), v = document.createTreeWalker(
1287
- d,
1299
+ const S = document.createRange(), x = document.createTreeWalker(
1300
+ n,
1288
1301
  NodeFilter.SHOW_TEXT,
1289
1302
  null
1290
1303
  );
1291
- let x = 0, w = null, A = 0;
1292
- for (; v.nextNode(); ) {
1293
- const $ = v.currentNode, S = $.textContent?.length || 0;
1294
- if (x + S >= k) {
1295
- w = $, A = k - x;
1304
+ let h = 0, v = null, $ = 0;
1305
+ for (; x.nextNode(); ) {
1306
+ const g = x.currentNode, k = g.textContent?.length || 0;
1307
+ if (h + k >= C) {
1308
+ v = g, $ = C - h;
1296
1309
  break;
1297
1310
  }
1298
- x += S;
1311
+ h += k;
1299
1312
  }
1300
- if (w) {
1301
- R.setStart(w, Math.min(A, w.textContent?.length || 0)), R.collapse(!0);
1302
- const $ = window.getSelection();
1303
- $ && ($.removeAllRanges(), $.addRange(R), d.focus());
1313
+ if (v) {
1314
+ S.setStart(v, Math.min($, v.textContent?.length || 0)), S.collapse(!0);
1315
+ const g = window.getSelection();
1316
+ g && (g.removeAllRanges(), g.addRange(S), n.focus());
1304
1317
  } else {
1305
- R.selectNodeContents(d), R.collapse(!1);
1306
- const $ = window.getSelection();
1307
- $ && ($.removeAllRanges(), $.addRange(R), d.focus());
1318
+ S.selectNodeContents(n), S.collapse(!1);
1319
+ const g = window.getSelection();
1320
+ g && (g.removeAllRanges(), g.addRange(S), n.focus());
1308
1321
  }
1309
1322
  } catch {
1310
- const R = document.createRange();
1311
- R.selectNodeContents(d), R.collapse(!1);
1312
- const v = window.getSelection();
1313
- v && (v.removeAllRanges(), v.addRange(R), d.focus());
1323
+ const S = document.createRange();
1324
+ S.selectNodeContents(n), S.collapse(!1);
1325
+ const x = window.getSelection();
1326
+ x && (x.removeAllRanges(), x.addRange(S), n.focus());
1314
1327
  }
1315
- h.current = null;
1328
+ f.current = null;
1316
1329
  }
1317
1330
  }, 0);
1318
1331
  }
1319
- }, [m, c, a, n, o, h, q]);
1320
- J(() => {
1321
- p();
1322
- }, [p]);
1332
+ }, [p, c, s, t, l, f, T]);
1333
+ te(() => {
1334
+ y();
1335
+ }, [y]);
1323
1336
  }
1324
- function at(n, m, c, a) {
1325
- J(() => {
1326
- const o = n.current;
1327
- if (!o) return;
1328
- const h = (p) => {
1329
- const e = p.target?.closest(".upload-info-icon");
1337
+ function ut(t, p, c, s) {
1338
+ te(() => {
1339
+ const l = t.current;
1340
+ if (!l) return;
1341
+ const f = (y) => {
1342
+ const e = y.target?.closest(".upload-info-icon");
1330
1343
  if (e && e.classList.contains("upload-info-icon")) {
1331
- const t = e.dataset.uploadKey;
1332
- t && a({ key: t, anchorEl: e, type: "upload" });
1344
+ const a = e.dataset.uploadKey;
1345
+ a && s({ key: a, anchorEl: e, type: "upload" });
1333
1346
  }
1334
- }, q = (p) => {
1335
- const e = p.target?.closest(".upload-info-icon"), t = p.relatedTarget;
1336
- e && e.classList.contains("upload-info-icon") && (!t || !o.contains(t) ? a(null) : t.closest(".upload-info-icon") || a(null));
1347
+ }, T = (y) => {
1348
+ const e = y.target?.closest(".upload-info-icon"), a = y.relatedTarget;
1349
+ e && e.classList.contains("upload-info-icon") && (!a || !l.contains(a) ? s(null) : a.closest(".upload-info-icon") || s(null));
1337
1350
  };
1338
- return o.addEventListener("mouseover", h, !0), o.addEventListener("mouseout", q, !0), () => {
1339
- o.removeEventListener("mouseover", h, !0), o.removeEventListener("mouseout", q, !0);
1351
+ return l.addEventListener("mouseover", f, !0), l.addEventListener("mouseout", T, !0), () => {
1352
+ l.removeEventListener("mouseover", f, !0), l.removeEventListener("mouseout", T, !0);
1340
1353
  };
1341
- }, [m, c, n, a]);
1354
+ }, [p, c, t, s]);
1342
1355
  }
1343
- function ot(n, m, c) {
1344
- J(() => {
1345
- if (!n.current) return;
1346
- const a = (p) => {
1347
- const e = p.currentTarget, t = e.dataset.tooltip, N = e.dataset.tagKey || "";
1348
- t && c({ key: N, anchorEl: e, type: "tag" });
1349
- }, o = () => {
1356
+ function dt(t, p, c) {
1357
+ te(() => {
1358
+ if (!t.current) return;
1359
+ const s = (y) => {
1360
+ const e = y.currentTarget, a = e.dataset.tooltip, N = e.dataset.tagKey || "";
1361
+ a && c({ key: N, anchorEl: e, type: "tag" });
1362
+ }, l = () => {
1350
1363
  c(null);
1351
1364
  };
1352
- let h;
1353
- const q = () => {
1354
- if (!n.current) return;
1355
- n.current.querySelectorAll(
1365
+ let f;
1366
+ const T = () => {
1367
+ if (!t.current) return;
1368
+ t.current.querySelectorAll(
1356
1369
  ".tag-node[data-tooltip]"
1357
1370
  ).forEach((e) => {
1358
- e.addEventListener("mouseenter", a), e.addEventListener("mouseleave", o);
1371
+ e.addEventListener("mouseenter", s), e.addEventListener("mouseleave", l);
1359
1372
  });
1360
1373
  };
1361
- return h = requestAnimationFrame(() => {
1362
- h = requestAnimationFrame(q);
1374
+ return f = requestAnimationFrame(() => {
1375
+ f = requestAnimationFrame(T);
1363
1376
  }), () => {
1364
- cancelAnimationFrame(h), n.current && n.current.querySelectorAll(
1377
+ cancelAnimationFrame(f), t.current && t.current.querySelectorAll(
1365
1378
  ".tag-node[data-tooltip]"
1366
1379
  ).forEach((e) => {
1367
- e.removeEventListener("mouseenter", a), e.removeEventListener("mouseleave", o);
1380
+ e.removeEventListener("mouseenter", s), e.removeEventListener("mouseleave", l);
1368
1381
  });
1369
1382
  };
1370
- }, [m, n, c]);
1383
+ }, [p, t, c]);
1371
1384
  }
1372
- function st(n, m, c) {
1373
- J(() => {
1374
- const a = n.current;
1375
- if (!a) return;
1376
- const o = (q) => {
1377
- const p = q.target?.closest(".variable-info-icon");
1378
- if (p && p.classList.contains("variable-info-icon")) {
1379
- const e = p.dataset.variableKey;
1380
- e && c({ key: e, anchorEl: p, type: "variable" });
1385
+ function pt(t, p, c) {
1386
+ te(() => {
1387
+ const s = t.current;
1388
+ if (!s) return;
1389
+ const l = (T) => {
1390
+ const y = T.target?.closest(".variable-info-icon");
1391
+ if (y && y.classList.contains("variable-info-icon")) {
1392
+ const e = y.dataset.variableKey;
1393
+ e && c({ key: e, anchorEl: y, type: "variable" });
1381
1394
  }
1382
- }, h = (q) => {
1383
- const p = q.target?.closest(".variable-info-icon"), e = q.relatedTarget;
1384
- p && p.classList.contains("variable-info-icon") && (!e || !a.contains(e) ? c(null) : e.closest(".variable-info-icon") || c(null));
1395
+ }, f = (T) => {
1396
+ const y = T.target?.closest(".variable-info-icon"), e = T.relatedTarget;
1397
+ y && y.classList.contains("variable-info-icon") && (!e || !s.contains(e) ? c(null) : e.closest(".variable-info-icon") || c(null));
1385
1398
  };
1386
- return a.addEventListener("mouseover", o, !0), a.addEventListener("mouseout", h, !0), () => {
1387
- a.removeEventListener("mouseover", o, !0), a.removeEventListener("mouseout", h, !0);
1399
+ return s.addEventListener("mouseover", l, !0), s.addEventListener("mouseout", f, !0), () => {
1400
+ s.removeEventListener("mouseover", l, !0), s.removeEventListener("mouseout", f, !0);
1388
1401
  };
1389
- }, [m, n, c]);
1402
+ }, [p, t, c]);
1390
1403
  }
1391
- function lt(n, m, c, a) {
1392
- J(() => {
1393
- if (!n.current) return;
1394
- const o = (e) => {
1395
- const t = e.currentTarget;
1396
- t.dataset.fileName && a({ key: "", anchorEl: t, type: "upload-label" });
1397
- }, h = () => {
1398
- a(null);
1404
+ function ft(t, p, c, s) {
1405
+ te(() => {
1406
+ if (!t.current) return;
1407
+ const l = (e) => {
1408
+ const a = e.currentTarget;
1409
+ a.dataset.fileName && s({ key: "", anchorEl: a, type: "upload-label" });
1410
+ }, f = () => {
1411
+ s(null);
1399
1412
  };
1400
- let q;
1401
- const p = () => {
1402
- if (!n.current) return;
1403
- n.current.querySelectorAll(
1413
+ let T;
1414
+ const y = () => {
1415
+ if (!t.current) return;
1416
+ t.current.querySelectorAll(
1404
1417
  ".upload-label[data-file-name]"
1405
- ).forEach((t) => {
1406
- t.addEventListener("mouseenter", o), t.addEventListener("mouseleave", h);
1418
+ ).forEach((a) => {
1419
+ a.addEventListener("mouseenter", l), a.addEventListener("mouseleave", f);
1407
1420
  });
1408
1421
  };
1409
- return q = requestAnimationFrame(() => {
1410
- q = requestAnimationFrame(p);
1422
+ return T = requestAnimationFrame(() => {
1423
+ T = requestAnimationFrame(y);
1411
1424
  }), () => {
1412
- cancelAnimationFrame(q), n.current && n.current.querySelectorAll(
1425
+ cancelAnimationFrame(T), t.current && t.current.querySelectorAll(
1413
1426
  ".upload-label[data-file-name]"
1414
- ).forEach((t) => {
1415
- t.removeEventListener("mouseenter", o), t.removeEventListener("mouseleave", h);
1427
+ ).forEach((a) => {
1428
+ a.removeEventListener("mouseenter", l), a.removeEventListener("mouseleave", f);
1416
1429
  });
1417
1430
  };
1418
- }, [m, c, n, a]);
1431
+ }, [p, c, t, s]);
1419
1432
  }
1420
- function it(n, m, c, a) {
1421
- J(() => {
1422
- me(n, m, c), ye(n, m, c, a);
1423
- }, [c, m, n, a]);
1433
+ function mt(t, p, c, s) {
1434
+ te(() => {
1435
+ ve(t, p, c), we(t, p, c, s);
1436
+ }, [c, p, t, s]);
1424
1437
  }
1425
- function ct(n, m) {
1426
- J(() => {
1427
- if (!n.current) return;
1428
- let c = !1, a = 0;
1429
- const o = () => {
1438
+ function yt(t, p) {
1439
+ te(() => {
1440
+ if (!t.current) return;
1441
+ let c = !1, s = 0;
1442
+ const l = () => {
1430
1443
  c = !0;
1431
- }, h = () => {
1432
- c = !1, a = Date.now();
1433
- }, q = () => {
1434
- if (!n.current) return;
1435
- const p = window.getSelection();
1436
- if (!p || p.rangeCount === 0 || m.current || c)
1444
+ }, f = () => {
1445
+ c = !1, s = Date.now();
1446
+ };
1447
+ let T = !1, y = 0;
1448
+ const e = () => {
1449
+ T = !0;
1450
+ }, a = () => {
1451
+ T = !1, y = Date.now();
1452
+ }, N = () => {
1453
+ y = Date.now();
1454
+ }, d = () => {
1455
+ if (!t.current) return;
1456
+ const n = window.getSelection();
1457
+ if (!n || n.rangeCount === 0 || p.current || c || T || Date.now() - y < 500)
1437
1458
  return;
1438
- const e = p.getRangeAt(0);
1439
- if (!e.collapsed) {
1440
- n.current.contains(e.commonAncestorContainer) || p.removeAllRanges();
1459
+ const S = n.getRangeAt(0);
1460
+ if (!S.collapsed) {
1461
+ t.current.contains(S.commonAncestorContainer) || n.removeAllRanges();
1441
1462
  return;
1442
1463
  }
1443
- const t = p.anchorNode;
1444
- if (!t) return;
1445
- if (!n.current.contains(t)) {
1446
- p.removeAllRanges();
1464
+ const x = n.anchorNode;
1465
+ if (!x) return;
1466
+ if (!t.current.contains(x)) {
1467
+ n.removeAllRanges();
1447
1468
  return;
1448
1469
  }
1449
- let N = null;
1450
- if (t.nodeType === Node.ELEMENT_NODE ? N = t.closest('[data-type="variable"]') : t.nodeType === Node.TEXT_NODE && t.parentElement && (N = t.parentElement.closest('[data-type="variable"]')), !N) {
1451
- if (Date.now() - a > 500)
1470
+ let h = null;
1471
+ if (x.nodeType === Node.ELEMENT_NODE ? h = x.closest('[data-type="variable"]') : x.nodeType === Node.TEXT_NODE && x.parentElement && (h = x.parentElement.closest('[data-type="variable"]')), !h) {
1472
+ if (Date.now() - s > 500)
1452
1473
  return;
1453
- const s = n.current.querySelectorAll('[data-type="variable"]');
1454
- if (s.length > 0) {
1455
- let k = null;
1456
- for (const d of Array.from(s))
1457
- if (d.style.display !== "none") {
1458
- k = d;
1474
+ const v = t.current.querySelectorAll('[data-type="variable"]');
1475
+ if (v.length > 0) {
1476
+ let $ = null;
1477
+ for (const g of Array.from(v))
1478
+ if (g.style.display !== "none") {
1479
+ $ = g;
1459
1480
  break;
1460
1481
  }
1461
- if (!k && s.length > 0 && (k = s[0]), k) {
1462
- const d = document.createRange();
1463
- d.selectNodeContents(k), d.collapse(!1), p.removeAllRanges(), p.addRange(d), k.focus();
1482
+ if (!$ && v.length > 0 && ($ = v[0]), $) {
1483
+ const g = document.createRange();
1484
+ g.selectNodeContents($), g.collapse(!1), n.removeAllRanges(), n.addRange(g), $.focus();
1464
1485
  } else
1465
- p.removeAllRanges();
1486
+ n.removeAllRanges();
1466
1487
  } else
1467
- p.removeAllRanges();
1488
+ n.removeAllRanges();
1468
1489
  }
1490
+ }, C = t.current;
1491
+ return C && (C.addEventListener("compositionstart", e), C.addEventListener("compositionend", a), C.addEventListener("input", N)), document.addEventListener("mousedown", l), document.addEventListener("mouseup", f), document.addEventListener("selectionchange", d), () => {
1492
+ const n = t.current;
1493
+ n && (n.removeEventListener("compositionstart", e), n.removeEventListener("compositionend", a), n.removeEventListener("input", N)), document.removeEventListener("mousedown", l), document.removeEventListener("mouseup", f), document.removeEventListener("selectionchange", d);
1469
1494
  };
1470
- return document.addEventListener("mousedown", o), document.addEventListener("mouseup", h), document.addEventListener("selectionchange", q), () => {
1471
- document.removeEventListener("mousedown", o), document.removeEventListener("mouseup", h), document.removeEventListener("selectionchange", q);
1472
- };
1473
- }, [n, m]);
1495
+ }, [t, p]);
1474
1496
  }
1475
- const ut = ({
1476
- config: n,
1477
- onSend: m,
1497
+ const ht = ({
1498
+ config: t,
1499
+ onSend: p,
1478
1500
  isProcessing: c = !1,
1479
- disabled: a = !1,
1480
- width: o,
1481
- lockStructure: h = !1,
1482
- agentOptions: q = [],
1483
- onAgentSelect: p,
1484
- loading: e = !1
1501
+ disabled: s = !1,
1502
+ width: l,
1503
+ lockStructure: f = !1,
1504
+ agentOptions: T = [],
1505
+ onAgentSelect: y,
1506
+ onAgentExit: e,
1507
+ loading: a = !1,
1508
+ placeholder: N,
1509
+ border: d,
1510
+ background: C = "transparent"
1485
1511
  }) => {
1486
- const t = W(null), N = W(null), [s, k] = z({}), [d, R] = z(null), [v, x] = z(null), w = W(!1), A = W(null), [$, S] = z(!1), C = W(null), [O, I] = z(() => {
1512
+ const n = Y(null), S = Y(null), [x, h] = z({}), [v, $] = z(null), [g, k] = z(null), w = Y(!1), L = Y(null), [O, M] = z(!1), P = Y(null), [W, D] = z(!0), [X, Z] = z(() => {
1487
1513
  const r = {};
1488
- return n.forEach((i) => {
1489
- i.type === "multi-variable" && i.key && (r[i.key] = 1);
1514
+ return t.forEach((o) => {
1515
+ o.type === "multi-variable" && o.key && (r[o.key] = 1);
1490
1516
  }), r;
1491
1517
  });
1492
- J(() => {
1493
- I((r) => {
1494
- const i = {};
1495
- return n.forEach((y) => {
1496
- y.type === "multi-variable" && y.key && (i[y.key] = r[y.key] || 1);
1497
- }), i;
1518
+ te(() => {
1519
+ Z((r) => {
1520
+ const o = {};
1521
+ return t.forEach((m) => {
1522
+ m.type === "multi-variable" && m.key && (o[m.key] = r[m.key] || 1);
1523
+ }), o;
1498
1524
  });
1499
- }, [n]), rt(t, n, s, h, O, C), at(t, n, s, x), ot(t, n, x), lt(t, n, s, x), st(t, n, x), it(t, n, s, S), ct(t, w);
1500
- const D = (r) => {
1501
- if (a) {
1525
+ }, [t]), ct(n, t, x, f, X, P), ut(n, t, x, k), dt(n, t, k), ft(n, t, x, k), pt(n, t, k), mt(n, t, x, M), yt(n, w), te(() => {
1526
+ if (t.length > 0) {
1527
+ D(!1);
1528
+ return;
1529
+ }
1530
+ const r = () => {
1531
+ if (!n.current) {
1532
+ D(!0);
1533
+ return;
1534
+ }
1535
+ const m = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", q = n.current.querySelectorAll('[data-type="variable"]'), b = n.current.querySelectorAll('[data-type="upload"]');
1536
+ let R = !1;
1537
+ q.forEach((V) => {
1538
+ (V.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (R = !0);
1539
+ }), b.forEach((V) => {
1540
+ V.querySelector(".upload-inner-wrapper.has-file") && (R = !0);
1541
+ });
1542
+ const A = !m && !R;
1543
+ D(A), t.length === 0 && M(!A);
1544
+ };
1545
+ r();
1546
+ const o = new MutationObserver(r);
1547
+ return n.current && o.observe(n.current, {
1548
+ childList: !0,
1549
+ subtree: !0,
1550
+ characterData: !0
1551
+ }), () => {
1552
+ o.disconnect();
1553
+ };
1554
+ }, [t]);
1555
+ const E = (r) => {
1556
+ if (s) {
1502
1557
  r.preventDefault();
1503
1558
  return;
1504
1559
  }
1505
1560
  r.preventDefault();
1506
- const i = r.clipboardData.getData("text/plain"), y = window.getSelection();
1507
- if (y && y.rangeCount > 0) {
1508
- const T = y.anchorNode;
1509
- if (T) {
1510
- let g = null;
1511
- if (T.nodeType === Node.ELEMENT_NODE ? g = T.closest('[data-type="variable"]') : T.nodeType === Node.TEXT_NODE && T.parentElement && (g = T.parentElement.closest('[data-type="variable"]')), g) {
1512
- const L = g.dataset.multiKey;
1513
- if (L) {
1514
- const f = i.split(/[,\n\r\t]+/).map((b) => b.trim()).filter((b) => b.length > 0);
1515
- if (f.length > 1) {
1516
- const b = parseInt(g.dataset.index || "0", 10), V = n.find((ee) => ee.type === "multi-variable" && ee.key === L)?.maxCount || 9, j = O[L] || 1, Y = Math.min(b + f.length, V);
1517
- Y > j && I((U) => ({
1518
- ...U,
1519
- [L]: Y
1561
+ const o = r.clipboardData.getData("text/plain"), m = window.getSelection();
1562
+ if (m && m.rangeCount > 0) {
1563
+ const q = m.anchorNode;
1564
+ if (q) {
1565
+ let b = null;
1566
+ if (q.nodeType === Node.ELEMENT_NODE ? b = q.closest('[data-type="variable"]') : q.nodeType === Node.TEXT_NODE && q.parentElement && (b = q.parentElement.closest('[data-type="variable"]')), b) {
1567
+ const R = b.dataset.multiKey;
1568
+ if (R) {
1569
+ const A = o.split(/[,\n\r\t]+/).map((V) => V.trim()).filter((V) => V.length > 0);
1570
+ if (A.length > 1) {
1571
+ const V = parseInt(b.dataset.index || "0", 10), j = t.find((re) => re.type === "multi-variable" && re.key === R)?.maxCount || 9, G = X[R] || 1, ne = Math.min(V + A.length, j);
1572
+ ne > G && Z((Q) => ({
1573
+ ...Q,
1574
+ [R]: ne
1520
1575
  })), setTimeout(() => {
1521
- t.current && (f.forEach((U, ee) => {
1522
- const te = b + ee;
1523
- if (te >= V) return;
1524
- const M = `${L}_${te}`, Z = t.current.querySelector(
1525
- `[data-type="variable"][data-key="${M}"]`
1576
+ n.current && (A.forEach((Q, re) => {
1577
+ const oe = V + re;
1578
+ if (oe >= j) return;
1579
+ const H = `${R}_${oe}`, ae = n.current.querySelector(
1580
+ `[data-type="variable"][data-key="${H}"]`
1526
1581
  );
1527
- Z && (Z.innerText = U, Z.classList.remove("show-placeholder"));
1528
- }), F());
1582
+ ae && (ae.innerText = Q, ae.classList.remove("show-placeholder"));
1583
+ }), B());
1529
1584
  }, 0);
1530
1585
  return;
1531
1586
  }
@@ -1533,367 +1588,398 @@ const ut = ({
1533
1588
  }
1534
1589
  }
1535
1590
  }
1536
- document.execCommand("insertText", !1, i), F();
1537
- }, P = (r) => {
1538
- if (r.target.files && r.target.files[0] && d) {
1539
- const i = r.target.files[0], y = d;
1540
- k((T) => ({ ...T, [y]: i }));
1541
- }
1542
- r.target && (r.target.value = ""), R(null);
1543
- }, H = (r) => {
1544
- k((i) => {
1545
- const y = { ...i };
1546
- return delete y[r], y;
1591
+ document.execCommand("insertText", !1, o), B();
1592
+ }, _ = (r) => {
1593
+ if (r.target.files && r.target.files[0] && v) {
1594
+ const o = r.target.files[0], m = v;
1595
+ h((q) => ({ ...q, [m]: o }));
1596
+ }
1597
+ r.target && (r.target.value = ""), $(null);
1598
+ }, K = (r) => {
1599
+ h((o) => {
1600
+ const m = { ...o };
1601
+ return delete m[r], m;
1547
1602
  });
1548
- }, G = (r) => {
1549
- const i = r.target;
1550
- if (h) {
1551
- const T = i.closest(".tag-node"), g = i.closest('[data-type="text"]');
1552
- if (T || g) {
1603
+ }, U = (r) => {
1604
+ const o = r.target;
1605
+ if (o.closest(".tag-close-btn")) {
1606
+ if (r.preventDefault(), r.stopPropagation(), f)
1607
+ return;
1608
+ k(null), e ? e() : n.current && (n.current.innerHTML = "", n.current.focus());
1609
+ return;
1610
+ }
1611
+ if (f) {
1612
+ const b = o.closest(".tag-node"), R = o.closest('[data-type="text"]');
1613
+ if (b || R) {
1553
1614
  r.preventDefault(), r.stopPropagation();
1554
- const L = window.getSelection();
1555
- L && L.removeAllRanges();
1615
+ const A = window.getSelection();
1616
+ A && A.removeAllRanges();
1556
1617
  return;
1557
1618
  }
1558
1619
  }
1559
- i.closest('[data-type="variable"]') || (A.current = { x: r.clientX, y: r.clientY }, w.current = !1, (i.closest(".tag-close-btn") || i.closest(".file-remove-btn")) && (r.preventDefault(), r.stopPropagation()));
1560
- }, K = (r) => {
1561
- if (!r.target.closest('[data-type="variable"]') && A.current) {
1562
- const T = Math.abs(r.clientX - A.current.x), g = Math.abs(r.clientY - A.current.y);
1563
- (T > 3 || g > 3) && (w.current = !0);
1620
+ o.closest('[data-type="variable"]') || (L.current = { x: r.clientX, y: r.clientY }, w.current = !1, o.closest(".file-remove-btn") && (r.preventDefault(), r.stopPropagation()));
1621
+ }, le = (r) => {
1622
+ if (!r.target.closest('[data-type="variable"]') && L.current) {
1623
+ const q = Math.abs(r.clientX - L.current.x), b = Math.abs(r.clientY - L.current.y);
1624
+ (q > 3 || b > 3) && (w.current = !0);
1564
1625
  }
1565
- }, Q = (r) => {
1626
+ }, ie = (r) => {
1566
1627
  if (r.target.closest('[data-type="variable"]')) {
1567
- A.current = null, w.current = !1;
1628
+ L.current = null, w.current = !1;
1629
+ return;
1630
+ }
1631
+ L.current = null, w.current = !1;
1632
+ }, i = (r) => {
1633
+ if (s)
1634
+ return;
1635
+ const o = r.target;
1636
+ if (o.closest(".tag-close-btn")) {
1637
+ r.preventDefault(), r.stopPropagation();
1568
1638
  return;
1569
1639
  }
1570
- A.current = null, w.current = !1;
1571
- }, E = (r) => {
1572
- if (a)
1640
+ if (t.length === 0)
1573
1641
  return;
1574
- const i = r.target;
1575
- if (i.closest('[data-type="text"]')) {
1642
+ if (o.closest('[data-type="text"]')) {
1576
1643
  r.preventDefault(), r.stopPropagation();
1577
- const f = window.getSelection();
1578
- f && f.removeAllRanges();
1644
+ const V = window.getSelection();
1645
+ V && V.removeAllRanges();
1579
1646
  return;
1580
1647
  }
1581
- if (h && i.closest(".tag-node")) {
1648
+ if (f && o.closest(".tag-node")) {
1582
1649
  r.preventDefault(), r.stopPropagation();
1583
- const b = window.getSelection();
1584
- b && b.removeAllRanges();
1650
+ const j = window.getSelection();
1651
+ j && j.removeAllRanges();
1585
1652
  return;
1586
1653
  }
1587
- if (i.closest('[data-type="variable"]')) {
1654
+ if (o.closest('[data-type="variable"]')) {
1588
1655
  if (w.current)
1589
1656
  return;
1590
1657
  setTimeout(() => {
1591
- const f = window.getSelection();
1592
- f && !f.isCollapsed || fe(t);
1658
+ const V = window.getSelection();
1659
+ V && !V.isCollapsed || be(n);
1593
1660
  }, 10);
1594
1661
  return;
1595
1662
  }
1596
- if (i.closest(".tag-close-btn")) {
1597
- if (h) {
1598
- r.preventDefault(), r.stopPropagation();
1599
- return;
1600
- }
1601
- r.preventDefault(), r.stopPropagation(), x(null), t.current && (t.current.innerHTML = "", t.current.focus());
1602
- return;
1603
- }
1604
- const g = i.closest(".file-remove-btn");
1605
- if (g) {
1663
+ const R = o.closest(".file-remove-btn");
1664
+ if (R) {
1606
1665
  r.preventDefault(), r.stopPropagation();
1607
- const b = g.closest('[data-type="upload"]')?.dataset.key;
1608
- b && H(b);
1666
+ const j = R.closest('[data-type="upload"]')?.dataset.key;
1667
+ j && K(j);
1609
1668
  return;
1610
1669
  }
1611
- const L = i.closest('[data-type="upload"]');
1612
- if (L) {
1613
- const f = L.dataset.key;
1614
- f && (R(f), N.current?.click());
1670
+ const A = o.closest('[data-type="upload"]');
1671
+ if (A) {
1672
+ const V = A.dataset.key;
1673
+ V && ($(V), S.current?.click());
1615
1674
  return;
1616
1675
  }
1617
- }, _ = (r) => {
1618
- const y = r.target.closest('[data-type="variable"]');
1619
- if (y) {
1620
- const T = window.getSelection();
1621
- if (T) {
1622
- const g = document.createRange(), L = y.textContent || "";
1623
- if (L.replace(/\u200B/g, "")) {
1624
- let b = 0, V = L.length;
1625
- L.startsWith("​") && (b = 1), L.endsWith("​") && L.length > 1 && (V = L.length - 1);
1626
- const j = y.firstChild;
1627
- j && j.nodeType === Node.TEXT_NODE ? (g.setStart(j, b), g.setEnd(j, V)) : g.selectNodeContents(y);
1676
+ }, I = (r) => {
1677
+ const m = r.target.closest('[data-type="variable"]');
1678
+ if (m) {
1679
+ const q = window.getSelection();
1680
+ if (q) {
1681
+ const b = document.createRange(), R = m.textContent || "";
1682
+ if (R.replace(/\u200B/g, "")) {
1683
+ let V = 0, j = R.length;
1684
+ R.startsWith("​") && (V = 1), R.endsWith("​") && R.length > 1 && (j = R.length - 1);
1685
+ const G = m.firstChild;
1686
+ G && G.nodeType === Node.TEXT_NODE ? (b.setStart(G, V), b.setEnd(G, j)) : b.selectNodeContents(m);
1628
1687
  } else
1629
- g.selectNodeContents(y), g.collapse(!0);
1630
- T.removeAllRanges(), T.addRange(g);
1688
+ b.selectNodeContents(m), b.collapse(!0);
1689
+ q.removeAllRanges(), q.addRange(b);
1631
1690
  }
1632
1691
  }
1633
- }, F = () => {
1634
- if (fe(t), t.current && t.current.querySelectorAll('[data-type="variable"]').forEach((y) => {
1635
- const T = y.querySelector(".variable-info-icon");
1636
- if (T) {
1637
- let g = !1;
1638
- const L = document.createTreeWalker(
1639
- y,
1692
+ }, B = () => {
1693
+ if (t.length === 0) {
1694
+ if (n.current) {
1695
+ const m = !(n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "");
1696
+ D(m), M(!m);
1697
+ }
1698
+ return;
1699
+ }
1700
+ if (be(n), n.current && n.current.querySelectorAll('[data-type="variable"]').forEach((m) => {
1701
+ const q = m.querySelector(".variable-info-icon");
1702
+ if (q) {
1703
+ let b = !1;
1704
+ const R = document.createTreeWalker(
1705
+ m,
1640
1706
  NodeFilter.SHOW_TEXT,
1641
1707
  {
1642
- acceptNode: (f) => T.contains(f) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
1708
+ acceptNode: (A) => q.contains(A) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
1643
1709
  }
1644
1710
  );
1645
- for (; L.nextNode(); )
1646
- if (L.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
1647
- g = !0;
1711
+ for (; R.nextNode(); )
1712
+ if (R.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
1713
+ b = !0;
1648
1714
  break;
1649
1715
  }
1650
- g ? T.classList.add("hidden") : T.classList.remove("hidden");
1716
+ b ? q.classList.add("hidden") : q.classList.remove("hidden");
1651
1717
  }
1652
- }), me(t, n, s), ye(t, n, s, S), !t.current) return;
1653
- n.filter((i) => i.type === "multi-variable" && i.key).forEach((i) => {
1654
- if (!i.key) return;
1655
- const y = i.maxCount || 9, T = O[i.key] || 1, g = [];
1656
- for (let j = 0; j < T; j++) {
1657
- const Y = `${i.key}_${j}`, U = t.current.querySelector(
1658
- `[data-type="variable"][data-key="${Y}"][data-multi-key="${i.key}"]`
1718
+ }), ve(n, t, x), we(n, t, x, M), !n.current) return;
1719
+ t.filter((o) => o.type === "multi-variable" && o.key).forEach((o) => {
1720
+ if (!o.key) return;
1721
+ const m = o.maxCount || 9, q = X[o.key] || 1, b = [];
1722
+ for (let G = 0; G < q; G++) {
1723
+ const ne = `${o.key}_${G}`, Q = n.current.querySelector(
1724
+ `[data-type="variable"][data-key="${ne}"][data-multi-key="${o.key}"]`
1659
1725
  );
1660
- if (U) {
1661
- const ee = U.innerText.replace(/[\u200B\n]/g, "").trim();
1662
- g.push(ee);
1726
+ if (Q) {
1727
+ const re = Q.innerText.replace(/[\u200B\n]/g, "").trim();
1728
+ b.push(re);
1663
1729
  }
1664
1730
  }
1665
- const f = (g[g.length - 1] || "") === "";
1666
- let b = !1, V = -1;
1667
- for (let j = 0; j < g.length - 1; j++)
1668
- if (g[j] === "") {
1669
- b = !0, V = j;
1731
+ const A = (b[b.length - 1] || "") === "";
1732
+ let V = !1, j = -1;
1733
+ for (let G = 0; G < b.length - 1; G++)
1734
+ if (b[G] === "") {
1735
+ V = !0, j = G;
1670
1736
  break;
1671
1737
  }
1672
- if (b && V >= 0) {
1673
- const j = window.getSelection();
1674
- if (j && j.rangeCount > 0) {
1675
- const M = j.getRangeAt(0), Z = M.startContainer, ae = Z.nodeType === Node.ELEMENT_NODE ? Z.closest('[data-type="variable"][data-multi-key]') : Z.parentElement?.closest('[data-type="variable"][data-multi-key]');
1676
- if (ae) {
1677
- const oe = ae.dataset.key;
1678
- if (oe) {
1679
- const se = document.createRange();
1680
- se.setStartBefore(ae), se.setEnd(M.startContainer, M.startOffset);
1681
- const pe = se.toString().length;
1682
- C.current = { key: oe, offset: pe };
1738
+ if (V && j >= 0) {
1739
+ const G = window.getSelection();
1740
+ if (G && G.rangeCount > 0) {
1741
+ const H = G.getRangeAt(0), ae = H.startContainer, ce = ae.nodeType === Node.ELEMENT_NODE ? ae.closest('[data-type="variable"][data-multi-key]') : ae.parentElement?.closest('[data-type="variable"][data-multi-key]');
1742
+ if (ce) {
1743
+ const ue = ce.dataset.key;
1744
+ if (ue) {
1745
+ const pe = document.createRange();
1746
+ pe.setStartBefore(ce), pe.setEnd(H.startContainer, H.startOffset);
1747
+ const xe = pe.toString().length;
1748
+ P.current = { key: ue, offset: xe };
1683
1749
  }
1684
1750
  }
1685
1751
  }
1686
- const Y = [...g];
1687
- for (let M = V; M < Y.length - 1; M++)
1688
- Y[M] = Y[M + 1];
1689
- Y.pop();
1690
- const U = {};
1691
- Y.forEach((M, Z) => {
1692
- M && (U[`${i.key}_${Z}`] = M);
1752
+ const ne = [...b];
1753
+ for (let H = j; H < ne.length - 1; H++)
1754
+ ne[H] = ne[H + 1];
1755
+ ne.pop();
1756
+ const Q = {};
1757
+ ne.forEach((H, ae) => {
1758
+ H && (Q[`${o.key}_${ae}`] = H);
1693
1759
  });
1694
- const ee = Math.max(f ? Y.length : Y.length + 1, 1);
1695
- t.current.querySelectorAll(
1760
+ const re = Math.max(A ? ne.length : ne.length + 1, 1);
1761
+ n.current.querySelectorAll(
1696
1762
  '[data-type="variable"]'
1697
- ).forEach((M) => {
1698
- const Z = M.dataset.key, ae = M.dataset.multiKey;
1699
- if (Z && ae !== i.key) {
1700
- const oe = M.innerText.replace(/[\u200B\n]/g, "").trim();
1701
- oe && (U[Z] = oe);
1763
+ ).forEach((H) => {
1764
+ const ae = H.dataset.key, ce = H.dataset.multiKey;
1765
+ if (ae && ce !== o.key) {
1766
+ const ue = H.innerText.replace(/[\u200B\n]/g, "").trim();
1767
+ ue && (Q[ae] = ue);
1702
1768
  }
1703
- }), t.current.__tempVariableValues = U, I((M) => ({
1704
- ...M,
1705
- [i.key]: ee
1769
+ }), n.current.__tempVariableValues = Q, Z((H) => ({
1770
+ ...H,
1771
+ [o.key]: re
1706
1772
  }));
1707
1773
  return;
1708
1774
  }
1709
- if (!f) {
1710
- const j = T - 1, Y = `${i.key}_${j}`, U = t.current.querySelector(
1711
- `[data-type="variable"][data-key="${Y}"][data-multi-key="${i.key}"]`
1775
+ if (!A) {
1776
+ const G = q - 1, ne = `${o.key}_${G}`, Q = n.current.querySelector(
1777
+ `[data-type="variable"][data-key="${ne}"][data-multi-key="${o.key}"]`
1712
1778
  );
1713
- if (U && U.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && T < y) {
1714
- const te = window.getSelection();
1715
- if (te && te.rangeCount > 0) {
1716
- const M = te.getRangeAt(0), Z = M.startContainer, ae = Z.nodeType === Node.ELEMENT_NODE ? Z.closest('[data-type="variable"][data-multi-key]') : Z.parentElement?.closest('[data-type="variable"][data-multi-key]');
1717
- if (ae) {
1718
- const oe = ae.dataset.key;
1719
- if (oe) {
1720
- const se = document.createRange();
1721
- se.setStartBefore(ae), se.setEnd(M.startContainer, M.startOffset);
1722
- const pe = se.toString().length;
1723
- C.current = { key: oe, offset: pe };
1779
+ if (Q && Q.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && q < m) {
1780
+ const oe = window.getSelection();
1781
+ if (oe && oe.rangeCount > 0) {
1782
+ const H = oe.getRangeAt(0), ae = H.startContainer, ce = ae.nodeType === Node.ELEMENT_NODE ? ae.closest('[data-type="variable"][data-multi-key]') : ae.parentElement?.closest('[data-type="variable"][data-multi-key]');
1783
+ if (ce) {
1784
+ const ue = ce.dataset.key;
1785
+ if (ue) {
1786
+ const pe = document.createRange();
1787
+ pe.setStartBefore(ce), pe.setEnd(H.startContainer, H.startOffset);
1788
+ const xe = pe.toString().length;
1789
+ P.current = { key: ue, offset: xe };
1724
1790
  }
1725
1791
  }
1726
1792
  }
1727
- I((M) => ({
1728
- ...M,
1729
- [i.key]: T + 1
1793
+ Z((H) => ({
1794
+ ...H,
1795
+ [o.key]: q + 1
1730
1796
  }));
1731
1797
  }
1732
1798
  }
1733
1799
  });
1734
- }, X = () => {
1735
- t.current && (fe(t), me(t, n, s), ye(t, n, s, S));
1736
- }, ne = (r) => {
1737
- if (a) {
1800
+ }, J = () => {
1801
+ if (n.current) {
1802
+ if (t.length === 0) {
1803
+ const r = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
1804
+ M(r.length > 0);
1805
+ return;
1806
+ }
1807
+ be(n), ve(n, t, x), we(n, t, x, M);
1808
+ }
1809
+ }, se = (r) => {
1810
+ if (s) {
1738
1811
  r.preventDefault();
1739
1812
  return;
1740
1813
  }
1741
- const i = window.getSelection();
1742
- if (i && i.rangeCount > 0) {
1743
- const y = i.anchorNode;
1744
- let T = null;
1745
- if (y && (y.nodeType === Node.ELEMENT_NODE ? T = y.closest('[data-type="text"]') : y.nodeType === Node.TEXT_NODE && y.parentElement && (T = y.parentElement.closest('[data-type="text"]'))), T) {
1746
- if (r.preventDefault(), r.stopPropagation(), t.current) {
1747
- const g = t.current.querySelector(
1814
+ const o = window.getSelection();
1815
+ if (o && o.rangeCount > 0) {
1816
+ const m = o.anchorNode;
1817
+ let q = null;
1818
+ if (m && (m.nodeType === Node.ELEMENT_NODE ? q = m.closest('[data-type="text"]') : m.nodeType === Node.TEXT_NODE && m.parentElement && (q = m.parentElement.closest('[data-type="text"]'))), q) {
1819
+ if (r.preventDefault(), r.stopPropagation(), n.current) {
1820
+ const b = n.current.querySelector(
1748
1821
  '[data-type="variable"], [data-type="upload"]'
1749
1822
  );
1750
- g && g.focus();
1823
+ b && b.focus();
1751
1824
  }
1752
1825
  return;
1753
1826
  }
1754
1827
  }
1755
- if (h && i && i.rangeCount > 0) {
1756
- const y = i.anchorNode;
1757
- let T = null;
1758
- if (y && (y.nodeType === Node.ELEMENT_NODE ? T = y.closest(".tag-node") : y.nodeType === Node.TEXT_NODE && y.parentElement && (T = y.parentElement.closest(".tag-node"))), T) {
1759
- if (r.preventDefault(), r.stopPropagation(), t.current) {
1760
- const g = t.current.querySelector(
1828
+ if (f && o && o.rangeCount > 0) {
1829
+ const m = o.anchorNode;
1830
+ let q = null;
1831
+ if (m && (m.nodeType === Node.ELEMENT_NODE ? q = m.closest(".tag-node") : m.nodeType === Node.TEXT_NODE && m.parentElement && (q = m.parentElement.closest(".tag-node"))), q) {
1832
+ if (r.preventDefault(), r.stopPropagation(), n.current) {
1833
+ const b = n.current.querySelector(
1761
1834
  '[data-type="variable"], [data-type="upload"]'
1762
1835
  );
1763
- g && g.focus();
1836
+ b && b.focus();
1764
1837
  }
1765
1838
  return;
1766
1839
  }
1767
1840
  }
1768
- if (r.key === "Enter" && !r.shiftKey && (r.preventDefault(), re()), r.key === "Escape" && t.current) {
1769
- if (h) {
1841
+ if (r.key === "Enter" && !r.shiftKey && (r.preventDefault(), ee()), r.key === "Escape" && n.current) {
1842
+ if (f) {
1770
1843
  r.preventDefault();
1771
1844
  return;
1772
1845
  }
1773
- t.current.innerHTML = "", t.current.focus();
1846
+ n.current.innerHTML = "", n.current.focus();
1774
1847
  }
1775
1848
  if (r.key === "Backspace") {
1776
- const y = window.getSelection();
1777
- if (y && y.rangeCount > 0) {
1778
- const T = y.getRangeAt(0), g = y.anchorNode;
1779
- if (h) {
1780
- let f = null, b = null;
1781
- if (g && (g.nodeType === Node.ELEMENT_NODE ? (f = g.closest(".tag-node"), b = g.closest('[data-type="text"]')) : g.nodeType === Node.TEXT_NODE && g.parentElement && (f = g.parentElement.closest(".tag-node"), b = g.parentElement.closest('[data-type="text"]'))), (f || b) && T.collapsed && T.startOffset === 0) {
1849
+ const m = window.getSelection();
1850
+ if (m && m.rangeCount > 0) {
1851
+ const q = m.getRangeAt(0), b = m.anchorNode;
1852
+ if (f) {
1853
+ let A = null, V = null;
1854
+ if (b && (b.nodeType === Node.ELEMENT_NODE ? (A = b.closest(".tag-node"), V = b.closest('[data-type="text"]')) : b.nodeType === Node.TEXT_NODE && b.parentElement && (A = b.parentElement.closest(".tag-node"), V = b.parentElement.closest('[data-type="text"]'))), (A || V) && q.collapsed && q.startOffset === 0) {
1782
1855
  r.preventDefault();
1783
1856
  return;
1784
1857
  }
1785
1858
  }
1786
- let L = null;
1787
- if (g && (g.nodeType === Node.ELEMENT_NODE ? L = g.closest(
1859
+ let R = null;
1860
+ if (b && (b.nodeType === Node.ELEMENT_NODE ? R = b.closest(
1788
1861
  '[data-type="variable"]'
1789
- ) : g.nodeType === Node.TEXT_NODE && g.parentElement && (L = g.parentElement.closest(
1862
+ ) : b.nodeType === Node.TEXT_NODE && b.parentElement && (R = b.parentElement.closest(
1790
1863
  '[data-type="variable"]'
1791
- ))), L) {
1792
- if (!T.collapsed)
1864
+ ))), R) {
1865
+ if (!q.collapsed)
1793
1866
  return;
1794
- const f = L.innerText;
1795
- if (f === "​" || f === "") {
1867
+ const A = R.innerText;
1868
+ if (A === "​" || A === "") {
1796
1869
  r.preventDefault();
1797
1870
  return;
1798
1871
  }
1799
- if (T.startOffset === 0) {
1872
+ if (q.startOffset === 0) {
1800
1873
  r.preventDefault();
1801
1874
  return;
1802
1875
  }
1803
- if (f.startsWith("​") && T.startOffset === 1) {
1876
+ if (A.startsWith("​") && q.startOffset === 1) {
1804
1877
  r.preventDefault();
1805
1878
  return;
1806
1879
  }
1807
1880
  }
1808
1881
  }
1809
1882
  }
1810
- }, re = () => {
1811
- if (c || a || e || !$ || !t.current) return;
1812
- const r = t.current;
1813
- let i = "";
1814
- const y = {}, T = (f) => {
1815
- if (!(f.nodeType === Node.ELEMENT_NODE && f.style.display === "none")) {
1816
- if (f.nodeType === Node.TEXT_NODE)
1817
- i += (f.textContent || "").replace(/\u200B/g, "");
1818
- else if (f.nodeType === Node.ELEMENT_NODE) {
1819
- const b = f, V = b.dataset.type, j = b.dataset.key;
1883
+ }, ee = () => {
1884
+ if (c || s || a || !O || !n.current) return;
1885
+ if (t.length === 0) {
1886
+ const R = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
1887
+ if (!R) return;
1888
+ p(R, R);
1889
+ return;
1890
+ }
1891
+ const r = n.current;
1892
+ let o = "";
1893
+ const m = {}, q = (R) => {
1894
+ if (!(R.nodeType === Node.ELEMENT_NODE && R.style.display === "none")) {
1895
+ if (R.nodeType === Node.TEXT_NODE)
1896
+ o += (R.textContent || "").replace(/\u200B/g, "");
1897
+ else if (R.nodeType === Node.ELEMENT_NODE) {
1898
+ const A = R, V = A.dataset.type, j = A.dataset.key;
1820
1899
  if (V === "variable" && j) {
1821
- let Y = "";
1822
- const U = document.createTreeWalker(
1823
- b,
1900
+ let G = "";
1901
+ const ne = document.createTreeWalker(
1902
+ A,
1824
1903
  NodeFilter.SHOW_TEXT,
1825
1904
  {
1826
- acceptNode: (te) => {
1827
- const M = b.querySelector(".variable-info-icon");
1828
- return M && M.contains(te) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
1905
+ acceptNode: (re) => {
1906
+ const oe = A.querySelector(".variable-info-icon");
1907
+ return oe && oe.contains(re) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
1829
1908
  }
1830
1909
  }
1831
1910
  );
1832
- for (; U.nextNode(); )
1833
- Y += U.currentNode.textContent || "";
1834
- const ee = Y.replace(/[\u200B\n]/g, "").trim();
1835
- if (ee) {
1836
- const te = b.dataset.multiKey;
1837
- if (te) {
1838
- y[te] || (y[te] = []);
1839
- const M = y[te];
1840
- M.push(ee), M.length > 1 && (i += " "), i += ee;
1911
+ for (; ne.nextNode(); )
1912
+ G += ne.currentNode.textContent || "";
1913
+ const Q = G.replace(/[\u200B\n]/g, "").trim();
1914
+ if (Q) {
1915
+ const re = A.dataset.multiKey;
1916
+ if (re) {
1917
+ m[re] || (m[re] = []);
1918
+ const oe = m[re];
1919
+ oe.push(Q), oe.length > 1 && (o += " "), o += Q;
1841
1920
  } else
1842
- y[j] = ee, i += ee;
1921
+ m[j] = Q, o += Q;
1843
1922
  }
1844
1923
  } else if (V === "upload" && j)
1845
- y[j] = s[j] ?? null, s[j] && (i += ` [附带文件: ${s[j]?.name}] `);
1924
+ m[j] = x[j] ?? null, x[j] && (o += ` [附带文件: ${x[j]?.name}] `);
1846
1925
  else {
1847
- if (b.classList.contains("tag-close-btn") || b.classList.contains("file-remove-btn")) return;
1848
- b.getAttribute("contenteditable") === "false" && !V && b.classList.contains("tag-node") ? i += b.innerText : b.childNodes.forEach(T);
1926
+ if (A.classList.contains("tag-close-btn") || A.classList.contains("file-remove-btn")) return;
1927
+ A.getAttribute("contenteditable") === "false" && !V && A.classList.contains("tag-node") ? o += A.innerText : A.childNodes.forEach(q);
1849
1928
  }
1850
1929
  }
1851
1930
  }
1852
1931
  };
1853
- if (r.childNodes.forEach(T), i = i.trim(), !i) return;
1854
- const g = new FormData();
1855
- g.append("fullPrompt", i), Object.keys(y).forEach((f) => {
1856
- const b = y[f];
1857
- b != null && (b instanceof File ? g.append(f, b) : Array.isArray(b) ? b.forEach((V, j) => {
1858
- V != null && (V instanceof File ? g.append(`${f}[${j}]`, V) : typeof V == "string" ? g.append(`${f}[${j}]`, V) : g.append(`${f}[${j}]`, String(V)));
1859
- }) : typeof b == "string" ? g.append(f, b) : g.append(f, String(b)));
1860
- }), console.log("dataPayload:", y);
1861
- const L = Array.from(g.keys());
1862
- console.log("FormData keys:", L), m(g, i);
1863
- }, l = o ? { width: typeof o == "number" ? `${o}px` : o } : {};
1932
+ if (r.childNodes.forEach(q), o = o.trim(), !o) return;
1933
+ const b = new FormData();
1934
+ b.append("fullPrompt", o), Object.keys(m).forEach((R) => {
1935
+ const A = m[R];
1936
+ A != null && (A instanceof File ? b.append(R, A) : Array.isArray(A) ? t.some(
1937
+ (j) => j.type === "multi-variable" && j.key === R
1938
+ ) ? A.forEach((j) => {
1939
+ j != null && j !== "" && b.append(R, String(j));
1940
+ }) : A.forEach((j, G) => {
1941
+ j != null && (j instanceof File ? b.append(`${R}[${G}]`, j) : typeof j == "string" ? b.append(`${R}[${G}]`, j) : b.append(`${R}[${G}]`, String(j)));
1942
+ }) : typeof A == "string" ? b.append(R, A) : b.append(R, String(A)));
1943
+ }), p(b, o);
1944
+ }, de = {
1945
+ ...l ? { width: typeof l == "number" ? `${l}px` : l } : {},
1946
+ ...d ? { border: d } : {},
1947
+ ...C ? { background: C } : {}
1948
+ };
1864
1949
  return /* @__PURE__ */ u.jsxs(
1865
1950
  "div",
1866
1951
  {
1867
1952
  className: "rich-text-editor",
1868
- style: l,
1869
- "data-disabled": a,
1953
+ style: de,
1954
+ "data-disabled": s,
1870
1955
  children: [
1871
1956
  /* @__PURE__ */ u.jsx(
1872
1957
  "div",
1873
1958
  {
1874
- ref: t,
1875
- className: "rte-editor",
1876
- contentEditable: !1,
1959
+ ref: n,
1960
+ className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${W && N ? "rte-editor-empty" : ""}`,
1961
+ contentEditable: t.length === 0,
1877
1962
  suppressContentEditableWarning: !0,
1878
- onMouseDown: G,
1879
- onMouseMove: K,
1880
- onMouseUp: Q,
1881
- onClick: E,
1882
- onDoubleClick: _,
1883
- onInput: F,
1884
- onKeyDown: ne,
1885
- onPaste: D,
1886
- onBlur: X
1963
+ "data-placeholder": N,
1964
+ onMouseDown: U,
1965
+ onMouseMove: le,
1966
+ onMouseUp: ie,
1967
+ onClick: i,
1968
+ onDoubleClick: I,
1969
+ onInput: B,
1970
+ onKeyDown: se,
1971
+ onPaste: E,
1972
+ onBlur: J
1887
1973
  }
1888
1974
  ),
1889
1975
  /* @__PURE__ */ u.jsx(
1890
1976
  "input",
1891
1977
  {
1892
1978
  type: "file",
1893
- ref: N,
1979
+ ref: S,
1894
1980
  className: "rte-file-input",
1895
1981
  accept: ".csv,.xlsx,.xls,.txt,.pdf,image/*",
1896
- onChange: P
1982
+ onChange: _
1897
1983
  }
1898
1984
  ),
1899
1985
  /* @__PURE__ */ u.jsxs("div", { className: "rich-text-editor-footer", children: [
@@ -1903,24 +1989,24 @@ const ut = ({
1903
1989
  /* @__PURE__ */ u.jsx("span", { className: "rte-brand-text", children: "SealSeek 1.0" })
1904
1990
  ] }),
1905
1991
  /* @__PURE__ */ u.jsx(
1906
- Ae,
1992
+ Oe,
1907
1993
  {
1908
1994
  placement: "top",
1909
1995
  menu: {
1910
- items: q.map((r) => ({
1996
+ items: T.map((r) => ({
1911
1997
  key: r.key,
1912
1998
  label: /* @__PURE__ */ u.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
1913
1999
  r.icon && /* @__PURE__ */ u.jsx("i", { className: r.icon }),
1914
2000
  /* @__PURE__ */ u.jsx("span", { children: r.label })
1915
2001
  ] }),
1916
2002
  onClick: () => {
1917
- p?.(r);
2003
+ y?.(r);
1918
2004
  }
1919
2005
  }))
1920
2006
  },
1921
2007
  trigger: ["click"],
1922
- disabled: a || c,
1923
- children: /* @__PURE__ */ u.jsxs("div", { className: "rte-agent-badge", style: { cursor: q.length > 0 ? "pointer" : "default" }, children: [
2008
+ disabled: s || c,
2009
+ children: /* @__PURE__ */ u.jsxs("div", { className: "rte-agent-badge", style: { cursor: T.length > 0 ? "pointer" : "default" }, children: [
1924
2010
  /* @__PURE__ */ u.jsx("i", { className: "iconfont icon-zhinengti" }),
1925
2011
  /* @__PURE__ */ u.jsx("span", { className: "rte-agent-text", children: "智能体" })
1926
2012
  ] })
@@ -1931,22 +2017,22 @@ const ut = ({
1931
2017
  "button",
1932
2018
  {
1933
2019
  type: "button",
1934
- onClick: re,
1935
- disabled: c || a || e || !$,
2020
+ onClick: ee,
2021
+ disabled: c || s || a || !O,
1936
2022
  className: "rich-text-editor-send-button",
1937
- children: c || e ? /* @__PURE__ */ u.jsx("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ u.jsx("i", { className: "iconfont icon-fasong" })
2023
+ children: c || a ? /* @__PURE__ */ u.jsx("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ u.jsx("i", { className: "iconfont icon-fasong" })
1938
2024
  }
1939
2025
  )
1940
2026
  ] }),
1941
- v?.anchorEl && (() => {
1942
- if (!document.body.contains(v.anchorEl))
2027
+ g?.anchorEl && (() => {
2028
+ if (!document.body.contains(g.anchorEl))
1943
2029
  return null;
1944
2030
  let r = "";
1945
- return v.type === "upload" ? r = n.find(
1946
- (y) => y.type === "upload" && y.key === v.key
1947
- )?.tooltip || "" : v.type === "tag" ? r = v.anchorEl.dataset.tooltip || "" : v.type === "upload-label" ? r = v.anchorEl.dataset.fileName || "" : v.type === "variable" && (r = v.anchorEl.dataset.tooltip || ""), Ge(
2031
+ return g.type === "upload" ? r = t.find(
2032
+ (m) => m.type === "upload" && m.key === g.key
2033
+ )?.tooltip || "" : g.type === "tag" ? r = g.anchorEl.dataset.tooltip || "" : g.type === "upload-label" ? r = g.anchorEl.dataset.fileName || "" : g.type === "variable" && (r = g.anchorEl.dataset.tooltip || ""), Xe(
1948
2034
  /* @__PURE__ */ u.jsx(
1949
- _e,
2035
+ Me,
1950
2036
  {
1951
2037
  arrow: !1,
1952
2038
  title: /* @__PURE__ */ u.jsx("div", { style: { maxWidth: "200px", fontSize: "12px", color: "#fff" }, children: r }),
@@ -1961,10 +2047,10 @@ const ut = ({
1961
2047
  {
1962
2048
  style: {
1963
2049
  position: "fixed",
1964
- left: `${v.anchorEl.getBoundingClientRect().left}px`,
1965
- top: `${v.anchorEl.getBoundingClientRect().top}px`,
1966
- width: `${v.anchorEl.offsetWidth}px`,
1967
- height: `${v.anchorEl.offsetHeight}px`,
2050
+ left: `${g.anchorEl.getBoundingClientRect().left}px`,
2051
+ top: `${g.anchorEl.getBoundingClientRect().top}px`,
2052
+ width: `${g.anchorEl.offsetWidth}px`,
2053
+ height: `${g.anchorEl.offsetHeight}px`,
1968
2054
  pointerEvents: "none"
1969
2055
  }
1970
2056
  }
@@ -1978,7 +2064,7 @@ const ut = ({
1978
2064
  }
1979
2065
  );
1980
2066
  };
1981
- ut.__docgenInfo = {
2067
+ ht.__docgenInfo = {
1982
2068
  displayName: "RichTextEditor",
1983
2069
  description: "结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",
1984
2070
  props: {
@@ -2006,79 +2092,79 @@ ut.__docgenInfo = {
2006
2092
  }
2007
2093
  }
2008
2094
  };
2009
- const dt = ({
2010
- texts: n = [],
2011
- placeholder: m = "请输入内容",
2095
+ const gt = ({
2096
+ texts: t = [],
2097
+ placeholder: p = "请输入内容",
2012
2098
  animationSpeed: c = 100,
2013
- autoPlay: a = !0,
2014
- value: o,
2015
- onChange: h,
2016
- ...q
2099
+ autoPlay: s = !0,
2100
+ value: l,
2101
+ onChange: f,
2102
+ ...T
2017
2103
  }) => {
2018
- const [p, e] = z(""), [t, N] = z(0), [s, k] = z(!1), [d, R] = z(!1), [v, x] = z(!1), w = W(void 0), A = W(void 0), $ = W(n), S = W(t), C = W(d), O = W(p);
2019
- J(() => {
2020
- $.current = n, S.current = t, C.current = d, O.current = p;
2104
+ const [y, e] = z(""), [a, N] = z(0), [d, C] = z(!1), [n, S] = z(!1), [x, h] = z(!1), v = Y(void 0), $ = Y(void 0), g = Y(t), k = Y(a), w = Y(n), L = Y(y);
2105
+ te(() => {
2106
+ g.current = t, k.current = a, w.current = n, L.current = y;
2021
2107
  });
2022
- const I = B((E, _) => {
2023
- let F = 0;
2024
- x(!0);
2025
- const X = () => {
2026
- F < E.length ? (e(E.slice(0, F + 1)), F++, A.current = window.setTimeout(X, c)) : (x(!1), _?.());
2108
+ const O = F((E, _) => {
2109
+ let K = 0;
2110
+ h(!0);
2111
+ const U = () => {
2112
+ K < E.length ? (e(E.slice(0, K + 1)), K++, $.current = window.setTimeout(U, c)) : (h(!1), _?.());
2027
2113
  };
2028
- X();
2029
- }, [c]), D = B((E) => {
2030
- let _ = O.current.length;
2031
- const F = () => {
2032
- _ > 0 ? (e(O.current.slice(0, _ - 1)), _--, A.current = window.setTimeout(F, c / 2)) : E?.();
2114
+ U();
2115
+ }, [c]), M = F((E) => {
2116
+ let _ = L.current.length;
2117
+ const K = () => {
2118
+ _ > 0 ? (e(L.current.slice(0, _ - 1)), _--, $.current = window.setTimeout(K, c / 2)) : E?.();
2033
2119
  };
2034
- F();
2035
- }, [c]), P = B(() => {
2036
- if ($.current.length === 0 || C.current) return;
2037
- k(!0);
2038
- const E = $.current[S.current];
2039
- O.current ? D(() => {
2040
- I(E, () => {
2041
- w.current = window.setTimeout(() => {
2042
- N((_) => (_ + 1) % $.current.length), k(!1);
2120
+ K();
2121
+ }, [c]), P = F(() => {
2122
+ if (g.current.length === 0 || w.current) return;
2123
+ C(!0);
2124
+ const E = g.current[k.current];
2125
+ L.current ? M(() => {
2126
+ O(E, () => {
2127
+ v.current = window.setTimeout(() => {
2128
+ N((_) => (_ + 1) % g.current.length), C(!1);
2043
2129
  }, 2e3);
2044
2130
  });
2045
- }) : I(E, () => {
2046
- w.current = window.setTimeout(() => {
2047
- N((_) => (_ + 1) % $.current.length), k(!1);
2131
+ }) : O(E, () => {
2132
+ v.current = window.setTimeout(() => {
2133
+ N((_) => (_ + 1) % g.current.length), C(!1);
2048
2134
  }, 2e3);
2049
2135
  });
2050
- }, [D, I]);
2051
- J(() => (a && n.length > 0 && !d && P(), () => {
2052
- w.current && window.clearTimeout(w.current), A.current && window.clearTimeout(A.current);
2053
- }), [t, d, a, n.length, P]), J(() => {
2054
- !s && a && n.length > 0 && !d && P();
2055
- }, [t, s, a, n.length, d, P]);
2056
- const H = (E) => {
2057
- R(!0), w.current && window.clearTimeout(w.current), A.current && window.clearTimeout(A.current), k(!1), x(!1), q.onFocus?.(E);
2058
- }, G = (E) => {
2059
- R(!1), !o && n.length > 0 && (e(""), N(0)), q.onBlur?.(E);
2060
- }, K = (E) => {
2061
- h?.(E.target.value), q.onChange?.(E);
2062
- }, Q = () => d || o ? m : p || m;
2136
+ }, [M, O]);
2137
+ te(() => (s && t.length > 0 && !n && P(), () => {
2138
+ v.current && window.clearTimeout(v.current), $.current && window.clearTimeout($.current);
2139
+ }), [a, n, s, t.length, P]), te(() => {
2140
+ !d && s && t.length > 0 && !n && P();
2141
+ }, [a, d, s, t.length, n, P]);
2142
+ const W = (E) => {
2143
+ S(!0), v.current && window.clearTimeout(v.current), $.current && window.clearTimeout($.current), C(!1), h(!1), T.onFocus?.(E);
2144
+ }, D = (E) => {
2145
+ S(!1), !l && t.length > 0 && (e(""), N(0)), T.onBlur?.(E);
2146
+ }, X = (E) => {
2147
+ f?.(E.target.value), T.onChange?.(E);
2148
+ }, Z = () => n || l ? p : y || p;
2063
2149
  return /* @__PURE__ */ u.jsxs("div", { style: { position: "relative" }, children: [
2064
2150
  /* @__PURE__ */ u.jsx(
2065
- ke,
2151
+ $e,
2066
2152
  {
2067
- ...q,
2068
- value: o,
2069
- onChange: K,
2070
- onFocus: H,
2071
- onBlur: G,
2072
- placeholder: Q(),
2153
+ ...T,
2154
+ value: l,
2155
+ onChange: X,
2156
+ onFocus: W,
2157
+ onBlur: D,
2158
+ placeholder: Z(),
2073
2159
  style: {
2074
2160
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2075
- ...q.style,
2161
+ ...T.style,
2076
2162
  position: "relative",
2077
2163
  zIndex: 1
2078
2164
  }
2079
2165
  }
2080
2166
  ),
2081
- !d && !o && p && /* @__PURE__ */ u.jsxs(
2167
+ !n && !l && y && /* @__PURE__ */ u.jsxs(
2082
2168
  "div",
2083
2169
  {
2084
2170
  style: {
@@ -2098,8 +2184,8 @@ const dt = ({
2098
2184
  fontFamily: "inherit"
2099
2185
  },
2100
2186
  children: [
2101
- /* @__PURE__ */ u.jsx("span", { children: p }),
2102
- v && /* @__PURE__ */ u.jsx(
2187
+ /* @__PURE__ */ u.jsx("span", { children: y }),
2188
+ x && /* @__PURE__ */ u.jsx(
2103
2189
  "span",
2104
2190
  {
2105
2191
  style: {
@@ -2123,7 +2209,7 @@ const dt = ({
2123
2209
  ` })
2124
2210
  ] });
2125
2211
  };
2126
- dt.__docgenInfo = {
2212
+ gt.__docgenInfo = {
2127
2213
  displayName: "DynamicInput",
2128
2214
  description: "动态文案输入框组件,支持流式文字动画效果",
2129
2215
  props: {
@@ -2168,109 +2254,109 @@ dt.__docgenInfo = {
2168
2254
  }
2169
2255
  }
2170
2256
  };
2171
- const pt = ({
2172
- texts: n = [],
2257
+ const xt = ({
2258
+ texts: t = [],
2173
2259
  // 动态文案数组,默认为空数组
2174
- placeholder: m = "请输入内容",
2260
+ placeholder: p = "请输入内容",
2175
2261
  // 占位符文本
2176
2262
  animationSpeed: c = 100,
2177
2263
  // 打字机动画速度,毫秒
2178
- autoPlay: a = !0,
2264
+ autoPlay: s = !0,
2179
2265
  // 是否自动播放动画
2180
- value: o = "",
2266
+ value: l = "",
2181
2267
  // 受控模式的值
2182
- onChange: h,
2268
+ onChange: f,
2183
2269
  // 受控模式的变化回调
2184
- onSubmit: q,
2270
+ onSubmit: T,
2185
2271
  // 提交回调
2186
- maxLength: p = 500,
2272
+ maxLength: y = 500,
2187
2273
  // 最大字符数限制
2188
2274
  showCount: e = !0,
2189
2275
  // 是否显示字数统计
2190
- submitText: t = "发送",
2276
+ submitText: a = "发送",
2191
2277
  // 提交按钮文本
2192
2278
  disabled: N = !1,
2193
2279
  // 是否禁用组件
2194
- rows: s = 4,
2280
+ rows: d = 4,
2195
2281
  // 文本域行数
2196
- style: k,
2282
+ style: C,
2197
2283
  // 自定义样式
2198
- ...d
2284
+ ...n
2199
2285
  // 其他原生属性
2200
2286
  }) => {
2201
- const [R, v] = z(""), [x, w] = z(0), [A, $] = z(!1), [S, C] = z(!1), [O, I] = z(!1), [D, P] = z(o || ""), H = W(void 0), G = W(void 0), K = W(n), Q = W(x), E = W(S), _ = W(R), F = W(null);
2202
- J(() => {
2203
- K.current = n, Q.current = x, E.current = S, _.current = R;
2287
+ const [S, x] = z(""), [h, v] = z(0), [$, g] = z(!1), [k, w] = z(!1), [L, O] = z(!1), [M, P] = z(l || ""), W = Y(void 0), D = Y(void 0), X = Y(t), Z = Y(h), E = Y(k), _ = Y(S), K = Y(null);
2288
+ te(() => {
2289
+ X.current = t, Z.current = h, E.current = k, _.current = S;
2204
2290
  });
2205
- const X = B((f, b) => {
2206
- let V = 0;
2207
- I(!0);
2208
- const j = () => {
2209
- V < f.length ? (v(f.slice(0, V + 1)), V++, G.current = window.setTimeout(j, c)) : (I(!1), b?.());
2291
+ const U = F((r, o) => {
2292
+ let m = 0;
2293
+ O(!0);
2294
+ const q = () => {
2295
+ m < r.length ? (x(r.slice(0, m + 1)), m++, D.current = window.setTimeout(q, c)) : (O(!1), o?.());
2210
2296
  };
2211
- j();
2212
- }, [c]), ne = B((f) => {
2213
- let b = _.current.length;
2214
- const V = () => {
2215
- b > 0 ? (v(_.current.slice(0, b - 1)), b--, G.current = window.setTimeout(V, c / 2)) : f?.();
2297
+ q();
2298
+ }, [c]), le = F((r) => {
2299
+ let o = _.current.length;
2300
+ const m = () => {
2301
+ o > 0 ? (x(_.current.slice(0, o - 1)), o--, D.current = window.setTimeout(m, c / 2)) : r?.();
2216
2302
  };
2217
- V();
2218
- }, [c]), re = B(() => {
2219
- if (K.current.length === 0 || E.current) return;
2220
- $(!0);
2221
- const f = K.current[Q.current];
2222
- _.current ? ne(() => {
2223
- X(f, () => {
2224
- H.current = window.setTimeout(() => {
2225
- w((b) => (b + 1) % K.current.length), $(!1);
2303
+ m();
2304
+ }, [c]), ie = F(() => {
2305
+ if (X.current.length === 0 || E.current) return;
2306
+ g(!0);
2307
+ const r = X.current[Z.current];
2308
+ _.current ? le(() => {
2309
+ U(r, () => {
2310
+ W.current = window.setTimeout(() => {
2311
+ v((o) => (o + 1) % X.current.length), g(!1);
2226
2312
  }, 2e3);
2227
2313
  });
2228
- }) : X(f, () => {
2229
- H.current = window.setTimeout(() => {
2230
- w((b) => (b + 1) % K.current.length), $(!1);
2314
+ }) : U(r, () => {
2315
+ W.current = window.setTimeout(() => {
2316
+ v((o) => (o + 1) % X.current.length), g(!1);
2231
2317
  }, 2e3);
2232
2318
  });
2233
- }, [ne, X]);
2234
- J(() => (a && n.length > 0 && !S && re(), () => {
2235
- H.current && window.clearTimeout(H.current), G.current && window.clearTimeout(G.current);
2236
- }), [x, S, a, n.length, re]), J(() => {
2237
- !A && a && n.length > 0 && !S && re();
2238
- }, [x, A, a, n.length, S, re]);
2239
- const l = (f) => {
2240
- C(!0), H.current && window.clearTimeout(H.current), G.current && window.clearTimeout(G.current), $(!1), I(!1), d.onFocus?.(f);
2241
- }, r = (f) => {
2242
- C(!1), !o && n.length > 0 && (v(""), w(0)), d.onBlur?.(f);
2243
- }, i = (f) => {
2244
- const b = f.target.value;
2245
- p && b.length > p || (h ? h(b) : P(b), d.onChange?.(f));
2246
- }, y = () => {
2247
- const f = h ? o : D;
2248
- f.trim() && !N && (q?.(f), h || P(""));
2249
- }, T = (f) => {
2250
- (f.ctrlKey || f.metaKey) && f.key === "Enter" && (f.preventDefault(), y()), d.onKeyDown?.(f);
2251
- }, g = h ? o : D, L = N || !g.trim() || (p ? g.length > p : !1);
2252
- return /* @__PURE__ */ u.jsxs("div", { style: { position: "relative", ...k }, children: [
2319
+ }, [le, U]);
2320
+ te(() => (s && t.length > 0 && !k && ie(), () => {
2321
+ W.current && window.clearTimeout(W.current), D.current && window.clearTimeout(D.current);
2322
+ }), [h, k, s, t.length, ie]), te(() => {
2323
+ !$ && s && t.length > 0 && !k && ie();
2324
+ }, [h, $, s, t.length, k, ie]);
2325
+ const i = (r) => {
2326
+ w(!0), W.current && window.clearTimeout(W.current), D.current && window.clearTimeout(D.current), g(!1), O(!1), n.onFocus?.(r);
2327
+ }, I = (r) => {
2328
+ w(!1), !l && t.length > 0 && (x(""), v(0)), n.onBlur?.(r);
2329
+ }, B = (r) => {
2330
+ const o = r.target.value;
2331
+ y && o.length > y || (f ? f(o) : P(o), n.onChange?.(r));
2332
+ }, J = () => {
2333
+ const r = f ? l : M;
2334
+ r.trim() && !N && (T?.(r), f || P(""));
2335
+ }, se = (r) => {
2336
+ (r.ctrlKey || r.metaKey) && r.key === "Enter" && (r.preventDefault(), J()), n.onKeyDown?.(r);
2337
+ }, ee = f ? l : M, de = N || !ee.trim() || (y ? ee.length > y : !1);
2338
+ return /* @__PURE__ */ u.jsxs("div", { style: { position: "relative", ...C }, children: [
2253
2339
  /* @__PURE__ */ u.jsxs("div", { style: { position: "relative" }, children: [
2254
2340
  /* @__PURE__ */ u.jsx(
2255
2341
  "textarea",
2256
2342
  {
2257
- ref: F,
2258
- value: h ? o : D,
2259
- onChange: i,
2260
- onFocus: (f) => {
2261
- f.target.style.borderColor = "#1890ff", f.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", l(f);
2343
+ ref: K,
2344
+ value: f ? l : M,
2345
+ onChange: B,
2346
+ onFocus: (r) => {
2347
+ r.target.style.borderColor = "#1890ff", r.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", i(r);
2262
2348
  },
2263
- onBlur: (f) => {
2264
- f.target.style.borderColor = "#d9d9d9", f.target.style.boxShadow = "none", r(f);
2349
+ onBlur: (r) => {
2350
+ r.target.style.borderColor = "#d9d9d9", r.target.style.boxShadow = "none", I(r);
2265
2351
  },
2266
- onKeyDown: T,
2267
- placeholder: S || g ? m : "",
2268
- maxLength: p,
2269
- rows: s,
2352
+ onKeyDown: se,
2353
+ placeholder: k || ee ? p : "",
2354
+ maxLength: y,
2355
+ rows: d,
2270
2356
  disabled: N,
2271
2357
  style: {
2272
2358
  width: "100%",
2273
- minHeight: `${s * 24 + 16}px`,
2359
+ minHeight: `${d * 24 + 16}px`,
2274
2360
  padding: "8px 60px 8px 12px",
2275
2361
  // 右侧留出按钮空间
2276
2362
  border: "1px solid #d9d9d9",
@@ -2283,12 +2369,12 @@ const pt = ({
2283
2369
  transition: "border-color 0.3s, box-shadow 0.3s",
2284
2370
  backgroundColor: "#fff",
2285
2371
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2286
- ...d.style
2372
+ ...n.style
2287
2373
  },
2288
- ...d
2374
+ ...n
2289
2375
  }
2290
2376
  ),
2291
- !S && !g && R && /* @__PURE__ */ u.jsxs(
2377
+ !k && !ee && S && /* @__PURE__ */ u.jsxs(
2292
2378
  "div",
2293
2379
  {
2294
2380
  style: {
@@ -2310,8 +2396,8 @@ const pt = ({
2310
2396
  lineHeight: "1.5"
2311
2397
  },
2312
2398
  children: [
2313
- /* @__PURE__ */ u.jsx("span", { children: R }),
2314
- O && /* @__PURE__ */ u.jsx(
2399
+ /* @__PURE__ */ u.jsx("span", { children: S }),
2400
+ L && /* @__PURE__ */ u.jsx(
2315
2401
  "span",
2316
2402
  {
2317
2403
  style: {
@@ -2337,13 +2423,13 @@ const pt = ({
2337
2423
  zIndex: 3
2338
2424
  },
2339
2425
  children: /* @__PURE__ */ u.jsx(
2340
- le,
2426
+ fe,
2341
2427
  {
2342
2428
  type: "primary",
2343
2429
  size: "small",
2344
- icon: /* @__PURE__ */ u.jsx(Pe, {}),
2345
- onClick: y,
2346
- disabled: L,
2430
+ icon: /* @__PURE__ */ u.jsx(ze, {}),
2431
+ onClick: J,
2432
+ disabled: de,
2347
2433
  style: {
2348
2434
  borderRadius: 6,
2349
2435
  minWidth: 32,
@@ -2352,7 +2438,7 @@ const pt = ({
2352
2438
  alignItems: "center",
2353
2439
  justifyContent: "center"
2354
2440
  },
2355
- children: t
2441
+ children: a
2356
2442
  }
2357
2443
  )
2358
2444
  }
@@ -2368,9 +2454,9 @@ const pt = ({
2368
2454
  color: "#999"
2369
2455
  },
2370
2456
  children: [
2371
- g.length,
2457
+ ee.length,
2372
2458
  "/",
2373
- p
2459
+ y
2374
2460
  ]
2375
2461
  }
2376
2462
  ),
@@ -2382,7 +2468,7 @@ const pt = ({
2382
2468
  ` })
2383
2469
  ] });
2384
2470
  };
2385
- pt.__docgenInfo = {
2471
+ xt.__docgenInfo = {
2386
2472
  displayName: "DynamicTextArea",
2387
2473
  description: "动态文案文本域组件,支持流式文字动画效果",
2388
2474
  props: {
@@ -2468,96 +2554,96 @@ pt.__docgenInfo = {
2468
2554
  }
2469
2555
  }
2470
2556
  };
2471
- const Te = ({
2472
- src: n,
2473
- poster: m,
2557
+ const Re = ({
2558
+ src: t,
2559
+ poster: p,
2474
2560
  width: c = 300,
2475
- height: a,
2476
- videoWidth: o,
2561
+ height: s,
2562
+ videoWidth: l,
2477
2563
  // 参数保留但不使用,由CSS控制
2478
- videoHeight: h,
2564
+ videoHeight: f,
2479
2565
  // 参数保留但不使用,由CSS控制
2480
- showPlayButton: q = !0,
2481
- autoPlayOnHover: p = !0,
2566
+ showPlayButton: T = !0,
2567
+ autoPlayOnHover: y = !0,
2482
2568
  onClick: e,
2483
- onVideoLoaded: t,
2569
+ onVideoLoaded: a,
2484
2570
  onVideoPlay: N,
2485
- onVideoPause: s,
2486
- onVideoEnded: k,
2487
- className: d,
2488
- style: R,
2489
- ...v
2571
+ onVideoPause: d,
2572
+ onVideoEnded: C,
2573
+ className: n,
2574
+ style: S,
2575
+ ...x
2490
2576
  }) => {
2491
- const x = W(null), [w, A] = z(!1), [$, S] = z(!1), [C, O] = z(!1), I = B(() => {
2492
- x.current && (x.current.play(), A(!0), N?.());
2493
- }, [N]), D = B(() => {
2494
- x.current && (x.current.pause(), A(!1), s?.());
2495
- }, [s]), P = B((X) => {
2496
- X.stopPropagation(), w ? D() : I();
2497
- }, [w, I, D]), H = B(() => {
2498
- S(!0), p && !w && I();
2499
- }, [p, w, I]), G = B(() => {
2500
- S(!1), p && w && D();
2501
- }, [p, w, D]), K = B(() => {
2502
- O(!0), t?.();
2503
- }, [t]), Q = B(() => {
2504
- A(!0), N?.();
2505
- }, [N]), E = B(() => {
2506
- A(!1), s?.();
2507
- }, [s]), _ = B(() => {
2508
- A(!1), k?.();
2509
- }, [k]), F = B((X) => {
2510
- e?.(X);
2577
+ const h = Y(null), [v, $] = z(!1), [g, k] = z(!1), [w, L] = z(!1), O = F(() => {
2578
+ h.current && (h.current.play(), $(!0), N?.());
2579
+ }, [N]), M = F(() => {
2580
+ h.current && (h.current.pause(), $(!1), d?.());
2581
+ }, [d]), P = F((U) => {
2582
+ U.stopPropagation(), v ? M() : O();
2583
+ }, [v, O, M]), W = F(() => {
2584
+ k(!0), y && !v && O();
2585
+ }, [y, v, O]), D = F(() => {
2586
+ k(!1), y && v && M();
2587
+ }, [y, v, M]), X = F(() => {
2588
+ L(!0), a?.();
2589
+ }, [a]), Z = F(() => {
2590
+ $(!0), N?.();
2591
+ }, [N]), E = F(() => {
2592
+ $(!1), d?.();
2593
+ }, [d]), _ = F(() => {
2594
+ $(!1), C?.();
2595
+ }, [C]), K = F((U) => {
2596
+ e?.(U);
2511
2597
  }, [e]);
2512
2598
  return /* @__PURE__ */ u.jsx(
2513
- he,
2599
+ Ee,
2514
2600
  {
2515
- ...v,
2516
- className: `video-card ${d || ""}`,
2601
+ ...x,
2602
+ className: `video-card ${n || ""}`,
2517
2603
  style: {
2518
2604
  width: c,
2519
- height: a,
2605
+ height: s,
2520
2606
  padding: 0,
2521
2607
  overflow: "hidden",
2522
2608
  cursor: e ? "pointer" : "default",
2523
2609
  border: "none",
2524
2610
  borderRadius: 0,
2525
- ...R
2611
+ ...S
2526
2612
  },
2527
2613
  bordered: !1,
2528
- onMouseEnter: H,
2529
- onMouseLeave: G,
2530
- onClick: F,
2614
+ onMouseEnter: W,
2615
+ onMouseLeave: D,
2616
+ onClick: K,
2531
2617
  children: /* @__PURE__ */ u.jsxs("div", { className: "video-card-container", children: [
2532
2618
  /* @__PURE__ */ u.jsx(
2533
2619
  "video",
2534
2620
  {
2535
- ref: x,
2536
- src: n,
2537
- poster: m,
2621
+ ref: h,
2622
+ src: t,
2623
+ poster: p,
2538
2624
  preload: "metadata",
2539
- onLoadedData: K,
2540
- onPlay: Q,
2625
+ onLoadedData: X,
2626
+ onPlay: Z,
2541
2627
  onPause: E,
2542
2628
  onEnded: _,
2543
2629
  muted: !0,
2544
2630
  loop: !0
2545
2631
  }
2546
2632
  ),
2547
- q && /* @__PURE__ */ u.jsx(
2633
+ T && /* @__PURE__ */ u.jsx(
2548
2634
  "div",
2549
2635
  {
2550
- className: `video-play-button ${$ ? "hovered" : ""}`,
2636
+ className: `video-play-button ${g ? "hovered" : ""}`,
2551
2637
  onClick: P,
2552
- children: w ? /* @__PURE__ */ u.jsx(Me, { className: "play-icon" }) : /* @__PURE__ */ u.jsx(De, { className: "play-icon" })
2638
+ children: v ? /* @__PURE__ */ u.jsx(He, { className: "play-icon" }) : /* @__PURE__ */ u.jsx(We, { className: "play-icon" })
2553
2639
  }
2554
2640
  ),
2555
- !C && /* @__PURE__ */ u.jsx("div", { className: "video-loading-mask", children: /* @__PURE__ */ u.jsx("div", { className: "loading-spinner" }) })
2641
+ !w && /* @__PURE__ */ u.jsx("div", { className: "video-loading-mask", children: /* @__PURE__ */ u.jsx("div", { className: "loading-spinner" }) })
2556
2642
  ] })
2557
2643
  }
2558
2644
  );
2559
2645
  };
2560
- Te.__docgenInfo = {
2646
+ Re.__docgenInfo = {
2561
2647
  displayName: "VideoCard",
2562
2648
  description: "视频卡片组件,支持鼠标悬浮播放控制",
2563
2649
  props: {
@@ -2658,12 +2744,12 @@ Te.__docgenInfo = {
2658
2744
  }
2659
2745
  }
2660
2746
  };
2661
- const ft = (n) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((c) => n.toLowerCase().includes(c)), mt = (n) => n.type ? n.type : ft(n.url) ? "video" : "image", yt = ({
2662
- items: n,
2663
- columns: m,
2747
+ const bt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((c) => t.toLowerCase().includes(c)), vt = (t) => t.type ? t.type : bt(t.url) ? "video" : "image", wt = ({
2748
+ items: t,
2749
+ columns: p,
2664
2750
  gap: c = 0,
2665
- responsive: a = !0,
2666
- breakpoints: o = {
2751
+ responsive: s = !0,
2752
+ breakpoints: l = {
2667
2753
  xs: 1,
2668
2754
  sm: 2,
2669
2755
  md: 3,
@@ -2671,78 +2757,78 @@ const ft = (n) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
2671
2757
  xl: 5,
2672
2758
  xxl: 6
2673
2759
  },
2674
- className: h,
2675
- style: q,
2676
- onClick: p
2760
+ className: f,
2761
+ style: T,
2762
+ onClick: y
2677
2763
  }) => {
2678
- const e = W(null), [t, N] = z(m || o.md || 3), s = W(/* @__PURE__ */ new Map()), k = B(() => {
2679
- if (!a || m)
2680
- return m || o.md || 3;
2681
- const x = window.innerWidth;
2682
- return x < 576 ? o.xs || 1 : x < 768 ? o.sm || 2 : x < 992 ? o.md || 3 : x < 1200 ? o.lg || 4 : x < 1600 ? o.xl || 5 : o.xxl || 6;
2683
- }, [a, m, o]), d = B(() => {
2764
+ const e = Y(null), [a, N] = z(p || l.md || 3), d = Y(/* @__PURE__ */ new Map()), C = F(() => {
2765
+ if (!s || p)
2766
+ return p || l.md || 3;
2767
+ const h = window.innerWidth;
2768
+ return h < 576 ? l.xs || 1 : h < 768 ? l.sm || 2 : h < 992 ? l.md || 3 : h < 1200 ? l.lg || 4 : h < 1600 ? l.xl || 5 : l.xxl || 6;
2769
+ }, [s, p, l]), n = F(() => {
2684
2770
  if (!e.current) return;
2685
- const x = t, w = e.current, $ = (w.offsetWidth - c * (x - 1)) / x, S = new Array(x).fill(0);
2686
- n.forEach((O, I) => {
2687
- const D = O.id || I, P = s.current.get(D);
2771
+ const h = a, v = e.current, g = (v.offsetWidth - c * (h - 1)) / h, k = new Array(h).fill(0);
2772
+ t.forEach((L, O) => {
2773
+ const M = L.id || O, P = d.current.get(M);
2688
2774
  if (!P) return;
2689
- const H = Math.min(...S), G = S.indexOf(H), K = G * ($ + c), Q = S[G];
2690
- P.style.position = "absolute", P.style.left = `${K}px`, P.style.top = `${Q}px`, P.style.width = `${$}px`, S[G] += P.offsetHeight + c;
2775
+ const W = Math.min(...k), D = k.indexOf(W), X = D * (g + c), Z = k[D];
2776
+ P.style.position = "absolute", P.style.left = `${X}px`, P.style.top = `${Z}px`, P.style.width = `${g}px`, k[D] += P.offsetHeight + c;
2691
2777
  });
2692
- const C = Math.max(...S);
2693
- w.style.height = `${C}px`;
2694
- }, [n, t, c]);
2695
- J(() => {
2696
- const x = () => {
2697
- const w = k();
2698
- w !== t && N(w);
2778
+ const w = Math.max(...k);
2779
+ v.style.height = `${w}px`;
2780
+ }, [t, a, c]);
2781
+ te(() => {
2782
+ const h = () => {
2783
+ const v = C();
2784
+ v !== a && N(v);
2699
2785
  };
2700
- if (a)
2701
- return window.addEventListener("resize", x), x(), () => window.removeEventListener("resize", x);
2702
- }, [a, k, t]), J(() => {
2703
- const x = setTimeout(() => {
2704
- d();
2786
+ if (s)
2787
+ return window.addEventListener("resize", h), h(), () => window.removeEventListener("resize", h);
2788
+ }, [s, C, a]), te(() => {
2789
+ const h = setTimeout(() => {
2790
+ n();
2705
2791
  }, 100);
2706
- return () => clearTimeout(x);
2707
- }, [n, t, d]);
2708
- const R = B(() => {
2709
- d();
2710
- }, [d]), v = B((x) => {
2711
- p && p(x), x.onClick?.(x);
2712
- }, [p]);
2792
+ return () => clearTimeout(h);
2793
+ }, [t, a, n]);
2794
+ const S = F(() => {
2795
+ n();
2796
+ }, [n]), x = F((h) => {
2797
+ y && y(h), h.onClick?.(h);
2798
+ }, [y]);
2713
2799
  return /* @__PURE__ */ u.jsx(
2714
2800
  "div",
2715
2801
  {
2716
2802
  ref: e,
2717
- className: `waterfall-container ${h || ""}`,
2803
+ className: `waterfall-container ${f || ""}`,
2718
2804
  style: {
2719
2805
  position: "relative",
2720
2806
  width: "100%",
2721
- ...q
2807
+ ...T
2722
2808
  },
2723
- children: n.map((x, w) => {
2724
- const A = x.id || w, $ = mt(x);
2809
+ children: t.map((h, v) => {
2810
+ const $ = h.id || v, g = vt(h);
2725
2811
  return /* @__PURE__ */ u.jsx(
2726
2812
  "div",
2727
2813
  {
2728
- ref: (S) => {
2729
- S ? s.current.set(A, S) : s.current.delete(A);
2814
+ ref: (k) => {
2815
+ k ? d.current.set($, k) : d.current.delete($);
2730
2816
  },
2731
2817
  className: "waterfall-item",
2732
- children: $ === "video" ? /* @__PURE__ */ u.jsx("div", { style: {
2818
+ children: g === "video" ? /* @__PURE__ */ u.jsx("div", { style: {
2733
2819
  width: "100%",
2734
2820
  position: "relative",
2735
2821
  paddingBottom: "56.25%",
2736
- cursor: p || x.onClick ? "pointer" : "default"
2822
+ cursor: y || h.onClick ? "pointer" : "default"
2737
2823
  }, children: /* @__PURE__ */ u.jsx("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }, children: /* @__PURE__ */ u.jsx(
2738
- Te,
2824
+ Re,
2739
2825
  {
2740
- src: x.url,
2741
- poster: x.poster,
2826
+ src: h.url,
2827
+ poster: h.poster,
2742
2828
  width: "100%",
2743
2829
  height: "100%",
2744
- onClick: () => v(x),
2745
- onVideoLoaded: R,
2830
+ onClick: () => x(h),
2831
+ onVideoLoaded: S,
2746
2832
  autoPlayOnHover: !0,
2747
2833
  showPlayButton: !1
2748
2834
  }
@@ -2750,29 +2836,29 @@ const ft = (n) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
2750
2836
  "div",
2751
2837
  {
2752
2838
  className: "waterfall-image-wrapper",
2753
- onClick: () => v(x),
2754
- style: { cursor: p || x.onClick ? "pointer" : "default" },
2839
+ onClick: () => x(h),
2840
+ style: { cursor: y || h.onClick ? "pointer" : "default" },
2755
2841
  children: /* @__PURE__ */ u.jsx(
2756
2842
  "img",
2757
2843
  {
2758
- src: x.url,
2759
- alt: `瀑布流图片 ${w + 1}`,
2844
+ src: h.url,
2845
+ alt: `瀑布流图片 ${v + 1}`,
2760
2846
  className: "waterfall-image",
2761
- onLoad: R,
2762
- onError: R,
2847
+ onLoad: S,
2848
+ onError: S,
2763
2849
  style: { display: "block", width: "100%", height: "auto" }
2764
2850
  }
2765
2851
  )
2766
2852
  }
2767
2853
  )
2768
2854
  },
2769
- A
2855
+ $
2770
2856
  );
2771
2857
  })
2772
2858
  }
2773
2859
  );
2774
2860
  };
2775
- yt.__docgenInfo = {
2861
+ wt.__docgenInfo = {
2776
2862
  displayName: "Waterfall",
2777
2863
  description: "瀑布流布局组件,支持图片和视频混合展示",
2778
2864
  props: {
@@ -2828,8 +2914,8 @@ yt.__docgenInfo = {
2828
2914
  }
2829
2915
  }
2830
2916
  };
2831
- const vt = {
2832
- algorithm: je.defaultAlgorithm,
2917
+ const Ct = {
2918
+ algorithm: Pe.defaultAlgorithm,
2833
2919
  token: {
2834
2920
  // 主色
2835
2921
  colorPrimary: "#3b82f6",
@@ -2895,20 +2981,20 @@ const vt = {
2895
2981
  }
2896
2982
  };
2897
2983
  export {
2898
- tt as AdvancedTable,
2899
- Ke as AppModal,
2900
- Qe as BackButton,
2901
- He as Button,
2902
- We as Card,
2903
- dt as DynamicInput,
2904
- pt as DynamicTextArea,
2905
- Je as EmptyAndSpin,
2906
- Ze as LinkButton,
2907
- Xe as PageTable,
2908
- ut as RichTextEditor,
2909
- Te as VideoCard,
2910
- yt as Waterfall,
2911
- Ue as XcIcon,
2912
- vt as lightTheme
2984
+ lt as AdvancedTable,
2985
+ Ze as AppModal,
2986
+ at as BackButton,
2987
+ Je as Button,
2988
+ Qe as Card,
2989
+ gt as DynamicInput,
2990
+ xt as DynamicTextArea,
2991
+ rt as EmptyAndSpin,
2992
+ ot as LinkButton,
2993
+ et as PageTable,
2994
+ ht as RichTextEditor,
2995
+ Re as VideoCard,
2996
+ wt as Waterfall,
2997
+ nt as XcIcon,
2998
+ Ct as lightTheme
2913
2999
  };
2914
3000
  //# sourceMappingURL=index.es.js.map