1"use strict";(self.webpackChunkdiscovery_nissan=self.webpackChunkdiscovery_nissan||[]).push([[406],{406:(e,s,t)=>{t.r(s),t.d(s,{default:()=>P});var r=t(5043),a=t(2107),i=t(5371),o=t(8846),n=t(9081),d=t(6148),l=t(8659),c=t(6659),h=t(6773),x=t(8939),f=t(3109),p=t(1411),g=t(4566),m=t(108),b=t(877),j=t(7734),u=t(2185),y=t(760),w=t(3670),S=t(6805),k=t(2291),E=t(6705),v=t(7667),W=t(579);const z="#F26A1B",A="#D8480A",F="#1A1B1D",C="#5A5D63",D="#EFEEE9",L="#E6E4DE",T={tick:{fontSize:11,fill:"#8A8A88",fontFamily:"Inter"},axisLine:!1,tickLine:!1},G={contentStyle:{borderRadius:"10px",fontSize:"12px",fontFamily:"Inter",border:"none",background:"#1F1F23",color:"#fff",boxShadow:"0 10px 30px -12px rgba(0,0,0,.5)",padding:"8px 12px"},labelStyle:{color:"rgba(255,255,255,.6)",marginBottom:2},itemStyle:{color:"#fff"},cursor:{fill:"rgba(242,106,27,.06)",stroke:"rgba(242,106,27,.25)"}},R=e=>{let{data:s,height:t}=e;return(0,W.jsx)(m.u,{width:"100%",height:t,children:(0,W.jsxs)(b.Q,{data:s,margin:{top:10,right:8,left:0,bottom:0},children:[(0,W.jsx)("defs",{children:(0,W.jsxs)("linearGradient",{id:"purchasedGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,W.jsx)("stop",{offset:"5%",stopColor:z,stopOpacity:.28}),(0,W.jsx)("stop",{offset:"95%",stopColor:z,stopOpacity:0})]})}),(0,W.jsx)(j.d,{vertical:!1,horizontal:!0,stroke:"rgba(0,0,0,.06)"}),(0,W.jsx)(u.W,{dataKey:"day",...T,dy:6}),(0,W.jsx)(y.h,{...T,domain:[0,"auto"],width:38,allowDecimals:!1}),(0,W.jsx)(w.m,{...G,formatter:e=>[`${e} cars`,"Purchased"]}),(0,W.jsx)(S.Gk,{type:"monotone",dataKey:"value",stroke:z,strokeWidth:2.5,fill:"url(#purchasedGrad)",dot:{r:3.5,fill:"#fff",stroke:z,strokeWidth:2},activeDot:{r:6,fill:z,stroke:"#fff",strokeWidth:2}})]})})},I=e=>{let{data:s,height:t}=e;return(0,W.jsx)(m.u,{width:"100%",height:t,children:(0,W.jsxs)(k.E,{data:s,margin:{top:10,right:8,left:0,bottom:0},children:[(0,W.jsx)("defs",{children:(0,W.jsxs)("linearGradient",{id:"addedGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,W.jsx)("stop",{offset:"0%",stopColor:"#FF8A3D"}),(0,W.jsx)("stop",{offset:"100%",stopColor:A})]})}),(0,W.jsx)(j.d,{vertical:!1,horizontal:!0,stroke:"rgba(0,0,0,.06)"}),(0,W.jsx)(u.W,{dataKey:"day",...T,dy:6}),(0,W.jsx)(y.h,{...T,domain:[0,"auto"],width:38,allowDecimals:!1}),(0,W.jsx)(w.m,{...G,formatter:e=>[`${e} cars`,"Added"]}),(0,W.jsx)(E.y,{dataKey:"value",fill:"url(#addedGrad)",radius:[6,6,0,0],maxBarSize:38})]})})},B=e=>{let{title:s,accent:t,children:r,isLoading:h,isError:x}=e;return(0,W.jsx)(a.a,{flex:"1",minW:0,children:(0,W.jsxs)(a.a,{bg:"white",borderRadius:"20px",border:"1px solid",borderColor:L,boxShadow:"0 1px 2px rgba(0,0,0,.04), 0 24px 60px -35px rgba(26,27,29,.35)",overflow:"hidden",transition:"transform 0.25s ease, box-shadow 0.25s ease",_hover:{transform:"translateY(-4px)",boxShadow:"0 1px 2px rgba(0,0,0,.04), 0 30px 55px -28px rgba(26,27,29,.4)"},children:[(0,W.jsxs)(i.s,{align:"center",justify:"space-between",px:{base:4,md:6},pt:{base:4,md:6},pb:4,gap:3,children:[(0,W.jsxs)(a.a,{minW:0,children:[(0,W.jsx)(o.D,{fontFamily:"'Archivo', sans-serif",fontSize:{base:"md",sm:"lg",md:"xl"},fontWeight:"700",letterSpacing:"-0.01em",color:F,noOfLines:2,children:s}),(0,W.jsx)(n.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Mon \u2013 Sun"})]}),(0,W.jsxs)(d.z,{spacing:2,flexShrink:0,bg:"blackAlpha.50",borderRadius:"full",px:3,py:1.5,children:[(0,W.jsx)(a.a,{w:"7px",h:"7px",borderRadius:"full",bg:t}),(0,W.jsx)(n.E,{fontSize:"xs",fontWeight:"600",color:"gray.600",children:"This week"})]})]}),(0,W.jsx)(a.a,{px:{base:2,md:4},pb:{base:4,md:6},children:h?(0,W.jsx)(l.o,{height:"220px",children:(0,W.jsx)(c.y,{color:z,size:"lg",thickness:"3px"})}):x?(0,W.jsx)(l.o,{height:"220px",children:(0,W.jsx)(n.E,{color:"red.400",fontSize:"sm",children:"Failed to load data. Please try again."})}):r})]})})};function P(){const[e,s]=(0,r.useState)(0),t=(0,h.A)({base:!0,md:!1}),l=(0,h.A)({base:220,sm:260,md:320}),[c,m]=(0,r.useState)([]),[b,j]=(0,r.useState)([]),[u,y]=(0,r.useState)(!0),[w,S]=(0,r.useState)(!0),[k,E]=(0,r.useState)(!1),[T,G]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{(async()=>{try{y(!0),E(!1);const e=await(0,v.nB)();m(e)}catch(e){console.error("Error fetching weekly purchases:",e),E(!0)}finally{y(!1)}})()}),[]),(0,r.useEffect)((()=>{(async()=>{try{S(!0),G(!1);const e=await(0,v.vv)();j(e)}catch(e){console.error("Error fetching weekly cars added:",e),G(!0)}finally{S(!1)}})()}),[]),(0,W.jsx)(a.a,{position:"relative",overflow:"hidden",bg:D,px:{base:6,sm:6,md:10},py:{base:14,sm:14,md:20},children:(0,W.jsxs)(x.m,{maxW:"1280px",px:0,position:"relative",children:[(0,W.jsxs)(a.a,{mb:{base:8,md:12},children:[(0,W.jsxs)(d.z,{spacing:2.5,mb:4,children:[(0,W.jsx)(a.a,{w:"26px",h:"2px",bg:z}),(0,W.jsx)(n.E,{fontFamily:"'Inter', sans-serif",fontSize:"xs",fontWeight:"600",letterSpacing:"0.2em",textTransform:"uppercase",color:A,children:"This Week"})]}),(0,W.jsx)(o.D,{fontFamily:"'Archivo', sans-serif",fontSize:{base:"4xl",md:"5xl"},fontWeight:"800",letterSpacing:"-0.02em",lineHeight:"1.02",color:F,children:"This week at a glance"}),(0,W.jsx)(n.E,{mt:4,fontFamily:"'Inter', sans-serif",fontSize:{base:"md",md:"lg"},color:C,lineHeight:"1.55",maxW:"560px",children:"Live movement across your lot \u2014 what came in, and what went out."})]}),t?(0,W.jsxs)(a.a,{children:[(0,W.jsx)(f.t,{index:e,onChange:s,variant:"unstyled",mb:5,children:(0,W.jsxs)(p.w,{bg:"white",border:"1px solid",borderColor:L,borderRadius:"full",p:"4px",display:"inline-flex",boxShadow:"sm",children:[(0,W.jsx)(g.o,{fontFamily:"Inter",fontSize:"sm",fontWeight:"600",color:C,borderRadius:"full",px:5,py:2,_selected:{bg:z,color:"white"},transition:"all 0.2s",children:"Purchased"}),(0,W.jsx)(g.o,{fontFamily:"Inter",fontSize:"sm",fontWeight:"600",color:C,borderRadius:"full",px:5,py:2,_selected:{bg:z,color:"white"},transition:"all 0.2s",children:"Added"})]})}),0===e?(0,W.jsx)(B,{title:"Cars Purchased This Week",accent:z,isLoading:u,isError:k,children:(0,W.jsx)(R,{data:c,height:l})}):(0,W.jsx)(B,{title:"Cars Added This Week",accent:A,isLoading:w,isError:T,children:(0,W.jsx)(I,{data:b,height:l})})]}):(0,W.jsxs)(i.s,{direction:"row",gap:{md:6,lg:6},align:"stretch",children:[(0,W.jsx)(B,{title:"Cars Purchased This Week",accent:z,isLoading:u,isError:k,children:(0,W.jsx)(R,{data:c,height:l})}),(0,W.jsx)(B,{title:"Cars Added This Week",accent:A,isLoading:w,isError:T,children:(0,W.jsx)(I,{data:b,height:l})})]})]})})}}}]); 2//# sourceMappingURL=406.368094ac.chunk.js.map
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.