@skopon-cool/form-sdk 0.2.2 → 0.2.3

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