1import{o as k,c as r,j as y,_ as h,d as i,f as s,k as n,t as p,e as _,w as v,g as C,L as w,l as b,A as m,r as u}from"./main-w-Krg8vg.js";import{s as R}from"./ACLToast-dVktgNUV.js";import"./info-BXRFBhMf.js";import"./alertCircle-B2KOPOcx.js";import"./alert-vWQ7ET8u.js";const x={key:1,class:"ml-auto"},B={key:2,class:"ml-auto"},T={key:3,class:"ml-auto"},L={__name:"royal-mail-remittance-report-button",setup(M){const t=u("checking"),o=u({started_at:"",started_by:""}),c=u(!1),d=new Date,l=()=>{m.get("/tasks/royalMailCreditsStatus").then(({data:a})=>{t.value=a.currently_running,a.details&&(o.value=a.details),t.value===!1?c.value&&(window.location="/admin/remittance/royal-mail"):setTimeout(l,15e3)})},g=()=>{c.value=!0,t.value="running",f().then(a=>{l(),a.error||R("Report has been queued for regeneration. This may take a few minutes.")})},f=()=>m.get(`/tasks/royalMailCredits/${d.getFullYear()}${String(d.getMonth()+1).padStart(2,"0")}`);return k(l),(a,e)=>t.value===!1?(r(),y(h,{key:0,text:"Rerun report",colour:"pink",class:"ml-auto",onClick:g})):t.value==="checking"?(r(),i("p",x," Checking to see if report is running... ")):t.value==="running"?(r(),i("p",B," Report is regenerating. Leave this page open to automatically refresh when finished. ")):t.value===!0?(r(),i("div",T,[s("p",null,[e[0]||(e[0]=n(" Report is currently being regenerated. It was started at ",-1)),s("strong",null,p(o.value.started_at),1),e[1]||(e[1]=n(" by ",-1)),s("strong",null,p(o.value.started_by),1),e[2]||(e[2]=n(". ",-1))]),s("p",null,[_(C(w),{class:"underline",href:"/admin/remittance/royal-mail"},{default:v(()=>[...e[3]||(e[3]=[n(" Click here to refresh the page and check progress. ",-1)])]),_:1})])])):b("",!0)}};export{L as default};
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.