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