@funhub/platform 0.1.30 → 0.1.33

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 (118) hide show
  1. package/config/tailwind/index.cjs +115 -1
  2. package/config/tailwind/index.d.ts +3 -0
  3. package/config/tailwind/index.mjs +115 -1
  4. package/dist/biz.d.mts +29 -25
  5. package/dist/biz.mjs +1 -1
  6. package/dist/common.mjs +1 -1
  7. package/dist/components/biz/basics/fullscreen-feed/index.mjs +1 -1
  8. package/dist/components/biz/basics/fullscreen-feed/runtime/client.mjs +1 -1
  9. package/dist/components/biz/basics/fullscreen-feed/runtime/post-slide.mjs +1 -1
  10. package/dist/components/biz/basics/fullscreen-feed/runtime/use-mixed-feed-controller.mjs +1 -1
  11. package/dist/components/biz/basics/fullscreen-feed/runtime/use-series-feed-controller.mjs +1 -1
  12. package/dist/components/biz/basics/fullscreen-feed/runtime/user-action.mjs +1 -1
  13. package/dist/components/biz/basics/logo/variants/basic-logo/runtime/client.mjs +1 -1
  14. package/dist/components/biz/basics/search/shared/components/search-box.mjs +1 -1
  15. package/dist/components/biz/basics/search/variants/simple-search/runtime/client.mjs +1 -1
  16. package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.mjs +1 -1
  17. package/dist/components/biz/business/banner/variants/basic-banner/runtime/client.mjs +1 -1
  18. package/dist/components/biz/business/banner-carousel/client.mjs +1 -1
  19. package/dist/components/biz/business/card-grid/variants/card-grid-2x3-infinite/runtime/client.mjs +1 -1
  20. package/dist/components/biz/business/card-grid/variants/card-grid-3x3-infinite/runtime/client.mjs +1 -1
  21. package/dist/components/biz/business/channel-list/client.d.mts +2 -2
  22. package/dist/components/biz/business/channel-list/client.mjs +1 -1
  23. package/dist/components/biz/business/channel-list/default-props.mjs +1 -1
  24. package/dist/components/biz/business/channel-list/material.d.mts +2 -2
  25. package/dist/components/biz/business/comment/comment-item.mjs +1 -1
  26. package/dist/components/biz/business/comment/reply-detail.mjs +1 -1
  27. package/dist/components/biz/business/contact/contact-list.mjs +1 -1
  28. package/dist/components/biz/business/detail/detail-operate.mjs +1 -1
  29. package/dist/components/biz/business/detail/materials/video-detail-actions/schema.d.mts +1 -1
  30. package/dist/components/biz/business/detail/materials/video-detail-info/schema.d.mts +1 -1
  31. package/dist/components/biz/business/detail/materials/video-detail-info-title/schema.d.mts +1 -1
  32. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/schema.d.mts +1 -1
  33. package/dist/components/biz/business/detail/materials/video-detail-player/schema.d.mts +1 -1
  34. package/dist/components/biz/business/detail/materials/video-detail-recommend/client.mjs +1 -1
  35. package/dist/components/biz/business/detail/video-hero.mjs +1 -1
  36. package/dist/components/biz/business/floating-ball/client.d.mts +2 -2
  37. package/dist/components/biz/business/floating-ball/client.mjs +1 -1
  38. package/dist/components/biz/business/floating-ball/index.d.mts +5 -0
  39. package/dist/components/biz/business/floating-ball/material.d.mts +6 -1
  40. package/dist/components/biz/business/floating-ball/schema.d.mts +11 -4
  41. package/dist/components/biz/business/floating-ball/schema.mjs +1 -1
  42. package/dist/components/biz/business/fullscreen-feed/variants/shared/runtime-compat.mjs +1 -1
  43. package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
  44. package/dist/components/biz/business/index.d.mts +29 -24
  45. package/dist/components/biz/business/index.mjs +1 -1
  46. package/dist/components/biz/business/large-feature-grid/card-item.mjs +2 -0
  47. package/dist/components/biz/business/large-feature-grid/client.d.mts +8 -5
  48. package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
  49. package/dist/components/biz/business/large-feature-grid/mock.mjs +2 -0
  50. package/dist/components/biz/business/large-feature-grid/server.d.mts +4 -2
  51. package/dist/components/biz/business/large-feature-grid/types.d.mts +33 -0
  52. package/dist/components/biz/business/marquee/client.mjs +1 -1
  53. package/dist/components/biz/business/nav-bar/variants/basic-nav-bar/runtime/client.mjs +1 -1
  54. package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
  55. package/dist/components/biz/business/profile/profile-header/material.d.mts +1 -7
  56. package/dist/components/biz/business/profile/profile-header/schema.d.mts +14 -14
  57. package/dist/components/biz/business/profile/profile-header/schema.mjs +1 -1
  58. package/dist/components/biz/business/profile/profile-main/material.d.mts +1 -12
  59. package/dist/components/biz/business/profile/profile-main/schema.d.mts +14 -24
  60. package/dist/components/biz/business/profile/profile-main/schema.mjs +1 -1
  61. package/dist/components/biz/business/profile/profile-main/tabs/publish-tab/client.mjs +1 -1
  62. package/dist/components/biz/business/recommended-users/variants/basic-recommended-users/runtime/client.mjs +1 -1
  63. package/dist/components/biz/business/search-bar/variants/detail-search-bar/runtime/client.mjs +1 -1
  64. package/dist/components/biz/business/search-history/client.mjs +1 -1
  65. package/dist/components/biz/business/search-input/client.mjs +1 -1
  66. package/dist/components/biz/business/tab-bar/client.mjs +1 -1
  67. package/dist/components/biz/business/text-recommend/client.mjs +1 -1
  68. package/dist/components/common/at-element/index.mjs +1 -1
  69. package/dist/components/common/blocked-dialog/blocked-dialog.mjs +1 -1
  70. package/dist/components/common/funhub-provider/funhub-provider.mjs +1 -1
  71. package/dist/components/common/header-nav/client.mjs +1 -1
  72. package/dist/components/common/info-card/card-header.mjs +1 -1
  73. package/dist/components/common/list/post-list/post-list.mjs +1 -1
  74. package/dist/components/common/list/user-activity-list/user-activity-list-actions.mjs +1 -1
  75. package/dist/components/common/list/user-activity-list/user-activity-list-item.mjs +1 -1
  76. package/dist/components/common/list/video-list/video-list.mjs +1 -1
  77. package/dist/components/common/media-preview/index.mjs +1 -1
  78. package/dist/components/common/popup-video/index.mjs +1 -1
  79. package/dist/components/common/share-popup/share-popup.mjs +1 -1
  80. package/dist/components/common/tab-bar/index.mjs +1 -1
  81. package/dist/components/common/top-nav-bar/client.mjs +1 -1
  82. package/dist/components/common/video-player/index.mjs +2 -2
  83. package/dist/components/pages/(follow)/_components/interaction-tabs/index.mjs +1 -1
  84. package/dist/components/pages/(follow)/_components/user-list/index.mjs +1 -1
  85. package/dist/components/pages/collection-create/form.mjs +1 -1
  86. package/dist/components/pages/collection-detail/detail.mjs +1 -1
  87. package/dist/components/pages/feed-series/feed-series-client.mjs +1 -1
  88. package/dist/components/pages/feed-series/page.mjs +1 -1
  89. package/dist/components/pages/feedback/_components/feedback-form.mjs +1 -1
  90. package/dist/components/pages/fullscreen-feed/page.mjs +1 -1
  91. package/dist/components/pages/home/client.mjs +1 -1
  92. package/dist/components/pages/post-detail/post-detail-client.mjs +1 -1
  93. package/dist/components/pages/profile/_components/user-profile-container/client.mjs +1 -1
  94. package/dist/components/pages/publish/components/collection.mjs +1 -1
  95. package/dist/components/pages/publish/components/header.mjs +1 -1
  96. package/dist/components/pages/publish/page-client.mjs +1 -1
  97. package/dist/components/pages/search/page-client.mjs +1 -1
  98. package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
  99. package/dist/components/pages/search/top-header.mjs +1 -1
  100. package/dist/components/pages/user-follow/_components/follow-no-login.mjs +1 -1
  101. package/dist/components/pages/video-detail/page.mjs +1 -1
  102. package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
  103. package/dist/components/pages/video-list/video-list-client.mjs +1 -1
  104. package/dist/components/ui/badge.d.mts +1 -1
  105. package/dist/components/ui/button-group.d.mts +1 -1
  106. package/dist/components/ui/button.d.mts +2 -2
  107. package/dist/components/ui/field.d.mts +1 -1
  108. package/dist/components/ui/image.d.mts +4 -4
  109. package/dist/hooks/use-content-operate.mjs +1 -1
  110. package/dist/i18n.d.mts +1 -1
  111. package/dist/i18n.mjs +1 -1
  112. package/dist/materials.d.mts +5 -5
  113. package/dist/materials.mjs +1 -1
  114. package/dist/utils/share-manager.mjs +1 -1
  115. package/dist/utils.d.mts +4 -4
  116. package/dist/utils.mjs +1 -1
  117. package/package.json +1 -1
  118. package/dist/components/biz/business/large-feature-grid/schema.d.mts +0 -14
@@ -1,22 +1,11 @@
1
1
 
2
- import { SchemaHasDefaultValue } from "../../../../../utils/schema/schema.mjs";
3
2
  import { DefineMaterialOption } from "../../../../../utils/schema/material.mjs";
4
- import "../../../../../utils/schema/index.mjs";
5
3
  import { UserProfileMainClient } from "./client.mjs";
6
4
  import { UserProfileMain } from "./server.mjs";
7
5
  import * as zod from "zod";
8
6
  import * as zod_v4_core0 from "zod/v4/core";
9
7
 
10
8
  //#region components/biz/business/profile/profile-main/material.d.ts
11
- declare const profileMainMaterial: DefineMaterialOption<typeof UserProfileMain, typeof UserProfileMainClient, zod.ZodObject<{
12
- id: zod.ZodOptional<zod.ZodString>;
13
- showCreateAction: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
14
- requireLogin: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
15
- tab: zod.ZodOptional<zod.ZodType<"history" | "collect" | "publish" | "like", unknown, zod_v4_core0.$ZodTypeInternals<"history" | "collect" | "publish" | "like", unknown>>> & SchemaHasDefaultValue;
16
- likeTab: zod.ZodOptional<zod.ZodType<"video" | "post", unknown, zod_v4_core0.$ZodTypeInternals<"video" | "post", unknown>>> & SchemaHasDefaultValue;
17
- historyTab: zod.ZodOptional<zod.ZodType<"video" | "post", unknown, zod_v4_core0.$ZodTypeInternals<"video" | "post", unknown>>> & SchemaHasDefaultValue;
18
- collectTab: zod.ZodOptional<zod.ZodType<"video" | "post" | "collection", unknown, zod_v4_core0.$ZodTypeInternals<"video" | "post" | "collection", unknown>>> & SchemaHasDefaultValue;
19
- collectCollectionTab: zod.ZodOptional<zod.ZodType<"subscribed" | "created", unknown, zod_v4_core0.$ZodTypeInternals<"subscribed" | "created", unknown>>> & SchemaHasDefaultValue;
20
- }, zod_v4_core0.$strip>, "profile-main">;
9
+ declare const profileMainMaterial: DefineMaterialOption<typeof UserProfileMain, typeof UserProfileMainClient, zod.ZodObject<{}, zod_v4_core0.$strip>, "profile-main">;
21
10
  //#endregion
22
11
  export { profileMainMaterial };
@@ -1,32 +1,16 @@
1
1
 
2
- import { SchemaHasDefaultValue } from "../../../../../utils/schema/schema.mjs";
2
+ import { InferSchemaProps } from "../../../../../utils/schema/schema.mjs";
3
3
  import "../../../../../utils/schema/index.mjs";
4
- import z$1 from "zod";
4
+ import * as zod from "zod";
5
+ import * as zod_v4_core0 from "zod/v4/core";
5
6
 
6
7
  //#region components/biz/business/profile/profile-main/schema.d.ts
7
8
  /**
8
- * 用户资料主体可被 inspector 编辑的字段。
9
+ * 用户资料主体物料暂不对外开放 inspector 配置。
9
10
  */
10
- declare const profileMainInspectorPropsSchema: z$1.ZodObject<{
11
- id: z$1.ZodOptional<z$1.ZodString>;
12
- showCreateAction: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
13
- requireLogin: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
14
- tab: z$1.ZodOptional<z$1.ZodType<"history" | "collect" | "publish" | "like", unknown, z$1.core.$ZodTypeInternals<"history" | "collect" | "publish" | "like", unknown>>> & SchemaHasDefaultValue;
15
- likeTab: z$1.ZodOptional<z$1.ZodType<"video" | "post", unknown, z$1.core.$ZodTypeInternals<"video" | "post", unknown>>> & SchemaHasDefaultValue;
16
- historyTab: z$1.ZodOptional<z$1.ZodType<"video" | "post", unknown, z$1.core.$ZodTypeInternals<"video" | "post", unknown>>> & SchemaHasDefaultValue;
17
- collectTab: z$1.ZodOptional<z$1.ZodType<"video" | "post" | "collection", unknown, z$1.core.$ZodTypeInternals<"video" | "post" | "collection", unknown>>> & SchemaHasDefaultValue;
18
- collectCollectionTab: z$1.ZodOptional<z$1.ZodType<"subscribed" | "created", unknown, z$1.core.$ZodTypeInternals<"subscribed" | "created", unknown>>> & SchemaHasDefaultValue;
19
- }, z$1.core.$strip>;
20
- declare const profileMainInspectorDefaultProps: {
21
- showCreateAction: boolean;
22
- requireLogin: boolean;
23
- tab: "history" | "collect" | "publish" | "like";
24
- likeTab: "video" | "post";
25
- historyTab: "video" | "post";
26
- collectTab: "video" | "post" | "collection";
27
- collectCollectionTab: "subscribed" | "created";
28
- };
29
- type ProfileMainInspectorProps = z$1.infer<typeof profileMainInspectorPropsSchema>;
11
+ declare const profileMainInspectorPropsSchema: zod.ZodObject<{}, zod_v4_core0.$strip>;
12
+ declare const profileMainInspectorDefaultProps: {};
13
+ type ProfileMainInspectorProps = InferSchemaProps<typeof profileMainInspectorPropsSchema>;
30
14
  interface ProfileMainRuntimeTabProps {
31
15
  tab?: string;
32
16
  likeTab?: string;
@@ -37,7 +21,13 @@ interface ProfileMainRuntimeTabProps {
37
21
  interface ProfileMainAuthConfig {
38
22
  headers?: Record<string, string>;
39
23
  }
40
- interface UserProfileMainProps extends Omit<ProfileMainInspectorProps, keyof ProfileMainRuntimeTabProps>, ProfileMainRuntimeTabProps {
24
+ interface UserProfileMainProps extends ProfileMainRuntimeTabProps {
25
+ /** 用户 ID。 */
26
+ id?: string;
27
+ /** 是否显示创建入口。 */
28
+ showCreateAction?: boolean;
29
+ /** 是否要求登录。 */
30
+ requireLogin?: boolean;
41
31
  /** 服务端透传的登录 Token。 */
42
32
  cookieToken?: string;
43
33
  /** 服务端透传的当前用户 ID。 */
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e,defineSelectEnumPropSchema as t,defineSwitchPropSchema as n,defineTextPropSchema as r,getSchemaDefaultProps as i}from"../../../../../utils/schema/schema.mjs";import{profileMainCollectCollectionTabOptions as a,profileMainCollectTabOptions as o,profileMainHistoryTabOptions as s,profileMainLikeTabOptions as c,profileMainTabOptions as l}from"./variants.mjs";const u=e({id:r({label:`用户 ID`,required:!1}),showCreateAction:n({label:`显示创建入口`,defaultValue:!1,required:!1}),requireLogin:n({label:`需要登录`,defaultValue:!1,required:!1}),tab:t(l,{label:`主 Tab`,defaultValue:`collect`,required:!1}),likeTab:t(c,{label:`点赞子 Tab`,defaultValue:`video`,required:!1}),historyTab:t(s,{label:`历史子 Tab`,defaultValue:`video`,required:!1}),collectTab:t(o,{label:`收藏子 Tab`,defaultValue:`video`,required:!1}),collectCollectionTab:t(a,{label:`收藏合集子 Tab`,defaultValue:`created`,required:!1})}),d=i(u);export{d as profileMainInspectorDefaultProps,u as profileMainInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e({}),r=t(n);export{r as profileMainInspectorDefaultProps,n as profileMainInspectorPropsSchema};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{pCommunityDeleteContent as e}from"../../../../../../../service/generated/client.mjs";import{DeleteConfirmDialog as t}from"../../../../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{useDeleteRequest as n,useMutation as r,usePaginated as i,useUpdateRequest as a}from"../../../../../../../hooks/query/use-query.mjs";import{useAppContext as o}from"../../../../../../../hooks/use-app-context/index.mjs";import{UserActivityList as s}from"../../../../../../common/list/user-activity-list/user-activity-list.mjs";import{getPublishData as c}from"../../utils.mjs";import{useState as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{toast as p}from"sonner";import{useTranslations as m}from"next-intl";function h(e,t,n){if(!e)return e;let r=0,i=e.pages.map(e=>({page:e,filteredList:(e.data?.list??[]).filter(e=>{let i=n(e)??``,a=t.has(i);return a&&(r+=1),!a})}));return{...e,pages:i.map(({page:e,filteredList:t})=>{if(!e.data)return e;let n=typeof e.data.total==`number`?Math.max(0,e.data.total-r):e.data.total;return{...e,data:{...e.data,list:t,total:n}}})}}function g({targetUserId:g,queryKeyPrefix:_,isMine:v=!1}){let y=m(`components.pages.profile.components.tabs`),b=o()===`renderer`,x=_??[],S=n(),C=a(),[w,T]=l(null),{mutateAsync:E,isPending:D}=r(async t=>await e({content_id:t})),{data:O,isFetching:k,fetchNextPage:A,hasNextPage:j}=i({key:[...x,`user-publish`],initialPageParam:1,async queryFn(e){return c({targetUserId:g,page:e})},options:{staleTime:0,enabled:b},getNextPageParam(e,t){let n=e?.data||{},r=n.list||[];if(typeof n.has_more==`boolean`)return n.has_more?t.length+1:void 0;if(!(r.length===0||n.total===0))return t.length+1}}),M=O?.pages.flatMap(e=>(e?.data||{}).list||[])??[];function N(e){T(e)}function P(){T(null)}async function F(){if(!(!w||D))try{await E(w);let e=new Set([w]);C([...x,`user-publish`],t=>h(t,e,e=>e.content_id)),p.success(y(`publishTab.deleteSuccess`)),T(null)}catch(e){console.error(`删除内容失败`,e),p.error(y(`publishTab.deleteFailed`))}}let I=M.map(e=>({...e,isDeleting:D&&w===e.content_id,onDelete:()=>N(e.content_id??``)})),L=async()=>{b&&await A()};function R(){S([...x,`user-publish`]),S(x)}function z(e){console.log(`分享到微信:`,e)}function B(e){console.log(`分享到QQ:`,e)}function V(e){console.log(`分享到朋友圈:`,e)}return f(u,{children:[d(s,{list:I,loading:k,hasMore:j,loadMore:L,canEdit:v,showGroupHeaders:!1,emptyText:y(`publishTab.emptyText`),onActionSuccess:R,onShareWeChat:z,onShareQQ:B,onShareMoments:V}),d(t,{open:!!w,onOpenChange:e=>!e&&P(),onCancel:P,onConfirm:F,isConfirming:D})]})}export{g as PublishTab};
2
+ "use client";import{pCommunityDeleteContent as e}from"../../../../../../../service/generated/client.mjs";import{useDeleteRequest as t,useMutation as n,usePaginated as r,useUpdateRequest as i}from"../../../../../../../hooks/query/use-query.mjs";import{useAppContext as a}from"../../../../../../../hooks/use-app-context/index.mjs";import{DeleteConfirmDialog as o}from"../../../../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{UserActivityList as s}from"../../../../../../common/list/user-activity-list/user-activity-list.mjs";import{getPublishData as c}from"../../utils.mjs";import{useState as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{toast as p}from"sonner";import{useTranslations as m}from"next-intl";function h(e,t,n){if(!e)return e;let r=0,i=e.pages.map(e=>({page:e,filteredList:(e.data?.list??[]).filter(e=>{let i=n(e)??``,a=t.has(i);return a&&(r+=1),!a})}));return{...e,pages:i.map(({page:e,filteredList:t})=>{if(!e.data)return e;let n=typeof e.data.total==`number`?Math.max(0,e.data.total-r):e.data.total;return{...e,data:{...e.data,list:t,total:n}}})}}function g({targetUserId:g,queryKeyPrefix:_,isMine:v=!1}){let y=m(`components.pages.profile.components.tabs`),b=a()===`renderer`,x=_??[],S=t(),C=i(),[w,T]=l(null),{mutateAsync:E,isPending:D}=n(async t=>await e({content_id:t})),{data:O,isFetching:k,fetchNextPage:A,hasNextPage:j}=r({key:[...x,`user-publish`],initialPageParam:1,async queryFn(e){return c({targetUserId:g,page:e})},options:{staleTime:0,enabled:b},getNextPageParam(e,t){let n=e?.data||{},r=n.list||[];if(typeof n.has_more==`boolean`)return n.has_more?t.length+1:void 0;if(!(r.length===0||n.total===0))return t.length+1}}),M=O?.pages.flatMap(e=>(e?.data||{}).list||[])??[];function N(e){T(e)}function P(){T(null)}async function F(){if(!(!w||D))try{await E(w);let e=new Set([w]);C([...x,`user-publish`],t=>h(t,e,e=>e.content_id)),p.success(y(`publishTab.deleteSuccess`)),T(null)}catch(e){console.error(`删除内容失败`,e),p.error(y(`publishTab.deleteFailed`))}}let I=M.map(e=>({...e,isDeleting:D&&w===e.content_id,onDelete:()=>N(e.content_id??``)})),L=async()=>{b&&await A()};function R(){S([...x,`user-publish`]),S(x)}function z(e){console.log(`分享到微信:`,e)}function B(e){console.log(`分享到QQ:`,e)}function V(e){console.log(`分享到朋友圈:`,e)}return f(u,{children:[d(s,{list:I,loading:k,hasMore:j,loadMore:L,canEdit:v,showGroupHeaders:!1,emptyText:y(`publishTab.emptyText`),onActionSuccess:R,onShareWeChat:z,onShareQQ:B,onShareMoments:V}),d(o,{open:!!w,onOpenChange:e=>!e&&P(),onCancel:P,onConfirm:F,isConfirming:D})]})}export{g as PublishTab};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{mergeStyles as e}from"../../../../../utils/styles/helpers.mjs";import{useUserStore as t}from"../../../../../../../store/modules/user-store.mjs";import{pInteractionCheckFollow as n}from"../../../../../../../service/generated/client.mjs";import{pxToVw as r}from"../../../../../../../utils/helper.mjs";import{Avatar as i,AvatarFallback as a,AvatarImage as o}from"../../../../../../ui/avatar.mjs";import{Box as s}from"../../../../../../ui/box.mjs";import{Text as c}from"../../../../../../ui/text.mjs";import{useRequest as l}from"../../../../../../../hooks/query/use-query.mjs";import u from"../../../../../../ui/link.mjs";import{defaultProps as d}from"../defaults/default-props.mjs";import f from"../../../../../../../assets/icons/follow_nor.mjs";import p from"../../../../../../../assets/icons/follow_sel.mjs";import{RecommendedUsersSkeleton as m}from"./recommended-users-skeleton.mjs";import{useEffect as h,useMemo as g,useRef as _,useState as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";const x={},S={list:[]};function C({props:C=x,styles:w,data:T=S}){function E(e){let t=new Set;return e.filter(e=>e.user_id?t.has(e.user_id)?!1:(t.add(e.user_id),!0):!0)}let D={...d,...C},{userId:O,isLogin:k}=t(),{title:A,avatarSize:j,followButtonSize:M,itemGap:N,listPadding:P,nameFontSize:F}=D,[I,L]=v(()=>E(T.list||[])),R=_(T.list),z=g(()=>I.map(e=>e.user_id).filter(Boolean),[I]),B=g(()=>z.join(`,`),[z]),{data:V}=l(g(()=>[`recommended-users`,`follow-status`,O,B],[B,O]),()=>n({follower_id:O,followee_ids:z}),{staleTime:0,enabled:!!k&&!!O&&z.length>0}),H=!!V?.data?.is_following_map;h(()=>{R.current!==T.list&&(R.current=T.list,L(E(T.list||[])))},[T.list]),h(()=>{let e=V?.data?.is_following_map;!e||Object.keys(e).length===0||L(t=>t.filter(e=>e.user_id?!(k&&O&&e.user_id===O):!0).map(t=>!t.user_id||e[t.user_id]===void 0?t:{...t,isFollow:!!e[t.user_id]}))},[V?.data?.is_following_map,k,O]);let U=w?e(w,{}):void 0,W=M+12;return b(s,{style:U,className:`mb-[16px]`,children:[y(c,{as:`h2`,className:`text-[18px] font-bold text-text1 mb-[8px] px-[12px] pt-[16px]`,children:A}),I&&I.length>0?y(s,{className:`overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:y(s,{className:`flex h-[62px]`,style:{paddingLeft:r(P),gap:r(N)},children:I.map((e,t)=>b(u,{href:`/profile/${e.user_id}`,className:`flex flex-col items-center shrink-0`,style:{paddingRight:t===I.length-1?r(P):0},children:[b(s,{className:`relative flex flex-col items-center`,children:[b(i,{size:`lg`,children:[e.avatar?y(o,{src:e.avatar,alt:e.nick_name}):null,y(a,{})]}),y(s,{className:`absolute`,style:{width:r(W),height:r(W),bottom:`-${r(W/2)}`,border:`${r(6)} solid rgba(255,255,255,0)`,boxSizing:`border-box`,borderRadius:`9999px`,display:`flex`,alignItems:`center`,justifyContent:`center`,opacity:k?H?1:.6:1},children:k&&H&&e.isFollow?y(p,{width:M,height:M}):y(f,{width:M,height:M})})]}),y(c,{className:`text-center mt-[8px] text-text1 whitespace-nowrap overflow-hidden text-ellipsis`,style:{fontSize:r(F),maxWidth:r(j+20)},title:e.nick_name,children:e.nick_name})]},e.user_id||`user-${t}`))})}):y(m,{avatarSize:j,followButtonSize:M,itemGap:N,listPadding:P,nameFontSize:F,itemCount:7})]})}export{C as default};
2
+ "use client";import{mergeStyles as e}from"../../../../../utils/styles/helpers.mjs";import{useUserStore as t}from"../../../../../../../store/modules/user-store.mjs";import{pInteractionCheckFollow as n}from"../../../../../../../service/generated/client.mjs";import{pxToVw as r}from"../../../../../../../utils/helper.mjs";import{Avatar as i,AvatarFallback as a,AvatarImage as o}from"../../../../../../ui/avatar.mjs";import{Box as s}from"../../../../../../ui/box.mjs";import{Text as c}from"../../../../../../ui/text.mjs";import l from"../../../../../../ui/link.mjs";import{useRequest as u}from"../../../../../../../hooks/query/use-query.mjs";import{defaultProps as d}from"../defaults/default-props.mjs";import f from"../../../../../../../assets/icons/follow_nor.mjs";import p from"../../../../../../../assets/icons/follow_sel.mjs";import{RecommendedUsersSkeleton as m}from"./recommended-users-skeleton.mjs";import{useEffect as h,useMemo as g,useRef as _,useState as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";const x={},S={list:[]};function C({props:C=x,styles:w,data:T=S}){function E(e){let t=new Set;return e.filter(e=>e.user_id?t.has(e.user_id)?!1:(t.add(e.user_id),!0):!0)}let D={...d,...C},{userId:O,isLogin:k}=t(),{title:A,avatarSize:j,followButtonSize:M,itemGap:N,listPadding:P,nameFontSize:F}=D,[I,L]=v(()=>E(T.list||[])),R=_(T.list),z=g(()=>I.map(e=>e.user_id).filter(Boolean),[I]),B=g(()=>z.join(`,`),[z]),{data:V}=u(g(()=>[`recommended-users`,`follow-status`,O,B],[B,O]),()=>n({follower_id:O,followee_ids:z}),{staleTime:0,enabled:!!k&&!!O&&z.length>0}),H=!!V?.data?.is_following_map;h(()=>{R.current!==T.list&&(R.current=T.list,L(E(T.list||[])))},[T.list]),h(()=>{let e=V?.data?.is_following_map;!e||Object.keys(e).length===0||L(t=>t.filter(e=>e.user_id?!(k&&O&&e.user_id===O):!0).map(t=>!t.user_id||e[t.user_id]===void 0?t:{...t,isFollow:!!e[t.user_id]}))},[V?.data?.is_following_map,k,O]);let U=w?e(w,{}):void 0,W=M+12;return b(s,{style:U,className:`mb-[16px]`,children:[y(c,{as:`h2`,className:`text-[18px] font-bold text-text1 mb-[8px] px-[12px] pt-[16px]`,children:A}),I&&I.length>0?y(s,{className:`overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:y(s,{className:`flex h-[62px]`,style:{paddingLeft:r(P),gap:r(N)},children:I.map((e,t)=>b(l,{href:`/profile/${e.user_id}`,className:`flex flex-col items-center shrink-0`,style:{paddingRight:t===I.length-1?r(P):0},children:[b(s,{className:`relative flex flex-col items-center`,children:[b(i,{size:`lg`,children:[e.avatar?y(o,{src:e.avatar,alt:e.nick_name}):null,y(a,{})]}),y(s,{className:`absolute`,style:{width:r(W),height:r(W),bottom:`-${r(W/2)}`,border:`${r(6)} solid rgba(255,255,255,0)`,boxSizing:`border-box`,borderRadius:`9999px`,display:`flex`,alignItems:`center`,justifyContent:`center`,opacity:k?H?1:.6:1},children:k&&H&&e.isFollow?y(p,{width:M,height:M}):y(f,{width:M,height:M})})]}),y(c,{className:`text-center mt-[8px] text-text1 whitespace-nowrap overflow-hidden text-ellipsis`,style:{fontSize:r(F),maxWidth:r(j+20)},title:e.nick_name,children:e.nick_name})]},e.user_id||`user-${t}`))})}):y(m,{avatarSize:j,followButtonSize:M,itemGap:N,listPadding:P,nameFontSize:F,itemCount:7})]})}export{C as default};
@@ -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{defaultProps as r}from"../defaults/default-props.mjs";import i from"../../../../../../../assets/icons/left_arrow.mjs";import a from"../../../../../basics/logo/variants/basic-logo/index.mjs";import o from"../../../../../basics/search/variants/simple-search/index.mjs";import{useRouter as s}from"next/navigation";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u={},d={list:[]};function f({props:f=u,styles:p,events:m,data:h=d}){let g={...r,...f},_=s(),{logo:v,search:y,gap:b=r.gap}=g,{list:x}=h,S=()=>{m?.onLogoClick?.()},C=(e,t)=>{m?.onLogoChannelChange?.(e,t)},w=()=>{m?.onSearchClick?.()},T=p?e(p,{}):void 0;return l(n,{as:`header`,className:`w-full bg-black flex justify-between items-center px-[16px] py-[8px]`,style:{...b>0?{gap:t(b)}:void 0,...T},children:[l(`div`,{className:`flex items-center`,children:[c(i,{className:`mr-4 cursor-pointer`,onClick:()=>{_.back()}}),c(a,{props:v,events:{onClick:S,onChannelChange:C},data:x})]}),c(o,{props:y,events:{onClick:w}})]})}export{f 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{defaultProps as r}from"../defaults/default-props.mjs";import i from"../../../../../../../assets/icons/left_arrow.mjs";import a from"../../../../../basics/logo/variants/basic-logo/index.mjs";import o from"../../../../../basics/search/variants/simple-search/index.mjs";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{useRouter as l}from"next/navigation";const u={},d={list:[]};function f({props:f=u,styles:p,events:m,data:h=d}){let g={...r,...f},_=l(),{logo:v,search:y,gap:b=r.gap}=g,{list:x}=h,S=()=>{m?.onLogoClick?.()},C=(e,t)=>{m?.onLogoChannelChange?.(e,t)},w=()=>{m?.onSearchClick?.()},T=p?e(p,{}):void 0;return c(n,{as:`header`,className:`w-full bg-black flex justify-between items-center px-[16px] py-[8px]`,style:{...b>0?{gap:t(b)}:void 0,...T},children:[c(`div`,{className:`flex items-center`,children:[s(i,{className:`mr-4 cursor-pointer`,onClick:()=>{_.back()}}),s(a,{props:v,events:{onClick:S,onChannelChange:C},data:x})]}),s(o,{props:y,events:{onClick:w}})]})}export{f as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{updateUrlParams as e}from"../../../../utils/common.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{DeleteConfirmDialog as n}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{useSearchHistory as r}from"../../../../hooks/use-search-history.mjs";import{useRouter as i}from"next/navigation";import{useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c({rows:c,title:l,clearText:u=`清理`,confirmDescription:d=`确认删除全部搜索历史吗?`,storageKey:f,onHistoryClick:p}){let{userInfo:m}=t(),h=f||m?.user_id||`guest`,g=i(),[_,v]=a(!1),{history:y,clearHistory:b}=r({storageKey:h});return y.length===0?null:s(`div`,{className:`w-full bg-transparent pt-[12px] px-[12px] relative z-0`,children:[s(`div`,{className:`w-full flex items-center justify-between mb-[12px]`,children:[o(`span`,{className:`text-[16px] font-bold text-text1`,children:l}),s(`div`,{onClick:()=>v(!0),className:`cursor-pointer flex items-center gap-[4px]`,children:[o(`span`,{className:`text-text2 text-[14px] font-normal leading-[22px] text-right`,style:{fontFamily:`"Source Code Pro"`},children:u}),o(`svg`,{className:`w-[12px] h-[12px] text-text3`,viewBox:`0 0 12 12`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:o(`path`,{d:`M4.8295 0C4.71306 0 4.60139 0.0511359 4.51905 0.142158C4.43671 0.233181 4.39046 0.356633 4.39046 0.485358V2.5889H0.439046C0.322604 2.5889 0.210931 2.64004 0.128594 2.73106C0.0462565 2.82208 0 2.94553 0 3.07426V5.66316C0 5.79189 0.0462565 5.91534 0.128594 6.00636C0.210931 6.09738 0.322604 6.14852 0.439046 6.14852H0.878092V11.5146C0.878092 11.6434 0.924348 11.7668 1.00669 11.8578C1.08902 11.9489 1.2007 12 1.31714 12H10.6829C10.7993 12 10.911 11.9489 10.9933 11.8578C11.0757 11.7668 11.1219 11.6434 11.1219 11.5146V6.14852H11.561C11.6774 6.14852 11.7891 6.09738 11.8714 6.00636C11.9537 5.91534 12 5.79189 12 5.66316V3.07426C12 2.94553 11.9537 2.82208 11.8714 2.73106C11.7891 2.64004 11.6774 2.5889 11.561 2.5889H7.60954V0.485358C7.60954 0.356633 7.56328 0.233181 7.48095 0.142158C7.39861 0.0511359 7.28694 0 7.1705 0H4.8295ZM10.2438 11.0293H8.78092V9.54603C8.78092 9.4173 8.73466 9.29385 8.65232 9.20283C8.56999 9.1118 8.45831 9.06067 8.34187 9.06067C8.22543 9.06067 8.11376 9.1118 8.03142 9.20283C7.94908 9.29385 7.90282 9.4173 7.90282 9.54603V11.0293H6.43905V9.54117C6.43905 9.41245 6.39279 9.289 6.31045 9.19797C6.22812 9.10695 6.11644 9.05582 6 9.05582C5.88356 9.05582 5.77188 9.10695 5.68955 9.19797C5.60721 9.289 5.56095 9.41245 5.56095 9.54117V11.0303H4.09718V9.547C4.09718 9.41827 4.05092 9.29482 3.96858 9.2038C3.88624 9.11278 3.77457 9.06164 3.65813 9.06164C3.54169 9.06164 3.43001 9.11278 3.34768 9.2038C3.26534 9.29482 3.21908 9.41827 3.21908 9.547V11.0303H1.75618V6.17667H10.2438V11.0303V11.0293ZM5.26855 3.07426V0.970717H6.73145V3.07426C6.73145 3.20298 6.77771 3.32644 6.86004 3.41746C6.94238 3.50848 7.05405 3.55962 7.1705 3.55962H11.1219V5.1778H0.878092V3.55962H4.8295C4.94595 3.55962 5.05762 3.50848 5.13996 3.41746C5.22229 3.32644 5.26855 3.20298 5.26855 3.07426Z`,fill:`currentColor`})})]})]}),o(`div`,{className:`w-full overflow-hidden ${c===`1`?`h-[30px]`:c===`2`?`h-[72px]`:`h-[114px]`}`,children:o(`ul`,{className:`list-none m-0 p-0 w-full flex flex-wrap gap-[12px]`,children:y.map((t,n)=>o(`li`,{className:`h-[30px] px-[12px] bg-bg2 rounded-[4px] flex items-center justify-center cursor-pointer`,onClick:()=>{p?p(t):(e({q:t}),g.push(`${window.location.pathname}?q=${encodeURIComponent(t)}`))},children:o(`div`,{className:`text-text1 text-[14px] max-w-[124px] truncate`,children:t.length>8?`${t.slice(0,8)}...`:t})},`${t}-${n}`))})}),o(n,{open:_,onOpenChange:v,onConfirm:()=>{b(),v(!1)},title:``,description:d})]})}export{c as SearchHistoryClient};
2
+ "use client";import{updateUrlParams as e}from"../../../../utils/common.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{useSearchHistory as n}from"../../../../hooks/use-search-history.mjs";import{DeleteConfirmDialog as r}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{useState as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{useRouter as s}from"next/navigation";function c({rows:c,title:l,clearText:u=`清理`,confirmDescription:d=`确认删除全部搜索历史吗?`,storageKey:f,onHistoryClick:p}){let{userInfo:m}=t(),h=f||m?.user_id||`guest`,g=s(),[_,v]=i(!1),{history:y,clearHistory:b}=n({storageKey:h});return y.length===0?null:o(`div`,{className:`w-full bg-transparent pt-[12px] px-[12px] relative z-0`,children:[o(`div`,{className:`w-full flex items-center justify-between mb-[12px]`,children:[a(`span`,{className:`text-[16px] font-bold text-text1`,children:l}),o(`div`,{onClick:()=>v(!0),className:`cursor-pointer flex items-center gap-[4px]`,children:[a(`span`,{className:`text-text2 text-[14px] font-normal leading-[22px] text-right`,style:{fontFamily:`"Source Code Pro"`},children:u}),a(`svg`,{className:`w-[12px] h-[12px] text-text3`,viewBox:`0 0 12 12`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:a(`path`,{d:`M4.8295 0C4.71306 0 4.60139 0.0511359 4.51905 0.142158C4.43671 0.233181 4.39046 0.356633 4.39046 0.485358V2.5889H0.439046C0.322604 2.5889 0.210931 2.64004 0.128594 2.73106C0.0462565 2.82208 0 2.94553 0 3.07426V5.66316C0 5.79189 0.0462565 5.91534 0.128594 6.00636C0.210931 6.09738 0.322604 6.14852 0.439046 6.14852H0.878092V11.5146C0.878092 11.6434 0.924348 11.7668 1.00669 11.8578C1.08902 11.9489 1.2007 12 1.31714 12H10.6829C10.7993 12 10.911 11.9489 10.9933 11.8578C11.0757 11.7668 11.1219 11.6434 11.1219 11.5146V6.14852H11.561C11.6774 6.14852 11.7891 6.09738 11.8714 6.00636C11.9537 5.91534 12 5.79189 12 5.66316V3.07426C12 2.94553 11.9537 2.82208 11.8714 2.73106C11.7891 2.64004 11.6774 2.5889 11.561 2.5889H7.60954V0.485358C7.60954 0.356633 7.56328 0.233181 7.48095 0.142158C7.39861 0.0511359 7.28694 0 7.1705 0H4.8295ZM10.2438 11.0293H8.78092V9.54603C8.78092 9.4173 8.73466 9.29385 8.65232 9.20283C8.56999 9.1118 8.45831 9.06067 8.34187 9.06067C8.22543 9.06067 8.11376 9.1118 8.03142 9.20283C7.94908 9.29385 7.90282 9.4173 7.90282 9.54603V11.0293H6.43905V9.54117C6.43905 9.41245 6.39279 9.289 6.31045 9.19797C6.22812 9.10695 6.11644 9.05582 6 9.05582C5.88356 9.05582 5.77188 9.10695 5.68955 9.19797C5.60721 9.289 5.56095 9.41245 5.56095 9.54117V11.0303H4.09718V9.547C4.09718 9.41827 4.05092 9.29482 3.96858 9.2038C3.88624 9.11278 3.77457 9.06164 3.65813 9.06164C3.54169 9.06164 3.43001 9.11278 3.34768 9.2038C3.26534 9.29482 3.21908 9.41827 3.21908 9.547V11.0303H1.75618V6.17667H10.2438V11.0303V11.0293ZM5.26855 3.07426V0.970717H6.73145V3.07426C6.73145 3.20298 6.77771 3.32644 6.86004 3.41746C6.94238 3.50848 7.05405 3.55962 7.1705 3.55962H11.1219V5.1778H0.878092V3.55962H4.8295C4.94595 3.55962 5.05762 3.50848 5.13996 3.41746C5.22229 3.32644 5.26855 3.20298 5.26855 3.07426Z`,fill:`currentColor`})})]})]}),a(`div`,{className:`w-full overflow-hidden ${c===`1`?`h-[30px]`:c===`2`?`h-[72px]`:`h-[114px]`}`,children:a(`ul`,{className:`list-none m-0 p-0 w-full flex flex-wrap gap-[12px]`,children:y.map((t,n)=>a(`li`,{className:`h-[30px] px-[12px] bg-bg2 rounded-[4px] flex items-center justify-center cursor-pointer`,onClick:()=>{p?p(t):(e({q:t}),g.push(`${window.location.pathname}?q=${encodeURIComponent(t)}`))},children:a(`div`,{className:`text-text1 text-[14px] max-w-[124px] truncate`,children:t.length>8?`${t.slice(0,8)}...`:t})},`${t}-${n}`))})}),a(r,{open:_,onOpenChange:v,onConfirm:()=>{b(),v(!1)},title:``,description:d})]})}export{c as SearchHistoryClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import e from"../../../../assets/icons/clear.mjs";import{updateUrlParams as t}from"../../../../utils/common.mjs";import{useUserStore as n}from"../../../../store/modules/user-store.mjs";import{Input as r}from"../../../ui/input.mjs";import{useSearchHistory as i}from"../../../../hooks/use-search-history.mjs";import a from"../../../../assets/icons/search.mjs";import{isPCEnv as o}from"../../../../utils/tools.mjs";import{HeaderNav as s}from"../../../common/header-nav/client.mjs";import c from"../../../pages/search/style.module.mjs";import{useRouter as l}from"next/navigation";import{useCallback as u,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";function m({placeholder:m,defaultPlaceholder:h=`搜索视频`,searchLabel:g=`搜索`}){let[_,v]=d(``),y=l(),{userInfo:b}=n(),{addHistory:x}=i({storageKey:b?.user_id||`guest`}),S=u(e=>{let n=e||_||h;n.trim()&&(x(n),t({q:n}),y.push(`${window.location.pathname}?q=${encodeURIComponent(n)}`))},[_,h,y,x]);return f(s,{className:`h-[55px]`,rightChild:f(`div`,{className:`cursor-pointer w-[52px] flex items-center justify-center`,onClick:()=>S(_),children:f(`span`,{className:`text-[16px] text-text1`,children:g})}),centerChild:p(`header`,{className:`w-[calc(100%-52px-48px)] ml-[-15px] h-[35px] rounded-[20px] flex items-center justify-center relative overflow-hidden border-line1 border-[1px]`,children:[f(`div`,{className:`absolute left-0 top-0 w-full h-full bg-bg2 opacity-50`}),f(a,{className:`w-[16px] h-[16px] text-text3 absolute left-[12px] top-[9px] z-[1]`}),f(r,{id:`search-input-field`,placeholder:m||h,maxLength:20,value:_,className:c.searchInput,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),S(_))}}),_&&f(e,{className:`w-[15px] h-[15px] text-text3 z-10 absolute right-[12px] cursor-pointer`,onClick:()=>{o()||(v(``),t({q:``}),y.push(window.location.pathname))}})]})})}export{m as SearchInputClient};
2
+ "use client";import{updateUrlParams as e}from"../../../../utils/common.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{Input as n}from"../../../ui/input.mjs";import{useSearchHistory as r}from"../../../../hooks/use-search-history.mjs";import{isPCEnv as i}from"../../../../utils/tools.mjs";import{HeaderNav as a}from"../../../common/header-nav/client.mjs";import o from"../../../../assets/icons/search.mjs";import s from"../../../../assets/icons/clear.mjs";import c from"../../../pages/search/style.module.mjs";import{useCallback as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useRouter as p}from"next/navigation";function m({placeholder:m,defaultPlaceholder:h=`搜索视频`,searchLabel:g=`搜索`}){let[_,v]=u(``),y=p(),{userInfo:b}=t(),{addHistory:x}=r({storageKey:b?.user_id||`guest`}),S=l(t=>{let n=t||_||h;n.trim()&&(x(n),e({q:n}),y.push(`${window.location.pathname}?q=${encodeURIComponent(n)}`))},[_,h,y,x]);return d(a,{className:`h-[55px]`,rightChild:d(`div`,{className:`cursor-pointer w-[52px] flex items-center justify-center`,onClick:()=>S(_),children:d(`span`,{className:`text-[16px] text-text1`,children:g})}),centerChild:f(`header`,{className:`w-[calc(100%-52px-48px)] ml-[-15px] h-[35px] rounded-[20px] flex items-center justify-center relative overflow-hidden border-line1 border-[1px]`,children:[d(`div`,{className:`absolute left-0 top-0 w-full h-full bg-bg2 opacity-50`}),d(o,{className:`w-[16px] h-[16px] text-text3 absolute left-[12px] top-[9px] z-[1]`}),d(n,{id:`search-input-field`,placeholder:m||h,maxLength:20,value:_,className:c.searchInput,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),S(_))}}),_&&d(s,{className:`w-[15px] h-[15px] text-text3 z-10 absolute right-[12px] cursor-pointer`,onClick:()=>{i()||(v(``),e({q:``}),y.push(window.location.pathname))}})]})})}export{m as SearchInputClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import n from"../../../ui/link.mjs";import r from"../../../../assets/icons/tabs/follow.mjs";import i from"../../../../assets/icons/tabs/follow_active.mjs";import a from"../../../../assets/icons/tabs/home.mjs";import o from"../../../../assets/icons/tabs/home_active.mjs";import s from"../../../../assets/icons/tabs/mine.mjs";import c from"../../../../assets/icons/tabs/mine_active.mjs";import{usePathname as l}from"next/navigation";import{useEffect as u,useState as d,useTransition as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";const g=`env(safe-area-inset-bottom, 0px)`;function _(e,t){if(t!==`/`)return e.startsWith(t);let n=[`/user`].some(t=>e.startsWith(t)),r=e.startsWith(`/category/`);return!n&&(e===`/`||r)}const v={home:{icon:a,activeIcon:o},follow:{icon:r,activeIcon:i},mine:{icon:s,activeIcon:c}};function y({items:r}){let i=l(),[a,o]=d(null),[,s]=f(),[c,y]=d(!1);return u(()=>{y(!0)},[]),u(()=>{a&&_(i,a)&&s(()=>{o(null)})},[i,a]),!r||r.length===0?null:m(e,{className:`fixed bottom-0 left-0 right-0 bg-bg1 border-t border-line1 flex items-center justify-around z-50`,style:{height:`calc(56px + ${g})`,paddingBottom:g},children:r.map((r,s)=>{let l=c?_(a||i||``,r.path):!1,u=v[r.iconType]||v.home,d=h(p,{children:[m(l?u.activeIcon:u.icon,{width:22,height:22}),m(t,{className:`text-[10px] mt-[4px] ${l?`text-theme5`:`text-text2`}`,children:r.label})]});return l?m(e,{className:`flex flex-col items-center justify-center flex-1 h-full`,children:d},`${r.path}-${s}`):m(n,{href:r.path,prefetch:!0,className:`flex flex-col items-center justify-center flex-1 h-full`,onClick:()=>{r.path!==i&&o(r.path)},children:d},`${r.path}-${s}`)})})}export{y as TabBarClient};
2
+ "use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import n from"../../../ui/link.mjs";import r from"../../../../assets/icons/tabs/follow.mjs";import i from"../../../../assets/icons/tabs/follow_active.mjs";import a from"../../../../assets/icons/tabs/home.mjs";import o from"../../../../assets/icons/tabs/home_active.mjs";import s from"../../../../assets/icons/tabs/mine.mjs";import c from"../../../../assets/icons/tabs/mine_active.mjs";import{useEffect as l,useState as u,useTransition as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{usePathname as h}from"next/navigation";const g=`env(safe-area-inset-bottom, 0px)`;function _(e,t){if(t!==`/`)return e.startsWith(t);let n=[`/user`].some(t=>e.startsWith(t)),r=e.startsWith(`/category/`);return!n&&(e===`/`||r)}const v={home:{icon:a,activeIcon:o},follow:{icon:r,activeIcon:i},mine:{icon:s,activeIcon:c}};function y({items:r}){let i=h(),[a,o]=u(null),[,s]=d(),[c,y]=u(!1);return l(()=>{y(!0)},[]),l(()=>{a&&_(i,a)&&s(()=>{o(null)})},[i,a]),!r||r.length===0?null:p(e,{className:`fixed bottom-0 left-0 right-0 bg-bg1 border-t border-line1 flex items-center justify-around z-50`,style:{height:`calc(56px + ${g})`,paddingBottom:g},children:r.map((r,s)=>{let l=c?_(a||i||``,r.path):!1,u=v[r.iconType]||v.home,d=m(f,{children:[p(l?u.activeIcon:u.icon,{width:22,height:22}),p(t,{className:`text-[10px] mt-[4px] ${l?`text-theme5`:`text-text2`}`,children:r.label})]});return l?p(e,{className:`flex flex-col items-center justify-center flex-1 h-full`,children:d},`${r.path}-${s}`):p(n,{href:r.path,prefetch:!0,className:`flex flex-col items-center justify-center flex-1 h-full`,onClick:()=>{r.path!==i&&o(r.path)},children:d},`${r.path}-${s}`)})})}export{y as TabBarClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{updateUrlParams as e}from"../../../../utils/common.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as n}from"../../../../service/generated/client.mjs";import{useRequest as r}from"../../../../hooks/query/use-query.mjs";import i from"../../../../assets/icons/refresh.mjs";import{useRouter as a}from"next/navigation";import{useMemo as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u({title:u,count:d,initialList:f=[],defaultTitle:p=`推荐搜索`}){let{userInfo:m}=t(),h=m?.user_id||`guest`,g=a(),[_,v]=s(null),{data:y,refetch:b,isFetching:x}=r([`hotSearchKey`,h],()=>n({user_id:h}),{enabled:!1}),S=o(()=>_||(y?.data?.recommend_list??f).slice(0,Number(d||6)),[y,_,f,d]),C=async()=>{let e=await b();e.data?.data?.recommend_list&&v(e.data.data.recommend_list)},w=t=>{e({q:t}),g.push(`${window.location.pathname}?q=${encodeURIComponent(t)}`)};return l(`div`,{className:`w-full mb-[24px] pt-[8px]`,children:[l(`div`,{className:`w-full px-[12px] h-[24px] mb-[12px] flex items-center justify-between`,children:[c(`span`,{className:`leading-[24px] text-[16px] text-text1 font-semibold`,children:u||p}),c(`div`,{className:`h-full px-[12px] flex items-center cursor-pointer`,onClick:C,children:c(i,{className:`w-[16px] h-[16px] text-text2 ${x?`animate-spin`:``}`})})]}),c(`div`,{className:`w-full px-[12px] flex gap-y-[16px] flex-wrap`,children:x&&!_?Array.from({length:Number(d||6)}).map((e,t)=>c(`div`,{className:`w-[50%] ${t%2==0?`pr-[4px]`:`pl-[4px]`}`,children:c(`div`,{className:`w-[70%] h-[22px] bg-bg2 animate-pulse rounded`})},`skeleton-${t}`)):S.map((e,t)=>c(`div`,{className:`w-[50%] ${t%2==0?`pr-[4px]`:`pl-[4px]`} cursor-pointer`,onClick:()=>w(e.title||``),children:c(`span`,{className:`text-text1 text-[14px] leading-[22px] max-w-[90%] line-clamp-1`,children:e.title})},String(e.title??t)))})]})}export{u as TextRecommendClient};
2
+ "use client";import{updateUrlParams as e}from"../../../../utils/common.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as n}from"../../../../service/generated/client.mjs";import{useRequest as r}from"../../../../hooks/query/use-query.mjs";import i from"../../../../assets/icons/refresh.mjs";import{useMemo as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{useRouter as l}from"next/navigation";function u({title:u,count:d,initialList:f=[],defaultTitle:p=`推荐搜索`}){let{userInfo:m}=t(),h=m?.user_id||`guest`,g=l(),[_,v]=o(null),{data:y,refetch:b,isFetching:x}=r([`hotSearchKey`,h],()=>n({user_id:h}),{enabled:!1}),S=a(()=>_||(y?.data?.recommend_list??f).slice(0,Number(d||6)),[y,_,f,d]),C=async()=>{let e=await b();e.data?.data?.recommend_list&&v(e.data.data.recommend_list)},w=t=>{e({q:t}),g.push(`${window.location.pathname}?q=${encodeURIComponent(t)}`)};return c(`div`,{className:`w-full mb-[24px] pt-[8px]`,children:[c(`div`,{className:`w-full px-[12px] h-[24px] mb-[12px] flex items-center justify-between`,children:[s(`span`,{className:`leading-[24px] text-[16px] text-text1 font-semibold`,children:u||p}),s(`div`,{className:`h-full px-[12px] flex items-center cursor-pointer`,onClick:C,children:s(i,{className:`w-[16px] h-[16px] text-text2 ${x?`animate-spin`:``}`})})]}),s(`div`,{className:`w-full px-[12px] flex gap-y-[16px] flex-wrap`,children:x&&!_?Array.from({length:Number(d||6)}).map((e,t)=>s(`div`,{className:`w-[50%] ${t%2==0?`pr-[4px]`:`pl-[4px]`}`,children:s(`div`,{className:`w-[70%] h-[22px] bg-bg2 animate-pulse rounded`})},`skeleton-${t}`)):S.map((e,t)=>s(`div`,{className:`w-[50%] ${t%2==0?`pr-[4px]`:`pl-[4px]`} cursor-pointer`,onClick:()=>w(e.title||``),children:s(`span`,{className:`text-text1 text-[14px] leading-[22px] max-w-[90%] line-clamp-1`,children:e.title})},String(e.title??t)))})]})}export{u as TextRecommendClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{replaceAtUserElementHtmlStr as e}from"../../../utils/tools.mjs";import{useRouter as t}from"next/navigation";import{Fragment as n,jsx as r}from"react/jsx-runtime";import i from"html-react-parser";const a=[];function o(o){let{text:s=``,atUsers:c=a,enableNavigation:l=!0}=o,u=e({text:s,atUsers:c}),d=t();return r(n,{children:i(u,{replace:e=>{if(e.type===`tag`&&e.attribs&&e.attribs.class===`mention`){let t=e.attribs[`data-id`];if(!t)return e;let n=e.children&&e.children[0]?e.children[0].data:``;return r(`span`,{className:`mention text-theme1 transition-colors ${l?`hover:text-theme1/80 cursor-pointer`:``}`,"data-id":t,style:{pointerEvents:l?`auto`:`none`},onClick:l?e=>{e.preventDefault(),e.stopPropagation();let n=`/profile/${t}`;d.push(n)}:void 0,children:n})}return e}})})}export{o as default};
2
+ "use client";import{replaceAtUserElementHtmlStr as e}from"../../../utils/tools.mjs";import{Fragment as t,jsx as n}from"react/jsx-runtime";import{useRouter as r}from"next/navigation";import i from"html-react-parser";const a=[];function o(o){let{text:s=``,atUsers:c=a,enableNavigation:l=!0}=o,u=e({text:s,atUsers:c}),d=r();return n(t,{children:i(u,{replace:e=>{if(e.type===`tag`&&e.attribs&&e.attribs.class===`mention`){let t=e.attribs[`data-id`];if(!t)return e;let r=e.children&&e.children[0]?e.children[0].data:``;return n(`span`,{className:`mention text-theme1 transition-colors ${l?`hover:text-theme1/80 cursor-pointer`:``}`,"data-id":t,style:{pointerEvents:l?`auto`:`none`},onClick:l?e=>{e.preventDefault(),e.stopPropagation();let n=`/profile/${t}`;d.push(n)}:void 0,children:r})}return e}})})}export{o as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{AlertDialog as e,AlertDialogAction as t,AlertDialogContent as n,AlertDialogDescription as r,AlertDialogFooter as i,AlertDialogHeader as a,AlertDialogTitle as o}from"../../ui/alert-dialog.mjs";import{secondToTime as s}from"../../../utils/common.mjs";import{useBlockedModalStore as c}from"../../../store/modules/blocked-modal-store.mjs";import{useLoginModalStore as l}from"../../../store/modules/login-modal-store.mjs";import{useRouter as u}from"next/navigation";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useTranslations as p}from"next-intl";function m(){let m=u(),h=p(`components.common.blockedDialog`),{isOpen:g,blockedRemark:_,blockedEndTime:v,close:y,setOpen:b}=c(),x=v>0?s(v):h(`unblockTimePermanent`),S=_||h(`remarkDefault`);return d(e,{open:g,onOpenChange:e=>{b(e)},children:f(n,{size:`sm`,children:[f(a,{children:[d(o,{className:`text-[16px]`,children:h(`title`)}),d(r,{className:`text-center text-[14px] leading-6 whitespace-pre-line`,children:h(`description`,{remark:S,unblockTime:x})})]}),f(i,{children:[d(t,{onClick:()=>{l.getState().isOpen&&l.getState().setOpen(!1),y(),m.push(`/feedback`)},children:h(`contactSupport`)}),d(t,{onClick:y,children:h(`gotIt`)})]})]})})}export{m as BlockedDialog};
2
+ "use client";import{AlertDialog as e,AlertDialogAction as t,AlertDialogContent as n,AlertDialogDescription as r,AlertDialogFooter as i,AlertDialogHeader as a,AlertDialogTitle as o}from"../../ui/alert-dialog.mjs";import{secondToTime as s}from"../../../utils/common.mjs";import{useBlockedModalStore as c}from"../../../store/modules/blocked-modal-store.mjs";import{useLoginModalStore as l}from"../../../store/modules/login-modal-store.mjs";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useTranslations as f}from"next-intl";import{useRouter as p}from"next/navigation";function m(){let m=p(),h=f(`components.common.blockedDialog`),{isOpen:g,blockedRemark:_,blockedEndTime:v,close:y,setOpen:b}=c(),x=v>0?s(v):h(`unblockTimePermanent`),S=_||h(`remarkDefault`);return u(e,{open:g,onOpenChange:e=>{b(e)},children:d(n,{size:`sm`,children:[d(a,{children:[u(o,{className:`text-[16px]`,children:h(`title`)}),u(r,{className:`text-center text-[14px] leading-6 whitespace-pre-line`,children:h(`description`,{remark:S,unblockTime:x})})]}),d(i,{children:[u(t,{onClick:()=>{l.getState().isOpen&&l.getState().setOpen(!1),y(),m.push(`/feedback`)},children:h(`contactSupport`)}),u(t,{onClick:y,children:h(`gotIt`)})]})]})})}export{m as BlockedDialog};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gUserGetUserInfo as t}from"../../../service/generated/client.mjs";import{Toaster as n}from"../../ui/sonner.mjs";import{useRequest as r}from"../../../hooks/query/use-query.mjs";import{BlockedDialog as i}from"../blocked-dialog/blocked-dialog.mjs";import{CollectionPopupHost as a}from"../collection-popup/index.mjs";import{IntlProvider as o}from"../intl-provider/intl-provider.mjs";import{LoginDialog as s}from"../login-dialog/login-dialog.mjs";import{MediaPreview as c}from"../media-preview/index.mjs";import{useRouter as l}from"next/navigation";import{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{QueryClient as g,QueryClientProvider as _}from"@tanstack/react-query";import{NuqsAdapter as v}from"nuqs/adapters/next/app";function y(){let{userId:n,setUserInfo:i}=e(),a={code:0,message:``,data:{}},{data:o}=r([`user-init`,n],()=>n?t({user_id:n}):Promise.resolve(a),{enabled:!!n});return u(()=>{if(!n)return;let e=o?.data;e&&i(e)},[i,n,o]),null}function b(t){let{queryClient:r,intl:b,children:x}=t,[S]=f(()=>new g),C=r??S,w=l(),T=e(e=>e.isLogin&&!!e.token&&!!e.userId),E=d(T);u(()=>{E.current&&!T&&(C.clear(),w.refresh()),E.current=T},[T,C,w]);let D=h(p,{children:[m(y,{}),x,m(i,{}),m(s,{}),m(a,{}),m(n,{position:`top-center`}),m(c,{})]});return m(_,{client:C,children:m(v,{children:m(o,{...b,children:D})})})}export{b as FunhubProvider};
2
+ "use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gUserGetUserInfo as t}from"../../../service/generated/client.mjs";import{Toaster as n}from"../../ui/sonner.mjs";import{useRequest as r}from"../../../hooks/query/use-query.mjs";import{MediaPreview as i}from"../media-preview/index.mjs";import{CollectionPopupHost as a}from"../collection-popup/index.mjs";import{IntlProvider as o}from"../intl-provider/intl-provider.mjs";import{BlockedDialog as s}from"../blocked-dialog/blocked-dialog.mjs";import{LoginDialog as c}from"../login-dialog/login-dialog.mjs";import{useEffect as l,useRef as u,useState as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{QueryClient as h,QueryClientProvider as g}from"@tanstack/react-query";import{useRouter as _}from"next/navigation";import{NuqsAdapter as v}from"nuqs/adapters/next/app";function y(){let{userId:n,setUserInfo:i}=e(),a={code:0,message:``,data:{}},{data:o}=r([`user-init`,n],()=>n?t({user_id:n}):Promise.resolve(a),{enabled:!!n});return l(()=>{if(!n)return;let e=o?.data;e&&i(e)},[i,n,o]),null}function b(t){let{queryClient:r,intl:b,children:x}=t,[S]=d(()=>new h),C=r??S,w=_(),T=e(e=>e.isLogin&&!!e.token&&!!e.userId),E=u(T);l(()=>{E.current&&!T&&(C.clear(),w.refresh()),E.current=T},[T,C,w]);let D=m(f,{children:[p(y,{}),x,p(s,{}),p(c,{}),p(a,{}),p(n,{position:`top-center`}),p(i,{})]});return p(g,{client:C,children:p(v,{children:p(o,{...b,children:D})})})}export{b as FunhubProvider};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{toast as e}from"../../../ui.mjs";import{LeftArrowIcon as t}from"../icons/left-arrow.mjs";import{useRouter as n}from"next/navigation";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a({title:a,leftChild:o,centerChild:s,className:c,rightChild:l,leftIconCss:u,onBack:d}){let f=n();function p(){if(e.dismiss(),d){d?.();return}window.location.search.split(`from_code=`)[1]?f.push(`/`):f.back()}return r(`nav`,{className:`app-top-nav w-full relative ${c?.includes(`h-`)?(c.match(/h-\[?\d\w+\]?/)||[`h-12`])[0]:`h-12`}`,children:i(`div`,{className:`w-full bg-bg1 flex items-center justify-center fixed top-0 left-0 right-0 z-50 border-b border-text1/5 ${c}`,style:{willChange:`transform`,transform:`translateZ(0)`},children:[r(`div`,{className:`absolute z-[1] h-full left-0 top-0`,children:o||r(`div`,{onClick:p,className:`cursor-pointer h-full w-12 flex items-center justify-center`,children:r(t,{className:`w-4 h-4 text-text1 ${u}`})})}),s||r(`p`,{className:`text-text1 line-clamp-1 px-12 text-ellipsis text-lg`,children:a}),l&&r(`div`,{className:`absolute h-full right-2 top-0 flex items-center justify-center`,children:l})]})})}export{a as HeaderNav};
2
+ "use client";import{toast as e}from"../../../ui.mjs";import{LeftArrowIcon as t}from"../icons/left-arrow.mjs";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{useRouter as i}from"next/navigation";function a({title:a,leftChild:o,centerChild:s,className:c,rightChild:l,leftIconCss:u,onBack:d}){let f=i();function p(){if(e.dismiss(),d){d?.();return}window.location.search.split(`from_code=`)[1]?f.push(`/`):f.back()}return n(`nav`,{className:`app-top-nav w-full relative ${c?.includes(`h-`)?(c.match(/h-\[?\d\w+\]?/)||[`h-12`])[0]:`h-12`}`,children:r(`div`,{className:`w-full bg-bg1 flex items-center justify-center fixed top-0 left-0 right-0 z-50 border-b border-text1/5 ${c}`,style:{willChange:`transform`,transform:`translateZ(0)`},children:[n(`div`,{className:`absolute z-[1] h-full left-0 top-0`,children:o||n(`div`,{onClick:p,className:`cursor-pointer h-full w-12 flex items-center justify-center`,children:n(t,{className:`w-4 h-4 text-text1 ${u}`})})}),s||n(`p`,{className:`text-text1 line-clamp-1 px-12 text-ellipsis text-lg`,children:a}),l&&n(`div`,{className:`absolute h-full right-2 top-0 flex items-center justify-center`,children:l})]})})}export{a as HeaderNav};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";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{Time as r}from"../../ui/time.mjs";import{FollowButton as i}from"../../pages/(follow)/_components/follow-button/index.mjs";import{usePathname as a,useRouter as o}from"next/navigation";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l({className:l,infoData:u,onChangeFollow:d,rightChild:f}){let p=a(),m=o(),h=u?.author?.user_id||``,g=u?.author?.nickname||``,_=u?.show_at||u?.create_time;return s(t,{className:`w-full mb-[8px] pt-[16px] px-[12px] ${l}`,children:c(t,{className:`w-full flex items-center justify-between`,children:[c(t,{className:`flex items-center cursor-pointer`,onClick:e=>{e.stopPropagation(),e.preventDefault();let t=`/profile/${h}`;p!==t&&m.push(t)},children:[s(t,{className:`w-[36px] h-[36px] mr-[8px] rounded-full bg-bg2 overflow-hidden`,children:u?.author?.avatar&&s(e,{width:36,height:36,src:u?.author?.avatar,className:`w-full h-full object-cover`,alt:`avatar`})}),c(t,{className:`flex flex-col`,children:[s(n,{className:`block text-text1 text-[14px] leading-[18px] max-w-[220px] overflow-hidden whitespace-nowrap text-ellipsis`,children:g}),s(t,{className:`mt-[4px] h-[14px] leading-[14px]`,children:s(r,{mode:`relative`,value:_,className:`text-text3 text-[12px]`})})]})]}),s(t,{onClick:e=>{e.stopPropagation(),e.preventDefault()},children:f||(h?s(i,{userId:h,hasFollow:!1,onChange:d}):null)})]})})}export{l as default};
2
+ "use client";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{Time as r}from"../../ui/time.mjs";import{FollowButton as i}from"../../pages/(follow)/_components/follow-button/index.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{usePathname as s,useRouter as c}from"next/navigation";function l({className:l,infoData:u,onChangeFollow:d,rightChild:f}){let p=s(),m=c(),h=u?.author?.user_id||``,g=u?.author?.nickname||``,_=u?.show_at||u?.create_time;return a(t,{className:`w-full mb-[8px] pt-[16px] px-[12px] ${l}`,children:o(t,{className:`w-full flex items-center justify-between`,children:[o(t,{className:`flex items-center cursor-pointer`,onClick:e=>{e.stopPropagation(),e.preventDefault();let t=`/profile/${h}`;p!==t&&m.push(t)},children:[a(t,{className:`w-[36px] h-[36px] mr-[8px] rounded-full bg-bg2 overflow-hidden`,children:u?.author?.avatar&&a(e,{width:36,height:36,src:u?.author?.avatar,className:`w-full h-full object-cover`,alt:`avatar`})}),o(t,{className:`flex flex-col`,children:[a(n,{className:`block text-text1 text-[14px] leading-[18px] max-w-[220px] overflow-hidden whitespace-nowrap text-ellipsis`,children:g}),a(t,{className:`mt-[4px] h-[14px] leading-[14px]`,children:a(r,{mode:`relative`,value:_,className:`text-text3 text-[12px]`})})]})]}),a(t,{onClick:e=>{e.stopPropagation(),e.preventDefault()},children:f||(h?a(i,{userId:h,hasFollow:!1,onChange:d}):null)})]})})}export{l as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Box as e}from"../../../ui/box.mjs";import{List as t}from"../../../ui/list.mjs";import{Text as n}from"../../../ui/text.mjs";import{normalizeTimeToMilliseconds as r}from"../../../ui/time.mjs";import{PostListItemSkeleton as i}from"../../skeleton/post-list-item-skeleton.mjs";import{PostListItem as a}from"./post-list-item.mjs";import{useMemo as o}from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import{useTranslations as u}from"next-intl";import d from"next/link";import{useIsClient as f}from"foxact/use-is-client";import{orderBy as p}from"lodash-es";function m(e){let t=r(e);if(!t)return!1;let n=new Date(t),i=new Date;return n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()&&n.getDate()===i.getDate()}function h(r){let h=u(`components.ui.list`),g=f(),{list:_,loading:v,hasMore:y=!1,loadMore:b,isEditMode:x,selectedIds:S,onToggleSelection:C}=r,w=o(()=>p(_,[`publishTime`],[`desc`]),[_]),{todayList:T,earlierList:E}=o(()=>{if(!g)return{todayList:[],earlierList:w};let e=[],t=[];for(let n of _)m(n.publishTime)?e.push(n):t.push(n);return{todayList:p(e,[`publishTime`],[`desc`]),earlierList:p(t,[`publishTime`],[`desc`])}},[g,_,w]),D=!!v&&_.length===0,O=g;return D?c(e,{className:`bg-bg1`,children:Array.from({length:6}).map((e,t)=>c(i,{isEditMode:x},`post-list-item-skeleton-${t}`))}):l(t,{loading:v,loadMore:b,hasMore:y,empty:`no-content`,emptyText:h(`postList.empty`),children:[O&&T.length>0&&l(s,{children:[c(e,{className:` `,children:c(n,{className:`text-lg text-text1`,children:h(`postList.today`)})}),T.map(e=>x?c(a,{...e,isEditMode:x,isSelected:S?.has(e.id),onToggle:()=>C?.(e.id)},e.id):c(d,{href:`/post/${e.id}`,children:c(a,{...e,isEditMode:x,isSelected:S?.has(e.id),onToggle:()=>C?.(e.id)})},e.id))]}),E.length>0&&l(s,{children:[c(e,{className:` `,children:c(n,{className:`text-lg text-text1`,children:h(`postList.earlier`)})}),E.map(e=>x?c(a,{...e,isEditMode:x,isSelected:S?.has(e.id),onToggle:()=>C?.(e.id)},e.id):c(d,{href:`/post/${e.id}`,children:c(a,{...e,isEditMode:x,isSelected:S?.has(e.id),onToggle:()=>C?.(e.id)})},e.id))]})]})}export{h as PostList};
2
+ "use client";import{Box as e}from"../../../ui/box.mjs";import{List as t}from"../../../ui/list.mjs";import{Text as n}from"../../../ui/text.mjs";import{normalizeTimeToMilliseconds as r}from"../../../ui/time.mjs";import{PostListItemSkeleton as i}from"../../skeleton/post-list-item-skeleton.mjs";import{PostListItem as a}from"./post-list-item.mjs";import{useIsClient as o}from"foxact/use-is-client";import{useMemo as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";import f from"next/link";import{orderBy as p}from"lodash-es";function m(e){let t=r(e);if(!t)return!1;let n=new Date(t),i=new Date;return n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()&&n.getDate()===i.getDate()}function h(r){let h=d(`components.ui.list`),g=o(),{list:_,loading:v,hasMore:y=!1,loadMore:b,isEditMode:x,selectedIds:S,onToggleSelection:C}=r,w=s(()=>p(_,[`publishTime`],[`desc`]),[_]),{todayList:T,earlierList:E}=s(()=>{if(!g)return{todayList:[],earlierList:w};let e=[],t=[];for(let n of _)m(n.publishTime)?e.push(n):t.push(n);return{todayList:p(e,[`publishTime`],[`desc`]),earlierList:p(t,[`publishTime`],[`desc`])}},[g,_,w]),D=!!v&&_.length===0,O=g;return D?l(e,{className:`bg-bg1`,children:Array.from({length:6}).map((e,t)=>l(i,{isEditMode:x},`post-list-item-skeleton-${t}`))}):u(t,{loading:v,loadMore:b,hasMore:y,empty:`no-content`,emptyText:h(`postList.empty`),children:[O&&T.length>0&&u(c,{children:[l(e,{className:` `,children:l(n,{className:`text-lg text-text1`,children:h(`postList.today`)})}),T.map(e=>x?l(a,{...e,isEditMode:x,isSelected:S?.has(e.id),onToggle:()=>C?.(e.id)},e.id):l(f,{href:`/post/${e.id}`,children:l(a,{...e,isEditMode:x,isSelected:S?.has(e.id),onToggle:()=>C?.(e.id)})},e.id))]}),E.length>0&&u(c,{children:[l(e,{className:` `,children:l(n,{className:`text-lg text-text1`,children:h(`postList.earlier`)})}),E.map(e=>x?l(a,{...e,isEditMode:x,isSelected:S?.has(e.id),onToggle:()=>C?.(e.id)},e.id):l(f,{href:`/post/${e.id}`,children:l(a,{...e,isEditMode:x,isSelected:S?.has(e.id),onToggle:()=>C?.(e.id)})},e.id))]})]})}export{h as PostList};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../store/modules/user-store.mjs";import{pInteractionCancelDislike as t,pInteractionCancelLike as n,pInteractionDislike as r,pInteractionLike as i}from"../../../../service/generated/client.mjs";import{useRequireLogin as a}from"../../../../hooks/use-auth.mjs";import{CommentIcon as o}from"../../icons/comment.mjs";import{DeleteIcon as s}from"../../icons/delete.mjs";import{ShareIcon as c}from"../../icons/share.mjs";import{ShareDrawer as l}from"../../share-popup/share-drawer.mjs";import{SharePlatformEnum as u}from"../../../../types/share.mjs";import d from"../../../../utils/share-manager.mjs";import f from"../../../../assets/icons/dislike.mjs";import p from"../../../../assets/icons/dislike_sel.mjs";import m from"../../../../assets/icons/like.mjs";import h from"../../../../assets/icons/like_sel.mjs";import{useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{toast as b}from"sonner";import{useTranslations as x}from"next-intl";function S(t){let r=x(`components.ui.list.userActivityList`),{contentId:o,count:s=0,isLiked:c=!1,isDisliked:l=!1,dislikeCount:u=0,onLikeSuccess:d,onSuccess:f,className:p=``}=t,[_,S]=g(!1),C=e(e=>e.userId),w=a(),T=c?Math.max(1,s):s>0?s:r(`userActivityListActions.like`);return y(`button`,{className:`flex justify-center items-center gap-1.5 p-2 cursor-pointer ${_?`opacity-50 cursor-not-allowed`:``} ${c?`text-red-500`:`text-text3`} ${p}`,onClick:async()=>{w(async()=>{if(_)return;S(!0);let e={isLiked:c,count:s,isDisliked:l,dislikeCount:u},t=!c,a=Math.max(0,t?s+1:s-1),p=t&&l?!1:l,m=t&&l?Math.max(0,u-1):u;d?.({isLiked:t,count:a,isDisliked:p,dislikeCount:m});try{let t=c?await n({id:o,user_id:C,content_type:2}):await i({id:o,user_id:C,content_type:2});t?.code===0||t?.data?f?.():(d?.({isLiked:e.isLiked,count:e.count,isDisliked:e.isDisliked,dislikeCount:e.dislikeCount}),b.error(t?.message||r(`userActivityListActions.likeFailed`)))}catch(t){console.error(`点赞操作失败:`,t),d?.({isLiked:e.isLiked,count:e.count,isDisliked:e.isDisliked,dislikeCount:e.dislikeCount}),b.error(r(`userActivityListActions.likeFailed`))}finally{S(!1)}})},disabled:_,children:[v(c?h:m,{}),v(`span`,{className:`text-sm`,children:T})]})}function C(n){let i=x(`components.ui.list.userActivityList`),{contentId:o,count:s=0,isDisliked:c=!1,isLiked:l=!1,likeCount:u=0,onDislikeSuccess:d,onSuccess:m,className:h=``}=n,[_,b]=g(!1),S=e(e=>e.userId),C=a();return y(`button`,{className:`flex justify-center items-center gap-1.5 p-2 cursor-pointer ${_?`opacity-50 cursor-not-allowed`:``} ${c?`text-primary`:`text-text3`} ${h}`,onClick:async()=>{C(async()=>{if(_)return;b(!0);let e={isDisliked:c,count:s,isLiked:l,likeCount:u},n=!c,i=Math.max(0,n?s+1:s-1),a=n&&l?!1:l,f=n&&l?Math.max(0,u-1):u;d?.({isDisliked:n,count:i,isLiked:a,likeCount:f});try{(c?await t({id:o,user_id:S,content_type:2}):await r({id:o,user_id:S,content_type:2})).data?m?.():d?.({isDisliked:e.isDisliked,count:e.count,isLiked:e.isLiked,likeCount:e.likeCount})}catch(t){console.error(`点踩操作失败:`,t),d?.({isDisliked:e.isDisliked,count:e.count,isLiked:e.isLiked,likeCount:e.likeCount})}finally{b(!1)}})},disabled:_,children:[v(c?p:f,{}),v(`span`,{className:`text-sm`,children:s||i(`userActivityListActions.dislike`)})]})}function w(e){let t=x(`components.ui.list.userActivityList`),{count:n=0,onClick:r,className:i=``}=e,a=n>0?n:t(`userActivityListActions.comment`);return y(`button`,{className:`flex justify-center items-center gap-1.5 p-2 cursor-pointer text-text3 ${i}`,onClick:r,children:[v(o,{}),v(`span`,{className:`text-sm`,children:a})]})}function T(e){let t=x(`components.ui.list.userActivityList`),{contentId:n,userId:r,isCollected:i,onShareSuccess:a,onClick:o,className:s=``,onCollect:f,onUncollect:p}=e,[m,h]=g(!1);function b(){o?.(),h(!0)}function S(){h(!1),a?.()}function C(){d.showSharePopup({type:u.WECHAT,data:{id:n},copyUrl:`${window.location.origin}/post/${n}`}),S()}function w(){d.showSharePopup({type:u.QQ,data:{id:n},copyUrl:`${window.location.origin}/post/${n}`}),S()}function T(){d.showSharePopup({type:u.WECHAT_MOMENTS,data:{id:n},copyUrl:`${window.location.origin}/post/${n}`}),S()}return y(_,{children:[y(`button`,{className:`flex justify-center items-center gap-1.5 p-2 cursor-pointer text-text3 ${s}`,onClick:b,children:[v(c,{}),v(`span`,{className:`text-sm`,children:t(`userActivityListActions.share`)})]}),v(l,{isCollected:i,open:m,onOpenChange:h,onShareWeChat:C,onShareQQ:w,onShareMoments:T,onCollect:f,onUncollect:p})]})}function E(e){let{onClick:t,disabled:n=!1,className:r=``}=e;return v(`button`,{className:`p-1 ${n?`cursor-not-allowed text-text3 opacity-60`:`cursor-pointer text-text3`} ${r}`,onClick:n?void 0:t,disabled:n,children:v(s,{})})}export{w as ActivityCommentButton,E as ActivityDeleteButton,C as ActivityDislikeButton,S as ActivityLikeButton,T as ActivityShareButton};
2
+ "use client";import{useUserStore as e}from"../../../../store/modules/user-store.mjs";import{pInteractionCancelDislike as t,pInteractionCancelLike as n,pInteractionDislike as r,pInteractionLike as i}from"../../../../service/generated/client.mjs";import{useRequireLogin as a}from"../../../../hooks/use-auth.mjs";import{ShareDrawer as o}from"../../share-popup/share-drawer.mjs";import{SharePlatformEnum as s}from"../../../../types/share.mjs";import c from"../../../../utils/share-manager.mjs";import{CommentIcon as l}from"../../icons/comment.mjs";import{DeleteIcon as u}from"../../icons/delete.mjs";import{ShareIcon as d}from"../../icons/share.mjs";import f from"../../../../assets/icons/dislike.mjs";import p from"../../../../assets/icons/dislike_sel.mjs";import m from"../../../../assets/icons/like.mjs";import h from"../../../../assets/icons/like_sel.mjs";import{useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{toast as b}from"sonner";import{useTranslations as x}from"next-intl";function S(t){let r=x(`components.ui.list.userActivityList`),{contentId:o,count:s=0,isLiked:c=!1,isDisliked:l=!1,dislikeCount:u=0,onLikeSuccess:d,onSuccess:f,className:p=``}=t,[_,S]=g(!1),C=e(e=>e.userId),w=a(),T=c?Math.max(1,s):s>0?s:r(`userActivityListActions.like`);return y(`button`,{className:`flex justify-center items-center gap-1.5 p-2 cursor-pointer ${_?`opacity-50 cursor-not-allowed`:``} ${c?`text-red-500`:`text-text3`} ${p}`,onClick:async()=>{w(async()=>{if(_)return;S(!0);let e={isLiked:c,count:s,isDisliked:l,dislikeCount:u},t=!c,a=Math.max(0,t?s+1:s-1),p=t&&l?!1:l,m=t&&l?Math.max(0,u-1):u;d?.({isLiked:t,count:a,isDisliked:p,dislikeCount:m});try{let t=c?await n({id:o,user_id:C,content_type:2}):await i({id:o,user_id:C,content_type:2});t?.code===0||t?.data?f?.():(d?.({isLiked:e.isLiked,count:e.count,isDisliked:e.isDisliked,dislikeCount:e.dislikeCount}),b.error(t?.message||r(`userActivityListActions.likeFailed`)))}catch(t){console.error(`点赞操作失败:`,t),d?.({isLiked:e.isLiked,count:e.count,isDisliked:e.isDisliked,dislikeCount:e.dislikeCount}),b.error(r(`userActivityListActions.likeFailed`))}finally{S(!1)}})},disabled:_,children:[v(c?h:m,{}),v(`span`,{className:`text-sm`,children:T})]})}function C(n){let i=x(`components.ui.list.userActivityList`),{contentId:o,count:s=0,isDisliked:c=!1,isLiked:l=!1,likeCount:u=0,onDislikeSuccess:d,onSuccess:m,className:h=``}=n,[_,b]=g(!1),S=e(e=>e.userId),C=a();return y(`button`,{className:`flex justify-center items-center gap-1.5 p-2 cursor-pointer ${_?`opacity-50 cursor-not-allowed`:``} ${c?`text-primary`:`text-text3`} ${h}`,onClick:async()=>{C(async()=>{if(_)return;b(!0);let e={isDisliked:c,count:s,isLiked:l,likeCount:u},n=!c,i=Math.max(0,n?s+1:s-1),a=n&&l?!1:l,f=n&&l?Math.max(0,u-1):u;d?.({isDisliked:n,count:i,isLiked:a,likeCount:f});try{(c?await t({id:o,user_id:S,content_type:2}):await r({id:o,user_id:S,content_type:2})).data?m?.():d?.({isDisliked:e.isDisliked,count:e.count,isLiked:e.isLiked,likeCount:e.likeCount})}catch(t){console.error(`点踩操作失败:`,t),d?.({isDisliked:e.isDisliked,count:e.count,isLiked:e.isLiked,likeCount:e.likeCount})}finally{b(!1)}})},disabled:_,children:[v(c?p:f,{}),v(`span`,{className:`text-sm`,children:s||i(`userActivityListActions.dislike`)})]})}function w(e){let t=x(`components.ui.list.userActivityList`),{count:n=0,onClick:r,className:i=``}=e,a=n>0?n:t(`userActivityListActions.comment`);return y(`button`,{className:`flex justify-center items-center gap-1.5 p-2 cursor-pointer text-text3 ${i}`,onClick:r,children:[v(l,{}),v(`span`,{className:`text-sm`,children:a})]})}function T(e){let t=x(`components.ui.list.userActivityList`),{contentId:n,userId:r,isCollected:i,onShareSuccess:a,onClick:l,className:u=``,onCollect:f,onUncollect:p}=e,[m,h]=g(!1);function b(){l?.(),h(!0)}function S(){h(!1),a?.()}function C(){c.showSharePopup({type:s.WECHAT,data:{id:n},copyUrl:`${window.location.origin}/post/${n}`}),S()}function w(){c.showSharePopup({type:s.QQ,data:{id:n},copyUrl:`${window.location.origin}/post/${n}`}),S()}function T(){c.showSharePopup({type:s.WECHAT_MOMENTS,data:{id:n},copyUrl:`${window.location.origin}/post/${n}`}),S()}return y(_,{children:[y(`button`,{className:`flex justify-center items-center gap-1.5 p-2 cursor-pointer text-text3 ${u}`,onClick:b,children:[v(d,{}),v(`span`,{className:`text-sm`,children:t(`userActivityListActions.share`)})]}),v(o,{isCollected:i,open:m,onOpenChange:h,onShareWeChat:C,onShareQQ:w,onShareMoments:T,onCollect:f,onUncollect:p})]})}function E(e){let{onClick:t,disabled:n=!1,className:r=``}=e;return v(`button`,{className:`p-1 ${n?`cursor-not-allowed text-text3 opacity-60`:`cursor-pointer text-text3`} ${r}`,onClick:n?void 0:t,disabled:n,children:v(u,{})})}export{w as ActivityCommentButton,E as ActivityDeleteButton,C as ActivityDislikeButton,S as ActivityLikeButton,T as ActivityShareButton};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Image as e}from"../../../ui/image.mjs";import{Avatar as t,AvatarFallback as n,AvatarImage as r}from"../../../ui/avatar.mjs";import{Box as i}from"../../../ui/box.mjs";import{Checkbox as a}from"../../../ui/checkbox.mjs";import{Text as o}from"../../../ui/text.mjs";import{Time as s}from"../../../ui/time.mjs";import{useMediaPreview as c}from"../../media-preview/index.mjs";import l from"../../../../assets/icons/detail/video_play.mjs";import{useContentOperate as u}from"../../../../hooks/use-content-operate.mjs";import{ActivityCommentButton as d,ActivityDeleteButton as f,ActivityDislikeButton as p,ActivityLikeButton as ee,ActivityShareButton as m}from"./user-activity-list-actions.mjs";import{useRouter as te}from"next/navigation";import{useEffect as h,useRef as ne,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useTranslations as b}from"next-intl";const x=[],S={post:2};function C({medias:t=x,className:n=``,onItemClick:r}){let a=b(`components.ui.list.userActivityList`),o=(t||[]).filter(Boolean).slice(0,9);if(!o.length)return null;function s(e){r?.(e)}function c(t,n,o){let{is_video:c,media_url:u,cover_image:d}=t||{},f=!!c,p=f?d||u||``:u||``;return p?v(i,{className:o||`relative w-full h-full`,onClick:e=>{r&&(e.stopPropagation(),e.preventDefault(),s(n))},children:[_(e,{src:p,alt:a(`userActivityListItem.mediaAlt`),fill:!0,className:`object-cover`}),f&&_(i,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-[rgba(0,0,0,0.5)] rounded-full`,children:_(l,{width:36,height:36})})]},n):null}if(o.length===1){let{is_video:e,media_url:t,cover_image:r}=o[0]||{};return _(i,{className:n,children:_(i,{className:`w-full rounded-xl overflow-hidden`,children:c({is_video:e,media_url:t,cover_image:r,__src:e?r||t||``:t||``},0,`relative w-full aspect-square`)})})}return o.length===2?_(i,{className:n,children:_(i,{className:`w-full flex gap-0.5 rounded-xl overflow-hidden`,children:o.map((e,t)=>_(i,{className:`flex-1 aspect-square relative`,children:c(e,t)},t))})}):o.length===3?_(i,{className:n,children:v(i,{className:`w-full h-89.25 flex gap-0.5 rounded-xl overflow-hidden`,children:[_(i,{className:`w-[56.65%] h-full relative`,children:c(o[0],0)}),_(i,{className:`flex-1 flex flex-col gap-0.5`,children:o.slice(1).map((e,t)=>_(i,{className:`w-full flex-1 relative`,children:c(e,t+1)},t))})]})}):o.length===4?_(i,{className:n,children:_(i,{className:`w-full h-89.25 rounded-xl overflow-hidden grid grid-cols-2 grid-rows-2 gap-0.5`,children:o.map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))})}):o.length===5?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[_(i,{className:`w-full h-49.5 flex gap-0.5`,children:o.slice(0,2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t)},t))}),_(i,{className:`w-full h-33.5 flex gap-0.5`,children:o.slice(2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t+2)},t))})]})}):o.length===6?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[v(i,{className:`w-full h-67.5 flex gap-0.5`,children:[_(i,{className:`w-67.5 h-full relative`,children:c(o[0],0)}),_(i,{className:`flex-1 grid grid-cols-1 grid-rows-2 gap-0.5`,children:o.slice(1,3).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+1)},t))})]}),_(i,{className:`w-full h-33.5 grid grid-cols-3 grid-rows-1 gap-0.5`,children:o.slice(3).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+3)},t))})]})}):o.length===7?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex gap-0.5`,children:[_(i,{className:`w-76 h-67.5 grid grid-cols-2 grid-rows-2 gap-0.5`,children:o.slice(0,4).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))}),_(i,{className:`flex-1 grid grid-cols-1 grid-rows-3 gap-0.5`,children:o.slice(4).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+4)},t))})]})}):o.length===8?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[_(i,{className:`w-full h-33.5 flex gap-0.5 items-center`,children:o.slice(0,2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t)},t))}),_(i,{className:`w-full h-67.5 grid grid-cols-3 grid-rows-2 gap-0.5`,children:o.slice(2).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+2)},t))})]})}):_(i,{className:n,children:_(i,{className:`w-full h-101.5 rounded-xl overflow-hidden grid grid-cols-3 grid-rows-3 gap-0.5`,children:o.slice(0,9).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))})})}function w(e){let l=b(`components.ui.list.userActivityList`),{content_id:x,author:w,rightSlot:T,create_time:re,content:E,medias:ie,canEdit:ae=!1,isDeleting:oe=!1,isEditMode:se=!1,isSelected:D=!1,onToggle:O,interaction:k,like_count:A=0,is_liked:j=!1,onLikeSuccess:ce,dislike_count:M=0,is_dislike:N=!1,is_collected:le,onDislikeSuccess:P,comment_count:F=0,onDelete:I,onShare:L,onShareSuccess:R,onActionSuccess:z,onCollectChange:B}=e,V=k?.is_collected??le??!1,[H,U]=g({isLiked:j,likeCount:A,isDisliked:N,dislikeCount:M,isCollected:V}),[W,G]=g(!1),[ue,K]=g(!1),q=ne(null),J=ie?.filter(Boolean)??[],Y=w?.nickname||w?.nick_name||``,de=w?.avatar||w?.avatar_url||``;h(()=>{U({isLiked:j,likeCount:A,isDisliked:N,dislikeCount:M,isCollected:V})},[M,N,j,A,V]),h(()=>{G(!1)},[E]),h(()=>()=>{q.current&&=(clearTimeout(q.current),null)},[]);function fe(e){U(t=>({...t,isLiked:e.isLiked,likeCount:e.count,isDisliked:e.isDisliked??t.isDisliked,dislikeCount:e.dislikeCount??t.dislikeCount})),ce?.(e)}function pe(e){U(t=>({...t,isDisliked:e.isDisliked,dislikeCount:e.count,isLiked:e.isLiked??t.isLiked,likeCount:e.likeCount??t.likeCount})),P?.(e)}let{handleToCollectionOperate:me}=u({id:x||``,isLike:H.isLiked,isDislike:H.isDisliked,isCollect:H.isCollected,likeCnt:H.likeCount,dislikeCnt:H.dislikeCount,contentType:S.post});function X(){q.current&&=(clearTimeout(q.current),null)}function Z(e){U(t=>({...t,isCollected:e})),z?.(),x&&B?.(x,e)}function Q(e){if(!x){y.error(l(`userActivityListItem.collectFailed`));return}if(!ue){if(K(!0),X(),!me({currentCollect:e,onUpdate:({isCollect:e})=>{X(),Z(e),K(!1)}})){y.error(l(`userActivityListItem.collectFailed`)),K(!1);return}q.current=setTimeout(()=>{K(!1),q.current=null},300)}}function he(e){return!!(e&&e.length>180)}function ge(){G(e=>!e)}let $=te(),_e=()=>{$.push(`/post/${x}`)},ve=e=>{e.stopPropagation(),e.preventDefault(),$.push(`/profile/${w?.user_id}`)},ye=()=>{$.push(`/post/${x}?tab=comment`)},be=c();function xe(e){let t=J.map(e=>({src:e.media_url,type:e.is_video?`video`:`image`,cover:e.cover_image}));t.length&&be.open(t,e)}return _(i,{className:`flex items-start gap-2 p-3`,children:v(i,{className:`flex-1 min-w-0`,children:[v(i,{className:`flex items-center gap-2 mb-3`,children:[v(i,{className:`flex items-center gap-2 shrink-0`,children:[se&&_(a,{checked:D,onCheckedChange:O}),v(t,{className:`w-10 h-10`,onClick:ve,children:[_(r,{src:de,alt:Y}),_(n,{})]})]}),v(i,{className:`flex-1 min-w-0`,children:[_(o,{as:`p`,className:`text-sm text-text1 line-clamp-1 font-medium`,children:Y}),_(i,{className:`h-[1em]`,children:_(s,{value:re,className:`text-xs text-text3`,format:`YYYY-MM-DD HH:mm`})})]}),T&&_(i,{className:`shrink-0`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:T}),ae&&_(f,{onClick:I,disabled:oe})]}),v(i,{onClick:_e,children:[v(i,{className:`mb-3`,children:[E&&v(i,{children:[_(o,{className:`text-sm text-text1 leading-5 whitespace-pre-wrap text-ellipsis ${W?`break-all`:`line-clamp-3`}`,dangerouslySetInnerHTML:{__html:E}}),he(E)&&_(i,{className:`mt-1 text-xs text-text3`,onClick:e=>{e.stopPropagation(),e.preventDefault(),ge()},children:l(W?`userActivityListItem.collapse`:`userActivityListItem.expand`)})]}),J.length>0&&_(C,{className:`mt-2`,medias:J,onItemClick:xe})]}),v(i,{className:`flex items-center justify-around text-text3 *:min-w-20`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:[_(ee,{contentId:x||``,count:H.likeCount,isLiked:H.isLiked,isDisliked:H.isDisliked,dislikeCount:H.dislikeCount,onLikeSuccess:fe,onSuccess:z}),_(p,{contentId:x||``,count:H.dislikeCount,isDisliked:H.isDisliked,isLiked:H.isLiked,likeCount:H.likeCount,onDislikeSuccess:pe,onSuccess:z}),_(d,{count:F,onClick:ye}),_(m,{isCollected:H.isCollected,contentId:x||``,userId:w?.user_id??``,onShareSuccess:R,onClick:L,onCollect:()=>Q(!1),onUncollect:()=>Q(!0)})]})]})]})})}export{w as UserActivityListItem,C as UserActivityMediaGrid};
2
+ "use client";import{Image as e}from"../../../ui/image.mjs";import{Avatar as t,AvatarFallback as n,AvatarImage as r}from"../../../ui/avatar.mjs";import{Box as i}from"../../../ui/box.mjs";import{Checkbox as a}from"../../../ui/checkbox.mjs";import{Text as o}from"../../../ui/text.mjs";import{Time as s}from"../../../ui/time.mjs";import{useMediaPreview as c}from"../../media-preview/index.mjs";import{useContentOperate as l}from"../../../../hooks/use-content-operate.mjs";import u from"../../../../assets/icons/detail/video_play.mjs";import{ActivityCommentButton as d,ActivityDeleteButton as f,ActivityDislikeButton as p,ActivityLikeButton as ee,ActivityShareButton as m}from"./user-activity-list-actions.mjs";import{useEffect as h,useRef as te,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useTranslations as b}from"next-intl";import{useRouter as x}from"next/navigation";const S=[],C={post:2};function w({medias:t=S,className:n=``,onItemClick:r}){let a=b(`components.ui.list.userActivityList`),o=(t||[]).filter(Boolean).slice(0,9);if(!o.length)return null;function s(e){r?.(e)}function c(t,n,o){let{is_video:c,media_url:l,cover_image:d}=t||{},f=!!c,p=f?d||l||``:l||``;return p?v(i,{className:o||`relative w-full h-full`,onClick:e=>{r&&(e.stopPropagation(),e.preventDefault(),s(n))},children:[_(e,{src:p,alt:a(`userActivityListItem.mediaAlt`),fill:!0,className:`object-cover`}),f&&_(i,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-[rgba(0,0,0,0.5)] rounded-full`,children:_(u,{width:36,height:36})})]},n):null}if(o.length===1){let{is_video:e,media_url:t,cover_image:r}=o[0]||{};return _(i,{className:n,children:_(i,{className:`w-full rounded-xl overflow-hidden`,children:c({is_video:e,media_url:t,cover_image:r,__src:e?r||t||``:t||``},0,`relative w-full aspect-square`)})})}return o.length===2?_(i,{className:n,children:_(i,{className:`w-full flex gap-0.5 rounded-xl overflow-hidden`,children:o.map((e,t)=>_(i,{className:`flex-1 aspect-square relative`,children:c(e,t)},t))})}):o.length===3?_(i,{className:n,children:v(i,{className:`w-full h-89.25 flex gap-0.5 rounded-xl overflow-hidden`,children:[_(i,{className:`w-[56.65%] h-full relative`,children:c(o[0],0)}),_(i,{className:`flex-1 flex flex-col gap-0.5`,children:o.slice(1).map((e,t)=>_(i,{className:`w-full flex-1 relative`,children:c(e,t+1)},t))})]})}):o.length===4?_(i,{className:n,children:_(i,{className:`w-full h-89.25 rounded-xl overflow-hidden grid grid-cols-2 grid-rows-2 gap-0.5`,children:o.map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))})}):o.length===5?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[_(i,{className:`w-full h-49.5 flex gap-0.5`,children:o.slice(0,2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t)},t))}),_(i,{className:`w-full h-33.5 flex gap-0.5`,children:o.slice(2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t+2)},t))})]})}):o.length===6?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[v(i,{className:`w-full h-67.5 flex gap-0.5`,children:[_(i,{className:`w-67.5 h-full relative`,children:c(o[0],0)}),_(i,{className:`flex-1 grid grid-cols-1 grid-rows-2 gap-0.5`,children:o.slice(1,3).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+1)},t))})]}),_(i,{className:`w-full h-33.5 grid grid-cols-3 grid-rows-1 gap-0.5`,children:o.slice(3).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+3)},t))})]})}):o.length===7?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex gap-0.5`,children:[_(i,{className:`w-76 h-67.5 grid grid-cols-2 grid-rows-2 gap-0.5`,children:o.slice(0,4).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))}),_(i,{className:`flex-1 grid grid-cols-1 grid-rows-3 gap-0.5`,children:o.slice(4).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+4)},t))})]})}):o.length===8?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[_(i,{className:`w-full h-33.5 flex gap-0.5 items-center`,children:o.slice(0,2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t)},t))}),_(i,{className:`w-full h-67.5 grid grid-cols-3 grid-rows-2 gap-0.5`,children:o.slice(2).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+2)},t))})]})}):_(i,{className:n,children:_(i,{className:`w-full h-101.5 rounded-xl overflow-hidden grid grid-cols-3 grid-rows-3 gap-0.5`,children:o.slice(0,9).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))})})}function T(e){let u=b(`components.ui.list.userActivityList`),{content_id:S,author:T,rightSlot:E,create_time:ne,content:D,medias:O,canEdit:re=!1,isDeleting:ie=!1,isEditMode:ae=!1,isSelected:oe=!1,onToggle:k,interaction:A,like_count:j=0,is_liked:M=!1,onLikeSuccess:se,dislike_count:N=0,is_dislike:P=!1,is_collected:ce,onDislikeSuccess:F,comment_count:I=0,onDelete:L,onShare:R,onShareSuccess:z,onActionSuccess:B,onCollectChange:V}=e,H=A?.is_collected??ce??!1,[U,W]=g({isLiked:M,likeCount:j,isDisliked:P,dislikeCount:N,isCollected:H}),[G,K]=g(!1),[le,q]=g(!1),J=te(null),Y=O?.filter(Boolean)??[],X=T?.nickname||T?.nick_name||``,ue=T?.avatar||T?.avatar_url||``;h(()=>{W({isLiked:M,likeCount:j,isDisliked:P,dislikeCount:N,isCollected:H})},[N,P,M,j,H]),h(()=>{K(!1)},[D]),h(()=>()=>{J.current&&=(clearTimeout(J.current),null)},[]);function de(e){W(t=>({...t,isLiked:e.isLiked,likeCount:e.count,isDisliked:e.isDisliked??t.isDisliked,dislikeCount:e.dislikeCount??t.dislikeCount})),se?.(e)}function fe(e){W(t=>({...t,isDisliked:e.isDisliked,dislikeCount:e.count,isLiked:e.isLiked??t.isLiked,likeCount:e.likeCount??t.likeCount})),F?.(e)}let{handleToCollectionOperate:pe}=l({id:S||``,isLike:U.isLiked,isDislike:U.isDisliked,isCollect:U.isCollected,likeCnt:U.likeCount,dislikeCnt:U.dislikeCount,contentType:C.post});function Z(){J.current&&=(clearTimeout(J.current),null)}function me(e){W(t=>({...t,isCollected:e})),B?.(),S&&V?.(S,e)}function Q(e){if(!S){y.error(u(`userActivityListItem.collectFailed`));return}if(!le){if(q(!0),Z(),!pe({currentCollect:e,onUpdate:({isCollect:e})=>{Z(),me(e),q(!1)}})){y.error(u(`userActivityListItem.collectFailed`)),q(!1);return}J.current=setTimeout(()=>{q(!1),J.current=null},300)}}function he(e){return!!(e&&e.length>180)}function ge(){K(e=>!e)}let $=x(),_e=()=>{$.push(`/post/${S}`)},ve=e=>{e.stopPropagation(),e.preventDefault(),$.push(`/profile/${T?.user_id}`)},ye=()=>{$.push(`/post/${S}?tab=comment`)},be=c();function xe(e){let t=Y.map(e=>({src:e.media_url,type:e.is_video?`video`:`image`,cover:e.cover_image}));t.length&&be.open(t,e)}return _(i,{className:`flex items-start gap-2 p-3`,children:v(i,{className:`flex-1 min-w-0`,children:[v(i,{className:`flex items-center gap-2 mb-3`,children:[v(i,{className:`flex items-center gap-2 shrink-0`,children:[ae&&_(a,{checked:oe,onCheckedChange:k}),v(t,{className:`w-10 h-10`,onClick:ve,children:[_(r,{src:ue,alt:X}),_(n,{})]})]}),v(i,{className:`flex-1 min-w-0`,children:[_(o,{as:`p`,className:`text-sm text-text1 line-clamp-1 font-medium`,children:X}),_(i,{className:`h-[1em]`,children:_(s,{value:ne,className:`text-xs text-text3`,format:`YYYY-MM-DD HH:mm`})})]}),E&&_(i,{className:`shrink-0`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:E}),re&&_(f,{onClick:L,disabled:ie})]}),v(i,{onClick:_e,children:[v(i,{className:`mb-3`,children:[D&&v(i,{children:[_(o,{className:`text-sm text-text1 leading-5 whitespace-pre-wrap text-ellipsis ${G?`break-all`:`line-clamp-3`}`,dangerouslySetInnerHTML:{__html:D}}),he(D)&&_(i,{className:`mt-1 text-xs text-text3`,onClick:e=>{e.stopPropagation(),e.preventDefault(),ge()},children:u(G?`userActivityListItem.collapse`:`userActivityListItem.expand`)})]}),Y.length>0&&_(w,{className:`mt-2`,medias:Y,onItemClick:xe})]}),v(i,{className:`flex items-center justify-around text-text3 *:min-w-20`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:[_(ee,{contentId:S||``,count:U.likeCount,isLiked:U.isLiked,isDisliked:U.isDisliked,dislikeCount:U.dislikeCount,onLikeSuccess:de,onSuccess:B}),_(p,{contentId:S||``,count:U.dislikeCount,isDisliked:U.isDisliked,isLiked:U.isLiked,likeCount:U.likeCount,onDislikeSuccess:fe,onSuccess:B}),_(d,{count:I,onClick:ye}),_(m,{isCollected:U.isCollected,contentId:S||``,userId:T?.user_id??``,onShareSuccess:z,onClick:R,onCollect:()=>Q(!1),onUncollect:()=>Q(!0)})]})]})]})})}export{T as UserActivityListItem,w as UserActivityMediaGrid};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Box as e}from"../../../ui/box.mjs";import{List as t}from"../../../ui/list.mjs";import{Text as n}from"../../../ui/text.mjs";import{normalizeTimeToMilliseconds as r}from"../../../ui/time.mjs";import{VideoListItemSkeleton as i}from"../../skeleton/video-list-item-skeleton.mjs";import{VideoListItem as a}from"./video-list-item.mjs";import{useMemo as o}from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import{useTranslations as u}from"next-intl";import d from"next/link";import{useIsClient as f}from"foxact/use-is-client";import{orderBy as p}from"lodash-es";function m(e){let t=r(e);if(!t)return!1;let n=new Date(t),i=new Date;return n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()&&n.getDate()===i.getDate()}function h(r){let h=u(`components.ui.list`),g=f(),{list:_,showVideoProgress:v,loading:y,hasMore:b=!1,loadMore:x,isEditMode:S,selectedIds:C,onToggleSelection:w}=r,T=o(()=>p(_,[`publishTime`],[`desc`]),[_]),{todayList:E,earlierList:D}=o(()=>{if(!g)return{todayList:[],earlierList:T};let e=[],t=[];for(let n of _)m(n.publishTime)?e.push(n):t.push(n);return{todayList:p(e,[`publishTime`],[`desc`]),earlierList:p(t,[`publishTime`],[`desc`])}},[g,_,T]),O=!!y&&_.length===0,k=g;return O?c(e,{className:`bg-bg1`,children:Array.from({length:6}).map((e,t)=>c(i,{isEditMode:S,showVideoProgress:v},`video-list-item-skeleton-${t}`))}):l(t,{loading:y,loadMore:x,hasMore:b,empty:`no-content`,emptyText:h(`videoList.empty`),children:[k&&E.length>0&&l(s,{children:[c(e,{className:` `,children:c(n,{className:`text-lg text-text1`,children:h(`videoList.today`)})}),E.map(e=>S?c(a,{showVideoProgress:v,isEditMode:S,isSelected:C?.has(e.id),...e,onToggle:()=>w?.(e.id)},e.id):c(d,{href:`/video/${e.id}/${e.title}`,children:c(a,{showVideoProgress:v,isEditMode:S,isSelected:C?.has(e.id),...e,onToggle:()=>w?.(e.id)},e.id)},e.id))]}),D.length>0&&l(s,{children:[c(e,{className:` `,children:c(n,{className:`text-lg text-text1`,children:h(`videoList.earlier`)})}),D.map(e=>S?c(a,{showVideoProgress:v,isEditMode:S,isSelected:C?.has(e.id),...e,onToggle:()=>w?.(e.id)},e.id):c(d,{href:`/video/${e.id}/${e.title}`,children:c(a,{showVideoProgress:v,isEditMode:S,isSelected:C?.has(e.id),...e,onToggle:()=>w?.(e.id)},e.id)},e.id))]})]})}export{h as VideoList};
2
+ "use client";import{Box as e}from"../../../ui/box.mjs";import{List as t}from"../../../ui/list.mjs";import{Text as n}from"../../../ui/text.mjs";import{normalizeTimeToMilliseconds as r}from"../../../ui/time.mjs";import{VideoListItemSkeleton as i}from"../../skeleton/video-list-item-skeleton.mjs";import{VideoListItem as a}from"./video-list-item.mjs";import{useIsClient as o}from"foxact/use-is-client";import{useMemo as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";import f from"next/link";import{orderBy as p}from"lodash-es";function m(e){let t=r(e);if(!t)return!1;let n=new Date(t),i=new Date;return n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()&&n.getDate()===i.getDate()}function h(r){let h=d(`components.ui.list`),g=o(),{list:_,showVideoProgress:v,loading:y,hasMore:b=!1,loadMore:x,isEditMode:S,selectedIds:C,onToggleSelection:w}=r,T=s(()=>p(_,[`publishTime`],[`desc`]),[_]),{todayList:E,earlierList:D}=s(()=>{if(!g)return{todayList:[],earlierList:T};let e=[],t=[];for(let n of _)m(n.publishTime)?e.push(n):t.push(n);return{todayList:p(e,[`publishTime`],[`desc`]),earlierList:p(t,[`publishTime`],[`desc`])}},[g,_,T]),O=!!y&&_.length===0,k=g;return O?l(e,{className:`bg-bg1`,children:Array.from({length:6}).map((e,t)=>l(i,{isEditMode:S,showVideoProgress:v},`video-list-item-skeleton-${t}`))}):u(t,{loading:y,loadMore:x,hasMore:b,empty:`no-content`,emptyText:h(`videoList.empty`),children:[k&&E.length>0&&u(c,{children:[l(e,{className:` `,children:l(n,{className:`text-lg text-text1`,children:h(`videoList.today`)})}),E.map(e=>S?l(a,{showVideoProgress:v,isEditMode:S,isSelected:C?.has(e.id),...e,onToggle:()=>w?.(e.id)},e.id):l(f,{href:`/video/${e.id}/${e.title}`,children:l(a,{showVideoProgress:v,isEditMode:S,isSelected:C?.has(e.id),...e,onToggle:()=>w?.(e.id)},e.id)},e.id))]}),D.length>0&&u(c,{children:[l(e,{className:` `,children:l(n,{className:`text-lg text-text1`,children:h(`videoList.earlier`)})}),D.map(e=>S?l(a,{showVideoProgress:v,isEditMode:S,isSelected:C?.has(e.id),...e,onToggle:()=>w?.(e.id)},e.id):l(f,{href:`/video/${e.id}/${e.title}`,children:l(a,{showVideoProgress:v,isEditMode:S,isSelected:C?.has(e.id),...e,onToggle:()=>w?.(e.id)},e.id)},e.id))]})]})}export{h as VideoList};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../utils/cn.mjs";import{Image as t}from"../../ui/image.mjs";import{Carousel as n,CarouselContent as r,CarouselItem as i,CarouselNext as a,CarouselPrevious as o}from"../../ui/carousel.mjs";import{Dialog as s,DialogContent as c}from"../../ui/dialog.mjs";import{useMediaPreviewStore as l}from"../../../store/modules/media-preview-store.mjs";import{CloseIcon as u}from"../../../assets/icons/close-icon.mjs";import{VideoPlay as d}from"./video-play.mjs";import{useEffect as f,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";function _(){let{openWithMediaList:e,close:t,setOpen:n}=l();function r(t,n=0){e(t,n)}return{open:r,close:t,setOpen:n}}function v(_){let{className:v}=_,{isOpen:y,setOpen:b,close:x,mediaList:S,startIndex:C,setStartIndex:w}=l(),[T,E]=m(null),[D,O]=m(null),[k,A]=m(0),j=p(!1);if(f(()=>{y||!S.length||x()},[x,y,S.length]),f(()=>{y&&!j.current&&(O(C),A(e=>e+1)),!y&&j.current&&O(null),j.current=y},[y,S.length,C]),f(()=>{if(!y||!T||!S.length)return;let e=Math.min(Math.max(C,0),Math.max(S.length-1,0));T.selectedScrollSnap()!==e&&T.scrollTo(e,!0)},[T,y,C,S.length]),f(()=>{if(!T||!S.length||!y)return;function e(){T&&w(T.selectedScrollSnap())}return T.on(`select`,e),T.on(`reInit`,e),()=>{T.off(`select`,e),T.off(`reInit`,e)}},[T,y,w,S.length]),!S.length&&!y)return null;function M(e){if(e){b(!0);return}x()}function N(){x()}function P(e){e.stopPropagation()}return h(s,{open:y,onOpenChange:M,children:g(c,{showCloseButton:!1,className:e(`border-none z-[10000] flex h-screen w-screen max-w-none items-center justify-center rounded-none bg-black text-white`,v),onClick:P,children:[g(`div`,{className:`absolute left-0 right-0 w-full flex justify-between items-center top-[calc(env(safe-area-inset-top)+60px)] z-[999] rounded-full bg-black/60 px-3 py-1 text-xs text-white`,children:[h(`div`,{className:`text-white`,children:`${C+1}/${S.length}`}),h(u,{className:`h-[12px] w-[12px] text-white`,onClick:N})]}),g(n,{className:e(`w-full`),opts:{loop:!1,startIndex:C},setApi:E,children:[h(r,{className:`will-change-transform`,children:S.map((n,r)=>h(i,{className:`will-change-transform`,children:h(`div`,{className:`relative h-[70vh] w-full overflow-hidden rounded-lg will-change-transform transform-gpu`,children:n.type===`video`?h(d,{url:n.src,cover:n.cover,isActive:r===C,autoPlayMuted:n.autoPlayMuted,previewAutoPlay:y&&D===r,previewAutoPlaySeed:k},`${n.src}-${r}`):h(t,{src:n.src,alt:`预览`,fill:!0,className:e(`object-contain will-change-transform`)})})},`${n.src}-${r}`))}),h(o,{}),h(a,{})]})]})})}export{v as MediaPreview,_ as useMediaPreview};
2
+ "use client";import{cn as e}from"../../../utils/cn.mjs";import{Image as t}from"../../ui/image.mjs";import{Carousel as n,CarouselContent as r,CarouselItem as i,CarouselNext as a,CarouselPrevious as o}from"../../ui/carousel.mjs";import{Dialog as s,DialogContent as c}from"../../ui/dialog.mjs";import{CloseIcon as l}from"../../../assets/icons/close-icon.mjs";import{useMediaPreviewStore as u}from"../../../store/modules/media-preview-store.mjs";import{VideoPlay as d}from"./video-play.mjs";import{useEffect as f,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";function _(){let{openWithMediaList:e,close:t,setOpen:n}=u();function r(t,n=0){e(t,n)}return{open:r,close:t,setOpen:n}}function v(_){let{className:v}=_,{isOpen:y,setOpen:b,close:x,mediaList:S,startIndex:C,setStartIndex:w}=u(),[T,E]=m(null),[D,O]=m(null),[k,A]=m(0),j=p(!1);if(f(()=>{y||!S.length||x()},[x,y,S.length]),f(()=>{y&&!j.current&&(O(C),A(e=>e+1)),!y&&j.current&&O(null),j.current=y},[y,S.length,C]),f(()=>{if(!y||!T||!S.length)return;let e=Math.min(Math.max(C,0),Math.max(S.length-1,0));T.selectedScrollSnap()!==e&&T.scrollTo(e,!0)},[T,y,C,S.length]),f(()=>{if(!T||!S.length||!y)return;function e(){T&&w(T.selectedScrollSnap())}return T.on(`select`,e),T.on(`reInit`,e),()=>{T.off(`select`,e),T.off(`reInit`,e)}},[T,y,w,S.length]),!S.length&&!y)return null;function M(e){if(e){b(!0);return}x()}function N(){x()}function P(e){e.stopPropagation()}return h(s,{open:y,onOpenChange:M,children:g(c,{showCloseButton:!1,className:e(`border-none z-[10000] flex h-screen w-screen max-w-none items-center justify-center rounded-none bg-black text-white`,v),onClick:P,children:[g(`div`,{className:`absolute left-0 right-0 w-full flex justify-between items-center top-[calc(env(safe-area-inset-top)+60px)] z-[999] rounded-full bg-black/60 px-3 py-1 text-xs text-white`,children:[h(`div`,{className:`text-white`,children:`${C+1}/${S.length}`}),h(l,{className:`h-[12px] w-[12px] text-white`,onClick:N})]}),g(n,{className:e(`w-full`),opts:{loop:!1,startIndex:C},setApi:E,children:[h(r,{className:`will-change-transform`,children:S.map((n,r)=>h(i,{className:`will-change-transform`,children:h(`div`,{className:`relative h-[70vh] w-full overflow-hidden rounded-lg will-change-transform transform-gpu`,children:n.type===`video`?h(d,{url:n.src,cover:n.cover,isActive:r===C,autoPlayMuted:n.autoPlayMuted,previewAutoPlay:y&&D===r,previewAutoPlaySeed:k},`${n.src}-${r}`):h(t,{src:n.src,alt:`预览`,fill:!0,className:e(`object-contain will-change-transform`)})})},`${n.src}-${r}`))}),h(o,{}),h(a,{})]})]})})}export{v as MediaPreview,_ as useMediaPreview};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Button as e}from"../../ui/button.mjs";import{parseResolution as t}from"../../../utils/common.mjs";import n from"../../../utils/event-bus.mjs";import{eventKey as r}from"../../../constants/event-key.mjs";import i from"../video-player/index.mjs";import a from"./popup-video.module.mjs";import{usePathname as o}from"next/navigation";import{useCallback as s,useEffect as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(){let f=o(),[p,m]=l(!1),[h,g]=l(null),[_,v]=l(0),y=s(e=>{if(typeof window>`u`)return 0;let{width:n,height:r}=t(e.resolution);return n<=0?0:Math.max(0,r*(window.innerWidth/n))},[]),b=s(({info:e,show:t})=>{if(!e||!t){m(!1),g(null);return}g(e),v(y(e)),m(!0)},[y]);return c(()=>(n.on(r.SHOW_POPUP_VIDEO,b),()=>{n.off(r.SHOW_POPUP_VIDEO,b)}),[b]),c(()=>{m(!1),g(null)},[f]),!p||!h?null:d(`div`,{className:`fixed inset-0 z-[9999] flex items-center justify-center bg-black/95`,children:[u(e,{variant:`ghost`,className:`absolute left-4 top-4 h-10 w-10 rounded-full border border-white/20 text-white`,onClick:()=>{m(!1),g(null)},children:`←`}),u(`div`,{className:a.popupVideo,style:{width:`100%`,maxHeight:`100%`,height:_>0?`${_}px`:`auto`},children:u(i,{plyerId:h.plyerId,resolution:h.resolution,poster:h.poster||``,videoUrl:h.videoUrl||``,hlsList:h.hlsList,mergeConfig:_>0?{}:{fitVideoSize:`fixWidth`}})})]})}export{f as default};
2
+ "use client";import{Button as e}from"../../ui/button.mjs";import{parseResolution as t}from"../../../utils/common.mjs";import n from"../../../utils/event-bus.mjs";import r from"../video-player/index.mjs";import{eventKey as i}from"../../../constants/event-key.mjs";import a from"./popup-video.module.mjs";import{useCallback as o,useEffect as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{usePathname as d}from"next/navigation";function f(){let f=d(),[p,m]=c(!1),[h,g]=c(null),[_,v]=c(0),y=o(e=>{if(typeof window>`u`)return 0;let{width:n,height:r}=t(e.resolution);return n<=0?0:Math.max(0,r*(window.innerWidth/n))},[]),b=o(({info:e,show:t})=>{if(!e||!t){m(!1),g(null);return}g(e),v(y(e)),m(!0)},[y]);return s(()=>(n.on(i.SHOW_POPUP_VIDEO,b),()=>{n.off(i.SHOW_POPUP_VIDEO,b)}),[b]),s(()=>{m(!1),g(null)},[f]),!p||!h?null:u(`div`,{className:`fixed inset-0 z-[9999] flex items-center justify-center bg-black/95`,children:[l(e,{variant:`ghost`,className:`absolute left-4 top-4 h-10 w-10 rounded-full border border-white/20 text-white`,onClick:()=>{m(!1),g(null)},children:`←`}),l(`div`,{className:a.popupVideo,style:{width:`100%`,maxHeight:`100%`,height:_>0?`${_}px`:`auto`},children:l(r,{plyerId:h.plyerId,resolution:h.resolution,poster:h.poster||``,videoUrl:h.videoUrl||``,hlsList:h.hlsList,mergeConfig:_>0?{}:{fitVideoSize:`fixWidth`}})})]})}export{f as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{defaultLocale as e,getMessages as t,isValidLocale as n}from"../../../i18n.mjs";import r from"../../ui/popup.mjs";import{IntlProvider as i}from"../intl-provider/intl-provider.mjs";import a from"../../../assets/icons/share/share-link.mjs";import{SharePlatformEnum as o}from"../../../types/share.mjs";import s from"../../../utils/share-manager.mjs";import{useEffect as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useTranslations as f}from"next-intl";import{createRoot as p}from"react-dom/client";let m=``;const h=[{id:o.SHARE_LINK,name:``,icon:u(a,{className:`w-full h-full`}),onClick:e=>{s.showSharePopup({type:o.SHARE_LINK,data:e,copyUrl:m})}}],g=[],_={id:``,isCollect:!1};function v(e){let t=f(`components.common.sharePopup`),{visible:n,onClose:i,onCollect:a,data:s=_,platforms:p=h,actions:m=g,cancelText:v,maskClosable:y=!0}=e,[b,x]=l(s.isCollect),S=v??t(`shareDrawer.cancel`);c(()=>{x(s.isCollect)},[s.isCollect]);function C(e){return e.name?e.name:e.id===o.SHARE_LINK?t(`shareContent.copyShareLink`):``}function w(e){window.sensors?.track?.(`detail_share_click`,{object_id:s.id,channel:e.id}),e.onClick(s),i?.()}function T(e){!e&&y&&i?.()}function E(e){return function(){w(e)}}return u(r,{side:`bottom`,open:n,onOpenChange:T,showCloseButton:!1,className:`z-[2000] !gap-0 rounded-t-[16px] bg-bg2 p-0 text-text1`,children:d(`div`,{className:`bg-bg2`,children:[p.length>0&&u(`div`,{className:`p-[24px]`,children:u(`div`,{className:`w-full h-[72px] overflow-hidden`,children:u(`div`,{className:`w-full g-scroll-box-x flex items-center`,style:{height:`calc(100% + 60px)`,paddingBottom:`60px`},children:p.map((e,t)=>d(`div`,{className:`cursor-pointer h-[100%] flex flex-col items-center justify-between ${t>0?`ml-[32px]`:``}`,onClick:E(e),children:[u(`span`,{className:`w-[48px] h-[48px] flex items-center justify-center`,children:e.icon}),u(`span`,{className:`text-text1 text-[12px] leading-[12px]`,children:C(e)})]},e.id))})})}),u(`div`,{className:`bg-bg1 mt-[4px] flex items-center justify-center`,onClick:i,children:u(`span`,{className:`text-text1 text-[16px] leading-[60px]`,children:S})})]})})}function y(){if(typeof document>`u`)return e;let t=document.documentElement?.lang||``;return n(t)?t:e}function b(e){let n=y();return u(i,{locale:n,messages:t(n),children:u(v,{...e})})}let x=null,S=null,C=null;var w=class e{static async show(t){let n=await s.initShareConfig(),r=t.initPlatforms||h.filter(e=>n[e.id]),i=t.initActions||g,{data:a,...o}=t,c={platforms:r,actions:i,maskClosable:!0,...o};C={supportActions:i,supportPlatforms:r};let l=typeof window<`u`?window.location.href:``;m=t.copyUrl||t.shareUrl||l,x||(x=document.createElement(`div`),x.style.zIndex=`2001`,document.body.appendChild(x),S=p(x)),S?.render(u(b,{visible:!1,data:a,onClose:()=>{e.clear(),c.onClose?.()},...c})),requestAnimationFrame(()=>{S?.render(u(b,{visible:!0,data:a,onClose:()=>{e.clear(),c.onClose?.()},...c}))})}static clear(){S&&x&&(S.render(u(b,{visible:!1,data:{},platforms:C?.supportPlatforms,actions:C?.supportActions,maskClosable:!0})),setTimeout(()=>{S?.unmount(),S=null,x?.parentNode&&x.parentNode.removeChild(x),x=null},300))}};export{v as SharePopupComponent,w as default,g as defaultActions,h as defaultPlatforms};
2
+ "use client";import e from"../../ui/popup.mjs";import t from"../../../assets/icons/share/share-link.mjs";import{defaultLocale as n,getMessages as r,isValidLocale as i}from"../../../i18n.mjs";import{IntlProvider as a}from"../intl-provider/intl-provider.mjs";import{SharePlatformEnum as o}from"../../../types/share.mjs";import s from"../../../utils/share-manager.mjs";import{useEffect as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useTranslations as f}from"next-intl";import{createRoot as p}from"react-dom/client";let m=``;const h=[{id:o.SHARE_LINK,name:``,icon:u(t,{className:`w-full h-full`}),onClick:e=>{s.showSharePopup({type:o.SHARE_LINK,data:e,copyUrl:m})}}],g=[],_={id:``,isCollect:!1};function v(t){let n=f(`components.common.sharePopup`),{visible:r,onClose:i,onCollect:a,data:s=_,platforms:p=h,actions:m=g,cancelText:v,maskClosable:y=!0}=t,[b,x]=l(s.isCollect),S=v??n(`shareDrawer.cancel`);c(()=>{x(s.isCollect)},[s.isCollect]);function C(e){return e.name?e.name:e.id===o.SHARE_LINK?n(`shareContent.copyShareLink`):``}function w(e){window.sensors?.track?.(`detail_share_click`,{object_id:s.id,channel:e.id}),e.onClick(s),i?.()}function T(e){!e&&y&&i?.()}function E(e){return function(){w(e)}}return u(e,{side:`bottom`,open:r,onOpenChange:T,showCloseButton:!1,className:`z-[2000] !gap-0 rounded-t-[16px] bg-bg2 p-0 text-text1`,children:d(`div`,{className:`bg-bg2`,children:[p.length>0&&u(`div`,{className:`p-[24px]`,children:u(`div`,{className:`w-full h-[72px] overflow-hidden`,children:u(`div`,{className:`w-full g-scroll-box-x flex items-center`,style:{height:`calc(100% + 60px)`,paddingBottom:`60px`},children:p.map((e,t)=>d(`div`,{className:`cursor-pointer h-[100%] flex flex-col items-center justify-between ${t>0?`ml-[32px]`:``}`,onClick:E(e),children:[u(`span`,{className:`w-[48px] h-[48px] flex items-center justify-center`,children:e.icon}),u(`span`,{className:`text-text1 text-[12px] leading-[12px]`,children:C(e)})]},e.id))})})}),u(`div`,{className:`bg-bg1 mt-[4px] flex items-center justify-center`,onClick:i,children:u(`span`,{className:`text-text1 text-[16px] leading-[60px]`,children:S})})]})})}function y(){if(typeof document>`u`)return n;let e=document.documentElement?.lang||``;return i(e)?e:n}function b(e){let t=y();return u(a,{locale:t,messages:r(t),children:u(v,{...e})})}let x=null,S=null,C=null;var w=class e{static async show(t){let n=await s.initShareConfig(),r=t.initPlatforms||h.filter(e=>n[e.id]),i=t.initActions||g,{data:a,...o}=t,c={platforms:r,actions:i,maskClosable:!0,...o};C={supportActions:i,supportPlatforms:r};let l=typeof window<`u`?window.location.href:``;m=t.copyUrl||t.shareUrl||l,x||(x=document.createElement(`div`),x.style.zIndex=`2001`,document.body.appendChild(x),S=p(x)),S?.render(u(b,{visible:!1,data:a,onClose:()=>{e.clear(),c.onClose?.()},...c})),requestAnimationFrame(()=>{S?.render(u(b,{visible:!0,data:a,onClose:()=>{e.clear(),c.onClose?.()},...c}))})}static clear(){S&&x&&(S.render(u(b,{visible:!1,data:{},platforms:C?.supportPlatforms,actions:C?.supportActions,maskClosable:!0})),setTimeout(()=>{S?.unmount(),S=null,x?.parentNode&&x.parentNode.removeChild(x),x=null},300))}};export{v as SharePopupComponent,w as default,g as defaultActions,h as defaultPlatforms};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Box as e}from"../../ui/box.mjs";import{Text as t}from"../../ui/text.mjs";import n from"../../ui/link.mjs";import r from"../../../assets/icons/tabs/follow.mjs";import i from"../../../assets/icons/tabs/follow_active.mjs";import a from"../../../assets/icons/tabs/home.mjs";import o from"../../../assets/icons/tabs/home_active.mjs";import s from"../../../assets/icons/tabs/mine.mjs";import c from"../../../assets/icons/tabs/mine_active.mjs";import l from"../../ui/legacy/badge.mjs";import{usePathname as u}from"next/navigation";import{useEffect as d,useState as f,useTransition as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{useTranslations as _}from"next-intl";function v(e,t){if(t!==`/`)return e.startsWith(t);let n=[`/user`].some(t=>e.startsWith(t)),r=e.startsWith(`/category/`);return!n&&(e===`/`||r)}const y=[`/nav-page`],b=`env(safe-area-inset-bottom, 0px)`;function x(x){let{className:S}=x,C=u(),w=_(`tabBar`),[T,E]=f(null),[,D]=p(),[O]=f(0),[k,A]=f(!1),j=[{badge:!1,id:1,labelKey:`home`,path:`/`,icon:a,activeIcon:o,width:22,height:22},{badge:!1,id:2,labelKey:`follow`,path:`/user/follow`,icon:r,activeIcon:i,width:22,height:22},{badge:!1,id:5,labelKey:`mine`,path:`/user/mine`,icon:s,activeIcon:c,width:22,height:22}],M=(e,t,n)=>{t!==C&&E(t)};return d(()=>{T&&v(C,T)&&D(()=>{E(null)})},[C,T]),d(()=>{let e=setTimeout(()=>{A(!0)},0);return()=>clearTimeout(e)},[]),C&&y.some(e=>C.includes(e))?null:h(e,{className:`fixed bottom-0 left-0 right-0 bg-bg1 border-t border-line1 flex items-center justify-around z-50 ${S||``}`,style:{height:`calc(56px + ${b})`,paddingBottom:b},children:j.map(r=>{let i=k&&C?v(T||C||``,r.path):!1,a=i?r.activeIcon:r.icon,o=g(m,{children:[r.badge&&O>0?h(l,{dot:!0,children:h(a,{width:r.width,height:r.height})}):h(a,{width:r.width,height:r.height}),h(t,{className:`text-[10px] mt-[4px] ${i?`text-theme5`:`text-text2`}`,children:w(r.labelKey)})]});return i?h(e,{className:`flex flex-col items-center justify-center flex-1 h-full`,children:o},r.id):h(n,{href:r.path,prefetch:!0,className:`flex flex-col items-center justify-center flex-1 h-full`,onClick:e=>{M(e,r.path,r.labelKey)},children:o},r.id)})})}export{x as TabBar};
2
+ "use client";import{Box as e}from"../../ui/box.mjs";import{Text as t}from"../../ui/text.mjs";import n from"../../ui/link.mjs";import r from"../../../assets/icons/tabs/follow.mjs";import i from"../../../assets/icons/tabs/follow_active.mjs";import a from"../../../assets/icons/tabs/home.mjs";import o from"../../../assets/icons/tabs/home_active.mjs";import s from"../../../assets/icons/tabs/mine.mjs";import c from"../../../assets/icons/tabs/mine_active.mjs";import l from"../../ui/legacy/badge.mjs";import{useEffect as u,useState as d,useTransition as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";import{usePathname as _}from"next/navigation";function v(e,t){if(t!==`/`)return e.startsWith(t);let n=[`/user`].some(t=>e.startsWith(t)),r=e.startsWith(`/category/`);return!n&&(e===`/`||r)}const y=[`/nav-page`],b=`env(safe-area-inset-bottom, 0px)`;function x(x){let{className:S}=x,C=_(),w=g(`tabBar`),[T,E]=d(null),[,D]=f(),[O]=d(0),[k,A]=d(!1),j=[{badge:!1,id:1,labelKey:`home`,path:`/`,icon:a,activeIcon:o,width:22,height:22},{badge:!1,id:2,labelKey:`follow`,path:`/user/follow`,icon:r,activeIcon:i,width:22,height:22},{badge:!1,id:5,labelKey:`mine`,path:`/user/mine`,icon:s,activeIcon:c,width:22,height:22}],M=(e,t,n)=>{t!==C&&E(t)};return u(()=>{T&&v(C,T)&&D(()=>{E(null)})},[C,T]),u(()=>{let e=setTimeout(()=>{A(!0)},0);return()=>clearTimeout(e)},[]),C&&y.some(e=>C.includes(e))?null:m(e,{className:`fixed bottom-0 left-0 right-0 bg-bg1 border-t border-line1 flex items-center justify-around z-50 ${S||``}`,style:{height:`calc(56px + ${b})`,paddingBottom:b},children:j.map(r=>{let i=k&&C?v(T||C||``,r.path):!1,a=i?r.activeIcon:r.icon,o=h(p,{children:[r.badge&&O>0?m(l,{dot:!0,children:m(a,{width:r.width,height:r.height})}):m(a,{width:r.width,height:r.height}),m(t,{className:`text-[10px] mt-[4px] ${i?`text-theme5`:`text-text2`}`,children:w(r.labelKey)})]});return i?m(e,{className:`flex flex-col items-center justify-center flex-1 h-full`,children:o},r.id):m(n,{href:r.path,prefetch:!0,className:`flex flex-col items-center justify-center flex-1 h-full`,onClick:e=>{M(e,r.path,r.labelKey)},children:o},r.id)})})}export{x as TabBar};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{gContentGetAppChannelBlock as t,gContentGetAppChannels as n}from"../../../service/generated/client.mjs";import{Box as r}from"../../ui/box.mjs";import{useRequest as i}from"../../../hooks/query/use-query.mjs";import{queryKey as a}from"../../../constants/query-key.mjs";import{matchChannelByPath as o}from"../../pages/home/channel-matcher.mjs";import{TopNavBarFullscreen as s}from"./fullscreen.mjs";import{TopNavBarNormal as c}from"./normal.mjs";import{usePathname as l}from"next/navigation";import{useMemo as u}from"react";import{jsx as d}from"react/jsx-runtime";function f(e){return e===`/`?[]:e.startsWith(`/category/`)?e.replace(`/category/`,``).split(`/`).map(e=>decodeURIComponent(e)):[]}function p({categoryPath:p,currentChannelId:m}){let h=l()||`/`,{data:g}=i([a.CHANNEL],()=>n()),_=u(()=>e(g?.data),[g?.data]),v=u(()=>typeof window>`u`?p||[]:f(h),[p,h]),y=u(()=>_.length===0?null:o(v,_),[v,_])?.id??m??``,{data:b}=i(a.GET_CONTENT_LIST(y),()=>t({channel_id:y}),{enabled:!!y}),x=u(()=>b?.data?.blocks||[],[b?.data?.blocks]),S=u(()=>x.length>0&&x[0].show_style===6,[x]);return d(r,{className:`w-full`,"data-top-nav-root":`true`,children:d(S?s:c,{channelDataList:_,currentChannelId:y})})}export{p as TopNavBar};
2
+ "use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{gContentGetAppChannelBlock as t,gContentGetAppChannels as n}from"../../../service/generated/client.mjs";import{Box as r}from"../../ui/box.mjs";import{useRequest as i}from"../../../hooks/query/use-query.mjs";import{queryKey as a}from"../../../constants/query-key.mjs";import{matchChannelByPath as o}from"../../pages/home/channel-matcher.mjs";import{TopNavBarFullscreen as s}from"./fullscreen.mjs";import{TopNavBarNormal as c}from"./normal.mjs";import{useMemo as l}from"react";import{jsx as u}from"react/jsx-runtime";import{usePathname as d}from"next/navigation";function f(e){return e===`/`?[]:e.startsWith(`/category/`)?e.replace(`/category/`,``).split(`/`).map(e=>decodeURIComponent(e)):[]}function p({categoryPath:p,currentChannelId:m}){let h=d()||`/`,{data:g}=i([a.CHANNEL],()=>n()),_=l(()=>e(g?.data),[g?.data]),v=l(()=>typeof window>`u`?p||[]:f(h),[p,h]),y=l(()=>_.length===0?null:o(v,_),[v,_])?.id??m??``,{data:b}=i(a.GET_CONTENT_LIST(y),()=>t({channel_id:y}),{enabled:!!y}),x=l(()=>b?.data?.blocks||[],[b?.data?.blocks]),S=l(()=>x.length>0&&x[0].show_style===6,[x]);return u(r,{className:`w-full`,"data-top-nav-root":`true`,children:u(S?s:c,{channelDataList:_,currentChannelId:y})})}export{p as TopNavBar};
@@ -1,8 +1,8 @@
1
1
 
2
- "use client";import{generateUUID as e,parseResolution as t}from"../../../utils/common.mjs";import{decryptImageUrl as n}from"../../../utils/decrypt-image-client.mjs";import{apiCollectCustom as r}from"../../../utils/api-collect.mjs";import{RETRY_RECOVERED_MIN_PLAY_SECONDS as i,buildVideoPlayerSrc as a,isM3u8VideoUrl as o,resolveVideoPlayerSrc as s}from"./process-m3u8-cache.mjs";import{videoConfig as c}from"./create-video.mjs";import{RETRY_RESUME_END_GAP_SECONDS as l,pauseOtherVideos as u,prepareRetryResumeState as d,registerVideo as ee,shouldTriggerFpsStuckRecovery as te,unregisterVideo as f}from"./playing-videos.mjs";import p from"./style.module.mjs";import{useCallback as m,useEffect as h,useImperativeHandle as ne,useRef as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import y from"next/image";import{useLocale as re}from"next-intl";async function ie(){await import(`xgplayer/dist/index.min.css`)}const ae=[],oe={},b=10*1e3;function x({className:r=``,parentId:x=``,plyerId:S=``,videoUrl:C=``,poster:se=``,resolution:w,hlsList:ce=ae,mergeConfig:T=oe,onProgressUpdate:le,onVideoEnded:ue,onPlay:de,onPause:fe,onEnded:pe,onPlayerReady:me,onControlsVisibilityChange:he,ref:ge}){let _e=re()===`en`?`en`:`zh-cn`,E=g(e()).current,D=g(1),O=g(1),k=g(0),ve=g(0),A=g(null),ye=g(null),j=g(!1),M=g(!1),be=g(1),N=g(null),P=g(null),xe=g(!1),F=g(0),I=g(null),L=g(null),R=g(!1),z=g(null),B=g(null),V=g(null),H=g(!1),Se=g(!1),U=g(!1),W=g(!1),Ce=g(T),G=m(()=>{P.current&&=(window.clearTimeout(P.current),null),N.current&&=(N.current.disconnect(),null)},[]),K=m(()=>{I.current&&=(window.clearTimeout(I.current),null)},[]),q=m(()=>{L.current&&=(window.clearTimeout(L.current),null)},[]),J=m(e=>{let t=R.current||L.current!==null;if(R.current=!1,q(),!(!t||!e))try{e.removeClass?.(`xgplayer-isloading`),e.getPlugin?.(`loading`)?.hide?.()}catch{}},[q]),Y=m(e=>{if(J(e),e)try{e.addClass?.(`xgplayer-is-error`),e.getPlugin?.(`error`)?.show?.()}catch{}},[J]),we=m(e=>{if(e){R.current=!0,q();try{e.removeClass?.(`xgplayer-is-error`),e.addClass?.(`xgplayer-isloading`),e.getPlugin?.(`error`)?.hide?.(),e.getPlugin?.(`loading`)?.show?.()}catch{}L.current=window.setTimeout(()=>{L.current=null,!(H.current||!R.current)&&(K(),z.current=null,F.current=3,Y(A.current||e),console.warn(`~ 播放器加载超过 ${b}ms,已回退失败态,请手动刷新 ~`))},b)}},[q,K,Y]),Te=m(()=>{G(),q(),R.current=!1,f(E),U.current=!1,z.current=null,A.current&&=(A.current.offAll(),A.current.destroy(),null)},[G,q,E]);ne(ge,()=>({enterFullscreen:()=>{A.current.getPlugin(`fullscreen`).handleFullscreen()},isFullscreen:()=>j.current,isPlayerReady:()=>U.current&&!!A.current,getPlayer:()=>A.current}),[]);let X=g(null),Z=g(null),Ee=g(null),Q=g(null),De=g(null),Oe=.3,ke=.7,$=.045,Ae=()=>a(C);function je(e){return Math.min(4e3,500*2**(e-1))+Math.floor(Math.random()*200)}let Me=async(e,r,f)=>{let p=Ae();if(!p)return;let m=s(C),h=o(C)||(ce?.length??0)>0;try{await ie();let[o,s]=await Promise.all([import(`xgplayer`),h?import(`xgplayer-hls`):Promise.resolve(null),(async()=>{try{se=await n(se)}catch{console.warn(`解码post失败`)}})()]);if(e())return;let ne=await m;if(e())return;let g=ne||p,_=ye.current;if(!_||!_.isConnected)for(let t=0;t<10;t+=1){if(e())return;if(await new Promise(e=>{window.setTimeout(()=>e(),16)}),_=ye.current,_&&_.isConnected)break}if(!_||!_.isConnected||e())return;let v=o.default??o,y=o.Events,re=s?s.default??s:null,ae=h&&re?[...c.plugins,re]:c.plugins,oe=h?{preloadTime:15,bufferBehind:5,keepStatusAfterSwitch:!0}:void 0;A.current=new v({...c,lang:_e,el:_,videoFillMode:`contain`,url:g,poster:se,playbackRate:{list:[.75,1,1.25,1.5,1.75,2]},plugins:ae,...oe?{hls:oe}:{},miniprogress:!0,definition:{list:ce?.map(e=>({text:`${e.text}`,url:a(e.url),definition:`${e.definition}`}))},fullscreen:{useScreenOrientation:!0},...T}),A.current.on(y.REPLAY,()=>{Se.current=!1}),A.current.on(y.WAITING,()=>{console.log(`~视频缓冲中,可能出现卡顿~`)}),A.current.on(y.STALLED,()=>{console.log(`~播放停滞,网络连接问题~`)}),A.current.on(y.LOADING,()=>{console.log(`~正在加载数据~`)}),A.current.on(y.LOADED_DATA,()=>{J(A.current)}),A.current.on(y.CANPLAY,()=>{J(A.current)}),A.current.on(y.PLAYING,()=>{J(A.current)});let b=t=>{let n=A.current;if(e()||!n||F.current>=3)return!1;if(I.current)return we(n),!0;let r=d({failureType:t,player:n,renderedMediaTime:0});B.current=r.time,V.current=r.shouldPlay,z.current=null,F.current+=1;let i=F.current,a=je(i);we(n);let o=t===`fps_stuck`?`画面卡顿`:`失败`;return console.warn(`~ 播放${o},${a}ms 后进行第 ${i} 次重试加载 ~`),I.current=window.setTimeout(()=>{I.current=null,!e()&&(Te(),Me(()=>H.current,()=>Pe.current?.(),e=>Fe.current?.(e)))},a),!0};A.current.on(y.FPS_STUCK,e=>{console.log(`~检测到帧率卡顿~`,e),te(e)&&(b(`fps_stuck`)||Y(A.current))}),A.current.on(y.BUFFER_CHANGE,e=>{console.log(`~缓冲区状态变化:~`,e)}),A.current.on(y.ERROR,t=>{let n=String(t&&(t.message||t.msg||t.error?.message)||t||``),r=A.current;if(r){if(h&&/SourceBuffer is full|QuotaExceeded/i.test(n)){if(e()||xe.current)return;xe.current=!0,window.setTimeout(()=>{xe.current=!1},2e3);try{let e=Number(r?.currentTime||0);(r?.getPlugin?.(`hls`)?.core)?._bufferService?.removeBuffer?.(0,Math.max(0,e-5)).catch?.(()=>{});let t=r?.config?.url;if(typeof r?.switchURL==`function`&&typeof t==`string`&&t){we(r),r.switchURL(t,{currentTime:e,seamless:!1}).catch(()=>{b(`error`)||Y(r)});return}}catch{}}b(`error`)||Y(r)}}),A.current.on(y.PLAY,()=>{F.current>0&&(z.current=Number(A.current?.currentTime||0)),K(),J(A.current),window.sensors?.track(`player_start`,{object_id:x||S||``,play_session_id:x||S,start_type:`播放`,start_position:0,duration:A.current.duration,definition:w,playback_rate:A.current.playbackRate}),u(E,A.current),Se.current||=(Ne(),!0),de?.()}),A.current.on(y.FULLSCREEN_CHANGE,e=>{window.sensors?.track(`player_fullscreen_toggle`,{object_id:x||S||``,play_session_id:x||S||``,action:e?`全屏`:`退出全屏`}),j.current=e}),A.current.on(y.SEEKING,()=>{M.current=!0}),A.current.on(y.SEEKED,()=>{M.current=!1}),A.current.on(y.PAUSE,()=>{window.sensors?.track(`player_pause`,{object_id:x||S||``,play_session_id:x||S||``,pause_position:A.current.currentTime,cumulative_time:A.current.duration}),fe?.()}),A.current.on(y.ENDED,()=>{window.sensors?.track(`player_end`,{object_id:x||S||``,play_session_id:x||S||``,end_position:A.current.currentTime,cumulative_time:A.current.duration,end_type:`播放结束`,is_finish:A.current.currentTime===A.current.duration}),pe?.(),ue&&ue()}),A.current.on(y.RATE_CHANGE,()=>{window.sensors?.track(`player_rate_change`,{object_id:x||S||``,play_session_id:x||S||``,old_rate:be.current,new_rate:A.current.playbackRate}),be.current=A.current.playbackRate}),A.current.on(y.DEFINITION_CHANGE,()=>{window.sensors?.track(`player_definition_change`,{object_id:x||S||``,play_session_id:x||S||``,old_def:w,new_def:A.current.definition})}),A.current.on(y.TIME_UPDATE,()=>{if(A.current&&(F.current>0&&z.current!==null&&Number(A.current.currentTime||0)-z.current>=i&&(F.current=0,z.current=null),le)){let e=A.current.currentTime||0,t=A.current.duration||0;e>0&&t>0&&le(e,t)}});let C=()=>{if(!A.current)return;let e=Ce.current||{},t=Number(A.current.duration||0);if(t<=0)return;let n=B.current;if(n!==null&&n>0){let e=Math.max(0,t-l),r=Math.min(e>0?e:t,n);A.current.currentTime=r,B.current=null;return}let r=Number(e.startTimeSeconds||0);if(r>0){let e=Math.min(t,r);A.current.currentTime=e;return}if(e.startPercent!==void 0&&e.startPercent>0){let n=e.startPercent/100*t;A.current.currentTime=Math.min(t,n)}};A.current.once(`loadedmetadata`,()=>{C()}),A.current.once(`ready`,()=>{U.current=!0,A.current&&A.current.duration>0&&C();let n=V.current;V.current=null,n===!0?A.current?.play?.().catch(()=>{}):n===!1&&A.current?.pause?.(),ee(E,A.current),r&&r(),f&&(G(),P.current=window.setTimeout(()=>{if(e())return;let t=A.current?.root;if(!t)return;let n=new MutationObserver(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`class`&&f(!e.target.classList.contains(`xgplayer-inactive`))})});N.current=n,n.observe(t,{attributes:!0,attributeFilter:[`class`]}),f(!t.classList.contains(`xgplayer-inactive`))},33));let i=A.current.root,a=0,o=A.current.root.querySelector(`.xgmask`),{width:s,height:c}=t(w),l=s<c?document.documentElement.clientWidth:document.documentElement.clientHeight,u=De.current;u&&A.current?.root&&!A.current.root.contains(u)&&A.current.root.appendChild(u),i.addEventListener(`touchstart`,e=>{if(!j.current)return;let t=e.touches[0];a=t.clientX,k.current=t.clientY,W.current=!1,O.current=A.current.volume;let n=window.getComputedStyle(o).backgroundColor;D.current=1-(Number.parseFloat(n.split(`,`)[3])||0)},{passive:!1}),i.addEventListener(`touchmove`,e=>{if(!j.current)return;e.preventDefault();let t=e.touches[0],n=t.clientX-a,r=t.clientY;if(Math.abs(n)>50||M.current){W.current=!0,d();return}if(W.current){d();return}if(Math.abs(r-k.current)>6){let e=Date.now();if(e-ve.current<16)return;ve.current=e;let n=r<k.current;k.current=r;let i=t.clientX,o=a<l*Oe,s=a>l*ke;if(!o&&!s){d();return}let c=i<l*Oe,u=i>l*ke;if(o&&!c){W.current=!0,d();return}if(s&&!u){W.current=!0,d();return}o&&c?te(n):s&&u?p(n):d()}},{passive:!1});function d(){X.current&&(X.current.style.visibility=`hidden`),Z.current&&(Z.current.style.visibility=`hidden`)}function te(e){let t=e?$:-$;D.current=Math.max(0,Math.min(1,D.current+t)),X.current&&(X.current.style.visibility=`visible`),Z.current&&(Z.current.style.visibility=`hidden`),Ee.current&&(Ee.current.style.transform=`scaleY(${D.current})`);let n=1-D.current;o.style.cssText=`
2
+ "use client";import{generateUUID as e,parseResolution as t}from"../../../utils/common.mjs";import{decryptImageUrl as n}from"../../../utils/decrypt-image-client.mjs";import{RETRY_RECOVERED_MIN_PLAY_SECONDS as r,buildVideoPlayerSrc as i,isM3u8VideoUrl as a,resolveVideoPlayerSrc as o}from"./process-m3u8-cache.mjs";import{apiCollectCustom as s}from"../../../utils/api-collect.mjs";import{videoConfig as c}from"./create-video.mjs";import{RETRY_RESUME_END_GAP_SECONDS as l,pauseOtherVideos as u,prepareRetryResumeState as d,registerVideo as ee,shouldTriggerFpsStuckRecovery as te,unregisterVideo as f}from"./playing-videos.mjs";import p from"./style.module.mjs";import{useCallback as m,useEffect as h,useImperativeHandle as ne,useRef as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import y from"next/image";import{useLocale as re}from"next-intl";async function ie(){await import(`xgplayer/dist/index.min.css`)}const ae=[],oe={},b=10*1e3;function x({className:s=``,parentId:x=``,plyerId:S=``,videoUrl:C=``,poster:se=``,resolution:w,hlsList:ce=ae,mergeConfig:T=oe,onProgressUpdate:le,onVideoEnded:ue,onPlay:de,onPause:fe,onEnded:pe,onPlayerReady:me,onControlsVisibilityChange:he,ref:ge}){let _e=re()===`en`?`en`:`zh-cn`,E=g(e()).current,D=g(1),O=g(1),k=g(0),ve=g(0),A=g(null),ye=g(null),j=g(!1),M=g(!1),be=g(1),N=g(null),P=g(null),xe=g(!1),F=g(0),I=g(null),L=g(null),R=g(!1),z=g(null),B=g(null),V=g(null),H=g(!1),Se=g(!1),U=g(!1),W=g(!1),Ce=g(T),G=m(()=>{P.current&&=(window.clearTimeout(P.current),null),N.current&&=(N.current.disconnect(),null)},[]),K=m(()=>{I.current&&=(window.clearTimeout(I.current),null)},[]),q=m(()=>{L.current&&=(window.clearTimeout(L.current),null)},[]),J=m(e=>{let t=R.current||L.current!==null;if(R.current=!1,q(),!(!t||!e))try{e.removeClass?.(`xgplayer-isloading`),e.getPlugin?.(`loading`)?.hide?.()}catch{}},[q]),Y=m(e=>{if(J(e),e)try{e.addClass?.(`xgplayer-is-error`),e.getPlugin?.(`error`)?.show?.()}catch{}},[J]),we=m(e=>{if(e){R.current=!0,q();try{e.removeClass?.(`xgplayer-is-error`),e.addClass?.(`xgplayer-isloading`),e.getPlugin?.(`error`)?.hide?.(),e.getPlugin?.(`loading`)?.show?.()}catch{}L.current=window.setTimeout(()=>{L.current=null,!(H.current||!R.current)&&(K(),z.current=null,F.current=3,Y(A.current||e),console.warn(`~ 播放器加载超过 ${b}ms,已回退失败态,请手动刷新 ~`))},b)}},[q,K,Y]),Te=m(()=>{G(),q(),R.current=!1,f(E),U.current=!1,z.current=null,A.current&&=(A.current.offAll(),A.current.destroy(),null)},[G,q,E]);ne(ge,()=>({enterFullscreen:()=>{A.current.getPlugin(`fullscreen`).handleFullscreen()},isFullscreen:()=>j.current,isPlayerReady:()=>U.current&&!!A.current,getPlayer:()=>A.current}),[]);let X=g(null),Z=g(null),Ee=g(null),Q=g(null),De=g(null),Oe=.3,ke=.7,$=.045,Ae=()=>i(C);function je(e){return Math.min(4e3,500*2**(e-1))+Math.floor(Math.random()*200)}let Me=async(e,s,f)=>{let p=Ae();if(!p)return;let m=o(C),h=a(C)||(ce?.length??0)>0;try{await ie();let[a,o]=await Promise.all([import(`xgplayer`),h?import(`xgplayer-hls`):Promise.resolve(null),(async()=>{try{se=await n(se)}catch{console.warn(`解码post失败`)}})()]);if(e())return;let ne=await m;if(e())return;let g=ne||p,_=ye.current;if(!_||!_.isConnected)for(let t=0;t<10;t+=1){if(e())return;if(await new Promise(e=>{window.setTimeout(()=>e(),16)}),_=ye.current,_&&_.isConnected)break}if(!_||!_.isConnected||e())return;let v=a.default??a,y=a.Events,re=o?o.default??o:null,ae=h&&re?[...c.plugins,re]:c.plugins,oe=h?{preloadTime:15,bufferBehind:5,keepStatusAfterSwitch:!0}:void 0;A.current=new v({...c,lang:_e,el:_,videoFillMode:`contain`,url:g,poster:se,playbackRate:{list:[.75,1,1.25,1.5,1.75,2]},plugins:ae,...oe?{hls:oe}:{},miniprogress:!0,definition:{list:ce?.map(e=>({text:`${e.text}`,url:i(e.url),definition:`${e.definition}`}))},fullscreen:{useScreenOrientation:!0},...T}),A.current.on(y.REPLAY,()=>{Se.current=!1}),A.current.on(y.WAITING,()=>{console.log(`~视频缓冲中,可能出现卡顿~`)}),A.current.on(y.STALLED,()=>{console.log(`~播放停滞,网络连接问题~`)}),A.current.on(y.LOADING,()=>{console.log(`~正在加载数据~`)}),A.current.on(y.LOADED_DATA,()=>{J(A.current)}),A.current.on(y.CANPLAY,()=>{J(A.current)}),A.current.on(y.PLAYING,()=>{J(A.current)});let b=t=>{let n=A.current;if(e()||!n||F.current>=3)return!1;if(I.current)return we(n),!0;let r=d({failureType:t,player:n,renderedMediaTime:0});B.current=r.time,V.current=r.shouldPlay,z.current=null,F.current+=1;let i=F.current,a=je(i);we(n);let o=t===`fps_stuck`?`画面卡顿`:`失败`;return console.warn(`~ 播放${o},${a}ms 后进行第 ${i} 次重试加载 ~`),I.current=window.setTimeout(()=>{I.current=null,!e()&&(Te(),Me(()=>H.current,()=>Pe.current?.(),e=>Fe.current?.(e)))},a),!0};A.current.on(y.FPS_STUCK,e=>{console.log(`~检测到帧率卡顿~`,e),te(e)&&(b(`fps_stuck`)||Y(A.current))}),A.current.on(y.BUFFER_CHANGE,e=>{console.log(`~缓冲区状态变化:~`,e)}),A.current.on(y.ERROR,t=>{let n=String(t&&(t.message||t.msg||t.error?.message)||t||``),r=A.current;if(r){if(h&&/SourceBuffer is full|QuotaExceeded/i.test(n)){if(e()||xe.current)return;xe.current=!0,window.setTimeout(()=>{xe.current=!1},2e3);try{let e=Number(r?.currentTime||0);(r?.getPlugin?.(`hls`)?.core)?._bufferService?.removeBuffer?.(0,Math.max(0,e-5)).catch?.(()=>{});let t=r?.config?.url;if(typeof r?.switchURL==`function`&&typeof t==`string`&&t){we(r),r.switchURL(t,{currentTime:e,seamless:!1}).catch(()=>{b(`error`)||Y(r)});return}}catch{}}b(`error`)||Y(r)}}),A.current.on(y.PLAY,()=>{F.current>0&&(z.current=Number(A.current?.currentTime||0)),K(),J(A.current),window.sensors?.track(`player_start`,{object_id:x||S||``,play_session_id:x||S,start_type:`播放`,start_position:0,duration:A.current.duration,definition:w,playback_rate:A.current.playbackRate}),u(E,A.current),Se.current||=(Ne(),!0),de?.()}),A.current.on(y.FULLSCREEN_CHANGE,e=>{window.sensors?.track(`player_fullscreen_toggle`,{object_id:x||S||``,play_session_id:x||S||``,action:e?`全屏`:`退出全屏`}),j.current=e}),A.current.on(y.SEEKING,()=>{M.current=!0}),A.current.on(y.SEEKED,()=>{M.current=!1}),A.current.on(y.PAUSE,()=>{window.sensors?.track(`player_pause`,{object_id:x||S||``,play_session_id:x||S||``,pause_position:A.current.currentTime,cumulative_time:A.current.duration}),fe?.()}),A.current.on(y.ENDED,()=>{window.sensors?.track(`player_end`,{object_id:x||S||``,play_session_id:x||S||``,end_position:A.current.currentTime,cumulative_time:A.current.duration,end_type:`播放结束`,is_finish:A.current.currentTime===A.current.duration}),pe?.(),ue&&ue()}),A.current.on(y.RATE_CHANGE,()=>{window.sensors?.track(`player_rate_change`,{object_id:x||S||``,play_session_id:x||S||``,old_rate:be.current,new_rate:A.current.playbackRate}),be.current=A.current.playbackRate}),A.current.on(y.DEFINITION_CHANGE,()=>{window.sensors?.track(`player_definition_change`,{object_id:x||S||``,play_session_id:x||S||``,old_def:w,new_def:A.current.definition})}),A.current.on(y.TIME_UPDATE,()=>{if(A.current&&(F.current>0&&z.current!==null&&Number(A.current.currentTime||0)-z.current>=r&&(F.current=0,z.current=null),le)){let e=A.current.currentTime||0,t=A.current.duration||0;e>0&&t>0&&le(e,t)}});let C=()=>{if(!A.current)return;let e=Ce.current||{},t=Number(A.current.duration||0);if(t<=0)return;let n=B.current;if(n!==null&&n>0){let e=Math.max(0,t-l),r=Math.min(e>0?e:t,n);A.current.currentTime=r,B.current=null;return}let r=Number(e.startTimeSeconds||0);if(r>0){let e=Math.min(t,r);A.current.currentTime=e;return}if(e.startPercent!==void 0&&e.startPercent>0){let n=e.startPercent/100*t;A.current.currentTime=Math.min(t,n)}};A.current.once(`loadedmetadata`,()=>{C()}),A.current.once(`ready`,()=>{U.current=!0,A.current&&A.current.duration>0&&C();let n=V.current;V.current=null,n===!0?A.current?.play?.().catch(()=>{}):n===!1&&A.current?.pause?.(),ee(E,A.current),s&&s(),f&&(G(),P.current=window.setTimeout(()=>{if(e())return;let t=A.current?.root;if(!t)return;let n=new MutationObserver(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`class`&&f(!e.target.classList.contains(`xgplayer-inactive`))})});N.current=n,n.observe(t,{attributes:!0,attributeFilter:[`class`]}),f(!t.classList.contains(`xgplayer-inactive`))},33));let r=A.current.root,i=0,a=A.current.root.querySelector(`.xgmask`),{width:o,height:c}=t(w),l=o<c?document.documentElement.clientWidth:document.documentElement.clientHeight,u=De.current;u&&A.current?.root&&!A.current.root.contains(u)&&A.current.root.appendChild(u),r.addEventListener(`touchstart`,e=>{if(!j.current)return;let t=e.touches[0];i=t.clientX,k.current=t.clientY,W.current=!1,O.current=A.current.volume;let n=window.getComputedStyle(a).backgroundColor;D.current=1-(Number.parseFloat(n.split(`,`)[3])||0)},{passive:!1}),r.addEventListener(`touchmove`,e=>{if(!j.current)return;e.preventDefault();let t=e.touches[0],n=t.clientX-i,r=t.clientY;if(Math.abs(n)>50||M.current){W.current=!0,d();return}if(W.current){d();return}if(Math.abs(r-k.current)>6){let e=Date.now();if(e-ve.current<16)return;ve.current=e;let n=r<k.current;k.current=r;let a=t.clientX,o=i<l*Oe,s=i>l*ke;if(!o&&!s){d();return}let c=a<l*Oe,u=a>l*ke;if(o&&!c){W.current=!0,d();return}if(s&&!u){W.current=!0,d();return}o&&c?te(n):s&&u?p(n):d()}},{passive:!1});function d(){X.current&&(X.current.style.visibility=`hidden`),Z.current&&(Z.current.style.visibility=`hidden`)}function te(e){let t=e?$:-$;D.current=Math.max(0,Math.min(1,D.current+t)),X.current&&(X.current.style.visibility=`visible`),Z.current&&(Z.current.style.visibility=`hidden`),Ee.current&&(Ee.current.style.transform=`scaleY(${D.current})`);let n=1-D.current;a.style.cssText=`
3
3
  background-color: rgba(0,0,0,${n.toFixed(3)});
4
4
  will-change: background-color;
5
5
  transform: translateZ(0);
6
- `}function p(e){let t=e?$:-$;O.current=Math.max(0,Math.min(1,O.current+t)),A.current.volume=O.current,Z.current&&(Z.current.style.visibility=`visible`),X.current&&(X.current.style.visibility=`hidden`),Q.current&&(Q.current.style.transform=`scaleY(${O.current})`)}i.addEventListener(`touchend`,()=>{j.current&&setTimeout(()=>{d()},800)})})}catch(t){e()||console.error(`初始化播放器失败`,t)}},Ne=m(()=>{},[x,S]),Pe=g(me),Fe=g(he);return Pe.current=me,Fe.current=he,Ce.current=T,h(()=>(H.current=!1,F.current=0,z.current=null,B.current=null,V.current=null,R.current=!1,K(),q(),Me(()=>H.current,()=>Pe.current?.(),e=>Fe.current?.(e)),window.webViewVideoData={resolution:w},()=>{H.current=!0,B.current=null,V.current=null,K(),q(),G(),Te()}),[_e,S,E,C]),h(()=>{let e=Number(T?.startTimeSeconds||0),t=T?.startPercent;if(!U.current||!A.current)return;let n=Number(A.current.duration||0);if(n<=0)return;let r=0;if(e>0)r=Math.min(n,e);else if(t!==void 0&&t>0)r=Math.min(n,t/100*n);else return;let i=A.current.currentTime;Math.abs(i-r)>1&&(A.current.currentTime=r)},[T?.startPercent,T?.startTimeSeconds]),Ae()?v(`div`,{className:`w-full h-full relative ${p.videoBox} ${r}`,children:[_(`div`,{ref:ye,className:`w-full h-full`}),v(`div`,{ref:De,children:[v(`div`,{ref:X,className:`w-[36px] h-[148px] bg-[rgba(51,51,51,0.5)] rounded-[50px] border border-[rgba(0,0,0,0.05)]
6
+ `}function p(e){let t=e?$:-$;O.current=Math.max(0,Math.min(1,O.current+t)),A.current.volume=O.current,Z.current&&(Z.current.style.visibility=`visible`),X.current&&(X.current.style.visibility=`hidden`),Q.current&&(Q.current.style.transform=`scaleY(${O.current})`)}r.addEventListener(`touchend`,()=>{j.current&&setTimeout(()=>{d()},800)})})}catch(t){e()||console.error(`初始化播放器失败`,t)}},Ne=m(()=>{},[x,S]),Pe=g(me),Fe=g(he);return Pe.current=me,Fe.current=he,Ce.current=T,h(()=>(H.current=!1,F.current=0,z.current=null,B.current=null,V.current=null,R.current=!1,K(),q(),Me(()=>H.current,()=>Pe.current?.(),e=>Fe.current?.(e)),window.webViewVideoData={resolution:w},()=>{H.current=!0,B.current=null,V.current=null,K(),q(),G(),Te()}),[_e,S,E,C]),h(()=>{let e=Number(T?.startTimeSeconds||0),t=T?.startPercent;if(!U.current||!A.current)return;let n=Number(A.current.duration||0);if(n<=0)return;let r=0;if(e>0)r=Math.min(n,e);else if(t!==void 0&&t>0)r=Math.min(n,t/100*n);else return;let i=A.current.currentTime;Math.abs(i-r)>1&&(A.current.currentTime=r)},[T?.startPercent,T?.startTimeSeconds]),Ae()?v(`div`,{className:`w-full h-full relative ${p.videoBox} ${s}`,children:[_(`div`,{ref:ye,className:`w-full h-full`}),v(`div`,{ref:De,children:[v(`div`,{ref:X,className:`w-[36px] h-[148px] bg-[rgba(51,51,51,0.5)] rounded-[50px] border border-[rgba(0,0,0,0.05)]
7
7
  absolute left-[18px] top-[50%] translate-y-[-50%] flex flex-col items-center justify-center gap-[12px] z-50`,style:{visibility:`hidden`},children:[_(y,{src:`/svg/icon_jiazai_zhong.svg`,alt:`Icon`,width:20,height:20}),v(`div`,{className:`relative`,children:[_(`div`,{className:`h-[92px] w-[4px] bg-[#000000] rounded-[8px]`}),_(`div`,{ref:Ee,className:`h-[92px] w-[4px] bg-[#fff] rounded-[8px] absolute bottom-0`,style:{transformOrigin:`bottom`,transform:`scaleY(1)`,willChange:`transform`,backfaceVisibility:`hidden`,transition:`none`}})]})]}),v(`div`,{ref:Z,className:`w-[36px] h-[148px] bg-[rgba(51,51,51,0.5)] rounded-[50px] border border-[rgba(0,0,0,0.05)]
8
8
  absolute right-[18px] top-[50%] translate-y-[-50%] flex flex-col items-center justify-center gap-[12px] z-50`,style:{visibility:`hidden`},children:[_(y,{src:`/svg/icon_shengyin_di.svg`,alt:`Icon`,width:20,height:20}),v(`div`,{className:`relative`,children:[_(`div`,{className:`h-[92px] w-[4px] bg-[#000000] rounded-[8px]`}),_(`div`,{ref:Q,className:`h-[92px] w-[4px] bg-[#fff] rounded-[8px] absolute bottom-0`,style:{transformOrigin:`bottom`,transform:`scaleY(1)`,willChange:`transform`,backfaceVisibility:`hidden`,transition:`none`}})]})]})]})]}):null}export{x as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Tabs as e,TabsList as t,TabsTrigger as n}from"../../../../ui/tabs.mjs";import{usePathname as r,useRouter as i,useSearchParams as a}from"next/navigation";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{useTranslations as c}from"next-intl";function l({type:l}){let u=c(`components.pages.follow.components.interactionTabs`),d=i(),f=a(),p=r();return o(e,{value:l,onValueChange:e=>{let t=e===`fans`?`fans`:`followed`,n=p;n=p.replace(/\/(fans|followed)/,`/${t}`);let r=f.get(`user_id`),i=r?`?user_id=${r}`:``;d.replace(`${n}${i}`)},className:`h-full`,children:s(t,{variant:`default`,className:`h-full`,children:[o(n,{value:`followed`,className:`h-full px-3`,children:u(`follow`)}),o(n,{value:`fans`,className:`h-full px-3`,children:u(`fans`)})]})})}export{l as InteractionTabs};
2
+ "use client";import{Tabs as e,TabsList as t,TabsTrigger as n}from"../../../../ui/tabs.mjs";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{useTranslations as a}from"next-intl";import{usePathname as o,useRouter as s,useSearchParams as c}from"next/navigation";function l({type:l}){let u=a(`components.pages.follow.components.interactionTabs`),d=s(),f=c(),p=o();return r(e,{value:l,onValueChange:e=>{let t=e===`fans`?`fans`:`followed`,n=p;n=p.replace(/\/(fans|followed)/,`/${t}`);let r=f.get(`user_id`),i=r?`?user_id=${r}`:``;d.replace(`${n}${i}`)},className:`h-full`,children:i(t,{variant:`default`,className:`h-full`,children:[r(n,{value:`followed`,className:`h-full px-3`,children:u(`follow`)}),r(n,{value:`fans`,className:`h-full px-3`,children:u(`fans`)})]})})}export{l as InteractionTabs};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{gInteractionGetFollowerList as t,gInteractionGetFollowingList as n}from"../../../../../service/generated/client.mjs";import{Box as r}from"../../../../ui/box.mjs";import{List as i}from"../../../../ui/list.mjs";import{Text as a}from"../../../../ui/text.mjs";import{usePaginated as o,useUpdateRequest as s}from"../../../../../hooks/query/use-query.mjs";import{UserListItem as c}from"./user-list-item.mjs";import{useRouter as l}from"next/navigation";import{useState as u}from"react";import{jsx as d}from"react/jsx-runtime";import{useTranslations as f}from"next-intl";function p(e,t){return e.map(e=>({user_id:e.user_brief?.user_id??e.user_id??``,name:e.user_brief?.nickname??e.user_brief?.username??``,avatar:e.user_brief?.avatar_url??``,is_mutual:e.is_mutual,signature:e?.user_brief?.signature||``,is_friend:`0`,browse_flag:`0`,self_flag:`0`,follow_flag:t,background:``}))}function m(e,t,n,r){return{code:0,msg:`OK`,data:{page:String(t),page_size:String(n),list:p(e,r)},trace:``}}function h(p){let h=f(`components.pages.follow.components.userList`),{userId:g,type:_,page:v,showAction:y,followText:b}=p,[x,S]=u(!1),C=l(),w=e(e=>e.userId||e.userInfo?.userId||``),T=g||w,E=[`user-list`,_,T,v],D=b||h(_===`fans`?`followBack`:`follow`),{data:O,isFetching:k,fetchNextPage:A}=o({key:E,options:{staleTime:0},initialPageParam:v,async queryFn(e){if(!T)return m([],e,20,_===`followed`?`1`:`0`);let r=(_===`followed`?await n({page:e,page_size:20,user_id:T}):await t({page:e,page_size:20,user_id:T})).data,i=[];_===`followed`&&`following`in r&&(i=r.following??[]),_===`fans`&&`followers`in r&&(i=r.followers??[]);let a=m(i,e,20,_===`followed`?`1`:`0`);return a.data?.list&&a.data.list.length===0&&S(!1),a},getNextPageParam(e,t){if((e?.data?.list??[]).length!==0)return t.length+v}}),j=s();function M(e,t){j(E,n=>{for(let r of n?.pages||[])for(let n of r.data?.list||[])if(n.user_id===e){n.follow_flag=t?`1`:`0`;break}return n&&{...n}})}return d(i,{loading:k,hasMore:x,loadMore:async()=>{await A()},empty:`adduser`,emptyText:h(_===`followed`?`noFollowedUsers`:`noFans`),emptySlot:_===`followed`&&!g?d(r,{className:`w-20.5 mt-6 h-7.5 rounded-[30px] bg-theme5 flex items-center justify-center`,onClick:()=>{C.push(`/`)},children:d(a,{className:`text-[14px] text-white leading-7.5`,children:h(`followNow`)})}):null,children:O?.pages.map(e=>e.data.list.map(e=>d(i.Item,{children:d(c,{showAction:y,data:e,onUpdateFollowStatus:M,followText:e.follow_flag===`1`?h(`follow`):D})},e.user_id)))})}export{h as UserList};
2
+ "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{gInteractionGetFollowerList as t,gInteractionGetFollowingList as n}from"../../../../../service/generated/client.mjs";import{Box as r}from"../../../../ui/box.mjs";import{List as i}from"../../../../ui/list.mjs";import{Text as a}from"../../../../ui/text.mjs";import{usePaginated as o,useUpdateRequest as s}from"../../../../../hooks/query/use-query.mjs";import{UserListItem as c}from"./user-list-item.mjs";import{useState as l}from"react";import{jsx as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";import{useRouter as f}from"next/navigation";function p(e,t){return e.map(e=>({user_id:e.user_brief?.user_id??e.user_id??``,name:e.user_brief?.nickname??e.user_brief?.username??``,avatar:e.user_brief?.avatar_url??``,is_mutual:e.is_mutual,signature:e?.user_brief?.signature||``,is_friend:`0`,browse_flag:`0`,self_flag:`0`,follow_flag:t,background:``}))}function m(e,t,n,r){return{code:0,msg:`OK`,data:{page:String(t),page_size:String(n),list:p(e,r)},trace:``}}function h(p){let h=d(`components.pages.follow.components.userList`),{userId:g,type:_,page:v,showAction:y,followText:b}=p,[x,S]=l(!1),C=f(),w=e(e=>e.userId||e.userInfo?.userId||``),T=g||w,E=[`user-list`,_,T,v],D=b||h(_===`fans`?`followBack`:`follow`),{data:O,isFetching:k,fetchNextPage:A}=o({key:E,options:{staleTime:0},initialPageParam:v,async queryFn(e){if(!T)return m([],e,20,_===`followed`?`1`:`0`);let r=(_===`followed`?await n({page:e,page_size:20,user_id:T}):await t({page:e,page_size:20,user_id:T})).data,i=[];_===`followed`&&`following`in r&&(i=r.following??[]),_===`fans`&&`followers`in r&&(i=r.followers??[]);let a=m(i,e,20,_===`followed`?`1`:`0`);return a.data?.list&&a.data.list.length===0&&S(!1),a},getNextPageParam(e,t){if((e?.data?.list??[]).length!==0)return t.length+v}}),j=s();function M(e,t){j(E,n=>{for(let r of n?.pages||[])for(let n of r.data?.list||[])if(n.user_id===e){n.follow_flag=t?`1`:`0`;break}return n&&{...n}})}return u(i,{loading:k,hasMore:x,loadMore:async()=>{await A()},empty:`adduser`,emptyText:h(_===`followed`?`noFollowedUsers`:`noFans`),emptySlot:_===`followed`&&!g?u(r,{className:`w-20.5 mt-6 h-7.5 rounded-[30px] bg-theme5 flex items-center justify-center`,onClick:()=>{C.push(`/`)},children:u(a,{className:`text-[14px] text-white leading-7.5`,children:h(`followNow`)})}):null,children:O?.pages.map(e=>e.data.list.map(e=>u(i.Item,{children:u(c,{showAction:y,data:e,onUpdateFollowStatus:M,followText:e.follow_flag===`1`?h(`follow`):D})},e.user_id)))})}export{h as UserList};