PageSourceSearch

https://soberpedia.ai/assets/quiz-guided-results-model-20260907.js

js soberpedia.ai collected 2026-10-05 15:07:37 UTC 9,458 bytes, 34 lines download raw bytes

1(function(root){
2const options=(items)=>items.map(([id,label,detail])=>({id,label,detail}));
3const questions={
4 audience:{title:'Who are you here for?',sub:'We’ll shape the next step around what you need.',options:options([['self','Myself'],['someone','Someone I care about']])},
5 region:{title:'Where are you looking for support?',sub:'Our care and directory links focus on the United States.',options:options([['us','United States'],['other','Outside the United States']])},
6 age:{title:'Are you 18 or older?',sub:'This guided care path is designed for adults.',options:options([['adult','Yes, I’m 18 or older'],['minor','No, I’m under 18']])},
7 goal:{multi:true,exclusive:['unsure'],title:'What would you like help with?',sub:'Choose all that matter to you.',options:options([['use','Drinking or substance use'],['cravings','Cravings that keep coming back'],['stress','Stress or anxiety'],['energy','My sleep, energy, or focus'],['weight','My weight or appetite'],['unsure','I’m not sure where to start']])},
8 substance:{multi:true,exclusive:['private'],title:'What are you looking to change your relationship with?',sub:'Choose all that apply. You can keep this private.',options:options([['alcohol','Alcohol'],['opioids','Opioids'],['stimulants','Stimulants'],['cannabis','Cannabis'],['nicotine','Nicotine'],['other','Something else'],['private','I’d rather discuss this privately']])},
9 stage:{title:'Where are you today?',sub:'There’s no right place to be starting from.',options:options([['exploring','Considering making a change'],['cutting','Trying to cut back'],['stopping','Planning to stop'],['recent','Recently stopped'],['maintaining','Maintaining my recovery']])},
10
11 impact:{title:'How much is this getting in the way?',sub:'Think about your day-to-day life, rather than a “score.”',options:options([['little','I notice it, but I’m managing'],['some','It makes some days harder'],['often','It often disrupts my plans or routine'],['much','It feels difficult to manage on my own']])},
12 support:{title:'What support do you have right now?',sub:'Choose your main source of support.',options:options([['clinician','A clinician or treatment team'],['therapy','A therapist or counselor'],['group','A recovery or peer-support group'],['family','Friends or family'],['none','I’m doing this mostly on my own']])},
13 tried:{title:'Have you tried professional care or medication for this?',sub:'Detailed medication and health questions belong in a private clinical assessment.',options:options([['helped','Yes, and some of it helped'],['notfit','Yes, but it wasn’t the right fit'],['notyet','Not yet'],['private','I’d rather discuss this privately']])},
14 supporter:{title:'What would help you support them?',sub:'You don’t need to answer medical questions on their behalf.',options:options([['conversation','Knowing how to start a conversation'],['provider','Finding professional help'],['support','Finding support for myself, too']])}
15};
16function question(id,a){if(questions[id])return questions[id];if(id==='priority')return {title:'Which would make the biggest difference right now?',sub:'We’ll focus your next step on this goal.',options:questions.goal.options.filter(o=>(a.goal||[]).includes(o.id))};
17 if(id==='desired'){const g=a.goal;return {title:'If things were getting better, what would you notice first?',sub:'Choose the change that would mean the most to you.',options:options(g==='weight'?[['appetite','Feeling more comfortable with my appetite'],['routine','A more consistent eating routine'],['health','Improving my weight-related health'],['understand','Understanding what has changed']]:g==='energy'?[['sleep','Waking up feeling more rested'],['energy','Having more energy for my day'],['focus','Finding it easier to concentrate'],['routine','Getting back into a daily routine']]:g==='stress'?[['calm','Feeling less overwhelmed'],['moments','Handling stressful moments more comfortably'],['rest','Finding it easier to settle or sleep'],['connection','Feeling less alone with this']]:[['less','Thinking about it less throughout the day'],['stress','Getting through stressful moments without using'],['cutback','Feeling able to cut back'],['stopped','Feeling more confident staying stopped'],['life','Having more space for the rest of my life']])};}
18 if(id==='context'){return {title:a.goal==='weight'?'When did you notice your appetite or weight changing?':a.goal==='energy'?'When did this start feeling different?':'When does this feel hardest?',sub:'The pattern can help you explain your experience to a care professional.',options:options(['weight','energy'].includes(a.goal)?[['before','Before I started changing my substance use'],['during','While cutting back or stopping'],['after','Later in my recovery'],['unsure','I’m not sure']]:[['evenings','In the evenings or when I’m alone'],['stress','During stressful moments'],['social','In certain places or around certain people'],['throughout','Throughout the day'],['unsure','There isn’t a clear pattern']])};}
19}
20function flow(a){let ids=['audience','region'];if(a.region==='other')return [...ids,'international'];if(a.audience==='someone')return [...ids,'supporter','result'];ids.push('age');if(a.age==='minor')return [...ids,'youth'];return [...ids,'goal',...((a.goal||[]).length>1?['priority']:[]),'substance','stage','impact','result'];}
21
22function label(id,a){const q=question(id,a);const values=Array.isArray(a[id])?a[id]:[a[id]];return q?.options.filter(o=>values.includes(o.id)).map(o=>o.label).join(', ')||'';}
23function select(a,id,value){const q=question(id,a);if(!q?.multi)return {...a,[id]:value};const current=Array.isArray(a[id])?a[id]:[];const exclusive=q.exclusive||[];return {...a,[id]:exclusive.includes(value)?[value]:current.includes(value)?current.filter(v=>v!==value):[...current.filter(v=>!exclusive.includes(v)),value]};}
24
25function result(a){if(a.audience==='someone')return {kind:'supporter',title:'A next step for supporting someone you care about.',body:a.supporter==='provider'?'Start by finding professional help together, if they’re open to it. Ask about services, availability, and costs directly.':'Start with a calm, nonjudgmental conversation. Share what you’ve noticed, ask what support would feel useful, and make room for their answer.',action:a.supporter==='provider'?'Find treatment nearby':'Explore support for families',href:a.supporter==='provider'?'/#directory':'https://www.samhsa.gov/find-help',finder:a.supporter==='provider'};
26const priority=(a.goal||[]).includes(a.priority)?a.priority:(a.goal||[])[0];
27const alcohol=(a.substance||[]).includes('alcohol');
28const base={kind:'guided',peptide:true,interest:'unsure',action:'Understand the care pathway',href:'/rx/'};
29if(priority==='weight')return {...base,title:'Start with the weight-management options.',body:'You told us weight or appetite is your main priority. Semaglutide and tirzepatide are two options to learn about before a clinical assessment. These answers cannot determine which is a
29ppropriate for you.',why:'Your priority points to weight-management information. Medical history, current medications, and eligibility criteria—not a preference quiz—determine the treatment choice.',topics:[{name:'Semaglutide',href:'/peptides/semaglutide/',text:'Understand how GLP-1 treatment is used for weight management and what clinical review involves.'},{name:'Tirzepatide',href:'/peptides/tirzepatide/',text:'Explore another weight-management option and the questions to bring to your clinician.'}],note:'A clinician may recommend either option, a different treatment, or no medication.'};
30if(alcohol&&['use','cravings'].includes(priority))return {...base,interest:'semaglutide',title:'The semaglutide research is relevant to your question.',body:'You mentioned alcohol and wanting more control over use or cravings. Semaglutide has been studied for alcohol use, making its research a useful starting point for a conversation with your clinician.',why:'This research topic reflects the goal you selected. It is not a finding that semaglutide is medically right for you.',topics:[{name:'Semaglutide & alcohol research',href:'/peptides/semaglutide/',text:'A clinical trial in adults with alcohol use disorder and obesity reported reduced drinking and craving. Learn who was studied and what the findings mean.'}],action:'Read the semaglutide evidence',href:'/peptides/semaglutide/',note:'Semaglutide is not FDA-approved for addiction. The findings do not establish eligibility or replace established alcohol treatment.'};
31return {...base,title:priority==='energy'?'Let’s get clearer on focus, sleep, and energy.':priority==='stress'?'Start with what’s behind the stress.':'Your next step needs a closer look.',body:'Your answers give us a starting point for a care conversation, but they do not point to a peptide with established benefit for this goal. You don’t need to choose a product to ask for help understanding your options.',why:'A symptom such as brain fog, anxiety, or craving can have different causes. Matching it to a peptide name would skip the evaluation needed to choose appropriate care.',note:'We haven’t identified a peptide match from these answers. Leave an inquiry to explore the care pathway and what a clinical assessment involves.'};}
32
33root.SoberQuiz={questions,question,flow,label,result,select};if(typeof module!=='undefined')module.exports=root.SoberQuiz;
34})(typeof window!=='undefined'?window:globalThis);

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.