PageSourceSearch

https://www.connectupskill.com/_next/static/chunks/2072-475d5ad273ba7863.js

js connectupskill.com collected 2026-10-04 04:18:00 UTC 27,881 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2072],{61225:function(e,t,r){r.d(t,{l:function(){return useAuthRedirect}});var s=r(73606),a=r(11163),n=r(67294);let useAuthRedirect=()=>{let{user:e,isLoading:t}=(0,s.aF)(),r=(0,a.useRouter)(),i=(0,n.useCallback)(s=>{if(t)return!1;if(!e){let e="/api/auth/login?user_type=RECRUITER&returnTo=".concat(encodeURIComponent(s));return r.push(e),!1}return!0},[e,t,r]);return{isAuthenticated:!!e,isLoading:t,requireAuth:i}}},5709:function(e,t,r){r.d(t,{X:function(){return LinkSearchToJobsModal}});var s=r(85893),a=r(67294),n=r(94491),i=r(97564),o=r(96768),l=r(49737),c=r(95117),d=r(87092),u=r(64523),h=r(54685),m=r(28855),g=r(74403),p=r(71232),v=r(67841),b=r(3600),f=r(17010),y=r(41664),w=r.n(y),S=r(74922),k=r(58959),x=r(70311),C=r(42294),j=r(45938);let LinkSearchToJobsModal=e=>{var t,r;let{opened:y,onClose:E,collectionId:A,searchRequestId:P,totalFound:R}=e,D=k.h.useContext(),{me:I}=(0,x.P)(),M=null!==(r=null==I?void 0:null===(t=I.recruiter)||void 0===t?void 0:t.id)&&void 0!==r?r:null,{jobOptions:F,isLoading:z}=(0,C.w)({recruiterId:M}),[O,N]=(0,a.useState)([]),[T,q]=(0,a.useState)(null),{data:L,isLoading:W}=k.h.candidateDiscovery.getLinkedJobsForSearchRequest.useQuery({collectionId:A,searchRequestId:P},{enabled:y&&!!(A||P)}),U=k.h.candidateDiscovery.linkSearchRequestToJobs.useMutation(),B=k.h.candidateDiscovery.unlinkSearchRequestFromJobs.useMutation(),_=(0,a.useMemo)(()=>{var e;return null!==(e=null==L?void 0:L.links)&&void 0!==e?e:[]},[null==L?void 0:L.links]),V=(0,a.useMemo)(()=>new Set(_.map(e=>e.jobId)),[_]);(0,a.useEffect)(()=>{y&&(N(Array.from(V)),q(null))},[y,V]);let J=U.isLoading||B.isLoading,Q=z||W,H=(0,a.useMemo)(()=>{let e=new Set(O);if(e.size!==V.size)return!0;for(let t of e)if(!V.has(t))return!0;return!1},[O,V]),K=(0,a.useMemo)(()=>{let e=new Set(O);return F.filter(t=>!e.has(t.value))},[F,O]),handleSave=async()=>{if(W)return;let e=new Set(O),t=O.filter(e=>!V.has(e)),r=Array.from(V).filter(t=>!e.has(t));if(0===t.length&&0===r.length)return;let errorMessageOf=e=>e instanceof Error?e.message:"Unknown error",a=[];t.length>0&&a.push(U.mutateAsync({collectionId:A,searchRequestId:P,jobIds:t}).then(e=>({kind:"link",ok:!0,syncSummary:e.syncSummary})).catch(e=>({kind:"link",ok:!1,error:errorMessageOf(e)}))),r.length>0&&a.push(B.mutateAsync({collectionId:A,searchRequestId:P,jobIds:r}).then(()=>({kind:"unlink",ok:!0})).catch(e=>({kind:"unlink",ok:!1,error:errorMessageOf(e)})));let n=await Promise.all(a);await D.candidateDiscovery.getLinkedJobsForSearchRequest.invalidate({collectionId:A,searchRequestId:P});let i=n.filter(e=>!e.ok);if(i.length>0){let e=i.map(e=>"link"===e.kind?"Could not link ".concat(t.length," job(s): ").concat(e.error):"Could not unlink ".concat(r.length," job(s): ").concat(e.error));S.N9.show({title:"Failed to save changes",message:e.join(" "),color:"red",icon:(0,s.jsx)(b.Z,{size:16}),autoClose:!1});return}let o=[],l=n.find(e=>"link"===e.kind&&e.ok);if(l){o.push("Linked ".concat(t.length," job(s)"));let e=l.syncSummary.created+l.syncSummary.updated;o.push("imported ".concat(e," candidate(s)")),l.syncSummary.skipped>0&&o.push("".concat(l.syncSummary.skipped," already on the job — skipped"))}n.some(e=>"unlink"===e.kind&&e.ok)&&o.push("unlinked ".concat(r.length," job(s)")),S.N9.show({title:"Jobs updated",message:o.join(", ")+".",color:"green"}),E()},Z="number"==typeof R?"Link to job (".concat(R," search result").concat(1===R?"":"s",")"):"Link to job";return(0,s.jsx)(n.u,{opened:y,onClose:E,title:Z,size:"lg",radius:"md",closeOnClickOutside:!J,closeOnEscape:!J,withCloseButton:!J,children:(0,s.jsxs)(i.K,{spacing:(0,o.h)(12),pos:"relative",children:[(0,s.jsx)(l.f,{visible:J,overlayBlur:2,loaderProps:{size:"sm"}}),(0,s.jsxs)(i.K,{spacing:(0,o.h)(8),children:[(0,s.jsx)(c.x,{size:"sm",c:"dimmed",children:"Use dropdown to add jobs, uncheck to remove. Click job titles to view dashboards. Future search results are synced to linked jobs automatically."}),(0,s.jsx)(c.x,{size:"sm",fw:600,children:"Link to jobs:"}),O.length>0?(0,s.jsx)(i.K,{spacing:(0,o.h)(4),children:O.map(e=>{let t=F.find(t=>t.value===e);return t?(0,s.jsx)(d.X,{checked:!0,onChange:t=>{t.currentTarget.checked||N(O.filter(t=>t!==e))},label:(0,s.jsxs)(u.x,{children:[(0,s.jsx)(h.e,{href:j.P.JOB_APPLICATIONS(e),target:"_blank",size:"sm",td:"underline",onClick:e=>e.stopPropagation(),children:t.label}),t.group&&(0,s.jsxs)(c.x,{size:"xs",c:"dimmed",component:"span",ml:(0,o.h)(6),children:["• ",t.group]})]}),disabled:Q||J},e):null})}):(0,s.jsx)(c.x,{size:"sm",c:"dimmed",children:"No jobs selected"})]}),K.length>0&&(0,s.jsx)(m.Ph,{placeholder:"Select a job to add...",data:K,value:T,onChange:e=>{e&&!O.includes(e)&&(N([...O,e]),q(null))},searchable:!0,nothingFound:"No more jobs available",disabled:Q||J,radius:"md",withinPortal:!0}),!Q&&0===F.length&&(0,s.jsxs)(g.b,{icon:(0,s.jsx)(f.Z,{size:"1rem"}),color:"blue",radius:"md",children:[(0,s.jsx)(c.x,{size:"sm",fw:500,children:"No jobs available"}),(0,s.jsxs)(c.x,{size:"xs",children:["You need to create a job first before linking search results."," ",(0,s.jsx)(w(),{href:j.P.CREATE_JOB(),passHref:!0,legacyBehavior:!0,children:(0,s.jsx)(h.e,{size:"xs",children:"Create a new job"})})]})]}),!Q&&F.length>0&&0===K.length&&O.length===F.length&&(0,s.jsxs)(g.b,{icon:(0,s.jsx)(f.Z,{size:"1rem"}),color:"blue",radius:"md",children:[(0,s.jsx)(c.x,{size:"sm",fw:500,children:"All jobs are already linked"}),(0,s.jsxs)(c.x,{size:"xs",children:["All available jobs are linked to this search request."," ",(0,s.jsx)(w(),{href:j.P.CREATE_JOB(),passHref:!0,legacyBehavior:!0,children:(0,s.jsx)(h.e,{size:"xs",children:"Create a new job"})})]})]}),(0,s.jsxs)(p.Z,{position:"right",children:[(0,s.jsx)(v.z,{variant:"default",onClick:E,disabled:J,radiu
1s:"md",children:"Cancel"}),(0,s.jsx)(v.z,{onClick:()=>void handleSave(),loading:J,disabled:!(!Q&&!J&&H),radius:"md",children:"Save Changes"})]})]})})}},27020:function(e,t,r){r.d(t,{c:function(){return PostSearchUpdatesModal}});var s=r(85893),a=r(67294),n=r(94491),i=r(71232),o=r(96768),l=r(95117),c=r(97564),d=r(61885),u=r(80061),h=r(28855),m=r(88393),g=r(67841),p=r(49801),v=r(74922),b=r(58959),f=r(70311);let PostSearchUpdatesModal=e=>{var t;let{opened:r,onClose:y,collectionId:w,searchRequestId:S,totalFound:k}=e,{me:x}=(0,f.P)({}),[C,j]=(0,a.useState)(!0),[E,A]=(0,a.useState)(""),[P,R]=(0,a.useState)(!1),[D,I]=(0,a.useState)(null),M=b.h.useContext(),F=b.h.candidateDiscovery.updateSearchRequestMetadata.useMutation({onSuccess:()=>{S&&M.candidateDiscovery.getSearchRequest.invalidate({id:S}),M.candidateDiscovery.getMyAgents.invalidate()}}),{data:z}=b.h.slack.hasIntegration.useQuery(),O=!!(null==z?void 0:z.hasSlack),{data:N}=b.h.slack.listChannels.useQuery(void 0,{enabled:P,staleTime:6e4}),T=(null!==(t=null==N?void 0:N.channels)&&void 0!==t?t:[]).map(e=>({value:e.id,label:"#".concat(e.name)}));(0,a.useEffect)(()=>{r&&(null==x?void 0:x.email)&&A(x.email)},[r,null==x?void 0:x.email]);let handleSkip=()=>{F.mutate({collectionId:w,searchRequestId:S,metadata:{modalSeen:!0,updatesEnabled:!1,slackEnabled:!1}},{onSuccess:y})};return(0,s.jsx)(n.u,{opened:r,onClose:()=>{handleSkip()},title:(0,s.jsxs)(i.Z,{spacing:(0,o.h)(8),noWrap:!0,align:"center",children:[(0,s.jsx)(p.Z,{size:18,color:"#1CB3FF"}),(0,s.jsx)(l.x,{fw:700,fz:(0,o.h)(18),children:"Get status updates"})]}),radius:"lg",size:"sm",centered:!0,closeOnClickOutside:!1,closeOnEscape:!1,children:(0,s.jsxs)(c.K,{spacing:(0,o.h)(16),children:[(0,s.jsx)(l.x,{size:"sm",c:"dimmed",children:"Your agent is searching the web and evaluating candidates against your criteria. This runs in the background — we'll notify you as qualified matches come in."}),(0,s.jsx)(d.r,{label:"Keep me updated via email",checked:C,onChange:e=>j(e.currentTarget.checked),size:"md"}),C&&(0,s.jsx)(u.o,{label:"Send updates to",placeholder:"[email protected]",value:E,onChange:e=>A(e.currentTarget.value),size:"sm",radius:"md",type:"email"}),O?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.r,{label:"Keep me updated via Slack",checked:P,onChange:e=>R(e.currentTarget.checked),size:"md"}),P&&(0,s.jsx)(h.Ph,{label:"Slack channel",placeholder:"Select a channel",data:T,value:D,onChange:I,size:"sm",radius:"md",searchable:!0,withinPortal:!0,nothingFound:"No channels — invite the bot first"})]}):(0,s.jsx)(m.u,{label:"Slack not connected — set up in Settings",withArrow:!0,position:"right",withinPortal:!0,children:(0,s.jsx)("div",{children:(0,s.jsx)(d.r,{label:"Keep me updated via Slack",checked:!1,disabled:!0,size:"md",styles:{label:{color:"#adb5bd"}}})})}),(0,s.jsx)(i.Z,{position:"right",mt:(0,o.h)(8),children:(0,s.jsx)(g.z,{radius:"md",onClick:()=>{var e,t;F.mutate({collectionId:w,searchRequestId:S,metadata:{modalSeen:!0,updatesEnabled:C,notifyEmail:C?E.trim():void 0,slackEnabled:P,slackChannelId:P?D:void 0,slackChannelName:P?null==N?void 0:null===(t=N.channels)||void 0===t?void 0:null===(e=t.find(e=>e.id===D))||void 0===e?void 0:e.name:void 0}},{onSuccess:()=>{let e=C||P;v.N9.show({title:e?"Notifications enabled":"Notifications disabled",message:e?"We'll let you know as your agent finds more candidates.":"You won't receive updates for this search.",color:e?"green":"gray"}),y()}})},loading:F.isLoading,disabled:C&&!E.trim()||P&&!D,children:"Save"})})]})})}},71002:function(e,t,r){r.d(t,{RU:function(){return showCandidateDiscoveryError},Tr:function(){return extractCandidateDiscoveryErrorFromUnknown}});var s=r(74922);let a=new Map,n=["concurrent","queue","capacity"],i=["credit","credits","quota","insufficient","limit"],o=["rate limit","too many requests","429"],l=["unauthorized","forbidden","invalid api key","authentication"],isRecord=e=>"object"==typeof e&&null!==e,normalizeMessage=e=>"string"==typeof e?e.toLowerCase():e instanceof Error?e.message.toLowerCase():"",hasHint=(e,t)=>t.some(t=>e.includes(t)),normalizeType=e=>{if("string"!=typeof e)return null;let t=e.trim().toUpperCase();return"CREDIT_LIMIT"===t||"QUEUE_FULL"===t||"RATE_LIMIT"===t||"AUTH"===t||"UNKNOWN"===t?t:null},coercePayload=e=>{if(!isRecord(e))return null;let t=normalizeType(e.type);return t?{type:t,statusCode:"number"==typeof e.statusCode?e.statusCode:null,providerMessage:"string"==typeof e.providerMessage?e.providerMessage:null,retryable:"boolean"==typeof e.retryable?e.retryable:void 0,searchRequestId:"string"==typeof e.searchRequestId?e.searchRequestId:null,websetId:"string"==typeof e.websetId?e.websetId:null}:null},findPayloadInError=e=>{if(!isRecord(e))return null;let t=isRecord(e.data)?coercePayload(e.data.candidateDiscoveryError):null;if(t)return t;let r=isRecord(e.shape)&&isRecord(e.shape.data)?coercePayload(e.shape.data.candidateDiscoveryError):null;if(r)return r;let s=isRecord(e.cause)?coercePayload(e.cause.candidateDiscoveryError):null;return s},classifyFromMessage=e=>hasHint(e,n)?"QUEUE_FULL":hasHint(e,i)?"CREDIT_LIMIT":hasHint(e,o)?"RATE_LIMIT":hasHint(e,l)?"AUTH":"UNKNOWN",extractCandidateDiscoveryErrorFromUnknown=e=>{let t=findPayloadInError(e);
1if(t)return t;let r=normalizeMessage(e);return{type:classifyFromMessage(r),providerMessage:r||null}},getMessageConfig=e=>"CREDIT_LIMIT"===e?{title:"Agent credits limit reached",message:"You've run out of agent credits. Contact [email protected] to increase access."}:"RATE_LIMIT"===e?{title:"Search provider is busy",message:"We're temporarily hitting provider rate limits. Please wait a moment and try again."}:"AUTH"===e?{title:"Search provider configuration issue",message:"Candidate search is temporarily unavailable due to provider authentication. Please contact support."}:{title:"Search failed",message:"Search request failed. Please try again in a moment."},showCandidateDiscoveryError=e=>{var t,r;let{error:n,source:i,websetId:o,searchRequestId:l,cooldownMs:c=15e3}=e,d=extractCandidateDiscoveryErrorFromUnknown(n);if("QUEUE_FULL"===d.type)return;let u=[d.type,i,null!==(t=null!=o?o:d.websetId)&&void 0!==t?t:"none",null!==(r=null!=l?l:d.searchRequestId)&&void 0!==r?r:"none"].join(":"),h=Date.now(),m=a.get(u);if(m&&h-m<c)return;a.set(u,h);let g=getMessageConfig(d.type);s.N9.show({title:g.title,message:g.message,color:"red"})}},76772:function(e,t,r){r.d(t,{ZB:function(){return WebsetDetailProvider},oE:function(){return useWebsetDetail}});var s=r(85893),a=r(67294),n=r(11163),i=r(58959),o=r(71002),l=r(74922);let sortEnrichmentsByOrderOrName=e=>e.slice().sort((e,t)=>{var r,s;let a=null===(r=e.metadata)||void 0===r?void 0:r.order,n=null===(s=t.metadata)||void 0===s?void 0:s.order,i=null!=a,o=null!=n;return i&&o?parseInt(a)-parseInt(n):i&&!o?-1:!i&&o?1:(e.description||"").localeCompare(t.description||"")}),c=(0,a.createContext)(null),useWebsetDetail=()=>{let e=(0,a.useContext)(c);if(!e)throw Error("useWebsetDetail must be used within a WebsetDetailProvider");return e},WebsetDetailProvider=e=>{let{children:t,websetId:r,disableAutoLoad:d=!1}=e,u=i.h.useContext(),h=(0,n.useRouter)(),m="table"===h.query.view?"table":"cards",[g,p]=(0,a.useState)(null),[v,b]=(0,a.useState)([]),[f,y]=(0,a.useState)(100),[w,S]=(0,a.useState)(!0),[k,x]=(0,a.useState)(!0),[C,j]=(0,a.useState)(!1),[E,A]=(0,a.useState)(!1),[P,R]=(0,a.useState)(m),[D,I]=(0,a.useState)(null),[M,F]=(0,a.useState)(!1),[z,O]=(0,a.useState)(!1),N=(0,a.useRef)(null),T=(0,a.useMemo)(()=>{if(!(null==g?void 0:g.searches)||0===g.searches.length)return 0;let e=g.searches.findLastIndex(e=>"override"===e.behavior),t=e>=0?g.searches.slice(e):g.searches;return t.reduce((e,t)=>{var r;return e+((null===(r=t.progress)||void 0===r?void 0:r.found)||0)},0)},[null==g?void 0:g.searches]),q=(0,a.useMemo)(()=>{if(!(null==g?void 0:g.searches)||0===g.searches.length)return 0;let e=g.searches.findLastIndex(e=>"override"===e.behavior),t=e>=0?g.searches.slice(e):g.searches;return t.reduce((e,t)=>{var r;return e+((null===(r=t.progress)||void 0===r?void 0:r.analyzed)||0)},0)},[null==g?void 0:g.searches]),L=i.h.candidateDiscovery.pollWebSetItems.useQuery({websetId:r,cursor:void 0,limit:f},{enabled:!1,refetchOnMount:!1,refetchOnReconnect:!1,staleTime:1/0,refetchOnWindowFocus:!1,onError:e=>{(0,o.RU)({error:e,source:"webset-detail.poll-webset-items",websetId:r})},onSuccess:e=>{e&&((e.searches||e.enrichments||e.status)&&p(t=>{var s;let a=(null===(s=e.searches)||void 0===s?void 0:s.map(e=>{var t;return{...e,criteria:null===(t=e.criteria)||void 0===t?void 0:t.slice().sort((e,t)=>{var r,s,a,n;let i=parseInt(null!==(a=null===(r=e.metadata)||void 0===r?void 0:r.order)&&void 0!==a?a:"999"),o=parseInt(null!==(n=null===(s=t.metadata)||void 0===s?void 0:s.order)&&void 0!==n?n:"999");return i-o})}}))||(null==t?void 0:t.searches)||[],n=e.enrichments?sortEnrichmentsByOrderOrName(e.enrichments):(null==t?void 0:t.enrichments)||[],i={...t||{},id:r,status:e.status,searches:a,enrichments:n};return JSON.stringify(t)===JSON.stringify(i)?t||{}:i}),e.items&&(b(e.items),S(e.hasMore||!1)),x(!1))}});(0,a.useEffect)(()=>{var e,t;if(!g)return;let r=null===(e=g.searches)||void 0===e?void 0:e.some(e=>"running"===e.status||"pending"===e.status||"created"===e.status),s=null===(t=g.enrichments)||void 0===t?void 0:t.some(e=>"pending"===e.status);if(r||s||z){let e=setInterval(()=>{L.refetch()},3e3);return()=>clearInterval(e)}},[g,L,z]),(0,a.useEffect)(()=>
1{if(d)return;let loadWebset=async()=>{try{x(!0),b([]);let e=await u.candidateDiscovery.getWebSetPublic.fetch({websetId:r});if(e.success&&e.webset){let t={...e.webset,enrichments:e.webset.enrichments?sortEnrichmentsByOrderOrName(e.webset.enrichments):[]};p(t)}x(!1)}catch(e){console.error("Failed to load webset:",e),x(!1),(0,o.RU)({error:e,source:"webset-detail.load-webset",websetId:r})}};loadWebset()},[r]),(0,a.useEffect)(()=>{d||L.refetch()},[]),(0,a.useEffect)(()=>{if(d)return;let checkPendingRequest=async()=>{try{let e=await u.candidateDiscovery.getPendingSearchRequestForWebset.fetch({websetId:r});e&&(I(e),Y(e.id,e.resultsRequested))}catch(e){console.error("Failed to check for pending requests:",e)}};checkPendingRequest()},[r]);let W=i.h.candidateDiscovery.cancelWebSetSearch.useMutation({onSuccess:()=>{l.N9.show({title:"Search stopped",message:"All running searches have been stopped",color:"blue"})},onError:e=>{l.N9.show({title:"Failed to stop search",message:e.message,color:"red"})}}),U=i.h.candidateDiscovery.updateWebSetCriteria.useMutation({onSuccess:()=>{u.candidateDiscovery.getWebSetPublic.invalidate({websetId:r}),u.candidateDiscovery.pollWebSetItems.invalidate({websetId:r})},onError:e=>{(0,o.RU)({error:e,source:"webset-detail.update-criteria",websetId:r})}}),B=i.h.candidateDiscovery.createWebSetEnrichments.useMutation({onSuccess:()=>{u.candidateDiscovery.getWebSetPublic.invalidate({websetId:r}),u.candidateDiscovery.pollWebSetItems.invalidate({websetId:r})},onError:e=>{(0,o.RU)({error:e,source:"webset-detail.create-enrichments",websetId:r})}}),_=i.h.candidateDiscovery.createSearchRequestForExpansion.useMutation(),V=i.h.candidateDiscovery.processSearchRequest.useMutation(),J=i.h.candidateDiscovery.cancelSearchRequestForWebset.useMutation(),Q=(0,a.useCallback)(()=>{if(!(null==g?void 0:g.searches))return;let e=g.searches.filter(e=>"running"===e.status||"pending"===e.status);e.forEach(e=>{W.mutate({websetId:g.id,searchId:e.id})})},[g,W]),H=(0,a.useCallback)(async()=>{if(r){A(!0);try{var e,t,s,a;let n=await u.candidateDiscovery.getAllWebSetItemsForExport.fetch({websetId:r}),i=(null===(e=n.webset)||void 0===e?void 0:e.items)||[],o=(null===(s=i[0])||void 0===s?void 0:null===(t=s.evaluations)||void 0===t?void 0:t.map(e=>({criterion:e.criterion})))||[],c=(null==g?void 0:null===(a=g.enrichments)||void 0===a?void 0:a.map(e=>({id:e.id,title:e.description})))||[],d=o.map(e=>e.criterion),h=c.flatMap(e=>[e.title,"".concat(e.title," - Reasoning")]),m=["Name","Position","Company","Location","URL",...d,...h],p=i.map(e=>{var t,r;let s="person"===e.properties.type?e.properties.person:null,a=[(null==s?void 0:s.name)||"",(null==s?void 0:s.position)||"",(null==s?void 0:null===(t=s.company)||void 0===t?void 0:t.name)||"",(null==s?void 0:s.location)||(null==s?void 0:null===(r=s.company)||void 0===r?void 0:r.location)||"",e.properties.url||""],n=o.map(t=>{var r;let s=null===(r=e.evaluations)||void 0===r?void 0:r.find(e=>e.criterion===t.criterion);return(null==s?void 0:s.reasoning)||""}),i=c.flatMap(t=>{var r;let s=null===(r=e.enrichments)||void 0===r?void 0:r.find(e=>e.enrichmentId===t.id);if(!s)return["",""];let a=s.result,n="";"string"==typeof a?n=a:Array.isArray(a)&&(n=a.join("; "));let i=s.reasoning||"";return[n,i]});return[...a,...n,...i].map(e=>'"'.concat(String(e||"").replace(/"/g,'""'),'"')).join(",")}),v=[m.join(","),...p].join("\n"),b=new Blob([v],{type:"text/csv;charset=utf-8;"}),f=document.createElement("a");f.href=URL.createObjectURL(b),f.download="candidates-".concat(new Date().toISOString().split("T")[0]||"export",".csv"),f.click(),l.N9.show({title:"Export successful",message:"Exported ".concat(i.length," candidates to CSV"),color:"green"})}catch(e){console.error("Failed to export:",e),l.N9.show({title:"Export failed",message:"Failed to export results",color:"red"})}finally{A(!1)}}},[r,g,u.candidateDiscovery.getAllWebSetItemsForExport]),K=(0,a.useCallback)(async(e,t)=>{await U.mutateAsync({websetId:r,criteria:t.map(e=>({description:e,successRate:80}))});let s=await u.candidateDiscovery.getWebSetPublic.fetch({websetId:r});if(s.success&&s.webset){let e={...s.webset,enrichments:s.webset.enrichments?sortEnrichmentsByOrderOrName(s.webset.enrichments):[]};p(e)}L.refetch()},[r,U,u,L]),Z=(0,a.useCallback)(async e=>{await B.mutateAsync({websetId:r,enrichments:e.map(e=>({description:e.description,format:e.format,options:e.options}))});let t=await u.candidateDiscovery.getWebSetPublic.fetch({websetId:r});if(t.success&&t.webset){let e={...t.webset,enrichments:t.webset.enrichments?sortEnrichmentsByOrderOrName(t.webset.enrichments):[]};p(e)}L.refetch()},[r,B,u,L]),Y=(0,a.useCallback)(async(e,t)=>{F(!0);let attemptProcess=async()=>{try{let t=await V.mutateAsync({searchRequestId:e});if("cancelled"in t){I(null),F(!1),O(!1);return}if("success"in t){let e=await u.candidateDiscovery.getWebSetPublic.fetch({websetId:r});if(e.success&&e.webset){let t={...e.webset,enrichments:e.webset.enrichments?sortEnrichmentsByOrderOrName(e.webset.enrichments):[]};p(t)}I(null),F(!1),O(!1),L.refetch()}else"queueFull"in t&&(O(!0),z||l.N9.show({title:"Search queued",message:"We'll start your search as soon as capacity is available",color:"blue",autoClose:5e3}),N.current=setTimeout(()=>{attemptProcess()},1e4))}catch(t){console.error("Failed to process search request:",t),I(null),F(!1),O(!1),(0,o.RU)({error:t,source:"webset-detail.process-search-request",websetId:r,searchRequestId:e})}};await attemptProcess()},[V,u,r,L,z]),X=(0,a.useCallback)(async e=>{try{N.current&&(clearTimeout(N.current),N.current=null);let t=await _.mutateAsync({websetId:r,count:e});I(t.searchRequest),F(!0),await u.candidateDiscovery.getWebSetPublic.fetch({websetId:r}).then(e=>{if(e.success&&e.webset){let t={...e.webset,enrichments:e.webset.enrichments?sortEnrichmentsByOrderOrName(e.webset.enrichments):[]};p(t)}}
1),Y(t.searchRequestId,e)}catch(e){console.error("Failed to create expansion request:",e),F(!1),O(!1),(0,o.RU)({error:e,source:"webset-detail.create-expansion-request",websetId:r})}},[r,_,Y,u]),G=(0,a.useCallback)(async()=>{try{N.current&&(clearTimeout(N.current),N.current=null),await J.mutateAsync({websetId:r}),I(null),F(!1),O(!1),l.N9.show({title:"Search canceled",message:"Expansion request has been canceled",color:"blue"})}catch(e){console.error("Failed to cancel expansion:",e)}},[r,J]),$=(0,a.useCallback)(async()=>{if(w&&!C){j(!0);try{let e=f+100,t=await u.candidateDiscovery.pollWebSetItems.fetch({websetId:r,cursor:void 0,limit:e});(null==t?void 0:t.items)&&(b(t.items),S(t.hasMore||!1),y(e))}catch(e){console.error("Failed to load more items:",e),l.N9.show({title:"Failed to load more",message:"Could not load more candidates",color:"red"})}finally{j(!1)}}},[w,C,f,r,u]),ee=(0,a.useCallback)(e=>{R(e);let t="cards"===e?{...h.query,view:void 0}:{...h.query,view:"table"};h.push({pathname:h.pathname,query:t},void 0,{shallow:!0})},[h]),et=(0,a.useCallback)(()=>L.refetch(),[L]);return(0,s.jsx)(c.Provider,{value:{webset:g,loadedItems:v,totalFound:T,totalAnalyzed:q,hasMore:w,isLoading:k,isLoadingMore:C,isExporting:E,viewMode:P,pendingSearchRequest:D,isProcessingSearchRequest:M,isSearchQueued:z,stopSearch:Q,exportResults:H,updateCriteria:K,updateEnrichments:Z,expandSearch:X,cancelExpansion:G,loadMore:$,setViewMode:ee,refetchWebset:et},children:t})}},87908:function(e,t,r){r.d(t,{K:function(){return AgentStatusDisplay}});var s=r(85893);r(67294);var a=r(69876),n=r(96768),i=r(17789),o=r(88393),l=r(3941),c=r(70917),d=r(64523);let u=(0,c.F4)({"0%":{opacity:1,transform:"scale(1)"},"50%":{opacity:.4,transform:"scale(0.75)"},"100%":{opacity:1,transform:"scale(1)"}}),LiveDot=e=>{let{color:t="#1CB3FF",size:r=8}=e;return(0,s.jsx)(d.x,{sx:{width:(0,n.h)(r),height:(0,n.h)(r),borderRadius:"50%",backgroundColor:t,animation:"".concat(u," 1.5s ease-in-out infinite"),flexShrink:0}})},AgentStatusDisplay=e=>{var t;let{status:r,showLiveDot:c=!1,liveDotColor:d="#1CB3FF",liveDotSize:u,size:h="sm"}=e;return(0,s.jsxs)(a.k,{align:"center",gap:(0,n.h)(8),style:{flex:1,minWidth:0},children:[c&&(0,s.jsx)(LiveDot,{color:d,size:null!=u?u:"md"===h?8:6}),(0,s.jsx)(i.C,{size:h,color:r.color,variant:r.variant,style:{flexShrink:0},children:r.label}),r.showProgress&&(0,s.jsx)(o.u,{label:null!==(t=r.detail)&&void 0!==t?t:r.label,withArrow:!0,position:"top",withinPortal:!0,disabled:!r.detail,children:(0,s.jsx)(l.E,{value:r.progressValue,size:"md"===h?"sm":"xs",radius:"xl",color:r.progressColor,animate:r.progressAnimate,style:{flex:1,minWidth:(0,n.h)(40)}})})]})}},32604:function(e,t,r){r.d(t,{D:function(){return computeAgentStepStatus}});var s=r(18816);let a={label:"Done",color:"green",variant:"light",progressValue:100,progressAnimate:!1,progressColor:"green",showProgress:!0,detail:null},computeAgentStepStatus=e=>{var t,r,n,i,o,l,c,d,u,h;if(e.isArchived||"archived"===e.currentStep)return{label:"Archived",color:"gray",variant:"light",progressValue:0,progressAnimate:!1,progressColor:"gray",showProgress:!1,detail:null};if(e.isStoppingSchedule)return{label:"Stopping",color:"yellow",variant:"light",progressValue:50,progressAnimate:!0,progressColor:"yellow",showProgress:!0,detail:"Cancelling in-flight search…"};if(e.isQueued)return{label:"Queued",color:"orange",variant:"light",progressValue:100,progressAnimate:!0,progressColor:"orange",showProgress:!0,detail:"Waiting in the search queue…"};if(e.hasPendingRequest)return{label:"Starting…",color:"blue",variant:"light",progressValue:100,progressAnimate:!0,progressColor:"blue",showProgress:!0,detail:"Starting the search…"};if(e.isActivelyAdding){let r=null!==(t=e.addingCount)&&void 0!==t?t:0,s=r>0?"Adding ".concat(r," candidate").concat(1===r?"":"s"):"Adding candidates";return{label:s,color:"blue",variant:"filled",progressValue:50,progressAnimate:!0,progressColor:"blue",showProgress:!0,detail:r>0?"".concat(r," new candidate").concat(1===r?"":"s"," arriving"):"Adding new candidates"}}if(e.isPaused)return{label:"Paused",color:"yellow",variant:"light",progressValue:100,progressAnimate:!1,progressColor:"yellow",showProgress:!0,detail:"Search paused"};switch(e.currentStep){case"scanning":{let t=null!==(r=e.totalActiveCount)&&void 0!==r?r:0,s=null!==(i=null!==(n=e.totalActiveFound)&&void 0!==n?n:e.found)&&void 0!==i?i:0;if(t>0){let r=Math.min(100,s/t*100),a=s<t;return{label:"Searching for ".concat(t).concat(e.isInitialSearch?"":" more"),color:"blue",variant:"light",progressValue:r,progressAnimate:a,progressColor:"blue",showProgress:!0,detail:"".concat(s," of ").concat(t," found")}}return{label:"Scanning",color:"blue",variant:"light",progressValue:50,progressAnimate:!0,progressColor:"blue",showProgress:!0,detail:s>0?"Scanned ".concat(s," so far"):"Scanning the web…"}}case"evaluating":{let t=null!==(o=e.found)&&void 0!==o?o:0,r=null!==(l=e.analyzed)&&void 0!==l?l:0,s=t>0?Math.min(100,r/t*100):50;return{label:"Evaluating",color:"blue",variant:"light",progressValue:s,progressAnimate:r<t,progressColor:"blue",showProgress:!0,detail:"Analyzed ".concat(r," of ").concat(t)}}case"syncing":{let t=null===(c=e.linkedJobs)||void 0===c?void 0:c[0],r=(null!==(u=null===(d=e.linkedJobs)||void 0===d?void 0:d.length)&&void 0!==u?u:1)-1,s=t?r>0?"Syncing to ".concat(t.jobTitle," +").concat(r):"Syncing to ".concat(t.jobTitle):"Syncing matches…";return{label:"Syncing",color:"blue",variant:"light",progressValue:50,progressAnimate:!0,progressColor:"blue",showProgress:!0,detail:s}}case"scheduled_idle":{let t=null!==(h=e.scheduleNextRunAt)&&void 0!==h?h:null;if(!t)return{label:"Scheduled",color:"blue",variant:"light",progressValue:100,progressAnimate:!1,progressColor:"blue",showProgress:!0,detail:null};let r=t.getTime()<=Date.now(),a=(0,s.Z)(t);return{label:r?"Queued":"Next run in ".concat(a),color:"blue",variant:"light",progressValue:100,progressAnimate:r,progressColor:"blue",showProgress:!0,detail:r?"Waiting for next dispatcher tick…":"Next run in ".concat(a)}}default:if(e.hasRunningEnrichment)return{label:"Enriching",color:"blue",variant:"light",progressValue:50,progressAnimate:!0,progressColor:"blue",showProgress:!0,detail:"Enriching c
1andidates…"};return a}}},42294:function(e,t,r){r.d(t,{w:function(){return useJobOptions}});var s=r(67294),a=r(58959);let useJobOptions=e=>{let{recruiterId:t}=e,[r,n]=s.useState([]),{data:i,isLoading:o,refetch:l}=a.h.job.getAll.useQuery(void 0,{refetchOnMount:!1,refetchOnReconnect:!1,enabled:null!=t});return(0,s.useEffect)(()=>{i&&n(i.map(e=>{var t,r;let s={value:e.id,label:(null!==e.closedAt?"CLOSED: ":"")+e.title,group:null!==(r=null===(t=e.company)||void 0===t?void 0:t.name)&&void 0!==r?r:void 0};return s}))},[i]),{jobOptions:r,setJobOptions:n,isLoading:o,refetch:l}}}}]);

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.