Как это работает: "var Rb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n};const $b=e=>{var t;const n=null!==(t=null==e?void 0:e.kindActivity)&&void 0!==t?t:{},{info:r}=n,a=Rb(n,["info"]);return Object.assign(Object.assign({},a),r)},Fb=({token:e,locale:t,isMobile:r})=>{const[a,o]=(0,n.useState)(!1),[i,s]=(0,n.useState)(null),[l,u]=(0,n.useState)(void 0),[c,d]=(0,n.useState)({}),[p,f]=(0,n.useState)(!1),[h,m]=(0,n.useState)(void 0),[g,y]=(0,n.useState)(),[v,b]=(0,n.useState)(void 0),[M,w]=(0,n.useState)(null);(0,n.useLayoutEffect)((()=>{const{schema:e,options:t}=zb;s(e),d(t)}),[]);const E=(0,n.useMemo)((()=>JSON.stringify(l)),[l]),S=!!h||void 0,N=cd({locale:t,tpl:wl.PanelTitle}),j=(e={})=>{const{isValid:t,validation:n}=e;y(n),f(t),console.debug("Forms onValidate",{isValid:t,validation:n})};(0,n.useEffect)((()=>{b({onValidate:void 0!==l?j:void 0})}),[E]);const k=()=>{o(!0);const t=$b(l);var n;(n=Object.assign(Object.assign({},t),{token:e}),Kn.post(`${CONFIG.API.Auth}/extra/education`,n)).then((e=>{"redirect"in e&&(document.location.href=e.redirect)})).catch((e=>{if((null==e?void 0:e.response)&&"status"in e.response){const{status:t}=e.response;t&&w(t)}})).finally((()=>o(!1)))},D={onDictQueryReq:pf,onDictResolveReq:ff,startLoading:at,stopLoading:ot},x=!!i,L=500===M;return n.createElement(Zd,{title:N,className:Pb},x?n.createElement(ob,Object.assign({},v,{schema:i,data:l,uioptions:Object.assign(Object.assign({},_b),{options:c,locale:t,isMobile:!0}),onChange:(e,t={})=>{u(e),h&&m(void 0)},validation:g,onActions:D,showErrorMsg:S})):null,n.createElement(sa,{mode:"primary",disabled:!p,onAction:k,loading:a},n.createElement(yd,{k:"App.ExtraEdication.SaveBtn"})),L&&n.createElement(gf,{className:Pb.el("modal"),onAction:()=>{w(null),k()},onClose:()=>w(null),sizeBtn:r?"l":"s",actionBtnK:"App.Modal.TryAgain",cancelBtnK:"App.ExtraEdication.BackToEdit",orientedButtons:r?"vertical-reverse":"horizontal",titleContent:" ",isMobile:r,wsize:"l"},n.createElement(Br,{className:Pb.el("modal-body")+"text-s",center:!0},n.createElement(fa,{className:Pb.el("modal-body-icon"),icon:yf,size:"xxl"}),n.createElement("h3",{className:Pb.el("modal-body-header")},n.createElement(yd,{k:`App.ExtraEdication.ErrStatus${M}`})),n.createElement(yd,{k:`App.ExtraEdication.ErrStatus${M}_text`}))))},Ub=new RegExp(/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/),Yb=new RegExp(/^([a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+\.?)+$/),Bb=e=>{if(e){const t=e.trim();if(t.includes("@")&&!t.includes(" ")){const[e,n]=t.split("@");return!(!e||!n)&&Yb.test(e)&&Ub.test(n)}return!1}return!1},Qb={education:"/extra/education"},{ChallengeParamName:Hb}=(0,ar.N)(CONFIG),Vb=({challenge:e,cluster:t})=>{const r=dr(),a=or(rt),o=Rr(479),[i,s]=(0,n.useState)(null),[l,u]=(0,n.useState)(Bb(i)),c=K(),{pathname:d}=W();(0,n.useEffect)((()=>{u(Bb(i))}),[i]);const p="/"!==d?()=>{c("/")}:void 0,f=t=>{if(t in Qb){const r=e?(n={[Hb]:e},void 0===n&&(n=""),new URLSearchParams("string"==typeof n||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce(((e,t)=>{let r=n[t];return e.concat(Array.isArray(r)?r.map((e=>[t,e])):[[t,r]])}),[]))).toString():void 0;c({pathname:Qb[t],search:r})}var n},h=e=>()=>{c(`/otp/${e}`)},m=()=>{c("/email-reg")};return n.createElement(de,null,n.createElement(ue,{path:"/feedback",element:n.createElement(af,{cluster:CONFIG.CLUSTER})}),n.createElement(ue,{path:"*",element:n.createElement(_d,{loading:a,isMobile:o,cluster:t,resetAuth:p,locale:r},n.createElement(de,null,n.createElement(ue,{path:"/:email-reg?",element:n.createElement(Kd,{token:e,locale:r,email:i,setEmail:s,emailIsValid:l,resetAuth:p,setUseOTP:()=>{c("/otp")},sendEmailRegistration:h("registration"),setUsePassword:()=>{c("/password")},setEmailRegistration:m})}),n.createElement(ue,{path:"/otp/:skip?",element:n.createElement(Zp,{token:e,locale:r,email:i,setEmail:s,emailIsValid:l,setUseRegistration:()=>{c("/registration")},resetAuth:p,enterForRegistered:p,setUseExtraData:f})}),n.createElement(ue,{path:"/registration",element:n.createElement(Wp,{token:e,locale:r,email:i,resetAuth:p})}),n.createElement(ue,{path:"/password",element:n.createElement(Kp,{token:e,email:i,setEmail:s,emailIsValid:l,locale:r,resetAuth:p,setUseOTP:h("password"),setEmailRegistration:m,setUseExtraData:f})}),n.createElement(ue,{path:Qb.education,element:n.createElement(Fb,{locale:r,isMobile:o,token:e})}),n.createElement(ue,{path:"*",element:n.createElement(Jp,null)})))}))},Zb="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1NiIgaGVpZ2h0PSI1NiIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzdFQjIxOSIgZD0iTTAgMjhDMCAxMi41MzYgMTIuNTM2IDAgMjggMHMyOCAxMi41MzYgMjggMjgtMTIuNTM2IDI4LTI4IDI4UzAgNDMuNDY0IDAgMjgiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJtMjQgMzMuNi00LjY2Ny00LjY2N2ExLjMxIDEuMzEgMCAwIDAtMS44NjcgMGMtLjUyLjUyLS41MiAxLjM0NyAwIDEuODY3bDUuNTg3IDUuNTg2Yy41Mi41MiAxLjM2LjUyIDEuODggMGwxNC4xMzMtMTQuMTJjLjUyLS41Mi41Mi0xLjM0NiAwLTEuODY2YTEuMzEgMS4zMSAwIDAgMC0xLjg2NyAweiIvPjwvc3ZnPg==",Gb=i.p+"assets/sirius-finger_f6956d04b9dd41f1ca59.jpg",Wb=new Fr.Z("b-password-change"),qb=/^[a-zA-Z0-9_%^&$#@!*(),.;'-]+$/,Kb=/[a-z]+/,Xb=/[A-Z]+/,Jb=/\d+/,eM=(e,t)=>t.test(e),tM=(e,t)=>e?"default":t?"good":"wrong",nM=({onCancel:e})=>n.createElement(ea,{onClose:e,className:Wb,narrowWidth:!0},n.createElement(wi,{onClose:e}),n.createElement(Ei,{className:Wb.el("body")},n.createElement(Br,{className:Wb.el("ok-body")},n.createElement("img",{src:Zb}),n.createElement("span",{className:Wb.el("ok-label")},n.createElement(yd,{k:"App.PasswordChange.LabelWasChanged"}))))),rM=({isMobile:e,onCancel:t,titleStart:r,onConfirm:a,confirmDisabled:o,setOTPCode:i,email:s,codeError:l,resendTimer:u,resendCode:c,loading:d})=>n.createElement(ea,{onClose:t,className:Wb+Wb.bod("loading",d),narrowWidth:!0},d?n.createElement(na,{marginCenter:!0}):n.createElement(n.Fragment,null,n.createElement(wi,{title:r,onClose:t}),n.createElement(Ei,{className:Wb.el("body")},n.createElement(Br,{className:Wb.el("otp-body")},"sirius"===CONFIG.CLUSTER&&n.createElement(Qr,{className:Wb.el("otp-banner")},n.createElement("img",{src:Gb,width:112,height:112})),n.createElement(Qr,{className:`${Wb.el("otp-email-sent")} text-s`},n.createElement(yd,{k:"App.PasswordChange.OtpEmailSent",values:{email:s}})),n.createElement(Qr,{className:`${Wb.el("otp-email-code")} text-s`},n.createElement(yd,{k:"App.PasswordChange.OtpEmailCode"})),n.createElement(ui,{onChange:i,size:e?"l":"s"}),l&&n.createElement(np,{error:l}),n.createElement(Qr,{className:`${Wb.el("otp-resend-timer")} text-s`},null!==u?n.createElement(yd,{k:"App.OTP.resendTimer",values:{resendSec:u}}):n.createElement(sa,{className:Wb.el("resend-button"),mode:"text",size:"xs",type:"button",onAction:c},n.createElement(yd,{k:"App.Profile.ButtonResend"}))))),n.createElement(Si,{className:Wb.el("footer")},n.createElement(Qr,{mobOverturnReverse:!0,className:Wb.el("footer-wrapper")},n.createElement(Kr,null),n.createElement(sa,{onAction:t,size:e?"l":"s"},n.createElement(yd,{k:"App.PasswordChange.ButtonCancel"})),n.createElement(Wr,null),n.createElement(sa,{mode:"primary",onAction:a,disabled:o,size:e?"l":"s"},n.createElement(yd,{k:"App.PasswordChange.ButtonConfirm"})))))),aM=({isMobile:e,onCancel:t,titleStart:r,PlaceholderNew:a,PlaceholderNew2:o,setNewPwd:i,setNew2Pwd:s,onSaveNewPassword:l,saveNewPasswordDisabled:u,isGoodPasswordNew:c,isEmptyPasswordNew:d,isGood2PasswordNew:p,isEmpty2PasswordNew:f,codeError:h})=>n.createElement(ea,{onClose:t,className:Wb,narrowWidth:!0},n.createElement(wi,{className:Wb.el("header"),title:r,onClose:t}),n.createElement(Ei,{className:Wb.el("body")},n.createElement(Br,{className:Wb.el("otpnew-body")},n.createElement(Qr,{className:Wb.el("otpnew-banner")},n.createElement("img",{src:Zb})),n.createElement(Qr,{className:`${Wb.el("otpnew-confirmed")} text-s`},n.createElement(yd,{k:"App.PasswordChange.CodeConfirmed"})),n.createElement(Qr,{className:`${Wb.el("requirements")} text-s`},n.createElement(yd,{k:"App.PasswordChange.Requirements"})),n.createElement(ui,{onChange:i,size:e?"l":"s",placeholder:a,type:"password",mode:tM(d,c)}),n.createElement(ui,{onChange:s,size:e?"l":"s",placeholder:o,type:"password",mode:tM(f,p)}),n.createElement(np,{error:h}))),n.createElement(Si,{className:Wb.el("footer")},n.createElement(Qr,{mobOverturnReverse:!0,className:Wb.el("footer-wrapper")},n.createElement(Kr,null),n.createElement(sa,{onAction:t,size:e?"l":"s"},n.createElement(yd,{k:"App.PasswordChange.ButtonCancel"})),n.createElement(Wr,null),n.createElement(sa,{mode:"primary",onAction:l,disabled:u,size:e?"l":"s"},n.createElement(yd,{k:"App.PasswordChange.ButtonSave"}))))),oM=({email:e,locale:t,onCancel:r,postPasswordReset:a,postPasswordResetConfirm:o,postPasswordResetNewPassword:i,isMobile:s,resendTimer:l,setResendTimer:u,setResetPasswordIsConfirmed:c,resetPasswordIsConfirmed:d})=>{const[p,f]=(0,n.useState)(l&&d?"otpnew":"otp"),[h,m]=(0,n.useState)(""),[g,y]=(0,n.useState)(""),[v,b]=(0,n.useState)(""),[M,w]=(0,n.useState)(null),[E,S]=(0,n.useState)(!1),[N,j]=(0,n.useState)(!1),k=()=>{a().then((e=>{if("success"in e){const{success:{ttl_resend:t}}=e;u(t),f("otp")}}))},D=(0,n.useRef)(!1);(0,n.useEffect)((()=>{!1===D.current&&(D.current=!0,"otp"===p&&(null===l&&k(),c(!1)))}),[p]);const x=or(rt),L=cd({locale:t,tpl:Ml.titleStart}),A=cd({locale:t,tpl:Ml.PlaceholderNew}),O=cd({locale:t,tpl:Ml.PlaceholderNew2}),T=0===h.trim().length,I=0===g.trim().length;(0,n.useEffect)((()=>{const{isValid:e,errorMsg:t}=(e=>{const t=e.trim(),n=(e=>e.length>=8&&e.length<=32)(t),r=eM(t,qb),a=eM(t,Kb),o=eM(t,Xb),i=eM(t,Jb);return{isValid:n&&r&&a&&o&&i,errorMsg:n?r&&a&&o&&i?null:"WrongPasswordFormat":"WrongPasswordSize"}})(h),{isValid:n,errorMsg:r}=((e,t)=>{const n=e===t;return{isValid:n,errorMsg:t.length>=e.length&&!n?"MismatchPassword":null}})(h,g);S(e),j(n),h&&h.trim().length>0&&w(null!=t?t:r)}),[h,g]);const C=!(E&&N),_={isMobile:s,email:e,onCancel:r,onSaveNewPassword:()=>i({newPassword:h}).then((e=>{if("success"in e)f("ok");else if("error"in e&&e.error.length>0){const[t]=e.error;w(t.message)}})),onConfirm:()=>{o({code:v}).then((e=>{if("success"in e)f("otpnew"),c(!0);else if("error"in e&&e.error.length>0){const[t]=e.error;w(t.message)}}))},confirmDisabled:v.trim().length<4,block:Wb,titleStart:L,PlaceholderNew:A,PlaceholderNew2:O,saveDisabled:C,saveNewPasswordDisabled:!(E&&N),setNewPwd:m,setNew2Pwd:y,setOTPCode:b,isGoodPasswordNew:E,isGood2PasswordNew:N,isEmptyPasswordNew:T,isEmpty2PasswordNew:I,resendTimer:l,resendCode:k,loading:x,codeError:M};return"ok"===p?n.createElement(nM,Object.assign({},_)):"otp"===p?n.createElement(rM,Object.assign({},_)):"otpnew"===p?n.createElement(aM,Object.assign({},_)):null},iM=({target:e,addData:t,close:r,locale:a,hasExtraKindData:o,hasPassportData:i})=>{const s=cd({locale:a,tpl:bl.labelAddDataKindActivity});return cd({locale:a,tpl:bl.labelAddDataPassport}),n.createElement(Ri,{target:e,close:r,placement:"top-start"},!o&&n.createElement(Bi,{icon:"add",label:s,onAction:t("kindActivity")}))},sM=({block:e,buttonSize:t,onSaveProfile:r,onCancelChange:a,hasChanged:o,hasErrors:i,showAddData:s,addDataButton:l,hasShowAddDataBtn:u=!1})=>n.createElement(n.Fragment,null,u&&n.createElement(sa,{className:e.el("button-full"),size:"l",icon:"add",mode:"outlined",onAction:s,buttonRef:l},n.createElement(yd,{k:"App.Profile.ButtonAddData"})),n.createElement(Qr,{className:e.el("button-row"),mobOverturn:!0},n.createElement(sa,{size:t,mode:"primary",onAction:r,disabled:!1===o||!0===i},n.createElement(yd,{k:"App.Profile.SaveProfile"})),n.createElement(sa,{size:t,mode:"outlined",onAction:a},n.createElement(yd,{k:"App.Profile.CancelEdit"})))),lM=({block:e,buttonSize:t,showAddData:r,addDataButton:a,setEditMode:o,startChangePassword:i,logout:s,hasShowAddDataBtn:l=!1})=>n.createElement(Qr,{className:e.el("button-row"),mobOverturn:!0},l&&n.createElement(sa,{size:t,icon:"add",mode:"outlined",onAction:r,buttonRef:a},n.createElement(yd,{k:"App.Profile.ButtonAddData"})),n.createElement(sa,{size:t,icon:"edit",mode:"outlined",onAction:o},n.createElement(yd,{k:"App.Profile.ButtonEditData"})),n.createElement(sa,{size:t,icon:"vpn_key",mode:"outlined",onAction:i},n.createElement(yd,{k:"App.Profile.ButtonChangePassword"})),n.createElement(sa,{size:t,icon:"logout",mode:"outlined",onAction:s},n.createElement(yd,{k:"App.Profile.ButtonLogout"}))),uM=["lastName","firstName","patronymic"],cM=["dateOfBirth","snils","phone"],dM=[...uM,...cM],pM=({children:e,size:t,noLock:r,block:a})=>n.createElement(Qr,{className:a.el("cell")+a.el("cell").mod("size",t||"full")},n.createElement(Br,{className:a.el("cell-content")},e),!0!==r&&n.createElement(fa,{className:a.el("cell-lock"),icon:"lock"})),fM=e=>{const{mode:t,value:r,onChange:a,schema:o,locale:i,isMobile:s,block:l}=e;return n.createElement(n.Fragment,null,Object.entries(o.properties).map((([e,o],u)=>n.createElement(DM,{key:u,mode:t,field:e,locale:i,value:r?r[e]:null,schema:o,onChange:(t,n)=>{a(Object.assign(Object.assign({},r||null),{[e]:t}),n)},isMobile:s,block:l}))))},hM=({error:e,block:t})=>n.createElement(Qr,{className:`${t.el("field-error")} text-m`},n.createElement(yd,{k:`App.ProfileFieldError.${e}`})),mM={year:"numeric",month:"long",day:"numeric"},gM=e=>{const{field:t,mode:r,value:a,schema:o,locale:i,isMobile:s,block:l,error:u,children:c}=e,d=((e,t,n)=>{if(null!=e&&"string"==typeof e&&e.trim().length>0){const{format:r,title:a}=t,o=(a||"").toLowerCase();return"date"===r||"date-time"===r?new Date(e).toLocaleDateString(n,mM):"snils"===r||"snils"===o?`${e.substring(0,3)}-${e.substring(3,6)}-${e.substring(6,9)} ${e.substring(9,11)}`:"phone"===r||"phone"===o?`+7 ${e.substring(1,4)} ${e.substring(4,7)}-${e.substring(7,9)}-${e.substring(9,11)}`:"seriesandnumber"===o?`${e.substring(0,2)} ${e.substring(2,4)} ${e.substring(4,10)}`:"unitnumber"===o?`${e.substring(0,3)}-${e.substring(3,6)}`:e}return"?"})(a,o,i);return n.createElement(Br,{className:l.el("field")+l.el("field").mod("name",t)+l.el("field").bod("has-value","?"!==d)},n.createElement("span",{className:`${l.el("field-label")} text-s`},n.createElement(yd,{k:`App.Profile.FieldLabel_${t}`})),"edit"===r?c:n.createElement("span",{className:`${l.el("field-value")} ${s?"text-l":"text-xl"}`},d),u&&"edit"===r&&n.createElement(hM,{error:u,block:l}))},yM=e=>{const{value:t,locale:r,onChange:a}=e;return n.createElement(gM,Object.assign({},e),n.createElement(oi,{value:t?new Date(`${t}`):null,locale:r,type:"date",cleanable:!0,showYearDropdown:!0,showMonthDropdown:!0,onChange:e=>a((e=>e?Hy(Vy(e),"date"):null)(e)),size:"l",maxDate:new Date}))},vM={phone:{mask:"+{7} (000) 000-00-00"},snils:{mask:"000-000-000 00"},seriesAndNumber:{mask:"00 00 000000"},unitNumber:{mask:"000-000"}},bM={snils:"000-000-000 00",phone:"+7 (000) 000-00-00",seriesAndNumber:"00 00 000000",unitNumber:"000-000"},MM=e=>{const{field:t,value:r,block:a,error:o,onChange:i,disabled:s}=e,l=e=>i(e,o),u=t in bM?bM[t]:void 0;return n.createElement(gM,Object.assign({},e,{error:o}),t in vM?n.createElement(di,{maskInput:vM[t],className:a.el("field-input"),onChange:l,defaultValue:`${r||""}`,size:"l",placeholder:u,disabled:!0===s}):n.createElement(ui,{className:a.el("field-input"),onChange:l,defaultValue:`${r||""}`,size:"l",placeholder:u,disabled:!0===s}))},wM=e=>{const{field:t,value:r,schema:a,block:o,error:i,locale:s,onChange:l,disabled:u}=e,{enum:c}=a,d=`placeholder-${t}`,p=d in bl?cd({locale:s,tpl:bl[d]}):d;return n.createElement(gM,Object.assign({},e,{error:i}),n.createElement(_y,{className:o.el("dropdown-select"),placeholder:p,onChange:([e])=>{const t=e?e.value:null;l(t)},disabled:u,cleanable:!1},c.map(((e,t)=>n.createElement(Sy,{key:t,value:{value:e},selected:e===r,label:`${e}`})))))},EM=/^\+?\s?\d[\s\d-]+\d$/,SM=e=>Number.isFinite(parseInt(e,10)),NM={phone:e=>{const t=`${e}`.trim();if(t){const e=t.split("").filter(SM).length;if(!EM.test(t)||e<10||e>13)return"wrongPhone"}return null},snils:e=>{const t=`${e}`.trim();if(t){if(t.split("").filter(SM),!/^\d+$/.test(t))return"format_snils_only_digits";if(!(e=>11===e.length)(t))return"format_snils_eleven";if(!(e=>{let t=0;for(let n=0;n<9;n++)t+=parseInt(e[n])*(9-n);let n=0;return t<100?n=t:t>101&&(n=parseInt(""+t%101),100===n&&(n=0)),n===parseInt(e.slice(-2))})(t))return"format_snils_sum"}return null},seriesAndNumber:e=>10!==`${e}`.trim().length?"format_SeriesAndNumber_10":null,unitNumber:e=>6!==`${e}`.trim().length?"format_UnitNumber_6":null,required:e=>null==e||"string"==typeof e&&0===e.trim().length?"required":null},jM=NM.required||null,kM=(e,t,n)=>{const{format:r}=e;if(t&&(r in NM||n in NM)){const e=NM[n]||null,a=NM[r]||null,o=e&&e(t),i=a&&a(t);return o||i}return null},DM=e=>{const{schema:t,value:r,field:a,onChange:o,required:i}=e,s="enum"in t,l="object"===t.type,u="date"===t.format||"date-time"===t.format,c="string"===t.type,[d,p]=(0,n.useState)(kM(t,r,a));return(0,n.useEffect)((()=>{const e=r&&("string"!=typeof r||r.trim().length>0)?kM(t,r,a):i?jM(r):null;p(e)}),[r]),(0,n.useEffect)((()=>{o(r,d)}),[d]),l?n.createElement(fM,Object.assign({},e,{error:d})):u?n.createElement(yM,Object.assign({},e,{error:d})):c?n.createElement(MM,Object.assign({},e,{error:d})):s?n.createElement(wM,Object.assign({},e,{error:d})):null};var xM=i(5270),LM=i.n(xM);const{result:AM}=LM(),OM=e=>uM.reduce(((t,n)=>{if(n in e){const r=e[n];if("string"==typeof r&&r.length>0)return`${t||""}${r} `}return t}),null),TM=({block:e,profile:t,mode:r,onFieldChange:a,locale:o,isMobile:i})=>{const[s,l]=(0,n.useState)(OM(t));(0,n.useEffect)((()=>{l(OM(t))}),[t]);const u="show"===r?cM.filter((e=>e in t&&t[e])):dM;return n.createElement(Qr,{className:e.el("row")},n.createElement(pM,{noLock:!0,block:e},n.createElement(Qr,{className:e.el("cell-title")},"show"===r&&s?s:n.createElement(yd,{k:"App.Profile.PersonalCellTitle"})),u.length>0&&n.createElement(Qr,{className:e.el("fields")},u.map(((s,l)=>n.createElement(DM,{required:["firstName","lastName"].includes(s),mode:r,key:l,field:s,locale:o,value:t[s],schema:AM.properties[s],onChange:a(s),isMobile:i,block:e}))))))},IM=({block:e,profile:t,isMobile:r})=>n.createElement(Qr,{className:e.el("row")},n.createElement(pM,{size:"short",block:e},n.createElement("span",{className:`${e.el("field-label")} text-s`},"ID"),n.createElement("span",{className:`${e.el("field-value")} ${r?"text-l":"text-xl"}`},t.userId)),n.createElement(pM,{size:"wide",block:e},n.createElement("span",{className:`${e.el("field-label")} text-s`},n.createElement(yd,{k:"App.Profile.fieldLabelEmail"})),n.createElement("span",{className:`${e.el("field-value")} ${r?"text-l":"text-xl"}`},t.email))),CM=new Fr.Z("ui-form-profile"),{SchemaField:_M}=Mv,PM=e=>n.createElement(_M,Object.assign({},e,{uischema:Mv,block:CM})),zM=({block:e,profile:t,mode:r,onFieldChange:a,locale:o,isMobile:i})=>{const s=(0,n.useMemo)((()=>(e=>{var t,n;const r=null!==(n=null===(t=null==e?void 0:e.extra)||void 0===t?void 0:t.kindActivity)&&void 0!==n?n:{},{isRussia:a,country:o,region:i,municipalicy:s,school:l}=r,u=Rb(r,["isRussia","country","region","municipalicy","school"]);return Object.assign(Object.assign({},u),{info:{isRussia:a,country:o,region:i,municipalicy:s,school:l}})})(t)),[t]),[l,u]=(0,n.useState)({kindActivity:s}),[c,d]=(0,n.useState)(null),[p,f]=(0,n.useState)({}),[h,m]=(0,n.useState)(!1),[g,y]=(0,n.useState)(),[v,b]=(0,n.useState)(void 0),M=(0,n.useMemo)((()=>JSON.stringify(l)),[l]),w={onDictQueryReq:pf,onDictResolveReq:ff,startLoading:at,stopLoading:ot};(0,n.useEffect)((()=>{const{schema:e,options:t}=zb,n="show"===r?Object.assign(Object.assign({},e),{readOnly:!0}):e;d(n),f(t)}),[r]);const E=(e={})=>{const{isValid:t,validation:n}=e;y(n),m(t)};return(0,n.useEffect)((()=>{b({onValidate:void 0!==l?E:void 0})}),[M]),(0,n.useEffect)((()=>{const e=h?void 0:"formNotValid";a("kindActivity")($b(l),e)}),[M,h]),n.createElement(Qr,{className:e.el("row")},n.createElement(pM,{noLock:!0,block:e},n.createElement(Qr,{className:e.el("cell-title")},n.createElement(yd,{k:"App.Profile.fieldLabelKindActivity"})),n.createElement(Qr,{className:e.el("fields")},c?n.createElement(PM,Object.assign({},v,{schema:c,data:l,uioptions:Object.assign(Object.assign({},_b),{options:p,locale:o,isMobile:i}),onChange:u,validation:g,onActions:w})):null)))},RM=e=>null!=e&&""!==e&&(!$M(e)||FM(e)),$M=e=>"object"==typeof e&&!Array.isArray(e),FM=e=>Object.values(e).filter(RM).length>0,UM=AM.properties.passportInfo,YM=({block:e,profile:t,mode:r,onFieldChange:a,locale:o,isMobile:i})=>{const s=Object.keys(UM.properties),l=t.passportInfo||{},u=e=>(t,n)=>{const r=Object.assign(Object.assign({},l),{[e]:t});a("passportInfo")(FM(r)?r:{},n)};return n.createElement(Qr,{className:e.el("row")},n.createElement(pM,{noLock:!0,block:e},n.createElement(Qr,{className:e.el("cell-title")},n.createElement(yd,{k:"App.Profile.fieldLabelPassport"})),s.length>0&&n.createElement(Qr,{className:e.el("fields")},s.map(((t,a)=>n.createElement(DM,{mode:r,key:a,field:t,locale:o,value:l[t],schema:UM.properties[t],onChange:u(t),isMobile:i,block:e}))))))},BM=new Fr.Z("b-profile-page"),QM={kindActivity:{kind:"student",isRussia:"yes"}},HM=e=>{const{firstName:t,dateOfBirth:n,lastName:r,passportInfo:a,patronymic:o,phone:i,snils:s,extra:l}=e,u=Object.entries({firstName:t,dateOfBirth:n,lastName:r,passportInfo:a,patronymic:o,phone:i,snils:s,extra:l}).reduce(((e,[t,n])=>RM(n)?Object.assign(Object.assign({},e),{[t]:n}):Object.assign(Object.assign({},e),{[t]:null})),{});return JSON.parse(JSON.stringify(u))},VM=(e,t)=>(null==e?void 0:e.extra)&&"kindActivity"in e.extra&&null!==e.extra.kindActivity&&("show"!==t||FM(e.extra.kindActivity)),ZM=e=>dM.reduce(((t,n)=>{if(n in e){const r=e[n];return null!=r&&""!==r||t}return t}),!1),GM=({profile:e,logout:t,saveProfile:r,postPasswordReset:a,postPasswordResetConfirm:o,postPasswordResetNewPassword:i,isMobile:s})=>{const l=dr(),u=(0,n.useRef)(null),[c,d]=(0,n.useState)(null),[p,f]=(0,n.useState)(!1),[h,m]=(0,n.useState)("show"),[g,y]=(0,n.useState)(HM(e)),[v,b]=(0,n.useState)(!1),[M,w]=(0,n.useState)(ZM(g)),[E,S]=(0,n.useState)(VM(g,h)),[N,j]=(0,n.useState)(!1),[k,D]=(0,n.useState)(!1),[x,L]=(0,n.useState)({}),[A,O]=(0,n.useState)(!1),[T,I]=(0,n.useState)(!1),C=()=>{L({}),m("edit")},_=()=>m("show"),P=e=>(t,n)=>{const r=Object.assign(Object.assign({},x),{[e]:n||null}),a=Object.assign(Object.assign({},g),{[e]:t});L(r),y(a)},z=e=>(t,n)=>{const r=Object.assign(Object.assign({},x),{extra:n||null}),a=Object.assign(Object.assign({},g),{extra:Object.assign(Object.assign({},g.extra),{[e]:t})});L(r),y(a)};(0,n.useEffect)((()=>{y(HM(e)),b(!1)}),[e]),(0,n.useEffect)((()=>{w(ZM(g)),S(VM(g,h)),j(!1)}),[g]),(0,n.useEffect)((()=>{const e=FM(x);O(e)}),[g,x]),(0,n.useEffect)((()=>{const t=HM(e),n=HM(g),r=JSON.stringify(t)!==JSON.stringify(n);b(r)}),[g,e]);const R=e=>{e&&e.stopPropagation(),f(!0)},$=s?"l":"s",F=!E,U=()=>{const e="number"==typeof c&&c>0?c-1:null;e>0?setTimeout((()=>{d(e)}),1e3):null!==c&&d(e)};return(0,n.useEffect)(U,[c]),n.createElement(Br,{className:BM+BM.mod("mode",h)},(M||"edit"===h)&&n.createElement(TM,{block:BM,profile:g,mode:h,locale:l,onFieldChange:P,isMobile:s}),E&&n.createElement(zM,{block:BM,profile:g,mode:h,locale:l,onFieldChange:z,isMobile:s}),N&&n.createElement(YM,{block:BM,profile:g,mode:h,locale:l,onFieldChange:P,isMobile:s}),n.createElement(IM,{block:BM,profile:e,mode:h,isMobile:s}),"show"===h?n.createElement(lM,{block:BM,buttonSize:$,addDataButton:u,showAddData:R,setEditMode:C,startChangePassword:()=>{D(!0),_()},logout:t,hasShowAddDataBtn:F}):n.createElement(sM,{block:BM,buttonSize:$,hasChanged:v,hasErrors:A,onSaveProfile:()=>{r(g).then(_)},onCancelChange:()=>{y(HM(e)),_()},showAddData:R,addDataButton:u,hasShowAddDataBtn:F}),k&&n.createElement(oM,{isMobile:s,email:e.email,locale:l,onCancel:()=>{D(!1)},postPasswordReset:a,postPasswordResetConfirm:o,postPasswordResetNewPassword:i,resendTimer:c,setResendTimer:e=>{null===c&&(d(e),U())},setResetPasswordIsConfirmed:I,resetPasswordIsConfirmed:T}),F&&n.createElement(iM,{locale:l,hasExtraKindData:E,hasPassportData:N,target:p?u.current:null,close:()=>{f(!1)},addData:e=>()=>{var t;(["kindActivity"].includes(e)?z(e):P(e))(null!==(t=null==QM?void 0:QM[e])&&void 0!==t?t:{}),C()}}))},WM=({cluster:e,logout:t})=>{const r=or(rt),a=or(et),o=Rr(479),i=(0,n.useRef)(!1),[s,l]=(0,n.useState)(null),u=dr();return(0,n.useEffect)((()=>{var e;a?!1===i.current&&(i.current=!0,(e=a,at(),Gn.get(`${CONFIG.API.Auth}/profile`,{headers:er(e)}).then(Jn).finally(ot)).then((e=>{if("success"in e)l(e.success);else if("error"in e)throw"getProfile error"})).catch((e=>{const{status:n}=null==e?void 0:e.response;401===n&&t()}))):t()}),[a]),null===s?n.createElement(na,{centerOfWindow:!0}):n.createElement(de,null,n.createElement(ue,{path:"/feedback",element:n.createElement(af,{cluster:CONFIG.CLUSTER})}),n.createElement(ue,{path:"*",element:n.createElement(Hd,{loading:r,isMobile:o,cluster:e,profile:s,locale:u},n.createElement(de,null,n.createElement(ue,{path:"*",element:n.createElement(GM,{cluster:CONFIG.CLUSTER,profile:s,logout:t,isMobile:o,saveProfile:e=>{return(t=a,n=e,at(),Gn.post(`${CONFIG.API.Auth}/profile`,n,{headers:er(t)}).then(Jn).finally(ot)).then((e=>{if("success"in e)l(e.success);else if("error"in e)throw"postProfile error"}));var t,n},postPasswordReset:()=>{return e=a,at(),Gn.post(`${CONFIG.API.Auth}/password/reset`,{},{headers:er(e)}).then(Jn).finally(ot);var e},postPasswordResetConfirm:e=>((e,t)=>(at(),Gn.post(`${CONFIG.API.Auth}/password/reset/confirm`,t,{headers:er(e)}).then(Jn).finally(ot)))(a,e),postPasswordResetNewPassword:e=>((e,t)=>(at(),Gn.post(`${CONFIG.API.Auth}/password/reset/new-password`,t,{headers:er(e)}).then(Jn).finally(ot)))(a,e)})})))}))},qM=i.p+"assets/bg_02aaae86f5f1788d2e42.png",KM=i.p+"assets/cpm_e4d2f61284f62b6c0437.svg",XM=new Fr.Z("b-error-page"),JM=()=>{document.location.href="/"},ew=({cluster:e})=>{const t=dr(),r=Rr(479);return n.createElement(de,null,n.createElement(ue,{path:"/feedback",element:n.createElement(af,{cluster:CONFIG.CLUSTER})}),n.createElement(ue,{path:"*",element:n.createElement(zd,{isMobile:r,cluster:e,locale:t},n.createElement(Br,{className:XM},n.createElement(Qr,{className:XM.el("img-wrap")},n.createElement("img",Object.assign({className:XM.el("img"),src:"cpm"===e?KM:qM},"sirius"===e?{height:240}:null))),n.createElement(Qr,{className:`${XM.el("title")} text-xxl`},n.createElement(yd,{k:"App.ErrorPage.title"})),n.createElement(Qr,{className:`${XM.el("text")} text-m`},n.createElement(yd,{k:"App.ErrorPage.text"})),n.createElement(sa,{mode:"primary",icon:"arrow_back",onAction:JM},n.createElement(yd,{k:"App.ErrorPage.backButton"}))))}))},{ChallengeParamName:tw,AuthCallbackCodeParam:nw,AuthCallbackPath:rw,AuthTokenPath:aw,AuthAuthorizePath:ow}=(0,ar.N)(CONFIG),iw=Qb?Object.values(Qb):[],sw=(0,a.s)(document.getElementById("root")),lw=()=>sw.render(n.createElement(n.StrictMode,null,n.createElement(be,null,n.createElement(ew,{cluster:CONFIG.CLUSTER})))),uw=()=>{const{pathname:e,search:t}=location,r=new URLSearchParams(t),[a,o,i,s]=((e,t)=>e.map((e=>t.has(e)?t.get(e):void 0)))([tw,nw,"state","redirect_to"],r);nt()&&!a?sw.render(n.createElement(n.StrictMode,null,n.createElement(be,null,n.createElement(WM,{cluster:CONFIG.CLUSTER,logout:()=>{tt(null),document.location.href=CONFIG.SSO_LOGOUT_URL}})))):"/error"===e?lw():e===rw?((e,{code:t,state:n,redirect:r})=>(at(),Gn.get(`${CONFIG.API.Auth}${e}?code=${t}&state=${n}&redirect=${r}`,Xn).then(Jn).finally(ot)))(aw,{code:o,state:i,redirect:s}).then((e=>{"success"in e&&tt(e.success.token)})).finally((()=>{window.history.replaceState(null,"","/"),setTimeout(uw)})):a?(!iw.includes(e)&&window.history.replaceState(null,"","/"),(e=>{sw.render(n.createElement(n.StrictMode,null,n.createElement(be,null,n.createElement(Vb,{challenge:e,cluster:CONFIG.CLUSTER}))))})(a)):document.location.href=`${CONFIG.API.Auth}${ow}`,window.addEventListener("unhandledrejection",(e=>{(null===CONFIG||void 0===CONFIG?void 0:CONFIG.MOCK)&&console.error(e),lw()}))};(null===CONFIG||void 0===CONFIG?void 0:CONFIG.MOCK)?Promise.all([i.e(624),i.e(758)]).then(i.bind(i,5758)).then((({worker:e})=>e.start({onUnhandledRequest:"bypass"}).then(uw))):uw()})()})();"