PageSourceSearch

https://stone-profit-flow.base44.app/assets/KpiWidgets-DM_0ffCa.js

js stone-profit-flow.base44.app collected 2026-10-03 03:12:35 UTC 4,439 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-query-B-_nDQQY.js";import{O as f,r as x,D as b,U as h,T as j,n as v,x as w,F as y,C as m,d as g}from"./index-D8ww6b7J.js";import{L as N}from"./vendor-react-BUIlT3ms.js";import{f as d,a as L,b as _,c as D}from"./dashboardUtils-DAoXRTvN.js";import{A as K}from"./arrow-right-BeikyhzV.js";import"./vendor-three-1K-S22da.js";import"./vendor-charts-i-522T5A.js";import"./vendor-pdf-Bwkk3Ew0.js";import"./vendor-radix-X0WMATEu.js";function c(){return L()}function p(){return D()}function T(){return _()}function i({icon:s,label:o,value:a,sublabel:n,to:t,accent:r}){return e.jsx(N,{to:t,className:"block group h-full",children:e.jsx(m,{className:"hover:shadow-md transition-shadow border-border/60 h-full",children:e.jsxs(g,{className:"p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center ${r||"bg-primary/10 text-primary"}`,children:e.jsx(s,{className:"w-5 h-5",strokeWidth:1.5})}),e.jsx(K,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]}),e.jsx("p",{className:"text-2xl font-bold text-foreground tracking-tight",children:a}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:o}),n&&e.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1",children:n})]})})})}function l(){return e.jsx(m,{className:"border-border/60 h-full",children:e.jsxs(g,{className:"p-4 sm:p-5",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-muted animate-pulse mb-2"}),e.jsx("div",{className:"h-7 bg-muted rounded animate-pulse mb-1"}),e.jsx("div",{className:"h-3 bg-muted rounded animate-pulse w-2/3"})]})})}function $(){const{data:s=[],isLoading:o}=c();if(o)return e.jsx(l,{});const a=s.filter(t=>!["completed","cancelled"].includes(t.status)),n=s.filter(t=>{if(t.status!=="completed"||!t.updated_date)return!1;const r=new Date(t.updated_date),u=new Date;return r.getMonth()===u.getMonth()&&r.getFullYear()===u.getFullYear()});return e.jsx(i,{icon:f,label:"Active Jobs",value:a.length,sublabel:`${n.length} completed this month`,to:"/jobs"})}function J(){const{data:s=[],isLoading:o}=c();if(o)return e.jsx(l,{});const a=s.filter(t=>t.status==="completed"&&t.updated_date).filter(t=>{const r=new Date(t.updated_date),u=new Date;return r.getMonth()===u.getMonth()&&r.getFullYear()===u.getFullYear()}),n=a.reduce((t,r)=>t+(r.selling_price||0),0);return e.jsx(i,{icon:b,label:"Revenue (This Month)",value:d(n),sublabel:`${a.length} jobs completed`,to:"/analytics",accent:"bg-success/10 text-success"})}function S(){const{data:s=[],isLoading:o}=p();if(o)return e.jsx(l,{});const a=s.filter(t=>["draft","sent"].includes(t.status)),n=a.reduce((t,r)=>t+(r.final_amount||r.selling_price||0),0);return e.jsx(i,{icon:w,label:"Pipeline Value",value:d(n),sublabel:`${a.length} open quotes`,to:"/quote",accent:"bg-info/10 text-info"})}function Y(){const{data:s=[],isLoading:o}=c();if(o)return e.jsx(l,{});const a=s.filter(n=>n.status!=="completed"?!1:(n.selling_price||0)-(n.deposit_amount||0)>0);return e.jsx(i,{icon:j,label:"Overdue Payments",value:a.length,sublabel:`${d(a.reduce((n,t)=>n+((t.selling_price||0)-(t.deposit_amount||0)),0))} outstanding`,to:"/payments",accent:"bg-destructive/10 text-destructive"})}function O(){const{data:s=[],isLoading:o}=T();if(o)return e.jsx(l,{});const a=s.filter(n=>{if(!n.created_date)return!1;const t=new Date(n.created_date),r=new Date;return r.setDate(r.getDate()-7),t>=r});return e.jsx(i,{icon:h,label:"New Leads (7 days)",value:a.length,to:"/leads",accent:"bg-purple/10 text-purple"})}function U(){const{data:s=[],isLoading:o}=c();if(o)return e.jsx(l,{});const a=s.filter(n=>n.job_date?new Date(n.job_date).toDateString()===new Date().toDateString():!1);return e.jsx(i,{icon:x,label:"Installations Today",value:a.length,to:"/calendar"})}function V(){const{data:s=[],isLoading:o}=p();return o?e.jsx(l,{}):e.jsx(i,{icon:y,label:"Total Quotes",value:s.length,to:"/quote"})}function I(){const{data:s=[],isLoading:o}=p();if(o)return e.jsx(l,{});const a=s.filter(n=>n.status==="sent");return e.jsx(i,{icon:v,label:"Pending Quotes",value:a.length,sublabel:"Awaiting response",to:"/aging-quotes",accent:"bg-warning/10 text-warning"})}export{$ as ActiveJobsKpi,U as InstallationsTodayKpi,J as MonthlyRevenueKpi,O as NewLeadsKpi,Y as OverduePaymentsKpi,I as PendingQuotesKpi,S as PipelineValueKpi,V as TotalQuotesKpi};

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.