@realtek/zinnext-theme 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +82 -3
  2. package/dist-lib/DocumentViewer-BaSdIaiX.js +575 -0
  3. package/dist-lib/DocumentViewer-BaSdIaiX.js.map +1 -0
  4. package/dist-lib/DocumentViewer-DyVOzGFs.cjs +2 -0
  5. package/dist-lib/DocumentViewer-DyVOzGFs.cjs.map +1 -0
  6. package/dist-lib/FileField-CYCUE0OI.js +2887 -0
  7. package/dist-lib/FileField-CYCUE0OI.js.map +1 -0
  8. package/dist-lib/FileField-DsQMJqXA.cjs +3 -0
  9. package/dist-lib/FileField-DsQMJqXA.cjs.map +1 -0
  10. package/dist-lib/LinkedRecordFileField-IXUcG6eb.js +3834 -0
  11. package/dist-lib/LinkedRecordFileField-IXUcG6eb.js.map +1 -0
  12. package/dist-lib/LinkedRecordFileField-hK12u1Pu.cjs +4 -0
  13. package/dist-lib/LinkedRecordFileField-hK12u1Pu.cjs.map +1 -0
  14. package/dist-lib/addFormApi-DEuEstyI.js +63 -0
  15. package/dist-lib/addFormApi-DEuEstyI.js.map +1 -0
  16. package/dist-lib/addFormApi-_5jnZVE1.cjs +2 -0
  17. package/dist-lib/addFormApi-_5jnZVE1.cjs.map +1 -0
  18. package/dist-lib/authApi-CERg2tGa.js +429 -0
  19. package/dist-lib/authApi-CERg2tGa.js.map +1 -0
  20. package/dist-lib/authApi-D4ufO1Os.cjs +2 -0
  21. package/dist-lib/authApi-D4ufO1Os.cjs.map +1 -0
  22. package/dist-lib/diceCandidateMapper-BjMhHno3.cjs +2 -0
  23. package/dist-lib/diceCandidateMapper-BjMhHno3.cjs.map +1 -0
  24. package/dist-lib/diceCandidateMapper-DqBO4EhL.js +201 -0
  25. package/dist-lib/diceCandidateMapper-DqBO4EhL.js.map +1 -0
  26. package/dist-lib/dropdownApi-BSlu1x_6.cjs +2 -0
  27. package/dist-lib/dropdownApi-BSlu1x_6.cjs.map +1 -0
  28. package/dist-lib/dropdownApi-C-DH4cqu.js +583 -0
  29. package/dist-lib/dropdownApi-C-DH4cqu.js.map +1 -0
  30. package/dist-lib/formGroupsCache-Bbz-28ws.cjs +2 -0
  31. package/dist-lib/formGroupsCache-Bbz-28ws.cjs.map +1 -0
  32. package/dist-lib/formGroupsCache-JeC59oNe.js +24 -0
  33. package/dist-lib/formGroupsCache-JeC59oNe.js.map +1 -0
  34. package/dist-lib/index.cjs +10 -0
  35. package/dist-lib/index.cjs.map +1 -0
  36. package/dist-lib/index.js +71151 -0
  37. package/dist-lib/index.js.map +1 -0
  38. package/dist-lib/jobsApi-0Z3ckOL3.cjs +2 -0
  39. package/dist-lib/jobsApi-0Z3ckOL3.cjs.map +1 -0
  40. package/dist-lib/jobsApi-BWnuOB-d.js +82 -0
  41. package/dist-lib/jobsApi-BWnuOB-d.js.map +1 -0
  42. package/dist-lib/recordAccess-BxBh-Qea.js +37 -0
  43. package/dist-lib/recordAccess-BxBh-Qea.js.map +1 -0
  44. package/dist-lib/recordAccess-C0idY6GV.cjs +2 -0
  45. package/dist-lib/recordAccess-C0idY6GV.cjs.map +1 -0
  46. package/dist-lib/rolldown-runtime-Chgba0Kb.cjs +1 -0
  47. package/dist-lib/rolldown-runtime-Dy4uBu1J.js +11 -0
  48. package/dist-lib/style.css +2 -0
  49. package/package.json +124 -6
@@ -0,0 +1,583 @@
1
+ import { C as e, D as t, E as n, O as r, S as i, o as a } from "./authApi-CERg2tGa.js";
2
+ import { t as o } from "./formGroupsCache-JeC59oNe.js";
3
+ import { at as s } from "./FileField-CYCUE0OI.js";
4
+ //#region src/services/candidateVersionsApi.js
5
+ async function c(e) {
6
+ let t = await a(i, `/candidate-versions?candidateId=${encodeURIComponent(e)}`), n = t?.data ?? t;
7
+ if (!Array.isArray(n)) throw Error("Candidate versions could not be loaded");
8
+ return [...n].sort((e, t) => Number(t.profileVersion) - Number(e.profileVersion));
9
+ }
10
+ //#endregion
11
+ //#region src/utils/numberRangeFilters.js
12
+ var l = [
13
+ "0 - 2 Years",
14
+ "2 - 5 Years",
15
+ "5 - 10 Years",
16
+ "10+ Years"
17
+ ];
18
+ function u(e) {
19
+ let t = (e.values || []).flatMap((t) => {
20
+ let n = String(t).trim().match(/^(\d+(?:\.\d+)?)\s*(?:-\s*(\d+(?:\.\d+)?)|(\+))\s*(?:Years?)?$/i);
21
+ return !n || n[2] !== void 0 && Number(n[2]) < Number(n[1]) ? [] : [{
22
+ field: e.field,
23
+ op: "numberRange",
24
+ from: n[1],
25
+ ...n[2] === void 0 ? {} : { to: n[2] }
26
+ }];
27
+ });
28
+ return {
29
+ field: e.field,
30
+ op: t.length ? "anyOf" : "none",
31
+ operator: e.operator === "or" ? "or" : "and",
32
+ ...t.length ? { conditions: t } : {}
33
+ };
34
+ }
35
+ //#endregion
36
+ //#region src/services/dropdownApi.js
37
+ var d = "authToken", f = "authUser", p = "authLoginSession", m = [
38
+ "access_token",
39
+ "refresh_token",
40
+ "id_token",
41
+ "token_type",
42
+ "expires_in",
43
+ "refresh_expires_in",
44
+ "menu",
45
+ "footermenu",
46
+ "menuPermission",
47
+ "default_values",
48
+ "roleId",
49
+ "companyName",
50
+ "preferred_Username",
51
+ "user_Email",
52
+ "userName",
53
+ "userId",
54
+ "tenantId",
55
+ "businessId",
56
+ "businessUnitId",
57
+ "activeKey",
58
+ "ct_project_id",
59
+ "ct_project_name"
60
+ ], h = "test-flows", g = [
61
+ {
62
+ value: "module",
63
+ label: "Module",
64
+ isVisible: !0,
65
+ type: "text"
66
+ },
67
+ {
68
+ value: "flow",
69
+ label: "Flow",
70
+ isVisible: !0,
71
+ type: "text"
72
+ },
73
+ {
74
+ value: "step_order",
75
+ label: "Step Order",
76
+ isVisible: !0,
77
+ type: "number"
78
+ },
79
+ {
80
+ value: "keyword",
81
+ label: "Action",
82
+ isVisible: !0,
83
+ type: "text"
84
+ },
85
+ {
86
+ value: "description",
87
+ label: "Description",
88
+ isVisible: !0,
89
+ type: "text"
90
+ },
91
+ {
92
+ value: "target",
93
+ label: "Key",
94
+ isVisible: !0,
95
+ type: "text"
96
+ },
97
+ {
98
+ value: "tags",
99
+ label: "Tags",
100
+ isVisible: !0,
101
+ type: "text"
102
+ },
103
+ {
104
+ value: "value",
105
+ label: "Value",
106
+ isVisible: !0,
107
+ type: "text"
108
+ },
109
+ {
110
+ value: "expected",
111
+ label: "Expected",
112
+ isVisible: !0,
113
+ type: "text"
114
+ }
115
+ ], _ = "lms-flows", v = [
116
+ {
117
+ value: "module",
118
+ label: "Module",
119
+ isVisible: !0,
120
+ type: "text"
121
+ },
122
+ {
123
+ value: "flow",
124
+ label: "Flow",
125
+ isVisible: !0,
126
+ type: "text"
127
+ },
128
+ {
129
+ value: "step_order",
130
+ label: "Step Order",
131
+ isVisible: !0,
132
+ type: "number"
133
+ },
134
+ {
135
+ value: "keyword",
136
+ label: "Action",
137
+ isVisible: !0,
138
+ type: "text"
139
+ },
140
+ {
141
+ value: "description",
142
+ label: "Description",
143
+ isVisible: !0,
144
+ type: "text"
145
+ },
146
+ {
147
+ value: "target",
148
+ label: "Key",
149
+ isVisible: !0,
150
+ type: "text"
151
+ },
152
+ {
153
+ value: "tags",
154
+ label: "Tags",
155
+ isVisible: !0,
156
+ type: "text"
157
+ },
158
+ {
159
+ value: "value",
160
+ label: "Value",
161
+ isVisible: !0,
162
+ type: "text"
163
+ },
164
+ {
165
+ value: "expected",
166
+ label: "Expected",
167
+ isVisible: !0,
168
+ type: "text"
169
+ }
170
+ ], y = null;
171
+ function b(e) {
172
+ return e?.token ?? e?.access_token ?? e?.accessToken ?? e?.jwt ?? e?.data?.token ?? e?.data?.access_token ?? e?.data?.accessToken ?? e?.data?.jwt;
173
+ }
174
+ function x(e) {
175
+ if (!e || typeof e != "string") return null;
176
+ try {
177
+ let t = e.split(".")[1];
178
+ if (!t) return null;
179
+ let n = t.replace(/-/g, "+").replace(/_/g, "/"), r = atob(n.padEnd(Math.ceil(n.length / 4) * 4, "="));
180
+ return JSON.parse(r);
181
+ } catch (e) {
182
+ return console.error("Unable to decode login token:", e), null;
183
+ }
184
+ }
185
+ function S() {
186
+ return localStorage.getItem(d);
187
+ }
188
+ async function C({ jobId: e, limit: t = 10, offset: r = 0, sortBy: i = "new", type: a = "myVendor" }) {
189
+ return await I(n, "/vendor/hotlist", {
190
+ method: "POST",
191
+ body: JSON.stringify({
192
+ jobId: e,
193
+ limit: t,
194
+ offset: r,
195
+ sortBy: i,
196
+ type: a
197
+ })
198
+ });
199
+ }
200
+ async function w(t) {
201
+ let n = await I(e, `/get-bulkmail-details?jobId=${encodeURIComponent(t)}`);
202
+ return n.data ?? n;
203
+ }
204
+ async function T(t = []) {
205
+ let n = [...new Set((t ?? []).map((e) => String(e ?? "").trim()).filter(Boolean))];
206
+ if (!n.length) return [];
207
+ let r = await I(e, "/candidate-emails", {
208
+ method: "POST",
209
+ body: JSON.stringify({ candidateIds: n })
210
+ }), i = r?.data ?? r;
211
+ return Array.isArray(i) ? i : [];
212
+ }
213
+ async function E(e, t) {
214
+ let n = String(e ?? "").trim(), r = String(t ?? "").trim();
215
+ if (!n || !r) return null;
216
+ let a = await I(i, `/module/list?module=${encodeURIComponent(n)}&id=${encodeURIComponent(r)}`), o = a?.data?.data ?? a?.data ?? [];
217
+ return Array.isArray(o) ? o[0] ?? null : null;
218
+ }
219
+ async function D(e, n = "") {
220
+ let r = String(e ?? "").trim();
221
+ if (!r) return "";
222
+ let i = await I(t, "/format-mail-content", {
223
+ method: "POST",
224
+ body: JSON.stringify({
225
+ contents: r,
226
+ subject: String(n ?? "")
227
+ })
228
+ });
229
+ if (i?.status === !1) throw Error(i?.error || "Unable to format mail content");
230
+ return String(i?.html ?? i?.contents ?? i?.data?.html ?? i?.data?.contents ?? "").trim();
231
+ }
232
+ async function O({ jobId: t, toMail: n, ccMail: r, bccMail: i, subject: a, contents: o, attachments: s = [] }) {
233
+ let c = localStorage.getItem("tenantId") || "93c782a4aa626175e5d11afa", l = localStorage.getItem("businessId") || "83c782a4aa626175e5d11afa", u = localStorage.getItem("businessUnitId") || "63b57588fd768a839dbc0f63", d = new FormData();
234
+ d.append("json", JSON.stringify({
235
+ schemaVersion: 1,
236
+ tenantId: c,
237
+ businessId: l,
238
+ businessUnitId: u,
239
+ jobId: t,
240
+ toMail: n,
241
+ ccMail: r,
242
+ bccMail: i,
243
+ contents: o,
244
+ subject: a
245
+ })), (s ?? []).forEach((e) => {
246
+ e instanceof File && e.size > 0 && String(e.name ?? "").trim() && d.append("attachments", e, e.name);
247
+ });
248
+ let { "Content-Type": f, ...p } = await F(), m = await fetch(`${e}/send-bulkmail`, {
249
+ method: "POST",
250
+ headers: p,
251
+ body: d
252
+ });
253
+ if (m.status === 401 && k(), !m.ok) throw Error(`API ${m.status}: ${m.statusText}`);
254
+ let h = await m.text();
255
+ return h ? JSON.parse(h) : {};
256
+ }
257
+ function k() {
258
+ localStorage.removeItem(d), localStorage.removeItem(f), m.forEach((e) => localStorage.removeItem(e)), sessionStorage.removeItem(p), window.dispatchEvent(new Event("auth:logout"));
259
+ }
260
+ function A(e = "") {
261
+ let t = String(e ?? "").trim();
262
+ return t === "myJobs" || t === "allJobs" || t === "fulfilled" ? t : "";
263
+ }
264
+ function j(e) {
265
+ let t = String(s(e) ?? "").trim().toLowerCase();
266
+ return t === "job" || t === "jobs";
267
+ }
268
+ function M(e, t = 30) {
269
+ let n = x(e), r = Number(n?.exp);
270
+ return !Number.isFinite(r) || r <= 0 ? !1 : r * 1e3 <= Date.now() + t * 1e3;
271
+ }
272
+ async function N() {
273
+ if (y) return y;
274
+ let e = String(localStorage.getItem("refresh_token") ?? "").trim();
275
+ if (!e) throw Object.assign(/* @__PURE__ */ Error("Session expired"), { status: 401 });
276
+ return y = fetch(`${i}/generate-refresh-token`, {
277
+ method: "POST",
278
+ headers: { "Content-Type": "application/json" },
279
+ body: JSON.stringify({ refresh_token: e })
280
+ }).then(async (e) => {
281
+ let t = await e.text(), n = {};
282
+ if (t) try {
283
+ n = JSON.parse(t);
284
+ } catch {
285
+ n = { error: t };
286
+ }
287
+ if (!e.ok) throw Object.assign(Error(n?.error ?? n?.message ?? `Token refresh failed: ${e.status}`), { status: e.status });
288
+ let r = b(n);
289
+ if (!r) throw Object.assign(/* @__PURE__ */ Error("Token refresh response did not contain an access token"), { status: 401 });
290
+ return localStorage.setItem(d, r), localStorage.setItem("access_token", r), r;
291
+ }).finally(() => {
292
+ y = null;
293
+ }), y;
294
+ }
295
+ async function P() {
296
+ let e = S();
297
+ if (e && !M(e)) return e;
298
+ if (localStorage.getItem("refresh_token")) try {
299
+ return await N();
300
+ } catch {}
301
+ if (e) return e;
302
+ let t = /* @__PURE__ */ Error("Authentication required");
303
+ throw t.status = 401, t;
304
+ }
305
+ async function F() {
306
+ return {
307
+ "Content-Type": "application/json",
308
+ Authorization: `Bearer ${await P()}`
309
+ };
310
+ }
311
+ async function I(e, t, n = {}) {
312
+ let r = async () => {
313
+ let r = await F();
314
+ return fetch(`${e}${t}`, {
315
+ ...n,
316
+ headers: {
317
+ ...r,
318
+ ...n.headers
319
+ }
320
+ });
321
+ }, i = await r();
322
+ if (i.status === 401 && localStorage.getItem("refresh_token")) try {
323
+ await N(), i = await r();
324
+ } catch {}
325
+ i.status === 401 && k();
326
+ let a = await i.text(), o = {};
327
+ if (a) try {
328
+ o = JSON.parse(a);
329
+ } catch {
330
+ o = { error: a };
331
+ }
332
+ if (!i.ok) {
333
+ let e = Error(o?.error ?? o?.message ?? `API ${i.status}: ${i.statusText}`);
334
+ throw e.status = i.status, e;
335
+ }
336
+ return o;
337
+ }
338
+ async function L(e, t) {
339
+ let n = await I(e, t);
340
+ return n.data ?? n;
341
+ }
342
+ async function R(e) {
343
+ return L(r, e);
344
+ }
345
+ async function z(e) {
346
+ return L(i, e);
347
+ }
348
+ async function B(e) {
349
+ return e === h ? g : e === _ ? v : R(`/filter-dropdown-fields?module=${encodeURIComponent(s(e))}`);
350
+ }
351
+ async function V(e, { configType: t, userId: n, roleId: r, includeMeta: i = !1 } = {}) {
352
+ if (e === h) return g;
353
+ if (e === _) return v;
354
+ let a = new URLSearchParams({ module: s(e) });
355
+ return t && a.set("configType", t), i && a.set("includeMeta", "1"), n != null && a.set("userId", String(n)), r != null && a.set("roleId", String(r)), z(`/admin/field-config?${a}`);
356
+ }
357
+ async function H({ limit: e = 10, offset: t = 0, search: n = "", module: r = "", keyword: i = "", tags: a = "", active: o } = {}) {
358
+ let s = new URLSearchParams({
359
+ limit: String(e),
360
+ offset: String(t)
361
+ });
362
+ return n && s.append("search", n), r && s.append("module", r), i && s.append("keyword", i), a && s.append("tags", a), o != null && o !== "" && s.append("active", String(o)), z(`/test-flows?${s.toString()}`);
363
+ }
364
+ async function U({ limit: e = 10, offset: t = 0, search: n = "", module: r = "", keyword: i = "", tags: a = "", active: o } = {}) {
365
+ let s = new URLSearchParams({
366
+ limit: String(e),
367
+ offset: String(t)
368
+ });
369
+ return n && s.append("search", n), r && s.append("module", r), i && s.append("keyword", i), a && s.append("tags", a), o != null && o !== "" && s.append("active", String(o)), z(`/lms-flows?${s.toString()}`);
370
+ }
371
+ async function W(e, t = 10, n = 0, r = {}) {
372
+ let { scope: a = "", sort: o = "", sortDir: c = "", search: l = "", filters: u = [], queryParams: d = {}, scopeConditions: f = [] } = r;
373
+ if (e === h) {
374
+ let e = await H({
375
+ limit: t,
376
+ offset: n
377
+ }), r = Array.isArray(e?.items) ? e.items : [], i = Number(e?.total) || 0;
378
+ return {
379
+ items: r,
380
+ total: i,
381
+ limit: t,
382
+ offset: n,
383
+ tabs: [{
384
+ key: "all",
385
+ title: "Test Cases",
386
+ count: i
387
+ }]
388
+ };
389
+ }
390
+ if (e === _) {
391
+ let e = await U({
392
+ limit: t,
393
+ offset: n
394
+ }), r = Array.isArray(e?.items) ? e.items : [], i = Number(e?.total) || 0;
395
+ return {
396
+ items: r,
397
+ total: i,
398
+ limit: t,
399
+ offset: n,
400
+ tabs: [{
401
+ key: "all",
402
+ title: "LMS Cases",
403
+ count: i
404
+ }]
405
+ };
406
+ }
407
+ let p = new URLSearchParams({
408
+ module: s(e),
409
+ limit: String(t),
410
+ offset: String(n)
411
+ }), m = j(e) ? A(a) : String(a ?? "").trim();
412
+ m && p.set("scope", m), o && p.set("sort", o), c && p.set("sortDir", c), String(l ?? "").trim() && p.set("search", String(l).trim());
413
+ let g = [...X(u.filter((e) => e?.field)), ...Array.isArray(f) ? f.filter((e) => e?.field) : []];
414
+ g.length && p.set("filters", JSON.stringify(g)), Object.entries(d ?? {}).forEach(([e, t]) => {
415
+ t != null && String(t).trim() !== "" && p.set(e, String(t));
416
+ });
417
+ let v = await I(i, `/module-data-list?${p.toString()}`), y = G(v), b = y.some((e) => J(e)), x = y.some((e) => Y(e));
418
+ if (b || x) try {
419
+ let { transformDiceResponseToInternalFormat: e } = await import("./diceCandidateMapper-DqBO4EhL.js").then((e) => e.t), r = e(v, v), i = r?.data?.data ?? [];
420
+ return {
421
+ items: i,
422
+ total: q(v, m) || q(r, m) || i.length,
423
+ limit: t,
424
+ offset: n,
425
+ tabs: r?.data?.tabs ?? v?.tabs ?? v?.data?.tabs ?? [],
426
+ fields: r?.data?.fields ?? v?.fields ?? v?.data?.fields ?? [],
427
+ tabField: r?.data?.tabField ?? v?.tabField ?? v?.data?.tabField ?? "",
428
+ actionRules: r?.data?.actionRules ?? v?.data?.actionRules ?? [],
429
+ actions: r?.data?.actions ?? v?.data?.actions ?? [],
430
+ columnActions: r?.data?.columnActions ?? v?.data?.columnActions ?? []
431
+ };
432
+ } catch (e) {
433
+ console.error("[getModuleDataList] Dice transformation failed:", e);
434
+ }
435
+ return v;
436
+ }
437
+ function G(e) {
438
+ let t = e?.data ?? e, n = Array.isArray(t) ? t : t?.rows ?? t?.records ?? t?.items ?? t?.list ?? t?.data ?? e?.items ?? e?.records ?? [];
439
+ return Array.isArray(n) ? n : [];
440
+ }
441
+ function K(...e) {
442
+ for (let t of e) {
443
+ let e = Number(t);
444
+ if (Number.isFinite(e)) return e;
445
+ }
446
+ }
447
+ function q(e, t = "") {
448
+ let n = e?.data ?? e, r = G(e), i = e?.count, a = n?.count, o = String(t ?? "").trim().toLowerCase();
449
+ if (i && typeof i == "object") {
450
+ let e = K(o ? i[o] : void 0, i.total, i.searchCount, i.count);
451
+ if (e !== void 0) return e;
452
+ }
453
+ if (a && typeof a == "object") {
454
+ let e = K(o ? a[o] : void 0, a.total, a.searchCount, a.count);
455
+ if (e !== void 0) return e;
456
+ }
457
+ return K(e?.total, typeof i == "object" ? void 0 : i, e?.totalCount, n?.total, typeof a == "object" ? void 0 : a, n?.totalCount, r.length) ?? 0;
458
+ }
459
+ function J(e) {
460
+ let t = e?.skills ?? e?.technicalSkills ?? e?.primarySkills;
461
+ return !Array.isArray(t) || t.length === 0 ? !1 : t.some((e) => e && typeof e == "object" && ("skill" in e || "lastUsed" in e));
462
+ }
463
+ function Y(e) {
464
+ return [
465
+ e?.sourceType,
466
+ e?.profileSource,
467
+ e?.selectedSource,
468
+ e?.customFields?.sourceType,
469
+ e?.customFields?.profileSource
470
+ ].flat().some((e) => String(e ?? "").trim().toLowerCase() === "dice") || !!e?.customFields?.diceProfileData;
471
+ }
472
+ function X(e) {
473
+ let t = [];
474
+ for (let n of e) {
475
+ if (!n.field) continue;
476
+ let e = n.operator === "or" ? "or" : "and";
477
+ if (n.operator === "isEmpty") {
478
+ t.push({
479
+ field: n.field,
480
+ op: "isEmpty",
481
+ operator: "and"
482
+ });
483
+ continue;
484
+ }
485
+ if (n.operator === "notEmpty") {
486
+ t.push({
487
+ field: n.field,
488
+ op: "notEmpty",
489
+ operator: "and"
490
+ });
491
+ continue;
492
+ }
493
+ if (n.filterInputType === "numberRanges") {
494
+ t.push(u(n));
495
+ continue;
496
+ }
497
+ if (n.filterInputType === "text") {
498
+ let r = typeof n.value == "string" ? n.value.trim() : "";
499
+ r && t.push({
500
+ field: n.field,
501
+ op: "contains",
502
+ value: r,
503
+ operator: e
504
+ });
505
+ continue;
506
+ }
507
+ if (n.from || n.to) {
508
+ n.from && t.push({
509
+ field: n.field,
510
+ op: "gte",
511
+ value: String(n.from),
512
+ operator: e
513
+ }), n.to && t.push({
514
+ field: n.field,
515
+ op: "lte",
516
+ value: String(n.to),
517
+ operator: "and"
518
+ });
519
+ continue;
520
+ }
521
+ Array.isArray(n.values) && n.values.length > 0 && t.push({
522
+ field: n.field,
523
+ op: "in",
524
+ values: n.values.map(String),
525
+ operator: e,
526
+ ...Array.isArray(n.groupFields) && n.groupFields.length > 1 ? { groupFields: n.groupFields } : {}
527
+ });
528
+ }
529
+ return t;
530
+ }
531
+ async function Z(e, t, n = "", r = {}) {
532
+ let { limit: i = 50, offset: a = 0, dataSource: o, groupName: c, lookup: l, groupFields: u = [], groupSeparator: d = " ", arrayLabelField: f = "", arrayValueField: p = "", scope: m = "", scopeConditions: h = [] } = r, g = s(e), _ = new URLSearchParams({
533
+ module: g,
534
+ field: t,
535
+ value: n,
536
+ limit: String(i),
537
+ offset: String(a)
538
+ });
539
+ o && _.set("dataSource", o), m && _.set("scope", j(e) ? A(m) : m);
540
+ let v = Array.isArray(h) ? h.filter((e) => e?.field) : [];
541
+ return v.length && _.set("filters", JSON.stringify(v)), f && _.set("arrayLabelField", f), p && _.set("arrayValueField", p), Array.isArray(u) && u.length > 1 && (_.set("groupFields", u.join(",")), _.set("groupSeparator", d ?? " ")), o === "group" && c && _.set("groupName", c), o === "lookup" && l?.collection && (_.set("lookupCollection", l.collection), l.displayField && _.set("lookupField", l.displayField)), String(g).trim().toLowerCase() === "sourcecandidates" ? z(`/candidates/filter-dropdown-values?${_}`) : R(`/filter-dropdown-values?${_}`);
542
+ }
543
+ function Q(e) {
544
+ let t = e?.data ?? e, n = Array.isArray(t) ? t : Array.isArray(t?.groups) ? t.groups : Array.isArray(e?.groups) ? e.groups : [], r = t?.recordMeta ?? e?.recordMeta;
545
+ r && typeof r == "object" && (n.recordMeta = r);
546
+ let i = t?.previewConfig ?? e?.previewConfig;
547
+ return i && typeof i == "object" && (n.previewConfig = i), n;
548
+ }
549
+ async function $({ module: e, id: t, view: n, clientId: r, region: a, candidateVersionId: s } = {}) {
550
+ if (!e) throw Error("module is required to fetch form groups");
551
+ let c = await F(), l = new URLSearchParams({ module: e });
552
+ t && l.set("id", String(t)), n && l.set("view", String(n)), r && l.set("clientId", String(r)), a && l.set("region", String(a)), s && l.set("candidateVersionId", s);
553
+ let u = `${i}/admin/form-groups?${l.toString()}`;
554
+ return Q(await o(u, async () => {
555
+ let e = await fetch(u, {
556
+ method: "GET",
557
+ headers: c
558
+ });
559
+ if (!e.ok) {
560
+ let t = /* @__PURE__ */ Error(`API ${e.status}: ${e.statusText}`);
561
+ throw t.status = e.status, t;
562
+ }
563
+ return e.json();
564
+ }));
565
+ }
566
+ async function ee({ searchQuery: e, candidateId: t }) {
567
+ let r = localStorage.getItem("tenantId") || "93c782a4aa626175e5d11afa", i = localStorage.getItem("businessId") || "83c782a4aa626175e5d11afa", a = localStorage.getItem("businessUnitId") || "63b57588fd768a839dbc0f63", o = Number(localStorage.getItem("userId")) || 1;
568
+ return I(n, "/joblist", {
569
+ method: "POST",
570
+ body: JSON.stringify({
571
+ tenantId: r,
572
+ businessId: i,
573
+ businessUnitId: a,
574
+ searchQuery: e,
575
+ userId: o,
576
+ candidateId: Array.isArray(t) ? t : [t]
577
+ })
578
+ });
579
+ }
580
+ //#endregion
581
+ export { B as a, $ as c, W as d, E as f, c as h, T as i, C as l, l as m, D as n, Z as o, O as p, w as r, V as s, I as t, ee as u };
582
+
583
+ //# sourceMappingURL=dropdownApi-C-DH4cqu.js.map