exports.id=354,exports.ids=[354],exports.modules={9659:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,2583,23)),Promise.resolve().then(s.t.bind(s,6840,23)),Promise.resolve().then(s.t.bind(s,8771,23)),Promise.resolve().then(s.t.bind(s,3225,23)),Promise.resolve().then(s.t.bind(s,9295,23)),Promise.resolve().then(s.t.bind(s,3982,23))},7378:(e,t,s)=>{Promise.resolve().then(s.bind(s,4669))},8031:(e,t,s)=>{"use strict";s.d(t,{Z:()=>z});var i=s(2295),a=s(3729),n=s(3644),r=s(7916),l=s(3024),o=s(3211),c=s(7060),d=s(7958),h=s(9224);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let m=(0,h.Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),u=(0,h.Z)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),x=(0,h.Z)("Volume2",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]]),p=(0,h.Z)("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),g=(0,h.Z)("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);var f=s(113),y=s(4669),b=s(8001),v=s(4538);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let j=(0,h.Z)("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);function k({isActive:e,audioLevel:t=0,color:s="#6366f1",barCount:n=20}){let r=(0,a.useRef)([]);(0,a.useEffect)(()=>{if(!e){r.current.forEach(e=>{e&&(e.style.transform="scaleY(0.15)")});return}let s=setInterval(()=>{r.current.forEach((e,s)=>{if(!e)return;let i=t/100,a=.3*Math.sin(Date.now()/200+.5*s);e.style.transform=`scaleY(${Math.max(.15,Math.min(1,.7*i+a+.2*Math.random()))})`})},50);return()=>clearInterval(s)},[e,t]);let l=["#6366f1","#7c3aed","#8b5cf6","#a855f7","#c026d3","#db2777","#ec4899","#db2777","#c026d3","#a855f7","#8b5cf6","#7c3aed","#6366f1","#4f46e5","#4338ca","#6366f1","#7c3aed","#a855f7","#c026d3","#6366f1"];return i.jsx("div",{className:"flex items-end justify-center gap-0.5",style:{height:"40px"},children:Array.from({length:n}).map((e,t)=>i.jsx("div",{ref:e=>{r.current[t]=e},className:"wave-bar",style:{height:"40px",background:l[t%l.length],animationDelay:`${.05*t}s`,animationDuration:`${.4+.3*Math.random()}s`,transform:"scaleY(0.15)",transition:"transform 0.05s ease"}},t))})}let N={idle:{bg:"linear-gradient(135deg, #6366f1, #a855f7)",label:"Tap to speak",icon:p,glow:"rgba(99,102,241,0.4)"},listening:{bg:"linear-gradient(135deg, #ef4444, #dc2626)",label:"Listening...",icon:p,glow:"rgba(239,68,68,0.5)"},thinking:{bg:"linear-gradient(135deg, #f59e0b, #d97706)",label:"Thinking...",icon:j,glow:"rgba(245,158,11,0.4)"},speaking:{bg:"linear-gradient(135deg, #3b82f6, #2563eb)",label:"Speaking...",icon:x,glow:"rgba(59,130,246,0.4)"}},w={sm:{button:56,icon:20,fontSize:11},md:{button:72,icon:24,fontSize:12},lg:{button:80,icon:28,fontSize:13}};function S({state:e,audioLevel:t=0,onTap:s,onLongPress:l,disabled:o,size:c="lg"}){let[d,h]=(0,a.useState)(!1),m=(0,a.useRef)(null),u=N[e],x=w[c],p=(0,a.useCallback)(()=>{h(!0),"vibrate"in navigator&&navigator.vibrate(50),l&&(m.current=setTimeout(()=>{"vibrate"in navigator&&navigator.vibrate([50,100,50]),l()},600))},[l]),g=(0,a.useCallback)(()=>{h(!1),m.current&&(clearTimeout(m.current),m.current=null)},[]),f=(0,a.useCallback)(()=>{o||("vibrate"in navigator&&navigator.vibrate(50),s())},[o,s]);return(0,i.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[i.jsx(n.M,{children:("listening"===e||"speaking"===e)&&i.jsx(r.E.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},children:i.jsx(k,{isActive:!0,audioLevel:t,barCount:20})})}),(0,i.jsxs)("div",{className:"relative flex items-center justify-center",children:["listening"===e&&(0,i.jsxs)(i.Fragment,{children:[i.jsx(r.E.div,{className:"absolute rounded-full",style:{width:x.button+32,height:x.button+32,background:"rgba(239,68,68,0.15)"},animate:{scale:[1,1.3,1],opacity:[.6,0,.6]},transition:{duration:1.5,repeat:1/0}}),i.jsx(r.E.div,{className:"absolute rounded-full",style:{width:x.button+16,height:x.button+16,background:"rgba(239,68,68,0.2)"},animate:{scale:[1,1.2,1],opacity:[.8,.2,.8]},transition:{duration:1.5,repeat:1/0,delay:.3}})]}),"thinking"===e&&i.jsx(r.E.div,{className:"absolute rounded-full border-2 border-amber-400",style:{width:x.button+20,height:x.button+20,borderStyle:"dashed"},animate:{rotate:360},transition:{duration:3,repeat:1/0,ease:"linear"}}),i.jsx(r.E.button,{onClick:f,onPointerDown:p,onPointerUp:g,onPointerLeave:g,disabled:o,whileTap:{scale:.92},animate:{scale:d?.95:1},className:"relative flex items-center justify-center rounded-full cursor-pointer select-none",style:{width:x.button,height:x.button,background:u.bg,boxShadow:`0 8px 32px ${u.glow}, 0 4px 16px rgba(0,0,0,0.2)`,border:"none",outline:"none"},"aria-label":u.label,children:i.jsx(r.E.div,{initial:{scale:0,rotate:-90},animate:{scale:1,rotate:0},transition:{type:"spring",stiffness:400,damping:20},children:i.jsx(u.icon,{size:x.icon,color:"white",className:"thinking"===e?"animate-sparkle":"listening"===e?"animate-voice-pulse":""})},e)})]}),i.jsx(r.E.p,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"text-xs font-semibold",style:{color:"var(--text-secondary)",fontSize:x.fontSize},children:u.label},e)]})}var C=s(4513);let T={idle:"#6366f1",listening:"#ef4444",thinking:"#f59e0b",speaking:"#3b82f6"},E={idle:"Tap mic to speak",listening:"Listening...",thinking:"James is thinking...",speaking:"James is speaking..."},L={idle:i.jsx(p,{className:"w-5 h-5"}),listening:i.jsx(p,{className:"w-5 h-5"}),thinking:i.jsx(j,{className:"w-5 h-5"}),speaking:i.jsx(x,{className:"w-5 h-5"})};function $({isOpen:e,voiceState:t,transcript:s,interimTranscript:l,audioLevel:o,recentMessages:c,onClose:d,onTap:h,clientName:m="You"}){let u=(0,a.useRef)(null),x=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=u.current;if(!e)return;let t=0,s=e=>{t=e.touches[0].clientY},i=e=>{e.changedTouches[0].clientY-t>80&&d()};return e.addEventListener("touchstart",s,{passive:!0}),e.addEventListener("touchend",i,{passive:!0}),()=>{e.removeEventListener("touchstart",s),e.removeEventListener("touchend",i)}},[d]),(0,a.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[c,s,l]);let p=T[t],g=c.slice(-6);return i.jsx(n.M,{children:e&&(0,i.jsxs)(i.Fragment,{children:[i.jsx(r.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40",style:{background:"rgba(0,0,0,0.6)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},onClick:d}),(0,i.jsxs)(r.E.div,{ref:u,initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",stiffness:320,damping:32},className:"fixed bottom-0 left-0 right-0 z-50 flex flex-col",style:{maxHeight:"80vh",borderRadius:"24px 24px 0 0",background:"var(--bg-card)",boxShadow:"0 -8px 40px rgba(0,0,0,0.25)"},children:[i.jsx("div",{className:"flex justify-center pt-3 pb-1 flex-shrink-0",children:i.jsx("div",{className:"w-10 h-1 rounded-full",style:{background:"var(--border)"}})}),(0,i.jsxs)("div",{className:"flex items-center justify-between px-5 py-2 flex-shrink-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[i.jsx(r.E.div,{animate:{background:p},transition:{duration:.3},className:"w-9 h-9 rounded-full flex items-center justify-center text-white",children:L[t]}),(0,i.jsxs)("div",{children:[i.jsx("p",{className:"text-sm font-bold",style:{color:"var(--text-primary)"},children:"James Cole"}),i.jsx(r.E.p,{initial:{opacity:0},animate:{opacity:1},className:"text-xs font-medium",style:{color:p},children:E[t]},t)]})]}),i.jsx("button",{onClick:d,className:"w-8 h-8 rounded-full flex items-center justify-center",style:{background:"var(--bg-secondary)"},children:i.jsx(C.Z,{className:"w-4 h-4",style:{color:"var(--text-secondary)"}})})]}),(0,i.jsxs)("div",{className:"flex-1 overflow-y-auto px-4 py-2 space-y-3 min-h-0",children:[g.map((e,t)=>(0,i.jsxs)(r.E.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:`flex ${"user"===e.role?"justify-end":"justify-start"} gap-2`,children:["assistant"===e.role&&i.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-bold flex-shrink-0 mt-0.5",style:{background:"linear-gradient(135deg, #6366f1, #a855f7)"},children:"J"}),i.jsx("div",{className:"user"===e.role?"msg-user text-sm":"msg-ai text-sm",style:{maxWidth:"80%",padding:"8px 12px"},children:e.content})]},t)),i.jsx(n.M,{children:(s||l)&&i.jsx(r.E.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0},className:"flex justify-end",children:(0,i.jsxs)("div",{className:"rounded-2xl px-3 py-2 text-sm text-white",style:{background:"rgba(99,102,241,0.6)",maxWidth:"80%"},children:[s||l,l&&i.jsx("span",{className:"inline-block w-0.5 h-3.5 ml-0.5 bg-white animate-pulse"})]})})}),"thinking"===t&&(0,i.jsxs)(r.E.div,{initial:{opacity:0},animate:{opacity:1},className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-bold",style:{background:"linear-gradient(135deg, #6366f1, #a855f7)"},children:"J"}),(0,i.jsxs)("div",{className:"msg-ai flex items-center gap-1.5 py-2 px-3",children:[i.jsx("div",{className:"typing-dot"}),i.jsx("div",{className:"typing-dot",style:{animationDelay:"0.2s"}}),i.jsx("div",{className:"typing-dot",style:{animationDelay:"0.4s"}})]})]}),i.jsx("div",{ref:x})]}),(0,i.jsxs)("div",{className:"flex-shrink-0 flex flex-col items-center py-4 gap-3",style:{borderTop:"1px solid var(--border)"},children:[i.jsx(n.M,{children:("listening"===t||"speaking"===t)&&i.jsx(r.E.div,{initial:{opacity:0,scaleY:0},animate:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:0},children:i.jsx(k,{isActive:!0,audioLevel:o,barCount:24})})}),(0,i.jsxs)(r.E.button,{onClick:h,whileTap:{scale:.92},className:"relative flex items-center justify-center rounded-full text-white",style:{width:72,height:72,background:`linear-gradient(135deg, ${p}, ${p}cc)`,boxShadow:`0 8px 32px ${p}60`},children:["listening"===t&&i.jsx(r.E.div,{className:"absolute inset-0 rounded-full",animate:{scale:[1,1.4],opacity:[.5,0]},transition:{duration:1.2,repeat:1/0},style:{background:p}}),i.jsx(r.E.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:400,damping:20},children:L[t]},t)]}),i.jsx("p",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"listening"===t?"Tap to stop • Swipe down to close":E[t]})]}),i.jsx("div",{className:"safe-bottom flex-shrink-0"})]})]})})}var D=s(3285);class M{constructor(e={}){this.recognition=null,this.synthesis=null,this.speakQueue=[],this.isSpeaking=!1,this.isListening=!1,this.active=!1,this.silenceTimer=null,this.retryCount=0,this.MAX_RETRIES=3,this.rate=e.rate??.92,this.pitch=e.pitch??1.05,this.volume=e.volume??1,this.language=e.language??"en-US",this.silenceMs=e.silenceMs??2e3,this.onListeningChange=e.onListeningChange,this.onSpeakingChange=e.onSpeakingChange,this.onTranscript=e.onTranscript,this.onFinalTranscript=e.onFinalTranscript,this.onError=e.onError}setupRecognitionHandlers(){this.recognition&&(this.recognition.onresult=e=>{let t="",s="";for(let i=e.resultIndex;i<e.results.length;i++){let a=e.results[i][0].transcript;e.results[i].isFinal?s+=a:t+=a}t&&this.onTranscript?.(t),s&&(this.onFinalTranscript?.(s.trim()),this.resetSilenceTimer())},this.recognition.onerror=e=>{"no-speech"!==e.error&&(this.onError?.(`Speech recognition error: ${e.error}`),this.active&&this.retryCount<this.MAX_RETRIES&&(this.retryCount++,setTimeout(()=>this.startListening(),500)))},this.recognition.onend=()=>{this.setListening(!1),this.active&&!this.isSpeaking&&setTimeout(()=>this.startListening(),300)})}resetSilenceTimer(){this.silenceTimer&&clearTimeout(this.silenceTimer),this.silenceTimer=setTimeout(()=>{this.isListening&&this.stopListening()},this.silenceMs)}setListening(e){this.isListening=e,this.onListeningChange?.(e)}setSpeakingState(e){this.isSpeaking=e,this.onSpeakingChange?.(e)}start(){this.active=!0,this.startListening()}stop(){this.active=!1,this.stopListening(),this.synthesis?.cancel(),this.speakQueue=[]}startListening(){if(this.recognition&&!this.isListening&&!this.isSpeaking)try{this.recognition.start(),this.setListening(!0),this.retryCount=0}catch{}}stopListening(){if(this.recognition&&this.isListening){try{this.recognition.stop()}catch{}this.setListening(!1),this.silenceTimer&&(clearTimeout(this.silenceTimer),this.silenceTimer=null)}}speak(e){if(!this.synthesis)return;let t=this.cleanText(e);if(!t)return;this.stopListening(),this.setSpeakingState(!0);let s=new SpeechSynthesisUtterance(t);s.rate=this.rate,s.pitch=this.pitch,s.volume=this.volume,s.lang=this.language,s.onend=()=>{this.setSpeakingState(!1),this.active&&setTimeout(()=>this.startListening(),400)},s.onerror=()=>{this.setSpeakingState(!1),this.active&&setTimeout(()=>this.startListening(),400)},this.synthesis.speak(s)}enqueueSpeak(e){this.speakQueue.push(e),this.isSpeaking||this.processQueue()}processQueue(){0!==this.speakQueue.length&&this.speak(this.speakQueue.shift())}completeProcessing(){this.processQueue()}isVoiceActive(){return this.active}setSilenceMs(e){this.silenceMs=e}setLanguage(e){this.language=e,this.recognition&&(this.recognition.lang=e)}cleanText(e){return e.replace(/[#*_`~>]/g,"").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\s+/g," ").trim()}}var O=s(9157),R=s(3284),Z=s(2254);let P={1:"#6366f1",2:"#a855f7",3:"#f59e0b",4:"#10b981"},F={1:"ROOTS",2:"THE JOURNEY",3:"GLORY",4:"LEGACY"};function z({client:e,onBack:t}){let s=(0,Z.useRouter)(),h=function(){let[e,t]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=()=>t(window.innerWidth<768);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}(),[j,k]=(0,a.useState)("loading"),[N,w]=(0,a.useState)([]),[C,T]=(0,a.useState)(null),[E,L]=(0,a.useState)(null),[z,J]=(0,a.useState)([]),[I,A]=(0,a.useState)(""),[_,Y]=(0,a.useState)(!1),[B,U]=(0,a.useState)(!1),[G,H]=(0,a.useState)(0),[Q,V]=(0,a.useState)(!1),[q,W]=(0,a.useState)(!1),[K,X]=(0,a.useState)(!1),[ee,et]=(0,a.useState)("idle"),[es,ei]=(0,a.useState)(!1),[ea,en]=(0,a.useState)(""),[er,el]=(0,a.useState)(""),[eo,ec]=(0,a.useState)(0),ed=(0,a.useRef)(null),eh=(0,a.useRef)(null),em=(0,a.useRef)(null),eu=(0,a.useRef)(!1),ex=(0,a.useRef)(null),ep=(0,a.useRef)(null),eg=(0,a.useRef)(null),ef=(0,a.useRef)(null),ey={recognition:!1},eb=(0,a.useRef)(()=>{}),ev=(0,a.useRef)(!1);(0,a.useRef)(e=>{ev.current=e(ev.current),ei(ev.current)}),(0,a.useEffect)(()=>{ej()},[]);let ej=async()=>{try{let t=await O.T6.getState(e.id);w(t.chapters),T(t.state),J(Array.isArray(e.messages)?e.messages:[]),k(12===t.state.completedChapters?"all_done":"chapter_select")}catch{k("chapter_select"),w([])}};(0,a.useEffect)(()=>{ed.current?.scrollIntoView({behavior:"smooth"})},[z,B]),(0,a.useEffect)(()=>{if(!ey.recognition)return;let e=new M({rate:.88,pitch:1,onListeningChange:e=>{et(t=>"thinking"===t||"speaking"===t?t:e?"listening":"idle"),e?ek():eN()},onSpeakingChange:t=>{t?et("speaking"):(et("idle"),ev.current&&setTimeout(()=>{et("listening"),e.startListening()},600))},onTranscript:e=>el(e),onFinalTranscript:t=>{en(t),el(""),et("thinking"),e.stopListening(),eN(),eb.current(t,!0)},onError:e=>{console.warn("Voice error:",e),et("idle")}});return em.current=e,()=>{e.stop(),eN()}},[]);let ek=async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});ep.current=new AudioContext,eg.current=ep.current.createAnalyser(),eg.current.fftSize=256,ep.current.createMediaStreamSource(e).connect(eg.current);let t=new Uint8Array(eg.current.frequencyBinCount);ef.current=setInterval(()=>{eg.current?.getByteFrequencyData(t);let e=t.reduce((e,t)=>e+t,0)/t.length;ec(Math.min(100,2*e))},50)}catch{}},eN=()=>{ef.current&&(clearInterval(ef.current),ef.current=null),ep.current&&(ep.current.close(),ep.current=null),ec(0)},ew=async t=>{L(t),Y(!0),U(!0),k("interviewing");try{let s=await O.T6.startChapter({clientId:e.id,chapterNum:t.num});T(s.state),J(e=>[...e,{role:"assistant",content:s.response,chapterNum:t.num,timestamp:new Date().toISOString()}]),H(0),V(!1),ev.current&&em.current&&(et("speaking"),em.current.speak(s.response))}catch(e){y.default.error(e.message||"Failed to start chapter"),k("chapter_select")}finally{Y(!1),U(!1)}},eS=(0,a.useCallback)(async(t,s=!1)=>{if(!eu.current&&t.trim()&&E){eu.current=!0,Y(!0),U(!0),et("thinking"),J(e=>[...e,{role:"user",content:t,chapterNum:E.num,timestamp:new Date().toISOString()}]),A(""),en("");try{let i=await O.T6.sendMessage({clientId:e.id,message:t,chapterNum:E.num,isVoice:s});U(!1),J(e=>[...e,{role:"assistant",content:i.response,chapterNum:E.num,timestamp:new Date().toISOString()}]),H(i.chapterUserResponses),V(i.canComplete),T(i.state),"vibrate"in navigator&&navigator.vibrate([30,50,30]),ev.current&&em.current?(et("speaking"),em.current.speak(i.response)):et("idle"),ex.current&&clearTimeout(ex.current),X(!1),ex.current=setTimeout(()=>{X(!0),setTimeout(()=>X(!1),3e3)},1500)}catch(e){U(!1),et("idle"),y.default.error(e.message||"Failed to send"),J(e=>e.slice(0,-1))}finally{Y(!1),eu.current=!1}}},[E,e.id]);(0,a.useEffect)(()=>{eb.current=eS},[eS]);let eC=async()=>{if(E){Y(!0);try{let t=await O.T6.completeChapter({clientId:e.id,chapterNum:E.num});T(t.state),J(e=>[...e,{role:"assistant",content:t.closingMessage,chapterNum:E.num,type:"chapter_closing",timestamp:new Date().toISOString()}]),"vibrate"in navigator&&navigator.vibrate([50,100,50,100,50]),k(t.isAllDone?"all_done":"chapter_complete")}catch(e){y.default.error(e.message||"Failed to complete chapter")}finally{Y(!1)}}},eT=(0,a.useCallback)(()=>{if(!em.current){y.default.error("Voice not supported in this browser");return}"listening"===ee?(em.current.stopListening(),et("idle")):"idle"===ee&&(ev.current=!0,ei(!0),et("listening"),em.current.startListening())},[ee]),eE=async()=>{W(!0);try{await O.s9.generate(e.id),y.default.success("Book generated!"),s.push(`/book/${e.id}`)}catch(e){y.default.error(e.message||"Failed to generate book")}finally{W(!1)}},eL=e=>{if("speechSynthesis"in window){window.speechSynthesis.cancel();let t=new SpeechSynthesisUtterance(e.replace(/[#*_`]/g,""));t.rate=.92,t.pitch=1.05,window.speechSynthesis.speak(t)}},e$=z.filter(e=>e.chapterNum===E?.num&&"system"!==e.role&&e.content),eD=C?.completedChapters??0,eM=C?.progress??0,eO=P[E?.part||1],[eR,eZ]=(0,a.useState)(null),[eP,eF]=(0,a.useState)(!1),ez=(0,a.useRef)(null);return(0,a.useEffect)(()=>{E&&!(G<3)&&G%3==0&&(ez.current&&clearTimeout(ez.current),ez.current=setTimeout(async()=>{eF(!0);try{let t=await O.s9.preview(e.id,E.num);t.preview&&eZ(t.preview)}catch{}finally{eF(!1)}},1e3))},[G,E,e.id]),(0,i.jsxs)("div",{className:"h-screen flex flex-col",style:{background:"var(--bg-secondary)"},children:[(0,i.jsxs)("header",{className:"flex-shrink-0 border-b px-4 py-3 flex items-center gap-3 safe-top",style:{background:"var(--bg-card)",borderColor:"var(--border)"},children:[i.jsx("button",{onClick:t,className:"btn-ghost p-2 rounded-lg touch-target","aria-label":"Go back to dashboard",children:i.jsx(l.Z,{className:"w-4 h-4"})}),(0,i.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[i.jsx("span",{className:"text-xl",children:(0,R.w2)(e.sport)}),(0,i.jsxs)("div",{className:"min-w-0",children:[i.jsx("h1",{className:"font-bold text-sm truncate",style:{color:"var(--text-primary)"},children:e.name}),i.jsx("p",{className:"text-xs truncate",style:{color:"var(--text-secondary)"},children:e.bookTitle})]})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,i.jsxs)("div",{className:"hidden sm:flex items-center gap-2",children:[(0,i.jsxs)("span",{className:"text-xs font-semibold",style:{color:"var(--text-secondary)"},children:[eD,"/12"]}),i.jsx("div",{className:"w-20",children:i.jsx(b.Z,{value:eM})})]}),i.jsx(n.M,{children:K&&i.jsx(r.E.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"text-xs text-green-500 hidden sm:block",children:"✓"})}),eD>=3&&(0,i.jsxs)("button",{onClick:eE,disabled:q,className:"btn-primary flex items-center gap-1.5 text-xs py-2",children:[q?i.jsx(v.Z,{size:"sm"}):i.jsx(o.Z,{className:"w-3.5 h-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:"Generate Book"})]})]})]}),(0,i.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,i.jsxs)("aside",{className:"hidden lg:flex flex-col w-64 border-r flex-shrink-0 overflow-y-auto",style:{borderColor:"var(--border)",background:"var(--bg-card)"},children:[(0,i.jsxs)("div",{className:"p-3",children:[i.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"var(--text-secondary)"},children:"Book Chapters"}),[1,2,3,4].map(e=>(0,i.jsxs)("div",{className:"mb-3",children:[(0,i.jsxs)("p",{className:"text-xs font-bold mb-1.5 px-1",style:{color:P[e]},children:["Part ",e,": ",F[e]]}),N.filter(t=>t.part===e).map(t=>{let s=C?.chapterData[t.num],a=s?.isComplete,n=E?.num===t.num&&"interviewing"===j,r=t.num>1&&!C?.chapterData[t.num-1]?.isComplete;return(0,i.jsxs)("button",{onClick:()=>!r&&!a&&"interviewing"!==j&&ew(t),disabled:r||"interviewing"===j&&!n,className:"w-full text-left px-2 py-2 rounded-lg mb-0.5 flex items-center gap-2 transition-all text-xs",style:n?{background:`${P[e]}18`,color:P[e],fontWeight:600}:a?{color:"#10b981"}:r?{color:"var(--text-secondary)",opacity:.4}:{color:"var(--text-secondary)"},children:[i.jsx("span",{className:"flex-shrink-0",children:a?i.jsx(c.Z,{className:"w-3.5 h-3.5 text-green-500"}):r?i.jsx(d.Z,{className:"w-3.5 h-3.5"}):n?i.jsx(m,{className:"w-3.5 h-3.5",style:{color:P[e]}}):i.jsx(u,{className:"w-3.5 h-3.5"})}),(0,i.jsxs)("span",{className:"truncate",children:[t.num,". ",t.title]})]},t.num)})]},e))]}),(eR||eP)&&E&&(0,i.jsxs)("div",{className:"mx-3 mb-3 p-3 rounded-xl border",style:{background:`${P[E.part]}08`,borderColor:`${P[E.part]}30`},children:[i.jsx("p",{className:"text-xs font-semibold mb-2 flex items-center gap-1",style:{color:P[E.part]},children:"✍️ Live Preview"}),eP?(0,i.jsxs)("div",{className:"space-y-1.5",children:[i.jsx("div",{className:"skeleton h-3 w-full rounded"}),i.jsx("div",{className:"skeleton h-3 w-4/5 rounded"}),i.jsx("div",{className:"skeleton h-3 w-3/4 rounded"})]}):(0,i.jsxs)("p",{className:"text-xs leading-relaxed italic",style:{color:"var(--text-secondary)"},children:['"',eR?.slice(0,200),'..."']})]})]}),(0,i.jsxs)("div",{className:"flex-1 flex flex-col min-w-0 relative",children:["loading"===j&&i.jsx("div",{className:"flex-1 p-4 space-y-4",children:[1,2,3].map(e=>i.jsx(D.tz,{isUser:e%2==0},e))}),"chapter_select"===j&&i.jsx("div",{className:"flex-1 overflow-y-auto p-4 pb-safe",children:(0,i.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,i.jsxs)(r.E.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center mb-6",children:[i.jsx("div",{className:"text-5xl mb-3",children:(0,R.w2)(e.sport)}),i.jsx("h2",{className:"text-xl font-bold mb-1",style:{color:"var(--text-primary)"},children:0===eD?`Welcome, ${e.name}!`:"Continue Your Story"}),i.jsx("p",{className:"text-sm",style:{color:"var(--text-secondary)"},children:0===eD?"Your biography will be built chapter by chapter.":`${eD} of 12 chapters complete.`}),eD>0&&(0,i.jsxs)("div",{className:"mt-3 max-w-xs mx-auto",children:[i.jsx(b.Z,{value:eM}),(0,i.jsxs)("p",{className:"text-xs mt-1",style:{color:"var(--text-secondary)"},children:[eM,"% complete"]})]})]}),[1,2,3,4].map(e=>(0,i.jsxs)("div",{className:"mb-5",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("div",{className:"h-px flex-1",style:{background:P[e]+"40"}}),(0,i.jsxs)("span",{className:"text-xs font-bold px-2",style:{color:P[e]},children:["PART ",e,": ",F[e]]}),i.jsx("div",{className:"h-px flex-1",style:{background:P[e]+"40"}})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:N.filter(t=>t.part===e).map((t,s)=>{let a=C?.chapterData[t.num],n=a?.isComplete,l=t.num>1&&!C?.chapterData[t.num-1]?.isComplete;return(0,i.jsxs)(r.E.button,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.05*s},onClick:()=>!l&&!n&&ew(t),disabled:l||n,whileTap:{scale:l||n?1:.97},className:"p-4 rounded-xl text-left border touch-target",style:n?{background:"rgba(16,185,129,0.08)",borderColor:"#10b981",cursor:"default"}:l?{background:"var(--bg-secondary)",borderColor:"var(--border)",opacity:.5,cursor:"not-allowed"}:{background:`${P[e]}08`,borderColor:`${P[e]}40`,cursor:"pointer"},children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,i.jsxs)("span",{className:"text-xs font-bold",style:{color:n?"#10b981":l?"var(--text-secondary)":P[e]},children:["Ch. ",t.num]}),n?i.jsx(c.Z,{className:"w-4 h-4 text-green-500"}):l?i.jsx(d.Z,{className:"w-4 h-4",style:{color:"var(--text-secondary)"}}):i.jsx(m,{className:"w-4 h-4",style:{color:P[e]}})]}),i.jsx("p",{className:"text-sm font-semibold mb-1",style:{color:"var(--text-primary)"},children:t.title}),i.jsx("p",{className:"text-xs",style:{color:"var(--text-secondary)"},children:t.theme.split(",").slice(0,2).join(", ")})]},t.num)})})]},e)),eD>=3&&(0,i.jsxs)(r.E.div,{initial:{opacity:0},animate:{opacity:1},className:"mt-4 p-4 rounded-xl text-center",style:{background:"rgba(99,102,241,0.08)",border:"1px solid rgba(99,102,241,0.2)"},children:[(0,i.jsxs)("p",{className:"text-sm font-semibold mb-2",style:{color:"var(--text-primary)"},children:["\uD83C\uDF89 ",eD," chapters ready!"]}),i.jsx("button",{onClick:eE,disabled:q,className:"btn-primary",children:q?(0,i.jsxs)(i.Fragment,{children:[i.jsx(v.Z,{size:"sm"})," Generating..."]}):(0,i.jsxs)(i.Fragment,{children:[i.jsx(o.Z,{className:"w-4 h-4 inline mr-1"})," Generate Book"]})})]})]})}),("interviewing"===j||"chapter_complete"===j)&&E&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex-shrink-0 px-4 py-2 flex items-center justify-between",style:{background:`${eO}12`,borderBottom:`1px solid ${eO}30`},children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("span",{className:"text-xs font-bold",style:{color:eO},children:["Ch. ",E.num,": ",E.title]}),i.jsx("span",{className:"text-xs ml-2 hidden sm:inline",style:{color:"var(--text-secondary)"},children:F[E.part]})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,i.jsxs)("span",{className:"text-xs",style:{color:"var(--text-secondary)"},children:[G,"/",E.minResponses]}),"interviewing"===j&&Q&&(0,i.jsxs)(r.E.button,{initial:{scale:.9},animate:{scale:1},onClick:eC,disabled:_,className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-xs font-semibold text-white touch-target",style:{background:eO},children:[i.jsx(c.Z,{className:"w-3 h-3"})," Complete"]}),"chapter_complete"===j&&i.jsx("button",{onClick:()=>k("chapter_select"),className:"px-2.5 py-1.5 rounded-lg text-xs font-semibold text-white touch-target",style:{background:"#10b981"},children:"Next →"})]})]}),(0,i.jsxs)("div",{className:`flex-1 overflow-y-auto p-4 space-y-4 ${h?"mobile-voice-space":""}`,children:[i.jsx(n.M,{initial:!1,children:e$.map((t,s)=>(0,i.jsxs)(r.E.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2},className:`flex ${"user"===t.role?"justify-end":"justify-start"} gap-2`,children:["assistant"===t.role&&i.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-white text-xs font-bold flex-shrink-0 mt-1",style:{background:`linear-gradient(135deg, ${eO}, #a855f7)`},children:"J"}),(0,i.jsxs)("div",{className:"user"===t.role?"msg-user":"msg-ai",children:[i.jsx("div",{className:"text-sm leading-relaxed",children:i.jsx(f.UG,{children:t.content||""})}),"assistant"===t.role&&(0,i.jsxs)("button",{onClick:()=>eL(t.content||""),className:"mt-1 flex items-center gap-1 text-xs opacity-40 hover:opacity-80 transition-opacity",style:{color:"var(--text-secondary)"},children:[i.jsx(x,{className:"w-3 h-3"})," Read aloud"]})]}),"user"===t.role&&i.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-white text-xs font-bold flex-shrink-0 mt-1",style:{background:"linear-gradient(135deg, #a855f7, #6366f1)"},children:e.name[0].toUpperCase()})]},s))}),B&&(0,i.jsxs)(r.E.div,{initial:{opacity:0},animate:{opacity:1},className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-white text-xs font-bold",style:{background:`linear-gradient(135deg, ${eO}, #a855f7)`},children:"J"}),(0,i.jsxs)("div",{className:"msg-ai flex items-center gap-1.5 py-3 px-4",children:[i.jsx("div",{className:"typing-dot"}),i.jsx("div",{className:"typing-dot",style:{animationDelay:"0.2s"}}),i.jsx("div",{className:"typing-dot",style:{animationDelay:"0.4s"}})]})]}),i.jsx("div",{ref:ed})]}),"interviewing"===j&&!h&&(0,i.jsxs)("div",{className:"flex-shrink-0 p-4 border-t",style:{borderColor:"var(--border)",background:"var(--bg-card)"},children:[Q&&i.jsx(r.E.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},className:"mb-2 px-3 py-2 rounded-lg text-xs",style:{background:`${eO}12`,border:`1px solid ${eO}30`,color:eO},children:"✓ Great coverage! You can complete this chapter or keep going."}),(0,i.jsxs)("div",{className:"flex gap-2 items-end",children:[i.jsx("button",{onClick:()=>{ei(!0),eT()},className:"w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 transition-all",style:{background:"idle"!==ee?"linear-gradient(135deg, #ef4444, #dc2626)":"var(--bg-secondary)",border:"1.5px solid var(--border)"},children:i.jsx(p,{className:"w-4 h-4",style:{color:"idle"!==ee?"white":"var(--text-secondary)"}})}),i.jsx("textarea",{ref:eh,value:I,onChange:e=>{A(e.target.value),e.target.style.height="auto",e.target.style.height=Math.min(e.target.scrollHeight,120)+"px"},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),eS(I))},placeholder:_?"James is thinking...":"Share your story...",disabled:_,rows:1,className:"input-field flex-1 resize-none",style:{minHeight:"44px",maxHeight:"120px"}}),i.jsx("button",{onClick:()=>eS(I),disabled:_||!I.trim(),className:"btn-primary w-10 h-10 p-0 flex items-center justify-center flex-shrink-0 disabled:opacity-40",children:_?i.jsx(v.Z,{size:"sm"}):i.jsx(g,{className:"w-4 h-4"})})]})]}),"interviewing"===j&&h&&(0,i.jsxs)("div",{className:"fixed bottom-0 left-0 right-0 z-30 safe-bottom",children:[(0,i.jsxs)("div",{className:"px-4 py-2 flex gap-2 items-end",style:{background:"var(--bg-card)",borderTop:"1px solid var(--border)"},children:[i.jsx("textarea",{value:I,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),eS(I))},placeholder:"Type or use voice...",disabled:_,rows:1,className:"input-field flex-1 resize-none text-sm",style:{minHeight:"40px",maxHeight:"80px"}}),i.jsx("button",{onClick:()=>eS(I),disabled:_||!I.trim(),className:"btn-primary w-10 h-10 p-0 flex items-center justify-center flex-shrink-0 disabled:opacity-40",children:_?i.jsx(v.Z,{size:"sm"}):i.jsx(g,{className:"w-4 h-4"})})]}),i.jsx("div",{className:"flex justify-center pb-4 pt-2",style:{background:"var(--bg-card)"},children:i.jsx(S,{state:ee,audioLevel:eo,onTap:()=>{ei(!0),eT()},size:"md"})})]}),"chapter_complete"===j&&(0,i.jsxs)("div",{className:"flex-shrink-0 p-4 border-t text-center safe-bottom",style:{borderColor:"var(--border)",background:"var(--bg-card)"},children:[(0,i.jsxs)("p",{className:"text-sm font-semibold mb-3",style:{color:"var(--text-primary)"},children:["✅ Chapter ",E.num," complete!"]}),(0,i.jsxs)("div",{className:"flex gap-3 justify-center",children:[i.jsx("button",{onClick:()=>k("chapter_select"),className:"btn-secondary",children:"← Chapters"}),E.num<12&&(0,i.jsxs)("button",{onClick:()=>{let e=N.find(e=>e.num===E.num+1);e&&ew(e)},className:"btn-primary flex items-center gap-1.5",children:["Chapter ",E.num+1," ",i.jsx(m,{className:"w-4 h-4"})]})]})]})]}),"all_done"===j&&i.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:(0,i.jsxs)(r.E.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"text-center max-w-md",children:[i.jsx("div",{className:"text-6xl mb-4",children:"\uD83C\uDFC6"}),i.jsx("h2",{className:"text-2xl font-bold mb-2",style:{color:"var(--text-primary)"},children:"All 12 Chapters Complete!"}),i.jsx("p",{className:"text-sm mb-6",style:{color:"var(--text-secondary)"},children:"Time to generate the book."}),i.jsx("button",{onClick:eE,disabled:q,className:"btn-primary text-base px-8 py-3",children:q?(0,i.jsxs)(i.Fragment,{children:[i.jsx(v.Z,{size:"sm"})," Generating..."]}):(0,i.jsxs)(i.Fragment,{children:[i.jsx(o.Z,{className:"w-5 h-5 inline mr-2"})," Generate Full Book"]})})]})})]})]}),i.jsx($,{isOpen:es,voiceState:ee,transcript:ea,interimTranscript:er,audioLevel:eo,recentMessages:e$.slice(-8),onClose:()=>{em.current?.stop(),ev.current=!1,ei(!1),et("idle"),en(""),el(""),eN()},onTap:eT,clientName:e.name})]})}},4538:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var i=s(2295);function a({size:e="md"}){return i.jsx("div",{className:`${{sm:"w-4 h-4",md:"w-6 h-6",lg:"w-10 h-10"}[e]} border-2 rounded-full animate-spin`,style:{borderColor:"rgba(99,102,241,0.2)",borderTopColor:"#6366f1"}})}},8001:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var i=s(2295);function a({value:e,className:t=""}){let s=Math.min(Math.max(e,0),100);return i.jsx("div",{className:`progress-bar ${t}`,role:"progressbar","aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":100,children:i.jsx("div",{className:"progress-fill",style:{width:`${s}%`}})})}},3285:(e,t,s)=>{"use strict";s.d(t,{ZT:()=>n,bG:()=>a,tz:()=>r});var i=s(2295);function a(){return(0,i.jsxs)("div",{className:"card p-5 flex flex-col gap-3",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"skeleton w-11 h-11 rounded-xl"}),(0,i.jsxs)("div",{className:"flex-1 space-y-2",children:[i.jsx("div",{className:"skeleton h-4 w-32 rounded"}),i.jsx("div",{className:"skeleton h-3 w-24 rounded"})]}),i.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]}),(0,i.jsxs)("div",{className:"space-y-1.5",children:[(0,i.jsxs)("div",{className:"flex justify-between",children:[i.jsx("div",{className:"skeleton h-3 w-20 rounded"}),i.jsx("div",{className:"skeleton h-3 w-16 rounded"})]}),i.jsx("div",{className:"skeleton h-1.5 w-full rounded-full"})]}),i.jsx("div",{className:"skeleton h-3 w-28 rounded"}),i.jsx("div",{className:"skeleton h-8 w-full rounded-xl"})]})}function n(){return(0,i.jsxs)("div",{className:"card p-5 flex items-center gap-4",children:[i.jsx("div",{className:"skeleton w-12 h-12 rounded-xl"}),(0,i.jsxs)("div",{className:"space-y-2",children:[i.jsx("div",{className:"skeleton h-6 w-16 rounded"}),i.jsx("div",{className:"skeleton h-3 w-24 rounded"})]})]})}function r({isUser:e=!1}){return(0,i.jsxs)("div",{className:`flex ${e?"justify-end":"justify-start"} gap-2`,children:[!e&&i.jsx("div",{className:"skeleton w-7 h-7 rounded-full flex-shrink-0"}),i.jsx("div",{className:`skeleton rounded-2xl ${e?"w-48 h-12":"w-64 h-16"}`})]})}},7958:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let i=(0,s(9224).Z)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},4513:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let i=(0,s(9224).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},3284:(e,t,s)=>{"use strict";function i(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toString()}function a(e){return({baseball:"⚾",football:"\uD83C\uDFC8",basketball:"\uD83C\uDFC0",cricket:"\uD83C\uDFCF",boxing:"\uD83E\uDD4A",athletics:"\uD83C\uDFC3",tennis:"\uD83C\uDFBE",soccer:"⚽"})[e]??"\uD83C\uDFC5"}function n(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}s.d(t,{CJ:()=>i,pi:()=>n,w2:()=>a})},9157:(e,t,s)=>{"use strict";s.d(t,{I8:()=>n,T6:()=>l,co:()=>c,s9:()=>o,yj:()=>r});let i=()=>null;async function a(e,t={}){let s=i(),a={"Content-Type":"application/json",...t.headers};s&&(a.Authorization=`Bearer ${s}`);let n=await fetch(`https://api.wailmehmood.com${e}`,{...t,headers:a}),r=await n.json();if(!n.ok)throw Error(r.error||`Request failed: ${n.status}`);return r}let n={register:e=>a("/api/auth/register",{method:"POST",body:JSON.stringify(e)}),login:e=>a("/api/auth/login",{method:"POST",body:JSON.stringify(e)}),verify:()=>a("/api/auth/verify"),logout:()=>a("/api/auth/logout",{method:"POST"})},r={create:e=>a("/api/clients",{method:"POST",body:JSON.stringify(e)}),list:e=>{let t=e?"?"+new URLSearchParams(e).toString():"";return a(`/api/clients${t}`)},get:e=>a(`/api/clients/${e}`),update:(e,t)=>a(`/api/clients/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>a(`/api/clients/${e}`,{method:"DELETE"}),getByLink:e=>a(`/api/interview/link/${e}`),reset:e=>a(`/api/clients/${e}/reset`,{method:"POST"}),regenerateLink:e=>a(`/api/clients/${e}/regenerate-link`,{method:"POST"}),getStats:e=>a(`/api/clients/${e}/stats`)},l={getState:e=>a(`/api/interview/state/${e}`),startChapter:e=>a("/api/interview/chapter/start",{method:"POST",body:JSON.stringify(e)}),sendMessage:e=>a("/api/interview/message",{method:"POST",body:JSON.stringify(e)}),completeChapter:e=>a("/api/interview/chapter/complete",{method:"POST",body:JSON.stringify(e)}),getInsights:e=>fetch(`https://api.wailmehmood.com/api/interview/insights/${e}`,{headers:{Authorization:"Bearer null"}}).then(e=>e.json())},o={generate:e=>a("/api/book/generate",{method:"POST",body:JSON.stringify({clientId:e})}),get:e=>a(`/api/book/${e}`),save:(e,t)=>a(`/api/book/${e}`,{method:"PUT",body:JSON.stringify({bookDraft:t})}),export:(e,t)=>a("/api/book/export",{method:"POST",body:JSON.stringify({clientId:e,format:t})}),regenerateChapter:(e,t)=>a("/api/book/regenerate-chapter",{method:"POST",body:JSON.stringify({clientId:e,chapterNum:t})}),preview:(e,t)=>a("/api/interview/preview",{method:"POST",body:JSON.stringify({clientId:e,chapterNum:t})})},c={get:()=>a("/api/analytics")}},2917:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>r,metadata:()=>n});var i=s(5036),a=s(9636);s(7633),s(2244);let n={title:"Muse Pro — Athlete Biography Platform",description:"AI-powered biography publishing platform for professional athletes"};function r({children:e}){return(0,i.jsxs)("html",{lang:"en",suppressHydrationWarning:!0,children:[(0,i.jsxs)("head",{children:[i.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),i.jsx("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),i.jsx("link",{href:"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap",rel:"stylesheet"})]}),(0,i.jsxs)("body",{children:[e,i.jsx(a.x7,{position:"top-right",toastOptions:{duration:3500,style:{borderRadius:"12px",fontFamily:"Inter, sans-serif",fontSize:"14px"},success:{style:{background:"#f0fdf4",color:"#166534",border:"1px solid #bbf7d0"}},error:{style:{background:"#fef2f2",color:"#991b1b",border:"1px solid #fecaca"}}}})]})]})}},2244:()=>{},7633:()=>{}};