PageSourceSearch

https://www.faithgpt.io/assets/EventDetailPage-Hid9ydDh.js

js faithgpt.io collected 2026-10-08 11:32:11 UTC 97,841 bytes, 14 lines download raw bytes

1import{j as e,r as x,o as qe,h as Ke,L as pe,m as Jt,w as Yt,i as Gt}from"./vendor-react-BbDvRQ-i.js";import{M as Xt}from"./MarkdownWithEntityHighlighting-QPgSL7gO.js";import{u as P,d as V,aW as D,C as De,f as Je,bq as ye,$ as rt,al as lt,L as me,o as ct,h as Ce,i as dt,B as es,bP as ts,bQ as ss,bR as as,aB as Fe,bS as ft,e as yt,E as Rt,bc as rs,aH as ns}from"./bootstrap-Ceeb7xxj.js";import{T as jt}from"./TwoWeightHeading-BN1WFU6t.js";import{u as ce,b as xe,e as Ye}from"./vendor-convex-BxSoWDLe.js";import{e as is}from"./eventPrograms-DdOexHMs.js";import{e as $,c as Pe,i as Te,j as Dt,k as os,l as ls,r as cs,m as ds,b as bt,f as us,n as vt}from"./eventPresentation-Z-OMWMxq.js";import{L as ms}from"./lock-Bs0MSNjw.js";import{e as Tt,c as Ne,a as ut,b as xs,d as Ot,f as mt,g as xt}from"./eventSharing-D-T4ZQNV.js";import{S as Ge}from"./share-2-vzfebF63.js";import{C as nt}from"./copy-CUsZ6Olj.js";import{d as $e,E as le,a as he,w as Oe,e as Be,u as hs,c as ps,f as gs,b as fs}from"./useEventRefreshKey-B6ScZVBY.js";import{A as ys}from"./AudioBankPlayer-CLu9tqXh.js";import{P as kt}from"./play-DTfj9ACa.js";import{V as js}from"./volume-x-CAZtdEeG.js";import{V as bs}from"./volume-2-3jxsXD36.js";import{P as vs}from"./pause-WlS7qmDd.js";import{S as ks}from"./ScripturePassagePreview-DoNLpFn1.js";import{S as wt}from"./switch-D3r9VtZC.js";import{M as Nt}from"./chatDeepLinkParams--XfD7SlZ.js";import{E as Ae,a as ws}from"./EventsQueryBoundary-C9ZcOzxz.js";import{A as it}from"./arrow-right-DZOsK46Z.js";import"./index.modern-jo4edEIS.js";import"./vendor-utils-D7yGyqwn.js";import"./useCreditCheck-BcY2Dc-r.js";import"./index-Du-NZRBO.js";import"./vendor-cn-DARsLm--.js";import"./vendor-motion-EJI06J_D.js";import"./locale-en-iShQupNv.js";import"./SplitText-CFzqddhr.js";import"./bibleMetadata-Cdl45J7F.js";import"./bibleBookNamesLocalized-C4aASwBf.js";import"./bibleTranslations-DcFnhlkk.js";import"./bibleReferenceParser-Veb6nLQc.js";import"./audioWaveform-D9UWO-Nw.js";import"./rotate-ccw-Cau17Nc8.js";import"./rotate-cw-BvlheEBJ.js";import"./ellipsis-CAfDHz3c.js";import"./useCachedBibleData-DHEgC-Co.js";import"./bibleCache-DVlyZehn.js";import"./scriptureReference-BGuW0dh9.js";import"./circle-alert-DwRE4g_K.js";const T=t=>Math.round(t*10)/10,fe=([t,s])=>`${T(t)} ${T(s)}`,_=t=>`M${fe(t)}`,ee=t=>`L${fe(t)}`,K=(t,s,r)=>`C${fe(t)} ${fe(s)} ${fe(r)}`,Y=(t,s)=>`Q${fe(t)} ${fe(s)}`,H=t=>`${_(t[0])}${K(t[1],t[2],t[3])}`,Me=(t,s)=>[(t[0]+s[0])/2,(t[1]+s[1])/2],Vt=(t,s,r)=>[t[0]+s[0]*r,t[1]+s[1]*r],He=([t,s])=>{const r=Math.hypot(t,s)||1;return[t/r,s/r]},Ut=([t,s])=>Math.atan2(t,-s)*180/Math.PI,je=(t,s,r)=>`translate(${T(t)} ${T(s)}) rotate(${T(r)})`,M=([t,s,r,a],i)=>{const n=1-i,l=[n*n*n,3*n*n*i,3*n*i*i,i*i*i];return[l[0]*t[0]+l[1]*s[0]+l[2]*r[0]+l[3]*a[0],l[0]*t[1]+l[1]*s[1]+l[2]*r[1]+l[3]*a[1]]},ze=([t,s,r,a],i)=>{const n=1-i;return[3*n*n*(s[0]-t[0])+6*n*i*(r[0]-s[0])+3*i*i*(a[0]-r[0]),3*n*n*(s[1]-t[1])+6*n*i*(r[1]-s[1])+3*i*i*(a[1]-r[1])]},de=(t,s)=>Ut(ze(t,s)),Ee=(t,s)=>t.map(([r,a],i)=>[r+s[i],a]),$t=(t,s,r)=>t.map(([a,i],n)=>[a+(s[n][0]-a)*r,i+(s[n][1]-i)*r]),_e=t=>t.map((s,r)=>r===0?_(s):r===t.length-1?ee(s):Y(s,Me(s,t[r+1]))).join(""),et=(t,s,r)=>s.reduce((a,[i,n],l)=>{const o=[t+r*n,i];if(l===0)return _(o);const[m,d]=s[l-1],u=(i-m)*.45;return`${a}${K([t+r*d,m+u],[o[0],i-u],o)}`},""),te={fill:"currentColor",fillOpacity:.16,stroke:"none"},z={strokeWidth:.9,strokeOpacity:.7};function Re({x:t,y:s,angle:r,length:a,width:i,bend:n=0,skew:l=0,veins:o=3,shade:m=!0}){const d=i*(1+l),u=i*(1-l),c=[[0,0],[-1.5*d,-.22*a],[n-1.1*d,-.72*a],[n,-a]],h=[[0,0],[1.5*u,-.22*a],[n+1.1*u,-.72*a],[n,-a]],p=[[0,0],[n*.15,-.3*a],[n*.6,-.7*a],[n,-a]],f=`${_(c[0])}${K(c[1],c[2],c[3])}${K(h[2],h[1],h[0])}Z`,b=`${_(c[0])}${K(c[1],c[2],c[3])}${K(p[2],p[1],p[0])}Z`,g=Array.from({length:o*2},(j,y)=>{const v=y%2?h:c,C=.2+Math.floor(y/2)*(.52/o)+y%2*.07,k=M(p,C),E=M(v,Math.min(C+.15,.93)),I=[k[0]+(E[0]-k[0])*.84,k[1]+(E[1]-k[1])*.84];return`${_(k)}${Y([k[0]+(I[0]-k[0])*.75,k[1]+(I[1]-k[1])*.3],I)}`}).join("");return e.jsxs("g",{transform:je(t,s,r),children:[m&&e.jsx("path",{d:b,...te}),e.jsx("path",{d:f}
1),e.jsx("path",{d:H(p),strokeWidth:"1.1"}),o>0&&e.jsx("path",{d:g,...z})]})}function Se({curve:t,offsets:s,nodes:r=[]}){const a=Ee(t,s),i=r.map(n=>{const l=M(t,n),o=M(a,n),m=Me(l,o);return`${_(l)}${Y([m[0],m[1]+1.4],o)}`}).join("");return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:H(t)}),e.jsx("path",{d:H(a)}),e.jsx("path",{d:`${_(t[0])}${ee([a[0][0],a[0][1]-1.2])}${i}`,strokeWidth:"0.9"})]})}function tt({x:t,y:s,angle:r,length:a,width:i,awn:n=0,awnAngle:l=0}){const o=[0,-a],m=`M0 0${K([-1.5*i,-.28*a],[-1.2*i,-.72*a],o)}${K([1.2*i,-.72*a],[1.5*i,-.28*a],[0,0])}Z`,d=`M0 0${K([-1.5*i,-.28*a],[-1.2*i,-.72*a],o)}Z`,u=l*Math.PI/180;return e.jsxs("g",{transform:je(t,s,r),children:[e.jsx("path",{d,...te}),e.jsx("path",{d:m}),n>0&&e.jsx("path",{d:`${_(o)}${ee([n*Math.sin(u),-a-n*Math.cos(u)])}`,...z})]})}function Et({x:t,y:s,angle:r,pairs:a,gap:i,size:n}){const o=4*n+a*i;return e.jsxs("g",{transform:je(t,s,r),children:[e.jsx("path",{d:`M0 ${T(2*n)}V${T(-o)}`,strokeWidth:"1.1"}),Array.from({length:a},(m,d)=>{const u=1-d*.035,c=d*7%5-2,h=d>=a-4?(15+(d-a+4)*3)*n:0;return e.jsxs("g",{children:[e.jsx(tt,{x:-.5,y:-(4*n+d*i),angle:-(20+c),length:11*n*u,width:3.1*n*u,awn:h,awnAngle:20+c-15}),e.jsx(tt,{x:.5,y:-(4*n+d*i+i/2),angle:20-c,length:11*n*u,width:3.1*n*u,awn:h,awnAngle:-5+c})]},d)}),e.jsx(tt,{x:0,y:-o,angle:0,length:9.5*n,width:2.6*n,awn:24*n,awnAngle:0})]})}function Ns(){const t=[[66,196],[62,160],[80,130],[84,92]],s=[2.8,2.6,2.2,1.8],r=[[90,196],[88,176],[106,160],[110,134]],a=[2.4,2.2,1.8,1.5],i=M(t,.45),n=[i,[i[0]-16,i[1]-22],[i[0]-41,i[1]-36],[i[0]-60,i[1]-14]],l=[i,[i[0]-14,i[1]-12],[i[0]-36,i[1]-24],n[3]],o=[i,[i[0]-15,i[1]-17],[i[0]-38,i[1]-30],n[3]],m=M(Ee(t,s),.18),d=M(r,.52);return e.jsxs(e.Fragment,{children:[e.jsx(Se,{curve:t,offsets:s,nodes:[.28,.6]}),e.jsx(Se,{curve:r,offsets:a,nodes:[.35]}),e.jsx("path",{d:`${_(i)}${K(o[1],o[2],o[3])}${K(l[2],l[1],l[0])}Z`,...te}),e.jsx("path",{d:`${_(i)}${K(n[1],n[2],n[3])}${K(l[2],l[1],l[0])}Z`}),e.jsx("path",{d:H(o),strokeWidth:"1.1"}),e.jsx(Re,{x:m[0],y:m[1],angle:de(t,.18)+40,length:32,width:2.6,bend:-3,veins:0}),e.jsx(Re,{x:d[0],y:d[1],angle:de(r,.52)-50,length:36,width:2.6,bend:5,veins:0}),e.jsx(Et,{x:84.9,y:92,angle:6,pairs:7,gap:7,size:1}),e.jsx(Et,{x:110.8,y:134,angle:9,pairs:5,gap:6.2,size:.85})]})}function $s({x:t,y:s,angle:r}){return e.jsxs("g",{transform:je(t,s,r),children:[e.jsx("path",{d:"M0 0C3.8 0 5 4 4.4 8.2C3.8 12 -3.8 12 -4.4 8.2C-5 4 -3.8 0 0 0Z"}),e.jsx("path",{d:"M2.8 1.6C4.8 4.2 4 9.4 0.4 10.2C3 7.2 3.2 4.2 2.8 1.6Z",...te,fillOpacity:.24}),e.jsx("path",{d:"M-2.4 3C-2.8 4.4 -2.8 5.6 -2.4 6.8",...z})]})}function Es(){const t=[[96,198],[104,140],[34,110],[58,16]],s=[[94.4,165.9],[104,160],[116,
1150],[121,128]],r=[{t:.3,side:-1,spread:52,length:30,bend:5,width:3.2},{t:.335,side:1,spread:50,length:29,bend:-3,width:3.1},{t:.42,side:-1,spread:48,length:29,bend:4,width:3.2},{t:.45,side:1,spread:46,length:28,bend:-5,width:3},{t:.54,side:-1,spread:46,length:27,bend:3,width:3.1},{t:.57,side:1,spread:44,length:26,bend:-3,width:3},{t:.66,side:-1,spread:48,length:25,bend:4,width:3},{t:.69,side:1,spread:46,length:24,bend:-4,width:2.9},{t:.78,side:-1,spread:52,length:22,bend:3,width:2.8},{t:.8,side:1,spread:50,length:21,bend:-3,width:2.8},{t:.9,side:-1,spread:46,length:19,bend:2,width:2.6},{t:1,side:1,spread:0,length:18,bend:2,width:2.6}],a=[{t:.3,side:-1,spread:45,length:22,bend:3,width:2.8},{t:.5,side:1,spread:42,length:20,bend:-3,width:2.7},{t:.72,side:-1,spread:40,length:19,bend:2,width:2.6},{t:1,side:1,spread:0,length:16,bend:2,width:2.4}],i=(l,o,m,d)=>{const u=M(s,l),c=[u[0]+o,u[1]+m];return e.jsxs("g",{children:[e.jsx("path",{d:`${_(u)}${Y([u[0]+o*.1,u[1]+m*.6],c)}`,strokeWidth:"1"}),e.jsx($s,{x:c[0],y:c[1],angle:d})]},l)},n=[.08,.17,.36].map(l=>{const o=M(Ee(t,[1.6,1.4,1,.7]),l);return`${_([o[0]-1.1,o[1]])}${Y([o[0],o[1]-.9],[o[0]+1.1,o[1]])}`}).join("");return e.jsxs("g",{transform:"translate(5.6 8.3) scale(0.92)",children:[e.jsx(Se,{curve:t,offsets:[3.2,2.8,2,1.4]}),e.jsx("path",{d:n,...z}),e.jsx("path",{d:H(s),strokeWidth:"1.4"}),r.map(l=>{const o=M(t,l.t);return e.jsx(Re,{x:o[0],y:o[1],angle:de(t,l.t)+l.side*l.spread,length:l.length,width:l.width,bend:l.bend,veins:0},l.t)}),a.map(l=>{const o=M(s,l.t);return e.jsx(Re,{x:o[0],y:o[1],angle:de(s,l.t)+l.side*l.spread,length:l.length,width:l.width,bend:l.bend,veins:0},l.t)}),i(.42,-2.2,7.5,6),i(.6,.8,6.6,-5)]})}function Ss(){const t=[[14,80],[24,66],[52,64],[70,80]],s=[[14,128],[30,140],[52,140],[70,132]],r=[[14,138],[30,150],[54,150],[70,142]],a=[[126,79],[117,66.5],[89,62.5],[70,80]],i=[[126,128],[110,139],[88,140],[70,132]],n=[[126,138],[110,150],[86,150],[70,142]],l=(u,c,h)=>h.map(([p,f])=>{const b=$t(u,c,p),g=M(b,.2),j=M(b,f),y=M(b,(.2+f)/2);return`${_(g)}${Y([2*y[0]-(g[0]+j[0])/2,2*y[1]-(g[1]+j[1])/2],j)}`}).join(""),o=(u,c,h)=>[.95,.87,.77].map((p,f)=>{const b=M(u,p),g=M(c,p),j=Me(b,g);return e.jsx("path",{d:`${_(b)}${Y([j[0]+h*1.8,j[1]],g)}`,strokeWidth:"0.8",strokeOpacity:[.6,.45,.32][f]},p)}),m=[-66,-52,-39,-26,-13,0,13,26,39,52,66].map((u,c)=>{const h=u*Math.PI/180,p=[20,28,22,33,26,38,25,34,22,30,19][c];return`${_([70+10*Math.sin(h),72-10*Math.cos(h)])}${ee([70+p*Math.sin(h),72-p*Math.cos(h)])}`}).join(""),d=(u,c)=>[.3,.55,.78].map(h=>H($t(u,c,h))).join("");return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:m,strokeWidth:"0.9",strokeOpacity:"0.65"}),e.jsx("path",{d:`${H(t)}${H(a)}${H(s)}${H(i)}M14 80C11 96 11 112 14 128M126 79C129 96 129 112 126 128`}),e.jsx("path",{d:"M70 80C69 98 69 116 70 132L70 142",strokeWidth:"1.3"}),e.jsx("path",{d:`M13 82L10 85C7 99 7 114 10 128C10 134 11 137 14 138${K(r[1],r[2],r[3])}M127 81L130 84C133 98 133 114 130 128C130 134 129 137 126 138${K(n[1],n[2],n[3])}M14 128V138M126 128V138`}),e.jsx("path",{d:`${d(s,r)}${d(i,n)}`,...z}),e.jsx("path",{d:l(t,s,[[.13,.66],[.25,.68],[.37,.67],[.49,.68],[.61,.66],[.73,.66],[.85,.42]]),...z}),e.jsx("path",{d:l(a,i,[[.13,.66],[.25,.67],[.37,.4],[.6,.68],[.72,.66],[.84,.5]]),...z}),o(t,s,1),o(a,i,-1),e.jsx("path",{d:"M68.4 136C67 150 63.4 162 59.6 176L63.4 173.6L66.6 177C68.6 163 72.2 150 72.4 138Z",...te}),e.jsx("path",{d:"M68.4 136C67 150 63.4 162 59.6 176L63.4 173.6L66.6 177C68.6 163 72.2 150 72.4 138",strokeWidth:"1.2"})]})}function st({x0:t,y0:s,x1:r,y1:a,bands:i}){const l=s+3.4,o=a-3.4,m=(s+a)/2,d=`M${t+2.4} ${s}H${r-2.4}Q${r} ${s} ${r} ${s+2.4}V${a-2.4}Q${r} ${a} ${r-2.4} ${a}H${t+2.4}Q${t} ${a} ${t} ${a-2.4}V${s+2.4}Q${t} ${s} ${t+2.4} ${s}Z`,u=`M${t+3} ${l}H${r-3}M${t+3} ${o}H${r-3}`,c=i.map(f=>`M${f} ${l}V${o}M${f+2.2} ${l}V${o}`).join(""),h=i.map(f=>`M${f} ${l}H${f+2.2}V${o}H${f}Z`).join(""),p=Array.from({length:i.length+1},(f,b)=>[b===0?t+3:i[b-1]+2.2,b===i.length?r-3:i[b]]).filter(([f,b])=>b-f>=9).map(([f,b])=>{const g=(f+b)/2,j=b-f>=11?`M${T(g-6)} ${m}H${T(g-3.6)}M${T(g+3.6)} ${m}
1H${T(g+6)}`:"";return`M${T(g)} ${m-3.4}L${T(g+2.3)} ${m}L${T(g)} ${m+3.4}L${T(g-2.3)} ${m}Z${j}`}).join("");return e.jsxs("g",{children:[e.jsx("path",{d:`M${t+3} ${o}H${r-3}V${a}H${t+3}Z`,fill:"currentColor",fillOpacity:"0.1",stroke:"none"}),e.jsx("path",{d:h,fill:"currentColor",fillOpacity:"0.2",stroke:"none"}),e.jsx("path",{d}),e.jsx("path",{d:u,...z}),e.jsx("path",{d:c,strokeWidth:"1"}),e.jsx("path",{d:p,strokeWidth:"0.9"})]})}function Cs(){const t=[[113,157.5],[108,114],[92,66],[70,14]],s=16,r=Array.from({length:s+1},(n,l)=>{const o=l/s,m=.3+.7*o,d=M(t,m),[u,c]=He(ze(t,m)),h=Math.pow(Math.sin(Math.PI*Math.pow(o,.75)),.8),p=l===7||l===8?.5:1,f=[d[0]+(u*.766+c*.643)*26*h,d[1]+(c*.766-u*.643)*26*h],b=[d[0]+(u*.766-c*.643)*16*h*p,d[1]+(c*.766+u*.643)*16*h*p];return{p:d,l:f,r:b}}),a=Array.from({length:6},(n,l)=>{const o=.3*l/5,m=M(t,o),[d,u]=He(ze(t,o));return{l:[m[0]+u*1.7,m[1]-d*1.7],r:[m[0]-u*1.7,m[1]+d*1.7]}}),i=_e(r.map(n=>n.l));return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:_e(a.map(n=>n.l)),strokeWidth:"1.3"}),e.jsx("path",{d:_e(a.map(n=>n.r)),strokeWidth:"1.3"}),e.jsx("path",{d:`${i}${[...r].reverse().map(n=>ee(n.p)).join("")}Z`,...te}),e.jsx("path",{d:i,strokeWidth:"1.2"}),e.jsx("path",{d:_e(r.map(n=>n.r)),strokeWidth:"1.2"}),e.jsx("path",{d:_e(r.map(n=>n.p)),strokeWidth:"1.2"}),e.jsx("path",{d:r.slice(1,-1).map(n=>`${_(n.p)}${ee(n.l)}${_(n.p)}${ee(n.r)}`).join(""),...z})]})}function Ms(){return e.jsxs(e.Fragment,{children:[e.jsx(st,{x0:12,y0:158,x1:92,y1:182,bands:[24,38,52,66,80]}),e.jsx(st,{x0:17,y0:136,x1:87,y1:158,bands:[31,43,55,67]}),e.jsx(st,{x0:26,y0:116,x1:80,y1:136,bands:[38,50,62]}),e.jsx(Cs,{}),e.jsx("path",{d:"M105 156C105 154.6 108 154.2 111.3 154.05M114.7 154.05C118 154.2 121 154.6 121 156M105 156C105 158.6 121 158.6 121 156"}),e.jsx("path",{d:"M105 158C102 159 97 162 97 170V176C97 180 103 182 113 182C123 182 129 180 129 176V170C129 162 124 159 121 158"}),e.jsx("path",{d:"M99 177C103 181 123 181 127 177",...z}),e.jsx("path",{d:"M101 166C100.4 170 101 174 103 177M122 166L125 170M121 171L125 176M120 176L123 179",...z})]})}function Is({x:t,y:s,angle:r,size:a}){const i=a/12,n=d=>Number((d/i).toFixed(2)),l="M0 0C-4.4 -2.4 -6.2 -8.6 -2.2 -11.4C-1.4 -12 -0.6 -11.4 0 -10.4C0.6 -11.4 1.4 -12 2.2 -11.4C6.2 -8.6 4.4 -2.4 0 0Z",o="M0 0C-4.4 -2.4 -6.2 -8.6 -2.2 -11.4C-1.4 -12 -0.6 -11.4 0 -10.4Z",m=Array.from({length:9},(d,u)=>{const c=(u*40+12)*Math.PI/180,h=4.2+u%3*1.1;return[Math.sin(c)*h,-Math.cos(c)*h]});return e.jsxs("g",{transform:`${je(t,s,r)} scale(${i.toFixed(3)})`,strokeWidth:n(1.3),children:[[0,72,144,216,288].map(d=>e.jsxs("g",{transform:`rotate(${d})`,children:[e.jsx("path",{d:o,...te}),e.jsx("path",{d:l}),e.jsx("path",{d:"M0 -1.8L0 -8.4",strokeWidth:n(.8),strokeOpacity:"0.6"})]},d)),e.jsx("path",{d:m.map(d=>`M0 0${ee(d)}`).join(""),strokeWidth:n(.8)}),m.map((d,u)=>e.jsx("circle",{cx:T(d[0]),cy:T(d[1]),r:"0.9",fill:"currentColor",fillOpacity:"0.7",stroke:"none"},u)),e.jsx("circle",{r:"1.3",strokeWidth:n(.8)})]})}function St({x:t,y:s,angle:r,size:a}){const i=n=>Number((n/a).toFixed(2));return e.jsxs("g",{transform:`${je(t,s,r)} scale(${a})`,strokeWidth:i(1.3),children:[e.jsx("path",{d:"M0 0C-3.2 -2 -3.8 -7 0 -11C-0.6 -8 -0.6 -3 0 0Z",...te}),e.jsx("path",{d:"M0 0C-3.2 -2 -3.8 -7 0 -11C3.8 -7 3.2 -2 0 0Z"}),e.jsx("path",{d:"M-2.5 -0.4C-2.7 -2.6 -1.8 -3.8 0 -4C1.8 -3.8 2.7 -2.6 2.5 -0.4",strokeWidth:i(.9)}),e.jsx("path",{d:"M0 -4C-0.5 -6.4 -0.2 -8.6 0.2 -10",strokeWidth:i(.8),strokeOpacity:"0.6"})]})}function Ls(){const t=[[44,196],[46,160],[90,140],[88,96]],s=[3,2.6,2,1.6],r=[[88,96],[86,76],[76,56],[74,30]],a=[1.6,1.4,1.2,1],i=Ee(t,s),n=Ee(r,a),l=[M(t,.55),[58,134],[44,122],[34,104]],o=[M(n,.25),[96,72],[108,66],[116,50]],m=[M(r,.7),[66,46],[52,40],[44,24]],d=[M(i,.82),[94,116],[102,112],[108,102]],u=[M(r,.45),[76,66],[70,66],[65,58]],c=(g,j)=>Vt(g[3],He([g[3][0]-g[2][0],g[3][1]-g[2][1]]),j),h=g=>Ut([g[3][0]-g[2][0],g[3][1]-g[2][1]]),p=[{at:c(r,8.6),angle:8,size:12},{at:c(o,7.2),angle:38,size:10},{at:c(m,6.5),angle:-22,size:9},{at:c(d,6.1),angle:16,size:8.5}],f=[{curve:l,t:.3,turn:-52,length:20,width:3.2,bend:3,veins:2},{curve:l,t:.5,turn:46,length:24,width:3.4,bend:-3,veins:3},{curve:t,t:.3,turn:-45,length:22,width:3.2,bend:3,veins:3},{curve:i,t:.18,turn:55,length:21,width:3.2,bend:-3,veins:3},{curve:d,t:.4,turn:50,length:16,width:2.8,bend:-2,veins:2}],b=[.1,.2,.4].map(g=>{const j=Me(M(t,g),M(i,g));return`${_([j[0]-.9,j[1]])}${Y([j[0],j[1]-.8],[j[0]+.9,j[1]])}`}).join("");return e.jsxs(e.Fragment,{children:[e.jsx(Se,{curve:t,offsets:s}),e.jsx(Se,{curve:r,offsets:a}),e.jsx("path",{d:b,...z}),e.jsx("path",{d:`${H(l)}${H(o)}${H(m)}${H(d)}`,strokeWidth:"1.3"}),e.jsx("path",{d:H(u),strokeWidth:"1.2"}),f.map(g=>{const j=M(g.curve,g.t);return e.jsx(Re,{x:j[0],y:j[1],angle:de(g.curve,g.t)+g.turn,length:g.length,width:g.width,bend:g.bend,veins:g.veins},`${g.curve[3][0]}:${g.t}`)}),e.jsx(St,{x:l[3][0],y:l[3][1],angle:h(l),size:1.1}),e.jsx(St,{x:u[3][0],y:u[3][1],angle:h(u),size:.95}),p.map(g=>e.jsx(Is,{x:g.at[0],y:g.at[1],angle:g.angle,size:g.size},g.size))]})}function _s(){const t=[[6,182],[46,190],[112,180],[124,124]],s=[[137.6,2.6],[141.5,3.4],[148,6.6],[153.8,2.8],[157,2.8],[159.6,5],[162.4,2.8],[167,3.4],[173,11],[176.4,16]],r=[-108,-90,-72,-54,-36,-18,0,18,36,54,72,90,108].map((n,l)=>{const o=n*Math.PI/180,m=[26,33,28,36,30,38,40,33,31,36,27,34,25][l];return`${_([71+19*Math.sin(o),66-19*Math.cos(o)])}${ee([71+m*Math.sin(o),66-m*Math.cos(o)])}`}).join(""),a=Array.from({length:24},(n,l)=>[1,-1].map(o=>{const m=Math.min(.04+l*.039+(o>0?0:.018),.98);if(o>0&&m>.4&&m<.62)return"";const d=M(t,m),[u,c]=He(ze(t,m)),h=[o*c,-o*u],p=13*(1-.55*m)*(.9+.05*(l*3%4)),f=[d[0]+(u*.616+h[0]*.788)*p,d[1]+(c*.616+h[1]*.788)*p];return`${_(d)}${Y([d[0]+u*p*.62+h[0]*p*.18,d[1]+c*p*.62+h[1]*p*.18],f)}`}).join("")).join(""),i=[-26,0,26].map(n=>{const l=(de(t,1)+n)*Math.PI/180;return`${_(t[3])}${ee([t[3][0]+9*Math.sin(l),t[3][1]-9*Math.cos(l)])}`}).join("");return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:H(t),strokeWidth:"1.6"}),e.jsx("path",{d:`${a}${i}`,strokeWidth:"0.9",strokeOpacity:"0.8"}),e.jsxs("g",{transform:"translate(0 -8)",children:[e.jsx("path",{d:"M71 80C64 78 62.4 69 66.6 63C69 59.8 70 56 70.4 52C74.4 56.6 79 62.4 77.4 70.4C76.4 75.6 74 79.6 71 80Z",strokeWidth:"1.4"}),e.jsx("path",{d:"M71 78C67.6 76.6 67 71 69.4 67.4C70.4 66 70.8 64.6 71 62.6C73.4 65.6 75.2 69.6 74 73.6C73.4 75.8 72.4 77.4 71 78Z",...te,fillOpacity:.26}),e.jsx("path",{d:r,strokeWidth:"0.9",strokeOpacity:"0.6"}),e.jsx("path",{d:"M70 85.8C70 83.4 70.3 82 71 80.6",strokeWidth:"1.1"}),e.jsx("path",{d:"M65.6 86L65 126M74.4 86L75 126M65.6 86C65.6 84.2 74.4 84.2 74.4 86C74.4 87.8 65.6 87.8 65.6 86Z"}),e.jsx("path",{d:"M74.4 88.4C77.2 89 77.4 94.4 77 98.6C76.8 101.6 73.6 101.4 73.6 98.4M65.6 91C63.4 91.6 63.4 95 63.8 97C64.1 98.8 66 98.8 66.2 97",strokeWidth:"1.2"}),e.jsx("path",{d:"M72.4 90L72.6 120M71 96L71.2 112",...z}),e.jsx("path",{d:"M63.4 126C63.4 124.8 64.4 124.3 65.2 124.2M74.8 124.2C75.6 124.3 76.6 124.8 76.6 126M63.4 126C63.4 128.4 76.6 128.4 76.6 126M63.8 127.6L64.6 133M76.2 127.6L75.4 133"}),e.jsx("path",{d:"M50 133C50 131.4 56 130.4 64 130.3M76 130.3C84 130.4 90 131.4 90 133M50 133C50 136 90 136 90 133M50.4 134.6C52 138.8 88 138.8 89.6 134.6"}
1),e.jsx("path",{d:`${et(70,s,1)}L70 176.4L70 137.6Z`,...te,fillOpacity:.12}),e.jsx("path",{d:et(70,s,-1)}),e.jsx("path",{d:et(70,s,1)}),e.jsx("path",{d:"M63.4 148Q70 149.6 76.6 148M65 159.6Q70 161.2 75 159.6",...z}),e.jsx("path",{d:"M54 176.4C54 174.6 86 174.6 86 176.4M54 176.4C54 179 86 179 86 176.4"})]})]})}function Ue({x:t,y:s,angle:r,length:a,width:i,spikes:n=4}){const l=u=>i*Math.pow(Math.sin(Math.PI*u),.8),o=(u,c)=>{const h=[[0,0]],p=[];for(let g=0;g<n;g++){const j=.22+g*(.56/(n-1))+c,y=[u*(l(j)*1.12+1),-a*j];h.push([u*l(j-.11)*.6,-a*(j-.11)],y),p.push(y)}h.push([0,-a]);const f=h.slice(1).map((g,j)=>{const y=h[j],v=Me(y,g),C=Math.hypot(g[0]-y[0],g[1]-y[1]),k=j===0?-.1:j%2===1?-.06:.24;return{a:y,b:g,c:[v[0]-u*k*C,v[1]]}}),b=p.map(g=>{const j=[0,g[1]+a*.13],y=[g[0]*.8,g[1]+a*.02];return`${_(j)}${Y([y[0]*.35,(j[1]+y[1])/2+a*.02],y)}`}).join("");return{forward:f.map(g=>Y(g.c,g.b)).join(""),backward:[...f].reverse().map(g=>Y(g.c,g.a)).join(""),veins:b}},m=o(-1,0),d=o(1,.06);return e.jsxs("g",{transform:je(t,s,r),children:[e.jsx("path",{d:`M0 0${d.forward}Z`,...te}),e.jsx("path",{d:`M0 0${m.forward}${d.backward}Z`}),e.jsx("path",{d:`M0 0L0 ${T(-a)}`,strokeWidth:"1.1"}),e.jsx("path",{d:`${m.veins}${d.veins}`,...z})]})}function Ps({x:t,y:s,r=3.4}){const a=i=>T(i*r*10)/10;return e.jsxs("g",{transform:`translate(${T(t)} ${T(s)})`,children:[e.jsx("circle",{r}),e.jsx("path",{d:`M${a(.7)} ${a(-.7)}A${r} ${r} 0 0 1 ${a(-.7)} ${a(.7)}Q${a(.9)} ${a(.9)} ${a(.7)} ${a(-.7)}Z`,...te,fillOpacity:.28}),e.jsx("path",{d:`M${a(-.6)} ${a(-.1)}Q${a(-.5)} ${a(-.55)} ${a(-.1)} ${a(-.65)}`,strokeWidth:"0.8",strokeOpacity:"0.7"})]})}function As(){const t=[[40,196],[46,168],[90,166],[98,128]],s=[2.2,2,1.6,1.2],r=[70,52],a=[[70,8],[72.5,46],[82,40],[76,49.5],[100,52],[76,54.5],[82,64],[72.5,58],[70,78],[67.5,58],[58,64],[64,54.5],[40,52],[64,49.5],[58,40],[67.5,46]],i=(h,p)=>{const f=Me(h,p);return Y(Vt(f,[r[0]-f[0],r[1]-f[1]],.14),p)},n=`${_(a[0])}${a.slice(1).map((h,p)=>i(a[p],h)).join("")}${i(a[15],a[0])}Z`,l=a.map((h,p)=>p%2?"":`${_(h)}${ee(a[p+1])}${ee(r)}Z`).join(""),o=[0,4,8,12].map(h=>`${_(a[h])}${ee(r)}`).join(""),m=M(t,.66),d=[[74,146],[80,150.5],[70.5,152.5]],u=h=>M(t,h),c=M(Ee(t,s),.62);return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:l,...te,fillOpacity:.2}),e.jsx("path",{d:n,strokeWidth:"1.4"}),e.jsx("path",{d:o,...z}),e.jsx("circle",{cx:"70",cy:"52",r:"2.2",fill:"currentColor",fillOpacity:"0.4",strokeWidth:"1"}),e.jsx(Se,{curve:t,offsets:s}),e.jsx(Ue,{x:u(.4)[0],y:u(.4)[1],angle:de(t,.4)-70,length:34,width:9}),e.jsx(Ue,{x:c[0],y:c[1],angle:de(t,.62)+48,length:32,width:8.5}),e.jsx(Ue,{x:u(.82)[0],y:u(.82)[1],angle:de(t,.82)-62,length:30,width:8,spikes:3}),e.jsx(Ue,{x:t[3][0],y:t[3][1],angle:de(t,1)-4,length:33,width:8.5}),e.jsx("path",{d:d.map(h=>`${_(m)}${Y([(m[0]+h[0])/2,(m[1]+h[1])/2+3],h)}`).join(""),strokeWidth:"1"}),d.map(h=>e.jsx(Ps,{x:h[0],y:h[1]},h[0]))]})}function Rs({kind:t}){switch(t){case"gratitude":return e.jsx(Ns,{});case"psalms":return e.jsx(Es,{});case"devotional":return e.jsx(Ss,{});case"encouragement":return e.jsx(Ls,{});case"study":return e.jsx(Ms,{});case"advent":return e.jsx(_s,{});case"christmas":return e.jsx(As,{})}}function Ds({kind:t}){return e.jsx("svg",{viewBox:"0 0 140 200",preserveAspectRatio:"xMidYMid meet",fill:"none","aria-hidden":"true",focusable:"false",className:"pointer-events-none mx-auto block h-80 w-full select-none text-secondary-700/55 dark:text-secondary-300/45 sm:h-96 lg:h-[28rem]",children:e.jsx("g",{stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx(Rs,{kind:t})})})}function Ts({event:t}){var r;const{t:s}=P("events");return e.jsxs("section",{className:"mt-10 space-y-4 sm:mt-14","aria-label":s("resources.teaserTitle"),children:[e.jsxs("h2",{className:"text-lg font-normal tracking-tight text-gray-900 dark:text-white",children:[s("resources.headingNormal")," ",e.jsx("strong",{className:"font-bold",children:s("resources.headingBold")})]}),e.jsx("p",{className:"max-w-[62ch] text-sm leading-7 text-gray-600 dark:text-gray-300",children:s("resources.teaserWallpaper")}),(r=t.resourceKinds)==null?void 0:r.map(a=>
1e.jsx("p",{className:"max-w-[62ch] text-sm leading-7 text-gray-600 dark:text-gray-300",children:s(a==="audio"?"resources.teaserAudio":a==="image"?"resources.teaserImage":"resources.teaserDocument")},a)),e.jsx("p",{className:"text-xs leading-6 text-gray-500 dark:text-gray-400",children:s("resources.teaserLocked")})]})}function Os({event:t,ownerId:s}){const r=ce(V.events.getMyProgress,{eventId:t._id}),a=xe(V.events.setDayCompleted);return e.jsx(Vs,{event:t,ownerId:s,progress:r,onUndo:async i=>{if((await a({eventId:t._id,dayNumber:i,completed:!1})).ownerId!==s)throw new Error("Event progress owner changed")}})}function Vs({event:t,ownerId:s,progress:r,onUndo:a}){const{t:i}=P("events"),n=x.useId(),[l,o]=x.useState(null),[m,d]=x.useState(!1),u=x.useRef(!1),c=(r==null?void 0:r.ownerId)===s?r.completedDays.filter(p=>p>t.availableDayCount&&p<=t.dayCount):[];if(!c.length)return null;const h=async p=>{if(!(u.current||!c.includes(p))){u.current=!0,o(p),d(!1);try{await a(p)}catch{d(!0)}finally{u.current=!1,o(null)}}};return e.jsxs("section",{"aria-labelledby":n,className:"mt-8 space-y-4",children:[e.jsx("h2",{id:n,className:"text-sm font-semibold",children:i("journey.completionHistory")}),e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:i("journey.completionHistoryHelp")}),e.jsx("ul",{className:"space-y-2",children:c.map(p=>e.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-300",children:i("day",{number:p})}),e.jsx(D,{type:"button",variant:"ghost",disabled:l!==null,onClick:()=>{h(p)},className:"min-h-11 whitespace-normal",children:i(l===p?"saving":"journey.undoCompletion",{number:p})})]},p))}),m&&e.jsx("p",{role:"alert",className:"text-sm text-red-700 dark:text-red-300",children:i("saveError")})]})}function ot({event:t,dayNumber:s,completedDays:r=[],onSelect:a}){const{t:i,i18n:n}=P("events"),l=x.useId(),o=new Set(r),m=Array.from({length:t.dayCount},(d,u)=>{const c=u+1,h=t.days.find(f=>f.dayNumber===c),p=new Date((is(t.startsOn)+u)*864e5).toISOString().slice(0,10);return{number:c,day:h,date:p}});return e.jsxs("nav",{"aria-label":i("daysLabel"),children:[e.jsxs("div",{className:"lg:hidden",children:[e.jsx("label",{htmlFor:l,className:"mb-2 block text-sm text-gray-500 dark:text-gray-400",children:i("daysLabel")}),e.jsx("select",{id:l,value:s,onChange:d=>a(Number(d.target.value)),className:"min-h-12 w-full cursor-pointer rounded-md border border-gray-300 bg-transparent px-3 text-base transition-colors duration-150 hover:border-secondary-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-secondary-500 dark:border-dark-500 dark:hover:border-secondary-400 motion-reduce:transition-none",children:m.map(({number:d,day:u,date:c})=>e.jsx("option",{value:d,disabled:!u,children:u?`${i("day",{number:d})} · ${$(u.title,n.language)}`:i("journey.dayLocked",{number:d,date:Pe(c,n.language)})},d))})]}),e.jsx("ol",{className:"hidden space-y-1 lg:block",children:m.map(({number:d,day:u,date:c})=>e.jsx("li",{children:e.jsxs("button",{type:"button",disabled:!u,onClick:()=>a(d),"aria-current":d===s?"step":void 0,className:`flex min-h-11 w-full items-start gap-3 rounded-md px-3 py-3 text-left text-sm leading-snug transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-secondary-500 motion-reduce:transition-none ${d===s?"bg-secondary-500/10 text-secondary-800 enabled:hover:bg-secondary-500/20 dark:text-secondary-300":"text-gray-500 enabled:hover:bg-gray-900/5 enabled:hover:text-gray-900 dark:text-gray-400 dark:enabled:hover:bg-white/10 dark:enabled:hover:text-white"} disabled:cursor-default disabled:opacity-60`,children:[e.jsx("span",{className:"w-5 shrink-0 pt-px text-center",children:o.has(d)?e.jsx(De,{className:"mx-auto h-4 w-4","aria-label":i("completed")}):u?d:e.jsx(ms,{className:"mx-auto h-3.5 w-3.5","aria-hidden":"true"})}),e.jsx("span",{className:"min-w-0 break-words",children:u?$(u.title,n.language):i("journey.dayLocked",{number:d,date:Pe(c,n.language)})})]})},d))})]})}function Us({ownerId:t,...s}){const r=ce(V.events.getMyProgress,{eventId:s.event._id});
1return e.jsx(ot,{...s,completedDays:(r==null?void 0:r.ownerId)===t?r.completedDays:[]})}const Ws={track:()=>{},view:()=>{}},Wt=x.createContext(Ws);function ie(){return x.useContext(Wt)}function Bs(t){const{t:s,i18n:r}=P("events"),a=t.reference??Tt(t.day);if(!t.isOpen||!a||!Ne(t.event,t.day.dayNumber))return null;const i=`${t.event.slug}:${t.day.dayNumber}:${t.translation.id}:${r.language}:${JSON.stringify(a)}`;return e.jsx(Je,{isOpen:!0,onClose:t.onClose,title:s("sharing.title"),maxWidth:"3xl",desktopModalMobileDrawer:!0,children:e.jsx(ye,{componentName:"EventShareDialog",fallback:e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:s("sharing.verseUnavailable")}),children:e.jsx(Fs,{...t,reference:a},i)})})}function Fs({event:t,day:s,translation:r,reference:a,onClose:i}){const{t:n,i18n:l}=P("events"),{isAuthenticated:o,isLoading:m}=Ye(),{isLoaded:d,isSignedIn:u}=qe(),c=!!(u&&o),h=!!(d&&u&&m),p=xe(V.sharedVerses.createShare),f=xe(V.sharedVerses.updateShare),b=Ke(),g=ie(),j=Te(a,l.language),y=ce(V.bible.getChapter,j?{bookId:j.bookId,chapter:j.chapter,translationId:r.id}:"skip"),v=x.useMemo(()=>ut(y,{book:a.book,chapter:a.chapter,verseStart:a.verseStart,verseEnd:a.verseEnd},{id:r.id,label:r.label},l.language),[y,a.book,a.chapter,a.verseStart,a.verseEnd,r.id,r.label,l.language]),[C,k]=x.useState(()=>$(s.shareMessage??s.focus,l.language)),[E,I]=x.useState(""),[S,Z]=x.useState(null),[se,G]=x.useState(!1),[U,Q]=x.useState(0),[w,J]=x.useState(null),[ae,O]=x.useState(null),[B,re]=x.useState(!1),[ge,oe]=x.useState(!1),[q,W]=x.useState(null),X=x.useId(),N=x.useId(),A=x.useId(),ue=xs(t.slug,s.dayNumber),ne=new URL(ue,rt).href,be=$(t.title,l.language),ve=s.imagePrompt?$(s.imagePrompt,l.language):"",Ie=v&&ve?`${ve}
2
3${v.text}
4${v.reference} (${v.translationLabel})`:"",[Ve,Xe]=x.useState(null),ke=Ve??Ie,L=Ot(C,ne),F=x.useMemo(()=>S?new File([S.blob],`${t.slug}-day-${s.dayNumber}.png`,{type:"image/png"}):null,[S,t.slug,s.dayNumber]);let we=!1;if(F&&typeof navigator.share=="function"&&typeof navigator.canShare=="function")try{we=navigator.canShare({files:[F],title:v==null?void 0:v.reference,text:C.trim(),url:ne})}catch{we=!1}x.useEffect(()=>{if(!v)return;let R=!0,Le;return Z(null),G(!1),mt(t.artwork,v,be).then(gt=>{R&&(Le=URL.createObjectURL(gt),Z({blob:gt,url:Le}))}).catch(()=>{R&&G(!0)}),()=>{R=!1,Le&&URL.revokeObjectURL(Le)}},[v,t.artwork,be,U]);const pt=async R=>{W(null);try{await navigator.clipboard.writeText(R),g.track("share",s.dayNumber),oe(!0)}catch{W(n("sharing.copyError"))}},Qt=async()=>{if(!(!F||!we||B)){re(!0),W(null);try{await navigator.share({files:[F],title:v==null?void 0:v.reference,text:C.trim(),url:ne}),g.track("share",s.dayNumber)}catch(R){R instanceof DOMException&&R.name==="AbortError"||W(n("sharing.shareError"))}finally{re(!1)}}},qt=async()=>{if(!(!v||!c||B)){re(!0),W(null);try{let R=ae;if(R?await f({shareId:R,recipientName:E.trim()||void 0,message:L}):(R=(await p({recipientName:E.trim()||void 0,message:L,verses:[{reference:v.canonicalReference,text:v.text,translation:v.translationId}],theme:be,sourceEventId:t._id,sourceDayNumber:s.dayNumber})).shareId,O(R)),!R)throw new Error("A saved share link is required");J(new URL(`/share/verse/${encodeURIComponent(R)}`,rt).href),oe(!1)}catch{W(n("sharing.linkError"))}finally{re(!1)}}},Kt=()=>{!v||!ke.trim()||(g.track("tool_open",s.dayNumber),i(),b(`/image-studio?${new URLSearchParams({prompt:ke.trim()})}`))};return e.jsxs("div",{className:"grid gap-8 pb-6 sm:grid-cols-[minmax(0,0.85fr)_minmax(0,1fr)] sm:gap-10",children:[e.jsxs("div",{className:"min-w-0 space-y-4",children:[S?e.jsx("img",{loading:"lazy",decoding:"async",src:S.url,alt:`${v==null?void 0:v.reference}. ${n("sharing.artworkAlt")}`,width:1080,height:1350,className:"mx-auto w-full max-w-sm rounded-sm"}):e.jsx("div",{className:"flex aspect-[4/5] items-center justify-center rounded-sm bg-light-100 px-6 text-center dark:bg-dark-900",role:"status",children:e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:n(se?"sharing.artworkError":y!==void 0&&!v?"sharing.verseUnavailable":"sharing.preparing")})}),se?e.jsx(D,{type:"button",variant:"ghost",onClick:()=>Q(R=>R+1),className:"min-h-11 w-full",children:n("retry")}):null,v?e.jsx("p",{className:"text-xs leading-relaxed text-gray-500 dark:text-gray-400",children:n("sharing.exactText")}):null,we?null:e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:n("sharing.fallbackHelp")}),e.jsxs(D,{type:"button",variant:"ghost",disabled:!S,onClick:()=>S&&xt(S.blob,`${t.slug}-day-${s.dayNumber}.png`),className:"min-h-11 w-full whitespace-normal",children:[e.jsx(lt,{className:"h-4 w-4","aria-hidden":"true"}),n("sharing.download")]})]}),e.jsxs("div",{className:"min-w-0 space-y-7",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{htmlFor:X,className:"block text-sm font-medium text-gray-900 dark:text-white",children:n("sharing.message")}),e.jsx("textarea",{id:X,value:C,disabled:B,onChange:R=>{k(R.target.value),J(null),oe(!1)},maxLength:4e3,rows:5,className:"w-full resize-y rounded-md border border-light-600/30 bg-transparent p-3 text-base leading-relaxed text-gray-900 focus:outline-none focus:ring-2 focus:ring-secondary-500/40 disabled:opacity-60 dark:border-dark-500/30 dark:text-white"}),e.jsx("p",{className:"text-xs leading-relaxed text-gray-500 dark:text-gray-400",children:n("sharing.privateHelp")}),e.jsx("p",{className:"break-all text-sm leading-relaxed text-gray-500 dark:text-gray-400",children:ne})]}),e.jsxs("div",{className:"space-y-3",children:[we?e.jsxs(D,{type:"button",disabled:B||!C.trim(),onClick:()=>void Qt(),className:"min-h-11 w-full whitespace-normal bg-secondary-500 text-black hover:bg-secondary-600",children:[e.jsx(Ge,{className:"h-4 w-4","aria-hidden":"true"}),n("sharing.share")]}):null,e.jsxs(D,{type:"button",variant:we?"ghost":"secondary",onClick:()=>void pt(L),className:"min-h-11 w-full whitespace-normal",children:[e.jsx(nt,{className:"h-4 w-4","aria-hidden":"true"}),n("sharing.copyMessage")]}),ge?e.jsxs("p",{role:"status",className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300",children:[e.jsx(De,{className:"h-4 w-4","aria-hidden":"true"}),n("sharing.copied")]}):null]}),e.jsxs("details",{className:"group",children:[e.jsx("summary",{className:"flex min-h-11 cursor-pointer items-center text-sm font-medium text-gray-900 marker:text-secondary-600 dark:text-white",children:n("sharing.friendLink")}),e.jsxs("div",{className:"space-y-4 pt-4",children:[e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:n("sharing.friendHelp")}),c?e.jsxs(e.Fragment,{children:[e.jsx("label",{htmlFor:N,className:"block text-sm font-medium text-gray-900 dark:text-white",children:n("sharing.recipient")}),e.jsx("input",{id:N,value:E,disabled:B,onChange:R=>{I(R.target.value),J(null),oe(!1)},maxLength:120,autoComplete:"off",className:"min-h-11 w-full rounded-md border border-light-600/30 bg-transparent px-3 text-base text-gray-900 focus:outline-none focus:ring-2 focus:ring-secondary-500/40 disabled:opacity-60 dark:border-dark-500/30 dark:text-white"}),e.jsxs(D,{type:"button",variant:"ghost",disabled:!v||B,onClick:()=>void qt(),className:"min-h-11 w-full whitespace-normal",children:[B?e.jsx(me,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}):null,n(ae?"sharing.updateLink":"sharing.createLink")]}),w?e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{role:"status",className:"text-sm text-gray-600 dark:text-gray-300",children:n("sharing.linkReady")}),e.jsx("a",{href:w,className:"block break-all text-sm text-secondary-700 underline dark:text-secondary-300",children:w}),e.jsxs(D,{type:"button",variant:"ghost",onClick:()=>void pt(w),className:"min-h-11 w-full",children:[e.jsx(nt,{className:"h-4 w-4","aria-hidden":"true"}),n("sharing.copyLink")]})]}):null]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:n("sharing.signInHelp")}),h?e.jsx("p",{role:"status",className:"text-sm text-gray-600 dark:text-gray-300",children:n("checkingAccount")}
4):e.jsx(pe,{to:ct({returnUrl:ue}),className:"inline-flex min-h-11 items-center text-sm font-medium text-secondary-700 underline dark:text-secondary-300",children:n("signIn")})]})]})]}),ve?e.jsxs("details",{onToggle:R=>{R.currentTarget.open&&g.track("prompt_open",s.dayNumber)},children:[e.jsx("summary",{className:"flex min-h-11 cursor-pointer items-center text-sm font-medium text-gray-900 marker:text-secondary-600 dark:text-white",children:n("sharing.createYourVersion")}),e.jsxs("div",{className:"space-y-4 pt-4",children:[e.jsx("label",{htmlFor:A,className:"block text-sm font-medium text-gray-900 dark:text-white",children:n("sharing.reviewPrompt")}),e.jsx("textarea",{id:A,value:ke,onChange:R=>Xe(R.target.value),maxLength:8e3,rows:8,className:"w-full resize-y rounded-md border border-light-600/30 bg-transparent p-3 text-base leading-relaxed text-gray-900 focus:outline-none focus:ring-2 focus:ring-secondary-500/40 dark:border-dark-500/30 dark:text-white"}),e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:n("sharing.creationHelp")}),e.jsx(D,{type:"button",variant:"ghost",onClick:Kt,disabled:!v||!ke.trim(),className:"min-h-11 w-full whitespace-normal",children:n("sharing.openStudio")})]})]}):null,q?e.jsx("p",{role:"alert",className:"text-sm leading-relaxed text-red-700 dark:text-red-300",children:q}):null]})]})}function Hs({day:t,verse:s,onOpen:r}){const{t:a,i18n:i}=P("events"),n=Ke(),l=ie(),o=x.useId(),m=x.useId(),[d,u]=x.useState(null),c=t.imagePrompt?$(t.imagePrompt,i.language):"",h=d??(s&&c?`${c}
5
6${s.text}
7${s.reference} (${s.translationLabel})`:"");if(!c)return null;const p=()=>{!s||!h.trim()||(l.track("tool_open",t.dayNumber),r==null||r(),n(`/image-studio?${new URLSearchParams({prompt:h.trim()})}`))};return e.jsxs("details",{className:"group",onToggle:f=>{f.currentTarget.open&&l.track("prompt_open",t.dayNumber)},children:[e.jsxs("summary",{className:`-mx-3 flex min-h-11 cursor-pointer items-center justify-between gap-4 px-3 text-base font-medium text-gray-900 dark:text-white ${$e}`,children:[a("sharing.createYourVersion"),e.jsx(Ce,{className:"h-4 w-4 shrink-0 transition-transform group-open:rotate-180","aria-hidden":"true"})]}),e.jsxs("div",{className:"space-y-5 pt-5 sm:space-y-6 sm:pt-6",children:[e.jsx("label",{htmlFor:o,className:"block text-sm font-medium text-gray-900 dark:text-white",children:a("sharing.reviewPrompt")}),e.jsx("textarea",{id:o,value:h,disabled:!s,onChange:f=>u(f.target.value),maxLength:8e3,rows:8,"aria-describedby":m,className:"w-full resize-y rounded-md border border-light-600/30 bg-transparent p-4 text-base leading-7 text-gray-900 focus:outline-none focus:ring-2 focus:ring-secondary-500/40 disabled:opacity-60 dark:border-dark-500/30 dark:text-white"}),e.jsx("p",{id:m,className:"max-w-[62ch] text-sm leading-7 text-gray-600 dark:text-gray-300",children:a(s?"sharing.creationHelp":"sharing.verseUnavailable")}),e.jsx(D,{type:"button",variant:"custom",onClick:p,disabled:!s||!h.trim(),className:`min-h-11 justify-start whitespace-normal text-secondary-700 underline underline-offset-4 dark:text-secondary-300 ${le}`,children:a("sharing.openStudio")})]})]})}function zs({event:t,day:s,verse:r}){const{t:a,i18n:i}=P("events"),n=x.useRef(!1),l=ie(),[o,m]=x.useState(!1),[d,u]=x.useState(!1),[c,h]=x.useState(!1),p=async()=>{if(!(!r||n.current||!Ne(t,s.dayNumber))){n.current=!0,m(!0),u(!1),h(!1);try{const f=await mt(t.artwork,r,$(t.title,i.language),"wallpaper");xt(f,`${t.slug}-day-${s.dayNumber}-${r.translationId}-wallpaper.png`),l.track("resource_download",s.dayNumber),h(!0)}catch{u(!0)}finally{n.current=!1,m(!1)}}};return Ne(t,s.dayNumber)?e.jsxs("div",{className:"space-y-2",children:[e.jsxs(D,{type:"button",variant:"custom",disabled:!r||o,onClick:()=>void p(),className:`min-h-11 justify-start whitespace-normal text-secondary-700 underline underline-offset-4 dark:text-secondary-300 ${le}`,children:[o?e.jsx(me,{className:"h-4 w-4 shrink-0 animate-spin","aria-hidden":"true"}):e.jsx(lt,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),a(o?"resources.preparingWallpaper":"resources.downloadWallpaper")]}),e.jsx("p",{className:"max-w-[52ch] text-xs leading-6 text-gray-500 dark:text-gray-400",children:a("resources.wallpaperHelp")}),d?e.jsx("p",{role:"alert",className:"text-sm leading-6 text-red-700 dark:text-red-300",children:a("resources.downloadError")}):null,c?e.jsx("p",{role:"status",className:"text-sm leading-6 text-gray-600 dark:text-gray-300",children:a("resources.downloadStarted")}):null]}):null}function Bt({day:t,authoredPrompt:s,initialVocals:r=!1}){const{t:a,i18n:i}=P("events"),n=Ke(),l=ie(),o=x.useId(),[m,d]=x.useState(r),[u,c]=x.useState(null),[h,p]=x.useState(""),f=u??(m===r?s:void 0)??a(m?"resources.choralPrompt":"resources.instrumentalPrompt",{title:$(t.title,i.language),theme:$(t.focus,i.language)}),b=!!(f.trim()&&f.length<=1e3),g=()=>{b&&(l.track("tool_open",t.dayNumber),n("/audio-studio?mode=music&tab=yours",{state:{eventAudioSeed:{name:$(t.title,i.language).slice(0,120),prompt:f.trim(),vocals:m,lyrics:h,language:i.language.startsWith("es")?"es":i.language.startsWith("fr")?"fr":"en"}}}))};return e.jsxs("details",{className:"group",onToggle:j=>{j.currentTarget.open&&l.track("prompt_open",t.dayNumber)},children:[e.jsxs("summary",{className:`-mx-3 flex min-h-11 cursor-pointer items-center justify-between gap-4 px-3 text-base font-medium text-gray-900 dark:text-white ${$e}`,children:[a("resources.createAudio"),e.jsx(Ce,{className:"h-4 w-4 shrink-0 transition-transform group-open:rotate-180","aria-hidden":"true"})]}),e.jsxs("div",{className:"space-y-5 pt-5 sm:space-y-6 sm:pt-6",children:[e.jsx("div",{className:"flex flex-wrap gap-2",role:"group","aria-label":a("resources.audioStyle"),children:[!1,!0].map(j=>e.jsx(D,{type:"button",variant:"ghost","aria-pressed":m===j,onClick:()=>d(j),className:"min-h-11 whitespace-normal aria-pressed:bg-secondary-500/10 aria-pressed:text-secondary-700 dark:aria-pressed:text-secondary-300",children:a(j?"resources.choral":"resources.instrumental")},String(j)))}),e.jsx("label",{htmlFor:`${o}-prompt`,className:"block text-sm font-medium text-gray-900 dark:text-white",children:a("resources.audioBrief")}),e.jsx("textarea",{id:`${o}-prompt`,value:f,onChange:j=>c(j.target.value),maxLength:1e3,rows:6,"aria-describedby":`${o}-help`,className:"w-full resize-y rounded-md border border-light-600/30 bg-transparent p-4 text-base leading-7 text-gray-900 focus:outline-none focus:ring-2 focus:ring-secondary-500/40 dark:border-dark-500/30 dark:text-white"}),b?null:e.jsx("p",{role:"status",className:"text-sm leading-6 text-gray-600 dark:text-gray-300",children:a("resources.promptLimit")}),m?e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{htmlFor:`${o}-lyrics`,className:"block text-sm font-medium text-gray-900 dark:text-white",children:a("resources.lyrics")}),e.jsx("textarea",{id:`${o}-lyrics`,value:h,onChange:j=>p(j.target.value),maxLength:2e3,rows:5,className:"w-full resize-y rounded-md border border-light-600/30 bg-transparent p-4 text-base leading-7 text-gray-900 focus:outline-none focus:ring-2 focus:ring-secondary-500/40 dark:border-dark-500/30 dark:text-white"})]}):null,e.jsx("p",{id:`${o}
7-help`,className:"max-w-[62ch] text-sm leading-7 text-gray-600 dark:text-gray-300",children:a("resources.audioHelp")}),e.jsx(D,{type:"button",variant:"custom",onClick:g,disabled:!b,className:`min-h-11 justify-start whitespace-normal text-secondary-700 underline underline-offset-4 dark:text-secondary-300 ${le}`,children:a("resources.openAudioStudio")})]})]})}const Ct=40*1024*1024;async function Zs(t,s){var i;const r=new AbortController,a=window.setTimeout(()=>r.abort(),6e4);try{const n=await fetch(t,{credentials:"omit",redirect:"error",signal:r.signal});if(!n.ok||!n.body)throw new Error("Resource could not be downloaded");if(Number(n.headers.get("content-length"))>Ct)throw new Error("Resource exceeds the download size limit");const o=((i=n.headers.get("content-type"))==null?void 0:i.split(";")[0].trim())??"";if(!/^(audio\/(mpeg|mp3|wav|x-wav|ogg|mp4|flac)|image\/(png|jpeg|webp)|application\/(pdf|octet-stream))$/u.test(o))throw new Error("Resource format is not supported");const m=n.body.getReader(),d=[];let u=0;try{for(;;){const{value:c,done:h}=await m.read();if(h)break;if(u+=c.byteLength,u>Ct)throw new Error("Resource exceeds the download size limit");d.push(c.slice().buffer)}}finally{await m.cancel(),m.releaseLock()}if(!u)throw new Error("Resource is empty");xt(new Blob(d,{type:o}),s)}finally{window.clearTimeout(a)}}function Qs({event:t,day:s}){var a;const{t:r}=P("events");return!Ne(t,s.dayNumber)||!((a=s.resources)!=null&&a.length)?null:e.jsxs("section",{className:"space-y-8","aria-label":r("resources.heading"),children:[e.jsxs("h3",{className:"text-xl font-normal tracking-tight text-gray-900 dark:text-white",children:[r("resources.headingNormal")," ",e.jsx("strong",{className:"font-bold",children:r("resources.headingBold")})]}),e.jsx("div",{className:"divide-y divide-light-600/30 dark:divide-dark-500/30",children:s.resources.map(i=>e.jsx(qs,{event:t,day:s,resource:i},`${s.dayNumber}:${i.id}:${i.url}`))})]})}function qs({event:t,day:s,resource:r}){const{t:a,i18n:i}=P("events"),n=ie(),l=x.useRef(!1),[o,m]=x.useState(!1),[d,u]=x.useState(!1),[c,h]=x.useState(!1),p=$(r.title,i.language),f=async()=>{if(!(l.current||!Ne(t,s.dayNumber))){l.current=!0,m(!0),u(!1);try{const b=new URL(r.url).pathname.split(".").pop();await Zs(r.url,`${t.slug}-day-${s.dayNumber}-${r.id}.${b}`),n.track("resource_download",s.dayNumber)}catch{u(!0)}finally{l.current=!1,m(!1)}}};return e.jsxs("article",{className:"space-y-5 py-8 first:pt-0 last:pb-0",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-base font-semibold leading-7 text-gray-900 dark:text-white",children:p}),r.description?e.jsx("p",{className:"max-w-[62ch] text-sm leading-7 text-gray-600 dark:text-gray-300",children:$(r.description,i.language)}):null]}),r.kind==="audio"?e.jsx(ys,{src:r.url,variant:"compact",roomyControls:!0,accessibleLabels:{play:a("resources.play"),pause:a("resources.pause"),seek:a("resources.seek")},onPlayingChange:b=>{b&&(h(!1),n.track("resource_play",s.dayNumber))},onPlaybackError:()=>h(!0),className:"!rounded-none !border-0 !bg-transparent !p-0"}):null,r.kind==="image"?e.jsx("img",{src:r.url,alt:p,loading:"lazy",decoding:"async",className:"max-h-[32rem] w-full object-contain object-left"}):null,c?e.jsx("p",{role:"alert",className:"text-sm leading-6 text-red-700 dark:text-red-300",children:a("resources.playbackError")}):null,e.jsxs(D,{type:"button",variant:"custom",onClick:()=>void f(),disabled:o,className:`min-h-11 justify-start whitespace-normal text-secondary-700 underline underline-offset-4 dark:text-secondary-300 ${le}`,children:[o?e.jsx(me,{className:"h-4 w-4 shrink-0 animate-spin","aria-hidden":"true"}):e.jsx(lt,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),a(o?"resources.preparingDownload":"resources.downloadFile",{title:p})]}),d?e.jsx("p",{role:"alert",className:"text-sm leading-6 text-red-700 dark:text-red-300",children:a("resources.downloadError")}):null,r.kind==="audio"&&r.creationPrompt?e.jsx(Bt,{day:s,authoredPrompt:$(r.creationPrompt,i.language),initialVocals:r.audioStyle==="choral"}):null]})}function Ks(t,s,r){const a=t?Te(t,r):null,i=ce(V.bible.getChapter,a?{bookId:a.bookId,chapter:a.chapter,translationId:s.id}:"skip"),n=t==null?void 0:t.book,l=t==null?void 0:t.chapter,o=t==null?void 0:t.ver
7seStart,m=t==null?void 0:t.verseEnd;return{verse:x.useMemo(()=>n&&l?ut(i,{book:n,chapter:l,verseStart:o,verseEnd:m},{id:s.id,label:s.label},r):null,[i,n,l,o,m,s.id,s.label,r]),isLoading:!!(a&&i===void 0)}}function Js(t,s,r){const[a,i]=x.useState(null),[n,l]=x.useState(null),[o,m]=x.useState(0),d=s?JSON.stringify([t,s.text,s.reference,s.translationLabel,r]):"";return x.useEffect(()=>{if(!s)return;let u=!0,c;return i(null),l(null),mt(t,s,r).then(h=>{u&&(c=URL.createObjectURL(h),i({key:d,blob:h,url:c}))}).catch(()=>{u&&l(d)}),()=>{u=!1,c&&URL.revokeObjectURL(c)}},[t,s,r,d,o]),{artwork:(a==null?void 0:a.key)===d?a:null,artworkError:n!==null&&n===d,retryArtwork:()=>m(u=>u+1)}}function Ys(t){const{t:s,i18n:r}=P("events");return Ne(t.event,t.day.dayNumber)?e.jsx(ye,{componentName:"EventEncouragement",fallback:e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:s("sharing.verseUnavailable")}),children:e.jsx(Gs,{...t,title:s("sharing.heading")},`${t.event.slug}:${t.day.dayNumber}:${t.translation.id}:${r.language}`)}):null}function Gs({event:t,day:s,translation:r,title:a,headingLevel:i="h2"}){var C,k;const{t:n,i18n:l}=P("events"),[o,m]=x.useState(null),[d,u]=x.useState(!1),[c,h]=x.useState(!1),p=ie(),f=Tt(s),{verse:b,isLoading:g}=Ks(f,r,l.language),{artwork:j,artworkError:y,retryArtwork:v}=Js(t.artwork,b,$(t.title,l.language));return e.jsxs("section",{className:"space-y-8 sm:space-y-10","aria-label":a,children:[e.jsx(i,{className:"text-xl font-semibold tracking-tight text-gray-900 dark:text-white sm:text-2xl",children:a}),e.jsxs("div",{className:"grid items-center gap-7 sm:grid-cols-[minmax(0,0.8fr)_minmax(0,1fr)] sm:gap-9",children:[e.jsxs("figure",{className:"min-w-0",children:[j?e.jsx("img",{loading:"lazy",decoding:"async",src:j.url,alt:`${b==null?void 0:b.reference}. ${n("sharing.artworkAlt")}`,width:1080,height:1350,className:"mx-auto w-full max-w-[20rem] rounded-sm sm:mx-0"}):e.jsxs("div",{className:"relative mx-auto aspect-[4/5] w-full max-w-[20rem] overflow-hidden rounded-sm sm:mx-0",role:"status","aria-busy":!y&&g,children:[e.jsx("img",{loading:"lazy",decoding:"async",src:t.artwork,alt:$(t.artworkAlt,l.language),width:1080,height:1350,className:"absolute inset-0 h-full w-full object-cover"}),e.jsx("div",{className:"absolute inset-0 flex items-end bg-black/50 p-6",children:e.jsx("p",{className:"text-sm leading-6 text-white",children:n(y?"sharing.artworkError":!g&&!b?"sharing.verseUnavailable":"sharing.preparing")})})]}),y?e.jsx(D,{type:"button",variant:"custom",onClick:v,className:`mt-3 min-h-11 text-sm text-secondary-700 underline underline-offset-4 dark:text-secondary-300 ${le}`,children:n("retry")}):null]}),e.jsxs("div",{className:"space-y-5 sm:space-y-6",children:[e.jsx("p",{className:"max-w-[62ch] text-base leading-8 text-gray-700 dark:text-gray-300",children:$(s.shareMessage??s.focus,l.language)}),e.jsxs(D,{type:"button",variant:"custom",onClick:()=>f&&m(f),disabled:!f,className:`min-h-11 justify-start whitespace-normal text-secondary-700 underline underline-offset-4 dark:text-secondary-300 ${le}`,children:[e.jsx(Ge,{className:"h-4 w-4","aria-hidden":"true"}),n("sharing.reviewAndShare")]}),e.jsx(zs,{event:t,day:s,verse:b})]})]}),e.jsx(Hs,{day:s,verse:b}),e.jsx(Qs,{event:t,day:s}),(C=s.resources)!=null&&C.some(E=>E.kind==="audio"&&E.creationPrompt)?null:e.jsx(Bt,{day:s}),e.jsxs("details",{className:"group",onToggle:E=>u(E.currentTarget.open),children:[e.jsxs("summary",{className:`-mx-3 flex min-h-11 cursor-pointer items-center justify-between gap-4 px-3 text-base font-medium text-gray-900 dark:text-white ${$e}`,children:[n("sharing.relatedVerses"),e.jsx(Ce,{className:"h-4 w-4 shrink-0 transition-transform group-open:rotate-180","aria-hidden":"true"})]}),d&&f?e.jsxs("div",{className:"space-y-7 pt-5 sm:space-y-8 sm:pt-6",children:[(k=s.relatedReferences)==null?void 0:k.map(E=>e.jsx(ye,{componentName:"EventRelatedVerse",fallback:e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:n("sharing.relatedUnavailable")}),children:e.jsx(Ft,{reference:E,translation:r,dayNumber:s.dayNumber,onShare:m})},`${E.book}:${E.chapter}:${E.verseStart}:${E.verseEnd}`)),e.jsxs("details",{className:"group",onToggle:E=>h(E.currentTarget.open),children:[e.jsx("summary",{className:`-mx-3 flex min-h-11 cursor-pointer items-center justify-between gap-4 px-3 text-sm font-medium text-gray-900 dark:text-white ${$e}`,children:n("sharing.additionalCrossReferences")}),c?e.jsxs("div",{className:"space-y-5 pt-5",children:[e.jsx("p",{className:"max-w-[62
7ch] text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:n("sharing.relatedHelp")}),e.jsx(ye,{componentName:"EventRelatedVerses",fallback:e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:n("sharing.relatedUnavailable")}),children:e.jsx(Xs,{reference:f,translation:r,dayNumber:s.dayNumber,onShare:m})})]}):null]}),e.jsx(pe,{to:`/verse-finder?${new URLSearchParams({q:$(s.focus,l.language)})}`,onClick:()=>p.track("tool_open",s.dayNumber),onAuxClick:Oe(()=>p.track("tool_open",s.dayNumber)),className:`inline-flex min-h-11 items-center text-sm font-medium text-secondary-700 underline dark:text-secondary-300 ${he}`,children:n("sharing.findMore")}),e.jsx("p",{className:"max-w-[62ch] text-xs leading-relaxed text-gray-500 dark:text-gray-400",children:n("sharing.findMoreHelp")})]}):null]}),o?e.jsx(Bs,{isOpen:!0,onClose:()=>m(null),event:t,day:s,translation:r,reference:o}):null]})}function Xs({reference:t,translation:s,dayNumber:r,onShare:a}){const{t:i,i18n:n}=P("events"),{isLoaded:l,isSignedIn:o}=qe(),{isAuthenticated:m,isLoading:d}=Ye(),u=!!(l&&o&&m&&!d),c=!!(l&&o&&d),h=Te(t,n.language),p=ce(V.bible.getCrossReferencesForVerse,u&&h?{translationId:s.id,bookId:h.bookId,chapter:h.chapter,verse:t.verseStart??1,limit:4}:"skip");return c?e.jsx("p",{role:"status",className:"text-sm text-gray-600 dark:text-gray-300",children:i("checkingAccount")}):u?p===void 0?e.jsx("p",{role:"status",className:"text-sm text-gray-600 dark:text-gray-300",children:i("sharing.loadingRelated")}):p.references.length?e.jsxs("div",{className:"space-y-8",children:[p.references.map(f=>e.jsx(Ft,{reference:{book:f.bookId,chapter:f.chapter,verseStart:f.verse,verseEnd:f.endVerse},translation:s,dayNumber:r,onShare:a},`${f.bookId}:${f.chapter}:${f.verse}`)),p.sourceLabel?e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:p.sourceLabel}):null]}):e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:i("sharing.relatedEmpty")}):e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:i("sharing.relatedSignInHelp")})}function Ft({reference:t,translation:s,dayNumber:r,onShare:a}){const{t:i,i18n:n}=P("events"),l=ie(),o=Te(t,n.language),m=ce(V.bible.getChapter,o?{translationId:s.id,bookId:o.bookId,chapter:o.chapter}:"skip"),d=ut(m,t,s,n.language);return o?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:[o.label,e.jsx("span",{className:"ml-2 font-normal text-gray-500 dark:text-gray-400",children:s.label})]}),e.jsx("p",{className:"max-w-[62ch] text-base leading-8 text-gray-700 dark:text-gray-300",children:(d==null?void 0:d.text)??i(m===void 0?"sharing.loadingRelated":"sharing.verseUnavailable")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-2",children:[e.jsx(pe,{to:{pathname:o.href,search:`?${new URLSearchParams({v:s.id})}`},onClick:()=>l.track("tool_open",r),onAuxClick:Oe(()=>l.track("tool_open",r)),className:`inline-flex min-h-11 items-center text-sm font-medium text-secondary-700 underline dark:text-secondary-300 ${he}`,children:i("openInBible")}),e.jsx(D,{type:"button",variant:"ghost",disabled:!d,onClick:()=>a(t),className:"min-h-11 whitespace-normal",children:i("sharing.shareVerse")})]})]}):null}function ea(t){return!t.reducedMotion&&!t.saveData}function ta(t){return t.automatic&&t.inView&&t.documentVisible}function sa(t){return!t.failed&&(t.requested||t.automatic&&t.loadStarted)}function aa(t){return t.mounted&&t.inView&&t.documentVisible&&!t.userPaused&&!t.blocked}function ra(t){return!t.mounted||!t.hasElement?"request":t.showsPause?"pause":"play"}function na(t){return t instanceof DOMException&&t.name==="NotAllowedError"?"blocked":t instanceof DOMException&&t.name==="AbortError"?"interrupted":"failed"}function ia(t){return t.token===t.currentToken&&t.currentElement===t.element}function oa(t){return t.shouldPlay&&!t.elementPaused}function Mt(){if(!(typeof navigator>"u"))return navigator.connection}function la(){const[t,s]=x.useState(()=>{var r;return!!((r=Mt())!=null&&r.saveData)});return x.useEffect(()=>{const r=Mt();if(!r)return;const a=()=>s(!!r.saveData);return a(),r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[]),t}function ca(){const[t,s]=x.useState(()=>typeof document>"u"||document.visibilityState!=="hidden");return x.useEffect(()=>{const r=()=>s(document.visibilityState!=="hidden");return r(),document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)},[]),t}function da(t){const s=typeof IntersectionObserver<"u",[r,a]=x.useState(!s);return x.useEffect(()=>{const i=t.current;if(!i||!s)return;const n=new IntersectionObserver(l=>{const o=l[l.length-1];o&&a(o.isIntersecting)},{threshold:.2});return n.observe(i),()=>n.disconnect()},[t,s]),r}function It(t){if(t)try{t()}catch{return}}function ua({source:t,poster:s,box:r,onPlay:a,onUnmute:i}){const{t:n}=P("events"),l=x.useId(),o=x.useRef(null),m=x.useRef(0),d=x.useRef(!1),u=dt("(prefers-reduced-motion: reduce)"),c=la(),h=ca(),p=da(r),[f,b]=x.use
7State(!1),[g,j]=x.useState(!1),[y,v]=x.useState(!1),[C,k]=x.useState(!1),[E,I]=x.useState(0),[S,Z]=x.useState(!0),[se,G]=x.useState(!1),[U,Q]=x.useState(!1),[w,J]=x.useState(!1),ae=ea({reducedMotion:u,saveData:c}),O=sa({failed:C,requested:g,automatic:ae,loadStarted:f}),B=aa({mounted:O,inView:p,documentVisible:h,userPaused:y,blocked:w}),re=B&&!U,ge=se||re,oe=x.useCallback(N=>{m.current+=1;const A=m.current;N.play().catch(ue=>{if(!ia({token:A,currentToken:m.current,element:N,currentElement:o.current}))return;const ne=na(ue);ne==="blocked"?J(!0):ne==="failed"&&k(!0)})},[]);x.useEffect(()=>{O||(G(!1),Q(!1),J(!1),Z(!0),b(!1))},[O]),x.useEffect(()=>{ta({automatic:ae,inView:p,documentVisible:h})&&b(!0)},[ae,p,h]),x.useEffect(()=>{if(!O)return;const N=o.current;return()=>{m.current+=1,N&&(N.pause(),N.removeAttribute("src"),N.load())}},[O,E]),x.useEffect(()=>{o.current&&(o.current.muted=S)},[S,O,E]),x.useEffect(()=>{const N=o.current;if(!(!O||!N)){if(!B){m.current+=1,N.pause();return}oe(N)}},[O,B,E,oe]);const q=()=>{const N=o.current,A=ra({mounted:O,hasElement:N!==null,showsPause:ge});if(A==="request"||!N){d.current=!1,J(!1),v(!1),j(!0);return}if(A==="pause"){v(!0),m.current+=1,N.pause();return}d.current=!1,J(!1),v(!1),oe(N)},W=()=>{d.current=!1,J(!1),k(!1),Q(!1),G(!1),v(!1),j(!0),I(N=>N+1)},X=()=>{const N=o.current;if(!N)return;const A=!S;N.muted=A,Z(A),!A&&!N.muted&&It(i)};return e.jsxs(e.Fragment,{children:[O&&e.jsx("video",{ref:o,src:t,poster:s,muted:S,autoPlay:B,loop:!0,playsInline:!0,preload:"metadata",disablePictureInPicture:!0,disableRemotePlayback:!0,"aria-hidden":"true",tabIndex:-1,onPlaying:N=>{const A=N.currentTarget;if(A===o.current){if(!oa({shouldPlay:B,elementPaused:A.paused})){A.paused||A.pause();return}G(!0),Q(!0),d.current||(d.current=!0,It(a))}},onPause:N=>{N.currentTarget===o.current&&G(!1)},onError:N=>{var A;N.currentTarget===o.current&&((A=N.currentTarget.error)==null?void 0:A.code)!==1&&k(!0)},className:`absolute inset-0 h-full w-full object-cover transition-opacity duration-500 motion-reduce:transition-none ${U?"opacity-100":"opacity-0"}`},E),e.jsxs("div",{className:"pointer-events-none absolute inset-x-3 bottom-3 z-20 flex flex-wrap items-end justify-end gap-2 sm:inset-x-4 sm:bottom-4",children:[C&&e.jsx("p",{role:"status",className:"pointer-events-auto max-w-[22rem] rounded-md bg-black/60 px-3 py-2 text-xs leading-relaxed text-white backdrop-blur-sm",children:n("media.error")}),e.jsx("span",{role:"status",className:"sr-only",children:re?n("media.loading"):""}),e.jsx("span",{id:l,className:"sr-only",children:n("media.soundNote")}),C?e.jsxs("button",{type:"button",onClick:W,className:`${Be} pointer-events-auto`,children:[e.jsx(kt,{className:"h-4 w-4","aria-hidden":"true"}),n("media.retry")]}):e.jsxs(e.Fragment,{children:[O&&e.jsxs("button",{type:"button",onClick:X,"aria-describedby":l,className:`${Be} pointer-events-auto`,children:[S?e.jsx(js,{className:"h-4 w-4","aria-hidden":"true"}):e.jsx(bs,{className:"h-4 w-4","aria-hidden":"true"}),n(S?"media.soundOn":"media.soundOff")]}),e.jsxs("button",{type:"button",onClick:q,"aria-busy":re,className:`${Be} pointer-events-auto`,children:[re?e.jsx(me,{className:"h-4 w-4 animate-spin motion-reduce:animate-none","aria-hidden":"true"}):se?e.jsx(vs,{className:"h-4 w-4","aria-hidden":"true"}):e.jsx(kt,{className:"h-4 w-4","aria-hidden":"true"}),n(ge?"media.pause":"media.play")]})]})]})]})}function ma({poster:t,alt:s,videoUrl:r,className:a="",overlay:i,onVideoPlay:n,onVideoUnmute:l}){const o=r&&/^https:\/\//i.test(r)?r:null,m=x.useRef(null);return e.jsxs("div",{ref:m,className:`relative isolate overflow-hidden rounded-md bg-gray-200 dark:bg-dark-800 ${a}`,children:[e.jsx("img",{src:t,alt:s,width:1920,height:1080,fetchPriority:"high",decoding:"async",className:"absolute inset-0 h-full w-full object-cover"}),o&&e.jsx(ua,{source:o,poster:t,box:m,onPlay:n,onUnmute:l},o),i&&e.jsx("div",{className:"absolute left-3 top-3 z-20 sm:left-4 sm:top-4",children:i})]})}function xa(t,s){return($(t.description,s).split(/\n\s*\n/u).find(i=>i.trim()&&!/^\s*#{1,6}\s/u.test(i))??$(t.shortDescription,s)).replace(/!\[[^\]]*\]\([^)]*\)/gu,"").replace(/\[([^\]]+)\]\([^)]*\)/gu,"$1").replace(/<[^>]+>/gu,"").replace(/[*_`]/gu,"").replace(/\s+/gu," ").trim()}function ha(t,s){return[{name:"WhatsApp",url:`https://wa.me/?${new URLSearchParams({text:[t.trim(),s].filter(
7Boolean).join(`
8
9`)})}`},{name:"Telegram",url:`https://t.me/share/url?${new URLSearchParams({text:t.trim(),url:s})}`},{name:"email",url:`mailto:?body=${encodeURIComponent([t.trim(),s].filter(Boolean).join(`
10
11`).replace(/\r?\n/gu,`\r
12`))}`}]}function pa({event:t,onClose:s}){const{t:r,i18n:a}=P("events"),i=ie(),n=$(t.title,a.language),l=new URL(`/events/${encodeURIComponent(t.slug)}`,rt).href,[o,m]=x.useState(()=>[r("invitation.ask",{title:n}),xa(t,a.language)].filter(Boolean).join(`
13
14`)),[d,u]=x.useState(!1),[c,h]=x.useState(!1),[p,f]=x.useState(null),b=x.useId(),g=typeof navigator.share=="function",j=Ot(o,l),y=ha(o,l),v=async()=>{if(!(d||!o.trim())){u(!0),f(null);try{await navigator.clipboard.writeText(j),i.track("share"),h(!0)}catch{f(r("sharing.copyError"))}finally{u(!1)}}},C=async()=>{if(!(d||!g||!o.trim())){u(!0),f(null);try{await navigator.share({title:n,text:o.trim(),url:l}),i.track("share")}catch(k){k instanceof DOMException&&k.name==="AbortError"||f(r("invitation.shareError"))}finally{u(!1)}}};return e.jsx(Je,{isOpen:!0,onClose:s,closeLabel:r("cancel"),title:r("journey.introShare"),desktopModalMobileDrawer:!0,maxWidth:"lg",children:e.jsxs("div",{className:"space-y-7 pb-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{htmlFor:b,className:"block text-sm font-medium text-gray-900 dark:text-white",children:r("sharing.message")}),e.jsx("textarea",{id:b,value:o,disabled:d,onChange:k=>{m(k.target.value),h(!1),f(null)},maxLength:4e3,rows:7,className:"w-full resize-y rounded-md border border-light-600/30 bg-transparent p-3 text-base leading-relaxed text-gray-900 focus:outline-none focus:ring-2 focus:ring-secondary-500/40 disabled:opacity-60 dark:border-dark-500/30 dark:text-white"}),e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:r("invitation.help")})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:r("invitation.preview")}),e.jsxs("div",{className:"grid items-center gap-4 grid-cols-[6rem_minmax(0,1fr)] sm:grid-cols-[8rem_minmax(0,1fr)]",children:[e.jsx("img",{src:t.artwork,alt:$(t.artworkAlt,a.language),width:256,height:160,className:"aspect-[16/10] w-full rounded-md object-cover"}),e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsx("p",{className:"font-semibold text-gray-900 dark:text-white",children:n}),e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:$(t.shortDescription,a.language)}),e.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:`inline-flex min-h-11 max-w-full items-center break-all text-xs text-secondary-800 underline underline-offset-4 dark:text-secondary-300 ${he}`,children:l})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[g&&e.jsxs(D,{type:"button",disabled:d||!o.trim(),onClick:()=>void C(),className:"min-h-11 w-full whitespace-normal bg-secondary-500 text-black hover:bg-secondary-600",children:[e.jsx(Ge,{className:"h-4 w-4","aria-hidden":"true"}),r("invitation.share")]}),e.jsxs(D,{type:"button",variant:g?"ghost":"secondary",disabled:d||!o.trim(),onClick:()=>void v(),className:"min-h-11 w-full whitespace-normal",children:[e.jsx(nt,{className:"h-4 w-4","aria-hidden":"true"}),r("sharing.copyMessage")]}),c&&e.jsxs("p",{role:"status",className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300",children:[e.jsx(De,{className:"h-4 w-4","aria-hidden":"true"}),r("sharing.copied")]})]}),o.trim()&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:r("invitation.channels")}),e.jsx("div",{className:"flex flex-wrap gap-x-6 gap-y-1",children:y.map(k=>e.jsx("a",{href:k.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>i.track("share_intent"),onAuxClick:Oe(()=>i.track("share_intent")),className:`inline-flex min-h-11 items-center text-sm font-medium text-secondary-800 underline underline-offset-4 dark:text-secondary-300 ${he}`,children:k.name==="email"?r("invitation.email"):k.name},k.name))})]}),p&&e.jsx("p",{role:"alert",className:"text-sm leading-relaxed text-red-700 dark:text-red-300",children:p})]})})}function ga({passage:t,translation:s,dayNumber:r}){const{t:a}=P("events"),i=ie(),n=dt("(max-width: 639px)");
14return e.jsxs("div",{className:"max-w-[62ch] space-y-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-5 gap-y-2",children:[e.jsxs("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:[t.label,e.jsx("span",{className:"ml-2",children:s.label})]}),e.jsxs(pe,{to:{pathname:t.href,search:`?${new URLSearchParams({v:s.id})}`},onClick:()=>i.track("tool_open",r),onAuxClick:Oe(()=>i.track("tool_open",r)),className:`inline-flex min-h-11 items-center gap-2 text-sm font-medium text-secondary-800 dark:text-secondary-300 ${he}`,children:[e.jsx(es,{className:"h-4 w-4","aria-hidden":"true"}),a("openInBible")]})]}),e.jsx(ye,{componentName:"EventPassage",fallback:e.jsx("p",{className:"text-base leading-relaxed text-gray-600 dark:text-gray-300",children:a("passageUnavailable")}),children:e.jsx(ks,{reference:{bookId:t.bookId,chapter:t.chapter,verseParam:t.verseParam,translationId:s.id},translationId:s.id,initialVerseCount:3,isMobile:n})})]})}function fa(t){const[s,r]=x.useState(0);return e.jsx(ya,{...t,onRetry:()=>r(a=>a+1)},`${t.event._id}:${t.ownerId}:${s}`)}function ya({event:t,ownerId:s,onRetry:r}){const{t:a,i18n:i}=P("events"),n=ce(V.eventNotifications.getMyParticipation,{eventId:t._id}),l=xe(V.eventNotifications.startEvent),o=xe(V.eventNotifications.setDailyReminder),m=(n==null?void 0:n.ownerId)===s&&n.eventId===t._id?n:void 0,[d,u]=x.useState(null),c=m?d??m:n===void 0?d??void 0:void 0,[h,p]=x.useState(!1),[f,b]=x.useState(null),[g,j]=x.useState(null),[y,v]=x.useState(!1),[C,k]=x.useState(null),[E,I]=x.useState(null),[S,Z]=x.useState(null),se=ie(),[G]=x.useState(()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||void 0}catch{return}}),U=x.useRef(!0),Q=x.useRef(!1),w=x.useId(),J=x.useId(),ae=x.useId(),O=x.useId(),B=x.useId(),re=x.useId(),ge=x.useId(),oe=x.useId(),q=t.lifecycle==="ended",W=(c==null?void 0:c.joinedAt)!==null&&(c==null?void 0:c.joinedAt)!==void 0,X=C??(c==null?void 0:c.remindersEnabled)??!1,N=S??(c==null?void 0:c.reminderLocalTime)??"",A=/^([01]\d|2[0-3]):[0-5]\d$/.test(N),ue=!!(c!=null&&c.remindersEnabled&&c.emailRemindersEnabled===!0),ne=X&&(E??ue),be=(c==null?void 0:c.hasEmailAddress)===!1&&!ue,ve=f!==null||!X||q||be,Ie=!!(c&&(X!==c.remindersEnabled||N!==c.reminderLocalTime||ne!==ue)),Ve=c==null?void 0:c.reminderTimezone;x.useEffect(()=>(U.current=!0,()=>{U.current=!1}),[]),x.useEffect(()=>{if(n!==void 0)return;const L=window.setTimeout(()=>p(!0),15e3);return()=>window.clearTimeout(L)},[n]),x.useEffect(()=>{d&&m&&m.updatedAt!==null&&d.updatedAt!==null&&m.updatedAt>=d.updatedAt&&u(null)},[d,m]),x.useEffect(()=>{W&&g==="joinError"&&j(null)},[W,g]);const Xe=async()=>{if(!(!c||W||q||Q.current)){Q.current=!0,b("join"),j(null);try{const L=await l({eventId:t._id,...G?{timezone:G}:{}});if(L.ownerId!==s||L.eventId!==t._id)throw new Error("Event participation owner changed");U.current&&u(L)}catch{U.current&&j("joinError")}finally{Q.current=!1,U.current&&b(null)}}},ke=async()=>{if(!(!c||!W||!Ve||!Ie||Q.current||q&&X)){if(!A){j("timeInvalid");return}Q.current=!0,b("reminder"),j(null),v(!1);try{const L=await o({eventId:t._id,enabled:X,localTime:N,timezone:Ve,emailRemindersEnabled:ne});if(L.ownerId!==s||L.eventId!==t._id)throw new Error("Event participation owner changed");se.track("reminder_change"),U.current&&(u(L),k(F=>F===null||F===X?null:F),I(F=>F===null||F===ne?null:F),Z(F=>F===null||F===N?null:F),v(!0))}catch{U.current&&j("saveError")}finally{Q.current=!1,U.current&&b(null)}}};if(!c){const L=n===void 0&&!h;return e.jsxs("section",{"aria-labelledby":w,className:"space-y-5",children:[e.jsx("h2",{id:w,className:"font-semibold text-gray-900 dark:text-white",children:a("events:participation.title")}),e.jsxs("p",{role:L?"status":"alert",className:"flex items-center gap-2 text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:[L&&e.jsx(me,{className:"h-4 w-4 shrink-0 animate-spin motion-reduce:animate-none","aria-hidden":"true"}),a(L?"events:participation.loading":"events:participation.unavailable")]}),!L&&e.jsx(D,{type:"button",variant:"outline",onClick:r,className:"h-auto min-h-11 w-full whitespace-normal py-2 sm:w-auto",children:a("events:retry")})]})}return e.jsxs("section",{"aria-labelledby":w,"aria-busy":f!==null,className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{id:w,className:"font-semibold text-gray-900 dark:text-white",children:a("events:participation.title")}),!W&&e.jsx("p",{className:"max-w-xl text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:a("events:participation.joinHelp")})]}),W?e.jsxs("p",{role:"status",className:"flex items-center gap-2 text-sm font-medium text-secondary-800 dark:text-secondary-300",children:[e.jsx(De,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),a("events:participation.joined")]}):e.jsxs(D,{type:"button",disabled:q||f!==null,onClick:()=>{Xe()},className:"h-auto min-h-11 w-full shrink-0 whitespace-normal py-2 sm:w-auto",children:[f==="join"&&e.jsx(me,{className:"h-4 w-4 animate-spin motion-reduce:animate-none","aria-hidden":"true"}),a(f==="join"?"events:participation.joining":"events:participation.join")]})]}),t.lifecycle==="upcoming"&&e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:a("events:participation.upcoming",{date:Pe(t.startsOn,i.language)})}),q&&e.jsx("p",{className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:a("events:participation.ended")}),W&&e.jsxs("details",{className:"group space-y-5",children:[e.jsxs("summary",{className:`-mx-3 flex min-h-11 cursor-pointer items-center justify-between gap-4 px-3 py-2 text-sm font-medium ${$e}`,children:[a("events:participation.reminderSummary"),e.jsx(Ce,{className:"h-4 w-4 shrink-0 transition-transform group-open:rotate-180 motion-reduce:transition-none","aria-hidden":"true"})]}),e.jsxs("form",{onSubmit:L=>{L.preventDefault(),ke()},className:"space-y-5",children:[e.jsxs("label",{htmlFor:J,className:"flex min-h-11 cursor-pointer items-center justify-between gap-4",children:[e.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:a("events:participation.reminderLabel")}),e.jsx(wt,{id:J,checked:X,disabled:f!==null||q&&!c.remindersEnabled,"aria-describedby":ae,onCheckedChange:L=>{q&&L||(k(L),L||I(!1),v(!1),j(null))}})]}),e.jsx("p",{id:ae,className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:a("events:participation.reminderHelp")}),e.jsxs("label",{htmlFor:ge,className:`flex min-h-11 items-center justify-between gap-4 ${ve?"curs
14or-not-allowed opacity-60":"cursor-pointer"}`,children:[e.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:a("events:participation.emailLabel")}),e.jsx(wt,{id:ge,checked:ne,disabled:ve,"aria-describedby":oe,onCheckedChange:L=>{q&&L||(I(L),v(!1),j(null))}})]}),e.jsx("p",{id:oe,className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:a(be?"events:participation.emailMissing":"events:participation.emailHelp")}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[e.jsx("label",{htmlFor:O,className:"block text-sm font-medium text-gray-900 dark:text-white",children:a("events:participation.reminderTime")}),e.jsx(ts,{id:O,type:"time",step:60,required:!0,value:N,disabled:f!==null||q,"aria-invalid":!A,"aria-describedby":`${B}${g||!A?` ${re}`:""}`,onChange:L=>{Z(L.target.value),v(!1),j(null)},className:"h-11 min-h-11 max-w-xs text-base md:text-base"}),e.jsx("p",{id:B,className:"break-words text-xs text-gray-500 dark:text-gray-400",children:a("events:participation.reminderTimezone",{timezone:Dt(c.reminderTimezone,i.language)})})]}),e.jsxs(D,{type:"submit",variant:"outline",disabled:!Ie||!A||f!==null||q&&X,className:"h-auto min-h-11 w-full whitespace-normal py-2 sm:w-auto",children:[f==="reminder"&&e.jsx(me,{className:"h-4 w-4 animate-spin motion-reduce:animate-none","aria-hidden":"true"}),a(f==="reminder"?"events:saving":"events:participation.save")]})]}),e.jsx("p",{role:"status","aria-live":"polite",className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:a(Ie?"events:participation.unsaved":y?"events:participation.saved":c.remindersEnabled?"events:participation.reminderOn":"events:participation.reminderOff")}),(!(m??c).pushSettingsEnabled||!(m??c).hasPushDevice)&&e.jsxs("div",{className:"space-y-1 text-sm leading-relaxed",children:[e.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:a((m??c).pushSettingsEnabled?"events:participation.pushDeviceMissing":"events:participation.pushSettingsOff")}),e.jsx(pe,{to:"/settings?tab=notifications",className:`inline-flex min-h-11 items-center font-medium text-secondary-800 underline underline-offset-4 dark:text-secondary-300 ${he}`,children:a("events:participation.notificationSettings")})]})]})]}),(g||W&&!A)&&e.jsx("p",{id:re,role:"alert",className:"text-sm leading-relaxed text-red-700 dark:text-red-300",children:a(`events:participation.${g??"timeInvalid"}`)})]})}function ja({event:t,dayNumber:s,ownerId:r}){const{t:a,i18n:i}=P("events"),n=ce(V.events.getMyProgress,{eventId:t._id}),l=xe(V.events.setDayCompleted),[o,m]=x.useState(!1),[d,u]=x.useState(!1),c=(n==null?void 0:n.ownerId)===r?n:void 0,h=(c==null?void 0:c.completedDays.includes(s))??!1,f=s<=t.availableDayCount||h,b=async()=>{if(!(!c||o||!f)){m(!0),u(!1);try{await l({eventId:t._id,dayNumber:s,completed:!h})}catch{u(!0)}finally{m(!1)}}};return e.jsxs("div",{className:"space-y-3 border-t border-gray-200 pt-5 dark:border-[#333c51]",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("div",{role:"status","aria-live":"polite",className:"text-sm text-gray-600 dark:text-gray-300",children:c?a("progress",{completed:c.completedCount,total:t.dayCount}):t.lifecycle==="upcoming"?a("progressStarts",{date:Pe(t.startsOn,i.language)}):a(n!==void 0?"progressUnavailable":"loadingProgress")}),e.jsxs(D,{type:"button",variant:h?"outline":"default",className:"min-h-11 w-full whitespace-normal sm:w-auto","aria-pressed":h,disabled:!f||!c||o,onClick:()=>{b()},children:[o?e.jsx(me,{className:"h-4 w-4 animate-spin motion-reduce:animate-none","aria-hidden":"true"}):h?e.jsx(De,{className:"h-4 w-4","aria-hidden":"true"}):null,a(o?"saving":h?"completedDay":"markComplete")]})]}),e.jsx("p",{className:"text-xs leading-relaxed text-gray-500 dark:text-gray-400",children:a("manualProgress")}),d&&e.jsx("p",{role:"alert",className:"text-sm text-red-700 dark:text-red-300",children:a("saveError")})]})}function ba({prompt:t,dayNumber:s,onClose:r}){const{t:a}=P("events"),i=ie(),{isAuthenticated:n,isLoading:l}=Ye(),{isLoaded:o,isSignedIn:m}=qe(),d=!o||!!(m&&l),u=!!(m&&n),[c,h]=x.useState(t),p=Ke(),f=x.useId(),b=x.useId(),g=()=>{const j=c.trim();if(!j||j.length>Nt||d)return;const y=os(j);u&&i.track("tool_open",s),r(),p(u?y:ct({returnUrl:y}))};return e.jsx(Je,{isOpen:!0,onClose:r,title:a("askFaithGPT"),desktopModalMobileDrawer:!0,maxWidth:"lg",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("label",{htmlFor:f,className:"block text-sm font-medium text-gray-900 dark:text-white",children:a("promptLabel")}),e.jsx("textarea",{id:f,value:c,onChange:j=>h(j.target.value),maxLength:Nt,rows:7,"aria-describedby":b,className:"w-full resize-y rounded-xl border border-[#c8c8c8] bg-light-50 p-4 text-base leading-relaxed text-gray-900 focus:border-secondary-500 focus:outline-none focus:ring-2 focus:ring-secondary-500/30 dark:border-[#333c51] dark:bg-dark-900 dark:text-white"}),e.jsx("p",{id:b,className:"text-sm leading-relaxed text-gray-600 dark:text-gray-300",children:a("promptCreditNotice")}),e.jsxs("div",{className:"flex flex-col-reverse gap-3 sm:flex-row sm:justify-end",children:[e.jsx(D,{type:"button",variant:"outline",onClick:r,className:"min-h-11",children:a("cancel")}),e.jsx(D,{type:"button",disabled:d||!c.trim(),onClick:g,className:"min-h-11 whitespace-normal",children:a(u?"sendPrompt":"signInAndAsk")})]})]})})}const at="faithgpt:event-reflection-saved";function va(t,s,r){t.getItem(s)===r&&t.removeItem(s)}function ka(t,s){return t&&t.updatedAt===s.expectedUpdatedAt?s.saved:t}function wa({event:t,day:s,ownerId:r}){const{t:a}=P("events"),i=ce(V.events.getMyReflection,{eventId:t._id,dayNumber:s.dayNumber}),n=xe(V.events.setMyReflection),l=`faithgpt:event-reflection:${r}:${t._id}:${s.dayNumber}`,[o,m]=x.useState(""),[d,u]=x.useState(null),[c,h]=x.useState(!1),[p,f]=x.use
14State(!1),[b,g]=x.useState(!1),j=x.useRef(!1),y=x.useRef(!0),v=x.useRef(o);v.current=o;const C=(i==null?void 0:i.ownerId)===r&&i.eventId===t._id&&i.dayNumber===s.dayNumber;x.useEffect(()=>(y.current=!0,()=>{y.current=!1}),[]),x.useEffect(()=>{const I=S=>{const Z=S.detail;Z.storageKey===l&&u(se=>ka(se,Z))};return window.addEventListener(at,I),()=>window.removeEventListener(at,I)},[l]),x.useEffect(()=>{if(!C||!i||j.current)return;j.current=!0,u({text:i.text,updatedAt:i.updatedAt});let I=i.text;try{I=sessionStorage.getItem(l)??I}catch{I=i.text}m(I)},[C,i,l]);const k=d!==null&&o!==d.text;x.useEffect(()=>{if(!(!j.current||!d))try{k?sessionStorage.setItem(l,o):sessionStorage.removeItem(l)}catch{return}},[o,k,d,l]);const E=async()=>{if(!d||!C||c||!k)return;const I=o;h(!0),f(!1),g(!1);try{const S=await n({eventId:t._id,dayNumber:s.dayNumber,text:I,expectedUpdatedAt:d.updatedAt});if(S.ownerId!==r||S.eventId!==t._id||S.dayNumber!==s.dayNumber)throw new Error("Reflection owner changed");try{va(sessionStorage,l,I)}catch{}window.dispatchEvent(new CustomEvent(at,{detail:{storageKey:l,expectedUpdatedAt:d.updatedAt,submittedText:I,saved:{text:S.text,updatedAt:S.updatedAt}}})),y.current&&(u({text:S.text,updatedAt:S.updatedAt}),v.current===I&&m(S.text),g(!0))}catch{y.current&&f(!0)}finally{y.current&&h(!1)}};return e.jsxs("section",{"aria-labelledby":"event-reflection-title",className:"max-w-[62ch] space-y-6",children:[e.jsx("h2",{id:"event-reflection-title",className:"text-2xl font-semibold tracking-tight",children:a("journey.reflection")}),d?e.jsxs(e.Fragment,{children:[e.jsx("label",{htmlFor:"event-reflection-input",className:"block text-sm text-gray-600 dark:text-gray-300",children:a("journey.reflectionHint")}),e.jsx("textarea",{id:"event-reflection-input",rows:5,maxLength:5e3,value:o,onChange:I=>{m(I.target.value),g(!1),f(!1)},className:"w-full resize-y rounded-md border border-gray-300 bg-transparent p-4 text-base leading-relaxed transition-colors duration-150 hover:border-secondary-500 focus:outline-none focus:ring-2 focus:ring-secondary-500 dark:border-dark-500 dark:hover:border-secondary-400 motion-reduce:transition-none"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-5",children:[e.jsx(D,{type:"button",variant:"outline",disabled:!k||c||!C,onClick:()=>{E()},className:"min-h-11 w-full sm:w-auto",children:a(c?"saving":"journey.reflectionSave")}),e.jsx("p",{role:"status",className:"text-sm text-gray-500 dark:text-gray-400",children:a(k?"journey.reflectionUnsaved":b?"journey.reflectionSaved":"journey.reflectionPrivate")})]}),p&&e.jsx("p",{role:"alert",className:"text-sm text-red-700 dark:text-red-300",children:a("journey.reflectionError")})]}):e.jsx("p",{role:"status",className:"text-sm text-gray-500 dark:text-gray-400",children:a(i===void 0?"journey.reflectionLoading":"progressUnavailable")})]})}const Lt="faithgpt:event-analytics-session",Ht="faithgpt:event-analytics-views",_t=/^[A-Za-z0-9_-]{16,64}$/,zt=200;function Ze(){return as()==="granted"&&ss()}function ht(){try{return typeof crypto>"u"?null:typeof crypto.randomUUID=="function"?crypto.randomUUID():typeof crypto.getRandomValues=="function"?Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join(""):null}catch{return null}}function Na(){const t=Fe.getItem(Lt);if(t&&_t.test(t))return t;const s=ht();return!s||!_t.test(s)?null:Fe.setItem(Lt,s)?s:null}function $a(){try{const t=Fe.getItem(Ht),s=t?JSON.parse(t):[];return new Set(Array.isArray(s)?s.filter(r=>typeof r=="string").slice(-zt):[])}catch{return new Set}}function Ea(t){Fe.setItem(Ht,JSON.stringify(Array.from(t).slice(-zt)))}function Sa(t){const{audience:s,eventId:r,kind:a,dayNumber:i,interactionId:n}=t;return!s||!n||!Ze()?Promise.resolve(null):Promise.resolve().then(async()=>{const l=t.current();if(l.audience!==s||l.eventId!==r||!Ze())return null;const o=s==="guest"?Na():null;return s==="guest"&&!o?null:(await t.record({eventId:r,kind:a,interactionId:n,consent:!0,...i!==void 0?{dayNumber:i}:{},...o?{guestSessionId:o}:{}})).status}).catch(()=>null)}function Ca(t){const s=t.newId??ht,r=t.load??$a,a=t.save??Ea;let i=null;const n=new Set,l=new Map;return{view(o,m){const d=`${o}:${m??0}`;if(i===null&&(i=r()),i.has(d)||n.has(d))return Promise.resolve();const u=l.get(d)??s();return u?(l.set(d,u),n.add(d),t.send(o,m,u).then(c=>
14{n.delete(d),!(c!=="recorded"&&c!=="duplicate")&&(i==null||i.add(d),i&&a(i))})):Promise.resolve()}}}const Ma=new Set(["day_select","prompt_open","tool_open"]);function Ia({eventId:t,audience:s,children:r}){const a=xe(V.eventAnalytics.recordInteraction),[i,n]=x.useState(Ze),l=x.useRef({audience:s,eventId:t});x.useLayoutEffect(()=>{l.current={audience:s,eventId:t}},[s,t]),x.useEffect(()=>{const c=()=>n(Ze());return c(),window.addEventListener(ft,c),window.addEventListener("storage",c),()=>{window.removeEventListener(ft,c),window.removeEventListener("storage",c)}},[]);const o=x.useCallback((c,h,p)=>Sa({audience:s,eventId:t,kind:c,dayNumber:h,interactionId:p,current:()=>l.current,record:a}),[s,t,a]),m=x.useRef(o);x.useLayoutEffect(()=>{m.current=o},[o]);const d=x.useRef(null);d.current===null&&(d.current=Ca({send:(c,h,p)=>m.current("view",h,p)}));const u=x.useMemo(()=>({track:(c,h)=>{i&&(Ma.has(c)&&h===void 0||o(c,h,ht()))},view:c=>{var h;i&&((h=d.current)==null||h.view(t,c))}}),[o,t,i]);return e.jsx(Wt.Provider,{value:u,children:r})}function La({clerkLoaded:t,signedIn:s,convexLoading:r,convexAuthenticated:a,ownerPending:i,ownerAvailable:n}){return t&&!s?"signedOut":!t||r||a&&i?"checking":s&&a&&n?"ready":"unavailable"}function _a(t,s){return s&&t.ownerId===s?{...t,days:t.lifecycle==="upcoming"?[]:t.days.filter(r=>r.dayNumber<=t.availableDayCount)}:{...t,ownerId:null,isParticipant:!1,days:t.lifecycle==="upcoming"?[]:t.days.filter(r=>r.dayNumber===1)}}const Pa={strong:{component:({className:t,style:s,...r})=>e.jsx("strong",{...r,className:"font-semibold text-gray-900 dark:text-white"})},a:{component:({className:t,style:s,...r})=>e.jsx("a",{...r,target:"_blank",rel:"noopener noreferrer",className:`font-medium text-secondary-800 underline underline-offset-4 dark:text-secondary-300 ${he}`})}},Aa="space-y-6 text-base leading-[1.9] text-gray-700 dark:text-gray-200 sm:text-[1.0625rem] [&_h2]:pt-4 [&_h2]:text-2xl [&_h2]:font-semibold [&_h2]:leading-tight [&_h2]:text-gray-900 dark:[&_h2]:text-white [&_h3]:pt-2 [&_h3]:text-xl [&_h3]:font-semibold [&_h3]:text-gray-900 dark:[&_h3]:text-white [&_ul]:list-disc [&_ul]:pl-6 [&_ol]:list-decimal [&_ol]:pl-6 [&_li]:mt-2 [&_li:not(:last-child)]:border-b [&_li:not(:last-child)]:border-light-600/30 [&_li:not(:last-child)]:pb-2 dark:[&_li:not(:last-child)]:border-dark-500/30 [&_blockquote]:pl-5 [&_blockquote]:text-gray-600 dark:[&_blockquote]:text-gray-300",Ra="[&>div>p:first-of-type]:first-letter:float-left [&>div>p:first-of-type]:first-letter:mr-3 [&>div>p:first-of-type]:first-letter:pt-1 [&>div>p:first-of-type]:first-letter:text-[3.25rem] [&>div>p:first-of-type]:first-letter:font-semibold [&>div>p:first-of-type]:first-letter:leading-[0.8] [&>div>p:first-of-type]:first-letter:text-secondary-700 dark:[&>div>p:first-of-type]:first-letter:text-secondary-300 sm:[&>div>p:first-of-type]:first-letter:text-[3.75rem] [&>div>div>p:first-of-type]:first-letter:float-left [&>div>div>p:first-of-type]:first-letter:mr-3 [&>div>div>p:first-of-type]:first-letter:pt-1 [&>div>div>p:first-of-type]:first-letter:text-[3.25rem] [&>div>div>p:first-of-type]:first-letter:font-semibold [&>div>div>p:first-of-type]:first-letter:leading-[0.8] [&>div>div>p:first-of-type]:first-letter:text-secondary-700 dark:[&>div>div>p:first-of-type]:first-letter:text-secondary-300 sm:[&>div>div>p:first-of-type]:first-letter:text-[3.75rem]";function Pt(t){return t.replace(/[*_`>#[\]()]/g,"").replace(/\s+/g," ").trim().replace(/[.!?:;…]+$/u,"").toLocaleLowerCase()}function Da(t,s){const r=Pt(t);return r.length>0&&Pt(s).startsWith(r)}function We({content:t,className:s="",dropCap:r=!1,id:a}){return e.jsx("div",{id:a,className:`${r?Ra:""} ${s}`,children:e.jsx(Xt,{content:t,disableInteractiveParsing:!0,overrides:Pa,className:Aa})})}function Qe({overlay:t=!1}){const{t:s}=P("events");return e.jsxs(pe,{to:"/events",className:t?`${Be} max-w-full`:`mb-4 inline-flex min-h-11 items-center gap-2 text-sm text-gray-600 dark:text-gray-300 ${ps}`,children:[e.jsx(Rt,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),s("allJourneys")]})}function At({event:t,ownerId:s}){const{t:r}=P("events");return e.jsx("section",{id:"journey-settings",className:"scroll-mt-24",children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{compact:!0,children:e.jsx(fa,{event:t,ownerId:s},`${t._id}:${s}`)},s),e.jsx(Ae,{compact:!0,children:e.jsx(Os,{event:t,ownerId:s},`${t._id}:${s}`)},`history:${s}`)]}):e.jsxs("div",{className:"space-y-5",children:[e.jsx("p",{className:"max-w-[62
14ch] text-base leading-relaxed text-gray-600 dark:text-gray-300",children:r("signInProgress")}),e.jsxs(pe,{to:ct({returnUrl:`/events/${t.slug}`}),className:`inline-flex min-h-11 w-full items-center justify-center gap-3 rounded-md bg-secondary-500 px-5 py-3 text-center text-sm font-semibold text-black sm:w-auto ${fs}`,children:[r("journey.join"),e.jsx(it,{className:"h-4 w-4 shrink-0","aria-hidden":"true"})]})]})})}function Ta({event:t,ownerId:s,dayNumber:r,onSelect:a}){const{t:i,i18n:n}=P("events");return e.jsxs("aside",{className:"order-first space-y-8 lg:sticky lg:top-20 lg:order-last lg:-mx-2 lg:max-h-[calc(100dvh-6rem)] lg:space-y-10 lg:overflow-y-auto lg:px-2 lg:py-1",children:[s?e.jsx(ye,{componentName:"EventDayStripProgress",fallback:e.jsx(ot,{event:t,dayNumber:r,onSelect:a}),children:e.jsx(Us,{event:t,dayNumber:r,ownerId:s,onSelect:a})}):e.jsx(ot,{event:t,dayNumber:r,onSelect:a}),e.jsx(Zt,{event:t,ownerId:s}),e.jsx("p",{className:"hidden text-xs leading-relaxed text-gray-500 dark:text-gray-400 lg:block",children:i("timezone",{timezone:Dt(t.timezone,n.language)})})]})}function Zt({event:t,ownerId:s}){const{t:r}=P("events"),a=Gt(),i=dt("(min-width: 1024px)"),[n,l]=x.useState(()=>a.hash==="#journey-settings"),o=x.useId();return i||!s||!t.isParticipant?e.jsx(At,{event:t,ownerId:s}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button","aria-haspopup":"dialog","aria-expanded":n,"aria-controls":n?o:void 0,onClick:()=>l(!0),className:`-mx-3 flex min-h-11 w-[calc(100%+1.5rem)] items-center justify-between gap-4 px-3 py-2 text-left text-sm font-medium text-gray-900 dark:text-white ${$e}`,children:[r("journey.journeySettings"),e.jsx(Ce,{className:"h-4 w-4 shrink-0","aria-hidden":"true"})]}),e.jsx(Je,{isOpen:n,onClose:()=>l(!1),closeLabel:r("cancel"),title:r("journey.journeySettings"),desktopModalMobileDrawer:!0,maxWidth:"md",children:e.jsx("div",{id:o,className:"pb-6",children:e.jsx(At,{event:t,ownerId:s})})})]})}function Oa({event:t,ownerId:s}){const{t:r,i18n:a}=P("events"),[i,n]=Yt(),[l,o]=x.useState(null),[m,d]=x.useState(!1),[u,c]=x.useState(!1),h=x.useId(),p=ie(),f=x.useMemo(()=>ls(a.language,cs()),[a.language]),b=!!(s&&t.isParticipant),g=t.lifecycle==="upcoming"?[]:t.days.filter(w=>w.dayNumber<=(b?t.availableDayCount:1)),j=ds(i.get("day"),t.dayCount,t.currentDay),y=g.find(w=>w.dayNumber===j)??g[0],v=b&&!!y,C=v?"h2":"h3",k=y==null?void 0:y.dayNumber;x.useEffect(()=>{p.view(k)},[p,k]);const E=w=>{if(!t.days.some(O=>O.dayNumber===w))return;const J=y!==void 0&&w!==y.dayNumber&&g.some(O=>O.dayNumber===w),ae=new URLSearchParams(i);ae.set("day",String(w)),n(ae,{replace:!0,preventScrollReset:!0}),J&&p.track("day_select",w)},I=w=>{o(w),y&&p.track("prompt_open",y.dayNumber)},S=(y==null?void 0:y.references.map(w=>Te(w,a.language)).filter(w=>w!==null))??[],Z=$(t.description,a.language),se=$(t.shortDescription,a.language),G=bt($(t.title,a.language)),U=y?bt($(y.title,a.language)):null,Q=e.jsx(ma,{poster:t.artwork,alt:$(t.artworkAlt,a.language),videoUrl:t.heroVideoUrl,overlay:e.jsx(Qe,{overlay:!0}),onVideoPlay:()=>p.track("video_play"),onVideoUnmute:()=>p.track("video_unmute"),className:v?"aspect-[16/7] max-h-72 sm:max-h-96":"aspect-[4/3] sm:aspect-[16/8] lg:aspect-[16/7]"});return e.jsxs(e.Fragment,{children:[v?e.jsxs("header",{className:"space-y-6 sm:space-y-8",children:[Q,e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-6 gap-y-1",children:[e.jsxs("p",{className:"min-w-0 text-sm text-gray-500 dark:text-gray-400",children:[$(t.title,a.language)," · ",r("dayOf",{number:y.dayNumber,total:t.dayCount})]}),e.jsxs("button",{type:"button","aria-expanded":u,"aria-controls":h,onClick:()=>c(w=>!w),className:`inline-flex min-h-11 items-center gap-2 text-sm font-medium text-secondary-800 dark:text-secondary-300 ${le}`,children:[r("journey.readIntro"),e.jsx(Ce,{className:`h-4 w-4 transition-transform motion-reduce:transition-none ${u?"rotate-180":""}`,"aria-hidden":"true"})]})]}),u&&e.jsx(We,{id:h,content:Z,dropCap:!0,className:"max-w-[62ch]"})]}):e.jsxs("header",{children:[Q,e.jsxs("div",{className:"mt-8 grid items-start gap-8 sm:mt-12 lg:grid-cols-[minmax(0,1fr)_16rem] lg:gap-16 xl:grid-cols-[minmax(0,1fr)_17rem] xl:gap-24",children:[e.jsxs("div",{className:"contents lg:block",children:[e.jsxs("div",{className:"order-1",children:[e.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[us(t.startsOn,t.endsOn,a.language)," · ",r("dayCount",{count:t.dayCount})]}),e.jsx(jt,{as:"h1",normal:G.normal,bold:G.bold,className:"mt-4 max-w-[20ch] text-4xl leading-[1.1] tracking-tight sm:text-5xl lg:text-6xl"}
14),!Da(se,Z)&&e.jsx("p",{className:"mt-6 max-w-[62ch] text-lg leading-relaxed text-gray-600 dark:text-gray-300",children:se})]}),e.jsxs("div",{className:"order-3 min-w-0 lg:mt-12 xl:mt-16",children:[e.jsx(We,{id:"event-introduction",content:Z,dropCap:!0,className:"max-w-[62ch]"}),e.jsx("p",{className:"mt-8 text-sm leading-relaxed text-gray-500 dark:text-gray-400",children:t.lifecycle==="upcoming"?r("journey.introOpens",{date:Pe(t.startsOn,a.language)}):r("journey.previewHelp")}),e.jsxs("button",{type:"button",onClick:()=>d(!0),className:`mt-4 inline-flex min-h-11 items-center gap-2 text-sm font-medium text-secondary-800 dark:text-secondary-300 ${le}`,children:[e.jsx(Ge,{className:"h-4 w-4","aria-hidden":"true"}),r("journey.introShare")]}),e.jsx("div",{className:"mt-8 w-full sm:mt-12",children:e.jsx(Ds,{kind:t.kind})}),e.jsx(Ts,{event:t})]})]}),e.jsx("aside",{className:"order-2 min-w-0 lg:pt-2",children:e.jsx(Zt,{event:t,ownerId:s})})]})]}),y&&e.jsxs("div",{className:"mt-10 grid items-start gap-10 sm:mt-14 lg:grid-cols-[minmax(0,1fr)_16rem] lg:gap-16 xl:grid-cols-[minmax(0,1fr)_17rem] xl:gap-24",children:[e.jsxs("article",{className:"min-w-0",children:[i.has("day")&&j!==y.dayNumber&&e.jsx("p",{role:"status",className:"mb-7 text-sm text-gray-500 dark:text-gray-400",children:r("journey.selectedDayUnavailable")}),!v&&e.jsx("p",{className:"mb-4 text-sm text-gray-500 dark:text-gray-400",children:r("previewDay",{number:y.dayNumber})}),U&&e.jsx(jt,{as:v?"h1":"h2",normal:U.normal,bold:U.bold,className:v?"max-w-[20ch] text-4xl leading-tight tracking-tight sm:text-5xl":"max-w-[24ch] text-3xl leading-tight tracking-tight sm:text-4xl"}),e.jsxs("div",{className:"mt-12 space-y-7 sm:mt-16 sm:space-y-10 [&>section:not(:last-of-type)]:border-b [&>section:not(:last-of-type)]:border-light-600/30 [&>section:not(:last-child)]:pb-7 dark:[&>section:not(:last-of-type)]:border-dark-500/30 sm:[&>section:not(:last-child)]:pb-10",children:[e.jsxs("section",{"aria-labelledby":"event-reading-title",className:"space-y-7",children:[e.jsx(C,{id:"event-reading-title",className:"text-2xl font-semibold tracking-tight",children:r("reading")}),e.jsx("div",{className:"space-y-5 [&>div:not(:last-child)]:border-b [&>div:not(:last-child)]:border-light-600/30 [&>div:not(:last-child)]:pb-5 dark:[&>div:not(:last-child)]:border-dark-500/30",children:S.map(w=>e.jsx(ga,{passage:w,translation:f,dayNumber:y.dayNumber},w.href))})]}),(y.reflection||vt(y,a.language))&&e.jsxs("section",{"aria-labelledby":"event-consider-title",className:"max-w-[62ch] space-y-7",children:[e.jsx(C,{id:"event-consider-title",className:"text-2xl font-semibold tracking-tight",children:r("journey.consider")}),y.reflection&&e.jsx(We,{content:$(y.reflection,a.language)}),vt(y,a.language)&&e.jsx("p",{className:"text-lg leading-relaxed text-gray-900 dark:text-white",children:$(y.focus,a.language)}),e.jsxs("button",{type:"button",onClick:()=>I($(y.prompt,a.language)),className:`inline-flex min-h-11 items-center gap-2 text-sm font-medium text-secondary-800 dark:text-secondary-300 ${le}`,children:[e.jsx(rs,{className:"h-4 w-4","aria-hidden":"true"}),r("journey.reflectWith")]})]}),e.jsxs("section",{"aria-labelledby":"event-action-title",className:"max-w-[62ch] space-y-7",children:[e.jsx(C,{id:"event-action-title",className:"text-2xl font-semibold tracking-tight",children:r("action")}),e.jsx(We,{content:$(y.action,a.language)}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-2",children:[e.jsxs("button",{type:"button",onClick:()=>I(r("journey.prayerPrompt",{title:$(y.title,a.language),references:S.map(w=>w.label).join(", "),action:$(y.action,a.language)})),className:`inline-flex min-h-11 items-center gap-2 text-sm font-medium text-secondary-800 dark:text-secondary-300 ${le}`,children:[e.jsx(ns,{className:"h-4 w-4","aria-hidden":"true"}),r("journey.prayWith")]}),(t.kind==="devotional"||t.kind==="psalms")&&e.jsxs(pe,{to:"/for-you",onClick:()=>p.track("tool_open",y.dayNumber),onAuxClick:Oe(()=>p.track("tool_open",y.dayNumber)),className:`inline-flex min-h-11 items-center gap-2 text-sm font-medium text-secondary-800 dark:text-secondary-300 ${he}`,children:[r("companion.forYou.label"),e.jsx(it,{className:"h-4 w-4","aria-hidden":"true"})]})]})]}),e.jsx(ye,{componentName:"EventEncouragement",children:e.jsx(Ys,{event:t,day:y,translation:f,headingLevel:v?"h2":"h3"})},`${t._id}:${y.dayNumber}:${f.id}`),b&&s&&e.jsx(Ae,{compact:!0,children:e.jsx(wa,{event:t,day:y,ownerId:s},`${s}:${t._id}:${y.dayNumber}`)},`reflection:${s}:${y.dayNumber}`),b&&s&&e.jsx(Ae,{compact:!0,children:e.jsx(ja,{event:t,dayNumber:y.dayNumber,ownerId:s},`${t._id}:${s}:${y.dayNumber}`)},`progress:${s}:${y.dayNumber}`)]}),b&&e.jsxs("div",{className:"mt-14 flex justify-between gap-5 sm:mt-20",children:[e.jsxs("button",{type:"button",disabled:!t.days.some(w=>w.dayNumber===y.dayNumber-1),onClick:()=>E(y.dayNumber-1),className:`inline-flex min-h-11 items-center gap-2 text-sm text-gray-600 dark:text-gray-300 ${gs}`,children:[e.jsx(Rt,{className:"h-4 w-4","aria-hidden":"true"}),r("previousDay")]}),e.jsxs("button",{type:"button",disabled:!t.days.some(w=>w.dayNumber===y.dayNumber+1),onClick:()=>E(y.dayNumber+1),className:`inline-flex min-h-11 items-center gap-2 text-sm font-medium text-secondary-800 dark:text-secondary-300 ${le}`,children:[r("nextDay"),e.jsx(it,{className:"h-4 w-4","aria-hidden":"true"})]})]})]}),b&&e.jsx(Ta,{event:t,ownerId:s,dayNumber:y.dayNumber,onSelect:E})]}),l&&e.jsx(ba,{prompt:l,dayNumber:y==null?void 0:y.dayNumber,onClose:()=>o(null)},`${y==null?void 0:y.dayNumber}:${a.language}:${l}`),m&&e.jsx(pa,{event:t,onClose:()=>d(!1)},`${t._id}:${a.language}`)]})}function Va({slug:t}){const{t:s,i18n:r}=P("events"),{isLoaded:a,isSignedIn:i}=qe(),{isAuthenticated:n,isLoading:l}=Ye(),o=hs(),m=ce(V.auth.currentUser,i&&n?{}:"skip"),d=La({clerkLoaded:a,signedIn:i,convexLoading:l,convexAuthenticated:n,ownerPending:m===void 0,ownerAvailable:!!m}),u=ce(V.events.getBySlug,{slug:t,refreshKey:o});if(u===void 0)return e.jsxs(e.Fragment,{children:[e.jsx(Qe,{}),e.jsx(ws,{})]});if(!u)return e.jsxs("div",{className:"space-y-5",children:[e.jsx(yt,{title:s("notFoundTitle"),noindex:!0}),e.jsx(Qe,{}),e.jsx("h1",{className:"text-3xl font-semibold",children:s("notFoundTitle")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:s("notFoundDescription")})]});const c=d==="ready"&&m&&u.ownerId===m._id?m._id:null,h=_a(u,c),p=c?"owner":d==="signedOut"?"guest":null;return e.jsxs(e.Fragment,{children:[e.jsx(yt,{title:$(u.title,r.language),description:$(u.shortDe
14scription,r.language),canonicalUrl:`/events/${u.slug}`,ogImage:u.artwork}),e.jsx(Ia,{eventId:u._id,audience:p,children:e.jsx(Oa,{event:h,ownerId:c},`${u._id}:${c??"guest"}`)})]})}function Cr(){const{slug:t=""}=Jt();return e.jsx("div",{className:"min-h-full bg-light-50 pb-[calc(7rem+env(safe-area-inset-bottom))] pt-14 text-gray-900 dark:bg-dark-900 dark:text-white lg:pb-24",children:e.jsx("div",{className:"mx-auto w-full max-w-7xl px-5 pt-3 sm:px-8 sm:pt-4 lg:px-12 lg:pt-5 2xl:max-w-[96rem] 2xl:px-16",children:e.jsx(Ae,{leading:e.jsx(Qe,{}),children:e.jsx(Va,{slug:t})},t)})})}export{Cr as EventDetailPage,Cr as default};

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.