@burdenoff/microfe-support 2026.802.1 → 2026.817.1

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.
@@ -0,0 +1,996 @@
1
+ import { Badge as e, Button as t, Tabs as n, TabsContent as r, TabsList as ee, TabsTrigger as i } from "../components/ui.js";
2
+ import { useCreateInterviewRoundConfigMutation as te, useCreateJobAssignmentMutation as ne, useDeleteInterviewRoundConfigMutation as re, useDeleteJobAssignmentMutation as ie, useGetJobPostingQuery as ae, useUpdateInterviewRoundConfigMutation as oe, useUpdateJobAssignmentMutation as se, useUpdateJobPostingMutation as ce } from "../../generated/global-operations.js";
3
+ import { EmploymentType as a, InterviewRoundType as o, JobPostingStatus as s } from "../../generated/global-types.js";
4
+ import { cn as c } from "../utils/cn.js";
5
+ import { EmptyState as l, LoadingState as le, PageLayout as u } from "../components/PageLayout.js";
6
+ import { useEffect as ue, useRef as d, useState as f } from "react";
7
+ import { AlertCircle as p, ArrowLeft as m, Briefcase as h, Building2 as de, Check as g, CheckCircle as fe, Clock as pe, Edit2 as _, FileText as me, Layers as he, Loader2 as v, MapPin as ge, Plus as y, Trash2 as _e, Users as ve, X as b } from "lucide-react";
8
+ import { useNavigate as ye, useParams as be } from "react-router";
9
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
10
+ import { AlertDialog as xe, AlertDialogAction as Se, AlertDialogCancel as Ce, AlertDialogContent as we, AlertDialogDescription as Te, AlertDialogFooter as w, AlertDialogHeader as T, AlertDialogTitle as E, ResponsiveDialog as D, ResponsiveDialogContent as O, ResponsiveDialogHeader as k, ResponsiveDialogTitle as A } from "@burdenoff/fe-libs/ui";
11
+ //#region src/support/pages/JobPostingDetailPage.tsx
12
+ var Ee = {
13
+ [s.Draft]: {
14
+ label: "Draft",
15
+ variant: "secondary"
16
+ },
17
+ [s.Open]: {
18
+ label: "Open",
19
+ variant: "success"
20
+ },
21
+ [s.Closed]: {
22
+ label: "Closed",
23
+ variant: "warning"
24
+ },
25
+ [s.Archived]: {
26
+ label: "Archived",
27
+ variant: "destructive"
28
+ }
29
+ }, De = {
30
+ [a.FullTime]: "Full-time",
31
+ [a.PartTime]: "Part-time",
32
+ [a.Contract]: "Contract",
33
+ [a.Internship]: "Internship"
34
+ }, Oe = {
35
+ [o.PhoneScreen]: "Phone Screen",
36
+ [o.Technical]: "Technical",
37
+ [o.CultureFit]: "Culture Fit",
38
+ [o.Hr]: "HR",
39
+ [o.TakeHome]: "Take-home",
40
+ [o.Final]: "Final"
41
+ }, j = {
42
+ NEW: "bg-status-info-bg-subtle text-status-info-text",
43
+ SCREENING: "bg-status-warning-bg-subtle text-status-warning-text",
44
+ SHORTLISTED: "bg-accent-purple-subtle text-accent-purple",
45
+ INTERVIEW: "bg-accent-blue-subtle text-accent-blue",
46
+ HIRED: "bg-status-success-bg-subtle text-status-success-text",
47
+ REJECTED: "bg-status-error-bg-subtle text-status-error-text",
48
+ ARCHIVED: "bg-bg-sunken text-text-secondary"
49
+ }, ke = {
50
+ NEW: "New",
51
+ SCREENING: "Screening",
52
+ SHORTLISTED: "Shortlisted",
53
+ INTERVIEW: "Interview",
54
+ HIRED: "Hired",
55
+ REJECTED: "Rejected",
56
+ ARCHIVED: "Archived"
57
+ };
58
+ function Ae(e) {
59
+ return new Date(e).toLocaleDateString("en-US", {
60
+ month: "short",
61
+ day: "numeric",
62
+ year: "numeric"
63
+ });
64
+ }
65
+ function je() {
66
+ let [e, t] = f(null), n = d(null);
67
+ return ue(() => () => {
68
+ n.current && clearTimeout(n.current);
69
+ }, []), {
70
+ notification: e,
71
+ show: (e, r) => {
72
+ t({
73
+ type: e,
74
+ message: r
75
+ }), n.current && clearTimeout(n.current), n.current = setTimeout(() => t(null), 3e3);
76
+ }
77
+ };
78
+ }
79
+ function M() {
80
+ let { id: d } = be(), M = ye(), { notification: N, show: P } = je(), [Me, Ne] = f("rounds"), [Pe, F] = f(!1), [Fe, I] = f(!1), [L, R] = f(null), [z, B] = f({
81
+ name: "",
82
+ roundType: o.Technical,
83
+ description: "",
84
+ isAssignmentRound: !1,
85
+ isRequired: !0
86
+ }), [Ie, V] = f(!1), [H, U] = f(null), [W, G] = f({
87
+ title: "",
88
+ description: "",
89
+ problemStatement: "",
90
+ difficulty: "",
91
+ isActive: !0
92
+ }), [K, q] = f(null), [J, Y] = f(null), { data: Le, loading: Re, error: ze } = ae({
93
+ variables: { id: d },
94
+ skip: !d
95
+ }), X = Le?.jobPosting, [Be, { loading: Ve }] = ce({ refetchQueries: ["GetJobPosting"] }), [He, { loading: Ue }] = te({ refetchQueries: ["GetJobPosting"] }), [We, { loading: Ge }] = oe({ refetchQueries: ["GetJobPosting"] }), [Ke, { loading: qe }] = re({ refetchQueries: ["GetJobPosting"] }), [Je, { loading: Ye }] = ne({ refetchQueries: ["GetJobPosting"] }), [Xe, { loading: Ze }] = se({ refetchQueries: ["GetJobPosting"] }), [Qe, { loading: $e }] = ie({ refetchQueries: ["GetJobPosting"] }), [Z, Q] = f({
96
+ title: "",
97
+ department: "",
98
+ location: "",
99
+ employmentType: "",
100
+ description: "",
101
+ productId: "",
102
+ status: s.Draft
103
+ });
104
+ if (ue(() => {
105
+ X && Q({
106
+ title: X.title,
107
+ department: X.department ?? "",
108
+ location: X.location ?? "",
109
+ employmentType: X.employmentType ?? "",
110
+ description: X.description ?? "",
111
+ productId: X.productId ?? "",
112
+ status: X.status
113
+ });
114
+ }, [X]), Re) return /* @__PURE__ */ S(u, {
115
+ title: "Job Posting",
116
+ subtitle: "Loading posting details…",
117
+ icon: /* @__PURE__ */ S(h, { size: 24 }),
118
+ children: /* @__PURE__ */ S(le, { message: "Loading job posting…" })
119
+ });
120
+ if (ze || !X) return /* @__PURE__ */ S(u, {
121
+ title: "Job Posting",
122
+ icon: /* @__PURE__ */ S(h, { size: 24 }),
123
+ children: /* @__PURE__ */ S(l, {
124
+ icon: /* @__PURE__ */ S(p, { size: 48 }),
125
+ title: "Posting not found",
126
+ description: ze?.message || "This job posting may have been deleted or you don't have access.",
127
+ action: /* @__PURE__ */ C(t, {
128
+ onClick: () => M("/support/applications/postings"),
129
+ children: [/* @__PURE__ */ S(m, { size: 16 }), "Back to Postings"]
130
+ })
131
+ })
132
+ });
133
+ let et = Ee[X.status], $ = [...X.rounds].sort((e, t) => e.roundNumber - t.roundNumber), tt = async (e) => {
134
+ if (e.preventDefault(), !(!d || !Z.title.trim())) try {
135
+ await Be({ variables: {
136
+ id: d,
137
+ input: {
138
+ title: Z.title,
139
+ department: Z.department || void 0,
140
+ location: Z.location || void 0,
141
+ employmentType: Z.employmentType || void 0,
142
+ description: Z.description || void 0,
143
+ productId: Z.productId || void 0,
144
+ status: Z.status
145
+ }
146
+ } }), P("success", "Job posting updated."), F(!1);
147
+ } catch {
148
+ P("error", "Failed to update job posting.");
149
+ }
150
+ }, nt = () => {
151
+ R(null), B({
152
+ name: "",
153
+ roundType: o.Technical,
154
+ description: "",
155
+ isAssignmentRound: !1,
156
+ isRequired: !0
157
+ }), I(!0);
158
+ }, rt = (e) => {
159
+ R(e), B({
160
+ name: e.name,
161
+ roundType: e.roundType,
162
+ description: e.description ?? "",
163
+ isAssignmentRound: e.isAssignmentRound,
164
+ isRequired: e.isRequired
165
+ }), I(!0);
166
+ }, it = () => {
167
+ I(!1), R(null);
168
+ }, at = async (e) => {
169
+ if (e.preventDefault(), !(!d || !z.name.trim())) try {
170
+ L ? (await We({ variables: {
171
+ id: L.id,
172
+ input: {
173
+ name: z.name,
174
+ roundType: z.roundType,
175
+ description: z.description || void 0,
176
+ isAssignmentRound: z.isAssignmentRound,
177
+ isRequired: z.isRequired
178
+ }
179
+ } }), P("success", "Round config updated.")) : (await He({ variables: { input: {
180
+ jobPostingId: d,
181
+ name: z.name,
182
+ roundType: z.roundType,
183
+ description: z.description || void 0,
184
+ roundNumber: $.length + 1,
185
+ isAssignmentRound: z.isAssignmentRound,
186
+ isRequired: z.isRequired
187
+ } } }), P("success", "Round config created.")), it();
188
+ } catch {
189
+ P("error", `Failed to ${L ? "update" : "create"} round config.`);
190
+ }
191
+ }, ot = async () => {
192
+ let e = K;
193
+ if (e) {
194
+ q(null);
195
+ try {
196
+ await Ke({ variables: { id: e } }), P("success", "Round config deleted.");
197
+ } catch {
198
+ P("error", "Failed to delete round config.");
199
+ }
200
+ }
201
+ }, st = () => {
202
+ U(null), G({
203
+ title: "",
204
+ description: "",
205
+ problemStatement: "",
206
+ difficulty: "",
207
+ isActive: !0
208
+ }), V(!0);
209
+ }, ct = (e) => {
210
+ U(e), G({
211
+ title: e.title,
212
+ description: e.description,
213
+ problemStatement: e.problemStatement ?? "",
214
+ difficulty: e.difficulty ?? "",
215
+ isActive: e.isActive
216
+ }), V(!0);
217
+ }, lt = () => {
218
+ V(!1), U(null);
219
+ };
220
+ return /* @__PURE__ */ C(u, {
221
+ title: X.title,
222
+ subtitle: "Manage interview rounds, take-home assignments and applications for this posting.",
223
+ icon: /* @__PURE__ */ S(h, { size: 24 }),
224
+ headerActions: /* @__PURE__ */ C("div", {
225
+ className: "flex items-center gap-2",
226
+ children: [/* @__PURE__ */ C(t, {
227
+ variant: "outline",
228
+ onClick: () => M("/support/applications/postings"),
229
+ children: [/* @__PURE__ */ S(m, { size: 16 }), "Back"]
230
+ }), /* @__PURE__ */ C(t, {
231
+ onClick: () => F(!0),
232
+ children: [/* @__PURE__ */ S(_, { size: 16 }), "Edit Posting"]
233
+ })]
234
+ }),
235
+ children: [
236
+ N && /* @__PURE__ */ C("div", {
237
+ className: c("fixed right-4 top-[calc(var(--header-height,4rem)+1rem)] z-[200] flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-200", N.type === "success" ? "bg-status-success-bg-subtle text-status-success-text border-border-subtle" : "bg-status-error-bg-subtle text-status-error-text border-border-subtle"),
238
+ children: [N.type === "success" ? /* @__PURE__ */ S(fe, {
239
+ size: 20,
240
+ className: "text-status-success-text"
241
+ }) : /* @__PURE__ */ S(p, {
242
+ size: 20,
243
+ className: "text-status-error-text"
244
+ }), /* @__PURE__ */ S("span", {
245
+ className: "font-medium",
246
+ children: N.message
247
+ })]
248
+ }),
249
+ /* @__PURE__ */ C("div", {
250
+ className: "rounded-xl border border-border-seam bg-bg-surface p-6 shadow-[var(--shadow-pop)]",
251
+ children: [/* @__PURE__ */ S("div", {
252
+ className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
253
+ children: /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("div", {
254
+ className: "flex items-center gap-3 mb-2 flex-wrap",
255
+ children: [/* @__PURE__ */ S("h1", {
256
+ className: "text-xl font-bold text-text-primary",
257
+ children: X.title
258
+ }), /* @__PURE__ */ S(e, {
259
+ variant: et.variant,
260
+ children: et.label
261
+ })]
262
+ }), /* @__PURE__ */ C("div", {
263
+ className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-text-secondary",
264
+ children: [
265
+ X.department && /* @__PURE__ */ C("span", {
266
+ className: "flex items-center gap-1.5",
267
+ children: [/* @__PURE__ */ S(de, { size: 14 }), X.department]
268
+ }),
269
+ X.location && /* @__PURE__ */ C("span", {
270
+ className: "flex items-center gap-1.5",
271
+ children: [/* @__PURE__ */ S(ge, { size: 14 }), X.location]
272
+ }),
273
+ X.employmentType && /* @__PURE__ */ C("span", {
274
+ className: "flex items-center gap-1.5",
275
+ children: [/* @__PURE__ */ S(pe, { size: 14 }), De[X.employmentType]]
276
+ }),
277
+ X.productId && /* @__PURE__ */ C("span", {
278
+ className: "flex items-center gap-1.5",
279
+ children: [/* @__PURE__ */ S(he, { size: 14 }), X.productId]
280
+ })
281
+ ]
282
+ })] })
283
+ }), X.description && /* @__PURE__ */ S("p", {
284
+ className: "mt-4 text-sm text-text-primary leading-relaxed whitespace-pre-wrap",
285
+ children: X.description
286
+ })]
287
+ }),
288
+ /* @__PURE__ */ C(n, {
289
+ value: Me,
290
+ onValueChange: Ne,
291
+ children: [
292
+ /* @__PURE__ */ C(ee, {
293
+ className: "mb-6",
294
+ children: [
295
+ /* @__PURE__ */ C(i, {
296
+ value: "rounds",
297
+ className: "flex items-center gap-1.5",
298
+ children: [
299
+ /* @__PURE__ */ S(ve, { size: 14 }),
300
+ "Interview Rounds",
301
+ /* @__PURE__ */ S("span", {
302
+ className: "ml-1 inline-flex items-center justify-center px-1.5 py-0.5 rounded-full text-[10px] font-medium bg-bg-sunken text-text-secondary",
303
+ children: X.rounds.length
304
+ })
305
+ ]
306
+ }),
307
+ /* @__PURE__ */ C(i, {
308
+ value: "assignments",
309
+ className: "flex items-center gap-1.5",
310
+ children: [
311
+ /* @__PURE__ */ S(me, { size: 14 }),
312
+ "Assignments",
313
+ /* @__PURE__ */ S("span", {
314
+ className: "ml-1 inline-flex items-center justify-center px-1.5 py-0.5 rounded-full text-[10px] font-medium bg-bg-sunken text-text-secondary",
315
+ children: X.assignments.length
316
+ })
317
+ ]
318
+ }),
319
+ /* @__PURE__ */ C(i, {
320
+ value: "applications",
321
+ className: "flex items-center gap-1.5",
322
+ children: [
323
+ /* @__PURE__ */ S(h, { size: 14 }),
324
+ "Applications",
325
+ /* @__PURE__ */ S("span", {
326
+ className: "ml-1 inline-flex items-center justify-center px-1.5 py-0.5 rounded-full text-[10px] font-medium bg-bg-sunken text-text-secondary",
327
+ children: X.applications.length
328
+ })
329
+ ]
330
+ })
331
+ ]
332
+ }),
333
+ /* @__PURE__ */ C(r, {
334
+ value: "rounds",
335
+ className: "space-y-4",
336
+ children: [/* @__PURE__ */ C("div", {
337
+ className: "flex items-center justify-between",
338
+ children: [/* @__PURE__ */ S("h2", {
339
+ className: "text-lg font-semibold text-text-primary",
340
+ children: "Interview Rounds"
341
+ }), /* @__PURE__ */ C(t, {
342
+ onClick: nt,
343
+ children: [/* @__PURE__ */ S(y, { size: 16 }), "Add Round"]
344
+ })]
345
+ }), $.length === 0 ? /* @__PURE__ */ S(l, {
346
+ icon: /* @__PURE__ */ S(ve, { size: 48 }),
347
+ title: "No rounds configured",
348
+ description: "Add interview rounds to define your hiring pipeline for this posting.",
349
+ action: /* @__PURE__ */ C(t, {
350
+ onClick: nt,
351
+ children: [/* @__PURE__ */ S(y, { size: 16 }), "Add Round"]
352
+ })
353
+ }) : /* @__PURE__ */ S("div", {
354
+ className: "space-y-3",
355
+ children: $.map((t, n) => /* @__PURE__ */ C("div", {
356
+ className: "p-4 rounded-xl border border-border-seam bg-bg-surface shadow-[var(--shadow-pop)] flex flex-col sm:flex-row sm:items-center gap-4",
357
+ children: [
358
+ /* @__PURE__ */ S("div", {
359
+ className: "flex-shrink-0 size-10 rounded-full bg-bg-sunken flex items-center justify-center text-sm font-bold text-text-secondary",
360
+ children: n + 1
361
+ }),
362
+ /* @__PURE__ */ C("div", {
363
+ className: "flex-1 min-w-0",
364
+ children: [/* @__PURE__ */ C("div", {
365
+ className: "flex items-center gap-2 flex-wrap",
366
+ children: [
367
+ /* @__PURE__ */ S("h3", {
368
+ className: "font-semibold text-text-primary",
369
+ children: t.name
370
+ }),
371
+ /* @__PURE__ */ S(e, {
372
+ variant: "secondary",
373
+ children: Oe[t.roundType]
374
+ }),
375
+ t.isAssignmentRound && /* @__PURE__ */ S(e, {
376
+ variant: "outline",
377
+ children: "Assignment"
378
+ }),
379
+ t.isRequired && /* @__PURE__ */ C("span", {
380
+ className: "inline-flex items-center gap-1 text-xs text-status-success-text",
381
+ children: [/* @__PURE__ */ S(g, { size: 12 }), "Required"]
382
+ })
383
+ ]
384
+ }), t.description && /* @__PURE__ */ S("p", {
385
+ className: "text-sm text-text-secondary mt-1 line-clamp-2",
386
+ children: t.description
387
+ })]
388
+ }),
389
+ /* @__PURE__ */ C("div", {
390
+ className: "flex items-center gap-1",
391
+ children: [/* @__PURE__ */ S("button", {
392
+ type: "button",
393
+ onClick: () => rt(t),
394
+ className: "min-h-10 min-w-10 p-2 rounded-lg hover:bg-bg-sunken text-text-secondary transition-colors",
395
+ "aria-label": "Edit round config",
396
+ title: "Edit round config",
397
+ children: /* @__PURE__ */ S(_, { size: 16 })
398
+ }), /* @__PURE__ */ S("button", {
399
+ type: "button",
400
+ onClick: () => q(t.id),
401
+ disabled: qe,
402
+ className: "min-h-10 min-w-10 p-2 rounded-lg hover:bg-bg-sunken text-status-error-text transition-colors disabled:opacity-50",
403
+ "aria-label": "Delete round config",
404
+ title: "Delete round config",
405
+ children: qe && K === t.id ? /* @__PURE__ */ S(v, {
406
+ size: 16,
407
+ className: "animate-spin"
408
+ }) : /* @__PURE__ */ S(_e, { size: 16 })
409
+ })]
410
+ })
411
+ ]
412
+ }, t.id))
413
+ })]
414
+ }),
415
+ /* @__PURE__ */ C(r, {
416
+ value: "assignments",
417
+ className: "space-y-4",
418
+ children: [/* @__PURE__ */ C("div", {
419
+ className: "flex items-center justify-between",
420
+ children: [/* @__PURE__ */ S("h2", {
421
+ className: "text-lg font-semibold text-text-primary",
422
+ children: "Take-home Assignments"
423
+ }), /* @__PURE__ */ C(t, {
424
+ onClick: st,
425
+ children: [/* @__PURE__ */ S(y, { size: 16 }), "Add Assignment"]
426
+ })]
427
+ }), X.assignments.length === 0 ? /* @__PURE__ */ S(l, {
428
+ icon: /* @__PURE__ */ S(me, { size: 48 }),
429
+ title: "No assignments configured",
430
+ description: "Add take-home assignments for candidates to complete during the hiring process.",
431
+ action: /* @__PURE__ */ C(t, {
432
+ onClick: st,
433
+ children: [/* @__PURE__ */ S(y, { size: 16 }), "Add Assignment"]
434
+ })
435
+ }) : /* @__PURE__ */ S("div", {
436
+ className: "space-y-3",
437
+ children: X.assignments.map((t) => /* @__PURE__ */ C("div", {
438
+ className: c("p-4 rounded-xl border border-border-seam bg-bg-surface shadow-[var(--shadow-pop)] flex flex-col sm:flex-row sm:items-start gap-4", !t.isActive && "opacity-60"),
439
+ children: [/* @__PURE__ */ C("div", {
440
+ className: "flex-1 min-w-0",
441
+ children: [
442
+ /* @__PURE__ */ C("div", {
443
+ className: "flex items-center gap-2 flex-wrap",
444
+ children: [
445
+ /* @__PURE__ */ S("h3", {
446
+ className: "font-semibold text-text-primary",
447
+ children: t.title
448
+ }),
449
+ !t.isActive && /* @__PURE__ */ S(e, {
450
+ variant: "secondary",
451
+ children: "Inactive"
452
+ }),
453
+ t.difficulty && /* @__PURE__ */ S(e, {
454
+ variant: "outline",
455
+ children: t.difficulty
456
+ })
457
+ ]
458
+ }),
459
+ /* @__PURE__ */ S("p", {
460
+ className: "text-sm text-text-secondary mt-1 line-clamp-2",
461
+ children: t.description
462
+ }),
463
+ t.problemStatement && /* @__PURE__ */ S("div", {
464
+ className: "mt-3 p-3 rounded-lg bg-bg-sunken text-sm text-text-primary whitespace-pre-wrap",
465
+ children: t.problemStatement
466
+ })
467
+ ]
468
+ }), /* @__PURE__ */ C("div", {
469
+ className: "flex items-center gap-1",
470
+ children: [/* @__PURE__ */ S("button", {
471
+ type: "button",
472
+ onClick: () => ct(t),
473
+ className: "min-h-10 min-w-10 p-2 rounded-lg hover:bg-bg-sunken text-text-secondary transition-colors",
474
+ "aria-label": "Edit assignment",
475
+ title: "Edit assignment",
476
+ children: /* @__PURE__ */ S(_, { size: 16 })
477
+ }), /* @__PURE__ */ S("button", {
478
+ type: "button",
479
+ onClick: () => Y(t.id),
480
+ disabled: $e,
481
+ className: "min-h-10 min-w-10 p-2 rounded-lg hover:bg-bg-sunken text-status-error-text transition-colors disabled:opacity-50",
482
+ "aria-label": "Delete assignment",
483
+ title: "Delete assignment",
484
+ children: $e && J === t.id ? /* @__PURE__ */ S(v, {
485
+ size: 16,
486
+ className: "animate-spin"
487
+ }) : /* @__PURE__ */ S(_e, { size: 16 })
488
+ })]
489
+ })]
490
+ }, t.id))
491
+ })]
492
+ }),
493
+ /* @__PURE__ */ C(r, {
494
+ value: "applications",
495
+ className: "space-y-4",
496
+ children: [/* @__PURE__ */ S("div", {
497
+ className: "flex items-center justify-between",
498
+ children: /* @__PURE__ */ S("h2", {
499
+ className: "text-lg font-semibold text-text-primary",
500
+ children: "Applications"
501
+ })
502
+ }), X.applications.length === 0 ? /* @__PURE__ */ S(l, {
503
+ icon: /* @__PURE__ */ S(h, { size: 48 }),
504
+ title: "No applications yet",
505
+ description: "Candidates who apply for this posting will appear here."
506
+ }) : /* @__PURE__ */ S("div", {
507
+ className: "space-y-3",
508
+ children: X.applications.map((e) => /* @__PURE__ */ S("button", {
509
+ type: "button",
510
+ onClick: () => M(`/support/applications/${e.id}`),
511
+ className: "w-full text-left p-4 bg-bg-surface border border-border-seam rounded-xl shadow-[var(--shadow-pop)] hover:border-border-strong hover:shadow-[var(--shadow-pop-hover)] transition-[box-shadow,border-color] duration-200 group",
512
+ children: /* @__PURE__ */ C("div", {
513
+ className: "flex items-start justify-between gap-4",
514
+ children: [/* @__PURE__ */ C("div", {
515
+ className: "flex-1 min-w-0",
516
+ children: [/* @__PURE__ */ C("div", {
517
+ className: "flex items-center gap-2 mb-1 flex-wrap",
518
+ children: [/* @__PURE__ */ C("h3", {
519
+ className: "text-sm font-semibold text-text-primary group-hover:text-primary transition-colors",
520
+ children: [
521
+ e.firstName,
522
+ " ",
523
+ e.lastName
524
+ ]
525
+ }), /* @__PURE__ */ S("span", {
526
+ className: c("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium", j[e.status] || j.NEW),
527
+ children: ke[e.status] || e.status
528
+ })]
529
+ }), /* @__PURE__ */ S("p", {
530
+ className: "text-xs text-text-secondary truncate",
531
+ children: e.email
532
+ })]
533
+ }), /* @__PURE__ */ S("div", {
534
+ className: "text-xs text-text-secondary whitespace-nowrap",
535
+ children: Ae(e.createdAt)
536
+ })]
537
+ })
538
+ }, e.id))
539
+ })]
540
+ })
541
+ ]
542
+ }),
543
+ /* @__PURE__ */ S(D, {
544
+ open: Pe,
545
+ onOpenChange: F,
546
+ children: /* @__PURE__ */ C(O, {
547
+ className: "w-full max-w-lg max-h-[90vh] overflow-y-auto",
548
+ children: [/* @__PURE__ */ S(k, { children: /* @__PURE__ */ S(A, { children: "Edit Job Posting" }) }), /* @__PURE__ */ C("form", {
549
+ onSubmit: tt,
550
+ className: "space-y-5",
551
+ children: [
552
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
553
+ htmlFor: "posting-title",
554
+ className: "block text-sm font-medium text-text-primary mb-2",
555
+ children: ["Title ", /* @__PURE__ */ S("span", {
556
+ className: "text-status-error-text",
557
+ children: "*"
558
+ })]
559
+ }), /* @__PURE__ */ S("input", {
560
+ id: "posting-title",
561
+ type: "text",
562
+ value: Z.title,
563
+ onChange: (e) => Q({
564
+ ...Z,
565
+ title: e.target.value
566
+ }),
567
+ className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
568
+ required: !0
569
+ })] }),
570
+ /* @__PURE__ */ C("div", {
571
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
572
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
573
+ htmlFor: "posting-department",
574
+ className: "block text-sm font-medium text-text-primary mb-2",
575
+ children: "Department"
576
+ }), /* @__PURE__ */ S("input", {
577
+ id: "posting-department",
578
+ type: "text",
579
+ value: Z.department,
580
+ onChange: (e) => Q({
581
+ ...Z,
582
+ department: e.target.value
583
+ }),
584
+ className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
585
+ })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
586
+ htmlFor: "posting-location",
587
+ className: "block text-sm font-medium text-text-primary mb-2",
588
+ children: "Location"
589
+ }), /* @__PURE__ */ S("input", {
590
+ id: "posting-location",
591
+ type: "text",
592
+ value: Z.location,
593
+ onChange: (e) => Q({
594
+ ...Z,
595
+ location: e.target.value
596
+ }),
597
+ className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
598
+ })] })]
599
+ }),
600
+ /* @__PURE__ */ C("div", {
601
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
602
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
603
+ htmlFor: "posting-employment-type",
604
+ className: "block text-sm font-medium text-text-primary mb-2",
605
+ children: "Employment Type"
606
+ }), /* @__PURE__ */ C("select", {
607
+ id: "posting-employment-type",
608
+ value: Z.employmentType,
609
+ onChange: (e) => Q({
610
+ ...Z,
611
+ employmentType: e.target.value
612
+ }),
613
+ className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
614
+ children: [
615
+ /* @__PURE__ */ S("option", {
616
+ value: "",
617
+ children: "Select type"
618
+ }),
619
+ /* @__PURE__ */ S("option", {
620
+ value: a.FullTime,
621
+ children: "Full-time"
622
+ }),
623
+ /* @__PURE__ */ S("option", {
624
+ value: a.PartTime,
625
+ children: "Part-time"
626
+ }),
627
+ /* @__PURE__ */ S("option", {
628
+ value: a.Contract,
629
+ children: "Contract"
630
+ }),
631
+ /* @__PURE__ */ S("option", {
632
+ value: a.Internship,
633
+ children: "Internship"
634
+ })
635
+ ]
636
+ })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
637
+ htmlFor: "posting-status",
638
+ className: "block text-sm font-medium text-text-primary mb-2",
639
+ children: "Status"
640
+ }), /* @__PURE__ */ C("select", {
641
+ id: "posting-status",
642
+ value: Z.status,
643
+ onChange: (e) => Q({
644
+ ...Z,
645
+ status: e.target.value
646
+ }),
647
+ className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
648
+ children: [
649
+ /* @__PURE__ */ S("option", {
650
+ value: s.Draft,
651
+ children: "Draft"
652
+ }),
653
+ /* @__PURE__ */ S("option", {
654
+ value: s.Open,
655
+ children: "Open"
656
+ }),
657
+ /* @__PURE__ */ S("option", {
658
+ value: s.Closed,
659
+ children: "Closed"
660
+ }),
661
+ /* @__PURE__ */ S("option", {
662
+ value: s.Archived,
663
+ children: "Archived"
664
+ })
665
+ ]
666
+ })] })]
667
+ }),
668
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
669
+ htmlFor: "posting-product-id",
670
+ className: "block text-sm font-medium text-text-primary mb-2",
671
+ children: "Product ID"
672
+ }), /* @__PURE__ */ S("input", {
673
+ id: "posting-product-id",
674
+ type: "text",
675
+ value: Z.productId,
676
+ onChange: (e) => Q({
677
+ ...Z,
678
+ productId: e.target.value
679
+ }),
680
+ className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
681
+ })] }),
682
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
683
+ htmlFor: "posting-description",
684
+ className: "block text-sm font-medium text-text-primary mb-2",
685
+ children: "Description"
686
+ }), /* @__PURE__ */ S("textarea", {
687
+ id: "posting-description",
688
+ value: Z.description,
689
+ onChange: (e) => Q({
690
+ ...Z,
691
+ description: e.target.value
692
+ }),
693
+ rows: 4,
694
+ className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary resize-none"
695
+ })] }),
696
+ /* @__PURE__ */ C("div", {
697
+ className: "flex flex-col gap-3 pt-2 sm:flex-row",
698
+ children: [/* @__PURE__ */ S(t, {
699
+ type: "submit",
700
+ disabled: Ve || !Z.title.trim(),
701
+ className: "flex-1",
702
+ children: Ve ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(v, {
703
+ size: 16,
704
+ className: "animate-spin"
705
+ }), "Saving…"] }) : /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(g, { size: 16 }), "Save Changes"] })
706
+ }), /* @__PURE__ */ C(t, {
707
+ type: "button",
708
+ variant: "outline",
709
+ onClick: () => F(!1),
710
+ children: [/* @__PURE__ */ S(b, { size: 16 }), "Cancel"]
711
+ })]
712
+ })
713
+ ]
714
+ })]
715
+ })
716
+ }),
717
+ /* @__PURE__ */ S(D, {
718
+ open: Fe,
719
+ onOpenChange: I,
720
+ children: /* @__PURE__ */ C(O, {
721
+ className: "w-full max-w-lg max-h-[90vh] overflow-y-auto",
722
+ children: [/* @__PURE__ */ S(k, { children: /* @__PURE__ */ S(A, { children: L ? "Edit Round Config" : "Add Round Config" }) }), /* @__PURE__ */ C("form", {
723
+ onSubmit: at,
724
+ className: "space-y-5",
725
+ children: [
726
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
727
+ htmlFor: "round-name",
728
+ className: "block text-sm font-medium text-text-primary mb-2",
729
+ children: ["Name ", /* @__PURE__ */ S("span", {
730
+ className: "text-status-error-text",
731
+ children: "*"
732
+ })]
733
+ }), /* @__PURE__ */ S("input", {
734
+ id: "round-name",
735
+ type: "text",
736
+ value: z.name,
737
+ onChange: (e) => B({
738
+ ...z,
739
+ name: e.target.value
740
+ }),
741
+ className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
742
+ required: !0
743
+ })] }),
744
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
745
+ htmlFor: "round-type",
746
+ className: "block text-sm font-medium text-text-primary mb-2",
747
+ children: "Round Type"
748
+ }), /* @__PURE__ */ S("select", {
749
+ id: "round-type",
750
+ value: z.roundType,
751
+ onChange: (e) => B({
752
+ ...z,
753
+ roundType: e.target.value
754
+ }),
755
+ className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
756
+ children: Object.values(o).map((e) => /* @__PURE__ */ S("option", {
757
+ value: e,
758
+ children: Oe[e]
759
+ }, e))
760
+ })] }),
761
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
762
+ htmlFor: "round-description",
763
+ className: "block text-sm font-medium text-text-primary mb-2",
764
+ children: "Description"
765
+ }), /* @__PURE__ */ S("textarea", {
766
+ id: "round-description",
767
+ value: z.description,
768
+ onChange: (e) => B({
769
+ ...z,
770
+ description: e.target.value
771
+ }),
772
+ rows: 3,
773
+ className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary resize-none"
774
+ })] }),
775
+ /* @__PURE__ */ C("div", {
776
+ className: "flex flex-col gap-3",
777
+ children: [/* @__PURE__ */ C("label", {
778
+ className: "flex items-center gap-3 cursor-pointer",
779
+ children: [/* @__PURE__ */ S("input", {
780
+ type: "checkbox",
781
+ checked: z.isAssignmentRound,
782
+ onChange: (e) => B({
783
+ ...z,
784
+ isAssignmentRound: e.target.checked
785
+ }),
786
+ className: "size-4 rounded border-border-default text-primary focus:ring-primary"
787
+ }), /* @__PURE__ */ S("span", {
788
+ className: "text-sm text-text-primary",
789
+ children: "Assignment round"
790
+ })]
791
+ }), /* @__PURE__ */ C("label", {
792
+ className: "flex items-center gap-3 cursor-pointer",
793
+ children: [/* @__PURE__ */ S("input", {
794
+ type: "checkbox",
795
+ checked: z.isRequired,
796
+ onChange: (e) => B({
797
+ ...z,
798
+ isRequired: e.target.checked
799
+ }),
800
+ className: "size-4 rounded border-border-default text-primary focus:ring-primary"
801
+ }), /* @__PURE__ */ S("span", {
802
+ className: "text-sm text-text-primary",
803
+ children: "Required"
804
+ })]
805
+ })]
806
+ }),
807
+ /* @__PURE__ */ C("div", {
808
+ className: "flex flex-col gap-3 pt-2 sm:flex-row",
809
+ children: [/* @__PURE__ */ S(t, {
810
+ type: "submit",
811
+ disabled: Ue || Ge || !z.name.trim(),
812
+ className: "flex-1",
813
+ children: Ue || Ge ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(v, {
814
+ size: 16,
815
+ className: "animate-spin"
816
+ }), L ? "Saving…" : "Creating…"] }) : /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(g, { size: 16 }), L ? "Update Round" : "Create Round"] })
817
+ }), /* @__PURE__ */ C(t, {
818
+ type: "button",
819
+ variant: "outline",
820
+ onClick: it,
821
+ children: [/* @__PURE__ */ S(b, { size: 16 }), "Cancel"]
822
+ })]
823
+ })
824
+ ]
825
+ })]
826
+ })
827
+ }),
828
+ /* @__PURE__ */ S(D, {
829
+ open: Ie,
830
+ onOpenChange: V,
831
+ children: /* @__PURE__ */ C(O, {
832
+ className: "w-full max-w-lg max-h-[90vh] overflow-y-auto",
833
+ children: [/* @__PURE__ */ S(k, { children: /* @__PURE__ */ S(A, { children: H ? "Edit Assignment" : "Add Assignment" }) }), /* @__PURE__ */ C("form", {
834
+ onSubmit: async (e) => {
835
+ if (e.preventDefault(), !(!d || !W.title.trim() || !W.description.trim())) try {
836
+ H ? (await Xe({ variables: {
837
+ id: H.id,
838
+ input: {
839
+ title: W.title,
840
+ description: W.description,
841
+ problemStatement: W.problemStatement || void 0,
842
+ difficulty: W.difficulty || void 0,
843
+ isActive: W.isActive
844
+ }
845
+ } }), P("success", "Assignment updated.")) : (await Je({ variables: { input: {
846
+ jobPostingId: d,
847
+ title: W.title,
848
+ description: W.description,
849
+ problemStatement: W.problemStatement || void 0,
850
+ difficulty: W.difficulty || void 0,
851
+ isActive: W.isActive
852
+ } } }), P("success", "Assignment created.")), lt();
853
+ } catch {
854
+ P("error", `Failed to ${H ? "update" : "create"} assignment.`);
855
+ }
856
+ },
857
+ className: "space-y-5",
858
+ children: [
859
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
860
+ htmlFor: "assignment-title",
861
+ className: "block text-sm font-medium text-text-primary mb-2",
862
+ children: ["Title ", /* @__PURE__ */ S("span", {
863
+ className: "text-status-error-text",
864
+ children: "*"
865
+ })]
866
+ }), /* @__PURE__ */ S("input", {
867
+ id: "assignment-title",
868
+ type: "text",
869
+ value: W.title,
870
+ onChange: (e) => G({
871
+ ...W,
872
+ title: e.target.value
873
+ }),
874
+ className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
875
+ required: !0
876
+ })] }),
877
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
878
+ htmlFor: "assignment-difficulty",
879
+ className: "block text-sm font-medium text-text-primary mb-2",
880
+ children: "Difficulty"
881
+ }), /* @__PURE__ */ S("input", {
882
+ id: "assignment-difficulty",
883
+ type: "text",
884
+ value: W.difficulty,
885
+ onChange: (e) => G({
886
+ ...W,
887
+ difficulty: e.target.value
888
+ }),
889
+ placeholder: "e.g., Easy, Medium, Hard",
890
+ className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
891
+ })] }),
892
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
893
+ htmlFor: "assignment-description",
894
+ className: "block text-sm font-medium text-text-primary mb-2",
895
+ children: ["Description ", /* @__PURE__ */ S("span", {
896
+ className: "text-status-error-text",
897
+ children: "*"
898
+ })]
899
+ }), /* @__PURE__ */ S("textarea", {
900
+ id: "assignment-description",
901
+ value: W.description,
902
+ onChange: (e) => G({
903
+ ...W,
904
+ description: e.target.value
905
+ }),
906
+ rows: 3,
907
+ className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary resize-none",
908
+ required: !0
909
+ })] }),
910
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
911
+ htmlFor: "assignment-problem-statement",
912
+ className: "block text-sm font-medium text-text-primary mb-2",
913
+ children: "Problem Statement"
914
+ }), /* @__PURE__ */ S("textarea", {
915
+ id: "assignment-problem-statement",
916
+ value: W.problemStatement,
917
+ onChange: (e) => G({
918
+ ...W,
919
+ problemStatement: e.target.value
920
+ }),
921
+ rows: 4,
922
+ className: "w-full px-4 py-2.5 rounded-lg border border-border-default bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary resize-none"
923
+ })] }),
924
+ /* @__PURE__ */ C("label", {
925
+ className: "flex items-center gap-3 cursor-pointer",
926
+ children: [/* @__PURE__ */ S("input", {
927
+ type: "checkbox",
928
+ checked: W.isActive,
929
+ onChange: (e) => G({
930
+ ...W,
931
+ isActive: e.target.checked
932
+ }),
933
+ className: "size-4 rounded border-border-default text-primary focus:ring-primary"
934
+ }), /* @__PURE__ */ S("span", {
935
+ className: "text-sm text-text-primary",
936
+ children: "Active"
937
+ })]
938
+ }),
939
+ /* @__PURE__ */ C("div", {
940
+ className: "flex flex-col gap-3 pt-2 sm:flex-row",
941
+ children: [/* @__PURE__ */ S(t, {
942
+ type: "submit",
943
+ disabled: Ye || Ze || !W.title.trim() || !W.description.trim(),
944
+ className: "flex-1",
945
+ children: Ye || Ze ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(v, {
946
+ size: 16,
947
+ className: "animate-spin"
948
+ }), H ? "Saving…" : "Creating…"] }) : /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(g, { size: 16 }), H ? "Update Assignment" : "Create Assignment"] })
949
+ }), /* @__PURE__ */ C(t, {
950
+ type: "button",
951
+ variant: "outline",
952
+ onClick: lt,
953
+ children: [/* @__PURE__ */ S(b, { size: 16 }), "Cancel"]
954
+ })]
955
+ })
956
+ ]
957
+ })]
958
+ })
959
+ }),
960
+ /* @__PURE__ */ S(xe, {
961
+ open: K !== null,
962
+ onOpenChange: (e) => {
963
+ e || q(null);
964
+ },
965
+ children: /* @__PURE__ */ C(we, { children: [/* @__PURE__ */ C(T, { children: [/* @__PURE__ */ S(E, { children: "Delete round config?" }), /* @__PURE__ */ S(Te, { children: "Are you sure you want to delete this interview round config? This action cannot be undone." })] }), /* @__PURE__ */ C(w, { children: [/* @__PURE__ */ S(Ce, { children: "Cancel" }), /* @__PURE__ */ S(Se, {
966
+ onClick: ot,
967
+ children: "Delete"
968
+ })] })] })
969
+ }),
970
+ /* @__PURE__ */ S(xe, {
971
+ open: J !== null,
972
+ onOpenChange: (e) => {
973
+ e || Y(null);
974
+ },
975
+ children: /* @__PURE__ */ C(we, { children: [/* @__PURE__ */ C(T, { children: [/* @__PURE__ */ S(E, { children: "Delete assignment?" }), /* @__PURE__ */ S(Te, { children: "Are you sure you want to delete this assignment? This action cannot be undone." })] }), /* @__PURE__ */ C(w, { children: [/* @__PURE__ */ S(Ce, { children: "Cancel" }), /* @__PURE__ */ S(Se, {
976
+ onClick: async () => {
977
+ let e = J;
978
+ if (e) {
979
+ Y(null);
980
+ try {
981
+ await Qe({ variables: { id: e } }), P("success", "Assignment deleted.");
982
+ } catch {
983
+ P("error", "Failed to delete assignment.");
984
+ }
985
+ }
986
+ },
987
+ children: "Delete"
988
+ })] })] })
989
+ })
990
+ ]
991
+ });
992
+ }
993
+ //#endregion
994
+ export { M as JobPostingDetailPage };
995
+
996
+ //# sourceMappingURL=JobPostingDetailPage.js.map