@skopon-cool/form-sdk 0.1.7 → 0.1.9

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,31 +1,31 @@
1
1
  import './form-sdk.css';
2
- import { jsx as s, jsxs as x, Fragment as De } from "react/jsx-runtime";
3
- import { createContext as Pe, useContext as Ee, useCallback as W, useSyncExternalStore as bt, useMemo as z, useState as E, useRef as B, useEffect as V, forwardRef as St, useImperativeHandle as kt } from "react";
4
- import { Spin as _e, Button as ue, Typography as L, Avatar as xt, Tag as Q, Select as Ce, Checkbox as At, Radio as Tt, Switch as Ct, TimePicker as It, DatePicker as Nt, Upload as ge, Input as ye, InputNumber as Ft, Tooltip as Z } from "antd";
5
- import { ReloadOutlined as Ke, FileTextOutlined as Je, UserOutlined as Mt, FileImageOutlined as Pt, FileExcelOutlined as Et, FileOutlined as He, PictureOutlined as _t, SoundOutlined as Ut, VideoCameraOutlined as zt } from "@ant-design/icons";
6
- import { createBinderlessComponentImplementation as R, basicCatalog as le, A2uiSurface as Ye } from "@a2ui/react/v0_9";
2
+ import { jsx as s, jsxs as C, Fragment as Ye } from "react/jsx-runtime";
3
+ import { createContext as ze, useContext as Re, useCallback as Q, useSyncExternalStore as Nt, useMemo as B, useState as U, useRef as q, useEffect as j, forwardRef as It, useImperativeHandle as Mt } from "react";
4
+ import { Spin as Oe, Button as fe, Typography as D, Avatar as Ft, Tag as te, Select as Fe, Checkbox as Pt, Radio as Ut, Switch as _t, TimePicker as Et, DatePicker as zt, Upload as Se, Input as xe, InputNumber as Rt, Tooltip as ee } from "antd";
5
+ import { ReloadOutlined as Xe, FileTextOutlined as Ge, UserOutlined as Ot, FileImageOutlined as Bt, FileExcelOutlined as Vt, FileOutlined as We, PictureOutlined as wt, SoundOutlined as qt, VideoCameraOutlined as jt } from "@ant-design/icons";
6
+ import { createBinderlessComponentImplementation as V, basicCatalog as ue, A2uiSurface as Ze } from "@a2ui/react/v0_9";
7
7
  import { z as d } from "zod";
8
- import { Catalog as Rt, MessageProcessor as Xe } from "@a2ui/web_core/v0_9";
9
- import { injectBasicCatalogStyles as Ge } from "@a2ui/web_core/v0_9/basic_catalog";
10
- import { injectStyles as We } from "@a2ui/react/styles";
11
- import qe from "dayjs";
12
- const Wr = "v0.9", wt = [
8
+ import { Catalog as $t, MessageProcessor as Qe } from "@a2ui/web_core/v0_9";
9
+ import { injectBasicCatalogStyles as et } from "@a2ui/web_core/v0_9/basic_catalog";
10
+ import { injectStyles as tt } from "@a2ui/react/styles";
11
+ import $e from "dayjs";
12
+ const oo = "v0.9", Lt = [
13
13
  "huge",
14
14
  "large",
15
15
  "medium",
16
16
  "small",
17
17
  "icon"
18
18
  ];
19
- function Ie(e) {
19
+ function Pe(e) {
20
20
  return e === "image" || e === "video" || e === "audio";
21
21
  }
22
- function Ue(e) {
22
+ function Be(e) {
23
23
  return e === "heading" || e === "paragraph";
24
24
  }
25
- function J(e) {
26
- return !Ue(e) && !Ie(e);
25
+ function X(e) {
26
+ return !Be(e) && !Pe(e);
27
27
  }
28
- function Ot() {
28
+ function Dt() {
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") {
@@ -39,11 +39,11 @@ function Ot() {
39
39
  return (e === "x" ? t : t & 3 | 8).toString(16);
40
40
  });
41
41
  }
42
- function te(e) {
43
- const t = Ot().replace(/-/g, "").slice(0, 8);
42
+ function re(e) {
43
+ const t = Dt().replace(/-/g, "").slice(0, 8);
44
44
  return `${e}${t}`;
45
45
  }
46
- const Ze = [
46
+ const nt = [
47
47
  { value: "image/*", label: "图片" },
48
48
  { value: "video/*", label: "视频" },
49
49
  { value: "audio/*", label: "音频" },
@@ -54,7 +54,7 @@ const Ze = [
54
54
  { value: "text/plain", label: "纯文本" },
55
55
  { value: "application/zip", label: "ZIP 压缩包" },
56
56
  { value: "application/x-rar-compressed", label: "RAR 压缩包" }
57
- ], Bt = {
57
+ ], Kt = {
58
58
  "image/*": ["image/*"],
59
59
  "video/*": ["video/*"],
60
60
  "audio/*": ["audio/*"],
@@ -74,7 +74,7 @@ const Ze = [
74
74
  "text/plain": ["text/plain"],
75
75
  "application/zip": ["application/zip"],
76
76
  "application/x-rar-compressed": ["application/x-rar-compressed"]
77
- }, Vt = {
77
+ }, Jt = {
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 Ze = [
85
85
  "text/plain": [".txt"],
86
86
  "application/zip": [".zip", ".7z"],
87
87
  "application/x-rar-compressed": [".rar"]
88
- }, qt = {
88
+ }, Ht = {
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
- }, ze = [
95
+ }, Ve = [
96
96
  { value: ".jpg", label: ".jpg" },
97
97
  { value: ".jpeg", label: ".jpeg" },
98
98
  { value: ".png", label: ".png" },
@@ -118,117 +118,121 @@ const Ze = [
118
118
  { value: ".zip", label: ".zip" },
119
119
  { value: ".rar", label: ".rar" },
120
120
  { value: ".7z", label: ".7z" }
121
- ], jt = Object.fromEntries(
122
- Ze.map((e) => [e.value, e.label])
123
- ), Lt = Object.fromEntries(
124
- ze.map((e) => [e.value, e.label])
125
- ), $t = new Set(Ze.map((e) => e.value)), Dt = new Set(
126
- ze.map((e) => e.value)
121
+ ], Yt = Object.fromEntries(
122
+ nt.map((e) => [e.value, e.label])
123
+ ), Xt = Object.fromEntries(
124
+ Ve.map((e) => [e.value, e.label])
125
+ ), Gt = new Set(nt.map((e) => e.value)), Wt = new Set(
126
+ Ve.map((e) => e.value)
127
127
  );
128
- function Kt(e) {
128
+ function Zt(e) {
129
129
  const t = e.trim();
130
- return t ? $t.has(t) ? t : qt[t] ?? null : null;
130
+ return t ? Gt.has(t) ? t : Ht[t] ?? null : null;
131
131
  }
132
- function Jt(e) {
132
+ function Qt(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}` : "";
136
136
  }).filter(Boolean) : [];
137
137
  }
138
- function ne(e) {
138
+ function oe(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 = Kt(r);
142
+ const o = Zt(r);
143
143
  o && !n.has(o) && (n.add(o), t.push(o));
144
144
  }
145
145
  return t;
146
146
  }
147
- function Ht(e) {
148
- const t = ne(e), n = [];
147
+ function en(e) {
148
+ const t = oe(e), n = [];
149
149
  for (const r of t)
150
- n.push(...Bt[r] ?? [r]);
150
+ n.push(...Kt[r] ?? [r]);
151
151
  return n;
152
152
  }
153
- function Yt(e) {
154
- const t = ne(e);
153
+ function tn(e) {
154
+ const t = oe(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 Vt[r] ?? [])
158
+ for (const o of Jt[r] ?? [])
159
159
  n.add(o);
160
- return ze.filter((r) => n.has(r.value));
160
+ return Ve.filter((r) => n.has(r.value));
161
161
  }
162
- function Re(e, t) {
163
- const n = Jt(t), r = ne(e);
162
+ function we(e, t) {
163
+ const n = Qt(t), r = oe(e);
164
164
  if (r.length === 0)
165
- return n.filter((a) => Dt.has(a));
165
+ return n.filter((i) => Wt.has(i));
166
166
  const o = new Set(
167
- Yt(r).map((a) => a.value)
167
+ tn(r).map((i) => i.value)
168
168
  );
169
- return n.filter((a) => o.has(a));
169
+ return n.filter((i) => o.has(i));
170
170
  }
171
- function Xt(e, t) {
172
- const n = Ht(e), r = Re(e, t), o = [...n, ...r];
171
+ function nn(e, t) {
172
+ const n = en(e), r = we(e, t), o = [...n, ...r];
173
173
  return o.length > 0 ? o.join(",") : void 0;
174
174
  }
175
- function Gt(e, t) {
176
- const n = ne(e), r = Re(
175
+ function rn(e, t) {
176
+ const n = oe(e), r = we(
177
177
  n,
178
178
  t
179
179
  ), o = [
180
- ...n.map((a) => jt[a] ?? a),
181
- ...r.map((a) => Lt[a] ?? a)
180
+ ...n.map((i) => Yt[i] ?? i),
181
+ ...r.map((i) => Xt[i] ?? i)
182
182
  ];
183
183
  return o.length === 0 ? null : o.join("、");
184
184
  }
185
- const Wt = [
185
+ const on = [
186
186
  "video",
187
187
  "audio",
188
188
  "image",
189
189
  "file",
190
190
  "spreadsheet",
191
191
  "document"
192
- ], Zt = new Set(Wt);
193
- function Qt(e) {
194
- return e && Zt.has(e) ? e : "file";
192
+ ], an = new Set(on);
193
+ function ln(e) {
194
+ return e && an.has(e) ? e : "file";
195
195
  }
196
- function re(e) {
197
- return typeof e == "string" && wt.includes(e) ? e : "medium";
196
+ function ie(e) {
197
+ return typeof e == "string" && Lt.includes(e) ? e : "medium";
198
198
  }
199
- function en(e, t) {
199
+ function sn(e, t) {
200
200
  var o;
201
201
  const n = Math.max(1, t);
202
202
  let r = [];
203
- return Array.isArray(e.mediaUrls) ? r = e.mediaUrls.map((a) => String(a).trim()) : (o = e.mediaUrl) != null && o.trim() && (r = [e.mediaUrl.trim()]), r.length === 0 ? [""] : r.slice(0, n);
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 tn(e) {
205
+ function cn(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 nn(e) {
210
- return `form-media-size-${re(e)}`;
209
+ function un(e) {
210
+ return `form-media-size-${ie(e)}`;
211
211
  }
212
- function rn(e) {
213
- return `form-media-preview form-media-list ${nn(e)}`;
212
+ function pn(e) {
213
+ return `form-media-preview form-media-list ${un(e)}`;
214
214
  }
215
- const on = 10;
216
- function we(e) {
215
+ const mn = 10;
216
+ function qe(e) {
217
217
  return e === !0 || e === "true";
218
218
  }
219
- function je(e, t = 1) {
219
+ function Le(e, t = 1) {
220
220
  const n = typeof e == "number" ? e : Number(e);
221
221
  return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
222
222
  }
223
- function an(e, t) {
223
+ function le(e, t = 1) {
224
+ const n = typeof e == "number" ? e : Number(e);
225
+ return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
226
+ }
227
+ function dn(e, t) {
224
228
  if (t !== void 0)
225
- return e === "toggle" ? we(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);
229
+ return e === "toggle" ? qe(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);
226
230
  }
227
- function ln(e) {
228
- 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, a = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, i = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, l = Array.isArray(e == null ? void 0 : e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
229
- return { agentKind: r, agentUniqueId: o, flowType: a, category: i, flowUniqueIds: l, pageSize: n };
231
+ function fn(e) {
232
+ 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, l = Array.isArray(e == null ? void 0 : e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
233
+ return { agentKind: r, agentUniqueId: o, flowType: i, category: a, flowUniqueIds: l, pageSize: n };
230
234
  }
231
- function sn(e) {
235
+ function hn(e) {
232
236
  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;
233
237
  return {
234
238
  names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
@@ -237,47 +241,51 @@ function sn(e) {
237
241
  pageSize: n
238
242
  };
239
243
  }
240
- function cn(e) {
244
+ function gn(e) {
241
245
  if (e.type !== "case_singleselect") return e;
242
246
  const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
243
247
  return { ...e, type: "case_multiselect", defaultValue: t };
244
248
  }
245
- function un(e) {
246
- var o, a;
247
- const t = cn(e), n = ne(t.fileAcceptTypes), r = t.type;
249
+ function yn(e) {
250
+ var o, i;
251
+ const t = gn(e), n = oe(t.fileAcceptTypes), r = t.type;
248
252
  return {
249
- id: ((o = t.id) == null ? void 0 : o.trim()) || te("block-"),
253
+ id: ((o = t.id) == null ? void 0 : o.trim()) || re("block-"),
250
254
  type: r,
251
- name: ((a = t.name) == null ? void 0 : a.trim()) || void 0,
255
+ name: ((i = t.name) == null ? void 0 : i.trim()) || void 0,
252
256
  label: t.label ?? "",
253
257
  placeholder: t.placeholder ?? "",
254
258
  help: t.help ?? "",
255
259
  required: t.required === !0,
256
- mediaUrls: Ie(r) ? en(t, on) : void 0,
257
- mediaSize: Ie(r) ? re(t.mediaSize) : void 0,
260
+ mediaUrls: Pe(r) ? sn(t, mn) : void 0,
261
+ mediaSize: Pe(r) ? ie(t.mediaSize) : void 0,
258
262
  fileAcceptTypes: n,
259
- fileAcceptExtensions: Re(
263
+ fileAcceptExtensions: we(
260
264
  n,
261
265
  t.fileAcceptExtensions
262
266
  ),
263
- filePlaceholderIcon: Qt(t.filePlaceholderIcon),
264
- fileMinCount: r === "file" ? je(t.fileMinCount, 1) : void 0,
265
- fileMaxCount: r === "file" ? je(t.fileMaxCount, 1) : void 0,
266
- defaultValue: an(r, t.defaultValue),
267
- options: Array.isArray(t.options) ? t.options.map((i, l) => {
267
+ filePlaceholderIcon: ln(t.filePlaceholderIcon),
268
+ fileMinCount: r === "file" ? Le(t.fileMinCount, 1) : void 0,
269
+ fileMaxCount: r === "file" ? Le(t.fileMaxCount, 1) : void 0,
270
+ defaultValue: dn(r, t.defaultValue),
271
+ options: Array.isArray(t.options) ? t.options.map((a, l) => {
268
272
  var c, u;
269
273
  return {
270
- value: ((c = i.value) == null ? void 0 : c.trim()) || `option_${l + 1}`,
271
- label: ((u = i.label) == null ? void 0 : u.trim()) || `选项 ${l + 1}`
274
+ value: ((c = a.value) == null ? void 0 : c.trim()) || `option_${l + 1}`,
275
+ label: ((u = a.label) == null ? void 0 : u.trim()) || `选项 ${l + 1}`
272
276
  };
273
277
  }) : void 0,
274
278
  resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
275
- resumeFilter: r === "resume_multiselect" ? sn(t.resumeFilter) : void 0,
279
+ resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? le(t.resumeMinCount, 1) : void 0,
280
+ resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? le(t.resumeMaxCount, 1) : void 0,
281
+ resumeFilter: r === "resume_multiselect" ? hn(t.resumeFilter) : void 0,
276
282
  caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
277
- caseFilter: r === "case_multiselect" ? ln(t.caseFilter) : void 0
283
+ caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? le(t.caseMinCount, 1) : void 0,
284
+ caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? le(t.caseMaxCount, 1) : void 0,
285
+ caseFilter: r === "case_multiselect" ? fn(t.caseFilter) : void 0
278
286
  };
279
287
  }
280
- function se(e) {
288
+ function pe(e) {
281
289
  return {
282
290
  title: e.title ?? "",
283
291
  description: e.description ?? "",
@@ -285,32 +293,38 @@ function se(e) {
285
293
  jsonSchema: e.jsonSchema ?? {}
286
294
  };
287
295
  }
288
- function H(e) {
296
+ function W(e) {
289
297
  if (!e || !Array.isArray(e.blocks))
290
- return se({ title: "", description: "", blocks: [], jsonSchema: {} });
291
- const t = e.blocks.map(un);
292
- return se({
298
+ return pe({ title: "", description: "", blocks: [], jsonSchema: {} });
299
+ const t = e.blocks.map(yn);
300
+ return pe({
293
301
  title: typeof e.title == "string" ? e.title : "",
294
302
  description: typeof e.description == "string" ? e.description : "",
295
303
  blocks: t,
296
304
  jsonSchema: {}
297
305
  });
298
306
  }
299
- function pn(e) {
300
- 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, a = typeof e.category == "string" && e.category.trim() ? e.category.trim() : void 0, i = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
307
+ function vn(e) {
308
+ 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) : [];
301
309
  return {
302
310
  agentKind: n,
303
311
  agentUniqueId: r,
304
312
  flowType: o,
305
- category: a,
306
- flowUniqueIds: i,
313
+ category: i,
314
+ flowUniqueIds: a,
307
315
  pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
308
316
  };
309
317
  }
310
- function mn(e, t) {
311
- var i, l, c, u, m, p;
312
- const { id: n, label: r, path: o, withData: a } = t;
313
- return a({
318
+ function De(e) {
319
+ if (e == null) return;
320
+ const t = typeof e == "number" ? e : Number(e);
321
+ if (!(!Number.isFinite(t) || t < 1))
322
+ return Math.floor(t);
323
+ }
324
+ function bn(e, t) {
325
+ var a, l, c, u, m, p;
326
+ const { id: n, label: r, path: o, withData: i } = t;
327
+ return i({
314
328
  id: n,
315
329
  component: "SkoponCaseSelect",
316
330
  label: r,
@@ -318,46 +332,52 @@ function mn(e, t) {
318
332
  help: e.help ?? "",
319
333
  enableRefresh: e.caseEnableRefresh !== !1,
320
334
  caseFilter: {
321
- agentKind: (i = e.caseFilter) == null ? void 0 : i.agentKind,
335
+ agentKind: (a = e.caseFilter) == null ? void 0 : a.agentKind,
322
336
  agentUniqueId: (l = e.caseFilter) == null ? void 0 : l.agentUniqueId,
323
337
  flowType: (c = e.caseFilter) == null ? void 0 : c.flowType,
324
338
  category: (u = e.caseFilter) == null ? void 0 : u.category,
325
339
  flowUniqueIds: ((m = e.caseFilter) == null ? void 0 : m.flowUniqueIds) ?? [],
326
340
  pageSize: ((p = e.caseFilter) == null ? void 0 : p.pageSize) ?? 20
327
341
  },
342
+ ...e.caseMinCount !== void 0 ? { minCount: e.caseMinCount } : {},
343
+ ...e.caseMaxCount !== void 0 ? { maxCount: e.caseMaxCount } : {},
328
344
  value: { path: o }
329
345
  });
330
346
  }
331
- function dn(e, t, n) {
347
+ function Sn(e, t, n) {
332
348
  const r = n.nameFromValue(e.value), o = {
333
349
  ...t("case_multiselect"),
334
350
  name: r,
335
351
  caseEnableRefresh: e.enableRefresh !== !1
336
- }, a = n.asLiteral(e.placeholder);
337
- a && (o.placeholder = a);
338
- const i = n.asLiteral(e.help);
339
- return i && (o.help = i), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = pn(e.caseFilter)), o;
340
- }
341
- const Qe = Pe({ interactive: !0 });
342
- function et({
352
+ }, i = n.asLiteral(e.placeholder);
353
+ i && (o.placeholder = i);
354
+ const a = n.asLiteral(e.help);
355
+ a && (o.help = a), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = vn(e.caseFilter));
356
+ const l = De(e.minCount);
357
+ l !== void 0 && (o.caseMinCount = l);
358
+ const c = De(e.maxCount);
359
+ return c !== void 0 && (o.caseMaxCount = c), o;
360
+ }
361
+ const rt = ze({ interactive: !0 });
362
+ function ot({
343
363
  interactive: e,
344
364
  children: t
345
365
  }) {
346
- return /* @__PURE__ */ s(Qe.Provider, { value: { interactive: e }, children: t });
366
+ return /* @__PURE__ */ s(rt.Provider, { value: { interactive: e }, children: t });
347
367
  }
348
- function $() {
349
- return Ee(Qe);
368
+ function K() {
369
+ return Re(rt);
350
370
  }
351
- function tt(e) {
371
+ function it(e) {
352
372
  return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
353
373
  }
354
- function Le(e, t = "value") {
374
+ function Ke(e, t = "value") {
355
375
  const r = e.componentModel.properties[t];
356
- if (!(!tt(r) || r === void 0))
376
+ if (!(!it(r) || r === void 0))
357
377
  return e.dataContext.resolveDynamicValue(r);
358
378
  }
359
- function D(e, t = "value") {
360
- const r = e.componentModel.properties[t], o = tt(r), a = W(
379
+ function J(e, t = "value") {
380
+ const r = e.componentModel.properties[t], o = it(r), i = Q(
361
381
  (u) => {
362
382
  if (!o || r === void 0) return () => {
363
383
  };
@@ -365,10 +385,10 @@ function D(e, t = "value") {
365
385
  return () => m.unsubscribe();
366
386
  },
367
387
  [e, r, o]
368
- ), i = W(() => {
388
+ ), a = Q(() => {
369
389
  if (!(!o || r === void 0))
370
390
  return e.dataContext.resolveDynamicValue(r);
371
- }, [e, r, o]), l = bt(a, i, i), c = W(
391
+ }, [e, r, o]), l = Nt(i, a, a), c = Q(
372
392
  (u) => {
373
393
  !o || !r || typeof r != "object" || !("path" in r) || e.dataContext.set(String(r.path), u);
374
394
  },
@@ -376,41 +396,62 @@ function D(e, t = "value") {
376
396
  );
377
397
  return { value: l, setValue: c, hasBinding: !!o };
378
398
  }
379
- function ee(e) {
399
+ function ne(e) {
380
400
  if (typeof e == "string") return e || void 0;
381
401
  if (typeof e == "number") return String(e);
382
402
  }
383
- function j(e) {
403
+ function L(e) {
384
404
  return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
385
405
  }
386
- const nt = Pe(null);
387
- function rt({
406
+ function me(e) {
407
+ if (e == null) return;
408
+ const t = typeof e == "number" ? e : Number(e);
409
+ if (!(!Number.isFinite(t) || t < 1))
410
+ return Math.floor(t);
411
+ }
412
+ function at(e, t, n, r) {
413
+ if (e.includes(t)) {
414
+ const i = e.filter((a) => a !== t);
415
+ return n !== void 0 && i.length < n ? null : i;
416
+ }
417
+ return r !== void 0 && e.length >= r ? null : [...e, t];
418
+ }
419
+ function lt(e, t, n, r, o) {
420
+ if (!n) return !0;
421
+ const i = e.includes(t);
422
+ return !!(!i && o !== void 0 && e.length >= o || i && r !== void 0 && e.length <= r);
423
+ }
424
+ function st(e, t) {
425
+ return t === void 0 || e.length <= t ? null : e.slice(0, t);
426
+ }
427
+ const ct = ze(null);
428
+ function ut({
388
429
  caseSearch: e,
389
430
  children: t
390
431
  }) {
391
- return /* @__PURE__ */ s(nt.Provider, { value: e ?? null, children: t });
432
+ return /* @__PURE__ */ s(ct.Provider, { value: e ?? null, children: t });
392
433
  }
393
- function fn() {
394
- return Ee(nt);
434
+ function xn() {
435
+ return Re(ct);
395
436
  }
396
- function ve(e) {
437
+ function Ce(e) {
397
438
  return typeof e == "string" ? e : "";
398
439
  }
399
- function be(e) {
440
+ function ke(e) {
400
441
  if (!e || typeof e != "object")
401
442
  return { flowUniqueIds: [], pageSize: 20 };
402
- 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, a = typeof t.agentUniqueId == "string" && t.agentUniqueId.trim() ? t.agentUniqueId.trim() : void 0, i = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, l = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, c = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
403
- return { agentKind: o, agentUniqueId: a, flowType: i, category: l, flowUniqueIds: c, pageSize: r };
443
+ 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, l = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, c = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
444
+ return { agentKind: o, agentUniqueId: i, flowType: a, category: l, flowUniqueIds: c, pageSize: r };
404
445
  }
405
- function Se(e) {
446
+ function Ae(e) {
406
447
  var r;
407
448
  const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
408
449
  return t || n;
409
450
  }
410
- function hn(e) {
451
+ function Cn(e) {
411
452
  return JSON.stringify(e);
412
453
  }
413
- const gn = {
454
+ const kn = {
414
455
  name: "SkoponCaseSelect",
415
456
  schema: d.object({
416
457
  label: d.any().optional(),
@@ -418,16 +459,18 @@ const gn = {
418
459
  help: d.any().optional(),
419
460
  enableRefresh: d.any().optional(),
420
461
  caseFilter: d.any().optional(),
462
+ minCount: d.any().optional(),
463
+ maxCount: d.any().optional(),
421
464
  value: d.any().optional()
422
465
  }).passthrough()
423
466
  };
424
- function yn({
467
+ function An({
425
468
  item: e,
426
469
  selected: t,
427
470
  disabled: n,
428
471
  onToggle: r
429
472
  }) {
430
- return /* @__PURE__ */ x(
473
+ return /* @__PURE__ */ C(
431
474
  "button",
432
475
  {
433
476
  type: "button",
@@ -435,11 +478,11 @@ function yn({
435
478
  disabled: n,
436
479
  onClick: r,
437
480
  children: [
438
- /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ s(Je, { style: { fontSize: 24, color: "var(--color-primary, #1677ff)" } }) }),
439
- /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-body", children: [
481
+ /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ s(Ge, { style: { fontSize: 24, color: "var(--color-primary, #1677ff)" } }) }),
482
+ /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
440
483
  /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-name", children: e.name }),
441
484
  e.description ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
442
- /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-meta", children: [
485
+ /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-meta", children: [
443
486
  e.caseUniqueId,
444
487
  e.platform ? ` · ${e.platform}` : "",
445
488
  e.link ? ` · ${e.link}` : ""
@@ -449,85 +492,107 @@ function yn({
449
492
  }
450
493
  );
451
494
  }
452
- function vn({ context: e }) {
453
- const { interactive: t } = $(), n = fn(), { value: r, setValue: o } = D(e), a = e.componentModel.properties, i = ve(a.label), l = ve(a.placeholder), c = ve(a.help), u = a.enableRefresh !== !1, m = z(() => be(a.caseFilter), [a.caseFilter]), p = hn(m), [y, S] = E(1), [C, F] = E(!1), [T, f] = E(""), [h, k] = E([]), [v, b] = E(0), [P, w] = E(m.pageSize ?? 20), U = B(0), O = j(r), q = z(() => n ? Se(m) ? T || l || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, m, T, l]), K = W(
454
- async (g) => {
455
- const A = be(JSON.parse(p)), M = ++U.current;
456
- if (!n || !Se(A)) {
457
- k([]), b(0), f("");
495
+ function Tn({ context: e }) {
496
+ const { interactive: t } = K(), n = xn(), { value: r, setValue: o } = J(e), i = e.componentModel.properties, a = Ce(i.label), l = Ce(i.placeholder), c = Ce(i.help), u = i.enableRefresh !== !1, m = me(i.minCount), p = me(i.maxCount), g = B(() => ke(i.caseFilter), [i.caseFilter]), v = Cn(g), [I, T] = U(1), [k, f] = U(!1), [h, x] = U(""), [y, S] = U([]), [M, z] = U(0), [$, G] = U(g.pageSize ?? 20), w = q(0), O = L(r);
497
+ j(() => {
498
+ const b = st(O, p);
499
+ b !== null && o(b);
500
+ }, [p, O, o]);
501
+ const H = B(() => n ? Ae(g) ? h || l || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, h, l]), Y = Q(
502
+ async (b) => {
503
+ const F = ke(JSON.parse(v)), R = ++w.current;
504
+ if (!n || !Ae(F)) {
505
+ S([]), z(0), x("");
458
506
  return;
459
507
  }
460
- F(!0), f("");
508
+ f(!0), x("");
461
509
  try {
462
- const I = await n({ filter: A, page: g });
463
- if (M !== U.current) return;
464
- k(I.list), b(I.total), S(I.page), w(I.pageSize);
465
- } catch (I) {
466
- if (M !== U.current) return;
467
- k([]), b(0), f(I instanceof Error ? I.message : "加载案例列表失败");
510
+ const N = await n({ filter: F, page: b });
511
+ if (R !== w.current) return;
512
+ S(N.list), z(N.total), T(N.page), G(N.pageSize);
513
+ } catch (N) {
514
+ if (R !== w.current) return;
515
+ S([]), z(0), x(N instanceof Error ? N.message : "加载案例列表失败");
468
516
  } finally {
469
- M === U.current && F(!1);
517
+ R === w.current && f(!1);
470
518
  }
471
519
  },
472
- [n, p]
520
+ [n, v]
473
521
  );
474
- V(() => {
475
- S(1), K(1);
476
- }, [p, K]);
477
- const Y = (g) => {
522
+ j(() => {
523
+ T(1), Y(1);
524
+ }, [v, Y]);
525
+ const P = (b) => {
478
526
  if (!t) return;
479
- const A = O.includes(g) ? O.filter((M) => M !== g) : [...O, g];
480
- o(A);
481
- }, X = () => {
482
- const g = be(JSON.parse(p)), A = P || g.pageSize || 20, M = Math.max(1, Math.ceil(v / A)), I = y >= M ? 1 : y + 1;
483
- K(I);
527
+ const F = at(
528
+ O,
529
+ b,
530
+ m,
531
+ p
532
+ );
533
+ F !== null && o(F);
534
+ }, _ = () => {
535
+ const b = ke(JSON.parse(v)), F = $ || b.pageSize || 20, R = Math.max(1, Math.ceil(M / F)), N = I >= R ? 1 : I + 1;
536
+ Y(N);
484
537
  };
485
- return /* @__PURE__ */ x("div", { className: "form-block-preview skopon-resume-select", children: [
486
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
487
- C && h.length === 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-status", children: [
488
- /* @__PURE__ */ s(_e, { size: "small" }),
538
+ return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
539
+ a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
540
+ k && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
541
+ /* @__PURE__ */ s(Oe, { size: "small" }),
489
542
  " 加载案例…"
490
543
  ] }) : null,
491
- !C && h.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: q }) : null,
492
- h.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: h.map((g) => /* @__PURE__ */ s(
493
- yn,
544
+ !k && y.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: H }) : null,
545
+ y.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ s(
546
+ An,
494
547
  {
495
- item: g,
496
- selected: O.includes(g.caseUniqueId),
497
- disabled: !t,
498
- onToggle: () => Y(g.caseUniqueId)
548
+ item: b,
549
+ selected: O.includes(b.caseUniqueId),
550
+ disabled: lt(
551
+ O,
552
+ b.caseUniqueId,
553
+ t,
554
+ m,
555
+ p
556
+ ),
557
+ onToggle: () => P(b.caseUniqueId)
499
558
  },
500
- g.caseUniqueId
559
+ b.caseUniqueId
501
560
  )) }) : null,
502
- u && n && Se(m) ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
503
- ue,
561
+ u && n && Ae(g) ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
562
+ fe,
504
563
  {
505
564
  type: "default",
506
565
  size: "small",
507
- icon: /* @__PURE__ */ s(Ke, {}),
508
- loading: C,
566
+ icon: /* @__PURE__ */ s(Xe, {}),
567
+ loading: k,
509
568
  disabled: !t,
510
- onClick: X,
569
+ onClick: _,
511
570
  children: "换一批"
512
571
  }
513
572
  ) }) : null,
514
- c ? /* @__PURE__ */ s(L.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
573
+ c ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
515
574
  ] });
516
575
  }
517
- const bn = R(
518
- gn,
519
- vn
520
- ), Sn = {
576
+ const Nn = V(
577
+ kn,
578
+ Tn
579
+ ), In = {
521
580
  type: "case_multiselect",
522
581
  componentName: "SkoponCaseSelect",
523
- toComponent: mn,
524
- fromComponent: dn,
525
- catalogComponents: [bn]
582
+ toComponent: bn,
583
+ fromComponent: Sn,
584
+ catalogComponents: [Nn]
526
585
  };
527
- function kn(e, t) {
528
- var i, l, c, u;
529
- const { id: n, label: r, path: o, withData: a } = t;
530
- return a({
586
+ function Je(e) {
587
+ if (e == null) return;
588
+ const t = typeof e == "number" ? e : Number(e);
589
+ if (!(!Number.isFinite(t) || t < 1))
590
+ return Math.floor(t);
591
+ }
592
+ function Mn(e, t) {
593
+ var a, l, c, u;
594
+ const { id: n, label: r, path: o, withData: i } = t;
595
+ return i({
531
596
  id: n,
532
597
  component: "SkoponResumeSelect",
533
598
  label: r,
@@ -535,56 +600,61 @@ function kn(e, t) {
535
600
  help: e.help ?? "",
536
601
  enableRefresh: e.resumeEnableRefresh !== !1,
537
602
  resumeFilter: {
538
- names: ((i = e.resumeFilter) == null ? void 0 : i.names) ?? [],
603
+ names: ((a = e.resumeFilter) == null ? void 0 : a.names) ?? [],
539
604
  agentUniqueIds: ((l = e.resumeFilter) == null ? void 0 : l.agentUniqueIds) ?? [],
540
605
  resumeUniqueIds: ((c = e.resumeFilter) == null ? void 0 : c.resumeUniqueIds) ?? [],
541
606
  pageSize: ((u = e.resumeFilter) == null ? void 0 : u.pageSize) ?? 20
542
607
  },
608
+ ...e.resumeMinCount !== void 0 ? { minCount: e.resumeMinCount } : {},
609
+ ...e.resumeMaxCount !== void 0 ? { maxCount: e.resumeMaxCount } : {},
543
610
  value: { path: o }
544
611
  });
545
612
  }
546
- function xn(e, t, n) {
613
+ function Fn(e, t, n) {
547
614
  const r = n.nameFromValue(e.value), o = {
548
615
  ...t("resume_multiselect"),
549
616
  name: r,
550
617
  resumeEnableRefresh: e.enableRefresh !== !1
551
- }, a = n.asLiteral(e.placeholder);
552
- a && (o.placeholder = a);
553
- const i = n.asLiteral(e.help);
554
- if (i && (o.help = i), e.resumeFilter && typeof e.resumeFilter == "object") {
555
- const l = e.resumeFilter;
618
+ }, i = n.asLiteral(e.placeholder);
619
+ i && (o.placeholder = i);
620
+ const a = n.asLiteral(e.help);
621
+ if (a && (o.help = a), e.resumeFilter && typeof e.resumeFilter == "object") {
622
+ const u = e.resumeFilter;
556
623
  o.resumeFilter = {
557
- names: Array.isArray(l.names) ? l.names.map(String) : [],
558
- agentUniqueIds: Array.isArray(l.agentUniqueIds) ? l.agentUniqueIds.map(String) : [],
559
- resumeUniqueIds: Array.isArray(l.resumeUniqueIds) ? l.resumeUniqueIds.map(String) : [],
560
- pageSize: typeof l.pageSize == "number" ? l.pageSize : 20
624
+ names: Array.isArray(u.names) ? u.names.map(String) : [],
625
+ agentUniqueIds: Array.isArray(u.agentUniqueIds) ? u.agentUniqueIds.map(String) : [],
626
+ resumeUniqueIds: Array.isArray(u.resumeUniqueIds) ? u.resumeUniqueIds.map(String) : [],
627
+ pageSize: typeof u.pageSize == "number" ? u.pageSize : 20
561
628
  };
562
629
  }
563
- return o;
630
+ const l = Je(e.minCount);
631
+ l !== void 0 && (o.resumeMinCount = l);
632
+ const c = Je(e.maxCount);
633
+ return c !== void 0 && (o.resumeMaxCount = c), o;
564
634
  }
565
- const ot = Pe(null);
566
- function at({
635
+ const pt = ze(null);
636
+ function mt({
567
637
  resumeSearch: e,
568
638
  children: t
569
639
  }) {
570
- return /* @__PURE__ */ s(ot.Provider, { value: e ?? null, children: t });
640
+ return /* @__PURE__ */ s(pt.Provider, { value: e ?? null, children: t });
571
641
  }
572
- function An() {
573
- return Ee(ot);
642
+ function Pn() {
643
+ return Re(pt);
574
644
  }
575
- function ke(e) {
645
+ function Te(e) {
576
646
  return typeof e == "string" ? e : "";
577
647
  }
578
- function xe(e) {
648
+ function Ne(e) {
579
649
  if (!e || typeof e != "object")
580
650
  return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
581
- 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) : [], a = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), i = Number.isFinite(a) && a >= 1 && a <= 100 ? Math.floor(a) : 20;
582
- return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: i };
651
+ const t = e, n = Array.isArray(t.names) ? t.names.map(String).filter(Boolean) : [], r = Array.isArray(t.agentUniqueIds) ? t.agentUniqueIds.map(String).filter(Boolean) : [], o = Array.isArray(t.resumeUniqueIds) ? t.resumeUniqueIds.map(String).filter(Boolean) : [], i = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), a = Number.isFinite(i) && i >= 1 && i <= 100 ? Math.floor(i) : 20;
652
+ return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: a };
583
653
  }
584
- function Tn(e) {
654
+ function Un(e) {
585
655
  return JSON.stringify(e);
586
656
  }
587
- const Cn = {
657
+ const _n = {
588
658
  name: "SkoponResumeSelect",
589
659
  schema: d.object({
590
660
  label: d.any().optional(),
@@ -592,42 +662,44 @@ const Cn = {
592
662
  help: d.any().optional(),
593
663
  enableRefresh: d.any().optional(),
594
664
  resumeFilter: d.any().optional(),
665
+ minCount: d.any().optional(),
666
+ maxCount: d.any().optional(),
595
667
  value: d.any().optional()
596
668
  }).passthrough()
597
- }, In = 3, Nn = 2;
598
- function Ae(e, t) {
599
- const n = (t ?? []).filter(Boolean), r = n.slice(0, In), o = n.length - r.length;
600
- return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-tags", children: [
669
+ }, En = 3, zn = 2;
670
+ function Ie(e, t) {
671
+ const n = (t ?? []).filter(Boolean), r = n.slice(0, En), o = n.length - r.length;
672
+ return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags", children: [
601
673
  /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-label", children: e }),
602
- n.length > 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-tags-list", children: [
603
- r.map((a) => /* @__PURE__ */ s(Q, { className: "skopon-resume-select-card-tag", children: a }, a)),
604
- o > 0 ? /* @__PURE__ */ x(Q, { className: "skopon-resume-select-card-tag", children: [
674
+ n.length > 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags-list", children: [
675
+ r.map((i) => /* @__PURE__ */ s(te, { className: "skopon-resume-select-card-tag", children: i }, i)),
676
+ o > 0 ? /* @__PURE__ */ C(te, { className: "skopon-resume-select-card-tag", children: [
605
677
  "+",
606
678
  o
607
679
  ] }) : null
608
680
  ] }) : /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
609
681
  ] });
610
682
  }
611
- function Fn(e) {
612
- return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-field", children: [
683
+ function Rn(e) {
684
+ return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-field", children: [
613
685
  /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
614
686
  /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
615
687
  ] });
616
688
  }
617
- function Mn({ work: e }) {
618
- return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-work", children: [
619
- /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ s("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ s(Pt, { className: "skopon-resume-select-card-work-placeholder" }) }),
689
+ function On({ work: e }) {
690
+ return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-work", children: [
691
+ /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ s("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ s(Bt, { className: "skopon-resume-select-card-work-placeholder" }) }),
620
692
  /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
621
693
  ] });
622
694
  }
623
- function Pn({
695
+ function Bn({
624
696
  item: e,
625
697
  selected: t,
626
698
  disabled: n,
627
699
  onToggle: r
628
700
  }) {
629
- const o = (e.works ?? []).slice(0, Nn);
630
- return /* @__PURE__ */ x(
701
+ const o = (e.works ?? []).slice(0, zn);
702
+ return /* @__PURE__ */ C(
631
703
  "button",
632
704
  {
633
705
  type: "button",
@@ -636,166 +708,182 @@ function Pn({
636
708
  onClick: r,
637
709
  children: [
638
710
  /* @__PURE__ */ s(
639
- xt,
711
+ Ft,
640
712
  {
641
713
  size: 48,
642
714
  src: e.avatarUrl || void 0,
643
- icon: e.avatarUrl ? void 0 : /* @__PURE__ */ s(Mt, {}),
715
+ icon: e.avatarUrl ? void 0 : /* @__PURE__ */ s(Ot, {}),
644
716
  className: "skopon-resume-select-card-avatar"
645
717
  }
646
718
  ),
647
719
  /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
648
- /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-body", children: [
649
- Fn(e.satisfaction),
650
- Ae("性格", e.personality),
651
- Ae("专长", e.specialties),
652
- Ae("擅长领域", e.traits),
653
- /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-works", children: [
720
+ /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
721
+ Rn(e.satisfaction),
722
+ Ie("性格", e.personality),
723
+ Ie("专长", e.specialties),
724
+ Ie("擅长领域", e.traits),
725
+ /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-works", children: [
654
726
  /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
655
- o.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-list", children: o.map((a, i) => /* @__PURE__ */ s(Mn, { work: a }, `${a.title}-${i}`)) }) : /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
727
+ o.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, a) => /* @__PURE__ */ s(On, { work: i }, `${i.title}-${a}`)) }) : /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
656
728
  ] })
657
729
  ] })
658
730
  ]
659
731
  }
660
732
  );
661
733
  }
662
- function En({ context: e }) {
663
- const { interactive: t } = $(), n = An(), { value: r, setValue: o } = D(e), a = e.componentModel.properties, i = ke(a.label), l = ke(a.placeholder), c = ke(a.help), u = a.enableRefresh !== !1, m = z(() => xe(a.resumeFilter), [a.resumeFilter]), p = Tn(m), [y, S] = E(1), [C, F] = E(!1), [T, f] = E(""), [h, k] = E([]), [v, b] = E(0), [P, w] = E(m.pageSize ?? 20), U = B(0), O = j(r), q = W(
664
- async (g) => {
665
- const A = xe(JSON.parse(p)), M = ++U.current;
734
+ function Vn({ context: e }) {
735
+ const { interactive: t } = K(), n = Pn(), { value: r, setValue: o } = J(e), i = e.componentModel.properties, a = Te(i.label), l = Te(i.placeholder), c = Te(i.help), u = i.enableRefresh !== !1, m = me(i.minCount), p = me(i.maxCount), g = B(() => Ne(i.resumeFilter), [i.resumeFilter]), v = Un(g), [I, T] = U(1), [k, f] = U(!1), [h, x] = U(""), [y, S] = U([]), [M, z] = U(0), [$, G] = U(g.pageSize ?? 20), w = q(0), O = L(r);
736
+ j(() => {
737
+ const b = st(O, p);
738
+ b !== null && o(b);
739
+ }, [p, O, o]);
740
+ const H = Q(
741
+ async (b) => {
742
+ const F = Ne(JSON.parse(v)), R = ++w.current;
666
743
  if (!n) {
667
- k([]), b(0), f("未配置简历搜索服务");
744
+ S([]), z(0), x("未配置简历搜索服务");
668
745
  return;
669
746
  }
670
- F(!0), f("");
747
+ f(!0), x("");
671
748
  try {
672
- const I = await n({ filter: A, page: g });
673
- if (M !== U.current) return;
674
- k(I.list), b(I.total), S(I.page), w(I.pageSize);
675
- } catch (I) {
676
- if (M !== U.current) return;
677
- k([]), b(0), f(I instanceof Error ? I.message : "加载简历列表失败");
749
+ const N = await n({ filter: F, page: b });
750
+ if (R !== w.current) return;
751
+ S(N.list), z(N.total), T(N.page), G(N.pageSize);
752
+ } catch (N) {
753
+ if (R !== w.current) return;
754
+ S([]), z(0), x(N instanceof Error ? N.message : "加载简历列表失败");
678
755
  } finally {
679
- M === U.current && F(!1);
756
+ R === w.current && f(!1);
680
757
  }
681
758
  },
682
- [n, p]
759
+ [n, v]
683
760
  );
684
- V(() => {
685
- S(1), q(1);
686
- }, [p, q]);
687
- const K = (g) => {
761
+ j(() => {
762
+ T(1), H(1);
763
+ }, [v, H]);
764
+ const Y = (b) => {
688
765
  if (!t) return;
689
- const A = O.includes(g) ? O.filter((M) => M !== g) : [...O, g];
690
- o(A);
691
- }, Y = () => {
692
- const g = xe(JSON.parse(p)), A = P || g.pageSize || 20, M = Math.max(1, Math.ceil(v / A)), I = y >= M ? 1 : y + 1;
693
- q(I);
694
- }, X = l || "暂无匹配的简历";
695
- return /* @__PURE__ */ x("div", { className: "form-block-preview skopon-resume-select", children: [
696
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
697
- C && h.length === 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-status", children: [
698
- /* @__PURE__ */ s(_e, { size: "small" }),
766
+ const F = at(
767
+ O,
768
+ b,
769
+ m,
770
+ p
771
+ );
772
+ F !== null && o(F);
773
+ }, P = () => {
774
+ const b = Ne(JSON.parse(v)), F = $ || b.pageSize || 20, R = Math.max(1, Math.ceil(M / F)), N = I >= R ? 1 : I + 1;
775
+ H(N);
776
+ }, _ = l || "暂无匹配的简历";
777
+ return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
778
+ a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
779
+ k && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
780
+ /* @__PURE__ */ s(Oe, { size: "small" }),
699
781
  " 加载简历…"
700
782
  ] }) : null,
701
- !C && T ? /* @__PURE__ */ s(L.Text, { type: "danger", className: "skopon-resume-select-status", children: T }) : null,
702
- !C && !T && h.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: X }) : null,
703
- h.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: h.map((g) => /* @__PURE__ */ s(
704
- Pn,
783
+ !k && h ? /* @__PURE__ */ s(D.Text, { type: "danger", className: "skopon-resume-select-status", children: h }) : null,
784
+ !k && !h && y.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: _ }) : null,
785
+ y.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ s(
786
+ Bn,
705
787
  {
706
- item: g,
707
- selected: O.includes(g.resumeUniqueId),
708
- disabled: !t,
709
- onToggle: () => K(g.resumeUniqueId)
788
+ item: b,
789
+ selected: O.includes(b.resumeUniqueId),
790
+ disabled: lt(
791
+ O,
792
+ b.resumeUniqueId,
793
+ t,
794
+ m,
795
+ p
796
+ ),
797
+ onToggle: () => Y(b.resumeUniqueId)
710
798
  },
711
- g.resumeUniqueId
799
+ b.resumeUniqueId
712
800
  )) }) : null,
713
801
  u && n ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
714
- ue,
802
+ fe,
715
803
  {
716
804
  type: "default",
717
805
  size: "small",
718
- icon: /* @__PURE__ */ s(Ke, {}),
719
- loading: C,
806
+ icon: /* @__PURE__ */ s(Xe, {}),
807
+ loading: k,
720
808
  disabled: !t,
721
- onClick: Y,
809
+ onClick: P,
722
810
  children: "换一批"
723
811
  }
724
812
  ) }) : null,
725
- c ? /* @__PURE__ */ s(L.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
813
+ c ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
726
814
  ] });
727
815
  }
728
- const _n = R(
729
- Cn,
730
- En
731
- ), Un = {
816
+ const wn = V(
817
+ _n,
818
+ Vn
819
+ ), qn = {
732
820
  type: "resume_multiselect",
733
821
  componentName: "SkoponResumeSelect",
734
- toComponent: kn,
735
- fromComponent: xn,
736
- catalogComponents: [_n]
737
- }, pe = [Un, Sn], zn = new Map(
738
- pe.map((e) => [e.type, e])
739
- ), Rn = new Map(
740
- pe.map((e) => [e.componentName, e])
822
+ toComponent: Mn,
823
+ fromComponent: Fn,
824
+ catalogComponents: [wn]
825
+ }, he = [qn, In], jn = new Map(
826
+ he.map((e) => [e.type, e])
827
+ ), $n = new Map(
828
+ he.map((e) => [e.componentName, e])
741
829
  );
742
- function wn(e) {
743
- return zn.get(e);
830
+ function Ln(e) {
831
+ return jn.get(e);
744
832
  }
745
- function On(e) {
746
- return Rn.get(e);
833
+ function Dn(e) {
834
+ return $n.get(e);
747
835
  }
748
- function Bn() {
749
- return pe.flatMap((e) => e.catalogComponents);
836
+ function Kn() {
837
+ return he.flatMap((e) => e.catalogComponents);
750
838
  }
751
- function Vn() {
752
- return pe.map((e) => e.componentName);
839
+ function Jn() {
840
+ return he.map((e) => e.componentName);
753
841
  }
754
- const ce = "root", Ne = "__title__", Fe = "__desc__", it = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
755
- function qn(e) {
842
+ const de = "root", Ue = "__title__", _e = "__desc__", dt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
843
+ function Hn(e) {
756
844
  return `/${e}`;
757
845
  }
758
- function $e(e) {
846
+ function He(e) {
759
847
  return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
760
848
  }
761
- function _(e) {
849
+ function E(e) {
762
850
  if (typeof e == "string") return e;
763
851
  }
764
- function jn(e) {
765
- const t = e.id || te("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
852
+ function Yn(e) {
853
+ const t = e.id || re("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
766
854
  return {
767
855
  id: t,
768
856
  component: "SkoponMedia",
769
857
  mediaType: n,
770
- urls: tn(e),
771
- mediaSize: re(e.mediaSize),
858
+ urls: cn(e),
859
+ mediaSize: ie(e.mediaSize),
772
860
  label: e.label ?? "",
773
861
  help: e.help ?? "",
774
862
  placeholder: e.placeholder ?? ""
775
863
  };
776
864
  }
777
- function Ln(e) {
865
+ function Xn(e) {
778
866
  if (Array.isArray(e.urls))
779
867
  return e.urls.map((n) => String(n).trim()).filter(Boolean);
780
- const t = _(e.url);
868
+ const t = E(e.url);
781
869
  return t != null && t.trim() ? [t.trim()] : [];
782
870
  }
783
- function ae(e, t, n) {
784
- const r = typeof e.id == "string" ? e.id : te("block-"), o = Ln(e), a = _(e.label) ?? _(e.description) ?? n, i = _(e.help), l = _(e.placeholder), c = re(e.mediaSize);
871
+ function se(e, t, n) {
872
+ const r = typeof e.id == "string" ? e.id : re("block-"), o = Xn(e), i = E(e.label) ?? E(e.description) ?? n, a = E(e.help), l = E(e.placeholder), c = ie(e.mediaSize);
785
873
  return {
786
874
  id: r,
787
875
  type: t,
788
- label: a,
789
- ...i ? { help: i } : {},
876
+ label: i,
877
+ ...a ? { help: a } : {},
790
878
  ...l ? { placeholder: l } : {},
791
879
  mediaSize: c,
792
880
  mediaUrls: o.length > 0 ? o : [""]
793
881
  };
794
882
  }
795
- function $n(e) {
883
+ function Gn(e) {
796
884
  switch (e.type) {
797
885
  case "toggle":
798
- return we(e.defaultValue);
886
+ return qe(e.defaultValue);
799
887
  case "multiselect":
800
888
  case "checkbox":
801
889
  case "resume_multiselect":
@@ -809,9 +897,9 @@ function $n(e) {
809
897
  return typeof e.defaultValue == "string" ? e.defaultValue : "";
810
898
  }
811
899
  }
812
- function Dn(e) {
900
+ function Wn(e) {
813
901
  var u;
814
- const t = e.id || te("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? qn(r) : void 0, a = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), i = (m) => r ? { node: m, dataKey: r, dataValue: $n(e) } : { node: m }, l = { id: t, label: n, name: r, path: o, withData: i }, c = wn(e.type);
902
+ const t = e.id || re("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? Hn(r) : void 0, i = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), a = (m) => r ? { node: m, dataKey: r, dataValue: Gn(e) } : { node: m }, l = { id: t, label: n, name: r, path: o, withData: a }, c = Ln(e.type);
815
903
  if (c)
816
904
  return c.toComponent(e, l);
817
905
  switch (e.type) {
@@ -822,7 +910,7 @@ function Dn(e) {
822
910
  case "text":
823
911
  case "tel":
824
912
  case "url":
825
- return i({
913
+ return a({
826
914
  id: t,
827
915
  component: "TextField",
828
916
  label: n,
@@ -831,17 +919,17 @@ function Dn(e) {
831
919
  value: { path: o }
832
920
  });
833
921
  case "email":
834
- return i({
922
+ return a({
835
923
  id: t,
836
924
  component: "TextField",
837
925
  label: n,
838
926
  variant: "shortText",
839
- validationRegexp: it,
927
+ validationRegexp: dt,
840
928
  ...e.placeholder ? { placeholder: e.placeholder } : {},
841
929
  value: { path: o }
842
930
  });
843
931
  case "textarea":
844
- return i({
932
+ return a({
845
933
  id: t,
846
934
  component: "TextField",
847
935
  label: n,
@@ -850,7 +938,7 @@ function Dn(e) {
850
938
  value: { path: o }
851
939
  });
852
940
  case "number":
853
- return i({
941
+ return a({
854
942
  id: t,
855
943
  component: "TextField",
856
944
  label: n,
@@ -859,49 +947,49 @@ function Dn(e) {
859
947
  value: { path: o }
860
948
  });
861
949
  case "select":
862
- return i({
950
+ return a({
863
951
  id: t,
864
952
  component: "SkoponSelect",
865
953
  label: n,
866
954
  mode: "single",
867
955
  placeholder: e.placeholder ?? "",
868
- options: a,
956
+ options: i,
869
957
  value: { path: o }
870
958
  });
871
959
  case "radio":
872
- return i({
960
+ return a({
873
961
  id: t,
874
962
  component: "ChoicePicker",
875
963
  label: n,
876
964
  variant: "mutuallyExclusive",
877
965
  skoponPickerType: "radio",
878
- options: a,
966
+ options: i,
879
967
  value: { path: o }
880
968
  });
881
969
  case "multiselect":
882
- return i({
970
+ return a({
883
971
  id: t,
884
972
  component: "SkoponSelect",
885
973
  label: n,
886
974
  mode: "multiple",
887
975
  placeholder: e.placeholder ?? "",
888
- options: a,
976
+ options: i,
889
977
  value: { path: o }
890
978
  });
891
979
  case "checkbox":
892
- return i({
980
+ return a({
893
981
  id: t,
894
982
  component: "ChoicePicker",
895
983
  label: n,
896
984
  variant: "multipleSelection",
897
985
  skoponPickerType: "checkbox",
898
- options: a,
986
+ options: i,
899
987
  value: { path: o }
900
988
  });
901
989
  case "toggle":
902
- return i({ id: t, component: "CheckBox", label: n, value: { path: o } });
990
+ return a({ id: t, component: "CheckBox", label: n, value: { path: o } });
903
991
  case "datetime":
904
- return i({
992
+ return a({
905
993
  id: t,
906
994
  component: "DateTimeInput",
907
995
  label: n,
@@ -911,7 +999,7 @@ function Dn(e) {
911
999
  value: { path: o }
912
1000
  });
913
1001
  case "time":
914
- return i({
1002
+ return a({
915
1003
  id: t,
916
1004
  component: "DateTimeInput",
917
1005
  label: n,
@@ -922,9 +1010,9 @@ function Dn(e) {
922
1010
  case "image":
923
1011
  case "video":
924
1012
  case "audio":
925
- return { node: jn(e) };
1013
+ return { node: Yn(e) };
926
1014
  case "file":
927
- return i({
1015
+ return a({
928
1016
  id: t,
929
1017
  component: "FileUpload",
930
1018
  label: n,
@@ -939,31 +1027,31 @@ function Dn(e) {
939
1027
  return { node: null };
940
1028
  }
941
1029
  }
942
- function Me(e) {
1030
+ function Ee(e) {
943
1031
  if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
944
- const t = e.components.find((r) => r.id === ce);
1032
+ const t = e.components.find((r) => r.id === de);
945
1033
  if (!t) return e.components.length === 0;
946
1034
  const n = t.children;
947
1035
  return !Array.isArray(n) || n.length === 0;
948
1036
  }
949
- function lt(e, t) {
950
- const n = [], r = [], o = {}, a = (t == null ? void 0 : t.includeHeader) !== !1, i = (e.title ?? "").trim(), l = (e.description ?? "").trim();
951
- a && i && (n.push({ id: Ne, component: "Text", text: i, variant: "h2" }), r.push(Ne)), a && l && (n.push({ id: Fe, component: "Text", text: l, variant: "body" }), r.push(Fe));
1037
+ function ft(e, t) {
1038
+ const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, a = (e.title ?? "").trim(), l = (e.description ?? "").trim();
1039
+ i && a && (n.push({ id: Ue, component: "Text", text: a, variant: "h2" }), r.push(Ue)), i && l && (n.push({ id: _e, component: "Text", text: l, variant: "body" }), r.push(_e));
952
1040
  for (const m of e.blocks ?? []) {
953
- const { node: p, dataKey: y, dataValue: S } = Dn(m);
954
- p && (n.push(p), r.push(p.id), y && (o[y] = S));
1041
+ const { node: p, dataKey: g, dataValue: v } = Wn(m);
1042
+ p && (n.push(p), r.push(p.id), g && (o[g] = v));
955
1043
  }
956
- n.unshift({ id: ce, component: "Column", children: r });
957
- const c = { root: ce, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1044
+ n.unshift({ id: de, component: "Column", children: r });
1045
+ const c = { root: de, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
958
1046
  return u !== void 0 && (c.surfaceProperties = { styleId: u ?? null }), c;
959
1047
  }
960
- function Kn(e) {
1048
+ function Zn(e) {
961
1049
  const t = /* @__PURE__ */ new Map();
962
1050
  for (const n of e.components ?? [])
963
1051
  n && typeof n.id == "string" && t.set(n.id, n);
964
1052
  return t;
965
1053
  }
966
- function Te(e) {
1054
+ function Me(e) {
967
1055
  const t = e.options;
968
1056
  return Array.isArray(t) ? t.map((n) => {
969
1057
  if (!n || typeof n != "object") return null;
@@ -974,10 +1062,10 @@ function Te(e) {
974
1062
  };
975
1063
  }).filter((n) => !!n) : [];
976
1064
  }
977
- function Jn(e) {
978
- const t = typeof e.id == "string" ? e.id : te("block-"), n = String(e.component ?? ""), r = _(e.label) ?? _(e.text) ?? "", o = $e(e.value), a = (l) => ({ id: t, type: l, label: r }), i = On(n);
979
- if (i)
980
- return i.fromComponent(e, a, { asLiteral: _, nameFromValue: $e });
1065
+ function Qn(e) {
1066
+ const t = typeof e.id == "string" ? e.id : re("block-"), n = String(e.component ?? ""), r = E(e.label) ?? E(e.text) ?? "", o = He(e.value), i = (l) => ({ id: t, type: l, label: r }), a = Dn(n);
1067
+ if (a)
1068
+ return a.fromComponent(e, i, { asLiteral: E, nameFromValue: He });
981
1069
  switch (n) {
982
1070
  case "Text": {
983
1071
  const l = String(e.variant ?? "body"), c = /^h[1-6]$/i.test(l) || l === "title" || l === "subtitle";
@@ -986,104 +1074,104 @@ function Jn(e) {
986
1074
  case "TextField": {
987
1075
  const l = String(e.variant ?? "shortText");
988
1076
  let c = "text";
989
- l === "longText" ? c = "textarea" : l === "number" ? c = "number" : _(e.validationRegexp) === it && (c = "email");
990
- const u = { ...a(c), name: o }, m = _(e.placeholder);
1077
+ l === "longText" ? c = "textarea" : l === "number" ? c = "number" : E(e.validationRegexp) === dt && (c = "email");
1078
+ const u = { ...i(c), name: o }, m = E(e.placeholder);
991
1079
  return m && (u.placeholder = m), u;
992
1080
  }
993
1081
  case "CheckBox":
994
- return { ...a("toggle"), name: o };
1082
+ return { ...i("toggle"), name: o };
995
1083
  case "SkoponSelect": {
996
1084
  const c = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", u = {
997
- ...a(c),
1085
+ ...i(c),
998
1086
  name: o,
999
- options: Te(e)
1000
- }, m = _(e.placeholder);
1087
+ options: Me(e)
1088
+ }, m = E(e.placeholder);
1001
1089
  return m && (u.placeholder = m), u;
1002
1090
  }
1003
1091
  case "ChoicePicker": {
1004
- const l = _(e.skoponPickerType);
1092
+ const l = E(e.skoponPickerType);
1005
1093
  if (l === "select" || l === "multiselect" || l === "radio" || l === "checkbox") {
1006
1094
  const m = {
1007
- ...a(l),
1095
+ ...i(l),
1008
1096
  name: o,
1009
- options: Te(e)
1010
- }, p = _(e.placeholder);
1097
+ options: Me(e)
1098
+ }, p = E(e.placeholder);
1011
1099
  return p && (m.placeholder = p), m;
1012
1100
  }
1013
1101
  const u = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
1014
- return { ...a(u), name: o, options: Te(e) };
1102
+ return { ...i(u), name: o, options: Me(e) };
1015
1103
  }
1016
1104
  case "DateTimeInput": {
1017
- const l = e.enableDate === !0, c = e.enableTime === !0, m = { ...a(!l && c ? "time" : "datetime"), name: o }, p = _(e.placeholder);
1105
+ const l = e.enableDate === !0, c = e.enableTime === !0, m = { ...i(!l && c ? "time" : "datetime"), name: o }, p = E(e.placeholder);
1018
1106
  return p && (m.placeholder = p), m;
1019
1107
  }
1020
1108
  case "SkoponMedia": {
1021
1109
  const l = String(e.mediaType ?? "image");
1022
- return ae(e, l === "video" ? "video" : l === "audio" ? "audio" : "image", r);
1110
+ return se(e, l === "video" ? "video" : l === "audio" ? "audio" : "image", r);
1023
1111
  }
1024
1112
  case "Image":
1025
- return ae(e, "image", r);
1113
+ return se(e, "image", r);
1026
1114
  case "Video":
1027
- return ae(e, "video", r);
1115
+ return se(e, "video", r);
1028
1116
  case "AudioPlayer":
1029
- return ae(e, "audio", r);
1117
+ return se(e, "audio", r);
1030
1118
  case "FileUpload": {
1031
- const l = _(e.accept) ?? "", c = { ...a("file"), name: o };
1119
+ const l = E(e.accept) ?? "", c = { ...i("file"), name: o };
1032
1120
  return l && (c.fileAcceptExtensions = l.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;
1033
1121
  }
1034
1122
  default:
1035
1123
  return null;
1036
1124
  }
1037
1125
  }
1038
- function st(e, t, n, r) {
1126
+ function ht(e, t, n, r) {
1039
1127
  if (n.has(e)) return;
1040
1128
  n.add(e);
1041
1129
  const o = t.get(e);
1042
1130
  if (!o) return;
1043
- const a = String(o.component ?? "");
1044
- if ((a === "Column" || a === "Row") && Array.isArray(o.children)) {
1045
- for (const i of o.children)
1046
- typeof i == "string" && st(i, t, n, r);
1131
+ const i = String(o.component ?? "");
1132
+ if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
1133
+ for (const a of o.children)
1134
+ typeof a == "string" && ht(a, t, n, r);
1047
1135
  return;
1048
1136
  }
1049
1137
  r.push(o);
1050
1138
  }
1051
- function Hn(e, t) {
1139
+ function er(e, t) {
1052
1140
  return t ? e.map((n) => {
1053
- var a;
1054
- const r = (a = n.name) == null ? void 0 : a.trim();
1141
+ var i;
1142
+ const r = (i = n.name) == null ? void 0 : i.trim();
1055
1143
  if (!r || !(r in t)) return n;
1056
1144
  const o = t[r];
1057
1145
  return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: o === !0 || o === "true" } : { ...n, defaultValue: o };
1058
1146
  }) : e;
1059
1147
  }
1060
- function Yn(e) {
1148
+ function tr(e) {
1061
1149
  if (!e || !Array.isArray(e.components))
1062
- return se({ title: "", description: "", blocks: [], jsonSchema: {} });
1063
- const t = Kn(e), n = [];
1064
- st(e.root ?? ce, t, /* @__PURE__ */ new Set(), n);
1150
+ return pe({ title: "", description: "", blocks: [], jsonSchema: {} });
1151
+ const t = Zn(e), n = [];
1152
+ ht(e.root ?? de, t, /* @__PURE__ */ new Set(), n);
1065
1153
  let r = "", o = "";
1066
- const a = [];
1067
- for (const i of n) {
1068
- if (i.id === Ne) {
1069
- r = _(i.text) ?? r;
1154
+ const i = [];
1155
+ for (const a of n) {
1156
+ if (a.id === Ue) {
1157
+ r = E(a.text) ?? r;
1070
1158
  continue;
1071
1159
  }
1072
- if (i.id === Fe) {
1073
- o = _(i.text) ?? o;
1160
+ if (a.id === _e) {
1161
+ o = E(a.text) ?? o;
1074
1162
  continue;
1075
1163
  }
1076
- const l = Jn(i);
1077
- l && a.push(l);
1164
+ const l = Qn(a);
1165
+ l && i.push(l);
1078
1166
  }
1079
- return se({
1167
+ return pe({
1080
1168
  title: r,
1081
1169
  description: o,
1082
- blocks: Hn(a, e.dataModel),
1170
+ blocks: er(i, e.dataModel),
1083
1171
  jsonSchema: {}
1084
1172
  });
1085
1173
  }
1086
- function Xn(e, t) {
1174
+ function nr(e, t) {
1087
1175
  const { surfaceId: n, catalogId: r } = t, o = [
1088
1176
  { version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
1089
1177
  {
@@ -1096,24 +1184,24 @@ function Xn(e, t) {
1096
1184
  updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
1097
1185
  }), o;
1098
1186
  }
1099
- function ct(e) {
1187
+ function gt(e) {
1100
1188
  return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
1101
1189
  }
1102
- function Gn(e, t) {
1190
+ function rr(e, t) {
1103
1191
  if (!e || typeof e != "object") return null;
1104
- const n = e, r = ct(n.a2ui) ? n.a2ui : void 0;
1105
- if (r && !Me(r)) return r;
1192
+ const n = e, r = gt(n.a2ui) ? n.a2ui : void 0;
1193
+ if (r && !Ee(r)) return r;
1106
1194
  const o = Array.isArray(n.blocks) ? n.blocks : [];
1107
1195
  if (o.length === 0) return null;
1108
- const a = H({
1196
+ const i = W({
1109
1197
  title: typeof n.title == "string" ? n.title : "",
1110
1198
  description: typeof n.description == "string" ? n.description : "",
1111
1199
  blocks: o
1112
- }), i = lt(a, t);
1113
- return Me(i) ? null : i;
1200
+ }), a = ft(i, t);
1201
+ return Ee(a) ? null : a;
1114
1202
  }
1115
- function Wn(e, t, n) {
1116
- return lt(
1203
+ function or(e, t, n) {
1204
+ return ft(
1117
1205
  {
1118
1206
  title: e.title,
1119
1207
  description: e.description,
@@ -1122,88 +1210,88 @@ function Wn(e, t, n) {
1122
1210
  n
1123
1211
  );
1124
1212
  }
1125
- function Zn(e) {
1213
+ function ir(e) {
1126
1214
  if (!e || typeof e != "object" || Array.isArray(e))
1127
1215
  return;
1128
1216
  const t = e;
1129
- return !(Array.isArray(t.blocks) && t.blocks.length > 0) && ct(t.a2ui) ? Yn(t.a2ui) : H({
1217
+ return !(Array.isArray(t.blocks) && t.blocks.length > 0) && gt(t.a2ui) ? tr(t.a2ui) : W({
1130
1218
  title: typeof t.title == "string" ? t.title : "",
1131
1219
  description: typeof t.description == "string" ? t.description : "",
1132
1220
  blocks: Array.isArray(t.blocks) ? t.blocks : []
1133
1221
  });
1134
1222
  }
1135
- function Qn(e, t, n) {
1223
+ function ar(e, t, n) {
1136
1224
  const r = e.model.surfacesMap.get(t);
1137
1225
  if (!r) return {};
1138
1226
  const o = {};
1139
- for (const a of n) {
1140
- const i = a.trim();
1141
- i && (o[i] = r.dataModel.get(`/${i}`));
1227
+ for (const i of n) {
1228
+ const a = i.trim();
1229
+ a && (o[a] = r.dataModel.get(`/${a}`));
1142
1230
  }
1143
1231
  return o;
1144
1232
  }
1145
- function er(e) {
1146
- return H({
1233
+ function lr(e) {
1234
+ return W({
1147
1235
  title: "",
1148
1236
  description: "",
1149
1237
  blocks: [e]
1150
1238
  }).blocks[0];
1151
1239
  }
1152
- function tr(e, t) {
1153
- var o, a;
1240
+ function sr(e, t) {
1241
+ var o, i;
1154
1242
  const n = /* @__PURE__ */ new Map();
1155
- for (const i of t) {
1156
- const l = (o = i.name) == null ? void 0 : o.trim();
1157
- l && n.set(l, i);
1243
+ for (const a of t) {
1244
+ const l = (o = a.name) == null ? void 0 : o.trim();
1245
+ l && n.set(l, a);
1158
1246
  }
1159
1247
  const r = [];
1160
- for (const i of e.blocks) {
1161
- if (Ue(i.type)) {
1162
- r.push(er(i));
1248
+ for (const a of e.blocks) {
1249
+ if (Be(a.type)) {
1250
+ r.push(lr(a));
1163
1251
  continue;
1164
1252
  }
1165
- if (!J(i.type)) continue;
1166
- const l = (a = i.name) == null ? void 0 : a.trim();
1253
+ if (!X(a.type)) continue;
1254
+ const l = (i = a.name) == null ? void 0 : i.trim();
1167
1255
  if (!l) continue;
1168
1256
  const c = n.get(l);
1169
1257
  c && r.push(c);
1170
1258
  }
1171
1259
  return r;
1172
1260
  }
1173
- function nr(e, t) {
1261
+ function cr(e, t) {
1174
1262
  var r;
1175
1263
  const n = {
1176
1264
  ...e,
1177
1265
  name: ((r = e.name) == null ? void 0 : r.trim()) || t.name
1178
1266
  };
1179
- return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), H({
1267
+ return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), W({
1180
1268
  title: "",
1181
1269
  description: "",
1182
1270
  blocks: [n]
1183
1271
  }).blocks[0];
1184
1272
  }
1185
- function ut(e) {
1273
+ function yt(e) {
1186
1274
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1187
1275
  const t = e;
1188
- return Array.isArray(t.blocks) ? H({
1276
+ return Array.isArray(t.blocks) ? W({
1189
1277
  title: typeof t.title == "string" ? t.title : "",
1190
1278
  description: typeof t.description == "string" ? t.description : "",
1191
1279
  blocks: t.blocks
1192
1280
  }) : null;
1193
1281
  }
1194
- function rr(e, t) {
1195
- var a, i, l, c, u, m;
1282
+ function ur(e, t) {
1283
+ var i, a, l, c, u, m;
1196
1284
  const n = /* @__PURE__ */ new Map();
1197
1285
  for (const p of (t == null ? void 0 : t.blocks) ?? [])
1198
- J(p.type) && ((a = p.name) != null && a.trim()) && n.set(p.name.trim(), p);
1286
+ X(p.type) && ((i = p.name) != null && i.trim()) && n.set(p.name.trim(), p);
1199
1287
  const r = [], o = [];
1200
1288
  for (const p of e.blocks) {
1201
- if (!J(p.type)) continue;
1202
- const y = (i = p.name) == null ? void 0 : i.trim();
1203
- if (!y) continue;
1204
- const S = n.get(y);
1205
- S ? r.push(nr(S, p)) : o.push(
1206
- H({
1289
+ if (!X(p.type)) continue;
1290
+ const g = (a = p.name) == null ? void 0 : a.trim();
1291
+ if (!g) continue;
1292
+ const v = n.get(g);
1293
+ v ? r.push(cr(v, p)) : o.push(
1294
+ W({
1207
1295
  title: "",
1208
1296
  description: "",
1209
1297
  blocks: [p]
@@ -1213,84 +1301,84 @@ function rr(e, t) {
1213
1301
  return {
1214
1302
  matchedBlocks: r,
1215
1303
  extraBlocks: o,
1216
- renderBlocks: tr(e, r),
1304
+ renderBlocks: sr(e, r),
1217
1305
  title: ((l = e.title) == null ? void 0 : l.trim()) || ((c = t == null ? void 0 : t.title) == null ? void 0 : c.trim()) || "",
1218
1306
  description: ((u = e.description) == null ? void 0 : u.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
1219
1307
  };
1220
1308
  }
1221
- function or(e) {
1309
+ function pr(e) {
1222
1310
  const { type: t, defaultValue: n } = e;
1223
1311
  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 : "";
1224
1312
  }
1225
- function pt(e) {
1313
+ function vt(e) {
1226
1314
  var n;
1227
1315
  const t = {};
1228
1316
  for (const r of e) {
1229
- if (!J(r.type)) continue;
1317
+ if (!X(r.type)) continue;
1230
1318
  const o = (n = r.name) == null ? void 0 : n.trim();
1231
- o && (t[o] = or(r));
1319
+ o && (t[o] = pr(r));
1232
1320
  }
1233
1321
  return t;
1234
1322
  }
1235
- function ar(e) {
1323
+ function mr(e) {
1236
1324
  return e.blocks.some(
1237
1325
  (t) => {
1238
1326
  var n;
1239
- return J(t.type) && !!((n = t.name) != null && n.trim());
1327
+ return X(t.type) && !!((n = t.name) != null && n.trim());
1240
1328
  }
1241
1329
  );
1242
1330
  }
1243
- function ir(e) {
1331
+ function dr(e) {
1244
1332
  return e.blocks.filter((t) => {
1245
1333
  var n;
1246
- return Ue(t.type) ? !0 : J(t.type) && !!((n = t.name) != null && n.trim());
1334
+ return Be(t.type) ? !0 : X(t.type) && !!((n = t.name) != null && n.trim());
1247
1335
  });
1248
1336
  }
1249
- function lr(e) {
1337
+ function fr(e) {
1250
1338
  return e.blocks.filter((t) => {
1251
1339
  var n;
1252
- return J(t.type) && ((n = t.name) == null ? void 0 : n.trim());
1340
+ return X(t.type) && ((n = t.name) == null ? void 0 : n.trim());
1253
1341
  }).map((t) => t.name.trim());
1254
1342
  }
1255
- function mt(e) {
1343
+ function bt(e) {
1256
1344
  return e.replace(/'/g, "'\\''");
1257
1345
  }
1258
- function dt(e, t) {
1346
+ function St(e, t) {
1259
1347
  const n = (t ?? "").trim() || "<callback_url>", r = JSON.stringify(e ?? {}, null, 2);
1260
1348
  return [
1261
1349
  `curl -X POST '${n}' \\`,
1262
1350
  " -H 'Content-Type: application/json' \\",
1263
- ` -d '${mt(r)}'`
1351
+ ` -d '${bt(r)}'`
1264
1352
  ].join(`
1265
1353
  `);
1266
1354
  }
1267
- function sr(e, t) {
1355
+ function hr(e, t) {
1268
1356
  return JSON.stringify({ ...e, ...t }, null, 2);
1269
1357
  }
1270
- function ft({
1358
+ function xt({
1271
1359
  cardValues: e,
1272
1360
  extraValues: t = {},
1273
1361
  callbackUrl: n
1274
1362
  }) {
1275
- const r = (n ?? "").trim() || "<callback_url>", o = sr(e, t);
1363
+ const r = (n ?? "").trim() || "<callback_url>", o = hr(e, t);
1276
1364
  return [
1277
1365
  `curl -X POST '${r}' \\`,
1278
1366
  " -H 'Content-Type: application/json' \\",
1279
- ` -d '${mt(o)}'`
1367
+ ` -d '${bt(o)}'`
1280
1368
  ].join(`
1281
1369
  `);
1282
1370
  }
1283
- function cr(e, t) {
1284
- const n = ut(e);
1285
- if (!n) return dt(e, t);
1286
- const r = pt(n.blocks);
1287
- return ft({ cardValues: r, callbackUrl: t });
1371
+ function gr(e, t) {
1372
+ const n = yt(e);
1373
+ if (!n) return St(e, t);
1374
+ const r = vt(n.blocks);
1375
+ return xt({ cardValues: r, callbackUrl: t });
1288
1376
  }
1289
- async function ur(e, t, n) {
1377
+ async function yr(e, t, n) {
1290
1378
  const r = e.trim();
1291
1379
  if (!r)
1292
1380
  throw new Error("callback_url 为空");
1293
- const a = await ((n == null ? void 0 : n.fetch) ?? fetch)(r, {
1381
+ const i = await ((n == null ? void 0 : n.fetch) ?? fetch)(r, {
1294
1382
  method: "POST",
1295
1383
  headers: {
1296
1384
  "Content-Type": "application/json",
@@ -1298,22 +1386,22 @@ async function ur(e, t, n) {
1298
1386
  },
1299
1387
  body: JSON.stringify(t ?? {})
1300
1388
  });
1301
- let i;
1302
- if ((a.headers.get("content-type") ?? "").includes("application/json"))
1389
+ let a;
1390
+ if ((i.headers.get("content-type") ?? "").includes("application/json"))
1303
1391
  try {
1304
- i = await a.json();
1392
+ a = await i.json();
1305
1393
  } catch {
1306
- i = void 0;
1394
+ a = void 0;
1307
1395
  }
1308
1396
  else
1309
1397
  try {
1310
- i = await a.text();
1398
+ a = await i.text();
1311
1399
  } catch {
1312
- i = void 0;
1400
+ a = void 0;
1313
1401
  }
1314
- return { ok: a.ok, status: a.status, body: i };
1402
+ return { ok: i.ok, status: i.status, body: a };
1315
1403
  }
1316
- async function ht(e) {
1404
+ async function Ct(e) {
1317
1405
  var n;
1318
1406
  if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
1319
1407
  await navigator.clipboard.writeText(e);
@@ -1329,7 +1417,7 @@ async function ht(e) {
1329
1417
  document.body.removeChild(t);
1330
1418
  }
1331
1419
  }
1332
- async function pr(e) {
1420
+ async function vr(e) {
1333
1421
  let t;
1334
1422
  try {
1335
1423
  t = await e.json();
@@ -1342,45 +1430,45 @@ async function pr(e) {
1342
1430
  throw new Error(t.message || `响应缺少 data (${e.status})`);
1343
1431
  return t.data;
1344
1432
  }
1345
- function Zr(e = {}) {
1433
+ function io(e = {}) {
1346
1434
  const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
1347
- async function o(a) {
1435
+ async function o(i) {
1348
1436
  var p;
1349
- const i = new URLSearchParams();
1350
- if (a.formId !== void 0)
1351
- i.set("form_id", String(a.formId));
1352
- else if (a.formUniqueId)
1353
- i.set("form_unique_id", a.formUniqueId);
1437
+ const a = new URLSearchParams();
1438
+ if (i.formId !== void 0)
1439
+ a.set("form_id", String(i.formId));
1440
+ else if (i.formUniqueId)
1441
+ a.set("form_unique_id", i.formUniqueId);
1354
1442
  else
1355
1443
  throw new Error("form_id 或 form_unique_id 至少传一个");
1356
- const l = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${i.toString()}`, {
1444
+ const l = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${a.toString()}`, {
1357
1445
  method: "GET",
1358
1446
  headers: l
1359
- }), u = await pr(c), m = Zn(u.form_definition);
1447
+ }), u = await vr(c), m = ir(u.form_definition);
1360
1448
  return {
1361
1449
  formUniqueId: u.form_unique_id,
1362
1450
  formId: u.form_id,
1363
1451
  disabled: u.disabled === 1,
1364
1452
  formDefinition: m,
1365
- a2ui: Gn(u.form_definition) ?? void 0
1453
+ a2ui: rr(u.form_definition) ?? void 0
1366
1454
  };
1367
1455
  }
1368
1456
  return { fetchDetail: o };
1369
1457
  }
1370
- const mr = {
1371
- video: zt,
1372
- audio: Ut,
1373
- image: _t,
1374
- file: He,
1375
- spreadsheet: Et,
1376
- document: Je
1458
+ const br = {
1459
+ video: jt,
1460
+ audio: qt,
1461
+ image: wt,
1462
+ file: We,
1463
+ spreadsheet: Vt,
1464
+ document: Ge
1377
1465
  };
1378
- function dr({
1466
+ function Sr({
1379
1467
  type: e,
1380
1468
  size: t = 40,
1381
1469
  className: n
1382
1470
  }) {
1383
- const r = mr[e] ?? He;
1471
+ const r = br[e] ?? We;
1384
1472
  return /* @__PURE__ */ s(
1385
1473
  r,
1386
1474
  {
@@ -1390,7 +1478,7 @@ function dr({
1390
1478
  }
1391
1479
  );
1392
1480
  }
1393
- const gt = "skopon-form-v0_9", fr = /* @__PURE__ */ new Set([
1481
+ const kt = "skopon-form-v0_9", xr = /* @__PURE__ */ new Set([
1394
1482
  "SkoponMedia",
1395
1483
  "SkoponSelect",
1396
1484
  "Image",
@@ -1402,39 +1490,39 @@ const gt = "skopon-form-v0_9", fr = /* @__PURE__ */ new Set([
1402
1490
  "FileUpload",
1403
1491
  "TextField",
1404
1492
  "Text",
1405
- ...Vn()
1406
- ]), hr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
1407
- function oe(e) {
1408
- const t = [...le.components.values()].find((n) => n.name === e);
1493
+ ...Jn()
1494
+ ]), Cr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
1495
+ function ae(e) {
1496
+ const t = [...ue.components.values()].find((n) => n.name === e);
1409
1497
  if (!t) throw new Error(`Missing basic catalog component: ${e}`);
1410
1498
  return t.schema;
1411
1499
  }
1412
- function N(e) {
1500
+ function A(e) {
1413
1501
  return typeof e == "string" ? e : "";
1414
1502
  }
1415
- function yt(e) {
1503
+ function At(e) {
1416
1504
  return Array.isArray(e) ? e.map((t) => {
1417
1505
  if (!t || typeof t != "object") return null;
1418
1506
  const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
1419
1507
  return { value: r, label: o };
1420
1508
  }).filter((t) => !!t) : [];
1421
1509
  }
1422
- function me({
1510
+ function ge({
1423
1511
  mediaType: e,
1424
1512
  urls: t,
1425
1513
  mediaSize: n,
1426
1514
  label: r,
1427
1515
  help: o,
1428
- placeholder: a
1516
+ placeholder: i
1429
1517
  }) {
1430
- const i = r == null ? void 0 : r.trim(), l = o == null ? void 0 : o.trim(), c = rn(n), u = (a == null ? void 0 : a.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
1431
- return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
1432
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1518
+ const a = r == null ? void 0 : r.trim(), l = o == null ? void 0 : o.trim(), c = pn(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
1519
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1520
+ a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1433
1521
  t.length === 0 ? /* @__PURE__ */ s("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ s("div", { className: c, children: t.map((m, p) => e === "image" ? /* @__PURE__ */ s(
1434
1522
  "img",
1435
1523
  {
1436
1524
  src: m,
1437
- alt: i || "图片",
1525
+ alt: a || "图片",
1438
1526
  className: "form-media-item"
1439
1527
  },
1440
1528
  `media-${p}`
@@ -1455,21 +1543,21 @@ function me({
1455
1543
  },
1456
1544
  `media-${p}`
1457
1545
  )) }),
1458
- l ? /* @__PURE__ */ s(L.Text, { type: "secondary", className: "form-block-preview-help", children: l }) : null
1546
+ l ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-help", children: l }) : null
1459
1547
  ] });
1460
1548
  }
1461
- function de(e, t) {
1462
- const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : N(e.url).trim() ? [N(e.url).trim()] : [];
1549
+ function ye(e, t) {
1550
+ const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : A(e.url).trim() ? [A(e.url).trim()] : [];
1463
1551
  return {
1464
1552
  mediaType: t,
1465
1553
  urls: n,
1466
- mediaSize: re(e.mediaSize),
1467
- label: N(e.label) || N(e.description),
1468
- help: N(e.help),
1469
- placeholder: N(e.placeholder)
1554
+ mediaSize: ie(e.mediaSize),
1555
+ label: A(e.label) || A(e.description),
1556
+ help: A(e.help),
1557
+ placeholder: A(e.placeholder)
1470
1558
  };
1471
1559
  }
1472
- const gr = {
1560
+ const kr = {
1473
1561
  name: "SkoponMedia",
1474
1562
  schema: d.object({
1475
1563
  mediaType: d.any().optional(),
@@ -1479,19 +1567,19 @@ const gr = {
1479
1567
  help: d.any().optional(),
1480
1568
  placeholder: d.any().optional()
1481
1569
  }).passthrough()
1482
- }, yr = R(gr, ({ context: e }) => {
1483
- const t = e.componentModel.properties, n = N(t.mediaType);
1484
- return /* @__PURE__ */ s(me, { ...de(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
1485
- }), vr = R(
1486
- { name: "Image", schema: oe("Image") },
1487
- ({ context: e }) => /* @__PURE__ */ s(me, { ...de(e.componentModel.properties, "image") })
1488
- ), br = R(
1489
- { name: "Video", schema: oe("Video") },
1490
- ({ context: e }) => /* @__PURE__ */ s(me, { ...de(e.componentModel.properties, "video") })
1491
- ), Sr = R(
1492
- { name: "AudioPlayer", schema: oe("AudioPlayer") },
1493
- ({ context: e }) => /* @__PURE__ */ s(me, { ...de(e.componentModel.properties, "audio") })
1494
- ), kr = {
1570
+ }, Ar = V(kr, ({ context: e }) => {
1571
+ const t = e.componentModel.properties, n = A(t.mediaType);
1572
+ return /* @__PURE__ */ s(ge, { ...ye(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
1573
+ }), Tr = V(
1574
+ { name: "Image", schema: ae("Image") },
1575
+ ({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "image") })
1576
+ ), Nr = V(
1577
+ { name: "Video", schema: ae("Video") },
1578
+ ({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "video") })
1579
+ ), Ir = V(
1580
+ { name: "AudioPlayer", schema: ae("AudioPlayer") },
1581
+ ({ context: e }) => /* @__PURE__ */ s(ge, { ...ye(e.componentModel.properties, "audio") })
1582
+ ), Mr = {
1495
1583
  name: "SkoponSelect",
1496
1584
  schema: d.object({
1497
1585
  label: d.any().optional(),
@@ -1501,36 +1589,36 @@ const gr = {
1501
1589
  value: d.any().optional()
1502
1590
  }).passthrough()
1503
1591
  };
1504
- function xr({ context: e }) {
1505
- const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), i = N(o.placeholder), l = yt(o.options), c = N(o.mode) === "multiple";
1506
- return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
1507
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1592
+ function Fr({ context: e }) {
1593
+ const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = At(o.options), c = A(o.mode) === "multiple";
1594
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1595
+ i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1508
1596
  /* @__PURE__ */ s(
1509
- Ce,
1597
+ Fe,
1510
1598
  {
1511
1599
  mode: c ? "multiple" : void 0,
1512
1600
  disabled: !t,
1513
1601
  allowClear: !0,
1514
1602
  className: "form-block-preview-control",
1515
1603
  style: { width: "100%" },
1516
- placeholder: i || (c ? "请选择多项" : "请选择"),
1604
+ placeholder: a || (c ? "请选择多项" : "请选择"),
1517
1605
  options: l,
1518
- value: c ? j(n) : ee(n),
1606
+ value: c ? L(n) : ne(n),
1519
1607
  onChange: (u) => r(c ? u ?? [] : u ?? "")
1520
1608
  }
1521
1609
  )
1522
1610
  ] });
1523
1611
  }
1524
- const Ar = R(
1525
- kr,
1526
- xr
1612
+ const Pr = V(
1613
+ Mr,
1614
+ Fr
1527
1615
  );
1528
- function Tr({ context: e }) {
1529
- const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), i = N(o.variant) || "mutuallyExclusive", l = N(o.skoponPickerType), c = N(o.placeholder), u = yt(o.options), p = l === "select" || l === "multiselect" || l === "radio" || l === "checkbox" ? l : i === "multipleSelection" ? "checkbox" : "radio";
1530
- return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
1531
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1616
+ function Ur({ context: e }) {
1617
+ const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.variant) || "mutuallyExclusive", l = A(o.skoponPickerType), c = A(o.placeholder), u = At(o.options), p = l === "select" || l === "multiselect" || l === "radio" || l === "checkbox" ? l : a === "multipleSelection" ? "checkbox" : "radio";
1618
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1619
+ i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1532
1620
  p === "select" ? /* @__PURE__ */ s(
1533
- Ce,
1621
+ Fe,
1534
1622
  {
1535
1623
  disabled: !t,
1536
1624
  allowClear: !0,
@@ -1538,11 +1626,11 @@ function Tr({ context: e }) {
1538
1626
  style: { width: "100%" },
1539
1627
  placeholder: c || "请选择",
1540
1628
  options: u,
1541
- value: ee(n),
1542
- onChange: (y) => r(y ?? "")
1629
+ value: ne(n),
1630
+ onChange: (g) => r(g ?? "")
1543
1631
  }
1544
1632
  ) : p === "multiselect" ? /* @__PURE__ */ s(
1545
- Ce,
1633
+ Fe,
1546
1634
  {
1547
1635
  mode: "multiple",
1548
1636
  disabled: !t,
@@ -1551,31 +1639,31 @@ function Tr({ context: e }) {
1551
1639
  style: { width: "100%" },
1552
1640
  placeholder: c || "请选择多项",
1553
1641
  options: u,
1554
- value: j(n),
1555
- onChange: (y) => r(y ?? [])
1642
+ value: L(n),
1643
+ onChange: (g) => r(g ?? [])
1556
1644
  }
1557
1645
  ) : p === "checkbox" ? /* @__PURE__ */ s(
1558
- At.Group,
1646
+ Pt.Group,
1559
1647
  {
1560
1648
  disabled: !t,
1561
1649
  className: "form-block-preview-control",
1562
1650
  options: u,
1563
- value: j(n),
1564
- onChange: (y) => r(y)
1651
+ value: L(n),
1652
+ onChange: (g) => r(g)
1565
1653
  }
1566
1654
  ) : /* @__PURE__ */ s(
1567
- Tt.Group,
1655
+ Ut.Group,
1568
1656
  {
1569
1657
  disabled: !t,
1570
1658
  className: "form-block-preview-control",
1571
1659
  options: u,
1572
- value: ee(n),
1573
- onChange: (y) => r(y.target.value)
1660
+ value: ne(n),
1661
+ onChange: (g) => r(g.target.value)
1574
1662
  }
1575
1663
  )
1576
1664
  ] });
1577
1665
  }
1578
- const Cr = R(
1666
+ const _r = V(
1579
1667
  {
1580
1668
  name: "ChoicePicker",
1581
1669
  schema: d.object({
@@ -1587,39 +1675,39 @@ const Cr = R(
1587
1675
  placeholder: d.any().optional()
1588
1676
  }).passthrough()
1589
1677
  },
1590
- Tr
1678
+ Ur
1591
1679
  );
1592
- function Ir({ context: e }) {
1593
- const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label);
1594
- return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
1595
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1680
+ function Er({ context: e }) {
1681
+ const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label);
1682
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1683
+ i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1596
1684
  /* @__PURE__ */ s(
1597
- Ct,
1685
+ _t,
1598
1686
  {
1599
1687
  disabled: !t,
1600
1688
  className: "form-block-preview-control",
1601
- checked: we(n),
1602
- onChange: (i) => r(i)
1689
+ checked: qe(n),
1690
+ onChange: (a) => r(a)
1603
1691
  }
1604
1692
  )
1605
1693
  ] });
1606
1694
  }
1607
- const Nr = R(
1608
- { name: "CheckBox", schema: oe("CheckBox") },
1609
- Ir
1695
+ const zr = V(
1696
+ { name: "CheckBox", schema: ae("CheckBox") },
1697
+ Er
1610
1698
  );
1611
- function Fr(e, t, n) {
1612
- const r = ee(e);
1699
+ function Rr(e, t, n) {
1700
+ const r = ne(e);
1613
1701
  if (!r) return;
1614
1702
  if (!t && n) {
1615
- const a = qe(r, "HH:mm", !0);
1616
- return a.isValid() ? a : void 0;
1703
+ const i = $e(r, "HH:mm", !0);
1704
+ return i.isValid() ? i : void 0;
1617
1705
  }
1618
- const o = qe(r);
1706
+ const o = $e(r);
1619
1707
  return o.isValid() ? o : void 0;
1620
1708
  }
1621
- function Mr({ context: e }) {
1622
- const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), i = N(o.placeholder), l = o.enableDate === !0, c = o.enableTime === !0, u = Fr(n, l, c), m = (p) => {
1709
+ function Or({ context: e }) {
1710
+ const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = o.enableDate === !0, c = o.enableTime === !0, u = Rr(n, l, c), m = (p) => {
1623
1711
  if (!p) {
1624
1712
  r("");
1625
1713
  return;
@@ -1634,33 +1722,33 @@ function Mr({ context: e }) {
1634
1722
  }
1635
1723
  r(p.format("YYYY-MM-DD"));
1636
1724
  };
1637
- return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
1638
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1725
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1726
+ i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1639
1727
  !l && c ? /* @__PURE__ */ s(
1640
- It,
1728
+ Et,
1641
1729
  {
1642
1730
  disabled: !t,
1643
1731
  className: "form-block-preview-control",
1644
1732
  style: { width: "100%" },
1645
- placeholder: i || "选择时间",
1733
+ placeholder: a || "选择时间",
1646
1734
  value: u,
1647
1735
  onChange: m
1648
1736
  }
1649
1737
  ) : /* @__PURE__ */ s(
1650
- Nt,
1738
+ zt,
1651
1739
  {
1652
1740
  showTime: l && c,
1653
1741
  disabled: !t,
1654
1742
  className: "form-block-preview-control",
1655
1743
  style: { width: "100%" },
1656
- placeholder: i || (l && c ? "选择日期时间" : "选择日期"),
1744
+ placeholder: a || (l && c ? "选择日期时间" : "选择日期"),
1657
1745
  value: u,
1658
1746
  onChange: m
1659
1747
  }
1660
1748
  )
1661
1749
  ] });
1662
1750
  }
1663
- const Pr = R(
1751
+ const Br = V(
1664
1752
  {
1665
1753
  name: "DateTimeInput",
1666
1754
  schema: d.object({
@@ -1673,8 +1761,8 @@ const Pr = R(
1673
1761
  max: d.any().optional()
1674
1762
  }).passthrough()
1675
1763
  },
1676
- Mr
1677
- ), Er = {
1764
+ Or
1765
+ ), Vr = {
1678
1766
  name: "FileUpload",
1679
1767
  schema: d.object({
1680
1768
  label: d.any().optional(),
@@ -1686,108 +1774,108 @@ const Pr = R(
1686
1774
  value: d.any().optional()
1687
1775
  }).passthrough()
1688
1776
  };
1689
- function _r({ context: e }) {
1690
- const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), i = N(o.accept), l = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = i ? i.split(",").map((f) => f.trim()).filter(Boolean) : void 0, u = Gt(l, c), m = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
1777
+ function wr({ context: e }) {
1778
+ const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.accept), l = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((f) => f.trim()).filter(Boolean) : void 0, u = rn(l, c), m = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
1691
1779
  o.filePlaceholderIcon
1692
- ) ? o.filePlaceholderIcon : "document", p = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, y = typeof o.maxCount == "number" ? o.maxCount : 1, S = y > 0, C = j(n), F = S && C.length >= y, T = C.length < p;
1693
- return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
1694
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1695
- /* @__PURE__ */ x(
1696
- ge.Dragger,
1780
+ ) ? o.filePlaceholderIcon : "document", p = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, g = typeof o.maxCount == "number" ? o.maxCount : 1, v = g > 0, I = L(n), T = v && I.length >= g, k = I.length < p;
1781
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1782
+ i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1783
+ /* @__PURE__ */ C(
1784
+ Se.Dragger,
1697
1785
  {
1698
- disabled: !t || F,
1699
- accept: Xt(l, c),
1786
+ disabled: !t || T,
1787
+ accept: nn(l, c),
1700
1788
  className: "form-file-upload-preview",
1701
- showUploadList: t && C.length > 0,
1702
- fileList: t ? C.map((f, h) => ({
1789
+ showUploadList: t && I.length > 0,
1790
+ fileList: t ? I.map((f, h) => ({
1703
1791
  uid: `${h}-${f}`,
1704
1792
  name: f,
1705
1793
  status: "done"
1706
1794
  })) : [],
1707
1795
  beforeUpload: (f) => {
1708
- if (!t) return ge.LIST_IGNORE;
1709
- const h = j(Le(e));
1710
- if (S && h.length >= y) return ge.LIST_IGNORE;
1711
- const k = S ? [...h, f.name].slice(0, y) : [...h, f.name];
1712
- return r(k), !1;
1796
+ if (!t) return Se.LIST_IGNORE;
1797
+ const h = L(Ke(e));
1798
+ if (v && h.length >= g) return Se.LIST_IGNORE;
1799
+ const x = v ? [...h, f.name].slice(0, g) : [...h, f.name];
1800
+ return r(x), !1;
1713
1801
  },
1714
1802
  onRemove: (f) => {
1715
- const h = j(Le(e)), k = /^(\d+)-/.exec(f.uid ?? ""), v = k ? Number(k[1]) : -1, b = v >= 0 && v < h.length ? h.filter((P, w) => w !== v) : h.filter((P) => P !== f.name);
1716
- if (b.length < p) return !1;
1717
- r(b);
1803
+ const h = L(Ke(e)), x = /^(\d+)-/.exec(f.uid ?? ""), y = x ? Number(x[1]) : -1, S = y >= 0 && y < h.length ? h.filter((M, z) => z !== y) : h.filter((M) => M !== f.name);
1804
+ if (S.length < p) return !1;
1805
+ r(S);
1718
1806
  },
1719
1807
  children: [
1720
- /* @__PURE__ */ s("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ s(dr, { type: m, size: 40 }) }),
1808
+ /* @__PURE__ */ s("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ s(Sr, { type: m, size: 40 }) }),
1721
1809
  /* @__PURE__ */ s("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
1722
1810
  ]
1723
1811
  }
1724
1812
  ),
1725
- /* @__PURE__ */ x(L.Text, { type: "secondary", className: "form-block-preview-help", children: [
1813
+ /* @__PURE__ */ C(D.Text, { type: "secondary", className: "form-block-preview-help", children: [
1726
1814
  "允许:",
1727
1815
  u ?? "全部类型",
1728
1816
  p > 0 ? `;至少 ${p} 个文件` : "",
1729
- S ? `;最多 ${y} 个文件` : "",
1730
- T && t ? `(当前 ${C.length} 个,未达下限)` : ""
1817
+ v ? `;最多 ${g} 个文件` : "",
1818
+ k && t ? `(当前 ${I.length} 个,未达下限)` : ""
1731
1819
  ] })
1732
1820
  ] });
1733
1821
  }
1734
- const Ur = R(
1735
- Er,
1736
- _r
1822
+ const qr = V(
1823
+ Vr,
1824
+ wr
1737
1825
  );
1738
- function zr({ context: e }) {
1739
- const { interactive: t } = $(), { value: n, setValue: r } = D(e), o = e.componentModel.properties, a = N(o.label), i = N(o.placeholder), l = N(o.variant) || "shortText", c = ee(n) ?? "", u = !t, m = "form-block-preview-control";
1826
+ function jr({ context: e }) {
1827
+ const { interactive: t } = K(), { value: n, setValue: r } = J(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), l = A(o.variant) || "shortText", c = ne(n) ?? "", u = !t, m = "form-block-preview-control";
1740
1828
  let p;
1741
1829
  if (l === "longText")
1742
1830
  p = /* @__PURE__ */ s(
1743
- ye.TextArea,
1831
+ xe.TextArea,
1744
1832
  {
1745
1833
  disabled: u,
1746
1834
  className: m,
1747
- placeholder: i || "长文本回答...",
1835
+ placeholder: a || "长文本回答...",
1748
1836
  autoSize: { minRows: 2, maxRows: 6 },
1749
1837
  value: c,
1750
- onChange: (y) => r(y.target.value)
1838
+ onChange: (g) => r(g.target.value)
1751
1839
  }
1752
1840
  );
1753
1841
  else if (l === "number") {
1754
- const y = c && Number.isFinite(Number(c)) ? Number(c) : void 0;
1842
+ const g = c && Number.isFinite(Number(c)) ? Number(c) : void 0;
1755
1843
  p = /* @__PURE__ */ s(
1756
- Ft,
1844
+ Rt,
1757
1845
  {
1758
1846
  disabled: u,
1759
1847
  className: m,
1760
1848
  style: { width: "100%" },
1761
- placeholder: i || "数字",
1762
- value: y,
1763
- onChange: (S) => r(S == null ? "" : String(S))
1849
+ placeholder: a || "数字",
1850
+ value: g,
1851
+ onChange: (v) => r(v == null ? "" : String(v))
1764
1852
  }
1765
1853
  );
1766
1854
  } else l === "obscured" ? p = /* @__PURE__ */ s(
1767
- ye.Password,
1855
+ xe.Password,
1768
1856
  {
1769
1857
  disabled: u,
1770
1858
  className: m,
1771
- placeholder: i,
1859
+ placeholder: a,
1772
1860
  value: c,
1773
- onChange: (y) => r(y.target.value)
1861
+ onChange: (g) => r(g.target.value)
1774
1862
  }
1775
1863
  ) : p = /* @__PURE__ */ s(
1776
- ye,
1864
+ xe,
1777
1865
  {
1778
1866
  disabled: u,
1779
1867
  className: m,
1780
- placeholder: i,
1868
+ placeholder: a,
1781
1869
  value: c,
1782
- onChange: (y) => r(y.target.value)
1870
+ onChange: (g) => r(g.target.value)
1783
1871
  }
1784
1872
  );
1785
- return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
1786
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
1873
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1874
+ i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
1787
1875
  p
1788
1876
  ] });
1789
1877
  }
1790
- const Rr = R(
1878
+ const $r = V(
1791
1879
  {
1792
1880
  name: "TextField",
1793
1881
  schema: d.object({
@@ -1798,204 +1886,204 @@ const Rr = R(
1798
1886
  value: d.any().optional()
1799
1887
  }).passthrough()
1800
1888
  },
1801
- zr
1889
+ jr
1802
1890
  );
1803
- function wr({ context: e }) {
1804
- const t = e.componentModel.properties, n = N(t.text), r = N(t.variant) || "body";
1805
- return hr.has(r) ? r === "caption" ? /* @__PURE__ */ s(L.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ s("em", { children: n }) }) : /* @__PURE__ */ s(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ s(L.Paragraph, { className: "form-block-preview-paragraph", children: n });
1891
+ function Lr({ context: e }) {
1892
+ const t = e.componentModel.properties, n = A(t.text), r = A(t.variant) || "body";
1893
+ return Cr.has(r) ? r === "caption" ? /* @__PURE__ */ s(D.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ s("em", { children: n }) }) : /* @__PURE__ */ s(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ s(D.Paragraph, { className: "form-block-preview-paragraph", children: n });
1806
1894
  }
1807
- const Or = R(
1808
- { name: "Text", schema: oe("Text") },
1809
- wr
1895
+ const Dr = V(
1896
+ { name: "Text", schema: ae("Text") },
1897
+ Lr
1810
1898
  );
1811
- function vt() {
1899
+ function Tt() {
1812
1900
  const t = [
1813
- ...[...le.components.values()].filter(
1814
- (r) => !fr.has(r.name)
1901
+ ...[...ue.components.values()].filter(
1902
+ (r) => !xr.has(r.name)
1815
1903
  ),
1816
- yr,
1817
1904
  Ar,
1818
- vr,
1819
- br,
1820
- Sr,
1821
- Cr,
1822
- Nr,
1823
1905
  Pr,
1824
- Ur,
1825
- Rr,
1826
- Or,
1827
- ...Bn()
1828
- ], n = [...le.functions.values()];
1829
- return new Rt(gt, t, n, le.themeSchema);
1830
- }
1831
- const Br = St(
1906
+ Tr,
1907
+ Nr,
1908
+ Ir,
1909
+ _r,
1910
+ zr,
1911
+ Br,
1912
+ qr,
1913
+ $r,
1914
+ Dr,
1915
+ ...Kn()
1916
+ ], n = [...ue.functions.values()];
1917
+ return new $t(kt, t, n, ue.themeSchema);
1918
+ }
1919
+ const Kr = It(
1832
1920
  function({
1833
1921
  doc: t,
1834
1922
  surfaceId: n = "skopon-form",
1835
1923
  emptyHint: r = null,
1836
1924
  interactive: o = !0,
1837
- fieldNames: a = [],
1838
- resumeSearch: i = null,
1925
+ fieldNames: i = [],
1926
+ resumeSearch: a = null,
1839
1927
  caseSearch: l = null
1840
1928
  }, c) {
1841
- V(() => {
1842
- We(), Ge();
1929
+ j(() => {
1930
+ tt(), et();
1843
1931
  }, []);
1844
- const u = B(null), m = B(a);
1845
- m.current = a;
1846
- const p = z(() => {
1847
- if (Me(t)) return "";
1932
+ const u = q(null), m = q(i);
1933
+ m.current = i;
1934
+ const p = B(() => {
1935
+ if (Ee(t)) return "";
1848
1936
  try {
1849
1937
  return JSON.stringify(t);
1850
1938
  } catch {
1851
1939
  return String(t);
1852
1940
  }
1853
- }, [t]), y = z(() => {
1941
+ }, [t]), g = B(() => {
1854
1942
  if (!p)
1855
1943
  return { surfaces: [], processor: null };
1856
1944
  try {
1857
- const F = JSON.parse(p), T = new Xe([vt()]), f = Xn(F, {
1945
+ const T = JSON.parse(p), k = new Qe([Tt()]), f = nr(T, {
1858
1946
  surfaceId: n,
1859
- catalogId: gt
1947
+ catalogId: kt
1860
1948
  });
1861
- return T.processMessages(f), {
1862
- surfaces: Array.from(T.model.surfacesMap.values()),
1863
- processor: T
1949
+ return k.processMessages(f), {
1950
+ surfaces: Array.from(k.model.surfacesMap.values()),
1951
+ processor: k
1864
1952
  };
1865
- } catch (F) {
1866
- return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", F), { surfaces: [], processor: null };
1953
+ } catch (T) {
1954
+ return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", T), { surfaces: [], processor: null };
1867
1955
  }
1868
- }, [p, n]), { surfaces: S, processor: C } = y;
1869
- return u.current = C, kt(
1956
+ }, [p, n]), { surfaces: v, processor: I } = g;
1957
+ return u.current = I, Mt(
1870
1958
  c,
1871
1959
  () => ({
1872
- getValues(F) {
1873
- const T = u.current;
1874
- if (!T) return {};
1875
- const f = (F ?? m.current).map((h) => h.trim()).filter(Boolean);
1876
- return Qn(T, n, f);
1960
+ getValues(T) {
1961
+ const k = u.current;
1962
+ if (!k) return {};
1963
+ const f = (T ?? m.current).map((h) => h.trim()).filter(Boolean);
1964
+ return ar(k, n, f);
1877
1965
  }
1878
1966
  }),
1879
1967
  [n]
1880
- ), S.length === 0 ? /* @__PURE__ */ s(De, { children: r }) : /* @__PURE__ */ s(at, { resumeSearch: i, children: /* @__PURE__ */ s(rt, { caseSearch: l, children: /* @__PURE__ */ s(et, { interactive: o, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: S.map((F) => /* @__PURE__ */ s(Ye, { surface: F }, F.id)) }) }) }) });
1968
+ ), v.length === 0 ? /* @__PURE__ */ s(Ye, { children: r }) : /* @__PURE__ */ s(mt, { resumeSearch: a, children: /* @__PURE__ */ s(ut, { caseSearch: l, children: /* @__PURE__ */ s(ot, { interactive: o, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: v.map((T) => /* @__PURE__ */ s(Ze, { surface: T }, T.id)) }) }) }) });
1881
1969
  }
1882
1970
  );
1883
- function ie() {
1884
- return new Xe([vt()]);
1971
+ function ce() {
1972
+ return new Qe([Tt()]);
1885
1973
  }
1886
- function Qr({
1974
+ function ao({
1887
1975
  messages: e,
1888
1976
  surfaceId: t = "skopon-form-stream",
1889
1977
  emptyHint: n = null,
1890
1978
  interactive: r = !0,
1891
1979
  resumeSearch: o = null,
1892
- caseSearch: a = null
1980
+ caseSearch: i = null
1893
1981
  }) {
1894
- V(() => {
1895
- We(), Ge();
1982
+ j(() => {
1983
+ tt(), et();
1896
1984
  }, []);
1897
- const i = B(null);
1898
- i.current === null && (i.current = ie());
1899
- const l = B(0), c = B(""), u = B(!0), m = B(t);
1985
+ const a = q(null);
1986
+ a.current === null && (a.current = ce());
1987
+ const l = q(0), c = q(""), u = q(!0), m = q(t);
1900
1988
  function p(f, h) {
1901
- i.current = f, l.current = h.length, c.current = JSON.stringify(h), u.current && (C(f), T(Array.from(f.model.surfacesMap.values())));
1989
+ a.current = f, l.current = h.length, c.current = JSON.stringify(h), u.current && (I(f), k(Array.from(f.model.surfacesMap.values())));
1902
1990
  }
1903
- function y(f, h) {
1991
+ function g(f, h) {
1904
1992
  if (h <= 0) return !1;
1905
- const k = JSON.stringify(f.slice(0, h)), v = c.current;
1906
- if (!v) return !0;
1993
+ const x = JSON.stringify(f.slice(0, h)), y = c.current;
1994
+ if (!y) return !0;
1907
1995
  try {
1908
- const b = JSON.parse(v);
1909
- return JSON.stringify(b.slice(0, h)) !== k;
1996
+ const S = JSON.parse(y);
1997
+ return JSON.stringify(S.slice(0, h)) !== x;
1910
1998
  } catch {
1911
1999
  return !0;
1912
2000
  }
1913
2001
  }
1914
- const [S, C] = E(
1915
- () => i.current
1916
- ), [F, T] = E(
2002
+ const [v, I] = U(
2003
+ () => a.current
2004
+ ), [T, k] = U(
1917
2005
  () => Array.from(
1918
- i.current.model.surfacesMap.values()
2006
+ a.current.model.surfacesMap.values()
1919
2007
  )
1920
2008
  );
1921
- return V(() => (u.current = !0, () => {
2009
+ return j(() => (u.current = !0, () => {
1922
2010
  u.current = !1;
1923
- }), []), V(() => {
1924
- i.current = S;
1925
- }, [S]), V(() => {
2011
+ }), []), j(() => {
2012
+ a.current = v;
2013
+ }, [v]), j(() => {
1926
2014
  const f = () => {
1927
- u.current && T(Array.from(S.model.surfacesMap.values()));
1928
- }, h = S.onSurfaceCreated(f), k = S.onSurfaceDeleted(f);
2015
+ u.current && k(Array.from(v.model.surfacesMap.values()));
2016
+ }, h = v.onSurfaceCreated(f), x = v.onSurfaceDeleted(f);
1929
2017
  return () => {
1930
- h.unsubscribe(), k.unsubscribe();
2018
+ h.unsubscribe(), x.unsubscribe();
1931
2019
  };
1932
- }, [S]), V(() => {
2020
+ }, [v]), j(() => {
1933
2021
  let f = !1;
1934
2022
  const h = m.current !== t;
1935
2023
  if (m.current = t, h) {
1936
- const P = ie();
1937
- return Array.isArray(e) && e.length > 0 ? (P.processMessages(e), f || p(P, e)) : (i.current = P, l.current = 0, c.current = "", f || (C(P), T([]))), () => {
2024
+ const M = ce();
2025
+ return Array.isArray(e) && e.length > 0 ? (M.processMessages(e), f || p(M, e)) : (a.current = M, l.current = 0, c.current = "", f || (I(M), k([]))), () => {
1938
2026
  f = !0;
1939
2027
  };
1940
2028
  }
1941
2029
  if (!Array.isArray(e) || e.length === 0) {
1942
2030
  if (l.current > 0) {
1943
- const P = ie();
1944
- i.current = P, l.current = 0, c.current = "", f || (C(P), T([]));
2031
+ const M = ce();
2032
+ a.current = M, l.current = 0, c.current = "", f || (I(M), k([]));
1945
2033
  }
1946
2034
  return () => {
1947
2035
  f = !0;
1948
2036
  };
1949
2037
  }
1950
- const k = i.current, v = l.current;
1951
- if (e.length < v || y(e, v)) {
1952
- const P = ie();
1953
- return P.processMessages(e), f || p(P, e), () => {
2038
+ const x = a.current, y = l.current;
2039
+ if (e.length < y || g(e, y)) {
2040
+ const M = ce();
2041
+ return M.processMessages(e), f || p(M, e), () => {
1954
2042
  f = !0;
1955
2043
  };
1956
2044
  }
1957
- const b = e.slice(v);
1958
- return b.length === 0 ? () => {
2045
+ const S = e.slice(y);
2046
+ return S.length === 0 ? () => {
1959
2047
  f = !0;
1960
- } : (k.processMessages(b), l.current = e.length, c.current = JSON.stringify(e), f || T(Array.from(k.model.surfacesMap.values())), () => {
2048
+ } : (x.processMessages(S), l.current = e.length, c.current = JSON.stringify(e), f || k(Array.from(x.model.surfacesMap.values())), () => {
1961
2049
  f = !0;
1962
2050
  });
1963
- }, [e, t]), F.length === 0 ? /* @__PURE__ */ s(De, { children: n }) : /* @__PURE__ */ s(at, { resumeSearch: o, children: /* @__PURE__ */ s(rt, { caseSearch: a, children: /* @__PURE__ */ s(et, { interactive: r, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: F.map((f) => /* @__PURE__ */ s(Ye, { surface: f }, f.id)) }) }) }) });
2051
+ }, [e, t]), T.length === 0 ? /* @__PURE__ */ s(Ye, { children: n }) : /* @__PURE__ */ s(mt, { resumeSearch: o, children: /* @__PURE__ */ s(ut, { caseSearch: i, children: /* @__PURE__ */ s(ot, { interactive: r, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: T.map((f) => /* @__PURE__ */ s(Ze, { surface: f }, f.id)) }) }) }) });
1964
2052
  }
1965
- function Vr({
2053
+ function Jr({
1966
2054
  payload: e,
1967
2055
  callbackUrl: t,
1968
2056
  title: n,
1969
2057
  unpublishedFormId: r,
1970
2058
  incompleteFormId: o,
1971
- copyMode: a = "display",
1972
- onNotify: i
2059
+ copyMode: i = "display",
2060
+ onNotify: a
1973
2061
  }) {
1974
- const l = z(
1975
- () => dt(e, t),
2062
+ const l = B(
2063
+ () => St(e, t),
1976
2064
  [e, t]
1977
- ), c = z(() => a === "submitFields" ? cr(e, t) : l, [a, e, t, l]);
2065
+ ), c = B(() => i === "submitFields" ? gr(e, t) : l, [i, e, t, l]);
1978
2066
  async function u() {
1979
2067
  try {
1980
- await ht(c), i == null || i("success", "已复制到剪贴板");
2068
+ await Ct(c), a == null || a("success", "已复制到剪贴板");
1981
2069
  } catch {
1982
- i == null || i("error", "复制失败");
2070
+ a == null || a("error", "复制失败");
1983
2071
  }
1984
2072
  }
1985
- const m = a === "submitFields" ? "复制提交字段 curl(向 callback 回传)" : "复制 curl";
1986
- return /* @__PURE__ */ x("div", { className: "ask-user-curl-card", children: [
1987
- /* @__PURE__ */ x("div", { className: "ask-user-curl-card-header", children: [
1988
- /* @__PURE__ */ x("div", { className: "ask-user-curl-card-header-title", children: [
1989
- /* @__PURE__ */ s(L.Text, { type: "secondary", children: n ?? "curl 命令" }),
1990
- r ? /* @__PURE__ */ s(Z, { title: r, children: /* @__PURE__ */ s(Q, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
1991
- o ? /* @__PURE__ */ s(Z, { title: o, children: /* @__PURE__ */ s(Q, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
2073
+ const m = i === "submitFields" ? "复制提交字段 curl(向 callback 回传)" : "复制 curl";
2074
+ return /* @__PURE__ */ C("div", { className: "ask-user-curl-card", children: [
2075
+ /* @__PURE__ */ C("div", { className: "ask-user-curl-card-header", children: [
2076
+ /* @__PURE__ */ C("div", { className: "ask-user-curl-card-header-title", children: [
2077
+ /* @__PURE__ */ s(D.Text, { type: "secondary", children: n ?? "curl 命令" }),
2078
+ r ? /* @__PURE__ */ s(ee, { title: r, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
2079
+ o ? /* @__PURE__ */ s(ee, { title: o, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
1992
2080
  ] }),
1993
- /* @__PURE__ */ s(Z, { title: m, children: /* @__PURE__ */ s(ue, { size: "small", type: "text", onClick: () => void u(), children: "复制" }) })
2081
+ /* @__PURE__ */ s(ee, { title: m, children: /* @__PURE__ */ s(fe, { size: "small", type: "text", onClick: () => void u(), children: "复制" }) })
1994
2082
  ] }),
1995
2083
  /* @__PURE__ */ s("pre", { className: "skopon-form-curl-json", children: l })
1996
2084
  ] });
1997
2085
  }
1998
- function qr(e, t) {
2086
+ function Hr(e, t) {
1999
2087
  if (t && typeof t == "object" && t !== null && "message" in t) {
2000
2088
  const n = t.message;
2001
2089
  if (typeof n == "string" && n.trim())
@@ -2003,156 +2091,156 @@ function qr(e, t) {
2003
2091
  }
2004
2092
  return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
2005
2093
  }
2006
- function eo({
2094
+ function lo({
2007
2095
  payload: e,
2008
2096
  formUniqueId: t,
2009
2097
  callbackUrl: n,
2010
2098
  submitMode: r = "curl",
2011
2099
  fetchFormDetail: o,
2012
- onNotify: a,
2013
- resumeSearch: i = null,
2100
+ onNotify: i,
2101
+ resumeSearch: a = null,
2014
2102
  caseSearch: l = null
2015
2103
  }) {
2016
- const [c, u] = E(null), [m, p] = E(!1), [y, S] = E(!0), [C, F] = E(!1), T = B(null), f = B(!0), h = B(a);
2017
- h.current = a;
2018
- const k = (t == null ? void 0 : t.trim()) ?? "";
2019
- V(() => (f.current = !0, () => {
2104
+ const [c, u] = U(null), [m, p] = U(!1), [g, v] = U(!0), [I, T] = U(!1), k = q(null), f = q(!0), h = q(i);
2105
+ h.current = i;
2106
+ const x = (t == null ? void 0 : t.trim()) ?? "";
2107
+ j(() => (f.current = !0, () => {
2020
2108
  f.current = !1;
2021
- }), []), V(() => {
2022
- let g = !1;
2023
- return k ? (S(!0), p(!1), o({ formUniqueId: k }).then((A) => {
2024
- g || (p(!!A.disabled), u(A.formDefinition ?? null));
2025
- }).catch((A) => {
2026
- var M;
2027
- if (!g) {
2109
+ }), []), j(() => {
2110
+ let P = !1;
2111
+ return x ? (v(!0), p(!1), o({ formUniqueId: x }).then((_) => {
2112
+ P || (p(!!_.disabled), u(_.formDefinition ?? null));
2113
+ }).catch((_) => {
2114
+ var b;
2115
+ if (!P) {
2028
2116
  p(!1), u(null);
2029
- const I = A instanceof Error ? A.message : "获取表单定义失败";
2030
- (M = h.current) == null || M.call(h, "error", I);
2117
+ const F = _ instanceof Error ? _.message : "获取表单定义失败";
2118
+ (b = h.current) == null || b.call(h, "error", F);
2031
2119
  }
2032
2120
  }).finally(() => {
2033
- g || S(!1);
2121
+ P || v(!1);
2034
2122
  }), () => {
2035
- g = !0;
2036
- }) : (S(!1), p(!1), u(null), () => {
2037
- g = !0;
2123
+ P = !0;
2124
+ }) : (v(!1), p(!1), u(null), () => {
2125
+ P = !0;
2038
2126
  });
2039
- }, [k, o]);
2040
- const v = z(() => ut(e), [e]), b = z(() => v ? rr(v, c ?? void 0) : null, [v, c]), P = (b == null ? void 0 : b.matchedBlocks) ?? [], w = !!(v && ar(v) && P.length === 0), U = z(() => w && v ? ir(v) : b && b.renderBlocks.length > 0 ? b.renderBlocks : [], [b, w, v]), O = z(
2041
- () => w ? {} : pt((b == null ? void 0 : b.extraBlocks) ?? []),
2042
- [w, b]
2043
- ), q = z(() => w && v ? lr(v) : U.filter((g) => {
2044
- var A;
2045
- return (A = g.name) == null ? void 0 : A.trim();
2046
- }).map((g) => g.name.trim()), [w, v, U]), K = z(() => {
2047
- if (U.length === 0) return null;
2048
- const g = (b == null ? void 0 : b.title) ?? (v == null ? void 0 : v.title) ?? "", A = (b == null ? void 0 : b.description) ?? (v == null ? void 0 : v.description) ?? "";
2049
- return Wn({ title: g, description: A }, U);
2050
- }, [b, v, U]), Y = k ? `ask-user-${k}` : "ask-user-payload";
2051
- if (y)
2052
- return /* @__PURE__ */ s("div", { className: "ask-user-form-card", children: /* @__PURE__ */ s(_e, { size: "small" }) });
2053
- if (!v || U.length === 0)
2127
+ }, [x, o]);
2128
+ const y = B(() => yt(e), [e]), S = B(() => y ? ur(y, c ?? void 0) : null, [y, c]), M = (S == null ? void 0 : S.matchedBlocks) ?? [], z = !!(y && mr(y) && M.length === 0), $ = B(() => z && y ? dr(y) : S && S.renderBlocks.length > 0 ? S.renderBlocks : [], [S, z, y]), G = B(
2129
+ () => z ? {} : vt((S == null ? void 0 : S.extraBlocks) ?? []),
2130
+ [z, S]
2131
+ ), w = B(() => z && y ? fr(y) : $.filter((P) => {
2132
+ var _;
2133
+ return (_ = P.name) == null ? void 0 : _.trim();
2134
+ }).map((P) => P.name.trim()), [z, y, $]), O = B(() => {
2135
+ if ($.length === 0) return null;
2136
+ const P = (S == null ? void 0 : S.title) ?? (y == null ? void 0 : y.title) ?? "", _ = (S == null ? void 0 : S.description) ?? (y == null ? void 0 : y.description) ?? "";
2137
+ return or({ title: P, description: _ }, $);
2138
+ }, [S, y, $]), H = x ? `ask-user-${x}` : "ask-user-payload";
2139
+ if (g)
2140
+ return /* @__PURE__ */ s("div", { className: "ask-user-form-card", children: /* @__PURE__ */ s(Oe, { size: "small" }) });
2141
+ if (!y || $.length === 0)
2054
2142
  return /* @__PURE__ */ s(
2055
- Vr,
2143
+ Jr,
2056
2144
  {
2057
2145
  payload: e,
2058
2146
  callbackUrl: n,
2059
2147
  copyMode: "submitFields",
2060
- unpublishedFormId: m && k ? k : void 0,
2061
- onNotify: a
2148
+ unpublishedFormId: m && x ? x : void 0,
2149
+ onNotify: i
2062
2150
  }
2063
2151
  );
2064
- async function X() {
2065
- var g, A, M, I, Oe, Be;
2066
- if (!C) {
2067
- F(!0);
2152
+ async function Y() {
2153
+ var P, _, b, F, R, N;
2154
+ if (!I) {
2155
+ T(!0);
2068
2156
  try {
2069
- const G = ((g = T.current) == null ? void 0 : g.getValues(q)) ?? {}, fe = { ...G, ...O };
2157
+ const Z = ((P = k.current) == null ? void 0 : P.getValues(w)) ?? {}, ve = { ...Z, ...G };
2070
2158
  if (r === "post") {
2071
- const Ve = (n ?? "").trim();
2072
- if (!Ve) {
2073
- (A = h.current) == null || A.call(h, "error", "callback_url 为空,无法提交");
2159
+ const je = (n ?? "").trim();
2160
+ if (!je) {
2161
+ (_ = h.current) == null || _.call(h, "error", "callback_url 为空,无法提交");
2074
2162
  return;
2075
2163
  }
2076
- const he = await ur(Ve, fe);
2164
+ const be = await yr(je, ve);
2077
2165
  if (!f.current) return;
2078
- he.ok ? (M = h.current) == null || M.call(h, "success", "提交成功") : (I = h.current) == null || I.call(h, "error", qr(he.status, he.body));
2166
+ be.ok ? (b = h.current) == null || b.call(h, "success", "提交成功") : (F = h.current) == null || F.call(h, "error", Hr(be.status, be.body));
2079
2167
  return;
2080
2168
  }
2081
- if (await ht(
2082
- ft({ cardValues: G, extraValues: O, callbackUrl: n })
2169
+ if (await Ct(
2170
+ xt({ cardValues: Z, extraValues: G, callbackUrl: n })
2083
2171
  ), !f.current) return;
2084
- (Oe = h.current) == null || Oe.call(h, "success", "已复制 curl 到剪贴板");
2085
- } catch (G) {
2172
+ (R = h.current) == null || R.call(h, "success", "已复制 curl 到剪贴板");
2173
+ } catch (Z) {
2086
2174
  if (!f.current) return;
2087
- const fe = G instanceof Error ? G.message : "复制失败";
2088
- (Be = h.current) == null || Be.call(h, "error", fe);
2175
+ const ve = Z instanceof Error ? Z.message : "复制失败";
2176
+ (N = h.current) == null || N.call(h, "error", ve);
2089
2177
  } finally {
2090
- f.current && F(!1);
2178
+ f.current && T(!1);
2091
2179
  }
2092
2180
  }
2093
2181
  }
2094
- return /* @__PURE__ */ x("div", { className: "ask-user-form-card", children: [
2095
- m && k ? /* @__PURE__ */ s("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ s(Z, { title: k, children: /* @__PURE__ */ s(Q, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
2182
+ return /* @__PURE__ */ C("div", { className: "ask-user-form-card", children: [
2183
+ m && x ? /* @__PURE__ */ s("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ s(ee, { title: x, children: /* @__PURE__ */ s(te, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
2096
2184
  /* @__PURE__ */ s(
2097
- Br,
2185
+ Kr,
2098
2186
  {
2099
- ref: T,
2100
- doc: K,
2101
- surfaceId: Y,
2102
- fieldNames: q,
2187
+ ref: k,
2188
+ doc: O,
2189
+ surfaceId: H,
2190
+ fieldNames: w,
2103
2191
  interactive: !0,
2104
- resumeSearch: i,
2192
+ resumeSearch: a,
2105
2193
  caseSearch: l
2106
2194
  }
2107
2195
  ),
2108
- /* @__PURE__ */ s("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ s(Z, { title: r === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ s(
2109
- ue,
2196
+ /* @__PURE__ */ s("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ s(ee, { title: r === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ s(
2197
+ fe,
2110
2198
  {
2111
2199
  type: "primary",
2112
2200
  size: "small",
2113
- loading: C,
2114
- disabled: C,
2115
- onClick: () => void X(),
2201
+ loading: I,
2202
+ disabled: I,
2203
+ onClick: () => void Y(),
2116
2204
  children: "提交"
2117
2205
  }
2118
2206
  ) }) })
2119
2207
  ] });
2120
2208
  }
2121
2209
  export {
2122
- Wr as A2UI_PROTOCOL_VERSION,
2123
- eo as AskUserFormCard,
2124
- rt as CaseSearchProvider,
2125
- Vr as CurlSubmitBlock,
2126
- wt as FORM_MEDIA_SIZES,
2127
- at as ResumeSearchProvider,
2128
- Qr as SkoponA2uiStreamRenderer,
2129
- Br as SkoponFormRenderer,
2130
- Yn as a2uiToBlocks,
2131
- lt as blocksToA2ui,
2132
- sr as buildAskUserCurlBodyJson,
2133
- ft as buildAskUserCurlStatement,
2134
- cr as buildAskUserSubmitCurlFromPayload,
2135
- Wn as buildAskUserSurface,
2136
- dt as buildCurlStatement,
2137
- ht as copyTextToClipboard,
2138
- Zr as createFormClient,
2139
- pt as extractExtraBlockValues,
2140
- Qn as extractSurfaceValues,
2141
- lr as getPayloadInputFieldNames,
2142
- ir as getPayloadRenderableBlocks,
2143
- rr as intersectPayloadBlocksWithForm,
2144
- Me as isA2uiSurfaceEmpty,
2145
- J as isInputBlockType,
2146
- Ue as isLayoutBlockType,
2147
- Ie as isMediaBlockType,
2148
- Zn as mapFormDefinitionFromDto,
2149
- H as normalizeFormDefinition,
2150
- ut as parsePayloadBlocksJson,
2151
- ar as payloadHasInputBlocks,
2152
- Gn as resolveSurfaceFromFormDefinition,
2153
- ur as submitFormJson,
2154
- Xn as surfaceDocToMessages,
2155
- se as syncFormDefinition,
2156
- fn as useCaseSearch,
2157
- An as useResumeSearch
2210
+ oo as A2UI_PROTOCOL_VERSION,
2211
+ lo as AskUserFormCard,
2212
+ ut as CaseSearchProvider,
2213
+ Jr as CurlSubmitBlock,
2214
+ Lt as FORM_MEDIA_SIZES,
2215
+ mt as ResumeSearchProvider,
2216
+ ao as SkoponA2uiStreamRenderer,
2217
+ Kr as SkoponFormRenderer,
2218
+ tr as a2uiToBlocks,
2219
+ ft as blocksToA2ui,
2220
+ hr as buildAskUserCurlBodyJson,
2221
+ xt as buildAskUserCurlStatement,
2222
+ gr as buildAskUserSubmitCurlFromPayload,
2223
+ or as buildAskUserSurface,
2224
+ St as buildCurlStatement,
2225
+ Ct as copyTextToClipboard,
2226
+ io as createFormClient,
2227
+ vt as extractExtraBlockValues,
2228
+ ar as extractSurfaceValues,
2229
+ fr as getPayloadInputFieldNames,
2230
+ dr as getPayloadRenderableBlocks,
2231
+ ur as intersectPayloadBlocksWithForm,
2232
+ Ee as isA2uiSurfaceEmpty,
2233
+ X as isInputBlockType,
2234
+ Be as isLayoutBlockType,
2235
+ Pe as isMediaBlockType,
2236
+ ir as mapFormDefinitionFromDto,
2237
+ W as normalizeFormDefinition,
2238
+ yt as parsePayloadBlocksJson,
2239
+ mr as payloadHasInputBlocks,
2240
+ rr as resolveSurfaceFromFormDefinition,
2241
+ yr as submitFormJson,
2242
+ nr as surfaceDocToMessages,
2243
+ pe as syncFormDefinition,
2244
+ xn as useCaseSearch,
2245
+ Pn as useResumeSearch
2158
2246
  };