1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/aiService-DZp17crU.js","assets/index-BrUeZY9m.js","assets/react-vendor-BbMijpWK.js","assets/firebase-vendor-BW4_ZEqj.js","assets/index-fL7kpy3-.css"])))=>i.map(i=>d[i]); 2import{u as e,y as t,k as a,b as n,z as i,_ as r,e as l,A as s,B as o,C as d,D as c,E as m,q as u,G as p,o as h,P as g,F as x}from"./index-BrUeZY9m.js";import{r as f,a as y,j as b,h as v,u as j,f as w,e as k}from"./react-vendor-BbMijpWK.js";import{d as N,f as S,s as P}from"./firebase-vendor-BW4_ZEqj.js";import{C as E}from"./CreditModal-CVnOwxoB.js";import{D as I}from"./DownloadModal-ClJSRy95.js";function D({title:e,titleId:t,...a},n){return f.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},a),e?f.createElement("title",{id:t},e):null,f.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const A=f.forwardRef(D);function C({title:e,titleId:t,...a},n){return f.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},a),e?f.createElement("title",{id:t},e):null,f.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"}))}const T=f.forwardRef(C);function z({title:e,titleId:t,...a},n){return f.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},a),e?f.createElement("title",{id:t},e):null,f.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M2
20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"}))}const L=f.forwardRef(z);function R({title:e,titleId:t,...a},n){return f.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},a),e?f.createElement("title",{id:t},e):null,f.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m.75 12 3 3m0 0 3-3m-3 3v-6m-1.5-9H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const F=f.forwardRef(R);function O({title:e,titleId:t,...a},n){return f.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},a),e?f.createElement("title",{id:t},e):null,f.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM13.5 10.5h-6"}))}const M=f.forwardRef(O);function $({title:e,titleId:t,...a},n){return f.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},a),e?f.createElement("title",{id:t},e):null,f.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM10.5 7.5v6m3-3h-6"}))}const B=f.forwardRef($),U=Object.freeze(["en","tr"]),_=e=>U.includes(e)?e:"en",Y=Object.freeze({company:"",position:"",location:"",startDate:"",endDate:"",description:"",achievements:""}),H=Object.freeze({institution:"",degree:"",fieldOfStudy:"",startDate:"",endDate:"",description:""}),K=Object.freeze({name:"",description:"",technologies:[""],githubUrl:"",liveUrl:"",startDate:"",endDate:"",achievements:""}),W=Object.freeze({personalInfo:Object.freeze({fullName:"",title:"",email:"",phone:"",address:"",summary:"",linkedin:"",github:""}),experience:Object.freeze([Y]),education:Object.freeze([H]),skills:Object.freeze([""]),languages:Object.freeze([""]),certifications:Object.freeze([""]),projects:Object.freeze([K]),jobDescription:"",resumeLanguage:"en"}),V=e=>{const t=JSON.parse(JSON.stringify(W));return t.resumeLanguage=_(e),t},G=e=>{const t=V();if(!e||"object"!=typeof e)return t;const a=(e,t)=>Array.isArray(e)&&e.length>0?e:t;return{...t,...e,personalInfo:{...t.personalInfo,...e.personalInfo||{}},experience:a(e.experience,t.experience),education:a(e.education,t.education),skills:a(e.skills,t.skills),languages:a(e.languages,t.languages),certifications:a(e.certifications,t.certifications),projects:a(e.projects,t.projects),jobDescription:e.jobDescription||"",resumeLanguage:_(e.resumeLanguage)}},J=(e=[])=>{const t=e=>{if(!e)return null;const t=String(e).trim();if(/^(present|halen)$/i.test(t))return new Date;const a=t.match(/^(\d{1,2})\/(\d{4})$/);if(a){const e=Math.min(Math.max(parseInt(a[1],10),1),12);return new Date(parseInt(a[2],10),e-1,1)}const n=t.match(/^(\d{4})$/);return n?new Date(parseInt(n[1],10),0,1):null},a=e.reduce((e,a)=>{const n=t(a?.startDate),i=t(a?.endDate)||null;if(!n||!i)return e;const r=12*(i.getFullYear()-n.getFullYear())+(i.getMonth()-n.getMonth());return e+Math.max(0,r)},0);return Math.max(0,Math.round(a/12))},q={en:{pageTitle:"Build Your Resume",resumeLanguageLabel:"Resume language",resumeLanguageHint:"Headings and AI-written text on your resume use this language.",resumeLanguageEn:"English",resumeLanguageTr:"Turkish",guestBannerPrefix:"Youâre building as a guest.",guestBannerLink:"Sign in to save it to your account",guestBannerSuffix:".",sectionPersonal:"Personal Information",sectionExperience:"Work Experience",sectionEducation:"Education",sectionSkills:"Skills",sectionLanguages:"Languages",sectionCertifications:"Certifications",sectionProjects:"Projects",sectionOptimize:"Job Description Optimization (Optional)",aiAssist:"AI Assist",generating:"Generating...",datePlaceholder:"MM/YYYY",fullName:"Full Name *",fullNamePlaceholder:"John Doe",jobTitle:"Job Title",jobTitlePlaceholder:"Software Engineer",email:"Email *",emailPlaceholder:"[email protected]",phone:"Phone",phonePlaceholder:"+1 (555) 123-4567",linkedin:"LinkedIn",linkedinPlaceholder:"https://linkedin.com/in/username",github:"GitHub",githubPlaceholder:"https://github.com/username",location:"Location",locationPlaceholder:"City, State",summary:"Professional Summary",summaryPlaceholder:"Write a brief summary of your professional background and ke
2y strengths...",position:"Job Title *",positionPlaceholder:"Software Engineer",company:"Company *",companyPlaceholder:"Acme Inc.",experienceLocationPlaceholder:"New York, NY",startDate:"Start Date",endDate:"End Date",currentlyWorking:"Currently Working Here",description:"Description",experienceDescriptionPlaceholder:"Describe your responsibilities, achievements, and impact...",addExperience:"+ Add Another Experience",removeExperience:"Remove experience",institution:"Institution *",institutionPlaceholder:"University of Example",degree:"Degree *",degreePlaceholder:"Bachelor of Science",fieldOfStudy:"Field of Study",fieldOfStudyPlaceholder:"Computer Science",educationDescriptionPlaceholder:"Describe your academic achievements, relevant coursework, etc.",addEducation:"+ Add Another Education",removeEducation:"Remove education",skillsLabel:"Skills",skillsHint:"Add skills relevant to the job youâre applying for.",skillPlaceholder:"e.g. JavaScript, Project Management, Customer Service",addSkill:"+ Add Another Skill",removeSkill:"Remove skill",languagePlaceholder:"e.g. English (Fluent), Spanish (Intermediate)",addLanguage:"+ Add Another Language",removeLanguage:"Remove language",certificationPlaceholder:"e.g. AWS Certified Solutions Architect, Google Analytics Certification",addCertification:"+ Add Another Certification",removeCertification:"Remove certification",projectName:"Project Name *",projectNamePlaceholder:"E-commerce Platform",technologies:"Technologies",technologyPlaceholder:"React, Node.js, MongoDB",addTechnology:"+ Add Technology",removeTechnology:"Remove technology",projectDescription:"Description *",projectDescriptionPlaceholder:"Describe your project, key features, and technologies used...",githubUrl:"GitHub URL",githubUrlPlaceholder:"https://github.com/username/project",liveUrl:"Live URL",liveUrlPlaceholder:"https://project-demo.com",projectStartPlaceholder:"2023",projectEndPlaceholder:"2024 or Present",achievements:"Key Achievements",achievementsPlaceholder:"Increased conversion rate by 25%, handled 10k+ daily users...",removeProject:"Remove",removeProjectLabel:"Remove project",addProject:"+ Add Another Project",optimizeIntro:"Tailor your resume to match the job requirements. Paste the job description below and use AI Assist for suggestions.",jobDescription:"Job Description",jobDescriptionPlaceholder:"Paste job description here...",guestCredits:"Sign in to use AI Assist (5 free credits) and to download your PDF.",creditsLoading:"Loading AI creditsâ¦",creditsRemaining_one:"You have {count} AI credit remaining.",creditsRemaining_other:"You have {count} AI credits remaining.",downloadsLoading:"Loading download rightsâ¦",downloadsUnlimited:"Unlimited downloads with your subscription.",downloadsRemaining_one:"You have {count} download remaining.",downloadsRemaining_other:"You have {count} downloads remaining.",viewSwitchLabel:"Editor view",viewEdit:"Edit",viewPreview:"Preview",phoneInvalid:"Phone number can only contain numbers, +, -, parentheses and spaces",monthInvalid:"Month value must be between 01-12",dateIncomplete:"Use the MM/YYYY format, for example 05/2021.",signInForAI:"Sign in to use AI (5 free credits)",signInToSave:"Sign in to save your resume",signInToDownload:"Sign in to download",resumeImported:"Resume imported.",guestDraftAdopted:"Your guest draft was saved to your account.",rateLimited:"Too many requests right now. Please wait a moment and try again.",aiTimeout:"The AI request took too long. Please try again.",aiNetwork:"Unable to reach the AI service. Please check your connection and try again.",summaryEmpty:"The AI didnât return a summary. Please try again.",summaryFailed:"Failed to generate summary. Please try again.",bulletsEmpty:"The AI didnât return any bullet points. Please try again.",bulletsFailed:"Failed to generate bullet points. Please try again.",skillsNeedTitle:"Please enter your job title first to generate relevant skills",skillsNeedExisting:"Please add some existing skills first to generate relevant suggestions",skillEmpty:"Unable to generate a skill suggestion. Please try again or add skills manually.",skillDuplicate:"â{skill}â is already in your skills list",skillFailed:"Failed to generate skill suggestion. Please try again.",educationGenerated:"Education description enhanced.",educationEmpty:"The AI didnât return a description. Please try again.",educationFailed:"Failed to generate education description. Please try again.",projectNeedName:"Please enter a project name first to generate a description",projectNeedTech:"Please add some technologies first to generate a relevant description",projectGenerated:"Project description generated.",projectEmpty:"Unable to generate project description. Please try again.",projectFailed:"Failed to generate project description. Please try again.",tailorNeedJob:"Please paste a job description first",tailorEmpty:"The AI didnât return anything to apply. Please try again.",tailorUnparsable:"The AI response couldnât be applied to your resume. Nothing was changed.",tailorChangeSummary:"your professional summary",tailorChangeExperience_one:"{count} work experience description",tailorChangeExperience_other:"{count} work experience descriptions",tailorChangeSkills:"your skills list",tailorConfirm:"Apply the tailored version? This will replace {changes}.\n\nThis cannot be undone.",tailorPartial:"Applied the summary and skills. Your job descriptions were left untouched because the AI response could not be matched to individual jobs.",tailorDone:"Resume tailored to the job description.",tailorFailed:"Failed to optimize resume. Please try again.",validationNameEmail:"Please fill in your name and email",validationContent:"Add at least one work experience, education entry or project",dbUnavailable:"Database not available. Please try again later.",resumeSaved:"Resume saved.",saveFailed:"We couldnât save your resume. Please check your connection and try again.",previewLoading:"The preview is still loading. Please try again in a moment.",pdfPreparing:"Preparing your PDFâ¦",pdfDone:"PDF downloaded.",pdfRateLimited:"Too many download requests. Please wait a moment and try again.",pdfFailed:"We couldnât generate your PDF right now. Please try again in a few minutes.",untitledResume:"Untitled resume",fileNameFallback:"Resume",preview:{region:"Resume preview",structureScore:"Structure score",atsMatch:"ATS match",headerNote:"A readability and structure check, not an actual ATS score. Every ATS parses differently.",zoomOut:"Zoom out",zoomIn:"Zoom in",save:"Save resume",download:"Download PDF",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",placeholderName:"Your name",placeholderTitle:"Your title",panelDescMatch:"How closely
2your resume matches the job description you pasted, plus how cleanly it parses.",panelDescStructure:"How completely and cleanly your resume is structured. Paste a job description to see a match score too.",tooltipMatch:"How well your resume matches the job description you pasted, and how cleanly it parses.",tooltipStructure:"How complete and cleanly structured your resume is. Paste a job description for a match score.",rowSections:"Sections found",rowLayout:"Layout safety",rowTextExtraction:"Text extraction",rowContact:"Contact details",rowKeywords:"Keyword coverage",rowSkills:"Skills match",rowTitle:"Title fit",rowRecent:"Recent work",lowWithoutJob:"Keyword, skills and title scores stay low until you paste a job description.",levelStrongTitle:"Strong",levelStrongText:"The main sections and contact details are in place. Read the wording once more before you apply.",levelGoodTitle:"Mostly complete",levelGoodText:"A few parts are thin. The rows above show which ones.",levelFairTitle:"Needs work",levelFairText:"Several sections are missing or short. Fill them in before you apply.",levelPoorTitle:"Incomplete",levelPoorText:"Key sections are missing. Start with contact details, work experience and skills.",runAnalysis:"Run AI analysis (1 AI credit)",analysing:"Analysingâ¦",creditsHave_one:"You have {count} AI credit.",creditsHave_other:"You have {count} AI credits.",creditsOut:"You are out of AI credits. You can buy more on the pricing page.",getCredits:"Get AI credits",analysisComplete:"AI analysis complete",analysisError:"Analysis error",tryAgain:"Try again",errSignIn:"Please sign in to run the AI analysis.",errNoCredits:"You are out of AI credits.",errRateLimited:"Too many requests. Please wait a moment and try again.",errFailed:"The AI analysis failed and your credit was refunded. Please try again.",errFailedToast:"The AI analysis failed and your credit was refunded.",aiAnalysis:"AI analysis",strengths:"Strengths",weaknesses:"Areas to improve",recommendations:"Recommendations"}},tr:{pageTitle:"CVânizi oluÅturun",resumeLanguageLabel:"CV dili",resumeLanguageHint:"CVânizdeki baÅlıklar ve AIâın yazdıÄı metinler bu dilde olur.",resumeLanguageEn:"İngilizce",resumeLanguageTr:"Türkçe",guestBannerPrefix:"Misafir olarak çalıÅıyorsunuz.",guestBannerLink:"Hesabınıza kaydetmek için giriÅ yapın",guestBannerSuffix:".",sectionPersonal:"KiÅisel bilgiler",sectionExperience:"İŠdeneyimi",sectionEducation:"EÄitim",sectionSkills:"Beceriler",sectionLanguages:"Diller",sectionCertifications:"Sertifikalar",sectionProjects:"Projeler",sectionOptimize:"İŠilanına göre uyarlama (isteÄe baÄlı)",aiAssist:"AI ile yaz",generating:"Yazılıyor...",datePlaceholder:"AA/YYYY",fullName:"Ad soyad *",fullNamePlaceholder:"AyÅe Yılmaz",jobTitle:"Unvan",jobTitlePlaceholder:"Yazılım Mühendisi",email:"E-posta *",emailPlaceholder:"[email protected]",phone:"Telefon",phonePlaceholder:"+90 532 123 45 67",linkedin:"LinkedIn",linkedinPlaceholder:"https://linkedin.com/in/kullaniciadi",github:"GitHub",githubPlaceholder:"https://github.com/kullaniciadi",location:"Konum",locationPlaceholder:"İstanbul, Türkiye",summary:"Profesyonel özet",summaryPlaceholder:"Mesleki geçmiÅinizi ve güçlü yönlerinizi birkaç cümleyle özetleyin...",position:"Pozisyon *",positionPlaceholder:"Yazılım Mühendisi",company:"Åirket *",companyPlaceholder:"Ãrnek A.Å.",experienceLocationPlaceholder:"İstanbul",startDate:"BaÅlangıç tarihi",endDate:"BitiÅ tarihi",currentlyWorking:"Hâlâ burada çalıÅıyorum",description:"Açıklama",experienceDescriptionPlaceholder:"Sorumluluklarınızı, baÅarılarınızı ve katkınızı yazın...",addExperience:"+ Deneyim ekle",removeExperience:"Deneyimi kaldır",institution:"Okul *",institutionPlaceholder:"Ãrnek Ãniversitesi",degree:"Derece *",degreePlaceholder:"Lisans",fieldOfStudy:"Bölüm",fieldOfStudyPlaceholder:"Bilgisayar MühendisliÄi",educationDescriptionPlaceholder:"Akademik baÅarılarınızı, ilgili dersleri vb. yazın.",addEducation:"+ EÄitim ekle",removeEducation:"EÄitimi kaldır",skillsLabel:"Beceriler",skillsHint:"BaÅvurduÄunuz iÅle ilgili becerileri ekleyin.",skillPlaceholder:"ör. JavaScript, Proje yönetimi, MüÅteri iliÅkileri",addSkill:"+ Beceri ekle",removeSkill:"Beceriyi kaldır",languagePlaceholder:"ör. İngilizce (İleri), Almanca (Orta)",addLanguage:"+ Dil ekle",removeLanguage:"Dili kaldır",certificationPlaceholder:"ör. AWS Certified Solutions Architect, PMP",addCertification:"+ Sertifika ekle",removeCertification:"Sertifikayı kaldır",projectName:"Proje adı *",projectNamePlaceholder:"E-ticaret platformu",technologies:"Teknolojiler",technologyPlaceholder:"React, Node.js, MongoDB",addTechnology:"+ Teknoloji ekle",removeTechnology:"Teknolojiyi kaldır",projectDescription:"Açıklama *",projectDescriptionPlaceholder:"Projeyi, temel özelliklerini ve kullandıÄınız teknolojileri yazın...",githubUrl:"GitHub adresi",githubUrlPlaceholder:"https://github.com/kullaniciadi/proje",liveUrl:"Canlı demo adresi",liveUrlPlaceholder:"https://proje-demo.com",projectStartPlaceholder:"2023",projectEndPlaceholder:"2024 veya Halen",achievements:"Ãne çıkan baÅarılar",achievementsPlaceholder:"DönüÅüm oranını %25 artırdı, günde 10.000+ kullanıcıya hizmet verdi...",removeProject:"Kaldır",removeProjectLabel:"Projeyi kaldır",addProject:"+ Proje ekle",optimizeIntro:"CVânizi ilandaki gereksinimlere göre uyarlayın. İŠilanını aÅaÄıya yapıÅtırın, ardından öneriler için âAI ile yazâ düÄmesini kullanın.",jobDescription:"İŠilanı",jobDescriptionPlaceholder:"İŠilanını buraya yapıÅtırın...",guestCredits:"AI özelliklerini kullanmak (5 ücretsiz AI kredisi) ve PDF indirmek için giriÅ yapın.",creditsLoading:"AI kredileriniz yükleniyorâ¦",creditsRemaining_one:"Kalan AI krediniz: {count}",creditsRemaining_other:"Kalan AI krediniz: {count}",downloadsLoading:"İndirme haklarınız yükleniyorâ¦",downloadsUnlimited:"AboneliÄinizle sınırsız PDF indirebilirsiniz.",downloadsRemaining_one:"Kalan PDF indirme hakkınız: {count}",downloadsRemaining_other:"Kalan PDF indirme hakkınız: {count}",viewSwitchLabel:"Görünüm",viewEdit:"Düzenle",viewPreview:"Ãnizleme",phoneInvalid:"Telefon numarası yalnızca rakam, +, -, parantez ve boÅluk içerebilir.",monthInvalid:"Ay 01 ile 12 arasında olmalıdır.",dateIncomplete:"AA/YYYY biçimini kullanın, örneÄin 05/2021.",signInForAI:"AI özelliklerini kullanmak için giriÅ yapın (5 ücretsiz AI kredisi)",signInToSave:"CVânizi kaydetmek için giriÅ yapın",signInToDownload:"PDF indirmek için giriÅ yapın",resumeImported:"CV içe aktarıldı.",guestDraftAdopted:"Misafir olarak hazırladıÄınız taslak hesabınıza kaydedildi.",rateLimited:"Åu anda çok fazla istek var. Biraz bekleyip tekrar deneyin.",aiTimeout:"AI isteÄi çok uzun sürdü. Lütfen tekrar deneyin.",aiNetwork:"AI hizmetine ulaÅılamıyor. BaÄlantınızı kontrol edip tekrar deneyin.",summaryEmpty:"AI bir özet döndürmedi. Lütfen tekrar deneyin.",summaryFailed:"Ãzet yazılamadı. Lütfen tekrar deneyin.",bulletsEmpty:"AI hiç madde döndürmedi. Lütfen tekrar deneyin.",bulletsFailed:"Maddeler yazılamadı. Lütfen tekrar deneyin.",skillsNeedTitle:"İlgili beceriler önerebilmemiz için önce unvanınızı girin.",skillsNeedExisting:"Ãneri alabilmek için önce birkaç beceri ekleyin.",skillEmpty:"Beceri önerisi oluÅturulamadı. Tekrar deneyin ya da beceriyi kendiniz ekleyin.",skillDuplicate:"â{skill}â zaten beceri listenizde.",skillFailed:"Beceri önerisi oluÅturulamadı. Lütfen tekrar deneyin.",educationGenerated:"EÄitim açıklaması güncellendi.",educationEmpty:"AI bir açıklama döndürmedi. Lütfen tekrar deneyin.",educationFailed:"EÄitim açıklaması yazılamadı. Lütfen tekrar deneyin.",projectNeedName:"Açıklama yazabilmek için önce proje adını girin.",projectNeedTech:"Açıklama yazabilmek için önce kullandıÄınız teknolojileri ekleyin.",projectGenerated:"Proje açıklaması yazıldı.",projectEmpty:"Proje açıklaması yazılamadı. Lütfen tekrar deneyin.",projectFailed:"Proje açıklaması yazılamadı. Lütfen tekrar deneyin.",tailorNeedJob:"Ãnce iÅ ilanını yapıÅtırın.",tailorEmpty:"AI uygulanabilecek bir sonuç döndürmedi. Lütfen tekrar deneyin.",tailorUnparsable:"AI yanıtı CVânize uygulanamadı. Hiçbir Åey deÄiÅtirilmedi.",tailorChangeSummary:"profesyonel özetiniz",tailorChangeExperience_one:"{count} iÅ deneyimi açıklaması",tailorChangeExperience_other:"{count} iÅ deneyimi açıklaması",tailorChangeSkills:"beceri listeniz",tailorConfirm:"UyarlanmıŠsürüm uygulansın mı? Åunların yerine yenisi yazılacak: {changes}.\n\nBu iÅlem geri alınamaz.",tailorPartial:"Ãzet ve beceriler uygulandı. AI yanıtı tek tek iÅlerle eÅleÅtirilemediÄi
2için iÅ açıklamalarınıza dokunulmadı.",tailorDone:"CVâniz iÅ ilanına göre uyarlandı.",tailorFailed:"CV uyarlanamadı. Lütfen tekrar deneyin.",validationNameEmail:"Lütfen adınızı ve e-posta adresinizi girin.",validationContent:"En az bir iÅ deneyimi, eÄitim bilgisi ya da proje ekleyin.",dbUnavailable:"Kayıt hizmetine Åu anda ulaÅılamıyor. Lütfen daha sonra tekrar deneyin.",resumeSaved:"CV kaydedildi.",saveFailed:"CVâniz kaydedilemedi. BaÄlantınızı kontrol edip tekrar deneyin.",previewLoading:"Ãnizleme hâlâ yükleniyor. Birazdan tekrar deneyin.",pdfPreparing:"PDFâiniz hazırlanıyorâ¦",pdfDone:"PDF indirildi.",pdfRateLimited:"Ãok fazla indirme isteÄi gönderildi. Biraz bekleyip tekrar deneyin.",pdfFailed:"PDFâiniz Åu anda oluÅturulamadı. Birkaç dakika sonra tekrar deneyin.",untitledResume:"Adsız CV",fileNameFallback:"CV",preview:{region:"CV önizlemesi",structureScore:"Yapı puanı",atsMatch:"ATS uyumu",headerNote:"Okunabilirlik ve yapı kontrolüdür, gerçek bir ATS puanı deÄildir. Her ATS CVâleri farklı okur.",zoomOut:"UzaklaÅtır",zoomIn:"YakınlaÅtır",save:"CVâyi kaydet",download:"PDF indir",enterFullscreen:"Tam ekran",exitFullscreen:"Tam ekrandan çık",placeholderName:"Adınız soyadınız",placeholderTitle:"Unvanınız",panelDescMatch:"CVânizin yapıÅtırdıÄınız iÅ ilanıyla ne kadar örtüÅtüÄünü ve ne kadar düzgün okunduÄunu gösterir.",panelDescStructure:"CVânizin ne kadar eksiksiz ve düzenli olduÄunu gösterir. Uyum puanını da görmek için bir iÅ ilanı yapıÅtırın.",tooltipMatch:"CVânizin yapıÅtırdıÄınız iÅ ilanıyla ne kadar örtüÅtüÄü ve ne kadar düzgün okunduÄu.",tooltipStructure:"CVânizin ne kadar eksiksiz ve düzenli olduÄu. Uyum puanı için bir iÅ ilanı yapıÅtırın.",rowSections:"Bulunan bölümler",rowLayout:"Düzen güvenliÄi",rowTextExtraction:"Metnin okunabilmesi",rowContact:"İletiÅim bilgileri",rowKeywords:"Anahtar kelime kapsamı",rowSkills:"Beceri uyumu",rowTitle:"Unvan uyumu",rowRecent:"Güncel deneyim",lowWithoutJob:"Bir iÅ ilanı yapıÅtırana kadar anahtar kelime, beceri ve unvan puanları düÅük kalır.",levelStrongTitle:"Güçlü",levelStrongText:"Ana bölümler ve iletiÅim bilgileri yerinde. BaÅvurmadan önce ifadeleri bir kez daha okuyun.",levelGoodTitle:"Büyük ölçüde tamam",levelGoodText:"Birkaç kısım zayıf. Hangileri olduÄunu yukarıdaki satırlarda görebilirsiniz.",levelFairTitle:"GeliÅtirilmeli",levelFairText:"Birkaç bölüm eksik ya da kısa. BaÅvurmadan önce tamamlayın.",levelPoorTitle:"Eksik",levelPoorText:"Temel bölümler eksik. İletiÅim bilgileri, iÅ deneyimi ve becerilerle baÅlayın.",runAnalysis:"AI analizi yap (1 AI kredisi)",analysing:"Analiz ediliyorâ¦",creditsHave_one:"Kalan AI krediniz: {count}",creditsHave_other:"Kalan AI krediniz: {count}",creditsOut:"AI krediniz kalmadı. Fiyatlandırma sayfasından AI kredisi alabilirsiniz.",getCredits:"AI kredisi al",analysisComplete:"AI analizi tamamlandı",analysisError:"Analiz hatası",tryAgain:"Tekrar deneyin",errSignIn:"AI analizi için lütfen giriÅ yapın.",errNoCredits:"AI krediniz kalmadı.",errRateLimited:"Ãok fazla istek var. Biraz bekleyip tekrar deneyin.",errFailed:"AI analizi baÅarısız oldu ve krediniz iade edildi. Lütfen tekrar deneyin.",errFailedToast:"AI analizi baÅarısız oldu ve krediniz iade edildi.",aiAnalysis:"AI analizi",strengths:"Güçlü yönler",weaknesses:"GeliÅtirilecek alanlar",recommendations:"Ãneriler"}}},Z=794,X=(e,t,a)=>((e,t={})=>String(e).replace(/\{(\w+)\}/g,(e,a)=>a in t?String(t[a]):e))(e[`${t}_${1===a?"one":"other"}`],{count:a}),Q="inline-flex items-center justify-center min-w-[44px] min-h-[44px] lg:min-w-0 lg:min-h-0 touch-manipulation",ee=f.forwardRef(({templateKey:o,templateId:d,templateName:c,templateColor:m,resumeData:u,width:p,height:h,atsScore:g,atsBreakdown:x,hasJobDescription:j=!1,isDownloading:w=!1,onDownload:k,onSave:N,isFullscreen:S=!1,onToggleFullscreen:P,autoHeight:E=!1},I)=>{const{lang:D,path:C}=e(),z=(q[D]||q.en).preview,R=y(),[O,$]=f.useState(null),[U,Y]=f.useState(!1),[H,K]=f.useState(!1),[W,V]=f.useState(null),[G,J]=f.useState(!1),[ee,te]=f.useState({x:0,y:0}),[ae,ne]=f.useState(100),[ie,re]=f.useState(0),[le,se]=f.useState(1123),{credits:oe,loading:de}=t(),{user:ce}=a(),me=f.useRef(null),ue=f.useRef(null);f.useImperativeHandle(I,()=>({getContainer:()=>me.current,getZoomLevel:()=>ae,setZoomLevel:e=>ne(e)})),f.useEffect(()=>{const e=ue.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=()=>{e.clientWidth>0&&re(e.clientWidth)};t();const a=new ResizeObserver(t);return a.observe(e),()=>a.disconnect()},[]),f.useEffect(()=>{const e=me.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=()=>
2se(Math.max(1123,e.scrollHeight));t();const a=new ResizeObserver(t);return a.observe(e),()=>a.disconnect()},[u,o]);const pe=S&&ie>0&&ie<1202,he=f.useMemo(()=>{if(!ie)return 1;const e=S?pe?24:48:16;return Math.max(.2,Math.min(1,(ie-e)/Z))},[ie,S,pe])*(ae/100),ge=f.useMemo(()=>n(o)||n(c)||n(d)||"professional",[o,c,d]),xe=s[ge]||s.professional,fe=f.useMemo(()=>i(ge),[ge]),ye=_(u?.resumeLanguage),be=f.useMemo(()=>u?{personalInfo:{fullName:u?.personalInfo?.fullName||"",title:u?.personalInfo?.title||"",email:u?.personalInfo?.email||"",phone:u?.personalInfo?.phone||"",address:u?.personalInfo?.address||"",summary:u?.personalInfo?.summary||"",linkedin:u?.personalInfo?.linkedin||"",github:u?.personalInfo?.github||""},skills:u?.skills?.filter(Boolean)||[],languages:u?.languages?.filter(Boolean)||[],certifications:u?.certifications?.filter(Boolean)||[],education:u?.education?.filter(e=>e.institution||e.degree)||[],experience:u?.experience?.filter(e=>e.company||e.position)||[],projects:u?.projects||[]}:{},[u]),ve=!be?.personalInfo?.fullName,je=!be?.personalInfo?.title,we=f.useCallback(()=>ne(e=>Math.min(e+25,200)),[]),ke=f.useCallback(()=>ne(e=>Math.max(e-25,50)),[]),Ne=f.useCallback(()=>ne(100),[]),Se=(e,t)=>{const a=t>0?e/t*100:0;return a>=60?{status:"good",dot:"bg-green-500"}:a>=40?{status:"warning",dot:"bg-yellow-500"}:{status:"poor",dot:"bg-red-500"}},Pe=f.useMemo(()=>{const e=(e,t)=>({score:Math.round(e||0),maxScore:t||0,status:Se(e||0,t||1)}),t=H&&W?.parse||x?.parse?.breakdown||{},a=H&&W?.relevance||x?.relevance?.breakdown||{};return{available:Boolean(x||H&&W),parse:{sectionStructure:e(t.sections?.points,t.sections?.maxPoints||20),formattingRisks:e(t.structural?.points,t.structural?.maxPoints||20),textExtraction:e(t.textExtraction?.points,t.textExtraction?.maxPoints||20),contactInfo:e(t.contact?.points,t.contact?.maxPoints||10),language:e(t.language?.points,t.language?.maxPoints||10)},relevance:{keywordCoverage:e(a.keywords?.points,a.keywords?.maxPoints||20),skillsMatch:e(a.skills?.points,a.skills?.maxPoints||20),titleFit:e(a.title?.points,a.title?.maxPoints||15),domainExperience:e(a.domain?.points,a.domain?.maxPoints||15),recentWork:e(a.recency?.points,a.recency?.maxPoints||10)}}},[x,W,H]),Ee=j?z.atsMatch:z.structureScore,Ie=g>=80?{box:"bg-green-50 border border-green-200",text:"text-green-800",title:z.levelStrongTitle,body:z.levelStrongText}:g>=60?{box:"bg-yellow-50 border border-yellow-200",text:"text-yellow-800",title:z.levelGoodTitle,body:z.levelGoodText}:g>=40?{box:"bg-orange-50 border border-orange-200",text:"text-orange-800",title:z.levelFairTitle,body:z.levelFairText}:{box:"bg-red-50 border border-red-200",text:"text-red-800",title:z.levelPoorTitle,body:z.levelPoorText},De=Boolean(ce)&&!de&&oe<=0,Ae=f.useCallback(async()=>{if(!U){Y(!0),$(null);try{const{analyzeCVForATS:e}=await r(async()=>{const{analyzeCVForATS:e}=await import("./aiService-DZp17crU.js");return{analyzeCVForATS:e}},__vite__mapDeps([0,1,2,3,4])),t=await e(u,u?.jobDescription||"",(e=>{if(!e)return"";const t=e.personalInfo||{},a=[],n=e=>{e&&String(e).trim()&&a.push(String(e).trim())};n(t.fullName),n(t.title),n([t.email,t.phone,t.address,t.linkedin,t.github].filter(Boolean).join(" | ")),t.summary&&a.push("","PROFESSIONAL SUMMARY",t.summary);const i=(e.experience||[]).filter(e=>e&&(e.company||e.position));i.length&&(a.push("","WORK EXPERIENCE"),i.forEach(e=>{n([e.position,e.company,e.location].filter(Boolean).join(" â ")),n([e.startDate,e.endDate].filter(Boolean).join(" - ")),n(e.description),n(e.achievements),a.push("")}));const r=(e.education||[]).filter(e=>e&&(e.institution||e.degree));r.length&&(a.push("","EDUCATION"),r.forEach(e=>{n([e.institution,e.degree,e.fieldOfStudy].filter(Boolean).join(" â ")),n([e.startDate,e.endDate].filter(Boolean).join(" - ")),n(e.description)}));const l=(e.skills||[]).filter(Boolean);l.length&&a.push("","SKILLS",l.join(", "));const s=(e.projects||[]).filter(e=>e&&e.name);s.length&&(a.push("","PROJECTS"),s.forEach(e=>{n(e.name),n((e.technologies||[]).filter(e=>e&&e.trim()).join(", ")),n(e.description),n(e.achievements)}));
2const o=(e.certifications||[]).filter(Boolean);o.length&&a.push("","CERTIFICATIONS",o.join(", "));const d=(e.languages||[]).filter(Boolean);return d.length&&a.push("","LANGUAGES",d.join(", ")),a.join("\n").trim()})(u),{lang:D});V(t||null),K(!0),l.success(z.analysisComplete)}catch(e){const t="AUTH_REQUIRED"===e?.code?z.errSignIn:"INSUFFICIENT_CREDITS"===e?.code?z.errNoCredits:"RATE_LIMIT"===e?.code?z.errRateLimited:z.errFailed;$(t),l.error(t===z.errFailed?z.errFailedToast:t)}finally{Y(!1)}}},[U,u,z,D]);f.useEffect(()=>{const e=e=>{S&&("Escape"===e.key||"F11"===e.key?(e.preventDefault(),P?.()):(e.ctrlKey||e.metaKey)&&("="===e.key||"+"===e.key?(e.preventDefault(),we()):"-"===e.key?(e.preventDefault(),ke()):"0"===e.key&&(e.preventDefault(),Ne())))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[S,P,we,ke,Ne]);const Ce=f.useMemo(()=>({wrapper:{width:p||"100%",height:E?"auto":h||"100%",backgroundColor:"#f8f9fa",border:"1px solid #e5e7eb",borderRadius:S?"0":"8px",overflow:"hidden",position:"relative",display:"flex",flexDirection:"column"},header:{display:"flex",flexWrap:"wrap",gap:"8px",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",backgroundColor:"#ffffff",borderBottom:"1px solid #e5e7eb",minHeight:"48px",flexShrink:0},content:E?{overflowX:"auto",overflowY:"hidden",backgroundColor:"#ffffff",position:"relative",display:"block"}:{flex:1,overflow:"auto",backgroundColor:S?"#f8f9fa":"#ffffff",position:"relative",display:S?"flex":"block",flexDirection:pe?"column":"row",alignItems:pe?"center":"flex-start"},scaleWrapper:{transform:`scale(${he})`,transformOrigin:"top left",width:Z*he+"px",height:le*he+"px",margin:S?pe?"16px auto":"20px":"8px auto",flexShrink:0},editorFrame:{boxShadow:S?"0 4px 6px -1px rgba(0, 0, 0, 0.1)":"0 1px 3px rgba(0,0,0,0.1)",border:"1px solid #e5e7eb",borderRadius:"4px",overflow:"hidden",backgroundColor:"#ffffff",width:"794px"},rightPanel:{flex:pe?"none":1,alignSelf:"stretch",backgroundColor:"#f8f9fa",margin:S?pe?"0 0 20px":"20px 20px 20px 0":"0",display:S?"block":"none",minWidth:0}}),[p,h,E,S,pe,he,le]);return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"enhanced-resume-preview-wrapper",style:Ce.wrapper,children:[b.jsxs("div",{className:"px-2 sm:px-4",style:Ce.header,children:[b.jsxs("div",{className:"flex items-center space-x-2 min-w-0",children:[S&&b.jsx("div",{className:"hidden sm:block px-4 py-2 bg-gradient-to-r from-blue-50 to-indigo-50 rounded-lg border border-blue-200",children:b.jsxs("div",{className:"flex items-center space-x-2",children:[b.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-pulse flex-shrink-0"}),b.jsx("p",{className:"text-sm text-blue-700",children:z.headerNote})]})}),!S&&void 0!==g&&b.jsx("div",{className:"group relative",onMouseEnter:e=>{const t=e.currentTarget.getBoundingClientRect();te({x:t.left+t.width/2,y:t.bottom+8}),J(!0)},onMouseLeave:()=>J(!1),children:b.jsx("div",{className:"px-3 py-1.5 rounded-full text-xs font-semibold text-white shadow-sm cursor-help transition-all duration-300 hover:scale-105 "+(g>=75?"bg-gradient-to-r from-green-500 to-green-600":g>=50?"bg-gradient-to-r from-yellow-500 to-yellow-600":"bg-gradient-to-r from-red-500 to-red-600"),children:b.jsxs("div",{className:"flex items-center space-x-1",children:[b.jsx("div",{className:"w-2 h-2 bg-white rounded-full animate-pulse"}),b.jsxs("span",{children:[Ee,": ",g]})]})})})]}),b.jsxs("div",{className:"w-full sm:w-auto flex flex-wrap items-center justify-between sm:justify-end gap-1 sm:gap-2 sm:ml-auto",children:[b.jsxs("div",{className:"flex items-center sm:gap-1",children:[b.jsx("button",{type:"button",onClick:ke,className:`${Q} p-1.5 hover:bg-gray-100 rounded-md text-gray-500 hover:text-gray-700 transition-colors`,title:z.zoomOut,"aria-label":z.zoomOut,children:b.jsx(M,{className:"w-4 h-4"})}),b.jsxs("span",{className:"px-1.5 sm:px-2 py-1 text-xs font-medium text-gray-600 bg-gray-50 rounded-md",children:[ae,"%"]}),b.jsx("button",{type:"button",onClick:we,className:`${Q} p-1.5 hover:bg-gray-100 rounded-md text-gray-500 hover:text-gray-700 transition-colors`,title:z.zoomIn,"aria-label":z.zoomIn,children:b.jsx(B,{className:"w-4 h-4"})})]}),b.jsxs("div",{className:"flex items-center gap-0.5 sm:gap-1",children:[N&&b.jsx("button",{type:"button",onClick:N,className:`${Q} p-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors`,title:z.save,"aria-label":z.save,children:b.jsx(F,{className:"w-4 h-4"})}),k&&b.jsx("button",{type:"button",onClick:k,disabled:w,className:`${Q} p-2 rounded-md text-white transition-colors ${w?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700"}`,title:z.download,"aria-label":z.download,children:w?b.jsx("span",{className:"block w-4 h-4 border-2 border-white border-b-transparent roun
2ded-full animate-spin"}):b.jsx(A,{className:"w-4 h-4"})}),P&&b.jsx("button",{type:"button",onClick:P,className:`${Q} p-2 text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-md transition-colors`,title:S?z.exitFullscreen:z.enterFullscreen,"aria-label":S?z.exitFullscreen:z.enterFullscreen,children:S?b.jsx(T,{className:"w-4 h-4"}):b.jsx(L,{className:"w-4 h-4"})})]})]})]}),b.jsxs("div",{className:"enhanced-resume-preview-content",style:Ce.content,ref:ue,role:"region","aria-label":z.region,children:[b.jsx("div",{className:"enhanced-resume-scale-wrapper",style:Ce.scaleWrapper,children:b.jsx("div",{style:Ce.editorFrame,children:b.jsxs("div",{ref:me,className:"resume-print-root",lang:ye,"data-template-key":ge,"data-template-color":m,children:[(ve||je)&&b.jsxs("div",{className:"no-print","data-placeholder":"true",style:{padding:"12px 16px",textAlign:"center",color:"#9ca3af",borderBottom:"1px dashed #e5e7eb"},children:[ve&&b.jsx("div",{style:{fontSize:"24px",fontWeight:"bold"},children:z.placeholderName}),je&&b.jsx("div",{style:{fontSize:"16px",marginTop:"2px"},children:z.placeholderTitle})]}),b.jsx(xe,{resumeData:be,colors:fe,width:"100%",lang:ye})]})})}),b.jsx("div",{className:"enhanced-resume-right-panel no-print",style:Ce.rightPanel,children:S&&void 0!==g&&b.jsxs("div",{className:"p-4 sm:p-6 space-y-6",children:[b.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-4 sm:p-6",children:[b.jsxs("div",{className:"flex flex-col-reverse sm:flex-row items-center sm:justify-between mb-6 gap-4",children:[b.jsxs("div",{children:[b.jsx("h3",{className:"text-xl font-bold text-gray-900",children:Ee}),b.jsx("p",{className:"text-sm text-gray-500",children:j?z.panelDescMatch:z.panelDescStructure})]}),b.jsx("div",{className:"relative flex-shrink-0",children:b.jsxs("div",{className:"w-24 h-24 relative",children:[b.jsxs("svg",{className:"w-24 h-24 transform -rotate-90",viewBox:"0 0 36 36","aria-hidden":"true",children:[b.jsx("path",{className:"text-gray-200",stroke:"currentColor",strokeWidth:"3",fill:"none",d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831"}),b.jsx("path",{className:"transition-all duration-1000 "+(g>=80?"text-green-500":g>=60?"text-yellow-500":g>=40?"text-orange-500":"text-red-500"),stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",fill:"none",strokeDasharray:`${g}, 100`,d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831"})]}),b.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:b.jsxs("div",{className:"text-center",children:[b.jsx("div",{className:"text-2xl font-bold "+(g>=80?"text-green-600":g>=60?"text-yellow-600":g>=40?"text-orange-600":"text-red-600"),children:g}),b.jsx("div",{className:"text-xs text-gray-500",children:"/100"})]})})]})})]}),Pe.available&&b.jsxs("div",{className:"mb-6 space-y-2",children:[[[z.rowSections,Pe.parse.sectionStructure],[z.rowLayout,Pe.parse.formattingRisks],[z.rowTextExtraction,Pe.parse.textExtraction],[z.rowContact,Pe.parse.contactInfo],[z.rowKeywords,Pe.relevance.keywordCoverage],[z.rowSkills,Pe.relevance.skillsMatch],[z.rowTitle,Pe.relevance.titleFit],[z.rowRecent,Pe.relevance.recentWork]].map(([e,t])=>b.jsxs("div",{className:"flex items-center justify-between text-sm gap-3",children:[b.jsxs("span",{className:"flex items-center gap-2 text-gray-600",children:[b.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${t.status.dot}`,"aria-hidden":"true"}),e]}),b.jsxs("span",{className:"text-gray-900 font-medium",children:[t.score,"/",t.maxScore]})]},e)),!j&&b.jsx("p",{className:"text-xs text-gray-500 pt-2",children:z.lowWithoutJob})]}),!H&&b.jsxs("div",{className:"mb-6 text-center",children:[De?b.jsx("button",{type:"button",onClick:()=>R(C("pricing")),className:"px-6 py-3 min-h-[44px] rounded-lg font-semibold text-white transition-all duration-300 bg-gradient-to-r from-orange-500 to-red-600 hover:from-orange-600 hover:to-red-700 hover:scale-105 shadow-lg hover:shadow-xl",children:z.getCredits}):b.jsx("button",{type:"button",onClick:Ae,disabled:U,className:"px-6 py-3 min-h-[44px] rounded-lg font-semibold text-white transition-all duration-300 "+(U?"bg-gray-400 cursor-not-allowed":"bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 hover:scale-105 shadow-lg hover:shadow-xl"),children:U?b.jsxs("span",{className:"flex items-center space-x-2",children:[b.jsx("span",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),b.jsx("span",{children:z.analysing})]}
2):z.runAnalysis}),b.jsx("p",{className:"text-xs text-gray-500 mt-2",children:ce?De?z.creditsOut:X(z,"creditsHave",oe):z.errSignIn})]}),H&&b.jsx("div",{className:"mb-4 p-3 bg-green-50 border border-green-200 rounded-lg",children:b.jsxs("div",{className:"flex items-center space-x-2",children:[b.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),b.jsx("span",{className:"text-sm font-medium text-green-800",children:z.analysisComplete})]})}),O&&b.jsxs("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg",role:"alert",children:[b.jsxs("div",{className:"flex items-center space-x-2",children:[b.jsx("div",{className:"w-2 h-2 bg-red-500 rounded-full"}),b.jsx("span",{className:"text-sm font-medium text-red-800",children:z.analysisError})]}),b.jsx("p",{className:"text-xs text-red-600 mt-1",children:O}),b.jsx("button",{type:"button",onClick:Ae,className:"mt-2 min-h-[44px] lg:min-h-0 text-xs text-red-700 hover:text-red-800 underline",children:z.tryAgain})]}),b.jsx("div",{className:`p-4 rounded-lg ${Ie.box}`,children:b.jsxs("div",{className:Ie.text,children:[b.jsx("div",{className:"font-bold text-lg mb-2",children:Ie.title}),b.jsx("div",{className:"text-sm",children:Ie.body})]})})]}),H&&W&&b.jsxs("div",{className:"mt-6 space-y-4",children:[b.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[b.jsx("h4",{className:"font-semibold text-blue-800 mb-2",children:z.aiAnalysis}),W.explanation&&!/couldn'?t read text/i.test(W.explanation)&&b.jsx("p",{className:"text-sm text-blue-700 mb-3",children:W.explanation}),W.strengths?.length>0&&b.jsxs("div",{className:"mb-3",children:[b.jsx("div",{className:"font-medium text-green-700 mb-1",children:z.strengths}),b.jsx("ul",{className:"text-sm text-green-600 space-y-1",children:W.strengths.map((e,t)=>b.jsxs("li",{className:"flex items-start space-x-2",children:[b.jsx("span",{className:"text-green-500 mt-0.5","aria-hidden":"true",children:"â¢"}),b.jsx("span",{children:e})]},t))})]}),W.weaknesses?.length>0&&b.jsxs("div",{className:"mb-3",children:[b.jsx("div",{className:"font-medium text-red-700 mb-1",children:z.weaknesses}),b.jsx("ul",{className:"text-sm text-red-600 space-y-1",children:W.weaknesses.map((e,t)=>b.jsxs("li",{className:"flex items-start space-x-2",children:[b.jsx("span",{className:"text-red-500 mt-0.5","aria-hidden":"true",children:"â¢"}),b.jsx("span",{children:e})]},t))})]})]}),W.specificRecommendations?.length>0&&b.jsxs("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:[b.jsx("h4",{className:"font-semibold text-yellow-800 mb-2",children:z.recommendations}),b.jsx("ul",{className:"text-sm text-yellow-700 space-y-2",children:W.specificRecommendations.map((e,t)=>b.jsxs("li",{className:"flex items-start space-x-2",children:[b.jsx("span",{className:"text-yellow-600 mt-0.5","aria-hidden":"true",children:"â¢"}),b.jsx("span",{children:e})]},t))})]})]})]})})]})]}),G&&void 0!==g&&v.createPortal(b.jsx("div",{className:"fixed z-[99999] pointer-events-none",style:{left:ee.x-112+"px",top:`${ee.y}px`},children:b.jsxs("div",{className:"relative w-56 px-3 py-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg",children:[b.jsxs("div",{className:"text-center",children:[b.jsxs("div",{className:"font-semibold mb-1",children:[Ee,": ",g,"/100"]}),b.jsx("div",{className:"text-gray-300",children:j?z.tooltipMatch:z.tooltipStructure})]}),b.jsx("div",{className:"absolute -top-1 left-1/2 transform -translate-x-1/2 w-2 h-2 bg-gray-900 rotate-45"})]})}),document.body)]})});ee.displayName="EnhancedResumePreview";
2const te=f.memo(ee),ae=d(),ne=async e=>{try{let t=null;if(e&&"function"==typeof e.getContainer&&(t=e.getContainer()),t||(t=e.querySelector(".resume-preview-content")),!t){const a=e.querySelector('div[style*="minHeight"]');a&&(t=a)}if(!t){const a=e.querySelector(".resume-template-content");a&&(t=a)}if(!t){const a=e.querySelector(".resume-template-container");a&&(t=a)}if(t||(t=e),!t)throw new Error("Resume content not found in preview");const a=t.cloneNode(!0);a.querySelectorAll(".no-print, .resume-preview-wrapper, .resume-preview-content").forEach(e=>{e.remove()}),a.setAttribute("data-pdf","true");const n=await re(a);return le(n,[])}catch(t){throw t}},ie=async e=>{try{if(e.startsWith("data:"))return e;const t=await fetch(e),a=await t.blob();return new Promise(e=>{const t=new FileReader;t.onloadend=()=>e(t.result),t.readAsDataURL(a)})}catch(t){return e}},re=async e=>{try{const a=e.querySelectorAll("*");for(const e of a){if("IMG"===e.tagName&&e.src)try{const t=await ie(e.src);e.src=t}catch(t){}const a=window.getComputedStyle?window.getComputedStyle(e):null;if(!a)return;const n=["font-family","font-size","font-weight","font-style","font-variant","color","background-color","background","display","position","top","left","right","bottom","z-index","float","clear","width","height","min-width","min-height","max-width","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border","border-width","border-style","border-color","border-radius","border-top","border-right","border-bottom","border-left","flex","flex-direction","flex-wrap","flex-basis","flex-grow","flex-shrink","justify-content","align-items","align-self","align-content","order","grid-template-columns","grid-template-rows","grid-template-areas","grid-column","grid-row","grid-area","gap","row-gap","column-gap","text-align","text-decoration","text-transform","text-indent","line-height","letter-spacing","word-spacing","white-space","word-wrap","word-break","text-overflow","vertical-align","box-shadow","text-shadow","opacity","visibility","transform","transition","animation","overflow","overflow-x","overflow-y","clip","page-break-before","page-break-after","page-break-inside"],i=e.children.length>0;let r="";if(n.forEach(e=>{if("height"===e&&i)return;if("overflow"===e||"overflow-x"===e||"overflow-y"===e)return void(r+=`${e}: visible; `);const t=a?a.getPropertyValue(e):null;t&&"initial"!==t&&"normal"!==t&&"auto"!==t&&("display"===e&&"flex"===t||"display"===e&&"grid"===t||"position"===e&&"relative"===t||"position"===e&&"absolute"===t?r+=`${e}: ${t}; `:"text-align"===e?(r+=`${e}: ${t} !important; `,r+=`--text-align-value: ${t}; `):"0px"!==t&&"0%"!==t&&"none"!==t&&(r+=`${e}: ${t}; `))}),r){const t=e.getAttribute("style")||"",a=t?`${t}; ${r}`:r;e.setAttribute("style",a)}}return e}catch(t){return e}},le=(e,t)=>{const a=t.filter(e=>"stylesheet"===e.type).map(e=>`<link rel="stylesheet" href="${e.url}" />`),n=t.filter(e=>"font"===e.type).map(e=>e.url?`<link rel="preload" href="${e.url}" as="font" type="font/woff2" crossorigin />
2`:"").filter(Boolean);return`<!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <title>Resume</title>\n \n \x3c!-- External stylesheets --\x3e\n ${a.join("\n ")}\n \n \x3c!-- External fonts --\x3e\n ${n.join("\n ")}\n \n \x3c!-- Google Fonts fallback --\x3e\n <link rel="preconnect" href="https://fonts.googleapis.com">\n <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>\n \x3c!-- Georgia and Palatino Linotype are system faces, not Google Fonts. Asking\n for them made the whole css2 request 400, so none of these families\n loaded and every PDF fell back to whatever the droplet had installed. --\x3e\n <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Open+Sans:wght@300;400;600;700&family=Lato:wght@300;400;700&family=Montserrat:wght@300;400;500;600;700&family=Roboto+Mono:wght@300;400;500&display=swap" rel="stylesheet">\n \n \x3c!-- Print-specific styles --\x3e\n <style>\n @page {\n size: A4;\n margin: 0;\n }\n \n body {\n margin: 0;\n padding: 0;\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n /* The droplet has no Arial. Liberation Sans is the metric-compatible\n substitute on Debian/Ubuntu; Roboto is fetched above so the PDF looks\n the same whatever the server happens to have installed. */\n font-family: Arial, "Liberation Sans", "DejaVu Sans", Roboto, Helvetica, sans-serif;\n line-height: 1.4;\n }\n \n * {\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n box-sizing: border-box;\n }\n \n .resume-container {\n width: 100%;\n max-width: 210mm;\n margin: 0 auto;\n background-color: #ffffff;\n color: #333;\n }\n \n /* Enhanced PDF rendering for better layout */\n [style*="display: flex"] {\n display: flex !important;\n }\n \n [style*="display: grid"] {\n display: grid !important;\n }\n \n /* Text alignment - Critical for PDF rendering */\n [style*="text-align: left"] {\n text-align: left !important;\n }\n \n [style*="text-align: center"] {\n text-align: center !important;\n }\n \n [style*="text-align: right"] {\n text-align: right !important;\n }\n \n [style*="text-align: justify"] {\n text-align: justify !important;\n }\n \n /* Additional text alignment selectors for better coverage */\n .text-left, [class*="text-left"] {\n text-align: left !important;\n }\n \n .text-center, [class*="text-center"] {\n text-align: center !important;\n }\n \n .text-right, [class*="text-right"] {\n text-align: right !important;\n }\n \n .text-justify, [class*="text-justify"] {\n text-align: justify !important;\n }\n \n /* Force text alignment preservation with highest priority */\n *[style*="text-align"] {\n text-align: inherit !important;\n }\n \n /* CSS custom properties for text alignment */\n :root {\n --text-align-left: left;\n --text-align-center: center;\n --text-align-right: right;\n --text-align-justify: justify;\n }\n \n /* Specific text alignment overrides */\n div[style*="text-align: center"] {\n text-align: center !important;\n }\n \n div[style*="text-align: right"] {\n text-align: right !important;\n }\n \n div[style*="text-align: left"] {\n text-align: left !important;\n }\n \n div[style*="text-align: justify"] {\n text-align: justify !important;\n }\n \n /* Print-specific text alignment rules */\n @media print {\n /* Force text alignment preservation in print */\n [style*="text-align: center"] {\n text-align: center !important;\n }\n \n [style*="text-align: right"] {\n text-align: right !important;\n }\n \n [style*="text-align: left"] {\n text-align: left !important;\n }\n \n [style*="text-align: justify"] {\n text-align: justify !important;\n }\n \n /* Override any conflicting styles */\n * {\n text-align: inherit;\n }\n \n /* Ensure inline styles take precedence */\n [style*="text-align"] {\n text-align: var(--text-align-value) !important;\n }\n }\n \n /* Ensure proper positioning */\n [style*="position: relative"] {\n position: relative !important;\n }\n \n [style*="position: absolute"] {\n position: absolute !important;\n }\n \n /* Page breaks */\n .page-break {\n page-break-before: always;\n }\n \n .avoid-break {\n page-break-inside: avoid;\n }\n \n .break-after {\n page-break-after: always;\n }\n \n /* Hide elements that shouldn't be in PDF */\n .no-print,\n .resume-preview-wrapper,\n .resume-preview-content,\n .resume-control
2s,\n .preview-controls,\n .toolbar,\n .sidebar,\n .navigation,\n .header,\n .footer,\n .debug-info,\n .dev-only {\n display: none !important;\n }\n </style>\n</head>\n<body>\n ${e.outerHTML}\n</body>\n</html>`},se=()=>{m("/api/me/credits",{timeoutMs:15e3}).catch(()=>{})},oe=async(e,t={})=>{try{if(!(await de()))throw new Error("Backend service is not available. Please try again later.");const a=await(async(e,t={})=>{let a;for(let i=1;i<=3;i++)try{const a={html:await ne(e),options:{filename:t.filename||"resume.pdf",...t}},n=await c("/api/download-pdf",{method:"POST",body:a,timeoutMs:9e4}),i=await n.blob();return i.type&&"application/pdf"===i.type?i:new Blob([i],{type:"application/pdf"})}catch(n){if(a=n,n instanceof o&&["AUTH_REQUIRED","INSUFFICIENT_CREDITS","RATE_LIMIT","ABORTED"].includes(n.code))throw n;if(i<3){const e=Math.min(1e3*Math.pow(2,i-1),5e3);await new Promise(t=>setTimeout(t,e))}}if(a instanceof o)throw a;throw new Error(`PDF generation failed after 3 attempts. Last error: ${a?.message||"Unknown error"}`)})(e,t);if(!a||0===a.size)throw new Error("Generated PDF is empty or invalid");const n=URL.createObjectURL(a),i=document.createElement("a");i.href=n,i.download=t.filename||"resume.pdf",document.body.appendChild(i),i.click(),setTimeout(()=>{document.body.removeChild(i),URL.revokeObjectURL(n)},5e3),se()}catch(a){if(a instanceof o)throw se(),a;let e="PDF download failed. ";a.message.includes("Backend service is not available")?e+="The server is currently unavailable. Please try again in a few moments.":a.message.includes("PDF generation failed")?e+="There was an error generating your PDF. Please try again.":a.message.includes("timeout")?e+="The request timed out. Please try again.":a.message.includes("network")?e+="Network error. Please check your connection and try again.":e+="An unexpected error occurred. Please try again.";const t=new Error(e);throw t.originalError=a,t.userMessage=e,t}},de=async()=>{try{const e=new AbortController,t=setTimeout(()=>e.abort(),1e4),a=await fetch(`${ae}/api/health`,{method:"GET",signal:e.signal});return clearTimeout(t),a.ok}catch(e){return!1}},ce="forgemycv:guestDraft",me="forgemycv:unsyncedDraft",ue=[5e3,15e3,3e4,6e4],pe=e=>{try{const t=localStorage.getItem(me),a=t?JSON.parse(t):null;return a&&a.uid===e&&a.resumeData?a:null}catch{return null}},he="(min-width: 1024px)",ge=()=>{try{const e=localStorage.getItem(ce);if(!e)return null;const t=JSON.parse(e);return t&&1===t.version&&t.resumeData?t:null}catch{return null}},xe=(e,t)=>{try{localStorage.setItem(ce,JSON.stringify({version:1,updatedAt:(new Date).toISOString(),templateKey:t,resumeData:e}))}catch{}},fe=(e,t={})=>String(e).replace(/\{(\w+)\}/g,(e,a)=>a in t?String(t[a]):e),ye=(e,t,a)=>fe(e[`${t}_${1===a?"one":"other"}`],{count:a}),be={"PROFESSIONAL SUMMARY":"PROFESSIONAL SUMMARY","WORK EXPERIENCE":"WORK EXPERIENCE",SKILLS:"SKILLS",EDUCATION:"EDUCATION",PROJECTS:"PROJECTS","PROFESYONEL ÃZET":"PROFESSIONAL SUMMARY","İŠDENEYİMİ":"WORK EXPERIENCE","BECERİLER":"SKILLS","EÄİTİM":"EDUCATION",PROJELER:"PROJECTS"},ve=e=>{let t=String(e??"").replace(/\D/g,"").slice(0,6);return 1===t.length&&t>"1"&&(t=`0${t}`),t.length<=2?t:`${t.slice(0,2)}/${t.slice(2)}`},je=(e,{final:t=!1}={},a)=>{if(!e)return"";const n=e.replace(/\D/g,"");if(n.length>=2){const e=parseInt(n.slice(0,2),10);if(e<1||e>12)return a.monthInvalid}return t&&!/^\d{2}\/\d{4}$/.test(e)?a.dateIncomplete:""},we=(e=!1)=>"w-full px-3 py-2.5 sm:py-2 border rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-sm sm:text-base min-h-[44px] touch-manipulation "+(e?"border-red-500":"border-gray-300"),ke="w-full px-3 py-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 resize-none text-sm sm:text-base min-h-[120px] touch-manipulation",Ne="block text-xs sm:text-sm font-medium text-gray-700 mb-1",Se="w-full py-2 bg-gray-100 text-gray-700 rounded-md hover:bg-gray-200 transition-colors min-h-[44px] touch-manipulation",Pe=e=>`px-3 sm:px-4 py-2.5 sm:py-2 rounded-lg bg-gradient-to-r ${e?"from-gray-400 to-gray-300 cursor-not-allowed":"from-blue-500 to-blue-400 hover:from-blue-600 hover:to-blue-500"} text-white font-semibold shadow transition text-xs sm:text-sm min-h-[44px] touch-manipulation`,Ee=()=>{const{selectedTemplate:i,selectTemplate:s}=u(),{user:o,loading:d}=a(),{credits:c,downloads:m,unlimitedDownloads:y,loading:v,refreshCredits:D}=t(),{lang:A,t:C,navigate:T}=e(),z=C(q),L=j(),{resumeId:R}=w(),[F]=k(),O=(()=>{const[e,t]=f.useState(()=>"undefined"==typeof window||!window.matchMedia||window.matchMedia(he).matches);return f.useEffect(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia(he),a=e=>t(e.matches);return t(e.matches),e.addEventListener?e.addEventListener("change",a):e.addListener(a),(
2)=>{e.removeEventListener?e.removeEventListener("change",a):e.removeListener(a)}},[]),e})(),[M,$]=f.useState("split"),[B,W]=f.useState(!1),[Z,X]=f.useState("edit"),[Q,ee]=f.useState(!1),[ae,ne]=f.useState(!1),[ie,re]=f.useState(!1),[le,se]=f.useState(!1),[de,Ee]=f.useState("personal"),[Ie,De]=f.useState(""),[Ae,Ce]=f.useState({}),[Te,ze]=f.useState(0),[Le,Re]=f.useState(null),[Fe,Oe]=f.useState(!1),Me=f.useRef(null),$e=f.useRef(null),Be=!o?.uid,Ue=F?.get("template"),_e=n(Ue)||n(L.state?.templateKey)||n(L.state?.templateId)||n(L.state?.templateName)||n(i?.key)||n(i?.id)||"professional",Ye=p[_e],He=Ye.id,Ke=Ye.displayName,We=Ye.color;f.useEffect(()=>{i?.key!==_e&&s({id:Ye.id,key:Ye.key,name:Ye.displayName,color:Ye.color,description:Ye.description,features:Ye.features,tags:Ye.tags,layout:Ye.layout})},[_e,i?.key]);const[Ve,Ge]=f.useState(()=>V(A)),[Je,qe]=f.useState(R||L.state?.resumeId||null),[Ze,Xe]=f.useState(!0),Qe=f.useRef(Je),et=f.useRef(!1),tt=f.useRef(null),at=f.useRef(0),nt=f.useRef(null),it=f.useRef(null),rt=f.useRef(!1),lt=f.useRef(_e);f.useEffect(()=>{Qe.current=Je},[Je]),f.useEffect(()=>{lt.current=_e},[_e]);const st=_(Ve.resumeLanguage),ot=f.useCallback(e=>{et.current=!0,Ge(e)},[]),dt=f.useCallback(e=>{Qe.current=e,qe(e)},[]),ct=f.useCallback(async(e,{markCompleted:t=!1}={})=>{if(!o?.uid||!h)return null;const a=N(h,"users",o.uid),n=await S(a),i=n.exists()?[...n.data().resumes||[]]:[],r=Qe.current||`draft_${o.uid}_${Date.now()}`;dt(r);const l=i.findIndex(e=>e.id===r),s=l>=0?i[l]:null,d=(new Date).toISOString(),c={...s||{},id:r,name:e.personalInfo?.fullName||s?.name||z.untitledResume,templateKey:lt.current,templateId:He,templateName:Ke,templateColor:We,resumeLanguage:_(e.resumeLanguage),createdAt:s?.createdAt||d,updatedAt:d,isDraft:!t&&(!s||!1!==s.isDraft),status:t?"in-progress":s?.status||"in-progress",data:e};return l>=0?i[l]=c:i.push(c),await P(a,{resumes:i},{merge:!0}),c},[o?.uid,He,Ke,We,dt,z.untitledResume]),mt=f.useCallback(async e=>{if(Be)return xe(e,lt.current),!0;clearTimeout(tt.current);try{return await ct(e),at.current=0,(()=>{try{localStorage.removeItem(me)}catch{}})(),!0}catch(t){((e,t,a,n)=>{try{localStorage.setItem(me,JSON.stringify({version:1,uid:e,draftId:t,templateKey:n,resumeData:a,updatedAt:(new Date).toISOString()}))}catch{}})(o?.uid,Qe.current,e,lt.current);const a=Math.min(at.current,ue.length-1);return at.current+=1,tt.current=setTimeout(()=>{nt.current?.(it.current)},ue[a]),!1}},[Be,ct,o?.uid]);f.useEffect(()=>{nt.current=mt},[mt]),f.useEffect(()=>{it.current=Ve},[Ve]),f.useEffect(()=>{if(Be)return;const e=()=>{at.current>0&&"hidden"!==document.visibilityState&&nt.current?.(it.current)};return window.addEventListener("online",e),document.addEventListener("visibilitychange",e),()=>{window.removeEventListener("online",e),document.removeEventListener("visibilitychange",e),clearTimeout(tt.current)}},[Be]);const ut=f.useCallback(e=>{xe(Ve,lt.current),e&&l(e),T("auth",{state:{returnTo:`${L.pathname}${L.search}`,templateKey:lt.current}})},[T,Ve,L.pathname,L.search]);f.useEffect(()=>{let e=!1;const t=()=>{e||(rt.current=!0,Xe(!1))};if(!d)return(async()=>{rt.current=!1,Xe(!0);const a=L.state?.resumeData||L.state?.importedResume?.data||null;if(a){const e=R||L.state?.resumeId||null,n=G(a);return a.resumeLanguage||e||(n.resumeLanguage=_(A)),Ge(n),e&&dt(e),L.state?.importedResume?.data&&l.success(z.resumeImported),void t()}if(Be){const a=ge();return a?.resumeData&&!e&&Ge(G(a.resumeData)),void t()}if(h){try{const a=N(h,"users",o.uid),n=await S(a),i=n.exists()&&n.data().resumes||[],r=ge();if(r?.resumeData){const n=G(r.resumeData),s=`draft_${o.uid}_${Date.now()}`,d=(new Date).toISOString(),c=[...i,{id:s,name:n.personalInfo?.fullName||z.untitledResume,templateKey:r.templateKey||lt.current,templateId:He,templateName:Ke,templateColor:We,resumeLanguage:n.resumeLanguage,createdAt:r.updatedAt||d,updatedAt:d,isDraft:!0,status:"in-progress",data:n}];return await P(a,{resumes:c},{merge:!0}),(()=>{try{localStorage.removeItem(ce)}catch{}})(),e||(dt(s),Ge(n),l.success(z.guestDraftAdopted)),void t()}const s=R?i.find(e=>e.id===R):[...i].filter(e=>e.isDraft).sort((e,t)=>
2new Date(t.updatedAt||t.createdAt||0)-new Date(e.updatedAt||e.createdAt||0))[0],d=pe(o.uid);d&&(!R||d.draftId===R)&&(!s||!d.draftId||d.draftId===s.id)&&!e?(d.draftId&&dt(d.draftId),Ge(G(d.resumeData)),et.current=!0):s&&!e&&(dt(s.id),s.data&&Ge(G(s.data)))}catch(n){const t=pe(o.uid);t&&!e&&(t.draftId&&dt(t.draftId),Ge(G(t.resumeData)),et.current=!0)}t()}else t()})(),()=>{e=!0}},[d,o?.uid,R,L.key]),f.useEffect(()=>{if(!rt.current||!et.current)return;const e=setTimeout(()=>{mt(Ve)},2e3);return()=>clearTimeout(e)},[Ve,mt,Ze]),f.useEffect(()=>{if(!Be)return;const e=()=>{et.current&&xe(Ve,lt.current)};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[Be,Ve]);const pt=f.useRef(0);f.useEffect(()=>{const e=++pt.current,t=setTimeout(async()=>{try{const{calculateOverallATSScore:t}=await r(async()=>{const{calculateOverallATSScore:e}=await import("./advancedATSService-DfXA6mZu.js");return{calculateOverallATSScore:e}},[]),a=await t(Ve,Ve.jobDescription||"");if(e!==pt.current)return;ze(Math.round(a?.totalScore||0)),Re(a?.breakdown||null),Oe("boolean"==typeof a?.hasJobDescription?a.hasJobDescription:Boolean((Ve.jobDescription||"").trim().length>10))}catch(t){if(e!==pt.current)return}},800);return()=>clearTimeout(t)},[Ve]);const ht=e=>{const{name:t,value:a}=e.target;if("phone"===t){if(""!==a&&!/^[0-9+\-\s()]*$/.test(a))return void De(z.phoneInvalid);De("")}ot(e=>({...e,personalInfo:{...e.personalInfo,[t]:a??""}}))},gt=(e,t,a)=>`${e}-${t}-${a}`,xt=(e,t)=>{Ce(a=>{if((a[e]||"")===t)return a;const n={...a};return t?n[e]=t:delete n[e],n})},ft=(e,t)=>{const{name:a,value:n}=t.target;let i=n??"";"startDate"!==a&&"endDate"!==a||(i=ve(i),xt(gt("edu",e,a),je(i,{},z))),ot(t=>{const n=[...t.education];return n[e]={...n[e],[a]:i},{...t,education:n}})},yt=(e,t)=>{const{name:a,value:n}=t.target;let i=n??"";"startDate"!==a&&"endDate"!==a||(i=ve(i),xt(gt("exp",e,a),je(i,{},z))),ot(t=>{const n=[...t.experience];return n[e]={...n[e],[a]:i},{...t,experience:n}})},bt=(e,t)=>{const{name:a,value:n}=t.target;ot(t=>({...t,projects:t.projects.map((t,i)=>i===e?{...t,[a]:n}:t)}))},vt=()=>Be?(ut(z.signInForAI),!1):!v&&(!(c<=0)||(re(!0),!1)),jt=(e,t)=>{"AUTH_REQUIRED"===e?.code?ut(z.signInForAI):"INSUFFICIENT_CREDITS"===e?.code?re(!0):"RATE_LIMIT"===e?.code?l.error(z.rateLimited):"TIMEOUT"===e?.code?l.error(z.aiTimeout):"NETWORK_ERROR"===e?.code?l.error(z.aiNetwork):l.error(t)},wt=e=>{const t={};let a=null;return String(e).split("\n").forEach(e=>{const n=e.replace(/\s+$/,""),i=(e=>{const t=e.trim().replace(/^#+\s*/,"").replace(/\*\*/g,"").replace(/\s*:?\s*$/,"");return!t||t.length>30?null:be[t.toUpperCase()]||be[t.toLocaleUpperCase("tr")]||null})(n);if(i)return a=i,void(t[a]=[]);a&&t[a].push(n)}),Object.keys(t).forEach(e=>{t[e]=t[e].join("\n").trim()}),t},kt=()=>{if(!Ve.personalInfo.fullName||!Ve.personalInfo.email)return l.error(z.validationNameEmail),Ee("personal"),X("edit"),!1;const e=Ve.experience.some(e=>e.company||e.position),t=Ve.education.some(e=>e.institution||e.degree),a=Ve.projects.some(e=>e.name);return!!(e||t||a)||(l.error(z.validationContent),Ee("experience"),X("edit"),!1)},Nt=f.useCallback(async()=>{if(kt())if(Be)ut(z.signInToSave);else if(h)try{await ct(Ve,{markCompleted:!0}),et.current=!1,l.success(z.resumeSaved),T("dashboard")}catch(e){l.error(z.saveFailed)}else l.error(z.dbUnavailable)},[Ve,Be,ct,ut,T,z]),St=f.useCallback(async()=>{if(ae||v)return;if(!kt())return;if(Be)return void ut(z.signInToDownload);if(!y&&m<=0)return await mt(Ve),void se(!0);const e=$e.current?.getContainer?.();if(!e)return void l.error(z.previewLoading);ne(!0);const t="pdf-download";l.loading(z.pdfPreparing,{id:t});try{await oe(e,{filename:`${(Ve.personalInfo.fullName||z.fileNameFallback).replace(/\s+/g,"_")}_${(new Date).toISOString().split("T")[0]}.pdf`,template:Ke,color:We}),l.success(z.pdfDone,{id:t}),await(D?.())}catch(a){l.dismiss(t),"INSUFFICIENT_CREDITS"===a?.code?(await mt(Ve),se(!0)):"AUTH_REQUIRED"===a?.code?ut(z.signInToDownload):"RATE_LIMIT"===a?.code?l.error(z.pdfRateLimited):l.error(z.pdfFailed)}finally{ne(!1)}},[ae,v,Be,y,m,Ve,Ke,We,mt,ut,D,z]),Pt=f.useCallback(()=>{$(e=>"split"===e?"fullscreen":"split"),W(e=>!e)},[]),Et=f.useCallback(()=>Nt(),[Nt]),It=f.useCallback(()=>St(),[St]),Dt=(e,t)=>
2b.jsxs("button",{type:"button",className:"w-full flex justify-between items-center p-3 sm:p-4 bg-white hover:bg-gray-50 transition-colors min-h-[44px] touch-manipulation text-left "+(de===e?"border-b border-gray-200":""),onClick:()=>(e=>{Ee(e===de?null:e)})(e),"aria-expanded":de===e,"aria-controls":`section-${e}`,children:[b.jsx("span",{className:"text-sm sm:text-base font-medium text-gray-800",children:t}),b.jsx("svg",{className:"w-4 h-4 sm:w-5 sm:h-5 flex-shrink-0 transition-transform "+(de===e?"transform rotate-180":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),At=(e,t)=>b.jsx("button",{type:"button",onClick:e,className:"absolute -top-4 -right-4 w-11 h-11 flex items-center justify-center group touch-manipulation","aria-label":t,title:t,children:b.jsx("span",{className:"w-7 h-7 flex items-center justify-center text-gray-700 bg-white rounded-full border border-gray-400 shadow-sm group-hover:bg-gray-100 transition-colors",children:b.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":"true",children:b.jsx("path",{d:"M6 6l12 12M18 6L6 18"})})})}),Ct=e=>b.jsx("button",{type:"button",onClick:e,disabled:Q,className:Pe(Q),children:Q?z.generating:z.aiAssist}),Tt=({id:e,section:t,index:a,name:n,value:i,onChange:r,disabled:l=!1,placeholder:s})=>{const o=gt(t,a,n),d=Ae[o];return b.jsxs(b.Fragment,{children:[b.jsx("input",{id:e,type:"text",inputMode:"numeric",autoComplete:"off",maxLength:7,name:n,value:i,onChange:r,onBlur:e=>((e,t,a,n)=>{xt(gt(e,t,a),je(n,{final:!0},z))})(t,a,n,e.target.value),className:`${we(Boolean(d))} disabled:bg-gray-100 disabled:text-gray-400`,placeholder:s||z.datePlaceholder,disabled:l,"aria-invalid":Boolean(d),"aria-describedby":d?`${e}-error`:void 0}),d&&b.jsx("p",{id:`${e}-error`,className:"mt-1 text-xs sm:text-sm text-red-600",children:d})]})},zt=b.jsxs("div",{className:"flex-grow flex flex-col items-end gap-1",children:[b.jsxs("div",{className:"flex items-center gap-2",role:"group","aria-labelledby":"resume-language-label",children:[b.jsx("span",{id:"resume-language-label",className:"text-xs sm:text-sm font-medium text-gray-700",children:z.resumeLanguageLabel}),b.jsx("div",{className:"inline-flex rounded-lg border border-gray-300 bg-gray-50 p-0.5",children:U.map(e=>{const t=st===e;return b.jsx("button",{type:"button",lang:e,onClick:()=>(e=>{const t=_(e);t!==st&&ot(e=>({...e,resumeLanguage:t}))})(e),"aria-pressed":t,className:"min-h-[40px] px-3 text-xs sm:text-sm font-medium rounded-md transition-colors touch-manipulation "+(t?"bg-white text-blue-700 shadow-sm":"text-gray-600 hover:text-gray-900"),children:"tr"===e?z.resumeLanguageTr:z.resumeLanguageEn},e)})})]}),b.jsx("p",{className:"max-w-[18rem] text-xs text-gray-500 text-right",children:z.resumeLanguageHint})]}),Lt=b.jsx(te,{ref:$e,templateKey:_e,templateId:He,templateName:Ke,templateColor:We,resumeData:Ve,atsBreakdown:Le,atsScore:Te,hasJobDescription:Fe,isDownloading:ae||v,onDownload:It,onSave:Et,isFullscreen:B,onToggleFullscreen:Pt,autoHeight:!B&&!O}),Rt=b.jsxs(b.Fragment,{children:[b.jsx(E,{isOpen:ie,onClose:()=>re(!1)}),b.jsx(I,{isOpen:le,onClose:()=>se(!1)})]});return"fullscreen"===M?b.jsxs("div",{className:"min-h-screen relative overflow-hidden",children:[b.jsx(g,{routeKey:"resumeBuilder"}),b.jsx("div",{style:{position:"fixed",inset:0,zIndex:-20,background:"linear-gradient(to right, #3498db 0%, #b3d8f7 20%, #ffffff 40%, #ffffff 60%, #b3d8f7 80%, #3498db 100%)",width:"100vw",height:"100vh",transition:"background 1s"}}),b.jsx("div",{className:"relative z-10",children:b.jsx("div",{className:"h-screen",children:Lt})}),Rt]}):b.jsxs("div",{className:"min-h-screen relative overflow-hidden",children:[b.jsx("div",{style:{position:"fixed",inset:0,zIndex:-20,background:"linear-gradient(to right, #3498db 0%, #b3d8f7 20%, #ffffff 40%, #ffffff 60%, #b3d8f7 80%, #3498db 100%)",width:"100vw",height:"100vh",transition:"background 1s"}}),b.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:-10,pointerEvents:"none",background:"\n radial-gradient(circle at 0% 50%, #3498db88 0%, transparent 60%),\n radial-gradient(circle at 100% 50%, #3498db88 0%, transparent 60%)\n ",f
2ilter:"blur(60px)",opacity:.7}}),b.jsx(g,{routeKey:"resumeBuilder"}),b.jsx("div",{className:"max-w-7xl mx-auto px-2 sm:px-4 lg:px-8 py-4 sm:py-6 lg:py-8",children:b.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 sm:gap-6 lg:gap-8",children:[b.jsx("div",{className:"w-full lg:w-1/2 flex-col "+("preview"===Z?"hidden lg:flex":"flex"),children:b.jsxs("div",{className:"bg-white/95 shadow-xl backdrop-blur-lg rounded-lg p-4 sm:p-6 flex-1 flex flex-col",children:[Be&&b.jsxs("div",{className:"mb-3 sm:mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs sm:text-sm text-amber-900",children:[z.guestBannerPrefix," ",b.jsx("button",{type:"button",onClick:()=>ut(),className:"underline font-medium hover:text-amber-950",children:z.guestBannerLink}),z.guestBannerSuffix]}),b.jsxs("div",{className:"flex flex-wrap justify-between items-start gap-x-4 gap-y-2 mb-3 sm:mb-4",children:[b.jsx("h2",{className:"text-base sm:text-lg font-semibold text-gray-800 whitespace-nowrap pt-2",children:z.pageTitle}),zt]}),b.jsxs("div",{className:"space-y-3 sm:space-y-4",ref:Me,children:[b.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[Dt("personal",z.sectionPersonal),"personal"===de&&b.jsxs("div",{id:"section-personal",className:"p-3 sm:p-4 space-y-3 sm:space-y-4",children:[b.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4",children:[b.jsxs("div",{children:[b.jsx("label",{htmlFor:"fullName",className:Ne,children:z.fullName}),b.jsx("input",{id:"fullName",type:"text",name:"fullName",autoComplete:"name",value:Ve.personalInfo.fullName,onChange:ht,className:we(),placeholder:z.fullNamePlaceholder})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:"title",className:Ne,children:z.jobTitle}),b.jsx("input",{id:"title",type:"text",name:"title",autoComplete:"organization-title",value:Ve.personalInfo.title,onChange:ht,className:we(),placeholder:z.jobTitlePlaceholder})]})]}),b.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 sm:gap-4",children:[b.jsxs("div",{children:[b.jsx("label",{htmlFor:"email",className:Ne,children:z.email}),b.jsx("input",{id:"email",type:"email",name:"email",autoComplete:"email",value:Ve.personalInfo.email,onChange:ht,className:we(),placeholder:z.emailPlaceholder})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:"phone",className:Ne,children:z.phone}),b.jsx("input",{id:"phone",type:"tel",name:"phone",autoComplete:"tel",value:Ve.personalInfo.phone,onChange:ht,className:we(Boolean(Ie)),placeholder:z.phonePlaceholder,"aria-invalid":Boolean(Ie),"aria-describedby":Ie?"phone-error":void 0}),Ie&&b.jsx("p",{id:"phone-error",className:"mt-1 text-xs sm:text-sm text-red-600",children:Ie})]})]}),b.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 sm:gap-4",children:[b.jsxs("div",{children:[b.jsx("label",{htmlFor:"linkedin",className:Ne,children:z.linkedin}),b.jsx("input",{id:"linkedin",type:"url",name:"linkedin",value:Ve.personalInfo.linkedin,onChange:ht,className:we(),placeholder:z.linkedinPlaceholder})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:"github",className:Ne,children:z.github}),b.jsx("input",{id:"github",type:"url",name:"github",value:Ve.personalInfo.github,onChange:ht,className:we(),placeholder:z.githubPlaceholder})]})]}),b.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 sm:gap-4 items-end",children:b.jsxs("div",{children:[b.jsx("label",{htmlFor:"address",className:Ne,children:z.location}),b.jsx("input",{id:"address",type:"text",name:"address",value:Ve.personalInfo.address,onChange:ht,className:we(),placeholder:z.locationPlaceholder})]})}),b.jsxs("div",{className:"w-full mt-4",children:[b.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[b.jsx("label",{htmlFor:"summary",className:"block text-sm font-medium text-gray-700",children:z.summary}),Ct(async()=>{if(vt()){ee(!0);try{const e={jobTitle:Ve.personalInfo.title||"",experience:Ve.experience.filter(e=>e.position&&e.company).map(e=>`${e.position} at ${e.company}`).join(", "),skills:Ve.skills.filter(Boolean).join(", "),targetRole:Ve.personalInfo.title||"",yearsOfExperience:J(Ve.experience)},{generateATSProfessionalSummary:t}=await r(async()=>{const{generateATSProfessionalSummary:e}=await import("./aiService-DZp17crU.js");return{generateATSProfessionalSummary:e}},__vite__mapDeps([0,1,2,3,4])),a=await t({...e,lang:st});a?(ot(e=>({...e,personalInfo:{...e.personalInfo,summary:a.trim()}})),await(D?.())):l.error(z.summaryEmpty)}catch(e){jt(e,z.summaryFailed)}finally{ee(!1)}}})]}),b.jsx("textarea",{id:"summary",name:"summary",rows:"5",value:Ve.personalInfo.summary,onChange:ht,className:ke,placeholder:z.summaryPlaceholder})]})]})]}),b.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[Dt("experience",z.sectionExperience),"experience"===de&&b.jsxs("div",{id:"section-experience",className:"p-3 sm:p-4 space-y-6",children:[Ve.experience.map((e,t)=>
2b.jsxs("div",{className:"relative p-3 sm:p-4 border border-gray-200 rounded-lg",children:[Ve.experience.length>1&&At(()=>(e=>{Ce({}),ot(t=>{const a=t.experience.filter((t,a)=>a!==e);return{...t,experience:a.length?a:[{...Y}]}})})(t),z.removeExperience),b.jsx("div",{className:"flex items-center justify-end mb-2",children:b.jsxs("label",{className:"flex items-center gap-2 min-h-[44px] text-xs sm:text-sm text-gray-600 cursor-pointer select-none",children:[b.jsx("input",{type:"checkbox",checked:"Present"===e.endDate,onChange:e=>((e,t)=>{t&&xt(gt("exp",e,"endDate"),""),ot(a=>{const n=[...a.experience];return n[e]={...n[e],endDate:t?"Present":""},{...a,experience:n}})})(t,e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),z.currentlyWorking]})}),b.jsxs("div",{className:"space-y-4",children:[b.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 sm:gap-4",children:[b.jsxs("div",{children:[b.jsx("label",{htmlFor:`position-${t}`,className:Ne,children:z.position}),b.jsx("input",{id:`position-${t}`,type:"text",name:"position",value:e.position,onChange:e=>yt(t,e),className:we(),placeholder:z.positionPlaceholder})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:`company-${t}`,className:Ne,children:z.company}),b.jsx("input",{id:`company-${t}`,type:"text",name:"company",value:e.company,onChange:e=>yt(t,e),className:we(),placeholder:z.companyPlaceholder})]})]}),b.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-3 sm:gap-4",children:[b.jsxs("div",{className:"sm:col-span-2 md:col-span-1",children:[b.jsx("label",{htmlFor:`location-${t}`,className:Ne,children:z.location}),b.jsx("input",{id:`location-${t}`,type:"text",name:"location",value:e.location,onChange:e=>yt(t,e),className:we(),placeholder:z.experienceLocationPlaceholder})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:`startDate-${t}`,className:Ne,children:z.startDate}),Tt({id:`startDate-${t}`,section:"exp",index:t,name:"startDate",value:e.startDate,onChange:e=>yt(t,e)})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:`endDate-${t}`,className:Ne,children:z.endDate}),Tt({id:`endDate-${t}`,section:"exp",index:t,name:"endDate",value:"Present"===e.endDate?"":e.endDate,onChange:e=>yt(t,e),disabled:"Present"===e.endDate})]})]}),b.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[b.jsx("label",{htmlFor:`expDescription-${t}`,className:"block text-sm font-medium text-gray-700",children:z.description}),Ct(()=>(async e=>{if(vt()){ee(!0);try{const{generateATSBulletPoints:t}=await r(async()=>{const{generateATSBulletPoints:e}=await import("./aiService-DZp17crU.js");return{generateATSBulletPoints:e}},__vite__mapDeps([0,1,2,3,4])),a=await t({jobTitle:Ve.experience[e].position,responsibilities:Ve.experience[e].description,achievements:Ve.experience[e].achievements||"",targetRole:Ve.personalInfo.title,lang:st});a?(ot(t=>{const n=[...t.experience];return n[e]={...n[e],description:a},{...t,experience:n}}),await(D?.())):l.error(z.bulletsEmpty)}catch(t){jt(t,z.bulletsFailed)}finally{ee(!1)}}})(t))]}),b.jsx("textarea",{id:`expDescription-${t}`,name:"description",rows:"4",value:e.description,onChange:e=>yt(t,e),className:ke,placeholder:z.experienceDescriptionPlaceholder})]})]},t)),b.jsx("button",{type:"button",onClick:()=>{ot(e=>({...e,experience:[...e.experience,{...Y}]}))},className:Se,children:z.addExperience})]})]}),b.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[Dt("education",z.sectionEducation),"education"===de&&b.jsxs("div",{id:"section-education",className:"p-3 sm:p-4 space-y-6",children:[Ve.education.map((e,t)=>b.jsxs("div",{className:"relative p-3 sm:p-4 border border-gray-200 rounded-lg",children:[Ve.education.length>1&&At(()=>(e=>{Ce({}),ot(t=>{const a=t.education.filter((t,a)=>a!==e);return{...t,education:a.length?a:[{...H}]}})})(t),z.removeEducation),b.jsxs("div",{className:"space-y-4",children:[b.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 sm:gap-4",children:[b.jsxs("div",{children:[b.jsx("label",{htmlFor:`institution-${t}`,className:Ne,children:z.institution}),b.jsx("input",{id:`institution-${t}`,type:"text",name:"institution",value:e.institution,onChange:e=>ft(t,e),className:we(),placeholder:z.institutionPlaceholder})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:`degree-${t}`,className:Ne,children:z.degree}),b.jsx("input",{id:`degree-${t}`,type:"text",name:"degree",value:e.degree,onChange:e=>ft(t,e),className:we(),placeholder:z.degreePlaceholder})]})]}),b.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-3 sm:gap-4",children:[b.jsxs("div",{className:"sm:col-span-2 md:col-span-1",children:[b.jsx("label",{htmlFor:`fieldOfStudy-${t}`,className:Ne,children:z.fieldOfStudy}),b.jsx("input",{id:`fieldOfStudy-${t}`,type:"text",name:"fieldOfStudy",value:e.fieldOfStudy,onChange:e=>ft(t,e),className:we(),placeholder:z.fieldOfStudyPlaceholder})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:`eduStartDate-${t}`,className:Ne,children:z.startDate}),Tt({id:`eduStartDate-${t}`,section:"edu",index:t,name:"startDate",value:e.startDate,onChange:e=>ft(t,e)})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:`eduEndDate-${t}`,className:Ne,children:z.endDate}),Tt({id:`eduEndDate-${t}`,section:"edu",index:t,name:"endDate",value:e.endDate,onChange:e=>ft(t,e)})]})]}),b.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[b.jsx("label",{htmlFor:`eduDescription-${t}`,className:"block text-sm font-medium text-gray-700",children:z.description}),Ct(()=>(async e=>{if(vt()){ee(!0);try{const t=Ve.education[e],{generateATSEducationDescription:a}=await r(async()=>{const{generateATSEducationDescription:e}=await import("./aiService-DZp17crU.js");return{generateATSEducationDescription:e}},__vite__mapDeps([0,1,2,3,4])),n=await a({institution:t.institution,degree:t.degree,fieldOfStudy:t.fieldOfStudy,targetRole:Ve.personalInfo.title,lang:st});n?(ot(t=>{const a=[...t.education];return a[e]={...a[e],description:n},{...t,education:a}}),await(D?.()),l.success(z.educationGenerated)):l.error(z.educationEmpty)}catch(t){jt(t,z.educationFailed)}finally{ee(!1)}}})(t))]}),b.jsx("textarea",{id:`eduDescription-${t}`,name:"description",rows:"3",value:e.description,onChange:e=>ft(t,e),className:ke,placeholder:z.educationDescriptionPlaceholder})]})]},t)),b.jsx("button",{type:"button",onClick:()=>{ot(e=>({...e,education:[...e.education,{...H}]}))},className:Se,children:z.addEducation})]})]}),b.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[Dt("skills",z.sectionSkills),"skills"===de&&b.jsxs("div",{id:"section-skills",className:"p-3 sm:p-4 space-y-4",children:[b.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[b.jsx("span",{className:"block text-sm font-medium text-gray-700",children:z.skillsLabel}),Ct(async()=>
2{if(vt())if(Ve.personalInfo.title)if(0!==Ve.skills.filter(Boolean).length){ee(!0);try{const{generateATSSkills:e}=await r(async()=>{const{generateATSSkills:e}=await import("./aiService-DZp17crU.js");return{generateATSSkills:e}},__vite__mapDeps([0,1,2,3,4])),t=await e({currentSkills:Ve.skills.filter(Boolean).join(", "),targetRole:Ve.personalInfo.title,jobDescription:Ve.jobDescription||"",lang:st});if(!t)return void l.error(z.skillEmpty);if(Ve.skills.filter(Boolean).map(e=>String(e).toLocaleLowerCase(st)).includes(String(t).toLocaleLowerCase(st)))return void l(fe(z.skillDuplicate,{skill:t}));ot(e=>({...e,skills:[...e.skills.filter(Boolean),t]})),await(D?.())}catch(e){jt(e,z.skillFailed)}finally{ee(!1)}}else l.error(z.skillsNeedExisting);else l.error(z.skillsNeedTitle)})]}),b.jsx("p",{className:"text-sm text-gray-600",children:z.skillsHint}),b.jsx("div",{className:"space-y-3",children:Ve.skills.map((e,t)=>b.jsxs("div",{className:"relative",children:[b.jsx("input",{type:"text",value:e,onChange:e=>((e,t)=>{ot(a=>{const n=[...a.skills];return n[e]=t??"",{...a,skills:n}})})(t,e.target.value),className:we(),placeholder:z.skillPlaceholder,"aria-label":z.skillsLabel}),Ve.skills.length>1&&At(()=>(e=>{ot(t=>{const a=t.skills.filter((t,a)=>a!==e);return{...t,skills:a.length?a:[""]}})})(t),z.removeSkill)]},t))}),b.jsx("button",{type:"button",onClick:()=>{ot(e=>({...e,skills:[...e.skills,""]}))},className:Se,children:z.addSkill})]})]}),b.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[Dt("languages",z.sectionLanguages),"languages"===de&&b.jsxs("div",{id:"section-languages",className:"p-3 sm:p-4 space-y-4",children:[b.jsx("div",{className:"space-y-3",children:Ve.languages.map((e,t)=>b.jsxs("div",{className:"relative",children:[b.jsx("input",{type:"text",value:e,onChange:e=>((e,t)=>{ot(a=>{const n=[...a.languages];return n[e]=t??"",{...a,languages:n}})})(t,e.target.value),className:we(),placeholder:z.languagePlaceholder,"aria-label":z.sectionLanguages}),At(()=>(e=>{ot(t=>({...t,languages:t.languages.filter((t,a)=>a!==e)}))})(t),z.removeLanguage)]},t))}),b.jsx("button",{type:"button",onClick:()=>{ot(e=>({...e,languages:[...e.languages,""]}))},className:Se,children:z.addLanguage})]})]}),b.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[Dt("certifications",z.sectionCertifications),"certifications"===de&&b.jsxs("div",{id:"section-certifications",className:"p-3 sm:p-4 space-y-4",children:[b.jsx("div",{className:"space-y-3",children:Ve.certifications.map((e,t)=>b.jsxs("div",{className:"relative",children:[b.jsx("input",{type:"text",value:e,onChange:e=>((e,t)=>{ot(a=>{const n=[...a.certifications];return n[e]=t??"",{...a,certifications:n}})})(t,e.target.value),className:we(),placeholder:z.certificationPlaceholder,"aria-label":z.sectionCertifications}),At(()=>(e=>{ot(t=>({...t,certifications:t.certifications.filter((t,a)=>a!==e)}))})(t),z.removeCertification)]},t))}),b.jsx("button",{type:"button",onClick:()=>{ot(e=>({...e,certifications:[...e.certifications,""]}))},className:Se,children:z.addCertification})]})]}),b.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[Dt("projects",z.sectionProjects),"projects"===de&&b.jsxs("div",{id:"section-projects",className:"p-3 sm:p-4 space-y-4",children:[Ve.projects.map((e,t)=>b.jsxs("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4 space-y-4",children:[Ve.projects.length>1&&b.jsx("div",{className:"flex justify-end",children:b.jsx("button",{type:"button",onClick:()=>(e=>{ot(t=>{const a=t.projects.filter((t,a)=>a!==e);return{...t,projects:a.length?a:[{...K,technologies:[""]}]}})})(t),className:"min-h-[44px] px-2 text-red-600 hover:text-red-800 text-sm font-medium touch-manipulation","aria-label":z.removeProjectLabel,children:z.removeProject})}),b.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4",children:[b.jsxs("div",{children:[b.jsx("label",{htmlFor:`projectName-${t}`,className:Ne,children:z.projectName}),b.jsx("input",{id:`projectName-${t}`,type:"text",name:"name",value:e.name,onChange:e=>bt(t,e),className:we(),placeholder:z.projectNamePlaceholder})]}),b.jsxs("div",{children:[b.jsx("span",{className:Ne,children:z.technologies}),b.jsxs("div",{className:"space-y-2",children:[e.technologies.map((a,n)=>b.jsxs("div",{className:"flex items-center gap-1",children:[b.jsx("input",{type:"text",value:a,onChange:e=>((e,t,a)=>{ot(n=>({...n,projects:n.projects.map((n,i)=>i===e?{...n,technologies:n.technologies.map((e,n)=>n===t?a:e)}:n)}))})(t,n,e.target.value),className:we(),placeholder:z.technologyPlaceholder,"aria-label":z.technologies}),e.technologies.length>1&&b.jsx("button",{type:"button",onClick:()=>((e,t)=>{ot(a=>({...a,projects:a.projects.map((a,n)=>n===e?{...a,technologies:a.technologies.filter((e,a)=>a!==t)}:a)}))})(t,n),className:"flex-shrink-0 w-11 h-11 flex items-center justify-center text-red-600 hover:text-red-800 touch-manipulation","aria-label":z.removeTechnology,title:z.removeTechnology,children:b.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":"true",children:b.jsx("path",{d:"M6 6l12 12M18 6L6 18"})})})]},n)),b.jsx("button",{type:"button",onClick:()=>{return e=t,void ot(t=>({...t,projects:t.projects.map((t,a)=>a===e?{...t,technologies:[...t.technologies,""]}:t)}));var e},className:"min-h-[44px] text-blue-600 hover:text-blue-800 text-sm font-medium touch-manipulation",children:z.addTechnology})]})]})]}),b.jsxs("div",{children:[b.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[b.jsx("label",{htmlFor:`projectDescription-${t}`,className:"block text-xs sm:text-sm font-medium text-gray-700",children:z.projectDescription}),Ct(()=>(async e=>{if(!vt())return;const t=Ve.projects[e];if(t.name)if(t.technologies&&0!==t.technologies.filter(e=>e.trim()).length){ee(!0);try{const{generateATSProjectDescription:a}=await r(async()=>{const{generateATSProjectDescription:e}=await import("./aiService-DZp17crU.js");return{generateATSProjectDescription:e}},__vite__mapDeps([0,1,2,3,4])),n=await a({projectName:t.name,technologies:t.technologies.filter(e=>e.trim()).join(", "),currentDescription:t.description||"",targetRole:Ve.personalInfo.title||"",jobDescription:Ve.jobDescription||"",lang:st});n?(ot(t=>({...t,projects:t.projects.map((t,a)=>a===e?{...t,description:n}:t)})),await(D?.()),l.success(z.projectGenerated)):l.error(z.projectEmpty)}catch(a){jt(a,z.projectFailed)}finally{ee(!1)}}else l.error(z.projectNeedTech);else l.error(z.projectNeedName)})(t))]}),b.jsx("textarea",{id:`projectDescription-${t}`,name:"description",rows:"3",value:e.description,onChange:e=>bt(t,e),className:ke,placeholder:z.projectDescriptionPlaceholder})]}),b.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4",children:[b.jsxs("div",{children:[b.jsx("label",{htmlFor:`githubUrl-${t}`,className:Ne,children:z.githubUrl}),b.jsx("input",{id:`githubUrl-${t}`,type:"url",name:"githubUrl",value:e.githubUrl,onChange:e=>bt(t,e),className:we(),placeholder:z.githubUrlPlaceholder})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:`liveUrl-${t}`,className:Ne,children:z.liveUrl}),b.jsx("input",{id:`liveUrl-${t}`,type:"url",name:"liveUrl",value:e.liveUrl,onChange:e=>bt(t,e),className:we(),placeholder:z.liveUrlPlaceholder})]})]}),b.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:gap-4",children:[b.jsxs("div",{children:[b.jsx("label",{htmlFor:`projectStart-${t}`,className:Ne,children:z.startDate}),b.jsx("input",{id:`projectStart-${t}`,type:"text",name:"startDate",value:e.startDate,onChange:e=>bt(t,e),className:we(),placeholder:z.projectStartPlaceholder})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:`projectEnd-${t}`,className:Ne,children:z.endDate}),b.jsx("input",{id:`projectEnd-${t}`,type:"text",name:"endDate",value:e.endDate,onChange:e=>bt(t,e),className:we(),placeholder:z.projectEndPlaceholder})]})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:`projectAchievements-${t}`,className:Ne,children:z.achievements}),b.jsx("textarea",{id:`projectAchievements-${t}`,name:"achievements",rows:"2",value:e.achievements,onChange:e=>bt(t,e),className:`${ke} min-h-[80px]`,placeholder:z.achievementsPlaceholder})]})]},t)),b.jsx("button",{type:"button",onClick:()=>{ot(e=>({...e,projects:[...e.projects,{...K,technologies:[""]}]}))},className:Se,children:z.addProject})]})]}),b.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[Dt("optimize",z.sectionOptimize),"optimize"===de&&b.jsxs("div",{id:"section-optimize",className:"p-3 sm:p-4 space-y-4",children:[b.jsx("p",{className:"text-sm text-blue-700 font-medium",children:z.optimizeIntro}),b.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[b.jsx("label",{htmlFor:"jobDescription",className:"block text-sm font-medium text-gray-700",children:z.jobDescription}),Ct(async()=>
2{if(vt())if(Ve.jobDescription.trim()){ee(!0);try{const{tailorResumeToJob:e}=await r(async()=>{const{tailorResumeToJob:e}=await import("./aiService-DZp17crU.js");return{tailorResumeToJob:e}},__vite__mapDeps([0,1,2,3,4])),t=await e({currentResume:JSON.stringify({personalInfo:Ve.personalInfo,experience:Ve.experience,education:Ve.education,skills:Ve.skills}),jobDescription:Ve.jobDescription,lang:st});if(await(D?.()),!t)return void l.error(z.tailorEmpty);const a=wt(t),n=a["PROFESSIONAL SUMMARY"]||"",i=a["WORK EXPERIENCE"]||"",s=a.SKILLS||"",o=Ve.experience.filter(e=>e.company||e.position),d=((e,t)=>{if(!e||t<=1)return e?[e]:[];const a=e.split(/\n\s*\n/).map(e=>e.trim()).filter(Boolean);return a.length===t?a:null})(i,o.length),c=Array.isArray(d)&&d.length===o.length,m=s.split(/[,;\n]/).map(e=>e.replace(/^[-â¢*\s]+/,"").trim()).filter(Boolean),u=[];if(n&&u.push(z.tailorChangeSummary),c&&u.push(ye(z,"tailorChangeExperience",o.length)),m.length>0&&u.push(z.tailorChangeSkills),0===u.length)return void l.error(z.tailorUnparsable);if(!window.confirm(fe(z.tailorConfirm,{changes:u.join(", ")})))return;const p=JSON.parse(JSON.stringify(Ve));if(n&&(p.personalInfo.summary=n),c){let e=0;p.experience=p.experience.map(t=>{if(!t.company&&!t.position)return t;const a=d[e++];return a?{...t,description:a}:t})}m.length>0&&(p.skills=m),ot(p),!c&&i?l(z.tailorPartial,{duration:6e3}):l.success(z.tailorDone)}catch(e){jt(e,z.tailorFailed)}finally{ee(!1)}}else l.error(z.tailorNeedJob)})]}),b.jsx("textarea",{id:"jobDescription",rows:"6",value:Ve.jobDescription,onChange:e=>{const{value:t}=e.target;ot(e=>({...e,jobDescription:t}))},className:`${ke} resize-y`,placeholder:z.jobDescriptionPlaceholder})]})]})]}),b.jsx("div",{className:"mt-6 space-y-3",children:Be?b.jsx("div",{className:"p-4 rounded-lg border border-blue-200 bg-blue-50 shadow-sm text-center",children:b.jsx("p",{className:"text-xs text-blue-800",children:z.guestCredits})}):b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"p-4 rounded-lg border border-blue-200 bg-blue-50 shadow-sm text-center",children:b.jsx("p",{className:"text-xs text-blue-700",children:v?z.creditsLoading:ye(z,"creditsRemaining",c)})}),b.jsx("div",{className:"p-4 rounded-lg border border-green-200 bg-green-50 shadow-sm text-center",children:b.jsx("p",{className:"text-xs text-green-700",children:v?z.downloadsLoading:y?z.downloadsUnlimited:ye(z,"downloadsRemaining",m)})})]})})]})}),b.jsx("div",{className:"w-full lg:w-1/2 "+("edit"===Z?"hidden lg:block":"block"),children:b.jsx("div",{className:"bg-white/95 shadow-xl backdrop-blur-lg rounded-lg flex flex-col",style:O?{width:"100%",height:"900px",padding:"1.5rem",position:"relative",overflow:"hidden"}:{width:"100%",padding:"0.5rem",position:"relative"},children:b.jsx("div",{className:"flex-1 bg-white rounded-lg "+(O?"overflow-hidden":""),style:{border:"1px solid #e5e7eb",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)",minHeight:"0"},children:Lt})})})]})}),b.jsx("div",{className:"lg:hidden fixed inset-x-0 bottom-0 z-40 border-t border-gray-200 bg-white/95 backdrop-blur-md",style:{paddingBottom:"env(safe-area-inset-bottom)"},children:b.jsx("div",{role:"tablist","aria-label":z.viewSwitchLabel,className:"max-w-md mx-auto grid grid-cols-2 gap-2 p-2",children:[["edit",z.viewEdit],["preview",z.viewPreview]].map(([e,t])=>b.jsx("button",{type:"button",role:"tab","aria-selected":Z===e,onClick:()=>(e=>{X(e),"undefined"!=typeof window&&window.scrollTo({top:0})})(e),className:"min-h-[44px] rounded-lg text-sm font-semibold transition-colors touch-manipulation "+(Z===e?"bg-blue-600 text-white shadow":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:t},e))})}),Rt,b.jsx(x,{}),b.jsx("div",{className:"h-16 lg:hidden","aria-hidden":"true"})]})};export{Ee as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.