1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[9796],{9796(e,t,l){l.r(t),l.d(t,{default:()=>A});var s=l(7224),a=l(9950),r=l(7119),i=l(6805),d=l(6624),o=l(6859),n=l(8276),c=l(5952),x=l(3971),m=l(2263),h=l(6274),u=l(6149),p=l(6479),b=l(5692),v=l(9401),f=l(298),g=l(6904),j=l(4414);const k={total_dials:x.A,streak:d.A,appointments:h.A,practice:c.A,pipeline:i.A,hot_handler:b.A,streak_legend:m.A},w={Rookie:"from-slate-400 to-slate-500",Caller:"from-green-400 to-green-600",Connector:"from-blue-400 to-blue-600",Closer:"from-purple-400 to-purple-600",Expert:"from-amber-400 to-amber-600",Master:"from-red-400 to-red-600",Legend:"from-yellow-400 to-yellow-600"};function y(e){return e.unlocked_tier>=e.max_tier?"#f59e0b":e.unlocked_tier>0?"#14b8a6":"#94a3b8"}const N=[{id:"total_dials",name:"Dial Master",Icon:x.A,color:"#3B82F6",short:"Log call outcomes from your lead queue.",detail:"Each completed outcome log counts as one dial toward tier targets (10 \u2192 250)."},{id:"appointments",name:"Spotlight Ace",Icon:h.A,color:"#10B981",short:"Book real appointments.",detail:"Use the connected appointment outcome when you schedule a showing or meeting."},{id:"streak",name:"Daily Driver",Icon:d.A,color:"#F97316",short:"Stay consistent day to day.",detail:"Log at least one call per UTC calendar day, counting back from today. Miss a day and your streak resets."},{id:"practice",name:"Training Champion",Icon:c.A,color:"#8B5CF6",short:"Complete Practice Mode sessions.",detail:"Finish scored practice calls (not abandoned early) to climb from First Practice up to Training Master."}];function _(e){let{open:t,onClose:l}=e;return(0,a.useEffect)(()=>{if(!t)return;const e=e=>{"Escape"===e.key&&l()};window.addEventListener("keydown",e);const s=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",e),document.body.style.overflow=s}},[t,l]),t&&"undefined"!==typeof document?(0,r.createPortal)((0,j.jsxs)("div",{className:"fixed inset-0 z-[12000] flex items-center justify-center p-4 sm:p-6",role:"dialog","aria-modal":"true","aria-labelledby":"badge-guide-title","data-testid":"badge-guide-modal",children:[(0,j.jsx)("button",{type:"button",className:"absolute inset-0 bg-black/55 backdrop-blur-[1px] dark:bg-black/70","aria-label":"Close guide",onClick:l}),(0,j.jsxs)("div",{className:"relative z-10 flex max-h-[min(90vh,640px)] w-full max-w-lg flex-col overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-2xl dark:border-white/10 dark:bg-slate-900",children:[(0,j.jsxs)("div",{className:"flex shrink-0 items-start justify-between gap-3 border-b border-slate-100 px-5 py-4 dark:border-white/[0.08]",children:[(0,j.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,j.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-violet-100 text-violet-700 dark:bg-violet-500/20 dark:text-violet-200",children:(0,j.jsx)(o.A,{size:20,strokeWidth:2.25,"aria-hidden":!0})}),(0,j.jsxs)("div",{className:"min-w-0",children:[(0,j.jsx)("h2",{id:"badge-guide-title",className:"font-heading text-lg font-bold text-slate-900 dark:text-white",children:"How to earn badges"}),(0,j.jsx)("p",{className:"mt-0.5 text-xs text-slate-500 dark:text-slate-400",children:"Four tracks \u2014 tier up as you hit each target. Dots on your cards show cleared tiers."})]})]}),(0,j.jsx)("button",{type:"button",onClick:l,className:"rounded-lg p-2 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-white/10 dark:hover:text-white","aria-label":"Close",children:(0,j.jsx)(p.A,{size:20})})]}),(0,j.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 py-4",children:[(0,j.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:gap-4",children:N.map(e=>{let{id:t,name:l,Icon:s,color:a,short:r,detail:i}=e;return(0,j.jsxs)("div",{className:"flex flex-col items-center rounded-xl border border-slate-100 bg-slate-50/80 p-3 text-center dark:border-white/[0.06] dark:bg-white/[0.04]",children:[(0,j.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full shadow-md ring-2 ring-white/30 dark:ring-black/20",style:{background:"radial-gradient(circle at 32% 32%, ".concat(a,"dd, ").concat(a,")"),boxShadow:"0 4px 14px ".concat(a,"55")}
1,"aria-hidden":!0,children:(0,j.jsx)(s,{size:30,color:"#fff",strokeWidth:1.75})}),(0,j.jsx)("p",{className:"mt-2.5 text-xs font-bold text-slate-900 dark:text-white",children:l}),(0,j.jsx)("p",{className:"mt-1 text-[10px] font-medium leading-snug text-slate-600 dark:text-slate-300",children:r}),(0,j.jsx)("p",{className:"mt-2 text-[10px] leading-snug text-slate-500 dark:text-slate-400",children:i})]},t)})}),(0,j.jsxs)("div",{className:"mt-5 rounded-xl border border-violet-100 bg-violet-50/60 px-3 py-3 dark:border-violet-500/20 dark:bg-violet-950/30",children:[(0,j.jsx)("p",{className:"text-[11px] font-semibold text-violet-950 dark:text-violet-100",children:"XP & levels"}),(0,j.jsx)("p",{className:"mt-1 text-[10px] leading-relaxed text-violet-900/90 dark:text-violet-200/90",children:"Your XP bar also grows from calls, appointments, practice, and streak. Leveling is separate from badge tiers \u2014 keep dialing and practicing to move both forward."})]})]}),(0,j.jsx)("div",{className:"shrink-0 border-t border-slate-100 px-5 py-3 dark:border-white/[0.08]",children:(0,j.jsx)("button",{type:"button",onClick:l,className:"w-full rounded-xl bg-slate-900 py-2.5 text-sm font-semibold text-white hover:bg-slate-800 dark:bg-violet-600 dark:hover:bg-violet-500",children:"Got it"})})]})]}),document.body):null}function A(){var e,t,l,r,i,d,c,x,m;const[h,p]=(0,a.useState)(!1),[N,A]=(0,a.useState)(null),[C,z]=(0,a.useState)(!0),[S,M]=(0,a.useState)(null),[E,T]=(0,a.useState)([]),[L,R]=(0,a.useState)(!1),[F,P]=(0,a.useState)(null),B=(0,a.useRef)(null);if((0,a.useEffect)(()=>{v.default.getCreditRules().then(e=>{T((null===e||void 0===e?void 0:e.rules)||[])}).catch(()=>{}),v.default.getAchievements().then(e=>{if(B.current&&null!==e&&void 0!==e&&e.achievements){const l=B.current.achievements||[];for(const s of e.achievements){const e=l.find(e=>e.id===s.id);if(e&&s.unlocked_tier>e.unlocked_tier){var t;const e=null===(t=s.tiers)||void 0===t?void 0:t[s.unlocked_tier-1];P({name:s.name,tier:(null===e||void 0===e?void 0:e.label)||"Tier ".concat(s.unlocked_tier),color:y(s)}),R(!0);break}}}B.current=e,A(e)}).catch(e=>{console.error(e),M(e)}).finally(()=>z(!1))},[]),C)return(0,j.jsx)(s.A,{});if(!N)return S?(0,j.jsx)(f.A,{onRetry:()=>window.location.reload(),title:"Could not load your achievements"}):null;const D=w[null===(e=N.level)||void 0===e?void 0:e.title]||w.Rookie,I=(null===(t=N.next_level)||void 0===t?void 0:t.xp_needed)||0,X=N.next_level?Math.min(100,Math.round((N.xp-((null===(l=N.level)||void 0===l?void 0:l.threshold)||0))/(I+(N.xp-((null===(r=N.level)||void 0===r?void 0:r.threshold)||0)))*100)):100;return(0,j.jsxs)("div",{"data-testid":"achievements-panel",className:"flex-1 space-y-6",children:[(0,j.jsxs)("div",{className:"bg-gradient-to-r ".concat(D," rounded-2xl p-6 text-white relative overflow-hidden"),children:[(0,j.jsx)("div",{className:"absolute right-4 top-4 opacity-10",children:(0,j.jsx)(u.A,{size:80})}),(0,j.jsxs)("div",{className:"relative z-10",children:[(0,j.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,j.jsx)(u.A,{size:24}),(0,j.jsxs)("div",{children:[(0,j.jsx)("p",{className:"text-white/70 text-xs uppercase tracking-wider",children:"Current Level"}),(0,j.jsx)("p",{className:"font-heading font-bold text-2xl",children:null===(i=N.level)||void 0===i?void 0:i.title})]})]}),(0,j.jsx)("p",{className:"text-white/80 text-sm mb-3",children:null===(d=N.level)||void 0===d?void 0:d.description}),(0,j.jsxs)("div",{className:"flex items-center gap-3",children:[(0,j.jsxs)("span",{className:"text-sm font-bold",children:[N.xp," XP"]}),(0,j.jsx)("div",{className:"flex-1 h-2.5 bg-white/20 rounded-full overflow-hidden",children:(0,j.jsx)("div",{className:"h-full bg-white/80 rounded-full transition-all duration-1000",style:{width:"".concat(X,"%")}})}),N.next_level&&(0,j.jsxs)("span",{className:"text-xs text-white/60",children:[N.next_level.xp_needed," to ",N.next_level.title]})]}),(0,j.jsxs)("div",{className:"grid grid-cols-3 gap-4 mt-4 pt-4 border-t border-white/20",children:[(0,j.jsxs)("div",{children:[(0,j.jsx)("p",{className:"text-2xl font-bold",children:(null===(c=N.stats)||void 0===c?void 0:c.total_calls)||0}),(0,j.jsx)("p",{className:"text-[10px] text-white/60 uppercase",children:"Calls"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("p",{className:"text-2xl font-bold",children:(null===(x=N.stats)||void 0===x?void 0:x.appointments)||0}),(0,j.jsx)("p",{className:"text-[10px] text-white/60 uppercase",children:"Appointments"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("p",{className:"text-2xl font-bold",children:N.streak||0}),(0,j.jsx)("p",{className:"text-[10px] text-white/60 uppercase",children:"Day Streak"})]})]})]})]}),(0,j.jsxs)("div",{children:[(0,j.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[(0,j.jsx)("h3",{className:"font-heading font-semibold text-lg text-kw-dark dark:text-white",children:"Achievements"}),(0,j.jsxs)("button",{type:"button",onClick:()=>p(!0),className:"inline-flex items-center gap-1.5 rounded-lg border border-violet-200 bg-vi
1olet-50 px-3 py-1.5 text-xs font-semibold text-violet-900 hover:bg-violet-100 dark:border-violet-500/30 dark:bg-violet-950/40 dark:text-violet-100 dark:hover:bg-violet-900/50","data-testid":"open-badge-guide",children:[(0,j.jsx)(o.A,{size:14,"aria-hidden":!0}),"Badge guide"]})]}),(0,j.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:null===(m=N.achievements)||void 0===m?void 0:m.map(e=>{var t;const l=k[e.id]||u.A,s=e.unlocked_tier>=e.max_tier;return(0,j.jsx)("div",{"data-testid":"achievement-".concat(e.id),className:"bg-white rounded-xl border p-4 transition-all ".concat(s?"border-amber-200 bg-amber-50/30":e.unlocked_tier>0?"border-slate-200":"border-slate-100 opacity-70"),children:(0,j.jsxs)("div",{className:"flex items-start gap-3",children:[(0,j.jsx)("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ".concat(s?"bg-amber-100":e.unlocked_tier>0?"bg-teal-100":"bg-slate-100"),children:(0,j.jsx)(l,{size:18,className:s?"text-amber-600":e.unlocked_tier>0?"text-teal-600":"text-slate-400"})}),(0,j.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,j.jsx)("p",{className:"font-semibold text-sm text-kw-dark",children:e.name}),(0,j.jsxs)("p",{className:"text-[10px] text-slate-500 mb-2",children:[e.current," / ",e.next_target," \u2014 Tier ",e.unlocked_tier,"/",e.max_tier]}),(0,j.jsx)("div",{className:"w-full h-1.5 bg-slate-100 rounded-full overflow-hidden mb-2",children:(0,j.jsx)("div",{className:"h-full rounded-full transition-all duration-700 ".concat(s?"bg-amber-400":"bg-teal-400"),style:{width:"".concat(e.progress_pct,"%")}})}),(0,j.jsx)("div",{className:"flex gap-1",children:null===(t=e.tiers)||void 0===t?void 0:t.map((t,l)=>(0,j.jsx)("div",{className:"flex items-center gap-0.5",title:t.label,children:(0,j.jsx)("div",{className:"w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold ".concat(l<e.unlocked_tier?"bg-teal-500 text-white":"bg-slate-200 text-slate-400"),children:l<e.unlocked_tier?"\u2713":(0,j.jsx)(n.A,{size:6})})},l))})]})]})},e.id)})})]}),E.length>0&&(0,j.jsxs)("div",{className:"mt-6 px-2",children:[(0,j.jsxs)("h3",{className:"font-heading font-semibold text-slate-700 dark:text-slate-200 text-sm mb-3 flex items-center gap-2",children:[(0,j.jsx)(b.A,{size:14,className:"text-amber-500"}),"How to Earn Taps"]}),(0,j.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:E.map((e,t)=>{var l;return(0,j.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-amber-50 dark:bg-amber-900/20 border border-amber-100 dark:border-amber-800/40 rounded-xl",children:[(0,j.jsx)("span",{className:"text-xs text-slate-700 dark:text-slate-200 leading-tight",children:e.description||e.event_type.replace(/_/g," ")}),(0,j.jsxs)("span",{className:"text-xs font-bold text-amber-600 dark:text-amber-400 tabular-nums ml-3 flex-shrink-0",children:["+",e.credits]})]},"".concat((null===e||void 0===e?void 0:e.event_type)||"rule","-").concat(null!==(l=null===e||void 0===e?void 0:e.credits)&&void 0!==l?l:"c","-").concat(t))})})]}),(0,j.jsx)(_,{open:h,onClose:()=>p(!1)}),(0,j.jsx)(g.A,{show:L,badge:F,onComplete:()=>R(!1)})]})}},298(e,t,l){l.d(t,{A:()=>i});l(9950);var s=l(5924),a=l(6987),r=l(4414);function i(e){let{onRetry:t,title:l="Could not load this data",message:i="The server had a problem \u2014 your data is safe. This is temporary.",compact:d=!1}=e;return(0,r.jsxs)("div",{"data-testid":"fetch-error",role:"alert",className:"flex flex-col items-center justify-center text-center ".concat(d?"p-6":"p-12 min-h-[200px]"),children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-red-50 dark:bg-red-950/40 flex items-center justify-center mb-3",children:(0,r.jsx)(s.A,{size:22,className:"text-red-500"})}),(0,r.jsx)("h3",{className:"font-medium text-slate-800 dark:text-slate-100 mb-1",children:l}),(0,r.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-400 mb-4 max-w-sm",children:i}),t&&(0,r.jsxs)("button",{type:"button",onClick:t,className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium bg-kw-red text-white rounded-lg hover:bg-red-700",children:[(0,r.jsx)(a.A,{size:14})," Retry"]})]})}},6859(e,t,l){l.d(t,{A:()=>s});const s=(0,l(9870).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])}}]);
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.