PageSourceSearch

https://app.ebookwriter.ai/build/assets/AdminCampaignsPage-9a20d8d5.js

js ebookwriter.ai collected 2026-10-05 11:59:22 UTC 21,446 bytes, 3 lines download raw bytes

1import{_ as dt,r as p,B as rt,o as ut,m as ct,b as a,e as o,g as t,s as R,y as pt,v as G,F as y,u as x,t as l,d as b,w as v,a$ as S,h as u,T as X,p as vt,n as _,c as _t,C as Z,f as P,q as f}from"./_plugin-vue_export-helper-a7c7f9f8.js";import{b as L}from"./main-2b3b9f70.js";import{S as E}from"./SortableTh-e38b6d92.js";import"./axios-917b1704.js";/* empty css            */const mt={class:"shell"},gt={class:"toolbar"},bt={class:"search-wrap"},ht=["value"],yt=["value"],kt={class:"total-badge"},ft={class:"card table-card"},wt={key:0,class:"sk-rows"},Ct={key:1,class:"empty-state"},xt={key:2,class:"table-scroll"},St=["onClick"],Et={class:"topic-cell"},It={class:"topic-main"},Pt={key:0,class:"topic-sub"},Nt={class:"user-info"},At={class:"user-name"},Ot={class:"user-email"},Rt={key:1,class:"muted-text"},Tt={class:"num-cell"},Dt={key:0,class:"owner-count"},Mt={key:1,class:"muted-text"},$t={class:"badge type-badge"},Ft={key:0,class:"badge v2-badge",title:"Company-key (V2) plan: billed in credits, runs on company credentials"},Bt=["title"],Ut=["title"],Gt={class:"num-cell"},Lt={class:"num-cell cost-cell"},Vt={key:0},Ht={key:1,class:"cost-value"},jt={key:2,class:"muted-text"},zt={class:"num-cell"},Qt={key:0,class:"muted-text"},Wt={key:1,class:"credits-chip"},Yt={key:2,class:"muted-text"},qt={class:"num-cell"},Kt={key:0,class:"muted-text"},Jt={key:2,class:"muted-text"},Xt={class:"time-cell"},Zt={class:"actions-cell"},te={class:"row-actions"},ee=["onClick"],se=["href"],le=["disabled","onClick"],ae={key:3,class:"pagination"},oe=["disabled"],ne={class:"pg-info"},ie=["disabled"],de={class:"cost-modal"},re={class:"modal-head"},ue={key:0,class:"modal-sub"},ce={class:"modal-body"},pe={key:0,class:"modal-loading"},ve={class:"modal-totals"},_e={class:"total-card"},me={class:"total-value primary"},ge={class:"total-card"},be={class:"total-value"},he={key:0,class:"empty-mini"},ye={key:1,class:"op-table-wrap"},ke={class:"op-table"},fe={class:"num"},we={class:"num"},Ce={class:"num cached"},xe={class:"num"},Se={class:"num cost-cell"},Ee={class:"section-title"},Ie={key:2,class:"empty-mini"},Pe={key:3,class:"rows-table-wrap"},Ne={class:"rows-table"},Ae=["title"],Oe=["title"],Re={class:"op-cell"},Te={class:"num"},De={class:"num cached"},Me={class:"num"},$e={class:"num cost-cell"},Fe={key:4,class:"pagination"},Be=["disabled"],Ue={class:"pg-info"},Ge=["disabled"],Le={class:"detail-drawer"},Ve={class:"drawer-head"},He={class:"drawer-body"},je={class:"detail-section"},ze={class:"detail-value"},Qe={class:"detail-value"},We={class:"pills-row"},Ye={class:"badge type-badge"},qe={key:0,class:"badge neutral-badge"},Ke={key:1,class:"badge ai-badge"},Je={key:2,class:"badge v2-badge"},Xe=["title"],Ze=["title"],ts={key:0,class:"detail-section"},es={class:"user-info"},ss={class:"user-name"},ls={class:"user-email"},as={class:"detail-section"},os={class:"detail-value"},ns={class:"muted-text"},is={key:1,class:"error-section"},ds={key:0,class:"error-box"},rs={class:"error-key"},us={key:2,class:"error-box"},cs={class:"drawer-actions"},ps=["href"],vs=["disabled"],_s={__name:"AdminCampaignsPage",setup(ms){const T=p([]),m=p({}),D=p(!0),M=p(""),$=p(""),F=p(""),B=p(""),i=p(null),N=p(null);let V=null;const d=p({open:!1,loading:!1,campaign:null,byOperation:[],rows:[],meta:null,total:{cost:0,calls:0,failed:0},campaignId:null}),tt=[{value:"NEW",label:"New"},{value:"DRAFT",label:"Draft"},{value:"PENDING",label:"Pending"},{value:"QUEUED",label:"Queued"},{value:"IN_PROGRESS",label:"In Progress"},{value:"IMAGE_PROCESSING",label:"Image Processing"},{value:"DONE",label:"Done"},{value:"FAILED",label:"Failed"}],et=[{value:"default",label:"eBook"},{value:"short_report",label:"Short Report"},{value:"informational_post",label:"Informational Post"},{value:"youtube_video",label:"YouTube Video"},{value:"kid_storybook",label:"Kid Storybook"},{value:"document_upload",label:"Document Upload"},{value:"cookbook",label:"Cookbook"}],I=p({field:"created_at",direction:"desc"}),w=rt(()=>({sort:I.value.field,direction:I.value.direction}));function C({field:n,direction:e}){I.value={field:n,direction:e},k(1)}async function k(n=1){D.value=!0;try{const{data:e}=await L.get("/admin/campaigns",{params:{page:n,search:M.value||void 0,status:$.value||void 0,type:F.value||void 0,plan_mode:B.value||void 0,sort:I.value.field,direction:I.value.direction,per_page:20}});I.value={field:e.meta.sort,direction:e.meta.direction},T.value=e.data,m.value=e.meta}catch(e){console.error("Failed to load admin campaigns",e)}finally{D.value=!1}}function st(){clearTimeout(V),V=setTimeout(()=>k(1),350)}function lt(n){i.value=n}async function at(n){d.value={open:!0,loading:!0,campaign:{id:n.id,title:n.title,topic:n.topic},byOperation:[],rows:[],meta:null,total:{cost:0,calls:0,failed:0},campaignId:n.id},await U(1)}async function U(n=1){if(d.value.campaignId){d.value.loading=!0;try{const{data:e}=await L.get(`/admin/api-call-costs/campaign/${d.value.campaignId}`,{params:{page:n,per_page:25}});d.value.campaign=e.campaign,d.value.byOperation=e.by_operation,d.value.rows=e.data,d.value.meta=e.meta,d.value.total=e.total}catch(e){console.error("Failed to load cost breakdown",e)}finally{d.value.loading=!1}}}function H(){d.value.open=!1}
1function g(n){return n!=null?Number(n).toLocaleString():"0"}function A(n){if(n==null)return"0.0000";const e=Number(n);return e<.01?e.toFixed(6):e.toFixed(4)}function ot(n){return{"prov-openai":n==="openai","prov-openrouter":n==="openrouter","prov-gemini":n==="gemini","prov-dataforseo":n==="dataforseo","prov-scrapeowl":n==="scrapeowl","prov-browserless":n==="browserless","prov-youtube":n==="youtube"}}const nt=["FAILED","IMAGE_PROCESSING_FAILED","AUDIO_PROCESSING_FAILED","OPENAI_ERROR","ERROR","IN_PROGRESS","IMAGE_PROCESSING","AUDIO_PROCESSING","GENERATE_PDF","GENERATE_EPUB","QUEUED"];function j(n){return n?nt.includes(String(n.status??"").toUpperCase().replace(/ /g,"_")):!1}async function z(n){var e,c,s,r,J;if(confirm(`Retry "${n.title||n.topic||"this campaign"}"?
2
3This resumes generation from wherever it stopped.`)){N.value=n.id;try{const{data:h}=await L.post(`/campaigns/${n.id}/start`);n.status=((e=h==null?void 0:h.data)==null?void 0:e.status)??"IN PROGRESS",n.status_label=((c=h==null?void 0:h.data)==null?void 0:c.status_label)??"In Progress",((s=i.value)==null?void 0:s.id)===n.id&&(i.value={...n})}catch(h){console.error("Failed to retry campaign",h),alert(((J=(r=h.response)==null?void 0:r.data)==null?void 0:J.message)||"Failed to retry campaign.")}finally{N.value=null}}}const it={company_codex:"company Codex",api_key:"API key",user_codex:"user's ChatGPT",unknown:"untagged (older rows)"};function Q(n){return Object.values(n.credential_mix??{}).reduce((e,c)=>e+Number(c||0),0)}function O(n){const e=n.credential_mix??{},c=Object.keys(e).map(s=>`${e[s]} × ${it[s]??s}`);return c.length?`AI calls served by: ${c.join(", ")}`:"No AI calls recorded"}function W(n){return{DONE:"status-done",IN_PROGRESS:"status-progress",IMAGE_PROCESSING:"status-progress",FAILED:"status-failed",PENDING:"status-pending",NEW:"status-neutral",QUEUED:"status-neutral",DRAFT:"status-draft"}[n]??"status-neutral"}const Y=["#635BFF","#0891b2","#16a34a","#d97706","#dc2626","#7c3aed"];function q(n){const e=(n??"").split("").reduce((c,s)=>c+s.charCodeAt(0),0)%Y.length;return Y[e]}function K(n){return(n??"?").split(" ").filter(Boolean).map(e=>e[0]).join("").slice(0,2).toUpperCase()}return ut(()=>k()),(n,e)=>{const c=ct("router-link");return a(),o("div",mt,[t("div",gt,[t("div",bt,[e[16]||(e[16]=t("svg",{class:"search-icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("circle",{cx:"11",cy:"11",r:"8"}),t("path",{d:"m21 21-4.35-4.35"})],-1)),R(t("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>M.value=s),class:"search-input",placeholder:"Search topic or title…",onInput:st},null,544),[[pt,M.value]])]),R(t("select",{"onUpdate:modelValue":e[1]||(e[1]=s=>$.value=s),class:"filter-select",onChange:e[2]||(e[2]=s=>k(1))},[e[17]||(e[17]=t("option",{value:""},"All Statuses",-1)),(a(),o(y,null,x(tt,s=>t("option",{key:s.value,value:s.value},l(s.label),9,ht)),64))],544),[[G,$.value]]),R(t("select",{"onUpdate:modelValue":e[3]||(e[3]=s=>F.value=s),class:"filter-select",onChange:e[4]||(e[4]=s=>k(1))},[e[18]||(e[18]=t("option",{value:""},"All Types",-1)),(a(),o(y,null,x(et,s=>t("option",{key:s.value,value:s.value},l(s.label),9,yt)),64))],544),[[G,F.value]]),R(t("select",{"onUpdate:modelValue":e[5]||(e[5]=s=>B.value=s),class:"filter-select",onChange:e[6]||(e[6]=s=>k(1))},e[19]||(e[19]=[t("option",{value:""},"All plan modes",-1),t("option",{value:"company"},"Company (v2)",-1),t("option",{value:"legacy"},"Legacy",-1)]),544),[[G,B.value]]),t("span",kt,l(m.value.total??0)+" campaigns",1)]),t("div",ft,[D.value?(a(),o("div",wt,[(a(),o(y,null,x(8,s=>t("div",{key:s,class:"sk-row"},e[20]||(e[20]=[vt('<div class="sk" style="width:220px;height:13px;" data-v-b2df7d04></div><div class="sk" style="width:120px;height:13px;" data-v-b2df7d04></div><div class="sk" style="width:80px;height:22px;border-radius:11px;" data-v-b2df7d04></div><div class="sk" style="width:60px;height:22px;border-radius:11px;" data-v-b2df7d04></div><div class="sk" style="width:90px;height:13px;" data-v-b2df7d04></div>',5)]))),64))])):T.value.length?(a(),o("div",xt,[t("table",null,[t("thead",null,[t("tr",null,[b(E,S({field:"topic",initial:"asc"},w.value,{onSort:C}),{default:v(()=>e[22]||(e[22]=[_("Topic / Title")])),_:1,__:[22]}
3,16),e[29]||(e[29]=t("th",null,"User",-1)),b(E,S({field:"owner_campaigns_count",width:"120px",align:"right"},w.value,{onSort:C}),{default:v(()=>e[23]||(e[23]=[_(" User’s books ")])),_:1,__:[23]},16),b(E,S({field:"type",initial:"asc"},w.value,{onSort:C}),{default:v(()=>e[24]||(e[24]=[_("Type")])),_:1,__:[24]},16),b(E,S({field:"status",initial:"asc"},w.value,{onSort:C}),{default:v(()=>e[25]||(e[25]=[_("Status")])),_:1,__:[25]},16),b(E,S({field:"page_length",width:"60px",align:"right"},w.value,{onSort:C}),{default:v(()=>e[26]||(e[26]=[_("Pages")])),_:1,__:[26]},16),b(E,S({field:"cost_total",width:"90px",align:"right"},w.value,{onSort:C}),{default:v(()=>e[27]||(e[27]=[_("Cost (USD)")])),_:1,__:[27]},16),e[30]||(e[30]=t("th",{class:"num-cell",style:{width:"90px"},title:"Credits deducted from the owner's balance"},"Credits",-1)),e[31]||(e[31]=t("th",{class:"num-cell",style:{width:"95px"},title:"Credit revenue minus API cost — red = generated at a loss"},"Profit",-1)),b(E,S({field:"created_at",width:"130px"},w.value,{onSort:C}),{default:v(()=>e[28]||(e[28]=[_("Created")])),_:1,__:[28]},16),e[32]||(e[32]=t("th",{style:{width:"110px"}},null,-1))])]),t("tbody",null,[(a(!0),o(y,null,x(T.value,s=>(a(),o("tr",{key:s.id,class:"data-row",onClick:r=>lt(s)},[t("td",null,[t("div",Et,[t("span",It,l(s.topic),1),s.title&&s.title!==s.topic?(a(),o("span",Pt,l(s.title),1)):u("",!0)])]),t("td",null,[s.user?(a(),_t(c,{key:0,class:"user-cell user-link",to:{name:"admin.users.view",params:{id:s.user.id}},onClick:e[7]||(e[7]=P(()=>{},["stop"]))},{default:v(()=>
3[t("div",{class:"user-av",style:Z({background:q(s.user.name)})},l(K(s.user.name)),5),t("div",Nt,[t("span",At,l(s.user.name),1),t("span",Ot,l(s.user.email),1)])]),_:2},1032,["to"])):(a(),o("span",Rt,"—"))]),t("td",Tt,[s.owner_campaigns_count?(a(),o("span",Dt,l(s.owner_campaigns_count.toLocaleString()),1)):(a(),o("span",Mt,"—"))]),t("td",null,[t("span",$t,l(s.type_label??s.type??"—"),1),s.plan_mode==="v2"?(a(),o("span",Ft,"V2")):u("",!0),s.codex_calls?(a(),o("span",{key:1,class:"badge codex-badge",title:O(s)},"Codex "+l(s.codex_calls)+"/"+l(Q(s)),9,Bt)):s.plan_mode==="v2"&&s.api_key_calls?(a(),o("span",{key:2,class:"badge key-badge",title:O(s)},"API key",8,Ut)):u("",!0)]),t("td",null,[t("span",{class:f(["badge",W(s.status)])},l(s.status_label??s.status??"—"),3)]),t("td",Gt,l(s.page_length??"—"),1),t("td",Lt,[s.billing==="own_key"?(a(),o("span",Vt)):s.cost_total>0?(a(),o("span",Ht,"$"+l(A(s.cost_total)),1)):(a(),o("span",jt,"—"))]),t("td",zt,[s.billing==="own_key"?(a(),o("span",Qt)):s.credit_total>0?(a(),o("span",Wt,l(s.credit_is_actual?"":"~")+l(Number(s.credit_total).toLocaleString())+" cr ",1)):(a(),o("span",Yt,"—"))]),t("td",qt,[s.billing==="own_key"?(a(),o("span",Kt)):s.profit_usd!=null?(a(),o("span",{key:1,class:f(["profit-chip",s.profit_usd>=0?"gain":"loss"])},l(s.profit_usd>=0?"+":"−")+"$"+l(A(Math.abs(s.profit_usd))),3)):(a(),o("span",Jt,"—"))]),t("td",Xt,l(s.created_at_human),1),t("td",Zt,[t("div",te,[s.calls_total>0?(a(),o("button",{key:0,class:"icon-btn cost-icon-btn","data-tip":"View costs",onClick:P(r=>at(s),["stop"])},e[33]||(e[33]=[t("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),t("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})],-1)]),8,ee)):u("",!0),t("a",{class:"icon-btn view-icon-btn",href:`/ebooks/${s.id}`,"data-tip":"View",onClick:e[8]||(e[8]=P(()=>{},["stop"]))},e[34]||(e[34]=[t("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),t("circle",{cx:"12",cy:"12",r:"3"})],-1)]),8,se),j(s)?(a(),o("button",{key:1,class:"icon-btn retry-icon-btn",disabled:N.value===s.id,"data-tip":"Retry",onClick:P(r=>z(s),["stop"])},e[35]||(e[35]=[t("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("polyline",{points:"23 4 23 10 17 10"}),t("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})],-1)]),8,le)):u("",!0)])])],8,St))),128))])])])):(a(),o("div",Ct,e[21]||(e[21]=[t("svg",{width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[t("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),t("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"})],-1),t("p",null,"No campaigns found",-1)]))),m.value.last_page>1?(a(),o("div",ae,[t("button",{class:"pg-btn",disabled:m.value.current_page<=1,onClick:e[9]||(e[9]=s=>k(m.value.current_page-1))},"← Prev",8,oe),t("span",ne,"Page "+l(m.value.current_page)+" of "+l(m.value.last_page),1),t("button",{class:"pg-btn",disabled:m.value.current_page>=m.value.last_page,onClick:e[10]||(e[10]=s=>k(m.value.current_page+1))},"Next →",8,ie)])):u("",!0)]),b(X,{name:"cost-modal"},{default:v(()=>{var s;return[d.value.open?(a(),o("div",{key:0,class:"modal-overlay",onClick:P(H,["self"])},[t("div",de,[t("div",re,[t("div",null,[e[36]||(e[36]=t("h3",{class:"modal-title"},"API Call Costs",-1)),d.value.campaign?(a(),o("p",ue," #"+l(d.value.campaign.id)+" · "+l(d.value.campaign.title||d.value.campaign.topic),1)):u("",!0)]),t("button",{class:"close-btn",onClick:H},e[37]||(e[37]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},[t("path",{d:"M18 6 6 18M6 6l12 12"})],-1)]))]),t("div",ce,[d.value.loading?(a(),o("div",pe,e[38]||(e[38]=[t("div",{class:"sk",style:{width:"100%",height:"60px","border-radius":"6px"}},null,-1),t("div",{class:"sk",style:{width:"100%",height:"200px","border-radius":"6px","margin-top":"14px"}},null,-1)]))):(a(),o(y,{key:1},[t("div",ve,[t("div",_e,[e[39]||(e[39]=t("div",{class:"total-label"},"Total cost",-1)),t("div",me,"$"+l(A(d.value.total.cost)),1)]),t("div",ge,[e[40]||(e[40]=t("div",{class:"total-label"},"Total calls",-1)),t("div",be,l(g(d.value.total.calls)),1)]),t("div",{class:f(["total-card",d.value.total.failed>0?"danger-card":""])},[e[41]||(e[41]=t("div",{class:"total-label"},"Failed",-1)),t("div",{class:f(["total-value",d.value.total.failed>0?"danger":"muted"])},l(g(d.value.total.failed)),3)],2)]),e[44]||(e[44]=t("h4",{class:"section-title"},"Breakdown by operation",-1)),d.value.byOperation.length?(a(),o("div",ye,[t("table",ke,[e[42]||(e[42]=t("thead",null,[t("tr",null,[t("th",null,"Operation"),t("th",{class:"num"},"Calls"),t("th",{class:"num"},"Failed"),t("th",{class:"num"},"Prompt"),t("th",{class:"num"},"Cached"),t("th",{class:"num"},"Output"),t("th",{class:"num"},"Cost")])],-1)),t("tbody",null,[(a(!0),o(y,null,x(d.value.byOperation,r=>(a(),o("tr",{key:r.operation},[t("td",null,l(r.operation_label),1),t("td",fe,l(g(r.calls)),1),t("td",{class:f(["num",r.failed_calls>0?"danger":""])},l(g(r.failed_calls)),3),t("td",we,l(g(r.prompt_tokens)),1),t("td",Ce,l(g(r.cached_tokens)),1),t("td",xe,l(g(r.completion_tokens)),1),t("td",Se,"$"+l(A(r.cost)),1)]))),128))])])])):(a(),o("div",he,"No operations recorded")),t("h4",Ee,"All calls ("+l(((s=d.value.meta)==null?void 0:s.total)??0)+")",1),d.value.rows.length?(a(),o("div",Pe,[t("table",Ne,[e[43]||(e[43]=t("thead",null,[t("tr",null,[t("th",null,"When"),t("th",null,"Provider"),t("th",null,"Model"),t("th",null,"Operation"),t("th",null,"Status"),t("th",{class:"num"},"Prompt"),t("th",{class:"num"},"Cached"),t("th",{class:"num"},"Out"),t("th",{class:"num"},"Cost")])],-1)),t("tbody",null,[(a(!0),o(y,null,x(d.value.rows,r=>(a(),o("tr",{key:r.id},[t("td",{class:"time-cell",title:r.created_at},l(r.created_at_human),9,Ae),t("td",null,[t("span",{class:f(["badge",ot(r.provider)])},l(r.provider_label||r.provider),3)]),t("td",{class:"model-cell",title:r.model},l(r.model),9,Oe),t("td",Re,l(r.operation_label),1),t("td",null,[t("span",{class:f(["badge",r.status==="success"?"status-ok":"status-fail"])}
3,l(r.status),3)]),t("td",Te,l(g(r.prompt_tokens)),1),t("td",De,l(g(r.cached_tokens)),1),t("td",Me,l(g(r.completion_tokens)),1),t("td",$e,"$"+l(A(r.cost_usd)),1)]))),128))])])])):(a(),o("div",Ie,"No calls recorded")),d.value.meta&&d.value.meta.last_page>1?(a(),o("div",Fe,[t("button",{class:"pg-btn",disabled:d.value.meta.current_page<=1,onClick:e[11]||(e[11]=r=>U(d.value.meta.current_page-1))},"← Prev",8,Be),t("span",Ue,"Page "+l(d.value.meta.current_page)+" of "+l(d.value.meta.last_page),1),t("button",{class:"pg-btn",disabled:d.value.meta.current_page>=d.value.meta.last_page,onClick:e[12]||(e[12]=r=>U(d.value.meta.current_page+1))},"Next →",8,Ge)])):u("",!0)],64))])])])):u("",!0)]}),_:1}),b(X,{name:"drawer"},{default:v(()=>[i.value?(a(),o("div",{key:0,class:"drawer-overlay",onClick:e[15]||(e[15]=P(s=>i.value=null,["self"]))},[t("aside",Le,[t("div",Ve,[e[46]||(e[46]=t("h3",{class:"drawer-title"},"Campaign Detail",-1)),t("button",{class:"close-btn",onClick:e[13]||(e[13]=s=>i.value=null)},e[45]||(e[45]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},[t("path",{d:"M18 6 6 18M6 6l12 12"})],-1)]))]),t("div",He,[t("div",je,[e[48]||(e[48]=t("div",{class:"detail-label"},"Topic",-1)),t("div",ze,l(i.value.topic),1),i.value.title&&i.value.title!==i.value.topic?(a(),o(y,{key:0},[e[47]||(e[47]=t("div",{class:"detail-label",style:{"margin-top":"8px"}},"Title",-1)),t("div",Qe,l(i.value.title),1)],64)):u("",!0)]),t("div",We,[t("span",{class:f(["badge",W(i.value.status)])},l(i.value.status_label??i.value.status),3),t("span",Ye,l(i.value.type_label??i.value.type),1),i.value.page_length?(a(),o("span",qe,l(i.value.page_length)+" pages",1)):u("",!0),i.value.ai_model?(a(),o("span",Ke,l(i.value.ai_model),1)):u("",!0),i.value.plan_mode==="v2"?(a(),o("span",Je,"V2")):u("",!0),i.value.codex_calls?(a(),o("span",{key:3,class:"badge codex-badge",title:O(i.value)},"Codex "+l(i.value.codex_calls)+"/"+l(Q(i.value)),9,Xe)):i.value.plan_mode==="v2"&&i.value.api_key_calls?(a(),o("span",{key:4,class:"badge key-badge",title:O(i.value)},"API key only",8,Ze)):u("",!0)]),i.value.user?(a(),o("div",ts,[e[49]||(e[49]=t("div",{class:"detail-label"},"Owner",-1)),b(c,{class:"user-cell user-link",to:{name:"admin.users.view",params:{id:i.value.user.id}}},{default:v(()=>[t("div",{class:"user-av",style:Z({background:q(i.value.user.name)})},l(K(i.value.user.name)),5),t("div",es,[t("span",ss,l(i.value.user.name),1),t("span",ls,l(i.value.user.email),1)])]),_:1},8,["to"])])):u("",!0),t("div",as,[e[50]||(e[50]=t("div",{class:"detail-label"},"Created",-1)),t("div",os,[_(l(i.value.created_at)+" ",1),t("span",ns,"("+l(i.value.created_at_human)+")",1)])]),i.value.status==="FAILED"?(a(),o("div",is,[e[51]||(e[51]=t("div",{class:"detail-label"},"Error",-1)),i.value.fail_message?(a(),o("div",ds,l(i.value.fail_message),1)):u("",!0),i.value.errors?(a(!0),o(y,{key:1},x(i.value.errors,(s,r)=>(a(),o("div",{key:r,class:"error-box",style:{"margin-top":"6px"}},[t("span",rs,l(r)+":",1),_(" "+l(s),1)]))),128)):u("",!0),!i.value.fail_message&&!i.value.errors?(a(),o("div",us,"Campaign failed with no error details recorded.")):u("",!0)])):u("",!0),t("div",cs,[t("a",{href:`/ebooks/${i.value.id}`,target:"_blank",class:"action-btn primary-btn"},e[52]||(e[52]=[t("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),t("polyline",{points:"15 3 21 3 21 9"}),t("line",{x1:"10",y1:"14",x2:"21",y2:"3"})],-1),_(" Open Campaign ")]),8,ps),j(i.value)?(a(),o("button",{key:0,class:"action-btn retry-action-btn",disabled:N.value===i.value.id,onClick:e[14]||(e[14]=s=>z(i.value))},[e[53]||(e[53]=t("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("polyline",{points:"23 4 23 10 17 10"}),t("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})],-1)),_(" "+l(N.value===i.value.id?"Retrying…":"Retry"),1)],8,vs)):u("",!0)])])])])):u("",!0)]),_:1})])}}},fs=dt(_s,[["__scopeId","data-v-b2df7d04"]]);export{fs 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.