@huyooo/ui 2.1.4 → 2.1.8

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 (39) hide show
  1. package/dist/{AuthkitAppSetting-BJWwY3T-.js → AuthkitAppSetting-CHVSyEY1.js} +1 -1
  2. package/dist/{FeedbackModal.vue_vue_type_script_setup_true_lang-BJj1bNKu.js → FeedbackModal.vue_vue_type_script_setup_true_lang-FIZdBxIZ.js} +1 -1
  3. package/dist/{LegalDocViewer-DCDSLVjc.js → LegalDocViewer-DiNoy_oj.js} +2 -2
  4. package/dist/PaySubscriptions-pEZtjp1g.js +1287 -0
  5. package/dist/{PricingPlans-CXk2DNb4.js → PricingPlans-qRWHwi9x.js} +2 -2
  6. package/dist/{ReferrerReferees-ZhroFXBA.js → ReferrerReferees-t5s4LzbY.js} +1 -1
  7. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-DbkGYZ2f.js +601 -0
  8. package/dist/{WidthContainer-CDf1GiFk.js → WidthContainer-FXZqDMid.js} +4 -4
  9. package/dist/authkit.js +3 -3
  10. package/dist/common.js +1 -1
  11. package/dist/components/Authkit/AuthkitAppSetting.vue.d.ts +2 -2
  12. package/dist/components/Feedback/FeedbackModal.vue.d.ts +2 -2
  13. package/dist/components/LandingPage/LandingPageSections.vue.d.ts +1 -1
  14. package/dist/components/Message/MessageTabs.vue.d.ts +2 -2
  15. package/dist/components/Pay/PaySubscriptions.vue.d.ts +2 -2
  16. package/dist/components/UserMenu/UserMenuModals.vue.d.ts +9 -9
  17. package/dist/composables/Billing/useBillingPlans.d.ts +10 -2
  18. package/dist/composables/Billing/useBillingSubscriptionSummary.d.ts +77 -258
  19. package/dist/composables.js +3 -3
  20. package/dist/feedback.js +1 -1
  21. package/dist/main.js +103 -102
  22. package/dist/pay.d.ts +1 -1
  23. package/dist/pay.js +18 -17
  24. package/dist/referrer.js +1 -1
  25. package/dist/style.css +1 -1
  26. package/dist/types/api/billing.generated.d.ts +2 -2
  27. package/dist/types/subscription.d.ts +57 -0
  28. package/dist/types/user.d.ts +3 -0
  29. package/dist/useAuthkitUsersProfile-D4H_Gxgd.js +67 -0
  30. package/dist/useBillingSubscriptionSummary-BC3G0N4t.js +43 -0
  31. package/dist/{useRoutePermission-ZOeRg6Wq.js → useRoutePermission-CGq_LIZM.js} +1 -1
  32. package/dist/useSubscriptionCheckout-Dmg0kt4F.js +399 -0
  33. package/dist/user.js +1 -1
  34. package/dist/utils/subscriptionDisplay.d.ts +6 -6
  35. package/package.json +1 -1
  36. package/dist/PaySubscriptions-CXLqpfgf.js +0 -1331
  37. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-COM36ViG.js +0 -598
  38. package/dist/useAuthkitUsersProfile-DX2PYmdU.js +0 -59
  39. package/dist/useSubscriptionCheckout-DAwwBVAk.js +0 -353
@@ -1,598 +0,0 @@
1
- /* empty css */
2
- /* empty css */
3
- import "./index-BYH7DaQf.js";
4
- import { defineComponent as m, computed as b, openBlock as r, createElementBlock as p, toDisplayString as $, createCommentVNode as U, createVNode as _, unref as t, createBlock as v, withCtx as g, createTextVNode as k, ref as C, createElementVNode as d, watch as x, onMounted as ne, Fragment as q, normalizeClass as G, renderSlot as A } from "vue";
5
- import { Avatar as J, Button as N, Dropdown as te, Badge as se } from "@arco-design/web-vue";
6
- import { u as R } from "./useAuthkitUsersProfile-DX2PYmdU.js";
7
- import { u as y } from "./useUserMenu-ClPBlvaM.js";
8
- /* empty css */
9
- import { g as K, a as ae, R as oe } from "./ReferrerReferees-ZhroFXBA.js";
10
- import { _ as h } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
- /* empty css */
12
- import { u as ie } from "./apiClients-CWSwNzGk.js";
13
- import { f as re, u as le, g as ue, c as ce, s as de, P as pe } from "./PaySubscriptions-CXLqpfgf.js";
14
- import { d as me } from "./useBillingStatusOptions-C6edto7H.js";
15
- import { A as fe } from "./AuthkitAppSetting-BJWwY3T-.js";
16
- import { c as _e, u as Q } from "./FeedbackModal.vue_vue_type_script_setup_true_lang-BJj1bNKu.js";
17
- import { M as ve } from "./MessageHandle-DDGFSJMg.js";
18
- import "./Menu-uCexrsKP.js";
19
- import { Icon as ge } from "@iconify/vue";
20
- const be = {
21
- class: "UserAvatar"
22
- }, Ue = ["title"], ke = /* @__PURE__ */ m({
23
- __name: "UserAvatar",
24
- props: {
25
- userId: {
26
- default: ""
27
- },
28
- nickname: {
29
- default: ""
30
- },
31
- email: {
32
- default: ""
33
- },
34
- phone: {
35
- default: ""
36
- },
37
- avatar: {
38
- default: ""
39
- }
40
- },
41
- setup(n) {
42
- const e = n, o = b(() => K({
43
- userId: e.userId,
44
- nickname: e.nickname,
45
- email: e.email,
46
- phone: e.phone
47
- }));
48
- return (s, i) => (r(), p("div", be, [o.value ? (r(), p("span", {
49
- key: 0,
50
- class: "UserAvatar__nickname",
51
- title: o.value
52
- }, $(o.value), 9, Ue)) : U("", !0), _(t(J), {
53
- "image-url": n.avatar,
54
- size: 32,
55
- "object-fit": "cover"
56
- }, null, 8, ["image-url"])]));
57
- }
58
- }), ye = /* @__PURE__ */ h(ke, [["__scopeId", "data-v-949e953e"]]), Ie = /* @__PURE__ */ m({
59
- __name: "UserSignInButton",
60
- setup(n) {
61
- const {
62
- open: e
63
- } = ie();
64
- return (o, s) => (r(), v(t(N), {
65
- type: "primary",
66
- class: "UserSignInButton",
67
- onClick: s[0] || (s[0] = (i) => t(e)())
68
- }, {
69
- default: g(() => [...s[1] || (s[1] = [k("登录", -1)])]),
70
- _: 1
71
- }));
72
- }
73
- }), he = /* @__PURE__ */ h(Ie, [["__scopeId", "data-v-85695587"]]), Se = {}, Be = {
74
- class: "UserMenuDivider",
75
- role: "separator"
76
- };
77
- function $e(n, e) {
78
- return r(), p("div", Be);
79
- }
80
- const Me = /* @__PURE__ */ h(Se, [["render", $e], ["__scopeId", "data-v-c7d18d97"]]), Y = C(0);
81
- let P = null;
82
- function Ce() {
83
- async function n() {
84
- return P || (P = (async () => {
85
- const {
86
- data: e,
87
- error: o
88
- } = await me.productOptions();
89
- o || !Array.isArray(e) || (Y.value = e.filter((s) => {
90
- var i;
91
- return (i = s.prices) == null ? void 0 : i.some((c) => c.type === "recurring");
92
- }).length);
93
- })().finally(() => {
94
- P = null;
95
- }), P);
96
- }
97
- return {
98
- paidProductCount: Y,
99
- loadPaidProductCount: n
100
- };
101
- }
102
- const xe = {
103
- class: "UserBasicInformation"
104
- }, Ae = {
105
- class: "UserBasicInformation__extra"
106
- }, we = ["title"], Pe = ["title"], De = /* @__PURE__ */ m({
107
- __name: "UserBasicInformation",
108
- props: {
109
- userId: {
110
- default: ""
111
- },
112
- nickname: {
113
- default: ""
114
- },
115
- email: {
116
- default: ""
117
- },
118
- phone: {
119
- default: ""
120
- },
121
- avatarUrl: {
122
- default: ""
123
- },
124
- avatarSize: {
125
- default: 32
126
- }
127
- },
128
- setup(n) {
129
- const e = n, o = b(() => ({
130
- userId: e.userId,
131
- nickname: e.nickname,
132
- email: e.email,
133
- phone: e.phone
134
- })), s = b(() => K(o.value)), i = b(() => ae(o.value));
135
- return (c, a) => (r(), p("div", xe, [_(t(J), {
136
- "image-url": n.avatarUrl,
137
- size: n.avatarSize,
138
- "object-fit": "cover"
139
- }, null, 8, ["image-url", "size"]), d("div", Ae, [d("span", {
140
- class: "UserBasicInformation__nickname",
141
- title: s.value
142
- }, $(s.value), 9, we), i.value ? (r(), p("span", {
143
- key: 0,
144
- class: "UserBasicInformation__contact",
145
- title: i.value
146
- }, $(i.value), 9, Pe)) : U("", !0)])]));
147
- }
148
- }), W = /* @__PURE__ */ h(De, [["__scopeId", "data-v-cb95c00d"]]), Ne = {
149
- class: "UserSubscriptionBaseInformation"
150
- }, Re = {
151
- class: "UserSubscriptionBaseInformation__row"
152
- }, He = {
153
- class: "UserSubscriptionBaseInformation__info"
154
- }, Oe = ["title"], Ve = {
155
- key: 0,
156
- class: "UserSubscriptionBaseInformation__info"
157
- }, ze = ["title"], Te = {
158
- class: "UserSubscriptionBaseInformation__row"
159
- }, Le = {
160
- class: "UserSubscriptionBaseInformation__info"
161
- }, Ee = {
162
- class: "UserSubscriptionBaseInformation__value"
163
- }, je = {
164
- key: 1,
165
- class: "UserSubscriptionBaseInformation__row"
166
- }, Fe = /* @__PURE__ */ m({
167
- __name: "UserSubscriptionBaseInformation",
168
- props: {
169
- currentVersionName: {
170
- default: ""
171
- },
172
- expireDate: {
173
- default: ""
174
- },
175
- pointsBalance: {},
176
- pendingInvoiceTotal: {},
177
- loading: {
178
- type: Boolean,
179
- default: !1
180
- },
181
- canUpgrade: {
182
- type: Boolean,
183
- default: !1
184
- },
185
- actionLabel: {
186
- default: "升级"
187
- }
188
- },
189
- emits: ["upgradeHandle", "payHandle", "pointsHandle"],
190
- setup(n, {
191
- emit: e
192
- }) {
193
- const o = n, s = e, i = b(() => re(o.pointsBalance));
194
- return (c, a) => (r(), p("div", Ne, [d("div", Re, [d("div", He, [a[3] || (a[3] = d("span", {
195
- class: "UserSubscriptionBaseInformation__label"
196
- }, "当前权益:", -1)), d("span", {
197
- class: "UserSubscriptionBaseInformation__value",
198
- title: n.currentVersionName
199
- }, $(n.currentVersionName), 9, Oe)]), n.canUpgrade ? (r(), v(t(N), {
200
- key: 0,
201
- type: "primary",
202
- size: "mini",
203
- class: "UserSubscriptionBaseInformation__action",
204
- loading: n.loading,
205
- onClick: a[0] || (a[0] = (l) => s("upgradeHandle"))
206
- }, {
207
- default: g(() => [k($(n.actionLabel), 1)]),
208
- _: 1
209
- }, 8, ["loading"])) : U("", !0)]), n.expireDate ? (r(), p("div", Ve, [a[4] || (a[4] = d("span", {
210
- class: "UserSubscriptionBaseInformation__label"
211
- }, "有效期至:", -1)), d("span", {
212
- class: "UserSubscriptionBaseInformation__value",
213
- title: n.expireDate
214
- }, $(n.expireDate), 9, ze)])) : U("", !0), d("div", Te, [d("div", Le, [a[5] || (a[5] = d("span", {
215
- class: "UserSubscriptionBaseInformation__label"
216
- }, "积分余额:", -1)), d("span", Ee, $(i.value), 1)]), _(t(N), {
217
- type: "primary",
218
- size: "mini",
219
- class: "UserSubscriptionBaseInformation__action",
220
- loading: n.loading,
221
- onClick: a[1] || (a[1] = (l) => s("pointsHandle"))
222
- }, {
223
- default: g(() => [...a[6] || (a[6] = [k(" 充值 ", -1)])]),
224
- _: 1
225
- }, 8, ["loading"])]), typeof n.pendingInvoiceTotal == "number" && n.pendingInvoiceTotal > 0 ? (r(), p("div", je, [a[8] || (a[8] = d("span", {
226
- class: "UserSubscriptionBaseInformation__warning"
227
- }, "有待支付订阅账单", -1)), _(t(N), {
228
- type: "primary",
229
- status: "warning",
230
- size: "mini",
231
- class: "UserSubscriptionBaseInformation__action",
232
- loading: n.loading,
233
- onClick: a[2] || (a[2] = (l) => s("payHandle"))
234
- }, {
235
- default: g(() => [...a[7] || (a[7] = [k(" 去支付 ", -1)])]),
236
- _: 1
237
- }, 8, ["loading"])])) : U("", !0)]));
238
- }
239
- }), Xe = /* @__PURE__ */ h(Fe, [["__scopeId", "data-v-7938abb7"]]), Ye = /* @__PURE__ */ m({
240
- __name: "UserMenuHeader",
241
- props: {
242
- showSubscription: {
243
- type: Boolean,
244
- default: !0
245
- },
246
- currentVersionName: {
247
- default: ""
248
- },
249
- expireDate: {
250
- default: ""
251
- },
252
- canUpgrade: {
253
- type: Boolean,
254
- default: !0
255
- }
256
- },
257
- setup(n) {
258
- const e = n, {
259
- userProfile: o
260
- } = R(), {
261
- isOpen: s,
262
- openSubscriptions: i
263
- } = y(), {
264
- entitlement: c,
265
- pointsBalance: a,
266
- pendingInvoice: l,
267
- loading: f,
268
- refresh: S
269
- } = le(), {
270
- paidProductCount: I,
271
- loadPaidProductCount: B
272
- } = Ce(), u = b(() => e.currentVersionName ? e.currentVersionName : ue(c.value)), H = b(() => {
273
- var w;
274
- return e.expireDate || ((w = c.value) == null ? void 0 : w.endAt) || "";
275
- }), Z = b(() => ce(c.value, I.value)), ee = b(() => de(c.value, I.value, e.canUpgrade));
276
- function O() {
277
- e.showSubscription && (S(), B());
278
- }
279
- return x(s, (w) => {
280
- w && O();
281
- }), ne(() => {
282
- s.value && O();
283
- }), (w, M) => {
284
- var V, z, T, L, E, j, F;
285
- return r(), p(q, null, [_(W, {
286
- "user-id": (V = t(o)) == null ? void 0 : V.id,
287
- "avatar-url": (z = t(o)) == null ? void 0 : z.avatarUrl,
288
- nickname: (T = t(o)) == null ? void 0 : T.nickname,
289
- email: (L = t(o)) == null ? void 0 : L.email,
290
- phone: (E = t(o)) == null ? void 0 : E.phone
291
- }, null, 8, ["user-id", "avatar-url", "nickname", "email", "phone"]), n.showSubscription ? (r(), v(Xe, {
292
- key: 0,
293
- "current-version-name": u.value,
294
- "expire-date": H.value,
295
- "points-balance": ((j = t(a)) == null ? void 0 : j.totalPoints) ?? 0,
296
- "pending-invoice-total": (F = t(l)) == null ? void 0 : F.total,
297
- loading: t(f),
298
- "can-upgrade": ee.value,
299
- "action-label": Z.value,
300
- onUpgradeHandle: M[0] || (M[0] = (X) => t(i)()),
301
- onPayHandle: M[1] || (M[1] = (X) => t(i)({
302
- target: "invoices"
303
- })),
304
- onPointsHandle: M[2] || (M[2] = (X) => t(i)({
305
- target: "points"
306
- }))
307
- }, null, 8, ["current-version-name", "expire-date", "points-balance", "pending-invoice-total", "loading", "can-upgrade", "action-label"])) : U("", !0)], 64);
308
- };
309
- }
310
- }), qe = {
311
- key: 0,
312
- "aria-hidden": "true"
313
- }, Ge = {
314
- class: "UserMenu__content"
315
- }, Je = {
316
- class: "UserMenu__header"
317
- }, Ke = /* @__PURE__ */ m({
318
- __name: "UserMenu",
319
- props: {
320
- position: {
321
- default: "br"
322
- },
323
- dropdownOffsetX: {
324
- default: "0"
325
- },
326
- dropdownOffsetY: {
327
- default: "0"
328
- }
329
- },
330
- setup(n) {
331
- const {
332
- userProfile: e,
333
- authSessionState: o
334
- } = R(), {
335
- isOpen: s,
336
- setOpen: i
337
- } = y(), c = b({
338
- get: () => s.value,
339
- set: (a) => i(a)
340
- });
341
- return (a, l) => (r(), p("div", {
342
- class: G(["UserMenu-auth-chrome", {
343
- "UserMenu-auth-chrome--custom-trigger": a.$slots.trigger
344
- }])
345
- }, [t(o) === "pending" ? (r(), p("span", qe)) : t(o) === "unauthenticated" ? (r(), v(he, {
346
- key: 1
347
- })) : (r(), v(t(te), {
348
- key: 2,
349
- "popup-visible": c.value,
350
- "onUpdate:popupVisible": l[0] || (l[0] = (f) => c.value = f),
351
- class: "UserMenu",
352
- position: n.position,
353
- "popup-max-height": !1,
354
- "popup-style": {
355
- "--user-menu-translate-x": n.dropdownOffsetX ?? "0",
356
- "--user-menu-translate-y": n.dropdownOffsetY ?? "0"
357
- }
358
- }, {
359
- content: g(() => [d("div", Ge, [d("div", Je, [A(a.$slots, "header", {
360
- user: t(e)
361
- }, () => [_(Ye)], !0)]), a.$slots.items ? (r(), v(Me, {
362
- key: 0
363
- })) : U("", !0), A(a.$slots, "items", {}, void 0, !0)])]),
364
- default: g(() => [A(a.$slots, "trigger", {
365
- user: t(e)
366
- }, () => {
367
- var f, S, I, B, u;
368
- return [_(ye, {
369
- "user-id": (f = t(e)) == null ? void 0 : f.id,
370
- nickname: (S = t(e)) == null ? void 0 : S.nickname,
371
- email: (I = t(e)) == null ? void 0 : I.email,
372
- phone: (B = t(e)) == null ? void 0 : B.phone,
373
- avatar: (u = t(e)) == null ? void 0 : u.avatarUrl
374
- }, null, 8, ["user-id", "nickname", "email", "phone", "avatar"])];
375
- }, !0)]),
376
- _: 3
377
- }, 8, ["popup-visible", "position", "popup-style"]))], 2));
378
- }
379
- }), Sn = /* @__PURE__ */ h(Ke, [["__scopeId", "data-v-c03d428f"]]), Qe = ["disabled"], We = {
380
- class: "UserMenuItem__label"
381
- }, Ze = {
382
- class: "UserMenuItem__label-text"
383
- }, en = {
384
- key: 0,
385
- class: "UserMenuItem__icon"
386
- }, nn = /* @__PURE__ */ m({
387
- __name: "UserMenuItem",
388
- props: {
389
- icon: {
390
- default: void 0
391
- },
392
- danger: {
393
- type: Boolean,
394
- default: !1
395
- },
396
- disabled: {
397
- type: Boolean,
398
- default: !1
399
- },
400
- closeOnClick: {
401
- type: Boolean,
402
- default: !0
403
- },
404
- badge: {
405
- default: 0
406
- }
407
- },
408
- emits: ["click"],
409
- setup(n, {
410
- emit: e
411
- }) {
412
- const o = n, s = b(() => o.badge > 0), i = e, {
413
- close: c
414
- } = y();
415
- function a(l) {
416
- l.stopPropagation(), !o.disabled && (o.closeOnClick && c(), i("click", l));
417
- }
418
- return (l, f) => (r(), p("button", {
419
- type: "button",
420
- class: G(["UserMenuItem", {
421
- "is-danger": n.danger,
422
- "is-disabled": n.disabled
423
- }]),
424
- disabled: n.disabled,
425
- onClick: a
426
- }, [d("span", We, [s.value ? (r(), v(t(se), {
427
- key: 0,
428
- count: n.badge,
429
- "max-count": 99,
430
- offset: [10, 0]
431
- }, {
432
- default: g(() => [d("span", Ze, [A(l.$slots, "default", {}, void 0, !0)])]),
433
- _: 3
434
- }, 8, ["count"])) : A(l.$slots, "default", {
435
- key: 1
436
- }, void 0, !0)]), l.$slots.icon || n.icon ? (r(), p("span", en, [A(l.$slots, "icon", {}, () => [n.icon ? (r(), v(t(ge), {
437
- key: 0,
438
- icon: n.icon,
439
- width: 16,
440
- height: 16
441
- }, null, 8, ["icon"])) : U("", !0)], !0)])) : U("", !0)], 10, Qe));
442
- }
443
- }), D = /* @__PURE__ */ h(nn, [["__scopeId", "data-v-d5d01729"]]), Bn = /* @__PURE__ */ m({
444
- __name: "UserMenuModals",
445
- setup(n) {
446
- const {
447
- settingTrigger: e,
448
- subscriptionsTrigger: o,
449
- subscriptionsOptions: s,
450
- messagesTrigger: i,
451
- feedbackTrigger: c,
452
- invitationsTrigger: a
453
- } = y(), l = C(null), f = C(null), S = C(null), I = C(null), B = C(null);
454
- return x(e, () => {
455
- var u;
456
- (u = l.value) == null || u.setData(null, !0);
457
- }), x(o, () => {
458
- var u;
459
- (u = f.value) == null || u.setData(s.value, !0);
460
- }), x(i, () => {
461
- var u;
462
- (u = S.value) == null || u.openNotification();
463
- }), x(c, () => {
464
- var u;
465
- (u = I.value) == null || u.setData(!0);
466
- }), x(a, () => {
467
- var u;
468
- (u = B.value) == null || u.setData(!0);
469
- }), (u, H) => (r(), p(q, null, [_(fe, {
470
- ref_key: "appSettingRef",
471
- ref: l
472
- }, null, 512), _(pe, {
473
- ref_key: "paySubsRef",
474
- ref: f
475
- }, null, 512), _(ve, {
476
- ref_key: "messageHandleRef",
477
- ref: S
478
- }, null, 512), _(_e, {
479
- ref_key: "feedbackModalRef",
480
- ref: I
481
- }, null, 512), _(oe, {
482
- ref_key: "refereesRef",
483
- ref: B
484
- }, null, 512)], 64));
485
- }
486
- }), tn = {
487
- class: "UserAccountMenu"
488
- }, sn = /* @__PURE__ */ m({
489
- __name: "UserAccountMenu",
490
- setup(n) {
491
- const {
492
- userProfile: e
493
- } = R();
494
- return (o, s) => {
495
- var i, c, a, l, f;
496
- return r(), p("div", tn, [_(W, {
497
- "user-id": (i = t(e)) == null ? void 0 : i.id,
498
- "avatar-url": (c = t(e)) == null ? void 0 : c.avatarUrl,
499
- nickname: (a = t(e)) == null ? void 0 : a.nickname,
500
- email: (l = t(e)) == null ? void 0 : l.email,
501
- phone: (f = t(e)) == null ? void 0 : f.phone
502
- }, null, 8, ["user-id", "avatar-url", "nickname", "email", "phone"])]);
503
- };
504
- }
505
- }), $n = /* @__PURE__ */ h(sn, [["__scopeId", "data-v-fe79b69c"]]), Mn = /* @__PURE__ */ m({
506
- __name: "UserMenuMessageItem",
507
- setup(n) {
508
- const {
509
- openMessages: e
510
- } = y(), {
511
- messageUnreadCount: o
512
- } = Q();
513
- return (s, i) => (r(), v(D, {
514
- icon: "lucide:chevron-right",
515
- badge: t(o),
516
- onClick: t(e)
517
- }, {
518
- default: g(() => [...i[0] || (i[0] = [k(" 消息中心 ", -1)])]),
519
- _: 1
520
- }, 8, ["badge", "onClick"]));
521
- }
522
- }), Cn = /* @__PURE__ */ m({
523
- __name: "UserMenuSettingItem",
524
- setup(n) {
525
- const {
526
- openSetting: e
527
- } = y();
528
- return (o, s) => (r(), v(D, {
529
- icon: "lucide:user-round",
530
- onClick: t(e)
531
- }, {
532
- default: g(() => [...s[0] || (s[0] = [k("用户信息", -1)])]),
533
- _: 1
534
- }, 8, ["onClick"]));
535
- }
536
- }), xn = /* @__PURE__ */ m({
537
- __name: "UserMenuSubscriptionItem",
538
- setup(n) {
539
- const {
540
- openSubscriptions: e
541
- } = y();
542
- return (o, s) => (r(), v(D, {
543
- icon: "lucide:chevron-right",
544
- onClick: s[0] || (s[0] = (i) => t(e)())
545
- }, {
546
- default: g(() => [...s[1] || (s[1] = [k("订阅与积分", -1)])]),
547
- _: 1
548
- }));
549
- }
550
- }), An = /* @__PURE__ */ m({
551
- __name: "UserMenuFeedbackItem",
552
- setup(n) {
553
- const {
554
- openFeedback: e
555
- } = y(), {
556
- feedbackUnreadCount: o
557
- } = Q();
558
- return (s, i) => (r(), v(D, {
559
- icon: "lucide:chevron-right",
560
- badge: t(o),
561
- onClick: t(e)
562
- }, {
563
- default: g(() => [...i[0] || (i[0] = [k(" 系统反馈 ", -1)])]),
564
- _: 1
565
- }, 8, ["badge", "onClick"]));
566
- }
567
- }), wn = /* @__PURE__ */ m({
568
- __name: "UserMenuInvitationsItem",
569
- setup(n) {
570
- const {
571
- openInvitations: e
572
- } = y();
573
- return (o, s) => (r(), v(D, {
574
- icon: "lucide:chevron-right",
575
- onClick: t(e)
576
- }, {
577
- default: g(() => [...s[0] || (s[0] = [k("邀请", -1)])]),
578
- _: 1
579
- }, 8, ["onClick"]));
580
- }
581
- });
582
- export {
583
- $n as U,
584
- An as _,
585
- ye as a,
586
- W as b,
587
- Sn as c,
588
- Me as d,
589
- Ye as e,
590
- wn as f,
591
- D as g,
592
- Mn as h,
593
- Bn as i,
594
- Cn as j,
595
- xn as k,
596
- he as l,
597
- Xe as m
598
- };
@@ -1,59 +0,0 @@
1
- import { ref as r, computed as l } from "vue";
2
- import { g as c } from "./apiClients-CWSwNzGk.js";
3
- import { u as i } from "./useAuthkitAuth-CWHJs8zY.js";
4
- const e = r(null), n = r(!1), u = r(!1), o = r(!1);
5
- function v() {
6
- o.value = !0;
7
- }
8
- function p(t) {
9
- return t === 401 || t === 40101;
10
- }
11
- const d = l(() => !!e.value), h = l(() => {
12
- if (!o.value || !u.value)
13
- return "pending";
14
- if (e.value)
15
- return "authenticated";
16
- const {
17
- getToken: t
18
- } = i();
19
- return t() ? "authenticated" : "unauthenticated";
20
- });
21
- async function g() {
22
- const {
23
- getToken: t,
24
- clearAuth: f
25
- } = i();
26
- if (!t()) {
27
- e.value = null, u.value = !0;
28
- return;
29
- }
30
- n.value = !0, u.value = !1;
31
- const {
32
- data: s,
33
- error: a
34
- } = await c().auth.users.profile.post({
35
- meta: {
36
- silentError: !0
37
- }
38
- });
39
- n.value = !1, s ? e.value = s : p(a == null ? void 0 : a.code) && (e.value = null, console.warn("认证已过期,清除认证状态"), f()), u.value = !0;
40
- }
41
- function m() {
42
- e.value = null, n.value = !1, u.value = !0;
43
- }
44
- function E() {
45
- return {
46
- userProfile: e,
47
- loading: n,
48
- usersProfileReady: u,
49
- authSessionBootstrapped: o,
50
- isLoggedIn: d,
51
- authSessionState: h,
52
- fetchUserProfile: g,
53
- clearUserProfile: m,
54
- markAuthSessionBootstrapped: v
55
- };
56
- }
57
- export {
58
- E as u
59
- };