PageSourceSearch

https://aivana.com/_next/static/chunks/pages/dashboard-df6ff879b894326f.js

js aivana.com collected 2026-10-07 04:04:26 UTC 12,975 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9724],{16717:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>E});var n=r(37876),o=r(89099),s=r.n(o),i=r(14232),a=r(89848),l=r(43233),c=r(49034),d=r(67268),p=r(58475),u=r(48230),x=r.n(u),h=r(46520),m=r(90964),_=r(94527),g=r(61428),y=r(11054),f=r(32643),A=r(6796),b=r(95065),j=r(41072),w=r(93616);let S=({user:e,showProfileDropdown:t,setShowProfileDropdown:r})=>{let o=(0,b.j)(),i=async e=>{try{let t=await d.apiClient.post("/api/v1/auth/signout",{access_token:e});return sessionStorage.clear(),document.cookie.split(";").forEach(e=>{let t=e.split("=")[0].trim();document.cookie=`${t}=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/;`}),t}catch(e){return{message:e.message}}},a=async()=>{try{let e=(0,w.getCookie)("auth_token");r(!1),e&&await i(e),(0,w.deleteCookie)("auth_token"),(0,w.deleteCookie)("auth_token"),(0,w.deleteCookie)("auth_refresh_token"),localStorage.removeItem("user"),await o((0,A.y4)()),sessionStorage.setItem("openSigninPopup","true"),s().push("/")}catch(e){console.error("Logout error:",e),await o((0,A.y4)()),r(!1),sessionStorage.setItem("openSigninPopup","true"),s().push("/")}};return(0,n.jsx)(h.A,{component:"header",sx:{paddingTop:10,backgroundColor:j.A.palette.background.paper,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},children:(0,n.jsxs)(m.A,{maxWidth:"lg",sx:{px:{xs:2,sm:3,lg:4},py:2,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsxs)(h.A,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(h.A,{children:(0,n.jsx)(x(),{href:"/",legacyBehavior:!0,children:(0,n.jsx)(_.A,{sx:{backgroundColor:j.A.palette.grey[100],width:40,height:40,color:j.A.palette.text.secondary,"&:hover":{backgroundColor:j.A.palette.grey[200]}},children:(0,n.jsx)(p.OLK,{size:20})})})}),(0,n.jsx)(g.A,{component:"h1",sx:{fontSize:"1.25rem",marginTop:.5,fontWeight:600,color:j.A.palette.text.primary},children:"User Profile"})]}),(0,n.jsxs)(h.A,{sx:{position:"relative"},onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[(0,n.jsx)(h.A,{sx:{display:"flex",alignItems:"center"},children:(0,n.jsx)(h.A,{sx:{position:"relative",marginRight:2},children:(0,n.jsx)(h.A,{component:"label",sx:{cursor:"pointer",display:"block",position:"relative"},children:(0,n.jsx)(h.A,{sx:{height:40,width:40,borderRadius:"50%",overflow:"hidden",backgroundColor:j.A.palette.grey[200],display:"flex",alignItems:"center",justifyContent:"center"},children:e?.picture||e?.profile?(0,n.jsx)(h.A,{component:"img",src:e?.picture||e?.profile,alt:e?.first_name||"User",sx:{height:"100%",width:"100%",objectFit:"cover"}}):(0,n.jsx)(h.A,{sx:{height:"100%",width:"100%",backgroundColor:j.A.palette.primary.main,paddingTop:.75,display:"flex",alignItems:"center",justifyContent:"center",color:j.A.palette.common.white},children:e?.email?.charAt(0).toUpperCase()})})})})}),t&&(0,n.jsx)(y.A,{sx:{position:"absolute",right:0,width:192,borderRadius:1,boxShadow:j.A.shadows[4],border:`1px solid ${j.A.palette.divider}`,zIndex:50},children:(0,n.jsxs)(h.A,{sx:{py:.5},children:[(0,n.jsx)(x(),{href:"/dashboard",legacyBehavior:!0,children:(0,n.jsxs)(f.A,{component:"a",sx:{px:2,py:1,fontSize:"0.875rem",color:j.A.palette.text.secondary,display:"flex",alignItems:"center",width:"100%",justifyContent:"flex-start",textTransform:"none","&:hover":{backgroundColor:j.A.palette.grey[100]}},children:[(0,n.jsx)(p.PY8,{style:{marginRight:8}})," Profile"]})}),(0,n.jsxs)(f.A,{onClick:async e=>{e.stopPropagation(),r(!1),await a()},sx:{px:2,py:1,fontSize:"0.875rem",color:j.A.palette.text.secondary,display:"flex",alignItems:"center",width:"100%",justifyContent:"flex-start",textTransform:"none","&:hover":{backgroundColor:j.A.palette.grey[100]}},children:[(0,n.jsx)(p.AMx,{style:{marginRight:8}}),"Sign out"]})]})})]})]})})};var v=r(58824);r(5148);var C=r(13085),k=r(65965),z=r(85549);function E(){let e;let t=(0,o.useRouter)(),{user:r}=(0,b.G)(e=>e.auth),s=(0,b.j)(),[d,p]=(0,i.useState)(!1),[u]=(0,i.useState)(!1),[x,_]=(0,i.useState)(null),[,w]=(0,i.useState)(null),[E,P]=(0,i.useState)({first_name:r?.first_name||"",last_name:r?.last_name||"",email:r?.email||"",mobile_cell_phone:r?.mobile_cell_phone||"",user_location:r?.user_location||"",country:r?.country||"",country_timezone:r?.country_timezone||"",user_role:Array.isArray(r?.user_role)?r?.user_role:[],industry_focu
1s:Array.isArray(r?.industry_focus)?r?.industry_focus:[],career_stage:r?.career_stage||"",user_interest:r?.user_interest||"",privacy_policy_consent:r?.privacy_policy_consent||!1,terms_and_conditions_consent:r?.terms_and_conditions_consent||!1,text_opt_in:r?.text_opt_in||!1,subscription_plan:r?.subscription_plan||"",subscription_intent:r?.subscription_intent||"",file:r?.file||null,onboarding_completed:r?.onboarding_completed||!1}),[,F]=(0,i.useState)(""),[,I]=(0,i.useState)([]),[T,U]=(0,i.useState)(!1),W=(0,i.useRef)(null),R=e=>{try{let t=c.Md(e);if(!t)return e;let r=t.utcOffsetStr;return e.split("/").pop()?.replace("_"," "),`${e} ${r}`}catch(t){return e}};(0,i.useEffect)(()=>{if(E.country){let e=D.find(e=>e.value===E.country);I(e?.timezones.map(e=>e.value)||[]),F(e?.timezones[0].value||"")}},[E.country]),(0,i.useEffect)(()=>{P({first_name:r?.first_name||"",last_name:r?.last_name||"",email:r?.email||"",mobile_cell_phone:r?.mobile_cell_phone||"",user_location:r?.user_location||"",country:r?.country||"",country_timezone:r?.country_timezone||"",user_role:Array.isArray(r?.user_role)?r?.user_role:[],industry_focus:Array.isArray(r?.industry_focus)?r?.industry_focus:[],career_stage:r?.career_stage||"",user_interest:r?.user_interest||"",privacy_policy_consent:r?.privacy_policy_consent||!1,terms_and_conditions_consent:r?.terms_and_conditions_consent||!1,text_opt_in:r?.text_opt_in||!1,subscription_plan:r?.subscription_plan||"",subscription_intent:r?.subscription_intent||"",file:r?.file||null,onboarding_completed:r?.onboarding_completed||!1})},[r]),(0,i.useEffect)(()=>{(async()=>{r||s((0,A.loadUserFromToken)())})()},[s,r]),(0,i.useEffect)(()=>{let e=e=>{W.current&&!W.current.contains(e.target)&&U(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);let D=Object.values(c.oj()).map(e=>({value:e.id,label:e.name,timezones:e.timezones.map(e=>({value:e,label:R(e)}))})),$=e=>{if(!e)return"--";try{let t="string"==typeof e?parseInt(e):e;return new Date(1e3*t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(t){return String(e)}},L=async()=>{try{p(!0),await v.X.getCustomerPortalLink()}catch(e){console.error("Purchase failed:",e)}finally{p(!1)}};return(0,n.jsx)(l.A,{children:(0,n.jsxs)(h.A,{sx:{minHeight:"100vh",backgroundColor:j.A.palette.grey[50]},children:[(0,n.jsx)(S,{user:r,imagePreview:x,isUpdatingPhoto:u,showProfileDropdown:T,setShowProfileDropdown:U,handleImageChange:e=>{if(!e.target.files||0===e.target.files.length)return;let t=e.target.files[0];if(t.size>5242880){a.oR.error("File size must be less than 5MB");return}let r=new FileReader;r.onloadend=()=>{_(r.result),w(t)},r.readAsDataURL(t)}}),(0,n.jsxs)(m.A,{component:"main",maxWidth:"lg",sx:{px:{xs:2,sm:3,lg:4},py:4},children:[(0,n.jsx)(y.A,{sx:{backgroundColor:j.A.palette.background.paper,borderRadius:2,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",border:`1px solid ${j.A.palette.divider}`,overflow:"hidden",mb:3},children:(0,n.jsxs)(h.A,{sx:{p:3},children:[(0,n.jsxs)(g.A,{component:"h1",variant:"h4",sx:{fontWeight:600,color:j.A.palette.text.primary},children:["Welcome, ",r?.given_name||r?.email,"!"]}),(0,n.jsx)(g.A,{sx:{mt:.5,fontSize:"0.875rem",color:j.A.palette.text.secondary},children:"You're signed in and can access your dashboard."})]})}),(0,n.jsxs)(h.A,{sx:{display:"flex",flexDirection:"column",gap:3},children:[r?.subscription_plan&&(0,n.jsxs)(y.A,{sx:{backgroundColor:j.A.palette.background.paper,borderRadius:2,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",border:`1px solid ${j.A.palette.divider}`,overflow:"hidden"},children:[(0,n.jsx)(h.A,{sx:{px:3,py:2.5,borderBottom:`1px solid ${j.A.palette.divider}`},children:(0,n.jsx)(g.A,{variant:"h6",sx:{fontWeight:500,color:j.A.palette.text.primary},children:"Subscription Status"})}),(0,n.jsxs)(h.A,{sx:{px:3,py:2.5},children:[(0,n.jsxs)(h.A,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"1fr 1fr"},gap:3},children:[(0,n.jsx)(h.A,{sx:{display:"flex",alignItems:"center"},children:(0,n.jsxs)(h.A,{sx:{ml:2},children:[(0,n.jsx)(g.A,{component:"dt",sx:{fontSize:"0.875rem",fontWeight:500,color:j.A.palette.text.secondary},children:"Plan Status"}),(0,n.jsx)(C.A,{label:`${r?.subscription_plan||"undefined"} Plan`,sx:{mt:.5,fontSize:"0.875rem",px:.5,py:.25,...r?.subscription_plan==="active"&&{color:"#2E7D32",backgroundColor:"#E8F5E8"},...r?.subscription_plan==="freeTrial"&&{color:"#F57C00",backgroundColor:"#FFF8E1"},...r?.subscription_plan!=="active"&&r?.subscription_plan!=="freeTrial"&&{color:"#D32F2F",backgroundColor:"#FFEBEE"}}})]})}),(0,n.jsxs)(h.A,{children:[(0,n.jsx)(g.A,{component:"dt",sx:{fontSize:"0.875rem",fontWeight:500,color:j.A.palette.text.secondary},children:"Subscription Amount"}),(0,n.jsxs)(g.A,{component:"dd",sx:{mt:.5,fontSize:"2rem",fontWeight:600,color:j.A.palette.text.primary},children:[(e=r?.stripe_data?.current_plan_amount||0,new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e/100)),(0,n.jsxs)(g.A,{component:"span",sx:{fontSize:"0.875rem",fontWeight:j.A.typography.fontWeightRegular,color:j.A.palette.text.secondary,ml:.5},children:["/",r?.stripe_data?.current_plan_interval||"month"]})]})]}),r?.stripe_data?.current_period_start&&r?.stripe_data?.current_period_end&&(0,n.jsxs)(h.A,{children:[(0,n.jsx)(g.A,{component:"dt",sx:{fontSize:"0.875rem",fontWeight:500,color:j.A.palette.text.secondary},children:"Current Period"}),(0,n.jsx)(g.A,{component:"dd",sx:{mt:.5,fontSize:"0.875rem",color:j.A.palette.text.primary},children:(0,n.jsxs)(h.A,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[(0,n.jsxs)(g.A,{component:"span",children:["From: ",$(r?.stripe_data?.current_period_start)]}),(0,n.jsxs)(g.A,{component:"span",children:["To: ",$(r?.stripe_data?.current_period_end)]})]})})]}),(0,n.jsxs)(h.A,{children:[(0,n.jsx)(g.A,{component:"dt",sx:{fontSize:"0.875rem",fontWeight:500,color:j.A.palette.text.secondary},children:"Cancellation Status"}),(0,n.jsx)(g.A,{component:"dd",sx:{mt:.5,fontSize:"0.875rem",color:j.A.palette.text.primary},children:r?.stripe_data?.canceled_at?(0,n.jsxs)(g.A,{sx:{color:"#D32F2F"},children:["Cancelled on ",$(r?.stripe_data?.canceled_at)]}):r?.stripe_data?.cancel_at?(0,n.jsxs)(g.A,{sx:{color:"#F57C00"},children:["Scheduled to cancel on ",$(r?.stripe_data?.cancel_at)]}):(0,n.jsx)(g.A,{sx:{color:"#2E7D32"},children:"No cancellation scheduled"})})]})]}),(0,n.jsx)(h.A,{sx:{mt:3,display:"flex",gap:1.5},children:"active"===r.subscription_plan?(0,n.jsx)(f.A,{variant:"contained",onClick:L,disabled:d,sx:{px:2,py:1,fontSize:"0.875rem",fontWeight:500,textTransform:"none"},children:d?(0,n.jsx)(h.A,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(k.A,{size:20,color:"inherit"})}):"Manage Subscription"}):(0,n.jsx)(f.A,{variant:"contained",onClick:()=>t.push("/payment"),sx:{px:2,py:1,fontSize:"0.875rem",fontWeight:500,textTransform:"none"},children:"Subscribe Now"})})]})]}),(0,n.jsx)(z.L,{user:r,formData:E,handleChange:e=>{let{name:t,value:r}=e.target;P(e=>({...e,[t]:r,..."country"===t&&{country_timezone:(()=>{let e=D.find(e=>e.value===r)?.timezones[0];return e?`${e.value} ${c.Md(e.value)?.utcOffsetStr||""}`:""})()}}))}})]})]})]})})}},58824:(e,t,r)=>{"use strict";r.d(t,{X:()=>o});var n=r(67268);let o={async createCheckoutSession(e,t){try{let r=await n.apiClient.post("/stripe/create-checkout-session",{priceId:e,email:t,successUrl:`${window.location.origin}/dashboard`,cancelUrl:`${window.location.origin}/payment/paymentCancel`},"application/json");window.location.href=r.data.sessionUrl}catch(e){throw console.error("Error creating checkout session:",e),e}},async getCustomerPortalLink(){try{let e=(await n.apiClient.post("/stripe/customer-portal",{returnURL:window.location.origin+"/dashboard"})).data.url;window.location.href=e}catch(e){throw console.error("Error getting portal link:",e),e}},async createUpdatePaymentMethodSession(e,t){try{return(await n.apiClient.post("/stripe/create-update-payment-method-session",{customer_id:e,subscription_id:t,ui_mode:"custom",return_url:`${window.location.origin}/dashboard?payment_method_updated=true`},"application/json")).data}catch(e){throw console.error("Error creating update payment method session:",e),e}}}},67580:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard",function(){return r(16717)}])}},e=>{var t=t=>e(e.s=t);e.O(0,[4938,713,5711,9942,3302,7236,289,4654,3368,4515,3124,1084,3814,3085,7504,3674,8700,1992,8230,5035,8528,3339,9034,4880,9101,636,6593,8792],()=>
1t(67580)),_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.