1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2cc702a8-377c-41ff-8410-f7371a12e082",e._sentryDebugIdIdentifier="sentry-dbid-2cc702a8-377c-41ff-8410-f7371a12e082")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1169],{29175:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dev/tools/soul-plan-reports",function(){return s(6680)}])},6680:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return ReviewQueue}});var r=s(85893),n=s(67294),l=s(9008),a=s.n(l),o=s(41664),i=s.n(o),d=s(33299),c=s(52913),u=s(57292);let x={queued:"Queued",generating:"Generating",review:"Ready for review",ready:"Published",failed:"Needs attention",refunded:"Refunded"};function ReviewQueue(){var e,t;let{data:s,status:l}=(0,d.useSession)(),[o,m]=(0,n.useState)(null),[f,p]=(0,n.useState)(""),[h,b]=(0,n.useState)(1),[v,g]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{var e;if(!(null==s?void 0:null===(e=s.user)||void 0===e?void 0:e.isAdmin))return;let t=new AbortController;return p(""),fetch("/api/soul-plan/review?page=".concat(h).concat(v?"&status=review":""),{signal:t.signal}).then(async e=>{if(!e.ok)throw Error("Could not load the review queue.");m(await e.json())}).catch(e=>{"AbortError"!==e.name&&p(e.message)}),()=>t.abort()},[null==s?void 0:null===(e=s.user)||void 0===e?void 0:e.isAdmin,h,v]),"loading"===l)?(0,r.jsx)("main",{className:"min-h-screen bg-stone-950 p-8 text-stone-300",children:"Loading review queue..."}):(null==s?void 0:null===(t=s.user)||void 0===t?void 0:t.isAdmin)?(0,r.jsxs)("main",{className:"min-h-screen bg-stone-950 px-5 py-10 text-stone-200 sm:px-8",children:[(0,r.jsxs)(a(),{children:[(0,r.jsx)("title",{children:"Soul Plan Review Queue | Selfgazer"}),(0,r.jsx)("meta",{name:"robots",content:"noindex,nofollow"})]}),(0,r.jsxs)("div",{className:"mx-auto max-w-5xl",children:[(0,r.jsxs)(i(),{href:"/dev",className:"inline-flex items-center gap-2 text-sm text-stone-400 hover:text-amber-200",children:[(0,r.jsx)(c.Z,{"aria-hidden":"true",className:"h-4 w-4"})," Developer tools"]}),(0,r.jsxs)("div",{className:"mt-10 flex flex-wrap items-end justify-between gap-5",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-amber-300",children:"Soul Plan fulfillment"}),(0,r.jsx)("h1",{className:"mt-3 font-lora text-3xl text-amber-100 sm:text-4xl",children:"Report review"}),(0,r.jsx)("p",{className:"mt-3 max-w-xl text-sm leading-6 text-stone-400",children:"Review the complete reading and its evidence before publishing it to the reader and PDF."})]}),(0,r.jsx)(i(),{href:"/dev/tools/soul-plan-fulfillment",className:"text-sm text-stone-400 underline-offset-4 hover:text-amber-200 hover:underline",children:"Original Soul Plan fulfillment"})]}),(0,r.jsxs)("div",{className:"mt-10 flex gap-2 border-b border-stone-700 pb-4 text-sm",children:[(0,r.jsx)("button",{type:"button",onClick:()=>{g(!1),b(1)},className:"rounded-full px-4 py-2 ".concat(v?"border border-stone-700 text-stone-300":"bg-amber-300 text-stone-900"),children:"All reports"}),(0,r.jsx)("button",{type:"button",onClick:()=>{g(!0),b(1)},className:"rounded-full px-4 py-2 ".concat(v?"bg-amber-300 text-stone-900":"border border-stone-700 text-stone-300"),children:"Ready for review"})]}),f&&(0,r.jsx)("p",{role:"alert",className:"mt-6 rounded-xl border border-red-800 p-4 text-red-200",children:f}),!o&&!f&&(0,r.jsx)("p",{role:"status",className:"mt-8 text-stone-400",children:"Loading reports..."}),(null==o?void 0:o.reports.length)===0&&(0,r.jsx)("p",{className:"mt-8 rounded-2xl border border-stone-700 p-8 text-center text-stone-400",children:v?"No reports are waiting for review.":"There are no paid reports yet."}),(0,r.jsx)("div",{className:"mt-6 space-y-3",children:null==o?void 0:o.reports.map(e=>(0,r.jsxs)("article",{className:"rounded-2xl border border-stone-700 bg-stone-900 p-5 sm:p-6",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-amber-200",children:x[e.status]||e.status}),e.cycleLabel&&(0,r.jsx)("p",{className:"text-sm text-stone-400",children:e.cycleLabel})]}),(0,r.jsx)("h2",{className:"mt-3 font-lora text-xl text-amber-100",children:e.title}),(0,r.jsx)("p",{className:"mt-1 text-sm text-stone-300",children:e.subject}),e.stage&&(0,r.jsxs)("p",{className:"mt-3 text-xs text-stone-500",children:["Stage: ",e.stage]}),e.error&&(0,r.jsx)("p",{role:"alert",className:"mt-3 text-sm text-red-300",children:e.error}),(0,r.jsxs)("div",{className:"mt-5 flex flex-wrap gap-5 border-t border-stone-700 pt-4 text-sm",children:[(0,r.jsxs)(i(),{className:"inline-flex items-center gap-2 font-medium text-amber-200 hover:text-amber-100",href:e.reviewUrl,children:["Review report ",(0,r.jsx)(u.Z,{"aria-hidden":"true",className:"h-4 w-4"})]}),e.orderId&&(0,r.jsx)(i(),{className:"text-stone-400 hover:text-stone-200",href:"/soul-plan/orders/".concat(e.orderId),children:"View order"})]})]},e.reportId))}),(null==o?void 0:o.pages)>1&&(0,r.jsxs)("nav",{"aria-label":"Review pages",className:"mt-8 flex items-center justify-center gap-6 text-sm",children:[(0,r.jsx)("button",{disabled:h<=1,onClick:()=>b(h-1),className:"disabled:opacity-40",children:"Previous"}),(0,r.jsxs)("span",{children:[h," / ",o.pages]}),(0,r.jsx)("button",{disabled:h>=o.pages,onClick:()=>b(h+1),className:"disabled:opacity-40",children:"Next"})]})]})]}):(0,r.jsx)("main",{className:"min-h-screen bg-stone-950 p-8 text-stone-300",children:"Staff access required."})}},52913:function(e,t,s){"use strict";var r=s(67294);let n=r.forwardRef(function({title:e,titleId:t,...s},n){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},s),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))});t.Z=n}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=29175)}),_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.