PageSourceSearch

https://xterns.ai/assets/XternEITracker-DHMZWjot.js

js xterns.ai collected 2026-10-05 13:24:05 UTC 53,997 bytes, 1 lines download raw bytes

1import{w as z,$ as Ee,r as S,j as e,F as qe,t as I,h as y,m as N,d as Xe,f as Ce,s as U,B as V,J as ve,K as Qe,i as $,k as B,l as Y,S as Ze,a as Ge,u as et,a0 as me,T as tt,P as re,E as st,aK as rt,bt as at,bu as nt}from"./index-DLd_kDlx.js";import{X as it}from"./XternTopbar-CTWW4Hoo.js";import{T as be,a as je,b as D,c as ee}from"./tabs-DKw2ItQa.js";import{u as lt}from"./useEIScore-C48npH32.js";import{f as ot}from"./numberFormat-zOUS8IHU.js";import{S as ct,l as Oe,t as Pe,F as dt,H as xe,r as ae,I as mt,o as ye,h as Te,G as xt,a1 as pt,a2 as ut,K as ht,C as ft,a3 as gt,E as vt,a4 as De,a5 as bt,A as jt,g as yt,O as Nt,R as Ne,T as wt,L as _t,a6 as St}from"./generateCategoricalChart-ByDL-d9M.js";import{P as we,a as At}from"./PolarAngleAxis-Blx3t8Nb.js";import{w as kt}from"./findIndex-Cos7Fxsp.js";import{T as q}from"./trending-up-BU4cR3Ys.js";import{T as _e}from"./trending-down-BvA8vA3u.js";import{C as Ke}from"./chevron-right-CD1gvy-q.js";import{I as Ct}from"./info-BLiu1f4f.js";import{t as pe}from"./en-US-9SRVm7yB.js";import{L as Et,a as Ot}from"./LineChart-BqKg5nac.js";import{C as Pt}from"./CartesianGrid-ChidKd9i.js";import{X as Tt,Y as Dt}from"./YAxis-BtEb5zMI.js";import{s as ue}from"./subDays-B5afKHU7.js";import{p as te}from"./parseISO-B4sJZ6AV.js";import{f as G}from"./format-BTXglRCX.js";import{f as It}from"./formatDistanceToNow-57P64IbE.js";import{M as Mt}from"./map-pin-ChCNbN_o.js";import{E as Rt}from"./external-link-D0CFvOTk.js";import{R as Se}from"./refresh-cw-CoPjtj5-.js";import{C as $t}from"./chevron-up-M4SAwIjf.js";import{C as Bt}from"./chevron-down-DpJJsCer.js";import{L as Ft}from"./lightbulb-BpXO0eKD.js";import{S as Lt}from"./SignalScoreTiers-CimoV002.js";import"./NotificationIcon-C1wwYnH5.js";import"./popover-BMD5FOmU.js";import"./scroll-area-BXTuUF24.js";import"./index-Deh-4PO1.js";import"./index-BdQq_4o_.js";import"./NotificationItem-Dc2WXW-y.js";import"./message-square-CtxeCfRz.js";import"./trophy-DBX-jNOC.js";import"./triangle-alert-Chqk_WK7.js";import"./arrow-right-left-C4CM-5rU.js";import"./index-lTaZyIGy.js";import"./tiny-invariant-CopsF_GD.js";import"./differenceInCalendarMonths-BA0TPVs2.js";import"./endOfDay-DkR3ZXc8.js";import"./endOfMonth-CYn6pTOm.js";function Ie(t,r){const s=+pe(t),[a,l]=[+pe(r.start),+pe(r.end)].sort((o,c)=>o-c);return s>=a&&s<=l}function se(t){"@babel/helpers - typeof";return se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},se(t)}function Ae(){return Ae=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var s=arguments[r];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(t[a]=s[a])}return t},Ae.apply(this,arguments)}function Me(t,r){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),s.push.apply(s,a)}return s}function he(t){for(var r=1;r<arguments.length;r++){var s=arguments[r]!=null?arguments[r]:{};r%2?Me(Object(s),!0).forEach(function(a){zt(t,a,s[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):Me(Object(s)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(s,a))})}return t}function zt(t,r,s){return r=Yt(r),r in t?Object.defineProperty(t,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[r]=s,t}function Yt(t){var r=Gt(t,"string");return se(r)=="symbol"?r:r+""}function Gt(t,r){if(se(t)!="object"||!t)return t;var s=t[Symbol.toPrimitive];if(s!==void 0){var a=s.call(t,r);
vendor: 8,916 bytes, line 1
1if(se(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function Re(t){return typeof t=="string"?parseInt(t,10):t}function Kt(t,r){var s="".concat(r.cx||t.cx),a=Number(s),l="".concat(r.cy||t.cy),o=Number(l);return he(he(he({},r),t),{},{cx:a,cy:o})}function $e(t){return z.createElement(ct,Ae({shapeType:"sector",propTransformer:Kt},t))}var Wt=["shape","activeShape","activeIndex","cornerRadius"],Ut=["value","background"];function X(t){"@babel/helpers - typeof";return X=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},X(t)}function le(){return le=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var s=arguments[r];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(t[a]=s[a])}return t},le.apply(this,arguments)}function Be(t,r){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),s.push.apply(s,a)}return s}function E(t){for(var r=1;r<arguments.length;r++){var s=arguments[r]!=null?arguments[r]:{};r%2?Be(Object(s),!0).forEach(function(a){J(t,a,s[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):Be(Object(s)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(s,a))})}return t}function Fe(t,r){if(t==null)return{};var s=Vt(t,r),a,l;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(l=0;l<o.length;l++)a=o[l],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(s[a]=t[a])}return s}function Vt(t,r){if(t==null)return{};var s={};for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){if(r.indexOf(a)>=0)continue;s[a]=t[a]}return s}function Jt(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function Le(t,r){for(var s=0;s<r.length;s++){var a=r[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Ue(a.key),a)}}function Ht(t,r,s){return r&&Le(t.prototype,r),s&&Le(t,s),Object.defineProperty(t,"prototype",{writable:!1}),t}function qt(t,r,s){return r=oe(r),Xt(t,We()?Reflect.construct(r,s||[],oe(t).constructor):r.apply(t,s))}function Xt(t,r){if(r&&(X(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qt(t)}function Qt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function We(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(We=function(){return!!t})()}function oe(t){return oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(s){return s.__proto__||Object.getPrototypeOf(s)},oe(t)}function Zt(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&ke(t,r)}function ke(t,r){return ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,l){return a.__proto__=l,a},ke(t,r)}function J(t,r,s){return r=Ue(r),r in t?Object.defineProperty(t,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[r]=s,t}function Ue(t){var r=es(t,"string");return X(r)=="symbol"?r:r+""}function es(t,r){if(X(t)!="object"||!t)return t;var s=t[Symbol.toPrimitive];if(s!==void 0){var a=s.call(t,r);if(X(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Q=(function(t){function r(){var s;Jt(this,r);for(var a=arguments.length,l=new Array(a),o=0;o<a;o++)l[o]=arguments[o];return s=qt(this,r,[].concat(l)),J(s,"state",{isAnimationFinished:!1}),J(s,"handleAnimationEnd",function(){var c=s.props.onAnimationEnd;s.setState({isAnimationFinished:!0}),Te(c)&&c()}),J(s,"handleAnimationStart",function(){var c=s.props.onAnimationStart;s.setState({isAnimationFinished:!1}),Te(c)&&c()}),s}return Zt(r,t),Ht(r,[{key:"getDeltaAngle",value:function(){var a=this.props,l=a.startAngle,o=a.endAngle,c=ye(o-l),d=Math.min(Math.abs(o-l),360);return c*d}},{key:"renderSectorsStatically",value:function(a){var l=this,o=this.props,c=o.shape,d=o.activeShape,f=o.activeIndex,m=o.cornerRadius,x=Fe(o,Wt),p=Oe(x,!1);return a.map(function(i,n){var u=n===f,v=E(E(E(E({},p),{},{cornerRadius:Re(m)},i),Pe(l.props,i,n)),{},{className:"recharts-radial-bar-sector ".concat(i.className),forceCornerRadius:x.forceCornerRadius,cornerIsExternal:x.cornerIsExternal,isActive:u,option:u?d:c});return z.createElement($e,le({},v,{key:"sector-".concat(n)}))})}},{key:"renderSectorsWithAnimation",value:function(){var a=this,l=this.props,o=l.data,c=l.isAnimationActive,d=l.animationBegin,f=l.animationDuration,m=l.animationEasing,x=l.animationId,p=this.state.prevData;return z.createElement(dt,{begin:d,duration:f,isActive:c,easing:m,from:{t:0},to:{t:1},key:"radialBar-".concat(x),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(i){var n=i.t,u=o.map(function(v,h){var b=p&&p[h];if(b){var O=xe(b.startAngle,v.startAngle),g=xe(b.endAngle,v.endAngle);return E(E({},v),{},{startAngle:O(n),endAngle:g(n)})}var w=v.endAngle,k=v.startAngle,T=xe(k,w);return E(E({},v),{},{endAngle:T(n)})});return z.createElement(ae,null,a.renderSectorsStatically(u))})}},{key:"renderSectors",value:function(){var a=this.props,l=a.data,o=a.isAnimationActive,c=this.state.prevData;return o&&l&&l.length&&(!c||!kt(c,l))?this.renderSectorsWithAnimation():this.renderSectorsStatically(l)}},{key:"renderBackground",value:function(a){var l=this,o=this.props.cornerRadius,c=Oe(this.props.background,!1);return a.map(function(d,f){d.value;var m=d.background,x=Fe(d,Ut);if(!m)return null;var p=E(E(E(E(E({cornerRadius:Re(o)},x),{},{fill:"#eee"},m),c),Pe(l.props,d,f)),{},{index:f,className:Ee("recharts-radial-bar-background-sector",c==null?void 0:c.className),option:m,isActive:!1});return z.createElement($e,le({},p,{key:"sector-".concat(f)}))})}},{key:"render",value:function(){var a=this.props,l=a.hide,o=a.data,c=a.className,d=a.background,f=a.isAnimationActive;if(l||!o||!o.length)return null;var m=this.state.isAnimationFinished,x=Ee("recharts-area",c);return z.createElement(ae,{className:x},d&&z.createElement(ae,{className:"recharts-radial-bar-background"},this.renderBackground(o)),z.createElement(ae,{className:"recharts-radial-bar-sectors"},this.renderSectors()),(!f||m)&&mt.renderCallByParent(E({},this.props),o))}}],[{key:"getDerivedStateFromProps",value:function(a,l){return a.animationId!==l.prevAnimationId?{prevAnimationId:a.animationId,curData:a.data,prevData:l.curData}:a.data!==l.curData?{curData:a.data}:null}}])})(S.PureComponent);J(Q,"displayName","RadialBar");J(Q,"defaultProps",{angleAxisId:0,radiusAxisId:0,minPointSize:0,hide:!1,legendType:"rect",data:[],isAnimationActive:!xt.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease",forceCornerRadius:!1,cornerIsExternal:!1});J(Q,"getComposedData",function(t){var r=t.item,s=t.props,a=t.radiusAxis,l=t.radiusAxisTicks,o=t.angleAxis,c=t.angleAxisTicks,d=t.displayedData,f=t.dataKey,m=t.stackedData,x=t.barPosition,p=t.bandSize,i=t.dataStartIndex,n=pt(x,r);if(!n)return null;var u=o.cx,v=o.cy,h=s.layout,b=r.props,O=b.children,g=b.minPointSize,w=h==="radial"?o:a,k=m?w.scale.domain():null,T=ut({numericAxis:w}),M=ht(O,ft),j=d.map(function(C,A){var P,_,R,F,L,Z;if(m?P=gt(m[i+A],k):(P=vt(C,f),Array.isArray(P)||(P=[T,P])),h==="radial"){_=De({axis:a,ticks:l,bandSize:p,offset:n.offset,entry:C,index:A}),L=o.scale(P[1]),F=o.scale(P[0]),R=_+n.size;var ce=L-F;if(Math.abs(g)>0&&Math.abs(ce)<Math.abs(g)){var Je=ye(ce||g)*(Math.abs(g)-Math.abs(ce));L+=Je}Z={background:{cx:u,cy:v,innerRadius:_,outerRadius:R,startAngle:s.startAngle,endAngle:s.endAngle}}}else{_=a.scale(P[0]),R=a.scale(P[1]),F=De({axis:o,ticks:c,bandSize:p,offset:n.offset,entry:C,index:A}),L=F+n.size;var de=R-_;if(Math.abs(g)>0&&Math.abs(de)<Math.abs(g)){var He=ye(de||g)*(Math.abs(g)-Math.abs(de));R+=He}}return E(E(E(E({},C),Z),{},{payload:C,value:m?P:P[1],cx:u,cy:v,innerRadius:_,outerRadius:R,startAngle:F,endAngle:L},M&&M[A]&&M[A].props),{},{tooltipPayload:[bt(r,C)],tooltipPosition:jt(u,v,(_+R)/2,(F+L)/2)})});return{data:j,layout:h}});var ze=yt({chartName:"RadialBarChart",GraphicalChild:Q,legendContent:"children",defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"angleAxis",AxisComp:we},{axisType:"radiusAxis",AxisComp:At}],formatAxisMap:Nt,defaultProps:{layout:"radial",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}
1);const Ye=[{min:0,max:200,label:"Beginner",color:"hsl(0 84.2% 60.2%)"},{min:201,max:400,label:"Growing",color:"hsl(24.6 95% 53.1%)"},{min:401,max:600,label:"Skilled",color:"hsl(47.9 95.8% 53.1%)"},{min:601,max:800,label:"Advanced",color:"hsl(142.1 76.2% 36.3%)"},{min:801,max:1e3,label:"Elite",color:"hsl(142.1 70.6% 45.3%)"}];function ts({score:t,previousScore:r,size:s="large",showTrend:a=!0,isUnavailable:l=!1,className:o}){const d={small:{height:150,fontSize:"text-2xl",labelSize:"text-xs"},medium:{height:200,fontSize:"text-3xl",labelSize:"text-sm"},large:{height:280,fontSize:"text-5xl",labelSize:"text-base"}}[s];if(l||t===null)return e.jsx("div",{className:I("flex flex-col items-center justify-center",o),children:e.jsxs("div",{className:"relative flex flex-col items-center justify-center",style:{height:d.height,width:d.height},children:[e.jsx(Ne,{width:"100%",height:"100%",children:e.jsxs(ze,{cx:"50%",cy:"50%",innerRadius:"70%",outerRadius:"90%",barSize:s==="small"?12:s==="medium"?16:20,data:[{name:"Score",value:0,fill:"hsl(var(--muted))"}],startAngle:90,endAngle:-270,children:[e.jsx(we,{type:"number",domain:[0,100],angleAxisId:0,tick:!1}),e.jsx(Q,{background:{fill:"hsl(var(--muted))"},dataKey:"value",cornerRadius:10})]})}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsx(qe,{className:"w-8 h-8 text-muted-foreground mb-2"}),e.jsx("div",{className:I("font-bold text-muted-foreground",s==="small"?"text-lg":"text-2xl"),children:"--"}),e.jsx("div",{className:I("text-muted-foreground font-medium",d.labelSize),children:"Not Available"}),e.jsx("div",{className:"text-xs text-muted-foreground mt-2 text-center px-4",children:"Check back later"})]})]})});const f=Ye.find(i=>t>=i.min&&t<=i.max)||Ye[0],m=t/1e3*100,x=r!==void 0?t-r:0,p=[{name:"Score",value:m,fill:f.color}];return e.jsxs("div",{className:I("flex flex-col items-center justify-center",o),children:[e.jsxs("div",{className:"relative",style:{height:d.height,width:d.height},children:[e.jsx(Ne,{width:"100%",height:"100%",children:e.jsxs(ze,{cx:"50%",cy:"50%",innerRadius:"70%",outerRadius:"90%",barSize:s==="small"?12:s==="medium"?16:20,data:p,startAngle:90,endAngle:-270,children:[e.jsx(we,{type:"number",domain:[0,100],angleAxisId:0,tick:!1}),e.jsx(Q,{background:{fill:"hsl(var(--muted))"},dataKey:"value",cornerRadius:10,animationDuration:1e3})]})}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsx("div",{className:I("font-bold",d.fontSize),style:{color:f.color},children:ot(t)}),e.jsx("div",{className:I("text-muted-foreground font-medium",d.labelSize),children:"out of 1000"}),e.jsx("div",{className:I("font-semibold mt-1",d.labelSize),style:{color:f.color},children:f.label}),a&&x!==0&&e.jsxs("div",{className:I("flex items-center gap-1 mt-2",x>0?"text-green-600":"text-red-600"),children:[x>0?e.jsx(q,{className:"w-4 h-4"}):e.jsx(_e,{className:"w-4 h-4"}),e.jsxs("span",{className:"text-xs font-medium",children:[Math.abs(x).toFixed(1)," pts"]})]})]})]}),s==="large"&&e.jsx("div",{className:"text-sm text-muted-foreground mt-4",children:"Score updated today"})]})}const ne=[{min:0,max:200,label:"Beginner",color:"hsl(0 84.2% 60.2%)"},{min:201,max:400,label:"Growing",color:"hsl(24.6 95% 53.1%)"},{min:401,max:600,label:"Skilled",color:"hsl(47.9 95.8% 53.1%)"},{min:601,max:800,label:"Advanced",color:"hsl(142.1 76.2% 36.3%)"},{min:801,max:1e3,label:"Elite",color:"hsl(142.1 70.6% 45.3%)"}];function ss({currentScore:t,className:r}){const s=ne.find(l=>t>=l.min&&t<=l.max)||ne[0],a=t/1e3*100;return e.jsxs("div",{className:I("space-y-4",r),children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Your Score Band"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"flex h-8 rounded-full overflow-hidden",children:ne.map(l=>e.jsx("div",{className:"relative",style:{width:`${(l.max-l.min+1)/1e3*100}%`,backgroundColor:l.color,opacity:l.label===s.label?1:.3}},l.label))}),e.jsx("div",{className:"absolute top-0 transform -translate-x-1/2 -translate-y-1",style:{left:`${a}%`},children:e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"w-1 h-10 bg-foreground rounded-full"}),e.jsx("div",{className:"mt-1 px-2 py-1 bg-background border-2 border-foreground rounded-md",children:e.jsx("span",{className:"text-xs font-bold",children:Math.round(t)})})]})})]}
1),e.jsx("div",{className:"grid grid-cols-5 gap-2 mt-8",children:ne.map(l=>e.jsxs("div",{className:I("text-center p-3 rounded-lg border-2 transition-all",l.label===s.label?"border-foreground bg-accent":"border-muted bg-muted/30"),children:[e.jsx("div",{className:"font-semibold text-sm",style:{color:l.color},children:l.label}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[l.min,"-",l.max]})]},l.label))}),e.jsxs("div",{className:"p-4 rounded-lg bg-accent/50 border",children:[e.jsxs("h4",{className:"font-semibold mb-2",style:{color:s.color},children:[s.label," Level"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.label==="Beginner"&&"You're just getting started. Keep completing assessments and participating in your pod activities to grow your score.",s.label==="Growing"&&"You're making progress! Continue completing stories, attending meetings, and collaborating with your team.",s.label==="Skilled"&&"You're demonstrating solid skills. Focus on technical assessments and consistent engagement to reach the next level.",s.label==="Advanced"&&"Excellent work! You're showing strong technical and collaborative abilities. Keep it up to reach Elite status.",s.label==="Elite"&&"Outstanding! You're at the top tier, demonstrating exceptional technical skills, engagement, and collaboration."]})]})]})}function rs({onBreakdownClick:t,onBandsClick:r,onImpactsClick:s,className:a}){const l=[{icon:e.jsx(Xe,{className:"w-6 h-6 text-blue-600"}),title:"Score Breakdown",description:"See what makes up your Signal Score",action:"See breakdown",onClick:t},{icon:e.jsx(Ct,{className:"w-6 h-6 text-purple-600"}),title:"Score Bands",description:"Learn about score ranges and levels",action:"Learn more",onClick:r},{icon:e.jsx(q,{className:"w-6 h-6 text-green-600"}),title:"What Impacts Your Score",description:"Discover how to improve your score",action:"View impacts",onClick:s}];return e.jsxs("div",{className:I("space-y-4",a),children:[e.jsx("h3",{className:"font-display text-2xl font-normal text-xterns-navy",children:"Take a closer look"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:l.map(o=>e.jsx(y,{className:"group cursor-pointer rounded-2xl border border-gray-200/80 bg-white shadow-sm transition-all duration-200 hover:-translate-y-0.5 hover:shadow-[0_16px_34px_rgba(15,23,42,0.09)]",onClick:o.onClick,children:e.jsx(N,{className:"p-6",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-xterns-blue/10 text-xterns-blue",children:o.icon}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-1",children:o.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:o.description})]}),e.jsxs("div",{className:"flex items-center text-primary font-medium text-sm group-hover:gap-2 transition-all",children:[o.action,e.jsx(Ke,{className:"w-4 h-4 ml-1 group-hover:translate-x-1 transition-transform"})]})]})})},o.title))})]})}const ie={story_completed:{icon:"✅",color:"text-green-600",title:"Story Completed",category:"engagement"},assessment_completed:{icon:"📝",color:"text-blue-600",title:"Assessment Completed",category:"technical"},sprint_completed:{icon:"🏃",color:"text-green-600",title:"Sprint Completed On-Time",category:"collaboration"},sprint_all_stories_completed:{icon:"🏆",color:"text-yellow-600",title:"Sprint Bonus: All Stories Done",category:"engagement"},project_submitted:{icon:"🎯",color:"text-green-600",title:"Project Completed",category:"engagement"},session_attended:{icon:"👥",color:"text-purple-600",title:"Session Attended",category:"collaboration"},comment_posted:{icon:"💬",color:"text-purple-600",title:"Comment Posted",category:"collaboration"},story_reverted:{icon:"🔄",color:"text-red-600",title:"Story Reverted",category:"engagement"},assessment_failed:{icon:"❌",color:"text-red-600",title:"Assessment Failed",category:"technical"},sprint_incomplete:{icon:"⚠️",color:"text-orange-600",title:"Sprint Incomplete",category:"engagement"},sprint_assessment_expired:{icon:"⏰",color:"text-orange-600",title:"Sprint Assessment Expired",category:"engagement"},pod_incomplete_sprint:{icon:"👥",color:"text-red-600",title:"Pod Sprint Incomplete",category:"collaboration"}},Ve=()=>{const{user:t}=Ce(),[r,s]=S.useState([]),[a,l]=S.useState(!0),[o,c]=S.useState(null),d=async()=>
1{if(t!=null&&t.id)try{l(!0),c(null);const{data:i,error:n}=await U.from("dareyscore_event_queue").select("*").eq("user_id",t.id).not("sent_at","is",null).order("created_at",{ascending:!1}).limit(100);if(n)throw n;const u=new Set,v=new Set,h=new Set;(i||[]).forEach(j=>{const C=typeof j.event_data=="string"?JSON.parse(j.event_data):j.event_data,A=(C==null?void 0:C.payload)||{};j.event_type==="comment_posted"&&(A.parent_type==="story"?u.add(A.parent_id):A.parent_type==="task"&&v.add(A.parent_id)),["assessment_completed","sprint_completed"].includes(j.event_type)&&A.sprint_id&&h.add(A.sprint_id)});const[b,O,g]=await Promise.all([u.size>0?U.from("roadmap_stories").select("id, title").in("id",Array.from(u)):Promise.resolve({data:[]}),v.size>0?U.from("roadmap_tasks").select("id, title").in("id",Array.from(v)):Promise.resolve({data:[]}),h.size>0?U.from("sprints").select("id, name, pod_id, pods(pod_name)").in("id",Array.from(h)):Promise.resolve({data:[]})]),w=new Map((b.data||[]).map(j=>[j.id,j.title])),k=new Map((O.data||[]).map(j=>[j.id,j.title])),T=new Map((g.data||[]).map(j=>{var C;return[j.id,{sprint_name:j.name,pod_name:(C=j.pods)==null?void 0:C.pod_n
1ame}]})),M=(i||[]).map(j=>{var R,F,L,Z;const C=j.event_type,A=typeof j.event_data=="string"?JSON.parse(j.event_data):j.event_data,P=((R=ie[C])==null?void 0:R.category)||"engagement";let _=0;if(A.points_local!==void 0&&A.points_local!==null)C==="comment_posted"?_=.05:_=A.points_local;else switch(C){case"story_completed":_=3;break;case"story_reverted":_=-3;break;case"assessment_failed":_=((F=A.payload)==null?void 0:F.attempt_number)===1?-2:((L=A.payload)==null?void 0:L.attempt_number)===2?-3:-5;break;case"sprint_incomplete":_=-1.5*(((Z=A.payload)==null?void 0:Z.uncompleted_stories)||1);break;case"sprint_all_stories_completed":_=5;break;case"sprint_assessment_expired":_=-1.5;break;case"project_submitted":_=5;break;case"sprint_completed":_=2;break;case"session_attended":_=2;break;case"comment_posted":_=.05;break;case"pod_incomplete_sprint":_=-1;break}return{id:j.id,event_type:C,event_data:{...A,_enriched:{storyTitlesMap:Object.fromEntries(w),taskTitlesMap:Object.fromEntries(k),sprintInfoMap:Object.fromEntries(T)}},created_at:j.created_at,sent_at:j.sent_at,points_local:_,category:P}});s(M)}catch(i){console.error("Error fetching score events:",i),c(i instanceof Error?i.message:"Failed to load events")}finally{l(!1)}};return S.useEffect(()=>{d();const i=U.channel("score-events").on("postgres_changes",{event:"INSERT",schema:"public",table:"dareyscore_event_queue",filter:`user_id=eq.${t==null?void 0:t.id}`},()=>{d()}).subscribe();return()=>{U.removeChannel(i)}},[t==null?void 0:t.id]),{events:r,isLoading:a,error:o,refetch:d,getEventIcon:i=>{var n;return((n=ie[i])==null?void 0:n.icon)||"📊"},getEventColor:i=>{var n;return((n=ie[i])==null?void 0:n.color)||"text-gray-600"},getEventTitle:i=>{var n;return((n=ie[i])==null?void 0:n.title)||i.replace(/_/g," ").replace(/\b\w/g,u=>u.toUpperCase())},getEventDescription:i=>{var v,h,b,O;const n=i.event_data.payload||{},u=i.event_data._enriched||{};switch(i.event_type){case"story_completed":return n.story_title||n.title||"Story marked as complete";case"story_reverted":return`${n.story_title||n.title||"Story"} moved back from done status`;case"assessment_failed":return`${n.assessment_type||"Assessment"} failed with ${n.assessment_score}% (Attempt ${n.attempt_number||1})`;case"assessment_completed":if(n.assessment_type==="sprint_technical"&&n.sprint_id){const k=(v=u.sprintInfoMap)==null?void 0:v[n.sprint_id],T=n.correct_answers||0,M=n.total_questions||5;return k?`Sprint assessment for ${k.sprint_name} in ${k.pod_name} - ${n.assessment_score}% (${T}/${M} correct)`:`Sprint assessment - ${n.assessment_score}% (${T}/${M} correct)`}return`${n.assessment_type||"Assessment"} completed with ${n.assessment_score}%`;case"sprint_incomplete":return`${n.uncompleted_stories||1} ${n.uncompleted_stories===1?"story":"stories"} incomplete at sprint end`;case"sprint_all_stories_completed":return"All assigned stories completed in sprint!";case"sprint_assessment_expired":return`Sprint assessment expired after ${n.days_since_assigned||7} days`;case"project_submitted":return n.project_title||"Project completed";case"sprint_completed":if(n.sprint_id){const k=(h=u.sprintInfoMap)==null?void 0:h[n.sprint_id];if(k)return`${k.sprint_name}
1 completed on time in ${k.pod_name}`}return"Sprint completed on time";case"session_attended":return n.session_title||"Session attended";case"comment_posted":const g=n.parent_title||(n.parent_type==="story"?(b=u.storyTitlesMap)==null?void 0:b[n.parent_id]:null)||(n.parent_type==="task"?(O=u.taskTitlesMap)==null?void 0:O[n.parent_id]:null),w=n.has_mentions?` (with ${n.mention_count} mention${n.mention_count>1?"s":""})`:"";return g?`Commented on "${g}"${w}`:`Comment posted on ${n.parent_type||"task"}${w}`;case"pod_incomplete_sprint":return"Pod failed to complete all sprint stories (-1 collaboration)";default:return"Event recorded"}}}};function as({currentScore:t,scoreHistory:r,className:s}){const[a,l]=S.useState(30),{events:o,getEventIcon:c}=Ve(),d=(i,n,u)=>{const v=new Date,h=[];for(let b=n;b>=0;b-=7){const O=ue(v,b),g=G(O,"MMM dd"),w=G(O,"yyyy-MM-dd"),k=i.find(T=>T.fullDate===w);if(k)h.push(k);else if(b===0)h.push({date:g,score:Math.round(u),fullDate:w});else{const T=(n-b)/n,M=Math.round(u*T);h.push({date:g,score:M,fullDate:w})}}return h},f=S.useMemo(()=>{const i=new Date,n=ue(i,a);let u=r||[];u=u.filter(g=>{const w=te(g.date);return Ie(w,{start:n,end:i})});const v=new Map;u.forEach(g=>{const w=typeof g.date=="string"&&g.date.includes("-")?g.date:G(te(g.date),"yyyy-MM-dd"),k=G(te(w),"MMM dd");v.set(w,{date:k,score:g.score,fullDate:w})});let h=Array.from(v.values()).sort((g,w)=>new Date(g.fullDate).getTime()-new Date(w.fullDate).getTime());const b=G(i,"yyyy-MM-dd");if(!h.some(g=>g.fullDate===b)||h.length===0)h.push({date:G(i,"MMM dd"),score:Math.round(t),fullDate:b});else{const g=h.findIndex(w=>w.fullDate===b);g!==-1&&(h[g].score=Math.round(t))}return h.length<3?d(h,a,t):h},[r,a,t]),m=f,x=S.useMemo(()=>{const i=new Date,n=ue(i,a);return o.filter(u=>{const v=te(u.created_at);return Ie(v,{start:n,end:i})&&Math.abs(u.points_local)>=1}).map(u=>{const v=te(u.created_at),h=G(v,"MMM dd"),b=f.find(O=>O.date===h)||f[f.length-1];return{date:h,score:(b==null?void 0:b.score)||t,event:u,icon:c(u.event_type),isNegative:u.points_local<0}})},[o,a,f,t,c]),p=({active:i,payload:n})=>i&&n&&n.length?e.jsx(y,{children:e.jsxs(N,{className:"p-3",children:[e.jsx("p",{className:"font-semibold",children:n[0].payload.fullDate||n[0].payload.date}),e.jsxs("p",{className:"text-primary font-bold text-lg",children:[n[0].value," points"]})]})}):null;return e.jsxs("div",{className:s,children:[e.jsxs("div",{className:"mb-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("h3",{className:"font-display text-2xl font-normal text-xterns-navy",children:"Score Timeline"}),e.jsx("div",{className:"flex gap-2",children:[30,60,90].map(i=>e.jsxs(V,{className:"rounded-xl",variant:a===i?"default":"outline",size:"sm",onClick:()=>l(i),children:[i," days"]},i))})]}),e.jsx("div",{className:"h-80",children:e.jsx(Ne,{width:"100%",height:"100%",children:e.jsxs(Et,{data:m,children:[e.jsx(Pt,{strokeDasharray:"3 3",className:"stroke-muted"}),e.jsx(Tt,{dataKey:"date",className:"text-muted-foreground",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Dt,{domain:[0,1e3],className:"text-muted-foreground",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(wt,{content:e.jsx(p,{})}),e.jsx(_t,{}),e.jsx(Ot,{type:"monotone",dataKey:"score",stroke:"hsl(var(--primary))",strokeWidth:3,dot:{fill:"hsl(var(--primary))",r:4},activeDot:{r:6},name:"Signal Score"}),x.map((i,n)=>e.jsx(St,{x:i.date,y:i.score,r:8,fill:i.isNegative?"#ef4444":"#22c55e",stroke:"#fff",strokeWidth:2},`event-${n}`))]})})}),x.length>0&&e.jsxs("div",{className:"mt-4 rounded-xl border border-gray-200 bg-gray-50/70 p-3",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Significant Events:"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[x.slice(0,5).map((i,n)=>e.jsxs("span",{className:"text-xs px-2 py-1 rounded bg-background border",children:[i.icon," ",i.event.points_local>0?"+":"",i.event.points_local.toFixed(1)," pts"]},n)),x.length>5&&e.jsxs("span",{className:"text-xs px-2 py-1 rounded bg-background border text-muted-foreground",children:["+",x.length-5," more"]})]})]}),e.jsx("div",{className:"mt-4 rounded-xl border border-xterns-blue/10 bg-xterns-blue/5 p-4",children:e.jsxs("p",{className:"text-sm text-gray-600",children:["Your score trend over the past ",a," days shows"," ",m.length>1&&m[m.length-1].score>m[0].score?e.jsx("span",{className:"text-green-600 font-semibold",children:"positive growth"}):m.length>1&&m[m.length-1].score<m[0].score?e.jsx("span",{className:"text-red-600 font-semibold",children:"a decline"}):e.jsx("span",{className:"font-semibold",children:"stable performance"}),". Keep up your engagement and technical development to continue improving."]})})]})}function ns({event:t,icon:r,color:s,title:a,description:l}){const o=t.points_local>0,c=t.points_local<0,d={technical:"bg-blue-100 text-blue-800 border-blue-200",engagement:"bg-green-100 text-green-800 border-green-200",collaboration:"bg-purple-100 text-purple-800 border-purple-200"};return e.jsx(y,{className:`transition-all hover:shadow-md ${c?"border-red-200 bg-red-50/30":o?"border-green-200 bg-green-50/30":""}`,children:e.jsx(N,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"text-3xl flex-shrink-0 mt-1",children:r}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 mb-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:`font-semibold ${s} mb-1`,children:a}),e.jsx("p",{className:"text-sm text-muted-foreground",children:l})]}),e.jsxs(ve,{variant:c?"destructive":o?"default":"secondary",className:"flex-shrink-0 text-sm font-bold",children:[o?"+":"",t.points_local.toFixed(t.points_local<1?2:1)," pts"]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[e.jsx(ve,{variant:"outline",className:d[t.category],children:t.category.charAt(0).toUpperCase()+t.category.slice(1)}),e.jsx("span",{className:"text-xs text-muted-foreground",children:It(new Date(t.created_at),{addSuffix:!0})})]})]})]})})})}const K="rounded-2xl border border-gray-200/80 bg-white shadow-[0_12px_36px_rgba(15,23,42,0.06)]";function is(){const{events:t,isLoading:r,error:s,getEventIcon:a,getEventC
1olor:l,getEventTitle:o,getEventDescription:c}=Ve(),[d,f]=S.useState("all"),[m,x]=S.useState("all"),p=S.useMemo(()=>{const n=t.filter(h=>h.points_local>0).reduce((h,b)=>h+b.points_local,0),u=t.filter(h=>h.points_local<0).reduce((h,b)=>h+Math.abs(b.points_local),0),v=n-u;return{totalEvents:t.length,totalGains:n,totalLosses:u,netChange:v}},[t]),i=S.useMemo(()=>t.filter(n=>!(d==="gains"&&n.points_local<=0||d==="losses"&&n.points_local>=0||m!=="all"&&n.category!==m)),[t,d,m]);return r?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary"})}):s?e.jsx(y,{className:K,children:e.jsx(N,{className:"p-6",children:e.jsxs("p",{className:"text-destructive",children:["Error loading activity: ",s]})})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsx(y,{className:K,children:e.jsx(N,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Qe,{className:"w-8 h-8 text-blue-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Events"}),e.jsx("p",{className:"font-display text-3xl text-xterns-navy",children:p.totalEvents})]})]})})}),e.jsx(y,{className:K,children:e.jsx(N,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(q,{className:"w-8 h-8 text-green-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Points Gained"}),e.jsxs("p",{className:"font-display text-3xl text-green-600",children:["+",p.totalGains.toFixed(1)]})]})]})})}),e.jsx(y,{className:K,children:e.jsx(N,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(_e,{className:"w-8 h-8 text-red-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Points Lost"}),e.jsxs("p",{className:"font-display text-3xl text-red-600",children:["-",p.totalLosses.toFixed(1)]})]})]})})}),e.jsx(y,{className:K,children:e.jsx(N,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center ${p.netChange>=0?"bg-green-100":"bg-red-100"}`,children:p.netChange>=0?e.jsx(q,{className:"w-5 h-5 text-green-600"}):e.jsx(_e,{className:"w-5 h-5 text-red-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Net Change"}),e.jsxs("p",{className:`font-display text-3xl ${p.netChange>=0?"text-green-600":"text-red-600"}`,children:[p.netChange>=0?"+":"",p.netChange.toFixed(1)]})]})]})})})]}),e.jsxs(y,{className:K,children:[e.jsxs($,{children:[e.jsx(B,{children:"Activity Filters"}),e.jsx(Y,{children:"Filter events by type and category"})]}),e.jsxs(N,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Event Type"}),e.jsx(be,{value:d,onValueChange:n=>
1f(n),children:e.jsxs(je,{className:"grid h-auto w-full max-w-md grid-cols-3 rounded-xl bg-gray-100/80 p-1",children:[e.jsx(D,{value:"all",children:"All Events"}),e.jsx(D,{value:"gains",children:"Gains Only"}),e.jsx(D,{value:"losses",children:"Losses Only"})]})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Category"}),e.jsx(be,{value:m,onValueChange:n=>x(n),children:e.jsxs(je,{className:"grid h-auto w-full max-w-2xl grid-cols-2 rounded-xl bg-gray-100/80 p-1 sm:grid-cols-4",children:[e.jsx(D,{value:"all",children:"All"}),e.jsx(D,{value:"technical",children:"Technical"}),e.jsx(D,{value:"engagement",children:"Engagement"}),e.jsx(D,{value:"collaboration",children:"Collaboration"})]})})]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"font-display text-2xl font-normal text-xterns-navy",children:"Recent Activity"}),e.jsxs(ve,{variant:"secondary",children:[i.length," ",i.length===1?"event":"events"]})]}),i.length===0?e.jsx(y,{className:K,children:e.jsx(N,{className:"p-8 text-center",children:e.jsx("p",{className:"text-muted-foreground",children:"No events match your current filters"})})}):e.jsx("div",{className:"space-y-3",children:i.map(n=>e.jsx(ns,{event:n,icon:a(n.event_type),color:l(n.event_type),title:o(n.event_type),description:c(n)},n.id))})]})]})}const fe="ai_coach_insights",ls=1440*60*1e3;function os(){const{user:t}=Ce(),[r,s]=S.useState(null),[a,l]=S.useState(!1),[o,c]=S.useState(null),d=S.useCallback(()=>{if(typeof window>"u")return null;try{const p=sessionStorage.getItem(fe);if(!p)return null;const i=JSON.parse(p);return Date.now()-i.timestamp<ls?(console.log("Using cached AI coach insights"),i.insights):(sessionStorage.removeItem(fe),null)}catch(p){return console.error("Error reading cached insights:",p),null}},[]),f=S.useCallback(p=>{if(!(typeof window>"u"))try{const i={insights:p,timestamp:Date.now()};sessionStorage.setItem(fe,JSON.stringify(i))}catch(i){console.error("Error caching insights:",i)}},[]),m=S.useCallback(async(p=!1)=>
1{if(!(t!=null&&t.id)){c("User not authenticated");return}if(!p){const i=d();if(i){s(i);return}}l(!0),c(null);try{console.log("Fetching AI coach insights for user:",t.id);const{data:i,error:n}=await U.functions.invoke("generate-ai-coach-insights",{body:{user_id:t.id}});if(n)throw console.error("Function error:",n),n;if(i.error)throw console.error("API error:",i.error),new Error(i.error);console.log("AI coach insights received:",i),s(i),f(i)}catch(i){console.error("Error fetching AI coach insights:",i),c(i instanceof Error?i.message:"Failed to fetch insights")}finally{l(!1)}},[t==null?void 0:t.id,d,f]),x=S.useCallback(async()=>{await m(!0)},[m]);return S.useEffect(()=>{t!=null&&t.id&&!r&&m()},[t==null?void 0:t.id]),{insights:r,isLoading:a,error:o,fetchInsights:m,refreshInsights:x}}function cs({userName:t,motivationalMessage:r}){const s=()=>{const a=new Date().getHours();return a<12?"Good morning":a<18?"Good afternoon":"Good evening"};return e.jsxs("div",{className:"flex items-start gap-4 p-6 rounded-lg bg-gradient-to-br from-primary/10 via-primary/5 to-transparent border border-primary/20",children:[e.jsx("div",{className:"flex-shrink-0 w-12 h-12 rounded-full bg-primary/20 flex items-center justify-center",children:e.jsx(Ze,{className:"w-6 h-6 text-primary"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("h3",{className:"text-lg font-semibold text-foreground mb-1",children:[s(),", ",t,"! 🌟"]}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:r})]})]})}function ds({job:t}){return e.jsxs("div",{className:"p-4 rounded-lg border border-border bg-card hover:border-primary/50 transition-colors",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 mb-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-semibold text-foreground mb-1",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.company})]}),e.jsx("div",{className:"flex-shrink-0",children:e.jsxs("div",{className:"px-2 py-1 rounded-full bg-green-100 text-green-700 text-xs font-medium",children:[t.matchPercentage,"% match"]})})]}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground mb-3",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Mt,{className:"w-3 h-3"}),t.location]}),t.salary&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ge,{className:"w-3 h-3"}),t.salary]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 mb-3",children:[t.skills.slice(0,4).map((r,s)=>e.jsx("span",{className:"px-2 py-0.5 rounded text-xs bg-muted text-muted-foreground",children:r},s)),t.skills.length>4&&e.jsxs("span",{className:"px-2 py-0.5 rounded text-xs text-muted-foreground",children:["+",t.skills.length-4," more"]})]}),t.applicationUrl&&e.jsxs(V,{size:"sm",variant:"outline",className:"w-full",onClick:()=>window.open(t.applicationUrl,"_blank"),children:["View Job ",e.jsx(Rt,{className:"w-3 h-3 ml-2"})]})]})}const W="rounded-2xl border border-gray-200/80 bg-white shadow-[0_12px_36px_rgba(15,23,42,0.06)]";function ms(){const{user:t}=Ce(),r=et(),{insights:s,isLoading:a,error:l,refreshInsights:o}=os(),[c,d]=S.useState(!1),f=x=>{r(x)};if(a)return e.jsxs("div",{className:"space-y-6",children:[e.jsx(me,{className:"h-24 w-full"}),e.jsx(me,{className:"h-48 w-full"}),e.jsx(me,{className:"h-64 w-full"})]});if(l)return e.jsx(y,{className:`${W} border-destructive/50`,children:e.jsxs(N,{className:"pt-6",children:[e.jsxs("p",{className:"text-destructive mb-4",children:["Failed to load AI coach insights: ",l]}),e.jsxs(V,{onClick:()=>o(),variant:"outline",children:[e.jsx(Se,{className:"w-4 h-4 mr-2"}),"Try Again"]})]})});if(!s)return e.jsx(y,{className:W,children:e.jsx(N,{className:"pt-6",children:e.jsx("p",{className:"text-muted-foreground",children:"Loading your personalized insights..."})})});const m=(t==null?void 0:t.name)||"there";return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"flex justify-end",children:e.jsxs(V,{onClick:()=>o(),variant:"outline",size:"sm",children:[e.jsx(Se,{className:"w-4 h-4 mr-2"}),"Refresh Insights"]})}
1),e.jsx(cs,{userName:m,motivationalMessage:s.motivationalMessage}),e.jsxs(y,{className:W,children:[e.jsx($,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(B,{className:"flex items-center gap-2",children:[e.jsx(tt,{className:"w-5 h-5 text-primary"}),"Your Path to ",s.nextBand]}),e.jsxs(Y,{children:[s.pointsToNextLevel," points to reach the next level"]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"text-2xl font-bold text-primary",children:s.currentScore}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s.currentBand})]})]})}),e.jsx(N,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(re,{value:s.progressPercentage,className:"h-3"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.progressPercentage,"% through ",s.currentBand," level"]})]})})]}),e.jsxs(y,{className:W,children:[e.jsxs($,{children:[e.jsxs(B,{className:"flex items-center gap-2",children:[e.jsx(q,{className:"w-5 h-5 text-green-600"}),"Today's Top Actions"]}),e.jsx(Y,{children:"High-impact activities to boost your score"})]}),e.jsx(N,{className:"space-y-3",children:s.topActions.map((x,p)=>e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border border-border bg-card hover:border-primary/50 transition-colors",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"font-semibold text-foreground",children:x.action}),e.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-primary/10 text-primary text-xs font-medium",children:["+",x.points," pts"]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:x.reason})]}),e.jsxs(V,{onClick:()=>f(x.route),variant:"outline",size:"sm",className:"ml-4",children:[x.cta,e.jsx(Ke,{className:"w-4 h-4 ml-1"})]})]},p))})]}),s.jobOpportunities.length>0&&e.jsxs(y,{className:W,children:[e.jsx($,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(B,{className:"flex items-center gap-2",children:[e.jsx(Ge,{className:"w-5 h-5 text-blue-600"}),"Job Opportunities For You"]}),e.jsxs(Y,{children:[s.jobOpportunities.length," roles match your skills"]})]}),e.jsx(V,{variant:"ghost",size:"sm",onClick:()=>d(!c),children:c?e.jsx($t,{className:"w-4 h-4"}):e.jsx(Bt,{className:"w-4 h-4"})})]})}),c&&e.jsx(N,{className:"space-y-3",children:s.jobOpportunities.map(x=>e.jsx(ds,{job:x},x.id))})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs(y,{className:W,children:[e.jsx($,{children:e.jsxs(B,{className:"flex items-center gap-2 text-base",children:[e.jsx(q,{className:"w-4 h-4 text-purple-600"}),"This Week's Progress"]})}),e.jsx(N,{children:e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:s.weeklyInsight})})]}),e.jsxs(y,{children:[e.jsx($,{children:e.jsxs(B,{className:"flex items-center gap-2 text-base",children:[e.jsx(Ft,{className:"w-4 h-4 text-yellow-600"}),"Career Insight"]})}),e.jsx(N,{children:e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:s.careerTip})})]})]}),e.jsxs(y,{className:W,children:[e.jsxs($,{children:[e.jsx(B,{children:"Score Components"}),e.jsx(Y,{children:"Your current performance breakdown"})]}),e.jsxs(N,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:"Technical Skills"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"40% weight"})]}),e.jsxs("div",{className:"text-lg font-bold text-blue-600",children:[s.breakdown.technical.score,"/",s.breakdown.technical.max]})]}),e.jsx(re,{value:s.breakdown.technical.score/s.breakdown.technical.max*100,className:"h-2"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:"Engagement"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"30% weight"})]}),e.jsxs("div",{className:"text-lg font-bold text-green-600",children:[s.breakdown.engagement.score,"/",s.breakdown.engagement.max]})]}),e.jsx(re,{value:s.breakdown.engagement.score/s.breakdown.engagement.max*100,className:"h-2"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:"Collaboration"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"30% weight"})]}),e.jsxs("div",{className:"text-lg font-bold text-purple-600",children:[s.breakdown.collaboration.score,"/",s.breakdown.collaboration.max]})]}),e.jsx(re,{value:s.breakdown.collaboration.score/s.breakdown.collaboration.max*100,className:"h-2"})]})]})]})]})}const H="rounded-2xl border border-gray-200/80 bg-white shadow-[0_12px_36px_rgba(15,23,42,0.06)]",ge="flex items-center justify-between rounded-xl border border-gray-200/80 bg-gray-50/70 p-4";function er(){var x,p,i;const{dareyScore:t,isApiAvailable:r,localBreakdown:s,isLoading:a,scoreHistory:l,calculateScore:o}=lt(),{toast:c}=st(),[d,f]=S.useState("overview"),m=async()=>
1{try{await o(30),c({title:"Score Refreshed",description:"Your Signal Score has been updated with the latest data."})}catch{c({title:"Refresh Failed",description:"Unable to refresh your score. Please try again.",variant:"destructive"})}};return e.jsx(rt,{children:e.jsxs("div",{className:"flex min-h-screen w-full bg-gray-50 font-sans",children:[e.jsx(at,{}),e.jsxs(nt,{className:"flex-1",children:[e.jsx(it,{title:"Signal Score Tracker"}),e.jsx("main",{className:"px-4 py-8 sm:px-8 lg:px-10",children:e.jsxs("div",{className:"mx-auto max-w-7xl space-y-8",children:[e.jsxs("div",{id:"skill-tracker-header",className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-3xl font-normal tracking-tight text-xterns-navy sm:text-4xl",children:"Your Signal Score"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 sm:text-base",children:"Track your performance and discover ways to improve"})]}),e.jsxs(V,{className:"w-fit rounded-xl bg-xterns-blue shadow-sm hover:bg-xterns-blue/90",onClick:m,disabled:a,children:[e.jsx(Se,{className:`w-4 h-4 mr-2 ${a?"animate-spin":""}`}),"Refresh Score"]})]}),e.jsxs(be,{value:d,onValueChange:f,className:"space-y-6",children:[e.jsxs(je,{id:"skill-tracker-tabs",className:"flex h-auto w-full max-w-3xl justify-start overflow-x-auto rounded-xl bg-gray-100/80 p-1",children:[e.jsx(D,{className:"shrink-0 rounded-lg px-4 data-[state=active]:text-xterns-blue",value:"overview",children:"Overview"}),e.jsx(D,{className:"shrink-0 rounded-lg px-4 data-[state=active]:text-xterns-blue",value:"timeline",children:"Timeline"}),e.jsx(D,{className:"shrink-0 rounded-lg px-4 data-[state=active]:text-xterns-blue",value:"activity",children:"Activity"}),e.jsx(D,{className:"shrink-0 rounded-lg px-4 data-[state=active]:text-xterns-blue",value:"impacts",children:"Impacts"}),e.jsx(D,{className:"shrink-0 rounded-lg px-4 data-[state=active]:text-xterns-blue",value:"improve",children:"Improve"})]}),e.jsxs(ee,{value:"overview",className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs(y,{className:H,children:[e.jsxs($,{children:[e.jsx(B,{children:"Tier 1 Signal Score"}),e.jsx(Y,{children:"Discoverable Talent score from Signal Score"})]}),e.jsx(N,{children:e.jsx(ts,{score:t,isUnavailable:!r,size:"large",showTrend:!1})})]}),e.jsxs(y,{id:"score-components-card",className:H,children:[e.jsxs($,{children:[e.jsx(B,{children:"Score Components"}),e.jsx(Y,{children:"How your score breaks down"})]}),e.jsx(N,{className:"space-y-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:ge,children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-blue-900",children:"Technical Skills"}),e.jsx("div",{className:"text-sm text-blue-600",children:"40% weight"})]}),e.jsx("div",{className:"font-display text-3xl text-blue-600",children:((x=s==null?void 0:s.technical)==null?void 0:x.toFixed(1))||"0.0"})]}),e.jsxs("div",{className:ge,children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-green-900",children:"Engagement"}),e.jsx("div",{className:"text-sm text-green-600",children:"30% weight"})]}),e.jsx("div",{className:"font-display text-3xl text-green-600",children:((p=s==null?void 0:s.engagement)==null?void 0:p.toFixed(1))||"0.0"})]}),e.jsxs("div",{className:ge,children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-purple-900",children:"Collaboration"}),e.jsx("div",{className:"text-sm text-purple-600",children:"30% weight"})]}),e.jsx("div",{className:"font-display text-3xl text-purple-600",children:((i=s==null?void 0:s.collaboration)==null?void 0:i.toFixed(1))||"0.0"})]})]})})]})]}),e.jsx(y,{className:H,children:e.jsx(N,{className:"pt-6",children:e.jsx(Lt,{tier1Score:t,isUnavailable:!r})})}),e.jsx(rs,{onBreakdownClick:()=>f("impacts"),onBandsClick:()=>{const n=document.getElementById("score-bands-section");n==null||n.scrollIntoView({behavior:"smooth"})},onImpactsClick:()=>f("impacts")}),e.jsx(y,{id:"score-bands-section",className:H,children:e.jsx(N,{className:"pt-6",children:e.jsx(ss,{currentScore:t||0})})})]}),e.jsx(ee,{value:"timeline",className:"space-y-6",children:e.jsx(y,{className:H,children:e.jsx(N,{className:"pt-6",children:e.jsx(as,{currentScore:t||0,scoreHistory:l})})})}),e.jsx(ee,{value:"activity",className:"space-y-6",children:e.jsx(is,{})}),e.jsx(ee,{value:"impacts",className:"space-y-6",children:e.jsxs(y,{className:H,children:[e.jsxs($,{children:[e.jsx(B,{children:"What Impacts Your Score"}),e.jsx(Y,{children:"Understanding the three pillars of your Signal Score"})]}),e.jsx(N,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"rounded-2xl border border-blue-200/80 bg-blue-50/70 p-6",children:[e.jsx("h3",{className:"font-semibold text-blue-900 mb-3",children:"Technical Skills (40%)"}),e.jsx("p",{className:"text-xs text-blue-600 mb-3 font-medium",children:"What Increases Your Score:"}),e.jsxs("ul",{className:"space-y-2 text-sm text-blue-700",children:[e.jsx("li",{children:"• Assessment scores (up to 10pts per skill)"}),e.jsx("li",{children:"• Sprint technical assessments (1pt per correct answer)"}),e.jsx("li",{children:"• Multiple skill mastery"}),e.jsx("li",{children:"• Proficiency level progression"})]}),e.jsx("p",{className:"text-xs text-red-600 mt-4 mb-2 font-medium",children:"What Decreases Your Score:"}),e.jsx("ul",{className:"space-y-2 text-sm text-red-700",children:e.jsx("li",{children:"• Assessment failure: -2 to -5 pts (progressive)"})})]}),e.jsxs("div",{className:"rounded-2xl border border-green-200/80 bg-green-50/70 p-6",children:[e.jsx("h3",{className:"font-semibold text-green-900 mb-3",children:"Engagement (30%)"}),e.jsx("p",{className:"text-xs text-green-600 mb-3 font-medium",children:"What Increases Your Score:"}),e.jsxs("ul",{className:"space-y-2 text-sm text-green-700",children:[e.jsx("li",{children:"• Story completions (3pts each)"}),e.jsx("li",{children:"• Project completions (5pts each)"}),e.jsx("li",{children:"• Sprint bonus: all stories done (5pts)"}),e.jsx("li",{children:"• Weekly platform activity (2pts per week)"})]}),e.jsx("p",{className:"text-xs text-red-600 mt-4 mb-2 font-medium",children:"What Decreases Your Score:"}),e.jsxs("ul",{className:"space-y-2 text-sm text-red-700",children:[e.jsx("li",{children:"• Story reversion by tech lead: -3 pts"}),e.jsx("li",{children:"• Sprint incomplete: -1.5 pts per story"}),e.jsx("li",{children:"• Sprint assessment expired: -1.5 pts"})]})]}),e.jsxs("div",{className:"rounded-2xl border border-purple-200/80 bg-purple-50/70 p-6",children:[e.jsx("h3",{className:"font-semibold text-purple-900 mb-3",children:"Collaboration (30%)"}),e.jsx("p",{className:"text-xs text-purple-600 mb-3 font-medium",children:"What Increases Your Score:"}),e.jsxs("ul",{className:"space-y-2 text-sm text-purple-700",children:[e.jsx("li",{children:"• Comments posted (0.05pts each)"}),e.jsx("li",{children:"• Sprint on-time completions (2pts each)"}),e.jsx("li",{children:"• Meeting attendance (2pts each)"}),e.jsx("li",{children:"• Team interactions"})]})]})]})})]})}),e.jsx(ee,{value:"improve",className:"space-y-6",children:e.jsx(ms,{})})]})]})})]})]})})}export{er 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.