1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="50ed0463-6497-72af-6eca-443f86ba0747")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,844546,103577,e=>{"use strict";function t(e,s=""){return`/blogs/${e?.slug||e?.id||""}${s}`}e.s(["blogPath",()=>t],844546);let{useGetBlogsQuery:s,useGetBlogBySlugQuery:a,useGetRelatedBlogsQuery:l,useCreateBlogMutation:i,useUpdateBlogMutation:n,useDeleteBlogMutation:o}=e.i(19687).baseApiSlice.injectEndpoints({endpoints:e=>({getBlogs:e.query({query:e=>{let{page:t=1,pageSize:s=12,tag:a,status:l="published"}=e??{},i=new URLSearchParams;return i.append("page",String(t)),i.append("pageSize",String(s)),i.append("status",l),a&&i.append("tag",a),`/api/blog?${i.toString()}`},transformResponse:e=>e.data,providesTags:e=>e?.items?[...e.items.map(({id:e})=>({type:"Blog",id:e})),"BlogList"]:["BlogList"]}),getBlogBySlug:e.query({query:e=>`/api/blog/${e}`,transformResponse:e=>e.data,providesTags:(e,t,s)=>[{type:"Blog",id:e?.id||s}]}),getRelatedBlogs:e.query({query:({id:e,count:t=3})=>`/api/blog/related/${e}?count=${t}`,transformResponse:e=>e.data,providesTags:["BlogList"]}),createBlog:e.mutation({query:e=>({url:"/api/blog",method:"POST",body:e}),invalidatesTags:["BlogList"]}),updateBlog:e.mutation({query:({id:e,body:t})=>({url:`/api/blog/${e}`,method:"PUT",body:t}),invalidatesTags:(e,t,{id:s})=>[{type:"Blog",id:s},"BlogList"]}),deleteBlog:e.mutation({query:e=>({url:`/api/blog/${e}`,method:"DELETE"}),invalidatesTags:(e,t,s)=>[{type:"Blog",id:s},"BlogList"]})})});e.s(["useCreateBlogMutation",0,i,"useDeleteBlogMutation",0,o,"useGetBlogBySlugQuery",0,a,"useGetBlogsQuery",0,s,"useGetRelatedBlogsQuery",0,l,"useUpdateBlogMutation",0,n],103577)},432184,e=>{"use strict";var t=e.i(925477),s=e.i(506816),a=e.i(23437),l=e.i(538982);e.i(857800);var i=e.i(10454),n=e.i(114324),o=e.i(255818),r=e.i(759195),c=e.i(844546),d=e.i(464490);let g=({blog:e,canManage:s=!1})=>{let{t:g}=(0,i.useTranslation)(),m=(0,c.blogPath)(e),u=e.coverImageUrl||e.titleImageUrl,b=e.userProfile?.displayName||e.userProfile?.name,p=e.publishedAt||e.createdAt,x=e.excerpt||(0,d.extractPlainText)(e.content||"").substring(0,160);return(0,t.jsxs)("div",{className:"group relative flex flex-col bg-base-100 rounded-2xl border border-base-content/15 shadow-sm hover:shadow-md transition-shadow duration-300 overflow-hidden h-full",children:[s&&(0,t.jsxs)(a.default,{href:(0,c.blogPath)(e,"/edit"),"aria-label":g("blog.editTitle"),className:"absolute top-2 right-2 z-10 flex items-center gap-1 rounded-full bg-base-100/90 border border-base-content/15 px-2.5 py-1 text-xs font-semibold text-base-content shadow-sm hover:bg-base-200 transition-colors",children:[(0,t.jsx)(l.Icon,{icon:"mdi:pencil-outline",className:"w-3.5 h-3.5"}),g("blog.editTitle")]}),"draft"===e.status&&(0,t.jsx)("span",{className:"absolute top-2 left-2 z-10 rounded-full bg-warning/90 px-2.5 py-0.5 text-[11px] font-bold text-warning-content shadow-sm",children:g("blog.draftBadge")}),u&&(0,t.jsx)(a.default,{href:m,className:"relative block aspect-[1200/630] bg-base-200",children:(0,t.jsx)(n.default,{mediaUrl:u,altText:e.title,disableDynamicHeight:!0,fillParent:!0})}),(0,t.jsxs)("div",{className:"flex flex-col flex-1 p-5",children:[e.tags?.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2",children:e.tags.slice(0,2).map(e=>(0,t.jsxs)(a.default,{href:`/blogs/tag/${encodeURIComponent(e)}`,className:"rounded-full bg-base-200 px-2.5 py-0.5 text-[11px] font-semibold text-base-content/70 hover:bg-base-300 transition-colors",children:["#",e]},e))}),(0,t.jsx)(a.default,{href:m,className:"block",children:(0,t.jsx)("h3",{className:"text-lg font-bold text-base-content leading-snug line-clamp-2 group-hover:text-primary transition-colors",children:e.title})}),(0,t.jsx)("p",{className:"mt-2 text-sm text-base-content/70 line-clamp-3",children:x}),(0,t.jsxs)("div",{className:"flex items-center justify-between mt-4 pt-3 border-t border-base-content/10 text-xs text-base-content/60",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,t.jsx)(r.default,{mediaUrl:e.userProfile?.profileMediaUrl,name:b})}),(0,t.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[p&&(0,t.jsx)("span",{className:"tabular-nums",children:(0,o.convertDate)(p.toString())}),e.readingTimeMins>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(l.Icon,{icon:"mdi:clock-outline",className:"w-3.5 h-3.5"}),g("blog.minRead",{mins:e.readingTimeMins})]})]})]})]})]})};e.i(721434);var m=e.i(799848),u=e.i(278877),b=e.i(103577);let p=[{i18nKey:"blog.catAcademy",tag:"academy",icon:"mdi:school-outline"},{i18nKey:"blog.catTournament",tag:"tournament",icon:"mdi:trophy-outline"},{i18nKey:"blog.catAuction",tag:"auction",icon:"mdi:gavel"},{i18nKey:"blog.typeGuide",tag:"guide"},{i18nKey:"blog.typeStepByStep",tag:"step-by-step"},{i18nKey:"blog.typeComparison",tag:"comparison"},{i18nKey:"blog.typeStrategy",tag:"strategy"},{i18nKey:"blog.typeTips",tag:"tips"},{i18nKey:"blog.typeDigitalTools",tag:"digital-tools"},{i18nKey:"blog.langHindi",tag:"hindi",icon:"mdi:translate"}];function x({initialBlogs:e=[],lockedTag:n}){let{t:o}=(0,i.useTranslation)(),{profileData:r}
2=(0,u.useAuth)(),c=!!r?.isSuperAdmin,[d,x]=(0,s.useState)(n),[h,f]=(0,s.useState)(""),[y,j]=(0,s.useState)(1),[v,N]=(0,s.useState)(e),{data:B,isFetching:w}=(0,b.useGetBlogsQuery)({page:y,pageSize:12,tag:d,status:"published"});(0,s.useEffect)(()=>{B?.items&&N(e=>{if(1===y)return B.items;let t=new Set(e.map(e=>e.id));return[...e,...B.items.filter(e=>!t.has(e.id))]})},[B,y]);let T=(0,s.useMemo)(()=>{let e=new Set;return v.forEach(t=>{t.tags?.forEach(t=>e.add(t)),t.category&&e.add(t.category)}),e},[v]),S=B?.total??v.length,P=v.length<S,k=e=>{x(e),j(1)},C=(0,s.useMemo)(()=>{if(!h.trim())return v;let e=h.toLowerCase();return v.filter(t=>t.title?.toLowerCase().includes(e)||t.excerpt?.toLowerCase().includes(e)||t.tags?.some(t=>t.toLowerCase().includes(e)))},[v,h]);return(0,t.jsx)("div",{className:"min-h-screen bg-base-100",children:(0,t.jsxs)("section",{className:"container mx-auto px-4 sm:px-6 lg:px-8 py-6",children:[(0,t.jsxs)("header",{className:"mb-6 flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"text-2xl sm:text-3xl font-bold text-base-content",children:n?o("blog.taggedTitle",{tag:n}):o("blog.listTitle")}),(0,t.jsx)("p",{className:"mt-1 text-base-content/60",children:o("blog.listSubtitle")})]}),c&&!n&&(0,t.jsx)(a.default,{href:"/blogs/create",className:"shrink-0",children:(0,t.jsx)(m.Button,{variant:"primary",leftIcon:"mdi:plus",children:o("blog.addBlog")})})]}),(0,t.jsxs)("div",{className:"relative mb-5 max-w-md",children:[(0,t.jsx)(l.Icon,{icon:"mdi:magnify",className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-5 h-5 text-base-content/40 pointer-events-none"}),(0,t.jsx)("input",{type:"text",value:h,onChange:e=>f(e.target.value),placeholder:o("blog.searchPlaceholder"),className:"w-full rounded-full bg-base-200 border-none pl-11 pr-4 py-2.5 text-sm text-base-content placeholder:text-base-content/40 focus:outline-none focus:ring-2 focus:ring-primary/30"})]}),!n&&T.size>0&&(0,t.jsxs)("div",{className:"flex gap-2 mb-6 overflow-x-auto pb-2 scrollbar-none sm:flex-wrap sm:overflow-visible sm:pb-0",children:[(0,t.jsx)("button",{type:"button",onClick:()=>k(void 0),className:`shrink-0 rounded-full px-4 py-2 text-sm font-semibold transition-colors ${!d?"bg-primary text-primary-content":"bg-base-200 text-base-content/70 hover:bg-base-200/80"}`,children:o("blog.allTag")}),p.filter(e=>T.has(e.tag)).map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>k(e.tag),className:`shrink-0 inline-flex items-center gap-1.5 rounded-full px-4 py-2 text-sm font-semibold transition-colors ${d===e.tag?"bg-primary text-primary-content":"bg-base-200 text-base-content/70 hover:bg-base-200/80"}`,children:["icon"in e&&(0,t.jsx)(l.Icon,{icon:e.icon,className:"w-4 h-4"}),o(e.i18nKey)]},e.tag))]}),C.length>0?(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:C.map(e=>(0,t.jsx)(g,{blog:e,canManage:c},e.id))}):!w&&(0,t.jsxs)("div",{className:"text-center py-16",children:[(0,t.jsx)(l.Icon,{icon:h?"mdi:magnify":"mdi:notebook-outline",className:"w-12 h-12 mx-auto text-base-content/30"}),(0,t.jsx)("h2",{className:"mt-4 text-lg font-semibold text-base-content",children:h?o("blog.noSearchResults"):o("blog.emptyTitle")}),(0,t.jsx)("p",{className:"mt-1 text-base-content/60",children:h?o("blog.noSearchResultsHint"):o("blog.emptySubtitle")}),n&&!h&&(0,t.jsx)(a.default,{href:"/blogs",className:"mt-4 inline-block text-primary font-medium hover:underline",children:o("blog.backToBlogs")})]}),P&&(0,t.jsx)("div",{className:"flex justify-center mt-8",children:(0,t.jsx)(m.Button,{variant:"outline",isLoading:w,onClick:()=>j(e=>e+1),children:o("blog.loadMore")})})]})})}e.s(["default",()=>x],432184)}]); 3 4//# debugId=50ed0463-6497-72af-6eca-443f86ba0747 5//# sourceMappingURL=29dc9b430c9b2491.js.map
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.