@skopon-cool/form-sdk 0.1.3 → 0.1.4

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