1import{u as L,r as B,ae as o,j as e,af as h,aH as O,y as M,bL as J,ar as R,Y as $}from"./vendor-react-CSjVeD5C.js";import{u as D,t as l,B as d,C as U,j as G,k as z,w as _,i as Q}from"./index-DCu_4ttF.js";import{B as f}from"./badge-q_8Hkdab.js";import"./vendor-misc-DNIZ_o8-.js";import"./vendor-ui-BQCqNqg0.js";import"./vendor-charts-CTZ3m9kf.js";import"./vendor-ai-CwA6B3_0.js";const q=[{label:"Analysts",color:"purple",types:["INTJ","INTP","ENTJ","ENTP"]},{label:"Diplomats",color:"emerald",types:["INFJ","INFP","ENFJ","ENFP"]},{label:"Sentinels",color:"blue",types:["ISTJ","ISFJ","ESTJ","ESFJ"]},{label:"Explorers",color:"amber",types:["ISTP","ISFP","ESTP","ESFP"]}],H={Analysts:"from-purple-500/20 to-purple-900/10 border-purple-500/30",Diplomats:"from-emerald-500/20 to-emerald-900/10 border-emerald-500/30",Sentinels:"from-blue-500/20 to-blue-900/10 border-blue-500/30",Explorers:"from-amber-500/20 to-amber-900/10 border-amber-500/30"},Y={Analysts:"bg-purple-500/20 text-purple-300 border-purple-500/40",Diplomats:"bg-emerald-500/20 text-emerald-300 border-emerald-500/40",Sentinels:"bg-blue-500/20 text-blue-300 border-blue-500/40",Explorers:"bg-amber-500/20 text-amber-300 border-amber-500/40"};function se(){D();const[,u]=L(),[v,w]=B.useState(null),y=l.useUtils(),C=typeof window<"u"?localStorage.getItem("selectedCharacterId"):null,T=new URLSearchParams(window.location.search),x=parseInt(T.get("characterId")||C||"0"),{data:I}=l.character.list.useQuery(void 0,{enabled:x===0}),s=x>0?x:I?.[0]?.id??0,{data:m,isLoading:P}=l.mbti.list.useQuery(),{data:S,isLoading:E}=l.mbti.getActive.useQuery({characterId:s},{enabled:s>0}),p=l.mbti.select.useMutation({onSuccess:t=>{o.success(`Personality set to ${t.mbtiTypeCode}`),y.mbti.getActive.invalidate({characterId:s})},onError:t=>{o.error(t.message)}}),b=l.mbti.clear.useMutation({onSuccess:()=>{o.success("Personality cleared â using default persona"),y.mbti.getActive.invalidate({characterId:s})}}),k=t=>{if(!s){o.error("No character selected");return}p.mutate({characterId:s,mbtiTypeCode:t})},A=()=>{s&&b.mutate({characterId:s})};if(P||E)return e.jsx("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:107",className:"flex items-center justify-center min-h-[60vh]",children:e.jsx(h,{"data-loc":"client/src/pages/MbtiSelection.tsx:108",className:"w-8 h-8 animate-spin text-cyan-400"})});const g=S?.personality?.typeCode||null;return e.jsx("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:116",className:"min-h-screen bg-gradient-to-b from-gray-950 via-gray-900 to-gray-950 p-4 sm:p-6",children:e.jsxs("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:117",className:"max-w-6xl mx-auto",children:[e.jsxs("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:119",className:"flex items-center gap-4 mb-6",children:[e.jsx(d,{"data-loc":"client/src/pages/MbtiSelection.tsx:120",variant:"ghost",size:"icon",onClick:()=>window.history.length>1?window.history.back():u("/"),className:"text-gray-400 hover:text-white",children:e.jsx(O,{"data-loc":"client/src/pages/MbtiSelection.tsx:126",className:"w-5 h-5"})}),e.jsxs("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:128",className:"flex-1",children:[e.jsxs("h1",{"data-loc":"client/src/pages/MbtiSelection.tsx:129",className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(M,{"data-loc":"client/src/pages/MbtiSelection.tsx:130",className:"w-6 h-6 text-cyan-400"}),"Personality Type"]}),e.jsx("p",{"data-loc":"client/src/pages/MbtiSelection.tsx:133",className:"text-gray-400 text-sm mt-1",children:"Choose how your companion thinks, feels, and communicates"})]})]}),e.jsx("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:140",className:"mb-6 p-4 rounded-lg bg-gradient-to-r from-violet-500/10 via-fuchsia-500/10 to-cyan-500/10 border border-violet-500/20",children:e.jsxs("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:141",className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:142",className:"flex items-center gap-3",children:[e.jsx(J,{"data-loc":"client/src/pages/MbtiSelection.tsx:143",className:"w-5 h-5 text-violet-400"}),e.jsxs("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:144",children:[e.jsx("p",{"data-loc":"client/src/pages/MbtiSelection.tsx:145",className:"text-white font-medium text-sm",children:"Not sure which type fits?"}),e.jsx("p",{"data-loc":"client/src/pages/MbtiSelection.tsx:146",className:"text-gray-400 text-xs",children:"Take a quick 20-question test to discover your personality type"})]})]}),e.jsx(d,{"data-loc":"client/src/pages/MbtiSelection.tsx:149",onClick:()=>u(`/personality-test${s?`?characterId=${s}`:""}`),className:"bg-violet-600 hover:bg-violet-500 text-white text-sm",size:"sm",children:"Take the Test"})]})}),g&&e.jsx("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:161",className:"mb-6 p-4 rounded-lg bg-cyan-500/10 border border-cyan-500/30",children:e.jsxs("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:162",className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:163",children:[e.jsx("p",{"data-loc":"client/src/pages/MbtiSelection.tsx:164",className:"text-cyan-300 text-sm font-medium",children:"Currently Active"}),e.jsxs("p",{"data-loc":"client/src/pages/MbtiSelection.tsx:165",className:"text-white text-lg font-bold",children:[g," â ",S?.personality?.label]})]}),e.jsx(d,{"data-loc":"client/src/pages/MbtiSelection.tsx:169",variant:"outline",size:"sm",onClick:A,disabled:b.isPending,className:"border-cyan-500/40 text-cyan-300 hover:bg-cyan-500/20",children:b.isPending?e.jsx(h,{"data-loc":"client/src/pages/MbtiSelection.tsx:176",className:"w-4 h-4 animate-spin"}):"Reset to Default"})]})}),(!m||m.length===0)&&e.jsxs("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:184",className:"text-center py-16",children:[e.jsx(M,{"data-loc":"client/src/pages/MbtiSelection.tsx:185",className:"w-12 h-12 text-gray-600 mx-auto mb-4"}),e.jsx("p",{"data-loc":"client/src/pages/MbtiSelection.tsx:186",className:"text-gray-400 text-lg",children:"No personality types available yet"}),e.jsx("p",{"data-loc":"client/src/pages/MbtiSelection.tsx:187",className:"text-gray-500 text-sm mt-1",children:"Ask an admin to seed the MBTI data"})]}),q.map(t=>{const N=t.types.map(a=>m?.find(c=>
1c.typeCode===a)).filter(Boolean);return N.length===0?null:e.jsxs("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:199",className:"mb-8",children:[e.jsx("h2",{"data-loc":"client/src/pages/MbtiSelection.tsx:200",className:"text-lg font-semibold text-gray-300 mb-3 flex items-center gap-2",children:e.jsx(f,{"data-loc":"client/src/pages/MbtiSelection.tsx:201",className:`${Y[t.label]} border text-xs`,children:t.label})}),e.jsx("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:205",className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:N.map(a=>{const c=a.typeCode,i=g===c,r=a.isEnabledForUsers,j=v===c;return e.jsxs(U,{"data-loc":"client/src/pages/MbtiSelection.tsx:213",className:`relative cursor-pointer transition-all duration-200 border bg-gradient-to-br ${H[t.label]} ${i?"ring-2 ring-cyan-400 shadow-lg shadow-cyan-500/20":r?"hover:scale-[1.02] hover:shadow-md":"opacity-60"}`,onClick:()=>w(j?null:c),children:[e.jsxs(G,{"data-loc":"client/src/pages/MbtiSelection.tsx:224",className:"pb-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:225",className:"flex items-center justify-between",children:[e.jsx(z,{"data-loc":"client/src/pages/MbtiSelection.tsx:226",className:"text-white text-base font-bold",children:c}),i&&e.jsx(R,{"data-loc":"client/src/pages/MbtiSelection.tsx:230",className:"w-5 h-5 text-cyan-400"}),!r&&!i&&e.jsx($,{"data-loc":"client/src/pages/MbtiSelection.tsx:233",className:"w-4 h-4 text-gray-500"})]}),e.jsx(_,{"data-loc":"client/src/pages/MbtiSelection.tsx:236",className:"text-gray-300 text-sm font-medium",children:a.label})]}),e.jsxs(Q,{"data-loc":"client/src/pages/MbtiSelection.tsx:240",className:"pt-0",children:[e.jsx("p",{"data-loc":"client/src/pages/MbtiSelection.tsx:241",className:"text-gray-400 text-xs leading-relaxed line-clamp-3",children:a.description}),j&&e.jsxs("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:247",className:"mt-3 pt-3 border-t border-white/10",children:[e.jsx("p",{"data-loc":"client/src/pages/MbtiSelection.tsx:248",className:"text-gray-300 text-xs leading-relaxed mb-3",children:a.behavioralGuidance}),e.jsx("div",{"data-loc":"client/src/pages/MbtiSelection.tsx:252",className:"flex flex-wrap gap-1 mb-3",children:Object.entries(a.traitOverrides||{}).slice(0,5).map(([n,F])=>e.jsxs(f,{"data-loc":"client/src/pages/MbtiSelection.tsx:254",variant:"outline",className:"text-[10px] border-white/20 text-gray-400",children:[n.replace(/([A-Z])/g," $1").trim(),": ",F]},n))}),r&&!i&&e.jsx(d,{"data-loc":"client/src/pages/MbtiSelection.tsx:264",size:"sm",onClick:n=>{n.stopPropagation(),k(c)},disabled:p.isPending,className:"w-full bg-cyan-600 hover:bg-cyan-500 text-white",children:p.isPending?e.jsx(h,{"data-loc":"client/src/pages/MbtiSelection.tsx:274",className:"w-4 h-4 animate-spin"}):"Select This Type"}),!r&&e.jsx("p",{"data-loc":"client/src/pages/MbtiSelection.tsx:281",className:"text-center text-gray-500 text-xs",children:"Coming Soon"})]})]})]},c)})})]},t.label)})]})})}export{se as default};
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.