@huyooo/ui 2.0.7 → 2.0.9

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.
Files changed (51) hide show
  1. package/dist/{AuthkitAppSetting-CX4WTwNd.js → AuthkitAppSetting-DoC2RJh7.js} +787 -752
  2. package/dist/{Contact-CBGSJC2q.js → Contact-Ck3LVLx-.js} +3 -3
  3. package/dist/{FeedbackModal.vue_vue_type_script_setup_true_lang-BNBzOqrv.js → FeedbackModal.vue_vue_type_script_setup_true_lang-hveEkBb4.js} +2 -2
  4. package/dist/{LandingPageLinkGroup-BZJ48Yss.js → LandingPageLinkGroup-DTFhrYK1.js} +1 -1
  5. package/dist/{LandingPageSectionTabs-jRjkWlM-.js → LandingPageSectionTabs-Bm_zZrfT.js} +1 -1
  6. package/dist/LegalDocViewer-DBr0x1ZE.js +2497 -0
  7. package/dist/{Logo-D7fyXyB-.js → Logo-B9DFBxDU.js} +1 -1
  8. package/dist/{PaySubscriptions-BSkcUqHk.js → PaySubscriptions-Bv6LQ_Pf.js} +1 -1
  9. package/dist/{PricingPlans-CyFvgf18.js → PricingPlans-CQaXgOIR.js} +3 -3
  10. package/dist/{ReferrerReferees-Mvv6oiqe.js → ReferrerReferees-CGrH-gYJ.js} +1 -1
  11. package/dist/{Upload.vue_vue_type_script_setup_true_lang-oa6LJgCY.js → Upload.vue_vue_type_script_setup_true_lang-CgZQOZYt.js} +1 -1
  12. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-V5EzZMCL.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-QE1ARaXY.js} +195 -211
  13. package/dist/WidthContainer-Clc_WxY_.js +706 -0
  14. package/dist/authkit.d.ts +1 -0
  15. package/dist/authkit.js +51 -50
  16. package/dist/common/globalConfig.d.ts +0 -5
  17. package/dist/common.js +2 -2
  18. package/dist/components/Authkit/Auth/AuthkitOauthCallback.vue.d.ts +1 -3
  19. package/dist/components/Gradientbackground.vue.d.ts +1 -1
  20. package/dist/components/UserMenu/UserMenu.vue.d.ts +2 -2
  21. package/dist/composables/Authkit/oauthCallback.d.ts +14 -0
  22. package/dist/composables/Authkit/useAppBrand.d.ts +7 -0
  23. package/dist/composables/Authkit/useAuthkitUsersProfile.d.ts +2 -0
  24. package/dist/composables/Authkit/useOAuthCallbackHandler.d.ts +11 -0
  25. package/dist/composables/Authkit/useOauth.d.ts +3 -3
  26. package/dist/composables.d.ts +1 -0
  27. package/dist/composables.js +39 -38
  28. package/dist/feedback.js +1 -1
  29. package/dist/{fetchAuthPageAboutUs-CP5a7jIo.js → fetchAuthPageAboutUs-DV7ArpNZ.js} +1 -1
  30. package/dist/landingPage.js +3 -3
  31. package/dist/main.js +239 -237
  32. package/dist/pay.js +3 -3
  33. package/dist/privateCom.js +1 -1
  34. package/dist/referrer.js +1 -1
  35. package/dist/{runtime-qs4IasEB.js → runtime-Dp7MgwhI.js} +115 -116
  36. package/dist/style.css +1 -1
  37. package/dist/upload.js +2 -2
  38. package/dist/{useAuthkitAuth-BPTZUSkM.js → useAuthkitAuth-cHrJMM8E.js} +48 -47
  39. package/dist/useAuthkitUsersProfile-8FzLTfUJ.js +55 -0
  40. package/dist/{useEnsureAuthenticated-CncOvj2H.js → useEnsureAuthenticated-C8qS8DLL.js} +1 -1
  41. package/dist/{useLegalDocs-BZlntAI7.js → useLegalDocs-C4qk5CTb.js} +1 -1
  42. package/dist/{usePageSEO-DwhbUUjW.js → usePageSEO-Dl6_kBWP.js} +1 -1
  43. package/dist/useRoutePermission-DYPZgvYv.js +247 -0
  44. package/dist/{useSubscriptionCheckout-BDDCRxSs.js → useSubscriptionCheckout-CYU2Ke0y.js} +1 -1
  45. package/dist/user.js +1 -1
  46. package/package.json +1 -1
  47. package/dist/LegalDocViewer-DPUiWxcR.js +0 -2492
  48. package/dist/WidthContainer-Dts5qV1W.js +0 -717
  49. package/dist/components/UserMenu/parts/UserMenuAuthPlaceholder.vue.d.ts +0 -7
  50. package/dist/useAuthkitUsersProfile-BclJWOvR.js +0 -45
  51. package/dist/useRoutePermission-CePjXomb.js +0 -218
@@ -0,0 +1,2497 @@
1
+ import { defineComponent as V, computed as T, openBlock as l, createElementBlock as k, normalizeStyle as G, normalizeClass as he, renderSlot as Z, createBlock as S, unref as e, createCommentVNode as I, createElementVNode as _, toDisplayString as L, ref as A, createVNode as i, withCtx as p, createTextVNode as O, watchEffect as ne, Fragment as D, renderList as re, useModel as Ue, watch as ye, mergeModels as $e, useSlots as Re, onMounted as E, onUnmounted as ue, Teleport as Te } from "vue";
2
+ import { useRouter as be, useRoute as qe } from "vue-router";
3
+ /* empty css */
4
+ /* empty css */
5
+ import "./userMenuModal-D-nDaYqM.js";
6
+ import { Message as X, Form as H, FormItem as P, Input as C, Button as B, Link as Y, Tabs as de, TabPane as ce, Checkbox as Oe, Modal as xe, List as Le, ListItem as ae, ListItemMeta as oe, Avatar as te, Alert as fe, Spin as Be, Empty as Me } from "@arco-design/web-vue";
7
+ import { a as F, u as N } from "./useAuthkitAuth-cHrJMM8E.js";
8
+ import { g as M, u as we } from "./apiClients-Ctcq8NZs.js";
9
+ import { u as j } from "./useAuthkitAppsAuthPageInfo-DZ1p-P3Q.js";
10
+ import { o as ve, j as Fe, k as ge, l as _e, u as De, m as Ee, n as He, p as Q, q as Ge, i as ke, S as W, r as K, s as Se, t as ze, v as le, w as Ne, x as je, b as We } from "./AuthkitAppSetting-DoC2RJh7.js";
11
+ import { _ as U } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
+ /* empty css */
13
+ import "./index-Cn6LcfZO.js";
14
+ /* empty css */
15
+ import { u as Ie, L as Ke, i as Je } from "./useLegalDocs-C4qk5CTb.js";
16
+ import { u as pe } from "./runtime-Dp7MgwhI.js";
17
+ import { u as Ae } from "./useAuthkitUsersProfile-8FzLTfUJ.js";
18
+ /* empty css */
19
+ /* empty css */
20
+ import "./CustomTable-HDwqEcmB.js";
21
+ /* empty css */
22
+ import { TiptapEditor as Qe, TiptapTitle as Xe } from "@huyooo/vue-tiptap";
23
+ import { f as Ye } from "./fetchAuthPageAboutUs-DV7ArpNZ.js";
24
+ const Ze = ["title", "aria-label", "disabled"], et = {
25
+ key: 0,
26
+ class: "OAuthItem__spinner"
27
+ }, tt = /* @__PURE__ */ V({
28
+ __name: "AuthkitOauthItem",
29
+ props: {
30
+ size: {
31
+ type: String,
32
+ required: !0
33
+ },
34
+ icon: {
35
+ type: String,
36
+ default: ""
37
+ },
38
+ label: {
39
+ type: String,
40
+ required: !0
41
+ },
42
+ loading: {
43
+ type: Boolean,
44
+ default: !1
45
+ },
46
+ disabled: {
47
+ type: Boolean,
48
+ default: !1
49
+ }
50
+ },
51
+ setup(b) {
52
+ const r = b, u = T(() => ({
53
+ width: `${ge}px`,
54
+ height: `${ge}px`,
55
+ padding: `${Fe}px`,
56
+ "--oauth-icon-size": `${ve}px`
57
+ }));
58
+ return (o, h) => (l(), k("button", {
59
+ class: he(["OAuthItem", {
60
+ "OAuthItem--loading": r.loading
61
+ }]),
62
+ type: "button",
63
+ title: r.label,
64
+ "aria-label": r.label,
65
+ disabled: r.disabled || r.loading,
66
+ style: G(u.value)
67
+ }, [r.loading ? (l(), k("span", et)) : Z(o.$slots, "icon", {
68
+ key: 1
69
+ }, () => [r.icon ? (l(), S(_e, {
70
+ key: 0,
71
+ icon: r.icon,
72
+ size: e(ve)
73
+ }, null, 8, ["icon", "size"])) : I("", !0)], !0)], 14, Ze));
74
+ }
75
+ }), J = /* @__PURE__ */ U(tt, [["__scopeId", "data-v-e00c1d80"]]), st = {
76
+ class: "OAuthList"
77
+ }, it = {
78
+ key: 0,
79
+ class: "OAuthDivider"
80
+ }, at = {
81
+ key: 1,
82
+ class: "OAuthHint"
83
+ }, ot = /* @__PURE__ */ V({
84
+ __name: "AuthkitOauthList",
85
+ props: {
86
+ size: {
87
+ type: String,
88
+ default: () => "large"
89
+ }
90
+ },
91
+ emits: ["passkeySubmit"],
92
+ setup(b, {
93
+ emit: r
94
+ }) {
95
+ const u = r, {
96
+ appsData: o
97
+ } = j(), {
98
+ loading: h,
99
+ supported: g,
100
+ loginWithPasskey: a,
101
+ formatError: s
102
+ } = De(), {
103
+ githubAuth: d,
104
+ googleAuth: v,
105
+ microsoftAuth: t,
106
+ wechatAuth: f
107
+ } = ke(), {
108
+ acceptedTerms: n,
109
+ ensureTermsAcceptedForSignIn: w
110
+ } = F();
111
+ function c($) {
112
+ w() && $({
113
+ acceptedTerms: n.value ? !0 : void 0
114
+ });
115
+ }
116
+ const m = b, y = T(() => o.value.authMethods.login.passkey && Ee() || ""), z = T(() => {
117
+ const $ = o.value.oauth, R = $.google.enabled || $.microsoft.enabled || $.github.enabled || $.wechat.enabled, x = o.value.authMethods.login.passkey;
118
+ return R || x;
119
+ });
120
+ async function q() {
121
+ if (w())
122
+ try {
123
+ const $ = await a();
124
+ if (!$)
125
+ return;
126
+ u("passkeySubmit", $);
127
+ } catch ($) {
128
+ const R = s($);
129
+ if ($ instanceof Error && $.name === "NotAllowedError") {
130
+ X.warning(R);
131
+ return;
132
+ }
133
+ X.error(R);
134
+ }
135
+ }
136
+ return ($, R) => (l(), k("div", st, [z.value ? (l(), k("div", it, [...R[4] || (R[4] = [_("span", null, "其他登录方式", -1)])])) : I("", !0), _("div", {
137
+ class: "OAuthIcons",
138
+ style: G({
139
+ gap: `${e(He)}px`
140
+ })
141
+ }, [e(o).oauth.google.enabled ? (l(), S(J, {
142
+ key: 0,
143
+ icon: e(Q).google,
144
+ label: "Google",
145
+ size: m.size,
146
+ onClick: R[0] || (R[0] = (x) => c(e(v)))
147
+ }, null, 8, ["icon", "size"])) : I("", !0), e(o).oauth.github.enabled ? (l(), S(J, {
148
+ key: 1,
149
+ icon: e(Q).github,
150
+ label: "Github",
151
+ size: m.size,
152
+ onClick: R[1] || (R[1] = (x) => c(e(d)))
153
+ }, null, 8, ["icon", "size"])) : I("", !0), e(o).oauth.microsoft.enabled ? (l(), S(J, {
154
+ key: 2,
155
+ icon: e(Q).microsoft,
156
+ label: "Microsoft",
157
+ size: m.size,
158
+ onClick: R[2] || (R[2] = (x) => c(e(t)))
159
+ }, null, 8, ["icon", "size"])) : I("", !0), e(o).oauth.wechat.enabled ? (l(), S(J, {
160
+ key: 3,
161
+ icon: e(Q).wechat,
162
+ label: "微信",
163
+ size: m.size,
164
+ onClick: R[3] || (R[3] = (x) => c(e(f)))
165
+ }, null, 8, ["icon", "size"])) : I("", !0), e(o).authMethods.login.passkey ? (l(), S(J, {
166
+ key: 4,
167
+ icon: e(Ge),
168
+ label: "Passkey",
169
+ size: m.size,
170
+ loading: e(h),
171
+ disabled: !e(g),
172
+ onClick: q
173
+ }, null, 8, ["icon", "size", "loading", "disabled"])) : I("", !0)], 4), y.value ? (l(), k("p", at, L(y.value), 1)) : I("", !0)]));
174
+ }
175
+ }), lt = /* @__PURE__ */ U(ot, [["__scopeId", "data-v-aa6a61de"]]), nt = {
176
+ class: "content"
177
+ }, rt = {
178
+ class: "sendVerifyCodeItem"
179
+ }, ut = {
180
+ class: "handle"
181
+ }, dt = /* @__PURE__ */ V({
182
+ __name: "AuthkitPasswordUpdateAndVerify",
183
+ props: {
184
+ size: {
185
+ type: String,
186
+ required: !0
187
+ },
188
+ loading: {
189
+ type: Boolean,
190
+ required: !0,
191
+ default: () => !0
192
+ }
193
+ },
194
+ emits: ["signIn", "submit"],
195
+ setup(b, {
196
+ emit: r
197
+ }) {
198
+ const u = r, o = b, h = A(), g = A(!1), a = A(), s = A({
199
+ email: void 0,
200
+ userToken: void 0,
201
+ emailVerifyId: void 0,
202
+ password: void 0,
203
+ confirmPassword: void 0
204
+ });
205
+ async function d() {
206
+ if (!await a.value.validateField(["email"])) {
207
+ g.value = !0;
208
+ const f = await M().auth.verify.email.retry.post({
209
+ email: s.value.email,
210
+ purpose: "resetPassword"
211
+ });
212
+ g.value = !1, f.data && (s.value.emailVerifyId = f.data.emailVerifyId), K(h.value, f);
213
+ }
214
+ }
215
+ async function v() {
216
+ a.value.validate().then((t) => {
217
+ t || u("submit", s.value);
218
+ });
219
+ }
220
+ return (t, f) => (l(), k("div", nt, [i(e(H), {
221
+ ref_key: "formRef",
222
+ ref: a,
223
+ model: s.value,
224
+ size: o.size,
225
+ "auto-label-width": ""
226
+ }, {
227
+ default: p(() => [i(e(P), {
228
+ field: "email",
229
+ label: "邮箱",
230
+ "hide-label": "",
231
+ rules: [{
232
+ required: !0,
233
+ message: "请输入邮箱"
234
+ }, {
235
+ type: "email",
236
+ message: "请输入有效的邮箱"
237
+ }]
238
+ }, {
239
+ default: p(() => [i(e(C), {
240
+ modelValue: s.value.email,
241
+ "onUpdate:modelValue": f[0] || (f[0] = (n) => s.value.email = n),
242
+ placeholder: "请输入邮箱"
243
+ }, null, 8, ["modelValue"])]),
244
+ _: 1
245
+ }), i(e(P), {
246
+ field: "userToken",
247
+ label: "验证码",
248
+ "hide-label": "",
249
+ rules: [{
250
+ required: !0,
251
+ message: "请输入验证码"
252
+ }]
253
+ }, {
254
+ default: p(() => [_("div", rt, [i(e(C), {
255
+ modelValue: s.value.userToken,
256
+ "onUpdate:modelValue": f[1] || (f[1] = (n) => s.value.userToken = n),
257
+ placeholder: "请输入验证码"
258
+ }, null, 8, ["modelValue"]), i(W, {
259
+ ref_key: "SendVerifyCodeRef",
260
+ ref: h,
261
+ size: o.size,
262
+ loading: g.value,
263
+ style: {
264
+ "margin-left": "10px"
265
+ },
266
+ onSend: d
267
+ }, null, 8, ["size", "loading"])])]),
268
+ _: 1
269
+ }), i(e(P), {
270
+ field: "password",
271
+ label: "密码",
272
+ "hide-label": "",
273
+ rules: [{
274
+ required: !0,
275
+ message: "密码请输入"
276
+ }, {
277
+ minLength: 10,
278
+ message: "密码不能少于10字符"
279
+ }]
280
+ }, {
281
+ default: p(() => [i(e(C), {
282
+ modelValue: s.value.password,
283
+ "onUpdate:modelValue": f[2] || (f[2] = (n) => s.value.password = n),
284
+ placeholder: "请输入密码",
285
+ type: "password",
286
+ autocomplete: ""
287
+ }, null, 8, ["modelValue"])]),
288
+ _: 1
289
+ }), i(e(P), {
290
+ field: "confirmPassword",
291
+ label: "确认密码",
292
+ "hide-label": "",
293
+ rules: [{
294
+ required: !0,
295
+ message: "请输入确认密码"
296
+ }, {
297
+ minLength: 10,
298
+ message: "确认密码不能少于10字符"
299
+ }, {
300
+ validator: (n, w) => {
301
+ n !== s.value.password ? w("两次密码输入不一致,请重新输入") : w();
302
+ }
303
+ }]
304
+ }, {
305
+ default: p(() => [i(e(C), {
306
+ modelValue: s.value.confirmPassword,
307
+ "onUpdate:modelValue": f[3] || (f[3] = (n) => s.value.confirmPassword = n),
308
+ placeholder: "请输入确认密码密码",
309
+ type: "password",
310
+ autocomplete: ""
311
+ }, null, 8, ["modelValue"])]),
312
+ _: 1
313
+ }, 8, ["rules"]), _("div", ut, [i(e(B), {
314
+ type: "primary",
315
+ loading: o.loading,
316
+ long: "",
317
+ size: o.size,
318
+ onClick: v
319
+ }, {
320
+ default: p(() => [...f[4] || (f[4] = [O(" 提交 ", -1)])]),
321
+ _: 1
322
+ }, 8, ["loading", "size"])])]),
323
+ _: 1
324
+ }, 8, ["model", "size"])]));
325
+ }
326
+ }), ct = /* @__PURE__ */ U(dt, [["__scopeId", "data-v-4091e418"]]), pt = {
327
+ class: "content"
328
+ }, mt = {
329
+ class: "sendVerifyCodeItem"
330
+ }, ft = /* @__PURE__ */ V({
331
+ __name: "AuthkitPhonePasswordUpdateAndVerify",
332
+ props: {
333
+ size: {
334
+ type: String,
335
+ required: !0
336
+ },
337
+ loading: {
338
+ type: Boolean,
339
+ required: !0,
340
+ default: () => !0
341
+ }
342
+ },
343
+ emits: ["submit"],
344
+ setup(b, {
345
+ emit: r
346
+ }) {
347
+ const u = r, o = b, h = A(), g = A(!1), a = A(), s = A({
348
+ phone: void 0,
349
+ code: void 0,
350
+ password: void 0,
351
+ confirmPassword: void 0
352
+ }), d = [{
353
+ required: !0,
354
+ message: "请输入确认密码"
355
+ }, {
356
+ minLength: 10,
357
+ message: "确认密码不能少于10字符"
358
+ }, {
359
+ validator: (f, n) => {
360
+ if (f !== s.value.password) {
361
+ n("两次密码输入不一致,请重新输入");
362
+ return;
363
+ }
364
+ n();
365
+ }
366
+ }];
367
+ async function v() {
368
+ if (!await a.value.validateField(["phone"])) {
369
+ g.value = !0;
370
+ const n = await M().auth.verify.sms.send.post({
371
+ phone: s.value.phone,
372
+ purpose: "resetPassword"
373
+ });
374
+ g.value = !1, K(h.value, n);
375
+ }
376
+ }
377
+ async function t() {
378
+ a.value.validate().then((f) => {
379
+ f || u("submit", {
380
+ method: "phone",
381
+ phone: s.value.phone,
382
+ code: s.value.code,
383
+ password: s.value.password
384
+ });
385
+ });
386
+ }
387
+ return (f, n) => (l(), k("div", pt, [i(e(H), {
388
+ ref_key: "formRef",
389
+ ref: a,
390
+ model: s.value,
391
+ size: o.size,
392
+ "auto-label-width": ""
393
+ }, {
394
+ default: p(() => [i(e(P), {
395
+ field: "phone",
396
+ label: "手机号",
397
+ "hide-label": "",
398
+ rules: [{
399
+ required: !0,
400
+ message: "请输入手机号"
401
+ }, {
402
+ match: /^1[3-9]\d{9}$/,
403
+ message: "请输入有效的手机号"
404
+ }]
405
+ }, {
406
+ default: p(() => [i(e(C), {
407
+ modelValue: s.value.phone,
408
+ "onUpdate:modelValue": n[0] || (n[0] = (w) => s.value.phone = w),
409
+ placeholder: "请输入手机号",
410
+ autocomplete: "tel",
411
+ type: "tel"
412
+ }, null, 8, ["modelValue"])]),
413
+ _: 1
414
+ }), i(e(P), {
415
+ field: "code",
416
+ label: "验证码",
417
+ "hide-label": "",
418
+ rules: [{
419
+ required: !0,
420
+ message: "请输入验证码"
421
+ }]
422
+ }, {
423
+ default: p(() => [_("div", mt, [i(e(C), {
424
+ modelValue: s.value.code,
425
+ "onUpdate:modelValue": n[1] || (n[1] = (w) => s.value.code = w),
426
+ placeholder: "请输入验证码",
427
+ autocomplete: "one-time-code"
428
+ }, null, 8, ["modelValue"]), i(W, {
429
+ ref_key: "SendVerifyCodeRef",
430
+ ref: h,
431
+ size: o.size,
432
+ loading: g.value,
433
+ style: {
434
+ "margin-left": "10px"
435
+ },
436
+ onSend: v
437
+ }, null, 8, ["size", "loading"])])]),
438
+ _: 1
439
+ }), i(e(P), {
440
+ field: "password",
441
+ label: "密码",
442
+ "hide-label": "",
443
+ rules: [{
444
+ required: !0,
445
+ message: "密码请输入"
446
+ }, {
447
+ minLength: 10,
448
+ message: "密码不能少于10字符"
449
+ }]
450
+ }, {
451
+ default: p(() => [i(e(C), {
452
+ modelValue: s.value.password,
453
+ "onUpdate:modelValue": n[2] || (n[2] = (w) => s.value.password = w),
454
+ placeholder: "请输入密码",
455
+ type: "password",
456
+ autocomplete: "new-password"
457
+ }, null, 8, ["modelValue"])]),
458
+ _: 1
459
+ }), i(e(P), {
460
+ field: "confirmPassword",
461
+ label: "确认密码",
462
+ "hide-label": "",
463
+ rules: d
464
+ }, {
465
+ default: p(() => [i(e(C), {
466
+ modelValue: s.value.confirmPassword,
467
+ "onUpdate:modelValue": n[3] || (n[3] = (w) => s.value.confirmPassword = w),
468
+ placeholder: "请输入确认密码",
469
+ type: "password",
470
+ autocomplete: "new-password"
471
+ }, null, 8, ["modelValue"])]),
472
+ _: 1
473
+ }), i(e(B), {
474
+ type: "primary",
475
+ loading: o.loading,
476
+ long: "",
477
+ size: o.size,
478
+ onClick: t
479
+ }, {
480
+ default: p(() => [...n[4] || (n[4] = [O(" 提交 ", -1)])]),
481
+ _: 1
482
+ }, 8, ["loading", "size"])]),
483
+ _: 1
484
+ }, 8, ["model", "size"])]));
485
+ }
486
+ }), vt = /* @__PURE__ */ U(ft, [["__scopeId", "data-v-a01a994e"]]), gt = {
487
+ class: "SwitchSignIn"
488
+ }, ht = /* @__PURE__ */ V({
489
+ __name: "AuthkitSwitchSignIn",
490
+ emits: ["switchSignIn"],
491
+ setup(b, {
492
+ emit: r
493
+ }) {
494
+ const u = r;
495
+ function o() {
496
+ u("switchSignIn");
497
+ }
498
+ return (h, g) => (l(), k("div", gt, [_("span", null, [g[1] || (g[1] = _("span", null, "已经有账号?", -1)), i(e(Y), {
499
+ style: {
500
+ padding: "0px"
501
+ },
502
+ onClick: o
503
+ }, {
504
+ default: p(() => [...g[0] || (g[0] = [O("去登录", -1)])]),
505
+ _: 1
506
+ })])]));
507
+ }
508
+ }), me = /* @__PURE__ */ U(ht, [["__scopeId", "data-v-c09d6c18"]]), yt = {
509
+ class: "ResetPassword"
510
+ }, bt = {
511
+ key: 0,
512
+ class: "tabsContainer"
513
+ }, wt = {
514
+ key: 3,
515
+ class: "empty"
516
+ }, _t = /* @__PURE__ */ V({
517
+ __name: "AuthkitResetPassword",
518
+ props: {
519
+ size: {
520
+ type: String,
521
+ required: !0,
522
+ default: () => "large"
523
+ },
524
+ loading: {
525
+ type: Boolean,
526
+ required: !0,
527
+ default: () => !0
528
+ }
529
+ },
530
+ emits: ["switchSignIn", "submit"],
531
+ setup(b, {
532
+ emit: r
533
+ }) {
534
+ const u = r, o = b, {
535
+ appsData: h
536
+ } = j(), g = T(() => h.value.authMethods), a = T(() => {
537
+ const t = [];
538
+ return g.value.login.emailPassword && t.push({
539
+ key: "email",
540
+ title: "邮箱找回"
541
+ }), g.value.login.phonePassword && t.push({
542
+ key: "phone",
543
+ title: "手机号找回"
544
+ }), t;
545
+ }), s = A("email");
546
+ ne(() => {
547
+ var t;
548
+ a.value.some((f) => f.key === s.value) || (s.value = ((t = a.value[0]) == null ? void 0 : t.key) || "email");
549
+ });
550
+ function d() {
551
+ u("switchSignIn");
552
+ }
553
+ async function v(t) {
554
+ u("submit", {
555
+ method: s.value,
556
+ ...t
557
+ });
558
+ }
559
+ return (t, f) => (l(), k("div", yt, [a.value.length > 1 ? (l(), k("div", bt, [i(e(de), {
560
+ "active-key": s.value,
561
+ "onUpdate:activeKey": f[0] || (f[0] = (n) => s.value = n)
562
+ }, {
563
+ default: p(() => [(l(!0), k(D, null, re(a.value, (n) => (l(), S(e(ce), {
564
+ key: n.key,
565
+ title: n.title
566
+ }, null, 8, ["title"]))), 128))]),
567
+ _: 1
568
+ }, 8, ["active-key"])])) : I("", !0), s.value === "email" && g.value.login.emailPassword ? (l(), S(ct, {
569
+ key: 1,
570
+ loading: b.loading,
571
+ size: o.size,
572
+ onSubmit: v
573
+ }, null, 8, ["loading", "size"])) : s.value === "phone" && g.value.login.phonePassword ? (l(), S(vt, {
574
+ key: 2,
575
+ loading: b.loading,
576
+ size: o.size,
577
+ onSubmit: v
578
+ }, null, 8, ["loading", "size"])) : (l(), k("div", wt, "当前应用未开放找回密码")), i(me, {
579
+ onSwitchSignIn: d
580
+ })]));
581
+ }
582
+ }), kt = /* @__PURE__ */ U(_t, [["__scopeId", "data-v-90d789bb"]]);
583
+ let se = null, ie = null;
584
+ function St(b) {
585
+ se = b.onPrivacyPolicy ?? null, ie = b.onUserServiceAgreement ?? null;
586
+ }
587
+ function zt() {
588
+ se == null || se();
589
+ }
590
+ function It() {
591
+ ie == null || ie();
592
+ }
593
+ const At = {
594
+ key: 2
595
+ }, Pt = /* @__PURE__ */ V({
596
+ __name: "AuthkitServiceAgreementAndPrivacyProtection",
597
+ props: /* @__PURE__ */ $e({
598
+ currentView: {}
599
+ }, {
600
+ acceptedTerms: {
601
+ type: Boolean,
602
+ default: !1
603
+ },
604
+ acceptedTermsModifiers: {}
605
+ }),
606
+ emits: ["update:acceptedTerms"],
607
+ setup(b) {
608
+ const {
609
+ config: r
610
+ } = pe(), u = b, o = Ue(b, "acceptedTerms"), {
611
+ getLink: h,
612
+ openLegalDoc: g
613
+ } = Ie(), {
614
+ termsShaking: a,
615
+ requiresAcceptanceForSignUp: s,
616
+ requiresAcceptanceForOAuth: d,
617
+ syncAcceptedTerms: v
618
+ } = F();
619
+ ye(o, (z) => {
620
+ v(z);
621
+ });
622
+ const t = T(() => {
623
+ const z = h("userServiceAgreement");
624
+ return z != null && z.configured ? z : void 0;
625
+ }), f = T(() => {
626
+ const z = h("privacyPolicy");
627
+ return z != null && z.configured ? z : void 0;
628
+ }), n = T(() => !!(t.value || f.value)), w = T(() => u.currentView === "signUp" ? s() : u.currentView === "signIn" ? d() : !1), c = T(() => n.value && w.value);
629
+ function m() {
630
+ if (r.legalDocsMode === "builtin") {
631
+ g("userServiceAgreement");
632
+ return;
633
+ }
634
+ It();
635
+ }
636
+ function y() {
637
+ if (r.legalDocsMode === "builtin") {
638
+ g("privacyPolicy");
639
+ return;
640
+ }
641
+ zt();
642
+ }
643
+ return (z, q) => c.value ? (l(), k("div", {
644
+ key: 0,
645
+ class: he(["ServiceAgreementAndPrivacyProtection", {
646
+ "terms-shake": e(a)
647
+ }])
648
+ }, [n.value ? (l(), k(D, {
649
+ key: 0
650
+ }, [w.value ? (l(), S(e(Oe), {
651
+ key: 0,
652
+ modelValue: o.value,
653
+ "onUpdate:modelValue": q[0] || (q[0] = ($) => o.value = $),
654
+ class: "terms-checkbox"
655
+ }, {
656
+ default: p(() => [...q[1] || (q[1] = [_("span", {
657
+ class: "terms-text"
658
+ }, "我已阅读并同意", -1)])]),
659
+ _: 1
660
+ }, 8, ["modelValue"])) : I("", !0), t.value ? (l(), S(e(Y), {
661
+ key: 1,
662
+ onClick: m
663
+ }, {
664
+ default: p(() => [O(L(t.value.label), 1)]),
665
+ _: 1
666
+ })) : I("", !0), t.value && f.value ? (l(), k("span", At, "和")) : I("", !0), f.value ? (l(), S(e(Y), {
667
+ key: 3,
668
+ onClick: y
669
+ }, {
670
+ default: p(() => [O(L(f.value.label), 1)]),
671
+ _: 1
672
+ })) : I("", !0)], 64)) : I("", !0)], 2)) : I("", !0);
673
+ }
674
+ }), ee = /* @__PURE__ */ U(Pt, [["__scopeId", "data-v-a0c2f361"]]), Vt = {
675
+ class: "content"
676
+ }, Ct = {
677
+ class: "handle"
678
+ }, Ut = /* @__PURE__ */ V({
679
+ __name: "AuthkitPasswordAuth",
680
+ props: {
681
+ size: {
682
+ type: String,
683
+ required: !0
684
+ },
685
+ loading: {
686
+ type: Boolean,
687
+ required: !0,
688
+ default: () => !0
689
+ },
690
+ allowPhone: {
691
+ type: Boolean,
692
+ default: !1
693
+ }
694
+ },
695
+ emits: ["submit"],
696
+ setup(b, {
697
+ emit: r
698
+ }) {
699
+ const u = r, {
700
+ useTermsFormField: o
701
+ } = F(), {
702
+ showTermsField: h,
703
+ termsRules: g
704
+ } = o("signIn"), a = b, s = A(), d = A({
705
+ identifier: void 0,
706
+ password: void 0,
707
+ acceptedTerms: !1
708
+ });
709
+ async function v() {
710
+ s.value.validate().then((t) => {
711
+ t || u("submit", d.value);
712
+ });
713
+ }
714
+ return (t, f) => (l(), k("div", Vt, [i(e(H), {
715
+ ref_key: "formRef",
716
+ ref: s,
717
+ model: d.value,
718
+ size: a.size,
719
+ "auto-label-width": ""
720
+ }, {
721
+ default: p(() => [i(e(P), {
722
+ field: "identifier",
723
+ label: "邮箱或手机号",
724
+ "hide-label": "",
725
+ rules: [{
726
+ required: !0,
727
+ message: "请输入邮箱或手机号"
728
+ }]
729
+ }, {
730
+ default: p(() => [i(e(C), {
731
+ modelValue: d.value.identifier,
732
+ "onUpdate:modelValue": f[0] || (f[0] = (n) => d.value.identifier = n),
733
+ placeholder: a.allowPhone ? "请输入邮箱或手机号" : "请输入邮箱",
734
+ autocomplete: "email username"
735
+ }, null, 8, ["modelValue", "placeholder"])]),
736
+ _: 1
737
+ }), i(e(P), {
738
+ field: "password",
739
+ label: "密码",
740
+ "hide-label": "",
741
+ rules: [{
742
+ required: !0,
743
+ message: "请输入密码"
744
+ }]
745
+ }, {
746
+ default: p(() => [i(e(C), {
747
+ modelValue: d.value.password,
748
+ "onUpdate:modelValue": f[1] || (f[1] = (n) => d.value.password = n),
749
+ placeholder: "请输入密码",
750
+ type: "password",
751
+ autocomplete: "current-password"
752
+ }, null, 8, ["modelValue"])]),
753
+ _: 1
754
+ }), _("div", Ct, [i(e(B), {
755
+ type: "primary",
756
+ loading: a.loading,
757
+ long: "",
758
+ size: a.size,
759
+ onClick: v
760
+ }, {
761
+ default: p(() => [...f[3] || (f[3] = [O(" 登录 ", -1)])]),
762
+ _: 1
763
+ }, 8, ["loading", "size"]), e(h) ? (l(), S(e(P), {
764
+ key: 0,
765
+ field: "acceptedTerms",
766
+ "hide-label": "",
767
+ rules: e(g)
768
+ }, {
769
+ default: p(() => [i(ee, {
770
+ "accepted-terms": d.value.acceptedTerms,
771
+ "onUpdate:acceptedTerms": f[2] || (f[2] = (n) => d.value.acceptedTerms = n),
772
+ "current-view": "signIn"
773
+ }, null, 8, ["accepted-terms"])]),
774
+ _: 1
775
+ }, 8, ["rules"])) : I("", !0)])]),
776
+ _: 1
777
+ }, 8, ["model", "size"])]));
778
+ }
779
+ }), $t = /* @__PURE__ */ U(Ut, [["__scopeId", "data-v-cca59a39"]]), Rt = {
780
+ class: "SignInPhone"
781
+ }, Tt = {
782
+ class: "content"
783
+ }, qt = {
784
+ class: "sendVerifyCodeItem"
785
+ }, Ot = {
786
+ class: "handle"
787
+ }, xt = /* @__PURE__ */ V({
788
+ __name: "AuthkitSignInPhone",
789
+ props: {
790
+ size: {
791
+ type: String,
792
+ required: !0
793
+ },
794
+ loading: {
795
+ type: Boolean,
796
+ required: !0,
797
+ default: () => !1
798
+ }
799
+ },
800
+ emits: ["submit"],
801
+ setup(b, {
802
+ emit: r
803
+ }) {
804
+ const u = r, {
805
+ useTermsFormField: o
806
+ } = F(), {
807
+ showTermsField: h,
808
+ termsRules: g
809
+ } = o("signIn"), a = b, s = A(), d = A(!1), v = A(), t = A({
810
+ phone: void 0,
811
+ code: void 0,
812
+ acceptedTerms: !1
813
+ });
814
+ async function f() {
815
+ if (!await v.value.validateField(["phone"])) {
816
+ d.value = !0;
817
+ const c = await M().auth.verify.sms.send.post({
818
+ phone: t.value.phone,
819
+ purpose: "signIn"
820
+ });
821
+ d.value = !1, K(s.value, c);
822
+ }
823
+ }
824
+ async function n() {
825
+ v.value.validate().then((w) => {
826
+ w || u("submit", {
827
+ identifier: t.value.phone,
828
+ code: t.value.code,
829
+ method: "code"
830
+ });
831
+ });
832
+ }
833
+ return (w, c) => (l(), k("div", Rt, [_("div", Tt, [i(e(H), {
834
+ ref_key: "formRef",
835
+ ref: v,
836
+ model: t.value,
837
+ size: a.size,
838
+ "auto-label-width": ""
839
+ }, {
840
+ default: p(() => [i(e(P), {
841
+ field: "phone",
842
+ label: "手机号",
843
+ "hide-label": "",
844
+ rules: [{
845
+ required: !0,
846
+ message: "请输入手机号"
847
+ }, {
848
+ match: /^1[3-9]\d{9}$/,
849
+ message: "请输入有效的手机号"
850
+ }]
851
+ }, {
852
+ default: p(() => [i(e(C), {
853
+ modelValue: t.value.phone,
854
+ "onUpdate:modelValue": c[0] || (c[0] = (m) => t.value.phone = m),
855
+ placeholder: "请输入手机号",
856
+ autocomplete: "tel",
857
+ type: "tel"
858
+ }, null, 8, ["modelValue"])]),
859
+ _: 1
860
+ }), i(e(P), {
861
+ field: "code",
862
+ label: "验证码",
863
+ "hide-label": "",
864
+ rules: [{
865
+ required: !0,
866
+ message: "请输入验证码"
867
+ }]
868
+ }, {
869
+ default: p(() => [_("div", qt, [i(e(C), {
870
+ modelValue: t.value.code,
871
+ "onUpdate:modelValue": c[1] || (c[1] = (m) => t.value.code = m),
872
+ placeholder: "请输入验证码",
873
+ autocomplete: "one-time-code"
874
+ }, null, 8, ["modelValue"]), i(W, {
875
+ ref_key: "SendVerifyCodeRef",
876
+ ref: s,
877
+ size: a.size,
878
+ loading: d.value,
879
+ style: {
880
+ "margin-left": "10px"
881
+ },
882
+ onSend: f
883
+ }, null, 8, ["size", "loading"])])]),
884
+ _: 1
885
+ }), _("div", Ot, [i(e(B), {
886
+ type: "primary",
887
+ loading: a.loading,
888
+ long: "",
889
+ size: a.size,
890
+ onClick: n
891
+ }, {
892
+ default: p(() => [...c[3] || (c[3] = [O(" 登录 ", -1)])]),
893
+ _: 1
894
+ }, 8, ["loading", "size"]), e(h) ? (l(), S(e(P), {
895
+ key: 0,
896
+ field: "acceptedTerms",
897
+ "hide-label": "",
898
+ rules: e(g)
899
+ }, {
900
+ default: p(() => [i(ee, {
901
+ "accepted-terms": t.value.acceptedTerms,
902
+ "onUpdate:acceptedTerms": c[2] || (c[2] = (m) => t.value.acceptedTerms = m),
903
+ "current-view": "signIn"
904
+ }, null, 8, ["accepted-terms"])]),
905
+ _: 1
906
+ }, 8, ["rules"])) : I("", !0)])]),
907
+ _: 1
908
+ }, 8, ["model", "size"])])]));
909
+ }
910
+ }), Lt = /* @__PURE__ */ U(xt, [["__scopeId", "data-v-ef67e91c"]]), Bt = {
911
+ class: "SignInEmailCode"
912
+ }, Mt = {
913
+ class: "sendVerifyCodeItem"
914
+ }, Ft = {
915
+ class: "handle"
916
+ }, Dt = /* @__PURE__ */ V({
917
+ __name: "AuthkitSignInEmailCode",
918
+ props: {
919
+ size: {
920
+ type: String,
921
+ required: !0
922
+ },
923
+ loading: {
924
+ type: Boolean,
925
+ required: !0,
926
+ default: () => !1
927
+ }
928
+ },
929
+ emits: ["submit"],
930
+ setup(b, {
931
+ emit: r
932
+ }) {
933
+ const u = r, {
934
+ useTermsFormField: o
935
+ } = F(), {
936
+ showTermsField: h,
937
+ termsRules: g
938
+ } = o("signIn"), a = b, s = A(), d = A(!1), v = A(), t = A({
939
+ email: void 0,
940
+ code: void 0,
941
+ emailVerifyId: "",
942
+ acceptedTerms: !1
943
+ });
944
+ async function f() {
945
+ var c;
946
+ if (!await v.value.validateField(["email"])) {
947
+ d.value = !0;
948
+ const m = await M().auth.verify.email.retry.post({
949
+ email: t.value.email,
950
+ purpose: "signIn"
951
+ });
952
+ d.value = !1, (c = m.data) != null && c.emailVerifyId && (t.value.emailVerifyId = m.data.emailVerifyId), K(s.value, m);
953
+ }
954
+ }
955
+ async function n() {
956
+ v.value.validate().then((w) => {
957
+ w || u("submit", {
958
+ identifier: t.value.email,
959
+ code: t.value.code,
960
+ emailVerifyId: t.value.emailVerifyId,
961
+ method: "code"
962
+ });
963
+ });
964
+ }
965
+ return (w, c) => (l(), k("div", Bt, [i(e(H), {
966
+ ref_key: "formRef",
967
+ ref: v,
968
+ model: t.value,
969
+ size: a.size,
970
+ "auto-label-width": ""
971
+ }, {
972
+ default: p(() => [i(e(P), {
973
+ field: "email",
974
+ "hide-label": "",
975
+ rules: [{
976
+ required: !0,
977
+ message: "请输入邮箱"
978
+ }, {
979
+ type: "email",
980
+ message: "请输入有效的邮箱"
981
+ }]
982
+ }, {
983
+ default: p(() => [i(e(C), {
984
+ modelValue: t.value.email,
985
+ "onUpdate:modelValue": c[0] || (c[0] = (m) => t.value.email = m),
986
+ placeholder: "请输入邮箱",
987
+ autocomplete: "email"
988
+ }, null, 8, ["modelValue"])]),
989
+ _: 1
990
+ }), i(e(P), {
991
+ field: "code",
992
+ "hide-label": "",
993
+ rules: [{
994
+ required: !0,
995
+ message: "请输入验证码"
996
+ }]
997
+ }, {
998
+ default: p(() => [_("div", Mt, [i(e(C), {
999
+ modelValue: t.value.code,
1000
+ "onUpdate:modelValue": c[1] || (c[1] = (m) => t.value.code = m),
1001
+ placeholder: "请输入验证码",
1002
+ autocomplete: "one-time-code"
1003
+ }, null, 8, ["modelValue"]), i(W, {
1004
+ ref_key: "SendVerifyCodeRef",
1005
+ ref: s,
1006
+ size: a.size,
1007
+ loading: d.value,
1008
+ style: {
1009
+ "margin-left": "10px"
1010
+ },
1011
+ onSend: f
1012
+ }, null, 8, ["size", "loading"])])]),
1013
+ _: 1
1014
+ }), _("div", Ft, [i(e(B), {
1015
+ type: "primary",
1016
+ loading: a.loading,
1017
+ long: "",
1018
+ size: a.size,
1019
+ onClick: n
1020
+ }, {
1021
+ default: p(() => [...c[3] || (c[3] = [O(" 登录 ", -1)])]),
1022
+ _: 1
1023
+ }, 8, ["loading", "size"]), e(h) ? (l(), S(e(P), {
1024
+ key: 0,
1025
+ field: "acceptedTerms",
1026
+ "hide-label": "",
1027
+ rules: e(g)
1028
+ }, {
1029
+ default: p(() => [i(ee, {
1030
+ "accepted-terms": t.value.acceptedTerms,
1031
+ "onUpdate:acceptedTerms": c[2] || (c[2] = (m) => t.value.acceptedTerms = m),
1032
+ "current-view": "signIn"
1033
+ }, null, 8, ["accepted-terms"])]),
1034
+ _: 1
1035
+ }, 8, ["rules"])) : I("", !0)])]),
1036
+ _: 1
1037
+ }, 8, ["model", "size"])]));
1038
+ }
1039
+ }), Et = /* @__PURE__ */ U(Dt, [["__scopeId", "data-v-fee4702f"]]), Ht = {
1040
+ class: "SwitchSignUpOrResetPassword"
1041
+ }, Gt = {
1042
+ key: 0
1043
+ }, Nt = /* @__PURE__ */ V({
1044
+ __name: "AuthkitSwitchSignUpOrResetPassword",
1045
+ props: {
1046
+ showSignUp: {
1047
+ type: Boolean,
1048
+ default: !0
1049
+ },
1050
+ showResetPassword: {
1051
+ type: Boolean,
1052
+ default: !0
1053
+ }
1054
+ },
1055
+ emits: ["switchSignUp", "switchResetPassword"],
1056
+ setup(b, {
1057
+ emit: r
1058
+ }) {
1059
+ const u = b, o = r;
1060
+ function h() {
1061
+ o("switchSignUp");
1062
+ }
1063
+ function g() {
1064
+ o("switchResetPassword");
1065
+ }
1066
+ return (a, s) => (l(), k("div", Ht, [u.showSignUp ? (l(), k("span", Gt, [s[1] || (s[1] = _("span", null, " 还没有账户?", -1)), i(e(Y), {
1067
+ style: {
1068
+ padding: "0px"
1069
+ },
1070
+ onClick: h
1071
+ }, {
1072
+ default: p(() => [...s[0] || (s[0] = [O("去注册?", -1)])]),
1073
+ _: 1
1074
+ })])) : I("", !0), u.showResetPassword ? (l(), S(e(Y), {
1075
+ key: 1,
1076
+ style: {
1077
+ padding: "0px"
1078
+ },
1079
+ onClick: g
1080
+ }, {
1081
+ default: p(() => [...s[2] || (s[2] = [O(" 忘记密码? ", -1)])]),
1082
+ _: 1
1083
+ })) : I("", !0)]));
1084
+ }
1085
+ }), jt = /* @__PURE__ */ U(Nt, [["__scopeId", "data-v-6ca7b1f2"]]), Wt = {
1086
+ class: "SignIn"
1087
+ }, Kt = {
1088
+ key: 0,
1089
+ class: "tabsContainer"
1090
+ }, Jt = /* @__PURE__ */ V({
1091
+ __name: "AuthkitSignIn",
1092
+ props: {
1093
+ size: {
1094
+ type: String,
1095
+ required: !0
1096
+ },
1097
+ loading: {
1098
+ type: Boolean,
1099
+ required: !0,
1100
+ default: () => !0
1101
+ }
1102
+ },
1103
+ emits: ["submit", "switchSignUp", "switchResetPassword"],
1104
+ setup(b, {
1105
+ emit: r
1106
+ }) {
1107
+ const u = r, o = b, h = Re(), g = T(() => !!h.OAuth), {
1108
+ appsData: a
1109
+ } = j(), {
1110
+ signUpAuthEnabled: s
1111
+ } = F(), d = T(() => a.value.authMethods), v = T(() => s.value && (d.value.signUp.email || d.value.signUp.phone)), t = T(() => d.value.login.emailPassword || d.value.login.phonePassword), f = T(() => {
1112
+ const y = [];
1113
+ return (d.value.login.emailPassword || d.value.login.phonePassword) && y.push({
1114
+ key: "password",
1115
+ title: "密码登录"
1116
+ }), d.value.login.phoneCode && y.push({
1117
+ key: "phoneCode",
1118
+ title: "手机验证码登录"
1119
+ }), d.value.login.emailCode && y.push({
1120
+ key: "emailCode",
1121
+ title: "邮箱验证码登录"
1122
+ }), y;
1123
+ }), n = A("password");
1124
+ ne(() => {
1125
+ var y;
1126
+ f.value.some((z) => z.key === n.value) || (n.value = ((y = f.value[0]) == null ? void 0 : y.key) || "password");
1127
+ });
1128
+ function w() {
1129
+ u("switchSignUp");
1130
+ }
1131
+ function c() {
1132
+ u("switchResetPassword");
1133
+ }
1134
+ async function m(y) {
1135
+ u("submit", {
1136
+ method: n.value === "password" ? "password" : "code",
1137
+ ...y
1138
+ });
1139
+ }
1140
+ return (y, z) => (l(), k("div", Wt, [f.value.length > 1 ? (l(), k("div", Kt, [i(e(de), {
1141
+ "active-key": n.value,
1142
+ "onUpdate:activeKey": z[0] || (z[0] = (q) => n.value = q)
1143
+ }, {
1144
+ default: p(() => [(l(!0), k(D, null, re(f.value, (q) => (l(), S(e(ce), {
1145
+ key: q.key,
1146
+ title: q.title
1147
+ }, null, 8, ["title"]))), 128))]),
1148
+ _: 1
1149
+ }, 8, ["active-key"])])) : I("", !0), n.value === "password" && (d.value.login.emailPassword || d.value.login.phonePassword) ? (l(), S($t, {
1150
+ key: 1,
1151
+ loading: o.loading,
1152
+ size: o.size,
1153
+ "allow-phone": d.value.login.phonePassword,
1154
+ onSubmit: m
1155
+ }, null, 8, ["loading", "size", "allow-phone"])) : n.value === "phoneCode" ? (l(), S(Lt, {
1156
+ key: 2,
1157
+ loading: o.loading,
1158
+ size: o.size,
1159
+ onSubmit: m
1160
+ }, null, 8, ["loading", "size"])) : n.value === "emailCode" ? (l(), S(Et, {
1161
+ key: 3,
1162
+ loading: o.loading,
1163
+ size: o.size,
1164
+ onSubmit: m
1165
+ }, null, 8, ["loading", "size"])) : I("", !0), g.value ? Z(y.$slots, "OAuth", {
1166
+ key: 4
1167
+ }, void 0, !0) : I("", !0), i(jt, {
1168
+ "show-sign-up": v.value,
1169
+ "show-reset-password": t.value,
1170
+ onSwitchSignUp: w,
1171
+ onSwitchResetPassword: c
1172
+ }, null, 8, ["show-sign-up", "show-reset-password"])]));
1173
+ }
1174
+ }), Qt = /* @__PURE__ */ U(Jt, [["__scopeId", "data-v-a7aef80e"]]), Xt = {
1175
+ class: "content"
1176
+ }, Yt = {
1177
+ class: "sendVerifyCodeItem"
1178
+ }, Zt = {
1179
+ class: "handle"
1180
+ }, es = /* @__PURE__ */ V({
1181
+ __name: "AuthkitEmailUpdate",
1182
+ props: {
1183
+ size: {
1184
+ type: String,
1185
+ required: !0
1186
+ },
1187
+ loading: {
1188
+ type: Boolean,
1189
+ required: !0,
1190
+ default: () => !0
1191
+ },
1192
+ purpose: {
1193
+ type: String,
1194
+ default: "signUp"
1195
+ }
1196
+ },
1197
+ emits: ["submit"],
1198
+ setup(b, {
1199
+ emit: r
1200
+ }) {
1201
+ const u = r, {
1202
+ useTermsFormField: o
1203
+ } = F(), {
1204
+ showTermsField: h,
1205
+ termsRules: g
1206
+ } = o("signUp"), a = b, s = A(), d = A(!1), v = A(), t = A({
1207
+ email: void 0,
1208
+ userToken: void 0,
1209
+ emailVerifyId: void 0,
1210
+ password: void 0,
1211
+ confirmPassword: void 0,
1212
+ inviteCode: void 0,
1213
+ acceptedTerms: !1
1214
+ });
1215
+ E(() => {
1216
+ const w = Se();
1217
+ w && (t.value.inviteCode = w);
1218
+ });
1219
+ async function f() {
1220
+ if (!await v.value.validateField(["email"])) {
1221
+ d.value = !0;
1222
+ const c = await M().auth.verify.email.retry.post({
1223
+ email: t.value.email,
1224
+ purpose: a.purpose
1225
+ });
1226
+ d.value = !1, c.data && (t.value.emailVerifyId = c.data.emailVerifyId), K(s.value, c);
1227
+ }
1228
+ }
1229
+ async function n() {
1230
+ v.value.validate().then((w) => {
1231
+ w || u("submit", t.value);
1232
+ });
1233
+ }
1234
+ return (w, c) => (l(), k("div", Xt, [i(e(H), {
1235
+ ref_key: "formRef",
1236
+ ref: v,
1237
+ model: t.value,
1238
+ size: a.size,
1239
+ "auto-label-width": ""
1240
+ }, {
1241
+ default: p(() => [i(e(P), {
1242
+ field: "email",
1243
+ label: "邮箱",
1244
+ "hide-label": "",
1245
+ rules: [{
1246
+ required: !0,
1247
+ message: "请输入邮箱"
1248
+ }, {
1249
+ type: "email",
1250
+ message: "请输入有效的邮箱"
1251
+ }]
1252
+ }, {
1253
+ default: p(() => [i(e(C), {
1254
+ modelValue: t.value.email,
1255
+ "onUpdate:modelValue": c[0] || (c[0] = (m) => t.value.email = m),
1256
+ placeholder: "请输入邮箱",
1257
+ autocomplete: "email username",
1258
+ type: "email"
1259
+ }, null, 8, ["modelValue"])]),
1260
+ _: 1
1261
+ }), i(e(P), {
1262
+ field: "userToken",
1263
+ label: "验证码",
1264
+ "hide-label": "",
1265
+ rules: [{
1266
+ required: !0,
1267
+ message: "请输入验证码"
1268
+ }]
1269
+ }, {
1270
+ default: p(() => [_("div", Yt, [i(e(C), {
1271
+ modelValue: t.value.userToken,
1272
+ "onUpdate:modelValue": c[1] || (c[1] = (m) => t.value.userToken = m),
1273
+ placeholder: "请输入验证码",
1274
+ autocomplete: "one-time-code"
1275
+ }, null, 8, ["modelValue"]), i(W, {
1276
+ ref_key: "SendVerifyCodeRef",
1277
+ ref: s,
1278
+ size: a.size,
1279
+ loading: d.value,
1280
+ style: {
1281
+ "margin-left": "10px"
1282
+ },
1283
+ onSend: f
1284
+ }, null, 8, ["size", "loading"])])]),
1285
+ _: 1
1286
+ }), i(e(P), {
1287
+ field: "password",
1288
+ label: "密码",
1289
+ "hide-label": "",
1290
+ rules: [{
1291
+ required: !0,
1292
+ message: "密码请输入"
1293
+ }, {
1294
+ minLength: 10,
1295
+ message: "密码不能少于10字符"
1296
+ }]
1297
+ }, {
1298
+ default: p(() => [i(e(C), {
1299
+ modelValue: t.value.password,
1300
+ "onUpdate:modelValue": c[2] || (c[2] = (m) => t.value.password = m),
1301
+ placeholder: "请输入密码",
1302
+ type: "password",
1303
+ autocomplete: "new-password"
1304
+ }, null, 8, ["modelValue"])]),
1305
+ _: 1
1306
+ }), i(e(P), {
1307
+ field: "confirmPassword",
1308
+ label: "确认密码",
1309
+ "hide-label": "",
1310
+ rules: [{
1311
+ required: !0,
1312
+ message: "请输入确认密码"
1313
+ }, {
1314
+ minLength: 10,
1315
+ message: "确认密码不能少于10字符"
1316
+ }, {
1317
+ validator: (m, y) => {
1318
+ m !== t.value.password ? y("两次密码输入不一致,请重新输入") : y();
1319
+ }
1320
+ }]
1321
+ }, {
1322
+ default: p(() => [i(e(C), {
1323
+ modelValue: t.value.confirmPassword,
1324
+ "onUpdate:modelValue": c[3] || (c[3] = (m) => t.value.confirmPassword = m),
1325
+ placeholder: "请输入确认密码密码",
1326
+ type: "password",
1327
+ autocomplete: "new-password"
1328
+ }, null, 8, ["modelValue"])]),
1329
+ _: 1
1330
+ }, 8, ["rules"]), i(e(P), {
1331
+ field: "inviteCode",
1332
+ label: "邀请码",
1333
+ "hide-label": "",
1334
+ rules: [{
1335
+ required: !1
1336
+ }]
1337
+ }, {
1338
+ default: p(() => [i(e(C), {
1339
+ modelValue: t.value.inviteCode,
1340
+ "onUpdate:modelValue": c[4] || (c[4] = (m) => t.value.inviteCode = m),
1341
+ placeholder: "邀请码(可选)",
1342
+ autocomplete: "off"
1343
+ }, null, 8, ["modelValue"])]),
1344
+ _: 1
1345
+ }), _("div", Zt, [i(e(B), {
1346
+ type: "primary",
1347
+ loading: a.loading,
1348
+ long: "",
1349
+ size: a.size,
1350
+ onClick: n
1351
+ }, {
1352
+ default: p(() => [...c[6] || (c[6] = [O(" 提交 ", -1)])]),
1353
+ _: 1
1354
+ }, 8, ["loading", "size"]), e(h) ? (l(), S(e(P), {
1355
+ key: 0,
1356
+ field: "acceptedTerms",
1357
+ "hide-label": "",
1358
+ rules: e(g)
1359
+ }, {
1360
+ default: p(() => [i(ee, {
1361
+ "accepted-terms": t.value.acceptedTerms,
1362
+ "onUpdate:acceptedTerms": c[5] || (c[5] = (m) => t.value.acceptedTerms = m),
1363
+ "current-view": "signUp"
1364
+ }, null, 8, ["accepted-terms"])]),
1365
+ _: 1
1366
+ }, 8, ["rules"])) : I("", !0)])]),
1367
+ _: 1
1368
+ }, 8, ["model", "size"])]));
1369
+ }
1370
+ }), ts = /* @__PURE__ */ U(es, [["__scopeId", "data-v-07ef9d49"]]), ss = {
1371
+ class: "SignUpPhone"
1372
+ }, is = {
1373
+ class: "content"
1374
+ }, as = {
1375
+ class: "sendVerifyCodeItem"
1376
+ }, os = {
1377
+ class: "handle"
1378
+ }, ls = /* @__PURE__ */ V({
1379
+ __name: "AuthkitSignUpPhone",
1380
+ props: {
1381
+ size: {
1382
+ type: String,
1383
+ required: !0
1384
+ },
1385
+ loading: {
1386
+ type: Boolean,
1387
+ required: !0,
1388
+ default: () => !1
1389
+ },
1390
+ /** 是否要求设置密码 */
1391
+ requirePassword: {
1392
+ type: Boolean,
1393
+ default: !1
1394
+ }
1395
+ },
1396
+ emits: ["switchSignIn", "submit"],
1397
+ setup(b, {
1398
+ emit: r
1399
+ }) {
1400
+ const u = r, {
1401
+ useTermsFormField: o
1402
+ } = F(), {
1403
+ showTermsField: h,
1404
+ termsRules: g
1405
+ } = o("signUp"), a = b, s = A(), d = A(!1), v = A(), t = A({
1406
+ phone: void 0,
1407
+ code: void 0,
1408
+ password: void 0,
1409
+ confirmPassword: void 0,
1410
+ inviteCode: void 0,
1411
+ acceptedTerms: !1
1412
+ });
1413
+ E(() => {
1414
+ const m = Se();
1415
+ m && (t.value.inviteCode = m);
1416
+ });
1417
+ const f = [{
1418
+ required: !0,
1419
+ message: "请输入确认密码"
1420
+ }, {
1421
+ validator: (m, y) => {
1422
+ t.value.password && m !== t.value.password ? y("两次密码输入不一致") : y();
1423
+ }
1424
+ }];
1425
+ function n() {
1426
+ u("switchSignIn");
1427
+ }
1428
+ async function w() {
1429
+ if (!await v.value.validateField(["phone"])) {
1430
+ d.value = !0;
1431
+ const y = await M().auth.verify.sms.send.post({
1432
+ phone: t.value.phone,
1433
+ purpose: "signUp"
1434
+ });
1435
+ d.value = !1, K(s.value, y);
1436
+ }
1437
+ }
1438
+ async function c() {
1439
+ v.value.validate().then((m) => {
1440
+ m || u("submit", {
1441
+ type: "phone",
1442
+ phone: t.value.phone,
1443
+ code: t.value.code,
1444
+ password: t.value.password,
1445
+ inviteCode: t.value.inviteCode
1446
+ });
1447
+ });
1448
+ }
1449
+ return (m, y) => (l(), k("div", ss, [_("div", is, [i(e(H), {
1450
+ ref_key: "formRef",
1451
+ ref: v,
1452
+ model: t.value,
1453
+ size: a.size,
1454
+ "auto-label-width": ""
1455
+ }, {
1456
+ default: p(() => [i(e(P), {
1457
+ field: "phone",
1458
+ label: "手机号",
1459
+ "hide-label": "",
1460
+ rules: [{
1461
+ required: !0,
1462
+ message: "请输入手机号"
1463
+ }, {
1464
+ match: /^1[3-9]\d{9}$/,
1465
+ message: "请输入有效的手机号"
1466
+ }]
1467
+ }, {
1468
+ default: p(() => [i(e(C), {
1469
+ modelValue: t.value.phone,
1470
+ "onUpdate:modelValue": y[0] || (y[0] = (z) => t.value.phone = z),
1471
+ placeholder: "请输入手机号",
1472
+ autocomplete: "tel",
1473
+ type: "tel"
1474
+ }, null, 8, ["modelValue"])]),
1475
+ _: 1
1476
+ }), i(e(P), {
1477
+ field: "code",
1478
+ label: "验证码",
1479
+ "hide-label": "",
1480
+ rules: [{
1481
+ required: !0,
1482
+ message: "请输入验证码"
1483
+ }]
1484
+ }, {
1485
+ default: p(() => [_("div", as, [i(e(C), {
1486
+ modelValue: t.value.code,
1487
+ "onUpdate:modelValue": y[1] || (y[1] = (z) => t.value.code = z),
1488
+ placeholder: "请输入验证码",
1489
+ autocomplete: "one-time-code"
1490
+ }, null, 8, ["modelValue"]), i(W, {
1491
+ ref_key: "SendVerifyCodeRef",
1492
+ ref: s,
1493
+ size: a.size,
1494
+ loading: d.value,
1495
+ style: {
1496
+ "margin-left": "10px"
1497
+ },
1498
+ onSend: w
1499
+ }, null, 8, ["size", "loading"])])]),
1500
+ _: 1
1501
+ }), a.requirePassword ? (l(), S(e(P), {
1502
+ key: 0,
1503
+ field: "password",
1504
+ label: "密码",
1505
+ "hide-label": "",
1506
+ rules: [{
1507
+ required: a.requirePassword,
1508
+ message: "密码请输入"
1509
+ }, {
1510
+ minLength: 10,
1511
+ message: "密码不能少于10字符"
1512
+ }]
1513
+ }, {
1514
+ default: p(() => [i(e(C), {
1515
+ modelValue: t.value.password,
1516
+ "onUpdate:modelValue": y[2] || (y[2] = (z) => t.value.password = z),
1517
+ placeholder: "请输入密码(可选)",
1518
+ type: "password",
1519
+ autocomplete: "new-password"
1520
+ }, null, 8, ["modelValue"])]),
1521
+ _: 1
1522
+ }, 8, ["rules"])) : I("", !0), a.requirePassword && t.value.password ? (l(), S(e(P), {
1523
+ key: 1,
1524
+ field: "confirmPassword",
1525
+ label: "确认密码",
1526
+ "hide-label": "",
1527
+ rules: f
1528
+ }, {
1529
+ default: p(() => [i(e(C), {
1530
+ modelValue: t.value.confirmPassword,
1531
+ "onUpdate:modelValue": y[3] || (y[3] = (z) => t.value.confirmPassword = z),
1532
+ placeholder: "请输入确认密码",
1533
+ type: "password",
1534
+ autocomplete: "new-password"
1535
+ }, null, 8, ["modelValue"])]),
1536
+ _: 1
1537
+ })) : I("", !0), i(e(P), {
1538
+ field: "inviteCode",
1539
+ label: "邀请码",
1540
+ "hide-label": "",
1541
+ rules: [{
1542
+ required: !1
1543
+ }]
1544
+ }, {
1545
+ default: p(() => [i(e(C), {
1546
+ modelValue: t.value.inviteCode,
1547
+ "onUpdate:modelValue": y[4] || (y[4] = (z) => t.value.inviteCode = z),
1548
+ placeholder: "邀请码(可选)",
1549
+ autocomplete: "off"
1550
+ }, null, 8, ["modelValue"])]),
1551
+ _: 1
1552
+ }), _("div", os, [i(e(B), {
1553
+ type: "primary",
1554
+ loading: a.loading,
1555
+ long: "",
1556
+ size: a.size,
1557
+ onClick: c
1558
+ }, {
1559
+ default: p(() => [...y[6] || (y[6] = [O(" 注册 ", -1)])]),
1560
+ _: 1
1561
+ }, 8, ["loading", "size"]), e(h) ? (l(), S(e(P), {
1562
+ key: 0,
1563
+ field: "acceptedTerms",
1564
+ "hide-label": "",
1565
+ rules: e(g)
1566
+ }, {
1567
+ default: p(() => [i(ee, {
1568
+ "accepted-terms": t.value.acceptedTerms,
1569
+ "onUpdate:acceptedTerms": y[5] || (y[5] = (z) => t.value.acceptedTerms = z),
1570
+ "current-view": "signUp"
1571
+ }, null, 8, ["accepted-terms"])]),
1572
+ _: 1
1573
+ }, 8, ["rules"])) : I("", !0)])]),
1574
+ _: 1
1575
+ }, 8, ["model", "size"])]), i(me, {
1576
+ onSwitchSignIn: n
1577
+ })]));
1578
+ }
1579
+ }), ns = /* @__PURE__ */ U(ls, [["__scopeId", "data-v-d0af58fd"]]), rs = {
1580
+ class: "SignUp"
1581
+ }, us = {
1582
+ key: 0,
1583
+ class: "tabsContainer"
1584
+ }, ds = {
1585
+ key: 1,
1586
+ class: "empty"
1587
+ }, cs = {
1588
+ key: 2,
1589
+ class: "empty"
1590
+ }, ps = {
1591
+ key: 2,
1592
+ class: "empty"
1593
+ }, ms = /* @__PURE__ */ V({
1594
+ __name: "AuthkitSignUp",
1595
+ props: {
1596
+ size: {
1597
+ type: String,
1598
+ required: !0
1599
+ },
1600
+ loading: {
1601
+ type: Boolean,
1602
+ required: !0,
1603
+ default: () => !0
1604
+ }
1605
+ },
1606
+ emits: ["switchSignIn", "submit"],
1607
+ setup(b, {
1608
+ emit: r
1609
+ }) {
1610
+ const u = r, o = b, {
1611
+ appsData: h
1612
+ } = j(), {
1613
+ registrationBlocked: g,
1614
+ signUpAuthEnabled: a
1615
+ } = F(), s = T(() => h.value.authMethods), d = T(() => {
1616
+ const n = [];
1617
+ return s.value.signUp.email && n.push({
1618
+ key: "email",
1619
+ title: "邮箱注册"
1620
+ }), s.value.signUp.phone && n.push({
1621
+ key: "phone",
1622
+ title: "手机号注册"
1623
+ }), n;
1624
+ }), v = A("email");
1625
+ ne(() => {
1626
+ var n;
1627
+ d.value.some((w) => w.key === v.value) || (v.value = ((n = d.value[0]) == null ? void 0 : n.key) || "email");
1628
+ });
1629
+ function t() {
1630
+ u("switchSignIn");
1631
+ }
1632
+ async function f(n) {
1633
+ u("submit", {
1634
+ type: v.value,
1635
+ ...n
1636
+ });
1637
+ }
1638
+ return (n, w) => (l(), k("div", rs, [d.value.length > 1 ? (l(), k("div", us, [i(e(de), {
1639
+ "active-key": v.value,
1640
+ "onUpdate:activeKey": w[0] || (w[0] = (c) => v.value = c)
1641
+ }, {
1642
+ default: p(() => [(l(!0), k(D, null, re(d.value, (c) => (l(), S(e(ce), {
1643
+ key: c.key,
1644
+ title: c.title
1645
+ }, null, 8, ["title"]))), 128))]),
1646
+ _: 1
1647
+ }, 8, ["active-key"])])) : I("", !0), e(a) ? e(g) ? (l(), k("div", cs, " 管理员尚未配置用户协议或隐私政策,暂无法注册。 ")) : (l(), k(D, {
1648
+ key: 3
1649
+ }, [v.value === "email" && s.value.signUp.email ? (l(), S(ts, {
1650
+ key: 0,
1651
+ size: o.size,
1652
+ loading: b.loading,
1653
+ onSubmit: f
1654
+ }, null, 8, ["size", "loading"])) : v.value === "phone" && s.value.signUp.phone ? (l(), S(ns, {
1655
+ key: 1,
1656
+ size: o.size,
1657
+ loading: b.loading,
1658
+ onSubmit: f,
1659
+ onSwitchSignIn: t
1660
+ }, null, 8, ["size", "loading"])) : (l(), k("div", ps, " 当前应用未开放用户注册 ")), v.value === "email" ? (l(), S(me, {
1661
+ key: 3,
1662
+ onSwitchSignIn: t
1663
+ })) : I("", !0)], 64)) : (l(), k("div", ds, " 系统已停止用户注册 "))]));
1664
+ }
1665
+ }), fs = /* @__PURE__ */ U(ms, [["__scopeId", "data-v-b211d5ef"]]), vs = ["src"], gs = /* @__PURE__ */ V({
1666
+ __name: "AuthkitAuthTitle",
1667
+ props: {
1668
+ size: {
1669
+ type: [String, Number],
1670
+ required: !1,
1671
+ default: 30
1672
+ },
1673
+ fontSize: {
1674
+ type: Number,
1675
+ required: !1,
1676
+ default: 18
1677
+ },
1678
+ lineHeight: {
1679
+ type: Number,
1680
+ required: !1,
1681
+ default: 60
1682
+ }
1683
+ },
1684
+ setup(b) {
1685
+ const r = b, u = `${r.size}px`, o = `${r.fontSize}px`, h = `${r.lineHeight}px`, {
1686
+ currentView: g
1687
+ } = N(), {
1688
+ appsData: a
1689
+ } = j(), s = T(() => g.value === "signIn" ? `${a.value.name}登录` : g.value === "signUp" ? `${a.value.name}账号注册` : g.value === "resetPassword" ? `${a.value.name}密码重置` : "");
1690
+ return (d, v) => (l(), k("div", {
1691
+ class: "Title",
1692
+ style: G({
1693
+ fontSize: o,
1694
+ lineHeight: h
1695
+ })
1696
+ }, [e(a).applicationLogoUrl ? (l(), k("img", {
1697
+ key: 0,
1698
+ src: e(a).applicationLogoUrl,
1699
+ srcset: "",
1700
+ style: G({
1701
+ width: u
1702
+ })
1703
+ }, null, 12, vs)) : I("", !0), _("span", null, L(s.value), 1), Z(d.$slots, "default", {}, void 0, !0)], 4));
1704
+ }
1705
+ }), Pe = /* @__PURE__ */ U(gs, [["__scopeId", "data-v-8ebe7939"]]), hs = {
1706
+ class: "Auth"
1707
+ }, ys = {
1708
+ class: "body"
1709
+ }, bs = /* @__PURE__ */ V({
1710
+ __name: "AuthkitAuth",
1711
+ props: {
1712
+ size: {
1713
+ type: String,
1714
+ required: !0
1715
+ },
1716
+ showTitle: {
1717
+ type: Boolean,
1718
+ default: () => !0
1719
+ }
1720
+ },
1721
+ setup(b) {
1722
+ const r = b, {
1723
+ signInSubmit: u,
1724
+ passkeySignInSubmit: o,
1725
+ signUpSubmit: h,
1726
+ resetPasswordSubmit: g,
1727
+ currentView: a,
1728
+ authSignInLoading: s,
1729
+ authSignUpLoading: d,
1730
+ resetPasswordLoading: v,
1731
+ switchSignUp: t,
1732
+ switchResetPassword: f,
1733
+ switchSignIn: n
1734
+ } = N();
1735
+ return (w, c) => (l(), k("div", hs, [b.showTitle ? (l(), S(Pe, {
1736
+ key: 0,
1737
+ size: 32,
1738
+ "font-size": 20
1739
+ })) : I("", !0), _("div", ys, [e(a) === "signIn" ? (l(), S(Qt, {
1740
+ key: 0,
1741
+ size: r.size,
1742
+ loading: e(s),
1743
+ onSwitchSignUp: e(t),
1744
+ onSwitchResetPassword: e(f),
1745
+ onSubmit: c[0] || (c[0] = (m) => e(u)(m))
1746
+ }, {
1747
+ OAuth: p(() => [i(lt, {
1748
+ size: r.size,
1749
+ onPasskeySubmit: e(o)
1750
+ }, null, 8, ["size", "onPasskeySubmit"])]),
1751
+ _: 1
1752
+ }, 8, ["size", "loading", "onSwitchSignUp", "onSwitchResetPassword"])) : e(a) === "signUp" ? (l(), S(fs, {
1753
+ key: 1,
1754
+ size: r.size,
1755
+ loading: e(d),
1756
+ onSwitchSignIn: e(n),
1757
+ onSubmit: c[1] || (c[1] = (m) => e(h)(m))
1758
+ }, null, 8, ["size", "loading", "onSwitchSignIn"])) : e(a) === "resetPassword" ? (l(), S(kt, {
1759
+ key: 2,
1760
+ size: r.size,
1761
+ loading: e(v),
1762
+ onSwitchSignIn: e(n),
1763
+ onSubmit: c[2] || (c[2] = (m) => e(g)(m))
1764
+ }, null, 8, ["size", "loading", "onSwitchSignIn"])) : I("", !0)])]));
1765
+ }
1766
+ }), ws = /* @__PURE__ */ U(bs, [["__scopeId", "data-v-60874d88"]]), _s = /* @__PURE__ */ V({
1767
+ __name: "AuthkitAuthModal",
1768
+ props: {
1769
+ size: {
1770
+ default: "large"
1771
+ }
1772
+ },
1773
+ emits: ["close"],
1774
+ setup(b, {
1775
+ emit: r
1776
+ }) {
1777
+ const u = r, {
1778
+ onSignIn: o,
1779
+ switchSignIn: h
1780
+ } = N(), {
1781
+ close: g
1782
+ } = we();
1783
+ let a = null;
1784
+ E(() => {
1785
+ a = o(() => g());
1786
+ }), ue(() => {
1787
+ a == null || a(), a = null;
1788
+ });
1789
+ function s(v) {
1790
+ v || d();
1791
+ }
1792
+ function d() {
1793
+ h(), g(), u("close");
1794
+ }
1795
+ return (v, t) => (l(), S(e(xe), {
1796
+ visible: !0,
1797
+ footer: !1,
1798
+ "mask-closable": !1,
1799
+ "title-align": "center",
1800
+ width: "auto",
1801
+ "modal-class": "SignInModalClass",
1802
+ "onUpdate:visible": s,
1803
+ onClose: d
1804
+ }, {
1805
+ title: p(() => [i(Pe)]),
1806
+ default: p(() => [i(ws, {
1807
+ "show-title": !1,
1808
+ size: b.size
1809
+ }, null, 8, ["size"])]),
1810
+ _: 1
1811
+ }));
1812
+ }
1813
+ }), ks = /* @__PURE__ */ U(_s, [["__scopeId", "data-v-19a4d5d0"]]);
1814
+ function Ve(b, r = {}) {
1815
+ const {
1816
+ bindIdentityRedirect: u = "",
1817
+ closePopupOnBindSuccess: o = !0,
1818
+ restoreRedirectAfterSignIn: h = !0,
1819
+ defaultRedirect: g = ""
1820
+ } = r, a = A(!1), {
1821
+ completeSignIn: s
1822
+ } = N();
1823
+ async function d() {
1824
+ if (typeof window > "u")
1825
+ return !1;
1826
+ const v = new URL(window.location.href);
1827
+ if (!ze(v))
1828
+ return !1;
1829
+ const t = v.searchParams.get("error");
1830
+ if (t)
1831
+ return window.history.replaceState({}, "", le(v)), X.error(t), !0;
1832
+ if (v.searchParams.get("bindSuccess") === "true") {
1833
+ const n = v.searchParams.get("provider");
1834
+ return window.history.replaceState({}, "", le(v)), X.success(n ? `${n} 绑定成功` : "绑定成功"), o && window.opener && setTimeout(() => window.close(), 800), !0;
1835
+ }
1836
+ const f = v.searchParams.get("token");
1837
+ if (!f)
1838
+ return !1;
1839
+ a.value = !0;
1840
+ try {
1841
+ const n = v.searchParams.get("userId"), w = v.searchParams.get("appId"), c = v.searchParams.get("needBindIdentity") === "true";
1842
+ if (window.history.replaceState({}, "", le(v)), s({
1843
+ jwtToken: f,
1844
+ userId: n,
1845
+ appId: w,
1846
+ needBindIdentity: c
1847
+ }), c && u)
1848
+ return await b.replace(u), !0;
1849
+ const y = Ne(h) || g;
1850
+ return y && await b.replace(y), !0;
1851
+ } finally {
1852
+ a.value = !1;
1853
+ }
1854
+ }
1855
+ return {
1856
+ processing: a,
1857
+ handleOAuthCallback: d
1858
+ };
1859
+ }
1860
+ const Ss = {
1861
+ key: 0,
1862
+ class: "AuthkitOAuthCallbackOverlay",
1863
+ "aria-live": "polite",
1864
+ "aria-busy": "true"
1865
+ }, zs = /* @__PURE__ */ V({
1866
+ __name: "AuthkitOAuthCallbackProvider",
1867
+ props: {
1868
+ bindIdentityRedirect: {
1869
+ default: ""
1870
+ },
1871
+ closePopupOnBindSuccess: {
1872
+ type: Boolean,
1873
+ default: !0
1874
+ },
1875
+ restoreRedirectAfterSignIn: {
1876
+ type: Boolean,
1877
+ default: !0
1878
+ }
1879
+ },
1880
+ setup(b) {
1881
+ const r = b, u = be(), {
1882
+ processing: o,
1883
+ handleOAuthCallback: h
1884
+ } = Ve(u, {
1885
+ bindIdentityRedirect: r.bindIdentityRedirect,
1886
+ closePopupOnBindSuccess: r.closePopupOnBindSuccess,
1887
+ restoreRedirectAfterSignIn: r.restoreRedirectAfterSignIn
1888
+ });
1889
+ return E(() => {
1890
+ h();
1891
+ }), (g, a) => (l(), S(Te, {
1892
+ to: "body"
1893
+ }, [e(o) ? (l(), k("div", Ss, [...a[0] || (a[0] = [_("div", {
1894
+ class: "AuthkitOAuthCallbackOverlay__panel"
1895
+ }, [_("div", {
1896
+ class: "AuthkitOAuthCallbackOverlay__spinner"
1897
+ }), _("p", {
1898
+ class: "AuthkitOAuthCallbackOverlay__text"
1899
+ }, "正在登录...")], -1)])])) : I("", !0)]));
1900
+ }
1901
+ }), Is = /* @__PURE__ */ U(zs, [["__scopeId", "data-v-7162b776"]]), hi = /* @__PURE__ */ V({
1902
+ __name: "AuthkitProvider",
1903
+ props: {
1904
+ handleOAuthCallback: {
1905
+ type: Boolean,
1906
+ default: !0
1907
+ },
1908
+ restoreSession: {
1909
+ type: Boolean,
1910
+ default: !0
1911
+ },
1912
+ fetchAppInfo: {
1913
+ type: Boolean,
1914
+ default: !0
1915
+ },
1916
+ showAuthModal: {
1917
+ type: Boolean,
1918
+ default: !0
1919
+ },
1920
+ authModalSize: {
1921
+ default: "large"
1922
+ },
1923
+ bindIdentityRedirect: {
1924
+ default: ""
1925
+ },
1926
+ closePopupOnBindSuccess: {
1927
+ type: Boolean,
1928
+ default: !0
1929
+ },
1930
+ restoreRedirectAfterSignIn: {
1931
+ type: Boolean,
1932
+ default: !0
1933
+ }
1934
+ },
1935
+ emits: ["toPrivacyPolicy", "toUserServiceAgreement"],
1936
+ setup(b, {
1937
+ emit: r
1938
+ }) {
1939
+ const {
1940
+ config: u
1941
+ } = pe(), o = b, h = r, g = qe(), {
1942
+ openLegalDoc: a
1943
+ } = Ie({
1944
+ route: g
1945
+ }), {
1946
+ isOpen: s
1947
+ } = we(), {
1948
+ restoreSession: d,
1949
+ onSignIn: v,
1950
+ onSignOut: t
1951
+ } = N(), {
1952
+ fetchUserProfile: f,
1953
+ clearUserProfile: n,
1954
+ markAuthSessionBootstrapped: w
1955
+ } = Ae(), {
1956
+ appsAuthPageInfoApi: c
1957
+ } = j(), m = v(() => {
1958
+ f();
1959
+ }), y = t(() => {
1960
+ n();
1961
+ });
1962
+ function z() {
1963
+ if (u.legalDocsMode === "builtin") {
1964
+ a("privacyPolicy");
1965
+ return;
1966
+ }
1967
+ h("toPrivacyPolicy");
1968
+ }
1969
+ function q() {
1970
+ if (u.legalDocsMode === "builtin") {
1971
+ a("userServiceAgreement");
1972
+ return;
1973
+ }
1974
+ h("toUserServiceAgreement");
1975
+ }
1976
+ let $ = null;
1977
+ async function R() {
1978
+ try {
1979
+ if (o.fetchAppInfo && c(), o.restoreSession && d()) {
1980
+ await f();
1981
+ return;
1982
+ }
1983
+ n();
1984
+ } finally {
1985
+ w();
1986
+ }
1987
+ }
1988
+ function x() {
1989
+ return $ || ($ = R()), $;
1990
+ }
1991
+ return typeof window < "u" && x(), E(() => {
1992
+ St({
1993
+ onPrivacyPolicy: z,
1994
+ onUserServiceAgreement: q
1995
+ });
1996
+ }), ue(() => {
1997
+ m(), y();
1998
+ }), (Ce, Ws) => (l(), k(D, null, [Z(Ce.$slots, "default"), o.handleOAuthCallback ? (l(), S(Is, {
1999
+ key: 0,
2000
+ "bind-identity-redirect": o.bindIdentityRedirect,
2001
+ "close-popup-on-bind-success": o.closePopupOnBindSuccess,
2002
+ "restore-redirect-after-sign-in": o.restoreRedirectAfterSignIn
2003
+ }, null, 8, ["bind-identity-redirect", "close-popup-on-bind-success", "restore-redirect-after-sign-in"])) : I("", !0), o.showAuthModal && e(s) ? (l(), S(ks, {
2004
+ key: 1,
2005
+ size: o.authModalSize
2006
+ }, null, 8, ["size"])) : I("", !0)], 64));
2007
+ }
2008
+ }), As = {
2009
+ class: "header"
2010
+ }, Ps = ["href"], Vs = {
2011
+ class: "container"
2012
+ }, Cs = /* @__PURE__ */ V({
2013
+ __name: "AuthkitAuthContainer",
2014
+ props: {
2015
+ applicationLogoUrl: {
2016
+ type: String,
2017
+ required: !0,
2018
+ default: () => ""
2019
+ },
2020
+ name: {
2021
+ type: String,
2022
+ required: !0,
2023
+ default: () => ""
2024
+ },
2025
+ description: {
2026
+ type: String,
2027
+ required: !0,
2028
+ default: () => ""
2029
+ },
2030
+ appHomePage: {
2031
+ type: String,
2032
+ required: !0,
2033
+ default: () => ""
2034
+ },
2035
+ backgroundImage: {
2036
+ type: String,
2037
+ required: !0,
2038
+ default: () => ""
2039
+ },
2040
+ backgroundColor: {
2041
+ type: String,
2042
+ required: !0,
2043
+ default: () => ""
2044
+ },
2045
+ linkColor: {
2046
+ type: String,
2047
+ default: "var(--huyooo-accent-primary)"
2048
+ },
2049
+ backgroundType: {
2050
+ type: String,
2051
+ default: "color"
2052
+ }
2053
+ },
2054
+ setup(b) {
2055
+ const r = b, u = T(() => r.backgroundType === "color" ? {
2056
+ backgroundColor: r.backgroundColor
2057
+ } : {
2058
+ backgroundImage: `url(${r.backgroundImage})`
2059
+ });
2060
+ return (o, h) => (l(), k("div", {
2061
+ class: "auth",
2062
+ style: G(u.value)
2063
+ }, [_("div", As, [r.name ? (l(), k("a", {
2064
+ key: 0,
2065
+ href: r.appHomePage,
2066
+ target: "_self",
2067
+ class: "link",
2068
+ style: G({
2069
+ color: r.linkColor
2070
+ })
2071
+ }, " 返回主页 ", 12, Ps)) : I("", !0)]), _("div", Vs, [Z(o.$slots, "default", {}, void 0, !0)])], 4));
2072
+ }
2073
+ }), yi = /* @__PURE__ */ U(Cs, [["__scopeId", "data-v-0e13d3ff"]]), Us = {
2074
+ class: "box"
2075
+ }, $s = {
2076
+ class: "title"
2077
+ }, Rs = {
2078
+ class: "content"
2079
+ }, Ts = {
2080
+ class: "redirect"
2081
+ }, qs = {
2082
+ style: {
2083
+ "font-weight": "bold",
2084
+ "font-size": "12px"
2085
+ }
2086
+ }, Os = /* @__PURE__ */ V({
2087
+ __name: "AuthkitAuthorize",
2088
+ props: {
2089
+ size: {
2090
+ type: String,
2091
+ required: !0
2092
+ },
2093
+ title: {
2094
+ type: String,
2095
+ required: !0,
2096
+ default: () => "授权登录"
2097
+ },
2098
+ logo: {
2099
+ type: String,
2100
+ required: !0,
2101
+ default: () => ""
2102
+ },
2103
+ clientId: {
2104
+ type: String,
2105
+ required: !0,
2106
+ default: () => ""
2107
+ },
2108
+ responseType: {
2109
+ type: String,
2110
+ required: !0,
2111
+ default: () => ""
2112
+ },
2113
+ scope: {
2114
+ type: String,
2115
+ required: !0,
2116
+ default: () => ""
2117
+ },
2118
+ state: {
2119
+ type: String,
2120
+ required: !0,
2121
+ default: () => ""
2122
+ },
2123
+ redirectUri: {
2124
+ type: String,
2125
+ required: !0,
2126
+ default: () => ""
2127
+ },
2128
+ userInfo: {
2129
+ type: Object,
2130
+ required: !0,
2131
+ default: () => ""
2132
+ }
2133
+ },
2134
+ setup(b) {
2135
+ const r = A(!1), u = b, o = A({
2136
+ name: "",
2137
+ homePageUrl: "",
2138
+ createAt: "",
2139
+ authorizationCallback: ""
2140
+ });
2141
+ async function h() {
2142
+ const {
2143
+ data: a,
2144
+ error: s
2145
+ } = await M().auth.apps.authPageInfo.post({});
2146
+ s || !a || (o.value = {
2147
+ name: a.name,
2148
+ homePageUrl: a.homePageUrl || "",
2149
+ createAt: "",
2150
+ authorizationCallback: a.authorizationCallback || ""
2151
+ });
2152
+ }
2153
+ h();
2154
+ async function g() {
2155
+ r.value = !0;
2156
+ const {
2157
+ data: a,
2158
+ error: s
2159
+ } = await M().auth.oauth2.authorize.post({
2160
+ client_id: u.clientId,
2161
+ response_type: u.responseType,
2162
+ scope: u.scope,
2163
+ state: u.state,
2164
+ redirect_uri: u.redirectUri
2165
+ });
2166
+ if (r.value = !1, s || !a)
2167
+ return;
2168
+ const d = a;
2169
+ window.location.href = d.authorizeUrl;
2170
+ }
2171
+ return (a, s) => (l(), k("div", Us, [_("div", $s, L(`授权 ${o.value.name}`), 1), _("div", Rs, [i(e(Le), null, {
2172
+ default: p(() => [i(e(ae), null, {
2173
+ default: p(() => {
2174
+ var d;
2175
+ return [i(e(oe), {
2176
+ title: o.value.name,
2177
+ description: `想要使用您的${(d = u.userInfo) == null ? void 0 : d.nickname}账户`
2178
+ }, {
2179
+ avatar: p(() => {
2180
+ var v;
2181
+ return [i(e(te), {
2182
+ shape: "square",
2183
+ "image-url": (v = u.userInfo) == null ? void 0 : v.avatar
2184
+ }, null, 8, ["image-url"])];
2185
+ }),
2186
+ _: 1
2187
+ }, 8, ["title", "description"])];
2188
+ }),
2189
+ _: 1
2190
+ }), i(e(ae), null, {
2191
+ default: p(() => [i(e(oe), {
2192
+ title: "公开信息",
2193
+ description: "头像、昵称"
2194
+ }, {
2195
+ avatar: p(() => [i(e(te), {
2196
+ shape: "square"
2197
+ }, {
2198
+ default: p(() => [...s[0] || (s[0] = [_("img", {
2199
+ alt: "avatar",
2200
+ src: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp"
2201
+ }, null, -1)])]),
2202
+ _: 1
2203
+ })]),
2204
+ _: 1
2205
+ })]),
2206
+ _: 1
2207
+ }), i(e(ae), null, {
2208
+ default: p(() => [i(e(oe), {
2209
+ title: "个人用户数据",
2210
+ description: "电子邮件地址"
2211
+ }, {
2212
+ avatar: p(() => [i(e(te), {
2213
+ shape: "square"
2214
+ }, {
2215
+ default: p(() => [...s[1] || (s[1] = [_("img", {
2216
+ alt: "avatar",
2217
+ src: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp"
2218
+ }, null, -1)])]),
2219
+ _: 1
2220
+ })]),
2221
+ _: 1
2222
+ })]),
2223
+ _: 1
2224
+ })]),
2225
+ _: 1
2226
+ }), i(e(B), {
2227
+ type: "primary",
2228
+ size: u.size,
2229
+ loading: r.value,
2230
+ onClick: g
2231
+ }, {
2232
+ default: p(() => [...s[2] || (s[2] = [O(" 授权 ", -1)])]),
2233
+ _: 1
2234
+ }, 8, ["size", "loading"]), _("div", Ts, [s[3] || (s[3] = _("div", {
2235
+ class: "redirect-hint"
2236
+ }, "授权后将跳转至", -1)), _("div", qs, L(o.value.authorizationCallback), 1)])])]));
2237
+ }
2238
+ }), bi = /* @__PURE__ */ U(Os, [["__scopeId", "data-v-6c1792d3"]]), xs = {
2239
+ class: "oauth-callback"
2240
+ }, Ls = {
2241
+ key: 0,
2242
+ class: "callback-loading"
2243
+ }, Bs = {
2244
+ key: 1,
2245
+ class: "callback-error"
2246
+ }, Ms = {
2247
+ key: 2,
2248
+ class: "callback-success"
2249
+ }, Fs = /* @__PURE__ */ V({
2250
+ __name: "AuthkitOauthCallback",
2251
+ props: {
2252
+ defaultRedirect: {},
2253
+ loadingText: {},
2254
+ bindIdentityRedirect: {}
2255
+ },
2256
+ emits: ["success", "error", "needBindIdentity"],
2257
+ setup(b, {
2258
+ emit: r
2259
+ }) {
2260
+ const u = b, o = r, h = A("登录成功,正在跳转..."), g = A(""), {
2261
+ restoreSession: a
2262
+ } = N(), s = be(), {
2263
+ processing: d,
2264
+ handleOAuthCallback: v
2265
+ } = Ve(s, {
2266
+ bindIdentityRedirect: u.bindIdentityRedirect,
2267
+ defaultRedirect: u.defaultRedirect
2268
+ });
2269
+ async function t() {
2270
+ const n = new URL(window.location.href);
2271
+ if (!ze(n)) {
2272
+ if (a()) {
2273
+ await s.replace(u.defaultRedirect || "/");
2274
+ return;
2275
+ }
2276
+ g.value = "无效的访问";
2277
+ return;
2278
+ }
2279
+ const w = n.searchParams.get("error");
2280
+ if (w) {
2281
+ g.value = w, o("error", w), await v();
2282
+ return;
2283
+ }
2284
+ await v() || (g.value = "登录失败:未收到认证令牌", o("error", g.value));
2285
+ }
2286
+ function f() {
2287
+ s.replace(u.defaultRedirect || "/");
2288
+ }
2289
+ return E(() => {
2290
+ t();
2291
+ }), (n, w) => (l(), k("div", xs, [e(d) ? (l(), k("div", Ls, [w[0] || (w[0] = _("div", {
2292
+ class: "spinner"
2293
+ }, null, -1)), _("p", null, L(u.loadingText ?? "正在登录..."), 1)])) : g.value ? (l(), k("div", Bs, [w[1] || (w[1] = _("div", {
2294
+ class: "error-icon"
2295
+ }, "✕", -1)), w[2] || (w[2] = _("h2", null, "登录失败", -1)), _("p", null, L(g.value), 1), _("button", {
2296
+ class: "retry-btn",
2297
+ type: "button",
2298
+ onClick: f
2299
+ }, "返回重试")])) : (l(), k("div", Ms, [w[3] || (w[3] = _("div", {
2300
+ class: "success-icon"
2301
+ }, "✓", -1)), _("p", null, L(h.value), 1)]))]));
2302
+ }
2303
+ }), wi = /* @__PURE__ */ U(Fs, [["__scopeId", "data-v-98babf68"]]), Ds = {
2304
+ class: "oauth-binding-account"
2305
+ }, Es = {
2306
+ key: 1,
2307
+ class: "oauth-binding-account__icon"
2308
+ }, Hs = {
2309
+ class: "oauth-binding-account__info"
2310
+ }, Gs = {
2311
+ class: "oauth-binding-account__name"
2312
+ }, Ns = /* @__PURE__ */ V({
2313
+ __name: "AuthkitGithubBinding",
2314
+ props: {
2315
+ size: {
2316
+ type: String,
2317
+ required: !0
2318
+ }
2319
+ },
2320
+ setup(b) {
2321
+ const {
2322
+ config: r
2323
+ } = pe(), {
2324
+ userProfile: u,
2325
+ fetchUserProfile: o
2326
+ } = Ae(), h = A("hidden"), g = A(!1);
2327
+ let a;
2328
+ const s = b, d = T(() => {
2329
+ var m, y, z;
2330
+ return ((y = (m = u.value) == null ? void 0 : m.github) == null ? void 0 : y.avatar_url) || ((z = u.value) == null ? void 0 : z.avatar) || "";
2331
+ }), {
2332
+ buildBindOauthRedirectUri: v
2333
+ } = ke();
2334
+ function t(m) {
2335
+ h.value = m;
2336
+ }
2337
+ async function f() {
2338
+ const m = r.appId;
2339
+ if (!m) {
2340
+ console.error("GitHub OAuth 失败: appId 未配置");
2341
+ return;
2342
+ }
2343
+ const {
2344
+ data: y,
2345
+ error: z
2346
+ } = await M().auth.oauth.github.login.get({
2347
+ appId: m,
2348
+ mode: "bind",
2349
+ redirectUri: v()
2350
+ });
2351
+ z || !y || (g.value = !0, window.open(y.redirectUri, "_blank"));
2352
+ }
2353
+ async function n() {
2354
+ const {
2355
+ error: m
2356
+ } = await M().auth.users.unbind.oauth.post({
2357
+ provider: "github"
2358
+ });
2359
+ m || (X.success("解绑成功"), h.value = "hidden", o());
2360
+ }
2361
+ function w() {
2362
+ h.value === "bind" && (h.value = "hidden", f()), h.value === "unbind" && n();
2363
+ }
2364
+ function c() {
2365
+ g.value && o();
2366
+ }
2367
+ return E(() => {
2368
+ u.value || o(), a = setInterval(c, 1e3);
2369
+ }), ue(() => {
2370
+ a && clearInterval(a);
2371
+ }), (m, y) => {
2372
+ var z, q, $;
2373
+ return l(), k(D, null, [!((z = e(u)) != null && z.github) && h.value === "hidden" ? (l(), S(e(fe), {
2374
+ key: 0,
2375
+ title: "绑定GitHub"
2376
+ }, {
2377
+ action: p(() => [i(e(B), {
2378
+ size: s.size,
2379
+ type: "primary",
2380
+ onClick: y[0] || (y[0] = (R) => t("bind"))
2381
+ }, {
2382
+ default: p(() => [...y[2] || (y[2] = [O(" 绑定GitHub ", -1)])]),
2383
+ _: 1
2384
+ }, 8, ["size"])]),
2385
+ default: p(() => [y[3] || (y[3] = O(" 您还未绑定GitHub账号,请点击绑定。 ", -1))]),
2386
+ _: 1
2387
+ })) : I("", !0), (q = e(u)) != null && q.github && h.value === "hidden" ? (l(), S(e(fe), {
2388
+ key: 1,
2389
+ title: "解绑GitHub"
2390
+ }, {
2391
+ action: p(() => [i(e(B), {
2392
+ size: s.size,
2393
+ type: "primary",
2394
+ onClick: y[1] || (y[1] = (R) => t("unbind"))
2395
+ }, {
2396
+ default: p(() => [...y[5] || (y[5] = [O(" 解绑GitHub ", -1)])]),
2397
+ _: 1
2398
+ }, 8, ["size"])]),
2399
+ default: p(() => {
2400
+ var R, x;
2401
+ return [_("div", Ds, [d.value ? (l(), S(e(te), {
2402
+ key: 0,
2403
+ class: "oauth-binding-account__avatar",
2404
+ "image-url": d.value,
2405
+ size: 42
2406
+ }, null, 8, ["image-url"])) : (l(), k("div", Es, [i(_e, {
2407
+ icon: e(Q).github,
2408
+ size: e(je),
2409
+ alt: "GitHub"
2410
+ }, null, 8, ["icon", "size"])])), _("div", Hs, [y[4] || (y[4] = _("div", {
2411
+ class: "oauth-binding-account__provider"
2412
+ }, "GitHub", -1)), _("div", Gs, L(((x = (R = e(u)) == null ? void 0 : R.github) == null ? void 0 : x.login) || "GitHub"), 1)])])];
2413
+ }),
2414
+ _: 1
2415
+ })) : I("", !0), h.value === "bind" || h.value === "unbind" ? (l(), S(We, {
2416
+ key: 2,
2417
+ size: s.size,
2418
+ email: ($ = e(u)) == null ? void 0 : $.email,
2419
+ onNext: w
2420
+ }, null, 8, ["size", "email"])) : I("", !0)], 64);
2421
+ };
2422
+ }
2423
+ }), _i = /* @__PURE__ */ U(Ns, [["__scopeId", "data-v-1cfa8892"]]), js = /* @__PURE__ */ V({
2424
+ __name: "LegalDocViewer",
2425
+ props: {
2426
+ type: {},
2427
+ appId: {}
2428
+ },
2429
+ setup(b) {
2430
+ const r = b, u = T(() => Ke[r.type] ?? ""), o = A(!1), h = A(null);
2431
+ async function g() {
2432
+ if (!r.type || !r.appId) {
2433
+ h.value = null;
2434
+ return;
2435
+ }
2436
+ o.value = !0;
2437
+ const a = await Ye(r.appId);
2438
+ if (o.value = !1, !a) {
2439
+ h.value = null;
2440
+ return;
2441
+ }
2442
+ const s = a[r.type];
2443
+ h.value = Je(s) ? s : null;
2444
+ }
2445
+ return ye(() => [r.type, r.appId], () => {
2446
+ g();
2447
+ }, {
2448
+ immediate: !0
2449
+ }), (a, s) => o.value ? (l(), S(e(Be), {
2450
+ key: 0,
2451
+ loading: o.value,
2452
+ class: "legal-doc-viewer-loading"
2453
+ }, null, 8, ["loading"])) : h.value ? (l(), S(e(Qe), {
2454
+ key: 2,
2455
+ modelValue: h.value,
2456
+ "onUpdate:modelValue": s[1] || (s[1] = (d) => h.value = d),
2457
+ editable: !1
2458
+ }, {
2459
+ title: p(() => [i(e(Xe), {
2460
+ modelValue: u.value,
2461
+ "onUpdate:modelValue": s[0] || (s[0] = (d) => u.value = d),
2462
+ editable: !1,
2463
+ class: "legal-doc-viewer-title"
2464
+ }, null, 8, ["modelValue"])]),
2465
+ _: 1
2466
+ }, 8, ["modelValue"])) : (l(), S(e(Me), {
2467
+ key: 1,
2468
+ description: "暂无内容"
2469
+ }));
2470
+ }
2471
+ }), ki = /* @__PURE__ */ U(js, [["__scopeId", "data-v-fe9a3621"]]);
2472
+ export {
2473
+ ws as A,
2474
+ ts as E,
2475
+ ki as L,
2476
+ J as O,
2477
+ $t as P,
2478
+ kt as R,
2479
+ ee as S,
2480
+ hi as _,
2481
+ yi as a,
2482
+ ks as b,
2483
+ Pe as c,
2484
+ bi as d,
2485
+ _i as e,
2486
+ Is as f,
2487
+ wi as g,
2488
+ lt as h,
2489
+ ct as i,
2490
+ vt as j,
2491
+ Qt as k,
2492
+ Lt as l,
2493
+ fs as m,
2494
+ ns as n,
2495
+ me as o,
2496
+ jt as p
2497
+ };