@skopon-cool/form-sdk 0.4.8 → 0.4.9
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/components/AskUserFormCard.d.ts.map +1 -1
- package/dist/index.js +632 -632
- package/dist/submit/intersectPayloadBlocksWithForm.d.ts +2 -2
- package/dist/submit/intersectPayloadBlocksWithForm.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/AskUserFormCard.tsx +2 -1
- package/src/submit/intersectPayloadBlocksWithForm.ts +6 -5
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import './form-sdk.css';
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var G = (e, t, n) =>
|
|
2
|
+
var qn = Object.defineProperty;
|
|
3
|
+
var Bn = (e, t, n) => t in e ? qn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var G = (e, t, n) => Bn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
5
|
import { jsx as u, jsxs as M } from "react/jsx-runtime";
|
|
6
|
-
import { useRef as A, useState as w, useCallback as j, useMemo as L, createContext as Ce, useContext as Ae, useEffect as q, useSyncExternalStore as
|
|
7
|
-
import { Spin as
|
|
8
|
-
import { ReloadOutlined as Yt, FileTextOutlined as Qt, UserOutlined as
|
|
9
|
-
import { createBinderlessComponentImplementation as X, basicCatalog as
|
|
6
|
+
import { useRef as A, useState as w, useCallback as j, useMemo as L, createContext as Ce, useContext as Ae, useEffect as q, useSyncExternalStore as Vn, forwardRef as Ln, useImperativeHandle as jn } from "react";
|
|
7
|
+
import { Spin as dt, Button as ze, Typography as ne, Avatar as $n, Tag as ve, Select as it, Checkbox as Dn, Radio as Hn, Switch as Kn, TimePicker as Jn, DatePicker as Gn, Upload as We, Input as Ye, InputNumber as Wn, ConfigProvider as Yn, Tooltip as ye } from "antd";
|
|
8
|
+
import { ReloadOutlined as Yt, FileTextOutlined as Qt, UserOutlined as Qn, FileImageOutlined as Xn, FileExcelOutlined as Zn, FileOutlined as Xt, PictureOutlined as er, SoundOutlined as tr, VideoCameraOutlined as nr } from "@ant-design/icons";
|
|
9
|
+
import { createBinderlessComponentImplementation as X, basicCatalog as Ee, A2uiSurface as Zt } from "@a2ui/react/v0_9";
|
|
10
10
|
import { z as h } from "zod";
|
|
11
|
-
import { Catalog as
|
|
11
|
+
import { Catalog as rr, MessageProcessor as en } from "@a2ui/web_core/v0_9";
|
|
12
12
|
import { injectBasicCatalogStyles as tn } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
13
13
|
import { injectStyles as nn } from "@a2ui/react/styles";
|
|
14
14
|
import jt from "dayjs";
|
|
15
|
-
const
|
|
15
|
+
const hs = "v0.9", or = [
|
|
16
16
|
"huge",
|
|
17
17
|
"large",
|
|
18
18
|
"medium",
|
|
@@ -22,22 +22,22 @@ const ps = "v0.9", rr = [
|
|
|
22
22
|
function pe(e) {
|
|
23
23
|
return e === "image" || e === "video" || e === "audio";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function ft(e) {
|
|
26
26
|
return e === "heading" || e === "paragraph";
|
|
27
27
|
}
|
|
28
28
|
function Z(e) {
|
|
29
|
-
return !
|
|
29
|
+
return !ft(e) && !pe(e);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function rn(e) {
|
|
32
|
+
return ft(e) || pe(e);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function ir(e) {
|
|
35
35
|
return e === "select" || e === "multiselect" || e === "radio" || e === "checkbox";
|
|
36
36
|
}
|
|
37
37
|
function gs(e) {
|
|
38
38
|
return Z(e) && e !== "file" && e !== "resume_multiselect" && e !== "case_multiselect";
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function sr() {
|
|
41
41
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
42
42
|
return crypto.randomUUID();
|
|
43
43
|
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
|
|
@@ -52,10 +52,10 @@ function ir() {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
function le(e) {
|
|
55
|
-
const t =
|
|
55
|
+
const t = sr().replace(/-/g, "").slice(0, 8);
|
|
56
56
|
return `${e}${t}`;
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const on = [
|
|
59
59
|
{ value: "image/*", label: "图片" },
|
|
60
60
|
{ value: "video/*", label: "视频" },
|
|
61
61
|
{ value: "audio/*", label: "音频" },
|
|
@@ -66,7 +66,7 @@ const rn = [
|
|
|
66
66
|
{ value: "text/plain", label: "纯文本" },
|
|
67
67
|
{ value: "application/zip", label: "ZIP 压缩包" },
|
|
68
68
|
{ value: "application/x-rar-compressed", label: "RAR 压缩包" }
|
|
69
|
-
],
|
|
69
|
+
], ar = {
|
|
70
70
|
"image/*": ["image/*"],
|
|
71
71
|
"video/*": ["video/*"],
|
|
72
72
|
"audio/*": ["audio/*"],
|
|
@@ -86,7 +86,7 @@ const rn = [
|
|
|
86
86
|
"text/plain": ["text/plain"],
|
|
87
87
|
"application/zip": ["application/zip"],
|
|
88
88
|
"application/x-rar-compressed": ["application/x-rar-compressed"]
|
|
89
|
-
},
|
|
89
|
+
}, lr = {
|
|
90
90
|
"image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
|
|
91
91
|
"video/*": [".mp4", ".mov", ".avi", ".webm"],
|
|
92
92
|
"audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
|
|
@@ -97,7 +97,7 @@ const rn = [
|
|
|
97
97
|
"text/plain": [".txt"],
|
|
98
98
|
"application/zip": [".zip", ".7z"],
|
|
99
99
|
"application/x-rar-compressed": [".rar"]
|
|
100
|
-
},
|
|
100
|
+
}, cr = {
|
|
101
101
|
"application/msword": "office/word",
|
|
102
102
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
|
|
103
103
|
"application/vnd.ms-excel": "office/excel",
|
|
@@ -130,108 +130,108 @@ const rn = [
|
|
|
130
130
|
{ value: ".zip", label: ".zip" },
|
|
131
131
|
{ value: ".rar", label: ".rar" },
|
|
132
132
|
{ value: ".7z", label: ".7z" }
|
|
133
|
-
],
|
|
134
|
-
|
|
135
|
-
),
|
|
133
|
+
], ur = Object.fromEntries(
|
|
134
|
+
on.map((e) => [e.value, e.label])
|
|
135
|
+
), mr = Object.fromEntries(
|
|
136
136
|
pt.map((e) => [e.value, e.label])
|
|
137
|
-
),
|
|
137
|
+
), dr = new Set(on.map((e) => e.value)), fr = new Set(
|
|
138
138
|
pt.map((e) => e.value)
|
|
139
139
|
);
|
|
140
|
-
function
|
|
140
|
+
function pr(e) {
|
|
141
141
|
const t = e.trim();
|
|
142
|
-
return t ?
|
|
142
|
+
return t ? dr.has(t) ? t : cr[t] ?? null : null;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function hr(e) {
|
|
145
145
|
return Array.isArray(e) ? e.map((t) => {
|
|
146
146
|
const n = t.trim().toLowerCase();
|
|
147
147
|
return n ? n.startsWith(".") ? n : `.${n}` : "";
|
|
148
148
|
}).filter(Boolean) : [];
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function _e(e) {
|
|
151
151
|
if (!Array.isArray(e)) return [];
|
|
152
152
|
const t = [], n = /* @__PURE__ */ new Set();
|
|
153
153
|
for (const r of e) {
|
|
154
|
-
const o =
|
|
154
|
+
const o = pr(r);
|
|
155
155
|
o && !n.has(o) && (n.add(o), t.push(o));
|
|
156
156
|
}
|
|
157
157
|
return t;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
const t =
|
|
159
|
+
function gr(e) {
|
|
160
|
+
const t = _e(e), n = [];
|
|
161
161
|
for (const r of t)
|
|
162
|
-
n.push(...
|
|
162
|
+
n.push(...ar[r] ?? [r]);
|
|
163
163
|
return n;
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
const t =
|
|
165
|
+
function yr(e) {
|
|
166
|
+
const t = _e(e);
|
|
167
167
|
if (t.length === 0) return [];
|
|
168
168
|
const n = /* @__PURE__ */ new Set();
|
|
169
169
|
for (const r of t)
|
|
170
|
-
for (const o of
|
|
170
|
+
for (const o of lr[r] ?? [])
|
|
171
171
|
n.add(o);
|
|
172
172
|
return pt.filter((r) => n.has(r.value));
|
|
173
173
|
}
|
|
174
174
|
function ht(e, t) {
|
|
175
|
-
const n =
|
|
175
|
+
const n = hr(t), r = _e(e);
|
|
176
176
|
if (r.length === 0)
|
|
177
|
-
return n.filter((i) =>
|
|
177
|
+
return n.filter((i) => fr.has(i));
|
|
178
178
|
const o = new Set(
|
|
179
|
-
|
|
179
|
+
yr(r).map((i) => i.value)
|
|
180
180
|
);
|
|
181
181
|
return n.filter((i) => o.has(i));
|
|
182
182
|
}
|
|
183
|
-
function
|
|
184
|
-
const n =
|
|
183
|
+
function vr(e, t) {
|
|
184
|
+
const n = gr(e), r = ht(e, t), o = [...n, ...r];
|
|
185
185
|
return o.length > 0 ? o.join(",") : void 0;
|
|
186
186
|
}
|
|
187
|
-
function
|
|
188
|
-
const n =
|
|
187
|
+
function br(e, t) {
|
|
188
|
+
const n = _e(e), r = ht(
|
|
189
189
|
n,
|
|
190
190
|
t
|
|
191
191
|
), o = [
|
|
192
|
-
...n.map((i) =>
|
|
193
|
-
...r.map((i) =>
|
|
192
|
+
...n.map((i) => ur[i] ?? i),
|
|
193
|
+
...r.map((i) => mr[i] ?? i)
|
|
194
194
|
];
|
|
195
195
|
return o.length === 0 ? null : o.join("、");
|
|
196
196
|
}
|
|
197
|
-
const
|
|
197
|
+
const Sr = [
|
|
198
198
|
"video",
|
|
199
199
|
"audio",
|
|
200
200
|
"image",
|
|
201
201
|
"file",
|
|
202
202
|
"spreadsheet",
|
|
203
203
|
"document"
|
|
204
|
-
],
|
|
205
|
-
function
|
|
206
|
-
return e &&
|
|
204
|
+
], kr = new Set(Sr);
|
|
205
|
+
function Cr(e) {
|
|
206
|
+
return e && kr.has(e) ? e : "file";
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
return typeof e == "string" &&
|
|
208
|
+
function Te(e) {
|
|
209
|
+
return typeof e == "string" && or.includes(e) ? e : "medium";
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function Ar(e, t) {
|
|
212
212
|
var o;
|
|
213
213
|
const n = Math.max(1, t);
|
|
214
214
|
let r = [];
|
|
215
215
|
return Array.isArray(e.mediaUrls) ? r = e.mediaUrls.map((i) => String(i).trim()) : (o = e.mediaUrl) != null && o.trim() && (r = [e.mediaUrl.trim()]), r.length === 0 ? [""] : r.slice(0, n);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function _r(e) {
|
|
218
218
|
var t;
|
|
219
219
|
return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
|
|
220
220
|
}
|
|
221
|
-
function _r(e) {
|
|
222
|
-
return `form-media-size-${xe(e)}`;
|
|
223
|
-
}
|
|
224
221
|
function Tr(e) {
|
|
225
|
-
return `form-media-
|
|
222
|
+
return `form-media-size-${Te(e)}`;
|
|
226
223
|
}
|
|
227
|
-
|
|
228
|
-
|
|
224
|
+
function xr(e) {
|
|
225
|
+
return `form-media-preview form-media-list ${Tr(e)}`;
|
|
226
|
+
}
|
|
227
|
+
const Mr = 10;
|
|
228
|
+
function sn(e) {
|
|
229
229
|
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function xe(e) {
|
|
232
232
|
return e === !0 || e === "true" || e === 1 || e === "1";
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function Ue(e, t = 1) {
|
|
235
235
|
const n = typeof e == "number" ? e : Number(e);
|
|
236
236
|
return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
|
|
237
237
|
}
|
|
@@ -239,10 +239,10 @@ function de(e, t = 1) {
|
|
|
239
239
|
const n = typeof e == "number" ? e : Number(e);
|
|
240
240
|
return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
return t == null ? void 0 : e === "toggle" ?
|
|
242
|
+
function an(e, t) {
|
|
243
|
+
return t == null ? void 0 : e === "toggle" ? xe(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String).map((o) => o.trim()).filter(Boolean) : typeof t == "string" && t.trim() ? [t.trim()] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t).trim() || void 0;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function Nr(e) {
|
|
246
246
|
if (Array.isArray(e)) return e.map(String).filter(Boolean);
|
|
247
247
|
if (typeof e == "string" && e.trim())
|
|
248
248
|
try {
|
|
@@ -252,11 +252,11 @@ function Mr(e) {
|
|
|
252
252
|
}
|
|
253
253
|
return [];
|
|
254
254
|
}
|
|
255
|
-
function
|
|
256
|
-
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, o = typeof (e == null ? void 0 : e.agentUniqueId) == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, i = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, s = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, a =
|
|
255
|
+
function Ir(e) {
|
|
256
|
+
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, o = typeof (e == null ? void 0 : e.agentUniqueId) == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, i = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, s = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, a = Nr(e == null ? void 0 : e.flowUniqueIds);
|
|
257
257
|
return { agentKind: r, agentUniqueId: o, flowType: i, category: s, flowUniqueIds: a, pageSize: n };
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function Fr(e) {
|
|
260
260
|
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0;
|
|
261
261
|
return {
|
|
262
262
|
names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
|
|
@@ -266,14 +266,14 @@ function Ir(e) {
|
|
|
266
266
|
pageSize: n
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function Er(e) {
|
|
270
270
|
if (e.type !== "case_singleselect") return e;
|
|
271
271
|
const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
|
|
272
272
|
return { ...e, type: "case_multiselect", defaultValue: t };
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function Ur(e) {
|
|
275
275
|
var o, i, s, a;
|
|
276
|
-
const t =
|
|
276
|
+
const t = Er(e), n = _e(t.fileAcceptTypes), r = t.type;
|
|
277
277
|
return {
|
|
278
278
|
id: ((o = t.id) == null ? void 0 : o.trim()) || le("block-"),
|
|
279
279
|
type: r,
|
|
@@ -282,17 +282,17 @@ function Er(e) {
|
|
|
282
282
|
placeholder: t.placeholder ?? "",
|
|
283
283
|
help: t.help ?? "",
|
|
284
284
|
required: t.required === !0,
|
|
285
|
-
mediaUrls: pe(r) ?
|
|
286
|
-
mediaSize: pe(r) ?
|
|
285
|
+
mediaUrls: pe(r) ? Ar(t, Mr) : void 0,
|
|
286
|
+
mediaSize: pe(r) ? Te(t.mediaSize) : void 0,
|
|
287
287
|
fileAcceptTypes: n,
|
|
288
288
|
fileAcceptExtensions: ht(
|
|
289
289
|
n,
|
|
290
290
|
t.fileAcceptExtensions
|
|
291
291
|
),
|
|
292
|
-
filePlaceholderIcon:
|
|
293
|
-
fileMinCount: r === "file" ?
|
|
294
|
-
fileMaxCount: r === "file" ?
|
|
295
|
-
defaultValue:
|
|
292
|
+
filePlaceholderIcon: Cr(t.filePlaceholderIcon),
|
|
293
|
+
fileMinCount: r === "file" ? Ue(t.fileMinCount, 1) : void 0,
|
|
294
|
+
fileMaxCount: r === "file" ? Ue(t.fileMaxCount, 1) : void 0,
|
|
295
|
+
defaultValue: an(r, t.defaultValue),
|
|
296
296
|
jsonSchemaDescription: ((s = t.jsonSchemaDescription) == null ? void 0 : s.trim()) ?? "",
|
|
297
297
|
hidden: r === "text" ? t.hidden === !0 : void 0,
|
|
298
298
|
needLLM: t.needLLM === !0 ? !0 : void 0,
|
|
@@ -311,14 +311,14 @@ function Er(e) {
|
|
|
311
311
|
resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
|
|
312
312
|
resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? de(t.resumeMinCount, 1) : void 0,
|
|
313
313
|
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? de(t.resumeMaxCount, 1) : void 0,
|
|
314
|
-
resumeFilter: r === "resume_multiselect" ?
|
|
314
|
+
resumeFilter: r === "resume_multiselect" ? Fr(t.resumeFilter) : void 0,
|
|
315
315
|
caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
|
|
316
316
|
caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? de(t.caseMinCount, 1) : void 0,
|
|
317
317
|
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? de(t.caseMaxCount, 1) : void 0,
|
|
318
|
-
caseFilter: r === "case_multiselect" ?
|
|
318
|
+
caseFilter: r === "case_multiselect" ? Ir(t.caseFilter) : void 0
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Rr(e) {
|
|
322
322
|
return new Set((e.options ?? []).map((t) => t.value));
|
|
323
323
|
}
|
|
324
324
|
function $t(e, t) {
|
|
@@ -328,10 +328,10 @@ function $t(e, t) {
|
|
|
328
328
|
};
|
|
329
329
|
return e !== void 0 && (n.minItems = de(e, 1)), t !== void 0 && (n.maxItems = de(t, 1)), n;
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
const t =
|
|
331
|
+
function Pr(e) {
|
|
332
|
+
const t = an(e.type, e.defaultValue);
|
|
333
333
|
if (t === void 0) return;
|
|
334
|
-
const n =
|
|
334
|
+
const n = Rr(e);
|
|
335
335
|
switch (e.type) {
|
|
336
336
|
case "toggle":
|
|
337
337
|
return t;
|
|
@@ -358,7 +358,7 @@ function Rr(e) {
|
|
|
358
358
|
return t;
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function wr(e) {
|
|
362
362
|
var i, s;
|
|
363
363
|
if (!((i = e.name) == null ? void 0 : i.trim()) || !Z(e.type)) return null;
|
|
364
364
|
let n;
|
|
@@ -386,7 +386,7 @@ function Pr(e) {
|
|
|
386
386
|
break;
|
|
387
387
|
}
|
|
388
388
|
case "file": {
|
|
389
|
-
const a =
|
|
389
|
+
const a = Ue(e.fileMinCount, 1), l = Ue(e.fileMaxCount, 1);
|
|
390
390
|
l <= 1 ? n = { type: "string" } : n = {
|
|
391
391
|
type: "array",
|
|
392
392
|
items: { type: "string" },
|
|
@@ -410,16 +410,16 @@ function Pr(e) {
|
|
|
410
410
|
}
|
|
411
411
|
const r = (s = e.jsonSchemaDescription) == null ? void 0 : s.trim();
|
|
412
412
|
r && (n.$comment = r);
|
|
413
|
-
const o =
|
|
413
|
+
const o = Pr(e);
|
|
414
414
|
return o !== void 0 && (n.default = o), n;
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function zr(e, t, n) {
|
|
417
417
|
var l;
|
|
418
418
|
const r = {}, o = [];
|
|
419
419
|
for (const c of e) {
|
|
420
420
|
const m = (l = c.name) == null ? void 0 : l.trim();
|
|
421
421
|
if (!m || !Z(c.type)) continue;
|
|
422
|
-
const d =
|
|
422
|
+
const d = wr(c);
|
|
423
423
|
d && (r[m] = d, c.required && o.push(m));
|
|
424
424
|
}
|
|
425
425
|
const i = {
|
|
@@ -436,13 +436,13 @@ function be(e) {
|
|
|
436
436
|
title: t,
|
|
437
437
|
description: n,
|
|
438
438
|
blocks: e.blocks,
|
|
439
|
-
jsonSchema:
|
|
439
|
+
jsonSchema: zr(e.blocks, t, n)
|
|
440
440
|
};
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function Oe(e) {
|
|
443
443
|
if (!e || !Array.isArray(e.blocks))
|
|
444
444
|
return be({ title: "", description: "", blocks: [] });
|
|
445
|
-
const t = e.blocks.map(
|
|
445
|
+
const t = e.blocks.map(Ur);
|
|
446
446
|
return be({
|
|
447
447
|
title: typeof e.title == "string" ? e.title : "",
|
|
448
448
|
description: typeof e.description == "string" ? e.description : "",
|
|
@@ -458,7 +458,7 @@ function vs(e) {
|
|
|
458
458
|
type: e,
|
|
459
459
|
label: e
|
|
460
460
|
};
|
|
461
|
-
return Z(e) && (t.label = "", t.name = le("field_"), t.placeholder = "", t.required = !1), pe(e) && (t.label = "", t.placeholder = "", t.help = "", t.mediaUrls = [""], t.mediaSize = "medium"),
|
|
461
|
+
return Z(e) && (t.label = "", t.name = le("field_"), t.placeholder = "", t.required = !1), pe(e) && (t.label = "", t.placeholder = "", t.help = "", t.mediaUrls = [""], t.mediaSize = "medium"), ir(e) && (t.options = [
|
|
462
462
|
{ value: "option_1", label: "选项 1" },
|
|
463
463
|
{ value: "option_2", label: "选项 2" }
|
|
464
464
|
]), e === "file" && (t.fileAcceptTypes = [], t.fileAcceptExtensions = [], t.filePlaceholderIcon = "file", t.fileMinCount = 1, t.fileMaxCount = 1), e === "resume_multiselect" && (t.resumeEnableRefresh = !0, t.resumeMinCount = 1, t.resumeMaxCount = 1, t.resumeFilter = {
|
|
@@ -468,7 +468,7 @@ function vs(e) {
|
|
|
468
468
|
pageSize: 20
|
|
469
469
|
}, t.defaultValue = []), e === "case_multiselect" && (t.caseEnableRefresh = !0, t.caseMinCount = 1, t.caseMaxCount = 1, t.caseFilter = { flowUniqueIds: [], pageSize: 20 }, t.defaultValue = []), t;
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function Or(e) {
|
|
472
472
|
const t = typeof e.pageSize == "number" ? e.pageSize : Number(e.pageSize), n = typeof e.agentKind == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, r = typeof e.agentUniqueId == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, o = typeof e.flowType == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, i = typeof e.category == "string" && e.category.trim() ? e.category.trim() : void 0, s = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
473
473
|
return {
|
|
474
474
|
agentKind: n,
|
|
@@ -485,7 +485,7 @@ function Dt(e) {
|
|
|
485
485
|
if (!(!Number.isFinite(t) || t < 1))
|
|
486
486
|
return Math.floor(t);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function qr(e, t) {
|
|
489
489
|
var s, a, l, c, m, d;
|
|
490
490
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
491
491
|
return i({
|
|
@@ -508,7 +508,7 @@ function Or(e, t) {
|
|
|
508
508
|
value: { path: o }
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function Br(e, t, n) {
|
|
512
512
|
const r = n.nameFromValue(e.value), o = {
|
|
513
513
|
...t("case_multiselect"),
|
|
514
514
|
name: r,
|
|
@@ -516,23 +516,23 @@ function qr(e, t, n) {
|
|
|
516
516
|
}, i = n.asLiteral(e.placeholder);
|
|
517
517
|
i && (o.placeholder = i);
|
|
518
518
|
const s = n.asLiteral(e.help);
|
|
519
|
-
s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter =
|
|
519
|
+
s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = Or(e.caseFilter));
|
|
520
520
|
const a = Dt(e.minCount);
|
|
521
521
|
a !== void 0 && (o.caseMinCount = a);
|
|
522
522
|
const l = Dt(e.maxCount);
|
|
523
523
|
return l !== void 0 && (o.caseMaxCount = l), o;
|
|
524
524
|
}
|
|
525
|
-
const
|
|
525
|
+
const ln = Ce(
|
|
526
526
|
null
|
|
527
527
|
);
|
|
528
|
-
function
|
|
528
|
+
function Vr(e) {
|
|
529
529
|
try {
|
|
530
530
|
return JSON.stringify(e);
|
|
531
531
|
} catch {
|
|
532
532
|
return String(e.length);
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
const
|
|
535
|
+
const Lr = {
|
|
536
536
|
publishLiveOptions: () => {
|
|
537
537
|
},
|
|
538
538
|
liveOptions: /* @__PURE__ */ new Map(),
|
|
@@ -541,7 +541,7 @@ const Vr = {
|
|
|
541
541
|
clearPendingChangeFields: () => {
|
|
542
542
|
}
|
|
543
543
|
};
|
|
544
|
-
function
|
|
544
|
+
function jr({ children: e }) {
|
|
545
545
|
const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] = w(0), [s, a] = w(() => /* @__PURE__ */ new Map()), [l, c] = w(
|
|
546
546
|
[]
|
|
547
547
|
), m = j(
|
|
@@ -551,7 +551,7 @@ function Lr({ children: e }) {
|
|
|
551
551
|
const k = S.map((f) => ({
|
|
552
552
|
value: String(f.value ?? ""),
|
|
553
553
|
label: String(f.label ?? f.value ?? "")
|
|
554
|
-
})), p =
|
|
554
|
+
})), p = Vr(k);
|
|
555
555
|
n.current.get(g) !== p && (n.current.set(g, p), t.current.set(g, k), r.current.includes(g) || (r.current = [...r.current, g]), a(new Map(t.current)), c(r.current), i((f) => f + 1));
|
|
556
556
|
},
|
|
557
557
|
[]
|
|
@@ -573,26 +573,26 @@ function Lr({ children: e }) {
|
|
|
573
573
|
d
|
|
574
574
|
]
|
|
575
575
|
);
|
|
576
|
-
return /* @__PURE__ */ u(
|
|
576
|
+
return /* @__PURE__ */ u(ln.Provider, { value: b, children: e });
|
|
577
577
|
}
|
|
578
578
|
function gt() {
|
|
579
|
-
return Ae(
|
|
579
|
+
return Ae(ln) ?? Lr;
|
|
580
580
|
}
|
|
581
|
-
const
|
|
582
|
-
function
|
|
581
|
+
const cn = Ce({ interactive: !0 });
|
|
582
|
+
function st({
|
|
583
583
|
interactive: e,
|
|
584
584
|
children: t
|
|
585
585
|
}) {
|
|
586
|
-
return /* @__PURE__ */ u(
|
|
586
|
+
return /* @__PURE__ */ u(cn.Provider, { value: { interactive: e }, children: t });
|
|
587
587
|
}
|
|
588
588
|
function se() {
|
|
589
|
-
return Ae(
|
|
589
|
+
return Ae(cn);
|
|
590
590
|
}
|
|
591
|
-
const
|
|
592
|
-
function
|
|
591
|
+
const un = Ce(null);
|
|
592
|
+
function $r(e) {
|
|
593
593
|
return e != null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
594
594
|
}
|
|
595
|
-
const
|
|
595
|
+
const Dr = {
|
|
596
596
|
reportEvent: () => {
|
|
597
597
|
},
|
|
598
598
|
reportData: () => {
|
|
@@ -600,7 +600,7 @@ const $r = {
|
|
|
600
600
|
runAutoControl: (e) => e(),
|
|
601
601
|
isAutoControl: () => !1
|
|
602
602
|
};
|
|
603
|
-
function
|
|
603
|
+
function Hr(e) {
|
|
604
604
|
const t = {};
|
|
605
605
|
for (const [n, r] of Object.entries(e.form_values ?? {}))
|
|
606
606
|
r !== void 0 && (t[n] = r);
|
|
@@ -610,7 +610,7 @@ function Dr(e) {
|
|
|
610
610
|
form_change: Array.isArray(e.form_change) ? [...e.form_change] : []
|
|
611
611
|
};
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function Kr({
|
|
614
614
|
client: e,
|
|
615
615
|
children: t
|
|
616
616
|
}) {
|
|
@@ -628,7 +628,7 @@ function Hr({
|
|
|
628
628
|
m.send(b, d);
|
|
629
629
|
}, []), i = j((c) => {
|
|
630
630
|
const m = r.current;
|
|
631
|
-
m && m.send("form_runtime_data",
|
|
631
|
+
m && m.send("form_runtime_data", Hr(c));
|
|
632
632
|
}, []), s = j((c) => {
|
|
633
633
|
n.current += 1;
|
|
634
634
|
let m;
|
|
@@ -637,7 +637,7 @@ function Hr({
|
|
|
637
637
|
} catch (d) {
|
|
638
638
|
throw n.current = Math.max(0, n.current - 1), d;
|
|
639
639
|
}
|
|
640
|
-
return
|
|
640
|
+
return $r(m) ? Promise.resolve(m).finally(() => {
|
|
641
641
|
n.current = Math.max(0, n.current - 1);
|
|
642
642
|
}) : (n.current = Math.max(0, n.current - 1), m);
|
|
643
643
|
}, []), a = j(
|
|
@@ -652,16 +652,16 @@ function Hr({
|
|
|
652
652
|
}),
|
|
653
653
|
[o, i, s, a]
|
|
654
654
|
);
|
|
655
|
-
return /* @__PURE__ */ u(
|
|
655
|
+
return /* @__PURE__ */ u(un.Provider, { value: l, children: t });
|
|
656
656
|
}
|
|
657
|
-
function
|
|
658
|
-
return Ae(
|
|
657
|
+
function mn() {
|
|
658
|
+
return Ae(un) ?? Dr;
|
|
659
659
|
}
|
|
660
|
-
const
|
|
661
|
-
function
|
|
660
|
+
const Jr = 300;
|
|
661
|
+
function dn(e) {
|
|
662
662
|
return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function Gr(e) {
|
|
665
665
|
if (!e) return;
|
|
666
666
|
const t = e.trim();
|
|
667
667
|
if (t)
|
|
@@ -669,11 +669,11 @@ function Jr(e) {
|
|
|
669
669
|
}
|
|
670
670
|
function Ht(e, t = "value") {
|
|
671
671
|
const r = e.componentModel.properties[t];
|
|
672
|
-
if (!(!
|
|
672
|
+
if (!(!dn(r) || r === void 0))
|
|
673
673
|
return e.dataContext.resolveDynamicValue(r);
|
|
674
674
|
}
|
|
675
675
|
function ae(e, t = "value", n = {}) {
|
|
676
|
-
const o = e.componentModel.properties[t], i =
|
|
676
|
+
const o = e.componentModel.properties[t], i = dn(o), s = Gr(i), a = mn(), {
|
|
677
677
|
component: l = "Unknown",
|
|
678
678
|
changeAction: c = "change",
|
|
679
679
|
debounceChange: m = !1
|
|
@@ -703,7 +703,7 @@ function ae(e, t = "value", n = {}) {
|
|
|
703
703
|
), v = j(() => {
|
|
704
704
|
if (!(!i || o === void 0))
|
|
705
705
|
return e.dataContext.resolveDynamicValue(o);
|
|
706
|
-
}, [e, o, i]), x =
|
|
706
|
+
}, [e, o, i]), x = Vn(f, v, v), N = j(
|
|
707
707
|
(B) => {
|
|
708
708
|
if (!s) return;
|
|
709
709
|
const V = () => {
|
|
@@ -720,7 +720,7 @@ function ae(e, t = "value", n = {}) {
|
|
|
720
720
|
}
|
|
721
721
|
b.current = B, y.current = !0, d.current != null && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
722
722
|
d.current = null, V();
|
|
723
|
-
},
|
|
723
|
+
}, Jr);
|
|
724
724
|
},
|
|
725
725
|
[s, c, l, m]
|
|
726
726
|
), _ = j(
|
|
@@ -757,38 +757,38 @@ function Se(e) {
|
|
|
757
757
|
function Q(e) {
|
|
758
758
|
return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
|
|
759
759
|
}
|
|
760
|
-
function
|
|
760
|
+
function fn(e, t) {
|
|
761
761
|
return t ? Array.isArray(e) ? null : Q(e) : Array.isArray(e) ? e.length > 0 ? String(e[0]) : "" : e == null || typeof e == "string" || typeof e == "number" ? null : "";
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function Re(e) {
|
|
764
764
|
if (e == null) return;
|
|
765
765
|
const t = typeof e == "number" ? e : Number(e);
|
|
766
766
|
if (!(!Number.isFinite(t) || t < 1))
|
|
767
767
|
return Math.floor(t);
|
|
768
768
|
}
|
|
769
|
-
function
|
|
769
|
+
function pn(e, t, n, r) {
|
|
770
770
|
return e.includes(t) ? e.filter((i) => i !== t) : r === 1 ? [t] : r !== void 0 && e.length >= r ? null : [...e, t];
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function hn(e, t, n, r, o) {
|
|
773
773
|
return n ? e.includes(t) || o === 1 ? !1 : o !== void 0 && e.length >= o : !0;
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function gn(e, t) {
|
|
776
776
|
return t === void 0 || e.length <= t ? null : e.slice(0, t);
|
|
777
777
|
}
|
|
778
|
-
const
|
|
779
|
-
function
|
|
778
|
+
const yn = Ce(null);
|
|
779
|
+
function at({
|
|
780
780
|
caseSearch: e,
|
|
781
781
|
children: t
|
|
782
782
|
}) {
|
|
783
|
-
return /* @__PURE__ */ u(
|
|
783
|
+
return /* @__PURE__ */ u(yn.Provider, { value: e ?? null, children: t });
|
|
784
784
|
}
|
|
785
|
-
function
|
|
786
|
-
return Ae(
|
|
785
|
+
function Wr() {
|
|
786
|
+
return Ae(yn);
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function Qe(e) {
|
|
789
789
|
return typeof e == "string" ? e : "";
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function Yr(e) {
|
|
792
792
|
if (Array.isArray(e)) return e.map(String).filter(Boolean);
|
|
793
793
|
if (typeof e == "string" && e.trim())
|
|
794
794
|
try {
|
|
@@ -798,21 +798,21 @@ function Wr(e) {
|
|
|
798
798
|
}
|
|
799
799
|
return [];
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function Xe(e) {
|
|
802
802
|
if (!e || typeof e != "object")
|
|
803
803
|
return { flowUniqueIds: [], pageSize: 20 };
|
|
804
|
-
const t = e, n = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), r = Number.isFinite(n) && n >= 1 && n <= 100 ? Math.floor(n) : 20, o = typeof t.agentKind == "string" && t.agentKind.trim() ? t.agentKind.trim() : void 0, i = typeof t.agentUniqueId == "string" && t.agentUniqueId.trim() ? t.agentUniqueId.trim() : void 0, s = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, a = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, l =
|
|
804
|
+
const t = e, n = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), r = Number.isFinite(n) && n >= 1 && n <= 100 ? Math.floor(n) : 20, o = typeof t.agentKind == "string" && t.agentKind.trim() ? t.agentKind.trim() : void 0, i = typeof t.agentUniqueId == "string" && t.agentUniqueId.trim() ? t.agentUniqueId.trim() : void 0, s = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, a = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, l = Yr(t.flowUniqueIds);
|
|
805
805
|
return { agentKind: o, agentUniqueId: i, flowType: s, category: a, flowUniqueIds: l, pageSize: r };
|
|
806
806
|
}
|
|
807
|
-
function
|
|
807
|
+
function Ze(e) {
|
|
808
808
|
var r;
|
|
809
809
|
const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
|
|
810
810
|
return t || n;
|
|
811
811
|
}
|
|
812
|
-
function
|
|
812
|
+
function Qr(e) {
|
|
813
813
|
return JSON.stringify(e);
|
|
814
814
|
}
|
|
815
|
-
const
|
|
815
|
+
const Xr = {
|
|
816
816
|
name: "SkoponCaseSelect",
|
|
817
817
|
schema: h.object({
|
|
818
818
|
label: h.any().optional(),
|
|
@@ -825,7 +825,7 @@ const Qr = {
|
|
|
825
825
|
value: h.any().optional()
|
|
826
826
|
}).passthrough()
|
|
827
827
|
};
|
|
828
|
-
function
|
|
828
|
+
function Zr({
|
|
829
829
|
item: e,
|
|
830
830
|
selected: t,
|
|
831
831
|
disabled: n,
|
|
@@ -853,36 +853,36 @@ function Xr({
|
|
|
853
853
|
}
|
|
854
854
|
);
|
|
855
855
|
}
|
|
856
|
-
function
|
|
857
|
-
const { interactive: t } = se(), n =
|
|
856
|
+
function eo({ context: e }) {
|
|
857
|
+
const { interactive: t } = se(), n = Wr(), { publishLiveOptions: r } = gt(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = ae(e, "value", {
|
|
858
858
|
component: "SkoponCaseSelect",
|
|
859
859
|
changeAction: "click"
|
|
860
|
-
}), l = e.componentModel.properties, c =
|
|
860
|
+
}), l = e.componentModel.properties, c = Qe(l.label), m = Qe(l.placeholder), d = Qe(l.help), b = l.enableRefresh !== !1, y = Re(l.minCount), S = Re(l.maxCount), g = L(() => Xe(l.caseFilter), [l.caseFilter]), k = Qr(g), [p, f] = w(1), [v, x] = w(!1), [N, _] = w(""), [z, C] = w([]), [B, V] = w(0), [re, K] = w(g.pageSize ?? 20), $ = A(0), W = Q(o);
|
|
861
861
|
q(() => {
|
|
862
|
-
const T =
|
|
862
|
+
const T = gn(W, S);
|
|
863
863
|
T !== null && s(T);
|
|
864
864
|
}, [S, W, s]);
|
|
865
|
-
const ee = L(() => n ?
|
|
865
|
+
const ee = L(() => n ? Ze(g) ? N || m || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, g, N, m]), te = j(
|
|
866
866
|
async (T) => {
|
|
867
|
-
const D =
|
|
868
|
-
if (!n || !
|
|
867
|
+
const D = Xe(JSON.parse(k)), U = ++$.current;
|
|
868
|
+
if (!n || !Ze(D)) {
|
|
869
869
|
C([]), V(0), _(""), x(!1);
|
|
870
870
|
return;
|
|
871
871
|
}
|
|
872
872
|
x(!0), _("");
|
|
873
873
|
try {
|
|
874
|
-
const
|
|
874
|
+
const F = await n({ filter: D, page: T });
|
|
875
875
|
if (U !== $.current) return;
|
|
876
|
-
C(
|
|
876
|
+
C(F.list), V(F.total), f(F.page), K(F.pageSize), a && r(
|
|
877
877
|
a,
|
|
878
|
-
|
|
878
|
+
F.list.map((Y) => ({
|
|
879
879
|
value: Y.caseUniqueId,
|
|
880
880
|
label: Y.name || Y.caseUniqueId
|
|
881
881
|
}))
|
|
882
882
|
);
|
|
883
|
-
} catch (
|
|
883
|
+
} catch (F) {
|
|
884
884
|
if (U !== $.current) return;
|
|
885
|
-
C([]), V(0), _(
|
|
885
|
+
C([]), V(0), _(F instanceof Error ? F.message : "加载案例列表失败");
|
|
886
886
|
} finally {
|
|
887
887
|
U === $.current && x(!1);
|
|
888
888
|
}
|
|
@@ -894,7 +894,7 @@ function Zr({ context: e }) {
|
|
|
894
894
|
}, [k, te]);
|
|
895
895
|
const E = (T) => {
|
|
896
896
|
if (!t) return;
|
|
897
|
-
const D =
|
|
897
|
+
const D = pn(
|
|
898
898
|
W,
|
|
899
899
|
T,
|
|
900
900
|
y,
|
|
@@ -902,8 +902,8 @@ function Zr({ context: e }) {
|
|
|
902
902
|
);
|
|
903
903
|
D !== null && i(D);
|
|
904
904
|
}, P = () => {
|
|
905
|
-
const T =
|
|
906
|
-
te(
|
|
905
|
+
const T = Xe(JSON.parse(k)), D = re || T.pageSize || 20, U = Math.max(1, Math.ceil(B / D)), F = p >= U ? 1 : p + 1;
|
|
906
|
+
te(F);
|
|
907
907
|
};
|
|
908
908
|
return /* @__PURE__ */ M(
|
|
909
909
|
"div",
|
|
@@ -913,16 +913,16 @@ function Zr({ context: e }) {
|
|
|
913
913
|
children: [
|
|
914
914
|
c ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: c }) : null,
|
|
915
915
|
v && z.length === 0 ? /* @__PURE__ */ M("div", { className: "skopon-resume-select-status", children: [
|
|
916
|
-
/* @__PURE__ */ u(
|
|
916
|
+
/* @__PURE__ */ u(dt, { size: "small" }),
|
|
917
917
|
" 加载案例…"
|
|
918
918
|
] }) : null,
|
|
919
919
|
!v && z.length === 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-empty", children: ee }) : null,
|
|
920
920
|
z.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-list", children: z.map((T) => /* @__PURE__ */ u(
|
|
921
|
-
|
|
921
|
+
Zr,
|
|
922
922
|
{
|
|
923
923
|
item: T,
|
|
924
924
|
selected: W.includes(T.caseUniqueId),
|
|
925
|
-
disabled:
|
|
925
|
+
disabled: hn(
|
|
926
926
|
W,
|
|
927
927
|
T.caseUniqueId,
|
|
928
928
|
t,
|
|
@@ -933,8 +933,8 @@ function Zr({ context: e }) {
|
|
|
933
933
|
},
|
|
934
934
|
T.caseUniqueId
|
|
935
935
|
)) }) : null,
|
|
936
|
-
b && n &&
|
|
937
|
-
|
|
936
|
+
b && n && Ze(g) ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ u(
|
|
937
|
+
ze,
|
|
938
938
|
{
|
|
939
939
|
type: "default",
|
|
940
940
|
size: "small",
|
|
@@ -950,15 +950,15 @@ function Zr({ context: e }) {
|
|
|
950
950
|
}
|
|
951
951
|
);
|
|
952
952
|
}
|
|
953
|
-
const
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
),
|
|
953
|
+
const to = X(
|
|
954
|
+
Xr,
|
|
955
|
+
eo
|
|
956
|
+
), no = {
|
|
957
957
|
type: "case_multiselect",
|
|
958
958
|
componentName: "SkoponCaseSelect",
|
|
959
|
-
toComponent:
|
|
960
|
-
fromComponent:
|
|
961
|
-
catalogComponents: [
|
|
959
|
+
toComponent: qr,
|
|
960
|
+
fromComponent: Br,
|
|
961
|
+
catalogComponents: [to]
|
|
962
962
|
};
|
|
963
963
|
function Kt(e) {
|
|
964
964
|
if (e == null) return;
|
|
@@ -966,7 +966,7 @@ function Kt(e) {
|
|
|
966
966
|
if (!(!Number.isFinite(t) || t < 1))
|
|
967
967
|
return Math.floor(t);
|
|
968
968
|
}
|
|
969
|
-
function
|
|
969
|
+
function ro(e, t) {
|
|
970
970
|
var s, a, l, c;
|
|
971
971
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
972
972
|
return i({
|
|
@@ -987,7 +987,7 @@ function no(e, t) {
|
|
|
987
987
|
value: { path: o }
|
|
988
988
|
});
|
|
989
989
|
}
|
|
990
|
-
function
|
|
990
|
+
function oo(e, t, n) {
|
|
991
991
|
const r = n.nameFromValue(e.value), o = {
|
|
992
992
|
...t("resume_multiselect"),
|
|
993
993
|
name: r,
|
|
@@ -1009,29 +1009,29 @@ function ro(e, t, n) {
|
|
|
1009
1009
|
const l = Kt(e.maxCount);
|
|
1010
1010
|
return l !== void 0 && (o.resumeMaxCount = l), o;
|
|
1011
1011
|
}
|
|
1012
|
-
const
|
|
1013
|
-
function
|
|
1012
|
+
const vn = Ce(null);
|
|
1013
|
+
function lt({
|
|
1014
1014
|
resumeSearch: e,
|
|
1015
1015
|
children: t
|
|
1016
1016
|
}) {
|
|
1017
|
-
return /* @__PURE__ */ u(
|
|
1017
|
+
return /* @__PURE__ */ u(vn.Provider, { value: e ?? null, children: t });
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1020
|
-
return Ae(
|
|
1019
|
+
function io() {
|
|
1020
|
+
return Ae(vn);
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1022
|
+
function et(e) {
|
|
1023
1023
|
return typeof e == "string" ? e : "";
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1025
|
+
function tt(e) {
|
|
1026
1026
|
if (!e || typeof e != "object")
|
|
1027
1027
|
return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
|
|
1028
1028
|
const t = e, n = Array.isArray(t.names) ? t.names.map(String).filter(Boolean) : [], r = Array.isArray(t.agentUniqueIds) ? t.agentUniqueIds.map(String).filter(Boolean) : [], o = Array.isArray(t.resumeUniqueIds) ? t.resumeUniqueIds.map(String).filter(Boolean) : [], i = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), s = Number.isFinite(i) && i >= 1 && i <= 100 ? Math.floor(i) : 20;
|
|
1029
1029
|
return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: s };
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1031
|
+
function so(e) {
|
|
1032
1032
|
return JSON.stringify(e);
|
|
1033
1033
|
}
|
|
1034
|
-
const
|
|
1034
|
+
const ao = {
|
|
1035
1035
|
name: "SkoponResumeSelect",
|
|
1036
1036
|
schema: h.object({
|
|
1037
1037
|
label: h.any().optional(),
|
|
@@ -1043,9 +1043,9 @@ const so = {
|
|
|
1043
1043
|
maxCount: h.any().optional(),
|
|
1044
1044
|
value: h.any().optional()
|
|
1045
1045
|
}).passthrough()
|
|
1046
|
-
},
|
|
1047
|
-
function
|
|
1048
|
-
const n = (t ?? []).filter(Boolean), r = n.slice(0,
|
|
1046
|
+
}, lo = 3, co = 2;
|
|
1047
|
+
function nt(e, t) {
|
|
1048
|
+
const n = (t ?? []).filter(Boolean), r = n.slice(0, lo), o = n.length - r.length;
|
|
1049
1049
|
return /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-tags", children: [
|
|
1050
1050
|
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-label", children: e }),
|
|
1051
1051
|
n.length > 0 ? /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-tags-list", children: [
|
|
@@ -1057,25 +1057,25 @@ function rt(e, t) {
|
|
|
1057
1057
|
] }) : /* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
|
|
1058
1058
|
] });
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1060
|
+
function uo(e) {
|
|
1061
1061
|
return /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-field", children: [
|
|
1062
1062
|
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
|
|
1063
1063
|
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
|
|
1064
1064
|
] });
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function mo({ work: e }) {
|
|
1067
1067
|
return /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-work", children: [
|
|
1068
|
-
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ u("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ u(
|
|
1068
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ u("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ u(Xn, { className: "skopon-resume-select-card-work-placeholder" }) }),
|
|
1069
1069
|
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
|
|
1070
1070
|
] });
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1072
|
+
function fo({
|
|
1073
1073
|
item: e,
|
|
1074
1074
|
selected: t,
|
|
1075
1075
|
disabled: n,
|
|
1076
1076
|
onToggle: r
|
|
1077
1077
|
}) {
|
|
1078
|
-
const o = (e.works ?? []).slice(0,
|
|
1078
|
+
const o = (e.works ?? []).slice(0, co);
|
|
1079
1079
|
return /* @__PURE__ */ M(
|
|
1080
1080
|
"button",
|
|
1081
1081
|
{
|
|
@@ -1085,59 +1085,59 @@ function mo({
|
|
|
1085
1085
|
onClick: r,
|
|
1086
1086
|
children: [
|
|
1087
1087
|
/* @__PURE__ */ u(
|
|
1088
|
-
|
|
1088
|
+
$n,
|
|
1089
1089
|
{
|
|
1090
1090
|
size: 48,
|
|
1091
1091
|
src: e.avatarUrl || void 0,
|
|
1092
|
-
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ u(
|
|
1092
|
+
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ u(Qn, {}),
|
|
1093
1093
|
className: "skopon-resume-select-card-avatar"
|
|
1094
1094
|
}
|
|
1095
1095
|
),
|
|
1096
1096
|
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
|
|
1097
1097
|
/* @__PURE__ */ M("div", { className: "skopon-resume-select-card-body", children: [
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1098
|
+
uo(e.satisfaction),
|
|
1099
|
+
nt("性格", e.personality),
|
|
1100
|
+
nt("专长", e.specialties),
|
|
1101
|
+
nt("擅长领域", e.traits),
|
|
1102
1102
|
/* @__PURE__ */ M("div", { className: "skopon-resume-select-card-works", children: [
|
|
1103
1103
|
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
|
|
1104
|
-
o.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, s) => /* @__PURE__ */ u(
|
|
1104
|
+
o.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, s) => /* @__PURE__ */ u(mo, { work: i }, `${i.title}-${s}`)) }) : /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
|
|
1105
1105
|
] })
|
|
1106
1106
|
] })
|
|
1107
1107
|
]
|
|
1108
1108
|
}
|
|
1109
1109
|
);
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1112
|
-
const { interactive: t } = se(), n =
|
|
1111
|
+
function po({ context: e }) {
|
|
1112
|
+
const { interactive: t } = se(), n = io(), { publishLiveOptions: r } = gt(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = ae(e, "value", {
|
|
1113
1113
|
component: "SkoponResumeSelect",
|
|
1114
1114
|
changeAction: "click"
|
|
1115
|
-
}), l = e.componentModel.properties, c =
|
|
1115
|
+
}), l = e.componentModel.properties, c = et(l.label), m = et(l.placeholder), d = et(l.help), b = l.enableRefresh !== !1, y = Re(l.minCount), S = Re(l.maxCount), g = L(() => tt(l.resumeFilter), [l.resumeFilter]), k = so(g), [p, f] = w(1), [v, x] = w(!1), [N, _] = w(""), [z, C] = w([]), [B, V] = w(0), [re, K] = w(g.pageSize ?? 20), $ = A(0), W = Q(o);
|
|
1116
1116
|
q(() => {
|
|
1117
|
-
const T =
|
|
1117
|
+
const T = gn(W, S);
|
|
1118
1118
|
T !== null && s(T);
|
|
1119
1119
|
}, [S, W, s]);
|
|
1120
1120
|
const ee = j(
|
|
1121
1121
|
async (T) => {
|
|
1122
|
-
const D =
|
|
1122
|
+
const D = tt(JSON.parse(k)), U = ++$.current;
|
|
1123
1123
|
if (!n) {
|
|
1124
1124
|
C([]), V(0), _("未配置简历搜索服务"), x(!1);
|
|
1125
1125
|
return;
|
|
1126
1126
|
}
|
|
1127
1127
|
x(!0), _("");
|
|
1128
1128
|
try {
|
|
1129
|
-
const
|
|
1129
|
+
const F = await n({ filter: D, page: T });
|
|
1130
1130
|
if (U !== $.current) return;
|
|
1131
|
-
C(
|
|
1131
|
+
C(F.list), V(F.total), f(F.page), K(F.pageSize), a && r(
|
|
1132
1132
|
a,
|
|
1133
|
-
|
|
1133
|
+
F.list.map((Y) => ({
|
|
1134
1134
|
value: Y.resumeUniqueId,
|
|
1135
1135
|
label: Y.name || Y.resumeUniqueId
|
|
1136
1136
|
}))
|
|
1137
1137
|
);
|
|
1138
|
-
} catch (
|
|
1138
|
+
} catch (F) {
|
|
1139
1139
|
if (U !== $.current) return;
|
|
1140
|
-
C([]), V(0), _(
|
|
1140
|
+
C([]), V(0), _(F instanceof Error ? F.message : "加载简历列表失败");
|
|
1141
1141
|
} finally {
|
|
1142
1142
|
U === $.current && x(!1);
|
|
1143
1143
|
}
|
|
@@ -1149,7 +1149,7 @@ function fo({ context: e }) {
|
|
|
1149
1149
|
}, [k, ee]);
|
|
1150
1150
|
const te = (T) => {
|
|
1151
1151
|
if (!t) return;
|
|
1152
|
-
const D =
|
|
1152
|
+
const D = pn(
|
|
1153
1153
|
W,
|
|
1154
1154
|
T,
|
|
1155
1155
|
y,
|
|
@@ -1157,8 +1157,8 @@ function fo({ context: e }) {
|
|
|
1157
1157
|
);
|
|
1158
1158
|
D !== null && i(D);
|
|
1159
1159
|
}, E = () => {
|
|
1160
|
-
const T =
|
|
1161
|
-
ee(
|
|
1160
|
+
const T = tt(JSON.parse(k)), D = re || T.pageSize || 20, U = Math.max(1, Math.ceil(B / D)), F = p >= U ? 1 : p + 1;
|
|
1161
|
+
ee(F);
|
|
1162
1162
|
}, P = m || "暂无匹配的简历";
|
|
1163
1163
|
return /* @__PURE__ */ M(
|
|
1164
1164
|
"div",
|
|
@@ -1168,17 +1168,17 @@ function fo({ context: e }) {
|
|
|
1168
1168
|
children: [
|
|
1169
1169
|
c ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: c }) : null,
|
|
1170
1170
|
v && z.length === 0 ? /* @__PURE__ */ M("div", { className: "skopon-resume-select-status", children: [
|
|
1171
|
-
/* @__PURE__ */ u(
|
|
1171
|
+
/* @__PURE__ */ u(dt, { size: "small" }),
|
|
1172
1172
|
" 加载简历…"
|
|
1173
1173
|
] }) : null,
|
|
1174
1174
|
!v && N ? /* @__PURE__ */ u(ne.Text, { type: "danger", className: "skopon-resume-select-status", children: N }) : null,
|
|
1175
1175
|
!v && !N && z.length === 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-empty", children: P }) : null,
|
|
1176
1176
|
z.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-list", children: z.map((T) => /* @__PURE__ */ u(
|
|
1177
|
-
|
|
1177
|
+
fo,
|
|
1178
1178
|
{
|
|
1179
1179
|
item: T,
|
|
1180
1180
|
selected: W.includes(T.resumeUniqueId),
|
|
1181
|
-
disabled:
|
|
1181
|
+
disabled: hn(
|
|
1182
1182
|
W,
|
|
1183
1183
|
T.resumeUniqueId,
|
|
1184
1184
|
t,
|
|
@@ -1190,7 +1190,7 @@ function fo({ context: e }) {
|
|
|
1190
1190
|
T.resumeUniqueId
|
|
1191
1191
|
)) }) : null,
|
|
1192
1192
|
b && n ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ u(
|
|
1193
|
-
|
|
1193
|
+
ze,
|
|
1194
1194
|
{
|
|
1195
1195
|
type: "default",
|
|
1196
1196
|
size: "small",
|
|
@@ -1206,34 +1206,34 @@ function fo({ context: e }) {
|
|
|
1206
1206
|
}
|
|
1207
1207
|
);
|
|
1208
1208
|
}
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
),
|
|
1209
|
+
const ho = X(
|
|
1210
|
+
ao,
|
|
1211
|
+
po
|
|
1212
|
+
), go = {
|
|
1213
1213
|
type: "resume_multiselect",
|
|
1214
1214
|
componentName: "SkoponResumeSelect",
|
|
1215
|
-
toComponent:
|
|
1216
|
-
fromComponent:
|
|
1217
|
-
catalogComponents: [
|
|
1218
|
-
},
|
|
1219
|
-
|
|
1220
|
-
),
|
|
1221
|
-
|
|
1215
|
+
toComponent: ro,
|
|
1216
|
+
fromComponent: oo,
|
|
1217
|
+
catalogComponents: [ho]
|
|
1218
|
+
}, qe = [go, no], yo = new Map(
|
|
1219
|
+
qe.map((e) => [e.type, e])
|
|
1220
|
+
), vo = new Map(
|
|
1221
|
+
qe.map((e) => [e.componentName, e])
|
|
1222
1222
|
);
|
|
1223
|
-
function vo(e) {
|
|
1224
|
-
return go.get(e);
|
|
1225
|
-
}
|
|
1226
1223
|
function bo(e) {
|
|
1227
1224
|
return yo.get(e);
|
|
1228
1225
|
}
|
|
1229
|
-
function So() {
|
|
1230
|
-
return
|
|
1226
|
+
function So(e) {
|
|
1227
|
+
return vo.get(e);
|
|
1231
1228
|
}
|
|
1232
1229
|
function ko() {
|
|
1233
|
-
return
|
|
1230
|
+
return qe.flatMap((e) => e.catalogComponents);
|
|
1231
|
+
}
|
|
1232
|
+
function Co() {
|
|
1233
|
+
return qe.map((e) => e.componentName);
|
|
1234
1234
|
}
|
|
1235
|
-
const
|
|
1236
|
-
function
|
|
1235
|
+
const Pe = "root", ct = "__title__", ut = "__desc__", yt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
|
|
1236
|
+
function Ao(e) {
|
|
1237
1237
|
return `/${e}`;
|
|
1238
1238
|
}
|
|
1239
1239
|
function Jt(e) {
|
|
@@ -1242,27 +1242,27 @@ function Jt(e) {
|
|
|
1242
1242
|
function H(e) {
|
|
1243
1243
|
if (typeof e == "string") return e;
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1245
|
+
function _o(e) {
|
|
1246
1246
|
const t = e.id || le("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
|
|
1247
1247
|
return {
|
|
1248
1248
|
id: t,
|
|
1249
1249
|
component: "SkoponMedia",
|
|
1250
1250
|
mediaType: n,
|
|
1251
|
-
urls:
|
|
1252
|
-
mediaSize:
|
|
1251
|
+
urls: _r(e),
|
|
1252
|
+
mediaSize: Te(e.mediaSize),
|
|
1253
1253
|
label: e.label ?? "",
|
|
1254
1254
|
help: e.help ?? "",
|
|
1255
1255
|
placeholder: e.placeholder ?? ""
|
|
1256
1256
|
};
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1258
|
+
function To(e) {
|
|
1259
1259
|
if (Array.isArray(e.urls))
|
|
1260
1260
|
return e.urls.map((n) => String(n).trim()).filter(Boolean);
|
|
1261
1261
|
const t = H(e.url);
|
|
1262
1262
|
return t != null && t.trim() ? [t.trim()] : [];
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1265
|
-
const r = typeof e.id == "string" ? e.id : le("block-"), o =
|
|
1264
|
+
function Ie(e, t, n) {
|
|
1265
|
+
const r = typeof e.id == "string" ? e.id : le("block-"), o = To(e), i = H(e.label) ?? H(e.description) ?? n, s = H(e.help), a = H(e.placeholder), l = Te(e.mediaSize);
|
|
1266
1266
|
return {
|
|
1267
1267
|
id: r,
|
|
1268
1268
|
type: t,
|
|
@@ -1276,7 +1276,7 @@ function Fe(e, t, n) {
|
|
|
1276
1276
|
function Gt(e) {
|
|
1277
1277
|
switch (e.type) {
|
|
1278
1278
|
case "toggle":
|
|
1279
|
-
return
|
|
1279
|
+
return xe(e.defaultValue);
|
|
1280
1280
|
case "multiselect":
|
|
1281
1281
|
case "checkbox":
|
|
1282
1282
|
case "resume_multiselect":
|
|
@@ -1290,9 +1290,9 @@ function Gt(e) {
|
|
|
1290
1290
|
return typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
1293
|
-
function
|
|
1293
|
+
function xo(e) {
|
|
1294
1294
|
var c;
|
|
1295
|
-
const t = e.id || le("a2-"), n = e.label ?? "", r = ((c = e.name) == null ? void 0 : c.trim()) || "", o = r ?
|
|
1295
|
+
const t = e.id || le("a2-"), n = e.label ?? "", r = ((c = e.name) == null ? void 0 : c.trim()) || "", o = r ? Ao(r) : void 0, i = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), s = (m) => r ? { node: m, dataKey: r, dataValue: Gt(e) } : { node: m }, a = { id: t, label: n, name: r, path: o, withData: s }, l = bo(e.type);
|
|
1296
1296
|
if (l)
|
|
1297
1297
|
return l.toComponent(e, a);
|
|
1298
1298
|
switch (e.type) {
|
|
@@ -1411,7 +1411,7 @@ function To(e) {
|
|
|
1411
1411
|
case "image":
|
|
1412
1412
|
case "video":
|
|
1413
1413
|
case "audio":
|
|
1414
|
-
return { node:
|
|
1414
|
+
return { node: _o(e) };
|
|
1415
1415
|
case "file":
|
|
1416
1416
|
return s({
|
|
1417
1417
|
id: t,
|
|
@@ -1428,31 +1428,31 @@ function To(e) {
|
|
|
1428
1428
|
return { node: null };
|
|
1429
1429
|
}
|
|
1430
1430
|
}
|
|
1431
|
-
function
|
|
1431
|
+
function mt(e) {
|
|
1432
1432
|
if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
|
|
1433
|
-
const t = e.components.find((r) => r.id ===
|
|
1433
|
+
const t = e.components.find((r) => r.id === Pe);
|
|
1434
1434
|
if (!t) return e.components.length === 0;
|
|
1435
1435
|
const n = t.children;
|
|
1436
1436
|
return !Array.isArray(n) || n.length === 0;
|
|
1437
1437
|
}
|
|
1438
|
-
function
|
|
1438
|
+
function bn(e, t) {
|
|
1439
1439
|
const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, s = (e.title ?? "").trim(), a = (e.description ?? "").trim();
|
|
1440
|
-
i && s && (n.push({ id:
|
|
1440
|
+
i && s && (n.push({ id: ct, component: "Text", text: s, variant: "h2" }), r.push(ct)), i && a && (n.push({ id: ut, component: "Text", text: a, variant: "body" }), r.push(ut));
|
|
1441
1441
|
for (const m of e.blocks ?? []) {
|
|
1442
|
-
const { node: d, dataKey: b, dataValue: y } =
|
|
1442
|
+
const { node: d, dataKey: b, dataValue: y } = xo(m);
|
|
1443
1443
|
b && (o[b] = y), d && (n.push(d), r.push(d.id));
|
|
1444
1444
|
}
|
|
1445
|
-
n.unshift({ id:
|
|
1446
|
-
const l = { root:
|
|
1445
|
+
n.unshift({ id: Pe, component: "Column", children: r });
|
|
1446
|
+
const l = { root: Pe, components: n, dataModel: o }, c = t == null ? void 0 : t.styleId;
|
|
1447
1447
|
return c !== void 0 && (l.surfaceProperties = { styleId: c ?? null }), l;
|
|
1448
1448
|
}
|
|
1449
|
-
function
|
|
1449
|
+
function Mo(e) {
|
|
1450
1450
|
const t = /* @__PURE__ */ new Map();
|
|
1451
1451
|
for (const n of e.components ?? [])
|
|
1452
1452
|
n && typeof n.id == "string" && t.set(n.id, n);
|
|
1453
1453
|
return t;
|
|
1454
1454
|
}
|
|
1455
|
-
function
|
|
1455
|
+
function rt(e) {
|
|
1456
1456
|
const t = e.options;
|
|
1457
1457
|
return Array.isArray(t) ? t.map((n) => {
|
|
1458
1458
|
if (!n || typeof n != "object") return null;
|
|
@@ -1463,8 +1463,8 @@ function ot(e) {
|
|
|
1463
1463
|
};
|
|
1464
1464
|
}).filter((n) => !!n) : [];
|
|
1465
1465
|
}
|
|
1466
|
-
function
|
|
1467
|
-
const t = typeof e.id == "string" ? e.id : le("block-"), n = String(e.component ?? ""), r = H(e.label) ?? H(e.text) ?? "", o = Jt(e.value), i = (a) => ({ id: t, type: a, label: r }), s =
|
|
1466
|
+
function No(e) {
|
|
1467
|
+
const t = typeof e.id == "string" ? e.id : le("block-"), n = String(e.component ?? ""), r = H(e.label) ?? H(e.text) ?? "", o = Jt(e.value), i = (a) => ({ id: t, type: a, label: r }), s = So(n);
|
|
1468
1468
|
if (s)
|
|
1469
1469
|
return s.fromComponent(e, i, { asLiteral: H, nameFromValue: Jt });
|
|
1470
1470
|
switch (n) {
|
|
@@ -1485,7 +1485,7 @@ function Mo(e) {
|
|
|
1485
1485
|
const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", c = {
|
|
1486
1486
|
...i(l),
|
|
1487
1487
|
name: o,
|
|
1488
|
-
options:
|
|
1488
|
+
options: rt(e)
|
|
1489
1489
|
}, m = H(e.placeholder);
|
|
1490
1490
|
return m && (c.placeholder = m), c;
|
|
1491
1491
|
}
|
|
@@ -1495,12 +1495,12 @@ function Mo(e) {
|
|
|
1495
1495
|
const m = {
|
|
1496
1496
|
...i(a),
|
|
1497
1497
|
name: o,
|
|
1498
|
-
options:
|
|
1498
|
+
options: rt(e)
|
|
1499
1499
|
}, d = H(e.placeholder);
|
|
1500
1500
|
return d && (m.placeholder = d), m;
|
|
1501
1501
|
}
|
|
1502
1502
|
const c = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
|
|
1503
|
-
return { ...i(c), name: o, options:
|
|
1503
|
+
return { ...i(c), name: o, options: rt(e) };
|
|
1504
1504
|
}
|
|
1505
1505
|
case "DateTimeInput": {
|
|
1506
1506
|
const a = e.enableDate === !0, l = e.enableTime === !0, m = { ...i(!a && l ? "time" : "datetime"), name: o }, d = H(e.placeholder);
|
|
@@ -1508,14 +1508,14 @@ function Mo(e) {
|
|
|
1508
1508
|
}
|
|
1509
1509
|
case "SkoponMedia": {
|
|
1510
1510
|
const a = String(e.mediaType ?? "image");
|
|
1511
|
-
return
|
|
1511
|
+
return Ie(e, a === "video" ? "video" : a === "audio" ? "audio" : "image", r);
|
|
1512
1512
|
}
|
|
1513
1513
|
case "Image":
|
|
1514
|
-
return
|
|
1514
|
+
return Ie(e, "image", r);
|
|
1515
1515
|
case "Video":
|
|
1516
|
-
return
|
|
1516
|
+
return Ie(e, "video", r);
|
|
1517
1517
|
case "AudioPlayer":
|
|
1518
|
-
return
|
|
1518
|
+
return Ie(e, "audio", r);
|
|
1519
1519
|
case "FileUpload": {
|
|
1520
1520
|
const a = H(e.accept) ?? "", l = { ...i("file"), name: o };
|
|
1521
1521
|
return a && (l.fileAcceptExtensions = a.split(",").map((c) => c.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (l.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (l.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (l.fileMinCount = e.minCount), typeof e.maxCount == "number" && (l.fileMaxCount = e.maxCount), l;
|
|
@@ -1524,7 +1524,7 @@ function Mo(e) {
|
|
|
1524
1524
|
return null;
|
|
1525
1525
|
}
|
|
1526
1526
|
}
|
|
1527
|
-
function
|
|
1527
|
+
function Sn(e, t, n, r) {
|
|
1528
1528
|
if (n.has(e)) return;
|
|
1529
1529
|
n.add(e);
|
|
1530
1530
|
const o = t.get(e);
|
|
@@ -1532,46 +1532,46 @@ function bn(e, t, n, r) {
|
|
|
1532
1532
|
const i = String(o.component ?? "");
|
|
1533
1533
|
if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
|
|
1534
1534
|
for (const s of o.children)
|
|
1535
|
-
typeof s == "string" &&
|
|
1535
|
+
typeof s == "string" && Sn(s, t, n, r);
|
|
1536
1536
|
return;
|
|
1537
1537
|
}
|
|
1538
1538
|
r.push(o);
|
|
1539
1539
|
}
|
|
1540
|
-
function
|
|
1540
|
+
function Io(e, t) {
|
|
1541
1541
|
return t ? e.map((n) => {
|
|
1542
1542
|
var i;
|
|
1543
1543
|
const r = (i = n.name) == null ? void 0 : i.trim();
|
|
1544
1544
|
if (!r || !(r in t)) return n;
|
|
1545
1545
|
const o = t[r];
|
|
1546
|
-
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue:
|
|
1546
|
+
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: xe(o) } : { ...n, defaultValue: o };
|
|
1547
1547
|
}) : e;
|
|
1548
1548
|
}
|
|
1549
|
-
function
|
|
1549
|
+
function Fo(e) {
|
|
1550
1550
|
if (!e || !Array.isArray(e.components))
|
|
1551
1551
|
return be({ title: "", description: "", blocks: [] });
|
|
1552
|
-
const t =
|
|
1553
|
-
|
|
1552
|
+
const t = Mo(e), n = [];
|
|
1553
|
+
Sn(e.root ?? Pe, t, /* @__PURE__ */ new Set(), n);
|
|
1554
1554
|
let r = "", o = "";
|
|
1555
1555
|
const i = [];
|
|
1556
1556
|
for (const s of n) {
|
|
1557
|
-
if (s.id ===
|
|
1557
|
+
if (s.id === ct) {
|
|
1558
1558
|
r = H(s.text) ?? r;
|
|
1559
1559
|
continue;
|
|
1560
1560
|
}
|
|
1561
|
-
if (s.id ===
|
|
1561
|
+
if (s.id === ut) {
|
|
1562
1562
|
o = H(s.text) ?? o;
|
|
1563
1563
|
continue;
|
|
1564
1564
|
}
|
|
1565
|
-
const a =
|
|
1565
|
+
const a = No(s);
|
|
1566
1566
|
a && i.push(a);
|
|
1567
1567
|
}
|
|
1568
1568
|
return be({
|
|
1569
1569
|
title: r,
|
|
1570
1570
|
description: o,
|
|
1571
|
-
blocks:
|
|
1571
|
+
blocks: Io(i, e.dataModel)
|
|
1572
1572
|
});
|
|
1573
1573
|
}
|
|
1574
|
-
function
|
|
1574
|
+
function Eo(e, t) {
|
|
1575
1575
|
const { surfaceId: n, catalogId: r } = t, o = [
|
|
1576
1576
|
{ version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
|
|
1577
1577
|
{
|
|
@@ -1584,25 +1584,25 @@ function Fo(e, t) {
|
|
|
1584
1584
|
updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
|
|
1585
1585
|
}), o;
|
|
1586
1586
|
}
|
|
1587
|
-
function
|
|
1587
|
+
function kn(e) {
|
|
1588
1588
|
return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
|
|
1589
1589
|
}
|
|
1590
|
-
function
|
|
1590
|
+
function Uo(e, t) {
|
|
1591
1591
|
if (!e || typeof e != "object") return null;
|
|
1592
|
-
const n = e, r =
|
|
1593
|
-
if (r && !
|
|
1592
|
+
const n = e, r = kn(n.a2ui) ? n.a2ui : void 0;
|
|
1593
|
+
if (r && !mt(r)) return r;
|
|
1594
1594
|
const o = Array.isArray(n.blocks) ? n.blocks : [];
|
|
1595
1595
|
if (o.length === 0) return null;
|
|
1596
|
-
const i =
|
|
1596
|
+
const i = Oe({
|
|
1597
1597
|
title: typeof n.title == "string" ? n.title : "",
|
|
1598
1598
|
description: typeof n.description == "string" ? n.description : "",
|
|
1599
1599
|
blocks: o,
|
|
1600
|
-
jsonSchema:
|
|
1601
|
-
}), s =
|
|
1602
|
-
return
|
|
1600
|
+
jsonSchema: sn(n.jsonSchema ?? n.json_schema)
|
|
1601
|
+
}), s = bn(i, t);
|
|
1602
|
+
return mt(s) ? null : s;
|
|
1603
1603
|
}
|
|
1604
|
-
function
|
|
1605
|
-
return
|
|
1604
|
+
function Ro(e, t, n) {
|
|
1605
|
+
return bn(
|
|
1606
1606
|
{
|
|
1607
1607
|
title: e.title,
|
|
1608
1608
|
description: e.description,
|
|
@@ -1611,18 +1611,18 @@ function Uo(e, t, n) {
|
|
|
1611
1611
|
n
|
|
1612
1612
|
);
|
|
1613
1613
|
}
|
|
1614
|
-
function
|
|
1614
|
+
function Po(e) {
|
|
1615
1615
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1616
1616
|
return;
|
|
1617
1617
|
const t = e;
|
|
1618
|
-
return !(Array.isArray(t.blocks) && t.blocks.length > 0) &&
|
|
1618
|
+
return !(Array.isArray(t.blocks) && t.blocks.length > 0) && kn(t.a2ui) ? Fo(t.a2ui) : Oe({
|
|
1619
1619
|
title: typeof t.title == "string" ? t.title : "",
|
|
1620
1620
|
description: typeof t.description == "string" ? t.description : "",
|
|
1621
1621
|
blocks: Array.isArray(t.blocks) ? t.blocks : [],
|
|
1622
|
-
jsonSchema:
|
|
1622
|
+
jsonSchema: sn(t.jsonSchema ?? t.json_schema)
|
|
1623
1623
|
});
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1625
|
+
function wo(e, t, n) {
|
|
1626
1626
|
const r = e.model.surfacesMap.get(t);
|
|
1627
1627
|
if (!r) return {};
|
|
1628
1628
|
const o = {};
|
|
@@ -1632,18 +1632,18 @@ function Po(e, t, n) {
|
|
|
1632
1632
|
}
|
|
1633
1633
|
return o;
|
|
1634
1634
|
}
|
|
1635
|
-
const
|
|
1635
|
+
const zo = /* @__PURE__ */ new Set(["type", "name", "id"]);
|
|
1636
1636
|
function vt(e) {
|
|
1637
1637
|
return e.type === "text" && e.hidden === !0;
|
|
1638
1638
|
}
|
|
1639
1639
|
function bt(e) {
|
|
1640
|
-
return
|
|
1640
|
+
return Oe({
|
|
1641
1641
|
title: "",
|
|
1642
1642
|
description: "",
|
|
1643
1643
|
blocks: [e]
|
|
1644
1644
|
}).blocks[0];
|
|
1645
1645
|
}
|
|
1646
|
-
function
|
|
1646
|
+
function Oo(e, t) {
|
|
1647
1647
|
var o, i;
|
|
1648
1648
|
const n = /* @__PURE__ */ new Map();
|
|
1649
1649
|
for (const s of t) {
|
|
@@ -1652,7 +1652,7 @@ function zo(e, t) {
|
|
|
1652
1652
|
}
|
|
1653
1653
|
const r = [];
|
|
1654
1654
|
for (const s of e.blocks) {
|
|
1655
|
-
if (
|
|
1655
|
+
if (rn(s.type)) {
|
|
1656
1656
|
r.push(bt(s));
|
|
1657
1657
|
continue;
|
|
1658
1658
|
}
|
|
@@ -1664,7 +1664,7 @@ function zo(e, t) {
|
|
|
1664
1664
|
}
|
|
1665
1665
|
return r;
|
|
1666
1666
|
}
|
|
1667
|
-
function
|
|
1667
|
+
function qo(e, t, n) {
|
|
1668
1668
|
const r = e.rawBlocks;
|
|
1669
1669
|
if (!(r != null && r.length)) return n;
|
|
1670
1670
|
for (const o of r) {
|
|
@@ -1673,23 +1673,23 @@ function Oo(e, t, n) {
|
|
|
1673
1673
|
}
|
|
1674
1674
|
return n;
|
|
1675
1675
|
}
|
|
1676
|
-
function
|
|
1676
|
+
function Bo(e, t) {
|
|
1677
1677
|
var r;
|
|
1678
1678
|
const n = { ...e };
|
|
1679
1679
|
for (const o of Object.keys(t)) {
|
|
1680
|
-
if (
|
|
1680
|
+
if (zo.has(o) || !Object.prototype.hasOwnProperty.call(t, o)) continue;
|
|
1681
1681
|
const i = t[o];
|
|
1682
1682
|
i !== void 0 && Object.assign(n, { [o]: i });
|
|
1683
1683
|
}
|
|
1684
1684
|
return n.type = e.type, n.name = ((r = e.name) == null ? void 0 : r.trim()) || t.name, n.id = e.id, bt(n);
|
|
1685
1685
|
}
|
|
1686
|
-
function
|
|
1686
|
+
function Be(e) {
|
|
1687
1687
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1688
1688
|
const t = e;
|
|
1689
1689
|
if (!Array.isArray(t.blocks)) return null;
|
|
1690
1690
|
const n = t.blocks.filter(
|
|
1691
1691
|
(o) => !!o && typeof o == "object" && !Array.isArray(o)
|
|
1692
|
-
), r =
|
|
1692
|
+
), r = Oe({
|
|
1693
1693
|
title: typeof t.title == "string" ? t.title : "",
|
|
1694
1694
|
description: typeof t.description == "string" ? t.description : "",
|
|
1695
1695
|
blocks: n
|
|
@@ -1701,7 +1701,7 @@ function Ve(e) {
|
|
|
1701
1701
|
rawBlocks: n
|
|
1702
1702
|
};
|
|
1703
1703
|
}
|
|
1704
|
-
function
|
|
1704
|
+
function Vo(e, t) {
|
|
1705
1705
|
var i, s, a, l, c, m;
|
|
1706
1706
|
const n = /* @__PURE__ */ new Map();
|
|
1707
1707
|
for (const d of (t == null ? void 0 : t.blocks) ?? [])
|
|
@@ -1713,34 +1713,34 @@ function Bo(e, t) {
|
|
|
1713
1713
|
if (!b) continue;
|
|
1714
1714
|
const y = n.get(b);
|
|
1715
1715
|
if (y) {
|
|
1716
|
-
const S =
|
|
1717
|
-
r.push(
|
|
1716
|
+
const S = qo(e, b, d);
|
|
1717
|
+
r.push(Bo(y, S));
|
|
1718
1718
|
} else
|
|
1719
1719
|
o.push(bt(d));
|
|
1720
1720
|
}
|
|
1721
1721
|
return {
|
|
1722
1722
|
matchedBlocks: r,
|
|
1723
1723
|
extraBlocks: o,
|
|
1724
|
-
renderBlocks:
|
|
1724
|
+
renderBlocks: Oo(e, r),
|
|
1725
1725
|
title: ((a = e.title) == null ? void 0 : a.trim()) || ((l = t == null ? void 0 : t.title) == null ? void 0 : l.trim()) || "",
|
|
1726
1726
|
description: ((c = e.description) == null ? void 0 : c.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
|
|
1727
1727
|
};
|
|
1728
1728
|
}
|
|
1729
|
-
function
|
|
1729
|
+
function Cn(e) {
|
|
1730
1730
|
const { type: t, defaultValue: n } = e;
|
|
1731
1731
|
return n !== void 0 ? t === "toggle" ? n === !0 || n === "true" : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? Array.isArray(n) ? n.map(String) : typeof n == "string" && n ? [n] : [] : n : t === "toggle" ? !1 : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? [] : t === "number" ? null : "";
|
|
1732
1732
|
}
|
|
1733
|
-
function
|
|
1733
|
+
function we(e) {
|
|
1734
1734
|
var n;
|
|
1735
1735
|
const t = {};
|
|
1736
1736
|
for (const r of e) {
|
|
1737
1737
|
if (!Z(r.type)) continue;
|
|
1738
1738
|
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1739
|
-
o && (t[o] =
|
|
1739
|
+
o && (t[o] = Cn(r));
|
|
1740
1740
|
}
|
|
1741
1741
|
return t;
|
|
1742
1742
|
}
|
|
1743
|
-
function
|
|
1743
|
+
function Lo(e) {
|
|
1744
1744
|
return e.blocks.some(
|
|
1745
1745
|
(t) => {
|
|
1746
1746
|
var n;
|
|
@@ -1748,10 +1748,10 @@ function Vo(e) {
|
|
|
1748
1748
|
}
|
|
1749
1749
|
);
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1751
|
+
function jo(e) {
|
|
1752
1752
|
return e.blocks.filter((t) => {
|
|
1753
1753
|
var n;
|
|
1754
|
-
return
|
|
1754
|
+
return rn(t.type) ? !0 : !Z(t.type) || !((n = t.name) != null && n.trim()) ? !1 : !vt(t);
|
|
1755
1755
|
});
|
|
1756
1756
|
}
|
|
1757
1757
|
function bs(e) {
|
|
@@ -1760,59 +1760,59 @@ function bs(e) {
|
|
|
1760
1760
|
return Z(t.type) && ((n = t.name) == null ? void 0 : n.trim());
|
|
1761
1761
|
}).map((t) => t.name.trim());
|
|
1762
1762
|
}
|
|
1763
|
-
function
|
|
1763
|
+
function $o(e) {
|
|
1764
1764
|
var n;
|
|
1765
1765
|
const t = {};
|
|
1766
1766
|
for (const r of e.blocks) {
|
|
1767
1767
|
if (!vt(r)) continue;
|
|
1768
1768
|
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1769
|
-
o && (t[o] =
|
|
1769
|
+
o && (t[o] = Cn(r));
|
|
1770
1770
|
}
|
|
1771
1771
|
return t;
|
|
1772
1772
|
}
|
|
1773
1773
|
function St(e) {
|
|
1774
1774
|
return e.replace(/'/g, "'\\''");
|
|
1775
1775
|
}
|
|
1776
|
-
function
|
|
1776
|
+
function An(e) {
|
|
1777
1777
|
var n;
|
|
1778
1778
|
const t = (n = e == null ? void 0 : e.Authorization) == null ? void 0 : n.trim();
|
|
1779
1779
|
return t ? ` -H 'Authorization: ${St(t)}' \\` : " -H 'Authorization: Bearer <token>' \\";
|
|
1780
1780
|
}
|
|
1781
|
-
function
|
|
1781
|
+
function _n(e, t, n) {
|
|
1782
1782
|
const r = (t ?? "").trim() || "<callback_url>", o = JSON.stringify(e ?? {}, null, 2);
|
|
1783
1783
|
return [
|
|
1784
1784
|
`curl -X POST '${r}' \\`,
|
|
1785
1785
|
" -H 'Content-Type: application/json' \\",
|
|
1786
|
-
|
|
1786
|
+
An(n),
|
|
1787
1787
|
` -d '${St(o)}'`
|
|
1788
1788
|
].join(`
|
|
1789
1789
|
`);
|
|
1790
1790
|
}
|
|
1791
|
-
function
|
|
1791
|
+
function Do(e, t) {
|
|
1792
1792
|
return JSON.stringify({ ...e, ...t }, null, 2);
|
|
1793
1793
|
}
|
|
1794
|
-
function
|
|
1794
|
+
function Ho({
|
|
1795
1795
|
cardValues: e,
|
|
1796
1796
|
extraValues: t = {},
|
|
1797
1797
|
callbackUrl: n,
|
|
1798
1798
|
headers: r
|
|
1799
1799
|
}) {
|
|
1800
|
-
const o = (n ?? "").trim() || "<callback_url>", i =
|
|
1800
|
+
const o = (n ?? "").trim() || "<callback_url>", i = Do(e, t);
|
|
1801
1801
|
return [
|
|
1802
1802
|
`curl -X POST '${o}' \\`,
|
|
1803
1803
|
" -H 'Content-Type: application/json' \\",
|
|
1804
|
-
|
|
1804
|
+
An(r),
|
|
1805
1805
|
` -d '${St(i)}'`
|
|
1806
1806
|
].join(`
|
|
1807
1807
|
`);
|
|
1808
1808
|
}
|
|
1809
1809
|
function Ss(e, t, n) {
|
|
1810
|
-
const r =
|
|
1811
|
-
if (!r) return
|
|
1812
|
-
const o =
|
|
1813
|
-
return
|
|
1810
|
+
const r = Be(e);
|
|
1811
|
+
if (!r) return _n(e, t, n);
|
|
1812
|
+
const o = we(r.blocks);
|
|
1813
|
+
return Ho({ cardValues: o, callbackUrl: t, headers: n });
|
|
1814
1814
|
}
|
|
1815
|
-
async function
|
|
1815
|
+
async function Tn(e, t, n) {
|
|
1816
1816
|
const r = e.trim();
|
|
1817
1817
|
if (!r)
|
|
1818
1818
|
throw new Error("callback_url 为空");
|
|
@@ -1868,7 +1868,7 @@ async function kt(e) {
|
|
|
1868
1868
|
throw new Error(t.message || `响应缺少 data (${e.status})`);
|
|
1869
1869
|
return t.data;
|
|
1870
1870
|
}
|
|
1871
|
-
const Ct = "auth_user",
|
|
1871
|
+
const Ct = "auth_user", Ko = "token", Jo = "answer_agent_callback_url", Go = "realtime_ws_url", Wo = "/api/v1/mock/ask_user_answer_mock";
|
|
1872
1872
|
function At(e) {
|
|
1873
1873
|
if (typeof window > "u") return null;
|
|
1874
1874
|
try {
|
|
@@ -1885,24 +1885,24 @@ function _t(e) {
|
|
|
1885
1885
|
return null;
|
|
1886
1886
|
}
|
|
1887
1887
|
}
|
|
1888
|
-
function
|
|
1888
|
+
function Yo(e, t) {
|
|
1889
1889
|
const n = _t(e);
|
|
1890
1890
|
if (!n) return "";
|
|
1891
1891
|
const r = n[t];
|
|
1892
1892
|
return typeof r == "string" ? r.trim().replace(/^bearer\s+/i, "").trim() : "";
|
|
1893
1893
|
}
|
|
1894
|
-
function
|
|
1895
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.answerAgentCallbackUrlField ??
|
|
1894
|
+
function Qo(e = {}) {
|
|
1895
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.answerAgentCallbackUrlField ?? Jo, o = At(t);
|
|
1896
1896
|
if (!o) return "";
|
|
1897
1897
|
const i = o.getItem(n);
|
|
1898
1898
|
if (!i) return "";
|
|
1899
1899
|
const s = _t(i);
|
|
1900
1900
|
if (!s) return "";
|
|
1901
1901
|
const a = s[r];
|
|
1902
|
-
return (typeof a == "string" ? a.trim() : "") ||
|
|
1902
|
+
return (typeof a == "string" ? a.trim() : "") || Wo;
|
|
1903
1903
|
}
|
|
1904
|
-
function
|
|
1905
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.realtimeWsUrlField ??
|
|
1904
|
+
function Xo(e = {}) {
|
|
1905
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.realtimeWsUrlField ?? Go, o = At(t);
|
|
1906
1906
|
if (!o) return "";
|
|
1907
1907
|
const i = o.getItem(n);
|
|
1908
1908
|
if (!i) return "";
|
|
@@ -1913,22 +1913,22 @@ function Qo(e = {}) {
|
|
|
1913
1913
|
}
|
|
1914
1914
|
function Tt(e, t) {
|
|
1915
1915
|
return {
|
|
1916
|
-
...
|
|
1916
|
+
...xn(t),
|
|
1917
1917
|
...e ?? {}
|
|
1918
1918
|
};
|
|
1919
1919
|
}
|
|
1920
|
-
function
|
|
1921
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.tokenField ??
|
|
1920
|
+
function xn(e = {}) {
|
|
1921
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.tokenField ?? Ko, o = At(t);
|
|
1922
1922
|
if (!o) return {};
|
|
1923
1923
|
const i = o.getItem(n);
|
|
1924
1924
|
if (!i) return {};
|
|
1925
|
-
const s =
|
|
1925
|
+
const s = Yo(i, r);
|
|
1926
1926
|
return s ? { Authorization: `Bearer ${s}` } : {};
|
|
1927
1927
|
}
|
|
1928
1928
|
async function xt(e = {}) {
|
|
1929
|
-
return e.getHeaders ? await e.getHeaders() ?? {} :
|
|
1929
|
+
return e.getHeaders ? await e.getHeaders() ?? {} : xn(e.authStorage);
|
|
1930
1930
|
}
|
|
1931
|
-
function
|
|
1931
|
+
function Zo(e = {}) {
|
|
1932
1932
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
|
|
1933
1933
|
async function o(i) {
|
|
1934
1934
|
const s = new URLSearchParams();
|
|
@@ -1941,18 +1941,18 @@ function Xo(e = {}) {
|
|
|
1941
1941
|
const a = await xt(e), l = await r(`${t}${n}?${s.toString()}`, {
|
|
1942
1942
|
method: "GET",
|
|
1943
1943
|
headers: a
|
|
1944
|
-
}), c = await kt(l), m =
|
|
1944
|
+
}), c = await kt(l), m = Po(c.form_definition);
|
|
1945
1945
|
return {
|
|
1946
1946
|
formUniqueId: c.form_unique_id,
|
|
1947
1947
|
formId: c.form_id,
|
|
1948
1948
|
disabled: c.disabled === 1,
|
|
1949
1949
|
formDefinition: m,
|
|
1950
|
-
a2ui:
|
|
1950
|
+
a2ui: Uo(c.form_definition) ?? void 0
|
|
1951
1951
|
};
|
|
1952
1952
|
}
|
|
1953
1953
|
return { fetchDetail: o };
|
|
1954
1954
|
}
|
|
1955
|
-
function
|
|
1955
|
+
function ei(e) {
|
|
1956
1956
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1957
1957
|
return e ?? null;
|
|
1958
1958
|
const t = e;
|
|
@@ -1968,7 +1968,7 @@ function Mt({
|
|
|
1968
1968
|
form: n,
|
|
1969
1969
|
answer: r
|
|
1970
1970
|
}) {
|
|
1971
|
-
const o =
|
|
1971
|
+
const o = Be(t) ?? t, i = n ? ei(n) : o;
|
|
1972
1972
|
return {
|
|
1973
1973
|
mission_id: e.missionId ?? null,
|
|
1974
1974
|
tenant_id: e.tenantId ?? null,
|
|
@@ -2006,24 +2006,24 @@ function Cs(e) {
|
|
|
2006
2006
|
);
|
|
2007
2007
|
}
|
|
2008
2008
|
const Wt = "answer_agent_callback_url 未配置,无法提交";
|
|
2009
|
-
function
|
|
2009
|
+
function ti(e) {
|
|
2010
2010
|
if ((e == null ? void 0 : e.answerAgentCallbackUrl) != null) {
|
|
2011
2011
|
const n = e.answerAgentCallbackUrl.trim();
|
|
2012
2012
|
if (!n)
|
|
2013
2013
|
throw new Error(Wt);
|
|
2014
2014
|
return n;
|
|
2015
2015
|
}
|
|
2016
|
-
const t =
|
|
2016
|
+
const t = Qo(e == null ? void 0 : e.authStorage).trim();
|
|
2017
2017
|
if (!t)
|
|
2018
2018
|
throw new Error(Wt);
|
|
2019
2019
|
return t;
|
|
2020
2020
|
}
|
|
2021
|
-
function
|
|
2021
|
+
function Mn(e) {
|
|
2022
2022
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
2023
2023
|
const n = e.data;
|
|
2024
2024
|
return !n || typeof n != "object" || Array.isArray(n) ? null : n;
|
|
2025
2025
|
}
|
|
2026
|
-
function
|
|
2026
|
+
function ni(e, t) {
|
|
2027
2027
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
2028
2028
|
const n = t.message;
|
|
2029
2029
|
if (typeof n == "string" && n.trim())
|
|
@@ -2031,27 +2031,27 @@ function ti(e, t) {
|
|
|
2031
2031
|
}
|
|
2032
2032
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
2033
2033
|
}
|
|
2034
|
-
function
|
|
2034
|
+
function ri(e) {
|
|
2035
2035
|
return `提交失败:${typeof e.error == "string" && e.error.trim() ? e.error.trim() : `回调 HTTP ${e.callback_status ?? "失败"}`}`;
|
|
2036
2036
|
}
|
|
2037
|
-
function
|
|
2038
|
-
const t =
|
|
2039
|
-
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message:
|
|
2037
|
+
function Nn(e) {
|
|
2038
|
+
const t = Mn(e.body);
|
|
2039
|
+
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message: ri(t) } : e.ok ? { type: "success", message: "提交成功" } : {
|
|
2040
2040
|
type: "error",
|
|
2041
|
-
message:
|
|
2041
|
+
message: ni(e.status, e.body)
|
|
2042
2042
|
};
|
|
2043
2043
|
}
|
|
2044
|
-
async function
|
|
2044
|
+
async function In(e, t) {
|
|
2045
2045
|
const n = Nt(e);
|
|
2046
2046
|
if (n)
|
|
2047
2047
|
throw new Error(n);
|
|
2048
|
-
const r =
|
|
2048
|
+
const r = ti(t), o = await Tn(r, e, {
|
|
2049
2049
|
...t,
|
|
2050
2050
|
headers: Tt(t == null ? void 0 : t.headers, t == null ? void 0 : t.authStorage)
|
|
2051
|
-
}), i =
|
|
2051
|
+
}), i = Mn(o.body);
|
|
2052
2052
|
return o.ok && (i == null ? void 0 : i.callback_ok) === !1 ? { ok: !1, status: o.status, body: o.body } : o;
|
|
2053
2053
|
}
|
|
2054
|
-
function
|
|
2054
|
+
function oi(e) {
|
|
2055
2055
|
return {
|
|
2056
2056
|
resumeUniqueId: e.resume_unique_id,
|
|
2057
2057
|
resumeId: e.resume_id,
|
|
@@ -2072,7 +2072,7 @@ function ri(e) {
|
|
|
2072
2072
|
}))
|
|
2073
2073
|
};
|
|
2074
2074
|
}
|
|
2075
|
-
function
|
|
2075
|
+
function ii(e, t, n) {
|
|
2076
2076
|
const r = new URLSearchParams();
|
|
2077
2077
|
r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20));
|
|
2078
2078
|
for (const o of e.names ?? [])
|
|
@@ -2085,27 +2085,27 @@ function oi(e, t, n) {
|
|
|
2085
2085
|
r.append("published", String(o));
|
|
2086
2086
|
return r;
|
|
2087
2087
|
}
|
|
2088
|
-
function
|
|
2088
|
+
function si(e = {}) {
|
|
2089
2089
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.searchPath ?? "/univ/resume/search", r = e.fetch ?? fetch, o = e.published ?? [1];
|
|
2090
2090
|
return async ({ filter: i, page: s }) => {
|
|
2091
|
-
const a = await xt(e), l =
|
|
2091
|
+
const a = await xt(e), l = ii(i, s, o), c = await r(`${t}${n}?${l.toString()}`, {
|
|
2092
2092
|
method: "GET",
|
|
2093
2093
|
headers: a
|
|
2094
2094
|
}), m = await kt(c);
|
|
2095
2095
|
return {
|
|
2096
|
-
list: (m.list ?? []).map(
|
|
2096
|
+
list: (m.list ?? []).map(oi),
|
|
2097
2097
|
total: m.total ?? 0,
|
|
2098
2098
|
page: m.page ?? s,
|
|
2099
2099
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
2100
2100
|
};
|
|
2101
2101
|
};
|
|
2102
2102
|
}
|
|
2103
|
-
function
|
|
2103
|
+
function ai(e) {
|
|
2104
2104
|
var r, o, i, s;
|
|
2105
2105
|
const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!((o = e.agentUniqueId) != null && o.trim() && ((i = e.flowType) != null && i.trim()) && ((s = e.category) != null && s.trim()));
|
|
2106
2106
|
return t || n;
|
|
2107
2107
|
}
|
|
2108
|
-
function
|
|
2108
|
+
function li(e) {
|
|
2109
2109
|
return {
|
|
2110
2110
|
caseUniqueId: e.case_unique_id,
|
|
2111
2111
|
caseId: e.case_id,
|
|
@@ -2116,7 +2116,7 @@ function ai(e) {
|
|
|
2116
2116
|
description: e.description ?? void 0
|
|
2117
2117
|
};
|
|
2118
2118
|
}
|
|
2119
|
-
function
|
|
2119
|
+
function ci(e, t, n) {
|
|
2120
2120
|
var o, i, s;
|
|
2121
2121
|
const r = new URLSearchParams();
|
|
2122
2122
|
r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20)), r.set("published", String(n)), (o = e.agentUniqueId) != null && o.trim() && r.set("agent_unique_id", e.agentUniqueId.trim()), (i = e.flowType) != null && i.trim() && r.set("flow_type", e.flowType.trim()), (s = e.category) != null && s.trim() && r.set("category_unique_id", e.category.trim());
|
|
@@ -2124,17 +2124,17 @@ function li(e, t, n) {
|
|
|
2124
2124
|
a && r.append("flow_unique_ids", a);
|
|
2125
2125
|
return r;
|
|
2126
2126
|
}
|
|
2127
|
-
function
|
|
2127
|
+
function ui(e = {}) {
|
|
2128
2128
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.listPath ?? "/univ/case/list", r = e.fetch ?? fetch, o = e.published ?? 1;
|
|
2129
2129
|
return async ({ filter: i, page: s }) => {
|
|
2130
|
-
if (!
|
|
2130
|
+
if (!ai(i))
|
|
2131
2131
|
return { list: [], total: 0, page: 1, pageSize: i.pageSize ?? 20 };
|
|
2132
|
-
const a = await xt(e), l =
|
|
2132
|
+
const a = await xt(e), l = ci(i, s, o), c = await r(`${t}${n}?${l.toString()}`, {
|
|
2133
2133
|
method: "GET",
|
|
2134
2134
|
headers: a
|
|
2135
2135
|
}), m = await kt(c);
|
|
2136
2136
|
return {
|
|
2137
|
-
list: (m.list ?? []).map(
|
|
2137
|
+
list: (m.list ?? []).map(li),
|
|
2138
2138
|
total: m.total ?? 0,
|
|
2139
2139
|
page: m.page ?? s,
|
|
2140
2140
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
@@ -2150,23 +2150,23 @@ function As(e = {}) {
|
|
|
2150
2150
|
authStorage: e.authStorage
|
|
2151
2151
|
};
|
|
2152
2152
|
return {
|
|
2153
|
-
fetchDetail:
|
|
2153
|
+
fetchDetail: Zo({
|
|
2154
2154
|
...t,
|
|
2155
2155
|
detailPath: (r = e.form) == null ? void 0 : r.detailPath
|
|
2156
2156
|
}).fetchDetail,
|
|
2157
|
-
resumeSearch:
|
|
2157
|
+
resumeSearch: si({
|
|
2158
2158
|
...t,
|
|
2159
2159
|
searchPath: (o = e.resume) == null ? void 0 : o.searchPath,
|
|
2160
2160
|
published: (i = e.resume) == null ? void 0 : i.published
|
|
2161
2161
|
}),
|
|
2162
|
-
caseSearch:
|
|
2162
|
+
caseSearch: ui({
|
|
2163
2163
|
...t,
|
|
2164
2164
|
listPath: (s = e.case) == null ? void 0 : s.listPath,
|
|
2165
2165
|
published: (a = e.case) == null ? void 0 : a.published
|
|
2166
2166
|
})
|
|
2167
2167
|
};
|
|
2168
2168
|
}
|
|
2169
|
-
function
|
|
2169
|
+
function Fn(e, t) {
|
|
2170
2170
|
if (!t.trim()) return !0;
|
|
2171
2171
|
try {
|
|
2172
2172
|
return new RegExp(t).test(e);
|
|
@@ -2174,10 +2174,10 @@ function In(e, t) {
|
|
|
2174
2174
|
return !0;
|
|
2175
2175
|
}
|
|
2176
2176
|
}
|
|
2177
|
-
function
|
|
2177
|
+
function En(e) {
|
|
2178
2178
|
return e == null ? !0 : typeof e == "string" ? !e.trim() : !1;
|
|
2179
2179
|
}
|
|
2180
|
-
function
|
|
2180
|
+
function mi(e, t) {
|
|
2181
2181
|
switch (e.type) {
|
|
2182
2182
|
case "multiselect":
|
|
2183
2183
|
case "checkbox":
|
|
@@ -2186,32 +2186,32 @@ function ui(e, t) {
|
|
|
2186
2186
|
case "case_multiselect":
|
|
2187
2187
|
return Q(t).length === 0;
|
|
2188
2188
|
case "toggle":
|
|
2189
|
-
return !
|
|
2189
|
+
return !xe(t);
|
|
2190
2190
|
case "number":
|
|
2191
2191
|
return t == null || t === "";
|
|
2192
2192
|
default:
|
|
2193
|
-
return
|
|
2193
|
+
return En(t);
|
|
2194
2194
|
}
|
|
2195
2195
|
}
|
|
2196
|
-
function
|
|
2196
|
+
function ot(e, t) {
|
|
2197
2197
|
return e.required === !0 || t > 0;
|
|
2198
2198
|
}
|
|
2199
|
-
function
|
|
2199
|
+
function di(e, t) {
|
|
2200
2200
|
var n, r;
|
|
2201
2201
|
for (const o of e) {
|
|
2202
2202
|
const i = (n = o.name) == null ? void 0 : n.trim();
|
|
2203
|
-
if (!i ||
|
|
2203
|
+
if (!i || ft(o.type) || pe(o.type)) continue;
|
|
2204
2204
|
const s = t[i], a = ((r = o.label) == null ? void 0 : r.trim()) || i;
|
|
2205
|
-
if (o.required &&
|
|
2205
|
+
if (o.required && mi(o, s))
|
|
2206
2206
|
return { fieldName: i, label: a, message: `请填写「${a}」` };
|
|
2207
|
-
if (o.type === "email" && !
|
|
2207
|
+
if (o.type === "email" && !En(s)) {
|
|
2208
2208
|
const l = String(s).trim();
|
|
2209
|
-
if (!
|
|
2209
|
+
if (!Fn(l, yt))
|
|
2210
2210
|
return { fieldName: i, label: a, message: `「${a}」格式不正确` };
|
|
2211
2211
|
}
|
|
2212
2212
|
if (o.type === "file") {
|
|
2213
2213
|
const l = o.fileMinCount ?? 0, c = Q(s).length;
|
|
2214
|
-
if (l > 0 && c < l &&
|
|
2214
|
+
if (l > 0 && c < l && ot(o, c))
|
|
2215
2215
|
return {
|
|
2216
2216
|
fieldName: i,
|
|
2217
2217
|
label: a,
|
|
@@ -2220,7 +2220,7 @@ function mi(e, t) {
|
|
|
2220
2220
|
}
|
|
2221
2221
|
if (o.type === "resume_multiselect") {
|
|
2222
2222
|
const l = o.resumeMinCount, c = Q(s).length;
|
|
2223
|
-
if (l !== void 0 && c < l &&
|
|
2223
|
+
if (l !== void 0 && c < l && ot(o, c))
|
|
2224
2224
|
return {
|
|
2225
2225
|
fieldName: i,
|
|
2226
2226
|
label: a,
|
|
@@ -2229,7 +2229,7 @@ function mi(e, t) {
|
|
|
2229
2229
|
}
|
|
2230
2230
|
if (o.type === "case_multiselect") {
|
|
2231
2231
|
const l = o.caseMinCount, c = Q(s).length;
|
|
2232
|
-
if (l !== void 0 && c < l &&
|
|
2232
|
+
if (l !== void 0 && c < l && ot(o, c))
|
|
2233
2233
|
return {
|
|
2234
2234
|
fieldName: i,
|
|
2235
2235
|
label: a,
|
|
@@ -2239,20 +2239,20 @@ function mi(e, t) {
|
|
|
2239
2239
|
}
|
|
2240
2240
|
return null;
|
|
2241
2241
|
}
|
|
2242
|
-
const
|
|
2243
|
-
video:
|
|
2244
|
-
audio:
|
|
2245
|
-
image:
|
|
2242
|
+
const fi = {
|
|
2243
|
+
video: nr,
|
|
2244
|
+
audio: tr,
|
|
2245
|
+
image: er,
|
|
2246
2246
|
file: Xt,
|
|
2247
|
-
spreadsheet:
|
|
2247
|
+
spreadsheet: Zn,
|
|
2248
2248
|
document: Qt
|
|
2249
2249
|
};
|
|
2250
|
-
function
|
|
2250
|
+
function pi({
|
|
2251
2251
|
type: e,
|
|
2252
2252
|
size: t = 40,
|
|
2253
2253
|
className: n
|
|
2254
2254
|
}) {
|
|
2255
|
-
const r =
|
|
2255
|
+
const r = fi[e] ?? Xt;
|
|
2256
2256
|
return /* @__PURE__ */ u(
|
|
2257
2257
|
r,
|
|
2258
2258
|
{
|
|
@@ -2262,7 +2262,7 @@ function fi({
|
|
|
2262
2262
|
}
|
|
2263
2263
|
);
|
|
2264
2264
|
}
|
|
2265
|
-
const
|
|
2265
|
+
const Un = "skopon-form-v0_9", hi = /* @__PURE__ */ new Set([
|
|
2266
2266
|
"SkoponMedia",
|
|
2267
2267
|
"SkoponSelect",
|
|
2268
2268
|
"Image",
|
|
@@ -2274,24 +2274,24 @@ const En = "skopon-form-v0_9", pi = /* @__PURE__ */ new Set([
|
|
|
2274
2274
|
"FileUpload",
|
|
2275
2275
|
"TextField",
|
|
2276
2276
|
"Text",
|
|
2277
|
-
...
|
|
2278
|
-
]),
|
|
2279
|
-
function
|
|
2280
|
-
const t = [...
|
|
2277
|
+
...Co()
|
|
2278
|
+
]), gi = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
|
|
2279
|
+
function Me(e) {
|
|
2280
|
+
const t = [...Ee.components.values()].find((n) => n.name === e);
|
|
2281
2281
|
if (!t) throw new Error(`Missing basic catalog component: ${e}`);
|
|
2282
2282
|
return t.schema;
|
|
2283
2283
|
}
|
|
2284
2284
|
function R(e) {
|
|
2285
2285
|
return typeof e == "string" ? e : "";
|
|
2286
2286
|
}
|
|
2287
|
-
function
|
|
2287
|
+
function Rn(e) {
|
|
2288
2288
|
return Array.isArray(e) ? e.map((t) => {
|
|
2289
2289
|
if (!t || typeof t != "object") return null;
|
|
2290
2290
|
const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
|
|
2291
2291
|
return { value: r, label: o };
|
|
2292
2292
|
}).filter((t) => !!t) : [];
|
|
2293
2293
|
}
|
|
2294
|
-
function
|
|
2294
|
+
function Ve({
|
|
2295
2295
|
mediaType: e,
|
|
2296
2296
|
urls: t,
|
|
2297
2297
|
mediaSize: n,
|
|
@@ -2299,7 +2299,7 @@ function Le({
|
|
|
2299
2299
|
help: o,
|
|
2300
2300
|
placeholder: i
|
|
2301
2301
|
}) {
|
|
2302
|
-
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l =
|
|
2302
|
+
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l = xr(n), c = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
|
|
2303
2303
|
return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
|
|
2304
2304
|
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2305
2305
|
t.length === 0 ? /* @__PURE__ */ u("div", { className: "form-media-preview form-media-preview--empty", children: c }) : /* @__PURE__ */ u("div", { className: l, children: t.map((m, d) => e === "image" ? /* @__PURE__ */ u(
|
|
@@ -2330,18 +2330,18 @@ function Le({
|
|
|
2330
2330
|
a ? /* @__PURE__ */ u(ne.Text, { type: "secondary", className: "form-block-preview-help", children: a }) : null
|
|
2331
2331
|
] });
|
|
2332
2332
|
}
|
|
2333
|
-
function
|
|
2333
|
+
function Le(e, t) {
|
|
2334
2334
|
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : R(e.url).trim() ? [R(e.url).trim()] : [];
|
|
2335
2335
|
return {
|
|
2336
2336
|
mediaType: t,
|
|
2337
2337
|
urls: n,
|
|
2338
|
-
mediaSize:
|
|
2338
|
+
mediaSize: Te(e.mediaSize),
|
|
2339
2339
|
label: R(e.label) || R(e.description),
|
|
2340
2340
|
help: R(e.help),
|
|
2341
2341
|
placeholder: R(e.placeholder)
|
|
2342
2342
|
};
|
|
2343
2343
|
}
|
|
2344
|
-
const
|
|
2344
|
+
const yi = {
|
|
2345
2345
|
name: "SkoponMedia",
|
|
2346
2346
|
schema: h.object({
|
|
2347
2347
|
mediaType: h.any().optional(),
|
|
@@ -2351,19 +2351,19 @@ const gi = {
|
|
|
2351
2351
|
help: h.any().optional(),
|
|
2352
2352
|
placeholder: h.any().optional()
|
|
2353
2353
|
}).passthrough()
|
|
2354
|
-
},
|
|
2354
|
+
}, vi = X(yi, ({ context: e }) => {
|
|
2355
2355
|
const t = e.componentModel.properties, n = R(t.mediaType);
|
|
2356
|
-
return /* @__PURE__ */ u(
|
|
2357
|
-
}),
|
|
2358
|
-
{ name: "Image", schema:
|
|
2359
|
-
({ context: e }) => /* @__PURE__ */ u(
|
|
2360
|
-
), bi = X(
|
|
2361
|
-
{ name: "Video", schema: Ne("Video") },
|
|
2362
|
-
({ context: e }) => /* @__PURE__ */ u(Le, { ...je(e.componentModel.properties, "video") })
|
|
2356
|
+
return /* @__PURE__ */ u(Ve, { ...Le(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
|
|
2357
|
+
}), bi = X(
|
|
2358
|
+
{ name: "Image", schema: Me("Image") },
|
|
2359
|
+
({ context: e }) => /* @__PURE__ */ u(Ve, { ...Le(e.componentModel.properties, "image") })
|
|
2363
2360
|
), Si = X(
|
|
2364
|
-
{ name: "
|
|
2365
|
-
({ context: e }) => /* @__PURE__ */ u(
|
|
2366
|
-
), ki =
|
|
2361
|
+
{ name: "Video", schema: Me("Video") },
|
|
2362
|
+
({ context: e }) => /* @__PURE__ */ u(Ve, { ...Le(e.componentModel.properties, "video") })
|
|
2363
|
+
), ki = X(
|
|
2364
|
+
{ name: "AudioPlayer", schema: Me("AudioPlayer") },
|
|
2365
|
+
({ context: e }) => /* @__PURE__ */ u(Ve, { ...Le(e.componentModel.properties, "audio") })
|
|
2366
|
+
), Ci = {
|
|
2367
2367
|
name: "SkoponSelect",
|
|
2368
2368
|
schema: h.object({
|
|
2369
2369
|
label: h.any().optional(),
|
|
@@ -2373,18 +2373,18 @@ const gi = {
|
|
|
2373
2373
|
value: h.any().optional()
|
|
2374
2374
|
}).passthrough()
|
|
2375
2375
|
};
|
|
2376
|
-
function
|
|
2376
|
+
function Ai({ context: e }) {
|
|
2377
2377
|
const { interactive: t } = se(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = ae(e, "value", {
|
|
2378
2378
|
component: "SkoponSelect",
|
|
2379
2379
|
changeAction: "select"
|
|
2380
|
-
}), s = e.componentModel.properties, a = R(s.label), l = R(s.placeholder), c =
|
|
2380
|
+
}), s = e.componentModel.properties, a = R(s.label), l = R(s.placeholder), c = Rn(s.options), m = R(s.mode) === "multiple";
|
|
2381
2381
|
return q(() => {
|
|
2382
|
-
const d =
|
|
2382
|
+
const d = fn(n, m);
|
|
2383
2383
|
d !== null && o(d);
|
|
2384
2384
|
}, [m, n, o]), /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2385
2385
|
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2386
2386
|
/* @__PURE__ */ u(
|
|
2387
|
-
|
|
2387
|
+
it,
|
|
2388
2388
|
{
|
|
2389
2389
|
mode: m ? "multiple" : void 0,
|
|
2390
2390
|
disabled: !t,
|
|
@@ -2399,22 +2399,22 @@ function Ci({ context: e }) {
|
|
|
2399
2399
|
)
|
|
2400
2400
|
] });
|
|
2401
2401
|
}
|
|
2402
|
-
const
|
|
2403
|
-
|
|
2404
|
-
|
|
2402
|
+
const _i = X(
|
|
2403
|
+
Ci,
|
|
2404
|
+
Ai
|
|
2405
2405
|
);
|
|
2406
|
-
function
|
|
2406
|
+
function Ti({ context: e }) {
|
|
2407
2407
|
const { interactive: t } = se(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = ae(e, "value", {
|
|
2408
2408
|
component: "ChoicePicker",
|
|
2409
2409
|
changeAction: "select"
|
|
2410
|
-
}), s = e.componentModel.properties, a = R(s.label), l = R(s.variant) || "mutuallyExclusive", c = R(s.skoponPickerType), m = R(s.placeholder), d =
|
|
2410
|
+
}), s = e.componentModel.properties, a = R(s.label), l = R(s.variant) || "mutuallyExclusive", c = R(s.skoponPickerType), m = R(s.placeholder), d = Rn(s.options), y = c === "select" || c === "multiselect" || c === "radio" || c === "checkbox" ? c : l === "multipleSelection" ? "checkbox" : "radio", S = y === "multiselect" || y === "checkbox";
|
|
2411
2411
|
return q(() => {
|
|
2412
|
-
const g =
|
|
2412
|
+
const g = fn(n, S);
|
|
2413
2413
|
g !== null && o(g);
|
|
2414
2414
|
}, [S, n, o]), /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2415
2415
|
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2416
2416
|
y === "select" ? /* @__PURE__ */ u(
|
|
2417
|
-
|
|
2417
|
+
it,
|
|
2418
2418
|
{
|
|
2419
2419
|
disabled: !t,
|
|
2420
2420
|
allowClear: !0,
|
|
@@ -2426,7 +2426,7 @@ function _i({ context: e }) {
|
|
|
2426
2426
|
onChange: (g) => r(g ?? "")
|
|
2427
2427
|
}
|
|
2428
2428
|
) : y === "multiselect" ? /* @__PURE__ */ u(
|
|
2429
|
-
|
|
2429
|
+
it,
|
|
2430
2430
|
{
|
|
2431
2431
|
mode: "multiple",
|
|
2432
2432
|
disabled: !t,
|
|
@@ -2439,7 +2439,7 @@ function _i({ context: e }) {
|
|
|
2439
2439
|
onChange: (g) => r(g ?? [])
|
|
2440
2440
|
}
|
|
2441
2441
|
) : y === "checkbox" ? /* @__PURE__ */ u(
|
|
2442
|
-
|
|
2442
|
+
Dn.Group,
|
|
2443
2443
|
{
|
|
2444
2444
|
disabled: !t,
|
|
2445
2445
|
className: "form-block-preview-control",
|
|
@@ -2448,7 +2448,7 @@ function _i({ context: e }) {
|
|
|
2448
2448
|
onChange: (g) => r(g)
|
|
2449
2449
|
}
|
|
2450
2450
|
) : /* @__PURE__ */ u(
|
|
2451
|
-
|
|
2451
|
+
Hn.Group,
|
|
2452
2452
|
{
|
|
2453
2453
|
disabled: !t,
|
|
2454
2454
|
className: "form-block-preview-control",
|
|
@@ -2459,7 +2459,7 @@ function _i({ context: e }) {
|
|
|
2459
2459
|
)
|
|
2460
2460
|
] });
|
|
2461
2461
|
}
|
|
2462
|
-
const
|
|
2462
|
+
const xi = X(
|
|
2463
2463
|
{
|
|
2464
2464
|
name: "ChoicePicker",
|
|
2465
2465
|
schema: h.object({
|
|
@@ -2471,9 +2471,9 @@ const Ti = X(
|
|
|
2471
2471
|
placeholder: h.any().optional()
|
|
2472
2472
|
}).passthrough()
|
|
2473
2473
|
},
|
|
2474
|
-
|
|
2474
|
+
Ti
|
|
2475
2475
|
);
|
|
2476
|
-
function
|
|
2476
|
+
function Mi({ context: e }) {
|
|
2477
2477
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o } = ae(e, "value", {
|
|
2478
2478
|
component: "CheckBox",
|
|
2479
2479
|
changeAction: "change"
|
|
@@ -2481,21 +2481,21 @@ function xi({ context: e }) {
|
|
|
2481
2481
|
return /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2482
2482
|
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2483
2483
|
/* @__PURE__ */ u(
|
|
2484
|
-
|
|
2484
|
+
Kn,
|
|
2485
2485
|
{
|
|
2486
2486
|
disabled: !t,
|
|
2487
2487
|
className: "form-block-preview-control",
|
|
2488
|
-
checked:
|
|
2488
|
+
checked: xe(n),
|
|
2489
2489
|
onChange: (a) => r(a)
|
|
2490
2490
|
}
|
|
2491
2491
|
)
|
|
2492
2492
|
] });
|
|
2493
2493
|
}
|
|
2494
|
-
const
|
|
2495
|
-
{ name: "CheckBox", schema:
|
|
2496
|
-
|
|
2494
|
+
const Ni = X(
|
|
2495
|
+
{ name: "CheckBox", schema: Me("CheckBox") },
|
|
2496
|
+
Mi
|
|
2497
2497
|
);
|
|
2498
|
-
function
|
|
2498
|
+
function Ii(e, t, n) {
|
|
2499
2499
|
const r = Se(e);
|
|
2500
2500
|
if (!r) return;
|
|
2501
2501
|
if (!t && n) {
|
|
@@ -2505,11 +2505,11 @@ function Ni(e, t, n) {
|
|
|
2505
2505
|
const o = jt(r);
|
|
2506
2506
|
return o.isValid() ? o : void 0;
|
|
2507
2507
|
}
|
|
2508
|
-
function
|
|
2508
|
+
function Fi({ context: e }) {
|
|
2509
2509
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o, reportFocus: i } = ae(e, "value", {
|
|
2510
2510
|
component: "DateTimeInput",
|
|
2511
2511
|
changeAction: "change"
|
|
2512
|
-
}), s = e.componentModel.properties, a = R(s.label), l = R(s.placeholder), c = s.enableDate === !0, m = s.enableTime === !0, d =
|
|
2512
|
+
}), s = e.componentModel.properties, a = R(s.label), l = R(s.placeholder), c = s.enableDate === !0, m = s.enableTime === !0, d = Ii(n, c, m), b = (y) => {
|
|
2513
2513
|
if (!y) {
|
|
2514
2514
|
r("");
|
|
2515
2515
|
return;
|
|
@@ -2527,7 +2527,7 @@ function Ii({ context: e }) {
|
|
|
2527
2527
|
return /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2528
2528
|
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2529
2529
|
!c && m ? /* @__PURE__ */ u(
|
|
2530
|
-
|
|
2530
|
+
Jn,
|
|
2531
2531
|
{
|
|
2532
2532
|
disabled: !t,
|
|
2533
2533
|
className: "form-block-preview-control",
|
|
@@ -2538,7 +2538,7 @@ function Ii({ context: e }) {
|
|
|
2538
2538
|
onFocus: i
|
|
2539
2539
|
}
|
|
2540
2540
|
) : /* @__PURE__ */ u(
|
|
2541
|
-
|
|
2541
|
+
Gn,
|
|
2542
2542
|
{
|
|
2543
2543
|
showTime: c && m,
|
|
2544
2544
|
disabled: !t,
|
|
@@ -2552,7 +2552,7 @@ function Ii({ context: e }) {
|
|
|
2552
2552
|
)
|
|
2553
2553
|
] });
|
|
2554
2554
|
}
|
|
2555
|
-
const
|
|
2555
|
+
const Ei = X(
|
|
2556
2556
|
{
|
|
2557
2557
|
name: "DateTimeInput",
|
|
2558
2558
|
schema: h.object({
|
|
@@ -2565,8 +2565,8 @@ const Fi = X(
|
|
|
2565
2565
|
max: h.any().optional()
|
|
2566
2566
|
}).passthrough()
|
|
2567
2567
|
},
|
|
2568
|
-
|
|
2569
|
-
),
|
|
2568
|
+
Fi
|
|
2569
|
+
), Ui = {
|
|
2570
2570
|
name: "FileUpload",
|
|
2571
2571
|
schema: h.object({
|
|
2572
2572
|
label: h.any().optional(),
|
|
@@ -2578,20 +2578,20 @@ const Fi = X(
|
|
|
2578
2578
|
value: h.any().optional()
|
|
2579
2579
|
}).passthrough()
|
|
2580
2580
|
};
|
|
2581
|
-
function
|
|
2581
|
+
function Ri({ context: e }) {
|
|
2582
2582
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o } = ae(e, "value", {
|
|
2583
2583
|
component: "FileUpload",
|
|
2584
2584
|
changeAction: "change"
|
|
2585
|
-
}), i = e.componentModel.properties, s = R(i.label), a = R(i.accept), l = Array.isArray(i.fileAcceptTypes) ? i.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((f) => f.trim()).filter(Boolean) : void 0, m =
|
|
2585
|
+
}), i = e.componentModel.properties, s = R(i.label), a = R(i.accept), l = Array.isArray(i.fileAcceptTypes) ? i.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((f) => f.trim()).filter(Boolean) : void 0, m = br(l, c), d = typeof i.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
|
|
2586
2586
|
i.filePlaceholderIcon
|
|
2587
2587
|
) ? i.filePlaceholderIcon : "document", b = typeof i.minCount == "number" ? Math.max(0, i.minCount) : 0, y = typeof i.maxCount == "number" ? i.maxCount : 1, S = y > 0, g = Q(n), k = S && g.length >= y, p = g.length < b;
|
|
2588
2588
|
return /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2589
2589
|
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2590
2590
|
/* @__PURE__ */ M(
|
|
2591
|
-
|
|
2591
|
+
We.Dragger,
|
|
2592
2592
|
{
|
|
2593
2593
|
disabled: !t || k,
|
|
2594
|
-
accept:
|
|
2594
|
+
accept: vr(l, c),
|
|
2595
2595
|
className: "form-file-upload-preview",
|
|
2596
2596
|
showUploadList: t && g.length > 0,
|
|
2597
2597
|
fileList: t ? g.map((f, v) => ({
|
|
@@ -2600,9 +2600,9 @@ function Ui({ context: e }) {
|
|
|
2600
2600
|
status: "done"
|
|
2601
2601
|
})) : [],
|
|
2602
2602
|
beforeUpload: (f) => {
|
|
2603
|
-
if (!t) return
|
|
2603
|
+
if (!t) return We.LIST_IGNORE;
|
|
2604
2604
|
const v = Q(Ht(e));
|
|
2605
|
-
if (S && v.length >= y) return
|
|
2605
|
+
if (S && v.length >= y) return We.LIST_IGNORE;
|
|
2606
2606
|
const x = S ? [...v, f.name].slice(0, y) : [...v, f.name];
|
|
2607
2607
|
return r(x), !1;
|
|
2608
2608
|
},
|
|
@@ -2612,7 +2612,7 @@ function Ui({ context: e }) {
|
|
|
2612
2612
|
r(_);
|
|
2613
2613
|
},
|
|
2614
2614
|
children: [
|
|
2615
|
-
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ u(
|
|
2615
|
+
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ u(pi, { type: d, size: 40 }) }),
|
|
2616
2616
|
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
|
|
2617
2617
|
]
|
|
2618
2618
|
}
|
|
@@ -2627,11 +2627,11 @@ function Ui({ context: e }) {
|
|
|
2627
2627
|
] })
|
|
2628
2628
|
] });
|
|
2629
2629
|
}
|
|
2630
|
-
const
|
|
2631
|
-
|
|
2632
|
-
|
|
2630
|
+
const Pi = X(
|
|
2631
|
+
Ui,
|
|
2632
|
+
Ri
|
|
2633
2633
|
);
|
|
2634
|
-
function
|
|
2634
|
+
function wi({ context: e }) {
|
|
2635
2635
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o, reportFocus: i } = ae(e, "value", {
|
|
2636
2636
|
component: "TextField",
|
|
2637
2637
|
changeAction: "change",
|
|
@@ -2641,7 +2641,7 @@ function Pi({ context: e }) {
|
|
|
2641
2641
|
S("");
|
|
2642
2642
|
return;
|
|
2643
2643
|
}
|
|
2644
|
-
S(
|
|
2644
|
+
S(Fn(f, m) ? "" : "格式不正确");
|
|
2645
2645
|
};
|
|
2646
2646
|
q(() => {
|
|
2647
2647
|
g(d);
|
|
@@ -2650,7 +2650,7 @@ function Pi({ context: e }) {
|
|
|
2650
2650
|
let p;
|
|
2651
2651
|
if (c === "longText")
|
|
2652
2652
|
p = /* @__PURE__ */ u(
|
|
2653
|
-
|
|
2653
|
+
Ye.TextArea,
|
|
2654
2654
|
{
|
|
2655
2655
|
disabled: b,
|
|
2656
2656
|
className: k,
|
|
@@ -2669,7 +2669,7 @@ function Pi({ context: e }) {
|
|
|
2669
2669
|
else if (c === "number") {
|
|
2670
2670
|
const f = d && Number.isFinite(Number(d)) ? Number(d) : void 0;
|
|
2671
2671
|
p = /* @__PURE__ */ u(
|
|
2672
|
-
|
|
2672
|
+
Wn,
|
|
2673
2673
|
{
|
|
2674
2674
|
disabled: b,
|
|
2675
2675
|
className: k,
|
|
@@ -2681,7 +2681,7 @@ function Pi({ context: e }) {
|
|
|
2681
2681
|
}
|
|
2682
2682
|
);
|
|
2683
2683
|
} else c === "obscured" ? p = /* @__PURE__ */ u(
|
|
2684
|
-
|
|
2684
|
+
Ye.Password,
|
|
2685
2685
|
{
|
|
2686
2686
|
disabled: b,
|
|
2687
2687
|
className: k,
|
|
@@ -2691,7 +2691,7 @@ function Pi({ context: e }) {
|
|
|
2691
2691
|
onFocus: i
|
|
2692
2692
|
}
|
|
2693
2693
|
) : p = /* @__PURE__ */ u(
|
|
2694
|
-
|
|
2694
|
+
Ye,
|
|
2695
2695
|
{
|
|
2696
2696
|
disabled: b,
|
|
2697
2697
|
className: k,
|
|
@@ -2712,7 +2712,7 @@ function Pi({ context: e }) {
|
|
|
2712
2712
|
y ? /* @__PURE__ */ u(ne.Text, { type: "danger", className: "form-block-preview-help", children: y }) : null
|
|
2713
2713
|
] });
|
|
2714
2714
|
}
|
|
2715
|
-
const
|
|
2715
|
+
const zi = X(
|
|
2716
2716
|
{
|
|
2717
2717
|
name: "TextField",
|
|
2718
2718
|
schema: h.object({
|
|
@@ -2723,35 +2723,35 @@ const wi = X(
|
|
|
2723
2723
|
value: h.any().optional()
|
|
2724
2724
|
}).passthrough()
|
|
2725
2725
|
},
|
|
2726
|
-
|
|
2726
|
+
wi
|
|
2727
2727
|
);
|
|
2728
|
-
function
|
|
2728
|
+
function Oi({ context: e }) {
|
|
2729
2729
|
const t = e.componentModel.properties, n = R(t.text), r = R(t.variant) || "body";
|
|
2730
|
-
return
|
|
2730
|
+
return gi.has(r) ? r === "caption" ? /* @__PURE__ */ u(ne.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ u("em", { children: n }) }) : /* @__PURE__ */ u(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ u(ne.Paragraph, { className: "form-block-preview-paragraph", children: n });
|
|
2731
2731
|
}
|
|
2732
|
-
const
|
|
2733
|
-
{ name: "Text", schema:
|
|
2734
|
-
|
|
2732
|
+
const qi = X(
|
|
2733
|
+
{ name: "Text", schema: Me("Text") },
|
|
2734
|
+
Oi
|
|
2735
2735
|
);
|
|
2736
|
-
function
|
|
2736
|
+
function Pn() {
|
|
2737
2737
|
const t = [
|
|
2738
|
-
...[...
|
|
2739
|
-
(r) => !
|
|
2738
|
+
...[...Ee.components.values()].filter(
|
|
2739
|
+
(r) => !hi.has(r.name)
|
|
2740
2740
|
),
|
|
2741
|
-
yi,
|
|
2742
|
-
Ai,
|
|
2743
2741
|
vi,
|
|
2742
|
+
_i,
|
|
2744
2743
|
bi,
|
|
2745
2744
|
Si,
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2745
|
+
ki,
|
|
2746
|
+
xi,
|
|
2747
|
+
Ni,
|
|
2748
|
+
Ei,
|
|
2749
|
+
Pi,
|
|
2750
|
+
zi,
|
|
2751
|
+
qi,
|
|
2752
|
+
...ko()
|
|
2753
|
+
], n = [...Ee.functions.values()];
|
|
2754
|
+
return new rr(Un, t, n, Ee.themeSchema);
|
|
2755
2755
|
}
|
|
2756
2756
|
const ie = {
|
|
2757
2757
|
jade9: "#29a383",
|
|
@@ -2765,7 +2765,7 @@ const ie = {
|
|
|
2765
2765
|
primaryHover: "#26997b",
|
|
2766
2766
|
primaryActive: "#1d3b31",
|
|
2767
2767
|
onPrimary: "#ffffff"
|
|
2768
|
-
},
|
|
2768
|
+
}, Bi = {
|
|
2769
2769
|
cssVar: { key: "vidtempl" },
|
|
2770
2770
|
token: {
|
|
2771
2771
|
colorPrimary: ie.primarySolid,
|
|
@@ -2855,9 +2855,9 @@ function ke({
|
|
|
2855
2855
|
locale: t,
|
|
2856
2856
|
theme: n
|
|
2857
2857
|
}) {
|
|
2858
|
-
return /* @__PURE__ */ u(
|
|
2858
|
+
return /* @__PURE__ */ u(Yn, { theme: n ?? Bi, locale: t, children: e });
|
|
2859
2859
|
}
|
|
2860
|
-
const
|
|
2860
|
+
const Vi = Ln(
|
|
2861
2861
|
function({
|
|
2862
2862
|
doc: t,
|
|
2863
2863
|
surfaceId: n = "skopon-form",
|
|
@@ -2874,7 +2874,7 @@ const Bi = Vn(
|
|
|
2874
2874
|
const m = A(null), d = A(i);
|
|
2875
2875
|
d.current = i;
|
|
2876
2876
|
const b = L(() => {
|
|
2877
|
-
if (
|
|
2877
|
+
if (mt(t)) return "";
|
|
2878
2878
|
try {
|
|
2879
2879
|
return JSON.stringify(t);
|
|
2880
2880
|
} catch {
|
|
@@ -2884,9 +2884,9 @@ const Bi = Vn(
|
|
|
2884
2884
|
if (!b)
|
|
2885
2885
|
return { surfaces: [], processor: null };
|
|
2886
2886
|
try {
|
|
2887
|
-
const p = JSON.parse(b), f = new en([
|
|
2887
|
+
const p = JSON.parse(b), f = new en([Pn()]), v = Eo(p, {
|
|
2888
2888
|
surfaceId: n,
|
|
2889
|
-
catalogId:
|
|
2889
|
+
catalogId: Un
|
|
2890
2890
|
});
|
|
2891
2891
|
return f.processMessages(v), {
|
|
2892
2892
|
surfaces: Array.from(f.model.surfacesMap.values()),
|
|
@@ -2896,14 +2896,14 @@ const Bi = Vn(
|
|
|
2896
2896
|
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", p), { surfaces: [], processor: null };
|
|
2897
2897
|
}
|
|
2898
2898
|
}, [b, n]), { surfaces: S, processor: g } = y;
|
|
2899
|
-
if (m.current = g,
|
|
2899
|
+
if (m.current = g, jn(
|
|
2900
2900
|
c,
|
|
2901
2901
|
() => ({
|
|
2902
2902
|
getValues(p) {
|
|
2903
2903
|
const f = m.current;
|
|
2904
2904
|
if (!f) return {};
|
|
2905
2905
|
const v = (p ?? d.current).map((x) => x.trim()).filter(Boolean);
|
|
2906
|
-
return
|
|
2906
|
+
return wo(f, n, v);
|
|
2907
2907
|
},
|
|
2908
2908
|
setValues(p) {
|
|
2909
2909
|
const f = m.current;
|
|
@@ -2918,15 +2918,15 @@ const Bi = Vn(
|
|
|
2918
2918
|
}),
|
|
2919
2919
|
[n]
|
|
2920
2920
|
), S.length === 0) {
|
|
2921
|
-
const p = /* @__PURE__ */ u(
|
|
2921
|
+
const p = /* @__PURE__ */ u(lt, { resumeSearch: s, children: /* @__PURE__ */ u(at, { caseSearch: a, children: /* @__PURE__ */ u(st, { interactive: o, children: r }) }) });
|
|
2922
2922
|
return l ? /* @__PURE__ */ u(ke, { children: p }) : p;
|
|
2923
2923
|
}
|
|
2924
|
-
const k = /* @__PURE__ */ u(
|
|
2924
|
+
const k = /* @__PURE__ */ u(lt, { resumeSearch: s, children: /* @__PURE__ */ u(at, { caseSearch: a, children: /* @__PURE__ */ u(st, { interactive: o, children: /* @__PURE__ */ u("div", { className: "a2ui-surface a2ui-container", children: S.map((p) => /* @__PURE__ */ u(Zt, { surface: p }, p.id)) }) }) }) });
|
|
2925
2925
|
return l ? /* @__PURE__ */ u(ke, { children: k }) : k;
|
|
2926
2926
|
}
|
|
2927
2927
|
);
|
|
2928
|
-
function
|
|
2929
|
-
return new en([
|
|
2928
|
+
function Fe() {
|
|
2929
|
+
return new en([Pn()]);
|
|
2930
2930
|
}
|
|
2931
2931
|
function _s({
|
|
2932
2932
|
messages: e,
|
|
@@ -2940,7 +2940,7 @@ function _s({
|
|
|
2940
2940
|
nn(), tn();
|
|
2941
2941
|
}, []);
|
|
2942
2942
|
const s = A(null);
|
|
2943
|
-
s.current === null && (s.current =
|
|
2943
|
+
s.current === null && (s.current = Fe());
|
|
2944
2944
|
const a = A(0), l = A(""), c = A(!0), m = A(t);
|
|
2945
2945
|
function d(p, f) {
|
|
2946
2946
|
s.current = p, a.current = f.length, l.current = JSON.stringify(f), c.current && (S(p), k(Array.from(p.model.surfacesMap.values())));
|
|
@@ -2978,14 +2978,14 @@ function _s({
|
|
|
2978
2978
|
let p = !1;
|
|
2979
2979
|
const f = m.current !== t;
|
|
2980
2980
|
if (m.current = t, f) {
|
|
2981
|
-
const _ =
|
|
2981
|
+
const _ = Fe();
|
|
2982
2982
|
return Array.isArray(e) && e.length > 0 ? (_.processMessages(e), p || d(_, e)) : (s.current = _, a.current = 0, l.current = "", p || (S(_), k([]))), () => {
|
|
2983
2983
|
p = !0;
|
|
2984
2984
|
};
|
|
2985
2985
|
}
|
|
2986
2986
|
if (!Array.isArray(e) || e.length === 0) {
|
|
2987
2987
|
if (a.current > 0) {
|
|
2988
|
-
const _ =
|
|
2988
|
+
const _ = Fe();
|
|
2989
2989
|
s.current = _, a.current = 0, l.current = "", p || (S(_), k([]));
|
|
2990
2990
|
}
|
|
2991
2991
|
return () => {
|
|
@@ -2994,7 +2994,7 @@ function _s({
|
|
|
2994
2994
|
}
|
|
2995
2995
|
const v = s.current, x = a.current;
|
|
2996
2996
|
if (e.length < x || b(e, x)) {
|
|
2997
|
-
const _ =
|
|
2997
|
+
const _ = Fe();
|
|
2998
2998
|
return _.processMessages(e), p || d(_, e), () => {
|
|
2999
2999
|
p = !0;
|
|
3000
3000
|
};
|
|
@@ -3005,15 +3005,15 @@ function _s({
|
|
|
3005
3005
|
} : (v.processMessages(N), a.current = e.length, l.current = JSON.stringify(e), p || k(Array.from(v.model.surfacesMap.values())), () => {
|
|
3006
3006
|
p = !0;
|
|
3007
3007
|
});
|
|
3008
|
-
}, [e, t]), g.length === 0 ? /* @__PURE__ */ u(ke, { children: n }) : /* @__PURE__ */ u(ke, { children: /* @__PURE__ */ u(
|
|
3008
|
+
}, [e, t]), g.length === 0 ? /* @__PURE__ */ u(ke, { children: n }) : /* @__PURE__ */ u(ke, { children: /* @__PURE__ */ u(lt, { resumeSearch: o, children: /* @__PURE__ */ u(at, { caseSearch: i, children: /* @__PURE__ */ u(st, { interactive: r, children: /* @__PURE__ */ u("div", { className: "a2ui-surface a2ui-container", children: g.map((p) => /* @__PURE__ */ u(Zt, { surface: p }, p.id)) }) }) }) }) });
|
|
3009
3009
|
}
|
|
3010
|
-
const
|
|
3011
|
-
function
|
|
3010
|
+
const Li = 100, ji = 3e4, $i = 1500, fe = /* @__PURE__ */ new Map();
|
|
3011
|
+
function Di(e) {
|
|
3012
3012
|
const t = e.trim();
|
|
3013
3013
|
let n = fe.get(t);
|
|
3014
|
-
return n || (n = new
|
|
3014
|
+
return n || (n = new Hi(t), fe.set(t, n)), n.acquire(), n;
|
|
3015
3015
|
}
|
|
3016
|
-
class
|
|
3016
|
+
class Hi {
|
|
3017
3017
|
constructor(t) {
|
|
3018
3018
|
G(this, "url");
|
|
3019
3019
|
G(this, "ws", null);
|
|
@@ -3032,7 +3032,7 @@ class Di {
|
|
|
3032
3032
|
release() {
|
|
3033
3033
|
this.refCount = Math.max(0, this.refCount - 1), !(this.refCount > 0) && (this.clearReleaseTimer(), this.releaseTimer = setTimeout(() => {
|
|
3034
3034
|
this.releaseTimer = null, !(this.refCount > 0) && (this.teardown(), fe.get(this.url) === this && fe.delete(this.url));
|
|
3035
|
-
},
|
|
3035
|
+
}, $i));
|
|
3036
3036
|
}
|
|
3037
3037
|
/** 强制关闭(测试用),跳过宽限期。 */
|
|
3038
3038
|
forceClose() {
|
|
@@ -3105,7 +3105,7 @@ class Di {
|
|
|
3105
3105
|
}
|
|
3106
3106
|
}
|
|
3107
3107
|
enqueue(t) {
|
|
3108
|
-
for (this.sendQueue.push(t); this.sendQueue.length >
|
|
3108
|
+
for (this.sendQueue.push(t); this.sendQueue.length > Li; )
|
|
3109
3109
|
this.sendQueue.shift();
|
|
3110
3110
|
}
|
|
3111
3111
|
flushQueue() {
|
|
@@ -3119,7 +3119,7 @@ class Di {
|
|
|
3119
3119
|
if (!this.connectRequested || this.refCount <= 0) return;
|
|
3120
3120
|
this.clearReconnectTimer();
|
|
3121
3121
|
const t = Math.min(
|
|
3122
|
-
|
|
3122
|
+
ji,
|
|
3123
3123
|
1e3 * 2 ** Math.min(this.reconnectAttempt, 5)
|
|
3124
3124
|
);
|
|
3125
3125
|
this.reconnectAttempt += 1, this.reconnectTimer = setTimeout(() => {
|
|
@@ -3157,13 +3157,13 @@ class Di {
|
|
|
3157
3157
|
}
|
|
3158
3158
|
}
|
|
3159
3159
|
}
|
|
3160
|
-
class
|
|
3160
|
+
class Ki {
|
|
3161
3161
|
constructor(t) {
|
|
3162
3162
|
G(this, "askUserMessageId");
|
|
3163
3163
|
G(this, "connection");
|
|
3164
3164
|
G(this, "unsubscribe");
|
|
3165
3165
|
G(this, "closed", !1);
|
|
3166
|
-
this.askUserMessageId = t.askUserMessageId.trim(), this.connection =
|
|
3166
|
+
this.askUserMessageId = t.askUserMessageId.trim(), this.connection = Di(t.url);
|
|
3167
3167
|
const n = t.onAutoControl;
|
|
3168
3168
|
this.unsubscribe = n ? this.connection.subscribe(this.askUserMessageId, n) : () => {
|
|
3169
3169
|
};
|
|
@@ -3178,24 +3178,24 @@ class Hi {
|
|
|
3178
3178
|
this.closed || (this.closed = !0, this.unsubscribe(), this.connection.release());
|
|
3179
3179
|
}
|
|
3180
3180
|
}
|
|
3181
|
-
function
|
|
3181
|
+
function wn(e) {
|
|
3182
3182
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
3183
3183
|
}
|
|
3184
|
-
function
|
|
3184
|
+
function Ji(e, t) {
|
|
3185
3185
|
if (!e) return !1;
|
|
3186
|
-
const n = e.querySelector(`[data-skopon-field="${
|
|
3186
|
+
const n = e.querySelector(`[data-skopon-field="${wn(t)}"]`);
|
|
3187
3187
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
3188
3188
|
'input, textarea, select, button, [tabindex]:not([tabindex="-1"])'
|
|
3189
3189
|
) ?? n).focus(), !0) : !1;
|
|
3190
3190
|
}
|
|
3191
|
-
function
|
|
3191
|
+
function Gi(e, t) {
|
|
3192
3192
|
if (!e) return !1;
|
|
3193
|
-
const n = e.querySelector(`[data-skopon-field="${
|
|
3193
|
+
const n = e.querySelector(`[data-skopon-field="${wn(t)}"]`);
|
|
3194
3194
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
3195
3195
|
'button, [role="button"], .skopon-resume-select-card, input, label'
|
|
3196
3196
|
) ?? n).click(), !0) : !1;
|
|
3197
3197
|
}
|
|
3198
|
-
function
|
|
3198
|
+
function Wi(e, t, n) {
|
|
3199
3199
|
const r = e.action;
|
|
3200
3200
|
if (r !== "change" && r !== "select" && r !== "focus" && r !== "click" && r !== "submit") {
|
|
3201
3201
|
console.warn("[FormAutoControl] unknown action", r);
|
|
@@ -3225,47 +3225,47 @@ function Gi(e, t, n) {
|
|
|
3225
3225
|
return;
|
|
3226
3226
|
}
|
|
3227
3227
|
if (r === "focus") {
|
|
3228
|
-
|
|
3228
|
+
Ji(t.rootElement, o), n.reportEvent({
|
|
3229
3229
|
action: "focus",
|
|
3230
3230
|
component: i,
|
|
3231
3231
|
field: o
|
|
3232
3232
|
});
|
|
3233
3233
|
return;
|
|
3234
3234
|
}
|
|
3235
|
-
|
|
3235
|
+
Gi(t.rootElement, o) || console.warn("[FormAutoControl] click target not found", o);
|
|
3236
3236
|
});
|
|
3237
3237
|
}
|
|
3238
|
-
function
|
|
3238
|
+
function Yi(e) {
|
|
3239
3239
|
const t = {};
|
|
3240
3240
|
for (const [n, r] of Object.entries(e))
|
|
3241
3241
|
r !== void 0 && (t[n] = r);
|
|
3242
3242
|
return t;
|
|
3243
3243
|
}
|
|
3244
|
-
function
|
|
3244
|
+
function Qi(e, t) {
|
|
3245
3245
|
var o;
|
|
3246
3246
|
const n = (o = e.name) == null ? void 0 : o.trim();
|
|
3247
3247
|
if (!n || !t) return { ...e };
|
|
3248
3248
|
const r = t.get(n);
|
|
3249
3249
|
return r ? e.type !== "resume_multiselect" && e.type !== "case_multiselect" ? { ...e } : { ...e, options: r.map((i) => ({ ...i })) } : { ...e };
|
|
3250
3250
|
}
|
|
3251
|
-
function
|
|
3251
|
+
function Xi(e) {
|
|
3252
3252
|
var i, s;
|
|
3253
3253
|
const n = {
|
|
3254
3254
|
blocks: (e.blocks ?? []).map(
|
|
3255
|
-
(a) =>
|
|
3255
|
+
(a) => Qi(a, e.liveOptions)
|
|
3256
3256
|
)
|
|
3257
3257
|
}, r = (i = e.title) == null ? void 0 : i.trim(), o = (s = e.description) == null ? void 0 : s.trim();
|
|
3258
3258
|
return r && (n.title = r), o && (n.description = o), {
|
|
3259
3259
|
form_schema: n,
|
|
3260
|
-
form_values:
|
|
3260
|
+
form_values: Yi(e.values ?? {}),
|
|
3261
3261
|
form_change: [...e.formChange ?? []]
|
|
3262
3262
|
};
|
|
3263
3263
|
}
|
|
3264
|
-
function
|
|
3265
|
-
const t =
|
|
3266
|
-
return t ?
|
|
3264
|
+
function Zi(e) {
|
|
3265
|
+
const t = Be(e);
|
|
3266
|
+
return t ? we(t.blocks) : e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
3267
3267
|
}
|
|
3268
|
-
function
|
|
3268
|
+
function es({
|
|
3269
3269
|
payload: e,
|
|
3270
3270
|
callbackUrl: t,
|
|
3271
3271
|
title: n,
|
|
@@ -3283,7 +3283,7 @@ function Zi({
|
|
|
3283
3283
|
() => Tt(s),
|
|
3284
3284
|
[s]
|
|
3285
3285
|
), b = L(
|
|
3286
|
-
() =>
|
|
3286
|
+
() => _n(e, t, d),
|
|
3287
3287
|
[e, t, d]
|
|
3288
3288
|
), y = L(
|
|
3289
3289
|
() => ({
|
|
@@ -3296,15 +3296,15 @@ function Zi({
|
|
|
3296
3296
|
if (!l) {
|
|
3297
3297
|
c(!0);
|
|
3298
3298
|
try {
|
|
3299
|
-
const g =
|
|
3299
|
+
const g = Zi(e), k = Mt({
|
|
3300
3300
|
context: y,
|
|
3301
3301
|
payload: e,
|
|
3302
3302
|
answer: g
|
|
3303
|
-
}), p = await
|
|
3303
|
+
}), p = await In(k, {
|
|
3304
3304
|
headers: d
|
|
3305
3305
|
});
|
|
3306
3306
|
if (!m.current) return;
|
|
3307
|
-
const f =
|
|
3307
|
+
const f = Nn(p);
|
|
3308
3308
|
a == null || a(f.type, f.message);
|
|
3309
3309
|
} catch (g) {
|
|
3310
3310
|
if (!m.current) return;
|
|
@@ -3323,7 +3323,7 @@ function Zi({
|
|
|
3323
3323
|
o ? /* @__PURE__ */ u(ye, { title: o, children: /* @__PURE__ */ u(ve, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
|
|
3324
3324
|
] }),
|
|
3325
3325
|
/* @__PURE__ */ u(ye, { title: "提交到 answer_agent_callback_url", children: /* @__PURE__ */ u(
|
|
3326
|
-
|
|
3326
|
+
ze,
|
|
3327
3327
|
{
|
|
3328
3328
|
size: "small",
|
|
3329
3329
|
type: "text",
|
|
@@ -3337,8 +3337,8 @@ function Zi({
|
|
|
3337
3337
|
/* @__PURE__ */ u("pre", { className: "skopon-form-curl-json", children: b })
|
|
3338
3338
|
] });
|
|
3339
3339
|
}
|
|
3340
|
-
const
|
|
3341
|
-
function
|
|
3340
|
+
const ts = 80;
|
|
3341
|
+
function ns(e, t) {
|
|
3342
3342
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
3343
3343
|
const n = t.message;
|
|
3344
3344
|
if (typeof n == "string" && n.trim())
|
|
@@ -3346,7 +3346,7 @@ function ts(e, t) {
|
|
|
3346
3346
|
}
|
|
3347
3347
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
3348
3348
|
}
|
|
3349
|
-
function
|
|
3349
|
+
function rs({
|
|
3350
3350
|
payload: e,
|
|
3351
3351
|
formUniqueId: t,
|
|
3352
3352
|
askUserMessageId: n,
|
|
@@ -3363,7 +3363,7 @@ function ns({
|
|
|
3363
3363
|
}) {
|
|
3364
3364
|
const [y, S] = w(null), [g, k] = w(!1), [p, f] = w(!0), [v, x] = w(!1), N = A(null), _ = A(null), z = A(!0), C = A(l);
|
|
3365
3365
|
C.current = l;
|
|
3366
|
-
const B =
|
|
3366
|
+
const B = mn(), V = gt(), re = A(""), K = A(null), $ = (t == null ? void 0 : t.trim()) ?? "", W = (n == null ? void 0 : n.trim()) ?? "", ee = L(
|
|
3367
3367
|
() => Tt(s),
|
|
3368
3368
|
[s]
|
|
3369
3369
|
), te = L(
|
|
@@ -3376,100 +3376,100 @@ function ns({
|
|
|
3376
3376
|
q(() => (z.current = !0, () => {
|
|
3377
3377
|
z.current = !1, K.current != null && (clearTimeout(K.current), K.current = null);
|
|
3378
3378
|
}), []), q(() => {
|
|
3379
|
-
let
|
|
3379
|
+
let I = !1;
|
|
3380
3380
|
return $ ? (f(!0), k(!1), a({ formUniqueId: $ }).then((O) => {
|
|
3381
|
-
|
|
3381
|
+
I || (k(!!O.disabled), S(O.formDefinition ?? null));
|
|
3382
3382
|
}).catch((O) => {
|
|
3383
3383
|
var J;
|
|
3384
|
-
if (!
|
|
3384
|
+
if (!I) {
|
|
3385
3385
|
k(!1), S(null);
|
|
3386
|
-
const
|
|
3387
|
-
(J = C.current) == null || J.call(C, "error",
|
|
3386
|
+
const Ne = O instanceof Error ? O.message : "获取表单定义失败";
|
|
3387
|
+
(J = C.current) == null || J.call(C, "error", Ne);
|
|
3388
3388
|
}
|
|
3389
3389
|
}).finally(() => {
|
|
3390
|
-
|
|
3390
|
+
I || f(!1);
|
|
3391
3391
|
}), () => {
|
|
3392
|
-
|
|
3392
|
+
I = !0;
|
|
3393
3393
|
}) : (f(!1), k(!1), S(null), () => {
|
|
3394
|
-
|
|
3394
|
+
I = !0;
|
|
3395
3395
|
});
|
|
3396
3396
|
}, [$, a]);
|
|
3397
|
-
const E = L(() =>
|
|
3397
|
+
const E = L(() => Be(e), [e]), P = L(() => E ? Vo(E, y ?? void 0) : null, [E, y]), T = (P == null ? void 0 : P.matchedBlocks) ?? [], D = !!(E && Lo(E) && T.length === 0), U = L(() => D && E ? jo(E) : P && P.renderBlocks.length > 0 ? P.renderBlocks : [], [P, D, E]), F = L(() => {
|
|
3398
3398
|
if (D && E)
|
|
3399
|
-
return
|
|
3400
|
-
const
|
|
3401
|
-
return { ...
|
|
3399
|
+
return $o(E);
|
|
3400
|
+
const I = we((P == null ? void 0 : P.extraBlocks) ?? []);
|
|
3401
|
+
return { ...we(
|
|
3402
3402
|
((P == null ? void 0 : P.matchedBlocks) ?? []).filter(
|
|
3403
3403
|
(J) => J.type === "text" && J.hidden === !0
|
|
3404
3404
|
)
|
|
3405
|
-
), ...
|
|
3405
|
+
), ...I };
|
|
3406
3406
|
}, [D, E, P]), Y = L(
|
|
3407
|
-
() => U.filter((
|
|
3407
|
+
() => U.filter((I) => {
|
|
3408
3408
|
var O;
|
|
3409
|
-
return (O =
|
|
3410
|
-
}).map((
|
|
3409
|
+
return Z(I.type) && ((O = I.name) == null ? void 0 : O.trim());
|
|
3410
|
+
}).map((I) => I.name.trim()),
|
|
3411
3411
|
[U]
|
|
3412
|
-
), ce = (P == null ? void 0 : P.title) ?? (E == null ? void 0 : E.title) ?? "", ue = (P == null ? void 0 : P.description) ?? (E == null ? void 0 : E.description) ?? "", me = L(() => U.length === 0 ? null :
|
|
3412
|
+
), ce = (P == null ? void 0 : P.title) ?? (E == null ? void 0 : E.title) ?? "", ue = (P == null ? void 0 : P.description) ?? (E == null ? void 0 : E.description) ?? "", me = L(() => U.length === 0 ? null : Ro(
|
|
3413
3413
|
{ title: ce, description: ue },
|
|
3414
3414
|
U
|
|
3415
|
-
), [ce, ue, U]),
|
|
3415
|
+
), [ce, ue, U]), je = L(() => {
|
|
3416
3416
|
if (!me) return "";
|
|
3417
3417
|
try {
|
|
3418
3418
|
return JSON.stringify(me);
|
|
3419
3419
|
} catch {
|
|
3420
3420
|
return String(me);
|
|
3421
3421
|
}
|
|
3422
|
-
}, [me]),
|
|
3422
|
+
}, [me]), $e = $ ? `ask-user-${$}` : "ask-user-payload", oe = !!(!p && E && U.length > 0 && me);
|
|
3423
3423
|
q(() => (d(oe), () => d(!1)), [oe, d]);
|
|
3424
3424
|
const It = j(() => {
|
|
3425
3425
|
var O;
|
|
3426
|
-
return { ...((O = N.current) == null ? void 0 : O.getValues(Y)) ?? {}, ...
|
|
3427
|
-
}, [Y,
|
|
3426
|
+
return { ...((O = N.current) == null ? void 0 : O.getValues(Y)) ?? {}, ...F };
|
|
3427
|
+
}, [Y, F]), Ft = A(V.liveOptions);
|
|
3428
3428
|
Ft.current = V.liveOptions;
|
|
3429
|
-
const
|
|
3430
|
-
|
|
3429
|
+
const De = A(V.pendingChangeFields);
|
|
3430
|
+
De.current = V.pendingChangeFields;
|
|
3431
3431
|
const he = j(
|
|
3432
|
-
(
|
|
3433
|
-
const O =
|
|
3432
|
+
(I) => {
|
|
3433
|
+
const O = Xi({
|
|
3434
3434
|
title: ce,
|
|
3435
3435
|
description: ue,
|
|
3436
3436
|
blocks: U,
|
|
3437
3437
|
values: It(),
|
|
3438
3438
|
liveOptions: Ft.current,
|
|
3439
|
-
formChange:
|
|
3439
|
+
formChange: I
|
|
3440
3440
|
});
|
|
3441
3441
|
B.reportData(O);
|
|
3442
3442
|
},
|
|
3443
3443
|
[ce, ue, U, It, B]
|
|
3444
|
-
),
|
|
3445
|
-
|
|
3444
|
+
), He = A(he);
|
|
3445
|
+
He.current = he, q(() => {
|
|
3446
3446
|
if (!oe) {
|
|
3447
3447
|
re.current = "";
|
|
3448
3448
|
return;
|
|
3449
3449
|
}
|
|
3450
|
-
if (
|
|
3451
|
-
const
|
|
3452
|
-
if (re.current ===
|
|
3450
|
+
if (!je) return;
|
|
3451
|
+
const I = `${$e}::${je}`;
|
|
3452
|
+
if (re.current === I) return;
|
|
3453
3453
|
const O = setTimeout(() => {
|
|
3454
|
-
z.current && re.current !==
|
|
3454
|
+
z.current && re.current !== I && (re.current = I, He.current([]));
|
|
3455
3455
|
}, 0);
|
|
3456
3456
|
return () => clearTimeout(O);
|
|
3457
|
-
}, [oe,
|
|
3458
|
-
if (!(!oe || V.version === 0) &&
|
|
3457
|
+
}, [oe, $e, je]), q(() => {
|
|
3458
|
+
if (!(!oe || V.version === 0) && De.current.length !== 0)
|
|
3459
3459
|
return K.current != null && clearTimeout(K.current), K.current = setTimeout(() => {
|
|
3460
3460
|
if (K.current = null, !z.current) return;
|
|
3461
|
-
const
|
|
3462
|
-
V.clearPendingChangeFields(),
|
|
3463
|
-
},
|
|
3461
|
+
const I = [...De.current];
|
|
3462
|
+
V.clearPendingChangeFields(), I.length !== 0 && He.current(I);
|
|
3463
|
+
}, ts), () => {
|
|
3464
3464
|
K.current != null && (clearTimeout(K.current), K.current = null);
|
|
3465
3465
|
};
|
|
3466
3466
|
}, [oe, V.version, V.clearPendingChangeFields]);
|
|
3467
|
-
const
|
|
3468
|
-
var
|
|
3467
|
+
const Ke = j(async () => {
|
|
3468
|
+
var I, O, J, Ne, Rt, Pt, wt, zt;
|
|
3469
3469
|
if (!v) {
|
|
3470
3470
|
x(!0);
|
|
3471
3471
|
try {
|
|
3472
|
-
const ge = { ...((
|
|
3472
|
+
const ge = { ...((I = N.current) == null ? void 0 : I.getValues(Y)) ?? {}, ...F }, Ot = di(U, ge);
|
|
3473
3473
|
if (Ot) {
|
|
3474
3474
|
(O = C.current) == null || O.call(C, "error", Ot.message);
|
|
3475
3475
|
return;
|
|
@@ -3484,21 +3484,21 @@ function ns({
|
|
|
3484
3484
|
action: "submit",
|
|
3485
3485
|
component: "SubmitButton"
|
|
3486
3486
|
});
|
|
3487
|
-
const
|
|
3487
|
+
const Ge = await Tn(Lt, ge, {
|
|
3488
3488
|
headers: ee
|
|
3489
3489
|
});
|
|
3490
3490
|
if (!z.current) return;
|
|
3491
|
-
|
|
3491
|
+
Ge.ok ? (Ne = C.current) == null || Ne.call(C, "success", "提交成功") : (Rt = C.current) == null || Rt.call(C, "error", ns(Ge.status, Ge.body));
|
|
3492
3492
|
return;
|
|
3493
3493
|
}
|
|
3494
|
-
const
|
|
3494
|
+
const zn = U.length > 0 ? {
|
|
3495
3495
|
title: ce,
|
|
3496
3496
|
description: ue,
|
|
3497
3497
|
blocks: U
|
|
3498
3498
|
} : E ?? void 0, qt = Mt({
|
|
3499
3499
|
context: te,
|
|
3500
3500
|
payload: e,
|
|
3501
|
-
form:
|
|
3501
|
+
form: zn,
|
|
3502
3502
|
answer: ge
|
|
3503
3503
|
}), Bt = Nt(qt);
|
|
3504
3504
|
if (Bt) {
|
|
@@ -3509,15 +3509,15 @@ function ns({
|
|
|
3509
3509
|
action: "submit",
|
|
3510
3510
|
component: "SubmitButton"
|
|
3511
3511
|
});
|
|
3512
|
-
const
|
|
3512
|
+
const On = await In(qt, {
|
|
3513
3513
|
headers: ee
|
|
3514
3514
|
});
|
|
3515
3515
|
if (!z.current) return;
|
|
3516
|
-
const Vt =
|
|
3516
|
+
const Vt = Nn(On);
|
|
3517
3517
|
(wt = C.current) == null || wt.call(C, Vt.type, Vt.message);
|
|
3518
|
-
} catch (
|
|
3518
|
+
} catch (Je) {
|
|
3519
3519
|
if (!z.current) return;
|
|
3520
|
-
const ge =
|
|
3520
|
+
const ge = Je instanceof Error ? Je.message : "提交失败";
|
|
3521
3521
|
(zt = C.current) == null || zt.call(C, "error", ge);
|
|
3522
3522
|
} finally {
|
|
3523
3523
|
z.current && x(!1);
|
|
@@ -3529,7 +3529,7 @@ function ns({
|
|
|
3529
3529
|
U,
|
|
3530
3530
|
ce,
|
|
3531
3531
|
ue,
|
|
3532
|
-
|
|
3532
|
+
F,
|
|
3533
3533
|
he,
|
|
3534
3534
|
B,
|
|
3535
3535
|
o,
|
|
@@ -3538,12 +3538,12 @@ function ns({
|
|
|
3538
3538
|
te,
|
|
3539
3539
|
e,
|
|
3540
3540
|
E
|
|
3541
|
-
]), Et = A(
|
|
3542
|
-
Et.current =
|
|
3541
|
+
]), Et = A(Ke);
|
|
3542
|
+
Et.current = Ke;
|
|
3543
3543
|
const Ut = j(
|
|
3544
|
-
(
|
|
3545
|
-
|
|
3546
|
-
|
|
3544
|
+
(I) => {
|
|
3545
|
+
Wi(
|
|
3546
|
+
I,
|
|
3547
3547
|
{
|
|
3548
3548
|
setValues: (O) => {
|
|
3549
3549
|
var J;
|
|
@@ -3570,8 +3570,8 @@ function ns({
|
|
|
3570
3570
|
return;
|
|
3571
3571
|
}
|
|
3572
3572
|
return b(Ut), () => b(null);
|
|
3573
|
-
}, [oe, Ut, b]), p ? /* @__PURE__ */ u("div", { className: "ask-user-form-card", children: /* @__PURE__ */ u(
|
|
3574
|
-
|
|
3573
|
+
}, [oe, Ut, b]), p ? /* @__PURE__ */ u("div", { className: "ask-user-form-card", children: /* @__PURE__ */ u(dt, { size: "small" }) }) : !E || U.length === 0 ? /* @__PURE__ */ u(
|
|
3574
|
+
es,
|
|
3575
3575
|
{
|
|
3576
3576
|
payload: e,
|
|
3577
3577
|
callbackUrl: r,
|
|
@@ -3589,11 +3589,11 @@ function ns({
|
|
|
3589
3589
|
children: [
|
|
3590
3590
|
g && $ ? /* @__PURE__ */ u("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ u(ye, { title: $, children: /* @__PURE__ */ u(ve, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
|
|
3591
3591
|
/* @__PURE__ */ u(
|
|
3592
|
-
|
|
3592
|
+
Vi,
|
|
3593
3593
|
{
|
|
3594
3594
|
ref: N,
|
|
3595
3595
|
doc: me,
|
|
3596
|
-
surfaceId:
|
|
3596
|
+
surfaceId: $e,
|
|
3597
3597
|
fieldNames: Y,
|
|
3598
3598
|
interactive: !0,
|
|
3599
3599
|
wrapProvider: !1,
|
|
@@ -3606,13 +3606,13 @@ function ns({
|
|
|
3606
3606
|
{
|
|
3607
3607
|
title: o === "post" ? "提交 JSON 到 callback_url" : "提交到 answer_agent_callback_url",
|
|
3608
3608
|
children: /* @__PURE__ */ u(
|
|
3609
|
-
|
|
3609
|
+
ze,
|
|
3610
3610
|
{
|
|
3611
3611
|
type: "primary",
|
|
3612
3612
|
size: "small",
|
|
3613
3613
|
loading: v,
|
|
3614
3614
|
disabled: v,
|
|
3615
|
-
onClick: () => void
|
|
3615
|
+
onClick: () => void Ke(),
|
|
3616
3616
|
children: "提交"
|
|
3617
3617
|
}
|
|
3618
3618
|
)
|
|
@@ -3624,14 +3624,14 @@ function ns({
|
|
|
3624
3624
|
}
|
|
3625
3625
|
function Ts(e) {
|
|
3626
3626
|
var c;
|
|
3627
|
-
const t = ((c = e.askUserMessageId) == null ? void 0 : c.trim()) ?? "", n = L(() =>
|
|
3627
|
+
const t = ((c = e.askUserMessageId) == null ? void 0 : c.trim()) ?? "", n = L(() => Xo(), []), [r, o] = w(!1), i = A(null), s = j((m) => {
|
|
3628
3628
|
o(m);
|
|
3629
3629
|
}, []), a = j(
|
|
3630
3630
|
(m) => {
|
|
3631
3631
|
i.current = m;
|
|
3632
3632
|
},
|
|
3633
3633
|
[]
|
|
3634
|
-
), l = L(() => !n || !t ? null : new
|
|
3634
|
+
), l = L(() => !n || !t ? null : new Ki({
|
|
3635
3635
|
url: n,
|
|
3636
3636
|
askUserMessageId: t,
|
|
3637
3637
|
onAutoControl: (m) => {
|
|
@@ -3646,8 +3646,8 @@ function Ts(e) {
|
|
|
3646
3646
|
};
|
|
3647
3647
|
}, [l]), q(() => {
|
|
3648
3648
|
!l || !r || l.connect();
|
|
3649
|
-
}, [l, r]), /* @__PURE__ */ u(ke, { children: /* @__PURE__ */ u(
|
|
3650
|
-
|
|
3649
|
+
}, [l, r]), /* @__PURE__ */ u(ke, { children: /* @__PURE__ */ u(Kr, { client: l, children: /* @__PURE__ */ u(jr, { children: /* @__PURE__ */ u(
|
|
3650
|
+
rs,
|
|
3651
3651
|
{
|
|
3652
3652
|
...e,
|
|
3653
3653
|
onSurfaceReadyChange: s,
|
|
@@ -3656,71 +3656,71 @@ function Ts(e) {
|
|
|
3656
3656
|
) }) }) });
|
|
3657
3657
|
}
|
|
3658
3658
|
export {
|
|
3659
|
-
|
|
3659
|
+
hs as A2UI_PROTOCOL_VERSION,
|
|
3660
3660
|
Ts as AskUserFormCard,
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3661
|
+
at as CaseSearchProvider,
|
|
3662
|
+
es as CurlSubmitBlock,
|
|
3663
|
+
Wo as DEFAULT_ANSWER_AGENT_CALLBACK_URL,
|
|
3664
|
+
Jo as DEFAULT_AUTH_ANSWER_AGENT_CALLBACK_URL_FIELD,
|
|
3665
|
+
Go as DEFAULT_AUTH_REALTIME_WS_URL_FIELD,
|
|
3666
3666
|
Ct as DEFAULT_AUTH_STORAGE_KEY,
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3667
|
+
Ko as DEFAULT_AUTH_TOKEN_FIELD,
|
|
3668
|
+
or as FORM_MEDIA_SIZES,
|
|
3669
|
+
lt as ResumeSearchProvider,
|
|
3670
3670
|
_s as SkoponA2uiStreamRenderer,
|
|
3671
3671
|
ke as SkoponFormProvider,
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3672
|
+
Vi as SkoponFormRenderer,
|
|
3673
|
+
Fo as a2uiToBlocks,
|
|
3674
|
+
bn as blocksToA2ui,
|
|
3675
|
+
zr as blocksToJsonSchema,
|
|
3676
3676
|
Mt as buildAnswerAgentBody,
|
|
3677
|
-
|
|
3678
|
-
|
|
3677
|
+
Do as buildAskUserCurlBodyJson,
|
|
3678
|
+
Ho as buildAskUserCurlStatement,
|
|
3679
3679
|
Ss as buildAskUserSubmitCurlFromPayload,
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3680
|
+
Ro as buildAskUserSurface,
|
|
3681
|
+
_n as buildCurlStatement,
|
|
3682
|
+
xe as coerceToggleValue,
|
|
3683
3683
|
ks as copyTextToClipboard,
|
|
3684
|
-
|
|
3684
|
+
ui as createCaseSearchClient,
|
|
3685
3685
|
vs as createEmptyBlock,
|
|
3686
3686
|
ys as createEmptyFormDefinition,
|
|
3687
|
-
|
|
3688
|
-
|
|
3687
|
+
Zo as createFormClient,
|
|
3688
|
+
si as createResumeSearchClient,
|
|
3689
3689
|
As as createSkoponSdkClients,
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3690
|
+
we as extractExtraBlockValues,
|
|
3691
|
+
wo as extractSurfaceValues,
|
|
3692
|
+
Nn as formatAnswerAgentSubmitMessage,
|
|
3693
|
+
$o as getPayloadHiddenBlockValues,
|
|
3694
3694
|
bs as getPayloadInputFieldNames,
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3695
|
+
jo as getPayloadRenderableBlocks,
|
|
3696
|
+
Vo as intersectPayloadBlocksWithForm,
|
|
3697
|
+
mt as isA2uiSurfaceEmpty,
|
|
3698
|
+
rn as isDisplayBlockType,
|
|
3699
3699
|
Z as isInputBlockType,
|
|
3700
|
-
|
|
3700
|
+
ft as isLayoutBlockType,
|
|
3701
3701
|
pe as isMediaBlockType,
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3702
|
+
ir as isOptionsBlockType,
|
|
3703
|
+
Po as mapFormDefinitionFromDto,
|
|
3704
|
+
Oe as normalizeFormDefinition,
|
|
3705
3705
|
de as normalizeMultiselectCount,
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3706
|
+
Be as parsePayloadBlocksJson,
|
|
3707
|
+
Lo as payloadHasInputBlocks,
|
|
3708
|
+
Qo as resolveAnswerAgentCallbackUrl,
|
|
3709
3709
|
xt as resolveClientHeaders,
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3710
|
+
Xo as resolveRealtimeWsUrl,
|
|
3711
|
+
Pr as resolveSchemaDefaultValue,
|
|
3712
|
+
xn as resolveSkoponAuthHeaders,
|
|
3713
3713
|
Tt as resolveSubmitAuthHeaders,
|
|
3714
|
-
|
|
3715
|
-
|
|
3714
|
+
Uo as resolveSurfaceFromFormDefinition,
|
|
3715
|
+
Bi as skoponAntdTheme,
|
|
3716
3716
|
ie as skoponBrandColors,
|
|
3717
|
-
|
|
3718
|
-
|
|
3717
|
+
In as submitAnswerAgent,
|
|
3718
|
+
Tn as submitFormJson,
|
|
3719
3719
|
gs as supportsDefaultValue,
|
|
3720
|
-
|
|
3720
|
+
Eo as surfaceDocToMessages,
|
|
3721
3721
|
be as syncFormDefinition,
|
|
3722
|
-
|
|
3723
|
-
|
|
3722
|
+
Wr as useCaseSearch,
|
|
3723
|
+
io as useResumeSearch,
|
|
3724
3724
|
Nt as validateAnswerAgentBody,
|
|
3725
3725
|
Cs as validateAnswerAgentContext
|
|
3726
3726
|
};
|