PageSourceSearch

https://aidealer360.com/assets/AnalyticsPage-mcrJJ4EE.js

js aidealer360.com collected 2026-09-24 12:38:29 UTC 7,456 bytes, 1 lines download raw bytes

1import{j as e}from"./ui-vendor-B12AOeKi.js";import{q as a,v as r,w as n,by as I,y as l,C as A,W as P,aa as _,x as d,B as V,ar as $,aA as L}from"./index-CUOC2qQu.js";import{u as U}from"./usePromotionsOffers-9RoOjQ2d.js";import{u as W}from"./useServicePromotions-gd7S-sDU.js";import{u as X}from"./usePromotionalBanners-BIHuHeHO.js";import{g as p}from"./ExpirationAlert-Bsi-aIVG.js";import{R as g,B,j as O,X as T,Y as D,T as u,i as f,f as Y,g as q,C as z}from"./charts-vendor-B6q1L48j.js";import{I as G}from"./image-DteYbBUl.js";import{e as H}from"./react-vendor-DZt7wVAJ.js";import"./supabase-vendor-dOy44Gxq.js";import"./animation-vendor-BAVy02gd.js";import"./calendar-check-D9v6EXqv.js";import"./calendar-clock-CJ5F1QjO.js";import"./differenceInDays-C7TMNu7N.js";const E=["hsl(var(--primary))","hsl(var(--chart-2))","hsl(var(--chart-3))","hsl(var(--chart-4))"];function F(){const{offers:i,activeOffers:x}=U(),{promotions:o,activePromotions:m}=W(),{banners:h,activeBanners:v}=X(),N=i.filter(s=>p(s.start_date,s.end_date)==="expiring-soon"),y=o.filter(s=>p(s.start_date,s.end_date)==="expiring-soon"),b=h.filter(s=>p(s.start_date,s.end_date)==="expiring-soon"),j=x.length+m.length+v.length,w=i.length+o.length+h.length,c=N.length+y.length+b.length,K=[{name:"Vehicle Offers",value:i.length,active:x.length},{name:"Service Coupons",value:o.length,active:m.length},{name:"Banners",value:h.length,active:v.length}],C=[{name:"Active",value:j},{name:"Inactive",value:w-j-c},{name:"Expiring Soon",value:c}].filter(s=>s.value>0),R=i.reduce((s,t)=>{const S=t.offer_type||"unknown";return s[S]=(s[S]||0)+1,s},{}),k=Object.entries(R).map(([s,t])=>({name:s.charAt(0).toUpperCase()+s.slice(1),value:t}));return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[e.jsxs(a,{children:[e.jsxs(r,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(n,{className:"text-sm font-medium",children:"Total Active"}),e.jsx(I,{className:"h-4 w-4 text-green-500"})]}),e.jsxs(l,{children:[e.jsx("div",{className:"text-2xl font-bold",children:j}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["out of ",w," total promotions"]})]})]}),e.jsxs(a,{children:[e.jsxs(r,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(n,{className:"text-sm font-medium",children:"Vehicle Offers"}),e.jsx(A,{className:"h-4 w-4 text-blue-500"})]}),e.jsxs(l,{children:[e.jsx("div",{className:"text-2xl font-bold",children:x.length}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[i.length," total offers"]})]})]}),e.jsxs(a,{children:[e.jsxs(r,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(n,{className:"text-sm font-medium",children:"Service Coupons"}),e.jsx(P,{className:"h-4 w-4 text-green-500"})]}),e.jsxs(l,{children:[e.jsx("div",{className:"text-2xl font-bold",children:m.length}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[o.length," total coupons"]})]})]}),e.jsxs(a,{children:[e.jsxs(r,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(n,{className:"text-sm font-medium",children:"Expiring Soon"}),e.jsx(_,{className:"h-4 w-4 text-orange-500"})]}),e.jsxs(l,{children:[e.jsx("div",{className:"text-2xl font-bold text-orange-500",children:c}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"within the next 7 days"})]})]})]}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs(a,{children:[e.jsxs(r,{children:[e.jsx(n,{children:"Promotions by Type"}),e.jsx(d,{children:"Distribution of active vs total promotions"})]}),e.jsx(l,{children:e.jsx(g,{width:"100%",height:250,children:e.jsxs(B,{data:K,children:[e.jsx(O,{strokeDasharray:"3 3",className:"stroke-muted"}),e.jsx(T,{dataKey:"name",className:"text-xs"}),e.jsx(D,{className:"text-xs"}),e.jsx(u,{contentStyle:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))"}}),e.jsx(f,{dataKey:"value",name:"Total",fill:"hsl(var(--muted-foreground))",radius:[4,4,0,0]}),e.jsx(f,{dataKey:"active",name:"Active",fill:"hsl(var(--primary))",radius:[4,4,0,0]})]})})})]}),e.jsxs(a,{children:[e.jsxs(r,{children:[e.jsx(n,{children:"Status Distribution"}),e.jsx(d,{children:"Current state of all promotions"})]}),e.jsx(l,{children:e.jsx(g,{width:"100%",height:250,children:e.jsxs(Y,{children:[e.jsx(q,{data:C,cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:5,dataKey:"value",label:({name:s,value:t})=>`${s}: ${t}`,children:C.map((s,t)=>e.jsx(z,{fill:E[t%E.length]},`cell-${t}`))}),e.jsx(u,{contentStyle:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))"}})]})})})]}),k.length>0&&e.jsxs(a,{className:"md:col-span-2",children:[e.jsxs(r,{children:[e.jsx(n,{children:"Vehicle Offer Types"}),e.jsx(d,{children:"Breakdown by offer type (lease, purchase, finance)"})]}),e.jsx(l,{children:e.jsx(g,{width:"100%",height:200,children:e.jsxs(B,{data:k,layout:"vertical",children:[e.jsx(O,{strokeDasharray:"3 3",className:"stroke-muted"}),e.jsx(T,{type:"number",className:"text-xs"}),e.jsx(D,{dataKey:"name",type:"category",className:"text-xs",width:80}),e.jsx(u,{contentStyle:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))"}}),e.jsx(f,{dataKey:"value",fill:"hsl(var(--primary))",radius:[0,4,4,0]})]})})})]})]}),c>0&&e.jsxs(a,{children:[e.jsxs(r,{children:[e.jsxs(n,{className:"flex items-center gap-2",children:[e.jsx(_,{className:"h-5 w-5 text-orange-500"}),"Expiring Soon"]}),e.jsx(d,{children:"Promotions expiring within the next 7 days"})]}),e.jsx(l,{children:e.jsxs("div",{className:"space-y-2",children:[N.map(s=>e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-orange-500/5 border border-orange-500/20",children:[e.jsx(A,{className:"h-4 w-4 text-blue-500"}),e.jsxs("span",{className:"text-sm flex-1",children:[s.year," ",s.make," ",s.model]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Ends ",s.end_date]})]},s.id)),y.map(s=>e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-orange-500/5 border border-orange-500/20",children:[e.jsx(P,{className:"h-4 w-4 text-green-500"}),e.jsx("span",{className:"text-sm flex-1",children:s.service_name}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Ends ",s.end_date]})]},s.id)),b.map(s=>e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-orange-500/5 border border-orange-500/20",children:[e.jsx(G,{className:"h-4 w-4 text-purple-500"}),e.jsx("span",{className:"text-sm flex-1",children:s.title}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Ends ",s.end_date]})]},s.id))]})})]})]})}function de(){const i=H();return e.jsxs("div",{className:"container mx-auto px-3 sm:px-6 py-4 sm:py-6 space-y-4 sm:sp
1ace-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(V,{variant:"ghost",size:"icon",onClick:()=>i("/promotions"),className:"shrink-0",children:e.jsx($,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h1",{className:"text-lg sm:text-2xl font-bold flex items-center gap-2 truncate",children:[e.jsx(L,{className:"h-5 w-5 sm:h-6 sm:w-6 shrink-0"}),e.jsx("span",{className:"truncate",children:"Promotions Analytics"})]}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground truncate",children:"Overview of your promotional content performance"})]})]}),e.jsx(F,{})]})}export{de 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.