@huyooo/ui 3.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/{AuthkitAppSetting-DhLRYlL_.js → AuthkitAppSetting-Cg8j3nES.js} +41 -42
  2. package/dist/{Contact-CNLjyOCR.js → Contact-D9NRguTE.js} +4 -4
  3. package/dist/{CustomTable-B1KjkixL.js → CustomTable-C15Dgbks.js} +4 -4
  4. package/dist/{FeedbackItem-BP-SiJ2u.js → FeedbackItem-hnJ7YXdE.js} +1 -1
  5. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-Ddy1jcdL.js +1526 -0
  6. package/dist/{LandingPageSectionTabs-BEAnU8B0.js → LandingPageSectionTabs-BJQeq3V5.js} +515 -402
  7. package/dist/{LegalDocViewer-DkVW9tCh.js → LegalDocViewer-BuzKCAfO.js} +44 -45
  8. package/dist/{Menu-uCexrsKP.js → Menu-C6NA8hCs.js} +1 -1
  9. package/dist/{MessageHandle-BKMBtqZM.js → MessageHandle-Cu23QspL.js} +13 -14
  10. package/dist/{MessageList-BK4u5DCH.js → MessageList-DdDKl9wk.js} +6 -7
  11. package/dist/{PaySubscriptions-tJSQUmhE.js → PaySubscriptions-ZSvRTG2i.js} +14 -15
  12. package/dist/{PricingPlans-BhcDv8uk.js → PricingPlans-DTGJ-_us.js} +13 -14
  13. package/dist/{ReferrerReferees-QTZnOCJB.js → ReferrerReferees-gkKtDau-.js} +25 -26
  14. package/dist/{Upload.vue_vue_type_script_setup_true_lang-CZjNlns_.js → Upload.vue_vue_type_script_setup_true_lang-C6B5_Hjo.js} +2 -2
  15. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BQgy_CeZ.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BH6l-SKs.js} +34 -35
  16. package/dist/{WidthContainer-BEeYYOat.js → WidthContainer-DXwIiG2x.js} +32 -32
  17. package/dist/{apiClients-8_c5cDW5.js → apiClients-5u4_uxFE.js} +47 -48
  18. package/dist/authkit.js +10 -10
  19. package/dist/common/globalConfig.d.ts +4 -4
  20. package/dist/common.js +3 -3
  21. package/dist/components/LandingPage/LandingPageHero.vue.d.ts +22 -0
  22. package/dist/components/Pay/PricingPlans.vue.d.ts +1 -1
  23. package/dist/composables/Authkit/useAuthkitAppsAuthPageInfo.d.ts +21 -0
  24. package/dist/composables/useAccessPosture.d.ts +31 -0
  25. package/dist/composables.d.ts +1 -0
  26. package/dist/composables.js +53 -49
  27. package/dist/feedback.js +3 -3
  28. package/dist/{fetchAuthPageAboutUs--dArFYk6.js → fetchAuthPageAboutUs-C-jQ44QK.js} +2 -2
  29. package/dist/{index-D9YtlhTa.js → index-5OR_BVTz.js} +4 -5
  30. package/dist/{index-D56hUMeD.js → index-BIxwv9Xs.js} +1 -1
  31. package/dist/landingPage.js +1 -1
  32. package/dist/legalDocs/constants.d.ts +1 -0
  33. package/dist/main.js +266 -262
  34. package/dist/message.js +36 -37
  35. package/dist/pay.js +5 -5
  36. package/dist/privateCom.js +1 -1
  37. package/dist/referrer.js +1 -1
  38. package/dist/{runtime-CDEl4QQl.js → runtime-B-tHI8-q.js} +191 -186
  39. package/dist/style.css +1 -1
  40. package/dist/types/api/auth.generated.d.ts +188 -37
  41. package/dist/types/api/ones.generated.d.ts +1512 -364
  42. package/dist/types/app.d.ts +9 -0
  43. package/dist/types/auth.d.ts +2 -1
  44. package/dist/upload.js +2 -2
  45. package/dist/useAccessPosture-DBNTLWQn.js +219 -0
  46. package/dist/{useAuthkitAppsAuthPageInfo-mv7hOnhi.js → useAuthkitAppsAuthPageInfo-CsivtUQH.js} +40 -33
  47. package/dist/{useAuthkitAuth-CO61XogP.js → useAuthkitAuth-CV60Hc3o.js} +56 -51
  48. package/dist/useAuthkitCreateAndUpdate-DJIn96EE.js +24 -0
  49. package/dist/{useAuthkitUsersProfile-CF7t2Y7T.js → useAuthkitUsersProfile-CQOLEAxC.js} +3 -3
  50. package/dist/{useBillingStatusOptions-C8fwW-AI.js → useBillingStatusOptions-BHVLZhEB.js} +1 -1
  51. package/dist/{useBillingSubscriptionSummary-C2E3p68U.js → useBillingSubscriptionSummary-DakAVL-3.js} +1 -1
  52. package/dist/{useEnsureAuthenticated-Q7EHguY4.js → useEnsureAuthenticated-BYGI2uYZ.js} +2 -2
  53. package/dist/{useLegalDocs-DUbab5R9.js → useLegalDocs-BrYWCDh3.js} +6 -5
  54. package/dist/{useMessageNotifications-BXimltcx.js → useMessageNotifications-Dcl8TXr-.js} +1 -1
  55. package/dist/{usePageSEO-D8CocvOJ.js → usePageSEO-BHYaXnDU.js} +12 -13
  56. package/dist/useRoutePermission-BkWHsFxN.js +212 -0
  57. package/dist/{useSubscriptionCheckout-Bic8vKgm.js → useSubscriptionCheckout-QSNro05_.js} +17 -18
  58. package/dist/user.js +1 -1
  59. package/dist/{userMenuModal-D-nDaYqM.js → userMenuModal-B4m4CHlW.js} +1 -1
  60. package/package.json +1 -1
  61. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-BXqxUXuu.js +0 -1516
  62. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
  63. package/dist/useAuthkitCreateAndUpdate-CYIcEuub.js +0 -25
  64. package/dist/useRoutePermission-Bvn-J8bp.js +0 -249
@@ -43,6 +43,10 @@ export interface RegistrationTermsInfo {
43
43
  export interface SignUpAuthConfig {
44
44
  enabled: boolean;
45
45
  }
46
+ export type AppAccessMode = 'development' | 'enterprise' | 'invite' | 'public';
47
+ export interface AppInviteAccess {
48
+ mode: AppAccessMode;
49
+ }
46
50
  export interface AboutUsDoc {
47
51
  type: string;
48
52
  content: any[];
@@ -53,6 +57,7 @@ export interface AboutUs {
53
57
  userServiceAgreement: AboutUsDoc;
54
58
  privacyPolicy: AboutUsDoc;
55
59
  licenseInformation: AboutUsDoc;
60
+ complaintReportingRules: AboutUsDoc;
56
61
  }
57
62
  export interface Brand {
58
63
  theme: string;
@@ -82,6 +87,10 @@ export interface AppsData {
82
87
  oauth: OAuthConfig;
83
88
  authMethods: AuthMethodsConfig;
84
89
  signUpAuth?: SignUpAuthConfig;
90
+ inviteAccess?: AppInviteAccess;
91
+ accessMode?: AppAccessMode;
92
+ signUpEnabled?: boolean;
93
+ inviteOnly?: boolean;
85
94
  registrationTerms?: RegistrationTermsInfo;
86
95
  authorizationCallback: string;
87
96
  aboutUs: AboutUs;
@@ -23,5 +23,6 @@ export type AboutUsType = {
23
23
  userServiceAgreement: JSONContent;
24
24
  privacyPolicy: JSONContent;
25
25
  licenseInformation: JSONContent;
26
+ complaintReportingRules: JSONContent;
26
27
  };
27
- export type AboutUsTypes = 'personalInformationCollectionList' | 'thirdPartyInformationSharingList' | 'userServiceAgreement' | 'privacyPolicy' | 'licenseInformation';
28
+ export type AboutUsTypes = 'personalInformationCollectionList' | 'thirdPartyInformationSharingList' | 'userServiceAgreement' | 'privacyPolicy' | 'licenseInformation' | 'complaintReportingRules';
package/dist/upload.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as o } from "./Upload.vue_vue_type_script_setup_true_lang-CZjNlns_.js";
2
- import { b as s, d as p } from "./runtime-CDEl4QQl.js";
1
+ import { _ as o } from "./Upload.vue_vue_type_script_setup_true_lang-C6B5_Hjo.js";
2
+ import { b as s, d as p } from "./runtime-B-tHI8-q.js";
3
3
  export {
4
4
  o as Upload,
5
5
  s as createBrowserCosTransport,
@@ -0,0 +1,219 @@
1
+ import { computed as a, ref as p, onMounted as N } from "vue";
2
+ import { useRouter as E } from "vue-router";
3
+ import { u as y } from "./useAuthkitAppsAuthPageInfo-CsivtUQH.js";
4
+ import { u as A } from "./useAuthkitAuth-CV60Hc3o.js";
5
+ import { g as h } from "./apiClients-5u4_uxFE.js";
6
+ function $(e, n = "default") {
7
+ const t = document;
8
+ if (t && typeof t.startViewTransition == "function") {
9
+ const r = document.body;
10
+ r.classList.add(`vt-${n}`), t.startViewTransition(() => {
11
+ try {
12
+ e();
13
+ } catch {
14
+ }
15
+ }).finished.finally(() => {
16
+ r.classList.remove(`vt-${n}`);
17
+ });
18
+ } else
19
+ e();
20
+ }
21
+ function B() {
22
+ const {
23
+ appsData: e,
24
+ appsAuthPageInfoSuccess: n
25
+ } = y(), t = E(), r = a(() => n.value), s = a(() => r.value && e.value.applicationLogoUrl || ""), o = a(() => r.value && e.value.name || "");
26
+ function f() {
27
+ $(() => {
28
+ t.push("/"), window.scrollTo({
29
+ top: 0,
30
+ behavior: "smooth"
31
+ });
32
+ });
33
+ }
34
+ return {
35
+ brandReady: r,
36
+ brandLogoUrl: s,
37
+ brandName: o,
38
+ navigateToAppHome: f
39
+ };
40
+ }
41
+ const c = p(!1), u = p(!1), i = p(!1);
42
+ let m = !1;
43
+ function v(e) {
44
+ return e === "development" || e === "enterprise" || e === "invite" || e === "public" ? e : null;
45
+ }
46
+ function M(e) {
47
+ var n;
48
+ return v(e.accessMode) || v((n = e.inviteAccess) == null ? void 0 : n.mode);
49
+ }
50
+ function T(e) {
51
+ var n;
52
+ return !(e.signUpEnabled === !1 || ((n = e.signUpAuth) == null ? void 0 : n.enabled) === !1);
53
+ }
54
+ function j(e) {
55
+ return typeof e != "object" || e === null || !("granted" in e) ? !1 : e.granted === !0;
56
+ }
57
+ function D(e) {
58
+ if (typeof e != "object" || e === null || !("application" in e))
59
+ return !1;
60
+ const n = e.application;
61
+ return typeof n != "object" || n === null || !("submittedAt" in n) ? !1 : !!n.submittedAt;
62
+ }
63
+ function l(e, n) {
64
+ const t = e.trim();
65
+ if (!t)
66
+ return n;
67
+ const r = t.slice(-1);
68
+ return /[A-Za-z0-9]/.test(r) ? `${t} ${n}` : `${t}${n}`;
69
+ }
70
+ function d() {
71
+ return {
72
+ note: null,
73
+ kind: "enter",
74
+ primaryLabel: "进入应用",
75
+ secondaryLabel: null
76
+ };
77
+ }
78
+ function L(e) {
79
+ return e ? {
80
+ primaryLabel: "注册",
81
+ secondaryLabel: "登录"
82
+ } : {
83
+ primaryLabel: "登录",
84
+ secondaryLabel: null
85
+ };
86
+ }
87
+ function R(e) {
88
+ return e === "development" ? "正在开发中" : e === "enterprise" ? "正在进行企业内测" : "正在邀请制内测中";
89
+ }
90
+ function C(e, n) {
91
+ const t = n.brandName || "", r = L(n.signUpEnabled), s = R(e), o = n.signUpEnabled ? `${s}。注册时填写邀请码即可开通;没有邀请码也可以先注册,再申请开通。` : `${s}。请使用已开通账号登录。`;
92
+ return {
93
+ note: l(t, o),
94
+ kind: "guest",
95
+ ...r
96
+ };
97
+ }
98
+ function F(e) {
99
+ return {
100
+ note: l(e, "你的账号尚未开通。申请开通通过后即可使用。"),
101
+ kind: "waitlisted",
102
+ primaryLabel: "申请开通",
103
+ secondaryLabel: null
104
+ };
105
+ }
106
+ function w(e) {
107
+ return {
108
+ note: l(e, "已收到你的申请,开通后即可使用。"),
109
+ kind: "applied",
110
+ primaryLabel: "已提交申请",
111
+ secondaryLabel: null
112
+ };
113
+ }
114
+ function V(e) {
115
+ const n = e.brandName || "";
116
+ return e.loggedIn && e.granted ? d() : e.loggedIn && e.applied ? w(n) : e.loggedIn ? {
117
+ note: l(n, "当前尚未对外开放。你可以申请开通,通过后即可使用。"),
118
+ kind: "waitlisted",
119
+ primaryLabel: "申请开通",
120
+ secondaryLabel: null
121
+ } : {
122
+ note: l(n, e.signUpEnabled ? "当前尚未对外开放。你可以注册并申请开通,通过后即可使用。" : "当前尚未对外开放。请使用已开通账号登录。"),
123
+ kind: "guest",
124
+ ...L(e.signUpEnabled)
125
+ };
126
+ }
127
+ function x(e, n) {
128
+ return n.loggedIn && n.granted || !e || e === "public" ? d() : n.loggedIn ? n.applied ? w(n.brandName || "") : F(n.brandName || "") : C(e, n);
129
+ }
130
+ function z(e) {
131
+ c.value = j(e), u.value = D(e);
132
+ }
133
+ async function G() {
134
+ const {
135
+ data: e,
136
+ error: n
137
+ } = await h().auth.serviceAccess.status.post({
138
+ meta: {
139
+ silentError: !0
140
+ }
141
+ });
142
+ n || !e || z(e);
143
+ }
144
+ function I() {
145
+ c.value = !1, u.value = !1;
146
+ }
147
+ async function P(e) {
148
+ if (!e) {
149
+ I(), i.value = !0;
150
+ return;
151
+ }
152
+ await G(), i.value = !0;
153
+ }
154
+ function H() {
155
+ if (m)
156
+ return;
157
+ m = !0;
158
+ const {
159
+ onSignIn: e,
160
+ onSignOut: n
161
+ } = A();
162
+ e(() => {
163
+ i.value = !1, P(!0);
164
+ }), n(() => {
165
+ I(), i.value = !0;
166
+ });
167
+ }
168
+ async function O() {
169
+ const {
170
+ data: e,
171
+ error: n
172
+ } = await h().auth.serviceAccess.apply.post({});
173
+ return n || !e ? {
174
+ ok: !1
175
+ } : (u.value = !0, {
176
+ ok: !0
177
+ });
178
+ }
179
+ function Q() {
180
+ const {
181
+ brandName: e
182
+ } = B(), {
183
+ jwtToken: n
184
+ } = A(), {
185
+ appsData: t,
186
+ appsAuthPageInfoSuccess: r,
187
+ appsAuthPageInfoFailed: s
188
+ } = y();
189
+ H(), N(() => {
190
+ P(!!n.value);
191
+ });
192
+ const o = a(() => M(t.value)), f = a(() => T(t.value)), k = a(() => !!n.value), S = a(() => r.value || s.value), b = a(() => S.value && i.value), U = a(() => {
193
+ if (!b.value)
194
+ return null;
195
+ const g = {
196
+ brandName: e.value,
197
+ loggedIn: k.value,
198
+ granted: c.value,
199
+ applied: u.value,
200
+ signUpEnabled: f.value
201
+ };
202
+ return s.value ? V(g) : x(o.value, g);
203
+ });
204
+ return {
205
+ accessMode: o,
206
+ loaded: b,
207
+ posture: U,
208
+ granted: c,
209
+ applied: u,
210
+ applyWaitlist: O
211
+ };
212
+ }
213
+ export {
214
+ x as a,
215
+ O as b,
216
+ B as c,
217
+ Q as u,
218
+ $ as w
219
+ };
@@ -1,7 +1,7 @@
1
- import { ref as r } from "vue";
2
- import { g as s } from "./apiClients-8_c5cDW5.js";
3
- import { g as u } from "./runtime-CDEl4QQl.js";
4
- function t() {
1
+ import { ref as t } from "vue";
2
+ import { g as u } from "./apiClients-5u4_uxFE.js";
3
+ import { g as c } from "./runtime-B-tHI8-q.js";
4
+ function r() {
5
5
  return {
6
6
  type: "doc",
7
7
  content: [{
@@ -9,32 +9,34 @@ function t() {
9
9
  }]
10
10
  };
11
11
  }
12
- function c(e) {
12
+ function p(e) {
13
13
  return e.type === "doc" && Array.isArray(e.content) && e.content.length > 0;
14
14
  }
15
- function a(e) {
16
- return typeof e == "string" || e == null ? t() : c(e) ? e : t();
15
+ function n(e) {
16
+ return typeof e == "string" || e == null ? r() : p(e) ? e : r();
17
17
  }
18
- function p(e) {
18
+ function f(e) {
19
19
  return {
20
- personalInformationCollectionList: a(e.personalInformationCollectionList),
21
- thirdPartyInformationSharingList: a(e.thirdPartyInformationSharingList),
22
- userServiceAgreement: a(e.userServiceAgreement),
23
- privacyPolicy: a(e.privacyPolicy),
24
- licenseInformation: a(e.licenseInformation)
20
+ personalInformationCollectionList: n(e.personalInformationCollectionList),
21
+ thirdPartyInformationSharingList: n(e.thirdPartyInformationSharingList),
22
+ userServiceAgreement: n(e.userServiceAgreement),
23
+ privacyPolicy: n(e.privacyPolicy),
24
+ licenseInformation: n(e.licenseInformation),
25
+ complaintReportingRules: n(e.complaintReportingRules)
25
26
  };
26
27
  }
27
- function f() {
28
- const e = t();
28
+ function g() {
29
+ const e = r();
29
30
  return {
30
31
  personalInformationCollectionList: e,
31
32
  thirdPartyInformationSharingList: e,
32
33
  userServiceAgreement: e,
33
34
  privacyPolicy: e,
34
- licenseInformation: e
35
+ licenseInformation: e,
36
+ complaintReportingRules: e
35
37
  };
36
38
  }
37
- const o = r({
39
+ const o = t({
38
40
  id: "",
39
41
  name: "",
40
42
  description: "",
@@ -82,7 +84,7 @@ const o = r({
82
84
  }
83
85
  },
84
86
  authorizationCallback: "",
85
- aboutUs: f(),
87
+ aboutUs: g(),
86
88
  brand: {
87
89
  theme: "dark",
88
90
  logo: "",
@@ -93,35 +95,40 @@ const o = r({
93
95
  backgroundImage: "/66a0d5b35203890887f0e1a4/6714e2458fe86895bf3da8ae/1ef8ed72-1731-6e00-93d1-fa24165f1a3e.webp"
94
96
  },
95
97
  socialLinks: []
96
- }), n = r(!1), i = r(!1);
97
- function g(e) {
98
- o.value.id = e.id, o.value.name = e.name, o.value.description = e.description, o.value.homePageUrl = e.homePageUrl, o.value.applicationLogo = e.applicationLogo, o.value.applicationLogoUrl = e.applicationLogoUrl, o.value.publicRoutes = e.publicRoutes || [], o.value.oauth = e.oauth, o.value.authMethods = e.authMethods || o.value.authMethods, o.value.signUpAuth = e.signUpAuth, o.value.registrationTerms = e.registrationTerms, o.value.authorizationCallback = e.authorizationCallback, o.value.aboutUs = p(e.aboutUs), o.value.brand = e.brand, o.value.socialLinks = Array.isArray(e.socialLinks) ? e.socialLinks : [];
98
+ }), a = t(!1), i = t(!1), l = t(!1);
99
+ function h(e) {
100
+ o.value.id = e.id, o.value.name = e.name, o.value.description = e.description, o.value.homePageUrl = e.homePageUrl, o.value.applicationLogo = e.applicationLogo, o.value.applicationLogoUrl = e.applicationLogoUrl, o.value.publicRoutes = e.publicRoutes || [], o.value.oauth = e.oauth, o.value.authMethods = e.authMethods || o.value.authMethods, o.value.signUpAuth = e.signUpAuth, o.value.inviteAccess = e.inviteAccess, o.value.accessMode = e.accessMode, o.value.signUpEnabled = e.signUpEnabled, o.value.inviteOnly = e.inviteOnly, o.value.registrationTerms = e.registrationTerms, o.value.authorizationCallback = e.authorizationCallback, o.value.aboutUs = f(e.aboutUs), o.value.brand = e.brand, o.value.socialLinks = Array.isArray(e.socialLinks) ? e.socialLinks : [];
99
101
  }
100
- async function h() {
101
- n.value = !0, i.value = !1;
102
+ async function m() {
103
+ a.value = !0, i.value = !1, l.value = !1;
102
104
  const {
103
105
  data: e,
104
- error: l
105
- } = await s().auth.apps.authPageInfo.post({
106
- clientKey: u().config.clientKey,
106
+ error: s
107
+ } = await u().auth.apps.authPageInfo.post({
108
+ clientKey: c().config.clientKey,
107
109
  meta: {
108
110
  silentError: !0
109
111
  }
110
112
  });
111
- n.value = !1, !(l || !e) && (g(e), i.value = !0);
113
+ if (a.value = !1, s || !e) {
114
+ l.value = !0;
115
+ return;
116
+ }
117
+ h(e), i.value = !0;
112
118
  }
113
- function v() {
119
+ function A() {
114
120
  async function e() {
115
- i.value || n.value || await h();
121
+ i.value || a.value || await m();
116
122
  }
117
123
  return {
118
124
  appsData: o,
119
125
  appsAuthPageInfoApi: e,
120
- appsAuthPageInfoLoading: n,
121
- appsAuthPageInfoSuccess: i
126
+ appsAuthPageInfoLoading: a,
127
+ appsAuthPageInfoSuccess: i,
128
+ appsAuthPageInfoFailed: l
122
129
  };
123
130
  }
124
131
  export {
125
- p as n,
126
- v as u
132
+ f as n,
133
+ A as u
127
134
  };
@@ -1,7 +1,7 @@
1
- import { ref as i, computed as h, nextTick as M, readonly as $ } from "vue";
2
- import { o as D, g as c, r as G, s as R } from "./apiClients-8_c5cDW5.js";
3
- import { u as K } from "./useAuthkitAppsAuthPageInfo-mv7hOnhi.js";
4
- const p = i(!1), g = i(!1);
1
+ import { ref as u, computed as m, nextTick as M, readonly as $ } from "vue";
2
+ import { o as D, g as f, r as G, s as R } from "./apiClients-5u4_uxFE.js";
3
+ import { u as K } from "./useAuthkitAppsAuthPageInfo-CsivtUQH.js";
4
+ const p = u(!1), g = u(!1);
5
5
  let I;
6
6
  const N = "请先阅读并同意用户协议与隐私政策", Y = {
7
7
  required: !1,
@@ -33,30 +33,30 @@ function z(e) {
33
33
  function H() {
34
34
  const {
35
35
  appsData: e
36
- } = K(), t = h(() => e.value.registrationTerms ?? Y), r = h(() => {
36
+ } = K(), t = m(() => e.value.registrationTerms ?? Y), r = m(() => {
37
37
  var n;
38
38
  return ((n = e.value.signUpAuth) == null ? void 0 : n.enabled) !== !1;
39
- }), o = h(() => r.value && !t.value.required);
40
- function l() {
39
+ }), o = m(() => r.value && !t.value.required);
40
+ function i() {
41
41
  return r.value && t.value.required;
42
42
  }
43
- function f() {
44
- return l();
43
+ function d() {
44
+ return i();
45
45
  }
46
46
  function T() {
47
47
  p.value = !1;
48
48
  }
49
49
  function v() {
50
- return !f() || p.value ? !0 : (y(), !1);
50
+ return !d() || p.value ? !0 : (y(), !1);
51
51
  }
52
52
  function S(n) {
53
53
  p.value = n;
54
54
  }
55
55
  function k(n) {
56
- const s = h(() => n === "signUp" ? l() : f()), d = h(() => z(() => s.value));
56
+ const s = m(() => n === "signUp" ? i() : d()), h = m(() => z(() => s.value));
57
57
  return {
58
58
  showTermsField: s,
59
- termsRules: d
59
+ termsRules: h
60
60
  };
61
61
  }
62
62
  return {
@@ -65,8 +65,8 @@ function H() {
65
65
  registrationTerms: t,
66
66
  signUpAuthEnabled: r,
67
67
  registrationBlocked: o,
68
- requiresAcceptanceForSignUp: l,
69
- requiresAcceptanceForOAuth: f,
68
+ requiresAcceptanceForSignUp: i,
69
+ requiresAcceptanceForOAuth: d,
70
70
  resetAcceptedTerms: T,
71
71
  shakeTerms: y,
72
72
  syncAcceptedTerms: S,
@@ -74,21 +74,21 @@ function H() {
74
74
  useTermsFormField: k
75
75
  };
76
76
  }
77
- const a = i("signIn"), j = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set(), u = i(null), V = "jwtToken";
77
+ const c = u("signIn"), j = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set(), a = u(null), V = "jwtToken";
78
78
  function O() {
79
79
  try {
80
80
  const e = localStorage.getItem(V);
81
81
  if (e)
82
- return u.value = e, !0;
82
+ return a.value = e, !0;
83
83
  } catch (e) {
84
84
  console.warn("Failed to access localStorage:", e);
85
85
  }
86
86
  return !1;
87
87
  }
88
88
  typeof window < "u" && O();
89
- let m = null;
89
+ let l = null;
90
90
  function J() {
91
- return m !== null;
91
+ return l !== null;
92
92
  }
93
93
  function Q(e) {
94
94
  e.searchParams.delete("loginCode"), window.history.replaceState({}, "", `${e.pathname}${e.search}${e.hash}`);
@@ -97,7 +97,7 @@ async function W(e) {
97
97
  const {
98
98
  data: t,
99
99
  error: r
100
- } = await c().auth.auth.oauth.session.exchange.post({
100
+ } = await f().auth.auth.oauth.session.exchange.post({
101
101
  code: e
102
102
  });
103
103
  if (r || !(t != null && t.jwtToken))
@@ -115,25 +115,30 @@ async function W(e) {
115
115
  }) : P(o.jwtToken), _(o), o;
116
116
  }
117
117
  async function q() {
118
- return m || (m = (async () => {
118
+ if (l)
119
+ return l;
120
+ const e = (async () => {
119
121
  try {
120
- const e = new URL(window.location.href), t = e.searchParams.get("loginCode");
121
- if (!t) return null;
122
- const r = await W(t);
123
- return Q(e), r;
124
- } catch (e) {
125
- return console.warn("Failed to handle OAuth callback:", e), null;
122
+ const r = new URL(window.location.href), o = r.searchParams.get("loginCode");
123
+ if (!o) return null;
124
+ const i = await W(o);
125
+ return i ? (Q(r), i) : null;
126
+ } catch (r) {
127
+ return console.warn("Failed to handle OAuth callback:", r), null;
126
128
  }
127
- })(), m);
129
+ })();
130
+ l = e;
131
+ const t = await e;
132
+ return !t && l === e && (l = null), t;
128
133
  }
129
134
  async function X() {
130
135
  return await q() ? !0 : O();
131
136
  }
132
137
  function x() {
133
- return u.value || O() ? u.value : null;
138
+ return a.value || O() ? a.value : null;
134
139
  }
135
140
  function P(e) {
136
- u.value = e;
141
+ a.value = e;
137
142
  try {
138
143
  localStorage.setItem(V, e);
139
144
  } catch (t) {
@@ -147,7 +152,7 @@ function A(e) {
147
152
  }) : P(e.jwtToken), _(e);
148
153
  }
149
154
  function Z() {
150
- u.value = null, re();
155
+ a.value = null, re();
151
156
  }
152
157
  D(Z);
153
158
  function U() {
@@ -158,7 +163,7 @@ async function ee() {
158
163
  return U(), !0;
159
164
  const {
160
165
  error: e
161
- } = await c().auth.auth.signOut.post();
166
+ } = await f().auth.auth.signOut.post();
162
167
  return U(), !e;
163
168
  }
164
169
  function w(e, t) {
@@ -193,42 +198,42 @@ function ue(e) {
193
198
  return w(b, e);
194
199
  }
195
200
  function fe() {
196
- const e = i(!1), t = i(!1), r = i(!1);
201
+ const e = u(!1), t = u(!1), r = u(!1);
197
202
  async function o(n) {
198
203
  e.value = !0;
199
204
  const {
200
205
  data: s,
201
- error: d
202
- } = await c().auth.auth.signIn.unified.post({
206
+ error: h
207
+ } = await f().auth.auth.signIn.unified.post({
203
208
  identifier: n.identifier || n.email || "",
204
209
  password: n.password,
205
210
  code: n.code,
206
211
  emailVerifyId: n.emailVerifyId,
207
212
  method: n.method || "password"
208
213
  });
209
- if (e.value = !1, d || !s)
214
+ if (e.value = !1, h || !s)
210
215
  return;
211
216
  A(s);
212
217
  }
213
- function l(n) {
218
+ function i(n) {
214
219
  A(n);
215
220
  }
216
- async function f(n) {
221
+ async function d(n) {
217
222
  const {
218
223
  resetAcceptedTerms: s,
219
- acceptedTerms: d,
224
+ acceptedTerms: h,
220
225
  requiresAcceptanceForSignUp: C
221
226
  } = H();
222
227
  t.value = !0;
223
- const L = C() ? d.value : void 0, {
228
+ const L = C() ? h.value : void 0, {
224
229
  error: B
225
- } = n.type === "phone" ? await c().auth.auth.signUp.phone.post({
230
+ } = n.type === "phone" ? await f().auth.auth.signUp.phone.post({
226
231
  phone: n.phone || "",
227
232
  code: n.code || "",
228
233
  password: n.password,
229
234
  inviteCode: n.inviteCode,
230
235
  acceptedTerms: L === !0
231
- }) : await c().auth.auth.signUp.post({
236
+ }) : await f().auth.auth.signUp.post({
232
237
  email: n.email || "",
233
238
  userToken: n.userToken || "",
234
239
  emailVerifyId: n.emailVerifyId || "",
@@ -236,13 +241,13 @@ function fe() {
236
241
  inviteCode: n.inviteCode,
237
242
  acceptedTerms: L === !0
238
243
  });
239
- t.value = !1, !B && (s(), a.value = "signIn", ne());
244
+ t.value = !1, !B && (s(), c.value = "signIn", ne());
240
245
  }
241
246
  async function T(n) {
242
247
  r.value = !0;
243
248
  const {
244
249
  error: s
245
- } = await c().auth.auth.resetPassword.post({
250
+ } = await f().auth.auth.resetPassword.post({
246
251
  method: n.method || "email",
247
252
  email: n.email,
248
253
  phone: n.phone,
@@ -251,23 +256,23 @@ function fe() {
251
256
  emailVerifyId: n.emailVerifyId,
252
257
  password: n.password
253
258
  });
254
- r.value = !1, !s && (a.value = "signIn", te());
259
+ r.value = !1, !s && (c.value = "signIn", te());
255
260
  }
256
261
  function v() {
257
- a.value = "signUp";
262
+ c.value = "signUp";
258
263
  }
259
264
  function S() {
260
- a.value = "resetPassword";
265
+ c.value = "resetPassword";
261
266
  }
262
267
  function k() {
263
- a.value = "signIn";
268
+ c.value = "signIn";
264
269
  }
265
270
  return {
266
271
  signInSubmit: o,
267
- passkeySignInSubmit: l,
268
- signUpSubmit: f,
272
+ passkeySignInSubmit: i,
273
+ signUpSubmit: d,
269
274
  resetPasswordSubmit: T,
270
- currentView: a,
275
+ currentView: c,
271
276
  authSignInLoading: e,
272
277
  authSignUpLoading: t,
273
278
  resetPasswordLoading: r,
@@ -278,7 +283,7 @@ function fe() {
278
283
  onSignUp: se,
279
284
  onResetPassword: ie,
280
285
  onSignOut: ue,
281
- jwtToken: $(u),
286
+ jwtToken: $(a),
282
287
  getToken: x,
283
288
  setToken: P,
284
289
  completeSignIn: A,
@@ -0,0 +1,24 @@
1
+ import "./apiClients-5u4_uxFE.js";
2
+ import { Message as r } from "@arco-design/web-vue";
3
+ import { ref as e } from "vue";
4
+ function d(n) {
5
+ const o = e(!1), a = e(), s = e(!1), c = e(""), t = e("");
6
+ function f(u) {
7
+ r.success(u), s.value = !1, o.value = !1, n("confirm");
8
+ }
9
+ function l() {
10
+ s.value = !1, n("cancel");
11
+ }
12
+ return {
13
+ loading: o,
14
+ formRef: a,
15
+ submitSuccess: f,
16
+ modelType: c,
17
+ changeType: t,
18
+ show: s,
19
+ handleCancel: l
20
+ };
21
+ }
22
+ export {
23
+ d as u
24
+ };