PageSourceSearch

https://recoverytrauma.lovable.app/assets/nervous-system-reset-CjeZIwbg.js

js recoverytrauma.lovable.app collected 2026-10-03 03:44:47 UTC 30,860 bytes, 2 lines download raw bytes

1import{d as x,j as e,aj as P,ak as Z,ei as z,a3 as J,T as ee,bf as te,P as V,k as q,c as L,r as F,a as H,an as se,m as B,ej as re,ek as K,el as ae,em as oe,V as ne,S as G,a6 as U,L as M,en as le,eo as de,ep as ie,eq as ce,er as xe,es as me,et as ue,eu as pe,ev as $,ew as he,ex as ge,ey as fe,Q as be,ez as je,eA as Y,al as ye}from"./index-70yz1Rcc.js";import{u as Ne}from"./useQuery-D3q5C8D-.js";import{u as ve}from"./useMutation-DfKl1Wee.js";import{w as we}from"./with-member-gate-DPareyqN.js";import{A as ke,a as Se,b as Ce,c as Ae,d as Te,e as De,f as Re,g as Oe,h as Pe}from"./alert-dialog-Ctyp1iYV.js";import{S as Ie}from"./sprout-Z2knjOVE.js";import{H as Ee}from"./heart-pulse-BZsoS9RC.js";import{N as X}from"./notebook-pen-CPFpAvvR.js";import{A as Q}from"./arrow-left-D1Uc4TKp.js";import"./useBaseQuery-fsGIu3U2.js";import"./MemberGate-DBZ5l3we.js";import"./onboarding.functions-B8Dgz2sd.js";import"./MemberLockScreen-BZoYLC_c.js";import"./log-in-BzAzj8k5.js";import"./recent-tools-Bwv98Oha.js";import"./membership-refresh-zb1yQH-m.js";function S({question:i,note:a,options:l,value:o,onChange:d,multi:p=!1,allowCustom:t=!1}){const[f,c]=x.useState(!1),[j,g]=x.useState(""),m=o.filter(n=>!l.includes(n)),h=[...l,...m];function N(n){d(p?o.includes(n)?o.filter(v=>v!==n):[...o,n]:o.includes(n)?[]:[n])}return e.jsxs("div",{children:[e.jsx("p",{className:"font-display text-[15px] text-foreground",children:i}),a&&e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:a}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[h.map(n=>{const v=o.includes(n);return e.jsxs("button",{type:"button",onClick:()=>N(n),"aria-pressed":v,className:`inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-[13px] transition ${v?"border-[var(--gold-deep)] bg-[var(--gradient-gold)] text-foreground shadow-sm":"border-border/60 bg-card text-muted-foreground hover:border-[var(--gold-deep)]/50 hover:text-foreground"}`,children:[v&&e.jsx(P,{className:"h-3.5 w-3.5"}),n]},n)}),t&&!f&&e.jsxs("button",{type:"button",onClick:()=>c(!0),className:"inline-flex items-center gap-1.5 rounded-full border border-dashed border-border/70 px-3 py-1.5 text-[13px] text-muted-foreground hover:text-foreground",children:[e.jsx(Z,{className:"h-3.5 w-3.5"})," Something else"]})]}),t&&f&&e.jsxs("div",{className:"mt-3 flex gap-2",children:[e.jsx("input",{value:j,onChange:n=>g(n.target.value),placeholder:"In your own words…",maxLength:120,className:"min-w-0 flex-1 rounded-xl border border-border/60 bg-card px-3 py-2 text-sm text-foreground outline-none focus:border-[var(--gold-deep)]"}),e.jsx("button",{type:"button",className:"btn-gold-outline shrink-0 !px-4 !py-2 text-sm",onClick:()=>{const n=j.trim();n&&(d(p?[...o,n]:[n]),g(""),c(!1))},children:"Add"})]})]})}const qe={notice:V,move:te,discover:ee,"real-life":J},$e={notice:"--qa-gold",move:"--qa-teal",discover:"--qa-sage","real-life":"--qa-peach"};function _e({completed:i,current:a,onSelect:l}){return e.jsxs("ol",{className:"relative space-y-5 ps-11 sm:ps-14",children:[e.jsx("span",{"aria-hidden":!0,className:"absolute start-[19px] top-3 bottom-3 w-px bg-gradient-to-b from-[var(--gold-deep)]/45 via-border to-transparent sm:start-[23px]"}),z.map((o,d)=>{const p=qe[o.key]??V,t=$e[o.key]??"--qa-gold",f=[];for(let m=o.range[0];m<=o.range[1];m+=1)f.push(m);const c=f.filter(m=>i.includes(m)).length,j=a>=o.range[0]&&a<=o.range[1],g=c===f.length;return e.jsxs("li",{className:"relative",children:[e.jsx("span",{"aria-hidden":!0,className:"absolute -start-11 top-0 grid h-10 w-10 place-items-center rounded-full border sm:-start-14 sm:h-12 sm:w-12",style:{background:`color-mix(in oklab, var(${t}-tint) 85%, var(--card))`,borderColor:`color-mix(in oklab, var(${t}-ink) 28%, transparent)`,color:`var(${t}-ink)`,boxShadow:j?"0 8px 22px -12px color-mix(in oklab, var(--gold-deep) 70%, transparent)":void 0},children:g?e.jsx(P,{className:"h-5 w-5"}):e.jsx(p,{className:"h-5 w-5"})}),e.jsxs("div",{className:`rounded-2xl border p-4 transition ${j?"border-[var(--gold-deep)]/40 bg-card shadow-[var(--shadow-soft)]":"border-border/50 bg-card/70"}`,children:[e.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-start gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"text-[11px] uppercase tracking-widest text-muted-foreground",children:["Phase ",d+1," · Days ",o.range[0],"–",o.range[1]]}),e.jsx("p",{className:"mt-0.5 font-display text-[15px] text-foreground",children:o.label})]}),e.jsxs("span",{className:"shrink-0 rounded-full px-2.5 py-1 text-[11px] font-medium",style:{background:`color-mix(in oklab, var(${t}-ink) 14%, var(--card))`,color:`var(${t}-ink)`},children:[c,"/",f.length]})]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:o.blurb}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:f.map(m=>{const h=i.includes(m);return m===a?e.jsxs("button",{type:"button",onClick:()=>l(m),"aria-current":"true",className:"inline-flex min-h-9 cursor-pointer items-center gap-1.5 rounded-full bg-[var(--gradient-gold)] px-3 text-[12px] font-semibold text-foreground shadow-[var(--shadow-gold)]",children:["Continue Day ",m,e.jsx(q,{className:"h-3.5 w-3.5"})]},m):e.jsx("button",{type:"button",onClick:()=>l(m),"aria-label":`Day ${m}${h?" — complete":""}`,className:`grid h-9 w-9 cursor-pointer place-items-center rounded-full text-[11px] font-medium transition ${h?"border border-[var(--gold-deep)]/40 bg-gold-light/50 text-foreground":"border border-border/50 text-muted-foreground
1/80 hover:border-[var(--gold-deep)]/50 hover:text-foreground"}`,children:h?e.jsx(P,{className:"h-4 w-4"}):m},m)})})]})]},o.key)})]})}function We({percent:i,day:a,size:l=108}){const d=(l-9)/2,p=2*Math.PI*d,t=p*(1-Math.min(Math.max(i,0),100)/100);return e.jsxs("div",{className:"relative shrink-0",style:{width:l,height:l},children:[e.jsxs("svg",{width:l,height:l,viewBox:`0 0 ${l} ${l}`,role:"img","aria-label":`Day ${a} of 30, ${i}% complete`,className:"-rotate-90",children:[e.jsx("circle",{cx:l/2,cy:l/2,r:d,fill:"none",strokeWidth:9,className:"stroke-muted"}),e.jsx("circle",{cx:l/2,cy:l/2,r:d,fill:"none",strokeWidth:9,strokeLinecap:"round",stroke:"var(--gold-deep)",strokeDasharray:p,strokeDashoffset:t,style:{transition:"stroke-dashoffset 600ms ease"}})]}),e.jsx("div",{className:"absolute inset-0 grid place-items-center text-center",children:e.jsxs("div",{children:[e.jsxs("p",{className:"font-serif text-xl leading-none text-foreground",children:[a,e.jsx("span",{className:"text-sm text-muted-foreground",children:"/30"})]}),e.jsxs("p",{className:"mt-1 text-[11px] text-muted-foreground",children:[i,"%"]})]})})]})}function Le({trigger:i,onConfirm:a}){const[l,o]=x.useState(!1),[d,p]=x.useState(!1);return e.jsxs(ke,{open:l,onOpenChange:t=>d?null:o(t),children:[e.jsx(Se,{asChild:!0,children:i}),e.jsxs(Ce,{children:[e.jsxs(Ae,{children:[e.jsx(Te,{children:"Reset your 30-Day Journey?"}),e.jsx(De,{className:"text-sm leading-relaxed text-foreground/75",children:"This will clear your completed days and restart the programme from Day 1. Your saved toolkit items and journal entries will not be deleted."})]}),e.jsxs(Re,{children:[e.jsx(Oe,{disabled:d,children:"Cancel"}),e.jsx(Pe,{disabled:d,onClick:async t=>{t.preventDefault(),p(!0);try{await a(),o(!1)}finally{p(!1)}},children:d?"Resetting…":"Reset progress"})]})]})]})}const Fe=L({method:"GET"}).middleware([F]).handler(H("f12790d54cf67e6f66d7b724fb5af4b77fa2f713e419faace34705e84291e12a")),He=L({method:"POST"}).middleware([F]).handler(H("959ce3bc55aa0697e7a9a2423606a70f1c2faedeaf21fdf0af60396fb1efac7f"));L({method:"POST"}).middleware([F]).handler(H("4d8b687ef93330339694d74e376ed31bac38fef82fc7da3d189db12484555e77"));function Me(){const i=se(),a=B(Fe),l=B(He),{data:o,isLoading:d,isError:p,isFetching:t,refetch:f}=Ne({queryKey:["nsr-progress"],queryFn:()=>a(),staleTime:6e4,retry:(s,u)=>{const D=u instanceof Error?u.message:"";return/\b(401|403|404)\b|unauthor/i.test(D)?!1:s<2},retryDelay:s=>Math.min(1e3*2**s,6e3)}),[c,j]=x.useState({}),g=x.useRef(!1);x.useEffect(()=>{o&&!g.current&&(j(o.state??{}),g.current=!0)},[o]);const m=ve({mutationFn:s=>l({data:{state:s}}),onSuccess:()=>i.invalidateQueries({queryKey:["nsr-progress"]})});function h(s){j(u=>{const D=s(u);return m.mutate(D),D})}const N=re(c),n=K(c),v=ae(c),{day:w}=oe.useSearch(),[T,b]=x.useState(w?"day":"overview"),[k,A]=x.useState(w??1);x.useEffect(()=>{g.current&&(w?(A(w),b("day")):A(K(c)))},[g.current,w]),x.useEffect(()=>{if(typeof window>"u")return;const s=new URL(window.location.href),u=T==="day"?String(k):null;s.searchParams.get("day")!==u&&(u?s.searchParams.set("day",u):s.searchParams.delete("day"),window.history.replaceState(window.history.state,"",s.pathname+s.search+s.hash))},[T,k]);function I(s){A(s),b("day"),typeof window<"u"&&window.scrollTo({top:0})}if(d)return e.jsx(O,{children:e.jsxs("div",{className:"space-y-4","aria-busy":"true","aria-live":"polite",children:[e.jsx("span",{className:"sr-only",children:"Loading your progress"}),e.jsx("div",{className:"h-32 animate-pulse rounded-3xl bg-muted","aria-hidden":!0}),e.jsx("div",{className:"h-10 w-2/3 animate-pulse rounded-2xl bg-muted","aria-hidden":!0}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:[0,1,2,3].map(s=>e.jsx("div",{className:"h-24 animate-pulse rounded-3xl bg-muted","aria-hidden":!0},s))})]})});if(p)return e.jsx(O,{children:e.jsxs("div",{className:"rounded-3xl border border-border bg-background/70 p-6 text-sm text-foreground/80",children:[e.jsx("p",{children:"Your 30-Day Reset progress didn't load just now. Nothing has been lost — this is usually a connection hiccup."}),e.jsx("button",{type:"button",onClick:()=>{f()},disabled:t,className:"mt-4 inline-flex min-h-[48px] items-center justify-center rounded-full border border-gold/30 px-5 text-sm font-medium text-foreground
1/80 transition hover:bg-gold-light/30 disabled:opacity-60",children:t?"Trying again…":"Try again"})]})});if(T==="profile")return e.jsx(O,{onBack:()=>b("overview"),children:e.jsx(Ke,{state:c,onSave:s=>h(u=>({...u,startedAt:u.startedAt??new Date().toISOString(),profile:{...s,completedAt:new Date().toISOString()}})),onDone:()=>b("overview")})});if(T==="toolkit")return e.jsx(O,{onBack:()=>b("overview"),children:e.jsx(Qe,{state:c})});if(T==="day")return e.jsx(O,{onBack:()=>b("overview"),children:e.jsx(Ye,{day:k,record:c.days?.[String(k)]??{},onSaveRecord:s=>h(u=>({...u,startedAt:u.startedAt??new Date().toISOString(),days:{...u.days??{},[String(k)]:s}})),onComplete:(s,u,D)=>h(C=>{const E={...C.toolkit??{}};for(const[r,y]of Object.entries(D)){const R=r;E[R]=Array.from(new Set([...E[R]??[],...y]))}return{...C,startedAt:C.startedAt??new Date().toISOString(),days:{...C.days??{},[String(k)]:{...s,completedAt:new Date().toISOString()}},savedTools:u?Array.from(new Set([...C.savedTools??[],u])):C.savedTools,toolkit:E}}),onNext:()=>{k<30?I(k+1):b("overview")},onBackToOverview:()=>b("overview")},k)});async function _(){const s={startedAt:new Date().toISOString(),profile:c.profile,savedTools:c.savedTools,toolkit:c.toolkit,toolkitSavedAt:c.toolkitSavedAt};await l({data:{state:s}}),j(s),A(1),i.invalidateQueries({queryKey:["nsr-progress"]})}const W=e.jsx(Le,{trigger:e.jsxs("button",{type:"button",className:"inline-flex min-h-10 cursor-pointer items-center gap-1.5 rounded-full border border-border/60 px-4 text-xs text-muted-foreground transition hover:border-[var(--gold-deep)]/50 hover:text-foreground",children:[e.jsx(ye,{className:"h-3.5 w-3.5"})," Reset progress"]}),onConfirm:_});return e.jsxs(O,{children:[e.jsxs("section",{className:"overflow-hidden rounded-3xl border border-[var(--gold-deep)]/25 p-6 sm:p-8",style:{background:"linear-gradient(150deg, color-mix(in oklab, var(--qa-gold-tint) 85%, var(--card)) 0%, var(--card) 62%)"},children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("span",{className:"grid h-11 w-11 shrink-0 place-items-center rounded-full bg-[var(--gradient-gold)] shadow-[var(--shadow-gold)]",children:e.jsx(ne,{className:"h-5 w-5 text-foreground"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-widest text-muted-foreground",children:"Regulate"}),e.jsx("h1",{className:"font-serif text-2xl leading-tight text-foreground sm:text-[2rem]",children:"Reset & Regulate"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"30-Day Nervous System Regulation Journey"})]})]}),e.jsxs("div",{className:"mt-6 flex items-center gap-5",children:[e.jsx(We,{percent:v,day:n}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"font-display text-[15px] text-foreground",children:["Day ",n," of 30 · ",v,"% complete"]}),e.jsx("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:N.length===0?"Nothing to catch up on — you can begin whenever you're ready.":`${N.length} ${N.length===1?"day":"days"} noted so far. Pause or repeat any day.`}),e.jsx("div",{className:"mt-3 h-2 w-full overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:"h-full rounded-full bg-[var(--gradient-gold)] transition-all duration-700",style:{width:`${Math.max(v,2)}%`}})})]})]}),e.jsxs("div",{className:"relative z-10 mt-6",children:[e.jsxs("button",{type:"button",className:"btn-gold min-h-12 w-full cursor-pointer px-6 sm:w-auto",onClick:()=>I(n),children:[N.length===0?"Begin Day 1":`Continue Day ${n}`,e.jsx(q,{className:"h-4 w-4"})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e.jsxs("button",{type:"button",className:"inline-flex min-h-10 cursor-pointer items-center gap-1.5 rounded-full border border-gold/50 bg-card/80 px-4 text-xs text-foreground transition hover:bg-gold-light/40",onClick:()=>b("toolkit"),children:[e.jsx(G,{className:"h-3.5 w-3.5"})," My toolkit"]}),!c.profile?.completedAt&&!c.profile?.skipped&&e.jsxs("button",{type:"button",className:"inline-flex min-h-10 cursor-pointer items-center gap-1.5 rounded-full border border-border/60 px-4 text-xs text-muted-foreground transition hover:text-foreground",onClick:()=>b("profile"),children:[e.jsx(J,{className:"h-3.5 w-3.5"})," My starting point"]}),W]})]})]}
1),e.jsxs("section",{className:"mt-5 grid gap-4 rounded-3xl border border-border/50 bg-card p-5 sm:grid-cols-[auto_minmax(0,1fr)] sm:items-start sm:p-6",children:[e.jsx("span",{className:"grid h-12 w-12 place-items-center rounded-2xl",style:{background:"color-mix(in oklab, var(--qa-sage-ink) 14%, var(--card))",color:"var(--qa-sage-ink)"},children:e.jsx(Ie,{className:"h-6 w-6"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"font-serif text-lg text-foreground",children:"What is the 30-Day Reset?"}),e.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-muted-foreground",children:"A self-paced 30-day programme to help you notice your nervous-system patterns, practise regulation gently, and gradually build a set of tools that genuinely work for you. A few minutes a day is enough, and every practice is optional."})]})]}),e.jsxs("section",{className:"mt-5",children:[e.jsx("h2",{className:"px-1 font-serif text-lg text-foreground",children:"How it works"}),e.jsx("div",{className:"mt-3 grid gap-3 sm:grid-cols-3",children:Be.map((s,u)=>e.jsxs("div",{className:"rounded-2xl border border-border/50 p-4",style:{background:`linear-gradient(160deg, color-mix(in oklab, var(${s.tint}-tint) 70%, var(--card)) 0%, var(--card) 80%)`},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-full",style:{background:`color-mix(in oklab, var(${s.tint}-ink) 16%, var(--card))`,color:`var(${s.tint}-ink)`},children:e.jsx(s.icon,{className:"h-4 w-4"})}),e.jsxs("span",{className:"text-[11px] uppercase tracking-widest text-muted-foreground",children:["Step ",u+1]})]}),e.jsx("p",{className:"mt-2 font-display text-[15px] text-foreground",children:s.label}),e.jsx("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:s.desc})]},s.label))})]}),e.jsxs("section",{className:"mt-5 rounded-3xl border border-border/50 p-5 sm:p-6",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--qa-gold-tint) 45%, var(--card)) 0%, var(--card) 45%)"},children:[e.jsx("h2",{className:"font-serif text-xl text-foreground",children:"Your journey"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Four gentle phases. Nothing is locked — move at your own pace and revisit any day."}),e.jsx("div",{className:"mt-5",children:e.jsx(_e,{completed:N,current:n,onSelect:I})})]}),(c.savedTools?.length??0)>0&&e.jsxs("section",{className:"mt-5 rounded-3xl border border-border/50 bg-card p-5 sm:p-6",children:[e.jsx("h2",{className:"font-serif text-lg text-foreground",children:"Tools you've saved"}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:(c.savedTools??[]).map(s=>e.jsxs("span",{className:"rounded-full bg-[var(--gradient-gold)] px-3 py-1.5 text-[13px] text-foreground",children:["♡ ",s]},s))})]}),e.jsxs("section",{className:"mt-5 rounded-2xl border border-border/50 bg-muted/40 p-4 text-xs leading-relaxed text-muted-foreground",children:["This programme is educational support for self-understanding. It isn't therapy, diagnosis or medical treatment, and it doesn't claim to cure anything. If you feel unsafe or in crisis, please reach out to a professional or an emergency service where you are."," ",e.jsx(M,{to:"/crisis",className:"underline",children:"Crisis support"})]})]})}const Be=[{label:"Check in",desc:"A few taps to notice how your body feels today.",icon:Ee,tint:"--qa-peach"},{label:"Try today's practice",desc:"One short, optional practice — gentler versions always offered.",icon:U,tint:"--qa-teal"},{label:"Reflect & save what helped",desc:"Keep anything that worked in your own toolkit.",icon:X,tint:"--qa-sage"}];function O({children:i,onBack:a}){return e.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-8 sm:py-10",children:[e.jsx("div",{className:"mb-5",children:a?e.jsxs("button",{onClick:a,className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[e.jsx(Q,{className:"h-3.5 w-3.5"})," Programme overview"]}):e.jsxs(M,{to:"/somatic",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[e.jsx(Q,{className:"h-3.5 w-3.5"})," Regulate"]})}),i]})}function Ke({state:i,onSave:a,onDone:l}){const o=i.profile??{}
1,[d,p]=x.useState(o.stressResponses??[]),[t,f]=x.useState(o.bodyAreas??[]),[c,j]=x.useState(o.helps??[]),[g,m]=x.useState(o.harder??[]),[h,N]=x.useState(o.hope??"");return e.jsxs("div",{className:"rounded-3xl border border-border/50 bg-card p-6 sm:p-8",children:[e.jsx("h2",{className:"font-serif text-2xl text-foreground",children:"My starting point"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Entirely optional, and there are no wrong answers. This just helps the programme reflect your own words back to you later on."}),e.jsxs("div",{className:"mt-6 space-y-7",children:[e.jsx(S,{question:"When I'm stressed, I usually…",options:le,value:d,onChange:p,multi:!0,allowCustom:!0}),e.jsx(S,{question:"Where do you feel stress in your body?",options:de,value:t,onChange:f,multi:!0,allowCustom:!0}),e.jsx(S,{question:"What usually helps you feel a bit better?",options:ie,value:c,onChange:j,multi:!0,allowCustom:!0}),e.jsx(S,{question:"What tends to make things harder?",options:ce,value:g,onChange:m,multi:!0,allowCustom:!0}),e.jsxs("div",{children:[e.jsx("p",{className:"font-display text-[15px] text-foreground",children:"What would you like to feel more of?"}),e.jsx("textarea",{value:h,onChange:n=>N(n.target.value),rows:3,maxLength:2e3,placeholder:"In your own words…",className:"mt-3 w-full rounded-xl border border-border/60 bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-[var(--gold-deep)]"})]})]}),e.jsxs("div",{className:"mt-8 flex flex-wrap gap-3",children:[e.jsxs("button",{className:"btn-gold",onClick:()=>{a({stressResponses:d,bodyAreas:t,helps:c,harder:g,hope:h}),l()},children:["Save and continue ",e.jsx(q,{className:"h-4 w-4"})]}),e.jsx("button",{className:"btn-gold-outline",onClick:()=>{a({skipped:!0}),l()},children:"Skip this"})]})]})}function Ye({day:i,record:a,onSaveRecord:l,onComplete:o,onNext:d,onBackToOverview:p}){const t=ue(i),f=pe(i),[c,j]=x.useState(a.checkInState?[a.checkInState]:[]),[g,m]=x.useState(a.checkInBody??[]),[h,N]=x.useState(a.capacity?[a.capacity]:[]),[n,v]=x.useState(a.answers??{}),[w,T]=x.useState(a.reflection??""),[b,k]=x.useState(a.after?[a.after]:[]),[A,I]=x.useState(a.keep?[a.keep]:[]),[_,W]=x.useState(!1),s=h[0]===$[1].label,u=h[0]===$[2].label,D=h[0]===$[3].label,C=x.useMemo(()=>({...a,checkInState:c[0],checkInBody:g,capacity:h[0],answers:n,reflection:w,after:b[0],keep:A[0]}),[a,c,g,h,n,w,b,A]),E=x.useMemo(()=>{const r={};for(const y of t.pickers??[]){if(!y.toolkitKey)continue;const R=n[y.id]??[];R.length&&(r[y.toolkitKey]=[...r[y.toolkitKey]??[],...R])}return r},[n,t.pickers]);return _?e.jsxs("div",{className:"rounded-3xl border border-border/50 bg-card p-8 text-center",children:[e.jsx("span",{className:"mx-auto grid h-14 w-14 place-items-center rounded-full bg-[var(--gradient-gold)]",children:e.jsx(P,{className:"h-6 w-6 text-foreground"})}),e.jsxs("h2",{className:"mt-4 font-serif text-2xl text-foreground",children:["Day ",i," noted"]}),e.jsx("p",{className:"mx-auto mt-2 max-w-md text-sm text-muted-foreground",children:"Thank you for showing up for yourself today. There's nothing else you need to do."}),e.jsxs("div",{className:"mt-6 flex flex-wrap justify-center gap-3",children:[i<30&&e.jsxs("button",{className:"btn-gold",onClick:d,children:["Day ",i+1," ",e.jsx(q,{className:"h-4 w-4"})]}),e.jsx("button",{className:"btn-gold-outline",onClick:p,children:"Back to overview"})]})]}):e.jsxs("div",{className:"space-y-5",children:[e.jsxs("header",{className:"rounded-3xl border border-border/50 bg-card p-6",children:[e.jsxs("p",{className:"text-[11px] uppercase tracking-widest text-muted-foreground",children:["Day ",i," of 30 · ",f.label]}),e.jsx("h1",{className:"mt-1 font-serif text-2xl text-foreground sm:text-3xl",children:t.title}),a.completedAt&&e.jsxs("p",{className:"mt-2 inline-flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(P,{className:"h-3.5 w-3.5"})," You've completed this day before — you're welcome to repeat it."]})]}),e.jsxs("section",{className:"rounded-3xl border border-border/50 bg-card p-5 sm:p-6",children:[e.jsx("h2",{className:"font-serif text-lg text-foreground",children:"Today's check-in"}),e.jsxs("div",{className:"mt-4 space-y-6",children:[e.jsx(S,{question:"How is your body feeling right now?",options:he.map(r=>`${r.emoji} ${r.label}`),value:c,onChange:j}),e.jsx(S,{question:"What do you notice in your body?",options:ge,value:g,onChange:m,multi:!0,allowCustom:!0}),e.jsx(S,{question:"What feels possible today?",options:$.map(r=>r.label),value:h,onChange:N})]})]}),D?e.jsxs("section",{className:"rounded-3xl border border-border/50 bg-card p-6",children:[e.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"Skipping today is a valid choice, and choosing it is itself a way of listening to yourself. Your check-in is saved. The day will be here when you want it."}),e.jsxs("div",{className:"mt-5 flex flex-wrap gap-3",children:[e.jsx("button",{className:"btn-gold",onClick:()=>{l(C),p()},children:"Save my check-in"}),e.jsx(M,{to:"/grounding",className:"btn-gold-outline",children:"One-minute grounding instead"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("section",{className:"rounded-3xl border border-border/50 bg-card p-5 sm:p-6",children:t.intro.map((r,y)=>e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground first:mt-0",children:r},y))}),t.practice&&!u&&e.jsxs("section",{className:"rounded-3xl border border-[var(--gold-deep)]/30 bg-card p-5 sm:p-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"h-4 w-4 text-[var(--gold-deep)]"}),e.jsx("h2",{className:"font-serif text-lg text-foreground",children:t.practice.title})]}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[t.practice.minutes," · ",t.practice.purpose]}),s&&t.practice.gentler&&e.jsxs("div",{className:"mt-4 rounded-xl bg-muted/50 p-3 text-sm text-foreground",children:[e.jsx("span",{className:"font-display",children:"A gentler version: "}),t.practice.gentler]}),e.jsx("ol",{className:"mt-4 space-y-2",children:t.practice.steps.map((r,y)=>e.jsxs("li",{className:"flex gap-3 text-sm text-muted-foreground",children:[e.jsx("span",{className:"grid h-5 w-5 shrink-0 place-items-center rounded-full bg-muted text-[11px] text-foreground",children:y+1}),e.jsx("span",{className:"leading-relaxed",children:r})]},y))}),t.practice.tips&&e.jsx("ul",{className:"mt-4 space-y-1",children:t.practice.tips.map(r=>e.jsxs("li",{className:"text-xs text-muted-foreground",children:["· ",r]},r))}),t.practice.seatedAlternative&&e.jsxs("p",{className:"mt-4 rounded-xl bg-muted/50 p-3 text-xs leading-relaxed text-foreground",children:[e.jsx("span",{className:"font-display",children:"Seated option: "}),t.practice.seatedAlternative]}),e.jsx("p",{className:"mt-4 text-xs leading-relaxed text-muted-foreground",children:fe})]}),t.optional&&e.jsx("section",{className:"rounded-2xl border border-border/50 bg-muted/40 p-4 text-sm leading-relaxed text-muted-foreground",children:t.optional}),(t.pickers?.length??0)>0&&e.jsx("section",{className:"rounded-3xl border border-border/50 bg-card p-5 sm:p-6",children:e.jsx("div",{className:"space-y-7",children:t.pickers.map(r=>e.jsx(S,{question:r.question,note:r.note,options:r.options,multi:r.multi,allowCustom:r.allowCustom,value:n[r.id]??[],onChange:y=>v(R=>({...R,[r.id]:y}))},r.id))})}),(t.tools?.length??0)>0&&e.jsxs("section",{className:"rounded-3xl border border-border/50 bg-card p-5 sm:p-6",children:[e.jsx("h2",{className:"font-serif text-lg text-foreground",children:"Tools for today"}),e.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:t.tools.map(r=>e.jsxs("a",{href:r.to,className:"rounded-2xl border border-border/60 p-3 transition hover:border-[var(--gold-deep)]/60",children:[e.jsx("p",{className:"font-display text-sm text-foreground",children:r.label}),e.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:r.desc})]},r.to))})]}),(t.reflection||t.journalPrompt)&&e.jsxs("section",{className:"rounded-3xl border border-border/50 bg-card p-5 sm:p-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(X,{className:"h-4 w-4 text-[var(--gold-deep)]"}),e.jsx("h2",{className:"font-serif text-lg text-foreground",children:"Reflection"})]}),t.reflection&&e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:t.reflection}
1),t.reflectionOptions?e.jsx("div",{className:"mt-3",children:e.jsx(S,{question:"",options:t.reflectionOptions,value:w?[w]:[],onChange:r=>T(r[0]??"")})}):e.jsx("textarea",{value:w,onChange:r=>T(r.target.value),rows:4,maxLength:5e3,placeholder:"Optional — a few words is plenty.",className:"mt-3 w-full rounded-xl border border-border/60 bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-[var(--gold-deep)]"}),t.journalPrompt&&e.jsxs("a",{href:`/journal?prompt=${encodeURIComponent(t.journalPrompt)}`,className:"mt-3 inline-flex items-center gap-1 text-xs text-[var(--gold-deep)] underline",children:["Write more in my journal ",e.jsx(q,{className:"h-3 w-3"})]})]}),e.jsxs("section",{className:"rounded-3xl border border-border/50 bg-card p-5 sm:p-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(be,{className:"h-4 w-4 text-[var(--gold-deep)]"}),e.jsx("h2",{className:"font-serif text-lg text-foreground",children:"After today"})]}),e.jsxs("div",{className:"mt-4 space-y-6",children:[e.jsx(S,{question:"How do you feel now?",options:je,value:b,onChange:k,allowCustom:!0}),t.practice&&e.jsx(S,{question:"Would you like to keep this practice?",options:Y.map(r=>r.label),value:A,onChange:I})]}),e.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[e.jsxs("button",{className:"btn-gold",onClick:()=>{const r=A[0]===Y[0].label&&t.practice?t.practice.title:null;o(C,r,E),W(!0),typeof window<"u"&&window.scrollTo({top:0})},children:["Mark day ",i," complete ",e.jsx(P,{className:"h-4 w-4"})]}),e.jsx("button",{className:"btn-gold-outline",onClick:()=>{l(C),p()},children:"Save and come back later"})]})]})]})]})}function Qe({state:i}){const a=xe(i),l=me.filter(d=>(i.toolkit?.[d.key]?.length??0)>0),o=l.length===0&&a.length===0;return e.jsxs("div",{className:"space-y-5",children:[e.jsx("header",{className:"rounded-3xl border border-border/50 bg-card p-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"grid h-11 w-11 place-items-center rounded-full bg-[var(--gradient-gold)]",children:e.jsx(G,{className:"h-5 w-5 text-foreground"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"font-serif text-2xl text-foreground",children:"My Nervous System Toolkit"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Built from your own answers. Private to you."})]})]})}),o?e.jsx("section",{className:"rounded-3xl border border-border/50 bg-card p-6",children:e.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"Your toolkit fills itself as you move through the 30 days. Days 4, 18, 21, 27, 28 and 29 all add to it — and you can revisit any of them at any time."})}):e.jsxs(e.Fragment,{children:[a.length>0&&e.jsxs("section",{className:"rounded-3xl border border-[var(--gold-deep)]/30 bg-card p-5 sm:p-6",children:[e.jsx("h2",{className:"font-serif text-lg text-foreground",children:"What seems to help you most"}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:a.map(d=>e.jsx("span",{className:"rounded-full bg-[var(--gradient-gold)] px-3 py-1.5 text-[13px] text-foreground",children:d},d))})]}),e.jsx("section",{className:"grid gap-3 sm:grid-cols-2",children:l.map(d=>e.jsxs("div",{className:"rounded-2xl border border-border/50 bg-card p-4",children:[e.jsx("p",{className:"font-display text-sm text-foreground",children:d.label}),e.jsx("ul",{className:"mt-2 space-y-1",children:(i.toolkit?.[d.key]??[]).map(p=>e.jsxs("li",{className:"text-xs text-muted-foreground",children:["· ",p]},p))})]},d.key))})]}),e.jsx("section",{className:"rounded-2xl border border-border/50 bg-muted/40 p-4 text-xs leading-relaxed text-muted-foreground",children:"Your toolkit is a living list. What helps can change with sleep, stress and season — you can update it any time by revisiting a day."})]})}const it=we(Me,"Reset & Regulate");export{it as component};
2//# sourceMappingURL=nervous-system-reset-CjeZIwbg.js.map

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.