@argusoft/medplat-product-management 1.0.1 → 1.0.2

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.
@@ -1,16 +1,16 @@
1
- import { B as e, F as t, L as n, Z as r, a as i, g as a, i as ee, j as o, n as te, o as s, p as ne, r as c } from "./currency-ClRLIEg2.js";
2
- import { c as l, s as u, t as d } from "./PmTable-B9970kPY.js";
3
- import { m as f, t as p, u as m } from "./validation-Ba7puFIO.js";
4
- import { t as h } from "./useFieldErrors-hDG8ox_x.js";
5
- import { n as g, r as _, t as re } from "./format-UOyOu75i.js";
6
- import { d as ie, f as ae, p as oe } from "./constants-5ZCZo-Zm.js";
7
- import { useMemo as se, useState as v } from "react";
8
- import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
9
- import { v4 as ce } from "uuid";
10
- import { Alert as S, Box as C, Button as w, Chip as T, Dialog as le, DialogActions as ue, DialogContent as de, DialogTitle as fe, FormControl as E, FormHelperText as pe, InputLabel as me, LinearProgress as D, MenuItem as O, Radio as he, Select as k, Stack as A, Table as ge, TableBody as j, TableCell as M, TableContainer as _e, TableHead as N, TableRow as P, TextField as ve, Tooltip as ye, Typography as F } from "@mui/material";
11
- import be from "@mui/icons-material/RefreshRounded";
12
- import { showToast as I } from "@/common/toaster/toaster";
13
- import xe from "@mui/icons-material/VaccinesRounded";
1
+ import { B as e, F as t, L as n, R as r, Z as i, a, g as ee, i as o, j as te, l as s, n as ne, o as c, p as l, r as u } from "./currency-ClRLIEg2.js";
2
+ import { c as d, s as re, t as f } from "./PmTable-B9970kPY.js";
3
+ import { m as p, t as m, u as h } from "./validation-Ba7puFIO.js";
4
+ import { t as g } from "./useFieldErrors-hDG8ox_x.js";
5
+ import { n as _, r as v, t as ie } from "./format-UOyOu75i.js";
6
+ import { d as ae, f as oe, p as se } from "./constants-5ZCZo-Zm.js";
7
+ import { useMemo as ce, useState as y } from "react";
8
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
9
+ import { v4 as le } from "uuid";
10
+ import { Alert as C, Box as w, Button as T, Chip as E, Dialog as ue, DialogActions as de, DialogContent as fe, DialogTitle as pe, FormControl as me, FormHelperText as he, InputLabel as D, LinearProgress as ge, MenuItem as O, Radio as _e, Select as ve, Stack as k, Table as ye, TableBody as A, TableCell as j, TableContainer as be, TableHead as M, TableRow as N, TextField as xe, Tooltip as Se, Typography as P } from "@mui/material";
11
+ import Ce from "@mui/icons-material/RefreshRounded";
12
+ import { showToast as F } from "@/common/toaster/toaster";
13
+ import I from "@mui/icons-material/VaccinesRounded";
14
14
  //#region src/views/VialsPage.jsx
15
15
  function L(e) {
16
16
  let t = e.expiresAt ? new Date(e.expiresAt).getTime() : Infinity, n = Infinity;
@@ -20,7 +20,7 @@ function L(e) {
20
20
  }
21
21
  return Math.min(t, n);
22
22
  }
23
- function Se(e) {
23
+ function we(e) {
24
24
  return e.expiryDate ? new Date(e.expiryDate).getTime() : Infinity;
25
25
  }
26
26
  var R = {
@@ -30,6 +30,7 @@ var R = {
30
30
  productId: "",
31
31
  ownerType: "",
32
32
  ownerId: "",
33
+ personalSource: "",
33
34
  allVials: [],
34
35
  allBatches: [],
35
36
  sources: [],
@@ -40,49 +41,50 @@ var R = {
40
41
  volumeMl: "",
41
42
  loading: !1
42
43
  };
43
- function Ce() {
44
- let Ce = i().has("update.manage.productManagement.vial"), [z, we] = v([]), [Te, Ee] = v([]), [B, De] = v([]), [Oe, ke] = v([]), [V, Ae] = v(!1), [je, Me] = v(""), [H, U] = v({
44
+ function Te() {
45
+ let Te = a().has("update.manage.productManagement.vial"), [z, Ee] = y([]), [De, Oe] = y([]), [B, ke] = y([]), [Ae, je] = y([]), [V, Me] = y([]), Ne = s()?.allowPersonalPurchase !== !1, [Pe, Fe] = y(!1), [Ie, Le] = y(""), [H, U] = y({
45
46
  open: !1,
46
47
  vial: null,
47
48
  reason: "TIME_EXPIRATION",
48
49
  comments: ""
49
- }), [W, G] = v(R), K = h(), q = h();
50
+ }), [W, G] = y(R), K = g(), q = g();
50
51
  async function J() {
51
- Ae(!0), Me("");
52
+ Fe(!0), Le("");
52
53
  try {
53
- let [r, i, a, ee] = await Promise.all([
54
+ let [i, a, ee, o, s] = await Promise.all([
54
55
  e(),
55
56
  t(),
56
- o(),
57
- n().catch(() => [])
57
+ te(),
58
+ n().catch(() => []),
59
+ r().catch(() => [])
58
60
  ]);
59
- we(r), Ee(i), De(a), ke(ee);
61
+ Ee(i), Oe(a), ke(ee), je(o), Me(s);
60
62
  } catch (e) {
61
- Me(e?.response?.data?.message ?? e?.message ?? "Failed to load"), I({
63
+ Le(e?.response?.data?.message ?? e?.message ?? "Failed to load"), F({
62
64
  message: e?.message || "Failed to load",
63
65
  type: "error"
64
66
  });
65
67
  } finally {
66
- Ae(!1);
68
+ Fe(!1);
67
69
  }
68
70
  }
69
- ee("view.manage.productManagement.vial", () => {
71
+ o("view.manage.productManagement.vial", () => {
70
72
  J();
71
73
  }, []);
72
- let Ne = se(() => B.filter((e) => e.categoryCode === "VACCINES" && e.isActive).sort((e, t) => e.name.localeCompare(t.name)), [B]), Y = { wastageReason: f(H.reason, "Reason") }, Pe = p(Y);
73
- async function Fe() {
74
+ let Re = ce(() => B.filter((e) => e.categoryCode === "VACCINES" && e.isActive).sort((e, t) => e.name.localeCompare(t.name)), [B]), Y = { wastageReason: p(H.reason, "Reason") }, ze = m(Y);
75
+ async function Be() {
74
76
  if (H.vial) {
75
- if (!Pe) {
77
+ if (!ze) {
76
78
  K.markAllTouched();
77
79
  return;
78
80
  }
79
81
  try {
80
- await a({
81
- id: ce(),
82
+ await ee({
83
+ id: le(),
82
84
  openVialId: H.vial.id,
83
85
  wastageReason: H.reason,
84
86
  comments: H.comments || null
85
- }), I({
87
+ }), F({
86
88
  message: "Vial closed.",
87
89
  type: "success"
88
90
  }), U({
@@ -92,21 +94,21 @@ function Ce() {
92
94
  comments: ""
93
95
  }), await J();
94
96
  } catch (e) {
95
- I({
97
+ F({
96
98
  message: e?.response?.data?.message ?? e?.message ?? "Failed",
97
99
  type: "error"
98
100
  });
99
101
  }
100
102
  }
101
103
  }
102
- function Ie() {
104
+ function Ve() {
103
105
  q.reset(), G(R);
104
106
  }
105
- function Le(e, t = Te) {
107
+ function He(e, t = De) {
106
108
  let n = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0);
107
- return t.filter((t) => t.productId === e && t.qtyRemaining > 0 && !t.isQuarantined && (!t.expiryDate || new Date(t.expiryDate).getTime() >= n)).sort((e, t) => Se(e) - Se(t));
109
+ return t.filter((t) => t.productId === e && t.qtyRemaining > 0 && !t.isQuarantined && (!t.expiryDate || new Date(t.expiryDate).getTime() >= n)).sort((e, t) => we(e) - we(t));
108
110
  }
109
- async function Re() {
111
+ async function Ue() {
110
112
  if (!W.productId) {
111
113
  q.markAllTouched();
112
114
  return;
@@ -116,23 +118,26 @@ function Ce() {
116
118
  loading: !0
117
119
  }));
118
120
  try {
119
- let [e, i, a] = await Promise.all([
120
- r(W.productId),
121
- t().catch(() => Te),
122
- n().catch(() => Oe)
121
+ let [e, r, a] = await Promise.all([
122
+ i(W.productId),
123
+ t().catch(() => De),
124
+ n().catch(() => Ae)
123
125
  ]);
124
- Ee(i), ke(a);
125
- let ee = Date.now(), o = e.filter((e) => e.status === "OPEN" && !e.expired && L(e) > ee && Number(e.volumeRemainingMl) > 0).sort((e, t) => L(e) - L(t)), te = e.reduce((e, t) => (t.status === "OPEN" && (e[t.batchId] = (e[t.batchId] || 0) + 1), e), {}), s = B.find((e) => e.id === W.productId)?.vaccineConfig, ne = s?.maxConcurrentOpenVials ?? 2, c = Le(W.productId, i).filter((e) => (te[e.id] || 0) < ne), l = /* @__PURE__ */ new Set(), u = [];
126
- function d(e, t, n) {
127
- let r = `${e}::${t ?? ""}`;
128
- l.has(r) || (l.add(r), u.push({
129
- key: r,
126
+ Oe(r), je(a);
127
+ let ee = Date.now(), o = e.filter((e) => e.status === "OPEN" && !e.expired && L(e) > ee && Number(e.volumeRemainingMl) > 0).sort((e, t) => L(e) - L(t)), te = e.reduce((e, t) => (t.status === "OPEN" && (e[t.batchId] = (e[t.batchId] || 0) + 1), e), {}), s = B.find((e) => e.id === W.productId)?.vaccineConfig, ne = s?.maxConcurrentOpenVials ?? 2, c = He(W.productId, r).filter((e) => (te[e.id] || 0) < ne), l = /* @__PURE__ */ new Set(), u = [];
128
+ function d(e, t, n, r = "") {
129
+ let i = `${e}::${t ?? ""}::${r ?? ""}`;
130
+ l.has(i) || (l.add(i), u.push({
131
+ key: i,
130
132
  ownerType: e,
131
133
  ownerId: t ?? null,
134
+ personalSource: r || null,
132
135
  label: n
133
136
  }));
134
137
  }
135
- (o.some((e) => e.ownerType === "USER") || c.some((e) => e.ownerType === "USER")) && d("USER", null, "Personal (outreach)");
138
+ (o.some((e) => e.ownerType === "USER" && e.batchSourceType === "PICKUP") || c.some((e) => e.ownerType === "USER" && e.sourceType === "PICKUP")) && d("USER", null, "Personal (Outreach)", "OUTREACH");
139
+ let re = o.some((e) => e.ownerType === "USER" && e.batchSourceType === "PURCHASE") || c.some((e) => e.ownerType === "USER" && e.sourceType === "PURCHASE");
140
+ Ne && re && d("USER", null, "Personal (Purchase)", "PURCHASE");
136
141
  let f = /* @__PURE__ */ new Set();
137
142
  o.forEach((e) => {
138
143
  e.ownerType === "FACILITY" && e.ownerId && f.add(e.ownerId);
@@ -141,50 +146,54 @@ function Ce() {
141
146
  }), f.forEach((e) => {
142
147
  d("FACILITY", e, `Facility — ${a.find((t) => t.id === e)?.name ?? e}`);
143
148
  });
144
- let p = u.length === 1 ? u[0] : null, m = p?.ownerType ?? "", h = p?.ownerId ?? "", g = ze(o, c, m, h), _ = g.vials.length > 0 ? "use-existing" : "open-new";
149
+ let p = u.length === 1 ? u[0] : null, m = p?.ownerType ?? "", h = p?.ownerId ?? "", g = p?.personalSource ?? "", _ = We(o, c, m, h, g), v = _.vials.length > 0 ? "use-existing" : "open-new";
145
150
  G((e) => ({
146
151
  ...e,
147
152
  loading: !1,
148
153
  step: "select",
149
- mode: _,
154
+ mode: v,
150
155
  ownerType: m,
151
156
  ownerId: h,
157
+ personalSource: g,
152
158
  allVials: o,
153
159
  allBatches: c,
154
160
  sources: u,
155
- vialCandidates: g.vials,
156
- batchCandidates: g.batches,
157
- selectedVialId: g.vials[0]?.id ?? "",
158
- selectedBatchId: g.batches[0]?.id ?? "",
159
- volumeMl: _ === "use-existing" ? g.vials[0]?.adultDoseMl ?? s?.adultDoseMl ?? "" : s?.adultDoseMl ?? ""
161
+ vialCandidates: _.vials,
162
+ batchCandidates: _.batches,
163
+ selectedVialId: _.vials[0]?.id ?? "",
164
+ selectedBatchId: _.batches[0]?.id ?? "",
165
+ volumeMl: v === "use-existing" ? _.vials[0]?.adultDoseMl ?? s?.adultDoseMl ?? "" : s?.adultDoseMl ?? ""
160
166
  }));
161
167
  } catch (e) {
162
168
  G((e) => ({
163
169
  ...e,
164
170
  loading: !1
165
- })), I({
171
+ })), F({
166
172
  message: e?.response?.data?.message ?? e?.message ?? "Failed to load vials",
167
173
  type: "error"
168
174
  });
169
175
  }
170
176
  }
171
- function ze(e, t, n, r) {
172
- return n ? {
173
- vials: e.filter((e) => e.ownerType === n && (n === "USER" || e.ownerId === r)),
174
- batches: t.filter((e) => e.ownerType === n && (n === "USER" || e.ownerId === r))
175
- } : {
177
+ function We(e, t, n, r, i) {
178
+ if (!n) return {
176
179
  vials: [],
177
180
  batches: []
178
181
  };
182
+ let a = n === "USER" && i ? i === "OUTREACH" ? "PICKUP" : "PURCHASE" : null;
183
+ return {
184
+ vials: e.filter((e) => e.ownerType === n && (n === "USER" ? !a || e.batchSourceType === a : e.ownerId === r)),
185
+ batches: t.filter((e) => e.ownerType === n && (n === "USER" ? !a || e.sourceType === a : e.ownerId === r))
186
+ };
179
187
  }
180
- function Be(e) {
188
+ function Ge(e) {
181
189
  let t = W.sources.find((t) => t.key === e);
182
190
  if (!t) return;
183
- let n = ze(W.allVials, W.allBatches, t.ownerType, t.ownerId), r = B.find((e) => e.id === W.productId)?.vaccineConfig, i = n.vials.length > 0 ? "use-existing" : "open-new";
191
+ let n = We(W.allVials, W.allBatches, t.ownerType, t.ownerId, t.personalSource), r = B.find((e) => e.id === W.productId)?.vaccineConfig, i = n.vials.length > 0 ? "use-existing" : "open-new";
184
192
  G((e) => ({
185
193
  ...e,
186
194
  ownerType: t.ownerType,
187
195
  ownerId: t.ownerId ?? "",
196
+ personalSource: t.personalSource ?? "",
188
197
  mode: i,
189
198
  vialCandidates: n.vials,
190
199
  batchCandidates: n.batches,
@@ -199,105 +208,116 @@ function Ce() {
199
208
  mode: e
200
209
  }));
201
210
  }
202
- let Z = W.vialCandidates.find((e) => e.id === W.selectedVialId), Ve = W.batchCandidates.find((e) => e.id === W.selectedBatchId), Q = B.find((e) => e.id === W.productId)?.vaccineConfig, $ = (() => {
203
- if (W.step === "product") return { productId: f(W.productId, "Vaccine") };
211
+ let Z = W.vialCandidates.find((e) => e.id === W.selectedVialId), Ke = W.batchCandidates.find((e) => e.id === W.selectedBatchId), Q = B.find((e) => e.id === W.productId)?.vaccineConfig, $ = (() => {
212
+ if (W.step === "product") return { productId: p(W.productId, "Vaccine") };
204
213
  let e = {
205
- ownerType: f(W.ownerType, "Source"),
206
- volumeMl: m(W.volumeMl, "Volume", { required: !0 })
214
+ ownerType: p(W.ownerType, "Source"),
215
+ volumeMl: h(W.volumeMl, "Volume", { required: !0 })
207
216
  };
208
217
  if (W.mode === "use-existing") {
209
- if (e.selectedVialId = f(W.selectedVialId, "Vial"), !e.volumeMl && Z) {
218
+ if (e.selectedVialId = p(W.selectedVialId, "Vial"), !e.volumeMl && Z) {
210
219
  let t = Number(W.volumeMl), n = Number(Z.volumeRemainingMl);
211
220
  t > n && (e.volumeMl = W.batchCandidates.length > 0 ? `Only ${n.toFixed(2)} ml remaining in this vial — open another vial instead.` : `Only ${n.toFixed(2)} ml remaining in this vial.`);
212
221
  }
213
- } else if (e.selectedBatchId = f(W.selectedBatchId, "Batch"), !e.volumeMl && Q?.vialVolumeMl) {
222
+ } else if (e.selectedBatchId = p(W.selectedBatchId, "Batch"), !e.volumeMl && Q?.vialVolumeMl) {
214
223
  let t = Number(W.volumeMl), n = Number(Q.vialVolumeMl);
215
224
  t > n && (e.volumeMl = `A fresh vial holds ${n.toFixed(2)} ml`);
216
225
  }
217
226
  return e;
218
- })(), He = p($);
219
- async function Ue() {
220
- if (!He) {
227
+ })(), qe = m($);
228
+ async function Je() {
229
+ if (!qe) {
221
230
  q.markAllTouched();
222
231
  return;
223
232
  }
224
233
  try {
225
234
  let e = {
226
- id: ce(),
235
+ id: le(),
227
236
  productId: W.productId,
228
237
  volumeMl: Number(W.volumeMl),
229
238
  ownerType: W.ownerType,
230
- ownerId: W.ownerType === "FACILITY" && W.ownerId || null
239
+ ownerId: W.ownerType === "FACILITY" && W.ownerId || null,
240
+ personalSource: W.ownerType === "USER" && W.personalSource || null
231
241
  };
232
- W.mode === "use-existing" ? e.openVialId = Z.id : e.batchId = Ve.id, await ne(e), I({
242
+ W.mode === "use-existing" ? e.openVialId = Z.id : e.batchId = Ke.id, await l(e), F({
233
243
  message: W.mode === "use-existing" ? "Dose administered." : "New vial opened and dose administered.",
234
244
  type: "success"
235
- }), Ie(), await J();
245
+ }), Ve(), await J();
236
246
  } catch (e) {
237
- I({
247
+ F({
238
248
  message: e?.response?.data?.message ?? e?.message ?? "Failed",
239
249
  type: "error"
240
250
  });
241
251
  }
242
252
  }
243
- return /* @__PURE__ */ x(C, { children: [/* @__PURE__ */ b(c, {}), /* @__PURE__ */ x(te, {
253
+ return /* @__PURE__ */ S(w, { children: [/* @__PURE__ */ x(u, {}), /* @__PURE__ */ S(ne, {
244
254
  perm: "view.manage.productManagement.vial",
245
255
  children: [
246
- /* @__PURE__ */ x(s, {
256
+ /* @__PURE__ */ S(c, {
247
257
  title: "Open Vials",
248
258
  subtitle: "Open vaccine vials in use. Close them at the end of the day and record any waste.",
249
259
  chips: ["Vaccine"],
250
- actions: /* @__PURE__ */ x(A, {
260
+ actions: /* @__PURE__ */ S(k, {
251
261
  direction: "row",
252
262
  spacing: 1,
253
- children: [/* @__PURE__ */ b(w, {
263
+ children: [/* @__PURE__ */ x(T, {
254
264
  variant: "outlined",
255
- startIcon: /* @__PURE__ */ b(be, {}),
265
+ startIcon: /* @__PURE__ */ x(Ce, {}),
256
266
  onClick: () => void J(),
257
267
  children: "Refresh"
258
- }), !1]
268
+ }), /* @__PURE__ */ x(T, {
269
+ variant: "contained",
270
+ startIcon: /* @__PURE__ */ x(I, {}),
271
+ onClick: () => {
272
+ q.reset(), G({
273
+ ...R,
274
+ open: !0
275
+ });
276
+ },
277
+ children: "Administer Vaccine"
278
+ })]
259
279
  }),
260
280
  children: [
261
- je ? /* @__PURE__ */ b(S, {
281
+ Ie ? /* @__PURE__ */ x(C, {
262
282
  severity: "error",
263
283
  sx: { mb: 2 },
264
- children: je
284
+ children: Ie
265
285
  }) : null,
266
- V ? /* @__PURE__ */ b(D, { sx: { mb: 2 } }) : null,
267
- /* @__PURE__ */ b(l, {
286
+ Pe ? /* @__PURE__ */ x(ge, { sx: { mb: 2 } }) : null,
287
+ /* @__PURE__ */ x(d, {
268
288
  eyebrow: "In use",
269
289
  title: "Open vials",
270
- subtitle: V ? "Loading…" : `${z.length} ${z.length === 1 ? "vial" : "vials"} currently in use`,
271
- children: /* @__PURE__ */ x(u, {
290
+ subtitle: Pe ? "Loading…" : `${z.length} ${z.length === 1 ? "vial" : "vials"} currently in use`,
291
+ children: /* @__PURE__ */ S(re, {
272
292
  dense: !0,
273
- children: [/* @__PURE__ */ b(N, { children: /* @__PURE__ */ x(P, { children: [
274
- /* @__PURE__ */ b(M, { children: "Product" }),
275
- /* @__PURE__ */ b(M, { children: "Lot" }),
276
- /* @__PURE__ */ b(M, { children: "Owner" }),
277
- /* @__PURE__ */ b(M, { children: "Opened" }),
278
- /* @__PURE__ */ b(M, { children: "Expires" }),
279
- /* @__PURE__ */ b(M, { children: "Volume remaining" }),
280
- /* @__PURE__ */ b(M, { children: "Status" }),
281
- /* @__PURE__ */ b(M, {
293
+ children: [/* @__PURE__ */ x(M, { children: /* @__PURE__ */ S(N, { children: [
294
+ /* @__PURE__ */ x(j, { children: "Product" }),
295
+ /* @__PURE__ */ x(j, { children: "Lot" }),
296
+ /* @__PURE__ */ x(j, { children: "Owner" }),
297
+ /* @__PURE__ */ x(j, { children: "Opened" }),
298
+ /* @__PURE__ */ x(j, { children: "Expires" }),
299
+ /* @__PURE__ */ x(j, { children: "Volume remaining" }),
300
+ /* @__PURE__ */ x(j, { children: "Status" }),
301
+ /* @__PURE__ */ x(j, {
282
302
  align: "right",
283
303
  children: "Action"
284
304
  })
285
- ] }) }), /* @__PURE__ */ b(j, { children: z.length === 0 && !V ? /* @__PURE__ */ b(d, {
305
+ ] }) }), /* @__PURE__ */ x(A, { children: z.length === 0 && !Pe ? /* @__PURE__ */ x(f, {
286
306
  colSpan: 8,
287
- icon: xe,
307
+ icon: I,
288
308
  title: "No open vials",
289
309
  hint: "Use Administer Vaccine to open and dose a vial."
290
310
  }) : z.map((e) => {
291
311
  let t = e.volumeTotalMl ? (1 - Number(e.volumeRemainingMl) / Number(e.volumeTotalMl)) * 100 : 0;
292
- return /* @__PURE__ */ x(P, {
312
+ return /* @__PURE__ */ S(N, {
293
313
  hover: !0,
294
314
  children: [
295
- /* @__PURE__ */ b(M, { children: /* @__PURE__ */ b(F, {
315
+ /* @__PURE__ */ x(j, { children: /* @__PURE__ */ x(P, {
296
316
  variant: "body2",
297
317
  sx: { fontWeight: 700 },
298
318
  children: e.productName
299
319
  }) }),
300
- /* @__PURE__ */ b(M, { children: e.lotNumber ? /* @__PURE__ */ b(C, {
320
+ /* @__PURE__ */ x(j, { children: e.lotNumber ? /* @__PURE__ */ x(w, {
301
321
  component: "span",
302
322
  sx: {
303
323
  display: "inline-flex",
@@ -310,31 +330,31 @@ function Ce() {
310
330
  fontWeight: 700
311
331
  },
312
332
  children: e.lotNumber
313
- }) : /* @__PURE__ */ b(F, {
333
+ }) : /* @__PURE__ */ x(P, {
314
334
  variant: "caption",
315
335
  color: "text.disabled",
316
336
  children: "—"
317
337
  }) }),
318
- /* @__PURE__ */ x(M, { children: [/* @__PURE__ */ b(F, {
338
+ /* @__PURE__ */ S(j, { children: [/* @__PURE__ */ x(P, {
319
339
  variant: "body2",
320
340
  sx: { fontWeight: 700 },
321
341
  children: e.ownerName || (e.ownerType === "USER" ? "Personal" : "Facility")
322
- }), /* @__PURE__ */ b(F, {
342
+ }), /* @__PURE__ */ x(P, {
323
343
  variant: "caption",
324
344
  color: "text.secondary",
325
345
  children: e.ownerType ?? "—"
326
346
  })] }),
327
- /* @__PURE__ */ b(M, { children: /* @__PURE__ */ b(F, {
347
+ /* @__PURE__ */ x(j, { children: /* @__PURE__ */ x(P, {
328
348
  variant: "caption",
329
349
  sx: { fontWeight: 600 },
330
- children: g(e.openedAt)
350
+ children: _(e.openedAt)
331
351
  }) }),
332
- /* @__PURE__ */ b(M, { children: /* @__PURE__ */ b(ye, {
352
+ /* @__PURE__ */ x(j, { children: /* @__PURE__ */ x(Se, {
333
353
  title: e.expired ? "Expired — close out immediately" : "",
334
- children: /* @__PURE__ */ b(T, {
354
+ children: /* @__PURE__ */ x(E, {
335
355
  size: "small",
336
356
  color: e.expired ? "error" : "success",
337
- label: g(e.expiresAt),
357
+ label: _(e.expiresAt),
338
358
  sx: {
339
359
  fontWeight: 700,
340
360
  borderRadius: 1.5,
@@ -342,11 +362,11 @@ function Ce() {
342
362
  }
343
363
  })
344
364
  }) }),
345
- /* @__PURE__ */ b(M, { children: /* @__PURE__ */ x(A, {
365
+ /* @__PURE__ */ x(j, { children: /* @__PURE__ */ S(k, {
346
366
  direction: "row",
347
367
  alignItems: "center",
348
368
  spacing: 1,
349
- children: [/* @__PURE__ */ x(F, {
369
+ children: [/* @__PURE__ */ S(P, {
350
370
  variant: "body2",
351
371
  sx: {
352
372
  fontWeight: 800,
@@ -354,15 +374,15 @@ function Ce() {
354
374
  minWidth: 80
355
375
  },
356
376
  children: [
357
- _(e.volumeRemainingMl),
377
+ v(e.volumeRemainingMl),
358
378
  " /",
359
379
  " ",
360
- _(e.volumeTotalMl),
380
+ v(e.volumeTotalMl),
361
381
  " ml"
362
382
  ]
363
- }), /* @__PURE__ */ b(C, {
383
+ }), /* @__PURE__ */ x(w, {
364
384
  sx: { width: 80 },
365
- children: /* @__PURE__ */ b(D, {
385
+ children: /* @__PURE__ */ x(ge, {
366
386
  variant: "determinate",
367
387
  value: t,
368
388
  sx: {
@@ -373,19 +393,19 @@ function Ce() {
373
393
  })
374
394
  })]
375
395
  }) }),
376
- /* @__PURE__ */ b(M, { children: /* @__PURE__ */ b(T, {
396
+ /* @__PURE__ */ x(j, { children: /* @__PURE__ */ x(E, {
377
397
  size: "small",
378
398
  color: e.expired ? "error" : "info",
379
- label: e.expired ? "Expired" : oe(ie, e.status),
399
+ label: e.expired ? "Expired" : se(ae, e.status),
380
400
  sx: {
381
401
  fontWeight: 700,
382
402
  borderRadius: 1.5,
383
403
  height: 22
384
404
  }
385
405
  }) }),
386
- /* @__PURE__ */ b(M, {
406
+ /* @__PURE__ */ x(j, {
387
407
  align: "right",
388
- children: Ce ? /* @__PURE__ */ b(w, {
408
+ children: Te ? /* @__PURE__ */ x(T, {
389
409
  size: "small",
390
410
  variant: "outlined",
391
411
  color: "error",
@@ -407,24 +427,24 @@ function Ce() {
407
427
  })
408
428
  ]
409
429
  }),
410
- /* @__PURE__ */ x(le, {
430
+ /* @__PURE__ */ S(ue, {
411
431
  open: W.open,
412
- onClose: Ie,
432
+ onClose: Ve,
413
433
  fullWidth: !0,
414
434
  maxWidth: "md",
415
435
  children: [
416
- /* @__PURE__ */ b(fe, { children: W.step === "product" ? "Administer Vaccine — Select Vaccine" : W.mode === "use-existing" ? "Administer Vaccine — Select Open Vial" : "Administer Vaccine — Open & Administer" }),
417
- /* @__PURE__ */ b(de, {
436
+ /* @__PURE__ */ x(pe, { children: W.step === "product" ? "Administer Vaccine — Select Vaccine" : W.mode === "use-existing" ? "Administer Vaccine — Select Open Vial" : "Administer Vaccine — Open & Administer" }),
437
+ /* @__PURE__ */ x(fe, {
418
438
  dividers: !0,
419
- children: W.step === "product" ? /* @__PURE__ */ x(E, {
439
+ children: W.step === "product" ? /* @__PURE__ */ S(me, {
420
440
  required: !0,
421
441
  fullWidth: !0,
422
442
  size: "small",
423
443
  sx: { mt: 1 },
424
444
  error: q.show("productId") && !!$.productId,
425
445
  children: [
426
- /* @__PURE__ */ b(me, { children: "Vaccine" }),
427
- /* @__PURE__ */ x(k, {
446
+ /* @__PURE__ */ x(D, { children: "Vaccine" }),
447
+ /* @__PURE__ */ S(ve, {
428
448
  label: "Vaccine",
429
449
  value: W.productId,
430
450
  onChange: (e) => G({
@@ -432,58 +452,105 @@ function Ce() {
432
452
  productId: e.target.value
433
453
  }),
434
454
  onBlur: q.onBlur("productId"),
435
- children: [Ne.length === 0 ? /* @__PURE__ */ b(O, {
455
+ children: [Re.length === 0 ? /* @__PURE__ */ x(O, {
436
456
  value: "",
437
457
  disabled: !0,
438
- children: /* @__PURE__ */ b("em", { children: "No active vaccine products" })
439
- }) : null, Ne.map((e) => /* @__PURE__ */ x(O, {
458
+ children: /* @__PURE__ */ x("em", { children: "No active vaccine products" })
459
+ }) : null, Re.map((e) => /* @__PURE__ */ S(O, {
440
460
  value: e.id,
441
461
  children: [e.name, e.vaccineConfig?.vaccineCode ? ` · ${e.vaccineConfig.vaccineCode}` : ""]
442
462
  }, e.id))]
443
463
  }),
444
- /* @__PURE__ */ b(pe, { children: q.show("productId") && $.productId ? $.productId : "Open vials for this vaccine will be shown next. If none are open, a fresh vial can be opened on the same screen." })
464
+ /* @__PURE__ */ x(he, { children: q.show("productId") && $.productId ? $.productId : "Open vials for this vaccine will be shown next. If none are open, a fresh vial can be opened on the same screen." })
445
465
  ]
446
- }) : /* @__PURE__ */ x(A, {
466
+ }) : /* @__PURE__ */ S(k, {
447
467
  spacing: 2,
448
468
  sx: { pt: 1 },
449
469
  children: [
450
- W.loading ? /* @__PURE__ */ b(D, {}) : null,
451
- W.sources.length === 0 ? /* @__PURE__ */ b(S, {
470
+ W.loading ? /* @__PURE__ */ x(ge, {}) : null,
471
+ W.sources.length === 0 ? /* @__PURE__ */ x(C, {
452
472
  severity: "warning",
453
473
  children: "No stock available for this vaccine — neither in your personal stock nor at an assigned facility."
454
- }) : W.sources.length > 1 ? /* @__PURE__ */ x(E, {
474
+ }) : W.sources.length > 1 ? /* @__PURE__ */ S(me, {
455
475
  required: !0,
456
476
  fullWidth: !0,
457
477
  size: "small",
458
478
  error: q.show("ownerType") && !!$.ownerType,
459
479
  children: [
460
- /* @__PURE__ */ b(me, { children: "Administer from" }),
461
- /* @__PURE__ */ b(k, {
480
+ /* @__PURE__ */ x(D, { children: "Administer from" }),
481
+ /* @__PURE__ */ x(ve, {
462
482
  label: "Administer from",
463
- value: W.ownerType ? `${W.ownerType}::${W.ownerId ?? ""}` : "",
464
- onChange: (e) => Be(e.target.value),
483
+ value: W.ownerType ? `${W.ownerType}::${W.ownerId ?? ""}::${W.personalSource ?? ""}` : "",
484
+ onChange: (e) => Ge(e.target.value),
465
485
  onBlur: q.onBlur("ownerType"),
466
- children: W.sources.map((e) => /* @__PURE__ */ b(O, {
486
+ children: W.sources.map((e) => /* @__PURE__ */ x(O, {
467
487
  value: e.key,
468
488
  children: e.label
469
489
  }, e.key))
470
490
  }),
471
- /* @__PURE__ */ b(pe, { children: q.show("ownerType") && $.ownerType ? $.ownerType : "Personal stock (outreach) and facility stock are separate vial pools — pick which one this dose comes from." })
491
+ /* @__PURE__ */ x(he, { children: q.show("ownerType") && $.ownerType ? $.ownerType : "Personal stock (outreach) and facility stock are separate vial pools — pick which one this dose comes from." })
472
492
  ]
473
- }) : /* @__PURE__ */ x(S, {
493
+ }) : /* @__PURE__ */ S(C, {
474
494
  severity: "info",
475
495
  children: [
476
496
  "Administering from",
477
497
  " ",
478
- /* @__PURE__ */ b("strong", { children: W.sources[0]?.label }),
498
+ /* @__PURE__ */ x("strong", { children: W.sources[0]?.label }),
479
499
  "."
480
500
  ]
481
501
  }),
482
- W.mode === "use-existing" ? /* @__PURE__ */ x(y, { children: [W.ownerType ? (() => {
502
+ W.ownerType === "USER" && W.personalSource === "OUTREACH" && V[0] ? /* @__PURE__ */ S(w, {
503
+ sx: {
504
+ p: 1.5,
505
+ borderRadius: 2,
506
+ border: "1px solid",
507
+ borderColor: "divider",
508
+ bgcolor: (e) => e.palette.action.hover
509
+ },
510
+ children: [
511
+ /* @__PURE__ */ x(P, {
512
+ variant: "overline",
513
+ sx: {
514
+ fontWeight: 800,
515
+ letterSpacing: .6,
516
+ color: "text.secondary"
517
+ },
518
+ children: "Outreach session"
519
+ }),
520
+ /* @__PURE__ */ x(P, {
521
+ variant: "body2",
522
+ sx: { fontWeight: 800 },
523
+ children: V[0].sessionName || "—"
524
+ }),
525
+ V[0].sessionSite ? /* @__PURE__ */ S(P, {
526
+ variant: "caption",
527
+ color: "text.secondary",
528
+ sx: { display: "block" },
529
+ children: ["Site: ", V[0].sessionSite]
530
+ }) : null,
531
+ /* @__PURE__ */ S(P, {
532
+ variant: "caption",
533
+ color: "text.secondary",
534
+ sx: { display: "block" },
535
+ children: [V[0].sessionStartTime ? _(V[0].sessionStartTime) : "—", V[0].sessionExpectedEndTime ? ` → ${_(V[0].sessionExpectedEndTime)}` : ""]
536
+ }),
537
+ V[0].sessionDescription ? /* @__PURE__ */ x(P, {
538
+ variant: "caption",
539
+ color: "text.secondary",
540
+ sx: {
541
+ display: "block",
542
+ mt: .5,
543
+ whiteSpace: "pre-wrap"
544
+ },
545
+ children: V[0].sessionDescription
546
+ }) : null
547
+ ]
548
+ }) : null,
549
+ W.mode === "use-existing" ? /* @__PURE__ */ S(b, { children: [W.ownerType ? (() => {
483
550
  let e = Number(W.volumeMl), t = !Number.isNaN(e) && e > 0 && W.vialCandidates.some((t) => Number(t.volumeRemainingMl) >= e);
484
- return /* @__PURE__ */ b(S, {
551
+ return /* @__PURE__ */ x(C, {
485
552
  severity: "info",
486
- action: t ? null : /* @__PURE__ */ b(w, {
553
+ action: t ? null : /* @__PURE__ */ x(T, {
487
554
  color: "inherit",
488
555
  size: "small",
489
556
  onClick: () => X("open-new"),
@@ -491,56 +558,56 @@ function Ce() {
491
558
  }),
492
559
  children: t ? "Pick an open vial — earliest-expiry-first is preselected. An existing vial can hold the requested dose, so no new vial is needed." : "Pick an open vial — earliest-expiry-first is preselected. The requested dose does not fit in any open vial; you can open another vial from stock."
493
560
  });
494
- })() : /* @__PURE__ */ b(S, {
561
+ })() : /* @__PURE__ */ x(C, {
495
562
  severity: "info",
496
563
  children: "Pick an administration source above to see the available open vials."
497
- }), /* @__PURE__ */ b(_e, { children: /* @__PURE__ */ x(ge, {
564
+ }), /* @__PURE__ */ x(be, { children: /* @__PURE__ */ S(ye, {
498
565
  size: "small",
499
- children: [/* @__PURE__ */ b(N, { children: /* @__PURE__ */ x(P, { children: [
500
- /* @__PURE__ */ b(M, {}),
501
- /* @__PURE__ */ b(M, {
566
+ children: [/* @__PURE__ */ x(M, { children: /* @__PURE__ */ S(N, { children: [
567
+ /* @__PURE__ */ x(j, {}),
568
+ /* @__PURE__ */ x(j, {
502
569
  sx: { fontWeight: 800 },
503
570
  children: "Lot"
504
571
  }),
505
- /* @__PURE__ */ b(M, {
572
+ /* @__PURE__ */ x(j, {
506
573
  sx: { fontWeight: 800 },
507
574
  children: "Vial expires"
508
575
  }),
509
- /* @__PURE__ */ b(M, {
576
+ /* @__PURE__ */ x(j, {
510
577
  sx: { fontWeight: 800 },
511
578
  children: "Batch expires"
512
579
  }),
513
- /* @__PURE__ */ b(M, {
580
+ /* @__PURE__ */ x(j, {
514
581
  sx: { fontWeight: 800 },
515
582
  align: "right",
516
583
  children: "Remaining (ml)"
517
584
  })
518
- ] }) }), /* @__PURE__ */ b(j, { children: W.vialCandidates.length === 0 ? /* @__PURE__ */ b(P, { children: /* @__PURE__ */ b(M, {
585
+ ] }) }), /* @__PURE__ */ x(A, { children: W.vialCandidates.length === 0 ? /* @__PURE__ */ x(N, { children: /* @__PURE__ */ x(j, {
519
586
  colSpan: 5,
520
587
  sx: {
521
588
  py: 4,
522
589
  textAlign: "center"
523
590
  },
524
- children: /* @__PURE__ */ x(A, {
591
+ children: /* @__PURE__ */ S(k, {
525
592
  alignItems: "center",
526
593
  spacing: 1,
527
594
  children: [
528
- /* @__PURE__ */ b(xe, { sx: {
595
+ /* @__PURE__ */ x(I, { sx: {
529
596
  fontSize: 36,
530
597
  color: "text.disabled",
531
598
  opacity: .7
532
599
  } }),
533
- /* @__PURE__ */ b(F, {
600
+ /* @__PURE__ */ x(P, {
534
601
  variant: "body2",
535
602
  sx: { fontWeight: 700 },
536
603
  children: "No usable open vials for this vaccine"
537
604
  }),
538
- W.batchCandidates.length > 0 ? /* @__PURE__ */ b(w, {
605
+ W.batchCandidates.length > 0 ? /* @__PURE__ */ x(T, {
539
606
  size: "small",
540
607
  variant: "outlined",
541
608
  onClick: () => X("open-new"),
542
609
  children: "Open a new vial instead"
543
- }) : /* @__PURE__ */ b(F, {
610
+ }) : /* @__PURE__ */ x(P, {
544
611
  variant: "caption",
545
612
  color: "text.secondary",
546
613
  children: "No stock available either — receive a purchase first."
@@ -549,7 +616,7 @@ function Ce() {
549
616
  })
550
617
  }) }) : W.vialCandidates.map((e, t) => {
551
618
  let n = W.selectedVialId === e.id;
552
- return /* @__PURE__ */ x(P, {
619
+ return /* @__PURE__ */ S(N, {
553
620
  hover: !0,
554
621
  selected: n,
555
622
  onClick: () => G({
@@ -559,76 +626,76 @@ function Ce() {
559
626
  }),
560
627
  sx: { cursor: "pointer" },
561
628
  children: [
562
- /* @__PURE__ */ b(M, {
629
+ /* @__PURE__ */ x(j, {
563
630
  padding: "checkbox",
564
- children: /* @__PURE__ */ b(he, { checked: n })
631
+ children: /* @__PURE__ */ x(_e, { checked: n })
565
632
  }),
566
- /* @__PURE__ */ x(M, {
633
+ /* @__PURE__ */ S(j, {
567
634
  sx: { fontFamily: "monospace" },
568
- children: [e.lotNumber || "—", t === 0 ? /* @__PURE__ */ b(T, {
635
+ children: [e.lotNumber || "—", t === 0 ? /* @__PURE__ */ x(E, {
569
636
  size: "small",
570
637
  color: "primary",
571
638
  label: "Use first",
572
639
  sx: { ml: 1 }
573
640
  }) : null]
574
641
  }),
575
- /* @__PURE__ */ b(M, { children: g(e.expiresAt) }),
576
- /* @__PURE__ */ b(M, { children: e.batchExpiryDate ? re(e.batchExpiryDate) : "—" }),
577
- /* @__PURE__ */ x(M, {
642
+ /* @__PURE__ */ x(j, { children: _(e.expiresAt) }),
643
+ /* @__PURE__ */ x(j, { children: e.batchExpiryDate ? ie(e.batchExpiryDate) : "—" }),
644
+ /* @__PURE__ */ S(j, {
578
645
  align: "right",
579
646
  sx: { fontWeight: 700 },
580
647
  children: [
581
- _(e.volumeRemainingMl),
648
+ v(e.volumeRemainingMl),
582
649
  " /",
583
650
  " ",
584
- _(e.volumeTotalMl)
651
+ v(e.volumeTotalMl)
585
652
  ]
586
653
  })
587
654
  ]
588
655
  }, e.id);
589
656
  }) })]
590
- }) })] }) : /* @__PURE__ */ b(y, { children: W.ownerType ? W.batchCandidates.length === 0 ? /* @__PURE__ */ b(S, {
657
+ }) })] }) : /* @__PURE__ */ x(b, { children: W.ownerType ? W.batchCandidates.length === 0 ? /* @__PURE__ */ x(C, {
591
658
  severity: "error",
592
- action: W.vialCandidates.length > 0 ? /* @__PURE__ */ b(w, {
659
+ action: W.vialCandidates.length > 0 ? /* @__PURE__ */ x(T, {
593
660
  color: "inherit",
594
661
  size: "small",
595
662
  onClick: () => X("use-existing"),
596
663
  children: "Use an open vial"
597
664
  }) : null,
598
665
  children: "No batches available — every batch is either out of stock, expired, or already at the maximum concurrent open vials. Receive a purchase or finish the open vials first."
599
- }) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(S, {
666
+ }) : /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(C, {
600
667
  severity: "warning",
601
- action: W.vialCandidates.length > 0 ? /* @__PURE__ */ b(w, {
668
+ action: W.vialCandidates.length > 0 ? /* @__PURE__ */ x(T, {
602
669
  color: "inherit",
603
670
  size: "small",
604
671
  onClick: () => X("use-existing"),
605
672
  children: "Use an open vial instead"
606
673
  }) : null,
607
674
  children: W.vialCandidates.length > 0 ? "Opening a new vial from stock. Existing open vials are still available if the dose fits." : "No open vials for this vaccine. A new vial will be opened from the selected batch and the dose recorded in one step."
608
- }), /* @__PURE__ */ b(_e, { children: /* @__PURE__ */ x(ge, {
675
+ }), /* @__PURE__ */ x(be, { children: /* @__PURE__ */ S(ye, {
609
676
  size: "small",
610
- children: [/* @__PURE__ */ b(N, { children: /* @__PURE__ */ x(P, { children: [
611
- /* @__PURE__ */ b(M, {}),
612
- /* @__PURE__ */ b(M, {
677
+ children: [/* @__PURE__ */ x(M, { children: /* @__PURE__ */ S(N, { children: [
678
+ /* @__PURE__ */ x(j, {}),
679
+ /* @__PURE__ */ x(j, {
613
680
  sx: { fontWeight: 800 },
614
681
  children: "Lot"
615
682
  }),
616
- /* @__PURE__ */ b(M, {
683
+ /* @__PURE__ */ x(j, {
617
684
  sx: { fontWeight: 800 },
618
685
  children: "Batch expires"
619
686
  }),
620
- /* @__PURE__ */ b(M, {
687
+ /* @__PURE__ */ x(j, {
621
688
  sx: { fontWeight: 800 },
622
689
  align: "right",
623
690
  children: "Qty available"
624
691
  }),
625
- /* @__PURE__ */ b(M, {
692
+ /* @__PURE__ */ x(j, {
626
693
  sx: { fontWeight: 800 },
627
694
  children: "Storage"
628
695
  })
629
- ] }) }), /* @__PURE__ */ b(j, { children: W.batchCandidates.map((e, t) => {
696
+ ] }) }), /* @__PURE__ */ x(A, { children: W.batchCandidates.map((e, t) => {
630
697
  let n = W.selectedBatchId === e.id;
631
- return /* @__PURE__ */ x(P, {
698
+ return /* @__PURE__ */ S(N, {
632
699
  hover: !0,
633
700
  selected: n,
634
701
  onClick: () => G({
@@ -637,39 +704,39 @@ function Ce() {
637
704
  }),
638
705
  sx: { cursor: "pointer" },
639
706
  children: [
640
- /* @__PURE__ */ b(M, {
707
+ /* @__PURE__ */ x(j, {
641
708
  padding: "checkbox",
642
- children: /* @__PURE__ */ b(he, { checked: n })
709
+ children: /* @__PURE__ */ x(_e, { checked: n })
643
710
  }),
644
- /* @__PURE__ */ x(M, {
711
+ /* @__PURE__ */ S(j, {
645
712
  sx: { fontFamily: "monospace" },
646
- children: [e.lotNumber || "—", t === 0 ? /* @__PURE__ */ b(T, {
713
+ children: [e.lotNumber || "—", t === 0 ? /* @__PURE__ */ x(E, {
647
714
  size: "small",
648
715
  color: "primary",
649
716
  label: "Use first",
650
717
  sx: { ml: 1 }
651
718
  }) : null]
652
719
  }),
653
- /* @__PURE__ */ b(M, { children: e.expiryDate ? re(e.expiryDate) : "—" }),
654
- /* @__PURE__ */ b(M, {
720
+ /* @__PURE__ */ x(j, { children: e.expiryDate ? ie(e.expiryDate) : "—" }),
721
+ /* @__PURE__ */ x(j, {
655
722
  align: "right",
656
723
  sx: { fontWeight: 700 },
657
724
  children: e.qtyRemaining
658
725
  }),
659
- /* @__PURE__ */ b(M, { children: e.storageUnitName || "—" })
726
+ /* @__PURE__ */ x(j, { children: e.storageUnitName || "—" })
660
727
  ]
661
728
  }, e.id);
662
729
  }) })]
663
- }) })] }) : /* @__PURE__ */ b(S, {
730
+ }) })] }) : /* @__PURE__ */ x(C, {
664
731
  severity: "info",
665
732
  children: "Pick an administration source above to see the available batches."
666
733
  }) }),
667
- W.mode === "use-existing" && Z || W.mode === "open-new" && Ve ? /* @__PURE__ */ x(A, {
734
+ W.mode === "use-existing" && Z || W.mode === "open-new" && Ke ? /* @__PURE__ */ S(k, {
668
735
  direction: "row",
669
736
  spacing: 1,
670
737
  alignItems: "center",
671
738
  flexWrap: "wrap",
672
- children: [W.mode === "use-existing" ? /* @__PURE__ */ x(y, { children: [Z.adultDoseMl ? /* @__PURE__ */ x(w, {
739
+ children: [W.mode === "use-existing" ? /* @__PURE__ */ S(b, { children: [Z.adultDoseMl ? /* @__PURE__ */ S(T, {
673
740
  size: "small",
674
741
  onClick: () => G({
675
742
  ...W,
@@ -680,7 +747,7 @@ function Ce() {
680
747
  Z.adultDoseMl,
681
748
  " ml)"
682
749
  ]
683
- }) : null, Z.childDoseMl ? /* @__PURE__ */ x(w, {
750
+ }) : null, Z.childDoseMl ? /* @__PURE__ */ S(T, {
684
751
  size: "small",
685
752
  onClick: () => G({
686
753
  ...W,
@@ -691,7 +758,7 @@ function Ce() {
691
758
  Z.childDoseMl,
692
759
  " ml)"
693
760
  ]
694
- }) : null] }) : /* @__PURE__ */ x(y, { children: [Q?.adultDoseMl ? /* @__PURE__ */ x(w, {
761
+ }) : null] }) : /* @__PURE__ */ S(b, { children: [Q?.adultDoseMl ? /* @__PURE__ */ S(T, {
695
762
  size: "small",
696
763
  onClick: () => G({
697
764
  ...W,
@@ -702,7 +769,7 @@ function Ce() {
702
769
  Q.adultDoseMl,
703
770
  " ml)"
704
771
  ]
705
- }) : null, Q?.childDoseMl ? /* @__PURE__ */ x(w, {
772
+ }) : null, Q?.childDoseMl ? /* @__PURE__ */ S(T, {
706
773
  size: "small",
707
774
  onClick: () => G({
708
775
  ...W,
@@ -713,7 +780,7 @@ function Ce() {
713
780
  Q.childDoseMl,
714
781
  " ml)"
715
782
  ]
716
- }) : null] }), /* @__PURE__ */ b(ve, {
783
+ }) : null] }), /* @__PURE__ */ x(xe, {
717
784
  required: !0,
718
785
  label: "Volume (ml)",
719
786
  size: "small",
@@ -736,12 +803,12 @@ function Ce() {
736
803
  ]
737
804
  })
738
805
  }),
739
- /* @__PURE__ */ x(ue, { children: [
740
- /* @__PURE__ */ b(w, {
741
- onClick: Ie,
806
+ /* @__PURE__ */ S(de, { children: [
807
+ /* @__PURE__ */ x(T, {
808
+ onClick: Ve,
742
809
  children: "Cancel"
743
810
  }),
744
- W.step === "select" ? /* @__PURE__ */ b(w, {
811
+ W.step === "select" ? /* @__PURE__ */ x(T, {
745
812
  onClick: () => G({
746
813
  ...R,
747
814
  open: !0,
@@ -749,21 +816,21 @@ function Ce() {
749
816
  }),
750
817
  children: "Back"
751
818
  }) : null,
752
- W.step === "product" ? /* @__PURE__ */ b(w, {
819
+ W.step === "product" ? /* @__PURE__ */ x(T, {
753
820
  variant: "contained",
754
821
  disabled: !W.productId || W.loading,
755
- onClick: () => void Re(),
822
+ onClick: () => void Ue(),
756
823
  children: "Next"
757
- }) : /* @__PURE__ */ b(w, {
824
+ }) : /* @__PURE__ */ x(T, {
758
825
  variant: "contained",
759
- disabled: !He,
760
- onClick: () => void Ue(),
826
+ disabled: !qe,
827
+ onClick: () => void Je(),
761
828
  children: W.mode === "use-existing" ? "Administer" : "Open & Administer"
762
829
  })
763
830
  ] })
764
831
  ]
765
832
  }),
766
- /* @__PURE__ */ x(le, {
833
+ /* @__PURE__ */ S(ue, {
767
834
  open: H.open,
768
835
  onClose: () => U({
769
836
  open: !1,
@@ -774,31 +841,31 @@ function Ce() {
774
841
  fullWidth: !0,
775
842
  maxWidth: "sm",
776
843
  children: [
777
- /* @__PURE__ */ b(fe, { children: "Close Vial (record remaining as wastage)" }),
778
- /* @__PURE__ */ b(de, {
844
+ /* @__PURE__ */ x(pe, { children: "Close Vial (record remaining as wastage)" }),
845
+ /* @__PURE__ */ x(fe, {
779
846
  dividers: !0,
780
- children: /* @__PURE__ */ x(A, {
847
+ children: /* @__PURE__ */ S(k, {
781
848
  spacing: 2,
782
849
  sx: { pt: 1 },
783
850
  children: [
784
- /* @__PURE__ */ x(F, {
851
+ /* @__PURE__ */ S(P, {
785
852
  variant: "body2",
786
853
  children: [
787
854
  H.vial?.productName,
788
855
  " ·",
789
856
  " ",
790
- _(H.vial?.volumeRemainingMl),
857
+ v(H.vial?.volumeRemainingMl),
791
858
  " ml will be marked as wasted."
792
859
  ]
793
860
  }),
794
- /* @__PURE__ */ x(E, {
861
+ /* @__PURE__ */ S(me, {
795
862
  required: !0,
796
863
  fullWidth: !0,
797
864
  size: "small",
798
865
  error: K.show("wastageReason") && !!Y.wastageReason,
799
866
  children: [
800
- /* @__PURE__ */ b(me, { children: "Reason" }),
801
- /* @__PURE__ */ b(k, {
867
+ /* @__PURE__ */ x(D, { children: "Reason" }),
868
+ /* @__PURE__ */ x(ve, {
802
869
  label: "Reason",
803
870
  value: H.reason,
804
871
  onChange: (e) => U({
@@ -806,15 +873,15 @@ function Ce() {
806
873
  reason: e.target.value
807
874
  }),
808
875
  onBlur: K.onBlur("wastageReason"),
809
- children: ae.map((e) => /* @__PURE__ */ b(O, {
876
+ children: oe.map((e) => /* @__PURE__ */ x(O, {
810
877
  value: e.value,
811
878
  children: e.label
812
879
  }, e.value))
813
880
  }),
814
- K.show("wastageReason") && Y.wastageReason ? /* @__PURE__ */ b(pe, { children: Y.wastageReason }) : null
881
+ K.show("wastageReason") && Y.wastageReason ? /* @__PURE__ */ x(he, { children: Y.wastageReason }) : null
815
882
  ]
816
883
  }),
817
- /* @__PURE__ */ b(ve, {
884
+ /* @__PURE__ */ x(xe, {
818
885
  label: "Comments",
819
886
  size: "small",
820
887
  multiline: !0,
@@ -829,7 +896,7 @@ function Ce() {
829
896
  ]
830
897
  })
831
898
  }),
832
- /* @__PURE__ */ x(ue, { children: [/* @__PURE__ */ b(w, {
899
+ /* @__PURE__ */ S(de, { children: [/* @__PURE__ */ x(T, {
833
900
  onClick: () => U({
834
901
  open: !1,
835
902
  vial: null,
@@ -837,11 +904,11 @@ function Ce() {
837
904
  comments: ""
838
905
  }),
839
906
  children: "Cancel"
840
- }), /* @__PURE__ */ b(w, {
907
+ }), /* @__PURE__ */ x(T, {
841
908
  variant: "contained",
842
909
  color: "error",
843
- disabled: !Pe,
844
- onClick: () => void Fe(),
910
+ disabled: !ze,
911
+ onClick: () => void Be(),
845
912
  children: "Close Vial"
846
913
  })] })
847
914
  ]
@@ -850,6 +917,6 @@ function Ce() {
850
917
  })] });
851
918
  }
852
919
  //#endregion
853
- export { Ce as default };
920
+ export { Te as default };
854
921
 
855
- //# sourceMappingURL=VialsPage-CcbY4v6H.js.map
922
+ //# sourceMappingURL=VialsPage-BNPUwGCU.js.map