1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2213],{1410:(e,a,t)=>{Promise.resolve().then(t.bind(t,81821)),Promise.resolve().then(t.bind(t,74219)),Promise.resolve().then(t.bind(t,83987))},74219:(e,a,t)=>{"use strict";t.d(a,{default:()=>g});var r=t(95155),s=t(13125),l=t(95058),n=t(11131),c=t(20063),i=t(12115),o=t(57830),d=t(21887);let{useSession:m}=(0,n.M)(),h=e=>{var a,t;return parseFloat(String((void 0!==(null==e?void 0:e.chapterNo)?e.chapterNo:null==e||null==(t=e.name)||null==(a=t.match(/(\d+(\.\d+)?)/))?void 0:a[0])||"0"))};function g(e){let{mangaId:a,title:t,imageUrl:n,firstChapter:g,className:u}=e,x=(0,c.useRouter)(),{data:p}=m(),{start:v}=(0,d.useTopLoader)(),[b,f]=(0,i.useState)(()=>"true"===localStorage.getItem("readHistoryPaused")),{addItem:j}=(0,l.C)("watchlist",!1),N=async e=>{e.preventDefault(),v();let r=localStorage.getItem("manga:selected-language:".concat(a))||"en",s=g||"";if("en"!==r)try{let e=await fetch("/api/manga/chapters/".concat(encodeURIComponent(a),"?lang=").concat(encodeURIComponent(r)));if(e.ok){let a=await e.json();s=(e=>{var a;let t=[...e].sort((e,a)=>h(e)-h(a))[0];return(null==t||null==(a=t.url)?void 0:a.split("/").pop())||""})(Array.isArray(a)?a:[])}}catch(e){console.error("Error fetching selected manga language chapters:",e)}let l="/manga/".concat(a,"/").concat(s||g,"?lang=").concat(r);if(!p)return void x.push(l);try{let e=new Date().toISOString(),r={mediaId:a,mediaType:"manga",title:t,backdrop_path:n,chapter:s||g,_id:"",addedAt:e,watchedAt:e,createdAt:e,updatedAt:e};await j(r),x.push(l)}catch(e){console.error("Error saving manga data:",e),x.push(l)}};return(0,r.jsxs)(s.$,{variant:"default",size:"lg",className:u,onClick:N,children:[(0,r.jsx)(o.sGl,{className:"mr-2 h-5 w-5"}),"Read Now"]})}},81821:(e,a,t)=>{"use strict";t.d(a,{ChaptersSection:()=>N});var r=t(95155),s=t(25978),l=t(55599),n=t(52619),c=t.n(n),i=t(12115),o=t(85400),d=t(65541),m=t(48754),h=t(19402),g=t(95058),u=t(29978);let{useSession:x}=(0,t(11131).M)();function p(e){let{id:a,name:t,imageUrl:s,type:l}=e,{data:n}=x(),{onOpen:o}=(0,u.X)(),{addItem:d,removeItem:p,isInList:v}=(0,g.C)("watchlist",!1),[b,f]=(0,i.useState)(!1);(0,i.useEffect)(()=>{n&&f(v(a,"manga"))},[a,v,n]);let j=e=>{if(e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),!n)return void o();let r={mediaId:a,mediaType:"manga",title:t,backdrop_path:s,addedAt:new Date().toISOString(),_id:a,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};b?(p(a,"manga"),f(!1)):(d(r),f(!0))};return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(c(),{href:"".concat(a),children:(0,r.jsx)("div",{className:"relative overflow-hidden rounded-md hover:text-white",children:(0,r.jsxs)("div",{className:"relative rounded-sm",children:[(0,r.jsx)("img",{className:"object-cover",src:s||"/placeholder.png",alt:t,style:{width:"100%",height:"100%"}}),(0,r.jsxs)("div",{className:"absolute left-0 top-0 flex h-full w-full flex-col items-center justify-center rounded-sm bg-gray-900 bg-opacity-60 opacity-0 transition-opacity hover:opacity-100 hover:backdrop-blur-[2px]",children:[(0,r.jsx)("img",{src:"/icon-play.png",alt:"play",width:25,height:25}),(0,r.jsxs)("div",{className:"absolute bottom-2 px-1 text-center text-sm font-semibold leading-snug sm:text-base",children:[(0,r.jsx)("h3",{className:"mb-2 line-clamp-2 text-xs font-semibold",children:t}),(0,r.jsx)("p",{className:"-mt-2 text-[10px] text-gray-400",children:l})]})]}),(0,r.jsx)("div",{className:"absolute top-2 left-0 rounded-r bg-yellow-500 px-0.5 text-xs font-semibold text-white",children:l})]})})}),(0,r.jsx)("button",{onClick:j,onMouseDown:j,className:"absolute top-2 right-0.5 z-20 flex items-center justify-center w-8 h-8 rounded-lg transition-all duration-200 backdrop-blur-sm border border-white/20 hover:scale-110 active:scale-95 ".concat(b?"bg-blue-500/80 text-white shadow-lg shadow-blue-500/25":"bg-black/50 text-white/70 hover:bg-blue-500/50 hover:text-white"),"aria-label":b?"Remove from watchlist":"Add to watchlist",children:b?(0,r.jsx)(m.A,{className:"h-5 w-5"}):(0,r.jsx)(h.A,{className:"h-5 w-5"})})]})}function v(){return(0,r.jsx)("div",{className:"flex justify-center items-center h-40",children:(0,r.jsxs)("svg",{className:"animate-spin h-8 w-8 text-gray-500",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})})}let b=e=>fetch(e).then(e=>e.json()),f={en:"US",fr:"FR",es:"ES","es-la":"MX",pt:"PT","pt-br":"BR",ja:"JP",ru:"RU",de:"DE",it:"IT",zh:"CN",ko:"KR",th:"TH",ar:"SA",tr:"TR"},j=e=>{let{langCode:a}=e,t=f[a];return(0,r.jsx)("img",{src:"https://flagsapi.com/".concat(t,"/flat/24.png"),alt:"".concat(a," flag"),className:"w-6 h-4 object-cover rounded",loading:"lazy"})};function N(e){let{chapters:a,mangaId:t,languages:n,recommendations:m}=e,[h,g]=(0,i.useState)(!0),[u,x]=(0,i.useState)(""),f="manga:selected-language:".concat(t),[N,y]=(0,i.useState)(()=>localStorage.getItem(f)||"en"),{data:w,isLoading:k}
1=(0,o.Ay)("en"!==N?"/api/manga/chapters/".concat(t,"?lang=").concat(N):null,b),S=(0,i.useMemo)(()=>("en"===N?a:w||[]).map(e=>({...e,language:N})),[a,w,N]),C=(0,i.useMemo)(()=>{let e=S;return e=e.filter(e=>e.language===N),u&&""!==u.trim()&&(e=e.filter(e=>{var a,t;return(void 0!==e.chapterNo?String(e.chapterNo):null!=(t=null==(a=e.name.match(/(\d+(\.\d+)?)/))?void 0:a[0])?t:"").includes(u)})),h?e:[...e].reverse()},[S,h,u,N]);return(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsxs)("div",{className:"rounded-xl bg-white/80 dark:bg-black/60 p-4 shadow-lg border dark:border-gray-800",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4 mb-4",children:[(0,r.jsx)("div",{className:"flex items-center gap-2",children:n.length>0&&(0,r.jsxs)(d.l6,{value:N,onValueChange:e=>{y(e),localStorage.setItem(f,e)},children:[(0,r.jsx)(d.bq,{className:"w-44 bg-[#f3f4f6] dark:bg-[#2a2a30] border-0",children:(0,r.jsx)(d.yv,{})}),(0,r.jsx)(d.gC,{className:"bg-[#f3f4f6] dark:bg-[#2a2a30] border-0",children:n.map(e=>(0,r.jsx)(d.eb,{value:e.code,className:"flex items-center gap-2",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(j,{langCode:e.code}),(0,r.jsxs)("span",{children:[e.title," (",e.count,")"]})]})},e.code))})]})}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{placeholder:"Chapter no.",value:u,onChange:e=>x(e.target.value),className:"w-32 rounded-md border bg-background px-2 py-[5px] text-sm",min:"1"}),(0,r.jsx)("button",{onClick:()=>g(e=>!e),className:"rounded-md px-2 py-1 text-xs font-medium",title:h?"Descending":"Ascending",type:"button",children:h?(0,r.jsx)(s.A,{className:"cursor-pointer"}):(0,r.jsx)(l.A,{className:"cursor-pointer"})})]})]}),(0,r.jsx)("div",{className:"max-h-[500px] overflow-y-auto divide-y dark:divide-gray-800",children:"en"!==N&&k?(0,r.jsx)(v,{}):0===C.length?(0,r.jsx)("div",{className:"flex flex-col items-center justify-center h-40",children:""!==u.trim()?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-lg text-gray-500 dark:text-gray-400",children:['No chapters found matching number "',u,'"']}),(0,r.jsx)("button",{onClick:()=>x(""),className:"mt-4 text-sm text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-300",type:"button",children:"Clear search"})]}):(0,r.jsx)("p",{className:"text-lg text-gray-500 dark:text-gray-400",children:"No chapters found for this language."})}):C.map(e=>(0,r.jsx)(c(),{href:"/manga/".concat(t,"/").concat(e.url.split("/").pop(),"?lang=").concat(e.language),children:(0,r.jsx)("div",{className:"mb-2 flex h-12 w-full md:w-[99%] cursor-pointer gap-2 overflow-hidden rounded-md transition-colors bg-gray-100 hover:bg-gray-200 dark:bg-[#2a2a30] dark:hover:bg-gray-700",children:(0,r.jsxs)("div",{className:"flex flex-col justify-center px-4",children:[(0,r.jsx)("span",{className:"font-medium",children:e.name}),e.dateUpload&&(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(Number(e.dateUpload)).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit"})})]})})},e.url))})]}),m.length>0&&(0,r.jsxs)("div",{className:"mt-8",children:[(0,r.jsx)("h2",{className:"text-xl font-bold mb-4",children:"You May Also Like"}),(0,r.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4",children:m.map(e=>{var a;return(0,r.jsx)(p,{id:e.id,name:e.name,imageUrl:e.imageUrl.includes("@100")?null==(a=e.imageUrl)?void 0:a.replace("@100","@1000"):e.imageUrl,type:e.type},e.id)})})]})]})}}},e=>{e.O(0,[7405,2076,8096,7358],()=>e(e.s=1410)),_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.