PageSourceSearch

https://storyweaver.org.in/assets/ListQuickViewModal.D2jza-xL.js

js storyweaver.org.in collected 2026-09-24 08:42:42 UTC 5,162 bytes, 2 lines download raw bytes

1import{r as e,j as o}from"./react-vendor.B75MsAI9.js";import{u as i,t as l,s,p as a,b0 as n,o as t,a as r,L as d,O as c,ce as f,cf as m,cg as g,i as u,M as p,S as h,ch as w,w as v,J as b}from"./AuthModalContainer.CwDh3qj_.js";import{N as k,D as j,S as _,a as x,A as y,O as C,h as L}from"./main.Bj0Ml4GZ.js";import{D as N}from"./DownloadModal.BFBMfZoF.js";import"./RTLProvider.Dbr8G8Qw.js";import"./LazyFontLoader.pvie9HdJ.js";const O=({viewport:O,list:R,onCloseClicked:S,offlineBooks:M,unsaveOfflineWorkflow:I,isAvailableOffline:$,isLoggedIn:A,openAuthModal:F,addSlimNotification:T,windowDimensions:B,profile:D,isRtl:E,saveOfflineWorkflow:W,addNotificationModal:z,removeNotificationModal:P,addGatingForm:V})=>{const G=i(),U=l();s();const q=a(e=>e.user.profile.email),H=a(e=>e.user.profile.id),J=a(e=>e.user.profile.profile_type),[K,Q]=e.useState({noSpaceForMoreOfflineBooks:!1,delete:!1,download:!1}),[X,Y]=e.useState(!1),Z="pb-list-quick-view-modal",ee=e=>{Q(o=>({...o,[e]:!0}))},oe=e=>{Q(o=>({...o,[e]:!1}))},ie=R.books.filter(e=>H&&!$(e.id,M,"read",H)),le=D.roles&&D.roles.includes(n.CONTENT_MANAGER),se=o.jsx("div",{className:`${Z}__footer`,children:o.jsx("div",{className:`${Z}__view-list-btn`,children:o.jsx(t,{variant:"primary",label:G("global.view-list"),onClick:()=>{S(),window.location.href=c.list(R.slug),window.dataLayer.push({event:r.clickedViewList,category:r.allListsHome,label:"modal",item_type:null,item_id:null,item_value:null,user_id:H,user_profile:D.profile_type})},fullWidth:!0,long:!0})})}),ae=R.books.every(e=>H&&$(e.id,M,"read",H)),ne=o.jsxs("div",{className:`${Z}__publisher`,children:[o.jsxs("div",{children:[G("ReadingList.list-created-by"),": "]}),o.jsx(d,{href:c.profile(f[R.organisation.type],R.organisation.slug,m.lists),isInternal:!0,onClick:()=>S(),children:o.jsx("img",{className:`${Z}__publisher-logo`,src:R.organisation.profileImage,alt:`${G("global.logo-of")} ${R.organisation.name}`})})]});return K.noSpaceForMoreOfflineBooks?o.jsx(k,{viewport:O,onClose:()=>{oe("noSpaceForMoreOfflineBooks"),S()},maximum:g,isRtl:E}):K.delete?o.jsx(j,{onConfirm:()=>{const e=R.books.map(e=>I(e,w(B.width),H));Promise.all(e).then(()=>{T({type:"info",content:G("ReadingList.removed-from-offline-library-notification")}),localStorage.setItem("sw-offline-activity","offline"+Math.random())})},onClose:()=>{oe("delete"),S()},viewport:O,count:R.books.length,books:R.books,userEmail:q,userId:H,baseClassName:Z,addSlimNotification:T,isRtl:u(localStorage.getItem("locale"))}):o.jsxs(p,{onClose:S,isRtl:E,children:[o.jsx("h2",{className:`${Z}__title`,children:R.title}),ne,o.jsxs("div",{className:`${Z}__stat-wrapper`,children:[o.jsxs(d,{href:c.list(R.slug),onClick:()=>S(),isInternal:!0,children:[R.count," ",G("global.story",R.count)]}),o.jsxs("div",{className:`${Z}__stats`,children:[R.likes?o.jsx(_,{iconVariant:"accent",icon:"heart",value:R.likes}):null,R.views?o.jsx(_,{icon:"book",value:R.views}):null]}),o.jsxs("div",{className:`${Z}__actions`,children:[o.jsx(x,{title:R.title,viewport:O,showIconOnly:!0,align:"right",href:window.location.origin+c.list(R.slug),onClick:e=>{window.dataLayer.push({label:`share_${R.slug}`,category:v.list,event:`clicked_${e.slice(5).toLowerCase()}`,item_type:null,item_id:null,item_value:null,user_profile:J,user_id:H||"00000"})}}),le?A?o.jsx(d,{onClick:()=>(R.slug,void(A&&U(b()).then(e=>{var o;(null==(o=e.data)?void 0:o.downloadLimitReached)?ee("download"):(T({id:G("ReadingList.attribution-download-title"),content:G("ReadingList.attribution-download-content")}),window.open(c.downloadList(R.slug)),S())}))),children:o.jsx(h,{name:"download",title:G("SvgTitle.download"),size:"m",pushRight:!0})}):o.jsx(y,{t:G,baseClassName:Z,openAuthModal:F,toggleEl:o.jsx(d,{children:o.jsx(h,{name:"download",title:G("SvgTitle.download"),size:"m",pushRight:!0})}),loginText:G("DownloadsDropdown.please-log-in")}):null,o.jsx(C,{showIconOnly:!0,availableOffline:ae,align:"right",onClickAddToOffline:()=>{const e=ie.filter(e=>!$(e.id,M,"read")).length,o=M.translations.filter(e=>e.userId===H).length,i=M.books.filter(e=>!e.isFromOfflineTranslate&&e.savedUsers&&e.savedUsers.includes(H)).length;return L(o+i,ie.length,M.books.length,e)<=g?(()=>
1{if(!A)return z({title:G("global.log-in"),content:G("BookCard.please-log-in-notification-offline-library-text"),additionalActions:[{label:G("global.log-in"),primary:!0,onClick:()=>{P(),F()}},{label:G("global.sign-up"),onClick:()=>{P(),F()}}]}),void S();Y(!0);const e=R.books.filter(e=>H&&!$(e.id,M,"read",H)).map(e=>W(e,w(B.width),H));Promise.all(e).then(()=>{T({type:"info",content:G("ReadingList.added-to-offline-library-notification")}),Y(!1),localStorage.setItem("sw-offline-activity","offline"+Math.random())})})():ee("noSpaceForMoreOfflineBooks")},onClickRemoveFromOffline:()=>ee("delete"),disabled:!("serviceWorker"in navigator),isLoggedIn:A,isSavingOffline:X,t:G,isRtl:E,openAuthModal:F})]})]}),o.jsx(N,{isVisible:K.download,onCloseClicked:()=>oe("download"),onFormLinkClicked:()=>{V(),S(),oe("download")},userEmail:q}),R.description?o.jsx("p",{children:R.description}):null,se]})};O.propTypes={};export{O as default};
2//# sourceMappingURL=ListQuickViewModal.D2jza-xL.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.