1import{r as e,j as t}from"./index-GDMS6ldZ.js";import{u as a,a as l,V as s,b as r,c as i,d as n,e as o}from"./dashboardApi-CFo7mmEI.js";import{A as d}from"./AdminListPageHeader-3o4Km4dD.js";import{A as c}from"./AdminDataTable-CcoZ3Y6N.js";import{F as m}from"./ArrowTrendingUpIcon-nuLLXKwR.js";import"./memoize-BJq8owbd.js";import"./value-wFQqkxWT.js";import"./timer-CRWIB8fh.js";import"./InformationCircleIcon-BqW0tfkd.js";import"./ArrowPathIcon-D-MTjHNq.js";import"./AdminAsyncState-VhllU-mN.js";import"./ExclamationCircleIcon-DBE7OqCV.js";import"./ChevronLeftIcon-BUBYIo34.js";import"./ChevronRightIcon-8w11xhHf.js";function x(e){const t=Number(e);return Number.isFinite(t)?t>=1e9?`${(t/1e9).toFixed(3).replace(/\.?0+$/,"")}B`:t>=1e6?`${(t/1e6).toFixed(3).replace(/\.?0+$/,"")}M`:t>=1e3?`${(t/1e3).toFixed(3).replace(/\.?0+$/,"")}K`:t.toLocaleString():"N/A"}function p(e,t=!1){const a=Number(e);return!Number.isFinite(a)||a<=0?"N/A":t?`$${x(a)}`:`$${a.toFixed(2)}`}function g({title:e,subtitle:a}){return t.jsxs("div",{className:"mb-3",children:[t.jsx("h2",{className:"text-base font-semibold text-gray-900",children:e}),a?t.jsx("p",{className:"text-xs text-gray-500",children:a}):null]})}function u({label:e,value:a,hint:l}){return t.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white p-4 shadow-sm",children:[t.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-gray-500",children:e}),t.jsx("div",{className:"mt-1 text-2xl font-bold text-blue-700 tabular-nums",children:a}),l?t.jsx("div",{className:"mt-1 text-[11px] text-gray-500",children:l}):null]})}function b({text:e="Loading dashboard data..."}){return t.jsx("div",{className:"rounded-xl border border-gray-200 bg-white p-10 text-center shadow-sm",children:t.jsx("div",{className:"text-sm font-medium text-gray-500",children:e})})}const h=[{id:"state",header:"State",cell:({row:e})=>t.jsx("span",{className:"font-semibold text-gray-900",children:e.original.state})},{id:"properties",header:"Properties",meta:{width:"120px",align:"right"},cell:({row:e})=>t.jsx("span",{className:"tabular-nums text-gray-700",children:(Number(e.original.totalProperties)||0).toLocaleString()})},{id:"totalSqFt",header:"Total Sq Ft",meta:{width:"130px",align:"right"},cell:({row:e})=>t.jsx("span",{className:"tabular-nums text-gray-700",children:x(e.original.totalSqFt)})},{id:"availableSqFt",header:"Available Sq Ft",meta:{width:"150px",align:"right"},cell:({row:e})=>t.jsx("span",{className:"tabular-nums text-gray-700",children:x(e.original.totalAvailableSqFt)})},{id:"avgRent",header:"Avg Rent/SF",meta:{width:"130px",align:"right"},cell:({row:e})=>t.jsx("span",{className:"tabular-nums text-gray-700",children:p(e.original.avgRent)})},{id:"avgSalePrice",header:"Avg Sale Price",meta:{width:"140px",align:"right"},cell:({row:e})=>t.jsx("span",{className:"tabular-nums text-gray-700",children:p(e.original.avgSalePrice,!0)})}],v=e=>e.state;function j(){var j;const{data:y,isLoading:f}=a(),{data:N,isLoading:w}=l(),S=e.useMemo(()=>{var e;return Object.entries((null==(e=null==y?void 0:y.data)?void 0:e.versionBreakdown)||{}).map(([e,t])=>({label:e,value:Number(t)||0}))},[y]),k=e.useMemo(()=>{var e;return Object.entries((null==(e=null==y?void 0:y.data)?void 0:e.typeBreakdown)||{}).map(([e,t])=>({label:e,value:Number(t)||0})).sort((e,t)=>t.value-e.value)},[y]),A=e.useMemo(()=>{var e;const t=null==(e=null==N?void 0:N.data)?void 0:e.stateData;if(t)return t.filter(e=>(Number(e.totalProperties)||0)>0).sort((e,t)=>(Number(t.totalProperties)||0)-(Number(e.totalProperties)||0))},[N]),F=null==(j=null==y?void 0:y.data)?void 0:j.totalProperties,P=null==N?void 0:N.data;return t.jsxs("div",{className:"min-h-full bg-gradient-to-b from-slate-50 to-white px-4 py-6 sm:px-6 lg:pl-8 xl:flex-1 xl:pl-6",children:[t.jsx(d,{title:"Properties Dashboard",description:"Clean view of IndustrialIQ inventory, pricing, and state-level supply."}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("section",{className:"rounded-xl border border-gray-200 bg-white p-4 shadow-sm",children:[t.jsx(g,{title:"Properties Overview",subtitle:"Property volume, version distribution, and type breakdown."}),f?t.jsx(b,{text:"Loading property overview..."}):t.jsxs("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-[280px_1fr_280px]",children:[t.jsxs("div",{className:"rounded-lg border border-gray-100 bg-slate-50 p-4",children:[t.jsx("div",{className:"text-sm font-semibold text-gray-700",children:"Total Properties"}),t.jsx("div",{className:"mt-2 text-4xl font-bold text-blue-700 tabular-nums",children:Number(F||0).toLocaleStr
1ing()}),t.jsxs("div",{className:"mt-2 inline-flex items-center gap-1 rounded-full bg-emerald-50 px-2 py-0.5 text-xs font-semibold text-emerald-700 ring-1 ring-emerald-200",children:[t.jsx(m,{className:"h-3.5 w-3.5"}),"+5.2%"]}),t.jsxs("div",{className:"mt-4 border-t border-gray-200 pt-3",children:[t.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-gray-500",children:"Version Breakdown"}),t.jsx("div",{className:"max-h-56 space-y-1 overflow-y-auto pr-1 text-xs",children:S.length>0?S.map(e=>t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded px-2 py-1 hover:bg-white",children:[t.jsx("span",{className:"truncate text-gray-700",children:e.label}),t.jsx("span",{className:"font-semibold text-gray-900 tabular-nums",children:e.value.toLocaleString()})]},e.label)):t.jsx("div",{className:"text-gray-400",children:"No version data."})})]})]}),t.jsx("div",{className:"rounded-lg border border-gray-100 bg-white p-3",children:k.length>0?t.jsxs(s,{theme:r.clean,domainPadding:{x:18,y:8},width:780,height:290,padding:{top:12,bottom:110,left:60,right:20},children:[t.jsx(i,{style:{tickLabels:{angle:-35,fontSize:9,padding:18,fill:"#475569"},axis:{stroke:"#e2e8f0"},ticks:{stroke:"#e2e8f0",size:4}}}),t.jsx(i,{dependentAxis:!0,style:{tickLabels:{fontSize:9,fill:"#64748b"},grid:{stroke:"#f1f5f9"},axis:{stroke:"#e2e8f0"}}}),t.jsx(n,{data:k,x:"label",y:"value",labels:({datum:e})=>x(e.value),labelComponent:t.jsx(o,{dy:-3}),barWidth:16,style:{data:{fill:"#93c5fd",stroke:"#3b82f6",strokeWidth:.6},labels:{fontSize:8,fontWeight:700,fill:"#334155"}}})]}):t.jsx(b,{text:"No type breakdown data."})}),t.jsxs("div",{className:"rounded-lg border border-gray-100 bg-slate-50 p-4",children:[t.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-gray-500",children:"Type Breakdown"}),t.jsx("div",{className:"max-h-72 space-y-1 overflow-y-auto pr-1 text-sm",children:k.length>0?k.map(e=>t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded px-2 py-1.5 hover:bg-white",children:[t.jsx("span",{className:"truncate text-gray-700",children:e.label}),t.jsx("span",{className:"font-semibold text-gray-900 tabular-nums",children:e.value.toLocaleString()})]},e.label)):t.jsx("div",{className:"text-gray-400",children:"No type data."})})]})]})]}),t.jsxs("section",{children:[t.jsx(g,{title:"Key Metrics",subtitle:"Top-level supply and pricing KPIs."}),w?t.jsx(b,{text:"Loading key metrics..."}):t.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4",children:[t.jsx(u,{label:"Total Sq Ft",value:x(null==P?void 0:P.totalSqFt)}),t.jsx(u,{label:"Available Sq Ft",value:x(null==P?void 0:P.totalAvailableSqFt)}),t.jsx(u,{label:"Average Rent / Sq Ft",value:p(null==P?void 0:P.avgRent)}),t.jsx(u,{label:"Average Sale Price",value:p(null==P?void 0:P.avgSalePrice,!0)})]})]}),t.jsxs("section",{children:[t.jsx(g,{title:"State Breakdown",subtitle:"State-level property count, supply, availability, and pricing."}),t.jsx(c,{columns:h,data:A,isLoading:w,getRowId:v,minTableWidth:"48rem",emptyMessage:"No state breakdown data available."})]})]})]})}export{j 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.