1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},i=(new e.Error).stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="ae47a4d2-8216-47fc-af3c-44c5cf122dc6",e._sentryDebugIdIdentifier="sentry-dbid-ae47a4d2-8216-47fc-af3c-44c5cf122dc6")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8913],{47055:(e,i,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/editions",function(){return t(22395)}])},15021:(e,i,t)=>{"use strict";t.d(i,{A:()=>h});var n=t(74848),o=t(34544),d=t(42413),s=t(21532);let r=(0,s.Ay)(o.A).withConfig({componentId:"sc-e3885fee-0"})(["padding:1rem;margin-bottom:1rem;cursor:pointer;transition:all 0.2s ease-in-out;display:flex;align-items:center;gap:1rem;&:hover{transform:translateY(-2px);box-shadow:0 4px 8px rgba(0,0,0,0.1);}"]),a=s.Ay.div.withConfig({componentId:"sc-e3885fee-1"})(["width:80px;height:80px;flex-shrink:0;border-radius:4px;overflow:hidden;background-color:#f5f5f5;"]),c=s.Ay.img.withConfig({componentId:"sc-e3885fee-2"})(["width:100%;height:100%;object-fit:cover;"]),l=s.Ay.div.withConfig({componentId:"sc-e3885fee-3"})(["flex:1;min-width:0;"]);function h(e){let{edition:i,onClick:t}=e;return console.log(i),(0,n.jsxs)(r,{onClick:()=>t(i),elevation:1,children:[(0,n.jsx)(a,{children:i.headerImage?(0,n.jsx)(c,{src:i.headerImage.imageURL,alt:i.topic}):(0,n.jsx)("div",{style:{width:"100%",height:"100%",backgroundColor:"#f5f5f5"}})}),(0,n.jsxs)(l,{children:[(0,n.jsx)(d.A,{variant:"h6",gutterBottom:!0,children:i.topic}),(0,n.jsx)(d.A,{variant:"body2",color:"textSecondary",children:new Date(i.createdAt.toMillis()).toLocaleDateString()})]})]})}},22395:(e,i,t)=>{"use strict";t.r(i),t.d(i,{default:()=>A});var n=t(74848),o=t(96540),d=t(86715),s=t(83327),r=t(448),a=t(71884),c=t(21532),l=t(70841),h=t(67330),f=t(42413),g=t(41917),u=t(3058),x=t(15021);let m=c.Ay.div.withConfig({componentId:"sc-4a319078-0"}
1)(["height:100vh;display:flex;flex-direction:column;background-color:#f5f5f5;width:100%;overflow-x:hidden;position:relative;"]),p=c.Ay.div.withConfig({componentId:"sc-4a319078-1"})(["flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;width:100%;height:0;"]),w=c.Ay.div.withConfig({componentId:"sc-4a319078-2"})(["padding:0.5rem;max-width:1200px;margin:0 auto;width:100%;box-sizing:border-box;@media (min-width:768px){padding:1rem;}"]),y=c.Ay.div.withConfig({componentId:"sc-4a319078-3"})(["display:flex;justify-content:space-between;align-items:center;margin-bottom:2rem;"]),b=c.Ay.div.withConfig({componentId:"sc-4a319078-4"})(["display:flex;justify-content:center;align-items:center;padding:2rem;"]);function A(){let e=(0,d.useRouter)(),{user:i}=(0,r.A)(),[t,c]=(0,o.useState)([]),[A,j]=(0,o.useState)(!0),[v,C]=(0,o.useState)(!0),[I,k]=(0,o.useState)(!1),[_,E]=(0,o.useState)(null),D=(0,o.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{let i;k(e);let t=(0,a.rJ)(s.db,"editions");i=_&&e?(0,a.P)(t,(0,a.My)("editionDate","desc"),(0,a.HM)(_),(0,a.AB)(20)):(0,a.P)(t,(0,a.My)("editionDate","desc"),(0,a.AB)(20));let n=await (0,a.GG)(i);if(n.empty){e||c([]),C(!1),j(!1);return}E(n.docs[n.docs.length-1]);let o=n.docs.map(e=>({id:e.id,...e.data()}));c(i=>e?[...i,...o]:o),C(20===n.docs.length),j(!1),k(!1)}catch(e){console.error("Error fetching editions:",e),j(!1),k(!1)}},[]),M=(0,o.useCallback)(async()=>{try{k(!0);let e=(0,a.rJ)(s.db,"editions"),i=(0,a.P)(e,(0,a.My)("editionDate","desc"),(0,a.HM)(_),(0,a.AB)(20)),t=await (0,a.GG)(i);if(t.empty){C(!1),k(!1);return}E(t.docs[t.docs.length-1]);let n=t.docs.map(e=>({id:e.id,...e.data()}));c(e=>[...e,...n]),C(20===t.docs.length),k(!1)}catch(e){console.error("Error loading more editions:",e),k(!1)}},[_]);(0,o.useEffect)(()=>{if(i){if(!i.isAdmin){e.push("/");return}D()}else A||e.push("/login")},[i,e,A]);let N=i=>{e.push(`/admin/edition/${i.id}`)};return A?(0,n.jsxs)(m,{children:[(0,n.jsx)(l.A,{user:i}),(0,n.jsx)(p,{children:(0,n.jsx)(b,{children:(0,n.jsx)(h.A,{})})})]}):(0,n.jsxs)(m,{children:[(0,n.jsx)(l.A,{user:i}),(0,n.jsx)(p,{children:(0,n.jsxs)(w,{children:[(0,n.jsxs)(y,{children:[(0,n.jsx)(f.A,{variant:"h4",children:"All Editions"}),(0,n.jsx)(g.A,{variant:"contained",color:"primary",onClick:()=>e.push("/admin/editions/new"),children:"New Edition"})]}),0===t.length?(0,n.jsx)(u.A,{sx:{textAlign:"center",mt:4},children:(0,n.jsx)(f.A,{variant:"h6",children:"No editions found"})}):(0,n.jsxs)(n.Fragment,{children:[t.map(e=>(0,n.jsx)(x.A,{edition:e,onClick:N},e.id)),v&&(0,n.jsx)(u.A,{sx:{display:"flex",justifyContent:"center",mt:4,mb:2},children:(0,n.jsx)(g.A,{variant:"outlined",onClick:()=>{v&&!I&&M()},disabled:I,startIcon:I&&(0,n.jsx)(h.A,{size:20}),children:I?"Loading...":"Load More Editions"})})]})]})})]})}}},e=>{var i=i=>e(e.s=i);e.O(0,[5850,3498,9965,4250,841,636,6593,8792],()=>i(47055)),_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.