!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="137a9a3b-50e0-429e-a34d-af3a8df04526",e._sentryDebugIdIdentifier="sentry-dbid-137a9a3b-50e0-429e-a34d-af3a8df04526")}catch(e){}}(),("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"v8.4"},(self.webpackChunkcvbuilder=self.webpackChunkcvbuilder||[]).push([[8094],{23128:(e,t,n)=>{n(63935);var a=n(64630),i=n(71112),o=n(87972),s=n(28657),r=n(66801),c=n(98363),l=n(92102),d=n(466);function u(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const p=(0,r.Ut)(!0);class f{constructor(){u(this,"generationResult",void 0)}getGenerationResult(){return this.generationResult}async processWorkflow(){if(this.generationResult=await this.documentGenerationRequest(),this.generationResult?.stream instanceof Blob){const e=await Promise.resolve().then(n.bind(n,466));if("string"==typeof this.generationResult.uploadToken&&this.generationResult.uploadToken.length){const t=await(0,c.dm)();if(!(t instanceof CryptoKey))throw new Error("No dek saved");const n=await this.generationResult.stream.arrayBuffer(),a=await(0,c.AW)(new Uint8Array(n),t),i=await this.computePreviewPdfBytes(),o=i?(await e.cPTI(i,{width:250,height:250*Math.sqrt(2)},1,[0]))[0]:void 0,s=await async function(e,t){if(t&&t?.size>5e4&&(t=await(0,l.$)(t,5e4))&&t.size>75e3&&(t=void 0),t){const n=await t.arrayBuffer(),a=await(0,c.AW)(new Uint8Array(n),e);return new Blob([a])}}(t,o);await(0,r.TV)(p,this.generationResult.uploadToken,new Blob([a]),s)}const t=await o.getPrivateMetadata();return e.downloadBlobFile(await this.downloadableBlob(),`${t?.documentName??"document"}.${this.downloadFileExtension()}`),!0}if(this.generationResult.upgradePrices)return!1;throw new Error("generateDocument returns invalid response")}}class A extends f{constructor(e,t,n,a){super(),this.jsonCV=e,this.templateCode=t,this.lang=n,this.docType=a}async documentGenerationRequest(){const e=(0,d.readApplicationIdFromUrl)();return await(0,r.XF)(p,this.jsonCV,this.templateCode,this.lang,this.docType,e)}async computePreviewPdfBytes(){return await(this.generationResult?.stream).arrayBuffer()}async downloadableBlob(){return this.generationResult?.stream}downloadFileExtension(){return"pdf"}}class h extends f{constructor(e,t,n,a){super(),this.jsonCV=e,this.templateCode=t,this.lang=n,this.docType=a,u(this,"docxArchive",void 0)}async documentGenerationRequest(){const e=(0,d.readApplicationIdFromUrl)(),t=await(0,r.N4)(p,this.jsonCV,this.templateCode,this.lang,this.docType,"PREFER_ATS",e);if(t.stream){const e=await Promise.all([n.e(9329),n.e(7466)]).then(n.bind(n,52228));this.docxArchive=await e.parseDocxArchive(new Uint8Array(await t.stream.arrayBuffer()))}return t}async computePreviewPdfBytes(){return this.docxArchive?.pdfFile??null}async downloadableBlob(){const e=new((await Promise.all([n.e(9329),n.e(7330)]).then(n.bind(n,24949))).DocumentBundle);return await e.addDocxDocument(this.docType,this.docxArchive),await e.bundleDocuments()}downloadFileExtension(){return"zip"}}class g extends h{async documentGenerationRequest(){const e=(0,d.readApplicationIdFromUrl)(),t=await(0,r.N4)(p,this.jsonCV,this.templateCode,this.lang,this.docType,"PREFER_FIDELITY",e);if(t.stream){const e=await Promise.all([n.e(9329),n.e(7466)]).then(n.bind(n,52228));this.docxArchive=await e.parseDocxArchive(new Uint8Array(await t.stream.arrayBuffer()))}return t}}async function m(e,t,a,i){const{forceSerializedCvDataUpdate:o,forceApplicantImageUpdate:r}=await Promise.resolve().then(n.bind(n,88013));sessionStorage.setItem(s.JM,JSON.stringify(e.upgradePrices)),await o(),t.applicantImage?.length&&await r(),location.href=function(e,t,n){const a=location.pathname.split("/")[1],i=function(e,t,n,a){const i=new URLSearchParams;return e&&i.append("applicationId",e),t&&i.append("docType",t),a&&i.append("docFormat",a),i.toString()}(e,t,0,n);return`${location.origin}/${a}/checkout/select-plan.html?${i}`}((0,d.readApplicationIdFromUrl)(),a,i)}const w=JSON.parse('{"ru":{"microsoft-word":"Microsoft Word","pdf-document":"PDF \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442","libre-office":"Libre Office \u0438 \u043f\u0440\u043e\u0447\u0438\u0435"},"en":{"microsoft-word":"Microsoft Word","pdf-document":"PDF Document","libre-office":"Libre Office & Co"},"de":{"microsoft-word":"Microsoft Word","pdf-document":"PDF Dokument","libre-office":"Libre Office & andere"}}');var v=n(66841),C=n(28390);const y=JSON.parse('{"ru":{"CDN_FONT_ERROR":{"cdnErrorTitle":"Font download failed","cdnErrorText":"Some font files could not be downloaded. Please try again later"}},"en":{"CDN_FONT_ERROR":{"cdnErrorTitle":"Font download failed","cdnErrorText":"Some font files could not be downloaded. Please try again later"}},"de":{"CDN_FONT_ERROR":{"cdnErrorTitle":"Font download failed","cdnErrorText":"Some font files could not be downloaded. Please try again later"}}}'),E=JSON.parse('{"ru":{"title":"\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 ATS","text":"\u042d\u0442\u0430 \u0432\u0435\u0440\u0441\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0434\u043b\u044f LibreOffice. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u043e\u0432 (ATS) \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u0435\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435. \u0414\u043b\u044f \u043f\u043e\u0434\u0430\u0447\u0438 \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u0438\u0439 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e Microsoft Word. \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0434\u043b\u044f LibreOffice?","yes":"\u0414\u0430","no":"\u041d\u0435\u0442"},"en":{"title":"ATS Compatibility Warning","text":"This version is optimized for LibreOffice. However, some Applicant Tracking Systems (ATS) may not fully read its content. For job applications, we recommend using the Microsoft Word version instead. Do you want to continue with LibreOffice version?","yes":"Yes","no":"No"},"de":{"title":"ATS-Kompatibilit\xe4tswarnung","text":"Diese Version ist f\xfcr LibreOffice optimiert. Einige Bewerbermanagementsysteme (ATS) k\xf6nnen den Inhalt jedoch m\xf6glicherweise nicht vollst\xe4ndig lesen. F\xfcr Bewerbungen empfehlen wir die Microsoft Word-Version. M\xf6chten Sie mit der LibreOffice-Version fortfahren?","yes":"Ja","no":"Nein"}}');var b=n(69766);function D(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var S=new WeakSet;class I extends i.cD{constructor(){var e;super(),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(this,e=S),e.add(this),D(this,"actionBtn",void 0),D(this,"onDownload",void 0),this.attachShadow({mode:"open"}),(0,v.YW)('
{{libre-office}}
{{microsoft-word}}
{{pdf-document}}
',w,this.shadowRoot),(0,v.Xg)(this.shadowRoot,b.A,C.A),this.actionBtn=this.shadowRoot?.querySelector(".action-button")}connectedCallback(){if(!this.shadowRoot)throw new Error("Shadowroot not initialized");$(document).on("click",(e=>{this.actionBtn.classList.contains("is-open")&&this.closeActions(this.actionBtn)})),$(this.actionBtn).on("click",(e=>{e.stopPropagation();const t=e.currentTarget;$(t).hasClass("is-open")||this.openActions(this.actionBtn)}));const e=this;$(this.shadowRoot).find("[data-action]").on("click",(async function(t){if(e.actionBtn.classList.contains("is-open"))switch(t.stopImmediatePropagation(),this.getAttribute("data-action")){case"docx-download":e.onDownload?.("DOCX");break;case"pdf-download":e.onDownload?.("PDF");break;case"libreoffice-download":e.onDownload?.("LIBRE_OFFICE")}}))}openActions(e){const t=e.querySelector(".action-list"),n=t.clientWidth,a=t.clientHeight;function i(){e.style.transition="all 0.3s ease",t.style.transition="all 0.3s ease",e.style.marginRight="0px",t.style.marginRight="0px",e.style.width=n+"px",e.style.height=a+"px",e.style.borderRadius="0",e.style.backgroundColor="rgb(255, 255, 255)",t.style.opacity="1"}e.classList.add("is-open"),requestAnimationFrame((function(){const a=n/2-30;t.style.transition="margin-right 0.15s ease",e.style.transition="margin-right 0.15s ease",t.style.marginRight=-a+"px",e.style.marginRight=a+"px",$(e).one("transitionend",i)}))}async closeActions(e){const t=e.querySelector(".action-list"),n=t.clientWidth;t.clientHeight,e.classList.remove("is-open"),await new Promise((a=>{requestAnimationFrame((function(){const i=n/2-30;e.style.transition="all 0.3s ease",t.style.transition="all 0.3s ease",e.style.marginRight=i+"px",t.style.marginRight=-i+"px",e.style.width="",e.style.height="",e.style.borderRadius="",e.style.backgroundColor="",t.style.opacity="",$(t).one("transitionend",(()=>{t.style.transition="margin-right 0.15s ease",e.style.transition="margin-right 0.15s ease",t.style.marginRight="",e.style.marginRight="",a()}))}))}))}async downloadDocument(e,t){if(!(0,a.isLoggedIn)())return await x(S,this,T).call(this,e,t),void this.closeActions(this.actionBtn);const i=await(0,o.getTemplateCode)(),s=await(0,o.getLang)(),r=this.getAttribute("data-mode");try{switch(await x(S,this,z).call(this),t){case"PDF":await async function(e,t,n,a){const i=new A(e,t,n,a);await i.processWorkflow()||await m(i.getGenerationResult(),e,a,"PDF")}(e,i,s,r);break;case"DOCX":await B((async()=>await async function(e,t,n,a){const i=new h(e,t,n,a);await i.processWorkflow()||await m(i.getGenerationResult(),e,a,"DOCX")}(e,i,s,r)));break;case"LIBRE_OFFICE":await async function(){const{SweetAlert:e}=await Promise.all([n.e(8465),n.e(4884),n.e(887)]).then(n.bind(n,43268)),t=E,a=t[location.pathname.split("/")[1]]??t.en??Object.values(t)[0];return(await e.fire({title:a.title,text:a.text,heightAuto:!1,allowEnterKey:!1,showDenyButton:!0,confirmButtonText:a.yes,denyButtonText:a.no,focusConfirm:!1,scrollbarPadding:!1})).isConfirmed}()&&await B((async()=>await async function(e,t,n,a){const i=new g(e,t,n,a);await i.processWorkflow()||await m(i.getGenerationResult(),e,a,"LIBRE_OFFICE")}(e,i,s,r)));break;default:throw new Error(`Invalid document format ${t}`)}}finally{x(S,this,L).call(this)}}}async function z(){await this.closeActions(this.actionBtn),this.actionBtn.style.transform="transition: background-color .5s ease",$(this.actionBtn).attr("disabled","")}function L(){$(this.actionBtn).removeAttr("disabled")}async function T(e,t){const a=await Promise.all([n.e(1338),n.e(1501)]).then(n.bind(n,59773)),i=await a.injectLoginSignupModal((()=>this.downloadDocument(e,t)));await i.modalBody().get(0).prefillSignupDataFromLocalCache(),i.showModal()}async function B(e){const{CDNFontError:t}=await Promise.all([n.e(9329),n.e(7330)]).then(n.bind(n,24949));try{await e()}catch(e){throw e instanceof t&&async function(){(await Promise.all([n.e(8465),n.e(4884),n.e(887)]).then(n.bind(n,43268))).showMessageJson(y,"CDN_FONT_ERROR","error")}(),e}}(0,i.Jp)(I),customElements.define("download-btn",I)},6419:(e,t,n)=>{n.d(t,{Bl:()=>c,Ix:()=>v,UH:()=>m,XD:()=>l,Yn:()=>u,hS:()=>A,ks:()=>d,t4:()=>p});var a=n(45950),i=n(91192),o=n(64630),s=n(90277),r=n(53308);function c(e,t=!1){return(0,a.Ar)(e,i.sx.AI_SERVICE_ID,v,t)}async function l(e,t){const n=h(t),{data:a,error:i,response:o}=await e.PUT("/ai/cv/objective",{body:{...n,mapToWysiwygHtml:!1},parseAs:"text"});return(0,s.VL)("OBJECTIVE"),f(a,o)}async function d(e,t){const{data:n,error:a,response:i}=await e.PUT("/ai/cv/experience",{body:{...t,mapToWysiwygHtml:!0},parseAs:"text"});return(0,s.VL)("EXPERIENCES"),f(n,i)}async function u(e,t,n,a){const i=h(t);i.existingSkills=i.existingSkills?.slice(0,10);const{data:o,error:r,response:c}=await e.PUT("/ai/cv/skills",{body:i,params:{query:{hardSkills:n,softSkills:a}}});return(0,s.VL)("SKILLS"),f(o,c)}async function p(e,t){const n=h(t),{data:a,error:i,response:o}=await e.PUT("/ai/cover",{body:{...n,mapToWysiwygHtml:!0},parseAs:"text"});return(0,s.VL)("COVER_LETTER"),f(a,o)}function f(e,t){const n=t.headers.get("x-sponjobs-data")?.split(";");return{response:e,creditsConsumed:n instanceof Array?parseFloat(n[0]):void 0,creditsLeft:n instanceof Array?parseFloat(n[1]):void 0}}async function A(e,t,a){if(await async function(){if(!(0,o.isLoggedIn)()){const e=await Promise.resolve().then(n.bind(n,88013));await e.forceApplicantImageUpdate(),await e.forceSerializedCvDataUpdate(),await(0,o.logout)()}}(),!t.lang?.length)throw new Error("No language set");if("string"==typeof(s=t.profession)&&s.length||((0,r.GJ)(),0))try{const n=await a(e,t);return"number"==typeof n.creditsConsumed&&"number"==typeof n.creditsLeft&&(0,r.dh)(n.creditsConsumed,n.creditsLeft),n.response}catch(e){throw e instanceof i.hD&&e.errorCode===v.INVALID_PROFESSION&&(0,r.GJ)(),e}var s}function h(e){return{...e,educationExperiences:g(e.educationExperiences),workExperiences:g(e.workExperiences)}}function g(e){return e?.filter((e=>e.experienceTitle&&e.institutionName)).map((e=>{const t=m(e);return{experienceTitle:e.experienceTitle,institutionName:e.institutionName,monthsExperience:t}}))}function m(e){const t=new Date,n=w(e.beginDate),a=e.isOpenExperience?t:w(e.endDate);let i=a&&n?Math.floor((a.getTime()-n.getTime())/2592e6):void 0;return"number"==typeof i&&i<0&&(i=void 0),i}function w(e){try{const t=e?new Date(e):void 0;return t instanceof Date&&!isNaN(t.getTime())?t:void 0}catch{return}}let v=function(e){return e.NOT_ENOUGH_AI_CREDITS="NOT_ENOUGH_AI_CREDITS",e.INVALID_PROFESSION="INVALID_PROFESSION",e}({})},90277:(e,t,n)=>{async function a(e){await r("ai-generation",{type:e})}async function i(e){await r("login"),"function"==typeof gtag&&"string"==typeof e&&e.length&>ag("set",{user_id:e})}async function o(){await r("invalid_email")}async function s(e){await r("sign_up"),"function"==typeof gtag&&"string"==typeof e&&e.length&>ag("set",{user_id:e})}function r(e,t=null,n=2e3){return new Promise(((a,i)=>{if("function"==typeof gtag){let i=()=>{i=null,a()},o={send_to:"G-1PRE4VJ0HY",event_timeout:n,event_callback:()=>i?.()};t&&(o=Object.assign({},o,t)),gtag("event",e,o),setTimeout((()=>i?.()),n)}else a()}))}n.d(t,{VL:()=>a,XF:()=>o,wp:()=>s,x5:()=>i})},87972:(e,t,n)=>{n.r(t),n.d(t,{ReferencesMode:()=>Z,clearApplicantImage:()=>z,forceSetStyle:()=>q,forceSetTemplateCode:()=>G,getApplicantImage:()=>T,getCoverLetterData:()=>U,getCustomCaptions:()=>$,getCvData:()=>F,getLang:()=>R,getPictureSelectorSettings:()=>B,getPrivateMetadata:()=>k,getReferences:()=>V,getSignature:()=>H,getStyles:()=>j,getTemplateCode:()=>P,initializeGetStorageData:()=>E,referencesToCvBuilderRequest:()=>Y,setApplicantImage:()=>I,setCoverLetterData:()=>D,setCustomCaptions:()=>M,setCvData:()=>b,setLang:()=>x,setPictureSelectorSettings:()=>L,setReferences:()=>O,setSignature:()=>_,setStyles:()=>N,setTemplateCode:()=>S});var a=n(66801),i=n(46778),o=n(88013),s=n(93365),r=n(466),c=n(64630),l=n(91192);const d="cvDataLocalCache",u="coverLetterDataLocalCache",p="templateCodeCache",f="force_templateCodeCache",A="signatureCache",h="styleCache",g="force_styleCache",m="referencesCache",w="cvLanguageCache";let v,C,y;function E(){y??=(async()=>{const e=(0,a.Ut)(!1),t=(0,r.readApplicationIdFromUrl)();if(t&&!(0,c.isLoggedIn)())return(0,c.redirectToLoginPage)(location.pathname),void await new Promise((()=>{}));let n;try{n=await(0,a.em)(e,"first"!==t?t:void 0)}catch(e){if(e instanceof l.hD&&e.errorCode===a.ko.INVALID_DOCUMENT_ID){const e=location.pathname.split("/")[1];return location.href=`https://${location.hostname}/${e}/app/downloads.html`,void await new Promise((()=>{}))}throw e}if((0,o.setApplicationId)(t),n){const[e,t]=await(0,i.xQ)(n);v=e,C=t??null,await(0,o.initialApplicantImage)(t),(0,o.initialSerializedCvData)(e)}v??=new i.Uo,v.storageData??=new i.MA,v.storageData.cvData??=Q(d),v.storageData.coverLetterData??=Q(u),v.lang??=sessionStorage.getItem(w),v.templateCode=function(){const e=sessionStorage.getItem(f);return sessionStorage.removeItem(f),e}()??v.templateCode??sessionStorage.getItem(p),v.storageData.signature??=Q(A),v.storageData.references??=Q(m),v.storageData.style??=Q(h),function(e){const t=Q(g);sessionStorage.removeItem(g),"string"!=typeof t?.templateCode||!t?.style||(e.templateCode=t.templateCode,e.storageData.style??={},e.storageData.style[t?.templateCode]=t?.style)}(v)})()}async function b(e,t=!1){if(t)sessionStorage.setItem(d,JSON.stringify(e));else{await y;const t=await H();W((()=>{v.storageData.cvData=J(e),v.cvCompleteness=(0,s.x)(e,t),v.privateMetadata??=new i.VI,v.privateMetadata.applicantFirstName=e?.aboutApplicant?.firstName,v.privateMetadata.applicantLastName=e?.aboutApplicant?.lastName}))}}async function D(e,t=!1){if(t)sessionStorage.setItem(u,JSON.stringify(e));else{await y;const t=await H();W((()=>{v.storageData.coverLetterData=J(e),v.coverLetterCompleteness=(0,s.N)(e,t)}))}}async function x(e,t=!1){t?sessionStorage.setItem(w,e):(await y,W((()=>v.lang=e)))}async function S(e,t=!1){t?sessionStorage.setItem(p,e):(await y,W((()=>v.templateCode=e)))}async function I(e){e instanceof Blob&&(C=e,await(0,o.applicantImageUpdate)(e))}function z(){C=null,(0,o.applicantImageUpdate)(void 0)}async function L(e){await y,W((()=>v.storageData.pictureSelectorSettings=J(e)))}async function T(){return await y,C}async function B(){return await y,J(v?.storageData?.pictureSelectorSettings)}async function k(){return await y,J(v?.privateMetadata)}async function R(){return await y,v?.lang||(0,r.getLangaugeCodeFromQueryParameters)()}async function P(){return await y,v?.templateCode}async function _(e,t=!1){if(t)sessionStorage.setItem(A,JSON.stringify(e));else{await y;const t=await F(),n=await U();W((()=>{v.storageData.signature=J(e),t&&(v.cvCompleteness=(0,s.x)(t,e)),n&&(v.coverLetterCompleteness=(0,s.N)(n,e))}))}}async function O(e,t=!1){t?sessionStorage.setItem(m,JSON.stringify(e)):(await y,W((()=>v.storageData.references=J(e))))}async function N(e,t=!1){t?sessionStorage.setItem(h,JSON.stringify(e)):(await y,W((()=>v.storageData.style=J(e))))}async function M(e){W((()=>v.customCaptions=J(e)))}async function F(){return await y,J(v?.storageData?.cvData)??null}async function U(){return await y,J(v?.storageData?.coverLetterData)??null}async function H(){return await y,J(v?.storageData?.signature)}async function V(){return await y,v?.storageData?.references}async function j(){return await y,J(v?.storageData?.style)}async function $(){return await y,J(v?.customCaptions)}function W(e){v??=new i.Uo,v.storageData??=new i.MA,e(),(0,o.serializedCvDataUpdate)(v)}function J(e){if(void 0!==e)return JSON.parse(JSON.stringify(e))}function G(e){sessionStorage.setItem(f,e)}function q(e,t){t?sessionStorage.setItem(g,JSON.stringify({templateCode:e,style:t})):sessionStorage.removeItem(g)}function Q(e){const t=sessionStorage.getItem(e);return t?.length?JSON.parse(t):void 0}function Y(e){if(e)switch(e.mode){case Z.DO_NOT_SHOW:return;case Z.ON_DEMAND:return{areAvailable:!1};case Z.SHOW:return{areAvailable:!0,references:e.references?.length?e.references:void 0};default:throw new Error(`${e.mode} is an invalid referencemode`)}}let Z=function(e){return e.DO_NOT_SHOW="DO_NOT_SHOW",e.ON_DEMAND="ON_DEMAND",e.SHOW="SHOW",e}({})},66841:(e,t,n)=>{function a(e,t){let n;if(e.adoptedStyleSheets??=[],t instanceof CSSStyleSheet)n=t;else{if("function"!=typeof t)return;n=t()}e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]}function i(e,...t){t?.length&&t.forEach((t=>a(e,t)))}function o(e,t,n){const a=function(e,t){const n=function(e){const t=(new DOMParser).parseFromString(e,"text/html");return{body:t.body,stylesAndLinks:t.querySelectorAll("style, link")}}(e),a=t[location.pathname.split("/")[1]]??t.en??Object.values(t)[0],i=document.createTreeWalker(n.body,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>NodeFilter.FILTER_ACCEPT});let o=i.currentNode;for(;o;){if(o.nodeType===Node.ELEMENT_NODE){const e=o;e.innerHTML.length&&(e.innerHTML=e.innerHTML.replace(/\{{2}([A-Za-z0-9\.\-\_]+)\}{2}/gm,((e,t)=>a[t]??e)));const t=e.attributes.length;for(let n=0;na[t]??e)))}}o=i.nextNode()}return n}(e,t);a.stylesAndLinks.forEach((e=>n.appendChild(e))),n.appendChild(a.body)}function s(e,t){const n=t[location.pathname.split("/")[1]]??t.en??Object.values(t)[0];return e.replace(/\{{2}([A-Za-z0-9\.\-\_]+)\}{2}/gm,((e,t)=>n[t]??e))}n.d(t,{UQ:()=>a,Xg:()=>i,YW:()=>o,bN:()=>s}),n(4876)},53308:(e,t,n)=>{function a(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){document.addEventListener(l.AiCreditsEvent,e)}function o(e,t){document.dispatchEvent(new c(e,t))}function s(e){document.addEventListener(l.AiInvalidProfessionEvent,e)}function r(){document.dispatchEvent(new Event(l.AiInvalidProfessionEvent))}n.d(t,{GJ:()=>r,Ii:()=>i,L:()=>s,dh:()=>o});class c extends Event{constructor(e,t){super(l.AiCreditsEvent),a(this,"consumedCredits",void 0),a(this,"creditsCount",void 0),this.consumedCredits=e,this.creditsCount=t}}let l=function(e){return e.AiCreditsEvent="ai-credits",e.AiInvalidProfessionEvent="ai-invalid-profession",e}({})},466:(e,t,n)=>{n.r(t),n.d(t,{cPTI:()=>S,calculateEmailMarketingData:()=>g,calculateInitialsData:()=>I,computeJsonChecksum:()=>z,computeStaticPreviewCvUrl:()=>T,cvPreview:()=>b,downloadBlobFile:()=>B,downloadFileFromDataUrl:()=>L,fillMissingDataInCacheWithDefaultLanguageData:()=>N,fireGAEvent:()=>m,firePreviewCreatedEvent:()=>v,getActivePromoCode:()=>y,getLangaugeCodeFromQueryParameters:()=>R,getLanguageData:()=>O,getStaticFontsSVG:()=>M,increaseCVPreviewsCountInIndexDb:()=>C,injectCss:()=>d,onDomContentLoaded:()=>l,previewPictures:()=>D,previewPicturesErrorHandler:()=>x,readApplicationIdFromUrl:()=>h,showErrorMsg:()=>w,updatePromoCodeValidity:()=>E,validateBase64:()=>p,validateEmail:()=>u,validateFirstAndLastName:()=>A,validatePassword:()=>f});var a=n(28657);const i=new Date,o=20,s=3e5;let r,c=0;function l(e){"function"==typeof e&&document.addEventListener("DOMContentLoaded",e)}function d(e){$(`link[href="${e}"]`).length||$("",{rel:"stylesheet",href:e}).appendTo($("head"))}function u(e){return"string"==typeof e&&!!e.length&&/^(?:(?:[a-zA-Z0-9_'^&/+-]+(?:\.[a-zA-Z0-9_'^&/+-]+)*)|"(?:[a-zA-Z0-9_'^&/+-]+(?:\.[a-zA-Z0-9_'^&/+-]+)*)")@(?:(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}|(?:\d{1,3}\.){3}\d{1,3})(?::\d+)?$/.test(e.toLowerCase())}function p(e){return!(!e?.length||""===e.trim())&&/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)}function f(e){return"string"==typeof e&&e.length>=4}function A(e){return!!e?.length&&/^[\p{L} ,.'-]+$/u.test(e)}function h(){const e="applicationId",t=new URLSearchParams(location.search);if(!t.has(e))return;const n=t.get(e);return n&&("first"===n||/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(n))?n:void 0}function g(){const e=localStorage.getItem(a.W3),t=Intl.DateTimeFormat().resolvedOptions().timeZone;return e?.length?{signupSegment:e,ianaTimezone:t}:void 0}function m(e,t=null){if("function"==typeof gtag){let n={send_to:"G-1PRE4VJ0HY"};t&&(n=Object.assign({},n,t)),gtag("event",e,n)}}function w(e,t,n="error"){d("https://cdn.jsdelivr.net/npm/sweetalert2@11.7.2/dist/sweetalert2.min.css"),import("https://cdn.jsdelivr.net/npm/sweetalert2@11.7.2/dist/sweetalert2.all.min.js").then((a=>Sweetalert2.fire({titleText:e,text:t,icon:n,toast:!0,position:"bottom-end",timer:5e3,heightAuto:!1})))}function v(e){m("preview_created",{cv_template_code:e}),c++,c>o&&Math.abs((new Date).getTime()-i.getTime())>s&&!localStorage.getItem("interested_user_evt_fired")&&(m("interested_user"),localStorage.setItem("interested_user_evt_fired","true"))}async function C(e="CV"){const{isLoggedIn:t,getLoginDetails:a}=await n.e(1045).then(n.bind(n,64630));if(t()){const t=await Promise.all([n.e(4179),n.e(4069)]).then(n.bind(n,74025));r||=new t.DexieDAO(a().userId);const i=await r.getStatisticsDao();await i.registerCVPreview(e)}}function y(){let e=localStorage.getItem(COUPON_CACHE);if(e&&(e=JSON.parse(e))&&"string"==typeof e.promoCode&&(!e.expiryDate||new Date(e.expiryDate).getTime()>=(new Date).getTime()))return e}function E(e){let t=localStorage.getItem(COUPON_CACHE);"number"==typeof e&&e>0&&t&&(t=JSON.parse(t))&&"string"==typeof t.promoCode&&(!t.expiryDate||new Date(t.expiryDate).getTime()>=(new Date).getTime())&&(t.expiryDate??=(new Date).getTime()+1e3*e,localStorage.setItem(COUPON_CACHE,JSON.stringify(t)))}function b(e,t,a,i=333,o="CV"){n.e(7155).then(n.bind(n,97155)).then((e=>e.loadPdfJs()));const s=new XMLHttpRequest;let r;switch(o){case"CV":r=`${apiBaseURL}/resume/preview2`;break;case"COVER_LETTER":r=`${apiBaseURL}/resume/coverletter`;break;default:throw`Preview ${o} not implemented`}return s.open("PUT",r),s.responseType="arraybuffer",s.setRequestHeader("x-sponjobs-language",t),s.setRequestHeader("x-sponjobs-templatecode",e),s.setRequestHeader("x-sponjobs-data",i.toString()),s.setRequestHeader("Content-Type","application/json"),s.setRequestHeader("Accept","application/json, application/pdf"),new Promise(((e,t)=>{s.onload=async function(){this.status>=200&&this.status<300?e(s):t({status:this.status,response:s.response})},s.onerror=function(){t({status:this.status,response:s.response})},s.send("string"==typeof a?a:JSON.stringify(a))}))}async function D(e,t){const n=e.getResponseHeader("x-sponjobs-data");n&&Number(n)>t.getIdempotenceId()&&(await t.addPicturesViaCPTI(e.response),t.setIdempotenceId(Number(n)))}async function x(e,t,n){const a=await O();throw e.showErrorMessage(a.error.templateViewer.GENERIC),m("preview_failed",{cv_template_code:n}),t}async function S(e,t=null,a=2,i){const o=await n.e(7155).then(n.bind(n,97155)),s=await o.constructCPTI(e,t,a),r=[];for(let e=0;e!!e&&e.length)).map((e=>e.charAt(0).toUpperCase())).join("");let a,i;if(!n?.length)return{initials:n,initialBgcColor:"#f7d7d1",initialTxtColor:"#d52727"};switch((n.charCodeAt(0)<<16|n.charCodeAt(1))%7){case 0:a="#d2e6f6",i="#2971bf";break;case 1:a="#daeeda",i="#508335";break;case 2:a="#dddbed",i="#766cba";break;case 3:a="#f7d7d1",i="#d52727";break;case 4:a="#f5d3e0",i="#cf3074";break;case 5:a="#f0e2d8",i="#b95a3c";break;default:a="#292dc2",i="#ffffff"}return{initials:n,initialBgcColor:a,initialTxtColor:i}}function z(e){const t=function(e){return Array.isArray(e)?JSON.stringify(e.map((e=>t(e)))):"number"==typeof e?e.toString():"object"==typeof e&&null!==e?Object.keys(e).sort().map((n=>`${n}:${t(e[n])}`)).join("|"):e};return function(e,t=0){let n=3735928559^t,a=1103547991^t;for(let t,i=0;i>>16,2246822507)^Math.imul(a^a>>>13,3266489909),a=Math.imul(a^a>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&a)+(n>>>0)}(t(e))}function L(e,t){const n=document.createElement("a");n.href=e,n.target="_blank",n.download=t,n.click(),n.remove()}function T(e,t,n=!0){const i=`${a.ES}/cvs/${R()}/%templateCode%/col%d%.webp`,o=n?`${t}_thbn`:t.toString();return i.replace("%templateCode%",e).replace("%d%",o)}function B(e,t){const n=URL.createObjectURL(e);try{L(n,t)}finally{"string"==typeof n&&n.length&&URL.revokeObjectURL(n)}}const k={en:"ENGLISH",ru:"RUSSIAN",de:"GERMAN"};function R(){let e=location.pathname.split("/")[1];return e in k?k[e]:(e=document.documentElement.getAttribute("data-lang"),e&&e in k?k[e]:"ENGLISH")}let P,_;async function O(){return P??=await(await fetch(`/assets/cv_data/data-${location.pathname.split("/")[1]}.json`)).json(),P}async function N(e,t,a){const i=await Promise.all([n.e(1045),n.e(7972)]).then(n.bind(n,87972)),o=!!await i.getCvData(),s=!!await i.getCoverLetterData(),r=!!await i.getSignature();if(e&&!o||t&&!s||a&&!r){const n=await O();a&&!r&&await i.setSignature(n.signature),e&&!o&&await i.setCvData(n.exampleData),t&&!s&&await i.setCoverLetterData(n.coverLetterData)}}async function M(){return _??=async function(){const e=await fetch(`${a.ES}/fonts/fonts.svg`,{cache:"no-cache"}),t=await e.text(),n=$(t);return n.addClass("d-none"),n.appendTo($("body")),n}(),await _}window.sjHelpers={trackFbqEvent:function(e,t=null){"function"==typeof fbq&&(t?fbq("track",e,t):fbq("track",e))},getType:function(e,t){return"number"===e?!isNaN(parseFloat(t))&&isFinite(t):Object.prototype.toString.call(t).slice(8,-1).toLowerCase()===e.toLowerCase()},isObject:function(e){return this.getType("object",e)},isArray:function(e){return this.getType("array",e)},isString:function(e){return this.getType("string",e)},isNumeric:function(e){return this.getType("number",e)},isUndefined:function(e){return this.getType("undefined",e)},isBoolean:function(e){return this.getType("boolean",e)},isFunction:function(e){return this.getType("function",e)}}},88013:(e,t,n)=>{n.r(t),n.d(t,{applicantImageUpdate:()=>k,forceApplicantImageUpdate:()=>T,forceSerializedCvDataUpdate:()=>L,getApplicantImageData:()=>D,getSerializedCvData:()=>b,initialApplicantImage:()=>w,initialSerializedCvData:()=>m,noUpgradeRequestTransaction:()=>C,serializedCvDataUpdate:()=>B,setApplicationId:()=>g});var a=n(66801),i=n(46778),o=n(98363),s=n(85498),r=n(8799);function c(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class l{constructor(){c(this,"lastDataUploadDateTime",new Date),c(this,"lastUploadedChecksum",void 0)}intervalHasPassedSinceLastUpload(e){return!!this.lastDataUploadDateTime&&Math.abs(this.lastDataUploadDateTime.getTime()-(new Date).getTime())>e}isStaleData(e){return void 0===this.lastUploadedChecksum||this.lastUploadedChecksum!==e}updateChecksum(e){this.lastUploadedChecksum=e}markUpload(){this.lastDataUploadDateTime=new Date}}let d;const u=new l,p=new Blob(["IMAGE_DELETION"]);let f;const A=new l;let h;function g(e){if(e&&"first"!==e.toLowerCase()){if(!/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e))throw new Error(`Invalid application id ${e}`);h=e}}function m(e){e&&(u.updateChecksum(e.computeChecksum()),u.markUpload())}async function w(e){A.updateChecksum(await(0,s.N7)(e??p)),A.markUpload()}let v=!1;async function C(e){try{v=!0,await e()}catch(e){}finally{v=!1}}const y=new Map,E=(0,a.Ut)(!1);function b(){return d}function D(){return f}async function x(e){if(e instanceof i.Uo){(0,r.Um)(r.oR.DataUploadBegin);try{u.markUpload();const t=await o.Ku();if(!t)throw new Error("UserKey is null");const n=await e.toPdfDataCacheApi(t);n.authUserDocumentId=h,await(0,a.XK)(E,n),u.markUpload()}finally{(0,r.Um)(r.oR.DataUploadEnd)}}}async function S(e){if(e instanceof Blob){(0,r.Um)(r.oR.DataUploadBegin);try{if(A.markUpload(),e!==p){const t=await o.Ku();if(!t)throw new Error("UserKey is null");const n=await e.arrayBuffer(),i=await o.AW(new Uint8Array(n),t);await(0,a.bQ)(E,new Blob([i]),e.type,h)}else await(0,a.dy)(E,h);A.markUpload()}finally{(0,r.Um)(r.oR.DataUploadEnd)}}}async function I(e){const t=y.get(e);t instanceof Promise&&await t}setInterval((async()=>{v||await L()}),1e4),setInterval((async()=>{v||await T()}),1e4);const z=new Map;async function L(){if(v)throw new Error("Not allowed to force update during no update request mode!");await I(x);const e=d;d=void 0,await x(e)}async function T(){if(v)throw new Error("Not allowed to force update during no update request mode!");await I(S);const e=f;f=void 0,await S(e)}async function B(e){await R((e=>e.computeChecksum()),u,x,(e=>d=e),e)}async function k(e){await R(s.N7,A,S,(e=>f=e),e??p)}async function R(e,t,n,a,i){if(i){const o=await e(i),s=z.get(n);if(void 0===s)throw new Error("uploadFunc must be either putData or putApplicantImage");if(s)return void(t.isStaleData(o)&&(t.updateChecksum(o),a(i)));try{if(z.set(n,!0),t.intervalHasPassedSinceLastUpload(1e4)&&t.isStaleData(o)&&!v){t.updateChecksum(o),a(void 0);const e=n(i);y.set(n,e),e.finally((()=>y.delete(n)))}else t.isStaleData(o)&&(t.updateChecksum(o),a(i))}finally{z.set(n,!1)}}}z.set(x,!1),z.set(S,!1)},42021:(e,t,n)=>{n.d(t,{Q:()=>u});var a=n(79090),i=(n(63935),n(64630));const o=`