@skopon-cool/form-sdk 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,56 +1,56 @@
1
1
  import './form-sdk.css';
2
- var Kn = Object.defineProperty;
3
- var Wn = (e, t, n) => t in e ? Kn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
- var G = (e, t, n) => Wn(e, typeof t != "symbol" ? t + "" : t, n);
5
- import { jsx as c, jsxs as x } from "react/jsx-runtime";
6
- import { useRef as A, useState as E, useCallback as j, useMemo as V, createContext as Te, useContext as xe, useEffect as B, useSyncExternalStore as Gn, forwardRef as Jn, useImperativeHandle as Yn } from "react";
7
- import { Spin as yt, Button as Me, Typography as ee, Avatar as Xn, Tag as be, Tooltip as ge, Modal as Qn, Select as ct, Checkbox as Zn, Radio as er, Switch as tr, TimePicker as nr, DatePicker as rr, Upload as Ze, Input as et, InputNumber as or, ConfigProvider as ir } from "antd";
8
- import { ReloadOutlined as nn, FileTextOutlined as rn, UserOutlined as sr, FileImageOutlined as ar, FullscreenOutlined as lr, FileExcelOutlined as cr, FileOutlined as on, PictureOutlined as ur, SoundOutlined as mr, VideoCameraOutlined as dr } from "@ant-design/icons";
9
- import { createBinderlessComponentImplementation as J, basicCatalog as ze, A2uiSurface as sn } from "@a2ui/react/v0_9";
2
+ var Xn = Object.defineProperty;
3
+ var Zn = (e, t, n) => t in e ? Xn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
+ var X = (e, t, n) => Zn(e, typeof t != "symbol" ? t + "" : t, n);
5
+ import { jsx as c, jsxs as U } from "react/jsx-runtime";
6
+ import { useRef as x, useState as w, useCallback as L, useMemo as $, createContext as be, useContext as Se, useEffect as z, useSyncExternalStore as er, forwardRef as tr, useImperativeHandle as nr } from "react";
7
+ import { Spin as kt, Button as Ne, Typography as re, Avatar as rr, Tag as Ae, Tooltip as ve, Modal as or, Select as dt, Checkbox as ir, Radio as sr, Switch as ar, TimePicker as lr, DatePicker as cr, Upload as nt, Input as rt, InputNumber as ur, ConfigProvider as mr } from "antd";
8
+ import { ReloadOutlined as cn, FileTextOutlined as un, UserOutlined as dr, FileImageOutlined as fr, FullscreenOutlined as pr, FileExcelOutlined as hr, FileOutlined as mn, PictureOutlined as gr, SoundOutlined as yr, VideoCameraOutlined as vr } from "@ant-design/icons";
9
+ import { createBinderlessComponentImplementation as Z, basicCatalog as Be, A2uiSurface as dn } from "@a2ui/react/v0_9";
10
10
  import { z as f } from "zod";
11
- import { Catalog as pr, MessageProcessor as an } from "@a2ui/web_core/v0_9";
12
- import { injectBasicCatalogStyles as ln } from "@a2ui/web_core/v0_9/basic_catalog";
13
- import { injectStyles as cn } from "@a2ui/react/styles";
14
- import Kt from "dayjs";
15
- const Rs = "v0.9", fr = [
11
+ import { Catalog as br, MessageProcessor as fn } from "@a2ui/web_core/v0_9";
12
+ import { injectBasicCatalogStyles as pn } from "@a2ui/web_core/v0_9/basic_catalog";
13
+ import { injectStyles as hn } from "@a2ui/react/styles";
14
+ import Qt from "dayjs";
15
+ const Ks = "v0.9", Sr = [
16
16
  "huge",
17
17
  "large",
18
18
  "medium",
19
19
  "small",
20
20
  "icon"
21
21
  ];
22
- function Se(e) {
22
+ function _e(e) {
23
23
  return e === "image" || e === "video" || e === "audio";
24
24
  }
25
- function ke(e) {
25
+ function Te(e) {
26
26
  return e === "web";
27
27
  }
28
- function un(e) {
28
+ function gn(e) {
29
29
  return e === "heading" || e === "paragraph";
30
30
  }
31
- function Z(e) {
32
- return !un(e) && !Se(e) && !ke(e);
31
+ function ee(e) {
32
+ return !gn(e) && !_e(e) && !Te(e);
33
33
  }
34
- function mn(e) {
35
- return un(e) || Se(e) || ke(e);
34
+ function yn(e) {
35
+ return gn(e) || _e(e) || Te(e);
36
36
  }
37
- function dn(e) {
37
+ function vn(e) {
38
38
  return e === "select" || e === "multiselect" || e === "radio" || e === "checkbox";
39
39
  }
40
- function ws(e) {
41
- return Z(e) && e !== "file" && e !== "resume_multiselect" && e !== "case_multiselect";
40
+ function Ws(e) {
41
+ return ee(e) && e !== "file" && e !== "resume_multiselect" && e !== "case_multiselect";
42
42
  }
43
- const ut = 360, hr = 200, gr = 1200;
44
- function Ne(e) {
43
+ const ft = 360, kr = 200, Cr = 1200;
44
+ function Ie(e) {
45
45
  if (e == null || e === "")
46
- return ut;
46
+ return ft;
47
47
  const t = typeof e == "number" ? e : Number(e);
48
48
  return Number.isFinite(t) ? Math.min(
49
- gr,
50
- Math.max(hr, Math.floor(t))
51
- ) : ut;
49
+ Cr,
50
+ Math.max(kr, Math.floor(t))
51
+ ) : ft;
52
52
  }
53
- function yr(e) {
53
+ function Ar(e) {
54
54
  if (typeof e != "string") return !1;
55
55
  const t = e.trim();
56
56
  if (!t) return !1;
@@ -64,7 +64,7 @@ function yr(e) {
64
64
  return !1;
65
65
  }
66
66
  }
67
- function vr() {
67
+ function _r() {
68
68
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
69
69
  return crypto.randomUUID();
70
70
  if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
@@ -78,11 +78,11 @@ function vr() {
78
78
  return (e === "x" ? t : t & 3 | 8).toString(16);
79
79
  });
80
80
  }
81
- function ce(e) {
82
- const t = vr().replace(/-/g, "").slice(0, 8);
81
+ function de(e) {
82
+ const t = _r().replace(/-/g, "").slice(0, 8);
83
83
  return `${e}${t}`;
84
84
  }
85
- const pn = [
85
+ const bn = [
86
86
  { value: "image/*", label: "图片" },
87
87
  { value: "video/*", label: "视频" },
88
88
  { value: "audio/*", label: "音频" },
@@ -93,7 +93,7 @@ const pn = [
93
93
  { value: "text/plain", label: "纯文本" },
94
94
  { value: "application/zip", label: "ZIP 压缩包" },
95
95
  { value: "application/x-rar-compressed", label: "RAR 压缩包" }
96
- ], br = {
96
+ ], Tr = {
97
97
  "image/*": ["image/*"],
98
98
  "video/*": ["video/*"],
99
99
  "audio/*": ["audio/*"],
@@ -113,7 +113,7 @@ const pn = [
113
113
  "text/plain": ["text/plain"],
114
114
  "application/zip": ["application/zip"],
115
115
  "application/x-rar-compressed": ["application/x-rar-compressed"]
116
- }, Sr = {
116
+ }, xr = {
117
117
  "image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
118
118
  "video/*": [".mp4", ".mov", ".avi", ".webm"],
119
119
  "audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
@@ -124,14 +124,14 @@ const pn = [
124
124
  "text/plain": [".txt"],
125
125
  "application/zip": [".zip", ".7z"],
126
126
  "application/x-rar-compressed": [".rar"]
127
- }, kr = {
127
+ }, Mr = {
128
128
  "application/msword": "office/word",
129
129
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
130
130
  "application/vnd.ms-excel": "office/excel",
131
131
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
132
132
  "application/vnd.ms-powerpoint": "office/ppt",
133
133
  "application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
134
- }, vt = [
134
+ }, Ct = [
135
135
  { value: ".jpg", label: ".jpg" },
136
136
  { value: ".jpeg", label: ".jpeg" },
137
137
  { value: ".png", label: ".png" },
@@ -157,101 +157,101 @@ const pn = [
157
157
  { value: ".zip", label: ".zip" },
158
158
  { value: ".rar", label: ".rar" },
159
159
  { value: ".7z", label: ".7z" }
160
- ], Cr = Object.fromEntries(
161
- pn.map((e) => [e.value, e.label])
162
- ), Ar = Object.fromEntries(
163
- vt.map((e) => [e.value, e.label])
164
- ), _r = new Set(pn.map((e) => e.value)), Tr = new Set(
165
- vt.map((e) => e.value)
160
+ ], Fr = Object.fromEntries(
161
+ bn.map((e) => [e.value, e.label])
162
+ ), Nr = Object.fromEntries(
163
+ Ct.map((e) => [e.value, e.label])
164
+ ), Ir = new Set(bn.map((e) => e.value)), Er = new Set(
165
+ Ct.map((e) => e.value)
166
166
  );
167
- function xr(e) {
167
+ function Ur(e) {
168
168
  const t = e.trim();
169
- return t ? _r.has(t) ? t : kr[t] ?? null : null;
169
+ return t ? Ir.has(t) ? t : Mr[t] ?? null : null;
170
170
  }
171
- function Mr(e) {
171
+ function wr(e) {
172
172
  return Array.isArray(e) ? e.map((t) => {
173
173
  const n = t.trim().toLowerCase();
174
174
  return n ? n.startsWith(".") ? n : `.${n}` : "";
175
175
  }).filter(Boolean) : [];
176
176
  }
177
- function Fe(e) {
177
+ function Ee(e) {
178
178
  if (!Array.isArray(e)) return [];
179
179
  const t = [], n = /* @__PURE__ */ new Set();
180
180
  for (const r of e) {
181
- const o = xr(r);
181
+ const o = Ur(r);
182
182
  o && !n.has(o) && (n.add(o), t.push(o));
183
183
  }
184
184
  return t;
185
185
  }
186
- function Nr(e) {
187
- const t = Fe(e), n = [];
186
+ function Rr(e) {
187
+ const t = Ee(e), n = [];
188
188
  for (const r of t)
189
- n.push(...br[r] ?? [r]);
189
+ n.push(...Tr[r] ?? [r]);
190
190
  return n;
191
191
  }
192
- function Fr(e) {
193
- const t = Fe(e);
192
+ function Pr(e) {
193
+ const t = Ee(e);
194
194
  if (t.length === 0) return [];
195
195
  const n = /* @__PURE__ */ new Set();
196
196
  for (const r of t)
197
- for (const o of Sr[r] ?? [])
197
+ for (const o of xr[r] ?? [])
198
198
  n.add(o);
199
- return vt.filter((r) => n.has(r.value));
199
+ return Ct.filter((r) => n.has(r.value));
200
200
  }
201
- function bt(e, t) {
202
- const n = Mr(t), r = Fe(e);
201
+ function At(e, t) {
202
+ const n = wr(t), r = Ee(e);
203
203
  if (r.length === 0)
204
- return n.filter((i) => Tr.has(i));
204
+ return n.filter((i) => Er.has(i));
205
205
  const o = new Set(
206
- Fr(r).map((i) => i.value)
206
+ Pr(r).map((i) => i.value)
207
207
  );
208
208
  return n.filter((i) => o.has(i));
209
209
  }
210
- function Ir(e, t) {
211
- const n = Nr(e), r = bt(e, t), o = [...n, ...r];
210
+ function zr(e, t) {
211
+ const n = Rr(e), r = At(e, t), o = [...n, ...r];
212
212
  return o.length > 0 ? o.join(",") : void 0;
213
213
  }
214
- function Er(e, t) {
215
- const n = Fe(e), r = bt(
214
+ function Or(e, t) {
215
+ const n = Ee(e), r = At(
216
216
  n,
217
217
  t
218
218
  ), o = [
219
- ...n.map((i) => Cr[i] ?? i),
220
- ...r.map((i) => Ar[i] ?? i)
219
+ ...n.map((i) => Fr[i] ?? i),
220
+ ...r.map((i) => Nr[i] ?? i)
221
221
  ];
222
222
  return o.length === 0 ? null : o.join("、");
223
223
  }
224
- const Ur = [
224
+ const Br = [
225
225
  "video",
226
226
  "audio",
227
227
  "image",
228
228
  "file",
229
229
  "spreadsheet",
230
230
  "document"
231
- ], Rr = new Set(Ur);
232
- function wr(e) {
233
- return e && Rr.has(e) ? e : "file";
231
+ ], qr = new Set(Br);
232
+ function Lr(e) {
233
+ return e && qr.has(e) ? e : "file";
234
234
  }
235
- function Ie(e) {
236
- return typeof e == "string" && fr.includes(e) ? e : "medium";
235
+ function Ue(e) {
236
+ return typeof e == "string" && Sr.includes(e) ? e : "medium";
237
237
  }
238
- function Pr(e, t) {
238
+ function Vr(e, t) {
239
239
  var o;
240
240
  const n = Math.max(1, t);
241
241
  let r = [];
242
242
  return Array.isArray(e.mediaUrls) ? r = e.mediaUrls.map((i) => String(i).trim()) : (o = e.mediaUrl) != null && o.trim() && (r = [e.mediaUrl.trim()]), r.length === 0 ? [""] : r.slice(0, n);
243
243
  }
244
- function zr(e) {
244
+ function jr(e) {
245
245
  var t;
246
246
  return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
247
247
  }
248
- function Or(e) {
249
- return `form-media-size-${Ie(e)}`;
248
+ function $r(e) {
249
+ return `form-media-size-${Ue(e)}`;
250
250
  }
251
- function Br(e) {
252
- return `form-media-preview form-media-list ${Or(e)}`;
251
+ function Dr(e) {
252
+ return `form-media-preview form-media-list ${$r(e)}`;
253
253
  }
254
- function Wt(e) {
254
+ function Xt(e) {
255
255
  if (typeof e == "number")
256
256
  return Number.isFinite(e) ? String(e) : void 0;
257
257
  if (typeof e != "string") return;
@@ -259,38 +259,38 @@ function Wt(e) {
259
259
  if (!(!t || t.toLowerCase() === "null"))
260
260
  return t;
261
261
  }
262
- function se(e) {
262
+ function ce(e) {
263
263
  if (!Array.isArray(e)) return [];
264
264
  const t = [];
265
265
  for (const n of e) {
266
266
  if (!n || typeof n != "object" || Array.isArray(n)) continue;
267
- const r = n, o = Wt(r.value), i = Wt(r.label);
267
+ const r = n, o = Xt(r.value), i = Xt(r.label);
268
268
  o === void 0 || i === void 0 || t.push({ value: o, label: i });
269
269
  }
270
270
  return t;
271
271
  }
272
- function ue(e) {
273
- return !dn(e.type) || se(e.options).length > 0;
272
+ function fe(e) {
273
+ return !vn(e.type) || ce(e.options).length > 0;
274
274
  }
275
- const qr = 10;
276
- function fn(e) {
275
+ const Hr = 10;
276
+ function Sn(e) {
277
277
  return e && typeof e == "object" && !Array.isArray(e) ? e : {};
278
278
  }
279
- function Ee(e) {
279
+ function we(e) {
280
280
  return e === !0 || e === "true" || e === 1 || e === "1";
281
281
  }
282
- function Oe(e, t = 1) {
282
+ function qe(e, t = 1) {
283
283
  const n = typeof e == "number" ? e : Number(e);
284
284
  return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
285
285
  }
286
- function fe(e, t = 1) {
286
+ function ge(e, t = 1) {
287
287
  const n = typeof e == "number" ? e : Number(e);
288
288
  return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
289
289
  }
290
- function hn(e, t) {
291
- return t == null ? void 0 : e === "toggle" ? Ee(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String).map((o) => o.trim()).filter(Boolean) : typeof t == "string" && t.trim() ? [t.trim()] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t).trim() || void 0;
290
+ function kn(e, t) {
291
+ return t == null ? void 0 : e === "toggle" ? we(t) : e === "multiselect" || e === "checkbox" || e === "file" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String).map((o) => o.trim()).filter(Boolean) : typeof t == "string" && t.trim() ? [t.trim()] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t).trim() || void 0;
292
292
  }
293
- function Lr(e) {
293
+ function Kr(e) {
294
294
  if (Array.isArray(e)) return e.map(String).filter(Boolean);
295
295
  if (typeof e == "string" && e.trim())
296
296
  try {
@@ -300,11 +300,11 @@ function Lr(e) {
300
300
  }
301
301
  return [];
302
302
  }
303
- function Vr(e) {
304
- const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, o = typeof (e == null ? void 0 : e.agentUniqueId) == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, i = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, s = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, a = Lr(e == null ? void 0 : e.flowUniqueIds);
303
+ function Wr(e) {
304
+ const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, o = typeof (e == null ? void 0 : e.agentUniqueId) == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, i = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, s = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, a = Kr(e == null ? void 0 : e.flowUniqueIds);
305
305
  return { agentKind: r, agentUniqueId: o, flowType: i, category: s, flowUniqueIds: a, pageSize: n };
306
306
  }
307
- function jr(e) {
307
+ function Gr(e) {
308
308
  const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0;
309
309
  return {
310
310
  names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
@@ -314,68 +314,68 @@ function jr(e) {
314
314
  pageSize: n
315
315
  };
316
316
  }
317
- function $r(e) {
317
+ function Jr(e) {
318
318
  if (e.type !== "case_singleselect") return e;
319
319
  const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
320
320
  return { ...e, type: "case_multiselect", defaultValue: t };
321
321
  }
322
- function Dr(e) {
322
+ function Yr(e) {
323
323
  var o, i, s, a, l;
324
- const t = $r(e), n = Fe(t.fileAcceptTypes), r = t.type;
324
+ const t = Jr(e), n = Ee(t.fileAcceptTypes), r = t.type;
325
325
  return {
326
- id: ((o = t.id) == null ? void 0 : o.trim()) || ce("block-"),
326
+ id: ((o = t.id) == null ? void 0 : o.trim()) || de("block-"),
327
327
  type: r,
328
328
  name: ((i = t.name) == null ? void 0 : i.trim()) || void 0,
329
329
  label: t.label ?? "",
330
330
  placeholder: t.placeholder ?? "",
331
331
  help: t.help ?? "",
332
332
  required: t.required === !0,
333
- mediaUrls: Se(r) ? Pr(t, qr) : void 0,
334
- mediaSize: Se(r) ? Ie(t.mediaSize) : void 0,
335
- webUrl: ke(r) ? ((s = t.webUrl) == null ? void 0 : s.trim()) ?? "" : void 0,
336
- webHeight: ke(r) ? Ne(t.webHeight) : void 0,
333
+ mediaUrls: _e(r) ? Vr(t, Hr) : void 0,
334
+ mediaSize: _e(r) ? Ue(t.mediaSize) : void 0,
335
+ webUrl: Te(r) ? ((s = t.webUrl) == null ? void 0 : s.trim()) ?? "" : void 0,
336
+ webHeight: Te(r) ? Ie(t.webHeight) : void 0,
337
337
  fileAcceptTypes: n,
338
- fileAcceptExtensions: bt(
338
+ fileAcceptExtensions: At(
339
339
  n,
340
340
  t.fileAcceptExtensions
341
341
  ),
342
- filePlaceholderIcon: wr(t.filePlaceholderIcon),
343
- fileMinCount: r === "file" ? Oe(t.fileMinCount, 1) : void 0,
344
- fileMaxCount: r === "file" ? Oe(t.fileMaxCount, 1) : void 0,
345
- defaultValue: hn(r, t.defaultValue),
342
+ filePlaceholderIcon: Lr(t.filePlaceholderIcon),
343
+ fileMinCount: r === "file" ? qe(t.fileMinCount, 1) : void 0,
344
+ fileMaxCount: r === "file" ? qe(t.fileMaxCount, 1) : void 0,
345
+ defaultValue: kn(r, t.defaultValue),
346
346
  jsonSchemaDescription: ((a = t.jsonSchemaDescription) == null ? void 0 : a.trim()) ?? "",
347
347
  hidden: r === "text" ? t.hidden === !0 : void 0,
348
348
  needLLM: t.needLLM === !0 ? !0 : void 0,
349
- options: Array.isArray(t.options) ? se(t.options) : void 0,
349
+ options: Array.isArray(t.options) ? ce(t.options) : void 0,
350
350
  condition: (l = t.condition) != null && l.fieldName ? {
351
351
  fieldName: t.condition.fieldName.trim(),
352
352
  operator: t.condition.operator ?? "eq",
353
353
  value: t.condition.value
354
354
  } : void 0,
355
355
  resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
356
- resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? fe(t.resumeMinCount, 1) : void 0,
357
- resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? fe(t.resumeMaxCount, 1) : void 0,
358
- resumeFilter: r === "resume_multiselect" ? jr(t.resumeFilter) : void 0,
356
+ resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? ge(t.resumeMinCount, 1) : void 0,
357
+ resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? ge(t.resumeMaxCount, 1) : void 0,
358
+ resumeFilter: r === "resume_multiselect" ? Gr(t.resumeFilter) : void 0,
359
359
  caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
360
- caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? fe(t.caseMinCount, 1) : void 0,
361
- caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? fe(t.caseMaxCount, 1) : void 0,
362
- caseFilter: r === "case_multiselect" ? Vr(t.caseFilter) : void 0
360
+ caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? ge(t.caseMinCount, 1) : void 0,
361
+ caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? ge(t.caseMaxCount, 1) : void 0,
362
+ caseFilter: r === "case_multiselect" ? Wr(t.caseFilter) : void 0
363
363
  };
364
364
  }
365
- function Hr(e) {
366
- return new Set(se(e.options).map((t) => t.value));
365
+ function Qr(e) {
366
+ return new Set(ce(e.options).map((t) => t.value));
367
367
  }
368
- function Gt(e, t) {
368
+ function Zt(e, t) {
369
369
  const n = {
370
370
  type: "array",
371
371
  items: { type: "string" }
372
372
  };
373
- return e !== void 0 && (n.minItems = fe(e, 1)), t !== void 0 && (n.maxItems = fe(t, 1)), n;
373
+ return e !== void 0 && (n.minItems = ge(e, 1)), t !== void 0 && (n.maxItems = ge(t, 1)), n;
374
374
  }
375
- function Kr(e) {
376
- const t = hn(e.type, e.defaultValue);
375
+ function Xr(e) {
376
+ const t = kn(e.type, e.defaultValue);
377
377
  if (t === void 0) return;
378
- const n = Hr(e);
378
+ const n = Qr(e);
379
379
  switch (e.type) {
380
380
  case "toggle":
381
381
  return t;
@@ -398,13 +398,17 @@ function Kr(e) {
398
398
  const r = Array.isArray(t) ? t.map(String).filter(Boolean) : [];
399
399
  return r.length > 0 ? r : void 0;
400
400
  }
401
+ case "file": {
402
+ const r = Array.isArray(t) ? t.map(String).map((o) => o.trim()).filter(Boolean) : [];
403
+ return r.length > 0 ? r : void 0;
404
+ }
401
405
  default:
402
406
  return t;
403
407
  }
404
408
  }
405
- function Wr(e) {
409
+ function Zr(e) {
406
410
  var i, s;
407
- if (!((i = e.name) == null ? void 0 : i.trim()) || !Z(e.type)) return null;
411
+ if (!((i = e.name) == null ? void 0 : i.trim()) || !ee(e.type)) return null;
408
412
  let n;
409
413
  switch (e.type) {
410
414
  case "number":
@@ -416,13 +420,13 @@ function Wr(e) {
416
420
  case "select":
417
421
  case "radio": {
418
422
  n = { type: "string" };
419
- const a = se(e.options).map((l) => l.value);
423
+ const a = ce(e.options).map((l) => l.value);
420
424
  a.length > 0 && (n.enum = a);
421
425
  break;
422
426
  }
423
427
  case "multiselect":
424
428
  case "checkbox": {
425
- const a = se(e.options).map((l) => l.value);
429
+ const a = ce(e.options).map((l) => l.value);
426
430
  n = {
427
431
  type: "array",
428
432
  items: a.length > 0 ? { type: "string", enum: a } : { type: "string" }
@@ -430,20 +434,20 @@ function Wr(e) {
430
434
  break;
431
435
  }
432
436
  case "file": {
433
- const a = Oe(e.fileMinCount, 1), l = Oe(e.fileMaxCount, 1);
434
- l <= 1 ? n = { type: "string" } : n = {
437
+ const a = qe(e.fileMinCount, 1), l = qe(e.fileMaxCount, 1);
438
+ n = {
435
439
  type: "array",
436
440
  items: { type: "string" },
437
441
  minItems: a,
438
- maxItems: l
442
+ ...l > 0 ? { maxItems: l } : {}
439
443
  };
440
444
  break;
441
445
  }
442
446
  case "resume_multiselect":
443
- n = Gt(e.resumeMinCount, e.resumeMaxCount);
447
+ n = Zt(e.resumeMinCount, e.resumeMaxCount);
444
448
  break;
445
449
  case "case_multiselect":
446
- n = Gt(e.caseMinCount, e.caseMaxCount);
450
+ n = Zt(e.caseMinCount, e.caseMaxCount);
447
451
  break;
448
452
  case "text":
449
453
  n = { type: "string" }, e.hidden && (n["x-hidden"] = !0);
@@ -454,16 +458,16 @@ function Wr(e) {
454
458
  }
455
459
  const r = (s = e.jsonSchemaDescription) == null ? void 0 : s.trim();
456
460
  r && (n.$comment = r);
457
- const o = Kr(e);
461
+ const o = Xr(e);
458
462
  return o !== void 0 && (n.default = o), n;
459
463
  }
460
- function Gr(e, t, n) {
464
+ function eo(e, t, n) {
461
465
  var l;
462
466
  const r = {}, o = [];
463
467
  for (const u of e) {
464
468
  const m = (l = u.name) == null ? void 0 : l.trim();
465
- if (!m || !Z(u.type) || !ue(u)) continue;
466
- const d = Wr(u);
469
+ if (!m || !ee(u.type) || !fe(u)) continue;
470
+ const d = Zr(u);
467
471
  d && (r[m] = d, u.required && o.push(m));
468
472
  }
469
473
  const i = {
@@ -474,35 +478,35 @@ function Gr(e, t, n) {
474
478
  }, s = t == null ? void 0 : t.trim(), a = n == null ? void 0 : n.trim();
475
479
  return s && (i.title = s), a && (i.description = a), i;
476
480
  }
477
- function Ce(e) {
481
+ function xe(e) {
478
482
  const t = e.title ?? "", n = e.description ?? "";
479
483
  return {
480
484
  title: t,
481
485
  description: n,
482
486
  blocks: e.blocks,
483
- jsonSchema: Gr(e.blocks, t, n)
487
+ jsonSchema: eo(e.blocks, t, n)
484
488
  };
485
489
  }
486
- function Ve(e) {
490
+ function $e(e) {
487
491
  if (!e || !Array.isArray(e.blocks))
488
- return Ce({ title: "", description: "", blocks: [] });
489
- const t = e.blocks.map(Dr);
490
- return Ce({
492
+ return xe({ title: "", description: "", blocks: [] });
493
+ const t = e.blocks.map(Yr);
494
+ return xe({
491
495
  title: typeof e.title == "string" ? e.title : "",
492
496
  description: typeof e.description == "string" ? e.description : "",
493
497
  blocks: t
494
498
  });
495
499
  }
496
- function Ps() {
497
- return Ce({ title: "", description: "", blocks: [] });
500
+ function Gs() {
501
+ return xe({ title: "", description: "", blocks: [] });
498
502
  }
499
- function zs(e) {
503
+ function Js(e) {
500
504
  const t = {
501
- id: ce("block-"),
505
+ id: de("block-"),
502
506
  type: e,
503
507
  label: e
504
508
  };
505
- return Z(e) && (t.label = "", t.name = ce("field_"), t.placeholder = "", t.required = !1), Se(e) && (t.label = "", t.placeholder = "", t.help = "", t.mediaUrls = [""], t.mediaSize = "medium"), ke(e) && (t.label = "", t.help = "", t.webUrl = "", t.webHeight = ut), dn(e) && (t.options = [
509
+ return ee(e) && (t.label = "", t.name = de("field_"), t.placeholder = "", t.required = !1), _e(e) && (t.label = "", t.placeholder = "", t.help = "", t.mediaUrls = [""], t.mediaSize = "medium"), Te(e) && (t.label = "", t.help = "", t.webUrl = "", t.webHeight = ft), vn(e) && (t.options = [
506
510
  { value: "option_1", label: "选项 1" },
507
511
  { value: "option_2", label: "选项 2" }
508
512
  ]), e === "file" && (t.fileAcceptTypes = [], t.fileAcceptExtensions = [], t.filePlaceholderIcon = "file", t.fileMinCount = 1, t.fileMaxCount = 1), e === "resume_multiselect" && (t.resumeEnableRefresh = !0, t.resumeMinCount = 1, t.resumeMaxCount = 1, t.resumeFilter = {
@@ -512,7 +516,7 @@ function zs(e) {
512
516
  pageSize: 20
513
517
  }, t.defaultValue = []), e === "case_multiselect" && (t.caseEnableRefresh = !0, t.caseMinCount = 1, t.caseMaxCount = 1, t.caseFilter = { flowUniqueIds: [], pageSize: 20 }, t.defaultValue = []), t;
514
518
  }
515
- function Jr(e) {
519
+ function to(e) {
516
520
  const t = typeof e.pageSize == "number" ? e.pageSize : Number(e.pageSize), n = typeof e.agentKind == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, r = typeof e.agentUniqueId == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, o = typeof e.flowType == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, i = typeof e.category == "string" && e.category.trim() ? e.category.trim() : void 0, s = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
517
521
  return {
518
522
  agentKind: n,
@@ -523,13 +527,13 @@ function Jr(e) {
523
527
  pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
524
528
  };
525
529
  }
526
- function Jt(e) {
530
+ function en(e) {
527
531
  if (e == null) return;
528
532
  const t = typeof e == "number" ? e : Number(e);
529
533
  if (!(!Number.isFinite(t) || t < 1))
530
534
  return Math.floor(t);
531
535
  }
532
- function Yr(e, t) {
536
+ function no(e, t) {
533
537
  var s, a, l, u, m, d;
534
538
  const { id: n, label: r, path: o, withData: i } = t;
535
539
  return i({
@@ -552,7 +556,7 @@ function Yr(e, t) {
552
556
  value: { path: o }
553
557
  });
554
558
  }
555
- function Xr(e, t, n) {
559
+ function ro(e, t, n) {
556
560
  const r = n.nameFromValue(e.value), o = {
557
561
  ...t("case_multiselect"),
558
562
  name: r,
@@ -560,23 +564,23 @@ function Xr(e, t, n) {
560
564
  }, i = n.asLiteral(e.placeholder);
561
565
  i && (o.placeholder = i);
562
566
  const s = n.asLiteral(e.help);
563
- s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = Jr(e.caseFilter));
564
- const a = Jt(e.minCount);
567
+ s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = to(e.caseFilter));
568
+ const a = en(e.minCount);
565
569
  a !== void 0 && (o.caseMinCount = a);
566
- const l = Jt(e.maxCount);
570
+ const l = en(e.maxCount);
567
571
  return l !== void 0 && (o.caseMaxCount = l), o;
568
572
  }
569
- const gn = Te(
573
+ const Cn = be(
570
574
  null
571
575
  );
572
- function Qr(e) {
576
+ function oo(e) {
573
577
  try {
574
578
  return JSON.stringify(e);
575
579
  } catch {
576
580
  return String(e.length);
577
581
  }
578
582
  }
579
- const Zr = {
583
+ const io = {
580
584
  publishLiveOptions: () => {
581
585
  },
582
586
  liveOptions: /* @__PURE__ */ new Map(),
@@ -585,23 +589,23 @@ const Zr = {
585
589
  clearPendingChangeFields: () => {
586
590
  }
587
591
  };
588
- function eo({ children: e }) {
589
- const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] = E(0), [s, a] = E(() => /* @__PURE__ */ new Map()), [l, u] = E(
592
+ function so({ children: e }) {
593
+ const t = x(/* @__PURE__ */ new Map()), n = x(/* @__PURE__ */ new Map()), r = x([]), [o, i] = w(0), [s, a] = w(() => /* @__PURE__ */ new Map()), [l, u] = w(
590
594
  []
591
- ), m = j(
592
- (y, S) => {
595
+ ), m = L(
596
+ (y, T) => {
593
597
  const g = y.trim();
594
598
  if (!g) return;
595
- const k = S.map((p) => ({
599
+ const C = T.map((p) => ({
596
600
  value: String(p.value ?? ""),
597
601
  label: String(p.label ?? p.value ?? "")
598
- })), h = Qr(k);
599
- n.current.get(g) !== h && (n.current.set(g, h), t.current.set(g, k), r.current.includes(g) || (r.current = [...r.current, g]), a(new Map(t.current)), u(r.current), i((p) => p + 1));
602
+ })), v = oo(C);
603
+ n.current.get(g) !== v && (n.current.set(g, v), t.current.set(g, C), r.current.includes(g) || (r.current = [...r.current, g]), a(new Map(t.current)), u(r.current), i((p) => p + 1));
600
604
  },
601
605
  []
602
- ), d = j(() => {
606
+ ), d = L(() => {
603
607
  r.current = [], u([]);
604
- }, []), b = V(
608
+ }, []), k = $(
605
609
  () => ({
606
610
  publishLiveOptions: m,
607
611
  liveOptions: s,
@@ -617,26 +621,26 @@ function eo({ children: e }) {
617
621
  d
618
622
  ]
619
623
  );
620
- return /* @__PURE__ */ c(gn.Provider, { value: b, children: e });
624
+ return /* @__PURE__ */ c(Cn.Provider, { value: k, children: e });
621
625
  }
622
- function St() {
623
- return xe(gn) ?? Zr;
626
+ function _t() {
627
+ return Se(Cn) ?? io;
624
628
  }
625
- const yn = Te({ interactive: !0 });
626
- function mt({
629
+ const An = be({ interactive: !0 });
630
+ function pt({
627
631
  interactive: e,
628
632
  children: t
629
633
  }) {
630
- return /* @__PURE__ */ c(yn.Provider, { value: { interactive: e }, children: t });
634
+ return /* @__PURE__ */ c(An.Provider, { value: { interactive: e }, children: t });
631
635
  }
632
- function ae() {
633
- return xe(yn);
636
+ function ue() {
637
+ return Se(An);
634
638
  }
635
- const vn = Te(null);
636
- function to(e) {
639
+ const _n = be(null);
640
+ function ao(e) {
637
641
  return e != null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
638
642
  }
639
- const no = {
643
+ const lo = {
640
644
  reportEvent: () => {
641
645
  },
642
646
  reportData: () => {
@@ -644,7 +648,7 @@ const no = {
644
648
  runAutoControl: (e) => e(),
645
649
  isAutoControl: () => !1
646
650
  };
647
- function ro(e) {
651
+ function co(e) {
648
652
  const t = {};
649
653
  for (const [n, r] of Object.entries(e.form_values ?? {}))
650
654
  r !== void 0 && (t[n] = r);
@@ -654,13 +658,13 @@ function ro(e) {
654
658
  form_change: Array.isArray(e.form_change) ? [...e.form_change] : []
655
659
  };
656
660
  }
657
- function oo({
661
+ function uo({
658
662
  client: e,
659
663
  children: t
660
664
  }) {
661
- const n = A(0), r = A(e);
665
+ const n = x(0), r = x(e);
662
666
  r.current = e;
663
- const o = j((u) => {
667
+ const o = L((u) => {
664
668
  const m = r.current;
665
669
  if (!m) return;
666
670
  const d = {
@@ -668,12 +672,12 @@ function oo({
668
672
  component: u.component
669
673
  };
670
674
  u.field !== void 0 && (d.field = u.field), u.value !== void 0 && (d.value = u.value);
671
- const b = n.current > 0 ? "form_auto_control_bac_event" : "form_runtime_event";
672
- m.send(b, d);
673
- }, []), i = j((u) => {
675
+ const k = n.current > 0 ? "form_auto_control_bac_event" : "form_runtime_event";
676
+ m.send(k, d);
677
+ }, []), i = L((u) => {
674
678
  const m = r.current;
675
- m && m.send("form_runtime_data", ro(u));
676
- }, []), s = j((u) => {
679
+ m && m.send("form_runtime_data", co(u));
680
+ }, []), s = L((u) => {
677
681
  n.current += 1;
678
682
  let m;
679
683
  try {
@@ -681,13 +685,13 @@ function oo({
681
685
  } catch (d) {
682
686
  throw n.current = Math.max(0, n.current - 1), d;
683
687
  }
684
- return to(m) ? Promise.resolve(m).finally(() => {
688
+ return ao(m) ? Promise.resolve(m).finally(() => {
685
689
  n.current = Math.max(0, n.current - 1);
686
690
  }) : (n.current = Math.max(0, n.current - 1), m);
687
- }, []), a = j(
691
+ }, []), a = L(
688
692
  () => n.current > 0,
689
693
  []
690
- ), l = V(
694
+ ), l = $(
691
695
  () => ({
692
696
  reportEvent: o,
693
697
  reportData: i,
@@ -696,143 +700,138 @@ function oo({
696
700
  }),
697
701
  [o, i, s, a]
698
702
  );
699
- return /* @__PURE__ */ c(vn.Provider, { value: l, children: t });
703
+ return /* @__PURE__ */ c(_n.Provider, { value: l, children: t });
700
704
  }
701
- function bn() {
702
- return xe(vn) ?? no;
705
+ function Tn() {
706
+ return Se(_n) ?? lo;
703
707
  }
704
- const io = 300;
705
- function Sn(e) {
708
+ const mo = 300;
709
+ function fo(e) {
706
710
  return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
707
711
  }
708
- function so(e) {
712
+ function po(e) {
709
713
  if (!e) return;
710
714
  const t = e.trim();
711
715
  if (t)
712
716
  return t.startsWith("/") ? t.slice(1) : t;
713
717
  }
714
- function Yt(e, t = "value") {
715
- const r = e.componentModel.properties[t];
716
- if (!(!Sn(r) || r === void 0))
717
- return e.dataContext.resolveDynamicValue(r);
718
- }
719
- function le(e, t = "value", n = {}) {
720
- const o = e.componentModel.properties[t], i = Sn(o), s = so(i), a = bn(), {
718
+ function me(e, t = "value", n = {}) {
719
+ const o = e.componentModel.properties[t], i = fo(o), s = po(i), a = Tn(), {
721
720
  component: l = "Unknown",
722
721
  changeAction: u = "change",
723
722
  debounceChange: m = !1
724
- } = n, d = A(null), b = A(void 0), y = A(!1), S = A(a);
725
- S.current = a;
726
- const g = A(u);
723
+ } = n, d = x(null), k = x(void 0), y = x(!1), T = x(a);
724
+ T.current = a;
725
+ const g = x(u);
727
726
  g.current = u;
728
- const k = A(l);
729
- k.current = l;
730
- const h = A(s);
731
- h.current = s, B(() => () => {
732
- d.current != null && (clearTimeout(d.current), d.current = null), y.current && h.current && (y.current = !1, S.current.reportEvent({
727
+ const C = x(l);
728
+ C.current = l;
729
+ const v = x(s);
730
+ v.current = s, z(() => () => {
731
+ d.current != null && (clearTimeout(d.current), d.current = null), y.current && v.current && (y.current = !1, T.current.reportEvent({
733
732
  action: g.current,
734
- component: k.current,
735
- field: h.current,
736
- value: b.current
733
+ component: C.current,
734
+ field: v.current,
735
+ value: k.current
737
736
  }));
738
737
  }, []);
739
- const p = j(
740
- (q) => {
738
+ const p = L(
739
+ (I) => {
741
740
  if (!i || o === void 0) return () => {
742
741
  };
743
- const L = e.dataContext.subscribeDynamicValue(o, () => q());
744
- return () => L.unsubscribe();
742
+ const A = e.dataContext.subscribeDynamicValue(o, () => I());
743
+ return () => A.unsubscribe();
745
744
  },
746
745
  [e, o, i]
747
- ), v = j(() => {
746
+ ), S = L(() => {
748
747
  if (!(!i || o === void 0))
749
748
  return e.dataContext.resolveDynamicValue(o);
750
- }, [e, o, i]), M = Gn(p, v, v), N = j(
751
- (q) => {
749
+ }, [e, o, i]), N = er(p, S, S), O = L(
750
+ (I) => {
752
751
  if (!s) return;
753
- const L = () => {
754
- y.current = !1, S.current.reportEvent({
752
+ const A = () => {
753
+ y.current = !1, T.current.reportEvent({
755
754
  action: u,
756
755
  component: l,
757
756
  field: s,
758
- value: q
757
+ value: I
759
758
  });
760
759
  };
761
760
  if (!m) {
762
- L();
761
+ A();
763
762
  return;
764
763
  }
765
- b.current = q, y.current = !0, d.current != null && clearTimeout(d.current), d.current = setTimeout(() => {
766
- d.current = null, L();
767
- }, io);
764
+ k.current = I, y.current = !0, d.current != null && clearTimeout(d.current), d.current = setTimeout(() => {
765
+ d.current = null, A();
766
+ }, mo);
768
767
  },
769
768
  [s, u, l, m]
770
- ), _ = j(
771
- (q) => {
772
- !i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path), q);
769
+ ), F = L(
770
+ (I) => {
771
+ !i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path), I);
773
772
  },
774
773
  [e, o, i]
775
- ), z = j(
776
- (q) => {
777
- _(q), N(q);
774
+ ), j = L(
775
+ (I) => {
776
+ F(I), O(I);
778
777
  },
779
- [_, N]
780
- ), C = j(() => {
781
- s && S.current.reportEvent({
778
+ [F, O]
779
+ ), H = L(() => {
780
+ s && T.current.reportEvent({
782
781
  action: "focus",
783
782
  component: l,
784
783
  field: s
785
784
  });
786
785
  }, [s, l]);
787
786
  return {
788
- value: M,
789
- setValue: z,
787
+ value: N,
788
+ setValue: j,
790
789
  /** 写入 dataModel 但不上报(用于模式切换规范化等内部同步) */
791
- setValueSilent: _,
790
+ setValueSilent: F,
792
791
  hasBinding: !!i,
793
792
  fieldName: s,
794
- reportFocus: C
793
+ reportFocus: H
795
794
  };
796
795
  }
797
- function Ae(e) {
796
+ function Me(e) {
798
797
  if (typeof e == "string") return e || void 0;
799
798
  if (typeof e == "number") return String(e);
800
799
  }
801
- function Q(e) {
800
+ function ne(e) {
802
801
  return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
803
802
  }
804
- function kn(e, t) {
805
- return t ? Array.isArray(e) ? null : Q(e) : Array.isArray(e) ? e.length > 0 ? String(e[0]) : "" : e == null || typeof e == "string" || typeof e == "number" ? null : "";
803
+ function xn(e, t) {
804
+ return t ? Array.isArray(e) ? null : ne(e) : Array.isArray(e) ? e.length > 0 ? String(e[0]) : "" : e == null || typeof e == "string" || typeof e == "number" ? null : "";
806
805
  }
807
- function Be(e) {
806
+ function Le(e) {
808
807
  if (e == null) return;
809
808
  const t = typeof e == "number" ? e : Number(e);
810
809
  if (!(!Number.isFinite(t) || t < 1))
811
810
  return Math.floor(t);
812
811
  }
813
- function Cn(e, t, n, r) {
812
+ function Mn(e, t, n, r) {
814
813
  return e.includes(t) ? e.filter((i) => i !== t) : r === 1 ? [t] : r !== void 0 && e.length >= r ? null : [...e, t];
815
814
  }
816
- function An(e, t, n, r, o) {
815
+ function Fn(e, t, n, r, o) {
817
816
  return n ? e.includes(t) || o === 1 ? !1 : o !== void 0 && e.length >= o : !0;
818
817
  }
819
- function _n(e, t) {
818
+ function Nn(e, t) {
820
819
  return t === void 0 || e.length <= t ? null : e.slice(0, t);
821
820
  }
822
- const Tn = Te(null);
823
- function dt({
821
+ const In = be(null);
822
+ function ht({
824
823
  caseSearch: e,
825
824
  children: t
826
825
  }) {
827
- return /* @__PURE__ */ c(Tn.Provider, { value: e ?? null, children: t });
826
+ return /* @__PURE__ */ c(In.Provider, { value: e ?? null, children: t });
828
827
  }
829
- function ao() {
830
- return xe(Tn);
828
+ function ho() {
829
+ return Se(In);
831
830
  }
832
- function tt(e) {
831
+ function ot(e) {
833
832
  return typeof e == "string" ? e : "";
834
833
  }
835
- function lo(e) {
834
+ function go(e) {
836
835
  if (Array.isArray(e)) return e.map(String).filter(Boolean);
837
836
  if (typeof e == "string" && e.trim())
838
837
  try {
@@ -842,21 +841,21 @@ function lo(e) {
842
841
  }
843
842
  return [];
844
843
  }
845
- function nt(e) {
844
+ function it(e) {
846
845
  if (!e || typeof e != "object")
847
846
  return { flowUniqueIds: [], pageSize: 20 };
848
- const t = e, n = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), r = Number.isFinite(n) && n >= 1 && n <= 100 ? Math.floor(n) : 20, o = typeof t.agentKind == "string" && t.agentKind.trim() ? t.agentKind.trim() : void 0, i = typeof t.agentUniqueId == "string" && t.agentUniqueId.trim() ? t.agentUniqueId.trim() : void 0, s = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, a = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, l = lo(t.flowUniqueIds);
847
+ const t = e, n = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), r = Number.isFinite(n) && n >= 1 && n <= 100 ? Math.floor(n) : 20, o = typeof t.agentKind == "string" && t.agentKind.trim() ? t.agentKind.trim() : void 0, i = typeof t.agentUniqueId == "string" && t.agentUniqueId.trim() ? t.agentUniqueId.trim() : void 0, s = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, a = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, l = go(t.flowUniqueIds);
849
848
  return { agentKind: o, agentUniqueId: i, flowType: s, category: a, flowUniqueIds: l, pageSize: r };
850
849
  }
851
- function rt(e) {
850
+ function st(e) {
852
851
  var r;
853
852
  const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
854
853
  return t || n;
855
854
  }
856
- function co(e) {
855
+ function yo(e) {
857
856
  return JSON.stringify(e);
858
857
  }
859
- const uo = {
858
+ const vo = {
860
859
  name: "SkoponCaseSelect",
861
860
  schema: f.object({
862
861
  label: f.any().optional(),
@@ -869,13 +868,13 @@ const uo = {
869
868
  value: f.any().optional()
870
869
  }).passthrough()
871
870
  };
872
- function mo({
871
+ function bo({
873
872
  item: e,
874
873
  selected: t,
875
874
  disabled: n,
876
875
  onToggle: r
877
876
  }) {
878
- return /* @__PURE__ */ x(
877
+ return /* @__PURE__ */ U(
879
878
  "button",
880
879
  {
881
880
  type: "button",
@@ -883,11 +882,11 @@ function mo({
883
882
  disabled: n,
884
883
  onClick: r,
885
884
  children: [
886
- /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ c(rn, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
887
- /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-body", children: [
885
+ /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ c(un, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
886
+ /* @__PURE__ */ U("div", { className: "skopon-resume-select-card-body", children: [
888
887
  /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-name", children: e.name }),
889
888
  e.description ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
890
- /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-meta", children: [
889
+ /* @__PURE__ */ U("div", { className: "skopon-resume-select-card-meta", children: [
891
890
  e.caseUniqueId,
892
891
  e.platform ? ` · ${e.platform}` : "",
893
892
  e.link ? ` · ${e.link}` : ""
@@ -897,120 +896,120 @@ function mo({
897
896
  }
898
897
  );
899
898
  }
900
- function po({ context: e }) {
901
- const { interactive: t } = ae(), n = ao(), { publishLiveOptions: r } = St(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = le(e, "value", {
899
+ function So({ context: e }) {
900
+ const { interactive: t } = ue(), n = ho(), { publishLiveOptions: r } = _t(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = me(e, "value", {
902
901
  component: "SkoponCaseSelect",
903
902
  changeAction: "click"
904
- }), l = e.componentModel.properties, u = tt(l.label), m = tt(l.placeholder), d = tt(l.help), b = l.enableRefresh !== !1, y = Be(l.minCount), S = Be(l.maxCount), g = V(() => nt(l.caseFilter), [l.caseFilter]), k = co(g), [h, p] = E(1), [v, M] = E(!1), [N, _] = E(""), [z, C] = E([]), [q, L] = E(0), [re, K] = E(g.pageSize ?? 20), $ = A(0), Y = Q(o);
905
- B(() => {
906
- const T = _n(Y, S);
907
- T !== null && s(T);
908
- }, [S, Y, s]);
909
- const te = V(() => n ? rt(g) ? N || m || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, N, m]), ne = j(
910
- async (T) => {
911
- const D = nt(JSON.parse(k)), R = ++$.current;
912
- if (!n || !rt(D)) {
913
- C([]), L(0), _(""), M(!1);
903
+ }), l = e.componentModel.properties, u = ot(l.label), m = ot(l.placeholder), d = ot(l.help), k = l.enableRefresh !== !1, y = Le(l.minCount), T = Le(l.maxCount), g = $(() => it(l.caseFilter), [l.caseFilter]), C = yo(g), [v, p] = w(1), [S, N] = w(!1), [O, F] = w(""), [j, H] = w([]), [I, A] = w(0), [Y, G] = w(g.pageSize ?? 20), W = x(0), q = ne(o);
904
+ z(() => {
905
+ const h = Nn(q, T);
906
+ h !== null && s(h);
907
+ }, [T, q, s]);
908
+ const D = $(() => n ? st(g) ? O || m || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, O, m]), ie = L(
909
+ async (h) => {
910
+ const b = it(JSON.parse(C)), R = ++W.current;
911
+ if (!n || !st(b)) {
912
+ H([]), A(0), F(""), N(!1);
914
913
  return;
915
914
  }
916
- M(!0), _("");
915
+ N(!0), F("");
917
916
  try {
918
- const I = await n({ filter: D, page: T });
919
- if (R !== $.current) return;
920
- C(I.list), L(I.total), p(I.page), K(I.pageSize), a && r(
917
+ const M = await n({ filter: b, page: h });
918
+ if (R !== W.current) return;
919
+ H(M.list), A(M.total), p(M.page), G(M.pageSize), a && r(
921
920
  a,
922
- I.list.map((X) => ({
923
- value: X.caseUniqueId,
924
- label: X.name || X.caseUniqueId
921
+ M.list.map((E) => ({
922
+ value: E.caseUniqueId,
923
+ label: E.name || E.caseUniqueId
925
924
  }))
926
925
  );
927
- } catch (I) {
928
- if (R !== $.current) return;
929
- C([]), L(0), _(I instanceof Error ? I.message : "加载案例列表失败");
926
+ } catch (M) {
927
+ if (R !== W.current) return;
928
+ H([]), A(0), F(M instanceof Error ? M.message : "加载案例列表失败");
930
929
  } finally {
931
- R === $.current && M(!1);
930
+ R === W.current && N(!1);
932
931
  }
933
932
  },
934
- [n, k, a, r]
933
+ [n, C, a, r]
935
934
  );
936
- B(() => {
937
- p(1), ne(1);
938
- }, [k, ne]);
939
- const U = (T) => {
935
+ z(() => {
936
+ p(1), ie(1);
937
+ }, [C, ie]);
938
+ const oe = (h) => {
940
939
  if (!t) return;
941
- const D = Cn(
942
- Y,
943
- T,
940
+ const b = Mn(
941
+ q,
942
+ h,
944
943
  y,
945
- S
944
+ T
946
945
  );
947
- D !== null && i(D);
948
- }, P = () => {
949
- const T = nt(JSON.parse(k)), D = re || T.pageSize || 20, R = Math.max(1, Math.ceil(q / D)), I = h >= R ? 1 : h + 1;
950
- ne(I);
946
+ b !== null && i(b);
947
+ }, _ = () => {
948
+ const h = it(JSON.parse(C)), b = Y || h.pageSize || 20, R = Math.max(1, Math.ceil(I / b)), M = v >= R ? 1 : v + 1;
949
+ ie(M);
951
950
  };
952
- return /* @__PURE__ */ x(
951
+ return /* @__PURE__ */ U(
953
952
  "div",
954
953
  {
955
954
  className: "form-block-preview skopon-resume-select",
956
955
  "data-skopon-field": a || void 0,
957
956
  children: [
958
957
  u ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: u }) : null,
959
- v && z.length === 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-status", children: [
960
- /* @__PURE__ */ c(yt, { size: "small" }),
958
+ S && j.length === 0 ? /* @__PURE__ */ U("div", { className: "skopon-resume-select-status", children: [
959
+ /* @__PURE__ */ c(kt, { size: "small" }),
961
960
  " 加载案例…"
962
961
  ] }) : null,
963
- !v && z.length === 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-empty", children: te }) : null,
964
- z.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-list", children: z.map((T) => /* @__PURE__ */ c(
965
- mo,
962
+ !S && j.length === 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-empty", children: D }) : null,
963
+ j.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-list", children: j.map((h) => /* @__PURE__ */ c(
964
+ bo,
966
965
  {
967
- item: T,
968
- selected: Y.includes(T.caseUniqueId),
969
- disabled: An(
970
- Y,
971
- T.caseUniqueId,
966
+ item: h,
967
+ selected: q.includes(h.caseUniqueId),
968
+ disabled: Fn(
969
+ q,
970
+ h.caseUniqueId,
972
971
  t,
973
972
  y,
974
- S
973
+ T
975
974
  ),
976
- onToggle: () => U(T.caseUniqueId)
975
+ onToggle: () => oe(h.caseUniqueId)
977
976
  },
978
- T.caseUniqueId
977
+ h.caseUniqueId
979
978
  )) }) : null,
980
- b && n && rt(g) ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ c(
981
- Me,
979
+ k && n && st(g) ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ c(
980
+ Ne,
982
981
  {
983
982
  type: "default",
984
983
  size: "small",
985
- icon: /* @__PURE__ */ c(nn, {}),
986
- loading: v,
984
+ icon: /* @__PURE__ */ c(cn, {}),
985
+ loading: S,
987
986
  disabled: !t,
988
- onClick: P,
987
+ onClick: _,
989
988
  children: "换一批"
990
989
  }
991
990
  ) }) : null,
992
- d ? /* @__PURE__ */ c(ee.Text, { type: "secondary", className: "form-block-preview-help", children: d }) : null
991
+ d ? /* @__PURE__ */ c(re.Text, { type: "secondary", className: "form-block-preview-help", children: d }) : null
993
992
  ]
994
993
  }
995
994
  );
996
995
  }
997
- const fo = J(
998
- uo,
999
- po
1000
- ), ho = {
996
+ const ko = Z(
997
+ vo,
998
+ So
999
+ ), Co = {
1001
1000
  type: "case_multiselect",
1002
1001
  componentName: "SkoponCaseSelect",
1003
- toComponent: Yr,
1004
- fromComponent: Xr,
1005
- catalogComponents: [fo]
1002
+ toComponent: no,
1003
+ fromComponent: ro,
1004
+ catalogComponents: [ko]
1006
1005
  };
1007
- function Xt(e) {
1006
+ function tn(e) {
1008
1007
  if (e == null) return;
1009
1008
  const t = typeof e == "number" ? e : Number(e);
1010
1009
  if (!(!Number.isFinite(t) || t < 1))
1011
1010
  return Math.floor(t);
1012
1011
  }
1013
- function go(e, t) {
1012
+ function Ao(e, t) {
1014
1013
  var s, a, l, u;
1015
1014
  const { id: n, label: r, path: o, withData: i } = t;
1016
1015
  return i({
@@ -1031,7 +1030,7 @@ function go(e, t) {
1031
1030
  value: { path: o }
1032
1031
  });
1033
1032
  }
1034
- function yo(e, t, n) {
1033
+ function _o(e, t, n) {
1035
1034
  const r = n.nameFromValue(e.value), o = {
1036
1035
  ...t("resume_multiselect"),
1037
1036
  name: r,
@@ -1048,34 +1047,34 @@ function yo(e, t, n) {
1048
1047
  pageSize: typeof u.pageSize == "number" ? u.pageSize : 20
1049
1048
  };
1050
1049
  }
1051
- const a = Xt(e.minCount);
1050
+ const a = tn(e.minCount);
1052
1051
  a !== void 0 && (o.resumeMinCount = a);
1053
- const l = Xt(e.maxCount);
1052
+ const l = tn(e.maxCount);
1054
1053
  return l !== void 0 && (o.resumeMaxCount = l), o;
1055
1054
  }
1056
- const xn = Te(null);
1057
- function pt({
1055
+ const En = be(null);
1056
+ function gt({
1058
1057
  resumeSearch: e,
1059
1058
  children: t
1060
1059
  }) {
1061
- return /* @__PURE__ */ c(xn.Provider, { value: e ?? null, children: t });
1060
+ return /* @__PURE__ */ c(En.Provider, { value: e ?? null, children: t });
1062
1061
  }
1063
- function vo() {
1064
- return xe(xn);
1062
+ function To() {
1063
+ return Se(En);
1065
1064
  }
1066
- function ot(e) {
1065
+ function at(e) {
1067
1066
  return typeof e == "string" ? e : "";
1068
1067
  }
1069
- function it(e) {
1068
+ function lt(e) {
1070
1069
  if (!e || typeof e != "object")
1071
1070
  return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
1072
1071
  const t = e, n = Array.isArray(t.names) ? t.names.map(String).filter(Boolean) : [], r = Array.isArray(t.agentUniqueIds) ? t.agentUniqueIds.map(String).filter(Boolean) : [], o = Array.isArray(t.resumeUniqueIds) ? t.resumeUniqueIds.map(String).filter(Boolean) : [], i = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), s = Number.isFinite(i) && i >= 1 && i <= 100 ? Math.floor(i) : 20;
1073
1072
  return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: s };
1074
1073
  }
1075
- function bo(e) {
1074
+ function xo(e) {
1076
1075
  return JSON.stringify(e);
1077
1076
  }
1078
- const So = {
1077
+ const Mo = {
1079
1078
  name: "SkoponResumeSelect",
1080
1079
  schema: f.object({
1081
1080
  label: f.any().optional(),
@@ -1087,40 +1086,40 @@ const So = {
1087
1086
  maxCount: f.any().optional(),
1088
1087
  value: f.any().optional()
1089
1088
  }).passthrough()
1090
- }, ko = 3, Co = 2;
1091
- function st(e, t) {
1092
- const n = (t ?? []).filter(Boolean), r = n.slice(0, ko), o = n.length - r.length;
1093
- return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-tags", children: [
1089
+ }, Fo = 3, No = 2;
1090
+ function ct(e, t) {
1091
+ const n = (t ?? []).filter(Boolean), r = n.slice(0, Fo), o = n.length - r.length;
1092
+ return /* @__PURE__ */ U("div", { className: "skopon-resume-select-card-tags", children: [
1094
1093
  /* @__PURE__ */ c("span", { className: "skopon-resume-select-card-tags-label", children: e }),
1095
- n.length > 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-tags-list", children: [
1096
- r.map((i) => /* @__PURE__ */ c(be, { className: "skopon-resume-select-card-tag", children: i }, i)),
1097
- o > 0 ? /* @__PURE__ */ x(be, { className: "skopon-resume-select-card-tag", children: [
1094
+ n.length > 0 ? /* @__PURE__ */ U("div", { className: "skopon-resume-select-card-tags-list", children: [
1095
+ r.map((i) => /* @__PURE__ */ c(Ae, { className: "skopon-resume-select-card-tag", children: i }, i)),
1096
+ o > 0 ? /* @__PURE__ */ U(Ae, { className: "skopon-resume-select-card-tag", children: [
1098
1097
  "+",
1099
1098
  o
1100
1099
  ] }) : null
1101
1100
  ] }) : /* @__PURE__ */ c("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
1102
1101
  ] });
1103
1102
  }
1104
- function Ao(e) {
1105
- return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-field", children: [
1103
+ function Io(e) {
1104
+ return /* @__PURE__ */ U("div", { className: "skopon-resume-select-card-field", children: [
1106
1105
  /* @__PURE__ */ c("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
1107
1106
  /* @__PURE__ */ c("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
1108
1107
  ] });
1109
1108
  }
1110
- function _o({ work: e }) {
1111
- return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-work", children: [
1112
- /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ c("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ c(ar, { className: "skopon-resume-select-card-work-placeholder" }) }),
1109
+ function Eo({ work: e }) {
1110
+ return /* @__PURE__ */ U("div", { className: "skopon-resume-select-card-work", children: [
1111
+ /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ c("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ c(fr, { className: "skopon-resume-select-card-work-placeholder" }) }),
1113
1112
  /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
1114
1113
  ] });
1115
1114
  }
1116
- function To({
1115
+ function Uo({
1117
1116
  item: e,
1118
1117
  selected: t,
1119
1118
  disabled: n,
1120
1119
  onToggle: r
1121
1120
  }) {
1122
- const o = (e.works ?? []).slice(0, Co);
1123
- return /* @__PURE__ */ x(
1121
+ const o = (e.works ?? []).slice(0, No);
1122
+ return /* @__PURE__ */ U(
1124
1123
  "button",
1125
1124
  {
1126
1125
  type: "button",
@@ -1129,161 +1128,161 @@ function To({
1129
1128
  onClick: r,
1130
1129
  children: [
1131
1130
  /* @__PURE__ */ c(
1132
- Xn,
1131
+ rr,
1133
1132
  {
1134
1133
  size: 48,
1135
1134
  src: e.avatarUrl || void 0,
1136
- icon: e.avatarUrl ? void 0 : /* @__PURE__ */ c(sr, {}),
1135
+ icon: e.avatarUrl ? void 0 : /* @__PURE__ */ c(dr, {}),
1137
1136
  className: "skopon-resume-select-card-avatar"
1138
1137
  }
1139
1138
  ),
1140
1139
  /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
1141
- /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-body", children: [
1142
- Ao(e.satisfaction),
1143
- st("性格", e.personality),
1144
- st("专长", e.specialties),
1145
- st("擅长领域", e.traits),
1146
- /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-works", children: [
1140
+ /* @__PURE__ */ U("div", { className: "skopon-resume-select-card-body", children: [
1141
+ Io(e.satisfaction),
1142
+ ct("性格", e.personality),
1143
+ ct("专长", e.specialties),
1144
+ ct("擅长领域", e.traits),
1145
+ /* @__PURE__ */ U("div", { className: "skopon-resume-select-card-works", children: [
1147
1146
  /* @__PURE__ */ c("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
1148
- o.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, s) => /* @__PURE__ */ c(_o, { work: i }, `${i.title}-${s}`)) }) : /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
1147
+ o.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, s) => /* @__PURE__ */ c(Eo, { work: i }, `${i.title}-${s}`)) }) : /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
1149
1148
  ] })
1150
1149
  ] })
1151
1150
  ]
1152
1151
  }
1153
1152
  );
1154
1153
  }
1155
- function xo({ context: e }) {
1156
- const { interactive: t } = ae(), n = vo(), { publishLiveOptions: r } = St(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = le(e, "value", {
1154
+ function wo({ context: e }) {
1155
+ const { interactive: t } = ue(), n = To(), { publishLiveOptions: r } = _t(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = me(e, "value", {
1157
1156
  component: "SkoponResumeSelect",
1158
1157
  changeAction: "click"
1159
- }), l = e.componentModel.properties, u = ot(l.label), m = ot(l.placeholder), d = ot(l.help), b = l.enableRefresh !== !1, y = Be(l.minCount), S = Be(l.maxCount), g = V(() => it(l.resumeFilter), [l.resumeFilter]), k = bo(g), [h, p] = E(1), [v, M] = E(!1), [N, _] = E(""), [z, C] = E([]), [q, L] = E(0), [re, K] = E(g.pageSize ?? 20), $ = A(0), Y = Q(o);
1160
- B(() => {
1161
- const T = _n(Y, S);
1162
- T !== null && s(T);
1163
- }, [S, Y, s]);
1164
- const te = j(
1165
- async (T) => {
1166
- const D = it(JSON.parse(k)), R = ++$.current;
1158
+ }), l = e.componentModel.properties, u = at(l.label), m = at(l.placeholder), d = at(l.help), k = l.enableRefresh !== !1, y = Le(l.minCount), T = Le(l.maxCount), g = $(() => lt(l.resumeFilter), [l.resumeFilter]), C = xo(g), [v, p] = w(1), [S, N] = w(!1), [O, F] = w(""), [j, H] = w([]), [I, A] = w(0), [Y, G] = w(g.pageSize ?? 20), W = x(0), q = ne(o);
1159
+ z(() => {
1160
+ const h = Nn(q, T);
1161
+ h !== null && s(h);
1162
+ }, [T, q, s]);
1163
+ const D = L(
1164
+ async (h) => {
1165
+ const b = lt(JSON.parse(C)), R = ++W.current;
1167
1166
  if (!n) {
1168
- C([]), L(0), _("未配置简历搜索服务"), M(!1);
1167
+ H([]), A(0), F("未配置简历搜索服务"), N(!1);
1169
1168
  return;
1170
1169
  }
1171
- M(!0), _("");
1170
+ N(!0), F("");
1172
1171
  try {
1173
- const I = await n({ filter: D, page: T });
1174
- if (R !== $.current) return;
1175
- C(I.list), L(I.total), p(I.page), K(I.pageSize), a && r(
1172
+ const M = await n({ filter: b, page: h });
1173
+ if (R !== W.current) return;
1174
+ H(M.list), A(M.total), p(M.page), G(M.pageSize), a && r(
1176
1175
  a,
1177
- I.list.map((X) => ({
1178
- value: X.resumeUniqueId,
1179
- label: X.name || X.resumeUniqueId
1176
+ M.list.map((E) => ({
1177
+ value: E.resumeUniqueId,
1178
+ label: E.name || E.resumeUniqueId
1180
1179
  }))
1181
1180
  );
1182
- } catch (I) {
1183
- if (R !== $.current) return;
1184
- C([]), L(0), _(I instanceof Error ? I.message : "加载简历列表失败");
1181
+ } catch (M) {
1182
+ if (R !== W.current) return;
1183
+ H([]), A(0), F(M instanceof Error ? M.message : "加载简历列表失败");
1185
1184
  } finally {
1186
- R === $.current && M(!1);
1185
+ R === W.current && N(!1);
1187
1186
  }
1188
1187
  },
1189
- [n, k, a, r]
1188
+ [n, C, a, r]
1190
1189
  );
1191
- B(() => {
1192
- p(1), te(1);
1193
- }, [k, te]);
1194
- const ne = (T) => {
1190
+ z(() => {
1191
+ p(1), D(1);
1192
+ }, [C, D]);
1193
+ const ie = (h) => {
1195
1194
  if (!t) return;
1196
- const D = Cn(
1197
- Y,
1198
- T,
1195
+ const b = Mn(
1196
+ q,
1197
+ h,
1199
1198
  y,
1200
- S
1199
+ T
1201
1200
  );
1202
- D !== null && i(D);
1203
- }, U = () => {
1204
- const T = it(JSON.parse(k)), D = re || T.pageSize || 20, R = Math.max(1, Math.ceil(q / D)), I = h >= R ? 1 : h + 1;
1205
- te(I);
1206
- }, P = m || "暂无匹配的简历";
1207
- return /* @__PURE__ */ x(
1201
+ b !== null && i(b);
1202
+ }, oe = () => {
1203
+ const h = lt(JSON.parse(C)), b = Y || h.pageSize || 20, R = Math.max(1, Math.ceil(I / b)), M = v >= R ? 1 : v + 1;
1204
+ D(M);
1205
+ }, _ = m || "暂无匹配的简历";
1206
+ return /* @__PURE__ */ U(
1208
1207
  "div",
1209
1208
  {
1210
1209
  className: "form-block-preview skopon-resume-select",
1211
1210
  "data-skopon-field": a || void 0,
1212
1211
  children: [
1213
1212
  u ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: u }) : null,
1214
- v && z.length === 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-status", children: [
1215
- /* @__PURE__ */ c(yt, { size: "small" }),
1213
+ S && j.length === 0 ? /* @__PURE__ */ U("div", { className: "skopon-resume-select-status", children: [
1214
+ /* @__PURE__ */ c(kt, { size: "small" }),
1216
1215
  " 加载简历…"
1217
1216
  ] }) : null,
1218
- !v && N ? /* @__PURE__ */ c(ee.Text, { type: "danger", className: "skopon-resume-select-status", children: N }) : null,
1219
- !v && !N && z.length === 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-empty", children: P }) : null,
1220
- z.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-list", children: z.map((T) => /* @__PURE__ */ c(
1221
- To,
1217
+ !S && O ? /* @__PURE__ */ c(re.Text, { type: "danger", className: "skopon-resume-select-status", children: O }) : null,
1218
+ !S && !O && j.length === 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-empty", children: _ }) : null,
1219
+ j.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-list", children: j.map((h) => /* @__PURE__ */ c(
1220
+ Uo,
1222
1221
  {
1223
- item: T,
1224
- selected: Y.includes(T.resumeUniqueId),
1225
- disabled: An(
1226
- Y,
1227
- T.resumeUniqueId,
1222
+ item: h,
1223
+ selected: q.includes(h.resumeUniqueId),
1224
+ disabled: Fn(
1225
+ q,
1226
+ h.resumeUniqueId,
1228
1227
  t,
1229
1228
  y,
1230
- S
1229
+ T
1231
1230
  ),
1232
- onToggle: () => ne(T.resumeUniqueId)
1231
+ onToggle: () => ie(h.resumeUniqueId)
1233
1232
  },
1234
- T.resumeUniqueId
1233
+ h.resumeUniqueId
1235
1234
  )) }) : null,
1236
- b && n ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ c(
1237
- Me,
1235
+ k && n ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ c(
1236
+ Ne,
1238
1237
  {
1239
1238
  type: "default",
1240
1239
  size: "small",
1241
- icon: /* @__PURE__ */ c(nn, {}),
1242
- loading: v,
1240
+ icon: /* @__PURE__ */ c(cn, {}),
1241
+ loading: S,
1243
1242
  disabled: !t,
1244
- onClick: U,
1243
+ onClick: oe,
1245
1244
  children: "换一批"
1246
1245
  }
1247
1246
  ) }) : null,
1248
- d ? /* @__PURE__ */ c(ee.Text, { type: "secondary", className: "form-block-preview-help", children: d }) : null
1247
+ d ? /* @__PURE__ */ c(re.Text, { type: "secondary", className: "form-block-preview-help", children: d }) : null
1249
1248
  ]
1250
1249
  }
1251
1250
  );
1252
1251
  }
1253
- const Mo = J(
1254
- So,
1255
- xo
1256
- ), No = {
1252
+ const Ro = Z(
1253
+ Mo,
1254
+ wo
1255
+ ), Po = {
1257
1256
  type: "resume_multiselect",
1258
1257
  componentName: "SkoponResumeSelect",
1259
- toComponent: go,
1260
- fromComponent: yo,
1261
- catalogComponents: [Mo]
1258
+ toComponent: Ao,
1259
+ fromComponent: _o,
1260
+ catalogComponents: [Ro]
1262
1261
  };
1263
- function Fo(e, t) {
1262
+ function zo(e, t) {
1264
1263
  var n;
1265
1264
  return {
1266
1265
  node: {
1267
1266
  id: t.id,
1268
1267
  component: "SkoponWeb",
1269
1268
  url: ((n = e.webUrl) == null ? void 0 : n.trim()) ?? "",
1270
- height: Ne(e.webHeight),
1269
+ height: Ie(e.webHeight),
1271
1270
  label: t.label,
1272
1271
  help: e.help ?? ""
1273
1272
  }
1274
1273
  };
1275
1274
  }
1276
- function Io(e, t, n) {
1275
+ function Oo(e, t, n) {
1277
1276
  var o, i;
1278
1277
  const r = (o = n.asLiteral(e.help)) == null ? void 0 : o.trim();
1279
1278
  return {
1280
1279
  ...t("web"),
1281
1280
  webUrl: ((i = n.asLiteral(e.url)) == null ? void 0 : i.trim()) ?? "",
1282
- webHeight: Ne(e.height),
1281
+ webHeight: Ie(e.height),
1283
1282
  ...r ? { help: r } : {}
1284
1283
  };
1285
1284
  }
1286
- function Qt({
1285
+ function nn({
1287
1286
  url: e,
1288
1287
  title: t,
1289
1288
  className: n,
@@ -1304,38 +1303,38 @@ function Qt({
1304
1303
  }
1305
1304
  );
1306
1305
  }
1307
- function Eo({
1306
+ function Bo({
1308
1307
  url: e = "",
1309
1308
  height: t,
1310
1309
  label: n,
1311
1310
  help: r
1312
1311
  }) {
1313
- const [o, i] = E(!1), [s, a] = E(!0), l = A(null), u = e.trim(), m = yr(u) ? u : null, d = Ne(t), b = (n == null ? void 0 : n.trim()) || "网页展示", y = r == null ? void 0 : r.trim(), S = u ? "网页 URL 无效" : "未设置网页 URL";
1314
- return /* @__PURE__ */ x("div", { className: "form-block-preview skopon-web-preview", children: [
1312
+ const [o, i] = w(!1), [s, a] = w(!0), l = x(null), u = e.trim(), m = Ar(u) ? u : null, d = Ie(t), k = (n == null ? void 0 : n.trim()) || "网页展示", y = r == null ? void 0 : r.trim(), T = u ? "网页 URL 无效" : "未设置网页 URL";
1313
+ return /* @__PURE__ */ U("div", { className: "form-block-preview skopon-web-preview", children: [
1315
1314
  n != null && n.trim() ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: n.trim() }) : null,
1316
- /* @__PURE__ */ x(
1315
+ /* @__PURE__ */ U(
1317
1316
  "div",
1318
1317
  {
1319
1318
  className: `skopon-web-frame-shell${m ? "" : " skopon-web-frame-shell--empty"}`,
1320
1319
  style: { height: d },
1321
1320
  children: [
1322
1321
  m && s ? /* @__PURE__ */ c(
1323
- Qt,
1322
+ nn,
1324
1323
  {
1325
1324
  url: m,
1326
- title: b,
1325
+ title: k,
1327
1326
  className: "skopon-web-frame skopon-web-frame--inline",
1328
1327
  height: d
1329
1328
  }
1330
1329
  ) : null,
1331
- m ? null : /* @__PURE__ */ c("div", { className: "skopon-web-empty", role: "status", children: S }),
1332
- m ? /* @__PURE__ */ c(ge, { title: "扩展显示", children: /* @__PURE__ */ c(
1333
- Me,
1330
+ m ? null : /* @__PURE__ */ c("div", { className: "skopon-web-empty", role: "status", children: T }),
1331
+ m ? /* @__PURE__ */ c(ve, { title: "扩展显示", children: /* @__PURE__ */ c(
1332
+ Ne,
1334
1333
  {
1335
1334
  type: "default",
1336
1335
  shape: "circle",
1337
1336
  className: "skopon-web-expand-button",
1338
- icon: /* @__PURE__ */ c(lr, {}),
1337
+ icon: /* @__PURE__ */ c(pr, {}),
1339
1338
  "aria-label": "扩展显示",
1340
1339
  onClick: () => {
1341
1340
  a(!1), i(!0);
@@ -1345,12 +1344,12 @@ function Eo({
1345
1344
  ]
1346
1345
  }
1347
1346
  ),
1348
- y ? /* @__PURE__ */ c(ee.Text, { type: "secondary", className: "form-block-preview-help", children: y }) : null,
1347
+ y ? /* @__PURE__ */ c(re.Text, { type: "secondary", className: "form-block-preview-help", children: y }) : null,
1349
1348
  /* @__PURE__ */ c(
1350
- Qn,
1349
+ or,
1351
1350
  {
1352
1351
  open: o,
1353
- title: b,
1352
+ title: k,
1354
1353
  footer: null,
1355
1354
  width: "min(1200px, calc(100vw - 32px))",
1356
1355
  className: "skopon-web-modal",
@@ -1361,10 +1360,10 @@ function Eo({
1361
1360
  (g = l.current) == null || g.removeAttribute("src"), i(!1), a(!0);
1362
1361
  },
1363
1362
  children: m && !s ? /* @__PURE__ */ c(
1364
- Qt,
1363
+ nn,
1365
1364
  {
1366
1365
  url: m,
1367
- title: `${b}(扩展显示)`,
1366
+ title: `${k}(扩展显示)`,
1368
1367
  className: "skopon-web-frame skopon-web-frame--modal",
1369
1368
  frameRef: l
1370
1369
  }
@@ -1373,7 +1372,7 @@ function Eo({
1373
1372
  )
1374
1373
  ] });
1375
1374
  }
1376
- const Uo = {
1375
+ const qo = {
1377
1376
  name: "SkoponWeb",
1378
1377
  schema: f.object({
1379
1378
  url: f.any().optional(),
@@ -1381,78 +1380,78 @@ const Uo = {
1381
1380
  label: f.any().optional(),
1382
1381
  help: f.any().optional()
1383
1382
  }).passthrough()
1384
- }, Ro = J(
1385
- Uo,
1383
+ }, Lo = Z(
1384
+ qo,
1386
1385
  ({ context: e }) => {
1387
1386
  const t = e.componentModel.properties;
1388
1387
  return /* @__PURE__ */ c(
1389
- Eo,
1388
+ Bo,
1390
1389
  {
1391
1390
  url: typeof t.url == "string" ? t.url : "",
1392
- height: Ne(t.height),
1391
+ height: Ie(t.height),
1393
1392
  label: typeof t.label == "string" ? t.label : "",
1394
1393
  help: typeof t.help == "string" ? t.help : ""
1395
1394
  }
1396
1395
  );
1397
1396
  }
1398
- ), wo = {
1397
+ ), Vo = {
1399
1398
  type: "web",
1400
1399
  componentName: "SkoponWeb",
1401
- toComponent: Fo,
1402
- fromComponent: Io,
1403
- catalogComponents: [Ro]
1404
- }, je = [
1405
- No,
1406
- ho,
1407
- wo
1408
- ], Po = new Map(
1409
- je.map((e) => [e.type, e])
1410
- ), zo = new Map(
1411
- je.map((e) => [e.componentName, e])
1400
+ toComponent: zo,
1401
+ fromComponent: Oo,
1402
+ catalogComponents: [Lo]
1403
+ }, De = [
1404
+ Po,
1405
+ Co,
1406
+ Vo
1407
+ ], jo = new Map(
1408
+ De.map((e) => [e.type, e])
1409
+ ), $o = new Map(
1410
+ De.map((e) => [e.componentName, e])
1412
1411
  );
1413
- function Oo(e) {
1414
- return Po.get(e);
1412
+ function Do(e) {
1413
+ return jo.get(e);
1415
1414
  }
1416
- function Bo(e) {
1417
- return zo.get(e);
1415
+ function Ho(e) {
1416
+ return $o.get(e);
1418
1417
  }
1419
- function qo() {
1420
- return je.flatMap((e) => e.catalogComponents);
1418
+ function Ko() {
1419
+ return De.flatMap((e) => e.catalogComponents);
1421
1420
  }
1422
- function Lo() {
1423
- return je.map((e) => e.componentName);
1421
+ function Wo() {
1422
+ return De.map((e) => e.componentName);
1424
1423
  }
1425
- const qe = "root", ft = "__title__", ht = "__desc__", kt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
1426
- function Vo(e) {
1424
+ const Ve = "root", yt = "__title__", vt = "__desc__", Tt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
1425
+ function Go(e) {
1427
1426
  return `/${e}`;
1428
1427
  }
1429
- function Zt(e) {
1428
+ function rn(e) {
1430
1429
  return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
1431
1430
  }
1432
- function H(e) {
1431
+ function K(e) {
1433
1432
  if (typeof e == "string") return e;
1434
1433
  }
1435
- function jo(e) {
1436
- const t = e.id || ce("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
1434
+ function Jo(e) {
1435
+ const t = e.id || de("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
1437
1436
  return {
1438
1437
  id: t,
1439
1438
  component: "SkoponMedia",
1440
1439
  mediaType: n,
1441
- urls: zr(e),
1442
- mediaSize: Ie(e.mediaSize),
1440
+ urls: jr(e),
1441
+ mediaSize: Ue(e.mediaSize),
1443
1442
  label: e.label ?? "",
1444
1443
  help: e.help ?? "",
1445
1444
  placeholder: e.placeholder ?? ""
1446
1445
  };
1447
1446
  }
1448
- function $o(e) {
1447
+ function Yo(e) {
1449
1448
  if (Array.isArray(e.urls))
1450
1449
  return e.urls.map((n) => String(n).trim()).filter(Boolean);
1451
- const t = H(e.url);
1450
+ const t = K(e.url);
1452
1451
  return t != null && t.trim() ? [t.trim()] : [];
1453
1452
  }
1454
- function we(e, t, n) {
1455
- const r = typeof e.id == "string" ? e.id : ce("block-"), o = $o(e), i = H(e.label) ?? H(e.description) ?? n, s = H(e.help), a = H(e.placeholder), l = Ie(e.mediaSize);
1453
+ function ze(e, t, n) {
1454
+ const r = typeof e.id == "string" ? e.id : de("block-"), o = Yo(e), i = K(e.label) ?? K(e.description) ?? n, s = K(e.help), a = K(e.placeholder), l = Ue(e.mediaSize);
1456
1455
  return {
1457
1456
  id: r,
1458
1457
  type: t,
@@ -1463,12 +1462,13 @@ function we(e, t, n) {
1463
1462
  mediaUrls: o.length > 0 ? o : [""]
1464
1463
  };
1465
1464
  }
1466
- function en(e) {
1465
+ function on(e) {
1467
1466
  switch (e.type) {
1468
1467
  case "toggle":
1469
- return Ee(e.defaultValue);
1468
+ return we(e.defaultValue);
1470
1469
  case "multiselect":
1471
1470
  case "checkbox":
1471
+ case "file":
1472
1472
  case "resume_multiselect":
1473
1473
  case "case_multiselect":
1474
1474
  return Array.isArray(e.defaultValue) ? e.defaultValue : typeof e.defaultValue == "string" && e.defaultValue ? [e.defaultValue] : [];
@@ -1480,9 +1480,9 @@ function en(e) {
1480
1480
  return typeof e.defaultValue == "string" ? e.defaultValue : "";
1481
1481
  }
1482
1482
  }
1483
- function Do(e) {
1483
+ function Qo(e) {
1484
1484
  var u;
1485
- const t = e.id || ce("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? Vo(r) : void 0, i = se(e.options), s = (m) => r ? { node: m, dataKey: r, dataValue: en(e) } : { node: m }, a = { id: t, label: n, name: r, path: o, withData: s }, l = Oo(e.type);
1485
+ const t = e.id || de("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? Go(r) : void 0, i = ce(e.options), s = (m) => r ? { node: m, dataKey: r, dataValue: on(e) } : { node: m }, a = { id: t, label: n, name: r, path: o, withData: s }, l = Do(e.type);
1486
1486
  if (l)
1487
1487
  return l.toComponent(e, a);
1488
1488
  switch (e.type) {
@@ -1491,7 +1491,7 @@ function Do(e) {
1491
1491
  case "paragraph":
1492
1492
  return { node: { id: t, component: "Text", text: n, variant: "body" } };
1493
1493
  case "text":
1494
- return e.hidden ? r ? { node: null, dataKey: r, dataValue: en(e) } : { node: null } : s({
1494
+ return e.hidden ? r ? { node: null, dataKey: r, dataValue: on(e) } : { node: null } : s({
1495
1495
  id: t,
1496
1496
  component: "TextField",
1497
1497
  label: n,
@@ -1515,7 +1515,7 @@ function Do(e) {
1515
1515
  component: "TextField",
1516
1516
  label: n,
1517
1517
  variant: "shortText",
1518
- validationRegexp: kt,
1518
+ validationRegexp: Tt,
1519
1519
  ...e.placeholder ? { placeholder: e.placeholder } : {},
1520
1520
  value: { path: o }
1521
1521
  });
@@ -1601,7 +1601,7 @@ function Do(e) {
1601
1601
  case "image":
1602
1602
  case "video":
1603
1603
  case "audio":
1604
- return { node: jo(e) };
1604
+ return { node: Jo(e) };
1605
1605
  case "file":
1606
1606
  return s({
1607
1607
  id: t,
@@ -1618,38 +1618,38 @@ function Do(e) {
1618
1618
  return { node: null };
1619
1619
  }
1620
1620
  }
1621
- function gt(e) {
1621
+ function bt(e) {
1622
1622
  if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
1623
- const t = e.components.find((r) => r.id === qe);
1623
+ const t = e.components.find((r) => r.id === Ve);
1624
1624
  if (!t) return e.components.length === 0;
1625
1625
  const n = t.children;
1626
1626
  return !Array.isArray(n) || n.length === 0;
1627
1627
  }
1628
- function Mn(e, t) {
1628
+ function Un(e, t) {
1629
1629
  const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, s = (e.title ?? "").trim(), a = (e.description ?? "").trim();
1630
- i && s && (n.push({ id: ft, component: "Text", text: s, variant: "h2" }), r.push(ft)), i && a && (n.push({ id: ht, component: "Text", text: a, variant: "body" }), r.push(ht));
1630
+ i && s && (n.push({ id: yt, component: "Text", text: s, variant: "h2" }), r.push(yt)), i && a && (n.push({ id: vt, component: "Text", text: a, variant: "body" }), r.push(vt));
1631
1631
  for (const m of e.blocks ?? []) {
1632
- if (!ue(m)) continue;
1633
- const { node: d, dataKey: b, dataValue: y } = Do(m);
1634
- b && (o[b] = y), d && (n.push(d), r.push(d.id));
1632
+ if (!fe(m)) continue;
1633
+ const { node: d, dataKey: k, dataValue: y } = Qo(m);
1634
+ k && (o[k] = y), d && (n.push(d), r.push(d.id));
1635
1635
  }
1636
- n.unshift({ id: qe, component: "Column", children: r });
1637
- const l = { root: qe, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1636
+ n.unshift({ id: Ve, component: "Column", children: r });
1637
+ const l = { root: Ve, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1638
1638
  return u !== void 0 && (l.surfaceProperties = { styleId: u ?? null }), l;
1639
1639
  }
1640
- function Ho(e) {
1640
+ function Xo(e) {
1641
1641
  const t = /* @__PURE__ */ new Map();
1642
1642
  for (const n of e.components ?? [])
1643
1643
  n && typeof n.id == "string" && t.set(n.id, n);
1644
1644
  return t;
1645
1645
  }
1646
- function at(e) {
1647
- return se(e.options);
1646
+ function ut(e) {
1647
+ return ce(e.options);
1648
1648
  }
1649
- function Ko(e) {
1650
- const t = typeof e.id == "string" ? e.id : ce("block-"), n = String(e.component ?? ""), r = H(e.label) ?? H(e.text) ?? "", o = Zt(e.value), i = (a) => ({ id: t, type: a, label: r }), s = Bo(n);
1649
+ function Zo(e) {
1650
+ const t = typeof e.id == "string" ? e.id : de("block-"), n = String(e.component ?? ""), r = K(e.label) ?? K(e.text) ?? "", o = rn(e.value), i = (a) => ({ id: t, type: a, label: r }), s = Ho(n);
1651
1651
  if (s)
1652
- return s.fromComponent(e, i, { asLiteral: H, nameFromValue: Zt });
1652
+ return s.fromComponent(e, i, { asLiteral: K, nameFromValue: rn });
1653
1653
  switch (n) {
1654
1654
  case "Text": {
1655
1655
  const a = String(e.variant ?? "body"), l = /^h[1-6]$/i.test(a) || a === "title" || a === "subtitle";
@@ -1658,8 +1658,8 @@ function Ko(e) {
1658
1658
  case "TextField": {
1659
1659
  const a = String(e.variant ?? "shortText");
1660
1660
  let l = "text";
1661
- a === "longText" ? l = "textarea" : a === "number" ? l = "number" : H(e.validationRegexp) === kt && (l = "email");
1662
- const u = { ...i(l), name: o }, m = H(e.placeholder);
1661
+ a === "longText" ? l = "textarea" : a === "number" ? l = "number" : K(e.validationRegexp) === Tt && (l = "email");
1662
+ const u = { ...i(l), name: o }, m = K(e.placeholder);
1663
1663
  return m && (u.placeholder = m), u;
1664
1664
  }
1665
1665
  case "CheckBox":
@@ -1668,46 +1668,46 @@ function Ko(e) {
1668
1668
  const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", u = {
1669
1669
  ...i(l),
1670
1670
  name: o,
1671
- options: at(e)
1672
- }, m = H(e.placeholder);
1671
+ options: ut(e)
1672
+ }, m = K(e.placeholder);
1673
1673
  return m && (u.placeholder = m), u;
1674
1674
  }
1675
1675
  case "ChoicePicker": {
1676
- const a = H(e.skoponPickerType);
1676
+ const a = K(e.skoponPickerType);
1677
1677
  if (a === "select" || a === "multiselect" || a === "radio" || a === "checkbox") {
1678
1678
  const m = {
1679
1679
  ...i(a),
1680
1680
  name: o,
1681
- options: at(e)
1682
- }, d = H(e.placeholder);
1681
+ options: ut(e)
1682
+ }, d = K(e.placeholder);
1683
1683
  return d && (m.placeholder = d), m;
1684
1684
  }
1685
1685
  const u = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
1686
- return { ...i(u), name: o, options: at(e) };
1686
+ return { ...i(u), name: o, options: ut(e) };
1687
1687
  }
1688
1688
  case "DateTimeInput": {
1689
- const a = e.enableDate === !0, l = e.enableTime === !0, m = { ...i(!a && l ? "time" : "datetime"), name: o }, d = H(e.placeholder);
1689
+ const a = e.enableDate === !0, l = e.enableTime === !0, m = { ...i(!a && l ? "time" : "datetime"), name: o }, d = K(e.placeholder);
1690
1690
  return d && (m.placeholder = d), m;
1691
1691
  }
1692
1692
  case "SkoponMedia": {
1693
1693
  const a = String(e.mediaType ?? "image");
1694
- return we(e, a === "video" ? "video" : a === "audio" ? "audio" : "image", r);
1694
+ return ze(e, a === "video" ? "video" : a === "audio" ? "audio" : "image", r);
1695
1695
  }
1696
1696
  case "Image":
1697
- return we(e, "image", r);
1697
+ return ze(e, "image", r);
1698
1698
  case "Video":
1699
- return we(e, "video", r);
1699
+ return ze(e, "video", r);
1700
1700
  case "AudioPlayer":
1701
- return we(e, "audio", r);
1701
+ return ze(e, "audio", r);
1702
1702
  case "FileUpload": {
1703
- const a = H(e.accept) ?? "", l = { ...i("file"), name: o };
1703
+ const a = K(e.accept) ?? "", l = { ...i("file"), name: o };
1704
1704
  return a && (l.fileAcceptExtensions = a.split(",").map((u) => u.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (l.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (l.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (l.fileMinCount = e.minCount), typeof e.maxCount == "number" && (l.fileMaxCount = e.maxCount), l;
1705
1705
  }
1706
1706
  default:
1707
1707
  return null;
1708
1708
  }
1709
1709
  }
1710
- function Nn(e, t, n, r) {
1710
+ function wn(e, t, n, r) {
1711
1711
  if (n.has(e)) return;
1712
1712
  n.add(e);
1713
1713
  const o = t.get(e);
@@ -1715,46 +1715,46 @@ function Nn(e, t, n, r) {
1715
1715
  const i = String(o.component ?? "");
1716
1716
  if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
1717
1717
  for (const s of o.children)
1718
- typeof s == "string" && Nn(s, t, n, r);
1718
+ typeof s == "string" && wn(s, t, n, r);
1719
1719
  return;
1720
1720
  }
1721
1721
  r.push(o);
1722
1722
  }
1723
- function Wo(e, t) {
1723
+ function ei(e, t) {
1724
1724
  return t ? e.map((n) => {
1725
1725
  var i;
1726
1726
  const r = (i = n.name) == null ? void 0 : i.trim();
1727
1727
  if (!r || !(r in t)) return n;
1728
1728
  const o = t[r];
1729
- return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: Ee(o) } : { ...n, defaultValue: o };
1729
+ return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: we(o) } : { ...n, defaultValue: o };
1730
1730
  }) : e;
1731
1731
  }
1732
- function Go(e) {
1732
+ function ti(e) {
1733
1733
  if (!e || !Array.isArray(e.components))
1734
- return Ce({ title: "", description: "", blocks: [] });
1735
- const t = Ho(e), n = [];
1736
- Nn(e.root ?? qe, t, /* @__PURE__ */ new Set(), n);
1734
+ return xe({ title: "", description: "", blocks: [] });
1735
+ const t = Xo(e), n = [];
1736
+ wn(e.root ?? Ve, t, /* @__PURE__ */ new Set(), n);
1737
1737
  let r = "", o = "";
1738
1738
  const i = [];
1739
1739
  for (const s of n) {
1740
- if (s.id === ft) {
1741
- r = H(s.text) ?? r;
1740
+ if (s.id === yt) {
1741
+ r = K(s.text) ?? r;
1742
1742
  continue;
1743
1743
  }
1744
- if (s.id === ht) {
1745
- o = H(s.text) ?? o;
1744
+ if (s.id === vt) {
1745
+ o = K(s.text) ?? o;
1746
1746
  continue;
1747
1747
  }
1748
- const a = Ko(s);
1748
+ const a = Zo(s);
1749
1749
  a && i.push(a);
1750
1750
  }
1751
- return Ce({
1751
+ return xe({
1752
1752
  title: r,
1753
1753
  description: o,
1754
- blocks: Wo(i, e.dataModel)
1754
+ blocks: ei(i, e.dataModel)
1755
1755
  });
1756
1756
  }
1757
- function Jo(e, t) {
1757
+ function ni(e, t) {
1758
1758
  const { surfaceId: n, catalogId: r } = t, o = [
1759
1759
  { version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
1760
1760
  {
@@ -1767,25 +1767,25 @@ function Jo(e, t) {
1767
1767
  updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
1768
1768
  }), o;
1769
1769
  }
1770
- function Fn(e) {
1770
+ function Rn(e) {
1771
1771
  return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
1772
1772
  }
1773
- function Yo(e, t) {
1773
+ function ri(e, t) {
1774
1774
  if (!e || typeof e != "object") return null;
1775
- const n = e, r = Fn(n.a2ui) ? n.a2ui : void 0;
1776
- if (r && !gt(r)) return r;
1775
+ const n = e, r = Rn(n.a2ui) ? n.a2ui : void 0;
1776
+ if (r && !bt(r)) return r;
1777
1777
  const o = Array.isArray(n.blocks) ? n.blocks : [];
1778
1778
  if (o.length === 0) return null;
1779
- const i = Ve({
1779
+ const i = $e({
1780
1780
  title: typeof n.title == "string" ? n.title : "",
1781
1781
  description: typeof n.description == "string" ? n.description : "",
1782
1782
  blocks: o,
1783
- jsonSchema: fn(n.jsonSchema ?? n.json_schema)
1784
- }), s = Mn(i, t);
1785
- return gt(s) ? null : s;
1783
+ jsonSchema: Sn(n.jsonSchema ?? n.json_schema)
1784
+ }), s = Un(i, t);
1785
+ return bt(s) ? null : s;
1786
1786
  }
1787
- function Xo(e, t, n) {
1788
- return Mn(
1787
+ function oi(e, t, n) {
1788
+ return Un(
1789
1789
  {
1790
1790
  title: e.title,
1791
1791
  description: e.description,
@@ -1794,18 +1794,18 @@ function Xo(e, t, n) {
1794
1794
  n
1795
1795
  );
1796
1796
  }
1797
- function Qo(e) {
1797
+ function ii(e) {
1798
1798
  if (!e || typeof e != "object" || Array.isArray(e))
1799
1799
  return;
1800
1800
  const t = e;
1801
- return !(Array.isArray(t.blocks) && t.blocks.length > 0) && Fn(t.a2ui) ? Go(t.a2ui) : Ve({
1801
+ return !(Array.isArray(t.blocks) && t.blocks.length > 0) && Rn(t.a2ui) ? ti(t.a2ui) : $e({
1802
1802
  title: typeof t.title == "string" ? t.title : "",
1803
1803
  description: typeof t.description == "string" ? t.description : "",
1804
1804
  blocks: Array.isArray(t.blocks) ? t.blocks : [],
1805
- jsonSchema: fn(t.jsonSchema ?? t.json_schema)
1805
+ jsonSchema: Sn(t.jsonSchema ?? t.json_schema)
1806
1806
  });
1807
1807
  }
1808
- function Zo(e, t, n) {
1808
+ function si(e, t, n) {
1809
1809
  const r = e.model.surfacesMap.get(t);
1810
1810
  if (!r) return {};
1811
1811
  const o = {};
@@ -1815,18 +1815,18 @@ function Zo(e, t, n) {
1815
1815
  }
1816
1816
  return o;
1817
1817
  }
1818
- const ei = /* @__PURE__ */ new Set(["type", "name", "id"]);
1819
- function Ct(e) {
1818
+ const ai = /* @__PURE__ */ new Set(["type", "name", "id"]);
1819
+ function xt(e) {
1820
1820
  return e.type === "text" && e.hidden === !0;
1821
1821
  }
1822
- function At(e) {
1823
- return Ve({
1822
+ function Mt(e) {
1823
+ return $e({
1824
1824
  title: "",
1825
1825
  description: "",
1826
1826
  blocks: [e]
1827
1827
  }).blocks[0];
1828
1828
  }
1829
- function ti(e, t) {
1829
+ function li(e, t) {
1830
1830
  var o, i;
1831
1831
  const n = /* @__PURE__ */ new Map();
1832
1832
  for (const s of t) {
@@ -1835,19 +1835,19 @@ function ti(e, t) {
1835
1835
  }
1836
1836
  const r = [];
1837
1837
  for (const s of e.blocks) {
1838
- if (mn(s.type)) {
1839
- r.push(At(s));
1838
+ if (yn(s.type)) {
1839
+ r.push(Mt(s));
1840
1840
  continue;
1841
1841
  }
1842
- if (!Z(s.type)) continue;
1842
+ if (!ee(s.type)) continue;
1843
1843
  const a = (i = s.name) == null ? void 0 : i.trim();
1844
1844
  if (!a) continue;
1845
1845
  const l = n.get(a);
1846
- l && (Ct(l) || ue(l) && r.push(l));
1846
+ l && (xt(l) || fe(l) && r.push(l));
1847
1847
  }
1848
1848
  return r;
1849
1849
  }
1850
- function ni(e, t, n) {
1850
+ function ci(e, t, n) {
1851
1851
  const r = e.rawBlocks;
1852
1852
  if (!(r != null && r.length)) return n;
1853
1853
  for (const o of r) {
@@ -1856,23 +1856,23 @@ function ni(e, t, n) {
1856
1856
  }
1857
1857
  return n;
1858
1858
  }
1859
- function ri(e, t) {
1859
+ function ui(e, t) {
1860
1860
  var r;
1861
1861
  const n = { ...e };
1862
1862
  for (const o of Object.keys(t)) {
1863
- if (ei.has(o) || !Object.prototype.hasOwnProperty.call(t, o)) continue;
1863
+ if (ai.has(o) || !Object.prototype.hasOwnProperty.call(t, o)) continue;
1864
1864
  const i = t[o];
1865
1865
  i !== void 0 && Object.assign(n, { [o]: i });
1866
1866
  }
1867
- return n.type = e.type, n.name = ((r = e.name) == null ? void 0 : r.trim()) || t.name, n.id = e.id, At(n);
1867
+ return n.type = e.type, n.name = ((r = e.name) == null ? void 0 : r.trim()) || t.name, n.id = e.id, Mt(n);
1868
1868
  }
1869
- function $e(e) {
1869
+ function He(e) {
1870
1870
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1871
1871
  const t = e;
1872
1872
  if (!Array.isArray(t.blocks)) return null;
1873
1873
  const n = t.blocks.filter(
1874
1874
  (o) => !!o && typeof o == "object" && !Array.isArray(o)
1875
- ), r = Ve({
1875
+ ), r = $e({
1876
1876
  title: typeof t.title == "string" ? t.title : "",
1877
1877
  description: typeof t.description == "string" ? t.description : "",
1878
1878
  blocks: n
@@ -1884,120 +1884,120 @@ function $e(e) {
1884
1884
  rawBlocks: n
1885
1885
  };
1886
1886
  }
1887
- function oi(e, t) {
1887
+ function mi(e, t) {
1888
1888
  var i, s, a, l, u, m;
1889
1889
  const n = /* @__PURE__ */ new Map();
1890
1890
  for (const d of (t == null ? void 0 : t.blocks) ?? [])
1891
- Z(d.type) && ((i = d.name) != null && i.trim()) && n.set(d.name.trim(), d);
1891
+ ee(d.type) && ((i = d.name) != null && i.trim()) && n.set(d.name.trim(), d);
1892
1892
  const r = [], o = [];
1893
1893
  for (const d of e.blocks) {
1894
- if (!Z(d.type)) continue;
1895
- const b = (s = d.name) == null ? void 0 : s.trim();
1896
- if (!b) continue;
1897
- const y = n.get(b);
1894
+ if (!ee(d.type)) continue;
1895
+ const k = (s = d.name) == null ? void 0 : s.trim();
1896
+ if (!k) continue;
1897
+ const y = n.get(k);
1898
1898
  if (y) {
1899
- const S = ni(e, b, d);
1900
- r.push(ri(y, S));
1899
+ const T = ci(e, k, d);
1900
+ r.push(ui(y, T));
1901
1901
  } else
1902
- o.push(At(d));
1902
+ o.push(Mt(d));
1903
1903
  }
1904
1904
  return {
1905
1905
  matchedBlocks: r,
1906
1906
  extraBlocks: o,
1907
- renderBlocks: ti(e, r),
1907
+ renderBlocks: li(e, r),
1908
1908
  title: ((a = e.title) == null ? void 0 : a.trim()) || ((l = t == null ? void 0 : t.title) == null ? void 0 : l.trim()) || "",
1909
1909
  description: ((u = e.description) == null ? void 0 : u.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
1910
1910
  };
1911
1911
  }
1912
- function In(e) {
1912
+ function Pn(e) {
1913
1913
  const { type: t, defaultValue: n } = e;
1914
1914
  return n !== void 0 ? t === "toggle" ? n === !0 || n === "true" : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? Array.isArray(n) ? n.map(String) : typeof n == "string" && n ? [n] : [] : n : t === "toggle" ? !1 : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? [] : t === "number" ? null : "";
1915
1915
  }
1916
- function Le(e) {
1916
+ function je(e) {
1917
1917
  var n;
1918
1918
  const t = {};
1919
1919
  for (const r of e) {
1920
- if (!Z(r.type) || !ue(r)) continue;
1920
+ if (!ee(r.type) || !fe(r)) continue;
1921
1921
  const o = (n = r.name) == null ? void 0 : n.trim();
1922
- o && (t[o] = In(r));
1922
+ o && (t[o] = Pn(r));
1923
1923
  }
1924
1924
  return t;
1925
1925
  }
1926
- function ii(e) {
1926
+ function di(e) {
1927
1927
  return e.blocks.some(
1928
1928
  (t) => {
1929
1929
  var n;
1930
- return Z(t.type) && !!((n = t.name) != null && n.trim()) && ue(t);
1930
+ return ee(t.type) && !!((n = t.name) != null && n.trim()) && fe(t);
1931
1931
  }
1932
1932
  );
1933
1933
  }
1934
- function si(e) {
1934
+ function fi(e) {
1935
1935
  return e.blocks.filter((t) => {
1936
1936
  var n;
1937
- return mn(t.type) ? !0 : !Z(t.type) || !((n = t.name) != null && n.trim()) || !ue(t) ? !1 : !Ct(t);
1937
+ return yn(t.type) ? !0 : !ee(t.type) || !((n = t.name) != null && n.trim()) || !fe(t) ? !1 : !xt(t);
1938
1938
  });
1939
1939
  }
1940
- function Os(e) {
1940
+ function Ys(e) {
1941
1941
  return e.blocks.filter(
1942
1942
  (t) => {
1943
1943
  var n;
1944
- return Z(t.type) && ((n = t.name) == null ? void 0 : n.trim()) && ue(t);
1944
+ return ee(t.type) && ((n = t.name) == null ? void 0 : n.trim()) && fe(t);
1945
1945
  }
1946
1946
  ).map((t) => t.name.trim());
1947
1947
  }
1948
- function ai(e) {
1948
+ function pi(e) {
1949
1949
  var n;
1950
1950
  const t = {};
1951
1951
  for (const r of e.blocks) {
1952
- if (!Ct(r)) continue;
1952
+ if (!xt(r)) continue;
1953
1953
  const o = (n = r.name) == null ? void 0 : n.trim();
1954
- o && (t[o] = In(r));
1954
+ o && (t[o] = Pn(r));
1955
1955
  }
1956
1956
  return t;
1957
1957
  }
1958
- function _t(e) {
1958
+ function Ft(e) {
1959
1959
  return e.replace(/'/g, "'\\''");
1960
1960
  }
1961
- function En(e) {
1961
+ function zn(e) {
1962
1962
  var n;
1963
1963
  const t = (n = e == null ? void 0 : e.Authorization) == null ? void 0 : n.trim();
1964
- return t ? ` -H 'Authorization: ${_t(t)}' \\` : " -H 'Authorization: Bearer <token>' \\";
1964
+ return t ? ` -H 'Authorization: ${Ft(t)}' \\` : " -H 'Authorization: Bearer <token>' \\";
1965
1965
  }
1966
- function Un(e, t, n) {
1966
+ function On(e, t, n) {
1967
1967
  const r = (t ?? "").trim() || "<callback_url>", o = JSON.stringify(e ?? {}, null, 2);
1968
1968
  return [
1969
1969
  `curl -X POST '${r}' \\`,
1970
1970
  " -H 'Content-Type: application/json' \\",
1971
- En(n),
1972
- ` -d '${_t(o)}'`
1971
+ zn(n),
1972
+ ` -d '${Ft(o)}'`
1973
1973
  ].join(`
1974
1974
  `);
1975
1975
  }
1976
- function li(e, t) {
1976
+ function hi(e, t) {
1977
1977
  return JSON.stringify({ ...e, ...t }, null, 2);
1978
1978
  }
1979
- function ci({
1979
+ function gi({
1980
1980
  cardValues: e,
1981
1981
  extraValues: t = {},
1982
1982
  callbackUrl: n,
1983
1983
  headers: r
1984
1984
  }) {
1985
- const o = (n ?? "").trim() || "<callback_url>", i = li(e, t);
1985
+ const o = (n ?? "").trim() || "<callback_url>", i = hi(e, t);
1986
1986
  return [
1987
1987
  `curl -X POST '${o}' \\`,
1988
1988
  " -H 'Content-Type: application/json' \\",
1989
- En(r),
1990
- ` -d '${_t(i)}'`
1989
+ zn(r),
1990
+ ` -d '${Ft(i)}'`
1991
1991
  ].join(`
1992
1992
  `);
1993
1993
  }
1994
- function Bs(e, t, n) {
1995
- const r = $e(e);
1996
- if (!r) return Un(e, t, n);
1997
- const o = Le(r.blocks);
1998
- return ci({ cardValues: o, callbackUrl: t, headers: n });
1994
+ function Qs(e, t, n) {
1995
+ const r = He(e);
1996
+ if (!r) return On(e, t, n);
1997
+ const o = je(r.blocks);
1998
+ return gi({ cardValues: o, callbackUrl: t, headers: n });
1999
1999
  }
2000
- async function Rn(e, t, n) {
2000
+ async function Bn(e, t, n) {
2001
2001
  const r = e.trim();
2002
2002
  if (!r)
2003
2003
  throw new Error("callback_url 为空");
@@ -2024,7 +2024,7 @@ async function Rn(e, t, n) {
2024
2024
  }
2025
2025
  return { ok: i.ok, status: i.status, body: s };
2026
2026
  }
2027
- async function qs(e) {
2027
+ async function Xs(e) {
2028
2028
  var n;
2029
2029
  if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
2030
2030
  await navigator.clipboard.writeText(e);
@@ -2040,7 +2040,7 @@ async function qs(e) {
2040
2040
  document.body.removeChild(t);
2041
2041
  }
2042
2042
  }
2043
- async function Tt(e) {
2043
+ async function Ke(e) {
2044
2044
  let t;
2045
2045
  try {
2046
2046
  t = await e.json();
@@ -2053,8 +2053,8 @@ async function Tt(e) {
2053
2053
  throw new Error(t.message || `响应缺少 data (${e.status})`);
2054
2054
  return t.data;
2055
2055
  }
2056
- const xt = "auth_user", ui = "token", mi = "answer_agent_callback_url", di = "realtime_ws_url", pi = "/api/v1/mock/ask_user_answer_mock";
2057
- function Mt(e) {
2056
+ const Nt = "auth_user", yi = "token", vi = "answer_agent_callback_url", bi = "realtime_ws_url", Si = "/api/v1/mock/ask_user_answer_mock";
2057
+ function It(e) {
2058
2058
  if (typeof window > "u") return null;
2059
2059
  try {
2060
2060
  return e === "localStorage" ? window.localStorage : window.sessionStorage;
@@ -2062,7 +2062,7 @@ function Mt(e) {
2062
2062
  return null;
2063
2063
  }
2064
2064
  }
2065
- function Nt(e) {
2065
+ function Et(e) {
2066
2066
  try {
2067
2067
  const t = JSON.parse(e);
2068
2068
  return !t || typeof t != "object" || Array.isArray(t) ? null : t;
@@ -2070,50 +2070,50 @@ function Nt(e) {
2070
2070
  return null;
2071
2071
  }
2072
2072
  }
2073
- function fi(e, t) {
2074
- const n = Nt(e);
2073
+ function ki(e, t) {
2074
+ const n = Et(e);
2075
2075
  if (!n) return "";
2076
2076
  const r = n[t];
2077
2077
  return typeof r == "string" ? r.trim().replace(/^bearer\s+/i, "").trim() : "";
2078
2078
  }
2079
- function hi(e = {}) {
2080
- const t = e.storage ?? "sessionStorage", n = e.storageKey ?? xt, r = e.answerAgentCallbackUrlField ?? mi, o = Mt(t);
2079
+ function Ci(e = {}) {
2080
+ const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Nt, r = e.answerAgentCallbackUrlField ?? vi, o = It(t);
2081
2081
  if (!o) return "";
2082
2082
  const i = o.getItem(n);
2083
2083
  if (!i) return "";
2084
- const s = Nt(i);
2084
+ const s = Et(i);
2085
2085
  if (!s) return "";
2086
2086
  const a = s[r];
2087
- return (typeof a == "string" ? a.trim() : "") || pi;
2087
+ return (typeof a == "string" ? a.trim() : "") || Si;
2088
2088
  }
2089
- function gi(e = {}) {
2090
- const t = e.storage ?? "sessionStorage", n = e.storageKey ?? xt, r = e.realtimeWsUrlField ?? di, o = Mt(t);
2089
+ function Ai(e = {}) {
2090
+ const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Nt, r = e.realtimeWsUrlField ?? bi, o = It(t);
2091
2091
  if (!o) return "";
2092
2092
  const i = o.getItem(n);
2093
2093
  if (!i) return "";
2094
- const s = Nt(i);
2094
+ const s = Et(i);
2095
2095
  if (!s) return "";
2096
2096
  const a = s[r];
2097
2097
  return typeof a == "string" ? a.trim() : "";
2098
2098
  }
2099
- function Ft(e, t) {
2099
+ function Ut(e, t) {
2100
2100
  return {
2101
- ...wn(t),
2101
+ ...wt(t),
2102
2102
  ...e ?? {}
2103
2103
  };
2104
2104
  }
2105
- function wn(e = {}) {
2106
- const t = e.storage ?? "sessionStorage", n = e.storageKey ?? xt, r = e.tokenField ?? ui, o = Mt(t);
2105
+ function wt(e = {}) {
2106
+ const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Nt, r = e.tokenField ?? yi, o = It(t);
2107
2107
  if (!o) return {};
2108
2108
  const i = o.getItem(n);
2109
2109
  if (!i) return {};
2110
- const s = fi(i, r);
2110
+ const s = ki(i, r);
2111
2111
  return s ? { Authorization: `Bearer ${s}` } : {};
2112
2112
  }
2113
- async function It(e = {}) {
2114
- return e.getHeaders ? await e.getHeaders() ?? {} : wn(e.authStorage);
2113
+ async function Rt(e = {}) {
2114
+ return e.getHeaders ? await e.getHeaders() ?? {} : wt(e.authStorage);
2115
2115
  }
2116
- function yi(e = {}) {
2116
+ function _i(e = {}) {
2117
2117
  const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
2118
2118
  async function o(i) {
2119
2119
  const s = new URLSearchParams();
@@ -2123,21 +2123,21 @@ function yi(e = {}) {
2123
2123
  s.set("form_unique_id", i.formUniqueId);
2124
2124
  else
2125
2125
  throw new Error("form_id 或 form_unique_id 至少传一个");
2126
- const a = await It(e), l = await r(`${t}${n}?${s.toString()}`, {
2126
+ const a = await Rt(e), l = await r(`${t}${n}?${s.toString()}`, {
2127
2127
  method: "GET",
2128
2128
  headers: a
2129
- }), u = await Tt(l), m = Qo(u.form_definition);
2129
+ }), u = await Ke(l), m = ii(u.form_definition);
2130
2130
  return {
2131
2131
  formUniqueId: u.form_unique_id,
2132
2132
  formId: u.form_id,
2133
2133
  disabled: u.disabled === 1,
2134
2134
  formDefinition: m,
2135
- a2ui: Yo(u.form_definition) ?? void 0
2135
+ a2ui: ri(u.form_definition) ?? void 0
2136
2136
  };
2137
2137
  }
2138
2138
  return { fetchDetail: o };
2139
2139
  }
2140
- function vi(e) {
2140
+ function Ti(e) {
2141
2141
  if (!e || typeof e != "object" || Array.isArray(e))
2142
2142
  return e ?? null;
2143
2143
  const t = e;
@@ -2147,13 +2147,13 @@ function vi(e) {
2147
2147
  blocks: t.blocks
2148
2148
  } : e;
2149
2149
  }
2150
- function Et({
2150
+ function Pt({
2151
2151
  context: e,
2152
2152
  payload: t,
2153
2153
  form: n,
2154
2154
  answer: r
2155
2155
  }) {
2156
- const o = $e(t) ?? t, i = n ? vi(n) : o;
2156
+ const o = He(t) ?? t, i = n ? Ti(n) : o;
2157
2157
  return {
2158
2158
  mission_id: e.missionId ?? null,
2159
2159
  tenant_id: e.tenantId ?? null,
@@ -2166,7 +2166,7 @@ function Et({
2166
2166
  answer: r
2167
2167
  };
2168
2168
  }
2169
- function Ut(e) {
2169
+ function zt(e) {
2170
2170
  const t = e.callback_url;
2171
2171
  if (typeof t != "string" || !t.trim())
2172
2172
  return "callback_url 为空,无法提交";
@@ -2181,34 +2181,34 @@ function Ut(e) {
2181
2181
  const o = e.mission_id;
2182
2182
  return o == null || o === "" ? "mission_id 缺失,无法提交" : null;
2183
2183
  }
2184
- function Ls(e) {
2185
- return Ut(
2186
- Et({
2184
+ function Zs(e) {
2185
+ return zt(
2186
+ Pt({
2187
2187
  context: e,
2188
2188
  payload: {},
2189
2189
  answer: {}
2190
2190
  })
2191
2191
  );
2192
2192
  }
2193
- const tn = "answer_agent_callback_url 未配置,无法提交";
2194
- function bi(e) {
2193
+ const sn = "answer_agent_callback_url 未配置,无法提交";
2194
+ function xi(e) {
2195
2195
  if ((e == null ? void 0 : e.answerAgentCallbackUrl) != null) {
2196
2196
  const n = e.answerAgentCallbackUrl.trim();
2197
2197
  if (!n)
2198
- throw new Error(tn);
2198
+ throw new Error(sn);
2199
2199
  return n;
2200
2200
  }
2201
- const t = hi(e == null ? void 0 : e.authStorage).trim();
2201
+ const t = Ci(e == null ? void 0 : e.authStorage).trim();
2202
2202
  if (!t)
2203
- throw new Error(tn);
2203
+ throw new Error(sn);
2204
2204
  return t;
2205
2205
  }
2206
- function Pn(e) {
2206
+ function qn(e) {
2207
2207
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
2208
2208
  const n = e.data;
2209
2209
  return !n || typeof n != "object" || Array.isArray(n) ? null : n;
2210
2210
  }
2211
- function Si(e, t) {
2211
+ function Mi(e, t) {
2212
2212
  if (t && typeof t == "object" && t !== null && "message" in t) {
2213
2213
  const n = t.message;
2214
2214
  if (typeof n == "string" && n.trim())
@@ -2216,27 +2216,27 @@ function Si(e, t) {
2216
2216
  }
2217
2217
  return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
2218
2218
  }
2219
- function ki(e) {
2219
+ function Fi(e) {
2220
2220
  return `提交失败:${typeof e.error == "string" && e.error.trim() ? e.error.trim() : `回调 HTTP ${e.callback_status ?? "失败"}`}`;
2221
2221
  }
2222
- function zn(e) {
2223
- const t = Pn(e.body);
2224
- return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message: ki(t) } : e.ok ? { type: "success", message: "提交成功" } : {
2222
+ function Ln(e) {
2223
+ const t = qn(e.body);
2224
+ return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message: Fi(t) } : e.ok ? { type: "success", message: "提交成功" } : {
2225
2225
  type: "error",
2226
- message: Si(e.status, e.body)
2226
+ message: Mi(e.status, e.body)
2227
2227
  };
2228
2228
  }
2229
- async function On(e, t) {
2230
- const n = Ut(e);
2229
+ async function Vn(e, t) {
2230
+ const n = zt(e);
2231
2231
  if (n)
2232
2232
  throw new Error(n);
2233
- const r = bi(t), o = await Rn(r, e, {
2233
+ const r = xi(t), o = await Bn(r, e, {
2234
2234
  ...t,
2235
- headers: Ft(t == null ? void 0 : t.headers, t == null ? void 0 : t.authStorage)
2236
- }), i = Pn(o.body);
2235
+ headers: Ut(t == null ? void 0 : t.headers, t == null ? void 0 : t.authStorage)
2236
+ }), i = qn(o.body);
2237
2237
  return o.ok && (i == null ? void 0 : i.callback_ok) === !1 ? { ok: !1, status: o.status, body: o.body } : o;
2238
2238
  }
2239
- function Ci(e) {
2239
+ function Ni(e) {
2240
2240
  return {
2241
2241
  resumeUniqueId: e.resume_unique_id,
2242
2242
  resumeId: e.resume_id,
@@ -2257,7 +2257,7 @@ function Ci(e) {
2257
2257
  }))
2258
2258
  };
2259
2259
  }
2260
- function Ai(e, t, n) {
2260
+ function Ii(e, t, n) {
2261
2261
  const r = new URLSearchParams();
2262
2262
  r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20));
2263
2263
  for (const o of e.names ?? [])
@@ -2270,27 +2270,27 @@ function Ai(e, t, n) {
2270
2270
  r.append("published", String(o));
2271
2271
  return r;
2272
2272
  }
2273
- function _i(e = {}) {
2273
+ function Ei(e = {}) {
2274
2274
  const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.searchPath ?? "/univ/resume/search", r = e.fetch ?? fetch, o = e.published ?? [1];
2275
2275
  return async ({ filter: i, page: s }) => {
2276
- const a = await It(e), l = Ai(i, s, o), u = await r(`${t}${n}?${l.toString()}`, {
2276
+ const a = await Rt(e), l = Ii(i, s, o), u = await r(`${t}${n}?${l.toString()}`, {
2277
2277
  method: "GET",
2278
2278
  headers: a
2279
- }), m = await Tt(u);
2279
+ }), m = await Ke(u);
2280
2280
  return {
2281
- list: (m.list ?? []).map(Ci),
2281
+ list: (m.list ?? []).map(Ni),
2282
2282
  total: m.total ?? 0,
2283
2283
  page: m.page ?? s,
2284
2284
  pageSize: m.page_size ?? i.pageSize ?? 20
2285
2285
  };
2286
2286
  };
2287
2287
  }
2288
- function Ti(e) {
2288
+ function Ui(e) {
2289
2289
  var r, o, i, s;
2290
2290
  const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!((o = e.agentUniqueId) != null && o.trim() && ((i = e.flowType) != null && i.trim()) && ((s = e.category) != null && s.trim()));
2291
2291
  return t || n;
2292
2292
  }
2293
- function xi(e) {
2293
+ function wi(e) {
2294
2294
  return {
2295
2295
  caseUniqueId: e.case_unique_id,
2296
2296
  caseId: e.case_id,
@@ -2301,7 +2301,7 @@ function xi(e) {
2301
2301
  description: e.description ?? void 0
2302
2302
  };
2303
2303
  }
2304
- function Mi(e, t, n) {
2304
+ function Ri(e, t, n) {
2305
2305
  var o, i, s;
2306
2306
  const r = new URLSearchParams();
2307
2307
  r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20)), r.set("published", String(n)), (o = e.agentUniqueId) != null && o.trim() && r.set("agent_unique_id", e.agentUniqueId.trim()), (i = e.flowType) != null && i.trim() && r.set("flow_type", e.flowType.trim()), (s = e.category) != null && s.trim() && r.set("category_unique_id", e.category.trim());
@@ -2309,24 +2309,24 @@ function Mi(e, t, n) {
2309
2309
  a && r.append("flow_unique_ids", a);
2310
2310
  return r;
2311
2311
  }
2312
- function Ni(e = {}) {
2312
+ function Pi(e = {}) {
2313
2313
  const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.listPath ?? "/univ/case/list", r = e.fetch ?? fetch, o = e.published ?? 1;
2314
2314
  return async ({ filter: i, page: s }) => {
2315
- if (!Ti(i))
2315
+ if (!Ui(i))
2316
2316
  return { list: [], total: 0, page: 1, pageSize: i.pageSize ?? 20 };
2317
- const a = await It(e), l = Mi(i, s, o), u = await r(`${t}${n}?${l.toString()}`, {
2317
+ const a = await Rt(e), l = Ri(i, s, o), u = await r(`${t}${n}?${l.toString()}`, {
2318
2318
  method: "GET",
2319
2319
  headers: a
2320
- }), m = await Tt(u);
2320
+ }), m = await Ke(u);
2321
2321
  return {
2322
- list: (m.list ?? []).map(xi),
2322
+ list: (m.list ?? []).map(wi),
2323
2323
  total: m.total ?? 0,
2324
2324
  page: m.page ?? s,
2325
2325
  pageSize: m.page_size ?? i.pageSize ?? 20
2326
2326
  };
2327
2327
  };
2328
2328
  }
2329
- function Vs(e = {}) {
2329
+ function ea(e = {}) {
2330
2330
  var r, o, i, s, a;
2331
2331
  const t = {
2332
2332
  baseUrl: e.baseUrl,
@@ -2335,23 +2335,23 @@ function Vs(e = {}) {
2335
2335
  authStorage: e.authStorage
2336
2336
  };
2337
2337
  return {
2338
- fetchDetail: yi({
2338
+ fetchDetail: _i({
2339
2339
  ...t,
2340
2340
  detailPath: (r = e.form) == null ? void 0 : r.detailPath
2341
2341
  }).fetchDetail,
2342
- resumeSearch: _i({
2342
+ resumeSearch: Ei({
2343
2343
  ...t,
2344
2344
  searchPath: (o = e.resume) == null ? void 0 : o.searchPath,
2345
2345
  published: (i = e.resume) == null ? void 0 : i.published
2346
2346
  }),
2347
- caseSearch: Ni({
2347
+ caseSearch: Pi({
2348
2348
  ...t,
2349
2349
  listPath: (s = e.case) == null ? void 0 : s.listPath,
2350
2350
  published: (a = e.case) == null ? void 0 : a.published
2351
2351
  })
2352
2352
  };
2353
2353
  }
2354
- function Bn(e, t) {
2354
+ function jn(e, t) {
2355
2355
  if (!t.trim()) return !0;
2356
2356
  try {
2357
2357
  return new RegExp(t).test(e);
@@ -2359,45 +2359,45 @@ function Bn(e, t) {
2359
2359
  return !0;
2360
2360
  }
2361
2361
  }
2362
- function qn(e) {
2362
+ function $n(e) {
2363
2363
  return e == null ? !0 : typeof e == "string" ? !e.trim() : !1;
2364
2364
  }
2365
- function Fi(e, t) {
2365
+ function zi(e, t) {
2366
2366
  switch (e.type) {
2367
2367
  case "multiselect":
2368
2368
  case "checkbox":
2369
2369
  case "file":
2370
2370
  case "resume_multiselect":
2371
2371
  case "case_multiselect":
2372
- return Q(t).length === 0;
2372
+ return ne(t).length === 0;
2373
2373
  case "toggle":
2374
- return !Ee(t);
2374
+ return !we(t);
2375
2375
  case "number":
2376
2376
  return t == null || t === "";
2377
2377
  default:
2378
- return qn(t);
2378
+ return $n(t);
2379
2379
  }
2380
2380
  }
2381
- function lt(e, t) {
2381
+ function mt(e, t) {
2382
2382
  return e.required === !0 || t > 0;
2383
2383
  }
2384
- function Ii(e, t) {
2384
+ function Oi(e, t) {
2385
2385
  var n, r;
2386
2386
  for (const o of e) {
2387
- if (!Z(o.type)) continue;
2387
+ if (!ee(o.type)) continue;
2388
2388
  const i = (n = o.name) == null ? void 0 : n.trim();
2389
2389
  if (!i) continue;
2390
2390
  const s = t[i], a = ((r = o.label) == null ? void 0 : r.trim()) || i;
2391
- if (o.required && Fi(o, s))
2391
+ if (o.required && zi(o, s))
2392
2392
  return { fieldName: i, label: a, message: `请填写「${a}」` };
2393
- if (o.type === "email" && !qn(s)) {
2393
+ if (o.type === "email" && !$n(s)) {
2394
2394
  const l = String(s).trim();
2395
- if (!Bn(l, kt))
2395
+ if (!jn(l, Tt))
2396
2396
  return { fieldName: i, label: a, message: `「${a}」格式不正确` };
2397
2397
  }
2398
2398
  if (o.type === "file") {
2399
- const l = o.fileMinCount ?? 0, u = Q(s).length;
2400
- if (l > 0 && u < l && lt(o, u))
2399
+ const l = o.fileMinCount ?? 0, u = ne(s).length;
2400
+ if (l > 0 && u < l && mt(o, u))
2401
2401
  return {
2402
2402
  fieldName: i,
2403
2403
  label: a,
@@ -2405,8 +2405,8 @@ function Ii(e, t) {
2405
2405
  };
2406
2406
  }
2407
2407
  if (o.type === "resume_multiselect") {
2408
- const l = o.resumeMinCount, u = Q(s).length;
2409
- if (l !== void 0 && u < l && lt(o, u))
2408
+ const l = o.resumeMinCount, u = ne(s).length;
2409
+ if (l !== void 0 && u < l && mt(o, u))
2410
2410
  return {
2411
2411
  fieldName: i,
2412
2412
  label: a,
@@ -2414,8 +2414,8 @@ function Ii(e, t) {
2414
2414
  };
2415
2415
  }
2416
2416
  if (o.type === "case_multiselect") {
2417
- const l = o.caseMinCount, u = Q(s).length;
2418
- if (l !== void 0 && u < l && lt(o, u))
2417
+ const l = o.caseMinCount, u = ne(s).length;
2418
+ if (l !== void 0 && u < l && mt(o, u))
2419
2419
  return {
2420
2420
  fieldName: i,
2421
2421
  label: a,
@@ -2425,20 +2425,20 @@ function Ii(e, t) {
2425
2425
  }
2426
2426
  return null;
2427
2427
  }
2428
- const Ei = {
2429
- video: dr,
2430
- audio: mr,
2431
- image: ur,
2432
- file: on,
2433
- spreadsheet: cr,
2434
- document: rn
2428
+ const Bi = {
2429
+ video: vr,
2430
+ audio: yr,
2431
+ image: gr,
2432
+ file: mn,
2433
+ spreadsheet: hr,
2434
+ document: un
2435
2435
  };
2436
- function Ui({
2436
+ function qi({
2437
2437
  type: e,
2438
2438
  size: t = 40,
2439
2439
  className: n
2440
2440
  }) {
2441
- const r = Ei[e] ?? on;
2441
+ const r = Bi[e] ?? mn;
2442
2442
  return /* @__PURE__ */ c(
2443
2443
  r,
2444
2444
  {
@@ -2448,7 +2448,69 @@ function Ui({
2448
2448
  }
2449
2449
  );
2450
2450
  }
2451
- const Ln = "skopon-form-v0_9", Ri = /* @__PURE__ */ new Set([
2451
+ const Li = "/api/v1/dev/upload/cdn", Vi = 12e4;
2452
+ class Dn extends Error {
2453
+ constructor(t = "上传已取消") {
2454
+ super(t), this.name = "UploadCancelledError";
2455
+ }
2456
+ }
2457
+ function ji(e) {
2458
+ return e instanceof Dn;
2459
+ }
2460
+ async function $i(e, t = {}) {
2461
+ var s, a, l;
2462
+ const n = new AbortController();
2463
+ let r = !1;
2464
+ const o = () => n.abort();
2465
+ (s = t.signal) != null && s.aborted ? n.abort() : (a = t.signal) == null || a.addEventListener("abort", o, { once: !0 });
2466
+ const i = setTimeout(() => {
2467
+ r = !0, n.abort();
2468
+ }, Vi);
2469
+ try {
2470
+ const u = new FormData();
2471
+ u.append("file", e);
2472
+ const m = await fetch(Li, {
2473
+ method: "POST",
2474
+ headers: wt(),
2475
+ body: u,
2476
+ signal: n.signal
2477
+ }), d = await Ke(m), k = typeof d.url == "string" ? d.url.trim() : "";
2478
+ if (!k) throw new Error("上传成功但响应缺少文件地址");
2479
+ return { ...d, url: k };
2480
+ } catch (u) {
2481
+ throw n.signal.aborted ? r ? new Error("上传超时,请稍后重试") : new Dn() : u;
2482
+ } finally {
2483
+ clearTimeout(i), (l = t.signal) == null || l.removeEventListener("abort", o);
2484
+ }
2485
+ }
2486
+ const Hn = be({
2487
+ beginUpload: () => () => {
2488
+ }
2489
+ });
2490
+ function St({
2491
+ children: e,
2492
+ onUploadingChange: t
2493
+ }) {
2494
+ const [n, r] = w(0), o = x(!0), i = x(t);
2495
+ i.current = t, z(() => (o.current = !0, () => {
2496
+ var a;
2497
+ o.current = !1, (a = i.current) == null || a.call(i, !1);
2498
+ }), []), z(() => {
2499
+ t == null || t(n > 0);
2500
+ }, [n, t]);
2501
+ const s = L(() => {
2502
+ o.current && r((l) => l + 1);
2503
+ let a = !1;
2504
+ return () => {
2505
+ a || (a = !0, o.current && r((l) => Math.max(0, l - 1)));
2506
+ };
2507
+ }, []);
2508
+ return /* @__PURE__ */ c(Hn.Provider, { value: { beginUpload: s }, children: e });
2509
+ }
2510
+ function Di() {
2511
+ return Se(Hn);
2512
+ }
2513
+ const Kn = "skopon-form-v0_9", Hi = /* @__PURE__ */ new Set([
2452
2514
  "SkoponMedia",
2453
2515
  "SkoponSelect",
2454
2516
  "Image",
@@ -2460,20 +2522,20 @@ const Ln = "skopon-form-v0_9", Ri = /* @__PURE__ */ new Set([
2460
2522
  "FileUpload",
2461
2523
  "TextField",
2462
2524
  "Text",
2463
- ...Lo()
2464
- ]), wi = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
2465
- function Ue(e) {
2466
- const t = [...ze.components.values()].find((n) => n.name === e);
2525
+ ...Wo()
2526
+ ]), Ki = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
2527
+ function Re(e) {
2528
+ const t = [...Be.components.values()].find((n) => n.name === e);
2467
2529
  if (!t) throw new Error(`Missing basic catalog component: ${e}`);
2468
2530
  return t.schema;
2469
2531
  }
2470
- function w(e) {
2532
+ function B(e) {
2471
2533
  return typeof e == "string" ? e : "";
2472
2534
  }
2473
- function Vn(e) {
2474
- return se(e);
2535
+ function Wn(e) {
2536
+ return ce(e);
2475
2537
  }
2476
- function De({
2538
+ function We({
2477
2539
  mediaType: e,
2478
2540
  urls: t,
2479
2541
  mediaSize: n,
@@ -2481,8 +2543,8 @@ function De({
2481
2543
  help: o,
2482
2544
  placeholder: i
2483
2545
  }) {
2484
- const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l = Br(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
2485
- return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
2546
+ const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l = Dr(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
2547
+ return /* @__PURE__ */ U("div", { className: "form-block-preview", children: [
2486
2548
  s ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: s }) : null,
2487
2549
  t.length === 0 ? /* @__PURE__ */ c("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ c("div", { className: l, children: t.map((m, d) => e === "image" ? /* @__PURE__ */ c(
2488
2550
  "img",
@@ -2509,21 +2571,21 @@ function De({
2509
2571
  },
2510
2572
  `media-${d}`
2511
2573
  )) }),
2512
- a ? /* @__PURE__ */ c(ee.Text, { type: "secondary", className: "form-block-preview-help", children: a }) : null
2574
+ a ? /* @__PURE__ */ c(re.Text, { type: "secondary", className: "form-block-preview-help", children: a }) : null
2513
2575
  ] });
2514
2576
  }
2515
- function He(e, t) {
2516
- const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : w(e.url).trim() ? [w(e.url).trim()] : [];
2577
+ function Ge(e, t) {
2578
+ const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : B(e.url).trim() ? [B(e.url).trim()] : [];
2517
2579
  return {
2518
2580
  mediaType: t,
2519
2581
  urls: n,
2520
- mediaSize: Ie(e.mediaSize),
2521
- label: w(e.label) || w(e.description),
2522
- help: w(e.help),
2523
- placeholder: w(e.placeholder)
2582
+ mediaSize: Ue(e.mediaSize),
2583
+ label: B(e.label) || B(e.description),
2584
+ help: B(e.help),
2585
+ placeholder: B(e.placeholder)
2524
2586
  };
2525
2587
  }
2526
- const Pi = {
2588
+ const Wi = {
2527
2589
  name: "SkoponMedia",
2528
2590
  schema: f.object({
2529
2591
  mediaType: f.any().optional(),
@@ -2533,19 +2595,19 @@ const Pi = {
2533
2595
  help: f.any().optional(),
2534
2596
  placeholder: f.any().optional()
2535
2597
  }).passthrough()
2536
- }, zi = J(Pi, ({ context: e }) => {
2537
- const t = e.componentModel.properties, n = w(t.mediaType);
2538
- return /* @__PURE__ */ c(De, { ...He(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
2539
- }), Oi = J(
2540
- { name: "Image", schema: Ue("Image") },
2541
- ({ context: e }) => /* @__PURE__ */ c(De, { ...He(e.componentModel.properties, "image") })
2542
- ), Bi = J(
2543
- { name: "Video", schema: Ue("Video") },
2544
- ({ context: e }) => /* @__PURE__ */ c(De, { ...He(e.componentModel.properties, "video") })
2545
- ), qi = J(
2546
- { name: "AudioPlayer", schema: Ue("AudioPlayer") },
2547
- ({ context: e }) => /* @__PURE__ */ c(De, { ...He(e.componentModel.properties, "audio") })
2548
- ), Li = {
2598
+ }, Gi = Z(Wi, ({ context: e }) => {
2599
+ const t = e.componentModel.properties, n = B(t.mediaType);
2600
+ return /* @__PURE__ */ c(We, { ...Ge(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
2601
+ }), Ji = Z(
2602
+ { name: "Image", schema: Re("Image") },
2603
+ ({ context: e }) => /* @__PURE__ */ c(We, { ...Ge(e.componentModel.properties, "image") })
2604
+ ), Yi = Z(
2605
+ { name: "Video", schema: Re("Video") },
2606
+ ({ context: e }) => /* @__PURE__ */ c(We, { ...Ge(e.componentModel.properties, "video") })
2607
+ ), Qi = Z(
2608
+ { name: "AudioPlayer", schema: Re("AudioPlayer") },
2609
+ ({ context: e }) => /* @__PURE__ */ c(We, { ...Ge(e.componentModel.properties, "audio") })
2610
+ ), Xi = {
2549
2611
  name: "SkoponSelect",
2550
2612
  schema: f.object({
2551
2613
  label: f.any().optional(),
@@ -2555,18 +2617,18 @@ const Pi = {
2555
2617
  value: f.any().optional()
2556
2618
  }).passthrough()
2557
2619
  };
2558
- function Vi({ context: e }) {
2559
- const { interactive: t } = ae(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = le(e, "value", {
2620
+ function Zi({ context: e }) {
2621
+ const { interactive: t } = ue(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = me(e, "value", {
2560
2622
  component: "SkoponSelect",
2561
2623
  changeAction: "select"
2562
- }), s = e.componentModel.properties, a = w(s.label), l = w(s.placeholder), u = Vn(s.options), m = w(s.mode) === "multiple";
2563
- return B(() => {
2564
- const d = kn(n, m);
2624
+ }), s = e.componentModel.properties, a = B(s.label), l = B(s.placeholder), u = Wn(s.options), m = B(s.mode) === "multiple";
2625
+ return z(() => {
2626
+ const d = xn(n, m);
2565
2627
  d !== null && o(d);
2566
- }, [m, n, o]), u.length === 0 ? null : /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
2628
+ }, [m, n, o]), u.length === 0 ? null : /* @__PURE__ */ U("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
2567
2629
  a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
2568
2630
  /* @__PURE__ */ c(
2569
- ct,
2631
+ dt,
2570
2632
  {
2571
2633
  mode: m ? "multiple" : void 0,
2572
2634
  disabled: !t,
@@ -2575,28 +2637,28 @@ function Vi({ context: e }) {
2575
2637
  style: { width: "100%" },
2576
2638
  placeholder: l || (m ? "请选择多项" : "请选择"),
2577
2639
  options: u,
2578
- value: m ? Q(n) : Ae(n),
2640
+ value: m ? ne(n) : Me(n),
2579
2641
  onChange: (d) => r(m ? d ?? [] : d ?? "")
2580
2642
  }
2581
2643
  )
2582
2644
  ] });
2583
2645
  }
2584
- const ji = J(
2585
- Li,
2586
- Vi
2646
+ const es = Z(
2647
+ Xi,
2648
+ Zi
2587
2649
  );
2588
- function $i({ context: e }) {
2589
- const { interactive: t } = ae(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = le(e, "value", {
2650
+ function ts({ context: e }) {
2651
+ const { interactive: t } = ue(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = me(e, "value", {
2590
2652
  component: "ChoicePicker",
2591
2653
  changeAction: "select"
2592
- }), s = e.componentModel.properties, a = w(s.label), l = w(s.variant) || "mutuallyExclusive", u = w(s.skoponPickerType), m = w(s.placeholder), d = Vn(s.options), y = u === "select" || u === "multiselect" || u === "radio" || u === "checkbox" ? u : l === "multipleSelection" ? "checkbox" : "radio", S = y === "multiselect" || y === "checkbox";
2593
- return B(() => {
2594
- const g = kn(n, S);
2654
+ }), s = e.componentModel.properties, a = B(s.label), l = B(s.variant) || "mutuallyExclusive", u = B(s.skoponPickerType), m = B(s.placeholder), d = Wn(s.options), y = u === "select" || u === "multiselect" || u === "radio" || u === "checkbox" ? u : l === "multipleSelection" ? "checkbox" : "radio", T = y === "multiselect" || y === "checkbox";
2655
+ return z(() => {
2656
+ const g = xn(n, T);
2595
2657
  g !== null && o(g);
2596
- }, [S, n, o]), d.length === 0 ? null : /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
2658
+ }, [T, n, o]), d.length === 0 ? null : /* @__PURE__ */ U("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
2597
2659
  a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
2598
2660
  y === "select" ? /* @__PURE__ */ c(
2599
- ct,
2661
+ dt,
2600
2662
  {
2601
2663
  disabled: !t,
2602
2664
  allowClear: !0,
@@ -2604,11 +2666,11 @@ function $i({ context: e }) {
2604
2666
  style: { width: "100%" },
2605
2667
  placeholder: m || "请选择",
2606
2668
  options: d,
2607
- value: Ae(n),
2669
+ value: Me(n),
2608
2670
  onChange: (g) => r(g ?? "")
2609
2671
  }
2610
2672
  ) : y === "multiselect" ? /* @__PURE__ */ c(
2611
- ct,
2673
+ dt,
2612
2674
  {
2613
2675
  mode: "multiple",
2614
2676
  disabled: !t,
@@ -2617,31 +2679,31 @@ function $i({ context: e }) {
2617
2679
  style: { width: "100%" },
2618
2680
  placeholder: m || "请选择多项",
2619
2681
  options: d,
2620
- value: Q(n),
2682
+ value: ne(n),
2621
2683
  onChange: (g) => r(g ?? [])
2622
2684
  }
2623
2685
  ) : y === "checkbox" ? /* @__PURE__ */ c(
2624
- Zn.Group,
2686
+ ir.Group,
2625
2687
  {
2626
2688
  disabled: !t,
2627
2689
  className: "form-block-preview-control",
2628
2690
  options: d,
2629
- value: Q(n),
2691
+ value: ne(n),
2630
2692
  onChange: (g) => r(g)
2631
2693
  }
2632
2694
  ) : /* @__PURE__ */ c(
2633
- er.Group,
2695
+ sr.Group,
2634
2696
  {
2635
2697
  disabled: !t,
2636
2698
  className: "form-block-preview-control",
2637
2699
  options: d,
2638
- value: Ae(n),
2700
+ value: Me(n),
2639
2701
  onChange: (g) => r(g.target.value)
2640
2702
  }
2641
2703
  )
2642
2704
  ] });
2643
2705
  }
2644
- const Di = J(
2706
+ const ns = Z(
2645
2707
  {
2646
2708
  name: "ChoicePicker",
2647
2709
  schema: f.object({
@@ -2653,45 +2715,45 @@ const Di = J(
2653
2715
  placeholder: f.any().optional()
2654
2716
  }).passthrough()
2655
2717
  },
2656
- $i
2718
+ ts
2657
2719
  );
2658
- function Hi({ context: e }) {
2659
- const { interactive: t } = ae(), { value: n, setValue: r, fieldName: o } = le(e, "value", {
2720
+ function rs({ context: e }) {
2721
+ const { interactive: t } = ue(), { value: n, setValue: r, fieldName: o } = me(e, "value", {
2660
2722
  component: "CheckBox",
2661
2723
  changeAction: "change"
2662
- }), i = e.componentModel.properties, s = w(i.label);
2663
- return /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
2724
+ }), i = e.componentModel.properties, s = B(i.label);
2725
+ return /* @__PURE__ */ U("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
2664
2726
  s ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: s }) : null,
2665
2727
  /* @__PURE__ */ c(
2666
- tr,
2728
+ ar,
2667
2729
  {
2668
2730
  disabled: !t,
2669
2731
  className: "form-block-preview-control",
2670
- checked: Ee(n),
2732
+ checked: we(n),
2671
2733
  onChange: (a) => r(a)
2672
2734
  }
2673
2735
  )
2674
2736
  ] });
2675
2737
  }
2676
- const Ki = J(
2677
- { name: "CheckBox", schema: Ue("CheckBox") },
2678
- Hi
2738
+ const os = Z(
2739
+ { name: "CheckBox", schema: Re("CheckBox") },
2740
+ rs
2679
2741
  );
2680
- function Wi(e, t, n) {
2681
- const r = Ae(e);
2742
+ function is(e, t, n) {
2743
+ const r = Me(e);
2682
2744
  if (!r) return;
2683
2745
  if (!t && n) {
2684
- const i = Kt(r, "HH:mm", !0);
2746
+ const i = Qt(r, "HH:mm", !0);
2685
2747
  return i.isValid() ? i : void 0;
2686
2748
  }
2687
- const o = Kt(r);
2749
+ const o = Qt(r);
2688
2750
  return o.isValid() ? o : void 0;
2689
2751
  }
2690
- function Gi({ context: e }) {
2691
- const { interactive: t } = ae(), { value: n, setValue: r, fieldName: o, reportFocus: i } = le(e, "value", {
2752
+ function ss({ context: e }) {
2753
+ const { interactive: t } = ue(), { value: n, setValue: r, fieldName: o, reportFocus: i } = me(e, "value", {
2692
2754
  component: "DateTimeInput",
2693
2755
  changeAction: "change"
2694
- }), s = e.componentModel.properties, a = w(s.label), l = w(s.placeholder), u = s.enableDate === !0, m = s.enableTime === !0, d = Wi(n, u, m), b = (y) => {
2756
+ }), s = e.componentModel.properties, a = B(s.label), l = B(s.placeholder), u = s.enableDate === !0, m = s.enableTime === !0, d = is(n, u, m), k = (y) => {
2695
2757
  if (!y) {
2696
2758
  r("");
2697
2759
  return;
@@ -2706,21 +2768,21 @@ function Gi({ context: e }) {
2706
2768
  }
2707
2769
  r(y.format("YYYY-MM-DD"));
2708
2770
  };
2709
- return /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
2771
+ return /* @__PURE__ */ U("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
2710
2772
  a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
2711
2773
  !u && m ? /* @__PURE__ */ c(
2712
- nr,
2774
+ lr,
2713
2775
  {
2714
2776
  disabled: !t,
2715
2777
  className: "form-block-preview-control",
2716
2778
  style: { width: "100%" },
2717
2779
  placeholder: l || "选择时间",
2718
2780
  value: d,
2719
- onChange: b,
2781
+ onChange: k,
2720
2782
  onFocus: i
2721
2783
  }
2722
2784
  ) : /* @__PURE__ */ c(
2723
- rr,
2785
+ cr,
2724
2786
  {
2725
2787
  showTime: u && m,
2726
2788
  disabled: !t,
@@ -2728,13 +2790,13 @@ function Gi({ context: e }) {
2728
2790
  style: { width: "100%" },
2729
2791
  placeholder: l || (u && m ? "选择日期时间" : "选择日期"),
2730
2792
  value: d,
2731
- onChange: b,
2793
+ onChange: k,
2732
2794
  onFocus: i
2733
2795
  }
2734
2796
  )
2735
2797
  ] });
2736
2798
  }
2737
- const Ji = J(
2799
+ const as = Z(
2738
2800
  {
2739
2801
  name: "DateTimeInput",
2740
2802
  schema: f.object({
@@ -2747,8 +2809,8 @@ const Ji = J(
2747
2809
  max: f.any().optional()
2748
2810
  }).passthrough()
2749
2811
  },
2750
- Gi
2751
- ), Yi = {
2812
+ ss
2813
+ ), ls = {
2752
2814
  name: "FileUpload",
2753
2815
  schema: f.object({
2754
2816
  label: f.any().optional(),
@@ -2760,89 +2822,172 @@ const Ji = J(
2760
2822
  value: f.any().optional()
2761
2823
  }).passthrough()
2762
2824
  };
2763
- function Xi({ context: e }) {
2764
- const { interactive: t } = ae(), { value: n, setValue: r, fieldName: o } = le(e, "value", {
2825
+ function an(e) {
2826
+ return ne(e).map((t) => t.trim()).filter(Boolean);
2827
+ }
2828
+ function cs(e) {
2829
+ const n = e.split(/[?#]/, 1)[0].split("/").filter(Boolean).pop() || e;
2830
+ try {
2831
+ return decodeURIComponent(n);
2832
+ } catch {
2833
+ return n;
2834
+ }
2835
+ }
2836
+ function ln(e, t) {
2837
+ return { uid: t, name: cs(e), status: "done", url: e };
2838
+ }
2839
+ function us({ context: e }) {
2840
+ var oe;
2841
+ const { interactive: t } = ue(), { beginUpload: n } = Di(), { value: r, setValue: o, setValueSilent: i, fieldName: s } = me(e, "value", {
2765
2842
  component: "FileUpload",
2766
2843
  changeAction: "change"
2767
- }), i = e.componentModel.properties, s = w(i.label), a = w(i.accept), l = Array.isArray(i.fileAcceptTypes) ? i.fileAcceptTypes.map(String) : void 0, u = a ? a.split(",").map((p) => p.trim()).filter(Boolean) : void 0, m = Er(l, u), d = typeof i.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
2768
- i.filePlaceholderIcon
2769
- ) ? i.filePlaceholderIcon : "document", b = typeof i.minCount == "number" ? Math.max(0, i.minCount) : 0, y = typeof i.maxCount == "number" ? i.maxCount : 1, S = y > 0, g = Q(n), k = S && g.length >= y, h = g.length < b;
2770
- return /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
2771
- s ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: s }) : null,
2772
- /* @__PURE__ */ x(
2773
- Ze.Dragger,
2844
+ }), a = e.componentModel.properties, l = B(a.label), u = B(a.accept), m = Array.isArray(a.fileAcceptTypes) ? a.fileAcceptTypes.map(String) : void 0, d = u ? u.split(",").map((_) => _.trim()).filter(Boolean) : void 0, k = Or(m, d), y = typeof a.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
2845
+ a.filePlaceholderIcon
2846
+ ) ? a.filePlaceholderIcon : "document", T = typeof a.minCount == "number" ? Math.max(0, a.minCount) : 0, g = typeof a.maxCount == "number" ? a.maxCount : 1, C = g > 0, v = an(r), p = x(0), S = x(!0), N = x(/* @__PURE__ */ new Map()), O = x(o);
2847
+ O.current = o;
2848
+ const [F, j] = w(
2849
+ () => v.map((_) => ln(_, `external-${p.current++}`))
2850
+ ), H = x(F);
2851
+ H.current = F;
2852
+ const I = L(
2853
+ (_, h) => {
2854
+ const b = _(H.current);
2855
+ return H.current = b, S.current && j(b), h && O.current(
2856
+ b.filter((R) => R.status === "done" && R.url).map((R) => R.url)
2857
+ ), b;
2858
+ },
2859
+ []
2860
+ );
2861
+ z(() => (S.current = !0, () => {
2862
+ S.current = !1;
2863
+ for (const _ of N.current.values()) _.abort();
2864
+ N.current.clear();
2865
+ }), []), z(() => {
2866
+ const _ = an(r);
2867
+ Array.isArray(r) && r.length === _.length && r.every((R, M) => typeof R == "string" && R === _[M]) || i(_);
2868
+ const b = /* @__PURE__ */ new Set();
2869
+ I(
2870
+ (R) => {
2871
+ const M = R.filter((E) => {
2872
+ if (E.status !== "done" || !E.url) return !0;
2873
+ const J = _.findIndex((te, se) => !b.has(se) && te === E.url);
2874
+ return J < 0 ? !1 : (b.add(J), !0);
2875
+ });
2876
+ return _.forEach((E, J) => {
2877
+ b.has(J) || M.push(ln(E, `external-${p.current++}`));
2878
+ }), M;
2879
+ },
2880
+ !1
2881
+ );
2882
+ }, [r, i, I]);
2883
+ const A = L(
2884
+ (_) => {
2885
+ if (!t || C && H.current.length >= g) return;
2886
+ const h = `${_.uid ?? "file"}-${p.current++}`, b = new AbortController();
2887
+ N.current.set(h, b), I(
2888
+ (M) => [...M, { uid: h, name: _.name, status: "uploading" }],
2889
+ !1
2890
+ );
2891
+ const R = n();
2892
+ $i(_, { signal: b.signal }).then((M) => {
2893
+ !S.current || b.signal.aborted || I(
2894
+ (E) => E.map(
2895
+ (J) => J.uid === h ? { ...J, status: "done", url: M.url, error: void 0 } : J
2896
+ ),
2897
+ !0
2898
+ );
2899
+ }).catch((M) => {
2900
+ if (!S.current || ji(M)) return;
2901
+ const E = M instanceof Error ? M.message : "上传失败";
2902
+ I(
2903
+ (J) => J.map(
2904
+ (te) => te.uid === h ? { ...te, status: "error", error: E } : te
2905
+ ),
2906
+ !1
2907
+ );
2908
+ }).finally(() => {
2909
+ N.current.delete(h), R();
2910
+ });
2911
+ },
2912
+ [n, I, C, t, g]
2913
+ ), Y = L(
2914
+ (_) => {
2915
+ var h;
2916
+ (h = N.current.get(_)) == null || h.abort(), N.current.delete(_), I((b) => b.filter((R) => R.uid !== _), !0);
2917
+ },
2918
+ [I]
2919
+ ), G = F.filter((_) => _.status === "done").length, W = C && F.length >= g, q = G < T, D = (oe = [...F].reverse().find((_) => _.error)) == null ? void 0 : oe.error, ie = F.map((_) => ({
2920
+ uid: _.uid,
2921
+ name: _.name,
2922
+ status: _.status,
2923
+ url: _.url,
2924
+ response: _.error
2925
+ }));
2926
+ return /* @__PURE__ */ U("div", { className: "form-block-preview", "data-skopon-field": s || void 0, children: [
2927
+ l ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: l }) : null,
2928
+ /* @__PURE__ */ U(
2929
+ nt.Dragger,
2774
2930
  {
2775
- disabled: !t || k,
2776
- accept: Ir(l, u),
2931
+ disabled: !t,
2932
+ openFileDialogOnClick: !W,
2933
+ accept: zr(m, d),
2777
2934
  className: "form-file-upload-preview",
2778
- showUploadList: t && g.length > 0,
2779
- fileList: t ? g.map((p, v) => ({
2780
- uid: `${v}-${p}`,
2781
- name: p,
2782
- status: "done"
2783
- })) : [],
2784
- beforeUpload: (p) => {
2785
- if (!t) return Ze.LIST_IGNORE;
2786
- const v = Q(Yt(e));
2787
- if (S && v.length >= y) return Ze.LIST_IGNORE;
2788
- const M = S ? [...v, p.name].slice(0, y) : [...v, p.name];
2789
- return r(M), !1;
2790
- },
2791
- onRemove: (p) => {
2792
- const v = Q(Yt(e)), M = /^(\d+)-/.exec(p.uid ?? ""), N = M ? Number(M[1]) : -1, _ = N >= 0 && N < v.length ? v.filter((z, C) => C !== N) : v.filter((z) => z !== p.name);
2793
- if (_.length < b) return !1;
2794
- r(_);
2795
- },
2935
+ multiple: !C || g > 1,
2936
+ showUploadList: t && F.length > 0,
2937
+ fileList: t ? ie : [],
2938
+ beforeUpload: (_) => t ? (A(_), nt.LIST_IGNORE) : nt.LIST_IGNORE,
2939
+ onRemove: (_) => (Y(_.uid), !0),
2796
2940
  children: [
2797
- /* @__PURE__ */ c("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ c(Ui, { type: d, size: 40 }) }),
2941
+ /* @__PURE__ */ c("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ c(qi, { type: y, size: 40 }) }),
2798
2942
  /* @__PURE__ */ c("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
2799
2943
  ]
2800
2944
  }
2801
2945
  ),
2802
- /* @__PURE__ */ x(ee.Text, { type: "secondary", className: "form-block-preview-help", children: [
2946
+ /* @__PURE__ */ U(re.Text, { type: "secondary", className: "form-block-preview-help", children: [
2803
2947
  "允许:",
2804
- m ?? "全部类型",
2805
- b > 0 ? `;至少 ${b} 个文件` : "",
2806
- S ? `;最多 ${y} 个文件` : "",
2807
- ";当前仅收集文件名(不含文件内容,需宿主另行上传)",
2808
- h && t ? `(当前 ${g.length} 个,未达下限)` : ""
2809
- ] })
2948
+ k ?? "全部类型",
2949
+ T > 0 ? `;至少 ${T} 个文件` : "",
2950
+ C ? `;最多 ${g} 个文件` : "",
2951
+ ";选择后自动上传至 CDN",
2952
+ q && t ? `(当前 ${G} 个,未达下限)` : ""
2953
+ ] }),
2954
+ D ? /* @__PURE__ */ c(re.Text, { type: "danger", className: "form-block-preview-help", children: D }) : null
2810
2955
  ] });
2811
2956
  }
2812
- const Qi = J(
2813
- Yi,
2814
- Xi
2957
+ const ms = Z(
2958
+ ls,
2959
+ us
2815
2960
  );
2816
- function Zi({ context: e }) {
2817
- const { interactive: t } = ae(), { value: n, setValue: r, fieldName: o, reportFocus: i } = le(e, "value", {
2961
+ function ds({ context: e }) {
2962
+ const { interactive: t } = ue(), { value: n, setValue: r, fieldName: o, reportFocus: i } = me(e, "value", {
2818
2963
  component: "TextField",
2819
2964
  changeAction: "change",
2820
2965
  debounceChange: !0
2821
- }), s = e.componentModel.properties, a = w(s.label), l = w(s.placeholder), u = w(s.variant) || "shortText", m = w(s.validationRegexp), d = Ae(n) ?? "", b = !t, [y, S] = E(""), g = (p) => {
2966
+ }), s = e.componentModel.properties, a = B(s.label), l = B(s.placeholder), u = B(s.variant) || "shortText", m = B(s.validationRegexp), d = Me(n) ?? "", k = !t, [y, T] = w(""), g = (p) => {
2822
2967
  if (!m || !p.trim()) {
2823
- S("");
2968
+ T("");
2824
2969
  return;
2825
2970
  }
2826
- S(Bn(p, m) ? "" : "格式不正确");
2971
+ T(jn(p, m) ? "" : "格式不正确");
2827
2972
  };
2828
- B(() => {
2973
+ z(() => {
2829
2974
  g(d);
2830
2975
  }, [m, d]);
2831
- const k = "form-block-preview-control";
2832
- let h;
2976
+ const C = "form-block-preview-control";
2977
+ let v;
2833
2978
  if (u === "longText")
2834
- h = /* @__PURE__ */ c(
2835
- et.TextArea,
2979
+ v = /* @__PURE__ */ c(
2980
+ rt.TextArea,
2836
2981
  {
2837
- disabled: b,
2838
- className: k,
2982
+ disabled: k,
2983
+ className: C,
2839
2984
  placeholder: l || "长文本回答...",
2840
2985
  autoSize: { minRows: 2, maxRows: 6 },
2841
2986
  value: d,
2842
2987
  status: y ? "error" : void 0,
2843
2988
  onChange: (p) => {
2844
- const v = p.target.value;
2845
- r(v), g(v);
2989
+ const S = p.target.value;
2990
+ r(S), g(S);
2846
2991
  },
2847
2992
  onFocus: i,
2848
2993
  onBlur: (p) => g(p.target.value)
@@ -2850,51 +2995,51 @@ function Zi({ context: e }) {
2850
2995
  );
2851
2996
  else if (u === "number") {
2852
2997
  const p = d && Number.isFinite(Number(d)) ? Number(d) : void 0;
2853
- h = /* @__PURE__ */ c(
2854
- or,
2998
+ v = /* @__PURE__ */ c(
2999
+ ur,
2855
3000
  {
2856
- disabled: b,
2857
- className: k,
3001
+ disabled: k,
3002
+ className: C,
2858
3003
  style: { width: "100%" },
2859
3004
  placeholder: l || "数字",
2860
3005
  value: p,
2861
- onChange: (v) => r(v == null ? "" : String(v)),
3006
+ onChange: (S) => r(S == null ? "" : String(S)),
2862
3007
  onFocus: i
2863
3008
  }
2864
3009
  );
2865
- } else u === "obscured" ? h = /* @__PURE__ */ c(
2866
- et.Password,
3010
+ } else u === "obscured" ? v = /* @__PURE__ */ c(
3011
+ rt.Password,
2867
3012
  {
2868
- disabled: b,
2869
- className: k,
3013
+ disabled: k,
3014
+ className: C,
2870
3015
  placeholder: l,
2871
3016
  value: d,
2872
3017
  onChange: (p) => r(p.target.value),
2873
3018
  onFocus: i
2874
3019
  }
2875
- ) : h = /* @__PURE__ */ c(
2876
- et,
3020
+ ) : v = /* @__PURE__ */ c(
3021
+ rt,
2877
3022
  {
2878
- disabled: b,
2879
- className: k,
3023
+ disabled: k,
3024
+ className: C,
2880
3025
  placeholder: l,
2881
3026
  value: d,
2882
3027
  status: y ? "error" : void 0,
2883
3028
  onChange: (p) => {
2884
- const v = p.target.value;
2885
- r(v), g(v);
3029
+ const S = p.target.value;
3030
+ r(S), g(S);
2886
3031
  },
2887
3032
  onFocus: i,
2888
3033
  onBlur: (p) => g(p.target.value)
2889
3034
  }
2890
3035
  );
2891
- return /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
3036
+ return /* @__PURE__ */ U("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
2892
3037
  a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
2893
- h,
2894
- y ? /* @__PURE__ */ c(ee.Text, { type: "danger", className: "form-block-preview-help", children: y }) : null
3038
+ v,
3039
+ y ? /* @__PURE__ */ c(re.Text, { type: "danger", className: "form-block-preview-help", children: y }) : null
2895
3040
  ] });
2896
3041
  }
2897
- const es = J(
3042
+ const fs = Z(
2898
3043
  {
2899
3044
  name: "TextField",
2900
3045
  schema: f.object({
@@ -2905,37 +3050,37 @@ const es = J(
2905
3050
  value: f.any().optional()
2906
3051
  }).passthrough()
2907
3052
  },
2908
- Zi
3053
+ ds
2909
3054
  );
2910
- function ts({ context: e }) {
2911
- const t = e.componentModel.properties, n = w(t.text), r = w(t.variant) || "body";
2912
- return wi.has(r) ? r === "caption" ? /* @__PURE__ */ c(ee.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ c("em", { children: n }) }) : /* @__PURE__ */ c(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ c(ee.Paragraph, { className: "form-block-preview-paragraph", children: n });
3055
+ function ps({ context: e }) {
3056
+ const t = e.componentModel.properties, n = B(t.text), r = B(t.variant) || "body";
3057
+ return Ki.has(r) ? r === "caption" ? /* @__PURE__ */ c(re.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ c("em", { children: n }) }) : /* @__PURE__ */ c(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ c(re.Paragraph, { className: "form-block-preview-paragraph", children: n });
2913
3058
  }
2914
- const ns = J(
2915
- { name: "Text", schema: Ue("Text") },
2916
- ts
3059
+ const hs = Z(
3060
+ { name: "Text", schema: Re("Text") },
3061
+ ps
2917
3062
  );
2918
- function jn() {
3063
+ function Gn() {
2919
3064
  const t = [
2920
- ...[...ze.components.values()].filter(
2921
- (r) => !Ri.has(r.name)
3065
+ ...[...Be.components.values()].filter(
3066
+ (r) => !Hi.has(r.name)
2922
3067
  ),
2923
- zi,
2924
- ji,
2925
- Oi,
2926
- Bi,
2927
- qi,
2928
- Di,
2929
- Ki,
3068
+ Gi,
3069
+ es,
2930
3070
  Ji,
3071
+ Yi,
2931
3072
  Qi,
2932
- es,
2933
3073
  ns,
2934
- ...qo()
2935
- ], n = [...ze.functions.values()];
2936
- return new pr(Ln, t, n, ze.themeSchema);
2937
- }
2938
- const ie = {
3074
+ os,
3075
+ as,
3076
+ ms,
3077
+ fs,
3078
+ hs,
3079
+ ...Ko()
3080
+ ], n = [...Be.functions.values()];
3081
+ return new br(Kn, t, n, Be.themeSchema);
3082
+ }
3083
+ const le = {
2939
3084
  jade9: "#29a383",
2940
3085
  jade10: "#26997b",
2941
3086
  jade11: "#208368",
@@ -2947,20 +3092,20 @@ const ie = {
2947
3092
  primaryHover: "#26997b",
2948
3093
  primaryActive: "#1d3b31",
2949
3094
  onPrimary: "#ffffff"
2950
- }, rs = {
3095
+ }, gs = {
2951
3096
  cssVar: { key: "vidtempl" },
2952
3097
  token: {
2953
- colorPrimary: ie.primarySolid,
2954
- colorPrimaryHover: ie.primaryHover,
2955
- colorPrimaryActive: ie.primaryActive,
2956
- colorLink: ie.primary,
2957
- colorLinkHover: ie.primaryHover,
2958
- colorSuccess: ie.jade9,
3098
+ colorPrimary: le.primarySolid,
3099
+ colorPrimaryHover: le.primaryHover,
3100
+ colorPrimaryActive: le.primaryActive,
3101
+ colorLink: le.primary,
3102
+ colorLinkHover: le.primaryHover,
3103
+ colorSuccess: le.jade9,
2959
3104
  colorWarning: "#f5a623",
2960
3105
  gold6: "#f5a623",
2961
3106
  gold7: "#e6951a",
2962
3107
  colorError: "#e5484d",
2963
- colorInfo: ie.primary,
3108
+ colorInfo: le.primary,
2964
3109
  colorBgLayout: "#f9f9f9",
2965
3110
  colorBgContainer: "#ffffff",
2966
3111
  colorBgElevated: "#ffffff",
@@ -3020,7 +3165,7 @@ const ie = {
3020
3165
  },
3021
3166
  Tag: {
3022
3167
  defaultBg: "#e6f7ed",
3023
- defaultColor: ie.primary,
3168
+ defaultColor: le.primary,
3024
3169
  fontSizeSM: 13
3025
3170
  },
3026
3171
  Form: {
@@ -3032,14 +3177,14 @@ const ie = {
3032
3177
  }
3033
3178
  }
3034
3179
  };
3035
- function _e({
3180
+ function Fe({
3036
3181
  children: e,
3037
3182
  locale: t,
3038
3183
  theme: n
3039
3184
  }) {
3040
- return /* @__PURE__ */ c(ir, { theme: n ?? rs, locale: t, children: e });
3185
+ return /* @__PURE__ */ c(mr, { theme: n ?? gs, locale: t, children: e });
3041
3186
  }
3042
- const os = Jn(
3187
+ const ys = tr(
3043
3188
  function({
3044
3189
  doc: t,
3045
3190
  surfaceId: n = "skopon-form",
@@ -3048,69 +3193,70 @@ const os = Jn(
3048
3193
  fieldNames: i = [],
3049
3194
  resumeSearch: s = null,
3050
3195
  caseSearch: a = null,
3051
- wrapProvider: l = !0
3052
- }, u) {
3053
- B(() => {
3054
- cn(), ln();
3196
+ onUploadingChange: l,
3197
+ wrapProvider: u = !0
3198
+ }, m) {
3199
+ z(() => {
3200
+ hn(), pn();
3055
3201
  }, []);
3056
- const m = A(null), d = A(i);
3057
- d.current = i;
3058
- const b = V(() => {
3059
- if (gt(t)) return "";
3202
+ const d = x(null), k = x(i);
3203
+ k.current = i;
3204
+ const y = $(() => {
3205
+ if (bt(t)) return "";
3060
3206
  try {
3061
3207
  return JSON.stringify(t);
3062
3208
  } catch {
3063
3209
  return String(t);
3064
3210
  }
3065
- }, [t]), y = V(() => {
3066
- if (!b)
3211
+ }, [t]), T = $(() => {
3212
+ if (!y)
3067
3213
  return { surfaces: [], processor: null };
3068
3214
  try {
3069
- const h = JSON.parse(b), p = new an([jn()]), v = Jo(h, {
3215
+ const p = JSON.parse(y), S = new fn([Gn()]), N = ni(p, {
3070
3216
  surfaceId: n,
3071
- catalogId: Ln
3217
+ catalogId: Kn
3072
3218
  });
3073
- return p.processMessages(v), {
3074
- surfaces: Array.from(p.model.surfacesMap.values()),
3075
- processor: p
3219
+ return S.processMessages(N), {
3220
+ surfaces: Array.from(S.model.surfacesMap.values()),
3221
+ processor: S
3076
3222
  };
3077
- } catch (h) {
3078
- return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", h), { surfaces: [], processor: null };
3223
+ } catch (p) {
3224
+ return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", p), { surfaces: [], processor: null };
3079
3225
  }
3080
- }, [b, n]), { surfaces: S, processor: g } = y;
3081
- if (m.current = g, Yn(
3082
- u,
3226
+ }, [y, n]), { surfaces: g, processor: C } = T;
3227
+ if (d.current = C, nr(
3228
+ m,
3083
3229
  () => ({
3084
- getValues(h) {
3085
- const p = m.current;
3086
- if (!p) return {};
3087
- const v = (h ?? d.current).map((M) => M.trim()).filter(Boolean);
3088
- return Zo(p, n, v);
3230
+ getValues(p) {
3231
+ const S = d.current;
3232
+ if (!S) return {};
3233
+ const N = (p ?? k.current).map((O) => O.trim()).filter(Boolean);
3234
+ return si(S, n, N);
3089
3235
  },
3090
- setValues(h) {
3091
- const p = m.current;
3092
- if (!p) return;
3093
- const v = p.model.surfacesMap.get(n);
3094
- if (v)
3095
- for (const [M, N] of Object.entries(h)) {
3096
- const _ = M.trim();
3097
- _ && v.dataModel.set(`/${_}`, N);
3236
+ setValues(p) {
3237
+ const S = d.current;
3238
+ if (!S) return;
3239
+ const N = S.model.surfacesMap.get(n);
3240
+ if (N)
3241
+ for (const [O, F] of Object.entries(p)) {
3242
+ const j = O.trim();
3243
+ j && N.dataModel.set(`/${j}`, F);
3098
3244
  }
3099
3245
  }
3100
3246
  }),
3101
3247
  [n]
3102
- ), S.length === 0) {
3103
- const h = /* @__PURE__ */ c(pt, { resumeSearch: s, children: /* @__PURE__ */ c(dt, { caseSearch: a, children: /* @__PURE__ */ c(mt, { interactive: o, children: r }) }) });
3104
- return l ? /* @__PURE__ */ c(_e, { children: h }) : h;
3248
+ ), g.length === 0) {
3249
+ const p = /* @__PURE__ */ c(St, { onUploadingChange: l, children: /* @__PURE__ */ c(gt, { resumeSearch: s, children: /* @__PURE__ */ c(ht, { caseSearch: a, children: /* @__PURE__ */ c(pt, { interactive: o, children: r }) }) }) });
3250
+ return u ? /* @__PURE__ */ c(Fe, { children: p }) : p;
3105
3251
  }
3106
- const k = /* @__PURE__ */ c(pt, { resumeSearch: s, children: /* @__PURE__ */ c(dt, { caseSearch: a, children: /* @__PURE__ */ c(mt, { interactive: o, children: /* @__PURE__ */ c("div", { className: "a2ui-surface a2ui-container", children: S.map((h) => /* @__PURE__ */ c(sn, { surface: h }, h.id)) }) }) }) });
3107
- return l ? /* @__PURE__ */ c(_e, { children: k }) : k;
3252
+ const v = /* @__PURE__ */ c(St, { onUploadingChange: l, children: /* @__PURE__ */ c(gt, { resumeSearch: s, children: /* @__PURE__ */ c(ht, { caseSearch: a, children: /* @__PURE__ */ c(pt, { interactive: o, children: /* @__PURE__ */ c("div", { className: "a2ui-surface a2ui-container", children: g.map((p) => /* @__PURE__ */ c(dn, { surface: p }, p.id)) }) }) }) }) });
3253
+ return u ? /* @__PURE__ */ c(Fe, { children: v }) : v;
3108
3254
  }
3109
3255
  );
3110
- function Pe() {
3111
- return new an([jn()]);
3256
+ function Oe() {
3257
+ return new fn([Gn()]);
3112
3258
  }
3113
- function js({
3259
+ function ta({
3114
3260
  messages: e,
3115
3261
  surfaceId: t = "skopon-form-stream",
3116
3262
  emptyHint: n = null,
@@ -3118,94 +3264,94 @@ function js({
3118
3264
  resumeSearch: o = null,
3119
3265
  caseSearch: i = null
3120
3266
  }) {
3121
- B(() => {
3122
- cn(), ln();
3267
+ z(() => {
3268
+ hn(), pn();
3123
3269
  }, []);
3124
- const s = A(null);
3125
- s.current === null && (s.current = Pe());
3126
- const a = A(0), l = A(""), u = A(!0), m = A(t);
3127
- function d(h, p) {
3128
- s.current = h, a.current = p.length, l.current = JSON.stringify(p), u.current && (S(h), k(Array.from(h.model.surfacesMap.values())));
3270
+ const s = x(null);
3271
+ s.current === null && (s.current = Oe());
3272
+ const a = x(0), l = x(""), u = x(!0), m = x(t);
3273
+ function d(v, p) {
3274
+ s.current = v, a.current = p.length, l.current = JSON.stringify(p), u.current && (T(v), C(Array.from(v.model.surfacesMap.values())));
3129
3275
  }
3130
- function b(h, p) {
3276
+ function k(v, p) {
3131
3277
  if (p <= 0) return !1;
3132
- const v = JSON.stringify(h.slice(0, p)), M = l.current;
3133
- if (!M) return !0;
3278
+ const S = JSON.stringify(v.slice(0, p)), N = l.current;
3279
+ if (!N) return !0;
3134
3280
  try {
3135
- const N = JSON.parse(M);
3136
- return JSON.stringify(N.slice(0, p)) !== v;
3281
+ const O = JSON.parse(N);
3282
+ return JSON.stringify(O.slice(0, p)) !== S;
3137
3283
  } catch {
3138
3284
  return !0;
3139
3285
  }
3140
3286
  }
3141
- const [y, S] = E(
3287
+ const [y, T] = w(
3142
3288
  () => s.current
3143
- ), [g, k] = E(
3289
+ ), [g, C] = w(
3144
3290
  () => Array.from(
3145
3291
  s.current.model.surfacesMap.values()
3146
3292
  )
3147
3293
  );
3148
- return B(() => (u.current = !0, () => {
3294
+ return z(() => (u.current = !0, () => {
3149
3295
  u.current = !1;
3150
- }), []), B(() => {
3296
+ }), []), z(() => {
3151
3297
  s.current = y;
3152
- }, [y]), B(() => {
3153
- const h = () => {
3154
- u.current && k(Array.from(y.model.surfacesMap.values()));
3155
- }, p = y.onSurfaceCreated(h), v = y.onSurfaceDeleted(h);
3298
+ }, [y]), z(() => {
3299
+ const v = () => {
3300
+ u.current && C(Array.from(y.model.surfacesMap.values()));
3301
+ }, p = y.onSurfaceCreated(v), S = y.onSurfaceDeleted(v);
3156
3302
  return () => {
3157
- p.unsubscribe(), v.unsubscribe();
3303
+ p.unsubscribe(), S.unsubscribe();
3158
3304
  };
3159
- }, [y]), B(() => {
3160
- let h = !1;
3305
+ }, [y]), z(() => {
3306
+ let v = !1;
3161
3307
  const p = m.current !== t;
3162
3308
  if (m.current = t, p) {
3163
- const _ = Pe();
3164
- return Array.isArray(e) && e.length > 0 ? (_.processMessages(e), h || d(_, e)) : (s.current = _, a.current = 0, l.current = "", h || (S(_), k([]))), () => {
3165
- h = !0;
3309
+ const F = Oe();
3310
+ return Array.isArray(e) && e.length > 0 ? (F.processMessages(e), v || d(F, e)) : (s.current = F, a.current = 0, l.current = "", v || (T(F), C([]))), () => {
3311
+ v = !0;
3166
3312
  };
3167
3313
  }
3168
3314
  if (!Array.isArray(e) || e.length === 0) {
3169
3315
  if (a.current > 0) {
3170
- const _ = Pe();
3171
- s.current = _, a.current = 0, l.current = "", h || (S(_), k([]));
3316
+ const F = Oe();
3317
+ s.current = F, a.current = 0, l.current = "", v || (T(F), C([]));
3172
3318
  }
3173
3319
  return () => {
3174
- h = !0;
3320
+ v = !0;
3175
3321
  };
3176
3322
  }
3177
- const v = s.current, M = a.current;
3178
- if (e.length < M || b(e, M)) {
3179
- const _ = Pe();
3180
- return _.processMessages(e), h || d(_, e), () => {
3181
- h = !0;
3323
+ const S = s.current, N = a.current;
3324
+ if (e.length < N || k(e, N)) {
3325
+ const F = Oe();
3326
+ return F.processMessages(e), v || d(F, e), () => {
3327
+ v = !0;
3182
3328
  };
3183
3329
  }
3184
- const N = e.slice(M);
3185
- return N.length === 0 ? () => {
3186
- h = !0;
3187
- } : (v.processMessages(N), a.current = e.length, l.current = JSON.stringify(e), h || k(Array.from(v.model.surfacesMap.values())), () => {
3188
- h = !0;
3330
+ const O = e.slice(N);
3331
+ return O.length === 0 ? () => {
3332
+ v = !0;
3333
+ } : (S.processMessages(O), a.current = e.length, l.current = JSON.stringify(e), v || C(Array.from(S.model.surfacesMap.values())), () => {
3334
+ v = !0;
3189
3335
  });
3190
- }, [e, t]), g.length === 0 ? /* @__PURE__ */ c(_e, { children: n }) : /* @__PURE__ */ c(_e, { children: /* @__PURE__ */ c(pt, { resumeSearch: o, children: /* @__PURE__ */ c(dt, { caseSearch: i, children: /* @__PURE__ */ c(mt, { interactive: r, children: /* @__PURE__ */ c("div", { className: "a2ui-surface a2ui-container", children: g.map((h) => /* @__PURE__ */ c(sn, { surface: h }, h.id)) }) }) }) }) });
3336
+ }, [e, t]), g.length === 0 ? /* @__PURE__ */ c(Fe, { children: n }) : /* @__PURE__ */ c(Fe, { children: /* @__PURE__ */ c(St, { children: /* @__PURE__ */ c(gt, { resumeSearch: o, children: /* @__PURE__ */ c(ht, { caseSearch: i, children: /* @__PURE__ */ c(pt, { interactive: r, children: /* @__PURE__ */ c("div", { className: "a2ui-surface a2ui-container", children: g.map((v) => /* @__PURE__ */ c(dn, { surface: v }, v.id)) }) }) }) }) }) });
3191
3337
  }
3192
- const is = 100, ss = 3e4, as = 1500, he = /* @__PURE__ */ new Map();
3193
- function ls(e) {
3338
+ const vs = 100, bs = 3e4, Ss = 1500, ye = /* @__PURE__ */ new Map();
3339
+ function ks(e) {
3194
3340
  const t = e.trim();
3195
- let n = he.get(t);
3196
- return n || (n = new cs(t), he.set(t, n)), n.acquire(), n;
3341
+ let n = ye.get(t);
3342
+ return n || (n = new Cs(t), ye.set(t, n)), n.acquire(), n;
3197
3343
  }
3198
- class cs {
3344
+ class Cs {
3199
3345
  constructor(t) {
3200
- G(this, "url");
3201
- G(this, "ws", null);
3202
- G(this, "refCount", 0);
3203
- G(this, "connectRequested", !1);
3204
- G(this, "reconnectAttempt", 0);
3205
- G(this, "reconnectTimer", null);
3206
- G(this, "releaseTimer", null);
3207
- G(this, "sendQueue", []);
3208
- G(this, "handlers", /* @__PURE__ */ new Map());
3346
+ X(this, "url");
3347
+ X(this, "ws", null);
3348
+ X(this, "refCount", 0);
3349
+ X(this, "connectRequested", !1);
3350
+ X(this, "reconnectAttempt", 0);
3351
+ X(this, "reconnectTimer", null);
3352
+ X(this, "releaseTimer", null);
3353
+ X(this, "sendQueue", []);
3354
+ X(this, "handlers", /* @__PURE__ */ new Map());
3209
3355
  this.url = t;
3210
3356
  }
3211
3357
  acquire() {
@@ -3213,12 +3359,12 @@ class cs {
3213
3359
  }
3214
3360
  release() {
3215
3361
  this.refCount = Math.max(0, this.refCount - 1), !(this.refCount > 0) && (this.clearReleaseTimer(), this.releaseTimer = setTimeout(() => {
3216
- this.releaseTimer = null, !(this.refCount > 0) && (this.teardown(), he.get(this.url) === this && he.delete(this.url));
3217
- }, as));
3362
+ this.releaseTimer = null, !(this.refCount > 0) && (this.teardown(), ye.get(this.url) === this && ye.delete(this.url));
3363
+ }, Ss));
3218
3364
  }
3219
3365
  /** 强制关闭(测试用),跳过宽限期。 */
3220
3366
  forceClose() {
3221
- this.refCount = 0, this.teardown(), he.get(this.url) === this && he.delete(this.url);
3367
+ this.refCount = 0, this.teardown(), ye.get(this.url) === this && ye.delete(this.url);
3222
3368
  }
3223
3369
  subscribe(t, n) {
3224
3370
  const r = t.trim();
@@ -3287,7 +3433,7 @@ class cs {
3287
3433
  }
3288
3434
  }
3289
3435
  enqueue(t) {
3290
- for (this.sendQueue.push(t); this.sendQueue.length > is; )
3436
+ for (this.sendQueue.push(t); this.sendQueue.length > vs; )
3291
3437
  this.sendQueue.shift();
3292
3438
  }
3293
3439
  flushQueue() {
@@ -3301,7 +3447,7 @@ class cs {
3301
3447
  if (!this.connectRequested || this.refCount <= 0) return;
3302
3448
  this.clearReconnectTimer();
3303
3449
  const t = Math.min(
3304
- ss,
3450
+ bs,
3305
3451
  1e3 * 2 ** Math.min(this.reconnectAttempt, 5)
3306
3452
  );
3307
3453
  this.reconnectAttempt += 1, this.reconnectTimer = setTimeout(() => {
@@ -3339,13 +3485,13 @@ class cs {
3339
3485
  }
3340
3486
  }
3341
3487
  }
3342
- class us {
3488
+ class As {
3343
3489
  constructor(t) {
3344
- G(this, "askUserMessageId");
3345
- G(this, "connection");
3346
- G(this, "unsubscribe");
3347
- G(this, "closed", !1);
3348
- this.askUserMessageId = t.askUserMessageId.trim(), this.connection = ls(t.url);
3490
+ X(this, "askUserMessageId");
3491
+ X(this, "connection");
3492
+ X(this, "unsubscribe");
3493
+ X(this, "closed", !1);
3494
+ this.askUserMessageId = t.askUserMessageId.trim(), this.connection = ks(t.url);
3349
3495
  const n = t.onAutoControl;
3350
3496
  this.unsubscribe = n ? this.connection.subscribe(this.askUserMessageId, n) : () => {
3351
3497
  };
@@ -3360,24 +3506,24 @@ class us {
3360
3506
  this.closed || (this.closed = !0, this.unsubscribe(), this.connection.release());
3361
3507
  }
3362
3508
  }
3363
- function $n(e) {
3509
+ function Jn(e) {
3364
3510
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
3365
3511
  }
3366
- function ms(e, t) {
3512
+ function _s(e, t) {
3367
3513
  if (!e) return !1;
3368
- const n = e.querySelector(`[data-skopon-field="${$n(t)}"]`);
3514
+ const n = e.querySelector(`[data-skopon-field="${Jn(t)}"]`);
3369
3515
  return n instanceof HTMLElement ? ((n.querySelector(
3370
3516
  'input, textarea, select, button, [tabindex]:not([tabindex="-1"])'
3371
3517
  ) ?? n).focus(), !0) : !1;
3372
3518
  }
3373
- function ds(e, t) {
3519
+ function Ts(e, t) {
3374
3520
  if (!e) return !1;
3375
- const n = e.querySelector(`[data-skopon-field="${$n(t)}"]`);
3521
+ const n = e.querySelector(`[data-skopon-field="${Jn(t)}"]`);
3376
3522
  return n instanceof HTMLElement ? ((n.querySelector(
3377
3523
  'button, [role="button"], .skopon-resume-select-card, input, label'
3378
3524
  ) ?? n).click(), !0) : !1;
3379
3525
  }
3380
- function ps(e, t, n) {
3526
+ function xs(e, t, n) {
3381
3527
  const r = e.action;
3382
3528
  if (r !== "change" && r !== "select" && r !== "focus" && r !== "click" && r !== "submit") {
3383
3529
  console.warn("[FormAutoControl] unknown action", r);
@@ -3407,47 +3553,47 @@ function ps(e, t, n) {
3407
3553
  return;
3408
3554
  }
3409
3555
  if (r === "focus") {
3410
- ms(t.rootElement, o), n.reportEvent({
3556
+ _s(t.rootElement, o), n.reportEvent({
3411
3557
  action: "focus",
3412
3558
  component: i,
3413
3559
  field: o
3414
3560
  });
3415
3561
  return;
3416
3562
  }
3417
- ds(t.rootElement, o) || console.warn("[FormAutoControl] click target not found", o);
3563
+ Ts(t.rootElement, o) || console.warn("[FormAutoControl] click target not found", o);
3418
3564
  });
3419
3565
  }
3420
- function fs(e) {
3566
+ function Ms(e) {
3421
3567
  const t = {};
3422
3568
  for (const [n, r] of Object.entries(e))
3423
3569
  r !== void 0 && (t[n] = r);
3424
3570
  return t;
3425
3571
  }
3426
- function hs(e, t) {
3572
+ function Fs(e, t) {
3427
3573
  var o;
3428
3574
  const n = (o = e.name) == null ? void 0 : o.trim();
3429
3575
  if (!n || !t) return { ...e };
3430
3576
  const r = t.get(n);
3431
3577
  return r ? e.type !== "resume_multiselect" && e.type !== "case_multiselect" ? { ...e } : { ...e, options: r.map((i) => ({ ...i })) } : { ...e };
3432
3578
  }
3433
- function gs(e) {
3579
+ function Ns(e) {
3434
3580
  var i, s;
3435
3581
  const n = {
3436
3582
  blocks: (e.blocks ?? []).map(
3437
- (a) => hs(a, e.liveOptions)
3583
+ (a) => Fs(a, e.liveOptions)
3438
3584
  )
3439
3585
  }, r = (i = e.title) == null ? void 0 : i.trim(), o = (s = e.description) == null ? void 0 : s.trim();
3440
3586
  return r && (n.title = r), o && (n.description = o), {
3441
3587
  form_schema: n,
3442
- form_values: fs(e.values ?? {}),
3588
+ form_values: Ms(e.values ?? {}),
3443
3589
  form_change: [...e.formChange ?? []]
3444
3590
  };
3445
3591
  }
3446
- function ys(e) {
3447
- const t = $e(e);
3448
- return t ? Le(t.blocks) : e && typeof e == "object" && !Array.isArray(e) ? e : {};
3592
+ function Is(e) {
3593
+ const t = He(e);
3594
+ return t ? je(t.blocks) : e && typeof e == "object" && !Array.isArray(e) ? e : {};
3449
3595
  }
3450
- function vs({
3596
+ function Es({
3451
3597
  payload: e,
3452
3598
  callbackUrl: t,
3453
3599
  title: n,
@@ -3457,70 +3603,70 @@ function vs({
3457
3603
  submitHeaders: s,
3458
3604
  onNotify: a
3459
3605
  }) {
3460
- const [l, u] = E(!1), m = A(!0);
3461
- B(() => (m.current = !0, () => {
3606
+ const [l, u] = w(!1), m = x(!0);
3607
+ z(() => (m.current = !0, () => {
3462
3608
  m.current = !1;
3463
3609
  }), []);
3464
- const d = V(
3465
- () => Ft(s),
3610
+ const d = $(
3611
+ () => Ut(s),
3466
3612
  [s]
3467
- ), b = V(
3468
- () => Un(e, t, d),
3613
+ ), k = $(
3614
+ () => On(e, t, d),
3469
3615
  [e, t, d]
3470
- ), y = V(
3616
+ ), y = $(
3471
3617
  () => ({
3472
3618
  ...i,
3473
3619
  callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? t ?? null
3474
3620
  }),
3475
3621
  [i, t]
3476
3622
  );
3477
- async function S() {
3623
+ async function T() {
3478
3624
  if (!l) {
3479
3625
  u(!0);
3480
3626
  try {
3481
- const g = ys(e), k = Et({
3627
+ const g = Is(e), C = Pt({
3482
3628
  context: y,
3483
3629
  payload: e,
3484
3630
  answer: g
3485
- }), h = await On(k, {
3631
+ }), v = await Vn(C, {
3486
3632
  headers: d
3487
3633
  });
3488
3634
  if (!m.current) return;
3489
- const p = zn(h);
3635
+ const p = Ln(v);
3490
3636
  a == null || a(p.type, p.message);
3491
3637
  } catch (g) {
3492
3638
  if (!m.current) return;
3493
- const k = g instanceof Error ? g.message : "提交失败";
3494
- a == null || a("error", k);
3639
+ const C = g instanceof Error ? g.message : "提交失败";
3640
+ a == null || a("error", C);
3495
3641
  } finally {
3496
3642
  m.current && u(!1);
3497
3643
  }
3498
3644
  }
3499
3645
  }
3500
- return /* @__PURE__ */ x("div", { className: "ask-user-curl-card", children: [
3501
- /* @__PURE__ */ x("div", { className: "ask-user-curl-card-header", children: [
3502
- /* @__PURE__ */ x("div", { className: "ask-user-curl-card-header-title", children: [
3503
- /* @__PURE__ */ c(ee.Text, { type: "secondary", children: n ?? "curl 命令" }),
3504
- r ? /* @__PURE__ */ c(ge, { title: r, children: /* @__PURE__ */ c(be, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
3505
- o ? /* @__PURE__ */ c(ge, { title: o, children: /* @__PURE__ */ c(be, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
3646
+ return /* @__PURE__ */ U("div", { className: "ask-user-curl-card", children: [
3647
+ /* @__PURE__ */ U("div", { className: "ask-user-curl-card-header", children: [
3648
+ /* @__PURE__ */ U("div", { className: "ask-user-curl-card-header-title", children: [
3649
+ /* @__PURE__ */ c(re.Text, { type: "secondary", children: n ?? "curl 命令" }),
3650
+ r ? /* @__PURE__ */ c(ve, { title: r, children: /* @__PURE__ */ c(Ae, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
3651
+ o ? /* @__PURE__ */ c(ve, { title: o, children: /* @__PURE__ */ c(Ae, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
3506
3652
  ] }),
3507
- /* @__PURE__ */ c(ge, { title: "提交到 answer_agent_callback_url", children: /* @__PURE__ */ c(
3508
- Me,
3653
+ /* @__PURE__ */ c(ve, { title: "提交到 answer_agent_callback_url", children: /* @__PURE__ */ c(
3654
+ Ne,
3509
3655
  {
3510
3656
  size: "small",
3511
3657
  type: "text",
3512
3658
  loading: l,
3513
3659
  disabled: l,
3514
- onClick: () => void S(),
3660
+ onClick: () => void T(),
3515
3661
  children: "提交"
3516
3662
  }
3517
3663
  ) })
3518
3664
  ] }),
3519
- /* @__PURE__ */ c("pre", { className: "skopon-form-curl-json", children: b })
3665
+ /* @__PURE__ */ c("pre", { className: "skopon-form-curl-json", children: k })
3520
3666
  ] });
3521
3667
  }
3522
- const bs = 80;
3523
- function Ss(e, t) {
3668
+ const Us = 80;
3669
+ function ws(e, t) {
3524
3670
  if (t && typeof t == "object" && t !== null && "message" in t) {
3525
3671
  const n = t.message;
3526
3672
  if (typeof n == "string" && n.trim())
@@ -3528,7 +3674,7 @@ function Ss(e, t) {
3528
3674
  }
3529
3675
  return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
3530
3676
  }
3531
- function ks({
3677
+ function Rs({
3532
3678
  payload: e,
3533
3679
  formUniqueId: t,
3534
3680
  askUserMessageId: n,
@@ -3541,260 +3687,266 @@ function ks({
3541
3687
  resumeSearch: u = null,
3542
3688
  caseSearch: m = null,
3543
3689
  onSurfaceReadyChange: d,
3544
- onAutoControlReady: b
3690
+ onAutoControlReady: k
3545
3691
  }) {
3546
- const [y, S] = E(null), [g, k] = E(!1), [h, p] = E(!0), [v, M] = E(!1), N = A(null), _ = A(null), z = A(!0), C = A(l);
3547
- C.current = l;
3548
- const q = bn(), L = St(), re = A(""), K = A(null), $ = (t == null ? void 0 : t.trim()) ?? "", Y = (n == null ? void 0 : n.trim()) ?? "", te = V(
3549
- () => Ft(s),
3692
+ const [y, T] = w(null), [g, C] = w(!1), [v, p] = w(!0), [S, N] = w(!1), [O, F] = w(!1), j = x(null), H = x(null), I = x(!0), A = x(l);
3693
+ A.current = l;
3694
+ const Y = Tn(), G = _t(), W = x(""), q = x(null), D = (t == null ? void 0 : t.trim()) ?? "", ie = (n == null ? void 0 : n.trim()) ?? "", oe = $(
3695
+ () => Ut(s),
3550
3696
  [s]
3551
- ), ne = V(
3697
+ ), _ = $(
3552
3698
  () => ({
3553
3699
  ...i,
3554
3700
  callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? r ?? null
3555
3701
  }),
3556
3702
  [i, r]
3557
3703
  );
3558
- B(() => (z.current = !0, () => {
3559
- z.current = !1, K.current != null && (clearTimeout(K.current), K.current = null);
3560
- }), []), B(() => {
3561
- let F = !1;
3562
- return $ ? (p(!0), k(!1), a({ formUniqueId: $ }).then((O) => {
3563
- F || (k(!!O.disabled), S(O.formDefinition ?? null));
3564
- }).catch((O) => {
3565
- var W;
3566
- if (!F) {
3567
- k(!1), S(null);
3568
- const Re = O instanceof Error ? O.message : "获取表单定义失败";
3569
- (W = C.current) == null || W.call(C, "error", Re);
3704
+ z(() => (I.current = !0, () => {
3705
+ I.current = !1, q.current != null && (clearTimeout(q.current), q.current = null);
3706
+ }), []), z(() => {
3707
+ let P = !1;
3708
+ return D ? (p(!0), C(!1), a({ formUniqueId: D }).then((V) => {
3709
+ P || (C(!!V.disabled), T(V.formDefinition ?? null));
3710
+ }).catch((V) => {
3711
+ var Q;
3712
+ if (!P) {
3713
+ C(!1), T(null);
3714
+ const Pe = V instanceof Error ? V.message : "获取表单定义失败";
3715
+ (Q = A.current) == null || Q.call(A, "error", Pe);
3570
3716
  }
3571
3717
  }).finally(() => {
3572
- F || p(!1);
3718
+ P || p(!1);
3573
3719
  }), () => {
3574
- F = !0;
3575
- }) : (p(!1), k(!1), S(null), () => {
3576
- F = !0;
3720
+ P = !0;
3721
+ }) : (p(!1), C(!1), T(null), () => {
3722
+ P = !0;
3577
3723
  });
3578
- }, [$, a]);
3579
- const U = V(() => $e(e), [e]), P = V(() => U ? oi(U, y ?? void 0) : null, [U, y]), T = (P == null ? void 0 : P.matchedBlocks) ?? [], D = !!(U && ii(U) && T.length === 0), R = V(() => D && U ? si(U) : P && P.renderBlocks.length > 0 ? P.renderBlocks : [], [P, D, U]), I = V(() => {
3580
- if (D && U)
3581
- return ai(U);
3582
- const F = Le((P == null ? void 0 : P.extraBlocks) ?? []);
3583
- return { ...Le(
3584
- ((P == null ? void 0 : P.matchedBlocks) ?? []).filter(
3585
- (W) => W.type === "text" && W.hidden === !0
3724
+ }, [D, a]);
3725
+ const h = $(() => He(e), [e]), b = $(() => h ? mi(h, y ?? void 0) : null, [h, y]), R = (b == null ? void 0 : b.matchedBlocks) ?? [], M = !!(h && di(h) && R.length === 0), E = $(() => M && h ? fi(h) : b && b.renderBlocks.length > 0 ? b.renderBlocks : [], [b, M, h]), J = $(() => {
3726
+ if (M && h)
3727
+ return pi(h);
3728
+ const P = je((b == null ? void 0 : b.extraBlocks) ?? []);
3729
+ return { ...je(
3730
+ ((b == null ? void 0 : b.matchedBlocks) ?? []).filter(
3731
+ (Q) => Q.type === "text" && Q.hidden === !0
3586
3732
  )
3587
- ), ...F };
3588
- }, [D, U, P]), X = V(
3589
- () => R.filter((F) => {
3590
- var O;
3591
- return Z(F.type) && ((O = F.name) == null ? void 0 : O.trim());
3592
- }).map((F) => F.name.trim()),
3593
- [R]
3594
- ), me = (P == null ? void 0 : P.title) ?? (U == null ? void 0 : U.title) ?? "", de = (P == null ? void 0 : P.description) ?? (U == null ? void 0 : U.description) ?? "", pe = V(() => R.length === 0 ? null : Xo(
3595
- { title: me, description: de },
3596
- R
3597
- ), [me, de, R]), Ke = V(() => {
3598
- if (!pe) return "";
3733
+ ), ...P };
3734
+ }, [M, h, b]), te = $(
3735
+ () => E.filter((P) => {
3736
+ var V;
3737
+ return ee(P.type) && ((V = P.name) == null ? void 0 : V.trim());
3738
+ }).map((P) => P.name.trim()),
3739
+ [E]
3740
+ ), se = (b == null ? void 0 : b.title) ?? (h == null ? void 0 : h.title) ?? "", pe = (b == null ? void 0 : b.description) ?? (h == null ? void 0 : h.description) ?? "", he = $(() => E.length === 0 ? null : oi(
3741
+ { title: se, description: pe },
3742
+ E
3743
+ ), [se, pe, E]), Je = $(() => {
3744
+ if (!he) return "";
3599
3745
  try {
3600
- return JSON.stringify(pe);
3746
+ return JSON.stringify(he);
3601
3747
  } catch {
3602
- return String(pe);
3603
- }
3604
- }, [pe]), We = $ ? `ask-user-${$}` : "ask-user-payload", oe = !!(!h && U && R.length > 0 && pe);
3605
- B(() => (d(oe), () => d(!1)), [oe, d]);
3606
- const Rt = j(() => {
3607
- var O;
3608
- return { ...((O = N.current) == null ? void 0 : O.getValues(X)) ?? {}, ...I };
3609
- }, [X, I]), wt = A(L.liveOptions);
3610
- wt.current = L.liveOptions;
3611
- const Ge = A(L.pendingChangeFields);
3612
- Ge.current = L.pendingChangeFields;
3613
- const ye = j(
3614
- (F) => {
3615
- const O = gs({
3616
- title: me,
3617
- description: de,
3618
- blocks: R,
3619
- values: Rt(),
3620
- liveOptions: wt.current,
3621
- formChange: F
3748
+ return String(he);
3749
+ }
3750
+ }, [he]), Ye = D ? `ask-user-${D}` : "ask-user-payload", ae = !!(!v && h && E.length > 0 && he);
3751
+ z(() => (d(ae), () => d(!1)), [ae, d]);
3752
+ const Ot = L(() => {
3753
+ var V;
3754
+ return { ...((V = j.current) == null ? void 0 : V.getValues(te)) ?? {}, ...J };
3755
+ }, [te, J]), Bt = x(G.liveOptions);
3756
+ Bt.current = G.liveOptions;
3757
+ const Qe = x(G.pendingChangeFields);
3758
+ Qe.current = G.pendingChangeFields;
3759
+ const ke = L(
3760
+ (P) => {
3761
+ const V = Ns({
3762
+ title: se,
3763
+ description: pe,
3764
+ blocks: E,
3765
+ values: Ot(),
3766
+ liveOptions: Bt.current,
3767
+ formChange: P
3622
3768
  });
3623
- q.reportData(O);
3769
+ Y.reportData(V);
3624
3770
  },
3625
- [me, de, R, Rt, q]
3626
- ), Je = A(ye);
3627
- Je.current = ye, B(() => {
3628
- if (!oe) {
3629
- re.current = "";
3771
+ [se, pe, E, Ot, Y]
3772
+ ), Xe = x(ke);
3773
+ Xe.current = ke, z(() => {
3774
+ if (!ae) {
3775
+ W.current = "";
3630
3776
  return;
3631
3777
  }
3632
- if (!Ke) return;
3633
- const F = `${We}::${Ke}`;
3634
- if (re.current === F) return;
3635
- const O = setTimeout(() => {
3636
- z.current && re.current !== F && (re.current = F, Je.current([]));
3778
+ if (!Je) return;
3779
+ const P = `${Ye}::${Je}`;
3780
+ if (W.current === P) return;
3781
+ const V = setTimeout(() => {
3782
+ I.current && W.current !== P && (W.current = P, Xe.current([]));
3637
3783
  }, 0);
3638
- return () => clearTimeout(O);
3639
- }, [oe, We, Ke]), B(() => {
3640
- if (!(!oe || L.version === 0) && Ge.current.length !== 0)
3641
- return K.current != null && clearTimeout(K.current), K.current = setTimeout(() => {
3642
- if (K.current = null, !z.current) return;
3643
- const F = [...Ge.current];
3644
- L.clearPendingChangeFields(), F.length !== 0 && Je.current(F);
3645
- }, bs), () => {
3646
- K.current != null && (clearTimeout(K.current), K.current = null);
3784
+ return () => clearTimeout(V);
3785
+ }, [ae, Ye, Je]), z(() => {
3786
+ if (!(!ae || G.version === 0) && Qe.current.length !== 0)
3787
+ return q.current != null && clearTimeout(q.current), q.current = setTimeout(() => {
3788
+ if (q.current = null, !I.current) return;
3789
+ const P = [...Qe.current];
3790
+ G.clearPendingChangeFields(), P.length !== 0 && Xe.current(P);
3791
+ }, Us), () => {
3792
+ q.current != null && (clearTimeout(q.current), q.current = null);
3647
3793
  };
3648
- }, [oe, L.version, L.clearPendingChangeFields]);
3649
- const Ye = j(async () => {
3650
- var F, O, W, Re, Ot, Bt, qt, Lt;
3651
- if (!v) {
3652
- M(!0);
3794
+ }, [ae, G.version, G.clearPendingChangeFields]);
3795
+ const Ze = L(async () => {
3796
+ var P, V, Q, Pe, Vt, jt, $t, Dt, Ht;
3797
+ if (!S) {
3798
+ if (O) {
3799
+ (P = A.current) == null || P.call(A, "error", "文件正在上传,请稍候");
3800
+ return;
3801
+ }
3802
+ N(!0);
3653
3803
  try {
3654
- const ve = { ...((F = N.current) == null ? void 0 : F.getValues(X)) ?? {}, ...I }, Vt = Ii(R, ve);
3655
- if (Vt) {
3656
- (O = C.current) == null || O.call(C, "error", Vt.message);
3804
+ const Ce = { ...((V = j.current) == null ? void 0 : V.getValues(te)) ?? {}, ...J }, Kt = Oi(E, Ce);
3805
+ if (Kt) {
3806
+ (Q = A.current) == null || Q.call(A, "error", Kt.message);
3657
3807
  return;
3658
3808
  }
3659
3809
  if (o === "post") {
3660
- const Ht = (r ?? "").trim();
3661
- if (!Ht) {
3662
- (W = C.current) == null || W.call(C, "error", "callback_url 为空,无法提交");
3810
+ const Yt = (r ?? "").trim();
3811
+ if (!Yt) {
3812
+ (Pe = A.current) == null || Pe.call(A, "error", "callback_url 为空,无法提交");
3663
3813
  return;
3664
3814
  }
3665
- ye([]), q.reportEvent({
3815
+ ke([]), Y.reportEvent({
3666
3816
  action: "submit",
3667
3817
  component: "SubmitButton"
3668
3818
  });
3669
- const Qe = await Rn(Ht, ve, {
3670
- headers: te
3819
+ const tt = await Bn(Yt, Ce, {
3820
+ headers: oe
3671
3821
  });
3672
- if (!z.current) return;
3673
- Qe.ok ? (Re = C.current) == null || Re.call(C, "success", "提交成功") : (Ot = C.current) == null || Ot.call(C, "error", Ss(Qe.status, Qe.body));
3822
+ if (!I.current) return;
3823
+ tt.ok ? (Vt = A.current) == null || Vt.call(A, "success", "提交成功") : (jt = A.current) == null || jt.call(A, "error", ws(tt.status, tt.body));
3674
3824
  return;
3675
3825
  }
3676
- const Dn = R.length > 0 ? {
3677
- title: me,
3678
- description: de,
3679
- blocks: R
3680
- } : U ?? void 0, jt = Et({
3681
- context: ne,
3826
+ const Yn = E.length > 0 ? {
3827
+ title: se,
3828
+ description: pe,
3829
+ blocks: E
3830
+ } : h ?? void 0, Wt = Pt({
3831
+ context: _,
3682
3832
  payload: e,
3683
- form: Dn,
3684
- answer: ve
3685
- }), $t = Ut(jt);
3686
- if ($t) {
3687
- (Bt = C.current) == null || Bt.call(C, "error", $t);
3833
+ form: Yn,
3834
+ answer: Ce
3835
+ }), Gt = zt(Wt);
3836
+ if (Gt) {
3837
+ ($t = A.current) == null || $t.call(A, "error", Gt);
3688
3838
  return;
3689
3839
  }
3690
- ye([]), q.reportEvent({
3840
+ ke([]), Y.reportEvent({
3691
3841
  action: "submit",
3692
3842
  component: "SubmitButton"
3693
3843
  });
3694
- const Hn = await On(jt, {
3695
- headers: te
3844
+ const Qn = await Vn(Wt, {
3845
+ headers: oe
3696
3846
  });
3697
- if (!z.current) return;
3698
- const Dt = zn(Hn);
3699
- (qt = C.current) == null || qt.call(C, Dt.type, Dt.message);
3700
- } catch (Xe) {
3701
- if (!z.current) return;
3702
- const ve = Xe instanceof Error ? Xe.message : "提交失败";
3703
- (Lt = C.current) == null || Lt.call(C, "error", ve);
3847
+ if (!I.current) return;
3848
+ const Jt = Ln(Qn);
3849
+ (Dt = A.current) == null || Dt.call(A, Jt.type, Jt.message);
3850
+ } catch (et) {
3851
+ if (!I.current) return;
3852
+ const Ce = et instanceof Error ? et.message : "提交失败";
3853
+ (Ht = A.current) == null || Ht.call(A, "error", Ce);
3704
3854
  } finally {
3705
- z.current && M(!1);
3855
+ I.current && N(!1);
3706
3856
  }
3707
3857
  }
3708
3858
  }, [
3709
- v,
3710
- X,
3711
- R,
3712
- me,
3713
- de,
3714
- I,
3715
- ye,
3716
- q,
3859
+ S,
3860
+ O,
3861
+ te,
3862
+ E,
3863
+ se,
3864
+ pe,
3865
+ J,
3866
+ ke,
3867
+ Y,
3717
3868
  o,
3718
3869
  r,
3719
- te,
3720
- ne,
3870
+ oe,
3871
+ _,
3721
3872
  e,
3722
- U
3723
- ]), Pt = A(Ye);
3724
- Pt.current = Ye;
3725
- const zt = j(
3726
- (F) => {
3727
- ps(
3728
- F,
3873
+ h
3874
+ ]), qt = x(Ze);
3875
+ qt.current = Ze;
3876
+ const Lt = L(
3877
+ (P) => {
3878
+ xs(
3879
+ P,
3729
3880
  {
3730
- setValues: (O) => {
3731
- var W;
3732
- return (W = N.current) == null ? void 0 : W.setValues(O);
3881
+ setValues: (V) => {
3882
+ var Q;
3883
+ return (Q = j.current) == null ? void 0 : Q.setValues(V);
3733
3884
  },
3734
- getValues: (O) => {
3735
- var W;
3736
- return ((W = N.current) == null ? void 0 : W.getValues(O)) ?? {};
3885
+ getValues: (V) => {
3886
+ var Q;
3887
+ return ((Q = j.current) == null ? void 0 : Q.getValues(V)) ?? {};
3737
3888
  },
3738
- submit: () => Pt.current(),
3739
- rootElement: _.current
3889
+ submit: () => qt.current(),
3890
+ rootElement: H.current
3740
3891
  },
3741
3892
  {
3742
- reportEvent: q.reportEvent,
3743
- runAutoControl: q.runAutoControl
3893
+ reportEvent: Y.reportEvent,
3894
+ runAutoControl: Y.runAutoControl
3744
3895
  }
3745
3896
  );
3746
3897
  },
3747
- [q]
3898
+ [Y]
3748
3899
  );
3749
- return B(() => {
3750
- if (!oe) {
3751
- b(null);
3900
+ return z(() => {
3901
+ if (!ae) {
3902
+ k(null);
3752
3903
  return;
3753
3904
  }
3754
- return b(zt), () => b(null);
3755
- }, [oe, zt, b]), h ? /* @__PURE__ */ c("div", { className: "ask-user-form-card", children: /* @__PURE__ */ c(yt, { size: "small" }) }) : !U || R.length === 0 ? /* @__PURE__ */ c(
3756
- vs,
3905
+ return k(Lt), () => k(null);
3906
+ }, [ae, Lt, k]), v ? /* @__PURE__ */ c("div", { className: "ask-user-form-card", children: /* @__PURE__ */ c(kt, { size: "small" }) }) : !h || E.length === 0 ? /* @__PURE__ */ c(
3907
+ Es,
3757
3908
  {
3758
3909
  payload: e,
3759
3910
  callbackUrl: r,
3760
- answerAgentContext: ne,
3911
+ answerAgentContext: _,
3761
3912
  submitHeaders: s,
3762
- unpublishedFormId: g && $ ? $ : void 0,
3913
+ unpublishedFormId: g && D ? D : void 0,
3763
3914
  onNotify: l
3764
3915
  }
3765
- ) : /* @__PURE__ */ x(
3916
+ ) : /* @__PURE__ */ U(
3766
3917
  "div",
3767
3918
  {
3768
3919
  className: "ask-user-form-card",
3769
- ref: _,
3770
- "data-ask-user-message-id": Y || void 0,
3920
+ ref: H,
3921
+ "data-ask-user-message-id": ie || void 0,
3771
3922
  children: [
3772
- g && $ ? /* @__PURE__ */ c("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ c(ge, { title: $, children: /* @__PURE__ */ c(be, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
3923
+ g && D ? /* @__PURE__ */ c("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ c(ve, { title: D, children: /* @__PURE__ */ c(Ae, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
3773
3924
  /* @__PURE__ */ c(
3774
- os,
3925
+ ys,
3775
3926
  {
3776
- ref: N,
3777
- doc: pe,
3778
- surfaceId: We,
3779
- fieldNames: X,
3927
+ ref: j,
3928
+ doc: he,
3929
+ surfaceId: Ye,
3930
+ fieldNames: te,
3780
3931
  interactive: !0,
3781
3932
  wrapProvider: !1,
3782
3933
  resumeSearch: u,
3783
- caseSearch: m
3934
+ caseSearch: m,
3935
+ onUploadingChange: F
3784
3936
  }
3785
3937
  ),
3786
3938
  /* @__PURE__ */ c("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ c(
3787
- ge,
3939
+ ve,
3788
3940
  {
3789
3941
  title: o === "post" ? "提交 JSON 到 callback_url" : "提交到 answer_agent_callback_url",
3790
3942
  children: /* @__PURE__ */ c(
3791
- Me,
3943
+ Ne,
3792
3944
  {
3793
3945
  type: "primary",
3794
3946
  size: "small",
3795
- loading: v,
3796
- disabled: v,
3797
- onClick: () => void Ye(),
3947
+ loading: S,
3948
+ disabled: S || O,
3949
+ onClick: () => void Ze(),
3798
3950
  children: "提交"
3799
3951
  }
3800
3952
  )
@@ -3804,16 +3956,16 @@ function ks({
3804
3956
  }
3805
3957
  );
3806
3958
  }
3807
- function $s(e) {
3959
+ function na(e) {
3808
3960
  var u;
3809
- const t = ((u = e.askUserMessageId) == null ? void 0 : u.trim()) ?? "", n = V(() => gi(), []), [r, o] = E(!1), i = A(null), s = j((m) => {
3961
+ const t = ((u = e.askUserMessageId) == null ? void 0 : u.trim()) ?? "", n = $(() => Ai(), []), [r, o] = w(!1), i = x(null), s = L((m) => {
3810
3962
  o(m);
3811
- }, []), a = j(
3963
+ }, []), a = L(
3812
3964
  (m) => {
3813
3965
  i.current = m;
3814
3966
  },
3815
3967
  []
3816
- ), l = V(() => !n || !t ? null : new us({
3968
+ ), l = $(() => !n || !t ? null : new As({
3817
3969
  url: n,
3818
3970
  askUserMessageId: t,
3819
3971
  onAutoControl: (m) => {
@@ -3821,15 +3973,15 @@ function $s(e) {
3821
3973
  (d = i.current) == null || d.call(i, m);
3822
3974
  }
3823
3975
  }), [n, t]);
3824
- return B(() => {
3976
+ return z(() => {
3825
3977
  if (l)
3826
3978
  return () => {
3827
3979
  l.close();
3828
3980
  };
3829
- }, [l]), B(() => {
3981
+ }, [l]), z(() => {
3830
3982
  !l || !r || l.connect();
3831
- }, [l, r]), /* @__PURE__ */ c(_e, { children: /* @__PURE__ */ c(oo, { client: l, children: /* @__PURE__ */ c(eo, { children: /* @__PURE__ */ c(
3832
- ks,
3983
+ }, [l, r]), /* @__PURE__ */ c(Fe, { children: /* @__PURE__ */ c(uo, { client: l, children: /* @__PURE__ */ c(so, { children: /* @__PURE__ */ c(
3984
+ Rs,
3833
3985
  {
3834
3986
  ...e,
3835
3987
  onSurfaceReadyChange: s,
@@ -3838,77 +3990,77 @@ function $s(e) {
3838
3990
  ) }) }) });
3839
3991
  }
3840
3992
  export {
3841
- Rs as A2UI_PROTOCOL_VERSION,
3842
- $s as AskUserFormCard,
3843
- dt as CaseSearchProvider,
3844
- vs as CurlSubmitBlock,
3845
- pi as DEFAULT_ANSWER_AGENT_CALLBACK_URL,
3846
- mi as DEFAULT_AUTH_ANSWER_AGENT_CALLBACK_URL_FIELD,
3847
- di as DEFAULT_AUTH_REALTIME_WS_URL_FIELD,
3848
- xt as DEFAULT_AUTH_STORAGE_KEY,
3849
- ui as DEFAULT_AUTH_TOKEN_FIELD,
3850
- fr as FORM_MEDIA_SIZES,
3851
- ut as FORM_WEB_DEFAULT_HEIGHT,
3852
- gr as FORM_WEB_MAX_HEIGHT,
3853
- hr as FORM_WEB_MIN_HEIGHT,
3854
- pt as ResumeSearchProvider,
3855
- js as SkoponA2uiStreamRenderer,
3856
- _e as SkoponFormProvider,
3857
- os as SkoponFormRenderer,
3858
- Go as a2uiToBlocks,
3859
- Mn as blocksToA2ui,
3860
- Gr as blocksToJsonSchema,
3861
- Et as buildAnswerAgentBody,
3862
- li as buildAskUserCurlBodyJson,
3863
- ci as buildAskUserCurlStatement,
3864
- Bs as buildAskUserSubmitCurlFromPayload,
3865
- Xo as buildAskUserSurface,
3866
- Un as buildCurlStatement,
3867
- Ee as coerceToggleValue,
3868
- qs as copyTextToClipboard,
3869
- Ni as createCaseSearchClient,
3870
- zs as createEmptyBlock,
3871
- Ps as createEmptyFormDefinition,
3872
- yi as createFormClient,
3873
- _i as createResumeSearchClient,
3874
- Vs as createSkoponSdkClients,
3875
- Le as extractExtraBlockValues,
3876
- Zo as extractSurfaceValues,
3877
- zn as formatAnswerAgentSubmitMessage,
3878
- ai as getPayloadHiddenBlockValues,
3879
- Os as getPayloadInputFieldNames,
3880
- si as getPayloadRenderableBlocks,
3881
- oi as intersectPayloadBlocksWithForm,
3882
- gt as isA2uiSurfaceEmpty,
3883
- mn as isDisplayBlockType,
3884
- Z as isInputBlockType,
3885
- un as isLayoutBlockType,
3886
- Se as isMediaBlockType,
3887
- dn as isOptionsBlockType,
3888
- yr as isSupportedWebUrl,
3889
- ke as isWebBlockType,
3890
- Qo as mapFormDefinitionFromDto,
3891
- Ve as normalizeFormDefinition,
3892
- fe as normalizeMultiselectCount,
3893
- Ne as normalizeWebHeight,
3894
- $e as parsePayloadBlocksJson,
3895
- ii as payloadHasInputBlocks,
3896
- hi as resolveAnswerAgentCallbackUrl,
3897
- It as resolveClientHeaders,
3898
- gi as resolveRealtimeWsUrl,
3899
- Kr as resolveSchemaDefaultValue,
3900
- wn as resolveSkoponAuthHeaders,
3901
- Ft as resolveSubmitAuthHeaders,
3902
- Yo as resolveSurfaceFromFormDefinition,
3903
- rs as skoponAntdTheme,
3904
- ie as skoponBrandColors,
3905
- On as submitAnswerAgent,
3906
- Rn as submitFormJson,
3907
- ws as supportsDefaultValue,
3908
- Jo as surfaceDocToMessages,
3909
- Ce as syncFormDefinition,
3910
- ao as useCaseSearch,
3911
- vo as useResumeSearch,
3912
- Ut as validateAnswerAgentBody,
3913
- Ls as validateAnswerAgentContext
3993
+ Ks as A2UI_PROTOCOL_VERSION,
3994
+ na as AskUserFormCard,
3995
+ ht as CaseSearchProvider,
3996
+ Es as CurlSubmitBlock,
3997
+ Si as DEFAULT_ANSWER_AGENT_CALLBACK_URL,
3998
+ vi as DEFAULT_AUTH_ANSWER_AGENT_CALLBACK_URL_FIELD,
3999
+ bi as DEFAULT_AUTH_REALTIME_WS_URL_FIELD,
4000
+ Nt as DEFAULT_AUTH_STORAGE_KEY,
4001
+ yi as DEFAULT_AUTH_TOKEN_FIELD,
4002
+ Sr as FORM_MEDIA_SIZES,
4003
+ ft as FORM_WEB_DEFAULT_HEIGHT,
4004
+ Cr as FORM_WEB_MAX_HEIGHT,
4005
+ kr as FORM_WEB_MIN_HEIGHT,
4006
+ gt as ResumeSearchProvider,
4007
+ ta as SkoponA2uiStreamRenderer,
4008
+ Fe as SkoponFormProvider,
4009
+ ys as SkoponFormRenderer,
4010
+ ti as a2uiToBlocks,
4011
+ Un as blocksToA2ui,
4012
+ eo as blocksToJsonSchema,
4013
+ Pt as buildAnswerAgentBody,
4014
+ hi as buildAskUserCurlBodyJson,
4015
+ gi as buildAskUserCurlStatement,
4016
+ Qs as buildAskUserSubmitCurlFromPayload,
4017
+ oi as buildAskUserSurface,
4018
+ On as buildCurlStatement,
4019
+ we as coerceToggleValue,
4020
+ Xs as copyTextToClipboard,
4021
+ Pi as createCaseSearchClient,
4022
+ Js as createEmptyBlock,
4023
+ Gs as createEmptyFormDefinition,
4024
+ _i as createFormClient,
4025
+ Ei as createResumeSearchClient,
4026
+ ea as createSkoponSdkClients,
4027
+ je as extractExtraBlockValues,
4028
+ si as extractSurfaceValues,
4029
+ Ln as formatAnswerAgentSubmitMessage,
4030
+ pi as getPayloadHiddenBlockValues,
4031
+ Ys as getPayloadInputFieldNames,
4032
+ fi as getPayloadRenderableBlocks,
4033
+ mi as intersectPayloadBlocksWithForm,
4034
+ bt as isA2uiSurfaceEmpty,
4035
+ yn as isDisplayBlockType,
4036
+ ee as isInputBlockType,
4037
+ gn as isLayoutBlockType,
4038
+ _e as isMediaBlockType,
4039
+ vn as isOptionsBlockType,
4040
+ Ar as isSupportedWebUrl,
4041
+ Te as isWebBlockType,
4042
+ ii as mapFormDefinitionFromDto,
4043
+ $e as normalizeFormDefinition,
4044
+ ge as normalizeMultiselectCount,
4045
+ Ie as normalizeWebHeight,
4046
+ He as parsePayloadBlocksJson,
4047
+ di as payloadHasInputBlocks,
4048
+ Ci as resolveAnswerAgentCallbackUrl,
4049
+ Rt as resolveClientHeaders,
4050
+ Ai as resolveRealtimeWsUrl,
4051
+ Xr as resolveSchemaDefaultValue,
4052
+ wt as resolveSkoponAuthHeaders,
4053
+ Ut as resolveSubmitAuthHeaders,
4054
+ ri as resolveSurfaceFromFormDefinition,
4055
+ gs as skoponAntdTheme,
4056
+ le as skoponBrandColors,
4057
+ Vn as submitAnswerAgent,
4058
+ Bn as submitFormJson,
4059
+ Ws as supportsDefaultValue,
4060
+ ni as surfaceDocToMessages,
4061
+ xe as syncFormDefinition,
4062
+ ho as useCaseSearch,
4063
+ To as useResumeSearch,
4064
+ zt as validateAnswerAgentBody,
4065
+ Zs as validateAnswerAgentContext
3914
4066
  };