1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[748],{3989:function(e,t,s){s.d(t,{Z:function(){return l}});let l=(0,s(1134).Z)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},39:function(e,t,s){s.d(t,{Z:function(){return l}});let l=(0,s(1134).Z)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},5494:function(e,t,s){s.d(t,{Z:function(){return l}});let l=(0,s(1134).Z)("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]])},5062:function(e,t,s){s.d(t,{Z:function(){return l}});let l=(0,s(1134).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},3058:function(e,t,s){s.d(t,{Z:function(){return l}});let l=(0,s(1134).Z)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},2190:function(e,t,s){s.d(t,{Z:function(){return l}});let l=(0,s(1134).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},8748:function(e,t,s){s.r(t),s.d(t,{default:function(){return C}});var l=s(5893),i=s(7294),r=s(1163),o=s(8542),n=s(5494),a=s(1134);let d=(0,a.Z)("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),c=(0,a.Z)("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var x=s(2190);let h=(0,a.Z)("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);var m=s(3989),u=s(3058);let p=(0,a.Z)("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),f=(0,a.Z)("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);var v=s(5062),g=s(39);let j=(0,a.Z)("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),b=[{name:"Early Childhood",icon:"\uD83D\uDC92"},{name:"My Parents",icon:"\uD83D\uDC68â\uD83D\uDC69â\uD83D\uDC67"},{name:"Friendships",icon:"\uD83E\uDD1D"},{name:"Love & Relationships",icon:"\uD83D\uDC95"},{name:"Family History",icon:"\uD83C\uDF33"},{name:"Career Journey",icon:"\uD83D\uDCBC"},{name:"Dreams & Aspirations",icon:"â¨"},{name:"Reflections & Regrets",icon:"\uD83E\uDE9E"},{name:"Life Lessons",icon:"\uD83D\uDCD6"},{name:"Highs & Lows",icon:"\uD83C\uDFA2"},{name:"Hardships Overcome",icon:"\uD83D\uDCAA"},{name:"Travel & Adventure",icon:"âï¸"},{name:"Funny Stories",icon:"\uD83D\uDE02"},{name:"Milestones",icon:"\uD83C\uDFC6"},{name:"Hopes for the Future",icon:"\uD83C\uDF05"},{name:"Values",icon:"â"},{name:"My Questions",icon:"âï¸"}],y=e=>{try{let t=new Date(e);if(Number.isNaN(t.getTime()))return"";return t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}catch(e){return""}},N=e=>{if(!e||0===e.length)return 0;let t=e.map(e=>{let t=new Date(e.createdAt||e.lastModified);return Number.isNaN(t.getTime())?null:t.toISOString().split("T")[0]}
1).filter(Boolean);if(0===t.length)return 0;let s=[...new Set(t)].sort().reverse(),l=new Date().toISOString().split("T")[0],i=new Date(Date.now()-864e5).toISOString().split("T")[0];if(s[0]!==l&&s[0]!==i)return 0;let r=0,o=new Date(s[0]);for(let e of s)if(e===o.toISOString().split("T")[0])r+=1,o.setDate(o.getDate()-1);else break;return r},w=e=>{let{userName:t="Storyteller",storyCount:s=0,stories:o=[],dailyInspiration:a=null,lastCategory:w=null,usageData:k=null,onRecordDailyInspiration:D,onRecordByCategory:C,onViewLibrary:z,onBrowseQuestions:M}=e,S=(0,r.useRouter)(),[Z,I]=(0,i.useState)(!1),A=Array.isArray(o)?o.slice(0,2):[],R=N(o),L=(null==a?void 0:a.completed)===!0,E=(null==a?void 0:a.question)||"What is a story you want to share today?",F=(null==k?void 0:k.isPremium)||!1,T=(null==k?void 0:k.storyCount)||0,B=(null==k?void 0:k.limit)||10,U=null==k?void 0:k.storiesRemaining,q=!F&&null!==U&&U<=2&&U>0,O=!F&&0===U,H=e=>{I(!1),C(e)};return(0,l.jsxs)("div",{className:"space-y-10 animate-fade-in pb-10",children:[(0,l.jsxs)("header",{className:"flex flex-col md:flex-row justify-between items-start md:items-end gap-6",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("p",{className:"text-stone-500 font-medium mb-2 flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-2 h-2 rounded-full bg-emerald-500"}),"Good morning, ",t]}),(0,l.jsx)("h1",{className:"text-4xl md:text-5xl font-serif font-medium text-stone-900 tracking-tight leading-tight",children:L?(0,l.jsxs)(l.Fragment,{children:["Great work today! ",(0,l.jsx)("br",{}),(0,l.jsx)("span",{className:"text-stone-400 italic",children:"Ready for more?"})]}):(0,l.jsxs)(l.Fragment,{children:["Ready to capture ",(0,l.jsx)("br",{}),(0,l.jsx)("span",{className:"text-stone-400 italic",children:0===s?"your first memory?":"another memory?"})]})})]}),(0,l.jsxs)("div",{className:"flex gap-4 items-start",children:[k&&!F&&(0,l.jsxs)("div",{className:"text-right ".concat(O?"animate-pulse":""),children:[(0,l.jsxs)("div",{className:"text-sm font-semibold ".concat(O?"text-red-600":q?"text-amber-600":"text-stone-600"),children:[T," of ",B," free"]}),O?(0,l.jsxs)("button",{onClick:()=>S.push("/upgrade"),className:"mt-1 inline-flex items-center gap-1 px-3 py-1 bg-violet-600 text-white text-xs font-semibold rounded-full hover:bg-violet-700 transition-colors",children:[(0,l.jsx)(n.Z,{size:12}),"Upgrade"]}):q?(0,l.jsxs)("div",{className:"text-xs text-amber-500 font-medium",children:[U," left"]}):null]}),F&&(0,l.jsxs)("div",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-violet-100 text-violet-700 text-xs font-semibold rounded-full",children:[(0,l.jsx)(n.Z,{size:12}),"Premium"]}),(0,l.jsxs)("div",{className:"hidden md:block text-right",children:[(0,l.jsx)("div",{className:"text-2xl font-bold text-stone-900",children:s}),(0,l.jsx)("div",{className:"text-xs text-stone-400 font-medium uppercase tracking-wide",children:"Stories Told"})]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-6",children:[0===s?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"md:col-span-8 relative bg-stone-900 rounded-[2.5rem] p-10 md:p-14 text-white overflow-hidden shadow-xl transition-all",children:[(0,l.jsxs)("div",{className:"absolute inset-0 opacity-40 mix-blend-overlay",children:[(0,l.jsx)("div",{className:"absolute -top-20 -right-20 w-96 h-96 bg-violet-600 rounded-full blur-[100px]"}),(0,l.jsx)("div",{className:"absolute bottom-0 left-0 w-80 h-80 bg-emerald-500 rounded-full blur-[80px] opacity-60"})]}),(0,l.jsx)("div",{className:"relative z-10",children:Z?(0,l.jsxs)("div",{className:"animate-fade-in",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,l.jsx)("h3",{className:"text-xl font-serif",children:"Choose a topic to start"}),(0,l.jsx)("button",{onClick:()=>I(!1),className:"w-8 h-8 rounded-full bg-white/10 flex items-center justify-center hover:bg-white/20 transition-colors",children:(0,l.jsx)(x.Z,{size:16})})]}),M&&(0,l.jsxs)("button",{onClick:()=>{I(!1),M()},className:"w-full mb-4 flex items-center justify-center gap-3 px-5 py-3 bg-white/10 hover:bg-white/20 border border-white/20 rounded-xl transition-all group",children:[(0,l.jsx)(h,{size:18}),(0,l.jsx)("span",{className:"font-medium",children:"Browse All Questions"}),(0,l.jsx)(m.Z,{size:14,className:"opacity-60 group-hover:translate-x-1 transition-transform"})]}),(0,l.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-5 ga
1p-3",children:b.map(e=>(0,l.jsxs)("button",{onClick:()=>H(e.name),className:"flex flex-col items-center gap-2 p-4 rounded-2xl bg-white/10 hover:bg-white/20 transition-all hover:scale-105 text-center",children:[(0,l.jsx)("span",{className:"text-2xl",children:e.icon}),(0,l.jsx)("span",{className:"text-sm font-medium leading-tight",children:e.name})]},e.name))})]}):(0,l.jsxs)("div",{onClick:()=>I(!0),className:"h-full flex flex-col justify-between items-start cursor-pointer group",children:[(0,l.jsx)("div",{className:"w-14 h-14 rounded-2xl bg-white/20 flex items-center justify-center mb-6",children:(0,l.jsx)(d,{size:28})}),(0,l.jsxs)("div",{className:"mt-4 mb-8",children:[(0,l.jsx)("p",{className:"text-white/70 text-lg mb-3",children:"Start telling your story"}),(0,l.jsx)("h2",{className:"text-3xl md:text-4xl font-serif leading-snug",children:"Select a Category"})]}),(0,l.jsxs)("button",{className:"flex items-center gap-3 text-lg font-medium group-hover:gap-5 transition-all",children:["Choose a Topic ",(0,l.jsx)(c,{size:20})]})]})})]}),(0,l.jsxs)("div",{onClick:D,className:"md:col-span-4 relative bg-white rounded-[2.5rem] p-8 overflow-hidden group cursor-pointer shadow-soft border border-stone-100 transition-all hover:scale-[1.01] hover:shadow-lg",children:[(0,l.jsx)("div",{className:"absolute -right-10 -bottom-10 w-40 h-40 bg-stone-50 rounded-full blur-3xl group-hover:bg-violet-50 transition-colors"}),(0,l.jsxs)("div",{className:"relative z-10 h-full flex flex-col justify-between",children:[(0,l.jsxs)("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-stone-100 text-sm font-medium text-stone-600 w-fit mb-4",children:[(0,l.jsx)(u.Z,{size:12,className:"text-yellow-500"}),(0,l.jsx)("span",{children:"Daily Inspiration"})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("p",{className:"text-stone-600 font-serif text-lg leading-snug mb-4",children:['"',E,'"']}),(0,l.jsx)("span",{className:"text-sm font-medium text-violet-600 group-hover:text-violet-700",children:"Record this prompt â"})]})]})]})]}):w?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{onClick:()=>C(w),className:"md:col-span-5 relative bg-gradient-to-br from-violet-600 to-violet-700 rounded-[2.5rem] p-10 md:p-12 text-white overflow-hidden group cursor-pointer shadow-xl transition-all hover:scale-[1.01]",children:[(0,l.jsx)("div",{className:"absolute -right-10 -bottom-10 w-60 h-60 bg-white/10 rounded-full blur-3xl"}),(0,l.jsxs)("div",{className:"relative z-10 h-full flex flex-col justify-between",children:[(0,l.jsx)("div",{className:"w-14 h-14 rounded-2xl bg-white/20 flex items-center justify-center mb-6",children:(0,l.jsx)(m.Z,{size:28})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-white/70 text-lg mb-2",children:"Continue where you left off"}),(0,l.jsx)("h2",{className:"text-3xl font-serif font-medium",children:w})]})]})]}),(0,l.jsxs)("div",{onClick:()=>I(!0),className:"md:col-span-3 relative bg-white rounded-[2.5rem] p-8 overflow-hidden group cursor-pointer shadow-soft border border-stone-100 transition-all hover:scale-[1.01] hover:shadow-lg",children:[(0,l.jsx)("div",{className:"absolute -right-10 -bottom-10 w-40 h-40 bg-stone-50 rounded-full blur-3xl group-hover:bg-violet-50 transition-colors"}),(0,l.jsxs)("div",{className:"relative z-10 h-full flex flex-col justify-between",children:[(0,l.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-stone-100 flex items-center justify-center mb-6 group-hover:bg-violet-100 transition-colors",children:(0,l.jsx)(d,{size:24,className:"text-stone-600 group-hover:text-violet-600 transition-colors"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-stone-500 text-sm font-medium mb-2",children:"Or explore"}),(0,l.jsx)("h3",{className:"text-xl font-serif font-medium text-stone-900",children:"Other Topics"})]})]})]}),!L&&(0,l.jsx)("div",{onClick:D,className:"md:col-span-4 relative bg-stone-50 rounded-[2.5rem] p-6 overflow-hidden group cursor-pointer border border-stone-100 transition-all hover:scale-[1.01] hover:bg-white hover:shadow-soft",children:(0,l.jsxs)("div",{className:"relative z-10 flex items-center gap-4",children:[(0,l.jsx)("div",{className:"w-10 h-10 rounded-xl bg-white flex items-center justify-center shadow-sm",children:(0,l.jsx)(u.Z,{size:18,className:"text-yellow-500"})}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("p",{className:"text-xs font-medium text-stone-400 uppercase tracking-wide mb-1",children:"Daily Inspiration"}),(0,l.jsxs)("p",{className:"text-stone-600 font-serif text-sm leading-snug truncate",children:['"',E,'"']})]}),(0,l.jsx)(c,{size:16,className:"text-stone-400 group-hover:text-violet-600 transition-colors"})]})})]}):L?(0,l.jsxs)("div",{className:"md:col-span-8 grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,l.jsxs)("div",{onClick:()=>I(!0),className:"relative bg-white rounded-[2.5rem] p-8 overflow-hidden group cursor-pointer shadow-soft border border-stone-100 transition-all hover:scale-[1.01] hover:shadow-lg",children:[(0,l.jsx)("div",{className:"absolute -right-10 -bottom-10 w-40 h-40 bg-stone-50 rounded-full blur-3xl group-hover:bg-violet-50 transition-colors"}),(0,l.jsxs)("div",{className:"relative z-10 h-full flex flex-col justify-between",children:[(0,l.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-stone-100 flex items-center justify-center mb-6 group-hover:bg-violet-100 transition-colors",children:(0,l.jsx)(d,{size:24,className:"text-stone-600 group-hover:text-violet-600 transition-colors"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-stone-500 text-sm font-medium mb-2",children:"Explore topics"}),(0,l.jsx)("h3",{className:"text-2xl font-serif font-medium text-stone-900",children:"Select a Category"})]})]})]}),(0,l.jsx)("div",{className:"relative bg-emerald-50 rounded-[2.5rem] p-8 overflow-hidden border border-emerald-100",children:(0,l.jsxs)("div",{className:"relative z-10 h-full flex flex-col justify-between",children:[(0,l.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-emerald-100 flex items-center justify-center mb-6",children:(0,l.jsx)(p,{size:24,className:"text-emerald-600"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-emerald-700 text-sm font-medium mb-2",children:"Done for today"}),(0,l.jsx)("h3",{className:"text-xl font-serif font-medium text-emerald-900",children:"Daily Inspiration Complete"})]})]})})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{onClick:D,className:"md:col-span-8 relative bg-stone-900 rounded-[2.5rem] p-10 md:p-14 text-white overflow-hidden group cursor-pointer shadow-xl transition-all hover:scale-[1.01]",children:[(0,l.jsxs)("div",{className:"absolute inset-0 opacity-40 mix-blend-overlay",children:[(0,l.jsx)("div",{className:"absolute -top-20 -right-20 w-96 h-96 bg-violet-600 rounded-full blur-[100px] group-hover:bg-violet-500 transition-colors duration-700"}),(0,l.jsx)("div",{className:"absolute bottom-0 left-0 w-80 h-80 bg-rose-500 rounded-full blur-[80px] opacity-60"})]}),(0,l.jsxs)("div",{className:"relative z-10 h-full flex flex-col justify-between items-start",children:[(0,l.jsxs)("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-white/10 backdrop-blur-md border border-white/10 text-sm font-medium",children:[(0,l.jsx)(u.Z,{size:14,className:"text-yellow-300"}),(0,l.jsx)("span",{children:"Daily Inspiration"})]}),(0,l.jsx)("div",{className:"mt-8 mb-8",children:(0,l.jsxs)("h2",{className:"text-3xl md:text-4xl font-serif leading-snug",children:['"',E,'"']})}),(0,l.jsxs)("button",{className:"flex items-center gap-3 text-lg font-medium group-hover:gap-5 transition-all",children:["Start Recording ",(0,l.jsx)(c,{size:20})]})]})]}),(0,l.jsxs)("div",{onClick:()=>I(!0),className:"md:col-span-4 relative bg-white rounded-[2.5rem] p-8 overflow-hidden group cursor-pointer shadow-soft border border-stone-100 transition-all hover:scale-[1.01] hover:shadow-lg",children:[(0,l.jsx)("div",{className:"absolute -right-10 -bottom-10 w-40 h-40 bg-stone-50 rounded-full blur-3xl group-hover:bg-violet-50 transition-colors"}),(0,l.jsxs)("div",{className:"relative z-10 h-full flex flex-col justify-between",children:[(0,l.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-stone-100 flex items-center justify-center mb-6 group-hover:bg-violet-100 transition-colors",children:(0,l.jsx)(d,{size:24,className:"text-stone-600 group-hover:text-violet-600 transition-colors"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-stone-500 text-sm font-medium mb-2",children:"Or choose your own"}),(0,l.jsx)("h3",{className:"text-xl font-serif font-medium text-stone-900",children:"Select a Category"})]})]})]})]}),(0,l.jsxs)("div",{className:"md:col-span-4 bg-white rounded-[2.5rem] p-8 shadow-soft border border-stone-100 flex flex-col justify-between relative overflow-hidden group",children:[(0,l.jsx)("div",{className:"absolute -right-10 -top-10 w-40 h-40 bg-stone-50 rounded-full blur-3xl group-hover:bg-violet-50 transition-colors"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-stone-100 flex items-center justify-center text-stone-900 mb
1-6 group-hover:bg-violet-100 group-hover:text-violet-600 transition-colors",children:(0,l.jsx)(f,{size:24})}),(0,l.jsx)("h3",{className:"text-stone-500 font-medium",children:"Current Streak"}),(0,l.jsxs)("div",{className:"text-4xl font-bold text-stone-900 mt-2",children:[R," ",(0,l.jsx)("span",{className:"text-lg font-normal text-stone-400",children:"days"})]})]}),(0,l.jsx)("div",{className:"mt-8",children:(0,l.jsx)("p",{className:"text-sm text-stone-600 leading-relaxed",children:"Consistency is key to a rich legacy. You're doing great."})})]}),(0,l.jsxs)("div",{className:"md:col-span-12 bg-white rounded-[2.5rem] p-8 md:p-10 shadow-soft border border-stone-100",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,l.jsx)("h3",{className:"text-xl font-bold text-stone-900",children:"Recent Stories"}),(0,l.jsx)("button",{onClick:z,className:"text-sm font-semibold text-violet-600 hover:text-violet-700",children:"View Library"})]}),0===A.length?(0,l.jsx)("div",{className:"text-stone-500 text-sm",children:"No stories yet. Start recording to begin."}):(0,l.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:A.map((e,t)=>(0,l.jsx)("div",{className:"group p-4 rounded-3xl hover:bg-stone-50 transition-colors cursor-pointer border border-transparent hover:border-stone-100",children:(0,l.jsxs)("div",{className:"flex items-start gap-5",children:[(0,l.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-stone-100 text-stone-900 flex items-center justify-center flex-shrink-0 group-hover:bg-violet-600 group-hover:text-white transition-all shadow-sm",children:(0,l.jsx)(v.Z,{size:24,className:"ml-1"})}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("h4",{className:"font-serif font-bold text-lg text-stone-900 truncate pr-4",children:e.questionText||e.title||"Untitled"}),e.transcript?(0,l.jsx)("p",{className:"text-stone-500 text-sm truncate mt-1",children:e.transcript}):null,(0,l.jsxs)("div",{className:"flex items-center gap-4 mt-3 text-xs font-semibold text-stone-400 uppercase tracking-wide",children:[e.duration&&(0,l.jsxs)("span",{className:"flex items-center gap-1",children:[(0,l.jsx)(g.Z,{size:12})," ",e.duration]}),(0,l.jsx)("span",{children:"â¢"}),(0,l.jsx)("span",{children:y(e.lastModified||e.createdAt||Date.now())})]})]}),(0,l.jsx)("button",{className:"opacity-0 group-hover:opacity-100 p-2 text-stone-400 hover:text-stone-900 transition-all",children:(0,l.jsx)(j,{size:20})})]})},e.id||t))})]})]}),Z&&s>0&&(0,l.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,l.jsx)("div",{className:"absolute inset-0 bg-stone-900/60 backdrop-blur-sm",onClick:()=>I(!1)}),(0,l.jsxs)("div",{className:"relative bg-white rounded-[2rem] p-8 md:p-10 max-w-2xl w-full shadow-2xl animate-fade-in",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-2xl font-serif font-medium text-stone-900",children:"Select a Category"}),(0,l.jsx)("p",{className:"text-stone-500 mt-1",children:"Choose a topic to start recording"})]}),(0,l.jsx)("button",{onClick:()=>I(!1),className:"w-10 h-10 rounded-full bg-stone-100 flex items-center justify-center hover:bg-stone-200 transition-colors",children:(0,l.jsx)(x.Z,{size:20,className:"text-stone-600"})})]}),M&&(0,l.jsxs)("button",{onClick:()=>{I(!1),M()},className:"w-full mb-6 flex items-center justify-center gap-3 px-6 py-4 bg-violet-50 hover:bg-violet-100 border-2 border-violet-200 rounded-2xl transition-all group",children:[(0,l.jsx)(h,{size:20,className:"text-violet-600"}),(0,l.jsx)("span",{className:"font-medium text-violet-700",children:"Browse All Questions"}),(0,l.jsx)(m.Z,{size:16,className:"text-violet-400 group-hover:translate-x-1 transition-transform"})]}),(0,l.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:b.map(e=>(0,l.jsxs)("button",{onClick:()=>H(e.name),className:"flex flex-col items-center gap-3 p-4 rounded-2xl bg-stone-50 hover:bg-violet-50 border-2 border-transparent hover:border-violet-200 transition-all hover:scale-105 text-center group",children:[(0,l.jsx)("span",{className:"text-3xl",children:e.icon}),(0,l.jsx)("span",{className:"text-sm font-medium text-stone-700 group-hover:text-violet-700 leading-tight",children:e.name})]},e.name))})]})]})]})};var k=s(7414),D=s(198);function C(){var e;let t=(0,r.useRouter)(),{user:s,loading:n}=(0,k.a)(),[a,d]=(0,i.useState)([]),[c,x]=(0,i.useState)(!0),[h,m]=(0,i.useState)(null),[u,p]=(0,i.useState)(null),[f,v]=(0,i.useState)(null);(0,i.useEffect)(()=>{n||s||t.replace("/welcome")},[s,n,t]),(0,i.useEffect)(()=>{s&&(async()=>{try{var e;let t=await (null===(e=D.I8.currentUser)||void 0===e?void 0:e.getIdToken());if(!t)return;let s=await fetch("/api/user/daily-inspiration",{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){let e=await s.json();m(e.dailyInspiration),p(e.lastCategory)}}catch(e){console.error("Failed to fetch daily inspiration",e)}})()},[s]),(0,i.useEffect)(()=>{s&&(async()=>{try{var e;let t=await (null===(e=D.I8.currentUser)||void 0===e?void 0:e.getIdToken());if(!t)return;let s=await fetch("/api/user/usage",{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){let e=await s.json();v(e)}}catch(e){console.error("Failed to fetch usage data",e)}})()},[s]),(0,i.useEffect)(()=>{s&&(async()=>{x(!0);try{let e="";(null===D.I8||void 0===D.I8?void 0:D.I8.currentUser)&&(e=await D.I8.currentUser.getIdToken(!0));let t=await fetch("/api/stories",{headers:{Authorization:"Bearer ".concat(e)}});if(!t.ok)throw Error(await t.text());let s=((await t.json()).stories||[]).sort((e,t)=>
1new Date(t.lastModified||t.createdAt||0)-new Date(e.lastModified||e.createdAt||0));d(s)}catch(e){d([])}finally{x(!1)}})()},[s]);let g=(null==s?void 0:s.displayName)||(null==s?void 0:null===(e=s.email)||void 0===e?void 0:e.split("@")[0])||"Storyteller",j=(null==a?void 0:a.length)||0;return n||c?(0,l.jsx)("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",fontSize:22,color:"#888"},children:"Loading..."}):(0,l.jsx)(o.c,{children:(0,l.jsx)(w,{userName:g,storyCount:j,stories:a,dailyInspiration:h,lastCategory:u,usageData:f,onRecordDailyInspiration:()=>{(null==h?void 0:h.question)?t.push("/record?prompt=".concat(encodeURIComponent(h.question),"&source=daily")):t.push("/record")},onRecordByCategory:e=>{e?t.push("/record?category=".concat(encodeURIComponent(e))):t.push("/record")},onViewLibrary:()=>t.push("/stories"),onBrowseQuestions:()=>t.push("/browse")})})}}}]);
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.