@skopon-cool/form-sdk 0.4.9 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -1
- package/dist/adapter/formSchema.d.ts.map +1 -1
- package/dist/adapter/formWeb.d.ts +14 -0
- package/dist/adapter/formWeb.d.ts.map +1 -0
- package/dist/blocks/registry.d.ts.map +1 -1
- package/dist/blocks/web/adapter.d.ts +8 -0
- package/dist/blocks/web/adapter.d.ts.map +1 -0
- package/dist/blocks/web/catalog.d.ts +9 -0
- package/dist/blocks/web/catalog.d.ts.map +1 -0
- package/dist/blocks/web/index.d.ts +3 -0
- package/dist/blocks/web/index.d.ts.map +1 -0
- package/dist/client/authStorage.d.ts +1 -1
- package/dist/client/authStorage.d.ts.map +1 -1
- package/dist/form-sdk.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1391 -1209
- package/dist/types/index.d.ts +7 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapter/a2uiAdapter.test.ts +39 -0
- package/src/adapter/formSchema.test.ts +38 -0
- package/src/adapter/formSchema.ts +16 -1
- package/src/adapter/formWeb.test.ts +38 -0
- package/src/adapter/formWeb.ts +41 -0
- package/src/blocks/registry.ts +6 -1
- package/src/blocks/web/adapter.ts +36 -0
- package/src/blocks/web/catalog.test.tsx +95 -0
- package/src/blocks/web/catalog.tsx +158 -0
- package/src/blocks/web/index.ts +11 -0
- package/src/client/authStorage.ts +1 -1
- package/src/index.ts +9 -0
- package/src/styles/index.css +87 -0
- package/src/submit/submit.test.ts +14 -0
- package/src/submit/validateFormSubmit.ts +2 -2
- package/src/types/index.ts +12 -2
package/dist/index.js
CHANGED
|
@@ -1,43 +1,70 @@
|
|
|
1
1
|
import './form-sdk.css';
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var G = (e, t, n) =>
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { useRef as A, useState as
|
|
7
|
-
import { Spin as
|
|
8
|
-
import { ReloadOutlined as
|
|
9
|
-
import { createBinderlessComponentImplementation as
|
|
10
|
-
import { z as
|
|
11
|
-
import { Catalog as
|
|
12
|
-
import { injectBasicCatalogStyles as
|
|
13
|
-
import { injectStyles as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
2
|
+
var jn = Object.defineProperty;
|
|
3
|
+
var $n = (e, t, n) => t in e ? jn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var G = (e, t, n) => $n(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
|
+
import { jsx as c, jsxs as x } from "react/jsx-runtime";
|
|
6
|
+
import { useRef as A, useState as E, useCallback as j, useMemo as V, createContext as Ae, useContext as _e, useEffect as B, useSyncExternalStore as Dn, forwardRef as Hn, useImperativeHandle as Kn } from "react";
|
|
7
|
+
import { Spin as ht, Button as Te, Typography as ee, Avatar as Wn, Tag as ye, Tooltip as fe, Modal as Gn, Select as at, Checkbox as Jn, Radio as Yn, Switch as Xn, TimePicker as Qn, DatePicker as Zn, Upload as Xe, Input as Qe, InputNumber as er, ConfigProvider as tr } from "antd";
|
|
8
|
+
import { ReloadOutlined as Zt, FileTextOutlined as en, UserOutlined as nr, FileImageOutlined as rr, FullscreenOutlined as or, FileExcelOutlined as ir, FileOutlined as tn, PictureOutlined as sr, SoundOutlined as ar, VideoCameraOutlined as lr } from "@ant-design/icons";
|
|
9
|
+
import { createBinderlessComponentImplementation as J, basicCatalog as we, A2uiSurface as nn } from "@a2ui/react/v0_9";
|
|
10
|
+
import { z as f } from "zod";
|
|
11
|
+
import { Catalog as cr, MessageProcessor as rn } from "@a2ui/web_core/v0_9";
|
|
12
|
+
import { injectBasicCatalogStyles as on } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
13
|
+
import { injectStyles as sn } from "@a2ui/react/styles";
|
|
14
|
+
import Dt from "dayjs";
|
|
15
|
+
const Is = "v0.9", ur = [
|
|
16
16
|
"huge",
|
|
17
17
|
"large",
|
|
18
18
|
"medium",
|
|
19
19
|
"small",
|
|
20
20
|
"icon"
|
|
21
21
|
];
|
|
22
|
-
function
|
|
22
|
+
function ve(e) {
|
|
23
23
|
return e === "image" || e === "video" || e === "audio";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function be(e) {
|
|
26
|
+
return e === "web";
|
|
27
|
+
}
|
|
28
|
+
function an(e) {
|
|
26
29
|
return e === "heading" || e === "paragraph";
|
|
27
30
|
}
|
|
28
31
|
function Z(e) {
|
|
29
|
-
return !
|
|
32
|
+
return !an(e) && !ve(e) && !be(e);
|
|
30
33
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
34
|
+
function ln(e) {
|
|
35
|
+
return an(e) || ve(e) || be(e);
|
|
33
36
|
}
|
|
34
|
-
function
|
|
37
|
+
function mr(e) {
|
|
35
38
|
return e === "select" || e === "multiselect" || e === "radio" || e === "checkbox";
|
|
36
39
|
}
|
|
37
|
-
function
|
|
40
|
+
function Es(e) {
|
|
38
41
|
return Z(e) && e !== "file" && e !== "resume_multiselect" && e !== "case_multiselect";
|
|
39
42
|
}
|
|
40
|
-
|
|
43
|
+
const lt = 360, dr = 200, pr = 1200;
|
|
44
|
+
function xe(e) {
|
|
45
|
+
if (e == null || e === "")
|
|
46
|
+
return lt;
|
|
47
|
+
const t = typeof e == "number" ? e : Number(e);
|
|
48
|
+
return Number.isFinite(t) ? Math.min(
|
|
49
|
+
pr,
|
|
50
|
+
Math.max(dr, Math.floor(t))
|
|
51
|
+
) : lt;
|
|
52
|
+
}
|
|
53
|
+
function fr(e) {
|
|
54
|
+
if (typeof e != "string") return !1;
|
|
55
|
+
const t = e.trim();
|
|
56
|
+
if (!t) return !1;
|
|
57
|
+
if (/^\/(?!\/)/.test(t) || /^\.\.?\//.test(t))
|
|
58
|
+
return !0;
|
|
59
|
+
if (!/^https?:\/\//i.test(t)) return !1;
|
|
60
|
+
try {
|
|
61
|
+
const n = new URL(t);
|
|
62
|
+
return (n.protocol === "http:" || n.protocol === "https:") && !!n.hostname;
|
|
63
|
+
} catch {
|
|
64
|
+
return !1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function hr() {
|
|
41
68
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
42
69
|
return crypto.randomUUID();
|
|
43
70
|
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
|
|
@@ -52,10 +79,10 @@ function sr() {
|
|
|
52
79
|
});
|
|
53
80
|
}
|
|
54
81
|
function le(e) {
|
|
55
|
-
const t =
|
|
82
|
+
const t = hr().replace(/-/g, "").slice(0, 8);
|
|
56
83
|
return `${e}${t}`;
|
|
57
84
|
}
|
|
58
|
-
const
|
|
85
|
+
const cn = [
|
|
59
86
|
{ value: "image/*", label: "图片" },
|
|
60
87
|
{ value: "video/*", label: "视频" },
|
|
61
88
|
{ value: "audio/*", label: "音频" },
|
|
@@ -66,7 +93,7 @@ const on = [
|
|
|
66
93
|
{ value: "text/plain", label: "纯文本" },
|
|
67
94
|
{ value: "application/zip", label: "ZIP 压缩包" },
|
|
68
95
|
{ value: "application/x-rar-compressed", label: "RAR 压缩包" }
|
|
69
|
-
],
|
|
96
|
+
], gr = {
|
|
70
97
|
"image/*": ["image/*"],
|
|
71
98
|
"video/*": ["video/*"],
|
|
72
99
|
"audio/*": ["audio/*"],
|
|
@@ -86,7 +113,7 @@ const on = [
|
|
|
86
113
|
"text/plain": ["text/plain"],
|
|
87
114
|
"application/zip": ["application/zip"],
|
|
88
115
|
"application/x-rar-compressed": ["application/x-rar-compressed"]
|
|
89
|
-
},
|
|
116
|
+
}, yr = {
|
|
90
117
|
"image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
|
|
91
118
|
"video/*": [".mp4", ".mov", ".avi", ".webm"],
|
|
92
119
|
"audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
|
|
@@ -97,14 +124,14 @@ const on = [
|
|
|
97
124
|
"text/plain": [".txt"],
|
|
98
125
|
"application/zip": [".zip", ".7z"],
|
|
99
126
|
"application/x-rar-compressed": [".rar"]
|
|
100
|
-
},
|
|
127
|
+
}, vr = {
|
|
101
128
|
"application/msword": "office/word",
|
|
102
129
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
|
|
103
130
|
"application/vnd.ms-excel": "office/excel",
|
|
104
131
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
|
|
105
132
|
"application/vnd.ms-powerpoint": "office/ppt",
|
|
106
133
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
|
|
107
|
-
},
|
|
134
|
+
}, gt = [
|
|
108
135
|
{ value: ".jpg", label: ".jpg" },
|
|
109
136
|
{ value: ".jpeg", label: ".jpeg" },
|
|
110
137
|
{ value: ".png", label: ".png" },
|
|
@@ -130,108 +157,108 @@ const on = [
|
|
|
130
157
|
{ value: ".zip", label: ".zip" },
|
|
131
158
|
{ value: ".rar", label: ".rar" },
|
|
132
159
|
{ value: ".7z", label: ".7z" }
|
|
133
|
-
],
|
|
134
|
-
|
|
135
|
-
),
|
|
136
|
-
|
|
137
|
-
),
|
|
138
|
-
|
|
160
|
+
], br = Object.fromEntries(
|
|
161
|
+
cn.map((e) => [e.value, e.label])
|
|
162
|
+
), Sr = Object.fromEntries(
|
|
163
|
+
gt.map((e) => [e.value, e.label])
|
|
164
|
+
), kr = new Set(cn.map((e) => e.value)), Cr = new Set(
|
|
165
|
+
gt.map((e) => e.value)
|
|
139
166
|
);
|
|
140
|
-
function
|
|
167
|
+
function Ar(e) {
|
|
141
168
|
const t = e.trim();
|
|
142
|
-
return t ?
|
|
169
|
+
return t ? kr.has(t) ? t : vr[t] ?? null : null;
|
|
143
170
|
}
|
|
144
|
-
function
|
|
171
|
+
function _r(e) {
|
|
145
172
|
return Array.isArray(e) ? e.map((t) => {
|
|
146
173
|
const n = t.trim().toLowerCase();
|
|
147
174
|
return n ? n.startsWith(".") ? n : `.${n}` : "";
|
|
148
175
|
}).filter(Boolean) : [];
|
|
149
176
|
}
|
|
150
|
-
function
|
|
177
|
+
function Me(e) {
|
|
151
178
|
if (!Array.isArray(e)) return [];
|
|
152
179
|
const t = [], n = /* @__PURE__ */ new Set();
|
|
153
180
|
for (const r of e) {
|
|
154
|
-
const o =
|
|
181
|
+
const o = Ar(r);
|
|
155
182
|
o && !n.has(o) && (n.add(o), t.push(o));
|
|
156
183
|
}
|
|
157
184
|
return t;
|
|
158
185
|
}
|
|
159
|
-
function
|
|
160
|
-
const t =
|
|
186
|
+
function Tr(e) {
|
|
187
|
+
const t = Me(e), n = [];
|
|
161
188
|
for (const r of t)
|
|
162
|
-
n.push(...
|
|
189
|
+
n.push(...gr[r] ?? [r]);
|
|
163
190
|
return n;
|
|
164
191
|
}
|
|
165
|
-
function
|
|
166
|
-
const t =
|
|
192
|
+
function xr(e) {
|
|
193
|
+
const t = Me(e);
|
|
167
194
|
if (t.length === 0) return [];
|
|
168
195
|
const n = /* @__PURE__ */ new Set();
|
|
169
196
|
for (const r of t)
|
|
170
|
-
for (const o of
|
|
197
|
+
for (const o of yr[r] ?? [])
|
|
171
198
|
n.add(o);
|
|
172
|
-
return
|
|
199
|
+
return gt.filter((r) => n.has(r.value));
|
|
173
200
|
}
|
|
174
|
-
function
|
|
175
|
-
const n =
|
|
201
|
+
function yt(e, t) {
|
|
202
|
+
const n = _r(t), r = Me(e);
|
|
176
203
|
if (r.length === 0)
|
|
177
|
-
return n.filter((i) =>
|
|
204
|
+
return n.filter((i) => Cr.has(i));
|
|
178
205
|
const o = new Set(
|
|
179
|
-
|
|
206
|
+
xr(r).map((i) => i.value)
|
|
180
207
|
);
|
|
181
208
|
return n.filter((i) => o.has(i));
|
|
182
209
|
}
|
|
183
|
-
function
|
|
184
|
-
const n =
|
|
210
|
+
function Mr(e, t) {
|
|
211
|
+
const n = Tr(e), r = yt(e, t), o = [...n, ...r];
|
|
185
212
|
return o.length > 0 ? o.join(",") : void 0;
|
|
186
213
|
}
|
|
187
|
-
function
|
|
188
|
-
const n =
|
|
214
|
+
function Nr(e, t) {
|
|
215
|
+
const n = Me(e), r = yt(
|
|
189
216
|
n,
|
|
190
217
|
t
|
|
191
218
|
), o = [
|
|
192
|
-
...n.map((i) =>
|
|
193
|
-
...r.map((i) =>
|
|
219
|
+
...n.map((i) => br[i] ?? i),
|
|
220
|
+
...r.map((i) => Sr[i] ?? i)
|
|
194
221
|
];
|
|
195
222
|
return o.length === 0 ? null : o.join("、");
|
|
196
223
|
}
|
|
197
|
-
const
|
|
224
|
+
const Fr = [
|
|
198
225
|
"video",
|
|
199
226
|
"audio",
|
|
200
227
|
"image",
|
|
201
228
|
"file",
|
|
202
229
|
"spreadsheet",
|
|
203
230
|
"document"
|
|
204
|
-
],
|
|
205
|
-
function
|
|
206
|
-
return e &&
|
|
231
|
+
], Ir = new Set(Fr);
|
|
232
|
+
function Er(e) {
|
|
233
|
+
return e && Ir.has(e) ? e : "file";
|
|
207
234
|
}
|
|
208
|
-
function
|
|
209
|
-
return typeof e == "string" &&
|
|
235
|
+
function Ne(e) {
|
|
236
|
+
return typeof e == "string" && ur.includes(e) ? e : "medium";
|
|
210
237
|
}
|
|
211
|
-
function
|
|
238
|
+
function Ur(e, t) {
|
|
212
239
|
var o;
|
|
213
240
|
const n = Math.max(1, t);
|
|
214
241
|
let r = [];
|
|
215
242
|
return Array.isArray(e.mediaUrls) ? r = e.mediaUrls.map((i) => String(i).trim()) : (o = e.mediaUrl) != null && o.trim() && (r = [e.mediaUrl.trim()]), r.length === 0 ? [""] : r.slice(0, n);
|
|
216
243
|
}
|
|
217
|
-
function
|
|
244
|
+
function Rr(e) {
|
|
218
245
|
var t;
|
|
219
246
|
return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
|
|
220
247
|
}
|
|
221
|
-
function
|
|
222
|
-
return `form-media-size-${
|
|
248
|
+
function wr(e) {
|
|
249
|
+
return `form-media-size-${Ne(e)}`;
|
|
223
250
|
}
|
|
224
|
-
function
|
|
225
|
-
return `form-media-preview form-media-list ${
|
|
251
|
+
function Pr(e) {
|
|
252
|
+
return `form-media-preview form-media-list ${wr(e)}`;
|
|
226
253
|
}
|
|
227
|
-
const
|
|
228
|
-
function
|
|
254
|
+
const zr = 10;
|
|
255
|
+
function un(e) {
|
|
229
256
|
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
230
257
|
}
|
|
231
|
-
function
|
|
258
|
+
function Fe(e) {
|
|
232
259
|
return e === !0 || e === "true" || e === 1 || e === "1";
|
|
233
260
|
}
|
|
234
|
-
function
|
|
261
|
+
function Pe(e, t = 1) {
|
|
235
262
|
const n = typeof e == "number" ? e : Number(e);
|
|
236
263
|
return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
|
|
237
264
|
}
|
|
@@ -239,10 +266,10 @@ function de(e, t = 1) {
|
|
|
239
266
|
const n = typeof e == "number" ? e : Number(e);
|
|
240
267
|
return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
|
|
241
268
|
}
|
|
242
|
-
function
|
|
243
|
-
return t == null ? void 0 : e === "toggle" ?
|
|
269
|
+
function mn(e, t) {
|
|
270
|
+
return t == null ? void 0 : e === "toggle" ? Fe(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String).map((o) => o.trim()).filter(Boolean) : typeof t == "string" && t.trim() ? [t.trim()] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t).trim() || void 0;
|
|
244
271
|
}
|
|
245
|
-
function
|
|
272
|
+
function Or(e) {
|
|
246
273
|
if (Array.isArray(e)) return e.map(String).filter(Boolean);
|
|
247
274
|
if (typeof e == "string" && e.trim())
|
|
248
275
|
try {
|
|
@@ -252,11 +279,11 @@ function Nr(e) {
|
|
|
252
279
|
}
|
|
253
280
|
return [];
|
|
254
281
|
}
|
|
255
|
-
function
|
|
256
|
-
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, o = typeof (e == null ? void 0 : e.agentUniqueId) == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, i = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, s = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, a =
|
|
282
|
+
function Br(e) {
|
|
283
|
+
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, o = typeof (e == null ? void 0 : e.agentUniqueId) == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, i = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, s = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, a = Or(e == null ? void 0 : e.flowUniqueIds);
|
|
257
284
|
return { agentKind: r, agentUniqueId: o, flowType: i, category: s, flowUniqueIds: a, pageSize: n };
|
|
258
285
|
}
|
|
259
|
-
function
|
|
286
|
+
function qr(e) {
|
|
260
287
|
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0;
|
|
261
288
|
return {
|
|
262
289
|
names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
|
|
@@ -266,14 +293,14 @@ function Fr(e) {
|
|
|
266
293
|
pageSize: n
|
|
267
294
|
};
|
|
268
295
|
}
|
|
269
|
-
function
|
|
296
|
+
function Lr(e) {
|
|
270
297
|
if (e.type !== "case_singleselect") return e;
|
|
271
298
|
const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
|
|
272
299
|
return { ...e, type: "case_multiselect", defaultValue: t };
|
|
273
300
|
}
|
|
274
|
-
function
|
|
275
|
-
var o, i, s, a;
|
|
276
|
-
const t =
|
|
301
|
+
function Vr(e) {
|
|
302
|
+
var o, i, s, a, l;
|
|
303
|
+
const t = Lr(e), n = Me(t.fileAcceptTypes), r = t.type;
|
|
277
304
|
return {
|
|
278
305
|
id: ((o = t.id) == null ? void 0 : o.trim()) || le("block-"),
|
|
279
306
|
type: r,
|
|
@@ -282,28 +309,30 @@ function Ur(e) {
|
|
|
282
309
|
placeholder: t.placeholder ?? "",
|
|
283
310
|
help: t.help ?? "",
|
|
284
311
|
required: t.required === !0,
|
|
285
|
-
mediaUrls:
|
|
286
|
-
mediaSize:
|
|
312
|
+
mediaUrls: ve(r) ? Ur(t, zr) : void 0,
|
|
313
|
+
mediaSize: ve(r) ? Ne(t.mediaSize) : void 0,
|
|
314
|
+
webUrl: be(r) ? ((s = t.webUrl) == null ? void 0 : s.trim()) ?? "" : void 0,
|
|
315
|
+
webHeight: be(r) ? xe(t.webHeight) : void 0,
|
|
287
316
|
fileAcceptTypes: n,
|
|
288
|
-
fileAcceptExtensions:
|
|
317
|
+
fileAcceptExtensions: yt(
|
|
289
318
|
n,
|
|
290
319
|
t.fileAcceptExtensions
|
|
291
320
|
),
|
|
292
|
-
filePlaceholderIcon:
|
|
293
|
-
fileMinCount: r === "file" ?
|
|
294
|
-
fileMaxCount: r === "file" ?
|
|
295
|
-
defaultValue:
|
|
296
|
-
jsonSchemaDescription: ((
|
|
321
|
+
filePlaceholderIcon: Er(t.filePlaceholderIcon),
|
|
322
|
+
fileMinCount: r === "file" ? Pe(t.fileMinCount, 1) : void 0,
|
|
323
|
+
fileMaxCount: r === "file" ? Pe(t.fileMaxCount, 1) : void 0,
|
|
324
|
+
defaultValue: mn(r, t.defaultValue),
|
|
325
|
+
jsonSchemaDescription: ((a = t.jsonSchemaDescription) == null ? void 0 : a.trim()) ?? "",
|
|
297
326
|
hidden: r === "text" ? t.hidden === !0 : void 0,
|
|
298
327
|
needLLM: t.needLLM === !0 ? !0 : void 0,
|
|
299
|
-
options: Array.isArray(t.options) ? t.options.map((
|
|
300
|
-
var
|
|
328
|
+
options: Array.isArray(t.options) ? t.options.map((u, m) => {
|
|
329
|
+
var d, v;
|
|
301
330
|
return {
|
|
302
|
-
value: ((
|
|
303
|
-
label: ((
|
|
331
|
+
value: ((d = u.value) == null ? void 0 : d.trim()) || `option_${m + 1}`,
|
|
332
|
+
label: ((v = u.label) == null ? void 0 : v.trim()) || `选项 ${m + 1}`
|
|
304
333
|
};
|
|
305
334
|
}) : void 0,
|
|
306
|
-
condition: (
|
|
335
|
+
condition: (l = t.condition) != null && l.fieldName ? {
|
|
307
336
|
fieldName: t.condition.fieldName.trim(),
|
|
308
337
|
operator: t.condition.operator ?? "eq",
|
|
309
338
|
value: t.condition.value
|
|
@@ -311,27 +340,27 @@ function Ur(e) {
|
|
|
311
340
|
resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
|
|
312
341
|
resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? de(t.resumeMinCount, 1) : void 0,
|
|
313
342
|
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? de(t.resumeMaxCount, 1) : void 0,
|
|
314
|
-
resumeFilter: r === "resume_multiselect" ?
|
|
343
|
+
resumeFilter: r === "resume_multiselect" ? qr(t.resumeFilter) : void 0,
|
|
315
344
|
caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
|
|
316
345
|
caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? de(t.caseMinCount, 1) : void 0,
|
|
317
346
|
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? de(t.caseMaxCount, 1) : void 0,
|
|
318
|
-
caseFilter: r === "case_multiselect" ?
|
|
347
|
+
caseFilter: r === "case_multiselect" ? Br(t.caseFilter) : void 0
|
|
319
348
|
};
|
|
320
349
|
}
|
|
321
|
-
function
|
|
350
|
+
function jr(e) {
|
|
322
351
|
return new Set((e.options ?? []).map((t) => t.value));
|
|
323
352
|
}
|
|
324
|
-
function
|
|
353
|
+
function Ht(e, t) {
|
|
325
354
|
const n = {
|
|
326
355
|
type: "array",
|
|
327
356
|
items: { type: "string" }
|
|
328
357
|
};
|
|
329
358
|
return e !== void 0 && (n.minItems = de(e, 1)), t !== void 0 && (n.maxItems = de(t, 1)), n;
|
|
330
359
|
}
|
|
331
|
-
function
|
|
332
|
-
const t =
|
|
360
|
+
function $r(e) {
|
|
361
|
+
const t = mn(e.type, e.defaultValue);
|
|
333
362
|
if (t === void 0) return;
|
|
334
|
-
const n =
|
|
363
|
+
const n = jr(e);
|
|
335
364
|
switch (e.type) {
|
|
336
365
|
case "toggle":
|
|
337
366
|
return t;
|
|
@@ -358,7 +387,7 @@ function Pr(e) {
|
|
|
358
387
|
return t;
|
|
359
388
|
}
|
|
360
389
|
}
|
|
361
|
-
function
|
|
390
|
+
function Dr(e) {
|
|
362
391
|
var i, s;
|
|
363
392
|
if (!((i = e.name) == null ? void 0 : i.trim()) || !Z(e.type)) return null;
|
|
364
393
|
let n;
|
|
@@ -386,7 +415,7 @@ function wr(e) {
|
|
|
386
415
|
break;
|
|
387
416
|
}
|
|
388
417
|
case "file": {
|
|
389
|
-
const a =
|
|
418
|
+
const a = Pe(e.fileMinCount, 1), l = Pe(e.fileMaxCount, 1);
|
|
390
419
|
l <= 1 ? n = { type: "string" } : n = {
|
|
391
420
|
type: "array",
|
|
392
421
|
items: { type: "string" },
|
|
@@ -396,10 +425,10 @@ function wr(e) {
|
|
|
396
425
|
break;
|
|
397
426
|
}
|
|
398
427
|
case "resume_multiselect":
|
|
399
|
-
n =
|
|
428
|
+
n = Ht(e.resumeMinCount, e.resumeMaxCount);
|
|
400
429
|
break;
|
|
401
430
|
case "case_multiselect":
|
|
402
|
-
n =
|
|
431
|
+
n = Ht(e.caseMinCount, e.caseMaxCount);
|
|
403
432
|
break;
|
|
404
433
|
case "text":
|
|
405
434
|
n = { type: "string" }, e.hidden && (n["x-hidden"] = !0);
|
|
@@ -410,17 +439,17 @@ function wr(e) {
|
|
|
410
439
|
}
|
|
411
440
|
const r = (s = e.jsonSchemaDescription) == null ? void 0 : s.trim();
|
|
412
441
|
r && (n.$comment = r);
|
|
413
|
-
const o =
|
|
442
|
+
const o = $r(e);
|
|
414
443
|
return o !== void 0 && (n.default = o), n;
|
|
415
444
|
}
|
|
416
|
-
function
|
|
445
|
+
function Hr(e, t, n) {
|
|
417
446
|
var l;
|
|
418
447
|
const r = {}, o = [];
|
|
419
|
-
for (const
|
|
420
|
-
const m = (l =
|
|
421
|
-
if (!m || !Z(
|
|
422
|
-
const d =
|
|
423
|
-
d && (r[m] = d,
|
|
448
|
+
for (const u of e) {
|
|
449
|
+
const m = (l = u.name) == null ? void 0 : l.trim();
|
|
450
|
+
if (!m || !Z(u.type)) continue;
|
|
451
|
+
const d = Dr(u);
|
|
452
|
+
d && (r[m] = d, u.required && o.push(m));
|
|
424
453
|
}
|
|
425
454
|
const i = {
|
|
426
455
|
type: "object",
|
|
@@ -430,35 +459,35 @@ function zr(e, t, n) {
|
|
|
430
459
|
}, s = t == null ? void 0 : t.trim(), a = n == null ? void 0 : n.trim();
|
|
431
460
|
return s && (i.title = s), a && (i.description = a), i;
|
|
432
461
|
}
|
|
433
|
-
function
|
|
462
|
+
function Se(e) {
|
|
434
463
|
const t = e.title ?? "", n = e.description ?? "";
|
|
435
464
|
return {
|
|
436
465
|
title: t,
|
|
437
466
|
description: n,
|
|
438
467
|
blocks: e.blocks,
|
|
439
|
-
jsonSchema:
|
|
468
|
+
jsonSchema: Hr(e.blocks, t, n)
|
|
440
469
|
};
|
|
441
470
|
}
|
|
442
|
-
function
|
|
471
|
+
function qe(e) {
|
|
443
472
|
if (!e || !Array.isArray(e.blocks))
|
|
444
|
-
return
|
|
445
|
-
const t = e.blocks.map(
|
|
446
|
-
return
|
|
473
|
+
return Se({ title: "", description: "", blocks: [] });
|
|
474
|
+
const t = e.blocks.map(Vr);
|
|
475
|
+
return Se({
|
|
447
476
|
title: typeof e.title == "string" ? e.title : "",
|
|
448
477
|
description: typeof e.description == "string" ? e.description : "",
|
|
449
478
|
blocks: t
|
|
450
479
|
});
|
|
451
480
|
}
|
|
452
|
-
function
|
|
453
|
-
return
|
|
481
|
+
function Us() {
|
|
482
|
+
return Se({ title: "", description: "", blocks: [] });
|
|
454
483
|
}
|
|
455
|
-
function
|
|
484
|
+
function Rs(e) {
|
|
456
485
|
const t = {
|
|
457
486
|
id: le("block-"),
|
|
458
487
|
type: e,
|
|
459
488
|
label: e
|
|
460
489
|
};
|
|
461
|
-
return Z(e) && (t.label = "", t.name = le("field_"), t.placeholder = "", t.required = !1),
|
|
490
|
+
return Z(e) && (t.label = "", t.name = le("field_"), t.placeholder = "", t.required = !1), ve(e) && (t.label = "", t.placeholder = "", t.help = "", t.mediaUrls = [""], t.mediaSize = "medium"), be(e) && (t.label = "", t.help = "", t.webUrl = "", t.webHeight = lt), mr(e) && (t.options = [
|
|
462
491
|
{ value: "option_1", label: "选项 1" },
|
|
463
492
|
{ value: "option_2", label: "选项 2" }
|
|
464
493
|
]), e === "file" && (t.fileAcceptTypes = [], t.fileAcceptExtensions = [], t.filePlaceholderIcon = "file", t.fileMinCount = 1, t.fileMaxCount = 1), e === "resume_multiselect" && (t.resumeEnableRefresh = !0, t.resumeMinCount = 1, t.resumeMaxCount = 1, t.resumeFilter = {
|
|
@@ -468,7 +497,7 @@ function vs(e) {
|
|
|
468
497
|
pageSize: 20
|
|
469
498
|
}, t.defaultValue = []), e === "case_multiselect" && (t.caseEnableRefresh = !0, t.caseMinCount = 1, t.caseMaxCount = 1, t.caseFilter = { flowUniqueIds: [], pageSize: 20 }, t.defaultValue = []), t;
|
|
470
499
|
}
|
|
471
|
-
function
|
|
500
|
+
function Kr(e) {
|
|
472
501
|
const t = typeof e.pageSize == "number" ? e.pageSize : Number(e.pageSize), n = typeof e.agentKind == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, r = typeof e.agentUniqueId == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, o = typeof e.flowType == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, i = typeof e.category == "string" && e.category.trim() ? e.category.trim() : void 0, s = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
473
502
|
return {
|
|
474
503
|
agentKind: n,
|
|
@@ -479,14 +508,14 @@ function Or(e) {
|
|
|
479
508
|
pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
|
|
480
509
|
};
|
|
481
510
|
}
|
|
482
|
-
function
|
|
511
|
+
function Kt(e) {
|
|
483
512
|
if (e == null) return;
|
|
484
513
|
const t = typeof e == "number" ? e : Number(e);
|
|
485
514
|
if (!(!Number.isFinite(t) || t < 1))
|
|
486
515
|
return Math.floor(t);
|
|
487
516
|
}
|
|
488
|
-
function
|
|
489
|
-
var s, a, l,
|
|
517
|
+
function Wr(e, t) {
|
|
518
|
+
var s, a, l, u, m, d;
|
|
490
519
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
491
520
|
return i({
|
|
492
521
|
id: n,
|
|
@@ -499,7 +528,7 @@ function qr(e, t) {
|
|
|
499
528
|
agentKind: (s = e.caseFilter) == null ? void 0 : s.agentKind,
|
|
500
529
|
agentUniqueId: (a = e.caseFilter) == null ? void 0 : a.agentUniqueId,
|
|
501
530
|
flowType: (l = e.caseFilter) == null ? void 0 : l.flowType,
|
|
502
|
-
category: (
|
|
531
|
+
category: (u = e.caseFilter) == null ? void 0 : u.category,
|
|
503
532
|
flowUniqueIds: ((m = e.caseFilter) == null ? void 0 : m.flowUniqueIds) ?? [],
|
|
504
533
|
pageSize: ((d = e.caseFilter) == null ? void 0 : d.pageSize) ?? 20
|
|
505
534
|
},
|
|
@@ -508,7 +537,7 @@ function qr(e, t) {
|
|
|
508
537
|
value: { path: o }
|
|
509
538
|
});
|
|
510
539
|
}
|
|
511
|
-
function
|
|
540
|
+
function Gr(e, t, n) {
|
|
512
541
|
const r = n.nameFromValue(e.value), o = {
|
|
513
542
|
...t("case_multiselect"),
|
|
514
543
|
name: r,
|
|
@@ -516,23 +545,23 @@ function Br(e, t, n) {
|
|
|
516
545
|
}, i = n.asLiteral(e.placeholder);
|
|
517
546
|
i && (o.placeholder = i);
|
|
518
547
|
const s = n.asLiteral(e.help);
|
|
519
|
-
s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter =
|
|
520
|
-
const a =
|
|
548
|
+
s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = Kr(e.caseFilter));
|
|
549
|
+
const a = Kt(e.minCount);
|
|
521
550
|
a !== void 0 && (o.caseMinCount = a);
|
|
522
|
-
const l =
|
|
551
|
+
const l = Kt(e.maxCount);
|
|
523
552
|
return l !== void 0 && (o.caseMaxCount = l), o;
|
|
524
553
|
}
|
|
525
|
-
const
|
|
554
|
+
const dn = Ae(
|
|
526
555
|
null
|
|
527
556
|
);
|
|
528
|
-
function
|
|
557
|
+
function Jr(e) {
|
|
529
558
|
try {
|
|
530
559
|
return JSON.stringify(e);
|
|
531
560
|
} catch {
|
|
532
561
|
return String(e.length);
|
|
533
562
|
}
|
|
534
563
|
}
|
|
535
|
-
const
|
|
564
|
+
const Yr = {
|
|
536
565
|
publishLiveOptions: () => {
|
|
537
566
|
},
|
|
538
567
|
liveOptions: /* @__PURE__ */ new Map(),
|
|
@@ -541,23 +570,23 @@ const Lr = {
|
|
|
541
570
|
clearPendingChangeFields: () => {
|
|
542
571
|
}
|
|
543
572
|
};
|
|
544
|
-
function
|
|
545
|
-
const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] =
|
|
573
|
+
function Xr({ children: e }) {
|
|
574
|
+
const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] = E(0), [s, a] = E(() => /* @__PURE__ */ new Map()), [l, u] = E(
|
|
546
575
|
[]
|
|
547
576
|
), m = j(
|
|
548
577
|
(y, S) => {
|
|
549
578
|
const g = y.trim();
|
|
550
579
|
if (!g) return;
|
|
551
|
-
const k = S.map((
|
|
552
|
-
value: String(
|
|
553
|
-
label: String(
|
|
554
|
-
})),
|
|
555
|
-
n.current.get(g) !==
|
|
580
|
+
const k = S.map((p) => ({
|
|
581
|
+
value: String(p.value ?? ""),
|
|
582
|
+
label: String(p.label ?? p.value ?? "")
|
|
583
|
+
})), h = Jr(k);
|
|
584
|
+
n.current.get(g) !== h && (n.current.set(g, h), t.current.set(g, k), r.current.includes(g) || (r.current = [...r.current, g]), a(new Map(t.current)), u(r.current), i((p) => p + 1));
|
|
556
585
|
},
|
|
557
586
|
[]
|
|
558
587
|
), d = j(() => {
|
|
559
|
-
r.current = [],
|
|
560
|
-
}, []),
|
|
588
|
+
r.current = [], u([]);
|
|
589
|
+
}, []), v = V(
|
|
561
590
|
() => ({
|
|
562
591
|
publishLiveOptions: m,
|
|
563
592
|
liveOptions: s,
|
|
@@ -573,26 +602,26 @@ function jr({ children: e }) {
|
|
|
573
602
|
d
|
|
574
603
|
]
|
|
575
604
|
);
|
|
576
|
-
return /* @__PURE__ */
|
|
605
|
+
return /* @__PURE__ */ c(dn.Provider, { value: v, children: e });
|
|
577
606
|
}
|
|
578
|
-
function
|
|
579
|
-
return
|
|
607
|
+
function vt() {
|
|
608
|
+
return _e(dn) ?? Yr;
|
|
580
609
|
}
|
|
581
|
-
const
|
|
582
|
-
function
|
|
610
|
+
const pn = Ae({ interactive: !0 });
|
|
611
|
+
function ct({
|
|
583
612
|
interactive: e,
|
|
584
613
|
children: t
|
|
585
614
|
}) {
|
|
586
|
-
return /* @__PURE__ */
|
|
615
|
+
return /* @__PURE__ */ c(pn.Provider, { value: { interactive: e }, children: t });
|
|
587
616
|
}
|
|
588
617
|
function se() {
|
|
589
|
-
return
|
|
618
|
+
return _e(pn);
|
|
590
619
|
}
|
|
591
|
-
const
|
|
592
|
-
function
|
|
620
|
+
const fn = Ae(null);
|
|
621
|
+
function Qr(e) {
|
|
593
622
|
return e != null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
594
623
|
}
|
|
595
|
-
const
|
|
624
|
+
const Zr = {
|
|
596
625
|
reportEvent: () => {
|
|
597
626
|
},
|
|
598
627
|
reportData: () => {
|
|
@@ -600,7 +629,7 @@ const Dr = {
|
|
|
600
629
|
runAutoControl: (e) => e(),
|
|
601
630
|
isAutoControl: () => !1
|
|
602
631
|
};
|
|
603
|
-
function
|
|
632
|
+
function eo(e) {
|
|
604
633
|
const t = {};
|
|
605
634
|
for (const [n, r] of Object.entries(e.form_values ?? {}))
|
|
606
635
|
r !== void 0 && (t[n] = r);
|
|
@@ -610,40 +639,40 @@ function Hr(e) {
|
|
|
610
639
|
form_change: Array.isArray(e.form_change) ? [...e.form_change] : []
|
|
611
640
|
};
|
|
612
641
|
}
|
|
613
|
-
function
|
|
642
|
+
function to({
|
|
614
643
|
client: e,
|
|
615
644
|
children: t
|
|
616
645
|
}) {
|
|
617
646
|
const n = A(0), r = A(e);
|
|
618
647
|
r.current = e;
|
|
619
|
-
const o = j((
|
|
648
|
+
const o = j((u) => {
|
|
620
649
|
const m = r.current;
|
|
621
650
|
if (!m) return;
|
|
622
651
|
const d = {
|
|
623
|
-
action:
|
|
624
|
-
component:
|
|
652
|
+
action: u.action,
|
|
653
|
+
component: u.component
|
|
625
654
|
};
|
|
626
|
-
|
|
627
|
-
const
|
|
628
|
-
m.send(
|
|
629
|
-
}, []), i = j((
|
|
655
|
+
u.field !== void 0 && (d.field = u.field), u.value !== void 0 && (d.value = u.value);
|
|
656
|
+
const v = n.current > 0 ? "form_auto_control_bac_event" : "form_runtime_event";
|
|
657
|
+
m.send(v, d);
|
|
658
|
+
}, []), i = j((u) => {
|
|
630
659
|
const m = r.current;
|
|
631
|
-
m && m.send("form_runtime_data",
|
|
632
|
-
}, []), s = j((
|
|
660
|
+
m && m.send("form_runtime_data", eo(u));
|
|
661
|
+
}, []), s = j((u) => {
|
|
633
662
|
n.current += 1;
|
|
634
663
|
let m;
|
|
635
664
|
try {
|
|
636
|
-
m =
|
|
665
|
+
m = u();
|
|
637
666
|
} catch (d) {
|
|
638
667
|
throw n.current = Math.max(0, n.current - 1), d;
|
|
639
668
|
}
|
|
640
|
-
return
|
|
669
|
+
return Qr(m) ? Promise.resolve(m).finally(() => {
|
|
641
670
|
n.current = Math.max(0, n.current - 1);
|
|
642
671
|
}) : (n.current = Math.max(0, n.current - 1), m);
|
|
643
672
|
}, []), a = j(
|
|
644
673
|
() => n.current > 0,
|
|
645
674
|
[]
|
|
646
|
-
), l =
|
|
675
|
+
), l = V(
|
|
647
676
|
() => ({
|
|
648
677
|
reportEvent: o,
|
|
649
678
|
reportData: i,
|
|
@@ -652,85 +681,85 @@ function Kr({
|
|
|
652
681
|
}),
|
|
653
682
|
[o, i, s, a]
|
|
654
683
|
);
|
|
655
|
-
return /* @__PURE__ */
|
|
684
|
+
return /* @__PURE__ */ c(fn.Provider, { value: l, children: t });
|
|
656
685
|
}
|
|
657
|
-
function
|
|
658
|
-
return
|
|
686
|
+
function hn() {
|
|
687
|
+
return _e(fn) ?? Zr;
|
|
659
688
|
}
|
|
660
|
-
const
|
|
661
|
-
function
|
|
689
|
+
const no = 300;
|
|
690
|
+
function gn(e) {
|
|
662
691
|
return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
|
|
663
692
|
}
|
|
664
|
-
function
|
|
693
|
+
function ro(e) {
|
|
665
694
|
if (!e) return;
|
|
666
695
|
const t = e.trim();
|
|
667
696
|
if (t)
|
|
668
697
|
return t.startsWith("/") ? t.slice(1) : t;
|
|
669
698
|
}
|
|
670
|
-
function
|
|
699
|
+
function Wt(e, t = "value") {
|
|
671
700
|
const r = e.componentModel.properties[t];
|
|
672
|
-
if (!(!
|
|
701
|
+
if (!(!gn(r) || r === void 0))
|
|
673
702
|
return e.dataContext.resolveDynamicValue(r);
|
|
674
703
|
}
|
|
675
704
|
function ae(e, t = "value", n = {}) {
|
|
676
|
-
const o = e.componentModel.properties[t], i =
|
|
705
|
+
const o = e.componentModel.properties[t], i = gn(o), s = ro(i), a = hn(), {
|
|
677
706
|
component: l = "Unknown",
|
|
678
|
-
changeAction:
|
|
707
|
+
changeAction: u = "change",
|
|
679
708
|
debounceChange: m = !1
|
|
680
|
-
} = n, d = A(null),
|
|
709
|
+
} = n, d = A(null), v = A(void 0), y = A(!1), S = A(a);
|
|
681
710
|
S.current = a;
|
|
682
|
-
const g = A(
|
|
683
|
-
g.current =
|
|
711
|
+
const g = A(u);
|
|
712
|
+
g.current = u;
|
|
684
713
|
const k = A(l);
|
|
685
714
|
k.current = l;
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
d.current != null && (clearTimeout(d.current), d.current = null), y.current &&
|
|
715
|
+
const h = A(s);
|
|
716
|
+
h.current = s, B(() => () => {
|
|
717
|
+
d.current != null && (clearTimeout(d.current), d.current = null), y.current && h.current && (y.current = !1, S.current.reportEvent({
|
|
689
718
|
action: g.current,
|
|
690
719
|
component: k.current,
|
|
691
|
-
field:
|
|
692
|
-
value:
|
|
720
|
+
field: h.current,
|
|
721
|
+
value: v.current
|
|
693
722
|
}));
|
|
694
723
|
}, []);
|
|
695
|
-
const
|
|
696
|
-
(
|
|
724
|
+
const p = j(
|
|
725
|
+
(q) => {
|
|
697
726
|
if (!i || o === void 0) return () => {
|
|
698
727
|
};
|
|
699
|
-
const
|
|
700
|
-
return () =>
|
|
728
|
+
const L = e.dataContext.subscribeDynamicValue(o, () => q());
|
|
729
|
+
return () => L.unsubscribe();
|
|
701
730
|
},
|
|
702
731
|
[e, o, i]
|
|
703
|
-
),
|
|
732
|
+
), b = j(() => {
|
|
704
733
|
if (!(!i || o === void 0))
|
|
705
734
|
return e.dataContext.resolveDynamicValue(o);
|
|
706
|
-
}, [e, o, i]),
|
|
707
|
-
(
|
|
735
|
+
}, [e, o, i]), M = Dn(p, b, b), N = j(
|
|
736
|
+
(q) => {
|
|
708
737
|
if (!s) return;
|
|
709
|
-
const
|
|
738
|
+
const L = () => {
|
|
710
739
|
y.current = !1, S.current.reportEvent({
|
|
711
|
-
action:
|
|
740
|
+
action: u,
|
|
712
741
|
component: l,
|
|
713
742
|
field: s,
|
|
714
|
-
value:
|
|
743
|
+
value: q
|
|
715
744
|
});
|
|
716
745
|
};
|
|
717
746
|
if (!m) {
|
|
718
|
-
|
|
747
|
+
L();
|
|
719
748
|
return;
|
|
720
749
|
}
|
|
721
|
-
|
|
722
|
-
d.current = null,
|
|
723
|
-
},
|
|
750
|
+
v.current = q, y.current = !0, d.current != null && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
751
|
+
d.current = null, L();
|
|
752
|
+
}, no);
|
|
724
753
|
},
|
|
725
|
-
[s,
|
|
754
|
+
[s, u, l, m]
|
|
726
755
|
), _ = j(
|
|
727
|
-
(
|
|
728
|
-
!i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path),
|
|
756
|
+
(q) => {
|
|
757
|
+
!i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path), q);
|
|
729
758
|
},
|
|
730
759
|
[e, o, i]
|
|
731
760
|
), z = j(
|
|
732
|
-
(
|
|
733
|
-
_(
|
|
761
|
+
(q) => {
|
|
762
|
+
_(q), N(q);
|
|
734
763
|
},
|
|
735
764
|
[_, N]
|
|
736
765
|
), C = j(() => {
|
|
@@ -741,7 +770,7 @@ function ae(e, t = "value", n = {}) {
|
|
|
741
770
|
});
|
|
742
771
|
}, [s, l]);
|
|
743
772
|
return {
|
|
744
|
-
value:
|
|
773
|
+
value: M,
|
|
745
774
|
setValue: z,
|
|
746
775
|
/** 写入 dataModel 但不上报(用于模式切换规范化等内部同步) */
|
|
747
776
|
setValueSilent: _,
|
|
@@ -750,45 +779,45 @@ function ae(e, t = "value", n = {}) {
|
|
|
750
779
|
reportFocus: C
|
|
751
780
|
};
|
|
752
781
|
}
|
|
753
|
-
function
|
|
782
|
+
function ke(e) {
|
|
754
783
|
if (typeof e == "string") return e || void 0;
|
|
755
784
|
if (typeof e == "number") return String(e);
|
|
756
785
|
}
|
|
757
786
|
function Q(e) {
|
|
758
787
|
return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
|
|
759
788
|
}
|
|
760
|
-
function
|
|
789
|
+
function yn(e, t) {
|
|
761
790
|
return t ? Array.isArray(e) ? null : Q(e) : Array.isArray(e) ? e.length > 0 ? String(e[0]) : "" : e == null || typeof e == "string" || typeof e == "number" ? null : "";
|
|
762
791
|
}
|
|
763
|
-
function
|
|
792
|
+
function ze(e) {
|
|
764
793
|
if (e == null) return;
|
|
765
794
|
const t = typeof e == "number" ? e : Number(e);
|
|
766
795
|
if (!(!Number.isFinite(t) || t < 1))
|
|
767
796
|
return Math.floor(t);
|
|
768
797
|
}
|
|
769
|
-
function
|
|
798
|
+
function vn(e, t, n, r) {
|
|
770
799
|
return e.includes(t) ? e.filter((i) => i !== t) : r === 1 ? [t] : r !== void 0 && e.length >= r ? null : [...e, t];
|
|
771
800
|
}
|
|
772
|
-
function
|
|
801
|
+
function bn(e, t, n, r, o) {
|
|
773
802
|
return n ? e.includes(t) || o === 1 ? !1 : o !== void 0 && e.length >= o : !0;
|
|
774
803
|
}
|
|
775
|
-
function
|
|
804
|
+
function Sn(e, t) {
|
|
776
805
|
return t === void 0 || e.length <= t ? null : e.slice(0, t);
|
|
777
806
|
}
|
|
778
|
-
const
|
|
779
|
-
function
|
|
807
|
+
const kn = Ae(null);
|
|
808
|
+
function ut({
|
|
780
809
|
caseSearch: e,
|
|
781
810
|
children: t
|
|
782
811
|
}) {
|
|
783
|
-
return /* @__PURE__ */
|
|
812
|
+
return /* @__PURE__ */ c(kn.Provider, { value: e ?? null, children: t });
|
|
784
813
|
}
|
|
785
|
-
function
|
|
786
|
-
return
|
|
814
|
+
function oo() {
|
|
815
|
+
return _e(kn);
|
|
787
816
|
}
|
|
788
|
-
function
|
|
817
|
+
function Ze(e) {
|
|
789
818
|
return typeof e == "string" ? e : "";
|
|
790
819
|
}
|
|
791
|
-
function
|
|
820
|
+
function io(e) {
|
|
792
821
|
if (Array.isArray(e)) return e.map(String).filter(Boolean);
|
|
793
822
|
if (typeof e == "string" && e.trim())
|
|
794
823
|
try {
|
|
@@ -798,40 +827,40 @@ function Yr(e) {
|
|
|
798
827
|
}
|
|
799
828
|
return [];
|
|
800
829
|
}
|
|
801
|
-
function
|
|
830
|
+
function et(e) {
|
|
802
831
|
if (!e || typeof e != "object")
|
|
803
832
|
return { flowUniqueIds: [], pageSize: 20 };
|
|
804
|
-
const t = e, n = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), r = Number.isFinite(n) && n >= 1 && n <= 100 ? Math.floor(n) : 20, o = typeof t.agentKind == "string" && t.agentKind.trim() ? t.agentKind.trim() : void 0, i = typeof t.agentUniqueId == "string" && t.agentUniqueId.trim() ? t.agentUniqueId.trim() : void 0, s = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, a = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, l =
|
|
833
|
+
const t = e, n = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), r = Number.isFinite(n) && n >= 1 && n <= 100 ? Math.floor(n) : 20, o = typeof t.agentKind == "string" && t.agentKind.trim() ? t.agentKind.trim() : void 0, i = typeof t.agentUniqueId == "string" && t.agentUniqueId.trim() ? t.agentUniqueId.trim() : void 0, s = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, a = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, l = io(t.flowUniqueIds);
|
|
805
834
|
return { agentKind: o, agentUniqueId: i, flowType: s, category: a, flowUniqueIds: l, pageSize: r };
|
|
806
835
|
}
|
|
807
|
-
function
|
|
836
|
+
function tt(e) {
|
|
808
837
|
var r;
|
|
809
838
|
const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
|
|
810
839
|
return t || n;
|
|
811
840
|
}
|
|
812
|
-
function
|
|
841
|
+
function so(e) {
|
|
813
842
|
return JSON.stringify(e);
|
|
814
843
|
}
|
|
815
|
-
const
|
|
844
|
+
const ao = {
|
|
816
845
|
name: "SkoponCaseSelect",
|
|
817
|
-
schema:
|
|
818
|
-
label:
|
|
819
|
-
placeholder:
|
|
820
|
-
help:
|
|
821
|
-
enableRefresh:
|
|
822
|
-
caseFilter:
|
|
823
|
-
minCount:
|
|
824
|
-
maxCount:
|
|
825
|
-
value:
|
|
846
|
+
schema: f.object({
|
|
847
|
+
label: f.any().optional(),
|
|
848
|
+
placeholder: f.any().optional(),
|
|
849
|
+
help: f.any().optional(),
|
|
850
|
+
enableRefresh: f.any().optional(),
|
|
851
|
+
caseFilter: f.any().optional(),
|
|
852
|
+
minCount: f.any().optional(),
|
|
853
|
+
maxCount: f.any().optional(),
|
|
854
|
+
value: f.any().optional()
|
|
826
855
|
}).passthrough()
|
|
827
856
|
};
|
|
828
|
-
function
|
|
857
|
+
function lo({
|
|
829
858
|
item: e,
|
|
830
859
|
selected: t,
|
|
831
860
|
disabled: n,
|
|
832
861
|
onToggle: r
|
|
833
862
|
}) {
|
|
834
|
-
return /* @__PURE__ */
|
|
863
|
+
return /* @__PURE__ */ x(
|
|
835
864
|
"button",
|
|
836
865
|
{
|
|
837
866
|
type: "button",
|
|
@@ -839,11 +868,11 @@ function Zr({
|
|
|
839
868
|
disabled: n,
|
|
840
869
|
onClick: r,
|
|
841
870
|
children: [
|
|
842
|
-
/* @__PURE__ */
|
|
843
|
-
/* @__PURE__ */
|
|
844
|
-
/* @__PURE__ */
|
|
845
|
-
e.description ? /* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
871
|
+
/* @__PURE__ */ c("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ c(en, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
|
|
872
|
+
/* @__PURE__ */ x("div", { className: "skopon-resume-select-card-body", children: [
|
|
873
|
+
/* @__PURE__ */ c("div", { className: "skopon-resume-select-card-name", children: e.name }),
|
|
874
|
+
e.description ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
|
|
875
|
+
/* @__PURE__ */ x("div", { className: "skopon-resume-select-card-meta", children: [
|
|
847
876
|
e.caseUniqueId,
|
|
848
877
|
e.platform ? ` · ${e.platform}` : "",
|
|
849
878
|
e.link ? ` · ${e.link}` : ""
|
|
@@ -853,121 +882,121 @@ function Zr({
|
|
|
853
882
|
}
|
|
854
883
|
);
|
|
855
884
|
}
|
|
856
|
-
function
|
|
857
|
-
const { interactive: t } = se(), n =
|
|
885
|
+
function co({ context: e }) {
|
|
886
|
+
const { interactive: t } = se(), n = oo(), { publishLiveOptions: r } = vt(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = ae(e, "value", {
|
|
858
887
|
component: "SkoponCaseSelect",
|
|
859
888
|
changeAction: "click"
|
|
860
|
-
}), l = e.componentModel.properties,
|
|
861
|
-
|
|
862
|
-
const T =
|
|
889
|
+
}), l = e.componentModel.properties, u = Ze(l.label), m = Ze(l.placeholder), d = Ze(l.help), v = l.enableRefresh !== !1, y = ze(l.minCount), S = ze(l.maxCount), g = V(() => et(l.caseFilter), [l.caseFilter]), k = so(g), [h, p] = E(1), [b, M] = E(!1), [N, _] = E(""), [z, C] = E([]), [q, L] = E(0), [re, K] = E(g.pageSize ?? 20), $ = A(0), Y = Q(o);
|
|
890
|
+
B(() => {
|
|
891
|
+
const T = Sn(Y, S);
|
|
863
892
|
T !== null && s(T);
|
|
864
|
-
}, [S,
|
|
865
|
-
const
|
|
893
|
+
}, [S, Y, s]);
|
|
894
|
+
const te = V(() => n ? tt(g) ? N || m || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, N, m]), ne = j(
|
|
866
895
|
async (T) => {
|
|
867
|
-
const D =
|
|
868
|
-
if (!n || !
|
|
869
|
-
C([]),
|
|
896
|
+
const D = et(JSON.parse(k)), R = ++$.current;
|
|
897
|
+
if (!n || !tt(D)) {
|
|
898
|
+
C([]), L(0), _(""), M(!1);
|
|
870
899
|
return;
|
|
871
900
|
}
|
|
872
|
-
|
|
901
|
+
M(!0), _("");
|
|
873
902
|
try {
|
|
874
|
-
const
|
|
875
|
-
if (
|
|
876
|
-
C(
|
|
903
|
+
const I = await n({ filter: D, page: T });
|
|
904
|
+
if (R !== $.current) return;
|
|
905
|
+
C(I.list), L(I.total), p(I.page), K(I.pageSize), a && r(
|
|
877
906
|
a,
|
|
878
|
-
|
|
879
|
-
value:
|
|
880
|
-
label:
|
|
907
|
+
I.list.map((X) => ({
|
|
908
|
+
value: X.caseUniqueId,
|
|
909
|
+
label: X.name || X.caseUniqueId
|
|
881
910
|
}))
|
|
882
911
|
);
|
|
883
|
-
} catch (
|
|
884
|
-
if (
|
|
885
|
-
C([]),
|
|
912
|
+
} catch (I) {
|
|
913
|
+
if (R !== $.current) return;
|
|
914
|
+
C([]), L(0), _(I instanceof Error ? I.message : "加载案例列表失败");
|
|
886
915
|
} finally {
|
|
887
|
-
|
|
916
|
+
R === $.current && M(!1);
|
|
888
917
|
}
|
|
889
918
|
},
|
|
890
919
|
[n, k, a, r]
|
|
891
920
|
);
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
}, [k,
|
|
895
|
-
const
|
|
921
|
+
B(() => {
|
|
922
|
+
p(1), ne(1);
|
|
923
|
+
}, [k, ne]);
|
|
924
|
+
const U = (T) => {
|
|
896
925
|
if (!t) return;
|
|
897
|
-
const D =
|
|
898
|
-
|
|
926
|
+
const D = vn(
|
|
927
|
+
Y,
|
|
899
928
|
T,
|
|
900
929
|
y,
|
|
901
930
|
S
|
|
902
931
|
);
|
|
903
932
|
D !== null && i(D);
|
|
904
933
|
}, P = () => {
|
|
905
|
-
const T =
|
|
906
|
-
|
|
934
|
+
const T = et(JSON.parse(k)), D = re || T.pageSize || 20, R = Math.max(1, Math.ceil(q / D)), I = h >= R ? 1 : h + 1;
|
|
935
|
+
ne(I);
|
|
907
936
|
};
|
|
908
|
-
return /* @__PURE__ */
|
|
937
|
+
return /* @__PURE__ */ x(
|
|
909
938
|
"div",
|
|
910
939
|
{
|
|
911
940
|
className: "form-block-preview skopon-resume-select",
|
|
912
941
|
"data-skopon-field": a || void 0,
|
|
913
942
|
children: [
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
/* @__PURE__ */
|
|
943
|
+
u ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: u }) : null,
|
|
944
|
+
b && z.length === 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-status", children: [
|
|
945
|
+
/* @__PURE__ */ c(ht, { size: "small" }),
|
|
917
946
|
" 加载案例…"
|
|
918
947
|
] }) : null,
|
|
919
|
-
!
|
|
920
|
-
z.length > 0 ? /* @__PURE__ */
|
|
921
|
-
|
|
948
|
+
!b && z.length === 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-empty", children: te }) : null,
|
|
949
|
+
z.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-list", children: z.map((T) => /* @__PURE__ */ c(
|
|
950
|
+
lo,
|
|
922
951
|
{
|
|
923
952
|
item: T,
|
|
924
|
-
selected:
|
|
925
|
-
disabled:
|
|
926
|
-
|
|
953
|
+
selected: Y.includes(T.caseUniqueId),
|
|
954
|
+
disabled: bn(
|
|
955
|
+
Y,
|
|
927
956
|
T.caseUniqueId,
|
|
928
957
|
t,
|
|
929
958
|
y,
|
|
930
959
|
S
|
|
931
960
|
),
|
|
932
|
-
onToggle: () =>
|
|
961
|
+
onToggle: () => U(T.caseUniqueId)
|
|
933
962
|
},
|
|
934
963
|
T.caseUniqueId
|
|
935
964
|
)) }) : null,
|
|
936
|
-
|
|
937
|
-
|
|
965
|
+
v && n && tt(g) ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ c(
|
|
966
|
+
Te,
|
|
938
967
|
{
|
|
939
968
|
type: "default",
|
|
940
969
|
size: "small",
|
|
941
|
-
icon: /* @__PURE__ */
|
|
942
|
-
loading:
|
|
970
|
+
icon: /* @__PURE__ */ c(Zt, {}),
|
|
971
|
+
loading: b,
|
|
943
972
|
disabled: !t,
|
|
944
973
|
onClick: P,
|
|
945
974
|
children: "换一批"
|
|
946
975
|
}
|
|
947
976
|
) }) : null,
|
|
948
|
-
d ? /* @__PURE__ */
|
|
977
|
+
d ? /* @__PURE__ */ c(ee.Text, { type: "secondary", className: "form-block-preview-help", children: d }) : null
|
|
949
978
|
]
|
|
950
979
|
}
|
|
951
980
|
);
|
|
952
981
|
}
|
|
953
|
-
const
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
),
|
|
982
|
+
const uo = J(
|
|
983
|
+
ao,
|
|
984
|
+
co
|
|
985
|
+
), mo = {
|
|
957
986
|
type: "case_multiselect",
|
|
958
987
|
componentName: "SkoponCaseSelect",
|
|
959
|
-
toComponent:
|
|
960
|
-
fromComponent:
|
|
961
|
-
catalogComponents: [
|
|
988
|
+
toComponent: Wr,
|
|
989
|
+
fromComponent: Gr,
|
|
990
|
+
catalogComponents: [uo]
|
|
962
991
|
};
|
|
963
|
-
function
|
|
992
|
+
function Gt(e) {
|
|
964
993
|
if (e == null) return;
|
|
965
994
|
const t = typeof e == "number" ? e : Number(e);
|
|
966
995
|
if (!(!Number.isFinite(t) || t < 1))
|
|
967
996
|
return Math.floor(t);
|
|
968
997
|
}
|
|
969
|
-
function
|
|
970
|
-
var s, a, l,
|
|
998
|
+
function po(e, t) {
|
|
999
|
+
var s, a, l, u;
|
|
971
1000
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
972
1001
|
return i({
|
|
973
1002
|
id: n,
|
|
@@ -980,14 +1009,14 @@ function ro(e, t) {
|
|
|
980
1009
|
names: ((s = e.resumeFilter) == null ? void 0 : s.names) ?? [],
|
|
981
1010
|
agentUniqueIds: ((a = e.resumeFilter) == null ? void 0 : a.agentUniqueIds) ?? [],
|
|
982
1011
|
resumeUniqueIds: ((l = e.resumeFilter) == null ? void 0 : l.resumeUniqueIds) ?? [],
|
|
983
|
-
pageSize: ((
|
|
1012
|
+
pageSize: ((u = e.resumeFilter) == null ? void 0 : u.pageSize) ?? 20
|
|
984
1013
|
},
|
|
985
1014
|
...e.resumeMinCount !== void 0 ? { minCount: e.resumeMinCount } : {},
|
|
986
1015
|
...e.resumeMaxCount !== void 0 ? { maxCount: e.resumeMaxCount } : {},
|
|
987
1016
|
value: { path: o }
|
|
988
1017
|
});
|
|
989
1018
|
}
|
|
990
|
-
function
|
|
1019
|
+
function fo(e, t, n) {
|
|
991
1020
|
const r = n.nameFromValue(e.value), o = {
|
|
992
1021
|
...t("resume_multiselect"),
|
|
993
1022
|
name: r,
|
|
@@ -996,87 +1025,87 @@ function oo(e, t, n) {
|
|
|
996
1025
|
i && (o.placeholder = i);
|
|
997
1026
|
const s = n.asLiteral(e.help);
|
|
998
1027
|
if (s && (o.help = s), e.resumeFilter && typeof e.resumeFilter == "object") {
|
|
999
|
-
const
|
|
1028
|
+
const u = e.resumeFilter;
|
|
1000
1029
|
o.resumeFilter = {
|
|
1001
|
-
names: Array.isArray(
|
|
1002
|
-
agentUniqueIds: Array.isArray(
|
|
1003
|
-
resumeUniqueIds: Array.isArray(
|
|
1004
|
-
pageSize: typeof
|
|
1030
|
+
names: Array.isArray(u.names) ? u.names.map(String) : [],
|
|
1031
|
+
agentUniqueIds: Array.isArray(u.agentUniqueIds) ? u.agentUniqueIds.map(String) : [],
|
|
1032
|
+
resumeUniqueIds: Array.isArray(u.resumeUniqueIds) ? u.resumeUniqueIds.map(String) : [],
|
|
1033
|
+
pageSize: typeof u.pageSize == "number" ? u.pageSize : 20
|
|
1005
1034
|
};
|
|
1006
1035
|
}
|
|
1007
|
-
const a =
|
|
1036
|
+
const a = Gt(e.minCount);
|
|
1008
1037
|
a !== void 0 && (o.resumeMinCount = a);
|
|
1009
|
-
const l =
|
|
1038
|
+
const l = Gt(e.maxCount);
|
|
1010
1039
|
return l !== void 0 && (o.resumeMaxCount = l), o;
|
|
1011
1040
|
}
|
|
1012
|
-
const
|
|
1013
|
-
function
|
|
1041
|
+
const Cn = Ae(null);
|
|
1042
|
+
function mt({
|
|
1014
1043
|
resumeSearch: e,
|
|
1015
1044
|
children: t
|
|
1016
1045
|
}) {
|
|
1017
|
-
return /* @__PURE__ */
|
|
1046
|
+
return /* @__PURE__ */ c(Cn.Provider, { value: e ?? null, children: t });
|
|
1018
1047
|
}
|
|
1019
|
-
function
|
|
1020
|
-
return
|
|
1048
|
+
function ho() {
|
|
1049
|
+
return _e(Cn);
|
|
1021
1050
|
}
|
|
1022
|
-
function
|
|
1051
|
+
function nt(e) {
|
|
1023
1052
|
return typeof e == "string" ? e : "";
|
|
1024
1053
|
}
|
|
1025
|
-
function
|
|
1054
|
+
function rt(e) {
|
|
1026
1055
|
if (!e || typeof e != "object")
|
|
1027
1056
|
return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
|
|
1028
1057
|
const t = e, n = Array.isArray(t.names) ? t.names.map(String).filter(Boolean) : [], r = Array.isArray(t.agentUniqueIds) ? t.agentUniqueIds.map(String).filter(Boolean) : [], o = Array.isArray(t.resumeUniqueIds) ? t.resumeUniqueIds.map(String).filter(Boolean) : [], i = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), s = Number.isFinite(i) && i >= 1 && i <= 100 ? Math.floor(i) : 20;
|
|
1029
1058
|
return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: s };
|
|
1030
1059
|
}
|
|
1031
|
-
function
|
|
1060
|
+
function go(e) {
|
|
1032
1061
|
return JSON.stringify(e);
|
|
1033
1062
|
}
|
|
1034
|
-
const
|
|
1063
|
+
const yo = {
|
|
1035
1064
|
name: "SkoponResumeSelect",
|
|
1036
|
-
schema:
|
|
1037
|
-
label:
|
|
1038
|
-
placeholder:
|
|
1039
|
-
help:
|
|
1040
|
-
enableRefresh:
|
|
1041
|
-
resumeFilter:
|
|
1042
|
-
minCount:
|
|
1043
|
-
maxCount:
|
|
1044
|
-
value:
|
|
1065
|
+
schema: f.object({
|
|
1066
|
+
label: f.any().optional(),
|
|
1067
|
+
placeholder: f.any().optional(),
|
|
1068
|
+
help: f.any().optional(),
|
|
1069
|
+
enableRefresh: f.any().optional(),
|
|
1070
|
+
resumeFilter: f.any().optional(),
|
|
1071
|
+
minCount: f.any().optional(),
|
|
1072
|
+
maxCount: f.any().optional(),
|
|
1073
|
+
value: f.any().optional()
|
|
1045
1074
|
}).passthrough()
|
|
1046
|
-
},
|
|
1047
|
-
function
|
|
1048
|
-
const n = (t ?? []).filter(Boolean), r = n.slice(0,
|
|
1049
|
-
return /* @__PURE__ */
|
|
1050
|
-
/* @__PURE__ */
|
|
1051
|
-
n.length > 0 ? /* @__PURE__ */
|
|
1052
|
-
r.map((i) => /* @__PURE__ */
|
|
1053
|
-
o > 0 ? /* @__PURE__ */
|
|
1075
|
+
}, vo = 3, bo = 2;
|
|
1076
|
+
function ot(e, t) {
|
|
1077
|
+
const n = (t ?? []).filter(Boolean), r = n.slice(0, vo), o = n.length - r.length;
|
|
1078
|
+
return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-tags", children: [
|
|
1079
|
+
/* @__PURE__ */ c("span", { className: "skopon-resume-select-card-tags-label", children: e }),
|
|
1080
|
+
n.length > 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-tags-list", children: [
|
|
1081
|
+
r.map((i) => /* @__PURE__ */ c(ye, { className: "skopon-resume-select-card-tag", children: i }, i)),
|
|
1082
|
+
o > 0 ? /* @__PURE__ */ x(ye, { className: "skopon-resume-select-card-tag", children: [
|
|
1054
1083
|
"+",
|
|
1055
1084
|
o
|
|
1056
1085
|
] }) : null
|
|
1057
|
-
] }) : /* @__PURE__ */
|
|
1086
|
+
] }) : /* @__PURE__ */ c("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
|
|
1058
1087
|
] });
|
|
1059
1088
|
}
|
|
1060
|
-
function
|
|
1061
|
-
return /* @__PURE__ */
|
|
1062
|
-
/* @__PURE__ */
|
|
1063
|
-
/* @__PURE__ */
|
|
1089
|
+
function So(e) {
|
|
1090
|
+
return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-field", children: [
|
|
1091
|
+
/* @__PURE__ */ c("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
|
|
1092
|
+
/* @__PURE__ */ c("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
|
|
1064
1093
|
] });
|
|
1065
1094
|
}
|
|
1066
|
-
function
|
|
1067
|
-
return /* @__PURE__ */
|
|
1068
|
-
/* @__PURE__ */
|
|
1069
|
-
/* @__PURE__ */
|
|
1095
|
+
function ko({ work: e }) {
|
|
1096
|
+
return /* @__PURE__ */ x("div", { className: "skopon-resume-select-card-work", children: [
|
|
1097
|
+
/* @__PURE__ */ c("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ c("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ c(rr, { className: "skopon-resume-select-card-work-placeholder" }) }),
|
|
1098
|
+
/* @__PURE__ */ c("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
|
|
1070
1099
|
] });
|
|
1071
1100
|
}
|
|
1072
|
-
function
|
|
1101
|
+
function Co({
|
|
1073
1102
|
item: e,
|
|
1074
1103
|
selected: t,
|
|
1075
1104
|
disabled: n,
|
|
1076
1105
|
onToggle: r
|
|
1077
1106
|
}) {
|
|
1078
|
-
const o = (e.works ?? []).slice(0,
|
|
1079
|
-
return /* @__PURE__ */
|
|
1107
|
+
const o = (e.works ?? []).slice(0, bo);
|
|
1108
|
+
return /* @__PURE__ */ x(
|
|
1080
1109
|
"button",
|
|
1081
1110
|
{
|
|
1082
1111
|
type: "button",
|
|
@@ -1084,185 +1113,331 @@ function fo({
|
|
|
1084
1113
|
disabled: n,
|
|
1085
1114
|
onClick: r,
|
|
1086
1115
|
children: [
|
|
1087
|
-
/* @__PURE__ */
|
|
1088
|
-
|
|
1116
|
+
/* @__PURE__ */ c(
|
|
1117
|
+
Wn,
|
|
1089
1118
|
{
|
|
1090
1119
|
size: 48,
|
|
1091
1120
|
src: e.avatarUrl || void 0,
|
|
1092
|
-
icon: e.avatarUrl ? void 0 : /* @__PURE__ */
|
|
1121
|
+
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ c(nr, {}),
|
|
1093
1122
|
className: "skopon-resume-select-card-avatar"
|
|
1094
1123
|
}
|
|
1095
1124
|
),
|
|
1096
|
-
/* @__PURE__ */
|
|
1097
|
-
/* @__PURE__ */
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
/* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
o.length > 0 ? /* @__PURE__ */
|
|
1125
|
+
/* @__PURE__ */ c("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
|
|
1126
|
+
/* @__PURE__ */ x("div", { className: "skopon-resume-select-card-body", children: [
|
|
1127
|
+
So(e.satisfaction),
|
|
1128
|
+
ot("性格", e.personality),
|
|
1129
|
+
ot("专长", e.specialties),
|
|
1130
|
+
ot("擅长领域", e.traits),
|
|
1131
|
+
/* @__PURE__ */ x("div", { className: "skopon-resume-select-card-works", children: [
|
|
1132
|
+
/* @__PURE__ */ c("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
|
|
1133
|
+
o.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, s) => /* @__PURE__ */ c(ko, { work: i }, `${i.title}-${s}`)) }) : /* @__PURE__ */ c("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
|
|
1105
1134
|
] })
|
|
1106
1135
|
] })
|
|
1107
1136
|
]
|
|
1108
1137
|
}
|
|
1109
1138
|
);
|
|
1110
1139
|
}
|
|
1111
|
-
function
|
|
1112
|
-
const { interactive: t } = se(), n =
|
|
1140
|
+
function Ao({ context: e }) {
|
|
1141
|
+
const { interactive: t } = se(), n = ho(), { publishLiveOptions: r } = vt(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = ae(e, "value", {
|
|
1113
1142
|
component: "SkoponResumeSelect",
|
|
1114
1143
|
changeAction: "click"
|
|
1115
|
-
}), l = e.componentModel.properties,
|
|
1116
|
-
|
|
1117
|
-
const T =
|
|
1144
|
+
}), l = e.componentModel.properties, u = nt(l.label), m = nt(l.placeholder), d = nt(l.help), v = l.enableRefresh !== !1, y = ze(l.minCount), S = ze(l.maxCount), g = V(() => rt(l.resumeFilter), [l.resumeFilter]), k = go(g), [h, p] = E(1), [b, M] = E(!1), [N, _] = E(""), [z, C] = E([]), [q, L] = E(0), [re, K] = E(g.pageSize ?? 20), $ = A(0), Y = Q(o);
|
|
1145
|
+
B(() => {
|
|
1146
|
+
const T = Sn(Y, S);
|
|
1118
1147
|
T !== null && s(T);
|
|
1119
|
-
}, [S,
|
|
1120
|
-
const
|
|
1148
|
+
}, [S, Y, s]);
|
|
1149
|
+
const te = j(
|
|
1121
1150
|
async (T) => {
|
|
1122
|
-
const D =
|
|
1151
|
+
const D = rt(JSON.parse(k)), R = ++$.current;
|
|
1123
1152
|
if (!n) {
|
|
1124
|
-
C([]),
|
|
1153
|
+
C([]), L(0), _("未配置简历搜索服务"), M(!1);
|
|
1125
1154
|
return;
|
|
1126
1155
|
}
|
|
1127
|
-
|
|
1156
|
+
M(!0), _("");
|
|
1128
1157
|
try {
|
|
1129
|
-
const
|
|
1130
|
-
if (
|
|
1131
|
-
C(
|
|
1158
|
+
const I = await n({ filter: D, page: T });
|
|
1159
|
+
if (R !== $.current) return;
|
|
1160
|
+
C(I.list), L(I.total), p(I.page), K(I.pageSize), a && r(
|
|
1132
1161
|
a,
|
|
1133
|
-
|
|
1134
|
-
value:
|
|
1135
|
-
label:
|
|
1162
|
+
I.list.map((X) => ({
|
|
1163
|
+
value: X.resumeUniqueId,
|
|
1164
|
+
label: X.name || X.resumeUniqueId
|
|
1136
1165
|
}))
|
|
1137
1166
|
);
|
|
1138
|
-
} catch (
|
|
1139
|
-
if (
|
|
1140
|
-
C([]),
|
|
1167
|
+
} catch (I) {
|
|
1168
|
+
if (R !== $.current) return;
|
|
1169
|
+
C([]), L(0), _(I instanceof Error ? I.message : "加载简历列表失败");
|
|
1141
1170
|
} finally {
|
|
1142
|
-
|
|
1171
|
+
R === $.current && M(!1);
|
|
1143
1172
|
}
|
|
1144
1173
|
},
|
|
1145
1174
|
[n, k, a, r]
|
|
1146
1175
|
);
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
}, [k,
|
|
1150
|
-
const
|
|
1176
|
+
B(() => {
|
|
1177
|
+
p(1), te(1);
|
|
1178
|
+
}, [k, te]);
|
|
1179
|
+
const ne = (T) => {
|
|
1151
1180
|
if (!t) return;
|
|
1152
|
-
const D =
|
|
1153
|
-
|
|
1181
|
+
const D = vn(
|
|
1182
|
+
Y,
|
|
1154
1183
|
T,
|
|
1155
1184
|
y,
|
|
1156
1185
|
S
|
|
1157
1186
|
);
|
|
1158
1187
|
D !== null && i(D);
|
|
1159
|
-
},
|
|
1160
|
-
const T =
|
|
1161
|
-
|
|
1188
|
+
}, U = () => {
|
|
1189
|
+
const T = rt(JSON.parse(k)), D = re || T.pageSize || 20, R = Math.max(1, Math.ceil(q / D)), I = h >= R ? 1 : h + 1;
|
|
1190
|
+
te(I);
|
|
1162
1191
|
}, P = m || "暂无匹配的简历";
|
|
1163
|
-
return /* @__PURE__ */
|
|
1192
|
+
return /* @__PURE__ */ x(
|
|
1164
1193
|
"div",
|
|
1165
1194
|
{
|
|
1166
1195
|
className: "form-block-preview skopon-resume-select",
|
|
1167
1196
|
"data-skopon-field": a || void 0,
|
|
1168
1197
|
children: [
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
/* @__PURE__ */
|
|
1198
|
+
u ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: u }) : null,
|
|
1199
|
+
b && z.length === 0 ? /* @__PURE__ */ x("div", { className: "skopon-resume-select-status", children: [
|
|
1200
|
+
/* @__PURE__ */ c(ht, { size: "small" }),
|
|
1172
1201
|
" 加载简历…"
|
|
1173
1202
|
] }) : null,
|
|
1174
|
-
!
|
|
1175
|
-
!
|
|
1176
|
-
z.length > 0 ? /* @__PURE__ */
|
|
1177
|
-
|
|
1203
|
+
!b && N ? /* @__PURE__ */ c(ee.Text, { type: "danger", className: "skopon-resume-select-status", children: N }) : null,
|
|
1204
|
+
!b && !N && z.length === 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-empty", children: P }) : null,
|
|
1205
|
+
z.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-list", children: z.map((T) => /* @__PURE__ */ c(
|
|
1206
|
+
Co,
|
|
1178
1207
|
{
|
|
1179
1208
|
item: T,
|
|
1180
|
-
selected:
|
|
1181
|
-
disabled:
|
|
1182
|
-
|
|
1209
|
+
selected: Y.includes(T.resumeUniqueId),
|
|
1210
|
+
disabled: bn(
|
|
1211
|
+
Y,
|
|
1183
1212
|
T.resumeUniqueId,
|
|
1184
1213
|
t,
|
|
1185
1214
|
y,
|
|
1186
1215
|
S
|
|
1187
1216
|
),
|
|
1188
|
-
onToggle: () =>
|
|
1217
|
+
onToggle: () => ne(T.resumeUniqueId)
|
|
1189
1218
|
},
|
|
1190
1219
|
T.resumeUniqueId
|
|
1191
1220
|
)) }) : null,
|
|
1192
|
-
|
|
1193
|
-
|
|
1221
|
+
v && n ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ c(
|
|
1222
|
+
Te,
|
|
1194
1223
|
{
|
|
1195
1224
|
type: "default",
|
|
1196
1225
|
size: "small",
|
|
1197
|
-
icon: /* @__PURE__ */
|
|
1198
|
-
loading:
|
|
1226
|
+
icon: /* @__PURE__ */ c(Zt, {}),
|
|
1227
|
+
loading: b,
|
|
1199
1228
|
disabled: !t,
|
|
1200
|
-
onClick:
|
|
1229
|
+
onClick: U,
|
|
1201
1230
|
children: "换一批"
|
|
1202
1231
|
}
|
|
1203
1232
|
) }) : null,
|
|
1204
|
-
d ? /* @__PURE__ */
|
|
1233
|
+
d ? /* @__PURE__ */ c(ee.Text, { type: "secondary", className: "form-block-preview-help", children: d }) : null
|
|
1205
1234
|
]
|
|
1206
1235
|
}
|
|
1207
1236
|
);
|
|
1208
1237
|
}
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
),
|
|
1238
|
+
const _o = J(
|
|
1239
|
+
yo,
|
|
1240
|
+
Ao
|
|
1241
|
+
), To = {
|
|
1213
1242
|
type: "resume_multiselect",
|
|
1214
1243
|
componentName: "SkoponResumeSelect",
|
|
1215
|
-
toComponent:
|
|
1216
|
-
fromComponent:
|
|
1217
|
-
catalogComponents: [
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1244
|
+
toComponent: po,
|
|
1245
|
+
fromComponent: fo,
|
|
1246
|
+
catalogComponents: [_o]
|
|
1247
|
+
};
|
|
1248
|
+
function xo(e, t) {
|
|
1249
|
+
var n;
|
|
1250
|
+
return {
|
|
1251
|
+
node: {
|
|
1252
|
+
id: t.id,
|
|
1253
|
+
component: "SkoponWeb",
|
|
1254
|
+
url: ((n = e.webUrl) == null ? void 0 : n.trim()) ?? "",
|
|
1255
|
+
height: xe(e.webHeight),
|
|
1256
|
+
label: t.label,
|
|
1257
|
+
help: e.help ?? ""
|
|
1258
|
+
}
|
|
1259
|
+
};
|
|
1260
|
+
}
|
|
1261
|
+
function Mo(e, t, n) {
|
|
1262
|
+
var o, i;
|
|
1263
|
+
const r = (o = n.asLiteral(e.help)) == null ? void 0 : o.trim();
|
|
1264
|
+
return {
|
|
1265
|
+
...t("web"),
|
|
1266
|
+
webUrl: ((i = n.asLiteral(e.url)) == null ? void 0 : i.trim()) ?? "",
|
|
1267
|
+
webHeight: xe(e.height),
|
|
1268
|
+
...r ? { help: r } : {}
|
|
1269
|
+
};
|
|
1270
|
+
}
|
|
1271
|
+
function Jt({
|
|
1272
|
+
url: e,
|
|
1273
|
+
title: t,
|
|
1274
|
+
className: n,
|
|
1275
|
+
height: r,
|
|
1276
|
+
frameRef: o
|
|
1277
|
+
}) {
|
|
1278
|
+
return /* @__PURE__ */ c(
|
|
1279
|
+
"iframe",
|
|
1280
|
+
{
|
|
1281
|
+
ref: o,
|
|
1282
|
+
src: e,
|
|
1283
|
+
title: t,
|
|
1284
|
+
className: n,
|
|
1285
|
+
style: r === void 0 ? void 0 : { height: r },
|
|
1286
|
+
loading: "lazy",
|
|
1287
|
+
referrerPolicy: "strict-origin-when-cross-origin",
|
|
1288
|
+
allowFullScreen: !0
|
|
1289
|
+
}
|
|
1290
|
+
);
|
|
1291
|
+
}
|
|
1292
|
+
function No({
|
|
1293
|
+
url: e = "",
|
|
1294
|
+
height: t,
|
|
1295
|
+
label: n,
|
|
1296
|
+
help: r
|
|
1297
|
+
}) {
|
|
1298
|
+
const [o, i] = E(!1), [s, a] = E(!0), l = A(null), u = e.trim(), m = fr(u) ? u : null, d = xe(t), v = (n == null ? void 0 : n.trim()) || "网页展示", y = r == null ? void 0 : r.trim(), S = u ? "网页 URL 无效" : "未设置网页 URL";
|
|
1299
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview skopon-web-preview", children: [
|
|
1300
|
+
n != null && n.trim() ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: n.trim() }) : null,
|
|
1301
|
+
/* @__PURE__ */ x(
|
|
1302
|
+
"div",
|
|
1303
|
+
{
|
|
1304
|
+
className: `skopon-web-frame-shell${m ? "" : " skopon-web-frame-shell--empty"}`,
|
|
1305
|
+
style: { height: d },
|
|
1306
|
+
children: [
|
|
1307
|
+
m && s ? /* @__PURE__ */ c(
|
|
1308
|
+
Jt,
|
|
1309
|
+
{
|
|
1310
|
+
url: m,
|
|
1311
|
+
title: v,
|
|
1312
|
+
className: "skopon-web-frame skopon-web-frame--inline",
|
|
1313
|
+
height: d
|
|
1314
|
+
}
|
|
1315
|
+
) : null,
|
|
1316
|
+
m ? null : /* @__PURE__ */ c("div", { className: "skopon-web-empty", role: "status", children: S }),
|
|
1317
|
+
m ? /* @__PURE__ */ c(fe, { title: "扩展显示", children: /* @__PURE__ */ c(
|
|
1318
|
+
Te,
|
|
1319
|
+
{
|
|
1320
|
+
type: "default",
|
|
1321
|
+
shape: "circle",
|
|
1322
|
+
className: "skopon-web-expand-button",
|
|
1323
|
+
icon: /* @__PURE__ */ c(or, {}),
|
|
1324
|
+
"aria-label": "扩展显示",
|
|
1325
|
+
onClick: () => {
|
|
1326
|
+
a(!1), i(!0);
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
) }) : null
|
|
1330
|
+
]
|
|
1331
|
+
}
|
|
1332
|
+
),
|
|
1333
|
+
y ? /* @__PURE__ */ c(ee.Text, { type: "secondary", className: "form-block-preview-help", children: y }) : null,
|
|
1334
|
+
/* @__PURE__ */ c(
|
|
1335
|
+
Gn,
|
|
1336
|
+
{
|
|
1337
|
+
open: o,
|
|
1338
|
+
title: v,
|
|
1339
|
+
footer: null,
|
|
1340
|
+
width: "min(1200px, calc(100vw - 32px))",
|
|
1341
|
+
className: "skopon-web-modal",
|
|
1342
|
+
destroyOnHidden: !0,
|
|
1343
|
+
mask: { closable: !0 },
|
|
1344
|
+
onCancel: () => {
|
|
1345
|
+
var g;
|
|
1346
|
+
(g = l.current) == null || g.removeAttribute("src"), i(!1), a(!0);
|
|
1347
|
+
},
|
|
1348
|
+
children: m && !s ? /* @__PURE__ */ c(
|
|
1349
|
+
Jt,
|
|
1350
|
+
{
|
|
1351
|
+
url: m,
|
|
1352
|
+
title: `${v}(扩展显示)`,
|
|
1353
|
+
className: "skopon-web-frame skopon-web-frame--modal",
|
|
1354
|
+
frameRef: l
|
|
1355
|
+
}
|
|
1356
|
+
) : null
|
|
1357
|
+
}
|
|
1358
|
+
)
|
|
1359
|
+
] });
|
|
1360
|
+
}
|
|
1361
|
+
const Fo = {
|
|
1362
|
+
name: "SkoponWeb",
|
|
1363
|
+
schema: f.object({
|
|
1364
|
+
url: f.any().optional(),
|
|
1365
|
+
height: f.any().optional(),
|
|
1366
|
+
label: f.any().optional(),
|
|
1367
|
+
help: f.any().optional()
|
|
1368
|
+
}).passthrough()
|
|
1369
|
+
}, Io = J(
|
|
1370
|
+
Fo,
|
|
1371
|
+
({ context: e }) => {
|
|
1372
|
+
const t = e.componentModel.properties;
|
|
1373
|
+
return /* @__PURE__ */ c(
|
|
1374
|
+
No,
|
|
1375
|
+
{
|
|
1376
|
+
url: typeof t.url == "string" ? t.url : "",
|
|
1377
|
+
height: xe(t.height),
|
|
1378
|
+
label: typeof t.label == "string" ? t.label : "",
|
|
1379
|
+
help: typeof t.help == "string" ? t.help : ""
|
|
1380
|
+
}
|
|
1381
|
+
);
|
|
1382
|
+
}
|
|
1383
|
+
), Eo = {
|
|
1384
|
+
type: "web",
|
|
1385
|
+
componentName: "SkoponWeb",
|
|
1386
|
+
toComponent: xo,
|
|
1387
|
+
fromComponent: Mo,
|
|
1388
|
+
catalogComponents: [Io]
|
|
1389
|
+
}, Le = [
|
|
1390
|
+
To,
|
|
1391
|
+
mo,
|
|
1392
|
+
Eo
|
|
1393
|
+
], Uo = new Map(
|
|
1394
|
+
Le.map((e) => [e.type, e])
|
|
1395
|
+
), Ro = new Map(
|
|
1396
|
+
Le.map((e) => [e.componentName, e])
|
|
1222
1397
|
);
|
|
1223
|
-
function
|
|
1224
|
-
return
|
|
1398
|
+
function wo(e) {
|
|
1399
|
+
return Uo.get(e);
|
|
1225
1400
|
}
|
|
1226
|
-
function
|
|
1227
|
-
return
|
|
1401
|
+
function Po(e) {
|
|
1402
|
+
return Ro.get(e);
|
|
1228
1403
|
}
|
|
1229
|
-
function
|
|
1230
|
-
return
|
|
1404
|
+
function zo() {
|
|
1405
|
+
return Le.flatMap((e) => e.catalogComponents);
|
|
1231
1406
|
}
|
|
1232
|
-
function
|
|
1233
|
-
return
|
|
1407
|
+
function Oo() {
|
|
1408
|
+
return Le.map((e) => e.componentName);
|
|
1234
1409
|
}
|
|
1235
|
-
const
|
|
1236
|
-
function
|
|
1410
|
+
const Oe = "root", dt = "__title__", pt = "__desc__", bt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
|
|
1411
|
+
function Bo(e) {
|
|
1237
1412
|
return `/${e}`;
|
|
1238
1413
|
}
|
|
1239
|
-
function
|
|
1414
|
+
function Yt(e) {
|
|
1240
1415
|
return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
|
|
1241
1416
|
}
|
|
1242
1417
|
function H(e) {
|
|
1243
1418
|
if (typeof e == "string") return e;
|
|
1244
1419
|
}
|
|
1245
|
-
function
|
|
1420
|
+
function qo(e) {
|
|
1246
1421
|
const t = e.id || le("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
|
|
1247
1422
|
return {
|
|
1248
1423
|
id: t,
|
|
1249
1424
|
component: "SkoponMedia",
|
|
1250
1425
|
mediaType: n,
|
|
1251
|
-
urls:
|
|
1252
|
-
mediaSize:
|
|
1426
|
+
urls: Rr(e),
|
|
1427
|
+
mediaSize: Ne(e.mediaSize),
|
|
1253
1428
|
label: e.label ?? "",
|
|
1254
1429
|
help: e.help ?? "",
|
|
1255
1430
|
placeholder: e.placeholder ?? ""
|
|
1256
1431
|
};
|
|
1257
1432
|
}
|
|
1258
|
-
function
|
|
1433
|
+
function Lo(e) {
|
|
1259
1434
|
if (Array.isArray(e.urls))
|
|
1260
1435
|
return e.urls.map((n) => String(n).trim()).filter(Boolean);
|
|
1261
1436
|
const t = H(e.url);
|
|
1262
1437
|
return t != null && t.trim() ? [t.trim()] : [];
|
|
1263
1438
|
}
|
|
1264
|
-
function
|
|
1265
|
-
const r = typeof e.id == "string" ? e.id : le("block-"), o =
|
|
1439
|
+
function Ue(e, t, n) {
|
|
1440
|
+
const r = typeof e.id == "string" ? e.id : le("block-"), o = Lo(e), i = H(e.label) ?? H(e.description) ?? n, s = H(e.help), a = H(e.placeholder), l = Ne(e.mediaSize);
|
|
1266
1441
|
return {
|
|
1267
1442
|
id: r,
|
|
1268
1443
|
type: t,
|
|
@@ -1273,10 +1448,10 @@ function Ie(e, t, n) {
|
|
|
1273
1448
|
mediaUrls: o.length > 0 ? o : [""]
|
|
1274
1449
|
};
|
|
1275
1450
|
}
|
|
1276
|
-
function
|
|
1451
|
+
function Xt(e) {
|
|
1277
1452
|
switch (e.type) {
|
|
1278
1453
|
case "toggle":
|
|
1279
|
-
return
|
|
1454
|
+
return Fe(e.defaultValue);
|
|
1280
1455
|
case "multiselect":
|
|
1281
1456
|
case "checkbox":
|
|
1282
1457
|
case "resume_multiselect":
|
|
@@ -1290,9 +1465,9 @@ function Gt(e) {
|
|
|
1290
1465
|
return typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
1291
1466
|
}
|
|
1292
1467
|
}
|
|
1293
|
-
function
|
|
1294
|
-
var
|
|
1295
|
-
const t = e.id || le("a2-"), n = e.label ?? "", r = ((
|
|
1468
|
+
function Vo(e) {
|
|
1469
|
+
var u;
|
|
1470
|
+
const t = e.id || le("a2-"), n = e.label ?? "", r = ((u = e.name) == null ? void 0 : u.trim()) || "", o = r ? Bo(r) : void 0, i = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), s = (m) => r ? { node: m, dataKey: r, dataValue: Xt(e) } : { node: m }, a = { id: t, label: n, name: r, path: o, withData: s }, l = wo(e.type);
|
|
1296
1471
|
if (l)
|
|
1297
1472
|
return l.toComponent(e, a);
|
|
1298
1473
|
switch (e.type) {
|
|
@@ -1301,7 +1476,7 @@ function xo(e) {
|
|
|
1301
1476
|
case "paragraph":
|
|
1302
1477
|
return { node: { id: t, component: "Text", text: n, variant: "body" } };
|
|
1303
1478
|
case "text":
|
|
1304
|
-
return e.hidden ? r ? { node: null, dataKey: r, dataValue:
|
|
1479
|
+
return e.hidden ? r ? { node: null, dataKey: r, dataValue: Xt(e) } : { node: null } : s({
|
|
1305
1480
|
id: t,
|
|
1306
1481
|
component: "TextField",
|
|
1307
1482
|
label: n,
|
|
@@ -1325,7 +1500,7 @@ function xo(e) {
|
|
|
1325
1500
|
component: "TextField",
|
|
1326
1501
|
label: n,
|
|
1327
1502
|
variant: "shortText",
|
|
1328
|
-
validationRegexp:
|
|
1503
|
+
validationRegexp: bt,
|
|
1329
1504
|
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
1330
1505
|
value: { path: o }
|
|
1331
1506
|
});
|
|
@@ -1411,7 +1586,7 @@ function xo(e) {
|
|
|
1411
1586
|
case "image":
|
|
1412
1587
|
case "video":
|
|
1413
1588
|
case "audio":
|
|
1414
|
-
return { node:
|
|
1589
|
+
return { node: qo(e) };
|
|
1415
1590
|
case "file":
|
|
1416
1591
|
return s({
|
|
1417
1592
|
id: t,
|
|
@@ -1428,31 +1603,31 @@ function xo(e) {
|
|
|
1428
1603
|
return { node: null };
|
|
1429
1604
|
}
|
|
1430
1605
|
}
|
|
1431
|
-
function
|
|
1606
|
+
function ft(e) {
|
|
1432
1607
|
if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
|
|
1433
|
-
const t = e.components.find((r) => r.id ===
|
|
1608
|
+
const t = e.components.find((r) => r.id === Oe);
|
|
1434
1609
|
if (!t) return e.components.length === 0;
|
|
1435
1610
|
const n = t.children;
|
|
1436
1611
|
return !Array.isArray(n) || n.length === 0;
|
|
1437
1612
|
}
|
|
1438
|
-
function
|
|
1613
|
+
function An(e, t) {
|
|
1439
1614
|
const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, s = (e.title ?? "").trim(), a = (e.description ?? "").trim();
|
|
1440
|
-
i && s && (n.push({ id:
|
|
1615
|
+
i && s && (n.push({ id: dt, component: "Text", text: s, variant: "h2" }), r.push(dt)), i && a && (n.push({ id: pt, component: "Text", text: a, variant: "body" }), r.push(pt));
|
|
1441
1616
|
for (const m of e.blocks ?? []) {
|
|
1442
|
-
const { node: d, dataKey:
|
|
1443
|
-
|
|
1617
|
+
const { node: d, dataKey: v, dataValue: y } = Vo(m);
|
|
1618
|
+
v && (o[v] = y), d && (n.push(d), r.push(d.id));
|
|
1444
1619
|
}
|
|
1445
|
-
n.unshift({ id:
|
|
1446
|
-
const l = { root:
|
|
1447
|
-
return
|
|
1620
|
+
n.unshift({ id: Oe, component: "Column", children: r });
|
|
1621
|
+
const l = { root: Oe, components: n, dataModel: o }, u = t == null ? void 0 : t.styleId;
|
|
1622
|
+
return u !== void 0 && (l.surfaceProperties = { styleId: u ?? null }), l;
|
|
1448
1623
|
}
|
|
1449
|
-
function
|
|
1624
|
+
function jo(e) {
|
|
1450
1625
|
const t = /* @__PURE__ */ new Map();
|
|
1451
1626
|
for (const n of e.components ?? [])
|
|
1452
1627
|
n && typeof n.id == "string" && t.set(n.id, n);
|
|
1453
1628
|
return t;
|
|
1454
1629
|
}
|
|
1455
|
-
function
|
|
1630
|
+
function it(e) {
|
|
1456
1631
|
const t = e.options;
|
|
1457
1632
|
return Array.isArray(t) ? t.map((n) => {
|
|
1458
1633
|
if (!n || typeof n != "object") return null;
|
|
@@ -1463,10 +1638,10 @@ function rt(e) {
|
|
|
1463
1638
|
};
|
|
1464
1639
|
}).filter((n) => !!n) : [];
|
|
1465
1640
|
}
|
|
1466
|
-
function
|
|
1467
|
-
const t = typeof e.id == "string" ? e.id : le("block-"), n = String(e.component ?? ""), r = H(e.label) ?? H(e.text) ?? "", o =
|
|
1641
|
+
function $o(e) {
|
|
1642
|
+
const t = typeof e.id == "string" ? e.id : le("block-"), n = String(e.component ?? ""), r = H(e.label) ?? H(e.text) ?? "", o = Yt(e.value), i = (a) => ({ id: t, type: a, label: r }), s = Po(n);
|
|
1468
1643
|
if (s)
|
|
1469
|
-
return s.fromComponent(e, i, { asLiteral: H, nameFromValue:
|
|
1644
|
+
return s.fromComponent(e, i, { asLiteral: H, nameFromValue: Yt });
|
|
1470
1645
|
switch (n) {
|
|
1471
1646
|
case "Text": {
|
|
1472
1647
|
const a = String(e.variant ?? "body"), l = /^h[1-6]$/i.test(a) || a === "title" || a === "subtitle";
|
|
@@ -1475,19 +1650,19 @@ function No(e) {
|
|
|
1475
1650
|
case "TextField": {
|
|
1476
1651
|
const a = String(e.variant ?? "shortText");
|
|
1477
1652
|
let l = "text";
|
|
1478
|
-
a === "longText" ? l = "textarea" : a === "number" ? l = "number" : H(e.validationRegexp) ===
|
|
1479
|
-
const
|
|
1480
|
-
return m && (
|
|
1653
|
+
a === "longText" ? l = "textarea" : a === "number" ? l = "number" : H(e.validationRegexp) === bt && (l = "email");
|
|
1654
|
+
const u = { ...i(l), name: o }, m = H(e.placeholder);
|
|
1655
|
+
return m && (u.placeholder = m), u;
|
|
1481
1656
|
}
|
|
1482
1657
|
case "CheckBox":
|
|
1483
1658
|
return { ...i("toggle"), name: o };
|
|
1484
1659
|
case "SkoponSelect": {
|
|
1485
|
-
const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select",
|
|
1660
|
+
const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", u = {
|
|
1486
1661
|
...i(l),
|
|
1487
1662
|
name: o,
|
|
1488
|
-
options:
|
|
1663
|
+
options: it(e)
|
|
1489
1664
|
}, m = H(e.placeholder);
|
|
1490
|
-
return m && (
|
|
1665
|
+
return m && (u.placeholder = m), u;
|
|
1491
1666
|
}
|
|
1492
1667
|
case "ChoicePicker": {
|
|
1493
1668
|
const a = H(e.skoponPickerType);
|
|
@@ -1495,12 +1670,12 @@ function No(e) {
|
|
|
1495
1670
|
const m = {
|
|
1496
1671
|
...i(a),
|
|
1497
1672
|
name: o,
|
|
1498
|
-
options:
|
|
1673
|
+
options: it(e)
|
|
1499
1674
|
}, d = H(e.placeholder);
|
|
1500
1675
|
return d && (m.placeholder = d), m;
|
|
1501
1676
|
}
|
|
1502
|
-
const
|
|
1503
|
-
return { ...i(
|
|
1677
|
+
const u = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
|
|
1678
|
+
return { ...i(u), name: o, options: it(e) };
|
|
1504
1679
|
}
|
|
1505
1680
|
case "DateTimeInput": {
|
|
1506
1681
|
const a = e.enableDate === !0, l = e.enableTime === !0, m = { ...i(!a && l ? "time" : "datetime"), name: o }, d = H(e.placeholder);
|
|
@@ -1508,23 +1683,23 @@ function No(e) {
|
|
|
1508
1683
|
}
|
|
1509
1684
|
case "SkoponMedia": {
|
|
1510
1685
|
const a = String(e.mediaType ?? "image");
|
|
1511
|
-
return
|
|
1686
|
+
return Ue(e, a === "video" ? "video" : a === "audio" ? "audio" : "image", r);
|
|
1512
1687
|
}
|
|
1513
1688
|
case "Image":
|
|
1514
|
-
return
|
|
1689
|
+
return Ue(e, "image", r);
|
|
1515
1690
|
case "Video":
|
|
1516
|
-
return
|
|
1691
|
+
return Ue(e, "video", r);
|
|
1517
1692
|
case "AudioPlayer":
|
|
1518
|
-
return
|
|
1693
|
+
return Ue(e, "audio", r);
|
|
1519
1694
|
case "FileUpload": {
|
|
1520
1695
|
const a = H(e.accept) ?? "", l = { ...i("file"), name: o };
|
|
1521
|
-
return a && (l.fileAcceptExtensions = a.split(",").map((
|
|
1696
|
+
return a && (l.fileAcceptExtensions = a.split(",").map((u) => u.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;
|
|
1522
1697
|
}
|
|
1523
1698
|
default:
|
|
1524
1699
|
return null;
|
|
1525
1700
|
}
|
|
1526
1701
|
}
|
|
1527
|
-
function
|
|
1702
|
+
function _n(e, t, n, r) {
|
|
1528
1703
|
if (n.has(e)) return;
|
|
1529
1704
|
n.add(e);
|
|
1530
1705
|
const o = t.get(e);
|
|
@@ -1532,46 +1707,46 @@ function Sn(e, t, n, r) {
|
|
|
1532
1707
|
const i = String(o.component ?? "");
|
|
1533
1708
|
if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
|
|
1534
1709
|
for (const s of o.children)
|
|
1535
|
-
typeof s == "string" &&
|
|
1710
|
+
typeof s == "string" && _n(s, t, n, r);
|
|
1536
1711
|
return;
|
|
1537
1712
|
}
|
|
1538
1713
|
r.push(o);
|
|
1539
1714
|
}
|
|
1540
|
-
function
|
|
1715
|
+
function Do(e, t) {
|
|
1541
1716
|
return t ? e.map((n) => {
|
|
1542
1717
|
var i;
|
|
1543
1718
|
const r = (i = n.name) == null ? void 0 : i.trim();
|
|
1544
1719
|
if (!r || !(r in t)) return n;
|
|
1545
1720
|
const o = t[r];
|
|
1546
|
-
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue:
|
|
1721
|
+
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: Fe(o) } : { ...n, defaultValue: o };
|
|
1547
1722
|
}) : e;
|
|
1548
1723
|
}
|
|
1549
|
-
function
|
|
1724
|
+
function Ho(e) {
|
|
1550
1725
|
if (!e || !Array.isArray(e.components))
|
|
1551
|
-
return
|
|
1552
|
-
const t =
|
|
1553
|
-
|
|
1726
|
+
return Se({ title: "", description: "", blocks: [] });
|
|
1727
|
+
const t = jo(e), n = [];
|
|
1728
|
+
_n(e.root ?? Oe, t, /* @__PURE__ */ new Set(), n);
|
|
1554
1729
|
let r = "", o = "";
|
|
1555
1730
|
const i = [];
|
|
1556
1731
|
for (const s of n) {
|
|
1557
|
-
if (s.id ===
|
|
1732
|
+
if (s.id === dt) {
|
|
1558
1733
|
r = H(s.text) ?? r;
|
|
1559
1734
|
continue;
|
|
1560
1735
|
}
|
|
1561
|
-
if (s.id ===
|
|
1736
|
+
if (s.id === pt) {
|
|
1562
1737
|
o = H(s.text) ?? o;
|
|
1563
1738
|
continue;
|
|
1564
1739
|
}
|
|
1565
|
-
const a =
|
|
1740
|
+
const a = $o(s);
|
|
1566
1741
|
a && i.push(a);
|
|
1567
1742
|
}
|
|
1568
|
-
return
|
|
1743
|
+
return Se({
|
|
1569
1744
|
title: r,
|
|
1570
1745
|
description: o,
|
|
1571
|
-
blocks:
|
|
1746
|
+
blocks: Do(i, e.dataModel)
|
|
1572
1747
|
});
|
|
1573
1748
|
}
|
|
1574
|
-
function
|
|
1749
|
+
function Ko(e, t) {
|
|
1575
1750
|
const { surfaceId: n, catalogId: r } = t, o = [
|
|
1576
1751
|
{ version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
|
|
1577
1752
|
{
|
|
@@ -1584,25 +1759,25 @@ function Eo(e, t) {
|
|
|
1584
1759
|
updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
|
|
1585
1760
|
}), o;
|
|
1586
1761
|
}
|
|
1587
|
-
function
|
|
1762
|
+
function Tn(e) {
|
|
1588
1763
|
return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
|
|
1589
1764
|
}
|
|
1590
|
-
function
|
|
1765
|
+
function Wo(e, t) {
|
|
1591
1766
|
if (!e || typeof e != "object") return null;
|
|
1592
|
-
const n = e, r =
|
|
1593
|
-
if (r && !
|
|
1767
|
+
const n = e, r = Tn(n.a2ui) ? n.a2ui : void 0;
|
|
1768
|
+
if (r && !ft(r)) return r;
|
|
1594
1769
|
const o = Array.isArray(n.blocks) ? n.blocks : [];
|
|
1595
1770
|
if (o.length === 0) return null;
|
|
1596
|
-
const i =
|
|
1771
|
+
const i = qe({
|
|
1597
1772
|
title: typeof n.title == "string" ? n.title : "",
|
|
1598
1773
|
description: typeof n.description == "string" ? n.description : "",
|
|
1599
1774
|
blocks: o,
|
|
1600
|
-
jsonSchema:
|
|
1601
|
-
}), s =
|
|
1602
|
-
return
|
|
1775
|
+
jsonSchema: un(n.jsonSchema ?? n.json_schema)
|
|
1776
|
+
}), s = An(i, t);
|
|
1777
|
+
return ft(s) ? null : s;
|
|
1603
1778
|
}
|
|
1604
|
-
function
|
|
1605
|
-
return
|
|
1779
|
+
function Go(e, t, n) {
|
|
1780
|
+
return An(
|
|
1606
1781
|
{
|
|
1607
1782
|
title: e.title,
|
|
1608
1783
|
description: e.description,
|
|
@@ -1611,18 +1786,18 @@ function Ro(e, t, n) {
|
|
|
1611
1786
|
n
|
|
1612
1787
|
);
|
|
1613
1788
|
}
|
|
1614
|
-
function
|
|
1789
|
+
function Jo(e) {
|
|
1615
1790
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1616
1791
|
return;
|
|
1617
1792
|
const t = e;
|
|
1618
|
-
return !(Array.isArray(t.blocks) && t.blocks.length > 0) &&
|
|
1793
|
+
return !(Array.isArray(t.blocks) && t.blocks.length > 0) && Tn(t.a2ui) ? Ho(t.a2ui) : qe({
|
|
1619
1794
|
title: typeof t.title == "string" ? t.title : "",
|
|
1620
1795
|
description: typeof t.description == "string" ? t.description : "",
|
|
1621
1796
|
blocks: Array.isArray(t.blocks) ? t.blocks : [],
|
|
1622
|
-
jsonSchema:
|
|
1797
|
+
jsonSchema: un(t.jsonSchema ?? t.json_schema)
|
|
1623
1798
|
});
|
|
1624
1799
|
}
|
|
1625
|
-
function
|
|
1800
|
+
function Yo(e, t, n) {
|
|
1626
1801
|
const r = e.model.surfacesMap.get(t);
|
|
1627
1802
|
if (!r) return {};
|
|
1628
1803
|
const o = {};
|
|
@@ -1632,18 +1807,18 @@ function wo(e, t, n) {
|
|
|
1632
1807
|
}
|
|
1633
1808
|
return o;
|
|
1634
1809
|
}
|
|
1635
|
-
const
|
|
1636
|
-
function
|
|
1810
|
+
const Xo = /* @__PURE__ */ new Set(["type", "name", "id"]);
|
|
1811
|
+
function St(e) {
|
|
1637
1812
|
return e.type === "text" && e.hidden === !0;
|
|
1638
1813
|
}
|
|
1639
|
-
function
|
|
1640
|
-
return
|
|
1814
|
+
function kt(e) {
|
|
1815
|
+
return qe({
|
|
1641
1816
|
title: "",
|
|
1642
1817
|
description: "",
|
|
1643
1818
|
blocks: [e]
|
|
1644
1819
|
}).blocks[0];
|
|
1645
1820
|
}
|
|
1646
|
-
function
|
|
1821
|
+
function Qo(e, t) {
|
|
1647
1822
|
var o, i;
|
|
1648
1823
|
const n = /* @__PURE__ */ new Map();
|
|
1649
1824
|
for (const s of t) {
|
|
@@ -1652,19 +1827,19 @@ function Oo(e, t) {
|
|
|
1652
1827
|
}
|
|
1653
1828
|
const r = [];
|
|
1654
1829
|
for (const s of e.blocks) {
|
|
1655
|
-
if (
|
|
1656
|
-
r.push(
|
|
1830
|
+
if (ln(s.type)) {
|
|
1831
|
+
r.push(kt(s));
|
|
1657
1832
|
continue;
|
|
1658
1833
|
}
|
|
1659
1834
|
if (!Z(s.type)) continue;
|
|
1660
1835
|
const a = (i = s.name) == null ? void 0 : i.trim();
|
|
1661
1836
|
if (!a) continue;
|
|
1662
1837
|
const l = n.get(a);
|
|
1663
|
-
l && (
|
|
1838
|
+
l && (St(l) || r.push(l));
|
|
1664
1839
|
}
|
|
1665
1840
|
return r;
|
|
1666
1841
|
}
|
|
1667
|
-
function
|
|
1842
|
+
function Zo(e, t, n) {
|
|
1668
1843
|
const r = e.rawBlocks;
|
|
1669
1844
|
if (!(r != null && r.length)) return n;
|
|
1670
1845
|
for (const o of r) {
|
|
@@ -1673,23 +1848,23 @@ function qo(e, t, n) {
|
|
|
1673
1848
|
}
|
|
1674
1849
|
return n;
|
|
1675
1850
|
}
|
|
1676
|
-
function
|
|
1851
|
+
function ei(e, t) {
|
|
1677
1852
|
var r;
|
|
1678
1853
|
const n = { ...e };
|
|
1679
1854
|
for (const o of Object.keys(t)) {
|
|
1680
|
-
if (
|
|
1855
|
+
if (Xo.has(o) || !Object.prototype.hasOwnProperty.call(t, o)) continue;
|
|
1681
1856
|
const i = t[o];
|
|
1682
1857
|
i !== void 0 && Object.assign(n, { [o]: i });
|
|
1683
1858
|
}
|
|
1684
|
-
return n.type = e.type, n.name = ((r = e.name) == null ? void 0 : r.trim()) || t.name, n.id = e.id,
|
|
1859
|
+
return n.type = e.type, n.name = ((r = e.name) == null ? void 0 : r.trim()) || t.name, n.id = e.id, kt(n);
|
|
1685
1860
|
}
|
|
1686
|
-
function
|
|
1861
|
+
function Ve(e) {
|
|
1687
1862
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1688
1863
|
const t = e;
|
|
1689
1864
|
if (!Array.isArray(t.blocks)) return null;
|
|
1690
1865
|
const n = t.blocks.filter(
|
|
1691
1866
|
(o) => !!o && typeof o == "object" && !Array.isArray(o)
|
|
1692
|
-
), r =
|
|
1867
|
+
), r = qe({
|
|
1693
1868
|
title: typeof t.title == "string" ? t.title : "",
|
|
1694
1869
|
description: typeof t.description == "string" ? t.description : "",
|
|
1695
1870
|
blocks: n
|
|
@@ -1701,46 +1876,46 @@ function Be(e) {
|
|
|
1701
1876
|
rawBlocks: n
|
|
1702
1877
|
};
|
|
1703
1878
|
}
|
|
1704
|
-
function
|
|
1705
|
-
var i, s, a, l,
|
|
1879
|
+
function ti(e, t) {
|
|
1880
|
+
var i, s, a, l, u, m;
|
|
1706
1881
|
const n = /* @__PURE__ */ new Map();
|
|
1707
1882
|
for (const d of (t == null ? void 0 : t.blocks) ?? [])
|
|
1708
1883
|
Z(d.type) && ((i = d.name) != null && i.trim()) && n.set(d.name.trim(), d);
|
|
1709
1884
|
const r = [], o = [];
|
|
1710
1885
|
for (const d of e.blocks) {
|
|
1711
1886
|
if (!Z(d.type)) continue;
|
|
1712
|
-
const
|
|
1713
|
-
if (!
|
|
1714
|
-
const y = n.get(
|
|
1887
|
+
const v = (s = d.name) == null ? void 0 : s.trim();
|
|
1888
|
+
if (!v) continue;
|
|
1889
|
+
const y = n.get(v);
|
|
1715
1890
|
if (y) {
|
|
1716
|
-
const S =
|
|
1717
|
-
r.push(
|
|
1891
|
+
const S = Zo(e, v, d);
|
|
1892
|
+
r.push(ei(y, S));
|
|
1718
1893
|
} else
|
|
1719
|
-
o.push(
|
|
1894
|
+
o.push(kt(d));
|
|
1720
1895
|
}
|
|
1721
1896
|
return {
|
|
1722
1897
|
matchedBlocks: r,
|
|
1723
1898
|
extraBlocks: o,
|
|
1724
|
-
renderBlocks:
|
|
1899
|
+
renderBlocks: Qo(e, r),
|
|
1725
1900
|
title: ((a = e.title) == null ? void 0 : a.trim()) || ((l = t == null ? void 0 : t.title) == null ? void 0 : l.trim()) || "",
|
|
1726
|
-
description: ((
|
|
1901
|
+
description: ((u = e.description) == null ? void 0 : u.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
|
|
1727
1902
|
};
|
|
1728
1903
|
}
|
|
1729
|
-
function
|
|
1904
|
+
function xn(e) {
|
|
1730
1905
|
const { type: t, defaultValue: n } = e;
|
|
1731
1906
|
return n !== void 0 ? t === "toggle" ? n === !0 || n === "true" : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? Array.isArray(n) ? n.map(String) : typeof n == "string" && n ? [n] : [] : n : t === "toggle" ? !1 : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? [] : t === "number" ? null : "";
|
|
1732
1907
|
}
|
|
1733
|
-
function
|
|
1908
|
+
function Be(e) {
|
|
1734
1909
|
var n;
|
|
1735
1910
|
const t = {};
|
|
1736
1911
|
for (const r of e) {
|
|
1737
1912
|
if (!Z(r.type)) continue;
|
|
1738
1913
|
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1739
|
-
o && (t[o] =
|
|
1914
|
+
o && (t[o] = xn(r));
|
|
1740
1915
|
}
|
|
1741
1916
|
return t;
|
|
1742
1917
|
}
|
|
1743
|
-
function
|
|
1918
|
+
function ni(e) {
|
|
1744
1919
|
return e.blocks.some(
|
|
1745
1920
|
(t) => {
|
|
1746
1921
|
var n;
|
|
@@ -1748,71 +1923,71 @@ function Lo(e) {
|
|
|
1748
1923
|
}
|
|
1749
1924
|
);
|
|
1750
1925
|
}
|
|
1751
|
-
function
|
|
1926
|
+
function ri(e) {
|
|
1752
1927
|
return e.blocks.filter((t) => {
|
|
1753
1928
|
var n;
|
|
1754
|
-
return
|
|
1929
|
+
return ln(t.type) ? !0 : !Z(t.type) || !((n = t.name) != null && n.trim()) ? !1 : !St(t);
|
|
1755
1930
|
});
|
|
1756
1931
|
}
|
|
1757
|
-
function
|
|
1932
|
+
function ws(e) {
|
|
1758
1933
|
return e.blocks.filter((t) => {
|
|
1759
1934
|
var n;
|
|
1760
1935
|
return Z(t.type) && ((n = t.name) == null ? void 0 : n.trim());
|
|
1761
1936
|
}).map((t) => t.name.trim());
|
|
1762
1937
|
}
|
|
1763
|
-
function
|
|
1938
|
+
function oi(e) {
|
|
1764
1939
|
var n;
|
|
1765
1940
|
const t = {};
|
|
1766
1941
|
for (const r of e.blocks) {
|
|
1767
|
-
if (!
|
|
1942
|
+
if (!St(r)) continue;
|
|
1768
1943
|
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1769
|
-
o && (t[o] =
|
|
1944
|
+
o && (t[o] = xn(r));
|
|
1770
1945
|
}
|
|
1771
1946
|
return t;
|
|
1772
1947
|
}
|
|
1773
|
-
function
|
|
1948
|
+
function Ct(e) {
|
|
1774
1949
|
return e.replace(/'/g, "'\\''");
|
|
1775
1950
|
}
|
|
1776
|
-
function
|
|
1951
|
+
function Mn(e) {
|
|
1777
1952
|
var n;
|
|
1778
1953
|
const t = (n = e == null ? void 0 : e.Authorization) == null ? void 0 : n.trim();
|
|
1779
|
-
return t ? ` -H 'Authorization: ${
|
|
1954
|
+
return t ? ` -H 'Authorization: ${Ct(t)}' \\` : " -H 'Authorization: Bearer <token>' \\";
|
|
1780
1955
|
}
|
|
1781
|
-
function
|
|
1956
|
+
function Nn(e, t, n) {
|
|
1782
1957
|
const r = (t ?? "").trim() || "<callback_url>", o = JSON.stringify(e ?? {}, null, 2);
|
|
1783
1958
|
return [
|
|
1784
1959
|
`curl -X POST '${r}' \\`,
|
|
1785
1960
|
" -H 'Content-Type: application/json' \\",
|
|
1786
|
-
|
|
1787
|
-
` -d '${
|
|
1961
|
+
Mn(n),
|
|
1962
|
+
` -d '${Ct(o)}'`
|
|
1788
1963
|
].join(`
|
|
1789
1964
|
`);
|
|
1790
1965
|
}
|
|
1791
|
-
function
|
|
1966
|
+
function ii(e, t) {
|
|
1792
1967
|
return JSON.stringify({ ...e, ...t }, null, 2);
|
|
1793
1968
|
}
|
|
1794
|
-
function
|
|
1969
|
+
function si({
|
|
1795
1970
|
cardValues: e,
|
|
1796
1971
|
extraValues: t = {},
|
|
1797
1972
|
callbackUrl: n,
|
|
1798
1973
|
headers: r
|
|
1799
1974
|
}) {
|
|
1800
|
-
const o = (n ?? "").trim() || "<callback_url>", i =
|
|
1975
|
+
const o = (n ?? "").trim() || "<callback_url>", i = ii(e, t);
|
|
1801
1976
|
return [
|
|
1802
1977
|
`curl -X POST '${o}' \\`,
|
|
1803
1978
|
" -H 'Content-Type: application/json' \\",
|
|
1804
|
-
|
|
1805
|
-
` -d '${
|
|
1979
|
+
Mn(r),
|
|
1980
|
+
` -d '${Ct(i)}'`
|
|
1806
1981
|
].join(`
|
|
1807
1982
|
`);
|
|
1808
1983
|
}
|
|
1809
|
-
function
|
|
1810
|
-
const r =
|
|
1811
|
-
if (!r) return
|
|
1812
|
-
const o =
|
|
1813
|
-
return
|
|
1984
|
+
function Ps(e, t, n) {
|
|
1985
|
+
const r = Ve(e);
|
|
1986
|
+
if (!r) return Nn(e, t, n);
|
|
1987
|
+
const o = Be(r.blocks);
|
|
1988
|
+
return si({ cardValues: o, callbackUrl: t, headers: n });
|
|
1814
1989
|
}
|
|
1815
|
-
async function
|
|
1990
|
+
async function Fn(e, t, n) {
|
|
1816
1991
|
const r = e.trim();
|
|
1817
1992
|
if (!r)
|
|
1818
1993
|
throw new Error("callback_url 为空");
|
|
@@ -1839,7 +2014,7 @@ async function Tn(e, t, n) {
|
|
|
1839
2014
|
}
|
|
1840
2015
|
return { ok: i.ok, status: i.status, body: s };
|
|
1841
2016
|
}
|
|
1842
|
-
async function
|
|
2017
|
+
async function zs(e) {
|
|
1843
2018
|
var n;
|
|
1844
2019
|
if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
|
|
1845
2020
|
await navigator.clipboard.writeText(e);
|
|
@@ -1855,7 +2030,7 @@ async function ks(e) {
|
|
|
1855
2030
|
document.body.removeChild(t);
|
|
1856
2031
|
}
|
|
1857
2032
|
}
|
|
1858
|
-
async function
|
|
2033
|
+
async function At(e) {
|
|
1859
2034
|
let t;
|
|
1860
2035
|
try {
|
|
1861
2036
|
t = await e.json();
|
|
@@ -1868,8 +2043,8 @@ async function kt(e) {
|
|
|
1868
2043
|
throw new Error(t.message || `响应缺少 data (${e.status})`);
|
|
1869
2044
|
return t.data;
|
|
1870
2045
|
}
|
|
1871
|
-
const
|
|
1872
|
-
function
|
|
2046
|
+
const _t = "auth_user", ai = "token", li = "answer_agent_callback_url", ci = "realtime_ws_url", ui = "/api/v1/mock/ask_user_answer_mock";
|
|
2047
|
+
function Tt(e) {
|
|
1873
2048
|
if (typeof window > "u") return null;
|
|
1874
2049
|
try {
|
|
1875
2050
|
return e === "localStorage" ? window.localStorage : window.sessionStorage;
|
|
@@ -1877,7 +2052,7 @@ function At(e) {
|
|
|
1877
2052
|
return null;
|
|
1878
2053
|
}
|
|
1879
2054
|
}
|
|
1880
|
-
function
|
|
2055
|
+
function xt(e) {
|
|
1881
2056
|
try {
|
|
1882
2057
|
const t = JSON.parse(e);
|
|
1883
2058
|
return !t || typeof t != "object" || Array.isArray(t) ? null : t;
|
|
@@ -1885,50 +2060,50 @@ function _t(e) {
|
|
|
1885
2060
|
return null;
|
|
1886
2061
|
}
|
|
1887
2062
|
}
|
|
1888
|
-
function
|
|
1889
|
-
const n =
|
|
2063
|
+
function mi(e, t) {
|
|
2064
|
+
const n = xt(e);
|
|
1890
2065
|
if (!n) return "";
|
|
1891
2066
|
const r = n[t];
|
|
1892
2067
|
return typeof r == "string" ? r.trim().replace(/^bearer\s+/i, "").trim() : "";
|
|
1893
2068
|
}
|
|
1894
|
-
function
|
|
1895
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
2069
|
+
function di(e = {}) {
|
|
2070
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? _t, r = e.answerAgentCallbackUrlField ?? li, o = Tt(t);
|
|
1896
2071
|
if (!o) return "";
|
|
1897
2072
|
const i = o.getItem(n);
|
|
1898
2073
|
if (!i) return "";
|
|
1899
|
-
const s =
|
|
2074
|
+
const s = xt(i);
|
|
1900
2075
|
if (!s) return "";
|
|
1901
2076
|
const a = s[r];
|
|
1902
|
-
return (typeof a == "string" ? a.trim() : "") ||
|
|
2077
|
+
return (typeof a == "string" ? a.trim() : "") || ui;
|
|
1903
2078
|
}
|
|
1904
|
-
function
|
|
1905
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
2079
|
+
function pi(e = {}) {
|
|
2080
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? _t, r = e.realtimeWsUrlField ?? ci, o = Tt(t);
|
|
1906
2081
|
if (!o) return "";
|
|
1907
2082
|
const i = o.getItem(n);
|
|
1908
2083
|
if (!i) return "";
|
|
1909
|
-
const s =
|
|
2084
|
+
const s = xt(i);
|
|
1910
2085
|
if (!s) return "";
|
|
1911
2086
|
const a = s[r];
|
|
1912
2087
|
return typeof a == "string" ? a.trim() : "";
|
|
1913
2088
|
}
|
|
1914
|
-
function
|
|
2089
|
+
function Mt(e, t) {
|
|
1915
2090
|
return {
|
|
1916
|
-
...
|
|
2091
|
+
...In(t),
|
|
1917
2092
|
...e ?? {}
|
|
1918
2093
|
};
|
|
1919
2094
|
}
|
|
1920
|
-
function
|
|
1921
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
2095
|
+
function In(e = {}) {
|
|
2096
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? _t, r = e.tokenField ?? ai, o = Tt(t);
|
|
1922
2097
|
if (!o) return {};
|
|
1923
2098
|
const i = o.getItem(n);
|
|
1924
2099
|
if (!i) return {};
|
|
1925
|
-
const s =
|
|
2100
|
+
const s = mi(i, r);
|
|
1926
2101
|
return s ? { Authorization: `Bearer ${s}` } : {};
|
|
1927
2102
|
}
|
|
1928
|
-
async function
|
|
1929
|
-
return e.getHeaders ? await e.getHeaders() ?? {} :
|
|
2103
|
+
async function Nt(e = {}) {
|
|
2104
|
+
return e.getHeaders ? await e.getHeaders() ?? {} : In(e.authStorage);
|
|
1930
2105
|
}
|
|
1931
|
-
function
|
|
2106
|
+
function fi(e = {}) {
|
|
1932
2107
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
|
|
1933
2108
|
async function o(i) {
|
|
1934
2109
|
const s = new URLSearchParams();
|
|
@@ -1938,21 +2113,21 @@ function Zo(e = {}) {
|
|
|
1938
2113
|
s.set("form_unique_id", i.formUniqueId);
|
|
1939
2114
|
else
|
|
1940
2115
|
throw new Error("form_id 或 form_unique_id 至少传一个");
|
|
1941
|
-
const a = await
|
|
2116
|
+
const a = await Nt(e), l = await r(`${t}${n}?${s.toString()}`, {
|
|
1942
2117
|
method: "GET",
|
|
1943
2118
|
headers: a
|
|
1944
|
-
}),
|
|
2119
|
+
}), u = await At(l), m = Jo(u.form_definition);
|
|
1945
2120
|
return {
|
|
1946
|
-
formUniqueId:
|
|
1947
|
-
formId:
|
|
1948
|
-
disabled:
|
|
2121
|
+
formUniqueId: u.form_unique_id,
|
|
2122
|
+
formId: u.form_id,
|
|
2123
|
+
disabled: u.disabled === 1,
|
|
1949
2124
|
formDefinition: m,
|
|
1950
|
-
a2ui:
|
|
2125
|
+
a2ui: Wo(u.form_definition) ?? void 0
|
|
1951
2126
|
};
|
|
1952
2127
|
}
|
|
1953
2128
|
return { fetchDetail: o };
|
|
1954
2129
|
}
|
|
1955
|
-
function
|
|
2130
|
+
function hi(e) {
|
|
1956
2131
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1957
2132
|
return e ?? null;
|
|
1958
2133
|
const t = e;
|
|
@@ -1962,13 +2137,13 @@ function ei(e) {
|
|
|
1962
2137
|
blocks: t.blocks
|
|
1963
2138
|
} : e;
|
|
1964
2139
|
}
|
|
1965
|
-
function
|
|
2140
|
+
function Ft({
|
|
1966
2141
|
context: e,
|
|
1967
2142
|
payload: t,
|
|
1968
2143
|
form: n,
|
|
1969
2144
|
answer: r
|
|
1970
2145
|
}) {
|
|
1971
|
-
const o =
|
|
2146
|
+
const o = Ve(t) ?? t, i = n ? hi(n) : o;
|
|
1972
2147
|
return {
|
|
1973
2148
|
mission_id: e.missionId ?? null,
|
|
1974
2149
|
tenant_id: e.tenantId ?? null,
|
|
@@ -1981,7 +2156,7 @@ function Mt({
|
|
|
1981
2156
|
answer: r
|
|
1982
2157
|
};
|
|
1983
2158
|
}
|
|
1984
|
-
function
|
|
2159
|
+
function It(e) {
|
|
1985
2160
|
const t = e.callback_url;
|
|
1986
2161
|
if (typeof t != "string" || !t.trim())
|
|
1987
2162
|
return "callback_url 为空,无法提交";
|
|
@@ -1996,34 +2171,34 @@ function Nt(e) {
|
|
|
1996
2171
|
const o = e.mission_id;
|
|
1997
2172
|
return o == null || o === "" ? "mission_id 缺失,无法提交" : null;
|
|
1998
2173
|
}
|
|
1999
|
-
function
|
|
2000
|
-
return
|
|
2001
|
-
|
|
2174
|
+
function Os(e) {
|
|
2175
|
+
return It(
|
|
2176
|
+
Ft({
|
|
2002
2177
|
context: e,
|
|
2003
2178
|
payload: {},
|
|
2004
2179
|
answer: {}
|
|
2005
2180
|
})
|
|
2006
2181
|
);
|
|
2007
2182
|
}
|
|
2008
|
-
const
|
|
2009
|
-
function
|
|
2183
|
+
const Qt = "answer_agent_callback_url 未配置,无法提交";
|
|
2184
|
+
function gi(e) {
|
|
2010
2185
|
if ((e == null ? void 0 : e.answerAgentCallbackUrl) != null) {
|
|
2011
2186
|
const n = e.answerAgentCallbackUrl.trim();
|
|
2012
2187
|
if (!n)
|
|
2013
|
-
throw new Error(
|
|
2188
|
+
throw new Error(Qt);
|
|
2014
2189
|
return n;
|
|
2015
2190
|
}
|
|
2016
|
-
const t =
|
|
2191
|
+
const t = di(e == null ? void 0 : e.authStorage).trim();
|
|
2017
2192
|
if (!t)
|
|
2018
|
-
throw new Error(
|
|
2193
|
+
throw new Error(Qt);
|
|
2019
2194
|
return t;
|
|
2020
2195
|
}
|
|
2021
|
-
function
|
|
2196
|
+
function En(e) {
|
|
2022
2197
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
2023
2198
|
const n = e.data;
|
|
2024
2199
|
return !n || typeof n != "object" || Array.isArray(n) ? null : n;
|
|
2025
2200
|
}
|
|
2026
|
-
function
|
|
2201
|
+
function yi(e, t) {
|
|
2027
2202
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
2028
2203
|
const n = t.message;
|
|
2029
2204
|
if (typeof n == "string" && n.trim())
|
|
@@ -2031,27 +2206,27 @@ function ni(e, t) {
|
|
|
2031
2206
|
}
|
|
2032
2207
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
2033
2208
|
}
|
|
2034
|
-
function
|
|
2209
|
+
function vi(e) {
|
|
2035
2210
|
return `提交失败:${typeof e.error == "string" && e.error.trim() ? e.error.trim() : `回调 HTTP ${e.callback_status ?? "失败"}`}`;
|
|
2036
2211
|
}
|
|
2037
|
-
function
|
|
2038
|
-
const t =
|
|
2039
|
-
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message:
|
|
2212
|
+
function Un(e) {
|
|
2213
|
+
const t = En(e.body);
|
|
2214
|
+
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message: vi(t) } : e.ok ? { type: "success", message: "提交成功" } : {
|
|
2040
2215
|
type: "error",
|
|
2041
|
-
message:
|
|
2216
|
+
message: yi(e.status, e.body)
|
|
2042
2217
|
};
|
|
2043
2218
|
}
|
|
2044
|
-
async function
|
|
2045
|
-
const n =
|
|
2219
|
+
async function Rn(e, t) {
|
|
2220
|
+
const n = It(e);
|
|
2046
2221
|
if (n)
|
|
2047
2222
|
throw new Error(n);
|
|
2048
|
-
const r =
|
|
2223
|
+
const r = gi(t), o = await Fn(r, e, {
|
|
2049
2224
|
...t,
|
|
2050
|
-
headers:
|
|
2051
|
-
}), i =
|
|
2225
|
+
headers: Mt(t == null ? void 0 : t.headers, t == null ? void 0 : t.authStorage)
|
|
2226
|
+
}), i = En(o.body);
|
|
2052
2227
|
return o.ok && (i == null ? void 0 : i.callback_ok) === !1 ? { ok: !1, status: o.status, body: o.body } : o;
|
|
2053
2228
|
}
|
|
2054
|
-
function
|
|
2229
|
+
function bi(e) {
|
|
2055
2230
|
return {
|
|
2056
2231
|
resumeUniqueId: e.resume_unique_id,
|
|
2057
2232
|
resumeId: e.resume_id,
|
|
@@ -2072,7 +2247,7 @@ function oi(e) {
|
|
|
2072
2247
|
}))
|
|
2073
2248
|
};
|
|
2074
2249
|
}
|
|
2075
|
-
function
|
|
2250
|
+
function Si(e, t, n) {
|
|
2076
2251
|
const r = new URLSearchParams();
|
|
2077
2252
|
r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20));
|
|
2078
2253
|
for (const o of e.names ?? [])
|
|
@@ -2085,27 +2260,27 @@ function ii(e, t, n) {
|
|
|
2085
2260
|
r.append("published", String(o));
|
|
2086
2261
|
return r;
|
|
2087
2262
|
}
|
|
2088
|
-
function
|
|
2263
|
+
function ki(e = {}) {
|
|
2089
2264
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.searchPath ?? "/univ/resume/search", r = e.fetch ?? fetch, o = e.published ?? [1];
|
|
2090
2265
|
return async ({ filter: i, page: s }) => {
|
|
2091
|
-
const a = await
|
|
2266
|
+
const a = await Nt(e), l = Si(i, s, o), u = await r(`${t}${n}?${l.toString()}`, {
|
|
2092
2267
|
method: "GET",
|
|
2093
2268
|
headers: a
|
|
2094
|
-
}), m = await
|
|
2269
|
+
}), m = await At(u);
|
|
2095
2270
|
return {
|
|
2096
|
-
list: (m.list ?? []).map(
|
|
2271
|
+
list: (m.list ?? []).map(bi),
|
|
2097
2272
|
total: m.total ?? 0,
|
|
2098
2273
|
page: m.page ?? s,
|
|
2099
2274
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
2100
2275
|
};
|
|
2101
2276
|
};
|
|
2102
2277
|
}
|
|
2103
|
-
function
|
|
2278
|
+
function Ci(e) {
|
|
2104
2279
|
var r, o, i, s;
|
|
2105
2280
|
const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!((o = e.agentUniqueId) != null && o.trim() && ((i = e.flowType) != null && i.trim()) && ((s = e.category) != null && s.trim()));
|
|
2106
2281
|
return t || n;
|
|
2107
2282
|
}
|
|
2108
|
-
function
|
|
2283
|
+
function Ai(e) {
|
|
2109
2284
|
return {
|
|
2110
2285
|
caseUniqueId: e.case_unique_id,
|
|
2111
2286
|
caseId: e.case_id,
|
|
@@ -2116,7 +2291,7 @@ function li(e) {
|
|
|
2116
2291
|
description: e.description ?? void 0
|
|
2117
2292
|
};
|
|
2118
2293
|
}
|
|
2119
|
-
function
|
|
2294
|
+
function _i(e, t, n) {
|
|
2120
2295
|
var o, i, s;
|
|
2121
2296
|
const r = new URLSearchParams();
|
|
2122
2297
|
r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20)), r.set("published", String(n)), (o = e.agentUniqueId) != null && o.trim() && r.set("agent_unique_id", e.agentUniqueId.trim()), (i = e.flowType) != null && i.trim() && r.set("flow_type", e.flowType.trim()), (s = e.category) != null && s.trim() && r.set("category_unique_id", e.category.trim());
|
|
@@ -2124,24 +2299,24 @@ function ci(e, t, n) {
|
|
|
2124
2299
|
a && r.append("flow_unique_ids", a);
|
|
2125
2300
|
return r;
|
|
2126
2301
|
}
|
|
2127
|
-
function
|
|
2302
|
+
function Ti(e = {}) {
|
|
2128
2303
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.listPath ?? "/univ/case/list", r = e.fetch ?? fetch, o = e.published ?? 1;
|
|
2129
2304
|
return async ({ filter: i, page: s }) => {
|
|
2130
|
-
if (!
|
|
2305
|
+
if (!Ci(i))
|
|
2131
2306
|
return { list: [], total: 0, page: 1, pageSize: i.pageSize ?? 20 };
|
|
2132
|
-
const a = await
|
|
2307
|
+
const a = await Nt(e), l = _i(i, s, o), u = await r(`${t}${n}?${l.toString()}`, {
|
|
2133
2308
|
method: "GET",
|
|
2134
2309
|
headers: a
|
|
2135
|
-
}), m = await
|
|
2310
|
+
}), m = await At(u);
|
|
2136
2311
|
return {
|
|
2137
|
-
list: (m.list ?? []).map(
|
|
2312
|
+
list: (m.list ?? []).map(Ai),
|
|
2138
2313
|
total: m.total ?? 0,
|
|
2139
2314
|
page: m.page ?? s,
|
|
2140
2315
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
2141
2316
|
};
|
|
2142
2317
|
};
|
|
2143
2318
|
}
|
|
2144
|
-
function
|
|
2319
|
+
function Bs(e = {}) {
|
|
2145
2320
|
var r, o, i, s, a;
|
|
2146
2321
|
const t = {
|
|
2147
2322
|
baseUrl: e.baseUrl,
|
|
@@ -2150,23 +2325,23 @@ function As(e = {}) {
|
|
|
2150
2325
|
authStorage: e.authStorage
|
|
2151
2326
|
};
|
|
2152
2327
|
return {
|
|
2153
|
-
fetchDetail:
|
|
2328
|
+
fetchDetail: fi({
|
|
2154
2329
|
...t,
|
|
2155
2330
|
detailPath: (r = e.form) == null ? void 0 : r.detailPath
|
|
2156
2331
|
}).fetchDetail,
|
|
2157
|
-
resumeSearch:
|
|
2332
|
+
resumeSearch: ki({
|
|
2158
2333
|
...t,
|
|
2159
2334
|
searchPath: (o = e.resume) == null ? void 0 : o.searchPath,
|
|
2160
2335
|
published: (i = e.resume) == null ? void 0 : i.published
|
|
2161
2336
|
}),
|
|
2162
|
-
caseSearch:
|
|
2337
|
+
caseSearch: Ti({
|
|
2163
2338
|
...t,
|
|
2164
2339
|
listPath: (s = e.case) == null ? void 0 : s.listPath,
|
|
2165
2340
|
published: (a = e.case) == null ? void 0 : a.published
|
|
2166
2341
|
})
|
|
2167
2342
|
};
|
|
2168
2343
|
}
|
|
2169
|
-
function
|
|
2344
|
+
function wn(e, t) {
|
|
2170
2345
|
if (!t.trim()) return !0;
|
|
2171
2346
|
try {
|
|
2172
2347
|
return new RegExp(t).test(e);
|
|
@@ -2174,10 +2349,10 @@ function Fn(e, t) {
|
|
|
2174
2349
|
return !0;
|
|
2175
2350
|
}
|
|
2176
2351
|
}
|
|
2177
|
-
function
|
|
2352
|
+
function Pn(e) {
|
|
2178
2353
|
return e == null ? !0 : typeof e == "string" ? !e.trim() : !1;
|
|
2179
2354
|
}
|
|
2180
|
-
function
|
|
2355
|
+
function xi(e, t) {
|
|
2181
2356
|
switch (e.type) {
|
|
2182
2357
|
case "multiselect":
|
|
2183
2358
|
case "checkbox":
|
|
@@ -2186,32 +2361,33 @@ function mi(e, t) {
|
|
|
2186
2361
|
case "case_multiselect":
|
|
2187
2362
|
return Q(t).length === 0;
|
|
2188
2363
|
case "toggle":
|
|
2189
|
-
return !
|
|
2364
|
+
return !Fe(t);
|
|
2190
2365
|
case "number":
|
|
2191
2366
|
return t == null || t === "";
|
|
2192
2367
|
default:
|
|
2193
|
-
return
|
|
2368
|
+
return Pn(t);
|
|
2194
2369
|
}
|
|
2195
2370
|
}
|
|
2196
|
-
function
|
|
2371
|
+
function st(e, t) {
|
|
2197
2372
|
return e.required === !0 || t > 0;
|
|
2198
2373
|
}
|
|
2199
|
-
function
|
|
2374
|
+
function Mi(e, t) {
|
|
2200
2375
|
var n, r;
|
|
2201
2376
|
for (const o of e) {
|
|
2377
|
+
if (!Z(o.type)) continue;
|
|
2202
2378
|
const i = (n = o.name) == null ? void 0 : n.trim();
|
|
2203
|
-
if (!i
|
|
2379
|
+
if (!i) continue;
|
|
2204
2380
|
const s = t[i], a = ((r = o.label) == null ? void 0 : r.trim()) || i;
|
|
2205
|
-
if (o.required &&
|
|
2381
|
+
if (o.required && xi(o, s))
|
|
2206
2382
|
return { fieldName: i, label: a, message: `请填写「${a}」` };
|
|
2207
|
-
if (o.type === "email" && !
|
|
2383
|
+
if (o.type === "email" && !Pn(s)) {
|
|
2208
2384
|
const l = String(s).trim();
|
|
2209
|
-
if (!
|
|
2385
|
+
if (!wn(l, bt))
|
|
2210
2386
|
return { fieldName: i, label: a, message: `「${a}」格式不正确` };
|
|
2211
2387
|
}
|
|
2212
2388
|
if (o.type === "file") {
|
|
2213
|
-
const l = o.fileMinCount ?? 0,
|
|
2214
|
-
if (l > 0 &&
|
|
2389
|
+
const l = o.fileMinCount ?? 0, u = Q(s).length;
|
|
2390
|
+
if (l > 0 && u < l && st(o, u))
|
|
2215
2391
|
return {
|
|
2216
2392
|
fieldName: i,
|
|
2217
2393
|
label: a,
|
|
@@ -2219,8 +2395,8 @@ function di(e, t) {
|
|
|
2219
2395
|
};
|
|
2220
2396
|
}
|
|
2221
2397
|
if (o.type === "resume_multiselect") {
|
|
2222
|
-
const l = o.resumeMinCount,
|
|
2223
|
-
if (l !== void 0 &&
|
|
2398
|
+
const l = o.resumeMinCount, u = Q(s).length;
|
|
2399
|
+
if (l !== void 0 && u < l && st(o, u))
|
|
2224
2400
|
return {
|
|
2225
2401
|
fieldName: i,
|
|
2226
2402
|
label: a,
|
|
@@ -2228,8 +2404,8 @@ function di(e, t) {
|
|
|
2228
2404
|
};
|
|
2229
2405
|
}
|
|
2230
2406
|
if (o.type === "case_multiselect") {
|
|
2231
|
-
const l = o.caseMinCount,
|
|
2232
|
-
if (l !== void 0 &&
|
|
2407
|
+
const l = o.caseMinCount, u = Q(s).length;
|
|
2408
|
+
if (l !== void 0 && u < l && st(o, u))
|
|
2233
2409
|
return {
|
|
2234
2410
|
fieldName: i,
|
|
2235
2411
|
label: a,
|
|
@@ -2239,21 +2415,21 @@ function di(e, t) {
|
|
|
2239
2415
|
}
|
|
2240
2416
|
return null;
|
|
2241
2417
|
}
|
|
2242
|
-
const
|
|
2243
|
-
video:
|
|
2244
|
-
audio:
|
|
2245
|
-
image:
|
|
2246
|
-
file:
|
|
2247
|
-
spreadsheet:
|
|
2248
|
-
document:
|
|
2418
|
+
const Ni = {
|
|
2419
|
+
video: lr,
|
|
2420
|
+
audio: ar,
|
|
2421
|
+
image: sr,
|
|
2422
|
+
file: tn,
|
|
2423
|
+
spreadsheet: ir,
|
|
2424
|
+
document: en
|
|
2249
2425
|
};
|
|
2250
|
-
function
|
|
2426
|
+
function Fi({
|
|
2251
2427
|
type: e,
|
|
2252
2428
|
size: t = 40,
|
|
2253
2429
|
className: n
|
|
2254
2430
|
}) {
|
|
2255
|
-
const r =
|
|
2256
|
-
return /* @__PURE__ */
|
|
2431
|
+
const r = Ni[e] ?? tn;
|
|
2432
|
+
return /* @__PURE__ */ c(
|
|
2257
2433
|
r,
|
|
2258
2434
|
{
|
|
2259
2435
|
className: n ?? "skopon-form-file-placeholder-icon",
|
|
@@ -2262,7 +2438,7 @@ function pi({
|
|
|
2262
2438
|
}
|
|
2263
2439
|
);
|
|
2264
2440
|
}
|
|
2265
|
-
const
|
|
2441
|
+
const zn = "skopon-form-v0_9", Ii = /* @__PURE__ */ new Set([
|
|
2266
2442
|
"SkoponMedia",
|
|
2267
2443
|
"SkoponSelect",
|
|
2268
2444
|
"Image",
|
|
@@ -2274,24 +2450,24 @@ const Un = "skopon-form-v0_9", hi = /* @__PURE__ */ new Set([
|
|
|
2274
2450
|
"FileUpload",
|
|
2275
2451
|
"TextField",
|
|
2276
2452
|
"Text",
|
|
2277
|
-
...
|
|
2278
|
-
]),
|
|
2279
|
-
function
|
|
2280
|
-
const t = [...
|
|
2453
|
+
...Oo()
|
|
2454
|
+
]), Ei = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
|
|
2455
|
+
function Ie(e) {
|
|
2456
|
+
const t = [...we.components.values()].find((n) => n.name === e);
|
|
2281
2457
|
if (!t) throw new Error(`Missing basic catalog component: ${e}`);
|
|
2282
2458
|
return t.schema;
|
|
2283
2459
|
}
|
|
2284
|
-
function
|
|
2460
|
+
function w(e) {
|
|
2285
2461
|
return typeof e == "string" ? e : "";
|
|
2286
2462
|
}
|
|
2287
|
-
function
|
|
2463
|
+
function On(e) {
|
|
2288
2464
|
return Array.isArray(e) ? e.map((t) => {
|
|
2289
2465
|
if (!t || typeof t != "object") return null;
|
|
2290
2466
|
const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
|
|
2291
2467
|
return { value: r, label: o };
|
|
2292
2468
|
}).filter((t) => !!t) : [];
|
|
2293
2469
|
}
|
|
2294
|
-
function
|
|
2470
|
+
function je({
|
|
2295
2471
|
mediaType: e,
|
|
2296
2472
|
urls: t,
|
|
2297
2473
|
mediaSize: n,
|
|
@@ -2299,10 +2475,10 @@ function Ve({
|
|
|
2299
2475
|
help: o,
|
|
2300
2476
|
placeholder: i
|
|
2301
2477
|
}) {
|
|
2302
|
-
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l =
|
|
2303
|
-
return /* @__PURE__ */
|
|
2304
|
-
s ? /* @__PURE__ */
|
|
2305
|
-
t.length === 0 ? /* @__PURE__ */
|
|
2478
|
+
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l = Pr(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
|
|
2479
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", children: [
|
|
2480
|
+
s ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2481
|
+
t.length === 0 ? /* @__PURE__ */ c("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ c("div", { className: l, children: t.map((m, d) => e === "image" ? /* @__PURE__ */ c(
|
|
2306
2482
|
"img",
|
|
2307
2483
|
{
|
|
2308
2484
|
src: m,
|
|
@@ -2310,7 +2486,7 @@ function Ve({
|
|
|
2310
2486
|
className: "form-media-item"
|
|
2311
2487
|
},
|
|
2312
2488
|
`media-${d}`
|
|
2313
|
-
) : e === "video" ? /* @__PURE__ */
|
|
2489
|
+
) : e === "video" ? /* @__PURE__ */ c(
|
|
2314
2490
|
"video",
|
|
2315
2491
|
{
|
|
2316
2492
|
src: m,
|
|
@@ -2318,7 +2494,7 @@ function Ve({
|
|
|
2318
2494
|
className: "form-media-item"
|
|
2319
2495
|
},
|
|
2320
2496
|
`media-${d}`
|
|
2321
|
-
) : /* @__PURE__ */
|
|
2497
|
+
) : /* @__PURE__ */ c(
|
|
2322
2498
|
"audio",
|
|
2323
2499
|
{
|
|
2324
2500
|
src: m,
|
|
@@ -2327,64 +2503,64 @@ function Ve({
|
|
|
2327
2503
|
},
|
|
2328
2504
|
`media-${d}`
|
|
2329
2505
|
)) }),
|
|
2330
|
-
a ? /* @__PURE__ */
|
|
2506
|
+
a ? /* @__PURE__ */ c(ee.Text, { type: "secondary", className: "form-block-preview-help", children: a }) : null
|
|
2331
2507
|
] });
|
|
2332
2508
|
}
|
|
2333
|
-
function
|
|
2334
|
-
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) :
|
|
2509
|
+
function $e(e, t) {
|
|
2510
|
+
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : w(e.url).trim() ? [w(e.url).trim()] : [];
|
|
2335
2511
|
return {
|
|
2336
2512
|
mediaType: t,
|
|
2337
2513
|
urls: n,
|
|
2338
|
-
mediaSize:
|
|
2339
|
-
label:
|
|
2340
|
-
help:
|
|
2341
|
-
placeholder:
|
|
2514
|
+
mediaSize: Ne(e.mediaSize),
|
|
2515
|
+
label: w(e.label) || w(e.description),
|
|
2516
|
+
help: w(e.help),
|
|
2517
|
+
placeholder: w(e.placeholder)
|
|
2342
2518
|
};
|
|
2343
2519
|
}
|
|
2344
|
-
const
|
|
2520
|
+
const Ui = {
|
|
2345
2521
|
name: "SkoponMedia",
|
|
2346
|
-
schema:
|
|
2347
|
-
mediaType:
|
|
2348
|
-
urls:
|
|
2349
|
-
mediaSize:
|
|
2350
|
-
label:
|
|
2351
|
-
help:
|
|
2352
|
-
placeholder:
|
|
2522
|
+
schema: f.object({
|
|
2523
|
+
mediaType: f.any().optional(),
|
|
2524
|
+
urls: f.any().optional(),
|
|
2525
|
+
mediaSize: f.any().optional(),
|
|
2526
|
+
label: f.any().optional(),
|
|
2527
|
+
help: f.any().optional(),
|
|
2528
|
+
placeholder: f.any().optional()
|
|
2353
2529
|
}).passthrough()
|
|
2354
|
-
},
|
|
2355
|
-
const t = e.componentModel.properties, n =
|
|
2356
|
-
return /* @__PURE__ */
|
|
2357
|
-
}),
|
|
2358
|
-
{ name: "Image", schema:
|
|
2359
|
-
({ context: e }) => /* @__PURE__ */
|
|
2360
|
-
),
|
|
2361
|
-
{ name: "Video", schema:
|
|
2362
|
-
({ context: e }) => /* @__PURE__ */
|
|
2363
|
-
),
|
|
2364
|
-
{ name: "AudioPlayer", schema:
|
|
2365
|
-
({ context: e }) => /* @__PURE__ */
|
|
2366
|
-
),
|
|
2530
|
+
}, Ri = J(Ui, ({ context: e }) => {
|
|
2531
|
+
const t = e.componentModel.properties, n = w(t.mediaType);
|
|
2532
|
+
return /* @__PURE__ */ c(je, { ...$e(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
|
|
2533
|
+
}), wi = J(
|
|
2534
|
+
{ name: "Image", schema: Ie("Image") },
|
|
2535
|
+
({ context: e }) => /* @__PURE__ */ c(je, { ...$e(e.componentModel.properties, "image") })
|
|
2536
|
+
), Pi = J(
|
|
2537
|
+
{ name: "Video", schema: Ie("Video") },
|
|
2538
|
+
({ context: e }) => /* @__PURE__ */ c(je, { ...$e(e.componentModel.properties, "video") })
|
|
2539
|
+
), zi = J(
|
|
2540
|
+
{ name: "AudioPlayer", schema: Ie("AudioPlayer") },
|
|
2541
|
+
({ context: e }) => /* @__PURE__ */ c(je, { ...$e(e.componentModel.properties, "audio") })
|
|
2542
|
+
), Oi = {
|
|
2367
2543
|
name: "SkoponSelect",
|
|
2368
|
-
schema:
|
|
2369
|
-
label:
|
|
2370
|
-
mode:
|
|
2371
|
-
placeholder:
|
|
2372
|
-
options:
|
|
2373
|
-
value:
|
|
2544
|
+
schema: f.object({
|
|
2545
|
+
label: f.any().optional(),
|
|
2546
|
+
mode: f.any().optional(),
|
|
2547
|
+
placeholder: f.any().optional(),
|
|
2548
|
+
options: f.any().optional(),
|
|
2549
|
+
value: f.any().optional()
|
|
2374
2550
|
}).passthrough()
|
|
2375
2551
|
};
|
|
2376
|
-
function
|
|
2552
|
+
function Bi({ context: e }) {
|
|
2377
2553
|
const { interactive: t } = se(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = ae(e, "value", {
|
|
2378
2554
|
component: "SkoponSelect",
|
|
2379
2555
|
changeAction: "select"
|
|
2380
|
-
}), s = e.componentModel.properties, a =
|
|
2381
|
-
return
|
|
2382
|
-
const d =
|
|
2556
|
+
}), s = e.componentModel.properties, a = w(s.label), l = w(s.placeholder), u = On(s.options), m = w(s.mode) === "multiple";
|
|
2557
|
+
return B(() => {
|
|
2558
|
+
const d = yn(n, m);
|
|
2383
2559
|
d !== null && o(d);
|
|
2384
|
-
}, [m, n, o]), /* @__PURE__ */
|
|
2385
|
-
a ? /* @__PURE__ */
|
|
2386
|
-
/* @__PURE__ */
|
|
2387
|
-
|
|
2560
|
+
}, [m, n, o]), /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2561
|
+
a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2562
|
+
/* @__PURE__ */ c(
|
|
2563
|
+
at,
|
|
2388
2564
|
{
|
|
2389
2565
|
mode: m ? "multiple" : void 0,
|
|
2390
2566
|
disabled: !t,
|
|
@@ -2392,29 +2568,29 @@ function Ai({ context: e }) {
|
|
|
2392
2568
|
className: "form-block-preview-control",
|
|
2393
2569
|
style: { width: "100%" },
|
|
2394
2570
|
placeholder: l || (m ? "请选择多项" : "请选择"),
|
|
2395
|
-
options:
|
|
2396
|
-
value: m ? Q(n) :
|
|
2571
|
+
options: u,
|
|
2572
|
+
value: m ? Q(n) : ke(n),
|
|
2397
2573
|
onChange: (d) => r(m ? d ?? [] : d ?? "")
|
|
2398
2574
|
}
|
|
2399
2575
|
)
|
|
2400
2576
|
] });
|
|
2401
2577
|
}
|
|
2402
|
-
const
|
|
2403
|
-
|
|
2404
|
-
|
|
2578
|
+
const qi = J(
|
|
2579
|
+
Oi,
|
|
2580
|
+
Bi
|
|
2405
2581
|
);
|
|
2406
|
-
function
|
|
2582
|
+
function Li({ context: e }) {
|
|
2407
2583
|
const { interactive: t } = se(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = ae(e, "value", {
|
|
2408
2584
|
component: "ChoicePicker",
|
|
2409
2585
|
changeAction: "select"
|
|
2410
|
-
}), s = e.componentModel.properties, a =
|
|
2411
|
-
return
|
|
2412
|
-
const g =
|
|
2586
|
+
}), s = e.componentModel.properties, a = w(s.label), l = w(s.variant) || "mutuallyExclusive", u = w(s.skoponPickerType), m = w(s.placeholder), d = On(s.options), y = u === "select" || u === "multiselect" || u === "radio" || u === "checkbox" ? u : l === "multipleSelection" ? "checkbox" : "radio", S = y === "multiselect" || y === "checkbox";
|
|
2587
|
+
return B(() => {
|
|
2588
|
+
const g = yn(n, S);
|
|
2413
2589
|
g !== null && o(g);
|
|
2414
|
-
}, [S, n, o]), /* @__PURE__ */
|
|
2415
|
-
a ? /* @__PURE__ */
|
|
2416
|
-
y === "select" ? /* @__PURE__ */
|
|
2417
|
-
|
|
2590
|
+
}, [S, n, o]), /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2591
|
+
a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2592
|
+
y === "select" ? /* @__PURE__ */ c(
|
|
2593
|
+
at,
|
|
2418
2594
|
{
|
|
2419
2595
|
disabled: !t,
|
|
2420
2596
|
allowClear: !0,
|
|
@@ -2422,11 +2598,11 @@ function Ti({ context: e }) {
|
|
|
2422
2598
|
style: { width: "100%" },
|
|
2423
2599
|
placeholder: m || "请选择",
|
|
2424
2600
|
options: d,
|
|
2425
|
-
value:
|
|
2601
|
+
value: ke(n),
|
|
2426
2602
|
onChange: (g) => r(g ?? "")
|
|
2427
2603
|
}
|
|
2428
|
-
) : y === "multiselect" ? /* @__PURE__ */
|
|
2429
|
-
|
|
2604
|
+
) : y === "multiselect" ? /* @__PURE__ */ c(
|
|
2605
|
+
at,
|
|
2430
2606
|
{
|
|
2431
2607
|
mode: "multiple",
|
|
2432
2608
|
disabled: !t,
|
|
@@ -2438,8 +2614,8 @@ function Ti({ context: e }) {
|
|
|
2438
2614
|
value: Q(n),
|
|
2439
2615
|
onChange: (g) => r(g ?? [])
|
|
2440
2616
|
}
|
|
2441
|
-
) : y === "checkbox" ? /* @__PURE__ */
|
|
2442
|
-
|
|
2617
|
+
) : y === "checkbox" ? /* @__PURE__ */ c(
|
|
2618
|
+
Jn.Group,
|
|
2443
2619
|
{
|
|
2444
2620
|
disabled: !t,
|
|
2445
2621
|
className: "form-block-preview-control",
|
|
@@ -2447,311 +2623,311 @@ function Ti({ context: e }) {
|
|
|
2447
2623
|
value: Q(n),
|
|
2448
2624
|
onChange: (g) => r(g)
|
|
2449
2625
|
}
|
|
2450
|
-
) : /* @__PURE__ */
|
|
2451
|
-
|
|
2626
|
+
) : /* @__PURE__ */ c(
|
|
2627
|
+
Yn.Group,
|
|
2452
2628
|
{
|
|
2453
2629
|
disabled: !t,
|
|
2454
2630
|
className: "form-block-preview-control",
|
|
2455
2631
|
options: d,
|
|
2456
|
-
value:
|
|
2632
|
+
value: ke(n),
|
|
2457
2633
|
onChange: (g) => r(g.target.value)
|
|
2458
2634
|
}
|
|
2459
2635
|
)
|
|
2460
2636
|
] });
|
|
2461
2637
|
}
|
|
2462
|
-
const
|
|
2638
|
+
const Vi = J(
|
|
2463
2639
|
{
|
|
2464
2640
|
name: "ChoicePicker",
|
|
2465
|
-
schema:
|
|
2466
|
-
label:
|
|
2467
|
-
variant:
|
|
2468
|
-
options:
|
|
2469
|
-
value:
|
|
2470
|
-
skoponPickerType:
|
|
2471
|
-
placeholder:
|
|
2641
|
+
schema: f.object({
|
|
2642
|
+
label: f.any().optional(),
|
|
2643
|
+
variant: f.any().optional(),
|
|
2644
|
+
options: f.any().optional(),
|
|
2645
|
+
value: f.any().optional(),
|
|
2646
|
+
skoponPickerType: f.any().optional(),
|
|
2647
|
+
placeholder: f.any().optional()
|
|
2472
2648
|
}).passthrough()
|
|
2473
2649
|
},
|
|
2474
|
-
|
|
2650
|
+
Li
|
|
2475
2651
|
);
|
|
2476
|
-
function
|
|
2652
|
+
function ji({ context: e }) {
|
|
2477
2653
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o } = ae(e, "value", {
|
|
2478
2654
|
component: "CheckBox",
|
|
2479
2655
|
changeAction: "change"
|
|
2480
|
-
}), i = e.componentModel.properties, s =
|
|
2481
|
-
return /* @__PURE__ */
|
|
2482
|
-
s ? /* @__PURE__ */
|
|
2483
|
-
/* @__PURE__ */
|
|
2484
|
-
|
|
2656
|
+
}), i = e.componentModel.properties, s = w(i.label);
|
|
2657
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2658
|
+
s ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2659
|
+
/* @__PURE__ */ c(
|
|
2660
|
+
Xn,
|
|
2485
2661
|
{
|
|
2486
2662
|
disabled: !t,
|
|
2487
2663
|
className: "form-block-preview-control",
|
|
2488
|
-
checked:
|
|
2664
|
+
checked: Fe(n),
|
|
2489
2665
|
onChange: (a) => r(a)
|
|
2490
2666
|
}
|
|
2491
2667
|
)
|
|
2492
2668
|
] });
|
|
2493
2669
|
}
|
|
2494
|
-
const
|
|
2495
|
-
{ name: "CheckBox", schema:
|
|
2496
|
-
|
|
2670
|
+
const $i = J(
|
|
2671
|
+
{ name: "CheckBox", schema: Ie("CheckBox") },
|
|
2672
|
+
ji
|
|
2497
2673
|
);
|
|
2498
|
-
function
|
|
2499
|
-
const r =
|
|
2674
|
+
function Di(e, t, n) {
|
|
2675
|
+
const r = ke(e);
|
|
2500
2676
|
if (!r) return;
|
|
2501
2677
|
if (!t && n) {
|
|
2502
|
-
const i =
|
|
2678
|
+
const i = Dt(r, "HH:mm", !0);
|
|
2503
2679
|
return i.isValid() ? i : void 0;
|
|
2504
2680
|
}
|
|
2505
|
-
const o =
|
|
2681
|
+
const o = Dt(r);
|
|
2506
2682
|
return o.isValid() ? o : void 0;
|
|
2507
2683
|
}
|
|
2508
|
-
function
|
|
2684
|
+
function Hi({ context: e }) {
|
|
2509
2685
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o, reportFocus: i } = ae(e, "value", {
|
|
2510
2686
|
component: "DateTimeInput",
|
|
2511
2687
|
changeAction: "change"
|
|
2512
|
-
}), s = e.componentModel.properties, a =
|
|
2688
|
+
}), s = e.componentModel.properties, a = w(s.label), l = w(s.placeholder), u = s.enableDate === !0, m = s.enableTime === !0, d = Di(n, u, m), v = (y) => {
|
|
2513
2689
|
if (!y) {
|
|
2514
2690
|
r("");
|
|
2515
2691
|
return;
|
|
2516
2692
|
}
|
|
2517
|
-
if (!
|
|
2693
|
+
if (!u && m) {
|
|
2518
2694
|
r(y.format("HH:mm"));
|
|
2519
2695
|
return;
|
|
2520
2696
|
}
|
|
2521
|
-
if (
|
|
2697
|
+
if (u && m) {
|
|
2522
2698
|
r(y.format("YYYY-MM-DDTHH:mm"));
|
|
2523
2699
|
return;
|
|
2524
2700
|
}
|
|
2525
2701
|
r(y.format("YYYY-MM-DD"));
|
|
2526
2702
|
};
|
|
2527
|
-
return /* @__PURE__ */
|
|
2528
|
-
a ? /* @__PURE__ */
|
|
2529
|
-
!
|
|
2530
|
-
|
|
2703
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2704
|
+
a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2705
|
+
!u && m ? /* @__PURE__ */ c(
|
|
2706
|
+
Qn,
|
|
2531
2707
|
{
|
|
2532
2708
|
disabled: !t,
|
|
2533
2709
|
className: "form-block-preview-control",
|
|
2534
2710
|
style: { width: "100%" },
|
|
2535
2711
|
placeholder: l || "选择时间",
|
|
2536
2712
|
value: d,
|
|
2537
|
-
onChange:
|
|
2713
|
+
onChange: v,
|
|
2538
2714
|
onFocus: i
|
|
2539
2715
|
}
|
|
2540
|
-
) : /* @__PURE__ */
|
|
2541
|
-
|
|
2716
|
+
) : /* @__PURE__ */ c(
|
|
2717
|
+
Zn,
|
|
2542
2718
|
{
|
|
2543
|
-
showTime:
|
|
2719
|
+
showTime: u && m,
|
|
2544
2720
|
disabled: !t,
|
|
2545
2721
|
className: "form-block-preview-control",
|
|
2546
2722
|
style: { width: "100%" },
|
|
2547
|
-
placeholder: l || (
|
|
2723
|
+
placeholder: l || (u && m ? "选择日期时间" : "选择日期"),
|
|
2548
2724
|
value: d,
|
|
2549
|
-
onChange:
|
|
2725
|
+
onChange: v,
|
|
2550
2726
|
onFocus: i
|
|
2551
2727
|
}
|
|
2552
2728
|
)
|
|
2553
2729
|
] });
|
|
2554
2730
|
}
|
|
2555
|
-
const
|
|
2731
|
+
const Ki = J(
|
|
2556
2732
|
{
|
|
2557
2733
|
name: "DateTimeInput",
|
|
2558
|
-
schema:
|
|
2559
|
-
label:
|
|
2560
|
-
enableDate:
|
|
2561
|
-
enableTime:
|
|
2562
|
-
placeholder:
|
|
2563
|
-
value:
|
|
2564
|
-
min:
|
|
2565
|
-
max:
|
|
2734
|
+
schema: f.object({
|
|
2735
|
+
label: f.any().optional(),
|
|
2736
|
+
enableDate: f.any().optional(),
|
|
2737
|
+
enableTime: f.any().optional(),
|
|
2738
|
+
placeholder: f.any().optional(),
|
|
2739
|
+
value: f.any().optional(),
|
|
2740
|
+
min: f.any().optional(),
|
|
2741
|
+
max: f.any().optional()
|
|
2566
2742
|
}).passthrough()
|
|
2567
2743
|
},
|
|
2568
|
-
|
|
2569
|
-
),
|
|
2744
|
+
Hi
|
|
2745
|
+
), Wi = {
|
|
2570
2746
|
name: "FileUpload",
|
|
2571
|
-
schema:
|
|
2572
|
-
label:
|
|
2573
|
-
accept:
|
|
2574
|
-
fileAcceptTypes:
|
|
2575
|
-
filePlaceholderIcon:
|
|
2576
|
-
minCount:
|
|
2577
|
-
maxCount:
|
|
2578
|
-
value:
|
|
2747
|
+
schema: f.object({
|
|
2748
|
+
label: f.any().optional(),
|
|
2749
|
+
accept: f.any().optional(),
|
|
2750
|
+
fileAcceptTypes: f.any().optional(),
|
|
2751
|
+
filePlaceholderIcon: f.any().optional(),
|
|
2752
|
+
minCount: f.any().optional(),
|
|
2753
|
+
maxCount: f.any().optional(),
|
|
2754
|
+
value: f.any().optional()
|
|
2579
2755
|
}).passthrough()
|
|
2580
2756
|
};
|
|
2581
|
-
function
|
|
2757
|
+
function Gi({ context: e }) {
|
|
2582
2758
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o } = ae(e, "value", {
|
|
2583
2759
|
component: "FileUpload",
|
|
2584
2760
|
changeAction: "change"
|
|
2585
|
-
}), i = e.componentModel.properties, s =
|
|
2761
|
+
}), i = e.componentModel.properties, s = w(i.label), a = w(i.accept), l = Array.isArray(i.fileAcceptTypes) ? i.fileAcceptTypes.map(String) : void 0, u = a ? a.split(",").map((p) => p.trim()).filter(Boolean) : void 0, m = Nr(l, u), d = typeof i.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
|
|
2586
2762
|
i.filePlaceholderIcon
|
|
2587
|
-
) ? i.filePlaceholderIcon : "document",
|
|
2588
|
-
return /* @__PURE__ */
|
|
2589
|
-
s ? /* @__PURE__ */
|
|
2590
|
-
/* @__PURE__ */
|
|
2591
|
-
|
|
2763
|
+
) ? i.filePlaceholderIcon : "document", v = typeof i.minCount == "number" ? Math.max(0, i.minCount) : 0, y = typeof i.maxCount == "number" ? i.maxCount : 1, S = y > 0, g = Q(n), k = S && g.length >= y, h = g.length < v;
|
|
2764
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2765
|
+
s ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2766
|
+
/* @__PURE__ */ x(
|
|
2767
|
+
Xe.Dragger,
|
|
2592
2768
|
{
|
|
2593
2769
|
disabled: !t || k,
|
|
2594
|
-
accept:
|
|
2770
|
+
accept: Mr(l, u),
|
|
2595
2771
|
className: "form-file-upload-preview",
|
|
2596
2772
|
showUploadList: t && g.length > 0,
|
|
2597
|
-
fileList: t ? g.map((
|
|
2598
|
-
uid: `${
|
|
2599
|
-
name:
|
|
2773
|
+
fileList: t ? g.map((p, b) => ({
|
|
2774
|
+
uid: `${b}-${p}`,
|
|
2775
|
+
name: p,
|
|
2600
2776
|
status: "done"
|
|
2601
2777
|
})) : [],
|
|
2602
|
-
beforeUpload: (
|
|
2603
|
-
if (!t) return
|
|
2604
|
-
const
|
|
2605
|
-
if (S &&
|
|
2606
|
-
const
|
|
2607
|
-
return r(
|
|
2778
|
+
beforeUpload: (p) => {
|
|
2779
|
+
if (!t) return Xe.LIST_IGNORE;
|
|
2780
|
+
const b = Q(Wt(e));
|
|
2781
|
+
if (S && b.length >= y) return Xe.LIST_IGNORE;
|
|
2782
|
+
const M = S ? [...b, p.name].slice(0, y) : [...b, p.name];
|
|
2783
|
+
return r(M), !1;
|
|
2608
2784
|
},
|
|
2609
|
-
onRemove: (
|
|
2610
|
-
const
|
|
2611
|
-
if (_.length <
|
|
2785
|
+
onRemove: (p) => {
|
|
2786
|
+
const b = Q(Wt(e)), M = /^(\d+)-/.exec(p.uid ?? ""), N = M ? Number(M[1]) : -1, _ = N >= 0 && N < b.length ? b.filter((z, C) => C !== N) : b.filter((z) => z !== p.name);
|
|
2787
|
+
if (_.length < v) return !1;
|
|
2612
2788
|
r(_);
|
|
2613
2789
|
},
|
|
2614
2790
|
children: [
|
|
2615
|
-
/* @__PURE__ */
|
|
2616
|
-
/* @__PURE__ */
|
|
2791
|
+
/* @__PURE__ */ c("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ c(Fi, { type: d, size: 40 }) }),
|
|
2792
|
+
/* @__PURE__ */ c("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
|
|
2617
2793
|
]
|
|
2618
2794
|
}
|
|
2619
2795
|
),
|
|
2620
|
-
/* @__PURE__ */
|
|
2796
|
+
/* @__PURE__ */ x(ee.Text, { type: "secondary", className: "form-block-preview-help", children: [
|
|
2621
2797
|
"允许:",
|
|
2622
2798
|
m ?? "全部类型",
|
|
2623
|
-
|
|
2799
|
+
v > 0 ? `;至少 ${v} 个文件` : "",
|
|
2624
2800
|
S ? `;最多 ${y} 个文件` : "",
|
|
2625
2801
|
";当前仅收集文件名(不含文件内容,需宿主另行上传)",
|
|
2626
|
-
|
|
2802
|
+
h && t ? `(当前 ${g.length} 个,未达下限)` : ""
|
|
2627
2803
|
] })
|
|
2628
2804
|
] });
|
|
2629
2805
|
}
|
|
2630
|
-
const
|
|
2631
|
-
|
|
2632
|
-
|
|
2806
|
+
const Ji = J(
|
|
2807
|
+
Wi,
|
|
2808
|
+
Gi
|
|
2633
2809
|
);
|
|
2634
|
-
function
|
|
2810
|
+
function Yi({ context: e }) {
|
|
2635
2811
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o, reportFocus: i } = ae(e, "value", {
|
|
2636
2812
|
component: "TextField",
|
|
2637
2813
|
changeAction: "change",
|
|
2638
2814
|
debounceChange: !0
|
|
2639
|
-
}), s = e.componentModel.properties, a =
|
|
2640
|
-
if (!m || !
|
|
2815
|
+
}), s = e.componentModel.properties, a = w(s.label), l = w(s.placeholder), u = w(s.variant) || "shortText", m = w(s.validationRegexp), d = ke(n) ?? "", v = !t, [y, S] = E(""), g = (p) => {
|
|
2816
|
+
if (!m || !p.trim()) {
|
|
2641
2817
|
S("");
|
|
2642
2818
|
return;
|
|
2643
2819
|
}
|
|
2644
|
-
S(
|
|
2820
|
+
S(wn(p, m) ? "" : "格式不正确");
|
|
2645
2821
|
};
|
|
2646
|
-
|
|
2822
|
+
B(() => {
|
|
2647
2823
|
g(d);
|
|
2648
2824
|
}, [m, d]);
|
|
2649
2825
|
const k = "form-block-preview-control";
|
|
2650
|
-
let
|
|
2651
|
-
if (
|
|
2652
|
-
|
|
2653
|
-
|
|
2826
|
+
let h;
|
|
2827
|
+
if (u === "longText")
|
|
2828
|
+
h = /* @__PURE__ */ c(
|
|
2829
|
+
Qe.TextArea,
|
|
2654
2830
|
{
|
|
2655
|
-
disabled:
|
|
2831
|
+
disabled: v,
|
|
2656
2832
|
className: k,
|
|
2657
2833
|
placeholder: l || "长文本回答...",
|
|
2658
2834
|
autoSize: { minRows: 2, maxRows: 6 },
|
|
2659
2835
|
value: d,
|
|
2660
2836
|
status: y ? "error" : void 0,
|
|
2661
|
-
onChange: (
|
|
2662
|
-
const
|
|
2663
|
-
r(
|
|
2837
|
+
onChange: (p) => {
|
|
2838
|
+
const b = p.target.value;
|
|
2839
|
+
r(b), g(b);
|
|
2664
2840
|
},
|
|
2665
2841
|
onFocus: i,
|
|
2666
|
-
onBlur: (
|
|
2842
|
+
onBlur: (p) => g(p.target.value)
|
|
2667
2843
|
}
|
|
2668
2844
|
);
|
|
2669
|
-
else if (
|
|
2670
|
-
const
|
|
2671
|
-
|
|
2672
|
-
|
|
2845
|
+
else if (u === "number") {
|
|
2846
|
+
const p = d && Number.isFinite(Number(d)) ? Number(d) : void 0;
|
|
2847
|
+
h = /* @__PURE__ */ c(
|
|
2848
|
+
er,
|
|
2673
2849
|
{
|
|
2674
|
-
disabled:
|
|
2850
|
+
disabled: v,
|
|
2675
2851
|
className: k,
|
|
2676
2852
|
style: { width: "100%" },
|
|
2677
2853
|
placeholder: l || "数字",
|
|
2678
|
-
value:
|
|
2679
|
-
onChange: (
|
|
2854
|
+
value: p,
|
|
2855
|
+
onChange: (b) => r(b == null ? "" : String(b)),
|
|
2680
2856
|
onFocus: i
|
|
2681
2857
|
}
|
|
2682
2858
|
);
|
|
2683
|
-
} else
|
|
2684
|
-
|
|
2859
|
+
} else u === "obscured" ? h = /* @__PURE__ */ c(
|
|
2860
|
+
Qe.Password,
|
|
2685
2861
|
{
|
|
2686
|
-
disabled:
|
|
2862
|
+
disabled: v,
|
|
2687
2863
|
className: k,
|
|
2688
2864
|
placeholder: l,
|
|
2689
2865
|
value: d,
|
|
2690
|
-
onChange: (
|
|
2866
|
+
onChange: (p) => r(p.target.value),
|
|
2691
2867
|
onFocus: i
|
|
2692
2868
|
}
|
|
2693
|
-
) :
|
|
2694
|
-
|
|
2869
|
+
) : h = /* @__PURE__ */ c(
|
|
2870
|
+
Qe,
|
|
2695
2871
|
{
|
|
2696
|
-
disabled:
|
|
2872
|
+
disabled: v,
|
|
2697
2873
|
className: k,
|
|
2698
2874
|
placeholder: l,
|
|
2699
2875
|
value: d,
|
|
2700
2876
|
status: y ? "error" : void 0,
|
|
2701
|
-
onChange: (
|
|
2702
|
-
const
|
|
2703
|
-
r(
|
|
2877
|
+
onChange: (p) => {
|
|
2878
|
+
const b = p.target.value;
|
|
2879
|
+
r(b), g(b);
|
|
2704
2880
|
},
|
|
2705
2881
|
onFocus: i,
|
|
2706
|
-
onBlur: (
|
|
2882
|
+
onBlur: (p) => g(p.target.value)
|
|
2707
2883
|
}
|
|
2708
2884
|
);
|
|
2709
|
-
return /* @__PURE__ */
|
|
2710
|
-
a ? /* @__PURE__ */
|
|
2711
|
-
|
|
2712
|
-
y ? /* @__PURE__ */
|
|
2885
|
+
return /* @__PURE__ */ x("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2886
|
+
a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2887
|
+
h,
|
|
2888
|
+
y ? /* @__PURE__ */ c(ee.Text, { type: "danger", className: "form-block-preview-help", children: y }) : null
|
|
2713
2889
|
] });
|
|
2714
2890
|
}
|
|
2715
|
-
const
|
|
2891
|
+
const Xi = J(
|
|
2716
2892
|
{
|
|
2717
2893
|
name: "TextField",
|
|
2718
|
-
schema:
|
|
2719
|
-
label:
|
|
2720
|
-
variant:
|
|
2721
|
-
placeholder:
|
|
2722
|
-
validationRegexp:
|
|
2723
|
-
value:
|
|
2894
|
+
schema: f.object({
|
|
2895
|
+
label: f.any().optional(),
|
|
2896
|
+
variant: f.any().optional(),
|
|
2897
|
+
placeholder: f.any().optional(),
|
|
2898
|
+
validationRegexp: f.any().optional(),
|
|
2899
|
+
value: f.any().optional()
|
|
2724
2900
|
}).passthrough()
|
|
2725
2901
|
},
|
|
2726
|
-
|
|
2902
|
+
Yi
|
|
2727
2903
|
);
|
|
2728
|
-
function
|
|
2729
|
-
const t = e.componentModel.properties, n =
|
|
2730
|
-
return
|
|
2904
|
+
function Qi({ context: e }) {
|
|
2905
|
+
const t = e.componentModel.properties, n = w(t.text), r = w(t.variant) || "body";
|
|
2906
|
+
return Ei.has(r) ? r === "caption" ? /* @__PURE__ */ c(ee.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(ee.Paragraph, { className: "form-block-preview-paragraph", children: n });
|
|
2731
2907
|
}
|
|
2732
|
-
const
|
|
2733
|
-
{ name: "Text", schema:
|
|
2734
|
-
|
|
2908
|
+
const Zi = J(
|
|
2909
|
+
{ name: "Text", schema: Ie("Text") },
|
|
2910
|
+
Qi
|
|
2735
2911
|
);
|
|
2736
|
-
function
|
|
2912
|
+
function Bn() {
|
|
2737
2913
|
const t = [
|
|
2738
|
-
...[...
|
|
2739
|
-
(r) => !
|
|
2914
|
+
...[...we.components.values()].filter(
|
|
2915
|
+
(r) => !Ii.has(r.name)
|
|
2740
2916
|
),
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
Si,
|
|
2745
|
-
ki,
|
|
2746
|
-
xi,
|
|
2747
|
-
Ni,
|
|
2748
|
-
Ei,
|
|
2917
|
+
Ri,
|
|
2918
|
+
qi,
|
|
2919
|
+
wi,
|
|
2749
2920
|
Pi,
|
|
2750
2921
|
zi,
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2922
|
+
Vi,
|
|
2923
|
+
$i,
|
|
2924
|
+
Ki,
|
|
2925
|
+
Ji,
|
|
2926
|
+
Xi,
|
|
2927
|
+
Zi,
|
|
2928
|
+
...zo()
|
|
2929
|
+
], n = [...we.functions.values()];
|
|
2930
|
+
return new cr(zn, t, n, we.themeSchema);
|
|
2755
2931
|
}
|
|
2756
2932
|
const ie = {
|
|
2757
2933
|
jade9: "#29a383",
|
|
@@ -2765,7 +2941,7 @@ const ie = {
|
|
|
2765
2941
|
primaryHover: "#26997b",
|
|
2766
2942
|
primaryActive: "#1d3b31",
|
|
2767
2943
|
onPrimary: "#ffffff"
|
|
2768
|
-
},
|
|
2944
|
+
}, es = {
|
|
2769
2945
|
cssVar: { key: "vidtempl" },
|
|
2770
2946
|
token: {
|
|
2771
2947
|
colorPrimary: ie.primarySolid,
|
|
@@ -2850,14 +3026,14 @@ const ie = {
|
|
|
2850
3026
|
}
|
|
2851
3027
|
}
|
|
2852
3028
|
};
|
|
2853
|
-
function
|
|
3029
|
+
function Ce({
|
|
2854
3030
|
children: e,
|
|
2855
3031
|
locale: t,
|
|
2856
3032
|
theme: n
|
|
2857
3033
|
}) {
|
|
2858
|
-
return /* @__PURE__ */
|
|
3034
|
+
return /* @__PURE__ */ c(tr, { theme: n ?? es, locale: t, children: e });
|
|
2859
3035
|
}
|
|
2860
|
-
const
|
|
3036
|
+
const ts = Hn(
|
|
2861
3037
|
function({
|
|
2862
3038
|
doc: t,
|
|
2863
3039
|
surfaceId: n = "skopon-form",
|
|
@@ -2867,68 +3043,68 @@ const Vi = Ln(
|
|
|
2867
3043
|
resumeSearch: s = null,
|
|
2868
3044
|
caseSearch: a = null,
|
|
2869
3045
|
wrapProvider: l = !0
|
|
2870
|
-
},
|
|
2871
|
-
|
|
2872
|
-
|
|
3046
|
+
}, u) {
|
|
3047
|
+
B(() => {
|
|
3048
|
+
sn(), on();
|
|
2873
3049
|
}, []);
|
|
2874
3050
|
const m = A(null), d = A(i);
|
|
2875
3051
|
d.current = i;
|
|
2876
|
-
const
|
|
2877
|
-
if (
|
|
3052
|
+
const v = V(() => {
|
|
3053
|
+
if (ft(t)) return "";
|
|
2878
3054
|
try {
|
|
2879
3055
|
return JSON.stringify(t);
|
|
2880
3056
|
} catch {
|
|
2881
3057
|
return String(t);
|
|
2882
3058
|
}
|
|
2883
|
-
}, [t]), y =
|
|
2884
|
-
if (!
|
|
3059
|
+
}, [t]), y = V(() => {
|
|
3060
|
+
if (!v)
|
|
2885
3061
|
return { surfaces: [], processor: null };
|
|
2886
3062
|
try {
|
|
2887
|
-
const
|
|
3063
|
+
const h = JSON.parse(v), p = new rn([Bn()]), b = Ko(h, {
|
|
2888
3064
|
surfaceId: n,
|
|
2889
|
-
catalogId:
|
|
3065
|
+
catalogId: zn
|
|
2890
3066
|
});
|
|
2891
|
-
return
|
|
2892
|
-
surfaces: Array.from(
|
|
2893
|
-
processor:
|
|
3067
|
+
return p.processMessages(b), {
|
|
3068
|
+
surfaces: Array.from(p.model.surfacesMap.values()),
|
|
3069
|
+
processor: p
|
|
2894
3070
|
};
|
|
2895
|
-
} catch (
|
|
2896
|
-
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败",
|
|
3071
|
+
} catch (h) {
|
|
3072
|
+
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", h), { surfaces: [], processor: null };
|
|
2897
3073
|
}
|
|
2898
|
-
}, [
|
|
2899
|
-
if (m.current = g,
|
|
2900
|
-
|
|
3074
|
+
}, [v, n]), { surfaces: S, processor: g } = y;
|
|
3075
|
+
if (m.current = g, Kn(
|
|
3076
|
+
u,
|
|
2901
3077
|
() => ({
|
|
2902
|
-
getValues(
|
|
2903
|
-
const
|
|
2904
|
-
if (!
|
|
2905
|
-
const
|
|
2906
|
-
return
|
|
3078
|
+
getValues(h) {
|
|
3079
|
+
const p = m.current;
|
|
3080
|
+
if (!p) return {};
|
|
3081
|
+
const b = (h ?? d.current).map((M) => M.trim()).filter(Boolean);
|
|
3082
|
+
return Yo(p, n, b);
|
|
2907
3083
|
},
|
|
2908
|
-
setValues(
|
|
2909
|
-
const
|
|
2910
|
-
if (!
|
|
2911
|
-
const
|
|
2912
|
-
if (
|
|
2913
|
-
for (const [
|
|
2914
|
-
const _ =
|
|
2915
|
-
_ &&
|
|
3084
|
+
setValues(h) {
|
|
3085
|
+
const p = m.current;
|
|
3086
|
+
if (!p) return;
|
|
3087
|
+
const b = p.model.surfacesMap.get(n);
|
|
3088
|
+
if (b)
|
|
3089
|
+
for (const [M, N] of Object.entries(h)) {
|
|
3090
|
+
const _ = M.trim();
|
|
3091
|
+
_ && b.dataModel.set(`/${_}`, N);
|
|
2916
3092
|
}
|
|
2917
3093
|
}
|
|
2918
3094
|
}),
|
|
2919
3095
|
[n]
|
|
2920
3096
|
), S.length === 0) {
|
|
2921
|
-
const
|
|
2922
|
-
return l ? /* @__PURE__ */
|
|
3097
|
+
const h = /* @__PURE__ */ c(mt, { resumeSearch: s, children: /* @__PURE__ */ c(ut, { caseSearch: a, children: /* @__PURE__ */ c(ct, { interactive: o, children: r }) }) });
|
|
3098
|
+
return l ? /* @__PURE__ */ c(Ce, { children: h }) : h;
|
|
2923
3099
|
}
|
|
2924
|
-
const k = /* @__PURE__ */
|
|
2925
|
-
return l ? /* @__PURE__ */
|
|
3100
|
+
const k = /* @__PURE__ */ c(mt, { resumeSearch: s, children: /* @__PURE__ */ c(ut, { caseSearch: a, children: /* @__PURE__ */ c(ct, { interactive: o, children: /* @__PURE__ */ c("div", { className: "a2ui-surface a2ui-container", children: S.map((h) => /* @__PURE__ */ c(nn, { surface: h }, h.id)) }) }) }) });
|
|
3101
|
+
return l ? /* @__PURE__ */ c(Ce, { children: k }) : k;
|
|
2926
3102
|
}
|
|
2927
3103
|
);
|
|
2928
|
-
function
|
|
2929
|
-
return new
|
|
3104
|
+
function Re() {
|
|
3105
|
+
return new rn([Bn()]);
|
|
2930
3106
|
}
|
|
2931
|
-
function
|
|
3107
|
+
function qs({
|
|
2932
3108
|
messages: e,
|
|
2933
3109
|
surfaceId: t = "skopon-form-stream",
|
|
2934
3110
|
emptyHint: n = null,
|
|
@@ -2936,84 +3112,84 @@ function _s({
|
|
|
2936
3112
|
resumeSearch: o = null,
|
|
2937
3113
|
caseSearch: i = null
|
|
2938
3114
|
}) {
|
|
2939
|
-
|
|
2940
|
-
|
|
3115
|
+
B(() => {
|
|
3116
|
+
sn(), on();
|
|
2941
3117
|
}, []);
|
|
2942
3118
|
const s = A(null);
|
|
2943
|
-
s.current === null && (s.current =
|
|
2944
|
-
const a = A(0), l = A(""),
|
|
2945
|
-
function d(
|
|
2946
|
-
s.current =
|
|
3119
|
+
s.current === null && (s.current = Re());
|
|
3120
|
+
const a = A(0), l = A(""), u = A(!0), m = A(t);
|
|
3121
|
+
function d(h, p) {
|
|
3122
|
+
s.current = h, a.current = p.length, l.current = JSON.stringify(p), u.current && (S(h), k(Array.from(h.model.surfacesMap.values())));
|
|
2947
3123
|
}
|
|
2948
|
-
function
|
|
2949
|
-
if (
|
|
2950
|
-
const
|
|
2951
|
-
if (!
|
|
3124
|
+
function v(h, p) {
|
|
3125
|
+
if (p <= 0) return !1;
|
|
3126
|
+
const b = JSON.stringify(h.slice(0, p)), M = l.current;
|
|
3127
|
+
if (!M) return !0;
|
|
2952
3128
|
try {
|
|
2953
|
-
const N = JSON.parse(
|
|
2954
|
-
return JSON.stringify(N.slice(0,
|
|
3129
|
+
const N = JSON.parse(M);
|
|
3130
|
+
return JSON.stringify(N.slice(0, p)) !== b;
|
|
2955
3131
|
} catch {
|
|
2956
3132
|
return !0;
|
|
2957
3133
|
}
|
|
2958
3134
|
}
|
|
2959
|
-
const [y, S] =
|
|
3135
|
+
const [y, S] = E(
|
|
2960
3136
|
() => s.current
|
|
2961
|
-
), [g, k] =
|
|
3137
|
+
), [g, k] = E(
|
|
2962
3138
|
() => Array.from(
|
|
2963
3139
|
s.current.model.surfacesMap.values()
|
|
2964
3140
|
)
|
|
2965
3141
|
);
|
|
2966
|
-
return
|
|
2967
|
-
|
|
2968
|
-
}), []),
|
|
3142
|
+
return B(() => (u.current = !0, () => {
|
|
3143
|
+
u.current = !1;
|
|
3144
|
+
}), []), B(() => {
|
|
2969
3145
|
s.current = y;
|
|
2970
|
-
}, [y]),
|
|
2971
|
-
const
|
|
2972
|
-
|
|
2973
|
-
},
|
|
3146
|
+
}, [y]), B(() => {
|
|
3147
|
+
const h = () => {
|
|
3148
|
+
u.current && k(Array.from(y.model.surfacesMap.values()));
|
|
3149
|
+
}, p = y.onSurfaceCreated(h), b = y.onSurfaceDeleted(h);
|
|
2974
3150
|
return () => {
|
|
2975
|
-
|
|
3151
|
+
p.unsubscribe(), b.unsubscribe();
|
|
2976
3152
|
};
|
|
2977
|
-
}, [y]),
|
|
2978
|
-
let
|
|
2979
|
-
const
|
|
2980
|
-
if (m.current = t,
|
|
2981
|
-
const _ =
|
|
2982
|
-
return Array.isArray(e) && e.length > 0 ? (_.processMessages(e),
|
|
2983
|
-
|
|
3153
|
+
}, [y]), B(() => {
|
|
3154
|
+
let h = !1;
|
|
3155
|
+
const p = m.current !== t;
|
|
3156
|
+
if (m.current = t, p) {
|
|
3157
|
+
const _ = Re();
|
|
3158
|
+
return Array.isArray(e) && e.length > 0 ? (_.processMessages(e), h || d(_, e)) : (s.current = _, a.current = 0, l.current = "", h || (S(_), k([]))), () => {
|
|
3159
|
+
h = !0;
|
|
2984
3160
|
};
|
|
2985
3161
|
}
|
|
2986
3162
|
if (!Array.isArray(e) || e.length === 0) {
|
|
2987
3163
|
if (a.current > 0) {
|
|
2988
|
-
const _ =
|
|
2989
|
-
s.current = _, a.current = 0, l.current = "",
|
|
3164
|
+
const _ = Re();
|
|
3165
|
+
s.current = _, a.current = 0, l.current = "", h || (S(_), k([]));
|
|
2990
3166
|
}
|
|
2991
3167
|
return () => {
|
|
2992
|
-
|
|
3168
|
+
h = !0;
|
|
2993
3169
|
};
|
|
2994
3170
|
}
|
|
2995
|
-
const
|
|
2996
|
-
if (e.length <
|
|
2997
|
-
const _ =
|
|
2998
|
-
return _.processMessages(e),
|
|
2999
|
-
|
|
3171
|
+
const b = s.current, M = a.current;
|
|
3172
|
+
if (e.length < M || v(e, M)) {
|
|
3173
|
+
const _ = Re();
|
|
3174
|
+
return _.processMessages(e), h || d(_, e), () => {
|
|
3175
|
+
h = !0;
|
|
3000
3176
|
};
|
|
3001
3177
|
}
|
|
3002
|
-
const N = e.slice(
|
|
3178
|
+
const N = e.slice(M);
|
|
3003
3179
|
return N.length === 0 ? () => {
|
|
3004
|
-
|
|
3005
|
-
} : (
|
|
3006
|
-
|
|
3180
|
+
h = !0;
|
|
3181
|
+
} : (b.processMessages(N), a.current = e.length, l.current = JSON.stringify(e), h || k(Array.from(b.model.surfacesMap.values())), () => {
|
|
3182
|
+
h = !0;
|
|
3007
3183
|
});
|
|
3008
|
-
}, [e, t]), g.length === 0 ? /* @__PURE__ */
|
|
3184
|
+
}, [e, t]), g.length === 0 ? /* @__PURE__ */ c(Ce, { children: n }) : /* @__PURE__ */ c(Ce, { children: /* @__PURE__ */ c(mt, { resumeSearch: o, children: /* @__PURE__ */ c(ut, { caseSearch: i, children: /* @__PURE__ */ c(ct, { interactive: r, children: /* @__PURE__ */ c("div", { className: "a2ui-surface a2ui-container", children: g.map((h) => /* @__PURE__ */ c(nn, { surface: h }, h.id)) }) }) }) }) });
|
|
3009
3185
|
}
|
|
3010
|
-
const
|
|
3011
|
-
function
|
|
3186
|
+
const ns = 100, rs = 3e4, os = 1500, pe = /* @__PURE__ */ new Map();
|
|
3187
|
+
function is(e) {
|
|
3012
3188
|
const t = e.trim();
|
|
3013
|
-
let n =
|
|
3014
|
-
return n || (n = new
|
|
3189
|
+
let n = pe.get(t);
|
|
3190
|
+
return n || (n = new ss(t), pe.set(t, n)), n.acquire(), n;
|
|
3015
3191
|
}
|
|
3016
|
-
class
|
|
3192
|
+
class ss {
|
|
3017
3193
|
constructor(t) {
|
|
3018
3194
|
G(this, "url");
|
|
3019
3195
|
G(this, "ws", null);
|
|
@@ -3031,12 +3207,12 @@ class Hi {
|
|
|
3031
3207
|
}
|
|
3032
3208
|
release() {
|
|
3033
3209
|
this.refCount = Math.max(0, this.refCount - 1), !(this.refCount > 0) && (this.clearReleaseTimer(), this.releaseTimer = setTimeout(() => {
|
|
3034
|
-
this.releaseTimer = null, !(this.refCount > 0) && (this.teardown(),
|
|
3035
|
-
},
|
|
3210
|
+
this.releaseTimer = null, !(this.refCount > 0) && (this.teardown(), pe.get(this.url) === this && pe.delete(this.url));
|
|
3211
|
+
}, os));
|
|
3036
3212
|
}
|
|
3037
3213
|
/** 强制关闭(测试用),跳过宽限期。 */
|
|
3038
3214
|
forceClose() {
|
|
3039
|
-
this.refCount = 0, this.teardown(),
|
|
3215
|
+
this.refCount = 0, this.teardown(), pe.get(this.url) === this && pe.delete(this.url);
|
|
3040
3216
|
}
|
|
3041
3217
|
subscribe(t, n) {
|
|
3042
3218
|
const r = t.trim();
|
|
@@ -3105,7 +3281,7 @@ class Hi {
|
|
|
3105
3281
|
}
|
|
3106
3282
|
}
|
|
3107
3283
|
enqueue(t) {
|
|
3108
|
-
for (this.sendQueue.push(t); this.sendQueue.length >
|
|
3284
|
+
for (this.sendQueue.push(t); this.sendQueue.length > ns; )
|
|
3109
3285
|
this.sendQueue.shift();
|
|
3110
3286
|
}
|
|
3111
3287
|
flushQueue() {
|
|
@@ -3119,7 +3295,7 @@ class Hi {
|
|
|
3119
3295
|
if (!this.connectRequested || this.refCount <= 0) return;
|
|
3120
3296
|
this.clearReconnectTimer();
|
|
3121
3297
|
const t = Math.min(
|
|
3122
|
-
|
|
3298
|
+
rs,
|
|
3123
3299
|
1e3 * 2 ** Math.min(this.reconnectAttempt, 5)
|
|
3124
3300
|
);
|
|
3125
3301
|
this.reconnectAttempt += 1, this.reconnectTimer = setTimeout(() => {
|
|
@@ -3157,13 +3333,13 @@ class Hi {
|
|
|
3157
3333
|
}
|
|
3158
3334
|
}
|
|
3159
3335
|
}
|
|
3160
|
-
class
|
|
3336
|
+
class as {
|
|
3161
3337
|
constructor(t) {
|
|
3162
3338
|
G(this, "askUserMessageId");
|
|
3163
3339
|
G(this, "connection");
|
|
3164
3340
|
G(this, "unsubscribe");
|
|
3165
3341
|
G(this, "closed", !1);
|
|
3166
|
-
this.askUserMessageId = t.askUserMessageId.trim(), this.connection =
|
|
3342
|
+
this.askUserMessageId = t.askUserMessageId.trim(), this.connection = is(t.url);
|
|
3167
3343
|
const n = t.onAutoControl;
|
|
3168
3344
|
this.unsubscribe = n ? this.connection.subscribe(this.askUserMessageId, n) : () => {
|
|
3169
3345
|
};
|
|
@@ -3178,24 +3354,24 @@ class Ki {
|
|
|
3178
3354
|
this.closed || (this.closed = !0, this.unsubscribe(), this.connection.release());
|
|
3179
3355
|
}
|
|
3180
3356
|
}
|
|
3181
|
-
function
|
|
3357
|
+
function qn(e) {
|
|
3182
3358
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
3183
3359
|
}
|
|
3184
|
-
function
|
|
3360
|
+
function ls(e, t) {
|
|
3185
3361
|
if (!e) return !1;
|
|
3186
|
-
const n = e.querySelector(`[data-skopon-field="${
|
|
3362
|
+
const n = e.querySelector(`[data-skopon-field="${qn(t)}"]`);
|
|
3187
3363
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
3188
3364
|
'input, textarea, select, button, [tabindex]:not([tabindex="-1"])'
|
|
3189
3365
|
) ?? n).focus(), !0) : !1;
|
|
3190
3366
|
}
|
|
3191
|
-
function
|
|
3367
|
+
function cs(e, t) {
|
|
3192
3368
|
if (!e) return !1;
|
|
3193
|
-
const n = e.querySelector(`[data-skopon-field="${
|
|
3369
|
+
const n = e.querySelector(`[data-skopon-field="${qn(t)}"]`);
|
|
3194
3370
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
3195
3371
|
'button, [role="button"], .skopon-resume-select-card, input, label'
|
|
3196
3372
|
) ?? n).click(), !0) : !1;
|
|
3197
3373
|
}
|
|
3198
|
-
function
|
|
3374
|
+
function us(e, t, n) {
|
|
3199
3375
|
const r = e.action;
|
|
3200
3376
|
if (r !== "change" && r !== "select" && r !== "focus" && r !== "click" && r !== "submit") {
|
|
3201
3377
|
console.warn("[FormAutoControl] unknown action", r);
|
|
@@ -3225,47 +3401,47 @@ function Wi(e, t, n) {
|
|
|
3225
3401
|
return;
|
|
3226
3402
|
}
|
|
3227
3403
|
if (r === "focus") {
|
|
3228
|
-
|
|
3404
|
+
ls(t.rootElement, o), n.reportEvent({
|
|
3229
3405
|
action: "focus",
|
|
3230
3406
|
component: i,
|
|
3231
3407
|
field: o
|
|
3232
3408
|
});
|
|
3233
3409
|
return;
|
|
3234
3410
|
}
|
|
3235
|
-
|
|
3411
|
+
cs(t.rootElement, o) || console.warn("[FormAutoControl] click target not found", o);
|
|
3236
3412
|
});
|
|
3237
3413
|
}
|
|
3238
|
-
function
|
|
3414
|
+
function ms(e) {
|
|
3239
3415
|
const t = {};
|
|
3240
3416
|
for (const [n, r] of Object.entries(e))
|
|
3241
3417
|
r !== void 0 && (t[n] = r);
|
|
3242
3418
|
return t;
|
|
3243
3419
|
}
|
|
3244
|
-
function
|
|
3420
|
+
function ds(e, t) {
|
|
3245
3421
|
var o;
|
|
3246
3422
|
const n = (o = e.name) == null ? void 0 : o.trim();
|
|
3247
3423
|
if (!n || !t) return { ...e };
|
|
3248
3424
|
const r = t.get(n);
|
|
3249
3425
|
return r ? e.type !== "resume_multiselect" && e.type !== "case_multiselect" ? { ...e } : { ...e, options: r.map((i) => ({ ...i })) } : { ...e };
|
|
3250
3426
|
}
|
|
3251
|
-
function
|
|
3427
|
+
function ps(e) {
|
|
3252
3428
|
var i, s;
|
|
3253
3429
|
const n = {
|
|
3254
3430
|
blocks: (e.blocks ?? []).map(
|
|
3255
|
-
(a) =>
|
|
3431
|
+
(a) => ds(a, e.liveOptions)
|
|
3256
3432
|
)
|
|
3257
3433
|
}, r = (i = e.title) == null ? void 0 : i.trim(), o = (s = e.description) == null ? void 0 : s.trim();
|
|
3258
3434
|
return r && (n.title = r), o && (n.description = o), {
|
|
3259
3435
|
form_schema: n,
|
|
3260
|
-
form_values:
|
|
3436
|
+
form_values: ms(e.values ?? {}),
|
|
3261
3437
|
form_change: [...e.formChange ?? []]
|
|
3262
3438
|
};
|
|
3263
3439
|
}
|
|
3264
|
-
function
|
|
3265
|
-
const t =
|
|
3266
|
-
return t ?
|
|
3440
|
+
function fs(e) {
|
|
3441
|
+
const t = Ve(e);
|
|
3442
|
+
return t ? Be(t.blocks) : e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
3267
3443
|
}
|
|
3268
|
-
function
|
|
3444
|
+
function hs({
|
|
3269
3445
|
payload: e,
|
|
3270
3446
|
callbackUrl: t,
|
|
3271
3447
|
title: n,
|
|
@@ -3275,17 +3451,17 @@ function es({
|
|
|
3275
3451
|
submitHeaders: s,
|
|
3276
3452
|
onNotify: a
|
|
3277
3453
|
}) {
|
|
3278
|
-
const [l,
|
|
3279
|
-
|
|
3454
|
+
const [l, u] = E(!1), m = A(!0);
|
|
3455
|
+
B(() => (m.current = !0, () => {
|
|
3280
3456
|
m.current = !1;
|
|
3281
3457
|
}), []);
|
|
3282
|
-
const d =
|
|
3283
|
-
() =>
|
|
3458
|
+
const d = V(
|
|
3459
|
+
() => Mt(s),
|
|
3284
3460
|
[s]
|
|
3285
|
-
),
|
|
3286
|
-
() =>
|
|
3461
|
+
), v = V(
|
|
3462
|
+
() => Nn(e, t, d),
|
|
3287
3463
|
[e, t, d]
|
|
3288
|
-
), y =
|
|
3464
|
+
), y = V(
|
|
3289
3465
|
() => ({
|
|
3290
3466
|
...i,
|
|
3291
3467
|
callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? t ?? null
|
|
@@ -3294,36 +3470,36 @@ function es({
|
|
|
3294
3470
|
);
|
|
3295
3471
|
async function S() {
|
|
3296
3472
|
if (!l) {
|
|
3297
|
-
|
|
3473
|
+
u(!0);
|
|
3298
3474
|
try {
|
|
3299
|
-
const g =
|
|
3475
|
+
const g = fs(e), k = Ft({
|
|
3300
3476
|
context: y,
|
|
3301
3477
|
payload: e,
|
|
3302
3478
|
answer: g
|
|
3303
|
-
}),
|
|
3479
|
+
}), h = await Rn(k, {
|
|
3304
3480
|
headers: d
|
|
3305
3481
|
});
|
|
3306
3482
|
if (!m.current) return;
|
|
3307
|
-
const
|
|
3308
|
-
a == null || a(
|
|
3483
|
+
const p = Un(h);
|
|
3484
|
+
a == null || a(p.type, p.message);
|
|
3309
3485
|
} catch (g) {
|
|
3310
3486
|
if (!m.current) return;
|
|
3311
3487
|
const k = g instanceof Error ? g.message : "提交失败";
|
|
3312
3488
|
a == null || a("error", k);
|
|
3313
3489
|
} finally {
|
|
3314
|
-
m.current &&
|
|
3490
|
+
m.current && u(!1);
|
|
3315
3491
|
}
|
|
3316
3492
|
}
|
|
3317
3493
|
}
|
|
3318
|
-
return /* @__PURE__ */
|
|
3319
|
-
/* @__PURE__ */
|
|
3320
|
-
/* @__PURE__ */
|
|
3321
|
-
/* @__PURE__ */
|
|
3322
|
-
r ? /* @__PURE__ */
|
|
3323
|
-
o ? /* @__PURE__ */
|
|
3494
|
+
return /* @__PURE__ */ x("div", { className: "ask-user-curl-card", children: [
|
|
3495
|
+
/* @__PURE__ */ x("div", { className: "ask-user-curl-card-header", children: [
|
|
3496
|
+
/* @__PURE__ */ x("div", { className: "ask-user-curl-card-header-title", children: [
|
|
3497
|
+
/* @__PURE__ */ c(ee.Text, { type: "secondary", children: n ?? "curl 命令" }),
|
|
3498
|
+
r ? /* @__PURE__ */ c(fe, { title: r, children: /* @__PURE__ */ c(ye, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
|
|
3499
|
+
o ? /* @__PURE__ */ c(fe, { title: o, children: /* @__PURE__ */ c(ye, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
|
|
3324
3500
|
] }),
|
|
3325
|
-
/* @__PURE__ */
|
|
3326
|
-
|
|
3501
|
+
/* @__PURE__ */ c(fe, { title: "提交到 answer_agent_callback_url", children: /* @__PURE__ */ c(
|
|
3502
|
+
Te,
|
|
3327
3503
|
{
|
|
3328
3504
|
size: "small",
|
|
3329
3505
|
type: "text",
|
|
@@ -3334,11 +3510,11 @@ function es({
|
|
|
3334
3510
|
}
|
|
3335
3511
|
) })
|
|
3336
3512
|
] }),
|
|
3337
|
-
/* @__PURE__ */
|
|
3513
|
+
/* @__PURE__ */ c("pre", { className: "skopon-form-curl-json", children: v })
|
|
3338
3514
|
] });
|
|
3339
3515
|
}
|
|
3340
|
-
const
|
|
3341
|
-
function
|
|
3516
|
+
const gs = 80;
|
|
3517
|
+
function ys(e, t) {
|
|
3342
3518
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
3343
3519
|
const n = t.message;
|
|
3344
3520
|
if (typeof n == "string" && n.trim())
|
|
@@ -3346,7 +3522,7 @@ function ns(e, t) {
|
|
|
3346
3522
|
}
|
|
3347
3523
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
3348
3524
|
}
|
|
3349
|
-
function
|
|
3525
|
+
function vs({
|
|
3350
3526
|
payload: e,
|
|
3351
3527
|
formUniqueId: t,
|
|
3352
3528
|
askUserMessageId: n,
|
|
@@ -3356,263 +3532,263 @@ function rs({
|
|
|
3356
3532
|
submitHeaders: s,
|
|
3357
3533
|
fetchFormDetail: a,
|
|
3358
3534
|
onNotify: l,
|
|
3359
|
-
resumeSearch:
|
|
3535
|
+
resumeSearch: u = null,
|
|
3360
3536
|
caseSearch: m = null,
|
|
3361
3537
|
onSurfaceReadyChange: d,
|
|
3362
|
-
onAutoControlReady:
|
|
3538
|
+
onAutoControlReady: v
|
|
3363
3539
|
}) {
|
|
3364
|
-
const [y, S] =
|
|
3540
|
+
const [y, S] = E(null), [g, k] = E(!1), [h, p] = E(!0), [b, M] = E(!1), N = A(null), _ = A(null), z = A(!0), C = A(l);
|
|
3365
3541
|
C.current = l;
|
|
3366
|
-
const
|
|
3367
|
-
() =>
|
|
3542
|
+
const q = hn(), L = vt(), re = A(""), K = A(null), $ = (t == null ? void 0 : t.trim()) ?? "", Y = (n == null ? void 0 : n.trim()) ?? "", te = V(
|
|
3543
|
+
() => Mt(s),
|
|
3368
3544
|
[s]
|
|
3369
|
-
),
|
|
3545
|
+
), ne = V(
|
|
3370
3546
|
() => ({
|
|
3371
3547
|
...i,
|
|
3372
3548
|
callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? r ?? null
|
|
3373
3549
|
}),
|
|
3374
3550
|
[i, r]
|
|
3375
3551
|
);
|
|
3376
|
-
|
|
3552
|
+
B(() => (z.current = !0, () => {
|
|
3377
3553
|
z.current = !1, K.current != null && (clearTimeout(K.current), K.current = null);
|
|
3378
|
-
}), []),
|
|
3379
|
-
let
|
|
3380
|
-
return $ ? (
|
|
3381
|
-
|
|
3554
|
+
}), []), B(() => {
|
|
3555
|
+
let F = !1;
|
|
3556
|
+
return $ ? (p(!0), k(!1), a({ formUniqueId: $ }).then((O) => {
|
|
3557
|
+
F || (k(!!O.disabled), S(O.formDefinition ?? null));
|
|
3382
3558
|
}).catch((O) => {
|
|
3383
|
-
var
|
|
3384
|
-
if (!
|
|
3559
|
+
var W;
|
|
3560
|
+
if (!F) {
|
|
3385
3561
|
k(!1), S(null);
|
|
3386
|
-
const
|
|
3387
|
-
(
|
|
3562
|
+
const Ee = O instanceof Error ? O.message : "获取表单定义失败";
|
|
3563
|
+
(W = C.current) == null || W.call(C, "error", Ee);
|
|
3388
3564
|
}
|
|
3389
3565
|
}).finally(() => {
|
|
3390
|
-
|
|
3566
|
+
F || p(!1);
|
|
3391
3567
|
}), () => {
|
|
3392
|
-
|
|
3393
|
-
}) : (
|
|
3394
|
-
|
|
3568
|
+
F = !0;
|
|
3569
|
+
}) : (p(!1), k(!1), S(null), () => {
|
|
3570
|
+
F = !0;
|
|
3395
3571
|
});
|
|
3396
3572
|
}, [$, a]);
|
|
3397
|
-
const
|
|
3398
|
-
if (D &&
|
|
3399
|
-
return
|
|
3400
|
-
const
|
|
3401
|
-
return { ...
|
|
3573
|
+
const U = V(() => Ve(e), [e]), P = V(() => U ? ti(U, y ?? void 0) : null, [U, y]), T = (P == null ? void 0 : P.matchedBlocks) ?? [], D = !!(U && ni(U) && T.length === 0), R = V(() => D && U ? ri(U) : P && P.renderBlocks.length > 0 ? P.renderBlocks : [], [P, D, U]), I = V(() => {
|
|
3574
|
+
if (D && U)
|
|
3575
|
+
return oi(U);
|
|
3576
|
+
const F = Be((P == null ? void 0 : P.extraBlocks) ?? []);
|
|
3577
|
+
return { ...Be(
|
|
3402
3578
|
((P == null ? void 0 : P.matchedBlocks) ?? []).filter(
|
|
3403
|
-
(
|
|
3579
|
+
(W) => W.type === "text" && W.hidden === !0
|
|
3404
3580
|
)
|
|
3405
|
-
), ...
|
|
3406
|
-
}, [D,
|
|
3407
|
-
() =>
|
|
3581
|
+
), ...F };
|
|
3582
|
+
}, [D, U, P]), X = V(
|
|
3583
|
+
() => R.filter((F) => {
|
|
3408
3584
|
var O;
|
|
3409
|
-
return Z(
|
|
3410
|
-
}).map((
|
|
3411
|
-
[
|
|
3412
|
-
), ce = (P == null ? void 0 : P.title) ?? (
|
|
3585
|
+
return Z(F.type) && ((O = F.name) == null ? void 0 : O.trim());
|
|
3586
|
+
}).map((F) => F.name.trim()),
|
|
3587
|
+
[R]
|
|
3588
|
+
), ce = (P == null ? void 0 : P.title) ?? (U == null ? void 0 : U.title) ?? "", ue = (P == null ? void 0 : P.description) ?? (U == null ? void 0 : U.description) ?? "", me = V(() => R.length === 0 ? null : Go(
|
|
3413
3589
|
{ title: ce, description: ue },
|
|
3414
|
-
|
|
3415
|
-
), [ce, ue,
|
|
3590
|
+
R
|
|
3591
|
+
), [ce, ue, R]), De = V(() => {
|
|
3416
3592
|
if (!me) return "";
|
|
3417
3593
|
try {
|
|
3418
3594
|
return JSON.stringify(me);
|
|
3419
3595
|
} catch {
|
|
3420
3596
|
return String(me);
|
|
3421
3597
|
}
|
|
3422
|
-
}, [me]),
|
|
3423
|
-
|
|
3424
|
-
const
|
|
3598
|
+
}, [me]), He = $ ? `ask-user-${$}` : "ask-user-payload", oe = !!(!h && U && R.length > 0 && me);
|
|
3599
|
+
B(() => (d(oe), () => d(!1)), [oe, d]);
|
|
3600
|
+
const Et = j(() => {
|
|
3425
3601
|
var O;
|
|
3426
|
-
return { ...((O = N.current) == null ? void 0 : O.getValues(
|
|
3427
|
-
}, [
|
|
3428
|
-
|
|
3429
|
-
const
|
|
3430
|
-
|
|
3602
|
+
return { ...((O = N.current) == null ? void 0 : O.getValues(X)) ?? {}, ...I };
|
|
3603
|
+
}, [X, I]), Ut = A(L.liveOptions);
|
|
3604
|
+
Ut.current = L.liveOptions;
|
|
3605
|
+
const Ke = A(L.pendingChangeFields);
|
|
3606
|
+
Ke.current = L.pendingChangeFields;
|
|
3431
3607
|
const he = j(
|
|
3432
|
-
(
|
|
3433
|
-
const O =
|
|
3608
|
+
(F) => {
|
|
3609
|
+
const O = ps({
|
|
3434
3610
|
title: ce,
|
|
3435
3611
|
description: ue,
|
|
3436
|
-
blocks:
|
|
3437
|
-
values:
|
|
3438
|
-
liveOptions:
|
|
3439
|
-
formChange:
|
|
3612
|
+
blocks: R,
|
|
3613
|
+
values: Et(),
|
|
3614
|
+
liveOptions: Ut.current,
|
|
3615
|
+
formChange: F
|
|
3440
3616
|
});
|
|
3441
|
-
|
|
3617
|
+
q.reportData(O);
|
|
3442
3618
|
},
|
|
3443
|
-
[ce, ue,
|
|
3444
|
-
),
|
|
3445
|
-
|
|
3619
|
+
[ce, ue, R, Et, q]
|
|
3620
|
+
), We = A(he);
|
|
3621
|
+
We.current = he, B(() => {
|
|
3446
3622
|
if (!oe) {
|
|
3447
3623
|
re.current = "";
|
|
3448
3624
|
return;
|
|
3449
3625
|
}
|
|
3450
|
-
if (!
|
|
3451
|
-
const
|
|
3452
|
-
if (re.current ===
|
|
3626
|
+
if (!De) return;
|
|
3627
|
+
const F = `${He}::${De}`;
|
|
3628
|
+
if (re.current === F) return;
|
|
3453
3629
|
const O = setTimeout(() => {
|
|
3454
|
-
z.current && re.current !==
|
|
3630
|
+
z.current && re.current !== F && (re.current = F, We.current([]));
|
|
3455
3631
|
}, 0);
|
|
3456
3632
|
return () => clearTimeout(O);
|
|
3457
|
-
}, [oe,
|
|
3458
|
-
if (!(!oe ||
|
|
3633
|
+
}, [oe, He, De]), B(() => {
|
|
3634
|
+
if (!(!oe || L.version === 0) && Ke.current.length !== 0)
|
|
3459
3635
|
return K.current != null && clearTimeout(K.current), K.current = setTimeout(() => {
|
|
3460
3636
|
if (K.current = null, !z.current) return;
|
|
3461
|
-
const
|
|
3462
|
-
|
|
3463
|
-
},
|
|
3637
|
+
const F = [...Ke.current];
|
|
3638
|
+
L.clearPendingChangeFields(), F.length !== 0 && We.current(F);
|
|
3639
|
+
}, gs), () => {
|
|
3464
3640
|
K.current != null && (clearTimeout(K.current), K.current = null);
|
|
3465
3641
|
};
|
|
3466
|
-
}, [oe,
|
|
3467
|
-
const
|
|
3468
|
-
var
|
|
3469
|
-
if (!
|
|
3470
|
-
|
|
3642
|
+
}, [oe, L.version, L.clearPendingChangeFields]);
|
|
3643
|
+
const Ge = j(async () => {
|
|
3644
|
+
var F, O, W, Ee, Pt, zt, Ot, Bt;
|
|
3645
|
+
if (!b) {
|
|
3646
|
+
M(!0);
|
|
3471
3647
|
try {
|
|
3472
|
-
const ge = { ...((
|
|
3473
|
-
if (
|
|
3474
|
-
(O = C.current) == null || O.call(C, "error",
|
|
3648
|
+
const ge = { ...((F = N.current) == null ? void 0 : F.getValues(X)) ?? {}, ...I }, qt = Mi(R, ge);
|
|
3649
|
+
if (qt) {
|
|
3650
|
+
(O = C.current) == null || O.call(C, "error", qt.message);
|
|
3475
3651
|
return;
|
|
3476
3652
|
}
|
|
3477
3653
|
if (o === "post") {
|
|
3478
|
-
const
|
|
3479
|
-
if (
|
|
3480
|
-
(
|
|
3654
|
+
const $t = (r ?? "").trim();
|
|
3655
|
+
if (!$t) {
|
|
3656
|
+
(W = C.current) == null || W.call(C, "error", "callback_url 为空,无法提交");
|
|
3481
3657
|
return;
|
|
3482
3658
|
}
|
|
3483
|
-
he([]),
|
|
3659
|
+
he([]), q.reportEvent({
|
|
3484
3660
|
action: "submit",
|
|
3485
3661
|
component: "SubmitButton"
|
|
3486
3662
|
});
|
|
3487
|
-
const
|
|
3488
|
-
headers:
|
|
3663
|
+
const Ye = await Fn($t, ge, {
|
|
3664
|
+
headers: te
|
|
3489
3665
|
});
|
|
3490
3666
|
if (!z.current) return;
|
|
3491
|
-
|
|
3667
|
+
Ye.ok ? (Ee = C.current) == null || Ee.call(C, "success", "提交成功") : (Pt = C.current) == null || Pt.call(C, "error", ys(Ye.status, Ye.body));
|
|
3492
3668
|
return;
|
|
3493
3669
|
}
|
|
3494
|
-
const
|
|
3670
|
+
const Ln = R.length > 0 ? {
|
|
3495
3671
|
title: ce,
|
|
3496
3672
|
description: ue,
|
|
3497
|
-
blocks:
|
|
3498
|
-
} :
|
|
3499
|
-
context:
|
|
3673
|
+
blocks: R
|
|
3674
|
+
} : U ?? void 0, Lt = Ft({
|
|
3675
|
+
context: ne,
|
|
3500
3676
|
payload: e,
|
|
3501
|
-
form:
|
|
3677
|
+
form: Ln,
|
|
3502
3678
|
answer: ge
|
|
3503
|
-
}),
|
|
3504
|
-
if (
|
|
3505
|
-
(
|
|
3679
|
+
}), Vt = It(Lt);
|
|
3680
|
+
if (Vt) {
|
|
3681
|
+
(zt = C.current) == null || zt.call(C, "error", Vt);
|
|
3506
3682
|
return;
|
|
3507
3683
|
}
|
|
3508
|
-
he([]),
|
|
3684
|
+
he([]), q.reportEvent({
|
|
3509
3685
|
action: "submit",
|
|
3510
3686
|
component: "SubmitButton"
|
|
3511
3687
|
});
|
|
3512
|
-
const
|
|
3513
|
-
headers:
|
|
3688
|
+
const Vn = await Rn(Lt, {
|
|
3689
|
+
headers: te
|
|
3514
3690
|
});
|
|
3515
3691
|
if (!z.current) return;
|
|
3516
|
-
const
|
|
3517
|
-
(
|
|
3692
|
+
const jt = Un(Vn);
|
|
3693
|
+
(Ot = C.current) == null || Ot.call(C, jt.type, jt.message);
|
|
3518
3694
|
} catch (Je) {
|
|
3519
3695
|
if (!z.current) return;
|
|
3520
3696
|
const ge = Je instanceof Error ? Je.message : "提交失败";
|
|
3521
|
-
(
|
|
3697
|
+
(Bt = C.current) == null || Bt.call(C, "error", ge);
|
|
3522
3698
|
} finally {
|
|
3523
|
-
z.current &&
|
|
3699
|
+
z.current && M(!1);
|
|
3524
3700
|
}
|
|
3525
3701
|
}
|
|
3526
3702
|
}, [
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3703
|
+
b,
|
|
3704
|
+
X,
|
|
3705
|
+
R,
|
|
3530
3706
|
ce,
|
|
3531
3707
|
ue,
|
|
3532
|
-
|
|
3708
|
+
I,
|
|
3533
3709
|
he,
|
|
3534
|
-
|
|
3710
|
+
q,
|
|
3535
3711
|
o,
|
|
3536
3712
|
r,
|
|
3537
|
-
ee,
|
|
3538
3713
|
te,
|
|
3714
|
+
ne,
|
|
3539
3715
|
e,
|
|
3540
|
-
|
|
3541
|
-
]),
|
|
3542
|
-
|
|
3543
|
-
const
|
|
3544
|
-
(
|
|
3545
|
-
|
|
3546
|
-
|
|
3716
|
+
U
|
|
3717
|
+
]), Rt = A(Ge);
|
|
3718
|
+
Rt.current = Ge;
|
|
3719
|
+
const wt = j(
|
|
3720
|
+
(F) => {
|
|
3721
|
+
us(
|
|
3722
|
+
F,
|
|
3547
3723
|
{
|
|
3548
3724
|
setValues: (O) => {
|
|
3549
|
-
var
|
|
3550
|
-
return (
|
|
3725
|
+
var W;
|
|
3726
|
+
return (W = N.current) == null ? void 0 : W.setValues(O);
|
|
3551
3727
|
},
|
|
3552
3728
|
getValues: (O) => {
|
|
3553
|
-
var
|
|
3554
|
-
return ((
|
|
3729
|
+
var W;
|
|
3730
|
+
return ((W = N.current) == null ? void 0 : W.getValues(O)) ?? {};
|
|
3555
3731
|
},
|
|
3556
|
-
submit: () =>
|
|
3732
|
+
submit: () => Rt.current(),
|
|
3557
3733
|
rootElement: _.current
|
|
3558
3734
|
},
|
|
3559
3735
|
{
|
|
3560
|
-
reportEvent:
|
|
3561
|
-
runAutoControl:
|
|
3736
|
+
reportEvent: q.reportEvent,
|
|
3737
|
+
runAutoControl: q.runAutoControl
|
|
3562
3738
|
}
|
|
3563
3739
|
);
|
|
3564
3740
|
},
|
|
3565
|
-
[
|
|
3741
|
+
[q]
|
|
3566
3742
|
);
|
|
3567
|
-
return
|
|
3743
|
+
return B(() => {
|
|
3568
3744
|
if (!oe) {
|
|
3569
|
-
|
|
3745
|
+
v(null);
|
|
3570
3746
|
return;
|
|
3571
3747
|
}
|
|
3572
|
-
return
|
|
3573
|
-
}, [oe,
|
|
3574
|
-
|
|
3748
|
+
return v(wt), () => v(null);
|
|
3749
|
+
}, [oe, wt, v]), h ? /* @__PURE__ */ c("div", { className: "ask-user-form-card", children: /* @__PURE__ */ c(ht, { size: "small" }) }) : !U || R.length === 0 ? /* @__PURE__ */ c(
|
|
3750
|
+
hs,
|
|
3575
3751
|
{
|
|
3576
3752
|
payload: e,
|
|
3577
3753
|
callbackUrl: r,
|
|
3578
|
-
answerAgentContext:
|
|
3754
|
+
answerAgentContext: ne,
|
|
3579
3755
|
submitHeaders: s,
|
|
3580
3756
|
unpublishedFormId: g && $ ? $ : void 0,
|
|
3581
3757
|
onNotify: l
|
|
3582
3758
|
}
|
|
3583
|
-
) : /* @__PURE__ */
|
|
3759
|
+
) : /* @__PURE__ */ x(
|
|
3584
3760
|
"div",
|
|
3585
3761
|
{
|
|
3586
3762
|
className: "ask-user-form-card",
|
|
3587
3763
|
ref: _,
|
|
3588
|
-
"data-ask-user-message-id":
|
|
3764
|
+
"data-ask-user-message-id": Y || void 0,
|
|
3589
3765
|
children: [
|
|
3590
|
-
g && $ ? /* @__PURE__ */
|
|
3591
|
-
/* @__PURE__ */
|
|
3592
|
-
|
|
3766
|
+
g && $ ? /* @__PURE__ */ c("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ c(fe, { title: $, children: /* @__PURE__ */ c(ye, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
|
|
3767
|
+
/* @__PURE__ */ c(
|
|
3768
|
+
ts,
|
|
3593
3769
|
{
|
|
3594
3770
|
ref: N,
|
|
3595
3771
|
doc: me,
|
|
3596
|
-
surfaceId:
|
|
3597
|
-
fieldNames:
|
|
3772
|
+
surfaceId: He,
|
|
3773
|
+
fieldNames: X,
|
|
3598
3774
|
interactive: !0,
|
|
3599
3775
|
wrapProvider: !1,
|
|
3600
|
-
resumeSearch:
|
|
3776
|
+
resumeSearch: u,
|
|
3601
3777
|
caseSearch: m
|
|
3602
3778
|
}
|
|
3603
3779
|
),
|
|
3604
|
-
/* @__PURE__ */
|
|
3605
|
-
|
|
3780
|
+
/* @__PURE__ */ c("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ c(
|
|
3781
|
+
fe,
|
|
3606
3782
|
{
|
|
3607
3783
|
title: o === "post" ? "提交 JSON 到 callback_url" : "提交到 answer_agent_callback_url",
|
|
3608
|
-
children: /* @__PURE__ */
|
|
3609
|
-
|
|
3784
|
+
children: /* @__PURE__ */ c(
|
|
3785
|
+
Te,
|
|
3610
3786
|
{
|
|
3611
3787
|
type: "primary",
|
|
3612
3788
|
size: "small",
|
|
3613
|
-
loading:
|
|
3614
|
-
disabled:
|
|
3615
|
-
onClick: () => void
|
|
3789
|
+
loading: b,
|
|
3790
|
+
disabled: b,
|
|
3791
|
+
onClick: () => void Ge(),
|
|
3616
3792
|
children: "提交"
|
|
3617
3793
|
}
|
|
3618
3794
|
)
|
|
@@ -3622,16 +3798,16 @@ function rs({
|
|
|
3622
3798
|
}
|
|
3623
3799
|
);
|
|
3624
3800
|
}
|
|
3625
|
-
function
|
|
3626
|
-
var
|
|
3627
|
-
const t = ((
|
|
3801
|
+
function Ls(e) {
|
|
3802
|
+
var u;
|
|
3803
|
+
const t = ((u = e.askUserMessageId) == null ? void 0 : u.trim()) ?? "", n = V(() => pi(), []), [r, o] = E(!1), i = A(null), s = j((m) => {
|
|
3628
3804
|
o(m);
|
|
3629
3805
|
}, []), a = j(
|
|
3630
3806
|
(m) => {
|
|
3631
3807
|
i.current = m;
|
|
3632
3808
|
},
|
|
3633
3809
|
[]
|
|
3634
|
-
), l =
|
|
3810
|
+
), l = V(() => !n || !t ? null : new as({
|
|
3635
3811
|
url: n,
|
|
3636
3812
|
askUserMessageId: t,
|
|
3637
3813
|
onAutoControl: (m) => {
|
|
@@ -3639,15 +3815,15 @@ function Ts(e) {
|
|
|
3639
3815
|
(d = i.current) == null || d.call(i, m);
|
|
3640
3816
|
}
|
|
3641
3817
|
}), [n, t]);
|
|
3642
|
-
return
|
|
3818
|
+
return B(() => {
|
|
3643
3819
|
if (l)
|
|
3644
3820
|
return () => {
|
|
3645
3821
|
l.close();
|
|
3646
3822
|
};
|
|
3647
|
-
}, [l]),
|
|
3823
|
+
}, [l]), B(() => {
|
|
3648
3824
|
!l || !r || l.connect();
|
|
3649
|
-
}, [l, r]), /* @__PURE__ */
|
|
3650
|
-
|
|
3825
|
+
}, [l, r]), /* @__PURE__ */ c(Ce, { children: /* @__PURE__ */ c(to, { client: l, children: /* @__PURE__ */ c(Xr, { children: /* @__PURE__ */ c(
|
|
3826
|
+
vs,
|
|
3651
3827
|
{
|
|
3652
3828
|
...e,
|
|
3653
3829
|
onSurfaceReadyChange: s,
|
|
@@ -3656,71 +3832,77 @@ function Ts(e) {
|
|
|
3656
3832
|
) }) }) });
|
|
3657
3833
|
}
|
|
3658
3834
|
export {
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
lt as
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3835
|
+
Is as A2UI_PROTOCOL_VERSION,
|
|
3836
|
+
Ls as AskUserFormCard,
|
|
3837
|
+
ut as CaseSearchProvider,
|
|
3838
|
+
hs as CurlSubmitBlock,
|
|
3839
|
+
ui as DEFAULT_ANSWER_AGENT_CALLBACK_URL,
|
|
3840
|
+
li as DEFAULT_AUTH_ANSWER_AGENT_CALLBACK_URL_FIELD,
|
|
3841
|
+
ci as DEFAULT_AUTH_REALTIME_WS_URL_FIELD,
|
|
3842
|
+
_t as DEFAULT_AUTH_STORAGE_KEY,
|
|
3843
|
+
ai as DEFAULT_AUTH_TOKEN_FIELD,
|
|
3844
|
+
ur as FORM_MEDIA_SIZES,
|
|
3845
|
+
lt as FORM_WEB_DEFAULT_HEIGHT,
|
|
3846
|
+
pr as FORM_WEB_MAX_HEIGHT,
|
|
3847
|
+
dr as FORM_WEB_MIN_HEIGHT,
|
|
3848
|
+
mt as ResumeSearchProvider,
|
|
3849
|
+
qs as SkoponA2uiStreamRenderer,
|
|
3850
|
+
Ce as SkoponFormProvider,
|
|
3851
|
+
ts as SkoponFormRenderer,
|
|
3852
|
+
Ho as a2uiToBlocks,
|
|
3853
|
+
An as blocksToA2ui,
|
|
3854
|
+
Hr as blocksToJsonSchema,
|
|
3855
|
+
Ft as buildAnswerAgentBody,
|
|
3856
|
+
ii as buildAskUserCurlBodyJson,
|
|
3857
|
+
si as buildAskUserCurlStatement,
|
|
3858
|
+
Ps as buildAskUserSubmitCurlFromPayload,
|
|
3859
|
+
Go as buildAskUserSurface,
|
|
3860
|
+
Nn as buildCurlStatement,
|
|
3861
|
+
Fe as coerceToggleValue,
|
|
3862
|
+
zs as copyTextToClipboard,
|
|
3863
|
+
Ti as createCaseSearchClient,
|
|
3864
|
+
Rs as createEmptyBlock,
|
|
3865
|
+
Us as createEmptyFormDefinition,
|
|
3866
|
+
fi as createFormClient,
|
|
3867
|
+
ki as createResumeSearchClient,
|
|
3868
|
+
Bs as createSkoponSdkClients,
|
|
3869
|
+
Be as extractExtraBlockValues,
|
|
3870
|
+
Yo as extractSurfaceValues,
|
|
3871
|
+
Un as formatAnswerAgentSubmitMessage,
|
|
3872
|
+
oi as getPayloadHiddenBlockValues,
|
|
3873
|
+
ws as getPayloadInputFieldNames,
|
|
3874
|
+
ri as getPayloadRenderableBlocks,
|
|
3875
|
+
ti as intersectPayloadBlocksWithForm,
|
|
3876
|
+
ft as isA2uiSurfaceEmpty,
|
|
3877
|
+
ln as isDisplayBlockType,
|
|
3699
3878
|
Z as isInputBlockType,
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3879
|
+
an as isLayoutBlockType,
|
|
3880
|
+
ve as isMediaBlockType,
|
|
3881
|
+
mr as isOptionsBlockType,
|
|
3882
|
+
fr as isSupportedWebUrl,
|
|
3883
|
+
be as isWebBlockType,
|
|
3884
|
+
Jo as mapFormDefinitionFromDto,
|
|
3885
|
+
qe as normalizeFormDefinition,
|
|
3705
3886
|
de as normalizeMultiselectCount,
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3887
|
+
xe as normalizeWebHeight,
|
|
3888
|
+
Ve as parsePayloadBlocksJson,
|
|
3889
|
+
ni as payloadHasInputBlocks,
|
|
3890
|
+
di as resolveAnswerAgentCallbackUrl,
|
|
3891
|
+
Nt as resolveClientHeaders,
|
|
3892
|
+
pi as resolveRealtimeWsUrl,
|
|
3893
|
+
$r as resolveSchemaDefaultValue,
|
|
3894
|
+
In as resolveSkoponAuthHeaders,
|
|
3895
|
+
Mt as resolveSubmitAuthHeaders,
|
|
3896
|
+
Wo as resolveSurfaceFromFormDefinition,
|
|
3897
|
+
es as skoponAntdTheme,
|
|
3716
3898
|
ie as skoponBrandColors,
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3899
|
+
Rn as submitAnswerAgent,
|
|
3900
|
+
Fn as submitFormJson,
|
|
3901
|
+
Es as supportsDefaultValue,
|
|
3902
|
+
Ko as surfaceDocToMessages,
|
|
3903
|
+
Se as syncFormDefinition,
|
|
3904
|
+
oo as useCaseSearch,
|
|
3905
|
+
ho as useResumeSearch,
|
|
3906
|
+
It as validateAnswerAgentBody,
|
|
3907
|
+
Os as validateAnswerAgentContext
|
|
3726
3908
|
};
|