1import{j as e}from"./app-C1iegf7Q.js";import{b as c,H as o,L as r,f as x}from"./inertia-BpyZy4w-.js";import{a as m}from"./admin-layout-BhXWbUlP.js";import{a as p}from"./utils-BiuKVCuu.js";import{S as h}from"./shield-off-KOaPd0RW.js";import{P as u}from"./plus-BJl-aJiX.js";import{M as f}from"./megaphone-opizzcRj.js";import{P as g}from"./pencil-DJkCCH8r.js";import{E as b}from"./eye-DoZffUO5.js";import{T as j}from"./triangle-alert-C7AVwNi-.js";import{C as N}from"./circle-check-big-AJlsIacq.js";import{L as k}from"./loader-circle-C_KBZAGS.js";import{C as d}from"./clock-BtI_SZvJ.js";/* empty css */import"./app-logo-Dz0wogSq.js";import"./logo-light-DU4bWymm.js";import"./flash-toast-C6O0iVL1.js";import"./createLucideIcon-wqc1LSWg.js";import"./info-D2ZN_yLm.js";import"./circle-x-Bp6Mbpgt.js";import"./circle-check-BMWvzPMx.js";import"./x-DQSeRCcH.js";import"./arrow-left-DCX0fhKH.js";import"./menu-BR3Nc3Gr.js";import"./users-BCcupCXV.js";import"./folder-open-I72SPUVk.js";import"./pound-sterling-D16GLaAZ.js";import"./book-open-DVFlG_9t.js";function y(s,n){if(s==null)return{};var l={},t=Object.keys(s),i,a;for(a=0;a<t.length;a++)i=t[a],!(n.indexOf(i)>=0)&&(l[i]=s[i]);return l}var v=["color"],w=c.forwardRef(function(s,n){var l=s.color,t=l===void 0?"currentColor":l,i=y(s,v);return c.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),c.createElement("path",{d:"M7.94721 0.164594C7.66569 0.0238299 7.33431 0.0238302 7.05279 0.164594L0.552786 3.41459C0.214002 3.58399 0 3.93025 0 4.30902V12C0 12.5523 0.447715 13 1 13H14C14.5523 13 15 12.5523 15 12V4.30902C15 3.93025 14.786 3.58399 14.4472 3.41459L7.94721 0.164594ZM13.5689 4.09349L7.5 1.05902L1.43105 4.09349L7.5 7.29136L13.5689 4.09349ZM1 4.88366V12H14V4.88366L7.70977 8.19813C7.57848 8.26731 7.42152 8.26731 7.29023 8.19813L1 4.88366Z",fill:t,fillRule:"evenodd",clipRule:"evenodd"}))});const _={database:"In-app",mail:"Email",webpush:"Web push",mobile_push:"Mobile"};function L({status:s}){const l={draft:{cls:"bg-bg-2 text-ink-3",icon:e.jsx(d,{className:"h-3 w-3"}),label:"Draft"},scheduled:{cls:"bg-teal/10 text-teal",icon:e.jsx(d,{className:"h-3 w-3"}),label:"Scheduled"},sending:{cls:"bg-amber/12 text-amber-ink",icon:e.jsx(k,{className:"h-3 w-3 animate-spin"}),label:"Sending"},sent:{cls:"bg-green/10 text-green-ink",icon:e.jsx(N,{className:"h-3 w-3"}),label:"Sent"},failed:{cls:"bg-red/10 text-red",icon:e.jsx(j,{className:"h-3 w-3"}),label:"Failed"}}[s]??{cls:"bg-bg-2 text-ink-3",icon:null,label:s};return e.jsxs("span",{className:p("inline-flex items-center gap-1 rounded-tag px-2 py-0.5 text-2xs font-bold",l.cls),children:[l.icon,l.label]})}function te({broadcasts:s,stats:n}){const l=t=>t?new Date(t).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}):null;return e.jsxs(m,{children:[e.jsx(o,{title:"Broadcasts · Admin"}),e.jsxs("div",{className:"px-4 py-5 sm:px-6 sm:py-7",children:[e.jsxs("div",{className:"mb-5 flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold text-ink",children:"Broadcast Notifications"}),e.jsx("p",{className:"mt-0.5 text-sm text-ink-3",children:"Send notifications to your users"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(r,{href:"/admin/email-suppressions",className:"inline-flex items-center gap-1.5 rounded-lg border border-line bg-white px-3 py-1.5 text-sm font-medium text-ink-2 hover:bg-bg-2",children:[e.jsx(h,{className:"h-3.5 w-3.5"}),"Suppressions"]}),e.jsxs(r,{href:"/admin/nurture-sequences",className:"inline-flex items-center gap-1.5 rounded-lg border border-line bg-white px-3 py-1.5 text-sm font-medium text-ink-2 hover:bg-bg-2",children:[e.jsx(w,{className:"h-3.5 w-3.5"}),"Nurture sequences"]}),e.jsxs(r,{href:"/admin/broadcasts/create",className:"inline-flex items-center gap-1.5 rounded-lg bg-ink px-4 py-2 text-sm font-medium text-white hover:bg-ink/90",children:[e.jsx(u,{className:"h-3.5 w-3.5"}),"New broadcast"]})]})]}),e.jsx("div",{className:"mb-5 grid grid-cols-3 gap-3 sm:grid-cols-6",children:[{label:"Total",value:n.total},{label:"Draft",value:n.draft},{label:"Scheduled",value:n.scheduled},{label:"Sending",value:n.sending},{label:"Sent",value:n.sent},{label:"Failed",value:n.failed}].map(t=>e.jsxs("div",{className:"rounded-card border border-line bg-white p-4",children:[e.jsx("p",{className:"text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:t.label}),e.jsx("p",{className:"mt-1.5 font-serif text-3xl leading-none text-ink",children:t.value})]},t.label))}),e.jsxs("div",{className:"overflow-hidden rounded-card border border-line bg-white",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-line-2 bg-bg-2",children:[e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Title"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Target"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Channels"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Status"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Delivery"}),e.jsx("th",{className:"px-4 py-2.5 text-left text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Date"}),e.jsx("th",{className:"px-4 py-2.5 text-right text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Actions"})]})}),e.jsx("tbody",{children:s.data.length===0?e.jsx("tr",{children:e.jsxs("td",{colSpan:7,className:"py-12 text-center",children:[e.jsx(f,{className:"mx-auto mb-3 h-8 w-8 text-ink-3 op
1acity-50"}),e.jsx("p",{className:"text-sm text-ink-3",children:"No broadcasts yet"})]})}):s.data.map(t=>e.jsxs("tr",{className:"border-b border-line-2 last:border-0 hover:bg-bg-2",children:[e.jsxs("td",{className:"px-4 py-3",children:[e.jsx(r,{href:`/admin/broadcasts/${t.uuid}`,className:"text-sm font-semibold text-ink hover:underline",children:t.title}),t.scheduled_at&&e.jsxs("p",{className:"mt-0.5 text-xs text-ink-3",children:["Scheduled: ",l(t.scheduled_at)]})]}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:"rounded-tag bg-bg-2 px-2 py-0.5 text-2xs font-bold capitalize text-ink-2",children:t.target_audience==="everyone"?"Everyone":t.target_audience==="contacts"?"Contacts":t.target_audience==="event"?"Event":t.target_tier||"All users"})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("div",{className:"flex flex-wrap gap-1",children:t.channels.map(i=>e.jsx("span",{className:"rounded-tag bg-bg-2 px-2 py-0.5 text-2xs font-bold text-ink-3",children:_[i]||i},i))})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx(L,{status:t.status})}),e.jsx("td",{className:"px-4 py-3 text-sm",children:t.status==="sent"||t.status==="failed"?e.jsxs("span",{children:[e.jsxs("span",{className:"block text-ink-2",children:[t.sent_count.toLocaleString()," sent",t.failed_count>0&&e.jsxs("span",{className:"ml-1 text-red",children:["/ ",t.failed_count," failed"]})]}),t.sent_count>0&&e.jsxs("span",{className:"mt-0.5 block text-xs text-ink-3",children:[t.open_count.toLocaleString()," opens · ",t.click_count.toLocaleString()," clicks"]})]}):e.jsx("span",{className:"text-ink-3",children:"â"})}),e.jsx("td",{className:"px-4 py-3 text-sm text-ink-3",children:t.completed_at?e.jsxs("span",{children:[e.jsx("span",{className:"block text-2xs text-ink-3",children:"Sent"}),l(t.completed_at)]}):t.scheduled_at&&t.status==="scheduled"?e.jsxs("span",{children:[e.jsx("span",{className:"block text-2xs text-ink-3",children:"Scheduled"}),l(t.scheduled_at)]}):e.jsxs("span",{children:[e.jsx("span",{className:"block text-2xs text-ink-3",children:"Created"}),l(t.created_at)]})}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex justify-end gap-1.5",children:[t.status==="draft"&&e.jsx(r,{href:`/admin/broadcasts/${t.uuid}/edit`,className:"flex h-7 w-7 items-center justify-center rounded-md border border-line bg-white text-ink-3 hover:bg-bg-2 hover:text-ink",children:e.jsx(g,{className:"h-3.5 w-3.5"})}),e.jsx(r,{href:`/admin/broadcasts/${t.uuid}`,className:"flex h-7 w-7 items-center justify-center rounded-md border border-line bg-white text-ink-3 hover:bg-bg-2 hover:text-ink",children:e.jsx(b,{className:"h-3.5 w-3.5"})})]})})]},t.id))})]})}),s.last_page>1&&e.jsxs("div",{className:"flex items-center justify-center gap-3 border-t border-line-2 px-4 py-3",children:[s.current_page>1&&e.jsx("button",{type:"button",onClick:()=>x.get("/admin/broadcasts",{page:s.current_page-1}),className:"text-xs font-medium text-ink-3 hover:text-ink",children:"Previous"}),e.jsxs("span",{className:"text-xs text-ink-3",children:["Page ",s.current_page," of ",s.last_page]}),s.current_page<s.last_page&&e.jsx("button",{type:"button",onClick:()=>x.get("/admin/broadcasts",{page:s.current_page+1}),className:"text-xs font-medium text-ink-3 hover:text-ink",children:"Next"})]})]})]})]})}export{te 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.