PageSourceSearch

https://sohamrecruit.com/_next/static/chunks/app/candidates/bulk-upload/page-9fb6a501fbf3cf39.js

js sohamrecruit.com collected 2026-10-02 00:57:48 UTC 12,216 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="25b97993-0a50-4b11-84d8-c1944dbac36d",e._sentryDebugIdIdentifier="sentry-dbid-25b97993-0a50-4b11-84d8-c1944dbac36d")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2808],{6296:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(78340).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},12651:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(78340).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},19215:(e,t,a)=>{"use strict";a.d(t,{d:()=>o,y:()=>c});var s=a(95155),r=a(12115),l=a(40980),i=a(52484),n=a(62791),d=a(33210);function c({message:e,type:t,onDismiss:a}){return(0,r.useEffect)(()=>{let e=setTimeout(a,4e3);return()=>clearTimeout(e)},[a]),(0,s.jsxs)("div",{className:(0,l.cn)("flex items-start gap-3 rounded-xl border px-4 py-3 text-sm shadow-sm","success"===t?"border-green-100 bg-green-50 text-green-800":"border-red-100 bg-red-50 text-red-800"),children:["success"===t?(0,s.jsx)(i.A,{size:16,className:"mt-0.5 shrink-0 text-green-600"}):(0,s.jsx)(n.A,{size:16,className:"mt-0.5 shrink-0 text-red-500"}),(0,s.jsx)("span",{className:"flex-1",children:e}),(0,s.jsx)("button",{onClick:a,"aria-label":"Dismiss",title:"Dismiss",className:"shrink-0 opacity-50 hover:opacity-100",children:(0,s.jsx)(d.A,{size:14})})]})}function o(){let[e,t]=(0,r.useState)(null);return{toast:e,show:(0,r.useCallback)((e,a="success")=>t({message:e,type:a}),[]),dismiss:(0,r.useCallback)(()=>t(null),[])}}},21975:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(78340).A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},41585:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(78340).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},51268:(e,t,a)=>{"use strict";a.d(t,{Q:()=>r});var s=a(27529);function r(e,t){if(e instanceof s.hD){let t="string"==typeof e.data?.message?e.data.message.trim():"";if(t)return t;if(e.message&&!l.test(e.message))return e.message}return t}let l=/^[a-z0-9]+(?:_[a-z0-9]+)*$/},52484:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(78340).A)("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},53580:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>k});var s=a(95155),r=a(12115),l=a(98500),i=a.n(l),n=a(73321),d=a(97086),c=a(27529),o=a(19215),u=a(6296),m=a(12651),p=a(41585),h=a(62791),x=a(21975),f=a(33210),g=a(86901),y=a(40980),b=a(51268);function k(){let e=(0,n.useRouter)(),{toast:t,show:a,dismiss:l}=(0,o.d)(),k=(0,r.useRef)(null),[j,N]=(0,r.useState)([]),[v,A]=(0,r.useState)(!1),[w,D]=(0,r.useState)(!1),[C,z]=(0,r.useState)(0),[_,$]=(0,r.useState)(null),M=async e=>{if(!e)return;let t=Array.from(e);if(0===t.length)return;let s=[],r=new Set(j.map(e=>`${e.file.name}::${e.file.size}`)),l=0;for(let e of t){let t=`${e.name}::${e.size}`;if(!r.has(t)){if(!await (0,y.SU)(e)){l+=1;continue}r.add(t),s.push({id:crypto.randomUUID(),file:e,status:"pending"})}}l>0&&a(`${l} file${l>1?"s were":" was"} skipped — only PDF and DOCX are allowed.`,"error"),N(e=>{let t=[...e,...s];return t.length>25?(a("Maximum 25 files at once. Extra files were skipped.","error"),t.slice(0,25)):t})},U=(e,t)=>{N(a=>a.map(a=>a.id===e?{...a,...t}:a))},I=async()=>{if(w||0===j.length)return;D(!0),$(null),z(0),N(e=>e.map(e=>({...e,status:"pending",error:void 0})));let e=[...j],t={total:0,created:0,duplicates:0,errors:0,cached:0},s=!1;for(let r=0;r<e.length&&!s;r+=3){let l=e.slice(r,r+3);l.forEach(e=>U(e.id,{status:"uploading"}));let i=null,n=null;for(let e=1;e<=2;e++)try{i=await c.Xi.bulkUploadResumes(l.map(e=>e.file)),n=null;break}catch(a){n=a;let t=a instanceof c.hD&&a.status>=500;if(console.error("[bulk-upload] chunk failed",{attempt:e,chunkSize:l.length,firstFile:l[0]?.file.name,status:a instanceof c.hD?a.status:"no-status",message:a instanceof Error?a.message:String(a),data:a instanceof c.hD?a.data:void 0}),!t||2===e)break;await new Promise(e=>
1setTimeout(e,1500)),l.forEach(e=>U(e.id,{status:"uploading"}))}if(i){let{results:e,summary:a}=i;e.forEach((e,t)=>{let a=l[t];if(!a)return;let s={candidateId:e.candidateId,candidateName:e.candidateName,fromCache:e.fromCache};"created"===e.action?s.status="created":"duplicate_exact"===e.action||"duplicate_ai"===e.action?(s.status="duplicate",s.duplicateKind="duplicate_exact"===e.action?"exact":"ai"):(s.status="error",s.error=e.error??"Unknown error"),U(a.id,s)}),t={total:t.total+a.total,created:t.created+a.created,duplicates:t.duplicates+a.duplicates,errors:t.errors+a.errors,cached:t.cached+(a.cached??0)}}else{let i=n,d=i instanceof c.hD?i.status:0,o=i instanceof c.hD?i.data?.error:void 0,u=(0,b.Q)(i,"Upload failed — check your connection and try again");if(l.forEach(e=>U(e.id,{status:"error",error:u})),t={...t,total:t.total+l.length,errors:t.errors+l.length},"ai_quota_exceeded"===o){a("AI quota reached for this hour. Try again later.","error"),s=!0;for(let t=r+3;t<e.length;t++)U(e[t].id,{status:"error",error:"Skipped — AI quota reached"});t={...t,total:t.total+Math.max(0,e.length-(r+3)),errors:t.errors+Math.max(0,e.length-(r+3))}}else{let e=d>=500?" Server may be warming up — wait a few seconds and click Upload again to retry the failed files.":d>0?` (HTTP ${d})`:"";a(`Upload failed for batch starting at "${l[0].file.name}": ${u}.${e}`,"error")}}z(e=>e+l.length)}$(t),D(!1)},S=j.length;return(0,s.jsx)(d.A,{children:(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)("div",{className:"mb-6 flex items-center gap-3",children:[(0,s.jsx)("button",{onClick:()=>e.back(),className:"btn text-xs",children:"← Back"}),(0,s.jsx)("h1",{className:"text-lg font-semibold",children:"Bulk upload resumes"})]}),t&&(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)(o.y,{message:t.message,type:t.type,onDismiss:l})}),(0,s.jsxs)("div",{className:"max-w-2xl space-y-4",children:[(0,s.jsxs)("p",{className:"text-sm text-gray-600",children:["Drop up to ",25," PDF or DOCX resumes. We'll parse each one and create the candidate. Open the candidate to view AI job suggestions and scores."]}),(0,s.jsxs)("div",{className:"card",children:[(0,s.jsxs)("div",{onDragOver:e=>{e.preventDefault(),A(!0)},onDragLeave:()=>A(!1),onDrop:e=>{e.preventDefault(),A(!1),M(e.dataTransfer.files)},onClick:()=>!w&&k.current?.click(),className:(0,y.cn)("flex cursor-pointer flex-col items-center gap-2 rounded-lg border-2 border-dashed p-8 text-center transition-colors",v?"border-brand-400 bg-brand-50":"border-gray-200 hover:border-gray-300",w&&"cursor-not-allowed opacity-60"),children:[(0,s.jsx)(x.A,{size:20,className:"text-gray-300"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm text-gray-600",children:"Drop resumes here or click to select files"}),(0,s.jsxs)("p",{className:"text-xs text-gray-400 mt-0.5",children:["PDF or DOCX \xb7 Max 10MB each \xb7 Up to ",25," files"]})]})]}),(0,s.jsx)("input",{ref:k,type:"file",multiple:!0,accept:".pdf,.docx,application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document",className:"hidden",onChange:e=>{M(e.target.files),k.current&&(k.current.value="")}})]}),j.length>0&&(0,s.jsxs)("div",{className:"card",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsxs)("h2",{className:"text-sm font-medium text-gray-700",children:[S," file",1===S?"":"s"," selected",w&&` \xb7 Processing ${C} of ${S}…`]}),!w&&(0,s.jsx)("button",{onClick:()=>{N([]),$(null),z(0)},className:"text-xs text-gray-400 hover:text-gray-600",children:"Clear all"})]}),(0,s.jsx)("ul",{className:"space-y-2",children:j.map(e=>{var t,a;return(0,s.jsxs)("li",{className:"flex items-start gap-3 rounded-md border border-gray-100 px-3 py-2 text-sm",children:[(0,s.jsx)("div",{className:"pt-0.5",children:"uploading"===(t=e.status)?(0,s.jsx)(u.A,{size:16,className:"animate-spin text-brand-500"}):"created"===t?(0,s.jsx)(m.A,{size:16,className:"text-green-600"}):"duplicate"===t?(0,s.jsx)(p.A,{size:16,className:"text-amber-500"}):"error"===t?(0,s.jsx)(h.A,{size:16,className:"text-red-500"}):(0,s.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-gray-300"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[e.candidateId?(0,s.jsx)(i(),{href:`/candidates/${e.candidateId}`,className:"truncate font-medium text-brand-700 hover:underline",title:e.file.name,children:e.candidateName||e.file.name}):(0,s.jsx)("span",{className:"truncate font-medium text-gray-700",title:e.file.name,children:e.file.name}),(0,s.jsx)("span",{className:"text-xs text-gray-400 whitespace-nowrap",children:(a=e.file.size)<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`})]}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:function(e){switch(e.status){case"pen
1ding":return"Waiting to upload";case"uploading":return"Uploading and parsing…";case"created":return"Added to talent pool";case"duplicate":return"Already exists — no changes";case"error":var t=e.error;switch(t){case"parse_failed":return"Couldn't read the resume — try a clearer PDF or DOCX, or re-upload later.";case"unsupported_type":return"Unsupported file type — only PDF and DOCX are accepted.";case"file_too_large":return"File too large — 10MB maximum.";case"empty_file":return"File is empty.";case"not_processed":return"Not processed.";default:return t??"Upload failed"}default:return""}}(e)})]}),!w&&"pending"===e.status&&(0,s.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void N(e=>e.filter(e=>e.id!==t))},className:"text-gray-400 hover:text-red-500","aria-label":"Remove file",children:(0,s.jsx)(f.A,{size:14})})]},e.id)})}),(0,s.jsx)("div",{className:"mt-4 flex justify-end gap-2",children:(0,s.jsx)("button",{type:"button",onClick:I,disabled:w||0===j.length,className:"btn-primary",children:w?(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)(u.A,{size:14,className:"animate-spin"})," Uploading…"]}):`Upload & create ${j.length} candidate${1===j.length?"":"s"}`})})]}),_&&!w&&(0,s.jsx)("div",{className:"card border border-brand-100 bg-brand-50/40",children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(g.A,{size:16,className:"mt-0.5 text-brand-600"}),(0,s.jsxs)("div",{className:"text-sm",children:[(0,s.jsx)("p",{className:"font-medium text-gray-800",children:"Bulk upload complete"}),(0,s.jsxs)("p",{className:"text-gray-600 mt-0.5",children:[_.created," created \xb7 ",_.duplicates," duplicate",1===_.duplicates?"":"s"," \xb7 ",_.errors," error",1===_.errors?"":"s",_.cached?` \xb7 ${_.cached} from cache (0 tokens)`:""]}),_.created>0&&(0,s.jsx)("button",{type:"button",onClick:()=>e.push("/candidates?source=Bulk+Upload"),className:"mt-2 text-xs text-brand-700 hover:underline",children:"View uploaded candidates →"})]})]})})]})]})})}},61694:(e,t,a)=>{Promise.resolve().then(a.bind(a,53580))},62791:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(78340).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},86901:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(78340).A)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])}},e=>{e.O(0,[8500,8437,9060,2917,7529,7086,9793,8441,2209,7358],()=>e(e.s=61694)),_N_E=e.O()}]);

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.