@skopon-cool/form-sdk 0.1.8 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,28 +1,31 @@
1
- import { jsx as s, jsxs as k, Fragment as tt } from "react/jsx-runtime";
2
- import { createContext as Be, useContext as qe, useCallback as oe, useSyncExternalStore as Pt, useMemo as R, useState as F, useRef as B, useEffect as q, forwardRef as Et, useImperativeHandle as Ut } from "react";
3
- import { Spin as Le, Button as xe, Typography as H, Avatar as jt, Tag as ie, Select as Ue, Checkbox as Rt, Radio as Ot, Switch as Vt, TimePicker as Bt, DatePicker as qt, Upload as Te, Input as $e, InputNumber as Lt, Tooltip as ae } from "antd";
4
- import { ReloadOutlined as nt, FileTextOutlined as rt, UserOutlined as Dt, FileImageOutlined as Kt, FileExcelOutlined as Ht, FileOutlined as ot, PictureOutlined as Jt, SoundOutlined as Gt, VideoCameraOutlined as Yt } from "@ant-design/icons";
5
- import { createBinderlessComponentImplementation as O, basicCatalog as ge, A2uiSurface as at } from "@a2ui/react/v0_9";
1
+ import './form-sdk.css';
2
+ import { jsx as l, jsxs as C } from "react/jsx-runtime";
3
+ import { createContext as Be, useContext as Oe, useCallback as te, useSyncExternalStore as Mt, useMemo as O, useState as z, useRef as q, useEffect as L, forwardRef as It, useImperativeHandle as Ft } from "react";
4
+ import { Spin as Ve, Button as ge, Typography as H, Avatar as Pt, Tag as re, Select as ze, Checkbox as zt, Radio as Ut, Switch as _t, TimePicker as Et, DatePicker as Rt, Upload as Ce, Input as ke, InputNumber as Bt, ConfigProvider as Ot, Tooltip as ne } from "antd";
5
+ import { ReloadOutlined as Xe, FileTextOutlined as We, UserOutlined as Vt, FileImageOutlined as wt, FileExcelOutlined as qt, FileOutlined as Qe, PictureOutlined as Lt, SoundOutlined as jt, VideoCameraOutlined as $t } from "@ant-design/icons";
6
+ import { createBinderlessComponentImplementation as V, basicCatalog as de, A2uiSurface as Ze } from "@a2ui/react/v0_9";
6
7
  import { z as m } from "zod";
7
- import { Catalog as Wt, MessageProcessor as it } from "@a2ui/web_core/v0_9";
8
- import Ye from "dayjs";
9
- const Ao = "v0.9", Xt = [
8
+ import { Catalog as Dt, MessageProcessor as et } from "@a2ui/web_core/v0_9";
9
+ import { injectBasicCatalogStyles as tt } from "@a2ui/web_core/v0_9/basic_catalog";
10
+ import { injectStyles as nt } from "@a2ui/react/styles";
11
+ import De from "dayjs";
12
+ const lo = "v0.9", Ht = [
10
13
  "huge",
11
14
  "large",
12
15
  "medium",
13
16
  "small",
14
17
  "icon"
15
18
  ];
16
- function je(e) {
19
+ function Ue(e) {
17
20
  return e === "image" || e === "video" || e === "audio";
18
21
  }
19
- function De(e) {
22
+ function we(e) {
20
23
  return e === "heading" || e === "paragraph";
21
24
  }
22
- function X(e) {
23
- return !De(e) && !je(e);
25
+ function W(e) {
26
+ return !we(e) && !Ue(e);
24
27
  }
25
- function Zt() {
28
+ function Kt() {
26
29
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
27
30
  return crypto.randomUUID();
28
31
  if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
@@ -36,11 +39,11 @@ function Zt() {
36
39
  return (e === "x" ? t : t & 3 | 8).toString(16);
37
40
  });
38
41
  }
39
- function se(e) {
40
- const t = Zt().replace(/-/g, "").slice(0, 8);
42
+ function ie(e) {
43
+ const t = Kt().replace(/-/g, "").slice(0, 8);
41
44
  return `${e}${t}`;
42
45
  }
43
- const lt = [
46
+ const rt = [
44
47
  { value: "image/*", label: "图片" },
45
48
  { value: "video/*", label: "视频" },
46
49
  { value: "audio/*", label: "音频" },
@@ -51,7 +54,7 @@ const lt = [
51
54
  { value: "text/plain", label: "纯文本" },
52
55
  { value: "application/zip", label: "ZIP 压缩包" },
53
56
  { value: "application/x-rar-compressed", label: "RAR 压缩包" }
54
- ], Qt = {
57
+ ], Gt = {
55
58
  "image/*": ["image/*"],
56
59
  "video/*": ["video/*"],
57
60
  "audio/*": ["audio/*"],
@@ -71,7 +74,7 @@ const lt = [
71
74
  "text/plain": ["text/plain"],
72
75
  "application/zip": ["application/zip"],
73
76
  "application/x-rar-compressed": ["application/x-rar-compressed"]
74
- }, en = {
77
+ }, Jt = {
75
78
  "image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
76
79
  "video/*": [".mp4", ".mov", ".avi", ".webm"],
77
80
  "audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
@@ -82,14 +85,14 @@ const lt = [
82
85
  "text/plain": [".txt"],
83
86
  "application/zip": [".zip", ".7z"],
84
87
  "application/x-rar-compressed": [".rar"]
85
- }, tn = {
88
+ }, Yt = {
86
89
  "application/msword": "office/word",
87
90
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
88
91
  "application/vnd.ms-excel": "office/excel",
89
92
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
90
93
  "application/vnd.ms-powerpoint": "office/ppt",
91
94
  "application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
92
- }, Ke = [
95
+ }, qe = [
93
96
  { value: ".jpg", label: ".jpg" },
94
97
  { value: ".jpeg", label: ".jpeg" },
95
98
  { value: ".png", label: ".png" },
@@ -115,121 +118,121 @@ const lt = [
115
118
  { value: ".zip", label: ".zip" },
116
119
  { value: ".rar", label: ".rar" },
117
120
  { value: ".7z", label: ".7z" }
118
- ], nn = Object.fromEntries(
119
- lt.map((e) => [e.value, e.label])
120
- ), rn = Object.fromEntries(
121
- Ke.map((e) => [e.value, e.label])
122
- ), on = new Set(lt.map((e) => e.value)), an = new Set(
123
- Ke.map((e) => e.value)
121
+ ], Xt = Object.fromEntries(
122
+ rt.map((e) => [e.value, e.label])
123
+ ), Wt = Object.fromEntries(
124
+ qe.map((e) => [e.value, e.label])
125
+ ), Qt = new Set(rt.map((e) => e.value)), Zt = new Set(
126
+ qe.map((e) => e.value)
124
127
  );
125
- function ln(e) {
128
+ function en(e) {
126
129
  const t = e.trim();
127
- return t ? on.has(t) ? t : tn[t] ?? null : null;
130
+ return t ? Qt.has(t) ? t : Yt[t] ?? null : null;
128
131
  }
129
- function sn(e) {
132
+ function tn(e) {
130
133
  return Array.isArray(e) ? e.map((t) => {
131
134
  const n = t.trim().toLowerCase();
132
135
  return n ? n.startsWith(".") ? n : `.${n}` : "";
133
136
  }).filter(Boolean) : [];
134
137
  }
135
- function ce(e) {
138
+ function ae(e) {
136
139
  if (!Array.isArray(e)) return [];
137
140
  const t = [], n = /* @__PURE__ */ new Set();
138
141
  for (const r of e) {
139
- const o = ln(r);
142
+ const o = en(r);
140
143
  o && !n.has(o) && (n.add(o), t.push(o));
141
144
  }
142
145
  return t;
143
146
  }
144
- function cn(e) {
145
- const t = ce(e), n = [];
147
+ function nn(e) {
148
+ const t = ae(e), n = [];
146
149
  for (const r of t)
147
- n.push(...Qt[r] ?? [r]);
150
+ n.push(...Gt[r] ?? [r]);
148
151
  return n;
149
152
  }
150
- function un(e) {
151
- const t = ce(e);
153
+ function rn(e) {
154
+ const t = ae(e);
152
155
  if (t.length === 0) return [];
153
156
  const n = /* @__PURE__ */ new Set();
154
157
  for (const r of t)
155
- for (const o of en[r] ?? [])
158
+ for (const o of Jt[r] ?? [])
156
159
  n.add(o);
157
- return Ke.filter((r) => n.has(r.value));
160
+ return qe.filter((r) => n.has(r.value));
158
161
  }
159
- function He(e, t) {
160
- const n = sn(t), r = ce(e);
162
+ function Le(e, t) {
163
+ const n = tn(t), r = ae(e);
161
164
  if (r.length === 0)
162
- return n.filter((a) => an.has(a));
165
+ return n.filter((i) => Zt.has(i));
163
166
  const o = new Set(
164
- un(r).map((a) => a.value)
167
+ rn(r).map((i) => i.value)
165
168
  );
166
- return n.filter((a) => o.has(a));
169
+ return n.filter((i) => o.has(i));
167
170
  }
168
- function pn(e, t) {
169
- const n = cn(e), r = He(e, t), o = [...n, ...r];
171
+ function on(e, t) {
172
+ const n = nn(e), r = Le(e, t), o = [...n, ...r];
170
173
  return o.length > 0 ? o.join(",") : void 0;
171
174
  }
172
- function dn(e, t) {
173
- const n = ce(e), r = He(
175
+ function an(e, t) {
176
+ const n = ae(e), r = Le(
174
177
  n,
175
178
  t
176
179
  ), o = [
177
- ...n.map((a) => nn[a] ?? a),
178
- ...r.map((a) => rn[a] ?? a)
180
+ ...n.map((i) => Xt[i] ?? i),
181
+ ...r.map((i) => Wt[i] ?? i)
179
182
  ];
180
183
  return o.length === 0 ? null : o.join("、");
181
184
  }
182
- const mn = [
185
+ const ln = [
183
186
  "video",
184
187
  "audio",
185
188
  "image",
186
189
  "file",
187
190
  "spreadsheet",
188
191
  "document"
189
- ], fn = new Set(mn);
190
- function hn(e) {
191
- return e && fn.has(e) ? e : "file";
192
+ ], sn = new Set(ln);
193
+ function cn(e) {
194
+ return e && sn.has(e) ? e : "file";
192
195
  }
193
- function ue(e) {
194
- return typeof e == "string" && Xt.includes(e) ? e : "medium";
196
+ function le(e) {
197
+ return typeof e == "string" && Ht.includes(e) ? e : "medium";
195
198
  }
196
- function gn(e, t) {
199
+ function un(e, t) {
197
200
  var o;
198
201
  const n = Math.max(1, t);
199
202
  let r = [];
200
- 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);
201
204
  }
202
- function yn(e) {
205
+ function pn(e) {
203
206
  var t;
204
207
  return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
205
208
  }
206
- function vn(e) {
207
- return `form-media-size-${ue(e)}`;
209
+ function dn(e) {
210
+ return `form-media-size-${le(e)}`;
208
211
  }
209
- function bn(e) {
210
- return `form-media-preview form-media-list ${vn(e)}`;
212
+ function mn(e) {
213
+ return `form-media-preview form-media-list ${dn(e)}`;
211
214
  }
212
- const xn = 10;
213
- function Je(e) {
215
+ const fn = 10;
216
+ function je(e) {
214
217
  return e === !0 || e === "true";
215
218
  }
216
- function We(e, t = 1) {
219
+ function He(e, t = 1) {
217
220
  const n = typeof e == "number" ? e : Number(e);
218
221
  return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
219
222
  }
220
- function de(e, t = 1) {
223
+ function ce(e, t = 1) {
221
224
  const n = typeof e == "number" ? e : Number(e);
222
225
  return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
223
226
  }
224
- function Sn(e, t) {
227
+ function hn(e, t) {
225
228
  if (t !== void 0)
226
- return e === "toggle" ? Je(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
229
+ return e === "toggle" ? je(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
227
230
  }
228
- function kn(e) {
229
- 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) : [];
230
- return { agentKind: r, agentUniqueId: o, flowType: a, category: i, flowUniqueIds: l, pageSize: n };
231
+ function gn(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, s = 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: s, pageSize: n };
231
234
  }
232
- function wn(e) {
235
+ function yn(e) {
233
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;
234
237
  return {
235
238
  names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
@@ -238,51 +241,51 @@ function wn(e) {
238
241
  pageSize: n
239
242
  };
240
243
  }
241
- function Cn(e) {
244
+ function vn(e) {
242
245
  if (e.type !== "case_singleselect") return e;
243
246
  const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
244
247
  return { ...e, type: "case_multiselect", defaultValue: t };
245
248
  }
246
- function An(e) {
247
- var o, a;
248
- const t = Cn(e), n = ce(t.fileAcceptTypes), r = t.type;
249
+ function bn(e) {
250
+ var o, i;
251
+ const t = vn(e), n = ae(t.fileAcceptTypes), r = t.type;
249
252
  return {
250
- id: ((o = t.id) == null ? void 0 : o.trim()) || se("block-"),
253
+ id: ((o = t.id) == null ? void 0 : o.trim()) || ie("block-"),
251
254
  type: r,
252
- name: ((a = t.name) == null ? void 0 : a.trim()) || void 0,
255
+ name: ((i = t.name) == null ? void 0 : i.trim()) || void 0,
253
256
  label: t.label ?? "",
254
257
  placeholder: t.placeholder ?? "",
255
258
  help: t.help ?? "",
256
259
  required: t.required === !0,
257
- mediaUrls: je(r) ? gn(t, xn) : void 0,
258
- mediaSize: je(r) ? ue(t.mediaSize) : void 0,
260
+ mediaUrls: Ue(r) ? un(t, fn) : void 0,
261
+ mediaSize: Ue(r) ? le(t.mediaSize) : void 0,
259
262
  fileAcceptTypes: n,
260
- fileAcceptExtensions: He(
263
+ fileAcceptExtensions: Le(
261
264
  n,
262
265
  t.fileAcceptExtensions
263
266
  ),
264
- filePlaceholderIcon: hn(t.filePlaceholderIcon),
265
- fileMinCount: r === "file" ? We(t.fileMinCount, 1) : void 0,
266
- fileMaxCount: r === "file" ? We(t.fileMaxCount, 1) : void 0,
267
- defaultValue: Sn(r, t.defaultValue),
268
- options: Array.isArray(t.options) ? t.options.map((i, l) => {
267
+ filePlaceholderIcon: cn(t.filePlaceholderIcon),
268
+ fileMinCount: r === "file" ? He(t.fileMinCount, 1) : void 0,
269
+ fileMaxCount: r === "file" ? He(t.fileMaxCount, 1) : void 0,
270
+ defaultValue: hn(r, t.defaultValue),
271
+ options: Array.isArray(t.options) ? t.options.map((a, s) => {
269
272
  var c, u;
270
273
  return {
271
- value: ((c = i.value) == null ? void 0 : c.trim()) || `option_${l + 1}`,
272
- label: ((u = i.label) == null ? void 0 : u.trim()) || `选项 ${l + 1}`
274
+ value: ((c = a.value) == null ? void 0 : c.trim()) || `option_${s + 1}`,
275
+ label: ((u = a.label) == null ? void 0 : u.trim()) || `选项 ${s + 1}`
273
276
  };
274
277
  }) : void 0,
275
278
  resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
276
- resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? de(t.resumeMinCount, 1) : void 0,
277
- resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? de(t.resumeMaxCount, 1) : void 0,
278
- resumeFilter: r === "resume_multiselect" ? wn(t.resumeFilter) : void 0,
279
+ resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? ce(t.resumeMinCount, 1) : void 0,
280
+ resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? ce(t.resumeMaxCount, 1) : void 0,
281
+ resumeFilter: r === "resume_multiselect" ? yn(t.resumeFilter) : void 0,
279
282
  caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
280
- caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? de(t.caseMinCount, 1) : void 0,
281
- caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? de(t.caseMaxCount, 1) : void 0,
282
- caseFilter: r === "case_multiselect" ? kn(t.caseFilter) : void 0
283
+ caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? ce(t.caseMinCount, 1) : void 0,
284
+ caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? ce(t.caseMaxCount, 1) : void 0,
285
+ caseFilter: r === "case_multiselect" ? gn(t.caseFilter) : void 0
283
286
  };
284
287
  }
285
- function ye(e) {
288
+ function me(e) {
286
289
  return {
287
290
  title: e.title ?? "",
288
291
  description: e.description ?? "",
@@ -290,38 +293,38 @@ function ye(e) {
290
293
  jsonSchema: e.jsonSchema ?? {}
291
294
  };
292
295
  }
293
- function ne(e) {
296
+ function Z(e) {
294
297
  if (!e || !Array.isArray(e.blocks))
295
- return ye({ title: "", description: "", blocks: [], jsonSchema: {} });
296
- const t = e.blocks.map(An);
297
- return ye({
298
+ return me({ title: "", description: "", blocks: [], jsonSchema: {} });
299
+ const t = e.blocks.map(bn);
300
+ return me({
298
301
  title: typeof e.title == "string" ? e.title : "",
299
302
  description: typeof e.description == "string" ? e.description : "",
300
303
  blocks: t,
301
304
  jsonSchema: {}
302
305
  });
303
306
  }
304
- function Tn(e) {
305
- 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 Sn(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) : [];
306
309
  return {
307
310
  agentKind: n,
308
311
  agentUniqueId: r,
309
312
  flowType: o,
310
- category: a,
311
- flowUniqueIds: i,
313
+ category: i,
314
+ flowUniqueIds: a,
312
315
  pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
313
316
  };
314
317
  }
315
- function Xe(e) {
318
+ function Ke(e) {
316
319
  if (e == null) return;
317
320
  const t = typeof e == "number" ? e : Number(e);
318
321
  if (!(!Number.isFinite(t) || t < 1))
319
322
  return Math.floor(t);
320
323
  }
321
- function $n(e, t) {
322
- var i, l, c, u, d, p;
323
- const { id: n, label: r, path: o, withData: a } = t;
324
- return a({
324
+ function xn(e, t) {
325
+ var a, s, c, u, d, p;
326
+ const { id: n, label: r, path: o, withData: i } = t;
327
+ return i({
325
328
  id: n,
326
329
  component: "SkoponCaseSelect",
327
330
  label: r,
@@ -329,8 +332,8 @@ function $n(e, t) {
329
332
  help: e.help ?? "",
330
333
  enableRefresh: e.caseEnableRefresh !== !1,
331
334
  caseFilter: {
332
- agentKind: (i = e.caseFilter) == null ? void 0 : i.agentKind,
333
- agentUniqueId: (l = e.caseFilter) == null ? void 0 : l.agentUniqueId,
335
+ agentKind: (a = e.caseFilter) == null ? void 0 : a.agentKind,
336
+ agentUniqueId: (s = e.caseFilter) == null ? void 0 : s.agentUniqueId,
334
337
  flowType: (c = e.caseFilter) == null ? void 0 : c.flowType,
335
338
  category: (u = e.caseFilter) == null ? void 0 : u.category,
336
339
  flowUniqueIds: ((d = e.caseFilter) == null ? void 0 : d.flowUniqueIds) ?? [],
@@ -341,40 +344,40 @@ function $n(e, t) {
341
344
  value: { path: o }
342
345
  });
343
346
  }
344
- function Nn(e, t, n) {
347
+ function Cn(e, t, n) {
345
348
  const r = n.nameFromValue(e.value), o = {
346
349
  ...t("case_multiselect"),
347
350
  name: r,
348
351
  caseEnableRefresh: e.enableRefresh !== !1
349
- }, a = n.asLiteral(e.placeholder);
350
- a && (o.placeholder = a);
351
- const i = n.asLiteral(e.help);
352
- i && (o.help = i), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = Tn(e.caseFilter));
353
- const l = Xe(e.minCount);
354
- l !== void 0 && (o.caseMinCount = l);
355
- const c = Xe(e.maxCount);
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 = Sn(e.caseFilter));
356
+ const s = Ke(e.minCount);
357
+ s !== void 0 && (o.caseMinCount = s);
358
+ const c = Ke(e.maxCount);
356
359
  return c !== void 0 && (o.caseMaxCount = c), o;
357
360
  }
358
- const st = Be({ interactive: !0 });
359
- function ct({
361
+ const ot = Be({ interactive: !0 });
362
+ function it({
360
363
  interactive: e,
361
364
  children: t
362
365
  }) {
363
- return /* @__PURE__ */ s(st.Provider, { value: { interactive: e }, children: t });
366
+ return /* @__PURE__ */ l(ot.Provider, { value: { interactive: e }, children: t });
364
367
  }
365
- function J() {
366
- return qe(st);
368
+ function K() {
369
+ return Oe(ot);
367
370
  }
368
- function ut(e) {
371
+ function at(e) {
369
372
  return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
370
373
  }
371
- function Ze(e, t = "value") {
374
+ function Ge(e, t = "value") {
372
375
  const r = e.componentModel.properties[t];
373
- if (!(!ut(r) || r === void 0))
376
+ if (!(!at(r) || r === void 0))
374
377
  return e.dataContext.resolveDynamicValue(r);
375
378
  }
376
379
  function G(e, t = "value") {
377
- const r = e.componentModel.properties[t], o = ut(r), a = oe(
380
+ const r = e.componentModel.properties[t], o = at(r), i = te(
378
381
  (u) => {
379
382
  if (!o || r === void 0) return () => {
380
383
  };
@@ -382,73 +385,73 @@ function G(e, t = "value") {
382
385
  return () => d.unsubscribe();
383
386
  },
384
387
  [e, r, o]
385
- ), i = oe(() => {
388
+ ), a = te(() => {
386
389
  if (!(!o || r === void 0))
387
390
  return e.dataContext.resolveDynamicValue(r);
388
- }, [e, r, o]), l = Pt(a, i, i), c = oe(
391
+ }, [e, r, o]), s = Mt(i, a, a), c = te(
389
392
  (u) => {
390
393
  !o || !r || typeof r != "object" || !("path" in r) || e.dataContext.set(String(r.path), u);
391
394
  },
392
395
  [e, r, o]
393
396
  );
394
- return { value: l, setValue: c, hasBinding: !!o };
397
+ return { value: s, setValue: c, hasBinding: !!o };
395
398
  }
396
- function le(e) {
399
+ function oe(e) {
397
400
  if (typeof e == "string") return e || void 0;
398
401
  if (typeof e == "number") return String(e);
399
402
  }
400
- function K(e) {
403
+ function D(e) {
401
404
  return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
402
405
  }
403
- function ve(e) {
406
+ function fe(e) {
404
407
  if (e == null) return;
405
408
  const t = typeof e == "number" ? e : Number(e);
406
409
  if (!(!Number.isFinite(t) || t < 1))
407
410
  return Math.floor(t);
408
411
  }
409
- function pt(e, t, n, r) {
412
+ function lt(e, t, n, r) {
410
413
  if (e.includes(t)) {
411
- const a = e.filter((i) => i !== t);
412
- return n !== void 0 && a.length < n ? null : a;
414
+ const i = e.filter((a) => a !== t);
415
+ return n !== void 0 && i.length < n ? null : i;
413
416
  }
414
417
  return r !== void 0 && e.length >= r ? null : [...e, t];
415
418
  }
416
- function dt(e, t, n, r, o) {
419
+ function st(e, t, n, r, o) {
417
420
  if (!n) return !0;
418
- const a = e.includes(t);
419
- return !!(!a && o !== void 0 && e.length >= o || a && r !== void 0 && e.length <= r);
421
+ const i = e.includes(t);
422
+ return !!(!i && o !== void 0 && e.length >= o || i && r !== void 0 && e.length <= r);
420
423
  }
421
- function mt(e, t) {
424
+ function ct(e, t) {
422
425
  return t === void 0 || e.length <= t ? null : e.slice(0, t);
423
426
  }
424
- const ft = Be(null);
425
- function ht({
427
+ const ut = Be(null);
428
+ function pt({
426
429
  caseSearch: e,
427
430
  children: t
428
431
  }) {
429
- return /* @__PURE__ */ s(ft.Provider, { value: e ?? null, children: t });
432
+ return /* @__PURE__ */ l(ut.Provider, { value: e ?? null, children: t });
430
433
  }
431
- function In() {
432
- return qe(ft);
434
+ function kn() {
435
+ return Oe(ut);
433
436
  }
434
- function Ne(e) {
437
+ function Ae(e) {
435
438
  return typeof e == "string" ? e : "";
436
439
  }
437
- function Ie(e) {
440
+ function Te(e) {
438
441
  if (!e || typeof e != "object")
439
442
  return { flowUniqueIds: [], pageSize: 20 };
440
- 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) : [];
441
- 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, s = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, c = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
444
+ return { agentKind: o, agentUniqueId: i, flowType: a, category: s, flowUniqueIds: c, pageSize: r };
442
445
  }
443
- function ze(e) {
446
+ function Ne(e) {
444
447
  var r;
445
448
  const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
446
449
  return t || n;
447
450
  }
448
- function zn(e) {
451
+ function An(e) {
449
452
  return JSON.stringify(e);
450
453
  }
451
- const Mn = {
454
+ const Tn = {
452
455
  name: "SkoponCaseSelect",
453
456
  schema: m.object({
454
457
  label: m.any().optional(),
@@ -461,13 +464,13 @@ const Mn = {
461
464
  value: m.any().optional()
462
465
  }).passthrough()
463
466
  };
464
- function Fn({
467
+ function Nn({
465
468
  item: e,
466
469
  selected: t,
467
470
  disabled: n,
468
471
  onToggle: r
469
472
  }) {
470
- return /* @__PURE__ */ k(
473
+ return /* @__PURE__ */ C(
471
474
  "button",
472
475
  {
473
476
  type: "button",
@@ -475,11 +478,11 @@ function Fn({
475
478
  disabled: n,
476
479
  onClick: r,
477
480
  children: [
478
- /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ s(rt, { style: { fontSize: 24, color: "var(--color-primary, #1677ff)" } }) }),
479
- /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-body", children: [
480
- /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-name", children: e.name }),
481
- e.description ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
482
- /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-meta", children: [
481
+ /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ l(We, { style: { fontSize: 24, color: "var(--color-primary, #1677ff)" } }) }),
482
+ /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
483
+ /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-name", children: e.name }),
484
+ e.description ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
485
+ /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-meta", children: [
483
486
  e.caseUniqueId,
484
487
  e.platform ? ` · ${e.platform}` : "",
485
488
  e.link ? ` · ${e.link}` : ""
@@ -489,107 +492,107 @@ function Fn({
489
492
  }
490
493
  );
491
494
  }
492
- function _n({ context: e }) {
493
- const { interactive: t } = J(), n = In(), { value: r, setValue: o } = G(e), a = e.componentModel.properties, i = Ne(a.label), l = Ne(a.placeholder), c = Ne(a.help), u = a.enableRefresh !== !1, d = ve(a.minCount), p = ve(a.maxCount), g = R(() => Ie(a.caseFilter), [a.caseFilter]), v = zn(g), [$, A] = F(1), [w, f] = F(!1), [h, S] = F(""), [y, x] = F([]), [N, E] = F(0), [L, Z] = F(g.pageSize ?? 20), V = B(0), j = K(r);
494
- q(() => {
495
- const b = mt(j, p);
495
+ function Mn({ context: e }) {
496
+ const { interactive: t } = K(), n = kn(), { value: r, setValue: o } = G(e), i = e.componentModel.properties, a = Ae(i.label), s = Ae(i.placeholder), c = Ae(i.help), u = i.enableRefresh !== !1, d = fe(i.minCount), p = fe(i.maxCount), g = O(() => Te(i.caseFilter), [i.caseFilter]), v = An(g), [M, T] = z(1), [k, f] = z(!1), [h, x] = z(""), [y, S] = z([]), [I, E] = z(0), [j, Q] = z(g.pageSize ?? 20), w = q(0), B = D(r);
497
+ L(() => {
498
+ const b = ct(B, p);
496
499
  b !== null && o(b);
497
- }, [p, j, o]);
498
- const Y = R(() => n ? ze(g) ? h || l || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, h, l]), W = oe(
500
+ }, [p, B, o]);
501
+ const J = O(() => n ? Ne(g) ? h || s || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, h, s]), Y = te(
499
502
  async (b) => {
500
- const I = Ie(JSON.parse(v)), U = ++V.current;
501
- if (!n || !ze(I)) {
502
- x([]), E(0), S("");
503
+ const F = Te(JSON.parse(v)), R = ++w.current;
504
+ if (!n || !Ne(F)) {
505
+ S([]), E(0), x("");
503
506
  return;
504
507
  }
505
- f(!0), S("");
508
+ f(!0), x("");
506
509
  try {
507
- const T = await n({ filter: I, page: b });
508
- if (U !== V.current) return;
509
- x(T.list), E(T.total), A(T.page), Z(T.pageSize);
510
- } catch (T) {
511
- if (U !== V.current) return;
512
- x([]), E(0), S(T instanceof Error ? T.message : "加载案例列表失败");
510
+ const N = await n({ filter: F, page: b });
511
+ if (R !== w.current) return;
512
+ S(N.list), E(N.total), T(N.page), Q(N.pageSize);
513
+ } catch (N) {
514
+ if (R !== w.current) return;
515
+ S([]), E(0), x(N instanceof Error ? N.message : "加载案例列表失败");
513
516
  } finally {
514
- U === V.current && f(!1);
517
+ R === w.current && f(!1);
515
518
  }
516
519
  },
517
520
  [n, v]
518
521
  );
519
- q(() => {
520
- A(1), W(1);
521
- }, [v, W]);
522
- const M = (b) => {
522
+ L(() => {
523
+ T(1), Y(1);
524
+ }, [v, Y]);
525
+ const P = (b) => {
523
526
  if (!t) return;
524
- const I = pt(
525
- j,
527
+ const F = lt(
528
+ B,
526
529
  b,
527
530
  d,
528
531
  p
529
532
  );
530
- I !== null && o(I);
531
- }, _ = () => {
532
- const b = Ie(JSON.parse(v)), I = L || b.pageSize || 20, U = Math.max(1, Math.ceil(N / I)), T = $ >= U ? 1 : $ + 1;
533
- W(T);
533
+ F !== null && o(F);
534
+ }, U = () => {
535
+ const b = Te(JSON.parse(v)), F = j || b.pageSize || 20, R = Math.max(1, Math.ceil(I / F)), N = M >= R ? 1 : M + 1;
536
+ Y(N);
534
537
  };
535
- return /* @__PURE__ */ k("div", { className: "form-block-preview skopon-resume-select", children: [
536
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
537
- w && y.length === 0 ? /* @__PURE__ */ k("div", { className: "skopon-resume-select-status", children: [
538
- /* @__PURE__ */ s(Le, { size: "small" }),
538
+ return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
539
+ a ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: a }) : null,
540
+ k && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
541
+ /* @__PURE__ */ l(Ve, { size: "small" }),
539
542
  " 加载案例…"
540
543
  ] }) : null,
541
- !w && y.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: Y }) : null,
542
- y.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ s(
543
- Fn,
544
+ !k && y.length === 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-empty", children: J }) : null,
545
+ y.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ l(
546
+ Nn,
544
547
  {
545
548
  item: b,
546
- selected: j.includes(b.caseUniqueId),
547
- disabled: dt(
548
- j,
549
+ selected: B.includes(b.caseUniqueId),
550
+ disabled: st(
551
+ B,
549
552
  b.caseUniqueId,
550
553
  t,
551
554
  d,
552
555
  p
553
556
  ),
554
- onToggle: () => M(b.caseUniqueId)
557
+ onToggle: () => P(b.caseUniqueId)
555
558
  },
556
559
  b.caseUniqueId
557
560
  )) }) : null,
558
- u && n && ze(g) ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
559
- xe,
561
+ u && n && Ne(g) ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ l(
562
+ ge,
560
563
  {
561
564
  type: "default",
562
565
  size: "small",
563
- icon: /* @__PURE__ */ s(nt, {}),
564
- loading: w,
566
+ icon: /* @__PURE__ */ l(Xe, {}),
567
+ loading: k,
565
568
  disabled: !t,
566
- onClick: _,
569
+ onClick: U,
567
570
  children: "换一批"
568
571
  }
569
572
  ) }) : null,
570
- c ? /* @__PURE__ */ s(H.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
573
+ c ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
571
574
  ] });
572
575
  }
573
- const Pn = O(
574
- Mn,
575
- _n
576
- ), En = {
576
+ const In = V(
577
+ Tn,
578
+ Mn
579
+ ), Fn = {
577
580
  type: "case_multiselect",
578
581
  componentName: "SkoponCaseSelect",
579
- toComponent: $n,
580
- fromComponent: Nn,
581
- catalogComponents: [Pn]
582
+ toComponent: xn,
583
+ fromComponent: Cn,
584
+ catalogComponents: [In]
582
585
  };
583
- function Qe(e) {
586
+ function Je(e) {
584
587
  if (e == null) return;
585
588
  const t = typeof e == "number" ? e : Number(e);
586
589
  if (!(!Number.isFinite(t) || t < 1))
587
590
  return Math.floor(t);
588
591
  }
589
- function Un(e, t) {
590
- var i, l, c, u;
591
- const { id: n, label: r, path: o, withData: a } = t;
592
- return a({
592
+ function Pn(e, t) {
593
+ var a, s, c, u;
594
+ const { id: n, label: r, path: o, withData: i } = t;
595
+ return i({
593
596
  id: n,
594
597
  component: "SkoponResumeSelect",
595
598
  label: r,
@@ -597,8 +600,8 @@ function Un(e, t) {
597
600
  help: e.help ?? "",
598
601
  enableRefresh: e.resumeEnableRefresh !== !1,
599
602
  resumeFilter: {
600
- names: ((i = e.resumeFilter) == null ? void 0 : i.names) ?? [],
601
- agentUniqueIds: ((l = e.resumeFilter) == null ? void 0 : l.agentUniqueIds) ?? [],
603
+ names: ((a = e.resumeFilter) == null ? void 0 : a.names) ?? [],
604
+ agentUniqueIds: ((s = e.resumeFilter) == null ? void 0 : s.agentUniqueIds) ?? [],
602
605
  resumeUniqueIds: ((c = e.resumeFilter) == null ? void 0 : c.resumeUniqueIds) ?? [],
603
606
  pageSize: ((u = e.resumeFilter) == null ? void 0 : u.pageSize) ?? 20
604
607
  },
@@ -607,15 +610,15 @@ function Un(e, t) {
607
610
  value: { path: o }
608
611
  });
609
612
  }
610
- function jn(e, t, n) {
613
+ function zn(e, t, n) {
611
614
  const r = n.nameFromValue(e.value), o = {
612
615
  ...t("resume_multiselect"),
613
616
  name: r,
614
617
  resumeEnableRefresh: e.enableRefresh !== !1
615
- }, a = n.asLiteral(e.placeholder);
616
- a && (o.placeholder = a);
617
- const i = n.asLiteral(e.help);
618
- if (i && (o.help = i), e.resumeFilter && typeof e.resumeFilter == "object") {
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") {
619
622
  const u = e.resumeFilter;
620
623
  o.resumeFilter = {
621
624
  names: Array.isArray(u.names) ? u.names.map(String) : [],
@@ -624,34 +627,34 @@ function jn(e, t, n) {
624
627
  pageSize: typeof u.pageSize == "number" ? u.pageSize : 20
625
628
  };
626
629
  }
627
- const l = Qe(e.minCount);
628
- l !== void 0 && (o.resumeMinCount = l);
629
- const c = Qe(e.maxCount);
630
+ const s = Je(e.minCount);
631
+ s !== void 0 && (o.resumeMinCount = s);
632
+ const c = Je(e.maxCount);
630
633
  return c !== void 0 && (o.resumeMaxCount = c), o;
631
634
  }
632
- const gt = Be(null);
633
- function yt({
635
+ const dt = Be(null);
636
+ function mt({
634
637
  resumeSearch: e,
635
638
  children: t
636
639
  }) {
637
- return /* @__PURE__ */ s(gt.Provider, { value: e ?? null, children: t });
640
+ return /* @__PURE__ */ l(dt.Provider, { value: e ?? null, children: t });
638
641
  }
639
- function Rn() {
640
- return qe(gt);
642
+ function Un() {
643
+ return Oe(dt);
641
644
  }
642
645
  function Me(e) {
643
646
  return typeof e == "string" ? e : "";
644
647
  }
645
- function Fe(e) {
648
+ function Ie(e) {
646
649
  if (!e || typeof e != "object")
647
650
  return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
648
- 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;
649
- 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 };
650
653
  }
651
- function On(e) {
654
+ function _n(e) {
652
655
  return JSON.stringify(e);
653
656
  }
654
- const Vn = {
657
+ const En = {
655
658
  name: "SkoponResumeSelect",
656
659
  schema: m.object({
657
660
  label: m.any().optional(),
@@ -663,40 +666,40 @@ const Vn = {
663
666
  maxCount: m.any().optional(),
664
667
  value: m.any().optional()
665
668
  }).passthrough()
666
- }, Bn = 3, qn = 2;
667
- function _e(e, t) {
668
- const n = (t ?? []).filter(Boolean), r = n.slice(0, Bn), o = n.length - r.length;
669
- return /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-tags", children: [
670
- /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-label", children: e }),
671
- n.length > 0 ? /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-tags-list", children: [
672
- r.map((a) => /* @__PURE__ */ s(ie, { className: "skopon-resume-select-card-tag", children: a }, a)),
673
- o > 0 ? /* @__PURE__ */ k(ie, { className: "skopon-resume-select-card-tag", children: [
669
+ }, Rn = 3, Bn = 2;
670
+ function Fe(e, t) {
671
+ const n = (t ?? []).filter(Boolean), r = n.slice(0, Rn), o = n.length - r.length;
672
+ return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags", children: [
673
+ /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-tags-label", children: e }),
674
+ n.length > 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-tags-list", children: [
675
+ r.map((i) => /* @__PURE__ */ l(re, { className: "skopon-resume-select-card-tag", children: i }, i)),
676
+ o > 0 ? /* @__PURE__ */ C(re, { className: "skopon-resume-select-card-tag", children: [
674
677
  "+",
675
678
  o
676
679
  ] }) : null
677
- ] }) : /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
680
+ ] }) : /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
678
681
  ] });
679
682
  }
680
- function Ln(e) {
681
- return /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-field", children: [
682
- /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
683
- /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
683
+ function On(e) {
684
+ return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-field", children: [
685
+ /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
686
+ /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
684
687
  ] });
685
688
  }
686
- function Dn({ work: e }) {
687
- return /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-work", children: [
688
- /* @__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(Kt, { className: "skopon-resume-select-card-work-placeholder" }) }),
689
- /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
689
+ function Vn({ work: e }) {
690
+ return /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-work", children: [
691
+ /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ l("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ l(wt, { className: "skopon-resume-select-card-work-placeholder" }) }),
692
+ /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
690
693
  ] });
691
694
  }
692
- function Kn({
695
+ function wn({
693
696
  item: e,
694
697
  selected: t,
695
698
  disabled: n,
696
699
  onToggle: r
697
700
  }) {
698
- const o = (e.works ?? []).slice(0, qn);
699
- return /* @__PURE__ */ k(
701
+ const o = (e.works ?? []).slice(0, Bn);
702
+ return /* @__PURE__ */ C(
700
703
  "button",
701
704
  {
702
705
  type: "button",
@@ -704,183 +707,183 @@ function Kn({
704
707
  disabled: n,
705
708
  onClick: r,
706
709
  children: [
707
- /* @__PURE__ */ s(
708
- jt,
710
+ /* @__PURE__ */ l(
711
+ Pt,
709
712
  {
710
713
  size: 48,
711
714
  src: e.avatarUrl || void 0,
712
- icon: e.avatarUrl ? void 0 : /* @__PURE__ */ s(Dt, {}),
715
+ icon: e.avatarUrl ? void 0 : /* @__PURE__ */ l(Vt, {}),
713
716
  className: "skopon-resume-select-card-avatar"
714
717
  }
715
718
  ),
716
- /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
717
- /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-body", children: [
718
- Ln(e.satisfaction),
719
- _e("性格", e.personality),
720
- _e("专长", e.specialties),
721
- _e("擅长领域", e.traits),
722
- /* @__PURE__ */ k("div", { className: "skopon-resume-select-card-works", children: [
723
- /* @__PURE__ */ s("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
724
- o.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-list", children: o.map((a, i) => /* @__PURE__ */ s(Dn, { work: a }, `${a.title}-${i}`)) }) : /* @__PURE__ */ s("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
719
+ /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
720
+ /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
721
+ On(e.satisfaction),
722
+ Fe("性格", e.personality),
723
+ Fe("专长", e.specialties),
724
+ Fe("擅长领域", e.traits),
725
+ /* @__PURE__ */ C("div", { className: "skopon-resume-select-card-works", children: [
726
+ /* @__PURE__ */ l("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
727
+ o.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, a) => /* @__PURE__ */ l(Vn, { work: i }, `${i.title}-${a}`)) }) : /* @__PURE__ */ l("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
725
728
  ] })
726
729
  ] })
727
730
  ]
728
731
  }
729
732
  );
730
733
  }
731
- function Hn({ context: e }) {
732
- const { interactive: t } = J(), n = Rn(), { value: r, setValue: o } = G(e), a = e.componentModel.properties, i = Me(a.label), l = Me(a.placeholder), c = Me(a.help), u = a.enableRefresh !== !1, d = ve(a.minCount), p = ve(a.maxCount), g = R(() => Fe(a.resumeFilter), [a.resumeFilter]), v = On(g), [$, A] = F(1), [w, f] = F(!1), [h, S] = F(""), [y, x] = F([]), [N, E] = F(0), [L, Z] = F(g.pageSize ?? 20), V = B(0), j = K(r);
733
- q(() => {
734
- const b = mt(j, p);
734
+ function qn({ context: e }) {
735
+ const { interactive: t } = K(), n = Un(), { value: r, setValue: o } = G(e), i = e.componentModel.properties, a = Me(i.label), s = Me(i.placeholder), c = Me(i.help), u = i.enableRefresh !== !1, d = fe(i.minCount), p = fe(i.maxCount), g = O(() => Ie(i.resumeFilter), [i.resumeFilter]), v = _n(g), [M, T] = z(1), [k, f] = z(!1), [h, x] = z(""), [y, S] = z([]), [I, E] = z(0), [j, Q] = z(g.pageSize ?? 20), w = q(0), B = D(r);
736
+ L(() => {
737
+ const b = ct(B, p);
735
738
  b !== null && o(b);
736
- }, [p, j, o]);
737
- const Y = oe(
739
+ }, [p, B, o]);
740
+ const J = te(
738
741
  async (b) => {
739
- const I = Fe(JSON.parse(v)), U = ++V.current;
742
+ const F = Ie(JSON.parse(v)), R = ++w.current;
740
743
  if (!n) {
741
- x([]), E(0), S("未配置简历搜索服务");
744
+ S([]), E(0), x("未配置简历搜索服务");
742
745
  return;
743
746
  }
744
- f(!0), S("");
747
+ f(!0), x("");
745
748
  try {
746
- const T = await n({ filter: I, page: b });
747
- if (U !== V.current) return;
748
- x(T.list), E(T.total), A(T.page), Z(T.pageSize);
749
- } catch (T) {
750
- if (U !== V.current) return;
751
- x([]), E(0), S(T instanceof Error ? T.message : "加载简历列表失败");
749
+ const N = await n({ filter: F, page: b });
750
+ if (R !== w.current) return;
751
+ S(N.list), E(N.total), T(N.page), Q(N.pageSize);
752
+ } catch (N) {
753
+ if (R !== w.current) return;
754
+ S([]), E(0), x(N instanceof Error ? N.message : "加载简历列表失败");
752
755
  } finally {
753
- U === V.current && f(!1);
756
+ R === w.current && f(!1);
754
757
  }
755
758
  },
756
759
  [n, v]
757
760
  );
758
- q(() => {
759
- A(1), Y(1);
760
- }, [v, Y]);
761
- const W = (b) => {
761
+ L(() => {
762
+ T(1), J(1);
763
+ }, [v, J]);
764
+ const Y = (b) => {
762
765
  if (!t) return;
763
- const I = pt(
764
- j,
766
+ const F = lt(
767
+ B,
765
768
  b,
766
769
  d,
767
770
  p
768
771
  );
769
- I !== null && o(I);
770
- }, M = () => {
771
- const b = Fe(JSON.parse(v)), I = L || b.pageSize || 20, U = Math.max(1, Math.ceil(N / I)), T = $ >= U ? 1 : $ + 1;
772
- Y(T);
773
- }, _ = l || "暂无匹配的简历";
774
- return /* @__PURE__ */ k("div", { className: "form-block-preview skopon-resume-select", children: [
775
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
776
- w && y.length === 0 ? /* @__PURE__ */ k("div", { className: "skopon-resume-select-status", children: [
777
- /* @__PURE__ */ s(Le, { size: "small" }),
772
+ F !== null && o(F);
773
+ }, P = () => {
774
+ const b = Ie(JSON.parse(v)), F = j || b.pageSize || 20, R = Math.max(1, Math.ceil(I / F)), N = M >= R ? 1 : M + 1;
775
+ J(N);
776
+ }, U = s || "暂无匹配的简历";
777
+ return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
778
+ a ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: a }) : null,
779
+ k && y.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
780
+ /* @__PURE__ */ l(Ve, { size: "small" }),
778
781
  " 加载简历…"
779
782
  ] }) : null,
780
- !w && h ? /* @__PURE__ */ s(H.Text, { type: "danger", className: "skopon-resume-select-status", children: h }) : null,
781
- !w && !h && y.length === 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-empty", children: _ }) : null,
782
- y.length > 0 ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ s(
783
- Kn,
783
+ !k && h ? /* @__PURE__ */ l(H.Text, { type: "danger", className: "skopon-resume-select-status", children: h }) : null,
784
+ !k && !h && y.length === 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-empty", children: U }) : null,
785
+ y.length > 0 ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-list", children: y.map((b) => /* @__PURE__ */ l(
786
+ wn,
784
787
  {
785
788
  item: b,
786
- selected: j.includes(b.resumeUniqueId),
787
- disabled: dt(
788
- j,
789
+ selected: B.includes(b.resumeUniqueId),
790
+ disabled: st(
791
+ B,
789
792
  b.resumeUniqueId,
790
793
  t,
791
794
  d,
792
795
  p
793
796
  ),
794
- onToggle: () => W(b.resumeUniqueId)
797
+ onToggle: () => Y(b.resumeUniqueId)
795
798
  },
796
799
  b.resumeUniqueId
797
800
  )) }) : null,
798
- u && n ? /* @__PURE__ */ s("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ s(
799
- xe,
801
+ u && n ? /* @__PURE__ */ l("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ l(
802
+ ge,
800
803
  {
801
804
  type: "default",
802
805
  size: "small",
803
- icon: /* @__PURE__ */ s(nt, {}),
804
- loading: w,
806
+ icon: /* @__PURE__ */ l(Xe, {}),
807
+ loading: k,
805
808
  disabled: !t,
806
- onClick: M,
809
+ onClick: P,
807
810
  children: "换一批"
808
811
  }
809
812
  ) }) : null,
810
- c ? /* @__PURE__ */ s(H.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
813
+ c ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-help", children: c }) : null
811
814
  ] });
812
815
  }
813
- const Jn = O(
814
- Vn,
815
- Hn
816
- ), Gn = {
816
+ const Ln = V(
817
+ En,
818
+ qn
819
+ ), jn = {
817
820
  type: "resume_multiselect",
818
821
  componentName: "SkoponResumeSelect",
819
- toComponent: Un,
820
- fromComponent: jn,
821
- catalogComponents: [Jn]
822
- }, Se = [Gn, En], Yn = new Map(
823
- Se.map((e) => [e.type, e])
824
- ), Wn = new Map(
825
- Se.map((e) => [e.componentName, e])
822
+ toComponent: Pn,
823
+ fromComponent: zn,
824
+ catalogComponents: [Ln]
825
+ }, ye = [jn, Fn], $n = new Map(
826
+ ye.map((e) => [e.type, e])
827
+ ), Dn = new Map(
828
+ ye.map((e) => [e.componentName, e])
826
829
  );
827
- function Xn(e) {
828
- return Yn.get(e);
830
+ function Hn(e) {
831
+ return $n.get(e);
829
832
  }
830
- function Zn(e) {
831
- return Wn.get(e);
833
+ function Kn(e) {
834
+ return Dn.get(e);
832
835
  }
833
- function Qn() {
834
- return Se.flatMap((e) => e.catalogComponents);
836
+ function Gn() {
837
+ return ye.flatMap((e) => e.catalogComponents);
835
838
  }
836
- function er() {
837
- return Se.map((e) => e.componentName);
839
+ function Jn() {
840
+ return ye.map((e) => e.componentName);
838
841
  }
839
- const be = "root", Re = "__title__", Oe = "__desc__", vt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
840
- function tr(e) {
842
+ const he = "root", _e = "__title__", Ee = "__desc__", ft = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
843
+ function Yn(e) {
841
844
  return `/${e}`;
842
845
  }
843
- function et(e) {
846
+ function Ye(e) {
844
847
  return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
845
848
  }
846
- function P(e) {
849
+ function _(e) {
847
850
  if (typeof e == "string") return e;
848
851
  }
849
- function nr(e) {
850
- const t = e.id || se("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
852
+ function Xn(e) {
853
+ const t = e.id || ie("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
851
854
  return {
852
855
  id: t,
853
856
  component: "SkoponMedia",
854
857
  mediaType: n,
855
- urls: yn(e),
856
- mediaSize: ue(e.mediaSize),
858
+ urls: pn(e),
859
+ mediaSize: le(e.mediaSize),
857
860
  label: e.label ?? "",
858
861
  help: e.help ?? "",
859
862
  placeholder: e.placeholder ?? ""
860
863
  };
861
864
  }
862
- function rr(e) {
865
+ function Wn(e) {
863
866
  if (Array.isArray(e.urls))
864
867
  return e.urls.map((n) => String(n).trim()).filter(Boolean);
865
- const t = P(e.url);
868
+ const t = _(e.url);
866
869
  return t != null && t.trim() ? [t.trim()] : [];
867
870
  }
868
- function me(e, t, n) {
869
- const r = typeof e.id == "string" ? e.id : se("block-"), o = rr(e), a = P(e.label) ?? P(e.description) ?? n, i = P(e.help), l = P(e.placeholder), c = ue(e.mediaSize);
871
+ function ue(e, t, n) {
872
+ const r = typeof e.id == "string" ? e.id : ie("block-"), o = Wn(e), i = _(e.label) ?? _(e.description) ?? n, a = _(e.help), s = _(e.placeholder), c = le(e.mediaSize);
870
873
  return {
871
874
  id: r,
872
875
  type: t,
873
- label: a,
874
- ...i ? { help: i } : {},
875
- ...l ? { placeholder: l } : {},
876
+ label: i,
877
+ ...a ? { help: a } : {},
878
+ ...s ? { placeholder: s } : {},
876
879
  mediaSize: c,
877
880
  mediaUrls: o.length > 0 ? o : [""]
878
881
  };
879
882
  }
880
- function or(e) {
883
+ function Qn(e) {
881
884
  switch (e.type) {
882
885
  case "toggle":
883
- return Je(e.defaultValue);
886
+ return je(e.defaultValue);
884
887
  case "multiselect":
885
888
  case "checkbox":
886
889
  case "resume_multiselect":
@@ -894,11 +897,11 @@ function or(e) {
894
897
  return typeof e.defaultValue == "string" ? e.defaultValue : "";
895
898
  }
896
899
  }
897
- function ar(e) {
900
+ function Zn(e) {
898
901
  var u;
899
- const t = e.id || se("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? tr(r) : void 0, a = (e.options ?? []).map((d) => ({ label: d.label, value: d.value })), i = (d) => r ? { node: d, dataKey: r, dataValue: or(e) } : { node: d }, l = { id: t, label: n, name: r, path: o, withData: i }, c = Xn(e.type);
902
+ const t = e.id || ie("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? Yn(r) : void 0, i = (e.options ?? []).map((d) => ({ label: d.label, value: d.value })), a = (d) => r ? { node: d, dataKey: r, dataValue: Qn(e) } : { node: d }, s = { id: t, label: n, name: r, path: o, withData: a }, c = Hn(e.type);
900
903
  if (c)
901
- return c.toComponent(e, l);
904
+ return c.toComponent(e, s);
902
905
  switch (e.type) {
903
906
  case "heading":
904
907
  return { node: { id: t, component: "Text", text: n, variant: "h3" } };
@@ -907,7 +910,7 @@ function ar(e) {
907
910
  case "text":
908
911
  case "tel":
909
912
  case "url":
910
- return i({
913
+ return a({
911
914
  id: t,
912
915
  component: "TextField",
913
916
  label: n,
@@ -916,17 +919,17 @@ function ar(e) {
916
919
  value: { path: o }
917
920
  });
918
921
  case "email":
919
- return i({
922
+ return a({
920
923
  id: t,
921
924
  component: "TextField",
922
925
  label: n,
923
926
  variant: "shortText",
924
- validationRegexp: vt,
927
+ validationRegexp: ft,
925
928
  ...e.placeholder ? { placeholder: e.placeholder } : {},
926
929
  value: { path: o }
927
930
  });
928
931
  case "textarea":
929
- return i({
932
+ return a({
930
933
  id: t,
931
934
  component: "TextField",
932
935
  label: n,
@@ -935,7 +938,7 @@ function ar(e) {
935
938
  value: { path: o }
936
939
  });
937
940
  case "number":
938
- return i({
941
+ return a({
939
942
  id: t,
940
943
  component: "TextField",
941
944
  label: n,
@@ -944,49 +947,49 @@ function ar(e) {
944
947
  value: { path: o }
945
948
  });
946
949
  case "select":
947
- return i({
950
+ return a({
948
951
  id: t,
949
952
  component: "SkoponSelect",
950
953
  label: n,
951
954
  mode: "single",
952
955
  placeholder: e.placeholder ?? "",
953
- options: a,
956
+ options: i,
954
957
  value: { path: o }
955
958
  });
956
959
  case "radio":
957
- return i({
960
+ return a({
958
961
  id: t,
959
962
  component: "ChoicePicker",
960
963
  label: n,
961
964
  variant: "mutuallyExclusive",
962
965
  skoponPickerType: "radio",
963
- options: a,
966
+ options: i,
964
967
  value: { path: o }
965
968
  });
966
969
  case "multiselect":
967
- return i({
970
+ return a({
968
971
  id: t,
969
972
  component: "SkoponSelect",
970
973
  label: n,
971
974
  mode: "multiple",
972
975
  placeholder: e.placeholder ?? "",
973
- options: a,
976
+ options: i,
974
977
  value: { path: o }
975
978
  });
976
979
  case "checkbox":
977
- return i({
980
+ return a({
978
981
  id: t,
979
982
  component: "ChoicePicker",
980
983
  label: n,
981
984
  variant: "multipleSelection",
982
985
  skoponPickerType: "checkbox",
983
- options: a,
986
+ options: i,
984
987
  value: { path: o }
985
988
  });
986
989
  case "toggle":
987
- return i({ id: t, component: "CheckBox", label: n, value: { path: o } });
990
+ return a({ id: t, component: "CheckBox", label: n, value: { path: o } });
988
991
  case "datetime":
989
- return i({
992
+ return a({
990
993
  id: t,
991
994
  component: "DateTimeInput",
992
995
  label: n,
@@ -996,7 +999,7 @@ function ar(e) {
996
999
  value: { path: o }
997
1000
  });
998
1001
  case "time":
999
- return i({
1002
+ return a({
1000
1003
  id: t,
1001
1004
  component: "DateTimeInput",
1002
1005
  label: n,
@@ -1007,9 +1010,9 @@ function ar(e) {
1007
1010
  case "image":
1008
1011
  case "video":
1009
1012
  case "audio":
1010
- return { node: nr(e) };
1013
+ return { node: Xn(e) };
1011
1014
  case "file":
1012
- return i({
1015
+ return a({
1013
1016
  id: t,
1014
1017
  component: "FileUpload",
1015
1018
  label: n,
@@ -1024,25 +1027,25 @@ function ar(e) {
1024
1027
  return { node: null };
1025
1028
  }
1026
1029
  }
1027
- function Ve(e) {
1030
+ function Re(e) {
1028
1031
  if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
1029
- const t = e.components.find((r) => r.id === be);
1032
+ const t = e.components.find((r) => r.id === he);
1030
1033
  if (!t) return e.components.length === 0;
1031
1034
  const n = t.children;
1032
1035
  return !Array.isArray(n) || n.length === 0;
1033
1036
  }
1034
- function bt(e, t) {
1035
- const n = [], r = [], o = {}, a = (t == null ? void 0 : t.includeHeader) !== !1, i = (e.title ?? "").trim(), l = (e.description ?? "").trim();
1036
- a && i && (n.push({ id: Re, component: "Text", text: i, variant: "h2" }), r.push(Re)), a && l && (n.push({ id: Oe, component: "Text", text: l, variant: "body" }), r.push(Oe));
1037
+ function ht(e, t) {
1038
+ const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, a = (e.title ?? "").trim(), s = (e.description ?? "").trim();
1039
+ i && a && (n.push({ id: _e, component: "Text", text: a, variant: "h2" }), r.push(_e)), i && s && (n.push({ id: Ee, component: "Text", text: s, variant: "body" }), r.push(Ee));
1037
1040
  for (const d of e.blocks ?? []) {
1038
- const { node: p, dataKey: g, dataValue: v } = ar(d);
1041
+ const { node: p, dataKey: g, dataValue: v } = Zn(d);
1039
1042
  p && (n.push(p), r.push(p.id), g && (o[g] = v));
1040
1043
  }
1041
- n.unshift({ id: be, component: "Column", children: r });
1042
- const c = { root: be, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1044
+ n.unshift({ id: he, component: "Column", children: r });
1045
+ const c = { root: he, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
1043
1046
  return u !== void 0 && (c.surfaceProperties = { styleId: u ?? null }), c;
1044
1047
  }
1045
- function ir(e) {
1048
+ function er(e) {
1046
1049
  const t = /* @__PURE__ */ new Map();
1047
1050
  for (const n of e.components ?? [])
1048
1051
  n && typeof n.id == "string" && t.set(n.id, n);
@@ -1059,116 +1062,116 @@ function Pe(e) {
1059
1062
  };
1060
1063
  }).filter((n) => !!n) : [];
1061
1064
  }
1062
- function lr(e) {
1063
- const t = typeof e.id == "string" ? e.id : se("block-"), n = String(e.component ?? ""), r = P(e.label) ?? P(e.text) ?? "", o = et(e.value), a = (l) => ({ id: t, type: l, label: r }), i = Zn(n);
1064
- if (i)
1065
- return i.fromComponent(e, a, { asLiteral: P, nameFromValue: et });
1065
+ function tr(e) {
1066
+ const t = typeof e.id == "string" ? e.id : ie("block-"), n = String(e.component ?? ""), r = _(e.label) ?? _(e.text) ?? "", o = Ye(e.value), i = (s) => ({ id: t, type: s, label: r }), a = Kn(n);
1067
+ if (a)
1068
+ return a.fromComponent(e, i, { asLiteral: _, nameFromValue: Ye });
1066
1069
  switch (n) {
1067
1070
  case "Text": {
1068
- const l = String(e.variant ?? "body"), c = /^h[1-6]$/i.test(l) || l === "title" || l === "subtitle";
1071
+ const s = String(e.variant ?? "body"), c = /^h[1-6]$/i.test(s) || s === "title" || s === "subtitle";
1069
1072
  return { id: t, type: c ? "heading" : "paragraph", label: r };
1070
1073
  }
1071
1074
  case "TextField": {
1072
- const l = String(e.variant ?? "shortText");
1075
+ const s = String(e.variant ?? "shortText");
1073
1076
  let c = "text";
1074
- l === "longText" ? c = "textarea" : l === "number" ? c = "number" : P(e.validationRegexp) === vt && (c = "email");
1075
- const u = { ...a(c), name: o }, d = P(e.placeholder);
1077
+ s === "longText" ? c = "textarea" : s === "number" ? c = "number" : _(e.validationRegexp) === ft && (c = "email");
1078
+ const u = { ...i(c), name: o }, d = _(e.placeholder);
1076
1079
  return d && (u.placeholder = d), u;
1077
1080
  }
1078
1081
  case "CheckBox":
1079
- return { ...a("toggle"), name: o };
1082
+ return { ...i("toggle"), name: o };
1080
1083
  case "SkoponSelect": {
1081
1084
  const c = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", u = {
1082
- ...a(c),
1085
+ ...i(c),
1083
1086
  name: o,
1084
1087
  options: Pe(e)
1085
- }, d = P(e.placeholder);
1088
+ }, d = _(e.placeholder);
1086
1089
  return d && (u.placeholder = d), u;
1087
1090
  }
1088
1091
  case "ChoicePicker": {
1089
- const l = P(e.skoponPickerType);
1090
- if (l === "select" || l === "multiselect" || l === "radio" || l === "checkbox") {
1092
+ const s = _(e.skoponPickerType);
1093
+ if (s === "select" || s === "multiselect" || s === "radio" || s === "checkbox") {
1091
1094
  const d = {
1092
- ...a(l),
1095
+ ...i(s),
1093
1096
  name: o,
1094
1097
  options: Pe(e)
1095
- }, p = P(e.placeholder);
1098
+ }, p = _(e.placeholder);
1096
1099
  return p && (d.placeholder = p), d;
1097
1100
  }
1098
1101
  const u = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
1099
- return { ...a(u), name: o, options: Pe(e) };
1102
+ return { ...i(u), name: o, options: Pe(e) };
1100
1103
  }
1101
1104
  case "DateTimeInput": {
1102
- const l = e.enableDate === !0, c = e.enableTime === !0, d = { ...a(!l && c ? "time" : "datetime"), name: o }, p = P(e.placeholder);
1105
+ const s = e.enableDate === !0, c = e.enableTime === !0, d = { ...i(!s && c ? "time" : "datetime"), name: o }, p = _(e.placeholder);
1103
1106
  return p && (d.placeholder = p), d;
1104
1107
  }
1105
1108
  case "SkoponMedia": {
1106
- const l = String(e.mediaType ?? "image");
1107
- return me(e, l === "video" ? "video" : l === "audio" ? "audio" : "image", r);
1109
+ const s = String(e.mediaType ?? "image");
1110
+ return ue(e, s === "video" ? "video" : s === "audio" ? "audio" : "image", r);
1108
1111
  }
1109
1112
  case "Image":
1110
- return me(e, "image", r);
1113
+ return ue(e, "image", r);
1111
1114
  case "Video":
1112
- return me(e, "video", r);
1115
+ return ue(e, "video", r);
1113
1116
  case "AudioPlayer":
1114
- return me(e, "audio", r);
1117
+ return ue(e, "audio", r);
1115
1118
  case "FileUpload": {
1116
- const l = P(e.accept) ?? "", c = { ...a("file"), name: o };
1117
- 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;
1119
+ const s = _(e.accept) ?? "", c = { ...i("file"), name: o };
1120
+ return s && (c.fileAcceptExtensions = s.split(",").map((u) => u.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (c.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (c.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (c.fileMinCount = e.minCount), typeof e.maxCount == "number" && (c.fileMaxCount = e.maxCount), c;
1118
1121
  }
1119
1122
  default:
1120
1123
  return null;
1121
1124
  }
1122
1125
  }
1123
- function xt(e, t, n, r) {
1126
+ function gt(e, t, n, r) {
1124
1127
  if (n.has(e)) return;
1125
1128
  n.add(e);
1126
1129
  const o = t.get(e);
1127
1130
  if (!o) return;
1128
- const a = String(o.component ?? "");
1129
- if ((a === "Column" || a === "Row") && Array.isArray(o.children)) {
1130
- for (const i of o.children)
1131
- typeof i == "string" && xt(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" && gt(a, t, n, r);
1132
1135
  return;
1133
1136
  }
1134
1137
  r.push(o);
1135
1138
  }
1136
- function sr(e, t) {
1139
+ function nr(e, t) {
1137
1140
  return t ? e.map((n) => {
1138
- var a;
1139
- const r = (a = n.name) == null ? void 0 : a.trim();
1141
+ var i;
1142
+ const r = (i = n.name) == null ? void 0 : i.trim();
1140
1143
  if (!r || !(r in t)) return n;
1141
1144
  const o = t[r];
1142
1145
  return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: o === !0 || o === "true" } : { ...n, defaultValue: o };
1143
1146
  }) : e;
1144
1147
  }
1145
- function cr(e) {
1148
+ function rr(e) {
1146
1149
  if (!e || !Array.isArray(e.components))
1147
- return ye({ title: "", description: "", blocks: [], jsonSchema: {} });
1148
- const t = ir(e), n = [];
1149
- xt(e.root ?? be, t, /* @__PURE__ */ new Set(), n);
1150
+ return me({ title: "", description: "", blocks: [], jsonSchema: {} });
1151
+ const t = er(e), n = [];
1152
+ gt(e.root ?? he, t, /* @__PURE__ */ new Set(), n);
1150
1153
  let r = "", o = "";
1151
- const a = [];
1152
- for (const i of n) {
1153
- if (i.id === Re) {
1154
- r = P(i.text) ?? r;
1154
+ const i = [];
1155
+ for (const a of n) {
1156
+ if (a.id === _e) {
1157
+ r = _(a.text) ?? r;
1155
1158
  continue;
1156
1159
  }
1157
- if (i.id === Oe) {
1158
- o = P(i.text) ?? o;
1160
+ if (a.id === Ee) {
1161
+ o = _(a.text) ?? o;
1159
1162
  continue;
1160
1163
  }
1161
- const l = lr(i);
1162
- l && a.push(l);
1164
+ const s = tr(a);
1165
+ s && i.push(s);
1163
1166
  }
1164
- return ye({
1167
+ return me({
1165
1168
  title: r,
1166
1169
  description: o,
1167
- blocks: sr(a, e.dataModel),
1170
+ blocks: nr(i, e.dataModel),
1168
1171
  jsonSchema: {}
1169
1172
  });
1170
1173
  }
1171
- function ur(e, t) {
1174
+ function or(e, t) {
1172
1175
  const { surfaceId: n, catalogId: r } = t, o = [
1173
1176
  { version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
1174
1177
  {
@@ -1181,24 +1184,24 @@ function ur(e, t) {
1181
1184
  updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
1182
1185
  }), o;
1183
1186
  }
1184
- function St(e) {
1187
+ function yt(e) {
1185
1188
  return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
1186
1189
  }
1187
- function pr(e, t) {
1190
+ function ir(e, t) {
1188
1191
  if (!e || typeof e != "object") return null;
1189
- const n = e, r = St(n.a2ui) ? n.a2ui : void 0;
1190
- if (r && !Ve(r)) return r;
1192
+ const n = e, r = yt(n.a2ui) ? n.a2ui : void 0;
1193
+ if (r && !Re(r)) return r;
1191
1194
  const o = Array.isArray(n.blocks) ? n.blocks : [];
1192
1195
  if (o.length === 0) return null;
1193
- const a = ne({
1196
+ const i = Z({
1194
1197
  title: typeof n.title == "string" ? n.title : "",
1195
1198
  description: typeof n.description == "string" ? n.description : "",
1196
1199
  blocks: o
1197
- }), i = bt(a, t);
1198
- return Ve(i) ? null : i;
1200
+ }), a = ht(i, t);
1201
+ return Re(a) ? null : a;
1199
1202
  }
1200
- function dr(e, t, n) {
1201
- return bt(
1203
+ function ar(e, t, n) {
1204
+ return ht(
1202
1205
  {
1203
1206
  title: e.title,
1204
1207
  description: e.description,
@@ -1207,88 +1210,88 @@ function dr(e, t, n) {
1207
1210
  n
1208
1211
  );
1209
1212
  }
1210
- function mr(e) {
1213
+ function lr(e) {
1211
1214
  if (!e || typeof e != "object" || Array.isArray(e))
1212
1215
  return;
1213
1216
  const t = e;
1214
- return !(Array.isArray(t.blocks) && t.blocks.length > 0) && St(t.a2ui) ? cr(t.a2ui) : ne({
1217
+ return !(Array.isArray(t.blocks) && t.blocks.length > 0) && yt(t.a2ui) ? rr(t.a2ui) : Z({
1215
1218
  title: typeof t.title == "string" ? t.title : "",
1216
1219
  description: typeof t.description == "string" ? t.description : "",
1217
1220
  blocks: Array.isArray(t.blocks) ? t.blocks : []
1218
1221
  });
1219
1222
  }
1220
- function fr(e, t, n) {
1223
+ function sr(e, t, n) {
1221
1224
  const r = e.model.surfacesMap.get(t);
1222
1225
  if (!r) return {};
1223
1226
  const o = {};
1224
- for (const a of n) {
1225
- const i = a.trim();
1226
- 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}`));
1227
1230
  }
1228
1231
  return o;
1229
1232
  }
1230
- function hr(e) {
1231
- return ne({
1233
+ function cr(e) {
1234
+ return Z({
1232
1235
  title: "",
1233
1236
  description: "",
1234
1237
  blocks: [e]
1235
1238
  }).blocks[0];
1236
1239
  }
1237
- function gr(e, t) {
1238
- var o, a;
1240
+ function ur(e, t) {
1241
+ var o, i;
1239
1242
  const n = /* @__PURE__ */ new Map();
1240
- for (const i of t) {
1241
- const l = (o = i.name) == null ? void 0 : o.trim();
1242
- l && n.set(l, i);
1243
+ for (const a of t) {
1244
+ const s = (o = a.name) == null ? void 0 : o.trim();
1245
+ s && n.set(s, a);
1243
1246
  }
1244
1247
  const r = [];
1245
- for (const i of e.blocks) {
1246
- if (De(i.type)) {
1247
- r.push(hr(i));
1248
+ for (const a of e.blocks) {
1249
+ if (we(a.type)) {
1250
+ r.push(cr(a));
1248
1251
  continue;
1249
1252
  }
1250
- if (!X(i.type)) continue;
1251
- const l = (a = i.name) == null ? void 0 : a.trim();
1252
- if (!l) continue;
1253
- const c = n.get(l);
1253
+ if (!W(a.type)) continue;
1254
+ const s = (i = a.name) == null ? void 0 : i.trim();
1255
+ if (!s) continue;
1256
+ const c = n.get(s);
1254
1257
  c && r.push(c);
1255
1258
  }
1256
1259
  return r;
1257
1260
  }
1258
- function yr(e, t) {
1261
+ function pr(e, t) {
1259
1262
  var r;
1260
1263
  const n = {
1261
1264
  ...e,
1262
1265
  name: ((r = e.name) == null ? void 0 : r.trim()) || t.name
1263
1266
  };
1264
- return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), ne({
1267
+ return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), Z({
1265
1268
  title: "",
1266
1269
  description: "",
1267
1270
  blocks: [n]
1268
1271
  }).blocks[0];
1269
1272
  }
1270
- function kt(e) {
1273
+ function vt(e) {
1271
1274
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
1272
1275
  const t = e;
1273
- return Array.isArray(t.blocks) ? ne({
1276
+ return Array.isArray(t.blocks) ? Z({
1274
1277
  title: typeof t.title == "string" ? t.title : "",
1275
1278
  description: typeof t.description == "string" ? t.description : "",
1276
1279
  blocks: t.blocks
1277
1280
  }) : null;
1278
1281
  }
1279
- function vr(e, t) {
1280
- var a, i, l, c, u, d;
1282
+ function dr(e, t) {
1283
+ var i, a, s, c, u, d;
1281
1284
  const n = /* @__PURE__ */ new Map();
1282
1285
  for (const p of (t == null ? void 0 : t.blocks) ?? [])
1283
- X(p.type) && ((a = p.name) != null && a.trim()) && n.set(p.name.trim(), p);
1286
+ W(p.type) && ((i = p.name) != null && i.trim()) && n.set(p.name.trim(), p);
1284
1287
  const r = [], o = [];
1285
1288
  for (const p of e.blocks) {
1286
- if (!X(p.type)) continue;
1287
- const g = (i = p.name) == null ? void 0 : i.trim();
1289
+ if (!W(p.type)) continue;
1290
+ const g = (a = p.name) == null ? void 0 : a.trim();
1288
1291
  if (!g) continue;
1289
1292
  const v = n.get(g);
1290
- v ? r.push(yr(v, p)) : o.push(
1291
- ne({
1293
+ v ? r.push(pr(v, p)) : o.push(
1294
+ Z({
1292
1295
  title: "",
1293
1296
  description: "",
1294
1297
  blocks: [p]
@@ -1298,84 +1301,84 @@ function vr(e, t) {
1298
1301
  return {
1299
1302
  matchedBlocks: r,
1300
1303
  extraBlocks: o,
1301
- renderBlocks: gr(e, r),
1302
- title: ((l = e.title) == null ? void 0 : l.trim()) || ((c = t == null ? void 0 : t.title) == null ? void 0 : c.trim()) || "",
1304
+ renderBlocks: ur(e, r),
1305
+ title: ((s = e.title) == null ? void 0 : s.trim()) || ((c = t == null ? void 0 : t.title) == null ? void 0 : c.trim()) || "",
1303
1306
  description: ((u = e.description) == null ? void 0 : u.trim()) || ((d = t == null ? void 0 : t.description) == null ? void 0 : d.trim()) || ""
1304
1307
  };
1305
1308
  }
1306
- function br(e) {
1309
+ function mr(e) {
1307
1310
  const { type: t, defaultValue: n } = e;
1308
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 : "";
1309
1312
  }
1310
- function wt(e) {
1313
+ function bt(e) {
1311
1314
  var n;
1312
1315
  const t = {};
1313
1316
  for (const r of e) {
1314
- if (!X(r.type)) continue;
1317
+ if (!W(r.type)) continue;
1315
1318
  const o = (n = r.name) == null ? void 0 : n.trim();
1316
- o && (t[o] = br(r));
1319
+ o && (t[o] = mr(r));
1317
1320
  }
1318
1321
  return t;
1319
1322
  }
1320
- function xr(e) {
1323
+ function fr(e) {
1321
1324
  return e.blocks.some(
1322
1325
  (t) => {
1323
1326
  var n;
1324
- return X(t.type) && !!((n = t.name) != null && n.trim());
1327
+ return W(t.type) && !!((n = t.name) != null && n.trim());
1325
1328
  }
1326
1329
  );
1327
1330
  }
1328
- function Sr(e) {
1331
+ function hr(e) {
1329
1332
  return e.blocks.filter((t) => {
1330
1333
  var n;
1331
- return De(t.type) ? !0 : X(t.type) && !!((n = t.name) != null && n.trim());
1334
+ return we(t.type) ? !0 : W(t.type) && !!((n = t.name) != null && n.trim());
1332
1335
  });
1333
1336
  }
1334
- function kr(e) {
1337
+ function gr(e) {
1335
1338
  return e.blocks.filter((t) => {
1336
1339
  var n;
1337
- return X(t.type) && ((n = t.name) == null ? void 0 : n.trim());
1340
+ return W(t.type) && ((n = t.name) == null ? void 0 : n.trim());
1338
1341
  }).map((t) => t.name.trim());
1339
1342
  }
1340
- function Ct(e) {
1343
+ function St(e) {
1341
1344
  return e.replace(/'/g, "'\\''");
1342
1345
  }
1343
- function At(e, t) {
1346
+ function xt(e, t) {
1344
1347
  const n = (t ?? "").trim() || "<callback_url>", r = JSON.stringify(e ?? {}, null, 2);
1345
1348
  return [
1346
1349
  `curl -X POST '${n}' \\`,
1347
1350
  " -H 'Content-Type: application/json' \\",
1348
- ` -d '${Ct(r)}'`
1351
+ ` -d '${St(r)}'`
1349
1352
  ].join(`
1350
1353
  `);
1351
1354
  }
1352
- function wr(e, t) {
1355
+ function yr(e, t) {
1353
1356
  return JSON.stringify({ ...e, ...t }, null, 2);
1354
1357
  }
1355
- function Tt({
1358
+ function Ct({
1356
1359
  cardValues: e,
1357
1360
  extraValues: t = {},
1358
1361
  callbackUrl: n
1359
1362
  }) {
1360
- const r = (n ?? "").trim() || "<callback_url>", o = wr(e, t);
1363
+ const r = (n ?? "").trim() || "<callback_url>", o = yr(e, t);
1361
1364
  return [
1362
1365
  `curl -X POST '${r}' \\`,
1363
1366
  " -H 'Content-Type: application/json' \\",
1364
- ` -d '${Ct(o)}'`
1367
+ ` -d '${St(o)}'`
1365
1368
  ].join(`
1366
1369
  `);
1367
1370
  }
1368
- function Cr(e, t) {
1369
- const n = kt(e);
1370
- if (!n) return At(e, t);
1371
- const r = wt(n.blocks);
1372
- return Tt({ cardValues: r, callbackUrl: t });
1371
+ function vr(e, t) {
1372
+ const n = vt(e);
1373
+ if (!n) return xt(e, t);
1374
+ const r = bt(n.blocks);
1375
+ return Ct({ cardValues: r, callbackUrl: t });
1373
1376
  }
1374
- async function Ar(e, t, n) {
1377
+ async function br(e, t, n) {
1375
1378
  const r = e.trim();
1376
1379
  if (!r)
1377
1380
  throw new Error("callback_url 为空");
1378
- const a = await ((n == null ? void 0 : n.fetch) ?? fetch)(r, {
1381
+ const i = await ((n == null ? void 0 : n.fetch) ?? fetch)(r, {
1379
1382
  method: "POST",
1380
1383
  headers: {
1381
1384
  "Content-Type": "application/json",
@@ -1383,22 +1386,22 @@ async function Ar(e, t, n) {
1383
1386
  },
1384
1387
  body: JSON.stringify(t ?? {})
1385
1388
  });
1386
- let i;
1387
- if ((a.headers.get("content-type") ?? "").includes("application/json"))
1389
+ let a;
1390
+ if ((i.headers.get("content-type") ?? "").includes("application/json"))
1388
1391
  try {
1389
- i = await a.json();
1392
+ a = await i.json();
1390
1393
  } catch {
1391
- i = void 0;
1394
+ a = void 0;
1392
1395
  }
1393
1396
  else
1394
1397
  try {
1395
- i = await a.text();
1398
+ a = await i.text();
1396
1399
  } catch {
1397
- i = void 0;
1400
+ a = void 0;
1398
1401
  }
1399
- return { ok: a.ok, status: a.status, body: i };
1402
+ return { ok: i.ok, status: i.status, body: a };
1400
1403
  }
1401
- async function $t(e) {
1404
+ async function kt(e) {
1402
1405
  var n;
1403
1406
  if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
1404
1407
  await navigator.clipboard.writeText(e);
@@ -1414,7 +1417,7 @@ async function $t(e) {
1414
1417
  document.body.removeChild(t);
1415
1418
  }
1416
1419
  }
1417
- async function Tr(e) {
1420
+ async function Sr(e) {
1418
1421
  let t;
1419
1422
  try {
1420
1423
  t = await e.json();
@@ -1427,902 +1430,46 @@ async function Tr(e) {
1427
1430
  throw new Error(t.message || `响应缺少 data (${e.status})`);
1428
1431
  return t.data;
1429
1432
  }
1430
- function To(e = {}) {
1433
+ function so(e = {}) {
1431
1434
  const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
1432
- async function o(a) {
1435
+ async function o(i) {
1433
1436
  var p;
1434
- const i = new URLSearchParams();
1435
- if (a.formId !== void 0)
1436
- i.set("form_id", String(a.formId));
1437
- else if (a.formUniqueId)
1438
- 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);
1439
1442
  else
1440
1443
  throw new Error("form_id 或 form_unique_id 至少传一个");
1441
- const l = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${i.toString()}`, {
1444
+ const s = await ((p = e.getHeaders) == null ? void 0 : p.call(e)) ?? {}, c = await r(`${t}${n}?${a.toString()}`, {
1442
1445
  method: "GET",
1443
- headers: l
1444
- }), u = await Tr(c), d = mr(u.form_definition);
1446
+ headers: s
1447
+ }), u = await Sr(c), d = lr(u.form_definition);
1445
1448
  return {
1446
1449
  formUniqueId: u.form_unique_id,
1447
1450
  formId: u.form_id,
1448
1451
  disabled: u.disabled === 1,
1449
1452
  formDefinition: d,
1450
- a2ui: pr(u.form_definition) ?? void 0
1453
+ a2ui: ir(u.form_definition) ?? void 0
1451
1454
  };
1452
1455
  }
1453
1456
  return { fetchDetail: o };
1454
1457
  }
1455
- const $r = `
1456
- :where(:root) {
1457
- color-scheme: light dark;
1458
- }
1459
-
1460
- :where(.a2ui-dark) {
1461
- color-scheme: dark;
1462
- }
1463
-
1464
- :where(.a2ui-light) {
1465
- color-scheme: light;
1466
- }
1467
-
1468
- :where(:root), :where(.a2ui-dark), :where(.a2ui-light) {
1469
- --a2ui-color-background: light-dark(#eee, #111);
1470
- --a2ui-color-on-background: light-dark(#333, #eee);
1471
-
1472
- --a2ui-color-surface: light-dark(
1473
- color-mix(in oklab, var(--a2ui-color-background) 85%, white),
1474
- color-mix(in oklab, var(--a2ui-color-background) 95%, white)
1475
- );
1476
- --a2ui-color-on-surface: light-dark(#333, #eee);
1477
-
1478
- --a2ui-color-primary: #17e;
1479
- --a2ui-color-primary-light: ${Q("light", { colorVar: "--a2ui-color-primary" })};
1480
- --a2ui-color-primary-dark: ${Q("dark", { colorVar: "--a2ui-color-primary" })};
1481
- --a2ui-color-primary-hover: ${Q("hover", { darkVar: "--a2ui-color-primary-dark", lightVar: "--a2ui-color-primary-light" })};
1482
- --a2ui-color-on-primary: #fff;
1483
-
1484
- --a2ui-color-secondary: light-dark(#ddd, #333);
1485
- --a2ui-color-secondary-light: ${Q("light", { colorVar: "--a2ui-color-secondary" })};
1486
- --a2ui-color-secondary-dark: ${Q("dark", { colorVar: "--a2ui-color-secondary", percentage: 95 })};
1487
- --a2ui-color-secondary-hover: ${Q("hover", { darkVar: "--a2ui-color-secondary-dark", lightVar: "--a2ui-color-secondary-light" })};
1488
- --a2ui-color-on-secondary: light-dark(#333, #eee);
1489
-
1490
- --a2ui-border-radius: 0.25rem;
1491
- --a2ui-color-border: light-dark(#ccc, #444);
1492
- --a2ui-border-width: 1px;
1493
- --a2ui-border: 1px solid var(--a2ui-color-border, #ccc);
1494
-
1495
- --a2ui-font-family-title: inherit;
1496
- --a2ui-font-family-monospace: monospace;
1497
- --a2ui-color-input: light-dark(#fff, #2a2a2a);
1498
- --a2ui-color-on-input: light-dark(#333, #eee);
1499
-
1500
- --a2ui-grid-base: 0.5rem;
1501
- --a2ui-spacing-xs: calc(var(--a2ui-spacing-s) / 2);
1502
- --a2ui-spacing-s: calc(var(--a2ui-spacing-m) / 2);
1503
- --a2ui-spacing-m: var(--a2ui-grid-base);
1504
- --a2ui-spacing-l: calc(var(--a2ui-spacing-m) * 2);
1505
- --a2ui-spacing-xl: calc(var(--a2ui-spacing-l) * 2);
1506
-
1507
- --a2ui-font-size: 1rem;
1508
- --a2ui-font-scale: 1.2;
1509
- --a2ui-font-size-xs: calc(var(--a2ui-font-size-s) / var(--a2ui-font-scale));
1510
- --a2ui-font-size-s: calc(var(--a2ui-font-size-m) / var(--a2ui-font-scale));
1511
- --a2ui-font-size-m: var(--a2ui-font-size);
1512
- --a2ui-font-size-l: calc(var(--a2ui-font-size-m) * var(--a2ui-font-scale));
1513
- --a2ui-font-size-xl: calc(var(--a2ui-font-size-l) * var(--a2ui-font-scale));
1514
- --a2ui-font-size-2xl: calc(var(--a2ui-font-size-xl) * var(--a2ui-font-scale));
1515
-
1516
- --a2ui-line-height-headings: 1.2;
1517
- --a2ui-line-height-body: 1.5;
1518
- }
1519
- `;
1520
- let fe;
1521
- function Nr() {
1522
- return fe || (fe = new CSSStyleSheet(), fe.replaceSync($r)), fe;
1523
- }
1524
- function Nt() {
1525
- if (typeof document > "u")
1526
- return;
1527
- const e = Nr();
1528
- document.adoptedStyleSheets.includes(e) || (document.adoptedStyleSheets = [...document.adoptedStyleSheets, e]);
1529
- }
1530
- function Q(e, t) {
1531
- switch (e) {
1532
- case "light": {
1533
- const n = t;
1534
- return `color-mix(in oklab, var(${n.colorVar}) ${n.percentage ?? 85}%, ${n.mixColor ?? "white"})`;
1535
- }
1536
- case "dark": {
1537
- const n = t;
1538
- return `color-mix(in oklab, var(${n.colorVar}) ${n.percentage ?? 85}%, ${n.mixColor ?? "black"})`;
1539
- }
1540
- case "hover": {
1541
- const n = t;
1542
- return `light-dark(var(${n.darkVar}), var(${n.lightVar}))`;
1543
- }
1544
- }
1545
- }
1546
- const Ir = `
1547
- &:not([disabled]) {
1548
- cursor: pointer;
1549
- opacity: var(--opacity, 0);
1550
- transition: opacity var(--speed, 0.2s) cubic-bezier(0, 0, 0.3, 1);
1551
-
1552
- &:hover,
1553
- &:focus {
1554
- opacity: 1;
1555
- }
1556
- }`, zr = `
1557
- ${new Array(21).fill(0).map((e, t) => `.behavior-ho-${t * 5} {
1558
- --opacity: ${t / 20};
1559
- ${Ir}
1560
- }`).join(`
1561
- `)}
1562
-
1563
- .behavior-o-s {
1564
- overflow: scroll;
1565
- }
1566
-
1567
- .behavior-o-a {
1568
- overflow: auto;
1569
- }
1570
-
1571
- .behavior-o-h {
1572
- overflow: hidden;
1573
- }
1574
-
1575
- .behavior-sw-n {
1576
- scrollbar-width: none;
1577
- }
1578
- `, z = 4, Mr = `
1579
- ${new Array(25).fill(0).map((e, t) => `
1580
- .border-bw-${t} { border-width: ${t}px; }
1581
- .border-btw-${t} { border-top-width: ${t}px; }
1582
- .border-bbw-${t} { border-bottom-width: ${t}px; }
1583
- .border-blw-${t} { border-left-width: ${t}px; }
1584
- .border-brw-${t} { border-right-width: ${t}px; }
1585
-
1586
- .border-ow-${t} { outline-width: ${t}px; }
1587
- .border-br-${t} { border-radius: ${t * z}px; overflow: hidden;}`).join(`
1588
- `)}
1589
-
1590
- .border-br-50pc {
1591
- border-radius: 50%;
1592
- }
1593
-
1594
- .border-bs-s {
1595
- border-style: solid;
1596
- }
1597
- `, It = [
1598
- 0,
1599
- 5,
1600
- 10,
1601
- 15,
1602
- 20,
1603
- 25,
1604
- 30,
1605
- 35,
1606
- 40,
1607
- 50,
1608
- 60,
1609
- 70,
1610
- 80,
1611
- 90,
1612
- 95,
1613
- 98,
1614
- 99,
1615
- 100
1616
- ];
1617
- function D(e) {
1618
- return e.startsWith("nv") ? `--nv-${e.slice(2)}` : `--${e[0]}-${e.slice(1)}`;
1619
- }
1620
- const ee = (e) => `
1621
- ${e.map((t) => {
1622
- const n = Ee(t);
1623
- return `.color-bc-${t} { border-color: light-dark(var(${D(t)}), var(${D(n)})); }`;
1624
- }).join(`
1625
- `)}
1626
-
1627
- ${e.map((t) => {
1628
- const n = Ee(t), r = [
1629
- `.color-bgc-${t} { background-color: light-dark(var(${D(t)}), var(${D(n)})); }`,
1630
- `.color-bbgc-${t}::backdrop { background-color: light-dark(var(${D(t)}), var(${D(n)})); }`
1631
- ];
1632
- for (let o = 0.1; o < 1; o += 0.1)
1633
- r.push(`.color-bbgc-${t}_${(o * 100).toFixed(0)}::backdrop {
1634
- background-color: light-dark(oklch(from var(${D(t)}) l c h / calc(alpha * ${o.toFixed(1)})), oklch(from var(${D(n)}) l c h / calc(alpha * ${o.toFixed(1)})) );
1635
- }
1636
- `);
1637
- return r.join(`
1638
- `);
1639
- }).join(`
1640
- `)}
1641
-
1642
- ${e.map((t) => {
1643
- const n = Ee(t);
1644
- return `.color-c-${t} { color: light-dark(var(${D(t)}), var(${D(n)})); }`;
1645
- }).join(`
1646
- `)}
1647
- `, Ee = (e) => {
1648
- const t = e.match(/^([a-z]+)(\d+)$/);
1649
- if (!t)
1650
- return e;
1651
- const [, n, r] = t, a = 100 - parseInt(r, 10), i = It.reduce((l, c) => Math.abs(c - a) < Math.abs(l - a) ? c : l);
1652
- return `${n}${i}`;
1653
- }, te = (e) => It.map((t) => `${e}${t}`), Fr = [
1654
- ee(te("p")),
1655
- ee(te("s")),
1656
- ee(te("t")),
1657
- ee(te("n")),
1658
- ee(te("nv")),
1659
- ee(te("e")),
1660
- `
1661
- .color-bgc-transparent {
1662
- background-color: transparent;
1663
- }
1664
-
1665
- :host {
1666
- color-scheme: var(--color-scheme);
1667
- }
1668
- `
1669
- ], _r = `
1670
- .g-icon {
1671
- font-family: "Material Symbols Outlined", "Google Symbols";
1672
- font-weight: normal;
1673
- font-style: normal;
1674
- font-display: optional;
1675
- font-size: 24px;
1676
- width: 1em;
1677
- height: 1em;
1678
- user-select: none;
1679
- line-height: 1;
1680
- letter-spacing: normal;
1681
- text-transform: none;
1682
- display: inline-block;
1683
- white-space: nowrap;
1684
- word-wrap: normal;
1685
- direction: ltr;
1686
- font-feature-settings: "liga";
1687
- -webkit-font-feature-settings: "liga";
1688
- -webkit-font-smoothing: antialiased;
1689
- text-rendering: optimizeLegibility;
1690
- -moz-osx-font-smoothing: grayscale;
1691
- overflow: hidden;
1692
-
1693
- font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 48,
1694
- "ROND" 100;
1695
-
1696
- &.filled {
1697
- font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 0, "opsz" 48,
1698
- "ROND" 100;
1699
- }
1700
-
1701
- &.filled-heavy {
1702
- font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 48,
1703
- "ROND" 100;
1704
- }
1705
- }
1706
- `, Pr = `
1707
- :host {
1708
- ${new Array(16).fill(0).map((e, t) => `--g-${t + 1}: ${(t + 1) * z}px;`).join(`
1709
- `)}
1710
- }
1711
-
1712
- ${new Array(49).fill(0).map((e, t) => {
1713
- const n = t - 24, r = n < 0 ? `n${Math.abs(n)}` : n.toString();
1714
- return `
1715
- .layout-p-${r} { --padding: ${n * z}px; padding: var(--padding); }
1716
- .layout-pt-${r} { padding-top: ${n * z}px; }
1717
- .layout-pr-${r} { padding-right: ${n * z}px; }
1718
- .layout-pb-${r} { padding-bottom: ${n * z}px; }
1719
- .layout-pl-${r} { padding-left: ${n * z}px; }
1720
-
1721
- .layout-m-${r} { --margin: ${n * z}px; margin: var(--margin); }
1722
- .layout-mt-${r} { margin-top: ${n * z}px; }
1723
- .layout-mr-${r} { margin-right: ${n * z}px; }
1724
- .layout-mb-${r} { margin-bottom: ${n * z}px; }
1725
- .layout-ml-${r} { margin-left: ${n * z}px; }
1726
-
1727
- .layout-t-${r} { top: ${n * z}px; }
1728
- .layout-r-${r} { right: ${n * z}px; }
1729
- .layout-b-${r} { bottom: ${n * z}px; }
1730
- .layout-l-${r} { left: ${n * z}px; }`;
1731
- }).join(`
1732
- `)}
1733
-
1734
- ${new Array(25).fill(0).map((e, t) => `
1735
- .layout-g-${t} { gap: ${t * z}px; }`).join(`
1736
- `)}
1737
-
1738
- ${new Array(8).fill(0).map((e, t) => `
1739
- .layout-grd-col${t + 1} { grid-template-columns: ${"1fr ".repeat(t + 1).trim()}; }`).join(`
1740
- `)}
1741
-
1742
- .layout-pos-a {
1743
- position: absolute;
1744
- }
1745
-
1746
- .layout-pos-rel {
1747
- position: relative;
1748
- }
1749
-
1750
- .layout-dsp-none {
1751
- display: none;
1752
- }
1753
-
1754
- .layout-dsp-block {
1755
- display: block;
1756
- }
1757
-
1758
- .layout-dsp-grid {
1759
- display: grid;
1760
- }
1761
-
1762
- .layout-dsp-iflex {
1763
- display: inline-flex;
1764
- }
1765
-
1766
- .layout-dsp-flexvert {
1767
- display: flex;
1768
- flex-direction: column;
1769
- }
1770
-
1771
- .layout-dsp-flexhor {
1772
- display: flex;
1773
- flex-direction: row;
1774
- }
1775
-
1776
- .layout-fw-w {
1777
- flex-wrap: wrap;
1778
- }
1779
-
1780
- .layout-al-fs {
1781
- align-items: start;
1782
- }
1783
-
1784
- .layout-al-fe {
1785
- align-items: end;
1786
- }
1787
-
1788
- .layout-al-c {
1789
- align-items: center;
1790
- }
1791
-
1792
- .layout-as-n {
1793
- align-self: normal;
1794
- }
1795
-
1796
- .layout-js-c {
1797
- justify-self: center;
1798
- }
1799
-
1800
- .layout-sp-c {
1801
- justify-content: center;
1802
- }
1803
-
1804
- .layout-sp-ev {
1805
- justify-content: space-evenly;
1806
- }
1807
-
1808
- .layout-sp-bt {
1809
- justify-content: space-between;
1810
- }
1811
-
1812
- .layout-sp-s {
1813
- justify-content: start;
1814
- }
1815
-
1816
- .layout-sp-e {
1817
- justify-content: end;
1818
- }
1819
-
1820
- .layout-ji-e {
1821
- justify-items: end;
1822
- }
1823
-
1824
- .layout-r-none {
1825
- resize: none;
1826
- }
1827
-
1828
- .layout-fs-c {
1829
- field-sizing: content;
1830
- }
1831
-
1832
- .layout-fs-n {
1833
- field-sizing: none;
1834
- }
1835
-
1836
- .layout-flx-0 {
1837
- flex: 0 0 auto;
1838
- }
1839
-
1840
- .layout-flx-1 {
1841
- flex: 1 0 auto;
1842
- }
1843
-
1844
- .layout-c-s {
1845
- contain: strict;
1846
- }
1847
-
1848
- /** Widths **/
1849
-
1850
- ${new Array(10).fill(0).map((e, t) => {
1851
- const n = (t + 1) * 10;
1852
- return `.layout-w-${n} { width: ${n}%; max-width: ${n}%; }`;
1853
- }).join(`
1854
- `)}
1855
-
1856
- ${new Array(16).fill(0).map((e, t) => {
1857
- const n = t * z;
1858
- return `.layout-wp-${t} { width: ${n}px; }`;
1859
- }).join(`
1860
- `)}
1861
-
1862
- /** Heights **/
1863
-
1864
- ${new Array(10).fill(0).map((e, t) => {
1865
- const n = (t + 1) * 10;
1866
- return `.layout-h-${n} { height: ${n}%; }`;
1867
- }).join(`
1868
- `)}
1869
-
1870
- ${new Array(16).fill(0).map((e, t) => {
1871
- const n = t * z;
1872
- return `.layout-hp-${t} { height: ${n}px; }`;
1873
- }).join(`
1874
- `)}
1875
-
1876
- .layout-el-cv {
1877
- & img,
1878
- & video {
1879
- width: 100%;
1880
- height: 100%;
1881
- object-fit: cover;
1882
- margin: 0;
1883
- }
1884
- }
1885
-
1886
- .layout-ar-sq {
1887
- aspect-ratio: 1 / 1;
1888
- }
1889
-
1890
- .layout-ex-fb {
1891
- margin: calc(var(--padding) * -1) 0 0 calc(var(--padding) * -1);
1892
- width: calc(100% + var(--padding) * 2);
1893
- height: calc(100% + var(--padding) * 2);
1894
- }
1895
- `, Er = `
1896
- ${new Array(21).fill(0).map((e, t) => `.opacity-el-${t * 5} { opacity: ${t / 20}; }`).join(`
1897
- `)}
1898
- `, Ur = `
1899
- :host {
1900
- --default-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
1901
- --default-font-family-mono: "Courier New", Courier, monospace;
1902
- }
1903
-
1904
- .typography-f-s {
1905
- font-family: var(--font-family, var(--default-font-family));
1906
- font-optical-sizing: auto;
1907
- font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0;
1908
- }
1909
-
1910
- .typography-f-sf {
1911
- font-family: var(--font-family-flex, var(--default-font-family));
1912
- font-optical-sizing: auto;
1913
- }
1914
-
1915
- .typography-f-c {
1916
- font-family: var(--font-family-mono, var(--default-font-family));
1917
- font-optical-sizing: auto;
1918
- font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0;
1919
- }
1920
-
1921
- .typography-v-r {
1922
- font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 100;
1923
- }
1924
-
1925
- .typography-ta-s {
1926
- text-align: start;
1927
- }
1928
-
1929
- .typography-ta-c {
1930
- text-align: center;
1931
- }
1932
-
1933
- .typography-fs-n {
1934
- font-style: normal;
1935
- }
1936
-
1937
- .typography-fs-i {
1938
- font-style: italic;
1939
- }
1940
-
1941
- .typography-sz-ls {
1942
- font-size: 11px;
1943
- line-height: 16px;
1944
- }
1945
-
1946
- .typography-sz-lm {
1947
- font-size: 12px;
1948
- line-height: 16px;
1949
- }
1950
-
1951
- .typography-sz-ll {
1952
- font-size: 14px;
1953
- line-height: 20px;
1954
- }
1955
-
1956
- .typography-sz-bs {
1957
- font-size: 12px;
1958
- line-height: 16px;
1959
- }
1960
-
1961
- .typography-sz-bm {
1962
- font-size: 14px;
1963
- line-height: 20px;
1964
- }
1965
-
1966
- .typography-sz-bl {
1967
- font-size: 16px;
1968
- line-height: 24px;
1969
- }
1970
-
1971
- .typography-sz-ts {
1972
- font-size: 14px;
1973
- line-height: 20px;
1974
- }
1975
-
1976
- .typography-sz-tm {
1977
- font-size: 16px;
1978
- line-height: 24px;
1979
- }
1980
-
1981
- .typography-sz-tl {
1982
- font-size: 22px;
1983
- line-height: 28px;
1984
- }
1985
-
1986
- .typography-sz-hs {
1987
- font-size: 24px;
1988
- line-height: 32px;
1989
- }
1990
-
1991
- .typography-sz-hm {
1992
- font-size: 28px;
1993
- line-height: 36px;
1994
- }
1995
-
1996
- .typography-sz-hl {
1997
- font-size: 32px;
1998
- line-height: 40px;
1999
- }
2000
-
2001
- .typography-sz-ds {
2002
- font-size: 36px;
2003
- line-height: 44px;
2004
- }
2005
-
2006
- .typography-sz-dm {
2007
- font-size: 45px;
2008
- line-height: 52px;
2009
- }
2010
-
2011
- .typography-sz-dl {
2012
- font-size: 57px;
2013
- line-height: 64px;
2014
- }
2015
-
2016
- .typography-ws-p {
2017
- white-space: pre-line;
2018
- }
2019
-
2020
- .typography-ws-nw {
2021
- white-space: nowrap;
2022
- }
2023
-
2024
- .typography-td-none {
2025
- text-decoration: none;
2026
- }
2027
-
2028
- /** Weights **/
2029
-
2030
- ${new Array(9).fill(0).map((e, t) => {
2031
- const n = (t + 1) * 100;
2032
- return `.typography-w-${n} { font-weight: ${n}; }`;
2033
- }).join(`
2034
- `)}
2035
- `, jr = [zr, Mr, Fr, _r, Pr, Er, Ur].flat(1 / 0).join(`
2036
- `);
2037
- var Rr = `
2038
- @layer a2ui-reset {
2039
- :where(.a2ui-surface) :where(*:not(svg, svg *:not(foreignObject *))) {
2040
- all: revert;
2041
- }
2042
- }
2043
- `, Or = jr.replace(
2044
- /:host\s*\{/g,
2045
- ".a2ui-surface {"
2046
- ), Vr = `
2047
- .a2ui-surface .a2ui-card {
2048
- display: block;
2049
- flex: var(--weight);
2050
- min-height: 0;
2051
- overflow: auto;
2052
- }
2053
- .a2ui-surface .a2ui-card > section {
2054
- height: 100%;
2055
- width: 100%;
2056
- min-height: 0;
2057
- overflow: auto;
2058
- }
2059
- .a2ui-surface .a2ui-card > section > * {
2060
- height: 100%;
2061
- width: 100%;
2062
- }
2063
-
2064
- .a2ui-surface .a2ui-divider {
2065
- display: block;
2066
- min-height: 0;
2067
- overflow: auto;
2068
- }
2069
- :where(.a2ui-surface .a2ui-divider) hr {
2070
- height: 1px;
2071
- background: #ccc;
2072
- border: none;
2073
- }
2074
-
2075
- .a2ui-surface .a2ui-text {
2076
- display: block;
2077
- flex: var(--weight);
2078
- }
2079
- :where(.a2ui-surface .a2ui-text) h1,
2080
- :where(.a2ui-surface .a2ui-text) h2,
2081
- :where(.a2ui-surface .a2ui-text) h3,
2082
- :where(.a2ui-surface .a2ui-text) h4,
2083
- :where(.a2ui-surface .a2ui-text) h5 {
2084
- line-height: inherit;
2085
- font: inherit;
2086
- }
2087
- .a2ui-surface .a2ui-text p {
2088
- margin: 0;
2089
- }
2090
-
2091
- .a2ui-surface .a2ui-textfield {
2092
- display: flex;
2093
- flex: var(--weight);
2094
- }
2095
- :where(.a2ui-surface .a2ui-textfield) input {
2096
- display: block;
2097
- width: 100%;
2098
- }
2099
- :where(.a2ui-surface .a2ui-textfield) label {
2100
- display: block;
2101
- margin-bottom: 4px;
2102
- }
2103
- :where(.a2ui-surface .a2ui-textfield) textarea {
2104
- display: block;
2105
- width: 100%;
2106
- }
2107
-
2108
- .a2ui-surface .a2ui-checkbox {
2109
- display: block;
2110
- flex: var(--weight);
2111
- min-height: 0;
2112
- overflow: auto;
2113
- }
2114
- :where(.a2ui-surface .a2ui-checkbox) input {
2115
- display: block;
2116
- width: 100%;
2117
- }
2118
-
2119
- .a2ui-surface .a2ui-slider {
2120
- display: block;
2121
- flex: var(--weight);
2122
- }
2123
- :where(.a2ui-surface .a2ui-slider) input {
2124
- display: block;
2125
- width: 100%;
2126
- }
2127
-
2128
- .a2ui-surface .a2ui-button {
2129
- display: block;
2130
- flex: var(--weight);
2131
- min-height: 0;
2132
- }
2133
-
2134
- .a2ui-surface .a2ui-icon {
2135
- display: block;
2136
- flex: var(--weight);
2137
- min-height: 0;
2138
- overflow: auto;
2139
- }
2140
- :where(.a2ui-surface .a2ui-icon) .g-icon {
2141
- font-size: 24px;
2142
- }
2143
-
2144
- .a2ui-surface .a2ui-tabs {
2145
- display: block;
2146
- flex: var(--weight);
2147
- }
2148
-
2149
- .a2ui-surface .a2ui-modal {
2150
- display: block;
2151
- flex: var(--weight);
2152
- }
2153
- :where(.a2ui-surface .a2ui-modal) dialog {
2154
- padding: 0;
2155
- border: none;
2156
- background: none;
2157
- }
2158
- .a2ui-surface .a2ui-modal dialog section #controls {
2159
- display: flex;
2160
- justify-content: end;
2161
- margin-bottom: 4px;
2162
- }
2163
- .a2ui-surface .a2ui-modal dialog section #controls button {
2164
- padding: 0;
2165
- background: none;
2166
- width: 20px;
2167
- height: 20px;
2168
- cursor: pointer;
2169
- border: none;
2170
- }
2171
-
2172
- .a2ui-surface .a2ui-image {
2173
- display: block;
2174
- flex: var(--weight);
2175
- min-height: 0;
2176
- overflow: auto;
2177
- }
2178
- :where(.a2ui-surface .a2ui-image) img {
2179
- display: block;
2180
- width: 100%;
2181
- height: 100%;
2182
- object-fit: var(--object-fit, fill);
2183
- }
2184
-
2185
- .a2ui-surface .a2ui-video {
2186
- display: block;
2187
- flex: var(--weight);
2188
- min-height: 0;
2189
- overflow: auto;
2190
- }
2191
- :where(.a2ui-surface .a2ui-video) video {
2192
- display: block;
2193
- width: 100%;
2194
- }
2195
-
2196
- .a2ui-surface .a2ui-audio {
2197
- display: block;
2198
- flex: var(--weight);
2199
- min-height: 0;
2200
- overflow: auto;
2201
- }
2202
- :where(.a2ui-surface .a2ui-audio) audio {
2203
- display: block;
2204
- width: 100%;
2205
- }
2206
-
2207
- .a2ui-surface .a2ui-multiplechoice {
2208
- display: block;
2209
- flex: var(--weight);
2210
- min-height: 0;
2211
- overflow: auto;
2212
- }
2213
- :where(.a2ui-surface .a2ui-multiplechoice) select {
2214
- width: 100%;
2215
- }
2216
-
2217
- .a2ui-surface .a2ui-column {
2218
- display: flex;
2219
- flex: var(--weight);
2220
- }
2221
- .a2ui-surface .a2ui-column > section {
2222
- display: flex;
2223
- flex-direction: column;
2224
- min-width: 100%;
2225
- height: 100%;
2226
- }
2227
- .a2ui-surface .a2ui-column[data-alignment="start"] > section { align-items: start; }
2228
- .a2ui-surface .a2ui-column[data-alignment="center"] > section { align-items: center; }
2229
- .a2ui-surface .a2ui-column[data-alignment="end"] > section { align-items: end; }
2230
- .a2ui-surface .a2ui-column[data-alignment="stretch"] > section { align-items: stretch; }
2231
- .a2ui-surface .a2ui-column[data-distribution="start"] > section { justify-content: start; }
2232
- .a2ui-surface .a2ui-column[data-distribution="center"] > section { justify-content: center; }
2233
- .a2ui-surface .a2ui-column[data-distribution="end"] > section { justify-content: end; }
2234
- .a2ui-surface .a2ui-column[data-distribution="spaceBetween"] > section { justify-content: space-between; }
2235
- .a2ui-surface .a2ui-column[data-distribution="spaceAround"] > section { justify-content: space-around; }
2236
- .a2ui-surface .a2ui-column[data-distribution="spaceEvenly"] > section { justify-content: space-evenly; }
2237
-
2238
- .a2ui-surface .a2ui-row {
2239
- display: flex;
2240
- flex: var(--weight);
2241
- }
2242
- .a2ui-surface .a2ui-row > section {
2243
- display: flex;
2244
- flex-direction: row;
2245
- width: 100%;
2246
- min-height: 100%;
2247
- }
2248
- .a2ui-surface .a2ui-row[data-alignment="start"] > section { align-items: start; }
2249
- .a2ui-surface .a2ui-row[data-alignment="center"] > section { align-items: center; }
2250
- .a2ui-surface .a2ui-row[data-alignment="end"] > section { align-items: end; }
2251
- .a2ui-surface .a2ui-row[data-alignment="stretch"] > section { align-items: stretch; }
2252
- .a2ui-surface .a2ui-row[data-distribution="start"] > section { justify-content: start; }
2253
- .a2ui-surface .a2ui-row[data-distribution="center"] > section { justify-content: center; }
2254
- .a2ui-surface .a2ui-row[data-distribution="end"] > section { justify-content: end; }
2255
- .a2ui-surface .a2ui-row[data-distribution="spaceBetween"] > section { justify-content: space-between; }
2256
- .a2ui-surface .a2ui-row[data-distribution="spaceAround"] > section { justify-content: space-around; }
2257
- .a2ui-surface .a2ui-row[data-distribution="spaceEvenly"] > section { justify-content: space-evenly; }
2258
-
2259
- .a2ui-surface .a2ui-list {
2260
- display: block;
2261
- flex: var(--weight);
2262
- min-height: 0;
2263
- overflow: auto;
2264
- }
2265
- .a2ui-surface .a2ui-list[data-direction="vertical"] > section {
2266
- display: grid;
2267
- }
2268
- .a2ui-surface .a2ui-list[data-direction="horizontal"] > section {
2269
- display: flex;
2270
- max-width: 100%;
2271
- overflow-x: scroll;
2272
- overflow-y: hidden;
2273
- scrollbar-width: none;
2274
- }
2275
- .a2ui-surface .a2ui-list[data-direction="horizontal"] > section > * {
2276
- flex: 1 0 fit-content;
2277
- max-width: min(80%, 400px);
2278
- }
2279
-
2280
- .a2ui-surface .a2ui-datetime-input {
2281
- display: block;
2282
- flex: var(--weight);
2283
- min-height: 0;
2284
- overflow: auto;
2285
- }
2286
- :where(.a2ui-surface .a2ui-datetime-input) input {
2287
- display: block;
2288
- border-radius: 8px;
2289
- padding: 8px;
2290
- border: 1px solid #ccc;
2291
- width: 100%;
2292
- }
2293
-
2294
- .a2ui-surface *,
2295
- .a2ui-surface *::before,
2296
- .a2ui-surface *::after {
2297
- box-sizing: border-box;
2298
- }
2299
- `;
2300
- function zt() {
2301
- if (typeof document > "u")
2302
- return;
2303
- const e = "a2ui-structural-styles";
2304
- if (document.getElementById(e))
2305
- return;
2306
- const t = document.createElement("style");
2307
- t.id = e, t.textContent = Rr + `
2308
- ` + Or + `
2309
- ` + Vr, document.head.appendChild(t);
2310
- }
2311
- const Br = {
2312
- video: Yt,
2313
- audio: Gt,
2314
- image: Jt,
2315
- file: ot,
2316
- spreadsheet: Ht,
2317
- document: rt
1458
+ const xr = {
1459
+ video: $t,
1460
+ audio: jt,
1461
+ image: Lt,
1462
+ file: Qe,
1463
+ spreadsheet: qt,
1464
+ document: We
2318
1465
  };
2319
- function qr({
1466
+ function Cr({
2320
1467
  type: e,
2321
1468
  size: t = 40,
2322
1469
  className: n
2323
1470
  }) {
2324
- const r = Br[e] ?? ot;
2325
- return /* @__PURE__ */ s(
1471
+ const r = xr[e] ?? Qe;
1472
+ return /* @__PURE__ */ l(
2326
1473
  r,
2327
1474
  {
2328
1475
  className: n ?? "skopon-form-file-placeholder-icon",
@@ -2331,7 +1478,7 @@ function qr({
2331
1478
  }
2332
1479
  );
2333
1480
  }
2334
- const Mt = "skopon-form-v0_9", Lr = /* @__PURE__ */ new Set([
1481
+ const At = "skopon-form-v0_9", kr = /* @__PURE__ */ new Set([
2335
1482
  "SkoponMedia",
2336
1483
  "SkoponSelect",
2337
1484
  "Image",
@@ -2343,43 +1490,43 @@ const Mt = "skopon-form-v0_9", Lr = /* @__PURE__ */ new Set([
2343
1490
  "FileUpload",
2344
1491
  "TextField",
2345
1492
  "Text",
2346
- ...er()
2347
- ]), Dr = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
2348
- function pe(e) {
2349
- const t = [...ge.components.values()].find((n) => n.name === e);
1493
+ ...Jn()
1494
+ ]), Ar = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
1495
+ function se(e) {
1496
+ const t = [...de.components.values()].find((n) => n.name === e);
2350
1497
  if (!t) throw new Error(`Missing basic catalog component: ${e}`);
2351
1498
  return t.schema;
2352
1499
  }
2353
- function C(e) {
1500
+ function A(e) {
2354
1501
  return typeof e == "string" ? e : "";
2355
1502
  }
2356
- function Ft(e) {
1503
+ function Tt(e) {
2357
1504
  return Array.isArray(e) ? e.map((t) => {
2358
1505
  if (!t || typeof t != "object") return null;
2359
1506
  const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
2360
1507
  return { value: r, label: o };
2361
1508
  }).filter((t) => !!t) : [];
2362
1509
  }
2363
- function ke({
1510
+ function ve({
2364
1511
  mediaType: e,
2365
1512
  urls: t,
2366
1513
  mediaSize: n,
2367
1514
  label: r,
2368
1515
  help: o,
2369
- placeholder: a
1516
+ placeholder: i
2370
1517
  }) {
2371
- const i = r == null ? void 0 : r.trim(), l = o == null ? void 0 : o.trim(), c = bn(n), u = (a == null ? void 0 : a.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
2372
- return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
2373
- i ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: i }) : null,
2374
- t.length === 0 ? /* @__PURE__ */ s("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ s("div", { className: c, children: t.map((d, p) => e === "image" ? /* @__PURE__ */ s(
1518
+ const a = r == null ? void 0 : r.trim(), s = o == null ? void 0 : o.trim(), c = mn(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
1519
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1520
+ a ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: a }) : null,
1521
+ t.length === 0 ? /* @__PURE__ */ l("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ l("div", { className: c, children: t.map((d, p) => e === "image" ? /* @__PURE__ */ l(
2375
1522
  "img",
2376
1523
  {
2377
1524
  src: d,
2378
- alt: i || "图片",
1525
+ alt: a || "图片",
2379
1526
  className: "form-media-item"
2380
1527
  },
2381
1528
  `media-${p}`
2382
- ) : e === "video" ? /* @__PURE__ */ s(
1529
+ ) : e === "video" ? /* @__PURE__ */ l(
2383
1530
  "video",
2384
1531
  {
2385
1532
  src: d,
@@ -2387,7 +1534,7 @@ function ke({
2387
1534
  className: "form-media-item"
2388
1535
  },
2389
1536
  `media-${p}`
2390
- ) : /* @__PURE__ */ s(
1537
+ ) : /* @__PURE__ */ l(
2391
1538
  "audio",
2392
1539
  {
2393
1540
  src: d,
@@ -2396,21 +1543,21 @@ function ke({
2396
1543
  },
2397
1544
  `media-${p}`
2398
1545
  )) }),
2399
- l ? /* @__PURE__ */ s(H.Text, { type: "secondary", className: "form-block-preview-help", children: l }) : null
1546
+ s ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-help", children: s }) : null
2400
1547
  ] });
2401
1548
  }
2402
- function we(e, t) {
2403
- const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : C(e.url).trim() ? [C(e.url).trim()] : [];
1549
+ function be(e, t) {
1550
+ const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : A(e.url).trim() ? [A(e.url).trim()] : [];
2404
1551
  return {
2405
1552
  mediaType: t,
2406
1553
  urls: n,
2407
- mediaSize: ue(e.mediaSize),
2408
- label: C(e.label) || C(e.description),
2409
- help: C(e.help),
2410
- placeholder: C(e.placeholder)
1554
+ mediaSize: le(e.mediaSize),
1555
+ label: A(e.label) || A(e.description),
1556
+ help: A(e.help),
1557
+ placeholder: A(e.placeholder)
2411
1558
  };
2412
1559
  }
2413
- const Kr = {
1560
+ const Tr = {
2414
1561
  name: "SkoponMedia",
2415
1562
  schema: m.object({
2416
1563
  mediaType: m.any().optional(),
@@ -2420,19 +1567,19 @@ const Kr = {
2420
1567
  help: m.any().optional(),
2421
1568
  placeholder: m.any().optional()
2422
1569
  }).passthrough()
2423
- }, Hr = O(Kr, ({ context: e }) => {
2424
- const t = e.componentModel.properties, n = C(t.mediaType);
2425
- return /* @__PURE__ */ s(ke, { ...we(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
2426
- }), Jr = O(
2427
- { name: "Image", schema: pe("Image") },
2428
- ({ context: e }) => /* @__PURE__ */ s(ke, { ...we(e.componentModel.properties, "image") })
2429
- ), Gr = O(
2430
- { name: "Video", schema: pe("Video") },
2431
- ({ context: e }) => /* @__PURE__ */ s(ke, { ...we(e.componentModel.properties, "video") })
2432
- ), Yr = O(
2433
- { name: "AudioPlayer", schema: pe("AudioPlayer") },
2434
- ({ context: e }) => /* @__PURE__ */ s(ke, { ...we(e.componentModel.properties, "audio") })
2435
- ), Wr = {
1570
+ }, Nr = V(Tr, ({ context: e }) => {
1571
+ const t = e.componentModel.properties, n = A(t.mediaType);
1572
+ return /* @__PURE__ */ l(ve, { ...be(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
1573
+ }), Mr = V(
1574
+ { name: "Image", schema: se("Image") },
1575
+ ({ context: e }) => /* @__PURE__ */ l(ve, { ...be(e.componentModel.properties, "image") })
1576
+ ), Ir = V(
1577
+ { name: "Video", schema: se("Video") },
1578
+ ({ context: e }) => /* @__PURE__ */ l(ve, { ...be(e.componentModel.properties, "video") })
1579
+ ), Fr = V(
1580
+ { name: "AudioPlayer", schema: se("AudioPlayer") },
1581
+ ({ context: e }) => /* @__PURE__ */ l(ve, { ...be(e.componentModel.properties, "audio") })
1582
+ ), Pr = {
2436
1583
  name: "SkoponSelect",
2437
1584
  schema: m.object({
2438
1585
  label: m.any().optional(),
@@ -2442,36 +1589,36 @@ const Kr = {
2442
1589
  value: m.any().optional()
2443
1590
  }).passthrough()
2444
1591
  };
2445
- function Xr({ context: e }) {
2446
- const { interactive: t } = J(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, a = C(o.label), i = C(o.placeholder), l = Ft(o.options), c = C(o.mode) === "multiple";
2447
- return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
2448
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
2449
- /* @__PURE__ */ s(
2450
- Ue,
1592
+ function zr({ context: e }) {
1593
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), s = Tt(o.options), c = A(o.mode) === "multiple";
1594
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1595
+ i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1596
+ /* @__PURE__ */ l(
1597
+ ze,
2451
1598
  {
2452
1599
  mode: c ? "multiple" : void 0,
2453
1600
  disabled: !t,
2454
1601
  allowClear: !0,
2455
1602
  className: "form-block-preview-control",
2456
1603
  style: { width: "100%" },
2457
- placeholder: i || (c ? "请选择多项" : "请选择"),
2458
- options: l,
2459
- value: c ? K(n) : le(n),
1604
+ placeholder: a || (c ? "请选择多项" : "请选择"),
1605
+ options: s,
1606
+ value: c ? D(n) : oe(n),
2460
1607
  onChange: (u) => r(c ? u ?? [] : u ?? "")
2461
1608
  }
2462
1609
  )
2463
1610
  ] });
2464
1611
  }
2465
- const Zr = O(
2466
- Wr,
2467
- Xr
1612
+ const Ur = V(
1613
+ Pr,
1614
+ zr
2468
1615
  );
2469
- function Qr({ context: e }) {
2470
- const { interactive: t } = J(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, a = C(o.label), i = C(o.variant) || "mutuallyExclusive", l = C(o.skoponPickerType), c = C(o.placeholder), u = Ft(o.options), p = l === "select" || l === "multiselect" || l === "radio" || l === "checkbox" ? l : i === "multipleSelection" ? "checkbox" : "radio";
2471
- return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
2472
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
2473
- p === "select" ? /* @__PURE__ */ s(
2474
- Ue,
1616
+ function _r({ context: e }) {
1617
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = A(o.label), a = A(o.variant) || "mutuallyExclusive", s = A(o.skoponPickerType), c = A(o.placeholder), u = Tt(o.options), p = s === "select" || s === "multiselect" || s === "radio" || s === "checkbox" ? s : a === "multipleSelection" ? "checkbox" : "radio";
1618
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1619
+ i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1620
+ p === "select" ? /* @__PURE__ */ l(
1621
+ ze,
2475
1622
  {
2476
1623
  disabled: !t,
2477
1624
  allowClear: !0,
@@ -2479,11 +1626,11 @@ function Qr({ context: e }) {
2479
1626
  style: { width: "100%" },
2480
1627
  placeholder: c || "请选择",
2481
1628
  options: u,
2482
- value: le(n),
1629
+ value: oe(n),
2483
1630
  onChange: (g) => r(g ?? "")
2484
1631
  }
2485
- ) : p === "multiselect" ? /* @__PURE__ */ s(
2486
- Ue,
1632
+ ) : p === "multiselect" ? /* @__PURE__ */ l(
1633
+ ze,
2487
1634
  {
2488
1635
  mode: "multiple",
2489
1636
  disabled: !t,
@@ -2492,31 +1639,31 @@ function Qr({ context: e }) {
2492
1639
  style: { width: "100%" },
2493
1640
  placeholder: c || "请选择多项",
2494
1641
  options: u,
2495
- value: K(n),
1642
+ value: D(n),
2496
1643
  onChange: (g) => r(g ?? [])
2497
1644
  }
2498
- ) : p === "checkbox" ? /* @__PURE__ */ s(
2499
- Rt.Group,
1645
+ ) : p === "checkbox" ? /* @__PURE__ */ l(
1646
+ zt.Group,
2500
1647
  {
2501
1648
  disabled: !t,
2502
1649
  className: "form-block-preview-control",
2503
1650
  options: u,
2504
- value: K(n),
1651
+ value: D(n),
2505
1652
  onChange: (g) => r(g)
2506
1653
  }
2507
- ) : /* @__PURE__ */ s(
2508
- Ot.Group,
1654
+ ) : /* @__PURE__ */ l(
1655
+ Ut.Group,
2509
1656
  {
2510
1657
  disabled: !t,
2511
1658
  className: "form-block-preview-control",
2512
1659
  options: u,
2513
- value: le(n),
1660
+ value: oe(n),
2514
1661
  onChange: (g) => r(g.target.value)
2515
1662
  }
2516
1663
  )
2517
1664
  ] });
2518
1665
  }
2519
- const eo = O(
1666
+ const Er = V(
2520
1667
  {
2521
1668
  name: "ChoicePicker",
2522
1669
  schema: m.object({
@@ -2528,80 +1675,80 @@ const eo = O(
2528
1675
  placeholder: m.any().optional()
2529
1676
  }).passthrough()
2530
1677
  },
2531
- Qr
1678
+ _r
2532
1679
  );
2533
- function to({ context: e }) {
2534
- const { interactive: t } = J(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, a = C(o.label);
2535
- return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
2536
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
2537
- /* @__PURE__ */ s(
2538
- Vt,
1680
+ function Rr({ context: e }) {
1681
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = A(o.label);
1682
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1683
+ i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1684
+ /* @__PURE__ */ l(
1685
+ _t,
2539
1686
  {
2540
1687
  disabled: !t,
2541
1688
  className: "form-block-preview-control",
2542
- checked: Je(n),
2543
- onChange: (i) => r(i)
1689
+ checked: je(n),
1690
+ onChange: (a) => r(a)
2544
1691
  }
2545
1692
  )
2546
1693
  ] });
2547
1694
  }
2548
- const no = O(
2549
- { name: "CheckBox", schema: pe("CheckBox") },
2550
- to
1695
+ const Br = V(
1696
+ { name: "CheckBox", schema: se("CheckBox") },
1697
+ Rr
2551
1698
  );
2552
- function ro(e, t, n) {
2553
- const r = le(e);
1699
+ function Or(e, t, n) {
1700
+ const r = oe(e);
2554
1701
  if (!r) return;
2555
1702
  if (!t && n) {
2556
- const a = Ye(r, "HH:mm", !0);
2557
- return a.isValid() ? a : void 0;
1703
+ const i = De(r, "HH:mm", !0);
1704
+ return i.isValid() ? i : void 0;
2558
1705
  }
2559
- const o = Ye(r);
1706
+ const o = De(r);
2560
1707
  return o.isValid() ? o : void 0;
2561
1708
  }
2562
- function oo({ context: e }) {
2563
- const { interactive: t } = J(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, a = C(o.label), i = C(o.placeholder), l = o.enableDate === !0, c = o.enableTime === !0, u = ro(n, l, c), d = (p) => {
1709
+ function Vr({ context: e }) {
1710
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), s = o.enableDate === !0, c = o.enableTime === !0, u = Or(n, s, c), d = (p) => {
2564
1711
  if (!p) {
2565
1712
  r("");
2566
1713
  return;
2567
1714
  }
2568
- if (!l && c) {
1715
+ if (!s && c) {
2569
1716
  r(p.format("HH:mm"));
2570
1717
  return;
2571
1718
  }
2572
- if (l && c) {
1719
+ if (s && c) {
2573
1720
  r(p.format("YYYY-MM-DDTHH:mm"));
2574
1721
  return;
2575
1722
  }
2576
1723
  r(p.format("YYYY-MM-DD"));
2577
1724
  };
2578
- return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
2579
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
2580
- !l && c ? /* @__PURE__ */ s(
2581
- Bt,
1725
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1726
+ i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1727
+ !s && c ? /* @__PURE__ */ l(
1728
+ Et,
2582
1729
  {
2583
1730
  disabled: !t,
2584
1731
  className: "form-block-preview-control",
2585
1732
  style: { width: "100%" },
2586
- placeholder: i || "选择时间",
1733
+ placeholder: a || "选择时间",
2587
1734
  value: u,
2588
1735
  onChange: d
2589
1736
  }
2590
- ) : /* @__PURE__ */ s(
2591
- qt,
1737
+ ) : /* @__PURE__ */ l(
1738
+ Rt,
2592
1739
  {
2593
- showTime: l && c,
1740
+ showTime: s && c,
2594
1741
  disabled: !t,
2595
1742
  className: "form-block-preview-control",
2596
1743
  style: { width: "100%" },
2597
- placeholder: i || (l && c ? "选择日期时间" : "选择日期"),
1744
+ placeholder: a || (s && c ? "选择日期时间" : "选择日期"),
2598
1745
  value: u,
2599
1746
  onChange: d
2600
1747
  }
2601
1748
  )
2602
1749
  ] });
2603
1750
  }
2604
- const ao = O(
1751
+ const wr = V(
2605
1752
  {
2606
1753
  name: "DateTimeInput",
2607
1754
  schema: m.object({
@@ -2614,8 +1761,8 @@ const ao = O(
2614
1761
  max: m.any().optional()
2615
1762
  }).passthrough()
2616
1763
  },
2617
- oo
2618
- ), io = {
1764
+ Vr
1765
+ ), qr = {
2619
1766
  name: "FileUpload",
2620
1767
  schema: m.object({
2621
1768
  label: m.any().optional(),
@@ -2627,108 +1774,108 @@ const ao = O(
2627
1774
  value: m.any().optional()
2628
1775
  }).passthrough()
2629
1776
  };
2630
- function lo({ context: e }) {
2631
- const { interactive: t } = J(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, a = C(o.label), i = C(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 = dn(l, c), d = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
1777
+ function Lr({ context: e }) {
1778
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = A(o.label), a = A(o.accept), s = Array.isArray(o.fileAcceptTypes) ? o.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((f) => f.trim()).filter(Boolean) : void 0, u = an(s, c), d = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
2632
1779
  o.filePlaceholderIcon
2633
- ) ? 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, $ = K(n), A = v && $.length >= g, w = $.length < p;
2634
- return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
2635
- a ? /* @__PURE__ */ s("div", { className: "form-block-preview-label", children: a }) : null,
2636
- /* @__PURE__ */ k(
2637
- Te.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, M = D(n), T = v && M.length >= g, k = M.length < p;
1781
+ return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
1782
+ i ? /* @__PURE__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
1783
+ /* @__PURE__ */ C(
1784
+ Ce.Dragger,
2638
1785
  {
2639
- disabled: !t || A,
2640
- accept: pn(l, c),
1786
+ disabled: !t || T,
1787
+ accept: on(s, c),
2641
1788
  className: "form-file-upload-preview",
2642
- showUploadList: t && $.length > 0,
2643
- fileList: t ? $.map((f, h) => ({
1789
+ showUploadList: t && M.length > 0,
1790
+ fileList: t ? M.map((f, h) => ({
2644
1791
  uid: `${h}-${f}`,
2645
1792
  name: f,
2646
1793
  status: "done"
2647
1794
  })) : [],
2648
1795
  beforeUpload: (f) => {
2649
- if (!t) return Te.LIST_IGNORE;
2650
- const h = K(Ze(e));
2651
- if (v && h.length >= g) return Te.LIST_IGNORE;
2652
- const S = v ? [...h, f.name].slice(0, g) : [...h, f.name];
2653
- return r(S), !1;
1796
+ if (!t) return Ce.LIST_IGNORE;
1797
+ const h = D(Ge(e));
1798
+ if (v && h.length >= g) return Ce.LIST_IGNORE;
1799
+ const x = v ? [...h, f.name].slice(0, g) : [...h, f.name];
1800
+ return r(x), !1;
2654
1801
  },
2655
1802
  onRemove: (f) => {
2656
- const h = K(Ze(e)), S = /^(\d+)-/.exec(f.uid ?? ""), y = S ? Number(S[1]) : -1, x = y >= 0 && y < h.length ? h.filter((N, E) => E !== y) : h.filter((N) => N !== f.name);
2657
- if (x.length < p) return !1;
2658
- r(x);
1803
+ const h = D(Ge(e)), x = /^(\d+)-/.exec(f.uid ?? ""), y = x ? Number(x[1]) : -1, S = y >= 0 && y < h.length ? h.filter((I, E) => E !== y) : h.filter((I) => I !== f.name);
1804
+ if (S.length < p) return !1;
1805
+ r(S);
2659
1806
  },
2660
1807
  children: [
2661
- /* @__PURE__ */ s("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ s(qr, { type: d, size: 40 }) }),
2662
- /* @__PURE__ */ s("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
1808
+ /* @__PURE__ */ l("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ l(Cr, { type: d, size: 40 }) }),
1809
+ /* @__PURE__ */ l("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
2663
1810
  ]
2664
1811
  }
2665
1812
  ),
2666
- /* @__PURE__ */ k(H.Text, { type: "secondary", className: "form-block-preview-help", children: [
1813
+ /* @__PURE__ */ C(H.Text, { type: "secondary", className: "form-block-preview-help", children: [
2667
1814
  "允许:",
2668
1815
  u ?? "全部类型",
2669
1816
  p > 0 ? `;至少 ${p} 个文件` : "",
2670
1817
  v ? `;最多 ${g} 个文件` : "",
2671
- w && t ? `(当前 ${$.length} 个,未达下限)` : ""
1818
+ k && t ? `(当前 ${M.length} 个,未达下限)` : ""
2672
1819
  ] })
2673
1820
  ] });
2674
1821
  }
2675
- const so = O(
2676
- io,
2677
- lo
1822
+ const jr = V(
1823
+ qr,
1824
+ Lr
2678
1825
  );
2679
- function co({ context: e }) {
2680
- const { interactive: t } = J(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, a = C(o.label), i = C(o.placeholder), l = C(o.variant) || "shortText", c = le(n) ?? "", u = !t, d = "form-block-preview-control";
1826
+ function $r({ context: e }) {
1827
+ const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = A(o.label), a = A(o.placeholder), s = A(o.variant) || "shortText", c = oe(n) ?? "", u = !t, d = "form-block-preview-control";
2681
1828
  let p;
2682
- if (l === "longText")
2683
- p = /* @__PURE__ */ s(
2684
- $e.TextArea,
1829
+ if (s === "longText")
1830
+ p = /* @__PURE__ */ l(
1831
+ ke.TextArea,
2685
1832
  {
2686
1833
  disabled: u,
2687
1834
  className: d,
2688
- placeholder: i || "长文本回答...",
1835
+ placeholder: a || "长文本回答...",
2689
1836
  autoSize: { minRows: 2, maxRows: 6 },
2690
1837
  value: c,
2691
1838
  onChange: (g) => r(g.target.value)
2692
1839
  }
2693
1840
  );
2694
- else if (l === "number") {
1841
+ else if (s === "number") {
2695
1842
  const g = c && Number.isFinite(Number(c)) ? Number(c) : void 0;
2696
- p = /* @__PURE__ */ s(
2697
- Lt,
1843
+ p = /* @__PURE__ */ l(
1844
+ Bt,
2698
1845
  {
2699
1846
  disabled: u,
2700
1847
  className: d,
2701
1848
  style: { width: "100%" },
2702
- placeholder: i || "数字",
1849
+ placeholder: a || "数字",
2703
1850
  value: g,
2704
1851
  onChange: (v) => r(v == null ? "" : String(v))
2705
1852
  }
2706
1853
  );
2707
- } else l === "obscured" ? p = /* @__PURE__ */ s(
2708
- $e.Password,
1854
+ } else s === "obscured" ? p = /* @__PURE__ */ l(
1855
+ ke.Password,
2709
1856
  {
2710
1857
  disabled: u,
2711
1858
  className: d,
2712
- placeholder: i,
1859
+ placeholder: a,
2713
1860
  value: c,
2714
1861
  onChange: (g) => r(g.target.value)
2715
1862
  }
2716
- ) : p = /* @__PURE__ */ s(
2717
- $e,
1863
+ ) : p = /* @__PURE__ */ l(
1864
+ ke,
2718
1865
  {
2719
1866
  disabled: u,
2720
1867
  className: d,
2721
- placeholder: i,
1868
+ placeholder: a,
2722
1869
  value: c,
2723
1870
  onChange: (g) => r(g.target.value)
2724
1871
  }
2725
1872
  );
2726
- return /* @__PURE__ */ k("div", { className: "form-block-preview", children: [
2727
- 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__ */ l("div", { className: "form-block-preview-label", children: i }) : null,
2728
1875
  p
2729
1876
  ] });
2730
1877
  }
2731
- const uo = O(
1878
+ const Dr = V(
2732
1879
  {
2733
1880
  name: "TextField",
2734
1881
  schema: m.object({
@@ -2739,204 +1886,308 @@ const uo = O(
2739
1886
  value: m.any().optional()
2740
1887
  }).passthrough()
2741
1888
  },
2742
- co
1889
+ $r
2743
1890
  );
2744
- function po({ context: e }) {
2745
- const t = e.componentModel.properties, n = C(t.text), r = C(t.variant) || "body";
2746
- return Dr.has(r) ? r === "caption" ? /* @__PURE__ */ s(H.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(H.Paragraph, { className: "form-block-preview-paragraph", children: n });
1891
+ function Hr({ context: e }) {
1892
+ const t = e.componentModel.properties, n = A(t.text), r = A(t.variant) || "body";
1893
+ return Ar.has(r) ? r === "caption" ? /* @__PURE__ */ l(H.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ l("em", { children: n }) }) : /* @__PURE__ */ l(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ l(H.Paragraph, { className: "form-block-preview-paragraph", children: n });
2747
1894
  }
2748
- const mo = O(
2749
- { name: "Text", schema: pe("Text") },
2750
- po
1895
+ const Kr = V(
1896
+ { name: "Text", schema: se("Text") },
1897
+ Hr
2751
1898
  );
2752
- function _t() {
1899
+ function Nt() {
2753
1900
  const t = [
2754
- ...[...ge.components.values()].filter(
2755
- (r) => !Lr.has(r.name)
1901
+ ...[...de.components.values()].filter(
1902
+ (r) => !kr.has(r.name)
2756
1903
  ),
2757
- Hr,
2758
- Zr,
2759
- Jr,
2760
- Gr,
2761
- Yr,
2762
- eo,
2763
- no,
2764
- ao,
2765
- so,
2766
- uo,
2767
- mo,
2768
- ...Qn()
2769
- ], n = [...ge.functions.values()];
2770
- return new Wt(Mt, t, n, ge.themeSchema);
2771
- }
2772
- const fo = Et(
1904
+ Nr,
1905
+ Ur,
1906
+ Mr,
1907
+ Ir,
1908
+ Fr,
1909
+ Er,
1910
+ Br,
1911
+ wr,
1912
+ jr,
1913
+ Dr,
1914
+ Kr,
1915
+ ...Gn()
1916
+ ], n = [...de.functions.values()];
1917
+ return new Dt(At, t, n, de.themeSchema);
1918
+ }
1919
+ const $ = {
1920
+ jade9: "#29a383",
1921
+ jade10: "#26997b",
1922
+ jade11: "#208368",
1923
+ jade12: "#1d3b31",
1924
+ /** 链接、边框、Logo 图形、实心底(与 primarySolid 同色) */
1925
+ primary: "#208368",
1926
+ /** Primary 实心按钮、Sider 胶囊、发布等 type="primary" */
1927
+ primarySolid: "#208368",
1928
+ primaryHover: "#26997b",
1929
+ primaryActive: "#1d3b31",
1930
+ onPrimary: "#ffffff"
1931
+ }, Gr = {
1932
+ cssVar: { key: "vidtempl" },
1933
+ token: {
1934
+ colorPrimary: $.primarySolid,
1935
+ colorPrimaryHover: $.primaryHover,
1936
+ colorPrimaryActive: $.primaryActive,
1937
+ colorLink: $.primary,
1938
+ colorLinkHover: $.primaryHover,
1939
+ colorSuccess: $.jade9,
1940
+ colorWarning: "#f5a623",
1941
+ gold6: "#f5a623",
1942
+ gold7: "#e6951a",
1943
+ colorError: "#e5484d",
1944
+ colorInfo: $.primary,
1945
+ colorBgLayout: "#f9f9f9",
1946
+ colorBgContainer: "#ffffff",
1947
+ colorBgElevated: "#ffffff",
1948
+ colorBorder: "#d9d9d9",
1949
+ colorBorderSecondary: "#f0f0f0",
1950
+ colorText: "#202020",
1951
+ colorTextSecondary: "#646464",
1952
+ colorTextTertiary: "#8d8d8d",
1953
+ colorTextQuaternary: "#bbbbbb",
1954
+ borderRadius: 8,
1955
+ borderRadiusSM: 4,
1956
+ borderRadiusLG: 12,
1957
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif",
1958
+ fontSize: 14,
1959
+ fontSizeLG: 16,
1960
+ fontSizeSM: 13,
1961
+ fontWeightStrong: 600,
1962
+ lineHeight: 1.5715,
1963
+ lineHeightLG: 1.5,
1964
+ lineHeightSM: 1.5715,
1965
+ controlHeight: 36,
1966
+ controlHeightLG: 40,
1967
+ controlHeightSM: 28,
1968
+ paddingContentHorizontal: 16,
1969
+ paddingContentHorizontalLG: 20,
1970
+ paddingContentHorizontalSM: 12,
1971
+ marginLG: 24,
1972
+ marginMD: 16,
1973
+ marginSM: 12,
1974
+ marginXS: 8
1975
+ },
1976
+ components: {
1977
+ Button: {
1978
+ borderRadius: 9999,
1979
+ borderRadiusSM: 9999,
1980
+ borderRadiusLG: 9999,
1981
+ controlHeight: 36,
1982
+ controlHeightLG: 40,
1983
+ controlHeightSM: 28,
1984
+ paddingInline: 16,
1985
+ paddingInlineLG: 20,
1986
+ paddingInlineSM: 12,
1987
+ fontSize: 14,
1988
+ fontSizeLG: 16,
1989
+ fontSizeSM: 13,
1990
+ fontWeight: 600,
1991
+ primaryShadow: "none",
1992
+ defaultShadow: "none",
1993
+ dangerShadow: "none"
1994
+ },
1995
+ Card: {
1996
+ borderRadiusLG: 8
1997
+ },
1998
+ Layout: {
1999
+ headerBg: "#ffffff",
2000
+ bodyBg: "#f9f9f9"
2001
+ },
2002
+ Tag: {
2003
+ defaultBg: "#e6f7ed",
2004
+ defaultColor: $.primary,
2005
+ fontSizeSM: 13
2006
+ },
2007
+ Form: {
2008
+ itemMarginBottom: 24
2009
+ },
2010
+ Typography: {
2011
+ titleMarginBottom: 16,
2012
+ titleMarginTop: 0
2013
+ }
2014
+ }
2015
+ };
2016
+ function X({
2017
+ children: e,
2018
+ locale: t,
2019
+ theme: n
2020
+ }) {
2021
+ return /* @__PURE__ */ l(Ot, { theme: n ?? Gr, locale: t, children: e });
2022
+ }
2023
+ const Jr = It(
2773
2024
  function({
2774
2025
  doc: t,
2775
2026
  surfaceId: n = "skopon-form",
2776
2027
  emptyHint: r = null,
2777
2028
  interactive: o = !0,
2778
- fieldNames: a = [],
2779
- resumeSearch: i = null,
2780
- caseSearch: l = null
2029
+ fieldNames: i = [],
2030
+ resumeSearch: a = null,
2031
+ caseSearch: s = null
2781
2032
  }, c) {
2782
- q(() => {
2783
- zt(), Nt();
2033
+ L(() => {
2034
+ nt(), tt();
2784
2035
  }, []);
2785
- const u = B(null), d = B(a);
2786
- d.current = a;
2787
- const p = R(() => {
2788
- if (Ve(t)) return "";
2036
+ const u = q(null), d = q(i);
2037
+ d.current = i;
2038
+ const p = O(() => {
2039
+ if (Re(t)) return "";
2789
2040
  try {
2790
2041
  return JSON.stringify(t);
2791
2042
  } catch {
2792
2043
  return String(t);
2793
2044
  }
2794
- }, [t]), g = R(() => {
2045
+ }, [t]), g = O(() => {
2795
2046
  if (!p)
2796
2047
  return { surfaces: [], processor: null };
2797
2048
  try {
2798
- const A = JSON.parse(p), w = new it([_t()]), f = ur(A, {
2049
+ const T = JSON.parse(p), k = new et([Nt()]), f = or(T, {
2799
2050
  surfaceId: n,
2800
- catalogId: Mt
2051
+ catalogId: At
2801
2052
  });
2802
- return w.processMessages(f), {
2803
- surfaces: Array.from(w.model.surfacesMap.values()),
2804
- processor: w
2053
+ return k.processMessages(f), {
2054
+ surfaces: Array.from(k.model.surfacesMap.values()),
2055
+ processor: k
2805
2056
  };
2806
- } catch (A) {
2807
- return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", A), { surfaces: [], processor: null };
2057
+ } catch (T) {
2058
+ return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", T), { surfaces: [], processor: null };
2808
2059
  }
2809
- }, [p, n]), { surfaces: v, processor: $ } = g;
2810
- return u.current = $, Ut(
2060
+ }, [p, n]), { surfaces: v, processor: M } = g;
2061
+ return u.current = M, Ft(
2811
2062
  c,
2812
2063
  () => ({
2813
- getValues(A) {
2814
- const w = u.current;
2815
- if (!w) return {};
2816
- const f = (A ?? d.current).map((h) => h.trim()).filter(Boolean);
2817
- return fr(w, n, f);
2064
+ getValues(T) {
2065
+ const k = u.current;
2066
+ if (!k) return {};
2067
+ const f = (T ?? d.current).map((h) => h.trim()).filter(Boolean);
2068
+ return sr(k, n, f);
2818
2069
  }
2819
2070
  }),
2820
2071
  [n]
2821
- ), v.length === 0 ? /* @__PURE__ */ s(tt, { children: r }) : /* @__PURE__ */ s(yt, { resumeSearch: i, children: /* @__PURE__ */ s(ht, { caseSearch: l, children: /* @__PURE__ */ s(ct, { interactive: o, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: v.map((A) => /* @__PURE__ */ s(at, { surface: A }, A.id)) }) }) }) });
2072
+ ), v.length === 0 ? /* @__PURE__ */ l(X, { children: r }) : /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l(mt, { resumeSearch: a, children: /* @__PURE__ */ l(pt, { caseSearch: s, children: /* @__PURE__ */ l(it, { interactive: o, children: /* @__PURE__ */ l("div", { className: "a2ui-surface a2ui-container", children: v.map((T) => /* @__PURE__ */ l(Ze, { surface: T }, T.id)) }) }) }) }) });
2822
2073
  }
2823
2074
  );
2824
- function he() {
2825
- return new it([_t()]);
2075
+ function pe() {
2076
+ return new et([Nt()]);
2826
2077
  }
2827
- function $o({
2078
+ function co({
2828
2079
  messages: e,
2829
2080
  surfaceId: t = "skopon-form-stream",
2830
2081
  emptyHint: n = null,
2831
2082
  interactive: r = !0,
2832
2083
  resumeSearch: o = null,
2833
- caseSearch: a = null
2084
+ caseSearch: i = null
2834
2085
  }) {
2835
- q(() => {
2836
- zt(), Nt();
2086
+ L(() => {
2087
+ nt(), tt();
2837
2088
  }, []);
2838
- const i = B(null);
2839
- i.current === null && (i.current = he());
2840
- const l = B(0), c = B(""), u = B(!0), d = B(t);
2089
+ const a = q(null);
2090
+ a.current === null && (a.current = pe());
2091
+ const s = q(0), c = q(""), u = q(!0), d = q(t);
2841
2092
  function p(f, h) {
2842
- i.current = f, l.current = h.length, c.current = JSON.stringify(h), u.current && ($(f), w(Array.from(f.model.surfacesMap.values())));
2093
+ a.current = f, s.current = h.length, c.current = JSON.stringify(h), u.current && (M(f), k(Array.from(f.model.surfacesMap.values())));
2843
2094
  }
2844
2095
  function g(f, h) {
2845
2096
  if (h <= 0) return !1;
2846
- const S = JSON.stringify(f.slice(0, h)), y = c.current;
2097
+ const x = JSON.stringify(f.slice(0, h)), y = c.current;
2847
2098
  if (!y) return !0;
2848
2099
  try {
2849
- const x = JSON.parse(y);
2850
- return JSON.stringify(x.slice(0, h)) !== S;
2100
+ const S = JSON.parse(y);
2101
+ return JSON.stringify(S.slice(0, h)) !== x;
2851
2102
  } catch {
2852
2103
  return !0;
2853
2104
  }
2854
2105
  }
2855
- const [v, $] = F(
2856
- () => i.current
2857
- ), [A, w] = F(
2106
+ const [v, M] = z(
2107
+ () => a.current
2108
+ ), [T, k] = z(
2858
2109
  () => Array.from(
2859
- i.current.model.surfacesMap.values()
2110
+ a.current.model.surfacesMap.values()
2860
2111
  )
2861
2112
  );
2862
- return q(() => (u.current = !0, () => {
2113
+ return L(() => (u.current = !0, () => {
2863
2114
  u.current = !1;
2864
- }), []), q(() => {
2865
- i.current = v;
2866
- }, [v]), q(() => {
2115
+ }), []), L(() => {
2116
+ a.current = v;
2117
+ }, [v]), L(() => {
2867
2118
  const f = () => {
2868
- u.current && w(Array.from(v.model.surfacesMap.values()));
2869
- }, h = v.onSurfaceCreated(f), S = v.onSurfaceDeleted(f);
2119
+ u.current && k(Array.from(v.model.surfacesMap.values()));
2120
+ }, h = v.onSurfaceCreated(f), x = v.onSurfaceDeleted(f);
2870
2121
  return () => {
2871
- h.unsubscribe(), S.unsubscribe();
2122
+ h.unsubscribe(), x.unsubscribe();
2872
2123
  };
2873
- }, [v]), q(() => {
2124
+ }, [v]), L(() => {
2874
2125
  let f = !1;
2875
2126
  const h = d.current !== t;
2876
2127
  if (d.current = t, h) {
2877
- const N = he();
2878
- return Array.isArray(e) && e.length > 0 ? (N.processMessages(e), f || p(N, e)) : (i.current = N, l.current = 0, c.current = "", f || ($(N), w([]))), () => {
2128
+ const I = pe();
2129
+ return Array.isArray(e) && e.length > 0 ? (I.processMessages(e), f || p(I, e)) : (a.current = I, s.current = 0, c.current = "", f || (M(I), k([]))), () => {
2879
2130
  f = !0;
2880
2131
  };
2881
2132
  }
2882
2133
  if (!Array.isArray(e) || e.length === 0) {
2883
- if (l.current > 0) {
2884
- const N = he();
2885
- i.current = N, l.current = 0, c.current = "", f || ($(N), w([]));
2134
+ if (s.current > 0) {
2135
+ const I = pe();
2136
+ a.current = I, s.current = 0, c.current = "", f || (M(I), k([]));
2886
2137
  }
2887
2138
  return () => {
2888
2139
  f = !0;
2889
2140
  };
2890
2141
  }
2891
- const S = i.current, y = l.current;
2142
+ const x = a.current, y = s.current;
2892
2143
  if (e.length < y || g(e, y)) {
2893
- const N = he();
2894
- return N.processMessages(e), f || p(N, e), () => {
2144
+ const I = pe();
2145
+ return I.processMessages(e), f || p(I, e), () => {
2895
2146
  f = !0;
2896
2147
  };
2897
2148
  }
2898
- const x = e.slice(y);
2899
- return x.length === 0 ? () => {
2149
+ const S = e.slice(y);
2150
+ return S.length === 0 ? () => {
2900
2151
  f = !0;
2901
- } : (S.processMessages(x), l.current = e.length, c.current = JSON.stringify(e), f || w(Array.from(S.model.surfacesMap.values())), () => {
2152
+ } : (x.processMessages(S), s.current = e.length, c.current = JSON.stringify(e), f || k(Array.from(x.model.surfacesMap.values())), () => {
2902
2153
  f = !0;
2903
2154
  });
2904
- }, [e, t]), A.length === 0 ? /* @__PURE__ */ s(tt, { children: n }) : /* @__PURE__ */ s(yt, { resumeSearch: o, children: /* @__PURE__ */ s(ht, { caseSearch: a, children: /* @__PURE__ */ s(ct, { interactive: r, children: /* @__PURE__ */ s("div", { className: "a2ui-surface a2ui-container", children: A.map((f) => /* @__PURE__ */ s(at, { surface: f }, f.id)) }) }) }) });
2155
+ }, [e, t]), T.length === 0 ? /* @__PURE__ */ l(X, { children: n }) : /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l(mt, { resumeSearch: o, children: /* @__PURE__ */ l(pt, { caseSearch: i, children: /* @__PURE__ */ l(it, { interactive: r, children: /* @__PURE__ */ l("div", { className: "a2ui-surface a2ui-container", children: T.map((f) => /* @__PURE__ */ l(Ze, { surface: f }, f.id)) }) }) }) }) });
2905
2156
  }
2906
- function ho({
2157
+ function Yr({
2907
2158
  payload: e,
2908
2159
  callbackUrl: t,
2909
2160
  title: n,
2910
2161
  unpublishedFormId: r,
2911
2162
  incompleteFormId: o,
2912
- copyMode: a = "display",
2913
- onNotify: i
2163
+ copyMode: i = "display",
2164
+ onNotify: a
2914
2165
  }) {
2915
- const l = R(
2916
- () => At(e, t),
2166
+ const s = O(
2167
+ () => xt(e, t),
2917
2168
  [e, t]
2918
- ), c = R(() => a === "submitFields" ? Cr(e, t) : l, [a, e, t, l]);
2169
+ ), c = O(() => i === "submitFields" ? vr(e, t) : s, [i, e, t, s]);
2919
2170
  async function u() {
2920
2171
  try {
2921
- await $t(c), i == null || i("success", "已复制到剪贴板");
2172
+ await kt(c), a == null || a("success", "已复制到剪贴板");
2922
2173
  } catch {
2923
- i == null || i("error", "复制失败");
2174
+ a == null || a("error", "复制失败");
2924
2175
  }
2925
2176
  }
2926
- const d = a === "submitFields" ? "复制提交字段 curl(向 callback 回传)" : "复制 curl";
2927
- return /* @__PURE__ */ k("div", { className: "ask-user-curl-card", children: [
2928
- /* @__PURE__ */ k("div", { className: "ask-user-curl-card-header", children: [
2929
- /* @__PURE__ */ k("div", { className: "ask-user-curl-card-header-title", children: [
2930
- /* @__PURE__ */ s(H.Text, { type: "secondary", children: n ?? "curl 命令" }),
2931
- r ? /* @__PURE__ */ s(ae, { title: r, children: /* @__PURE__ */ s(ie, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
2932
- o ? /* @__PURE__ */ s(ae, { title: o, children: /* @__PURE__ */ s(ie, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
2177
+ const d = i === "submitFields" ? "复制提交字段 curl(向 callback 回传)" : "复制 curl";
2178
+ return /* @__PURE__ */ C("div", { className: "ask-user-curl-card", children: [
2179
+ /* @__PURE__ */ C("div", { className: "ask-user-curl-card-header", children: [
2180
+ /* @__PURE__ */ C("div", { className: "ask-user-curl-card-header-title", children: [
2181
+ /* @__PURE__ */ l(H.Text, { type: "secondary", children: n ?? "curl 命令" }),
2182
+ r ? /* @__PURE__ */ l(ne, { title: r, children: /* @__PURE__ */ l(re, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
2183
+ o ? /* @__PURE__ */ l(ne, { title: o, children: /* @__PURE__ */ l(re, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
2933
2184
  ] }),
2934
- /* @__PURE__ */ s(ae, { title: d, children: /* @__PURE__ */ s(xe, { size: "small", type: "text", onClick: () => void u(), children: "复制" }) })
2185
+ /* @__PURE__ */ l(ne, { title: d, children: /* @__PURE__ */ l(ge, { size: "small", type: "text", onClick: () => void u(), children: "复制" }) })
2935
2186
  ] }),
2936
- /* @__PURE__ */ s("pre", { className: "skopon-form-curl-json", children: l })
2187
+ /* @__PURE__ */ l("pre", { className: "skopon-form-curl-json", children: s })
2937
2188
  ] });
2938
2189
  }
2939
- function go(e, t) {
2190
+ function Xr(e, t) {
2940
2191
  if (t && typeof t == "object" && t !== null && "message" in t) {
2941
2192
  const n = t.message;
2942
2193
  if (typeof n == "string" && n.trim())
@@ -2944,156 +2195,159 @@ function go(e, t) {
2944
2195
  }
2945
2196
  return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
2946
2197
  }
2947
- function No({
2198
+ function uo({
2948
2199
  payload: e,
2949
2200
  formUniqueId: t,
2950
2201
  callbackUrl: n,
2951
2202
  submitMode: r = "curl",
2952
2203
  fetchFormDetail: o,
2953
- onNotify: a,
2954
- resumeSearch: i = null,
2955
- caseSearch: l = null
2204
+ onNotify: i,
2205
+ resumeSearch: a = null,
2206
+ caseSearch: s = null
2956
2207
  }) {
2957
- const [c, u] = F(null), [d, p] = F(!1), [g, v] = F(!0), [$, A] = F(!1), w = B(null), f = B(!0), h = B(a);
2958
- h.current = a;
2959
- const S = (t == null ? void 0 : t.trim()) ?? "";
2960
- q(() => (f.current = !0, () => {
2208
+ const [c, u] = z(null), [d, p] = z(!1), [g, v] = z(!0), [M, T] = z(!1), k = q(null), f = q(!0), h = q(i);
2209
+ h.current = i;
2210
+ const x = (t == null ? void 0 : t.trim()) ?? "";
2211
+ L(() => (f.current = !0, () => {
2961
2212
  f.current = !1;
2962
- }), []), q(() => {
2963
- let M = !1;
2964
- return S ? (v(!0), p(!1), o({ formUniqueId: S }).then((_) => {
2965
- M || (p(!!_.disabled), u(_.formDefinition ?? null));
2966
- }).catch((_) => {
2213
+ }), []), L(() => {
2214
+ let P = !1;
2215
+ return x ? (v(!0), p(!1), o({ formUniqueId: x }).then((U) => {
2216
+ P || (p(!!U.disabled), u(U.formDefinition ?? null));
2217
+ }).catch((U) => {
2967
2218
  var b;
2968
- if (!M) {
2219
+ if (!P) {
2969
2220
  p(!1), u(null);
2970
- const I = _ instanceof Error ? _.message : "获取表单定义失败";
2971
- (b = h.current) == null || b.call(h, "error", I);
2221
+ const F = U instanceof Error ? U.message : "获取表单定义失败";
2222
+ (b = h.current) == null || b.call(h, "error", F);
2972
2223
  }
2973
2224
  }).finally(() => {
2974
- M || v(!1);
2225
+ P || v(!1);
2975
2226
  }), () => {
2976
- M = !0;
2227
+ P = !0;
2977
2228
  }) : (v(!1), p(!1), u(null), () => {
2978
- M = !0;
2229
+ P = !0;
2979
2230
  });
2980
- }, [S, o]);
2981
- const y = R(() => kt(e), [e]), x = R(() => y ? vr(y, c ?? void 0) : null, [y, c]), N = (x == null ? void 0 : x.matchedBlocks) ?? [], E = !!(y && xr(y) && N.length === 0), L = R(() => E && y ? Sr(y) : x && x.renderBlocks.length > 0 ? x.renderBlocks : [], [x, E, y]), Z = R(
2982
- () => E ? {} : wt((x == null ? void 0 : x.extraBlocks) ?? []),
2983
- [E, x]
2984
- ), V = R(() => E && y ? kr(y) : L.filter((M) => {
2985
- var _;
2986
- return (_ = M.name) == null ? void 0 : _.trim();
2987
- }).map((M) => M.name.trim()), [E, y, L]), j = R(() => {
2988
- if (L.length === 0) return null;
2989
- const M = (x == null ? void 0 : x.title) ?? (y == null ? void 0 : y.title) ?? "", _ = (x == null ? void 0 : x.description) ?? (y == null ? void 0 : y.description) ?? "";
2990
- return dr({ title: M, description: _ }, L);
2991
- }, [x, y, L]), Y = S ? `ask-user-${S}` : "ask-user-payload";
2231
+ }, [x, o]);
2232
+ const y = O(() => vt(e), [e]), S = O(() => y ? dr(y, c ?? void 0) : null, [y, c]), I = (S == null ? void 0 : S.matchedBlocks) ?? [], E = !!(y && fr(y) && I.length === 0), j = O(() => E && y ? hr(y) : S && S.renderBlocks.length > 0 ? S.renderBlocks : [], [S, E, y]), Q = O(
2233
+ () => E ? {} : bt((S == null ? void 0 : S.extraBlocks) ?? []),
2234
+ [E, S]
2235
+ ), w = O(() => E && y ? gr(y) : j.filter((P) => {
2236
+ var U;
2237
+ return (U = P.name) == null ? void 0 : U.trim();
2238
+ }).map((P) => P.name.trim()), [E, y, j]), B = O(() => {
2239
+ if (j.length === 0) return null;
2240
+ const P = (S == null ? void 0 : S.title) ?? (y == null ? void 0 : y.title) ?? "", U = (S == null ? void 0 : S.description) ?? (y == null ? void 0 : y.description) ?? "";
2241
+ return ar({ title: P, description: U }, j);
2242
+ }, [S, y, j]), J = x ? `ask-user-${x}` : "ask-user-payload";
2992
2243
  if (g)
2993
- return /* @__PURE__ */ s("div", { className: "ask-user-form-card", children: /* @__PURE__ */ s(Le, { size: "small" }) });
2994
- if (!y || L.length === 0)
2995
- return /* @__PURE__ */ s(
2996
- ho,
2244
+ return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l("div", { className: "ask-user-form-card", children: /* @__PURE__ */ l(Ve, { size: "small" }) }) });
2245
+ if (!y || j.length === 0)
2246
+ return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l(
2247
+ Yr,
2997
2248
  {
2998
2249
  payload: e,
2999
2250
  callbackUrl: n,
3000
2251
  copyMode: "submitFields",
3001
- unpublishedFormId: d && S ? S : void 0,
3002
- onNotify: a
2252
+ unpublishedFormId: d && x ? x : void 0,
2253
+ onNotify: i
3003
2254
  }
3004
- );
3005
- async function W() {
3006
- var M, _, b, I, U, T;
3007
- if (!$) {
3008
- A(!0);
2255
+ ) });
2256
+ async function Y() {
2257
+ var P, U, b, F, R, N;
2258
+ if (!M) {
2259
+ T(!0);
3009
2260
  try {
3010
- const re = ((M = w.current) == null ? void 0 : M.getValues(V)) ?? {}, Ce = { ...re, ...Z };
2261
+ const ee = ((P = k.current) == null ? void 0 : P.getValues(w)) ?? {}, Se = { ...ee, ...Q };
3011
2262
  if (r === "post") {
3012
- const Ge = (n ?? "").trim();
3013
- if (!Ge) {
3014
- (_ = h.current) == null || _.call(h, "error", "callback_url 为空,无法提交");
2263
+ const $e = (n ?? "").trim();
2264
+ if (!$e) {
2265
+ (U = h.current) == null || U.call(h, "error", "callback_url 为空,无法提交");
3015
2266
  return;
3016
2267
  }
3017
- const Ae = await Ar(Ge, Ce);
2268
+ const xe = await br($e, Se);
3018
2269
  if (!f.current) return;
3019
- Ae.ok ? (b = h.current) == null || b.call(h, "success", "提交成功") : (I = h.current) == null || I.call(h, "error", go(Ae.status, Ae.body));
2270
+ xe.ok ? (b = h.current) == null || b.call(h, "success", "提交成功") : (F = h.current) == null || F.call(h, "error", Xr(xe.status, xe.body));
3020
2271
  return;
3021
2272
  }
3022
- if (await $t(
3023
- Tt({ cardValues: re, extraValues: Z, callbackUrl: n })
2273
+ if (await kt(
2274
+ Ct({ cardValues: ee, extraValues: Q, callbackUrl: n })
3024
2275
  ), !f.current) return;
3025
- (U = h.current) == null || U.call(h, "success", "已复制 curl 到剪贴板");
3026
- } catch (re) {
2276
+ (R = h.current) == null || R.call(h, "success", "已复制 curl 到剪贴板");
2277
+ } catch (ee) {
3027
2278
  if (!f.current) return;
3028
- const Ce = re instanceof Error ? re.message : "复制失败";
3029
- (T = h.current) == null || T.call(h, "error", Ce);
2279
+ const Se = ee instanceof Error ? ee.message : "复制失败";
2280
+ (N = h.current) == null || N.call(h, "error", Se);
3030
2281
  } finally {
3031
- f.current && A(!1);
2282
+ f.current && T(!1);
3032
2283
  }
3033
2284
  }
3034
2285
  }
3035
- return /* @__PURE__ */ k("div", { className: "ask-user-form-card", children: [
3036
- d && S ? /* @__PURE__ */ s("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ s(ae, { title: S, children: /* @__PURE__ */ s(ie, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
3037
- /* @__PURE__ */ s(
3038
- fo,
2286
+ return /* @__PURE__ */ l(X, { children: /* @__PURE__ */ C("div", { className: "ask-user-form-card", children: [
2287
+ d && x ? /* @__PURE__ */ l("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ l(ne, { title: x, children: /* @__PURE__ */ l(re, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
2288
+ /* @__PURE__ */ l(
2289
+ Jr,
3039
2290
  {
3040
- ref: w,
3041
- doc: j,
3042
- surfaceId: Y,
3043
- fieldNames: V,
2291
+ ref: k,
2292
+ doc: B,
2293
+ surfaceId: J,
2294
+ fieldNames: w,
3044
2295
  interactive: !0,
3045
- resumeSearch: i,
3046
- caseSearch: l
2296
+ resumeSearch: a,
2297
+ caseSearch: s
3047
2298
  }
3048
2299
  ),
3049
- /* @__PURE__ */ s("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ s(ae, { title: r === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ s(
3050
- xe,
2300
+ /* @__PURE__ */ l("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ l(ne, { title: r === "curl" ? "点击复制 curl" : "提交 JSON 到 callback_url", children: /* @__PURE__ */ l(
2301
+ ge,
3051
2302
  {
3052
2303
  type: "primary",
3053
2304
  size: "small",
3054
- loading: $,
3055
- disabled: $,
3056
- onClick: () => void W(),
2305
+ loading: M,
2306
+ disabled: M,
2307
+ onClick: () => void Y(),
3057
2308
  children: "提交"
3058
2309
  }
3059
2310
  ) }) })
3060
- ] });
2311
+ ] }) });
3061
2312
  }
3062
2313
  export {
3063
- Ao as A2UI_PROTOCOL_VERSION,
3064
- No as AskUserFormCard,
3065
- ht as CaseSearchProvider,
3066
- ho as CurlSubmitBlock,
3067
- Xt as FORM_MEDIA_SIZES,
3068
- yt as ResumeSearchProvider,
3069
- $o as SkoponA2uiStreamRenderer,
3070
- fo as SkoponFormRenderer,
3071
- cr as a2uiToBlocks,
3072
- bt as blocksToA2ui,
3073
- wr as buildAskUserCurlBodyJson,
3074
- Tt as buildAskUserCurlStatement,
3075
- Cr as buildAskUserSubmitCurlFromPayload,
3076
- dr as buildAskUserSurface,
3077
- At as buildCurlStatement,
3078
- $t as copyTextToClipboard,
3079
- To as createFormClient,
3080
- wt as extractExtraBlockValues,
3081
- fr as extractSurfaceValues,
3082
- kr as getPayloadInputFieldNames,
3083
- Sr as getPayloadRenderableBlocks,
3084
- vr as intersectPayloadBlocksWithForm,
3085
- Ve as isA2uiSurfaceEmpty,
3086
- X as isInputBlockType,
3087
- De as isLayoutBlockType,
3088
- je as isMediaBlockType,
3089
- mr as mapFormDefinitionFromDto,
3090
- ne as normalizeFormDefinition,
3091
- kt as parsePayloadBlocksJson,
3092
- xr as payloadHasInputBlocks,
3093
- pr as resolveSurfaceFromFormDefinition,
3094
- Ar as submitFormJson,
3095
- ur as surfaceDocToMessages,
3096
- ye as syncFormDefinition,
3097
- In as useCaseSearch,
3098
- Rn as useResumeSearch
2314
+ lo as A2UI_PROTOCOL_VERSION,
2315
+ uo as AskUserFormCard,
2316
+ pt as CaseSearchProvider,
2317
+ Yr as CurlSubmitBlock,
2318
+ Ht as FORM_MEDIA_SIZES,
2319
+ mt as ResumeSearchProvider,
2320
+ co as SkoponA2uiStreamRenderer,
2321
+ X as SkoponFormProvider,
2322
+ Jr as SkoponFormRenderer,
2323
+ rr as a2uiToBlocks,
2324
+ ht as blocksToA2ui,
2325
+ yr as buildAskUserCurlBodyJson,
2326
+ Ct as buildAskUserCurlStatement,
2327
+ vr as buildAskUserSubmitCurlFromPayload,
2328
+ ar as buildAskUserSurface,
2329
+ xt as buildCurlStatement,
2330
+ kt as copyTextToClipboard,
2331
+ so as createFormClient,
2332
+ bt as extractExtraBlockValues,
2333
+ sr as extractSurfaceValues,
2334
+ gr as getPayloadInputFieldNames,
2335
+ hr as getPayloadRenderableBlocks,
2336
+ dr as intersectPayloadBlocksWithForm,
2337
+ Re as isA2uiSurfaceEmpty,
2338
+ W as isInputBlockType,
2339
+ we as isLayoutBlockType,
2340
+ Ue as isMediaBlockType,
2341
+ lr as mapFormDefinitionFromDto,
2342
+ Z as normalizeFormDefinition,
2343
+ vt as parsePayloadBlocksJson,
2344
+ fr as payloadHasInputBlocks,
2345
+ ir as resolveSurfaceFromFormDefinition,
2346
+ Gr as skoponAntdTheme,
2347
+ $ as skoponBrandColors,
2348
+ br as submitFormJson,
2349
+ or as surfaceDocToMessages,
2350
+ me as syncFormDefinition,
2351
+ kn as useCaseSearch,
2352
+ Un as useResumeSearch
3099
2353
  };