PageSourceSearch

https://www.exodushc.com/_next/static/chunks/pages/dashboard-5300f2125dfc1317.js

js exodushc.com collected 2026-09-26 10:03:41 UTC 11,463 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9724],{35110:(e,a,r)=>{"use strict";r.d(a,{A:()=>t});var t=(0,r(69255).A)("dots-vertical","IconDotsVertical",[["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]])},59522:(e,a,r)=>{"use strict";r.r(a),r.d(a,{__N_SSP:()=>C,default:()=>S});var t=r(23798),s=r(21462),n=r(62559),l=r(47720),o=r(78140),i=r(51793),c=r(78105),d=r(4813),p=r(35516),u=r(39197),x=r(17847),g=r(54575),h=r(75069),m=r(71252),f=r(51312),b=r(31395),j=r(14659);let y=e=>(0,g.GZ)(e)||"\uD83D\uDCB0",v=(0,o.r)(e=>({pageHeader:{marginBottom:"24px"},titleRow:{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"16px"},pageTitle:{fontSize:"22px",fontWeight:700,color:"var(--title, #1f2937)",[e.fn.largerThan("md")]:{fontSize:"26px"}},pageSubtitle:{fontSize:"14px",color:"var(--body, #6b7280)"},statsGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"12px",marginBottom:"24px",[e.fn.largerThan("md")]:{gridTemplateColumns:"repeat(4, 1fr)",gap:"16px"}},statCard:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"var(--portal-radius, 8px)",padding:"16px"},statLabel:{fontSize:"11px",color:"var(--body, #6b7280)",marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.5px",fontWeight:500},statValue:{fontSize:"22px",fontWeight:700,color:"var(--portal-primary, #1f2937)",[e.fn.largerThan("md")]:{fontSize:"26px"}},statSubtext:{fontSize:"12px",color:"var(--body, #9ca3af)",marginTop:"2px"},currencySelector:{display:"flex",alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"6px",cursor:"pointer",transition:"background-color 0.2s","&:hover":{backgroundColor:"#f3f4f6"}},currencyFlag:{fontSize:"18px",lineHeight:1},currencyCode:{fontSize:"12px",fontWeight:600,color:"var(--body, #6b7280)"},orderCurrencyFlag:{fontSize:"14px",marginRight:"4px"},section:{marginBottom:"24px"},sectionHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},sectionTitle:{fontSize:"16px",fontWeight:600,color:"var(--title, #1f2937)"},viewAllLink:{fontSize:"14px",color:"var(--portal-primary, #000000)",cursor:"pointer",fontWeight:500,"&:hover":{textDecoration:"underline"}},ordersList:{display:"flex",flexDirection:"column",gap:"6px"},quoteCard:{backgroundColor:"#ffffff",borderRadius:"var(--portal-radius, 8px)",padding:"16px",border:"1px solid #e5e7eb",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",transition:"border-color 0.2s","&:hover":{borderColor:"var(--portal-primary, #000000)"}},quoteInfo:{flex:1},quoteNumber:{fontSize:"14px",fontWeight:600,color:"var(--title, #1f2937)",marginBottom:"4px"},quoteDate:{fontSize:"12px",color:"var(--body, #6b7280)"},quoteAmount:{fontSize:"16px",fontWeight:600,color:"var(--title, #1f2937)",textAlign:"right"},quoteBadge:{display:"inline-block",padding:"2px 8px",borderRadius:"12px",fontSize:"11px",fontWeight:500,textTransform:"capitalize"},badgePending:{backgroundColor:"#fef3c7",color:"#92400e"},badgeAccepted:{backgroundColor:"#d1fae5",color:"#065f46"},badgeRejected:{backgroundColor:"#fee2e2",color:"#991b1b"},badgeExpired:{backgroundColor:"#f3f4f6",color:"#6b7280"},loadingContainer:{minHeight:"200px",display:"flex",alignItems:"center",justifyContent:"center"},errorContainer:{textAlign:"center",padding:"40px 20px",backgroundColor:"#ffffff",borderRadius:"var(--portal-radius-lg, 12px)",border:"1px solid #e5e7eb"},emptySection:{backgroundColor:"#ffffff",borderRadius:"var(--portal-radius, 8px)",padding:"24px",textAlign:"center",border:"1px solid #e5e7eb"},emptyText:{color:"var(--body, #6b7280)",fontSize:"14px"}})),N=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});var C=!0;function S(e){var a,r;let{educator_details:o,websiteSettings:g}=e,{classes:C}=v(),S=(0,n.useRouter)(),[E,k]=(0,s.useState)(null),{data:w,error:_,isLoading:T}=(0,b.rv)(),{data:z,error:O,isLoading:q}=(0,b.Nk)();(0,s.useEffect)(()=>{(0,l.getCookie)("token")||S.replace("/auth/login?redirect=/dashboard")},[S]);let A=(null==w?void 0:w.orders)||[],L=(null==z?void 0:z.quotes)||[],D=(0,s.useMemo)(()=>{let e={};A.forEach(a=>{var r,t;let s=a.customer_payment,n=(null==s?void 0:s.total)||(null==(r=a.amount)?void 0:r.total)||a.total_amount||0,l=((null==s?void 0:s.currency)||(null==(t=a.amount)?void 0:t.currency)||a.currency||"USD").toUpperCase();e[l]=(e[l]||0)+n});let a=Object.keys(e),r=a.length>0?a[0]:"USD",t=A.filter(e=>"pending"===e.status||"processing"===e.status).length,s=A.filter(e=>"shipped"===e.status||"in_transit"===e.status).length,n=A.filter(e=>"delivered"===e.status||"completed"===e.status).length,l=L.filter(e=>"sent"===e.status||"viewed"===e.status).length;return{spendByCurrency:e,currencies:a,defaultCurrency:r,totalOrders:A.length,pendingOrders:t,shippedOrders:s,deliveredOrders:n,totalQuotes:L.length,pendingQuotes:l}},[A,L]);(0,s.useEffect)(()=>{!E&&D.defaultCurrency&&k(D.defaultCurrency)},[D.defaultCurrency,E]);let R=E||D.defaultCurrency||"USD",W=D.spendByCurrency[R]||0,I=A.slice(0,5),B=L.slice(0,5),P="enterprise"===(null==o||null==(r=o.educator_portfolio)||null==(a=r.educator_pricing_plan)?void 0:a.toLowerCase());return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.e,{title:"Dashboard"}),(0,t.jsxs)(f.ty,{educator_details:o,websiteSettings:g,pageTitle:"Dashboard",isLoggedIn:!0,showNav:!0,children:[(0,t.jsx)(i.a,{className:C.pageHeader,children:(0,t.jsxs)(i.a,{className:C.titleRow,children:[(0,t.jsx)(m.E,{className:C.pageTitle,children:"Dashboard"}),(0,t.jsxs)(m.E,{className:C.pageSubtitle,children:["Welcome back! Here's an overview of your account with"," ",(null==o?void 0:o.educator_name)||"this business"]})]})}),T||q?(0,t.jsx)(i.a,{className:C.loadingContainer,children:(0,t.jsx)(c.a,{size:"lg",color:"var(--portal-primary)"})}):_||O?(0,t.jsxs)(i.a,{className:C.errorContainer,children:[(0,t.jsx)(m.E,{size:"lg",weight:600,color:"red",children:"Failed to load dashboard data"}),(0,t.jsx)(m.E,{color:"dimmed",mt:"sm",children:"Please try refreshing the page"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(i.a,{className:C.statsGrid,children:[(0,t.jsxs)(i.a,{className:C.statCard,children:[(0,t.jsxs)(d.Y,{position:"apart",mb:4,children:[(0,t.jsx)(m.E,{className:C.statLabel,children:"Total Spend"}),D.currencies.length>1?(0,t.jsxs)(p.W,{shadow:"md",width:140,children:[(0,t.jsx)(p.W.Target,{children:(0,t.jsxs)(u.N,{className:C.currencySelector,children:[(0,t.jsx)("span",{className:C.currencyFlag,children:y(R)}),(0,t.jsx)("span",{className:C.currencyCode,children:R}),(0,t.jsx)(x.A,{size:14,color:"#6b7280"})]})}),(0,t.jsx)(p.W.Dropdown,{children:D.currencies.map(e=>(0,t.jsx)(p.W.Item,{onClick:()=>k(e),sx:{fontWeight:e===R?600:400},children:(0,t.jsxs)(d.Y,{spacing:8,children:[(0,t.jsx)("span",{children:y(e)}),(0,t.jsx)("span",{children:e})]})},e))})]}):(0,t.jsxs)(i.a,{className:C.currencySelector,sx:{cursor:"default","&:hover":{backgroundColor:"transparent"}},children:[(0,t.jsx)("span",{className:C.currencyFlag,children:y(R)}),(0,t.jsx)("span",{className:C.currencyCode,children:R})]})]}),(0,t.jsx)(m.E,{className:C.statValue,children:(0,j.$g)(W,R)})]}),(0,t.jsxs)(i.a,{className:C.statCard,children:[(0,t.jsx)(m.E,{className:C.statLabel,children:"Orders"}),(0,t.jsx)(m.E,{className:C.statValue,children:D.totalOrders}),(0,t.jsxs)(m.E,{className:C.statSubtext,children:[D.pendingOrders," pending"]})]}),P&&(0,t.jsxs)(i.a,{className:C.statCard,children:[(0,t.jsx)(m.E,{className:C.statLabel,children:"Quotes"}),(0,t.jsx)(m.E,{className:C.statValue,children:D.totalQuotes}),(0,t.jsxs)(m.E,{className:C.statSubtext,children:[D.pendingQuotes," awaiting response"]})]}),(0,t.jsxs)(i.a,{className:C.statCard,children:[(0,t.jsx)(m.E,{className:C.statLabel,children:"Delivered"}),(0,t.jsx)(m.E,{className:C.statValue,children:D.deliveredOrders}),(0,t.jsxs)(m.E,{className:C.statSubtext,children:[D.shippedOrders," in transit"]})]})]}),(0,t.jsxs)(i.a,{className:C.section,children:[(0,t.jsxs)(i.a,{className:C.sectionHeader,children:[(0,t.jsx)(m.E,{className:C.sectionTitle,children:"Recent Orders"}),I.length>0&&(0,t.jsx)(m.E,{className:C.viewAllLink,onClick:()=>S.push("/orders"),children:"View all"})]}),0===I.length?(0,t.jsx)(i.a,{className:C.emptySection,children:(0,t.jsx)(m.E,{className:C.emptyText,children:"No orders yet"})}):(0,t.jsx)(i.a,{className:C.ordersList,children:I.map(e=>e&&e.id?(0,t.jsx)(f.BK,{order:e},e.id):null)})]}),P&&(0,t.jsxs)(i.a,{className:C.section,children:[(0,t.jsxs)(i.a,{className:C.sectionHeader,children:[(0,t.jsx)(m.E,{className:C.sectionTitle,children:"Recent Quotes"}),B.length>0&&(0,t.jsx)(m.E,{className:C.viewAllLink,onClick:()=>S.push("/quotes"),children:"View all"})]}),0===B.length?(0,t.jsx)(i.a,{className:C.emptySection,children:(0,t.jsx)(m.E,{className:C.emptyText,children:"No quotes yet"})}):(0,t.jsx)(i.a,{className:C.ordersList,children:B.map(e=>(0,t.jsxs)(i.a,{className:C.quoteCard,onClick:()=>S.push("/quotes/".concat(e.id)),children:[(0,t.jsxs)(i.a,{className:C.quoteInfo,children:[(0,t.jsx)(m.E,{className:C.quoteNumber,children:e.quote_number}),(0,t.jsxs)(m.E,{className:C.quoteDate,children:[N(e.createdAt),e.valid_until&&(0,t.jsxs)(t.Fragment,{children:[" \xb7 Valid until ",N(e.valid_until)]})]})]}),(0,t.jsxs)(i.a,{children:[(0,t.jsxs)(m.E,{className:C.quoteAmou
1nt,children:[(0,t.jsx)("span",{style:{marginRight:"4px"},children:y(e.currency)}),(0,j.$g)(e.total_amount,e.currency)]}),(0,t.jsx)(i.a,{style:{textAlign:"right",marginTop:"4px"},children:(0,t.jsx)("span",{className:"".concat(C.quoteBadge," ").concat(((e,a)=>{switch(e){case"sent":case"viewed":return a.badgePending;case"accepted":return a.badgeAccepted;case"rejected":return a.badgeRejected;case"expired":return a.badgeExpired;default:return""}})(e.status,C)),children:"sent"===e.status||"viewed"===e.status?"Pending":e.status})})]})]},e.id))})]})]})]})]})}},75832:(e,a,r)=>{"use strict";r.d(a,{o:()=>g});var t=r(21462),s=r(52447),n=r(86767),l=(0,r(78140).r)((e,{inline:a})=>({root:{display:a?"inline-flex":"flex",alignItems:"center",justifyContent:"center"}})),o=r(51793),i=Object.defineProperty,c=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,u=(e,a,r)=>a in e?i(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r;let x=(0,t.forwardRef)((e,a)=>{let r=(0,s.a1)("Center",{},e),{inline:n,className:i,unstyled:x,variant:g}=r,h=((e,a)=>{var r={};for(var t in e)d.call(e,t)&&0>a.indexOf(t)&&(r[t]=e[t]);if(null!=e&&c)for(var t of c(e))0>a.indexOf(t)&&p.call(e,t)&&(r[t]=e[t]);return r})(r,["inline","className","unstyled","variant"]),{classes:m,cx:f}=l({inline:n},{name:"Center",unstyled:x,variant:g});return t.createElement(o.a,((e,a)=>{for(var r in a||(a={}))d.call(a,r)&&u(e,r,a[r]);if(c)for(var r of c(a))p.call(a,r)&&u(e,r,a[r]);return e})({ref:a,className:f(m.root,i)},h))});x.displayName="@mantine/core/Center";let g=(0,n.K)(x)},91949:(e,a,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard",function(){return r(59522)}])},99766:(e,a,r)=>{"use strict";r.d(a,{A:()=>t});var t=(0,r(69255).A)("logout","IconLogout",[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]])}},e=>{e.O(0,[1312,4611,636,6593,8792],()=>e(e.s=91949)),_N_E=e.O()}]);

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.