1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[75162],{39910:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/super/digital-products/comments",function(){return r(76889)}])},76889:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>O});var a=r(2445),n=r(27006),l=r(96540),o=r(59324),i=r(89571),c=r(8548),d=r(58323),s=r(11335),u=r(77666);let h=e=>{let{value:t,row:r}=e,l="/".concat(r.original.slug);return(0,a.Y)(n.Link,{href:l,isExternal:!0,color:"teal.500",_hover:{textDecoration:"underline"},children:t})},m=e=>{let{value:t,row:r}=e;return(0,a.FD)(n.VStack,{spacing:0,align:"start",children:[(0,a.Y)(n.Badge,{fontSize:"sm",children:{free:"åºæ¬æå¡",premium:"é ç´"}[t]||t}),r.original.isRT&&(0,a.Y)(n.Text,{fontSize:"xs",color:"orange.500",children:"RT"})]})},Y=e=>{let{row:t}=e,r=(0,u.A)(),{original:l}=t;return(0,a.FD)(n.Menu,{children:[(0,a.Y)(n.MenuButton,{size:"sm",as:c.A,rightIcon:(0,a.Y)(i.bv7,{size:"1.25em"}),children:"管ç"}),(0,a.FD)(n.MenuList,{children:[(0,a.Y)(n.MenuItem,{as:n.Link,isExternal:!0,href:"/admin?id=".concat(l.slug),children:"å³ééå¾å°"}),(0,a.Y)(n.MenuItem,{as:n.Link,isExternal:!0,href:"https://console.firebase.google.com/u/0/project/".concat(null==r?void 0:r.app.options.projectId,"/firestore/data/~2Fprofiles~2F").concat(l.profileId),children:"éåè³æåº«"})]})]})},p=()=>{let e=(0,s.A)(),{data:t,error:r,isLoading:i}=(0,o.Ay)("/api/super/comments/dashboard",e,{dedupingInterval:3e5,revalidateOnFocus:!1}),c=(0,l.useMemo)(()=>[{Header:"管ç",id:"manage",Cell:Y,width:"5em",disableSortBy:!0},{Header:"åµä½è
å稱",accessor:"author",Cell:h},{Header:"çç´",accessor:"tier",Cell:m,width:"5em"},{Header:"90æ¥ç覽é",accessor:"sessions90Days",width:"6em"},{Header:"è©è«çæ¿è£¡æ¾çè©è«æ¸",accessor:"featuredCommentsCount",width:"10em"},{Header:"總å
±ç²å¾çè©è«æ¸",accessor:"totalCommentsCount",disableSortBy:!0,width:"9em"},{Header:"åå總æ¸",accessor:"productCount",width:"5em"},{Header:"åå總é·å®é",accessor:"totalSalesCount",disableSortBy:!0,width:"7em"},{accessor:"slug"}],[]);if(r)return(0,a.FD)(n.Alert,{status:"error",children:[(0,a.Y)(n.AlertIcon,{}),(0,a.FD)(n.Box,{children:[(0,a.Y)(n.Text,{fontWeight:"bold",children:"è¼å
¥å¤±æ"}),(0,a.Y)(n.Text,{fontSize:"sm",children:(null==r?void 0:r.message)||"ç¡æ³è¼å
¥è©è«çæ¿è³æ"})]})]});if(!t||i)return(0,a.Y)(n.Flex,{w:"100%",h:"200px",justifyContent:"center",alignItems:"center",children:(0,a.Y)(n.Spinner,{size:"xl",color:"teal.500"})});let{data:u=[],totalCount:p=0,warning:g}=t||{};return(0,a.Y)(n.Box,{children:(0,a.Y)(d.A,{columns:c,data:u,totalCount:p,storageKey:"comments-dashboard-v2",defaultSortBy:[{id:"featuredCommentsCount",desc:!0}],hiddenColumns:["slug"],canExport:!0,enableFilters:!1,disableGlobalFilter:!0,variant:"simple",placeholder:(0,a.Y)(n.Flex,{w:"full",justifyContent:"center",py:8,children:(0,a.Y)(n.Text,{color:"gray.500",children:"ç®åæ²æè©è«è³æ"})})})})};var g=r(84316);let f=e=>{let{value:t,row:r}=e,l=(0,g.A)(r.original.slug);return(0,a.Y)(n.Link,{href:l,color:"teal.500",isExternal:!0,children:t})},C=[{Header:"åµä½è
å稱",accessor:"author",Cell:e=>{let{value:t,row:r}=e;return(0,a.Y)(f,{value:t,row:r})}},{Header:"åå總æ¸(å
å«å·²éé)",accessor:"productCount"},{Header:"éåççè¨ç¸½æ¸",accessor:"commentActiveCount"}],y=()=>{let e=(0,s.A)(),{data:t,error:r}=(0,o.Ay)("/api/getCreatorCommentOverview",e);if(r)return(0,a.Y)(n.Flex,{children:"Failed to load"});if(!t)return(0,a.Y)(n.Flex,{w:"100%",justifyContent:"center",alignItems:"center",children:(0,a.Y)(n.Spinner,{})});let{data:l=[],totalCount:i=0}=t||{};return(0,a.Y)(d.A,{columns:C,data:l,totalCount:i,defaultSortBy:[{id:"commentActiveCount",desc:!0}]})};var v=r(42371),x=r(9784),w=r(37323),A=r(91672),b=r(33087),F=r(39911),H=r(1191),S=r(58904),k=r(46960),E=r(49177);let I=e=>e.toISOString(),_=e=>{let{date:{start:t,end:r}}=e,l=(0,s.A)(),i=I((0,E.tK)(t)),c=I((0,E.ae)(r)),{data:d,error:u}=(0,o.Ay)("/api/everyDayComment?start=".concat(i,"&end=").concat(c),l),[h]=(0,n.useToken)("colors",["ci.teal.600"]);return u?(0,a.Y)("div",{children:"Failed to load"}):d?(0,a.Y)(n.AspectRatio,{ratio:3,my:"2",children:(0,a.Y)(v.u,{children:(0,a.FD)(x.E,{width:600,height:300,data:null==d?void 0:d.data,margin:{top:5,right:30,left:2
10,bottom:5},children:[(0,a.Y)(w.d,{strokeDasharray:"3 3"}),(0,a.Y)(A.W,{dataKey:"date",tickFormatter:e=>e.slice(5)}),(0,a.Y)(b.h,{}),(0,a.Y)(F.m,{}),(0,a.Y)(H.s,{}),(0,a.Y)(S.y,{dataKey:"count",fill:h})]})})}):(0,a.Y)("div",{children:"Loading..."})},D=()=>(0,a.Y)(n.Box,{w:"100%",h:"100%",children:(0,a.Y)(k.A,{children:(0,a.Y)(_,{})})});var B=r(22061);let T=e=>{let{value:t,row:r}=e,l=(0,g.A)(r.original.slug);return(0,a.Y)(n.Link,{href:l,color:"teal.500",isExternal:!0,children:t})},L=e=>{let{value:t,row:r}=e,l=(0,g.A)(r.original.slug);return(0,a.Y)(n.Link,{href:"".concat(l,"/product/").concat(r.original.productId),textDecoration:"underline",isExternal:!0,children:t})},j=[{Header:"ååå稱(è¤è£½ ååID)",accessor:"name",Cell:e=>{let{value:t,row:r}=e;return(0,a.Y)(L,{value:t,row:r})}},{Header:"åµä½è
å稱",accessor:"author",Cell:e=>{let{value:t,row:r}=e;return(0,a.Y)(T,{value:t,row:r})}},{Header:"ææè©å總æ¸",accessor:"ratingCount"},{Header:"ææå¹³å忏",accessor:"averageRating",Cell:e=>{let{value:t}=e;return"number"==typeof t?t.toFixed(1):t}},{Header:"è©è«ç¸½æ¸",accessor:"commentCount"}],z=()=>{let e=(0,s.A)(),{data:t,error:r}=(0,o.Ay)("/api/getProductCommentOverview",e);if(r)return(0,a.Y)(n.Flex,{children:"Failed to load"});if(!t)return(0,a.Y)(n.Flex,{w:"100%",justifyContent:"center",alignItems:"center",children:(0,a.Y)(n.Spinner,{})});let{data:l,totalCount:i}=t;return(0,a.Y)(d.A,{columns:j,data:l,totalCount:i,defaultSortBy:[{id:"commentCount",desc:!0}]})};var M=r(85226);let O=()=>(0,a.Y)(B.A,{tabs:[{label:"æ¯æ¥çµ±è¨",comp:(0,a.Y)(D,{})},{label:"åå總覽",comp:(0,a.Y)(z,{}),query:"products"},{label:"åµä½è
總覽",comp:(0,a.Y)(y,{}),query:"creators"},{label:"è©è«çæ¿",comp:(0,a.Y)(p,{}),query:"dashboard"}],allTabs:M.m})}},e=>{var t=t=>e(e.s=t);e.O(0,[19883,28505,58247,67690,17057,43465,87551,69735,81544,75687,53958,92535,80971,64065,99624,13404,49785,77381,90585,47533,5244,85701,57716,59324,2524,72668,59579,95005,64190,95517,90636,46593,38792],()=>t(39910)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.