PageSourceSearch

https://xyrus.ai/_next/static/chunks/5849.a97d2d24aaee6c3b.js

js xyrus.ai collected 2026-10-05 15:10:33 UTC 9,631 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5849],{13940:(e,t,a)=>{a.d(t,{o:()=>l,t:()=>r});var r=function(e){return e.All="all",e.CandidateCreated="candidate_created",e.CandidateAiGeneration="candidate_ai_generation",e.ClientCreated="client_created",e.EngagementCreated="engagement_created",e.CompetencyMapCreated="competency_map_created",e.CompetencySelfAssessmentCompleted="competency_self_assessment_completed",e.ProjectRstSubmitted="project_rst_submitted",e.UserAdded="user_added",e}({});let l={ALL:"all",CANDIDATE_CREATED:"candidate_created",CANDIDATE_AI_GENERATION:"candidate_ai_generation",CLIENT_CREATED:"client_created",ENGAGEMENT_CREATED:"engagement_created",COMPETENCY_MAP_CREATED:"competency_map_created",COMPETENCY_SELF_ASSESSMENT_COMPLETED:"competency_self_assessment_completed",PROJECT_RST_SUBMITTED:"project_rst_submitted",USER_ADDED:"user_added"}},27413:(e,t,a)=>{a.d(t,{F$:()=>d,do:()=>o,jL:()=>s});var r=a(30482),l=a(13940);let i=new Set(Object.values(l.t)),s=e=>(0,r.GP)(e,"yyyy-MM-dd"),n=e=>"object"==typeof e&&null!==e&&"title"in e&&"description"in e&&"string"==typeof e.title,c=e=>Array.isArray(e)?e.filter(n):e&&"object"==typeof e?Array.isArray(e.preview)?e.preview.filter(n):Array.isArray(e.activities)?e.activities.filter(n):Array.isArray(e.items)?e.items.filter(n):Array.isArray(e.data)?e.data.filter(n):e.recent_activities&&"object"==typeof e.recent_activities?c(e.recent_activities):[]:[],d=e=>e.map(e=>{let t=e.occurred_at?(e=>{try{return"Occurred on: ".concat((0,r.GP)(new Date(e),"MMMM d, yyyy"))}catch(e){return""}})(e.occurred_at):void 0,a=(e=>{if(i.has(e)&&e!==l.t.All)return e})(e.activity_type);return{id:"".concat(e.activity_type,"-").concat(e.entity_id||e.created_by_user_id,"-").concat(e.occurred_at),title:e.title,description:e.description,...t?{dateLabel:t}:{},...a?{type:a}:{}}}),o=e=>{var t;if(!e)return{items:[],total:0};if(Array.isArray(e)){let t=e.filter(n);return{items:d(t),total:t.length}}if("object"!=typeof e)return{items:[],total:0};let a=c(null!=(t=e.data)?t:e),r=((e,t)=>{if("number"==typeof e.total_count)return e.total_count;if("number"==typeof e.total)return e.total;let a=e.data;if(a&&"object"==typeof a&&!Array.isArray(a)){if("number"==typeof a.total_count)return a.total_count;if("number"==typeof a.total)return a.total}return t})(e,a.length);return{items:d(a),total:r}}},35849:(e,t,a)=>{a.r(t),a.d(t,{default:()=>f});var r=a(95155),l=a(12115),i=a(47507),s=a(4370),n=a(93366),c=a(75358),d=a(99429),o=a(30590),u=a(13940),m=a(95621),p=a(27413),y=a(73977);let x=()=>(0,n.o)(new Date),E=e=>(0,n.o)(e)>x();function f(e){let{data:t}=e,{filters:a,availableActivityTypes:n,activities:f,isLoading:v,isLoadingMore:h,hasMore:_,hasActiveFilters:A,handleActivityTypeChange:g,handleFromDateChange:C,handleToDateChange:N,handleClearFilters:b,maxSelectableDate:T,scrollContainerRef:j,loadMoreSentinelRef:D}=function(){let[e,t]=(0,l.useState)(u.o.ALL),[a,r]=(0,l.useState)(void 0),[i,s]=(0,l.useState)(void 0),[n,f]=(0,l.useState)([]),[v,h]=(0,l.useState)(0),[_,A]=(0,l.useState)(!0),[g,C]=(0,l.useState)(!1),N=(0,l.useMemo)(()=>x(),[]),b=(0,l.useMemo)(()=>({activityType:e,fromDate:a,toDate:i}),[e,a,i]),T=(0,l.useMemo)(()=>e!==u.o.ALL||void 0!==a||void 0!==i,[e,a,i]),{execute:j,isLoading:D}=(0,c.sO)(e=>d.Sn.DASHBOARD.RECENT_ACTIVITIES_ENDPOINT(e),{queryKey:e=>["dashboard","recent-activities","modal",e],queryFn:async e=>{let t=d.Sn.DASHBOARD.RECENT_ACTIVITIES_ENDPOINT(e);return(0,m.query)(t)}}),S=(0,l.useMemo)(()=>[{label:"All Activities",value:u.o.ALL},{label:"Candidate created",value:u.o.CANDIDATE_CREATED},{label:"Client Created",value:u.o.CLIENT_CREATED},{label:"Engagement Created",value:u.o.ENGAGEMENT_CREATED},{label:"Competency Matrix created",value:u.o.COMPETENCY_MAP_CREATED},{label:"Candidate self assessment submitted",value:u.o.COMPETENCY_SELF_ASSESSMENT_COMPLETED},{label:"Client Competency Assessment submitted",value:u.o.PROJECT_RST_SUBMITTED},{label:"Candidate Xyrus match",value:u.o.CANDIDATE_AI_GENERATION},{label:"New user created",value:u.o.USER_ADDED}],[]),R=(0,l.useRef)(j);R.current=j;let M=(0,l.useRef)(b);M.current=b;let I=(0,l.useRef)(v);I.current=v;let w=(0,l.useRef)(null),L=(0,l.useRef)(null),F=(0,l.useRef)(0),O=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=e?F.current:++F.current;e&&C(!0);let a=e?I.current:0,r=((e,t)=>{let a={[o.uB.SKIP]:t,[o.uB.LIMIT]:10};return e.activityType!==u.o.ALL&&(a[o.uB.ACTIVITY_TYPE]=[e.activityType]),e.fromDate&&(a[o.uB.FROM_DATE]=(0,p.jL)(e.fromDate)),e.toDate&&(
1a[o.uB.TO_DATE]=(0,p.jL)(e.toDate)),a})(M.current,a);try{let a=await R.current(r);if(t!==F.current)return;let{items:l,total:i}=(0,p.do)(a);e?(f(e=>{let t=[...e,...l];return A(t.length<i),t}),h(e=>e+10)):(f(l),h(10),A(l.length<i))}catch(e){t===F.current&&(0,y.yG)("error","Failed to fetch recent activities",{error:e})}finally{e&&C(!1)}},[]),k=(0,l.useRef)(O);k.current=O,(0,l.useEffect)(()=>{h(0),A(!0),f([]),k.current(!1)},[e,a,i]);let P=(0,l.useCallback)(e=>{!(e&&E(e))&&(r(e),e&&i&&e>i&&s(void 0))},[i]),B=(0,l.useCallback)(e=>{e&&E(e)||s(e)},[]),G=(0,l.useCallback)(e=>{t(e)},[]),U=(0,l.useCallback)(()=>{t(u.o.ALL),r(void 0),s(void 0)},[]),Y=(0,l.useCallback)(()=>{!_||g||D||k.current(!0)},[_,g,D]);return(0,l.useEffect)(()=>{let e=w.current,t=L.current;if(!e||!t||!_||0===n.length||D)return;let a=new IntersectionObserver(e=>{let t=e[0];(null==t?void 0:t.isIntersecting)&&Y()},{root:e,rootMargin:"0px 0px 80px 0px",threshold:.1});return a.observe(t),()=>a.disconnect()},[n.length,_,D,g,Y]),{filters:b,availableActivityTypes:S,activities:n,isLoading:D&&!g,isLoadingMore:g,hasMore:_,hasActiveFilters:T,handleActivityTypeChange:G,handleFromDateChange:P,handleToDateChange:B,handleClearFilters:U,maxSelectableDate:N,scrollContainerRef:w,loadMoreSentinelRef:L}}();return(0,r.jsxs)("div",{className:"flex flex-1 min-h-0 w-full flex-col overflow-hidden",children:[(0,r.jsxs)("div",{className:"shrink-0 space-y-4 pb-4",children:[(0,r.jsxs)("div",{className:"space-y-2.5",children:[(0,r.jsx)("label",{className:"text-[13px] font-medium text-gray-900 tracking-tight",children:"Activity Type*"}),(0,r.jsxs)(i.Select,{value:a.activityType,onValueChange:e=>g(e),children:[(0,r.jsx)(i.SelectTrigger,{className:"w-full h-[46px] mt-2 border-[#E5E7EB] bg-white text-[14px] font-medium text-gray-700 rounded-lg shadow-sm cursor-pointer",children:(0,r.jsx)(i.SelectValue,{placeholder:"Select"})}),(0,r.jsx)(i.SelectContent,{className:"bg-white z-99999",children:n.map(e=>(0,r.jsx)(i.SelectItem,{value:e.value,className:"cursor-pointer",children:e.label},e.label))})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-[13px] font-medium text-gray-900 tracking-tight",children:"Date Range*"}),A?(0,r.jsx)("button",{type:"button",onClick:b,className:"cursor-pointer text-[13px] text-gray-600 hover:text-gray-900 hover:underline","data-testid":"recent-activities-clear-filters",children:"Clear Filters"}):null]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsx)("span",{className:"space-y-1",children:(0,r.jsx)(s.DatePicker,{value:a.fromDate,onChange:e=>C(e||void 0),maxDate:T,label:"From",calendarOnly:!0,className:"h-[46px] border-[#E5E7EB] rounded-lg"})}),(0,r.jsx)("span",{className:"space-y-1",children:(0,r.jsx)(s.DatePicker,{value:a.toDate,onChange:e=>N(e||void 0),minDate:a.fromDate,maxDate:T,label:"To",calendarOnly:!0,className:"h-[46px] border-[#E5E7EB] rounded-lg"})})]})]})]}),(0,r.jsx)("div",{ref:j,className:"flex-1 min-h-0 overflow-y-auto space-y-3 pr-1 max-h-[calc(100vh-240px)]","data-testid":"recent-activities-modal-list",children:v&&!h?(0,r.jsx)(r.Fragment,{children:[1,2,3].map(e=>(0,r.jsxs)("div",{className:"rounded-xl bg-[#F9FAFB] p-4 space-y-2","data-testid":"recent-activities-modal-skeleton","aria-hidden":!0,children:[(0,r.jsx)("div",{className:"h-4 w-3/4 animate-pulse rounded-md bg-gray-200"}),(0,r.jsx)("div",{className:"h-3 w-full animate-pulse rounded-md bg-gray-200"})]},e))}):0===f.length?(0,r.jsx)("div",{className:"rounded-lg bg-[#F9FAFB] p-4",children:(0,r.jsx)("p",{className:"text-sm text-gray-500","data-testid":"recent-activities-modal-empty",children:"No activities found."})}):(0,r.jsxs)(r.Fragment,{children:[f.map(e=>(0,r.jsx)("div",{className:"rounded-xl bg-[#F9FAFB] p-4","data-testid":"recent-activity-modal-item",children:(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)("div",{className:"h-10 w-10 shrink-0 rounded-full bg-[#EEF2F7] flex items-center justify-center text-[12px] font-extrabold text-gray-700",children:e.title.split(" ").map(e=>
1e.trim()).filter(Boolean).slice(0,2).map(e=>{var t;return(null==(t=e[0])?void 0:t.toUpperCase())||""}).join("")||"NA"}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"font-medium text-[15px] text-gray-900 tracking-tight",children:e.title}),(0,r.jsx)("p",{className:"text-[13px] text-gray-500 font-medium",children:e.description}),e.dateLabel?(0,r.jsx)("p",{className:"mt-1 text-[12px] text-gray-400 font-medium",children:e.dateLabel}):null]})]})},e.id)),_?(0,r.jsx)("div",{ref:D,className:"h-4 w-full shrink-0","data-testid":"recent-activities-load-more-sentinel","aria-hidden":!0}):null,h?(0,r.jsxs)("div",{className:"rounded-xl bg-[#F9FAFB] p-4 space-y-2","data-testid":"recent-activities-modal-loading-more","aria-hidden":!0,children:[(0,r.jsx)("div",{className:"h-4 w-3/4 animate-pulse rounded-md bg-gray-200"}),(0,r.jsx)("div",{className:"h-3 w-full animate-pulse rounded-md bg-gray-200"})]}):null]})})]})}}}]);

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.