@burdenoff/microfe-support 2026.819.2 → 2026.819.3

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.
@@ -12,11 +12,10 @@ interface SharedDialogProps {
12
12
  jobPostingId: string;
13
13
  previewLoading: boolean;
14
14
  previewError: string | null;
15
- refreshTargets: (applicationIds: ReadonlyArray<string>) => Promise<BulkCandidateTarget[]>;
16
15
  }
17
- export declare function BulkCandidateSendDialog({ mode, open, onClose, onOpenAddRound, targets, selection, jobPostingId, previewLoading, previewError, refreshTargets, }: SharedDialogProps & {
16
+ export declare function BulkCandidateSendDialog({ mode, open, onClose, onOpenAddRound, targets, selection, jobPostingId, previewLoading, previewError, }: SharedDialogProps & {
18
17
  mode: BulkCandidateDialogMode;
19
18
  onOpenAddRound: () => void;
20
19
  }): import("react/jsx-runtime").JSX.Element;
21
- export declare function AddSelectedToRoundDialog({ open, onClose, targets, selection, jobPostingId, previewLoading, previewError, refreshTargets, }: SharedDialogProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function AddSelectedToRoundDialog({ open, onClose, targets, selection, jobPostingId, previewLoading, previewError, }: SharedDialogProps): import("react/jsx-runtime").JSX.Element;
22
21
  export {};
@@ -1,31 +1,31 @@
1
1
  import { Button as e, Checkbox as t, Dialog as n, DialogContent as r, DialogDescription as ee, DialogFooter as i, DialogHeader as te, DialogTitle as ne, Label as a, Select as re, SelectContent as ie, SelectItem as ae, SelectTrigger as oe, SelectValue as se, Textarea as o } from "../ui.js";
2
- import { BulkEnsureInterviewRoundsDocument as s, BulkRandomizeAndSendAssignmentDocument as ce, BulkSendRoundMessageDocument as c, useGetJobPostingQuery as le } from "../../../generated/global-operations.js";
3
- import { InterviewRoundType as l } from "../../../generated/global-types.js";
4
- import { nativeNotify as ue } from "../../../utils/nativeBridge.js";
5
- import { CandidateChunkPreconditionError as u, aggregateCandidateEmailResult as de, aggregateEnsureRoundResult as fe, assertCandidateChunkMatchesCurrentScope as d, assertCandidateEmailChunkMatchesCurrentScope as pe, assertCompleteCandidateEmailChunkResult as f, assertCompleteEnsureRoundChunkResult as p, createEmptyCandidateEmailAggregate as m, createEmptyEnsureRoundAggregate as h, executeSequentialCandidateChunks as me, getBulkOperationNotificationSeverity as he, getCandidateSelectionCount as ge, getSelectedCandidateIds as g, hasCandidateEmailType as _, resolveExactCandidateRounds as v } from "../../utils/bulkCandidateOperations.js";
6
- import { BulkCandidateActionGuidance as _e } from "./BulkCandidateActionGuidance.js";
7
- import { BulkOperationProgress as ve, CandidateEmailResultDetails as y, EnsureRoundResultDetails as ye, StoppedBulkOperationNotice as be } from "./BulkOperationFeedback.js";
8
- import { useEffect as xe, useMemo as Se, useState as b } from "react";
9
- import { AlertCircle as Ce, Loader2 as x, Send as S, UserPlus as we } from "lucide-react";
10
- import { graphqlFetch as C } from "@burdenoff/fe-libs/shared/graphql/fetch";
11
- import { jsx as w, jsxs as T } from "react/jsx-runtime";
12
- import { useApolloClient as Te } from "@apollo/client/react";
13
- import { print as E } from "graphql";
2
+ import { BulkEnsureInterviewRoundsDocument as s, BulkRandomizeAndSendAssignmentDocument as c, BulkSendRoundMessageDocument as l, useGetJobPostingQuery as ce } from "../../../generated/global-operations.js";
3
+ import { InterviewRoundType as u } from "../../../generated/global-types.js";
4
+ import { nativeNotify as le } from "../../../utils/nativeBridge.js";
5
+ import { aggregateCandidateEmailResult as d, aggregateEnsureRoundResult as f, assertCompleteCandidateEmailChunkResult as p, assertCompleteEnsureRoundChunkResult as ue, createEmptyCandidateEmailAggregate as m, createEmptyEnsureRoundAggregate as h, executeSequentialCandidateChunks as de, getBulkOperationNotificationSeverity as fe, getCandidateSelectionCount as pe, getSelectedCandidateIds as g, hasCandidateEmailType as _, resolveExactCandidateRounds as v } from "../../utils/bulkCandidateOperations.js";
6
+ import { BulkCandidateActionGuidance as y } from "./BulkCandidateActionGuidance.js";
7
+ import { BulkOperationProgress as me, CandidateEmailResultDetails as he, EnsureRoundResultDetails as b, StoppedBulkOperationNotice as ge } from "./BulkOperationFeedback.js";
8
+ import { useEffect as _e, useMemo as ve, useState as x } from "react";
9
+ import { AlertCircle as ye, Loader2 as S, Send as C, UserPlus as be } from "lucide-react";
10
+ import { graphqlFetch as w } from "@burdenoff/fe-libs/shared/graphql/fetch";
11
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
12
+ import { useApolloClient as xe } from "@apollo/client/react";
13
+ import { print as D } from "graphql";
14
14
  //#region src/support/components/careers/BulkCandidateDialogs.tsx
15
- function D(e) {
16
- return e.isAssignmentRound || e.roundType === l.TakeHome;
15
+ function O(e) {
16
+ return e.isAssignmentRound || e.roundType === u.TakeHome;
17
17
  }
18
- var O = {
18
+ var Se = {
19
19
  message: "ROUND_MESSAGE",
20
20
  assignment: "ASSIGNMENT"
21
21
  };
22
- function Ee(e) {
22
+ function Ce(e) {
23
23
  return e instanceof Error ? e.message : "The request failed without an error message.";
24
24
  }
25
25
  async function k(e, t, n) {
26
- let r = await C({
26
+ let r = await w({
27
27
  gateway: "global",
28
- query: E(e),
28
+ query: D(e),
29
29
  variables: t,
30
30
  operationName: n,
31
31
  skipAuthRetry: !0
@@ -34,47 +34,39 @@ async function k(e, t, n) {
34
34
  if (!r.data) throw Error(`${n} returned no data.`);
35
35
  return r.data;
36
36
  }
37
- function De(e, t) {
37
+ function we(e, t) {
38
38
  let n = g(t);
39
39
  return e.filter((e) => n.has(e.id));
40
40
  }
41
- async function Oe(e, t) {
42
- try {
43
- return await e(t);
44
- } catch (e) {
45
- throw new u(`Candidate scope revalidation failed before this chunk: ${Ee(e)}`);
46
- }
47
- }
48
- function A({ mode: s, open: l, onClose: u, onOpenAddRound: fe, targets: d, selection: p, jobPostingId: h, previewLoading: g, previewError: ye, refreshTargets: C }) {
49
- let E = Te(), [A, j] = b(""), [M, N] = b(""), [P, F] = b(!1), [I, L] = b(null), [ke, R] = b(m), [z, B] = b(null), [V, H] = b(!1), [U, W] = b(!1), { data: Ae, loading: G, error: je } = le({
50
- variables: { id: h },
51
- skip: !l || !h,
41
+ function A({ mode: s, open: u, onClose: f, onOpenAddRound: ue, targets: h, selection: g, jobPostingId: b, previewLoading: w, previewError: D }) {
42
+ let A = xe(), [j, M] = x(""), [N, P] = x(""), [F, I] = x(!1), [L, R] = x(null), [Te, z] = x(m), [B, V] = x(null), [H, U] = x(!1), [W, G] = x(!1), { data: Ee, loading: K, error: De } = ce({
43
+ variables: { id: b },
44
+ skip: !u || !b,
52
45
  fetchPolicy: "network-only"
53
46
  });
54
- xe(() => {
55
- l && (j(""), N(""), F(!1), L(null), R(m()), B(null), H(!1), W(!1));
56
- }, [l, s]);
57
- let K = Se(() => De(d, p), [p, d]), Me = ge(p), q = K.length === Me, Ne = Ae?.jobPosting?.rounds ?? [], Pe = Ne.filter((e) => s !== "assignment" || D(e)), J = Ne.find((e) => e.id === A), Y = J ? v(K, J.id) : {
47
+ _e(() => {
48
+ u && (M(""), P(""), I(!1), R(null), z(m()), V(null), U(!1), G(!1));
49
+ }, [u, s]);
50
+ let q = ve(() => we(h, g), [g, h]), Oe = pe(g), J = q.length === Oe, ke = Ee?.jobPosting?.rounds ?? [], Ae = ke.filter((e) => s !== "assignment" || O(e)), Y = ke.find((e) => e.id === j), X = Y ? v(q, Y.id) : {
58
51
  pairs: [],
59
52
  unresolved: []
60
- }, Fe = Y.unresolved.filter((e) => e.reason === "MISSING").length, X = Y.unresolved.filter((e) => e.reason === "AMBIGUOUS").length, Ie = O[s], Le = Y.pairs.filter(({ round: e }) => _(e, Ie)).length, Z = Y.pairs.filter(({ round: e }) => P || !_(e, Ie)).length, Re = K.some((e) => e.jobPostingId !== h), Q = ye;
61
- !Q && je ? Q = "Could not load the posting rounds. Nothing will be sent." : !Q && !g && !q ? Q = "Some selected candidate details are unavailable. Refresh the selection before sending." : !Q && Re ? Q = "Some selected candidates do not belong to the filtered posting." : !Q && A && !G && !J ? Q = "The selected round is no longer available. Choose another round." : !Q && X > 0 && (Q = `${X} selected candidate${X === 1 ? " has" : "s have"} multiple concrete rounds for this configuration. Nothing will be sent until the data is corrected.`);
62
- let ze = async () => {
63
- if (U || V || g || G || Q || !q || !J || Y.pairs.length === 0 || Z === 0 || s === "message" && !M.trim()) return;
64
- W(!0), H(!0), B(null), R(m());
65
- let e = await me({
66
- items: Y.pairs.map(({ applicationId: e, roundId: t }) => ({
53
+ }, je = X.unresolved.filter((e) => e.reason === "MISSING").length, Me = X.unresolved.filter((e) => e.reason === "AMBIGUOUS").length, Ne = Se[s], Pe = X.pairs.filter(({ round: e }) => _(e, Ne)).length, Z = X.pairs.filter(({ round: e }) => F || !_(e, Ne)).length, Fe = q.some((e) => e.jobPostingId !== b), Q = D;
54
+ !Q && De ? Q = "Could not load the posting rounds. Nothing will be sent." : !Q && !w && !J ? Q = "Some selected candidate details are unavailable. Refresh the selection before sending." : !Q && Fe ? Q = "Some selected candidates do not belong to the filtered posting." : !Q && j && !K && !Y ? Q = "The selected round is no longer available. Choose another round." : !Q && Me > 0 && (Q = `${Me} selected candidate${Me === 1 ? " has" : "s have"} multiple concrete rounds for this configuration. Nothing will be sent until the data is corrected.`);
55
+ let Ie = async () => {
56
+ if (W || H || w || K || Q || !J || !Y || X.pairs.length === 0 || Z === 0 || s === "message" && !N.trim()) return;
57
+ G(!0), U(!0), V(null), z(m());
58
+ let e = await de({
59
+ items: X.pairs.map(({ applicationId: e, roundId: t }) => ({
67
60
  applicationId: e,
68
61
  roundId: t
69
62
  })),
70
63
  initialAggregate: m(),
71
- onProgress: L,
64
+ onProgress: R,
72
65
  executeChunk: async (e) => {
73
- let t = await Oe(C, e.map((e) => e.applicationId));
74
- if (pe(e, t, h, J.id), s === "assignment") {
75
- let t = (await k(ce, { input: {
66
+ if (s === "assignment") {
67
+ let t = (await k(c, { input: {
76
68
  items: [...e],
77
- force: P
69
+ force: F
78
70
  } }, "BulkRandomizeAndSendAssignment")).bulkRandomizeAndSendAssignment;
79
71
  if (!t) throw Error("The assignment request returned no result.");
80
72
  let n = {
@@ -94,105 +86,105 @@ function A({ mode: s, open: l, onClose: u, onOpenAddRound: fe, targets: d, selec
94
86
  message: e.message
95
87
  }))
96
88
  };
97
- return f(e, n), n;
89
+ return p(e, n), n;
98
90
  }
99
- let n = (await k(c, { input: {
91
+ let t = (await k(l, { input: {
100
92
  items: [...e],
101
- message: M.trim(),
102
- force: P
93
+ message: N.trim(),
94
+ force: F
103
95
  } }, "BulkSendRoundMessage")).bulkSendRoundMessage;
104
- if (!n) throw Error("The message request returned no result.");
105
- let r = {
106
- succeeded: n.succeeded.map((e) => ({
96
+ if (!t) throw Error("The message request returned no result.");
97
+ let n = {
98
+ succeeded: t.succeeded.map((e) => ({
107
99
  applicationId: e.applicationId,
108
100
  roundId: e.id
109
101
  })),
110
- skipped: n.skipped.map((e) => ({
102
+ skipped: t.skipped.map((e) => ({
111
103
  applicationId: e.applicationId,
112
104
  roundId: e.roundId,
113
105
  reason: e.reason,
114
106
  message: e.message
115
107
  })),
116
- failed: n.failed.map((e) => ({
108
+ failed: t.failed.map((e) => ({
117
109
  applicationId: e.applicationId,
118
110
  roundId: e.roundId,
119
111
  message: e.message
120
112
  }))
121
113
  };
122
- return f(e, r), r;
114
+ return p(e, n), n;
123
115
  },
124
- mergeResult: de
116
+ mergeResult: d
125
117
  });
126
- R(e.aggregate), e.error && B({
118
+ z(e.aggregate), e.error && V({
127
119
  knownCompleted: e.processedItems.length,
128
120
  ambiguous: e.ambiguousItems.length,
129
121
  notStarted: e.notStartedItems.length,
130
- message: Ee(e.error)
131
- }), ue(he({
122
+ message: Ce(e.error)
123
+ }), le(fe({
132
124
  succeeded: e.aggregate.succeeded.length,
133
125
  skipped: e.aggregate.skipped.length,
134
126
  failed: e.aggregate.failed.length,
135
127
  ambiguous: !!e.error
136
- })), W(!1), E.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
137
- }, $ = g || G;
138
- return /* @__PURE__ */ w(n, {
139
- open: l,
128
+ })), G(!1), A.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
129
+ }, $ = w || K;
130
+ return /* @__PURE__ */ T(n, {
131
+ open: u,
140
132
  onOpenChange: (e) => {
141
- !e && !U && u();
133
+ !e && !W && f();
142
134
  },
143
- children: /* @__PURE__ */ T(r, {
135
+ children: /* @__PURE__ */ E(r, {
144
136
  className: "sm:max-w-xl max-h-[90vh] overflow-y-auto",
145
137
  children: [
146
- /* @__PURE__ */ T(te, { children: [/* @__PURE__ */ w(ne, { children: s === "assignment" ? "Assign & Email Random Take-Home" : "Send Message" }), /* @__PURE__ */ w(ee, { children: "Choose one configured round for the candidates in the filtered posting." })] }),
147
- /* @__PURE__ */ w(_e, {
138
+ /* @__PURE__ */ E(te, { children: [/* @__PURE__ */ T(ne, { children: s === "assignment" ? "Assign & Email Random Take-Home" : "Send Message" }), /* @__PURE__ */ T(ee, { children: "Choose one configured round for the candidates in the filtered posting." })] }),
139
+ /* @__PURE__ */ T(y, {
148
140
  action: s,
149
- unresolvedCount: Fe
141
+ unresolvedCount: je
150
142
  }),
151
- V ? /* @__PURE__ */ T("div", {
143
+ H ? /* @__PURE__ */ E("div", {
152
144
  className: "space-y-4",
153
145
  children: [
154
- I ? /* @__PURE__ */ w(ve, { progress: I }) : null,
155
- /* @__PURE__ */ w(y, { result: ke }),
156
- z ? /* @__PURE__ */ w(be, { details: z }) : null,
157
- /* @__PURE__ */ w(i, { children: /* @__PURE__ */ w(e, {
158
- onClick: u,
159
- disabled: U,
146
+ L ? /* @__PURE__ */ T(me, { progress: L }) : null,
147
+ /* @__PURE__ */ T(he, { result: Te }),
148
+ B ? /* @__PURE__ */ T(ge, { details: B }) : null,
149
+ /* @__PURE__ */ T(i, { children: /* @__PURE__ */ T(e, {
150
+ onClick: f,
151
+ disabled: W,
160
152
  children: "Done"
161
153
  }) })
162
154
  ]
163
- }) : /* @__PURE__ */ T("div", {
155
+ }) : /* @__PURE__ */ E("div", {
164
156
  className: "space-y-4",
165
157
  children: [
166
- $ ? /* @__PURE__ */ T("div", {
158
+ $ ? /* @__PURE__ */ E("div", {
167
159
  className: "flex items-center gap-2 text-sm text-text-secondary",
168
- children: [/* @__PURE__ */ w(x, {
160
+ children: [/* @__PURE__ */ T(S, {
169
161
  size: 14,
170
162
  className: "animate-spin"
171
163
  }), "Refreshing candidates and configured rounds…"]
172
164
  }) : null,
173
- Q ? /* @__PURE__ */ T("div", {
165
+ Q ? /* @__PURE__ */ E("div", {
174
166
  className: "flex items-start gap-2 text-sm text-status-error-text",
175
167
  role: "alert",
176
- children: [/* @__PURE__ */ w(Ce, {
168
+ children: [/* @__PURE__ */ T(ye, {
177
169
  size: 14,
178
170
  className: "mt-0.5 shrink-0"
179
- }), /* @__PURE__ */ w("span", { children: Q })]
171
+ }), /* @__PURE__ */ T("span", { children: Q })]
180
172
  }) : null,
181
- /* @__PURE__ */ T("div", {
173
+ /* @__PURE__ */ E("div", {
182
174
  className: "space-y-1.5",
183
175
  children: [
184
- /* @__PURE__ */ w(a, {
176
+ /* @__PURE__ */ T(a, {
185
177
  htmlFor: "bulk-round-config",
186
178
  children: "Target round"
187
179
  }),
188
- /* @__PURE__ */ T(re, {
189
- value: A,
190
- onValueChange: j,
180
+ /* @__PURE__ */ E(re, {
181
+ value: j,
182
+ onValueChange: M,
191
183
  disabled: $ || !!Q,
192
- children: [/* @__PURE__ */ w(oe, {
184
+ children: [/* @__PURE__ */ T(oe, {
193
185
  id: "bulk-round-config",
194
- children: /* @__PURE__ */ w(se, { placeholder: "Select a round" })
195
- }), /* @__PURE__ */ w(ie, { children: Pe.map((e) => /* @__PURE__ */ T(ae, {
186
+ children: /* @__PURE__ */ T(se, { placeholder: "Select a round" })
187
+ }), /* @__PURE__ */ T(ie, { children: Ae.map((e) => /* @__PURE__ */ E(ae, {
196
188
  value: e.id,
197
189
  children: [
198
190
  "Round ",
@@ -202,35 +194,35 @@ function A({ mode: s, open: l, onClose: u, onOpenAddRound: fe, targets: d, selec
202
194
  ]
203
195
  }, e.id)) })]
204
196
  }),
205
- Pe.length === 0 && !$ && !Q ? /* @__PURE__ */ w("p", {
197
+ Ae.length === 0 && !$ && !Q ? /* @__PURE__ */ T("p", {
206
198
  className: "text-xs text-status-warning-text",
207
199
  children: s === "assignment" ? "This posting has no configured assignment round." : "This posting has no configured interview rounds."
208
200
  }) : null
209
201
  ]
210
202
  }),
211
- s === "message" ? /* @__PURE__ */ T("div", {
203
+ s === "message" ? /* @__PURE__ */ E("div", {
212
204
  className: "space-y-1.5",
213
- children: [/* @__PURE__ */ w(a, {
205
+ children: [/* @__PURE__ */ T(a, {
214
206
  htmlFor: "bulk-message",
215
207
  children: "Free-text message"
216
- }), /* @__PURE__ */ w(o, {
208
+ }), /* @__PURE__ */ T(o, {
217
209
  id: "bulk-message",
218
- value: M,
219
- onChange: (e) => N(e.target.value),
210
+ value: N,
211
+ onChange: (e) => P(e.target.value),
220
212
  placeholder: "Write the message sent to each candidate",
221
213
  rows: 5
222
214
  })]
223
215
  }) : null,
224
- A && !$ && !Q ? /* @__PURE__ */ T("div", {
216
+ j && !$ && !Q ? /* @__PURE__ */ E("div", {
225
217
  className: "space-y-2 rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-xs text-text-secondary",
226
218
  children: [
227
- /* @__PURE__ */ w("p", {
219
+ /* @__PURE__ */ T("p", {
228
220
  className: "font-medium text-text-primary",
229
221
  children: "Preview"
230
222
  }),
231
- /* @__PURE__ */ T("p", { children: [
223
+ /* @__PURE__ */ E("p", { children: [
232
224
  "Will send to ",
233
- /* @__PURE__ */ w("span", {
225
+ /* @__PURE__ */ T("span", {
234
226
  className: "font-semibold",
235
227
  children: Z
236
228
  }),
@@ -238,41 +230,41 @@ function A({ mode: s, open: l, onClose: u, onOpenAddRound: fe, targets: d, selec
238
230
  Z === 1 ? "" : "s",
239
231
  "."
240
232
  ] }),
241
- Le > 0 ? /* @__PURE__ */ T("p", { children: [
242
- Le,
233
+ Pe > 0 ? /* @__PURE__ */ E("p", { children: [
234
+ Pe,
243
235
  " already received this email type",
244
236
  " ",
245
- P ? "(force will send again)" : "(the backend will skip them)",
237
+ F ? "(force will send again)" : "(the backend will skip them)",
246
238
  "."
247
239
  ] }) : null,
248
- Fe > 0 ? /* @__PURE__ */ T(e, {
240
+ je > 0 ? /* @__PURE__ */ E(e, {
249
241
  type: "button",
250
242
  size: "sm",
251
243
  variant: "outline",
252
- onClick: fe,
253
- children: [/* @__PURE__ */ w(we, { size: 14 }), "Add Selected to Round"]
244
+ onClick: ue,
245
+ children: [/* @__PURE__ */ T(be, { size: 14 }), "Add Selected to Round"]
254
246
  }) : null,
255
- /* @__PURE__ */ T("label", {
247
+ /* @__PURE__ */ E("label", {
256
248
  className: "flex cursor-pointer items-start gap-2 pt-1",
257
- children: [/* @__PURE__ */ w(t, {
258
- checked: P,
259
- onCheckedChange: (e) => F(e === !0)
260
- }), /* @__PURE__ */ w("span", { children: "Force resend to candidates with a prior email. Force sends are non-idempotent and are never retried automatically." })]
249
+ children: [/* @__PURE__ */ T(t, {
250
+ checked: F,
251
+ onCheckedChange: (e) => I(e === !0)
252
+ }), /* @__PURE__ */ T("span", { children: "Force resend to candidates with a prior email. Force sends are non-idempotent and are never retried automatically." })]
261
253
  })
262
254
  ]
263
255
  }) : null,
264
- /* @__PURE__ */ T(i, { children: [/* @__PURE__ */ w(e, {
256
+ /* @__PURE__ */ E(i, { children: [/* @__PURE__ */ T(e, {
265
257
  variant: "outline",
266
- onClick: u,
267
- disabled: U,
258
+ onClick: f,
259
+ disabled: W,
268
260
  children: "Cancel"
269
- }), /* @__PURE__ */ T(e, {
270
- onClick: () => void ze(),
271
- disabled: U || $ || !!Q || !q || !A || Y.pairs.length === 0 || Z === 0 || s === "message" && !M.trim(),
272
- children: [U ? /* @__PURE__ */ w(x, {
261
+ }), /* @__PURE__ */ E(e, {
262
+ onClick: () => void Ie(),
263
+ disabled: W || $ || !!Q || !J || !j || X.pairs.length === 0 || Z === 0 || s === "message" && !N.trim(),
264
+ children: [W ? /* @__PURE__ */ T(S, {
273
265
  size: 16,
274
266
  className: "mr-2 animate-spin"
275
- }) : /* @__PURE__ */ w(S, { size: 16 }), U ? "Sending…" : "Send"]
267
+ }) : /* @__PURE__ */ T(C, { size: 16 }), W ? "Sending…" : "Send"]
276
268
  })] })
277
269
  ]
278
270
  })
@@ -280,122 +272,120 @@ function A({ mode: s, open: l, onClose: u, onOpenAddRound: fe, targets: d, selec
280
272
  })
281
273
  });
282
274
  }
283
- function j({ open: t, onClose: o, targets: ce, selection: c, jobPostingId: l, previewLoading: u, previewError: de, refreshTargets: pe }) {
284
- let f = Te(), [m, g] = b(""), [_, v] = b(null), [_e, y] = b(h), [S, C] = b(null), [E, D] = b(!1), [O, A] = b(!1), { data: j, loading: M, error: N } = le({
285
- variables: { id: l },
286
- skip: !t || !l,
275
+ function j({ open: t, onClose: o, targets: c, selection: l, jobPostingId: u, previewLoading: d, previewError: p }) {
276
+ let m = xe(), [g, _] = x(""), [v, y] = x(null), [he, C] = x(h), [w, D] = x(null), [O, Se] = x(!1), [A, j] = x(!1), { data: M, loading: N, error: P } = ce({
277
+ variables: { id: u },
278
+ skip: !t || !u,
287
279
  fetchPolicy: "network-only"
288
280
  });
289
- xe(() => {
290
- t && (g(""), v(null), y(h()), C(null), D(!1), A(!1));
281
+ _e(() => {
282
+ t && (_(""), y(null), C(h()), D(null), Se(!1), j(!1));
291
283
  }, [t]);
292
- let P = Se(() => De(ce, c), [c, ce]), F = ge(c), I = P.length === F, L = P.map((e) => e.id), ke = P.some((e) => e.jobPostingId !== l), R = j?.jobPosting?.rounds ?? [], z = R.find((e) => e.id === m), B = de;
293
- !B && N ? B = "Could not load the posting rounds. Nothing will be changed." : !B && !u && !I ? B = "Some selected candidate details are unavailable. Refresh the selection before adding rounds." : !B && ke ? B = "Some selected candidates do not belong to the filtered posting." : !B && m && !M && !z && (B = "The selected round is no longer available. Choose another round.");
294
- let V = async () => {
295
- if (O || E || u || M || B || !I || !z || L.length === 0) return;
296
- A(!0), D(!0), C(null), y(h());
297
- let e = await me({
298
- items: L,
284
+ let F = ve(() => we(c, l), [l, c]), I = pe(l), L = F.length === I, R = F.map((e) => e.id), Te = F.some((e) => e.jobPostingId !== u), z = M?.jobPosting?.rounds ?? [], B = z.find((e) => e.id === g), V = p;
285
+ !V && P ? V = "Could not load the posting rounds. Nothing will be changed." : !V && !d && !L ? V = "Some selected candidate details are unavailable. Refresh the selection before adding rounds." : !V && Te ? V = "Some selected candidates do not belong to the filtered posting." : !V && g && !N && !B && (V = "The selected round is no longer available. Choose another round.");
286
+ let H = async () => {
287
+ if (A || O || d || N || V || !L || !B || R.length === 0) return;
288
+ j(!0), Se(!0), D(null), C(h());
289
+ let e = await de({
290
+ items: R,
299
291
  initialAggregate: h(),
300
- onProgress: v,
292
+ onProgress: y,
301
293
  executeChunk: async (e) => {
302
- let t = await Oe(pe, e);
303
- d(e, t, l);
304
- let n = (await k(s, { input: {
305
- jobPostingId: l,
306
- roundConfigId: z.id,
294
+ let t = (await k(s, { input: {
295
+ jobPostingId: u,
296
+ roundConfigId: B.id,
307
297
  applicationIds: [...e]
308
298
  } }, "BulkEnsureInterviewRounds")).bulkEnsureInterviewRounds;
309
- if (!n) throw Error("The add-to-round request returned no result.");
310
- let r = {
311
- created: n.created.map((e) => ({
299
+ if (!t) throw Error("The add-to-round request returned no result.");
300
+ let n = {
301
+ created: t.created.map((e) => ({
312
302
  id: e.round.id,
313
303
  applicationId: e.applicationId
314
304
  })),
315
- alreadyPresent: n.alreadyPresent.map((e) => ({
305
+ alreadyPresent: t.alreadyPresent.map((e) => ({
316
306
  id: e.round.id,
317
307
  applicationId: e.applicationId
318
308
  })),
319
- failed: n.failed.map((e) => ({
309
+ failed: t.failed.map((e) => ({
320
310
  applicationId: e.applicationId,
321
311
  code: e.code,
322
312
  message: e.message
323
313
  }))
324
314
  };
325
- return p(e, r), r;
315
+ return ue(e, n), n;
326
316
  },
327
- mergeResult: fe
317
+ mergeResult: f
328
318
  });
329
- y(e.aggregate), e.error && C({
319
+ C(e.aggregate), e.error && D({
330
320
  knownCompleted: e.processedItems.length,
331
321
  ambiguous: e.ambiguousItems.length,
332
322
  notStarted: e.notStartedItems.length,
333
- message: Ee(e.error)
334
- }), ue(he({
323
+ message: Ce(e.error)
324
+ }), le(fe({
335
325
  succeeded: e.aggregate.created.length + e.aggregate.alreadyPresent.length,
336
326
  skipped: 0,
337
327
  failed: e.aggregate.failed.length,
338
328
  ambiguous: !!e.error
339
- })), A(!1), f.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
340
- }, H = u || M;
341
- return /* @__PURE__ */ w(n, {
329
+ })), j(!1), m.refetchQueries({ include: ["GetJobApplications", "GetJobApplicationInterviewRounds"] }).catch(() => void 0);
330
+ }, U = d || N;
331
+ return /* @__PURE__ */ T(n, {
342
332
  open: t,
343
333
  onOpenChange: (e) => {
344
- !e && !O && o();
334
+ !e && !A && o();
345
335
  },
346
- children: /* @__PURE__ */ T(r, {
336
+ children: /* @__PURE__ */ E(r, {
347
337
  className: "sm:max-w-xl max-h-[90vh] overflow-y-auto",
348
338
  children: [
349
- /* @__PURE__ */ T(te, { children: [/* @__PURE__ */ w(ne, { children: "Add Selected to Round" }), /* @__PURE__ */ w(ee, { children: "Add every selected candidate in this posting to one configured interview round." })] }),
350
- /* @__PURE__ */ w("div", {
339
+ /* @__PURE__ */ E(te, { children: [/* @__PURE__ */ T(ne, { children: "Add Selected to Round" }), /* @__PURE__ */ T(ee, { children: "Add every selected candidate in this posting to one configured interview round." })] }),
340
+ /* @__PURE__ */ T("div", {
351
341
  className: "rounded-md border border-border-seam bg-bg-sunken/30 p-3 text-sm text-text-secondary",
352
342
  children: "Candidates without this concrete round are added with status Scheduled. Existing target rounds are left unchanged, and all prior round history and application status remain unchanged."
353
343
  }),
354
- E ? /* @__PURE__ */ T("div", {
344
+ O ? /* @__PURE__ */ E("div", {
355
345
  className: "space-y-4",
356
346
  children: [
357
- _ ? /* @__PURE__ */ w(ve, { progress: _ }) : null,
358
- /* @__PURE__ */ w(ye, { result: _e }),
359
- S ? /* @__PURE__ */ w(be, { details: S }) : null,
360
- /* @__PURE__ */ w(i, { children: /* @__PURE__ */ w(e, {
347
+ v ? /* @__PURE__ */ T(me, { progress: v }) : null,
348
+ /* @__PURE__ */ T(b, { result: he }),
349
+ w ? /* @__PURE__ */ T(ge, { details: w }) : null,
350
+ /* @__PURE__ */ T(i, { children: /* @__PURE__ */ T(e, {
361
351
  onClick: o,
362
- disabled: O,
352
+ disabled: A,
363
353
  children: "Done"
364
354
  }) })
365
355
  ]
366
- }) : /* @__PURE__ */ T("div", {
356
+ }) : /* @__PURE__ */ E("div", {
367
357
  className: "space-y-4",
368
358
  children: [
369
- H ? /* @__PURE__ */ T("div", {
359
+ U ? /* @__PURE__ */ E("div", {
370
360
  className: "flex items-center gap-2 text-sm text-text-secondary",
371
- children: [/* @__PURE__ */ w(x, {
361
+ children: [/* @__PURE__ */ T(S, {
372
362
  size: 14,
373
363
  className: "animate-spin"
374
364
  }), "Refreshing candidates and configured rounds…"]
375
365
  }) : null,
376
- B ? /* @__PURE__ */ T("div", {
366
+ V ? /* @__PURE__ */ E("div", {
377
367
  className: "flex items-start gap-2 text-sm text-status-error-text",
378
368
  role: "alert",
379
- children: [/* @__PURE__ */ w(Ce, {
369
+ children: [/* @__PURE__ */ T(ye, {
380
370
  size: 14,
381
371
  className: "mt-0.5 shrink-0"
382
- }), /* @__PURE__ */ w("span", { children: B })]
372
+ }), /* @__PURE__ */ T("span", { children: V })]
383
373
  }) : null,
384
- /* @__PURE__ */ T("div", {
374
+ /* @__PURE__ */ E("div", {
385
375
  className: "space-y-1.5",
386
376
  children: [
387
- /* @__PURE__ */ w(a, {
377
+ /* @__PURE__ */ T(a, {
388
378
  htmlFor: "ensure-round-config",
389
379
  children: "Interview round"
390
380
  }),
391
- /* @__PURE__ */ T(re, {
392
- value: m,
393
- onValueChange: g,
394
- disabled: H || !!B,
395
- children: [/* @__PURE__ */ w(oe, {
381
+ /* @__PURE__ */ E(re, {
382
+ value: g,
383
+ onValueChange: _,
384
+ disabled: U || !!V,
385
+ children: [/* @__PURE__ */ T(oe, {
396
386
  id: "ensure-round-config",
397
- children: /* @__PURE__ */ w(se, { placeholder: "Select a round" })
398
- }), /* @__PURE__ */ w(ie, { children: R.map((e) => /* @__PURE__ */ T(ae, {
387
+ children: /* @__PURE__ */ T(se, { placeholder: "Select a round" })
388
+ }), /* @__PURE__ */ T(ie, { children: z.map((e) => /* @__PURE__ */ E(ae, {
399
389
  value: e.id,
400
390
  children: [
401
391
  "Round ",
@@ -405,34 +395,34 @@ function j({ open: t, onClose: o, targets: ce, selection: c, jobPostingId: l, pr
405
395
  ]
406
396
  }, e.id)) })]
407
397
  }),
408
- R.length === 0 && !H && !B ? /* @__PURE__ */ w("p", {
398
+ z.length === 0 && !U && !V ? /* @__PURE__ */ T("p", {
409
399
  className: "text-xs text-status-warning-text",
410
400
  children: "This posting has no configured interview rounds."
411
401
  }) : null
412
402
  ]
413
403
  }),
414
- /* @__PURE__ */ T("p", {
404
+ /* @__PURE__ */ E("p", {
415
405
  className: "text-xs text-text-secondary",
416
406
  children: [
417
- F,
407
+ I,
418
408
  " selected candidate",
419
- F === 1 ? "" : "s",
409
+ I === 1 ? "" : "s",
420
410
  " ",
421
411
  "will be checked. Existing target rounds are reported as already present."
422
412
  ]
423
413
  }),
424
- /* @__PURE__ */ T(i, { children: [/* @__PURE__ */ w(e, {
414
+ /* @__PURE__ */ E(i, { children: [/* @__PURE__ */ T(e, {
425
415
  variant: "outline",
426
416
  onClick: o,
427
- disabled: O,
417
+ disabled: A,
428
418
  children: "Cancel"
429
- }), /* @__PURE__ */ T(e, {
430
- onClick: () => void V(),
431
- disabled: O || H || !!B || !I || !m || L.length === 0,
432
- children: [O ? /* @__PURE__ */ w(x, {
419
+ }), /* @__PURE__ */ E(e, {
420
+ onClick: () => void H(),
421
+ disabled: A || U || !!V || !L || !g || R.length === 0,
422
+ children: [A ? /* @__PURE__ */ T(S, {
433
423
  size: 16,
434
424
  className: "mr-2 animate-spin"
435
- }) : /* @__PURE__ */ w(we, { size: 16 }), O ? "Adding…" : "Add Selected to Round"]
425
+ }) : /* @__PURE__ */ T(be, { size: 16 }), A ? "Adding…" : "Add Selected to Round"]
436
426
  })] })
437
427
  ]
438
428
  })
@@ -441,6 +431,6 @@ function j({ open: t, onClose: o, targets: ce, selection: c, jobPostingId: l, pr
441
431
  });
442
432
  }
443
433
  //#endregion
444
- export { j as AddSelectedToRoundDialog, A as BulkCandidateSendDialog, D as isAssignmentRoundConfig };
434
+ export { j as AddSelectedToRoundDialog, A as BulkCandidateSendDialog, O as isAssignmentRoundConfig };
445
435
 
446
436
  //# sourceMappingURL=BulkCandidateDialogs.js.map