1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4347],{47601:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>u});var s=a(37876),n=a(14232),i=a(48230),l=a.n(i),r=a(62422),o=a(94430);async function d(e){let t=document.createElement("canvas");t.width=1080,t.height=1920;let a=t.getContext("2d"),s=a.createLinearGradient(0,0,0,1920);s.addColorStop(0,"#2a1245"),s.addColorStop(.55,"#5c1f2e"),s.addColorStop(1,"#800000"),a.fillStyle=s,a.fillRect(0,0,1080,1920);let n=a.createRadialGradient(540,360,40,540,360,620);for(let[e,t,s]of(n.addColorStop(0,"rgba(255,180,32,0.35)"),n.addColorStop(1,"rgba(255,180,32,0)"),a.fillStyle=n,a.fillRect(0,0,1080,900),a.fillStyle="rgba(255,255,255,0.85)",[[160,300,4],[900,240,5],[820,560,3],[220,640,3],[540,180,4],[680,720,3]]))a.beginPath(),a.arc(e,t,s,0,2*Math.PI),a.fill();a.textAlign="center";let i=await new Promise(e=>{let t=new Image;t.onload=()=>e(t),t.onerror=()=>e(null),t.src="/logo.png"});if(i){let e=i.height*(150/i.width);a.drawImage(i,465,170,150,e)}a.fillStyle="#ffd34e",a.font="700 34px system-ui, sans-serif",a.fillText("INDIAN CAUCUS OF SECAUCUS",540,380),a.fillStyle="#fff",a.font="800 96px system-ui, sans-serif",a.fillText("My Year \uD83E\uDE94",540,560),a.fillStyle="rgba(255,255,255,0.8)",a.font="500 40px system-ui, sans-serif",a.fillText(`${e.name}${e.joinedYear?` \xb7 since ${e.joinedYear}`:""}`,540,630);let l=[];e.eventsAttended&&l.push([e.eventsAttended,1===e.eventsAttended?"event":"events"]),e.hours&&l.push([e.hours,1===e.hours?"volunteer hr":"volunteer hrs"]),e.diyas?l.push([e.diyas,1===e.diyas?"diya lit":"diyas lit"]):e.donations&&l.push([e.donations,1===e.donations?"gift":"gifts"]),e.contributions&&l.push([e.contributions,"contributions"]),l.length<4&&l.push([e.days,"days here"]);let r=l.slice(0,4),o=[310,770],d=[1e3,1360];return r.forEach(([e,t],s)=>{let n=o[s%2],i=d[Math.floor(s/2)];a.fillStyle="#ffd34e",a.font="800 116px system-ui, sans-serif",a.fillText(String(e.toLocaleString("en-US")),n,i),a.fillStyle="rgba(255,255,255,0.85)",a.font="600 36px system-ui, sans-serif",a.fillText(t,n,i+56)}),a.fillStyle="rgba(255,255,255,0.14)",a.beginPath(),a.roundRect(260,1700,560,96,48),a.fill(),a.fillStyle="#fff",a.font="700 44px system-ui, sans-serif",a.fillText("indiancaucus.org",540,1762),a.fillStyle="rgba(255,255,255,0.7)",a.font="500 30px system-ui, sans-serif",a.fillText("Join our community â¨",540,1850),await new Promise(e=>t.toBlob(t=>e(t),"image/jpeg",.92))}function u(){let{toast:e}
1=(0,o.j)(),[t,a]=(0,n.useState)(null),[i,u]=(0,n.useState)(!1),[c,h]=(0,n.useState)(0),[m,f]=(0,n.useState)(!1);async function x(){if(t&&!m){f(!0);try{let a=await d(t),s=new File([a],"my-year-indian-caucus.jpg",{type:"image/jpeg"});if(navigator.canShare&&navigator.canShare({files:[s]}))await navigator.share({files:[s],text:"My Year with the Indian Caucus of Secaucus \uD83E\uDE94 indiancaucus.org"});else{let t=document.createElement("a");t.href=URL.createObjectURL(a),t.download="my-year-indian-caucus.jpg",t.click(),e("Image saved â share it to your story!","success")}}catch(t){t?.name!=="AbortError"&&e("Could not create the image","error")}finally{f(!1)}}}(0,n.useEffect)(()=>{fetch("/api/member/wrapped").then(e=>{if(!e.ok)throw Error();return e.json()}).then(a).catch(()=>u(!0))},[]);let g=(0,n.useMemo)(()=>{let e;if(!t)return[];let a=[];return a.push({grad:"linear-gradient(160deg,#2a1245,#5c1f2e)",emoji:"\uD83E\uDE94",title:`${t.name}, here's your year with us`,sub:t.joinedYear?`Since ${t.joinedYear} \xb7 ${t.days} days in the community`:"A look back at your community journey",big:null}),t.eventsAttended&&a.push({grad:"linear-gradient(160deg,#F26644,#800000)",emoji:"\uD83C\uDF89",big:t.eventsAttended,label:1===t.eventsAttended?"event attended":"events attended",sub:t.guests>t.eventsAttended?`You brought ${t.guests} guests along`:"You showed up and celebrated"}),t.hours&&a.push({grad:"linear-gradient(160deg,#0F2044,#2e9664)",emoji:"\uD83D\uDE4C",big:t.hours,label:1===t.hours?"volunteer hour":"volunteer hours",sub:"Seva you gave to the community"}),(t.diyas||t.donations)&&a.push({grad:"linear-gradient(160deg,#c9752b,#5c1f2e)",emoji:"\uD83E\uDE94",big:t.diyas||t.donations,label:t.diyas?1===t.diyas?"diya lit":"diyas lit":1===t.donations?"gift given":"gifts given",sub:t.raisedCents?`${e=t.raisedCents,`$${Math.round((e||0)/100).toLocaleString("en-US")}`} toward our community`:"Thank you for your generosity"}),t.meetups&&a.push({grad:"linear-gradient(160deg,#3d1830,#F26644)",emoji:"\uD83E\uDD1D",big:t.meetups,label:1===t.meetups?"meetup":"meetups",sub:"Connections made with neighbors"}),t.posts&&a.push({grad:"linear-gradient(160deg,#241634,#3a1526)",emoji:"\uD83D\uDCAC",big:t.posts,label:1===t.posts?"community post":"community posts",sub:"You added your voice"}),a.push({grad:"linear-gradient(160deg,#800000,#FF9933)",emoji:"\uD83C\uDF1F",big:t.contributions,label:1===t.contributions?"contribution":"contributions",sub:`${t.days} days with us and counting`,isLast:!0}),a},[t]);if(t&&(t.eventsAttended,t.eventsAttended,t.hours,t.hours,t.diyas&&(t.diyas,t.diyas)),i)return(0,s.jsx)(r.Ay,{title:"Your Year",children:(0,s.jsxs)("div",{className:"text-center py-16",children:[(0,s.jsx)("p",{className:"text-brand-navy dark:text-white font-bold",children:"Couldn't build your recap"}),(0,s.jsx)(l(),{href:"/app",className:"text-brand-orange dark:text-brand-saffron font-semibold text-sm mt-2 inline-block",children:"Back home"})]})});if(!g.length)return(0,s.jsx)(r.Ay,{title:"Your Year",children:(0,s.jsx)("div",{className:"space-y-3",children:[0,1].map(e=>(0,s.jsx)("div",{className:"h-64 rounded-3xl bg-white border border-orange-100 app-shine"},e))})});let p=g[c],b=c>=g.length-1,y=e=>h(t=>Math.max(0,Math.min(g.length-1,t+e)));return(0,s.jsxs)(r.Ay,{title:"Your Year",children:[(0,s.jsx)("div",{className:"flex gap-1.5 mb-3 px-1",children:g.map((e,t)=>(0,s.jsx)("div",{className:`h-1 flex-1 rounded-full transition-colors ${t<=c?"bg-brand-orange":"bg-gray-200 dark:bg-white/15"}`},t))}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("div",{className:"app-pop rounded-3xl p-7 min-h-[62vh] flex flex-col items-center justify-center text-center text-white shadow-xl overflow-hidden",style:{background:p.grad},children:[(0,s.jsx)("div",{className:"text-6xl mb-4 app-float",children:p.emoji}),null!=p.big?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-7xl font-black leading-none tabular-nums drop-shadow-sm",children:p.big.toLocaleString("en-US")}),(0,s.jsx)("p",{className:"text-xl font-extrabold mt-2",children:p.label}),p.sub&&(0,s.jsx)("p",{className:"text-white/80 text-sm mt-2 max-w-xs",children:p.sub})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-2xl font-extrabold leading-snug max-w-xs",children:p.title}),p.sub&&(0,s.jsx)("p",{className:"text-white/80 text-sm mt-3 max-w-xs",children:p.sub}),(0,s.jsx)("p",{className:"text-white/60 text-xs mt-6",children:"Tap through your year â"})]}),p.isLast&&(0,s.jsxs)("div",{className:"mt-7 flex flex-col items-center gap-2 w-full max-w-xs",children:[(0,s.jsxs)("button",{onClick:x,disabled:m,className:"w-full inline-flex items-center justify-center gap-2 bg-white text-brand-maroon font-bold text-sm rounded-2xl px-5 py-3.5 active:scale-95 transition-transform disabled:opacity-60",children:[(0,s.jsxs)("svg",{width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:"2.2",viewBox:"0 0 24 24",children:[(0,s.jsx)("path",{d:"M4 12v7a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7"}),(0,s.jsx)("path",{d:"M16 6l-4-4-4 4"}),(0,s.jsx)("path",{d:"M12 2v14"})]}),m?"Creatingâ¦":"Share to your story"]}),(0,s.jsx)("p",{className:"text-white/55 text-[11px]",children:"Instagram \xb7 Facebook \xb7 WhatsApp & more"}),(0,s.jsx)(l(),{href:"/app",className:"text-white/70 text-xs font-semibold mt-1",children:"Back home"})]})]},c),c>0&&(0,s.jsx)("button",{onClick:()=>y(-1),"aria-label":"Previous",className:"absolute left-0 top-0 h-full w-1/3"}),!b&&(0,s.jsx)("button",{onClick:()=>y(1),"aria-label":"Next",className:"absolute right-0 top-0 h-full w-1/3"})]}),!b&&(0,s.jsx)("button",{onClick:()=>y(1),className:"mt-4 w-full py-3 rounded-2xl bg-brand-navy dark:bg-white/10 text-white font-bold text-sm active:scale-[0.99] transition-transform",children:"Next"})]})}},71850:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/wrapped",function(){return a(47601)}])}},e=>{e.O(0,[8230,900,8766,2422,636,6593,8792],()=>e(e.s=71850)),_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.