PageSourceSearch

https://ceskaonlinekasina.cz/build/assets/init.7c4bbaf6.js

js ceskaonlinekasina.cz collected 2026-10-10 02:36:07 UTC 14,041 bytes, 1 lines download raw bytes

1import{r as p,g as as,a as ns,j as s,c as rs}from"./getTranslationFn.2356ac80.js";import{u as os}from"./usePopupHandler.6cac7bc4.js";import{i as G,j as q,k as ls}from"./api-routes.b5363d5a.js";import{a as Y,b as X}from"./k2.module.9d7457c1.js";import{u as is}from"./useLockBodyScroll.7791b918.js";import{s as w}from"./selectStylesByLayout.27113c92.js";import{u as D,t as x,a as B,E as F,U as l,e as $,N as k,f as E}from"./auth.4886ff80.js";import{B as cs,u as J,I,b as ds,a as H,c as _s}from"./index.a09ad1f4.js";import{T as ms}from"./index.b0a881f3.js";import{U as Q}from"./index.57849716.js";import"./_commonjsHelpers.725317a4.js";import"./index.054212fd.js";import"./getProjectVersion.cf97dcd9.js";import"./getInitials.15d02be9.js";const R=p.createContext(),n=as("react-profile-translates");function us({onClose:e}){const a=w(X,Y),[t,o]=p.useState(!1),[r,i]=p.useState(null),{logout:m}=D(),u=window["react-layout"]==="k1";is();const v=async()=>{var b,c,d,f;o(!0),i(null);try{await B.delete(G),e(),m()}catch(_){const g=((c=(b=_.response)==null?void 0:b.data)==null?void 0:c.error)||((f=(d=_.response)==null?void 0:d.data)==null?void 0:f.message)||x("something-went-wrong");i(g),setTimeout(()=>i(null),4e3)}finally{o(!1)}};return ns.createPortal(s.jsx(cs,{onClose:e,closeBtnAltCondition:!u,children:s.jsxs("div",{className:`${a.wrap} ${a["wrap-alt"]}`,children:[r&&s.jsx("p",{className:a.error,role:"alert",children:r}),s.jsx("p",{className:`${a.title} ${a["title-alt"]}`,children:n("del-account-title")}),s.jsx("p",{className:a.hint,children:n("del-account-text")}),s.jsxs("div",{className:a["btns-wrap"],children:[!t&&s.jsx("button",{className:a["outlined-btn"],type:"button",onClick:e,children:n("del-account-no")}),s.jsx("button",{className:a["outlined-btn"],type:"button",onClick:v,disabled:t,children:t?x("loading"):n("del-account-yes")})]})]})}),document.getElementById("react-popups"))}const ps="_wrap_qggv6_2",gs="_inner_qggv6_2",vs="_tabs_qggv6_7",bs="_active_qggv6_67",fs={wrap:ps,inner:gs,"tabs-wrap":"_tabs-wrap_qggv6_7","tabs-settings":"_tabs-settings_qggv6_12","tabs-not-settings":"_tabs-not-settings_qggv6_18","tab-btn":"_tab-btn_qggv6_18",tabs:vs,active:bs},hs="_wrap_1ez21_2",js="_inner_1ez21_2",xs="_tabs_1ez21_7",ws="_active_1ez21_68",ys={wrap:hs,inner:js,"tabs-wrap":"_tabs-wrap_1ez21_7","tabs-settings":"_tabs-settings_1ez21_12","tabs-not-settings":"_tabs-not-settings_1ez21_18","tab-btn":"_tab-btn_1ez21_18",tabs:xs,active:ws},ss="updates",ks="activity",L="settings",Ns="_wrap_4dk40_1",$s="_text_4dk40_55",Es="_badge_4dk40_64",Ss="_name_4dk40_69",Cs="_email_4dk40_86",As="_btns_4dk40_120",Ts="_settings_4dk40_155",es={wrap:Ns,"btn-settings":"_btn-settings_4dk40_14","avatar-wrap":"_avatar-wrap_4dk40_44",text:$s,badge:Es,name:Ss,email:Cs,btns:As,settings:Ts},zs="_wrap_1tfin_1",Ps="_text_1tfin_55",Ds="_badge_1tfin_64",Fs="_name_1tfin_69",Is="_email_1tfin_87",Bs="_btns_1tfin_126",Ls="_settings_1tfin_159",ts={wrap:zs,"btn-settings":"_btn-settings_1tfin_14","avatar-wrap":"_avatar-wrap_1tfin_44",text:Ps,badge:Ds,name:Fs,email:Is,btns:Bs,settings:Ls},Ks="/build/assets/settings.svg";function W({classes:e}){return s.jsx("div",{className:e,children:n("verified")})}function V({setActiveTab:e}){const a=w(es,ts),{user:t,logout:o}=D(),{openPopup:r}=p.useContext(R);return s.jsxs("div",{className:a.wrap,children:[s.jsx("button",{className:a["btn-settings"],type:"button",onClick:()=>e(L),children:s.jsx("img",{src:Ks,alt:"Settings icon",width:"22",height:"22",loading:"lazy"})}),s.jsxs("div",{className:a["avatar-wrap"],children:[s.jsx(Q,{name:t==null?void 0:t.name,avatarUrl:t==null?void 0:t.avatar}),s.jsxs("div",{className:a.text,children:[s.jsxs("div",{className:a.name,children:[t==null?void 0:t.name,!!(t!=null&&t.is_email_verified)&&s.jsx(W,{classes:`${a.badge} hide-xs`})]}),s.jsx("div",{className:a.email,children:t==null?void 0:t.email}),!!(t!=null&&t.is_email_verified)&&s.jsx(W,{classes:`${a.badge} hide-lg`})]})]}),s.jsxs("div",{className:a.btns,children:[s.jsxs("button",{type:"button",onClick:()=>o(),children:[n("log-out"),s.jsx("svg",{"aria-hidden":"true",children:s.jsx("use",{xlinkHref:"#svg-logout"})})]}),s.jsx("button",{type:"button",onClick:r,children:n("delete-account")}
1)]})]})}function Rs({setActiveTab:e}){const a=w(es,ts);return s.jsxs("div",{className:a.settings,children:[s.jsx("button",{type:"button",onClick:()=>e(ss),"aria-label":n("back-to-preview")}),n("profile-settings")]})}function Ms({isSettings:e=!1,setActiveTab:a}){return s.jsxs(s.Fragment,{children:[!e&&s.jsx(V,{setActiveTab:a}),e&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"hide-xs",children:s.jsx(V,{setActiveTab:a})}),s.jsx("div",{className:"hide-lg",children:s.jsx(Rs,{setActiveTab:a})})]})]})}const Os="_skeleton_k13vj_1",Us="_avatar_k13vj_12",qs="_pulse_k13vj_1",Hs="_name_k13vj_37",Ws="_username_k13vj_51",Vs="_tabs_k13vj_65",Zs="_tab_k13vj_65",Gs="_bio_k13vj_89",Ys="_line_k13vj_97",Xs="_short_k13vj_110",Js="_shorter_k13vj_111",Qs={skeleton:Os,"avatar-wrap":"_avatar-wrap_k13vj_12",avatar:Us,pulse:qs,name:Hs,username:Ws,tabs:Vs,tab:Zs,bio:Gs,line:Ys,short:Xs,shorter:Js},se="_skeleton_k13vj_1",ee="_avatar_k13vj_12",te="_pulse_k13vj_1",ae="_name_k13vj_37",ne="_username_k13vj_51",re="_tabs_k13vj_65",oe="_tab_k13vj_65",le="_bio_k13vj_89",ie="_line_k13vj_97",ce="_short_k13vj_110",de="_shorter_k13vj_111",_e={skeleton:se,"avatar-wrap":"_avatar-wrap_k13vj_12",avatar:ee,pulse:te,name:ae,username:ne,tabs:re,tab:oe,bio:le,line:ie,short:ce,shorter:de};function me(){const e=w(Qs,_e);return s.jsxs("div",{className:`${e.skeleton} container`,"aria-hidden":"true",children:[s.jsxs("div",{className:e["avatar-wrap"],children:[s.jsx("div",{className:e.avatar}),s.jsxs("div",{className:e.text,children:[s.jsx("div",{className:e.name}),s.jsx("div",{className:e.username})]})]}),s.jsxs("div",{className:e.tabs,children:[s.jsx("div",{className:e.tab}),s.jsx("div",{className:e.tab}),s.jsx("div",{className:e.tab})]}),s.jsxs("div",{className:e.bio,children:[s.jsx("div",{className:e.line}),s.jsx("div",{className:`${e.line} ${e.short}`}),s.jsx("div",{className:`${e.line} ${e.shorter}`})]})]})}const ue={"not-verified":"_not-verified_l72j4_1"},pe={"not-verified":"_not-verified_1yq9h_1"};function ge(){const e=w(ue,pe);return s.jsx("div",{className:e["not-verified"],children:s.jsx("p",{children:n("pending-verification")})})}const ve={"not-authorized":"_not-authorized_vcfff_1"},be={"not-authorized":"_not-authorized_mgm8l_1"};function fe(){const e=w(ve,be);return s.jsx("div",{className:`${e["not-authorized"]} container`,children:s.jsx("p",{children:n("not-authorized")})})}function he(){return s.jsx(s.Fragment,{})}function je(){return s.jsx(s.Fragment,{})}const xe="_forms_1jzdc_1",we="_avatar_1jzdc_49",M={forms:xe,"form-wrap":"_form-wrap_1jzdc_20","form-wrap-pass":"_form-wrap-pass_1jzdc_37","img-label":"_img-label_1jzdc_41",avatar:we,"upload-img":"_upload-img_1jzdc_55","del-img-btn":"_del-img-btn_1jzdc_86","settings-btns":"_settings-btns_1jzdc_107"},ye="_forms_12flp_1",ke="_avatar_12flp_66",O={forms:ye,"form-wrap":"_form-wrap_12flp_20","form-wrap-pass":"_form-wrap-pass_12flp_49","img-label":"_img-label_12flp_53",avatar:ke,"upload-img":"_upload-img_12flp_72","del-img-btn":"_del-img-btn_12flp_103","settings-btns":"_settings-btns_12flp_123"};function Ne(){const{logout:e}=D(),a=w(M,O),{openPopup:t}=p.useContext(R);return s.jsxs("div",{className:`hide-lg ${a["settings-btns"]}`,children:[s.jsxs("button",{type:"button",onClick:()=>e(),children:[n("log-out"),s.jsx("svg",{"aria-hidden":"true",children:s.jsx("use",{xlinkHref:"#svg-logout"})})]}),s.jsx("button",{type:"button",onClick:t,children:n("delete-account")})]})}function U(){const e=w(M,O),a=w(X,Y);return{styles:e,commonStyles:a}}const $e=2,Ee=["image/jpeg","image/png","image/webp"];function Se(){const{user:e,setUser:a}=D(),{styles:t,commonStyles:o}=U(),[r,i]=p.useState(null),[m,u]=p.useState(!1),v=async c=>{var _,g,y,A,T,S;const d=(_=c.target.files)==null?void 0:_[0];if(!d)return;if(!Ee.includes(d.type)){i(n("invalid-file-type"));return}if(d.size/(1024*1024)>$e){i(n("file-too-large"));return}i(null),u(!0);try{const h=new FormData;h.append("avatar",d);const j=await B.post(q,h,{headers:{"Content-Type":"multipart/form-data"}}),C=(g=j==null?void 0:j.data)==null?void 0:g.avatar;C&&(a==null||a({...e,avatar:C}))}catch(h){const j=((A=(y=h.response)==null?void 0:y.data)==null?void 0:A.error)||((S=(T=h.response)==null?void 0:T.data)==null?void 0:S.message)||x("something-went-wrong");i(j)}finally{u(!1),c.target.value=""}},b=async()=>{var c,d,f,_;if(e!=null&&e.avatar){u(!0),i(null);try{await B.delete(q),a==null||a({...e,avatar:null})}catch(g){const y=((d=(c=g.response)==null?void 0:c.data)==null?void 0:d.error)||((_
1=(f=g.response)==null?void 0:f.data)==null?void 0:_.message)||x("something-went-wrong");i(y)}finally{u(!1)}}};return s.jsxs("div",{className:t["form-wrap"],children:[s.jsx("p",{className:t["img-label"],children:n("profile-picture")}),r&&s.jsx("p",{className:o.error,role:"alert",children:r}),s.jsx("div",{className:`${t.avatar} hide-lg`,children:s.jsx(Q,{name:e==null?void 0:e.name,avatarUrl:e==null?void 0:e.avatar})}),s.jsxs("label",{className:t["upload-img"],children:[s.jsx("input",{type:"file",accept:"image/*",onChange:v,disabled:m}),s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",children:s.jsx("path",{fill:"currentColor",d:"M7.5 12V3.85l-2.6 2.6L3.5 5l5-5 5 5-1.4 1.45-2.6-2.6V12h-2Zm-5 4c-.55 0-1.02-.196-1.412-.587A1.93 1.93 0 0 1 .5 14v-3h2v3h12v-3h2v3c0 .55-.196 1.021-.587 1.413A1.92 1.92 0 0 1 14.5 16h-12Z"})}),m?x("loading"):n("upload-new-picture")]}),(e==null?void 0:e.avatar)&&s.jsx("button",{className:t["del-img-btn"],type:"button",onClick:b,children:n("delete-picture")})]})}function Ce(){const{styles:e,commonStyles:a}=U(),{user:t,setUser:o}=D(),{form:r,setForm:i,errors:m,setErrors:u,loading:v,setLoading:b,serverError:c,setServerError:d,handleChange:f}=J({[F]:"",[l]:""}),_=window["react-layout"]==="k1",[g,y]=p.useState(null);p.useEffect(()=>{t&&i({[F]:t[F]||"",[l]:t[l]||""})},[t]);const A=async()=>{var h,j,C,N,z;const S={[l]:ds(r[l])};if(u(S),d(null),y(null),!Object.values(S).some(Boolean)&&!(!t||r[l]===t[l])){b(!0);try{const P=await B.patch(G,{[l]:r[l]});o==null||o({...t,[l]:r[l]});const K=((h=P==null?void 0:P.data)==null?void 0:h.message)||n("profile-updated-successfully");y(K),setTimeout(()=>y(null),4e3)}catch(P){const K=((C=(j=P.response)==null?void 0:j.data)==null?void 0:C.error)||((z=(N=P.response)==null?void 0:N.data)==null?void 0:z.message)||x("something-went-wrong");d(K),setTimeout(()=>d(null),4e3)}finally{b(!1)}}},T=!t||v||!r[l]||r[l]===(t==null?void 0:t[l])||!!m[l];return s.jsxs("div",{className:e["form-wrap"],children:[(c||g)&&s.jsx("p",{className:c?a.error:a.success,role:c?"alert":"status",children:c||g}
1),s.jsx(I,{type:"email",label:n("email"),name:F,placeholder:x("enter-email-here"),value:r[F],disabled:!0}),s.jsx(I,{type:"text",label:s.jsx("span",{dangerouslySetInnerHTML:{__html:n("display-name")}}),name:l,placeholder:x("user-name"),value:r[l],onChange:f,error:m[l]}),s.jsx("button",{className:`${a["submit-btn"]} ${_?"":"main-btn"}`,type:"button",onClick:A,disabled:T,children:v?x("loading"):n("save")})]})}function Ae(){const{styles:e,commonStyles:a}=U(),{form:t,setForm:o,errors:r,setErrors:i,loading:m,setLoading:u,serverError:v,setServerError:b,handleChange:c}=J({[$]:"",[k]:"",[E]:""}),d=window["react-layout"]==="k1",[f,_]=p.useState(null),g=async()=>{var T,S,h,j,C;i({}),b(null),_(null);const A={[$]:H(t[$]),[k]:_s(t[k]),[E]:H(t[E])};if(Object.values(A).some(Boolean)){i(A);return}u(!0);try{const N=await B.post(ls,t);o({[$]:"",[k]:"",[E]:""});const z=((T=N==null?void 0:N.data)==null?void 0:T.message)||n("password-changed-successfully");_(z),setTimeout(()=>_(null),4e3)}catch(N){const z=((h=(S=N.response)==null?void 0:S.data)==null?void 0:h.error)||((C=(j=N.response)==null?void 0:j.data)==null?void 0:C.message)||x("something-went-wrong");b(z),setTimeout(()=>b(null),4e3)}finally{u(!1)}},y=!t[$]||!t[k]||!t[E]||t[k]!==t[E]||t[k]===t[$]||m;return s.jsxs("div",{className:`${e["form-wrap"]} ${e["form-wrap-pass"]}`,children:[(v||f)&&s.jsx("p",{className:v?a.error:a.success,role:v?"alert":"status",children:v||f}
1),s.jsx(I,{type:"password",label:n("password-reset"),name:$,placeholder:n("old-password"),value:t[$],onChange:c,error:r[$],showToggle:!0}),s.jsx(I,{type:"password",name:k,placeholder:n("new-password"),value:t[k],onChange:c,error:r[k],showToggle:!0}),s.jsx(I,{type:"password",name:E,placeholder:n("confirm-new-password"),value:t[E],onChange:c,error:r[E],showToggle:!0}),s.jsx("button",{className:`${a["submit-btn"]} ${d?"":"main-btn"}`,type:"button",onClick:g,disabled:y,children:m?x("loading"):n("reset-password")})]})}function Te(){const e=w(M,O);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:e.forms,children:[s.jsx(Se,{}),s.jsx(Ce,{}),s.jsx(Ae,{})]}),s.jsx(Ne,{})]})}const Z=[{id:ss,label:n("updates"),body:s.jsx(he,{})},{id:ks,label:n("your-activity"),body:s.jsx(je,{})},{id:L,label:n("profile-settings"),body:s.jsx(Te,{})}];function ze(){const{user:e,loading:a}=D(),[t,o]=p.useState(L),r=w(fs,ys),i=Z.find(u=>u.id===t),m=t===L;return a?s.jsx(me,{}):!e||e.length===0?s.jsx(fe,{}):s.jsx("div",{className:r.wrap,children:s.jsxs("div",{className:`container ${r.inner}`,children:[s.jsx(Ms,{isSettings:m,setActiveTab:o}),e!=null&&e.is_email_verified?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:`${r["tabs-wrap"]} ${m?r["tabs-settings"]:r["tabs-not-settings"]}`,children:s.jsx(ms,{tabsConfig:Z,activeTab:t,setActiveTab:o,styles:r})}),i.body]}):s.jsx(ge,{})]})})}function Pe(){const[e,a,t]=os(),o=p.useCallback(r=>{r.key==="Escape"&&t()},[t]);return p.useEffect(()=>{if(e)return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e,o]),s.jsxs(R.Provider,{value:{openPopup:a},children:[s.jsx(ze,{}),e&&s.jsx(us,{onClose:t})]})}function Ze(){const e=document.getElementById("react-profile");e&&rs.createRoot(e).render(s.jsx(Pe,{}))}export{Ze 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.