@nice2dev/auth 1.2.1 → 1.2.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.
package/dist/index.mjs CHANGED
@@ -1,181 +1,182 @@
1
- import { useState as g, useCallback as $, forwardRef as G, useMemo as ne, useRef as H, useEffect as Q, useImperativeHandle as oe } from "react";
2
- import { jsxs as a, jsx as e, Fragment as ae } from "react/jsx-runtime";
3
- function Ce(r = {}) {
4
- const { onLogin: t, onRefresh: c, onLogout: n, storageKey: i = "nice_auth", persistAuth: h = !1 } = r, [l, s] = g(() => {
5
- if (h && typeof window < "u")
1
+ import { useState as _, useCallback as M, forwardRef as K, useMemo as se, useRef as Q, useEffect as Z, useImperativeHandle as me } from "react";
2
+ import { jsxs as r, jsx as e, Fragment as ce } from "react/jsx-runtime";
3
+ import { useNiceTranslation as q } from "@nice2dev/ui-core";
4
+ function Se(s = {}) {
5
+ const { onLogin: a, onRefresh: n, onLogout: t, storageKey: i = "nice_auth", persistAuth: d = !1 } = s, [l, c] = _(() => {
6
+ if (d && typeof window < "u")
6
7
  try {
7
- const o = localStorage.getItem(i);
8
- if (o)
9
- return { ...JSON.parse(o), loading: !1, error: null };
8
+ const m = localStorage.getItem(i);
9
+ if (m)
10
+ return { ...JSON.parse(m), loading: !1, error: null };
10
11
  } catch {
11
12
  }
12
13
  return { isAuthenticated: !1, user: null, tokens: null, loading: !1, error: null };
13
- }), u = $(
14
- (o) => {
15
- s((p) => {
16
- const f = { ...p, ...o };
17
- return h && typeof window < "u" && (f.isAuthenticated ? localStorage.setItem(
14
+ }), h = M(
15
+ (m) => {
16
+ c((p) => {
17
+ const b = { ...p, ...m };
18
+ return d && typeof window < "u" && (b.isAuthenticated ? localStorage.setItem(
18
19
  i,
19
- JSON.stringify({ isAuthenticated: !0, user: f.user })
20
- ) : localStorage.removeItem(i)), f;
20
+ JSON.stringify({ isAuthenticated: !0, user: b.user })
21
+ ) : localStorage.removeItem(i)), b;
21
22
  });
22
23
  },
23
- [h, i]
24
- ), S = $(
25
- async (o, p) => {
26
- u({ loading: !0, error: null });
24
+ [d, i]
25
+ ), x = M(
26
+ async (m, p) => {
27
+ h({ loading: !0, error: null });
27
28
  try {
28
- if (t) {
29
- const f = await t(o, p);
30
- return u({
29
+ if (a) {
30
+ const b = await a(m, p);
31
+ return h({
31
32
  isAuthenticated: !0,
32
- user: f.user,
33
- tokens: f.tokens,
33
+ user: b.user,
34
+ tokens: b.tokens,
34
35
  loading: !1
35
36
  }), !0;
36
37
  }
37
- return u({ loading: !1, error: "No login handler configured" }), !1;
38
- } catch (f) {
39
- return u({
38
+ return h({ loading: !1, error: "No login handler configured" }), !1;
39
+ } catch (b) {
40
+ return h({
40
41
  loading: !1,
41
- error: (f == null ? void 0 : f.message) ?? "Login failed"
42
+ error: (b == null ? void 0 : b.message) ?? "Login failed"
42
43
  }), !1;
43
44
  }
44
45
  },
45
- [t, u]
46
- ), d = $(() => {
47
- n == null || n(), u({ isAuthenticated: !1, user: null, tokens: null, loading: !1, error: null });
48
- }, [n, u]), A = $(async () => {
49
- var o;
50
- if (!((o = l.tokens) != null && o.refreshToken) || !c)
46
+ [a, h]
47
+ ), f = M(() => {
48
+ t == null || t(), h({ isAuthenticated: !1, user: null, tokens: null, loading: !1, error: null });
49
+ }, [t, h]), g = M(async () => {
50
+ var m;
51
+ if (!((m = l.tokens) != null && m.refreshToken) || !n)
51
52
  return !1;
52
53
  try {
53
- const p = await c(l.tokens.refreshToken);
54
- return u({ tokens: p }), !0;
54
+ const p = await n(l.tokens.refreshToken);
55
+ return h({ tokens: p }), !0;
55
56
  } catch {
56
- return d(), !1;
57
+ return f(), !1;
57
58
  }
58
- }, [l.tokens, c, u, d]), b = $(
59
- (o, p) => {
60
- u({ isAuthenticated: !0, user: o, tokens: p, loading: !1, error: null });
59
+ }, [l.tokens, n, h, f]), S = M(
60
+ (m, p) => {
61
+ h({ isAuthenticated: !0, user: m, tokens: p, loading: !1, error: null });
61
62
  },
62
- [u]
63
- ), k = $(
64
- (...o) => l.user ? o.every((p) => l.user.roles.includes(p)) : !1,
63
+ [h]
64
+ ), y = M(
65
+ (...m) => l.user ? m.every((p) => l.user.roles.includes(p)) : !1,
65
66
  [l.user]
66
- ), _ = $(
67
- (...o) => l.user ? o.every((p) => l.user.permissions.includes(p)) : !1,
67
+ ), o = M(
68
+ (...m) => l.user ? m.every((p) => l.user.permissions.includes(p)) : !1,
68
69
  [l.user]
69
- ), F = $(() => {
70
- u({ error: null });
71
- }, [u]);
70
+ ), w = M(() => {
71
+ h({ error: null });
72
+ }, [h]);
72
73
  return {
73
74
  ...l,
74
- login: S,
75
- logout: d,
76
- refreshToken: A,
77
- setAuth: b,
78
- hasRoles: k,
79
- hasPermissions: _,
80
- clearError: F
75
+ login: x,
76
+ logout: f,
77
+ refreshToken: g,
78
+ setAuth: S,
79
+ hasRoles: y,
80
+ hasPermissions: o,
81
+ clearError: w
81
82
  };
82
83
  }
83
- const xe = /* @__PURE__ */ Object.assign(
84
- /* @__PURE__ */ G(
84
+ const Te = /* @__PURE__ */ Object.assign(
85
+ /* @__PURE__ */ K(
85
86
  ({
86
- onSubmit: r,
87
- loading: t = !1,
88
- error: c,
89
- showRememberMe: n = !0,
87
+ onSubmit: s,
88
+ loading: a = !1,
89
+ error: n,
90
+ showRememberMe: t = !0,
90
91
  showForgotPassword: i = !0,
91
- onForgotPassword: h,
92
+ onForgotPassword: d,
92
93
  showRegisterLink: l = !0,
93
- onRegisterClick: s,
94
- title: u = "Sign In",
95
- submitLabel: S = "Sign In",
96
- logo: d,
97
- footer: A,
98
- className: b,
99
- style: k,
100
- emailLabel: _ = "Email",
101
- passwordLabel: F = "Password",
102
- tracelessPolicy: o,
94
+ onRegisterClick: c,
95
+ title: h,
96
+ submitLabel: x,
97
+ logo: f,
98
+ footer: g,
99
+ className: S,
100
+ style: y,
101
+ emailLabel: o,
102
+ passwordLabel: w,
103
+ tracelessPolicy: m,
103
104
  privacyMessage: p
104
- }, f) => {
105
- const [M, w] = g(""), [C, T] = g(""), [E, N] = g(!1), I = ne(() => !(!n || o && !o.cookiesAllowed), [n, o]), O = $(
106
- (x) => {
107
- x.preventDefault();
108
- const D = (o == null ? void 0 : o.cookiesAllowed) === !1 ? !1 : E;
109
- r == null || r({ email: M, password: C, rememberMe: D });
105
+ }, b) => {
106
+ const { t: N } = q(), [I, k] = _(""), [T, $] = _(""), [O, v] = _(!1), E = se(() => !(!t || m && !m.cookiesAllowed), [t, m]), L = M(
107
+ (A) => {
108
+ A.preventDefault();
109
+ const D = (m == null ? void 0 : m.cookiesAllowed) === !1 ? !1 : O;
110
+ s == null || s({ email: I, password: T, rememberMe: D });
110
111
  },
111
- [M, C, E, r, o]
112
+ [I, T, O, s, m]
112
113
  );
113
- return /* @__PURE__ */ a(
114
+ return /* @__PURE__ */ r(
114
115
  "form",
115
116
  {
116
- ref: f,
117
- className: `nice-login-form${b ? ` ${b}` : ""}`,
118
- style: k,
119
- onSubmit: O,
117
+ ref: b,
118
+ className: `nice-login-form${S ? ` ${S}` : ""}`,
119
+ style: y,
120
+ onSubmit: L,
120
121
  noValidate: !0,
121
122
  children: [
122
- d && /* @__PURE__ */ e("div", { className: "nice-login-form__logo", children: d }),
123
- /* @__PURE__ */ e("h2", { className: "nice-login-form__title", children: u }),
124
- c && /* @__PURE__ */ e("div", { className: "nice-login-form__error", role: "alert", children: c }),
125
- /* @__PURE__ */ a("div", { className: "nice-login-form__field", children: [
126
- /* @__PURE__ */ e("label", { htmlFor: "nice-login-email", children: _ }),
123
+ f && /* @__PURE__ */ e("div", { className: "nice-login-form__logo", children: f }),
124
+ /* @__PURE__ */ e("h2", { className: "nice-login-form__title", children: h ?? N("loginForm.title", "Sign In") }),
125
+ n && /* @__PURE__ */ e("div", { className: "nice-login-form__error", role: "alert", children: n }),
126
+ /* @__PURE__ */ r("div", { className: "nice-login-form__field", children: [
127
+ /* @__PURE__ */ e("label", { htmlFor: "nice-login-email", children: o ?? N("loginForm.email", "Email") }),
127
128
  /* @__PURE__ */ e(
128
129
  "input",
129
130
  {
130
131
  id: "nice-login-email",
131
132
  className: "nice-input",
132
133
  type: "email",
133
- value: M,
134
- onChange: (x) => w(x.target.value),
134
+ value: I,
135
+ onChange: (A) => k(A.target.value),
135
136
  autoComplete: "email",
136
137
  required: !0,
137
- disabled: t
138
+ disabled: a
138
139
  }
139
140
  )
140
141
  ] }),
141
- /* @__PURE__ */ a("div", { className: "nice-login-form__field", children: [
142
- /* @__PURE__ */ e("label", { htmlFor: "nice-login-password", children: F }),
142
+ /* @__PURE__ */ r("div", { className: "nice-login-form__field", children: [
143
+ /* @__PURE__ */ e("label", { htmlFor: "nice-login-password", children: w ?? N("loginForm.password", "Password") }),
143
144
  /* @__PURE__ */ e(
144
145
  "input",
145
146
  {
146
147
  id: "nice-login-password",
147
148
  className: "nice-input",
148
149
  type: "password",
149
- value: C,
150
- onChange: (x) => T(x.target.value),
150
+ value: T,
151
+ onChange: (A) => $(A.target.value),
151
152
  autoComplete: "current-password",
152
153
  required: !0,
153
- disabled: t
154
+ disabled: a
154
155
  }
155
156
  )
156
157
  ] }),
157
- /* @__PURE__ */ a("div", { className: "nice-login-form__options", children: [
158
- I && /* @__PURE__ */ a("label", { className: "nice-login-form__remember", children: [
158
+ /* @__PURE__ */ r("div", { className: "nice-login-form__options", children: [
159
+ E && /* @__PURE__ */ r("label", { className: "nice-login-form__remember", children: [
159
160
  /* @__PURE__ */ e(
160
161
  "input",
161
162
  {
162
163
  type: "checkbox",
163
- checked: E,
164
- onChange: (x) => N(x.target.checked),
165
- disabled: t
164
+ checked: O,
165
+ onChange: (A) => v(A.target.checked),
166
+ disabled: a
166
167
  }
167
168
  ),
168
- /* @__PURE__ */ e("span", { children: "Remember me" })
169
+ /* @__PURE__ */ e("span", { children: N("loginForm.rememberMe", "Remember me") })
169
170
  ] }),
170
- !I && n && p && /* @__PURE__ */ e("span", { className: "nice-login-form__privacy-notice", children: p }),
171
+ !E && t && p && /* @__PURE__ */ e("span", { className: "nice-login-form__privacy-notice", children: p }),
171
172
  i && /* @__PURE__ */ e(
172
173
  "button",
173
174
  {
174
175
  type: "button",
175
176
  className: "nice-login-form__forgot",
176
- onClick: h,
177
- disabled: t,
178
- children: "Forgot password?"
177
+ onClick: d,
178
+ disabled: a,
179
+ children: N("loginForm.forgotPassword", "Forgot password?")
179
180
  }
180
181
  )
181
182
  ] }),
@@ -184,200 +185,197 @@ const xe = /* @__PURE__ */ Object.assign(
184
185
  {
185
186
  type: "submit",
186
187
  className: "nice-btn nice-btn--primary nice-login-form__submit",
187
- disabled: t || !M || !C,
188
- children: t ? "…" : S
188
+ disabled: a || !I || !T,
189
+ children: a ? "…" : x ?? N("loginForm.signIn", "Sign In")
189
190
  }
190
191
  ),
191
- l && /* @__PURE__ */ a("div", { className: "nice-login-form__register", children: [
192
- /* @__PURE__ */ e("span", { children: "Don't have an account? " }),
193
- /* @__PURE__ */ e("button", { type: "button", onClick: s, disabled: t, children: "Register" })
192
+ l && /* @__PURE__ */ r("div", { className: "nice-login-form__register", children: [
193
+ /* @__PURE__ */ r("span", { children: [
194
+ N("loginForm.dontHaveAnAccount", "Don't have an account?"),
195
+ " "
196
+ ] }),
197
+ /* @__PURE__ */ e("button", { type: "button", onClick: c, disabled: a, children: N("loginForm.register", "Register") })
194
198
  ] }),
195
- A && /* @__PURE__ */ e("div", { className: "nice-login-form__footer", children: A })
199
+ g && /* @__PURE__ */ e("div", { className: "nice-login-form__footer", children: g })
196
200
  ]
197
201
  }
198
202
  );
199
203
  }
200
204
  ),
201
205
  { displayName: "NiceLoginForm" }
202
- ), de = {
206
+ ), ue = {
203
207
  0: "Very weak",
204
208
  1: "Weak",
205
209
  2: "Fair",
206
210
  3: "Strong",
207
211
  4: "Very strong"
208
- }, he = {
212
+ }, pe = {
209
213
  0: "#d9534f",
210
214
  1: "#f0ad4e",
211
215
  2: "#5bc0de",
212
216
  3: "#5cb85c",
213
217
  4: "#2e7d32"
214
218
  };
215
- function X(r) {
216
- if (!r)
219
+ function ee(s) {
220
+ if (!s)
217
221
  return 0;
218
- let t = 0;
219
- return r.length >= 8 && t++, r.length >= 12 && t++, /[a-z]/.test(r) && /[A-Z]/.test(r) && t++, /\d/.test(r) && t++, /[^a-zA-Z0-9]/.test(r) && t++, Math.min(4, t);
222
+ let a = 0;
223
+ return s.length >= 8 && a++, s.length >= 12 && a++, /[a-z]/.test(s) && /[A-Z]/.test(s) && a++, /\d/.test(s) && a++, /[^a-zA-Z0-9]/.test(s) && a++, Math.min(4, a);
220
224
  }
221
- const Y = /* @__PURE__ */ Object.assign(
222
- /* @__PURE__ */ G(
223
- ({
224
- password: r,
225
- strength: t,
226
- showLabel: c = !0,
227
- labels: n = de,
228
- className: i
229
- }, h) => {
230
- const l = t ?? X(r), s = he[l], u = (l + 1) / 5 * 100;
231
- return /* @__PURE__ */ a("div", { ref: h, className: `nice-password-strength${i ? ` ${i}` : ""}`, children: [
225
+ const te = /* @__PURE__ */ Object.assign(
226
+ /* @__PURE__ */ K(
227
+ ({ password: s, strength: a, showLabel: n = !0, labels: t, className: i }, d) => {
228
+ const { t: l } = q(), c = a ?? ee(s), h = pe[c], x = (c + 1) / 5 * 100;
229
+ return /* @__PURE__ */ r("div", { ref: d, className: `nice-password-strength${i ? ` ${i}` : ""}`, children: [
232
230
  /* @__PURE__ */ e("div", { className: "nice-password-strength__bar", children: /* @__PURE__ */ e(
233
231
  "div",
234
232
  {
235
233
  className: "nice-password-strength__fill",
236
- style: { width: `${u}%`, backgroundColor: s }
234
+ style: { width: `${x}%`, backgroundColor: h }
237
235
  }
238
236
  ) }),
239
- c && /* @__PURE__ */ e("span", { className: "nice-password-strength__label", style: { color: s }, children: n[l] })
237
+ n && /* @__PURE__ */ e("span", { className: "nice-password-strength__label", style: { color: h }, children: t ? t[c] : l(`passwordStrength.level.${c}`, ue[c]) })
240
238
  ] });
241
239
  }
242
240
  ),
243
241
  { displayName: "NicePasswordStrength" }
244
- ), $e = /* @__PURE__ */ Object.assign(
245
- /* @__PURE__ */ G(
242
+ ), Ae = /* @__PURE__ */ Object.assign(
243
+ /* @__PURE__ */ K(
246
244
  ({
247
- onSubmit: r,
248
- loading: t = !1,
249
- error: c,
250
- onLoginClick: n,
245
+ onSubmit: s,
246
+ loading: a = !1,
247
+ error: n,
248
+ onLoginClick: t,
251
249
  showPasswordStrength: i = !0,
252
- minPasswordStrength: h = 2,
250
+ minPasswordStrength: d = 2,
253
251
  termsUrl: l,
254
- privacyUrl: s,
255
- title: u = "Create Account",
256
- logo: S,
257
- footer: d,
258
- className: A,
259
- style: b
260
- }, k) => {
261
- const [_, F] = g(""), [o, p] = g(""), [f, M] = g(""), [w, C] = g(""), [T, E] = g(""), [N, I] = g(!1), O = X(w), x = w === T, D = _ && f && w && x && N && O >= h && !t, m = $(
262
- (v) => {
263
- v.preventDefault(), D && (r == null || r({ firstName: _, lastName: o, email: f, password: w, acceptTerms: N }));
252
+ privacyUrl: c,
253
+ title: h,
254
+ logo: x,
255
+ footer: f,
256
+ className: g,
257
+ style: S
258
+ }, y) => {
259
+ const { t: o } = q(), [w, m] = _(""), [p, b] = _(""), [N, I] = _(""), [k, T] = _(""), [$, O] = _(""), [v, E] = _(!1), L = ee(k), A = k === $, D = w && N && k && A && v && L >= d && !a, u = M(
260
+ (C) => {
261
+ C.preventDefault(), D && (s == null || s({ firstName: w, lastName: p, email: N, password: k, acceptTerms: v }));
264
262
  },
265
- [D, _, o, f, w, N, r]
263
+ [D, w, p, N, k, v, s]
266
264
  );
267
- return /* @__PURE__ */ a(
265
+ return /* @__PURE__ */ r(
268
266
  "form",
269
267
  {
270
- ref: k,
271
- className: `nice-register-form${A ? ` ${A}` : ""}`,
272
- style: b,
273
- onSubmit: m,
268
+ ref: y,
269
+ className: `nice-register-form${g ? ` ${g}` : ""}`,
270
+ style: S,
271
+ onSubmit: u,
274
272
  noValidate: !0,
275
273
  children: [
276
- S && /* @__PURE__ */ e("div", { className: "nice-register-form__logo", children: S }),
277
- /* @__PURE__ */ e("h2", { className: "nice-register-form__title", children: u }),
278
- c && /* @__PURE__ */ e("div", { className: "nice-register-form__error", role: "alert", children: c }),
279
- /* @__PURE__ */ a("div", { className: "nice-register-form__row", children: [
280
- /* @__PURE__ */ a("div", { className: "nice-register-form__field", children: [
281
- /* @__PURE__ */ e("label", { htmlFor: "nice-reg-first", children: "First name *" }),
274
+ x && /* @__PURE__ */ e("div", { className: "nice-register-form__logo", children: x }),
275
+ /* @__PURE__ */ e("h2", { className: "nice-register-form__title", children: h ?? o("registrationForm.title", "Create Account") }),
276
+ n && /* @__PURE__ */ e("div", { className: "nice-register-form__error", role: "alert", children: n }),
277
+ /* @__PURE__ */ r("div", { className: "nice-register-form__row", children: [
278
+ /* @__PURE__ */ r("div", { className: "nice-register-form__field", children: [
279
+ /* @__PURE__ */ e("label", { htmlFor: "nice-reg-first", children: o("registrationForm.firstName", "First name *") }),
282
280
  /* @__PURE__ */ e(
283
281
  "input",
284
282
  {
285
283
  id: "nice-reg-first",
286
284
  className: "nice-input",
287
285
  type: "text",
288
- value: _,
289
- onChange: (v) => F(v.target.value),
286
+ value: w,
287
+ onChange: (C) => m(C.target.value),
290
288
  required: !0,
291
- disabled: t,
289
+ disabled: a,
292
290
  autoComplete: "given-name"
293
291
  }
294
292
  )
295
293
  ] }),
296
- /* @__PURE__ */ a("div", { className: "nice-register-form__field", children: [
297
- /* @__PURE__ */ e("label", { htmlFor: "nice-reg-last", children: "Last name" }),
294
+ /* @__PURE__ */ r("div", { className: "nice-register-form__field", children: [
295
+ /* @__PURE__ */ e("label", { htmlFor: "nice-reg-last", children: o("registrationForm.lastName", "Last name") }),
298
296
  /* @__PURE__ */ e(
299
297
  "input",
300
298
  {
301
299
  id: "nice-reg-last",
302
300
  className: "nice-input",
303
301
  type: "text",
304
- value: o,
305
- onChange: (v) => p(v.target.value),
306
- disabled: t,
302
+ value: p,
303
+ onChange: (C) => b(C.target.value),
304
+ disabled: a,
307
305
  autoComplete: "family-name"
308
306
  }
309
307
  )
310
308
  ] })
311
309
  ] }),
312
- /* @__PURE__ */ a("div", { className: "nice-register-form__field", children: [
313
- /* @__PURE__ */ e("label", { htmlFor: "nice-reg-email", children: "Email *" }),
310
+ /* @__PURE__ */ r("div", { className: "nice-register-form__field", children: [
311
+ /* @__PURE__ */ e("label", { htmlFor: "nice-reg-email", children: o("registrationForm.email", "Email *") }),
314
312
  /* @__PURE__ */ e(
315
313
  "input",
316
314
  {
317
315
  id: "nice-reg-email",
318
316
  className: "nice-input",
319
317
  type: "email",
320
- value: f,
321
- onChange: (v) => M(v.target.value),
318
+ value: N,
319
+ onChange: (C) => I(C.target.value),
322
320
  required: !0,
323
- disabled: t,
321
+ disabled: a,
324
322
  autoComplete: "email"
325
323
  }
326
324
  )
327
325
  ] }),
328
- /* @__PURE__ */ a("div", { className: "nice-register-form__field", children: [
329
- /* @__PURE__ */ e("label", { htmlFor: "nice-reg-pass", children: "Password *" }),
326
+ /* @__PURE__ */ r("div", { className: "nice-register-form__field", children: [
327
+ /* @__PURE__ */ e("label", { htmlFor: "nice-reg-pass", children: o("registrationForm.password", "Password *") }),
330
328
  /* @__PURE__ */ e(
331
329
  "input",
332
330
  {
333
331
  id: "nice-reg-pass",
334
332
  className: "nice-input",
335
333
  type: "password",
336
- value: w,
337
- onChange: (v) => C(v.target.value),
334
+ value: k,
335
+ onChange: (C) => T(C.target.value),
338
336
  required: !0,
339
- disabled: t,
337
+ disabled: a,
340
338
  autoComplete: "new-password"
341
339
  }
342
340
  ),
343
- i && w.length > 0 && /* @__PURE__ */ e(Y, { password: w })
341
+ i && k.length > 0 && /* @__PURE__ */ e(te, { password: k })
344
342
  ] }),
345
- /* @__PURE__ */ a("div", { className: "nice-register-form__field", children: [
346
- /* @__PURE__ */ e("label", { htmlFor: "nice-reg-confirm", children: "Confirm password *" }),
343
+ /* @__PURE__ */ r("div", { className: "nice-register-form__field", children: [
344
+ /* @__PURE__ */ e("label", { htmlFor: "nice-reg-confirm", children: o("registrationForm.confirmPassword", "Confirm password *") }),
347
345
  /* @__PURE__ */ e(
348
346
  "input",
349
347
  {
350
348
  id: "nice-reg-confirm",
351
349
  className: "nice-input",
352
350
  type: "password",
353
- value: T,
354
- onChange: (v) => E(v.target.value),
351
+ value: $,
352
+ onChange: (C) => O(C.target.value),
355
353
  required: !0,
356
- disabled: t,
354
+ disabled: a,
357
355
  autoComplete: "new-password"
358
356
  }
359
357
  ),
360
- T && !x && /* @__PURE__ */ e("span", { className: "nice-error-text", children: "Passwords do not match" })
358
+ $ && !A && /* @__PURE__ */ e("span", { className: "nice-error-text", children: o("registrationForm.passwordsDoNotMatch", "Passwords do not match") })
361
359
  ] }),
362
- /* @__PURE__ */ a("label", { className: "nice-register-form__terms", children: [
360
+ /* @__PURE__ */ r("label", { className: "nice-register-form__terms", children: [
363
361
  /* @__PURE__ */ e(
364
362
  "input",
365
363
  {
366
364
  type: "checkbox",
367
- checked: N,
368
- onChange: (v) => I(v.target.checked),
369
- disabled: t
365
+ checked: v,
366
+ onChange: (C) => E(C.target.checked),
367
+ disabled: a
370
368
  }
371
369
  ),
372
- /* @__PURE__ */ a("span", { children: [
373
- "I accept the",
370
+ /* @__PURE__ */ r("span", { children: [
371
+ o("registrationForm.iAcceptThe", "I accept the"),
374
372
  " ",
375
- l ? /* @__PURE__ */ e("a", { href: l, target: "_blank", rel: "noopener noreferrer", children: "Terms" }) : "Terms",
376
- s && /* @__PURE__ */ a(ae, { children: [
373
+ l ? /* @__PURE__ */ e("a", { href: l, target: "_blank", rel: "noopener noreferrer", children: o("registrationForm.terms", "Terms") }) : o("registrationForm.terms", "Terms"),
374
+ c && /* @__PURE__ */ r(ce, { children: [
377
375
  " ",
378
- "and",
376
+ o("registrationForm.and", "and"),
379
377
  " ",
380
- /* @__PURE__ */ e("a", { href: s, target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" })
378
+ /* @__PURE__ */ e("a", { href: c, target: "_blank", rel: "noopener noreferrer", children: o("registrationForm.privacyPolicy", "Privacy Policy") })
381
379
  ] }),
382
380
  " *"
383
381
  ] })
@@ -388,21 +386,24 @@ const Y = /* @__PURE__ */ Object.assign(
388
386
  type: "submit",
389
387
  className: "nice-btn nice-btn--primary nice-register-form__submit",
390
388
  disabled: !D,
391
- children: t ? "…" : "Register"
389
+ children: a ? "…" : o("registrationForm.register", "Register")
392
390
  }
393
391
  ),
394
- n && /* @__PURE__ */ a("div", { className: "nice-register-form__login", children: [
395
- /* @__PURE__ */ e("span", { children: "Already have an account? " }),
396
- /* @__PURE__ */ e("button", { type: "button", onClick: n, children: "Sign in" })
392
+ t && /* @__PURE__ */ r("div", { className: "nice-register-form__login", children: [
393
+ /* @__PURE__ */ r("span", { children: [
394
+ o("registrationForm.alreadyHaveAnAccount", "Already have an account?"),
395
+ " "
396
+ ] }),
397
+ /* @__PURE__ */ e("button", { type: "button", onClick: t, children: o("registrationForm.signIn", "Sign in") })
397
398
  ] }),
398
- d && /* @__PURE__ */ e("div", { className: "nice-register-form__footer", children: d })
399
+ f && /* @__PURE__ */ e("div", { className: "nice-register-form__footer", children: f })
399
400
  ]
400
401
  }
401
402
  );
402
403
  }
403
404
  ),
404
405
  { displayName: "NiceRegistrationForm" }
405
- ), ue = ({ style: r }) => /* @__PURE__ */ e(
406
+ ), ge = ({ style: s }) => /* @__PURE__ */ e(
406
407
  "span",
407
408
  {
408
409
  "aria-hidden": "true",
@@ -414,10 +415,10 @@ const Y = /* @__PURE__ */ Object.assign(
414
415
  borderRight: "0.12em solid currentColor",
415
416
  borderBottom: "0.12em solid currentColor",
416
417
  transform: "rotate(45deg)",
417
- ...r
418
+ ...s
418
419
  }
419
420
  }
420
- ), re = ({ style: r }) => /* @__PURE__ */ e(
421
+ ), ie = ({ style: s }) => /* @__PURE__ */ e(
421
422
  "span",
422
423
  {
423
424
  "aria-hidden": "true",
@@ -429,22 +430,22 @@ const Y = /* @__PURE__ */ Object.assign(
429
430
  border: "0.12em solid currentColor",
430
431
  borderTopColor: "transparent",
431
432
  transform: "rotate(-45deg)",
432
- ...r
433
+ ...s
433
434
  }
434
435
  }
435
- ), ee = {
436
+ ), ae = {
436
437
  lowercase: "abcdefghijklmnopqrstuvwxyz",
437
438
  uppercase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
438
439
  digits: "0123456789",
439
440
  symbols: "!@#$%^&*()-_=+[]{};:,.?/~"
440
- }, me = /[0Oo1lI|]/g, W = {
441
+ }, fe = /[0Oo1lI|]/g, J = {
441
442
  length: 16,
442
443
  lowercase: !0,
443
444
  uppercase: !0,
444
445
  digits: !0,
445
446
  symbols: !0,
446
447
  excludeAmbiguous: !1
447
- }, pe = {
448
+ }, ne = {
448
449
  password: "Generated password",
449
450
  length: "Length",
450
451
  lowercase: "Lowercase (a–z)",
@@ -456,92 +457,100 @@ const Y = /* @__PURE__ */ Object.assign(
456
457
  copy: "Copy",
457
458
  copied: "Copied",
458
459
  noCharacterSets: "Pick at least one kind of character."
459
- }, fe = (r) => {
460
- const t = globalThis.crypto;
461
- if (!t || typeof t.getRandomValues != "function")
460
+ }, be = (s) => {
461
+ const a = globalThis.crypto;
462
+ if (!a || typeof a.getRandomValues != "function")
462
463
  throw new Error("generatePassword: crypto.getRandomValues is not available");
463
- return t.getRandomValues(r);
464
+ return a.getRandomValues(s);
464
465
  };
465
- let ge = 0;
466
- function J(r, t) {
467
- const c = Math.floor(4294967296 / r) * r, n = new Uint32Array(1);
466
+ let _e = 0;
467
+ function X(s, a) {
468
+ const n = Math.floor(4294967296 / s) * s, t = new Uint32Array(1);
468
469
  for (; ; ) {
469
- const i = t(n)[0];
470
- if (i < c)
471
- return i % r;
470
+ const i = a(t)[0];
471
+ if (i < n)
472
+ return i % s;
472
473
  }
473
474
  }
474
- function te(r = {}, t = fe) {
475
- const c = { ...W, ...r }, n = ["lowercase", "uppercase", "digits", "symbols"].filter((s) => c[s]).map((s) => c.excludeAmbiguous ? ee[s].replace(me, "") : ee[s]).filter((s) => s.length > 0);
476
- if (n.length === 0)
475
+ function re(s = {}, a = be) {
476
+ const n = { ...J, ...s }, t = ["lowercase", "uppercase", "digits", "symbols"].filter((c) => n[c]).map((c) => n.excludeAmbiguous ? ae[c].replace(fe, "") : ae[c]).filter((c) => c.length > 0);
477
+ if (t.length === 0)
477
478
  return "";
478
- const i = Math.max(n.length, Math.min(1024, Math.floor(c.length))), h = n.join(""), l = n.map((s) => s[J(s.length, t)]);
479
+ const i = Math.max(t.length, Math.min(1024, Math.floor(n.length))), d = t.join(""), l = t.map((c) => c[X(c.length, a)]);
479
480
  for (; l.length < i; )
480
- l.push(h[J(h.length, t)]);
481
- for (let s = l.length - 1; s > 0; s--) {
482
- const u = J(s + 1, t);
483
- [l[s], l[u]] = [l[u], l[s]];
481
+ l.push(d[X(d.length, a)]);
482
+ for (let c = l.length - 1; c > 0; c--) {
483
+ const h = X(c + 1, a);
484
+ [l[c], l[h]] = [l[h], l[c]];
484
485
  }
485
486
  return l.join("");
486
487
  }
487
- const Ae = ({
488
- value: r,
489
- defaultValue: t = "",
490
- onChange: c,
491
- options: n,
488
+ const Me = ({
489
+ value: s,
490
+ defaultValue: a = "",
491
+ onChange: n,
492
+ options: t,
492
493
  defaultOptions: i,
493
- onOptionsChange: h,
494
+ onOptionsChange: d,
494
495
  minLength: l = 8,
495
- maxLength: s = 64,
496
- showStrength: u = !0,
497
- showCopy: S = !0,
498
- onCopy: d,
499
- labels: A,
500
- disabled: b = !1,
501
- className: k,
502
- style: _,
503
- id: F
496
+ maxLength: c = 64,
497
+ showStrength: h = !0,
498
+ showCopy: x = !0,
499
+ onCopy: f,
500
+ labels: g,
501
+ disabled: S = !1,
502
+ className: y,
503
+ style: o,
504
+ id: w
504
505
  }) => {
505
- const o = { ...pe, ...A }, [p] = g(() => `nice-password-generator-${++ge}`), f = F ?? p, [M, w] = g(() => ({
506
- ...W,
506
+ const { t: m } = q(), p = {
507
+ ...Object.fromEntries(
508
+ Object.keys(ne).map((R) => [
509
+ R,
510
+ m(`passwordGenerator.${R}`, ne[R])
511
+ ])
512
+ ),
513
+ ...g
514
+ }, [b] = _(() => `nice-password-generator-${++_e}`), N = w ?? b, [I, k] = _(() => ({
515
+ ...J,
507
516
  ...i
508
- })), C = n ? { ...W, ...n } : M, [T, E] = g(
509
- () => r === void 0 && !t ? te({ ...W, ...i, ...n }) : t
510
- ), N = r ?? T, [I, O] = g(!1), x = H(void 0);
511
- Q(() => () => clearTimeout(x.current), []);
512
- const D = $(
513
- (P) => {
514
- r === void 0 && E(P), O(!1), c == null || c(P);
517
+ })), T = t ? { ...J, ...t } : I, [$, O] = _(
518
+ () => s === void 0 && !a ? re({ ...J, ...i, ...t }) : a
519
+ ), v = s ?? $, [E, L] = _(!1), A = Q(void 0);
520
+ Z(() => () => clearTimeout(A.current), []);
521
+ const D = M(
522
+ (R) => {
523
+ s === void 0 && O(R), L(!1), n == null || n(R);
515
524
  },
516
- [r, c]
517
- ), m = $(
518
- (P) => D(te(P)),
525
+ [s, n]
526
+ ), u = M(
527
+ (R) => D(re(R)),
519
528
  [D]
520
- ), v = (P, L) => {
521
- const q = { ...C, [P]: L };
522
- n || w(q), h == null || h(q), m(q);
523
- }, z = async () => {
524
- !N || !navigator.clipboard || (await navigator.clipboard.writeText(N), O(!0), clearTimeout(x.current), x.current = setTimeout(() => O(!1), 1500), d == null || d(N));
525
- }, R = !C.lowercase && !C.uppercase && !C.digits && !C.symbols, B = Math.min(s, Math.max(l, C.length));
526
- return /* @__PURE__ */ a(
529
+ ), C = (R, j) => {
530
+ const z = { ...T, [R]: j };
531
+ t || k(z), d == null || d(z), u(z);
532
+ }, H = async () => {
533
+ !v || !navigator.clipboard || (await navigator.clipboard.writeText(v), L(!0), clearTimeout(A.current), A.current = setTimeout(() => L(!1), 1500), f == null || f(v));
534
+ }, P = !T.lowercase && !T.uppercase && !T.digits && !T.symbols, U = Math.min(c, Math.max(l, T.length));
535
+ return /* @__PURE__ */ r(
527
536
  "div",
528
537
  {
529
- id: F,
530
- className: `nice-password-generator${k ? ` ${k}` : ""}`,
531
- style: _,
538
+ id: w,
539
+ className: `nice-password-generator${y ? ` ${y}` : ""}`,
540
+ style: o,
532
541
  children: [
533
- /* @__PURE__ */ a("div", { className: "nice-password-generator__output", children: [
542
+ /* @__PURE__ */ r("div", { className: "nice-password-generator__output", children: [
534
543
  /* @__PURE__ */ e(
535
544
  "input",
536
545
  {
537
- id: `${f}-value`,
546
+ id: `${N}-value`,
538
547
  className: "nice-password-generator__value",
539
548
  type: "text",
540
549
  readOnly: !0,
541
550
  spellCheck: !1,
542
551
  autoComplete: "off",
543
- value: N,
544
- "aria-label": o.password
552
+ value: v,
553
+ "aria-label": p.password
545
554
  }
546
555
  ),
547
556
  /* @__PURE__ */ e(
@@ -549,208 +558,224 @@ const Ae = ({
549
558
  {
550
559
  type: "button",
551
560
  className: "nice-password-generator__button",
552
- onClick: () => m(C),
553
- disabled: b || R,
554
- "aria-label": o.generate,
555
- title: o.generate,
556
- children: /* @__PURE__ */ e(re, {})
561
+ onClick: () => u(T),
562
+ disabled: S || P,
563
+ "aria-label": p.generate,
564
+ title: p.generate,
565
+ children: /* @__PURE__ */ e(ie, {})
557
566
  }
558
567
  ),
559
- S && /* @__PURE__ */ e(
568
+ x && /* @__PURE__ */ e(
560
569
  "button",
561
570
  {
562
571
  type: "button",
563
572
  className: "nice-password-generator__button nice-password-generator__button--copy",
564
- onClick: z,
565
- disabled: b || !N,
573
+ onClick: H,
574
+ disabled: S || !v,
566
575
  "aria-live": "polite",
567
- children: I ? /* @__PURE__ */ a(ae, { children: [
568
- /* @__PURE__ */ e(ue, {}),
576
+ children: E ? /* @__PURE__ */ r(ce, { children: [
577
+ /* @__PURE__ */ e(ge, {}),
569
578
  " ",
570
- o.copied
571
- ] }) : o.copy
579
+ p.copied
580
+ ] }) : p.copy
572
581
  }
573
582
  )
574
583
  ] }),
575
- u && /* @__PURE__ */ e(Y, { password: N }),
576
- /* @__PURE__ */ a("div", { className: "nice-password-generator__length", children: [
577
- /* @__PURE__ */ e("label", { htmlFor: `${f}-length`, children: o.length }),
584
+ h && /* @__PURE__ */ e(te, { password: v }),
585
+ /* @__PURE__ */ r("div", { className: "nice-password-generator__length", children: [
586
+ /* @__PURE__ */ e("label", { htmlFor: `${N}-length`, children: p.length }),
578
587
  /* @__PURE__ */ e(
579
588
  "input",
580
589
  {
581
- id: `${f}-length`,
590
+ id: `${N}-length`,
582
591
  type: "range",
583
592
  min: l,
584
- max: s,
585
- value: B,
586
- disabled: b,
587
- onChange: (P) => v("length", Number(P.target.value))
593
+ max: c,
594
+ value: U,
595
+ disabled: S,
596
+ onChange: (R) => C("length", Number(R.target.value))
588
597
  }
589
598
  ),
590
- /* @__PURE__ */ e("output", { htmlFor: `${f}-length`, className: "nice-password-generator__length-value", children: B })
599
+ /* @__PURE__ */ e("output", { htmlFor: `${N}-length`, className: "nice-password-generator__length-value", children: U })
591
600
  ] }),
592
601
  /* @__PURE__ */ e("div", { className: "nice-password-generator__sets", children: ["lowercase", "uppercase", "digits", "symbols", "excludeAmbiguous"].map(
593
- (P) => /* @__PURE__ */ a("label", { className: "nice-password-generator__option", children: [
602
+ (R) => /* @__PURE__ */ r("label", { className: "nice-password-generator__option", children: [
594
603
  /* @__PURE__ */ e(
595
604
  "input",
596
605
  {
597
606
  type: "checkbox",
598
- checked: C[P],
599
- disabled: b,
600
- onChange: (L) => v(P, L.target.checked)
607
+ checked: T[R],
608
+ disabled: S,
609
+ onChange: (j) => C(R, j.target.checked)
601
610
  }
602
611
  ),
603
- o[P]
604
- ] }, P)
612
+ p[R]
613
+ ] }, R)
605
614
  ) }),
606
- R && /* @__PURE__ */ e("p", { className: "nice-password-generator__error", role: "alert", children: o.noCharacterSets })
615
+ P && /* @__PURE__ */ e("p", { className: "nice-password-generator__error", role: "alert", children: p.noCharacterSets })
607
616
  ]
608
617
  }
609
618
  );
610
- }, Se = /* @__PURE__ */ Object.assign(
611
- /* @__PURE__ */ G(
619
+ }, $e = /* @__PURE__ */ Object.assign(
620
+ /* @__PURE__ */ K(
612
621
  ({
613
- requireCurrentPassword: r = !0,
614
- onSubmit: t,
615
- loading: c = !1,
616
- error: n,
622
+ requireCurrentPassword: s = !0,
623
+ onSubmit: a,
624
+ loading: n = !1,
625
+ error: t,
617
626
  success: i,
618
- minPasswordStrength: h = 2,
619
- title: l = "Change Password",
620
- className: s,
621
- style: u
622
- }, S) => {
623
- const [d, A] = g(""), [b, k] = g(""), [_, F] = g(""), o = X(b), p = b === _, f = (!r || d.length > 0) && b.length > 0 && p && o >= h && !c, M = $(
624
- (w) => {
625
- w.preventDefault(), f && (t == null || t({
626
- currentPassword: r ? d : void 0,
627
- newPassword: b
627
+ minPasswordStrength: d = 2,
628
+ title: l,
629
+ className: c,
630
+ style: h
631
+ }, x) => {
632
+ const { t: f } = q(), [g, S] = _(""), [y, o] = _(""), [w, m] = _(""), p = ee(y), b = y === w, N = (!s || g.length > 0) && y.length > 0 && b && p >= d && !n, I = M(
633
+ (k) => {
634
+ k.preventDefault(), N && (a == null || a({
635
+ currentPassword: s ? g : void 0,
636
+ newPassword: y
628
637
  }));
629
638
  },
630
- [f, d, b, r, t]
639
+ [N, g, y, s, a]
631
640
  );
632
- return /* @__PURE__ */ a(
641
+ return /* @__PURE__ */ r(
633
642
  "form",
634
643
  {
635
- ref: S,
636
- className: `nice-change-password${s ? ` ${s}` : ""}`,
637
- style: u,
638
- onSubmit: M,
644
+ ref: x,
645
+ className: `nice-change-password${c ? ` ${c}` : ""}`,
646
+ style: h,
647
+ onSubmit: I,
639
648
  noValidate: !0,
640
649
  children: [
641
- /* @__PURE__ */ e("h3", { className: "nice-change-password__title", children: l }),
642
- n && /* @__PURE__ */ e("div", { className: "nice-change-password__error", role: "alert", children: n }),
650
+ /* @__PURE__ */ e("h3", { className: "nice-change-password__title", children: l ?? f("changePassword.title", "Change Password") }),
651
+ t && /* @__PURE__ */ e("div", { className: "nice-change-password__error", role: "alert", children: t }),
643
652
  i && /* @__PURE__ */ e("div", { className: "nice-change-password__success", role: "status", children: i }),
644
- r && /* @__PURE__ */ a("div", { className: "nice-change-password__field", children: [
645
- /* @__PURE__ */ e("label", { htmlFor: "nice-cp-current", children: "Current password" }),
653
+ s && /* @__PURE__ */ r("div", { className: "nice-change-password__field", children: [
654
+ /* @__PURE__ */ e("label", { htmlFor: "nice-cp-current", children: f("changePassword.currentPassword", "Current password") }),
646
655
  /* @__PURE__ */ e(
647
656
  "input",
648
657
  {
649
658
  id: "nice-cp-current",
650
659
  className: "nice-input",
651
660
  type: "password",
652
- value: d,
653
- onChange: (w) => A(w.target.value),
661
+ value: g,
662
+ onChange: (k) => S(k.target.value),
654
663
  autoComplete: "current-password",
655
- disabled: c,
664
+ disabled: n,
656
665
  required: !0
657
666
  }
658
667
  )
659
668
  ] }),
660
- /* @__PURE__ */ a("div", { className: "nice-change-password__field", children: [
661
- /* @__PURE__ */ e("label", { htmlFor: "nice-cp-new", children: "New password" }),
669
+ /* @__PURE__ */ r("div", { className: "nice-change-password__field", children: [
670
+ /* @__PURE__ */ e("label", { htmlFor: "nice-cp-new", children: f("changePassword.newPassword", "New password") }),
662
671
  /* @__PURE__ */ e(
663
672
  "input",
664
673
  {
665
674
  id: "nice-cp-new",
666
675
  className: "nice-input",
667
676
  type: "password",
668
- value: b,
669
- onChange: (w) => k(w.target.value),
677
+ value: y,
678
+ onChange: (k) => o(k.target.value),
670
679
  autoComplete: "new-password",
671
- disabled: c,
680
+ disabled: n,
672
681
  required: !0
673
682
  }
674
683
  ),
675
- b.length > 0 && /* @__PURE__ */ e(Y, { password: b })
684
+ y.length > 0 && /* @__PURE__ */ e(te, { password: y })
676
685
  ] }),
677
- /* @__PURE__ */ a("div", { className: "nice-change-password__field", children: [
678
- /* @__PURE__ */ e("label", { htmlFor: "nice-cp-confirm", children: "Confirm new password" }),
686
+ /* @__PURE__ */ r("div", { className: "nice-change-password__field", children: [
687
+ /* @__PURE__ */ e("label", { htmlFor: "nice-cp-confirm", children: f("changePassword.confirmNewPassword", "Confirm new password") }),
679
688
  /* @__PURE__ */ e(
680
689
  "input",
681
690
  {
682
691
  id: "nice-cp-confirm",
683
692
  className: "nice-input",
684
693
  type: "password",
685
- value: _,
686
- onChange: (w) => F(w.target.value),
694
+ value: w,
695
+ onChange: (k) => m(k.target.value),
687
696
  autoComplete: "new-password",
688
- disabled: c,
697
+ disabled: n,
689
698
  required: !0
690
699
  }
691
700
  ),
692
- _ && !p && /* @__PURE__ */ e("span", { className: "nice-error-text", children: "Passwords do not match" })
701
+ w && !b && /* @__PURE__ */ e("span", { className: "nice-error-text", children: f("changePassword.passwordsDoNotMatch", "Passwords do not match") })
693
702
  ] }),
694
- /* @__PURE__ */ e("button", { type: "submit", className: "nice-btn nice-btn--primary", disabled: !f, children: c ? "…" : "Change Password" })
703
+ /* @__PURE__ */ e("button", { type: "submit", className: "nice-btn nice-btn--primary", disabled: !N, children: n ? "…" : f("changePassword.changePassword", "Change Password") })
695
704
  ]
696
705
  }
697
706
  );
698
707
  }
699
708
  ),
700
709
  { displayName: "NiceChangePassword" }
701
- ), Te = /* @__PURE__ */ Object.assign(
702
- /* @__PURE__ */ G(
710
+ ), Pe = /* @__PURE__ */ Object.assign(
711
+ /* @__PURE__ */ K(
703
712
  ({
704
- secret: r,
705
- qrCodeUrl: t,
706
- issuer: c,
707
- accountName: n,
713
+ secret: s,
714
+ qrCodeUrl: a,
715
+ issuer: n,
716
+ accountName: t,
708
717
  onVerify: i,
709
- loading: h = !1,
718
+ loading: d = !1,
710
719
  error: l,
711
- onCancel: s,
712
- recoveryCodes: u,
713
- step: S = "setup",
714
- onStepChange: d,
715
- className: A,
716
- style: b
717
- }, k) => {
718
- const [_, F] = g(""), [o, p] = g(!1), [f, M] = g(!1), w = $(
719
- (T) => {
720
- T.preventDefault(), _.length >= 6 && (i == null || i(_));
720
+ onCancel: c,
721
+ recoveryCodes: h,
722
+ step: x = "setup",
723
+ onStepChange: f,
724
+ className: g,
725
+ style: S
726
+ }, y) => {
727
+ const { t: o } = q(), [w, m] = _(""), [p, b] = _(!1), [N, I] = _(!1), k = M(
728
+ ($) => {
729
+ $.preventDefault(), w.length >= 6 && (i == null || i(w));
721
730
  },
722
- [_, i]
723
- ), C = `otpauth://totp/${c ? `${c}:` : ""}${n ?? "user"}?secret=${r}${c ? `&issuer=${c}` : ""}&digits=6&period=30`;
724
- return /* @__PURE__ */ a(
731
+ [w, i]
732
+ ), T = `otpauth://totp/${n ? `${n}:` : ""}${t ?? "user"}?secret=${s}${n ? `&issuer=${n}` : ""}&digits=6&period=30`;
733
+ return /* @__PURE__ */ r(
725
734
  "div",
726
735
  {
727
- ref: k,
728
- className: `nice-2fa-setup${A ? ` ${A}` : ""}`,
729
- style: b,
736
+ ref: y,
737
+ className: `nice-2fa-setup${g ? ` ${g}` : ""}`,
738
+ style: S,
730
739
  children: [
731
- /* @__PURE__ */ e("h3", { className: "nice-2fa-setup__title", children: "Two-Factor Authentication" }),
732
- S === "setup" && /* @__PURE__ */ a("div", { className: "nice-2fa-setup__step", children: [
733
- /* @__PURE__ */ e("p", { className: "nice-2fa-setup__instruction", children: "Scan this QR code with your authenticator app (Google Authenticator, Authy, etc.):" }),
734
- t ? /* @__PURE__ */ e("img", { src: t, alt: "2FA QR Code", className: "nice-2fa-setup__qr" }) : /* @__PURE__ */ a("div", { className: "nice-2fa-setup__qr-placeholder", children: [
735
- /* @__PURE__ */ e("span", { children: "QR Code" }),
736
- /* @__PURE__ */ e("code", { className: "nice-2fa-setup__uri", children: C })
740
+ /* @__PURE__ */ e("h3", { className: "nice-2fa-setup__title", children: o("twoFaSetup.twoFactorAuthentication", "Two-Factor Authentication") }),
741
+ x === "setup" && /* @__PURE__ */ r("div", { className: "nice-2fa-setup__step", children: [
742
+ /* @__PURE__ */ e("p", { className: "nice-2fa-setup__instruction", children: o(
743
+ "twoFaSetup.scanThisQrCodeWith",
744
+ "Scan this QR code with your authenticator app (Google Authenticator, Authy, etc.):"
745
+ ) }),
746
+ a ? /* @__PURE__ */ e(
747
+ "img",
748
+ {
749
+ src: a,
750
+ alt: o("twoFaSetup.n2faQrCode", "2FA QR Code"),
751
+ className: "nice-2fa-setup__qr"
752
+ }
753
+ ) : /* @__PURE__ */ r("div", { className: "nice-2fa-setup__qr-placeholder", children: [
754
+ /* @__PURE__ */ e("span", { children: o("twoFaSetup.qrCode", "QR Code") }),
755
+ /* @__PURE__ */ e("code", { className: "nice-2fa-setup__uri", children: T })
737
756
  ] }),
738
- /* @__PURE__ */ a("div", { className: "nice-2fa-setup__secret", children: [
739
- /* @__PURE__ */ e("span", { children: "Or enter manually: " }),
740
- o ? /* @__PURE__ */ e("code", { className: "nice-2fa-setup__secret-key", children: r }) : /* @__PURE__ */ e("button", { type: "button", onClick: () => p(!0), children: "Show secret key" })
757
+ /* @__PURE__ */ r("div", { className: "nice-2fa-setup__secret", children: [
758
+ /* @__PURE__ */ r("span", { children: [
759
+ o("twoFaSetup.orEnterManually", "Or enter manually:"),
760
+ " "
761
+ ] }),
762
+ p ? /* @__PURE__ */ e("code", { className: "nice-2fa-setup__secret-key", children: s }) : /* @__PURE__ */ e("button", { type: "button", onClick: () => b(!0), children: o("twoFaSetup.showSecretKey", "Show secret key") })
741
763
  ] }),
742
764
  /* @__PURE__ */ e(
743
765
  "button",
744
766
  {
745
767
  type: "button",
746
768
  className: "nice-btn nice-btn--primary",
747
- onClick: () => d == null ? void 0 : d("verify"),
748
- children: "Next — Verify"
769
+ onClick: () => f == null ? void 0 : f("verify"),
770
+ children: o("twoFaSetup.nextVerify", "Next — Verify")
749
771
  }
750
772
  )
751
773
  ] }),
752
- S === "verify" && /* @__PURE__ */ a("form", { className: "nice-2fa-setup__step", onSubmit: w, children: [
753
- /* @__PURE__ */ e("p", { className: "nice-2fa-setup__instruction", children: "Enter the 6-digit code from your authenticator app:" }),
774
+ x === "verify" && /* @__PURE__ */ r("form", { className: "nice-2fa-setup__step", onSubmit: k, children: [
775
+ /* @__PURE__ */ e("p", { className: "nice-2fa-setup__instruction", children: o(
776
+ "twoFaSetup.enterThe6DigitCode",
777
+ "Enter the 6-digit code from your authenticator app:"
778
+ ) }),
754
779
  l && /* @__PURE__ */ e("div", { className: "nice-2fa-setup__error", role: "alert", children: l }),
755
780
  /* @__PURE__ */ e(
756
781
  "input",
@@ -759,216 +784,218 @@ const Ae = ({
759
784
  type: "text",
760
785
  inputMode: "numeric",
761
786
  maxLength: 6,
762
- value: _,
763
- onChange: (T) => F(T.target.value.replace(/\D/g, "").slice(0, 6)),
787
+ value: w,
788
+ onChange: ($) => m($.target.value.replace(/\D/g, "").slice(0, 6)),
764
789
  placeholder: "000000",
765
790
  autoFocus: !0,
766
- disabled: h,
791
+ disabled: d,
767
792
  autoComplete: "one-time-code"
768
793
  }
769
794
  ),
770
- /* @__PURE__ */ a("div", { className: "nice-2fa-setup__actions", children: [
771
- /* @__PURE__ */ e("button", { type: "button", className: "nice-btn", onClick: () => d == null ? void 0 : d("setup"), children: "Back" }),
795
+ /* @__PURE__ */ r("div", { className: "nice-2fa-setup__actions", children: [
796
+ /* @__PURE__ */ e("button", { type: "button", className: "nice-btn", onClick: () => f == null ? void 0 : f("setup"), children: o("twoFaSetup.back", "Back") }),
772
797
  /* @__PURE__ */ e(
773
798
  "button",
774
799
  {
775
800
  type: "submit",
776
801
  className: "nice-btn nice-btn--primary",
777
- disabled: h || _.length < 6,
778
- children: h ? "…" : "Verify"
802
+ disabled: d || w.length < 6,
803
+ children: d ? "…" : o("twoFaSetup.verify", "Verify")
779
804
  }
780
805
  )
781
806
  ] })
782
807
  ] }),
783
- S === "recovery" && u && /* @__PURE__ */ a("div", { className: "nice-2fa-setup__step", children: [
784
- /* @__PURE__ */ e("p", { className: "nice-2fa-setup__instruction", children: "Save these recovery codes in a safe place. Each code can only be used once:" }),
785
- /* @__PURE__ */ e("div", { className: "nice-2fa-setup__recovery-codes", children: u.map((T, E) => /* @__PURE__ */ e("code", { className: "nice-2fa-setup__recovery-code", children: T }, E)) }),
808
+ x === "recovery" && h && /* @__PURE__ */ r("div", { className: "nice-2fa-setup__step", children: [
809
+ /* @__PURE__ */ e("p", { className: "nice-2fa-setup__instruction", children: o(
810
+ "twoFaSetup.saveTheseRecoveryCodesIn",
811
+ "Save these recovery codes in a safe place. Each code can only be used once:"
812
+ ) }),
813
+ /* @__PURE__ */ e("div", { className: "nice-2fa-setup__recovery-codes", children: h.map(($, O) => /* @__PURE__ */ e("code", { className: "nice-2fa-setup__recovery-code", children: $ }, O)) }),
786
814
  /* @__PURE__ */ e(
787
815
  "button",
788
816
  {
789
817
  type: "button",
790
818
  className: "nice-btn",
791
819
  onClick: () => {
792
- var T;
793
- (T = navigator.clipboard) == null || T.writeText(u.join(`
794
- `)), M(!0);
820
+ var $;
821
+ ($ = navigator.clipboard) == null || $.writeText(h.join(`
822
+ `)), I(!0);
795
823
  },
796
- children: f ? "Copied!" : "Copy all codes"
824
+ children: N ? o("twoFaSetup.copied", "Copied!") : o("twoFaSetup.copyAllCodes", "Copy all codes")
797
825
  }
798
826
  ),
799
- s && /* @__PURE__ */ e("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: s, children: "Done" })
827
+ c && /* @__PURE__ */ e("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: c, children: o("twoFaSetup.done", "Done") })
800
828
  ] }),
801
- s && S !== "recovery" && /* @__PURE__ */ e("button", { type: "button", className: "nice-2fa-setup__cancel", onClick: s, children: "Cancel" })
829
+ c && x !== "recovery" && /* @__PURE__ */ e("button", { type: "button", className: "nice-2fa-setup__cancel", onClick: c, children: o("twoFaSetup.cancel", "Cancel") })
802
830
  ]
803
831
  }
804
832
  );
805
833
  }
806
834
  ),
807
835
  { displayName: "NiceTwoFaSetup" }
808
- ), be = 500;
809
- function V(r, t) {
810
- return Math.floor(Math.random() * (t - r + 1)) + r;
836
+ ), we = 500;
837
+ function V(s, a) {
838
+ return Math.floor(Math.random() * (a - s + 1)) + s;
811
839
  }
812
- function _e() {
840
+ function Ne() {
813
841
  return `${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;
814
842
  }
815
- function Ne(r, t) {
816
- switch (r) {
843
+ function ve(s, a) {
844
+ switch (s) {
817
845
  case "math": {
818
- const c = t === "easy" ? 5 : t === "hard" ? 20 : 10, n = V(1, c), i = V(1, c), h = t !== "easy" && n >= i && Math.random() < 0.5, l = h ? n - i : n + i;
819
- return { kind: "math", prompt: `${n} ${h ? "−" : "+"} ${i}`, answer: l };
846
+ const n = a === "easy" ? 5 : a === "hard" ? 20 : 10, t = V(1, n), i = V(1, n), d = a !== "easy" && t >= i && Math.random() < 0.5, l = d ? t - i : t + i;
847
+ return { kind: "math", prompt: `${t} ${d ? "−" : "+"} ${i}`, answer: l };
820
848
  }
821
849
  case "text": {
822
- const c = t === "easy" ? 4 : t === "hard" ? 7 : 5, n = "ABCDEFGHJKMNPQRSTUVWXYZ23456789";
850
+ const n = a === "easy" ? 4 : a === "hard" ? 7 : 5, t = "ABCDEFGHJKMNPQRSTUVWXYZ23456789";
823
851
  let i = "";
824
- for (let h = 0; h < c; h++)
825
- i += n[V(0, n.length - 1)];
852
+ for (let d = 0; d < n; d++)
853
+ i += t[V(0, t.length - 1)];
826
854
  return { kind: "text", text: i };
827
855
  }
828
856
  case "slider":
829
- return { kind: "slider", target: V(70, 92), tolerance: t === "easy" ? 8 : t === "hard" ? 2 : 4 };
857
+ return { kind: "slider", target: V(70, 92), tolerance: a === "easy" ? 8 : a === "hard" ? 2 : 4 };
830
858
  case "checkbox":
831
859
  default:
832
860
  return { kind: "checkbox" };
833
861
  }
834
862
  }
835
- function we(r, t, c) {
836
- if (!r)
863
+ function ye(s, a, n) {
864
+ if (!s)
837
865
  return;
838
- const n = r.getContext("2d");
839
- if (!n)
866
+ const t = s.getContext("2d");
867
+ if (!t)
840
868
  return;
841
- const i = r.width, h = r.height;
842
- n.clearRect(0, 0, i, h), n.fillStyle = c ? "#1a1a1a" : "#f3f4f6", n.fillRect(0, 0, i, h), n.strokeStyle = c ? "rgba(255,255,255,0.18)" : "rgba(0,0,0,0.18)", n.lineWidth = 1;
843
- for (let s = 0; s < 6; s++)
844
- n.beginPath(), n.moveTo(V(0, i), V(0, h)), n.lineTo(V(0, i), V(0, h)), n.stroke();
845
- n.fillStyle = c ? "#e5e7eb" : "#111827", n.textBaseline = "middle";
846
- const l = i / (t.length + 1);
847
- for (let s = 0; s < t.length; s++) {
848
- const u = V(22, 30);
849
- n.save(), n.translate(l * (s + 1), h / 2 + V(-4, 4)), n.rotate(V(-22, 22) * Math.PI / 180), n.font = `bold ${u}px monospace`, n.fillText(t[s], -u / 3, 0), n.restore();
869
+ const i = s.width, d = s.height;
870
+ t.clearRect(0, 0, i, d), t.fillStyle = n ? "#1a1a1a" : "#f3f4f6", t.fillRect(0, 0, i, d), t.strokeStyle = n ? "rgba(255,255,255,0.18)" : "rgba(0,0,0,0.18)", t.lineWidth = 1;
871
+ for (let c = 0; c < 6; c++)
872
+ t.beginPath(), t.moveTo(V(0, i), V(0, d)), t.lineTo(V(0, i), V(0, d)), t.stroke();
873
+ t.fillStyle = n ? "#e5e7eb" : "#111827", t.textBaseline = "middle";
874
+ const l = i / (a.length + 1);
875
+ for (let c = 0; c < a.length; c++) {
876
+ const h = V(22, 30);
877
+ t.save(), t.translate(l * (c + 1), d / 2 + V(-4, 4)), t.rotate(V(-22, 22) * Math.PI / 180), t.font = `bold ${h}px monospace`, t.fillText(a[c], -h / 3, 0), t.restore();
850
878
  }
851
879
  }
852
880
  const Re = /* @__PURE__ */ Object.assign(
853
- /* @__PURE__ */ G((r, t) => {
854
- const {
855
- variant: c,
856
- difficulty: n = "medium",
857
- refreshable: i = !0,
858
- verifyToken: h,
859
- expiresMs: l,
860
- label: s = "I'm not a robot",
861
- provider: u = "custom",
862
- siteKey: S,
863
- onVerify: d,
864
- onExpire: A,
865
- onError: b,
866
- onRefresh: k,
867
- theme: _ = "light",
868
- size: F = "normal",
869
- customRender: o,
870
- className: p,
871
- style: f
872
- } = r, M = H(null), w = H(null), C = H(void 0), [T, E] = g(0), [N, I] = g("idle"), [O, x] = g(""), [D, m] = g(""), [v, z] = g(0), R = ne(
873
- () => Ne(c ?? "checkbox", n),
874
- [c, n, T]
875
- ), B = $(() => {
876
- I("idle"), x(""), m(""), z(0), E((y) => y + 1);
877
- }, []), P = $(() => {
878
- B(), k == null || k();
879
- }, [B, k]);
880
- oe(
881
- t,
882
- () => ({ reset: B, refresh: P, container: M.current }),
883
- [B, P]
884
- ), Q(() => {
885
- c === "text" && R.kind === "text" && we(w.current, R.text, _ === "dark");
886
- }, [c, R, _]), Q(() => {
887
- if (N !== "verified" || !l)
881
+ /* @__PURE__ */ K((s, a) => {
882
+ const { t: n } = q(), {
883
+ variant: t,
884
+ difficulty: i = "medium",
885
+ refreshable: d = !0,
886
+ verifyToken: l,
887
+ expiresMs: c,
888
+ label: h = n("captcha.imNotARobot", "I'm not a robot"),
889
+ provider: x = "custom",
890
+ siteKey: f,
891
+ onVerify: g,
892
+ onExpire: S,
893
+ onError: y,
894
+ onRefresh: o,
895
+ theme: w = "light",
896
+ size: m = "normal",
897
+ customRender: p,
898
+ className: b,
899
+ style: N
900
+ } = s, I = Q(null), k = Q(null), T = Q(void 0), [$, O] = _(0), [v, E] = _("idle"), [L, A] = _(""), [D, u] = _(""), [C, H] = _(0), P = se(() => ve(t ?? "checkbox", i), [t, i, $]), U = M(() => {
901
+ E("idle"), A(""), u(""), H(0), O((F) => F + 1);
902
+ }, []), R = M(() => {
903
+ U(), o == null || o();
904
+ }, [U, o]);
905
+ me(
906
+ a,
907
+ () => ({ reset: U, refresh: R, container: I.current }),
908
+ [U, R]
909
+ ), Z(() => {
910
+ t === "text" && P.kind === "text" && ye(k.current, P.text, w === "dark");
911
+ }, [t, P, w]), Z(() => {
912
+ if (v !== "verified" || !c)
888
913
  return;
889
- const y = setTimeout(() => {
890
- A == null || A(), B();
891
- }, l);
892
- return () => clearTimeout(y);
893
- }, [N, l, A, B]);
894
- const L = $(() => {
895
- const y = `ntd-cap:${c}:${_e()}`;
896
- h ? (I("verifying"), x(""), Promise.resolve().then(() => h(y)).then((Z) => {
897
- Z ? (I("verified"), d == null || d(y)) : (I("error"), x("Verification failed. Please try again."), E((le) => le + 1), m(""));
898
- }).catch((Z) => {
899
- I("error"), x("Verification error. Please try again."), b == null || b(Z);
900
- })) : (I("verified"), d == null || d(y));
901
- }, [c, h, d, b]), q = $(() => {
902
- I("error"), x("Incorrect, please try again."), E((y) => y + 1), m("");
903
- }, []), ce = $(() => {
904
- N === "verifying" || N === "verified" || (I("verifying"), x(""), C.current = setTimeout(L, be));
905
- }, [N, L]);
906
- Q(() => () => clearTimeout(C.current), []);
907
- const K = $(() => {
908
- R.kind === "math" ? D.trim() !== "" && Number(D) === R.answer ? L() : q() : R.kind === "text" && (D.trim().toUpperCase() === R.text ? L() : q());
909
- }, [R, D, L, q]), se = $(
910
- (y) => {
911
- z(y), !(R.kind !== "slider" || N === "verified" || N === "verifying") && Math.abs(y - R.target) <= R.tolerance && L();
914
+ const F = setTimeout(() => {
915
+ S == null || S(), U();
916
+ }, c);
917
+ return () => clearTimeout(F);
918
+ }, [v, c, S, U]);
919
+ const j = M(() => {
920
+ const F = `ntd-cap:${t}:${Ne()}`;
921
+ l ? (E("verifying"), A(""), Promise.resolve().then(() => l(F)).then((Y) => {
922
+ Y ? (E("verified"), g == null || g(F)) : (E("error"), A(
923
+ n(
924
+ "captcha.verificationFailedPleaseTryAgain",
925
+ "Verification failed. Please try again."
926
+ )
927
+ ), O((he) => he + 1), u(""));
928
+ }).catch((Y) => {
929
+ E("error"), A(
930
+ n("captcha.verificationErrorPleaseTryAgain", "Verification error. Please try again.")
931
+ ), y == null || y(Y);
932
+ })) : (E("verified"), g == null || g(F));
933
+ }, [t, l, g, y, n]), z = M(() => {
934
+ E("error"), A(n("captcha.incorrectPleaseTryAgain", "Incorrect, please try again.")), O((F) => F + 1), u("");
935
+ }, [n]), oe = M(() => {
936
+ v === "verifying" || v === "verified" || (E("verifying"), A(""), T.current = setTimeout(j, we));
937
+ }, [v, j]);
938
+ Z(() => () => clearTimeout(T.current), []);
939
+ const W = M(() => {
940
+ P.kind === "math" ? D.trim() !== "" && Number(D) === P.answer ? j() : z() : P.kind === "text" && (D.trim().toUpperCase() === P.text ? j() : z());
941
+ }, [P, D, j, z]), le = M(
942
+ (F) => {
943
+ H(F), !(P.kind !== "slider" || v === "verified" || v === "verifying") && Math.abs(F - P.target) <= P.tolerance && j();
912
944
  },
913
- [R, N, L]
945
+ [P, v, j]
914
946
  );
915
- if (!c)
916
- return u === "custom" && o ? /* @__PURE__ */ e(
947
+ if (!t)
948
+ return x === "custom" && p ? /* @__PURE__ */ e(
917
949
  "div",
918
950
  {
919
- ref: M,
920
- className: `nice-captcha nice-captcha--custom${p ? ` ${p}` : ""}`,
921
- style: f,
922
- children: o
951
+ ref: I,
952
+ className: `nice-captcha nice-captcha--custom${b ? ` ${b}` : ""}`,
953
+ style: N,
954
+ children: p
923
955
  }
924
956
  ) : /* @__PURE__ */ e(
925
957
  "div",
926
958
  {
927
- ref: M,
928
- className: `nice-captcha nice-captcha--${u} nice-captcha--${_}${F === "compact" ? " nice-captcha--compact" : ""}${p ? ` ${p}` : ""}`,
929
- style: f,
930
- "data-sitekey": S,
931
- "data-theme": _,
932
- "data-size": F,
933
- children: /* @__PURE__ */ a("div", { className: "nice-captcha__placeholder", children: [
934
- /* @__PURE__ */ a("span", { children: [
935
- "Captcha (",
936
- u,
937
- ")"
938
- ] }),
939
- /* @__PURE__ */ a("p", { children: [
940
- "Load the ",
941
- u,
942
- " SDK to activate verification."
943
- ] })
959
+ ref: I,
960
+ className: `nice-captcha nice-captcha--${x} nice-captcha--${w}${m === "compact" ? " nice-captcha--compact" : ""}${b ? ` ${b}` : ""}`,
961
+ style: N,
962
+ "data-sitekey": f,
963
+ "data-theme": w,
964
+ "data-size": m,
965
+ children: /* @__PURE__ */ r("div", { className: "nice-captcha__placeholder", children: [
966
+ /* @__PURE__ */ e("span", { children: n("captcha.captcha", "Captcha ({provider})").replace("{provider}", String(x)) }),
967
+ /* @__PURE__ */ e("p", { children: n(
968
+ "captcha.loadTheSdkToActivate",
969
+ "Load the {provider} SDK to activate verification."
970
+ ).replace("{provider}", String(x)) })
944
971
  ] })
945
972
  }
946
973
  );
947
- const j = N === "verifying", U = N === "verified", ie = `nice-captcha nice-captcha--${c} nice-captcha--${_} nice-captcha--${N}${F === "compact" ? " nice-captcha--compact" : ""}${p ? ` ${p}` : ""}`;
948
- return /* @__PURE__ */ a(
974
+ const B = v === "verifying", G = v === "verified", de = `nice-captcha nice-captcha--${t} nice-captcha--${w} nice-captcha--${v}${m === "compact" ? " nice-captcha--compact" : ""}${b ? ` ${b}` : ""}`;
975
+ return /* @__PURE__ */ r(
949
976
  "div",
950
977
  {
951
- ref: M,
952
- className: ie,
953
- style: f,
978
+ ref: I,
979
+ className: de,
980
+ style: N,
954
981
  role: "group",
955
- "aria-label": "Captcha challenge",
956
- "data-variant": c,
957
- "data-status": N,
958
- "data-theme": _,
982
+ "aria-label": n("captcha.captchaChallenge", "Captcha challenge"),
983
+ "data-variant": t,
984
+ "data-status": v,
985
+ "data-theme": w,
959
986
  children: [
960
- c === "checkbox" && /* @__PURE__ */ a(
987
+ t === "checkbox" && /* @__PURE__ */ r(
961
988
  "button",
962
989
  {
963
990
  type: "button",
964
991
  className: "nice-captcha__checkbox",
965
992
  role: "checkbox",
966
- "aria-checked": U,
967
- "aria-busy": j,
968
- disabled: j || U,
969
- onClick: ce,
993
+ "aria-checked": G,
994
+ "aria-busy": B,
995
+ disabled: B || G,
996
+ onClick: oe,
970
997
  children: [
971
- /* @__PURE__ */ e("span", { className: "nice-captcha__box", "aria-hidden": "true", children: j ? "…" : U ? /* @__PURE__ */ e(
998
+ /* @__PURE__ */ e("span", { className: "nice-captcha__box", "aria-hidden": "true", children: B ? "…" : G ? /* @__PURE__ */ e(
972
999
  "span",
973
1000
  {
974
1001
  style: {
@@ -982,13 +1009,13 @@ const Re = /* @__PURE__ */ Object.assign(
982
1009
  }
983
1010
  }
984
1011
  ) : "" }),
985
- /* @__PURE__ */ e("span", { className: "nice-captcha__label", children: s })
1012
+ /* @__PURE__ */ e("span", { className: "nice-captcha__label", children: h })
986
1013
  ]
987
1014
  }
988
1015
  ),
989
- c === "math" && R.kind === "math" && /* @__PURE__ */ a("div", { className: "nice-captcha__challenge", children: [
990
- /* @__PURE__ */ a("span", { className: "nice-captcha__prompt", "aria-hidden": "true", children: [
991
- R.prompt,
1016
+ t === "math" && P.kind === "math" && /* @__PURE__ */ r("div", { className: "nice-captcha__challenge", children: [
1017
+ /* @__PURE__ */ r("span", { className: "nice-captcha__prompt", "aria-hidden": "true", children: [
1018
+ P.prompt,
992
1019
  " ="
993
1020
  ] }),
994
1021
  /* @__PURE__ */ e(
@@ -998,11 +1025,14 @@ const Re = /* @__PURE__ */ Object.assign(
998
1025
  type: "number",
999
1026
  inputMode: "numeric",
1000
1027
  value: D,
1001
- "aria-label": `What is ${R.prompt}?`,
1002
- disabled: j || U,
1003
- onChange: (y) => m(y.target.value),
1004
- onKeyDown: (y) => {
1005
- y.key === "Enter" && (y.preventDefault(), K());
1028
+ "aria-label": n("captcha.whatIs", "What is {prompt}?").replace(
1029
+ "{prompt}",
1030
+ String(P.prompt)
1031
+ ),
1032
+ disabled: B || G,
1033
+ onChange: (F) => u(F.target.value),
1034
+ onKeyDown: (F) => {
1035
+ F.key === "Enter" && (F.preventDefault(), W());
1006
1036
  }
1007
1037
  }
1008
1038
  ),
@@ -1011,17 +1041,17 @@ const Re = /* @__PURE__ */ Object.assign(
1011
1041
  {
1012
1042
  type: "button",
1013
1043
  className: "nice-btn nice-btn--primary nice-captcha__verify",
1014
- disabled: j || U || D.trim() === "",
1015
- onClick: K,
1016
- children: j ? "…" : "Verify"
1044
+ disabled: B || G || D.trim() === "",
1045
+ onClick: W,
1046
+ children: B ? "…" : n("captcha.verify", "Verify")
1017
1047
  }
1018
1048
  )
1019
1049
  ] }),
1020
- c === "text" && R.kind === "text" && /* @__PURE__ */ a("div", { className: "nice-captcha__challenge", children: [
1050
+ t === "text" && P.kind === "text" && /* @__PURE__ */ r("div", { className: "nice-captcha__challenge", children: [
1021
1051
  /* @__PURE__ */ e(
1022
1052
  "canvas",
1023
1053
  {
1024
- ref: w,
1054
+ ref: k,
1025
1055
  className: "nice-captcha__canvas",
1026
1056
  width: 160,
1027
1057
  height: 56,
@@ -1036,11 +1066,14 @@ const Re = /* @__PURE__ */ Object.assign(
1036
1066
  autoCapitalize: "characters",
1037
1067
  autoComplete: "off",
1038
1068
  value: D,
1039
- "aria-label": "Type the characters shown in the image",
1040
- disabled: j || U,
1041
- onChange: (y) => m(y.target.value),
1042
- onKeyDown: (y) => {
1043
- y.key === "Enter" && (y.preventDefault(), K());
1069
+ "aria-label": n(
1070
+ "captcha.typeTheCharactersShownIn",
1071
+ "Type the characters shown in the image"
1072
+ ),
1073
+ disabled: B || G,
1074
+ onChange: (F) => u(F.target.value),
1075
+ onKeyDown: (F) => {
1076
+ F.key === "Enter" && (F.preventDefault(), W());
1044
1077
  }
1045
1078
  }
1046
1079
  ),
@@ -1049,21 +1082,21 @@ const Re = /* @__PURE__ */ Object.assign(
1049
1082
  {
1050
1083
  type: "button",
1051
1084
  className: "nice-btn nice-btn--primary nice-captcha__verify",
1052
- disabled: j || U || D.trim() === "",
1053
- onClick: K,
1054
- children: j ? "…" : "Verify"
1085
+ disabled: B || G || D.trim() === "",
1086
+ onClick: W,
1087
+ children: B ? "…" : n("captcha.verify", "Verify")
1055
1088
  }
1056
1089
  )
1057
1090
  ] }),
1058
- c === "slider" && R.kind === "slider" && /* @__PURE__ */ a("div", { className: "nice-captcha__challenge nice-captcha__challenge--slider", children: [
1059
- /* @__PURE__ */ e("span", { className: "nice-captcha__slider-hint", "aria-hidden": "true", children: U ? "Verified" : "Slide to the marker" }),
1060
- /* @__PURE__ */ a("div", { className: "nice-captcha__track", children: [
1091
+ t === "slider" && P.kind === "slider" && /* @__PURE__ */ r("div", { className: "nice-captcha__challenge nice-captcha__challenge--slider", children: [
1092
+ /* @__PURE__ */ e("span", { className: "nice-captcha__slider-hint", "aria-hidden": "true", children: G ? n("captcha.verified", "Verified") : n("captcha.slideToTheMarker", "Slide to the marker") }),
1093
+ /* @__PURE__ */ r("div", { className: "nice-captcha__track", children: [
1061
1094
  /* @__PURE__ */ e(
1062
1095
  "span",
1063
1096
  {
1064
1097
  className: "nice-captcha__target",
1065
1098
  "aria-hidden": "true",
1066
- style: { left: `${R.target}%` }
1099
+ style: { left: `${P.target}%` }
1067
1100
  }
1068
1101
  ),
1069
1102
  /* @__PURE__ */ e(
@@ -1073,26 +1106,29 @@ const Re = /* @__PURE__ */ Object.assign(
1073
1106
  type: "range",
1074
1107
  min: 0,
1075
1108
  max: 100,
1076
- value: v,
1077
- "aria-label": "Slide the handle to the marker to verify",
1078
- "aria-valuetext": `${v}%`,
1079
- disabled: U || j,
1080
- onChange: (y) => se(Number(y.target.value))
1109
+ value: C,
1110
+ "aria-label": n(
1111
+ "captcha.slideTheHandleToThe",
1112
+ "Slide the handle to the marker to verify"
1113
+ ),
1114
+ "aria-valuetext": `${C}%`,
1115
+ disabled: G || B,
1116
+ onChange: (F) => le(Number(F.target.value))
1081
1117
  }
1082
1118
  )
1083
1119
  ] })
1084
1120
  ] }),
1085
- /* @__PURE__ */ a("div", { className: "nice-captcha__footer", children: [
1086
- /* @__PURE__ */ e("div", { className: "nice-captcha__message", role: "status", "aria-live": "polite", children: O }),
1087
- i && /* @__PURE__ */ e(
1121
+ /* @__PURE__ */ r("div", { className: "nice-captcha__footer", children: [
1122
+ /* @__PURE__ */ e("div", { className: "nice-captcha__message", role: "status", "aria-live": "polite", children: L }),
1123
+ d && /* @__PURE__ */ e(
1088
1124
  "button",
1089
1125
  {
1090
1126
  type: "button",
1091
1127
  className: "nice-captcha__refresh",
1092
- "aria-label": "Refresh challenge",
1093
- title: "Refresh challenge",
1094
- onClick: P,
1095
- children: /* @__PURE__ */ e(re, {})
1128
+ "aria-label": n("captcha.refreshChallenge", "Refresh challenge"),
1129
+ title: n("captcha.refreshChallenge", "Refresh challenge"),
1130
+ onClick: R,
1131
+ children: /* @__PURE__ */ e(ie, {})
1096
1132
  }
1097
1133
  )
1098
1134
  ] })
@@ -1101,207 +1137,211 @@ const Re = /* @__PURE__ */ Object.assign(
1101
1137
  );
1102
1138
  }),
1103
1139
  { displayName: "NiceCaptcha" }
1104
- ), ve = [
1140
+ ), ke = [
1105
1141
  { id: "google", label: "Google", color: "#4285f4", textColor: "#fff" },
1106
1142
  { id: "microsoft", label: "Microsoft", color: "#00a4ef", textColor: "#fff" },
1107
1143
  { id: "discord", label: "Discord", color: "#5865f2", textColor: "#fff" },
1108
1144
  { id: "spotify", label: "Spotify", color: "#1db954", textColor: "#fff" },
1109
1145
  { id: "github", label: "GitHub", color: "#24292e", textColor: "#fff" }
1110
- ], Fe = /* @__PURE__ */ Object.assign(
1111
- /* @__PURE__ */ G(
1146
+ ], Ie = /* @__PURE__ */ Object.assign(
1147
+ /* @__PURE__ */ K(
1112
1148
  ({
1113
- providers: r = ve,
1114
- onProviderClick: t,
1115
- disabled: c = !1,
1116
- loadingProvider: n,
1149
+ providers: s = ke,
1150
+ onProviderClick: a,
1151
+ disabled: n = !1,
1152
+ loadingProvider: t,
1117
1153
  direction: i = "vertical",
1118
- separatorText: h = "or continue with",
1154
+ separatorText: d,
1119
1155
  showSeparator: l = !0,
1120
- className: s,
1121
- style: u
1122
- }, S) => /* @__PURE__ */ a(
1123
- "div",
1124
- {
1125
- ref: S,
1126
- className: `nice-oauth nice-oauth--${i}${s ? ` ${s}` : ""}`,
1127
- style: u,
1128
- children: [
1129
- l && /* @__PURE__ */ a("div", { className: "nice-oauth__separator", children: [
1130
- /* @__PURE__ */ e("hr", {}),
1131
- /* @__PURE__ */ e("span", { children: h }),
1132
- /* @__PURE__ */ e("hr", {})
1133
- ] }),
1134
- /* @__PURE__ */ e("div", { className: "nice-oauth__buttons", children: r.map((d) => /* @__PURE__ */ a(
1135
- "button",
1136
- {
1137
- type: "button",
1138
- className: `nice-oauth__btn${n === d.id ? " nice-oauth__btn--loading" : ""}`,
1139
- style: { backgroundColor: d.color, color: d.textColor },
1140
- onClick: () => t == null ? void 0 : t(d.id),
1141
- disabled: c || !!n,
1142
- children: [
1143
- d.icon && /* @__PURE__ */ e("span", { className: "nice-oauth__btn-icon", children: d.icon }),
1144
- /* @__PURE__ */ e("span", { className: "nice-oauth__btn-label", children: n === d.id ? "…" : d.label })
1145
- ]
1146
- },
1147
- d.id
1148
- )) })
1149
- ]
1150
- }
1151
- )
1156
+ className: c,
1157
+ style: h
1158
+ }, x) => {
1159
+ const { t: f } = q();
1160
+ return /* @__PURE__ */ r(
1161
+ "div",
1162
+ {
1163
+ ref: x,
1164
+ className: `nice-oauth nice-oauth--${i}${c ? ` ${c}` : ""}`,
1165
+ style: h,
1166
+ children: [
1167
+ l && /* @__PURE__ */ r("div", { className: "nice-oauth__separator", children: [
1168
+ /* @__PURE__ */ e("hr", {}),
1169
+ /* @__PURE__ */ e("span", { children: d ?? f("oAuthButtons.orContinueWith", "or continue with") }),
1170
+ /* @__PURE__ */ e("hr", {})
1171
+ ] }),
1172
+ /* @__PURE__ */ e("div", { className: "nice-oauth__buttons", children: s.map((g) => /* @__PURE__ */ r(
1173
+ "button",
1174
+ {
1175
+ type: "button",
1176
+ className: `nice-oauth__btn${t === g.id ? " nice-oauth__btn--loading" : ""}`,
1177
+ style: { backgroundColor: g.color, color: g.textColor },
1178
+ onClick: () => a == null ? void 0 : a(g.id),
1179
+ disabled: n || !!t,
1180
+ children: [
1181
+ g.icon && /* @__PURE__ */ e("span", { className: "nice-oauth__btn-icon", children: g.icon }),
1182
+ /* @__PURE__ */ e("span", { className: "nice-oauth__btn-label", children: t === g.id ? "…" : g.label })
1183
+ ]
1184
+ },
1185
+ g.id
1186
+ )) })
1187
+ ]
1188
+ }
1189
+ );
1190
+ }
1152
1191
  ),
1153
1192
  { displayName: "NiceOAuthButtons" }
1154
- ), Me = /* @__PURE__ */ G(function(t, c) {
1155
- const {
1156
- tokens: n,
1157
- onCreate: i,
1158
- onRevoke: h,
1159
- availableScopes: l = [],
1160
- maxTokens: s = 10,
1161
- title: u = "API Tokens",
1162
- className: S,
1163
- style: d
1164
- } = t, [A, b] = g(!1), [k, _] = g(""), [F, o] = g([]), [p, f] = g("90"), [M, w] = g(null), [C, T] = g(!1), [E, N] = g(null), I = $(async () => {
1165
- if (!(!i || !k.trim())) {
1166
- T(!0);
1193
+ ), De = /* @__PURE__ */ K(function(a, n) {
1194
+ const { t } = q(), {
1195
+ tokens: i,
1196
+ onCreate: d,
1197
+ onRevoke: l,
1198
+ availableScopes: c = [],
1199
+ maxTokens: h = 10,
1200
+ title: x = t("tokenManagement.apiTokens", "API Tokens"),
1201
+ className: f,
1202
+ style: g
1203
+ } = a, [S, y] = _(!1), [o, w] = _(""), [m, p] = _([]), [b, N] = _("90"), [I, k] = _(null), [T, $] = _(!1), [O, v] = _(null), E = M(async () => {
1204
+ if (!(!d || !o.trim())) {
1205
+ $(!0);
1167
1206
  try {
1168
- const m = p ? parseInt(p, 10) : void 0, v = await i(k.trim(), F, m);
1169
- w(v), _(""), o([]), b(!1);
1207
+ const u = b ? parseInt(b, 10) : void 0, C = await d(o.trim(), m, u);
1208
+ k(C), w(""), p([]), y(!1);
1170
1209
  } finally {
1171
- T(!1);
1210
+ $(!1);
1172
1211
  }
1173
1212
  }
1174
- }, [i, k, F, p]), O = $(
1175
- async (m) => {
1176
- if (h) {
1177
- N(m);
1213
+ }, [d, o, m, b]), L = M(
1214
+ async (u) => {
1215
+ if (l) {
1216
+ v(u);
1178
1217
  try {
1179
- await h(m);
1218
+ await l(u);
1180
1219
  } finally {
1181
- N(null);
1220
+ v(null);
1182
1221
  }
1183
1222
  }
1184
1223
  },
1185
- [h]
1186
- ), x = (m) => {
1187
- o(
1188
- (v) => v.includes(m) ? v.filter((z) => z !== m) : [...v, m]
1224
+ [l]
1225
+ ), A = (u) => {
1226
+ p(
1227
+ (C) => C.includes(u) ? C.filter((H) => H !== u) : [...C, u]
1189
1228
  );
1190
- }, D = n.length < s;
1191
- return /* @__PURE__ */ a("div", { ref: c, className: `nice-token-management ${S ?? ""}`, style: d, children: [
1192
- /* @__PURE__ */ a("div", { className: "nice-token-management__header", children: [
1193
- /* @__PURE__ */ e("h3", { children: u }),
1229
+ }, D = i.length < h;
1230
+ return /* @__PURE__ */ r("div", { ref: n, className: `nice-token-management ${f ?? ""}`, style: g, children: [
1231
+ /* @__PURE__ */ r("div", { className: "nice-token-management__header", children: [
1232
+ /* @__PURE__ */ e("h3", { children: x }),
1194
1233
  D && /* @__PURE__ */ e(
1195
1234
  "button",
1196
1235
  {
1197
1236
  className: "nice-token-management__new-btn",
1198
- onClick: () => b(!0),
1199
- disabled: A,
1200
- children: "+ New Token"
1237
+ onClick: () => y(!0),
1238
+ disabled: S,
1239
+ children: t("tokenManagement.newToken", "+ New Token")
1201
1240
  }
1202
1241
  )
1203
1242
  ] }),
1204
- M && /* @__PURE__ */ a("div", { className: "nice-token-management__reveal", children: [
1205
- /* @__PURE__ */ a("p", { children: [
1206
- /* @__PURE__ */ e("strong", { children: "New token created!" }),
1207
- " Copy it now — it won't be shown again."
1243
+ I && /* @__PURE__ */ r("div", { className: "nice-token-management__reveal", children: [
1244
+ /* @__PURE__ */ r("p", { children: [
1245
+ /* @__PURE__ */ e("strong", { children: t("tokenManagement.newTokenCreated", "New token created!") }),
1246
+ " ",
1247
+ t("tokenManagement.copyItNowItWont", "Copy it now — it won't be shown again.")
1208
1248
  ] }),
1209
- /* @__PURE__ */ e("code", { className: "nice-token-management__token-value", children: M }),
1210
- /* @__PURE__ */ e("button", { onClick: () => w(null), children: "Dismiss" })
1249
+ /* @__PURE__ */ e("code", { className: "nice-token-management__token-value", children: I }),
1250
+ /* @__PURE__ */ e("button", { onClick: () => k(null), children: t("tokenManagement.dismiss", "Dismiss") })
1211
1251
  ] }),
1212
- A && /* @__PURE__ */ a("div", { className: "nice-token-management__create-form", children: [
1213
- /* @__PURE__ */ a("label", { children: [
1214
- "Name",
1252
+ S && /* @__PURE__ */ r("div", { className: "nice-token-management__create-form", children: [
1253
+ /* @__PURE__ */ r("label", { children: [
1254
+ t("tokenManagement.name", "Name"),
1215
1255
  /* @__PURE__ */ e(
1216
1256
  "input",
1217
1257
  {
1218
1258
  type: "text",
1219
- value: k,
1220
- onChange: (m) => _(m.target.value),
1221
- placeholder: "My API token",
1259
+ value: o,
1260
+ onChange: (u) => w(u.target.value),
1261
+ placeholder: t("tokenManagement.myApiToken", "My API token"),
1222
1262
  maxLength: 64
1223
1263
  }
1224
1264
  )
1225
1265
  ] }),
1226
- l.length > 0 && /* @__PURE__ */ a("fieldset", { children: [
1227
- /* @__PURE__ */ e("legend", { children: "Scopes" }),
1228
- l.map((m) => /* @__PURE__ */ a("label", { className: "nice-token-management__scope", children: [
1266
+ c.length > 0 && /* @__PURE__ */ r("fieldset", { children: [
1267
+ /* @__PURE__ */ e("legend", { children: t("tokenManagement.scopes", "Scopes") }),
1268
+ c.map((u) => /* @__PURE__ */ r("label", { className: "nice-token-management__scope", children: [
1229
1269
  /* @__PURE__ */ e(
1230
1270
  "input",
1231
1271
  {
1232
1272
  type: "checkbox",
1233
- checked: F.includes(m),
1234
- onChange: () => x(m)
1273
+ checked: m.includes(u),
1274
+ onChange: () => A(u)
1235
1275
  }
1236
1276
  ),
1237
- m
1238
- ] }, m))
1277
+ u
1278
+ ] }, u))
1239
1279
  ] }),
1240
- /* @__PURE__ */ a("label", { children: [
1241
- "Expires in (days)",
1280
+ /* @__PURE__ */ r("label", { children: [
1281
+ t("tokenManagement.expiresInDays", "Expires in (days)"),
1242
1282
  /* @__PURE__ */ e(
1243
1283
  "input",
1244
1284
  {
1245
1285
  type: "number",
1246
- value: p,
1247
- onChange: (m) => f(m.target.value),
1286
+ value: b,
1287
+ onChange: (u) => N(u.target.value),
1248
1288
  min: 1,
1249
1289
  max: 365
1250
1290
  }
1251
1291
  )
1252
1292
  ] }),
1253
- /* @__PURE__ */ a("div", { className: "nice-token-management__create-actions", children: [
1254
- /* @__PURE__ */ e("button", { onClick: I, disabled: C || !k.trim(), children: C ? "Creating…" : "Create Token" }),
1255
- /* @__PURE__ */ e("button", { onClick: () => b(!1), children: "Cancel" })
1293
+ /* @__PURE__ */ r("div", { className: "nice-token-management__create-actions", children: [
1294
+ /* @__PURE__ */ e("button", { onClick: E, disabled: T || !o.trim(), children: T ? t("tokenManagement.creating", "Creating…") : t("tokenManagement.createToken", "Create Token") }),
1295
+ /* @__PURE__ */ e("button", { onClick: () => y(!1), children: t("tokenManagement.cancel", "Cancel") })
1256
1296
  ] })
1257
1297
  ] }),
1258
- n.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-token-management__empty", children: "No API tokens yet." }) : /* @__PURE__ */ a("table", { className: "nice-token-management__table", children: [
1259
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ a("tr", { children: [
1260
- /* @__PURE__ */ e("th", { children: "Name" }),
1261
- /* @__PURE__ */ e("th", { children: "Prefix" }),
1262
- /* @__PURE__ */ e("th", { children: "Created" }),
1263
- /* @__PURE__ */ e("th", { children: "Expires" }),
1264
- /* @__PURE__ */ e("th", { children: "Last Used" }),
1265
- /* @__PURE__ */ e("th", { children: "Scopes" }),
1298
+ i.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-token-management__empty", children: t("tokenManagement.noApiTokensYet", "No API tokens yet.") }) : /* @__PURE__ */ r("table", { className: "nice-token-management__table", children: [
1299
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { children: [
1300
+ /* @__PURE__ */ e("th", { children: t("tokenManagement.name", "Name") }),
1301
+ /* @__PURE__ */ e("th", { children: t("tokenManagement.prefix", "Prefix") }),
1302
+ /* @__PURE__ */ e("th", { children: t("tokenManagement.created", "Created") }),
1303
+ /* @__PURE__ */ e("th", { children: t("tokenManagement.expires", "Expires") }),
1304
+ /* @__PURE__ */ e("th", { children: t("tokenManagement.lastUsed", "Last Used") }),
1305
+ /* @__PURE__ */ e("th", { children: t("tokenManagement.scopes", "Scopes") }),
1266
1306
  /* @__PURE__ */ e("th", {})
1267
1307
  ] }) }),
1268
- /* @__PURE__ */ e("tbody", { children: n.map((m) => {
1269
- var v;
1270
- return /* @__PURE__ */ a("tr", { children: [
1271
- /* @__PURE__ */ e("td", { children: m.name }),
1272
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ a("code", { children: [
1273
- m.prefix,
1308
+ /* @__PURE__ */ e("tbody", { children: i.map((u) => {
1309
+ var C;
1310
+ return /* @__PURE__ */ r("tr", { children: [
1311
+ /* @__PURE__ */ e("td", { children: u.name }),
1312
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ r("code", { children: [
1313
+ u.prefix,
1274
1314
  "…"
1275
1315
  ] }) }),
1276
- /* @__PURE__ */ e("td", { children: m.createdAt }),
1277
- /* @__PURE__ */ e("td", { children: m.expiresAt ?? "—" }),
1278
- /* @__PURE__ */ e("td", { children: m.lastUsedAt ?? "Never" }),
1279
- /* @__PURE__ */ e("td", { children: ((v = m.scopes) == null ? void 0 : v.join(", ")) || "—" }),
1316
+ /* @__PURE__ */ e("td", { children: u.createdAt }),
1317
+ /* @__PURE__ */ e("td", { children: u.expiresAt ?? "—" }),
1318
+ /* @__PURE__ */ e("td", { children: u.lastUsedAt ?? t("tokenManagement.never", "Never") }),
1319
+ /* @__PURE__ */ e("td", { children: ((C = u.scopes) == null ? void 0 : C.join(", ")) || "—" }),
1280
1320
  /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
1281
1321
  "button",
1282
1322
  {
1283
1323
  className: "nice-token-management__revoke-btn",
1284
- onClick: () => O(m.id),
1285
- disabled: E === m.id,
1286
- children: E === m.id ? "Revoking…" : "Revoke"
1324
+ onClick: () => L(u.id),
1325
+ disabled: O === u.id,
1326
+ children: O === u.id ? t("tokenManagement.revoking", "Revoking…") : t("tokenManagement.revoke", "Revoke")
1287
1327
  }
1288
1328
  ) })
1289
- ] }, m.id);
1329
+ ] }, u.id);
1290
1330
  }) })
1291
1331
  ] })
1292
1332
  ] });
1293
1333
  });
1294
1334
  export {
1295
1335
  Re as NiceCaptcha,
1296
- Se as NiceChangePassword,
1297
- xe as NiceLoginForm,
1298
- Fe as NiceOAuthButtons,
1299
- Ae as NicePasswordGenerator,
1300
- Y as NicePasswordStrength,
1301
- $e as NiceRegistrationForm,
1302
- Me as NiceTokenManagement,
1303
- Te as NiceTwoFaSetup,
1304
- X as calcPasswordStrength,
1305
- te as generatePassword,
1306
- Ce as useAuth
1336
+ $e as NiceChangePassword,
1337
+ Te as NiceLoginForm,
1338
+ Ie as NiceOAuthButtons,
1339
+ Me as NicePasswordGenerator,
1340
+ te as NicePasswordStrength,
1341
+ Ae as NiceRegistrationForm,
1342
+ De as NiceTokenManagement,
1343
+ Pe as NiceTwoFaSetup,
1344
+ ee as calcPasswordStrength,
1345
+ re as generatePassword,
1346
+ Se as useAuth
1307
1347
  };