@skopon-cool/form-sdk 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +96 -9
  2. package/dist/adapter/a2uiAdapter.d.ts +1 -0
  3. package/dist/adapter/a2uiAdapter.d.ts.map +1 -1
  4. package/dist/adapter/formSchema.d.ts +2 -1
  5. package/dist/adapter/formSchema.d.ts.map +1 -1
  6. package/dist/catalog/a2uiCustomCatalog.d.ts.map +1 -1
  7. package/dist/catalog/skoponCaseSelect.d.ts.map +1 -1
  8. package/dist/catalog/skoponResumeSelect.d.ts.map +1 -1
  9. package/dist/catalog/useSkoponBoundField.d.ts +2 -0
  10. package/dist/catalog/useSkoponBoundField.d.ts.map +1 -1
  11. package/dist/client/apiEnvelope.d.ts +7 -0
  12. package/dist/client/apiEnvelope.d.ts.map +1 -0
  13. package/dist/client/authStorage.d.ts +19 -0
  14. package/dist/client/authStorage.d.ts.map +1 -0
  15. package/dist/client/caseSearchClient.d.ts +11 -0
  16. package/dist/client/caseSearchClient.d.ts.map +1 -0
  17. package/dist/client/formClient.d.ts +2 -2
  18. package/dist/client/formClient.d.ts.map +1 -1
  19. package/dist/client/resumeSearchClient.d.ts +9 -0
  20. package/dist/client/resumeSearchClient.d.ts.map +1 -0
  21. package/dist/client/skoponSdkClients.d.ts +22 -0
  22. package/dist/client/skoponSdkClients.d.ts.map +1 -0
  23. package/dist/components/AskUserFormCard.d.ts.map +1 -1
  24. package/dist/components/SkoponFormRenderer.d.ts +2 -0
  25. package/dist/components/SkoponFormRenderer.d.ts.map +1 -1
  26. package/dist/form-sdk.css +1 -1
  27. package/dist/index.d.ts +4 -0
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +1097 -826
  30. package/dist/submit/validateFormSubmit.d.ts +10 -0
  31. package/dist/submit/validateFormSubmit.d.ts.map +1 -0
  32. package/package.json +1 -1
  33. package/src/adapter/a2uiAdapter.ts +3 -4
  34. package/src/adapter/formSchema.test.ts +29 -1
  35. package/src/adapter/formSchema.ts +12 -3
  36. package/src/adapter/resolveSurface.ts +3 -3
  37. package/src/catalog/a2uiCustomCatalog.tsx +49 -3
  38. package/src/catalog/skoponCaseSelect.tsx +2 -1
  39. package/src/catalog/skoponResumeSelect.tsx +1 -0
  40. package/src/catalog/skoponSelectLoading.test.tsx +182 -0
  41. package/src/catalog/textFieldPreview.test.tsx +31 -0
  42. package/src/catalog/useSkoponBoundField.test.ts +14 -1
  43. package/src/catalog/useSkoponBoundField.ts +14 -0
  44. package/src/client/apiEnvelope.ts +21 -0
  45. package/src/client/authStorage.test.ts +61 -0
  46. package/src/client/authStorage.ts +70 -0
  47. package/src/client/caseSearchClient.ts +107 -0
  48. package/src/client/formClient.test.ts +25 -0
  49. package/src/client/formClient.ts +7 -25
  50. package/src/client/resumeSearchClient.test.ts +87 -0
  51. package/src/client/resumeSearchClient.ts +108 -0
  52. package/src/client/skoponSdkClients.ts +51 -0
  53. package/src/components/AskUserFormCard.tsx +7 -0
  54. package/src/components/SkoponFormRenderer.tsx +18 -6
  55. package/src/index.ts +21 -0
  56. package/src/styles/index.css +3 -3
  57. package/src/submit/submit.test.ts +40 -0
  58. package/src/submit/validateFormSubmit.ts +111 -0
  59. package/dist/catalog/textFieldPreview.test.d.ts +0 -2
  60. package/dist/catalog/textFieldPreview.test.d.ts.map +0 -1
  61. package/dist/components/SkoponA2uiStreamRenderer.test.d.ts +0 -2
  62. package/dist/components/SkoponA2uiStreamRenderer.test.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -1,31 +1,31 @@
1
1
  import './form-sdk.css';
2
- import { jsx as l, jsxs as C } from "react/jsx-runtime";
3
- import { createContext as Be, useContext as Oe, useCallback as te, useSyncExternalStore as Mt, useMemo as O, useState as z, useRef as q, useEffect as L, forwardRef as It, useImperativeHandle as Ft } from "react";
4
- import { Spin as Ve, Button as ge, Typography as H, Avatar as Pt, Tag as re, Select as ze, Checkbox as zt, Radio as Ut, Switch as _t, TimePicker as Et, DatePicker as Rt, Upload as Ce, Input as ke, InputNumber as Bt, ConfigProvider as Ot, Tooltip as ne } from "antd";
5
- import { ReloadOutlined as Xe, FileTextOutlined as We, UserOutlined as Vt, FileImageOutlined as wt, FileExcelOutlined as qt, FileOutlined as Qe, PictureOutlined as Lt, SoundOutlined as jt, VideoCameraOutlined as $t } from "@ant-design/icons";
6
- import { createBinderlessComponentImplementation as V, basicCatalog as de, A2uiSurface as Ze } from "@a2ui/react/v0_9";
7
- import { z as m } from "zod";
8
- import { Catalog as Dt, MessageProcessor as et } from "@a2ui/web_core/v0_9";
9
- import { injectBasicCatalogStyles as tt } from "@a2ui/web_core/v0_9/basic_catalog";
10
- import { injectStyles as nt } from "@a2ui/react/styles";
11
- import De from "dayjs";
12
- const lo = "v0.9", Ht = [
2
+ import { jsx as l, jsxs as k } from "react/jsx-runtime";
3
+ import { createContext as Le, useContext as $e, useCallback as te, useSyncExternalStore as Bt, useMemo as q, useState as _, useRef as L, useEffect as R, forwardRef as wt, useImperativeHandle as qt } from "react";
4
+ import { Spin as De, Button as Se, Typography as D, Avatar as Ot, Tag as re, Select as Re, Checkbox as Vt, Radio as jt, Switch as Lt, TimePicker as $t, DatePicker as Dt, Upload as Te, Input as Ie, InputNumber as Ht, ConfigProvider as Kt, Tooltip as ne } from "antd";
5
+ import { ReloadOutlined as it, FileTextOutlined as at, UserOutlined as Gt, FileImageOutlined as Jt, FileExcelOutlined as Yt, FileOutlined as st, PictureOutlined as Xt, SoundOutlined as Wt, VideoCameraOutlined as Qt } from "@ant-design/icons";
6
+ import { createBinderlessComponentImplementation as V, basicCatalog as fe, A2uiSurface as lt } from "@a2ui/react/v0_9";
7
+ import { z as f } from "zod";
8
+ import { Catalog as Zt, MessageProcessor as ct } from "@a2ui/web_core/v0_9";
9
+ import { injectBasicCatalogStyles as ut } from "@a2ui/web_core/v0_9/basic_catalog";
10
+ import { injectStyles as pt } from "@a2ui/react/styles";
11
+ import Ze from "dayjs";
12
+ const Po = "v0.9", en = [
13
13
  "huge",
14
14
  "large",
15
15
  "medium",
16
16
  "small",
17
17
  "icon"
18
18
  ];
19
- function Ue(e) {
19
+ function he(e) {
20
20
  return e === "image" || e === "video" || e === "audio";
21
21
  }
22
- function we(e) {
22
+ function be(e) {
23
23
  return e === "heading" || e === "paragraph";
24
24
  }
25
25
  function W(e) {
26
- return !we(e) && !Ue(e);
26
+ return !be(e) && !he(e);
27
27
  }
28
- function Kt() {
28
+ function tn() {
29
29
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
30
30
  return crypto.randomUUID();
31
31
  if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
@@ -40,10 +40,10 @@ function Kt() {
40
40
  });
41
41
  }
42
42
  function ie(e) {
43
- const t = Kt().replace(/-/g, "").slice(0, 8);
43
+ const t = tn().replace(/-/g, "").slice(0, 8);
44
44
  return `${e}${t}`;
45
45
  }
46
- const rt = [
46
+ const mt = [
47
47
  { value: "image/*", label: "图片" },
48
48
  { value: "video/*", label: "视频" },
49
49
  { value: "audio/*", label: "音频" },
@@ -54,7 +54,7 @@ const rt = [
54
54
  { value: "text/plain", label: "纯文本" },
55
55
  { value: "application/zip", label: "ZIP 压缩包" },
56
56
  { value: "application/x-rar-compressed", label: "RAR 压缩包" }
57
- ], Gt = {
57
+ ], nn = {
58
58
  "image/*": ["image/*"],
59
59
  "video/*": ["video/*"],
60
60
  "audio/*": ["audio/*"],
@@ -74,7 +74,7 @@ const rt = [
74
74
  "text/plain": ["text/plain"],
75
75
  "application/zip": ["application/zip"],
76
76
  "application/x-rar-compressed": ["application/x-rar-compressed"]
77
- }, Jt = {
77
+ }, rn = {
78
78
  "image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
79
79
  "video/*": [".mp4", ".mov", ".avi", ".webm"],
80
80
  "audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
@@ -85,14 +85,14 @@ const rt = [
85
85
  "text/plain": [".txt"],
86
86
  "application/zip": [".zip", ".7z"],
87
87
  "application/x-rar-compressed": [".rar"]
88
- }, Yt = {
88
+ }, on = {
89
89
  "application/msword": "office/word",
90
90
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
91
91
  "application/vnd.ms-excel": "office/excel",
92
92
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
93
93
  "application/vnd.ms-powerpoint": "office/ppt",
94
94
  "application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
95
- }, qe = [
95
+ }, He = [
96
96
  { value: ".jpg", label: ".jpg" },
97
97
  { value: ".jpeg", label: ".jpeg" },
98
98
  { value: ".png", label: ".png" },
@@ -118,18 +118,18 @@ const rt = [
118
118
  { value: ".zip", label: ".zip" },
119
119
  { value: ".rar", label: ".rar" },
120
120
  { value: ".7z", label: ".7z" }
121
- ], Xt = Object.fromEntries(
122
- rt.map((e) => [e.value, e.label])
123
- ), Wt = Object.fromEntries(
124
- qe.map((e) => [e.value, e.label])
125
- ), Qt = new Set(rt.map((e) => e.value)), Zt = new Set(
126
- qe.map((e) => e.value)
121
+ ], an = Object.fromEntries(
122
+ mt.map((e) => [e.value, e.label])
123
+ ), sn = Object.fromEntries(
124
+ He.map((e) => [e.value, e.label])
125
+ ), ln = new Set(mt.map((e) => e.value)), cn = new Set(
126
+ He.map((e) => e.value)
127
127
  );
128
- function en(e) {
128
+ function un(e) {
129
129
  const t = e.trim();
130
- return t ? Qt.has(t) ? t : Yt[t] ?? null : null;
130
+ return t ? ln.has(t) ? t : on[t] ?? null : null;
131
131
  }
132
- function tn(e) {
132
+ function pn(e) {
133
133
  return Array.isArray(e) ? e.map((t) => {
134
134
  const n = t.trim().toLowerCase();
135
135
  return n ? n.startsWith(".") ? n : `.${n}` : "";
@@ -139,100 +139,103 @@ function ae(e) {
139
139
  if (!Array.isArray(e)) return [];
140
140
  const t = [], n = /* @__PURE__ */ new Set();
141
141
  for (const r of e) {
142
- const o = en(r);
142
+ const o = un(r);
143
143
  o && !n.has(o) && (n.add(o), t.push(o));
144
144
  }
145
145
  return t;
146
146
  }
147
- function nn(e) {
147
+ function mn(e) {
148
148
  const t = ae(e), n = [];
149
149
  for (const r of t)
150
- n.push(...Gt[r] ?? [r]);
150
+ n.push(...nn[r] ?? [r]);
151
151
  return n;
152
152
  }
153
- function rn(e) {
153
+ function dn(e) {
154
154
  const t = ae(e);
155
155
  if (t.length === 0) return [];
156
156
  const n = /* @__PURE__ */ new Set();
157
157
  for (const r of t)
158
- for (const o of Jt[r] ?? [])
158
+ for (const o of rn[r] ?? [])
159
159
  n.add(o);
160
- return qe.filter((r) => n.has(r.value));
160
+ return He.filter((r) => n.has(r.value));
161
161
  }
162
- function Le(e, t) {
163
- const n = tn(t), r = ae(e);
162
+ function Ke(e, t) {
163
+ const n = pn(t), r = ae(e);
164
164
  if (r.length === 0)
165
- return n.filter((i) => Zt.has(i));
165
+ return n.filter((i) => cn.has(i));
166
166
  const o = new Set(
167
- rn(r).map((i) => i.value)
167
+ dn(r).map((i) => i.value)
168
168
  );
169
169
  return n.filter((i) => o.has(i));
170
170
  }
171
- function on(e, t) {
172
- const n = nn(e), r = Le(e, t), o = [...n, ...r];
171
+ function fn(e, t) {
172
+ const n = mn(e), r = Ke(e, t), o = [...n, ...r];
173
173
  return o.length > 0 ? o.join(",") : void 0;
174
174
  }
175
- function an(e, t) {
176
- const n = ae(e), r = Le(
175
+ function hn(e, t) {
176
+ const n = ae(e), r = Ke(
177
177
  n,
178
178
  t
179
179
  ), o = [
180
- ...n.map((i) => Xt[i] ?? i),
181
- ...r.map((i) => Wt[i] ?? i)
180
+ ...n.map((i) => an[i] ?? i),
181
+ ...r.map((i) => sn[i] ?? i)
182
182
  ];
183
183
  return o.length === 0 ? null : o.join("、");
184
184
  }
185
- const ln = [
185
+ const gn = [
186
186
  "video",
187
187
  "audio",
188
188
  "image",
189
189
  "file",
190
190
  "spreadsheet",
191
191
  "document"
192
- ], sn = new Set(ln);
193
- function cn(e) {
194
- return e && sn.has(e) ? e : "file";
192
+ ], yn = new Set(gn);
193
+ function vn(e) {
194
+ return e && yn.has(e) ? e : "file";
195
195
  }
196
- function le(e) {
197
- return typeof e == "string" && Ht.includes(e) ? e : "medium";
196
+ function se(e) {
197
+ return typeof e == "string" && en.includes(e) ? e : "medium";
198
198
  }
199
- function un(e, t) {
199
+ function Sn(e, t) {
200
200
  var o;
201
201
  const n = Math.max(1, t);
202
202
  let r = [];
203
203
  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);
204
204
  }
205
- function pn(e) {
205
+ function bn(e) {
206
206
  var t;
207
207
  return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
208
208
  }
209
- function dn(e) {
210
- return `form-media-size-${le(e)}`;
209
+ function Cn(e) {
210
+ return `form-media-size-${se(e)}`;
211
211
  }
212
- function mn(e) {
213
- return `form-media-preview form-media-list ${dn(e)}`;
212
+ function xn(e) {
213
+ return `form-media-preview form-media-list ${Cn(e)}`;
214
214
  }
215
- const fn = 10;
216
- function je(e) {
217
- return e === !0 || e === "true";
215
+ const kn = 10;
216
+ function Ge(e) {
217
+ return e && typeof e == "object" && !Array.isArray(e) ? e : {};
218
+ }
219
+ function le(e) {
220
+ return e === !0 || e === "true" || e === 1 || e === "1";
218
221
  }
219
- function He(e, t = 1) {
222
+ function et(e, t = 1) {
220
223
  const n = typeof e == "number" ? e : Number(e);
221
224
  return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
222
225
  }
223
- function ce(e, t = 1) {
226
+ function pe(e, t = 1) {
224
227
  const n = typeof e == "number" ? e : Number(e);
225
228
  return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
226
229
  }
227
- function hn(e, t) {
230
+ function An(e, t) {
228
231
  if (t !== void 0)
229
- return e === "toggle" ? je(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
232
+ return e === "toggle" ? le(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
230
233
  }
231
- function gn(e) {
234
+ function Tn(e) {
232
235
  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, a = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, s = Array.isArray(e == null ? void 0 : e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
233
236
  return { agentKind: r, agentUniqueId: o, flowType: i, category: a, flowUniqueIds: s, pageSize: n };
234
237
  }
235
- function yn(e) {
238
+ function In(e) {
236
239
  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;
237
240
  return {
238
241
  names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
@@ -241,14 +244,14 @@ function yn(e) {
241
244
  pageSize: n
242
245
  };
243
246
  }
244
- function vn(e) {
247
+ function Nn(e) {
245
248
  if (e.type !== "case_singleselect") return e;
246
249
  const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
247
250
  return { ...e, type: "case_multiselect", defaultValue: t };
248
251
  }
249
- function bn(e) {
252
+ function Mn(e) {
250
253
  var o, i;
251
- const t = vn(e), n = ae(t.fileAcceptTypes), r = t.type;
254
+ const t = Nn(e), n = ae(t.fileAcceptTypes), r = t.type;
252
255
  return {
253
256
  id: ((o = t.id) == null ? void 0 : o.trim()) || ie("block-"),
254
257
  type: r,
@@ -257,17 +260,17 @@ function bn(e) {
257
260
  placeholder: t.placeholder ?? "",
258
261
  help: t.help ?? "",
259
262
  required: t.required === !0,
260
- mediaUrls: Ue(r) ? un(t, fn) : void 0,
261
- mediaSize: Ue(r) ? le(t.mediaSize) : void 0,
263
+ mediaUrls: he(r) ? Sn(t, kn) : void 0,
264
+ mediaSize: he(r) ? se(t.mediaSize) : void 0,
262
265
  fileAcceptTypes: n,
263
- fileAcceptExtensions: Le(
266
+ fileAcceptExtensions: Ke(
264
267
  n,
265
268
  t.fileAcceptExtensions
266
269
  ),
267
- filePlaceholderIcon: cn(t.filePlaceholderIcon),
268
- fileMinCount: r === "file" ? He(t.fileMinCount, 1) : void 0,
269
- fileMaxCount: r === "file" ? He(t.fileMaxCount, 1) : void 0,
270
- defaultValue: hn(r, t.defaultValue),
270
+ filePlaceholderIcon: vn(t.filePlaceholderIcon),
271
+ fileMinCount: r === "file" ? et(t.fileMinCount, 1) : void 0,
272
+ fileMaxCount: r === "file" ? et(t.fileMaxCount, 1) : void 0,
273
+ defaultValue: An(r, t.defaultValue),
271
274
  options: Array.isArray(t.options) ? t.options.map((a, s) => {
272
275
  var c, u;
273
276
  return {
@@ -276,16 +279,16 @@ function bn(e) {
276
279
  };
277
280
  }) : void 0,
278
281
  resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
279
- resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? ce(t.resumeMinCount, 1) : void 0,
280
- resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? ce(t.resumeMaxCount, 1) : void 0,
281
- resumeFilter: r === "resume_multiselect" ? yn(t.resumeFilter) : void 0,
282
+ resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? pe(t.resumeMinCount, 1) : void 0,
283
+ resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? pe(t.resumeMaxCount, 1) : void 0,
284
+ resumeFilter: r === "resume_multiselect" ? In(t.resumeFilter) : void 0,
282
285
  caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
283
- caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? ce(t.caseMinCount, 1) : void 0,
284
- caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? ce(t.caseMaxCount, 1) : void 0,
285
- caseFilter: r === "case_multiselect" ? gn(t.caseFilter) : void 0
286
+ caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? pe(t.caseMinCount, 1) : void 0,
287
+ caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? pe(t.caseMaxCount, 1) : void 0,
288
+ caseFilter: r === "case_multiselect" ? Tn(t.caseFilter) : void 0
286
289
  };
287
290
  }
288
- function me(e) {
291
+ function ge(e) {
289
292
  return {
290
293
  title: e.title ?? "",
291
294
  description: e.description ?? "",
@@ -293,18 +296,18 @@ function me(e) {
293
296
  jsonSchema: e.jsonSchema ?? {}
294
297
  };
295
298
  }
296
- function Z(e) {
299
+ function ee(e) {
297
300
  if (!e || !Array.isArray(e.blocks))
298
- return me({ title: "", description: "", blocks: [], jsonSchema: {} });
299
- const t = e.blocks.map(bn);
300
- return me({
301
+ return ge({ title: "", description: "", blocks: [], jsonSchema: {} });
302
+ const t = e.blocks.map(Mn);
303
+ return ge({
301
304
  title: typeof e.title == "string" ? e.title : "",
302
305
  description: typeof e.description == "string" ? e.description : "",
303
306
  blocks: t,
304
- jsonSchema: {}
307
+ jsonSchema: Ge(e.jsonSchema)
305
308
  });
306
309
  }
307
- function Sn(e) {
310
+ function Fn(e) {
308
311
  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, a = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
309
312
  return {
310
313
  agentKind: n,
@@ -315,14 +318,14 @@ function Sn(e) {
315
318
  pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
316
319
  };
317
320
  }
318
- function Ke(e) {
321
+ function tt(e) {
319
322
  if (e == null) return;
320
323
  const t = typeof e == "number" ? e : Number(e);
321
324
  if (!(!Number.isFinite(t) || t < 1))
322
325
  return Math.floor(t);
323
326
  }
324
- function xn(e, t) {
325
- var a, s, c, u, d, p;
327
+ function _n(e, t) {
328
+ var a, s, c, u, d, m;
326
329
  const { id: n, label: r, path: o, withData: i } = t;
327
330
  return i({
328
331
  id: n,
@@ -337,14 +340,14 @@ function xn(e, t) {
337
340
  flowType: (c = e.caseFilter) == null ? void 0 : c.flowType,
338
341
  category: (u = e.caseFilter) == null ? void 0 : u.category,
339
342
  flowUniqueIds: ((d = e.caseFilter) == null ? void 0 : d.flowUniqueIds) ?? [],
340
- pageSize: ((p = e.caseFilter) == null ? void 0 : p.pageSize) ?? 20
343
+ pageSize: ((m = e.caseFilter) == null ? void 0 : m.pageSize) ?? 20
341
344
  },
342
345
  ...e.caseMinCount !== void 0 ? { minCount: e.caseMinCount } : {},
343
346
  ...e.caseMaxCount !== void 0 ? { maxCount: e.caseMaxCount } : {},
344
347
  value: { path: o }
345
348
  });
346
349
  }
347
- function Cn(e, t, n) {
350
+ function Pn(e, t, n) {
348
351
  const r = n.nameFromValue(e.value), o = {
349
352
  ...t("case_multiselect"),
350
353
  name: r,
@@ -352,32 +355,32 @@ function Cn(e, t, n) {
352
355
  }, i = n.asLiteral(e.placeholder);
353
356
  i && (o.placeholder = i);
354
357
  const a = n.asLiteral(e.help);
355
- a && (o.help = a), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = Sn(e.caseFilter));
356
- const s = Ke(e.minCount);
358
+ a && (o.help = a), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = Fn(e.caseFilter));
359
+ const s = tt(e.minCount);
357
360
  s !== void 0 && (o.caseMinCount = s);
358
- const c = Ke(e.maxCount);
361
+ const c = tt(e.maxCount);
359
362
  return c !== void 0 && (o.caseMaxCount = c), o;
360
363
  }
361
- const ot = Be({ interactive: !0 });
362
- function it({
364
+ const dt = Le({ interactive: !0 });
365
+ function Be({
363
366
  interactive: e,
364
367
  children: t
365
368
  }) {
366
- return /* @__PURE__ */ l(ot.Provider, { value: { interactive: e }, children: t });
369
+ return /* @__PURE__ */ l(dt.Provider, { value: { interactive: e }, children: t });
367
370
  }
368
371
  function K() {
369
- return Oe(ot);
372
+ return $e(dt);
370
373
  }
371
- function at(e) {
374
+ function ft(e) {
372
375
  return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
373
376
  }
374
- function Ge(e, t = "value") {
377
+ function nt(e, t = "value") {
375
378
  const r = e.componentModel.properties[t];
376
- if (!(!at(r) || r === void 0))
379
+ if (!(!ft(r) || r === void 0))
377
380
  return e.dataContext.resolveDynamicValue(r);
378
381
  }
379
382
  function G(e, t = "value") {
380
- const r = e.componentModel.properties[t], o = at(r), i = te(
383
+ const r = e.componentModel.properties[t], o = ft(r), i = te(
381
384
  (u) => {
382
385
  if (!o || r === void 0) return () => {
383
386
  };
@@ -388,7 +391,7 @@ function G(e, t = "value") {
388
391
  ), a = te(() => {
389
392
  if (!(!o || r === void 0))
390
393
  return e.dataContext.resolveDynamicValue(r);
391
- }, [e, r, o]), s = Mt(i, a, a), c = te(
394
+ }, [e, r, o]), s = Bt(i, a, a), c = te(
392
395
  (u) => {
393
396
  !o || !r || typeof r != "object" || !("path" in r) || e.dataContext.set(String(r.path), u);
394
397
  },
@@ -400,77 +403,80 @@ function oe(e) {
400
403
  if (typeof e == "string") return e || void 0;
401
404
  if (typeof e == "number") return String(e);
402
405
  }
403
- function D(e) {
406
+ function O(e) {
404
407
  return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
405
408
  }
406
- function fe(e) {
409
+ function ht(e, t) {
410
+ return t ? Array.isArray(e) ? null : O(e) : Array.isArray(e) ? e.length > 0 ? String(e[0]) : "" : e == null || typeof e == "string" || typeof e == "number" ? null : "";
411
+ }
412
+ function ye(e) {
407
413
  if (e == null) return;
408
414
  const t = typeof e == "number" ? e : Number(e);
409
415
  if (!(!Number.isFinite(t) || t < 1))
410
416
  return Math.floor(t);
411
417
  }
412
- function lt(e, t, n, r) {
418
+ function gt(e, t, n, r) {
413
419
  if (e.includes(t)) {
414
420
  const i = e.filter((a) => a !== t);
415
421
  return n !== void 0 && i.length < n ? null : i;
416
422
  }
417
423
  return r !== void 0 && e.length >= r ? null : [...e, t];
418
424
  }
419
- function st(e, t, n, r, o) {
425
+ function yt(e, t, n, r, o) {
420
426
  if (!n) return !0;
421
427
  const i = e.includes(t);
422
428
  return !!(!i && o !== void 0 && e.length >= o || i && r !== void 0 && e.length <= r);
423
429
  }
424
- function ct(e, t) {
430
+ function vt(e, t) {
425
431
  return t === void 0 || e.length <= t ? null : e.slice(0, t);
426
432
  }
427
- const ut = Be(null);
428
- function pt({
433
+ const St = Le(null);
434
+ function we({
429
435
  caseSearch: e,
430
436
  children: t
431
437
  }) {
432
- return /* @__PURE__ */ l(ut.Provider, { value: e ?? null, children: t });
438
+ return /* @__PURE__ */ l(St.Provider, { value: e ?? null, children: t });
433
439
  }
434
- function kn() {
435
- return Oe(ut);
440
+ function Un() {
441
+ return $e(St);
436
442
  }
437
- function Ae(e) {
443
+ function Ne(e) {
438
444
  return typeof e == "string" ? e : "";
439
445
  }
440
- function Te(e) {
446
+ function Me(e) {
441
447
  if (!e || typeof e != "object")
442
448
  return { flowUniqueIds: [], pageSize: 20 };
443
449
  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, a = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, s = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, c = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
444
450
  return { agentKind: o, agentUniqueId: i, flowType: a, category: s, flowUniqueIds: c, pageSize: r };
445
451
  }
446
- function Ne(e) {
452
+ function Fe(e) {
447
453
  var r;
448
454
  const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
449
455
  return t || n;
450
456
  }
451
- function An(e) {
457
+ function zn(e) {
452
458
  return JSON.stringify(e);
453
459
  }
454
- const Tn = {
460
+ const En = {
455
461
  name: "SkoponCaseSelect",
456
- schema: m.object({
457
- label: m.any().optional(),
458
- placeholder: m.any().optional(),
459
- help: m.any().optional(),
460
- enableRefresh: m.any().optional(),
461
- caseFilter: m.any().optional(),
462
- minCount: m.any().optional(),
463
- maxCount: m.any().optional(),
464
- value: m.any().optional()
462
+ schema: f.object({
463
+ label: f.any().optional(),
464
+ placeholder: f.any().optional(),
465
+ help: f.any().optional(),
466
+ enableRefresh: f.any().optional(),
467
+ caseFilter: f.any().optional(),
468
+ minCount: f.any().optional(),
469
+ maxCount: f.any().optional(),
470
+ value: f.any().optional()
465
471
  }).passthrough()
466
472
  };
467
- function Nn({
473
+ function Rn({
468
474
  item: e,
469
475
  selected: t,
470
476
  disabled: n,
471
477
  onToggle: r
472
478
  }) {
473
- return /* @__PURE__ */ C(
479
+ return /* @__PURE__ */ k(
474
480
  "button",
475
481
  {
476
482
  type: "button",
@@ -478,11 +484,11 @@ function Nn({
478
484
  disabled: n,
479
485
  onClick: r,
480
486
  children: [
481
- /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ l(We, { style: { fontSize: 24, color: "var(--color-primary, #1677ff)" } }) }),
482
- /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
487
+ /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ l(at, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
488
+ /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-body", children: [
483
489
  /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-name", children: e.name }),
484
490
  e.description ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
485
- /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-meta", children: [
491
+ /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-meta", children: [
486
492
  e.caseUniqueId,
487
493
  e.platform ? ` · ${e.platform}` : "",
488
494
  e.link ? ` · ${e.link}` : ""
@@ -492,104 +498,104 @@ function Nn({
492
498
  }
493
499
  );
494
500
  }
495
- function Mn({ context: e }) {
496
- const { interactive: t } = K(), n = kn(), { value: r, setValue: o } = G(e), i = e.componentModel.properties, a = Ae(i.label), s = Ae(i.placeholder), c = Ae(i.help), u = i.enableRefresh !== !1, d = fe(i.minCount), p = fe(i.maxCount), g = O(() => Te(i.caseFilter), [i.caseFilter]), v = An(g), [M, T] = z(1), [k, f] = z(!1), [h, x] = z(""), [y, S] = z([]), [I, E] = z(0), [j, Q] = z(g.pageSize ?? 20), w = q(0), B = D(r);
497
- L(() => {
498
- const b = ct(B, p);
499
- b !== null && o(b);
500
- }, [p, B, o]);
501
- const J = O(() => n ? Ne(g) ? h || s || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, h, s]), Y = te(
502
- async (b) => {
503
- const F = Te(JSON.parse(v)), R = ++w.current;
504
- if (!n || !Ne(F)) {
505
- S([]), E(0), x("");
501
+ function Bn({ context: e }) {
502
+ const { interactive: t } = K(), n = Un(), { value: r, setValue: o } = G(e), i = e.componentModel.properties, a = Ne(i.label), s = Ne(i.placeholder), c = Ne(i.help), u = i.enableRefresh !== !1, d = ye(i.minCount), m = ye(i.maxCount), b = q(() => Me(i.caseFilter), [i.caseFilter]), g = zn(b), [A, N] = _(1), [v, p] = _(!1), [h, x] = _(""), [y, C] = _([]), [M, E] = _(0), [$, Q] = _(b.pageSize ?? 20), j = L(0), w = O(r);
503
+ R(() => {
504
+ const S = vt(w, m);
505
+ S !== null && o(S);
506
+ }, [m, w, o]);
507
+ const J = q(() => n ? Fe(b) ? h || s || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, b, h, s]), Y = te(
508
+ async (S) => {
509
+ const F = Me(JSON.parse(g)), B = ++j.current;
510
+ if (!n || !Fe(F)) {
511
+ C([]), E(0), x(""), p(!1);
506
512
  return;
507
513
  }
508
- f(!0), x("");
514
+ p(!0), x("");
509
515
  try {
510
- const N = await n({ filter: F, page: b });
511
- if (R !== w.current) return;
512
- S(N.list), E(N.total), T(N.page), Q(N.pageSize);
513
- } catch (N) {
514
- if (R !== w.current) return;
515
- S([]), E(0), x(N instanceof Error ? N.message : "加载案例列表失败");
516
+ const I = await n({ filter: F, page: S });
517
+ if (B !== j.current) return;
518
+ C(I.list), E(I.total), N(I.page), Q(I.pageSize);
519
+ } catch (I) {
520
+ if (B !== j.current) return;
521
+ C([]), E(0), x(I instanceof Error ? I.message : "加载案例列表失败");
516
522
  } finally {
517
- R === w.current && f(!1);
523
+ B === j.current && p(!1);
518
524
  }
519
525
  },
520
- [n, v]
526
+ [n, g]
521
527
  );
522
- L(() => {
523
- T(1), Y(1);
524
- }, [v, Y]);
525
- const P = (b) => {
528
+ R(() => {
529
+ N(1), Y(1);
530
+ }, [g, Y]);
531
+ const P = (S) => {
526
532
  if (!t) return;
527
- const F = lt(
528
- B,
529
- b,
533
+ const F = gt(
534
+ w,
535
+ S,
530
536
  d,
531
- p
537
+ m
532
538
  );
533
539
  F !== null && o(F);
534
540
  }, U = () => {
535
- const b = Te(JSON.parse(v)), F = j || b.pageSize || 20, R = Math.max(1, Math.ceil(I / F)), N = M >= R ? 1 : M + 1;
536
- Y(N);
541
+ const S = Me(JSON.parse(g)), F = $ || S.pageSize || 20, B = Math.max(1, Math.ceil(M / F)), I = A >= B ? 1 : A + 1;
542
+ Y(I);
537
543
  };
538
- return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
544
+ return /* @__PURE__ */ k("div", { className: "form-block-preview skopon-resume-select", children: [
539
545
  a ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: a }) : null,
540
- k && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
541
- /* @__PURE__ */ l(Ve, { size: "small" }),
546
+ v && y.length === 0 ? /* @__PURE__ */ k("div", { className: "skopon-resume-select-status", children: [
547
+ /* @__PURE__ */ l(De, { size: "small" }),
542
548
  " 加载案例…"
543
549
  ] }) : null,
544
- !k && y.length === 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-empty", children: J }) : null,
545
- y.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ l(
546
- Nn,
550
+ !v && y.length === 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-empty", children: J }) : null,
551
+ y.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-list", children: y.map((S) => /* @__PURE__ */ l(
552
+ Rn,
547
553
  {
548
- item: b,
549
- selected: B.includes(b.caseUniqueId),
550
- disabled: st(
551
- B,
552
- b.caseUniqueId,
554
+ item: S,
555
+ selected: w.includes(S.caseUniqueId),
556
+ disabled: yt(
557
+ w,
558
+ S.caseUniqueId,
553
559
  t,
554
560
  d,
555
- p
561
+ m
556
562
  ),
557
- onToggle: () => P(b.caseUniqueId)
563
+ onToggle: () => P(S.caseUniqueId)
558
564
  },
559
- b.caseUniqueId
565
+ S.caseUniqueId
560
566
  )) }) : null,
561
- u && n && Ne(g) ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ l(
562
- ge,
567
+ u && n && Fe(b) ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ l(
568
+ Se,
563
569
  {
564
570
  type: "default",
565
571
  size: "small",
566
- icon: /* @__PURE__ */ l(Xe, {}),
567
- loading: k,
572
+ icon: /* @__PURE__ */ l(it, {}),
573
+ loading: v,
568
574
  disabled: !t,
569
575
  onClick: U,
570
576
  children: "换一批"
571
577
  }
572
578
  ) }) : null,
573
- c ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
579
+ c ? /* @__PURE__ */ l(D.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
574
580
  ] });
575
581
  }
576
- const In = V(
577
- Tn,
578
- Mn
579
- ), Fn = {
582
+ const wn = V(
583
+ En,
584
+ Bn
585
+ ), qn = {
580
586
  type: "case_multiselect",
581
587
  componentName: "SkoponCaseSelect",
582
- toComponent: xn,
583
- fromComponent: Cn,
584
- catalogComponents: [In]
588
+ toComponent: _n,
589
+ fromComponent: Pn,
590
+ catalogComponents: [wn]
585
591
  };
586
- function Je(e) {
592
+ function rt(e) {
587
593
  if (e == null) return;
588
594
  const t = typeof e == "number" ? e : Number(e);
589
595
  if (!(!Number.isFinite(t) || t < 1))
590
596
  return Math.floor(t);
591
597
  }
592
- function Pn(e, t) {
598
+ function On(e, t) {
593
599
  var a, s, c, u;
594
600
  const { id: n, label: r, path: o, withData: i } = t;
595
601
  return i({
@@ -610,7 +616,7 @@ function Pn(e, t) {
610
616
  value: { path: o }
611
617
  });
612
618
  }
613
- function zn(e, t, n) {
619
+ function Vn(e, t, n) {
614
620
  const r = n.nameFromValue(e.value), o = {
615
621
  ...t("resume_multiselect"),
616
622
  name: r,
@@ -627,79 +633,79 @@ function zn(e, t, n) {
627
633
  pageSize: typeof u.pageSize == "number" ? u.pageSize : 20
628
634
  };
629
635
  }
630
- const s = Je(e.minCount);
636
+ const s = rt(e.minCount);
631
637
  s !== void 0 && (o.resumeMinCount = s);
632
- const c = Je(e.maxCount);
638
+ const c = rt(e.maxCount);
633
639
  return c !== void 0 && (o.resumeMaxCount = c), o;
634
640
  }
635
- const dt = Be(null);
636
- function mt({
641
+ const bt = Le(null);
642
+ function qe({
637
643
  resumeSearch: e,
638
644
  children: t
639
645
  }) {
640
- return /* @__PURE__ */ l(dt.Provider, { value: e ?? null, children: t });
646
+ return /* @__PURE__ */ l(bt.Provider, { value: e ?? null, children: t });
641
647
  }
642
- function Un() {
643
- return Oe(dt);
648
+ function jn() {
649
+ return $e(bt);
644
650
  }
645
- function Me(e) {
651
+ function _e(e) {
646
652
  return typeof e == "string" ? e : "";
647
653
  }
648
- function Ie(e) {
654
+ function Pe(e) {
649
655
  if (!e || typeof e != "object")
650
656
  return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
651
657
  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), a = Number.isFinite(i) && i >= 1 && i <= 100 ? Math.floor(i) : 20;
652
658
  return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: a };
653
659
  }
654
- function _n(e) {
660
+ function Ln(e) {
655
661
  return JSON.stringify(e);
656
662
  }
657
- const En = {
663
+ const $n = {
658
664
  name: "SkoponResumeSelect",
659
- schema: m.object({
660
- label: m.any().optional(),
661
- placeholder: m.any().optional(),
662
- help: m.any().optional(),
663
- enableRefresh: m.any().optional(),
664
- resumeFilter: m.any().optional(),
665
- minCount: m.any().optional(),
666
- maxCount: m.any().optional(),
667
- value: m.any().optional()
665
+ schema: f.object({
666
+ label: f.any().optional(),
667
+ placeholder: f.any().optional(),
668
+ help: f.any().optional(),
669
+ enableRefresh: f.any().optional(),
670
+ resumeFilter: f.any().optional(),
671
+ minCount: f.any().optional(),
672
+ maxCount: f.any().optional(),
673
+ value: f.any().optional()
668
674
  }).passthrough()
669
- }, Rn = 3, Bn = 2;
670
- function Fe(e, t) {
671
- const n = (t ?? []).filter(Boolean), r = n.slice(0, Rn), o = n.length - r.length;
672
- return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags", children: [
675
+ }, Dn = 3, Hn = 2;
676
+ function Ue(e, t) {
677
+ const n = (t ?? []).filter(Boolean), r = n.slice(0, Dn), o = n.length - r.length;
678
+ return /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-tags", children: [
673
679
  /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-tags-label", children: e }),
674
- n.length > 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags-list", children: [
680
+ n.length > 0 ? /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-tags-list", children: [
675
681
  r.map((i) => /* @__PURE__ */ l(re, { className: "skopon-resume-select-card-tag", children: i }, i)),
676
- o > 0 ? /* @__PURE__ */ C(re, { className: "skopon-resume-select-card-tag", children: [
682
+ o > 0 ? /* @__PURE__ */ k(re, { className: "skopon-resume-select-card-tag", children: [
677
683
  "+",
678
684
  o
679
685
  ] }) : null
680
686
  ] }) : /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
681
687
  ] });
682
688
  }
683
- function On(e) {
684
- return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-field", children: [
689
+ function Kn(e) {
690
+ return /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-field", children: [
685
691
  /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
686
692
  /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
687
693
  ] });
688
694
  }
689
- function Vn({ work: e }) {
690
- return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-work", children: [
691
- /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ l("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ l(wt, { className: "skopon-resume-select-card-work-placeholder" }) }),
695
+ function Gn({ work: e }) {
696
+ return /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-work", children: [
697
+ /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ l("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ l(Jt, { className: "skopon-resume-select-card-work-placeholder" }) }),
692
698
  /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
693
699
  ] });
694
700
  }
695
- function wn({
701
+ function Jn({
696
702
  item: e,
697
703
  selected: t,
698
704
  disabled: n,
699
705
  onToggle: r
700
706
  }) {
701
- const o = (e.works ?? []).slice(0, Bn);
702
- return /* @__PURE__ */ C(
707
+ const o = (e.works ?? []).slice(0, Hn);
708
+ return /* @__PURE__ */ k(
703
709
  "button",
704
710
  {
705
711
  type: "button",
@@ -708,168 +714,168 @@ function wn({
708
714
  onClick: r,
709
715
  children: [
710
716
  /* @__PURE__ */ l(
711
- Pt,
717
+ Ot,
712
718
  {
713
719
  size: 48,
714
720
  src: e.avatarUrl || void 0,
715
- icon: e.avatarUrl ? void 0 : /* @__PURE__ */ l(Vt, {}),
721
+ icon: e.avatarUrl ? void 0 : /* @__PURE__ */ l(Gt, {}),
716
722
  className: "skopon-resume-select-card-avatar"
717
723
  }
718
724
  ),
719
725
  /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
720
- /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
721
- On(e.satisfaction),
722
- Fe("性格", e.personality),
723
- Fe("专长", e.specialties),
724
- Fe("擅长领域", e.traits),
725
- /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-works", children: [
726
+ /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-body", children: [
727
+ Kn(e.satisfaction),
728
+ Ue("性格", e.personality),
729
+ Ue("专长", e.specialties),
730
+ Ue("擅长领域", e.traits),
731
+ /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-works", children: [
726
732
  /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
727
- o.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, a) => /* @__PURE__ */ l(Vn, { work: i }, `${i.title}-${a}`)) }) : /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
733
+ o.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, a) => /* @__PURE__ */ l(Gn, { work: i }, `${i.title}-${a}`)) }) : /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
728
734
  ] })
729
735
  ] })
730
736
  ]
731
737
  }
732
738
  );
733
739
  }
734
- function qn({ context: e }) {
735
- const { interactive: t } = K(), n = Un(), { value: r, setValue: o } = G(e), i = e.componentModel.properties, a = Me(i.label), s = Me(i.placeholder), c = Me(i.help), u = i.enableRefresh !== !1, d = fe(i.minCount), p = fe(i.maxCount), g = O(() => Ie(i.resumeFilter), [i.resumeFilter]), v = _n(g), [M, T] = z(1), [k, f] = z(!1), [h, x] = z(""), [y, S] = z([]), [I, E] = z(0), [j, Q] = z(g.pageSize ?? 20), w = q(0), B = D(r);
736
- L(() => {
737
- const b = ct(B, p);
738
- b !== null && o(b);
739
- }, [p, B, o]);
740
+ function Yn({ context: e }) {
741
+ const { interactive: t } = K(), n = jn(), { value: r, setValue: o } = G(e), i = e.componentModel.properties, a = _e(i.label), s = _e(i.placeholder), c = _e(i.help), u = i.enableRefresh !== !1, d = ye(i.minCount), m = ye(i.maxCount), b = q(() => Pe(i.resumeFilter), [i.resumeFilter]), g = Ln(b), [A, N] = _(1), [v, p] = _(!1), [h, x] = _(""), [y, C] = _([]), [M, E] = _(0), [$, Q] = _(b.pageSize ?? 20), j = L(0), w = O(r);
742
+ R(() => {
743
+ const S = vt(w, m);
744
+ S !== null && o(S);
745
+ }, [m, w, o]);
740
746
  const J = te(
741
- async (b) => {
742
- const F = Ie(JSON.parse(v)), R = ++w.current;
747
+ async (S) => {
748
+ const F = Pe(JSON.parse(g)), B = ++j.current;
743
749
  if (!n) {
744
- S([]), E(0), x("未配置简历搜索服务");
750
+ C([]), E(0), x("未配置简历搜索服务"), p(!1);
745
751
  return;
746
752
  }
747
- f(!0), x("");
753
+ p(!0), x("");
748
754
  try {
749
- const N = await n({ filter: F, page: b });
750
- if (R !== w.current) return;
751
- S(N.list), E(N.total), T(N.page), Q(N.pageSize);
752
- } catch (N) {
753
- if (R !== w.current) return;
754
- S([]), E(0), x(N instanceof Error ? N.message : "加载简历列表失败");
755
+ const I = await n({ filter: F, page: S });
756
+ if (B !== j.current) return;
757
+ C(I.list), E(I.total), N(I.page), Q(I.pageSize);
758
+ } catch (I) {
759
+ if (B !== j.current) return;
760
+ C([]), E(0), x(I instanceof Error ? I.message : "加载简历列表失败");
755
761
  } finally {
756
- R === w.current && f(!1);
762
+ B === j.current && p(!1);
757
763
  }
758
764
  },
759
- [n, v]
765
+ [n, g]
760
766
  );
761
- L(() => {
762
- T(1), J(1);
763
- }, [v, J]);
764
- const Y = (b) => {
767
+ R(() => {
768
+ N(1), J(1);
769
+ }, [g, J]);
770
+ const Y = (S) => {
765
771
  if (!t) return;
766
- const F = lt(
767
- B,
768
- b,
772
+ const F = gt(
773
+ w,
774
+ S,
769
775
  d,
770
- p
776
+ m
771
777
  );
772
778
  F !== null && o(F);
773
779
  }, P = () => {
774
- const b = Ie(JSON.parse(v)), F = j || b.pageSize || 20, R = Math.max(1, Math.ceil(I / F)), N = M >= R ? 1 : M + 1;
775
- J(N);
780
+ const S = Pe(JSON.parse(g)), F = $ || S.pageSize || 20, B = Math.max(1, Math.ceil(M / F)), I = A >= B ? 1 : A + 1;
781
+ J(I);
776
782
  }, U = s || "暂无匹配的简历";
777
- return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
783
+ return /* @__PURE__ */ k("div", { className: "form-block-preview skopon-resume-select", children: [
778
784
  a ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: a }) : null,
779
- k && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
780
- /* @__PURE__ */ l(Ve, { size: "small" }),
785
+ v && y.length === 0 ? /* @__PURE__ */ k("div", { className: "skopon-resume-select-status", children: [
786
+ /* @__PURE__ */ l(De, { size: "small" }),
781
787
  " 加载简历…"
782
788
  ] }) : null,
783
- !k && h ? /* @__PURE__ */ l(H.Text, { type: "danger", className: "skopon-resume-select-status", children: h }) : null,
784
- !k && !h && y.length === 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-empty", children: U }) : null,
785
- y.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ l(
786
- wn,
789
+ !v && h ? /* @__PURE__ */ l(D.Text, { type: "danger", className: "skopon-resume-select-status", children: h }) : null,
790
+ !v && !h && y.length === 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-empty", children: U }) : null,
791
+ y.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-list", children: y.map((S) => /* @__PURE__ */ l(
792
+ Jn,
787
793
  {
788
- item: b,
789
- selected: B.includes(b.resumeUniqueId),
790
- disabled: st(
791
- B,
792
- b.resumeUniqueId,
794
+ item: S,
795
+ selected: w.includes(S.resumeUniqueId),
796
+ disabled: yt(
797
+ w,
798
+ S.resumeUniqueId,
793
799
  t,
794
800
  d,
795
- p
801
+ m
796
802
  ),
797
- onToggle: () => Y(b.resumeUniqueId)
803
+ onToggle: () => Y(S.resumeUniqueId)
798
804
  },
799
- b.resumeUniqueId
805
+ S.resumeUniqueId
800
806
  )) }) : null,
801
807
  u && n ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ l(
802
- ge,
808
+ Se,
803
809
  {
804
810
  type: "default",
805
811
  size: "small",
806
- icon: /* @__PURE__ */ l(Xe, {}),
807
- loading: k,
812
+ icon: /* @__PURE__ */ l(it, {}),
813
+ loading: v,
808
814
  disabled: !t,
809
815
  onClick: P,
810
816
  children: "换一批"
811
817
  }
812
818
  ) }) : null,
813
- c ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
819
+ c ? /* @__PURE__ */ l(D.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
814
820
  ] });
815
821
  }
816
- const Ln = V(
817
- En,
818
- qn
819
- ), jn = {
822
+ const Xn = V(
823
+ $n,
824
+ Yn
825
+ ), Wn = {
820
826
  type: "resume_multiselect",
821
827
  componentName: "SkoponResumeSelect",
822
- toComponent: Pn,
823
- fromComponent: zn,
824
- catalogComponents: [Ln]
825
- }, ye = [jn, Fn], $n = new Map(
826
- ye.map((e) => [e.type, e])
827
- ), Dn = new Map(
828
- ye.map((e) => [e.componentName, e])
828
+ toComponent: On,
829
+ fromComponent: Vn,
830
+ catalogComponents: [Xn]
831
+ }, Ce = [Wn, qn], Qn = new Map(
832
+ Ce.map((e) => [e.type, e])
833
+ ), Zn = new Map(
834
+ Ce.map((e) => [e.componentName, e])
829
835
  );
830
- function Hn(e) {
831
- return $n.get(e);
836
+ function er(e) {
837
+ return Qn.get(e);
832
838
  }
833
- function Kn(e) {
834
- return Dn.get(e);
839
+ function tr(e) {
840
+ return Zn.get(e);
835
841
  }
836
- function Gn() {
837
- return ye.flatMap((e) => e.catalogComponents);
842
+ function nr() {
843
+ return Ce.flatMap((e) => e.catalogComponents);
838
844
  }
839
- function Jn() {
840
- return ye.map((e) => e.componentName);
845
+ function rr() {
846
+ return Ce.map((e) => e.componentName);
841
847
  }
842
- const he = "root", _e = "__title__", Ee = "__desc__", ft = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
843
- function Yn(e) {
848
+ const ve = "root", Oe = "__title__", Ve = "__desc__", Je = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
849
+ function or(e) {
844
850
  return `/${e}`;
845
851
  }
846
- function Ye(e) {
852
+ function ot(e) {
847
853
  return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
848
854
  }
849
- function _(e) {
855
+ function z(e) {
850
856
  if (typeof e == "string") return e;
851
857
  }
852
- function Xn(e) {
858
+ function ir(e) {
853
859
  const t = e.id || ie("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
854
860
  return {
855
861
  id: t,
856
862
  component: "SkoponMedia",
857
863
  mediaType: n,
858
- urls: pn(e),
859
- mediaSize: le(e.mediaSize),
864
+ urls: bn(e),
865
+ mediaSize: se(e.mediaSize),
860
866
  label: e.label ?? "",
861
867
  help: e.help ?? "",
862
868
  placeholder: e.placeholder ?? ""
863
869
  };
864
870
  }
865
- function Wn(e) {
871
+ function ar(e) {
866
872
  if (Array.isArray(e.urls))
867
873
  return e.urls.map((n) => String(n).trim()).filter(Boolean);
868
- const t = _(e.url);
874
+ const t = z(e.url);
869
875
  return t != null && t.trim() ? [t.trim()] : [];
870
876
  }
871
- function ue(e, t, n) {
872
- const r = typeof e.id == "string" ? e.id : ie("block-"), o = Wn(e), i = _(e.label) ?? _(e.description) ?? n, a = _(e.help), s = _(e.placeholder), c = le(e.mediaSize);
877
+ function me(e, t, n) {
878
+ const r = typeof e.id == "string" ? e.id : ie("block-"), o = ar(e), i = z(e.label) ?? z(e.description) ?? n, a = z(e.help), s = z(e.placeholder), c = se(e.mediaSize);
873
879
  return {
874
880
  id: r,
875
881
  type: t,
@@ -880,10 +886,10 @@ function ue(e, t, n) {
880
886
  mediaUrls: o.length > 0 ? o : [""]
881
887
  };
882
888
  }
883
- function Qn(e) {
889
+ function sr(e) {
884
890
  switch (e.type) {
885
891
  case "toggle":
886
- return je(e.defaultValue);
892
+ return le(e.defaultValue);
887
893
  case "multiselect":
888
894
  case "checkbox":
889
895
  case "resume_multiselect":
@@ -897,9 +903,9 @@ function Qn(e) {
897
903
  return typeof e.defaultValue == "string" ? e.defaultValue : "";
898
904
  }
899
905
  }
900
- function Zn(e) {
906
+ function lr(e) {
901
907
  var u;
902
- const t = e.id || ie("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? Yn(r) : void 0, i = (e.options ?? []).map((d) => ({ label: d.label, value: d.value })), a = (d) => r ? { node: d, dataKey: r, dataValue: Qn(e) } : { node: d }, s = { id: t, label: n, name: r, path: o, withData: a }, c = Hn(e.type);
908
+ const t = e.id || ie("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? or(r) : void 0, i = (e.options ?? []).map((d) => ({ label: d.label, value: d.value })), a = (d) => r ? { node: d, dataKey: r, dataValue: sr(e) } : { node: d }, s = { id: t, label: n, name: r, path: o, withData: a }, c = er(e.type);
903
909
  if (c)
904
910
  return c.toComponent(e, s);
905
911
  switch (e.type) {
@@ -924,7 +930,7 @@ function Zn(e) {
924
930
  component: "TextField",
925
931
  label: n,
926
932
  variant: "shortText",
927
- validationRegexp: ft,
933
+ validationRegexp: Je,
928
934
  ...e.placeholder ? { placeholder: e.placeholder } : {},
929
935
  value: { path: o }
930
936
  });
@@ -1010,7 +1016,7 @@ function Zn(e) {
1010
1016
  case "image":
1011
1017
  case "video":
1012
1018
  case "audio":
1013
- return { node: Xn(e) };
1019
+ return { node: ir(e) };
1014
1020
  case "file":
1015
1021
  return a({
1016
1022
  id: t,
@@ -1027,31 +1033,31 @@ function Zn(e) {
1027
1033
  return { node: null };
1028
1034
  }
1029
1035
  }
1030
- function Re(e) {
1036
+ function je(e) {
1031
1037
  if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
1032
- const t = e.components.find((r) => r.id === he);
1038
+ const t = e.components.find((r) => r.id === ve);
1033
1039
  if (!t) return e.components.length === 0;
1034
1040
  const n = t.children;
1035
1041
  return !Array.isArray(n) || n.length === 0;
1036
1042
  }
1037
- function ht(e, t) {
1043
+ function Ct(e, t) {
1038
1044
  const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, a = (e.title ?? "").trim(), s = (e.description ?? "").trim();
1039
- i && a && (n.push({ id: _e, component: "Text", text: a, variant: "h2" }), r.push(_e)), i && s && (n.push({ id: Ee, component: "Text", text: s, variant: "body" }), r.push(Ee));
1045
+ i && a && (n.push({ id: Oe, component: "Text", text: a, variant: "h2" }), r.push(Oe)), i && s && (n.push({ id: Ve, component: "Text", text: s, variant: "body" }), r.push(Ve));
1040
1046
  for (const d of e.blocks ?? []) {
1041
- const { node: p, dataKey: g, dataValue: v } = Zn(d);
1042
- p && (n.push(p), r.push(p.id), g && (o[g] = v));
1047
+ const { node: m, dataKey: b, dataValue: g } = lr(d);
1048
+ m && (n.push(m), r.push(m.id), b && (o[b] = g));
1043
1049
  }
1044
- n.unshift({ id: he, component: "Column", children: r });
1045
- const c = { root: he, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1050
+ n.unshift({ id: ve, component: "Column", children: r });
1051
+ const c = { root: ve, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1046
1052
  return u !== void 0 && (c.surfaceProperties = { styleId: u ?? null }), c;
1047
1053
  }
1048
- function er(e) {
1054
+ function cr(e) {
1049
1055
  const t = /* @__PURE__ */ new Map();
1050
1056
  for (const n of e.components ?? [])
1051
1057
  n && typeof n.id == "string" && t.set(n.id, n);
1052
1058
  return t;
1053
1059
  }
1054
- function Pe(e) {
1060
+ function ze(e) {
1055
1061
  const t = e.options;
1056
1062
  return Array.isArray(t) ? t.map((n) => {
1057
1063
  if (!n || typeof n != "object") return null;
@@ -1062,10 +1068,10 @@ function Pe(e) {
1062
1068
  };
1063
1069
  }).filter((n) => !!n) : [];
1064
1070
  }
1065
- function tr(e) {
1066
- const t = typeof e.id == "string" ? e.id : ie("block-"), n = String(e.component ?? ""), r = _(e.label) ?? _(e.text) ?? "", o = Ye(e.value), i = (s) => ({ id: t, type: s, label: r }), a = Kn(n);
1071
+ function ur(e) {
1072
+ const t = typeof e.id == "string" ? e.id : ie("block-"), n = String(e.component ?? ""), r = z(e.label) ?? z(e.text) ?? "", o = ot(e.value), i = (s) => ({ id: t, type: s, label: r }), a = tr(n);
1067
1073
  if (a)
1068
- return a.fromComponent(e, i, { asLiteral: _, nameFromValue: Ye });
1074
+ return a.fromComponent(e, i, { asLiteral: z, nameFromValue: ot });
1069
1075
  switch (n) {
1070
1076
  case "Text": {
1071
1077
  const s = String(e.variant ?? "body"), c = /^h[1-6]$/i.test(s) || s === "title" || s === "subtitle";
@@ -1074,8 +1080,8 @@ function tr(e) {
1074
1080
  case "TextField": {
1075
1081
  const s = String(e.variant ?? "shortText");
1076
1082
  let c = "text";
1077
- s === "longText" ? c = "textarea" : s === "number" ? c = "number" : _(e.validationRegexp) === ft && (c = "email");
1078
- const u = { ...i(c), name: o }, d = _(e.placeholder);
1083
+ s === "longText" ? c = "textarea" : s === "number" ? c = "number" : z(e.validationRegexp) === Je && (c = "email");
1084
+ const u = { ...i(c), name: o }, d = z(e.placeholder);
1079
1085
  return d && (u.placeholder = d), u;
1080
1086
  }
1081
1087
  case "CheckBox":
@@ -1084,46 +1090,46 @@ function tr(e) {
1084
1090
  const c = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", u = {
1085
1091
  ...i(c),
1086
1092
  name: o,
1087
- options: Pe(e)
1088
- }, d = _(e.placeholder);
1093
+ options: ze(e)
1094
+ }, d = z(e.placeholder);
1089
1095
  return d && (u.placeholder = d), u;
1090
1096
  }
1091
1097
  case "ChoicePicker": {
1092
- const s = _(e.skoponPickerType);
1098
+ const s = z(e.skoponPickerType);
1093
1099
  if (s === "select" || s === "multiselect" || s === "radio" || s === "checkbox") {
1094
1100
  const d = {
1095
1101
  ...i(s),
1096
1102
  name: o,
1097
- options: Pe(e)
1098
- }, p = _(e.placeholder);
1099
- return p && (d.placeholder = p), d;
1103
+ options: ze(e)
1104
+ }, m = z(e.placeholder);
1105
+ return m && (d.placeholder = m), d;
1100
1106
  }
1101
1107
  const u = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
1102
- return { ...i(u), name: o, options: Pe(e) };
1108
+ return { ...i(u), name: o, options: ze(e) };
1103
1109
  }
1104
1110
  case "DateTimeInput": {
1105
- const s = e.enableDate === !0, c = e.enableTime === !0, d = { ...i(!s && c ? "time" : "datetime"), name: o }, p = _(e.placeholder);
1106
- return p && (d.placeholder = p), d;
1111
+ const s = e.enableDate === !0, c = e.enableTime === !0, d = { ...i(!s && c ? "time" : "datetime"), name: o }, m = z(e.placeholder);
1112
+ return m && (d.placeholder = m), d;
1107
1113
  }
1108
1114
  case "SkoponMedia": {
1109
1115
  const s = String(e.mediaType ?? "image");
1110
- return ue(e, s === "video" ? "video" : s === "audio" ? "audio" : "image", r);
1116
+ return me(e, s === "video" ? "video" : s === "audio" ? "audio" : "image", r);
1111
1117
  }
1112
1118
  case "Image":
1113
- return ue(e, "image", r);
1119
+ return me(e, "image", r);
1114
1120
  case "Video":
1115
- return ue(e, "video", r);
1121
+ return me(e, "video", r);
1116
1122
  case "AudioPlayer":
1117
- return ue(e, "audio", r);
1123
+ return me(e, "audio", r);
1118
1124
  case "FileUpload": {
1119
- const s = _(e.accept) ?? "", c = { ...i("file"), name: o };
1125
+ const s = z(e.accept) ?? "", c = { ...i("file"), name: o };
1120
1126
  return s && (c.fileAcceptExtensions = s.split(",").map((u) => u.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (c.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (c.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (c.fileMinCount = e.minCount), typeof e.maxCount == "number" && (c.fileMaxCount = e.maxCount), c;
1121
1127
  }
1122
1128
  default:
1123
1129
  return null;
1124
1130
  }
1125
1131
  }
1126
- function gt(e, t, n, r) {
1132
+ function xt(e, t, n, r) {
1127
1133
  if (n.has(e)) return;
1128
1134
  n.add(e);
1129
1135
  const o = t.get(e);
@@ -1131,47 +1137,47 @@ function gt(e, t, n, r) {
1131
1137
  const i = String(o.component ?? "");
1132
1138
  if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
1133
1139
  for (const a of o.children)
1134
- typeof a == "string" && gt(a, t, n, r);
1140
+ typeof a == "string" && xt(a, t, n, r);
1135
1141
  return;
1136
1142
  }
1137
1143
  r.push(o);
1138
1144
  }
1139
- function nr(e, t) {
1145
+ function pr(e, t) {
1140
1146
  return t ? e.map((n) => {
1141
1147
  var i;
1142
1148
  const r = (i = n.name) == null ? void 0 : i.trim();
1143
1149
  if (!r || !(r in t)) return n;
1144
1150
  const o = t[r];
1145
- return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: o === !0 || o === "true" } : { ...n, defaultValue: o };
1151
+ return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: le(o) } : { ...n, defaultValue: o };
1146
1152
  }) : e;
1147
1153
  }
1148
- function rr(e) {
1154
+ function mr(e) {
1149
1155
  if (!e || !Array.isArray(e.components))
1150
- return me({ title: "", description: "", blocks: [], jsonSchema: {} });
1151
- const t = er(e), n = [];
1152
- gt(e.root ?? he, t, /* @__PURE__ */ new Set(), n);
1156
+ return ge({ title: "", description: "", blocks: [], jsonSchema: {} });
1157
+ const t = cr(e), n = [];
1158
+ xt(e.root ?? ve, t, /* @__PURE__ */ new Set(), n);
1153
1159
  let r = "", o = "";
1154
1160
  const i = [];
1155
1161
  for (const a of n) {
1156
- if (a.id === _e) {
1157
- r = _(a.text) ?? r;
1162
+ if (a.id === Oe) {
1163
+ r = z(a.text) ?? r;
1158
1164
  continue;
1159
1165
  }
1160
- if (a.id === Ee) {
1161
- o = _(a.text) ?? o;
1166
+ if (a.id === Ve) {
1167
+ o = z(a.text) ?? o;
1162
1168
  continue;
1163
1169
  }
1164
- const s = tr(a);
1170
+ const s = ur(a);
1165
1171
  s && i.push(s);
1166
1172
  }
1167
- return me({
1173
+ return ge({
1168
1174
  title: r,
1169
1175
  description: o,
1170
- blocks: nr(i, e.dataModel),
1176
+ blocks: pr(i, e.dataModel),
1171
1177
  jsonSchema: {}
1172
1178
  });
1173
1179
  }
1174
- function or(e, t) {
1180
+ function dr(e, t) {
1175
1181
  const { surfaceId: n, catalogId: r } = t, o = [
1176
1182
  { version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
1177
1183
  {
@@ -1184,24 +1190,25 @@ function or(e, t) {
1184
1190
  updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
1185
1191
  }), o;
1186
1192
  }
1187
- function yt(e) {
1193
+ function kt(e) {
1188
1194
  return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
1189
1195
  }
1190
- function ir(e, t) {
1196
+ function fr(e, t) {
1191
1197
  if (!e || typeof e != "object") return null;
1192
- const n = e, r = yt(n.a2ui) ? n.a2ui : void 0;
1193
- if (r && !Re(r)) return r;
1198
+ const n = e, r = kt(n.a2ui) ? n.a2ui : void 0;
1199
+ if (r && !je(r)) return r;
1194
1200
  const o = Array.isArray(n.blocks) ? n.blocks : [];
1195
1201
  if (o.length === 0) return null;
1196
- const i = Z({
1202
+ const i = ee({
1197
1203
  title: typeof n.title == "string" ? n.title : "",
1198
1204
  description: typeof n.description == "string" ? n.description : "",
1199
- blocks: o
1200
- }), a = ht(i, t);
1201
- return Re(a) ? null : a;
1205
+ blocks: o,
1206
+ jsonSchema: Ge(n.jsonSchema ?? n.json_schema)
1207
+ }), a = Ct(i, t);
1208
+ return je(a) ? null : a;
1202
1209
  }
1203
- function ar(e, t, n) {
1204
- return ht(
1210
+ function hr(e, t, n) {
1211
+ return Ct(
1205
1212
  {
1206
1213
  title: e.title,
1207
1214
  description: e.description,
@@ -1210,17 +1217,18 @@ function ar(e, t, n) {
1210
1217
  n
1211
1218
  );
1212
1219
  }
1213
- function lr(e) {
1220
+ function gr(e) {
1214
1221
  if (!e || typeof e != "object" || Array.isArray(e))
1215
1222
  return;
1216
1223
  const t = e;
1217
- return !(Array.isArray(t.blocks) && t.blocks.length > 0) && yt(t.a2ui) ? rr(t.a2ui) : Z({
1224
+ return !(Array.isArray(t.blocks) && t.blocks.length > 0) && kt(t.a2ui) ? mr(t.a2ui) : ee({
1218
1225
  title: typeof t.title == "string" ? t.title : "",
1219
1226
  description: typeof t.description == "string" ? t.description : "",
1220
- blocks: Array.isArray(t.blocks) ? t.blocks : []
1227
+ blocks: Array.isArray(t.blocks) ? t.blocks : [],
1228
+ jsonSchema: Ge(t.jsonSchema ?? t.json_schema)
1221
1229
  });
1222
1230
  }
1223
- function sr(e, t, n) {
1231
+ function yr(e, t, n) {
1224
1232
  const r = e.model.surfacesMap.get(t);
1225
1233
  if (!r) return {};
1226
1234
  const o = {};
@@ -1230,14 +1238,15 @@ function sr(e, t, n) {
1230
1238
  }
1231
1239
  return o;
1232
1240
  }
1233
- function cr(e) {
1234
- return Z({
1241
+ function vr(e) {
1242
+ return ee({
1235
1243
  title: "",
1236
1244
  description: "",
1237
- blocks: [e]
1245
+ blocks: [e],
1246
+ jsonSchema: {}
1238
1247
  }).blocks[0];
1239
1248
  }
1240
- function ur(e, t) {
1249
+ function Sr(e, t) {
1241
1250
  var o, i;
1242
1251
  const n = /* @__PURE__ */ new Map();
1243
1252
  for (const a of t) {
@@ -1246,8 +1255,8 @@ function ur(e, t) {
1246
1255
  }
1247
1256
  const r = [];
1248
1257
  for (const a of e.blocks) {
1249
- if (we(a.type)) {
1250
- r.push(cr(a));
1258
+ if (be(a.type)) {
1259
+ r.push(vr(a));
1251
1260
  continue;
1252
1261
  }
1253
1262
  if (!W(a.type)) continue;
@@ -1258,69 +1267,72 @@ function ur(e, t) {
1258
1267
  }
1259
1268
  return r;
1260
1269
  }
1261
- function pr(e, t) {
1270
+ function br(e, t) {
1262
1271
  var r;
1263
1272
  const n = {
1264
1273
  ...e,
1265
1274
  name: ((r = e.name) == null ? void 0 : r.trim()) || t.name
1266
1275
  };
1267
- return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), Z({
1276
+ return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), ee({
1268
1277
  title: "",
1269
1278
  description: "",
1270
- blocks: [n]
1279
+ blocks: [n],
1280
+ jsonSchema: {}
1271
1281
  }).blocks[0];
1272
1282
  }
1273
- function vt(e) {
1283
+ function At(e) {
1274
1284
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1275
1285
  const t = e;
1276
- return Array.isArray(t.blocks) ? Z({
1286
+ return Array.isArray(t.blocks) ? ee({
1277
1287
  title: typeof t.title == "string" ? t.title : "",
1278
1288
  description: typeof t.description == "string" ? t.description : "",
1279
- blocks: t.blocks
1289
+ blocks: t.blocks,
1290
+ jsonSchema: {}
1280
1291
  }) : null;
1281
1292
  }
1282
- function dr(e, t) {
1293
+ function Cr(e, t) {
1283
1294
  var i, a, s, c, u, d;
1284
1295
  const n = /* @__PURE__ */ new Map();
1285
- for (const p of (t == null ? void 0 : t.blocks) ?? [])
1286
- W(p.type) && ((i = p.name) != null && i.trim()) && n.set(p.name.trim(), p);
1296
+ for (const m of (t == null ? void 0 : t.blocks) ?? [])
1297
+ W(m.type) && ((i = m.name) != null && i.trim()) && n.set(m.name.trim(), m);
1287
1298
  const r = [], o = [];
1288
- for (const p of e.blocks) {
1289
- if (!W(p.type)) continue;
1290
- const g = (a = p.name) == null ? void 0 : a.trim();
1291
- if (!g) continue;
1292
- const v = n.get(g);
1293
- v ? r.push(pr(v, p)) : o.push(
1294
- Z({
1299
+ for (const m of e.blocks) {
1300
+ if (!W(m.type)) continue;
1301
+ const b = (a = m.name) == null ? void 0 : a.trim();
1302
+ if (!b) continue;
1303
+ const g = n.get(b);
1304
+ g ? r.push(br(g, m)) : o.push(
1305
+ ee({
1295
1306
  title: "",
1296
1307
  description: "",
1297
- blocks: [p]
1308
+ blocks: [m],
1309
+ jsonSchema: {}
1298
1310
  }).blocks[0]
1299
1311
  );
1300
1312
  }
1301
1313
  return {
1302
1314
  matchedBlocks: r,
1303
1315
  extraBlocks: o,
1304
- renderBlocks: ur(e, r),
1316
+ renderBlocks: Sr(e, r),
1305
1317
  title: ((s = e.title) == null ? void 0 : s.trim()) || ((c = t == null ? void 0 : t.title) == null ? void 0 : c.trim()) || "",
1306
1318
  description: ((u = e.description) == null ? void 0 : u.trim()) || ((d = t == null ? void 0 : t.description) == null ? void 0 : d.trim()) || ""
1307
1319
  };
1308
1320
  }
1309
- function mr(e) {
1321
+ function xr(e) {
1310
1322
  const { type: t, defaultValue: n } = e;
1311
1323
  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 : "";
1312
1324
  }
1313
- function bt(e) {
1325
+ function Tt(e) {
1314
1326
  var n;
1315
1327
  const t = {};
1316
1328
  for (const r of e) {
1317
1329
  if (!W(r.type)) continue;
1318
1330
  const o = (n = r.name) == null ? void 0 : n.trim();
1319
- o && (t[o] = mr(r));
1331
+ o && (t[o] = xr(r));
1320
1332
  }
1321
1333
  return t;
1322
1334
  }
1323
- function fr(e) {
1335
+ function kr(e) {
1324
1336
  return e.blocks.some(
1325
1337
  (t) => {
1326
1338
  var n;
@@ -1328,53 +1340,53 @@ function fr(e) {
1328
1340
  }
1329
1341
  );
1330
1342
  }
1331
- function hr(e) {
1343
+ function Ar(e) {
1332
1344
  return e.blocks.filter((t) => {
1333
1345
  var n;
1334
- return we(t.type) ? !0 : W(t.type) && !!((n = t.name) != null && n.trim());
1346
+ return be(t.type) ? !0 : W(t.type) && !!((n = t.name) != null && n.trim());
1335
1347
  });
1336
1348
  }
1337
- function gr(e) {
1349
+ function Tr(e) {
1338
1350
  return e.blocks.filter((t) => {
1339
1351
  var n;
1340
1352
  return W(t.type) && ((n = t.name) == null ? void 0 : n.trim());
1341
1353
  }).map((t) => t.name.trim());
1342
1354
  }
1343
- function St(e) {
1355
+ function It(e) {
1344
1356
  return e.replace(/'/g, "'\\''");
1345
1357
  }
1346
- function xt(e, t) {
1358
+ function Nt(e, t) {
1347
1359
  const n = (t ?? "").trim() || "<callback_url>", r = JSON.stringify(e ?? {}, null, 2);
1348
1360
  return [
1349
1361
  `curl -X POST '${n}' \\`,
1350
1362
  " -H 'Content-Type: application/json' \\",
1351
- ` -d '${St(r)}'`
1363
+ ` -d '${It(r)}'`
1352
1364
  ].join(`
1353
1365
  `);
1354
1366
  }
1355
- function yr(e, t) {
1367
+ function Ir(e, t) {
1356
1368
  return JSON.stringify({ ...e, ...t }, null, 2);
1357
1369
  }
1358
- function Ct({
1370
+ function Mt({
1359
1371
  cardValues: e,
1360
1372
  extraValues: t = {},
1361
1373
  callbackUrl: n
1362
1374
  }) {
1363
- const r = (n ?? "").trim() || "<callback_url>", o = yr(e, t);
1375
+ const r = (n ?? "").trim() || "<callback_url>", o = Ir(e, t);
1364
1376
  return [
1365
1377
  `curl -X POST '${r}' \\`,
1366
1378
  " -H 'Content-Type: application/json' \\",
1367
- ` -d '${St(o)}'`
1379
+ ` -d '${It(o)}'`
1368
1380
  ].join(`
1369
1381
  `);
1370
1382
  }
1371
- function vr(e, t) {
1372
- const n = vt(e);
1373
- if (!n) return xt(e, t);
1374
- const r = bt(n.blocks);
1375
- return Ct({ cardValues: r, callbackUrl: t });
1383
+ function Nr(e, t) {
1384
+ const n = At(e);
1385
+ if (!n) return Nt(e, t);
1386
+ const r = Tt(n.blocks);
1387
+ return Mt({ cardValues: r, callbackUrl: t });
1376
1388
  }
1377
- async function br(e, t, n) {
1389
+ async function Mr(e, t, n) {
1378
1390
  const r = e.trim();
1379
1391
  if (!r)
1380
1392
  throw new Error("callback_url 为空");
@@ -1401,7 +1413,7 @@ async function br(e, t, n) {
1401
1413
  }
1402
1414
  return { ok: i.ok, status: i.status, body: a };
1403
1415
  }
1404
- async function kt(e) {
1416
+ async function Ft(e) {
1405
1417
  var n;
1406
1418
  if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
1407
1419
  await navigator.clipboard.writeText(e);
@@ -1417,7 +1429,7 @@ async function kt(e) {
1417
1429
  document.body.removeChild(t);
1418
1430
  }
1419
1431
  }
1420
- async function Sr(e) {
1432
+ async function Ye(e) {
1421
1433
  let t;
1422
1434
  try {
1423
1435
  t = await e.json();
@@ -1430,10 +1442,37 @@ async function Sr(e) {
1430
1442
  throw new Error(t.message || `响应缺少 data (${e.status})`);
1431
1443
  return t.data;
1432
1444
  }
1433
- function so(e = {}) {
1445
+ const Fr = "auth_user", _r = "token";
1446
+ function Pr(e) {
1447
+ if (typeof window > "u") return null;
1448
+ try {
1449
+ return e === "localStorage" ? window.localStorage : window.sessionStorage;
1450
+ } catch {
1451
+ return null;
1452
+ }
1453
+ }
1454
+ function Ur(e, t) {
1455
+ try {
1456
+ const r = JSON.parse(e)[t];
1457
+ return typeof r == "string" ? r.trim().replace(/^bearer\s+/i, "").trim() : "";
1458
+ } catch {
1459
+ return "";
1460
+ }
1461
+ }
1462
+ function zr(e = {}) {
1463
+ const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Fr, r = e.tokenField ?? _r, o = Pr(t);
1464
+ if (!o) return {};
1465
+ const i = o.getItem(n);
1466
+ if (!i) return {};
1467
+ const a = Ur(i, r);
1468
+ return a ? { Authorization: `Bearer ${a}` } : {};
1469
+ }
1470
+ async function Xe(e = {}) {
1471
+ return e.getHeaders ? await e.getHeaders() ?? {} : zr(e.authStorage);
1472
+ }
1473
+ function Er(e = {}) {
1434
1474
  const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
1435
1475
  async function o(i) {
1436
- var p;
1437
1476
  const a = new URLSearchParams();
1438
1477
  if (i.formId !== void 0)
1439
1478
  a.set("form_id", String(i.formId));
@@ -1441,34 +1480,219 @@ function so(e = {}) {
1441
1480
  a.set("form_unique_id", i.formUniqueId);
1442
1481
  else
1443
1482
  throw new Error("form_id 或 form_unique_id 至少传一个");
1444
- const s = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${a.toString()}`, {
1483
+ const s = await Xe(e), c = await r(`${t}${n}?${a.toString()}`, {
1445
1484
  method: "GET",
1446
1485
  headers: s
1447
- }), u = await Sr(c), d = lr(u.form_definition);
1486
+ }), u = await Ye(c), d = gr(u.form_definition);
1448
1487
  return {
1449
1488
  formUniqueId: u.form_unique_id,
1450
1489
  formId: u.form_id,
1451
1490
  disabled: u.disabled === 1,
1452
1491
  formDefinition: d,
1453
- a2ui: ir(u.form_definition) ?? void 0
1492
+ a2ui: fr(u.form_definition) ?? void 0
1454
1493
  };
1455
1494
  }
1456
1495
  return { fetchDetail: o };
1457
1496
  }
1458
- const xr = {
1459
- video: $t,
1460
- audio: jt,
1461
- image: Lt,
1462
- file: Qe,
1463
- spreadsheet: qt,
1464
- document: We
1497
+ function Rr(e) {
1498
+ return {
1499
+ resumeUniqueId: e.resume_unique_id,
1500
+ resumeId: e.resume_id,
1501
+ agentId: e.agent_id,
1502
+ name: e.name,
1503
+ avatarUrl: e.avatar_url ?? null,
1504
+ description: e.description ?? void 0,
1505
+ satisfaction: e.satisfaction,
1506
+ published: e.published,
1507
+ worksCount: e.works_count,
1508
+ personality: e.personality_json ?? [],
1509
+ specialties: e.specialties_json ?? [],
1510
+ traits: e.traits_json ?? [],
1511
+ works: (e.works_json ?? []).map((t) => ({
1512
+ title: t.title ?? "",
1513
+ coverUrl: t.cover_url ?? null,
1514
+ link: t.link
1515
+ }))
1516
+ };
1517
+ }
1518
+ function Br(e, t) {
1519
+ const n = new URLSearchParams();
1520
+ n.set("page", String(t)), n.set("page_size", String(e.pageSize ?? 20));
1521
+ for (const r of e.names ?? [])
1522
+ r && n.append("name", r);
1523
+ for (const r of e.agentUniqueIds ?? [])
1524
+ r && n.append("agent_unique_id", r);
1525
+ for (const r of e.resumeUniqueIds ?? [])
1526
+ r && n.append("resume_unique_id", r);
1527
+ return n;
1528
+ }
1529
+ function wr(e = {}) {
1530
+ const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.searchPath ?? "/univ/resume/search", r = e.fetch ?? fetch;
1531
+ return async ({ filter: o, page: i }) => {
1532
+ const a = await Xe(e), s = Br(o, i), c = await r(`${t}${n}?${s.toString()}`, {
1533
+ method: "GET",
1534
+ headers: a
1535
+ }), u = await Ye(c);
1536
+ return {
1537
+ list: (u.list ?? []).map(Rr),
1538
+ total: u.total ?? 0,
1539
+ page: u.page ?? i,
1540
+ pageSize: u.page_size ?? o.pageSize ?? 20
1541
+ };
1542
+ };
1543
+ }
1544
+ function qr(e) {
1545
+ var r, o, i, a;
1546
+ const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!((o = e.agentUniqueId) != null && o.trim() && ((i = e.flowType) != null && i.trim()) && ((a = e.category) != null && a.trim()));
1547
+ return t || n;
1548
+ }
1549
+ function Or(e) {
1550
+ return {
1551
+ caseUniqueId: e.case_unique_id,
1552
+ caseId: e.case_id,
1553
+ flowId: e.flow_id,
1554
+ name: e.name,
1555
+ link: e.link,
1556
+ platform: e.platform ?? null,
1557
+ description: e.description ?? void 0
1558
+ };
1559
+ }
1560
+ function Vr(e, t, n) {
1561
+ var o, i, a;
1562
+ const r = new URLSearchParams();
1563
+ 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()), (a = e.category) != null && a.trim() && r.set("category_unique_id", e.category.trim());
1564
+ for (const s of e.flowUniqueIds ?? [])
1565
+ s && r.append("flow_unique_ids", s);
1566
+ return r;
1567
+ }
1568
+ function jr(e = {}) {
1569
+ const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.listPath ?? "/univ/case/list", r = e.fetch ?? fetch, o = e.published ?? 1;
1570
+ return async ({ filter: i, page: a }) => {
1571
+ if (!qr(i))
1572
+ return { list: [], total: 0, page: 1, pageSize: i.pageSize ?? 20 };
1573
+ const s = await Xe(e), c = Vr(i, a, o), u = await r(`${t}${n}?${c.toString()}`, {
1574
+ method: "GET",
1575
+ headers: s
1576
+ }), d = await Ye(u);
1577
+ return {
1578
+ list: (d.list ?? []).map(Or),
1579
+ total: d.total ?? 0,
1580
+ page: d.page ?? a,
1581
+ pageSize: d.page_size ?? i.pageSize ?? 20
1582
+ };
1583
+ };
1584
+ }
1585
+ function Uo(e = {}) {
1586
+ var r, o, i, a;
1587
+ const t = {
1588
+ baseUrl: e.baseUrl,
1589
+ fetch: e.fetch,
1590
+ getHeaders: e.getHeaders,
1591
+ authStorage: e.authStorage
1592
+ };
1593
+ return {
1594
+ fetchDetail: Er({
1595
+ ...t,
1596
+ detailPath: (r = e.form) == null ? void 0 : r.detailPath
1597
+ }).fetchDetail,
1598
+ resumeSearch: wr({
1599
+ ...t,
1600
+ searchPath: (o = e.resume) == null ? void 0 : o.searchPath
1601
+ }),
1602
+ caseSearch: jr({
1603
+ ...t,
1604
+ listPath: (i = e.case) == null ? void 0 : i.listPath,
1605
+ published: (a = e.case) == null ? void 0 : a.published
1606
+ })
1607
+ };
1608
+ }
1609
+ function _t(e, t) {
1610
+ if (!t.trim()) return !0;
1611
+ try {
1612
+ return new RegExp(t).test(e);
1613
+ } catch {
1614
+ return !0;
1615
+ }
1616
+ }
1617
+ function Pt(e) {
1618
+ return e == null ? !0 : typeof e == "string" ? !e.trim() : !1;
1619
+ }
1620
+ function Lr(e, t) {
1621
+ switch (e.type) {
1622
+ case "multiselect":
1623
+ case "checkbox":
1624
+ case "file":
1625
+ case "resume_multiselect":
1626
+ case "case_multiselect":
1627
+ return O(t).length === 0;
1628
+ case "toggle":
1629
+ return !le(t);
1630
+ case "number":
1631
+ return t == null || t === "";
1632
+ default:
1633
+ return Pt(t);
1634
+ }
1635
+ }
1636
+ function Ee(e, t) {
1637
+ return e.required === !0 || t > 0;
1638
+ }
1639
+ function $r(e, t) {
1640
+ var n, r;
1641
+ for (const o of e) {
1642
+ const i = (n = o.name) == null ? void 0 : n.trim();
1643
+ if (!i || be(o.type) || he(o.type)) continue;
1644
+ const a = t[i], s = ((r = o.label) == null ? void 0 : r.trim()) || i;
1645
+ if (o.required && Lr(o, a))
1646
+ return { fieldName: i, label: s, message: `请填写「${s}」` };
1647
+ if (o.type === "email" && !Pt(a)) {
1648
+ const c = String(a).trim();
1649
+ if (!_t(c, Je))
1650
+ return { fieldName: i, label: s, message: `「${s}」格式不正确` };
1651
+ }
1652
+ if (o.type === "file") {
1653
+ const c = o.fileMinCount ?? 0, u = O(a).length;
1654
+ if (c > 0 && u < c && Ee(o, u))
1655
+ return {
1656
+ fieldName: i,
1657
+ label: s,
1658
+ message: `「${s}」至少需要 ${c} 个文件`
1659
+ };
1660
+ }
1661
+ if (o.type === "resume_multiselect") {
1662
+ const c = o.resumeMinCount, u = O(a).length;
1663
+ if (c !== void 0 && u < c && Ee(o, u))
1664
+ return {
1665
+ fieldName: i,
1666
+ label: s,
1667
+ message: `「${s}」至少选择 ${c} 项`
1668
+ };
1669
+ }
1670
+ if (o.type === "case_multiselect") {
1671
+ const c = o.caseMinCount, u = O(a).length;
1672
+ if (c !== void 0 && u < c && Ee(o, u))
1673
+ return {
1674
+ fieldName: i,
1675
+ label: s,
1676
+ message: `「${s}」至少选择 ${c} 项`
1677
+ };
1678
+ }
1679
+ }
1680
+ return null;
1681
+ }
1682
+ const Dr = {
1683
+ video: Qt,
1684
+ audio: Wt,
1685
+ image: Xt,
1686
+ file: st,
1687
+ spreadsheet: Yt,
1688
+ document: at
1465
1689
  };
1466
- function Cr({
1690
+ function Hr({
1467
1691
  type: e,
1468
1692
  size: t = 40,
1469
1693
  className: n
1470
1694
  }) {
1471
- const r = xr[e] ?? Qe;
1695
+ const r = Dr[e] ?? st;
1472
1696
  return /* @__PURE__ */ l(
1473
1697
  r,
1474
1698
  {
@@ -1478,7 +1702,7 @@ function Cr({
1478
1702
  }
1479
1703
  );
1480
1704
  }
1481
- const At = "skopon-form-v0_9", kr = /* @__PURE__ */ new Set([
1705
+ const Ut = "skopon-form-v0_9", Kr = /* @__PURE__ */ new Set([
1482
1706
  "SkoponMedia",
1483
1707
  "SkoponSelect",
1484
1708
  "Image",
@@ -1490,24 +1714,24 @@ const At = "skopon-form-v0_9", kr = /* @__PURE__ */ new Set([
1490
1714
  "FileUpload",
1491
1715
  "TextField",
1492
1716
  "Text",
1493
- ...Jn()
1494
- ]), Ar = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
1495
- function se(e) {
1496
- const t = [...de.components.values()].find((n) => n.name === e);
1717
+ ...rr()
1718
+ ]), Gr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
1719
+ function ce(e) {
1720
+ const t = [...fe.components.values()].find((n) => n.name === e);
1497
1721
  if (!t) throw new Error(`Missing basic catalog component: ${e}`);
1498
1722
  return t.schema;
1499
1723
  }
1500
- function A(e) {
1724
+ function T(e) {
1501
1725
  return typeof e == "string" ? e : "";
1502
1726
  }
1503
- function Tt(e) {
1727
+ function zt(e) {
1504
1728
  return Array.isArray(e) ? e.map((t) => {
1505
1729
  if (!t || typeof t != "object") return null;
1506
1730
  const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
1507
1731
  return { value: r, label: o };
1508
1732
  }).filter((t) => !!t) : [];
1509
1733
  }
1510
- function ve({
1734
+ function xe({
1511
1735
  mediaType: e,
1512
1736
  urls: t,
1513
1737
  mediaSize: n,
@@ -1515,17 +1739,17 @@ function ve({
1515
1739
  help: o,
1516
1740
  placeholder: i
1517
1741
  }) {
1518
- const a = r == null ? void 0 : r.trim(), s = o == null ? void 0 : o.trim(), c = mn(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
1519
- return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1742
+ const a = r == null ? void 0 : r.trim(), s = o == null ? void 0 : o.trim(), c = xn(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
1743
+ return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
1520
1744
  a ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: a }) : null,
1521
- t.length === 0 ? /* @__PURE__ */ l("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ l("div", { className: c, children: t.map((d, p) => e === "image" ? /* @__PURE__ */ l(
1745
+ t.length === 0 ? /* @__PURE__ */ l("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ l("div", { className: c, children: t.map((d, m) => e === "image" ? /* @__PURE__ */ l(
1522
1746
  "img",
1523
1747
  {
1524
1748
  src: d,
1525
1749
  alt: a || "图片",
1526
1750
  className: "form-media-item"
1527
1751
  },
1528
- `media-${p}`
1752
+ `media-${m}`
1529
1753
  ) : e === "video" ? /* @__PURE__ */ l(
1530
1754
  "video",
1531
1755
  {
@@ -1533,7 +1757,7 @@ function ve({
1533
1757
  controls: !0,
1534
1758
  className: "form-media-item"
1535
1759
  },
1536
- `media-${p}`
1760
+ `media-${m}`
1537
1761
  ) : /* @__PURE__ */ l(
1538
1762
  "audio",
1539
1763
  {
@@ -1541,60 +1765,63 @@ function ve({
1541
1765
  controls: !0,
1542
1766
  className: "form-media-item form-media-item--audio"
1543
1767
  },
1544
- `media-${p}`
1768
+ `media-${m}`
1545
1769
  )) }),
1546
- s ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-help", children: s }) : null
1770
+ s ? /* @__PURE__ */ l(D.Text, { type: "secondary", className: "form-block-preview-help", children: s }) : null
1547
1771
  ] });
1548
1772
  }
1549
- function be(e, t) {
1550
- const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : A(e.url).trim() ? [A(e.url).trim()] : [];
1773
+ function ke(e, t) {
1774
+ const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : T(e.url).trim() ? [T(e.url).trim()] : [];
1551
1775
  return {
1552
1776
  mediaType: t,
1553
1777
  urls: n,
1554
- mediaSize: le(e.mediaSize),
1555
- label: A(e.label) || A(e.description),
1556
- help: A(e.help),
1557
- placeholder: A(e.placeholder)
1778
+ mediaSize: se(e.mediaSize),
1779
+ label: T(e.label) || T(e.description),
1780
+ help: T(e.help),
1781
+ placeholder: T(e.placeholder)
1558
1782
  };
1559
1783
  }
1560
- const Tr = {
1784
+ const Jr = {
1561
1785
  name: "SkoponMedia",
1562
- schema: m.object({
1563
- mediaType: m.any().optional(),
1564
- urls: m.any().optional(),
1565
- mediaSize: m.any().optional(),
1566
- label: m.any().optional(),
1567
- help: m.any().optional(),
1568
- placeholder: m.any().optional()
1786
+ schema: f.object({
1787
+ mediaType: f.any().optional(),
1788
+ urls: f.any().optional(),
1789
+ mediaSize: f.any().optional(),
1790
+ label: f.any().optional(),
1791
+ help: f.any().optional(),
1792
+ placeholder: f.any().optional()
1569
1793
  }).passthrough()
1570
- }, Nr = V(Tr, ({ context: e }) => {
1571
- const t = e.componentModel.properties, n = A(t.mediaType);
1572
- return /* @__PURE__ */ l(ve, { ...be(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
1573
- }), Mr = V(
1574
- { name: "Image", schema: se("Image") },
1575
- ({ context: e }) => /* @__PURE__ */ l(ve, { ...be(e.componentModel.properties, "image") })
1576
- ), Ir = V(
1577
- { name: "Video", schema: se("Video") },
1578
- ({ context: e }) => /* @__PURE__ */ l(ve, { ...be(e.componentModel.properties, "video") })
1579
- ), Fr = V(
1580
- { name: "AudioPlayer", schema: se("AudioPlayer") },
1581
- ({ context: e }) => /* @__PURE__ */ l(ve, { ...be(e.componentModel.properties, "audio") })
1582
- ), Pr = {
1794
+ }, Yr = V(Jr, ({ context: e }) => {
1795
+ const t = e.componentModel.properties, n = T(t.mediaType);
1796
+ return /* @__PURE__ */ l(xe, { ...ke(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
1797
+ }), Xr = V(
1798
+ { name: "Image", schema: ce("Image") },
1799
+ ({ context: e }) => /* @__PURE__ */ l(xe, { ...ke(e.componentModel.properties, "image") })
1800
+ ), Wr = V(
1801
+ { name: "Video", schema: ce("Video") },
1802
+ ({ context: e }) => /* @__PURE__ */ l(xe, { ...ke(e.componentModel.properties, "video") })
1803
+ ), Qr = V(
1804
+ { name: "AudioPlayer", schema: ce("AudioPlayer") },
1805
+ ({ context: e }) => /* @__PURE__ */ l(xe, { ...ke(e.componentModel.properties, "audio") })
1806
+ ), Zr = {
1583
1807
  name: "SkoponSelect",
1584
- schema: m.object({
1585
- label: m.any().optional(),
1586
- mode: m.any().optional(),
1587
- placeholder: m.any().optional(),
1588
- options: m.any().optional(),
1589
- value: m.any().optional()
1808
+ schema: f.object({
1809
+ label: f.any().optional(),
1810
+ mode: f.any().optional(),
1811
+ placeholder: f.any().optional(),
1812
+ options: f.any().optional(),
1813
+ value: f.any().optional()
1590
1814
  }).passthrough()
1591
1815
  };
1592
- function zr({ context: e }) {
1593
- const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), s = Tt(o.options), c = A(o.mode) === "multiple";
1594
- return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1816
+ function eo({ context: e }) {
1817
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = T(o.label), a = T(o.placeholder), s = zt(o.options), c = T(o.mode) === "multiple";
1818
+ return R(() => {
1819
+ const u = ht(n, c);
1820
+ u !== null && r(u);
1821
+ }, [c, n, r]), /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
1595
1822
  i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1596
1823
  /* @__PURE__ */ l(
1597
- ze,
1824
+ Re,
1598
1825
  {
1599
1826
  mode: c ? "multiple" : void 0,
1600
1827
  disabled: !t,
@@ -1603,22 +1830,25 @@ function zr({ context: e }) {
1603
1830
  style: { width: "100%" },
1604
1831
  placeholder: a || (c ? "请选择多项" : "请选择"),
1605
1832
  options: s,
1606
- value: c ? D(n) : oe(n),
1833
+ value: c ? O(n) : oe(n),
1607
1834
  onChange: (u) => r(c ? u ?? [] : u ?? "")
1608
1835
  }
1609
1836
  )
1610
1837
  ] });
1611
1838
  }
1612
- const Ur = V(
1613
- Pr,
1614
- zr
1839
+ const to = V(
1840
+ Zr,
1841
+ eo
1615
1842
  );
1616
- function _r({ context: e }) {
1617
- const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = A(o.label), a = A(o.variant) || "mutuallyExclusive", s = A(o.skoponPickerType), c = A(o.placeholder), u = Tt(o.options), p = s === "select" || s === "multiselect" || s === "radio" || s === "checkbox" ? s : a === "multipleSelection" ? "checkbox" : "radio";
1618
- return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1843
+ function no({ context: e }) {
1844
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = T(o.label), a = T(o.variant) || "mutuallyExclusive", s = T(o.skoponPickerType), c = T(o.placeholder), u = zt(o.options), m = s === "select" || s === "multiselect" || s === "radio" || s === "checkbox" ? s : a === "multipleSelection" ? "checkbox" : "radio", b = m === "multiselect" || m === "checkbox";
1845
+ return R(() => {
1846
+ const g = ht(n, b);
1847
+ g !== null && r(g);
1848
+ }, [b, n, r]), /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
1619
1849
  i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1620
- p === "select" ? /* @__PURE__ */ l(
1621
- ze,
1850
+ m === "select" ? /* @__PURE__ */ l(
1851
+ Re,
1622
1852
  {
1623
1853
  disabled: !t,
1624
1854
  allowClear: !0,
@@ -1629,8 +1859,8 @@ function _r({ context: e }) {
1629
1859
  value: oe(n),
1630
1860
  onChange: (g) => r(g ?? "")
1631
1861
  }
1632
- ) : p === "multiselect" ? /* @__PURE__ */ l(
1633
- ze,
1862
+ ) : m === "multiselect" ? /* @__PURE__ */ l(
1863
+ Re,
1634
1864
  {
1635
1865
  mode: "multiple",
1636
1866
  disabled: !t,
@@ -1639,20 +1869,20 @@ function _r({ context: e }) {
1639
1869
  style: { width: "100%" },
1640
1870
  placeholder: c || "请选择多项",
1641
1871
  options: u,
1642
- value: D(n),
1872
+ value: O(n),
1643
1873
  onChange: (g) => r(g ?? [])
1644
1874
  }
1645
- ) : p === "checkbox" ? /* @__PURE__ */ l(
1646
- zt.Group,
1875
+ ) : m === "checkbox" ? /* @__PURE__ */ l(
1876
+ Vt.Group,
1647
1877
  {
1648
1878
  disabled: !t,
1649
1879
  className: "form-block-preview-control",
1650
1880
  options: u,
1651
- value: D(n),
1881
+ value: O(n),
1652
1882
  onChange: (g) => r(g)
1653
1883
  }
1654
1884
  ) : /* @__PURE__ */ l(
1655
- Ut.Group,
1885
+ jt.Group,
1656
1886
  {
1657
1887
  disabled: !t,
1658
1888
  className: "form-block-preview-control",
@@ -1663,69 +1893,69 @@ function _r({ context: e }) {
1663
1893
  )
1664
1894
  ] });
1665
1895
  }
1666
- const Er = V(
1896
+ const ro = V(
1667
1897
  {
1668
1898
  name: "ChoicePicker",
1669
- schema: m.object({
1670
- label: m.any().optional(),
1671
- variant: m.any().optional(),
1672
- options: m.any().optional(),
1673
- value: m.any().optional(),
1674
- skoponPickerType: m.any().optional(),
1675
- placeholder: m.any().optional()
1899
+ schema: f.object({
1900
+ label: f.any().optional(),
1901
+ variant: f.any().optional(),
1902
+ options: f.any().optional(),
1903
+ value: f.any().optional(),
1904
+ skoponPickerType: f.any().optional(),
1905
+ placeholder: f.any().optional()
1676
1906
  }).passthrough()
1677
1907
  },
1678
- _r
1908
+ no
1679
1909
  );
1680
- function Rr({ context: e }) {
1681
- const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = A(o.label);
1682
- return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1910
+ function oo({ context: e }) {
1911
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = T(o.label);
1912
+ return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
1683
1913
  i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1684
1914
  /* @__PURE__ */ l(
1685
- _t,
1915
+ Lt,
1686
1916
  {
1687
1917
  disabled: !t,
1688
1918
  className: "form-block-preview-control",
1689
- checked: je(n),
1919
+ checked: le(n),
1690
1920
  onChange: (a) => r(a)
1691
1921
  }
1692
1922
  )
1693
1923
  ] });
1694
1924
  }
1695
- const Br = V(
1696
- { name: "CheckBox", schema: se("CheckBox") },
1697
- Rr
1925
+ const io = V(
1926
+ { name: "CheckBox", schema: ce("CheckBox") },
1927
+ oo
1698
1928
  );
1699
- function Or(e, t, n) {
1929
+ function ao(e, t, n) {
1700
1930
  const r = oe(e);
1701
1931
  if (!r) return;
1702
1932
  if (!t && n) {
1703
- const i = De(r, "HH:mm", !0);
1933
+ const i = Ze(r, "HH:mm", !0);
1704
1934
  return i.isValid() ? i : void 0;
1705
1935
  }
1706
- const o = De(r);
1936
+ const o = Ze(r);
1707
1937
  return o.isValid() ? o : void 0;
1708
1938
  }
1709
- function Vr({ context: e }) {
1710
- const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), s = o.enableDate === !0, c = o.enableTime === !0, u = Or(n, s, c), d = (p) => {
1711
- if (!p) {
1939
+ function so({ context: e }) {
1940
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = T(o.label), a = T(o.placeholder), s = o.enableDate === !0, c = o.enableTime === !0, u = ao(n, s, c), d = (m) => {
1941
+ if (!m) {
1712
1942
  r("");
1713
1943
  return;
1714
1944
  }
1715
1945
  if (!s && c) {
1716
- r(p.format("HH:mm"));
1946
+ r(m.format("HH:mm"));
1717
1947
  return;
1718
1948
  }
1719
1949
  if (s && c) {
1720
- r(p.format("YYYY-MM-DDTHH:mm"));
1950
+ r(m.format("YYYY-MM-DDTHH:mm"));
1721
1951
  return;
1722
1952
  }
1723
- r(p.format("YYYY-MM-DD"));
1953
+ r(m.format("YYYY-MM-DD"));
1724
1954
  };
1725
- return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1955
+ return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
1726
1956
  i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1727
1957
  !s && c ? /* @__PURE__ */ l(
1728
- Et,
1958
+ $t,
1729
1959
  {
1730
1960
  disabled: !t,
1731
1961
  className: "form-block-preview-control",
@@ -1735,7 +1965,7 @@ function Vr({ context: e }) {
1735
1965
  onChange: d
1736
1966
  }
1737
1967
  ) : /* @__PURE__ */ l(
1738
- Rt,
1968
+ Dt,
1739
1969
  {
1740
1970
  showTime: s && c,
1741
1971
  disabled: !t,
@@ -1748,175 +1978,197 @@ function Vr({ context: e }) {
1748
1978
  )
1749
1979
  ] });
1750
1980
  }
1751
- const wr = V(
1981
+ const lo = V(
1752
1982
  {
1753
1983
  name: "DateTimeInput",
1754
- schema: m.object({
1755
- label: m.any().optional(),
1756
- enableDate: m.any().optional(),
1757
- enableTime: m.any().optional(),
1758
- placeholder: m.any().optional(),
1759
- value: m.any().optional(),
1760
- min: m.any().optional(),
1761
- max: m.any().optional()
1984
+ schema: f.object({
1985
+ label: f.any().optional(),
1986
+ enableDate: f.any().optional(),
1987
+ enableTime: f.any().optional(),
1988
+ placeholder: f.any().optional(),
1989
+ value: f.any().optional(),
1990
+ min: f.any().optional(),
1991
+ max: f.any().optional()
1762
1992
  }).passthrough()
1763
1993
  },
1764
- Vr
1765
- ), qr = {
1994
+ so
1995
+ ), co = {
1766
1996
  name: "FileUpload",
1767
- schema: m.object({
1768
- label: m.any().optional(),
1769
- accept: m.any().optional(),
1770
- fileAcceptTypes: m.any().optional(),
1771
- filePlaceholderIcon: m.any().optional(),
1772
- minCount: m.any().optional(),
1773
- maxCount: m.any().optional(),
1774
- value: m.any().optional()
1997
+ schema: f.object({
1998
+ label: f.any().optional(),
1999
+ accept: f.any().optional(),
2000
+ fileAcceptTypes: f.any().optional(),
2001
+ filePlaceholderIcon: f.any().optional(),
2002
+ minCount: f.any().optional(),
2003
+ maxCount: f.any().optional(),
2004
+ value: f.any().optional()
1775
2005
  }).passthrough()
1776
2006
  };
1777
- function Lr({ context: e }) {
1778
- const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = A(o.label), a = A(o.accept), s = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((f) => f.trim()).filter(Boolean) : void 0, u = an(s, c), d = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
2007
+ function uo({ context: e }) {
2008
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = T(o.label), a = T(o.accept), s = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((p) => p.trim()).filter(Boolean) : void 0, u = hn(s, c), d = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
1779
2009
  o.filePlaceholderIcon
1780
- ) ? o.filePlaceholderIcon : "document", p = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, g = typeof o.maxCount == "number" ? o.maxCount : 1, v = g > 0, M = D(n), T = v && M.length >= g, k = M.length < p;
1781
- return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
2010
+ ) ? o.filePlaceholderIcon : "document", m = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, b = typeof o.maxCount == "number" ? o.maxCount : 1, g = b > 0, A = O(n), N = g && A.length >= b, v = A.length < m;
2011
+ return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
1782
2012
  i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1783
- /* @__PURE__ */ C(
1784
- Ce.Dragger,
2013
+ /* @__PURE__ */ k(
2014
+ Te.Dragger,
1785
2015
  {
1786
- disabled: !t || T,
1787
- accept: on(s, c),
2016
+ disabled: !t || N,
2017
+ accept: fn(s, c),
1788
2018
  className: "form-file-upload-preview",
1789
- showUploadList: t && M.length > 0,
1790
- fileList: t ? M.map((f, h) => ({
1791
- uid: `${h}-${f}`,
1792
- name: f,
2019
+ showUploadList: t && A.length > 0,
2020
+ fileList: t ? A.map((p, h) => ({
2021
+ uid: `${h}-${p}`,
2022
+ name: p,
1793
2023
  status: "done"
1794
2024
  })) : [],
1795
- beforeUpload: (f) => {
1796
- if (!t) return Ce.LIST_IGNORE;
1797
- const h = D(Ge(e));
1798
- if (v && h.length >= g) return Ce.LIST_IGNORE;
1799
- const x = v ? [...h, f.name].slice(0, g) : [...h, f.name];
2025
+ beforeUpload: (p) => {
2026
+ if (!t) return Te.LIST_IGNORE;
2027
+ const h = O(nt(e));
2028
+ if (g && h.length >= b) return Te.LIST_IGNORE;
2029
+ const x = g ? [...h, p.name].slice(0, b) : [...h, p.name];
1800
2030
  return r(x), !1;
1801
2031
  },
1802
- onRemove: (f) => {
1803
- const h = D(Ge(e)), x = /^(\d+)-/.exec(f.uid ?? ""), y = x ? Number(x[1]) : -1, S = y >= 0 && y < h.length ? h.filter((I, E) => E !== y) : h.filter((I) => I !== f.name);
1804
- if (S.length < p) return !1;
1805
- r(S);
2032
+ onRemove: (p) => {
2033
+ const h = O(nt(e)), x = /^(\d+)-/.exec(p.uid ?? ""), y = x ? Number(x[1]) : -1, C = y >= 0 && y < h.length ? h.filter((M, E) => E !== y) : h.filter((M) => M !== p.name);
2034
+ if (C.length < m) return !1;
2035
+ r(C);
1806
2036
  },
1807
2037
  children: [
1808
- /* @__PURE__ */ l("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ l(Cr, { type: d, size: 40 }) }),
2038
+ /* @__PURE__ */ l("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ l(Hr, { type: d, size: 40 }) }),
1809
2039
  /* @__PURE__ */ l("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
1810
2040
  ]
1811
2041
  }
1812
2042
  ),
1813
- /* @__PURE__ */ C(H.Text, { type: "secondary", className: "form-block-preview-help", children: [
2043
+ /* @__PURE__ */ k(D.Text, { type: "secondary", className: "form-block-preview-help", children: [
1814
2044
  "允许:",
1815
2045
  u ?? "全部类型",
1816
- p > 0 ? `;至少 ${p} 个文件` : "",
1817
- v ? `;最多 ${g} 个文件` : "",
1818
- k && t ? `(当前 ${M.length} 个,未达下限)` : ""
2046
+ m > 0 ? `;至少 ${m} 个文件` : "",
2047
+ g ? `;最多 ${b} 个文件` : "",
2048
+ ";当前仅收集文件名(不含文件内容,需宿主另行上传)",
2049
+ v && t ? `(当前 ${A.length} 个,未达下限)` : ""
1819
2050
  ] })
1820
2051
  ] });
1821
2052
  }
1822
- const jr = V(
1823
- qr,
1824
- Lr
2053
+ const po = V(
2054
+ co,
2055
+ uo
1825
2056
  );
1826
- function $r({ context: e }) {
1827
- const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), s = A(o.variant) || "shortText", c = oe(n) ?? "", u = !t, d = "form-block-preview-control";
1828
- let p;
2057
+ function mo({ context: e }) {
2058
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = T(o.label), a = T(o.placeholder), s = T(o.variant) || "shortText", c = T(o.validationRegexp), u = oe(n) ?? "", d = !t, [m, b] = _(""), g = (v) => {
2059
+ if (!c || !v.trim()) {
2060
+ b("");
2061
+ return;
2062
+ }
2063
+ b(_t(v, c) ? "" : "格式不正确");
2064
+ };
2065
+ R(() => {
2066
+ g(u);
2067
+ }, [c, u]);
2068
+ const A = "form-block-preview-control";
2069
+ let N;
1829
2070
  if (s === "longText")
1830
- p = /* @__PURE__ */ l(
1831
- ke.TextArea,
2071
+ N = /* @__PURE__ */ l(
2072
+ Ie.TextArea,
1832
2073
  {
1833
- disabled: u,
1834
- className: d,
2074
+ disabled: d,
2075
+ className: A,
1835
2076
  placeholder: a || "长文本回答...",
1836
2077
  autoSize: { minRows: 2, maxRows: 6 },
1837
- value: c,
1838
- onChange: (g) => r(g.target.value)
2078
+ value: u,
2079
+ status: m ? "error" : void 0,
2080
+ onChange: (v) => {
2081
+ const p = v.target.value;
2082
+ r(p), g(p);
2083
+ },
2084
+ onBlur: (v) => g(v.target.value)
1839
2085
  }
1840
2086
  );
1841
2087
  else if (s === "number") {
1842
- const g = c && Number.isFinite(Number(c)) ? Number(c) : void 0;
1843
- p = /* @__PURE__ */ l(
1844
- Bt,
2088
+ const v = u && Number.isFinite(Number(u)) ? Number(u) : void 0;
2089
+ N = /* @__PURE__ */ l(
2090
+ Ht,
1845
2091
  {
1846
- disabled: u,
1847
- className: d,
2092
+ disabled: d,
2093
+ className: A,
1848
2094
  style: { width: "100%" },
1849
2095
  placeholder: a || "数字",
1850
- value: g,
1851
- onChange: (v) => r(v == null ? "" : String(v))
2096
+ value: v,
2097
+ onChange: (p) => r(p == null ? "" : String(p))
1852
2098
  }
1853
2099
  );
1854
- } else s === "obscured" ? p = /* @__PURE__ */ l(
1855
- ke.Password,
2100
+ } else s === "obscured" ? N = /* @__PURE__ */ l(
2101
+ Ie.Password,
1856
2102
  {
1857
- disabled: u,
1858
- className: d,
2103
+ disabled: d,
2104
+ className: A,
1859
2105
  placeholder: a,
1860
- value: c,
1861
- onChange: (g) => r(g.target.value)
2106
+ value: u,
2107
+ onChange: (v) => r(v.target.value)
1862
2108
  }
1863
- ) : p = /* @__PURE__ */ l(
1864
- ke,
2109
+ ) : N = /* @__PURE__ */ l(
2110
+ Ie,
1865
2111
  {
1866
- disabled: u,
1867
- className: d,
2112
+ disabled: d,
2113
+ className: A,
1868
2114
  placeholder: a,
1869
- value: c,
1870
- onChange: (g) => r(g.target.value)
2115
+ value: u,
2116
+ status: m ? "error" : void 0,
2117
+ onChange: (v) => {
2118
+ const p = v.target.value;
2119
+ r(p), g(p);
2120
+ },
2121
+ onBlur: (v) => g(v.target.value)
1871
2122
  }
1872
2123
  );
1873
- return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
2124
+ return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
1874
2125
  i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1875
- p
2126
+ N,
2127
+ m ? /* @__PURE__ */ l(D.Text, { type: "danger", className: "form-block-preview-help", children: m }) : null
1876
2128
  ] });
1877
2129
  }
1878
- const Dr = V(
2130
+ const fo = V(
1879
2131
  {
1880
2132
  name: "TextField",
1881
- schema: m.object({
1882
- label: m.any().optional(),
1883
- variant: m.any().optional(),
1884
- placeholder: m.any().optional(),
1885
- validationRegexp: m.any().optional(),
1886
- value: m.any().optional()
2133
+ schema: f.object({
2134
+ label: f.any().optional(),
2135
+ variant: f.any().optional(),
2136
+ placeholder: f.any().optional(),
2137
+ validationRegexp: f.any().optional(),
2138
+ value: f.any().optional()
1887
2139
  }).passthrough()
1888
2140
  },
1889
- $r
2141
+ mo
1890
2142
  );
1891
- function Hr({ context: e }) {
1892
- const t = e.componentModel.properties, n = A(t.text), r = A(t.variant) || "body";
1893
- return Ar.has(r) ? r === "caption" ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ l("em", { children: n }) }) : /* @__PURE__ */ l(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ l(H.Paragraph, { className: "form-block-preview-paragraph", children: n });
2143
+ function ho({ context: e }) {
2144
+ const t = e.componentModel.properties, n = T(t.text), r = T(t.variant) || "body";
2145
+ return Gr.has(r) ? r === "caption" ? /* @__PURE__ */ l(D.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ l("em", { children: n }) }) : /* @__PURE__ */ l(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ l(D.Paragraph, { className: "form-block-preview-paragraph", children: n });
1894
2146
  }
1895
- const Kr = V(
1896
- { name: "Text", schema: se("Text") },
1897
- Hr
2147
+ const go = V(
2148
+ { name: "Text", schema: ce("Text") },
2149
+ ho
1898
2150
  );
1899
- function Nt() {
2151
+ function Et() {
1900
2152
  const t = [
1901
- ...[...de.components.values()].filter(
1902
- (r) => !kr.has(r.name)
2153
+ ...[...fe.components.values()].filter(
2154
+ (r) => !Kr.has(r.name)
1903
2155
  ),
1904
- Nr,
1905
- Ur,
1906
- Mr,
1907
- Ir,
1908
- Fr,
1909
- Er,
1910
- Br,
1911
- wr,
1912
- jr,
1913
- Dr,
1914
- Kr,
1915
- ...Gn()
1916
- ], n = [...de.functions.values()];
1917
- return new Dt(At, t, n, de.themeSchema);
1918
- }
1919
- const $ = {
2156
+ Yr,
2157
+ to,
2158
+ Xr,
2159
+ Wr,
2160
+ Qr,
2161
+ ro,
2162
+ io,
2163
+ lo,
2164
+ po,
2165
+ fo,
2166
+ go,
2167
+ ...nr()
2168
+ ], n = [...fe.functions.values()];
2169
+ return new Zt(Ut, t, n, fe.themeSchema);
2170
+ }
2171
+ const H = {
1920
2172
  jade9: "#29a383",
1921
2173
  jade10: "#26997b",
1922
2174
  jade11: "#208368",
@@ -1928,20 +2180,20 @@ const $ = {
1928
2180
  primaryHover: "#26997b",
1929
2181
  primaryActive: "#1d3b31",
1930
2182
  onPrimary: "#ffffff"
1931
- }, Gr = {
2183
+ }, yo = {
1932
2184
  cssVar: { key: "vidtempl" },
1933
2185
  token: {
1934
- colorPrimary: $.primarySolid,
1935
- colorPrimaryHover: $.primaryHover,
1936
- colorPrimaryActive: $.primaryActive,
1937
- colorLink: $.primary,
1938
- colorLinkHover: $.primaryHover,
1939
- colorSuccess: $.jade9,
2186
+ colorPrimary: H.primarySolid,
2187
+ colorPrimaryHover: H.primaryHover,
2188
+ colorPrimaryActive: H.primaryActive,
2189
+ colorLink: H.primary,
2190
+ colorLinkHover: H.primaryHover,
2191
+ colorSuccess: H.jade9,
1940
2192
  colorWarning: "#f5a623",
1941
2193
  gold6: "#f5a623",
1942
2194
  gold7: "#e6951a",
1943
2195
  colorError: "#e5484d",
1944
- colorInfo: $.primary,
2196
+ colorInfo: H.primary,
1945
2197
  colorBgLayout: "#f9f9f9",
1946
2198
  colorBgContainer: "#ffffff",
1947
2199
  colorBgElevated: "#ffffff",
@@ -2001,7 +2253,7 @@ const $ = {
2001
2253
  },
2002
2254
  Tag: {
2003
2255
  defaultBg: "#e6f7ed",
2004
- defaultColor: $.primary,
2256
+ defaultColor: H.primary,
2005
2257
  fontSizeSM: 13
2006
2258
  },
2007
2259
  Form: {
@@ -2018,9 +2270,9 @@ function X({
2018
2270
  locale: t,
2019
2271
  theme: n
2020
2272
  }) {
2021
- return /* @__PURE__ */ l(Ot, { theme: n ?? Gr, locale: t, children: e });
2273
+ return /* @__PURE__ */ l(Kt, { theme: n ?? yo, locale: t, children: e });
2022
2274
  }
2023
- const Jr = It(
2275
+ const vo = wt(
2024
2276
  function({
2025
2277
  doc: t,
2026
2278
  surfaceId: n = "skopon-form",
@@ -2028,54 +2280,60 @@ const Jr = It(
2028
2280
  interactive: o = !0,
2029
2281
  fieldNames: i = [],
2030
2282
  resumeSearch: a = null,
2031
- caseSearch: s = null
2032
- }, c) {
2033
- L(() => {
2034
- nt(), tt();
2283
+ caseSearch: s = null,
2284
+ wrapProvider: c = !0
2285
+ }, u) {
2286
+ R(() => {
2287
+ pt(), ut();
2035
2288
  }, []);
2036
- const u = q(null), d = q(i);
2037
- d.current = i;
2038
- const p = O(() => {
2039
- if (Re(t)) return "";
2289
+ const d = L(null), m = L(i);
2290
+ m.current = i;
2291
+ const b = q(() => {
2292
+ if (je(t)) return "";
2040
2293
  try {
2041
2294
  return JSON.stringify(t);
2042
2295
  } catch {
2043
2296
  return String(t);
2044
2297
  }
2045
- }, [t]), g = O(() => {
2046
- if (!p)
2298
+ }, [t]), g = q(() => {
2299
+ if (!b)
2047
2300
  return { surfaces: [], processor: null };
2048
2301
  try {
2049
- const T = JSON.parse(p), k = new et([Nt()]), f = or(T, {
2302
+ const p = JSON.parse(b), h = new ct([Et()]), x = dr(p, {
2050
2303
  surfaceId: n,
2051
- catalogId: At
2304
+ catalogId: Ut
2052
2305
  });
2053
- return k.processMessages(f), {
2054
- surfaces: Array.from(k.model.surfacesMap.values()),
2055
- processor: k
2306
+ return h.processMessages(x), {
2307
+ surfaces: Array.from(h.model.surfacesMap.values()),
2308
+ processor: h
2056
2309
  };
2057
- } catch (T) {
2058
- return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", T), { surfaces: [], processor: null };
2310
+ } catch (p) {
2311
+ return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", p), { surfaces: [], processor: null };
2059
2312
  }
2060
- }, [p, n]), { surfaces: v, processor: M } = g;
2061
- return u.current = M, Ft(
2062
- c,
2313
+ }, [b, n]), { surfaces: A, processor: N } = g;
2314
+ if (d.current = N, qt(
2315
+ u,
2063
2316
  () => ({
2064
- getValues(T) {
2065
- const k = u.current;
2066
- if (!k) return {};
2067
- const f = (T ?? d.current).map((h) => h.trim()).filter(Boolean);
2068
- return sr(k, n, f);
2317
+ getValues(p) {
2318
+ const h = d.current;
2319
+ if (!h) return {};
2320
+ const x = (p ?? m.current).map((y) => y.trim()).filter(Boolean);
2321
+ return yr(h, n, x);
2069
2322
  }
2070
2323
  }),
2071
2324
  [n]
2072
- ), v.length === 0 ? /* @__PURE__ */ l(X, { children: r }) : /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l(mt, { resumeSearch: a, children: /* @__PURE__ */ l(pt, { caseSearch: s, children: /* @__PURE__ */ l(it, { interactive: o, children: /* @__PURE__ */ l("div", { className: "a2ui-surface a2ui-container", children: v.map((T) => /* @__PURE__ */ l(Ze, { surface: T }, T.id)) }) }) }) }) });
2325
+ ), A.length === 0) {
2326
+ const p = /* @__PURE__ */ l(qe, { resumeSearch: a, children: /* @__PURE__ */ l(we, { caseSearch: s, children: /* @__PURE__ */ l(Be, { interactive: o, children: r }) }) });
2327
+ return c ? /* @__PURE__ */ l(X, { children: p }) : p;
2328
+ }
2329
+ const v = /* @__PURE__ */ l(qe, { resumeSearch: a, children: /* @__PURE__ */ l(we, { caseSearch: s, children: /* @__PURE__ */ l(Be, { interactive: o, children: /* @__PURE__ */ l("div", { className: "a2ui-surface a2ui-container", children: A.map((p) => /* @__PURE__ */ l(lt, { surface: p }, p.id)) }) }) }) });
2330
+ return c ? /* @__PURE__ */ l(X, { children: v }) : v;
2073
2331
  }
2074
2332
  );
2075
- function pe() {
2076
- return new et([Nt()]);
2333
+ function de() {
2334
+ return new ct([Et()]);
2077
2335
  }
2078
- function co({
2336
+ function zo({
2079
2337
  messages: e,
2080
2338
  surfaceId: t = "skopon-form-stream",
2081
2339
  emptyHint: n = null,
@@ -2083,78 +2341,78 @@ function co({
2083
2341
  resumeSearch: o = null,
2084
2342
  caseSearch: i = null
2085
2343
  }) {
2086
- L(() => {
2087
- nt(), tt();
2344
+ R(() => {
2345
+ pt(), ut();
2088
2346
  }, []);
2089
- const a = q(null);
2090
- a.current === null && (a.current = pe());
2091
- const s = q(0), c = q(""), u = q(!0), d = q(t);
2092
- function p(f, h) {
2093
- a.current = f, s.current = h.length, c.current = JSON.stringify(h), u.current && (M(f), k(Array.from(f.model.surfacesMap.values())));
2347
+ const a = L(null);
2348
+ a.current === null && (a.current = de());
2349
+ const s = L(0), c = L(""), u = L(!0), d = L(t);
2350
+ function m(p, h) {
2351
+ a.current = p, s.current = h.length, c.current = JSON.stringify(h), u.current && (A(p), v(Array.from(p.model.surfacesMap.values())));
2094
2352
  }
2095
- function g(f, h) {
2353
+ function b(p, h) {
2096
2354
  if (h <= 0) return !1;
2097
- const x = JSON.stringify(f.slice(0, h)), y = c.current;
2355
+ const x = JSON.stringify(p.slice(0, h)), y = c.current;
2098
2356
  if (!y) return !0;
2099
2357
  try {
2100
- const S = JSON.parse(y);
2101
- return JSON.stringify(S.slice(0, h)) !== x;
2358
+ const C = JSON.parse(y);
2359
+ return JSON.stringify(C.slice(0, h)) !== x;
2102
2360
  } catch {
2103
2361
  return !0;
2104
2362
  }
2105
2363
  }
2106
- const [v, M] = z(
2364
+ const [g, A] = _(
2107
2365
  () => a.current
2108
- ), [T, k] = z(
2366
+ ), [N, v] = _(
2109
2367
  () => Array.from(
2110
2368
  a.current.model.surfacesMap.values()
2111
2369
  )
2112
2370
  );
2113
- return L(() => (u.current = !0, () => {
2371
+ return R(() => (u.current = !0, () => {
2114
2372
  u.current = !1;
2115
- }), []), L(() => {
2116
- a.current = v;
2117
- }, [v]), L(() => {
2118
- const f = () => {
2119
- u.current && k(Array.from(v.model.surfacesMap.values()));
2120
- }, h = v.onSurfaceCreated(f), x = v.onSurfaceDeleted(f);
2373
+ }), []), R(() => {
2374
+ a.current = g;
2375
+ }, [g]), R(() => {
2376
+ const p = () => {
2377
+ u.current && v(Array.from(g.model.surfacesMap.values()));
2378
+ }, h = g.onSurfaceCreated(p), x = g.onSurfaceDeleted(p);
2121
2379
  return () => {
2122
2380
  h.unsubscribe(), x.unsubscribe();
2123
2381
  };
2124
- }, [v]), L(() => {
2125
- let f = !1;
2382
+ }, [g]), R(() => {
2383
+ let p = !1;
2126
2384
  const h = d.current !== t;
2127
2385
  if (d.current = t, h) {
2128
- const I = pe();
2129
- return Array.isArray(e) && e.length > 0 ? (I.processMessages(e), f || p(I, e)) : (a.current = I, s.current = 0, c.current = "", f || (M(I), k([]))), () => {
2130
- f = !0;
2386
+ const M = de();
2387
+ return Array.isArray(e) && e.length > 0 ? (M.processMessages(e), p || m(M, e)) : (a.current = M, s.current = 0, c.current = "", p || (A(M), v([]))), () => {
2388
+ p = !0;
2131
2389
  };
2132
2390
  }
2133
2391
  if (!Array.isArray(e) || e.length === 0) {
2134
2392
  if (s.current > 0) {
2135
- const I = pe();
2136
- a.current = I, s.current = 0, c.current = "", f || (M(I), k([]));
2393
+ const M = de();
2394
+ a.current = M, s.current = 0, c.current = "", p || (A(M), v([]));
2137
2395
  }
2138
2396
  return () => {
2139
- f = !0;
2397
+ p = !0;
2140
2398
  };
2141
2399
  }
2142
2400
  const x = a.current, y = s.current;
2143
- if (e.length < y || g(e, y)) {
2144
- const I = pe();
2145
- return I.processMessages(e), f || p(I, e), () => {
2146
- f = !0;
2401
+ if (e.length < y || b(e, y)) {
2402
+ const M = de();
2403
+ return M.processMessages(e), p || m(M, e), () => {
2404
+ p = !0;
2147
2405
  };
2148
2406
  }
2149
- const S = e.slice(y);
2150
- return S.length === 0 ? () => {
2151
- f = !0;
2152
- } : (x.processMessages(S), s.current = e.length, c.current = JSON.stringify(e), f || k(Array.from(x.model.surfacesMap.values())), () => {
2153
- f = !0;
2407
+ const C = e.slice(y);
2408
+ return C.length === 0 ? () => {
2409
+ p = !0;
2410
+ } : (x.processMessages(C), s.current = e.length, c.current = JSON.stringify(e), p || v(Array.from(x.model.surfacesMap.values())), () => {
2411
+ p = !0;
2154
2412
  });
2155
- }, [e, t]), T.length === 0 ? /* @__PURE__ */ l(X, { children: n }) : /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l(mt, { resumeSearch: o, children: /* @__PURE__ */ l(pt, { caseSearch: i, children: /* @__PURE__ */ l(it, { interactive: r, children: /* @__PURE__ */ l("div", { className: "a2ui-surface a2ui-container", children: T.map((f) => /* @__PURE__ */ l(Ze, { surface: f }, f.id)) }) }) }) }) });
2413
+ }, [e, t]), N.length === 0 ? /* @__PURE__ */ l(X, { children: n }) : /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l(qe, { resumeSearch: o, children: /* @__PURE__ */ l(we, { caseSearch: i, children: /* @__PURE__ */ l(Be, { interactive: r, children: /* @__PURE__ */ l("div", { className: "a2ui-surface a2ui-container", children: N.map((p) => /* @__PURE__ */ l(lt, { surface: p }, p.id)) }) }) }) }) });
2156
2414
  }
2157
- function Yr({
2415
+ function So({
2158
2416
  payload: e,
2159
2417
  callbackUrl: t,
2160
2418
  title: n,
@@ -2163,31 +2421,31 @@ function Yr({
2163
2421
  copyMode: i = "display",
2164
2422
  onNotify: a
2165
2423
  }) {
2166
- const s = O(
2167
- () => xt(e, t),
2424
+ const s = q(
2425
+ () => Nt(e, t),
2168
2426
  [e, t]
2169
- ), c = O(() => i === "submitFields" ? vr(e, t) : s, [i, e, t, s]);
2427
+ ), c = q(() => i === "submitFields" ? Nr(e, t) : s, [i, e, t, s]);
2170
2428
  async function u() {
2171
2429
  try {
2172
- await kt(c), a == null || a("success", "已复制到剪贴板");
2430
+ await Ft(c), a == null || a("success", "已复制到剪贴板");
2173
2431
  } catch {
2174
2432
  a == null || a("error", "复制失败");
2175
2433
  }
2176
2434
  }
2177
2435
  const d = i === "submitFields" ? "复制提交字段 curl(向 callback 回传)" : "复制 curl";
2178
- return /* @__PURE__ */ C("div", { className: "ask-user-curl-card", children: [
2179
- /* @__PURE__ */ C("div", { className: "ask-user-curl-card-header", children: [
2180
- /* @__PURE__ */ C("div", { className: "ask-user-curl-card-header-title", children: [
2181
- /* @__PURE__ */ l(H.Text, { type: "secondary", children: n ?? "curl 命令" }),
2436
+ return /* @__PURE__ */ k("div", { className: "ask-user-curl-card", children: [
2437
+ /* @__PURE__ */ k("div", { className: "ask-user-curl-card-header", children: [
2438
+ /* @__PURE__ */ k("div", { className: "ask-user-curl-card-header-title", children: [
2439
+ /* @__PURE__ */ l(D.Text, { type: "secondary", children: n ?? "curl 命令" }),
2182
2440
  r ? /* @__PURE__ */ l(ne, { title: r, children: /* @__PURE__ */ l(re, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
2183
2441
  o ? /* @__PURE__ */ l(ne, { title: o, children: /* @__PURE__ */ l(re, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
2184
2442
  ] }),
2185
- /* @__PURE__ */ l(ne, { title: d, children: /* @__PURE__ */ l(ge, { size: "small", type: "text", onClick: () => void u(), children: "复制" }) })
2443
+ /* @__PURE__ */ l(ne, { title: d, children: /* @__PURE__ */ l(Se, { size: "small", type: "text", onClick: () => void u(), children: "复制" }) })
2186
2444
  ] }),
2187
2445
  /* @__PURE__ */ l("pre", { className: "skopon-form-curl-json", children: s })
2188
2446
  ] });
2189
2447
  }
2190
- function Xr(e, t) {
2448
+ function bo(e, t) {
2191
2449
  if (t && typeof t == "object" && t !== null && "message" in t) {
2192
2450
  const n = t.message;
2193
2451
  if (typeof n == "string" && n.trim())
@@ -2195,7 +2453,7 @@ function Xr(e, t) {
2195
2453
  }
2196
2454
  return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
2197
2455
  }
2198
- function uo({
2456
+ function Eo({
2199
2457
  payload: e,
2200
2458
  formUniqueId: t,
2201
2459
  callbackUrl: n,
@@ -2205,46 +2463,46 @@ function uo({
2205
2463
  resumeSearch: a = null,
2206
2464
  caseSearch: s = null
2207
2465
  }) {
2208
- const [c, u] = z(null), [d, p] = z(!1), [g, v] = z(!0), [M, T] = z(!1), k = q(null), f = q(!0), h = q(i);
2466
+ const [c, u] = _(null), [d, m] = _(!1), [b, g] = _(!0), [A, N] = _(!1), v = L(null), p = L(!0), h = L(i);
2209
2467
  h.current = i;
2210
2468
  const x = (t == null ? void 0 : t.trim()) ?? "";
2211
- L(() => (f.current = !0, () => {
2212
- f.current = !1;
2213
- }), []), L(() => {
2469
+ R(() => (p.current = !0, () => {
2470
+ p.current = !1;
2471
+ }), []), R(() => {
2214
2472
  let P = !1;
2215
- return x ? (v(!0), p(!1), o({ formUniqueId: x }).then((U) => {
2216
- P || (p(!!U.disabled), u(U.formDefinition ?? null));
2473
+ return x ? (g(!0), m(!1), o({ formUniqueId: x }).then((U) => {
2474
+ P || (m(!!U.disabled), u(U.formDefinition ?? null));
2217
2475
  }).catch((U) => {
2218
- var b;
2476
+ var S;
2219
2477
  if (!P) {
2220
- p(!1), u(null);
2478
+ m(!1), u(null);
2221
2479
  const F = U instanceof Error ? U.message : "获取表单定义失败";
2222
- (b = h.current) == null || b.call(h, "error", F);
2480
+ (S = h.current) == null || S.call(h, "error", F);
2223
2481
  }
2224
2482
  }).finally(() => {
2225
- P || v(!1);
2483
+ P || g(!1);
2226
2484
  }), () => {
2227
2485
  P = !0;
2228
- }) : (v(!1), p(!1), u(null), () => {
2486
+ }) : (g(!1), m(!1), u(null), () => {
2229
2487
  P = !0;
2230
2488
  });
2231
2489
  }, [x, o]);
2232
- const y = O(() => vt(e), [e]), S = O(() => y ? dr(y, c ?? void 0) : null, [y, c]), I = (S == null ? void 0 : S.matchedBlocks) ?? [], E = !!(y && fr(y) && I.length === 0), j = O(() => E && y ? hr(y) : S && S.renderBlocks.length > 0 ? S.renderBlocks : [], [S, E, y]), Q = O(
2233
- () => E ? {} : bt((S == null ? void 0 : S.extraBlocks) ?? []),
2234
- [E, S]
2235
- ), w = O(() => E && y ? gr(y) : j.filter((P) => {
2490
+ const y = q(() => At(e), [e]), C = q(() => y ? Cr(y, c ?? void 0) : null, [y, c]), M = (C == null ? void 0 : C.matchedBlocks) ?? [], E = !!(y && kr(y) && M.length === 0), $ = q(() => E && y ? Ar(y) : C && C.renderBlocks.length > 0 ? C.renderBlocks : [], [C, E, y]), Q = q(
2491
+ () => E ? {} : Tt((C == null ? void 0 : C.extraBlocks) ?? []),
2492
+ [E, C]
2493
+ ), j = q(() => E && y ? Tr(y) : $.filter((P) => {
2236
2494
  var U;
2237
2495
  return (U = P.name) == null ? void 0 : U.trim();
2238
- }).map((P) => P.name.trim()), [E, y, j]), B = O(() => {
2239
- if (j.length === 0) return null;
2240
- const P = (S == null ? void 0 : S.title) ?? (y == null ? void 0 : y.title) ?? "", U = (S == null ? void 0 : S.description) ?? (y == null ? void 0 : y.description) ?? "";
2241
- return ar({ title: P, description: U }, j);
2242
- }, [S, y, j]), J = x ? `ask-user-${x}` : "ask-user-payload";
2243
- if (g)
2244
- return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l("div", { className: "ask-user-form-card", children: /* @__PURE__ */ l(Ve, { size: "small" }) }) });
2245
- if (!y || j.length === 0)
2496
+ }).map((P) => P.name.trim()), [E, y, $]), w = q(() => {
2497
+ if ($.length === 0) return null;
2498
+ const P = (C == null ? void 0 : C.title) ?? (y == null ? void 0 : y.title) ?? "", U = (C == null ? void 0 : C.description) ?? (y == null ? void 0 : y.description) ?? "";
2499
+ return hr({ title: P, description: U }, $);
2500
+ }, [C, y, $]), J = x ? `ask-user-${x}` : "ask-user-payload";
2501
+ if (b)
2502
+ return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l("div", { className: "ask-user-form-card", children: /* @__PURE__ */ l(De, { size: "small" }) }) });
2503
+ if (!y || $.length === 0)
2246
2504
  return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l(
2247
- Yr,
2505
+ So,
2248
2506
  {
2249
2507
  payload: e,
2250
2508
  callbackUrl: n,
@@ -2254,56 +2512,62 @@ function uo({
2254
2512
  }
2255
2513
  ) });
2256
2514
  async function Y() {
2257
- var P, U, b, F, R, N;
2258
- if (!M) {
2259
- T(!0);
2515
+ var P, U, S, F, B, I, We;
2516
+ if (!A) {
2517
+ N(!0);
2260
2518
  try {
2261
- const ee = ((P = k.current) == null ? void 0 : P.getValues(w)) ?? {}, Se = { ...ee, ...Q };
2519
+ const Z = ((P = v.current) == null ? void 0 : P.getValues(j)) ?? {}, ue = $r($, Z);
2520
+ if (ue) {
2521
+ (U = h.current) == null || U.call(h, "error", ue.message);
2522
+ return;
2523
+ }
2524
+ const Rt = { ...Z, ...Q };
2262
2525
  if (r === "post") {
2263
- const $e = (n ?? "").trim();
2264
- if (!$e) {
2265
- (U = h.current) == null || U.call(h, "error", "callback_url 为空,无法提交");
2526
+ const Qe = (n ?? "").trim();
2527
+ if (!Qe) {
2528
+ (S = h.current) == null || S.call(h, "error", "callback_url 为空,无法提交");
2266
2529
  return;
2267
2530
  }
2268
- const xe = await br($e, Se);
2269
- if (!f.current) return;
2270
- xe.ok ? (b = h.current) == null || b.call(h, "success", "提交成功") : (F = h.current) == null || F.call(h, "error", Xr(xe.status, xe.body));
2531
+ const Ae = await Mr(Qe, Rt);
2532
+ if (!p.current) return;
2533
+ Ae.ok ? (F = h.current) == null || F.call(h, "success", "提交成功") : (B = h.current) == null || B.call(h, "error", bo(Ae.status, Ae.body));
2271
2534
  return;
2272
2535
  }
2273
- if (await kt(
2274
- Ct({ cardValues: ee, extraValues: Q, callbackUrl: n })
2275
- ), !f.current) return;
2276
- (R = h.current) == null || R.call(h, "success", "已复制 curl 到剪贴板");
2277
- } catch (ee) {
2278
- if (!f.current) return;
2279
- const Se = ee instanceof Error ? ee.message : "复制失败";
2280
- (N = h.current) == null || N.call(h, "error", Se);
2536
+ if (await Ft(
2537
+ Mt({ cardValues: Z, extraValues: Q, callbackUrl: n })
2538
+ ), !p.current) return;
2539
+ (I = h.current) == null || I.call(h, "success", "已复制 curl 到剪贴板");
2540
+ } catch (Z) {
2541
+ if (!p.current) return;
2542
+ const ue = Z instanceof Error ? Z.message : "复制失败";
2543
+ (We = h.current) == null || We.call(h, "error", ue);
2281
2544
  } finally {
2282
- f.current && T(!1);
2545
+ p.current && N(!1);
2283
2546
  }
2284
2547
  }
2285
2548
  }
2286
- return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ C("div", { className: "ask-user-form-card", children: [
2549
+ return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ k("div", { className: "ask-user-form-card", children: [
2287
2550
  d && x ? /* @__PURE__ */ l("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ l(ne, { title: x, children: /* @__PURE__ */ l(re, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
2288
2551
  /* @__PURE__ */ l(
2289
- Jr,
2552
+ vo,
2290
2553
  {
2291
- ref: k,
2292
- doc: B,
2554
+ ref: v,
2555
+ doc: w,
2293
2556
  surfaceId: J,
2294
- fieldNames: w,
2557
+ fieldNames: j,
2295
2558
  interactive: !0,
2559
+ wrapProvider: !1,
2296
2560
  resumeSearch: a,
2297
2561
  caseSearch: s
2298
2562
  }
2299
2563
  ),
2300
2564
  /* @__PURE__ */ l("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ l(ne, { title: r === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ l(
2301
- ge,
2565
+ Se,
2302
2566
  {
2303
2567
  type: "primary",
2304
2568
  size: "small",
2305
- loading: M,
2306
- disabled: M,
2569
+ loading: A,
2570
+ disabled: A,
2307
2571
  onClick: () => void Y(),
2308
2572
  children: "提交"
2309
2573
  }
@@ -2311,43 +2575,50 @@ function uo({
2311
2575
  ] }) });
2312
2576
  }
2313
2577
  export {
2314
- lo as A2UI_PROTOCOL_VERSION,
2315
- uo as AskUserFormCard,
2316
- pt as CaseSearchProvider,
2317
- Yr as CurlSubmitBlock,
2318
- Ht as FORM_MEDIA_SIZES,
2319
- mt as ResumeSearchProvider,
2320
- co as SkoponA2uiStreamRenderer,
2578
+ Po as A2UI_PROTOCOL_VERSION,
2579
+ Eo as AskUserFormCard,
2580
+ we as CaseSearchProvider,
2581
+ So as CurlSubmitBlock,
2582
+ Fr as DEFAULT_AUTH_STORAGE_KEY,
2583
+ _r as DEFAULT_AUTH_TOKEN_FIELD,
2584
+ en as FORM_MEDIA_SIZES,
2585
+ qe as ResumeSearchProvider,
2586
+ zo as SkoponA2uiStreamRenderer,
2321
2587
  X as SkoponFormProvider,
2322
- Jr as SkoponFormRenderer,
2323
- rr as a2uiToBlocks,
2324
- ht as blocksToA2ui,
2325
- yr as buildAskUserCurlBodyJson,
2326
- Ct as buildAskUserCurlStatement,
2327
- vr as buildAskUserSubmitCurlFromPayload,
2328
- ar as buildAskUserSurface,
2329
- xt as buildCurlStatement,
2330
- kt as copyTextToClipboard,
2331
- so as createFormClient,
2332
- bt as extractExtraBlockValues,
2333
- sr as extractSurfaceValues,
2334
- gr as getPayloadInputFieldNames,
2335
- hr as getPayloadRenderableBlocks,
2336
- dr as intersectPayloadBlocksWithForm,
2337
- Re as isA2uiSurfaceEmpty,
2588
+ vo as SkoponFormRenderer,
2589
+ mr as a2uiToBlocks,
2590
+ Ct as blocksToA2ui,
2591
+ Ir as buildAskUserCurlBodyJson,
2592
+ Mt as buildAskUserCurlStatement,
2593
+ Nr as buildAskUserSubmitCurlFromPayload,
2594
+ hr as buildAskUserSurface,
2595
+ Nt as buildCurlStatement,
2596
+ Ft as copyTextToClipboard,
2597
+ jr as createCaseSearchClient,
2598
+ Er as createFormClient,
2599
+ wr as createResumeSearchClient,
2600
+ Uo as createSkoponSdkClients,
2601
+ Tt as extractExtraBlockValues,
2602
+ yr as extractSurfaceValues,
2603
+ Tr as getPayloadInputFieldNames,
2604
+ Ar as getPayloadRenderableBlocks,
2605
+ Cr as intersectPayloadBlocksWithForm,
2606
+ je as isA2uiSurfaceEmpty,
2338
2607
  W as isInputBlockType,
2339
- we as isLayoutBlockType,
2340
- Ue as isMediaBlockType,
2341
- lr as mapFormDefinitionFromDto,
2342
- Z as normalizeFormDefinition,
2343
- vt as parsePayloadBlocksJson,
2344
- fr as payloadHasInputBlocks,
2345
- ir as resolveSurfaceFromFormDefinition,
2346
- Gr as skoponAntdTheme,
2347
- $ as skoponBrandColors,
2348
- br as submitFormJson,
2349
- or as surfaceDocToMessages,
2350
- me as syncFormDefinition,
2351
- kn as useCaseSearch,
2352
- Un as useResumeSearch
2608
+ be as isLayoutBlockType,
2609
+ he as isMediaBlockType,
2610
+ gr as mapFormDefinitionFromDto,
2611
+ ee as normalizeFormDefinition,
2612
+ At as parsePayloadBlocksJson,
2613
+ kr as payloadHasInputBlocks,
2614
+ Xe as resolveClientHeaders,
2615
+ zr as resolveSkoponAuthHeaders,
2616
+ fr as resolveSurfaceFromFormDefinition,
2617
+ yo as skoponAntdTheme,
2618
+ H as skoponBrandColors,
2619
+ Mr as submitFormJson,
2620
+ dr as surfaceDocToMessages,
2621
+ ge as syncFormDefinition,
2622
+ Un as useCaseSearch,
2623
+ jn as useResumeSearch
2353
2624
  };