1"use strict";(self.webpackChunkdiscovery_nissan=self.webpackChunkdiscovery_nissan||[]).push([[8109],{502:(e,t,s)=>{s.d(t,{d:()=>d});var r=s(5043),o=s(610),n=s(6827);function a(e,t){const s=e??"bottom",r={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[s];return r?.[t]??s}var i=s(482);var c=s(2325),l=s(6448);function d(e){const{theme:t}=(0,l.UQ)(),s=(0,c.NU)();return(0,r.useMemo)((()=>function(e,t){const s=s=>({...t,...s,position:a(s?.position??t?.position,e)}),r=e=>{const t=s(e),r=(0,n.q)(t);return i.Z.notify(r,t)};return r.update=(e,t)=>{i.Z.update(e,s(t))},r.promise=(e,t)=>{const s=r({...t.loading,status:"loading",duration:null});e.then((e=>r.update(s,{status:"success",duration:5e3,...(0,o.J)(t.success,e)}))).catch((e=>r.update(s,{status:"error",duration:5e3,...(0,o.J)(t.error,e)})))},r.closeAll=i.Z.closeAll,r.close=i.Z.close,r.isActive=i.Z.isActive,r}(t.direction,{...s,...e})),[e,t.direction,s])}},8109:(e,t,s)=>{s.r(t),s.d(t,{default:()=>x});var r=s(502),o=s(8939),n=s(8846),a=s(5371),i=s(6659),c=s(9081),l=s(9904),d=s(2107),u=s(7139),f=s(2459),m=s(5043),p=s(4443),h=s(7667),g=s(579);const x=()=>{const e=p.A.checkForToken(),t=(0,r.d)(),[s,x]=(0,m.useState)([]),[v,b]=(0,m.useState)(!0);(0,m.useEffect)((()=>{if(!e)return void t({title:"Authorization failed",description:"Unable to fetch contact messages.",status:"error",duration:3e3,isClosable:!0});(async()=>{try{const t=await(0,h.E_)(e);x(t.messages)}catch{t({title:"Failed to load messages",description:"Unable to fetch contact messages.",status:"error",duration:3e3,isClosable:!0})}finally{b(!1)}})()}),[t,e]);const j=(0,m.useRef)(s);return(0,m.useEffect)((()=>{j.current=s}),[s]),(0,m.useEffect)((()=>()=>{if(!e)return;const t=(j.current||[]).filter((e=>!e.is_read)).map((e=>e.id));t.length>0&&(0,h.Yf)(t,e).catch((()=>{}))}),[e]),(0,g.jsxs)(o.m,{maxW:"container.lg",py:8,children:[(0,g.jsx)(n.D,{size:"lg",mb:6,children:"Contact Messages"}),v?(0,g.jsx)(a.s,{justify:"center",mt:20,children:(0,g.jsx)(i.y,{size:"xl"})}):0===s.length?(0,g.jsx)(c.E,{color:"gray.500",children:"No messages found."}):(0,g.jsx)(l.B,{spacing:4,children:s.map((e=>{var t,s,r,o;return(0,g.jsxs)(d.a,{p:4,bg:"white",borderRadius:"md",boxShadow:"sm",overflow:"hidden",cursor:"pointer",opacity:e.is_read?.6:1,filter:e.is_read?"blur(0.6px)":"none",transition:"all 0.2s ease",onClick:()=>{return!e.is_read&&(t=e.id,void x((e=>e.map((e=>e.id===t?{...e,is_read:!0}:e)))));var t},children:[(0,g.jsxs)(a.s,{justify:"space-between",align:"center",wrap:"wrap",gap:2,children:[(0,g.jsxs)(a.s,{gap:2,align:"center",children:[(0,g.jsx)(u.E,{colorScheme:"developer"===e.contact_for?"blue":"green",children:e.contact_for}),!e.is_read&&(0,g.jsx)(u.E,{colorScheme:"red",children:"NEW"})]}),(0,g.jsx)(c.E,{fontSize:"sm",color:"gray.500",children:new Date(e.createdAt).toLocaleString()})]}),(0,g.jsx)(f.c,{my:3}),(0,g.jsx)(c.E,{color:"gray.700",whiteSpace:"pre-wrap",children:e.message}),(0,g.jsxs)(c.E,{mt:3,fontSize:"sm",color:"gray.500",children:["User: ",null===(t=e.user)||void 0===t||null===(s=t.profile)||void 0===s?void 0:s.first_name," ",null===(r=e.user)||void 0===r||null===(o=r.profile)||void 0===o?void 0:o.last_name]})]},e.id)}))})]})}},8846:(e,t,s)=>{s.d(t,{D:()=>l});var r=s(579),o=s(3033),n=s(4765),a=s(5003),i=s(5158),c=s(7971);const l=(0,a.R)((function(e,t){const s=(0,i.V)("Heading",e),{className:a,...l}=(0,o.M)(e);return(0,r.jsx)(c.B.h2,{ref:t,className:(0,n.cx)("chakra-heading",e.className),...l,__css:s})}));l.displayName="Heading"},8939:(e,t,s)=>{s.d(t,{m:()=>l});var r=s(579),o=s(3033),n=s(4765),a=s(5003),i=s(5158),c=s(7971);const l=(0,a.R)((function(e,t){const{className:s,centerContent:a,...l}=(0,o.M)(e),d=(0,i.V)("Container",e);return(0,r.jsx)(c.B.div,{ref:t,className:(0,n.cx)("chakra-container",s),...l,__css:{...d,...a&&{display:"flex",flexDirection:"column",alignItems:"center"}}})}));l.displayName="Container"}}]); 2//# sourceMappingURL=8109.13cb7810.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.