astrogators-shared-ui 0.3.1 → 0.4.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.
package/dist/index.js CHANGED
@@ -1,159 +1,159 @@
1
- var me = Object.defineProperty;
2
- var he = (e, t, s) => t in e ? me(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
- var R = (e, t, s) => he(e, typeof t != "symbol" ? t + "" : t, s);
4
- import { jsx as r, jsxs as m } from "react/jsx-runtime";
5
- import re, { createContext as ge, useState as $, useEffect as U, useCallback as S, useContext as pe } from "react";
6
- const fe = "_container_u3o0e_1", ye = "_padding_u3o0e_7", X = {
7
- container: fe,
8
- padding: ye,
1
+ var ue = Object.defineProperty;
2
+ var he = (e, s, t) => s in e ? ue(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
3
+ var R = (e, s, t) => he(e, typeof s != "symbol" ? s + "" : s, t);
4
+ import { jsx as r, jsxs as m, Fragment as ge } from "react/jsx-runtime";
5
+ import ae, { createContext as fe, useState as b, useEffect as j, useCallback as S, useContext as pe } from "react";
6
+ const ye = "_container_u3o0e_1", ve = "_padding_u3o0e_7", X = {
7
+ container: ye,
8
+ padding: ve,
9
9
  "maxWidth-sm": "_maxWidth-sm_u3o0e_12",
10
10
  "maxWidth-md": "_maxWidth-md_u3o0e_16",
11
11
  "maxWidth-lg": "_maxWidth-lg_u3o0e_20",
12
12
  "maxWidth-xl": "_maxWidth-xl_u3o0e_24",
13
13
  "maxWidth-full": "_maxWidth-full_u3o0e_28"
14
- }, fs = ({
14
+ }, vs = ({
15
15
  children: e,
16
- maxWidth: t = "xl",
17
- padding: s = !0,
16
+ maxWidth: s = "xl",
17
+ padding: t = !0,
18
18
  className: o = ""
19
19
  }) => /* @__PURE__ */ r(
20
20
  "div",
21
21
  {
22
- className: `${X.container} ${X[`maxWidth-${t}`]} ${s ? X.padding : ""} ${o}`,
22
+ className: `${X.container} ${X[`maxWidth-${s}`]} ${t ? X.padding : ""} ${o}`,
23
23
  children: e
24
24
  }
25
- ), ve = "_topBar_10g3c_1", $e = "_content_10g3c_13", we = "_left_10g3c_23", be = "_right_10g3c_30", Ne = "_logo_10g3c_36", B = {
26
- topBar: ve,
27
- content: $e,
25
+ ), $e = "_topBar_10g3c_1", be = "_content_10g3c_13", we = "_left_10g3c_23", Ne = "_right_10g3c_30", Ae = "_logo_10g3c_36", P = {
26
+ topBar: $e,
27
+ content: be,
28
28
  left: we,
29
- right: be,
30
- logo: Ne
31
- }, ys = ({
29
+ right: Ne,
30
+ logo: Ae
31
+ }, $s = ({
32
32
  logo: e,
33
- leftContent: t,
34
- rightContent: s,
33
+ leftContent: s,
34
+ rightContent: t,
35
35
  className: o = ""
36
- }) => /* @__PURE__ */ r("header", { className: `${B.topBar} ${o}`, children: /* @__PURE__ */ m("div", { className: B.content, children: [
37
- /* @__PURE__ */ m("div", { className: B.left, children: [
38
- e && /* @__PURE__ */ r("div", { className: B.logo, children: e }),
39
- t
36
+ }) => /* @__PURE__ */ r("header", { className: `${P.topBar} ${o}`, children: /* @__PURE__ */ m("div", { className: P.content, children: [
37
+ /* @__PURE__ */ m("div", { className: P.left, children: [
38
+ e && /* @__PURE__ */ r("div", { className: P.logo, children: e }),
39
+ s
40
40
  ] }),
41
- /* @__PURE__ */ r("div", { className: B.right, children: s })
42
- ] }) }), Se = "_footer_zjuj8_1", Ae = "_content_zjuj8_7", xe = "_defaultContent_zjuj8_13", Te = "_copyright_zjuj8_21", Ce = "_disclaimer_zjuj8_26", P = {
41
+ /* @__PURE__ */ r("div", { className: P.right, children: t })
42
+ ] }) }), Se = "_footer_zjuj8_1", xe = "_content_zjuj8_7", Te = "_defaultContent_zjuj8_13", Ce = "_copyright_zjuj8_21", ke = "_disclaimer_zjuj8_26", B = {
43
43
  footer: Se,
44
- content: Ae,
45
- defaultContent: xe,
46
- copyright: Te,
47
- disclaimer: Ce
48
- }, vs = ({ children: e, className: t = "" }) => /* @__PURE__ */ r("footer", { className: `${P.footer} ${t}`, children: /* @__PURE__ */ r("div", { className: P.content, children: e || /* @__PURE__ */ m("div", { className: P.defaultContent, children: [
49
- /* @__PURE__ */ m("p", { className: P.copyright, children: [
44
+ content: xe,
45
+ defaultContent: Te,
46
+ copyright: Ce,
47
+ disclaimer: ke
48
+ }, bs = ({ children: e, className: s = "" }) => /* @__PURE__ */ r("footer", { className: `${B.footer} ${s}`, children: /* @__PURE__ */ r("div", { className: B.content, children: e || /* @__PURE__ */ m("div", { className: B.defaultContent, children: [
49
+ /* @__PURE__ */ m("p", { className: B.copyright, children: [
50
50
  "© ",
51
51
  (/* @__PURE__ */ new Date()).getFullYear(),
52
52
  " The Astrogator's Table. All rights reserved."
53
53
  ] }),
54
- /* @__PURE__ */ r("p", { className: P.disclaimer, children: "Star Wars: Galaxy of Heroes is a trademark of Electronic Arts Inc." })
55
- ] }) }) }), ke = "_button_159ms_1", Ee = "_sm_159ms_22", We = "_md_159ms_28", Ie = "_lg_159ms_34", Le = "_primary_159ms_41", qe = "_secondary_159ms_55", Re = "_outline_159ms_69", Be = "_ghost_159ms_80", Pe = "_danger_159ms_89", Ue = "_fullWidth_159ms_100", je = "_loading_159ms_105", De = "_loadingSpinner_159ms_110", Fe = "_spinner_159ms_116", ze = "_spin_159ms_116", Oe = "_loadingText_159ms_131", A = {
56
- button: ke,
57
- sm: Ee,
58
- md: We,
59
- lg: Ie,
60
- primary: Le,
61
- secondary: qe,
62
- outline: Re,
54
+ /* @__PURE__ */ r("p", { className: B.disclaimer, children: "Star Wars: Galaxy of Heroes is a trademark of Electronic Arts Inc." })
55
+ ] }) }) }), Ee = "_button_159ms_1", We = "_sm_159ms_22", Ie = "_md_159ms_28", Le = "_lg_159ms_34", qe = "_primary_159ms_41", Re = "_secondary_159ms_55", Pe = "_outline_159ms_69", Be = "_ghost_159ms_80", Ue = "_danger_159ms_89", je = "_fullWidth_159ms_100", Fe = "_loading_159ms_105", De = "_loadingSpinner_159ms_110", Oe = "_spinner_159ms_116", ze = "_spin_159ms_116", Me = "_loadingText_159ms_131", x = {
56
+ button: Ee,
57
+ sm: We,
58
+ md: Ie,
59
+ lg: Le,
60
+ primary: qe,
61
+ secondary: Re,
62
+ outline: Pe,
63
63
  ghost: Be,
64
- danger: Pe,
65
- fullWidth: Ue,
66
- loading: je,
64
+ danger: Ue,
65
+ fullWidth: je,
66
+ loading: Fe,
67
67
  loadingSpinner: De,
68
- spinner: Fe,
68
+ spinner: Oe,
69
69
  spin: ze,
70
- loadingText: Oe
71
- }, O = ({
70
+ loadingText: Me
71
+ }, M = ({
72
72
  children: e,
73
- variant: t = "primary",
74
- size: s = "md",
73
+ variant: s = "primary",
74
+ size: t = "md",
75
75
  fullWidth: o = !1,
76
76
  loading: _ = !1,
77
- disabled: h = !1,
77
+ disabled: g = !1,
78
78
  className: c = "",
79
79
  ...l
80
80
  }) => /* @__PURE__ */ r(
81
81
  "button",
82
82
  {
83
- className: `${A.button} ${A[t]} ${A[s]} ${o ? A.fullWidth : ""} ${_ ? A.loading : ""} ${c}`,
84
- disabled: h || _,
83
+ className: `${x.button} ${x[s]} ${x[t]} ${o ? x.fullWidth : ""} ${_ ? x.loading : ""} ${c}`,
84
+ disabled: g || _,
85
85
  ...l,
86
- children: _ ? /* @__PURE__ */ m("span", { className: A.loadingSpinner, children: [
87
- /* @__PURE__ */ r("span", { className: A.spinner }),
88
- /* @__PURE__ */ r("span", { className: A.loadingText, children: e })
86
+ children: _ ? /* @__PURE__ */ m("span", { className: x.loadingSpinner, children: [
87
+ /* @__PURE__ */ r("span", { className: x.spinner }),
88
+ /* @__PURE__ */ r("span", { className: x.loadingText, children: e })
89
89
  ] }) : e
90
90
  }
91
- ), Me = "_inputWrapper_15t4g_1", Je = "_fullWidth_15t4g_7", He = "_label_15t4g_11", Ye = "_required_15t4g_20", Ge = "_input_15t4g_1", Ke = "_error_15t4g_55", Ve = "_errorText_15t4g_63", Qe = "_helperText_15t4g_68", x = {
92
- inputWrapper: Me,
93
- fullWidth: Je,
94
- label: He,
95
- required: Ye,
96
- input: Ge,
97
- error: Ke,
98
- errorText: Ve,
99
- helperText: Qe
100
- }, ae = re.forwardRef(
91
+ ), Je = "_inputWrapper_15t4g_1", He = "_fullWidth_15t4g_7", Ye = "_label_15t4g_11", Ge = "_required_15t4g_20", Ke = "_input_15t4g_1", Ve = "_error_15t4g_55", Qe = "_errorText_15t4g_63", Xe = "_helperText_15t4g_68", T = {
92
+ inputWrapper: Je,
93
+ fullWidth: He,
94
+ label: Ye,
95
+ required: Ge,
96
+ input: Ke,
97
+ error: Ve,
98
+ errorText: Qe,
99
+ helperText: Xe
100
+ }, ne = ae.forwardRef(
101
101
  ({
102
102
  label: e,
103
- error: t,
104
- helperText: s,
103
+ error: s,
104
+ helperText: t,
105
105
  fullWidth: o = !1,
106
106
  className: _ = "",
107
- id: h,
107
+ id: g,
108
108
  ...c
109
109
  }, l) => {
110
- const i = h || `input-${Math.random().toString(36).substr(2, 9)}`, g = !!t;
111
- return /* @__PURE__ */ m("div", { className: `${x.inputWrapper} ${o ? x.fullWidth : ""} ${_}`, children: [
112
- e && /* @__PURE__ */ m("label", { htmlFor: i, className: x.label, children: [
110
+ const i = g || `input-${Math.random().toString(36).substr(2, 9)}`, h = !!s;
111
+ return /* @__PURE__ */ m("div", { className: `${T.inputWrapper} ${o ? T.fullWidth : ""} ${_}`, children: [
112
+ e && /* @__PURE__ */ m("label", { htmlFor: i, className: T.label, children: [
113
113
  e,
114
- c.required && /* @__PURE__ */ r("span", { className: x.required, children: "*" })
114
+ c.required && /* @__PURE__ */ r("span", { className: T.required, children: "*" })
115
115
  ] }),
116
116
  /* @__PURE__ */ r(
117
117
  "input",
118
118
  {
119
119
  ref: l,
120
120
  id: i,
121
- className: `${x.input} ${g ? x.error : ""}`,
121
+ className: `${T.input} ${h ? T.error : ""}`,
122
122
  ...c
123
123
  }
124
124
  ),
125
- t && /* @__PURE__ */ r("span", { className: x.errorText, children: t }),
126
- s && !t && /* @__PURE__ */ r("span", { className: x.helperText, children: s })
125
+ s && /* @__PURE__ */ r("span", { className: T.errorText, children: s }),
126
+ t && !s && /* @__PURE__ */ r("span", { className: T.helperText, children: t })
127
127
  ] });
128
128
  }
129
129
  );
130
- ae.displayName = "Input";
131
- const Xe = "_selectWrapper_ir4bq_1", Ze = "_fullWidth_ir4bq_7", et = "_label_ir4bq_11", tt = "_required_ir4bq_20", st = "_selectContainer_ir4bq_24", ot = "_select_ir4bq_1", nt = "_error_ir4bq_63", rt = "_arrow_ir4bq_71", at = "_errorText_ir4bq_81", lt = "_helperText_ir4bq_86", w = {
132
- selectWrapper: Xe,
133
- fullWidth: Ze,
134
- label: et,
135
- required: tt,
136
- selectContainer: st,
137
- select: ot,
138
- error: nt,
139
- arrow: rt,
140
- errorText: at,
141
- helperText: lt
142
- }, le = re.forwardRef(
130
+ ne.displayName = "Input";
131
+ const Ze = "_selectWrapper_ir4bq_1", et = "_fullWidth_ir4bq_7", tt = "_label_ir4bq_11", st = "_required_ir4bq_20", ot = "_selectContainer_ir4bq_24", rt = "_select_ir4bq_1", at = "_error_ir4bq_63", nt = "_arrow_ir4bq_71", lt = "_errorText_ir4bq_81", ct = "_helperText_ir4bq_86", w = {
132
+ selectWrapper: Ze,
133
+ fullWidth: et,
134
+ label: tt,
135
+ required: st,
136
+ selectContainer: ot,
137
+ select: rt,
138
+ error: at,
139
+ arrow: nt,
140
+ errorText: lt,
141
+ helperText: ct
142
+ }, le = ae.forwardRef(
143
143
  ({
144
144
  label: e,
145
- error: t,
146
- helperText: s,
145
+ error: s,
146
+ helperText: t,
147
147
  options: o,
148
148
  placeholder: _,
149
- fullWidth: h = !1,
149
+ fullWidth: g = !1,
150
150
  className: c = "",
151
151
  id: l,
152
152
  ...i
153
- }, g) => {
154
- const f = l || `select-${Math.random().toString(36).substr(2, 9)}`, C = !!t;
155
- return /* @__PURE__ */ m("div", { className: `${w.selectWrapper} ${h ? w.fullWidth : ""} ${c}`, children: [
156
- e && /* @__PURE__ */ m("label", { htmlFor: f, className: w.label, children: [
153
+ }, h) => {
154
+ const p = l || `select-${Math.random().toString(36).substr(2, 9)}`, N = !!s;
155
+ return /* @__PURE__ */ m("div", { className: `${w.selectWrapper} ${g ? w.fullWidth : ""} ${c}`, children: [
156
+ e && /* @__PURE__ */ m("label", { htmlFor: p, className: w.label, children: [
157
157
  e,
158
158
  i.required && /* @__PURE__ */ r("span", { className: w.required, children: "*" })
159
159
  ] }),
@@ -161,20 +161,20 @@ const Xe = "_selectWrapper_ir4bq_1", Ze = "_fullWidth_ir4bq_7", et = "_label_ir4
161
161
  /* @__PURE__ */ m(
162
162
  "select",
163
163
  {
164
- ref: g,
165
- id: f,
166
- className: `${w.select} ${C ? w.error : ""}`,
164
+ ref: h,
165
+ id: p,
166
+ className: `${w.select} ${N ? w.error : ""}`,
167
167
  ...i,
168
168
  children: [
169
169
  _ && /* @__PURE__ */ r("option", { value: "", disabled: !0, children: _ }),
170
- o && o.map((b) => /* @__PURE__ */ r(
170
+ o && o.map((f) => /* @__PURE__ */ r(
171
171
  "option",
172
172
  {
173
- value: b.value,
174
- disabled: b.disabled,
175
- children: b.label
173
+ value: f.value,
174
+ disabled: f.disabled,
175
+ children: f.label
176
176
  },
177
- b.value
177
+ f.value
178
178
  )),
179
179
  !o && i.children
180
180
  ]
@@ -182,59 +182,59 @@ const Xe = "_selectWrapper_ir4bq_1", Ze = "_fullWidth_ir4bq_7", et = "_label_ir4
182
182
  ),
183
183
  /* @__PURE__ */ r("span", { className: w.arrow, children: "▼" })
184
184
  ] }),
185
- t && /* @__PURE__ */ r("span", { className: w.errorText, children: t }),
186
- s && !t && /* @__PURE__ */ r("span", { className: w.helperText, children: s })
185
+ s && /* @__PURE__ */ r("span", { className: w.errorText, children: s }),
186
+ t && !s && /* @__PURE__ */ r("span", { className: w.helperText, children: t })
187
187
  ] });
188
188
  }
189
189
  );
190
190
  le.displayName = "Select";
191
- const te = "astrogators_access_token", se = "astrogators_refresh_token", ce = () => localStorage.getItem(te), ct = (e) => {
191
+ const te = "astrogators_access_token", se = "astrogators_refresh_token", ce = () => localStorage.getItem(te), it = (e) => {
192
192
  localStorage.setItem(te, e);
193
- }, it = () => {
193
+ }, dt = () => {
194
194
  localStorage.removeItem(te);
195
- }, dt = () => localStorage.getItem(se), _t = (e) => {
195
+ }, _t = () => localStorage.getItem(se), mt = (e) => {
196
196
  localStorage.setItem(se, e);
197
197
  }, ut = () => {
198
198
  localStorage.removeItem(se);
199
- }, ie = (e, t) => {
200
- ct(e), _t(t);
199
+ }, ie = (e, s) => {
200
+ it(e), mt(s);
201
201
  }, ee = () => {
202
- it(), ut();
203
- }, mt = () => !!ce();
204
- class ht {
205
- constructor(t) {
202
+ dt(), ut();
203
+ }, ht = () => !!ce();
204
+ class gt {
205
+ constructor(s) {
206
206
  R(this, "baseURL");
207
207
  R(this, "onUnauthorized");
208
208
  R(this, "isRefreshing", !1);
209
209
  R(this, "refreshPromise", null);
210
- this.baseURL = t.baseURL, this.onUnauthorized = t.onUnauthorized;
210
+ this.baseURL = s.baseURL, this.onUnauthorized = s.onUnauthorized;
211
211
  }
212
212
  async refreshAccessToken() {
213
213
  var _;
214
- const t = dt();
215
- if (!t)
214
+ const s = _t();
215
+ if (!s)
216
216
  throw new Error("No refresh token available");
217
- const s = await fetch(`${this.baseURL}/api/v1/auth/refresh-token`, {
217
+ const t = await fetch(`${this.baseURL}/api/v1/auth/refresh-token`, {
218
218
  method: "POST",
219
219
  headers: {
220
220
  "Content-Type": "application/json"
221
221
  },
222
- body: JSON.stringify({ refresh_token: t })
222
+ body: JSON.stringify({ refresh_token: s })
223
223
  });
224
- if (!s.ok)
224
+ if (!t.ok)
225
225
  throw ee(), (_ = this.onUnauthorized) == null || _.call(this), new Error("Token refresh failed");
226
- const o = await s.json();
227
- return ie(o.access_token, t), o.access_token;
226
+ const o = await t.json();
227
+ return ie(o.access_token, s), o.access_token;
228
228
  }
229
- async request(t, s = {}) {
229
+ async request(s, t = {}) {
230
230
  const o = ce(), _ = {
231
231
  "Content-Type": "application/json",
232
- ...s.headers
232
+ ...t.headers
233
233
  };
234
234
  o && (_.Authorization = `Bearer ${o}`);
235
- const h = `${this.baseURL}${t}`;
236
- let c = await fetch(h, {
237
- ...s,
235
+ const g = `${this.baseURL}${s}`;
236
+ let c = await fetch(g, {
237
+ ...t,
238
238
  headers: _
239
239
  });
240
240
  if (c.status === 401 && o) {
@@ -243,8 +243,8 @@ class ht {
243
243
  }));
244
244
  try {
245
245
  const l = await this.refreshPromise;
246
- _.Authorization = `Bearer ${l}`, c = await fetch(h, {
247
- ...s,
246
+ _.Authorization = `Bearer ${l}`, c = await fetch(g, {
247
+ ...t,
248
248
  headers: _
249
249
  });
250
250
  } catch {
@@ -259,8 +259,8 @@ class ht {
259
259
  try {
260
260
  const i = await c.json();
261
261
  if (c.status === 422 && Array.isArray(i.detail)) {
262
- const g = i.detail.map((f) => f.msg || "Validation error").join(", ");
263
- l.message = g;
262
+ const h = i.detail.map((p) => p.msg || "Validation error").join(", ");
263
+ l.message = h;
264
264
  } else typeof i.detail == "string" ? l.message = i.detail : i.message && (l.message = i.message);
265
265
  l.detail = i.detail;
266
266
  } catch {
@@ -269,221 +269,221 @@ class ht {
269
269
  }
270
270
  return c.status === 204 ? {} : c.json();
271
271
  }
272
- async get(t, s) {
273
- return this.request(t, { ...s, method: "GET" });
272
+ async get(s, t) {
273
+ return this.request(s, { ...t, method: "GET" });
274
274
  }
275
- async post(t, s, o) {
276
- return this.request(t, {
275
+ async post(s, t, o) {
276
+ return this.request(s, {
277
277
  ...o,
278
278
  method: "POST",
279
- body: s ? JSON.stringify(s) : void 0
279
+ body: t ? JSON.stringify(t) : void 0
280
280
  });
281
281
  }
282
- async put(t, s, o) {
283
- return this.request(t, {
282
+ async put(s, t, o) {
283
+ return this.request(s, {
284
284
  ...o,
285
285
  method: "PUT",
286
- body: s ? JSON.stringify(s) : void 0
286
+ body: t ? JSON.stringify(t) : void 0
287
287
  });
288
288
  }
289
- async patch(t, s, o) {
290
- return this.request(t, {
289
+ async patch(s, t, o) {
290
+ return this.request(s, {
291
291
  ...o,
292
292
  method: "PATCH",
293
- body: s ? JSON.stringify(s) : void 0
293
+ body: t ? JSON.stringify(t) : void 0
294
294
  });
295
295
  }
296
- async delete(t, s) {
297
- return this.request(t, { ...s, method: "DELETE" });
296
+ async delete(s, t) {
297
+ return this.request(s, { ...t, method: "DELETE" });
298
298
  }
299
299
  }
300
- let p;
301
- const gt = (e) => {
302
- p = new ht(e);
303
- }, j = "astrogators_ally_codes", H = "astrogators_selected_ally_code", N = () => {
300
+ let y;
301
+ const ft = (e) => {
302
+ y = new gt(e);
303
+ }, F = "astrogators_ally_codes", H = "astrogators_selected_ally_code", A = () => {
304
304
  try {
305
- const e = localStorage.getItem(j);
305
+ const e = localStorage.getItem(F);
306
306
  return e ? JSON.parse(e) : [];
307
307
  } catch (e) {
308
308
  return console.error("Failed to read ally codes from localStorage:", e), [];
309
309
  }
310
310
  }, pt = (e) => {
311
311
  try {
312
- const t = N();
313
- if (t.some((o) => o.ally_code === e.ally_code))
312
+ const s = A();
313
+ if (s.some((o) => o.ally_code === e.ally_code))
314
314
  return;
315
- t.push(e), localStorage.setItem(j, JSON.stringify(t));
316
- } catch (t) {
317
- console.error("Failed to save ally code to localStorage:", t);
315
+ s.push(e), localStorage.setItem(F, JSON.stringify(s));
316
+ } catch (s) {
317
+ console.error("Failed to save ally code to localStorage:", s);
318
318
  }
319
- }, ft = (e) => {
319
+ }, yt = (e) => {
320
320
  try {
321
- const s = N().filter((o) => o.ally_code !== e);
322
- localStorage.setItem(j, JSON.stringify(s));
323
- } catch (t) {
324
- console.error("Failed to remove ally code from localStorage:", t);
321
+ const t = A().filter((o) => o.ally_code !== e);
322
+ localStorage.setItem(F, JSON.stringify(t));
323
+ } catch (s) {
324
+ console.error("Failed to remove ally code from localStorage:", s);
325
325
  }
326
- }, ne = (e) => {
326
+ }, re = (e) => {
327
327
  try {
328
- const s = N().map(
328
+ const t = A().map(
329
329
  (o) => o.ally_code === e ? { ...o, last_used_at: (/* @__PURE__ */ new Date()).toISOString() } : o
330
330
  );
331
- localStorage.setItem(j, JSON.stringify(s));
332
- } catch (t) {
333
- console.error("Failed to update ally code last used:", t);
331
+ localStorage.setItem(F, JSON.stringify(t));
332
+ } catch (s) {
333
+ console.error("Failed to update ally code last used:", s);
334
334
  }
335
- }, yt = () => localStorage.getItem(H), vt = (e) => {
335
+ }, vt = () => localStorage.getItem(H), $t = (e) => {
336
336
  e ? localStorage.setItem(H, e) : localStorage.removeItem(H);
337
- }, $t = () => {
338
- localStorage.removeItem(j), localStorage.removeItem(H);
339
- }, de = ge(void 0), $s = ({ children: e, apiBaseUrl: t }) => {
340
- const [s, o] = $(null), [_, h] = $(!0), [c, l] = $([]), [i, g] = $(null), [f, C] = $(!1), [b, k] = $({
337
+ }, bt = () => {
338
+ localStorage.removeItem(F), localStorage.removeItem(H);
339
+ }, de = fe(void 0), ws = ({ children: e, apiBaseUrl: s }) => {
340
+ const [t, o] = b(null), [_, g] = b(!0), [c, l] = b([]), [i, h] = b(null), [p, N] = b(!1), [f, k] = b({
341
341
  show: !1,
342
342
  localStorageCodes: []
343
343
  });
344
- U(() => {
345
- gt({
346
- baseURL: t
344
+ j(() => {
345
+ ft({
346
+ baseURL: s
347
347
  });
348
- }, [t]);
348
+ }, [s]);
349
349
  const W = S(async () => {
350
- if (!mt()) {
351
- o(null), h(!1);
350
+ if (!ht()) {
351
+ o(null), g(!1);
352
352
  return;
353
353
  }
354
354
  try {
355
- const n = await p.get("/api/v1/users/me");
356
- o(n);
357
- } catch (n) {
358
- console.error("Failed to fetch user:", n), o(null), ee();
355
+ const a = await y.get("/api/v1/users/me");
356
+ o(a);
357
+ } catch (a) {
358
+ console.error("Failed to fetch user:", a), o(null), ee();
359
359
  } finally {
360
- h(!1);
360
+ g(!1);
361
361
  }
362
362
  }, []);
363
- U(() => {
363
+ j(() => {
364
364
  W();
365
365
  }, [W]);
366
- const I = async (n) => {
366
+ const I = async (a) => {
367
367
  try {
368
- const a = await p.post("/api/v1/auth/login", n);
369
- ie(a.access_token, a.refresh_token);
370
- const u = await p.get("/api/v1/users/me");
368
+ const n = await y.post("/api/v1/auth/login", a);
369
+ ie(n.access_token, n.refresh_token);
370
+ const u = await y.get("/api/v1/users/me");
371
371
  o(u);
372
- } catch (a) {
373
- throw console.error("Login failed:", a), a;
372
+ } catch (n) {
373
+ throw console.error("Login failed:", n), n;
374
374
  }
375
- }, D = async (n) => {
375
+ }, D = async (a) => {
376
376
  try {
377
- await p.post("/api/v1/auth/register", n);
378
- } catch (a) {
379
- throw console.error("Registration failed:", a), a;
377
+ await y.post("/api/v1/auth/register", a);
378
+ } catch (n) {
379
+ throw console.error("Registration failed:", n), n;
380
380
  }
381
- }, F = () => {
382
- ee(), o(null), l([]), g(null), k({ show: !1, localStorageCodes: [] });
381
+ }, O = () => {
382
+ ee(), o(null), l([]), h(null), k({ show: !1, localStorageCodes: [] });
383
383
  }, Y = async () => {
384
384
  await W();
385
- }, G = async (n) => {
385
+ }, G = async (a) => {
386
386
  try {
387
- return (await p.post(
387
+ return (await y.post(
388
388
  "/api/v1/auth/forgot-password",
389
- n
389
+ a
390
390
  )).message;
391
- } catch (a) {
392
- throw console.error("Forgot password failed:", a), a;
391
+ } catch (n) {
392
+ throw console.error("Forgot password failed:", n), n;
393
393
  }
394
- }, K = async (n) => {
394
+ }, K = async (a) => {
395
395
  try {
396
- return (await p.post(
396
+ return (await y.post(
397
397
  "/api/v1/auth/reset-password",
398
- n
398
+ a
399
399
  )).message;
400
- } catch (a) {
401
- throw console.error("Reset password failed:", a), a;
400
+ } catch (n) {
401
+ throw console.error("Reset password failed:", n), n;
402
402
  }
403
- }, V = async (n) => {
403
+ }, V = async (a) => {
404
404
  try {
405
- return (await p.post(
405
+ return (await y.post(
406
406
  "/api/v1/auth/resend-verification",
407
- n
407
+ a
408
408
  )).message;
409
- } catch (a) {
410
- throw console.error("Resend verification failed:", a), a;
409
+ } catch (n) {
410
+ throw console.error("Resend verification failed:", n), n;
411
411
  }
412
412
  }, d = S(async () => {
413
- C(!0);
413
+ N(!0);
414
414
  try {
415
- if (s) {
416
- const a = await p.get("/api/v1/users/me/ally-codes");
417
- l(a.ally_codes);
418
- const u = N();
415
+ if (t) {
416
+ const n = await y.get("/api/v1/users/me/ally-codes");
417
+ l(n.ally_codes);
418
+ const u = A();
419
419
  u.length > 0 && k({
420
420
  show: !0,
421
421
  localStorageCodes: u.map((q) => q.ally_code)
422
422
  });
423
423
  } else {
424
- const a = N();
425
- l(a);
424
+ const n = A();
425
+ l(n);
426
426
  }
427
- const n = yt();
428
- g(n);
429
- } catch (n) {
430
- console.error("Failed to fetch ally codes:", n), l([]);
427
+ const a = vt();
428
+ h(a);
429
+ } catch (a) {
430
+ console.error("Failed to fetch ally codes:", a), l([]);
431
431
  } finally {
432
- C(!1);
432
+ N(!1);
433
433
  }
434
- }, [s]), y = S(async (n) => {
435
- var a;
436
- if (!/^\d{9}$/.test(n))
434
+ }, [t]), v = S(async (a) => {
435
+ var n;
436
+ if (!/^\d{9}$/.test(a))
437
437
  throw new Error("Ally code must be exactly 9 digits");
438
- if (s) {
439
- const u = await p.post(
438
+ if (t) {
439
+ const u = await y.post(
440
440
  "/api/v1/users/me/ally-codes",
441
- { ally_code: n }
441
+ { ally_code: a }
442
442
  );
443
- l((q) => [u, ...q]), c.length === 0 && z(n);
443
+ l((q) => [u, ...q]), c.length === 0 && z(a);
444
444
  } else {
445
- const u = await p.get(`/api/v1/player-data/player/${n}`);
445
+ const u = await y.get(`/api/v1/player-data/player/${a}`);
446
446
  if (!u)
447
447
  throw new Error("Invalid ally code - player not found");
448
448
  const q = {
449
- ally_code: n,
450
- player_name: ((a = u == null ? void 0 : u.data) == null ? void 0 : a.name) || null,
449
+ ally_code: a,
450
+ player_name: ((n = u == null ? void 0 : u.data) == null ? void 0 : n.name) || null,
451
451
  last_used_at: (/* @__PURE__ */ new Date()).toISOString()
452
452
  };
453
- pt(q), l(N()), c.length === 0 && z(n);
453
+ pt(q), l(A()), c.length === 0 && z(a);
454
454
  }
455
- }, [s, c.length]), L = S(async (n) => {
456
- s && typeof n == "number" ? (await p.delete(`/api/v1/users/me/ally-codes/${n}`), l((a) => a.filter((u) => "id" in u && u.id !== n))) : !s && typeof n == "string" && (ft(n), l(N()), i === n && z(null));
457
- }, [s, i]), z = S((n) => {
458
- if (g(n), vt(n), n && s) {
459
- const a = c.find((u) => "ally_code" in u && u.ally_code === n);
460
- a && "id" in a && oe(a.id);
461
- } else n && !s && ne(n);
462
- }, [s, c]), oe = S(async (n) => {
463
- s && typeof n == "number" ? (await p.put(`/api/v1/users/me/ally-codes/${n}/use`, {}), await d()) : !s && typeof n == "string" && (ne(n), l(N()));
464
- }, [s, d]), Q = S(() => {
455
+ }, [t, c.length]), L = S(async (a) => {
456
+ t && typeof a == "number" ? (await y.delete(`/api/v1/users/me/ally-codes/${a}`), l((n) => n.filter((u) => "id" in u && u.id !== a))) : !t && typeof a == "string" && (yt(a), l(A()), i === a && z(null));
457
+ }, [t, i]), z = S((a) => {
458
+ if (h(a), $t(a), a && t) {
459
+ const n = c.find((u) => "ally_code" in u && u.ally_code === a);
460
+ n && "id" in n && oe(n.id);
461
+ } else a && !t && re(a);
462
+ }, [t, c]), oe = S(async (a) => {
463
+ t && typeof a == "number" ? (await y.put(`/api/v1/users/me/ally-codes/${a}/use`, {}), await d()) : !t && typeof a == "string" && (re(a), l(A()));
464
+ }, [t, d]), Q = S(() => {
465
465
  k({ show: !1, localStorageCodes: [] });
466
466
  }, []), _e = S(async () => {
467
- if (!s) return;
468
- const n = N();
469
- for (const a of n)
467
+ if (!t) return;
468
+ const a = A();
469
+ for (const n of a)
470
470
  try {
471
- await y(a.ally_code);
471
+ await v(n.ally_code);
472
472
  } catch (u) {
473
- console.error(`Failed to migrate ally code ${a.ally_code}:`, u);
473
+ console.error(`Failed to migrate ally code ${n.ally_code}:`, u);
474
474
  }
475
- $t(), Q();
476
- }, [s, y, Q]);
477
- U(() => {
475
+ bt(), Q();
476
+ }, [t, v, Q]);
477
+ j(() => {
478
478
  d();
479
479
  }, [d]);
480
- const ue = {
481
- user: s,
482
- isAuthenticated: !!s,
480
+ const me = {
481
+ user: t,
482
+ isAuthenticated: !!t,
483
483
  isLoading: _,
484
484
  login: I,
485
485
  register: D,
486
- logout: F,
486
+ logout: O,
487
487
  refreshUser: Y,
488
488
  forgotPassword: G,
489
489
  resetPassword: K,
@@ -491,72 +491,72 @@ const gt = (e) => {
491
491
  // Ally code values
492
492
  allyCodes: c,
493
493
  selectedAllyCode: i,
494
- isLoadingAllyCodes: f,
494
+ isLoadingAllyCodes: p,
495
495
  fetchAllyCodes: d,
496
- addAllyCode: y,
496
+ addAllyCode: v,
497
497
  removeAllyCode: L,
498
498
  selectAllyCode: z,
499
499
  updateAllyCodeLastUsed: oe,
500
- migrationPrompt: b,
500
+ migrationPrompt: f,
501
501
  dismissMigrationPrompt: Q,
502
502
  migrateLocalStorageCodes: _e
503
503
  };
504
- return /* @__PURE__ */ r(de.Provider, { value: ue, children: e });
504
+ return /* @__PURE__ */ r(de.Provider, { value: me, children: e });
505
505
  }, wt = () => {
506
506
  const e = pe(de);
507
507
  if (e === void 0)
508
508
  throw new Error("useAuth must be used within an AuthProvider");
509
509
  return e;
510
- }, M = (e) => !e || e.length !== 9 ? e : `${e.slice(0, 3)}-${e.slice(3, 6)}-${e.slice(6, 9)}`, ws = (e) => e.replace(/-/g, ""), bt = "_allyCodeDropdown_1m0tw_1", Nt = "_select_1m0tw_8", St = "_manageButton_1m0tw_12", At = "_managePanel_1m0tw_16", xt = "_addSection_1m0tw_37", Tt = "_addInputGroup_1m0tw_43", Ct = "_error_1m0tw_55", kt = "_success_1m0tw_61", Et = "_codesList_1m0tw_67", Wt = "_codeItem_1m0tw_71", It = "_doneButton_1m0tw_88", v = {
511
- allyCodeDropdown: bt,
512
- select: Nt,
510
+ }, J = (e) => !e || e.length !== 9 ? e : `${e.slice(0, 3)}-${e.slice(3, 6)}-${e.slice(6, 9)}`, Ns = (e) => e.replace(/-/g, ""), Nt = "_allyCodeDropdown_1m0tw_1", At = "_select_1m0tw_8", St = "_manageButton_1m0tw_12", xt = "_managePanel_1m0tw_16", Tt = "_addSection_1m0tw_37", Ct = "_addInputGroup_1m0tw_43", kt = "_error_1m0tw_55", Et = "_success_1m0tw_61", Wt = "_codesList_1m0tw_67", It = "_codeItem_1m0tw_71", Lt = "_doneButton_1m0tw_88", $ = {
511
+ allyCodeDropdown: Nt,
512
+ select: At,
513
513
  manageButton: St,
514
- managePanel: At,
515
- addSection: xt,
516
- addInputGroup: Tt,
517
- error: Ct,
518
- success: kt,
519
- codesList: Et,
520
- codeItem: Wt,
521
- doneButton: It
522
- }, bs = ({
514
+ managePanel: xt,
515
+ addSection: Tt,
516
+ addInputGroup: Ct,
517
+ error: kt,
518
+ success: Et,
519
+ codesList: Wt,
520
+ codeItem: It,
521
+ doneButton: Lt
522
+ }, As = ({
523
523
  onAllyCodeSelected: e,
524
- className: t = ""
524
+ className: s = ""
525
525
  }) => {
526
526
  const {
527
- allyCodes: s,
527
+ allyCodes: t,
528
528
  selectedAllyCode: o,
529
529
  selectAllyCode: _,
530
- removeAllyCode: h,
530
+ removeAllyCode: g,
531
531
  addAllyCode: c,
532
532
  isLoadingAllyCodes: l
533
- } = wt(), [i, g] = $(!1), [f, C] = $(""), [b, k] = $(""), [W, I] = $(""), [D, F] = $(!1), Y = s.map((d) => ({
533
+ } = wt(), [i, h] = b(!1), [p, N] = b(""), [f, k] = b(""), [W, I] = b(""), [D, O] = b(!1), Y = t.map((d) => ({
534
534
  value: d.ally_code,
535
- label: d.player_name ? `${d.player_name} (${M(d.ally_code)})` : M(d.ally_code)
535
+ label: d.player_name ? `${d.player_name} (${J(d.ally_code)})` : J(d.ally_code)
536
536
  })), G = (d) => {
537
- const y = d.target.value || null;
538
- _(y), e == null || e(y);
537
+ const v = d.target.value || null;
538
+ _(v), e == null || e(v);
539
539
  }, K = async (d) => {
540
- const y = s.find((L) => L.ally_code === d);
541
- if (y) {
542
- const L = "id" in y ? y.id : y.ally_code;
543
- await h(L);
540
+ const v = t.find((L) => L.ally_code === d);
541
+ if (v) {
542
+ const L = "id" in v ? v.id : v.ally_code;
543
+ await g(L);
544
544
  }
545
545
  }, V = async () => {
546
- if (k(""), I(""), !/^\d{9}$/.test(f)) {
546
+ if (k(""), I(""), !/^\d{9}$/.test(p)) {
547
547
  k("Ally code must be exactly 9 digits");
548
548
  return;
549
549
  }
550
- F(!0);
550
+ O(!0);
551
551
  try {
552
- await c(f), I("Added successfully!"), C(""), setTimeout(() => I(""), 2e3);
552
+ await c(p), I("Added successfully!"), N(""), setTimeout(() => I(""), 2e3);
553
553
  } catch (d) {
554
554
  k(d.message || "Failed to add ally code");
555
555
  } finally {
556
- F(!1);
556
+ O(!1);
557
557
  }
558
558
  };
559
- return s.length === 0 ? null : /* @__PURE__ */ m("div", { className: `${v.allyCodeDropdown} ${t}`, children: [
559
+ return t.length === 0 ? null : /* @__PURE__ */ m("div", { className: `${$.allyCodeDropdown} ${s}`, children: [
560
560
  /* @__PURE__ */ r(
561
561
  le,
562
562
  {
@@ -565,42 +565,42 @@ const gt = (e) => {
565
565
  onChange: G,
566
566
  placeholder: "Select ally code",
567
567
  disabled: l,
568
- className: v.select
568
+ className: $.select
569
569
  }
570
570
  ),
571
- i && /* @__PURE__ */ m("div", { className: v.managePanel, children: [
571
+ i && /* @__PURE__ */ m("div", { className: $.managePanel, children: [
572
572
  /* @__PURE__ */ r("h4", { children: "Manage Ally Codes" }),
573
- /* @__PURE__ */ m("div", { className: v.addSection, children: [
574
- /* @__PURE__ */ m("div", { className: v.addInputGroup, children: [
573
+ /* @__PURE__ */ m("div", { className: $.addSection, children: [
574
+ /* @__PURE__ */ m("div", { className: $.addInputGroup, children: [
575
575
  /* @__PURE__ */ r(
576
- ae,
576
+ ne,
577
577
  {
578
578
  type: "text",
579
579
  placeholder: "9-digit ally code",
580
- value: f,
581
- onChange: (d) => C(d.target.value.replace(/\D/g, "").slice(0, 9)),
580
+ value: p,
581
+ onChange: (d) => N(d.target.value.replace(/\D/g, "").slice(0, 9)),
582
582
  disabled: D
583
583
  }
584
584
  ),
585
585
  /* @__PURE__ */ r(
586
- O,
586
+ M,
587
587
  {
588
588
  variant: "primary",
589
589
  size: "sm",
590
590
  onClick: V,
591
591
  loading: D,
592
- disabled: f.length !== 9,
592
+ disabled: p.length !== 9,
593
593
  children: "Add"
594
594
  }
595
595
  )
596
596
  ] }),
597
- b && /* @__PURE__ */ r("div", { className: v.error, children: b }),
598
- W && /* @__PURE__ */ r("div", { className: v.success, children: W })
597
+ f && /* @__PURE__ */ r("div", { className: $.error, children: f }),
598
+ W && /* @__PURE__ */ r("div", { className: $.success, children: W })
599
599
  ] }),
600
- /* @__PURE__ */ r("div", { className: v.codesList, children: s.map((d) => /* @__PURE__ */ m("div", { className: v.codeItem, children: [
601
- /* @__PURE__ */ r("span", { children: d.player_name ? `${d.player_name} (${M(d.ally_code)})` : M(d.ally_code) }),
600
+ /* @__PURE__ */ r("div", { className: $.codesList, children: t.map((d) => /* @__PURE__ */ m("div", { className: $.codeItem, children: [
601
+ /* @__PURE__ */ r("span", { children: d.player_name ? `${d.player_name} (${J(d.ally_code)})` : J(d.ally_code) }),
602
602
  /* @__PURE__ */ r(
603
- O,
603
+ M,
604
604
  {
605
605
  variant: "ghost",
606
606
  size: "sm",
@@ -610,167 +610,180 @@ const gt = (e) => {
610
610
  )
611
611
  ] }, d.ally_code)) }),
612
612
  /* @__PURE__ */ r(
613
- O,
613
+ M,
614
614
  {
615
615
  variant: "secondary",
616
616
  size: "sm",
617
- onClick: () => g(!1),
618
- className: v.doneButton,
617
+ onClick: () => h(!1),
618
+ className: $.doneButton,
619
619
  children: "Done"
620
620
  }
621
621
  )
622
622
  ] }),
623
623
  /* @__PURE__ */ r(
624
- O,
624
+ M,
625
625
  {
626
626
  variant: "ghost",
627
627
  size: "sm",
628
- onClick: () => g(!i),
629
- className: v.manageButton,
628
+ onClick: () => h(!i),
629
+ className: $.manageButton,
630
630
  children: "Manage"
631
631
  }
632
632
  )
633
633
  ] });
634
- }, Lt = "_card_1n0ll_1", qt = "_elevated_1n0ll_12", Rt = "_outline_1n0ll_17", Bt = "_hoverable_1n0ll_40", J = {
635
- card: Lt,
636
- default: "_default_1n0ll_8",
637
- elevated: qt,
638
- outline: Rt,
639
- "padding-none": "_padding-none_1n0ll_23",
640
- "padding-sm": "_padding-sm_1n0ll_27",
641
- "padding-md": "_padding-md_1n0ll_31",
642
- "padding-lg": "_padding-lg_1n0ll_35",
643
- hoverable: Bt
644
- }, Ns = ({
634
+ }, qt = "_card_b4471_1", Rt = "_chamfered_b4471_8", Pt = "_elevated_b4471_17", Bt = "_outline_b4471_22", Ut = "_hoverable_b4471_45", U = {
635
+ card: qt,
636
+ chamfered: Rt,
637
+ default: "_default_b4471_13",
638
+ elevated: Pt,
639
+ outline: Bt,
640
+ "padding-none": "_padding-none_b4471_28",
641
+ "padding-sm": "_padding-sm_b4471_32",
642
+ "padding-md": "_padding-md_b4471_36",
643
+ "padding-lg": "_padding-lg_b4471_40",
644
+ hoverable: Ut
645
+ }, Ss = ({
645
646
  children: e,
646
- variant: t = "default",
647
- chamfered: s = !1,
647
+ variant: s = "default",
648
+ chamfered: t = !1,
648
649
  chamferSize: o = "md",
649
650
  padding: _ = "md",
650
- hoverable: h = !1,
651
- className: c = "",
652
- onClick: l
651
+ hoverable: g = !1,
652
+ showDiagonalBorders: c = !1,
653
+ diagonalBorderColor: l,
654
+ className: i = "",
655
+ onClick: h,
656
+ style: p
653
657
  }) => {
654
- const i = s ? o === "sm" ? "chamfered-box-sm" : o === "lg" ? "chamfered-box-lg" : "chamfered-box" : "";
655
- return /* @__PURE__ */ r(
658
+ const N = t ? o === "asymmetric" ? "chamfered-box-asymmetric" : o === "sm" ? "chamfered-box-sm" : o === "lg" ? "chamfered-box-lg" : "chamfered-box" : "", f = l ? { color: l } : void 0;
659
+ return /* @__PURE__ */ m(
656
660
  "div",
657
661
  {
658
- className: `${J.card} ${J[t]} ${J[`padding-${_}`]} ${i} ${h ? J.hoverable : ""} ${c}`,
659
- onClick: l,
660
- role: l ? "button" : void 0,
661
- tabIndex: l ? 0 : void 0,
662
- children: e
662
+ className: `${U.card} ${t ? U.chamfered : ""} ${U[s]} ${U[`padding-${_}`]} ${N} ${g ? U.hoverable : ""} ${i}`,
663
+ onClick: h,
664
+ role: h ? "button" : void 0,
665
+ tabIndex: h ? 0 : void 0,
666
+ style: p,
667
+ children: [
668
+ c && /* @__PURE__ */ m(ge, { children: [
669
+ /* @__PURE__ */ r("div", { className: "chamfered-diagonal-border chamfered-diagonal-tl", style: f }),
670
+ /* @__PURE__ */ r("div", { className: "chamfered-diagonal-border chamfered-diagonal-tr", style: f }),
671
+ /* @__PURE__ */ r("div", { className: "chamfered-diagonal-border chamfered-diagonal-bl", style: f }),
672
+ /* @__PURE__ */ r("div", { className: `chamfered-diagonal-border ${o === "asymmetric" ? "chamfered-diagonal-br-large" : "chamfered-diagonal-br"}`, style: f })
673
+ ] }),
674
+ e
675
+ ]
663
676
  }
664
677
  );
665
- }, Pt = "_badge_rk7t5_1", Ut = "_sm_rk7t5_11", jt = "_md_rk7t5_16", Dt = "_lg_rk7t5_21", Ft = "_primary_rk7t5_32", zt = "_secondary_rk7t5_37", Ot = "_success_rk7t5_42", Mt = "_warning_rk7t5_47", Jt = "_error_rk7t5_52", Ht = "_info_rk7t5_57", Z = {
666
- badge: Pt,
667
- sm: Ut,
668
- md: jt,
669
- lg: Dt,
678
+ }, jt = "_badge_rk7t5_1", Ft = "_sm_rk7t5_11", Dt = "_md_rk7t5_16", Ot = "_lg_rk7t5_21", zt = "_primary_rk7t5_32", Mt = "_secondary_rk7t5_37", Jt = "_success_rk7t5_42", Ht = "_warning_rk7t5_47", Yt = "_error_rk7t5_52", Gt = "_info_rk7t5_57", Z = {
679
+ badge: jt,
680
+ sm: Ft,
681
+ md: Dt,
682
+ lg: Ot,
670
683
  default: "_default_rk7t5_27",
671
- primary: Ft,
672
- secondary: zt,
673
- success: Ot,
674
- warning: Mt,
675
- error: Jt,
676
- info: Ht
677
- }, Ss = ({
684
+ primary: zt,
685
+ secondary: Mt,
686
+ success: Jt,
687
+ warning: Ht,
688
+ error: Yt,
689
+ info: Gt
690
+ }, xs = ({
678
691
  children: e,
679
- variant: t = "default",
680
- size: s = "md",
692
+ variant: s = "default",
693
+ size: t = "md",
681
694
  className: o = ""
682
- }) => /* @__PURE__ */ r("span", { className: `${Z.badge} ${Z[t]} ${Z[s]} ${o}`, children: e }), Yt = "_overlay_1b3yt_1", Gt = "_fadeIn_1b3yt_1", Kt = "_modal_1b3yt_13", Vt = "_slideUp_1b3yt_1", Qt = "_sm_1b3yt_25", Xt = "_md_1b3yt_30", Zt = "_lg_1b3yt_35", es = "_xl_1b3yt_40", ts = "_header_1b3yt_45", ss = "_title_1b3yt_53", os = "_closeButton_1b3yt_60", ns = "_content_1b3yt_78", E = {
683
- overlay: Yt,
684
- fadeIn: Gt,
685
- modal: Kt,
686
- slideUp: Vt,
687
- sm: Qt,
688
- md: Xt,
689
- lg: Zt,
690
- xl: es,
691
- header: ts,
692
- title: ss,
693
- closeButton: os,
695
+ }) => /* @__PURE__ */ r("span", { className: `${Z.badge} ${Z[s]} ${Z[t]} ${o}`, children: e }), Kt = "_overlay_1b3yt_1", Vt = "_fadeIn_1b3yt_1", Qt = "_modal_1b3yt_13", Xt = "_slideUp_1b3yt_1", Zt = "_sm_1b3yt_25", es = "_md_1b3yt_30", ts = "_lg_1b3yt_35", ss = "_xl_1b3yt_40", os = "_header_1b3yt_45", rs = "_title_1b3yt_53", as = "_closeButton_1b3yt_60", ns = "_content_1b3yt_78", E = {
696
+ overlay: Kt,
697
+ fadeIn: Vt,
698
+ modal: Qt,
699
+ slideUp: Xt,
700
+ sm: Zt,
701
+ md: es,
702
+ lg: ts,
703
+ xl: ss,
704
+ header: os,
705
+ title: rs,
706
+ closeButton: as,
694
707
  content: ns
695
- }, As = ({
708
+ }, Ts = ({
696
709
  isOpen: e,
697
- onClose: t,
698
- title: s,
710
+ onClose: s,
711
+ title: t,
699
712
  children: o,
700
713
  size: _ = "md",
701
- closeOnOverlayClick: h = !0,
714
+ closeOnOverlayClick: g = !0,
702
715
  className: c = ""
703
716
  }) => {
704
- if (U(() => (e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "unset", () => {
717
+ if (j(() => (e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "unset", () => {
705
718
  document.body.style.overflow = "unset";
706
- }), [e]), U(() => {
707
- const i = (g) => {
708
- g.key === "Escape" && e && t();
719
+ }), [e]), j(() => {
720
+ const i = (h) => {
721
+ h.key === "Escape" && e && s();
709
722
  };
710
723
  return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
711
- }, [e, t]), !e) return null;
724
+ }, [e, s]), !e) return null;
712
725
  const l = (i) => {
713
- h && i.target === i.currentTarget && t();
726
+ g && i.target === i.currentTarget && s();
714
727
  };
715
728
  return /* @__PURE__ */ r("div", { className: E.overlay, onClick: l, children: /* @__PURE__ */ m("div", { className: `${E.modal} ${E[_]} ${c}`, role: "dialog", "aria-modal": "true", children: [
716
- s && /* @__PURE__ */ m("div", { className: E.header, children: [
717
- /* @__PURE__ */ r("h2", { className: E.title, children: s }),
718
- /* @__PURE__ */ r("button", { className: E.closeButton, onClick: t, "aria-label": "Close modal", children: "✕" })
729
+ t && /* @__PURE__ */ m("div", { className: E.header, children: [
730
+ /* @__PURE__ */ r("h2", { className: E.title, children: t }),
731
+ /* @__PURE__ */ r("button", { className: E.closeButton, onClick: s, "aria-label": "Close modal", children: "✕" })
719
732
  ] }),
720
733
  /* @__PURE__ */ r("div", { className: E.content, children: o })
721
734
  ] }) });
722
- }, rs = "_spinner_1uhnh_2", as = "_spin_1uhnh_2", ls = "_sm_1uhnh_9", cs = "_md_1uhnh_15", is = "_lg_1uhnh_21", ds = "_dots_1uhnh_34", _s = "_dot_1uhnh_34", us = "_bounce_1uhnh_1", ms = "_visuallyHidden_1uhnh_91", T = {
723
- spinner: rs,
724
- spin: as,
725
- sm: ls,
726
- md: cs,
727
- lg: is,
728
- dots: ds,
729
- dot: _s,
730
- bounce: us,
731
- visuallyHidden: ms
732
- }, xs = ({
735
+ }, ls = "_spinner_1uhnh_2", cs = "_spin_1uhnh_2", is = "_sm_1uhnh_9", ds = "_md_1uhnh_15", _s = "_lg_1uhnh_21", ms = "_dots_1uhnh_34", us = "_dot_1uhnh_34", hs = "_bounce_1uhnh_1", gs = "_visuallyHidden_1uhnh_91", C = {
736
+ spinner: ls,
737
+ spin: cs,
738
+ sm: is,
739
+ md: ds,
740
+ lg: _s,
741
+ dots: ms,
742
+ dot: us,
743
+ bounce: hs,
744
+ visuallyHidden: gs
745
+ }, Cs = ({
733
746
  size: e = "md",
734
- variant: t = "spinner",
735
- className: s = ""
736
- }) => t === "dots" ? /* @__PURE__ */ m("div", { className: `${T.dots} ${T[e]} ${s}`, children: [
737
- /* @__PURE__ */ r("span", { className: T.dot }),
738
- /* @__PURE__ */ r("span", { className: T.dot }),
739
- /* @__PURE__ */ r("span", { className: T.dot })
740
- ] }) : /* @__PURE__ */ r("div", { className: `${T.spinner} ${T[e]} ${s}`, role: "status", children: /* @__PURE__ */ r("span", { className: T.visuallyHidden, children: "Loading..." }) });
747
+ variant: s = "spinner",
748
+ className: t = ""
749
+ }) => s === "dots" ? /* @__PURE__ */ m("div", { className: `${C.dots} ${C[e]} ${t}`, children: [
750
+ /* @__PURE__ */ r("span", { className: C.dot }),
751
+ /* @__PURE__ */ r("span", { className: C.dot }),
752
+ /* @__PURE__ */ r("span", { className: C.dot })
753
+ ] }) : /* @__PURE__ */ r("div", { className: `${C.spinner} ${C[e]} ${t}`, role: "status", children: /* @__PURE__ */ r("span", { className: C.visuallyHidden, children: "Loading..." }) });
741
754
  export {
742
- bs as AllyCodeDropdown,
743
- ht as ApiClient,
744
- $s as AuthProvider,
745
- Ss as Badge,
746
- O as Button,
747
- Ns as Card,
748
- fs as Container,
749
- vs as Footer,
750
- ae as Input,
751
- xs as Loader,
752
- As as Modal,
755
+ As as AllyCodeDropdown,
756
+ gt as ApiClient,
757
+ ws as AuthProvider,
758
+ xs as Badge,
759
+ M as Button,
760
+ Ss as Card,
761
+ vs as Container,
762
+ bs as Footer,
763
+ ne as Input,
764
+ Cs as Loader,
765
+ Ts as Modal,
753
766
  le as Select,
754
- ys as TopBar,
755
- p as apiClient,
756
- $t as clearAllyCodes,
767
+ $s as TopBar,
768
+ y as apiClient,
769
+ bt as clearAllyCodes,
757
770
  ee as clearTokens,
758
- M as formatAllyCode,
771
+ J as formatAllyCode,
759
772
  ce as getAccessToken,
760
- N as getAllyCodesFromStorage,
761
- dt as getRefreshToken,
762
- yt as getSelectedAllyCode,
763
- gt as initializeApiClient,
764
- mt as isAuthenticated,
765
- it as removeAccessToken,
766
- ft as removeAllyCodeFromStorage,
773
+ A as getAllyCodesFromStorage,
774
+ _t as getRefreshToken,
775
+ vt as getSelectedAllyCode,
776
+ ft as initializeApiClient,
777
+ ht as isAuthenticated,
778
+ dt as removeAccessToken,
779
+ yt as removeAllyCodeFromStorage,
767
780
  ut as removeRefreshToken,
768
781
  pt as saveAllyCodeToStorage,
769
- ct as setAccessToken,
770
- _t as setRefreshToken,
771
- vt as setSelectedAllyCode,
782
+ it as setAccessToken,
783
+ mt as setRefreshToken,
784
+ $t as setSelectedAllyCode,
772
785
  ie as setTokens,
773
- ws as unformatAllyCode,
774
- ne as updateAllyCodeLastUsed,
786
+ Ns as unformatAllyCode,
787
+ re as updateAllyCodeLastUsed,
775
788
  wt as useAuth
776
789
  };