@huyooo/ui 1.0.3 → 1.0.5

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 (188) hide show
  1. package/dist/AuthkitAppSetting-BN8-xgNq.js +2674 -0
  2. package/dist/{Contact-M6iyuyNL.js → Contact-BWuVR9ho.js} +105 -113
  3. package/dist/CustomTable-BzGfaAVH.js +276 -0
  4. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-B9BqGWm8.js +1480 -0
  5. package/dist/LandingPageDescription-BczWZHKy.js +12 -0
  6. package/dist/{LandingPageLinkGroup-DDNRivMt.js → LandingPageLinkGroup-BZJ48Yss.js} +87 -88
  7. package/dist/{LandingPageFAQ-CZJXvor9.js → LandingPageSectionHeader-3hiuw6G0.js} +44 -25
  8. package/dist/{LandingPageSectionTabs-Ce3_Rc2L.js → LandingPageSectionTabs-jRjkWlM-.js} +475 -375
  9. package/dist/LegalDocViewer-DM8FYBpf.js +2501 -0
  10. package/dist/Menu-uCexrsKP.js +199 -0
  11. package/dist/MessageHandle-mEkCsv9e.js +1173 -0
  12. package/dist/MessageList-Ce-_LNTk.js +244 -0
  13. package/dist/PaySubscriptions-CXkEjqr2.js +1326 -0
  14. package/dist/PricingPlans-CV97ck9p.js +427 -0
  15. package/dist/ReferrerReferees-DgygiIiE.js +237 -0
  16. package/dist/{Upload.vue_vue_type_script_setup_true_lang-B6NOZjK0.js → Upload.vue_vue_type_script_setup_true_lang-VGh2V4o0.js} +1 -1
  17. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-zgjpFVln.js +592 -0
  18. package/dist/WidthContainer-PeWkCK0p.js +721 -0
  19. package/dist/{apiClients-DrGX2iJy.js → apiClients-BcXOLuYu.js} +131 -98
  20. package/dist/authkit.d.ts +6 -2
  21. package/dist/authkit.js +53 -44
  22. package/dist/common/authProviderIcons.d.ts +12 -0
  23. package/dist/common/globalConfig.d.ts +5 -0
  24. package/dist/common/tableColumnWidths.d.ts +11 -0
  25. package/dist/common.js +3 -3
  26. package/dist/components/AuthProviderIcon.vue.d.ts +12 -0
  27. package/dist/components/Authkit/AppSetting/AuthkitEmailVerify.vue.d.ts +2 -2
  28. package/dist/components/Authkit/AppSetting/AuthkitOAuthBinding.vue.d.ts +2 -1
  29. package/dist/components/Authkit/AppSetting/AuthkitPasskeyBinding.vue.d.ts +14 -0
  30. package/dist/components/Authkit/AppSetting/AuthkitPasswordUpdate.vue.d.ts +11 -1
  31. package/dist/components/Authkit/AppSetting/AuthkitPersonalInformation.vue.d.ts +1 -3
  32. package/dist/components/Authkit/AppSetting/AuthkitPhoneVerify.vue.d.ts +13 -3
  33. package/dist/components/Authkit/Auth/AuthkitBindEmail.vue.d.ts +29 -2
  34. package/dist/components/Authkit/Auth/AuthkitBindPhone.vue.d.ts +2 -2
  35. package/dist/components/Authkit/Auth/AuthkitEmailUpdate.vue.d.ts +2 -2
  36. package/dist/components/Authkit/Auth/AuthkitOauthItem.vue.d.ts +37 -9
  37. package/dist/components/Authkit/Auth/AuthkitOauthList.vue.d.ts +7 -11
  38. package/dist/components/Authkit/Auth/AuthkitPasswordUpdateAndVerify.vue.d.ts +2 -2
  39. package/dist/components/Authkit/Auth/AuthkitPhonePasswordUpdateAndVerify.vue.d.ts +2 -2
  40. package/dist/components/Authkit/Auth/AuthkitServiceAgreementAndPrivacyProtection.vue.d.ts +11 -7
  41. package/dist/components/Authkit/Auth/AuthkitSignInEmailCode.vue.d.ts +2 -2
  42. package/dist/components/Authkit/Auth/AuthkitSignInPhone.vue.d.ts +3 -62
  43. package/dist/components/Authkit/Auth/AuthkitSignUpPhone.vue.d.ts +2 -2
  44. package/dist/components/Authkit/Auth/AuthkitSwitchSignUpOrResetPassword.vue.d.ts +9 -0
  45. package/dist/components/Authkit/AuthkitAuth.vue.d.ts +2 -8
  46. package/dist/components/Authkit/AuthkitAuthModal.vue.d.ts +0 -4
  47. package/dist/components/Authkit/AuthkitProvider.vue.d.ts +5 -2
  48. package/dist/components/Authkit/AuthkitSendVerifyCode.vue.d.ts +2 -1
  49. package/dist/components/CustomTable.vue.d.ts +27 -1
  50. package/dist/components/Ellipsis.vue.d.ts +2 -6
  51. package/dist/components/Feedback/FeedbackList.vue.d.ts +4 -1
  52. package/dist/components/Gradientbackground.vue.d.ts +2 -2
  53. package/dist/components/HeaderMenus.vue.d.ts +4 -1
  54. package/dist/components/InfiniteLoading.vue.d.ts +1 -1
  55. package/dist/components/LandingPage/LandingPageButton.vue.d.ts +2 -2
  56. package/dist/components/LandingPage/LandingPageContainer.vue.d.ts +2 -2
  57. package/dist/components/LandingPage/LandingPageFeaturePanels.vue.d.ts +19 -0
  58. package/dist/components/LandingPage/LandingPageHero.vue.d.ts +9 -0
  59. package/dist/components/LandingPage/LandingPagePageContent.vue.d.ts +2 -2
  60. package/dist/components/LandingPage/LandingPageSectionHeader.vue.d.ts +1 -14
  61. package/dist/components/LandingPage/LandingPageSections.vue.d.ts +1 -1
  62. package/dist/components/LegalDoc/LegalDocViewer.vue.d.ts +7 -0
  63. package/dist/components/Menu.vue.d.ts +2 -1
  64. package/dist/components/MenuItem.vue.d.ts +3 -1
  65. package/dist/components/Message/MessageAppMessage.vue.d.ts +12 -2
  66. package/dist/components/Message/MessageDetails.vue.d.ts +9 -161
  67. package/dist/components/Message/MessageHandle.vue.d.ts +16 -4
  68. package/dist/components/Message/MessageList.vue.d.ts +4 -3
  69. package/dist/components/Message/MessageNotificationDetails.vue.d.ts +13 -0
  70. package/dist/components/Message/messageBody/DescriptionsMessageBody.vue.d.ts +3 -0
  71. package/dist/components/Message/messageBody/JsonMessageBodyFallback.vue.d.ts +3 -0
  72. package/dist/components/Message/messageBody/TextMessageBody.vue.d.ts +3 -0
  73. package/dist/components/Message/messageBody/descriptionRows.d.ts +14 -0
  74. package/dist/components/Message/messageBody/descriptionsMessageBody.d.ts +32 -0
  75. package/dist/components/Message/messageBody/descriptionsValueRender.d.ts +4 -0
  76. package/dist/components/Message/messageBody/messageBodyRegistry.d.ts +9 -0
  77. package/dist/components/Message/messageBody/registerBuiltinMessageBodies.d.ts +2 -0
  78. package/dist/components/Message/messageBody/types.d.ts +7 -0
  79. package/dist/components/Referrer/ReferrerRefereeCell.vue.d.ts +7 -0
  80. package/dist/components/Referrer/ReferrerReferees.vue.d.ts +1 -0
  81. package/dist/components/UserMenu/UserAccountMenu.vue.d.ts +1 -16
  82. package/dist/components/UserMenu/UserMenuItem.vue.d.ts +4 -0
  83. package/dist/components/UserMenu/UserMenuModals.vue.d.ts +18 -4
  84. package/dist/components/UserMenu/parts/UserAvatar.vue.d.ts +6 -0
  85. package/dist/components/UserMenu/parts/UserBasicInformation.vue.d.ts +7 -2
  86. package/dist/composables/Authkit/fetchAuthPageAboutUs.d.ts +3 -0
  87. package/dist/composables/Authkit/resolveRoutePermission.d.ts +2 -0
  88. package/dist/composables/Authkit/useAuthkitAppsAuthPageInfo.d.ts +16 -0
  89. package/dist/composables/Authkit/useAuthkitAuth.d.ts +2 -0
  90. package/dist/composables/Authkit/useAuthkitPasskey.d.ts +10 -0
  91. package/dist/composables/Authkit/useLegalDocHostActions.d.ts +6 -0
  92. package/dist/composables/Authkit/useLegalDocs.d.ts +19 -0
  93. package/dist/composables/Authkit/useOauth.d.ts +17 -4
  94. package/dist/composables/Authkit/useRegistrationTerms.d.ts +24 -0
  95. package/dist/composables/Authkit/verifyCodeCooldown.d.ts +19 -0
  96. package/dist/composables/Billing/useBillingPlans.d.ts +0 -4
  97. package/dist/composables/Billing/useBillingStatusOptions.d.ts +2 -6
  98. package/dist/composables/Billing/useBillingSubscriptionSummary.d.ts +16 -0
  99. package/dist/composables/Billing/usePaidProductOptions.d.ts +5 -0
  100. package/dist/composables/Message/messageCenterBadgeCounts.d.ts +28 -0
  101. package/dist/composables/UserMenu/useUserMenuBadgeCounts.d.ts +9 -0
  102. package/dist/composables/useInfiniteList.d.ts +19 -0
  103. package/dist/composables/useMessageNotifications.d.ts +3 -6
  104. package/dist/composables.d.ts +4 -2
  105. package/dist/composables.js +50 -45
  106. package/dist/feedback.d.ts +1 -0
  107. package/dist/feedback.js +12 -11
  108. package/dist/fetchAuthPageAboutUs-dzTSwRsB.js +25 -0
  109. package/dist/{Clipboard-Bo7gdpR6.js → index-BkLvw1PU.js} +1 -1
  110. package/dist/landingPage.d.ts +1 -0
  111. package/dist/landingPage.js +41 -40
  112. package/dist/legalDocs/buildBuiltinUrl.d.ts +3 -0
  113. package/dist/{utils/legalLinks.d.ts → legalDocs/constants.d.ts} +0 -10
  114. package/dist/legalDocs/index.d.ts +7 -0
  115. package/dist/legalDocs/isConfigured.d.ts +7 -0
  116. package/dist/legalDocs/open.d.ts +3 -0
  117. package/dist/legalDocs/resolveAppId.d.ts +8 -0
  118. package/dist/legalDocs/resolveTarget.d.ts +4 -0
  119. package/dist/legalDocs/types.d.ts +12 -0
  120. package/dist/main.js +321 -308
  121. package/dist/message.d.ts +3 -0
  122. package/dist/message.js +301 -21
  123. package/dist/pay.d.ts +1 -1
  124. package/dist/pay.js +14 -17
  125. package/dist/privateCom.js +1 -1
  126. package/dist/referrer.js +1 -1
  127. package/dist/style.css +1 -1
  128. package/dist/types/api/auth.generated.d.ts +1385 -328
  129. package/dist/types/api/billing.generated.d.ts +907 -76
  130. package/dist/types/api/ones.generated.d.ts +131 -2
  131. package/dist/types/api.d.ts +1 -0
  132. package/dist/types/app.d.ts +10 -0
  133. package/dist/types/user.d.ts +1 -0
  134. package/dist/upload.js +2 -2
  135. package/dist/{useAuthkitAppsAuthPageInfo-C2yKgl8t.js → useAuthkitAppsAuthPageInfo-CNudJd04.js} +18 -17
  136. package/dist/useAuthkitAuth-3m0yW6uP.js +267 -0
  137. package/dist/{useAuthkitCreateAndUpdate-oo9517Gj.js → useAuthkitCreateAndUpdate-BsINsI-E.js} +1 -1
  138. package/dist/{useAuthkitUsersProfile-BZDk21c8.js → useAuthkitUsersProfile-DJlMsftY.js} +3 -3
  139. package/dist/useBillingStatusOptions-CfHQOFNw.js +71 -0
  140. package/dist/{useEnsureAuthenticated-BuIbxqsO.js → useEnsureAuthenticated-DNkCCy_Y.js} +2 -2
  141. package/dist/useLegalDocs-DQP_Yq6B.js +106 -0
  142. package/dist/{useMessageNotifications-D85_-mDq.js → useMessageNotifications-CAphguOm.js} +21 -24
  143. package/dist/useRoutePermission-CEiya9AM.js +218 -0
  144. package/dist/useSEO-CDWxbk8B.js +221 -0
  145. package/dist/useSubscriptionCheckout-d_M_rKRa.js +368 -0
  146. package/dist/{useUploadCos-BRKRzSy3.js → useUploadCos-C8BqFPkx.js} +1 -1
  147. package/dist/user.js +1 -1
  148. package/dist/userMenuModal-D-nDaYqM.js +66 -0
  149. package/dist/utils/apiMiddlewares.d.ts +5 -5
  150. package/dist/utils/apiResponse.d.ts +11 -0
  151. package/dist/utils/authProviderIcon.d.ts +3 -0
  152. package/dist/utils/authkit.d.ts +20 -7
  153. package/dist/utils/formatPoints.d.ts +8 -0
  154. package/dist/utils/messageNotificationContent.d.ts +4 -0
  155. package/dist/utils/messageTextLink.d.ts +9 -0
  156. package/dist/utils/passkeySupport.d.ts +8 -0
  157. package/dist/utils/pointsFlowTypes.d.ts +10 -0
  158. package/dist/utils/pointsHistoryDisplay.d.ts +8 -0
  159. package/dist/utils/refundStatusDisplay.d.ts +1 -0
  160. package/dist/utils/subscriptionDisplay.d.ts +7 -0
  161. package/dist/utils/userDisplay.d.ts +41 -0
  162. package/package.json +11 -3
  163. package/dist/AuthkitAppSetting-C-0uuLSg.js +0 -1921
  164. package/dist/AuthkitGithubBinding-C5zEy9zN.js +0 -2207
  165. package/dist/CustomTable-nsxN4Ja4.js +0 -276
  166. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-M1NQ-rx-.js +0 -1396
  167. package/dist/LandingPageSectionHeader-D_74W4My.js +0 -69
  168. package/dist/Menu-Cy2ZPeaz.js +0 -170
  169. package/dist/MessageHandle-BG12aX0i.js +0 -924
  170. package/dist/MessageList-CrCF8mU6.js +0 -233
  171. package/dist/MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-gsjL6yAe.js +0 -142
  172. package/dist/PaySubscriptions-lWnEioX5.js +0 -1241
  173. package/dist/PricingPlans-DFcjOMWS.js +0 -404
  174. package/dist/ReferrerReferees-Cn7KaO8z.js +0 -106
  175. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-P0X1Exyu.js +0 -520
  176. package/dist/WidthContainer-CF3qOLWW.js +0 -688
  177. package/dist/common/authPanelWidth.d.ts +0 -2
  178. package/dist/components/Feedback/FeedbackDetails.vue.d.ts +0 -178
  179. package/dist/composables/Authkit/useLegalLinks.d.ts +0 -34
  180. package/dist/index-D3Kp6R4z.js +0 -4
  181. package/dist/useAuthkitAuth-DmS-H7M2.js +0 -175
  182. package/dist/useBillingStatusOptions-B7xLU3fs.js +0 -145
  183. package/dist/useLegalLinks-Cwr45PBT.js +0 -60
  184. package/dist/useRoutePermission-CaWtjLRA.js +0 -212
  185. package/dist/useSEO-BSMQdBR9.js +0 -158
  186. package/dist/useSubscriptionCheckout-BRk5h9aC.js +0 -365
  187. package/dist/useTableHandle-BdujaiNX.js +0 -69
  188. /package/dist/components/{Feedback/FeedbackVideoPreview.vue.d.ts → VideoPreview.vue.d.ts} +0 -0
@@ -1,365 +0,0 @@
1
- import { ref as y, computed as L } from "vue";
2
- import { d as H } from "./useBillingStatusOptions-B7xLU3fs.js";
3
- import { h as $ } from "./apiClients-DrGX2iJy.js";
4
- /* empty css */
5
- import { Message as g } from "@arco-design/web-vue";
6
- import { u as J } from "./useEnsureAuthenticated-BuIbxqsO.js";
7
- function M(e) {
8
- var i;
9
- const r = (i = e == null ? void 0 : e.metadata) == null ? void 0 : i.originalPrice;
10
- return typeof r == "number" ? r : void 0;
11
- }
12
- function N(e) {
13
- const r = M(e);
14
- return !e || r === void 0 || r <= e.unitAmount ? 0 : Math.round((1 - e.unitAmount / r) * 100);
15
- }
16
- function W(e) {
17
- var l, f;
18
- const r = (l = e == null ? void 0 : e.metadata) == null ? void 0 : l.discountLabel;
19
- if (typeof r == "string" && r.trim())
20
- return r;
21
- const i = (f = e == null ? void 0 : e.metadata) == null ? void 0 : f.savingMonths;
22
- return typeof i == "number" && i > 0 ? `买 ${12 - i} 个月送 ${i} 个月` : "";
23
- }
24
- function q(e) {
25
- return e === void 0 ? 0 : Math.floor(e / 100);
26
- }
27
- function X(e, r = 1) {
28
- const i = r > 1 ? `每 ${r} ` : "按";
29
- switch (e) {
30
- case "month":
31
- return `${i}月订阅`;
32
- case "year":
33
- return `${i}年订阅`;
34
- case "day":
35
- return `${i}天订阅`;
36
- case "week":
37
- return `${i}周订阅`;
38
- default:
39
- return "";
40
- }
41
- }
42
- function Y(e) {
43
- const r = e != null && e.intervalCount && e.intervalCount > 1 ? `${e.intervalCount} ` : "";
44
- switch (e == null ? void 0 : e.interval) {
45
- case "month":
46
- return `/ ${r}月`;
47
- case "year":
48
- return `/ ${r}年`;
49
- case "day":
50
- return `/ ${r}天`;
51
- case "week":
52
- return `/ ${r}周`;
53
- default:
54
- return "";
55
- }
56
- }
57
- function I(e) {
58
- switch (e) {
59
- case "day":
60
- return "每天";
61
- case "week":
62
- return "每周";
63
- case "month":
64
- return "每月";
65
- case "year":
66
- return "每年";
67
- case "lifetime":
68
- return "不重置";
69
- default:
70
- return "";
71
- }
72
- }
73
- function S(e) {
74
- if (e.type === "quota" && e.value !== void 0) {
75
- const r = I(e.quotaPeriod), i = r ? ` / ${r}` : "";
76
- return `${e.name}: ${e.value === -1 ? "无限" : e.value}${i}`;
77
- }
78
- if (e.type === "unlimited") {
79
- const r = I(e.quotaPeriod);
80
- return r ? `${e.name}: 不限 / ${r}` : `${e.name}不限`;
81
- }
82
- return e.type === "boolean" && e.value === !1 ? `${e.name}(不支持)` : e.name;
83
- }
84
- function w(e) {
85
- return e.type !== "recurring" || !e.interval ? null : {
86
- key: `${e.interval}:${e.intervalCount ?? 1}`,
87
- interval: e.interval,
88
- intervalCount: e.intervalCount ?? 1
89
- };
90
- }
91
- function Z(e, r) {
92
- const i = {
93
- day: 1,
94
- week: 2,
95
- month: 3,
96
- year: 4
97
- };
98
- return i[e.interval] - i[r.interval] || e.intervalCount - r.intervalCount;
99
- }
100
- function ee(e, r) {
101
- let i = 0;
102
- for (const l of e)
103
- for (const f of l.prices) {
104
- const s = w(f);
105
- (s == null ? void 0 : s.key) === r && (i = Math.max(i, N(f)));
106
- }
107
- return i > 0 ? `省 ${i}%` : void 0;
108
- }
109
- function te(e) {
110
- return e.includes(":") ? e : `${e}:1`;
111
- }
112
- function B() {
113
- return !!localStorage.getItem("jwtToken");
114
- }
115
- function fe(e = "month") {
116
- const r = y([]), i = y(null), l = y(null), f = y(!1), s = y(!1), d = y(te(e)), a = L(() => {
117
- const t = /* @__PURE__ */ new Map();
118
- for (const n of r.value)
119
- for (const u of n.prices) {
120
- const c = w(u);
121
- c && t.set(c.key, c);
122
- }
123
- return [...t.values()].sort(Z).map((n) => ({
124
- value: n.key,
125
- label: X(n.interval, n.intervalCount),
126
- badge: ee(r.value, n.key)
127
- }));
128
- }), p = L(() => {
129
- const t = [];
130
- for (const n of r.value) {
131
- const u = n.prices.find((o) => {
132
- const h = w(o);
133
- return (h == null ? void 0 : h.key) === d.value;
134
- }), c = n.prices.find((o) => o.type === "free"), m = u ?? (c && n.prices.every((o) => o.type === "free") ? c : void 0);
135
- m && t.push({
136
- ...n,
137
- features: m.features ?? [],
138
- selectedPrice: m
139
- });
140
- }
141
- return t;
142
- });
143
- function x(t) {
144
- d.value = t;
145
- }
146
- function P(t) {
147
- const n = i.value, u = l.value;
148
- return n != null && n.priceId && t.selectedPrice ? n.priceId === t.selectedPrice.id : n ? n.productId === t.id : u != null && u.priceId && t.selectedPrice ? u.priceId === t.selectedPrice.id : u ? u.productId === t.id : !1;
149
- }
150
- function C(t) {
151
- var n;
152
- return ((n = i.value) == null ? void 0 : n.productId) === t.id;
153
- }
154
- function v(t) {
155
- var n;
156
- return ((n = t.selectedPrice) == null ? void 0 : n.type) === "free";
157
- }
158
- function F() {
159
- return !!i.value;
160
- }
161
- function U(t) {
162
- return !!(!t.selectedPrice || P(t) || v(t) && F());
163
- }
164
- function b(t) {
165
- var n;
166
- return ((n = t.metadata) == null ? void 0 : n.recommended) === !0;
167
- }
168
- function T(t) {
169
- var n;
170
- return q((n = t.selectedPrice) == null ? void 0 : n.unitAmount);
171
- }
172
- function j(t) {
173
- const n = M(t.selectedPrice);
174
- return n === void 0 ? void 0 : q(n);
175
- }
176
- function G(t) {
177
- return v(t) ? "" : Y(t.selectedPrice);
178
- }
179
- function O(t) {
180
- var n;
181
- if (v(t)) {
182
- const u = (n = t.selectedPrice) == null ? void 0 : n.trialPeriodDays;
183
- return u ? `${u} 天免费体验` : "免费体验";
184
- }
185
- return W(t.selectedPrice);
186
- }
187
- function R(t) {
188
- return P(t) ? "当前方案" : b(t) ? "最受欢迎" : "";
189
- }
190
- function E(t) {
191
- const n = [];
192
- return P(t) ? n.push({
193
- label: "当前方案",
194
- type: "current"
195
- }) : v(t) ? n.push({
196
- label: "免费体验",
197
- type: "trial"
198
- }) : b(t) && n.push({
199
- label: "最受欢迎",
200
- type: "recommended"
201
- }), n;
202
- }
203
- function K(t) {
204
- const n = i.value;
205
- return P(t) ? "当前方案" : v(t) ? n ? "已订阅付费方案" : B() ? "免费开通" : "免费注册" : n ? C(t) ? "切换周期" : typeof n.unitAmount == "number" && t.selectedPrice.unitAmount > n.unitAmount ? "升级方案" : "切换方案" : "立即订阅";
206
- }
207
- function Q(t, n) {
208
- const u = t.features.find((c) => c.type === "quota" && c.value !== void 0);
209
- if (u) {
210
- const c = I(u.quotaPeriod), m = u.value === -1 ? "不限量" : u.value;
211
- return `${u.name} ${c ? `${m} / ${c}` : m},覆盖核心使用场景。`;
212
- }
213
- return v(t) ? "注册后自动开通免费权益,适合先体验核心能力。" : n === 1 ? "为正式团队准备的高配能力组合。" : "包含入门所需的核心能力。";
214
- }
215
- function V(t) {
216
- return t.filter((n) => n.highlight !== !1).map((n) => ({
217
- title: S(n),
218
- description: n.description || ""
219
- }));
220
- }
221
- function _(t) {
222
- const n = t.filter((o) => o.highlight !== !1), u = n.filter((o) => o.type === "quota" || o.type === "unlimited").map((o) => ({
223
- title: S(o),
224
- description: o.description || ""
225
- })), c = n.filter((o) => o.type === "boolean" && o.value !== !1).map((o) => ({
226
- title: o.name,
227
- description: o.description || ""
228
- })), m = [];
229
- return c.length && m.push({
230
- title: "功能特性",
231
- items: c
232
- }), u.length && m.push({
233
- title: "用量配额",
234
- items: u
235
- }), m;
236
- }
237
- async function k() {
238
- f.value = !0;
239
- try {
240
- const t = await H.productOptions();
241
- r.value = Array.isArray(t) ? t : [], !a.value.some((u) => u.value === d.value) && a.value[0] && (d.value = a.value[0].value);
242
- } finally {
243
- f.value = !1;
244
- }
245
- }
246
- async function A() {
247
- if (!B()) {
248
- i.value = null, l.value = null;
249
- return;
250
- }
251
- s.value = !0;
252
- try {
253
- const {
254
- data: t,
255
- error: n
256
- } = await $.subscriptions.summary.post();
257
- if (n) {
258
- console.error("加载当前订阅失败", n);
259
- return;
260
- }
261
- i.value = (t == null ? void 0 : t.current) ?? null, l.value = (t == null ? void 0 : t.trial) ?? null;
262
- } finally {
263
- s.value = !1;
264
- }
265
- }
266
- async function z() {
267
- await Promise.all([k(), A()]);
268
- }
269
- return {
270
- products: r,
271
- plans: p,
272
- currentSubscription: i,
273
- currentTrial: l,
274
- listLoading: f,
275
- currentLoading: s,
276
- billingInterval: d,
277
- billingIntervalTabs: a,
278
- setBillingInterval: x,
279
- isCurrentPlan: P,
280
- isSameProduct: C,
281
- isRecommendedPlan: b,
282
- isFreePlan: v,
283
- isPlanActionDisabled: U,
284
- getDisplayPrice: T,
285
- getDisplayOriginalPrice: j,
286
- getDisplayCycle: G,
287
- getPromotionLabel: O,
288
- getBadgeLabel: R,
289
- getBadgeLabels: E,
290
- getButtonLabel: K,
291
- getPlanSummary: Q,
292
- getFeatureItems: V,
293
- getFeatureGroups: _,
294
- loadProducts: k,
295
- loadCurrentSubscription: A,
296
- refresh: z
297
- };
298
- }
299
- function ne(e) {
300
- window.open(e, "_blank", "noopener,noreferrer");
301
- }
302
- function D(e) {
303
- return e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "";
304
- }
305
- function re(e) {
306
- return e && typeof e == "object" && "alipayUrl" in e && typeof e.alipayUrl == "string" ? e.alipayUrl : "";
307
- }
308
- function ie(e) {
309
- return e && typeof e == "object" && "status" in e && e.status === "trialing";
310
- }
311
- function de(e) {
312
- const r = y(null), {
313
- ensureAuthenticated: i
314
- } = J();
315
- async function l(s) {
316
- if (!s.selectedPrice) {
317
- g.warning("当前方案暂无可购买价格");
318
- return;
319
- }
320
- if (!i(() => l(s))) return;
321
- const d = e.currentSubscription.value;
322
- if ((d == null ? void 0 : d.priceId) === s.selectedPrice.id) {
323
- g.info("当前已经是该方案");
324
- return;
325
- }
326
- r.value = s.id;
327
- try {
328
- if (s.selectedPrice.type === "free")
329
- return;
330
- const a = d ? await $.subscriptions.change.post({
331
- subscriptionId: d.id,
332
- newPriceId: s.selectedPrice.id,
333
- proration: !0
334
- }) : await $.subscriptions.create.post({
335
- priceId: s.selectedPrice.id
336
- });
337
- if (a.error) {
338
- g.error(a.error.message || "订阅操作失败");
339
- return;
340
- }
341
- const p = re(a.data);
342
- if (p) {
343
- ne(p);
344
- return;
345
- }
346
- ie(a.data) ? g.success(D(a.data) || "试用已开始") : g.success(D(a.data) || "订阅已更新"), await e.refreshCurrentSubscription();
347
- } catch (a) {
348
- console.error("订阅操作失败", a), g.error("订阅操作失败,请稍后重试");
349
- } finally {
350
- r.value = null;
351
- }
352
- }
353
- function f(s) {
354
- return r.value === s.id;
355
- }
356
- return {
357
- checkoutPlanId: r,
358
- checkout: l,
359
- isCheckingOut: f
360
- };
361
- }
362
- export {
363
- de as a,
364
- fe as u
365
- };
@@ -1,69 +0,0 @@
1
- /* empty css */
2
- import "./apiClients-DrGX2iJy.js";
3
- import { Message as O } from "@arco-design/web-vue";
4
- import { ref as t } from "vue";
5
- function A(r) {
6
- const f = t(r), p = t(!1), u = t(!1), a = t({
7
- total: 0,
8
- current: 1,
9
- pageSize: 10,
10
- showTotal: !0,
11
- showPageSize: !0
12
- }), m = t([]), o = t(), i = t(Symbol("key")), l = t(), s = t(Symbol("key")), n = t(), c = t(Symbol("key"));
13
- function v(e) {
14
- o.value.setData(e, !0, "edit");
15
- }
16
- function y(e) {
17
- n.value.setData(e, !0, "view");
18
- }
19
- function g() {
20
- o.value.setData(null, !0, "create");
21
- }
22
- const d = (e, C) => {
23
- a.value.current = e, a.value.pageSize = C;
24
- };
25
- function S() {
26
- i.value = Symbol("key");
27
- }
28
- function D() {
29
- s.value = Symbol("key");
30
- }
31
- function b(e) {
32
- l.value.setData(e, !0);
33
- }
34
- function k() {
35
- c.value = Symbol("key");
36
- }
37
- function L(e) {
38
- n.value.setData(e, !0);
39
- }
40
- function w(e) {
41
- O.success(e), u.value = !1;
42
- }
43
- return {
44
- CreateAndUpdateRef: o,
45
- CreateAndUpdateKey: i,
46
- OperationLogRef: l,
47
- OperationLogKey: s,
48
- DetailsRef: n,
49
- DetailsKey: c,
50
- pagination: a,
51
- title: f,
52
- edit: v,
53
- create: g,
54
- view: y,
55
- dataSource: m,
56
- setPage: d,
57
- cancel: S,
58
- OperationLogCancel: D,
59
- openOperationLog: b,
60
- DetailsCancel: k,
61
- openDetails: L,
62
- loading: p,
63
- submitRemove: w,
64
- removeLoading: u
65
- };
66
- }
67
- export {
68
- A as u
69
- };