PageSourceSearch

https://trueresume.ai/_next/static/chunks/pages/profile-setup-ff82576a9f9179af.js

js trueresume.ai collected 2026-10-02 01:13:38 UTC 89,626 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5776,8304],{65101:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile-setup",function(){return a(37929)}])},42949:function(e,t,a){"use strict";a.d(t,{q:function(){return i}});var s=a(85893);a(67294);var r=a(54271);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:26;return(0,s.jsx)(r.ZP,{variant:e,size:t,density:"full",animated:!0})}},88129:function(e,t,a){"use strict";var s=a(85893),r=a(67294),i=a(14424),n=a(14025),l=a(87542),o=a(67694);t.Z=e=>{let{actions:t,className:a="",density:c="default"}=e,{theme:d}=(0,o.F)(),[u,m]=(0,r.useState)(!1),{scrollY:x}=(0,i.v)(),p=(0,r.useRef)(null),[h,f]=(0,r.useState)(92);(0,n.W)(x,"change",e=>{var t;let a=null!==(t=x.getPrevious())&&void 0!==t?t:0;e>a&&Math.abs(e-a)>120&&e>200?m(!0):m(!1)});let v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"primary",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t)return"dark"===d?"bg-[#272729] text-[#818384] cursor-not-allowed opacity-50":"bg-gray-200/50 text-gray-400 cursor-not-allowed opacity-50";switch(e){case"primary":return"bg-[#FF4500] text-white shadow-md active:bg-[#E03D00]";case"secondary":return"dark"===d?"bg-white text-[#1C1C1C] shadow-lg shadow-white/10 active:bg-[#EDEFF1]":"bg-[#1A1A1B] text-white shadow-lg shadow-black/10 active:bg-[#272729]";case"outline":return"dark"===d?"bg-[#1A1A1B] text-[#D7DADC] border-2 border-[#343536] active:bg-[#272729]":"bg-white  text-gray-700 border-2 border-[#EDEFF1] active:bg-white";default:return""}},g="compact"===c;return(0,r.useLayoutEffect)(()=>{if(p.current&&f(p.current.offsetHeight||(g?64:72)),"ResizeObserver"in window&&p.current){let e=new ResizeObserver(e=>{for(let t of e)t.target===p.current&&f(Math.max(g?64:72,Math.ceil(t.contentRect&&t.contentRect.height||p.current.offsetHeight)))});return e.observe(p.current),()=>e.disconnect()}},[g]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.E.div,{initial:{y:120,opacity:0},animate:{y:u?120:0,opacity:u?0:1},transition:{y:{type:"spring",stiffness:350,damping:30},opacity:{duration:.15}},className:"md:hidden fixed bottom-0 left-0 right-0 z-[80] ".concat(a),ref:p,style:{pointerEvents:u?"none":"auto"},children:(0,s.jsxs)("div",{className:"border-t shadow-[0_-18px_40px_-12px_rgba(0,0,0,0.25)] ".concat(g?"rounded-t-2xl":"rounded-t-3xl")+("dark"===d?" bg-[#1A1A1B]/96 border-[#343536]/40":" bg-white border-gray-200"),children:[(0,s.jsx)("div",{className:"mx-auto rounded-full bg-[#C8CCD2]/40 dark:bg-[#343536]/40 ".concat(g?"mb-1.5 mt-1.5 h-1 w-12":"my-2 h-1.5 w-14"),"aria-hidden":!0}),(0,s.jsx)("div",{className:"px-4 pb-safe grid ".concat(g?"gap-2 py-2":"gap-3 py-3"),style:{gridTemplateColumns:"repeat(".concat(Math.min(t.length,2),", 1fr)")},children:t.map((e,a)=>{let r=e.icon,i=1===t.length;return(0,s.jsxs)("button",{onClick:e.onClick,disabled:e.disabled,className:"flex items-center justify-center font-semibold transition-all active:scale-95 ".concat(g?"gap-2 rounded-xl py-2 text-xs":"gap-3 rounded-2xl py-3 text-sm"," ").concat(i?"col-span-full":""," ").concat(v(e.variant,e.disabled)," ").concat(e.className||""),children:[(0,s.jsx)(r,{className:g?"h-4 w-4":"w-5 h-5"}),(0,s.jsx)("span",{children:e.label})]},a)})})]})}),(0,s.jsx)("div",{className:"md:hidden",style:{height:h},"aria-hidden":!0})]})}},26709:function(e,t,a){"use strict";a.d(t,{Z:function(){return o}});var s=a(85893);a(67294);var r=a(92761),i=a(79298),n=a(11163),l=a(67694);function o(e){let{title:t,subtitle:a,onPrimary:o,primaryLabel:c,showBack:d=!0}=e,u=(0,n.useRouter)(),{theme:m}=(0,l.F)();return(0,s.jsx)("div",{className:"md:hidden sticky top-12 z-40 px-3 py-2.5  transition-colors ".concat("dark"===m?"bg-[#1A1A1B] border-b border-[#343536]":"bg-white border-b border-[#EDEFF1]"),children:(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[d?(0,s.jsx)(i.hU,{onClick:()=>u.back(),icon:r.Z,"aria-label":"Back",variant:"ghost",size:"sm"}):(0,s.jsx)("div",{className:"w-9 h-9","aria-hidden":!0}),(0,s.jsxs)("div",{className:"flex-1 text-center min-w-0",children:[t&&(0,s.jsx)("div",{className:"font-semibold text-sm truncate ".concat("dark"===m?"text-white":"text-gray-900"),children:t}),a&&(0,s.jsx)("div",{className:"text-xs truncate ".concat("dark"===m?"text-[#818384]":"text-gray-500"),children:a})]}),(0,s.jsx)("div",{className:"flex-shrink-0 flex items-center justify-end",children:o?(0,s.jsx)(i.zx,{onClick:o,size:"sm",variant:"primary",className:"text-xs px-2.5 py-1.5 whitespace-nowrap",children:c||"Done"}):(0,s.jsx)("div",{className:"w-9 h-9","aria-hidden":!0})})]})})}},72026:function(e,t,a){"use strict";a.d(t,{Z:function(){return d}});var s=a(85893),r=a(67294),i=a(79298),n=a(23346),l=a(61258),o=a(4307),c=a(67694);function d(e){let{value:t,onChange:a,placeholder:d="YYYY-MM (e.g. 2024-03)",disabled:u,id:m,className:x=""}=e,{theme:p}=(0,c.F)(),h="dark"===p,[f,v]=(0,r.useState)(!1),[g,b]=(0,r.useState)(t||""),[j,y]=(0,r.useState)(()=>t&&/^\d{4}-\d{2}$/.test(t)?parseInt(t.slice(0,4),10):new Date().getFullYear()),N=(0,r.useRef)(null);(0,r.useEffect)(()=>{b(t||""),t&&/^\d{4}-\d{2}$/.test(t)&&y(parseInt(t.slice(0,4),10))},[t]),(0,r.useEffect)(()=>{let e=e=>{N.current&&!N.current.contains(e.target)&&v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let w=e=>{let t=String(e+1).padStart(2,"0"),s="".concat(j,"-").concat(t);b(s),a(s),v(!1)},D=e=>{let t=function(e){if(!e)return"";let t=e.trim();if(/^\d{4}-\d{2}$/.test(t))return t;let a=t.match(/^(\d{1,2})\/(\d{4})$/);if(a){let e=a[1].padStart(2,"0"),t=a[2];return"".concat(t,"-").concat(e)}if(/^\d{4}$/.test(t))return"".concat(t,"-01");let s=t.match(/^([A-Za-z]+)\s+(\d{4})$/);if(s){let e=s[1].toLowerCase(),t=s[2],a={jan:"01",january:"01",feb:"02",february:"02",mar:"03",march:"03",apr:"04",april:"04",may:"05",jun:"06",june:"06",jul:"07",july:"07",aug:"08",august:"08",sep:"09",sept:"09",september:"09",oct:"10",october:"10",nov:"11",november:"11",dec:"12",december:"12"}[e];if(a)return"".concat(t,"-").concat(a)}let r=t.match(/^(\d{4})-(\d{1,2})$/);if(r){let e=r[1],t=r[2].padStart(2,"0");return"".concat(e,"-").concat(t)}return""}(e);b(e),t?a(t):a("")},C=h?"hover:bg-[#272729]":"hover:bg-gray-100",k=h?"hover:bg-[#343536]":"hover:bg-blue-50";return(0,s.jsxs)("div",{ref:N,className:"relative ".concat(x),children:[(0,s.jsxs)("div",{className:"relative",onClick:()=>v(!0),children:[(0,s.jsx)(i.II,{disabled:u,placeholder:d,value:g,onChange:e=>b(e.target.value),onKeyPress:e=>{"Enter"===e.key&&(D(e.target.value),v(!1))},className:"pl-10 pr-3"}),(0,s.jsx)("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none ".concat(h?"text-[#818384]":"text-gray-400"),children:(0,s.jsx)(n.Z,{className:"w-4 h-4"})})]}),f&&(0,s.jsxs)("div",{role:"dialog","aria-modal":"false",className:"absolute z-20 mt-2 w-64 sm:w-72 border rounded-lg shadow-lg p-3 ".concat(h?"bg-[#1A1A1B] border-[#343536]":"bg-white  border-[#
1EDEFF1]"," ").concat(h?"text-white":"text-gray-900"),style:{minWidth:240},children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("button",{"aria-label":"Previous year",className:"p-2 rounded-md ".concat(C),onClick:()=>y(e=>e-1),children:(0,s.jsx)(l.Z,{className:"w-4 h-4"})}),(0,s.jsx)("div",{className:"font-semibold text-sm",children:j}),(0,s.jsx)("button",{"aria-label":"Next year",className:"p-2 rounded-md ".concat(C),onClick:()=>y(e=>e+1),children:(0,s.jsx)(o.Z,{className:"w-4 h-4"})})]}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-2",children:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].map((e,t)=>(0,s.jsx)("button",{onClick:()=>w(t),className:"py-2 rounded-md ".concat(k," focus:outline-none focus:ring-2 focus:ring-blue-300"),"aria-label":"Select ".concat(e," ").concat(j),children:e},e))}),(0,s.jsxs)("div",{className:"mt-3 text-xs ".concat(h?"text-[#818384]":"text-gray-500"),children:["Tip: you can also type formats like ",(0,s.jsx)("span",{className:"font-mono",children:"YYYY-MM"}),", ",(0,s.jsx)("span",{className:"font-mono",children:"MM/YYYY"})," or just ",(0,s.jsx)("span",{className:"font-mono",children:"YYYY"}),"."]})]})]})}},99617:function(e,t,a){"use strict";function s(e){if(!e)return;let t=String(e).trim(),a=t.match(/^(\d{4})-(\d{2})$/);if(a){let e=parseInt(a[1],10),t=parseInt(a[2],10);if(t>=1&&t<=12)return new Date(e,t-1,1)}let s=t.match(/^(\d{1,2})\/(\d{4})$/);if(s){let e=parseInt(s[1],10),t=parseInt(s[2],10);if(e>=1&&e<=12)return new Date(t,e-1,1)}let r=t.match(/^([A-Za-z]+)\s+(\d{4})$/);if(r){let e=r[1].toLowerCase(),t=parseInt(r[2],10),a={jan:1,january:1,feb:2,february:2,mar:3,march:3,apr:4,april:4,may:5,jun:6,june:6,jul:7,july:7,aug:8,august:8,sep:9,sept:9,september:9,oct:10,october:10,nov:11,november:11,dec:12,december:12}[e];if(a)return new Date(t,a-1,1)}let i=t.match(/(19|20)\d{2}/);if(i)return new Date(parseInt(i[0],10),0,1)}function r(e){return e?e.toLocaleDateString("en-US",{month:"short",year:"numeric"}):""}function i(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e||"string"!=typeof e||""===e.trim())return t?"Present":"—";let a=e.trim(),s=a.toLowerCase();if("present"===s||"current"===s||s.includes("present")||s.includes("current"))return"Present";let r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];if(a.includes("/")){let e=a.split("/");if(2===e.length){let t=parseInt(e[0],10),a=e[1];if(!Number.isNaN(t)&&t>=1&&t<=12)return"".concat(r[t-1]," ").concat(a)}}if(a.includes("-")){let e=a.split("-");if(e.length>=2&&4===e[0].length){let t=e[0],a=parseInt(e[1],10);if(!Number.isNaN(a)&&a>=1&&a<=12)return"".concat(r[a-1]," ").concat(t)}}return a}function n(e){if(!e||"string"!=typeof e)return -864e13;let t=e.trim().toLowerCase();if("present"===t||"current"===t)return Number.POSITIVE_INFINITY;let a=t.match(/^(\d{1,2})\/(\d{4})$/);if(a){let e=parseInt(a[1],10)-1;return new Date(parseInt(a[2],10),Math.max(0,e),1).getTime()}let s=t.match(/^(\d{4})-(\d{1,2})$/);if(s)return new Date(parseInt(s[1],10),Math.max(0,parseInt(s[2],10)-1),1).getTime();let r=t.match(/^(\d{4})$/);if(r)return new Date(parseInt(r[1],10),0,1).getTime();let i=Date.parse(t);return Number.isNaN(i)?-864e13:i}function l(e){return[...e].sort((e,t)=>{let a="string"==typeof e.endDate&&""!==e.endDate.trim()?n(e.endDate):Number.POSITIVE_INFINITY,s="string"==typeof t.endDate&&""!==t.endDate.trim()?n(t.endDate):Number.POSITIVE_INFINITY;if(a===s){let a=n(e.startDate);return n(t.startDate)-a}return s-a})}function o(e){return e&&Array.isArray(e.experiences)?{...e,experiences:l(e.experiences)}:e}a.r(t),a.d(t,{formatMonthYearLocal:function(){return r},formatResumeDate:function(){return i},parseDateForSort:function(){return n},parseYearMonthToLocalDate:function(){return s},sortExperiencesDesc:function(){return l},sortGeneratedResume:function(){return o}}),t.default={parseYearMonthToLocalDate:s,formatMonthYearLocal:r}},43765:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},83989:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},23346:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]])},60493:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},61258:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},4307:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},43283:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("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"}]])},37929:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return J}});var s=a(85893),r=a(67294),i=a(9008),n=a.n(i),l=a(87542),o=a(11163),c=a(33299),d=a(99617),u=a(86501),m=a(42949),x=a(85412),p=a(67694),h=a(5152),f=a.n(h),v=a(79298),g=a(72026),b=a(43765),j=a(61929),y=a(37864),N=a(23346),w=a(32225),D=a(4270),C=r.memo(function(e){var t,i,n,l,o,c;let{exp:u,index:m,theme:x,labelClass:p,inputClass:h,headingClass:f,subTextClass:C,cardClass:k,updateExperience:S,removeExperience:I,addProjectToExperience:E,updateExperienceProject:P,removeProjectFromExperience:F,initialExpanded:Z=!1,dragHandleProps:A,isDragging:R=!1,moveUp:T,moveDown:M,canMoveUp:z,canMoveDown:Y,showValidation:q=!1}
1=e,[O,L]=(0,r.useState)(Z);(0,r.useEffect)(()=>{L(Z)},[Z]);let $=q&&!(null===(t=u.position)||void 0===t?void 0:t.trim()),W=q&&!(null===(i=u.company)||void 0===i?void 0:i.trim()),V=q&&!(null===(n=u.startDate)||void 0===n?void 0:n.trim()),J=$||W||V;(0,r.useEffect)(()=>{J&&!O&&L(!0)},[J]);let _=(0,r.useMemo)(()=>{let e=u.projects.length;return e>0?"".concat(e," project").concat(1!==e?"s":""):""},[u.projects.length]),B=!(null===(l=u.position)||void 0===l?void 0:l.trim())||!(null===(o=u.company)||void 0===o?void 0:o.trim())||!(null===(c=u.startDate)||void 0===c?void 0:c.trim());return O?R?(0,s.jsxs)("div",{className:"border rounded-2xl p-4 flex items-center justify-between ".concat(k),children:[(0,s.jsx)("div",{className:"flex items-center gap-3",children:(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"font-semibold ".concat(f),children:u.position||"Untitled Role"}),(0,s.jsx)("span",{className:"text-sm ".concat(C),children:u.company||"Unknown Company"}),(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:[u.startDate||"—"," ",u.endDate?"→ ".concat(u.endDate):u.current?"→ Present":""]})]})}),(0,s.jsx)("div",{className:"text-xs text-gray-400 mr-2",children:_})]}):(0,s.jsxs)("div",{className:"rounded-xl border p-4 ".concat(k," ").concat(J?"border-red-500/50":""),children:[(0,s.jsxs)("div",{className:"mb-3 flex items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("h3",{className:"text-sm font-bold sm:text-base ".concat(f),children:["Experience #",m+1]}),J&&(0,s.jsxs)("span",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,s.jsx)(b.Z,{className:"w-3 h-3"})," Missing required fields"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{...A||{},"aria-label":"Drag to reorder experience ".concat(m+1),title:"Drag to reorder",className:"p-2 -ml-2 mr-2 text-[#818384] hover:text-[#D7DADC] ".concat(R?"cursor-grabbing":"cursor-grab"),onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation()},children:(0,s.jsx)(j.Z,{className:"w-4 h-4"})}),(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),L(!1)},onKeyDown:e=>{e.stopPropagation()},className:"text-xs px-2 py-1 rounded-lg border hover:bg-gray-50 transition","aria-label":"Collapse experience ".concat(m+1),title:"Collapse",children:"Collapse"}),(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),I(u.id)},className:"text-red-400 hover:text-red-300 p-1","aria-label":"Remove experience ".concat(m+1),title:"Remove experience",children:(0,s.jsx)(y.Z,{className:"w-4 h-4"})})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-x-4 gap-y-3 md:grid-cols-2",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"text-xs font-semibold sm:text-sm ".concat(p),children:["Job Title ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(v.II,{type:"text",size:"sm",value:u.position,onChange:e=>S(u.id,"position",e.target.value),placeholder:"Software Engineer",className:$?"border-red-500 border-2":"",required:!0}),$&&(0,s.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1 mt-1",children:[(0,s.jsx)(b.Z,{className:"w-3 h-3"})," Job title is required"]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"text-xs font-semibold sm:text-sm ".concat(p),children:["Company ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(v.II,{type:"text",size:"sm",value:u.company,onChange:e=>S(u.id,"company",e.target.value),placeholder:"TechCorp Inc.",className:W?"border-red-500 border-2":"",required:!0}),W&&(0,s.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1 mt-1",children:[(0,s.jsx)(b.Z,{className:"w-3 h-3"})," Company name is required"]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"text-xs font-semibold sm:text-sm flex items-center justify-between ".concat(p),children:[(0,s.jsxs)("span",{children:["Start Date ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),u.startDate&&u.startDate.match(/^\d{4}-\d{2}$/)&&(0,s.jsx)("span",{className:"text-xs font-normal text-blue-400",children:(()=>{try{let{parseYearMonthToLocalDate:e,formatMonthYearLocal:t}=a(99617),s=e(u.startDate);return s?t(s):u.startDate||""}catch(e){return u.startDate||""}})()})]}),(0,s.jsxs)("div",{className:"relative ".concat(V?"ring-2 ring-red-500 rounded-xl":""),children:[(0,s.jsx)(N.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none ".concat("dark"===x?"text-[#818384]":"text-gray-500")}),(0,s.jsx)(g.Z,{value:u.startDate,onChange:e=>S(u.id,"startDate",e),disabled:!1,className:"w-full"})]}),V&&(0,s.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1 mt-1",children:[(0,s.jsx)(b.Z,{className:"w-3 h-3"})," Start date is required"]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"text-xs font-semibold sm:text-sm flex items-center justify-between ".concat(p),children:[(0,s.jsx)("span",{children:"End Date"}),u.endDate&&!u.current&&u.endDate.match(/^\d{4}-\d{2}$/)&&(0,s.jsx)("span",{className:"text-xs font-normal text-blue-400",children:(()=>{try{let{parseYearMonthToLocalDate:e,formatMonthYearLocal:t}=a(99617),s=e(u.endDate);return s?t(s):u.endDate||""}
1catch(e){return u.endDate||""}})()}),u.current&&(0,s.jsx)("span",{className:"text-xs font-normal text-green-400",children:"Present"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(N.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none ".concat("dark"===x?"text-[#818384]":"text-gray-500")}),(0,s.jsx)(g.Z,{value:u.endDate,onChange:e=>S(u.id,"endDate",e),disabled:u.current,className:"w-full ".concat(u.current?"opacity-50 cursor-not-allowed":"")})]}),(0,s.jsxs)("label",{className:"flex items-center gap-2 text-xs sm:text-sm ".concat(p),children:[(0,s.jsx)("input",{type:"checkbox",checked:u.current,onChange:e=>S(u.id,"current",e.target.checked),className:"rounded border-[#343536] bg-[#272729] text-blue-500"}),(0,s.jsx)("span",{children:"Current position"})]})]})]}),(0,s.jsxs)("div",{className:"space-y-1.5 md:col-span-2",children:[(0,s.jsx)("label",{className:"text-xs font-semibold sm:text-sm ".concat(p),children:"Location"}),(0,s.jsx)(v.II,{type:"text",size:"sm",value:u.location,onChange:e=>S(u.id,"location",e.target.value),placeholder:"San Francisco, CA"})]}),(0,s.jsxs)("div",{className:"space-y-1.5 md:col-span-2",children:[(0,s.jsx)("label",{className:"text-xs font-semibold sm:text-sm ".concat(p),children:"Description & Achievements"}),(0,s.jsx)(v.II,{as:"textarea",value:u.description,onChange:e=>S(u.id,"description",e.target.value),placeholder:"• Led development of microservices architecture serving 10M+ users\\n• Improved system performance by 40% through optimization\\n• Mentored 5 junior developers",rows:3,className:"".concat(h," min-h-[90px] text-sm")})]}),(0,s.jsxs)("div",{className:"mt-2 space-y-3 border-t border-[#343536] pt-3 md:col-span-2",children:[(0,s.jsxs)("div",{className:"mb-1 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(w.Z,{className:"h-4 w-4 text-blue-400"}),(0,s.jsxs)("label",{className:"text-xs font-semibold text-[#D7DADC] sm:text-sm",children:["Projects at ",u.company||"this company"]})]}),u.projects.length>0&&(0,s.jsx)("span",{className:"text-xs text-blue-400 bg-blue-500/10 px-2 py-1 rounded-full",children:_})]}),0===u.projects.length?(0,s.jsxs)("div",{className:"bg-[#272729] border border-[#343536] rounded-lg p-4 text-center",children:[(0,s.jsx)("p",{className:"text-sm text-[#818384] mb-3",children:"No projects added for this experience yet"}),(0,s.jsxs)("button",{onClick:()=>E(u.id),className:"text-sm bg-blue-500/10 hover:bg-blue-500/20 text-blue-400 px-4 py-2 rounded-lg transition-all inline-flex items-center space-x-2",children:[(0,s.jsx)(D.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Add Project"})]})]}):(0,s.jsxs)("div",{className:"space-y-3",children:[u.projects.map((e,t)=>(0,s.jsxs)("div",{className:"border rounded-lg p-4 ".concat("dark"===x?"bg-[#272729] border-[#343536]":"bg-gray-50 border-gray-200"),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsxs)("span",{className:"text-xs font-medium ".concat(C),children:["Project #",t+1]}),(0,s.jsx)("button",{onClick:()=>F(u.id,e.id),className:"text-red-400 hover:text-red-300 p-1","aria-label":"Remove project ".concat(t+1),children:(0,s.jsx)(y.Z,{className:"w-3 h-3"})})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"text-xs font-medium ".concat(C),children:"Project Name *"}),(0,s.jsx)(v.II,{type:"text",value:e.name,onChange:t=>P(u.id,e.id,"name",t.target.value),placeholder:"e.g., Customer Portal, API Integration",className:"w-full focus:border-blue-500 rounded-lg px-3 py-2 text-sm focus:outline-none ".concat(""===e.name.trim()?"border-red-500 border-2":""," ").concat("dark"===x?"bg-[#272729] border-[#343536] text-white placeholder-[#818384]":"bg-white border-gray-300/50 text-gray-900 placeholder-gray-400")}),""===e.name.trim()&&(0,s.jsx)("p",{className:"text-red-500 text-xs mt-1",children:"Project name is required"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"text-xs font-medium ".concat(C),children:"Project Description"}),(0,s.jsx)(v.II,{as:"textarea",value:e.description,onChange:t=>P(u.id,e.id,"description",t.target.value),placeholder:"Brief description of the project, its purpose, and your role...",rows:2,className:"".concat(h)})]})]})]},e.id)),(0,s.jsxs)("button",{onClick:()=>E(u.id),className:"w-full border border-dashed hover:border-blue-500 rounded-lg p-3 flex items-center justify-center space-x-2 hover:text-blue-400 transition-all text-sm ".concat("dark"===x?"border-[#343536] text-[#818384]":"border-gray-300 text-gray-500"),children:[(0,s.jsx)(D.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Add Another Project"})]})]})]})]})]}):(0,s.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>L(!0),onKeyDown:e=>
1{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),L(!0))},className:"cursor-pointer border rounded-2xl p-4 flex items-center justify-between ".concat(k," ").concat(B?"border-[#FF4500]/50":""),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[B&&(0,s.jsx)("div",{className:"flex-shrink-0",title:"Missing required fields",children:(0,s.jsx)(b.Z,{className:"w-5 h-5 text-[#FF4500]"})}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"font-semibold ".concat(f),children:u.position||(0,s.jsx)("span",{className:"text-[#FF4500] italic",children:"Title required"})}),(0,s.jsx)("span",{className:"text-sm ".concat(C),children:u.company||(0,s.jsx)("span",{className:"text-[#FF4500] italic",children:"Company required"})}),(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:[u.startDate||(0,s.jsx)("span",{className:"text-[#FF4500]",children:"Start date required"})," ",u.endDate?"→ ".concat(u.endDate):u.current?"→ Present":""]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{...A||{},"aria-label":"Drag to reorder experience ".concat(m+1),title:"Drag to reorder",className:"p-2 -ml-2 mr-2 text-[#818384] hover:text-[#D7DADC] ".concat(R?"cursor-grabbing":"cursor-grab"),onMouseDown:e=>{e.stopPropagation()},onClick:e=>e.stopPropagation(),children:(0,s.jsx)(j.Z,{className:"w-4 h-4"})}),(0,s.jsx)("div",{className:"text-xs text-gray-400 mr-2",children:_}),(0,s.jsxs)("div",{className:"text-xs text-gray-400 mr-2",children:[(0,d.formatResumeDate)(u.startDate)," ",u.endD
1ate?"→ ".concat((0,d.formatResumeDate)(u.endDate,!0)):u.current?"→ Present":""]}),(0,s.jsx)("button",{onKeyDown:e=>{e.stopPropagation()},className:"text-sm px-3 py-1 rounded-lg border hover:bg-gray-50 transition ".concat(B?"border-[#FF4500] text-[#FF4500]":""),"aria-label":"Edit experience ".concat(m+1),children:B?"Complete":"Edit"})]})]})});function k(e){var t,i,n,l;let{cert:o,index:c,theme:d,labelClass:u,inputClass:m,headingClass:x,subTextClass:p,cardClass:h,updateCertification:f,removeCertification:v,initialExpanded:j=!1,showValidation:w=!1}=e,[D,C]=(0,r.useState)(j),k=w&&!(null===(t=o.name)||void 0===t?void 0:t.trim()),S=w&&!(null===(i=o.issuer)||void 0===i?void 0:i.trim()),I=k||S;if((0,r.useEffect)(()=>{C(j)},[j]),(0,r.useEffect)(()=>{I&&!D&&C(!0)},[I]),!D){let e=!(null===(n=o.name)||void 0===n?void 0:n.trim())||!(null===(l=o.issuer)||void 0===l?void 0:l.trim());return(0,s.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>C(!0),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),C(!0))},className:"cursor-pointer border rounded-xl p-4 flex items-center justify-between ".concat(h," ").concat(e?"border-[#FF4500]/50":""),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[e&&(0,s.jsx)("div",{className:"flex-shrink-0",title:"Missing required fields",children:(0,s.jsx)(b.Z,{className:"w-5 h-5 text-[#FF4500]"})}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"font-semibold ".concat(x),children:o.name||(0,s.jsx)("span",{className:"text-[#FF4500] italic",children:"Name required"})}),(0,s.jsx)("span",{className:"text-sm ".concat(p),children:o.issuer||(0,s.jsx)("span",{className:"text-[#FF4500] italic",children:"Issuer required"})}),(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:[o.date?o.date:"—"," ",o.expiryDate?"→ ".concat(o.expiryDate):""]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),C(!0)},className:"text-sm px-3 py-1 rounded-lg border hover:bg-gray-50 transition ".concat(e?"border-[#FF4500] text-[#FF4500]":""),children:e?"Complete":"Edit"}),(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),v(o.id)},className:"text-red-400 hover:text-red-300 p-1","aria-label":"Remove certification ".concat(c+1),title:"Remove certification",children:(0,s.jsx)(y.Z,{className:"w-4 h-4"})})]})]})}return(0,s.jsxs)("div",{className:"rounded-xl border p-4 ".concat(h," ").concat(I?"border-red-500/50":""),children:[(0,s.jsxs)("div",{className:"mb-3 flex items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("h4",{className:"text-sm font-bold sm:text-base ".concat(x),children:["Certification #",c+1]}),I&&(0,s.jsxs)("span",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,s.jsx)(b.Z,{className:"w-3 h-3"})," Missing required fields"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:()=>C(!1),className:"text-xs px-2 py-1 rounded-lg border hover:bg-gray-50 transition","aria-label":"Collapse certification ".concat(c+1),title:"Collapse",children:"Collapse"}),(0,s.jsx)("button",{onClick:()=>v(o.id),className:"text-red-400 hover:text-red-300 p-1","aria-label":"Remove certification ".concat(c+1),title:"Remove certification",children:(0,s.jsx)(y.Z,{className:"w-4 h-4"})})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-x-4 gap-y-3 md:grid-cols-2",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"text-xs font-semibold sm:text-sm ".concat(u),children:["Certification Name ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("input",{type:"text",value:o.name,onChange:e=>f(o.id,"name",e.target.value),placeholder:"AWS Solutions Architect",className:"h-10 w-full rounded-lg border-2 px-3 text-sm outline-none transition-colors focus:border-[#0079D3] focus:ring-4 focus:ring-[#0079D3]/20 ".concat(m," ").concat(k?"border-red-500":"")}),k&&(0,s.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,s.jsx)(b.Z,{className:"w-3 h-3"})," Certification name is required"]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"text-xs font-semibold sm:text-sm ".concat(u),children:["Issuing Organization ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("input",{type:"text",value:o.issuer,onChange:e=>f(o.id,"issuer",e.target.value),placeholder:"Amazon Web Services",className:"h-10 w-full rounded-lg border-2 px-3 text-sm outline-none transition-colors focus:border-[#0079D3] focus:ring-4 focus:ring-[#0079D3]/20 ".concat(m," ").concat(S?"border-red-500":"")}
1),S&&(0,s.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,s.jsx)(b.Z,{className:"w-3 h-3"})," Issuing organization is required"]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"text-xs font-semibold sm:text-sm flex items-center justify-between ".concat(u),children:[(0,s.jsx)("span",{children:"Issue Date"}),o.date&&o.date.match(/^\d{4}-\d{2}$/)&&(0,s.jsx)("span",{className:"text-xs font-normal text-blue-400",children:(()=>{try{let{parseYearMonthToLocalDate:e,formatMonthYearLocal:t}=a(99617),s=e(o.date);return s?t(s):o.date||""}catch(e){return o.date||""}})()})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(N.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none ".concat("dark"===d?"text-[#818384]":"text-gray-500")}),(0,s.jsx)(g.Z,{value:o.date,onChange:e=>f(o.id,"date",e),disabled:!1,className:"w-full ".concat(m)})]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"text-xs font-semibold sm:text-sm flex items-center justify-between ".concat(u),children:[(0,s.jsx)("span",{children:"Expiry Date (Optional)"}),o.expiryDate&&o.expiryDate.match(/^\d{4}-\d{2}$/)&&(0,s.jsx)("span",{className:"text-xs font-normal text-blue-400",children:(()=>{try{let{parseYearMonthToLocalDate:e,formatMonthYearLocal:t}=a(99617),s=e(o.expiryDate);return s?t(s):o.expiryDate||""}catch(e){return o.expiryDate||""}})()})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(N.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none ".concat("dark"===d?"text-[#818384]":"text-gray-500")}),(0,s.jsx)(g.Z,{value:o.expiryDate,onChange:e=>f(o.id,"expiryDate",e),disabled:!1,className:"w-full ".concat(m)})]})]})]})]})}var S=a(28627),I=a(73935),E=a(8267),P=a(80893),F=a(82591),Z=a(23488),A=a(60493),R=a(43283),T=a(73416),M=a(92761),z=a(69819),Y=a(83989),q=a(15432),O=a(42171),L=a(88129),$=a(39793),W=a(26709);let V=f()(()=>a.e(4262).then(a.bind(a,84262)),{loadableGenerated:{webpack:()=>[84262]},ssr:!1,loading:()=>(0,s.jsx)("div",{className:"w-full text-center py-8 text-gray-500 dark:text-[#818384] animate-pulse",children:"Loading upload..."})});function J(){var e,t,i;let h=(0,o.useRouter)(),{data:f,status:j}=(0,c.useSession)(),{theme:N}=(0,p.F)(),[w,J]=(0,r.useState)(!1),[_,B]=(0,r.useState)(0),[H,U]=(0,r.useState)(!1),[K,G]=(0,r.useState)(!1),[X,Q]=(0,r.useState)(!1),[ee,et]=(0,r.useState)(!1),[ea,es]=(0,r.useState)(!1),[er,ei]=(0,r.useState)(!0),[en,el]=(0,r.useState)(null),[eo,ec]=(0,r.useState)(null),[ed,eu]=(0,r.useState)(null),[em,ex]=(0,r.useState)(""),[ep,eh]=(0,r.useState)(!1),ef=(0,r.useRef)(null),ev=(0,r.useRef)(null),eg=(0,r.useRef)(null),eb=(0,r.useRef)(null),ej=(0,r.useRef)(!1),ey=function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a]},eN=function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a]},ew="text-[var(--color-text)]",eD="dark"===N?"bg-[#272729] border-[#343536] text-white placeholder-[#818384]":"bg-[var(--color-surface)] border-[var(--color-border)] text-[var(--color-text)] placeholder-[var(--color-text-secondary)]",eC="text-[var(--color-text)]",ek="text-[var(--color-text-secondary)]",eS="dark"===N?"bg-[#1A1A1B]/30 border-[var(--color-border)]":"bg-[var(--color-surface)] border-[var(--color-border)]",[eI,eE]=(0,r.useState)(!1),[eP,eF]=(0,r.useState)(!1),[eZ,eA]=(0,r.useState)(!1),eR=(0,r.useRef)({name:"",email:"",phone:"",location:"",website:"",linkedin:"",github:"",bio:"",experience:[],education:[],skills:[],certifications:[],languages:[]}),[eT,eM]=(0,r.useState)({name:"",email:"",phone:"",location:"",website:"",linkedin:"",github:"",bio:"",experience:[],education:[],skills:[],certifications:[],languages:[]});(0,r.useEffect)(()=>{J(!0)},[]),(0,r.useEffect)(()=>{let e=h.query.section;if(e)switch(Array.isArray(e)?e[0]:e){case"experience":B(1),window.scrollTo({top:0,behavior:"smooth"}),requestAnimationFrame(()=>{var e;null===(e=ev.current)||void 0===e||e.focus(),ex("Opened Work Experience section")});break;case"education":B(2),window.scrollTo({top:0,behavior:"smooth"}),requestAnimationFrame(()=>{var e;null===(e=eg.current)||void 0===e||e.focus(),ex("Opened Education section")});break;case"skills":B(3),window.scrollTo({top:0,behavior:"smooth"}),requestAnimationFrame(()=>{var e;null===(e=eb.current)||void 0===e||e.focus(),ex("Opened Skills and Certifications section")});break;default:B(0),window.scrollTo({top:0,behavior:"smooth"}),requestAnimationFrame(()=>{var e;null===(e=ef.current)||void 0===e||e.focus(),ex("Opened Personal Information section")})}},[h.query.section]),(0,r.useEffect)(()=>{"unauthenticated"===j&&h.push("/login?callbackUrl=/profile-setup")},[j,h]),(0,r.useEffect)(()=>{eR.current=eT},[eT]),(0,r.useEffect)(()=>{(async()=>{var e,t,a,s,r,i,n,l,o,c,u,m,x,p,h,v,g,b,y,N;if(ea){ey("⏭️ Skipping profile load - using parsed resume data"),ei(!1);return}let w=sessionStorage.getItem("parsedResumeData");if(w)try{let e=JSON.parse(w);if((null==f?void 0:null===(t=f.user)||void 0===t?void 0:t.email)&&e.email&&e.email.toLowerCase()!==f.user.email.toLowerCase())ey("⚠️ SessionStorage data belongs to different user, clearing stale cache"),sessionStorage.removeItem("parsedResumeData");else{ey("\uD83D\uDCE6 Found parsed resume data in session storage"),e.experience&&Array.isArray(e.experience)&&(e.experience
1=(0,d.sortExperiencesDesc)(e.experience)),eM(e),es(!0),ei(!1);return}}catch(e){eN("Failed to parse session data:",e),sessionStorage.removeItem("parsedResumeData")}if("loading"===j){ey("⏳ Waiting for session...");return}if(!(null==f?void 0:null===(e=f.user)||void 0===e?void 0:e.email)){ey("❌ No session found"),ei(!1);return}ey("\uD83D\uDD0D Fetching profile for:",f.user.email),ei(!0);try{let e=await fetch("/api/check-profile"),t=await e.json();if(ey("\uD83D\uDCE6 API Response:",t),t.exists&&t.profile){ey("\uD83D\uDCE5 Loading existing profile:",t.profile),ey("\uD83D\uDCCA Profile has",(null===(a=t.profile.experiences)||void 0===a?void 0:a.length)||0,"experiences");let e=t.profile;e.experiences&&e.experiences.forEach((e,t)=>{var a;ey("   Experience ".concat(t+1," (").concat(e.company,"): ").concat((null===(a=e.projects)||void 0===a?void 0:a.length)||0," projects")),e.projects&&e.projects.length>0&&e.projects.forEach((e,t)=>{ey("      Project ".concat(t+1,": ").concat(e.name))})});let d={name:(null===(s=e.personal)||void 0===s?void 0:s.fullName)||"",email:(null===(r=e.personal)||void 0===r?void 0:r.email)||f.user.email||"",phone:(null===(i=e.personal)||void 0===i?void 0:i.phone)||"",location:(null===(n=e.personal)||void 0===n?void 0:n.location)||"",website:(null===(l=e.personal)||void 0===l?void 0:l.portfolio)||(null===(o=e.personal)||void 0===o?void 0:o.website)||"",linkedin:(null===(c=e.personal)||void 0===c?void 0:c.linkedin)||"",github:(null===(u=e.personal)||void 0===u?void 0:u.github)||"",bio:e.summary||(null===(m=e.personal)||void 0===m?void 0:m.summary)||"",experience:(null===(x=e.experiences)||void 0===x?void 0:x.map((e,t)=>{var a,s;return{id:e._id||e.id||Date.now().toString(),company:e.company||"",position:e.title||e.position||"",startDate:eq(e.startDate||""),endDate:eq(e.endDate||""),current:e.current||!1,description:(null===(a=e.bullets)||void 0===a?void 0:a.join("\n"))||e.description||"",location:e.location||"",projects:(null===(s=e.projects)||void 0===s?void 0:s.map((e,a)=>({id:e.id||e._id||"proj-".concat(t,"-").concat(a,"-").concat(Date.now()),name:e.name||"",description:e.description||""})))||[]}}))||[],education:(null===(p=e.education)||void 0===p?void 0:p.map(e=>{let t=eq(e.startDate||(e.startYear?String(e.startYear):"")),a=eq(e.endDate||(e.endYear?String(e.endYear):"")),s=e.startYear||(t?parseInt(t.split("-")[0],10):void 0),r=e.endYear||(a?parseInt(a.split("-")[0],10):void 0);return{id:e._id||e.id||Date.now().toString(),institution:e.institution||"",degree:e.degree||"",field:e.field||"",startDate:t,endDate:a,startYear:s,endYear:r,gpa:e.gpa||""}}))||[],skills:[...(null===(h=e.skills)||void 0===h?void 0:h.primary)||[],...(null===(v=e.skills)||void 0===v?void 0:v.secondary)||[],...(null===(g=e.skills)||void 0===g?void 0:g.tools)||[]],certifications:(null===(b=e.certifications)||void 0===b?void 0:b.map(e=>{var t,a;return{id:e._id||e.id||Date.now().toString(),name:e.name||"",issuer:e.issuer||"",date:eq(e.date||(null===(t=e.year)||void 0===t?void 0:t.toString())||""),expiryDate:eq(e.expiryDate||(null===(a=e.expiryYear)||void 0===a?void 0:a.toString())||""),credentialId:e.credentialId||""}}))||[],languages:(null===(y=e.languages)||void 0===y?void 0:y.map(e=>({name:e.language||e.name||"",level:e.proficiency||e.level||""})))||[]};ey("✅ Mapped profile data:",{name:d.name,email:d.email,experienceCount:d.experience.length,totalProjects:d.experience.reduce((e,t)=>{var a;return e+((null===(a=t.projects)||void 0===a?void 0:a.length)||0)},0),skillsCount:d.skills.length}),ey("\uD83C\uDFAF About to call setProfile with:",JSON.stringify(d,null,2).substring(0,500)),eM(d),ey("✅ setProfile called - waiting for state update..."),setTimeout(()=>{ey("\uD83D\uDD0D Verifying profile state after setProfile:"),ey("   Current profile.name:",eT.name),ey("   Current profile.email:",eT.email),ey("   Current profile.experience.length:",eT.experience.length)},100),sessionStorage.removeItem("parsedResumeData")}else ey("ℹ️ No existing profile found, starting fresh"),eM(e=>{var t,a;return{...e,name:(null==f?void 0:null===(t=f.user)||void 0===t?void 0:t.name)||e.name,email:(null==f?void 0:null===(a=f.user)||void 0===a?void 0:a.email)||e.email}}),ey("✅ Initialized profile with session email:",null==f?void 0:null===(N=f.user)||void 0===N?void 0:N.email)}catch(e){eN("❌ Error loading profile:",e)}finally{ei(!1)}})()},[f,j,ea]),(0,r.useEffect)(()=>{let e={value:!1},t=()=>{e.value||(e.value=!0,window.requestAnimationFrame(()=>{e.value=!1;let t=window.pageYOffset||document.documentElement.scrollTop,a=document.documentElement.scrollHeight,s=window.innerHeight||document.documentElement.clientHeight,r=a>s+100&&t>200,i=t>
1100,n=t+s<a-50;eE(e=>e===r?e:r),eA(e=>e===i?e:i),eF(e=>e===n?e:n)}))};return t(),window.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t,{passive:!0}),()=>{window.removeEventListener("scroll",t),window.removeEventListener("resize",t)}},[_]);let ez=(0,r.useRef)(null),eY=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(!er)return ez.current&&(clearTimeout(ez.current),ez.current=null),ez.current=window.setTimeout(async()=>{var e;if(!eY.current){if((null==f?void 0:null===(e=f.user)||void 0===e?void 0:e.email)&&navigator.onLine){eY.current=!0,G(!0);try{await eL(eT,{showToast:!1,triggerValidation:!1}),eu(new Date().toISOString()),sessionStorage.removeItem("parsedResumeData")}catch(e){eN("Autosave (server) failed, falling back to local storage:",e);try{localStorage.setItem("userProfile",JSON.stringify(eT)),sessionStorage.setItem("parsedResumeData",JSON.stringify(eT)),eu(new Date().toISOString())}catch(e){eN("Autosave fallback failed",e)}}finally{eY.current=!1,setTimeout(()=>G(!1),250)}}else try{localStorage.setItem("userProfile",JSON.stringify(eT)),sessionStorage.setItem("parsedResumeData",JSON.stringify(eT)),eu(new Date().toISOString())}catch(e){eN("Autosave failed",e)}}},1500),()=>{ez.current&&(clearTimeout(ez.current),ez.current=null)}},[eT,er]);let eq=e=>{if(!e||e.toLowerCase().includes("present")||e.toLowerCase().includes("current"))return"";if(/^\d{4}-\d{2}$/.test(e))return e;let t=e.match(/^(\d{1,2})\/(\d{4})$/);if(t){let e=t[1].padStart(2,"0"),a=t[2];return"".concat(a,"-").concat(e)}if(/^\d{4}$/.test(e))return"".concat(e,"-01");let a=e.match(/^([A-Za-z]+)\s+(\d{4})$/);if(a){let e={jan:"01",january:"01",feb:"02",february:"02",mar:"03",march:"03",apr:"04",april:"04",may:"05",jun:"06",june:"06",jul:"07",july:"07",aug:"08",august:"08",sep:"09",sept:"09",september:"09",oct:"10",october:"10",nov:"11",november:"11",dec:"12",december:"12"}[a[1].toLowerCase()];if(e)return"".concat(a[2],"-").concat(e)}return""},eO=e=>{if(!e)return"";if(e.toLowerCase().includes("present")||e.toLowerCase().includes("current"))return"Present";let t=e.match(/^(\d{4})-(\d{1,2})$/);if(t){let e=t[1],a=t[2].padStart(2,"0");return"".concat(a,"/").concat(e)}let a=e.match(/^(\d{1,2})\/(\d{4})$/);if(a){let e=a[1].padStart(2,"0"),t=a[2];return"".concat(e,"/").concat(t)}let s=e.match(/^([A-Za-z]+)\s+(\d{4})$/);if(s){let e={jan:"01",january:"01",feb:"02",february:"02",mar:"03",march:"03",apr:"04",april:"04",may:"05",jun:"06",june:"06",jul:"07",july:"07",aug:"08",august:"08",sep:"09",sept:"09",september:"09",oct:"10",october:"10",nov:"11",november:"11",dec:"12",december:"12"}[s[1].toLowerCase()];if(e)return"".concat(e,"/").concat(s[2])}return e},eL=async(e,t)=>{var a,s,r,i,n,l;let o=null===(a=null==t?void 0:t.showToast)||void 0===a||a,c=null!==(s=null==t?void 0:t.triggerValidation)&&void 0!==s?s:o;try{let t=(null==f?void 0:null===(r=f.user)||void 0===r?void 0:r.email)||"default-user";ey("\uD83D\uDCBE Saving profile with userId (email):",t),ey("\uD83D\uDCE7 Resume email:",e.email);let a={userId:t,personal:{fullName:e.name.trim(),title:(null===(n=e.experience[0])||void 0===n?void 0:null===(i=n.position)||void 0===i?void 0:i.trim())||"Professional",email:t,phone:e.phone.trim(),location:e.location.trim(),linkedin:e.linkedin.trim(),github:e.github.trim(),portfolio:e.website.trim(),summary:e.bio.trim()},summary:e.bio.trim()||"Experienced professional with expertise in ".concat(e.skills.slice(0,3).join(", ")||"various technologies","."),skills:{primary:e.skills.slice(0,5),secondary:e.skills.slice(5),tools:[],domains:[]},experiences:e.experience.filter(e=>{var t,a,s,r;return(null===(t=e.company)||void 0===t?void 0:t.trim())&&((null===(a=e.position)||void 0===a?void 0:a.trim())||(null===(s=e.title)||void 0===s?void 0:s.trim()))&&(null===(r=e.startDate)||void 0===r?void 0:r.trim())}).map((t,a)=>({id:t.id,company:t.company,title:t.position||t.title||"",location:t.location,startDate:eO(t.startDate),endDate:t.current?void 0:eO(t.endDate),current:t.current,domain:"Professional Services",techStack:e.skills.slice(0,5),bullets:t.description?t.description.split("\n").map(e=>e.replace(/^[\s\u2022\-*]+/,"").trim()).filter(e=>e.length>0):[],projects:t.projects.map(e=>({id:e.id,name:e.name,description:e.description})),relevanceScore:0})),education:e.education.filter(e=>{var t,a;return(null===(t=e.degree)||void 0===t?void 0:t.trim())&&(null===(a=e.institution)||void 0===a?void 0:a.trim())}).map(e=>{var t,a,s;let r=eO(e.startDate),i=eO(e.endDate),n=null==r?void 0:r.match(/\/(\d{4})$/),l=null==i?void 0:i.match(/\/(\d{4})$/),o=null!==(a=e.startYear)&&void 0!==a?a:n?parseInt(n[1],10):void 0,c=null!==(s=e.endYear)&&void 0!==s?s:l?parseInt(l[1],10):void 0;return{id:e.id,institution:e.institution,degree:e.degree,field:(null===(t=e.field)||void 0===t?void 0:t.trim())||"General Studies",startYear:o,endYear:c,gpa:e.gpa}}),certifications:e.certifications.filter(e=>{var t,a;return(null===(t=e.name)||void 0===t?void 0:t.trim())&&(null===(a=e.issuer)||void 0===a?void 0:a.trim())}).map(e=>{let t=eO(e.date),a=eO(e.expiryDate),s=null==t?void 0:t.match(/\/(\d{4})$/),r=null==a?void 0:a.match(/\/(\d{4})$/);return{id:e.id,name:e.name,issuer:e.issuer,year:s?parseInt(s[1],10):void 0,expiryYear:r?parseInt(r[1],10):void 0,credentialId:e.credentialId}}),saveMask:{certifications:["replace"],education:["replace"]}};c&&eh(!0);let s=!(null===(l=e.name)||void 0===l?void 0:l.trim()),d=e.experience.filter(e=>{var t,a,s;return!(null===(t=e.company)||void 0===t?void 0:t.trim())||!(null===(a=e.position)||void 0===a?void 0:a.trim())||!(null===(s=e.startDate)||void 0===s?void 0:s.trim())}),x=e.education.filter(e=>{var t,a;return!(null===(t=e.degree)||void 0===t?void 0:t.trim())||!(null===(a=e.institution)||void 0===a?void 0:a.trim())}),p=e.certifications.filter(e=>{var t,a;return!(null===(t=e.name)||void 0===t?void 0:t.trim())||!(null===(a=e.issuer)||void 0===a?void 0:a.trim())}),h=s||d.length>0||x.length>0||p.length>0;if(h&&o){let e=[];s&&e.push("Full Name required in Personal Info"),d.length>0&&e.push("".concat(d.length," experience").concat(d.length>
11?"s":""," (need Title, Company & Start Date)")),x.length>0&&e.push("".concat(x.length," education entr").concat(x.length>1?"ies":"y"," (need Institution & Degree)")),p.length>0&&e.push("".concat(p.length," certification").concat(p.length>1?"s":""," (need Name & Issuer)")),u.default.error("⚠️ ".concat(e.join(", ")," - fill required fields (marked with *) to save."),{duration:8e3,style:{maxWidth:"550px"}})}ey("\uD83D\uDCBE Saving careerProfile with certifications:",{count:a.certifications.length,certs:a.certifications.map(e=>({id:e.id,name:e.name})),saveMask:a.saveMask});let v=await fetch("/api/profile/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),g=await v.json();if(!v.ok){eN("❌ Save API returned error:",g);let e=g.message||"Failed to save profile";if(g.details&&Array.isArray(g.details)&&g.details.length>0){let t=g.details.map(e=>{let t=e.path.match(/experiences\[(\d+)\]\.(\w+)/);if(t){let e=parseInt(t[1])+1,a=t[2];return"Experience ".concat(e,": Missing ").concat(a)}let a=e.path.match(/experiences\[(\d+)\]\.projects\[(\d+)\]\.(\w+)/);if(a){let e=parseInt(a[1])+1,t=parseInt(a[2])+1;return"Experience ".concat(e,", Project ").concat(t,": Missing name")}let s=e.path.match(/education\[(\d+)\]\.(\w+)/);if(s){let e=parseInt(s[1])+1,t=s[2];return"Education ".concat(e,": Missing ").concat(t)}let r=e.path.match(/personal\.(\w+)/);if(r){let e=r[1];return"Missing ".concat(e)}return e.issue});e=t[0],eN("\uD83D\uDCCB Validation errors:",g.details),eN("\uD83D\uDD0D Field errors:",t)}throw Error(e)}return ey("✅ Profile saved to database successfully"),ey("\uD83D\uDCCA Save result:",g),h||eh(!1),o&&u.default.success("Profile saved successfully!",{duration:3e3,icon:(0,m.q)("check")}),!0}catch(e){if(eN("❌ Failed to save profile to database:",e),eN("\uD83D\uDC1E Error details:",e instanceof Error?e.message:JSON.stringify(e)),o){let t=(e instanceof Error?e.message:"Unknown error").replace(/^(Profile validation failed:|Failed to save profile:)\s*/i,"");u.default.error(t,{duration:5e3,style:{maxWidth:"400px"}})}throw e}},e$=async e=>{if(ey("\uD83D\uDCC4 Resume data received:",e),ej.current){ey("⏭️ Already processing resume, skipping duplicate call");return}ej.current=!0;try{var t,a;if(sessionStorage.removeItem("parsedResumeData"),localStorage.removeItem("userProfile"),ey("\uD83E\uDDF9 Cleared cached profile data before processing new resume"),!e||!e.name){eN("❌ Invalid resume data - missing required fields");return}let r={name:e.name||"",email:(null==f?void 0:null===(t=f.user)||void 0===t?void 0:t.email)||e.email||"",phone:e.phone||"",location:e.location||"",website:e.website||"",linkedin:e.linkedin||"",github:e.github||"",bio:e.bio||"",experience:(null===(a=e.experience)||void 0===a?void 0:a.map((e,t)=>({id:"exp-".concat(t),company:e.company||"",position:e.title||"",startDate:e.startDate||"",endDate:e.endDate||"",current:e.current||!1,description:e.description||"",location:e.location||"",projects:(e.projects||[]).map((e,a)=>({id:"proj-".concat(t,"-").concat(a),name:e.name||"",description:e.description||""}))})))||[],education:(e.education||[]).map(e=>{let t=e.endDate||e.graduationDate||e.end||e.endYear,a=e.startDate||e.start||e.startYear,s=t&&String(t).match(/(19|20)\d{2}/)?parseInt(String(t).match(/(19|20)\d{2}/)[0],10):void 0,r=a&&String(a).match(/(19|20)\d{2}/)?parseInt(String(a).match(/(19|20)\d{2}/)[0],10):void 0;return{id:e.id||"edu-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),institution:e.institution||e.school||"",degree:e.degree||"",field:e.field||e.major||e.fieldOfStudy||"",startDate:e.startDate||"",endDate:e.endDate||e.graduationDate||"",gpa:e.gpa||"",startYear:r,endYear:s}}),skills:e.skills||[],certifications:(e.certifications||[]).map(e=>{var t,a;return{id:e.id||"cert-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),name:e.name||"",issuer:e.issuer||"",date:e.date||(null===(t=e.year)||void 0===t?void 0:t.toString())||"",expiryDate:e.expiryDate||(null===(a=e.expiryYear)||void 0===a?void 0:a.toString())||"",credentialId:e.credentialId||""}}),languages:e.languages||[]},i=r.education.filter(e=>{var t,a;return!(null===(t=e.institution)||void 0===t?void 0:t.trim())||!(null===(a=e.degree)||void 0===a?void 0:a.trim())}),n=r.certifications.filter(e=>{var t,a;return!(null===(t=e.name)||void 0===t?void 0:t.trim())||!(null===(a=e.issuer)||void 0===a?void 0:a.trim())});if(i.length>0||n.length>0){let e=[];i.length>0&&e.push("".concat(i.length," education entr").concat(i.length>1?"ies need":"y needs"," completion")),n.length>0&&e.push("".concat(n.length," certification").concat(n.length>
11?"s need":" needs"," completion")),(0,u.default)("Some items need your attention: ".concat(e.join(", "),". Please review and fill in missing details."),{icon:(0,m.q)("warn"),duration:6e3,style:{maxWidth:"450px"}})}if(ey("\uD83D\uDCDD Structured data:",{hasName:!!r.name,hasEmail:!!r.email,experienceCount:r.experience.length,skillsCount:r.skills.length,projectsCount:r.experience.reduce((e,t)=>{var a;return e+((null===(a=t.projects)||void 0===a?void 0:a.length)||0)},0),educationCount:r.education.length,incompleteEducation:i.length,certificationCount:r.certifications.length,incompleteCertifications:n.length}),!(r.experience.length>0||r.skills.length>0||r.education.length>0)&&!r.name&&!r.email){eN("❌ Parsed resume appears empty — nothing to import"),u.default.error("Unable to extract useful data from the uploaded file. Try uploading a different copy (DOCX is best).",{duration:6e3,style:{maxWidth:"400px"}});return}r.name&&r.email||(ey("⚠️ Parsed resume is missing name and/or email — user should review the profile before saving."),(0,u.default)(e=>(0,s.jsx)("div",{children:"Parsed resume created but name/email may be missing — please review before completing your profile."}))),es(!0),ey("✅ isDataFromResume flag set to true"),ey("\uD83D\uDCDD About to call setProfile with structured data..."),r.experience&&Array.isArray(r.experience)&&(r.experience=(0,d.sortExperiencesDesc)(r.experience)),eM(r),ey("✅ setProfile called"),et(!1),ey("✅ Resume upload modal closed"),sessionStorage.setItem("parsedResumeData",JSON.stringify(r)),ey("✅ Data saved to sessionStorage"),ey("✅ Form state updated with resume data"),ey("\uD83D\uDCCA Profile state after update:",{name:r.name,experienceCount:r.experience.length,projectsCount:r.experience.reduce((e,t)=>{var a;return e+((null===(a=t.projects)||void 0===a?void 0:a.length)||0)},0)}),ey("✅ Resume import complete - form populated with parsed data"),ey("\uD83D\uDCBE Auto-saving parsed resume data to database...");try{await eL(r,{showToast:!1,triggerValidation:!1}),ey("✅ Profile data saved to database"),ey("ℹ️ You can now review and edit your information")}catch(e){eN("❌ CRITICAL: Failed to save resume data:",e),u.default.error('Resume parsed but failed to save to database. Please click "Complete Profile" to retry.',{duration:6e3,style:{maxWidth:"400px"}})}}finally{setTimeout(()=>{ej.current=!1,ey("\uD83D\uDD13 Processing flag reset")},1e3)}},eW=[{title:"Personal Information",description:"Basic contact details and professional summary",icon:E.Z},{title:"Work Experience",description:"Your employment history and achievements",icon:P.Z},{title:"Education",description:"Academic background and qualifications",icon:F.Z},{title:"Skills & Certifications",description:"Technical skills and professional certifications",icon:Z.Z}],eV=(0,r.useMemo)(()=>{let e;let t=e=>(null!=e?e:"").trim(),a=0;e=0+(t(eT.name)?12:0);let s=t(eT.bio);e+=(s.length>=40?8:s.length>0?4:0)+(t(eT.phone)||t(eT.location)?5:0)+Math.min(5,2*((t(eT.linkedin)?1:0)+(t(eT.github)?1:0)+(t(eT.website)?1:0))),a+=Math.min(25,e)+(eT.experience.some(e=>t(e.position)&&t(e.company)&&t(e.startDate))?25:eT.experience.length>0?10:0),0===eT.education.length?a+=25:a+=eT.education.some(e=>t(e.institution)&&t(e.degree))?25:12;let r=Math.min(8,4*eT.certifications.filter(e=>t(e.name)&&t(e.issuer)).length);return Math.min(100,Math.round(a+=Math.min(25,8*eT.skills.length+r)))},[eT]),eJ=(0,r.useCallback)(()=>{let e={id:Date.now().toString(),company:"",position:"",startDate:"",endDate:"",current:!1,description:"",location:"",projects:[]};eM(t=>({...t,experience:[...t.experience,e]})),el(e.id)},[]),e_=(0,r.useCallback)((e,t,a)=>{eM(s=>({...s,experience:s.experience.map(s=>s.id===e?{...s,[t]:a}:s)}))},[]),eB=(0,r.useCallback)(e=>{eM(t=>({...t,experience:t.experience.filter(t=>t.id!==e)}))},[]),eH=(e,t,a)=>{eM(s=>({...s,education:s.education.map(s=>{if(s.id!==e)return s;if("startDate"===t){let e=a||"",t=e.match(/^(\d{4})(?:-|\/|$)/)||e.match(/(\d{4})$/),r=t?parseInt(t[1],10):void 0;return{...s,startDate:a,startYear:r}}if("endDate"===t){let e=a||"",t=e.match(/^(\d{4})(?:-|\/|$)/)||e.match(/(\d{4})$/),r=t?parseInt(t[1],10):void 0;return{...s,endDate:a,endYear:r}}return{...s,[t]:a}})}))},eU=e=>{eM(t=>({...t,education:t.education.filter(t=>t.id!==e)}))},eK=e=>{e.trim()&&!eT.skills.includes(e.trim())&&eM(t=>({...t,skills:[...t.skills,e.trim()]}))},eG=e=>{eM(t=>({...t,skills:t.skills.filter(t=>t!==e)}))},eX=(0,r.useCallback)(e=>{let t={id:Date.now().toString(),name:"",description:""};eM(a=>({...a,experience:a.experience.map(a=>a.id===e?{...a,projects:[...a.projects,t]}:a)}))},[]),eQ=(0,r.useCallback)((e,t,a,s)=>{eM(r=>({...r,experience:r.experience.map(r=>r.id===e?{...r,projects:r.projects.map(e=>e.id===t?{...e,[a]:s}:e)}:r)}))},[]),e0=(0,r.useCallback)((e,t)=>{eM(a=>({...a,experience:a.experience.map(a=>a.id===e?{...a,projects:a.projects.filter(e=>e.id!==t)}:a)}))},[]),e1=(e,t,a)=>{eM(s=>({...s,certifications:s.certifications.map(s=>s.id===e?{...s,[t]:a}:s)}))},e2=e=>{eM(t=>({...t,certifications:t.certifications.filter(t=>t.id!==e)}))},e3=async()=>{var e,t,a,s,r,i,n;if(ey("\uD83D\uDE80 handleSave called"),ey("\uD83D\uDCCD Manual save triggered by user"),U(!0),ey("\uD83D\uDCCB Current profile state:",{name:eT.name,email:eT.email,phone:eT.phone,location:eT.location,experienceCount:eT.experience.length,skillsCount:eT.skills.length,firstExperience:null===(e=eT.experience[0])||void 0===e?void 0:e.company,projectsIn
1FirstExp:(null===(a=eT.experience[0])||void 0===a?void 0:null===(t=a.projects)||void 0===t?void 0:t.length)||0}),!eT.name&&!eT.email&&0===eT.experience.length){eN("❌ BLOCKED: handleSave called with EMPTY profile state!"),eN("\uD83D\uDCCB Profile state:",eT),eN("⚠️ This should NOT happen - there is a bug somewhere calling handleSave prematurely"),u.default.error("Profile data is empty. Please parse your resume first.",{duration:4e3,style:{maxWidth:"400px"}}),U(!1);return}try{if(!eT.name||!eT.name.trim()){eN("❌ Validation failed: No name"),u.default.error("Please enter your full name",{duration:3e3,style:{maxWidth:"400px"}}),U(!1);return}if(!eT.email||!eT.email.trim()||!eT.email.includes("@")){eN("❌ Validation failed: Invalid email"),u.default.error("Please enter a valid email address",{duration:3e3,style:{maxWidth:"400px"}}),U(!1);return}if(0===eT.experience.length){eN("❌ Validation failed: No experience"),u.default.error("Please add at least one work experience"),U(!1);return}if(eT.experience.filter(e=>{if(e.company||e.position||e.startDate||e.description){var t,a,s;if(!(null===(t=e.company)||void 0===t?void 0:t.trim())||!(null===(a=e.position)||void 0===a?void 0:a.trim())||!(null===(s=e.startDate)||void 0===s?void 0:s.trim()))return!0}return!1}).length>0){let e=eT.experience.findIndex(e=>{if(e.company||e.position||e.startDate||e.description){var t,a,s;if(!(null===(t=e.company)||void 0===t?void 0:t.trim())||!(null===(a=e.position)||void 0===a?void 0:a.trim())||!(null===(s=e.startDate)||void 0===s?void 0:s.trim()))return!0}return!1}),t=[],a=eT.experience[e];(null===(r=a.company)||void 0===r?void 0:r.trim())||t.push("company name"),(null===(i=a.position)||void 0===i?void 0:i.trim())||t.push("job title"),
1(null===(n=a.startDate)||void 0===n?void 0:n.trim())||t.push("start date"),eN("❌ Validation failed: Invalid experience at index",e,a),u.default.error("Experience ".concat(e+1,": Missing ").concat(t.join(", ")),{duration:5e3,style:{maxWidth:"400px"}}),U(!1);return}for(let e=0;e<eT.experience.length;e++){let t=eT.experience[e];if(t.projects&&t.projects.length>0)for(let a=0;a<t.projects.length;a++){let s=t.projects[a];if(!s.name||!s.name.trim()){u.default.error("Experience ".concat(e+1,", Project ").concat(a+1,": Project name is required. Please add a name or remove this project."),{duration:6e3,style:{maxWidth:"450px"}}),U(!1);return}}}if(!eT.email||!eT.email.trim()){eN("❌ Validation failed: No email"),u.default.error("Please enter your email address",{duration:3e3,style:{maxWidth:"400px"}}),U(!1);return}if(!eT.experience||0===eT.experience.length){eN("❌ Validation failed: No experience"),u.default.error("Please add at least one work experience"),U(!1);return}ey("\uD83D\uDCBE Saving profile manually..."),ey("Profile state:",{name:eT.name,email:eT.email,experienceCount:eT.experience.length,skillsCount:eT.skills.length}),localStorage.setItem("userProfile",JSON.stringify(eT)),eh(!0);let e=!(null===(s=eT.name)||void 0===s?void 0:s.trim()),t=eT.experience.filter(e=>{var t,a,s;return!(null===(t=e.company)||void 0===t?void 0:t.trim())||!(null===(a=e.position)||void 0===a?void 0:a.trim())||!(null===(s=e.startDate)||void 0===s?void 0:s.trim())}),a=eT.education.filter(e=>{var t,a;return!(null===(t=e.degree)||void 0===t?void 0:t.trim())||!(null===(a=e.institution)||void 0===a?void 0:a.trim())}),l=eT.certifications.filter(e=>{var t,a;return!(null===(t=e.name)||void 0===t?void 0:t.trim())||!(null===(a=e.issuer)||void 0===a?void 0:a.trim())});if(e||t.length>0||a.length>0||l.length>0){let s=[];e&&s.push("Full Name"),t.length>0&&s.push("".concat(t.length," experience").concat(t.length>1?"s":""," (Title, Company, Start Date)")),a.length>0&&s.push("".concat(a.length," education").concat(a.length>1?"s":""," (Institution, Degree)")),l.length>0&&s.push("".concat(l.length," certification").concat(l.length>1?"s":""," (Name, Issuer)")),u.default.error("⚠️ Please complete required fields: ".concat(s.join(", ")),{duration:6e3,style:{maxWidth:"500px"}}),U(!1);return}let o=u.default.loading("Saving your profile...",{style:{maxWidth:"400px"}});try{await eL(eT,{showToast:!1,triggerValidation:!0}),u.default.dismiss(o),u.default.success("Profile saved successfully!",{duration:3e3,icon:(0,m.q)("check")}),sessionStorage.removeItem("parsedResumeData"),es(!1),setTimeout(()=>{h.push("/create-resume")},1500)}catch(e){throw u.default.dismiss(o),e}}catch(t){eN("Failed to save profile:",t);let e=(t instanceof Error?t.message:"Failed to save profile. Please try again.").replace(/^(Profile validation failed:|Failed to save profile:)\s*/i,"");u.default.error(e,{duration:5e3,style:{maxWidth:"400px"}})}finally{U(!1)}},e4=async()=>{var e,t;eh(!0);let a=!(null===(e=eT.name)||void 0===e?void 0:e.trim()),s=eT.experience.filter(e=>{var t,a,s;return!(null===(t=e.company)||void 0===t?void 0:t.trim())||!(null===(a=e.position)||void 0===a?void 0:a.trim())||!(null===(s=e.startDate)||void 0===s?void 0:s.trim())}),r=eT.education.filter(e=>{var t,a;return!(null===(t=e.degree)||void 0===t?void 0:t.trim())||!(null===(a=e.institution)||void 0===a?void 0:a.trim())}),i=eT.certifications.filter(e=>{var t,a;return!(null===(t=e.name)||void 0===t?void 0:t.trim())||!(null===(a=e.issuer)||void 0===a?void 0:a.trim())});if(a||s.length>0||r.length>0||i.length>0){let e=[];a&&e.push("Full Name"),s.length>0&&e.push("".concat(s.length," experience").concat(s.length>1?"s":""," (Title, Company, Start Date)")),r.length>0&&e.push("".concat(r.length," education").concat(r.length>1?"s":""," (Institution, Degree)")),i.length>0&&e.push("".concat(i.length," certification").concat(i.length>1?"s":""," (Name, Issuer)")),u.default.error("⚠️ Please complete required fields: ".concat(e.join(", ")),{duration:6e3,style:{maxWidth:"500px"}});return}G(!0);try{(null==f?void 0:null===(t=f.user)||void 0===t?void 0:t.email)?(await eL(eT,{showToast:!1,triggerValidation:!0}
1),sessionStorage.removeItem("parsedResumeData"),u.default.success("Draft saved to your account",{duration:2e3,icon:(0,m.q)("check"),style:{maxWidth:"400px"}})):(localStorage.setItem("userProfile",JSON.stringify(eT)),sessionStorage.setItem("parsedResumeData",JSON.stringify(eT)),u.default.success("Draft saved locally",{duration:2e3,icon:(0,m.q)("check"),style:{maxWidth:"400px"}}))}catch(e){localStorage.setItem("userProfile",JSON.stringify(eT)),sessionStorage.setItem("parsedResumeData",JSON.stringify(eT)),u.default.error("Server save failed — draft saved locally",{duration:4e3,style:{maxWidth:"400px"}})}finally{setTimeout(()=>G(!1),200)}},e5=()=>{var e,t;ey("\uD83D\uDCCD Next step clicked. Current step:",_,"/",eW.length-1),ey("\uD83D\uDCCB Current profile state:",{name:eT.name,email:eT.email,experienceCount:(null===(e=eT.experience)||void 0===e?void 0:e.length)||0,skillsCount:(null===(t=eT.skills)||void 0===t?void 0:t.length)||0}),_<eW.length-1?(B(_+1),window.scrollTo({top:0,behavior:"smooth"})):(ey("\uD83C\uDFC1 Last step - calling handleSave"),e3())},e8=()=>{_>0&&(B(_-1),window.scrollTo({top:0,behavior:"smooth"}))},e9=e=>{B(e),window.scrollTo({top:0,behavior:"smooth"})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n(),{children:[(0,s.jsx)("title",{children:"Profile Setup - TrueResume"}),(0,s.jsx)("meta",{name:"description",content:"Set up your professional profile"})]}),(0,s.jsxs)("div",{className:"min-h-screen pt-14 sm:pt-16 pb-20 md:pb-0 transition-colors duration-300 overflow-x-hidden bg-[var(--color-canvas)] text-[var(--color-text)] antialiased",children:[(0,s.jsx)(x.Z,{}),(0,s.jsx)(W.Z,{title:"Complete Your Profile",subtitle:ea?"Auto-filled from resume":void 0,onPrimary:e4,primaryLabel:"Save"}),(0,s.jsx)("div",{className:"w-full border-b border-[var(--color-border)] bg-[var(--color-surface)] shadow-sm transition-colors dark:shadow-none",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-3 px-4 py-4 sm:gap-4 sm:px-6 lg:px-10 xl:px-14",children:[(0,s.jsx)("p",{className:"text-center text-[13px] font-semibold leading-snug text-[var(--color-text-secondary)]",children:ea?"Continue editing your imported details below. Upload a r\xe9sum\xe9 at any time to refresh fields.":"Complete each section below. Upload a r\xe9sum\xe9 to import contact and experience."}),(0,s.jsxs)("div",{className:"flex w-full flex-col items-stretch justify-center gap-3 lg:flex-row lg:flex-wrap lg:items-center lg:justify-center lg:gap-5",children:[(0,s.jsxs)("nav",{className:"flex w-full flex-wrap items-center justify-center gap-y-2","aria-label":"Profile setup wizard",children:[(0,s.jsxs)("h1",{className:"sr-only",children:["Profile setup wizard, step ",_+1," of ",eW.length,": ",null===(e=eW[_])||void 0===e?void 0:e.title]}),(0,s.jsx)("div",{className:"flex flex-wrap items-center justify-center gap-0.5 sm:gap-1",children:eW.map((e,t)=>{let a=t<_,r=t===_,i=e.icon;return(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>e9(t),"aria-current":r?"step":void 0,className:"inline-flex items-center gap-1.5 rounded-full border px-2 py-1 transition-all md:gap-2 md:px-2.5 md:py-1.5 ".concat(r?"border-transparent bg-gradient-to-r from-[#FF4500] to-[#FF7335] text-white shadow-md ring-2 ring-[#FF4500]/20 dark:ring-[#FF7335]/25":a?"border-emerald-400/50 bg-emerald-50 text-emerald-900 shadow-sm hover:bg-emerald-100/90 dark:border-emerald-700/60 dark:bg-emerald-950/40 dark:text-emerald-100 dark:hover:bg-emerald-950/60":"border-[var(--color-border)] bg-[var(--color-surface-hover)] text-[var(--color-text-secondary)] hover:border-[#0079D3]/35 hover:bg-[var(--color-surface)] hover:text-[var(--color-text)]"),style:{fontFamily:"Rajdhani, system-ui, sans-serif"},children:[(0,s.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full shadow-inner ".concat(r?"bg-white/25 text-xl":a?"bg-emerald-500 text-white":"bg-[var(--color-canvas)] text-base dark:bg-[#272729]"),"aria-hidden":!0,children:a?(0,s.jsx)(A.Z,{className:"h-3.5 w-3.5 text-white dark:text-emerald-50",strokeWidth:2}):r?(0,s.jsx)(i,{className:"h-4 w-4 text-white",strokeWidth:2}):(0,s.jsx)("span",{className:"text-[10px] font-bold tabular-nums",children:t+1})}),(0,s.jsx)("span",{className:"max-w-[5.25rem] truncate text-[10px] font-bold sm:max-w-[8rem] sm:text-[11px] md:max-w-[10rem] md:text-xs",children:e.title})]}),t<eW.length-1?(0,s.jsx)("span",{className:"mx-px select-none text-xs text-[var(--color-text-secondary)] sm:mx-1 md:mx-1.5","aria-hidden":!0,
1children:"→"}):null]},e.title)})})]}),(0,s.jsxs)("div",{className:"relative flex w-full shrink-0 justify-center lg:w-auto",children:[(0,s.jsx)("div",{className:"absolute -right-1 -top-1 z-10 md:-top-1.5 md:-right-1.5",children:(0,s.jsxs)("span",{className:"relative flex h-2 w-2 md:h-2.5 md:w-2.5",children:[(0,s.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"}),(0,s.jsx)("span",{className:"relative inline-flex h-full w-full rounded-full bg-emerald-500"})]})}),(0,s.jsxs)("button",{type:"button",onClick:()=>et(!0),className:"group relative flex h-9 min-h-0 items-center gap-1.5 overflow-hidden whitespace-nowrap rounded-full border border-emerald-500/40 bg-emerald-600 px-3 text-xs font-bold text-white shadow transition-all hover:border-emerald-400 hover:bg-emerald-700 active:scale-[0.98] md:h-10 md:gap-2 md:px-3.5 md:text-sm",children:[(0,s.jsx)("div",{className:"absolute inset-0 -translate-x-full bg-gradient-to-r from-transparent via-white/25 to-transparent transition-transform duration-700 group-hover:translate-x-full"}),(0,s.jsx)(R.Z,{className:"relative h-3.5 w-3.5 shrink-0 md:h-4 md:w-4"}),(0,s.jsxs)("span",{className:"relative leading-tight",children:[eT.name?"Re-upload CV":"Upload CV",(0,s.jsx)("span",{className:"hidden md:inline",children:"\xa0\xb7 Auto-fill profile"})]})]})]})]}),(0,s.jsxs)("div",{className:"mx-auto w-full max-w-lg pt-0.5 lg:max-w-2xl",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[11px] font-semibold text-[var(--color-text-secondary)] sm:text-xs",children:[(0,s.jsx)("span",{children:"Profile progress"}),(0,s.jsxs)("span",{className:"tabular-nums text-[var(--color-text)]",children:[eV,"%"]})]}),(0,s.jsx)("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":eV,"aria-label":"Profile ".concat(eV," percent complete"),className:"mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-[var(--color-canvas)] ring-1 ring-inset ring-[var(--color-border)] dark:bg-[#272729]",children:(0,s.jsx)("div",{className:"h-full rounded-full bg-gradient-to-r from-[#0079D3] to-[#FF4500] transition-[width] duration-500 ease-out",style:{width:"".concat(eV,"%")}})})]})]})}),(0,s.jsx)("div",{className:"w-full px-4 py-4 sm:px-6 sm:py-6 lg:px-10 xl:px-14 pb-28",children:(0,s.jsxs)(l.E.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"w-full rounded-2xl border border-[var(--color-border)] bg-[var(--color-surface)] p-4 shadow-sm sm:p-5 lg:p-6 dark:shadow-none",children:[(0,s.jsx)("div",{"aria-live":"polite",className:"sr-only",children:em}),0===_&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"mb-3 text-center sm:mb-4",children:[(0,s.jsx)("div",{className:"mx-auto mb-2 flex justify-center",children:(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center overflow-hidden rounded-xl ring-1 ring-[var(--color-border)] bg-[var(--color-surface-hover)] shadow-inner",children:(0,s.jsx)($.ZJ,{size:36})})}),(0,s.jsx)("h2",{ref:ef,tabIndex:-1,className:"mb-0.5 text-lg font-bold sm:text-xl ".concat(eC),style:{fontFamily:"Rajdhani, sans-serif"},children:"Personal information"}),(0,s.jsx)("p",{className:"mx-auto mt-1 max-w-md text-xs sm:text-sm ".concat(ek),children:"Start with name, contacts, and a short summary."}),(0,s.jsx)("div",{className:"mt-2.5 sm:mt-3",children:(0,s.jsxs)("div",{className:"inline-flex max-w-[95%] flex-wrap items-center justify-center gap-1.5 rounded-full px-3 py-1.5 text-[11px] text-[var(--color-text-secondary)] ring-1 ring-inset ring-[var(--color-border)] sm:text-xs",children:[(0,s.jsx)(T.Z,{className:"h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400","aria-hidden":"true"}),(0,s.jsx)("span",{children:"Private and secure; your profile data stays under your account."})]})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-x-4 gap-y-3 md:grid-cols-2",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"text-xs font-semibold sm:text-sm ".concat(ew),children:["Full Name ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(v.II,{type:"text",size:"sm",value:eT.name,onChange:e=>eM(t=>({...t,name:e.target.value})),placeholder:"John Doe",className:!ep||(null===(t=eT.name)||void 0===t?void 0:t.trim())?"":"border-red-500 border-2"}),ep&&!(null===(i=eT.name)||void 0===i?void 0:i.trim())&&(0,s.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1 mt-1",children:[(0,s.jsx)(b.Z,{className:"w-3 h-3"})," Full name is required"]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"text-xs font-semibold sm:text-sm ".concat(ew),children:["Email Address ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(v.II,{type:"email",size:"sm",value:eT.email,disabled:!0,placeholder:"[email protected]",className:"cursor-not-allowed opacity-65"}),(0,s.jsx)("div",{className:"text-xs mt-1 ".concat(ek),children:"This email is set to your login and cannot be changed."})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"text-xs font-semibold sm:text-sm ".concat(ew),children:"Phone Number"}),(0,s.jsx)(v.II,{type:"tel",size:"sm",value:eT.phone,onChange:e=>eM(t=>({...t,phone:e.target.value})),placeholder:"+1 (555) 123-4567"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"text-xs font-semibold sm:text-sm ".concat(ew),children:"Location"}),(0,s.jsx)(v.II,{type:"text",size:"sm",value:eT.location,onChange:e=>eM(t=>({...t,location:e.target.value})),placeholder:"New York, NY"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"text-xs font-semibold sm:text-sm ".concat(ew),children:"LinkedIn Profile"}),(0,s.jsx)(v.II,{type:"url",size:"sm",value:eT.linkedin,onChange:e=>eM(t=>({...t,linkedin:e.target.value})),placeholder:"https://linkedin.com/in/johndoe"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"text-xs font-semibold sm:text-sm ".concat(ew),children:"GitHub Profile"}),(0,s.jsx)(v.II,{type:"url",size:"sm",value:eT.github,onChange:e=>eM(t=>({...t,github:e.target.value})),placeholder:"https://github.com/johndoe"})]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"text-xs font-semibold sm:text-sm ".concat(ew),children:"Professional summary"}),(0,s.jsx)(v.II,{as:"textarea",size:"sm",rows:4,value:eT.bio,onChange:e=>eM(t=>({...t,bio:e.target.value})),placeholder:"Brief summary of your professional background and ke
1y achievements..."})]})]}),1===_&&(0,s.jsxs)("div",{className:"space-y-3 sm:space-y-4",children:[(0,s.jsxs)("div",{className:"mb-3 text-center sm:mb-4",children:[(0,s.jsx)("div",{className:"mx-auto mb-2 flex h-10 w-10 items-center justify-center rounded-xl ring-1 ring-[var(--color-border)] bg-[#0079D3]/12 text-[#0079D3] dark:bg-[#0079D3]/20",children:(0,s.jsx)(P.Z,{className:"h-5 w-5","aria-hidden":!0})}),(0,s.jsx)("h2",{ref:ev,tabIndex:-1,className:"mb-0.5 text-lg font-bold sm:text-xl ".concat(eC),style:{fontFamily:"Rajdhani, sans-serif"},children:"Work experience"}),(0,s.jsx)("p",{className:"mx-auto mt-1 max-w-md text-xs sm:text-sm ".concat(ek),children:"Roles and impact at each employer."})]}),(0,s.jsxs)("div",{className:"space-y-3 sm:space-y-4",children:[(0,s.jsx)(S.Z5,{onDragStart:()=>{try{document.body.classList.add("dnd-active")}catch(e){}},onDragEnd:e=>{try{document.body.classList.remove("dnd-active")}catch(e){}if(!e.destination||"experience"!==e.type)return;let t=e.source.index,a=e.destination.index;t!==a&&(eM(e=>{let s=Array.from(e.experience),[r]=s.splice(t,1);return s.splice(a,0,r),{...e,experience:s}}),ex("Moved experience ".concat(t+1," to position ").concat(a+1)))},children:(0,s.jsx)(S.bK,{droppableId:"experiences",type:"experience",renderClone:(e,t,a)=>{var r;let i=a.source.index,n=eT.experience[i],l=(0,s.jsx)("div",{ref:e.innerRef,...e.draggableProps,...e.dragHandleProps,style:{...e.draggableProps.style,transition:"none",willChange:"transform",zIndex:2e5,position:"fixed"},children:(0,s.jsxs)("div",{className:"border rounded-2xl p-4 flex items-center justify-between ".concat(eS),children:[(0,s.jsx)("div",{className:"flex items-center gap-3",children:(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"font-semibold ".concat(eC),children:n.position||"Untitled Role"}),(0,s.jsx)("span",{className:"text-sm ".concat(ek),children:n.company||"Unknown Company"}),(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:[n.startDate||"—"," ",n.endDate?"→ ".concat(n.endDate):n.current?"→ Present":""]})]})}),(0,s.jsx)("div",{className:"text-xs text-gray-400 mr-2",children:(null===(r=n.projects)||void 0===r?void 0:r.length)?"".concat(n.projects.length," project").concat(1!==n.projects.length?"s":""):""})]})});if("undefined"!=typeof document&&document.body)try{return(0,I.createPortal)(l,document.body)}catch(e){}return l},children:e=>(0,s.jsxs)("div",{ref:e.innerRef,...e.droppableProps,className:"space-y-4 overflow-visible",children:[eT.experience.map((e,t)=>(0,s.jsx)(S._l,{draggableId:e.id,index:t,children:(a,r)=>{var i;return(0,s.jsx)("div",{ref:a.innerRef,...a.draggableProps,style:{...a.draggableProps.style,transition:(null==r?void 0:r.isDragging)?"none":null===(i=a.draggableProps.style)||void 0===i?void 0:i.transition,willChange:(null==r?void 0:r.isDragging)?"transform":void 0,zIndex:(null==r?void 0:r.isDragging)?9999:void 0},"data-dnd-dragging":(null==r?void 0:r.isDragging)?"true":"false",children:(0,s.jsx)(C,{exp:e,index:t,dragHandleProps:a.dragHandleProps,isDragging:!!(null==r?void 0:r.isDragging),initialExpanded:en===e.id||0===t,theme:N,labelClass:ew,inputClass:eD,headingClass:eC,subTextClass:ek,cardClass:eS,updateExperience:e_,removeExperience:eB,addProjectToExperience:eX,updateExperienceProject:eQ,removeProjectFromExperience:e0,showValidation:ep,canMoveUp:t>0,canMoveDown:t<eT.experience.length-1,moveUp:()=>{t<=0||(eM(e=>{let a=Array.from(e.experience),s=t-1,[r]=a.splice(t,1);return a.splice(s,0,r),{...e,experience:a}}),ex("Moved experience ".concat(t+1," up")))},moveDown:()=>{t>=eT.experience.length-1||(eM(e=>{let a=Array.from(e.experience),s=t+1,[r]=a.splice(t,1);return a.splice(s,0,r),{...e,experience:a}}),ex("Moved experience ".concat(t+1," down")))}},e.id)})}},e.id)),e.placeholder]})})}),(0,s.jsxs)("div",{className:"flex justify-between items-center mt-4",children:[(0,s.jsx)("div",{className:"text-xs text-[#818384]",children:ed?(0,s.jsxs)("span",{children:["Last saved: ",new Date(ed).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]}):(0,s.jsx)("span",{children:"Not saved yet"})}),(0,s.jsx)("div",{children:(0,s.jsx)(v.zx,{onClick:e4,disabled:K,size:"sm",variant:"outline",className:"".concat(K?"opacity-60 cursor-wait":""),children:(0,s.jsx)("span",{children:K?"Saving...":"Save Draft"})})})]}),(0,s.jsxs)(l.E.button,{onClick:eJ,whileHover:{scale:1.01},whileTap:{scale:.99},className:"flex w-full items-center justify-center gap-2 rounded-xl border-2 border-dashed py-3.5 text-sm font-semibold transition-colors hover:border-[#0079D3] hover:text-[#0079D3] ".concat("dark"===N?"border-[var(--color-border)] text-[var(--color-text-secondary)]":"border-slate-200 text-[var(--color-text-secondary)]"),children:[(0,s.jsx)(D.Z,{className:"h-4 w-4"}),(0,s.jsx)("span",{children:"Add Work Experience"})]})]})]}),2===_&&(0,s.jsxs)("div",{className:"space-y-3 sm:space-y-4",children:[(0,s.jsxs)("div",{className:"mb-3 text-center sm:mb-4",children:[(0,s.jsx)("div",{className:"mx-auto mb-2 flex h-10 w-10 items-center justify-center rounded-xl ring-1 ring-[var(--color-border)] bg-emerald-500/12 text-emerald-600 dark:text-emerald-400",children:(0,s.jsx)(F.Z,{className:"h-5 w-5","aria-hidden":!0})}
1),(0,s.jsx)("h2",{ref:eg,tabIndex:-1,className:"mb-0.5 text-lg font-bold sm:text-xl ".concat(eC),style:{fontFamily:"Rajdhani, sans-serif"},children:"Education"}),(0,s.jsx)("p",{className:"mx-auto mt-1 max-w-md text-xs sm:text-sm ".concat(ek),children:"Degrees and programs."})]}),(0,s.jsxs)("div",{className:"space-y-3 sm:space-y-4",children:[eT.education.map((e,t)=>{var r,i,n;let o=ep&&!(null===(r=e.institution)||void 0===r?void 0:r.trim()),c=ep&&!(null===(i=e.degree)||void 0===i?void 0:i.trim()),d=o||c;return(0,s.jsxs)("div",{className:"rounded-xl border p-4 ".concat(eS," ").concat(d?"border-red-500/50":""),children:[(0,s.jsxs)("div",{className:"mb-3 flex items-start justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("h3",{className:"text-sm font-bold sm:text-base ".concat(eC),children:["School #",t+1]}),d&&(0,s.jsxs)("span",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,s.jsx)(b.Z,{className:"w-3 h-3"})," Missing required fields"]})]}),(0,s.jsx)(l.E.button,{onClick:()=>eU(e.id),whileHover:{scale:1.1},whileTap:{scale:.9},className:"text-red-400 hover:text-red-300 p-1",children:(0,s.jsx)(y.Z,{className:"w-4 h-4"})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-x-4 gap-y-3 md:grid-cols-2",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"text-xs font-semibold sm:text-sm ".concat(ew),children:["Institution ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(v.II,{type:"text",size:"sm",value:e.institution,onChange:t=>eH(e.id,"institution",t.target.value),placeholder:"Stanford University",className:o?"border-red-500 border-2":""}),o&&(0,s.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,s.jsx)(b.Z,{className:"w-3 h-3"})," Institution is required"]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"text-xs font-semibold sm:text-sm ".concat(ew),children:["Degree ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(v.II,{type:"text",size:"sm",value:e.degree,onChange:t=>eH(e.id,"degree",t.target.value),placeholder:"Bachelor of Science",className:c?"border-red-500 border-2":""}),c&&(0,s.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,s.jsx)(b.Z,{className:"w-3 h-3"})," Degree is required"]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"text-xs font-semibold sm:text-sm ".concat(ew),children:"Field of Study"}),(0,s.jsx)(v.II,{type:"text",size:"sm",value:e.field,onChange:t=>eH(e.id,"field",t.target.value),placeholder:"Computer Science"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"text-xs font-semibold sm:text-sm ".concat(ew),children:"GPA (Optional)"}),(0,s.jsx)(v.II,{type:"text",size:"sm",value:null!==(n=e.gpa)&&void 0!==n?n:"",onChange:t=>eH(e.id,"gpa",t.target.value),placeholder:"3.8/4.0"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"text-xs font-semibold sm:text-sm flex items-center justify-between ".concat(ew),children:[(0,s.jsx)("span",{children:"Start Date"}),e.startDate&&(0,s.jsx)("span",{className:"text-xs font-normal text-blue-400",children:(()=>{try{let{parseYearMonthToLocalDate:t,formatMonthYearLocal:s}=a(99617),r=t(e.startDate);return r?s(r):""}catch(t){return e.startDate}})()})]}),(0,s.jsx)("div",{className:"relative",children:(0,s.jsx)(g.Z,{value:e.startDate,onChange:t=>eH(e.id,"startDate",t),disabled:!1,className:"w-full ".concat(eD)})})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"text-xs font-semibold sm:text-sm flex items-center justify-between ".concat(ew),children:[(0,s.jsx)("span",{children:"End Date"}),e.endDate&&(0,s.jsx)("span",{className:"text-xs font-normal text-blue-400",children:(()=>{try{let{parseYearMonthToLocalDate:t,formatMonthYearLocal:s}=a(99617),r=t(e.endDate);return r?s(r):""}catch(t){return e.endDate}})()})]}),(0,s.jsx)("div",{className:"relative",children:(0,s.jsx)(g.Z,{value:e.endDate,onChange:t=>eH(e.id,"endDate",t),disabled:!1,className:"w-full ".concat(eD)})})]})]})]},e.id)}),(0,s.jsxs)(l.E.button,{onClick:()=>
1{let e={id:Date.now().toString(),institution:"",degree:"",field:"",startDate:"",endDate:"",gpa:""};eM(t=>({...t,education:[...t.education,e]}))},whileHover:{scale:1.01},whileTap:{scale:.99},className:"w-full border-2 border-dashed hover:border-blue-500 rounded-xl py-3.5 px-4 flex items-center justify-center gap-2 text-sm hover:text-blue-400 transition-colors ".concat("dark"===N?"border-[#343536] text-[#818384]":"border-gray-300 text-gray-500"),children:[(0,s.jsx)(D.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Add Education"})]})]})]}),3===_&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"mb-3 text-center sm:mb-4",children:[(0,s.jsx)("div",{className:"mx-auto mb-2 flex h-10 w-10 items-center justify-center rounded-xl ring-1 ring-[var(--color-border)] ".concat("dark"===N?"bg-blue-500/15 text-blue-400":"bg-blue-500/12 text-blue-600"),children:(0,s.jsx)(Z.Z,{className:"h-5 w-5","aria-hidden":!0})}),(0,s.jsx)("h2",{ref:eb,tabIndex:-1,className:"text-lg font-bold sm:text-xl ".concat(eC),style:{fontFamily:"Rajdhani, sans-serif"},children:"Skills & Certifications"}),(0,s.jsx)("p",{className:"mx-auto mt-1 max-w-md text-xs sm:text-sm ".concat(ek),children:"Add your technical skills and professional certifications"})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("h3",{className:"text-sm font-bold sm:text-base ".concat(eC),children:"Technical Skills"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:eT.skills.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-1.5 rounded-lg border border-blue-500/20 bg-blue-500/10 px-2 py-1",children:[(0,s.jsx)("span",{className:"text-xs font-medium text-blue-600 dark:text-blue-300",children:e}),(0,s.jsx)(l.E.button,{onClick:()=>eG(e),whileHover:{scale:1.1},whileTap:{scale:.9},className:"text-blue-400 hover:text-red-400",children:(0,s.jsx)(y.Z,{className:"w-3 h-3"})})]},t))}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",placeholder:"e.g. React, Python",onKeyPress:e=>{if("Enter"===e.key){e.preventDefault();let t=e.target;eK(t.value),t.value=""}},className:"h-10 min-h-[40px] flex-1 rounded-lg border-2 px-3 text-sm outline-none transition-colors focus:border-[#0079D3] focus:ring-4 focus:ring-[#0079D3]/20 ".concat(eD)}),(0,s.jsx)(l.E.button,{whileHover:{scale:1.01},whileTap:{scale:.99},onClick:e=>{let t=e.target.previousElementSibling;eK(t.value),t.value=""},className:"h-10 shrink-0 rounded-lg bg-blue-500 px-3 text-xs font-bold text-white transition-colors hover:bg-blue-600 sm:px-4 sm:text-sm",children:"Add"})]})]})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("h3",{className:"text-sm font-bold sm:text-base ".concat(eC),children:"Certifications"}),(0,s.jsxs)("div",{className:"space-y-3",children:[eT.certifications.map((e,t)=>(0,s.jsx)(k,{cert:e,index:t,theme:N,labelClass:ew,inputClass:eD,headingClass:eC,subTextClass:ek,cardClass:eS,updateCertification:e1,removeCertification:e2,initialExpanded:eo===e.id,showValidation:ep},e.id)),(0,s.jsxs)(l.E.button,{onClick:()=>{let e={id:Date.now().toString(),name:"",issuer:"",date:"",expiryDate:"",credentialId:""};eM(t=>({...t,certifications:[...t.certifications,e]})),ec(e.id)},whileHover:{scale:1.01},whileTap:{scale:.99},className:"w-full rounded-xl border-2 border-dashed py-3.5 px-4 flex items-center justify-center gap-2 text-sm hover:border-blue-500 hover:text-blue-400 transition-colors ".concat("dark"===N?"border-[#343536] text-[#818384]":"border-gray-300 text-gray-500"),children:[(0,s.jsx)(D.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Add Certification"})]})]})]})]}),(0,s.jsxs)("div",{className:"mt-6 hidden items-center justify-between border-t pt-4 md:flex",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[_>0&&(0,s.jsx)(v.zx,{onClick:e8,disabled:H,size:"xs",variant:"ghost",className:"flex items-center gap-1 font-semibold",icon:M.Z,children:(0,s.jsx)("span",{children:"Previous"})}),(0,s.jsx)(v.zx,{onClick:e4,disabled:K,size:"xs",variant:"outline",className:"".concat(K?"cursor-wait opacity-60":""),children:(0,s.jsx)("span",{children:K?"Saving…":"Save Draft"})})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(v.zx,{onClick:e4,disabled:K,size:"xs",variant:"success",className:K?"cursor-wait opacity-60":"",children:K?"Saving…":"Save"}),(0,s.jsx)(v.zx,{onClick:e5,disabled:H,size:"xs",variant:"primary",children:_===eW.length-1?"Complete Setup":"Next"})]})]}),(0,s.jsx)(L.Z,{density:"compact",actions:[..._>0?[{icon:M.Z,label:"Previous",onClick:e8,variant:"outline",disabled:H}]:[],{icon:_===eW.length-1?z.Z:Y.Z,label:H?"Saving...":_===eW.length-1?"Complete Setup":"Next Step",onClick:e5,variant:"primary",disabled:H}],className:"mt-8 pt-6 border-t border-[#343536]"})]},_)})]}),ee&&(0,s.jsx)(V,{onResumeData:e$,onClose:()=>et(!1)}),eI&&(0,s.jsxs)("div",{className:"fixed right-6 bottom-24 z-50 flex flex-col gap-2",children:[eZ&&(0,s.jsx)(l.E.button,{initial:{opacity:0,scale:.8}
1,animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},whileHover:{scale:1.1},whileTap:{scale:.9},onClick:()=>{window.scrollTo({top:0,behavior:"smooth"})},className:"group bg-gradient-to-br from-blue-500 to-[#E03D00] hover:bg-[#E03D00] text-white p-3 rounded-full shadow-lg hover:shadow-xl transition-all ",title:"Scroll to top",children:(0,s.jsx)(q.Z,{className:"w-5 h-5"})}),eP&&(0,s.jsx)(l.E.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},whileHover:{scale:1.1},whileTap:{scale:.9},onClick:()=>{window.scrollTo({top:document.documentElement.scrollHeight,behavior:"smooth"})},className:"group bg-gradient-to-br from-[#FF4500] to-[#E03D00] hover:bg-[#E03D00] text-white p-3 rounded-full shadow-lg hover:shadow-xl transition-all ",title:"Scroll to bottom",children:(0,s.jsx)(O.Z,{className:"w-5 h-5"})})]})]})}},37666:function(e,t,a){"use strict";var s=a(67294),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=s.useSyncExternalStore,n=s.useRef,l=s.useEffect,o=s.useMemo,c=s.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,a,s,d){var u=n(null);if(null===u.current){var m={hasValue:!1,value:null};u.current=m}else m=u.current;var x=i(e,(u=o(function(){function e(e){if(!l){if(l=!0,i=e,e=s(e),void 0!==d&&m.hasValue){var t=m.value;if(d(t,e))return n=t}return n=e}if(t=n,r(i,e))return t;var a=s(e);return void 0!==d&&d(t,a)?(i=e,t):(i=e,n=a)}var i,n,l=!1,o=void 0===a?null:a;return[function(){return e(t())},null===o?void 0:function(){return e(o())}]},[t,a,s,d]))[0],u[1]);return l(function(){m.hasValue=!0,m.value=x},[x]),c(x),x}},31103:function(e,t,a){"use strict";e.exports=a(37666)}},function(e){e.O(0,[5062,4968,1296,63,7100,5412,9793,2888,9774,179],function(){return e(e.s=65101)}),_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.