@skopon-cool/form-sdk 0.4.6 → 0.4.7
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/adapter/a2uiAdapter.d.ts.map +1 -1
- package/dist/components/AskUserFormCard.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +879 -849
- package/dist/submit/intersectPayloadBlocksWithForm.d.ts +4 -2
- package/dist/submit/intersectPayloadBlocksWithForm.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapter/a2uiAdapter.test.ts +25 -0
- package/src/adapter/a2uiAdapter.ts +16 -1
- package/src/components/AskUserFormCard.tsx +25 -13
- package/src/index.ts +1 -0
- package/src/submit/intersectPayloadBlocksWithForm.ts +27 -4
- package/src/submit/submit.test.ts +54 -0
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import './form-sdk.css';
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
2
|
+
var zn = Object.defineProperty;
|
|
3
|
+
var On = (e, t, n) => t in e ? zn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var G = (e, t, n) => On(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
|
|
7
|
-
import { Spin as
|
|
8
|
-
import { ReloadOutlined as
|
|
9
|
-
import { createBinderlessComponentImplementation as
|
|
6
|
+
import { useRef as A, useState as P, useCallback as j, useMemo as L, createContext as Se, useContext as ke, useEffect as q, useSyncExternalStore as qn, forwardRef as Bn, useImperativeHandle as Vn } from "react";
|
|
7
|
+
import { Spin as ft, Button as Oe, Typography as ne, Avatar as Ln, Tag as ge, Select as st, Checkbox as jn, Radio as $n, Switch as Dn, TimePicker as Hn, DatePicker as Kn, Upload as Ye, Input as Qe, InputNumber as Jn, ConfigProvider as Gn, Tooltip as he } from "antd";
|
|
8
|
+
import { ReloadOutlined as Yt, FileTextOutlined as Qt, UserOutlined as Wn, FileImageOutlined as Yn, FileExcelOutlined as Qn, FileOutlined as Xt, PictureOutlined as Xn, SoundOutlined as Zn, VideoCameraOutlined as er } from "@ant-design/icons";
|
|
9
|
+
import { createBinderlessComponentImplementation as X, basicCatalog as Ue, A2uiSurface as Zt } from "@a2ui/react/v0_9";
|
|
10
10
|
import { z as h } from "zod";
|
|
11
|
-
import { Catalog as
|
|
12
|
-
import { injectBasicCatalogStyles as
|
|
13
|
-
import { injectStyles as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
11
|
+
import { Catalog as tr, MessageProcessor as en } from "@a2ui/web_core/v0_9";
|
|
12
|
+
import { injectBasicCatalogStyles as tn } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
13
|
+
import { injectStyles as nn } from "@a2ui/react/styles";
|
|
14
|
+
import jt from "dayjs";
|
|
15
|
+
const ds = "v0.9", nr = [
|
|
16
16
|
"huge",
|
|
17
17
|
"large",
|
|
18
18
|
"medium",
|
|
@@ -28,16 +28,16 @@ function Ce(e) {
|
|
|
28
28
|
function Z(e) {
|
|
29
29
|
return !Ce(e) && !de(e);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function fs(e) {
|
|
32
32
|
return Ce(e) || de(e);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function rr(e) {
|
|
35
35
|
return e === "select" || e === "multiselect" || e === "radio" || e === "checkbox";
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function ps(e) {
|
|
38
38
|
return Z(e) && e !== "file" && e !== "resume_multiselect" && e !== "case_multiselect";
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function or() {
|
|
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 tr() {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
function le(e) {
|
|
55
|
-
const t =
|
|
55
|
+
const t = or().replace(/-/g, "").slice(0, 8);
|
|
56
56
|
return `${e}${t}`;
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const rn = [
|
|
59
59
|
{ value: "image/*", label: "图片" },
|
|
60
60
|
{ value: "video/*", label: "视频" },
|
|
61
61
|
{ value: "audio/*", label: "音频" },
|
|
@@ -66,7 +66,7 @@ const tn = [
|
|
|
66
66
|
{ value: "text/plain", label: "纯文本" },
|
|
67
67
|
{ value: "application/zip", label: "ZIP 压缩包" },
|
|
68
68
|
{ value: "application/x-rar-compressed", label: "RAR 压缩包" }
|
|
69
|
-
],
|
|
69
|
+
], ir = {
|
|
70
70
|
"image/*": ["image/*"],
|
|
71
71
|
"video/*": ["video/*"],
|
|
72
72
|
"audio/*": ["audio/*"],
|
|
@@ -86,7 +86,7 @@ const tn = [
|
|
|
86
86
|
"text/plain": ["text/plain"],
|
|
87
87
|
"application/zip": ["application/zip"],
|
|
88
88
|
"application/x-rar-compressed": ["application/x-rar-compressed"]
|
|
89
|
-
},
|
|
89
|
+
}, sr = {
|
|
90
90
|
"image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
|
|
91
91
|
"video/*": [".mp4", ".mov", ".avi", ".webm"],
|
|
92
92
|
"audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
|
|
@@ -97,14 +97,14 @@ const tn = [
|
|
|
97
97
|
"text/plain": [".txt"],
|
|
98
98
|
"application/zip": [".zip", ".7z"],
|
|
99
99
|
"application/x-rar-compressed": [".rar"]
|
|
100
|
-
},
|
|
100
|
+
}, ar = {
|
|
101
101
|
"application/msword": "office/word",
|
|
102
102
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
|
|
103
103
|
"application/vnd.ms-excel": "office/excel",
|
|
104
104
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
|
|
105
105
|
"application/vnd.ms-powerpoint": "office/ppt",
|
|
106
106
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
|
|
107
|
-
},
|
|
107
|
+
}, pt = [
|
|
108
108
|
{ value: ".jpg", label: ".jpg" },
|
|
109
109
|
{ value: ".jpeg", label: ".jpeg" },
|
|
110
110
|
{ value: ".png", label: ".png" },
|
|
@@ -130,18 +130,18 @@ const tn = [
|
|
|
130
130
|
{ value: ".zip", label: ".zip" },
|
|
131
131
|
{ value: ".rar", label: ".rar" },
|
|
132
132
|
{ value: ".7z", label: ".7z" }
|
|
133
|
-
],
|
|
134
|
-
|
|
135
|
-
),
|
|
136
|
-
|
|
137
|
-
),
|
|
138
|
-
|
|
133
|
+
], lr = Object.fromEntries(
|
|
134
|
+
rn.map((e) => [e.value, e.label])
|
|
135
|
+
), cr = Object.fromEntries(
|
|
136
|
+
pt.map((e) => [e.value, e.label])
|
|
137
|
+
), ur = new Set(rn.map((e) => e.value)), mr = new Set(
|
|
138
|
+
pt.map((e) => e.value)
|
|
139
139
|
);
|
|
140
|
-
function
|
|
140
|
+
function dr(e) {
|
|
141
141
|
const t = e.trim();
|
|
142
|
-
return t ?
|
|
142
|
+
return t ? ur.has(t) ? t : ar[t] ?? null : null;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function fr(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}` : "";
|
|
@@ -151,87 +151,87 @@ function Ae(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 = dr(r);
|
|
155
155
|
o && !n.has(o) && (n.add(o), t.push(o));
|
|
156
156
|
}
|
|
157
157
|
return t;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function pr(e) {
|
|
160
160
|
const t = Ae(e), n = [];
|
|
161
161
|
for (const r of t)
|
|
162
|
-
n.push(...
|
|
162
|
+
n.push(...ir[r] ?? [r]);
|
|
163
163
|
return n;
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function hr(e) {
|
|
166
166
|
const t = Ae(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 sr[r] ?? [])
|
|
171
171
|
n.add(o);
|
|
172
|
-
return
|
|
172
|
+
return pt.filter((r) => n.has(r.value));
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
const n =
|
|
174
|
+
function ht(e, t) {
|
|
175
|
+
const n = fr(t), r = Ae(e);
|
|
176
176
|
if (r.length === 0)
|
|
177
|
-
return n.filter((i) =>
|
|
177
|
+
return n.filter((i) => mr.has(i));
|
|
178
178
|
const o = new Set(
|
|
179
|
-
|
|
179
|
+
hr(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 gr(e, t) {
|
|
184
|
+
const n = pr(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 = Ae(e), r =
|
|
187
|
+
function yr(e, t) {
|
|
188
|
+
const n = Ae(e), r = ht(
|
|
189
189
|
n,
|
|
190
190
|
t
|
|
191
191
|
), o = [
|
|
192
|
-
...n.map((i) =>
|
|
193
|
-
...r.map((i) =>
|
|
192
|
+
...n.map((i) => lr[i] ?? i),
|
|
193
|
+
...r.map((i) => cr[i] ?? i)
|
|
194
194
|
];
|
|
195
195
|
return o.length === 0 ? null : o.join("、");
|
|
196
196
|
}
|
|
197
|
-
const
|
|
197
|
+
const vr = [
|
|
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
|
+
], br = new Set(vr);
|
|
205
|
+
function Sr(e) {
|
|
206
|
+
return e && br.has(e) ? e : "file";
|
|
207
207
|
}
|
|
208
208
|
function _e(e) {
|
|
209
|
-
return typeof e == "string" &&
|
|
209
|
+
return typeof e == "string" && nr.includes(e) ? e : "medium";
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function kr(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 Cr(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
|
|
221
|
+
function Ar(e) {
|
|
222
222
|
return `form-media-size-${_e(e)}`;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
return `form-media-preview form-media-list ${
|
|
224
|
+
function _r(e) {
|
|
225
|
+
return `form-media-preview form-media-list ${Ar(e)}`;
|
|
226
226
|
}
|
|
227
|
-
const
|
|
228
|
-
function
|
|
227
|
+
const Tr = 10;
|
|
228
|
+
function on(e) {
|
|
229
229
|
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
230
230
|
}
|
|
231
231
|
function Te(e) {
|
|
232
232
|
return e === !0 || e === "true" || e === 1 || e === "1";
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function Re(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 ue(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
|
|
242
|
+
function sn(e, t) {
|
|
243
243
|
return t == null ? void 0 : e === "toggle" ? Te(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 xr(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 Ar(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 Mr(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 = xr(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 Nr(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 Tr(e) {
|
|
|
266
266
|
pageSize: n
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function Ir(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 Fr(e) {
|
|
275
275
|
var o, i, s, a;
|
|
276
|
-
const t =
|
|
276
|
+
const t = Ir(e), n = Ae(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 Mr(e) {
|
|
|
282
282
|
placeholder: t.placeholder ?? "",
|
|
283
283
|
help: t.help ?? "",
|
|
284
284
|
required: t.required === !0,
|
|
285
|
-
mediaUrls: de(r) ?
|
|
285
|
+
mediaUrls: de(r) ? kr(t, Tr) : void 0,
|
|
286
286
|
mediaSize: de(r) ? _e(t.mediaSize) : void 0,
|
|
287
287
|
fileAcceptTypes: n,
|
|
288
|
-
fileAcceptExtensions:
|
|
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: Sr(t.filePlaceholderIcon),
|
|
293
|
+
fileMinCount: r === "file" ? Re(t.fileMinCount, 1) : void 0,
|
|
294
|
+
fileMaxCount: r === "file" ? Re(t.fileMaxCount, 1) : void 0,
|
|
295
|
+
defaultValue: sn(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,27 +311,27 @@ function Mr(e) {
|
|
|
311
311
|
resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
|
|
312
312
|
resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? ue(t.resumeMinCount, 1) : void 0,
|
|
313
313
|
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? ue(t.resumeMaxCount, 1) : void 0,
|
|
314
|
-
resumeFilter: r === "resume_multiselect" ?
|
|
314
|
+
resumeFilter: r === "resume_multiselect" ? Nr(t.resumeFilter) : void 0,
|
|
315
315
|
caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
|
|
316
316
|
caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? ue(t.caseMinCount, 1) : void 0,
|
|
317
317
|
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? ue(t.caseMaxCount, 1) : void 0,
|
|
318
|
-
caseFilter: r === "case_multiselect" ?
|
|
318
|
+
caseFilter: r === "case_multiselect" ? Mr(t.caseFilter) : void 0
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Er(e) {
|
|
322
322
|
return new Set((e.options ?? []).map((t) => t.value));
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function $t(e, t) {
|
|
325
325
|
const n = {
|
|
326
326
|
type: "array",
|
|
327
327
|
items: { type: "string" }
|
|
328
328
|
};
|
|
329
329
|
return e !== void 0 && (n.minItems = ue(e, 1)), t !== void 0 && (n.maxItems = ue(t, 1)), n;
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
const t =
|
|
331
|
+
function Ur(e) {
|
|
332
|
+
const t = sn(e.type, e.defaultValue);
|
|
333
333
|
if (t === void 0) return;
|
|
334
|
-
const n =
|
|
334
|
+
const n = Er(e);
|
|
335
335
|
switch (e.type) {
|
|
336
336
|
case "toggle":
|
|
337
337
|
return t;
|
|
@@ -358,7 +358,7 @@ function Ir(e) {
|
|
|
358
358
|
return t;
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function Rr(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 Fr(e) {
|
|
|
386
386
|
break;
|
|
387
387
|
}
|
|
388
388
|
case "file": {
|
|
389
|
-
const a =
|
|
389
|
+
const a = Re(e.fileMinCount, 1), l = Re(e.fileMaxCount, 1);
|
|
390
390
|
l <= 1 ? n = { type: "string" } : n = {
|
|
391
391
|
type: "array",
|
|
392
392
|
items: { type: "string" },
|
|
@@ -396,10 +396,10 @@ function Fr(e) {
|
|
|
396
396
|
break;
|
|
397
397
|
}
|
|
398
398
|
case "resume_multiselect":
|
|
399
|
-
n =
|
|
399
|
+
n = $t(e.resumeMinCount, e.resumeMaxCount);
|
|
400
400
|
break;
|
|
401
401
|
case "case_multiselect":
|
|
402
|
-
n =
|
|
402
|
+
n = $t(e.caseMinCount, e.caseMaxCount);
|
|
403
403
|
break;
|
|
404
404
|
case "text":
|
|
405
405
|
n = { type: "string" }, e.hidden && (n["x-hidden"] = !0);
|
|
@@ -410,16 +410,16 @@ function Fr(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 = Ur(e);
|
|
414
414
|
return o !== void 0 && (n.default = o), n;
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function Pr(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 = Rr(c);
|
|
423
423
|
d && (r[m] = d, c.required && o.push(m));
|
|
424
424
|
}
|
|
425
425
|
const i = {
|
|
@@ -436,29 +436,29 @@ function ye(e) {
|
|
|
436
436
|
title: t,
|
|
437
437
|
description: n,
|
|
438
438
|
blocks: e.blocks,
|
|
439
|
-
jsonSchema:
|
|
439
|
+
jsonSchema: Pr(e.blocks, t, n)
|
|
440
440
|
};
|
|
441
441
|
}
|
|
442
442
|
function qe(e) {
|
|
443
443
|
if (!e || !Array.isArray(e.blocks))
|
|
444
444
|
return ye({ title: "", description: "", blocks: [] });
|
|
445
|
-
const t = e.blocks.map(
|
|
445
|
+
const t = e.blocks.map(Fr);
|
|
446
446
|
return ye({
|
|
447
447
|
title: typeof e.title == "string" ? e.title : "",
|
|
448
448
|
description: typeof e.description == "string" ? e.description : "",
|
|
449
449
|
blocks: t
|
|
450
450
|
});
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function hs() {
|
|
453
453
|
return ye({ title: "", description: "", blocks: [] });
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function gs(e) {
|
|
456
456
|
const t = {
|
|
457
457
|
id: le("block-"),
|
|
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), de(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), de(e) && (t.label = "", t.placeholder = "", t.help = "", t.mediaUrls = [""], t.mediaSize = "medium"), rr(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 hs(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 wr(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,
|
|
@@ -479,13 +479,13 @@ function Ur(e) {
|
|
|
479
479
|
pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
|
|
480
480
|
};
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function Dt(e) {
|
|
483
483
|
if (e == null) return;
|
|
484
484
|
const t = typeof e == "number" ? e : Number(e);
|
|
485
485
|
if (!(!Number.isFinite(t) || t < 1))
|
|
486
486
|
return Math.floor(t);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function zr(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 Rr(e, t) {
|
|
|
508
508
|
value: { path: o }
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function Or(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 Pr(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 =
|
|
520
|
-
const a =
|
|
519
|
+
s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = wr(e.caseFilter));
|
|
520
|
+
const a = Dt(e.minCount);
|
|
521
521
|
a !== void 0 && (o.caseMinCount = a);
|
|
522
|
-
const l =
|
|
522
|
+
const l = Dt(e.maxCount);
|
|
523
523
|
return l !== void 0 && (o.caseMaxCount = l), o;
|
|
524
524
|
}
|
|
525
|
-
const
|
|
525
|
+
const an = Se(
|
|
526
526
|
null
|
|
527
527
|
);
|
|
528
|
-
function
|
|
528
|
+
function qr(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 Br = {
|
|
536
536
|
publishLiveOptions: () => {
|
|
537
537
|
},
|
|
538
538
|
liveOptions: /* @__PURE__ */ new Map(),
|
|
@@ -541,23 +541,23 @@ const zr = {
|
|
|
541
541
|
clearPendingChangeFields: () => {
|
|
542
542
|
}
|
|
543
543
|
};
|
|
544
|
-
function
|
|
545
|
-
const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] =
|
|
544
|
+
function Vr({ children: e }) {
|
|
545
|
+
const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] = P(0), [s, a] = P(() => /* @__PURE__ */ new Map()), [l, c] = P(
|
|
546
546
|
[]
|
|
547
|
-
), m =
|
|
547
|
+
), m = j(
|
|
548
548
|
(g, S) => {
|
|
549
549
|
const y = g.trim();
|
|
550
550
|
if (!y) return;
|
|
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 = qr(k);
|
|
555
555
|
n.current.get(y) !== p && (n.current.set(y, p), t.current.set(y, k), r.current.includes(y) || (r.current = [...r.current, y]), a(new Map(t.current)), c(r.current), i((f) => f + 1));
|
|
556
556
|
},
|
|
557
557
|
[]
|
|
558
|
-
), d =
|
|
558
|
+
), d = j(() => {
|
|
559
559
|
r.current = [], c([]);
|
|
560
|
-
}, []), b =
|
|
560
|
+
}, []), b = L(
|
|
561
561
|
() => ({
|
|
562
562
|
publishLiveOptions: m,
|
|
563
563
|
liveOptions: s,
|
|
@@ -573,26 +573,26 @@ function Or({ children: e }) {
|
|
|
573
573
|
d
|
|
574
574
|
]
|
|
575
575
|
);
|
|
576
|
-
return /* @__PURE__ */ u(
|
|
576
|
+
return /* @__PURE__ */ u(an.Provider, { value: b, children: e });
|
|
577
577
|
}
|
|
578
|
-
function
|
|
579
|
-
return ke(
|
|
578
|
+
function gt() {
|
|
579
|
+
return ke(an) ?? Br;
|
|
580
580
|
}
|
|
581
|
-
const
|
|
582
|
-
function
|
|
581
|
+
const ln = Se({ interactive: !0 });
|
|
582
|
+
function at({
|
|
583
583
|
interactive: e,
|
|
584
584
|
children: t
|
|
585
585
|
}) {
|
|
586
|
-
return /* @__PURE__ */ u(
|
|
586
|
+
return /* @__PURE__ */ u(ln.Provider, { value: { interactive: e }, children: t });
|
|
587
587
|
}
|
|
588
588
|
function se() {
|
|
589
|
-
return ke(
|
|
589
|
+
return ke(ln);
|
|
590
590
|
}
|
|
591
|
-
const
|
|
592
|
-
function
|
|
591
|
+
const cn = Se(null);
|
|
592
|
+
function Lr(e) {
|
|
593
593
|
return e != null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
594
594
|
}
|
|
595
|
-
const
|
|
595
|
+
const jr = {
|
|
596
596
|
reportEvent: () => {
|
|
597
597
|
},
|
|
598
598
|
reportData: () => {
|
|
@@ -600,7 +600,7 @@ const Br = {
|
|
|
600
600
|
runAutoControl: (e) => e(),
|
|
601
601
|
isAutoControl: () => !1
|
|
602
602
|
};
|
|
603
|
-
function
|
|
603
|
+
function $r(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,13 +610,13 @@ function Lr(e) {
|
|
|
610
610
|
form_change: Array.isArray(e.form_change) ? [...e.form_change] : []
|
|
611
611
|
};
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function Dr({
|
|
614
614
|
client: e,
|
|
615
615
|
children: t
|
|
616
616
|
}) {
|
|
617
617
|
const n = A(0), r = A(e);
|
|
618
618
|
r.current = e;
|
|
619
|
-
const o =
|
|
619
|
+
const o = j((c) => {
|
|
620
620
|
const m = r.current;
|
|
621
621
|
if (!m) return;
|
|
622
622
|
const d = {
|
|
@@ -626,10 +626,10 @@ function Vr({
|
|
|
626
626
|
c.field !== void 0 && (d.field = c.field), c.value !== void 0 && (d.value = c.value);
|
|
627
627
|
const b = n.current > 0 ? "form_auto_control_bac_event" : "form_runtime_event";
|
|
628
628
|
m.send(b, d);
|
|
629
|
-
}, []), i =
|
|
629
|
+
}, []), i = j((c) => {
|
|
630
630
|
const m = r.current;
|
|
631
|
-
m && m.send("form_runtime_data",
|
|
632
|
-
}, []), s =
|
|
631
|
+
m && m.send("form_runtime_data", $r(c));
|
|
632
|
+
}, []), s = j((c) => {
|
|
633
633
|
n.current += 1;
|
|
634
634
|
let m;
|
|
635
635
|
try {
|
|
@@ -637,13 +637,13 @@ function Vr({
|
|
|
637
637
|
} catch (d) {
|
|
638
638
|
throw n.current = Math.max(0, n.current - 1), d;
|
|
639
639
|
}
|
|
640
|
-
return
|
|
640
|
+
return Lr(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
|
-
}, []), a =
|
|
643
|
+
}, []), a = j(
|
|
644
644
|
() => n.current > 0,
|
|
645
645
|
[]
|
|
646
|
-
), l =
|
|
646
|
+
), l = L(
|
|
647
647
|
() => ({
|
|
648
648
|
reportEvent: o,
|
|
649
649
|
reportData: i,
|
|
@@ -652,28 +652,28 @@ function Vr({
|
|
|
652
652
|
}),
|
|
653
653
|
[o, i, s, a]
|
|
654
654
|
);
|
|
655
|
-
return /* @__PURE__ */ u(
|
|
655
|
+
return /* @__PURE__ */ u(cn.Provider, { value: l, children: t });
|
|
656
656
|
}
|
|
657
|
-
function
|
|
658
|
-
return ke(
|
|
657
|
+
function un() {
|
|
658
|
+
return ke(cn) ?? jr;
|
|
659
659
|
}
|
|
660
|
-
const
|
|
661
|
-
function
|
|
660
|
+
const Hr = 300;
|
|
661
|
+
function mn(e) {
|
|
662
662
|
return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function Kr(e) {
|
|
665
665
|
if (!e) return;
|
|
666
666
|
const t = e.trim();
|
|
667
667
|
if (t)
|
|
668
668
|
return t.startsWith("/") ? t.slice(1) : t;
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function Ht(e, t = "value") {
|
|
671
671
|
const r = e.componentModel.properties[t];
|
|
672
|
-
if (!(!
|
|
672
|
+
if (!(!mn(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 = mn(o), s = Kr(i), a = un(), {
|
|
677
677
|
component: l = "Unknown",
|
|
678
678
|
changeAction: c = "change",
|
|
679
679
|
debounceChange: m = !1
|
|
@@ -684,7 +684,7 @@ function ae(e, t = "value", n = {}) {
|
|
|
684
684
|
const k = A(l);
|
|
685
685
|
k.current = l;
|
|
686
686
|
const p = A(s);
|
|
687
|
-
p.current = s,
|
|
687
|
+
p.current = s, q(() => () => {
|
|
688
688
|
d.current != null && (clearTimeout(d.current), d.current = null), g.current && p.current && (g.current = !1, S.current.reportEvent({
|
|
689
689
|
action: y.current,
|
|
690
690
|
component: k.current,
|
|
@@ -692,48 +692,48 @@ function ae(e, t = "value", n = {}) {
|
|
|
692
692
|
value: b.current
|
|
693
693
|
}));
|
|
694
694
|
}, []);
|
|
695
|
-
const f =
|
|
696
|
-
(
|
|
695
|
+
const f = j(
|
|
696
|
+
(B) => {
|
|
697
697
|
if (!i || o === void 0) return () => {
|
|
698
698
|
};
|
|
699
|
-
const
|
|
700
|
-
return () =>
|
|
699
|
+
const V = e.dataContext.subscribeDynamicValue(o, () => B());
|
|
700
|
+
return () => V.unsubscribe();
|
|
701
701
|
},
|
|
702
702
|
[e, o, i]
|
|
703
|
-
), v =
|
|
703
|
+
), v = j(() => {
|
|
704
704
|
if (!(!i || o === void 0))
|
|
705
705
|
return e.dataContext.resolveDynamicValue(o);
|
|
706
|
-
}, [e, o, i]), x =
|
|
707
|
-
(
|
|
706
|
+
}, [e, o, i]), x = qn(f, v, v), N = j(
|
|
707
|
+
(B) => {
|
|
708
708
|
if (!s) return;
|
|
709
|
-
const
|
|
709
|
+
const V = () => {
|
|
710
710
|
g.current = !1, S.current.reportEvent({
|
|
711
711
|
action: c,
|
|
712
712
|
component: l,
|
|
713
713
|
field: s,
|
|
714
|
-
value:
|
|
714
|
+
value: B
|
|
715
715
|
});
|
|
716
716
|
};
|
|
717
717
|
if (!m) {
|
|
718
|
-
|
|
718
|
+
V();
|
|
719
719
|
return;
|
|
720
720
|
}
|
|
721
|
-
b.current =
|
|
722
|
-
d.current = null,
|
|
723
|
-
},
|
|
721
|
+
b.current = B, g.current = !0, d.current != null && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
722
|
+
d.current = null, V();
|
|
723
|
+
}, Hr);
|
|
724
724
|
},
|
|
725
725
|
[s, c, l, m]
|
|
726
|
-
), _ =
|
|
727
|
-
(
|
|
728
|
-
!i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path),
|
|
726
|
+
), _ = j(
|
|
727
|
+
(B) => {
|
|
728
|
+
!i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path), B);
|
|
729
729
|
},
|
|
730
730
|
[e, o, i]
|
|
731
|
-
),
|
|
732
|
-
(
|
|
733
|
-
_(
|
|
731
|
+
), w = j(
|
|
732
|
+
(B) => {
|
|
733
|
+
_(B), N(B);
|
|
734
734
|
},
|
|
735
735
|
[_, N]
|
|
736
|
-
), C =
|
|
736
|
+
), C = j(() => {
|
|
737
737
|
s && S.current.reportEvent({
|
|
738
738
|
action: "focus",
|
|
739
739
|
component: l,
|
|
@@ -742,7 +742,7 @@ function ae(e, t = "value", n = {}) {
|
|
|
742
742
|
}, [s, l]);
|
|
743
743
|
return {
|
|
744
744
|
value: x,
|
|
745
|
-
setValue:
|
|
745
|
+
setValue: w,
|
|
746
746
|
/** 写入 dataModel 但不上报(用于模式切换规范化等内部同步) */
|
|
747
747
|
setValueSilent: _,
|
|
748
748
|
hasBinding: !!i,
|
|
@@ -754,55 +754,55 @@ function ve(e) {
|
|
|
754
754
|
if (typeof e == "string") return e || void 0;
|
|
755
755
|
if (typeof e == "number") return String(e);
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function Q(e) {
|
|
758
758
|
return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
|
|
759
759
|
}
|
|
760
|
-
function
|
|
761
|
-
return t ? Array.isArray(e) ? null :
|
|
760
|
+
function dn(e, t) {
|
|
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 Pe(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 fn(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 pn(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 hn(e, t) {
|
|
776
776
|
return t === void 0 || e.length <= t ? null : e.slice(0, t);
|
|
777
777
|
}
|
|
778
|
-
const
|
|
779
|
-
function
|
|
778
|
+
const gn = Se(null);
|
|
779
|
+
function lt({
|
|
780
780
|
caseSearch: e,
|
|
781
781
|
children: t
|
|
782
782
|
}) {
|
|
783
|
-
return /* @__PURE__ */ u(
|
|
783
|
+
return /* @__PURE__ */ u(gn.Provider, { value: e ?? null, children: t });
|
|
784
784
|
}
|
|
785
|
-
function
|
|
786
|
-
return ke(
|
|
785
|
+
function Jr() {
|
|
786
|
+
return ke(gn);
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function Xe(e) {
|
|
789
789
|
return typeof e == "string" ? e : "";
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function Ze(e) {
|
|
792
792
|
if (!e || typeof e != "object")
|
|
793
793
|
return { flowUniqueIds: [], pageSize: 20 };
|
|
794
794
|
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 = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
795
795
|
return { agentKind: o, agentUniqueId: i, flowType: s, category: a, flowUniqueIds: l, pageSize: r };
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function et(e) {
|
|
798
798
|
var r;
|
|
799
799
|
const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
|
|
800
800
|
return t || n;
|
|
801
801
|
}
|
|
802
|
-
function
|
|
802
|
+
function Gr(e) {
|
|
803
803
|
return JSON.stringify(e);
|
|
804
804
|
}
|
|
805
|
-
const
|
|
805
|
+
const Wr = {
|
|
806
806
|
name: "SkoponCaseSelect",
|
|
807
807
|
schema: h.object({
|
|
808
808
|
label: h.any().optional(),
|
|
@@ -815,7 +815,7 @@ const Kr = {
|
|
|
815
815
|
value: h.any().optional()
|
|
816
816
|
}).passthrough()
|
|
817
817
|
};
|
|
818
|
-
function
|
|
818
|
+
function Yr({
|
|
819
819
|
item: e,
|
|
820
820
|
selected: t,
|
|
821
821
|
disabled: n,
|
|
@@ -829,7 +829,7 @@ function Jr({
|
|
|
829
829
|
disabled: n,
|
|
830
830
|
onClick: r,
|
|
831
831
|
children: [
|
|
832
|
-
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ u(
|
|
832
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ u(Qt, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
|
|
833
833
|
/* @__PURE__ */ M("div", { className: "skopon-resume-select-card-body", children: [
|
|
834
834
|
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-name", children: e.name }),
|
|
835
835
|
e.description ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
|
|
@@ -843,56 +843,56 @@ function Jr({
|
|
|
843
843
|
}
|
|
844
844
|
);
|
|
845
845
|
}
|
|
846
|
-
function
|
|
847
|
-
const { interactive: t } = se(), n =
|
|
846
|
+
function Qr({ context: e }) {
|
|
847
|
+
const { interactive: t } = se(), n = Jr(), { publishLiveOptions: r } = gt(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = ae(e, "value", {
|
|
848
848
|
component: "SkoponCaseSelect",
|
|
849
849
|
changeAction: "click"
|
|
850
|
-
}), l = e.componentModel.properties, c =
|
|
851
|
-
|
|
852
|
-
const T =
|
|
850
|
+
}), l = e.componentModel.properties, c = Xe(l.label), m = Xe(l.placeholder), d = Xe(l.help), b = l.enableRefresh !== !1, g = Pe(l.minCount), S = Pe(l.maxCount), y = L(() => Ze(l.caseFilter), [l.caseFilter]), k = Gr(y), [p, f] = P(1), [v, x] = P(!1), [N, _] = P(""), [w, C] = P([]), [B, V] = P(0), [re, K] = P(y.pageSize ?? 20), $ = A(0), W = Q(o);
|
|
851
|
+
q(() => {
|
|
852
|
+
const T = hn(W, S);
|
|
853
853
|
T !== null && s(T);
|
|
854
|
-
}, [S,
|
|
855
|
-
const ee =
|
|
854
|
+
}, [S, W, s]);
|
|
855
|
+
const ee = L(() => n ? et(y) ? N || m || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, y, N, m]), te = j(
|
|
856
856
|
async (T) => {
|
|
857
|
-
const
|
|
858
|
-
if (!n || !
|
|
859
|
-
C([]),
|
|
857
|
+
const D = Ze(JSON.parse(k)), z = ++$.current;
|
|
858
|
+
if (!n || !et(D)) {
|
|
859
|
+
C([]), V(0), _(""), x(!1);
|
|
860
860
|
return;
|
|
861
861
|
}
|
|
862
862
|
x(!0), _("");
|
|
863
863
|
try {
|
|
864
|
-
const I = await n({ filter:
|
|
865
|
-
if (
|
|
866
|
-
C(I.list),
|
|
864
|
+
const I = await n({ filter: D, page: T });
|
|
865
|
+
if (z !== $.current) return;
|
|
866
|
+
C(I.list), V(I.total), f(I.page), K(I.pageSize), a && r(
|
|
867
867
|
a,
|
|
868
|
-
I.list.map((
|
|
869
|
-
value:
|
|
870
|
-
label:
|
|
868
|
+
I.list.map((Y) => ({
|
|
869
|
+
value: Y.caseUniqueId,
|
|
870
|
+
label: Y.name || Y.caseUniqueId
|
|
871
871
|
}))
|
|
872
872
|
);
|
|
873
873
|
} catch (I) {
|
|
874
|
-
if (
|
|
875
|
-
C([]),
|
|
874
|
+
if (z !== $.current) return;
|
|
875
|
+
C([]), V(0), _(I instanceof Error ? I.message : "加载案例列表失败");
|
|
876
876
|
} finally {
|
|
877
|
-
|
|
877
|
+
z === $.current && x(!1);
|
|
878
878
|
}
|
|
879
879
|
},
|
|
880
880
|
[n, k, a, r]
|
|
881
881
|
);
|
|
882
|
-
|
|
882
|
+
q(() => {
|
|
883
883
|
f(1), te(1);
|
|
884
884
|
}, [k, te]);
|
|
885
|
-
const
|
|
885
|
+
const E = (T) => {
|
|
886
886
|
if (!t) return;
|
|
887
|
-
const
|
|
888
|
-
|
|
887
|
+
const D = fn(
|
|
888
|
+
W,
|
|
889
889
|
T,
|
|
890
890
|
g,
|
|
891
891
|
S
|
|
892
892
|
);
|
|
893
|
-
|
|
894
|
-
},
|
|
895
|
-
const T =
|
|
893
|
+
D !== null && i(D);
|
|
894
|
+
}, R = () => {
|
|
895
|
+
const T = Ze(JSON.parse(k)), D = re || T.pageSize || 20, z = Math.max(1, Math.ceil(B / D)), I = p >= z ? 1 : p + 1;
|
|
896
896
|
te(I);
|
|
897
897
|
};
|
|
898
898
|
return /* @__PURE__ */ M(
|
|
@@ -902,36 +902,36 @@ function Gr({ context: e }) {
|
|
|
902
902
|
"data-skopon-field": a || void 0,
|
|
903
903
|
children: [
|
|
904
904
|
c ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: c }) : null,
|
|
905
|
-
v &&
|
|
906
|
-
/* @__PURE__ */ u(
|
|
905
|
+
v && w.length === 0 ? /* @__PURE__ */ M("div", { className: "skopon-resume-select-status", children: [
|
|
906
|
+
/* @__PURE__ */ u(ft, { size: "small" }),
|
|
907
907
|
" 加载案例…"
|
|
908
908
|
] }) : null,
|
|
909
|
-
!v &&
|
|
910
|
-
|
|
911
|
-
|
|
909
|
+
!v && w.length === 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-empty", children: ee }) : null,
|
|
910
|
+
w.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-list", children: w.map((T) => /* @__PURE__ */ u(
|
|
911
|
+
Yr,
|
|
912
912
|
{
|
|
913
913
|
item: T,
|
|
914
|
-
selected:
|
|
915
|
-
disabled:
|
|
916
|
-
|
|
914
|
+
selected: W.includes(T.caseUniqueId),
|
|
915
|
+
disabled: pn(
|
|
916
|
+
W,
|
|
917
917
|
T.caseUniqueId,
|
|
918
918
|
t,
|
|
919
919
|
g,
|
|
920
920
|
S
|
|
921
921
|
),
|
|
922
|
-
onToggle: () =>
|
|
922
|
+
onToggle: () => E(T.caseUniqueId)
|
|
923
923
|
},
|
|
924
924
|
T.caseUniqueId
|
|
925
925
|
)) }) : null,
|
|
926
|
-
b && n &&
|
|
926
|
+
b && n && et(y) ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ u(
|
|
927
927
|
Oe,
|
|
928
928
|
{
|
|
929
929
|
type: "default",
|
|
930
930
|
size: "small",
|
|
931
|
-
icon: /* @__PURE__ */ u(
|
|
931
|
+
icon: /* @__PURE__ */ u(Yt, {}),
|
|
932
932
|
loading: v,
|
|
933
933
|
disabled: !t,
|
|
934
|
-
onClick:
|
|
934
|
+
onClick: R,
|
|
935
935
|
children: "换一批"
|
|
936
936
|
}
|
|
937
937
|
) }) : null,
|
|
@@ -940,23 +940,23 @@ function Gr({ context: e }) {
|
|
|
940
940
|
}
|
|
941
941
|
);
|
|
942
942
|
}
|
|
943
|
-
const
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
),
|
|
943
|
+
const Xr = X(
|
|
944
|
+
Wr,
|
|
945
|
+
Qr
|
|
946
|
+
), Zr = {
|
|
947
947
|
type: "case_multiselect",
|
|
948
948
|
componentName: "SkoponCaseSelect",
|
|
949
|
-
toComponent:
|
|
950
|
-
fromComponent:
|
|
951
|
-
catalogComponents: [
|
|
949
|
+
toComponent: zr,
|
|
950
|
+
fromComponent: Or,
|
|
951
|
+
catalogComponents: [Xr]
|
|
952
952
|
};
|
|
953
|
-
function
|
|
953
|
+
function Kt(e) {
|
|
954
954
|
if (e == null) return;
|
|
955
955
|
const t = typeof e == "number" ? e : Number(e);
|
|
956
956
|
if (!(!Number.isFinite(t) || t < 1))
|
|
957
957
|
return Math.floor(t);
|
|
958
958
|
}
|
|
959
|
-
function
|
|
959
|
+
function eo(e, t) {
|
|
960
960
|
var s, a, l, c;
|
|
961
961
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
962
962
|
return i({
|
|
@@ -977,7 +977,7 @@ function Qr(e, t) {
|
|
|
977
977
|
value: { path: o }
|
|
978
978
|
});
|
|
979
979
|
}
|
|
980
|
-
function
|
|
980
|
+
function to(e, t, n) {
|
|
981
981
|
const r = n.nameFromValue(e.value), o = {
|
|
982
982
|
...t("resume_multiselect"),
|
|
983
983
|
name: r,
|
|
@@ -994,34 +994,34 @@ function Xr(e, t, n) {
|
|
|
994
994
|
pageSize: typeof c.pageSize == "number" ? c.pageSize : 20
|
|
995
995
|
};
|
|
996
996
|
}
|
|
997
|
-
const a =
|
|
997
|
+
const a = Kt(e.minCount);
|
|
998
998
|
a !== void 0 && (o.resumeMinCount = a);
|
|
999
|
-
const l =
|
|
999
|
+
const l = Kt(e.maxCount);
|
|
1000
1000
|
return l !== void 0 && (o.resumeMaxCount = l), o;
|
|
1001
1001
|
}
|
|
1002
|
-
const
|
|
1003
|
-
function
|
|
1002
|
+
const yn = Se(null);
|
|
1003
|
+
function ct({
|
|
1004
1004
|
resumeSearch: e,
|
|
1005
1005
|
children: t
|
|
1006
1006
|
}) {
|
|
1007
|
-
return /* @__PURE__ */ u(
|
|
1007
|
+
return /* @__PURE__ */ u(yn.Provider, { value: e ?? null, children: t });
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1010
|
-
return ke(
|
|
1009
|
+
function no() {
|
|
1010
|
+
return ke(yn);
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function tt(e) {
|
|
1013
1013
|
return typeof e == "string" ? e : "";
|
|
1014
1014
|
}
|
|
1015
|
-
function
|
|
1015
|
+
function nt(e) {
|
|
1016
1016
|
if (!e || typeof e != "object")
|
|
1017
1017
|
return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
|
|
1018
1018
|
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;
|
|
1019
1019
|
return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: s };
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1021
|
+
function ro(e) {
|
|
1022
1022
|
return JSON.stringify(e);
|
|
1023
1023
|
}
|
|
1024
|
-
const
|
|
1024
|
+
const oo = {
|
|
1025
1025
|
name: "SkoponResumeSelect",
|
|
1026
1026
|
schema: h.object({
|
|
1027
1027
|
label: h.any().optional(),
|
|
@@ -1033,9 +1033,9 @@ const to = {
|
|
|
1033
1033
|
maxCount: h.any().optional(),
|
|
1034
1034
|
value: h.any().optional()
|
|
1035
1035
|
}).passthrough()
|
|
1036
|
-
},
|
|
1037
|
-
function
|
|
1038
|
-
const n = (t ?? []).filter(Boolean), r = n.slice(0,
|
|
1036
|
+
}, io = 3, so = 2;
|
|
1037
|
+
function rt(e, t) {
|
|
1038
|
+
const n = (t ?? []).filter(Boolean), r = n.slice(0, io), o = n.length - r.length;
|
|
1039
1039
|
return /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-tags", children: [
|
|
1040
1040
|
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-label", children: e }),
|
|
1041
1041
|
n.length > 0 ? /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-tags-list", children: [
|
|
@@ -1047,25 +1047,25 @@ function nt(e, t) {
|
|
|
1047
1047
|
] }) : /* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
|
|
1048
1048
|
] });
|
|
1049
1049
|
}
|
|
1050
|
-
function
|
|
1050
|
+
function ao(e) {
|
|
1051
1051
|
return /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-field", children: [
|
|
1052
1052
|
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
|
|
1053
1053
|
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
|
|
1054
1054
|
] });
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1056
|
+
function lo({ work: e }) {
|
|
1057
1057
|
return /* @__PURE__ */ M("div", { className: "skopon-resume-select-card-work", children: [
|
|
1058
|
-
/* @__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(
|
|
1058
|
+
/* @__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(Yn, { className: "skopon-resume-select-card-work-placeholder" }) }),
|
|
1059
1059
|
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
|
|
1060
1060
|
] });
|
|
1061
1061
|
}
|
|
1062
|
-
function
|
|
1062
|
+
function co({
|
|
1063
1063
|
item: e,
|
|
1064
1064
|
selected: t,
|
|
1065
1065
|
disabled: n,
|
|
1066
1066
|
onToggle: r
|
|
1067
1067
|
}) {
|
|
1068
|
-
const o = (e.works ?? []).slice(0,
|
|
1068
|
+
const o = (e.works ?? []).slice(0, so);
|
|
1069
1069
|
return /* @__PURE__ */ M(
|
|
1070
1070
|
"button",
|
|
1071
1071
|
{
|
|
@@ -1075,81 +1075,81 @@ function so({
|
|
|
1075
1075
|
onClick: r,
|
|
1076
1076
|
children: [
|
|
1077
1077
|
/* @__PURE__ */ u(
|
|
1078
|
-
|
|
1078
|
+
Ln,
|
|
1079
1079
|
{
|
|
1080
1080
|
size: 48,
|
|
1081
1081
|
src: e.avatarUrl || void 0,
|
|
1082
|
-
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ u(
|
|
1082
|
+
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ u(Wn, {}),
|
|
1083
1083
|
className: "skopon-resume-select-card-avatar"
|
|
1084
1084
|
}
|
|
1085
1085
|
),
|
|
1086
1086
|
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
|
|
1087
1087
|
/* @__PURE__ */ M("div", { className: "skopon-resume-select-card-body", children: [
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1088
|
+
ao(e.satisfaction),
|
|
1089
|
+
rt("性格", e.personality),
|
|
1090
|
+
rt("专长", e.specialties),
|
|
1091
|
+
rt("擅长领域", e.traits),
|
|
1092
1092
|
/* @__PURE__ */ M("div", { className: "skopon-resume-select-card-works", children: [
|
|
1093
1093
|
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
|
|
1094
|
-
o.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, s) => /* @__PURE__ */ u(
|
|
1094
|
+
o.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, s) => /* @__PURE__ */ u(lo, { work: i }, `${i.title}-${s}`)) }) : /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
|
|
1095
1095
|
] })
|
|
1096
1096
|
] })
|
|
1097
1097
|
]
|
|
1098
1098
|
}
|
|
1099
1099
|
);
|
|
1100
1100
|
}
|
|
1101
|
-
function
|
|
1102
|
-
const { interactive: t } = se(), n =
|
|
1101
|
+
function uo({ context: e }) {
|
|
1102
|
+
const { interactive: t } = se(), n = no(), { publishLiveOptions: r } = gt(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = ae(e, "value", {
|
|
1103
1103
|
component: "SkoponResumeSelect",
|
|
1104
1104
|
changeAction: "click"
|
|
1105
|
-
}), l = e.componentModel.properties, c =
|
|
1106
|
-
|
|
1107
|
-
const T =
|
|
1105
|
+
}), l = e.componentModel.properties, c = tt(l.label), m = tt(l.placeholder), d = tt(l.help), b = l.enableRefresh !== !1, g = Pe(l.minCount), S = Pe(l.maxCount), y = L(() => nt(l.resumeFilter), [l.resumeFilter]), k = ro(y), [p, f] = P(1), [v, x] = P(!1), [N, _] = P(""), [w, C] = P([]), [B, V] = P(0), [re, K] = P(y.pageSize ?? 20), $ = A(0), W = Q(o);
|
|
1106
|
+
q(() => {
|
|
1107
|
+
const T = hn(W, S);
|
|
1108
1108
|
T !== null && s(T);
|
|
1109
|
-
}, [S,
|
|
1110
|
-
const ee =
|
|
1109
|
+
}, [S, W, s]);
|
|
1110
|
+
const ee = j(
|
|
1111
1111
|
async (T) => {
|
|
1112
|
-
const
|
|
1112
|
+
const D = nt(JSON.parse(k)), z = ++$.current;
|
|
1113
1113
|
if (!n) {
|
|
1114
|
-
C([]),
|
|
1114
|
+
C([]), V(0), _("未配置简历搜索服务"), x(!1);
|
|
1115
1115
|
return;
|
|
1116
1116
|
}
|
|
1117
1117
|
x(!0), _("");
|
|
1118
1118
|
try {
|
|
1119
|
-
const I = await n({ filter:
|
|
1120
|
-
if (
|
|
1121
|
-
C(I.list),
|
|
1119
|
+
const I = await n({ filter: D, page: T });
|
|
1120
|
+
if (z !== $.current) return;
|
|
1121
|
+
C(I.list), V(I.total), f(I.page), K(I.pageSize), a && r(
|
|
1122
1122
|
a,
|
|
1123
|
-
I.list.map((
|
|
1124
|
-
value:
|
|
1125
|
-
label:
|
|
1123
|
+
I.list.map((Y) => ({
|
|
1124
|
+
value: Y.resumeUniqueId,
|
|
1125
|
+
label: Y.name || Y.resumeUniqueId
|
|
1126
1126
|
}))
|
|
1127
1127
|
);
|
|
1128
1128
|
} catch (I) {
|
|
1129
|
-
if (
|
|
1130
|
-
C([]),
|
|
1129
|
+
if (z !== $.current) return;
|
|
1130
|
+
C([]), V(0), _(I instanceof Error ? I.message : "加载简历列表失败");
|
|
1131
1131
|
} finally {
|
|
1132
|
-
|
|
1132
|
+
z === $.current && x(!1);
|
|
1133
1133
|
}
|
|
1134
1134
|
},
|
|
1135
1135
|
[n, k, a, r]
|
|
1136
1136
|
);
|
|
1137
|
-
|
|
1137
|
+
q(() => {
|
|
1138
1138
|
f(1), ee(1);
|
|
1139
1139
|
}, [k, ee]);
|
|
1140
1140
|
const te = (T) => {
|
|
1141
1141
|
if (!t) return;
|
|
1142
|
-
const
|
|
1143
|
-
|
|
1142
|
+
const D = fn(
|
|
1143
|
+
W,
|
|
1144
1144
|
T,
|
|
1145
1145
|
g,
|
|
1146
1146
|
S
|
|
1147
1147
|
);
|
|
1148
|
-
|
|
1149
|
-
},
|
|
1150
|
-
const T =
|
|
1148
|
+
D !== null && i(D);
|
|
1149
|
+
}, E = () => {
|
|
1150
|
+
const T = nt(JSON.parse(k)), D = re || T.pageSize || 20, z = Math.max(1, Math.ceil(B / D)), I = p >= z ? 1 : p + 1;
|
|
1151
1151
|
ee(I);
|
|
1152
|
-
},
|
|
1152
|
+
}, R = m || "暂无匹配的简历";
|
|
1153
1153
|
return /* @__PURE__ */ M(
|
|
1154
1154
|
"div",
|
|
1155
1155
|
{
|
|
@@ -1157,19 +1157,19 @@ function ao({ context: e }) {
|
|
|
1157
1157
|
"data-skopon-field": a || void 0,
|
|
1158
1158
|
children: [
|
|
1159
1159
|
c ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: c }) : null,
|
|
1160
|
-
v &&
|
|
1161
|
-
/* @__PURE__ */ u(
|
|
1160
|
+
v && w.length === 0 ? /* @__PURE__ */ M("div", { className: "skopon-resume-select-status", children: [
|
|
1161
|
+
/* @__PURE__ */ u(ft, { size: "small" }),
|
|
1162
1162
|
" 加载简历…"
|
|
1163
1163
|
] }) : null,
|
|
1164
1164
|
!v && N ? /* @__PURE__ */ u(ne.Text, { type: "danger", className: "skopon-resume-select-status", children: N }) : null,
|
|
1165
|
-
!v && !N &&
|
|
1166
|
-
|
|
1167
|
-
|
|
1165
|
+
!v && !N && w.length === 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-empty", children: R }) : null,
|
|
1166
|
+
w.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-list", children: w.map((T) => /* @__PURE__ */ u(
|
|
1167
|
+
co,
|
|
1168
1168
|
{
|
|
1169
1169
|
item: T,
|
|
1170
|
-
selected:
|
|
1171
|
-
disabled:
|
|
1172
|
-
|
|
1170
|
+
selected: W.includes(T.resumeUniqueId),
|
|
1171
|
+
disabled: pn(
|
|
1172
|
+
W,
|
|
1173
1173
|
T.resumeUniqueId,
|
|
1174
1174
|
t,
|
|
1175
1175
|
g,
|
|
@@ -1184,10 +1184,10 @@ function ao({ context: e }) {
|
|
|
1184
1184
|
{
|
|
1185
1185
|
type: "default",
|
|
1186
1186
|
size: "small",
|
|
1187
|
-
icon: /* @__PURE__ */ u(
|
|
1187
|
+
icon: /* @__PURE__ */ u(Yt, {}),
|
|
1188
1188
|
loading: v,
|
|
1189
1189
|
disabled: !t,
|
|
1190
|
-
onClick:
|
|
1190
|
+
onClick: E,
|
|
1191
1191
|
children: "换一批"
|
|
1192
1192
|
}
|
|
1193
1193
|
) }) : null,
|
|
@@ -1196,63 +1196,63 @@ function ao({ context: e }) {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
);
|
|
1198
1198
|
}
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
),
|
|
1199
|
+
const mo = X(
|
|
1200
|
+
oo,
|
|
1201
|
+
uo
|
|
1202
|
+
), fo = {
|
|
1203
1203
|
type: "resume_multiselect",
|
|
1204
1204
|
componentName: "SkoponResumeSelect",
|
|
1205
|
-
toComponent:
|
|
1206
|
-
fromComponent:
|
|
1207
|
-
catalogComponents: [
|
|
1208
|
-
}, Be = [
|
|
1205
|
+
toComponent: eo,
|
|
1206
|
+
fromComponent: to,
|
|
1207
|
+
catalogComponents: [mo]
|
|
1208
|
+
}, Be = [fo, Zr], po = new Map(
|
|
1209
1209
|
Be.map((e) => [e.type, e])
|
|
1210
|
-
),
|
|
1210
|
+
), ho = new Map(
|
|
1211
1211
|
Be.map((e) => [e.componentName, e])
|
|
1212
1212
|
);
|
|
1213
|
-
function
|
|
1214
|
-
return
|
|
1213
|
+
function go(e) {
|
|
1214
|
+
return po.get(e);
|
|
1215
1215
|
}
|
|
1216
|
-
function
|
|
1217
|
-
return
|
|
1216
|
+
function yo(e) {
|
|
1217
|
+
return ho.get(e);
|
|
1218
1218
|
}
|
|
1219
|
-
function
|
|
1219
|
+
function vo() {
|
|
1220
1220
|
return Be.flatMap((e) => e.catalogComponents);
|
|
1221
1221
|
}
|
|
1222
|
-
function
|
|
1222
|
+
function bo() {
|
|
1223
1223
|
return Be.map((e) => e.componentName);
|
|
1224
1224
|
}
|
|
1225
|
-
const
|
|
1226
|
-
function
|
|
1225
|
+
const we = "root", ut = "__title__", mt = "__desc__", yt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
|
|
1226
|
+
function So(e) {
|
|
1227
1227
|
return `/${e}`;
|
|
1228
1228
|
}
|
|
1229
|
-
function
|
|
1229
|
+
function Jt(e) {
|
|
1230
1230
|
return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
|
|
1231
1231
|
}
|
|
1232
1232
|
function H(e) {
|
|
1233
1233
|
if (typeof e == "string") return e;
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1235
|
+
function ko(e) {
|
|
1236
1236
|
const t = e.id || le("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
|
|
1237
1237
|
return {
|
|
1238
1238
|
id: t,
|
|
1239
1239
|
component: "SkoponMedia",
|
|
1240
1240
|
mediaType: n,
|
|
1241
|
-
urls:
|
|
1241
|
+
urls: Cr(e),
|
|
1242
1242
|
mediaSize: _e(e.mediaSize),
|
|
1243
1243
|
label: e.label ?? "",
|
|
1244
1244
|
help: e.help ?? "",
|
|
1245
1245
|
placeholder: e.placeholder ?? ""
|
|
1246
1246
|
};
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1248
|
+
function Co(e) {
|
|
1249
1249
|
if (Array.isArray(e.urls))
|
|
1250
1250
|
return e.urls.map((n) => String(n).trim()).filter(Boolean);
|
|
1251
1251
|
const t = H(e.url);
|
|
1252
1252
|
return t != null && t.trim() ? [t.trim()] : [];
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1255
|
-
const r = typeof e.id == "string" ? e.id : le("block-"), o =
|
|
1254
|
+
function Fe(e, t, n) {
|
|
1255
|
+
const r = typeof e.id == "string" ? e.id : le("block-"), o = Co(e), i = H(e.label) ?? H(e.description) ?? n, s = H(e.help), a = H(e.placeholder), l = _e(e.mediaSize);
|
|
1256
1256
|
return {
|
|
1257
1257
|
id: r,
|
|
1258
1258
|
type: t,
|
|
@@ -1263,7 +1263,7 @@ function Ee(e, t, n) {
|
|
|
1263
1263
|
mediaUrls: o.length > 0 ? o : [""]
|
|
1264
1264
|
};
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function Gt(e) {
|
|
1267
1267
|
switch (e.type) {
|
|
1268
1268
|
case "toggle":
|
|
1269
1269
|
return Te(e.defaultValue);
|
|
@@ -1280,9 +1280,9 @@ function So(e) {
|
|
|
1280
1280
|
return typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
1281
1281
|
}
|
|
1282
1282
|
}
|
|
1283
|
-
function
|
|
1283
|
+
function Ao(e) {
|
|
1284
1284
|
var c;
|
|
1285
|
-
const t = e.id || le("a2-"), n = e.label ?? "", r = ((c = e.name) == null ? void 0 : c.trim()) || "", o = r ?
|
|
1285
|
+
const t = e.id || le("a2-"), n = e.label ?? "", r = ((c = e.name) == null ? void 0 : c.trim()) || "", o = r ? So(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 = go(e.type);
|
|
1286
1286
|
if (l)
|
|
1287
1287
|
return l.toComponent(e, a);
|
|
1288
1288
|
switch (e.type) {
|
|
@@ -1291,6 +1291,14 @@ function ko(e) {
|
|
|
1291
1291
|
case "paragraph":
|
|
1292
1292
|
return { node: { id: t, component: "Text", text: n, variant: "body" } };
|
|
1293
1293
|
case "text":
|
|
1294
|
+
return e.hidden ? r ? { node: null, dataKey: r, dataValue: Gt(e) } : { node: null } : s({
|
|
1295
|
+
id: t,
|
|
1296
|
+
component: "TextField",
|
|
1297
|
+
label: n,
|
|
1298
|
+
variant: "shortText",
|
|
1299
|
+
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
1300
|
+
value: { path: o }
|
|
1301
|
+
});
|
|
1294
1302
|
case "tel":
|
|
1295
1303
|
case "url":
|
|
1296
1304
|
return s({
|
|
@@ -1307,7 +1315,7 @@ function ko(e) {
|
|
|
1307
1315
|
component: "TextField",
|
|
1308
1316
|
label: n,
|
|
1309
1317
|
variant: "shortText",
|
|
1310
|
-
validationRegexp:
|
|
1318
|
+
validationRegexp: yt,
|
|
1311
1319
|
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
1312
1320
|
value: { path: o }
|
|
1313
1321
|
});
|
|
@@ -1393,7 +1401,7 @@ function ko(e) {
|
|
|
1393
1401
|
case "image":
|
|
1394
1402
|
case "video":
|
|
1395
1403
|
case "audio":
|
|
1396
|
-
return { node:
|
|
1404
|
+
return { node: ko(e) };
|
|
1397
1405
|
case "file":
|
|
1398
1406
|
return s({
|
|
1399
1407
|
id: t,
|
|
@@ -1410,31 +1418,31 @@ function ko(e) {
|
|
|
1410
1418
|
return { node: null };
|
|
1411
1419
|
}
|
|
1412
1420
|
}
|
|
1413
|
-
function
|
|
1421
|
+
function dt(e) {
|
|
1414
1422
|
if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
|
|
1415
|
-
const t = e.components.find((r) => r.id ===
|
|
1423
|
+
const t = e.components.find((r) => r.id === we);
|
|
1416
1424
|
if (!t) return e.components.length === 0;
|
|
1417
1425
|
const n = t.children;
|
|
1418
1426
|
return !Array.isArray(n) || n.length === 0;
|
|
1419
1427
|
}
|
|
1420
|
-
function
|
|
1428
|
+
function vn(e, t) {
|
|
1421
1429
|
const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, s = (e.title ?? "").trim(), a = (e.description ?? "").trim();
|
|
1422
|
-
i && s && (n.push({ id:
|
|
1430
|
+
i && s && (n.push({ id: ut, component: "Text", text: s, variant: "h2" }), r.push(ut)), i && a && (n.push({ id: mt, component: "Text", text: a, variant: "body" }), r.push(mt));
|
|
1423
1431
|
for (const m of e.blocks ?? []) {
|
|
1424
|
-
const { node: d, dataKey: b, dataValue: g } =
|
|
1425
|
-
d && (n.push(d), r.push(d.id)
|
|
1432
|
+
const { node: d, dataKey: b, dataValue: g } = Ao(m);
|
|
1433
|
+
b && (o[b] = g), d && (n.push(d), r.push(d.id));
|
|
1426
1434
|
}
|
|
1427
|
-
n.unshift({ id:
|
|
1428
|
-
const l = { root:
|
|
1435
|
+
n.unshift({ id: we, component: "Column", children: r });
|
|
1436
|
+
const l = { root: we, components: n, dataModel: o }, c = t == null ? void 0 : t.styleId;
|
|
1429
1437
|
return c !== void 0 && (l.surfaceProperties = { styleId: c ?? null }), l;
|
|
1430
1438
|
}
|
|
1431
|
-
function
|
|
1439
|
+
function _o(e) {
|
|
1432
1440
|
const t = /* @__PURE__ */ new Map();
|
|
1433
1441
|
for (const n of e.components ?? [])
|
|
1434
1442
|
n && typeof n.id == "string" && t.set(n.id, n);
|
|
1435
1443
|
return t;
|
|
1436
1444
|
}
|
|
1437
|
-
function
|
|
1445
|
+
function ot(e) {
|
|
1438
1446
|
const t = e.options;
|
|
1439
1447
|
return Array.isArray(t) ? t.map((n) => {
|
|
1440
1448
|
if (!n || typeof n != "object") return null;
|
|
@@ -1445,10 +1453,10 @@ function rt(e) {
|
|
|
1445
1453
|
};
|
|
1446
1454
|
}).filter((n) => !!n) : [];
|
|
1447
1455
|
}
|
|
1448
|
-
function
|
|
1449
|
-
const t = typeof e.id == "string" ? e.id : le("block-"), n = String(e.component ?? ""), r = H(e.label) ?? H(e.text) ?? "", o =
|
|
1456
|
+
function To(e) {
|
|
1457
|
+
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 = yo(n);
|
|
1450
1458
|
if (s)
|
|
1451
|
-
return s.fromComponent(e, i, { asLiteral: H, nameFromValue:
|
|
1459
|
+
return s.fromComponent(e, i, { asLiteral: H, nameFromValue: Jt });
|
|
1452
1460
|
switch (n) {
|
|
1453
1461
|
case "Text": {
|
|
1454
1462
|
const a = String(e.variant ?? "body"), l = /^h[1-6]$/i.test(a) || a === "title" || a === "subtitle";
|
|
@@ -1457,7 +1465,7 @@ function Ao(e) {
|
|
|
1457
1465
|
case "TextField": {
|
|
1458
1466
|
const a = String(e.variant ?? "shortText");
|
|
1459
1467
|
let l = "text";
|
|
1460
|
-
a === "longText" ? l = "textarea" : a === "number" ? l = "number" : H(e.validationRegexp) ===
|
|
1468
|
+
a === "longText" ? l = "textarea" : a === "number" ? l = "number" : H(e.validationRegexp) === yt && (l = "email");
|
|
1461
1469
|
const c = { ...i(l), name: o }, m = H(e.placeholder);
|
|
1462
1470
|
return m && (c.placeholder = m), c;
|
|
1463
1471
|
}
|
|
@@ -1467,7 +1475,7 @@ function Ao(e) {
|
|
|
1467
1475
|
const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", c = {
|
|
1468
1476
|
...i(l),
|
|
1469
1477
|
name: o,
|
|
1470
|
-
options:
|
|
1478
|
+
options: ot(e)
|
|
1471
1479
|
}, m = H(e.placeholder);
|
|
1472
1480
|
return m && (c.placeholder = m), c;
|
|
1473
1481
|
}
|
|
@@ -1477,12 +1485,12 @@ function Ao(e) {
|
|
|
1477
1485
|
const m = {
|
|
1478
1486
|
...i(a),
|
|
1479
1487
|
name: o,
|
|
1480
|
-
options:
|
|
1488
|
+
options: ot(e)
|
|
1481
1489
|
}, d = H(e.placeholder);
|
|
1482
1490
|
return d && (m.placeholder = d), m;
|
|
1483
1491
|
}
|
|
1484
1492
|
const c = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
|
|
1485
|
-
return { ...i(c), name: o, options:
|
|
1493
|
+
return { ...i(c), name: o, options: ot(e) };
|
|
1486
1494
|
}
|
|
1487
1495
|
case "DateTimeInput": {
|
|
1488
1496
|
const a = e.enableDate === !0, l = e.enableTime === !0, m = { ...i(!a && l ? "time" : "datetime"), name: o }, d = H(e.placeholder);
|
|
@@ -1490,14 +1498,14 @@ function Ao(e) {
|
|
|
1490
1498
|
}
|
|
1491
1499
|
case "SkoponMedia": {
|
|
1492
1500
|
const a = String(e.mediaType ?? "image");
|
|
1493
|
-
return
|
|
1501
|
+
return Fe(e, a === "video" ? "video" : a === "audio" ? "audio" : "image", r);
|
|
1494
1502
|
}
|
|
1495
1503
|
case "Image":
|
|
1496
|
-
return
|
|
1504
|
+
return Fe(e, "image", r);
|
|
1497
1505
|
case "Video":
|
|
1498
|
-
return
|
|
1506
|
+
return Fe(e, "video", r);
|
|
1499
1507
|
case "AudioPlayer":
|
|
1500
|
-
return
|
|
1508
|
+
return Fe(e, "audio", r);
|
|
1501
1509
|
case "FileUpload": {
|
|
1502
1510
|
const a = H(e.accept) ?? "", l = { ...i("file"), name: o };
|
|
1503
1511
|
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;
|
|
@@ -1506,7 +1514,7 @@ function Ao(e) {
|
|
|
1506
1514
|
return null;
|
|
1507
1515
|
}
|
|
1508
1516
|
}
|
|
1509
|
-
function
|
|
1517
|
+
function bn(e, t, n, r) {
|
|
1510
1518
|
if (n.has(e)) return;
|
|
1511
1519
|
n.add(e);
|
|
1512
1520
|
const o = t.get(e);
|
|
@@ -1514,12 +1522,12 @@ function yn(e, t, n, r) {
|
|
|
1514
1522
|
const i = String(o.component ?? "");
|
|
1515
1523
|
if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
|
|
1516
1524
|
for (const s of o.children)
|
|
1517
|
-
typeof s == "string" &&
|
|
1525
|
+
typeof s == "string" && bn(s, t, n, r);
|
|
1518
1526
|
return;
|
|
1519
1527
|
}
|
|
1520
1528
|
r.push(o);
|
|
1521
1529
|
}
|
|
1522
|
-
function
|
|
1530
|
+
function xo(e, t) {
|
|
1523
1531
|
return t ? e.map((n) => {
|
|
1524
1532
|
var i;
|
|
1525
1533
|
const r = (i = n.name) == null ? void 0 : i.trim();
|
|
@@ -1528,32 +1536,32 @@ function _o(e, t) {
|
|
|
1528
1536
|
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: Te(o) } : { ...n, defaultValue: o };
|
|
1529
1537
|
}) : e;
|
|
1530
1538
|
}
|
|
1531
|
-
function
|
|
1539
|
+
function Mo(e) {
|
|
1532
1540
|
if (!e || !Array.isArray(e.components))
|
|
1533
1541
|
return ye({ title: "", description: "", blocks: [] });
|
|
1534
|
-
const t =
|
|
1535
|
-
|
|
1542
|
+
const t = _o(e), n = [];
|
|
1543
|
+
bn(e.root ?? we, t, /* @__PURE__ */ new Set(), n);
|
|
1536
1544
|
let r = "", o = "";
|
|
1537
1545
|
const i = [];
|
|
1538
1546
|
for (const s of n) {
|
|
1539
|
-
if (s.id ===
|
|
1547
|
+
if (s.id === ut) {
|
|
1540
1548
|
r = H(s.text) ?? r;
|
|
1541
1549
|
continue;
|
|
1542
1550
|
}
|
|
1543
|
-
if (s.id ===
|
|
1551
|
+
if (s.id === mt) {
|
|
1544
1552
|
o = H(s.text) ?? o;
|
|
1545
1553
|
continue;
|
|
1546
1554
|
}
|
|
1547
|
-
const a =
|
|
1555
|
+
const a = To(s);
|
|
1548
1556
|
a && i.push(a);
|
|
1549
1557
|
}
|
|
1550
1558
|
return ye({
|
|
1551
1559
|
title: r,
|
|
1552
1560
|
description: o,
|
|
1553
|
-
blocks:
|
|
1561
|
+
blocks: xo(i, e.dataModel)
|
|
1554
1562
|
});
|
|
1555
1563
|
}
|
|
1556
|
-
function
|
|
1564
|
+
function No(e, t) {
|
|
1557
1565
|
const { surfaceId: n, catalogId: r } = t, o = [
|
|
1558
1566
|
{ version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
|
|
1559
1567
|
{
|
|
@@ -1566,25 +1574,25 @@ function xo(e, t) {
|
|
|
1566
1574
|
updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
|
|
1567
1575
|
}), o;
|
|
1568
1576
|
}
|
|
1569
|
-
function
|
|
1577
|
+
function Sn(e) {
|
|
1570
1578
|
return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
|
|
1571
1579
|
}
|
|
1572
|
-
function
|
|
1580
|
+
function Io(e, t) {
|
|
1573
1581
|
if (!e || typeof e != "object") return null;
|
|
1574
|
-
const n = e, r =
|
|
1575
|
-
if (r && !
|
|
1582
|
+
const n = e, r = Sn(n.a2ui) ? n.a2ui : void 0;
|
|
1583
|
+
if (r && !dt(r)) return r;
|
|
1576
1584
|
const o = Array.isArray(n.blocks) ? n.blocks : [];
|
|
1577
1585
|
if (o.length === 0) return null;
|
|
1578
1586
|
const i = qe({
|
|
1579
1587
|
title: typeof n.title == "string" ? n.title : "",
|
|
1580
1588
|
description: typeof n.description == "string" ? n.description : "",
|
|
1581
1589
|
blocks: o,
|
|
1582
|
-
jsonSchema:
|
|
1583
|
-
}), s =
|
|
1584
|
-
return
|
|
1590
|
+
jsonSchema: on(n.jsonSchema ?? n.json_schema)
|
|
1591
|
+
}), s = vn(i, t);
|
|
1592
|
+
return dt(s) ? null : s;
|
|
1585
1593
|
}
|
|
1586
|
-
function
|
|
1587
|
-
return
|
|
1594
|
+
function Fo(e, t, n) {
|
|
1595
|
+
return vn(
|
|
1588
1596
|
{
|
|
1589
1597
|
title: e.title,
|
|
1590
1598
|
description: e.description,
|
|
@@ -1593,18 +1601,18 @@ function No(e, t, n) {
|
|
|
1593
1601
|
n
|
|
1594
1602
|
);
|
|
1595
1603
|
}
|
|
1596
|
-
function
|
|
1604
|
+
function Eo(e) {
|
|
1597
1605
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1598
1606
|
return;
|
|
1599
1607
|
const t = e;
|
|
1600
|
-
return !(Array.isArray(t.blocks) && t.blocks.length > 0) &&
|
|
1608
|
+
return !(Array.isArray(t.blocks) && t.blocks.length > 0) && Sn(t.a2ui) ? Mo(t.a2ui) : qe({
|
|
1601
1609
|
title: typeof t.title == "string" ? t.title : "",
|
|
1602
1610
|
description: typeof t.description == "string" ? t.description : "",
|
|
1603
1611
|
blocks: Array.isArray(t.blocks) ? t.blocks : [],
|
|
1604
|
-
jsonSchema:
|
|
1612
|
+
jsonSchema: on(t.jsonSchema ?? t.json_schema)
|
|
1605
1613
|
});
|
|
1606
1614
|
}
|
|
1607
|
-
function
|
|
1615
|
+
function Uo(e, t, n) {
|
|
1608
1616
|
const r = e.model.surfacesMap.get(t);
|
|
1609
1617
|
if (!r) return {};
|
|
1610
1618
|
const o = {};
|
|
@@ -1614,15 +1622,18 @@ function Fo(e, t, n) {
|
|
|
1614
1622
|
}
|
|
1615
1623
|
return o;
|
|
1616
1624
|
}
|
|
1617
|
-
const
|
|
1618
|
-
function
|
|
1625
|
+
const Ro = /* @__PURE__ */ new Set(["type", "name", "id"]);
|
|
1626
|
+
function vt(e) {
|
|
1627
|
+
return e.type === "text" && e.hidden === !0;
|
|
1628
|
+
}
|
|
1629
|
+
function bt(e) {
|
|
1619
1630
|
return qe({
|
|
1620
1631
|
title: "",
|
|
1621
1632
|
description: "",
|
|
1622
1633
|
blocks: [e]
|
|
1623
1634
|
}).blocks[0];
|
|
1624
1635
|
}
|
|
1625
|
-
function
|
|
1636
|
+
function Po(e, t) {
|
|
1626
1637
|
var o, i;
|
|
1627
1638
|
const n = /* @__PURE__ */ new Map();
|
|
1628
1639
|
for (const s of t) {
|
|
@@ -1632,18 +1643,18 @@ function Uo(e, t) {
|
|
|
1632
1643
|
const r = [];
|
|
1633
1644
|
for (const s of e.blocks) {
|
|
1634
1645
|
if (Ce(s.type)) {
|
|
1635
|
-
r.push(
|
|
1646
|
+
r.push(bt(s));
|
|
1636
1647
|
continue;
|
|
1637
1648
|
}
|
|
1638
1649
|
if (!Z(s.type)) continue;
|
|
1639
1650
|
const a = (i = s.name) == null ? void 0 : i.trim();
|
|
1640
1651
|
if (!a) continue;
|
|
1641
1652
|
const l = n.get(a);
|
|
1642
|
-
l && r.push(l);
|
|
1653
|
+
l && (vt(l) || r.push(l));
|
|
1643
1654
|
}
|
|
1644
1655
|
return r;
|
|
1645
1656
|
}
|
|
1646
|
-
function
|
|
1657
|
+
function wo(e, t, n) {
|
|
1647
1658
|
const r = e.rawBlocks;
|
|
1648
1659
|
if (!(r != null && r.length)) return n;
|
|
1649
1660
|
for (const o of r) {
|
|
@@ -1652,17 +1663,17 @@ function Ro(e, t, n) {
|
|
|
1652
1663
|
}
|
|
1653
1664
|
return n;
|
|
1654
1665
|
}
|
|
1655
|
-
function
|
|
1666
|
+
function zo(e, t) {
|
|
1656
1667
|
var r;
|
|
1657
1668
|
const n = { ...e };
|
|
1658
1669
|
for (const o of Object.keys(t)) {
|
|
1659
|
-
if (
|
|
1670
|
+
if (Ro.has(o) || !Object.prototype.hasOwnProperty.call(t, o)) continue;
|
|
1660
1671
|
const i = t[o];
|
|
1661
1672
|
i !== void 0 && Object.assign(n, { [o]: i });
|
|
1662
1673
|
}
|
|
1663
|
-
return n.type = e.type, n.name = ((r = e.name) == null ? void 0 : r.trim()) || t.name, n.id = e.id,
|
|
1674
|
+
return n.type = e.type, n.name = ((r = e.name) == null ? void 0 : r.trim()) || t.name, n.id = e.id, bt(n);
|
|
1664
1675
|
}
|
|
1665
|
-
function
|
|
1676
|
+
function Ve(e) {
|
|
1666
1677
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1667
1678
|
const t = e;
|
|
1668
1679
|
if (!Array.isArray(t.blocks)) return null;
|
|
@@ -1680,7 +1691,7 @@ function Le(e) {
|
|
|
1680
1691
|
rawBlocks: n
|
|
1681
1692
|
};
|
|
1682
1693
|
}
|
|
1683
|
-
function
|
|
1694
|
+
function Oo(e, t) {
|
|
1684
1695
|
var i, s, a, l, c, m;
|
|
1685
1696
|
const n = /* @__PURE__ */ new Map();
|
|
1686
1697
|
for (const d of (t == null ? void 0 : t.blocks) ?? [])
|
|
@@ -1692,34 +1703,34 @@ function wo(e, t) {
|
|
|
1692
1703
|
if (!b) continue;
|
|
1693
1704
|
const g = n.get(b);
|
|
1694
1705
|
if (g) {
|
|
1695
|
-
const S =
|
|
1696
|
-
r.push(
|
|
1706
|
+
const S = wo(e, b, d);
|
|
1707
|
+
r.push(zo(g, S));
|
|
1697
1708
|
} else
|
|
1698
|
-
o.push(
|
|
1709
|
+
o.push(bt(d));
|
|
1699
1710
|
}
|
|
1700
1711
|
return {
|
|
1701
1712
|
matchedBlocks: r,
|
|
1702
1713
|
extraBlocks: o,
|
|
1703
|
-
renderBlocks:
|
|
1714
|
+
renderBlocks: Po(e, r),
|
|
1704
1715
|
title: ((a = e.title) == null ? void 0 : a.trim()) || ((l = t == null ? void 0 : t.title) == null ? void 0 : l.trim()) || "",
|
|
1705
1716
|
description: ((c = e.description) == null ? void 0 : c.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
|
|
1706
1717
|
};
|
|
1707
1718
|
}
|
|
1708
|
-
function
|
|
1719
|
+
function kn(e) {
|
|
1709
1720
|
const { type: t, defaultValue: n } = e;
|
|
1710
1721
|
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 : "";
|
|
1711
1722
|
}
|
|
1712
|
-
function
|
|
1723
|
+
function ze(e) {
|
|
1713
1724
|
var n;
|
|
1714
1725
|
const t = {};
|
|
1715
1726
|
for (const r of e) {
|
|
1716
1727
|
if (!Z(r.type)) continue;
|
|
1717
1728
|
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1718
|
-
o && (t[o] =
|
|
1729
|
+
o && (t[o] = kn(r));
|
|
1719
1730
|
}
|
|
1720
1731
|
return t;
|
|
1721
1732
|
}
|
|
1722
|
-
function
|
|
1733
|
+
function qo(e) {
|
|
1723
1734
|
return e.blocks.some(
|
|
1724
1735
|
(t) => {
|
|
1725
1736
|
var n;
|
|
@@ -1727,40 +1738,50 @@ function Oo(e) {
|
|
|
1727
1738
|
}
|
|
1728
1739
|
);
|
|
1729
1740
|
}
|
|
1730
|
-
function
|
|
1741
|
+
function Bo(e) {
|
|
1731
1742
|
return e.blocks.filter((t) => {
|
|
1732
1743
|
var n;
|
|
1733
|
-
return Ce(t.type) ? !0 : Z(t.type)
|
|
1744
|
+
return Ce(t.type) ? !0 : !Z(t.type) || !((n = t.name) != null && n.trim()) ? !1 : !vt(t);
|
|
1734
1745
|
});
|
|
1735
1746
|
}
|
|
1736
|
-
function
|
|
1747
|
+
function ys(e) {
|
|
1737
1748
|
return e.blocks.filter((t) => {
|
|
1738
1749
|
var n;
|
|
1739
1750
|
return Z(t.type) && ((n = t.name) == null ? void 0 : n.trim());
|
|
1740
1751
|
}).map((t) => t.name.trim());
|
|
1741
1752
|
}
|
|
1742
|
-
function
|
|
1753
|
+
function Vo(e) {
|
|
1754
|
+
var n;
|
|
1755
|
+
const t = {};
|
|
1756
|
+
for (const r of e.blocks) {
|
|
1757
|
+
if (!vt(r)) continue;
|
|
1758
|
+
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1759
|
+
o && (t[o] = kn(r));
|
|
1760
|
+
}
|
|
1761
|
+
return t;
|
|
1762
|
+
}
|
|
1763
|
+
function St(e) {
|
|
1743
1764
|
return e.replace(/'/g, "'\\''");
|
|
1744
1765
|
}
|
|
1745
|
-
function
|
|
1766
|
+
function Cn(e) {
|
|
1746
1767
|
var n;
|
|
1747
1768
|
const t = (n = e == null ? void 0 : e.Authorization) == null ? void 0 : n.trim();
|
|
1748
|
-
return t ? ` -H 'Authorization: ${
|
|
1769
|
+
return t ? ` -H 'Authorization: ${St(t)}' \\` : " -H 'Authorization: Bearer <token>' \\";
|
|
1749
1770
|
}
|
|
1750
|
-
function
|
|
1771
|
+
function An(e, t, n) {
|
|
1751
1772
|
const r = (t ?? "").trim() || "<callback_url>", o = JSON.stringify(e ?? {}, null, 2);
|
|
1752
1773
|
return [
|
|
1753
1774
|
`curl -X POST '${r}' \\`,
|
|
1754
1775
|
" -H 'Content-Type: application/json' \\",
|
|
1755
|
-
|
|
1756
|
-
` -d '${
|
|
1776
|
+
Cn(n),
|
|
1777
|
+
` -d '${St(o)}'`
|
|
1757
1778
|
].join(`
|
|
1758
1779
|
`);
|
|
1759
1780
|
}
|
|
1760
1781
|
function Lo(e, t) {
|
|
1761
1782
|
return JSON.stringify({ ...e, ...t }, null, 2);
|
|
1762
1783
|
}
|
|
1763
|
-
function
|
|
1784
|
+
function jo({
|
|
1764
1785
|
cardValues: e,
|
|
1765
1786
|
extraValues: t = {},
|
|
1766
1787
|
callbackUrl: n,
|
|
@@ -1770,18 +1791,18 @@ function Vo({
|
|
|
1770
1791
|
return [
|
|
1771
1792
|
`curl -X POST '${o}' \\`,
|
|
1772
1793
|
" -H 'Content-Type: application/json' \\",
|
|
1773
|
-
|
|
1774
|
-
` -d '${
|
|
1794
|
+
Cn(r),
|
|
1795
|
+
` -d '${St(i)}'`
|
|
1775
1796
|
].join(`
|
|
1776
1797
|
`);
|
|
1777
1798
|
}
|
|
1778
|
-
function
|
|
1779
|
-
const r =
|
|
1780
|
-
if (!r) return
|
|
1781
|
-
const o =
|
|
1782
|
-
return
|
|
1799
|
+
function vs(e, t, n) {
|
|
1800
|
+
const r = Ve(e);
|
|
1801
|
+
if (!r) return An(e, t, n);
|
|
1802
|
+
const o = ze(r.blocks);
|
|
1803
|
+
return jo({ cardValues: o, callbackUrl: t, headers: n });
|
|
1783
1804
|
}
|
|
1784
|
-
async function
|
|
1805
|
+
async function _n(e, t, n) {
|
|
1785
1806
|
const r = e.trim();
|
|
1786
1807
|
if (!r)
|
|
1787
1808
|
throw new Error("callback_url 为空");
|
|
@@ -1808,7 +1829,7 @@ async function kn(e, t, n) {
|
|
|
1808
1829
|
}
|
|
1809
1830
|
return { ok: i.ok, status: i.status, body: s };
|
|
1810
1831
|
}
|
|
1811
|
-
async function
|
|
1832
|
+
async function bs(e) {
|
|
1812
1833
|
var n;
|
|
1813
1834
|
if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
|
|
1814
1835
|
await navigator.clipboard.writeText(e);
|
|
@@ -1824,7 +1845,7 @@ async function ys(e) {
|
|
|
1824
1845
|
document.body.removeChild(t);
|
|
1825
1846
|
}
|
|
1826
1847
|
}
|
|
1827
|
-
async function
|
|
1848
|
+
async function kt(e) {
|
|
1828
1849
|
let t;
|
|
1829
1850
|
try {
|
|
1830
1851
|
t = await e.json();
|
|
@@ -1837,8 +1858,8 @@ async function St(e) {
|
|
|
1837
1858
|
throw new Error(t.message || `响应缺少 data (${e.status})`);
|
|
1838
1859
|
return t.data;
|
|
1839
1860
|
}
|
|
1840
|
-
const
|
|
1841
|
-
function
|
|
1861
|
+
const Ct = "auth_user", $o = "token", Do = "answer_agent_callback_url", Ho = "realtime_ws_url", Ko = "/api/v1/mock/ask_user_answer_mock";
|
|
1862
|
+
function At(e) {
|
|
1842
1863
|
if (typeof window > "u") return null;
|
|
1843
1864
|
try {
|
|
1844
1865
|
return e === "localStorage" ? window.localStorage : window.sessionStorage;
|
|
@@ -1846,7 +1867,7 @@ function Ct(e) {
|
|
|
1846
1867
|
return null;
|
|
1847
1868
|
}
|
|
1848
1869
|
}
|
|
1849
|
-
function
|
|
1870
|
+
function _t(e) {
|
|
1850
1871
|
try {
|
|
1851
1872
|
const t = JSON.parse(e);
|
|
1852
1873
|
return !t || typeof t != "object" || Array.isArray(t) ? null : t;
|
|
@@ -1854,50 +1875,50 @@ function At(e) {
|
|
|
1854
1875
|
return null;
|
|
1855
1876
|
}
|
|
1856
1877
|
}
|
|
1857
|
-
function
|
|
1858
|
-
const n =
|
|
1878
|
+
function Jo(e, t) {
|
|
1879
|
+
const n = _t(e);
|
|
1859
1880
|
if (!n) return "";
|
|
1860
1881
|
const r = n[t];
|
|
1861
1882
|
return typeof r == "string" ? r.trim().replace(/^bearer\s+/i, "").trim() : "";
|
|
1862
1883
|
}
|
|
1863
|
-
function
|
|
1864
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
1884
|
+
function Go(e = {}) {
|
|
1885
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.answerAgentCallbackUrlField ?? Do, o = At(t);
|
|
1865
1886
|
if (!o) return "";
|
|
1866
1887
|
const i = o.getItem(n);
|
|
1867
1888
|
if (!i) return "";
|
|
1868
|
-
const s =
|
|
1889
|
+
const s = _t(i);
|
|
1869
1890
|
if (!s) return "";
|
|
1870
1891
|
const a = s[r];
|
|
1871
|
-
return (typeof a == "string" ? a.trim() : "") ||
|
|
1892
|
+
return (typeof a == "string" ? a.trim() : "") || Ko;
|
|
1872
1893
|
}
|
|
1873
|
-
function
|
|
1874
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
1894
|
+
function Wo(e = {}) {
|
|
1895
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.realtimeWsUrlField ?? Ho, o = At(t);
|
|
1875
1896
|
if (!o) return "";
|
|
1876
1897
|
const i = o.getItem(n);
|
|
1877
1898
|
if (!i) return "";
|
|
1878
|
-
const s =
|
|
1899
|
+
const s = _t(i);
|
|
1879
1900
|
if (!s) return "";
|
|
1880
1901
|
const a = s[r];
|
|
1881
1902
|
return typeof a == "string" ? a.trim() : "";
|
|
1882
1903
|
}
|
|
1883
|
-
function
|
|
1904
|
+
function Tt(e, t) {
|
|
1884
1905
|
return {
|
|
1885
|
-
...
|
|
1906
|
+
...Tn(t),
|
|
1886
1907
|
...e ?? {}
|
|
1887
1908
|
};
|
|
1888
1909
|
}
|
|
1889
|
-
function
|
|
1890
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
1910
|
+
function Tn(e = {}) {
|
|
1911
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? Ct, r = e.tokenField ?? $o, o = At(t);
|
|
1891
1912
|
if (!o) return {};
|
|
1892
1913
|
const i = o.getItem(n);
|
|
1893
1914
|
if (!i) return {};
|
|
1894
|
-
const s =
|
|
1915
|
+
const s = Jo(i, r);
|
|
1895
1916
|
return s ? { Authorization: `Bearer ${s}` } : {};
|
|
1896
1917
|
}
|
|
1897
|
-
async function
|
|
1898
|
-
return e.getHeaders ? await e.getHeaders() ?? {} :
|
|
1918
|
+
async function xt(e = {}) {
|
|
1919
|
+
return e.getHeaders ? await e.getHeaders() ?? {} : Tn(e.authStorage);
|
|
1899
1920
|
}
|
|
1900
|
-
function
|
|
1921
|
+
function Yo(e = {}) {
|
|
1901
1922
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
|
|
1902
1923
|
async function o(i) {
|
|
1903
1924
|
const s = new URLSearchParams();
|
|
@@ -1907,21 +1928,21 @@ function Wo(e = {}) {
|
|
|
1907
1928
|
s.set("form_unique_id", i.formUniqueId);
|
|
1908
1929
|
else
|
|
1909
1930
|
throw new Error("form_id 或 form_unique_id 至少传一个");
|
|
1910
|
-
const a = await
|
|
1931
|
+
const a = await xt(e), l = await r(`${t}${n}?${s.toString()}`, {
|
|
1911
1932
|
method: "GET",
|
|
1912
1933
|
headers: a
|
|
1913
|
-
}), c = await
|
|
1934
|
+
}), c = await kt(l), m = Eo(c.form_definition);
|
|
1914
1935
|
return {
|
|
1915
1936
|
formUniqueId: c.form_unique_id,
|
|
1916
1937
|
formId: c.form_id,
|
|
1917
1938
|
disabled: c.disabled === 1,
|
|
1918
1939
|
formDefinition: m,
|
|
1919
|
-
a2ui:
|
|
1940
|
+
a2ui: Io(c.form_definition) ?? void 0
|
|
1920
1941
|
};
|
|
1921
1942
|
}
|
|
1922
1943
|
return { fetchDetail: o };
|
|
1923
1944
|
}
|
|
1924
|
-
function
|
|
1945
|
+
function Qo(e) {
|
|
1925
1946
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1926
1947
|
return e ?? null;
|
|
1927
1948
|
const t = e;
|
|
@@ -1931,13 +1952,13 @@ function Yo(e) {
|
|
|
1931
1952
|
blocks: t.blocks
|
|
1932
1953
|
} : e;
|
|
1933
1954
|
}
|
|
1934
|
-
function
|
|
1955
|
+
function Mt({
|
|
1935
1956
|
context: e,
|
|
1936
1957
|
payload: t,
|
|
1937
1958
|
form: n,
|
|
1938
1959
|
answer: r
|
|
1939
1960
|
}) {
|
|
1940
|
-
const o =
|
|
1961
|
+
const o = Ve(t) ?? t, i = n ? Qo(n) : o;
|
|
1941
1962
|
return {
|
|
1942
1963
|
mission_id: e.missionId ?? null,
|
|
1943
1964
|
tenant_id: e.tenantId ?? null,
|
|
@@ -1950,7 +1971,7 @@ function xt({
|
|
|
1950
1971
|
answer: r
|
|
1951
1972
|
};
|
|
1952
1973
|
}
|
|
1953
|
-
function
|
|
1974
|
+
function Nt(e) {
|
|
1954
1975
|
const t = e.callback_url;
|
|
1955
1976
|
if (typeof t != "string" || !t.trim())
|
|
1956
1977
|
return "callback_url 为空,无法提交";
|
|
@@ -1965,34 +1986,34 @@ function Mt(e) {
|
|
|
1965
1986
|
const o = e.mission_id;
|
|
1966
1987
|
return o == null || o === "" ? "mission_id 缺失,无法提交" : null;
|
|
1967
1988
|
}
|
|
1968
|
-
function
|
|
1969
|
-
return
|
|
1970
|
-
|
|
1989
|
+
function Ss(e) {
|
|
1990
|
+
return Nt(
|
|
1991
|
+
Mt({
|
|
1971
1992
|
context: e,
|
|
1972
1993
|
payload: {},
|
|
1973
1994
|
answer: {}
|
|
1974
1995
|
})
|
|
1975
1996
|
);
|
|
1976
1997
|
}
|
|
1977
|
-
const
|
|
1978
|
-
function
|
|
1998
|
+
const Wt = "answer_agent_callback_url 未配置,无法提交";
|
|
1999
|
+
function Xo(e) {
|
|
1979
2000
|
if ((e == null ? void 0 : e.answerAgentCallbackUrl) != null) {
|
|
1980
2001
|
const n = e.answerAgentCallbackUrl.trim();
|
|
1981
2002
|
if (!n)
|
|
1982
|
-
throw new Error(
|
|
2003
|
+
throw new Error(Wt);
|
|
1983
2004
|
return n;
|
|
1984
2005
|
}
|
|
1985
|
-
const t =
|
|
2006
|
+
const t = Go(e == null ? void 0 : e.authStorage).trim();
|
|
1986
2007
|
if (!t)
|
|
1987
|
-
throw new Error(
|
|
2008
|
+
throw new Error(Wt);
|
|
1988
2009
|
return t;
|
|
1989
2010
|
}
|
|
1990
|
-
function
|
|
2011
|
+
function xn(e) {
|
|
1991
2012
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1992
2013
|
const n = e.data;
|
|
1993
2014
|
return !n || typeof n != "object" || Array.isArray(n) ? null : n;
|
|
1994
2015
|
}
|
|
1995
|
-
function
|
|
2016
|
+
function Zo(e, t) {
|
|
1996
2017
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
1997
2018
|
const n = t.message;
|
|
1998
2019
|
if (typeof n == "string" && n.trim())
|
|
@@ -2000,27 +2021,27 @@ function Xo(e, t) {
|
|
|
2000
2021
|
}
|
|
2001
2022
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
2002
2023
|
}
|
|
2003
|
-
function
|
|
2024
|
+
function ei(e) {
|
|
2004
2025
|
return `提交失败:${typeof e.error == "string" && e.error.trim() ? e.error.trim() : `回调 HTTP ${e.callback_status ?? "失败"}`}`;
|
|
2005
2026
|
}
|
|
2006
|
-
function
|
|
2007
|
-
const t =
|
|
2008
|
-
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message:
|
|
2027
|
+
function Mn(e) {
|
|
2028
|
+
const t = xn(e.body);
|
|
2029
|
+
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message: ei(t) } : e.ok ? { type: "success", message: "提交成功" } : {
|
|
2009
2030
|
type: "error",
|
|
2010
|
-
message:
|
|
2031
|
+
message: Zo(e.status, e.body)
|
|
2011
2032
|
};
|
|
2012
2033
|
}
|
|
2013
|
-
async function
|
|
2014
|
-
const n =
|
|
2034
|
+
async function Nn(e, t) {
|
|
2035
|
+
const n = Nt(e);
|
|
2015
2036
|
if (n)
|
|
2016
2037
|
throw new Error(n);
|
|
2017
|
-
const r =
|
|
2038
|
+
const r = Xo(t), o = await _n(r, e, {
|
|
2018
2039
|
...t,
|
|
2019
|
-
headers:
|
|
2020
|
-
}), i =
|
|
2040
|
+
headers: Tt(t == null ? void 0 : t.headers, t == null ? void 0 : t.authStorage)
|
|
2041
|
+
}), i = xn(o.body);
|
|
2021
2042
|
return o.ok && (i == null ? void 0 : i.callback_ok) === !1 ? { ok: !1, status: o.status, body: o.body } : o;
|
|
2022
2043
|
}
|
|
2023
|
-
function
|
|
2044
|
+
function ti(e) {
|
|
2024
2045
|
return {
|
|
2025
2046
|
resumeUniqueId: e.resume_unique_id,
|
|
2026
2047
|
resumeId: e.resume_id,
|
|
@@ -2041,7 +2062,7 @@ function ei(e) {
|
|
|
2041
2062
|
}))
|
|
2042
2063
|
};
|
|
2043
2064
|
}
|
|
2044
|
-
function
|
|
2065
|
+
function ni(e, t, n) {
|
|
2045
2066
|
const r = new URLSearchParams();
|
|
2046
2067
|
r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20));
|
|
2047
2068
|
for (const o of e.names ?? [])
|
|
@@ -2054,27 +2075,27 @@ function ti(e, t, n) {
|
|
|
2054
2075
|
r.append("published", String(o));
|
|
2055
2076
|
return r;
|
|
2056
2077
|
}
|
|
2057
|
-
function
|
|
2078
|
+
function ri(e = {}) {
|
|
2058
2079
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.searchPath ?? "/univ/resume/search", r = e.fetch ?? fetch, o = e.published ?? [1];
|
|
2059
2080
|
return async ({ filter: i, page: s }) => {
|
|
2060
|
-
const a = await
|
|
2081
|
+
const a = await xt(e), l = ni(i, s, o), c = await r(`${t}${n}?${l.toString()}`, {
|
|
2061
2082
|
method: "GET",
|
|
2062
2083
|
headers: a
|
|
2063
|
-
}), m = await
|
|
2084
|
+
}), m = await kt(c);
|
|
2064
2085
|
return {
|
|
2065
|
-
list: (m.list ?? []).map(
|
|
2086
|
+
list: (m.list ?? []).map(ti),
|
|
2066
2087
|
total: m.total ?? 0,
|
|
2067
2088
|
page: m.page ?? s,
|
|
2068
2089
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
2069
2090
|
};
|
|
2070
2091
|
};
|
|
2071
2092
|
}
|
|
2072
|
-
function
|
|
2093
|
+
function oi(e) {
|
|
2073
2094
|
var r, o, i, s;
|
|
2074
2095
|
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()));
|
|
2075
2096
|
return t || n;
|
|
2076
2097
|
}
|
|
2077
|
-
function
|
|
2098
|
+
function ii(e) {
|
|
2078
2099
|
return {
|
|
2079
2100
|
caseUniqueId: e.case_unique_id,
|
|
2080
2101
|
caseId: e.case_id,
|
|
@@ -2085,7 +2106,7 @@ function oi(e) {
|
|
|
2085
2106
|
description: e.description ?? void 0
|
|
2086
2107
|
};
|
|
2087
2108
|
}
|
|
2088
|
-
function
|
|
2109
|
+
function si(e, t, n) {
|
|
2089
2110
|
var o, i, s;
|
|
2090
2111
|
const r = new URLSearchParams();
|
|
2091
2112
|
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());
|
|
@@ -2093,24 +2114,24 @@ function ii(e, t, n) {
|
|
|
2093
2114
|
a && r.append("flow_unique_ids", a);
|
|
2094
2115
|
return r;
|
|
2095
2116
|
}
|
|
2096
|
-
function
|
|
2117
|
+
function ai(e = {}) {
|
|
2097
2118
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.listPath ?? "/univ/case/list", r = e.fetch ?? fetch, o = e.published ?? 1;
|
|
2098
2119
|
return async ({ filter: i, page: s }) => {
|
|
2099
|
-
if (!
|
|
2120
|
+
if (!oi(i))
|
|
2100
2121
|
return { list: [], total: 0, page: 1, pageSize: i.pageSize ?? 20 };
|
|
2101
|
-
const a = await
|
|
2122
|
+
const a = await xt(e), l = si(i, s, o), c = await r(`${t}${n}?${l.toString()}`, {
|
|
2102
2123
|
method: "GET",
|
|
2103
2124
|
headers: a
|
|
2104
|
-
}), m = await
|
|
2125
|
+
}), m = await kt(c);
|
|
2105
2126
|
return {
|
|
2106
|
-
list: (m.list ?? []).map(
|
|
2127
|
+
list: (m.list ?? []).map(ii),
|
|
2107
2128
|
total: m.total ?? 0,
|
|
2108
2129
|
page: m.page ?? s,
|
|
2109
2130
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
2110
2131
|
};
|
|
2111
2132
|
};
|
|
2112
2133
|
}
|
|
2113
|
-
function
|
|
2134
|
+
function ks(e = {}) {
|
|
2114
2135
|
var r, o, i, s, a;
|
|
2115
2136
|
const t = {
|
|
2116
2137
|
baseUrl: e.baseUrl,
|
|
@@ -2119,23 +2140,23 @@ function bs(e = {}) {
|
|
|
2119
2140
|
authStorage: e.authStorage
|
|
2120
2141
|
};
|
|
2121
2142
|
return {
|
|
2122
|
-
fetchDetail:
|
|
2143
|
+
fetchDetail: Yo({
|
|
2123
2144
|
...t,
|
|
2124
2145
|
detailPath: (r = e.form) == null ? void 0 : r.detailPath
|
|
2125
2146
|
}).fetchDetail,
|
|
2126
|
-
resumeSearch:
|
|
2147
|
+
resumeSearch: ri({
|
|
2127
2148
|
...t,
|
|
2128
2149
|
searchPath: (o = e.resume) == null ? void 0 : o.searchPath,
|
|
2129
2150
|
published: (i = e.resume) == null ? void 0 : i.published
|
|
2130
2151
|
}),
|
|
2131
|
-
caseSearch:
|
|
2152
|
+
caseSearch: ai({
|
|
2132
2153
|
...t,
|
|
2133
2154
|
listPath: (s = e.case) == null ? void 0 : s.listPath,
|
|
2134
2155
|
published: (a = e.case) == null ? void 0 : a.published
|
|
2135
2156
|
})
|
|
2136
2157
|
};
|
|
2137
2158
|
}
|
|
2138
|
-
function
|
|
2159
|
+
function In(e, t) {
|
|
2139
2160
|
if (!t.trim()) return !0;
|
|
2140
2161
|
try {
|
|
2141
2162
|
return new RegExp(t).test(e);
|
|
@@ -2143,44 +2164,44 @@ function xn(e, t) {
|
|
|
2143
2164
|
return !0;
|
|
2144
2165
|
}
|
|
2145
2166
|
}
|
|
2146
|
-
function
|
|
2167
|
+
function Fn(e) {
|
|
2147
2168
|
return e == null ? !0 : typeof e == "string" ? !e.trim() : !1;
|
|
2148
2169
|
}
|
|
2149
|
-
function
|
|
2170
|
+
function li(e, t) {
|
|
2150
2171
|
switch (e.type) {
|
|
2151
2172
|
case "multiselect":
|
|
2152
2173
|
case "checkbox":
|
|
2153
2174
|
case "file":
|
|
2154
2175
|
case "resume_multiselect":
|
|
2155
2176
|
case "case_multiselect":
|
|
2156
|
-
return
|
|
2177
|
+
return Q(t).length === 0;
|
|
2157
2178
|
case "toggle":
|
|
2158
2179
|
return !Te(t);
|
|
2159
2180
|
case "number":
|
|
2160
2181
|
return t == null || t === "";
|
|
2161
2182
|
default:
|
|
2162
|
-
return
|
|
2183
|
+
return Fn(t);
|
|
2163
2184
|
}
|
|
2164
2185
|
}
|
|
2165
|
-
function
|
|
2186
|
+
function it(e, t) {
|
|
2166
2187
|
return e.required === !0 || t > 0;
|
|
2167
2188
|
}
|
|
2168
|
-
function
|
|
2189
|
+
function ci(e, t) {
|
|
2169
2190
|
var n, r;
|
|
2170
2191
|
for (const o of e) {
|
|
2171
2192
|
const i = (n = o.name) == null ? void 0 : n.trim();
|
|
2172
2193
|
if (!i || Ce(o.type) || de(o.type)) continue;
|
|
2173
2194
|
const s = t[i], a = ((r = o.label) == null ? void 0 : r.trim()) || i;
|
|
2174
|
-
if (o.required &&
|
|
2195
|
+
if (o.required && li(o, s))
|
|
2175
2196
|
return { fieldName: i, label: a, message: `请填写「${a}」` };
|
|
2176
|
-
if (o.type === "email" && !
|
|
2197
|
+
if (o.type === "email" && !Fn(s)) {
|
|
2177
2198
|
const l = String(s).trim();
|
|
2178
|
-
if (!
|
|
2199
|
+
if (!In(l, yt))
|
|
2179
2200
|
return { fieldName: i, label: a, message: `「${a}」格式不正确` };
|
|
2180
2201
|
}
|
|
2181
2202
|
if (o.type === "file") {
|
|
2182
|
-
const l = o.fileMinCount ?? 0, c =
|
|
2183
|
-
if (l > 0 && c < l &&
|
|
2203
|
+
const l = o.fileMinCount ?? 0, c = Q(s).length;
|
|
2204
|
+
if (l > 0 && c < l && it(o, c))
|
|
2184
2205
|
return {
|
|
2185
2206
|
fieldName: i,
|
|
2186
2207
|
label: a,
|
|
@@ -2188,8 +2209,8 @@ function li(e, t) {
|
|
|
2188
2209
|
};
|
|
2189
2210
|
}
|
|
2190
2211
|
if (o.type === "resume_multiselect") {
|
|
2191
|
-
const l = o.resumeMinCount, c =
|
|
2192
|
-
if (l !== void 0 && c < l &&
|
|
2212
|
+
const l = o.resumeMinCount, c = Q(s).length;
|
|
2213
|
+
if (l !== void 0 && c < l && it(o, c))
|
|
2193
2214
|
return {
|
|
2194
2215
|
fieldName: i,
|
|
2195
2216
|
label: a,
|
|
@@ -2197,8 +2218,8 @@ function li(e, t) {
|
|
|
2197
2218
|
};
|
|
2198
2219
|
}
|
|
2199
2220
|
if (o.type === "case_multiselect") {
|
|
2200
|
-
const l = o.caseMinCount, c =
|
|
2201
|
-
if (l !== void 0 && c < l &&
|
|
2221
|
+
const l = o.caseMinCount, c = Q(s).length;
|
|
2222
|
+
if (l !== void 0 && c < l && it(o, c))
|
|
2202
2223
|
return {
|
|
2203
2224
|
fieldName: i,
|
|
2204
2225
|
label: a,
|
|
@@ -2208,20 +2229,20 @@ function li(e, t) {
|
|
|
2208
2229
|
}
|
|
2209
2230
|
return null;
|
|
2210
2231
|
}
|
|
2211
|
-
const
|
|
2212
|
-
video:
|
|
2213
|
-
audio:
|
|
2214
|
-
image:
|
|
2215
|
-
file:
|
|
2216
|
-
spreadsheet:
|
|
2217
|
-
document:
|
|
2232
|
+
const ui = {
|
|
2233
|
+
video: er,
|
|
2234
|
+
audio: Zn,
|
|
2235
|
+
image: Xn,
|
|
2236
|
+
file: Xt,
|
|
2237
|
+
spreadsheet: Qn,
|
|
2238
|
+
document: Qt
|
|
2218
2239
|
};
|
|
2219
|
-
function
|
|
2240
|
+
function mi({
|
|
2220
2241
|
type: e,
|
|
2221
2242
|
size: t = 40,
|
|
2222
2243
|
className: n
|
|
2223
2244
|
}) {
|
|
2224
|
-
const r =
|
|
2245
|
+
const r = ui[e] ?? Xt;
|
|
2225
2246
|
return /* @__PURE__ */ u(
|
|
2226
2247
|
r,
|
|
2227
2248
|
{
|
|
@@ -2231,7 +2252,7 @@ function ui({
|
|
|
2231
2252
|
}
|
|
2232
2253
|
);
|
|
2233
2254
|
}
|
|
2234
|
-
const
|
|
2255
|
+
const En = "skopon-form-v0_9", di = /* @__PURE__ */ new Set([
|
|
2235
2256
|
"SkoponMedia",
|
|
2236
2257
|
"SkoponSelect",
|
|
2237
2258
|
"Image",
|
|
@@ -2243,24 +2264,24 @@ const Nn = "skopon-form-v0_9", mi = /* @__PURE__ */ new Set([
|
|
|
2243
2264
|
"FileUpload",
|
|
2244
2265
|
"TextField",
|
|
2245
2266
|
"Text",
|
|
2246
|
-
...
|
|
2247
|
-
]),
|
|
2267
|
+
...bo()
|
|
2268
|
+
]), fi = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
|
|
2248
2269
|
function xe(e) {
|
|
2249
|
-
const t = [...
|
|
2270
|
+
const t = [...Ue.components.values()].find((n) => n.name === e);
|
|
2250
2271
|
if (!t) throw new Error(`Missing basic catalog component: ${e}`);
|
|
2251
2272
|
return t.schema;
|
|
2252
2273
|
}
|
|
2253
|
-
function
|
|
2274
|
+
function U(e) {
|
|
2254
2275
|
return typeof e == "string" ? e : "";
|
|
2255
2276
|
}
|
|
2256
|
-
function
|
|
2277
|
+
function Un(e) {
|
|
2257
2278
|
return Array.isArray(e) ? e.map((t) => {
|
|
2258
2279
|
if (!t || typeof t != "object") return null;
|
|
2259
2280
|
const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
|
|
2260
2281
|
return { value: r, label: o };
|
|
2261
2282
|
}).filter((t) => !!t) : [];
|
|
2262
2283
|
}
|
|
2263
|
-
function
|
|
2284
|
+
function Le({
|
|
2264
2285
|
mediaType: e,
|
|
2265
2286
|
urls: t,
|
|
2266
2287
|
mediaSize: n,
|
|
@@ -2268,7 +2289,7 @@ function Ve({
|
|
|
2268
2289
|
help: o,
|
|
2269
2290
|
placeholder: i
|
|
2270
2291
|
}) {
|
|
2271
|
-
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l =
|
|
2292
|
+
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l = _r(n), c = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
|
|
2272
2293
|
return /* @__PURE__ */ M("div", { className: "form-block-preview", children: [
|
|
2273
2294
|
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2274
2295
|
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(
|
|
@@ -2300,17 +2321,17 @@ function Ve({
|
|
|
2300
2321
|
] });
|
|
2301
2322
|
}
|
|
2302
2323
|
function je(e, t) {
|
|
2303
|
-
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) :
|
|
2324
|
+
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : U(e.url).trim() ? [U(e.url).trim()] : [];
|
|
2304
2325
|
return {
|
|
2305
2326
|
mediaType: t,
|
|
2306
2327
|
urls: n,
|
|
2307
2328
|
mediaSize: _e(e.mediaSize),
|
|
2308
|
-
label:
|
|
2309
|
-
help:
|
|
2310
|
-
placeholder:
|
|
2329
|
+
label: U(e.label) || U(e.description),
|
|
2330
|
+
help: U(e.help),
|
|
2331
|
+
placeholder: U(e.placeholder)
|
|
2311
2332
|
};
|
|
2312
2333
|
}
|
|
2313
|
-
const
|
|
2334
|
+
const pi = {
|
|
2314
2335
|
name: "SkoponMedia",
|
|
2315
2336
|
schema: h.object({
|
|
2316
2337
|
mediaType: h.any().optional(),
|
|
@@ -2320,19 +2341,19 @@ const fi = {
|
|
|
2320
2341
|
help: h.any().optional(),
|
|
2321
2342
|
placeholder: h.any().optional()
|
|
2322
2343
|
}).passthrough()
|
|
2323
|
-
},
|
|
2324
|
-
const t = e.componentModel.properties, n =
|
|
2325
|
-
return /* @__PURE__ */ u(
|
|
2326
|
-
}),
|
|
2344
|
+
}, hi = X(pi, ({ context: e }) => {
|
|
2345
|
+
const t = e.componentModel.properties, n = U(t.mediaType);
|
|
2346
|
+
return /* @__PURE__ */ u(Le, { ...je(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
|
|
2347
|
+
}), gi = X(
|
|
2327
2348
|
{ name: "Image", schema: xe("Image") },
|
|
2328
|
-
({ context: e }) => /* @__PURE__ */ u(
|
|
2329
|
-
),
|
|
2349
|
+
({ context: e }) => /* @__PURE__ */ u(Le, { ...je(e.componentModel.properties, "image") })
|
|
2350
|
+
), yi = X(
|
|
2330
2351
|
{ name: "Video", schema: xe("Video") },
|
|
2331
|
-
({ context: e }) => /* @__PURE__ */ u(
|
|
2332
|
-
),
|
|
2352
|
+
({ context: e }) => /* @__PURE__ */ u(Le, { ...je(e.componentModel.properties, "video") })
|
|
2353
|
+
), vi = X(
|
|
2333
2354
|
{ name: "AudioPlayer", schema: xe("AudioPlayer") },
|
|
2334
|
-
({ context: e }) => /* @__PURE__ */ u(
|
|
2335
|
-
),
|
|
2355
|
+
({ context: e }) => /* @__PURE__ */ u(Le, { ...je(e.componentModel.properties, "audio") })
|
|
2356
|
+
), bi = {
|
|
2336
2357
|
name: "SkoponSelect",
|
|
2337
2358
|
schema: h.object({
|
|
2338
2359
|
label: h.any().optional(),
|
|
@@ -2342,18 +2363,18 @@ const fi = {
|
|
|
2342
2363
|
value: h.any().optional()
|
|
2343
2364
|
}).passthrough()
|
|
2344
2365
|
};
|
|
2345
|
-
function
|
|
2366
|
+
function Si({ context: e }) {
|
|
2346
2367
|
const { interactive: t } = se(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = ae(e, "value", {
|
|
2347
2368
|
component: "SkoponSelect",
|
|
2348
2369
|
changeAction: "select"
|
|
2349
|
-
}), s = e.componentModel.properties, a =
|
|
2350
|
-
return
|
|
2351
|
-
const d =
|
|
2370
|
+
}), s = e.componentModel.properties, a = U(s.label), l = U(s.placeholder), c = Un(s.options), m = U(s.mode) === "multiple";
|
|
2371
|
+
return q(() => {
|
|
2372
|
+
const d = dn(n, m);
|
|
2352
2373
|
d !== null && o(d);
|
|
2353
2374
|
}, [m, n, o]), /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2354
2375
|
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2355
2376
|
/* @__PURE__ */ u(
|
|
2356
|
-
|
|
2377
|
+
st,
|
|
2357
2378
|
{
|
|
2358
2379
|
mode: m ? "multiple" : void 0,
|
|
2359
2380
|
disabled: !t,
|
|
@@ -2362,28 +2383,28 @@ function bi({ context: e }) {
|
|
|
2362
2383
|
style: { width: "100%" },
|
|
2363
2384
|
placeholder: l || (m ? "请选择多项" : "请选择"),
|
|
2364
2385
|
options: c,
|
|
2365
|
-
value: m ?
|
|
2386
|
+
value: m ? Q(n) : ve(n),
|
|
2366
2387
|
onChange: (d) => r(m ? d ?? [] : d ?? "")
|
|
2367
2388
|
}
|
|
2368
2389
|
)
|
|
2369
2390
|
] });
|
|
2370
2391
|
}
|
|
2371
|
-
const
|
|
2372
|
-
|
|
2373
|
-
|
|
2392
|
+
const ki = X(
|
|
2393
|
+
bi,
|
|
2394
|
+
Si
|
|
2374
2395
|
);
|
|
2375
|
-
function
|
|
2396
|
+
function Ci({ context: e }) {
|
|
2376
2397
|
const { interactive: t } = se(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = ae(e, "value", {
|
|
2377
2398
|
component: "ChoicePicker",
|
|
2378
2399
|
changeAction: "select"
|
|
2379
|
-
}), s = e.componentModel.properties, a =
|
|
2380
|
-
return
|
|
2381
|
-
const y =
|
|
2400
|
+
}), s = e.componentModel.properties, a = U(s.label), l = U(s.variant) || "mutuallyExclusive", c = U(s.skoponPickerType), m = U(s.placeholder), d = Un(s.options), g = c === "select" || c === "multiselect" || c === "radio" || c === "checkbox" ? c : l === "multipleSelection" ? "checkbox" : "radio", S = g === "multiselect" || g === "checkbox";
|
|
2401
|
+
return q(() => {
|
|
2402
|
+
const y = dn(n, S);
|
|
2382
2403
|
y !== null && o(y);
|
|
2383
2404
|
}, [S, n, o]), /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2384
2405
|
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2385
2406
|
g === "select" ? /* @__PURE__ */ u(
|
|
2386
|
-
|
|
2407
|
+
st,
|
|
2387
2408
|
{
|
|
2388
2409
|
disabled: !t,
|
|
2389
2410
|
allowClear: !0,
|
|
@@ -2395,7 +2416,7 @@ function ki({ context: e }) {
|
|
|
2395
2416
|
onChange: (y) => r(y ?? "")
|
|
2396
2417
|
}
|
|
2397
2418
|
) : g === "multiselect" ? /* @__PURE__ */ u(
|
|
2398
|
-
|
|
2419
|
+
st,
|
|
2399
2420
|
{
|
|
2400
2421
|
mode: "multiple",
|
|
2401
2422
|
disabled: !t,
|
|
@@ -2404,20 +2425,20 @@ function ki({ context: e }) {
|
|
|
2404
2425
|
style: { width: "100%" },
|
|
2405
2426
|
placeholder: m || "请选择多项",
|
|
2406
2427
|
options: d,
|
|
2407
|
-
value:
|
|
2428
|
+
value: Q(n),
|
|
2408
2429
|
onChange: (y) => r(y ?? [])
|
|
2409
2430
|
}
|
|
2410
2431
|
) : g === "checkbox" ? /* @__PURE__ */ u(
|
|
2411
|
-
|
|
2432
|
+
jn.Group,
|
|
2412
2433
|
{
|
|
2413
2434
|
disabled: !t,
|
|
2414
2435
|
className: "form-block-preview-control",
|
|
2415
2436
|
options: d,
|
|
2416
|
-
value:
|
|
2437
|
+
value: Q(n),
|
|
2417
2438
|
onChange: (y) => r(y)
|
|
2418
2439
|
}
|
|
2419
2440
|
) : /* @__PURE__ */ u(
|
|
2420
|
-
|
|
2441
|
+
$n.Group,
|
|
2421
2442
|
{
|
|
2422
2443
|
disabled: !t,
|
|
2423
2444
|
className: "form-block-preview-control",
|
|
@@ -2428,7 +2449,7 @@ function ki({ context: e }) {
|
|
|
2428
2449
|
)
|
|
2429
2450
|
] });
|
|
2430
2451
|
}
|
|
2431
|
-
const
|
|
2452
|
+
const Ai = X(
|
|
2432
2453
|
{
|
|
2433
2454
|
name: "ChoicePicker",
|
|
2434
2455
|
schema: h.object({
|
|
@@ -2440,17 +2461,17 @@ const Ci = Q(
|
|
|
2440
2461
|
placeholder: h.any().optional()
|
|
2441
2462
|
}).passthrough()
|
|
2442
2463
|
},
|
|
2443
|
-
|
|
2464
|
+
Ci
|
|
2444
2465
|
);
|
|
2445
|
-
function
|
|
2466
|
+
function _i({ context: e }) {
|
|
2446
2467
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o } = ae(e, "value", {
|
|
2447
2468
|
component: "CheckBox",
|
|
2448
2469
|
changeAction: "change"
|
|
2449
|
-
}), i = e.componentModel.properties, s =
|
|
2470
|
+
}), i = e.componentModel.properties, s = U(i.label);
|
|
2450
2471
|
return /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2451
2472
|
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2452
2473
|
/* @__PURE__ */ u(
|
|
2453
|
-
|
|
2474
|
+
Dn,
|
|
2454
2475
|
{
|
|
2455
2476
|
disabled: !t,
|
|
2456
2477
|
className: "form-block-preview-control",
|
|
@@ -2460,25 +2481,25 @@ function Ai({ context: e }) {
|
|
|
2460
2481
|
)
|
|
2461
2482
|
] });
|
|
2462
2483
|
}
|
|
2463
|
-
const
|
|
2484
|
+
const Ti = X(
|
|
2464
2485
|
{ name: "CheckBox", schema: xe("CheckBox") },
|
|
2465
|
-
|
|
2486
|
+
_i
|
|
2466
2487
|
);
|
|
2467
|
-
function
|
|
2488
|
+
function xi(e, t, n) {
|
|
2468
2489
|
const r = ve(e);
|
|
2469
2490
|
if (!r) return;
|
|
2470
2491
|
if (!t && n) {
|
|
2471
|
-
const i =
|
|
2492
|
+
const i = jt(r, "HH:mm", !0);
|
|
2472
2493
|
return i.isValid() ? i : void 0;
|
|
2473
2494
|
}
|
|
2474
|
-
const o =
|
|
2495
|
+
const o = jt(r);
|
|
2475
2496
|
return o.isValid() ? o : void 0;
|
|
2476
2497
|
}
|
|
2477
|
-
function
|
|
2498
|
+
function Mi({ context: e }) {
|
|
2478
2499
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o, reportFocus: i } = ae(e, "value", {
|
|
2479
2500
|
component: "DateTimeInput",
|
|
2480
2501
|
changeAction: "change"
|
|
2481
|
-
}), s = e.componentModel.properties, a =
|
|
2502
|
+
}), s = e.componentModel.properties, a = U(s.label), l = U(s.placeholder), c = s.enableDate === !0, m = s.enableTime === !0, d = xi(n, c, m), b = (g) => {
|
|
2482
2503
|
if (!g) {
|
|
2483
2504
|
r("");
|
|
2484
2505
|
return;
|
|
@@ -2496,7 +2517,7 @@ function xi({ context: e }) {
|
|
|
2496
2517
|
return /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2497
2518
|
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2498
2519
|
!c && m ? /* @__PURE__ */ u(
|
|
2499
|
-
|
|
2520
|
+
Hn,
|
|
2500
2521
|
{
|
|
2501
2522
|
disabled: !t,
|
|
2502
2523
|
className: "form-block-preview-control",
|
|
@@ -2507,7 +2528,7 @@ function xi({ context: e }) {
|
|
|
2507
2528
|
onFocus: i
|
|
2508
2529
|
}
|
|
2509
2530
|
) : /* @__PURE__ */ u(
|
|
2510
|
-
|
|
2531
|
+
Kn,
|
|
2511
2532
|
{
|
|
2512
2533
|
showTime: c && m,
|
|
2513
2534
|
disabled: !t,
|
|
@@ -2521,7 +2542,7 @@ function xi({ context: e }) {
|
|
|
2521
2542
|
)
|
|
2522
2543
|
] });
|
|
2523
2544
|
}
|
|
2524
|
-
const
|
|
2545
|
+
const Ni = X(
|
|
2525
2546
|
{
|
|
2526
2547
|
name: "DateTimeInput",
|
|
2527
2548
|
schema: h.object({
|
|
@@ -2534,8 +2555,8 @@ const Mi = Q(
|
|
|
2534
2555
|
max: h.any().optional()
|
|
2535
2556
|
}).passthrough()
|
|
2536
2557
|
},
|
|
2537
|
-
|
|
2538
|
-
),
|
|
2558
|
+
Mi
|
|
2559
|
+
), Ii = {
|
|
2539
2560
|
name: "FileUpload",
|
|
2540
2561
|
schema: h.object({
|
|
2541
2562
|
label: h.any().optional(),
|
|
@@ -2547,20 +2568,20 @@ const Mi = Q(
|
|
|
2547
2568
|
value: h.any().optional()
|
|
2548
2569
|
}).passthrough()
|
|
2549
2570
|
};
|
|
2550
|
-
function
|
|
2571
|
+
function Fi({ context: e }) {
|
|
2551
2572
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o } = ae(e, "value", {
|
|
2552
2573
|
component: "FileUpload",
|
|
2553
2574
|
changeAction: "change"
|
|
2554
|
-
}), i = e.componentModel.properties, s =
|
|
2575
|
+
}), i = e.componentModel.properties, s = U(i.label), a = U(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 = yr(l, c), d = typeof i.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
|
|
2555
2576
|
i.filePlaceholderIcon
|
|
2556
|
-
) ? i.filePlaceholderIcon : "document", b = typeof i.minCount == "number" ? Math.max(0, i.minCount) : 0, g = typeof i.maxCount == "number" ? i.maxCount : 1, S = g > 0, y =
|
|
2577
|
+
) ? i.filePlaceholderIcon : "document", b = typeof i.minCount == "number" ? Math.max(0, i.minCount) : 0, g = typeof i.maxCount == "number" ? i.maxCount : 1, S = g > 0, y = Q(n), k = S && y.length >= g, p = y.length < b;
|
|
2557
2578
|
return /* @__PURE__ */ M("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2558
2579
|
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2559
2580
|
/* @__PURE__ */ M(
|
|
2560
|
-
|
|
2581
|
+
Ye.Dragger,
|
|
2561
2582
|
{
|
|
2562
2583
|
disabled: !t || k,
|
|
2563
|
-
accept:
|
|
2584
|
+
accept: gr(l, c),
|
|
2564
2585
|
className: "form-file-upload-preview",
|
|
2565
2586
|
showUploadList: t && y.length > 0,
|
|
2566
2587
|
fileList: t ? y.map((f, v) => ({
|
|
@@ -2569,19 +2590,19 @@ function Ii({ context: e }) {
|
|
|
2569
2590
|
status: "done"
|
|
2570
2591
|
})) : [],
|
|
2571
2592
|
beforeUpload: (f) => {
|
|
2572
|
-
if (!t) return
|
|
2573
|
-
const v =
|
|
2574
|
-
if (S && v.length >= g) return
|
|
2593
|
+
if (!t) return Ye.LIST_IGNORE;
|
|
2594
|
+
const v = Q(Ht(e));
|
|
2595
|
+
if (S && v.length >= g) return Ye.LIST_IGNORE;
|
|
2575
2596
|
const x = S ? [...v, f.name].slice(0, g) : [...v, f.name];
|
|
2576
2597
|
return r(x), !1;
|
|
2577
2598
|
},
|
|
2578
2599
|
onRemove: (f) => {
|
|
2579
|
-
const v =
|
|
2600
|
+
const v = Q(Ht(e)), x = /^(\d+)-/.exec(f.uid ?? ""), N = x ? Number(x[1]) : -1, _ = N >= 0 && N < v.length ? v.filter((w, C) => C !== N) : v.filter((w) => w !== f.name);
|
|
2580
2601
|
if (_.length < b) return !1;
|
|
2581
2602
|
r(_);
|
|
2582
2603
|
},
|
|
2583
2604
|
children: [
|
|
2584
|
-
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ u(
|
|
2605
|
+
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ u(mi, { type: d, size: 40 }) }),
|
|
2585
2606
|
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
|
|
2586
2607
|
]
|
|
2587
2608
|
}
|
|
@@ -2596,30 +2617,30 @@ function Ii({ context: e }) {
|
|
|
2596
2617
|
] })
|
|
2597
2618
|
] });
|
|
2598
2619
|
}
|
|
2599
|
-
const
|
|
2600
|
-
|
|
2601
|
-
|
|
2620
|
+
const Ei = X(
|
|
2621
|
+
Ii,
|
|
2622
|
+
Fi
|
|
2602
2623
|
);
|
|
2603
|
-
function
|
|
2624
|
+
function Ui({ context: e }) {
|
|
2604
2625
|
const { interactive: t } = se(), { value: n, setValue: r, fieldName: o, reportFocus: i } = ae(e, "value", {
|
|
2605
2626
|
component: "TextField",
|
|
2606
2627
|
changeAction: "change",
|
|
2607
2628
|
debounceChange: !0
|
|
2608
|
-
}), s = e.componentModel.properties, a =
|
|
2629
|
+
}), s = e.componentModel.properties, a = U(s.label), l = U(s.placeholder), c = U(s.variant) || "shortText", m = U(s.validationRegexp), d = ve(n) ?? "", b = !t, [g, S] = P(""), y = (f) => {
|
|
2609
2630
|
if (!m || !f.trim()) {
|
|
2610
2631
|
S("");
|
|
2611
2632
|
return;
|
|
2612
2633
|
}
|
|
2613
|
-
S(
|
|
2634
|
+
S(In(f, m) ? "" : "格式不正确");
|
|
2614
2635
|
};
|
|
2615
|
-
|
|
2636
|
+
q(() => {
|
|
2616
2637
|
y(d);
|
|
2617
2638
|
}, [m, d]);
|
|
2618
2639
|
const k = "form-block-preview-control";
|
|
2619
2640
|
let p;
|
|
2620
2641
|
if (c === "longText")
|
|
2621
2642
|
p = /* @__PURE__ */ u(
|
|
2622
|
-
|
|
2643
|
+
Qe.TextArea,
|
|
2623
2644
|
{
|
|
2624
2645
|
disabled: b,
|
|
2625
2646
|
className: k,
|
|
@@ -2638,7 +2659,7 @@ function Ei({ context: e }) {
|
|
|
2638
2659
|
else if (c === "number") {
|
|
2639
2660
|
const f = d && Number.isFinite(Number(d)) ? Number(d) : void 0;
|
|
2640
2661
|
p = /* @__PURE__ */ u(
|
|
2641
|
-
|
|
2662
|
+
Jn,
|
|
2642
2663
|
{
|
|
2643
2664
|
disabled: b,
|
|
2644
2665
|
className: k,
|
|
@@ -2650,7 +2671,7 @@ function Ei({ context: e }) {
|
|
|
2650
2671
|
}
|
|
2651
2672
|
);
|
|
2652
2673
|
} else c === "obscured" ? p = /* @__PURE__ */ u(
|
|
2653
|
-
|
|
2674
|
+
Qe.Password,
|
|
2654
2675
|
{
|
|
2655
2676
|
disabled: b,
|
|
2656
2677
|
className: k,
|
|
@@ -2660,7 +2681,7 @@ function Ei({ context: e }) {
|
|
|
2660
2681
|
onFocus: i
|
|
2661
2682
|
}
|
|
2662
2683
|
) : p = /* @__PURE__ */ u(
|
|
2663
|
-
|
|
2684
|
+
Qe,
|
|
2664
2685
|
{
|
|
2665
2686
|
disabled: b,
|
|
2666
2687
|
className: k,
|
|
@@ -2681,7 +2702,7 @@ function Ei({ context: e }) {
|
|
|
2681
2702
|
g ? /* @__PURE__ */ u(ne.Text, { type: "danger", className: "form-block-preview-help", children: g }) : null
|
|
2682
2703
|
] });
|
|
2683
2704
|
}
|
|
2684
|
-
const
|
|
2705
|
+
const Ri = X(
|
|
2685
2706
|
{
|
|
2686
2707
|
name: "TextField",
|
|
2687
2708
|
schema: h.object({
|
|
@@ -2692,35 +2713,35 @@ const Ui = Q(
|
|
|
2692
2713
|
value: h.any().optional()
|
|
2693
2714
|
}).passthrough()
|
|
2694
2715
|
},
|
|
2695
|
-
|
|
2716
|
+
Ui
|
|
2696
2717
|
);
|
|
2697
|
-
function
|
|
2698
|
-
const t = e.componentModel.properties, n =
|
|
2699
|
-
return
|
|
2718
|
+
function Pi({ context: e }) {
|
|
2719
|
+
const t = e.componentModel.properties, n = U(t.text), r = U(t.variant) || "body";
|
|
2720
|
+
return fi.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 });
|
|
2700
2721
|
}
|
|
2701
|
-
const
|
|
2722
|
+
const wi = X(
|
|
2702
2723
|
{ name: "Text", schema: xe("Text") },
|
|
2703
|
-
|
|
2724
|
+
Pi
|
|
2704
2725
|
);
|
|
2705
|
-
function
|
|
2726
|
+
function Rn() {
|
|
2706
2727
|
const t = [
|
|
2707
|
-
...[...
|
|
2708
|
-
(r) => !
|
|
2728
|
+
...[...Ue.components.values()].filter(
|
|
2729
|
+
(r) => !di.has(r.name)
|
|
2709
2730
|
),
|
|
2710
|
-
pi,
|
|
2711
|
-
Si,
|
|
2712
2731
|
hi,
|
|
2732
|
+
ki,
|
|
2713
2733
|
gi,
|
|
2714
2734
|
yi,
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2735
|
+
vi,
|
|
2736
|
+
Ai,
|
|
2737
|
+
Ti,
|
|
2738
|
+
Ni,
|
|
2739
|
+
Ei,
|
|
2740
|
+
Ri,
|
|
2741
|
+
wi,
|
|
2742
|
+
...vo()
|
|
2743
|
+
], n = [...Ue.functions.values()];
|
|
2744
|
+
return new tr(En, t, n, Ue.themeSchema);
|
|
2724
2745
|
}
|
|
2725
2746
|
const ie = {
|
|
2726
2747
|
jade9: "#29a383",
|
|
@@ -2734,7 +2755,7 @@ const ie = {
|
|
|
2734
2755
|
primaryHover: "#26997b",
|
|
2735
2756
|
primaryActive: "#1d3b31",
|
|
2736
2757
|
onPrimary: "#ffffff"
|
|
2737
|
-
},
|
|
2758
|
+
}, zi = {
|
|
2738
2759
|
cssVar: { key: "vidtempl" },
|
|
2739
2760
|
token: {
|
|
2740
2761
|
colorPrimary: ie.primarySolid,
|
|
@@ -2824,9 +2845,9 @@ function be({
|
|
|
2824
2845
|
locale: t,
|
|
2825
2846
|
theme: n
|
|
2826
2847
|
}) {
|
|
2827
|
-
return /* @__PURE__ */ u(
|
|
2848
|
+
return /* @__PURE__ */ u(Gn, { theme: n ?? zi, locale: t, children: e });
|
|
2828
2849
|
}
|
|
2829
|
-
const
|
|
2850
|
+
const Oi = Bn(
|
|
2830
2851
|
function({
|
|
2831
2852
|
doc: t,
|
|
2832
2853
|
surfaceId: n = "skopon-form",
|
|
@@ -2837,25 +2858,25 @@ const zi = zn(
|
|
|
2837
2858
|
caseSearch: a = null,
|
|
2838
2859
|
wrapProvider: l = !0
|
|
2839
2860
|
}, c) {
|
|
2840
|
-
|
|
2841
|
-
|
|
2861
|
+
q(() => {
|
|
2862
|
+
nn(), tn();
|
|
2842
2863
|
}, []);
|
|
2843
2864
|
const m = A(null), d = A(i);
|
|
2844
2865
|
d.current = i;
|
|
2845
|
-
const b =
|
|
2846
|
-
if (
|
|
2866
|
+
const b = L(() => {
|
|
2867
|
+
if (dt(t)) return "";
|
|
2847
2868
|
try {
|
|
2848
2869
|
return JSON.stringify(t);
|
|
2849
2870
|
} catch {
|
|
2850
2871
|
return String(t);
|
|
2851
2872
|
}
|
|
2852
|
-
}, [t]), g =
|
|
2873
|
+
}, [t]), g = L(() => {
|
|
2853
2874
|
if (!b)
|
|
2854
2875
|
return { surfaces: [], processor: null };
|
|
2855
2876
|
try {
|
|
2856
|
-
const p = JSON.parse(b), f = new
|
|
2877
|
+
const p = JSON.parse(b), f = new en([Rn()]), v = No(p, {
|
|
2857
2878
|
surfaceId: n,
|
|
2858
|
-
catalogId:
|
|
2879
|
+
catalogId: En
|
|
2859
2880
|
});
|
|
2860
2881
|
return f.processMessages(v), {
|
|
2861
2882
|
surfaces: Array.from(f.model.surfacesMap.values()),
|
|
@@ -2865,14 +2886,14 @@ const zi = zn(
|
|
|
2865
2886
|
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", p), { surfaces: [], processor: null };
|
|
2866
2887
|
}
|
|
2867
2888
|
}, [b, n]), { surfaces: S, processor: y } = g;
|
|
2868
|
-
if (m.current = y,
|
|
2889
|
+
if (m.current = y, Vn(
|
|
2869
2890
|
c,
|
|
2870
2891
|
() => ({
|
|
2871
2892
|
getValues(p) {
|
|
2872
2893
|
const f = m.current;
|
|
2873
2894
|
if (!f) return {};
|
|
2874
2895
|
const v = (p ?? d.current).map((x) => x.trim()).filter(Boolean);
|
|
2875
|
-
return
|
|
2896
|
+
return Uo(f, n, v);
|
|
2876
2897
|
},
|
|
2877
2898
|
setValues(p) {
|
|
2878
2899
|
const f = m.current;
|
|
@@ -2887,17 +2908,17 @@ const zi = zn(
|
|
|
2887
2908
|
}),
|
|
2888
2909
|
[n]
|
|
2889
2910
|
), S.length === 0) {
|
|
2890
|
-
const p = /* @__PURE__ */ u(
|
|
2911
|
+
const p = /* @__PURE__ */ u(ct, { resumeSearch: s, children: /* @__PURE__ */ u(lt, { caseSearch: a, children: /* @__PURE__ */ u(at, { interactive: o, children: r }) }) });
|
|
2891
2912
|
return l ? /* @__PURE__ */ u(be, { children: p }) : p;
|
|
2892
2913
|
}
|
|
2893
|
-
const k = /* @__PURE__ */ u(
|
|
2914
|
+
const k = /* @__PURE__ */ u(ct, { resumeSearch: s, children: /* @__PURE__ */ u(lt, { caseSearch: a, children: /* @__PURE__ */ u(at, { interactive: o, children: /* @__PURE__ */ u("div", { className: "a2ui-surface a2ui-container", children: S.map((p) => /* @__PURE__ */ u(Zt, { surface: p }, p.id)) }) }) }) });
|
|
2894
2915
|
return l ? /* @__PURE__ */ u(be, { children: k }) : k;
|
|
2895
2916
|
}
|
|
2896
2917
|
);
|
|
2897
|
-
function
|
|
2898
|
-
return new
|
|
2918
|
+
function Ee() {
|
|
2919
|
+
return new en([Rn()]);
|
|
2899
2920
|
}
|
|
2900
|
-
function
|
|
2921
|
+
function Cs({
|
|
2901
2922
|
messages: e,
|
|
2902
2923
|
surfaceId: t = "skopon-form-stream",
|
|
2903
2924
|
emptyHint: n = null,
|
|
@@ -2905,11 +2926,11 @@ function Ss({
|
|
|
2905
2926
|
resumeSearch: o = null,
|
|
2906
2927
|
caseSearch: i = null
|
|
2907
2928
|
}) {
|
|
2908
|
-
|
|
2909
|
-
|
|
2929
|
+
q(() => {
|
|
2930
|
+
nn(), tn();
|
|
2910
2931
|
}, []);
|
|
2911
2932
|
const s = A(null);
|
|
2912
|
-
s.current === null && (s.current =
|
|
2933
|
+
s.current === null && (s.current = Ee());
|
|
2913
2934
|
const a = A(0), l = A(""), c = A(!0), m = A(t);
|
|
2914
2935
|
function d(p, f) {
|
|
2915
2936
|
s.current = p, a.current = f.length, l.current = JSON.stringify(f), c.current && (S(p), k(Array.from(p.model.surfacesMap.values())));
|
|
@@ -2925,36 +2946,36 @@ function Ss({
|
|
|
2925
2946
|
return !0;
|
|
2926
2947
|
}
|
|
2927
2948
|
}
|
|
2928
|
-
const [g, S] =
|
|
2949
|
+
const [g, S] = P(
|
|
2929
2950
|
() => s.current
|
|
2930
|
-
), [y, k] =
|
|
2951
|
+
), [y, k] = P(
|
|
2931
2952
|
() => Array.from(
|
|
2932
2953
|
s.current.model.surfacesMap.values()
|
|
2933
2954
|
)
|
|
2934
2955
|
);
|
|
2935
|
-
return
|
|
2956
|
+
return q(() => (c.current = !0, () => {
|
|
2936
2957
|
c.current = !1;
|
|
2937
|
-
}), []),
|
|
2958
|
+
}), []), q(() => {
|
|
2938
2959
|
s.current = g;
|
|
2939
|
-
}, [g]),
|
|
2960
|
+
}, [g]), q(() => {
|
|
2940
2961
|
const p = () => {
|
|
2941
2962
|
c.current && k(Array.from(g.model.surfacesMap.values()));
|
|
2942
2963
|
}, f = g.onSurfaceCreated(p), v = g.onSurfaceDeleted(p);
|
|
2943
2964
|
return () => {
|
|
2944
2965
|
f.unsubscribe(), v.unsubscribe();
|
|
2945
2966
|
};
|
|
2946
|
-
}, [g]),
|
|
2967
|
+
}, [g]), q(() => {
|
|
2947
2968
|
let p = !1;
|
|
2948
2969
|
const f = m.current !== t;
|
|
2949
2970
|
if (m.current = t, f) {
|
|
2950
|
-
const _ =
|
|
2971
|
+
const _ = Ee();
|
|
2951
2972
|
return Array.isArray(e) && e.length > 0 ? (_.processMessages(e), p || d(_, e)) : (s.current = _, a.current = 0, l.current = "", p || (S(_), k([]))), () => {
|
|
2952
2973
|
p = !0;
|
|
2953
2974
|
};
|
|
2954
2975
|
}
|
|
2955
2976
|
if (!Array.isArray(e) || e.length === 0) {
|
|
2956
2977
|
if (a.current > 0) {
|
|
2957
|
-
const _ =
|
|
2978
|
+
const _ = Ee();
|
|
2958
2979
|
s.current = _, a.current = 0, l.current = "", p || (S(_), k([]));
|
|
2959
2980
|
}
|
|
2960
2981
|
return () => {
|
|
@@ -2963,7 +2984,7 @@ function Ss({
|
|
|
2963
2984
|
}
|
|
2964
2985
|
const v = s.current, x = a.current;
|
|
2965
2986
|
if (e.length < x || b(e, x)) {
|
|
2966
|
-
const _ =
|
|
2987
|
+
const _ = Ee();
|
|
2967
2988
|
return _.processMessages(e), p || d(_, e), () => {
|
|
2968
2989
|
p = !0;
|
|
2969
2990
|
};
|
|
@@ -2974,25 +2995,25 @@ function Ss({
|
|
|
2974
2995
|
} : (v.processMessages(N), a.current = e.length, l.current = JSON.stringify(e), p || k(Array.from(v.model.surfacesMap.values())), () => {
|
|
2975
2996
|
p = !0;
|
|
2976
2997
|
});
|
|
2977
|
-
}, [e, t]), y.length === 0 ? /* @__PURE__ */ u(be, { children: n }) : /* @__PURE__ */ u(be, { children: /* @__PURE__ */ u(
|
|
2998
|
+
}, [e, t]), y.length === 0 ? /* @__PURE__ */ u(be, { children: n }) : /* @__PURE__ */ u(be, { children: /* @__PURE__ */ u(ct, { resumeSearch: o, children: /* @__PURE__ */ u(lt, { caseSearch: i, children: /* @__PURE__ */ u(at, { interactive: r, children: /* @__PURE__ */ u("div", { className: "a2ui-surface a2ui-container", children: y.map((p) => /* @__PURE__ */ u(Zt, { surface: p }, p.id)) }) }) }) }) });
|
|
2978
2999
|
}
|
|
2979
|
-
const
|
|
3000
|
+
const qi = 100, Bi = 3e4, Vi = 1500, me = /* @__PURE__ */ new Map();
|
|
2980
3001
|
function Li(e) {
|
|
2981
3002
|
const t = e.trim();
|
|
2982
3003
|
let n = me.get(t);
|
|
2983
|
-
return n || (n = new
|
|
3004
|
+
return n || (n = new ji(t), me.set(t, n)), n.acquire(), n;
|
|
2984
3005
|
}
|
|
2985
|
-
class
|
|
3006
|
+
class ji {
|
|
2986
3007
|
constructor(t) {
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
3008
|
+
G(this, "url");
|
|
3009
|
+
G(this, "ws", null);
|
|
3010
|
+
G(this, "refCount", 0);
|
|
3011
|
+
G(this, "connectRequested", !1);
|
|
3012
|
+
G(this, "reconnectAttempt", 0);
|
|
3013
|
+
G(this, "reconnectTimer", null);
|
|
3014
|
+
G(this, "releaseTimer", null);
|
|
3015
|
+
G(this, "sendQueue", []);
|
|
3016
|
+
G(this, "handlers", /* @__PURE__ */ new Map());
|
|
2996
3017
|
this.url = t;
|
|
2997
3018
|
}
|
|
2998
3019
|
acquire() {
|
|
@@ -3001,7 +3022,7 @@ class Vi {
|
|
|
3001
3022
|
release() {
|
|
3002
3023
|
this.refCount = Math.max(0, this.refCount - 1), !(this.refCount > 0) && (this.clearReleaseTimer(), this.releaseTimer = setTimeout(() => {
|
|
3003
3024
|
this.releaseTimer = null, !(this.refCount > 0) && (this.teardown(), me.get(this.url) === this && me.delete(this.url));
|
|
3004
|
-
},
|
|
3025
|
+
}, Vi));
|
|
3005
3026
|
}
|
|
3006
3027
|
/** 强制关闭(测试用),跳过宽限期。 */
|
|
3007
3028
|
forceClose() {
|
|
@@ -3074,7 +3095,7 @@ class Vi {
|
|
|
3074
3095
|
}
|
|
3075
3096
|
}
|
|
3076
3097
|
enqueue(t) {
|
|
3077
|
-
for (this.sendQueue.push(t); this.sendQueue.length >
|
|
3098
|
+
for (this.sendQueue.push(t); this.sendQueue.length > qi; )
|
|
3078
3099
|
this.sendQueue.shift();
|
|
3079
3100
|
}
|
|
3080
3101
|
flushQueue() {
|
|
@@ -3088,7 +3109,7 @@ class Vi {
|
|
|
3088
3109
|
if (!this.connectRequested || this.refCount <= 0) return;
|
|
3089
3110
|
this.clearReconnectTimer();
|
|
3090
3111
|
const t = Math.min(
|
|
3091
|
-
|
|
3112
|
+
Bi,
|
|
3092
3113
|
1e3 * 2 ** Math.min(this.reconnectAttempt, 5)
|
|
3093
3114
|
);
|
|
3094
3115
|
this.reconnectAttempt += 1, this.reconnectTimer = setTimeout(() => {
|
|
@@ -3126,12 +3147,12 @@ class Vi {
|
|
|
3126
3147
|
}
|
|
3127
3148
|
}
|
|
3128
3149
|
}
|
|
3129
|
-
class
|
|
3150
|
+
class $i {
|
|
3130
3151
|
constructor(t) {
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3152
|
+
G(this, "askUserMessageId");
|
|
3153
|
+
G(this, "connection");
|
|
3154
|
+
G(this, "unsubscribe");
|
|
3155
|
+
G(this, "closed", !1);
|
|
3135
3156
|
this.askUserMessageId = t.askUserMessageId.trim(), this.connection = Li(t.url);
|
|
3136
3157
|
const n = t.onAutoControl;
|
|
3137
3158
|
this.unsubscribe = n ? this.connection.subscribe(this.askUserMessageId, n) : () => {
|
|
@@ -3147,24 +3168,24 @@ class ji {
|
|
|
3147
3168
|
this.closed || (this.closed = !0, this.unsubscribe(), this.connection.release());
|
|
3148
3169
|
}
|
|
3149
3170
|
}
|
|
3150
|
-
function
|
|
3171
|
+
function Pn(e) {
|
|
3151
3172
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
3152
3173
|
}
|
|
3153
|
-
function
|
|
3174
|
+
function Di(e, t) {
|
|
3154
3175
|
if (!e) return !1;
|
|
3155
|
-
const n = e.querySelector(`[data-skopon-field="${
|
|
3176
|
+
const n = e.querySelector(`[data-skopon-field="${Pn(t)}"]`);
|
|
3156
3177
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
3157
3178
|
'input, textarea, select, button, [tabindex]:not([tabindex="-1"])'
|
|
3158
3179
|
) ?? n).focus(), !0) : !1;
|
|
3159
3180
|
}
|
|
3160
|
-
function
|
|
3181
|
+
function Hi(e, t) {
|
|
3161
3182
|
if (!e) return !1;
|
|
3162
|
-
const n = e.querySelector(`[data-skopon-field="${
|
|
3183
|
+
const n = e.querySelector(`[data-skopon-field="${Pn(t)}"]`);
|
|
3163
3184
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
3164
3185
|
'button, [role="button"], .skopon-resume-select-card, input, label'
|
|
3165
3186
|
) ?? n).click(), !0) : !1;
|
|
3166
3187
|
}
|
|
3167
|
-
function
|
|
3188
|
+
function Ki(e, t, n) {
|
|
3168
3189
|
const r = e.action;
|
|
3169
3190
|
if (r !== "change" && r !== "select" && r !== "focus" && r !== "click" && r !== "submit") {
|
|
3170
3191
|
console.warn("[FormAutoControl] unknown action", r);
|
|
@@ -3194,47 +3215,47 @@ function Hi(e, t, n) {
|
|
|
3194
3215
|
return;
|
|
3195
3216
|
}
|
|
3196
3217
|
if (r === "focus") {
|
|
3197
|
-
|
|
3218
|
+
Di(t.rootElement, o), n.reportEvent({
|
|
3198
3219
|
action: "focus",
|
|
3199
3220
|
component: i,
|
|
3200
3221
|
field: o
|
|
3201
3222
|
});
|
|
3202
3223
|
return;
|
|
3203
3224
|
}
|
|
3204
|
-
|
|
3225
|
+
Hi(t.rootElement, o) || console.warn("[FormAutoControl] click target not found", o);
|
|
3205
3226
|
});
|
|
3206
3227
|
}
|
|
3207
|
-
function
|
|
3228
|
+
function Ji(e) {
|
|
3208
3229
|
const t = {};
|
|
3209
3230
|
for (const [n, r] of Object.entries(e))
|
|
3210
3231
|
r !== void 0 && (t[n] = r);
|
|
3211
3232
|
return t;
|
|
3212
3233
|
}
|
|
3213
|
-
function
|
|
3234
|
+
function Gi(e, t) {
|
|
3214
3235
|
var o;
|
|
3215
3236
|
const n = (o = e.name) == null ? void 0 : o.trim();
|
|
3216
3237
|
if (!n || !t) return { ...e };
|
|
3217
3238
|
const r = t.get(n);
|
|
3218
3239
|
return r ? e.type !== "resume_multiselect" && e.type !== "case_multiselect" ? { ...e } : { ...e, options: r.map((i) => ({ ...i })) } : { ...e };
|
|
3219
3240
|
}
|
|
3220
|
-
function
|
|
3241
|
+
function Wi(e) {
|
|
3221
3242
|
var i, s;
|
|
3222
3243
|
const n = {
|
|
3223
3244
|
blocks: (e.blocks ?? []).map(
|
|
3224
|
-
(a) =>
|
|
3245
|
+
(a) => Gi(a, e.liveOptions)
|
|
3225
3246
|
)
|
|
3226
3247
|
}, r = (i = e.title) == null ? void 0 : i.trim(), o = (s = e.description) == null ? void 0 : s.trim();
|
|
3227
3248
|
return r && (n.title = r), o && (n.description = o), {
|
|
3228
3249
|
form_schema: n,
|
|
3229
|
-
form_values:
|
|
3250
|
+
form_values: Ji(e.values ?? {}),
|
|
3230
3251
|
form_change: [...e.formChange ?? []]
|
|
3231
3252
|
};
|
|
3232
3253
|
}
|
|
3233
|
-
function
|
|
3234
|
-
const t =
|
|
3235
|
-
return t ?
|
|
3254
|
+
function Yi(e) {
|
|
3255
|
+
const t = Ve(e);
|
|
3256
|
+
return t ? ze(t.blocks) : e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
3236
3257
|
}
|
|
3237
|
-
function
|
|
3258
|
+
function Qi({
|
|
3238
3259
|
payload: e,
|
|
3239
3260
|
callbackUrl: t,
|
|
3240
3261
|
title: n,
|
|
@@ -3244,17 +3265,17 @@ function Yi({
|
|
|
3244
3265
|
submitHeaders: s,
|
|
3245
3266
|
onNotify: a
|
|
3246
3267
|
}) {
|
|
3247
|
-
const [l, c] =
|
|
3248
|
-
|
|
3268
|
+
const [l, c] = P(!1), m = A(!0);
|
|
3269
|
+
q(() => (m.current = !0, () => {
|
|
3249
3270
|
m.current = !1;
|
|
3250
3271
|
}), []);
|
|
3251
|
-
const d =
|
|
3252
|
-
() =>
|
|
3272
|
+
const d = L(
|
|
3273
|
+
() => Tt(s),
|
|
3253
3274
|
[s]
|
|
3254
|
-
), b =
|
|
3255
|
-
() =>
|
|
3275
|
+
), b = L(
|
|
3276
|
+
() => An(e, t, d),
|
|
3256
3277
|
[e, t, d]
|
|
3257
|
-
), g =
|
|
3278
|
+
), g = L(
|
|
3258
3279
|
() => ({
|
|
3259
3280
|
...i,
|
|
3260
3281
|
callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? t ?? null
|
|
@@ -3265,15 +3286,15 @@ function Yi({
|
|
|
3265
3286
|
if (!l) {
|
|
3266
3287
|
c(!0);
|
|
3267
3288
|
try {
|
|
3268
|
-
const y =
|
|
3289
|
+
const y = Yi(e), k = Mt({
|
|
3269
3290
|
context: g,
|
|
3270
3291
|
payload: e,
|
|
3271
3292
|
answer: y
|
|
3272
|
-
}), p = await
|
|
3293
|
+
}), p = await Nn(k, {
|
|
3273
3294
|
headers: d
|
|
3274
3295
|
});
|
|
3275
3296
|
if (!m.current) return;
|
|
3276
|
-
const f =
|
|
3297
|
+
const f = Mn(p);
|
|
3277
3298
|
a == null || a(f.type, f.message);
|
|
3278
3299
|
} catch (y) {
|
|
3279
3300
|
if (!m.current) return;
|
|
@@ -3306,8 +3327,8 @@ function Yi({
|
|
|
3306
3327
|
/* @__PURE__ */ u("pre", { className: "skopon-form-curl-json", children: b })
|
|
3307
3328
|
] });
|
|
3308
3329
|
}
|
|
3309
|
-
const
|
|
3310
|
-
function
|
|
3330
|
+
const Xi = 80;
|
|
3331
|
+
function Zi(e, t) {
|
|
3311
3332
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
3312
3333
|
const n = t.message;
|
|
3313
3334
|
if (typeof n == "string" && n.trim())
|
|
@@ -3315,7 +3336,7 @@ function Xi(e, t) {
|
|
|
3315
3336
|
}
|
|
3316
3337
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
3317
3338
|
}
|
|
3318
|
-
function
|
|
3339
|
+
function es({
|
|
3319
3340
|
payload: e,
|
|
3320
3341
|
formUniqueId: t,
|
|
3321
3342
|
askUserMessageId: n,
|
|
@@ -3330,210 +3351,218 @@ function Zi({
|
|
|
3330
3351
|
onSurfaceReadyChange: d,
|
|
3331
3352
|
onAutoControlReady: b
|
|
3332
3353
|
}) {
|
|
3333
|
-
const [g, S] =
|
|
3354
|
+
const [g, S] = P(null), [y, k] = P(!1), [p, f] = P(!0), [v, x] = P(!1), N = A(null), _ = A(null), w = A(!0), C = A(l);
|
|
3334
3355
|
C.current = l;
|
|
3335
|
-
const
|
|
3336
|
-
() =>
|
|
3356
|
+
const B = un(), V = gt(), re = A(""), K = A(null), $ = (t == null ? void 0 : t.trim()) ?? "", W = (n == null ? void 0 : n.trim()) ?? "", ee = L(
|
|
3357
|
+
() => Tt(s),
|
|
3337
3358
|
[s]
|
|
3338
|
-
), te =
|
|
3359
|
+
), te = L(
|
|
3339
3360
|
() => ({
|
|
3340
3361
|
...i,
|
|
3341
3362
|
callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? r ?? null
|
|
3342
3363
|
}),
|
|
3343
3364
|
[i, r]
|
|
3344
3365
|
);
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
}), []),
|
|
3348
|
-
let
|
|
3349
|
-
return
|
|
3350
|
-
|
|
3351
|
-
}).catch((
|
|
3352
|
-
var
|
|
3353
|
-
if (!
|
|
3366
|
+
q(() => (w.current = !0, () => {
|
|
3367
|
+
w.current = !1, K.current != null && (clearTimeout(K.current), K.current = null);
|
|
3368
|
+
}), []), q(() => {
|
|
3369
|
+
let F = !1;
|
|
3370
|
+
return $ ? (f(!0), k(!1), a({ formUniqueId: $ }).then((O) => {
|
|
3371
|
+
F || (k(!!O.disabled), S(O.formDefinition ?? null));
|
|
3372
|
+
}).catch((O) => {
|
|
3373
|
+
var J;
|
|
3374
|
+
if (!F) {
|
|
3354
3375
|
k(!1), S(null);
|
|
3355
|
-
const Ie =
|
|
3356
|
-
(
|
|
3376
|
+
const Ie = O instanceof Error ? O.message : "获取表单定义失败";
|
|
3377
|
+
(J = C.current) == null || J.call(C, "error", Ie);
|
|
3357
3378
|
}
|
|
3358
3379
|
}).finally(() => {
|
|
3359
|
-
|
|
3380
|
+
F || f(!1);
|
|
3360
3381
|
}), () => {
|
|
3361
|
-
|
|
3382
|
+
F = !0;
|
|
3362
3383
|
}) : (f(!1), k(!1), S(null), () => {
|
|
3363
|
-
|
|
3384
|
+
F = !0;
|
|
3364
3385
|
});
|
|
3365
|
-
}, [
|
|
3366
|
-
const
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3386
|
+
}, [$, a]);
|
|
3387
|
+
const E = L(() => Ve(e), [e]), R = L(() => E ? Oo(E, g ?? void 0) : null, [E, g]), T = (R == null ? void 0 : R.matchedBlocks) ?? [], D = !!(E && qo(E) && T.length === 0), z = L(() => D && E ? Bo(E) : R && R.renderBlocks.length > 0 ? R.renderBlocks : [], [R, D, E]), I = L(() => {
|
|
3388
|
+
if (D && E)
|
|
3389
|
+
return Vo(E);
|
|
3390
|
+
const F = ze((R == null ? void 0 : R.extraBlocks) ?? []);
|
|
3391
|
+
return { ...ze(
|
|
3392
|
+
((R == null ? void 0 : R.matchedBlocks) ?? []).filter(
|
|
3393
|
+
(J) => J.type === "text" && J.hidden === !0
|
|
3394
|
+
)
|
|
3395
|
+
), ...F };
|
|
3396
|
+
}, [D, E, R]), Y = L(
|
|
3397
|
+
() => z.filter((F) => {
|
|
3398
|
+
var O;
|
|
3399
|
+
return (O = F.name) == null ? void 0 : O.trim();
|
|
3400
|
+
}).map((F) => F.name.trim()),
|
|
3401
|
+
[z]
|
|
3402
|
+
), Me = (R == null ? void 0 : R.title) ?? (E == null ? void 0 : E.title) ?? "", Ne = (R == null ? void 0 : R.description) ?? (E == null ? void 0 : E.description) ?? "", ce = L(() => z.length === 0 ? null : Fo(
|
|
3373
3403
|
{ title: Me, description: Ne },
|
|
3374
|
-
|
|
3375
|
-
), [Me, Ne,
|
|
3404
|
+
z
|
|
3405
|
+
), [Me, Ne, z]), $e = L(() => {
|
|
3376
3406
|
if (!ce) return "";
|
|
3377
3407
|
try {
|
|
3378
3408
|
return JSON.stringify(ce);
|
|
3379
3409
|
} catch {
|
|
3380
3410
|
return String(ce);
|
|
3381
3411
|
}
|
|
3382
|
-
}, [ce]), De =
|
|
3383
|
-
|
|
3384
|
-
const
|
|
3385
|
-
var
|
|
3386
|
-
return { ...((
|
|
3387
|
-
}, [
|
|
3388
|
-
|
|
3389
|
-
const He = A(
|
|
3390
|
-
He.current =
|
|
3391
|
-
const fe =
|
|
3392
|
-
(
|
|
3393
|
-
const
|
|
3412
|
+
}, [ce]), De = $ ? `ask-user-${$}` : "ask-user-payload", oe = !!(!p && E && z.length > 0 && ce);
|
|
3413
|
+
q(() => (d(oe), () => d(!1)), [oe, d]);
|
|
3414
|
+
const It = j(() => {
|
|
3415
|
+
var O;
|
|
3416
|
+
return { ...((O = N.current) == null ? void 0 : O.getValues(Y)) ?? {}, ...I };
|
|
3417
|
+
}, [Y, I]), Ft = A(V.liveOptions);
|
|
3418
|
+
Ft.current = V.liveOptions;
|
|
3419
|
+
const He = A(V.pendingChangeFields);
|
|
3420
|
+
He.current = V.pendingChangeFields;
|
|
3421
|
+
const fe = j(
|
|
3422
|
+
(F) => {
|
|
3423
|
+
const O = Wi({
|
|
3394
3424
|
title: Me,
|
|
3395
3425
|
description: Ne,
|
|
3396
|
-
blocks:
|
|
3397
|
-
values:
|
|
3398
|
-
liveOptions:
|
|
3399
|
-
formChange:
|
|
3426
|
+
blocks: z,
|
|
3427
|
+
values: It(),
|
|
3428
|
+
liveOptions: Ft.current,
|
|
3429
|
+
formChange: F
|
|
3400
3430
|
});
|
|
3401
|
-
|
|
3431
|
+
B.reportData(O);
|
|
3402
3432
|
},
|
|
3403
|
-
[Me, Ne,
|
|
3433
|
+
[Me, Ne, z, It, B]
|
|
3404
3434
|
), Ke = A(fe);
|
|
3405
|
-
Ke.current = fe,
|
|
3435
|
+
Ke.current = fe, q(() => {
|
|
3406
3436
|
if (!oe) {
|
|
3407
3437
|
re.current = "";
|
|
3408
3438
|
return;
|
|
3409
3439
|
}
|
|
3410
3440
|
if (!$e) return;
|
|
3411
|
-
const
|
|
3412
|
-
if (re.current ===
|
|
3413
|
-
const
|
|
3414
|
-
|
|
3441
|
+
const F = `${De}::${$e}`;
|
|
3442
|
+
if (re.current === F) return;
|
|
3443
|
+
const O = setTimeout(() => {
|
|
3444
|
+
w.current && re.current !== F && (re.current = F, Ke.current([]));
|
|
3415
3445
|
}, 0);
|
|
3416
|
-
return () => clearTimeout(
|
|
3417
|
-
}, [oe, De, $e]),
|
|
3418
|
-
if (!(!oe ||
|
|
3446
|
+
return () => clearTimeout(O);
|
|
3447
|
+
}, [oe, De, $e]), q(() => {
|
|
3448
|
+
if (!(!oe || V.version === 0) && He.current.length !== 0)
|
|
3419
3449
|
return K.current != null && clearTimeout(K.current), K.current = setTimeout(() => {
|
|
3420
|
-
if (K.current = null, !
|
|
3421
|
-
const
|
|
3422
|
-
|
|
3423
|
-
},
|
|
3450
|
+
if (K.current = null, !w.current) return;
|
|
3451
|
+
const F = [...He.current];
|
|
3452
|
+
V.clearPendingChangeFields(), F.length !== 0 && Ke.current(F);
|
|
3453
|
+
}, Xi), () => {
|
|
3424
3454
|
K.current != null && (clearTimeout(K.current), K.current = null);
|
|
3425
3455
|
};
|
|
3426
|
-
}, [oe,
|
|
3427
|
-
const Je =
|
|
3428
|
-
var
|
|
3456
|
+
}, [oe, V.version, V.clearPendingChangeFields]);
|
|
3457
|
+
const Je = j(async () => {
|
|
3458
|
+
var F, O, J, Ie, Rt, Pt, wt, zt;
|
|
3429
3459
|
if (!v) {
|
|
3430
3460
|
x(!0);
|
|
3431
3461
|
try {
|
|
3432
|
-
const pe = ((
|
|
3433
|
-
if (
|
|
3434
|
-
(
|
|
3462
|
+
const pe = { ...((F = N.current) == null ? void 0 : F.getValues(Y)) ?? {}, ...I }, Ot = ci(z, pe);
|
|
3463
|
+
if (Ot) {
|
|
3464
|
+
(O = C.current) == null || O.call(C, "error", Ot.message);
|
|
3435
3465
|
return;
|
|
3436
3466
|
}
|
|
3437
|
-
const zt = { ...pe, ...I };
|
|
3438
3467
|
if (o === "post") {
|
|
3439
3468
|
const Lt = (r ?? "").trim();
|
|
3440
3469
|
if (!Lt) {
|
|
3441
|
-
(
|
|
3470
|
+
(J = C.current) == null || J.call(C, "error", "callback_url 为空,无法提交");
|
|
3442
3471
|
return;
|
|
3443
3472
|
}
|
|
3444
|
-
fe([]),
|
|
3473
|
+
fe([]), B.reportEvent({
|
|
3445
3474
|
action: "submit",
|
|
3446
3475
|
component: "SubmitButton"
|
|
3447
3476
|
});
|
|
3448
|
-
const
|
|
3477
|
+
const We = await _n(Lt, pe, {
|
|
3449
3478
|
headers: ee
|
|
3450
3479
|
});
|
|
3451
|
-
if (!
|
|
3452
|
-
|
|
3480
|
+
if (!w.current) return;
|
|
3481
|
+
We.ok ? (Ie = C.current) == null || Ie.call(C, "success", "提交成功") : (Rt = C.current) == null || Rt.call(C, "error", Zi(We.status, We.body));
|
|
3453
3482
|
return;
|
|
3454
3483
|
}
|
|
3455
|
-
const
|
|
3484
|
+
const qt = Mt({
|
|
3456
3485
|
context: te,
|
|
3457
3486
|
payload: e,
|
|
3458
|
-
form: g ??
|
|
3459
|
-
answer:
|
|
3460
|
-
}),
|
|
3461
|
-
if (
|
|
3462
|
-
(
|
|
3487
|
+
form: g ?? E,
|
|
3488
|
+
answer: pe
|
|
3489
|
+
}), Bt = Nt(qt);
|
|
3490
|
+
if (Bt) {
|
|
3491
|
+
(Pt = C.current) == null || Pt.call(C, "error", Bt);
|
|
3463
3492
|
return;
|
|
3464
3493
|
}
|
|
3465
|
-
fe([]),
|
|
3494
|
+
fe([]), B.reportEvent({
|
|
3466
3495
|
action: "submit",
|
|
3467
3496
|
component: "SubmitButton"
|
|
3468
3497
|
});
|
|
3469
|
-
const
|
|
3498
|
+
const wn = await Nn(qt, {
|
|
3470
3499
|
headers: ee
|
|
3471
3500
|
});
|
|
3472
|
-
if (!
|
|
3473
|
-
const
|
|
3474
|
-
(
|
|
3475
|
-
} catch (
|
|
3476
|
-
if (!
|
|
3477
|
-
const
|
|
3478
|
-
(
|
|
3501
|
+
if (!w.current) return;
|
|
3502
|
+
const Vt = Mn(wn);
|
|
3503
|
+
(wt = C.current) == null || wt.call(C, Vt.type, Vt.message);
|
|
3504
|
+
} catch (Ge) {
|
|
3505
|
+
if (!w.current) return;
|
|
3506
|
+
const pe = Ge instanceof Error ? Ge.message : "提交失败";
|
|
3507
|
+
(zt = C.current) == null || zt.call(C, "error", pe);
|
|
3479
3508
|
} finally {
|
|
3480
|
-
|
|
3509
|
+
w.current && x(!1);
|
|
3481
3510
|
}
|
|
3482
3511
|
}
|
|
3483
3512
|
}, [
|
|
3484
3513
|
v,
|
|
3485
|
-
|
|
3486
|
-
|
|
3514
|
+
Y,
|
|
3515
|
+
z,
|
|
3487
3516
|
I,
|
|
3488
3517
|
fe,
|
|
3489
|
-
|
|
3518
|
+
B,
|
|
3490
3519
|
o,
|
|
3491
3520
|
r,
|
|
3492
3521
|
ee,
|
|
3493
3522
|
te,
|
|
3494
3523
|
e,
|
|
3495
3524
|
g,
|
|
3496
|
-
|
|
3497
|
-
]),
|
|
3498
|
-
|
|
3499
|
-
const
|
|
3500
|
-
(
|
|
3501
|
-
|
|
3502
|
-
|
|
3525
|
+
E
|
|
3526
|
+
]), Et = A(Je);
|
|
3527
|
+
Et.current = Je;
|
|
3528
|
+
const Ut = j(
|
|
3529
|
+
(F) => {
|
|
3530
|
+
Ki(
|
|
3531
|
+
F,
|
|
3503
3532
|
{
|
|
3504
|
-
setValues: (
|
|
3505
|
-
var
|
|
3506
|
-
return (
|
|
3533
|
+
setValues: (O) => {
|
|
3534
|
+
var J;
|
|
3535
|
+
return (J = N.current) == null ? void 0 : J.setValues(O);
|
|
3507
3536
|
},
|
|
3508
|
-
getValues: (
|
|
3509
|
-
var
|
|
3510
|
-
return ((
|
|
3537
|
+
getValues: (O) => {
|
|
3538
|
+
var J;
|
|
3539
|
+
return ((J = N.current) == null ? void 0 : J.getValues(O)) ?? {};
|
|
3511
3540
|
},
|
|
3512
|
-
submit: () =>
|
|
3541
|
+
submit: () => Et.current(),
|
|
3513
3542
|
rootElement: _.current
|
|
3514
3543
|
},
|
|
3515
3544
|
{
|
|
3516
|
-
reportEvent:
|
|
3517
|
-
runAutoControl:
|
|
3545
|
+
reportEvent: B.reportEvent,
|
|
3546
|
+
runAutoControl: B.runAutoControl
|
|
3518
3547
|
}
|
|
3519
3548
|
);
|
|
3520
3549
|
},
|
|
3521
|
-
[
|
|
3550
|
+
[B]
|
|
3522
3551
|
);
|
|
3523
|
-
return
|
|
3552
|
+
return q(() => {
|
|
3524
3553
|
if (!oe) {
|
|
3525
3554
|
b(null);
|
|
3526
3555
|
return;
|
|
3527
3556
|
}
|
|
3528
|
-
return b(
|
|
3529
|
-
}, [oe,
|
|
3530
|
-
|
|
3557
|
+
return b(Ut), () => b(null);
|
|
3558
|
+
}, [oe, Ut, b]), p ? /* @__PURE__ */ u("div", { className: "ask-user-form-card", children: /* @__PURE__ */ u(ft, { size: "small" }) }) : !E || z.length === 0 ? /* @__PURE__ */ u(
|
|
3559
|
+
Qi,
|
|
3531
3560
|
{
|
|
3532
3561
|
payload: e,
|
|
3533
3562
|
callbackUrl: r,
|
|
3534
3563
|
answerAgentContext: te,
|
|
3535
3564
|
submitHeaders: s,
|
|
3536
|
-
unpublishedFormId: y &&
|
|
3565
|
+
unpublishedFormId: y && $ ? $ : void 0,
|
|
3537
3566
|
onNotify: l
|
|
3538
3567
|
}
|
|
3539
3568
|
) : /* @__PURE__ */ M(
|
|
@@ -3541,16 +3570,16 @@ function Zi({
|
|
|
3541
3570
|
{
|
|
3542
3571
|
className: "ask-user-form-card",
|
|
3543
3572
|
ref: _,
|
|
3544
|
-
"data-ask-user-message-id":
|
|
3573
|
+
"data-ask-user-message-id": W || void 0,
|
|
3545
3574
|
children: [
|
|
3546
|
-
y &&
|
|
3575
|
+
y && $ ? /* @__PURE__ */ u("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ u(he, { title: $, children: /* @__PURE__ */ u(ge, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
|
|
3547
3576
|
/* @__PURE__ */ u(
|
|
3548
|
-
|
|
3577
|
+
Oi,
|
|
3549
3578
|
{
|
|
3550
3579
|
ref: N,
|
|
3551
3580
|
doc: ce,
|
|
3552
3581
|
surfaceId: De,
|
|
3553
|
-
fieldNames:
|
|
3582
|
+
fieldNames: Y,
|
|
3554
3583
|
interactive: !0,
|
|
3555
3584
|
wrapProvider: !1,
|
|
3556
3585
|
resumeSearch: c,
|
|
@@ -3578,16 +3607,16 @@ function Zi({
|
|
|
3578
3607
|
}
|
|
3579
3608
|
);
|
|
3580
3609
|
}
|
|
3581
|
-
function
|
|
3610
|
+
function As(e) {
|
|
3582
3611
|
var c;
|
|
3583
|
-
const t = ((c = e.askUserMessageId) == null ? void 0 : c.trim()) ?? "", n =
|
|
3612
|
+
const t = ((c = e.askUserMessageId) == null ? void 0 : c.trim()) ?? "", n = L(() => Wo(), []), [r, o] = P(!1), i = A(null), s = j((m) => {
|
|
3584
3613
|
o(m);
|
|
3585
|
-
}, []), a =
|
|
3614
|
+
}, []), a = j(
|
|
3586
3615
|
(m) => {
|
|
3587
3616
|
i.current = m;
|
|
3588
3617
|
},
|
|
3589
3618
|
[]
|
|
3590
|
-
), l =
|
|
3619
|
+
), l = L(() => !n || !t ? null : new $i({
|
|
3591
3620
|
url: n,
|
|
3592
3621
|
askUserMessageId: t,
|
|
3593
3622
|
onAutoControl: (m) => {
|
|
@@ -3595,15 +3624,15 @@ function ks(e) {
|
|
|
3595
3624
|
(d = i.current) == null || d.call(i, m);
|
|
3596
3625
|
}
|
|
3597
3626
|
}), [n, t]);
|
|
3598
|
-
return
|
|
3627
|
+
return q(() => {
|
|
3599
3628
|
if (l)
|
|
3600
3629
|
return () => {
|
|
3601
3630
|
l.close();
|
|
3602
3631
|
};
|
|
3603
|
-
}, [l]),
|
|
3632
|
+
}, [l]), q(() => {
|
|
3604
3633
|
!l || !r || l.connect();
|
|
3605
|
-
}, [l, r]), /* @__PURE__ */ u(be, { children: /* @__PURE__ */ u(
|
|
3606
|
-
|
|
3634
|
+
}, [l, r]), /* @__PURE__ */ u(be, { children: /* @__PURE__ */ u(Dr, { client: l, children: /* @__PURE__ */ u(Vr, { children: /* @__PURE__ */ u(
|
|
3635
|
+
es,
|
|
3607
3636
|
{
|
|
3608
3637
|
...e,
|
|
3609
3638
|
onSurfaceReadyChange: s,
|
|
@@ -3612,70 +3641,71 @@ function ks(e) {
|
|
|
3612
3641
|
) }) }) });
|
|
3613
3642
|
}
|
|
3614
3643
|
export {
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3644
|
+
ds as A2UI_PROTOCOL_VERSION,
|
|
3645
|
+
As as AskUserFormCard,
|
|
3646
|
+
lt as CaseSearchProvider,
|
|
3647
|
+
Qi as CurlSubmitBlock,
|
|
3648
|
+
Ko as DEFAULT_ANSWER_AGENT_CALLBACK_URL,
|
|
3649
|
+
Do as DEFAULT_AUTH_ANSWER_AGENT_CALLBACK_URL_FIELD,
|
|
3650
|
+
Ho as DEFAULT_AUTH_REALTIME_WS_URL_FIELD,
|
|
3651
|
+
Ct as DEFAULT_AUTH_STORAGE_KEY,
|
|
3652
|
+
$o as DEFAULT_AUTH_TOKEN_FIELD,
|
|
3653
|
+
nr as FORM_MEDIA_SIZES,
|
|
3654
|
+
ct as ResumeSearchProvider,
|
|
3655
|
+
Cs as SkoponA2uiStreamRenderer,
|
|
3627
3656
|
be as SkoponFormProvider,
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3657
|
+
Oi as SkoponFormRenderer,
|
|
3658
|
+
Mo as a2uiToBlocks,
|
|
3659
|
+
vn as blocksToA2ui,
|
|
3660
|
+
Pr as blocksToJsonSchema,
|
|
3661
|
+
Mt as buildAnswerAgentBody,
|
|
3633
3662
|
Lo as buildAskUserCurlBodyJson,
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3663
|
+
jo as buildAskUserCurlStatement,
|
|
3664
|
+
vs as buildAskUserSubmitCurlFromPayload,
|
|
3665
|
+
Fo as buildAskUserSurface,
|
|
3666
|
+
An as buildCurlStatement,
|
|
3638
3667
|
Te as coerceToggleValue,
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3668
|
+
bs as copyTextToClipboard,
|
|
3669
|
+
ai as createCaseSearchClient,
|
|
3670
|
+
gs as createEmptyBlock,
|
|
3671
|
+
hs as createEmptyFormDefinition,
|
|
3672
|
+
Yo as createFormClient,
|
|
3673
|
+
ri as createResumeSearchClient,
|
|
3674
|
+
ks as createSkoponSdkClients,
|
|
3675
|
+
ze as extractExtraBlockValues,
|
|
3676
|
+
Uo as extractSurfaceValues,
|
|
3677
|
+
Mn as formatAnswerAgentSubmitMessage,
|
|
3678
|
+
Vo as getPayloadHiddenBlockValues,
|
|
3679
|
+
ys as getPayloadInputFieldNames,
|
|
3680
|
+
Bo as getPayloadRenderableBlocks,
|
|
3681
|
+
Oo as intersectPayloadBlocksWithForm,
|
|
3682
|
+
dt as isA2uiSurfaceEmpty,
|
|
3683
|
+
fs as isDisplayBlockType,
|
|
3654
3684
|
Z as isInputBlockType,
|
|
3655
3685
|
Ce as isLayoutBlockType,
|
|
3656
3686
|
de as isMediaBlockType,
|
|
3657
|
-
|
|
3658
|
-
|
|
3687
|
+
rr as isOptionsBlockType,
|
|
3688
|
+
Eo as mapFormDefinitionFromDto,
|
|
3659
3689
|
qe as normalizeFormDefinition,
|
|
3660
3690
|
ue as normalizeMultiselectCount,
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3691
|
+
Ve as parsePayloadBlocksJson,
|
|
3692
|
+
qo as payloadHasInputBlocks,
|
|
3693
|
+
Go as resolveAnswerAgentCallbackUrl,
|
|
3694
|
+
xt as resolveClientHeaders,
|
|
3695
|
+
Wo as resolveRealtimeWsUrl,
|
|
3696
|
+
Ur as resolveSchemaDefaultValue,
|
|
3697
|
+
Tn as resolveSkoponAuthHeaders,
|
|
3698
|
+
Tt as resolveSubmitAuthHeaders,
|
|
3699
|
+
Io as resolveSurfaceFromFormDefinition,
|
|
3700
|
+
zi as skoponAntdTheme,
|
|
3671
3701
|
ie as skoponBrandColors,
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3702
|
+
Nn as submitAnswerAgent,
|
|
3703
|
+
_n as submitFormJson,
|
|
3704
|
+
ps as supportsDefaultValue,
|
|
3705
|
+
No as surfaceDocToMessages,
|
|
3676
3706
|
ye as syncFormDefinition,
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3707
|
+
Jr as useCaseSearch,
|
|
3708
|
+
no as useResumeSearch,
|
|
3709
|
+
Nt as validateAnswerAgentBody,
|
|
3710
|
+
Ss as validateAnswerAgentContext
|
|
3681
3711
|
};
|