@nice2dev/auth 1.2.0 → 1.2.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/CHANGELOG.md +103 -0
- package/dist/NiceCaptcha.d.ts +3 -1
- package/dist/NiceChangePassword.d.ts +3 -1
- package/dist/NiceLoginForm.d.ts +3 -1
- package/dist/NiceOAuthButtons.d.ts +3 -1
- package/dist/NicePasswordStrength.d.ts +3 -1
- package/dist/NiceRegistrationForm.d.ts +3 -1
- package/dist/NiceTwoFaSetup.d.ts +3 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +912 -893
- package/dist/marks.d.ts +6 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useState as g, useCallback as $, forwardRef as
|
|
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
2
|
import { jsxs as a, jsx as e, Fragment as ae } from "react/jsx-runtime";
|
|
3
|
-
function
|
|
3
|
+
function Ce(r = {}) {
|
|
4
4
|
const { onLogin: t, onRefresh: c, onLogout: n, storageKey: i = "nice_auth", persistAuth: h = !1 } = r, [l, s] = g(() => {
|
|
5
5
|
if (h && typeof window < "u")
|
|
6
6
|
try {
|
|
@@ -80,320 +80,329 @@ function Re(r = {}) {
|
|
|
80
80
|
clearError: F
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
const
|
|
84
|
-
(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
(
|
|
106
|
-
x
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
|
|
127
|
-
"input",
|
|
128
|
-
{
|
|
129
|
-
id: "nice-login-email",
|
|
130
|
-
className: "nice-input",
|
|
131
|
-
type: "email",
|
|
132
|
-
value: M,
|
|
133
|
-
onChange: (x) => w(x.target.value),
|
|
134
|
-
autoComplete: "email",
|
|
135
|
-
required: !0,
|
|
136
|
-
disabled: t
|
|
137
|
-
}
|
|
138
|
-
)
|
|
139
|
-
] }),
|
|
140
|
-
/* @__PURE__ */ a("div", { className: "nice-login-form__field", children: [
|
|
141
|
-
/* @__PURE__ */ e("label", { htmlFor: "nice-login-password", children: F }),
|
|
142
|
-
/* @__PURE__ */ e(
|
|
143
|
-
"input",
|
|
144
|
-
{
|
|
145
|
-
id: "nice-login-password",
|
|
146
|
-
className: "nice-input",
|
|
147
|
-
type: "password",
|
|
148
|
-
value: C,
|
|
149
|
-
onChange: (x) => T(x.target.value),
|
|
150
|
-
autoComplete: "current-password",
|
|
151
|
-
required: !0,
|
|
152
|
-
disabled: t
|
|
153
|
-
}
|
|
154
|
-
)
|
|
155
|
-
] }),
|
|
156
|
-
/* @__PURE__ */ a("div", { className: "nice-login-form__options", children: [
|
|
157
|
-
I && /* @__PURE__ */ a("label", { className: "nice-login-form__remember", children: [
|
|
83
|
+
const xe = /* @__PURE__ */ Object.assign(
|
|
84
|
+
/* @__PURE__ */ G(
|
|
85
|
+
({
|
|
86
|
+
onSubmit: r,
|
|
87
|
+
loading: t = !1,
|
|
88
|
+
error: c,
|
|
89
|
+
showRememberMe: n = !0,
|
|
90
|
+
showForgotPassword: i = !0,
|
|
91
|
+
onForgotPassword: h,
|
|
92
|
+
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,
|
|
103
|
+
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 });
|
|
110
|
+
},
|
|
111
|
+
[M, C, E, r, o]
|
|
112
|
+
);
|
|
113
|
+
return /* @__PURE__ */ a(
|
|
114
|
+
"form",
|
|
115
|
+
{
|
|
116
|
+
ref: f,
|
|
117
|
+
className: `nice-login-form${b ? ` ${b}` : ""}`,
|
|
118
|
+
style: k,
|
|
119
|
+
onSubmit: O,
|
|
120
|
+
noValidate: !0,
|
|
121
|
+
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: _ }),
|
|
158
127
|
/* @__PURE__ */ e(
|
|
159
128
|
"input",
|
|
160
129
|
{
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
130
|
+
id: "nice-login-email",
|
|
131
|
+
className: "nice-input",
|
|
132
|
+
type: "email",
|
|
133
|
+
value: M,
|
|
134
|
+
onChange: (x) => w(x.target.value),
|
|
135
|
+
autoComplete: "email",
|
|
136
|
+
required: !0,
|
|
164
137
|
disabled: t
|
|
165
138
|
}
|
|
166
|
-
)
|
|
167
|
-
/* @__PURE__ */ e("span", { children: "Remember me" })
|
|
139
|
+
)
|
|
168
140
|
] }),
|
|
169
|
-
|
|
170
|
-
|
|
141
|
+
/* @__PURE__ */ a("div", { className: "nice-login-form__field", children: [
|
|
142
|
+
/* @__PURE__ */ e("label", { htmlFor: "nice-login-password", children: F }),
|
|
143
|
+
/* @__PURE__ */ e(
|
|
144
|
+
"input",
|
|
145
|
+
{
|
|
146
|
+
id: "nice-login-password",
|
|
147
|
+
className: "nice-input",
|
|
148
|
+
type: "password",
|
|
149
|
+
value: C,
|
|
150
|
+
onChange: (x) => T(x.target.value),
|
|
151
|
+
autoComplete: "current-password",
|
|
152
|
+
required: !0,
|
|
153
|
+
disabled: t
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
] }),
|
|
157
|
+
/* @__PURE__ */ a("div", { className: "nice-login-form__options", children: [
|
|
158
|
+
I && /* @__PURE__ */ a("label", { className: "nice-login-form__remember", children: [
|
|
159
|
+
/* @__PURE__ */ e(
|
|
160
|
+
"input",
|
|
161
|
+
{
|
|
162
|
+
type: "checkbox",
|
|
163
|
+
checked: E,
|
|
164
|
+
onChange: (x) => N(x.target.checked),
|
|
165
|
+
disabled: t
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
/* @__PURE__ */ e("span", { children: "Remember me" })
|
|
169
|
+
] }),
|
|
170
|
+
!I && n && p && /* @__PURE__ */ e("span", { className: "nice-login-form__privacy-notice", children: p }),
|
|
171
|
+
i && /* @__PURE__ */ e(
|
|
172
|
+
"button",
|
|
173
|
+
{
|
|
174
|
+
type: "button",
|
|
175
|
+
className: "nice-login-form__forgot",
|
|
176
|
+
onClick: h,
|
|
177
|
+
disabled: t,
|
|
178
|
+
children: "Forgot password?"
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
] }),
|
|
182
|
+
/* @__PURE__ */ e(
|
|
171
183
|
"button",
|
|
172
184
|
{
|
|
173
|
-
type: "
|
|
174
|
-
className: "nice-login-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
children: "Forgot password?"
|
|
185
|
+
type: "submit",
|
|
186
|
+
className: "nice-btn nice-btn--primary nice-login-form__submit",
|
|
187
|
+
disabled: t || !M || !C,
|
|
188
|
+
children: t ? "…" : S
|
|
178
189
|
}
|
|
179
|
-
)
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: s, disabled: t, children: "Register" })
|
|
193
|
-
] }),
|
|
194
|
-
A && /* @__PURE__ */ e("div", { className: "nice-login-form__footer", children: A })
|
|
195
|
-
]
|
|
196
|
-
}
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
);
|
|
200
|
-
de.displayName = "NiceLoginForm";
|
|
201
|
-
const he = {
|
|
190
|
+
),
|
|
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" })
|
|
194
|
+
] }),
|
|
195
|
+
A && /* @__PURE__ */ e("div", { className: "nice-login-form__footer", children: A })
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
),
|
|
201
|
+
{ displayName: "NiceLoginForm" }
|
|
202
|
+
), de = {
|
|
202
203
|
0: "Very weak",
|
|
203
204
|
1: "Weak",
|
|
204
205
|
2: "Fair",
|
|
205
206
|
3: "Strong",
|
|
206
207
|
4: "Very strong"
|
|
207
|
-
},
|
|
208
|
+
}, he = {
|
|
208
209
|
0: "#d9534f",
|
|
209
210
|
1: "#f0ad4e",
|
|
210
211
|
2: "#5bc0de",
|
|
211
212
|
3: "#5cb85c",
|
|
212
213
|
4: "#2e7d32"
|
|
213
214
|
};
|
|
214
|
-
function
|
|
215
|
+
function X(r) {
|
|
215
216
|
if (!r)
|
|
216
217
|
return 0;
|
|
217
218
|
let t = 0;
|
|
218
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);
|
|
219
220
|
}
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
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: [
|
|
232
|
+
/* @__PURE__ */ e("div", { className: "nice-password-strength__bar", children: /* @__PURE__ */ e(
|
|
233
|
+
"div",
|
|
234
|
+
{
|
|
235
|
+
className: "nice-password-strength__fill",
|
|
236
|
+
style: { width: `${u}%`, backgroundColor: s }
|
|
237
|
+
}
|
|
238
|
+
) }),
|
|
239
|
+
c && /* @__PURE__ */ e("span", { className: "nice-password-strength__label", style: { color: s }, children: n[l] })
|
|
240
|
+
] });
|
|
241
|
+
}
|
|
242
|
+
),
|
|
243
|
+
{ displayName: "NicePasswordStrength" }
|
|
244
|
+
), $e = /* @__PURE__ */ Object.assign(
|
|
245
|
+
/* @__PURE__ */ G(
|
|
246
|
+
({
|
|
247
|
+
onSubmit: r,
|
|
248
|
+
loading: t = !1,
|
|
249
|
+
error: c,
|
|
250
|
+
onLoginClick: n,
|
|
251
|
+
showPasswordStrength: i = !0,
|
|
252
|
+
minPasswordStrength: h = 2,
|
|
253
|
+
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 }));
|
|
264
|
+
},
|
|
265
|
+
[D, _, o, f, w, N, r]
|
|
266
|
+
);
|
|
267
|
+
return /* @__PURE__ */ a(
|
|
268
|
+
"form",
|
|
226
269
|
{
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
)
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
c && /* @__PURE__ */ e("div", { className: "nice-register-form__error", role: "alert", children: c }),
|
|
270
|
-
/* @__PURE__ */ a("div", { className: "nice-register-form__row", children: [
|
|
270
|
+
ref: k,
|
|
271
|
+
className: `nice-register-form${A ? ` ${A}` : ""}`,
|
|
272
|
+
style: b,
|
|
273
|
+
onSubmit: m,
|
|
274
|
+
noValidate: !0,
|
|
275
|
+
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 *" }),
|
|
282
|
+
/* @__PURE__ */ e(
|
|
283
|
+
"input",
|
|
284
|
+
{
|
|
285
|
+
id: "nice-reg-first",
|
|
286
|
+
className: "nice-input",
|
|
287
|
+
type: "text",
|
|
288
|
+
value: _,
|
|
289
|
+
onChange: (v) => F(v.target.value),
|
|
290
|
+
required: !0,
|
|
291
|
+
disabled: t,
|
|
292
|
+
autoComplete: "given-name"
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
] }),
|
|
296
|
+
/* @__PURE__ */ a("div", { className: "nice-register-form__field", children: [
|
|
297
|
+
/* @__PURE__ */ e("label", { htmlFor: "nice-reg-last", children: "Last name" }),
|
|
298
|
+
/* @__PURE__ */ e(
|
|
299
|
+
"input",
|
|
300
|
+
{
|
|
301
|
+
id: "nice-reg-last",
|
|
302
|
+
className: "nice-input",
|
|
303
|
+
type: "text",
|
|
304
|
+
value: o,
|
|
305
|
+
onChange: (v) => p(v.target.value),
|
|
306
|
+
disabled: t,
|
|
307
|
+
autoComplete: "family-name"
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
] })
|
|
311
|
+
] }),
|
|
271
312
|
/* @__PURE__ */ a("div", { className: "nice-register-form__field", children: [
|
|
272
|
-
/* @__PURE__ */ e("label", { htmlFor: "nice-reg-
|
|
313
|
+
/* @__PURE__ */ e("label", { htmlFor: "nice-reg-email", children: "Email *" }),
|
|
273
314
|
/* @__PURE__ */ e(
|
|
274
315
|
"input",
|
|
275
316
|
{
|
|
276
|
-
id: "nice-reg-
|
|
317
|
+
id: "nice-reg-email",
|
|
277
318
|
className: "nice-input",
|
|
278
|
-
type: "
|
|
279
|
-
value:
|
|
280
|
-
onChange: (v) =>
|
|
319
|
+
type: "email",
|
|
320
|
+
value: f,
|
|
321
|
+
onChange: (v) => M(v.target.value),
|
|
281
322
|
required: !0,
|
|
282
323
|
disabled: t,
|
|
283
|
-
autoComplete: "
|
|
324
|
+
autoComplete: "email"
|
|
284
325
|
}
|
|
285
326
|
)
|
|
286
327
|
] }),
|
|
287
328
|
/* @__PURE__ */ a("div", { className: "nice-register-form__field", children: [
|
|
288
|
-
/* @__PURE__ */ e("label", { htmlFor: "nice-reg-
|
|
329
|
+
/* @__PURE__ */ e("label", { htmlFor: "nice-reg-pass", children: "Password *" }),
|
|
289
330
|
/* @__PURE__ */ e(
|
|
290
331
|
"input",
|
|
291
332
|
{
|
|
292
|
-
id: "nice-reg-
|
|
333
|
+
id: "nice-reg-pass",
|
|
293
334
|
className: "nice-input",
|
|
294
|
-
type: "
|
|
295
|
-
value:
|
|
296
|
-
onChange: (v) =>
|
|
335
|
+
type: "password",
|
|
336
|
+
value: w,
|
|
337
|
+
onChange: (v) => C(v.target.value),
|
|
338
|
+
required: !0,
|
|
297
339
|
disabled: t,
|
|
298
|
-
autoComplete: "
|
|
340
|
+
autoComplete: "new-password"
|
|
299
341
|
}
|
|
300
|
-
)
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
type: "password",
|
|
344
|
-
value: T,
|
|
345
|
-
onChange: (v) => E(v.target.value),
|
|
346
|
-
required: !0,
|
|
347
|
-
disabled: t,
|
|
348
|
-
autoComplete: "new-password"
|
|
349
|
-
}
|
|
350
|
-
),
|
|
351
|
-
T && !x && /* @__PURE__ */ e("span", { className: "nice-error-text", children: "Passwords do not match" })
|
|
352
|
-
] }),
|
|
353
|
-
/* @__PURE__ */ a("label", { className: "nice-register-form__terms", children: [
|
|
342
|
+
),
|
|
343
|
+
i && w.length > 0 && /* @__PURE__ */ e(Y, { password: w })
|
|
344
|
+
] }),
|
|
345
|
+
/* @__PURE__ */ a("div", { className: "nice-register-form__field", children: [
|
|
346
|
+
/* @__PURE__ */ e("label", { htmlFor: "nice-reg-confirm", children: "Confirm password *" }),
|
|
347
|
+
/* @__PURE__ */ e(
|
|
348
|
+
"input",
|
|
349
|
+
{
|
|
350
|
+
id: "nice-reg-confirm",
|
|
351
|
+
className: "nice-input",
|
|
352
|
+
type: "password",
|
|
353
|
+
value: T,
|
|
354
|
+
onChange: (v) => E(v.target.value),
|
|
355
|
+
required: !0,
|
|
356
|
+
disabled: t,
|
|
357
|
+
autoComplete: "new-password"
|
|
358
|
+
}
|
|
359
|
+
),
|
|
360
|
+
T && !x && /* @__PURE__ */ e("span", { className: "nice-error-text", children: "Passwords do not match" })
|
|
361
|
+
] }),
|
|
362
|
+
/* @__PURE__ */ a("label", { className: "nice-register-form__terms", children: [
|
|
363
|
+
/* @__PURE__ */ e(
|
|
364
|
+
"input",
|
|
365
|
+
{
|
|
366
|
+
type: "checkbox",
|
|
367
|
+
checked: N,
|
|
368
|
+
onChange: (v) => I(v.target.checked),
|
|
369
|
+
disabled: t
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
/* @__PURE__ */ a("span", { children: [
|
|
373
|
+
"I accept the",
|
|
374
|
+
" ",
|
|
375
|
+
l ? /* @__PURE__ */ e("a", { href: l, target: "_blank", rel: "noopener noreferrer", children: "Terms" }) : "Terms",
|
|
376
|
+
s && /* @__PURE__ */ a(ae, { children: [
|
|
377
|
+
" ",
|
|
378
|
+
"and",
|
|
379
|
+
" ",
|
|
380
|
+
/* @__PURE__ */ e("a", { href: s, target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" })
|
|
381
|
+
] }),
|
|
382
|
+
" *"
|
|
383
|
+
] })
|
|
384
|
+
] }),
|
|
354
385
|
/* @__PURE__ */ e(
|
|
355
|
-
"
|
|
386
|
+
"button",
|
|
356
387
|
{
|
|
357
|
-
type: "
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
388
|
+
type: "submit",
|
|
389
|
+
className: "nice-btn nice-btn--primary nice-register-form__submit",
|
|
390
|
+
disabled: !D,
|
|
391
|
+
children: t ? "…" : "Register"
|
|
361
392
|
}
|
|
362
393
|
),
|
|
363
|
-
/* @__PURE__ */ a("
|
|
364
|
-
"
|
|
365
|
-
" ",
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
] }),
|
|
376
|
-
/* @__PURE__ */ e(
|
|
377
|
-
"button",
|
|
378
|
-
{
|
|
379
|
-
type: "submit",
|
|
380
|
-
className: "nice-btn nice-btn--primary nice-register-form__submit",
|
|
381
|
-
disabled: !D,
|
|
382
|
-
children: t ? "…" : "Register"
|
|
383
|
-
}
|
|
384
|
-
),
|
|
385
|
-
n && /* @__PURE__ */ a("div", { className: "nice-register-form__login", children: [
|
|
386
|
-
/* @__PURE__ */ e("span", { children: "Already have an account? " }),
|
|
387
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: n, children: "Sign in" })
|
|
388
|
-
] }),
|
|
389
|
-
d && /* @__PURE__ */ e("div", { className: "nice-register-form__footer", children: d })
|
|
390
|
-
]
|
|
391
|
-
}
|
|
392
|
-
);
|
|
393
|
-
}
|
|
394
|
-
);
|
|
395
|
-
me.displayName = "NiceRegistrationForm";
|
|
396
|
-
const pe = ({ style: r }) => /* @__PURE__ */ e(
|
|
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" })
|
|
397
|
+
] }),
|
|
398
|
+
d && /* @__PURE__ */ e("div", { className: "nice-register-form__footer", children: d })
|
|
399
|
+
]
|
|
400
|
+
}
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
),
|
|
404
|
+
{ displayName: "NiceRegistrationForm" }
|
|
405
|
+
), ue = ({ style: r }) => /* @__PURE__ */ e(
|
|
397
406
|
"span",
|
|
398
407
|
{
|
|
399
408
|
"aria-hidden": "true",
|
|
@@ -428,14 +437,14 @@ const pe = ({ style: r }) => /* @__PURE__ */ e(
|
|
|
428
437
|
uppercase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
429
438
|
digits: "0123456789",
|
|
430
439
|
symbols: "!@#$%^&*()-_=+[]{};:,.?/~"
|
|
431
|
-
},
|
|
440
|
+
}, me = /[0Oo1lI|]/g, W = {
|
|
432
441
|
length: 16,
|
|
433
442
|
lowercase: !0,
|
|
434
443
|
uppercase: !0,
|
|
435
444
|
digits: !0,
|
|
436
445
|
symbols: !0,
|
|
437
446
|
excludeAmbiguous: !1
|
|
438
|
-
},
|
|
447
|
+
}, pe = {
|
|
439
448
|
password: "Generated password",
|
|
440
449
|
length: "Length",
|
|
441
450
|
lowercase: "Lowercase (a–z)",
|
|
@@ -447,14 +456,14 @@ const pe = ({ style: r }) => /* @__PURE__ */ e(
|
|
|
447
456
|
copy: "Copy",
|
|
448
457
|
copied: "Copied",
|
|
449
458
|
noCharacterSets: "Pick at least one kind of character."
|
|
450
|
-
},
|
|
459
|
+
}, fe = (r) => {
|
|
451
460
|
const t = globalThis.crypto;
|
|
452
461
|
if (!t || typeof t.getRandomValues != "function")
|
|
453
462
|
throw new Error("generatePassword: crypto.getRandomValues is not available");
|
|
454
463
|
return t.getRandomValues(r);
|
|
455
464
|
};
|
|
456
|
-
let
|
|
457
|
-
function
|
|
465
|
+
let ge = 0;
|
|
466
|
+
function J(r, t) {
|
|
458
467
|
const c = Math.floor(4294967296 / r) * r, n = new Uint32Array(1);
|
|
459
468
|
for (; ; ) {
|
|
460
469
|
const i = t(n)[0];
|
|
@@ -462,20 +471,20 @@ function X(r, t) {
|
|
|
462
471
|
return i % r;
|
|
463
472
|
}
|
|
464
473
|
}
|
|
465
|
-
function te(r = {}, t =
|
|
466
|
-
const c = { ...W, ...r }, n = ["lowercase", "uppercase", "digits", "symbols"].filter((s) => c[s]).map((s) => c.excludeAmbiguous ? ee[s].replace(
|
|
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);
|
|
467
476
|
if (n.length === 0)
|
|
468
477
|
return "";
|
|
469
|
-
const i = Math.max(n.length, Math.min(1024, Math.floor(c.length))), h = n.join(""), l = n.map((s) => s[
|
|
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)]);
|
|
470
479
|
for (; l.length < i; )
|
|
471
|
-
l.push(h[
|
|
480
|
+
l.push(h[J(h.length, t)]);
|
|
472
481
|
for (let s = l.length - 1; s > 0; s--) {
|
|
473
|
-
const u =
|
|
482
|
+
const u = J(s + 1, t);
|
|
474
483
|
[l[s], l[u]] = [l[u], l[s]];
|
|
475
484
|
}
|
|
476
485
|
return l.join("");
|
|
477
486
|
}
|
|
478
|
-
const
|
|
487
|
+
const Ae = ({
|
|
479
488
|
value: r,
|
|
480
489
|
defaultValue: t = "",
|
|
481
490
|
onChange: c,
|
|
@@ -493,27 +502,27 @@ const Fe = ({
|
|
|
493
502
|
style: _,
|
|
494
503
|
id: F
|
|
495
504
|
}) => {
|
|
496
|
-
const o = { ...
|
|
505
|
+
const o = { ...pe, ...A }, [p] = g(() => `nice-password-generator-${++ge}`), f = F ?? p, [M, w] = g(() => ({
|
|
497
506
|
...W,
|
|
498
507
|
...i
|
|
499
508
|
})), C = n ? { ...W, ...n } : M, [T, E] = g(
|
|
500
509
|
() => r === void 0 && !t ? te({ ...W, ...i, ...n }) : t
|
|
501
|
-
), N = r ?? T, [I,
|
|
510
|
+
), N = r ?? T, [I, O] = g(!1), x = H(void 0);
|
|
502
511
|
Q(() => () => clearTimeout(x.current), []);
|
|
503
512
|
const D = $(
|
|
504
513
|
(P) => {
|
|
505
|
-
r === void 0 && E(P),
|
|
514
|
+
r === void 0 && E(P), O(!1), c == null || c(P);
|
|
506
515
|
},
|
|
507
516
|
[r, c]
|
|
508
517
|
), m = $(
|
|
509
518
|
(P) => D(te(P)),
|
|
510
519
|
[D]
|
|
511
|
-
), v = (P,
|
|
512
|
-
const q = { ...C, [P]:
|
|
520
|
+
), v = (P, L) => {
|
|
521
|
+
const q = { ...C, [P]: L };
|
|
513
522
|
n || w(q), h == null || h(q), m(q);
|
|
514
523
|
}, z = async () => {
|
|
515
|
-
!N || !navigator.clipboard || (await navigator.clipboard.writeText(N),
|
|
516
|
-
}, R = !C.lowercase && !C.uppercase && !C.digits && !C.symbols,
|
|
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));
|
|
517
526
|
return /* @__PURE__ */ a(
|
|
518
527
|
"div",
|
|
519
528
|
{
|
|
@@ -556,14 +565,14 @@ const Fe = ({
|
|
|
556
565
|
disabled: b || !N,
|
|
557
566
|
"aria-live": "polite",
|
|
558
567
|
children: I ? /* @__PURE__ */ a(ae, { children: [
|
|
559
|
-
/* @__PURE__ */ e(
|
|
568
|
+
/* @__PURE__ */ e(ue, {}),
|
|
560
569
|
" ",
|
|
561
570
|
o.copied
|
|
562
571
|
] }) : o.copy
|
|
563
572
|
}
|
|
564
573
|
)
|
|
565
574
|
] }),
|
|
566
|
-
u && /* @__PURE__ */ e(
|
|
575
|
+
u && /* @__PURE__ */ e(Y, { password: N }),
|
|
567
576
|
/* @__PURE__ */ a("div", { className: "nice-password-generator__length", children: [
|
|
568
577
|
/* @__PURE__ */ e("label", { htmlFor: `${f}-length`, children: o.length }),
|
|
569
578
|
/* @__PURE__ */ e(
|
|
@@ -573,12 +582,12 @@ const Fe = ({
|
|
|
573
582
|
type: "range",
|
|
574
583
|
min: l,
|
|
575
584
|
max: s,
|
|
576
|
-
value:
|
|
585
|
+
value: B,
|
|
577
586
|
disabled: b,
|
|
578
587
|
onChange: (P) => v("length", Number(P.target.value))
|
|
579
588
|
}
|
|
580
589
|
),
|
|
581
|
-
/* @__PURE__ */ e("output", { htmlFor: `${f}-length`, className: "nice-password-generator__length-value", children:
|
|
590
|
+
/* @__PURE__ */ e("output", { htmlFor: `${f}-length`, className: "nice-password-generator__length-value", children: B })
|
|
582
591
|
] }),
|
|
583
592
|
/* @__PURE__ */ e("div", { className: "nice-password-generator__sets", children: ["lowercase", "uppercase", "digits", "symbols", "excludeAmbiguous"].map(
|
|
584
593
|
(P) => /* @__PURE__ */ a("label", { className: "nice-password-generator__option", children: [
|
|
@@ -588,7 +597,7 @@ const Fe = ({
|
|
|
588
597
|
type: "checkbox",
|
|
589
598
|
checked: C[P],
|
|
590
599
|
disabled: b,
|
|
591
|
-
onChange: (
|
|
600
|
+
onChange: (L) => v(P, L.target.checked)
|
|
592
601
|
}
|
|
593
602
|
),
|
|
594
603
|
o[P]
|
|
@@ -598,202 +607,212 @@ const Fe = ({
|
|
|
598
607
|
]
|
|
599
608
|
}
|
|
600
609
|
);
|
|
601
|
-
},
|
|
602
|
-
(
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
(
|
|
615
|
-
w
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
/* @__PURE__ */
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
/* @__PURE__ */
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
(
|
|
610
|
+
}, Se = /* @__PURE__ */ Object.assign(
|
|
611
|
+
/* @__PURE__ */ G(
|
|
612
|
+
({
|
|
613
|
+
requireCurrentPassword: r = !0,
|
|
614
|
+
onSubmit: t,
|
|
615
|
+
loading: c = !1,
|
|
616
|
+
error: n,
|
|
617
|
+
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
|
|
628
|
+
}));
|
|
629
|
+
},
|
|
630
|
+
[f, d, b, r, t]
|
|
631
|
+
);
|
|
632
|
+
return /* @__PURE__ */ a(
|
|
633
|
+
"form",
|
|
634
|
+
{
|
|
635
|
+
ref: S,
|
|
636
|
+
className: `nice-change-password${s ? ` ${s}` : ""}`,
|
|
637
|
+
style: u,
|
|
638
|
+
onSubmit: M,
|
|
639
|
+
noValidate: !0,
|
|
640
|
+
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 }),
|
|
643
|
+
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" }),
|
|
646
|
+
/* @__PURE__ */ e(
|
|
647
|
+
"input",
|
|
648
|
+
{
|
|
649
|
+
id: "nice-cp-current",
|
|
650
|
+
className: "nice-input",
|
|
651
|
+
type: "password",
|
|
652
|
+
value: d,
|
|
653
|
+
onChange: (w) => A(w.target.value),
|
|
654
|
+
autoComplete: "current-password",
|
|
655
|
+
disabled: c,
|
|
656
|
+
required: !0
|
|
657
|
+
}
|
|
658
|
+
)
|
|
659
|
+
] }),
|
|
660
|
+
/* @__PURE__ */ a("div", { className: "nice-change-password__field", children: [
|
|
661
|
+
/* @__PURE__ */ e("label", { htmlFor: "nice-cp-new", children: "New password" }),
|
|
662
|
+
/* @__PURE__ */ e(
|
|
663
|
+
"input",
|
|
664
|
+
{
|
|
665
|
+
id: "nice-cp-new",
|
|
666
|
+
className: "nice-input",
|
|
667
|
+
type: "password",
|
|
668
|
+
value: b,
|
|
669
|
+
onChange: (w) => k(w.target.value),
|
|
670
|
+
autoComplete: "new-password",
|
|
671
|
+
disabled: c,
|
|
672
|
+
required: !0
|
|
673
|
+
}
|
|
674
|
+
),
|
|
675
|
+
b.length > 0 && /* @__PURE__ */ e(Y, { password: b })
|
|
676
|
+
] }),
|
|
677
|
+
/* @__PURE__ */ a("div", { className: "nice-change-password__field", children: [
|
|
678
|
+
/* @__PURE__ */ e("label", { htmlFor: "nice-cp-confirm", children: "Confirm new password" }),
|
|
679
|
+
/* @__PURE__ */ e(
|
|
680
|
+
"input",
|
|
681
|
+
{
|
|
682
|
+
id: "nice-cp-confirm",
|
|
683
|
+
className: "nice-input",
|
|
684
|
+
type: "password",
|
|
685
|
+
value: _,
|
|
686
|
+
onChange: (w) => F(w.target.value),
|
|
687
|
+
autoComplete: "new-password",
|
|
688
|
+
disabled: c,
|
|
689
|
+
required: !0
|
|
690
|
+
}
|
|
691
|
+
),
|
|
692
|
+
_ && !p && /* @__PURE__ */ e("span", { className: "nice-error-text", children: "Passwords do not match" })
|
|
693
|
+
] }),
|
|
694
|
+
/* @__PURE__ */ e("button", { type: "submit", className: "nice-btn nice-btn--primary", disabled: !f, children: c ? "…" : "Change Password" })
|
|
695
|
+
]
|
|
696
|
+
}
|
|
697
|
+
);
|
|
698
|
+
}
|
|
699
|
+
),
|
|
700
|
+
{ displayName: "NiceChangePassword" }
|
|
701
|
+
), Te = /* @__PURE__ */ Object.assign(
|
|
702
|
+
/* @__PURE__ */ G(
|
|
703
|
+
({
|
|
704
|
+
secret: r,
|
|
705
|
+
qrCodeUrl: t,
|
|
706
|
+
issuer: c,
|
|
707
|
+
accountName: n,
|
|
708
|
+
onVerify: i,
|
|
709
|
+
loading: h = !1,
|
|
710
|
+
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(_));
|
|
721
|
+
},
|
|
722
|
+
[_, i]
|
|
723
|
+
), C = `otpauth://totp/${c ? `${c}:` : ""}${n ?? "user"}?secret=${r}${c ? `&issuer=${c}` : ""}&digits=6&period=30`;
|
|
724
|
+
return /* @__PURE__ */ a(
|
|
725
|
+
"div",
|
|
726
|
+
{
|
|
727
|
+
ref: k,
|
|
728
|
+
className: `nice-2fa-setup${A ? ` ${A}` : ""}`,
|
|
729
|
+
style: b,
|
|
730
|
+
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 })
|
|
737
|
+
] }),
|
|
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" })
|
|
741
|
+
] }),
|
|
742
|
+
/* @__PURE__ */ e(
|
|
743
|
+
"button",
|
|
744
|
+
{
|
|
745
|
+
type: "button",
|
|
746
|
+
className: "nice-btn nice-btn--primary",
|
|
747
|
+
onClick: () => d == null ? void 0 : d("verify"),
|
|
748
|
+
children: "Next — Verify"
|
|
749
|
+
}
|
|
750
|
+
)
|
|
751
|
+
] }),
|
|
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:" }),
|
|
754
|
+
l && /* @__PURE__ */ e("div", { className: "nice-2fa-setup__error", role: "alert", children: l }),
|
|
755
|
+
/* @__PURE__ */ e(
|
|
756
|
+
"input",
|
|
757
|
+
{
|
|
758
|
+
className: "nice-input nice-2fa-setup__code-input",
|
|
759
|
+
type: "text",
|
|
760
|
+
inputMode: "numeric",
|
|
761
|
+
maxLength: 6,
|
|
762
|
+
value: _,
|
|
763
|
+
onChange: (T) => F(T.target.value.replace(/\D/g, "").slice(0, 6)),
|
|
764
|
+
placeholder: "000000",
|
|
765
|
+
autoFocus: !0,
|
|
766
|
+
disabled: h,
|
|
767
|
+
autoComplete: "one-time-code"
|
|
768
|
+
}
|
|
769
|
+
),
|
|
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" }),
|
|
772
|
+
/* @__PURE__ */ e(
|
|
773
|
+
"button",
|
|
774
|
+
{
|
|
775
|
+
type: "submit",
|
|
776
|
+
className: "nice-btn nice-btn--primary",
|
|
777
|
+
disabled: h || _.length < 6,
|
|
778
|
+
children: h ? "…" : "Verify"
|
|
779
|
+
}
|
|
780
|
+
)
|
|
781
|
+
] })
|
|
782
|
+
] }),
|
|
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)) }),
|
|
786
|
+
/* @__PURE__ */ e(
|
|
787
|
+
"button",
|
|
788
|
+
{
|
|
789
|
+
type: "button",
|
|
790
|
+
className: "nice-btn",
|
|
791
|
+
onClick: () => {
|
|
792
|
+
var T;
|
|
793
|
+
(T = navigator.clipboard) == null || T.writeText(u.join(`
|
|
777
794
|
`)), M(!0);
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
);
|
|
788
|
-
|
|
789
|
-
|
|
795
|
+
},
|
|
796
|
+
children: f ? "Copied!" : "Copy all codes"
|
|
797
|
+
}
|
|
798
|
+
),
|
|
799
|
+
s && /* @__PURE__ */ e("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: s, children: "Done" })
|
|
800
|
+
] }),
|
|
801
|
+
s && S !== "recovery" && /* @__PURE__ */ e("button", { type: "button", className: "nice-2fa-setup__cancel", onClick: s, children: "Cancel" })
|
|
802
|
+
]
|
|
803
|
+
}
|
|
804
|
+
);
|
|
805
|
+
}
|
|
806
|
+
),
|
|
807
|
+
{ displayName: "NiceTwoFaSetup" }
|
|
808
|
+
), be = 500;
|
|
790
809
|
function V(r, t) {
|
|
791
810
|
return Math.floor(Math.random() * (t - r + 1)) + r;
|
|
792
811
|
}
|
|
793
|
-
function
|
|
812
|
+
function _e() {
|
|
794
813
|
return `${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;
|
|
795
814
|
}
|
|
796
|
-
function
|
|
815
|
+
function Ne(r, t) {
|
|
797
816
|
switch (r) {
|
|
798
817
|
case "math": {
|
|
799
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;
|
|
@@ -813,7 +832,7 @@ function ke(r, t) {
|
|
|
813
832
|
return { kind: "checkbox" };
|
|
814
833
|
}
|
|
815
834
|
}
|
|
816
|
-
function
|
|
835
|
+
function we(r, t, c) {
|
|
817
836
|
if (!r)
|
|
818
837
|
return;
|
|
819
838
|
const n = r.getContext("2d");
|
|
@@ -830,459 +849,459 @@ function Ce(r, t, c) {
|
|
|
830
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();
|
|
831
850
|
}
|
|
832
851
|
}
|
|
833
|
-
const
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
()
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
const
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
"
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
852
|
+
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)
|
|
888
|
+
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();
|
|
912
|
+
},
|
|
913
|
+
[R, N, L]
|
|
914
|
+
);
|
|
915
|
+
if (!c)
|
|
916
|
+
return u === "custom" && o ? /* @__PURE__ */ e(
|
|
917
|
+
"div",
|
|
918
|
+
{
|
|
919
|
+
ref: M,
|
|
920
|
+
className: `nice-captcha nice-captcha--custom${p ? ` ${p}` : ""}`,
|
|
921
|
+
style: f,
|
|
922
|
+
children: o
|
|
923
|
+
}
|
|
924
|
+
) : /* @__PURE__ */ e(
|
|
925
|
+
"div",
|
|
926
|
+
{
|
|
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
|
+
] })
|
|
944
|
+
] })
|
|
945
|
+
}
|
|
946
|
+
);
|
|
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(
|
|
905
949
|
"div",
|
|
906
950
|
{
|
|
907
951
|
ref: M,
|
|
908
|
-
className:
|
|
952
|
+
className: ie,
|
|
909
953
|
style: f,
|
|
910
|
-
"
|
|
954
|
+
role: "group",
|
|
955
|
+
"aria-label": "Captcha challenge",
|
|
956
|
+
"data-variant": c,
|
|
957
|
+
"data-status": N,
|
|
911
958
|
"data-theme": _,
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
/* @__PURE__ */ a("span", { children: [
|
|
915
|
-
"Captcha (",
|
|
916
|
-
u,
|
|
917
|
-
")"
|
|
918
|
-
] }),
|
|
919
|
-
/* @__PURE__ */ a("p", { children: [
|
|
920
|
-
"Load the ",
|
|
921
|
-
u,
|
|
922
|
-
" SDK to activate verification."
|
|
923
|
-
] })
|
|
924
|
-
] })
|
|
925
|
-
}
|
|
926
|
-
);
|
|
927
|
-
const B = N === "verifying", G = N === "verified", ie = `nice-captcha nice-captcha--${c} nice-captcha--${_} nice-captcha--${N}${F === "compact" ? " nice-captcha--compact" : ""}${p ? ` ${p}` : ""}`;
|
|
928
|
-
return /* @__PURE__ */ a(
|
|
929
|
-
"div",
|
|
930
|
-
{
|
|
931
|
-
ref: M,
|
|
932
|
-
className: ie,
|
|
933
|
-
style: f,
|
|
934
|
-
role: "group",
|
|
935
|
-
"aria-label": "Captcha challenge",
|
|
936
|
-
"data-variant": c,
|
|
937
|
-
"data-status": N,
|
|
938
|
-
"data-theme": _,
|
|
939
|
-
children: [
|
|
940
|
-
c === "checkbox" && /* @__PURE__ */ a(
|
|
941
|
-
"button",
|
|
942
|
-
{
|
|
943
|
-
type: "button",
|
|
944
|
-
className: "nice-captcha__checkbox",
|
|
945
|
-
role: "checkbox",
|
|
946
|
-
"aria-checked": G,
|
|
947
|
-
"aria-busy": B,
|
|
948
|
-
disabled: B || G,
|
|
949
|
-
onClick: ce,
|
|
950
|
-
children: [
|
|
951
|
-
/* @__PURE__ */ e("span", { className: "nice-captcha__box", "aria-hidden": "true", children: B ? "…" : G ? /* @__PURE__ */ e(
|
|
952
|
-
"span",
|
|
953
|
-
{
|
|
954
|
-
style: {
|
|
955
|
-
display: "inline-block",
|
|
956
|
-
width: "0.3em",
|
|
957
|
-
height: "0.6em",
|
|
958
|
-
marginBottom: "0.15em",
|
|
959
|
-
borderRight: "0.12em solid currentColor",
|
|
960
|
-
borderBottom: "0.12em solid currentColor",
|
|
961
|
-
transform: "rotate(45deg)"
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
) : "" }),
|
|
965
|
-
/* @__PURE__ */ e("span", { className: "nice-captcha__label", children: s })
|
|
966
|
-
]
|
|
967
|
-
}
|
|
968
|
-
),
|
|
969
|
-
c === "math" && R.kind === "math" && /* @__PURE__ */ a("div", { className: "nice-captcha__challenge", children: [
|
|
970
|
-
/* @__PURE__ */ a("span", { className: "nice-captcha__prompt", "aria-hidden": "true", children: [
|
|
971
|
-
R.prompt,
|
|
972
|
-
" ="
|
|
973
|
-
] }),
|
|
974
|
-
/* @__PURE__ */ e(
|
|
975
|
-
"input",
|
|
976
|
-
{
|
|
977
|
-
className: "nice-input nice-captcha__answer",
|
|
978
|
-
type: "number",
|
|
979
|
-
inputMode: "numeric",
|
|
980
|
-
value: D,
|
|
981
|
-
"aria-label": `What is ${R.prompt}?`,
|
|
982
|
-
disabled: B || G,
|
|
983
|
-
onChange: (y) => m(y.target.value),
|
|
984
|
-
onKeyDown: (y) => {
|
|
985
|
-
y.key === "Enter" && (y.preventDefault(), K());
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
),
|
|
989
|
-
/* @__PURE__ */ e(
|
|
959
|
+
children: [
|
|
960
|
+
c === "checkbox" && /* @__PURE__ */ a(
|
|
990
961
|
"button",
|
|
991
962
|
{
|
|
992
963
|
type: "button",
|
|
993
|
-
className: "nice-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
964
|
+
className: "nice-captcha__checkbox",
|
|
965
|
+
role: "checkbox",
|
|
966
|
+
"aria-checked": U,
|
|
967
|
+
"aria-busy": j,
|
|
968
|
+
disabled: j || U,
|
|
969
|
+
onClick: ce,
|
|
970
|
+
children: [
|
|
971
|
+
/* @__PURE__ */ e("span", { className: "nice-captcha__box", "aria-hidden": "true", children: j ? "…" : U ? /* @__PURE__ */ e(
|
|
972
|
+
"span",
|
|
973
|
+
{
|
|
974
|
+
style: {
|
|
975
|
+
display: "inline-block",
|
|
976
|
+
width: "0.3em",
|
|
977
|
+
height: "0.6em",
|
|
978
|
+
marginBottom: "0.15em",
|
|
979
|
+
borderRight: "0.12em solid currentColor",
|
|
980
|
+
borderBottom: "0.12em solid currentColor",
|
|
981
|
+
transform: "rotate(45deg)"
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
) : "" }),
|
|
985
|
+
/* @__PURE__ */ e("span", { className: "nice-captcha__label", children: s })
|
|
986
|
+
]
|
|
1009
987
|
}
|
|
1010
988
|
),
|
|
1011
|
-
/* @__PURE__ */
|
|
1012
|
-
"
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
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,
|
|
992
|
+
" ="
|
|
993
|
+
] }),
|
|
994
|
+
/* @__PURE__ */ e(
|
|
995
|
+
"input",
|
|
996
|
+
{
|
|
997
|
+
className: "nice-input nice-captcha__answer",
|
|
998
|
+
type: "number",
|
|
999
|
+
inputMode: "numeric",
|
|
1000
|
+
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());
|
|
1006
|
+
}
|
|
1024
1007
|
}
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
)
|
|
1037
|
-
|
|
1038
|
-
c === "slider" && R.kind === "slider" && /* @__PURE__ */ a("div", { className: "nice-captcha__challenge nice-captcha__challenge--slider", children: [
|
|
1039
|
-
/* @__PURE__ */ e("span", { className: "nice-captcha__slider-hint", "aria-hidden": "true", children: G ? "Verified" : "Slide to the marker" }),
|
|
1040
|
-
/* @__PURE__ */ a("div", { className: "nice-captcha__track", children: [
|
|
1008
|
+
),
|
|
1009
|
+
/* @__PURE__ */ e(
|
|
1010
|
+
"button",
|
|
1011
|
+
{
|
|
1012
|
+
type: "button",
|
|
1013
|
+
className: "nice-btn nice-btn--primary nice-captcha__verify",
|
|
1014
|
+
disabled: j || U || D.trim() === "",
|
|
1015
|
+
onClick: K,
|
|
1016
|
+
children: j ? "…" : "Verify"
|
|
1017
|
+
}
|
|
1018
|
+
)
|
|
1019
|
+
] }),
|
|
1020
|
+
c === "text" && R.kind === "text" && /* @__PURE__ */ a("div", { className: "nice-captcha__challenge", children: [
|
|
1041
1021
|
/* @__PURE__ */ e(
|
|
1042
|
-
"
|
|
1022
|
+
"canvas",
|
|
1043
1023
|
{
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1024
|
+
ref: w,
|
|
1025
|
+
className: "nice-captcha__canvas",
|
|
1026
|
+
width: 160,
|
|
1027
|
+
height: 56,
|
|
1028
|
+
"aria-hidden": "true"
|
|
1047
1029
|
}
|
|
1048
1030
|
),
|
|
1049
1031
|
/* @__PURE__ */ e(
|
|
1050
1032
|
"input",
|
|
1051
1033
|
{
|
|
1052
|
-
className: "nice-
|
|
1053
|
-
type: "
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
value:
|
|
1057
|
-
"aria-label": "
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1034
|
+
className: "nice-input nice-captcha__answer",
|
|
1035
|
+
type: "text",
|
|
1036
|
+
autoCapitalize: "characters",
|
|
1037
|
+
autoComplete: "off",
|
|
1038
|
+
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());
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
),
|
|
1047
|
+
/* @__PURE__ */ e(
|
|
1048
|
+
"button",
|
|
1049
|
+
{
|
|
1050
|
+
type: "button",
|
|
1051
|
+
className: "nice-btn nice-btn--primary nice-captcha__verify",
|
|
1052
|
+
disabled: j || U || D.trim() === "",
|
|
1053
|
+
onClick: K,
|
|
1054
|
+
children: j ? "…" : "Verify"
|
|
1055
|
+
}
|
|
1056
|
+
)
|
|
1057
|
+
] }),
|
|
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: [
|
|
1061
|
+
/* @__PURE__ */ e(
|
|
1062
|
+
"span",
|
|
1063
|
+
{
|
|
1064
|
+
className: "nice-captcha__target",
|
|
1065
|
+
"aria-hidden": "true",
|
|
1066
|
+
style: { left: `${R.target}%` }
|
|
1067
|
+
}
|
|
1068
|
+
),
|
|
1069
|
+
/* @__PURE__ */ e(
|
|
1070
|
+
"input",
|
|
1071
|
+
{
|
|
1072
|
+
className: "nice-captcha__slider",
|
|
1073
|
+
type: "range",
|
|
1074
|
+
min: 0,
|
|
1075
|
+
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))
|
|
1081
|
+
}
|
|
1082
|
+
)
|
|
1083
|
+
] })
|
|
1084
|
+
] }),
|
|
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(
|
|
1088
|
+
"button",
|
|
1089
|
+
{
|
|
1090
|
+
type: "button",
|
|
1091
|
+
className: "nice-captcha__refresh",
|
|
1092
|
+
"aria-label": "Refresh challenge",
|
|
1093
|
+
title: "Refresh challenge",
|
|
1094
|
+
onClick: P,
|
|
1095
|
+
children: /* @__PURE__ */ e(re, {})
|
|
1061
1096
|
}
|
|
1062
1097
|
)
|
|
1063
1098
|
] })
|
|
1064
|
-
]
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
type: "button",
|
|
1071
|
-
className: "nice-captcha__refresh",
|
|
1072
|
-
"aria-label": "Refresh challenge",
|
|
1073
|
-
title: "Refresh challenge",
|
|
1074
|
-
onClick: P,
|
|
1075
|
-
children: /* @__PURE__ */ e(re, {})
|
|
1076
|
-
}
|
|
1077
|
-
)
|
|
1078
|
-
] })
|
|
1079
|
-
]
|
|
1080
|
-
}
|
|
1081
|
-
);
|
|
1082
|
-
});
|
|
1083
|
-
xe.displayName = "NiceCaptcha";
|
|
1084
|
-
const $e = [
|
|
1099
|
+
]
|
|
1100
|
+
}
|
|
1101
|
+
);
|
|
1102
|
+
}),
|
|
1103
|
+
{ displayName: "NiceCaptcha" }
|
|
1104
|
+
), ve = [
|
|
1085
1105
|
{ id: "google", label: "Google", color: "#4285f4", textColor: "#fff" },
|
|
1086
1106
|
{ id: "microsoft", label: "Microsoft", color: "#00a4ef", textColor: "#fff" },
|
|
1087
1107
|
{ id: "discord", label: "Discord", color: "#5865f2", textColor: "#fff" },
|
|
1088
1108
|
{ id: "spotify", label: "Spotify", color: "#1db954", textColor: "#fff" },
|
|
1089
1109
|
{ id: "github", label: "GitHub", color: "#24292e", textColor: "#fff" }
|
|
1090
|
-
],
|
|
1091
|
-
(
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
/* @__PURE__ */
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
"
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1110
|
+
], Fe = /* @__PURE__ */ Object.assign(
|
|
1111
|
+
/* @__PURE__ */ G(
|
|
1112
|
+
({
|
|
1113
|
+
providers: r = ve,
|
|
1114
|
+
onProviderClick: t,
|
|
1115
|
+
disabled: c = !1,
|
|
1116
|
+
loadingProvider: n,
|
|
1117
|
+
direction: i = "vertical",
|
|
1118
|
+
separatorText: h = "or continue with",
|
|
1119
|
+
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
|
+
)
|
|
1152
|
+
),
|
|
1153
|
+
{ 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);
|
|
1167
|
+
try {
|
|
1168
|
+
const m = p ? parseInt(p, 10) : void 0, v = await i(k.trim(), F, m);
|
|
1169
|
+
w(v), _(""), o([]), b(!1);
|
|
1170
|
+
} finally {
|
|
1171
|
+
T(!1);
|
|
1172
|
+
}
|
|
1129
1173
|
}
|
|
1130
|
-
)
|
|
1131
|
-
)
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
function(t, c) {
|
|
1135
|
-
const {
|
|
1136
|
-
tokens: n,
|
|
1137
|
-
onCreate: i,
|
|
1138
|
-
onRevoke: h,
|
|
1139
|
-
availableScopes: l = [],
|
|
1140
|
-
maxTokens: s = 10,
|
|
1141
|
-
title: u = "API Tokens",
|
|
1142
|
-
className: S,
|
|
1143
|
-
style: d
|
|
1144
|
-
} = 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 () => {
|
|
1145
|
-
if (!(!i || !k.trim())) {
|
|
1146
|
-
T(!0);
|
|
1174
|
+
}, [i, k, F, p]), O = $(
|
|
1175
|
+
async (m) => {
|
|
1176
|
+
if (h) {
|
|
1177
|
+
N(m);
|
|
1147
1178
|
try {
|
|
1148
|
-
|
|
1149
|
-
w(v), _(""), o([]), b(!1);
|
|
1179
|
+
await h(m);
|
|
1150
1180
|
} finally {
|
|
1151
|
-
|
|
1181
|
+
N(null);
|
|
1152
1182
|
}
|
|
1153
1183
|
}
|
|
1154
|
-
},
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1184
|
+
},
|
|
1185
|
+
[h]
|
|
1186
|
+
), x = (m) => {
|
|
1187
|
+
o(
|
|
1188
|
+
(v) => v.includes(m) ? v.filter((z) => z !== m) : [...v, m]
|
|
1189
|
+
);
|
|
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 }),
|
|
1194
|
+
D && /* @__PURE__ */ e(
|
|
1195
|
+
"button",
|
|
1196
|
+
{
|
|
1197
|
+
className: "nice-token-management__new-btn",
|
|
1198
|
+
onClick: () => b(!0),
|
|
1199
|
+
disabled: A,
|
|
1200
|
+
children: "+ New Token"
|
|
1163
1201
|
}
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
/* @__PURE__ */
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1202
|
+
)
|
|
1203
|
+
] }),
|
|
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."
|
|
1208
|
+
] }),
|
|
1209
|
+
/* @__PURE__ */ e("code", { className: "nice-token-management__token-value", children: M }),
|
|
1210
|
+
/* @__PURE__ */ e("button", { onClick: () => w(null), children: "Dismiss" })
|
|
1211
|
+
] }),
|
|
1212
|
+
A && /* @__PURE__ */ a("div", { className: "nice-token-management__create-form", children: [
|
|
1213
|
+
/* @__PURE__ */ a("label", { children: [
|
|
1214
|
+
"Name",
|
|
1215
|
+
/* @__PURE__ */ e(
|
|
1216
|
+
"input",
|
|
1176
1217
|
{
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1218
|
+
type: "text",
|
|
1219
|
+
value: k,
|
|
1220
|
+
onChange: (m) => _(m.target.value),
|
|
1221
|
+
placeholder: "My API token",
|
|
1222
|
+
maxLength: 64
|
|
1181
1223
|
}
|
|
1182
1224
|
)
|
|
1183
1225
|
] }),
|
|
1184
|
-
|
|
1185
|
-
/* @__PURE__ */
|
|
1186
|
-
|
|
1187
|
-
" Copy it now — it won't be shown again."
|
|
1188
|
-
] }),
|
|
1189
|
-
/* @__PURE__ */ e("code", { className: "nice-token-management__token-value", children: M }),
|
|
1190
|
-
/* @__PURE__ */ e("button", { onClick: () => w(null), children: "Dismiss" })
|
|
1191
|
-
] }),
|
|
1192
|
-
A && /* @__PURE__ */ a("div", { className: "nice-token-management__create-form", children: [
|
|
1193
|
-
/* @__PURE__ */ a("label", { children: [
|
|
1194
|
-
"Name",
|
|
1195
|
-
/* @__PURE__ */ e(
|
|
1196
|
-
"input",
|
|
1197
|
-
{
|
|
1198
|
-
type: "text",
|
|
1199
|
-
value: k,
|
|
1200
|
-
onChange: (m) => _(m.target.value),
|
|
1201
|
-
placeholder: "My API token",
|
|
1202
|
-
maxLength: 64
|
|
1203
|
-
}
|
|
1204
|
-
)
|
|
1205
|
-
] }),
|
|
1206
|
-
l.length > 0 && /* @__PURE__ */ a("fieldset", { children: [
|
|
1207
|
-
/* @__PURE__ */ e("legend", { children: "Scopes" }),
|
|
1208
|
-
l.map((m) => /* @__PURE__ */ a("label", { className: "nice-token-management__scope", children: [
|
|
1209
|
-
/* @__PURE__ */ e(
|
|
1210
|
-
"input",
|
|
1211
|
-
{
|
|
1212
|
-
type: "checkbox",
|
|
1213
|
-
checked: F.includes(m),
|
|
1214
|
-
onChange: () => x(m)
|
|
1215
|
-
}
|
|
1216
|
-
),
|
|
1217
|
-
m
|
|
1218
|
-
] }, m))
|
|
1219
|
-
] }),
|
|
1220
|
-
/* @__PURE__ */ a("label", { children: [
|
|
1221
|
-
"Expires in (days)",
|
|
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: [
|
|
1222
1229
|
/* @__PURE__ */ e(
|
|
1223
1230
|
"input",
|
|
1224
1231
|
{
|
|
1225
|
-
type: "
|
|
1226
|
-
|
|
1227
|
-
onChange: (
|
|
1228
|
-
min: 1,
|
|
1229
|
-
max: 365
|
|
1232
|
+
type: "checkbox",
|
|
1233
|
+
checked: F.includes(m),
|
|
1234
|
+
onChange: () => x(m)
|
|
1230
1235
|
}
|
|
1231
|
-
)
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
/* @__PURE__ */ e("button", { onClick: I, disabled: C || !k.trim(), children: C ? "Creating…" : "Create Token" }),
|
|
1235
|
-
/* @__PURE__ */ e("button", { onClick: () => b(!1), children: "Cancel" })
|
|
1236
|
-
] })
|
|
1236
|
+
),
|
|
1237
|
+
m
|
|
1238
|
+
] }, m))
|
|
1237
1239
|
] }),
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
"…"
|
|
1255
|
-
] }) }),
|
|
1256
|
-
/* @__PURE__ */ e("td", { children: m.createdAt }),
|
|
1257
|
-
/* @__PURE__ */ e("td", { children: m.expiresAt ?? "—" }),
|
|
1258
|
-
/* @__PURE__ */ e("td", { children: m.lastUsedAt ?? "Never" }),
|
|
1259
|
-
/* @__PURE__ */ e("td", { children: ((v = m.scopes) == null ? void 0 : v.join(", ")) || "—" }),
|
|
1260
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
1261
|
-
"button",
|
|
1262
|
-
{
|
|
1263
|
-
className: "nice-token-management__revoke-btn",
|
|
1264
|
-
onClick: () => L(m.id),
|
|
1265
|
-
disabled: E === m.id,
|
|
1266
|
-
children: E === m.id ? "Revoking…" : "Revoke"
|
|
1267
|
-
}
|
|
1268
|
-
) })
|
|
1269
|
-
] }, m.id);
|
|
1270
|
-
}) })
|
|
1240
|
+
/* @__PURE__ */ a("label", { children: [
|
|
1241
|
+
"Expires in (days)",
|
|
1242
|
+
/* @__PURE__ */ e(
|
|
1243
|
+
"input",
|
|
1244
|
+
{
|
|
1245
|
+
type: "number",
|
|
1246
|
+
value: p,
|
|
1247
|
+
onChange: (m) => f(m.target.value),
|
|
1248
|
+
min: 1,
|
|
1249
|
+
max: 365
|
|
1250
|
+
}
|
|
1251
|
+
)
|
|
1252
|
+
] }),
|
|
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" })
|
|
1271
1256
|
] })
|
|
1272
|
-
] })
|
|
1273
|
-
|
|
1274
|
-
|
|
1257
|
+
] }),
|
|
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" }),
|
|
1266
|
+
/* @__PURE__ */ e("th", {})
|
|
1267
|
+
] }) }),
|
|
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,
|
|
1274
|
+
"…"
|
|
1275
|
+
] }) }),
|
|
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(", ")) || "—" }),
|
|
1280
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
1281
|
+
"button",
|
|
1282
|
+
{
|
|
1283
|
+
className: "nice-token-management__revoke-btn",
|
|
1284
|
+
onClick: () => O(m.id),
|
|
1285
|
+
disabled: E === m.id,
|
|
1286
|
+
children: E === m.id ? "Revoking…" : "Revoke"
|
|
1287
|
+
}
|
|
1288
|
+
) })
|
|
1289
|
+
] }, m.id);
|
|
1290
|
+
}) })
|
|
1291
|
+
] })
|
|
1292
|
+
] });
|
|
1293
|
+
});
|
|
1275
1294
|
export {
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1295
|
+
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,
|
|
1283
1302
|
Me as NiceTokenManagement,
|
|
1284
|
-
|
|
1285
|
-
|
|
1303
|
+
Te as NiceTwoFaSetup,
|
|
1304
|
+
X as calcPasswordStrength,
|
|
1286
1305
|
te as generatePassword,
|
|
1287
|
-
|
|
1306
|
+
Ce as useAuth
|
|
1288
1307
|
};
|