@funhub/platform 0.2.4-beta.3 → 0.2.4

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 (216) hide show
  1. package/dist/assets/icons/channel-list/channel-active-indicator.mjs +2 -0
  2. package/dist/assets/icons/common/header-menu.mjs +2 -0
  3. package/dist/assets/icons/common/header-search-icon.mjs +2 -0
  4. package/dist/assets/icons/common/right_arrow_thin.mjs +2 -0
  5. package/dist/assets/icons/eye-off-icon.mjs +1 -1
  6. package/dist/assets/icons/marquee-close.mjs +2 -0
  7. package/dist/assets/icons/marquee-speaker.mjs +2 -0
  8. package/dist/assets/images/shortcut-grid/shortcut-grid-card-bg-primary.mjs +2 -0
  9. package/dist/biz.d.mts +10 -6
  10. package/dist/biz.mjs +1 -1
  11. package/dist/common.d.mts +5 -2
  12. package/dist/common.mjs +1 -1
  13. package/dist/components/biz/basics/fullscreen-feed/runtime/user-action.mjs +1 -1
  14. package/dist/components/biz/basics/logo/variants/basic-logo/runtime/client.mjs +1 -1
  15. package/dist/components/biz/business/advertisement/ad-match.d.mts +7 -3
  16. package/dist/components/biz/business/advertisement/ad-match.mjs +1 -1
  17. package/dist/components/biz/business/advertisement/banner-ad/client.mjs +1 -1
  18. package/dist/components/biz/business/advertisement/banner-ad/material.d.mts +2 -2
  19. package/dist/components/biz/business/advertisement/banner-ad/material.mjs +1 -1
  20. package/dist/components/biz/business/advertisement/banner-ad/schema.d.mts +9 -4
  21. package/dist/components/biz/business/advertisement/banner-ad/schema.mjs +1 -1
  22. package/dist/components/biz/business/advertisement/feed-ad/index.d.mts +1 -31
  23. package/dist/components/biz/business/advertisement/feed-ad/index.mjs +1 -1
  24. package/dist/components/biz/business/advertisement/floating-ad/client.d.mts +4 -0
  25. package/dist/components/biz/business/advertisement/floating-ad/client.mjs +1 -1
  26. package/dist/components/biz/business/advertisement/floating-ad/index.d.mts +1 -1
  27. package/dist/components/biz/business/advertisement/floating-ad/material.d.mts +5 -0
  28. package/dist/components/biz/business/advertisement/floating-ad/schema.d.mts +21 -6
  29. package/dist/components/biz/business/advertisement/floating-ad/schema.mjs +1 -1
  30. package/dist/components/biz/business/advertisement/icon-ad/client.mjs +1 -1
  31. package/dist/components/biz/business/advertisement/icon-ad/material.d.mts +1 -1
  32. package/dist/components/biz/business/advertisement/icon-ad/material.mjs +1 -1
  33. package/dist/components/biz/business/advertisement/icon-ad/schema.d.mts +7 -1
  34. package/dist/components/biz/business/advertisement/icon-ad/schema.mjs +1 -1
  35. package/dist/components/biz/business/advertisement/index.d.mts +4 -4
  36. package/dist/components/biz/business/advertisement/popup-ad/client.mjs +2 -2
  37. package/dist/components/biz/business/advertisement/popup-ad/index.d.mts +1 -1
  38. package/dist/components/biz/business/advertisement/popup-ad/material.d.mts +2 -2
  39. package/dist/components/biz/business/advertisement/popup-ad/schema.d.mts +14 -15
  40. package/dist/components/biz/business/advertisement/popup-ad/schema.mjs +1 -1
  41. package/dist/components/biz/business/advertisement/text-ad/client.mjs +1 -1
  42. package/dist/components/biz/business/advertisement/text-ad/material.d.mts +1 -1
  43. package/dist/components/biz/business/advertisement/text-ad/material.mjs +1 -1
  44. package/dist/components/biz/business/advertisement/text-ad/schema.d.mts +5 -1
  45. package/dist/components/biz/business/advertisement/text-ad/schema.mjs +1 -1
  46. package/dist/components/biz/business/banner/variants/basic-banner/runtime/client.mjs +1 -1
  47. package/dist/components/biz/business/banner-carousel/client.d.mts +2 -1
  48. package/dist/components/biz/business/banner-carousel/client.mjs +1 -1
  49. package/dist/components/biz/business/banner-carousel/default-props.mjs +1 -1
  50. package/dist/components/biz/business/channel-list/client.mjs +1 -1
  51. package/dist/components/biz/business/channel-list/default-props.mjs +1 -1
  52. package/dist/components/biz/business/detail/shared/detail-operate.mjs +1 -1
  53. package/dist/components/biz/business/detail/shared/editor-preview.mjs +1 -1
  54. package/dist/components/biz/business/detail/shared/registry.d.mts +1 -1
  55. package/dist/components/biz/business/detail/video-detail-actions/client.mjs +1 -1
  56. package/dist/components/biz/business/detail/video-detail-info/client.mjs +1 -1
  57. package/dist/components/biz/business/detail/video-detail-recommend/client.d.mts +1 -13
  58. package/dist/components/biz/business/detail/video-detail-recommend/client.mjs +1 -1
  59. package/dist/components/biz/business/detail/video-detail-recommend/material.d.mts +1 -1
  60. package/dist/components/biz/business/detail/video-detail-recommend/material.mjs +1 -1
  61. package/dist/components/biz/business/detail/video-detail-recommend/schema.d.mts +1 -1
  62. package/dist/components/biz/business/detail/video-detail-recommend/schema.mjs +1 -1
  63. package/dist/components/biz/business/detail/video-detail-recommend/shared.mjs +2 -0
  64. package/dist/components/biz/business/header-search/header-avatar-icon/client.mjs +1 -1
  65. package/dist/components/biz/business/header-search/header-avatar-logo-search/client.d.mts +1 -1
  66. package/dist/components/biz/business/header-search/header-avatar-logo-search/client.mjs +1 -1
  67. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.d.mts +4 -3
  68. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +1 -1
  69. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/client.mjs +1 -1
  70. package/dist/components/biz/business/header-search/header-logo-search/client.mjs +1 -1
  71. package/dist/components/biz/business/header-search/header-search/client.mjs +1 -1
  72. package/dist/components/biz/business/header-search/shared/avatar.mjs +1 -1
  73. package/dist/components/biz/business/header-search/shared/header-action.mjs +2 -0
  74. package/dist/components/biz/business/header-search/shared/header-search-icon.mjs +2 -0
  75. package/dist/components/biz/business/header-search/shared/header-shell.mjs +2 -0
  76. package/dist/components/biz/business/header-search/shared/logo.mjs +1 -1
  77. package/dist/components/biz/business/header-search/shared/search.mjs +1 -1
  78. package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.d.mts +1 -9
  79. package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.mjs +1 -1
  80. package/dist/components/biz/business/home-recommend/home-recommend-grid/material.d.mts +1 -9
  81. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.d.mts +1 -9
  82. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.mjs +1 -1
  83. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/material.d.mts +1 -9
  84. package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
  85. package/dist/components/biz/business/home-recommend/shared/home-recommend-preview.mjs +1 -1
  86. package/dist/components/biz/business/hot-recommend/client.d.mts +17 -0
  87. package/dist/components/biz/business/hot-recommend/client.mjs +2 -0
  88. package/dist/components/biz/business/hot-recommend/index.d.mts +5 -0
  89. package/dist/components/biz/business/hot-recommend/material.d.mts +24 -0
  90. package/dist/components/biz/business/hot-recommend/material.mjs +2 -0
  91. package/dist/components/biz/business/hot-recommend/schema.d.mts +23 -0
  92. package/dist/components/biz/business/hot-recommend/schema.mjs +2 -0
  93. package/dist/components/biz/business/hot-recommend/server.d.mts +11 -0
  94. package/dist/components/biz/business/hot-recommend/server.mjs +2 -0
  95. package/dist/components/biz/business/index.d.mts +10 -5
  96. package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
  97. package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
  98. package/dist/components/biz/business/large-feature-grid/schema.mjs +1 -1
  99. package/dist/components/biz/business/marquee/client.mjs +1 -1
  100. package/dist/components/biz/business/marquee/marquee.module.mjs +2 -6
  101. package/dist/components/biz/business/marquee/material.d.mts +1 -1
  102. package/dist/components/biz/business/marquee/schema.d.mts +1 -1
  103. package/dist/components/biz/business/nav-bar/variants/basic-nav-bar/runtime/client.mjs +1 -1
  104. package/dist/components/biz/business/profile/index.d.mts +1 -1
  105. package/dist/components/biz/business/profile/profile-header/client.d.mts +2 -1
  106. package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
  107. package/dist/components/biz/business/profile/profile-header/index.d.mts +1 -1
  108. package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
  109. package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
  110. package/dist/components/biz/business/profile/profile-main/client.mjs +1 -1
  111. package/dist/components/biz/business/profile/profile-main/empty-state.mjs +2 -0
  112. package/dist/components/biz/business/profile/profile-main/shell.mjs +1 -1
  113. package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.mjs +1 -1
  114. package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/video-waterfall.mjs +2 -0
  115. package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.mjs +1 -1
  116. package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.d.mts +5 -1
  117. package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.mjs +1 -1
  118. package/dist/components/biz/business/profile/profile-main/utils.mjs +1 -1
  119. package/dist/components/biz/business/ranking-recommend/client.d.mts +17 -0
  120. package/dist/components/biz/business/ranking-recommend/client.mjs +70 -0
  121. package/dist/components/biz/business/ranking-recommend/material.d.mts +35 -0
  122. package/dist/components/biz/business/ranking-recommend/material.mjs +2 -0
  123. package/dist/components/biz/business/ranking-recommend/schema.d.mts +35 -0
  124. package/dist/components/biz/business/ranking-recommend/schema.mjs +2 -0
  125. package/dist/components/biz/business/ranking-recommend/server.d.mts +11 -0
  126. package/dist/components/biz/business/ranking-recommend/server.mjs +2 -0
  127. package/dist/components/biz/business/ranking-recommend/shared/query.mjs +2 -0
  128. package/dist/components/biz/business/ranking-recommend/shared.d.mts +15 -0
  129. package/dist/components/biz/business/ranking-recommend/shared.mjs +2 -0
  130. package/dist/components/biz/business/search-history/client.mjs +1 -1
  131. package/dist/components/biz/business/search-history/schema.mjs +1 -1
  132. package/dist/components/biz/business/search-input/client.mjs +1 -1
  133. package/dist/components/biz/business/shortcut-grid/client.mjs +1 -1
  134. package/dist/components/biz/business/tab-bar/client.mjs +1 -1
  135. package/dist/components/common/collection-popup/create-collection-sheet.d.mts +41 -0
  136. package/dist/components/common/collection-popup/create-collection-sheet.mjs +2 -0
  137. package/dist/components/common/collection-popup/index.d.mts +1 -0
  138. package/dist/components/common/collection-popup/index.mjs +1 -1
  139. package/dist/components/common/icons/setting.mjs +1 -1
  140. package/dist/components/common/list/collection-list/collection-list-item.d.mts +8 -0
  141. package/dist/components/common/list/collection-list/collection-list-item.mjs +1 -1
  142. package/dist/components/common/list/collection-list/collection-list.d.mts +6 -0
  143. package/dist/components/common/list/collection-list/collection-list.mjs +1 -1
  144. package/dist/components/common/list/collection-list/collection-select-icon.mjs +2 -0
  145. package/dist/components/common/list/waterfall-recommend/index.d.mts +2 -0
  146. package/dist/components/common/list/waterfall-recommend/waterfall-recommend.d.mts +116 -0
  147. package/dist/components/common/list/waterfall-recommend/waterfall-recommend.mjs +2 -0
  148. package/dist/components/common/series-episodes/index.d.mts +3 -1
  149. package/dist/components/common/series-episodes/index.mjs +1 -1
  150. package/dist/components/common/tab-bar/index.mjs +1 -1
  151. package/dist/components/pages/collection-detail/_components/collection-detail-video-card.mjs +2 -0
  152. package/dist/components/pages/collection-detail/detail.mjs +1 -1
  153. package/dist/components/pages/edit/page.mjs +1 -1
  154. package/dist/components/pages/feedback/_components/feedback-form.mjs +1 -1
  155. package/dist/components/pages/home/client.mjs +1 -1
  156. package/dist/components/pages/login/auth-page-styles.mjs +6 -0
  157. package/dist/components/pages/login/login-client.mjs +1 -1
  158. package/dist/components/pages/login/register.mjs +1 -1
  159. package/dist/components/pages/login/verify.mjs +1 -4
  160. package/dist/components/pages/publish/components/collection.mjs +1 -1
  161. package/dist/components/pages/search/page-client.mjs +1 -1
  162. package/dist/components/pages/search/search-result/index.mjs +1 -1
  163. package/dist/components/pages/search/search-result/search-all.mjs +1 -1
  164. package/dist/components/pages/search/search-result/search-user.mjs +1 -1
  165. package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
  166. package/dist/components/pages/search/search-result/shared.mjs +2 -0
  167. package/dist/components/pages/search/top-header.mjs +1 -1
  168. package/dist/components/pages/search-result/page-client.mjs +1 -1
  169. package/dist/components/pages/search-result/search-all.mjs +1 -1
  170. package/dist/components/pages/search-result/search-empty.mjs +2 -0
  171. package/dist/components/pages/search-result/search-tab.mjs +1 -1
  172. package/dist/components/pages/search-result/search-user.mjs +1 -1
  173. package/dist/components/pages/search-result/search-video-info.mjs +2 -0
  174. package/dist/components/pages/search-result/shared.mjs +2 -0
  175. package/dist/components/pages/search-result/top-header.mjs +2 -0
  176. package/dist/components/pages/settings/_components/reset-password-drawer.mjs +2 -2
  177. package/dist/components/pages/settings/_components/settings.mjs +1 -1
  178. package/dist/components/pages/user-follow/_components/follow-no-login.mjs +1 -1
  179. package/dist/components/pages/video-list/video-list-client.mjs +1 -1
  180. package/dist/components/pages/video-list/video-list-recommend-item.mjs +2 -0
  181. package/dist/components/pages/video-list/video-list-skeleton.d.mts +2 -3
  182. package/dist/components/pages/video-list/video-list-skeleton.mjs +1 -1
  183. package/dist/components/ui/badge.d.mts +1 -1
  184. package/dist/components/ui/box.d.mts +1 -1
  185. package/dist/components/ui/button.d.mts +1 -1
  186. package/dist/i18n/locales/en.mjs +2 -2
  187. package/dist/i18n/locales/zh-CN.mjs +2 -2
  188. package/dist/materials.d.mts +3 -1
  189. package/dist/materials.mjs +1 -1
  190. package/dist/service/generated/client.d.mts +38 -2
  191. package/dist/service/generated/client.mjs +1 -1
  192. package/dist/service/generated/tanstack.d.mts +47 -2
  193. package/dist/service/generated/tanstack.mjs +1 -1
  194. package/dist/service.d.mts +3 -3
  195. package/dist/service.mjs +1 -1
  196. package/dist/theme-tokens.d.mts +9 -0
  197. package/dist/theme-tokens.mjs +2 -0
  198. package/dist/types.d.mts +662 -9
  199. package/dist/utils/helper.d.mts +1 -1
  200. package/dist/utils/helper.mjs +1 -1
  201. package/package.json +8 -2
  202. package/theme.css +170 -59
  203. package/dist/assets/icons/detail/collect_nor.mjs +0 -2
  204. package/dist/assets/icons/detail/collect_sel.mjs +0 -2
  205. package/dist/assets/icons/detail/share.mjs +0 -2
  206. package/dist/assets/icons/marquee-enter.mjs +0 -2
  207. package/dist/assets/icons/right_arrow.mjs +0 -2
  208. package/dist/assets/icons/search/avatar.mjs +0 -2
  209. package/dist/assets/images/marquee.mjs +0 -2
  210. package/dist/components/biz/business/detail/shared/detail-introduction.mjs +0 -2
  211. package/dist/components/common/collection-popup/collection-create-modal.mjs +0 -2
  212. package/dist/components/common/skeleton/search-video-card-skeleton.mjs +0 -2
  213. package/dist/components/pages/search/search-utils.mjs +0 -2
  214. package/dist/components/pages/search-result/search-result-skeleton.mjs +0 -2
  215. package/dist/components/pages/search-result/search-video.mjs +0 -2
  216. package/dist/components/pages/video-list/video-list-item.mjs +0 -2
@@ -0,0 +1,17 @@
1
+
2
+ import { InferSchemaProps } from "../../../../utils/schema/schema.mjs";
3
+ import "../../../../utils.mjs";
4
+ import { hotRecommendInspectorPropsSchema } from "./schema.mjs";
5
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
6
+
7
+ //#region components/biz/business/hot-recommend/client.d.ts
8
+ type HotRecommendProps = InferSchemaProps<typeof hotRecommendInspectorPropsSchema>;
9
+ interface ClientProps extends HotRecommendProps {
10
+ onItemClick?: (keyword: string) => void;
11
+ }
12
+ /**
13
+ * 热门推荐物料组件 - 客户端部分
14
+ */
15
+ declare function HotRecommendClient(props: ClientProps): react_jsx_runtime0.JSX.Element | null;
16
+ //#endregion
17
+ export { HotRecommendClient, HotRecommendProps };
@@ -0,0 +1,2 @@
1
+
2
+ "use client";import{useRouter as e}from"../../../../utils/use-compatible-router.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import{useCallback as r,useId as i,useMemo as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{usePathname as u,useSearchParams as d}from"next/navigation";const f=[];function p(e,t){if(e.length<=t)return[...e];let n=[...e];for(let e=0;e<t;e++){let t=e+Math.floor(Math.random()*(n.length-e));[n[e],n[t]]=[n[t],n[e]]}return n.slice(0,t)}function m({className:e=``}){let t=i().replace(/:/g,``);return l(`svg`,{viewBox:`0 0 62.4481 14.192`,fill:`none`,"aria-hidden":!0,className:e,children:[l(`g`,{children:[c(`path`,{d:`M50.7201 4V3.04H47.9841V0.768H50.7201V0H53.3281V0.768H57.1201V0H59.7441V0.768H62.4481V3.04H59.7441V4H57.1201V3.04H53.3281V4H50.7201ZM48.1281 8.32C48.4587 8.32 48.8054 8.27733 49.1681 8.192C49.5307 8.096 49.8934 7.968 50.2561 7.808C50.6294 7.63733 50.9867 7.43467 51.3281 7.2C51.6801 6.95467 52.0054 6.688 52.3041 6.4H48.3041V4.464H53.5681C53.7067 4.112 53.7761 3.72267 53.7761 3.296H56.4641C56.4641 3.68 56.4107 4.06933 56.3041 4.464H62.1121V6.4H55.5041C55.4401 6.51733 55.3707 6.62933 55.2961 6.736C55.2321 6.832 55.1574 6.93867 55.0721 7.056H61.1841V7.536C61.1841 7.94133 61.1147 8.33067 60.9761 8.704C60.8481 9.07733 60.5921 9.39733 60.2081 9.664H62.3041V11.488H59.2801V11.696C59.2801 12.1653 59.2267 12.5547 59.1201 12.864C59.0134 13.1733 58.8534 13.4187 58.6401 13.6C58.4267 13.792 58.1601 13.9253 57.8401 14C57.5201 14.0747 57.1521 14.112 56.7361 14.112H54.7361V12.432H55.2481C55.5894 12.4213 55.8561 12.4 56.0481 12.368C56.2507 12.336 56.4001 12.288 56.4961 12.224C56.6027 12.16 56.6721 12.0853 56.7041 12C56.7361 11.9147 56.7521 11.8133 56.7521 11.696V11.488H53.2161V9.664H56.7521V9.44C57.2321 9.44 57.6267 9.39733 57.9361 9.312C58.2454 9.216 58.4747 9.04 58.6241 8.784H54.4641V7.856C54.1547 8.208 53.8187 8.544 53.4561 8.864C53.1041 9.17333 52.7254 9.456 52.3201 9.712V14.176H49.7761V10.784C49.2534 10.912 48.7041 10.976 48.1281 10.976V8.32Z`,fill:`url(#${t})`}),c(`path`,{d:`M40.3361 0.0159912C40.3361 0.805325 40.2614 1.53066 40.1121 2.19199H46.3841V4.28799H44.3361V5.45599H46.1601V7.31199H44.3361V8.47999H46.1601V10.352H44.3361V11.648H46.4961V13.968H40.1121V14.192H37.5681V5.63199C37.3441 5.69599 37.1201 5.72799 36.8961 5.72799V2.92799C37.2694 2.92799 37.5361 2.68799 37.6961 2.20799C37.8561 1.72799 37.9361 0.997325 37.9361 0.0159912H40.3361ZM33.2641 0.0159912H35.6641V2.20799H36.6721V4.57599H35.6641V6.20799L36.6881 6.09599V8.47999L35.6641 8.62399V10.992C35.6641 11.408 35.6427 11.8027 35.6001 12.176C35.5574 12.56 35.4507 12.8907 35.2801 13.168C35.1201 13.456 34.8801 13.68 34.5601 13.84C34.2401 14.0107 33.8081 14.096 33.2641 14.096H32.1921V11.872H32.6241C32.9014 11.872 33.0774 11.7973 33.1521 11.648C33.2267 11.488 33.2641 11.184 33.2641 10.736V8.97599L31.9841 9.15199V6.63999L33.2641 6.49599V4.57599H32.0641V2.20799H33.2641V0.0159912ZM41.6001 0.0159912H44.4161L44.4641 1.90399H41.6481L41.6001 0.0159912ZM40.1121 5.45599H41.8881V4.28799H40.1121V5.45599ZM40.1121 8.47999H41.8881V7.31199H40.1121V8.47999ZM40.1121 11.648H41.8881V10.352H40.1121V11.648Z`,fill:`url(#${t})`}),c(`path`,{d:`M16.6721 2.49599L16.6081 0.0159912H19.8401L19.9041 2.49599H16.6721ZM24.9601 14.192V11.68H25.7121C26.0427 11.68 26.2987 11.6587 26.4801 11.616C26.6721 11.5733 26.8161 11.4987 26.9121 11.392C27.0081 11.2747 27.0667 11.12 27.0881 10.928C27.1094 10.736 27.1201 10.4907 27.1201 10.192V2.68799H20.8001V0.175991H29.9521V10.448C29.9521 11.2267 29.8827 11.8613 29.7441 12.352C29.6161 12.8427 29.3921 13.2213 29.0721 13.488C28.7521 13.7653 28.3201 13.952 27.7761 14.048C27.2321 14.144 26.5494 14.192 25.7281 14.192H24.9601ZM16.5441 14.192V3.23199H19.3761V14.192H16.5441Z`,fill:`url(#${t})`}),c(`path`,{d:`M6.48499e-05 7.18399V5.10399L1.87206 5.02399V3.82399H0.176065V1.45599H1.87206V0.0159912H4.25607V1.45599H6.00007V3.82399H4.25607V4.91199L5.84007 4.84799V6.92799L4.25607 6.99199V8.36799C4.25607 8.73066 4.22407 9.06132 4.16007 9.35999C4.09607 9.65866 3.97873 9.91466 3.80806 10.128C3.64807 10.3413 3.41873 10.5067 3.12007 10.624C2.83207 10.7413 2.45873 10.8 2.00006 10.8H0.592065V8.68799H1.05606C1.24806 8.68799 1.3974 8.66666 1.50406 8.62399C1.6214 8.58132 1.70673 8.52266 1.76006 8.44799C1.8134 8.36266 1.8454 8.26666 1.85606 8.15999C1.86673 8.04266 1.87206 7.91999 1.87206 7.79199V7.10399L6.48499e-05 7.18399ZM13.8081 10.864C12.7627 10.864 12.0054 10.624 11.5361 10.144C11.0774 9.66399 10.8481 8.86933 10.8481 7.75999V3.82399H9.84007V4.87999V5.02399H10.5121V6.68799H9.76007C9.6854 7.46666 9.55206 8.12266 9.36006 8.65599C9.17873 9.18932 8.9174 9.62133 8.57607 9.95199C8.2454 10.2827 7.8294 10.5227 7.32807 10.672C6.82673 10.8213 6.2294 10.896 5.53607 10.896V8.79999C5.8774 8.79999 6.1654 8.76799 6.40007 8.70399C6.6454 8.63999 6.84273 8.52799 6.99207 8.36799C7.1414 8.20799 7.25873 7.99466 7.34407 7.72799C7.4294 7.45066 7.48807 7.10399 7.52007 6.68799H6.35207V5.02399H7.58406V4.84799V3.82399H6.44807V1.45599H7.60007V0.0159912H9.85606V1.45599H13.2321V7.24799C13.2321 7.66399 13.2747 7.92533 13.3601 8.03199C13.4561 8.13866 13.6321 8.19199 13.8881 8.19199H14.3521V10.864H13.8081ZM0.144065 14.192L0.256065 11.232H3.21606L3.10406 14.192H0.144065ZM11.3921 14.192L11.2481 11.232H14.2241L14.3681 14.192H11.3921ZM4.17606 14.192L4.03207 11.296H6.73607L6.86407 14.192H4.17606ZM7.77607 14.192L7.63207 11.296H10.3841L10.5121 14.192H7.77607Z`,fill:`url(#${t})`})]}),c(`defs`,{children:l(`linearGradient`,{id:t,x1:`33.7161`,y1:`-4.59601`,x2:`60.7161`,y2:`18.404`,gradientUnits:`userSpaceOnUse`,children:[c(`stop`,{stopColor:`#E914E9`}),c(`stop`,{offset:`1`,stopColor:`#6C43EE`})]})})]})}function h({className:e=``}){return c(`svg`,{viewBox:`0 0 16.6667 16.6667`,fill:`none`,"aria-hidden":!0,className:e,children:c(`path`,{d:`M8.33333 1.66667C6.04287 1.66667 4.0209 2.82188 2.82036 4.58333H5V6.25H0V1.25H1.66667V3.3328C3.18651 1.30972 5.60637 0 8.33333 0C12.9357 0 16.6667 3.73096 16.6667 8.33333H15C15 4.65143 12.0152 1.66667 8.33333 1.66667ZM1.66667 8.33333C1.66667 12.0152 4.65143 15 8.33333 15C10.6238 15 12.6458 13.8447 13.8463 12.0833H11.6667V10.4167H16.6667V15.4167H15V13.3338C13.4802 15.3569 11.0603 16.6667 8.33333 16.6667C3.73096 16.6667 0 12.9357 0 8.33333H1.66667Z`,fill:`currentColor`})})}function g({variant:e,className:t=``}){let n=i().replace(/:/g,``),r=e===`gold`?`#FFF047`:`#D7D7D7`;return l(`svg`,{viewBox:`0 0 10 8`,fill:`none`,"aria-hidden":!0,className:t,children:[c(`path`,{d:`M0.72289 1.44405L2.67531 2.6057L4.62168 0.173795C4.77092 -0.0126857 5.06132 -0.0558774 5.27027 0.0773202C5.31202 0.103935 5.34852 0.136533 5.37837 0.173795L7.32476 2.6057L9.27714 1.44405C9.49083 1.31693 9.77946 1.36845 9.92192 1.55913C9.98315 1.64113 10.0097 1.73991 9.99682 1.83779L9.23283 7.63352C9.20526 7.84249 9.00682 8 8.77105 8H1.22899C0.99323 8 0.794784 7.84249 0.767236 7.63352L0.00322932 1.83779C-0.0267734 1.61019 0.155642 1.40398 0.410663 1.3772C0.520333 1.36569 0.631013 1.38938 0.72289 1.44405ZM5.00005 5.51033C5.51357 5.51033 5.92993 5.13878 5.92993 4.68043C5.92993 4.22209 5.51357 3.85054 5.00005 3.85054C4.48647 3.85054 4.07016 4.22209 4.07016 4.68043C4.07016 5.13878 4.48647 5.51033 5.00005 5.51033Z`,fill:`url(#${n})`}),c(`defs`,{children:l(`linearGradient`,{id:n,x1:`5`,y1:`0`,x2:`5`,y2:`8`,gradientUnits:`userSpaceOnUse`,children:[c(`stop`,{stopColor:r}),c(`stop`,{offset:`1`,stopColor:r,stopOpacity:`0`})]})})]})}function _(i){let{title:_,displayCount:v=4,items:y=f,onItemClick:b,mode:x=`renderer`}=i,S=x===`editor`,C=e(),w=u(),T=d(),E=_.trim()||`热门推荐`,D=Math.max(1,v||0),[O,k]=s(0),[A,j]=s(!1),M=o(null),N=r(()=>{A||(j(!0),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{k(e=>e+1),j(!1),M.current=null},500))},[A]),P=a(()=>p(y,D),[D,y,O]);if(y.length===0)return null;let F=e=>{if(b){b(e);return}let t=new URLSearchParams(T.toString());t.set(`q`,e);let n=w.includes(`/search-result`)?w:`/search-result`;C.push(`${n}?${t.toString()}`)};return l(t,{className:`relative mx-[16px] mt-[24px] overflow-hidden rounded-[12px] bg-black${S?` pointer-events-none`:``}`,children:[c(t,{className:`pointer-events-none absolute inset-0 rounded-[12px]`,style:{background:`linear-gradient(180deg, #9756E3 0%, #6C43EE 100%), linear-gradient(180deg, rgba(255,30,255,0.7) 0%, rgba(108,67,238,0) 100%)`,padding:`0.5px`,WebkitMask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,WebkitMaskComposite:`xor`,mask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,maskComposite:`exclude`}}),c(t,{className:`pointer-events-none absolute inset-x-0 top-0 rounded-t-[12px] mix-blend-plus-lighter`,style:{height:`259px`,background:`linear-gradient(180deg, rgba(151,86,227,0.4) 0%, rgba(151,86,227,0) 85%)`}}),l(t,{className:`relative px-[24px] pb-[18px] pt-[22px]`,children:[l(t,{className:`flex items-center justify-between`,children:[E===`热门推荐`?c(m,{className:`h-[14.192px] w-[62.448px] shrink-0`}):c(n,{className:`shrink-0 bg-[linear-gradient(90deg,#E914E9_0%,#6C43EE_100%)] bg-clip-text font-["PingFang_SC"] text-[16px] font-semibold leading-none text-transparent`,children:E}),c(`button`,{type:`button`,"aria-label":`刷新`,className:`flex h-[20px] w-[20px] shrink-0 items-center justify-center text-white/40 transition-opacity active:opacity-70`,onClick:N,children:c(h,{className:`h-[16.6667px] w-[16.6667px] ${A?`animate-spin`:``}`})})]}),c(t,{className:`mt-[7px]`,children:P.map((e,r)=>{let i=r<3,a=r<2,o=i?`text-[#C922EF]`:`text-white/70`,s=i?`text-white/90`:`text-white/70`;return l(t,{children:[l(`button`,{type:`button`,className:`flex h-[48px] w-full items-center gap-[4px] text-left transition-opacity active:opacity-70`,onClick:()=>F(e.label),children:[l(t,{className:`relative flex h-[24px] w-[20px] shrink-0 items-end justify-center`,children:[a?c(g,{variant:r===0?`gold`:`silver`,className:`absolute left-1/2 top-0 h-[8px] w-[10px] -translate-x-1/2`}):null,c(n,{className:`font-['DIN_Black'] text-[14px] font-normal not-italic leading-[24px] ${o}`,children:r+1})]}),c(n,{className:`min-w-0 flex-1 truncate font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[24px] ${s}`,children:e.label})]}),r<P.length-1?c(t,{className:`h-px w-full bg-white/[0.08]`}):null]},`${e.label}-${r}`)})})]})]})}export{_ as HotRecommendClient};
@@ -0,0 +1,5 @@
1
+
2
+ import { hotRecommendInspectorPropsSchema } from "./schema.mjs";
3
+ import { HotRecommendClient, HotRecommendProps } from "./client.mjs";
4
+ import { HotRecommendServer } from "./server.mjs";
5
+ import { hotRecommendMaterial } from "./material.mjs";
@@ -0,0 +1,24 @@
1
+
2
+ import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
3
+ import { DefineMaterialOption } from "../../../../utils/schema/material.mjs";
4
+ import "../../../../utils.mjs";
5
+ import { HotRecommendClient } from "./client.mjs";
6
+ import { HotRecommendServer } from "./server.mjs";
7
+ import * as zod from "zod";
8
+ import * as zod_v4_core0 from "zod/v4/core";
9
+
10
+ //#region components/biz/business/hot-recommend/material.d.ts
11
+ declare const hotRecommendMaterial: DefineMaterialOption<typeof HotRecommendServer, typeof HotRecommendClient, zod.ZodObject<{
12
+ readonly title: zod.ZodString & SchemaHasDefaultValue;
13
+ readonly displayCount: zod.ZodNumber & SchemaHasDefaultValue;
14
+ readonly items: zod.ZodArray<zod.ZodObject<{
15
+ label: zod.ZodString & SchemaHasDefaultValue;
16
+ }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
17
+ } & {
18
+ mode: zod.ZodOptional<zod.ZodEnum<{
19
+ renderer: "renderer";
20
+ editor: "editor";
21
+ }>>;
22
+ }, zod_v4_core0.$strip>, "hot-recommend", "内容组件">;
23
+ //#endregion
24
+ export { hotRecommendMaterial };
@@ -0,0 +1,2 @@
1
+
2
+ import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{HotRecommendClient as t}from"./client.mjs";import{hotRecommendInspectorPropsSchema as n}from"./schema.mjs";import{HotRecommendServer as r}from"./server.mjs";const i=e({type:`hot-recommend`,name:`热门推荐`,icon:`/static/components-thumb/search_recommend_text.png`,category:`内容组件`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as hotRecommendMaterial};
@@ -0,0 +1,23 @@
1
+
2
+ import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
3
+ import "../../../../utils.mjs";
4
+ import { z } from "zod";
5
+
6
+ //#region components/biz/business/hot-recommend/schema.d.ts
7
+ /**
8
+ * 热门推荐物料属性定义
9
+ */
10
+ declare const hotRecommendInspectorPropsSchema: z.ZodObject<{
11
+ readonly title: z.ZodString & SchemaHasDefaultValue;
12
+ readonly displayCount: z.ZodNumber & SchemaHasDefaultValue;
13
+ readonly items: z.ZodArray<z.ZodObject<{
14
+ label: z.ZodString & SchemaHasDefaultValue;
15
+ }, z.core.$strip>> & SchemaHasDefaultValue;
16
+ } & {
17
+ mode: z.ZodOptional<z.ZodEnum<{
18
+ renderer: "renderer";
19
+ editor: "editor";
20
+ }>>;
21
+ }, z.core.$strip>;
22
+ //#endregion
23
+ export { hotRecommendInspectorPropsSchema };
@@ -0,0 +1,2 @@
1
+
2
+ import{defineComponentPropsSchema as e}from"../../../../utils/schema/schema.mjs";import{z as t}from"zod";const n=e(e=>({title:e.string(`热门推荐`,{label:`标题名称`,description:`支持输入,中/英/数/符,6个字符`}),displayCount:e.number(4,{label:`展示数`}),items:e.array(t.object({label:e.string(`东野圭吾作品:11字迷案`,{label:`热词`})}),{label:`推荐位模块`,defaultValue:[{label:`东野圭吾作品:11字迷案`},{label:`嫌疑人X的献身:高智商博弈`},{label:`白夜行:原著同名悬疑改编`},{label:`神探伽利略:校园连环谜案`},{label:`假面饭店:密室追凶夜`},{label:`恶意:东野圭吾高分作品`}]})}));export{n as hotRecommendInspectorPropsSchema};
@@ -0,0 +1,11 @@
1
+
2
+ import { HotRecommendProps } from "./client.mjs";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region components/biz/business/hot-recommend/server.d.ts
6
+ /**
7
+ * 热门推荐物料组件 - 服务端部分
8
+ */
9
+ declare function HotRecommendServer(props: HotRecommendProps): Promise<react_jsx_runtime0.JSX.Element>;
10
+ //#endregion
11
+ export { HotRecommendServer };
@@ -0,0 +1,2 @@
1
+
2
+ import{HotRecommendClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";async function n(n){let{mode:r=`renderer`,...i}=n;return t(e,{...i,mode:r})}export{n as HotRecommendServer};
@@ -3,24 +3,24 @@ import { defaultProps } from "../basics/fullscreen-feed/defaults/default-props.m
3
3
  import { FullscreenFeedClient } from "../basics/fullscreen-feed/runtime/client.mjs";
4
4
  import { schema } from "../basics/fullscreen-feed/schema/index.mjs";
5
5
  import { BannerAdInspectorProps, BannerAdItem, BannerAdProps, BannerAdStyleSize, bannerAdInspectorDefaultProps, bannerAdInspectorPropsSchema, bannerAdStyleSizeOptions } from "./advertisement/banner-ad/schema.mjs";
6
- import { FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema } from "./advertisement/floating-ad/schema.mjs";
6
+ import { FloatingAdEditableProps, FloatingAdInspectorProps, FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema } from "./advertisement/floating-ad/schema.mjs";
7
7
  import { IconAdInspectorProps, IconAdItem, IconAdProps, iconAdInspectorDefaultProps, iconAdInspectorPropsSchema } from "./advertisement/icon-ad/schema.mjs";
8
8
  import { TextAdInspectorProps, TextAdItem, TextAdProps, textAdInspectorDefaultProps, textAdInspectorPropsSchema } from "./advertisement/text-ad/schema.mjs";
9
- import { AdsMatchExtData, adaptBannerAdProps, adaptFloatingAdItems, adaptIconAdProps, adaptPopupAdMaterials, adaptTextAdProps, buildAdsMatchRequest, hasMatchedAds, parseAdsMatchExtData, resolveAdsAppCode, sortAdsMatchMaterials } from "./advertisement/ad-match.mjs";
9
+ import { AdsMatchExtData, adaptBannerAdProps, adaptFloatingAdItem, adaptIconAdProps, adaptPopupAdMaterials, adaptTextAdProps, buildAdsMatchRequest, getFirstMatchedMaterial, hasMatchedAds, parseAdsMatchExtData, resolveAdsAppCode, sortAdsMatchMaterials } from "./advertisement/ad-match.mjs";
10
10
  import { AdProvider, AdProviderProps, AdProviderValue, useAdProvider } from "./advertisement/ad-provider.mjs";
11
11
  import { AdsMatchQueryOptions, createAdsMatchPrefetchItem, createAdsMatchQueryFn, getAdsMatchQueryKey } from "./advertisement/ad-query.mjs";
12
12
  import { AdRuntimeProvider, AdRuntimeProviderProps } from "./advertisement/ad-runtime-provider.mjs";
13
13
  import { BannerAd } from "./advertisement/banner-ad/client.mjs";
14
14
  import { BannerAdServer } from "./advertisement/banner-ad/server.mjs";
15
15
  import { bannerAdMaterial } from "./advertisement/banner-ad/material.mjs";
16
- import { FeedAdBadge, FeedAdItemLike, FeedAdPayloadLike, getFeedAdIcon, getFeedAdJumpUrl, isFeedAdItem } from "./advertisement/feed-ad/index.mjs";
16
+ import { FeedAdBadge, FeedAdItemLike, getFeedAdIcon, getFeedAdJumpUrl, isFeedAdItem } from "./advertisement/feed-ad/index.mjs";
17
17
  import { FloatingAd } from "./advertisement/floating-ad/client.mjs";
18
18
  import { FloatingAdServer } from "./advertisement/floating-ad/server.mjs";
19
19
  import { floatingAdMaterial } from "./advertisement/floating-ad/material.mjs";
20
20
  import { IconAd } from "./advertisement/icon-ad/client.mjs";
21
21
  import { IconAdServer } from "./advertisement/icon-ad/server.mjs";
22
22
  import { iconAdMaterial } from "./advertisement/icon-ad/material.mjs";
23
- import { PopupAdBaseProps, PopupAdInspectorProps, PopupAdItem, PopupAdProps, popupAdInspectorDefaultProps, popupAdInspectorPropsSchema } from "./advertisement/popup-ad/schema.mjs";
23
+ import { PopupAdInspectorProps, PopupAdItem, PopupAdProps, popupAdInspectorDefaultProps, popupAdInspectorPropsSchema } from "./advertisement/popup-ad/schema.mjs";
24
24
  import { PopupAd } from "./advertisement/popup-ad/client.mjs";
25
25
  import { PopupAdServer } from "./advertisement/popup-ad/server.mjs";
26
26
  import { popupAdMaterial } from "./advertisement/popup-ad/material.mjs";
@@ -78,6 +78,11 @@ import { schema as schema$11 } from "./home-recommend/home-recommend-waterfall/s
78
78
  import { HomeRecommendWaterfall } from "./home-recommend/home-recommend-waterfall/server.mjs";
79
79
  import { homeRecommendWaterfallMaterial } from "./home-recommend/home-recommend-waterfall/material.mjs";
80
80
  import "./home-recommend/index.mjs";
81
+ import { hotRecommendInspectorPropsSchema } from "./hot-recommend/schema.mjs";
82
+ import { HotRecommendClient, HotRecommendProps } from "./hot-recommend/client.mjs";
83
+ import { HotRecommendServer } from "./hot-recommend/server.mjs";
84
+ import { hotRecommendMaterial } from "./hot-recommend/material.mjs";
85
+ import "./hot-recommend/index.mjs";
81
86
  import { imageTextRecommendInspectorPropsSchema } from "./image-text-recommend/schema.mjs";
82
87
  import { ImageTextRecommendClient, ImageTextRecommendProps } from "./image-text-recommend/client.mjs";
83
88
  import { ImageTextRecommendServer } from "./image-text-recommend/server.mjs";
@@ -97,7 +102,7 @@ import { BasicPostCardClient } from "./post-card/variants/basic-post-card/runtim
97
102
  import { schema as schema$13 } from "./post-card/variants/basic-post-card/schema/index.mjs";
98
103
  import "./post-card/index.mjs";
99
104
  import { ProfileHeaderInspectorProps, UserProfileHeaderAuthConfig, UserProfileHeaderClientProps, profileHeaderInspectorDefaultProps, profileHeaderInspectorPropsSchema } from "./profile/profile-header/schema.mjs";
100
- import { UserProfileHeaderClient } from "./profile/profile-header/client.mjs";
105
+ import { UserProfileHeaderClient, defaultBackground } from "./profile/profile-header/client.mjs";
101
106
  import { profileHeaderMaterial, profileHeaderMaterialWithDisabledBackground } from "./profile/profile-header/material.mjs";
102
107
  import { ProfileMainInspectorProps, UserProfileMainProps, profileMainInspectorDefaultProps, profileMainInspectorPropsSchema } from "./profile/profile-main/schema.mjs";
103
108
  import { UserProfileMainClient } from "./profile/profile-main/client.mjs";
@@ -1,2 +1,2 @@
1
1
 
2
- import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import{getFeedAdIcon as i,getFeedAdJumpUrl as a,isFeedAdItem as o}from"../advertisement/feed-ad/index.mjs";import s from"../../../../assets/icons/view.mjs";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u(e){let t=Number(e||0);return Number.isNaN(t)||t<=0?`0`:t>=1e4?`${(t/1e4).toFixed(1)}w`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function d({data:d}){return d?c(t,{children:(Array.isArray(d)?d:[d]).map((d,f)=>{if(!d||typeof d!=`object`)return null;let{id:p,title:m,desc:h,cover:g,tagImageUrl:_,showEpisode:v,episodeText:y,showPlayCount:b,play_count:x}=d,S=o(d),C=m||``,w=(S?i(d):``)||g,T=S?a(d):p?`/video/${p}/${C?encodeURIComponent(C):``}`:`#`,E=_?String(_):null,D=y==null?``:String(y).trim(),O=!S&&(v??!0)&&D!==``,k=!S&&(b??!0),A=u(x);return S?c(t,{children:c(r,{href:T,children:l(t,{className:`relative w-full overflow-hidden rounded-[8px] bg-[rgba(90,90,90,0.48)]`,style:{aspectRatio:`358 / 263`},children:[l(t,{className:`absolute inset-x-0 top-0 overflow-hidden`,style:{height:`83.65%`},children:[w&&c(t,{className:`absolute top-0`,style:{left:`-6.42%`,width:`202.24%`,height:`163.64%`},children:c(e,{src:w,alt:C||`广告封面`,fill:!0,objectFit:`cover`})}),c(t,{className:`absolute right-0 top-0 flex items-center justify-center`,style:{width:`15.64%`,height:`9.51%`,minWidth:`56px`,minHeight:`25px`,borderBottomLeftRadius:`16px`,backgroundColor:`rgba(0, 0, 0, 0.33)`},children:c(n,{className:`text-white`,style:{fontSize:`clamp(12px, 3.35vw, 16px)`,lineHeight:`normal`},children:`广告`})})]}),l(t,{className:`absolute inset-x-0 bottom-0 flex items-center justify-between bg-white`,style:{height:`16.35%`,minHeight:`43px`,padding:`0 3.35%`},children:[c(t,{className:`min-w-0 flex-1`,style:{paddingRight:`3.35%`},children:c(n,{as:`h3`,className:`line-clamp-1 text-[#161616]`,style:{fontSize:`clamp(14px, 3.9vw, 18px)`,lineHeight:`normal`},children:C})}),c(t,{className:`flex shrink-0 items-center justify-center rounded-[16px] border border-[#FD4C5E]`,style:{width:`14.53%`,height:`10.27%`,minWidth:`52px`,minHeight:`27px`},children:c(n,{className:`text-[#FD4C5E]`,style:{fontSize:`clamp(14px, 3.9vw, 18px)`,lineHeight:`normal`},children:`前往`})})]})]})})},p||C||`large-grid-item-${f}`):c(t,{children:l(r,{href:T,children:[l(t,{className:`relative w-full overflow-hidden rounded-[12px] bg-neutral-800`,style:{aspectRatio:`16/9`},children:[w&&c(e,{src:w,alt:C||`封面`,fill:!0,objectFit:`cover`}),E&&c(t,{className:`absolute top-0 right-0 z-10 w-[37px] h-[20px]`,children:c(e,{src:E,alt:C||`角标`,fill:!0,sizes:`37px`,className:`object-contain`})}),c(t,{className:`absolute inset-x-0 bottom-0 h-[40px] bg-gradient-to-t from-black/80 to-transparent z-0 pointer-events-none`}),k&&l(t,{className:`absolute bottom-0 left-[8px] mb-[6px] z-10 flex items-center gap-[4px]`,children:[c(s,{className:`h-[14px] w-[14px] text-white`}),c(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:A})]}),O&&c(t,{className:`absolute bottom-0 right-[8px] mb-[6px] z-10 flex items-center`,children:c(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:D})})]}),l(t,{className:`flex items-center justify-between gap-[12px] pt-[10px] px-2`,children:[l(t,{className:`flex-1 min-w-0`,children:[c(n,{as:`h3`,className:`text-[16px] font-semibold leading-[24px] text-text1 line-clamp-1`,children:C}),h&&c(n,{as:`p`,className:`mt-[4px] text-[13px] leading-[20px] text-text2 line-clamp-1`,children:h})]}),c(n,{className:`shrink-0 rounded-[20px] border border-[#FD4C5E] px-[24px] py-[8px] text-[14px] font-normal text-[#FD4C5E]`,children:`观看`})]})]})},p||C||`large-grid-item-${f}`)})}):null}export{d as LargeGridItemClient};
2
+ import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/icons/view.mjs";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";function c(e){let t=Number(e||0);if(Number.isNaN(t)||t<=0)return``;if(t>=1e6){let e=(t/1e6).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}M`:`${e}M`}return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(Math.floor(t))}function l({data:l}){return l?o(t,{className:`flex flex-col gap-[12px]`,children:(Array.isArray(l)?l:[l]).map((l,u)=>{if(!l||typeof l!=`object`)return null;let{id:d,title:f,desc:p,cover:m,tagImageUrl:h,showEpisode:g,episodeText:_,showPlayCount:v,play_count:y}=l,b=f||``,x=d?`/video/${d}/${b?encodeURIComponent(b):``}`:`#`,S=_==null?``:String(_).trim(),C=(g??!0)&&S!==``,w=v??!0,T=c(y)||`0`;return o(t,{children:o(r,{href:x,className:`block`,children:s(t,{className:`relative h-[204px] w-full overflow-hidden rounded-[8px] bg-[rgba(6,3,20,0.5)]`,children:[s(t,{className:`relative h-[134px] w-full overflow-hidden rounded-t-[8px]`,children:[m&&o(e,{src:m,alt:b||`封面`,fill:!0,objectFit:`cover`}),h&&String(h).trim()&&o(t,{className:`absolute left-[16px] top-[12px]`,children:o(t,{className:`inline-flex items-center justify-center rounded-[4px] px-[4px] py-[4px]`,style:{background:`linear-gradient(90deg, #CA3FE9 0%, #9756E3 100%)`},children:o(e,{src:String(h),alt:``,width:75,height:14,className:`h-[14px] w-auto object-contain`})})}),s(t,{className:`absolute bottom-[12px] left-[16px] right-[16px] flex items-center justify-between`,children:[o(t,{className:`flex items-center gap-[4px]`,children:w&&s(a,{children:[o(i,{className:`size-[22px] text-white opacity-80`}),o(n,{className:`text-[14px] leading-[20px] text-white`,children:T})]})}),C&&o(n,{className:`text-[14px] leading-[20px] text-white`,children:S})]})]}),o(t,{className:`px-[16px] pt-[12px]`,children:s(t,{className:`flex flex-col gap-[2px]`,children:[o(n,{className:`line-clamp-1 text-[16px] font-medium leading-[22px] text-white`,children:b}),p&&o(n,{className:`line-clamp-1 text-[14px] leading-[20px] text-white/50`,children:p})]})})]})})},d||b||`large-grid-item-${u}`)})}):null}export{l as LargeGridItemClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{isClient as e}from"../../../../utils/common.mjs";import{pContentBatchGetVideoDetail as t}from"../../../../service/generated/client.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import i from"../../../ui/loading.mjs";import a from"../../../ui/link.mjs";import{useSingleFirstRowHeight as o}from"../../../../hooks/use-first-row-height.mjs";import{useMinDurationLoading as s}from"../../../../hooks/use-min-duration-loading.mjs";import c from"../../../../assets/icons/common/right_arrow.mjs";import{isFeedAdItem as l}from"../advertisement/feed-ad/index.mjs";import{LargeGridItemClient as u}from"./card-item.mjs";import{largeFeatureGridInspectorDefaultProps as d}from"./schema.mjs";import{useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";const v=[],y=d.data??[];function b(e){return e==null}function x(e,t){return b(e)?t:e}function S(e){return typeof e==`string`?e.trim():``}function C(e){return S(e)}function w(e){let t=Number(e);if(!(!Number.isFinite(t)||t<0))return t}function T(e){let t=e,n=S(e.update_status)===`0`,r=(Array.isArray(t.episodes)?t.episodes.length:0)||(Array.isArray(e.video_episodes)?e.video_episodes.length:0)||(Array.isArray(e.links)?e.links.length:0)||(w(e.episode_cnt)??0);return!Number.isFinite(r)||r<=0?``:`${n?`更新至`:`全`}${Math.floor(r)}集`}function E(e,t){return t?{...e,...t,id:x(t.id,e.id),cover:x(t.cover,e.cover),title:x(t.title,e.title),desc:x(t.desc,e.desc),play_count:x(t.play_count,e.play_count),showPlayCount:t.showPlayCount??e.showPlayCount,episodeText:x(t.episodeText,e.episodeText),showEpisode:t.showEpisode??e.showEpisode,useContentCover:t.useContentCover??e.useContentCover,tagImageUrl:x(t.tagImageUrl,e.tagImageUrl)}:e}function D(e,t){if(!t)return e;let n=e.items;return{...e,...t,title:x(t.title,e.title),moreUrl:x(t.moreUrl,e.moreUrl),moreLinkType:t.moreLinkType??e.moreLinkType,items:n?E(n,t.items):t.items}}function O({mode:d=`renderer`,data:b=v}){let x=d===`editor`,S=b??v,E=Array.isArray(S)&&S.length>0,O=p(()=>E?[D(y[0],S[0])]:y,[E,S]),[k,A]=h(O),j=m(``),M=m(null),{isLoading:N,show:P,hide:F,cancel:I}=s(500);f(()=>{A(O)},[O]);let L=o({enabled:!x,containerRef:M,itemRef:M,deps:[k.length]}),R=p(()=>{if(x||!E)return``;let e=O.map(e=>C(e?.items?.id)).filter(Boolean);return Array.from(new Set(e)).join(`,`)},[E,x,O]);if(f(()=>{if(x||!e()||!R||j.current===R)return;j.current=R;let n=!1;async function r(){try{P();let e=await t({ids:R.split(`,`).filter(Boolean)},{cache:`no-store`}),r=Array.isArray(e.data?.videos)?e.data.videos:[],i=new Map;if(r.forEach(e=>{let t=C(e.video_id||e.id||e.mid);t&&i.set(t,e)}),n)return;A(e=>e.map(e=>{let t=e.items;if(!t||l(t))return e;let n=C(t.id),r=n?i.get(n):void 0;if(!r)return e;let a=w(r.play_count)??w(r.browse_count),o=T(r);return{...e,items:{...t,play_count:a??t.play_count,episodeText:o||t.episodeText}}}))}catch(e){console.error(`大图推荐刷新首屏失败(client)`,e)}finally{n||F()}}return r(),()=>{n=!0,I()}},[I,R,F,x,P]),!k||k.length===0)return null;let z=k[0],B=z?.title,V=z?.moreUrl,H=L>0?L/2:160,U=!x&&N;return _(n,{className:x?`p-3 pointer-events-none`:`p-3`,children:[_(n,{className:`flex items-center justify-between mb-[10px] h-[24px]`,children:[B&&g(r,{as:`h2`,className:`text-[18px] font-bold text-text1 line-clamp-1 flex-1 min-w-0 mr-[12px]`,children:B}),V&&_(a,{href:V,className:`flex items-center text-[14px] text-text2 ml-auto`,children:[`更多`,g(c,{className:`ml-[2px] h-[12px] w-[12px] text-text2`})]})]}),_(n,{className:`relative`,children:[k.map((e,t)=>{let{items:r}=e;return r?g(n,{ref:t===0?M:void 0,className:t>0?`mt-3`:``,children:g(u,{data:r})},`large-feature-grid-items-${t}`):null}),U&&g(n,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),U&&g(n,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:H},"aria-hidden":!0,children:g(i,{size:`large`,showLabel:!1,className:`text-theme5`})})]})]})}export{O as LargeFeatureGridClient};
2
+ "use client";import{isClient as e}from"../../../../utils/common.mjs";import{pContentBatchGetVideoDetail as t}from"../../../../service/generated/client.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import i from"../../../ui/loading.mjs";import a from"../../../ui/link.mjs";import{useSingleFirstRowHeight as o}from"../../../../hooks/use-first-row-height.mjs";import{useMinDurationLoading as s}from"../../../../hooks/use-min-duration-loading.mjs";import c from"../../../../assets/icons/common/right_arrow.mjs";import{isFeedAdItem as l}from"../advertisement/feed-ad/index.mjs";import{LargeGridItemClient as u}from"./card-item.mjs";import{largeFeatureGridInspectorDefaultProps as d}from"./schema.mjs";import{useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";const v=[],y=d.data??[];function b(e){return e==null}function x(e,t){return b(e)?t:e}function S(e){return typeof e==`string`?e.trim():``}function C(e){return S(e)}function w(e){let t=Number(e);if(!(!Number.isFinite(t)||t<0))return t}function T(e){let t=e,n=S(e.update_status)===`0`,r=(Array.isArray(t.episodes)?t.episodes.length:0)||(Array.isArray(e.video_episodes)?e.video_episodes.length:0)||(Array.isArray(e.links)?e.links.length:0)||(w(e.episode_cnt)??0);return!Number.isFinite(r)||r<=0?``:`${n?`更新至`:`全`}${Math.floor(r)}集`}function E(e,t){return t?{...e,...t,id:x(t.id,e.id),cover:x(t.cover,e.cover),title:x(t.title,e.title),desc:x(t.desc,e.desc),play_count:x(t.play_count,e.play_count),showPlayCount:t.showPlayCount??e.showPlayCount,episodeText:x(t.episodeText,e.episodeText),showEpisode:t.showEpisode??e.showEpisode,useContentCover:t.useContentCover??e.useContentCover,tagImageUrl:x(t.tagImageUrl,e.tagImageUrl)}:e}function D(e,t){if(!t)return e;let n=e.items;return{...e,...t,title:x(t.title,e.title),moreUrl:x(t.moreUrl,e.moreUrl),moreLinkType:t.moreLinkType??e.moreLinkType,items:n?E(n,t.items):t.items}}function O({mode:d=`renderer`,data:b=v}){let x=d===`editor`,S=b??v,E=Array.isArray(S)&&S.length>0,O=p(()=>E?[D(y[0],S[0])]:y,[E,S]),[k,A]=h(O),j=m(``),M=m(null),{isLoading:N,show:P,hide:F,cancel:I}=s(500);f(()=>{A(O)},[O]);let L=o({enabled:!x,containerRef:M,itemRef:M,deps:[k.length]}),R=p(()=>{if(x||!E)return``;let e=O.map(e=>C(e?.items?.id)).filter(Boolean);return Array.from(new Set(e)).join(`,`)},[E,x,O]);if(f(()=>{if(x||!e()||!R||j.current===R)return;j.current=R;let n=!1;async function r(){try{P();let e=await t({ids:R.split(`,`).filter(Boolean)},{cache:`no-store`}),r=Array.isArray(e.data?.videos)?e.data.videos:[],i=new Map;if(r.forEach(e=>{let t=C(e.video_id||e.id||e.mid);t&&i.set(t,e)}),n)return;A(e=>e.map(e=>{let t=e.items;if(!t||l(t))return e;let n=C(t.id),r=n?i.get(n):void 0;if(!r)return e;let a=w(r.play_count)??w(r.browse_count)??w(r.view_count),o=T(r);return{...e,items:{...t,play_count:a??t.play_count,episodeText:o||t.episodeText}}}))}catch(e){console.error(`大图推荐刷新首屏失败(client)`,e)}finally{n||F()}}return r(),()=>{n=!0,I()}},[I,R,F,x,P]),!k||k.length===0)return null;let z=k[0],B=z?.title,V=z?.moreUrl,H=L>0?L/2:160,U=!x&&N;return _(n,{className:x?`p-3 pointer-events-none`:`p-3`,children:[_(n,{className:`flex items-center justify-between mb-[10px] h-[24px]`,children:[B&&g(r,{as:`h2`,className:`text-[18px] font-bold text-text1 line-clamp-1 flex-1 min-w-0 mr-[12px]`,children:B}),V&&_(a,{href:V,className:`flex items-center text-[14px] text-text2 ml-auto`,children:[`更多`,g(c,{className:`ml-[2px] h-[12px] w-[12px] text-text2`})]})]}),_(n,{className:`relative`,children:[k.map((e,t)=>{let{items:r}=e;return r?g(n,{ref:t===0?M:void 0,className:t>0?`mt-3`:``,children:g(u,{data:r})},`large-feature-grid-items-${t}`):null}),U&&g(n,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),U&&g(n,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:H},"aria-hidden":!0,children:g(i,{size:`large`,showLabel:!1,className:`text-theme5`})})]})]})}export{O as LargeFeatureGridClient};
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({data:e.array(n.object({title:e.string(void 0,{label:`推荐位名称`,required:!1}),moreUrl:e.string(void 0,{label:`更多链接`,required:!1}),moreLinkType:e.string(`content-list`,{label:`更多链接类型`,required:!1}),items:e.object({id:e.string(void 0,{label:`内容ID`}),is_ad:e.boolean(!1,{fieldType:`switch`,label:`是否广告`,required:!1}),ad:e.object({ad_code:e.string(void 0,{label:`广告业务编码`,required:!1}),ad_advertise_url:e.string(void 0,{label:`广告跳转链接`,required:!1}),ad_advertise_icon:e.string(void 0,{label:`广告素材地址`,required:!1}),ad_advertise_type:e.number(void 0,{label:`广告类型`,required:!1}),ad_advertise_desc:e.string(void 0,{label:`广告文案描述`,required:!1}),ad_ext_data:e.string(void 0,{label:`广告扩展信息`,required:!1})},{label:`广告对象`,required:!1}),ad_advertise_url:e.string(void 0,{label:`广告跳转链接`,required:!1}),ad_advertise_icon:e.string(void 0,{label:`广告素材地址`,required:!1}),cover:e.string(void 0,{label:`封面`}),play_count:e.string(void 0,{label:`播放量`,required:!1}),showPlayCount:e.boolean(!0,{fieldType:`switch`,label:`展示播放量`,required:!1}),episodeText:e.string(void 0,{label:`集数文案`,required:!1}),showEpisode:e.boolean(!0,{fieldType:`switch`,label:`展示集数`,required:!1}),useContentCover:e.boolean(!0,{fieldType:`switch`,label:`沿用内容海报`,required:!1}),title:e.string(void 0,{label:`内容标题`}),desc:e.string(void 0,{label:`内容简介`,required:!1}),tagImageUrl:e.string(void 0,{label:`角标图`,required:!1})})}),{label:`大图推荐数据`,required:!1,defaultValue:[{title:`推荐位名称`,moreUrl:`/channel`,moreLinkType:`content-list`,items:{id:`22edc8693ebbdaf1`,cover:`https://base-resources.guadd.fun/md-204/dcc-file/f7/f70a9f9f0c17aa9aff6c3a3e03a822db-small.jpg`,play_count:`11111`,showPlayCount:!0,episodeText:`连载中`,showEpisode:!0,useContentCover:!0,title:`穷小伙一睁眼穿越古代,娶个老婆就能得到奖励,后宫3000宠都宠不过来!谁料女帝主动送上门来,征服女帝可以直接开终极宝箱,不用选择全都可以!`,desc:`穷小伙一睁眼穿越古代,娶个老婆就能得到奖励,后宫3000宠都宠不过来!谁料女帝主动送上门来,征服女帝可以直接开终极宝箱,不用选择全都可以!`}}]})})),i=t(r);export{i as largeFeatureGridInspectorDefaultProps,r as largeFeatureGridInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({data:e.array(n.object({title:e.string(void 0,{label:`推荐位名称`,required:!1}),moreUrl:e.string(void 0,{label:`更多链接`,required:!1}),moreLinkType:e.string(`content-list`,{label:`更多链接类型`,required:!1}),items:e.object({id:e.string(void 0,{label:`内容ID`}),is_ad:e.boolean(!1,{fieldType:`switch`,label:`是否广告`,required:!1}),ad_advertise_url:e.string(void 0,{label:`广告跳转链接`,required:!1}),ad_advertise_icon:e.string(void 0,{label:`广告素材地址`,required:!1}),cover:e.string(void 0,{label:`封面`}),play_count:e.string(void 0,{label:`播放量`,required:!1}),showPlayCount:e.boolean(!0,{fieldType:`switch`,label:`展示播放量`,required:!1}),episodeText:e.string(void 0,{label:`集数文案`,required:!1}),showEpisode:e.boolean(!0,{fieldType:`switch`,label:`展示集数`,required:!1}),useContentCover:e.boolean(!0,{fieldType:`switch`,label:`沿用内容海报`,required:!1}),title:e.string(void 0,{label:`内容标题`}),desc:e.string(void 0,{label:`内容简介`,required:!1}),tagImageUrl:e.string(void 0,{label:`角标图`,required:!1})})}),{label:`大图推荐数据`,required:!1,defaultValue:[{title:`推荐位名称`,moreUrl:`/channel`,moreLinkType:`content-list`,items:{id:`22edc8693ebbdaf1`,cover:`https://base-resources.guadd.fun/md-204/dcc-file/f7/f70a9f9f0c17aa9aff6c3a3e03a822db-small.jpg`,play_count:`11111`,showPlayCount:!0,episodeText:`连载中`,showEpisode:!0,useContentCover:!0,title:`穷小伙一睁眼穿越古代,娶个老婆就能得到奖励,后宫3000宠都宠不过来!谁料女帝主动送上门来,征服女帝可以直接开终极宝箱,不用选择全都可以!`,desc:`穷小伙一睁眼穿越古代,娶个老婆就能得到奖励,后宫3000宠都宠不过来!谁料女帝主动送上门来,征服女帝可以直接开终极宝箱,不用选择全都可以!`}}]})})),i=t(r);export{i as largeFeatureGridInspectorDefaultProps,r as largeFeatureGridInspectorPropsSchema};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useRouter as e}from"../../../../utils/use-compatible-router.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import i from"../../../../assets/icons/marquee-enter.mjs";import a from"../../../../assets/images/marquee.mjs";import o from"./marquee.module.mjs";import{defaultMarqueePeriod as s}from"./schema.mjs";import{useEffect as c,useMemo as l,useRef as u,useState as d}from"react";import{X as f}from"lucide-react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{useTranslations as h}from"next-intl";const g=[],_=`marquee_list`;let v=null;function y(e,t=20){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t).join(``)}...`}function b(e,t){if(!e)return!1;if(t===`once`)return!0;let n=new Date(e),r=new Date;return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function x(){if(v)return v;let e=localStorage.getItem(_);if(!e)return v={},{};try{let t=JSON.parse(e);if(!t||typeof t!=`object`)return{};let n={};return Object.entries(t).forEach(([e,t])=>{if(!t||typeof t!=`object`)return;let r=t.closedAt;typeof r!=`number`||Number.isNaN(r)||(n[e]={closedAt:r})}),v=n,n}catch{return v={},{}}}function S(e){v=e,localStorage.setItem(_,JSON.stringify(e))}function C(e){return x()[e]??{}}function w(e,t){S({...x(),[e]:t})}function T(e,t){return b(e.closedAt,t)}function E(_){let v=h(`components.biz.business.marquee`),{marqueeKey:b,contents:x=g,click:S,close:E,displayStrategy:D,mode:O=`renderer`}=_,k=O===`editor`,A=e(),j=u(!1),[M,N]=d(k),[P,F]=d(k),[I,L]=d(!1),[R,z]=d(0);c(()=>{L(!0)},[]);let B=l(()=>{let e=D?.period??s,t=e.start,n=e.end;if(!t&&!n)return!0;let r=Date.now(),i=t?new Date(t).getTime():0,a=n?new Date(n).getTime():2**53-1;return r>=i&&r<=a},[D?.period]),V=l(()=>(x??[]).map(e=>({...e,text:y(String(e?.text??``))})).filter(e=>!!e.text),[x]),H=b?.trim()??``;if(c(()=>{z(0)},[l(()=>V.map(e=>`${e.text??``}::${e.link??``}`).join(`|`),[V]),H]),c(()=>{k||H||j.current||process.env.NODE_ENV===`production`||(j.current=!0,console.warn(`[MarqueeClient] marqueeKey is required in renderer mode.`))},[k,H]),c(()=>{if(I){if(k){N(!0),F(!0);return}if(!D?.rule||!B||V.length===0){N(!1),F(!0);return}if(!H){N(!1),F(!0);return}N(!T(C(H),D.rule)),F(!0)}},[D?.rule,k,I,B,V.length,H]),!k&&(!I||!P||!M||!B)||V.length===0)return null;let U=V[R%V.length],W=S?.enabled===!0,G=S?.link||U.link,K=W&&!!G,q=E?.enabled===!0;function J(){!H||!D?.rule||V.length===0||w(H,{...C(H),closedAt:Date.now()})}let Y=e=>{e.stopPropagation(),N(!1),J()};function X(e){if(typeof window>`u`){A.push(e);return}if(window.isWebView===!0)try{let t=new URL(e,window.location.href);if(t.origin===window.location.origin){let e=t.pathname.split(`/`).filter(Boolean),n=e.findIndex(e=>e===`video`);n>=0&&(e[n]=`webview`,t.pathname=`/${e.join(`/`)}`)}window.location.href=t.toString();return}catch{window.location.href=e;return}A.push(e)}function Z(){k||K&&G&&(N(!1),J(),X(G))}let Q=()=>{k||!M||V.length<=1||z(e=>(e+1)%V.length)},$=k?o[`marquee-item-paused`]:V.length>1?o[`marquee-item-once`]:o[`marquee-item-loop`];return p(n,{className:k?`px-3 py-2 w-full bg-bg1 pointer-events-none`:`px-3 py-2 w-full bg-bg1`,children:m(n,{className:`pl-[2px] pr-[12px] py-[2px] flex items-center w-full cursor-pointer relative rounded-[8px] overflow-hidden ${o[`marquee-shell`]}`,onClick:Z,children:[p(n,{className:`relative shrink-0 w-[36px] h-[36px] mr-[4px]`,children:p(t,{src:typeof a==`string`?a:a.src,alt:v(`noticeAlt`),fill:!0,className:`object-cover`,unoptimized:!0})}),p(n,{className:`flex-1 overflow-hidden relative h-[22px] ml-1`,children:p(n,{className:`absolute inset-y-0 left-0 flex items-center whitespace-nowrap ${$}`,onAnimationEnd:Q,children:p(r,{className:`inline-block text-[14px] text-[#f59e0b] leading-[22px] font-medium`,children:U.text})},`marquee-item-${R}`)}),m(n,{className:`flex items-center gap-[12px] shrink-0 ml-[4px]`,children:[K&&p(i,{className:`h-[16px] w-[16px] shrink-0`}),q&&p(n,{className:`opacity-30 hover:opacity-100 transition-opacity`,onClick:Y,children:p(f,{className:`w-[12px] h-[12px] text-[#F59E0B]`})})]})]})})}export{E as MarqueeClient};
2
+ "use client";import{useRouter as e}from"../../../../utils/use-compatible-router.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../../assets/icons/marquee-close.mjs";import i from"../../../../assets/icons/marquee-speaker.mjs";import a from"./marquee.module.mjs";import{defaultMarqueePeriod as o}from"./schema.mjs";import{useEffect as s,useMemo as c,useRef as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";const p=[],m=`marquee_list`;let h=null;function g(e,t=20){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t).join(``)}...`}function _(e,t){if(!e)return!1;if(t===`once`)return!0;let n=new Date(e),r=new Date;return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function v(){if(h)return h;let e=localStorage.getItem(m);if(!e)return h={},{};try{let t=JSON.parse(e);if(!t||typeof t!=`object`)return{};let n={};return Object.entries(t).forEach(([e,t])=>{if(!t||typeof t!=`object`)return;let r=t.closedAt;typeof r!=`number`||Number.isNaN(r)||(n[e]={closedAt:r})}),h=n,n}catch{return h={},{}}}function y(e){h=e,localStorage.setItem(m,JSON.stringify(e))}function b(e){return v()[e]??{}}function x(e,t){y({...v(),[e]:t})}function S(e,t){return _(e.closedAt,t)}function C(m){let{marqueeKey:h,contents:_=p,click:v,close:y,displayStrategy:C,mode:w=`renderer`}=m,T=w===`editor`,E=e(),D=l(!1),[O,k]=u(T),[A,j]=u(T),[M,N]=u(!1),[P,F]=u(0);s(()=>{N(!0)},[]);let I=c(()=>{let e=C?.period??o,t=e.start,n=e.end;if(!t&&!n)return!0;let r=Date.now(),i=t?new Date(t).getTime():0,a=n?new Date(n).getTime():2**53-1;return r>=i&&r<=a},[C?.period]),L=c(()=>(_??[]).map(e=>({...e,text:g(String(e?.text??``))})).filter(e=>!!e.text),[_]),R=h?.trim()??``;if(s(()=>{F(0)},[c(()=>L.map(e=>`${e.text??``}::${e.link??``}`).join(`|`),[L]),R]),s(()=>{T||R||D.current||process.env.NODE_ENV===`production`||(D.current=!0,console.warn(`[MarqueeClient] marqueeKey is required in renderer mode.`))},[T,R]),s(()=>{if(M){if(T){k(!0),j(!0);return}if(!C?.rule||!I||L.length===0){k(!1),j(!0);return}if(!R){k(!1),j(!0);return}k(!S(b(R),C.rule)),j(!0)}},[C?.rule,T,M,I,L.length,R]),!T&&(!M||!A||!O||!I)||L.length===0)return null;let z=L[P%L.length],B=v?.enabled===!0,V=v?.link||z.link,H=B&&!!V,U=y?.enabled===!0;function W(){!R||!C?.rule||L.length===0||x(R,{...b(R),closedAt:Date.now()})}let G=e=>{e.stopPropagation(),k(!1),W()};function K(e){if(typeof window>`u`){E.push(e);return}if(window.isWebView===!0)try{let t=new URL(e,window.location.href);if(t.origin===window.location.origin){let e=t.pathname.split(`/`).filter(Boolean),n=e.findIndex(e=>e===`video`);n>=0&&(e[n]=`webview`,t.pathname=`/${e.join(`/`)}`)}window.location.href=t.toString();return}catch{window.location.href=e;return}E.push(e)}function q(){T||H&&V&&(k(!1),W(),K(V))}let J=()=>{T||!O||L.length<=1||F(e=>(e+1)%L.length)},Y=T?a[`marquee-item-paused`]:L.length>1?a[`marquee-item-once`]:a[`marquee-item-loop`],X=U?d(`button`,{type:`button`,"aria-label":`关闭`,className:`flex size-6 shrink-0 items-center justify-center overflow-hidden p-0.5`,onClick:G,children:d(r,{className:`h-5 w-5`,"aria-hidden":!0})}):d(t,{className:`flex size-6 shrink-0 items-center justify-center overflow-hidden p-0.5`,"aria-hidden":!0});return f(t,{className:`grid h-8 w-full grid-cols-[20px_1fr_24px] items-center gap-2 bg-white/10 px-4 py-1 backdrop-blur-[2px] ${H?`cursor-pointer`:``} ${T?`pointer-events-none`:``}`,onClick:q,children:[d(i,{className:`h-5 w-5 shrink-0`,"aria-hidden":!0}),d(t,{className:`relative h-5 min-w-0 w-full overflow-hidden`,children:d(t,{className:`absolute inset-y-0 left-0 flex items-center whitespace-nowrap ${Y}`,onAnimationEnd:J,children:d(n,{className:`inline-block font-sans text-[14px] font-normal leading-[20px] not-italic text-white/90`,children:z.text})},`marquee-item-${P}`)}),X]})}export{C as MarqueeClient};
@@ -1,9 +1,5 @@
1
1
 
2
- import e from"../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs";var t=`.marquee-module_marquee-shell__UrSDr {
3
- background-image: linear-gradient(154deg, rgba(255, 228, 133, 0.2) 9.14%, rgba(207, 129, 37, 0.05) 90.86%);
4
- }
5
-
6
- .marquee-module_marquee-item-loop__xI-aW {
2
+ import e from"../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs";var t=`.marquee-module_marquee-item-loop__xI-aW {
7
3
  animation: marquee-module_funhub-marquee-run__evIQh 12s linear infinite;
8
4
  }
9
5
 
@@ -25,4 +21,4 @@ import e from"../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/sty
25
21
  transform: translateX(-100%);
26
22
  }
27
23
  }
28
- `,n={"marquee-shell":`marquee-module_marquee-shell__UrSDr`,"marquee-item-loop":`marquee-module_marquee-item-loop__xI-aW`,"funhub-marquee-run":`marquee-module_funhub-marquee-run__evIQh`,"marquee-item-once":`marquee-module_marquee-item-once__KFzcv`,"marquee-item-paused":`marquee-module_marquee-item-paused__edGch`};e(t);export{n as default};
24
+ `,n={"marquee-item-loop":`marquee-module_marquee-item-loop__xI-aW`,"funhub-marquee-run":`marquee-module_funhub-marquee-run__evIQh`,"marquee-item-once":`marquee-module_marquee-item-once__KFzcv`,"marquee-item-paused":`marquee-module_marquee-item-paused__edGch`};e(t);export{n as default};
@@ -19,7 +19,7 @@ declare const marqueeMaterial: DefineMaterialOption<typeof MarqueeServer, typeof
19
19
  }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
20
20
  readonly click: zod.ZodObject<{
21
21
  readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
22
- readonly redirectType: zod.ZodOptional<zod.ZodType<"link" | "content" | "content_list", unknown, zod_v4_core0.$ZodTypeInternals<"link" | "content" | "content_list", unknown>>> & SchemaHasDefaultValue;
22
+ readonly redirectType: zod.ZodOptional<zod.ZodType<"content" | "link" | "content_list", unknown, zod_v4_core0.$ZodTypeInternals<"content" | "link" | "content_list", unknown>>> & SchemaHasDefaultValue;
23
23
  readonly link: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
24
24
  }, zod_v4_core0.$strip> & SchemaHasDefaultValue;
25
25
  readonly close: zod.ZodObject<{
@@ -24,7 +24,7 @@ declare const marqueeInspectorPropsSchema: zod.ZodObject<{
24
24
  }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
25
25
  readonly click: zod.ZodObject<{
26
26
  readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
27
- readonly redirectType: zod.ZodOptional<zod.ZodType<"link" | "content" | "content_list", unknown, zod_v4_core0.$ZodTypeInternals<"link" | "content" | "content_list", unknown>>> & SchemaHasDefaultValue;
27
+ readonly redirectType: zod.ZodOptional<zod.ZodType<"content" | "link" | "content_list", unknown, zod_v4_core0.$ZodTypeInternals<"content" | "link" | "content_list", unknown>>> & SchemaHasDefaultValue;
28
28
  readonly link: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
29
29
  }, zod_v4_core0.$strip> & SchemaHasDefaultValue;
30
30
  readonly close: zod.ZodObject<{
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{mergeStyles as e}from"../../../../../utils/styles/helpers.mjs";import{pxToVw as t}from"../../../../../../../utils/helper.mjs";import{Box as n}from"../../../../../../ui/box.mjs";import r from"../../../../../../ui/link.mjs";import{urlPrefix as i}from"../../../../../../../constants/url-prefix.mjs";import{useSticky as a}from"../../../../../../../hooks/use-sticky.mjs";import o from"../../../../../../../assets/icons/search.mjs";import s,{loadHiddenChannelIdsFromStorage as c}from"./channel-filter-dialog.mjs";import{defaultProps as l}from"../defaults/default-props.mjs";import u from"../../../../../../../assets/icons/filter_dark.mjs";import{clsx as d}from"clsx";import{useEffect as f,useMemo as p,useState as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";const v={},y={list:[],currentChannelId:null,isFullfeed:!1};function b(e,t){return t===0?`/`:`${i.CHANNEL}/${encodeURIComponent(e.cn_name)}`}function x({props:i=v,styles:x,events:S,data:C=y}){let{searchUrl:w,searchIconSize:T,filterIconSize:E,channelItemHeight:D,channelItemFontSize:O,channelItemActiveFontSize:k,channelItemGap:A}={...l,...i},[j,M]=m(!1),{isSticky:N,ref:P}=a(),[F,I]=m(C.list),L=p(()=>C.currentChannelId??null,[C.currentChannelId]);f(()=>{let e=c();I(C.list.filter(t=>!e.includes(t.id)))},[C.list]);let R=e=>{I(e)},z=(e,t)=>{S?.onChannelChange?.(e,t)},B=()=>{M(!0),S?.onFilterClick?.()},V=()=>{S?.onSearchClick?.()},H=x?e(x,{}):void 0,U=N?E+T+24:E+16;return _(h,{children:[N&&g(n,{className:`w-full`,style:{height:t(44)}}),g(n,{as:`nav`,ref:P,className:d(`w-full transition-all duration-200`,!C.isFullfeed&&N&&`fixed top-0 left-0 right-0 z-50`,C.isFullfeed&&`fixed top-[54px] left-0 z-10 w-full`,!C.isFullfeed&&`bg-bg1`),style:H,children:_(n,{className:`relative flex items-center h-[44px]`,children:[g(n,{className:`flex-1 overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:g(n,{className:`flex items-center h-full`,style:{paddingLeft:t(16),paddingRight:t(U+16),gap:t(A)},children:F.map((e,n)=>{let i=L===e.id||L===null&&n===0;return g(r,{href:b(e,n),className:d(`whitespace-nowrap cursor-pointer transition-all duration-200`,`flex items-center justify-center`),style:{height:t(D),fontSize:t(i?k:O),fontWeight:i?`bold`:`normal`,color:i?`var(--color-theme5)`:`var(--color-text2)`},onClick:()=>z(e,n),children:e.cn_name},e.id||`channel-${n}`)})})}),_(n,{className:`flex items-center gap-[12px] px-[8px]`,children:[g(n,{className:`flex items-center justify-center cursor-pointer`,style:{width:t(E+8),height:t(E+8)},onClick:B,children:g(u,{width:t(E),height:t(E),style:{color:`var(--color-text1)`}})}),N&&g(r,{href:w,onClick:V,children:g(n,{className:`flex items-center justify-center cursor-pointer`,style:{width:t(T+8),height:t(T+8)},children:g(o,{width:t(T),height:t(T),style:{color:`var(--color-text1)`}})})})]})]})}),g(s,{open:j,onOpenChange:M,channels:C.list,currentChannelId:L,onChannelClick:z,onChannelsChange:R})]})}export{x as default};
2
+ "use client";import{mergeStyles as e}from"../../../../../utils/styles/helpers.mjs";import{pxToVw as t}from"../../../../../../../utils/helper.mjs";import{Box as n}from"../../../../../../ui/box.mjs";import r from"../../../../../../ui/link.mjs";import{urlPrefix as i}from"../../../../../../../constants/url-prefix.mjs";import{useSticky as a}from"../../../../../../../hooks/use-sticky.mjs";import o from"../../../../../../../assets/icons/search.mjs";import s,{loadHiddenChannelIdsFromStorage as c}from"./channel-filter-dialog.mjs";import{defaultProps as l}from"../defaults/default-props.mjs";import u from"../../../../../../../assets/icons/filter_dark.mjs";import{clsx as d}from"clsx";import{useEffect as f,useMemo as p,useState as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";const v={},y={list:[],currentChannelId:null,isFullfeed:!1};function b(e,t){return t===0?`/`:`${i.CHANNEL}/${encodeURIComponent(e.cn_name)}`}function x({props:i=v,styles:x,events:S,data:C=y}){let{searchUrl:w,searchIconSize:T,filterIconSize:E,channelItemHeight:D,channelItemFontSize:O,channelItemActiveFontSize:k,channelItemGap:A}={...l,...i},[j,M]=m(!1),{isSticky:N,ref:P}=a(),[F,I]=m(C.list),L=p(()=>C.currentChannelId??null,[C.currentChannelId]);f(()=>{let e=c();I(C.list.filter(t=>!e.includes(t.id)))},[C.list]);let R=e=>{I(e)},z=(e,t)=>{S?.onChannelChange?.(e,t)},B=()=>{M(!0),S?.onFilterClick?.()},V=()=>{S?.onSearchClick?.()},H=x?e(x,{}):void 0,U=N?E+T+24:E+16;return _(h,{children:[N&&g(n,{className:`w-full`,style:{height:t(44)}}),g(n,{as:`nav`,ref:P,className:d(`w-full bg-transparent transition-all duration-200`,!C.isFullfeed&&N&&`fixed top-0 left-0 right-0 z-50`,C.isFullfeed&&`fixed top-[54px] left-0 z-10 w-full`),style:H,children:_(n,{className:`relative flex items-center h-[44px]`,children:[g(n,{className:`flex-1 overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:g(n,{className:`flex items-center h-full`,style:{paddingLeft:t(16),paddingRight:t(U+16),gap:t(A)},children:F.map((e,n)=>{let i=L===e.id||L===null&&n===0;return g(r,{href:b(e,n),className:d(`whitespace-nowrap cursor-pointer transition-all duration-200`,`flex items-center justify-center`),style:{height:t(D),fontSize:t(i?k:O),fontWeight:i?`bold`:`normal`,color:i?`var(--color-theme5)`:`var(--color-text2)`},onClick:()=>z(e,n),children:e.cn_name},e.id||`channel-${n}`)})})}),_(n,{className:`flex items-center gap-[12px] px-[8px]`,children:[g(n,{className:`flex items-center justify-center cursor-pointer`,style:{width:t(E+8),height:t(E+8)},onClick:B,children:g(u,{width:t(E),height:t(E),style:{color:`var(--color-text1)`}})}),N&&g(r,{href:w,onClick:V,children:g(n,{className:`flex items-center justify-center cursor-pointer`,style:{width:t(T+8),height:t(T+8)},children:g(o,{width:t(T),height:t(T),style:{color:`var(--color-text1)`}})})})]})]})}),g(s,{open:j,onOpenChange:M,channels:C.list,currentChannelId:L,onChannelClick:z,onChannelsChange:R})]})}export{x as default};
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { ProfileHeaderInspectorProps, UserProfileHeaderAuthConfig, UserProfileHeaderClientProps, profileHeaderInspectorDefaultProps, profileHeaderInspectorPropsSchema } from "./profile-header/schema.mjs";
3
- import { UserProfileHeaderClient } from "./profile-header/client.mjs";
3
+ import { UserProfileHeaderClient, defaultBackground } from "./profile-header/client.mjs";
4
4
  import { profileHeaderMaterial, profileHeaderMaterialWithDisabledBackground } from "./profile-header/material.mjs";
5
5
  import "./profile-header/index.mjs";
6
6
  import { ProfileMainInspectorProps, UserProfileMainProps, profileMainInspectorDefaultProps, profileMainInspectorPropsSchema } from "./profile-main/schema.mjs";
@@ -3,6 +3,7 @@ import { UserProfileHeaderClientProps } from "./schema.mjs";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
5
5
  //#region components/biz/business/profile/profile-header/client.d.ts
6
+ declare const defaultBackground = "/images/mine/img_mine_head_bg.png";
6
7
  /**
7
8
  * 用户资料头部组件,包含资料请求与头部交互。
8
9
  */
@@ -16,4 +17,4 @@ declare function UserProfileHeaderClient({
16
17
  mode
17
18
  }: UserProfileHeaderClientProps): react_jsx_runtime0.JSX.Element;
18
19
  //#endregion
19
- export { UserProfileHeaderClient };
20
+ export { UserProfileHeaderClient, defaultBackground };
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{gUserGetUserInfo as r,gUserViewUserInfo as i}from"../../../../../service/generated/client.mjs";import{useRouter as a}from"../../../../../utils/use-compatible-router.mjs";import{Box as o}from"../../../../ui/box.mjs";import{Text as s}from"../../../../ui/text.mjs";import{Skeleton as c}from"../../../../ui/skeleton.mjs";import{useLoginModalStore as l}from"../../../../../store/modules/login-modal-store.mjs";import{useRequest as u}from"../../../../../hooks/query/use-query.mjs";import{LeftArrowIcon as d}from"../../../../common/icons/left-arrow.mjs";import{SettingIcon as f}from"../../../../common/icons/setting.mjs";import{UserProfileAvatar as p}from"./user-profile-avatar.mjs";import{UserProfileCoverBackground as m}from"./user-profile-cover-background.mjs";import{useEffect as ee,useMemo as te,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useTranslations as v}from"next-intl";import y from"next/link";const b=n.persist,x=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,S=`/images/mine/img_mine_head_bg.png`;function C({showBackButton:n,isMine:r,enableCustomBackground:i,className:a}){return _(o,{className:e(`flex flex-col relative`,a),children:[_(o,{className:`absolute top-0 p-3 z-10 flex items-center justify-between w-full`,children:[g(t,{variant:`ghost`,size:`icon-xs`,className:e(`h-4 w-4 p-0 hover:bg-transparent`,{invisible:!n}),disabled:!0,children:g(d,{className:`w-4 h-4`})}),g(o,{className:e({invisible:!r}),children:g(f,{})})]}),g(o,{className:i?`h-33.75`:`h-24`,children:g(c,{className:`h-full w-full rounded-none`})}),_(o,{className:`flex-1 px-3`,children:[_(o,{className:`relative flex justify-end`,children:[g(c,{className:`absolute bottom-3 left-0 h-22 w-22 rounded-full`}),g(o,{className:`py-4 h-12`})]}),_(o,{className:`flex items-center justify-between gap-1`,children:[g(c,{className:`h-7 w-[132px]`}),g(c,{className:`h-10 w-[104px] rounded-full shrink-0`})]}),_(o,{className:`min-h-11 pt-1 pb-0 flex flex-col gap-2`,children:[g(c,{className:`h-4 w-[76%]`}),g(c,{className:`h-4 w-[58%]`})]})]})]})}function w({id:c,enableCustomBackground:w=!0,showBackButton:T=!0,requireLogin:E=!1,isEditorPreview:D=!1,className:O,mode:k=`renderer`}){let A=v(`components.pages.profile`),j=D||k===`editor`,M=!j,N=a(),{open:ne}=l(),{isLogin:P,userId:F,token:re}=n(),[ie,I]=h(!1);ee(()=>{if(!b){I(!0);return}I(b.hasHydrated());let e=b.onHydrate(()=>{I(!1)}),t=b.onFinishHydration(()=>{I(!0)});return()=>{e(),t()}},[]);let L=j?!1:P&&!!F&&!!re,R=j?``:F,z=R,B=c==null||!!c&&!!z&&c===z,V=B?[`user-profile`,`mine`]:[`user-profile`,`profile`,c],{data:H,isLoading:U}=u(j?[`editor-preview`,...V]:V,()=>c?i({target_user_id:c,user_id:R||c}):r({user_id:c||R||``}),{staleTime:0,enabled:M&&(!!c||!!R)}),W=te(()=>{let e=H?H.data:void 0;return e?{userId:e.user_id,isFollowing:e.is_following||!1,name:e.nick_name||`User${c??``}`,avatar:e.avatar||x,followingCnt:e.following_count??0,followersCnt:e.follower_count??0,likeCnt:e.like_count??0,signature:e.signature||``,background:e.bg_image||S}:{}},[c,H]),G=j||E&&B&&!L,K=B&&L&&!G,q=!L,J=w&&K,Y=w&&q,ae={name:A(`client.welcomeToPlanet`),description:A(`client.exploreAdventures`),avatar:x,followingCnt:0,followersCnt:0,likeCnt:0,background:S};function X(){ne()}function oe(){N.back()}let se=G?g(t,{className:`rounded-full`,size:`lg`,onClick:X,children:A(`client.loginNow`)}):B?g(y,{href:`/edit`,children:g(t,{variant:`outline`,className:`rounded-full`,children:A(`client.editProfile`)})}):null,Z=G?ae:W,Q=Z.name||``,$=Z.description||Z.signature||``,ce=Z.avatar||``;return M&&U&&!H?g(C,{showBackButton:T,isMine:B,enableCustomBackground:w,className:O}):_(o,{className:e(`flex flex-col relative`,O),children:[_(o,{className:`absolute top-0 p-3 z-10 flex items-center justify-between w-full`,children:[g(t,{variant:`ghost`,size:`icon-xs`,onClick:oe,className:e(`h-4 w-4 p-0 hover:bg-transparent`,{invisible:!T}),children:g(d,{className:`w-4 h-4`})}),g(y,{href:`/settings`,className:e({invisible:!B}),children:g(f,{})})]}),g(m,{isMine:J,enableCustomBackground:w,src:Z.background,onUnauthorizedClick:Y?X:void 0}),_(o,{className:`flex-1 px-3`,children:[_(o,{className:`relative flex justify-end`,children:[g(p,{isMine:K,src:ce,alt:Q||`avatar`,onUnauthorizedClick:q?X:void 0}),g(o,{className:`flex divide-x divide-text1/5 py-4 h-12`})]}),_(o,{className:`flex items-center justify-between gap-1`,children:[P&&B?g(y,{href:`/edit`,children:g(s,{as:`p`,className:`text-text1 max-w-[14em] text-xl overflow-hidden whitespace-nowrap text-ellipsis font-bold `,children:Q})}):g(s,{as:`p`,className:`text-text1 max-w-[14em] text-xl overflow-hidden whitespace-nowrap text-ellipsis font-bold `,children:Q}),se]}),$&&g(o,{className:`min-h-11 pt-1 pb-0`,children:g(s,{as:`p`,className:`text-sm line-clamp-2 break-all text-text1/66`,children:$})})]})]})}export{w as UserProfileHeaderClient};
2
+ "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{gUserGetUserInfo as r,gUserViewUserInfo as i,pInteractionFollow as a,pInteractionUnfollow as o}from"../../../../../service/generated/client.mjs";import{useRouter as s}from"../../../../../utils/use-compatible-router.mjs";import{Box as c}from"../../../../ui/box.mjs";import{Text as l}from"../../../../ui/text.mjs";import{Skeleton as u}from"../../../../ui/skeleton.mjs";import{toast as d}from"../../../../../ui.mjs";import{useLoginModalStore as f}from"../../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as p,useMutation as m,useRequest as h,useUpdateRequest as g}from"../../../../../hooks/query/use-query.mjs";import{LeftArrowIcon as _}from"../../../../common/icons/left-arrow.mjs";import{SettingIcon as v}from"../../../../common/icons/setting.mjs";import{UserProfileAvatar as y}from"./user-profile-avatar.mjs";import{UserProfileCoverBackground as b}from"./user-profile-cover-background.mjs";import{useEffect as x,useMemo as S,useState as ee}from"react";import{Check as C,Plus as w}from"lucide-react";import{jsx as T,jsxs as E}from"react/jsx-runtime";import{useTranslations as D}from"next-intl";import O from"next/link";const k=n.persist,A=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,j=`/images/mine/img_mine_head_bg.png`;function te({showBackButton:n,isMine:r,enableCustomBackground:i,className:a}){return E(c,{className:e(`relative overflow-hidden px-4 pb-8 pt-[16px]`,a),children:[T(c,{className:e(`pointer-events-none absolute inset-x-0 top-0 h-[220px]`,i?`bg-[image:var(--gradient-card-mask-strong)]`:`bg-[linear-gradient(180deg,var(--color-overlay-mask-start)_0%,var(--color-overlay-mask-end80)_100%)]`)}),E(c,{className:`absolute left-4 right-4 top-[16px] z-10 flex items-center justify-between`,children:[T(t,{variant:`ghost`,size:`icon-xs`,className:e(`h-4 w-4 p-0 hover:bg-transparent`,{invisible:!n}),disabled:!0,children:T(_,{className:`w-4 h-4`})}),T(c,{className:e({invisible:!r}),children:T(v,{className:`text-text1`})})]}),E(c,{className:`relative z-10 mt-[56px] flex items-start gap-4`,children:[T(u,{className:`h-[72px] w-[72px] shrink-0 rounded-full bg-[var(--color-surface-white10)]`}),E(c,{className:`min-w-0 flex-1`,children:[T(u,{className:`h-[26px] w-[132px] rounded-md bg-[var(--color-surface-white10)]`}),E(c,{className:`mt-1 flex flex-col gap-1`,children:[T(u,{className:`h-[20px] w-[76%] rounded-md bg-[var(--color-surface-white10)]`}),T(u,{className:`h-[20px] w-[58%] rounded-md bg-[var(--color-surface-white10)]`})]})]})]})]})}function ne({userId:n,currentUserId:r,isFollowing:i}){let s=D(`components.pages.profile`),{open:c}=f(),l=p(),u=g(),{mutateAsync:h,isPending:_}=m(async e=>a(e)),{mutateAsync:v,isPending:y}=m(async e=>o(e)),b=_||y;async function x(){if(!b){if(!r){c();return}try{if(i){let e=await v({app_id:0,follower_id:r,followee_id:n});e.code===0?(d.success(s(`client.unfollowSuccess`)),S(!1),l([`check-follow`,n]),l([`user-profile`,`profile`,n])):d.error(e.message||s(`client.unfollowFailed`))}else{let e=await h({app_id:0,follower_id:r,followee_id:n});e.code===0?(d.success(s(`client.followSuccess`)),S(!0),l([`check-follow`,n]),l([`user-profile`,`profile`,n])):d.error(e.message||s(`client.followFailed`))}}catch(e){console.error(`关注操作失败`,e),d.error(s(`client.operationFailed`))}}}function S(e){u([`user-profile`,`profile`,n],t=>!t||!t.data?t:{...t,data:{...t.data,is_following:e}})}return E(t,{type:`button`,variant:`ghost`,size:`xs`,className:e(`h-6 min-w-0 gap-1 rounded-full border px-2 py-0 text-[14px] font-normal leading-5 shadow-none`,`disabled:pointer-events-none disabled:opacity-100`,i?`border-[var(--color-text-tertiary)] bg-transparent text-[var(--color-text-tertiary)] hover:!bg-[var(--color-surface-white10)] hover:!text-[var(--color-text-tertiary)]`:`border-[var(--color-text-secondary)] bg-[var(--color-overlay-create-top-black50)] text-[var(--color-text-secondary)] backdrop-blur-[2px] hover:!bg-[var(--color-overlay-create-top-black50)] hover:!text-[var(--color-text-secondary)]`),onClick:x,disabled:b,children:[T(i?C:w,{className:`size-[14px]`}),s(b?`client.processing`:i?`client.followed`:`client.follow`)]})}function M({id:a,enableCustomBackground:o=!0,showBackButton:u=!0,requireLogin:d=!1,isEditorPreview:p=!1,className:m,mode:g=`renderer`}){let C=D(`components.pages.profile`),w=p||g===`editor`,M=!w,N=s(),{open:P}=f(),{isLogin:F,userId:I,token:L}=n(),[re,R]=ee(!1);x(()=>{if(!k){R(!0);return}R(k.hasHydrated());let e=k.onHydrate(()=>{R(!1)}),t=k.onFinishHydration(()=>{R(!0)});return()=>{e(),t()}},[]);let z=w?!1:F&&!!I&&!!L,B=w?``:I,V=B,H=a==null||!!a&&!!V&&a===V,U=H?[`user-profile`,`mine`]:[`user-profile`,`profile`,a],{data:W,isLoading:ie}=h(w?[`editor-preview`,...U]:U,()=>a?i({target_user_id:a,user_id:B||a}):r({user_id:a||B||``}),{staleTime:0,enabled:M&&(!!a||!!B)}),G=S(()=>{let e=W?W.data:void 0;return e?{userId:e.user_id,isFollowing:e.is_following||!1,name:e.nick_name||`User${a??``}`,avatar:e.avatar||A,followingCnt:e.following_count??0,followersCnt:e.follower_count??0,likeCnt:e.like_count??0,signature:e.signature||``,background:e.bg_image||j}:{}},[a,W]),K=w||d&&H&&!z,q=H&&z&&!K,J=!z,ae=o&&q,oe=o&&J,se={name:C(`client.welcomeToPlanet`),description:C(`client.exploreAdventures`),avatar:A,followingCnt:0,followersCnt:0,likeCnt:0,background:j};function Y(){P()}function ce(){N.back()}let X=K?null:H?z?T(O,{href:`/edit`,children:T(t,{variant:`ghost`,className:`h-auto min-h-0 rounded-full border border-[rgba(255,255,255,0.8)] bg-[rgba(11,3,23,0.5)] px-2 py-1 text-[14px] font-normal leading-5 text-[rgba(255,255,255,0.8)] backdrop-blur-[2px] hover:bg-[rgba(11,3,23,0.65)] hover:text-[rgba(255,255,255,0.9)]`,children:C(`client.editProfile`)})}):null:T(ne,{userId:a||``,currentUserId:B,isFollowing:G?.isFollowing}),Z=K?se:G,Q=Z.name||``,$=Z.description||Z.signature||``,le=Z.avatar||``;return M&&ie&&!W?T(te,{showBackButton:u,isMine:H,enableCustomBackground:o,className:m}):E(c,{className:e(`relative px-4 pb-8 pt-[16px]`,m),children:[T(c,{className:`absolute inset-x-0 top-0 overflow-hidden`,children:T(b,{isMine:ae,enableCustomBackground:o,src:Z.background,onUnauthorizedClick:oe?Y:void 0})}),T(c,{className:e(`pointer-events-none absolute inset-x-0 top-0 h-[220px]`,o?`bg-[image:var(--gradient-card-mask-strong)]`:`bg-[linear-gradient(180deg,var(--color-overlay-mask-start)_0%,var(--color-overlay-mask-end80)_100%)]`)}),E(c,{className:`absolute left-4 right-4 top-[16px] z-10 flex items-center justify-between`,children:[T(t,{variant:`ghost`,size:`icon-xs`,onClick:ce,className:e(`h-6 w-6 p-0 text-text1 hover:bg-transparent hover:text-[var(--color-text-secondary)]`,{invisible:!u}),children:T(_,{className:`h-4 w-4`})}),T(O,{href:`/settings`,className:e(`text-[var(--color-text-secondary)] opacity-80 transition-opacity hover:opacity-100`,{invisible:!H}),children:T(v,{})})]}),E(c,{className:e(`relative z-10 mt-[56px] flex justify-between gap-3 items-center`),children:[T(y,{isMine:q,src:le,alt:Q||`avatar`,onUnauthorizedClick:J?Y:void 0}),E(c,{className:`min-w-0 flex-1`,children:[E(c,{className:e(`flex justify-between gap-3 items-center`),children:[F&&H?T(O,{href:`/edit`,className:`min-w-0`,children:T(l,{as:`p`,className:`max-w-[195px] text-[18px] font-semibold leading-[26px] text-[var(--color-text-primary)]`,children:Q})}):T(l,{as:`p`,className:`max-w-[195px] text-[18px] font-semibold leading-[26px] text-[var(--color-text-primary)]`,onClick:()=>{!F&&H&&Y()},children:Q}),X?T(c,{className:`shrink-0 pt-0.5`,children:X}):null]}),$&&T(c,{className:`pt-1`,children:T(l,{as:`p`,className:`line-clamp-2 max-w-[195px] break-words text-[14px] leading-[20px] text-[var(--color-text-white80)]`,children:$})})]})]})]})}export{M as UserProfileHeaderClient,j as defaultBackground};
@@ -1,4 +1,4 @@
1
1
 
2
2
  import { ProfileHeaderInspectorProps, UserProfileHeaderAuthConfig, UserProfileHeaderClientProps, profileHeaderInspectorDefaultProps, profileHeaderInspectorPropsSchema } from "./schema.mjs";
3
- import { UserProfileHeaderClient } from "./client.mjs";
3
+ import { UserProfileHeaderClient, defaultBackground } from "./client.mjs";
4
4
  import { profileHeaderMaterial, profileHeaderMaterialWithDisabledBackground } from "./material.mjs";
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{gUserGetUserEditInfo as r,pUserEditUserInfo as i}from"../../../../../service/generated/client.mjs";import{uploadFile as a}from"../../../../../utils/upload-file.mjs";import{Avatar as o,AvatarFallback as s,AvatarImage as c}from"../../../../ui/avatar.mjs";import{Box as l}from"../../../../ui/box.mjs";import{Input as u}from"../../../../ui/input.mjs";import{Dialog as d,DialogContent as f}from"../../../../ui/dialog.mjs";import{Text as p}from"../../../../ui/text.mjs";import{useDeleteRequest as m}from"../../../../../hooks/query/use-query.mjs";import{ImageCropModal as h}from"../../../../common/image-crop-modal/image-crop-modal.mjs";import{useRef as g,useState as _}from"react";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{toast as x}from"sonner";import{useTranslations as S}from"next-intl";const C=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,w=[`image/jpeg`,`image/png`];function T(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return w.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function E({isMine:w,src:E,alt:D,onUnauthorizedClick:O}){let k=S(`components.pages.profile`),A=g(null),{userId:j,setUserInfo:M,userInfo:N}=n(),P=m(),[F,I]=_(!1),[L,R]=_(!1),[z,B]=_(``),[V,H]=_(!1);function U(){if(!V){if(w){I(!0);return}O?.()}}function W(){z&&(URL.revokeObjectURL(z),B(``))}function G(){I(!1)}function K(){V||A.current?.click()}async function q(e){let t=(await r({user_id:String(j)})).data;return{user_id:String(j),nick_name:t?.nick_name??N?.nick_name??void 0,avatar:e||void 0,signature:t?.signature??N?.signature??void 0,gender:t?.gender??N?.gender??void 0}}function J(e){let t=e.target.files?.[0];if(t){if(!T(t)){x.error(k(`client.imageTypeInvalid`)),e.target&&(e.target.value=``);return}if(t.size>5242880){x.error(k(`client.imageTooLarge`)),e.target&&(e.target.value=``);return}B(URL.createObjectURL(t)),R(!0),e.target&&(e.target.value=``)}}async function Y(e){if(!j){x.error(k(`client.loginRequiredForUpload`));return}try{H(!0);let t=await a(new File([e],`avatar.jpg`,{type:`image/jpeg`}),1),n=await q(t.objectKey);await i(n),M({...N,nick_name:n.nick_name,avatar:t.objectKey,signature:n.signature,gender:n.gender}),P([`user-profile`,`mine`]),P([`user-profile`,`profile`,String(j)]),P([`user-edit-info`,String(j)]),I(!1),R(!1),x.success(k(`client.mediaUpdateSuccess`))}catch(e){console.error(`上传头像失败`,e),x.error(k(`client.uploadFailed`))}finally{W(),H(!1)}}function X(){R(!1),W()}return b(v,{children:[w||O?y(t,{variant:`ghost`,size:`icon`,className:`!absolute bottom-3 left-0 h-22 w-22 rounded-full p-0 hover:bg-transparent`,onClick:U,"aria-label":`打开头像预览`,children:b(o,{className:`w-22 h-22`,children:[y(c,{src:E||C,alt:D||`avatar`}),y(s,{})]})}):b(o,{className:`!absolute bottom-3 left-0 w-22 h-22`,children:[y(c,{src:E||C,alt:D||`avatar`}),y(s,{})]}),y(d,{open:F,onOpenChange:G,children:y(f,{showCloseButton:!1,className:`bg-black !m-0 !p-0 !fixed !inset-0 !w-screen !h-screen !max-w-none !rounded-none !top-0 !left-0 !translate-x-0 !translate-y-0 !transform-none z-[9999] !pointer-events-auto`,children:b(l,{className:`relative flex h-full w-full flex-col items-center justify-center`,children:[y(t,{variant:`ghost`,size:`icon`,className:`absolute left-0 top-0 h-14 w-14 text-white hover:bg-transparent hover:text-white/80`,onClick:G,"aria-label":`关闭头像预览`,children:y(`svg`,{className:`w-4 h-4`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 16 16`,children:y(`path`,{d:`M14.55.2a.889.889 0 0 1 1.25 1.25l-.06.067L9.255 8l6.483 6.482.06.069a.888.888 0 0 1-1.25 1.25l-.067-.062L8 9.256l-6.482 6.483A.888.888 0 1 1 .26 14.482L6.742 8 .26 1.517.2 1.45A.888.888 0 0 1 1.45.2l.067.062 6.482 6.482L14.482.261l.068-.062Z`})})}),b(o,{className:`w-50 h-50`,children:[y(c,{src:E||C,alt:D||`avatar`}),y(s,{})]}),b(t,{variant:`ghost`,className:e(`absolute bottom-8 left-0 right-0 mx-auto flex w-[366px] max-w-[90%] items-center justify-between rounded-3xl bg-white/10 px-3 py-3 transition-colors hover:bg-white/20`,`active:scale-95`),onClick:K,disabled:V,children:[y(p,{as:`span`,className:`text-base font-medium text-white`,children:V?`上传中...`:`更换头像`}),b(`svg`,{className:`w-6 h-6 text-white`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:[y(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z`}),y(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 13a3 3 0 11-6 0 3 3 0 016 0z`})]})]})]})})}),y(u,{ref:A,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:J}),y(h,{open:L,onClose:X,imageSrc:z,onConfirm:Y})]})}export{E as UserProfileAvatar};
2
+ "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{gUserGetUserEditInfo as r,pUserEditUserInfo as i}from"../../../../../service/generated/client.mjs";import{uploadFile as a}from"../../../../../utils/upload-file.mjs";import{Avatar as o,AvatarFallback as s,AvatarImage as c}from"../../../../ui/avatar.mjs";import{Box as l}from"../../../../ui/box.mjs";import{Input as u}from"../../../../ui/input.mjs";import{Dialog as d,DialogContent as f}from"../../../../ui/dialog.mjs";import{Text as p}from"../../../../ui/text.mjs";import{useDeleteRequest as m}from"../../../../../hooks/query/use-query.mjs";import{ImageCropModal as h}from"../../../../common/image-crop-modal/image-crop-modal.mjs";import{useRef as g,useState as _}from"react";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{toast as x}from"sonner";import{useTranslations as S}from"next-intl";const C=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,w=[`image/jpeg`,`image/png`];function T(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return w.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function E({isMine:w,src:E,alt:D,onUnauthorizedClick:O}){let k=S(`components.pages.profile`),A=g(null),{userId:j,setUserInfo:M,userInfo:N}=n(),P=m(),[F,I]=_(!1),[L,R]=_(!1),[z,B]=_(``),[V,H]=_(!1);function U(){if(!V){if(w){I(!0);return}O?.()}}function W(){z&&(URL.revokeObjectURL(z),B(``))}function G(){I(!1)}function K(){V||A.current?.click()}async function q(e){let t=(await r({user_id:String(j)})).data;return{user_id:String(j),nick_name:t?.nick_name??N?.nick_name??void 0,avatar:e||void 0,signature:t?.signature??N?.signature??void 0,gender:t?.gender??N?.gender??void 0}}function J(e){let t=e.target.files?.[0];if(t){if(!T(t)){x.error(k(`client.imageTypeInvalid`)),e.target&&(e.target.value=``);return}if(t.size>5242880){x.error(k(`client.imageTooLarge`)),e.target&&(e.target.value=``);return}B(URL.createObjectURL(t)),R(!0),e.target&&(e.target.value=``)}}async function Y(e){if(!j){x.error(k(`client.loginRequiredForUpload`));return}try{H(!0);let t=await a(new File([e],`avatar.jpg`,{type:`image/jpeg`}),1),n=await q(t.objectKey);await i(n),M({...N,nick_name:n.nick_name,avatar:t.objectKey,signature:n.signature,gender:n.gender}),P([`user-profile`,`mine`]),P([`user-profile`,`profile`,String(j)]),P([`user-edit-info`,String(j)]),I(!1),R(!1),x.success(k(`client.mediaUpdateSuccess`))}catch(e){console.error(`上传头像失败`,e),x.error(k(`client.uploadFailed`))}finally{W(),H(!1)}}function X(){R(!1),W()}return b(v,{children:[w||O?y(t,{variant:`ghost`,size:`icon`,className:`h-[72px] w-[72px] rounded-full p-0 hover:bg-transparent`,onClick:U,"aria-label":`打开头像预览`,children:y(l,{className:`flex h-[72px] w-[72px] items-center justify-center rounded-full bg-[var(--color-surface-white20)]`,children:b(o,{className:`h-[60px] w-[60px] border-[3px] border-[var(--color-surface-white20)]`,children:[y(c,{src:E||C,alt:D||`avatar`}),y(s,{})]})})}):y(l,{className:`flex h-[72px] w-[72px] items-center justify-center rounded-full bg-[var(--color-surface-white20)]`,children:b(o,{className:`h-[60px] w-[60px] border-[3px] border-[var(--color-surface-white20)]`,children:[y(c,{src:E||C,alt:D||`avatar`}),y(s,{})]})}),y(d,{open:F,onOpenChange:G,children:y(f,{showCloseButton:!1,className:`bg-black !m-0 !p-0 !fixed !inset-0 !w-screen !h-screen !max-w-none !rounded-none !top-0 !left-0 !translate-x-0 !translate-y-0 !transform-none z-[9999] !pointer-events-auto`,children:b(l,{className:`relative flex h-full w-full flex-col items-center justify-center`,children:[y(t,{variant:`ghost`,size:`icon`,className:`absolute left-0 top-0 h-14 w-14 text-text1 hover:bg-transparent hover:text-[var(--color-text-secondary)]`,onClick:G,"aria-label":`关闭头像预览`,children:y(`svg`,{className:`w-4 h-4`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 16 16`,children:y(`path`,{d:`M14.55.2a.889.889 0 0 1 1.25 1.25l-.06.067L9.255 8l6.483 6.482.06.069a.888.888 0 0 1-1.25 1.25l-.067-.062L8 9.256l-6.482 6.483A.888.888 0 1 1 .26 14.482L6.742 8 .26 1.517.2 1.45A.888.888 0 0 1 1.45.2l.067.062 6.482 6.482L14.482.261l.068-.062Z`})})}),b(o,{className:`w-50 h-50`,children:[y(c,{src:E||C,alt:D||`avatar`}),y(s,{})]}),b(t,{variant:`ghost`,className:e(`absolute bottom-8 left-0 right-0 mx-auto flex w-[366px] max-w-[90%] items-center justify-between rounded-3xl bg-[var(--color-surface-white10)] px-3 py-3 transition-colors hover:bg-[var(--color-surface-white20)]`,`active:scale-95`),onClick:K,disabled:V,children:[y(p,{as:`span`,className:`text-base font-medium text-text1`,children:V?`上传中...`:`更换头像`}),b(`svg`,{className:`w-6 h-6 text-text1`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:[y(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z`}),y(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 13a3 3 0 11-6 0 3 3 0 016 0z`})]})]})]})})}),y(u,{ref:A,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:J}),y(h,{open:L,onClose:X,imageSrc:z,onConfirm:Y})]})}export{E as UserProfileAvatar};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{pUserUploadUserBgImage as t}from"../../../../../service/generated/client.mjs";import{uploadFile as n}from"../../../../../utils/upload-file.mjs";import{Image as r}from"../../../../ui/image.mjs";import{Box as i}from"../../../../ui/box.mjs";import{Input as a}from"../../../../ui/input.mjs";import{useDeleteRequest as o}from"../../../../../hooks/query/use-query.mjs";import{ImageCropModal as s}from"../../../../common/image-crop-modal/image-crop-modal.mjs";import{BackgroundPreviewModal as c}from"../../../../common/background-preview-modal/background-preview-modal.mjs";import{useCallback as l,useEffect as u,useRef as d,useState as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{toast as g}from"sonner";import{useTranslations as _}from"next-intl";const v=[`image/jpeg`,`image/png`];function y(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return v.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function b({isMine:v,enableCustomBackground:b=!0,src:x,onUnauthorizedClick:S}){let C=_(`components.pages.profile`),w=`/images/mine/img_mine_head_bg.png`,T=d(null),{userId:E,setUserInfo:D,userInfo:O}=e(),k=o(),[A,j]=f(!1),[M,N]=f(!1),[P,F]=f(!1),[I,L]=f(``),R=b&&(!!v||typeof S==`function`),z=l(()=>{I&&(URL.revokeObjectURL(I),L(``))},[I]),B=()=>{if(b){if(v){A||N(!0);return}S?.()}},V=()=>{N(!1)};function H(){A||T.current?.click()}async function U(e){let t=e.target.files?.[0];if(e.target&&(e.target.value=``),t)try{if(!y(t)){g.error(C(`client.imageTypeInvalid`));return}if(t.size>5242880){g.error(C(`client.imageTooLarge`));return}z(),L(URL.createObjectURL(t)),N(!1),F(!0)}catch(e){console.error(`上传背景图失败`,e),g.error(C(`client.uploadFailed`))}}let W=l(()=>{F(!1),z()},[z]);u(()=>{b||(N(!1),F(!1),z())},[z,b]);async function G(e){if(!E){g.error(C(`client.loginRequiredForUpload`));return}try{j(!0);let r=await n(new File([e],`background.jpg`,{type:`image/jpeg`}),1);await t({user_id:String(E),bg_image:r.objectKey}),D({...O,bg_image:r.objectKey}),k([`user-profile`,`mine`]),N(!1),F(!1),g.success(C(`client.mediaUpdateSuccess`))}catch(e){console.error(`上传背景图失败`,e),g.error(C(`client.uploadFailed`))}finally{z(),j(!1)}}return h(p,{children:[m(i,{className:b?`h-33.75`:`h-24`,children:b?m(i,{className:`relative h-full w-full`,onClick:R?B:void 0,children:m(r,{alt:`cover background`,fill:!0,objectFit:`cover`,className:`pointer-events-none`,src:x||w})}):m(i,{className:`h-full w-full bg-bg1`})}),b&&h(p,{children:[m(c,{open:M,onClose:V,bgUrl:x||w,onUpload:H}),m(a,{ref:T,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:U}),m(s,{open:P,onClose:W,imageSrc:I,onConfirm:G,cropShape:`rect`,aspectRatio:430/256})]})]})}export{b as UserProfileCoverBackground};
2
+ "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{pUserUploadUserBgImage as t}from"../../../../../service/generated/client.mjs";import{uploadFile as n}from"../../../../../utils/upload-file.mjs";import{Image as r}from"../../../../ui/image.mjs";import{Box as i}from"../../../../ui/box.mjs";import{Input as a}from"../../../../ui/input.mjs";import{useDeleteRequest as o}from"../../../../../hooks/query/use-query.mjs";import{ImageCropModal as s}from"../../../../common/image-crop-modal/image-crop-modal.mjs";import{BackgroundPreviewModal as c}from"../../../../common/background-preview-modal/background-preview-modal.mjs";import{defaultBackground as l}from"./client.mjs";import{useCallback as u,useEffect as d,useRef as f,useState as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{toast as _}from"sonner";import{useTranslations as v}from"next-intl";const y=[`image/jpeg`,`image/png`];function b(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return y.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function x({isMine:y,enableCustomBackground:x=!0,src:S,onUnauthorizedClick:C}){let w=v(`components.pages.profile`),T=l,E=f(null),{userId:D,setUserInfo:O,userInfo:k}=e(),A=o(),[j,M]=p(!1),[N,P]=p(!1),[F,I]=p(!1),[L,R]=p(``),z=x&&(!!y||typeof C==`function`),B=u(()=>{L&&(URL.revokeObjectURL(L),R(``))},[L]),V=()=>{if(x){if(y){j||P(!0);return}C?.()}},H=()=>{P(!1)};function U(){j||E.current?.click()}async function W(e){let t=e.target.files?.[0];if(e.target&&(e.target.value=``),t)try{if(!b(t)){_.error(w(`client.imageTypeInvalid`));return}if(t.size>5242880){_.error(w(`client.imageTooLarge`));return}B(),R(URL.createObjectURL(t)),P(!1),I(!0)}catch(e){console.error(`上传背景图失败`,e),_.error(w(`client.uploadFailed`))}}let G=u(()=>{I(!1),B()},[B]);d(()=>{x||(P(!1),I(!1),B())},[B,x]);async function K(e){if(!D){_.error(w(`client.loginRequiredForUpload`));return}try{M(!0);let r=await n(new File([e],`background.jpg`,{type:`image/jpeg`}),1);await t({user_id:String(D),bg_image:r.objectKey}),O({...k,bg_image:r.objectKey}),A([`user-profile`,`mine`]),P(!1),I(!1),_.success(w(`client.mediaUpdateSuccess`))}catch(e){console.error(`上传背景图失败`,e),_.error(w(`client.uploadFailed`))}finally{B(),M(!1)}}return g(m,{children:[h(i,{className:`h-[284px]`,children:x?h(i,{className:`relative h-full w-full`,onClick:z?V:void 0,children:h(r,{alt:`cover background`,fill:!0,objectFit:`cover`,className:`pointer-events-none`,src:S||T})}):h(i,{className:`h-full w-full bg-bg1`})}),x&&g(m,{children:[h(c,{open:N,onClose:H,bgUrl:S||T,onUpload:U}),h(a,{ref:E,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:W}),h(s,{open:F,onClose:G,imageSrc:L,onConfirm:K,cropShape:`rect`,aspectRatio:430/256})]})]})}export{x as UserProfileCoverBackground};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{gUserViewUserInfo as t}from"../../../../../service/generated/client.mjs";import{useRequest as n}from"../../../../../hooks/query/use-query.mjs";import{VideoList as r}from"../../../../common/list/video-list/video-list.mjs";import{profileMainMineTabOptions as i,profileMainProfileTabOptions as a}from"./variants.mjs";import{UserProfileMainShell as o}from"./shell.mjs";import{CollectTab as s}from"./tabs/collect-tab/client.mjs";import{HistoryTab as c}from"./tabs/history-tab/client.mjs";import{LikeTab as l}from"./tabs/like-tab/client.mjs";import{useMemo as u}from"react";import{jsx as d}from"react/jsx-runtime";import{parseAsString as f,useQueryState as p}from"nuqs";function m(e){return e*1e3}const h=[{id:`00d21b841126c976`,title:`朝朝暮暮都是你`,coverImage:`/md-204/uploads/default/other/2024-04-15/2750647625e6193940163169b77fb566.jpg`,duration:192,viewCount:237,createTime:1772175066,isMoreLink:!0},{id:`009f2e1820718add`,title:`狗哥的乡村爱情故事`,coverImage:`/md-204/uploads/default/other/2024-04-11/579bc5eb807d29657828945330b0ac47.jpg`,duration:74,viewCount:191,createTime:1770714221,isMoreLink:!0},{id:`02e2a11f78a3ffbf`,title:`唯爱百分之十二`,coverImage:`/md-204/resource/b6/b689e34f40d0e5baccb8f79630b99425.jpg`,duration:3348,viewCount:214,createTime:1770347155,isMoreLink:!0},{id:`2c19073cbd3c5c5a`,title:`疯狂磕学家`,coverImage:`/md-204/uploads/default/other/2024-08-23/5e174eeb8f2009dd7bb797fcabd5a649.jpg`,duration:2359,viewCount:17,createTime:1769757646,isMoreLink:!0},{id:`07e029915c2a9c96`,title:`我和祖宗做交易`,coverImage:`/md-204/uploads/default/other/2024-05-23/b53e50fa75986b41aac766c253a91fea.jpg`,duration:194,viewCount:75,createTime:1769670600,isMoreLink:!0},{id:`0ae1056a620b286f`,title:`识汝不识丁`,coverImage:`/md-204/uploads/default/other/2024-08-24/8958d46da3087a420d1d55e691dcb10a.jpg`,duration:2053,viewCount:13,createTime:1769651310,isMoreLink:!0},{id:`05564bf1aaf5fad6`,title:`我们的天空`,coverImage:`/md-204/resource/1a/1af6ce7117dcda390cf08db26e832684.jpg`,duration:2737,viewCount:180,createTime:1769566315,isMoreLink:!0},{id:`00f61e5be01409bb`,title:`我初初爱你`,coverImage:`/md-204/resource/bd/bd657a65bc6adc202a94acb8aca33f38.jpg`,duration:2898,viewCount:362,createTime:1769410683,isMoreLink:!0},{id:`062cd69d44fcb772`,title:`料理情缘`,coverImage:`/md-204/uploads/default/other/2023-11-27/de0491f07909b05fa012d15552e02cd0.png`,duration:2726,viewCount:33,createTime:1769157580,isMoreLink:!0},{id:`05751871b640b1a7`,title:`穷小伙被碎玻璃割伤眼睛,却因祸得福获得了一只超能神眼,人生直接开挂,之前欺负他的人统统匍匐在他脚下,征服姐妹花,走向人生巅峰!`,coverImage:`/md-204/dcc-file/29/29a0fdc86f0d756ad8f123e81693d233-small.jpgbnc`,duration:9236,viewCount:137,createTime:1769157575,isMoreLink:!1}].map(e=>({id:e.id,title:e.title,coverImage:e.coverImage,duration:e.duration,authorName:``,viewCount:e.viewCount,publishTime:m(e.createTime),is_more_link:e.isMoreLink}));function g({isMine:e,tab:t}){let n=e?i:a;return t&&n.includes(t)?t:n[0]}function _(e,t){return e&&(t===`collect`||t===`like`)}function v({id:i,showCreateAction:a=!1,requireLogin:m=!1,className:v,currentUserId:y,mode:b=`renderer`,tab:x}){let S=b===`renderer`,C=e(e=>e.userId),[w]=p(`tab`,f),T=b===`editor`?``:y||C||``,E=i==null||!!T&&i===T,D=!E&&!!i,O=E?T:i?String(i):void 0,k=E?[`user-profile`,`mine`]:[`user-profile`,`profile`,i],A=u(()=>g({isMine:E,tab:w??x}),[E,x,w]),j=S&&_(D,A)&&!!i,{data:M}=n([`user-profile`,`privacy`,i,T],async()=>await t({target_user_id:String(i),user_id:T||String(i)}),{staleTime:0,enabled:j}),N=`content`;if(b===`editor`)N=`content`;else if(m&&E&&!T)N=`login-required`;else if(j&&M){let e=M.data??{},t=Number(e.collections_open??1)>0,n=Number(e.like_open??1)>0;A===`collect`&&!t&&(N=`privacy-collect`),A===`like`&&!n&&(N=`privacy-like`)}let P=N===`content`&&(!j||!!M),F=null;if(b===`editor`)F=d(r,{list:h,loading:!1,hasMore:!1,showVideoProgress:!1});else if(P)switch(A){case`like`:F=d(l,{mode:b,isMine:E,targetUserId:O,queryKeyPrefix:k});break;case`history`:F=d(c,{mode:b,targetUserId:O,queryKeyPrefix:k});break;default:F=d(s,{mode:b,isMine:E,userId:O,showCreateAction:a&&E,queryKeyPrefix:k});break}return d(o,{profileId:i,currentUserId:T,isMine:E,renderMode:N,className:v,children:F})}export{v as UserProfileMainClient};
2
+ "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{gUserViewUserInfo as t}from"../../../../../service/generated/client.mjs";import{useRequest as n}from"../../../../../hooks/query/use-query.mjs";import{profileMainMineTabOptions as r,profileMainProfileTabOptions as i}from"./variants.mjs";import{UserProfileMainShell as a}from"./shell.mjs";import{CollectVideoWaterfall as o}from"./tabs/collect-tab/video-waterfall.mjs";import{CollectTab as s}from"./tabs/collect-tab/client.mjs";import{HistoryTab as c}from"./tabs/history-tab/client.mjs";import{LikeTab as l}from"./tabs/like-tab/client.mjs";import{useMemo as u}from"react";import{jsx as d}from"react/jsx-runtime";import{parseAsString as f,useQueryState as p}from"nuqs";function m(e){return e*1e3}const h=[{id:`00d21b841126c976`,title:`朝朝暮暮都是你`,coverImage:`/md-204/uploads/default/other/2024-04-15/2750647625e6193940163169b77fb566.jpg`,duration:192,viewCount:237,createTime:1772175066,isMoreLink:!0},{id:`009f2e1820718add`,title:`狗哥的乡村爱情故事`,coverImage:`/md-204/uploads/default/other/2024-04-11/579bc5eb807d29657828945330b0ac47.jpg`,duration:74,viewCount:191,createTime:1770714221,isMoreLink:!0},{id:`02e2a11f78a3ffbf`,title:`唯爱百分之十二`,coverImage:`/md-204/resource/b6/b689e34f40d0e5baccb8f79630b99425.jpg`,duration:3348,viewCount:214,createTime:1770347155,isMoreLink:!0},{id:`2c19073cbd3c5c5a`,title:`疯狂磕学家`,coverImage:`/md-204/uploads/default/other/2024-08-23/5e174eeb8f2009dd7bb797fcabd5a649.jpg`,duration:2359,viewCount:17,createTime:1769757646,isMoreLink:!0},{id:`07e029915c2a9c96`,title:`我和祖宗做交易`,coverImage:`/md-204/uploads/default/other/2024-05-23/b53e50fa75986b41aac766c253a91fea.jpg`,duration:194,viewCount:75,createTime:1769670600,isMoreLink:!0},{id:`0ae1056a620b286f`,title:`识汝不识丁`,coverImage:`/md-204/uploads/default/other/2024-08-24/8958d46da3087a420d1d55e691dcb10a.jpg`,duration:2053,viewCount:13,createTime:1769651310,isMoreLink:!0},{id:`05564bf1aaf5fad6`,title:`我们的天空`,coverImage:`/md-204/resource/1a/1af6ce7117dcda390cf08db26e832684.jpg`,duration:2737,viewCount:180,createTime:1769566315,isMoreLink:!0},{id:`00f61e5be01409bb`,title:`我初初爱你`,coverImage:`/md-204/resource/bd/bd657a65bc6adc202a94acb8aca33f38.jpg`,duration:2898,viewCount:362,createTime:1769410683,isMoreLink:!0},{id:`062cd69d44fcb772`,title:`料理情缘`,coverImage:`/md-204/uploads/default/other/2023-11-27/de0491f07909b05fa012d15552e02cd0.png`,duration:2726,viewCount:33,createTime:1769157580,isMoreLink:!0},{id:`05751871b640b1a7`,title:`穷小伙被碎玻璃割伤眼睛,却因祸得福获得了一只超能神眼,人生直接开挂,之前欺负他的人统统匍匐在他脚下,征服姐妹花,走向人生巅峰!`,coverImage:`/md-204/dcc-file/29/29a0fdc86f0d756ad8f123e81693d233-small.jpgbnc`,duration:9236,viewCount:137,createTime:1769157575,isMoreLink:!1}].map((e,t)=>({id:e.id,title:e.title,coverImage:e.coverImage,duration:e.duration,authorName:``,viewCount:e.viewCount,publishTime:m(e.createTime),is_more_link:e.isMoreLink,imgType:t%3==1?`long`:`short`}));function g({isMine:e,tab:t}){let n=e?r:i;return t&&n.includes(t)?t:n[0]}function _(e,t){return e&&(t===`collect`||t===`like`)}function v({id:r,showCreateAction:i=!1,requireLogin:m=!1,className:v,currentUserId:y,mode:b=`renderer`,tab:x}){let S=b===`renderer`,C=e(e=>e.userId),[w]=p(`tab`,f),T=b===`editor`?``:y||C||``,E=r==null||!!T&&r===T,D=!E&&!!r,O=E?T:r?String(r):void 0,k=E?[`user-profile`,`mine`]:[`user-profile`,`profile`,r],A=u(()=>g({isMine:E,tab:w??x}),[E,x,w]),j=S&&_(D,A)&&!!r,{data:M}=n([`user-profile`,`privacy`,r,T],async()=>await t({target_user_id:String(r),user_id:T||String(r)}),{staleTime:0,enabled:j}),N=`content`;if(b===`editor`)N=`content`;else if(m&&E&&!T)N=`login-required`;else if(j&&M){let e=M.data??{},t=Number(e.collections_open??1)>0,n=Number(e.like_open??1)>0;A===`collect`&&!t&&(N=`privacy-collect`),A===`like`&&!n&&(N=`privacy-like`)}let P=N===`content`&&(!j||!!M),F=null;if(b===`editor`)F=d(o,{list:h,loading:!1,hasMore:!1});else if(P)switch(A){case`like`:F=d(l,{mode:b,isMine:E,targetUserId:O,queryKeyPrefix:k});break;case`history`:F=d(c,{mode:b,targetUserId:O,queryKeyPrefix:k});break;default:F=d(s,{mode:b,isMine:E,userId:O,showCreateAction:i&&E,queryKeyPrefix:k});break}return d(a,{profileId:r,currentUserId:T,isMine:E,renderMode:N,className:v,children:F})}export{v as UserProfileMainClient};
@@ -0,0 +1,2 @@
1
+
2
+ "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Box as t}from"../../../../ui/box.mjs";import{Text as n}from"../../../../ui/text.mjs";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a(a){let{text:o,className:s}=a;return i(t,{className:e(`flex min-h-[360px] w-full flex-col items-center pt-[132px]`,s),children:[i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`68`,height:`58`,viewBox:`0 0 68 58`,fill:`none`,className:`h-[58px] w-[68px]`,children:[r(`rect`,{x:`0.5`,y:`0.5`,width:`67`,height:`57`,rx:`7.5`,fill:`#1B1829`,stroke:`#322F3E`}),r(`path`,{d:`M27.1175 33.8211L27.118 23.9652C27.1182 21.7159 29.502 20.2667 31.4989 21.3021L40.5835 26.0125C42.6976 27.1086 42.7531 30.1126 40.681 31.2861L31.5959 36.4317C29.596 37.5644 27.1173 36.1195 27.1175 33.8211Z`,fill:`#54525E`})]}),r(n,{className:`mt-[16px] text-center text-[15px] leading-[normal] text-[#54525E]`,children:o})]})}export{a as ProfileMainEmptyState};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{Box as r}from"../../../../ui/box.mjs";import{EmptyState as i}from"../../../../ui/empty.mjs";import{Text as a}from"../../../../ui/text.mjs";import{Tabs as o,TabsList as s,TabsTrigger as c}from"../../../../ui/tabs.mjs";import{useLoginModalStore as l}from"../../../../../store/modules/login-modal-store.mjs";import{profileMainMineTabOptions as u,profileMainProfileTabOptions as d}from"./variants.mjs";import{useEffect as f,useMemo as p,useRef as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{useTranslations as _}from"next-intl";import{parseAsString as v,useQueryState as y}from"nuqs";function b(e){return e?[...u]:[...d]}function x(e,t){let n=b(t);return n.includes(e)?e:n[0]}function S(e){let t=window.getComputedStyle(e);return/auto|scroll|overlay/.test(t.overflowY)}function C(e){if(typeof window>`u`)return null;let t=e?.parentElement??null;for(;t;){if(S(t))return t;t=t.parentElement}return null}function w(e){return typeof window>`u`?0:e?e.scrollTop:window.scrollY||window.pageYOffset||0}function T(e,t){if(!(typeof window>`u`)){if(e){e.scrollTo({top:t});return}window.scrollTo({top:t,left:0})}}function E({profileId:u,currentUserId:d,isMine:S,renderMode:E,className:D,children:O}){let k=_(`components.pages.profile`),A=m(null),j=l(e=>e.open),M=n(e=>e.userId),N=m(``),P=b(S),[F,I]=y(`tab`,v.withDefault(`collect`)),L=p(()=>x(F,S),[S,F]),R=d||M||``,z=S?R:u,B=p(()=>`profile-scroll:${z||(S?`mine`:`guest`)}:${L}`,[S,L,z]);f(()=>{F!==L&&I(L,{shallow:!1})},[L,I,F]),f(()=>{if(typeof window>`u`)return;let e=`${S?`mine`:`profile`}:${z||``}:${L}`;N.current!==e&&(N.current=e,window.WebSDK?.track?.({event:`recommend_list_click`,payload:{page_type:S?`mine`:`profile`,profile_id:u||z||``,current_user_id:R,tab:L,page_source:window.location?.pathname||``}}))},[S,u,R,L,z]),f(()=>{if(typeof window>`u`)return;let e=C(A.current),t=window.sessionStorage.getItem(B),n=t?Number(t):0;Number.isFinite(n)&&n>0&&requestAnimationFrame(()=>{T(e,n)});let r=!1,i=()=>{r||(r=!0,requestAnimationFrame(()=>{window.sessionStorage.setItem(B,String(w(e))),r=!1}))};return e?(e.addEventListener(`scroll`,i,{passive:!0}),()=>{e.removeEventListener(`scroll`,i)}):(window.addEventListener(`scroll`,i,{passive:!0}),()=>{window.removeEventListener(`scroll`,i)})},[B]);let V={collect:k(`client.collect`),like:k(`client.like`),history:k(`client.history`)},H=O;return E===`login-required`?H=g(r,{className:`flex gap-4 flex-col items-center justify-center py-10 text-center`,children:[h(a,{className:`text-base text-text1`,children:k(`client.loginToView`)}),h(t,{size:`lg`,variant:`secondary`,onClick:j,children:k(`client.loginNow`)})]}):E===`privacy-collect`?H=h(i,{type:`no-content`,text:k(`client.collectionNotPublic`)}):E===`privacy-like`&&(H=h(i,{type:`no-content`,text:k(`client.likeNotPublic`)})),g(r,{ref:A,className:e(D),children:[h(r,{className:`border-b bg-bg1 sticky z-10 top-0 border-text1/5 h-10`,children:h(o,{value:L,onValueChange:e=>{I(e,{shallow:!1})},className:`w-fit`,children:h(s,{variant:`default`,className:`inline-flex h-9`,children:P.map(e=>h(c,{value:e,className:`p-2.5 !text-base !w-fit data-active:!text-lg data-active:font-bold`,children:V[e]},e))})})}),h(r,{className:`p-2`,children:H})]})}export{E as UserProfileMainShell};
2
+ "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{Box as r}from"../../../../ui/box.mjs";import{EmptyState as i}from"../../../../ui/empty.mjs";import{Text as a}from"../../../../ui/text.mjs";import{Tabs as o,TabsList as s,TabsTrigger as c}from"../../../../ui/tabs.mjs";import{useLoginModalStore as l}from"../../../../../store/modules/login-modal-store.mjs";import{profileMainMineTabOptions as u,profileMainProfileTabOptions as d}from"./variants.mjs";import{useEffect as f,useId as p,useMemo as m,useRef as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useTranslations as v}from"next-intl";import{parseAsString as y,useQueryState as b}from"nuqs";function x(e){let t=p();return _(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`37`,height:`10`,viewBox:`0 0 37 10`,fill:`none`,...e,children:[g(`path`,{d:`M32.8921 0.212888C34.4317 -0.398985 36.1765 0.353067 36.7886 1.89258C37.4004 3.43219 36.6484 5.17704 35.1089 5.78906L29.9204 7.85058C26.0475 9.38961 21.7156 9.29046 17.9175 7.57519C15.9234 6.67463 13.6771 6.5 11.5679 7.08203L3.79833 9.22656C2.20143 9.66708 0.549808 8.72958 0.108873 7.13281C-0.331916 5.53567 0.605478 3.88317 2.20262 3.44238L9.97118 1.29785C13.431 0.342993 17.1161 0.629191 20.3872 2.10644C22.7028 3.15218 25.3434 3.21271 27.7046 2.27441L32.8921 0.212888Z`,fill:`url(#${t})`}),g(`defs`,{children:_(`linearGradient`,{id:t,x1:`3.00047`,y1:`5.00097`,x2:`34.0005`,y2:`5.00097`,gradientUnits:`userSpaceOnUse`,children:[g(`stop`,{stopColor:`var(--color-brand-tag-gradient-start)`}),g(`stop`,{offset:`1`,stopColor:`var(--color-brand-tag-gradient-end)`})]})})]})}function S(e){return _(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`68`,height:`58`,viewBox:`0 0 68 58`,fill:`none`,...e,children:[g(`rect`,{x:`0.5`,y:`0.5`,width:`67`,height:`57`,rx:`7.5`,fill:`#1B1829`,stroke:`#322F3E`}),g(`path`,{d:`M27.1175 33.8211L27.118 23.9652C27.1182 21.7159 29.502 20.2667 31.4989 21.3021L40.5835 26.0125C42.6976 27.1086 42.7531 30.1126 40.681 31.2861L31.5959 36.4317C29.596 37.5644 27.1173 36.1195 27.1175 33.8211Z`,fill:`#54525E`})]})}function C(e){return e?[...u]:[...d]}function w(e,t){let n=C(t);return n.includes(e)?e:n[0]}function T(e){let t=window.getComputedStyle(e);return/auto|scroll|overlay/.test(t.overflowY)}function E(e){if(typeof window>`u`)return null;let t=e?.parentElement??null;for(;t;){if(T(t))return t;t=t.parentElement}return null}function D(e){return typeof window>`u`?0:e?e.scrollTop:window.scrollY||window.pageYOffset||0}function O(e,t){if(!(typeof window>`u`)){if(e){e.scrollTo({top:t});return}window.scrollTo({top:t,left:0})}}function k({profileId:u,currentUserId:d,isMine:p,renderMode:T,className:k,children:A}){let j=v(`components.pages.profile`),M=h(null),N=l(e=>e.open),P=n(e=>e.userId),F=h(``),I=C(p),[L,R]=b(`tab`,y.withDefault(`collect`)),z=m(()=>w(L,p),[p,L]),B=d||P||``,V=p?B:u,H=m(()=>`profile-scroll:${V||(p?`mine`:`guest`)}:${z}`,[p,z,V]);f(()=>{L!==z&&R(z,{shallow:!1})},[z,R,L]),f(()=>{if(typeof window>`u`)return;let e=`${p?`mine`:`profile`}:${V||``}:${z}`;F.current!==e&&(F.current=e,window.WebSDK?.track?.({event:`recommend_list_click`,payload:{page_type:p?`mine`:`profile`,profile_id:u||V||``,current_user_id:B,tab:z,page_source:window.location?.pathname||``}}))},[p,u,B,z,V]),f(()=>{if(typeof window>`u`)return;let e=E(M.current),t=window.sessionStorage.getItem(H),n=t?Number(t):0;Number.isFinite(n)&&n>0&&requestAnimationFrame(()=>{O(e,n)});let r=!1,i=()=>{r||(r=!0,requestAnimationFrame(()=>{window.sessionStorage.setItem(H,String(D(e))),r=!1}))};return e?(e.addEventListener(`scroll`,i,{passive:!0}),()=>{e.removeEventListener(`scroll`,i)}):(window.addEventListener(`scroll`,i,{passive:!0}),()=>{window.removeEventListener(`scroll`,i)})},[H]);let U={collect:j(`client.collect`),like:j(`client.like`),history:j(`client.history`)},W=A;return T===`login-required`?W=_(r,{className:`flex flex-col items-center pt-[132px] text-center`,children:[g(S,{className:`h-[58px] w-[68px]`}),g(a,{className:`mt-[16px] text-[15px] leading-[normal] text-[#54525E]`,children:j(`client.loginToSeeMoreVideos`)}),g(t,{type:`button`,onClick:N,className:`mt-[16px] h-[40px] min-w-[100px] rounded-[8px] border-0 bg-[linear-gradient(90deg,#9756E3_0%,#6C43EE_100%)] px-[24px] py-0 text-[16px] font-normal leading-[24px] text-white active:opacity-90`,children:j(`client.loginNow`)})]}):T===`privacy-collect`?W=g(i,{type:`no-content`,text:j(`client.collectionNotPublic`)}):T===`privacy-like`&&(W=g(i,{type:`no-content`,text:j(`client.likeNotPublic`)})),_(r,{ref:M,className:e(`relative grow overflow-hidden rounded-t-[24px] bg-[var(--color-surface-panel-dark)]`,k),children:[g(r,{className:`sticky top-0 z-10 bg-[var(--color-surface-panel-dark)] px-4 pt-8`,children:g(o,{value:z,onValueChange:e=>{R(e,{shallow:!1})},className:`h-6 w-full`,children:g(s,{variant:`default`,className:`h-6 w-fit gap-8 px-0`,children:I.map(t=>_(c,{value:t,className:e(`group/profile-main-tab !flex-none !h-6 min-w-8 !px-0 !py-0 !pb-0 text-[16px] !font-normal leading-6 text-[var(--color-text-secondary)]`,`data-[active]:!text-text1 data-[active]:!font-semibold data-[active]:!text-[18px]`,`data-[state=active]:!text-text1 data-[state=active]:!font-semibold data-[state=active]:!text-[18px]`,`after:hidden`),children:[g(x,{"aria-hidden":`true`,className:e(`pointer-events-none absolute bottom-0 left-1/2 h-[10px] w-[37px] -translate-x-1/2 opacity-0 transition-opacity duration-200`,`group-data-[active]/profile-main-tab:opacity-100`,`group-data-[state=active]/profile-main-tab:opacity-100`)}),g(`span`,{className:`relative z-10`,children:U[t]})]},t))})})}),g(r,{className:`relative px-4 pb-6 pt-7`,children:W})]})}export{k as UserProfileMainShell};