1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,991101,793021,760832,939202,561485,868590,372673,723733,618351,e=>{"use strict";let t,a;var n,r=e.i(38484),i=e.i(765221),s=e.i(778713);let l=e=>{let t,a=new Set,n=(e,n)=>{let r="function"==typeof e?e(t):e;if(!Object.is(r,t)){let e=t;t=(null!=n?n:"object"!=typeof r||null===r)?r:Object.assign({},t,r),a.forEach(a=>a(t,e))}},r=()=>t,i={setState:n,getState:r,getInitialState:()=>s,subscribe:e=>(a.add(e),()=>a.delete(e))},s=t=e(n,r,i);return i},o=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function d(e,t){return!e.visibleWhen||function(e,t){if(!t)return!1;let a=t.value,n=e.value,r=Array.isArray(n)?n.map(String):[];switch(e.condition){case"equals":return String(a)===String(n);case"not_equals":return String(a)!==String(n);case"in":return r.includes(String(a));case"not_in":return!r.includes(String(a));case"contains":return Array.isArray(a)?a.map(String).includes(String(n)):String(a).includes(String(n))}}(e.visibleWhen,t[e.visibleWhen.questionId])}function c(e,t){return e.questions.flatMap((e,a)=>d(e,t)?[a]:[])}function u(e,t){return!e||0===e.questions.length||t<0||t>=e.questions.length?null:e.questions[t]}function h(e,t,a){let n=c(e,t).filter(t=>!["welcome","statement","thank_you"].includes(e.questions[t].type)),r=n.filter(e=>e<a).length,i=n.includes(a),s=n.length;return{currentQuestionNumber:r+ +!!i,totalQuestions:s,progress:s<=0?0:Math.round(r/s*100)}}let m={definition:null,currentIndex:0,answers:{},email:"",startedAt:null,progress:0,currentQuestion:null,currentQuestionNumber:0,isComplete:!1,totalQuestions:0,validationErrorKey:null},p=(t=(n=(e,t)=>({...m,initialize:(t,a,n)=>{let r=t.questions,i=a??{},s=a&&Object.keys(a).length>0?function(e,t,a){let n=c(e,t);if(void 0===a||!Number.isInteger(a)){for(let a of n)if(!t[e.questions[a].id])return a;return n.at(-1)??0}let r=Math.min(Math.max(a,0),n.find(a=>{let n=e.questions[a];return n.required&&!t[n.id]})??n.at(-1)??0);return n.includes(r)?r:n.find(e=>e>=r)??n.at(-1)??0}(t,a,n):0,l="";if(a&&Object.keys(a).length>0){let e=r.find(e=>"email"===e.type);e&&a[e.id]&&(l=String(a[e.id].value))}e({definition:t,answers:i,currentIndex:s,startedAt:new Date,currentQuestion:u(t,s),isComplete:!1,validationErrorKey:null,email:l,...h(t,i,s)})},next:()=>{let{definition:a,currentIndex:n,answers:r}=t();if(!a||0===a.questions.length)return!1;let i=a.questions[n];if(!i)return!1;let s=null;if(i.required&&!r[i.id])switch(i.type){case"single_choice":case"single_choice_other":s="selectOption";break;case"open_text":s="writeAnswer";break;case"email":s="enterEmail";break;case"nps":s="selectValue";break;case"multi_select":case"consent":case"familiarity_grid":s="selectAtLeastOne";break;default:s="required"}else if("email"===i.type&&r[i.id]){var l;l=String(r[i.id].value),o.test(l)||(s="invalidEmail")}else if("open_text"===i.type&&i.required&&r[i.id]&&""===String(r[i.id].value).trim())s="writeAnswer";else if("single_choice_other"===i.type&&r[i.id]){let e=String(r[i.id].value);e.startsWith("other:")&&""===e.slice(6).trim()&&(s="specifyOther")}if(!s&&("multi_select"===i.type||"consent"===i.type)&&i.required&&r[i.id]&&Array.isArray(r[i.id].value)&&0===r[i.id].value.length&&(s="selectAtLeastOne"),!s&&"consent"===i.type&&i.required&&r[i.id]){let e=Array.isArray(r[i.id].value)?r[i.id].value:[];(i.options??[]).map(e=>String(e.value)).some(t=>!e.includes(t))&&(s="required")}if(!s&&"familiarity_grid"===i.type&&i.required){let e=r[i.id]?.value,t=i.options??[];(!e||"object"!=typeof e||Array.isArray(e)||t.some(t=>!e[t.id]))&&(s="selectAtLeastOne")}if(s)return e({validationErrorKey:s}),!1;let d={};if(("email"===i.type||"thank_you"===i.type)&&r[i.id]){let e=String(r[i.id].value);e.includes("@")&&(d.email=e)}let m=c(a,r).find(e=>e>n),p=void 0===m,x=m??n,y=h(a,r,x);return e({currentIndex:x,validationErrorKey:null,...y,progress:p?100:y.progress,currentQuestion:p?u(a,n):u(a,x),isComplete:p,...d}),!0},back:()=>{e(e=>{if(!e.definition||e.currentIndex<=0)return e;let t=[...c(e.definition,e.answers)].reverse().find(t=>t<e.currentIndex);return void 0===t?e:{currentIndex:t,validationErrorKey:null,...h(e.definition,e.answers,t),currentQuestion:u(e.definition,t)}})},setAnswer:(t,a,n)=>{e(e=>{let r=e.answers[t],i={questionId:t,value:a,answeredAt:new Date().toISOString(),timeSpentMs:n?.timeSpentMs??r?.timeSpentMs??0,revision:r?r.revision+1:1,confidence:n?.confidence??r?.confidence},s=e.definition?function(e,t){let a={...t};for(let t of e.questions)d(t,a)||delete a[t.id];return a}(e.definition,{...e.answers,[t]:i}):{...e.answers,[t]:i};return{answers:s,validationErrorKey:null,...e.definition?h(e.definition,s,e.currentIndex):{}}})},setEmail:t=>{e({email:t})},reset:()=>{e({...m})}}))?l(n):l,Object.assign(a=e=>(function(e,t=e=>e){let a=i.default.useSyncExternalStore(e.subscribe,i.default.useCallback(()=>t(e.getState()),[e,t]),i.default.useCallback(()=>t(e.getInitialState()),[e,t]));return i.default.useDebugValue(a),a})(t,e),t),a);var x=e.i(239937),y=e.i(913793),f=e.i(519455);let v=(0,i.memo)(function({onNext:e,onBack:t,canGoBack:a,isLastQuestion:n,isNextDisabled:i=!1,centerSlot:l}){let o=(0,s.useTranslations)("survey");return(0,r.jsx)("div",{className:"w-full pb-[env(safe-area-inset-bottom)]",children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,r.jsx)("div",{className:"min-w-[80px]",children:a&&(0,r.jsxs)(f.Button,{variant:"ghost",className:"min-h-11",onClick:t,type:"button","aria-label":o("backAriaLabel"),"data-testid":"nav-back",children:[(0,r.jsx)(y.ChevronUp,{className:"size-4 -rotate-90"}),o("back")]})}),l&&(0,r.jsx)("div",{className:"flex items-center",children:l}),(0,r.jsxs)(f.Button,{variant:"default",className:"min-h-11",onClick:e,disabled:i,type:"button","aria-label":o("nextAriaLabel"),"data-testid":"nav-next",children:[o(n?"finish":"next"),(0,r.jsx)(x.ChevronRight,{className:"size-4"})]})]})})});var g=e.i(168148);let k=(0,i.memo)(function({value:e}){let t=(0,s.useTranslations)("common"),a=Math.min(100,Math.max(0,e));return(0,r.jsxs)("div",{className:"sticky top-0 z-40 w-full bg-background/80 backdrop-blur-sm px-4 py-2",children:[(0,r.jsx)(g.Progress,{value:a,className:"h-2 rounded-full","data-testid":"progress","aria-label":t("surveyProgress"),"aria-valuenow":a,"aria-valuemax":100}),(0,r.jsxs)("p",{className:"mono-label text-muted-foreground mt-1 text-center",children:[a,"%"]})]})});var b=e.i(504624);e.i(716787);let j=(0,i.createContext)(new Set),w=(0,i.createContext)(void 0);function N({lockedQuestionIds:e,audienceCompanyName:t,children:a}){let n=(0,i.useMemo)(()=>new Set(e),[e.join("|")]);return(0,r.jsx)(w.Provider,{value:t,children:(0,r.jsx)(j.Provider,{value:n,children:a})})}function M(e){return(0,i.useContext)(j).has(e)}function S(){return(0,i.useContext)(w)}function C({question:e,onAnswer:t,onAutoAdvance:a}){let n=(0,s.useTranslations)("survey"),i=(0,b.useSearchParams)(),l=S(),o=i.get("company_name")??l;return(0,r.jsxs)("div",{className:"flex flex-col items-center text-center space-y-6",children:[(0,r.jsx)("h1",{className:"text-3xl",children:e.title}),o&&(0,r.jsx)("p",{className:"text-lg text-primary font-medium",children:n("preparedFor",{companyName:o})}),e.subtitle&&(0,r.jsx)("p",{className:"text-muted-foreground text-lg",children:e.subt
1itle}),e.description&&(0,r.jsx)("p",{className:"text-muted-foreground text-sm max-w-md",children:e.description}),(0,r.jsx)(f.Button,{size:"lg",onClick:()=>{t("start"),a&&setTimeout(()=>a(),100)},"data-testid":"survey-start",children:n("startButton")})]})}e.s(["PrefillLockProvider",()=>N,"useAudienceCompanyName",()=>S,"useIsLocked",()=>M],793021);var A=e.i(487486),L=e.i(110204),q=e.i(629288),E=e.i(103790);let z=(0,E.default)("alarm-clock",[["circle",{cx:"12",cy:"13",r:"8",key:"3y4lt7"}],["path",{d:"M12 9v4l2 2",key:"1c63tq"}],["path",{d:"M5 3 2 6",key:"18tl5t"}],["path",{d:"m22 6-3-3",key:"1opdir"}],["path",{d:"M6.38 18.7 4 21",key:"17xu3x"}],["path",{d:"M17.64 18.67 20 21",key:"kv2oe2"}]]);var I=e.i(543912);let T=(0,E.default)("angry",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 16s-1.5-2-4-2-4 2-4 2",key:"epbg0q"}],["path",{d:"M7.5 8 10 9",key:"olxxln"}],["path",{d:"m14 9 2.5-1",key:"1j6cij"}],["path",{d:"M9 10h.01",key:"qbtxuw"}],["path",{d:"M15 10h.01",key:"1qmjsl"}]]),_=(0,E.default)("app-window",[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]),B=(0,E.default)("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]),R=(0,E.default)("banknote",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]]);var O=e.i(499339),V=e.i(216398);let P=(0,E.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),H=(0,E.default)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),D=(0,E.default)("briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);var $=e.i(771292),W=e.i(137950),W=W;let F=(0,E.default)("calendar-days",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);var K=e.i(497364),Q=e.i(806650),Q=Q,G=e.i(420692),U=e.i(611905);let Y=(0,E.default)("construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]),Z=(0,E.default)("crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);var J=e.i(134893);let X=(0,E.default)("factory",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M16 16h.01",key:"1f9h7w"}],["path",{d:"M3 19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a.5.5 0 0 0-.769-.422l-4.462 2.844A.5.5 0 0 1 15 10.5v-2a.5.5 0 0 0-.769-.422L9.77 10.922A.5.5 0 0 1 9 10.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z",key:"1iv0i2"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);var ee=e.i(145053);let et=(0,E.default)("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]);var ea=e.i(712901);let en=(0,E.default)("frown",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 16s-1.5-2-4-2-4 2-4 2",key:"epbg0q"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]),er=(0,E.default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);var ei=e.i(409734);let es=(0,E.default)("hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]),el=(0,E.default)("handshake",[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]]),eo=(0,E.default)("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]),ed=(0,E.default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),ec=(0,E.default)("hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);var eu=e.i(259886);let eh=(0,E.default)("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),em=(0,E.default)("landmark",[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z",key:"1m329m"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]]),ep=(0,E.default)("laptop",[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]);var ex=e.i(491244);let ey=(0,E.default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var ef=e.i(764698),ev=e.i(325066);let eg=(0,E.default)("megaphone",[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}
1]]),ek=(0,E.default)("meh",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"8",x2:"16",y1:"15",y2:"15",key:"1xb1d9"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);var eb=e.i(280743);let ej=(0,E.default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),ew=(0,E.default)("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);var eN=e.i(517613);let eM=(0,E.default)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]),eS=(0,E.default)("party-popper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]);var eC=e.i(564727),eA=e.i(984939);let eL=(0,E.default)("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]),eq=(0,E.default)("plane-takeoff",[["path",{d:"M2 22h20",key:"272qi7"}],["path",{d:"M6.36 17.4 4 17l-2-4 1.1-.55a2 2 0 0 1 1.8 0l.17.1a2 2 0 0 0 1.8 0L8 12 5 6l.9-.45a2 2 0 0 1 2.09.2l4.02 3a2 2 0 0 0 2.1.2l4.19-2.06a2.41 2.41 0 0 1 1.73-.17L21 7a1.4 1.4 0 0 1 .87 1.99l-.38.76c-.23.46-.6.84-1.07 1.08L7.58 17.2a2 2 0 0 1-1.22.18Z",key:"fkigj9"}]]);var eE=e.i(947101);let ez=(0,E.default)("repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]),eI=(0,E.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]),eT=(0,E.default)("scale",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]]),e_=(0,E.default)("school",[["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M18 5v16",key:"1ethyx"}],["path",{d:"m4 6 7.106-3.79a2 2 0 0 1 1.788 0L20 6",key:"zywc2d"}],["path",{d:"m6 11-3.52 2.147a1 1 0 0 0-.48.854V19a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5a1 1 0 0 0-.48-.853L18 11",key:"1d4ql0"}],["path",{d:"M6 5v16",key:"1sn0nx"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}]]),eB=(0,E.default)("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),eR=(0,E.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);var eO=e.i(866588);let eV=(0,E.default)("siren",[["path",{d:"M7 18v-6a5 5 0 1 1 10 0v6",key:"pcx96s"}],["path",{d:"M5 21a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2z",key:"1b4s83"}],["path",{d:"M21 12h1",key:"jtio3y"}],["path",{d:"M18.5 4.5 18 5",key:"g5sp9y"}],["path",{d:"M2 12h1",key:"1uaihz"}],["path",{d:"M12 2v1",key:"11qlp1"}],["path",{d:"m4.929 4.929.707.707",key:"1i51kw"}],["path",{d:"M12 12v6",key:"3ahymv"}]]),eP=(0,E.default)("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),eH=(0,E.default)("smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}
1],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);var eD=e.i(914628),e$=e.i(557173);let eW=(0,E.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),eF=(0,E.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),eK=(0,E.default)("stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);var eQ=e.i(998324);let eG=(0,E.default)("thumbs-up",[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]]);var eU=e.i(762776);let eY=(0,E.default)("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]);var eZ=e.i(989315);let eJ=(0,E.default)("trophy",[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]]),eX=(0,E.default)("truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]),e0=(0,E.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var e1=e.i(44114);let e2=(0,E.default)("wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);var e4=e.i(722195),e5=e.i(456222),e3=e.i(975157);let e8=Object.fromEntries(Object.entries({"â":e4.X,"ð«":B,"â":ed,"ð¤":ed,"ð¤·":ek,"â
":K.Check,"ð":eG,"âï¸":eO.Settings,"ð":eR,"ð":eR,"ð":O.BarChart3,"ð":eZ.TrendingUp,"ð":eY,"ð¬":eb.MessageCircle,"ð":ej,"ð£":eg,"ð":U.ClipboardList,"ð":ee.FileText,"ð":et,"ð":eW,"ð":eB,"ð":V.BookOpen,"ð":ex.Library,"ð
":W.default,"ð":F,"â³":ec,"â±ï¸":eU.Timer,"â°":z,"ð":eE.RefreshCw,"ð":ez,"ð»":ep,"ð±":eP,"â¨ï¸":eh,"ðª":_,"ð":eI,"ð¥":ea.Flame,"â¡":e5.Zap,"ð¼":D,"ð¢":$.Building2,"ð":X,"ð«":e_,"ð¦":em,"ð§":em,"ð¥":e1.Users,"ð¤":e0,"ð":J.Eye,"âï¸":eC.Pencil,"âï¸":eA.PenLine,"âï¸":ev.Mail,"ð¥":eu.Inbox,"ð":eL,"ð°":e2,"ðµ":R,"ð":ei.GraduationCap,"ð¨":eM,"ð":er,"ð":er,"ð¡":ey,"ð":eJ,"ð¯":eQ.Target,"ð§ ":H,"ð¤":el,"ð¤":P,"ð¨":eV,"ð§":Y,"ð":ef.Lock,"ð":Z,"ðï¸":ew,"ð":eS,"ð±":e$.Sprout,"ð¤©":eD.Sparkles,"â¨":eD.Sparkles,"â":eF,"ð":eF,"âï¸":eT,"âï¸":eK,"ð§¡":eo,"ð«":eq,"ð":eX,"ð¬":G.Clapperboard,"ð":eN.Moon,"â":es,"â ï¸":I.AlertTriangle,"ð":eH,"ð":ek,"ð":en,"ð":en,"ð°":en,"ð¤":T,"ð´":Q.default,"ð¡":Q.default,"ð¤":Q.default,"ðµ":Q.default,"ð¢":Q.default,"circle-red":Q.default,"circle-yellow":Q.default,"circle-green":Q.default,"circle-blue":Q.default,"circle-espresso":Q.default}).map(([e,t])=>[e.replace(/ï¸/g,""),t]));function e6({icon:e,className:t}){if(!e)return null;let a=e8[e.replace(/ï¸/g,"")];return a?(0,r.jsx)(a,{"aria-hidden":!0,strokeWidth:1.75,className:(0,e3.cn)("size-5 shrink-0 text-muted-foreground",t)}):null}function e7({question:e,answer:t,onAnswer:a,onAutoAdvance:n}
1){let i=(0,s.useTranslations)("survey");return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h2",{className:"text-2xl sm:text-3xl text-balance",children:e.title}),e.subtitle&&(0,r.jsx)("p",{className:"text-base sm:text-lg text-muted-foreground leading-relaxed",children:e.subtitle}),e.confidential&&(0,r.jsx)(A.Badge,{variant:"outline",className:"gap-1.5",children:i("confidentialBadge")}),(0,r.jsx)(q.RadioGroup,{value:"string"==typeof t?t:"",onValueChange:e=>{a(e),n&&setTimeout(()=>n(),350)},"aria-label":e.title,children:e.options?.map((e,t)=>(0,r.jsxs)("label",{className:"flex items-center gap-3 rounded-lg border border-border p-4 min-h-11 cursor-pointer transition-colors hover:bg-accent/50 has-[[data-state=checked]]:border-primary has-[[data-state=checked]]:bg-primary/5 has-[[data-state=checked]]:animate-confirm","data-testid":"option","data-value":String(e.value),children:[(0,r.jsx)(q.RadioGroupItem,{value:String(e.value),id:e.id}),(0,r.jsxs)(L.Label,{htmlFor:e.id,className:"flex-1 cursor-pointer text-base leading-snug sm:text-lg",children:[(0,r.jsx)(e6,{icon:e.icon}),e.label]}),t<6&&(0,r.jsx)("span",{className:"keyboard-hint mono-label text-muted-foreground border border-border rounded px-1.5 py-0.5 leading-none","aria-hidden":"true",children:String.fromCharCode(65+t)})]},e.id))})]})}var e9=e.i(793479);function te({question:e,answer:t,onAnswer:a,onAutoAdvance:n}){let i=(0,s.useTranslations)("survey"),l="string"==typeof t?t:"",o=l.startsWith("other:");return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h2",{className:"text-2xl sm:text-3xl text-balance",children:e.title}),e.subtitle&&(0,r.jsx)("p",{className:"text-base sm:text-lg text-muted-foreground leading-relaxed",children:e.subt
1itle}),(0,r.jsx)(q.RadioGroup,{value:o?"__other__":l,onValueChange:e=>{"__other__"===e?a("other:"):(a(e),n&&setTimeout(()=>n(),350))},children:e.options?.map(e=>(0,r.jsxs)("label",{"data-testid":"option","data-value":e.hasOther?"__other__":String(e.value),className:"flex items-center gap-3 rounded-lg border border-border p-4 min-h-11 cursor-pointer transition-colors hover:bg-accent/50 has-[[data-state=checked]]:border-primary has-[[data-state=checked]]:bg-primary/5",children:[(0,r.jsx)(q.RadioGroupItem,{value:e.hasOther?"__other__":String(e.value),id:e.id}),(0,r.jsxs)(L.Label,{htmlFor:e.id,className:"flex-1 cursor-pointer text-base leading-snug sm:text-lg",children:[(0,r.jsx)(e6,{icon:e.icon}),e.label]})]},e.id))}),o&&(0,r.jsx)(e9.Input,{placeholder:i("specifyPlaceholder"),value:l.replace("other:",""),onChange:e=>a(`other:${e.target.value}`),autoFocus:!0,className:"min-h-11"})]})}var tt=e.i(59497);function ta({question:e,answer:t,onAnswer:a}){let n=(0,s.useTranslations)("survey"),i=Array.isArray(t)?t:[],l=e.maxSelections;return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h2",{className:"text-2xl sm:text-3xl text-balance",children:e.title}),e.subtitle&&(0,r.jsx)("p",{className:"text-base sm:text-lg text-muted-foreground leading-relaxed",children:e.subt
1itle}),l&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:n("multiSelectCounter",{max:l,selected:i.length})}),(0,r.jsx)("div",{className:"grid gap-3",role:"group","aria-label":e.title,children:e.options?.map((t,n)=>{let s=i.includes(String(t.value)),o=!s&&!!l&&i.length>=l;return(0,r.jsxs)("label",{className:`flex items-center gap-3 rounded-lg border border-border p-4 min-h-11 cursor-pointer transition-colors hover:bg-accent/50 ${s?"border-primary bg-primary/5 animate-confirm":""} ${o?"opacity-50 cursor-not-allowed":""}`,"data-testid":"option","data-value":String(t.value),children:[(0,r.jsx)(tt.Checkbox,{checked:s,disabled:o,onCheckedChange:()=>(function(t){if(i.includes(t))a(i.filter(e=>e!==t));else{let n=e.options?.find(e=>String(e.value)===t);if(n?.exclusive)return void a([t]);let r=i.filter(t=>{let a=e.options?.find(e=>String(e.value)===t);return!a?.exclusive});if(l&&r.length>=l)return;a([...r,t])}})(String(t.value)),id:t.id}),(0,r.jsxs)(L.Label,{htmlFor:t.id,className:`flex-1 text-base leading-snug sm:text-lg ${o?"cursor-not-allowed":"cursor-pointer"}`,children:[(0,r.jsx)(e6,{icon:t.icon}),t.label]}),n<6&&(0,r.jsx)("span",{className:"keyboard-hint mono-label text-muted-foreground border border-border rounded px-1.5 py-0.5 leading-none","aria-hidden":"true",children:String.fromCharCode(65+n)})]},t.id)})})]})}var tn=e.i(624687);function tr({question:e,answer:t,onAnswer:a}){let n=(0,s.useTranslations)("survey");return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h2",{className:"text-2xl sm:text-3xl text-balance",children:e.title}),e.subtitle&&(0,r.jsx)("p",{className:"text-base sm:text-lg text-muted-foreground leading-relaxed",children:e.subt
1itle}),(0,r.jsx)(tn.Textarea,{value:"string"==typeof t?t:"",onChange:e=>a(e.target.value),"data-testid":"input-text",placeholder:e.placeholder??n("openTextPlaceholder"),rows:4,className:"resize-y min-h-11","aria-describedby":e.hint?`hint-${e.id}`:void 0}),e.hint&&(0,r.jsx)("p",{id:`hint-${e.id}`,className:"text-sm text-muted-foreground italic",children:e.hint})]})}let ti=["360integral","Almacenes El Rey","Amazon","Avon Costa Rica","Bayer","Boston Scientific","Bridgestone","Capital Financial Advisors","Cargill","Coca-Cola","Concentrix","DHL","Dojo Coding","Dole","Edwards Lifesciences","Garnier & Garnier","Hewlett Packard Enterprise (HPE)","Horizontes Nature Experiences","HP Inc.","IBM","INS","Intel","Kimberly-Clark","Microsoft","Pfizer","Procter & Gamble (P&G)","Property Pro S.A.","Roche","Stryker","Thermo Fisher Scientific","Vainilla","We Work CR","Western Union","Zurich"],ts=/\s+(s\s*a\s*s|s\s*a(\s+de\s+c\s*v)?|s\s*r\s*l|ltda|ltd|inc|incorporated|corp|corporation|llc|co|company|sociedad\s+anonima)$/;function tl(e){let t=e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g," ").replace(/\s+/g," ").trim(),a=t,n="";for(;a!==n&&a.length>0;)n=a,a=(a=(function(e){let t=e.match(/^(.*?)\s+costa\s+rica$/);if(t&&!/\bde$/.test(t[1]))return t[1];let a=e.match(/^(.*?)\s+c\s*r$/);return a?a[1]:e})(a).trim()).replace(ts,"").trim();return a.length>0?a:t}function to({question:e,answer:t,onAnswer:a}){let n=(0,s.useTranslations)("survey"),l="string"==typeof t?t:"",o=M(e.id),d=function(e=!0){let[t,a]=(0,i.useState)([]);return(0,i.useEffect)(()=>{if(!e)return;let t=new AbortController;return fetch("/api/company-suggestions",{signal:t.signal}).then(e=>e.ok?e.json():{companies:[]}).then(e=>{Array.isArray(e.companies)&&a(e.companies.filter(e=>"string"==typeof e))}).catch(()=>{}),()=>t.abort()},[e]),(0,i.useMemo)(()=>{let e=new Set,a=[];for(let n of[...ti,...t]){let t=tl(n);!t||e.has(t)||(e.add(t),a.push(n))}return a.sort((e,t)=>e.localeCompare(t,"es")),a},[t])}(!o),[c,u]=(0,i.useState)(!1),[h,m]=(0,i.useState)(-1),p=(0,i.useRef)(null),x=(0,i.useId)(),y=`${x}-title`,f=`${x}-list`,v=(0,i.useMemo)(()=>{let e=tl(l);return d.filter(t=>{let a=tl(t);return!e||a!==e&&a.includes(e)}).slice(0,8)},[l,d]),g=c&&!o&&v.length>0,k=o||g||""===l.trim()||1!==v.length?null:v[0];function b(e){a(e),u(!1),m(-1)}return((0,i.useEffect)(()=>{if(g)return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e);function e(e){p.current?.contains(e.target)||u(!1)}},[g]),(0,i.useEffect)(()=>{g&&!(h<0)&&document.getElementById(`${f}-opt-${h}`)?.scrollIntoView({block:"nearest"})},[h,g,f]),o)?(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h2",{id:y,className:"text-2xl sm:text-3xl text-balance",children:e.title}),(0,r.jsx)(e9.Input,{type:"text","data-testid":"input-text",value:l,readOnly:!0,"aria-readonly":!0,"aria-labelledby":y,autoComplete:"organization",className:"bg-muted text-muted-foreground"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:n("companyNameLocked")})]}):(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h2",{id:y,className:"text-2xl sm:text-3xl text-balance",children:e.title}),e.subtitle&&(0,r.jsx)("p",{className:"text-base sm:text-lg text-muted-foreground leading-relaxed",children:e.subt
1itle}),(0,r.jsxs)("div",{ref:p,className:"relative",children:[(0,r.jsx)(e9.Input,{type:"text","data-testid":"input-text",value:l,onChange:e=>{a(e.target.value),u(!0),m(-1)},onFocus:()=>u(!0),onBlur:()=>u(!1),onKeyDown:function(e){if("ArrowDown"===e.key){if(e.preventDefault(),!g)return void u(!0);m(e=>Math.min(e+1,v.length-1))}else if("ArrowUp"===e.key){if(e.preventDefault(),!g){u(!0),m(v.length-1);return}m(e=>e<=0?v.length-1:e-1)}else"Home"===e.key&&g?(e.preventDefault(),m(0)):"End"===e.key&&g?(e.preventDefault(),m(v.length-1)):"Enter"===e.key?g&&(e.preventDefault(),h>=0&&h<v.length&&b(v[h])):"Escape"===e.key&&g&&(e.preventDefault(),u(!1),m(-1))},placeholder:e.placeholder??n("companyNamePlaceholder"),autoComplete:"off","aria-labelledby":y,role:"combobox","aria-expanded":g,"aria-controls":g?f:void 0,"aria-autocomplete":"list","aria-activedescendant":g&&h>=0?`${f}-opt-${h}`:void 0}),g&&(0,r.jsx)("ul",{id:f,role:"listbox",className:"absolute left-0 right-0 z-20 mt-1 max-h-64 overflow-auto rounded-md border border-border bg-background py-1 shadow-md",children:v.map((e,t)=>(0,r.jsx)("li",{id:`${f}-opt-${t}`,role:"option","aria-selected":t===h,onMouseDown:e=>e.preventDefault(),onClick:()=>b(e),onMouseEnter:()=>m(t),className:`flex min-h-11 cursor-pointer items-center px-3 text-sm ${t===h?"bg-muted":""}`,children:e},e))})]}),k&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:n.rich("didYouMean",{name:k,button:e=>(0,r.jsx)("button",{type:"button",onClick:()=>b(k),className:"font-medium text-foreground underline underline-offset-2 hover:text-primary",children:e})})}),(0,r.jsx)("span",{className:"sr-only",role:"status","aria-live":"polite",children:k?n("suggestionAnnounce",{name:k}):g?n("suggestionsAvailable",{count:v.length}):""})]})}function td({question:e,answer:t,onAnswer:a}){let n=(0,s.useTranslations)("survey");return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h2",{className:"text-2xl sm:text-3xl text-balance",children:e.title}),e.subtitle&&(0,r.jsx)("p",{className:"text-muted-foreground",children:e.subt
1itle}),(0,r.jsxs)(A.Badge,{variant:"outline",className:"gap-1.5",children:[(0,r.jsx)(ef.Lock,{className:"size-3","aria-hidden":!0}),n("confidentialBadge")]}),(0,r.jsx)(tn.Textarea,{value:"string"==typeof t?t:"",onChange:e=>a(e.target.value),"data-testid":"input-text",placeholder:e.placeholder??n("confidentialPlaceholder"),rows:4,className:"resize-y min-h-11"}),e.hint&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground italic",children:e.hint})]})}function tc({question:e,answer:t,onAnswer:a}){let n=(0,s.useTranslations)("survey"),i="number"==typeof t?t:null,l=n("npsNotLikely"),o=n("npsVeryLikely");return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h2",{className:"text-2xl sm:text-3xl text-balance",children:e.title}),e.subtitle&&(0,r.jsx)("p",{className:"text-base sm:text-lg text-muted-foreground leading-relaxed",children:e.subtitle}),(0,r.jsx)("div",{className:"grid grid-cols-6 gap-2 sm:flex sm:flex-wrap sm:justify-center",children:Array.from({length:11},(e,t)=>(0,r.jsx)(f.Button,{variant:i===t?"default":"outline",size:"sm",className:`min-w-11 min-h-11${i===t?" animate-confirm":""}`,"data-testid":"nps-option","data-value":t,onClick:()=>a(t),"aria-pressed":i===t,"aria-label":t<=1?`${t} - ${l}`:t>=9?`${t} - ${o}`:`${t}`,children:t},t))}),(0,r.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground px-1",children:[(0,r.jsx)("span",{children:l}),(0,r.jsx)("span",{children:o})]})]})}function tu({question:e,answer:t,onAnswer:a}){let n=(0,s.useTranslations)("survey"),l="string"==typeof t?t:"",[d,c]=(0,i.useState)(!1),u=!d||""===l||o.test(l);return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h2",{className:"text-2xl sm:text-3xl text-balance",children:e.title}),e.subtitle&&(0,r.jsx)("p",{className:"text-base sm:text-lg text-muted-foreground leading-relaxed",children:e.subt
1itle}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(L.Label,{htmlFor:"email-input",children:n("emailLabel")}),(0,r.jsx)(e9.Input,{id:"email-input","data-testid":"input-email",type:"email",inputMode:"email",autoComplete:"email",value:l,onChange:e=>a(e.target.value),onBlur:()=>c(!0),placeholder:e.placeholder??n("emailPlaceholderExample"),"aria-invalid":!u,className:"min-h-11"}),!u&&(0,r.jsx)("p",{className:"text-sm text-destructive",children:n("invalidEmail")})]}),e.hint&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground italic",children:e.hint}),(0,r.jsxs)("p",{className:"text-xs text-muted-foreground/70 flex items-center gap-1.5",children:[(0,r.jsx)(ef.Lock,{className:"size-3.5 shrink-0","aria-hidden":!0}),n("privacyNotice")]})]})}var th=e.i(407187),tm=e.i(511194),tp=e.i(772436);let tx={hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:.6,ease:"easeInOut"}}};function ty({reduced:e}){return(0,r.jsxs)(th.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",initial:e?"visible":"hidden",animate:"visible","aria-hidden":"true",children:[(0,r.jsx)(th.motion.circle,{cx:"24",cy:"24",r:"21",stroke:"currentColor",strokeWidth:"2",fill:"none",className:"text-primary/30",variants:{hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:.5,ease:"easeOut"}}}}),(0,r.jsx)(th.motion.path,{d:"M15 25L21 31L33 19",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",className:"text-primary",variants:{hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:.4,delay:.4,ease:"easeOut"}}}})]})}function tf({reduced:e}){return(0,r.jsxs)(th.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",initial:e?"visible":"hidden",animate:"visible","aria-hidden":"true",children:[(0,r.jsx)(th.motion.circle,{cx:"20",cy:"16",r:"7",stroke:"currentColor",strokeWidth:"2",fill:"none",className:"text-primary",variants:tx}),(0,r.jsx)(th.motion.path,{d:"M8 40C8 33.4 13.4 28 20 28C23 28 25.7 29.1 27.8 30.9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none",className:"text-primary/60",variants:{hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:.5,delay:.2,ease:"easeOut"}}}}),(0,r.jsx)(th.motion.path,{d:"M32 30L36 34L42 26",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",className:"text-primary",variants:{hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:.35,delay:.5,ease:"easeOut"}}}})]})}function tv({reduced:e}){return(0,r.jsxs)(th.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",initial:e?"visible":"hidden",animate:"visible","aria-hidden":"true",children:[(0,r.jsx)(th.motion.path,{d:"M10 38H38",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"text-primary/30",variants:{hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:.3,ease:"easeOut"}}}}),(0,r.jsx)(th.motion.path,{d:"M10 38V10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"text-primary/30",variants:{hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:.3,ease:"easeOut"}}}}),[{x:15,height:12,delay:.25},{x:22,height:20,delay:.35},{x:29,height:16,delay:.45}].map(e=>(0,r.jsx)(th.motion.rect,{x:e.x,y:38-e.height,width:"5",rx:"1",height:e.height,fill:"currentColor",className:"text-primary",variants:{hidden:{scaleY:0,opacity:0},visible:{scaleY:1,opacity:1,transition:{duration:.4,delay:e.delay,ease:"easeOut"}}},style:{originY:1}},e.x)),(0,r.jsx)(th.motion.path,{d:"M17.5 28L24.5 20L31.5 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",className:"text-gold-accent",variants:{hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:.4,delay:.6,ease:"easeOut"}}}})]})}function tg({reduced:e}){return(0,r.jsxs)(th.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",initial:e?"visible":"hidden",animate:"visible","aria-hidden":"true",children:[(0,r.jsx)(th.motion.path,{d:"M16 10H32V22C32 26.4 28.4 30 24 30C19.6 3
10 16 26.4 16 22V10Z",stroke:"currentColor",strokeWidth:"2",fill:"none",className:"text-primary",variants:tx}),(0,r.jsx)(th.motion.path,{d:"M16 14H12C10.9 14 10 14.9 10 16V18C10 20.2 11.8 22 14 22H16",stroke:"currentColor",strokeWidth:"2",fill:"none",className:"text-primary/50",variants:{hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:.4,delay:.3,ease:"easeOut"}}}}),(0,r.jsx)(th.motion.path,{d:"M32 14H36C37.1 14 38 14.9 38 16V18C38 20.2 36.2 22 34 22H32",stroke:"currentColor",strokeWidth:"2",fill:"none",className:"text-primary/50",variants:{hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:.4,delay:.3,ease:"easeOut"}}}}),(0,r.jsx)(th.motion.path,{d:"M24 30V34M18 38H30M20 34H28",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none",className:"text-primary/60",variants:{hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:.35,delay:.55,ease:"easeOut"}}}})]})}function tk({type:e,reduced:t}){switch(e){case"profile":return(0,r.jsx)(tf,{reduced:t});case"analysis":return(0,r.jsx)(tv,{reduced:t});case"final":return(0,r.jsx)(tg,{reduced:t});default:return(0,r.jsx)(ty,{reduced:t})}}let tb={hidden:{},visible:{transition:{staggerChildren:.15,delayChildren:.1}}},tj={hidden:{opacity:0,y:12},visible:{opacity:1,y:0,transition:{duration:.45,ease:[.25,.1,.25,1]}}};function tw({question:e,onAnswer:t,onAutoAdvance:a}){let n=(0,s.useTranslations)("survey"),l=!!(0,tm.useReducedMotion)(),[o,d]=(0,i.useState)(0),[c,u]=(0,i.useState)(!1),h=e.metadata?.interstitialType,m=(0,i.useCallback)(()=>{!c&&(u(!0),t("continue"),a&&setTimeout(()=>a(),100))},[c,t,a]);return(0,i.useEffect)(()=>{if(c)return;let e=Date.now(),t=setInterval(()=>{let a=Math.min((Date.now()-e)/5e3,1);d(a),a>=1&&(clearInterval(t),m())},50);return()=>clearInterval(t)},[c,m]),(0,r.jsxs)(th.motion.div,{className:"flex flex-col items-center text-center space-y-6 max-w-lg mx-auto",variants:l?void 0:tb,initial:l?"visible":"hidden",animate:"visible",children:[(0,r.jsx)(th.motion.div,{variants:l?void 0:tj,className:"text-primary",children:(0,r.jsx)(tk,{type:h,reduced:l})}),(0,r.jsx)(th.motion.div,{variants:l?void 0:tj,children:(0,r.jsx)(tp.Separator,{className:"w-16 mx-auto"})}),(0,r.jsx)(th.motion.h2,{variants:l?void 0:tj,className:"text-2xl text-foreground",children:e.title}),e.subtitle&&(0,r.jsx)(th.motion.p,{variants:l?void 0:tj,className:"text-muted-foreground text-lg leading-relaxed",children:e.subt
1itle}),e.description&&(0,r.jsx)(th.motion.p,{variants:l?void 0:tj,className:"text-muted-foreground text-sm max-w-md leading-relaxed",children:e.description}),(0,r.jsx)(th.motion.div,{variants:l?void 0:tj,children:(0,r.jsx)(tp.Separator,{className:"w-16 mx-auto"})}),(0,r.jsx)(th.motion.div,{variants:l?void 0:tj,children:(0,r.jsx)(f.Button,{onClick:m,disabled:c,"aria-label":n("continueButton"),"data-testid":"statement-continue",children:n("continueButton")})}),!c&&(0,r.jsxs)(th.motion.div,{className:"w-full max-w-xs",initial:{opacity:0},animate:{opacity:1},transition:{delay:.8*!l,duration:.3},children:[(0,r.jsx)("div",{className:"h-0.5 w-full rounded-full overflow-hidden bg-border/40",role:"progressbar","aria-valuenow":Math.round(100*o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":n("autoAdvanceLabel"),children:(0,r.jsx)(th.motion.div,{className:"h-full bg-primary/40 rounded-full",style:{width:`${100*o}%`},transition:{duration:.05,ease:"linear"}})}),(0,r.jsx)("p",{className:"mono-label text-muted-foreground/60 mt-2",children:n("autoAdvanceCountdown",{seconds:Math.max(Math.ceil((5e3-5e3*o)/1e3),0)})})]})]})}var tN=e.i(164303);function tM({question:e,onAnswer:t,onAutoAdvance:a}){let n=(0,s.useTranslations)("survey"),[l,o]=(0,i.useState)(!1),d=(0,i.useCallback)(()=>{!l&&(o(!0),t("completed"),a&&setTimeout(()=>a(),100))},[l,t,a]);return(0,r.jsxs)("div",{className:"flex flex-col items-center text-center space-y-8",children:[(0,r.jsx)("div",{className:"bg-success/10 text-success flex h-16 w-16 items-center justify-center rounded-full","aria-hidden":"true",children:(0,r.jsx)(K.Check,{className:"h-8 w-8",strokeWidth:2.5})}),(0,r.jsx)("h1",{className:"text-3xl",children:e.title}),e.subtitle&&(0,r.jsx)("p",{className:"text-muted-foreground text-lg",children:e.subt
1itle}),e.description&&(0,r.jsx)("p",{className:"text-muted-foreground text-sm max-w-md",children:e.description}),e.metadata?.showBookingCta?(0,r.jsx)(tN.BookingCTA,{variant:"inline"}):null,(0,r.jsx)("div",{className:"w-full max-w-md space-y-3",children:(0,r.jsx)(f.Button,{onClick:d,disabled:l,"data-testid":"view-results",children:n("viewResults")})})]})}var tS=e.i(284787),tC=e.i(655727);function tA({question:e,answer:t,onAnswer:a}){let n=(0,tS.useLocale)(),i=t&&"object"==typeof t&&!Array.isArray(t)?t:{},s=e.options??[];return(0,r.jsxs)("div",{className:"space-y-4","data-testid":"familiarity-grid",children:[(0,r.jsx)("h2",{className:"text-2xl sm:text-3xl text-balance",children:e.title}),e.subtitle&&(0,r.jsx)("p",{className:"text-base text-muted-foreground",children:e.subtitle}),(0,r.jsx)("div",{className:"space-y-4",children:s.map(e=>(0,r.jsxs)("div",{className:"rounded-lg border border-border p-3","data-testid":"familiarity-term","data-term-id":e.id,children:[(0,r.jsx)("p",{className:"mb-2 font-medium",children:e.label}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:tC.FAMILIARITY_SCALE.map(t=>(0,r.jsx)("button",{type:"button","data-testid":"option","data-value":`${e.id}:${t.value}`,onClick:()=>{var n,r;return n=e.id,r=t.value,void a({...i,[n]:r})},className:`min-h-11 rounded-md border px-2 py-2 text-xs sm:text-sm ${i[e.id]===t.value?"border-primary bg-primary/5":"border-border hover:bg-accent/50"}`,children:"en"===n?t.labelEn:t.label},t.value))})]},e.id))})]})}function tL({question:e,answer:t,onAnswer:a}){let n=Array.isArray(t)?t.map(String):[],l=e.options?.[0],o=p(e=>e.validationErrorKey),d=(0,s.useTranslations)("survey"),c=(0,i.useRef)(null);if((0,i.useEffect)(()=>{if(o&&c.current){let e=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;c.current.scrollIntoView?.({behavior:e?"auto":"smooth",block:"center"})}},[o]),!l)return null;let u=String(l.value),h=n.includes(u),m=`consent-${l.id}`;return(0,r.jsxs)("div",{className:"space-y-4 text-left","data-testid":"consent-screen",children:[(0,r.jsx)("h2",{className:"text-2xl text-balance sm:text-3xl",children:e.title}),(0,r.jsxs)("p",{className:"min-h-11 text-base leading-[1.5] text-foreground",children:[(0,r.jsxs)("label",{htmlFor:m,"data-testid":"option","data-value":u,className:"cursor-pointer",children:[(0,r.jsxs)("span",{className:"relative mr-2 inline-block size-5 translate-y-[2px] align-text-top",children:[(0,r.jsx)("input",{id:m,type:"checkbox",checked:h,onChange:function(){a(h?[]:[u])},className:"peer sr-only"}),(0,r.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none flex size-5 items-center justify-center rounded-[4px] border border-primary/45 bg-background text-primary-foreground transition-colors peer-checked:border-primary peer-checked:bg-primary peer-focus-visible:ring-[3px] peer-focus-visible:ring-ring/50 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-background motion-reduce:transition-none",children:h?(0,r.jsx)("svg",{viewBox:"0 0 16 16",className:"size-3.5",fill:"none","aria-hidden":!0,children:(0,r.jsx)("path",{d:"M3.5 8.5 6.5 11.5 12.5 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null})]}),d("consentBefore")]}),(0,r.jsx)("a",{href:"/privacidad",target:"_blank",rel:"noopener noreferrer","data-testid":"privacy-policy-link","aria-label":d("consentPolicyAria"),onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),className:"rounded-sm text-foreground no-underline underline-offset-2 hover:underline focus-visible:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-2",children:d("consentPolicyLink")}),"."]}),o?(0,r.jsx)("p",{ref:c,className:"animate-shake text-base font-medium text-destructive motion-reduce:animate-none",role:"alert",children:d(o)}):null]})}function tq({value:e,onChange:t}){let a=(0,s.useTranslations)("survey"),n=(0,tS.useLocale)();return(0,r.jsxs)("fieldset",{className:"mt-6 space-y-3","data-testid":"confidence-prompt",children:[(0,r.jsx)("legend",{className:"text-base text-muted-foreground",children:a("confidenceLegend")}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:tC.CONFIDENCE_SCALE.map(a=>(0,r.jsx)("button",{type:"button","data-testid":"confidence-option","data-value":a.value,onClick:()=>
1t(a.value),className:`min-h-11 rounded-lg border px-3 py-2 text-sm transition-colors ${e===a.value?"border-primary bg-primary/5":"border-border hover:bg-accent/50"}`,children:"en"===n?a.labelEn:a.label},a.value))}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:a("confidenceNote")})]})}tC.EMPLOYMENT_DISCLAIMER;let tE=(0,i.memo)(function({question:e,answer:t,onAnswer:a,onAutoAdvance:n}){let i=t?.value,s=e.metadata?.askConfidence===!0,l=s?void 0:n;return(0,r.jsxs)("fieldset",{className:"border-0 p-0 m-0 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-md","data-question-focus":!0,"data-testid":"question","data-qid":e.id,"data-qtype":e.type,"data-item-kind":String(e.metadata?.itemKind??""),tabIndex:-1,children:[(0,r.jsx)("legend",{className:"sr-only",children:e.title}),function(){switch(e.type){case"welcome":return(0,r.jsx)(C,{question:e,answer:i,onAnswer:a,onAutoAdvance:n});case"single_choice":return(0,r.jsx)(e7,{question:e,answer:i,onAnswer:a,onAutoAdvance:l});case"single_choice_other":return(0,r.jsx)(te,{question:e,answer:i,onAnswer:a,onAutoAdvance:l});case"multi_select":return(0,r.jsx)(ta,{question:e,answer:i,onAnswer:a});case"open_text":if("company"===e.autocomplete)return(0,r.jsx)(to,{question:e,answer:i,onAnswer:a});return(0,r.jsx)(tr,{question:e,answer:i,onAnswer:a});case"open_text_confidential":return(0,r.jsx)(td,{question:e,answer:i,onAnswer:a});case"nps":return(0,r.jsx)(tc,{question:e,answer:i,onAnswer:a});case"email":return(0,r.jsx)(tu,{question:e,answer:i,onAnswer:a});case"statement":return(0,r.jsx)(tw,{question:e,answer:i,onAnswer:a,onAutoAdvance:n});case"thank_you":return(0,r.jsx)(tM,{question:e,answer:i,onAnswer:a,onAutoAdvance:n});case"familiarity_grid":return(0,r.jsx)(tA,{question:e,answer:i,onAnswer:a});case"consent":return(0,r.jsx)(tL,{question:e,answer:i,onAnswer:a});default:return e.type}}(),s&&void 0!==i&&(0,r.jsx)(tq,{value:t?.confidence,onChange:e=>a(i,{confidence:e})})]})},(e,t)=>e.question.id===t.question.id&&e.answer?.value===t.answer?.value&&e.answer?.confidence===t.answer?.confidence&&e.onAnswer===t.onAnswer&&e.onAutoAdvance===t.onAutoAdvance);function tz({section:e}){return e?(0,r.jsx)("span",{className:"mono-label text-muted-foreground",children:e}):null}var tI=e.i(864891),tT=e.i(682175),t_=e.i(349154),tB=e.i(642574);let tR={enter:e=>({y:"forward"===e?40:-40,opacity:0}),center:{y:0,opacity:1},exit:e=>({y:"forward"===e?-40:40,opacity:0})},tO={duration:.3};function tV({questionId:e,direction:t,children:a}){return(0,tm.useReducedMotion)()?(0,r.jsx)("div",{children:a},e):(0,r.jsx)(tB.AnimatePresence,{mode:"wait",custom:t,initial:!1,children:(0,r.jsx)(th.motion.div,{custom:t,variants:tR,initial:"enter",animate:"center",exit:"exit",transition:tO,children:a},e)})}function tP({definition:e,initialAnswers:t,initialIndex:a,onComplete:n}){let l=p(e=>e.currentIndex),o=p(e=>e.currentQuestion),d=p(e=>e.currentQuestionNumber),c=p(e=>e.totalQuestions),u=p(e=>e.progress),h=p(e=>e.isComplete),m=p(e=>e.validationErrorKey),x=p(e=>e.answers),y=p(e=>e.initialize),f=p(e=>e.setAnswer),g=p(e=>e.next),b=p(e=>e.back),j=(0,s.useTranslations)("survey"),w=(0,s.useTranslations)("common"),[N,M]=(0,i.useState)("forward"),S=(0,i.useRef)(!1),C=(0,i.useRef)(!1),A=(0,i.useRef)(null),L=(0,i.useRef)(!0);(0,i.useEffect)(()=>{C.current=!1,L.current=!0,y(e,t,a)},[e,t,a,y]),(0,i.useEffect)(()=>{h&&n&&!C.current&&(C.current=!0,n(x))},[h,n,x]),(0,i.useEffect)(()=>{m&&A.current&&A.current.scrollIntoView({behavior:"smooth",block:"center"})},[m]),(0,i.useEffect)(()=>{if(!o)return;if(L.current){L.current=!1;return}let e=setTimeout(()=>{let e=document.querySelector("[data-question-focus]");e?.focus({preventScroll:!1})},350);return()=>clearTimeout(e)},[o]);let q=(0,i.useCallback)(()=>{S.current||(S.current=!0,M("forward"),g(),setTimeout(()=>{S.current=!1},400))},[g]),E=(0,i.useCallback)(()=>{S.current||(S.current=!0,M("back"),b(),setTimeout(()=>{S.current=!1},400))},[b]),z=(0,i.useRef)(0),I=(0,i.useRef)(null);(0,i.useEffect)(()=>{o&&I.current!==o.id&&(I.current=o.id,z.current=Date.now())},[o]);let T=(0,i.useCallback)((e,t)=>{if(!o)return;let a=Date.now()-z.current;f(o.id,e,{timeSpentMs:t?.timeSpentMs??a,confidence:t?.confidence})},[o,f]);if(!o)return null;let _=d===c,B="consent"===o.type,R=["welcome","statement","thank_you","consent"].includes(o.type);return(0,r.jsxs)("form",{onSubmit:e=>e.preventDefault(),className:"flex min-h-[100dvh] flex-col bg-background font-sans","data-testid":"form-runner","data-instrument":String(e.instrumentVersion??e.version??1),children:[(0,r.jsx)("div",{children:(0,r.jsx)(k,{value:u})}),(0,r.jsx)("div",{className:"flex justify-center pt-4",children:(0,r.jsx)(tI.default,{href:"/","aria-label":w("goToHome"),className:"text-primary opacity-80 transition-opacity hover:opacity-100 dark:text-foreground",children:(0,r.jsx)(t_.AvanteLogo,{className:"text-base"})})}),R?null:(0,r.jsx)("span",{className:"sr-only","aria-live":"polite",children:j("questionAnnouncement",{current:d,total:c})}),(0,r.jsx)("main",{id:"main-content",className:(0,e3.cn)("flex flex-1 flex-col items-center px-6","consent"===o.type?"justify-start":"justify-center"),children:(0,r.jsxs)("div",{className:"w-full max-w-2xl space-y-6 py-12",children:[!B&&(0,r.jsx)(tz,{section:e.sections.find(e=>e.id===o.section)?.title??o.section}),R?null:(0,r.jsx)("p",{className:"text-sm text-muted-foreground","aria-label":j("questionAnnouncement",{current:d,total:c}),children:j("questionCounter",{current:d,total:c})}),(0,r.jsx)(tV,{questionId:o.id,direction:N,children:(0,r.jsx)(tE,{question:o,answer:x[o.id],onAnswer:T,onAutoAdvance:q})}),m&&"consent"!==o.type&&(0,r.jsx)("p",{ref:A,className:"animate-shake text-base font-medium text-destructive",role:"alert",children:j(m)})]})}),(0,r.jsx)("nav",{className:"sticky bottom-0 z-10 border-t border-border bg-background/80 backdrop-blur-sm",children:(0,r.jsx)("div",{className:"mx-auto w-full max-w-2xl px-6 py-4",children:(0,r.jsx)(v,{onNext:q,onBack:E,canGoBack:0!==l&&e.settings.allowBack,isLastQuestion:_,isNextDisabled:!1,centerSlot:(0,r.jsx)(tT.AppControl
1s,{})})})})]})}e.s(["FormRunner",()=>tP],991101);var tH=e.i(302747);function tD(){return(0,r.jsxs)("div",{className:"flex min-h-[100dvh] flex-col bg-background",children:[(0,r.jsx)("div",{className:"w-full",children:(0,r.jsx)(tH.Skeleton,{className:"h-1 w-full rounded-none"})}),(0,r.jsx)("main",{className:"flex flex-1 flex-col items-center justify-center px-6",children:(0,r.jsxs)("div",{className:"w-full max-w-2xl space-y-6 py-12",children:[(0,r.jsx)(tH.Skeleton,{className:"h-4 w-32"}),(0,r.jsx)(tH.Skeleton,{className:"h-4 w-16"}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(tH.Skeleton,{className:"h-7 w-3/4"}),(0,r.jsx)(tH.Skeleton,{className:"h-5 w-1/2"})]}),(0,r.jsxs)("div",{className:"mt-8 space-y-3",children:[(0,r.jsx)(tH.Skeleton,{className:"h-12 w-full rounded-lg"}),(0,r.jsx)(tH.Skeleton,{className:"h-12 w-full rounded-lg"}),(0,r.jsx)(tH.Skeleton,{className:"h-12 w-full rounded-lg"}),(0,r.jsx)(tH.Skeleton,{className:"h-12 w-full rounded-lg"})]})]})}),(0,r.jsx)("div",{className:"sticky bottom-0 z-10 border-t border-border bg-background/80",children:(0,r.jsxs)("div",{className:"mx-auto flex w-full max-w-2xl items-center justify-between px-6 py-4",children:[(0,r.jsx)(tH.Skeleton,{className:"h-10 w-24 rounded-md"}),(0,r.jsx)(tH.Skeleton,{className:"h-10 w-24 rounded-md"})]})})]})}e.s(["FormRunnerSkeleton",()=>tD],760832);var t$=i;let tW=(0,E.default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);var tF=e.i(929592);class tK extends t$.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error("[FormErrorBoundary]",e,t)}handleRetry=()=>{this.setState({hasError:!1})};render(){return this.state.hasError?(0,r.jsx)("div",{className:"flex min-h-[100dvh] flex-col items-center justify-center bg-background px-6",children:(0,r.jsxs)("div",{className:"w-full max-w-md",children:[(0,r.jsxs)(tF.Alert,{variant:"destructive",children:[(0,r.jsx)(tW,{className:"h-4 w-4"}),(0,r.jsx)(tF.AlertTitle,{children:"Algo salio mal"}),(0,r.jsx)(tF.AlertDescription,{children:"Ocurrio un error inesperado al cargar la encuesta. Por favor, intente de nuevo."})]}),(0,r.jsx)("div",{className:"mt-6 text-center",children:(0,r.jsx)(f.Button,{onClick:this.handleRetry,children:"Reintentar"})})]})}):this.props.children}}e.s(["FormErrorBoundary",()=>tK],939202);var tQ=e.i(776639),tG=e.i(122839);function tU({variant:e,storageKey:t,definition:a,onContinue:n,onStartFresh:s,onNoSession:l}){var o;let[d,c]=(0,i.useState)(null),[u,h]=(0,i.useState)(!1),m=t??e;if((0,i.useEffect)(()=>{if(!(0,tG.hasExistingSession)(m))return void l();let e=(0,tG.loadSession)(m);if(!e)return void l();let t=a.questions.length;(e.formVersion??1)===a.version&&e.currentIndex>=t-1?l():(c(e),h(!0))},[m,a,l]),!d||!u)return null;let p=a.questions.length,x=(o=d.currentIndex,p<=0?0:Math.round(o/p*100)),y=d.formVersion??1,v=y===a.version;function k(){(0,tG.clearSession)(m,d.sessionId),h(!1),s()}return(0,r.jsx)(tQ.Dialog,{open:u,onOpenChange:e=>{e||k()},children:(0,r.jsxs)(tQ.DialogContent,{showCloseButton:!1,"aria-label":"Sesión anterior encontrada",children:[(0,r.jsxs)(tQ.DialogHeader,{children:[(0,r.jsx)(tQ.DialogTitle,{children:v?"¡Bienvenido de vuelta!":"Actualizamos el diagnóstico"}),(0,r.jsx)(tQ.DialogDescription,{children:v?"Encontramos una sesión guardada. ¿Deseas continuar donde lo dejaste o empezar de nuevo?":`Tu sesi\xf3n corresponde a la versi\xf3n ${y}. La versi\xf3n ${a.version} tiene preguntas y resultados actualizados, por lo que necesitas empezar una sesi\xf3n nueva.`})]}),v&&(0,r.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,r.jsx)(g.Progress,{value:x}),(0,r.jsxs)("span",{className:"mono-label text-muted-foreground text-xs",role:"status","aria-live":"polite",children:[x,"% completado · versión ",a.version]})]}),(0,r.jsxs)(tQ.DialogFooter,{className:"sm:flex-col sm:gap-2",children:[v&&(0,r.jsx)(f.Button,{onClick:function(){h(!1),n(d)},className:"w-full",children:"Continuar donde lo dejaste"}),(0,r.jsx)(f.Button,{variant:"ghost",onClick:k,className:"w-full",children:v?"Empezar de nuevo":"Empezar versión actual"}),(0,r.jsx)(f.Button,{variant:"link",onClick:k,className:"w-full text-muted-foreground",children:"Cancelar"})]})]})})}e.s(["ResumeModal",()=>tU],561485);let tY=["analyzingStep1","analyzingStep2","analyzingStep3","analyzingStep4","analyzingStep5"].map(e=>({key:e})),tZ={hidden:{opacity:0,y:12},visible:{opacity:1,y:0}},tJ={hidden:{scale:0,opacity:0}
1,visible:{scale:1,opacity:1}};function tX(){return(0,r.jsxs)("svg",{className:"h-5 w-5 animate-spin text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}function t0({onComplete:e,waitingForSync:t=!1}){let a=(0,s.useTranslations)("survey"),n=(0,tm.useReducedMotion)(),[l,o]=(0,i.useState)(0),[d,c]=(0,i.useState)(0),u=(0,i.useRef)(!1);(0,i.useEffect)(()=>{let e=900*tY.length,t=0,a=setInterval(()=>{let n=Math.min((t+=50)/e*100,100);c(n),n>=100&&clearInterval(a)},50);return()=>clearInterval(a)},[]),(0,i.useEffect)(()=>{if(l>=tY.length)return;let e=setTimeout(()=>{o(e=>e+1)},900);return()=>clearTimeout(e)},[l]),(0,i.useEffect)(()=>{if(l<tY.length||u.current)return;let t=setTimeout(()=>{u.current=!0,e()},600);return()=>clearTimeout(t)},[l,e]);let h=tY.slice(0,l+1);return(0,r.jsx)("div",{className:"flex min-h-[100dvh] flex-col items-center justify-center bg-background px-6",role:"status","aria-live":"polite","aria-label":a("analyzingTitle"),"data-testid":"analyzing-screen",children:(0,r.jsxs)("div",{className:"w-full max-w-md
1space-y-10",children:[(0,r.jsxs)("div",{className:"space-y-3 text-center",children:[(0,r.jsx)("h2",{className:"text-2xl text-foreground sm:text-3xl",children:a("analyzingTitle")}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:a("analyzingSubtitle")})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(g.Progress,{value:d,className:"h-2"}),(0,r.jsxs)("p",{className:"text-right text-xs text-muted-foreground tabular-nums",children:[Math.round(d),"%"]}),t&&(0,r.jsx)("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:a("analyzingSaving")})]}),(0,r.jsx)("ul",{className:"space-y-4","aria-label":a("analyzingStepsAria"),children:(0,r.jsx)(tB.AnimatePresence,{initial:!1,children:h.map((e,t)=>{let i=t<l,s=t===l&&l<tY.length;return(0,r.jsxs)(th.motion.li,{variants:n?void 0:tZ,initial:n?void 0:"hidden",animate:n?void 0:"visible",transition:{duration:.3,ease:"easeOut"},className:"flex items-center gap-3",children:[(0,r.jsx)("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center",children:i?(0,r.jsx)(th.motion.span,{variants:n?void 0:tJ,initial:n?void 0:"hidden",animate:n?void 0:"visible",transition:{type:"spring",stiffness:300,damping:20},className:"flex h-6 w-6 items-center justify-center rounded-full bg-success text-success-foreground","aria-label":"Completado",children:(0,r.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}):s?(0,r.jsx)(tX,{}):null}),(0,r.jsx)("span",{className:i?"text-sm text-foreground":"text-sm text-muted-foreground",children:a(e.key)})]},e.key)})})}),(0,r.jsx)("div",{className:"divider-gold"}),(0,r.jsx)("p",{className:"text-center text-xs leading-relaxed text-muted-foreground",children:a("socialProof")}
1)]})})}function t1(e,t,a=1){let n=(0,i.useRef)(null),r=(0,i.useRef)(null);(0,i.useEffect)(()=>{let i=p.getState();n.current=i.answers,r.current=i.currentIndex;let s=p.subscribe(i=>{let s=n.current,l=r.current,o=i.answers!==s,d=i.currentIndex!==l;if(!o&&!d)return;let c={sessionId:t,variant:e,formVersion:a,answers:i.answers,currentIndex:i.currentIndex,email:i.email,startedAt:i.startedAt?.toISOString()??"",updatedAt:new Date().toISOString()};d?(0,tG.forceSave)(e,t,c):o&&(0,tG.saveSession)(e,t,c),n.current=i.answers,r.current=i.currentIndex}),l=()=>{(0,tG.flushPendingWrites)()};return window.addEventListener("beforeunload",l),()=>{s(),window.removeEventListener("beforeunload",l)}},[e,t,a])}e.s(["AnalyzingScreen",()=>t0],868590),e.s(["useFormPersistence",()=>t1],372673);var t2=e.i(623692);let t4=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];function t5(e){return window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}}function t3(){return navigator.onLine}function t8(){return!0}function t6(e){return(0,t2.subscribeSyncStatus)(()=>e())}function t7(){return(0,t2.getSyncStatus)()}function t9(){return"idle"}let ae=new Set(["welcome","statement","thank_you"]);function at(e){if(!e.definition)return e.answers;let t=new Set(e.definition.questions.filter(e=>!ae.has(e.type)).map(e=>e.id)??[]);
1return Object.fromEntries(Object.entries(e.answers).filter(([e])=>t.has(e)))}function aa(e,t,a){let n=(0,i.useRef)(null),[r,s]=(0,i.useState)(!1),[l,o]=(0,i.useState)(null),d=(0,i.useRef)(!1),c=(0,i.useRef)(function(){let e=new URLSearchParams(window.location.search),t={},a=!1;for(let n of t4){let r=e.get(n);r&&(t[n]=r,a=!0)}return a?t:void 0}()),u=(0,i.useRef)(new Map),h=(0,i.useRef)(!1),m=(0,i.useRef)(null),x=(0,i.useRef)(null),y=(0,i.useSyncExternalStore)(t5,t3,t8),f=(0,i.useSyncExternalStore)(t6,t7,t9),v=(0,i.useCallback)(e=>{let t=u.current;if(t.size>0){for(let[,{questionId:a,value:n}]of(console.info(`[useSupabaseSync] Session ready â flushing ${t.size} early answers`),t))(0,t2.syncAnswer)(e,a,n);t.clear(),x.current&&((0,t2.syncSessionEmail)(e,x.current),x.current=null)}if(h.current){h.current=!1;let t=p.getState();console.info("[useSupabaseSync] Session ready â executing deferred completion"),m.current=(0,t2.completeRemoteSession)(e,at(t)),m.current.catch(e=>{console.error("[useSupabaseSync] deferred completeRemoteSession error:",e)})}},[]);return(0,i.useEffect)(()=>{let r=a=>{d.current=!0,s(!0);let r=p.getState().definition,i=t??r?.instrumentVersion??r?.version;(0,t2.createRemoteSession)(e,a,i,c.current,r?.wrapper).then(e=>{e&&(n.current=e.sessionId,o(e.sessionId),v(e.sessionId))}).catch(e=>{console.error("[useSupabaseSync] session creation error:",e)}).finally(()=>{s(!1)})},i=p.subscribe((e,t)=>{if(!e.email||e.email===t.email)return;let i=n.current;i?(0,t2.syncSessionEmail)(i,e.email):void 0!==a||d.current?x.current=e.email:r(e.email)});!0!==a||d.current||r(p.getState().email||void 0);let{email:l}=p.getState();return void 0===a&&l&&!d.current&&r(l),i},[e,t,a,v]),(0,i.useEffect)(()=>{let e=p.subscribe((e,t)=>{if(e.answers!==t.answers)for(let[a,r]of Object.entries(e.answers
1)){if(e.definition){let t=e.definition.questions.find(e=>e.id===a);if(!t||ae.has(t.type))continue}let i=t.answers[a];if(!i||i.revision!==r.revision){let e=n.current;e?(0,t2.syncAnswer)(e,a,r.value):u.current.set(a,{questionId:a,value:r.value})}}}),t=()=>{let e=n.current;if(!e||"function"!=typeof navigator.sendBeacon)return;let t=p.getState(),a=JSON.stringify({sessionId:e,sessionToken:(0,t2.getSessionToken)(),answers:at(t)});navigator.sendBeacon("/api/sessions/sync-beacon",a)};return window.addEventListener("beforeunload",t),()=>{e(),window.removeEventListener("beforeunload",t)}},[]),(0,i.useEffect)(()=>p.subscribe((e,t)=>{let a=n.current;a&&e.currentIndex!==t.currentIndex&&(0,t2.syncProgress)(a,e.currentIndex)}),[]),(0,i.useEffect)(()=>p.subscribe((e,t)=>{if(!e.isComplete||e.isComplete===t.isComplete)return;let a=n.current;if(!a){console.warn("[useSupabaseSync] isComplete fired but no remote session â deferring"),h.current=!0;return}m.current=(0,t2.completeRemoteSession)(a,at(e)),m.current.catch(e=>{console.error("[useSupabaseSync] completeRemoteSession error:",e)})}),[]),(0,i.useEffect)(()=>{let e=()=>{console.info("[useSupabaseSync] Back online â flushing pending sync queue"),(0,t2.flushOfflineQueue)(),(0,t2.flushOfflineProgress)()};return window.addEventListener("online",e),()=>{window.removeEventListener("online",e)}},[]),{remoteSessionId:l,isCreatingSession:r,syncStatus:f,isOnline:y,waitForCompletion:(0,i.useCallback)(async()=>{if(m.current||h.current){if(h.current&&!m.current){let e=Date.now()+8e3;for(;h.current&&!m.current&&Date.now()<e;)await new Promise(e=>setTimeout(e,200))}m.current&&await Promise.race([m.current,new Promise(e=>setTimeout(e,8e3))])}},[])}}e.s(["useSupabaseSync",()=>aa],723733),e.i(109056),e.i(363121),e.i(122848),e.i(931055),e.i(152293),e.s([],618351)}]);
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.