1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3919],{9765:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>w});var n=a(37876),r=a(14232),s=a(48230),i=a.n(s),o=a(62422),l=a(84098),d=a(41998),c=a(33977),x=a(11361),h=a(47989),m=a(23492),u=a(62406),p=a(31710),f=a(57728);function b(e){if(!e||"string"!=typeof e)return"";let[t,a,n]=e.split("-").map(Number);return t&&a&&n?new Date(t,a-1,n).toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"}):""}function g(e){if(!e)return"";let[t,a]=e.split(":").map(Number),n=t>=12?"PM":"AM";return t=t%12||12,`${t}:${String(a).padStart(2,"0")} ${n}`}let y=e=>`$${(e/100).toFixed(2).replace(/\.00$/,"")}`;function w(){let{member:e}=(0,u.IG)(),t=(0,f.ZU)(),{data:a=[],loading:s,error:x,reload:w}=(0,p.s)("events","/api/events",e=>e.events||[]),[v,N]=(0,r.useState)({webcal:"",https:""}),[C,S]=(0,r.useState)(!1),[T,$]=(0,r.useState)(null),[M,_]=(0,r.useState)(!1),A=(0,r.useRef)(!1),[P,E]=(0,r.useState)({}),[F,O]=(0,r.useState)(null);function B(){if(!e)return void E({});fetch("/api/tickets/waitlist").then(e=>e.json()).then(e=>{let t={};(e.events||[]).forEach(e=>{t[e.event_id]=e.status}),E(t)}).catch(()=>{})}return(0,r.useEffect)(()=>{let e=window.location.host;N({webcal:`webcal://${e}/api/calendar.ics`,https:`${window.location.origin}/api/calendar.ics`})},[]),(0,r.useEffect)(()=>{B()},[e?.id]),(0,n.jsxs)(o.Ay,{title:"Events",children:[(0,n.jsxs)("div",{className:"app-fade-up app-hero-warm relative overflow-hidden rounded-3xl p-5 mb-5 text-white shadow-lg app-gradient-animate",style:l.VT,children:[(0,n.jsx)("h1",{className:"text-2xl font-extrabold",children:"Never miss an event"}),(0,n.jsx)("p",{className:"text-white/90 text-sm mt-1.5",children:"Subscribe once â every event syncs to your phoneâs calendar with automatic reminders."}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 mt-3",children:[(0,n.jsx)("a",{href:v.webcal,className:"bg-white text-brand-orange dark:text-brand-saffron font-bold text-sm rounded-xl px-4 py-2.5 active:scale-95 transition-transform text-shadow-none",children:"Subscribe to calendar"}),(0,n.jsx)("button",{onClick:function(){navigator.clipboard?.writeText(v.https).then(()=>{S(!0),setTimeout(()=>S(!1),2e3)}).catch(()=>{})},className:"bg-white/15 text-white font-bold text-sm rounded-xl px-4 py-2.5 active:scale-95 transition-transform",children:C?"Link copied":"Copy feed link"})]}),(0,n.jsx)("p",{className:"text-white/80 text-[11px] mt-2",children:"ios"===t?"Tap âSubscribeâ and confirm â the events land in your Calendar app.":"android"===t?"Tap âCopy feed linkâ, then in Google Calendar: Other calendars â From URL.":"iPhone: tap âSubscribeâ. Google Calendar: âCopy feed linkâ â Other calendars â From URL."})]}),(0,n.jsx)(h.A,{}),(0,n.jsxs)("div",{className:"space-y-3 app-stagger",children:[s&&(0,n.jsx)("div",{className:"space-y-3",children:[0,1].map(e=>(0,n.jsx)("div",{className:"h-36 rounded-2xl bg-white border border-orange-100 app-shine"},e))}),x&&!s&&(0,n.jsxs)("div",{className:"app-pop text-center py-14 px-6 bg-white border border-orange-100 rounded-2xl shadow-xs",children:[(0,n.jsx)("span",{className:"w-12 h-12 rounded-2xl bg-orange-50 text-brand-orange dark:text-brand-saffron flex items-center justify-center mx-auto mb-3",children:(0,n.jsxs)("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,n.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),(0,n.jsx)("p",{className:"font-bold text-brand-navy dark:text-white",children:"Couldnât load events"}),(0,n.jsx)("p",{className:"text-gray-500 dark:text-white/55 text-sm mt-1",children:"Check your connection and try again."}),(0,n.jsx)("button",{onClick:w,className:"mt-4 bg-brand-navy text-white font-bold text-sm rounded-2xl px-5 py-2.5 active:scale-95 transition-transform",children:"Try again"})]}),!s&&!x&&a.length>0&&(0,n.jsx)("div",{className:"lg:grid lg:grid-cols-2 lg:items-start lg:gap-3 lg:space-y-0 space-y-3 app-stagger",children:a.map(e=>{let[t,a,r]=(e.date||"").split("-").map(Number),s=a?new Date(t,a-1,r).toLocaleDateString("en-US",{month:"short"}):"";return(0,n.jsxs)("div",{className:"bg-white border border-orange-100 rounded-2xl p-5 shadow-xs",children:[(0,n.jsxs)("div",{className:"flex gap-3.5",children:[r&&(0,n.jsxs)("div",{className:"w-14 shrink-0 self-start rounded-xl bg-orange-50 border border-orange-100/70 text-center overflow-hidden",children:[(0,n.jsx)("div",{className:"bg-linear-to-r from-brand-orange to-brand-saffron text-white text-[10px] font-bold uppercase tracking-wider py-1",children:s}),(0,n.jsx)("div",{className:"text-brand-navy dark:text-white text-2xl font-extrabold py-1.5 leading-none",children:r})]}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("p",{className:"text-xs font-bold text-brand-orange dark:text-brand-saffron",children:[b(e.date),e.start?` \xb7 ${g(e.start)}${e.end?`â${g(e.end)}`:""}`:""]}),(0,n.jsx)("p",{className:"font-extrabold text-brand-navy dark:text-white text-lg mt-0.5 leading-snug",children:e.title}),e.location&&(0,n.jsxs)("p",{className:"text-gray-500 dark:text-white/55 text-sm mt-1 flex items-start gap-1.5",children:[(0,n.jsxs)("svg",{width:"14",height:"14",className:"mt-0.5 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{d:"M21 10c0 7-9 12-9 12s-9-5-9-12a9 9 0 0 1 18 0z"}),(0,n.jsx)("circle",{cx:"12",cy:"10",r:"3"})]}),e.location]})]})]}),e.description&&(0,n.jsx)("p",{className:"text-gray-600 dark:text-white/70 text-sm mt-3 leading-relaxed",children:e.description}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 mt-4",children:[e.freeTickets?e.capacity&&e.ticketsSold>=e.capacity?"released"===P[e.id]?(0,n.jsx)("button",{onClick:()=>$(e),className:"bg-linear-to-r from-brand-green-dark to-[#38b27a] text-white font-bold text-sm rounded-2xl px-5 py-3 shadow-lg shadow-green-500/20 active:scale-95 transition-transform",children:"Claim your spot \uD83C\uDF9Fï¸"}):"waiting"===P[e.id]?(0,n.jsx)("span",{className:"inline-flex items-center gap-1.5 bg-amber-50 text-amber-700 dark:text-amber-300 dark:bg-amber-400/10 font-bold text-sm rounded-2xl px-5 py-3",children:"On the waitlist â"}):(0,n.jsx)("button",{onClick:()=>O(e),className:"bg-brand-navy text-white font-bold text-sm rounded-2xl px-5 py-3 active:scale-95 transition-transform",children:"Join the waitlist"}):!1===e.onSale?(0,n.jsx)("span",{className:"bg-gray-100 text-gray-500 dark:text-white/55 font-bold text-sm rounded-2xl px-5 py-3",children:"Tickets not on sale yet"}):(0,n.jsx)("button",{onClick:()=>$(e),className:"bg-linear-to-r from-brand-orange to-brand-saffron text-white font-bold text-sm rounded-2xl px-5 py-3 shadow-lg shadow-orange-500/20 active:scale-95 transition-transform",children:function(e){let t=Array.isArray(e.tiers)?e.tiers:[];if(t.length){let e=Math.min(...t.map(e=>e.priceCents||0));return e>0?`Tickets \xb7 from ${y(e)}`:"Get tickets"}return e.priceCents>0?`Buy tickets \xb7 ${y(e.priceCents)}`:"Get free tickets"}(e)}):e.rsvpUrl&&(0,n.jsx)("a",{href:e.rsvpUrl,target:"_blank",rel:"noopener noreferrer",className:"bg-linear-to-r from-brand-orange to-brand-saffron text-white font-bold text-sm rounded-2xl px-5 py-3 shadow-lg shadow-orange-500/20 active:scale-95 transition-transform",children:"RSVP / Tickets"}),(0,n.jsx)("a",{href:function(e){let t=new URLSearchParams({id:String(e.id||""),title:e.title||"",date:e.date||""});return e.start&&t.set("start",e.start),e.end&&t.set("end",e.end),e.location&&t.set("location",e.location),e.description&&t.set("description",e.description),`/api/event-ics?${t.toString()}`}(e),className:"border border-gray-200 text-brand-navy dark:text-white font-bold text-sm rounded-2xl px-4 py-3 active:scale-95 transition-transform",children:"Add to calendar"}),(0,n.jsx)(c.A,{text:`${e.title} is coming up${e.date?` (${b(e.date)})`:""} â details & tickets are in the Indian Caucus of Secaucus app:`,url:m.Bb,className:"inline-flex items-center gap-1.5 border border-gray-200 text-brand-navy dark:text-white font-bold text-sm rounded-2xl px-4 py-3 active:scale-95 transition-transform"})]}),e.freeTickets&&e.capacity&&e.ticketsSold<e.capacity&&e.capacity-e.ticketsSold<=20&&(0,n.jsxs)("p",{className:"text-brand-orange dark:text-brand-saffron text-xs font-bold mt-2.5 inline-flex items-center gap-1",children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-brand-orange animate-pulse"}),"Only ",e.capacity-e.ticketsSold," left"]})]},e.id)})}),!s&&!x&&0===a.length&&(0,n.jsxs)("div",{className:"app-pop text-center py-14 px-6 bg-white border border-orange-100 rounded-2xl shadow-xs",children:[(0,n.jsx)("span",{className:"w-12 h-12 rounded-2xl bg-orange-50 text-brand-orange dark:text-brand-saffron flex items-center justify-center mx-auto mb-3",children:(0,n.jsxs)("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24",children:[(0,n.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),(0,n.jsx)("path",{d:"M16 2v4M8 2v4M3 10h18"})]})}),(0,n.jsx)("p",{className:"font-bold text-brand-navy dark:text-white",children:"No upcoming events yet"}),(0,n.jsx)("p",{className:"text-gray-500 dark:text-white/55 text-sm mt-1 max-w-xs mx-auto",children:"Subscribe above and weâll ping you the moment the next festival, party, or gathering is announced. Meanwhile, say hi to neighbors in the community."}),(0,n.jsxs)(i(),{href:"/app/community",className:"mt-4 inline-flex items-center gap-2 bg-white border border-orange-200 text-brand-orange dark:text-brand-saffron font-bold text-sm rounded-2xl px-5 py-2.5 active:scale-95 transition-transform",children:["Go to Community",(0,n.jsx)("svg",{width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M5 12h14M13 6l6 6-6 6"})})]})]})]}),T&&(0,n.jsx)(k,{ev:T,member:e,onReserved:()=>{A.current=!0},onClose:()=>{$(null),A.current&&(A.current=!1,B(),w(),setTimeout(()=>_(!0),300))}}),F&&(0,n.jsx)(j,{ev:F,member:e,onJoined:e=>E(t=>({...t,[F.id]:e})),onClose:()=>O(null)}),(0,n.jsx)(d.A,{open:M,onClose:()=>_(!1),reason:"event"})]})}function j({ev:e,member:t,onClose:a,onJoined:s}){let[i,o]=(0,r.useState)(1),[l,d]=(0,r.useState)(!1),[c,x]=(0,r.useState)(!1),[h,m]=(0,r.useState)("");async function u(){if(!t){window.location.href="/app/signin";return}d(!0),m("");try{let t=await fetch("/api/tickets/waitlist",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({eventId:e.id,quantity:i})}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||"Could not join the waitlist");x(!0),s?.(a.status||"waiting")}catch(e){m(e.message),d(!1)}}return(0,n.jsx)("div",{className:"app-backdrop fixed inset-0 z-50 bg-black/50 flex items-end sm:items-center justify-center",onClick:a,children:(0,n.jsx)("div",{className:"app-pop bg-white w-full sm:max-w-sm rounded-t-3xl sm:rounded-3xl p-6 text-center max-h-[88dvh] overflow-y-auto",onClick:e=>e.stopPropagation(),style:{paddingBottom:"calc(84px + env(safe-area-inset-bottom))"},children:c?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-amber-50 text-amber-600 dar
1k:text-amber-300 flex items-center justify-center mx-auto mb-3",children:(0,n.jsxs)("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,n.jsx)("path",{d:"M12 7v5l3 2"})]})}),(0,n.jsx)("p",{className:"font-extrabold text-brand-navy dark:text-white text-lg",children:"You're on the list â"}),(0,n.jsxs)("p",{className:"text-gray-600 dark:text-white/70 text-sm mt-1",children:["We'll notify you the moment a spot opens for ",(0,n.jsx)("span",{className:"font-semibold",children:e.title})," â by push and email. Spots are first-come, so claim fast when you hear from us."]}),(0,n.jsx)("button",{onClick:a,className:"mt-4 block w-full py-3 rounded-2xl bg-linear-to-r from-brand-orange to-brand-saffron text-white font-bold text-sm",children:"Done"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"font-extrabold text-brand-navy dark:text-white text-lg",children:e.title}),(0,n.jsx)("p",{className:"text-gray-500 dark:text-white/55 text-sm mt-1 mb-4",children:"Sold out â join the waitlist and we'll ping you if a spot frees up."}),(0,n.jsxs)("div",{className:"flex items-center justify-center gap-4 mb-4",children:[(0,n.jsx)("button",{onClick:()=>o(e=>Math.max(1,e-1)),className:"w-11 h-11 rounded-full border border-gray-200 text-2xl text-brand-navy dark:text-white font-bold active:scale-90 transition-transform",children:"â"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-3xl font-extrabold text-brand-navy dark:text-white",children:i}),(0,n.jsx)("p",{className:"text-gray-400 dark:text-white/45 text-xs",children:1===i?"ticket":"tickets"})]}),(0,n.jsx)("button",{onClick:()=>o(t=>Math.min(e.maxPerPerson||10,t+1)),className:"w-11 h-11 rounded-full border border-gray-200 text-2xl text-brand-navy dark:text-white font-bold active:scale-90 transition-transform",children:"+"})]}),h&&(0,n.jsx)("p",{className:"text-red-600 text-xs mb-2",children:h}),(0,n.jsx)("button",{onClick:u,disabled:l,className:"w-full py-3.5 rounded-2xl bg-brand-navy text-white font-bold text-sm shadow-lg disabled:opacity-50",children:l?"Joiningâ¦":t?"Join the waitlist":"Sign in to join"}),(0,n.jsx)("button",{onClick:a,className:"mt-2 w-full py-2.5 text-gray-500 dark:text-white/55 font-semibold text-sm",children:"Cancel"})]})})})}function k({ev:e,member:t,onClose:a,onReserved:s}){let o=Array.isArray(e.tiers)?e.tiers:[],l=o.length>0,d=l?o.find(e=>!(e.capacity&&e.sold>=e.capacity))||o[0]:null,[c,h]=(0,r.useState)(d?d.id:null),[m,u]=(0,r.useState)(1),[p,f]=(0,r.useState)(!1),[b,g]=(0,r.useState)(!1),[w,j]=(0,r.useState)(""),k=l?o.find(e=>e.id===c):null,v=k?k.priceCents||0:e.priceCents||0,N=v>0;async function C(){if(!t){window.location.href="/app/signin";return}if(l&&!k)return void j("Choose a ticket type");f(!0),j("");try{let t={eventId:e.id,quantity:m,...k?{tierId:k.id}:{}};if(N){let e=await fetch("/api/tickets/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),a=await e.json().catch(()=>({}));if(!e.ok||!a.url)throw Error(a.error||"Could not start checkout");window.location.href=a.url;return}let a=await fetch("/api/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await a.json().catch(()=>({}));if(!a.ok)throw Error(n.error||"Could not reserve");g(!0),s?.()}catch(e){j(e.message),f(!1)}}return(0,n.jsx)("div",{className:"app-backdrop fixed inset-0 z-50 bg-black/50 flex items-end sm:items-center justify-center",onClick:a,children:(0,n.jsx)("div",{className:"app-pop bg-white w-full sm:max-w-sm rounded-t-3xl sm:rounded-3xl p-6 text-center max-h-[88dvh] overflow-y-auto",onClick:e=>e.stopPropagation(),style:{paddingBottom:"calc(84px + env(safe-area-inset-bottom))"},children:b?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-green-50 text-brand-green-dark dark:text-brand-green-light flex items-center justify-center mx-auto mb-3",children:(0,n.jsx)("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),(0,n.jsx)("p",{className:"font-extrabold text-brand-navy dark:text-white text-lg",children:"You're in!"}),(0,n.jsxs)("p",{className:"text-gray-600 dark:text-white/70 text-sm mt-1",children:["We emailed your ticket and receipt",t?.email?` to ${t.email}`:"",". Find it any time under ",(0,n.jsx)(i(),{href:"/app/tickets",className:"text-brand-orange dark:text-brand-saffron font-semibold underline",children:"My Tickets"}),"."]}),(0,n.jsx)(i(),{href:"/app/tickets",className:"mt-4 block w-full py-3 rounded-2xl bg-linear-to-r from-brand-orange to-brand-saffron text-white font-bold text-sm",children:"View my ticket"}),(0,n.jsx)("p",{className:"text-gray-500 dark:text-white/55 text-xs mt-4 mb-1",children:"Know someone who'd want to come?"}),(0,n.jsx)(x.A,{}),(0,n.jsx)("button",{onClick:a,className:"mt-2 w-full py-2.5 text-gray-500 dark:text-white/55 font-semibold text-sm",children:"Close"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"font-extrabold text-brand-navy dark:text-white text-lg",children:e.title}),(0,n.jsx)("p",{className:"text-gray-500 dark:text-white/55 text-sm mt-1 mb-4",children:l?"Choose your ticket type":N?`${y(v)} per ticket`:"Free admission \xb7 reserve your spot"}),l&&(0,n.jsx)("div",{className:"space-y-2 mb-4 text-left",children:o.map(e=>{let t=e.capacity&&e.sold>=e.capacity,a=null!=e.capacity?e.capacity-e.sold:null;return(0,n.jsxs)("button",{type:"button",disabled:t,onClick:()=>h(e.id),className:`w-full flex items-center justify-between gap-2 rounded-2xl border px-4 py-3 text-left transition ${c===e.id?"border-brand-orange bg-orange-50 dark:bg-orange-400/10":"border-gray-200 dark:border-white/10"} ${t?"opacity-50 cursor-not-allowed":"active:scale-[0.99]"}`,children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"font-bold text-brand-navy dark:text-white text-sm truncate",children:e.name}),t?(0,n.jsx)("p",{className:"text-[11px] text-gray-400 dark:text-white/45",children:"Sold out"}):null!=a&&a<=20?(0,n.jsxs)("p",{className:"text-[11px] text-brand-orange dark:text-brand-saffron font-semibold",children:["Only ",a," left"]}):null]}),(0,n.jsx)("p",{className:"font-extrabold text-brand-navy dark:text-white text-sm shrink-0",children:e.priceCents>0?y(e.priceCents):"Free"})]},e.id)})}),(0,n.jsxs)("div",{className:"flex items-center justify-center gap-4 mb-4",children:[(0,n.jsx)("button",{onClick:()=>u(e=>Math.max(1,e-1)),className:"w-11 h-11 rounded-full border border-gray-200 text-2xl text-brand-navy dark:text-white font-bold active:scale-90 transition-transform",children:"â"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-3xl font-extrabold text-brand-navy dark:text-white",children:m}),(0,n.jsx)("p",{className:"text-gray-400 dark:text-white/45 text-xs",children:1===m?"ticket":"tickets"})]}),(0,n.jsx)("button",{onClick:()=>u(t=>Math.min(e.maxPerPerson||10,t+1)),className:"w-11 h-11 rounded-full border border-gray-200 text-2xl text-brand-navy dark:text-white font-bold active:scale-90 transition-transform",children:"+"})]}),N&&(0,n.jsxs)("p",{className:"text-brand-navy dark:text-white text-sm font-bold mb-3",children:["Total: $",(v*m/100).toFixed(2)]}),w&&(0,n.jsx)("p",{className:"text-red-600 text-xs mb-2",children:w}),(0,n.jsx)("button",{onClick:C,disabled:p,className:"w-full py-3.5 rounded-2xl bg-linear-to-r from-brand-orange to-brand-saffron text-white font-bold text-sm shadow-lg shadow-orange-500/25 disabled:opacity-50",children:p?N?"Starting checkoutâ¦":"Reservingâ¦":t?N?`Buy ${m} ticket${1===m?"":"s"}`:"Get tickets":"Sign in to get tickets"}),(0,n.jsx)("button",{onClick:a,className:"mt-2 w-full py-2.5 text-gray-500 dark:text-white/55 font-semibold text-sm",children:"Cancel"})]})})})}},31710:(e,t,a)=>{"use strict";a.d(t,{s:()=>s});var n=a(14232),r=a(79004);function s(e,t,a){let s=(0,n.useRef)(t),i=(0,n.useRef)(a);s.current=t,i.current=a;
1let[o,l]=(0,n.useState)(()=>e?(0,r.tv)(e):void 0),[d,c]=(0,n.useState)(()=>!e||void 0===(0,r.tv)(e)),[x,h]=(0,n.useState)(!1),[m,u]=(0,n.useState)(e);if(e!==m){u(e);let t=e?(0,r.tv)(e):void 0;l(t),c(void 0===t),h(!1)}let p=(0,n.useCallback)(async()=>{let t=e?(0,r.tv)(e):void 0;void 0!==t?(l(t),c(!1)):c(!0),h(!1);try{let t="function"==typeof s.current?s.current():s.current,a=await fetch(t);if(!a.ok)throw Error("load");let n=await a.json(),o=i.current?i.current(n):n;return l(o),(0,r.lx)(e,o),c(!1),o}catch{void 0===t&&h(!0),c(!1);return}},[e]);return(0,n.useEffect)(()=>{p()},[p]),{data:o,loading:d,error:x,reload:p,setData:(0,n.useCallback)(t=>{l(a=>{let n="function"==typeof t?t(a):t;return(0,r.lx)(e,n),n})},[e])}}},33977:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var n=a(37876),r=a(94430),s=a(23492);function i({text:e,url:t,label:a="Share",className:i=""}){let{toast:o}=(0,r.j)();async function l(){"copied"===await (0,s.eK)({text:e,url:t})&&o("Link copied â paste it anywhere","success")}return(0,n.jsxs)("button",{onClick:l,className:i||"inline-flex items-center gap-1 text-sm font-bold text-gray-500 active:opacity-70",children:[(0,n.jsxs)("svg",{width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{cx:"18",cy:"5",r:"3"}),(0,n.jsx)("circle",{cx:"6",cy:"12",r:"3"}),(0,n.jsx)("circle",{cx:"18",cy:"19",r:"3"}),(0,n.jsx)("path",{d:"M8.6 13.5l6.8 4M15.4 6.5l-6.8 4"})]}),a]})}},41998:(e,t,a)=>{"use strict";a.d(t,{A:()=>h});var n=a(37876),r=a(14232),s=a(84764),i=a(70491),o=a(31145),l=a(80856),d=a(3083),c=a(4063);let x={event:{emoji:"\uD83C\uDF9Fï¸",title:"You're in!",body:"Want a heads-up so you don't miss it? Turn on notifications and we'll remind you before the event."},donation:{emoji:"â¤ï¸",title:"Thank you!",body:"Turn on notifications to hear about the causes you support and the difference your gift makes."},default:{emoji:"\uD83D\uDD14",title:"Stay in the loop",body:"Turn on notifications for reminders, replies, and community news."}};function h({open:e,onClose:t,reason:a="default"}){let[h,m]=(0,r.useState)(!1),[u,p]=(0,r.useState)(!1),[f,b]=(0,r.useState)(!1),[g,y]=(0,r.useState)(!1);async function w(){b(!0);let e=u?await (0,d.FA)():await (0,o.AF)();b(!1),e?((0,c.$o)(),y(!0),setTimeout(()=>{m(!1),t?.()},1600)):(m(!1),t?.())}function j(){m(!1),t?.()}(0,r.useEffect)(()=>{if(!e)return;let a=!0;return(async()=>{try{if(localStorage.getItem("ic_push_moment_shown"))return void t?.()}catch{}let e=await (0,l.JK)(),n=e?await (0,d.aQ)():await (0,o.P)();if(a)if(p(e),"prompt"===n||"prompt-with-rationale"===n||"default"===n){try{localStorage.setItem("ic_push_moment_shown","1")}catch{}m(!0)}else t?.()})(),()=>{a=!1}},[e]);let k=x[a]||x.default;return(0,n.jsxs)(s.A,{open:h,onClose:j,children:[(0,n.jsx)(i.A,{show:g}),(0,n.jsxs)("div",{className:"text-center pb-2",children:[(0,n.jsx)("div",{className:"text-5xl mb-2","aria-hidden":!0,children:g?"â
":k.emoji}),(0,n.jsx)("p",{className:"sheet-fg font-extrabold text-lg",children:g?"You're all set!":k.title}),(0,n.jsx)("p",{className:"sheet-fg-dim text-sm mt-1.5 max-w-xs mx-auto",children:g?"We'll keep you posted.":k.body}),!g&&(0,n.jsxs)("div",{className:"mt-5 space-y-2",children:[(0,n.jsx)("button",{onClick:w,disabled:f,className:"w-full py-3 rounded-2xl bg-linear-to-r from-brand-orange to-brand-saffron text-white font-bold shadow-lg shadow-orange-500/20 disabled:opacity-60 active:scale-[.99] transition-transform",children:f?"Turning onâ¦":"Turn on notifications"}),(0,n.jsx)("button",{onClick:j,className:"w-full py-2.5 sheet-fg-dim font-semibold text-sm",children:"Maybe later"})]})]})]})}},53744:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/events",function(){return a(9765)}])},57728:(e,t,a)=>{"use strict";a.d(t,{ZU:()=>i,jR:()=>o});var n=a(14232),r=a(50900);function s(){try{let e=r.Capacitor?.getPlatform?.()||"web";return"ios"===e||"android"===e?e:"web"}catch{return"web"}}function i(){let[e,t]=(0,n.useState)(s);return(0,n.useEffect)(()=>{t(s())},[]),e}function o(e){return"ios"===e?"iOS Settings":"android"===e?"Android Settings":"your browser settings"}}},e=>{e.O(0,[8230,900,8766,2422,674,636,6593,8792],()=>e(e.s=53744)),_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.