@skopon-cool/form-sdk 0.2.3 → 0.2.5
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 +8 -1
- package/dist/client/authStorage.d.ts.map +1 -1
- package/dist/components/AskUserFormCard.d.ts +3 -1
- package/dist/components/AskUserFormCard.d.ts.map +1 -1
- package/dist/components/CurlSubmitBlock.d.ts +3 -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 +1098 -1007
- package/dist/submit/buildAnswerAgentBody.d.ts +4 -0
- package/dist/submit/buildAnswerAgentBody.d.ts.map +1 -1
- package/dist/submit/buildCurlStatement.d.ts +4 -3
- package/dist/submit/buildCurlStatement.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 +45 -1
- package/src/client/authStorage.ts +19 -2
- package/src/components/AskUserFormCard.tsx +22 -8
- package/src/components/CurlSubmitBlock.tsx +32 -24
- package/src/index.ts +5 -0
- package/src/submit/buildAnswerAgentBody.ts +37 -0
- package/src/submit/buildCurlStatement.ts +20 -3
- package/src/submit/submit.test.ts +163 -7
- package/src/submit/submitAnswerAgent.ts +87 -13
package/dist/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import './form-sdk.css';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { Spin as
|
|
5
|
-
import { ReloadOutlined as
|
|
6
|
-
import { createBinderlessComponentImplementation as
|
|
2
|
+
import { jsx as c, jsxs as C } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as He, useContext as Ke, useCallback as ne, useSyncExternalStore as en, useMemo as w, useState as P, useRef as O, useEffect as B, forwardRef as tn, useImperativeHandle as nn } from "react";
|
|
4
|
+
import { Spin as Ge, Button as ke, Typography as D, Avatar as rn, Tag as oe, Select as qe, Checkbox as on, Radio as an, Switch as sn, TimePicker as ln, DatePicker as cn, Upload as Ne, Input as Me, InputNumber as un, ConfigProvider as mn, Tooltip as re } from "antd";
|
|
5
|
+
import { ReloadOutlined as yt, FileTextOutlined as vt, UserOutlined as dn, FileImageOutlined as pn, FileExcelOutlined as fn, FileOutlined as bt, PictureOutlined as hn, SoundOutlined as gn, VideoCameraOutlined as yn } from "@ant-design/icons";
|
|
6
|
+
import { createBinderlessComponentImplementation as j, basicCatalog as ge, A2uiSurface as St } from "@a2ui/react/v0_9";
|
|
7
7
|
import { z as f } from "zod";
|
|
8
|
-
import { Catalog as
|
|
9
|
-
import { injectBasicCatalogStyles as
|
|
10
|
-
import { injectStyles as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
8
|
+
import { Catalog as vn, MessageProcessor as kt } from "@a2ui/web_core/v0_9";
|
|
9
|
+
import { injectBasicCatalogStyles as At } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
10
|
+
import { injectStyles as Ct } from "@a2ui/react/styles";
|
|
11
|
+
import ut from "dayjs";
|
|
12
|
+
const Zo = "v0.9", bn = [
|
|
13
13
|
"huge",
|
|
14
14
|
"large",
|
|
15
15
|
"medium",
|
|
16
16
|
"small",
|
|
17
17
|
"icon"
|
|
18
18
|
];
|
|
19
|
-
function
|
|
19
|
+
function ye(e) {
|
|
20
20
|
return e === "image" || e === "video" || e === "audio";
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Ae(e) {
|
|
23
23
|
return e === "heading" || e === "paragraph";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return !
|
|
25
|
+
function W(e) {
|
|
26
|
+
return !Ae(e) && !ye(e);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Sn() {
|
|
29
29
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
30
30
|
return crypto.randomUUID();
|
|
31
31
|
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
|
|
@@ -39,11 +39,11 @@ function 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 = Sn().replace(/-/g, "").slice(0, 8);
|
|
44
44
|
return `${e}${t}`;
|
|
45
45
|
}
|
|
46
|
-
const
|
|
46
|
+
const xt = [
|
|
47
47
|
{ value: "image/*", label: "图片" },
|
|
48
48
|
{ value: "video/*", label: "视频" },
|
|
49
49
|
{ value: "audio/*", label: "音频" },
|
|
@@ -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
|
+
], kn = {
|
|
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
|
+
}, An = {
|
|
78
78
|
"image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
|
|
79
79
|
"video/*": [".mp4", ".mov", ".avi", ".webm"],
|
|
80
80
|
"audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
|
|
@@ -85,14 +85,14 @@ const St = [
|
|
|
85
85
|
"text/plain": [".txt"],
|
|
86
86
|
"application/zip": [".zip", ".7z"],
|
|
87
87
|
"application/x-rar-compressed": [".rar"]
|
|
88
|
-
},
|
|
88
|
+
}, Cn = {
|
|
89
89
|
"application/msword": "office/word",
|
|
90
90
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
|
|
91
91
|
"application/vnd.ms-excel": "office/excel",
|
|
92
92
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
|
|
93
93
|
"application/vnd.ms-powerpoint": "office/ppt",
|
|
94
94
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
|
|
95
|
-
},
|
|
95
|
+
}, Je = [
|
|
96
96
|
{ value: ".jpg", label: ".jpg" },
|
|
97
97
|
{ value: ".jpeg", label: ".jpeg" },
|
|
98
98
|
{ value: ".png", label: ".png" },
|
|
@@ -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
|
-
],
|
|
122
|
-
|
|
123
|
-
),
|
|
124
|
-
|
|
125
|
-
),
|
|
126
|
-
|
|
121
|
+
], xn = Object.fromEntries(
|
|
122
|
+
xt.map((e) => [e.value, e.label])
|
|
123
|
+
), _n = Object.fromEntries(
|
|
124
|
+
Je.map((e) => [e.value, e.label])
|
|
125
|
+
), Tn = new Set(xt.map((e) => e.value)), In = new Set(
|
|
126
|
+
Je.map((e) => e.value)
|
|
127
127
|
);
|
|
128
|
-
function
|
|
128
|
+
function Nn(e) {
|
|
129
129
|
const t = e.trim();
|
|
130
|
-
return t ?
|
|
130
|
+
return t ? Tn.has(t) ? t : Cn[t] ?? null : null;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function Mn(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 = Nn(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 Fn(e) {
|
|
148
|
+
const t = se(e), n = [];
|
|
149
149
|
for (const r of t)
|
|
150
|
-
n.push(...
|
|
150
|
+
n.push(...kn[r] ?? [r]);
|
|
151
151
|
return n;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
const t =
|
|
153
|
+
function Un(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 An[r] ?? [])
|
|
159
159
|
n.add(o);
|
|
160
|
-
return
|
|
160
|
+
return Je.filter((r) => n.has(r.value));
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
const n =
|
|
162
|
+
function Ye(e, t) {
|
|
163
|
+
const n = Mn(t), r = se(e);
|
|
164
164
|
if (r.length === 0)
|
|
165
|
-
return n.filter((i) =>
|
|
165
|
+
return n.filter((i) => In.has(i));
|
|
166
166
|
const o = new Set(
|
|
167
|
-
|
|
167
|
+
Un(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 Pn(e, t) {
|
|
172
|
+
const n = Fn(e), r = Ye(e, t), o = [...n, ...r];
|
|
173
173
|
return o.length > 0 ? o.join(",") : void 0;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
const n =
|
|
175
|
+
function En(e, t) {
|
|
176
|
+
const n = se(e), r = Ye(
|
|
177
177
|
n,
|
|
178
178
|
t
|
|
179
179
|
), o = [
|
|
180
|
-
...n.map((i) =>
|
|
181
|
-
...r.map((i) =>
|
|
180
|
+
...n.map((i) => xn[i] ?? i),
|
|
181
|
+
...r.map((i) => _n[i] ?? i)
|
|
182
182
|
];
|
|
183
183
|
return o.length === 0 ? null : o.join("、");
|
|
184
184
|
}
|
|
185
|
-
const
|
|
185
|
+
const zn = [
|
|
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
|
+
], Rn = new Set(zn);
|
|
193
|
+
function wn(e) {
|
|
194
|
+
return e && Rn.has(e) ? e : "file";
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
return typeof e == "string" &&
|
|
196
|
+
function le(e) {
|
|
197
|
+
return typeof e == "string" && bn.includes(e) ? e : "medium";
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function Bn(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 qn(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 On(e) {
|
|
210
|
+
return `form-media-size-${le(e)}`;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
return `form-media-preview form-media-list ${
|
|
212
|
+
function Ln(e) {
|
|
213
|
+
return `form-media-preview form-media-list ${On(e)}`;
|
|
214
214
|
}
|
|
215
|
-
const
|
|
216
|
-
function
|
|
215
|
+
const jn = 10;
|
|
216
|
+
function We(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 mt(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 pe(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 Vn(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 $n(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 Dn(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 Hn(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 Kn(e) {
|
|
253
253
|
var o, i;
|
|
254
|
-
const t =
|
|
254
|
+
const t = Hn(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: ye(r) ? Bn(t, jn) : void 0,
|
|
264
|
+
mediaSize: ye(r) ? le(t.mediaSize) : void 0,
|
|
265
265
|
fileAcceptTypes: n,
|
|
266
|
-
fileAcceptExtensions:
|
|
266
|
+
fileAcceptExtensions: Ye(
|
|
267
267
|
n,
|
|
268
268
|
t.fileAcceptExtensions
|
|
269
269
|
),
|
|
270
|
-
filePlaceholderIcon:
|
|
271
|
-
fileMinCount: r === "file" ?
|
|
272
|
-
fileMaxCount: r === "file" ?
|
|
273
|
-
defaultValue:
|
|
270
|
+
filePlaceholderIcon: wn(t.filePlaceholderIcon),
|
|
271
|
+
fileMinCount: r === "file" ? mt(t.fileMinCount, 1) : void 0,
|
|
272
|
+
fileMaxCount: r === "file" ? mt(t.fileMaxCount, 1) : void 0,
|
|
273
|
+
defaultValue: Vn(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 ? pe(t.resumeMinCount, 1) : void 0,
|
|
283
|
+
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? pe(t.resumeMaxCount, 1) : void 0,
|
|
284
|
+
resumeFilter: r === "resume_multiselect" ? Dn(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 ? pe(t.caseMinCount, 1) : void 0,
|
|
287
|
+
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? pe(t.caseMaxCount, 1) : void 0,
|
|
288
|
+
caseFilter: r === "case_multiselect" ? $n(t.caseFilter) : void 0
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function ve(e) {
|
|
292
292
|
return {
|
|
293
293
|
title: e.title ?? "",
|
|
294
294
|
description: e.description ?? "",
|
|
@@ -296,18 +296,18 @@ function ge(e) {
|
|
|
296
296
|
jsonSchema: e.jsonSchema ?? {}
|
|
297
297
|
};
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function Q(e) {
|
|
300
300
|
if (!e || !Array.isArray(e.blocks))
|
|
301
|
-
return
|
|
302
|
-
const t = e.blocks.map(
|
|
303
|
-
return
|
|
301
|
+
return ve({ title: "", description: "", blocks: [], jsonSchema: {} });
|
|
302
|
+
const t = e.blocks.map(Kn);
|
|
303
|
+
return ve({
|
|
304
304
|
title: typeof e.title == "string" ? e.title : "",
|
|
305
305
|
description: typeof e.description == "string" ? e.description : "",
|
|
306
306
|
blocks: t,
|
|
307
|
-
jsonSchema:
|
|
307
|
+
jsonSchema: We(e.jsonSchema)
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function Gn(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 dt(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 Jn(e, t) {
|
|
328
|
+
var a, s, l, u, m, d;
|
|
329
329
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
330
330
|
return i({
|
|
331
331
|
id: n,
|
|
@@ -337,17 +337,17 @@ 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
|
-
flowUniqueIds: ((
|
|
343
|
-
pageSize: ((
|
|
342
|
+
flowUniqueIds: ((m = e.caseFilter) == null ? void 0 : m.flowUniqueIds) ?? [],
|
|
343
|
+
pageSize: ((d = e.caseFilter) == null ? void 0 : d.pageSize) ?? 20
|
|
344
344
|
},
|
|
345
345
|
...e.caseMinCount !== void 0 ? { minCount: e.caseMinCount } : {},
|
|
346
346
|
...e.caseMaxCount !== void 0 ? { maxCount: e.caseMaxCount } : {},
|
|
347
347
|
value: { path: o }
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function Yn(e, t, n) {
|
|
351
351
|
const r = n.nameFromValue(e.value), o = {
|
|
352
352
|
...t("case_multiselect"),
|
|
353
353
|
name: r,
|
|
@@ -355,109 +355,109 @@ 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 = Gn(e.caseFilter));
|
|
359
|
+
const s = dt(e.minCount);
|
|
360
360
|
s !== void 0 && (o.caseMinCount = s);
|
|
361
|
-
const
|
|
362
|
-
return
|
|
361
|
+
const l = dt(e.maxCount);
|
|
362
|
+
return l !== void 0 && (o.caseMaxCount = l), o;
|
|
363
363
|
}
|
|
364
|
-
const
|
|
365
|
-
function
|
|
364
|
+
const _t = He({ interactive: !0 });
|
|
365
|
+
function Oe({
|
|
366
366
|
interactive: e,
|
|
367
367
|
children: t
|
|
368
368
|
}) {
|
|
369
|
-
return /* @__PURE__ */
|
|
369
|
+
return /* @__PURE__ */ c(_t.Provider, { value: { interactive: e }, children: t });
|
|
370
370
|
}
|
|
371
|
-
function
|
|
372
|
-
return
|
|
371
|
+
function K() {
|
|
372
|
+
return Ke(_t);
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function Tt(e) {
|
|
375
375
|
return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function pt(e, t = "value") {
|
|
378
378
|
const r = e.componentModel.properties[t];
|
|
379
|
-
if (!(!
|
|
379
|
+
if (!(!Tt(r) || r === void 0))
|
|
380
380
|
return e.dataContext.resolveDynamicValue(r);
|
|
381
381
|
}
|
|
382
|
-
function
|
|
383
|
-
const r = e.componentModel.properties[t], o =
|
|
382
|
+
function G(e, t = "value") {
|
|
383
|
+
const r = e.componentModel.properties[t], o = Tt(r), i = ne(
|
|
384
384
|
(u) => {
|
|
385
385
|
if (!o || r === void 0) return () => {
|
|
386
386
|
};
|
|
387
|
-
const
|
|
388
|
-
return () =>
|
|
387
|
+
const m = e.dataContext.subscribeDynamicValue(r, () => u());
|
|
388
|
+
return () => m.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 = en(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 L(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 It(e, t) {
|
|
410
|
+
return t ? Array.isArray(e) ? null : L(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 be(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 Nt(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;
|
|
422
422
|
}
|
|
423
423
|
return r !== void 0 && e.length >= r ? null : [...e, t];
|
|
424
424
|
}
|
|
425
|
-
function
|
|
425
|
+
function Mt(e, t, n, r, o) {
|
|
426
426
|
if (!n) return !0;
|
|
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 Ft(e, t) {
|
|
431
431
|
return t === void 0 || e.length <= t ? null : e.slice(0, t);
|
|
432
432
|
}
|
|
433
|
-
const
|
|
434
|
-
function
|
|
433
|
+
const Ut = He(null);
|
|
434
|
+
function Le({
|
|
435
435
|
caseSearch: e,
|
|
436
436
|
children: t
|
|
437
437
|
}) {
|
|
438
|
-
return /* @__PURE__ */
|
|
438
|
+
return /* @__PURE__ */ c(Ut.Provider, { value: e ?? null, children: t });
|
|
439
439
|
}
|
|
440
|
-
function
|
|
441
|
-
return
|
|
440
|
+
function Wn() {
|
|
441
|
+
return Ke(Ut);
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function Fe(e) {
|
|
444
444
|
return typeof e == "string" ? e : "";
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function Ue(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
|
-
function
|
|
452
|
+
function Pe(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 Xn(e) {
|
|
458
458
|
return JSON.stringify(e);
|
|
459
459
|
}
|
|
460
|
-
const
|
|
460
|
+
const Qn = {
|
|
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 Zn({
|
|
474
474
|
item: e,
|
|
475
475
|
selected: t,
|
|
476
476
|
disabled: n,
|
|
477
477
|
onToggle: r
|
|
478
478
|
}) {
|
|
479
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ C(
|
|
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(vt, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
|
|
488
|
+
/* @__PURE__ */ C("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__ */ C("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,105 +498,105 @@ function Kn({
|
|
|
498
498
|
}
|
|
499
499
|
);
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
const { interactive: t } =
|
|
503
|
-
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
}, [
|
|
507
|
-
const
|
|
508
|
-
async (
|
|
509
|
-
const
|
|
510
|
-
if (!n || !
|
|
511
|
-
|
|
501
|
+
function er({ context: e }) {
|
|
502
|
+
const { interactive: t } = K(), n = Wn(), { value: r, setValue: o } = G(e), i = e.componentModel.properties, a = Fe(i.label), s = Fe(i.placeholder), l = Fe(i.help), u = i.enableRefresh !== !1, m = be(i.minCount), d = be(i.maxCount), b = w(() => Ue(i.caseFilter), [i.caseFilter]), h = Xn(b), [x, _] = P(1), [y, p] = P(!1), [v, A] = P(""), [g, I] = P([]), [U, V] = P(0), [M, F] = P(b.pageSize ?? 20), $ = O(0), E = L(r);
|
|
503
|
+
B(() => {
|
|
504
|
+
const k = Ft(E, d);
|
|
505
|
+
k !== null && o(k);
|
|
506
|
+
}, [d, E, o]);
|
|
507
|
+
const q = w(() => n ? Pe(b) ? v || s || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, b, v, s]), J = ne(
|
|
508
|
+
async (k) => {
|
|
509
|
+
const R = Ue(JSON.parse(h)), T = ++$.current;
|
|
510
|
+
if (!n || !Pe(R)) {
|
|
511
|
+
I([]), V(0), A(""), p(!1);
|
|
512
512
|
return;
|
|
513
513
|
}
|
|
514
|
-
p(!0),
|
|
514
|
+
p(!0), A("");
|
|
515
515
|
try {
|
|
516
|
-
const
|
|
517
|
-
if (
|
|
518
|
-
|
|
519
|
-
} catch (
|
|
520
|
-
if (
|
|
521
|
-
|
|
516
|
+
const S = await n({ filter: R, page: k });
|
|
517
|
+
if (T !== $.current) return;
|
|
518
|
+
I(S.list), V(S.total), _(S.page), F(S.pageSize);
|
|
519
|
+
} catch (S) {
|
|
520
|
+
if (T !== $.current) return;
|
|
521
|
+
I([]), V(0), A(S instanceof Error ? S.message : "加载案例列表失败");
|
|
522
522
|
} finally {
|
|
523
|
-
|
|
523
|
+
T === $.current && p(!1);
|
|
524
524
|
}
|
|
525
525
|
},
|
|
526
526
|
[n, h]
|
|
527
527
|
);
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}, [h,
|
|
531
|
-
const
|
|
528
|
+
B(() => {
|
|
529
|
+
_(1), J(1);
|
|
530
|
+
}, [h, J]);
|
|
531
|
+
const X = (k) => {
|
|
532
532
|
if (!t) return;
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
533
|
+
const R = Nt(
|
|
534
|
+
E,
|
|
535
|
+
k,
|
|
536
|
+
m,
|
|
537
|
+
d
|
|
538
538
|
);
|
|
539
|
-
|
|
539
|
+
R !== null && o(R);
|
|
540
540
|
}, Z = () => {
|
|
541
|
-
const
|
|
542
|
-
|
|
541
|
+
const k = Ue(JSON.parse(h)), R = M || k.pageSize || 20, T = Math.max(1, Math.ceil(U / R)), S = x >= T ? 1 : x + 1;
|
|
542
|
+
J(S);
|
|
543
543
|
};
|
|
544
|
-
return /* @__PURE__ */
|
|
545
|
-
a ? /* @__PURE__ */
|
|
546
|
-
|
|
547
|
-
/* @__PURE__ */
|
|
544
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
|
|
545
|
+
a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
|
|
546
|
+
y && g.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
|
|
547
|
+
/* @__PURE__ */ c(Ge, { size: "small" }),
|
|
548
548
|
" 加载案例…"
|
|
549
549
|
] }) : null,
|
|
550
|
-
!
|
|
551
|
-
|
|
552
|
-
|
|
550
|
+
!y && g.length === 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-empty", children: q }) : null,
|
|
551
|
+
g.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-list", children: g.map((k) => /* @__PURE__ */ c(
|
|
552
|
+
Zn,
|
|
553
553
|
{
|
|
554
|
-
item:
|
|
555
|
-
selected:
|
|
556
|
-
disabled:
|
|
557
|
-
|
|
558
|
-
|
|
554
|
+
item: k,
|
|
555
|
+
selected: E.includes(k.caseUniqueId),
|
|
556
|
+
disabled: Mt(
|
|
557
|
+
E,
|
|
558
|
+
k.caseUniqueId,
|
|
559
559
|
t,
|
|
560
|
-
|
|
561
|
-
|
|
560
|
+
m,
|
|
561
|
+
d
|
|
562
562
|
),
|
|
563
|
-
onToggle: () =>
|
|
563
|
+
onToggle: () => X(k.caseUniqueId)
|
|
564
564
|
},
|
|
565
|
-
|
|
565
|
+
k.caseUniqueId
|
|
566
566
|
)) }) : null,
|
|
567
|
-
u && n &&
|
|
568
|
-
|
|
567
|
+
u && n && Pe(b) ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ c(
|
|
568
|
+
ke,
|
|
569
569
|
{
|
|
570
570
|
type: "default",
|
|
571
571
|
size: "small",
|
|
572
|
-
icon: /* @__PURE__ */
|
|
573
|
-
loading:
|
|
572
|
+
icon: /* @__PURE__ */ c(yt, {}),
|
|
573
|
+
loading: y,
|
|
574
574
|
disabled: !t,
|
|
575
575
|
onClick: Z,
|
|
576
576
|
children: "换一批"
|
|
577
577
|
}
|
|
578
578
|
) }) : null,
|
|
579
|
-
|
|
579
|
+
l ? /* @__PURE__ */ c(D.Text, { type: "secondary", className: "form-block-preview-help", children: l }) : null
|
|
580
580
|
] });
|
|
581
581
|
}
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
),
|
|
582
|
+
const tr = j(
|
|
583
|
+
Qn,
|
|
584
|
+
er
|
|
585
|
+
), nr = {
|
|
586
586
|
type: "case_multiselect",
|
|
587
587
|
componentName: "SkoponCaseSelect",
|
|
588
|
-
toComponent:
|
|
589
|
-
fromComponent:
|
|
590
|
-
catalogComponents: [
|
|
588
|
+
toComponent: Jn,
|
|
589
|
+
fromComponent: Yn,
|
|
590
|
+
catalogComponents: [tr]
|
|
591
591
|
};
|
|
592
|
-
function
|
|
592
|
+
function ft(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 rr(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 or(e, t, n) {
|
|
620
620
|
const r = n.nameFromValue(e.value), o = {
|
|
621
621
|
...t("resume_multiselect"),
|
|
622
622
|
name: r,
|
|
@@ -633,34 +633,34 @@ 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 = ft(e.minCount);
|
|
637
637
|
s !== void 0 && (o.resumeMinCount = s);
|
|
638
|
-
const
|
|
639
|
-
return
|
|
638
|
+
const l = ft(e.maxCount);
|
|
639
|
+
return l !== void 0 && (o.resumeMaxCount = l), o;
|
|
640
640
|
}
|
|
641
|
-
const
|
|
641
|
+
const Pt = He(null);
|
|
642
642
|
function je({
|
|
643
643
|
resumeSearch: e,
|
|
644
644
|
children: t
|
|
645
645
|
}) {
|
|
646
|
-
return /* @__PURE__ */
|
|
646
|
+
return /* @__PURE__ */ c(Pt.Provider, { value: e ?? null, children: t });
|
|
647
647
|
}
|
|
648
|
-
function
|
|
649
|
-
return
|
|
648
|
+
function ir() {
|
|
649
|
+
return Ke(Pt);
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function Ee(e) {
|
|
652
652
|
return typeof e == "string" ? e : "";
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function ze(e) {
|
|
655
655
|
if (!e || typeof e != "object")
|
|
656
656
|
return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
|
|
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 ar(e) {
|
|
661
661
|
return JSON.stringify(e);
|
|
662
662
|
}
|
|
663
|
-
const
|
|
663
|
+
const sr = {
|
|
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
|
-
},
|
|
676
|
-
function
|
|
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__ */
|
|
675
|
+
}, lr = 3, cr = 2;
|
|
676
|
+
function Re(e, t) {
|
|
677
|
+
const n = (t ?? []).filter(Boolean), r = n.slice(0, lr), o = n.length - r.length;
|
|
678
|
+
return /* @__PURE__ */ C("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__ */ C("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__ */ C(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 ur(e) {
|
|
690
|
+
return /* @__PURE__ */ C("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 mr({ work: e }) {
|
|
696
|
+
return /* @__PURE__ */ C("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(pn, { 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 dr({
|
|
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, cr);
|
|
708
|
+
return /* @__PURE__ */ C(
|
|
709
709
|
"button",
|
|
710
710
|
{
|
|
711
711
|
type: "button",
|
|
@@ -713,183 +713,183 @@ function ir({
|
|
|
713
713
|
disabled: n,
|
|
714
714
|
onClick: r,
|
|
715
715
|
children: [
|
|
716
|
-
/* @__PURE__ */
|
|
717
|
-
|
|
716
|
+
/* @__PURE__ */ c(
|
|
717
|
+
rn,
|
|
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(dn, {}),
|
|
722
722
|
className: "skopon-resume-select-card-avatar"
|
|
723
723
|
}
|
|
724
724
|
),
|
|
725
|
-
/* @__PURE__ */
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
/* @__PURE__ */
|
|
732
|
-
/* @__PURE__ */
|
|
733
|
-
o.length > 0 ? /* @__PURE__ */
|
|
725
|
+
/* @__PURE__ */ c("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
|
|
726
|
+
/* @__PURE__ */ C("div", { className: "skopon-resume-select-card-body", children: [
|
|
727
|
+
ur(e.satisfaction),
|
|
728
|
+
Re("性格", e.personality),
|
|
729
|
+
Re("专长", e.specialties),
|
|
730
|
+
Re("擅长领域", e.traits),
|
|
731
|
+
/* @__PURE__ */ C("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(mr, { 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 } =
|
|
742
|
-
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
}, [
|
|
746
|
-
const
|
|
747
|
-
async (
|
|
748
|
-
const
|
|
740
|
+
function pr({ context: e }) {
|
|
741
|
+
const { interactive: t } = K(), n = ir(), { value: r, setValue: o } = G(e), i = e.componentModel.properties, a = Ee(i.label), s = Ee(i.placeholder), l = Ee(i.help), u = i.enableRefresh !== !1, m = be(i.minCount), d = be(i.maxCount), b = w(() => ze(i.resumeFilter), [i.resumeFilter]), h = ar(b), [x, _] = P(1), [y, p] = P(!1), [v, A] = P(""), [g, I] = P([]), [U, V] = P(0), [M, F] = P(b.pageSize ?? 20), $ = O(0), E = L(r);
|
|
742
|
+
B(() => {
|
|
743
|
+
const k = Ft(E, d);
|
|
744
|
+
k !== null && o(k);
|
|
745
|
+
}, [d, E, o]);
|
|
746
|
+
const q = ne(
|
|
747
|
+
async (k) => {
|
|
748
|
+
const R = ze(JSON.parse(h)), T = ++$.current;
|
|
749
749
|
if (!n) {
|
|
750
|
-
|
|
750
|
+
I([]), V(0), A("未配置简历搜索服务"), p(!1);
|
|
751
751
|
return;
|
|
752
752
|
}
|
|
753
|
-
p(!0),
|
|
753
|
+
p(!0), A("");
|
|
754
754
|
try {
|
|
755
|
-
const
|
|
756
|
-
if (
|
|
757
|
-
|
|
758
|
-
} catch (
|
|
759
|
-
if (
|
|
760
|
-
|
|
755
|
+
const S = await n({ filter: R, page: k });
|
|
756
|
+
if (T !== $.current) return;
|
|
757
|
+
I(S.list), V(S.total), _(S.page), F(S.pageSize);
|
|
758
|
+
} catch (S) {
|
|
759
|
+
if (T !== $.current) return;
|
|
760
|
+
I([]), V(0), A(S instanceof Error ? S.message : "加载简历列表失败");
|
|
761
761
|
} finally {
|
|
762
|
-
|
|
762
|
+
T === $.current && p(!1);
|
|
763
763
|
}
|
|
764
764
|
},
|
|
765
765
|
[n, h]
|
|
766
766
|
);
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
}, [h,
|
|
770
|
-
const
|
|
767
|
+
B(() => {
|
|
768
|
+
_(1), q(1);
|
|
769
|
+
}, [h, q]);
|
|
770
|
+
const J = (k) => {
|
|
771
771
|
if (!t) return;
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
772
|
+
const R = Nt(
|
|
773
|
+
E,
|
|
774
|
+
k,
|
|
775
|
+
m,
|
|
776
|
+
d
|
|
777
777
|
);
|
|
778
|
-
|
|
779
|
-
},
|
|
780
|
-
const
|
|
781
|
-
|
|
778
|
+
R !== null && o(R);
|
|
779
|
+
}, X = () => {
|
|
780
|
+
const k = ze(JSON.parse(h)), R = M || k.pageSize || 20, T = Math.max(1, Math.ceil(U / R)), S = x >= T ? 1 : x + 1;
|
|
781
|
+
q(S);
|
|
782
782
|
}, Z = s || "暂无匹配的简历";
|
|
783
|
-
return /* @__PURE__ */
|
|
784
|
-
a ? /* @__PURE__ */
|
|
785
|
-
|
|
786
|
-
/* @__PURE__ */
|
|
783
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview skopon-resume-select", children: [
|
|
784
|
+
a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
|
|
785
|
+
y && g.length === 0 ? /* @__PURE__ */ C("div", { className: "skopon-resume-select-status", children: [
|
|
786
|
+
/* @__PURE__ */ c(Ge, { size: "small" }),
|
|
787
787
|
" 加载简历…"
|
|
788
788
|
] }) : null,
|
|
789
|
-
!
|
|
790
|
-
!
|
|
791
|
-
|
|
792
|
-
|
|
789
|
+
!y && v ? /* @__PURE__ */ c(D.Text, { type: "danger", className: "skopon-resume-select-status", children: v }) : null,
|
|
790
|
+
!y && !v && g.length === 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-empty", children: Z }) : null,
|
|
791
|
+
g.length > 0 ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-list", children: g.map((k) => /* @__PURE__ */ c(
|
|
792
|
+
dr,
|
|
793
793
|
{
|
|
794
|
-
item:
|
|
795
|
-
selected:
|
|
796
|
-
disabled:
|
|
797
|
-
|
|
798
|
-
|
|
794
|
+
item: k,
|
|
795
|
+
selected: E.includes(k.resumeUniqueId),
|
|
796
|
+
disabled: Mt(
|
|
797
|
+
E,
|
|
798
|
+
k.resumeUniqueId,
|
|
799
799
|
t,
|
|
800
|
-
|
|
801
|
-
|
|
800
|
+
m,
|
|
801
|
+
d
|
|
802
802
|
),
|
|
803
|
-
onToggle: () =>
|
|
803
|
+
onToggle: () => J(k.resumeUniqueId)
|
|
804
804
|
},
|
|
805
|
-
|
|
805
|
+
k.resumeUniqueId
|
|
806
806
|
)) }) : null,
|
|
807
|
-
u && n ? /* @__PURE__ */
|
|
808
|
-
|
|
807
|
+
u && n ? /* @__PURE__ */ c("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ c(
|
|
808
|
+
ke,
|
|
809
809
|
{
|
|
810
810
|
type: "default",
|
|
811
811
|
size: "small",
|
|
812
|
-
icon: /* @__PURE__ */
|
|
813
|
-
loading:
|
|
812
|
+
icon: /* @__PURE__ */ c(yt, {}),
|
|
813
|
+
loading: y,
|
|
814
814
|
disabled: !t,
|
|
815
|
-
onClick:
|
|
815
|
+
onClick: X,
|
|
816
816
|
children: "换一批"
|
|
817
817
|
}
|
|
818
818
|
) }) : null,
|
|
819
|
-
|
|
819
|
+
l ? /* @__PURE__ */ c(D.Text, { type: "secondary", className: "form-block-preview-help", children: l }) : null
|
|
820
820
|
] });
|
|
821
821
|
}
|
|
822
|
-
const
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
),
|
|
822
|
+
const fr = j(
|
|
823
|
+
sr,
|
|
824
|
+
pr
|
|
825
|
+
), hr = {
|
|
826
826
|
type: "resume_multiselect",
|
|
827
827
|
componentName: "SkoponResumeSelect",
|
|
828
|
-
toComponent:
|
|
829
|
-
fromComponent:
|
|
830
|
-
catalogComponents: [
|
|
831
|
-
},
|
|
832
|
-
|
|
833
|
-
),
|
|
834
|
-
|
|
828
|
+
toComponent: rr,
|
|
829
|
+
fromComponent: or,
|
|
830
|
+
catalogComponents: [fr]
|
|
831
|
+
}, Ce = [hr, nr], gr = new Map(
|
|
832
|
+
Ce.map((e) => [e.type, e])
|
|
833
|
+
), yr = new Map(
|
|
834
|
+
Ce.map((e) => [e.componentName, e])
|
|
835
835
|
);
|
|
836
|
-
function
|
|
837
|
-
return
|
|
836
|
+
function vr(e) {
|
|
837
|
+
return gr.get(e);
|
|
838
838
|
}
|
|
839
|
-
function
|
|
840
|
-
return
|
|
839
|
+
function br(e) {
|
|
840
|
+
return yr.get(e);
|
|
841
841
|
}
|
|
842
|
-
function
|
|
843
|
-
return
|
|
842
|
+
function Sr() {
|
|
843
|
+
return Ce.flatMap((e) => e.catalogComponents);
|
|
844
844
|
}
|
|
845
|
-
function
|
|
846
|
-
return
|
|
845
|
+
function kr() {
|
|
846
|
+
return Ce.map((e) => e.componentName);
|
|
847
847
|
}
|
|
848
|
-
const
|
|
849
|
-
function
|
|
848
|
+
const Se = "root", Ve = "__title__", $e = "__desc__", Xe = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
|
|
849
|
+
function Ar(e) {
|
|
850
850
|
return `/${e}`;
|
|
851
851
|
}
|
|
852
|
-
function
|
|
852
|
+
function ht(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 Cr(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: qn(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 xr(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 fe(e, t, n) {
|
|
878
|
+
const r = typeof e.id == "string" ? e.id : ae("block-"), o = xr(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 _r(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 Tr(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 ? Ar(r) : void 0, i = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), a = (m) => r ? { node: m, dataKey: r, dataValue: _r(e) } : { node: m }, s = { id: t, label: n, name: r, path: o, withData: a }, l = vr(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" } };
|
|
@@ -930,7 +930,7 @@ function br(e) {
|
|
|
930
930
|
component: "TextField",
|
|
931
931
|
label: n,
|
|
932
932
|
variant: "shortText",
|
|
933
|
-
validationRegexp:
|
|
933
|
+
validationRegexp: Xe,
|
|
934
934
|
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
935
935
|
value: { path: o }
|
|
936
936
|
});
|
|
@@ -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: Cr(e) };
|
|
1020
1020
|
case "file":
|
|
1021
1021
|
return a({
|
|
1022
1022
|
id: t,
|
|
@@ -1033,31 +1033,31 @@ function br(e) {
|
|
|
1033
1033
|
return { node: null };
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1036
|
+
function De(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 === Se);
|
|
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 Et(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: Ve, component: "Text", text: a, variant: "h2" }), r.push(Ve)), i && s && (n.push({ id:
|
|
1046
|
-
for (const
|
|
1047
|
-
const { node:
|
|
1048
|
-
|
|
1045
|
+
i && a && (n.push({ id: Ve, component: "Text", text: a, variant: "h2" }), r.push(Ve)), i && s && (n.push({ id: $e, component: "Text", text: s, variant: "body" }), r.push($e));
|
|
1046
|
+
for (const m of e.blocks ?? []) {
|
|
1047
|
+
const { node: d, dataKey: b, dataValue: h } = Tr(m);
|
|
1048
|
+
d && (n.push(d), r.push(d.id), b && (o[b] = h));
|
|
1049
1049
|
}
|
|
1050
|
-
n.unshift({ id:
|
|
1051
|
-
const
|
|
1052
|
-
return u !== void 0 && (
|
|
1050
|
+
n.unshift({ id: Se, component: "Column", children: r });
|
|
1051
|
+
const l = { root: Se, 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 Ir(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);
|
|
1058
1058
|
return t;
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1060
|
+
function we(e) {
|
|
1061
1061
|
const t = e.options;
|
|
1062
1062
|
return Array.isArray(t) ? t.map((n) => {
|
|
1063
1063
|
if (!n || typeof n != "object") return null;
|
|
@@ -1068,68 +1068,68 @@ 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 Nr(e) {
|
|
1072
|
+
const t = typeof e.id == "string" ? e.id : ae("block-"), n = String(e.component ?? ""), r = z(e.label) ?? z(e.text) ?? "", o = ht(e.value), i = (s) => ({ id: t, type: s, label: r }), a = br(n);
|
|
1073
1073
|
if (a)
|
|
1074
|
-
return a.fromComponent(e, i, { asLiteral: z, nameFromValue:
|
|
1074
|
+
return a.fromComponent(e, i, { asLiteral: z, nameFromValue: ht });
|
|
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(
|
|
1085
|
-
return
|
|
1082
|
+
let l = "text";
|
|
1083
|
+
s === "longText" ? l = "textarea" : s === "number" ? l = "number" : z(e.validationRegexp) === Xe && (l = "email");
|
|
1084
|
+
const u = { ...i(l), name: o }, m = z(e.placeholder);
|
|
1085
|
+
return m && (u.placeholder = m), 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
|
-
options:
|
|
1094
|
-
},
|
|
1095
|
-
return
|
|
1093
|
+
options: we(e)
|
|
1094
|
+
}, m = z(e.placeholder);
|
|
1095
|
+
return m && (u.placeholder = m), u;
|
|
1096
1096
|
}
|
|
1097
1097
|
case "ChoicePicker": {
|
|
1098
1098
|
const s = z(e.skoponPickerType);
|
|
1099
1099
|
if (s === "select" || s === "multiselect" || s === "radio" || s === "checkbox") {
|
|
1100
|
-
const
|
|
1100
|
+
const m = {
|
|
1101
1101
|
...i(s),
|
|
1102
1102
|
name: o,
|
|
1103
|
-
options:
|
|
1104
|
-
},
|
|
1105
|
-
return
|
|
1103
|
+
options: we(e)
|
|
1104
|
+
}, d = z(e.placeholder);
|
|
1105
|
+
return d && (m.placeholder = d), m;
|
|
1106
1106
|
}
|
|
1107
1107
|
const u = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
|
|
1108
|
-
return { ...i(u), name: o, options:
|
|
1108
|
+
return { ...i(u), name: o, options: we(e) };
|
|
1109
1109
|
}
|
|
1110
1110
|
case "DateTimeInput": {
|
|
1111
|
-
const s = e.enableDate === !0,
|
|
1112
|
-
return
|
|
1111
|
+
const s = e.enableDate === !0, l = e.enableTime === !0, m = { ...i(!s && l ? "time" : "datetime"), name: o }, d = z(e.placeholder);
|
|
1112
|
+
return d && (m.placeholder = d), m;
|
|
1113
1113
|
}
|
|
1114
1114
|
case "SkoponMedia": {
|
|
1115
1115
|
const s = String(e.mediaType ?? "image");
|
|
1116
|
-
return
|
|
1116
|
+
return fe(e, s === "video" ? "video" : s === "audio" ? "audio" : "image", r);
|
|
1117
1117
|
}
|
|
1118
1118
|
case "Image":
|
|
1119
|
-
return
|
|
1119
|
+
return fe(e, "image", r);
|
|
1120
1120
|
case "Video":
|
|
1121
|
-
return
|
|
1121
|
+
return fe(e, "video", r);
|
|
1122
1122
|
case "AudioPlayer":
|
|
1123
|
-
return
|
|
1123
|
+
return fe(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;
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1132
|
+
function zt(e, t, n, r) {
|
|
1133
1133
|
if (n.has(e)) return;
|
|
1134
1134
|
n.add(e);
|
|
1135
1135
|
const o = t.get(e);
|
|
@@ -1137,25 +1137,25 @@ function Ft(e, t, n, r) {
|
|
|
1137
1137
|
const i = String(o.component ?? "");
|
|
1138
1138
|
if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
|
|
1139
1139
|
for (const a of o.children)
|
|
1140
|
-
typeof a == "string" &&
|
|
1140
|
+
typeof a == "string" && zt(a, t, n, r);
|
|
1141
1141
|
return;
|
|
1142
1142
|
}
|
|
1143
1143
|
r.push(o);
|
|
1144
1144
|
}
|
|
1145
|
-
function
|
|
1145
|
+
function Mr(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 Fr(e) {
|
|
1155
1155
|
if (!e || !Array.isArray(e.components))
|
|
1156
|
-
return
|
|
1157
|
-
const t =
|
|
1158
|
-
|
|
1156
|
+
return ve({ title: "", description: "", blocks: [], jsonSchema: {} });
|
|
1157
|
+
const t = Ir(e), n = [];
|
|
1158
|
+
zt(e.root ?? Se, t, /* @__PURE__ */ new Set(), n);
|
|
1159
1159
|
let r = "", o = "";
|
|
1160
1160
|
const i = [];
|
|
1161
1161
|
for (const a of n) {
|
|
@@ -1163,21 +1163,21 @@ function xr(e) {
|
|
|
1163
1163
|
r = z(a.text) ?? r;
|
|
1164
1164
|
continue;
|
|
1165
1165
|
}
|
|
1166
|
-
if (a.id ===
|
|
1166
|
+
if (a.id === $e) {
|
|
1167
1167
|
o = z(a.text) ?? o;
|
|
1168
1168
|
continue;
|
|
1169
1169
|
}
|
|
1170
|
-
const s =
|
|
1170
|
+
const s = Nr(a);
|
|
1171
1171
|
s && i.push(s);
|
|
1172
1172
|
}
|
|
1173
|
-
return
|
|
1173
|
+
return ve({
|
|
1174
1174
|
title: r,
|
|
1175
1175
|
description: o,
|
|
1176
|
-
blocks:
|
|
1176
|
+
blocks: Mr(i, e.dataModel),
|
|
1177
1177
|
jsonSchema: {}
|
|
1178
1178
|
});
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function Ur(e, t) {
|
|
1181
1181
|
const { surfaceId: n, catalogId: r } = t, o = [
|
|
1182
1182
|
{ version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
|
|
1183
1183
|
{
|
|
@@ -1190,25 +1190,25 @@ function Ar(e, t) {
|
|
|
1190
1190
|
updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
|
|
1191
1191
|
}), o;
|
|
1192
1192
|
}
|
|
1193
|
-
function
|
|
1193
|
+
function Rt(e) {
|
|
1194
1194
|
return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
|
|
1195
1195
|
}
|
|
1196
|
-
function
|
|
1196
|
+
function Pr(e, t) {
|
|
1197
1197
|
if (!e || typeof e != "object") return null;
|
|
1198
|
-
const n = e, r =
|
|
1199
|
-
if (r &&
|
|
1198
|
+
const n = e, r = Rt(n.a2ui) ? n.a2ui : void 0;
|
|
1199
|
+
if (r && !De(r)) return r;
|
|
1200
1200
|
const o = Array.isArray(n.blocks) ? n.blocks : [];
|
|
1201
1201
|
if (o.length === 0) return null;
|
|
1202
|
-
const i =
|
|
1202
|
+
const i = Q({
|
|
1203
1203
|
title: typeof n.title == "string" ? n.title : "",
|
|
1204
1204
|
description: typeof n.description == "string" ? n.description : "",
|
|
1205
1205
|
blocks: o,
|
|
1206
|
-
jsonSchema:
|
|
1207
|
-
}), a =
|
|
1208
|
-
return
|
|
1206
|
+
jsonSchema: We(n.jsonSchema ?? n.json_schema)
|
|
1207
|
+
}), a = Et(i, t);
|
|
1208
|
+
return De(a) ? null : a;
|
|
1209
1209
|
}
|
|
1210
|
-
function
|
|
1211
|
-
return
|
|
1210
|
+
function Er(e, t, n) {
|
|
1211
|
+
return Et(
|
|
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 zr(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) &&
|
|
1224
|
+
return !(Array.isArray(t.blocks) && t.blocks.length > 0) && Rt(t.a2ui) ? Fr(t.a2ui) : Q({
|
|
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
|
-
jsonSchema:
|
|
1228
|
+
jsonSchema: We(t.jsonSchema ?? t.json_schema)
|
|
1229
1229
|
});
|
|
1230
1230
|
}
|
|
1231
|
-
function
|
|
1231
|
+
function Rr(e, t, n) {
|
|
1232
1232
|
const r = e.model.surfacesMap.get(t);
|
|
1233
1233
|
if (!r) return {};
|
|
1234
1234
|
const o = {};
|
|
@@ -1238,15 +1238,15 @@ function Mr(e, t, n) {
|
|
|
1238
1238
|
}
|
|
1239
1239
|
return o;
|
|
1240
1240
|
}
|
|
1241
|
-
function
|
|
1242
|
-
return
|
|
1241
|
+
function wr(e) {
|
|
1242
|
+
return Q({
|
|
1243
1243
|
title: "",
|
|
1244
1244
|
description: "",
|
|
1245
1245
|
blocks: [e],
|
|
1246
1246
|
jsonSchema: {}
|
|
1247
1247
|
}).blocks[0];
|
|
1248
1248
|
}
|
|
1249
|
-
function
|
|
1249
|
+
function Br(e, t) {
|
|
1250
1250
|
var o, i;
|
|
1251
1251
|
const n = /* @__PURE__ */ new Map();
|
|
1252
1252
|
for (const a of t) {
|
|
@@ -1255,57 +1255,57 @@ 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 (Ae(a.type)) {
|
|
1259
|
+
r.push(wr(a));
|
|
1260
1260
|
continue;
|
|
1261
1261
|
}
|
|
1262
|
-
if (!
|
|
1262
|
+
if (!W(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 qr(e, t) {
|
|
1271
1271
|
var r;
|
|
1272
1272
|
const n = {
|
|
1273
1273
|
...e,
|
|
1274
1274
|
name: ((r = e.name) == null ? void 0 : r.trim()) || t.name
|
|
1275
1275
|
};
|
|
1276
|
-
return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue),
|
|
1276
|
+
return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), Q({
|
|
1277
1277
|
title: "",
|
|
1278
1278
|
description: "",
|
|
1279
1279
|
blocks: [n],
|
|
1280
1280
|
jsonSchema: {}
|
|
1281
1281
|
}).blocks[0];
|
|
1282
1282
|
}
|
|
1283
|
-
function
|
|
1283
|
+
function xe(e) {
|
|
1284
1284
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1285
1285
|
const t = e;
|
|
1286
|
-
return Array.isArray(t.blocks) ?
|
|
1286
|
+
return Array.isArray(t.blocks) ? Q({
|
|
1287
1287
|
title: typeof t.title == "string" ? t.title : "",
|
|
1288
1288
|
description: typeof t.description == "string" ? t.description : "",
|
|
1289
1289
|
blocks: t.blocks,
|
|
1290
1290
|
jsonSchema: {}
|
|
1291
1291
|
}) : null;
|
|
1292
1292
|
}
|
|
1293
|
-
function
|
|
1294
|
-
var i, a, s,
|
|
1293
|
+
function Or(e, t) {
|
|
1294
|
+
var i, a, s, l, u, m;
|
|
1295
1295
|
const n = /* @__PURE__ */ new Map();
|
|
1296
|
-
for (const
|
|
1297
|
-
|
|
1296
|
+
for (const d of (t == null ? void 0 : t.blocks) ?? [])
|
|
1297
|
+
W(d.type) && ((i = d.name) != null && i.trim()) && n.set(d.name.trim(), d);
|
|
1298
1298
|
const r = [], o = [];
|
|
1299
|
-
for (const
|
|
1300
|
-
if (!
|
|
1301
|
-
const
|
|
1302
|
-
if (!
|
|
1303
|
-
const h = n.get(
|
|
1304
|
-
h ? r.push(
|
|
1305
|
-
|
|
1299
|
+
for (const d of e.blocks) {
|
|
1300
|
+
if (!W(d.type)) continue;
|
|
1301
|
+
const b = (a = d.name) == null ? void 0 : a.trim();
|
|
1302
|
+
if (!b) continue;
|
|
1303
|
+
const h = n.get(b);
|
|
1304
|
+
h ? r.push(qr(h, d)) : o.push(
|
|
1305
|
+
Q({
|
|
1306
1306
|
title: "",
|
|
1307
1307
|
description: "",
|
|
1308
|
-
blocks: [
|
|
1308
|
+
blocks: [d],
|
|
1309
1309
|
jsonSchema: {}
|
|
1310
1310
|
}).blocks[0]
|
|
1311
1311
|
);
|
|
@@ -1313,80 +1313,88 @@ 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()) || ((
|
|
1318
|
-
description: ((u = e.description) == null ? void 0 : u.trim()) || ((
|
|
1316
|
+
renderBlocks: Br(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
|
+
description: ((u = e.description) == null ? void 0 : u.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
|
|
1319
1319
|
};
|
|
1320
1320
|
}
|
|
1321
|
-
function
|
|
1321
|
+
function Lr(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
|
}
|
|
1325
|
-
function
|
|
1325
|
+
function Qe(e) {
|
|
1326
1326
|
var n;
|
|
1327
1327
|
const t = {};
|
|
1328
1328
|
for (const r of e) {
|
|
1329
|
-
if (!
|
|
1329
|
+
if (!W(r.type)) continue;
|
|
1330
1330
|
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1331
|
-
o && (t[o] =
|
|
1331
|
+
o && (t[o] = Lr(r));
|
|
1332
1332
|
}
|
|
1333
1333
|
return t;
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1335
|
+
function jr(e) {
|
|
1336
1336
|
return e.blocks.some(
|
|
1337
1337
|
(t) => {
|
|
1338
1338
|
var n;
|
|
1339
|
-
return
|
|
1339
|
+
return W(t.type) && !!((n = t.name) != null && n.trim());
|
|
1340
1340
|
}
|
|
1341
1341
|
);
|
|
1342
1342
|
}
|
|
1343
|
-
function
|
|
1343
|
+
function Vr(e) {
|
|
1344
1344
|
return e.blocks.filter((t) => {
|
|
1345
1345
|
var n;
|
|
1346
|
-
return
|
|
1346
|
+
return Ae(t.type) ? !0 : W(t.type) && !!((n = t.name) != null && n.trim());
|
|
1347
1347
|
});
|
|
1348
1348
|
}
|
|
1349
|
-
function
|
|
1349
|
+
function $r(e) {
|
|
1350
1350
|
return e.blocks.filter((t) => {
|
|
1351
1351
|
var n;
|
|
1352
|
-
return
|
|
1352
|
+
return W(t.type) && ((n = t.name) == null ? void 0 : n.trim());
|
|
1353
1353
|
}).map((t) => t.name.trim());
|
|
1354
1354
|
}
|
|
1355
|
-
function
|
|
1355
|
+
function Ze(e) {
|
|
1356
1356
|
return e.replace(/'/g, "'\\''");
|
|
1357
1357
|
}
|
|
1358
|
-
function
|
|
1359
|
-
|
|
1358
|
+
function wt(e) {
|
|
1359
|
+
var n;
|
|
1360
|
+
const t = (n = e == null ? void 0 : e.Authorization) == null ? void 0 : n.trim();
|
|
1361
|
+
return t ? ` -H 'Authorization: ${Ze(t)}' \\` : " -H 'Authorization: Bearer <token>' \\";
|
|
1362
|
+
}
|
|
1363
|
+
function Bt(e, t, n) {
|
|
1364
|
+
const r = (t ?? "").trim() || "<callback_url>", o = JSON.stringify(e ?? {}, null, 2);
|
|
1360
1365
|
return [
|
|
1361
|
-
`curl -X POST '${
|
|
1366
|
+
`curl -X POST '${r}' \\`,
|
|
1362
1367
|
" -H 'Content-Type: application/json' \\",
|
|
1363
|
-
|
|
1368
|
+
wt(n),
|
|
1369
|
+
` -d '${Ze(o)}'`
|
|
1364
1370
|
].join(`
|
|
1365
1371
|
`);
|
|
1366
1372
|
}
|
|
1367
|
-
function
|
|
1373
|
+
function Dr(e, t) {
|
|
1368
1374
|
return JSON.stringify({ ...e, ...t }, null, 2);
|
|
1369
1375
|
}
|
|
1370
|
-
function
|
|
1376
|
+
function Hr({
|
|
1371
1377
|
cardValues: e,
|
|
1372
1378
|
extraValues: t = {},
|
|
1373
|
-
callbackUrl: n
|
|
1379
|
+
callbackUrl: n,
|
|
1380
|
+
headers: r
|
|
1374
1381
|
}) {
|
|
1375
|
-
const
|
|
1382
|
+
const o = (n ?? "").trim() || "<callback_url>", i = Dr(e, t);
|
|
1376
1383
|
return [
|
|
1377
|
-
`curl -X POST '${
|
|
1384
|
+
`curl -X POST '${o}' \\`,
|
|
1378
1385
|
" -H 'Content-Type: application/json' \\",
|
|
1379
|
-
|
|
1386
|
+
wt(r),
|
|
1387
|
+
` -d '${Ze(i)}'`
|
|
1380
1388
|
].join(`
|
|
1381
1389
|
`);
|
|
1382
1390
|
}
|
|
1383
|
-
function
|
|
1384
|
-
const
|
|
1385
|
-
if (!
|
|
1386
|
-
const
|
|
1387
|
-
return
|
|
1391
|
+
function ei(e, t, n) {
|
|
1392
|
+
const r = xe(e);
|
|
1393
|
+
if (!r) return Bt(e, t, n);
|
|
1394
|
+
const o = Qe(r.blocks);
|
|
1395
|
+
return Hr({ cardValues: o, callbackUrl: t, headers: n });
|
|
1388
1396
|
}
|
|
1389
|
-
async function
|
|
1397
|
+
async function qt(e, t, n) {
|
|
1390
1398
|
const r = e.trim();
|
|
1391
1399
|
if (!r)
|
|
1392
1400
|
throw new Error("callback_url 为空");
|
|
@@ -1413,7 +1421,7 @@ async function zt(e, t, n) {
|
|
|
1413
1421
|
}
|
|
1414
1422
|
return { ok: i.ok, status: i.status, body: a };
|
|
1415
1423
|
}
|
|
1416
|
-
async function
|
|
1424
|
+
async function ti(e) {
|
|
1417
1425
|
var n;
|
|
1418
1426
|
if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
|
|
1419
1427
|
await navigator.clipboard.writeText(e);
|
|
@@ -1429,7 +1437,7 @@ async function Do(e) {
|
|
|
1429
1437
|
document.body.removeChild(t);
|
|
1430
1438
|
}
|
|
1431
1439
|
}
|
|
1432
|
-
async function
|
|
1440
|
+
async function et(e) {
|
|
1433
1441
|
let t;
|
|
1434
1442
|
try {
|
|
1435
1443
|
t = await e.json();
|
|
@@ -1442,8 +1450,8 @@ async function Qe(e) {
|
|
|
1442
1450
|
throw new Error(t.message || `响应缺少 data (${e.status})`);
|
|
1443
1451
|
return t.data;
|
|
1444
1452
|
}
|
|
1445
|
-
const
|
|
1446
|
-
function
|
|
1453
|
+
const Ot = "auth_user", Kr = "token", Gr = "answer_agent_callback_url", Jr = "/api/v1/mock/ask_user_answer_mock";
|
|
1454
|
+
function Lt(e) {
|
|
1447
1455
|
if (typeof window > "u") return null;
|
|
1448
1456
|
try {
|
|
1449
1457
|
return e === "localStorage" ? window.localStorage : window.sessionStorage;
|
|
@@ -1451,7 +1459,7 @@ function Bt(e) {
|
|
|
1451
1459
|
return null;
|
|
1452
1460
|
}
|
|
1453
1461
|
}
|
|
1454
|
-
function
|
|
1462
|
+
function jt(e) {
|
|
1455
1463
|
try {
|
|
1456
1464
|
const t = JSON.parse(e);
|
|
1457
1465
|
return !t || typeof t != "object" || Array.isArray(t) ? null : t;
|
|
@@ -1459,34 +1467,40 @@ function wt(e) {
|
|
|
1459
1467
|
return null;
|
|
1460
1468
|
}
|
|
1461
1469
|
}
|
|
1462
|
-
function
|
|
1463
|
-
const n =
|
|
1470
|
+
function Yr(e, t) {
|
|
1471
|
+
const n = jt(e);
|
|
1464
1472
|
if (!n) return "";
|
|
1465
1473
|
const r = n[t];
|
|
1466
1474
|
return typeof r == "string" ? r.trim().replace(/^bearer\s+/i, "").trim() : "";
|
|
1467
1475
|
}
|
|
1468
|
-
function
|
|
1469
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
1476
|
+
function Wr(e = {}) {
|
|
1477
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ot, r = e.answerAgentCallbackUrlField ?? Gr, o = Lt(t);
|
|
1470
1478
|
if (!o) return "";
|
|
1471
1479
|
const i = o.getItem(n);
|
|
1472
1480
|
if (!i) return "";
|
|
1473
|
-
const a =
|
|
1481
|
+
const a = jt(i);
|
|
1474
1482
|
if (!a) return "";
|
|
1475
1483
|
const s = a[r];
|
|
1476
|
-
return typeof s == "string" ? s.trim() : "";
|
|
1484
|
+
return (typeof s == "string" ? s.trim() : "") || Jr;
|
|
1477
1485
|
}
|
|
1478
|
-
function
|
|
1479
|
-
|
|
1486
|
+
function tt(e, t) {
|
|
1487
|
+
return {
|
|
1488
|
+
...Vt(t),
|
|
1489
|
+
...e ?? {}
|
|
1490
|
+
};
|
|
1491
|
+
}
|
|
1492
|
+
function Vt(e = {}) {
|
|
1493
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ot, r = e.tokenField ?? Kr, o = Lt(t);
|
|
1480
1494
|
if (!o) return {};
|
|
1481
1495
|
const i = o.getItem(n);
|
|
1482
1496
|
if (!i) return {};
|
|
1483
|
-
const a =
|
|
1497
|
+
const a = Yr(i, r);
|
|
1484
1498
|
return a ? { Authorization: `Bearer ${a}` } : {};
|
|
1485
1499
|
}
|
|
1486
|
-
async function
|
|
1487
|
-
return e.getHeaders ? await e.getHeaders() ?? {} :
|
|
1500
|
+
async function nt(e = {}) {
|
|
1501
|
+
return e.getHeaders ? await e.getHeaders() ?? {} : Vt(e.authStorage);
|
|
1488
1502
|
}
|
|
1489
|
-
function
|
|
1503
|
+
function Xr(e = {}) {
|
|
1490
1504
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
|
|
1491
1505
|
async function o(i) {
|
|
1492
1506
|
const a = new URLSearchParams();
|
|
@@ -1496,21 +1510,21 @@ function $r(e = {}) {
|
|
|
1496
1510
|
a.set("form_unique_id", i.formUniqueId);
|
|
1497
1511
|
else
|
|
1498
1512
|
throw new Error("form_id 或 form_unique_id 至少传一个");
|
|
1499
|
-
const s = await
|
|
1513
|
+
const s = await nt(e), l = await r(`${t}${n}?${a.toString()}`, {
|
|
1500
1514
|
method: "GET",
|
|
1501
1515
|
headers: s
|
|
1502
|
-
}), u = await
|
|
1516
|
+
}), u = await et(l), m = zr(u.form_definition);
|
|
1503
1517
|
return {
|
|
1504
1518
|
formUniqueId: u.form_unique_id,
|
|
1505
1519
|
formId: u.form_id,
|
|
1506
1520
|
disabled: u.disabled === 1,
|
|
1507
|
-
formDefinition:
|
|
1508
|
-
a2ui:
|
|
1521
|
+
formDefinition: m,
|
|
1522
|
+
a2ui: Pr(u.form_definition) ?? void 0
|
|
1509
1523
|
};
|
|
1510
1524
|
}
|
|
1511
1525
|
return { fetchDetail: o };
|
|
1512
1526
|
}
|
|
1513
|
-
function
|
|
1527
|
+
function Qr(e) {
|
|
1514
1528
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1515
1529
|
return e ?? null;
|
|
1516
1530
|
const t = e;
|
|
@@ -1520,13 +1534,13 @@ function Dr(e) {
|
|
|
1520
1534
|
blocks: t.blocks
|
|
1521
1535
|
} : e;
|
|
1522
1536
|
}
|
|
1523
|
-
function
|
|
1537
|
+
function rt({
|
|
1524
1538
|
context: e,
|
|
1525
1539
|
payload: t,
|
|
1526
1540
|
form: n,
|
|
1527
1541
|
answer: r
|
|
1528
1542
|
}) {
|
|
1529
|
-
const o =
|
|
1543
|
+
const o = xe(t) ?? t, i = n ? Qr(n) : o;
|
|
1530
1544
|
return {
|
|
1531
1545
|
mission_id: e.missionId ?? null,
|
|
1532
1546
|
tenant_id: e.tenantId ?? null,
|
|
@@ -1539,20 +1553,77 @@ function Ot({
|
|
|
1539
1553
|
answer: r
|
|
1540
1554
|
};
|
|
1541
1555
|
}
|
|
1542
|
-
|
|
1543
|
-
const
|
|
1544
|
-
if (!
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1556
|
+
function $t(e) {
|
|
1557
|
+
const t = e.callback_url;
|
|
1558
|
+
if (typeof t != "string" || !t.trim())
|
|
1559
|
+
return "callback_url 为空,无法提交";
|
|
1560
|
+
if (e.tenant_id == null)
|
|
1561
|
+
return "tenant_id 缺失,无法提交";
|
|
1562
|
+
const n = e.tenant_user_id;
|
|
1563
|
+
if (typeof n != "string" || !n.trim())
|
|
1564
|
+
return "tenant_user_id 缺失,无法提交";
|
|
1565
|
+
const r = e.request_id;
|
|
1566
|
+
if (typeof r != "string" || !r.trim())
|
|
1567
|
+
return "request_id 缺失,无法提交";
|
|
1568
|
+
const o = e.mission_id;
|
|
1569
|
+
return o == null || o === "" ? "mission_id 缺失,无法提交" : null;
|
|
1570
|
+
}
|
|
1571
|
+
function ni(e) {
|
|
1572
|
+
return $t(
|
|
1573
|
+
rt({
|
|
1574
|
+
context: e,
|
|
1575
|
+
payload: {},
|
|
1576
|
+
answer: {}
|
|
1577
|
+
})
|
|
1578
|
+
);
|
|
1579
|
+
}
|
|
1580
|
+
const gt = "answer_agent_callback_url 未配置,无法提交";
|
|
1581
|
+
function Zr(e) {
|
|
1582
|
+
if ((e == null ? void 0 : e.answerAgentCallbackUrl) != null) {
|
|
1583
|
+
const n = e.answerAgentCallbackUrl.trim();
|
|
1584
|
+
if (!n)
|
|
1585
|
+
throw new Error(gt);
|
|
1586
|
+
return n;
|
|
1587
|
+
}
|
|
1588
|
+
const t = Wr(e == null ? void 0 : e.authStorage).trim();
|
|
1589
|
+
if (!t)
|
|
1590
|
+
throw new Error(gt);
|
|
1591
|
+
return t;
|
|
1592
|
+
}
|
|
1593
|
+
function Dt(e) {
|
|
1594
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1595
|
+
const n = e.data;
|
|
1596
|
+
return !n || typeof n != "object" || Array.isArray(n) ? null : n;
|
|
1597
|
+
}
|
|
1598
|
+
function eo(e, t) {
|
|
1599
|
+
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
1600
|
+
const n = t.message;
|
|
1601
|
+
if (typeof n == "string" && n.trim())
|
|
1602
|
+
return `提交失败 (${e}): ${n.trim()}`;
|
|
1603
|
+
}
|
|
1604
|
+
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
1605
|
+
}
|
|
1606
|
+
function to(e) {
|
|
1607
|
+
return `提交失败:${typeof e.error == "string" && e.error.trim() ? e.error.trim() : `回调 HTTP ${e.callback_status ?? "失败"}`}`;
|
|
1608
|
+
}
|
|
1609
|
+
function Ht(e) {
|
|
1610
|
+
const t = Dt(e.body);
|
|
1611
|
+
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message: to(t) } : e.ok ? { type: "success", message: "提交成功" } : {
|
|
1612
|
+
type: "error",
|
|
1613
|
+
message: eo(e.status, e.body)
|
|
1614
|
+
};
|
|
1615
|
+
}
|
|
1616
|
+
async function Kt(e, t) {
|
|
1617
|
+
const n = $t(e);
|
|
1618
|
+
if (n)
|
|
1619
|
+
throw new Error(n);
|
|
1620
|
+
const r = Zr(t), o = await qt(r, e, {
|
|
1548
1621
|
...t,
|
|
1549
|
-
headers:
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
}
|
|
1553
|
-
});
|
|
1622
|
+
headers: tt(t == null ? void 0 : t.headers, t == null ? void 0 : t.authStorage)
|
|
1623
|
+
}), i = Dt(o.body);
|
|
1624
|
+
return o.ok && (i == null ? void 0 : i.callback_ok) === !1 ? { ok: !1, status: o.status, body: o.body } : o;
|
|
1554
1625
|
}
|
|
1555
|
-
function
|
|
1626
|
+
function no(e) {
|
|
1556
1627
|
return {
|
|
1557
1628
|
resumeUniqueId: e.resume_unique_id,
|
|
1558
1629
|
resumeId: e.resume_id,
|
|
@@ -1573,7 +1644,7 @@ function Hr(e) {
|
|
|
1573
1644
|
}))
|
|
1574
1645
|
};
|
|
1575
1646
|
}
|
|
1576
|
-
function
|
|
1647
|
+
function ro(e, t) {
|
|
1577
1648
|
const n = new URLSearchParams();
|
|
1578
1649
|
n.set("page", String(t)), n.set("page_size", String(e.pageSize ?? 20));
|
|
1579
1650
|
for (const r of e.names ?? [])
|
|
@@ -1584,27 +1655,27 @@ function Kr(e, t) {
|
|
|
1584
1655
|
r && n.append("resume_unique_id", r);
|
|
1585
1656
|
return n;
|
|
1586
1657
|
}
|
|
1587
|
-
function
|
|
1658
|
+
function oo(e = {}) {
|
|
1588
1659
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.searchPath ?? "/univ/resume/search", r = e.fetch ?? fetch;
|
|
1589
1660
|
return async ({ filter: o, page: i }) => {
|
|
1590
|
-
const a = await
|
|
1661
|
+
const a = await nt(e), s = ro(o, i), l = await r(`${t}${n}?${s.toString()}`, {
|
|
1591
1662
|
method: "GET",
|
|
1592
1663
|
headers: a
|
|
1593
|
-
}), u = await
|
|
1664
|
+
}), u = await et(l);
|
|
1594
1665
|
return {
|
|
1595
|
-
list: (u.list ?? []).map(
|
|
1666
|
+
list: (u.list ?? []).map(no),
|
|
1596
1667
|
total: u.total ?? 0,
|
|
1597
1668
|
page: u.page ?? i,
|
|
1598
1669
|
pageSize: u.page_size ?? o.pageSize ?? 20
|
|
1599
1670
|
};
|
|
1600
1671
|
};
|
|
1601
1672
|
}
|
|
1602
|
-
function
|
|
1673
|
+
function io(e) {
|
|
1603
1674
|
var r, o, i, a;
|
|
1604
1675
|
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
1676
|
return t || n;
|
|
1606
1677
|
}
|
|
1607
|
-
function
|
|
1678
|
+
function ao(e) {
|
|
1608
1679
|
return {
|
|
1609
1680
|
caseUniqueId: e.case_unique_id,
|
|
1610
1681
|
caseId: e.case_id,
|
|
@@ -1615,7 +1686,7 @@ function Yr(e) {
|
|
|
1615
1686
|
description: e.description ?? void 0
|
|
1616
1687
|
};
|
|
1617
1688
|
}
|
|
1618
|
-
function
|
|
1689
|
+
function so(e, t, n) {
|
|
1619
1690
|
var o, i, a;
|
|
1620
1691
|
const r = new URLSearchParams();
|
|
1621
1692
|
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 +1694,24 @@ function Wr(e, t, n) {
|
|
|
1623
1694
|
s && r.append("flow_unique_ids", s);
|
|
1624
1695
|
return r;
|
|
1625
1696
|
}
|
|
1626
|
-
function
|
|
1697
|
+
function lo(e = {}) {
|
|
1627
1698
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.listPath ?? "/univ/case/list", r = e.fetch ?? fetch, o = e.published ?? 1;
|
|
1628
1699
|
return async ({ filter: i, page: a }) => {
|
|
1629
|
-
if (!
|
|
1700
|
+
if (!io(i))
|
|
1630
1701
|
return { list: [], total: 0, page: 1, pageSize: i.pageSize ?? 20 };
|
|
1631
|
-
const s = await
|
|
1702
|
+
const s = await nt(e), l = so(i, a, o), u = await r(`${t}${n}?${l.toString()}`, {
|
|
1632
1703
|
method: "GET",
|
|
1633
1704
|
headers: s
|
|
1634
|
-
}),
|
|
1705
|
+
}), m = await et(u);
|
|
1635
1706
|
return {
|
|
1636
|
-
list: (
|
|
1637
|
-
total:
|
|
1638
|
-
page:
|
|
1639
|
-
pageSize:
|
|
1707
|
+
list: (m.list ?? []).map(ao),
|
|
1708
|
+
total: m.total ?? 0,
|
|
1709
|
+
page: m.page ?? a,
|
|
1710
|
+
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
1640
1711
|
};
|
|
1641
1712
|
};
|
|
1642
1713
|
}
|
|
1643
|
-
function
|
|
1714
|
+
function ri(e = {}) {
|
|
1644
1715
|
var r, o, i, a;
|
|
1645
1716
|
const t = {
|
|
1646
1717
|
baseUrl: e.baseUrl,
|
|
@@ -1649,22 +1720,22 @@ function Ho(e = {}) {
|
|
|
1649
1720
|
authStorage: e.authStorage
|
|
1650
1721
|
};
|
|
1651
1722
|
return {
|
|
1652
|
-
fetchDetail:
|
|
1723
|
+
fetchDetail: Xr({
|
|
1653
1724
|
...t,
|
|
1654
1725
|
detailPath: (r = e.form) == null ? void 0 : r.detailPath
|
|
1655
1726
|
}).fetchDetail,
|
|
1656
|
-
resumeSearch:
|
|
1727
|
+
resumeSearch: oo({
|
|
1657
1728
|
...t,
|
|
1658
1729
|
searchPath: (o = e.resume) == null ? void 0 : o.searchPath
|
|
1659
1730
|
}),
|
|
1660
|
-
caseSearch:
|
|
1731
|
+
caseSearch: lo({
|
|
1661
1732
|
...t,
|
|
1662
1733
|
listPath: (i = e.case) == null ? void 0 : i.listPath,
|
|
1663
1734
|
published: (a = e.case) == null ? void 0 : a.published
|
|
1664
1735
|
})
|
|
1665
1736
|
};
|
|
1666
1737
|
}
|
|
1667
|
-
function
|
|
1738
|
+
function Gt(e, t) {
|
|
1668
1739
|
if (!t.trim()) return !0;
|
|
1669
1740
|
try {
|
|
1670
1741
|
return new RegExp(t).test(e);
|
|
@@ -1672,86 +1743,86 @@ function Vt(e, t) {
|
|
|
1672
1743
|
return !0;
|
|
1673
1744
|
}
|
|
1674
1745
|
}
|
|
1675
|
-
function
|
|
1746
|
+
function Jt(e) {
|
|
1676
1747
|
return e == null ? !0 : typeof e == "string" ? !e.trim() : !1;
|
|
1677
1748
|
}
|
|
1678
|
-
function
|
|
1749
|
+
function co(e, t) {
|
|
1679
1750
|
switch (e.type) {
|
|
1680
1751
|
case "multiselect":
|
|
1681
1752
|
case "checkbox":
|
|
1682
1753
|
case "file":
|
|
1683
1754
|
case "resume_multiselect":
|
|
1684
1755
|
case "case_multiselect":
|
|
1685
|
-
return
|
|
1756
|
+
return L(t).length === 0;
|
|
1686
1757
|
case "toggle":
|
|
1687
|
-
return !
|
|
1758
|
+
return !ce(t);
|
|
1688
1759
|
case "number":
|
|
1689
1760
|
return t == null || t === "";
|
|
1690
1761
|
default:
|
|
1691
|
-
return
|
|
1762
|
+
return Jt(t);
|
|
1692
1763
|
}
|
|
1693
1764
|
}
|
|
1694
1765
|
function Be(e, t) {
|
|
1695
1766
|
return e.required === !0 || t > 0;
|
|
1696
1767
|
}
|
|
1697
|
-
function
|
|
1768
|
+
function uo(e, t) {
|
|
1698
1769
|
var n, r;
|
|
1699
1770
|
for (const o of e) {
|
|
1700
1771
|
const i = (n = o.name) == null ? void 0 : n.trim();
|
|
1701
|
-
if (!i ||
|
|
1772
|
+
if (!i || Ae(o.type) || ye(o.type)) continue;
|
|
1702
1773
|
const a = t[i], s = ((r = o.label) == null ? void 0 : r.trim()) || i;
|
|
1703
|
-
if (o.required &&
|
|
1774
|
+
if (o.required && co(o, a))
|
|
1704
1775
|
return { fieldName: i, label: s, message: `请填写「${s}」` };
|
|
1705
|
-
if (o.type === "email" && !
|
|
1706
|
-
const
|
|
1707
|
-
if (!
|
|
1776
|
+
if (o.type === "email" && !Jt(a)) {
|
|
1777
|
+
const l = String(a).trim();
|
|
1778
|
+
if (!Gt(l, Xe))
|
|
1708
1779
|
return { fieldName: i, label: s, message: `「${s}」格式不正确` };
|
|
1709
1780
|
}
|
|
1710
1781
|
if (o.type === "file") {
|
|
1711
|
-
const
|
|
1712
|
-
if (
|
|
1782
|
+
const l = o.fileMinCount ?? 0, u = L(a).length;
|
|
1783
|
+
if (l > 0 && u < l && Be(o, u))
|
|
1713
1784
|
return {
|
|
1714
1785
|
fieldName: i,
|
|
1715
1786
|
label: s,
|
|
1716
|
-
message: `「${s}」至少需要 ${
|
|
1787
|
+
message: `「${s}」至少需要 ${l} 个文件`
|
|
1717
1788
|
};
|
|
1718
1789
|
}
|
|
1719
1790
|
if (o.type === "resume_multiselect") {
|
|
1720
|
-
const
|
|
1721
|
-
if (
|
|
1791
|
+
const l = o.resumeMinCount, u = L(a).length;
|
|
1792
|
+
if (l !== void 0 && u < l && Be(o, u))
|
|
1722
1793
|
return {
|
|
1723
1794
|
fieldName: i,
|
|
1724
1795
|
label: s,
|
|
1725
|
-
message: `「${s}」至少选择 ${
|
|
1796
|
+
message: `「${s}」至少选择 ${l} 项`
|
|
1726
1797
|
};
|
|
1727
1798
|
}
|
|
1728
1799
|
if (o.type === "case_multiselect") {
|
|
1729
|
-
const
|
|
1730
|
-
if (
|
|
1800
|
+
const l = o.caseMinCount, u = L(a).length;
|
|
1801
|
+
if (l !== void 0 && u < l && Be(o, u))
|
|
1731
1802
|
return {
|
|
1732
1803
|
fieldName: i,
|
|
1733
1804
|
label: s,
|
|
1734
|
-
message: `「${s}」至少选择 ${
|
|
1805
|
+
message: `「${s}」至少选择 ${l} 项`
|
|
1735
1806
|
};
|
|
1736
1807
|
}
|
|
1737
1808
|
}
|
|
1738
1809
|
return null;
|
|
1739
1810
|
}
|
|
1740
|
-
const
|
|
1741
|
-
video:
|
|
1742
|
-
audio:
|
|
1743
|
-
image:
|
|
1744
|
-
file:
|
|
1745
|
-
spreadsheet:
|
|
1746
|
-
document:
|
|
1811
|
+
const mo = {
|
|
1812
|
+
video: yn,
|
|
1813
|
+
audio: gn,
|
|
1814
|
+
image: hn,
|
|
1815
|
+
file: bt,
|
|
1816
|
+
spreadsheet: fn,
|
|
1817
|
+
document: vt
|
|
1747
1818
|
};
|
|
1748
|
-
function
|
|
1819
|
+
function po({
|
|
1749
1820
|
type: e,
|
|
1750
1821
|
size: t = 40,
|
|
1751
1822
|
className: n
|
|
1752
1823
|
}) {
|
|
1753
|
-
const r =
|
|
1754
|
-
return /* @__PURE__ */
|
|
1824
|
+
const r = mo[e] ?? bt;
|
|
1825
|
+
return /* @__PURE__ */ c(
|
|
1755
1826
|
r,
|
|
1756
1827
|
{
|
|
1757
1828
|
className: n ?? "skopon-form-file-placeholder-icon",
|
|
@@ -1760,7 +1831,7 @@ function to({
|
|
|
1760
1831
|
}
|
|
1761
1832
|
);
|
|
1762
1833
|
}
|
|
1763
|
-
const
|
|
1834
|
+
const Yt = "skopon-form-v0_9", fo = /* @__PURE__ */ new Set([
|
|
1764
1835
|
"SkoponMedia",
|
|
1765
1836
|
"SkoponSelect",
|
|
1766
1837
|
"Image",
|
|
@@ -1772,24 +1843,24 @@ const $t = "skopon-form-v0_9", no = /* @__PURE__ */ new Set([
|
|
|
1772
1843
|
"FileUpload",
|
|
1773
1844
|
"TextField",
|
|
1774
1845
|
"Text",
|
|
1775
|
-
...
|
|
1776
|
-
]),
|
|
1777
|
-
function
|
|
1778
|
-
const t = [...
|
|
1846
|
+
...kr()
|
|
1847
|
+
]), ho = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
|
|
1848
|
+
function ue(e) {
|
|
1849
|
+
const t = [...ge.components.values()].find((n) => n.name === e);
|
|
1779
1850
|
if (!t) throw new Error(`Missing basic catalog component: ${e}`);
|
|
1780
1851
|
return t.schema;
|
|
1781
1852
|
}
|
|
1782
|
-
function
|
|
1853
|
+
function N(e) {
|
|
1783
1854
|
return typeof e == "string" ? e : "";
|
|
1784
1855
|
}
|
|
1785
|
-
function
|
|
1856
|
+
function Wt(e) {
|
|
1786
1857
|
return Array.isArray(e) ? e.map((t) => {
|
|
1787
1858
|
if (!t || typeof t != "object") return null;
|
|
1788
1859
|
const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
|
|
1789
1860
|
return { value: r, label: o };
|
|
1790
1861
|
}).filter((t) => !!t) : [];
|
|
1791
1862
|
}
|
|
1792
|
-
function
|
|
1863
|
+
function _e({
|
|
1793
1864
|
mediaType: e,
|
|
1794
1865
|
urls: t,
|
|
1795
1866
|
mediaSize: n,
|
|
@@ -1797,49 +1868,49 @@ function xe({
|
|
|
1797
1868
|
help: o,
|
|
1798
1869
|
placeholder: i
|
|
1799
1870
|
}) {
|
|
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__ */
|
|
1871
|
+
const a = r == null ? void 0 : r.trim(), s = o == null ? void 0 : o.trim(), l = Ln(n), u = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
|
|
1872
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1873
|
+
a ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: a }) : null,
|
|
1874
|
+
t.length === 0 ? /* @__PURE__ */ c("div", { className: "form-media-preview form-media-preview--empty", children: u }) : /* @__PURE__ */ c("div", { className: l, children: t.map((m, d) => e === "image" ? /* @__PURE__ */ c(
|
|
1804
1875
|
"img",
|
|
1805
1876
|
{
|
|
1806
|
-
src:
|
|
1877
|
+
src: m,
|
|
1807
1878
|
alt: a || "图片",
|
|
1808
1879
|
className: "form-media-item"
|
|
1809
1880
|
},
|
|
1810
|
-
`media-${
|
|
1811
|
-
) : e === "video" ? /* @__PURE__ */
|
|
1881
|
+
`media-${d}`
|
|
1882
|
+
) : e === "video" ? /* @__PURE__ */ c(
|
|
1812
1883
|
"video",
|
|
1813
1884
|
{
|
|
1814
|
-
src:
|
|
1885
|
+
src: m,
|
|
1815
1886
|
controls: !0,
|
|
1816
1887
|
className: "form-media-item"
|
|
1817
1888
|
},
|
|
1818
|
-
`media-${
|
|
1819
|
-
) : /* @__PURE__ */
|
|
1889
|
+
`media-${d}`
|
|
1890
|
+
) : /* @__PURE__ */ c(
|
|
1820
1891
|
"audio",
|
|
1821
1892
|
{
|
|
1822
|
-
src:
|
|
1893
|
+
src: m,
|
|
1823
1894
|
controls: !0,
|
|
1824
1895
|
className: "form-media-item form-media-item--audio"
|
|
1825
1896
|
},
|
|
1826
|
-
`media-${
|
|
1897
|
+
`media-${d}`
|
|
1827
1898
|
)) }),
|
|
1828
|
-
s ? /* @__PURE__ */
|
|
1899
|
+
s ? /* @__PURE__ */ c(D.Text, { type: "secondary", className: "form-block-preview-help", children: s }) : null
|
|
1829
1900
|
] });
|
|
1830
1901
|
}
|
|
1831
|
-
function
|
|
1832
|
-
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) :
|
|
1902
|
+
function Te(e, t) {
|
|
1903
|
+
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : N(e.url).trim() ? [N(e.url).trim()] : [];
|
|
1833
1904
|
return {
|
|
1834
1905
|
mediaType: t,
|
|
1835
1906
|
urls: n,
|
|
1836
|
-
mediaSize:
|
|
1837
|
-
label:
|
|
1838
|
-
help:
|
|
1839
|
-
placeholder:
|
|
1907
|
+
mediaSize: le(e.mediaSize),
|
|
1908
|
+
label: N(e.label) || N(e.description),
|
|
1909
|
+
help: N(e.help),
|
|
1910
|
+
placeholder: N(e.placeholder)
|
|
1840
1911
|
};
|
|
1841
1912
|
}
|
|
1842
|
-
const
|
|
1913
|
+
const go = {
|
|
1843
1914
|
name: "SkoponMedia",
|
|
1844
1915
|
schema: f.object({
|
|
1845
1916
|
mediaType: f.any().optional(),
|
|
@@ -1849,19 +1920,19 @@ const oo = {
|
|
|
1849
1920
|
help: f.any().optional(),
|
|
1850
1921
|
placeholder: f.any().optional()
|
|
1851
1922
|
}).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
|
-
),
|
|
1923
|
+
}, yo = j(go, ({ context: e }) => {
|
|
1924
|
+
const t = e.componentModel.properties, n = N(t.mediaType);
|
|
1925
|
+
return /* @__PURE__ */ c(_e, { ...Te(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
|
|
1926
|
+
}), vo = j(
|
|
1927
|
+
{ name: "Image", schema: ue("Image") },
|
|
1928
|
+
({ context: e }) => /* @__PURE__ */ c(_e, { ...Te(e.componentModel.properties, "image") })
|
|
1929
|
+
), bo = j(
|
|
1930
|
+
{ name: "Video", schema: ue("Video") },
|
|
1931
|
+
({ context: e }) => /* @__PURE__ */ c(_e, { ...Te(e.componentModel.properties, "video") })
|
|
1932
|
+
), So = j(
|
|
1933
|
+
{ name: "AudioPlayer", schema: ue("AudioPlayer") },
|
|
1934
|
+
({ context: e }) => /* @__PURE__ */ c(_e, { ...Te(e.componentModel.properties, "audio") })
|
|
1935
|
+
), ko = {
|
|
1865
1936
|
name: "SkoponSelect",
|
|
1866
1937
|
schema: f.object({
|
|
1867
1938
|
label: f.any().optional(),
|
|
@@ -1871,87 +1942,87 @@ const oo = {
|
|
|
1871
1942
|
value: f.any().optional()
|
|
1872
1943
|
}).passthrough()
|
|
1873
1944
|
};
|
|
1874
|
-
function
|
|
1875
|
-
const { interactive: t } =
|
|
1876
|
-
return
|
|
1877
|
-
const u =
|
|
1945
|
+
function Ao({ context: e }) {
|
|
1946
|
+
const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = N(o.label), a = N(o.placeholder), s = Wt(o.options), l = N(o.mode) === "multiple";
|
|
1947
|
+
return B(() => {
|
|
1948
|
+
const u = It(n, l);
|
|
1878
1949
|
u !== null && r(u);
|
|
1879
|
-
}, [
|
|
1880
|
-
i ? /* @__PURE__ */
|
|
1881
|
-
/* @__PURE__ */
|
|
1882
|
-
|
|
1950
|
+
}, [l, n, r]), /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1951
|
+
i ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1952
|
+
/* @__PURE__ */ c(
|
|
1953
|
+
qe,
|
|
1883
1954
|
{
|
|
1884
|
-
mode:
|
|
1955
|
+
mode: l ? "multiple" : void 0,
|
|
1885
1956
|
disabled: !t,
|
|
1886
1957
|
allowClear: !0,
|
|
1887
1958
|
className: "form-block-preview-control",
|
|
1888
1959
|
style: { width: "100%" },
|
|
1889
|
-
placeholder: a || (
|
|
1960
|
+
placeholder: a || (l ? "请选择多项" : "请选择"),
|
|
1890
1961
|
options: s,
|
|
1891
|
-
value:
|
|
1892
|
-
onChange: (u) => r(
|
|
1962
|
+
value: l ? L(n) : ie(n),
|
|
1963
|
+
onChange: (u) => r(l ? u ?? [] : u ?? "")
|
|
1893
1964
|
}
|
|
1894
1965
|
)
|
|
1895
1966
|
] });
|
|
1896
1967
|
}
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1899
|
-
|
|
1968
|
+
const Co = j(
|
|
1969
|
+
ko,
|
|
1970
|
+
Ao
|
|
1900
1971
|
);
|
|
1901
|
-
function
|
|
1902
|
-
const { interactive: t } =
|
|
1903
|
-
return
|
|
1904
|
-
const h =
|
|
1972
|
+
function xo({ context: e }) {
|
|
1973
|
+
const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = N(o.label), a = N(o.variant) || "mutuallyExclusive", s = N(o.skoponPickerType), l = N(o.placeholder), u = Wt(o.options), d = s === "select" || s === "multiselect" || s === "radio" || s === "checkbox" ? s : a === "multipleSelection" ? "checkbox" : "radio", b = d === "multiselect" || d === "checkbox";
|
|
1974
|
+
return B(() => {
|
|
1975
|
+
const h = It(n, b);
|
|
1905
1976
|
h !== null && r(h);
|
|
1906
|
-
}, [
|
|
1907
|
-
i ? /* @__PURE__ */
|
|
1908
|
-
|
|
1909
|
-
|
|
1977
|
+
}, [b, n, r]), /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
1978
|
+
i ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: i }) : null,
|
|
1979
|
+
d === "select" ? /* @__PURE__ */ c(
|
|
1980
|
+
qe,
|
|
1910
1981
|
{
|
|
1911
1982
|
disabled: !t,
|
|
1912
1983
|
allowClear: !0,
|
|
1913
1984
|
className: "form-block-preview-control",
|
|
1914
1985
|
style: { width: "100%" },
|
|
1915
|
-
placeholder:
|
|
1986
|
+
placeholder: l || "请选择",
|
|
1916
1987
|
options: u,
|
|
1917
|
-
value:
|
|
1988
|
+
value: ie(n),
|
|
1918
1989
|
onChange: (h) => r(h ?? "")
|
|
1919
1990
|
}
|
|
1920
|
-
) :
|
|
1921
|
-
|
|
1991
|
+
) : d === "multiselect" ? /* @__PURE__ */ c(
|
|
1992
|
+
qe,
|
|
1922
1993
|
{
|
|
1923
1994
|
mode: "multiple",
|
|
1924
1995
|
disabled: !t,
|
|
1925
1996
|
allowClear: !0,
|
|
1926
1997
|
className: "form-block-preview-control",
|
|
1927
1998
|
style: { width: "100%" },
|
|
1928
|
-
placeholder:
|
|
1999
|
+
placeholder: l || "请选择多项",
|
|
1929
2000
|
options: u,
|
|
1930
|
-
value:
|
|
2001
|
+
value: L(n),
|
|
1931
2002
|
onChange: (h) => r(h ?? [])
|
|
1932
2003
|
}
|
|
1933
|
-
) :
|
|
1934
|
-
|
|
2004
|
+
) : d === "checkbox" ? /* @__PURE__ */ c(
|
|
2005
|
+
on.Group,
|
|
1935
2006
|
{
|
|
1936
2007
|
disabled: !t,
|
|
1937
2008
|
className: "form-block-preview-control",
|
|
1938
2009
|
options: u,
|
|
1939
|
-
value:
|
|
2010
|
+
value: L(n),
|
|
1940
2011
|
onChange: (h) => r(h)
|
|
1941
2012
|
}
|
|
1942
|
-
) : /* @__PURE__ */
|
|
1943
|
-
|
|
2013
|
+
) : /* @__PURE__ */ c(
|
|
2014
|
+
an.Group,
|
|
1944
2015
|
{
|
|
1945
2016
|
disabled: !t,
|
|
1946
2017
|
className: "form-block-preview-control",
|
|
1947
2018
|
options: u,
|
|
1948
|
-
value:
|
|
2019
|
+
value: ie(n),
|
|
1949
2020
|
onChange: (h) => r(h.target.value)
|
|
1950
2021
|
}
|
|
1951
2022
|
)
|
|
1952
2023
|
] });
|
|
1953
2024
|
}
|
|
1954
|
-
const
|
|
2025
|
+
const _o = j(
|
|
1955
2026
|
{
|
|
1956
2027
|
name: "ChoicePicker",
|
|
1957
2028
|
schema: f.object({
|
|
@@ -1963,80 +2034,80 @@ const fo = O(
|
|
|
1963
2034
|
placeholder: f.any().optional()
|
|
1964
2035
|
}).passthrough()
|
|
1965
2036
|
},
|
|
1966
|
-
|
|
2037
|
+
xo
|
|
1967
2038
|
);
|
|
1968
|
-
function
|
|
1969
|
-
const { interactive: t } =
|
|
1970
|
-
return /* @__PURE__ */
|
|
1971
|
-
i ? /* @__PURE__ */
|
|
1972
|
-
/* @__PURE__ */
|
|
1973
|
-
|
|
2039
|
+
function To({ context: e }) {
|
|
2040
|
+
const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = N(o.label);
|
|
2041
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
2042
|
+
i ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: i }) : null,
|
|
2043
|
+
/* @__PURE__ */ c(
|
|
2044
|
+
sn,
|
|
1974
2045
|
{
|
|
1975
2046
|
disabled: !t,
|
|
1976
2047
|
className: "form-block-preview-control",
|
|
1977
|
-
checked:
|
|
2048
|
+
checked: ce(n),
|
|
1978
2049
|
onChange: (a) => r(a)
|
|
1979
2050
|
}
|
|
1980
2051
|
)
|
|
1981
2052
|
] });
|
|
1982
2053
|
}
|
|
1983
|
-
const
|
|
1984
|
-
{ name: "CheckBox", schema:
|
|
1985
|
-
|
|
2054
|
+
const Io = j(
|
|
2055
|
+
{ name: "CheckBox", schema: ue("CheckBox") },
|
|
2056
|
+
To
|
|
1986
2057
|
);
|
|
1987
|
-
function
|
|
1988
|
-
const r =
|
|
2058
|
+
function No(e, t, n) {
|
|
2059
|
+
const r = ie(e);
|
|
1989
2060
|
if (!r) return;
|
|
1990
2061
|
if (!t && n) {
|
|
1991
|
-
const i =
|
|
2062
|
+
const i = ut(r, "HH:mm", !0);
|
|
1992
2063
|
return i.isValid() ? i : void 0;
|
|
1993
2064
|
}
|
|
1994
|
-
const o =
|
|
2065
|
+
const o = ut(r);
|
|
1995
2066
|
return o.isValid() ? o : void 0;
|
|
1996
2067
|
}
|
|
1997
|
-
function
|
|
1998
|
-
const { interactive: t } =
|
|
1999
|
-
if (!
|
|
2068
|
+
function Mo({ context: e }) {
|
|
2069
|
+
const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = N(o.label), a = N(o.placeholder), s = o.enableDate === !0, l = o.enableTime === !0, u = No(n, s, l), m = (d) => {
|
|
2070
|
+
if (!d) {
|
|
2000
2071
|
r("");
|
|
2001
2072
|
return;
|
|
2002
2073
|
}
|
|
2003
|
-
if (!s &&
|
|
2004
|
-
r(
|
|
2074
|
+
if (!s && l) {
|
|
2075
|
+
r(d.format("HH:mm"));
|
|
2005
2076
|
return;
|
|
2006
2077
|
}
|
|
2007
|
-
if (s &&
|
|
2008
|
-
r(
|
|
2078
|
+
if (s && l) {
|
|
2079
|
+
r(d.format("YYYY-MM-DDTHH:mm"));
|
|
2009
2080
|
return;
|
|
2010
2081
|
}
|
|
2011
|
-
r(
|
|
2082
|
+
r(d.format("YYYY-MM-DD"));
|
|
2012
2083
|
};
|
|
2013
|
-
return /* @__PURE__ */
|
|
2014
|
-
i ? /* @__PURE__ */
|
|
2015
|
-
!s &&
|
|
2016
|
-
|
|
2084
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
2085
|
+
i ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: i }) : null,
|
|
2086
|
+
!s && l ? /* @__PURE__ */ c(
|
|
2087
|
+
ln,
|
|
2017
2088
|
{
|
|
2018
2089
|
disabled: !t,
|
|
2019
2090
|
className: "form-block-preview-control",
|
|
2020
2091
|
style: { width: "100%" },
|
|
2021
2092
|
placeholder: a || "选择时间",
|
|
2022
2093
|
value: u,
|
|
2023
|
-
onChange:
|
|
2094
|
+
onChange: m
|
|
2024
2095
|
}
|
|
2025
|
-
) : /* @__PURE__ */
|
|
2026
|
-
|
|
2096
|
+
) : /* @__PURE__ */ c(
|
|
2097
|
+
cn,
|
|
2027
2098
|
{
|
|
2028
|
-
showTime: s &&
|
|
2099
|
+
showTime: s && l,
|
|
2029
2100
|
disabled: !t,
|
|
2030
2101
|
className: "form-block-preview-control",
|
|
2031
2102
|
style: { width: "100%" },
|
|
2032
|
-
placeholder: a || (s &&
|
|
2103
|
+
placeholder: a || (s && l ? "选择日期时间" : "选择日期"),
|
|
2033
2104
|
value: u,
|
|
2034
|
-
onChange:
|
|
2105
|
+
onChange: m
|
|
2035
2106
|
}
|
|
2036
2107
|
)
|
|
2037
2108
|
] });
|
|
2038
2109
|
}
|
|
2039
|
-
const
|
|
2110
|
+
const Fo = j(
|
|
2040
2111
|
{
|
|
2041
2112
|
name: "DateTimeInput",
|
|
2042
2113
|
schema: f.object({
|
|
@@ -2049,8 +2120,8 @@ const bo = O(
|
|
|
2049
2120
|
max: f.any().optional()
|
|
2050
2121
|
}).passthrough()
|
|
2051
2122
|
},
|
|
2052
|
-
|
|
2053
|
-
),
|
|
2123
|
+
Mo
|
|
2124
|
+
), Uo = {
|
|
2054
2125
|
name: "FileUpload",
|
|
2055
2126
|
schema: f.object({
|
|
2056
2127
|
label: f.any().optional(),
|
|
@@ -2062,130 +2133,130 @@ const bo = O(
|
|
|
2062
2133
|
value: f.any().optional()
|
|
2063
2134
|
}).passthrough()
|
|
2064
2135
|
};
|
|
2065
|
-
function
|
|
2066
|
-
const { interactive: t } =
|
|
2136
|
+
function Po({ context: e }) {
|
|
2137
|
+
const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = N(o.label), a = N(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 = En(s, l), m = typeof o.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
|
|
2067
2138
|
o.filePlaceholderIcon
|
|
2068
|
-
) ? o.filePlaceholderIcon : "document",
|
|
2069
|
-
return /* @__PURE__ */
|
|
2070
|
-
i ? /* @__PURE__ */
|
|
2071
|
-
/* @__PURE__ */
|
|
2072
|
-
|
|
2139
|
+
) ? o.filePlaceholderIcon : "document", d = typeof o.minCount == "number" ? Math.max(0, o.minCount) : 0, b = typeof o.maxCount == "number" ? o.maxCount : 1, h = b > 0, x = L(n), _ = h && x.length >= b, y = x.length < d;
|
|
2140
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
2141
|
+
i ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: i }) : null,
|
|
2142
|
+
/* @__PURE__ */ C(
|
|
2143
|
+
Ne.Dragger,
|
|
2073
2144
|
{
|
|
2074
|
-
disabled: !t ||
|
|
2075
|
-
accept:
|
|
2145
|
+
disabled: !t || _,
|
|
2146
|
+
accept: Pn(s, l),
|
|
2076
2147
|
className: "form-file-upload-preview",
|
|
2077
2148
|
showUploadList: t && x.length > 0,
|
|
2078
|
-
fileList: t ? x.map((p,
|
|
2079
|
-
uid: `${
|
|
2149
|
+
fileList: t ? x.map((p, v) => ({
|
|
2150
|
+
uid: `${v}-${p}`,
|
|
2080
2151
|
name: p,
|
|
2081
2152
|
status: "done"
|
|
2082
2153
|
})) : [],
|
|
2083
2154
|
beforeUpload: (p) => {
|
|
2084
|
-
if (!t) return
|
|
2085
|
-
const
|
|
2086
|
-
if (h &&
|
|
2087
|
-
const
|
|
2088
|
-
return r(
|
|
2155
|
+
if (!t) return Ne.LIST_IGNORE;
|
|
2156
|
+
const v = L(pt(e));
|
|
2157
|
+
if (h && v.length >= b) return Ne.LIST_IGNORE;
|
|
2158
|
+
const A = h ? [...v, p.name].slice(0, b) : [...v, p.name];
|
|
2159
|
+
return r(A), !1;
|
|
2089
2160
|
},
|
|
2090
2161
|
onRemove: (p) => {
|
|
2091
|
-
const
|
|
2092
|
-
if (
|
|
2093
|
-
r(
|
|
2162
|
+
const v = L(pt(e)), A = /^(\d+)-/.exec(p.uid ?? ""), g = A ? Number(A[1]) : -1, I = g >= 0 && g < v.length ? v.filter((U, V) => V !== g) : v.filter((U) => U !== p.name);
|
|
2163
|
+
if (I.length < d) return !1;
|
|
2164
|
+
r(I);
|
|
2094
2165
|
},
|
|
2095
2166
|
children: [
|
|
2096
|
-
/* @__PURE__ */
|
|
2097
|
-
/* @__PURE__ */
|
|
2167
|
+
/* @__PURE__ */ c("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ c(po, { type: m, size: 40 }) }),
|
|
2168
|
+
/* @__PURE__ */ c("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
|
|
2098
2169
|
]
|
|
2099
2170
|
}
|
|
2100
2171
|
),
|
|
2101
|
-
/* @__PURE__ */
|
|
2172
|
+
/* @__PURE__ */ C(D.Text, { type: "secondary", className: "form-block-preview-help", children: [
|
|
2102
2173
|
"允许:",
|
|
2103
2174
|
u ?? "全部类型",
|
|
2104
|
-
|
|
2105
|
-
h ? `;最多 ${
|
|
2175
|
+
d > 0 ? `;至少 ${d} 个文件` : "",
|
|
2176
|
+
h ? `;最多 ${b} 个文件` : "",
|
|
2106
2177
|
";当前仅收集文件名(不含文件内容,需宿主另行上传)",
|
|
2107
|
-
|
|
2178
|
+
y && t ? `(当前 ${x.length} 个,未达下限)` : ""
|
|
2108
2179
|
] })
|
|
2109
2180
|
] });
|
|
2110
2181
|
}
|
|
2111
|
-
const
|
|
2112
|
-
|
|
2113
|
-
|
|
2182
|
+
const Eo = j(
|
|
2183
|
+
Uo,
|
|
2184
|
+
Po
|
|
2114
2185
|
);
|
|
2115
|
-
function
|
|
2116
|
-
const { interactive: t } =
|
|
2117
|
-
if (!
|
|
2118
|
-
|
|
2186
|
+
function zo({ context: e }) {
|
|
2187
|
+
const { interactive: t } = K(), { value: n, setValue: r } = G(e), o = e.componentModel.properties, i = N(o.label), a = N(o.placeholder), s = N(o.variant) || "shortText", l = N(o.validationRegexp), u = ie(n) ?? "", m = !t, [d, b] = P(""), h = (y) => {
|
|
2188
|
+
if (!l || !y.trim()) {
|
|
2189
|
+
b("");
|
|
2119
2190
|
return;
|
|
2120
2191
|
}
|
|
2121
|
-
|
|
2192
|
+
b(Gt(y, l) ? "" : "格式不正确");
|
|
2122
2193
|
};
|
|
2123
|
-
|
|
2194
|
+
B(() => {
|
|
2124
2195
|
h(u);
|
|
2125
|
-
}, [
|
|
2196
|
+
}, [l, u]);
|
|
2126
2197
|
const x = "form-block-preview-control";
|
|
2127
|
-
let
|
|
2198
|
+
let _;
|
|
2128
2199
|
if (s === "longText")
|
|
2129
|
-
|
|
2200
|
+
_ = /* @__PURE__ */ c(
|
|
2130
2201
|
Me.TextArea,
|
|
2131
2202
|
{
|
|
2132
|
-
disabled:
|
|
2203
|
+
disabled: m,
|
|
2133
2204
|
className: x,
|
|
2134
2205
|
placeholder: a || "长文本回答...",
|
|
2135
2206
|
autoSize: { minRows: 2, maxRows: 6 },
|
|
2136
2207
|
value: u,
|
|
2137
|
-
status:
|
|
2138
|
-
onChange: (
|
|
2139
|
-
const p =
|
|
2208
|
+
status: d ? "error" : void 0,
|
|
2209
|
+
onChange: (y) => {
|
|
2210
|
+
const p = y.target.value;
|
|
2140
2211
|
r(p), h(p);
|
|
2141
2212
|
},
|
|
2142
|
-
onBlur: (
|
|
2213
|
+
onBlur: (y) => h(y.target.value)
|
|
2143
2214
|
}
|
|
2144
2215
|
);
|
|
2145
2216
|
else if (s === "number") {
|
|
2146
|
-
const
|
|
2147
|
-
|
|
2148
|
-
|
|
2217
|
+
const y = u && Number.isFinite(Number(u)) ? Number(u) : void 0;
|
|
2218
|
+
_ = /* @__PURE__ */ c(
|
|
2219
|
+
un,
|
|
2149
2220
|
{
|
|
2150
|
-
disabled:
|
|
2221
|
+
disabled: m,
|
|
2151
2222
|
className: x,
|
|
2152
2223
|
style: { width: "100%" },
|
|
2153
2224
|
placeholder: a || "数字",
|
|
2154
|
-
value:
|
|
2225
|
+
value: y,
|
|
2155
2226
|
onChange: (p) => r(p == null ? "" : String(p))
|
|
2156
2227
|
}
|
|
2157
2228
|
);
|
|
2158
|
-
} else s === "obscured" ?
|
|
2229
|
+
} else s === "obscured" ? _ = /* @__PURE__ */ c(
|
|
2159
2230
|
Me.Password,
|
|
2160
2231
|
{
|
|
2161
|
-
disabled:
|
|
2232
|
+
disabled: m,
|
|
2162
2233
|
className: x,
|
|
2163
2234
|
placeholder: a,
|
|
2164
2235
|
value: u,
|
|
2165
|
-
onChange: (
|
|
2236
|
+
onChange: (y) => r(y.target.value)
|
|
2166
2237
|
}
|
|
2167
|
-
) :
|
|
2238
|
+
) : _ = /* @__PURE__ */ c(
|
|
2168
2239
|
Me,
|
|
2169
2240
|
{
|
|
2170
|
-
disabled:
|
|
2241
|
+
disabled: m,
|
|
2171
2242
|
className: x,
|
|
2172
2243
|
placeholder: a,
|
|
2173
2244
|
value: u,
|
|
2174
|
-
status:
|
|
2175
|
-
onChange: (
|
|
2176
|
-
const p =
|
|
2245
|
+
status: d ? "error" : void 0,
|
|
2246
|
+
onChange: (y) => {
|
|
2247
|
+
const p = y.target.value;
|
|
2177
2248
|
r(p), h(p);
|
|
2178
2249
|
},
|
|
2179
|
-
onBlur: (
|
|
2250
|
+
onBlur: (y) => h(y.target.value)
|
|
2180
2251
|
}
|
|
2181
2252
|
);
|
|
2182
|
-
return /* @__PURE__ */
|
|
2183
|
-
i ? /* @__PURE__ */
|
|
2184
|
-
|
|
2185
|
-
|
|
2253
|
+
return /* @__PURE__ */ C("div", { className: "form-block-preview", children: [
|
|
2254
|
+
i ? /* @__PURE__ */ c("div", { className: "form-block-preview-label", children: i }) : null,
|
|
2255
|
+
_,
|
|
2256
|
+
d ? /* @__PURE__ */ c(D.Text, { type: "danger", className: "form-block-preview-help", children: d }) : null
|
|
2186
2257
|
] });
|
|
2187
2258
|
}
|
|
2188
|
-
const
|
|
2259
|
+
const Ro = j(
|
|
2189
2260
|
{
|
|
2190
2261
|
name: "TextField",
|
|
2191
2262
|
schema: f.object({
|
|
@@ -2196,37 +2267,37 @@ const Ao = O(
|
|
|
2196
2267
|
value: f.any().optional()
|
|
2197
2268
|
}).passthrough()
|
|
2198
2269
|
},
|
|
2199
|
-
|
|
2270
|
+
zo
|
|
2200
2271
|
);
|
|
2201
|
-
function
|
|
2202
|
-
const t = e.componentModel.properties, n =
|
|
2203
|
-
return
|
|
2272
|
+
function wo({ context: e }) {
|
|
2273
|
+
const t = e.componentModel.properties, n = N(t.text), r = N(t.variant) || "body";
|
|
2274
|
+
return ho.has(r) ? r === "caption" ? /* @__PURE__ */ c(D.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(D.Paragraph, { className: "form-block-preview-paragraph", children: n });
|
|
2204
2275
|
}
|
|
2205
|
-
const
|
|
2206
|
-
{ name: "Text", schema:
|
|
2207
|
-
|
|
2276
|
+
const Bo = j(
|
|
2277
|
+
{ name: "Text", schema: ue("Text") },
|
|
2278
|
+
wo
|
|
2208
2279
|
);
|
|
2209
|
-
function
|
|
2280
|
+
function Xt() {
|
|
2210
2281
|
const t = [
|
|
2211
|
-
...[...
|
|
2212
|
-
(r) => !
|
|
2282
|
+
...[...ge.components.values()].filter(
|
|
2283
|
+
(r) => !fo.has(r.name)
|
|
2213
2284
|
),
|
|
2214
|
-
|
|
2215
|
-
mo,
|
|
2216
|
-
ao,
|
|
2217
|
-
so,
|
|
2218
|
-
lo,
|
|
2219
|
-
fo,
|
|
2220
|
-
go,
|
|
2221
|
-
bo,
|
|
2285
|
+
yo,
|
|
2222
2286
|
Co,
|
|
2223
|
-
|
|
2287
|
+
vo,
|
|
2288
|
+
bo,
|
|
2289
|
+
So,
|
|
2290
|
+
_o,
|
|
2224
2291
|
Io,
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2292
|
+
Fo,
|
|
2293
|
+
Eo,
|
|
2294
|
+
Ro,
|
|
2295
|
+
Bo,
|
|
2296
|
+
...Sr()
|
|
2297
|
+
], n = [...ge.functions.values()];
|
|
2298
|
+
return new vn(Yt, t, n, ge.themeSchema);
|
|
2299
|
+
}
|
|
2300
|
+
const H = {
|
|
2230
2301
|
jade9: "#29a383",
|
|
2231
2302
|
jade10: "#26997b",
|
|
2232
2303
|
jade11: "#208368",
|
|
@@ -2238,20 +2309,20 @@ const D = {
|
|
|
2238
2309
|
primaryHover: "#26997b",
|
|
2239
2310
|
primaryActive: "#1d3b31",
|
|
2240
2311
|
onPrimary: "#ffffff"
|
|
2241
|
-
},
|
|
2312
|
+
}, qo = {
|
|
2242
2313
|
cssVar: { key: "vidtempl" },
|
|
2243
2314
|
token: {
|
|
2244
|
-
colorPrimary:
|
|
2245
|
-
colorPrimaryHover:
|
|
2246
|
-
colorPrimaryActive:
|
|
2247
|
-
colorLink:
|
|
2248
|
-
colorLinkHover:
|
|
2249
|
-
colorSuccess:
|
|
2315
|
+
colorPrimary: H.primarySolid,
|
|
2316
|
+
colorPrimaryHover: H.primaryHover,
|
|
2317
|
+
colorPrimaryActive: H.primaryActive,
|
|
2318
|
+
colorLink: H.primary,
|
|
2319
|
+
colorLinkHover: H.primaryHover,
|
|
2320
|
+
colorSuccess: H.jade9,
|
|
2250
2321
|
colorWarning: "#f5a623",
|
|
2251
2322
|
gold6: "#f5a623",
|
|
2252
2323
|
gold7: "#e6951a",
|
|
2253
2324
|
colorError: "#e5484d",
|
|
2254
|
-
colorInfo:
|
|
2325
|
+
colorInfo: H.primary,
|
|
2255
2326
|
colorBgLayout: "#f9f9f9",
|
|
2256
2327
|
colorBgContainer: "#ffffff",
|
|
2257
2328
|
colorBgElevated: "#ffffff",
|
|
@@ -2311,7 +2382,7 @@ const D = {
|
|
|
2311
2382
|
},
|
|
2312
2383
|
Tag: {
|
|
2313
2384
|
defaultBg: "#e6f7ed",
|
|
2314
|
-
defaultColor:
|
|
2385
|
+
defaultColor: H.primary,
|
|
2315
2386
|
fontSizeSM: 13
|
|
2316
2387
|
},
|
|
2317
2388
|
Form: {
|
|
@@ -2323,14 +2394,14 @@ const D = {
|
|
|
2323
2394
|
}
|
|
2324
2395
|
}
|
|
2325
2396
|
};
|
|
2326
|
-
function
|
|
2397
|
+
function Y({
|
|
2327
2398
|
children: e,
|
|
2328
2399
|
locale: t,
|
|
2329
2400
|
theme: n
|
|
2330
2401
|
}) {
|
|
2331
|
-
return /* @__PURE__ */
|
|
2402
|
+
return /* @__PURE__ */ c(mn, { theme: n ?? qo, locale: t, children: e });
|
|
2332
2403
|
}
|
|
2333
|
-
const
|
|
2404
|
+
const Oo = tn(
|
|
2334
2405
|
function({
|
|
2335
2406
|
doc: t,
|
|
2336
2407
|
surfaceId: n = "skopon-form",
|
|
@@ -2339,59 +2410,59 @@ const Mo = Jt(
|
|
|
2339
2410
|
fieldNames: i = [],
|
|
2340
2411
|
resumeSearch: a = null,
|
|
2341
2412
|
caseSearch: s = null,
|
|
2342
|
-
wrapProvider:
|
|
2413
|
+
wrapProvider: l = !0
|
|
2343
2414
|
}, u) {
|
|
2344
|
-
|
|
2345
|
-
|
|
2415
|
+
B(() => {
|
|
2416
|
+
Ct(), At();
|
|
2346
2417
|
}, []);
|
|
2347
|
-
const
|
|
2348
|
-
|
|
2349
|
-
const
|
|
2350
|
-
if (
|
|
2418
|
+
const m = O(null), d = O(i);
|
|
2419
|
+
d.current = i;
|
|
2420
|
+
const b = w(() => {
|
|
2421
|
+
if (De(t)) return "";
|
|
2351
2422
|
try {
|
|
2352
2423
|
return JSON.stringify(t);
|
|
2353
2424
|
} catch {
|
|
2354
2425
|
return String(t);
|
|
2355
2426
|
}
|
|
2356
|
-
}, [t]), h =
|
|
2357
|
-
if (!
|
|
2427
|
+
}, [t]), h = w(() => {
|
|
2428
|
+
if (!b)
|
|
2358
2429
|
return { surfaces: [], processor: null };
|
|
2359
2430
|
try {
|
|
2360
|
-
const p = JSON.parse(
|
|
2431
|
+
const p = JSON.parse(b), v = new kt([Xt()]), A = Ur(p, {
|
|
2361
2432
|
surfaceId: n,
|
|
2362
|
-
catalogId:
|
|
2433
|
+
catalogId: Yt
|
|
2363
2434
|
});
|
|
2364
|
-
return
|
|
2365
|
-
surfaces: Array.from(
|
|
2366
|
-
processor:
|
|
2435
|
+
return v.processMessages(A), {
|
|
2436
|
+
surfaces: Array.from(v.model.surfacesMap.values()),
|
|
2437
|
+
processor: v
|
|
2367
2438
|
};
|
|
2368
2439
|
} catch (p) {
|
|
2369
2440
|
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", p), { surfaces: [], processor: null };
|
|
2370
2441
|
}
|
|
2371
|
-
}, [
|
|
2372
|
-
if (
|
|
2442
|
+
}, [b, n]), { surfaces: x, processor: _ } = h;
|
|
2443
|
+
if (m.current = _, nn(
|
|
2373
2444
|
u,
|
|
2374
2445
|
() => ({
|
|
2375
2446
|
getValues(p) {
|
|
2376
|
-
const
|
|
2377
|
-
if (!
|
|
2378
|
-
const
|
|
2379
|
-
return
|
|
2447
|
+
const v = m.current;
|
|
2448
|
+
if (!v) return {};
|
|
2449
|
+
const A = (p ?? d.current).map((g) => g.trim()).filter(Boolean);
|
|
2450
|
+
return Rr(v, n, A);
|
|
2380
2451
|
}
|
|
2381
2452
|
}),
|
|
2382
2453
|
[n]
|
|
2383
2454
|
), x.length === 0) {
|
|
2384
|
-
const p = /* @__PURE__ */
|
|
2385
|
-
return
|
|
2455
|
+
const p = /* @__PURE__ */ c(je, { resumeSearch: a, children: /* @__PURE__ */ c(Le, { caseSearch: s, children: /* @__PURE__ */ c(Oe, { interactive: o, children: r }) }) });
|
|
2456
|
+
return l ? /* @__PURE__ */ c(Y, { children: p }) : p;
|
|
2386
2457
|
}
|
|
2387
|
-
const
|
|
2388
|
-
return
|
|
2458
|
+
const y = /* @__PURE__ */ c(je, { resumeSearch: a, children: /* @__PURE__ */ c(Le, { caseSearch: s, children: /* @__PURE__ */ c(Oe, { interactive: o, children: /* @__PURE__ */ c("div", { className: "a2ui-surface a2ui-container", children: x.map((p) => /* @__PURE__ */ c(St, { surface: p }, p.id)) }) }) }) });
|
|
2459
|
+
return l ? /* @__PURE__ */ c(Y, { children: y }) : y;
|
|
2389
2460
|
}
|
|
2390
2461
|
);
|
|
2391
|
-
function
|
|
2392
|
-
return new
|
|
2462
|
+
function he() {
|
|
2463
|
+
return new kt([Xt()]);
|
|
2393
2464
|
}
|
|
2394
|
-
function
|
|
2465
|
+
function oi({
|
|
2395
2466
|
messages: e,
|
|
2396
2467
|
surfaceId: t = "skopon-form-stream",
|
|
2397
2468
|
emptyHint: n = null,
|
|
@@ -2399,149 +2470,154 @@ function Ko({
|
|
|
2399
2470
|
resumeSearch: o = null,
|
|
2400
2471
|
caseSearch: i = null
|
|
2401
2472
|
}) {
|
|
2402
|
-
|
|
2403
|
-
|
|
2473
|
+
B(() => {
|
|
2474
|
+
Ct(), At();
|
|
2404
2475
|
}, []);
|
|
2405
|
-
const a =
|
|
2406
|
-
a.current === null && (a.current =
|
|
2407
|
-
const s =
|
|
2408
|
-
function
|
|
2409
|
-
a.current = p, s.current =
|
|
2476
|
+
const a = O(null);
|
|
2477
|
+
a.current === null && (a.current = he());
|
|
2478
|
+
const s = O(0), l = O(""), u = O(!0), m = O(t);
|
|
2479
|
+
function d(p, v) {
|
|
2480
|
+
a.current = p, s.current = v.length, l.current = JSON.stringify(v), u.current && (x(p), y(Array.from(p.model.surfacesMap.values())));
|
|
2410
2481
|
}
|
|
2411
|
-
function
|
|
2412
|
-
if (
|
|
2413
|
-
const
|
|
2414
|
-
if (!
|
|
2482
|
+
function b(p, v) {
|
|
2483
|
+
if (v <= 0) return !1;
|
|
2484
|
+
const A = JSON.stringify(p.slice(0, v)), g = l.current;
|
|
2485
|
+
if (!g) return !0;
|
|
2415
2486
|
try {
|
|
2416
|
-
const
|
|
2417
|
-
return JSON.stringify(
|
|
2487
|
+
const I = JSON.parse(g);
|
|
2488
|
+
return JSON.stringify(I.slice(0, v)) !== A;
|
|
2418
2489
|
} catch {
|
|
2419
2490
|
return !0;
|
|
2420
2491
|
}
|
|
2421
2492
|
}
|
|
2422
|
-
const [h, x] =
|
|
2493
|
+
const [h, x] = P(
|
|
2423
2494
|
() => a.current
|
|
2424
|
-
), [
|
|
2495
|
+
), [_, y] = P(
|
|
2425
2496
|
() => Array.from(
|
|
2426
2497
|
a.current.model.surfacesMap.values()
|
|
2427
2498
|
)
|
|
2428
2499
|
);
|
|
2429
|
-
return
|
|
2500
|
+
return B(() => (u.current = !0, () => {
|
|
2430
2501
|
u.current = !1;
|
|
2431
|
-
}), []),
|
|
2502
|
+
}), []), B(() => {
|
|
2432
2503
|
a.current = h;
|
|
2433
|
-
}, [h]),
|
|
2504
|
+
}, [h]), B(() => {
|
|
2434
2505
|
const p = () => {
|
|
2435
|
-
u.current &&
|
|
2436
|
-
},
|
|
2506
|
+
u.current && y(Array.from(h.model.surfacesMap.values()));
|
|
2507
|
+
}, v = h.onSurfaceCreated(p), A = h.onSurfaceDeleted(p);
|
|
2437
2508
|
return () => {
|
|
2438
|
-
|
|
2509
|
+
v.unsubscribe(), A.unsubscribe();
|
|
2439
2510
|
};
|
|
2440
|
-
}, [h]),
|
|
2511
|
+
}, [h]), B(() => {
|
|
2441
2512
|
let p = !1;
|
|
2442
|
-
const
|
|
2443
|
-
if (
|
|
2444
|
-
const
|
|
2445
|
-
return Array.isArray(e) && e.length > 0 ? (
|
|
2513
|
+
const v = m.current !== t;
|
|
2514
|
+
if (m.current = t, v) {
|
|
2515
|
+
const U = he();
|
|
2516
|
+
return Array.isArray(e) && e.length > 0 ? (U.processMessages(e), p || d(U, e)) : (a.current = U, s.current = 0, l.current = "", p || (x(U), y([]))), () => {
|
|
2446
2517
|
p = !0;
|
|
2447
2518
|
};
|
|
2448
2519
|
}
|
|
2449
2520
|
if (!Array.isArray(e) || e.length === 0) {
|
|
2450
2521
|
if (s.current > 0) {
|
|
2451
|
-
const
|
|
2452
|
-
a.current =
|
|
2522
|
+
const U = he();
|
|
2523
|
+
a.current = U, s.current = 0, l.current = "", p || (x(U), y([]));
|
|
2453
2524
|
}
|
|
2454
2525
|
return () => {
|
|
2455
2526
|
p = !0;
|
|
2456
2527
|
};
|
|
2457
2528
|
}
|
|
2458
|
-
const
|
|
2459
|
-
if (e.length <
|
|
2460
|
-
const
|
|
2461
|
-
return
|
|
2529
|
+
const A = a.current, g = s.current;
|
|
2530
|
+
if (e.length < g || b(e, g)) {
|
|
2531
|
+
const U = he();
|
|
2532
|
+
return U.processMessages(e), p || d(U, e), () => {
|
|
2462
2533
|
p = !0;
|
|
2463
2534
|
};
|
|
2464
2535
|
}
|
|
2465
|
-
const
|
|
2466
|
-
return
|
|
2536
|
+
const I = e.slice(g);
|
|
2537
|
+
return I.length === 0 ? () => {
|
|
2467
2538
|
p = !0;
|
|
2468
|
-
} : (
|
|
2539
|
+
} : (A.processMessages(I), s.current = e.length, l.current = JSON.stringify(e), p || y(Array.from(A.model.surfacesMap.values())), () => {
|
|
2469
2540
|
p = !0;
|
|
2470
2541
|
});
|
|
2471
|
-
}, [e, t]),
|
|
2472
|
-
}
|
|
2473
|
-
function No(e, t) {
|
|
2474
|
-
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
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})`;
|
|
2542
|
+
}, [e, t]), _.length === 0 ? /* @__PURE__ */ c(Y, { children: n }) : /* @__PURE__ */ c(Y, { children: /* @__PURE__ */ c(je, { resumeSearch: o, children: /* @__PURE__ */ c(Le, { caseSearch: i, children: /* @__PURE__ */ c(Oe, { interactive: r, children: /* @__PURE__ */ c("div", { className: "a2ui-surface a2ui-container", children: _.map((p) => /* @__PURE__ */ c(St, { surface: p }, p.id)) }) }) }) }) });
|
|
2480
2543
|
}
|
|
2481
|
-
function
|
|
2482
|
-
const t =
|
|
2483
|
-
return t ?
|
|
2544
|
+
function Lo(e) {
|
|
2545
|
+
const t = xe(e);
|
|
2546
|
+
return t ? Qe(t.blocks) : e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
2484
2547
|
}
|
|
2485
|
-
function
|
|
2548
|
+
function jo({
|
|
2486
2549
|
payload: e,
|
|
2487
2550
|
callbackUrl: t,
|
|
2488
2551
|
title: n,
|
|
2489
2552
|
unpublishedFormId: r,
|
|
2490
2553
|
incompleteFormId: o,
|
|
2491
2554
|
answerAgentContext: i,
|
|
2492
|
-
|
|
2555
|
+
submitHeaders: a,
|
|
2556
|
+
onNotify: s
|
|
2493
2557
|
}) {
|
|
2494
|
-
const [
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
),
|
|
2558
|
+
const [l, u] = P(!1), m = O(!0);
|
|
2559
|
+
B(() => (m.current = !0, () => {
|
|
2560
|
+
m.current = !1;
|
|
2561
|
+
}), []);
|
|
2562
|
+
const d = w(
|
|
2563
|
+
() => tt(a),
|
|
2564
|
+
[a]
|
|
2565
|
+
), b = w(
|
|
2566
|
+
() => Bt(e, t, d),
|
|
2567
|
+
[e, t, d]
|
|
2568
|
+
), h = w(
|
|
2498
2569
|
() => ({
|
|
2499
2570
|
...i,
|
|
2500
2571
|
callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? t ?? null
|
|
2501
2572
|
}),
|
|
2502
2573
|
[i, t]
|
|
2503
2574
|
);
|
|
2504
|
-
async function
|
|
2505
|
-
if (!
|
|
2506
|
-
|
|
2575
|
+
async function x() {
|
|
2576
|
+
if (!l) {
|
|
2577
|
+
u(!0);
|
|
2507
2578
|
try {
|
|
2508
|
-
const
|
|
2509
|
-
context:
|
|
2579
|
+
const _ = Lo(e), y = rt({
|
|
2580
|
+
context: h,
|
|
2510
2581
|
payload: e,
|
|
2511
|
-
answer:
|
|
2512
|
-
}),
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2582
|
+
answer: _
|
|
2583
|
+
}), p = await Kt(y, {
|
|
2584
|
+
headers: d
|
|
2585
|
+
});
|
|
2586
|
+
if (!m.current) return;
|
|
2587
|
+
const v = Ht(p);
|
|
2588
|
+
s == null || s(v.type, v.message);
|
|
2589
|
+
} catch (_) {
|
|
2590
|
+
if (!m.current) return;
|
|
2591
|
+
const y = _ instanceof Error ? _.message : "提交失败";
|
|
2592
|
+
s == null || s("error", y);
|
|
2517
2593
|
} finally {
|
|
2518
|
-
|
|
2594
|
+
m.current && u(!1);
|
|
2519
2595
|
}
|
|
2520
2596
|
}
|
|
2521
2597
|
}
|
|
2522
|
-
return /* @__PURE__ */
|
|
2523
|
-
/* @__PURE__ */
|
|
2524
|
-
/* @__PURE__ */
|
|
2525
|
-
/* @__PURE__ */
|
|
2526
|
-
r ? /* @__PURE__ */
|
|
2527
|
-
o ? /* @__PURE__ */
|
|
2598
|
+
return /* @__PURE__ */ C("div", { className: "ask-user-curl-card", children: [
|
|
2599
|
+
/* @__PURE__ */ C("div", { className: "ask-user-curl-card-header", children: [
|
|
2600
|
+
/* @__PURE__ */ C("div", { className: "ask-user-curl-card-header-title", children: [
|
|
2601
|
+
/* @__PURE__ */ c(D.Text, { type: "secondary", children: n ?? "curl 命令" }),
|
|
2602
|
+
r ? /* @__PURE__ */ c(re, { title: r, children: /* @__PURE__ */ c(oe, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
|
|
2603
|
+
o ? /* @__PURE__ */ c(re, { title: o, children: /* @__PURE__ */ c(oe, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
|
|
2528
2604
|
] }),
|
|
2529
|
-
/* @__PURE__ */
|
|
2530
|
-
|
|
2605
|
+
/* @__PURE__ */ c(re, { title: "提交到 answer_agent_callback_url", children: /* @__PURE__ */ c(
|
|
2606
|
+
ke,
|
|
2531
2607
|
{
|
|
2532
2608
|
size: "small",
|
|
2533
2609
|
type: "text",
|
|
2534
|
-
loading:
|
|
2535
|
-
disabled:
|
|
2536
|
-
onClick: () => void
|
|
2610
|
+
loading: l,
|
|
2611
|
+
disabled: l,
|
|
2612
|
+
onClick: () => void x(),
|
|
2537
2613
|
children: "提交"
|
|
2538
2614
|
}
|
|
2539
2615
|
) })
|
|
2540
2616
|
] }),
|
|
2541
|
-
/* @__PURE__ */
|
|
2617
|
+
/* @__PURE__ */ c("pre", { className: "skopon-form-curl-json", children: b })
|
|
2542
2618
|
] });
|
|
2543
2619
|
}
|
|
2544
|
-
function
|
|
2620
|
+
function Vo(e, t) {
|
|
2545
2621
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
2546
2622
|
const n = t.message;
|
|
2547
2623
|
if (typeof n == "string" && n.trim())
|
|
@@ -2549,137 +2625,147 @@ function dt(e, t) {
|
|
|
2549
2625
|
}
|
|
2550
2626
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
2551
2627
|
}
|
|
2552
|
-
function
|
|
2628
|
+
function ii({
|
|
2553
2629
|
payload: e,
|
|
2554
2630
|
formUniqueId: t,
|
|
2555
2631
|
callbackUrl: n,
|
|
2556
2632
|
submitMode: r = "curl",
|
|
2557
2633
|
answerAgentContext: o,
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2634
|
+
submitHeaders: i,
|
|
2635
|
+
fetchFormDetail: a,
|
|
2636
|
+
onNotify: s,
|
|
2637
|
+
resumeSearch: l = null,
|
|
2638
|
+
caseSearch: u = null
|
|
2562
2639
|
}) {
|
|
2563
|
-
const [
|
|
2564
|
-
g.current =
|
|
2565
|
-
const
|
|
2640
|
+
const [m, d] = P(null), [b, h] = P(!1), [x, _] = P(!0), [y, p] = P(!1), v = O(null), A = O(!0), g = O(s);
|
|
2641
|
+
g.current = s;
|
|
2642
|
+
const I = (t == null ? void 0 : t.trim()) ?? "", U = w(
|
|
2643
|
+
() => tt(i),
|
|
2644
|
+
[i]
|
|
2645
|
+
), V = w(
|
|
2566
2646
|
() => ({
|
|
2567
2647
|
...o,
|
|
2568
2648
|
callbackUrl: (o == null ? void 0 : o.callbackUrl) ?? n ?? null
|
|
2569
2649
|
}),
|
|
2570
2650
|
[o, n]
|
|
2571
2651
|
);
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
}), []),
|
|
2575
|
-
let
|
|
2576
|
-
return
|
|
2577
|
-
|
|
2578
|
-
}).catch((
|
|
2579
|
-
var
|
|
2580
|
-
if (!
|
|
2581
|
-
|
|
2582
|
-
const
|
|
2583
|
-
(
|
|
2652
|
+
B(() => (A.current = !0, () => {
|
|
2653
|
+
A.current = !1;
|
|
2654
|
+
}), []), B(() => {
|
|
2655
|
+
let T = !1;
|
|
2656
|
+
return I ? (_(!0), h(!1), a({ formUniqueId: I }).then((S) => {
|
|
2657
|
+
T || (h(!!S.disabled), d(S.formDefinition ?? null));
|
|
2658
|
+
}).catch((S) => {
|
|
2659
|
+
var ee;
|
|
2660
|
+
if (!T) {
|
|
2661
|
+
h(!1), d(null);
|
|
2662
|
+
const me = S instanceof Error ? S.message : "获取表单定义失败";
|
|
2663
|
+
(ee = g.current) == null || ee.call(g, "error", me);
|
|
2584
2664
|
}
|
|
2585
2665
|
}).finally(() => {
|
|
2586
|
-
|
|
2666
|
+
T || _(!1);
|
|
2587
2667
|
}), () => {
|
|
2588
|
-
|
|
2589
|
-
}) : (
|
|
2590
|
-
|
|
2668
|
+
T = !0;
|
|
2669
|
+
}) : (_(!1), h(!1), d(null), () => {
|
|
2670
|
+
T = !0;
|
|
2591
2671
|
});
|
|
2592
|
-
}, [
|
|
2593
|
-
const
|
|
2594
|
-
() =>
|
|
2595
|
-
[
|
|
2596
|
-
),
|
|
2597
|
-
var
|
|
2598
|
-
return (
|
|
2599
|
-
}).map((
|
|
2600
|
-
if (
|
|
2601
|
-
const
|
|
2602
|
-
return
|
|
2603
|
-
}, [
|
|
2604
|
-
if (
|
|
2605
|
-
return /* @__PURE__ */
|
|
2606
|
-
if (!
|
|
2607
|
-
return /* @__PURE__ */
|
|
2608
|
-
|
|
2672
|
+
}, [I, a]);
|
|
2673
|
+
const M = w(() => xe(e), [e]), F = w(() => M ? Or(M, m ?? void 0) : null, [M, m]), $ = (F == null ? void 0 : F.matchedBlocks) ?? [], E = !!(M && jr(M) && $.length === 0), q = w(() => E && M ? Vr(M) : F && F.renderBlocks.length > 0 ? F.renderBlocks : [], [F, E, M]), J = w(
|
|
2674
|
+
() => E ? {} : Qe((F == null ? void 0 : F.extraBlocks) ?? []),
|
|
2675
|
+
[E, F]
|
|
2676
|
+
), X = w(() => E && M ? $r(M) : q.filter((T) => {
|
|
2677
|
+
var S;
|
|
2678
|
+
return (S = T.name) == null ? void 0 : S.trim();
|
|
2679
|
+
}).map((T) => T.name.trim()), [E, M, q]), Z = w(() => {
|
|
2680
|
+
if (q.length === 0) return null;
|
|
2681
|
+
const T = (F == null ? void 0 : F.title) ?? (M == null ? void 0 : M.title) ?? "", S = (F == null ? void 0 : F.description) ?? (M == null ? void 0 : M.description) ?? "";
|
|
2682
|
+
return Er({ title: T, description: S }, q);
|
|
2683
|
+
}, [F, M, q]), k = I ? `ask-user-${I}` : "ask-user-payload";
|
|
2684
|
+
if (x)
|
|
2685
|
+
return /* @__PURE__ */ c(Y, { children: /* @__PURE__ */ c("div", { className: "ask-user-form-card", children: /* @__PURE__ */ c(Ge, { size: "small" }) }) });
|
|
2686
|
+
if (!M || q.length === 0)
|
|
2687
|
+
return /* @__PURE__ */ c(Y, { children: /* @__PURE__ */ c(
|
|
2688
|
+
jo,
|
|
2609
2689
|
{
|
|
2610
2690
|
payload: e,
|
|
2611
2691
|
callbackUrl: n,
|
|
2612
|
-
answerAgentContext:
|
|
2613
|
-
|
|
2614
|
-
|
|
2692
|
+
answerAgentContext: V,
|
|
2693
|
+
submitHeaders: i,
|
|
2694
|
+
unpublishedFormId: b && I ? I : void 0,
|
|
2695
|
+
onNotify: s
|
|
2615
2696
|
}
|
|
2616
2697
|
) });
|
|
2617
|
-
async function
|
|
2618
|
-
var
|
|
2619
|
-
if (!
|
|
2620
|
-
|
|
2698
|
+
async function R() {
|
|
2699
|
+
var T, S, ee, me, ot, it, at;
|
|
2700
|
+
if (!y) {
|
|
2701
|
+
p(!0);
|
|
2621
2702
|
try {
|
|
2622
|
-
const
|
|
2623
|
-
if (
|
|
2624
|
-
(
|
|
2703
|
+
const te = ((T = v.current) == null ? void 0 : T.getValues(X)) ?? {}, de = uo(q, te);
|
|
2704
|
+
if (de) {
|
|
2705
|
+
(S = g.current) == null || S.call(g, "error", de.message);
|
|
2625
2706
|
return;
|
|
2626
2707
|
}
|
|
2627
|
-
const
|
|
2708
|
+
const st = { ...te, ...J };
|
|
2628
2709
|
if (r === "post") {
|
|
2629
|
-
const
|
|
2630
|
-
if (!
|
|
2631
|
-
(
|
|
2710
|
+
const ct = (n ?? "").trim();
|
|
2711
|
+
if (!ct) {
|
|
2712
|
+
(ee = g.current) == null || ee.call(g, "error", "callback_url 为空,无法提交");
|
|
2632
2713
|
return;
|
|
2633
2714
|
}
|
|
2634
|
-
const Ie = await
|
|
2635
|
-
|
|
2636
|
-
|
|
2715
|
+
const Ie = await qt(ct, st, {
|
|
2716
|
+
headers: U
|
|
2717
|
+
});
|
|
2718
|
+
if (!A.current) return;
|
|
2719
|
+
Ie.ok ? (me = g.current) == null || me.call(g, "success", "提交成功") : (ot = g.current) == null || ot.call(g, "error", Vo(Ie.status, Ie.body));
|
|
2637
2720
|
return;
|
|
2638
2721
|
}
|
|
2639
|
-
const
|
|
2640
|
-
context:
|
|
2722
|
+
const Qt = rt({
|
|
2723
|
+
context: V,
|
|
2641
2724
|
payload: e,
|
|
2642
|
-
form:
|
|
2643
|
-
answer:
|
|
2644
|
-
}),
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2725
|
+
form: m ?? M,
|
|
2726
|
+
answer: st
|
|
2727
|
+
}), Zt = await Kt(Qt, {
|
|
2728
|
+
headers: U
|
|
2729
|
+
});
|
|
2730
|
+
if (!A.current) return;
|
|
2731
|
+
const lt = Ht(Zt);
|
|
2732
|
+
(it = g.current) == null || it.call(g, lt.type, lt.message);
|
|
2733
|
+
} catch (te) {
|
|
2734
|
+
if (!A.current) return;
|
|
2735
|
+
const de = te instanceof Error ? te.message : "提交失败";
|
|
2736
|
+
(at = g.current) == null || at.call(g, "error", de);
|
|
2651
2737
|
} finally {
|
|
2652
|
-
|
|
2738
|
+
A.current && p(!1);
|
|
2653
2739
|
}
|
|
2654
2740
|
}
|
|
2655
2741
|
}
|
|
2656
|
-
return /* @__PURE__ */
|
|
2657
|
-
|
|
2658
|
-
/* @__PURE__ */
|
|
2659
|
-
|
|
2742
|
+
return /* @__PURE__ */ c(Y, { children: /* @__PURE__ */ C("div", { className: "ask-user-form-card", children: [
|
|
2743
|
+
b && I ? /* @__PURE__ */ c("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ c(re, { title: I, children: /* @__PURE__ */ c(oe, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
|
|
2744
|
+
/* @__PURE__ */ c(
|
|
2745
|
+
Oo,
|
|
2660
2746
|
{
|
|
2661
|
-
ref:
|
|
2662
|
-
doc:
|
|
2663
|
-
surfaceId:
|
|
2664
|
-
fieldNames:
|
|
2747
|
+
ref: v,
|
|
2748
|
+
doc: Z,
|
|
2749
|
+
surfaceId: k,
|
|
2750
|
+
fieldNames: X,
|
|
2665
2751
|
interactive: !0,
|
|
2666
2752
|
wrapProvider: !1,
|
|
2667
|
-
resumeSearch:
|
|
2668
|
-
caseSearch:
|
|
2753
|
+
resumeSearch: l,
|
|
2754
|
+
caseSearch: u
|
|
2669
2755
|
}
|
|
2670
2756
|
),
|
|
2671
|
-
/* @__PURE__ */
|
|
2672
|
-
|
|
2757
|
+
/* @__PURE__ */ c("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ c(
|
|
2758
|
+
re,
|
|
2673
2759
|
{
|
|
2674
2760
|
title: r === "post" ? "提交 JSON 到 callback_url" : "提交到 answer_agent_callback_url",
|
|
2675
|
-
children: /* @__PURE__ */
|
|
2676
|
-
|
|
2761
|
+
children: /* @__PURE__ */ c(
|
|
2762
|
+
ke,
|
|
2677
2763
|
{
|
|
2678
2764
|
type: "primary",
|
|
2679
2765
|
size: "small",
|
|
2680
|
-
loading:
|
|
2681
|
-
disabled:
|
|
2682
|
-
onClick: () => void
|
|
2766
|
+
loading: y,
|
|
2767
|
+
disabled: y,
|
|
2768
|
+
onClick: () => void R(),
|
|
2683
2769
|
children: "提交"
|
|
2684
2770
|
}
|
|
2685
2771
|
)
|
|
@@ -2688,54 +2774,59 @@ function Go({
|
|
|
2688
2774
|
] }) });
|
|
2689
2775
|
}
|
|
2690
2776
|
export {
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2777
|
+
Zo as A2UI_PROTOCOL_VERSION,
|
|
2778
|
+
ii as AskUserFormCard,
|
|
2779
|
+
Le as CaseSearchProvider,
|
|
2780
|
+
jo as CurlSubmitBlock,
|
|
2781
|
+
Jr as DEFAULT_ANSWER_AGENT_CALLBACK_URL,
|
|
2782
|
+
Gr as DEFAULT_AUTH_ANSWER_AGENT_CALLBACK_URL_FIELD,
|
|
2783
|
+
Ot as DEFAULT_AUTH_STORAGE_KEY,
|
|
2784
|
+
Kr as DEFAULT_AUTH_TOKEN_FIELD,
|
|
2785
|
+
bn as FORM_MEDIA_SIZES,
|
|
2699
2786
|
je as ResumeSearchProvider,
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2787
|
+
oi as SkoponA2uiStreamRenderer,
|
|
2788
|
+
Y as SkoponFormProvider,
|
|
2789
|
+
Oo as SkoponFormRenderer,
|
|
2790
|
+
Fr as a2uiToBlocks,
|
|
2791
|
+
Et as blocksToA2ui,
|
|
2792
|
+
rt as buildAnswerAgentBody,
|
|
2793
|
+
Dr as buildAskUserCurlBodyJson,
|
|
2794
|
+
Hr as buildAskUserCurlStatement,
|
|
2795
|
+
ei as buildAskUserSubmitCurlFromPayload,
|
|
2796
|
+
Er as buildAskUserSurface,
|
|
2797
|
+
Bt as buildCurlStatement,
|
|
2798
|
+
ti as copyTextToClipboard,
|
|
2799
|
+
lo as createCaseSearchClient,
|
|
2800
|
+
Xr as createFormClient,
|
|
2801
|
+
oo as createResumeSearchClient,
|
|
2802
|
+
ri as createSkoponSdkClients,
|
|
2803
|
+
Qe as extractExtraBlockValues,
|
|
2804
|
+
Rr as extractSurfaceValues,
|
|
2805
|
+
Ht as formatAnswerAgentSubmitMessage,
|
|
2806
|
+
$r as getPayloadInputFieldNames,
|
|
2807
|
+
Vr as getPayloadRenderableBlocks,
|
|
2808
|
+
Or as intersectPayloadBlocksWithForm,
|
|
2809
|
+
De as isA2uiSurfaceEmpty,
|
|
2810
|
+
W as isInputBlockType,
|
|
2811
|
+
Ae as isLayoutBlockType,
|
|
2812
|
+
ye as isMediaBlockType,
|
|
2813
|
+
zr as mapFormDefinitionFromDto,
|
|
2814
|
+
Q as normalizeFormDefinition,
|
|
2815
|
+
xe as parsePayloadBlocksJson,
|
|
2816
|
+
jr as payloadHasInputBlocks,
|
|
2817
|
+
Wr as resolveAnswerAgentCallbackUrl,
|
|
2818
|
+
nt as resolveClientHeaders,
|
|
2819
|
+
Vt as resolveSkoponAuthHeaders,
|
|
2820
|
+
tt as resolveSubmitAuthHeaders,
|
|
2821
|
+
Pr as resolveSurfaceFromFormDefinition,
|
|
2822
|
+
qo as skoponAntdTheme,
|
|
2823
|
+
H as skoponBrandColors,
|
|
2824
|
+
Kt as submitAnswerAgent,
|
|
2825
|
+
qt as submitFormJson,
|
|
2826
|
+
Ur as surfaceDocToMessages,
|
|
2827
|
+
ve as syncFormDefinition,
|
|
2828
|
+
Wn as useCaseSearch,
|
|
2829
|
+
ir as useResumeSearch,
|
|
2830
|
+
$t as validateAnswerAgentBody,
|
|
2831
|
+
ni as validateAnswerAgentContext
|
|
2741
2832
|
};
|