PageSourceSearch

https://storyblok-assets-ng.mindvalley.com/_nuxt/yyw7z9Lp.js

js mindvalley.com collected 2026-09-24 08:24:38 UTC 13,401 bytes, 1 lines download raw bytes

1import{u as Oe}from"./BHe9BvlE.js";import{f as Me,a as Qe,q as Ue,Q as P,i as Le,b as Ve,c as De,P as ue,r as Z,d as Fe,e as Ke,g as Ye,h as Ge,j as je,k as He,l as le,m as Be}from"./D7GZ5IbA.js";import{ad as Ze,G as Je}from"#entry";import{i as We,d as J}from"./CA0L0dfh.js";import{D as u,j as S,r as Xe,c as et}from"./D0rPpKiU.js";const tt="exponential_you",b={intro:"exponential_you_intro",quiz:"exponential_you_quiz",result:"exponential_you_result"},d={started:"assessment_started",questionViewed:"assessment_question_viewed",answerSubmitted:"assessment_answer_submitted",backClicked:"assessment_back_clicked",completed:"assessment_completed",resultViewed:"assessment_result_viewed",recommendationClicked:"assessment_recommendation_clicked",leadCaptured:"assessment_lead_captured",leadCaptureFailed:"assessment_lead_capture_failed",leadCaptureRetryClicked:"assessment_lead_capture_retry_clicked"},nt="mindvalley_web",at="web",rt={ee:"entrepreneurship",auth:"career",mind:"mind",mystic:"soul",conn:"relationships",body:"body"},Rt=t=>rt[t]??"mind",st=new Set([400,409,422]);function ot(t){if(!t||typeof t!="object")return null;const a=t,l=a.statusCode??a.status??a.response?.status,o=Number(l);return Number.isFinite(o)&&o>0?o:null}function it(t){const a=ot(t);return a?st.has(a)?"validation_error":"api_error":"network_error"}function ut(t){return(t||[]).some(a=>!!a?.field)?"validation_error":"api_error"}const ce=120,lt=/[^\s@<>()[\]",;:]+@[^\s@<>()[\]",;:]+\.[a-z]{2,}/gi;function ct(t){const a=(t||"").replace(lt,"[email]").replace(/\s+/g," ").trim();return a.length>ce?`${a.slice(0,ce-1).trimEnd()}…`:a}function dt(t,a){return t?a?"member":"non_member":"logged_out"}const mt=64;function ft(t,a,l){const o=new URLSearchParams(t||""),w=o.get("utm_source")||o.get("itm_source");if(w){const m=w.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,mt).replace(/_+$/,"");if(m)return m}return["gclid","fbclid","gbraid","wbraid","ttclid","msclkid"].some(m=>o.get(m))?"paid":a?fe(a)===l?"internal":"organic":"direct"}function _t(t,a){if(!t)return"direct";if(fe(t)!==a)return"external";const l=pt(t);return!l||l==="/"?"home":l.replace(/^\/+|\/+$/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"home"}function fe(t){try{return new URL(t).host}catch{return""}}function pt(t){try{return new URL(t).pathname}catch{return""}}function $t(t,a="cta"){const l=(t||"").replace(/[^a-zA-Z0-9\s]+/g," ").trim().toLowerCase().split(/\s+/).filter(Boolean);return l.length?l.map((o,w)=>w===0?o:o.charAt(0).toUpperCase()+o.slice(1)).join(""):a}function xt(t,a){const l=Date.parse(t),o=Date.parse(a);if(!(Number.isNaN(l)||Number.isNaN(o)||o<l))return Math.round((o-l)/1e3)}const gt=["grow","dream","deeper","bottleneck","analyzing","lead","bridge","plan"],vt=["grow","dream","deeper","bottleneck","age","gender","analyzing","lead","bridge","plan"],wt=["grow","dream","deeper","bottleneck","age","gender","lead","plan"],ht={v1:gt,v2:vt,v3:wt},yt=["analyzing","lead","bridge","plan"],_e=t=>t==="v2"||t==="v3"?t:"v1",St=t=>t.filter(a=>!yt.includes(a)),bt=["gclid","fbclid","gbraid","wbraid","ttclid","msclkid"],kt=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],Tt="mv_pathway_quiz_state",pe="mv_pathway_quiz_distinct_id",At=()=>{if(typeof window>"u")return"";try{return window.localStorage.getItem(pe)||""}catch{return""}},Ct=t=>{if(!(!t||typeof window>"u"))try{window.localStorage.setItem(pe,t)}catch{}};let de=0;function me(){const t=globalThis.crypto;if(typeof t?.randomUUID=="function")return t.randomUUID();if(typeof t?.getRandomValues=="function"){const a=new Uint8Array(16);t.getRandomValues(a),a[6]=a[6]&15|64,a[8]=a[8]&63|128;const l=Array.from(a,o=>o.toString(16).padStart(2,"0")).join("");return[l.slice(0,8),l.slice(8,12),l.slice(12,16),l.slice(16,20),l.slice(20)].join("-")}return de+=1,`pq-${Date.now().toString(36)}-${de}`}const M=()=>new Date().toISOString();function zt(t={}){const a=u(()=>et(t.copy)||{}),l=t.storageKey||Tt,o=_e(t.variant),w=ht[o],q=St(w),m=S(0),p=S([]),s=Xe({}),k=S(""),T=S(""),R=S(null),z=S(!1),$=S(""),N=S(null),h=S([]),A=S([]),Q=S(null),O=u(()=>w[m.value]||"grow"),C=u(()=>s[P.growthArea]?.value??null),x=u(()=>s[P.bestSelf]?.value||""),U=u(()=>s[P.deeper]?.value||""),E=u(()=>s[P.lead]?.lead??null),Y=u(()=>E.value?.firstName||""),G=u(()=>De(s[P.ageRange]?.value??null)?.label||""),n=u(()=>Ve(s[P.gender]?.value??null)?.label||""),f=u(()=>He(`${x.value} ${U.value}`.trim(),C.value)),j=u(()=>je(f.value[0])),H=u(()=>le(x.value)),ge=u(()=>le(U.value)),L=u(()=>{const e=s[P.bottleneck]?.value;return e?Number(e):null}),D=u(()=>Ge(L.value)),V=u(()=>Ye(L.value,C.value)),W=u(()=>V.value.key),X=u(()=>Fe(L.value,C.value,f.value)),ee=u(()=>Ke(W.value,C.value)),te=u(()=>{const e=X.value,r=e[0]??V.value,g=e.map(c=>c.key),_=(c,y)=>h.value.find(v=>v.slug&&v.slug===c)??h.value.find(v=>Z(v.slug,g)===y)??null,i=c=>A.value.find(y=>Z(y.pathway.slug,g)===c);if(o==="v1"){const c=i(r.key);return[{pathway:r,pathwayKey:r.key,offering:_(c?.pathway.slug??null,r.key)??c?.offering??h.value[0]??null,info:c?.pathway??null,score:c?.score??null,position:"top_match"}]}const I=new Set,oe=(c,y)=>{const v=Z(c,g),ze=y===0?r.key:e[1]?.key??r.key,ie=v&&!I.has(v)?v:ze;return I.add(ie),ie};return A.value.length?A.value.map((c,y)=>{const v=oe(c.pathway.slug,y);return{pathway:ue[v],pathwayKey:v,offering:c.offering??_(c.pathway.slug,v),info:c.pathway,score:c.score,position:y===0?"top_match":"also_fits"}}):h.value.map((c,y)=>{const v=oe(c.slug,y);return{pathway:ue[v],pathwayKey:v,offering:c,info:null,score:null,position:y===0?"top_match":"also_fits"}})}),ve=u(()=>te.value[0]?.offering??h.value[0]??null),F=u(()=>Be({growthArea:C.value,bestSelfText:x.value,themes:f.value},a.value,o)),B=e=>F.value.find(r=>r.stepId===e),we=u(()=>B(O.value)),he=u(()=>q.filter(e=>{const r=B(e);return r?Le(r,s[r.id]):!1}).length),ne=q.length,ye=u(()=>{const e=q.indexOf(O.value);return e===-1?100:Math.round(e/ne*100)}),Se=u(()=>p.value.length>0);function ae(e,r,g=null){const _=F.value.find(I=>I.id===e);if(!_)return;const i=_.type==="single_choice"?_.options?.find(I=>I.value===r)?.label??null:null;s[e]={questionId:e,stepId:_.stepId,type:_.type,questionText:_.title,order:_.order,value:_.type==="lead_capture"?null:r,label:i,lead:g,answeredAt:M()},K()}function be(e){ae(P.lead,null,e)}
1function ke(e){e in s&&(delete s[e],K())}function re(e,r=!0){const g=Math.max(0,Math.min(e,w.length-1));g!==m.value&&(r&&p.value.push(m.value),m.value=g,O.value==="plan"&&!R.value&&(R.value=M()),K())}function Te(){re(m.value+1)}function Ae(){const e=p.value.pop();e!==void 0&&(m.value=e,K())}function Ce(){Object.keys(s).forEach(e=>delete s[e]),m.value=0,p.value=[],R.value=null,$.value="",N.value=null,h.value=[],A.value=[],k.value=me(),T.value=M(),Ie()}function Ee(){if(typeof window>"u")return;const e=new URLSearchParams(window.location.search),r=g=>g.reduce((_,i)=>{const I=e.get(i)||e.get(i.replace("utm_","itm_"));return I&&(_[i]=I),_},{});Q.value={page_path:window.location.pathname,page_url:window.location.href,referrer:document.referrer||null,user_agent:window.navigator?.userAgent||null,locale:window.navigator?.language||null,utm:r(kt),click_ids:r(bt)}}function K(){if(!(!t.persist||typeof window>"u"))try{const e={sessionId:k.value,startedAt:T.value,stepIndex:m.value,answers:JSON.parse(JSON.stringify(s))};window.localStorage.setItem(l,JSON.stringify(e))}catch{}}function Ie(){if(!(typeof window>"u"))try{window.localStorage.removeItem(l)}catch{}}function Ne(){if(!t.persist||typeof window>"u")return!1;try{const e=window.localStorage.getItem(l);if(!e)return!1;const r=JSON.parse(e);if(!r?.sessionId)return!1;k.value=r.sessionId,T.value=r.startedAt||M(),Object.entries(r.answers||{}).forEach(([_,i])=>{s[_]=i});const g=w[r.stepIndex]==="analyzing"?r.stepIndex-1:r.stepIndex;return m.value=Math.max(0,Math.min(g||0,w.length-1)),!0}catch{return!1}}function Pe(){k.value||Ne()||(k.value=me(),T.value=M()),Ee()}function qe(){return F.value.map(e=>s[e.id]).filter(e=>!!e).sort((e,r)=>e.order-r.order).map(e=>({question_id:e.questionId,question_order:e.order,question_type:e.type,question_text:e.questionText,answer_value:e.type==="single_choice"?e.value:null,answer_label:e.label,answer_text:e.type==="open_text"?e.value:null,answer_json:e.lead?{first_name:e.lead.firstName,email:e.lead.email,consent:e.lead.consent}:null,answered_at:e.answeredAt}))}function Re(){return L.value===null?null:{pathway_key:V.value.key,pathway_name:V.value.name,identity:ee.value,bottleneck_id:D.value.id,bottleneck_key:D.value.key,bottleneck_name:D.value.name,themes:f.value}}const $e={page_path:"",page_url:"",referrer:null,user_agent:null,locale:null,utm:{},click_ids:{}};function se(e="completed"){return{quiz_id:Qe,quiz_version:Ue(o),session_id:k.value,distinct_id:At(),status:e,started_at:T.value,completed_at:e==="completed"?R.value||M():null,lead:E.value?{first_name:E.value.firstName,email:E.value.email,consent:E.value.consent}:null,result:Re(),responses:qe(),context:Q.value||$e,consent_categories:Ze()}}async function xe(e,r="completed"){if(!e)return!1;z.value=!0,$.value="",N.value=null;const g=se(r),_=We();J("PathwayQuiz",`POST ${e} → request`,g);try{const i=await $fetch(e,{method:"POST",body:g,..._?{headers:{"x-debug":"true"}}:{}});return J("PathwayQuiz",`POST ${e} → response`,i),h.value=i?.offerings?.length?i.offerings:i?.offering?[i.offering]:[],A.value=i?.recommendations??[],i?.distinctId&&Ct(i.distinctId),i?.success===!1?($.value=i.error||i.messages?.[0]?.message||"Submission rejected",N.value=ut(i.messages),!1):!0}catch(i){return J("PathwayQuiz",`POST ${e} → error`,i),h.value=[],A.value=[],$.value=i instanceof Error?i.message:"Submission failed",N.value=it(i),!1}finally{z.value=!1}}return{variant:o,steps:w,answerableSteps:q,stepIndex:m,currentStep:O,answers:s,sessionId:k,startedAt:T,completedAt:R,isSubmitting:z,submitError:$,submitErrorType:N,offering:ve,offerings:h,recommendations:A,context:Q,questions:F,currentQuestion:we,questionForStep:B,growthArea:C,growthAreaOption:u(()=>Me(C.value)),bestSelfText:x,bestSelfQuote:H,deeperText:U,deeperQuote:ge,themes:f,dominantTheme:j,bottleneck:D,bottleneckId:L,pathway:V,pathwayKey:W,identity:ee,rankedPathways:X,recommendedPathways:te,lead:E,firstName:Y,ageRange:G,gender:n,answeredCount:he,totalQuestions:ne,progress:ye,canGoBack:Se,start:Pe,recordAnswer:ae,recordLead:be,clearAnswer:ke,next:Te,back:Ae,goToStep:re,reset:Ce,buildSubmissionPayload:se,submitAnswers:xe}}function Ot(t={}){const{track:a,identify:l}=Oe(),o=Je(),w=_e(t.variant);function q(){return{app_name:nt,platform:at,ui_language:typeof window<"u"&&window.navigator?.language||"",user_level_super_property:o.profile?.userLevel?.level??0}}function m(){return dt(!!o.loggedIn,!!o.isMember)}function p(n){return{...q(),assessment_id:tt,assessment_variant:w,screen_name:n}}function s(n,f,j,H){typeof window>"u"||a(n,f,H,j)}function k(){if(typeof window>"u")return;const n=window.location.host,f=document.referrer||null;s(d.started,{...p(b.intro),entry_source:ft(window.location.search,f,n),previous_screen_name:_t(f,n)},`${d.started}`)}let T=0;function R(n){T+=1,s(d.questionViewed,{...p(b.quiz),question_id:n.questionId,question_order:n.questionOrder,total_questions:n.totalQuestions},`${d.questionViewed}:${n.questionId}:${T}`)}let z=0;function $(n){z+=1,s(d.answerSubmitted,{...p(b.quiz),question_id:n},`${d.answerSubmitted}:${n}:${z}`)}let N=0;function h(n){N+=1,s(d.backClicked,{...p(b.quiz),question_id:n.questionId,question_order:n.questionOrder},`${d.backClicked}:${n.questionId}:${N}`)}function A(n,f){s(d.completed,{...p(b.quiz),total_questions:n,...f===void 0?{}:{completion_time_seconds:f}},`${d.completed}`)}function Q(n){s(d.resultViewed,{...p(b.result),result_name:n.resultName,recommended_pathway_name:n.recommendedPathwayName,recommended_category_name:n.recommendedCategoryName,...n.recommendedPathwayName2?{recommended_pathway_name_2:n.recommendedPathwayName2,recommended_category_name_2:n.recommendedCategoryName2}:{},...n.matchPercentage===void 0?{}:{match_percentage:n.matchPercentage},...n.matchPercentage2===void 0?{}:{match_percentage_2:n.matchPercentage2},membership_status:m()},`${d.resultViewed}:${n.resultName}`)}function O(n){s(d.recommendationClicked,{...p(b.result),recommended_pathway_name:n.recommendedPathwayName,cta_name:n.ctaName,membership_status:m()},`${d.recommendationClicked}:${n.ctaName}`)}function C(n){s(d.leadCaptured,{...p(b.result),email:n.email,capture_placement:n.placement},`${d.leadCaptured}
1`,{integrations:{All:!0,"Google Analytics 4":!1}})}let x=0;function U(n){x+=1;const f=ct(n.errorMessage);s(d.leadCaptureFailed,{...p(b.result),capture_placement:n.placement,error_type:n.errorType,...f?{error_message:f}:{}},`${d.leadCaptureFailed}:${x}`)}let E=0;function Y(){E+=1,s(d.leadCaptureRetryClicked,p(b.result),`${d.leadCaptureRetryClicked}:${E}`)}function G(n,f){typeof window>"u"||l(null,{exponential_you_result:n,is_exponential_you_lead:f})}return{trackAssessmentStarted:k,trackQuestionViewed:R,trackAnswerSubmitted:$,trackBackClicked:h,trackCompleted:A,trackResultViewed:Q,trackRecommendationClicked:O,trackLeadCaptured:C,trackLeadCaptureFailed:U,trackLeadCaptureRetryClicked:Y,identifyResult:G}}const Mt="pathway-quiz-theme",Qt="mv_pathway_quiz_theme",Ut=t=>t==="states"||t==="mindvalley";export{Qt as P,Ot as a,xt as b,$t as c,Rt as d,Mt as e,Ut as i,_e as n,zt as u};

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.