Files
MyClub/frontend/build/static/js/main.dd323bc8.js
T
Tomas Dvorak 84a8acf944 update
2026-03-02 20:20:56 +01:00

2 lines
1.7 MiB
Plaintext

"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[792],{418:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_});var a=n(65043),i=n(87139),o=n(22107),r=n(98662),s=n(68659),l=n(44093),c=n(98939),d=n(73212),u=n(33572),h=n(7189),m=n(76659),p=n(96148),x=n(10202),g=n(28846),v=n(39081),j=n(40378),b=n(79219),y=n(1009),f=n(49367),k=n(70579);const _=()=>{const[e,t]=(0,a.useState)([]),[n,_]=(0,a.useState)(!0),w=(0,l.dU)("white","gray.800"),z=(0,l.dU)("gray.200","gray.700"),S="http://localhost:3100";return(0,a.useEffect)(()=>{(async()=>{try{const e=await(0,b.bM)();t(e)}catch(e){console.error("Failed to fetch clothing items:",e)}finally{_(!1)}})()},[]),n?(0,k.jsx)(j.A,{children:(0,k.jsx)(c.m,{maxW:"7xl",py:8,children:(0,k.jsx)(s.o,{minH:"50vh",children:(0,k.jsx)(m.y,{size:"xl",color:"blue.500"})})})}):(0,k.jsxs)(j.A,{children:[(0,k.jsxs)(f.mg,{children:[(0,k.jsx)("title",{children:"Oble\u010den\xed a Fan Shop"}),(0,k.jsx)("meta",{name:"description",content:"Podpo\u0159te sv\u016fj t\xfdm! Oble\u010den\xed, dresy a merchandise na\u0161eho klubu."})]}),(0,k.jsx)(c.m,{maxW:"7xl",py:8,children:(0,k.jsxs)(x.T,{spacing:6,align:"stretch",children:[(0,k.jsxs)(o.a,{children:[(0,k.jsx)(g.D,{as:"h1",size:"xl",mb:3,children:"Oble\u010den\xed a Fan Shop"}),(0,k.jsx)(v.E,{fontSize:"lg",color:"gray.600",children:"Podpo\u0159te sv\u016fj t\xfdm! Prohl\xe9dn\u011bte si na\u0161i nab\xeddku dres\u016f, tri\u010dek a dal\u0161\xedho merchandisingu."}),S&&(0,k.jsx)(o.a,{mt:4,children:(0,k.jsx)(r.$,{as:h.N,href:S,isExternal:!0,colorScheme:"blue",rightIcon:(0,k.jsx)(y.HaR,{}),size:"sm",children:"P\u0159ej\xedt do pln\xe9ho e-shopu"})})]}),0===e.length?(0,k.jsx)(s.o,{minH:"40vh",children:(0,k.jsxs)(x.T,{spacing:3,children:[(0,k.jsx)(v.E,{fontSize:"lg",color:"gray.500",children:"Zat\xedm zde nejsou \u017e\xe1dn\xe9 polo\u017eky."}),(0,k.jsx)(v.E,{fontSize:"sm",color:"gray.400",children:"Brzy zde najdete na\u0161e oble\u010den\xed a merchandise."})]})}):(0,k.jsx)(d.r,{columns:{base:1,sm:2,md:3,lg:4},spacing:6,children:e.map(e=>(0,k.jsx)(h.N,{href:e.url||"#",isExternal:!!e.url,_hover:{textDecoration:"none"},role:"group",children:(0,k.jsxs)(o.a,{bg:w,borderWidth:"1px",borderColor:z,borderRadius:"xl",overflow:"hidden",transition:"all 0.3s",_groupHover:{transform:"translateY(-4px)",boxShadow:"lg"},children:[(0,k.jsxs)(o.a,{position:"relative",paddingTop:"100%",overflow:"hidden",children:[(0,k.jsx)(u._,{src:e.image_url,alt:e.title,position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",fallbackSrc:"/images/placeholder-clothing.jpg"}),e.url&&(0,k.jsx)(o.a,{position:"absolute",top:2,right:2,bg:"white",borderRadius:"full",p:2,opacity:0,_groupHover:{opacity:1},transition:"opacity 0.2s",children:(0,k.jsx)(y.HaR,{size:16})})]}),(0,k.jsxs)(x.T,{align:"stretch",p:4,spacing:2,children:[(0,k.jsx)(g.D,{as:"h3",size:"sm",noOfLines:2,children:e.title}),e.description&&(0,k.jsx)(v.E,{fontSize:"sm",color:"gray.600",noOfLines:2,children:e.description}),(0,k.jsxs)(p.z,{justify:"space-between",mt:2,children:[e.price&&e.price>0?(0,k.jsxs)(i.E,{colorScheme:"blue",fontSize:"md",px:2,py:1,children:[e.price," ",e.currency||"K\u010d"]}):(0,k.jsx)(o.a,{}),e.url&&(0,k.jsx)(v.E,{fontSize:"xs",color:"blue.500",children:"Zobrazit \u2192"})]})]})]})},e.id))})]})})]})}},1029:(e,t,n)=>{n.d(t,{$k:()=>x,C4:()=>v,D:()=>j,Kt:()=>p,Ky:()=>l,NK:()=>g,O3:()=>u,Qc:()=>h,T:()=>d,ds:()=>c,g9:()=>s,hZ:()=>r,w8:()=>m});var a=n(46291);function i(e){var t;if(!e||"object"!==typeof e)return e;const n=null!==(t=e.id)&&void 0!==t?t:e.ID,a=Array.isArray(e.children)?e.children.map(e=>i(e)):void 0;return{id:n,label:e.label,url:e.url,icon:e.icon,type:e.type,page_type:e.page_type,page_id:e.page_id,visible:e.visible,display_order:e.display_order,parent_id:e.parent_id,children:a,target:e.target,css_class:e.css_class,requires_auth:e.requires_auth,requires_admin:e.requires_admin,allow_editor:e.allow_editor}}function o(e){var t;if(!e||"object"!==typeof e)return e;return{id:null!==(t=e.id)&&void 0!==t?t:e.ID,platform:e.platform,url:e.url,display_order:e.display_order,visible:e.visible,icon:e.icon}}const r=async()=>{const e=await a.Ay.get("/navigation");return(Array.isArray(e.data)?e.data:[]).map(e=>i(e))},s=async()=>{const e=await a.Ay.get("/admin/navigation");return(Array.isArray(e.data)?e.data:[]).map(e=>i(e))},l=async e=>i((await a.Ay.post("/admin/navigation",e)).data),c=async(e,t)=>i((await a.Ay.put("/admin/navigation/".concat(e),t)).data),d=async e=>{await a.Ay.delete("/admin/navigation/".concat(e))},u=async e=>{await a.Ay.post("/admin/navigation/reorder",e)},h=async()=>{const e=await a.Ay.get("/admin/navigation/editor");return(Array.isArray(e.data)?e.data:[]).map(e=>i(e))},m=async()=>{const e=await a.Ay.get("/admin/social-links");return(Array.isArray(e.data)?e.data:[]).map(e=>o(e))},p=async e=>o((await a.Ay.post("/admin/social-links",e)).data),x=async(e,t)=>o((await a.Ay.put("/admin/social-links/".concat(e),t)).data),g=async e=>{await a.Ay.delete("/admin/social-links/".concat(e))},v=async e=>{await a.Ay.post("/admin/social-links/reorder",e)},j=async()=>(await a.Ay.post("/admin/navigation/seed",{})).data},1112:(e,t,n)=>{n.r(t),n.d(t,{default:()=>T});var a=n(87139),i=n(22107),o=n(34946),r=n(44093),s=n(98939),l=n(73212),c=n(33572),d=n(35699),u=n(45973),h=n(29244),m=n(61724),p=n(76659),x=n(96148),g=n(29904),v=n(10202),j=n(28846),b=n(39081),y=n(72526),f=n(66286),k=n(25189),_=n(35475),w=n(40378),z=n(81398),S=n(65043),A=n(12733),C=n(74117),E=n(70579);const T=()=>{const{t:e}=(0,C.Bd)(),{data:t,isLoading:n,isError:T}=(0,y.I)({queryKey:["players-all"],queryFn:()=>(0,f.Dq)({active:!1})}),D=(0,r.dU)("white","gray.800"),N=(0,r.dU)("gray.200","gray.700"),R=(0,r.dU)("gray.600","gray.400"),[F,P]=(0,S.useState)(""),[I,M]=(0,S.useState)(""),[L,W]=(0,S.useState)(""),[U,O]=(0,S.useState)(!0),q=(0,S.useMemo)(()=>{const e=(t||[]).map(e=>e.position).filter(Boolean);return Array.from(new Set(e))},[t]),K=(0,S.useMemo)(()=>{let e=(t||[]).slice();if(U&&(e=e.filter(e=>!1!==e.is_active)),I&&(e=e.filter(e=>(e.gender||"").toLowerCase()===I)),L&&(e=e.filter(e=>(e.position||"")===L)),F.trim()){const t=F.trim().toLowerCase();e=e.filter(e=>{const n="".concat(e.first_name," ").concat(e.last_name).trim().toLowerCase(),a=(e.position||"").toLowerCase(),i="number"===typeof e.jersey_number?String(e.jersey_number):"";return n.includes(t)||a.includes(t)||i.includes(t)})}return e},[t,F,I,L,U]);return n?(0,E.jsx)(w.A,{children:(0,E.jsx)(s.m,{maxW:"7xl",py:8,children:(0,E.jsx)(p.y,{})})}):T?(0,E.jsx)(w.A,{children:(0,E.jsx)(s.m,{maxW:"7xl",py:8,children:(0,E.jsx)(b.E,{color:"red.500",children:e("players.loading_error")})})}):(0,E.jsx)(w.A,{children:(0,E.jsxs)(i.a,{children:[(0,E.jsx)(s.m,{maxW:"7xl",py:{base:6,md:10},children:(0,E.jsxs)(v.T,{align:"stretch",spacing:6,children:[(0,E.jsx)(j.D,{as:"h1",size:{base:"xl",md:"2xl"},children:e("players.title")}),(0,E.jsxs)(l.r,{columns:{base:1,md:4},spacing:4,children:[(0,E.jsxs)(u.M,{children:[(0,E.jsx)(h.W,{pointerEvents:"none",children:(0,E.jsx)(A.W,{color:"gray.400"})}),(0,E.jsx)(d.p,{value:F,onChange:e=>P(e.target.value),placeholder:e("players.search_placeholder")})]}),(0,E.jsxs)(m.l,{value:I,onChange:e=>M(e.target.value),placeholder:e("players.gender"),children:[(0,E.jsx)("option",{value:"men",children:e("players.male")}),(0,E.jsx)("option",{value:"women",children:e("players.female")})]}),(0,E.jsx)(m.l,{value:L,onChange:e=>W(e.target.value),placeholder:e("players.position"),children:q.map(e=>(0,E.jsx)("option",{value:e,children:e},e))}),(0,E.jsx)(x.z,{children:(0,E.jsx)(o.S,{isChecked:U,onChange:e=>O(e.target.checked),children:e("players.active_only")})})]}),(0,E.jsx)(l.r,{columns:{base:1,sm:2,md:3,lg:4},spacing:6,children:K.map(e=>(0,E.jsxs)(g.B,{as:_.N_,to:"/hraci/".concat(e.id),borderWidth:"1px",borderColor:N,borderRadius:"lg",p:4,bg:D,_hover:{boxShadow:"lg",transform:"translateY(-4px)"},transition:"all 0.2s ease",spacing:3,children:[(0,E.jsxs)(i.a,{position:"relative",borderRadius:"md",overflow:"hidden",children:[(0,E.jsx)(c._,{src:(0,k.uq)(e.image_url)||"/logo512.png",alt:"".concat(e.first_name," ").concat(e.last_name),objectFit:"cover",w:"100%",h:"240px"}),"number"===typeof e.jersey_number&&(0,E.jsxs)(a.E,{position:"absolute",top:"10px",left:"10px",colorScheme:"blue",fontSize:"0.85rem",px:3,py:1,borderRadius:"md",boxShadow:"sm",children:["#",e.jersey_number]})]}),(0,E.jsxs)(b.E,{fontWeight:"bold",fontSize:"lg",children:[e.first_name," ",e.last_name]}),(0,E.jsx)(b.E,{color:R,children:e.position})]},e.id))})]})}),(0,E.jsx)(z.A,{})]})})}},1352:(e,t,n)=>{n.r(t),n.d(t,{default:()=>j});var a=n(65043),i=n(22107),o=n(98662),r=n(73225),s=n(76668),l=n(35699),c=n(50464),d=n(96148),u=n(10202),h=n(30502),m=n(28846),p=n(39081),x=n(46291),g=n(2367),v=n(70579);const j=()=>{const[e,t]=(0,a.useState)(""),[n,j]=(0,a.useState)(""),[b,y]=(0,a.useState)(""),[f,k]=(0,a.useState)(""),[_,w]=(0,a.useState)(!1),[z,S]=(0,a.useState)("email"),A=(0,h.d)(),C=async t=>{if(t.preventDefault(),e){w(!0);try{await x.Ay.post("/auth/initiate-password-reset",{email:e}),S("code"),A({title:"K\xf3d odesl\xe1n",description:"Ov\u011b\u0159ovac\xed k\xf3d byl odesl\xe1n na v\xe1\u0161 e-mail.",status:"success",duration:5e3,isClosable:!0})}catch(i){var n,a;A({title:"Chyba",description:(null===(n=i.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.message)||"Nepoda\u0159ilo se odeslat ov\u011b\u0159ovac\xed k\xf3d",status:"error",duration:5e3,isClosable:!0})}finally{w(!1)}}},E=async t=>{if(t.preventDefault(),6===n.length){w(!0);try{await x.Ay.post("/auth/verify-reset-code",{email:e,code:n}),S("new_password")}catch(o){var a,i;A({title:"Chyba",description:(null===(a=o.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message)||"Neplatn\xfd ov\u011b\u0159ovac\xed k\xf3d",status:"error",duration:5e3,isClosable:!0})}finally{w(!1)}}},T=async t=>{if(t.preventDefault(),b===f)if(b.length<8)A({title:"Chyba",description:"Heslo mus\xed m\xedt alespo\u0148 8 znak\u016f",status:"error",duration:5e3,isClosable:!0});else{w(!0);try{await x.Ay.post("/auth/complete-password-reset",{email:e,code:n,new_password:b}),S("success"),A({title:"\xdasp\u011bch",description:"Va\u0161e heslo bylo \xfasp\u011b\u0161n\u011b zm\u011bn\u011bno. Nyn\xed se m\u016f\u017eete p\u0159ihl\xe1sit.",status:"success",duration:5e3,isClosable:!0})}catch(o){var a,i;A({title:"Chyba",description:(null===(a=o.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message)||"Nepoda\u0159ilo se zm\u011bnit heslo",status:"error",duration:5e3,isClosable:!0})}finally{w(!1)}}else A({title:"Chyba",description:"Hesla se neshoduj\xed",status:"error",duration:5e3,isClosable:!0})};return(0,v.jsx)(i.a,{minH:"100vh",display:"flex",alignItems:"center",justifyContent:"center",bg:"gray.50",p:4,children:(0,v.jsx)(i.a,{w:"100%",maxW:"md",p:8,bg:"white",borderWidth:1,borderRadius:8,boxShadow:"lg",children:(()=>{switch(z){case"email":return(0,v.jsxs)(u.T,{as:"form",onSubmit:C,spacing:4,align:"stretch",children:[(0,v.jsx)(m.D,{as:"h2",size:"lg",textAlign:"center",mb:4,children:"Obnova hesla"}),(0,v.jsx)(p.E,{textAlign:"center",mb:4,children:"Zadejte e-mailovou adresu va\u0161eho \xfa\u010dtu. Po\u0161leme v\xe1m ov\u011b\u0159ovac\xed k\xf3d pro obnovu hesla."}),(0,v.jsxs)(r.MJ,{id:"email",isRequired:!0,children:[(0,v.jsx)(s.l,{children:"E-mail"}),(0,v.jsx)(l.p,{type:"email",value:e,onChange:e=>t(e.target.value),placeholder:"vas@email.cz",size:"lg"})]}),(0,v.jsx)(o.$,{type:"submit",colorScheme:"blue",size:"lg",isLoading:_,loadingText:"Odes\xedl\xe1n\xed...",children:"Odeslat ov\u011b\u0159ovac\xed k\xf3d"})]});case"code":return(0,v.jsxs)(u.T,{as:"form",onSubmit:E,spacing:6,align:"center",children:[(0,v.jsx)(m.D,{as:"h2",size:"lg",textAlign:"center",children:"Ov\u011b\u0159te svou identitu"}),(0,v.jsxs)(p.E,{textAlign:"center",children:["Zadejte 6m\xedstn\xfd ov\u011b\u0159ovac\xed k\xf3d, kter\xfd jsme zaslali na adresu ",e]}),(0,v.jsx)(d.z,{spacing:3,justify:"center",children:(0,v.jsx)(c.c,{value:n,onChange:e=>j(e),isDisabled:_,autoFocus:!0,otp:!0,children:[...Array(6)].map((e,t)=>(0,v.jsx)(c.M,{},t))})}),(0,v.jsx)(o.$,{type:"submit",colorScheme:"blue",size:"lg",isDisabled:6!==n.length,isLoading:_,loadingText:"Ov\u011b\u0159ov\xe1n\xed...",width:"100%",children:"Ov\u011b\u0159it k\xf3d"}),(0,v.jsx)(o.$,{variant:"link",onClick:()=>S("email"),isDisabled:_,children:"Zm\u011bnit e-mail"})]});case"new_password":return(0,v.jsxs)(u.T,{as:"form",onSubmit:T,spacing:4,align:"stretch",children:[(0,v.jsx)(m.D,{as:"h2",size:"lg",textAlign:"center",children:"Nastaven\xed nov\xe9ho hesla"}),(0,v.jsxs)(p.E,{textAlign:"center",mb:4,children:["Zadejte nov\xe9 heslo pro v\xe1\u0161 \xfa\u010det ",e]}),(0,v.jsxs)(r.MJ,{id:"newPassword",isRequired:!0,children:[(0,v.jsxs)(s.l,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,v.jsx)(i.a,{children:"Nov\xe9 heslo"}),(0,v.jsx)(g.II,{})]}),(0,v.jsx)(l.p,{type:"password",value:b,onChange:e=>y(e.target.value),placeholder:"Zadejte nov\xe9 heslo",size:"lg"})]}),(0,v.jsxs)(r.MJ,{id:"confirmPassword",isRequired:!0,children:[(0,v.jsx)(s.l,{children:"Potvrzen\xed hesla"}),(0,v.jsx)(l.p,{type:"password",value:f,onChange:e=>k(e.target.value),placeholder:"Zadejte heslo znovu",size:"lg"})]}),(0,v.jsx)(o.$,{type:"submit",colorScheme:"blue",size:"lg",isLoading:_,loadingText:"Ukl\xe1d\xe1n\xed...",isDisabled:!b||b!==f,children:"Nastavit nov\xe9 heslo"})]});case"success":return(0,v.jsxs)(u.T,{spacing:6,textAlign:"center",children:[(0,v.jsx)(i.a,{p:4,bg:"green.50",borderRadius:"md",width:"100%",children:(0,v.jsx)(p.E,{color:"green.800",fontWeight:"medium",children:"Va\u0161e heslo bylo \xfasp\u011b\u0161n\u011b zm\u011bn\u011bno!"})}),(0,v.jsx)(p.E,{children:"Nyn\xed se m\u016f\u017eete p\u0159ihl\xe1sit pomoc\xed sv\xe9ho nov\xe9ho hesla."}),(0,v.jsx)(o.$,{as:"a",href:"/login",colorScheme:"blue",size:"lg",width:"100%",children:"P\u0159ej\xedt na p\u0159ihl\xe1\u0161en\xed"})]});default:return null}})()})})}},1540:(e,t,n)=>{n.r(t),n.d(t,{default:()=>D});var a=n(89379),i=n(65043),o=n(44093),r=n(30502),s=n(22107),l=n(5371),c=n(96148),d=n(98662),u=n(87139),h=n(80511),m=n(3313),p=n(55395),x=n(83201),g=n(82595),v=n(67813),j=n(39081),b=n(35699),y=n(42703),f=n(10202),k=n(1009),_=n(70082),w=n(6583),z=n(25011),S=n(28846),A=n(70579);const C=e=>{let{title:t,description:n,icon:a,badge:i,action:r,children:h}=e;const m=(0,o.dU)("gray.200","gray.700"),p=(0,o.dU)("blue.50","blue.900"),x=(0,o.dU)("blue.600","blue.300");return(0,A.jsxs)(s.a,{mb:8,pb:6,borderBottomWidth:"1px",borderColor:m,children:[(0,A.jsxs)(l.s,{justify:"space-between",align:"flex-start",wrap:"wrap",gap:4,children:[(0,A.jsxs)(c.z,{spacing:4,align:"flex-start",flex:1,children:[a&&(0,A.jsx)(s.a,{p:3,bg:p,borderRadius:"xl",display:{base:"none",md:"block"},children:(0,A.jsx)(z.I,{as:a,boxSize:6,color:x})}),(0,A.jsxs)(f.T,{align:"flex-start",spacing:2,flex:1,children:[(0,A.jsxs)(c.z,{spacing:3,wrap:"wrap",children:[(0,A.jsx)(S.D,{size:"xl",fontWeight:"extrabold",bgGradient:(0,o.dU)("linear(to-r, gray.800, gray.600)","linear(to-r, white, gray.300)"),bgClip:"text",children:t}),i&&(0,A.jsx)(u.E,{colorScheme:i.colorScheme||"blue",fontSize:"sm",px:3,py:1,borderRadius:"full",children:i.label})]}),n&&(0,A.jsx)(j.E,{color:(0,o.dU)("gray.600","gray.400"),fontSize:"md",maxW:"2xl",children:n})]})]}),r&&(0,A.jsx)(d.$,{leftIcon:r.icon,onClick:r.onClick,colorScheme:r.colorScheme||"blue",isLoading:r.isLoading,isDisabled:r.isDisabled,size:"lg",shadow:"sm",_hover:{shadow:"md",transform:"translateY(-1px)"},transition:"all 0.2s",children:r.label})]}),h]})};var E=n(35200),T=n(46291);const D=()=>{const e=(0,o.dU)("white","gray.800"),t=(0,r.d)(),[n,z]=(0,i.useState)([]),[S,D]=(0,i.useState)(!1),[N,R]=(0,i.useState)({}),[F,P]=(0,i.useState)(null),[I,M]=(0,i.useState)(!1),{confirm:L}=(0,E.G)(),W=async()=>{D(!0);try{const e=await(0,_.hA)();z(e||[])}catch(e){t({title:"Chyba p\u0159i na\u010d\xedt\xe1n\xed",description:(null===e||void 0===e?void 0:e.message)||"Nelze na\u010d\xedst aliasy",status:"error"})}finally{D(!1)}};(0,i.useEffect)(()=>{W().then(async()=>{await U()})},[]);const U=async()=>{try{const e=(e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")){const t=new URL(T.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}})("/cache/prefetch/facr_club_info.json"),n=await fetch(e,{cache:"no-cache"});if(!n.ok)return;const a=await n.json(),i=Array.isArray(null===a||void 0===a?void 0:a.competitions)?a.competitions:[],o=await(0,_.hA)(),r=new Set((o||[]).map(e=>e.code)),s=i.map(e=>({code:String(e.code||e.id||"").trim(),name:String(e.name||"").trim()})).filter(e=>e.code).filter(e=>!r.has(e.code));if(!s.length)return;await Promise.all(s.map(e=>(0,_.V1)(e.code,{alias:e.name||e.code,original_name:e.name||void 0}))),await W(),t({title:"Alias sout\u011b\u017e\xed dopln\u011bny",description:"P\u0159id\xe1no: ".concat(s.length),status:"success",duration:3e3})}catch(e){}},O=(0,i.useMemo)(()=>{if(!n)return[];if(I)return n;const e=e=>!e||e<=0?Number.MAX_SAFE_INTEGER:e;return[...n].sort((t,n)=>{const a=e(t.display_order),i=e(n.display_order);return a!==i?a-i:t.code.localeCompare(n.code)})},[n,I]),q=async()=>{const e=Object.entries(N);if(e.length){D(!0);try{for(const[t,n]of e){var a;if(null===n||void 0===n||null===(a=n.alias)||void 0===a||!a.trim())throw new Error("Alias je povinn\xfd pro ".concat(t))}const i=await Promise.all(e.map(e=>{let[t,a]=e;const i=n.find(e=>e.code===t),o={alias:a.alias.trim()};return null!==i&&void 0!==i&&i.original_name&&(o.original_name=i.original_name),(0,_.V1)(t,o)}));z(e=>{const t=new Map(e.map(e=>[e.code,e]));for(const n of i)t.set(n.code,n);return Array.from(t.values()).sort((e,t)=>e.code.localeCompare(t.code))}),R({}),t({title:"V\u0161e ulo\u017eeno",status:"success"})}catch(i){t({title:"Hromadn\xe9 ulo\u017een\xed selhalo",description:(null===i||void 0===i?void 0:i.message)||"Zkuste znovu",status:"error"})}finally{D(!1)}}else t({title:"Nic k ulo\u017een\xed",status:"info"})},K=Object.keys(N).length>0,B=()=>{P(null)};return(0,A.jsx)(w.A,{requireAdmin:!1,children:(0,A.jsxs)(s.a,{maxW:"1400px",mx:"auto",children:[(0,A.jsx)(C,{title:"Alias sout\u011b\u017e\xed",description:"Spravujte zobrazovan\xe9 n\xe1zvy sout\u011b\u017e\xed. M\u016f\u017eete je importovat z cache (FACR) a upravit aliasy."}),(0,A.jsxs)(l.s,{align:"center",justify:"space-between",mb:6,wrap:"wrap",gap:3,bg:e,p:4,borderRadius:"lg",shadow:"sm",borderWidth:"1px",borderColor:"gray.200",children:[(0,A.jsx)(c.z,{spacing:3,children:I?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(d.$,{leftIcon:(0,A.jsx)(k.Bc_,{}),onClick:async()=>{D(!0);try{const e=n.map((e,t)=>({code:e.code,display_order:t+1}));await(0,_.BI)(e),t({title:"Po\u0159ad\xed ulo\u017eeno",status:"success"}),M(!1),await W()}catch(e){t({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed po\u0159ad\xed",description:(null===e||void 0===e?void 0:e.message)||"Zkuste znovu",status:"error"})}finally{D(!1)}},isLoading:S,colorScheme:"green",size:"md",children:"Ulo\u017eit po\u0159ad\xed"}),(0,A.jsx)(d.$,{onClick:()=>{M(!1),W()},isDisabled:S,variant:"outline",size:"md",children:"Zru\u0161it"})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(d.$,{leftIcon:(0,A.jsx)(k.wO2,{}),onClick:W,isLoading:S,variant:"outline",size:"md",_hover:{bg:"gray.50",borderColor:"gray.400"},children:"Obnovit"}),(0,A.jsxs)(d.$,{leftIcon:(0,A.jsx)(k.Bc_,{}),onClick:q,isDisabled:!K,isLoading:S,colorScheme:"green",size:"md",variant:K?"solid":"outline",_hover:K?{bg:"green.600"}:{},children:["Ulo\u017eit v\u0161e ",K&&(0,A.jsx)(u.E,{ml:2,colorScheme:"green",variant:"solid",children:Object.keys(N).length})]}),(0,A.jsx)(d.$,{leftIcon:(0,A.jsx)(k.PfQ,{}),onClick:()=>M(!0),isLoading:S,colorScheme:"purple",size:"md",variant:"outline",_hover:{bg:"purple.50",borderColor:"purple.400"},children:"Zm\u011bnit po\u0159ad\xed"})]})}),!I&&(0,A.jsx)(d.$,{leftIcon:(0,A.jsx)(k.a4x,{}),onClick:async()=>{D(!0);try{const e=(e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")){const t=new URL(T.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}})("/cache/prefetch/facr_club_info.json"),n=await fetch(e,{cache:"no-cache"});if(!n.ok)throw new Error("HTTP ".concat(n.status));const a=await n.json(),i=Array.isArray(null===a||void 0===a?void 0:a.competitions)?a.competitions:[],o=await(0,_.hA)(),r=new Set((o||[]).map(e=>e.code)),s=i.map(e=>({code:String(e.code||e.id||"").trim(),name:String(e.name||"").trim()})).filter(e=>e.code).filter(e=>!r.has(e.code));if(!s.length)return void t({title:"\u017d\xe1dn\xe9 nov\xe9 sout\u011b\u017ee",description:"V\u0161echny sout\u011b\u017ee ji\u017e maj\xed alias.",status:"info"});await Promise.all(s.map(e=>(0,_.V1)(e.code,{alias:e.name||e.code,original_name:e.name||void 0}))),await W(),t({title:"Import dokon\u010den",description:"P\u0159id\xe1no: ".concat(s.length),status:"success"})}catch(e){t({title:"Import selhal",description:(null===e||void 0===e?void 0:e.message)||"Nelze na\u010d\xedst FACR sout\u011b\u017ee",status:"error"})}finally{D(!1)}},isLoading:S,colorScheme:"blue",size:"md",shadow:"sm",children:"Importovat ze sout\u011b\u017e\xed"})]}),(0,A.jsx)(s.a,{bg:e,borderWidth:"1px",borderColor:"gray.200",borderRadius:"lg",overflow:"hidden",shadow:"sm",children:(0,A.jsx)(s.a,{overflowX:"auto",children:(0,A.jsxs)(h.X,{variant:"simple",size:"md",children:[(0,A.jsx)(m.d,{bg:(0,o.dU)("gray.50","gray.900"),children:(0,A.jsxs)(p.Tr,{children:[I&&(0,A.jsx)(x.Th,{width:"60px",textTransform:"uppercase",fontSize:"xs",fontWeight:"bold",color:"gray.600",letterSpacing:"wide",children:"Po\u0159ad\xed"}),(0,A.jsx)(x.Th,{width:"200px",textTransform:"uppercase",fontSize:"xs",fontWeight:"bold",color:"gray.600",letterSpacing:"wide",children:"K\xf3d"}),!I&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(x.Th,{textTransform:"uppercase",fontSize:"xs",fontWeight:"bold",color:"gray.600",letterSpacing:"wide",children:"P\u016fvodn\xed n\xe1zev"}),(0,A.jsx)(x.Th,{textTransform:"uppercase",fontSize:"xs",fontWeight:"bold",color:"gray.600",letterSpacing:"wide",children:"Alias"}),(0,A.jsx)(x.Th,{isNumeric:!0,textTransform:"uppercase",fontSize:"xs",fontWeight:"bold",color:"gray.600",letterSpacing:"wide",children:"Akce"})]}),I&&(0,A.jsx)(x.Th,{textTransform:"uppercase",fontSize:"xs",fontWeight:"bold",color:"gray.600",letterSpacing:"wide",children:"Alias"})]})}),(0,A.jsxs)(g.N,{children:[O.map((e,i)=>{var o;const r=null!==(o=N[e.code])&&void 0!==o?o:{alias:e.alias},l=void 0!==N[e.code];return I?(0,A.jsxs)(p.Tr,{draggable:!0,onDragStart:e=>((e,t)=>{P(t),e.dataTransfer.effectAllowed="move"})(e,i),onDragOver:e=>((e,t)=>{if(e.preventDefault(),null===F||F===t)return;const a=[...n],i=a[F];a.splice(F,1),a.splice(t,0,i),z(a),P(t)})(e,i),onDragEnd:B,cursor:"move",bg:F===i?"blue.50":void 0,_hover:{bg:"gray.100"},transition:"background 0.15s",opacity:F===i?.5:1,children:[(0,A.jsx)(v.Td,{children:(0,A.jsxs)(c.z,{spacing:2,children:[(0,A.jsx)(s.a,{as:k.PfQ,color:"gray.500"}),(0,A.jsx)(j.E,{fontWeight:"bold",color:"gray.700",children:i+1})]})}),(0,A.jsx)(v.Td,{children:(0,A.jsx)(u.E,{colorScheme:"blue",variant:"subtle",fontFamily:"mono",fontSize:"sm",px:2,py:1,children:e.code})}),(0,A.jsx)(v.Td,{children:(0,A.jsx)(j.E,{fontSize:"sm",fontWeight:"medium",children:e.alias})})]},e.code):(0,A.jsxs)(p.Tr,{_hover:{bg:"gray.50"},transition:"background 0.15s",children:[(0,A.jsx)(v.Td,{children:(0,A.jsxs)(c.z,{children:[(0,A.jsx)(u.E,{colorScheme:"blue",variant:"subtle",fontFamily:"mono",fontSize:"sm",px:2,py:1,children:e.code}),l&&(0,A.jsx)(s.a,{as:k.Pj4,color:"orange.500",size:14})]})}),(0,A.jsx)(v.Td,{children:(0,A.jsx)(j.E,{fontSize:"sm",color:"gray.600",fontWeight:"medium",children:e.original_name||(0,A.jsx)(j.E,{as:"span",color:"gray.400",children:"\u2014"})})}),(0,A.jsx)(v.Td,{children:(0,A.jsx)(b.p,{size:"md",value:r.alias,onChange:t=>R(n=>(0,a.A)((0,a.A)({},n),{},{[e.code]:{alias:t.target.value}})),bg:l?"orange.50":"white",borderColor:l?"orange.300":"gray.200",_hover:{borderColor:l?"orange.400":"blue.300",bg:"white"},_focus:{borderColor:"blue.500",bg:"white",shadow:"sm"},fontWeight:"medium"})}),(0,A.jsx)(v.Td,{isNumeric:!0,children:(0,A.jsxs)(c.z,{justify:"flex-end",spacing:2,children:[(0,A.jsx)(y.K,{"aria-label":"Ulo\u017eit",icon:(0,A.jsx)(k.Bc_,{}),size:"sm",onClick:()=>(async e=>{var i;const o=N[e];if(o)if(null!==(i=o.alias)&&void 0!==i&&i.trim())try{const i=n.find(t=>t.code===e),r={alias:o.alias.trim()};null!==i&&void 0!==i&&i.original_name&&(r.original_name=i.original_name);const s=await(0,_.V1)(e,r);z(t=>t.map(t=>t.code===e?s:t)),R(t=>{const n=(0,a.A)({},t);return delete n[e],n}),t({title:"Ulo\u017eeno",status:"success"})}catch(r){t({title:"Ulo\u017een\xed selhalo",description:(null===r||void 0===r?void 0:r.message)||"Zkuste znovu",status:"error"})}else t({title:"Alias je povinn\xfd",status:"warning"})})(e.code),colorScheme:"green",variant:"ghost",_hover:{bg:"green.50"}}),(0,A.jsx)(y.K,{"aria-label":"Smazat",icon:(0,A.jsx)(k.IXo,{}),size:"sm",colorScheme:"red",variant:"ghost",_hover:{bg:"red.50"},onClick:()=>(async e=>{if(await L({title:"Smazat alias",message:"Smazat alias pro sout\u011b\u017e ".concat(e,"?"),confirmText:"Smazat",cancelText:"Zru\u0161it",isDanger:!0}))try{await(0,_.hv)(e),z(t=>t.filter(t=>t.code!==e)),R(t=>{const n=(0,a.A)({},t);return delete n[e],n}),t({title:"Smaz\xe1no",status:"success"})}catch(n){t({title:"Smaz\xe1n\xed selhalo",description:(null===n||void 0===n?void 0:n.message)||"Zkuste znovu",status:"error"})}})(e.code)})]})})]},e.code)}),0===O.length&&(0,A.jsx)(p.Tr,{children:(0,A.jsx)(v.Td,{colSpan:4,children:(0,A.jsxs)(f.T,{py:12,spacing:3,children:[(0,A.jsx)(s.a,{color:"gray.300",fontSize:"4xl",children:(0,A.jsx)(k.Pj4,{})}),(0,A.jsx)(j.E,{color:"gray.500",fontSize:"md",fontWeight:"medium",children:"\u017d\xe1dn\xe9 aliasy zat\xedm nejsou"}),(0,A.jsx)(j.E,{color:"gray.400",fontSize:"sm",children:"Importujte ze sout\u011b\u017e\xed (FACR) pomoc\xed tla\u010d\xedtka naho\u0159e"})]})})})]})]})})}),O.length>0&&(0,A.jsx)(s.a,{mt:4,p:4,bg:(0,o.dU)("gray.50","gray.900"),borderRadius:"md",borderWidth:"1px",borderColor:"gray.200",children:(0,A.jsxs)(c.z,{justify:"space-between",wrap:"wrap",children:[(0,A.jsxs)(j.E,{fontSize:"sm",color:"gray.600",children:["Celkem alias\u016f: ",(0,A.jsx)(u.E,{colorScheme:"blue",ml:1,children:O.length})]}),K&&(0,A.jsxs)(c.z,{spacing:2,children:[(0,A.jsxs)(u.E,{colorScheme:"orange",variant:"subtle",children:[Object.keys(N).length," neulo\u017een\xfdch zm\u011bn"]}),(0,A.jsx)(d.$,{size:"sm",colorScheme:"green",onClick:q,leftIcon:(0,A.jsx)(k.Bc_,{}),children:"Ulo\u017eit v\u0161e"})]})]})})]})})}},2210:(e,t,n)=>{n.r(t),n.d(t,{default:()=>b});var a=n(89379),i=n(65043),o=n(22107),r=n(98662),s=n(44093),l=n(73225),c=n(10804),d=n(35699),u=n(10202),h=n(30502),m=n(39081),p=n(24858),x=n(66286),g=n(82047),v=n(74117),j=n(70579);function b(){const{t:e}=(0,v.Bd)(),[t,n]=(0,i.useState)(!1),b=(0,h.d)(),{register:y,handleSubmit:f,reset:k,formState:{errors:_}}=(0,p.mN)(),w=(0,s.dU)("gray.800","white"),z=(0,s.dU)("gray.600","gray.300"),S=(0,s.dU)("gray.500","gray.400");return(0,j.jsx)(o.a,{w:"100%",maxW:"xl",mx:"auto",p:4,children:(0,j.jsxs)(u.T,{spacing:3,align:"stretch",children:[(0,j.jsx)(m.E,{fontSize:"xl",fontWeight:"bold",textAlign:"center",color:w,children:e("newsletter.subscribe")}),(0,j.jsx)(m.E,{textAlign:"center",color:z,mb:2,children:e("newsletter.subscribe_description")}),(0,j.jsx)("form",{onSubmit:f(async t=>{n(!0);try{await(0,x.ZG)(t.email),(0,g.$n)(window.location.pathname),(0,g.w)("Newsletter Subscribe",!0),b({title:e("newsletter.subscribe_success"),description:e("newsletter.subscribe_success_desc"),status:"success",duration:7e3,isClosable:!0});try{window.dispatchEvent(new CustomEvent("engagement:refresh"))}catch(a){}k()}catch(i){const t=i instanceof Error?i.message:e("newsletter.subscribe_error_desc");(0,g.w)("Newsletter Subscribe",!1),b({title:e("newsletter.subscribe_error"),description:t,status:"error",duration:5e3,isClosable:!0})}finally{n(!1)}}),children:(0,j.jsxs)(u.T,{spacing:3,children:[(0,j.jsxs)(l.MJ,{isInvalid:!!_.email,children:[(0,j.jsx)(d.p,(0,a.A)((0,a.A)({id:"email",type:"email",placeholder:e("newsletter.email_label"),autoComplete:"email"},y("email",{required:e("newsletter.email_required"),pattern:{value:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,message:e("newsletter.email_invalid")}})),{},{size:"md",disabled:t})),(0,j.jsx)(c.Wt,{children:_.email&&_.email.message})]}),(0,j.jsx)(r.$,{type:"submit",colorScheme:"blue",size:"md",width:"100%",isLoading:t,loadingText:e("newsletter.loading"),"data-umami-event":"Newsletter Submit","data-umami-event-location":window.location.pathname,children:e("newsletter.subscribe_button")})]})}),(0,j.jsx)(m.E,{fontSize:"xs",color:S,textAlign:"center",mt:2,children:e("newsletter.consent_text")})]})})}},2367:(e,t,n)=>{n.d(t,{II:()=>b,tX:()=>j});n(65043);var a=n(22107),i=n(44093),o=n(25011),r=n(82846),s=n(15983),l=n(33192),c=n(91765),d=n(75780),u=n(22205),h=n(96148),m=n(29904),p=n(39081),x=n(4875),g=n(17401),v=n(70579);const j=e=>{let{label:t,title:n,items:j,showStrengthBars:b=!1}=e;const y=(0,i.dU)("white","gray.800"),f=(0,i.dU)("gray.200","gray.700"),k=(0,i.dU)("white","gray.700"),_=(0,i.dU)("gray.200","gray.600"),w=(0,i.dU)("gray.600","gray.200");return(0,v.jsxs)(r.A,{trigger:"hover",openDelay:150,closeDelay:100,placement:"right-start",children:[(0,v.jsx)(d.W,{children:(0,v.jsx)(a.a,{as:"button",type:"button",borderRadius:"full",bg:k,borderWidth:"1px",borderColor:_,boxShadow:"sm",fontSize:"xs",fontWeight:"medium",_hover:{boxShadow:"md",transform:"translateY(-1px)"},transition:"all 0.15s ease-out",display:"inline-flex",alignItems:"center",justifyContent:"center",w:"18px",h:"18px","aria-label":t,children:(0,v.jsx)(o.I,{as:g.Y,boxSize:3,color:w})})}),(0,v.jsx)(u.Z,{children:(0,v.jsxs)(c.h,{maxW:"sm",bg:y,borderColor:f,boxShadow:"2xl",borderRadius:"xl",_focus:{boxShadow:"2xl"},children:[(0,v.jsx)(s.R,{}),(0,v.jsx)(l.e,{p:4,children:(0,v.jsxs)(m.B,{spacing:3,children:[b&&(0,v.jsxs)(h.z,{spacing:1.5,children:[(0,v.jsx)(a.a,{flex:"1",h:"2px",borderRadius:"full",bg:"red.400"}),(0,v.jsx)(a.a,{flex:"1",h:"2px",borderRadius:"full",bg:"orange.400"}),(0,v.jsx)(a.a,{flex:"1",h:"2px",borderRadius:"full",bg:"green.400"})]}),(0,v.jsx)(p.E,{fontSize:"sm",fontWeight:"semibold",children:n}),j&&j.length>0&&(0,v.jsx)(m.B,{as:"ul",spacing:1.5,pl:0,m:0,style:{listStyle:"none"},children:j.map(e=>(0,v.jsxs)(h.z,{as:"li",align:"flex-start",spacing:2,children:[(0,v.jsx)(o.I,{as:x.C,color:"green.400",boxSize:3.5,mt:.5}),(0,v.jsx)(p.E,{fontSize:"sm",color:"gray.700",_dark:{color:"gray.200"},children:e})]},e))})]})})]})})]})},b=e=>{let{label:t="Po\u017eadavky na heslo"}=e;return(0,v.jsx)(j,{label:t,title:"Siln\xe9 heslo by m\u011blo obsahovat:",items:["Minim\xe1ln\u011b 8 znak\u016f (povinn\xe9)","Kombinaci mal\xfdch a velk\xfdch p\xedsmen","\u010c\xedsla a ide\xe1ln\u011b speci\xe1ln\xed znaky"],showStrengthBars:!0})}},2836:(e,t,n)=>{n.r(t),n.d(t,{default:()=>H});var a=n(89379),i=n(96870),o=n(87139),r=n(22107),s=n(98662),l=n(42703),c=n(44093),d=n(73225),u=n(76668),h=n(33572),m=n(35699),p=n(7189),x=n(67516),g=n(35929),v=n(56529),j=n(15071),b=n(11054),y=n(78460),f=n(85421),k=n(97569),_=n(61724),w=n(96148),z=n(10202),S=n(98481),A=n(80511),C=n(82595),E=n(67813),T=n(83201),D=n(3313),N=n(55395),R=n(30502),F=n(28846),P=n(39081),I=n(65043),M=n(72526),L=n(59781),W=n(12836),U=n(1009),O=n(6583),q=n(35200),K=n(91296),B=n(46291),Z=n(88500),V=n(70579);const H=()=>{var e;(0,c.dU)("white","gray.800"),(0,c.dU)("gray.200","gray.700"),(0,c.dU)("white","gray.700");const t=e=>{if(!e||""===e)return"/sponsor-placeholder.svg";if(/^https?:\/\//i.test(e))return e;const t=new URL(B.API_URL,window.location.origin).origin;return e.startsWith("/uploads/")?"".concat(t).concat(e):"".concat(t).concat(e.startsWith("/")?"":"/").concat(e)},n=(0,R.d)(),H=(0,L.jE)(),{data:$,isLoading:J}=(0,M.I)({queryKey:["admin-sponsors"],queryFn:K.sJ}),[G,X]=(0,I.useState)(null),{isOpen:Y,onOpen:Q,onClose:ee}=(0,i.j)(),{confirm:te}=(0,q.G)(),ne=()=>{X(null),ee()},ae=(0,W.n)({mutationFn:e=>(0,K.rR)(e),onSuccess:e=>{try{H.setQueryData(["admin-sponsors"],t=>{const n=Array.isArray(t)?t:(null===t||void 0===t?void 0:t.data)||[],i=[e,...n];return t&&t.data?(0,a.A)((0,a.A)({},t),{},{data:i}):i})}catch(t){}n({title:"Sponzor vytvo\u0159en",status:"success"}),H.invalidateQueries({queryKey:["admin-sponsors"]}),ne()},onError:e=>{var t,a;return n({title:"Vytvo\u0159en\xed selhalo",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.chyba)||"Chyba",status:"error"})}}),ie=(0,W.n)({mutationFn:e=>{let{id:t,payload:n}=e;return(0,K.gm)(t,n)},onSuccess:e=>{try{H.setQueryData(["admin-sponsors"],t=>{const n=((Array.isArray(t)?t:(null===t||void 0===t?void 0:t.data)||[])||[]).map(t=>(null===t||void 0===t?void 0:t.id)===(null===e||void 0===e?void 0:e.id)?(0,a.A)((0,a.A)({},t),e):t);return t&&t.data?(0,a.A)((0,a.A)({},t),{},{data:n}):n})}catch(t){}n({title:"Sponzor aktualizov\xe1n",status:"success"}),H.invalidateQueries({queryKey:["admin-sponsors"]}),ne()},onError:e=>{var t,a;return n({title:"Aktualizace selhala",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.chyba)||"Chyba",status:"error"})}}),oe=(0,W.n)({mutationFn:e=>(0,K.Sm)(e),onSuccess:()=>{n({title:"Sponzor smaz\xe1n",status:"success"}),H.invalidateQueries({queryKey:["admin-sponsors"]})},onError:e=>{var t,a;return n({title:"Smaz\xe1n\xed selhalo",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.chyba)||"Chyba",status:"error"})}});return(0,V.jsx)(O.A,{requireAdmin:!1,children:(0,V.jsxs)(r.a,{children:[(0,V.jsxs)(w.z,{justify:"space-between",mb:4,children:[(0,V.jsx)(F.D,{size:"lg",children:"Spr\xe1va sponzor\u016f"}),(0,V.jsx)(s.$,{leftIcon:(0,V.jsx)(U.GGD,{}),colorScheme:"blue",onClick:()=>{X({name:"",is_active:!0,tier:"standard",display_order:0}),Q()},children:"Nov\xfd sponzor"})]}),(0,V.jsx)(P.E,{color:"gray.500",mb:6,children:"Spr\xe1va sponzor\u016f a partner\u016f klubu. M\u016f\u017eete p\u0159id\xe1vat, upravovat a odeb\xedrat sponzory, kte\u0159\xed se zobrazuj\xed na webu."}),(0,V.jsx)(r.a,{bg:(0,c.dU)("white","gray.800"),borderWidth:"1px",borderRadius:"lg",overflowX:"auto",boxShadow:"sm",mb:6,children:(0,V.jsxs)(A.X,{size:"sm",children:[(0,V.jsx)(D.d,{children:(0,V.jsxs)(N.Tr,{children:[(0,V.jsx)(T.Th,{w:"80px",children:"Logo"}),(0,V.jsx)(T.Th,{children:"N\xe1zev"}),(0,V.jsx)(T.Th,{children:"\xdarove\u0148"}),(0,V.jsx)(T.Th,{children:"Po\u0159ad\xed"}),(0,V.jsx)(T.Th,{children:"Web"}),(0,V.jsx)(T.Th,{w:"120px",children:"Aktivn\xed"}),(0,V.jsx)(T.Th,{w:"160px",children:"Akce"})]})}),(0,V.jsxs)(C.N,{children:[J&&(0,V.jsx)(N.Tr,{children:(0,V.jsx)(E.Td,{colSpan:7,children:"Na\u010d\xedt\xe1m..."})}),!J&&($||[]).map(e=>{var i;return(0,V.jsxs)(N.Tr,{opacity:e.is_active?1:.6,children:[(0,V.jsx)(E.Td,{children:(0,V.jsx)(h._,{src:t(e.logo_url),alt:e.name,boxSize:"48px",objectFit:"contain"})}),(0,V.jsx)(E.Td,{children:e.name}),(0,V.jsx)(E.Td,{children:(0,V.jsx)(o.E,{colorScheme:"general"===e.tier?"green":"blue",children:"general"===e.tier?"Hlavn\xed partner":"Partner"})}),(0,V.jsx)(E.Td,{children:null!==(i=e.display_order)&&void 0!==i?i:0}),(0,V.jsx)(E.Td,{children:e.website_url?(0,V.jsxs)(w.z,{children:[(0,V.jsx)(p.N,{href:e.website_url,color:"blue.500",isExternal:!0,fontSize:"sm",children:e.website_url}),(0,V.jsx)(U.HaR,{})]}):"-"}),(0,V.jsx)(E.Td,{children:(0,V.jsx)(S.d,{isChecked:!!e.is_active,onChange:()=>(async e=>{if(null!=e.id)try{await ie.mutateAsync({id:e.id,payload:{is_active:!e.is_active}}),n({title:"Stav sponzora aktualizov\xe1n",status:"success"})}catch(t){n({title:"Aktualizace selhala",status:"error"})}})(e)})}),(0,V.jsx)(E.Td,{children:(0,V.jsxs)(w.z,{spacing:2,children:[(0,V.jsx)(l.K,{"aria-label":"Upravit",icon:(0,V.jsx)(U.WXf,{}),size:"sm",onClick:()=>(e=>{X((0,a.A)({},e)),Q()})(e)}),(0,V.jsx)(l.K,{"aria-label":"Smazat",icon:(0,V.jsx)(U.IXo,{}),size:"sm",colorScheme:"red",variant:"outline",onClick:async()=>{if(await te({title:"Smazat sponzora",message:'Opravdu chcete smazat sponzora "'.concat(e.name,'"?'),confirmText:"Smazat",cancelText:"Zru\u0161it",isDanger:!0}))try{await oe.mutateAsync(e.id),n({title:"Sponzor smaz\xe1n",status:"success"})}catch(t){n({title:"Smaz\xe1n\xed sponzora selhalo",status:"error"})}}})]})})]},e.id)})]})]})}),(0,V.jsxs)(y.aF,{isOpen:Y,onClose:ne,size:"lg",children:[(0,V.jsx)(b.m,{}),(0,V.jsxs)(f.$,{children:[(0,V.jsx)(j.r,{children:null!==G&&void 0!==G&&G.id?"Upravit sponzora":"Nov\xfd sponzor"}),(0,V.jsx)(g.s,{}),(0,V.jsx)(x.c,{children:(0,V.jsxs)(z.T,{align:"stretch",spacing:4,children:[(0,V.jsxs)(d.MJ,{isRequired:!0,children:[(0,V.jsx)(u.l,{children:"N\xe1zev"}),(0,V.jsx)(m.p,{value:(null===G||void 0===G?void 0:G.name)||"",onChange:e=>X(t=>(0,a.A)((0,a.A)({},t),{},{name:e.target.value}))})]}),(0,V.jsxs)(d.MJ,{children:[(0,V.jsx)(u.l,{children:"Web (URL)"}),(0,V.jsx)(m.p,{value:(null===G||void 0===G?void 0:G.website_url)||"",onChange:e=>X(t=>(0,a.A)((0,a.A)({},t),{},{website_url:e.target.value}))})]}),(0,V.jsxs)(d.MJ,{children:[(0,V.jsx)(u.l,{children:"Logo"}),(0,V.jsxs)(z.T,{align:"stretch",spacing:3,children:[(0,V.jsx)(Z.A,{label:"Logo sponzora",description:"Nahrajte logo sponzora (doporu\u010deno PNG/SVG, max. 10 MB).",accept:"image/*",multiple:!1,maxFiles:1,allowUrlImport:!0,urlPlaceholder:"/uploads/... nebo https://example.com/logo.png",onChange:e=>{const t=e[e.length-1];X(t?e=>(0,a.A)((0,a.A)({},e||{}),{},{logo_url:t.url||""}):e=>(0,a.A)((0,a.A)({},e||{}),{},{logo_url:""}))}}),(null===G||void 0===G?void 0:G.logo_url)&&(0,V.jsxs)(w.z,{children:[(0,V.jsx)(h._,{src:t(G.logo_url),alt:"logo",boxSize:"56px",objectFit:"contain"}),(0,V.jsx)(P.E,{fontSize:"sm",color:"gray.500",children:G.logo_url})]})]})]}),(0,V.jsxs)(d.MJ,{children:[(0,V.jsx)(u.l,{children:"\xdarove\u0148 partnera"}),(0,V.jsxs)(_.l,{value:(null===G||void 0===G?void 0:G.tier)||"standard",onChange:e=>X(t=>(0,a.A)((0,a.A)({},t),{},{tier:e.target.value})),children:[(0,V.jsx)("option",{value:"general",children:"Hlavn\xed partner"}),(0,V.jsx)("option",{value:"standard",children:"Partner"})]})]}),(0,V.jsxs)(d.MJ,{children:[(0,V.jsx)(u.l,{children:"Po\u0159ad\xed zobrazen\xed"}),(0,V.jsx)(k.Q7,{value:null!==(e=null===G||void 0===G?void 0:G.display_order)&&void 0!==e?e:0,onChange:e=>X(t=>(0,a.A)((0,a.A)({},t),{},{display_order:parseInt(e)||0})),min:0,children:(0,V.jsx)(k.OO,{})}),(0,V.jsx)(P.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Men\u0161\xed \u010d\xedslo = vy\u0161\u0161\xed pozice"})]}),(0,V.jsxs)(d.MJ,{display:"flex",alignItems:"center",children:[(0,V.jsx)(u.l,{mb:"0",children:"Aktivn\xed"}),(0,V.jsx)(S.d,{isChecked:!(null===G||void 0===G||!G.is_active),onChange:e=>X(t=>(0,a.A)((0,a.A)({},t),{},{is_active:e.target.checked}))})]})]})}),(0,V.jsxs)(v.j,{children:[(0,V.jsx)(s.$,{variant:"ghost",mr:3,onClick:ne,children:"Zru\u0161it"}),(0,V.jsx)(s.$,{colorScheme:"blue",onClick:async()=>{var e,t;if(!G)return;const n={name:G.name||"",website_url:G.website_url||"",logo_url:G.logo_url||"",is_active:null===(e=G.is_active)||void 0===e||e,tier:G.tier||"standard",display_order:null!==(t=G.display_order)&&void 0!==t?t:0};null!=G.id?await ie.mutateAsync({id:G.id,payload:n}):await ae.mutateAsync(n)},isLoading:ae.isLoading||ie.isLoading,children:"Ulo\u017eit"})]})]})]})]})})}},3200:(e,t,n)=>{n.r(t),n.d(t,{adminSendSmtpTest:()=>s,createNewsletterSubscriber:()=>j,deleteSubscriber:()=>x,getEmailEventsForLog:()=>p,getNewsletterStatus:()=>c,getNewsletterSubscribers:()=>i,getRecentEmailStats:()=>m,previewNewsletter:()=>h,searchByICO:()=>b,sendNewsletter:()=>o,sendNewsletterDigest:()=>d,sendNewsletterTest:()=>r,sendNewsletterTestAdvanced:()=>l,setNewsletterAutomation:()=>u,toggleSubscriberStatus:()=>g,updateSubscriberPreferences:()=>v});var a=n(46291);const i=async()=>(await a.FH.get("/admin/newsletter/subscribers")).data,o=async e=>(await a.FH.post("/admin/newsletter/send",{subject:e.subject,content:e.content},{timeout:6e4})).data,r=async e=>{const t=e?{email:e}:{};return(await a.FH.post("/admin/newsletter/test",t,{timeout:6e4})).data},s=async e=>(await a.FH.post("/admin/newsletter/smtp-test",e,{timeout:6e4})).data,l=async e=>(await a.FH.post("/admin/newsletter/test",e,{timeout:6e4})).data,c=async()=>(await a.FH.get("/admin/newsletter/status")).data,d=async(e,t)=>(await a.FH.post("/admin/newsletter/send-digest",{type:e,competitions:t})).data,u=async e=>(await a.FH.patch("/admin/newsletter/enable",{enabled:e})).data,h=async e=>(await a.FH.post("/admin/newsletter/preview",e)).data,m=async()=>{var e;return(null===(e=(await a.FH.get("/admin/newsletter/stats/recent")).data)||void 0===e?void 0:e.data)||[]},p=async e=>{var t;return(null===(t=(await a.FH.get("/admin/newsletter/stats/".concat(e,"/events"))).data)||void 0===t?void 0:t.data)||[]},x=async e=>{await a.FH.delete("/admin/newsletter/subscribers/".concat(e))},g=async(e,t)=>(await a.FH.patch("/admin/newsletter/subscribers/".concat(e,"/status"),{is_active:t})).data,v=async(e,t)=>(await a.FH.patch("/admin/newsletter/subscribers/".concat(e,"/preferences"),t)).data,j=async(e,t)=>(await a.FH.post("/admin/newsletter/subscribers",{email:e,preferences:t})).data,b=async e=>(await a.FH.get("/admin/invoices/ares-search/".concat(encodeURIComponent(e)))).data},5195:(e,t,n)=>{n.r(t),n.d(t,{default:()=>$});var a=n(65043),i=n(6583),o=n(30502),r=n(96870),s=n(22107),l=n(28846),c=n(10202),d=n(96148),u=n(61724),h=n(39081),m=n(98481),p=n(98662),x=n(80511),g=n(3313),v=n(55395),j=n(83201),b=n(82595),y=n(67813),f=n(87139),k=n(99956),_=n(42703),w=n(78460),z=n(11054),S=n(85421),A=n(15071),C=n(35929),E=n(67516),T=n(73225),D=n(76668),N=n(35699),R=n(97569),F=n(56529),P=n(59781),I=n(72526),M=n(12836),L=n(46291);async function W(){return(await L.Ay.get("/admin/comments/bans")).data}async function U(){return(await L.Ay.get("/admin/comments/unban-requests")).data}var O=n(23857),q=n(1009),K=n(34636),B=n(38376),Z=n(24346),V=n(64920),H=n(70579);const $=()=>{var e,t,n,$,J;const[G,X]=a.useState(""),[Y,Q]=a.useState(""),[ee,te]=a.useState(""),[ne,ae]=a.useState(""),[ie,oe]=a.useState(1),[re,se]=a.useState(!1),le=(0,o.d)(),ce=(0,P.jE)(),[de,ue]=a.useState([]),[he,me]=a.useState(!1),[pe,xe]=a.useState([]),[ge,ve]=a.useState(!1),je=(0,I.I)({queryKey:["admin-comments",{status:G,targetType:Y,targetId:ee,userId:ne,page:ie}],queryFn:()=>async function(e){return(await L.Ay.get("/admin/comments",{params:e})).data}({status:G,target_type:Y,target_id:ee,user_id:ne,page:ie,page_size:50}),keepPreviousData:!0}),be=(0,I.I)({queryKey:["admin-unban-requests"],queryFn:U}),ye=(0,I.I)({queryKey:["admin-comment-bans"],queryFn:W}),fe=(0,M.n)({mutationFn:e=>async function(e,t){return(await L.Ay.patch("/admin/comments/".concat(e,"/status"),{status:t})).data}(e.id,e.s),onSuccess:async()=>{await ce.invalidateQueries({queryKey:["admin-comments"]})}}),ke=(0,M.n)({mutationFn:e=>(0,O.Tu)(e),onSuccess:async()=>{await ce.invalidateQueries({queryKey:["admin-comments"]}),le({status:"success",title:"Smaz\xe1no"})}}),[_e,we]=a.useState(null),ze=(0,r.j)(),[Se,Ae]=a.useState("Poru\u0161en\xed pravidel diskuse"),[Ce,Ee]=a.useState(0),Te=(0,M.n)({mutationFn:()=>async function(e,t,n){return(await L.Ay.post("/admin/comments/ban",{user_id:e,reason:t,duration_hours:n||0})).data}(_e||0,Se,Ce),onSuccess:async()=>{ze.onClose(),we(null),le({status:"success",title:"U\u017eivatel zablokov\xe1n"})}}),De=(0,M.n)({mutationFn:e=>async function(e,t){return(await L.Ay.post("/admin/comments/unban-requests/".concat(e,"/resolve"),{action:t})).data}(e.id,e.action),onSuccess:async()=>{await ce.invalidateQueries({queryKey:["admin-unban-requests"]}),await ce.invalidateQueries({queryKey:["admin-comment-bans"]}),le({status:"success",title:"Vy\u0159\xedzeno"})}}),Ne=(0,M.n)({mutationFn:e=>async function(e){return(await L.Ay.post("/admin/comments/bans/".concat(e,"/lift"))).data}(e),onSuccess:async()=>{await ce.invalidateQueries({queryKey:["admin-comment-bans"]}),le({status:"success",title:"Ban zru\u0161en"})}});a.useEffect(()=>{(async()=>{if(Y)try{if(me(!0),"article"===Y){const e=await(0,K.GE)({page:1,page_size:100});ue((e.data||[]).map(e=>({value:String(e.id),label:"".concat(e.title," (#").concat(e.id,")")})))}else if("event"===Y){const e=await(0,B.kQ)();ue((e||[]).map(e=>({value:String(e.id),label:"".concat(e.title," (#").concat(e.id,")")})))}else if("gallery_album"===Y){var e,t;const n=await L.Ay.get("/gallery/albums"),a=Array.isArray(n.data)?n.data:(null===(e=n.data)||void 0===e?void 0:e.data)||(null===(t=n.data)||void 0===t?void 0:t.albums)||[];ue((a||[]).map(e=>({value:String(e.id),label:"".concat(e.title," (").concat(e.date||"",")")})))}else if("youtube_video"===Y){const e=await(0,Z.S)(),t=(null===e||void 0===e?void 0:e.videos)||[];ue(t.map(e=>({value:String(e.video_id),label:"".concat(e.title," (").concat(e.published_date||"",")")})))}else ue([])}catch(n){ue([])}finally{me(!1)}else ue([])})()},[Y]),a.useEffect(()=>{(async()=>{try{ve(!0);const e=await(0,V._m)();xe((e||[]).map(e=>({value:String(e.id),label:"".concat(e.name||e.email," (#").concat(e.id,")")})))}catch(e){xe([])}finally{ve(!1)}})()},[]);const Re=(null===(e=je.data)||void 0===e?void 0:e.items)||[],Fe=a.useMemo(()=>re?Re.filter(e=>e.reports&&e.reports>0):Re,[Re,re]);return(0,H.jsx)(i.A,{children:(0,H.jsxs)(s.a,{children:[(0,H.jsx)(l.D,{size:"md",mb:4,children:"Koment\xe1\u0159e (moderace)"}),(0,H.jsx)(c.T,{align:"stretch",spacing:3,mb:4,children:(0,H.jsxs)(d.z,{children:[(0,H.jsxs)(u.l,{placeholder:"Stav",value:G,onChange:e=>{X(e.target.value),oe(1)},maxW:"200px",children:[(0,H.jsx)("option",{value:"visible",children:"Viditeln\xe9"}),(0,H.jsx)("option",{value:"hidden",children:"Skryt\xe9"})]}),(0,H.jsxs)(u.l,{placeholder:"Typ c\xedle",value:Y,onChange:e=>{Q(e.target.value),oe(1),te("")},maxW:"220px",children:[(0,H.jsx)("option",{value:"article",children:"\u010cl\xe1nek"}),(0,H.jsx)("option",{value:"event",children:"Aktivita"}),(0,H.jsx)("option",{value:"gallery_album",children:"Galerie"}),(0,H.jsx)("option",{value:"youtube_video",children:"YouTube video"})]}),Y&&(0,H.jsx)(u.l,{placeholder:he?"Na\u010d\xedt\xe1n\xed\u2026":"C\xedl",value:ee,onChange:e=>{te(e.target.value),oe(1)},maxW:"320px",isDisabled:he,children:de.map(e=>(0,H.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,H.jsx)(u.l,{placeholder:ge?"Na\u010d\xedt\xe1n\xed u\u017eivatel\u016f\u2026":"U\u017eivatel",value:ne,onChange:e=>{ae(e.target.value),oe(1)},maxW:"260px",isDisabled:ge,children:pe.map(e=>(0,H.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,H.jsxs)(d.z,{children:[(0,H.jsx)(h.E,{fontSize:"sm",color:"gray.500",children:"Jen nahl\xe1\u0161en\xe9"}),(0,H.jsx)(m.d,{isChecked:re,onChange:e=>se(e.target.checked)})]}),(0,H.jsx)(p.$,{size:"sm",variant:"ghost",onClick:()=>{X(""),Q(""),te(""),ae(""),se(!1),oe(1)},children:"Reset"})]})}),(0,H.jsx)(s.a,{borderWidth:"1px",borderRadius:"md",overflowX:"auto",children:(0,H.jsxs)(x.X,{size:"sm",children:[(0,H.jsx)(g.d,{children:(0,H.jsxs)(v.Tr,{children:[(0,H.jsx)(j.Th,{children:"ID"}),(0,H.jsx)(j.Th,{children:"U\u017eivatel"}),(0,H.jsx)(j.Th,{children:"C\xedl"}),(0,H.jsx)(j.Th,{children:"Obsah"}),(0,H.jsx)(j.Th,{children:"Spam"}),(0,H.jsx)(j.Th,{children:"Hl\xe1\u0161en\xed"}),(0,H.jsx)(j.Th,{children:"Stav"}),(0,H.jsx)(j.Th,{children:"Akce"})]})}),(0,H.jsx)(b.N,{children:Fe.map(e=>{var t,n,a;return(0,H.jsxs)(v.Tr,{children:[(0,H.jsxs)(y.Td,{children:["#",e.id]}),(0,H.jsxs)(y.Td,{children:["#",null===(t=e.user)||void 0===t?void 0:t.id," ",null===(n=e.user)||void 0===n?void 0:n.first_name," ",null===(a=e.user)||void 0===a?void 0:a.last_name]}),(0,H.jsxs)(y.Td,{children:[(0,H.jsx)(f.E,{mr:2,children:e.target_type}),(0,H.jsx)(h.E,{as:"span",children:e.target_label||e.target_id})]}),(0,H.jsx)(y.Td,{maxW:"420px",children:(0,H.jsx)(h.E,{noOfLines:2,children:e.content})}),(0,H.jsx)(y.Td,{children:e.spam_score?(0,H.jsx)(f.E,{colorScheme:e.spam_score>.5?"orange":"green",children:e.spam_score.toFixed(2)}):"-"}),(0,H.jsx)(y.Td,{children:e.reports?(0,H.jsx)(f.E,{colorScheme:e.reports>2?"red":"yellow",children:e.reports}):"-"}),(0,H.jsx)(y.Td,{children:(0,H.jsx)(k.m,{label:"visible"===e.status?"Viditeln\xe9":"Skryt\xe9",children:(0,H.jsx)(_.K,{"aria-label":"visible"===e.status?"Viditeln\xe9":"Skryt\xe9",size:"xs",variant:"ghost",colorScheme:"visible"===e.status?"green":"gray",icon:"visible"===e.status?(0,H.jsx)(q.Vap,{}):(0,H.jsx)(q._NO,{}),onClick:()=>fe.mutate({id:e.id,s:"visible"===e.status?"hidden":"visible"})})})}),(0,H.jsx)(y.Td,{children:(0,H.jsxs)(d.z,{children:[(0,H.jsx)(_.K,{"aria-label":"Smazat",size:"xs",icon:(0,H.jsx)(q.IXo,{}),onClick:()=>ke.mutate(e.id)}),(0,H.jsx)(p.$,{size:"xs",variant:"outline",onClick:()=>{var t;we(null===(t=e.user)||void 0===t?void 0:t.id),ze.onOpen()},children:"Ban"})]})})]},e.id)})})]})}),(0,H.jsxs)(d.z,{mt:3,justify:"space-between",children:[(0,H.jsxs)(h.E,{fontSize:"sm",color:"gray.500",children:["Str\xe1nka ",ie," \u2022 ",(null===(t=je.data)||void 0===t?void 0:t.total)||0," koment\xe1\u0159\u016f"]}),(0,H.jsxs)(d.z,{children:[(0,H.jsx)(p.$,{size:"sm",variant:"outline",onClick:()=>oe(e=>Math.max(1,e-1)),isDisabled:ie<=1,children:"P\u0159edchoz\xed"}),(0,H.jsx)(p.$,{size:"sm",variant:"outline",onClick:()=>oe(e=>e+1),isDisabled:0===Re.length||Re.length<50&&((null===(n=je.data)||void 0===n?void 0:n.total)||0)<=50*ie,children:"Dal\u0161\xed"})]})]}),(0,H.jsx)(l.D,{size:"sm",mt:6,mb:2,children:"\u017d\xe1dosti o odblokov\xe1n\xed"}),(0,H.jsx)(s.a,{borderWidth:"1px",borderRadius:"md",overflowX:"auto",children:(0,H.jsxs)(x.X,{size:"sm",children:[(0,H.jsx)(g.d,{children:(0,H.jsxs)(v.Tr,{children:[(0,H.jsx)(j.Th,{children:"ID"}),(0,H.jsx)(j.Th,{children:"U\u017eivatel"}),(0,H.jsx)(j.Th,{children:"Text"}),(0,H.jsx)(j.Th,{children:"Stav"}),(0,H.jsx)(j.Th,{children:"Akce"})]})}),(0,H.jsx)(b.N,{children:((null===($=be.data)||void 0===$?void 0:$.items)||[]).map(e=>{var t,n,a,i;return(0,H.jsxs)(v.Tr,{children:[(0,H.jsxs)(y.Td,{children:["#",e.id]}),(0,H.jsxs)(y.Td,{children:["#",null===(t=e.user)||void 0===t?void 0:t.id," ",null===(n=e.user)||void 0===n?void 0:n.first_name," ",null===(a=e.user)||void 0===a?void 0:a.last_name," ",(0,H.jsx)(h.E,{as:"span",color:"gray.500",fontSize:"sm",children:null===(i=e.user)||void 0===i?void 0:i.email})]}),(0,H.jsx)(y.Td,{maxW:"480px",children:(0,H.jsx)(h.E,{noOfLines:2,children:e.message})}),(0,H.jsxs)(y.Td,{children:["pending"===e.status&&(0,H.jsx)(f.E,{colorScheme:"yellow",children:"\u010cek\xe1 na vy\u0159\xedzen\xed"}),"approved"===e.status&&(0,H.jsx)(f.E,{colorScheme:"green",children:"Schv\xe1leno"}),"rejected"===e.status&&(0,H.jsx)(f.E,{colorScheme:"red",children:"Zam\xedtnuto"})]}),(0,H.jsx)(y.Td,{children:(0,H.jsxs)(d.z,{children:[(0,H.jsx)(p.$,{size:"xs",colorScheme:"green",variant:"outline",onClick:()=>De.mutate({id:e.id,action:"approve"}),children:"Povolit"}),(0,H.jsx)(p.$,{size:"xs",colorScheme:"red",variant:"outline",onClick:()=>De.mutate({id:e.id,action:"reject"}),children:"Zam\xedtnout"})]})})]},e.id)})})]})}),(0,H.jsx)(l.D,{size:"sm",mt:6,mb:2,children:"Zablokovan\xed u\u017eivatel\xe9"}),(0,H.jsx)(s.a,{borderWidth:"1px",borderRadius:"md",overflowX:"auto",children:(0,H.jsxs)(x.X,{size:"sm",children:[(0,H.jsx)(g.d,{children:(0,H.jsxs)(v.Tr,{children:[(0,H.jsx)(j.Th,{children:"ID"}),(0,H.jsx)(j.Th,{children:"U\u017eivatel"}),(0,H.jsx)(j.Th,{children:"D\u016fvod"}),(0,H.jsx)(j.Th,{children:"Zabanov\xe1n"}),(0,H.jsx)(j.Th,{children:"Platn\xe9 do"}),(0,H.jsx)(j.Th,{children:"Akce"})]})}),(0,H.jsx)(b.N,{children:((null===(J=ye.data)||void 0===J?void 0:J.items)||[]).map(e=>{var t,n,a,i;const o=e.until?new Date(e.until).toLocaleString():"Trvale";return(0,H.jsxs)(v.Tr,{children:[(0,H.jsxs)(y.Td,{children:["#",e.id]}),(0,H.jsxs)(y.Td,{children:["#",null===(t=e.user)||void 0===t?void 0:t.id," ",null===(n=e.user)||void 0===n?void 0:n.first_name," ",null===(a=e.user)||void 0===a?void 0:a.last_name," ",(0,H.jsx)(h.E,{as:"span",color:"gray.500",fontSize:"sm",children:null===(i=e.user)||void 0===i?void 0:i.email})]}),(0,H.jsx)(y.Td,{children:e.reason||"-"}),(0,H.jsx)(y.Td,{children:new Date(e.created_at).toLocaleString()}),(0,H.jsx)(y.Td,{children:o}),(0,H.jsx)(y.Td,{children:(0,H.jsx)(p.$,{size:"xs",variant:"outline",onClick:()=>Ne.mutate(e.id),children:"Zru\u0161it ban"})})]},e.id)})})]})}),(0,H.jsxs)(w.aF,{isOpen:ze.isOpen,onClose:ze.onClose,isCentered:!0,children:[(0,H.jsx)(z.m,{}),(0,H.jsxs)(S.$,{children:[(0,H.jsxs)(A.r,{children:["Zablokovat u\u017eivatele #",_e]}),(0,H.jsx)(C.s,{}),(0,H.jsx)(E.c,{children:(0,H.jsxs)(c.T,{align:"stretch",spacing:3,children:[(0,H.jsxs)(T.MJ,{children:[(0,H.jsx)(D.l,{children:"D\u016fvod"}),(0,H.jsx)(N.p,{value:Se,onChange:e=>Ae(e.target.value)})]}),(0,H.jsxs)(T.MJ,{children:[(0,H.jsx)(D.l,{children:"Doba (hodiny) \u2013 0 = trvale"}),(0,H.jsx)(R.Q7,{min:0,value:Ce,onChange:e=>Ee(Number(e)||0),children:(0,H.jsx)(R.OO,{})})]}),(0,H.jsxs)(d.z,{children:[(0,H.jsx)(h.E,{fontSize:"sm",color:"gray.500",children:"Rychl\xe1 volba:"}),(0,H.jsx)(p.$,{size:"xs",variant:"outline",onClick:()=>Ee(24),children:"24h"}),(0,H.jsx)(p.$,{size:"xs",variant:"outline",onClick:()=>Ee(168),children:"7 dn\xed"}),(0,H.jsx)(p.$,{size:"xs",variant:"outline",onClick:()=>Ee(0),children:"Trvale"})]})]})}),(0,H.jsx)(F.j,{children:(0,H.jsxs)(d.z,{children:[(0,H.jsx)(p.$,{onClick:ze.onClose,children:"Zru\u0161it"}),(0,H.jsx)(p.$,{colorScheme:"red",isLoading:Te.isPending,onClick:()=>Te.mutate(),children:"Zablokovat"})]})})]})]})]})})}},5722:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var a=n(22107),i=n(44093),o=n(98939),r=n(82459),s=n(7189),l=n(47781),c=n(10202),d=n(28846),u=n(39081),h=n(40378),m=n(70579);const p=()=>{const e=(0,i.dU)("gray.700","gray.300"),t=(0,i.dU)("gray.900","gray.100"),n=(0,i.dU)("blue.50","blue.900"),p=(0,i.dU)("blue.900","blue.100");return(0,m.jsx)(h.A,{children:(0,m.jsx)(o.m,{maxW:"3xl",py:8,children:(0,m.jsxs)(c.T,{align:"stretch",spacing:6,children:[(0,m.jsx)(d.D,{as:"h1",size:"xl",mb:2,color:t,children:"Z\xe1sady ochrany osobn\xedch \xfadaj\u016f"}),(0,m.jsxs)(u.E,{fontSize:"sm",color:e,children:["Posledn\xed aktualizace: ",(new Date).toLocaleDateString("cs-CZ")]}),(0,m.jsxs)(a.a,{bg:n,p:4,borderRadius:"md",children:[(0,m.jsx)(u.E,{fontWeight:"bold",mb:2,color:p,children:"D\u016fle\u017eit\xe9 upozorn\u011bn\xed"}),(0,m.jsx)(u.E,{fontSize:"sm",color:p,children:"Respektujeme va\u0161e soukrom\xed. Tato str\xe1nka popisuje, jak zpracov\xe1v\xe1me va\u0161e osobn\xed \xfadaje v souladu s platn\xfdmi pr\xe1vn\xedmi p\u0159edpisy (zejm\xe9na na\u0159\xedzen\xedm GDPR - Na\u0159\xedzen\xed Evropsk\xe9ho parlamentu a Rady (EU) 2016/679)."})]}),(0,m.jsx)(r.c,{}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"1. Spr\xe1vce osobn\xedch \xfadaj\u016f"}),(0,m.jsxs)(u.E,{color:e,mb:2,children:["Spr\xe1vcem osobn\xedch \xfadaj\u016f je provozovatel t\u011bchto webov\xfdch str\xe1nek. Kontaktn\xed \xfadaje spr\xe1vce naleznete na str\xe1nce ",(0,m.jsx)(s.N,{href:"/kontakt",color:"brand.primary",children:"Kontakt"}),"."]})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"2. Jak\xe9 osobn\xed \xfadaje zpracov\xe1v\xe1me"}),(0,m.jsx)(u.E,{color:e,mb:2,children:"Zpracov\xe1v\xe1me n\xe1sleduj\xedc\xed kategorie osobn\xedch \xfadaj\u016f:"}),(0,m.jsxs)(l.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Kontaktn\xed \xfadaje:"})," jm\xe9no, p\u0159\xedjmen\xed, e-mailov\xe1 adresa, telefonn\xed \u010d\xedslo - poskytnut\xe9 dobrovoln\u011b prost\u0159ednictv\xedm kontaktn\xedho formul\xe1\u0159e nebo p\u0159i registraci k newsletteru"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"IP adresa:"})," automaticky zaznamen\xe1van\xe1 p\u0159i n\xe1v\u0161t\u011bv\u011b webu pro \xfa\u010dely bezpe\u010dnosti, anal\xfdzy n\xe1v\u0161t\u011bvnosti a prevence zneu\u017eit\xed"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Technick\xe9 \xfadaje:"})," informace o za\u0159\xedzen\xed, prohl\xed\u017ee\u010di, opera\u010dn\xedm syst\xe9mu, datum a \u010das n\xe1v\u0161t\u011bvy, nav\u0161t\xedven\xe9 str\xe1nky"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Cookies:"})," soubory ukl\xe1dan\xe9 do va\u0161eho za\u0159\xedzen\xed (viz samostatn\xe1 ",(0,m.jsx)(s.N,{href:"/pravidla-cookies",color:"brand.primary",children:"Pravidla pou\u017e\xedv\xe1n\xed cookies"}),")"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Analytick\xe9 \xfadaje:"})," anonymizovan\xe1 data o chov\xe1n\xed na webu prost\u0159ednictv\xedm analytick\xfdch n\xe1stroj\u016f"]})]})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"3. Zdroje dat a vlastnictv\xed obsahu"}),(0,m.jsxs)(a.a,{bg:n,p:4,borderRadius:"md",mb:4,children:[(0,m.jsx)(u.E,{fontWeight:"bold",mb:2,color:p,children:"D\u016fle\u017eit\xe9 pr\xe1vn\xed upozorn\u011bn\xed"}),(0,m.jsx)(u.E,{fontSize:"sm",color:p,children:"Tento web zobrazuje data z extern\xedch zdroj\u016f, kter\xe1 NEVLASTN\xcdME a kter\xe1 jsou majetkem p\u0159\xedslu\u0161n\xfdch organizac\xed."})]}),(0,m.jsxs)(l.B8,{spacing:3,mb:4,styleType:"disc",pl:6,color:e,children:[(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Data FA\u010cR (Fotbalov\xe1 asociace \u010cesk\xe9 republiky):"})," Ve\u0161ker\xe9 informace o z\xe1pasech, tabulk\xe1ch, sout\u011b\u017e\xedch a v\xfdsledc\xedch poch\xe1zej\xed z ve\u0159ejn\xfdch API a webov\xfdch str\xe1nek FA\u010cR (",(0,m.jsx)(s.N,{href:"https://www.fotbal.cz",isExternal:!0,color:"brand.primary",children:"www.fotbal.cz"}),"). Tato data jsou majetkem FA\u010cR a zobrazujeme je pouze pro informa\u010dn\xed \xfa\u010dely v souladu s ve\u0159ejnou dostupnost\xed."]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Loga klub\u016f a t\xfdm\u016f:"})," Loga zobrazen\xe1 na webu jsou majetkem p\u0159\xedslu\u0161n\xfdch fotbalov\xfdch klub\u016f a organizac\xed. Pou\u017e\xedv\xe1me je pouze pro identifika\u010dn\xed \xfa\u010dely v r\xe1mci sportovn\xedho zpravodajstv\xed."]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Fotografie a medi\xe1ln\xed obsah:"})," Fotografie a videa mohou poch\xe1zet z r\u016fzn\xfdch zdroj\u016f v\u010detn\u011b ve\u0159ejn\xfdch galeri\xed, YouTube a dal\u0161\xedch platforem. Ve\u0161ker\xe1 autorsk\xe1 pr\xe1va n\xe1le\u017e\xed jejich p\u016fvodn\xedm autor\u016fm."]})]}),(0,m.jsxs)(u.E,{fontSize:"sm",color:e,children:["Pokud jste vlastn\xedkem obsahu a m\xe1te n\xe1mitky proti jeho pou\u017eit\xed, pros\xedm kontaktujte n\xe1s prost\u0159ednictv\xedm ",(0,m.jsx)(s.N,{href:"/kontakt",color:"brand.primary",children:"kontaktn\xedho formul\xe1\u0159e"}),"."]})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"4. \xda\u010del zpracov\xe1n\xed"}),(0,m.jsxs)(l.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Komunikace:"})," Vy\u0159\xedzen\xed va\u0161ich dotaz\u016f, po\u017eadavk\u016f a zp\u011btn\xe9 vazby"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Newsletter:"})," Zas\xedl\xe1n\xed novinek a informac\xed (pouze se souhlasem)"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Bezpe\u010dnost webu:"})," Ochrana p\u0159ed \xfatoky, prevence zneu\u017eit\xed, detekce podvod\u016f"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Anal\xfdza n\xe1v\u0161t\u011bvnosti:"})," Zlep\u0161ov\xe1n\xed u\u017eivatelsk\xe9ho z\xe1\u017eitku a optimalizace obsahu"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Pln\u011bn\xed pr\xe1vn\xedch povinnost\xed:"})," Dodr\u017eov\xe1n\xed z\xe1konn\xfdch po\u017eadavk\u016f"]})]})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"5. Pr\xe1vn\xed z\xe1klad zpracov\xe1n\xed"}),(0,m.jsxs)(l.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Souhlas (\u010dl. 6 odst. 1 p\xedsm. a GDPR):"})," Pro newsletter a analytick\xe9 cookies"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Opr\xe1vn\u011bn\xfd z\xe1jem (\u010dl. 6 odst. 1 p\xedsm. f GDPR):"})," Bezpe\u010dnost webu, prevence zneu\u017eit\xed, anonymizovan\xe1 analytika"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Pln\u011bn\xed smlouvy (\u010dl. 6 odst. 1 p\xedsm. b GDPR):"})," Poskytov\xe1n\xed slu\u017eeb"]})]})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"6. Doba uchov\xe1v\xe1n\xed \xfadaj\u016f"}),(0,m.jsxs)(l.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Kontaktn\xed \xfadaje:"})," Po dobu nezbytnou pro vy\u0159\xedzen\xed po\u017eadavku, maxim\xe1ln\u011b 3 roky"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"IP adresy:"})," 90 dn\xed pro \xfa\u010dely bezpe\u010dnosti a anal\xfdzy"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Analytick\xe9 \xfadaje:"})," Anonymizovan\u011b a\u017e 26 m\u011bs\xedc\u016f"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Newsletter:"})," Do odvol\xe1n\xed souhlasu"]})]})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"7. P\u0159ed\xe1v\xe1n\xed \xfadaj\u016f t\u0159et\xedm stran\xe1m"}),(0,m.jsx)(u.E,{color:e,mb:2,children:"Va\u0161e osobn\xed \xfadaje m\u016f\u017eeme p\u0159ed\xe1vat:"}),(0,m.jsxs)(l.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Poskytovatel\xe9 hostingu:"})," Pro technick\xfd provoz webu"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Analytick\xe9 n\xe1stroje:"})," Pro m\u011b\u0159en\xed n\xe1v\u0161t\u011bvnosti (anonymizovan\u011b)"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"E-mailov\xe9 slu\u017eby:"})," Pro zas\xedl\xe1n\xed newsletter\u016f"]})]}),(0,m.jsx)(u.E,{fontSize:"sm",color:e,children:"V\u0161ichni zpracovatel\xe9 jsou pe\u010dliv\u011b vybr\xe1ni a zav\xe1z\xe1ni k ochran\u011b va\u0161ich \xfadaj\u016f v souladu s GDPR."})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"8. Va\u0161e pr\xe1va"}),(0,m.jsx)(u.E,{color:e,mb:2,children:"M\xe1te n\xe1sleduj\xedc\xed pr\xe1va:"}),(0,m.jsxs)(l.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Pr\xe1vo na p\u0159\xedstup:"})," M\u016f\u017eete po\u017e\xe1dat o informace o zpracov\xe1n\xed va\u0161ich \xfadaj\u016f"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Pr\xe1vo na opravu:"})," M\u016f\u017eete po\u017eadovat opravu nep\u0159esn\xfdch \xfadaj\u016f"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Pr\xe1vo na v\xfdmaz:"}),' M\u016f\u017eete po\u017eadovat smaz\xe1n\xed va\u0161ich \xfadaj\u016f (\u201epr\xe1vo b\xfdt zapomenut")']}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Pr\xe1vo na omezen\xed zpracov\xe1n\xed:"})," M\u016f\u017eete po\u017eadovat omezen\xed zpracov\xe1n\xed"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Pr\xe1vo na p\u0159enositelnost:"})," M\u016f\u017eete po\u017e\xe1dat o p\u0159ed\xe1n\xed \xfadaj\u016f"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Pr\xe1vo vzn\xe9st n\xe1mitku:"})," M\u016f\u017eete se br\xe1nit zpracov\xe1n\xed na z\xe1klad\u011b opr\xe1vn\u011bn\xe9ho z\xe1jmu"]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Pr\xe1vo odvolat souhlas:"})," Kdykoliv m\u016f\u017eete odvolat souhlas se zpracov\xe1n\xedm"]})]}),(0,m.jsxs)(u.E,{color:e,mb:4,children:["Pro uplatn\u011bn\xed va\u0161ich pr\xe1v n\xe1s kontaktujte prost\u0159ednictv\xedm str\xe1nky ",(0,m.jsx)(s.N,{href:"/kontakt",color:"brand.primary",children:"Kontakt"}),"."]})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"9. Bezpe\u010dnost \xfadaj\u016f"}),(0,m.jsx)(u.E,{color:e,mb:4,children:"Pou\u017e\xedv\xe1me p\u0159im\u011b\u0159en\xe1 technick\xe1 a organiza\u010dn\xed opat\u0159en\xed k ochran\u011b va\u0161ich osobn\xedch \xfadaj\u016f p\u0159ed neopr\xe1vn\u011bn\xfdm p\u0159\xedstupem, ztr\xe1tou, zni\u010den\xedm nebo zm\u011bnou. Data jsou p\u0159en\xe1\u0161ena \u0161ifrovan\u011b prost\u0159ednictv\xedm HTTPS protokolu."})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"10. St\xed\u017enosti"}),(0,m.jsx)(u.E,{color:e,mb:4,children:"Pokud se domn\xedv\xe1te, \u017ee s va\u0161imi \xfadaji nen\xed nakl\xe1d\xe1no v souladu se z\xe1konem, m\xe1te pr\xe1vo podat st\xed\u017enost u dozorov\xe9ho \xfa\u0159adu:"}),(0,m.jsxs)(a.a,{bg:n,p:4,borderRadius:"md",children:[(0,m.jsx)(u.E,{fontWeight:"bold",color:p,children:"\xda\u0159ad pro ochranu osobn\xedch \xfadaj\u016f"}),(0,m.jsx)(u.E,{fontSize:"sm",color:p,children:"Pplk. Sochora 27, 170 00 Praha 7"}),(0,m.jsxs)(u.E,{fontSize:"sm",color:p,children:["Web: ",(0,m.jsx)(s.N,{href:"https://www.uoou.cz",isExternal:!0,color:"brand.primary",children:"www.uoou.cz"})]})]})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"11. Zm\u011bny t\u011bchto z\xe1sad"}),(0,m.jsx)(u.E,{color:e,children:"Vyhrazujeme si pr\xe1vo tyto z\xe1sady aktualizovat. O v\xfdznamn\xfdch zm\u011bn\xe1ch v\xe1s budeme informovat prost\u0159ednictv\xedm webu."})]})]})})})}},6484:(e,t,n)=>{n.d(t,{Oe:()=>l,Oh:()=>o,Zt:()=>r,cQ:()=>s});var a=n(89379),i=n(46291);async function o(e){const t=(await i.Ay.get("/banners",{params:e})).data;return((Array.isArray(t)?t:Array.isArray(null===t||void 0===t?void 0:t.data)?t.data:[])||[]).map(e=>{var t,n,i;return(0,a.A)((0,a.A)({},e),{},{id:null!==(t=null!==(n=null!==(i=e.id)&&void 0!==i?i:e.ID)&&void 0!==n?n:e.Id)&&void 0!==t?t:e.iD})})}async function r(e){return(await i.Ay.post("/banners",e)).data}async function s(e,t){return(await i.Ay.put("/banners/".concat(e),t)).data}async function l(e){return(await i.Ay.delete("/banners/".concat(e))).data}},6583:(e,t,n)=>{n.d(t,{A:()=>ve});var a=n(96870),i=n(44093),o=n(5371),r=n(99032),s=n(22107),l=n(96148),c=n(42703),d=n(65043),u=n(73216),h=n(29066),m=n(89379),p=n(7189),x=n(25011),g=n(39081),v=n(10202),j=n(33572),b=n(82459),y=n(76659),f=n(53407),k=n(35475);var _=n(85369),w=n(63856),z=n(5874),S=n(72526),A=n(38376),C=n(1029),E=n(57550),T=n(25189),D=n(70579);const N=e=>{let{icon:t,to:n,children:a,onClick:o}=e;const r=(0,u.zy)(),s=!!n&&r.pathname===n,l=(0,i.dU)("blue.50","blue.900"),c=(0,i.dU)("blue.600","blue.300"),d=(0,i.dU)("gray.100","gray.700"),h=n?k.N_:"a",v=n?{to:n}:{href:"#"};return(0,D.jsxs)(p.N,(0,m.A)((0,m.A)({as:h},v),{},{display:"flex",alignItems:"center",px:3,py:2.5,borderRadius:"lg",bg:s?l:"transparent",color:s?c:"inherit",fontWeight:s?"semibold":"medium",fontSize:"sm",_hover:{textDecoration:"none",bg:s?l:d,transform:"translateX(2px)"},transition:"all 0.2s ease",onClick:e=>{!o||(o(e),e.isDefaultPrevented())},"data-navitem":"true","data-active":s?"true":void 0,position:"relative",_before:s?{content:'""',position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",width:"3px",height:"60%",bg:c,borderRadius:"full"}:{},children:[(0,D.jsx)(x.I,{as:t,mr:3,boxSize:4}),(0,D.jsx)(g.E,{flex:1,children:a})]}))},R=e=>({dashboard:_.$BV,analytics:_.v$b,teams:_.YXz,matches:_.bfZ,activities:_.bfZ,players:_.i0U,articles:_.Nhm,categories:_.t69,about:_.vd0,videos:_.HiP,gallery:_.dkL,scoreboard:_.$BV,scoreboard_remote:_.rle,clothing:_.umw,sponsors:_.DDN,banners:_.sdT,messages:_.maD,contacts:_.toK,newsletter:_.Cer,polls:_.l2R,navigation:_.OXb,competition_aliases:_.Z0L,prefetch:_.uoG,users:_.e7y,settings:_.lV_,files:_.M1W,media:_.M1W,docs:_.vd0,shortlinks:_.AnD,comments:_.uN,engagement:_.Z0L,sweepstakes:_.Wp,"manual-data":_.xdT,"financial-dashboard":_.MxO,"qr-codes":_.Acq,invoices:_.xXS,"invoice-settings":_.xXS,customers:_.M5n,expenses:_.MxO,manual_facr:_.xdT}[e||""]||_.t69),F=e=>{let{isOpen:t,onClose:n,bg:a,borderRight:r="1px",borderColor:l}=e;const{logout:k,user:F}=(0,h.A)(),{data:P}=(0,E.s)(),I="admin"===(null===F||void 0===F?void 0:F.role),M=(0,i.dU)("white","#1a1d29"),L=(0,i.dU)("gray.200","rgba(255, 255, 255, 0.12)"),W=((0,i.dU)("gray.800","#e2e8f0"),a||M),U=l||L,O=(null===P||void 0===P?void 0:P.eshop_enabled)||!1,q="manual"===((null===P||void 0===P?void 0:P.club_data_mode)||"").toLowerCase(),K=(0,i.dU)("gray.200","whiteAlpha.300"),B=(0,i.dU)("gray.600","gray.300"),Z=(0,i.dU)("gray.500","gray.400"),V=(0,i.dU)("gray.500","gray.400"),H=(0,i.dU)("gray.300","gray.600"),$=(0,i.dU)("gray.400","gray.500"),J=(0,i.dU)("green.100","green.900"),G=(0,i.dU)("green.700","green.200"),X=(0,i.dU)("green.200","green.700"),Y=(0,i.dU)("gray.100","whiteAlpha.200"),Q=(0,i.dU)("gray.700","gray.300"),ee=(0,i.dU)("gray.200","whiteAlpha.300"),{data:te}=(0,S.I)({queryKey:["admin-sidebar-upcoming-events"],queryFn:A.y6}),ne=Array.isArray(te)?te.length:0,ae=(0,d.useRef)(null),ie=(0,d.useRef)({about:!1}),{scrollToCurrentPage:oe,isReady:re,debug:se}=((0,u.zy)(),function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{scrollContainerSelector:n='[data-sidebar="true"]',navItemSelector:a='a[href*="/admin/"]',enableDebug:i=!1}=t,o=(0,u.zy)(),r=(0,d.useRef)(null),s=(0,d.useRef)(!1),[l,c]=(0,d.useState)(!1),h=(0,d.useCallback)((e,t)=>{i&&console.log("[AdminNavScroll] ".concat(e),t||"")},[i]),m=(0,d.useCallback)((e,t)=>{console.log("[AdminNavScroll] ".concat(e),t||"")},[]),p=(0,d.useCallback)(()=>{if(r.current)return r.current;const e=document.querySelector(n);return e&&(r.current=e,h("Found scroll container:",e)),e},[n,h]),x=(0,d.useCallback)(()=>{const e=p();if(!e)return null;const t=e.querySelectorAll(a);for(let n=0;n<t.length;n++){const e=t[n],a=e.getAttribute("href");if(a===o.pathname)return m("Found current nav item:",{href:a,element:e}),e}for(let n=0;n<t.length;n++){const e=t[n],a=e.getAttribute("href");if(a&&o.pathname.startsWith(a)&&"/admin"!==a)return m("Found partial match nav item:",{href:a,pathname:o.pathname,element:e}),e}return h("No matching nav item found for:",o.pathname),null},[p,a,o.pathname,m,h]),g=(0,d.useCallback)(()=>{const e=p();if(!e||s.current)return;const t=x();if(!t)return void h("No nav item to scroll to");s.current=!0;const n=e.getBoundingClientRect(),a=t.getBoundingClientRect(),i=a.top-n.top+e.scrollTop,r=a.height,l=n.height,c=i-l/2+r/2,d=e.scrollHeight-l,u=Math.max(0,Math.min(c,d));m("\ud83c\udfaf Centering nav item:",{pathname:o.pathname,itemTopRelativeToContainer:i,targetScrollTop:c,finalScrollTop:u,containerHeight:l,itemHeight:r}),e.scrollTo({top:u,behavior:"smooth"}),setTimeout(()=>{s.current=!1,m("\u2705 Scroll to current page completed")},300)},[p,x,o.pathname,m,h]);return(0,d.useEffect)(()=>{m("\ud83e\udded Navigation detected:",o.pathname);const e=setTimeout(()=>{g()},100);return()=>clearTimeout(e)},[o.pathname,g,m]),(0,d.useEffect)(()=>{const e=setTimeout(()=>{p()?(c(!0),g(),m("\u2705 Initialization completed")):h("Scroll container not found after delay")},150);return()=>{clearTimeout(e)}},[p,g,m,h]),{scrollToCurrentPage:g,scrollPosition:(null===(e=r.current)||void 0===e?void 0:e.scrollTop)||0,isReady:l,debug:h}}({scrollContainerSelector:'[data-sidebar="true"]',enableDebug:!1})),le=(0,d.useCallback)(e=>(0,D.jsx)(N,(0,m.A)({},e)),[]),[ce,de]=(0,d.useState)([]),[ue,he]=(0,d.useState)(!0),me=(0,d.useCallback)(e=>{const t=n=>!!e(n)||!!Array.isArray(n.children)&&n.children.some(t);return ce.some(t)},[ce]),pe=(0,d.useMemo)(()=>me(e=>"shortlinks"===e.page_type||"/admin/shortlinks"===e.url),[me]),xe=(0,d.useMemo)(()=>me(e=>"engagement"===e.page_type||"/admin/engagement"===e.url),[me]),ge=(0,d.useMemo)(()=>me(e=>"comments"===e.page_type||"/admin/komentare"===e.url),[me]),ve=(0,d.useMemo)(()=>me(e=>"sweepstakes"===e.page_type||"/admin/sweepstakes"===e.url),[me]),je=(0,d.useMemo)(()=>me(e=>"competition_aliases"===e.page_type||"/admin/aliasy-soutezi"===e.url),[me]),be=(0,d.useMemo)(()=>me(e=>"clothing"===e.page_type||"/admin/obleceni"===e.url),[me]),ye=(0,d.useMemo)(()=>me(e=>"eshop_products"===e.page_type||"/admin/eshop-produkty"===e.url),[me]),fe=(0,d.useMemo)(()=>me(e=>"about"===e.page_type||"/admin/o-klubu"===e.url),[me]),ke=(0,d.useMemo)(()=>me(e=>"videos"===e.page_type||"/admin/videa"===e.url),[me]),_e=(0,d.useMemo)(()=>me(e=>"gallery"===e.page_type||"/admin/galerie"===e.url),[me]),we=(0,d.useMemo)(()=>me(e=>"scoreboard"===e.page_type||"/admin/scoreboard"===e.url),[me]),ze=(0,d.useMemo)(()=>me(e=>"scoreboard_remote"===e.page_type||"/admin/scoreboard/remote"===e.url),[me]),Se=(0,d.useMemo)(()=>me(e=>"sponsors"===e.page_type||"/admin/sponzori"===e.url),[me]),Ae=(0,d.useMemo)(()=>me(e=>"banners"===e.page_type||"/admin/bannery"===e.url),[me]),Ce=(0,d.useMemo)(()=>me(e=>"messages"===e.page_type||"/admin/zpravy"===e.url),[me]),Ee=(0,d.useMemo)(()=>me(e=>"contacts"===e.page_type||"/admin/kontakty"===e.url),[me]),Te=(0,d.useMemo)(()=>me(e=>"newsletter"===e.page_type||"/admin/newsletter"===e.url),[me]),De=(0,d.useMemo)(()=>me(e=>"polls"===e.page_type||"/admin/ankety"===e.url),[me]),Ne=(0,d.useMemo)(()=>me(e=>"files"===e.page_type||"/admin/soubory"===e.url),[me]),Re=(0,d.useMemo)(()=>me(e=>"navigation"===e.page_type||"/admin/navigace"===e.url),[me]),Fe=(0,d.useMemo)(()=>me(e=>"users"===e.page_type||"/admin/uzivatele"===e.url),[me]),Pe=(0,d.useMemo)(()=>me(e=>"settings"===e.page_type||"/admin/nastaveni"===e.url),[me]),Ie=(0,d.useMemo)(()=>me(e=>"analytics"===e.page_type||"/admin/analytika"===e.url),[me]),Me=(0,d.useMemo)(()=>me(e=>"prefetch"===e.page_type||"/admin/prefetch"===e.url),[me]),Le=(0,d.useMemo)(()=>me(e=>"manual_data"===e.page_type||"/admin/manual-data"===e.url),[me]),We="admin-sidebar-collapsed-v1",[Ue,Oe]=(0,d.useState)({});(0,d.useEffect)(()=>{try{const e=localStorage.getItem(We);if(e){const t=JSON.parse(e);t&&"object"===typeof t&&Oe(t)}}catch(e){}},[]),(0,d.useEffect)(()=>{Oe(e=>{const t=(0,m.A)({},e);return ce.forEach(e=>{"dropdown"===e.type&&"number"===typeof e.id&&"undefined"===typeof t[e.id]&&(t[e.id]=!1)}),t})},[ce]);const qe=(0,d.useCallback)(e=>{e&&Oe(t=>{const n=(0,m.A)((0,m.A)({},t),{},{[e]:!t[e]});try{localStorage.setItem(We,JSON.stringify(n))}catch(a){}return n})},[]);return(0,d.useEffect)(()=>{let e=!0;return I?((async()=>{try{const a=await(0,C.g9)();if(e&&Array.isArray(a)){const i=a.filter(e=>e.requires_admin);if(0===i.length&&I)try{console.log("Admin navigation empty, auto-seeding..."),await(0,C.D)();const t=await(0,C.g9)();if(e&&Array.isArray(t)){const e=t.filter(e=>e.requires_admin);de(e)}}catch(t){console.error("Auto-seed failed:",t),de(i)}else{if(i.some(e=>"about"===e.page_type||!!Array.isArray(e.children)&&e.children.some(e=>"about"===e.page_type||"/admin/o-klubu"===e.url))||!I||ie.current.about)de(i);else try{ie.current.about=!0,await(0,C.D)();const t=await(0,C.g9)();if(e&&Array.isArray(t)){const e=t.filter(e=>e.requires_admin);de(e)}}catch(n){console.warn("Seed backfill for about failed:",n),de(i)}}}}catch(a){console.error("Failed to load admin navigation:",a)}finally{e&&he(!1)}})(),()=>{e=!1}):((async()=>{try{he(!0);const t=await(0,C.Qc)();e&&de(t||[])}catch(t){e&&de([])}finally{e&&he(!1)}})(),()=>{e=!1})},[I]),(0,d.useEffect)(()=>{re&&!ue&&(oe(),se("Auto-scroll to current page after navigation load"))},[re,ue,oe,se]),(0,D.jsx)(s.a,{as:"nav",position:"fixed",left:0,top:0,bottom:0,width:{base:"320px",md:"260px"},bg:W,borderRightWidth:r,borderColor:U,pt:{base:16,md:5},display:{base:t?"block":"none",md:"block"},zIndex:{base:11,md:10},overflowY:"auto",overflowX:"hidden",boxShadow:{base:"lg",md:"none"},transform:{base:t?"translateX(0)":"translateX(-100%)",md:"translateX(0)"},transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",ref:ae,onScroll:void 0,"data-sidebar":"true",css:{"&::-webkit-scrollbar":{width:"4px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:H,borderRadius:"2px"},"&::-webkit-scrollbar-thumb:hover":{background:$}},children:(0,D.jsxs)(v.T,{align:"stretch",spacing:{base:2,md:1},px:{base:6,md:3},pb:6,children:[(0,D.jsx)(o.s,{justify:"flex-end",display:{base:"flex",md:"none"},w:"100%",mb:2,children:(0,D.jsx)(c.K,{"aria-label":"Zav\u0159\xedt menu",icon:(0,D.jsx)(_.QCr,{}),variant:"ghost",onClick:n,size:"sm",borderRadius:"full",_hover:{bg:(0,i.dU)("gray.100","gray.700")}})}),(0,D.jsx)(s.a,{px:{base:6,md:3},mb:{base:6,md:4},children:(0,D.jsxs)(o.s,{align:"center",gap:{base:4,md:3},mb:2,children:[(0,D.jsx)(j._,{src:(0,T.uq)(null===P||void 0===P?void 0:P.club_logo_url)||(null===P||void 0===P?void 0:P.club_logo_url)||"/dist/img/logo-club-empty.svg",alt:"Club Logo",boxSize:{base:"56px",md:"48px"},objectFit:"contain",fallbackSrc:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect width='100' height='100' fill='%23e2e8f0'/%3E%3Ctext x='50' y='55' text-anchor='middle' font-size='40' fill='%23718096'%3EMC%3C/text%3E%3C/svg%3E",borderRadius:"md"}),(0,D.jsxs)(v.T,{align:"start",spacing:0,children:[(0,D.jsx)(g.E,{fontSize:{base:"2xl",md:"xl"},fontWeight:"extrabold",color:(0,i.dU)("gray.800","white"),letterSpacing:"tight",children:"My Club"}),(0,D.jsx)(g.E,{fontSize:{base:"sm",md:"xs"},color:(0,i.dU)("gray.500","gray.400"),fontWeight:"semibold",textTransform:"uppercase",letterSpacing:"wider",children:"Admin Panel"})]})]})}),le({icon:_.rQ8,to:"/",onClick:n,children:"Zp\u011bt na web"}),(0,D.jsx)(b.c,{my:2}),ue?(0,D.jsx)(o.s,{justify:"center",py:8,children:(0,D.jsx)(y.y,{size:"sm"})}):ce.length>0?(0,D.jsxs)(D.Fragment,{children:[ce.filter(e=>!("E-shop"===e.label&&!O)&&e.visible).map((e,t)=>{const a="dropdown"===e.type,i=Array.isArray(e.children)&&e.children.length>0,r=!(!e.id||!Ue[e.id]),l=(0,D.jsx)(s.a,{px:2,py:2,onClick:()=>qe(e.id),cursor:"pointer",role:"button","aria-expanded":!r,children:(0,D.jsxs)(o.s,{align:"center",gap:2,children:[(0,D.jsx)(s.a,{flex:"1",height:"1px",bg:K}),(0,D.jsx)(g.E,{fontSize:"xs",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",color:B,children:e.label}),(0,D.jsx)(x.I,{as:r?w.v:z.D,boxSize:3.5,color:Z}),(0,D.jsx)(s.a,{flex:"1",height:"1px",bg:K})]})});if(a)return(0,D.jsxs)(s.a,{children:[l,i&&(0,D.jsx)(f.S,{in:!r,animateOpacity:!0,unmountOnExit:!0,children:(0,D.jsx)(v.T,{align:"stretch",spacing:1,px:1,children:e.children.filter(e=>!("manual_facr"===e.page_type&&!q)&&e.visible).map((e,t)=>{const a=R(e.page_type),i=e.url||"#",o="activities"===e.page_type&&ne>0;return le({icon:a,to:i,onClick:n,children:(0,D.jsxs)(g.E,{as:"span",children:[e.label,o&&(0,D.jsx)(g.E,{as:"span",ml:2,fontSize:"10px",px:2,py:.5,borderRadius:"full",bg:J,color:G,borderWidth:"1px",borderColor:X,children:ne})]})})})})})]});if("manual_facr"===e.page_type&&!q)return null;const c=R(e.page_type),d=e.url||"#",u="activities"===e.page_type&&ne>0;return le({icon:c,to:d,onClick:n,children:(0,D.jsxs)(g.E,{as:"span",children:[e.label,u&&(0,D.jsx)(g.E,{as:"span",ml:2,fontSize:"10px",px:2,py:.5,borderRadius:"full",bg:J,color:G,borderWidth:"1px",borderColor:X,children:ne})]})})}),I&&!pe&&le({icon:_.AnD,to:"/admin/shortlinks",onClick:n,children:"Zkr\xe1cen\xe9 odkazy"}),I&&!xe&&(0,D.jsx)(N,{icon:_.Z0L,to:"/admin/engagement",onClick:n,children:"Odm\u011bny & \xdasp\u011bchy"}),I&&!ge&&(0,D.jsx)(N,{icon:_.uN,to:"/admin/komentare",onClick:n,children:"Koment\xe1\u0159e"}),I&&!ve&&(0,D.jsx)(N,{icon:_.Wp,to:"/admin/sweepstakes",onClick:n,children:"Sout\u011b\u017ee"}),I&&!je&&(0,D.jsx)(N,{icon:_.Z0L,to:"/admin/aliasy-soutezi",onClick:n,children:"Alias sout\u011b\u017e\xed"}),I&&!be&&(0,D.jsx)(N,{icon:_.umw,to:"/admin/obleceni",onClick:n,children:"Oble\u010den\xed"}),I&&!ye&&O&&(0,D.jsx)(N,{icon:_.umw,to:"/admin/eshop-produkty",onClick:n,children:"E\u2011shop produkty"}),I&&!fe&&(0,D.jsx)(N,{icon:_.vd0,to:"/admin/o-klubu",onClick:n,children:"O klubu"}),I&&!ke&&(0,D.jsx)(N,{icon:_.HiP,to:"/admin/videa",onClick:n,children:"Videa"}),I&&!_e&&(0,D.jsx)(N,{icon:_.dkL,to:"/admin/galerie",onClick:n,children:"Galerie (Zonerama)"}),I&&!we&&(0,D.jsx)(N,{icon:_.$BV,to:"/admin/scoreboard",onClick:n,children:"Tabule (Scoreboard)"}),I&&!ze&&(0,D.jsx)(N,{icon:_.rle,to:"/admin/scoreboard/remote",onClick:n,children:"Scoreboard Remote"}),I&&!Se&&(0,D.jsx)(N,{icon:_.DDN,to:"/admin/sponzori",onClick:n,children:"Sponzo\u0159i"}),I&&!Ae&&(0,D.jsx)(N,{icon:_.dkL,to:"/admin/bannery",onClick:n,children:"Bannery"}),I&&!Ce&&(0,D.jsx)(N,{icon:_.maD,to:"/admin/zpravy",onClick:n,children:"Zpr\xe1vy"}),I&&!Ee&&(0,D.jsx)(N,{icon:_.toK,to:"/admin/kontakty",onClick:n,children:"Kontakty"}),I&&!Te&&(0,D.jsx)(N,{icon:_.Cer,to:"/admin/newsletter",onClick:n,children:"Zpravodaj"}),I&&!De&&(0,D.jsx)(N,{icon:_.l2R,to:"/admin/ankety",onClick:n,children:"Ankety"}),I&&!Ie&&(0,D.jsx)(N,{icon:_.v$b,to:"/admin/analytika",onClick:n,children:"Analytika"}),I&&!Re&&(0,D.jsx)(N,{icon:_.OXb,to:"/admin/navigace",onClick:n,children:"Navigace"}),I&&!Fe&&(0,D.jsx)(N,{icon:_.YXz,to:"/admin/uzivatele",onClick:n,children:"U\u017eivatel\xe9"}),I&&!Ne&&(0,D.jsx)(N,{icon:_.M1W,to:"/admin/soubory",onClick:n,children:"Soubory"}),I&&!Pe&&(0,D.jsx)(N,{icon:_.lV_,to:"/admin/nastaveni",onClick:n,children:"Nastaven\xed"}),I&&!Me&&(0,D.jsx)(N,{icon:_.KP4,to:"/admin/prefetch",onClick:n,children:"Prefetch & Cache"}),I&&!Le&&q&&(0,D.jsx)(N,{icon:_.t69,to:"/admin/manual-data",onClick:n,children:"Manu\xe1ln\xed data sout\u011b\u017e\xed"})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(g.E,{fontSize:"xs",fontWeight:"bold",px:4,py:2,color:V,textTransform:"uppercase",letterSpacing:"wider",children:"Hlavn\xed"}),I&&(0,D.jsx)(N,{icon:_.$BV,to:"/admin",onClick:n,children:"N\xe1st\u011bnka"}),I&&q&&(0,D.jsx)(N,{icon:_.t69,to:"/admin/manual-data",onClick:n,children:"Manu\xe1ln\xed data sout\u011b\u017e\xed"}),I&&(0,D.jsx)(N,{icon:_.v$b,to:"/admin/analytika",onClick:n,children:"Analytika"}),(0,D.jsx)(g.E,{fontSize:"xs",fontWeight:"bold",px:4,py:2,color:V,textTransform:"uppercase",letterSpacing:"wider",mt:4,children:"Obsah"}),I&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(N,{icon:_.YXz,to:"/admin/tymy",onClick:n,children:"T\xfdmy"}),(0,D.jsx)(N,{icon:_.bfZ,to:"/admin/zapasy",onClick:n,children:(0,D.jsxs)(g.E,{as:"span",children:["Z\xe1pasy",(0,D.jsx)(g.E,{as:"span",ml:2,fontSize:"10px",px:2,py:.5,borderRadius:"full",bg:Y,color:Q,borderWidth:"1px",borderColor:ee,children:"scroller"})]})})]}),(0,D.jsx)(N,{icon:_.bfZ,to:"/admin/aktivity",onClick:n,children:(0,D.jsxs)(g.E,{as:"span",children:["Aktivity",ne>0&&(0,D.jsx)(g.E,{as:"span",ml:2,fontSize:"10px",px:2,py:.5,borderRadius:"full",bg:J,color:G,borderWidth:"1px",borderColor:X,children:ne})]})}),I&&(0,D.jsx)(N,{icon:_.i0U,to:"/admin/hraci",onClick:n,children:"Hr\xe1\u010di"}),(0,D.jsx)(N,{icon:_.Nhm,to:"/admin/clanky",onClick:n,children:"\u010cl\xe1nky"}),(0,D.jsx)(N,{icon:_.AnD,to:"/admin/shortlinks",onClick:n,children:"Zkr\xe1cen\xe9 odkazy"}),I&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(N,{icon:_.vd0,to:"/admin/o-klubu",onClick:n,children:"O klubu"}),(0,D.jsx)(N,{icon:_.dkL,to:"/admin/videa",onClick:n,children:"Videa"}),(0,D.jsx)(N,{icon:_.dkL,to:"/admin/galerie",onClick:n,children:"Galerie (Zonerama)"}),(0,D.jsx)(N,{icon:_.$BV,to:"/admin/scoreboard",onClick:n,children:"Tabule (Scoreboard)"}),(0,D.jsx)(N,{icon:_.rle,to:"/admin/scoreboard/remote",onClick:n,children:"Scoreboard Remote"}),(0,D.jsx)(N,{icon:_.lV_,to:"/admin/obleceni",onClick:n,children:"Oble\u010den\xed"}),(0,D.jsx)(N,{icon:_.DDN,to:"/admin/sponzori",onClick:n,children:"Sponzo\u0159i"}),(0,D.jsx)(N,{icon:_.dkL,to:"/admin/bannery",onClick:n,children:"Bannery"}),(0,D.jsx)(N,{icon:_.maD,to:"/admin/zpravy",onClick:n,children:"Zpr\xe1vy"}),(0,D.jsx)(N,{icon:_.uN,to:"/admin/komentare",onClick:n,children:"Koment\xe1\u0159e"}),(0,D.jsx)(N,{icon:_.toK,to:"/admin/kontakty",onClick:n,children:"Kontakty"}),(0,D.jsx)(N,{icon:_.Cer,to:"/admin/newsletter",onClick:n,children:"Zpravodaj"}),(0,D.jsx)(N,{icon:_.l2R,to:"/admin/ankety",onClick:n,children:"Ankety"}),(0,D.jsx)(N,{icon:_.Z0L,to:"/admin/engagement",onClick:n,children:"Odm\u011bny & \xdasp\u011bchy"})]}),(0,D.jsx)(b.c,{my:2}),I&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(g.E,{fontSize:"xs",fontWeight:"bold",px:4,py:2,color:V,textTransform:"uppercase",letterSpacing:"wider",mt:4,children:"Nastaven\xed"}),(0,D.jsx)(N,{icon:_.OXb,to:"/admin/navigace",onClick:n,children:"Navigace"}),(0,D.jsx)(N,{icon:_.Z0L,to:"/admin/aliasy-soutezi",onClick:n,children:"Alias sout\u011b\u017e\xed"}),(0,D.jsx)(N,{icon:_.KP4,to:"/admin/prefetch",onClick:n,children:"Prefetch & Cache"}),(0,D.jsx)(N,{icon:_.YXz,to:"/admin/uzivatele",onClick:n,children:"U\u017eivatel\xe9"}),(0,D.jsx)(N,{icon:_.lV_,to:"/admin/nastaveni",onClick:n,children:"Nastaven\xed"}),(0,D.jsx)(N,{icon:_.AnD,to:"/admin/shortlinks",onClick:n,children:"Zkr\xe1cen\xe9 odkazy"}),(0,D.jsx)(N,{icon:_.M1W,to:"/admin/soubory",onClick:n,children:"Soubory"})]})]}),(0,D.jsx)(s.a,{mt:"auto",mb:4,px:2,children:(0,D.jsxs)(p.N,{as:"button",display:"flex",alignItems:"center",w:"100%",px:4,py:2,borderRadius:"md",_hover:{textDecoration:"none",bg:(0,i.dU)("red.50","red.900"),color:"red.500"},onClick:k,color:(0,i.dU)("red.500","red.300"),children:[(0,D.jsx)(x.I,{as:_.axc,mr:3}),(0,D.jsx)(g.E,{children:"Odhl\xe1sit se"})]})})]})})};var P=n(80045),I=n(99956),M=n(59883),L=n(86236),W=n(27024),U=n(91872),O=n(53560),q=n(87024);const K=["onMenuToggle","rightContent"],B=e=>{let{onMenuToggle:t,rightContent:n}=e,a=(0,P.A)(e,K);const{user:r,logout:d}=(0,h.A)(),u=(0,i.dU)("white","#1a1d29"),x=(0,i.dU)("gray.200","rgba(255, 255, 255, 0.12)"),v=((0,i.dU)("gray.800","#e2e8f0"),r),j=(0,i.dU)("sm","none");return(0,D.jsx)(s.a,(0,m.A)((0,m.A)({as:"header",position:"sticky",top:0,left:0,right:0,bg:u,borderBottomWidth:"1px",borderColor:x,zIndex:20,height:"60px",px:{base:3,md:6},boxShadow:j,transition:"all 0.2s"},a),{},{children:(0,D.jsxs)(o.s,{h:"100%",alignItems:"center",justifyContent:"space-between",children:[(0,D.jsxs)(o.s,{alignItems:"center",children:[(0,D.jsx)(c.K,{display:{base:"flex",md:"none"},"aria-label":"Otev\u0159\xedt menu",icon:(0,D.jsx)(_.OXb,{}),variant:"ghost",onClick:t,mr:2}),(0,D.jsx)(g.E,{fontSize:"xl",fontWeight:"bold",display:{base:"none",md:"block"},children:"Fotbal Admin"})]}),(0,D.jsx)(l.z,{spacing:4,children:n||(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(I.m,{label:"Dokumentace",hasArrow:!0,children:(0,D.jsx)(p.N,{as:k.N_,to:"/admin/docs",children:(0,D.jsx)(c.K,{"aria-label":"Dokumentace",icon:(0,D.jsx)(_.vd0,{}),variant:"ghost",size:"sm",mr:1})})}),(0,D.jsx)(q.UW,{}),(0,D.jsxs)(M.W,{children:[(0,D.jsx)(L.I,{children:(0,D.jsx)(W.e,{size:"sm",name:(null===v||void 0===v?void 0:v.name)||"U\u017eivatel",src:null===v||void 0===v?void 0:v.avatar,cursor:"pointer",border:"2px solid",borderColor:(0,i.dU)("gray.200","gray.600"),_hover:{transform:"scale(1.05)",transition:"transform 0.2s"}})}),(0,D.jsxs)(U.c,{zIndex:30,children:[(null===v||void 0===v?void 0:v.name)&&(0,D.jsxs)(s.a,{px:3,py:2,borderBottomWidth:"1px",borderColor:x,children:[(0,D.jsx)(g.E,{fontWeight:"medium",children:v.name}),(0,D.jsx)(g.E,{fontSize:"sm",color:"gray.500",children:v.email})]}),(0,D.jsx)(O.D,{icon:(0,D.jsx)(_.aBc,{}),_hover:{bg:(0,i.dU)("gray.100","gray.700")},children:"M\u016fj \xfa\u010det"}),(0,D.jsx)(O.D,{icon:(0,D.jsx)(_.axc,{}),color:"red.500",_hover:{bg:(0,i.dU)("red.50","red.900")},onClick:d,children:"Odhl\xe1sit se"})]})]})]})})]})}))};var Z=n(78460),V=n(11054),H=n(85421),$=n(15071),J=n(12555),G=n(35929),X=n(67516),Y=n(45973),Q=n(29244),ee=n(35699),te=n(47781),ne=n(87139);const ae=[{label:"Dashboard",path:"/admin",section:"Z\xe1kladn\xed",keywords:["overview","stat","dashboard","p\u0159ehled"],icon:_.$BV},{label:"\u010cl\xe1nky",path:"/admin/clanky",section:"Obsah",keywords:["articles","posts","blog","\u010dl\xe1nky"],icon:_.Nhm},{label:"Kategorie \u010dl\xe1nk\u016f",path:"/admin/kategorie",section:"Obsah",keywords:["categories","kategorie"],icon:_.amN},{label:"Aktivity",path:"/admin/aktivity",section:"Obsah",keywords:["activities","events","akce","ud\xe1losti"],icon:_.bfZ},{label:"Koment\xe1\u0159e",path:"/admin/komentare",section:"Obsah",keywords:["comments","diskuse"],icon:_.g5D},{label:"Hr\xe1\u010di",path:"/admin/hraci",section:"Sport",keywords:["players","hr\xe1\u010di"],icon:_.YXz},{label:"T\xfdmy",path:"/admin/tymy",section:"Sport",keywords:["teams","t\xfdmy"],icon:_.YXz},{label:"Z\xe1pasy",path:"/admin/zapasy",section:"Sport",keywords:["matches","facr","z\xe1pasy"],icon:_.bfZ},{label:"Alias sout\u011b\u017e\xed",path:"/admin/aliasy",section:"Sport",keywords:["aliases","competition","sout\u011b\u017ee"],icon:_.Z0L},{label:"Tabulky",path:"/admin/tabulky",section:"Sport",keywords:["standings","table","tabulka"],icon:_.YYR},{label:"Tabule (Scoreboard)",path:"/admin/scoreboard",section:"Sport",keywords:["scoreboard","tabule","v\xfdsledky"],icon:_.vF8},{label:"Galerie",path:"/admin/galerie",section:"M\xe9dia",keywords:["gallery","zonerama","fotky"],icon:_.dkL},{label:"Videa",path:"/admin/videa",section:"M\xe9dia",keywords:["youtube","videos","videa"],icon:_.HiP},{label:"Soubory",path:"/admin/soubory",section:"M\xe9dia",keywords:["files","uploads","soubory"],icon:_.g1V},{label:"Sponzo\u0159i",path:"/admin/sponzori",section:"Marketing",keywords:["sponsors","partners","sponzo\u0159i"],icon:_.DDN},{label:"Bannery",path:"/admin/bannery",section:"Marketing",keywords:["banners","reklama"],icon:_.dkL},{label:"Oble\u010den\xed",path:"/admin/obleceni",section:"Marketing",keywords:["clothing","merch","eshop","obleceni"],icon:_.umw},{label:"Ankety",path:"/admin/ankety",section:"Marketing",keywords:["polls","ankety","hlasov\xe1n\xed"],icon:_.l2R},{label:"Sout\u011b\u017ee",path:"/admin/souteze",section:"Marketing",keywords:["sweepstakes","soute\u017ee","akce"],icon:_.SBv},{label:"Odm\u011bny & \xdasp\u011bchy",path:"/admin/odmeny",section:"Marketing",keywords:["engagement","rewards","odmeny","\xfasp\u011bchy"],icon:_.SBv},{label:"Zkr\xe1cen\xe9 odkazy",path:"/admin/shortlinks",section:"Marketing",keywords:["shortlinks","zkr\xe1cen\xe9","odkazy"],icon:_.AnD},{label:"QR k\xf3dy",path:"/admin/qr",section:"Marketing",keywords:["qr","k\xf3dy","qrcode"],icon:_.Acq},{label:"Vstupenky",path:"/admin/vstupenky",section:"Marketing",keywords:["tickets","vstupenky","prodej"],icon:_.tVd},{label:"Newsletter",path:"/admin/newsletter",section:"Komunikace",keywords:["email","campaign","newsletter"],icon:_.maD},{label:"Zpr\xe1vy",path:"/admin/zpravy",section:"Komunikace",keywords:["messages","zpr\xe1vy"],icon:_.g5D},{label:"Kontakty",path:"/admin/kontakty",section:"Komunikace",keywords:["contacts","kontakty","formul\xe1\u0159"],icon:_.toK},{label:"Notifikace",path:"/admin/notifications",section:"Komunikace",keywords:["notifications","notifikace"],icon:_.jNV},{label:"Analytika",path:"/admin/analytika",section:"SEO",keywords:["analytics","umami"],icon:_.YYR},{label:"O klubu",path:"/admin/o-klubu",section:"Obsah",keywords:["about","klub"],icon:_.lV_},{label:"Nastaven\xed",path:"/admin/nastaveni",section:"Nastaven\xed",keywords:["settings","config","nastaven\xed"],icon:_.Pcn},{label:"U\u017eivatel\xe9",path:"/admin/uzivatele",section:"Nastaven\xed",keywords:["users","accounts","u\u017eivatel\xe9"],icon:_.pXu},{label:"Navigace",path:"/admin/navigace",section:"Nastaven\xed",keywords:["navigation","menu","sidebar"],icon:_.OXb},{label:"Prefetch & Cache",path:"/admin/prefetch",section:"N\xe1stroje",keywords:["cache","fetch","prefetch"],icon:_.KP4},{label:"Chybov\xe1 hl\xe1\u0161en\xed",path:"/admin/chyby",section:"N\xe1stroje",keywords:["errors","chyby","hl\xe1\u0161en\xed","log"],icon:_.KRc},{label:"P\u0159eklady (I18n)",path:"/admin/i18n",section:"N\xe1stroje",keywords:["i18n","p\u0159eklady","jazyky","translations"],icon:_.f35},{label:"FACR manu\xe1l",path:"/admin/facr-manual",section:"N\xe1stroje",keywords:["facr","manu\xe1l","import"],icon:_.i0U},{label:"Nastaven\xed - Soci\xe1ln\xed s\xedt\u011b",path:"/admin/nastaveni#socialni-site",section:"Nastaven\xed",keywords:["socialni","s\xedt\u011b","facebook","instagram","twitter"],icon:_.toK},{label:"Nastaven\xed - Videa",path:"/admin/nastaveni#videa",section:"Nastaven\xed",keywords:["videa","youtube","kan\xe1l"],icon:_.HiP},{label:"Nastaven\xed - SMTP",path:"/admin/nastaveni#smtp",section:"Nastaven\xed",keywords:["smtp","email","odes\xedl\xe1n\xed"],icon:_.maD},{label:"Nastaven\xed - Analytika",path:"/admin/nastaveni#analytika",section:"Nastaven\xed",keywords:["umami","analytics","statistiky"],icon:_.YYR},{label:"Nastaven\xed - SEO",path:"/admin/nastaveni#seo",section:"Nastaven\xed",keywords:["seo","metadata","vyhled\xe1va\u010de"],icon:_.KSO},{label:"Nastaven\xed - Obecn\xe9",path:"/admin/nastaveni#obecne",section:"Nastaven\xed",keywords:["obecn\xe9","z\xe1kladn\xed","klub"],icon:_.Pcn},{label:"Dokumentace - \xdavod",path:"/admin/docs#uvod",section:"Dokumentace",keywords:["docs","documentation","\xfavod"],icon:_.vd0},{label:"Dokumentace - Nastaven\xed klubu",path:"/admin/docs#nastaveni",section:"Dokumentace",keywords:["docs","nastaven\xed","konfigurace"],icon:_.vd0},{label:"Dokumentace - Dashboard",path:"/admin/docs#dashboard",section:"Dokumentace",keywords:["docs","dashboard","p\u0159ehledy"],icon:_.vd0},{label:"Dokumentace - \u010cl\xe1nky",path:"/admin/docs#clanky",section:"Dokumentace",keywords:["docs","\u010dl\xe1nky","blog"],icon:_.vd0},{label:"Dokumentace - Z\xe1pasy",path:"/admin/docs#zapasy",section:"Dokumentace",keywords:["docs","z\xe1pasy","facr"],icon:_.vd0},{label:"Dokumentace - Hr\xe1\u010di a t\xfdmy",path:"/admin/docs#hraci-tymy",section:"Dokumentace",keywords:["docs","hr\xe1\u010di","t\xfdmy"],icon:_.vd0},{label:"Dokumentace - M\xe9dia",path:"/admin/docs#media",section:"Dokumentace",keywords:["docs","m\xe9dia","soubory"],icon:_.vd0},{label:"Dokumentace - Galerie",path:"/admin/docs#gallery",section:"Dokumentace",keywords:["docs","galerie","fotky"],icon:_.vd0},{label:"Dokumentace - Soubory",path:"/admin/docs#files",section:"Dokumentace",keywords:["docs","soubory","upload"],icon:_.vd0},{label:"Dokumentace - Sponzo\u0159i a bannery",path:"/admin/docs#sponzori-bannery",section:"Dokumentace",keywords:["docs","sponzo\u0159i","bannery"],icon:_.vd0},{label:"Dokumentace - Newsletter",path:"/admin/docs#newsletter",section:"Dokumentace",keywords:["docs","newsletter","email"],icon:_.vd0},{label:"Dokumentace - Alias sout\u011b\u017e\xed",path:"/admin/docs#aliasy",section:"Dokumentace",keywords:["docs","alias","sout\u011b\u017ee"],icon:_.vd0},{label:"Dokumentace - Prefetch",path:"/admin/docs#prefetch",section:"Dokumentace",keywords:["docs","prefetch","cache"],icon:_.vd0},{label:"Dokumentace - Videa",path:"/admin/docs#videa",section:"Dokumentace",keywords:["docs","videa","youtube"],icon:_.vd0},{label:"Dokumentace - Aktivity",path:"/admin/docs#aktivity",section:"Dokumentace",keywords:["docs","aktivity","ud\xe1losti"],icon:_.vd0},{label:"Dokumentace - Oble\u010den\xed",path:"/admin/docs#merch",section:"Dokumentace",keywords:["docs","obleceni","merch"],icon:_.vd0},{label:"Dokumentace - Zpr\xe1vy",path:"/admin/docs#zpravy",section:"Dokumentace",keywords:["docs","zpr\xe1vy","komunikace"],icon:_.vd0},{label:"Dokumentace - Kontakty",path:"/admin/docs#contacts",section:"Dokumentace",keywords:["docs","kontakty","formul\xe1\u0159e"],icon:_.vd0},{label:"Dokumentace - Analytics",path:"/admin/docs#analytics",section:"Dokumentace",keywords:["docs","analytics","statistiky"],icon:_.vd0},{label:"Dokumentace - Scoreboard",path:"/admin/docs#scoreboard",section:"Dokumentace",keywords:["docs","scoreboard","tabule"],icon:_.vd0},{label:"Dokumentace - Mobiln\xed scoreboard",path:"/admin/docs#mobile-scoreboard",section:"Dokumentace",keywords:["docs","mobiln\xed","scoreboard"],icon:_.vd0},{label:"Dokumentace - U\u017eivatel\xe9",path:"/admin/docs#uzivatele",section:"Dokumentace",keywords:["docs","u\u017eivatel\xe9","p\u0159\xedstupy"],icon:_.vd0},{label:"Dokumentace - Intern\xed dokumentace",path:"/admin/docs#docs",section:"Dokumentace",keywords:["docs","intern\xed","v\xfdvoj"],icon:_.vd0},{label:"Dokumentace - Checklisty",path:"/admin/docs#checklist",section:"Dokumentace",keywords:["docs","checklist","postupy"],icon:_.vd0},{label:"Dokumentace - SEO",path:"/admin/docs#seo",section:"Dokumentace",keywords:["docs","seo","metadata"],icon:_.vd0},{label:"Dokumentace - \u0158e\u0161en\xed probl\xe9m\u016f",path:"/admin/docs#troubleshooting",section:"Dokumentace",keywords:["docs","troubleshooting","probl\xe9my"],icon:_.vd0}];function ie(e,t){if(!t)return e;try{const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(n,"gi"),i=e.split(a),o=e.match(a)||[],r=[];return i.forEach((e,t)=>{r.push(e),t<o.length&&r.push((0,D.jsx)("mark",{style:{backgroundColor:"#fde68a"},children:o[t]},t))}),(0,D.jsx)(D.Fragment,{children:r})}catch(n){return e}}function oe(e,t){const n=(e.label||"").toLowerCase(),a=t.toLowerCase(),i=(e.keywords||[]).join(" ").toLowerCase();let o=0;return a?(n===a&&(o+=200),n.startsWith(a)&&(o+=120),n.includes(a)&&(o+=80-n.indexOf(a)),i.includes(a)&&(o+=40),"Nastaven\xed"===e.section&&(a.includes("nastaven\xed")||a.includes("settings")||a.includes("config"))&&(o+=30),"Dokumentace"===e.section&&(a.includes("docs")||a.includes("dokumentace")||a.includes("help")||a.includes("n\xe1vod"))&&(o+=30),"Dokumentace"===e.section&&e.path.includes("#")&&(o+=5),o):o}function re(e){let{isOpen:t,onClose:n,onSelectPath:a}=e;const[i,o]=(0,d.useState)(""),[r,c]=(0,d.useState)(""),[u,h]=(0,d.useState)(-1),m=(0,d.useRef)(null);(0,d.useEffect)(()=>{const e=setTimeout(()=>c(i.trim()),250);return()=>clearTimeout(e)},[i]),(0,d.useEffect)(()=>{t&&(o(""),c(""),h(-1),setTimeout(()=>{var e;return null===(e=m.current)||void 0===e?void 0:e.focus()},50))},[t]);const p=(0,d.useMemo)(()=>ae.map(e=>({it:e,s:oe(e,r)})).filter(e=>e.s>0||!r).sort((e,t)=>t.s-e.s||e.it.label.localeCompare(t.it.label)).slice(0,12).map(e=>e.it),[r]),v=(0,d.useCallback)(e=>{n(),a(e)},[n,a]);return(0,D.jsxs)(Z.aF,{isOpen:t,onClose:n,size:"lg",motionPreset:"scale",children:[(0,D.jsx)(V.m,{}),(0,D.jsxs)(H.$,{children:[(0,D.jsxs)($.r,{children:["Admin vyhled\xe1v\xe1n\xed",(0,D.jsxs)(s.a,{as:"span",ml:3,color:"gray.500",fontSize:"sm",children:[(0,D.jsx)(J.u,{children:"Ctrl"}),"+",(0,D.jsx)(J.u,{children:"K"})]})]}),(0,D.jsx)(G.s,{}),(0,D.jsxs)(X.c,{pb:4,children:[(0,D.jsxs)(Y.M,{size:"lg",children:[(0,D.jsx)(Q.W,{pointerEvents:"none",children:(0,D.jsx)(x.I,{as:_.KSO})}),(0,D.jsx)(ee.p,{placeholder:"Hledat str\xe1nky, nastaven\xed, dokumentaci... (nap\u0159. 'soci\xe1ln\xed s\xedt\u011b', '\u010dl\xe1nky', 'scoreboard')",value:i,onChange:e=>{o(e.target.value),h(-1)},onKeyDown:e=>{const t=p.length;if("ArrowDown"===e.key)e.preventDefault(),h(e=>Math.min(t-1,e+1));else if("ArrowUp"===e.key)e.preventDefault(),h(e=>Math.max(-1,e-1));else if("Enter"===e.key){const e=u>=0?p[u]:p[0];e&&v(e.path)}else(e.ctrlKey||e.metaKey)&&"k"===String(e.key||"").toLowerCase()?(e.preventDefault(),n()):"Escape"===e.key&&n()},ref:m,autoFocus:!0})]}),(0,D.jsxs)(te.B8,{mt:4,spacing:1,children:[p.map((e,t)=>(0,D.jsx)(te.ck,{px:3,py:2,borderRadius:"md",cursor:"pointer",bg:t===u?"blackAlpha.50":"transparent",_hover:{bg:"blackAlpha.50"},onClick:()=>v(e.path),children:(0,D.jsxs)(l.z,{children:[e.icon?(0,D.jsx)(x.I,{as:e.icon,color:"blue.500"}):null,(0,D.jsx)(g.E,{fontWeight:"semibold",children:ie(e.label,r)}),(0,D.jsx)(ne.E,{ml:"auto",colorScheme:"gray",children:e.section})]})},e.path)),0===p.length&&(0,D.jsx)(s.a,{color:"gray.500",fontSize:"sm",px:1,py:2,children:"\u017d\xe1dn\xe9 v\xfdsledky"})]})]})]})]})}var se=n(30502),le=n(19077),ce=n(56529),de=n(98662),ue=n(44847),he=n(35436),me=n(74770);function pe(){const{isOpen:e,onOpen:t,onClose:n}=(0,a.j)(),[o,r]=(0,d.useState)(""),[m,p]=(0,d.useState)(!1),x=(0,u.zy)(),j=(0,se.d)(),{user:b}=(0,h.A)(),[y,f]=(0,d.useState)(""),[k,w]=(0,d.useState)(""),z=(0,d.useMemo)(()=>(0,ue.z)(12),[e]),S=x.pathname+x.search,A=(0,i.dU)("gray.50","gray.800"),C=(0,i.dU)("gray.200","gray.600"),E=(0,d.useMemo)(()=>{const e=Date.now();return z.map(t=>{var n;const a=Math.max(0,Math.round((e-t.at)/1e3));return"nav"===t.type?"-".concat(a,"s NAV ").concat(t.path):"-".concat(a,"s ").concat(t.method.toUpperCase()," ").concat(t.url," ").concat(null!==(n=t.status)&&void 0!==n?n:""," ").concat(t.ms?t.ms+"ms":"").trim()})},[z]);(0,d.useEffect)(()=>{e&&(async()=>{try{const e=await(0,me.rC)();f(String(e.error_review_ui_url||"")),w(String(e.error_review_admin_token||""))}catch(e){}})()},[e]);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(s.a,{position:"fixed",right:4,bottom:4,zIndex:40,children:(0,D.jsx)(I.m,{label:"Z\xe1kaznick\xe1 podpora",hasArrow:!0,children:(0,D.jsx)(c.K,{"aria-label":"Z\xe1kaznick\xe1 podpora",icon:(0,D.jsx)(_.Qro,{}),onClick:t,colorScheme:"blue",borderRadius:"full",boxShadow:"lg"})})}),(0,D.jsxs)(Z.aF,{isOpen:e,onClose:n,size:"lg",children:[(0,D.jsx)(V.m,{}),(0,D.jsxs)(H.$,{children:[(0,D.jsx)($.r,{children:"Nahl\xe1sit probl\xe9m"}),(0,D.jsx)(G.s,{}),(0,D.jsx)(X.c,{children:(0,D.jsxs)(v.T,{align:"stretch",spacing:4,children:[(0,D.jsxs)(l.z,{spacing:3,children:[(0,D.jsx)(ne.E,{colorScheme:"blue",children:"Admin"}),(0,D.jsx)(g.E,{fontSize:"sm",color:"gray.500",children:S})]}),(0,D.jsxs)(s.a,{bg:A,borderWidth:"1px",borderColor:C,borderRadius:"md",p:3,maxH:"160px",overflowY:"auto",children:[(0,D.jsx)(g.E,{fontSize:"xs",color:"gray.500",mb:2,children:"Posledn\xed akce"}),(0,D.jsx)(v.T,{align:"stretch",spacing:1,children:E.map((e,t)=>(0,D.jsx)(g.E,{fontFamily:"mono",fontSize:"xs",children:e},t))})]}),(0,D.jsx)(le.T,{value:o,onChange:e=>r(e.target.value),placeholder:"Popi\u0161te, co se stalo\u2026",rows:5})]})}),(0,D.jsxs)(ce.j,{children:[(0,D.jsx)(v.T,{align:"stretch",spacing:2,flex:1,mr:3,children:(0,D.jsx)(l.z,{children:(0,D.jsx)(de.$,{size:"sm",variant:"outline",onClick:()=>window.open("/admin/docs","_blank"),children:"N\xe1pov\u011bda"})})}),(0,D.jsx)(de.$,{colorScheme:"blue",onClick:async()=>{if(!m){p(!0);try{await(0,he.N)({severity:"warn",message:null!==o&&void 0!==o&&o.trim()?"Support: ".concat(o.trim()):"Support: bez popisu",tags:{type:"support",source:"admin"},context:{path:S,recentActions:z},user_id:null===b||void 0===b?void 0:b.id,url:S}),j({title:"Odesl\xe1no",description:"D\u011bkujeme, ozveme se co nejd\u0159\xedve.",status:"success",duration:3e3}),r(""),n()}catch(e){j({title:"Chyba",description:"Nepoda\u0159ilo se odeslat.",status:"error"})}finally{p(!1)}}},isLoading:m,children:"Odeslat"})]})]})]})]})}var xe=n(46291);const ge=()=>{const[e,t]=(0,d.useState)("loading"),[n,a]=(0,d.useState)(null);let i;switch((0,d.useEffect)(()=>{let e,n=!1;const i=async()=>{try{var o;const e=await xe.Ay.get("/health/ready");if(n)return;const i=((null===(o=e.data)||void 0===o?void 0:o.status)||"").toLowerCase();let r;r="healthy"===i?"healthy":"degraded"===i?"degraded":"unhealthy",t(r),a(null)}catch(r){if(n)return;t(e=>"loading"===e?"error":e),a("Nepoda\u0159ilo se ov\u011b\u0159it stav serveru")}finally{n||(e=window.setTimeout(i,6e4))}};return i(),()=>{n=!0,e&&window.clearTimeout(e)}},[]),e){case"healthy":i="green.400";break;case"degraded":i="orange.400";break;case"unhealthy":i="red.400";break;case"loading":i="yellow.300";break;default:i="gray.400"}const o="loading"===e?"Ov\u011b\u0159uji stav serveru\u2026":"healthy"===e?"Server v po\u0159\xe1dku":"degraded"===e?"Server b\u011b\u017e\xed, ale v omezen\xe9m re\u017eimu":"unhealthy"===e?"Server nen\xed p\u0159ipraven (zdravotn\xed kontrola selhala)":"error"===e?n||"Nepoda\u0159ilo se ov\u011b\u0159it stav serveru":"Stav serveru nen\xed zn\xe1m\xfd";return(0,D.jsx)(I.m,{label:o,hasArrow:!0,children:(0,D.jsx)(s.a,{as:"span",w:"10px",h:"10px",borderRadius:"full",bg:i,boxShadow:"0 0 0 2px rgba(255, 255, 255, 0.6)"})})},ve=e=>{let{children:t,requireAdmin:n=!0}=e;const{isOpen:m,onOpen:p,onClose:x}=(0,a.j)({defaultIsOpen:!1}),{isOpen:g,onOpen:v,onClose:j}=(0,a.j)(),b=(0,d.useRef)(!1),y=()=>{b.current=!1,x()},f=(0,u.Zp)(),k=(0,u.zy)(),{isAuthenticated:w,isLoading:z,user:S}=(0,h.A)(),{colorMode:A}=(0,i.G6)(),C=(0,i.dU)("gray.50","gray.900"),N=((0,i.dU)("white","#1a1d29"),(0,i.dU)("white","gray.800")),R=(0,i.dU)("gray.200","gray.700"),{data:P}=(0,E.s)(),[I,M]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{const e=()=>{const e=window.innerWidth<768;M(e)};e();const t=()=>e();return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[I]),function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=(0,u.zy)(),n=(0,d.useRef)(new Map),a=(0,d.useRef)(""),i=(0,d.useRef)(!1);(0,d.useEffect)(()=>{if(!e)return;const o=document.querySelector('[data-sidebar="true"]');if(!o)return;if(a.current&&!i.current){const e=o.scrollTop;e>0&&n.current.set(a.current,e)}const r=n.current.get(t.pathname)||0;r>0&&t.pathname!==a.current&&(i.current=!0,o.scrollTop=r,requestAnimationFrame(()=>{i.current=!1})),a.current=t.pathname},[t.pathname,e])}(!I),(0,d.useEffect)(()=>{z||w||f("/login",{state:{from:k.pathname}})},[w,z,f,k]),(0,d.useEffect)(()=>{const e=e=>{const t=(e.key||"").toLowerCase();(e.ctrlKey||e.metaKey)&&"k"===t&&(e.preventDefault(),v()),"escape"===t&&m&&y()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[v,m,y]),(0,d.useEffect)(()=>{if(!z&&w&&n){const e=null===S||void 0===S?void 0:S.role;e&&"admin"!==e&&f("/403",{replace:!0,state:{from:k.pathname}})}},[z,w,S,f,n]),(0,d.useEffect)(()=>{(0,ue.d)({type:"nav",at:Date.now(),path:k.pathname+k.search})},[k.pathname,k.search]),(0,d.useEffect)(()=>{try{const e=(null===P||void 0===P?void 0:P.club_logo_url)||"/dist/img/logo-club-empty.svg";if(!e)return;const t=(0,T.uq)(e)||e,n=e=>{let n=document.querySelector('link[rel="'.concat(e,'"]'));n||(n=document.createElement("link"),n.rel=e,document.head.appendChild(n)),n.href=t,t.endsWith(".svg")&&(n.type="image/svg+xml")};n("icon"),n("shortcut icon")}catch(e){}},[null===P||void 0===P?void 0:P.club_logo_url]),z?(0,D.jsxs)(o.s,{minH:"100vh",bg:C,children:[(0,D.jsx)(r.E,{width:"250px",height:"100vh",position:"fixed"}),(0,D.jsxs)(s.a,{ml:{base:0,md:"250px"},flex:1,p:6,children:[(0,D.jsx)(r.E,{height:"60px",mb:6}),(0,D.jsx)(r.E,{height:"400px"})]})]}):w?(0,D.jsxs)(s.a,{minH:"100vh",bg:C,className:"admin-layout",children:[(0,D.jsx)(s.a,{display:{base:m?"block":"none",md:"none"},position:"fixed",top:0,left:0,right:0,bottom:0,bg:"blackAlpha.600",zIndex:9,onClick:y}),(0,D.jsx)(F,{isOpen:m,onClose:y,bg:N,borderRight:"1px",borderColor:R}),(0,D.jsxs)(s.a,{ml:{base:0,md:"260px"},transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",minH:"100vh",children:[(0,D.jsx)(B,{onMenuToggle:()=>{b.current=!0,p()},rightContent:(0,D.jsxs)(l.z,{spacing:3,children:[(0,D.jsx)(ge,{}),(0,D.jsx)(c.K,{"aria-label":"Vyhled\xe1v\xe1n\xed v administraci",icon:(0,D.jsx)(_.KSO,{}),onClick:v,variant:"ghost",size:"sm",borderRadius:"full",_hover:{bg:(0,i.dU)("gray.100","gray.700"),transform:"scale(1.05)"},transition:"all 0.2s"}),(0,D.jsx)(pe,{}),(0,D.jsx)(q.UW,{})]})}),(0,D.jsx)(s.a,{as:"main",className:"admin-main",p:{base:4,md:8},pb:{base:8,md:12},children:t}),(0,D.jsx)(re,{isOpen:g,onClose:j,onSelectPath:e=>f(e)})]})]}):null}},7157:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ie});var a=n(89379),i=n(60790),o=n(88787),r=n(85871),s=n(87139),l=n(22107),c=n(98662),d=n(96351),u=n(44093),h=n(5371),m=n(73225),p=n(76668),x=n(73212),g=n(33572),v=n(35699),j=n(45973),b=n(29244),y=n(47781),f=n(67516),k=n(56529),_=n(15071),w=n(11054),z=n(63935),S=n(19542),A=n(76659),C=n(96148),E=n(10202),T=n(80511),D=n(82595),N=n(67813),R=n(83201),F=n(3313),P=n(55395),I=n(14566),M=n(31411),L=n(10227),W=n(51794),U=n(3109),O=n(48239),q=n(30502),K=n(99956),B=n(28846),Z=n(39081),V=n(72526),H=n(59781),$=n(12836),J=n(6583),G=n(42687),X=n(44318),Y=n(25189),Q=n(65043),ee=n(46291),te=n(70579);function ne(e){let t=String(e||"");t=t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),t=t.replace(/[\u2012\u2013\u2014\u2015\u2212]/g,"-"),t=t.replace(/\bn\.?\b/g," nad "),t=t.replace(/\bp\.?\b/g," pod "),t=t.replace(/[,,\s]*(z\.?\s*s\.?|o\.?\s*s\.?)\s*$/g,"");const n=["fotbalovy klub","sportovni klub","telovychovna jednota","skolni sportovni klub","spolek","fotbal","futsal"];for(const a of n){const e=new RegExp("(^|\\b)"+a+"(\\b|$)","g");t=t.replace(e," ")}return t=t.replace(/\b(1\.)?\s*(sfc|afc|fc|fk|mfk|tj|sk|afk)\b\.?/g," "),t=t.replace(/[\.,!;:()\[\]{}]/g," "),t=t.replace(/\s+/g," ").trim(),t}function ae(e){try{const t=String(e||"");if(!t)return;const n=t.match(/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/);return n?n[0].toLowerCase():void 0}catch(t){return}}const ie=()=>{const e=(0,q.d)(),t=(0,H.jE)(),{data:n,isLoading:ie,error:oe}=(0,V.I)({queryKey:["facr-tables-cache"],queryFn:()=>(0,X.g)(),staleTime:3e5}),re=Array.isArray(null===n||void 0===n?void 0:n.competitions)?n.competitions:[],se=null!==n&&void 0!==n&&n.club_id?String(n.club_id).toLowerCase():void 0,le=(0,Q.useMemo)(()=>ne(String((null===n||void 0===n?void 0:n.name)||"")),[null===n||void 0===n?void 0:n.name]),ce=new URL(ee.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin,de=(0,u.dU)("gray.50","gray.700"),ue=(0,u.dU)("gray.50","gray.700"),he=(0,u.dU)("white","gray.800"),{data:me={}}=(0,V.I)({queryKey:["teamLogoOverrides"],queryFn:G.a5,staleTime:3e5}),pe=(null===me||void 0===me?void 0:me.by_id)||{},xe=(0,Q.useMemo)(()=>{const e={};try{for(const[t,n]of Object.entries(pe))e[String(t).toLowerCase()]=n}catch(t){}return e},[pe]),ge=(0,Q.useMemo)(()=>{const e={};try{for(const[t,n]of Object.entries(pe)){const a=String((null===n||void 0===n?void 0:n.name)||"").trim(),i=String((null===n||void 0===n?void 0:n.logo_url)||"").trim();if(!a)continue;const o=ne(a);o&&(e[o]={id:t,name:a,logo_url:i})}}catch(t){}return e},[pe]),[ve,je]=(0,Q.useState)({}),[be,ye]=(0,Q.useState)(!1);(0,Q.useEffect)(()=>{if(!re||0===re.length)return;const e=new Set;for(const n of re){var t;const a=(null===n||void 0===n||null===(t=n.table)||void 0===t?void 0:t.overall)||[];for(const t of a)if(t.team_id)e.add(String(t.team_id).toLowerCase());else{const n=ae(t.team_logo_url);n&&e.add(n)}}if(0===e.size)return;if(e.size>500){console.warn("Too many team IDs (".concat(e.size,") for logo fetching. Limiting to first ").concat(500,"."));const t=Array.from(e);t.length=500,e.clear(),t.forEach(t=>e.add(t))}ye(!0),(0,i.Br)(Array.from(e)).then(e=>je(e)).catch(e=>console.error("Failed to fetch sport logos:",e)).finally(()=>ye(!1))},[re]);const fe=(null===me||void 0===me?void 0:me.by_name)||{},ke=(0,Q.useMemo)(()=>{const e={};for(const t of Object.keys(fe))e[ne(t)]=fe[t];return e},[fe]),_e=(0,Q.useMemo)(()=>Object.keys(fe||{}).map(e=>({keyNorm:ne(e),url:fe[e]})),[fe]),we=(e,t,n)=>{var a;if(!e)return(0,Y.uq)("/dist/img/logo-club-empty.svg");const i=t?String(t).toLowerCase():"";if(i&&xe[i]&&null!==(a=xe[i])&&void 0!==a&&a.logo_url){const e=String(xe[i].logo_url);return e.startsWith("/")?(0,Y.uq)(e):e}try{const t=ne(e);let n=ge[t];if(!n)for(const[e,a]of Object.entries(ge))if(e&&(t.endsWith(e)||e.endsWith(t))){n=a;break}if(!n){const t=ne(e).split(" ")[0];if(t&&t.length>=5)for(const[e,a]of Object.entries(ge)){if(String(e).split(" ")[0]===t){n=a;break}}}if(n&&n.logo_url){const e=String(n.logo_url);return e.startsWith("/")?(0,Y.uq)(e):e}}catch(r){}let o=fe[e];if(!o){const t=ne(e);o=ke[t]}if(!o){const t=ne(e);for(const{keyNorm:e,url:n}of _e)if(e&&(t.endsWith(e)||e.endsWith(t))){o=n;break}}return o?"string"===typeof o&&o.startsWith("/")?(0,Y.uq)(o):o:i&&ve[i]?ve[i]:n||"/dist/img/logo-club-empty.svg"},ze=(e,t)=>{var n;const a=t?String(t).toLowerCase():"";if(a&&xe[a]&&null!==(n=xe[a])&&void 0!==n&&n.name)return String(xe[a].name||"").trim()||String(e||"");try{if(e){const t=ne(e);let n=ge[t];if(!n)for(const[e,a]of Object.entries(ge))if(e&&(t.endsWith(e)||e.endsWith(t))){n=a;break}if(!n){const e=t.split(" ")[0];if(e&&e.length>=5)for(const[t,a]of Object.entries(ge)){if(String(t).split(" ")[0]===e){n=a;break}}}if(n&&n.name)return n.name}}catch(i){}return String(e||"")},[Se,Ae]=(0,Q.useState)("table"),[Ce,Ee]=(0,Q.useState)(0),[Te,De]=(0,Q.useState)(""),[Ne,Re]=(0,Q.useState)("");(0,Q.useEffect)(()=>{const e=setTimeout(()=>Re(Te),250);return()=>clearTimeout(e)},[Te]);const Fe=(0,Q.useMemo)(()=>{const e={};for(const n of re){var t;const a=(null===n||void 0===n||null===(t=n.table)||void 0===t?void 0:t.overall)||[];for(const t of a){const n=(t.team||"").trim();let a=t.team_id||ae(t.team_logo_url);if(a&&(a=String(a).toLowerCase()),!a&&se){const e=ne(n);(e===le||e.endsWith(" "+le)||e.startsWith(le+" ")||e.includes(" "+le+" "))&&(a=se)}const i=ze(n,a);if(!i)continue;const o=a?"id:".concat(a):ne(i),r=we(i,a,t.team_logo_url);if(e[o]){e[o].variants.push(n),e[o].variants.push(i);const t=!e[o].logo||/logo-club-empty\.svg$/.test(String(e[o].logo)),s=r&&!/logo-club-empty\.svg$/.test(String(r));t&&s&&(e[o].logo=r),!e[o].teamId&&a&&(e[o].teamId=a)}else e[o]={key:o,name:i,logo:r,variants:[n,i],teamId:a}}}return Object.values(e).sort((e,t)=>e.name.localeCompare(t.name,"cs",{sensitivity:"base"}))},[re,we,le,se]),Pe=(0,Q.useMemo)(()=>{const e={};for(const t of Fe)e[t.key]=Array.from(new Set(t.variants));return e},[Fe]),[Ie,Me]=(0,Q.useState)(!1),[Le,We]=(0,Q.useState)(null),[Ue,Oe]=(0,Q.useState)({external_team_id:"",team_name:"",logo_url:""}),qe=(0,Q.useRef)(null),[Ke,Be]=(0,Q.useState)(null),[Ze,Ve]=(0,Q.useState)("idle"),[He,$e]=(0,Q.useState)(null),Je=(0,Q.useMemo)(()=>{try{if(Ke)return!0;const e=(Ue.logo_url||"").trim();if(!e)return!1;const t=e.startsWith("/")?new URL(e,ce).toString():e,n=new URL(t),a=n.hostname.toLowerCase(),i=n.pathname,o=new URL(ce).hostname.toLowerCase(),r=a.endsWith("fotbal.cz")||"is1.fotbal.cz"===a,s="logoapi.sportcreative.eu"===a,l=a===o&&i.startsWith("/uploads/");return!r&&!s&&l}catch(e){return!1}},[Ke,Ue.logo_url,ce]),[Ge,Xe]=(0,Q.useState)(""),[Ye,Qe]=(0,Q.useState)("");(0,Q.useEffect)(()=>{const e=setTimeout(()=>Qe(Ge),300);return()=>clearTimeout(e)},[Ge]);const{data:et=[]}=(0,V.I)({queryKey:["club-search",Ye],queryFn:()=>(0,G.Qm)(Ye),enabled:Ye.trim().length>=2}),tt=(e,t,n,a)=>{let i=n;if(!i||0===i.length){const t=ne(e||"");i=Pe[t]||[]}We({teamName:e,teamLogoUrl:t,variantNames:i}),Oe({external_team_id:a||"",team_name:e||"",logo_url:t||""}),Xe(e||""),Me(!0)},nt=(0,$.n)({mutationFn:async()=>{let e=(Ue.external_team_id||"").trim();if(!e){let t;try{t=ae(Ue.logo_url)}catch(a){}if(!t&&null!==Le&&void 0!==Le&&Le.teamLogoUrl)try{t=ae(Le.teamLogoUrl)}catch(o){}if(!t){const e=(Ue.team_name||(null===Le||void 0===Le?void 0:Le.teamName)||"").trim();if(e)try{const n=await(0,G.Qm)(e),a=e=>ne(e),i=n.find(t=>a(t.name)===a(e))||n[0];null!==i&&void 0!==i&&i.id&&(t=String(i.id))}catch(r){}}t&&(e=t)}if(!e)throw new Error("Vyberte t\xfdm ze seznamu vyhled\xe1v\xe1n\xed (chyb\xed ID).");let t=(Ue.logo_url||"").trim();const n=(Ue.team_name||(null===Le||void 0===Le?void 0:Le.teamName)||"").trim();Array.from(new Set([n,...(null===Le||void 0===Le?void 0:Le.variantNames)||[]])).map(e=>e.trim()).filter(Boolean);try{if(!Ke&&e){const a=await(0,i.JG)(e,n);a&&(t=a)}}catch(s){}if(t){let a=!1,o=Boolean(Ke);try{const e=t.startsWith("/")?new URL(t,ce).toString():t,n=new URL(e),a=n.hostname.toLowerCase(),i=n.pathname,r=new URL(ce).hostname.toLowerCase(),s=a.endsWith("fotbal.cz")||"is1.fotbal.cz"===a,l="logoapi.sportcreative.eu"===a,c=a===r&&i.startsWith("/uploads/");o||(o=c),(s||l)&&(o=!1)}catch(l){}if(o){a=!0,Ve("uploading"),$e(null);try{let a=Ke;if(!a&&t&&(a=await(0,G.dt)(t)),a){const o=await(0,G.FR)(e,a,{filename:"".concat(e,".").concat(a instanceof File?a.name.split(".").pop():"png"),clubName:Ue.team_name||(null===Le||void 0===Le?void 0:Le.teamName)||"Nezn\xe1m\xfd klub"});if(o.success){Ve("success"),o.url&&(t=o.url);try{let a=null;for(let t=0;t<10&&(a=await(0,i.JG)(e,n),!a);t++)await new Promise(e=>setTimeout(e,700));a&&(t=a)}catch(c){}}else Ve("error"),$e(o.error||"Nepoda\u0159ilo se nahr\xe1t logo")}else Ve("error"),$e("Could not fetch logo file")}catch(oe){Ve("error"),$e((null===oe||void 0===oe?void 0:oe.message)||"Upload failed")}}if(a)try{const e=t.startsWith("/")?new URL(t,ce).toString():t;if("logoapi.sportcreative.eu"!==new URL(e).hostname.toLowerCase())throw new Error("Extern\xed upload loga je\u0161t\u011b nen\xed dostupn\xfd. Zkuste ulo\u017eit znovu za chv\xedli.")}catch(d){throw new Error((null===d||void 0===d?void 0:d.message)||"Extern\xed upload loga selhal")}}return await(0,G.aS)(e,n,t),!0},onSuccess:()=>{let n="Zm\u011bna byla aplikov\xe1na na v\u0161echny duplicitn\xed varianty.";"success"===Ze?n+=" Logo bylo \xfasp\u011b\u0161n\u011b nahr\xe1no.":"error"===Ze&&(n+=" \u26a0\ufe0f ".concat(He||"Nepoda\u0159ilo se nahr\xe1t logo")),e({title:"Ulo\u017eeno",description:n,status:"error"===Ze?"warning":"success",duration:6e3,isClosable:!0}),Me(!1),We(null),Be(null),Ve("idle"),$e(null),t.invalidateQueries({queryKey:["facr-tables-cache"]}),t.invalidateQueries({queryKey:["teamLogoOverrides"]})},onError:t=>{e({title:"Ulo\u017een\xed selhalo",description:(null===t||void 0===t?void 0:t.message)||"Zkuste to znovu",status:"error"})}});return(0,te.jsx)(J.A,{requireAdmin:!1,children:(0,te.jsxs)(l.a,{children:[(0,te.jsx)(C.z,{justify:"space-between",mb:4,children:(0,te.jsx)(B.D,{size:"lg",children:"Spr\xe1va t\xfdm\u016f"})}),(0,te.jsx)(Z.E,{color:"gray.500",mb:4,fontSize:"sm",children:"P\u0159ehled tabulek z FA\u010cR. Kompaktn\xed zobrazen\xed s rychl\xfdm p\u0159ep\xedn\xe1n\xedm sout\u011b\u017e\xed."}),(0,te.jsxs)(h.s,{mb:4,gap:3,align:"center",wrap:"wrap",children:[(0,te.jsxs)(d.e,{isAttached:!0,size:"sm",variant:"outline",children:[(0,te.jsx)(c.$,{colorScheme:"table"===Se?"blue":"gray",variant:"table"===Se?"solid":"outline",onClick:()=>Ae("table"),size:"sm",children:"Tabulky"}),(0,te.jsx)(c.$,{colorScheme:"grid"===Se?"blue":"gray",variant:"grid"===Se?"solid":"outline",onClick:()=>Ae("grid"),size:"sm",children:"M\u0159\xed\u017eka"})]}),(0,te.jsxs)(j.M,{maxW:{base:"100%",md:"300px"},size:"sm",children:[(0,te.jsx)(v.p,{placeholder:"Filtrovat podle n\xe1zvu t\xfdmu\u2026",value:Te,onChange:e=>De(e.target.value)}),Te&&(0,te.jsx)(b.t,{width:"3rem",children:(0,te.jsx)(c.$,{size:"xs",variant:"ghost",onClick:()=>De(""),children:"Vymazat"})})]}),be&&(0,te.jsx)(s.E,{colorScheme:"blue",fontSize:"xs",children:(0,te.jsxs)(C.z,{spacing:1,children:[(0,te.jsx)(A.y,{size:"xs"}),(0,te.jsx)(Z.E,{children:"Na\u010d\xedt\xe1m loga z logoapi.sportcreative.eu..."})]})}),!be&&Object.keys(ve).length>0&&(0,te.jsxs)(s.E,{colorScheme:"green",fontSize:"xs",children:["\u2713 ",Object.keys(ve).length," log z logoapi.sportcreative.eu"]}),Object.keys(ve).length>0&&(0,te.jsxs)(s.E,{colorScheme:"blue",fontSize:"xs",children:["\ud83d\udcca ",(0,i.i)().totalRequests,"/min po\u017eadavk\u016f"]})]}),ie&&(0,te.jsxs)(E.T,{align:"start",spacing:3,mb:6,children:[(0,te.jsx)(A.y,{}),(0,te.jsx)(Z.E,{children:"Na\u010d\xedt\xe1m tabulky\u2026"})]}),Boolean(oe)&&(0,te.jsxs)(o.F,{status:"error",variant:"left-accent",mb:4,children:[(0,te.jsx)(r._,{}),"Nepoda\u0159ilo se na\u010d\xedst data z cache."]}),!ie&&!oe&&"table"===Se&&(0,te.jsx)(l.a,{children:(0,te.jsxs)(U.t,{index:Ce,onChange:Ee,variant:"soft-rounded",colorScheme:"blue",size:"sm",children:[(0,te.jsx)(M.w,{mb:4,overflowX:"auto",overflowY:"hidden",flexWrap:"nowrap",pb:2,children:re.map((e,t)=>(0,te.jsx)(I.o,{fontSize:"xs",px:3,py:1.5,minW:"fit-content",whiteSpace:"nowrap",children:e.name},e.id))}),(0,te.jsx)(W.T,{children:re.map(e=>{var t;const n=(null===e||void 0===e||null===(t=e.table)||void 0===t?void 0:t.overall)||[],a=ne(Ne),i=a?n.filter(e=>ne(e.team||"").includes(a)):n;return(0,te.jsx)(L.K,{p:0,children:(0,te.jsx)(l.a,{overflowX:"auto",borderWidth:"1px",borderRadius:"md",w:"full",sx:{WebkitOverflowScrolling:"touch"},children:(0,te.jsxs)(T.X,{size:"sm",variant:"simple",children:[(0,te.jsx)(F.d,{bg:de,children:(0,te.jsxs)(P.Tr,{children:[(0,te.jsx)(R.Th,{w:"40px",fontSize:"xs",py:2,children:"#"}),(0,te.jsx)(R.Th,{fontSize:"xs",py:2,children:"T\xfdm"}),(0,te.jsx)(R.Th,{isNumeric:!0,w:"45px",fontSize:"xs",py:2,children:"Z"}),(0,te.jsx)(R.Th,{isNumeric:!0,w:"45px",fontSize:"xs",py:2,children:"V"}),(0,te.jsx)(R.Th,{isNumeric:!0,w:"45px",fontSize:"xs",py:2,children:"R"}),(0,te.jsx)(R.Th,{isNumeric:!0,w:"45px",fontSize:"xs",py:2,children:"P"}),(0,te.jsx)(R.Th,{isNumeric:!0,w:"70px",fontSize:"xs",py:2,children:"Sk\xf3re"}),(0,te.jsx)(R.Th,{isNumeric:!0,w:"50px",fontSize:"xs",py:2,children:"Body"}),(0,te.jsx)(R.Th,{w:"90px",fontSize:"xs",py:2,children:"Akce"})]})}),(0,te.jsxs)(D.N,{children:[i.map((t,n)=>(0,te.jsxs)(P.Tr,{_hover:{bg:ue},children:[(0,te.jsx)(N.Td,{py:1.5,fontSize:"xs",children:t.rank}),(0,te.jsx)(N.Td,{py:1.5,children:(0,te.jsxs)(C.z,{spacing:2,align:"center",children:[(0,te.jsx)(g._,{src:we(t.team,t.team_id||ae(t.team_logo_url),t.team_logo_url),alt:ze(t.team,t.team_id||ae(t.team_logo_url)),boxSize:"24px",objectFit:"contain"}),(0,te.jsx)(Z.E,{fontSize:"xs",noOfLines:1,children:ze(t.team,t.team_id||ae(t.team_logo_url))})]})}),(0,te.jsx)(N.Td,{isNumeric:!0,py:1.5,fontSize:"xs",children:t.played}),(0,te.jsx)(N.Td,{isNumeric:!0,py:1.5,fontSize:"xs",children:t.wins}),(0,te.jsx)(N.Td,{isNumeric:!0,py:1.5,fontSize:"xs",children:t.draws}),(0,te.jsx)(N.Td,{isNumeric:!0,py:1.5,fontSize:"xs",children:t.losses}),(0,te.jsx)(N.Td,{isNumeric:!0,py:1.5,fontSize:"xs",children:t.score}),(0,te.jsx)(N.Td,{isNumeric:!0,py:1.5,fontSize:"xs",fontWeight:"bold",children:t.points}),(0,te.jsx)(N.Td,{py:1.5,children:(0,te.jsx)(c.$,{size:"xs",fontSize:"xs",onClick:()=>{const e=t.team_id||ae(t.team_logo_url),n=e?String(e).toLowerCase():void 0,a=ze(t.team,n),i=n?"id:".concat(n):ne(a);tt(a||"",we(t.team,n,t.team_logo_url),Pe[i],n)},children:"Upravit"})})]},"".concat(e.id,"-").concat(n))),0===i.length&&(0,te.jsx)(P.Tr,{children:(0,te.jsx)(N.Td,{colSpan:9,py:4,children:(0,te.jsx)(Z.E,{color:"gray.500",fontSize:"sm",textAlign:"center",children:"\u017d\xe1dn\xfd t\xfdm neodpov\xedd\xe1 filtru."})})})]})]})})},e.id)})})]})}),!ie&&!oe&&"grid"===Se&&(0,te.jsx)(l.a,{children:(()=>{const e=ne(Ne),t=e?Fe.filter(t=>ne(t.name).includes(e)||(t.variants||[]).some(t=>ne(t).includes(e))):Fe;return(0,te.jsxs)(x.r,{columns:{base:2,sm:3,md:4,lg:6},spacing:3,children:[t.map(e=>(0,te.jsx)(l.a,{borderWidth:"1px",borderRadius:"md",p:2.5,_hover:{boxShadow:"md",borderColor:"blue.300"},transition:"all 0.2s",children:(0,te.jsxs)(E.T,{align:"stretch",spacing:2,children:[(0,te.jsxs)(C.z,{justify:"space-between",align:"start",children:[(0,te.jsxs)(C.z,{spacing:2,flex:1,minW:0,children:[(0,te.jsx)(g._,{src:e.logo,alt:e.name,boxSize:"24px",objectFit:"contain",flexShrink:0}),(0,te.jsx)(Z.E,{fontSize:"xs",noOfLines:2,fontWeight:"medium",children:e.name})]}),e.variants.length>1&&(0,te.jsx)(K.m,{label:"Varianty: ".concat(Array.from(new Set(e.variants)).join(", ")),hasArrow:!0,children:(0,te.jsx)(O.vw,{size:"sm",colorScheme:"purple",variant:"subtle",fontSize:"xs",children:(0,te.jsx)(O.d1,{children:e.variants.length})})})]}),(0,te.jsx)(c.$,{size:"xs",fontSize:"xs",onClick:()=>tt(e.name,e.logo,e.variants,e.teamId),w:"full",children:"Upravit"})]})},e.key)),0===t.length&&(0,te.jsx)(l.a,{gridColumn:{base:"span 2",sm:"span 3",md:"span 4",lg:"span 6"},children:(0,te.jsx)(Z.E,{color:"gray.500",fontSize:"sm",textAlign:"center",py:8,children:"\u017d\xe1dn\xfd t\xfdm neodpov\xedd\xe1 filtru."})})]})})()}),(0,te.jsxs)(z._s,{isOpen:Ie,placement:"right",onClose:()=>{Me(!1),We(null)},size:"md",children:[(0,te.jsx)(w.m,{}),(0,te.jsxs)(S.z,{children:[(0,te.jsx)(_.r,{children:"Upravit logo t\xfdmu"}),(0,te.jsx)(f.c,{children:(0,te.jsxs)(E.T,{align:"stretch",spacing:4,children:[(0,te.jsxs)(m.MJ,{children:[(0,te.jsx)(p.l,{children:"Hledat t\xfdm (FA\u010cR)"}),(0,te.jsxs)(j.M,{children:[(0,te.jsx)(v.p,{value:Ge,onChange:e=>{Xe(e.target.value)},placeholder:"Zadejte n\xe1zev t\xfdmu"}),(0,te.jsx)(b.t,{width:"8rem",children:(0,te.jsx)(c.$,{size:"xs",onClick:()=>{var e;return null===(e=qe.current)||void 0===e?void 0:e.click()},children:"Nahr\xe1t logo"})})]}),et.length>0&&(0,te.jsx)(l.a,{mt:4,bg:he,borderWidth:"1px",borderRadius:"lg",overflowX:"auto",boxShadow:"sm",mb:6,children:(0,te.jsx)(y.B8,{spacing:0,children:et.map(e=>(0,te.jsx)(y.ck,{px:3,py:2,_hover:{bg:"gray.50",cursor:"pointer"},onClick:async()=>{Oe(t=>(0,a.A)((0,a.A)({},t),{},{external_team_id:e.id,team_name:e.name,logo_url:e.logo_url||t.logo_url})),Xe(e.name);try{const t=await(0,i.JG)(e.id,e.name);t&&Oe(e=>(0,a.A)((0,a.A)({},e),{},{logo_url:t}))}catch(t){}},children:(0,te.jsxs)(C.z,{justify:"space-between",spacing:3,children:[(0,te.jsxs)(C.z,{spacing:3,maxW:"80%",children:[e.logo_url?(0,te.jsx)(g._,{src:e.logo_url,alt:e.name,boxSize:"20px",objectFit:"contain"}):(0,te.jsx)(s.E,{colorScheme:"gray",children:"bez loga"}),(0,te.jsx)(Z.E,{noOfLines:1,children:e.name})]}),e.logo_url&&(0,te.jsx)(s.E,{colorScheme:"green",children:"logo"})]})},e.id))})}),(0,te.jsx)("input",{ref:qe,type:"file",accept:"image/png,image/svg+xml,image/jpeg,application/pdf",style:{display:"none"},onChange:async t=>{var n;const i=null===(n=t.target.files)||void 0===n?void 0:n[0];if(i)try{const{url:t}=await(0,G.V6)(i);Oe(e=>(0,a.A)((0,a.A)({},e),{},{logo_url:t})),Be(i),e({title:"Logo nahr\xe1no",status:"success"})}catch(o){e({title:"Nahr\xe1v\xe1n\xed selhalo",description:(null===o||void 0===o?void 0:o.message)||"Zkuste to znovu",status:"error"})}finally{qe.current&&(qe.current.value="")}}})]}),(0,te.jsxs)(m.MJ,{children:[(0,te.jsx)(p.l,{children:"N\xe1zev t\xfdmu"}),(0,te.jsx)(v.p,{value:Ue.team_name,onChange:e=>Oe((0,a.A)((0,a.A)({},Ue),{},{team_name:e.target.value}))})]}),(0,te.jsxs)(m.MJ,{children:[(0,te.jsx)(p.l,{children:"Logo URL"}),(0,te.jsx)(v.p,{value:Ue.logo_url,onChange:e=>Oe((0,a.A)((0,a.A)({},Ue),{},{logo_url:e.target.value}))})]}),(null===Le||void 0===Le?void 0:Le.variantNames)&&Le.variantNames.length>1&&(0,te.jsxs)(o.F,{status:"info",children:[(0,te.jsx)(r._,{}),"Uprav\xedte tak\xe9 duplicitn\xed n\xe1zvy: ",Array.from(new Set(Le.variantNames)).join(", ")]}),Je&&(0,te.jsxs)(o.F,{status:"info",variant:"left-accent",children:[(0,te.jsx)(r._,{}),(0,te.jsxs)(E.T,{align:"start",spacing:1,children:[(0,te.jsx)(Z.E,{fontSize:"sm",fontWeight:"medium",children:"Logo bude automaticky nahr\xe1no na logoapi.sportcreative.eu"}),(0,te.jsx)(Z.E,{fontSize:"xs",color:"gray.600",children:"Toto poskytuje z\xe1lohu a sd\xedlen\xed log mezi aplikacemi."})]})]})]})}),(0,te.jsx)(k.j,{children:(0,te.jsxs)(C.z,{children:[(0,te.jsx)(c.$,{variant:"outline",onClick:()=>{Me(!1),We(null)},children:"Zru\u0161it"}),(0,te.jsx)(c.$,{colorScheme:"blue",isLoading:nt.isPending,onClick:()=>nt.mutate(),children:"Ulo\u017eit"})]})})]})]})]})})}},7296:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ue});var a=n(89379),i=n(65043),o=n(96870),r=n(87139),s=n(22107),l=n(98662),c=n(42703),d=n(34946),u=n(44093),h=n(5371),m=n(73225),p=n(76668),x=n(35699),g=n(45973),v=n(29244),j=n(6773),b=n(67516),y=n(35929),f=n(56529),k=n(15071),_=n(11054),w=n(78460),z=n(85421),S=n(61724),A=n(76659),C=n(96148),E=n(10202),T=n(98481),D=n(80511),N=n(82595),R=n(67813),F=n(83201),P=n(3313),I=n(55395),M=n(14566),L=n(31411),W=n(10227),U=n(51794),O=n(3109),q=n(19077),K=n(30502),B=n(99956),Z=n(28846),V=n(39081),H=n(12733),$=n(12730),J=n(58584),G=n(92835),X=n(72526),Y=n(59781),Q=n(12836),ee=n(69023),te=n(6175),ne=n(6583),ae=n(57550),ie=n(40384),oe=n(3200),re=n(74770),se=n(2367),le=n(72898),ce=n(35200),de=n(70579);function ue(){var e,t,ue,he,me,pe;const xe=(0,u.dU)("white","gray.800"),ge=((0,u.dU)("gray.200","gray.700"),(0,u.dU)("white","gray.700"),(0,u.dU)("gray.600","gray.400")),ve=(0,u.dU)("gray.50","gray.700"),[je,be]=(0,i.useState)(""),[ye,fe]=(0,i.useState)([]),[ke,_e]=(0,i.useState)({subject:"",content:""}),[we,ze]=(0,i.useState)(""),[Se,Ae]=(0,i.useState)(""),[Ce,Ee]=(0,i.useState)(""),[Te,De]=(0,i.useState)(""),[Ne,Re]=(0,i.useState)(""),[Fe,Pe]=(0,i.useState)(""),[Ie,Me]=(0,i.useState)(!0),[Le,We]=(0,i.useState)("SMTP Test"),[Ue,Oe]=(0,i.useState)("<p>Toto je testovac\xed e\u2011mail (admin SMTP debug).</p>"),[qe,Ke]=(0,i.useState)(!1),Be=(0,Q.n)({mutationFn:async()=>{const e={host:we.trim(),port:"number"===typeof Se?Se:0,username:Ce||void 0,password:Te||void 0,from:Ne.trim(),to:Fe.trim(),subject:Le||void 0,body:Ue||void 0,use_tls:Ie};return(0,oe.adminSendSmtpTest)(e)},onSuccess:e=>{null!==e&&void 0!==e&&e.ok?Gt({title:"SMTP test \xfasp\u011b\u0161n\xfd",description:(null===e||void 0===e?void 0:e.message)||"Test email sent",status:"success"}):Gt({title:"SMTP test selhal",description:(null===e||void 0===e?void 0:e.error)||"Chyba p\u0159i odesl\xe1n\xed testu",status:"error"})},onError:e=>{var t,n;Gt({title:"Chyba po\u017eadavku",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e?void 0:e.message),status:"error"})}}),[Ze,Ve]=(0,i.useState)(""),[He,$e]=(0,i.useState)(""),[Je,Ge]=(0,i.useState)("newsletter"),[Xe,Ye]=(0,i.useState)(!1),[Qe,et]=(0,i.useState)(null),[tt,nt]=(0,i.useState)({}),[at,it]=(0,i.useState)("custom"),[ot,rt]=(0,i.useState)(""),[st,lt]=(0,i.useState)(""),[ct,dt]=(0,i.useState)(""),[ut,ht]=(0,i.useState)(!1),mt={weekly:"T\xfddenn\xed p\u0159ehled",matches:"Z\xe1pasy",scores:"V\xfdsledky",blogs:"Novinky",events:"Akce"},[pt,xt]=(0,i.useState)(!1),[gt,vt]=(0,i.useState)(null),[jt,bt]=(0,i.useState)({}),[yt,ft]=(0,i.useState)(""),[kt,_t]=(0,i.useState)(!1),[wt,zt]=(0,i.useState)(!1),[St,At]=(0,i.useState)(""),[Ct,Et]=(0,i.useState)(""),[Tt,Dt]=(0,i.useState)({weekly:!0,matches:!0,scores:!0,blogs:!0,events:!0}),[Nt,Rt]=(0,i.useState)(null),[Ft,Pt]=(0,i.useState)(!1),It=()=>{xt(!1),vt(null),ft("")},Mt=i.useMemo(()=>new Set((ot||"").split(",").map(e=>e.trim()).filter(Boolean)),[ot]),Lt=i.useMemo(()=>new Set((yt||"").split(",").map(e=>e.trim()).filter(Boolean)),[yt]),{data:Wt=[],isLoading:Ut}=(0,X.I)({queryKey:["admin","newsletter-subscribers"],queryFn:oe.getNewsletterSubscribers}),Ot=e=>{const t="weekly"===e?"weekly":e;return Wt.filter(e=>e.is_active&&(null===e||void 0===e?void 0:e.preferences)&&!0===e.preferences[t]).map(e=>e.email)},qt=(e,t)=>{const n=((e,t)=>{const n="weekly"===e?"weekly":e,a=Wt.filter(e=>(null===e||void 0===e?void 0:e.is_active)&&(null===e||void 0===e?void 0:e.preferences)&&!0===e.preferences[n]);if(!t||!t.trim()||"matches"!==e&&"scores"!==e)return a.map(e=>e.email);const i=t.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean);return a.filter(e=>{const t=(null===e||void 0===e?void 0:e.preferences)||{},n=("string"===typeof t.competitions&&t.competitions?t.competitions:"string"===typeof t.categories?t.categories:"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean);return 0===n.length||n.some(e=>i.includes(e))}).map(e=>e.email)})(e,t),a=e=>{const t=String(null!==e&&void 0!==e?e:"");return/^[=+\-@]/.test(t)?"'".concat(t):t},i=[["email","type","competitions"].join(","),...n.map(n=>[a(n),e,(t||"").trim()].join(","))],o=new Blob(["\ufeff"+i.join("\n")],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(o),s=document.createElement("a");s.href=r,s.download="newsletter_recipients_".concat(e,".csv"),s.click(),URL.revokeObjectURL(r)},Kt=async(e,t)=>{const n={};"weekly"===e?(n.blogs=!0,n.events=!0,n.matches=!0,n.scores=!0):n[e]=!0,t&&t.trim()&&(n.competitions=t.trim());const i=await(0,oe.previewNewsletter)({preferences:n});bt(t=>(0,a.A)((0,a.A)({},t),{},{[e]:{subject:i.subject,html:i.html}}))};(0,i.useEffect)(()=>{pt&&gt&&!jt[gt]&&(async()=>{try{_t(!0),await Kt(gt,yt)}finally{_t(!1)}})()},[pt,gt]),(0,i.useEffect)(()=>{const e=["weekly","matches","scores","blogs","events"];(async()=>{for(const n of e)try{Ot(n).length>0&&!jt[n]&&await Kt(n)}catch(t){}})()},[Wt]);const{isOpen:Bt,onOpen:Zt,onClose:Vt}=(0,o.j)(),Ht=(0,o.j)(),$t=(0,o.j)(),Jt=(0,o.j)(),Gt=(0,K.d)(),Xt=(0,Y.jE)(),{data:Yt}=((0,j.A)({base:!0,md:!1}),(0,ae.s)()),Qt=null===Yt||void 0===Yt?void 0:Yt.club_id,en=(null===Yt||void 0===Yt?void 0:Yt.club_type)||"football",{data:tn=[]}=(0,X.I)({queryKey:["facr","competitions",Qt,en],queryFn:async()=>{if(!Qt)return[];return await ie.J.getClubCompetitions(Qt,en)||[]},enabled:!!Qt}),nn=tn.map(e=>({code:String((null===e||void 0===e?void 0:e.code)||(null===e||void 0===e?void 0:e.id)||""),name:String((null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.code)||(null===e||void 0===e?void 0:e.id)||"")})).filter(e=>e.code),an=(0,X.I)({queryKey:["admin","settings"],queryFn:re.rC}),on=an.data,[rn,sn]=(0,i.useState)(!(null===on||void 0===on||!on.enable_weekly)),[ln,cn]=(0,i.useState)(!(null===on||void 0===on||!on.enable_match_reminders)),[dn,un]=(0,i.useState)(!(null===on||void 0===on||!on.enable_results)),[hn,mn]=(0,i.useState)((null===on||void 0===on?void 0:on.newsletter_weekly_day)||"sun"),pn=e=>String("number"===typeof e?Math.max(0,Math.min(23,e)):18).padStart(2,"0")+":00",[xn,gn]=(0,i.useState)(pn(null===on||void 0===on?void 0:on.newsletter_weekly_hour)),[vn,jn]=(0,i.useState)("number"===typeof(null===on||void 0===on?void 0:on.newsletter_reminder_lead_hours)?on.newsletter_reminder_lead_hours:48),[bn,yn]=(0,i.useState)(pn(null===on||void 0===on?void 0:on.newsletter_quiet_start)),[fn,kn]=(0,i.useState)(pn(null===on||void 0===on?void 0:on.newsletter_quiet_end));(0,i.useEffect)(()=>{on&&(sn(!!on.enable_weekly),cn(!!on.enable_match_reminders),un(!!on.enable_results),mn(on.newsletter_weekly_day||"sun"),gn(pn("number"===typeof on.newsletter_weekly_hour?on.newsletter_weekly_hour:18)),jn("number"===typeof on.newsletter_reminder_lead_hours?on.newsletter_reminder_lead_hours:48),yn(pn("number"===typeof on.newsletter_quiet_start?on.newsletter_quiet_start:22)),kn(pn("number"===typeof on.newsletter_quiet_end?on.newsletter_quiet_end:7)))},[on]);const _n=e=>{const t=/^\s*(\d{1,2})(?::(\d{1,2}))?/.exec(e||""),n=t?parseInt(t[1],10):18;return Math.max(0,Math.min(23,isNaN(n)?18:n))},wn=(0,Q.n)({mutationFn:()=>(0,re.CX)({enable_weekly:rn,enable_match_reminders:ln,enable_results:dn,newsletter_weekly_day:hn,newsletter_weekly_hour:_n(xn),newsletter_reminder_lead_hours:vn,newsletter_quiet_start:_n(bn),newsletter_quiet_end:_n(fn)}),onSuccess:()=>{Xt.invalidateQueries({queryKey:["admin","settings"]}),Gt({title:"Nastaven\xed rozes\xedlek ulo\u017eeno",status:"success"})},onError:e=>{var t,n;Gt({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e?void 0:e.message),status:"error"})}}),zn=e=>{try{const t=e.replace(/<\s*(script|style|iframe)[^>]*>[\s\S]*?<\s*\/\s*\1\s*>/gi,"").replace(/ on[a-zA-Z]+\s*=\s*"[^"]*"/g,"").replace(/ on[a-zA-Z]+\s*=\s*'[^']*'/g,"").replace(/ on[a-zA-Z]+\s*=\s*[^\s>]+/g,"");return t.replace(/(href|src)\s*=\s*(["'])\s*(javascript:|data:)/gi,"$1=$2#")}catch(t){return""}},Sn=Wt.filter(e=>e.email.toLowerCase().includes(je.toLowerCase())),An=(0,Q.n)({mutationFn:e=>{let{id:t,isActive:n}=e;return(0,oe.toggleSubscriberStatus)(t,n)},onSuccess:()=>{Xt.invalidateQueries({queryKey:["admin","newsletter-subscribers"]}),Gt({title:"Stav odb\u011bratele byl aktualizov\xe1n",status:"success",duration:3e3,isClosable:!0})}}),Cn=(0,Q.n)({mutationFn:oe.deleteSubscriber,onSuccess:()=>{Xt.invalidateQueries({queryKey:["admin","newsletter-subscribers"]}),fe([]),Gt({title:"Odb\u011bratel byl smaz\xe1n",status:"success",duration:3e3,isClosable:!0})}}),En=(0,Q.n)({mutationFn:e=>{let{id:t,prefs:a}=e;return Promise.resolve().then(n.bind(n,3200)).then(e=>e.updateSubscriberPreferences(t,a))},onSuccess:()=>{Xt.invalidateQueries({queryKey:["admin","newsletter-subscribers"]}),Ye(!1),Gt({title:"Preference ulo\u017eeny",status:"success"})},onError:e=>{var t,n;Gt({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed preferenc\xed",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e?void 0:e.message),status:"error"})}}),Tn=(0,Q.n)({mutationFn:oe.sendNewsletter,onSuccess:()=>{Vt(),_e({subject:"",content:""}),Gt({title:"Newsletter byl odesl\xe1n",status:"success",duration:5e3,isClosable:!0})},onError:e=>{var t,n,a,i;Gt({title:"Chyba p\u0159i odes\xedl\xe1n\xed newsletteru",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message)||(null===e||void 0===e?void 0:e.message)||"Do\u0161lo k chyb\u011b",status:"error",duration:5e3,isClosable:!0})}}),Dn=(0,Q.n)({mutationFn:()=>{const e=He.split(",").map(e=>e.trim()).filter(Boolean);return e.length>0?(0,oe.sendNewsletterTestAdvanced)({emails:e,type:Je}):Ze?(0,oe.sendNewsletterTestAdvanced)({email:Ze,type:Je}):(0,oe.sendNewsletterTestAdvanced)({type:Je})},onSuccess:e=>{Gt({title:"Test odesl\xe1n",description:null!==e&&void 0!==e&&e.recipients&&e.recipients.length>0?"E-mail byl odesl\xe1n na ".concat(e.recipients.join(", ")):null!==e&&void 0!==e&&e.recipient?"E-mail byl odesl\xe1n na ".concat(e.recipient):"Testovac\xed e-mail byl odesl\xe1n",status:"success",duration:4e3,isClosable:!0}),Ve(""),$e(""),Ht.onClose()},onError:e=>{var t,n,a,i;Gt({title:"Chyba p\u0159i odes\xedl\xe1n\xed testu",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message)||(null===e||void 0===e?void 0:e.message)||"Do\u0161lo k chyb\u011b",status:"error",duration:5e3,isClosable:!0})}}),Nn=(0,Q.n)({mutationFn:e=>{let{email:t,preferences:n}=e;return(0,oe.createNewsletterSubscriber)(t,n)},onSuccess:()=>{Xt.invalidateQueries({queryKey:["admin","newsletter-subscribers"]}),Gt({title:"Odb\u011bratel byl p\u0159id\xe1n",status:"success",duration:3e3,isClosable:!0}),At(""),Et(""),Rt(null),Dt({weekly:!0,matches:!0,scores:!0,blogs:!0,events:!0}),Jt.onClose()},onError:e=>{var t,n;Gt({title:"Chyba p\u0159i p\u0159id\xe1v\xe1n\xed odb\u011bratele",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e?void 0:e.message)||"Do\u0161lo k chyb\u011b",status:"error",duration:5e3,isClosable:!0})}}),Rn=(0,Q.n)({mutationFn:oe.searchByICO,onSuccess:e=>{Rt(e),e.found&&e.name&&(St.trim()||At(e.name))},onError:e=>{var t,n;Rt(null),Gt({title:"ICO nebylo nalezeno",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e?void 0:e.message)||"Do\u0161lo k chyb\u011b p\u0159i vyhled\xe1v\xe1n\xed",status:"warning",duration:3e3,isClosable:!0})},onSettled:()=>{Pt(!1)}}),Fn=e=>(0,ee.GP)(new Date(e),"d. M. yyyy HH:mm",{locale:te.cs}),{data:Pn}=(0,X.I)({queryKey:["admin","newsletter-status"],queryFn:oe.getNewsletterStatus}),In=(0,Q.n)({mutationFn:e=>(0,oe.setNewsletterAutomation)(e),onSuccess:()=>Xt.invalidateQueries({queryKey:["admin","newsletter-status"]})}),{data:Mn=[],isLoading:Ln}=(0,X.I)({queryKey:["admin","newsletter-stats-recent"],queryFn:oe.getRecentEmailStats}),[Wn,Un]=(0,i.useState)(""),[On,qn]=(0,i.useState)(""),Kn=i.useMemo(()=>Mn&&0!==Mn.length?Mn.filter(e=>{const t=new Date(e.created_at).getTime();if(isNaN(t))return!0;if(Wn){const e=new Date(Wn+"T00:00:00").getTime();if(!isNaN(e)&&t<e)return!1}if(On){const e=new Date(On+"T23:59:59").getTime();if(!isNaN(e)&&t>e)return!1}return!0}):Mn,[Mn,Wn,On]),[Bn,Zn]=(0,i.useState)(!1),[Vn,Hn]=(0,i.useState)(null),$n=(0,X.I)({queryKey:["admin","email-events",null===Vn||void 0===Vn?void 0:Vn.id],queryFn:()=>(0,oe.getEmailEventsForLog)((null===Vn||void 0===Vn?void 0:Vn.id)||0),enabled:!(null===Vn||void 0===Vn||!Vn.id)&&Bn}),[Jn,Gn]=(0,i.useState)({open:!0,click:!0,spam:!0,unsubscribe:!0}),{confirm:Xn}=(($n.data||[]).filter(e=>{var t;return null===(t=Jn[e.event_type])||void 0===t||t}),(0,ce.G)());return(0,de.jsxs)(ne.A,{children:[(0,de.jsxs)(s.a,{p:6,children:[(0,de.jsxs)(h.s,{justify:"space-between",align:"center",mb:6,flexWrap:"wrap",gap:4,children:[(0,de.jsxs)(s.a,{children:[(0,de.jsx)(Z.D,{size:"lg",mb:2,children:"Spr\xe1va newsletteru"}),(0,de.jsx)(V.E,{color:"gray.600",children:"Spravujte odb\u011bratele newsletteru a rozes\xedlejte hromadn\xe9 zpr\xe1vy"})]}),(0,de.jsxs)(C.z,{spacing:3,children:[(0,de.jsx)(l.$,{colorScheme:"green",leftIcon:(0,de.jsx)($.R,{}),onClick:Jt.onOpen,children:"P\u0159idat odb\u011bratele"}),ye.length>0&&(0,de.jsxs)(l.$,{colorScheme:"red",variant:"outline",leftIcon:(0,de.jsx)(J.d,{}),onClick:async()=>{if(0===ye.length)return;await Xn({title:"Smazat vybran\xe9 odb\u011bratele",message:"Opravdu chcete smazat vybran\xe9 odb\u011bratele?",confirmText:"Smazat",cancelText:"Zru\u0161it",isDanger:!0})&&await Promise.all(ye.map(e=>Cn.mutateAsync(e)))},isLoading:Cn.isLoading,children:["Smazat vybran\xe9 (",ye.length,")"]}),(0,de.jsx)(l.$,{variant:"outline",onClick:Ht.onOpen,children:"Odeslat testovac\xed e-mail"}),(0,de.jsx)(l.$,{variant:"outline",onClick:$t.onOpen,children:"Otestovat SMTP"}),(0,de.jsx)(l.$,{colorScheme:"blue",leftIcon:(0,de.jsx)(G.a,{}),onClick:Zt,isDisabled:0===Wt.length,children:"Odeslat newsletter"})]})]}),(0,de.jsxs)(O.t,{colorScheme:"blue",isFitted:!0,children:[(0,de.jsxs)(L.w,{children:[(0,de.jsx)(M.o,{children:"Stav"}),(0,de.jsx)(M.o,{children:"Pl\xe1nov\xe1n\xed"}),(0,de.jsx)(M.o,{children:"Statistika"})]}),(0,de.jsxs)(U.T,{children:[(0,de.jsxs)(W.K,{p:0,children:[(0,de.jsxs)(s.a,{bg:xe,borderRadius:"lg",boxShadow:"sm",p:4,mb:6,children:[(0,de.jsxs)(C.z,{justify:"space-between",align:"center",mb:3,children:[(0,de.jsx)(Z.D,{size:"md",children:"Stav rozes\xedlek"}),(0,de.jsx)(se.tX,{label:"Jak funguje automatika",title:"Stav rozes\xedlek a automatick\xe9 odes\xedl\xe1n\xed",items:["Zobrazuje, kolik odb\u011bratel\u016f m\xe1 newsletter aktivn\xed a jak \u010dasto b\u011b\u017e\xed automatick\xe1 \xfaloha.","P\u0159ep\xedna\u010d \u201eAutomatick\xe9 rozes\xedlky\u201c zap\xedn\xe1/vyp\xedn\xe1 celou automatiku \u2013 harmonogram v z\xe1lo\u017ece Pl\xe1nov\xe1n\xed mus\xed b\xfdt tak\xe9 nastaven.","Dal\u0161\xed b\u011bh a p\u0159\xedklady p\u0159\xedjemc\u016f v\xe1m pomohou ov\u011b\u0159it, \u017ee se e\u2011maily budou pos\xedlat spr\xe1vn\xe9 skupin\u011b lid\xed."]})]}),(0,de.jsxs)(C.z,{spacing:6,wrap:"wrap",children:[(0,de.jsxs)(V.E,{children:[(0,de.jsx)("b",{children:"Odb\u011bratel\u016f:"})," ",null!==(e=null===Pn||void 0===Pn?void 0:Pn.total_subscribers)&&void 0!==e?e:"\u2014"]}),(0,de.jsxs)(V.E,{children:[(0,de.jsx)("b",{children:"Aktivn\xedch:"})," ",null!==(t=null===Pn||void 0===Pn?void 0:Pn.active_subscribers)&&void 0!==t?t:"\u2014"]}),(0,de.jsxs)(V.E,{children:[(0,de.jsx)("b",{children:"Dal\u0161\xed b\u011bh:"})," ",null!==Pn&&void 0!==Pn&&Pn.next_approximate?(0,ee.GP)(new Date(Pn.next_approximate),"d. M. yyyy HH:mm",{locale:te.cs}):"\u2014"]}),(0,de.jsxs)(V.E,{children:[(0,de.jsx)("b",{children:"Interval:"})," ",null!==Pn&&void 0!==Pn&&Pn.interval_minutes?"".concat(Pn.interval_minutes," min"):"\u2014"]}),(0,de.jsxs)(C.z,{children:[(0,de.jsx)(T.d,{size:"sm",isChecked:!(null===Pn||void 0===Pn||!Pn.newsletter_enabled),onChange:e=>In.mutate(e.target.checked)}),(0,de.jsx)(V.E,{children:"Automatick\xe9 rozes\xedlky"})]})]}),(0,de.jsx)(s.a,{mt:3,color:ge,fontSize:"sm",children:null!==Pn&&void 0!==Pn&&Pn.weekly_day?(0,de.jsxs)(de.Fragment,{children:[(0,de.jsxs)(V.E,{children:[(0,de.jsx)("b",{children:"T\xfddenn\xed p\u0159ehled:"})," ",null!==Pn&&void 0!==Pn&&Pn.weekly_enabled?"Zapnuto":"Vypnuto",null!==Pn&&void 0!==Pn&&Pn.weekly_enabled?(0,de.jsxs)(de.Fragment,{children:[" \u2014 ",{sun:"Ned\u011ble",mon:"Pond\u011bl\xed",tue:"\xdater\xfd",wed:"St\u0159eda",thu:"\u010ctvrtek",fri:"P\xe1tek",sat:"Sobota"}[Pn.weekly_day]," ",String(null!==(ue=null===Pn||void 0===Pn?void 0:Pn.weekly_hour)&&void 0!==ue?ue:9).padStart(2,"0"),":00"]}):null]}),null!==Pn&&void 0!==Pn&&Pn.weekly_next_scheduled?(0,de.jsxs)(V.E,{children:[(0,de.jsx)("b",{children:"P\u0159\xed\u0161t\xed t\xfddenn\xed odesl\xe1n\xed:"})," ",(0,ee.GP)(new Date(Pn.weekly_next_scheduled),"d. M. yyyy HH:mm",{locale:te.cs})]}):null]}):null}),null!==Pn&&void 0!==Pn&&Pn.next_approximate?(0,de.jsxs)(V.E,{color:"gray.600",fontSize:"sm",mt:2,children:["Dal\u0161\xed automatick\xfd newsletter za ",(()=>{const e=new Date(Pn.next_approximate).getTime()-Date.now();if(e<=0)return"m\xe9n\u011b ne\u017e minutu";const t=Math.floor(e/6e4),n=Math.floor(t/60),a=t%60;return n>0?"".concat(n," h ").concat(a," min"):"".concat(t," min")})()]}):null,null!==Pn&&void 0!==Pn&&null!==(he=Pn.sample_recipients)&&void 0!==he&&he.length?(0,de.jsx)(s.a,{mt:3,children:(0,de.jsxs)(V.E,{color:"gray.600",fontSize:"sm",children:["Uk\xe1zka p\u0159\xedjemc\u016f (",Pn.sample_recipients.length,"): ",Pn.sample_recipients.join(", ")]})}):null]}),(0,de.jsxs)(s.a,{bg:xe,borderRadius:"lg",boxShadow:"sm",p:4,mb:6,children:[(0,de.jsxs)(C.z,{justify:"space-between",align:"center",mb:3,children:[(0,de.jsx)(Z.D,{size:"md",children:"Typy e\u2011mail\u016f"}),(0,de.jsx)(se.tX,{label:"Jak\xe9 typy se pos\xedlaj\xed",title:"Typy newsletter\u016f a komu chod\xed",items:["Ka\u017ed\xfd odb\u011bratel si v preferenc\xedch vol\xed, jak\xe9 typy e\u2011mail\u016f chce dost\xe1vat (t\xfddenn\xed p\u0159ehled, z\xe1pasy, v\xfdsledky, novinky, akce).","Po\u010det p\u0159\xedjemc\u016f u ka\u017ed\xe9ho typu vych\xe1z\xed z aktivn\xedch odb\u011bratel\u016f, kte\u0159\xed maj\xed dan\xfd typ povolen\xfd.","P\u0159es tla\u010d\xedtko \u201eDetail\u201c uvid\xedte n\xe1hled konkr\xe9tn\xedho e\u2011mailu a m\u016f\u017eete zkontrolovat p\u0159edm\u011bt i obsah p\u0159ed hromadn\xfdm odesl\xe1n\xedm."]})]}),(0,de.jsx)(E.T,{align:"stretch",spacing:3,children:["weekly","matches","scores","blogs","events"].map(e=>{var t;const n=Ot(e).length,a="weekly"===e?!(null===on||void 0===on||!on.enable_weekly):"matches"===e?!(null===on||void 0===on||!on.enable_match_reminders):"scores"===e?!(null===on||void 0===on||!on.enable_results):void 0;return(0,de.jsxs)(h.s,{align:"center",justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",_hover:{bg:ve},children:[(0,de.jsxs)(C.z,{spacing:3,children:[(0,de.jsx)(V.E,{fontWeight:"600",children:mt[e]}),void 0!==a&&(0,de.jsx)(r.E,{colorScheme:a?"green":"gray",children:a?"Zapnuto":"Vypnuto"})]}),(0,de.jsxs)(C.z,{spacing:4,children:[(0,de.jsxs)(V.E,{color:ge,children:["P\u0159\xedjemci: ",(0,de.jsx)("b",{children:n})]}),null!==(t=jt[e])&&void 0!==t&&t.subject?(0,de.jsx)(r.E,{colorScheme:"blue",title:"P\u0159edm\u011bt p\u0159ipraven\xe9ho e\u2011mailu",children:jt[e].subject}):null,(0,de.jsx)(l.$,{size:"sm",onClick:()=>(e=>{vt(e),xt(!0)})(e),children:"Detail"})]})]},e)})})]})]}),(0,de.jsx)(W.K,{p:0,children:(0,de.jsxs)(s.a,{bg:xe,borderRadius:"lg",boxShadow:"sm",p:4,mb:6,children:[(0,de.jsxs)(C.z,{justify:"space-between",align:"center",mb:1,children:[(0,de.jsx)(Z.D,{size:"md",children:"Pl\xe1nov\xe1n\xed rozes\xedlek"}),(0,de.jsx)(se.tX,{label:"Jak funguje pl\xe1nov\xe1n\xed",title:"Kdy se newslettery automaticky pos\xedlaj\xed",items:["Nastavte den a \u010das pro t\xfddenn\xed p\u0159ehled a p\u0159edstih pro p\u0159ipom\xednky z\xe1pas\u016f \u2013 syst\xe9m pak b\u011b\u017e\xed automaticky na pozad\xed.","Tich\xe9 hodiny br\xe1n\xed odes\xedl\xe1n\xed v\xfdsledkov\xfdch e\u2011mail\u016f v nevhodnou dobu (nap\u0159. v noci).","Aby se e\u2011maily odes\xedlaly, mus\xed b\xfdt z\xe1rove\u0148 zapnut\xe9 typy rozes\xedlek v Nastaven\xed a povolen\xe9 \u201eAutomatick\xe9 rozes\xedlky\u201c na kart\u011b Stav."]})]}),(0,de.jsx)(V.E,{color:"gray.600",mb:4,children:"Nastavte, kdy se automaticky pos\xedlaj\xed jednotliv\xe9 typy newsletter\u016f."}),an.isLoading?(0,de.jsxs)(C.z,{color:"gray.600",children:[(0,de.jsx)(A.y,{size:"sm"})," ",(0,de.jsx)(V.E,{children:"Na\u010d\xedt\xe1m nastaven\xed\u2026"})]}):(0,de.jsxs)(E.T,{align:"stretch",spacing:4,children:[(0,de.jsxs)(C.z,{justify:"space-between",children:[(0,de.jsx)(V.E,{fontWeight:"600",children:"T\xfddenn\xed p\u0159ehled"}),(0,de.jsx)(T.d,{isChecked:rn,onChange:e=>sn(e.target.checked)})]}),(0,de.jsxs)(C.z,{spacing:3,children:[(0,de.jsxs)(m.MJ,{maxW:"220px",children:[(0,de.jsx)(p.l,{children:"Den v t\xfddnu"}),(0,de.jsxs)(S.l,{value:hn,onChange:e=>mn(e.target.value),children:[(0,de.jsx)("option",{value:"mon",children:"Pond\u011bl\xed"}),(0,de.jsx)("option",{value:"tue",children:"\xdater\xfd"}),(0,de.jsx)("option",{value:"wed",children:"St\u0159eda"}),(0,de.jsx)("option",{value:"thu",children:"\u010ctvrtek"}),(0,de.jsx)("option",{value:"fri",children:"P\xe1tek"}),(0,de.jsx)("option",{value:"sat",children:"Sobota"}),(0,de.jsx)("option",{value:"sun",children:"Ned\u011ble"})]})]}),(0,de.jsxs)(m.MJ,{maxW:"200px",children:[(0,de.jsx)(p.l,{children:"\u010cas odesl\xe1n\xed"}),(0,de.jsx)(x.p,{type:"time",step:900,value:xn,onChange:e=>gn(e.target.value)})]})]}),(0,de.jsx)(s.a,{h:"1px",bg:(0,u.dU)("gray.200","gray.700"),my:2}),(0,de.jsxs)(C.z,{justify:"space-between",children:[(0,de.jsx)(V.E,{fontWeight:"600",children:"P\u0159ipom\xednky z\xe1pas\u016f"}),(0,de.jsx)(T.d,{isChecked:ln,onChange:e=>cn(e.target.checked)})]}),(0,de.jsx)(C.z,{spacing:3,children:(0,de.jsxs)(m.MJ,{maxW:"220px",children:[(0,de.jsx)(p.l,{children:"Odeslat p\u0159ed (hodin)"}),(0,de.jsx)(x.p,{type:"number",min:1,max:168,value:vn,onChange:e=>jn(Math.max(1,Math.min(168,Number(e.target.value)||0)))}),(0,de.jsx)(m.eK,{children:"V\xfdchoz\xed 48 h p\u0159ed v\xfdkopem. Syst\xe9m pos\xedl\xe1 i upozorn\u011bn\xed v den z\xe1pasu."})]})}),(0,de.jsx)(s.a,{h:"1px",bg:(0,u.dU)("gray.200","gray.700"),my:2}),(0,de.jsxs)(C.z,{justify:"space-between",children:[(0,de.jsx)(V.E,{fontWeight:"600",children:"V\xfdsledky po z\xe1pase"}),(0,de.jsx)(T.d,{isChecked:dn,onChange:e=>un(e.target.checked)})]}),(0,de.jsxs)(C.z,{spacing:3,children:[(0,de.jsxs)(m.MJ,{maxW:"200px",children:[(0,de.jsx)(p.l,{children:"Tich\xe9 hodiny od"}),(0,de.jsx)(x.p,{type:"time",step:900,value:bn,onChange:e=>yn(e.target.value)})]}),(0,de.jsxs)(m.MJ,{maxW:"200px",children:[(0,de.jsx)(p.l,{children:"Tich\xe9 hodiny do"}),(0,de.jsx)(x.p,{type:"time",step:900,value:fn,onChange:e=>kn(e.target.value)}),(0,de.jsx)(m.eK,{children:"E-maily s v\xfdsledky se nepos\xedlaj\xed v tomto intervalu."})]})]}),(0,de.jsx)(C.z,{pt:2,children:(0,de.jsx)(l.$,{colorScheme:"blue",onClick:()=>wn.mutate(),isLoading:wn.isLoading,children:"Ulo\u017eit pl\xe1nov\xe1n\xed"})})]})]})}),(0,de.jsx)(W.K,{p:0,children:(0,de.jsxs)(s.a,{bg:xe,borderRadius:"lg",boxShadow:"sm",p:4,mb:6,children:[(0,de.jsx)(Z.D,{size:"md",mb:3,children:"Dod\xe1n\xed a interakce"}),Ln?(0,de.jsxs)(C.z,{color:"gray.600",children:[(0,de.jsx)(A.y,{size:"sm"})," ",(0,de.jsx)(V.E,{children:"Na\u010d\xedt\xe1m statistiky\u2026"})]}):0===Mn.length?(0,de.jsx)(V.E,{color:"gray.600",children:"Zat\xedm nejsou k dispozici \u017e\xe1dn\xe9 z\xe1znamy."}):(0,de.jsxs)(de.Fragment,{children:[(0,de.jsxs)(C.z,{mb:3,spacing:3,align:"center",children:[(0,de.jsx)(le.A,{from:Wn||void 0,to:On||void 0,onChange:(e,t)=>{Un((e||"").trim()),qn((t||"").trim())},size:"sm"}),(Wn||On)&&(0,de.jsx)(l.$,{size:"sm",variant:"outline",colorScheme:"red",onClick:()=>{Un(""),qn("")},borderRadius:"md",children:"Vymazat filtr"})]}),(0,de.jsx)(s.a,{overflowX:"auto",children:(0,de.jsxs)(D.X,{size:"sm",variant:"simple",children:[(0,de.jsx)(P.d,{children:(0,de.jsxs)(I.Tr,{children:[(0,de.jsx)(F.Th,{children:"\u010cas"}),(0,de.jsx)(F.Th,{children:"P\u0159edm\u011bt"}),(0,de.jsx)(F.Th,{children:"P\u0159\xedjemce"}),(0,de.jsx)(F.Th,{isNumeric:!0,children:"Otev\u0159en\xed"}),(0,de.jsx)(F.Th,{isNumeric:!0,children:"Kliknut\xed"}),(0,de.jsx)(F.Th,{isNumeric:!0,children:"Spam"}),(0,de.jsx)(F.Th,{isNumeric:!0,children:"Odhl\xe1\u0161en\xed"}),(0,de.jsx)(F.Th,{children:"Stav"}),(0,de.jsx)(F.Th,{children:"Detail"})]})}),(0,de.jsx)(N.N,{children:Kn.slice(0,50).map(e=>(0,de.jsxs)(I.Tr,{children:[(0,de.jsx)(R.Td,{children:(0,ee.GP)(new Date(e.created_at),"d. M. yyyy HH:mm",{locale:te.cs})}),(0,de.jsx)(R.Td,{children:e.subject}),(0,de.jsx)(R.Td,{children:e.recipient}),(0,de.jsx)(R.Td,{isNumeric:!0,children:e.opens}),(0,de.jsx)(R.Td,{isNumeric:!0,children:e.clicks}),(0,de.jsx)(R.Td,{isNumeric:!0,children:e.spam}),(0,de.jsx)(R.Td,{isNumeric:!0,children:e.unsubs}),(0,de.jsx)(R.Td,{children:(0,de.jsx)(r.E,{colorScheme:"failed"===e.status?"red":"green",children:e.status})}),(0,de.jsx)(R.Td,{children:(0,de.jsx)(l.$,{size:"xs",variant:"outline",onClick:()=>{Hn(e),Zn(!0)},children:"Detail"})})]},e.id))})]})})]})]})})]})]}),(0,de.jsxs)(s.a,{bg:xe,borderRadius:"lg",boxShadow:"sm",p:4,mb:6,children:[(0,de.jsxs)(g.M,{maxW:"md",mb:4,children:[(0,de.jsx)(v.W,{pointerEvents:"none",children:(0,de.jsx)(H.W,{color:"gray.400"})}),(0,de.jsx)(x.p,{placeholder:"Hledat podle e-mailu...",value:je,onChange:e=>be(e.target.value)})]}),(0,de.jsx)(s.a,{overflowX:"auto",children:(0,de.jsxs)(D.X,{variant:"simple",children:[(0,de.jsx)(P.d,{children:(0,de.jsxs)(I.Tr,{children:[(0,de.jsx)(F.Th,{w:"40px",children:(0,de.jsx)("input",{type:"checkbox",onChange:e=>{e.target.checked?fe(Sn.map(e=>e.id)):fe([])},checked:Sn.length>0&&ye.length===Sn.length})}),(0,de.jsx)(F.Th,{children:"E-mail"}),(0,de.jsx)(F.Th,{children:"Stav"}),(0,de.jsx)(F.Th,{children:"Datum registrace"}),(0,de.jsx)(F.Th,{children:"Posledn\xed zm\u011bna"}),(0,de.jsx)(F.Th,{w:"120px",children:"Akce"})]})}),(0,de.jsx)(N.N,{children:Ut?(0,de.jsx)(I.Tr,{children:(0,de.jsx)(R.Td,{colSpan:6,textAlign:"center",py:8,children:"Na\u010d\xedt\xe1n\xed..."})}):0===Sn.length?(0,de.jsx)(I.Tr,{children:(0,de.jsx)(R.Td,{colSpan:6,textAlign:"center",py:8,color:"gray.500",children:je?"\u017d\xe1dn\xed odb\u011bratel\xe9 nebyli nalezeni":"\u017d\xe1dn\xed odb\u011bratel\xe9"})}):Sn.map(e=>(0,de.jsxs)(I.Tr,{children:[(0,de.jsx)(R.Td,{children:(0,de.jsx)("input",{type:"checkbox",checked:ye.includes(e.id),onChange:t=>{return n=e.id,a=t.target.checked,void fe(a?e=>[...e,n]:e=>e.filter(e=>e!==n));var n,a}})}),(0,de.jsx)(R.Td,{children:e.email}),(0,de.jsx)(R.Td,{children:(0,de.jsx)(r.E,{colorScheme:e.is_active?"green":"gray",children:e.is_active?"Aktivn\xed":"Neaktivn\xed"})}),(0,de.jsx)(R.Td,{children:(()=>{const t=e.preferences;return t&&Object.keys(t).length>0?Object.keys(t).map(e=>t[e]?(0,de.jsx)(r.E,{mr:1,colorScheme:"blue",children:e},e):null):(0,de.jsx)(V.E,{color:"gray.500",children:"\u017d\xe1dn\xe9"})})()}),(0,de.jsx)(R.Td,{children:Fn(e.created_at)}),(0,de.jsx)(R.Td,{children:Fn(e.updated_at)}),(0,de.jsx)(R.Td,{children:(0,de.jsxs)(C.z,{spacing:2,children:[(0,de.jsx)(B.m,{label:e.is_active?"Deaktivovat":"Aktivovat",children:(0,de.jsx)("span",{children:(0,de.jsx)(T.d,{colorScheme:"green",isChecked:e.is_active,onChange:t=>An.mutate({id:e.id,isActive:t.target.checked}),isDisabled:An.isLoading})})}),(0,de.jsx)(B.m,{label:"Smazat",children:(0,de.jsx)("span",{children:(0,de.jsx)(c.K,{"aria-label":"Smazat odb\u011bratele",icon:(0,de.jsx)(J.d,{}),size:"sm",colorScheme:"red",variant:"ghost",onClick:async()=>{await Xn({title:"Smazat odb\u011bratele",message:"Opravdu chcete smazat tohoto odb\u011bratele?",confirmText:"Smazat",cancelText:"Zru\u0161it",isDanger:!0})&&Cn.mutate(e.id)}})})}),(0,de.jsx)(B.m,{label:"Upravit preference",children:(0,de.jsx)(l.$,{size:"sm",variant:"ghost",onClick:()=>{et(e),nt(e.preferences||{}),Ye(!0)},children:"Upravit"})})]})})]},e.id))})]})})]})]}),(0,de.jsxs)(w.aF,{isOpen:Bt,onClose:Vt,size:"xl",children:[(0,de.jsx)(_.m,{}),(0,de.jsxs)(z.$,{maxW:"90vw",maxH:"90vh",overflowY:"auto",children:[(0,de.jsx)(k.r,{children:"Odeslat newsletter"}),(0,de.jsx)(y.s,{}),(0,de.jsx)(b.c,{children:(0,de.jsxs)(E.T,{spacing:4,align:"stretch",children:[(0,de.jsxs)(V.E,{children:["Newsletter bude odesl\xe1n v\u0161em aktivn\xedm odb\u011bratel\u016fm (",Wt.filter(e=>e.is_active).length,")."]}),(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"Typ"}),(0,de.jsxs)(S.l,{value:at,onChange:e=>it(e.target.value),children:[(0,de.jsx)("option",{value:"custom",children:"Vlastn\xed obsah"}),(0,de.jsx)("option",{value:"matches",children:"\u0160ablona: Z\xe1pasy"}),(0,de.jsx)("option",{value:"scores",children:"\u0160ablona: V\xfdsledky"}),(0,de.jsx)("option",{value:"events",children:"\u0160ablona: Akce"}),(0,de.jsx)("option",{value:"blogs",children:"\u0160ablona: Novinky"}),(0,de.jsx)("option",{value:"weekly",children:"\u0160ablona: T\xfddenn\xed p\u0159ehled"})]}),(0,de.jsx)(m.eK,{children:"Zvolte mezi vlastn\xedm obsahem nebo automatickou \u0161ablonou."})]}),"custom"===at&&(0,de.jsxs)(de.Fragment,{children:[(0,de.jsxs)(m.MJ,{isRequired:!0,children:[(0,de.jsx)(p.l,{children:"P\u0159edm\u011bt"}),(0,de.jsx)(x.p,{placeholder:"P\u0159edm\u011bt zpr\xe1vy",value:ke.subject,onChange:e=>_e((0,a.A)((0,a.A)({},ke),{},{subject:e.target.value}))})]}),(0,de.jsxs)(m.MJ,{isRequired:!0,children:[(0,de.jsx)(p.l,{children:"Obsah zpr\xe1vy"}),(0,de.jsx)(q.T,{placeholder:"Zde napi\u0161te obsah newsletteru...",value:ke.content,onChange:e=>_e((0,a.A)((0,a.A)({},ke),{},{content:e.target.value})),rows:10}),(0,de.jsx)(m.eK,{children:"Pro form\xe1tov\xe1n\xed textu m\u016f\u017eete pou\u017e\xedt HTML zna\u010dky."})]})]}),"custom"!==at&&(0,de.jsxs)(de.Fragment,{children:[(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"Filtr sout\u011b\u017e\xed (voliteln\xe9)"}),nn.length>0?(0,de.jsxs)(E.T,{align:"stretch",spacing:2,maxH:"220px",overflowY:"auto",borderWidth:"1px",borderRadius:"md",p:3,children:[(0,de.jsxs)(C.z,{children:[(0,de.jsx)(l.$,{size:"xs",variant:"outline",onClick:()=>rt(nn.map(e=>e.code).join(", ")),children:"Vybrat v\u0161e"}),(0,de.jsx)(l.$,{size:"xs",variant:"ghost",onClick:()=>rt(""),children:"Zru\u0161it v\u0161e"})]}),nn.map(e=>{const t=Mt.has(e.code.toLowerCase())||Mt.has(e.code);return(0,de.jsxs)(C.z,{justify:"space-between",children:[(0,de.jsx)(V.E,{children:e.name}),(0,de.jsx)(T.d,{isChecked:t,onChange:t=>((e,t)=>{const n=new Set(Mt);t?n.add(e):n.delete(e),rt(Array.from(n).join(", "))})(e.code,t.target.checked)})]},e.code)})]}):(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(x.p,{placeholder:"NAP\u0158. KP, I.A, I.B",value:ot,onChange:e=>rt(e.target.value)}),(0,de.jsx)(m.eK,{children:"\u010c\xe1rkou odd\u011blen\xfd seznam k\xf3d\u016f sout\u011b\u017e\xed."})]})]}),(0,de.jsxs)(C.z,{children:[(0,de.jsx)(l.$,{variant:"outline",onClick:async()=>{ht(!0);try{const e={};"weekly"===at?(e.blogs=!0,e.events=!0,e.matches=!0,e.scores=!0):e[at]=!0,ot.trim()&&(e.competitions=ot.trim());const t=await(0,oe.previewNewsletter)({preferences:e});lt(t.subject),dt(t.html)}finally{ht(!1)}},children:"N\xe1hled \u0161ablony"}),ut&&(0,de.jsx)(A.y,{size:"sm"}),st&&(0,de.jsx)(r.E,{colorScheme:"blue",children:st})]}),(0,de.jsx)(s.a,{mt:2,p:3,bg:(0,u.dU)("gray.50","gray.900"),borderRadius:"md",borderWidth:"1px",children:(0,de.jsx)(s.a,{className:"ql-editor",p:3,borderRadius:"md",borderWidth:"1px",dangerouslySetInnerHTML:{__html:zn(ct||"<em>N\xe1hled se zobraz\xed zde</em>")}})}),(0,de.jsxs)(s.a,{mt:4,p:4,bg:(0,u.dU)("gray.50","gray.900"),borderRadius:"md",children:[(0,de.jsx)(V.E,{fontWeight:"bold",mb:2,children:"N\xe1hled:"}),(0,de.jsx)(s.a,{border:"1px",borderColor:"gray.200",p:4,borderRadius:"md",bg:xe,className:"ql-editor",dangerouslySetInnerHTML:{__html:zn(ct||"<em>N\xe1hled se zobraz\xed zde</em>")}})]})]})]})}),(0,de.jsxs)(f.j,{children:[(0,de.jsx)(l.$,{variant:"ghost",mr:3,onClick:Vt,children:"Zru\u0161it"}),"custom"===at?(0,de.jsx)(l.$,{colorScheme:"blue",onClick:()=>{Tn.mutate(ke)},isLoading:Tn.isLoading,isDisabled:!ke.subject||!ke.content,leftIcon:(0,de.jsx)(G.a,{}),children:"Odeslat newsletter"}):(0,de.jsx)(l.$,{colorScheme:"blue",onClick:async()=>{try{await(0,oe.sendNewsletterDigest)(at,ot.trim()||void 0),Gt({title:"Digest odesl\xe1n",status:"success"}),Vt(),dt(""),lt(""),rt(""),it("custom")}catch(n){var e,t;Gt({title:"Chyba p\u0159i odesl\xe1n\xed",description:(null===n||void 0===n||null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||(null===n||void 0===n?void 0:n.message),status:"error"})}},leftIcon:(0,de.jsx)(G.a,{}),children:"Odeslat digest"})]})]})]}),(0,de.jsxs)(w.aF,{isOpen:pt,onClose:It,size:"5xl",children:[(0,de.jsx)(_.m,{}),(0,de.jsxs)(z.$,{maxW:"95vw",maxH:"90vh",overflowY:"auto",children:[(0,de.jsx)(k.r,{children:gt?"Detail: ".concat(mt[gt]):"Detail"}),(0,de.jsx)(y.s,{}),(0,de.jsx)(b.c,{children:(0,de.jsxs)(E.T,{align:"stretch",spacing:4,children:[(0,de.jsxs)(C.z,{spacing:4,align:"flex-end",children:[(0,de.jsxs)(m.MJ,{maxW:"420px",children:[(0,de.jsx)(p.l,{children:"Filtr sout\u011b\u017e\xed (voliteln\xe9)"}),nn.length>0?(0,de.jsxs)(E.T,{align:"stretch",spacing:2,maxH:"220px",overflowY:"auto",borderWidth:"1px",borderRadius:"md",p:3,children:[(0,de.jsxs)(C.z,{children:[(0,de.jsx)(l.$,{size:"xs",variant:"outline",onClick:()=>ft(nn.map(e=>e.code).join(", ")),children:"Vybrat v\u0161e"}),(0,de.jsx)(l.$,{size:"xs",variant:"ghost",onClick:()=>ft(""),children:"Zru\u0161it v\u0161e"})]}),nn.map(e=>{const t=Lt.has(e.code.toLowerCase())||Lt.has(e.code);return(0,de.jsxs)(C.z,{justify:"space-between",children:[(0,de.jsx)(V.E,{children:e.name}),(0,de.jsx)(T.d,{isChecked:t,onChange:t=>((e,t)=>{const n=new Set(Lt);t?n.add(e):n.delete(e),ft(Array.from(n).join(", "))})(e.code,t.target.checked)})]},e.code)})]}):(0,de.jsx)(x.p,{placeholder:"NAP\u0158. KP, I.A, I.B",value:yt,onChange:e=>ft(e.target.value)})]}),(0,de.jsx)(l.$,{onClick:async()=>{if(gt){_t(!0);try{await Kt(gt,yt)}finally{_t(!1)}}},isLoading:kt,children:"Aktualizovat n\xe1hled"}),gt&&(null===(me=jt[gt])||void 0===me?void 0:me.subject)&&(0,de.jsx)(r.E,{colorScheme:"blue",children:jt[gt].subject}),(0,de.jsx)(l.$,{colorScheme:"blue",variant:"solid",isLoading:wt,onClick:async()=>{if(!gt)return;if(await Xn({title:"Odeslat nyn\xed",message:'Odeslat "'.concat(mt[gt],'" nyn\xed? E\u2011mail bude odesl\xe1n v\u0161em aktivn\xedm odb\u011bratel\u016fm.'),confirmText:"Odeslat",cancelText:"Zru\u0161it",isDanger:!0}))try{zt(!0),await(0,oe.sendNewsletterDigest)(gt,(yt||"").trim()||void 0),Gt({title:"Digest odesl\xe1n",status:"success"})}catch(n){var e,t;Gt({title:"Chyba p\u0159i odesl\xe1n\xed",description:(null===n||void 0===n||null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||(null===n||void 0===n?void 0:n.message),status:"error"})}finally{zt(!1)}},children:"Odeslat nyn\xed"}),(0,de.jsx)(l.$,{variant:"outline",onClick:()=>{gt&&qt(gt,yt)},children:"Export CSV"})]}),(0,de.jsx)(s.a,{p:3,bg:(0,u.dU)("gray.50","gray.900"),borderRadius:"md",borderWidth:"1px",children:(0,de.jsx)(s.a,{className:"ql-editor",bg:xe,p:3,borderRadius:"md",borderWidth:"1px",dangerouslySetInnerHTML:{__html:zn(gt&&(null===(pe=jt[gt])||void 0===pe?void 0:pe.html)||"<em>N\xe1hled se zobraz\xed zde</em>")}})}),(0,de.jsxs)(s.a,{children:[(0,de.jsx)(Z.D,{size:"sm",mb:2,children:"P\u0159\xedjemci"}),(()=>{let e=[];if(gt){const t="weekly"===gt?"weekly":gt,n=Wt.filter(e=>(null===e||void 0===e?void 0:e.is_active)&&(null===e||void 0===e?void 0:e.preferences)&&!0===e.preferences[t]);let a=n;const i=(yt||"").trim();if(i&&("matches"===gt||"scores"===gt)){const e=i.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean);e.length>0&&(a=n.filter(t=>{const n=(null===t||void 0===t?void 0:t.preferences)||{},a=("string"===typeof n.competitions&&n.competitions?n.competitions:"string"===typeof n.categories?n.categories:"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean);return 0===a.length||a.some(t=>e.includes(t))}))}e=a.map(e=>e.email)}const t=e.slice(0,50);return(0,de.jsx)(de.Fragment,{children:0===t.length?(0,de.jsx)(V.E,{color:"gray.600",children:"\u017d\xe1dn\xed p\u0159\xedjemci pro tento typ."}):(0,de.jsxs)(E.T,{align:"stretch",spacing:1,maxH:"240px",overflowY:"auto",borderWidth:"1px",borderRadius:"md",p:3,children:[t.map(e=>(0,de.jsx)(V.E,{fontFamily:"mono",children:e},e)),e.length>t.length&&(0,de.jsxs)(V.E,{color:"gray.600",children:["\u2026 a dal\u0161\xedch ",e.length-t.length]})]})})})()]})]})}),(0,de.jsx)(f.j,{children:(0,de.jsx)(l.$,{onClick:It,children:"Zav\u0159\xedt"})})]})]}),(0,de.jsxs)(w.aF,{isOpen:$t.isOpen,onClose:$t.onClose,size:"lg",children:[(0,de.jsx)(_.m,{}),(0,de.jsxs)(z.$,{maxW:"90vw",maxH:"90vh",overflowY:"auto",children:[(0,de.jsx)(k.r,{children:"Otestovat SMTP"}),(0,de.jsx)(y.s,{}),(0,de.jsx)(b.c,{children:(0,de.jsxs)(E.T,{spacing:4,align:"stretch",children:[(0,de.jsxs)(C.z,{spacing:3,align:"flex-end",children:[(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"Host"}),(0,de.jsx)(x.p,{placeholder:"smtp.example.com",value:we,onChange:e=>ze(e.target.value)})]}),(0,de.jsxs)(m.MJ,{maxW:"140px",children:[(0,de.jsx)(p.l,{children:"Port"}),(0,de.jsx)(x.p,{type:"number",placeholder:"465",value:Se,onChange:e=>Ae(Number(e.target.value)||0)})]}),(0,de.jsxs)(m.MJ,{maxW:"140px",children:[(0,de.jsx)(p.l,{children:"\xa0"}),(0,de.jsx)(d.S,{isChecked:Ie,onChange:e=>Me(e.target.checked),children:"TLS/SSL"})]})]}),(0,de.jsxs)(C.z,{spacing:3,children:[(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"U\u017eivatel"}),(0,de.jsx)(x.p,{value:Ce,onChange:e=>Ee(e.target.value)})]}),(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"Heslo"}),(0,de.jsxs)(g.M,{children:[(0,de.jsx)(x.p,{type:qe?"text":"password",value:Te,onChange:e=>De(e.target.value)}),(0,de.jsx)(v.t,{width:"4.5rem",children:(0,de.jsx)(l.$,{h:"1.75rem",size:"sm",onClick:()=>Ke(e=>!e),children:qe?"Skr\xfdt":"Zobrazit"})})]})]})]}),(0,de.jsxs)(C.z,{spacing:3,children:[(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"From"}),(0,de.jsx)(x.p,{placeholder:"club@example.com",value:Ne,onChange:e=>Re(e.target.value)})]}),(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"To (kam poslat test)"}),(0,de.jsx)(x.p,{placeholder:"you@example.com",value:Fe,onChange:e=>Pe(e.target.value)})]})]}),(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"P\u0159edm\u011bt"}),(0,de.jsx)(x.p,{value:Le,onChange:e=>We(e.target.value)})]}),(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"T\u011blo zpr\xe1vy (HTML)"}),(0,de.jsx)(q.T,{rows:6,value:Ue,onChange:e=>Oe(e.target.value)})]})]})}),(0,de.jsxs)(f.j,{children:[(0,de.jsx)(l.$,{variant:"ghost",mr:3,onClick:$t.onClose,children:"Zav\u0159\xedt"}),(0,de.jsx)(l.$,{colorScheme:"blue",onClick:()=>Be.mutate(),isLoading:Be.isLoading,children:"Odeslat test"})]})]})]}),(0,de.jsxs)(w.aF,{isOpen:Ht.isOpen,onClose:Ht.onClose,size:"md",children:[(0,de.jsx)(_.m,{}),(0,de.jsxs)(z.$,{maxW:"90vw",maxH:"90vh",overflowY:"auto",children:[(0,de.jsx)(k.r,{children:"Odeslat testovac\xed e-mail"}),(0,de.jsx)(y.s,{}),(0,de.jsx)(b.c,{children:(0,de.jsxs)(E.T,{spacing:4,align:"stretch",children:[(0,de.jsx)(V.E,{color:"gray.600",children:"Testovac\xed e-mail bude odesl\xe1n na zadanou adresu. Pokud pole nech\xe1te pr\xe1zdn\xe9, ode\u0161leme na v\xfdchoz\xed administr\xe1torsk\xfd e-mail."}),(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"E-mail p\u0159\xedjemce (voliteln\u011b)"}),(0,de.jsx)(x.p,{type:"email",placeholder:"nap\u0159. admin@priklad.cz",value:Ze,onChange:e=>Ve(e.target.value)})]}),(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"V\xedce e-mail\u016f (odd\u011blen\xe9 \u010d\xe1rkou)"}),(0,de.jsx)(x.p,{placeholder:"user1@priklad.cz, user2@priklad.cz",value:He,onChange:e=>$e(e.target.value)}),(0,de.jsx)(m.eK,{children:"Pokud vypln\xedte, pou\u017eije se toto pole p\u0159ednostn\u011b."})]}),(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"Typ testu"}),(0,de.jsxs)("select",{value:Je,onChange:e=>Ge(e.target.value),children:[(0,de.jsx)("option",{value:"newsletter",children:"Newsletter"}),(0,de.jsx)("option",{value:"welcome",children:"Uv\xedtac\xed"}),(0,de.jsx)("option",{value:"welcome_back",children:"Uv\xedtac\xed (n\xe1vrat)"}),(0,de.jsx)("option",{value:"blogs",children:"Blogy (digest)"}),(0,de.jsx)("option",{value:"events",children:"Ud\xe1losti (digest)"}),(0,de.jsx)("option",{value:"matches",children:"Z\xe1pasy (digest)"}),(0,de.jsx)("option",{value:"scores",children:"V\xfdsledky (digest)"}),(0,de.jsx)("option",{value:"weekly",children:"T\xfddenn\xed p\u0159ehled"})]})]})]})}),(0,de.jsxs)(f.j,{children:[(0,de.jsx)(l.$,{variant:"ghost",mr:3,onClick:Ht.onClose,children:"Zav\u0159\xedt"}),(0,de.jsx)(l.$,{colorScheme:"blue",onClick:()=>Dn.mutate(),isLoading:Dn.isLoading,children:"Odeslat test"})]})]})]}),(0,de.jsxs)(w.aF,{isOpen:Xe,onClose:()=>Ye(!1),size:"md",children:[(0,de.jsx)(_.m,{}),(0,de.jsxs)(z.$,{children:[(0,de.jsx)(k.r,{children:"Upravit preference"}),(0,de.jsx)(y.s,{}),(0,de.jsx)(b.c,{children:(0,de.jsxs)(E.T,{spacing:4,align:"stretch",children:[(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"T\xfddenn\xed p\u0159ehled"}),(0,de.jsx)(T.d,{isChecked:!!tt.weekly,onChange:e=>nt((0,a.A)((0,a.A)({},tt),{},{weekly:e.target.checked}))})]}),(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"Nadch\xe1zej\xedc\xed z\xe1pasy"}),(0,de.jsx)(T.d,{isChecked:!!tt.matches,onChange:e=>nt((0,a.A)((0,a.A)({},tt),{},{matches:e.target.checked}))})]}),(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"Blog"}),(0,de.jsx)(T.d,{isChecked:!!tt.blogs,onChange:e=>nt((0,a.A)((0,a.A)({},tt),{},{blogs:e.target.checked}))})]})]})}),(0,de.jsxs)(f.j,{children:[(0,de.jsx)(l.$,{variant:"ghost",mr:3,onClick:()=>Ye(!1),children:"Zru\u0161it"}),(0,de.jsx)(l.$,{colorScheme:"blue",onClick:()=>Qe?En.mutate({id:Qe.id,prefs:tt}):void 0,isLoading:En.isLoading,isDisabled:!Qe,children:"Ulo\u017eit"})]})]})]}),(0,de.jsxs)(w.aF,{isOpen:Jt.isOpen,onClose:Jt.onClose,size:"lg",children:[(0,de.jsx)(_.m,{}),(0,de.jsxs)(z.$,{children:[(0,de.jsx)(k.r,{children:"P\u0159idat odb\u011bratele"}),(0,de.jsx)(y.s,{}),(0,de.jsx)(b.c,{children:(0,de.jsxs)(E.T,{spacing:4,align:"stretch",children:[(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"E-mail odb\u011bratele"}),(0,de.jsx)(x.p,{value:St,onChange:e=>At(e.target.value),placeholder:"email@example.com"})]}),(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"I\u010cO (voliteln\xe9)"}),(0,de.jsxs)(g.M,{children:[(0,de.jsx)(x.p,{value:Ct,onChange:e=>{return t=e.target.value,Et(t),Rt(null),void(8===t.length&&/^\d+$/.test(t)&&(Pt(!0),Rn.mutate(t)));var t},placeholder:"12345678",maxLength:8}),(0,de.jsx)(v.t,{width:"4.5rem",children:Ft?(0,de.jsx)(A.y,{size:"sm"}):(0,de.jsx)(l.$,{size:"sm",onClick:()=>{8===Ct.length&&/^\d+$/.test(Ct)&&(Pt(!0),Rn.mutate(Ct))},isDisabled:8!==Ct.length||!/^\d+$/.test(Ct),children:"Hledat"})})]}),Nt&&(0,de.jsx)(s.a,{mt:2,p:3,borderWidth:"1px",borderRadius:"md",bg:Nt.found?"green.50":"red.50",children:Nt.found?(0,de.jsxs)(E.T,{align:"start",spacing:1,children:[(0,de.jsx)(V.E,{fontWeight:"600",children:"Nalezeno:"}),(0,de.jsxs)(V.E,{children:[(0,de.jsx)("strong",{children:"N\xe1zev:"})," ",Nt.name]}),(0,de.jsxs)(V.E,{children:[(0,de.jsx)("strong",{children:"I\u010cO:"})," ",Nt.ico]}),Nt.dic&&(0,de.jsxs)(V.E,{children:[(0,de.jsx)("strong",{children:"DI\u010c:"})," ",Nt.dic]}),(0,de.jsxs)(V.E,{children:[(0,de.jsx)("strong",{children:"Adresa:"})," ",Nt.address,", ",Nt.city]})]}):(0,de.jsxs)(V.E,{color:"red.600",children:["Subjekt s I\u010cO ",Ct," nebyl nalezen"]})})]}),(0,de.jsxs)(m.MJ,{children:[(0,de.jsx)(p.l,{children:"Preference odb\u011bru"}),(0,de.jsxs)(E.T,{align:"start",spacing:2,children:[(0,de.jsx)(d.S,{isChecked:!!Tt.weekly,onChange:e=>Dt((0,a.A)((0,a.A)({},Tt),{},{weekly:e.target.checked})),children:"T\xfddenn\xed p\u0159ehled"}),(0,de.jsx)(d.S,{isChecked:!!Tt.matches,onChange:e=>Dt((0,a.A)((0,a.A)({},Tt),{},{matches:e.target.checked})),children:"Nadch\xe1zej\xedc\xed z\xe1pasy"}),(0,de.jsx)(d.S,{isChecked:!!Tt.scores,onChange:e=>Dt((0,a.A)((0,a.A)({},Tt),{},{scores:e.target.checked})),children:"V\xfdsledky z\xe1pas\u016f"}),(0,de.jsx)(d.S,{isChecked:!!Tt.blogs,onChange:e=>Dt((0,a.A)((0,a.A)({},Tt),{},{blogs:e.target.checked})),children:"Novinky a \u010dl\xe1nky"}),(0,de.jsx)(d.S,{isChecked:!!Tt.events,onChange:e=>Dt((0,a.A)((0,a.A)({},Tt),{},{events:e.target.checked})),children:"Akce a ud\xe1losti"})]})]})]})}),(0,de.jsxs)(f.j,{children:[(0,de.jsx)(l.$,{variant:"ghost",mr:3,onClick:Jt.onClose,children:"Zru\u0161it"}),(0,de.jsx)(l.$,{colorScheme:"blue",onClick:()=>{St.trim()?Nn.mutate({email:St.trim(),preferences:Tt}):Gt({title:"Chyb\xed e-mail",description:"Zadejte e-mailovou adresu odb\u011bratele",status:"error",duration:3e3})},isLoading:Nn.isLoading,isDisabled:!St.trim(),children:"P\u0159idat odb\u011bratele"})]})]})]})]})}},7553:(e,t,n)=>{n.r(t),n.d(t,{default:()=>de});var a=n(89379),i=n(65043),o=n(96870),r=n(88787),s=n(85871),l=n(87139),c=n(22107),d=n(98662),u=n(42703),h=n(83169),m=n(24330),p=n(44093),x=n(98939),g=n(5371),v=n(73225),j=n(76668),b=n(25011),y=n(35699),f=n(67516),k=n(35929),_=n(56529),w=n(15071),z=n(11054),S=n(78460),A=n(85421),C=n(61724),E=n(76659),T=n(96148),D=n(10202),N=n(98481),R=n(14566),F=n(31411),P=n(10227),I=n(51794),M=n(3109),L=n(19077),W=n(30502),U=n(99956),O=n(28846),q=n(39081),K=n(3746),B=n(6583),Z=n(12730),V=n(55206),H=n(13241),$=n(58584),J=n(99973),G=n(63856),X=n(5874),Y=n(84937),Q=n(42128),ee=n(85369),te=n(1029),ne=n(2367),ae=n(35200),ie=n(74117),oe=n(70579);const re=[{value:"dashboard",label:"N\xe1st\u011bnka",url:"/admin"},{value:"analytics",label:"Analytika",url:"/admin/analytika"},{value:"teams",label:"T\xfdmy",url:"/admin/tymy"},{value:"matches",label:"Z\xe1pasy",url:"/admin/zapasy"},{value:"activities",label:"Aktivity",url:"/admin/aktivity"},{value:"players",label:"Hr\xe1\u010di",url:"/admin/hraci"},{value:"articles",label:"\u010cl\xe1nky",url:"/admin/clanky"},{value:"comments",label:"Koment\xe1\u0159e",url:"/admin/komentare"},{value:"about",label:"O klubu",url:"/admin/o-klubu"},{value:"videos",label:"Videa",url:"/admin/videa"},{value:"gallery",label:"Galerie",url:"/admin/galerie"},{value:"banners",label:"Bannery",url:"/admin/bannery"},{value:"clothing",label:"Oble\u010den\xed",url:"/admin/obleceni"},{value:"sponsors",label:"Sponzo\u0159i",url:"/admin/sponzori"},{value:"messages",label:"Zpr\xe1vy",url:"/admin/zpravy"},{value:"contacts",label:"Kontakty",url:"/admin/kontakty"},{value:"newsletter",label:"Zpravodaj",url:"/admin/newsletter"},{value:"polls",label:"Ankety",url:"/admin/ankety"},{value:"sweepstakes",label:"Sout\u011b\u017ee",url:"/admin/sweepstakes"},{value:"engagement",label:"Odm\u011bny & \xdasp\u011bchy",url:"/admin/engagement"},{value:"navigation",label:"Navigace",url:"/admin/navigace"},{value:"competition_aliases",label:"Alias sout\u011b\u017e\xed",url:"/admin/aliasy-soutezi"},{value:"users",label:"U\u017eivatel\xe9",url:"/admin/uzivatele"},{value:"settings",label:"Nastaven\xed",url:"/admin/nastaveni"},{value:"files",label:"Soubory",url:"/admin/soubory"},{value:"scoreboard",label:"Tabule (Scoreboard)",url:"/admin/scoreboard"},{value:"scoreboard_remote",label:"Scoreboard Remote",url:"/admin/scoreboard/remote"},{value:"prefetch",label:"Prefetch",url:"/admin/prefetch"},{value:"docs",label:"Dokumentace",url:"/admin/docs"},{value:"webmail",label:"Webmail",url:"https://webmail.example.com"}],se=(ee.iYk,ee.ao$,ee.Vk6,ee.feZ,ee.kkU,ee.QEs,ee.O4U,ee.JV,[{value:"FaHome",label:"Dom\u016f",icon:ee.rQ8},{value:"FaInfoCircle",label:"O klubu",icon:ee.__w},{value:"FaCalendarAlt",label:"Kalend\xe1\u0159",icon:ee.bfZ},{value:"FaFutbol",label:"Hr\xe1\u010di",icon:ee.i0U},{value:"FaUsers",label:"T\xfdmy",icon:ee.YXz},{value:"FaTable",label:"Tabulky",icon:ee.ist},{value:"FaNewspaper",label:"\u010cl\xe1nky",icon:ee.Nhm},{value:"FaVideo",label:"Videa",icon:ee.HiP},{value:"FaCamera",label:"Galerie",icon:ee.p5B},{value:"FaHandshake",label:"Sponzo\u0159i",icon:ee.DDN},{value:"FaEnvelope",label:"Kontakt",icon:ee.maD},{value:"FaSearch",label:"Hledat",icon:ee.KSO},{value:"FaBars",label:"Menu",icon:ee.OXb},{value:"FaLink",label:"Odkaz",icon:ee.AnD},{value:"FaCog",label:"Nastaven\xed",icon:ee.Pcn},{value:"FaPoll",label:"Ankety",icon:ee.l2R},{value:"FaUserShield",label:"U\u017eivatel\xe9",icon:ee.e7y},{value:"FaFolder",label:"Soubory",icon:ee.M1W},{value:"FaBook",label:"Str\xe1nka",icon:ee.vd0},{value:"FaTshirt",label:"Oble\u010den\xed",icon:ee.umw}]),le=Object.fromEntries(se.map(e=>[e.value,e.icon])),ce=e=>{let{item:t,index:n,total:i,onMoveUp:o,onMoveDown:r,onEdit:s,onDelete:d,onAddChild:x,isExpanded:v,onToggleExpand:j,cardBg:b,borderColor:y,hoverBg:f,level:k=0,onChildMoveUp:_,onChildMoveDown:w,onToggleVisible:z,childrenDroppableId:S,draggableChildPrefix:A,onEditTarget:C,onDeleteTarget:E}=e;const N=t.children&&t.children.length>0,R=32*k,F="dropdown"===t.type;return(0,oe.jsxs)(c.a,{ml:"".concat(R,"px"),children:[(0,oe.jsx)(h.Z,{bg:t.visible?b:(0,p.dU)("gray.100","gray.700"),borderWidth:"1px",borderColor:y,_hover:{bg:f},transition:"all 0.2s",children:(0,oe.jsx)(m.b,{py:3,children:(0,oe.jsxs)(g.s,{align:"center",gap:3,children:[N?(0,oe.jsx)(u.K,{"aria-label":"Toggle children",icon:v?(0,oe.jsx)(X.D,{}):(0,oe.jsx)(G.v,{}),size:"sm",variant:"ghost",onClick:j}):(0,oe.jsx)(c.a,{w:"32px"}),(0,oe.jsxs)(D.T,{spacing:0,children:[(0,oe.jsx)(u.K,{"aria-label":"Nahoru",icon:(0,oe.jsx)(Y.M,{}),size:"xs",isDisabled:0===n,onClick:o,variant:"ghost"}),(0,oe.jsx)(u.K,{"aria-label":"Dol\u016f",icon:(0,oe.jsx)(X.D,{}),size:"xs",isDisabled:n===i-1,onClick:r,variant:"ghost"})]}),(0,oe.jsxs)(D.T,{align:"start",flex:1,spacing:1,children:[(0,oe.jsxs)(T.z,{children:[(0,oe.jsx)(q.E,{fontWeight:"bold",fontSize:"md",children:t.label}),(0,oe.jsx)(l.E,{colorScheme:"external"===t.type?"orange":"dropdown"===t.type?"purple":"page"===t.type?"blue":"green",children:t.type}),!t.visible&&(0,oe.jsx)(l.E,{colorScheme:"red",children:(0,oe.jsxs)(T.z,{spacing:1,children:[(0,oe.jsx)(H.O,{}),(0,oe.jsx)(q.E,{children:"Skryto"})]})})]}),(0,oe.jsxs)(T.z,{spacing:2,fontSize:"sm",color:"gray.500",children:[t.url&&(0,oe.jsxs)(T.z,{children:[(0,oe.jsx)(q.E,{isTruncated:!0,maxW:"300px",children:t.url}),"external"===t.type&&(0,oe.jsx)(Q.p,{})]}),t.page_type&&!t.url&&(0,oe.jsxs)(q.E,{children:["Page: ",t.page_type]}),N&&(0,oe.jsxs)(l.E,{colorScheme:"cyan",children:[t.children.length," ",1===t.children.length?"podpolo\u017eka":"podpolo\u017eek"]})]})]}),(0,oe.jsxs)(T.z,{spacing:1,children:[(0,oe.jsx)(U.m,{label:t.visible?"Skr\xfdt":"Zobrazit",children:(0,oe.jsx)(u.K,{"aria-label":t.visible?"Skr\xfdt":"Zobrazit",icon:t.visible?(0,oe.jsx)(H.O,{}):(0,oe.jsx)(V.t,{}),size:"sm",variant:"ghost",onClick:()=>z(t)})}),"dropdown"===t.type&&(0,oe.jsx)(U.m,{label:"P\u0159idat podpolo\u017eku",children:(0,oe.jsx)(u.K,{"aria-label":"P\u0159idat podpolo\u017eku",icon:(0,oe.jsx)(Z.R,{}),size:"sm",colorScheme:"green",variant:"ghost",onClick:x})}),(0,oe.jsx)(U.m,{label:"Upravit",children:(0,oe.jsx)(u.K,{"aria-label":"Upravit",icon:(0,oe.jsx)(J.q,{}),size:"sm",variant:"ghost",onClick:()=>"function"===typeof C?C(t):s&&s()})}),(0,oe.jsx)(U.m,{label:"Smazat",children:(0,oe.jsx)(u.K,{"aria-label":"Smazat",icon:(0,oe.jsx)($.d,{}),size:"sm",colorScheme:"red",variant:"ghost",onClick:()=>"function"===typeof E?E(t):d&&d()})})]})]})})}),F&&(0,oe.jsx)(K.gL,{droppableId:S||"children-".concat(t.id),children:e=>(0,oe.jsxs)(D.T,(0,a.A)((0,a.A)({spacing:2,align:"stretch",mt:2,ref:e.innerRef},e.droppableProps),{},{children:[N&&v&&t.children.map((e,n)=>(0,oe.jsx)(K.sx,{draggableId:"".concat(A||"child","-").concat(e.id),index:n,children:i=>(0,oe.jsx)(c.a,(0,a.A)((0,a.A)((0,a.A)({ref:i.innerRef},i.draggableProps),i.dragHandleProps),{},{children:(0,oe.jsx)(ce,{item:e,index:n,total:t.children.length,onMoveUp:()=>_&&_(t.id,n),onMoveDown:()=>w&&w(t.id,n),onEdit:()=>"function"===typeof C?C(e):s&&s(),onDelete:()=>"function"===typeof E?E(e):d&&d(),onAddChild:()=>{},isExpanded:!1,onToggleExpand:()=>{},cardBg:b,borderColor:y,hoverBg:f,level:k+1,onChildMoveUp:_,onChildMoveDown:w,onToggleVisible:z,onEditTarget:C,onDeleteTarget:E},e.id)}))},String(e.id))),!N&&(0,oe.jsx)(c.a,{minH:"8px"}),e.placeholder]}))})]})},de=()=>{var e;const{t:t}=(0,ie.Bd)(),n=[{value:"home",label:"Dom\u016f",url:"/"},{value:"about",label:"O klubu",url:"/o-klubu"},{value:"calendar",label:"Kalend\xe1\u0159",url:"/kalendar"},{value:"matches",label:"Z\xe1pasy",url:"/zapasy"},{value:"activities",label:"Aktivity",url:"/aktivity"},{value:"players",label:"Hr\xe1\u010di",url:"/hraci"},{value:"tables",label:"Tabulky",url:"/tabulky"},{value:"blog",label:"\u010cl\xe1nky",url:"/blog"},{value:"videos",label:"Videa",url:"/videa"},{value:"gallery",label:t("homepage.gallery"),url:"/galerie"},{value:"sponsors",label:"Sponzo\u0159i",url:"/sponzori"},{value:"contact",label:"Kontakt",url:"/kontakt"},{value:"search",label:"Hledat",url:"/hledat"}],[u,h]=(0,i.useState)([]),[m,g]=(0,i.useState)([]),[U,V]=(0,i.useState)([]),[H,$]=(0,i.useState)(!0),[J,G]=(0,i.useState)(null),[X,Y]=(0,i.useState)(null),[Q,ee]=(0,i.useState)(new Set),[de,ue]=(0,i.useState)(!1),he=(0,W.d)(),me=(0,p.dU)("white","gray.800"),pe=(0,p.dU)("gray.200","gray.600"),xe=(0,p.dU)("gray.50","gray.700"),{isOpen:ge,onOpen:ve,onClose:je}=(0,o.j)(),{isOpen:be,onOpen:ye,onClose:fe}=(0,o.j)(),{confirm:ke}=(0,ae.G)();(0,i.useEffect)(()=>{_e()},[]);const _e=async()=>{try{$(!0);const[e,t]=await Promise.all([(0,te.g9)(),(0,te.w8)()]);if(!e||0===e.length)try{const e=await(0,te.D)();if(e.seeded){he({title:"V\xfdchoz\xed navigace vytvo\u0159ena",description:"Automaticky vytvo\u0159eno ".concat(e.count," polo\u017eek navigace"),status:"success",duration:4e3,isClosable:!0});const[t,n]=await Promise.all([(0,te.g9)(),(0,te.w8)()]),a=(t||[]).filter(e=>!e.requires_admin),i=(t||[]).filter(e=>e.requires_admin);return h(a),g(i),void V(n||[])}}catch(n){console.error("Chyba p\u0159i automatick\xe9m seedov\xe1n\xed:",n)}const a=(e||[]).filter(e=>!e.requires_admin),i=(e||[]).filter(e=>e.requires_admin);h(a),g(i),V(t||[])}catch(a){var e,t;console.error("Chyba p\u0159i na\u010d\xedt\xe1n\xed navigace:",a),he({title:"Chyba p\u0159i na\u010d\xedt\xe1n\xed dat",description:(null===a||void 0===a||null===(e=a.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||(null===a||void 0===a?void 0:a.message)||"Nezn\xe1m\xe1 chyba",status:"error",duration:5e3,isClosable:!0})}finally{$(!1)}},we=async e=>{const t=!e.visible;try{await(0,te.ds)(e.id,{visible:t});const n=i=>(i||[]).map(i=>{if(i.id===e.id)return(0,a.A)((0,a.A)({},i),{},{visible:t});const o=i.children?n(i.children):i.children;return(0,a.A)((0,a.A)({},i),{},{children:o})});h(e=>n(e)),g(e=>n(e)),he({title:t?"Zobrazeno":"Skryto",status:"success",duration:1500})}catch(n){he({title:"Chyba p\u0159i zm\u011bn\u011b viditelnosti",status:"error",duration:3e3})}},ze=async(e,t,n)=>{const i=async(i,o)=>{const r=i.findIndex(t=>t.id===e);if(-1===r)return!1;const s=i[r],l=Array.isArray(s.children)?[...s.children]:[];if(0===l.length)return!0;if("up"===n&&0===t)return!0;if("down"===n&&t===l.length-1)return!0;const c="up"===n?t-1:t+1;[l[t],l[c]]=[l[c],l[t]];const d=(0,a.A)((0,a.A)({},s),{},{children:l}),u=[...i];u[r]=d,o(u);const h=l.map((e,t)=>({id:e.id,display_order:t}));try{await(0,te.O3)(h),he({title:"Po\u0159ad\xed aktualizov\xe1no",status:"success",duration:2e3})}catch(m){he({title:"Chyba p\u0159i aktualizaci po\u0159ad\xed",status:"error",duration:3e3}),_e()}return!0};await i(u,h)||await i(m,g)},Se=async(e,t)=>{if("up"===t&&0===e)return;if("down"===t&&e===u.length-1)return;const n=Array.from(u),a="up"===t?e-1:e+1;[n[e],n[a]]=[n[a],n[e]],h(n);const i=n.map((e,t)=>({id:e.id,display_order:t}));try{await(0,te.O3)(i),he({title:"Po\u0159ad\xed aktualizov\xe1no",status:"success",duration:2e3})}catch(o){he({title:"Chyba p\u0159i aktualizaci po\u0159ad\xed",status:"error",duration:3e3}),_e()}},Ae=async(e,t)=>{if("up"===t&&0===e)return;if("down"===t&&e===m.length-1)return;const n=Array.from(m),a="up"===t?e-1:e+1;[n[e],n[a]]=[n[a],n[e]],g(n);const i=n.map((e,t)=>({id:e.id,display_order:t}));try{await(0,te.O3)(i),he({title:"Po\u0159ad\xed aktualizov\xe1no",status:"success",duration:2e3})}catch(o){he({title:"Chyba p\u0159i aktualizaci po\u0159ad\xed",status:"error",duration:3e3}),_e()}},Ce=(e,t,n)=>{if(ue(n||!1),e)G(e);else{const e=n?m.length:u.length;G({label:"",type:n?"internal":"page",visible:!0,display_order:e,target:"_self",parent_id:t,requires_admin:n||!1,allow_editor:!1})}ve()},Ee=e=>{ee(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Te=async e=>{if(await ke({title:"Smazat polo\u017eku",message:"Opravdu smazat tuto polo\u017eku?",confirmText:"Smazat",cancelText:"Zru\u0161it",isDanger:!0}))try{await(0,te.T)(e),he({title:"Polo\u017eka smaz\xe1na",status:"success",duration:2e3}),_e()}catch(t){he({title:"Chyba p\u0159i maz\xe1n\xed",status:"error",duration:3e3})}};return H?(0,oe.jsx)(B.A,{children:(0,oe.jsx)(x.m,{maxW:"7xl",py:8,children:(0,oe.jsxs)(D.T,{spacing:4,children:[(0,oe.jsx)(E.y,{size:"xl"}),(0,oe.jsx)(q.E,{children:"Na\u010d\xedt\xe1n\xed..."})]})})}):(0,oe.jsxs)(B.A,{children:[(0,oe.jsx)(x.m,{maxW:"7xl",py:8,children:(0,oe.jsxs)(D.T,{spacing:6,align:"stretch",children:[(0,oe.jsxs)(T.z,{justify:"space-between",align:"center",children:[(0,oe.jsx)(O.D,{size:"lg",children:"Spr\xe1va navigace"}),(0,oe.jsx)(d.$,{onClick:_e,size:"sm",colorScheme:"gray",children:"Obnovit data"})]}),(0,oe.jsxs)(r.F,{status:"info",variant:"left-accent",children:[(0,oe.jsx)(s._,{}),(0,oe.jsx)(c.a,{flex:"1",children:(0,oe.jsx)(T.z,{spacing:4,children:(0,oe.jsxs)(q.E,{fontSize:"sm",children:[(0,oe.jsx)("strong",{children:"Na\u010dteno:"})," ",u.length," webov\xfdch, ",m.length," admin"]})})})]}),(0,oe.jsxs)(r.F,{status:"info",children:[(0,oe.jsx)(s._,{}),(0,oe.jsxs)(c.a,{children:[(0,oe.jsx)(q.E,{fontWeight:"bold",children:"Odd\u011blen\xe1 spr\xe1va navigace"}),(0,oe.jsxs)(q.E,{fontSize:"sm",mt:1,children:["\u2022 ",(0,oe.jsx)("strong",{children:"Webov\xe1 navigace:"})," Menu na ve\u0159ejn\xe9m webu",(0,oe.jsx)("br",{}),"\u2022 ",(0,oe.jsx)("strong",{children:"Admin panel:"})," Postrann\xed menu v administraci"]})]})]}),(0,oe.jsx)(K.JY,{onDragEnd:async e=>{if(!e.destination)return;const{source:t,destination:n}=e,i=e=>e.startsWith("admin-children-")?parseInt(e.replace("admin-children-",""),10):null,o=e=>e.startsWith("frontend-children-")?parseInt(e.replace("frontend-children-",""),10):null;if("frontend-nav"===t.droppableId){const e=Array.from(u),[a]=e.splice(t.index,1);e.splice(n.index,0,a),h(e);const i=e.map((e,t)=>({id:e.id,display_order:t}));try{await(0,te.O3)(i),he({title:"Po\u0159ad\xed aktualizov\xe1no",status:"success",duration:2e3})}catch(r){he({title:"Chyba p\u0159i aktualizaci po\u0159ad\xed",status:"error",duration:3e3}),_e()}}else if("admin-nav"===t.droppableId&&"admin-nav"===n.droppableId){const e=Array.from(m),[a]=e.splice(t.index,1);e.splice(n.index,0,a),g(e);const i=e.map((e,t)=>({id:e.id,display_order:t}));try{await(0,te.O3)(i),he({title:"Po\u0159ad\xed aktualizov\xe1no",status:"success",duration:2e3})}catch(r){he({title:"Chyba p\u0159i aktualizaci po\u0159ad\xed",status:"error",duration:3e3}),_e()}}else if(t.droppableId.startsWith("admin-children-")||n.droppableId.startsWith("admin-children-")||"admin-nav"===t.droppableId&&n.droppableId.startsWith("admin-children-")||t.droppableId.startsWith("admin-children-")&&"admin-nav"===n.droppableId){const e=i(t.droppableId);let o=i(n.droppableId);const s=Array.from(m),l=e=>null===e?-1:s.findIndex(t=>t.id===e);let c=n.index;if(null===o){const e=s[n.index],t=n.index>0?s[n.index-1]:void 0,a=n.index<s.length-1?s[n.index+1]:void 0;let i=null;if(e&&"dropdown"===e.type?i=e.id:t&&"dropdown"===t.type?i=t.id:a&&"dropdown"===a.type&&(i=a.id),i){o=i;const e=l(o);c=e>=0&&Array.isArray(s[e].children)?s[e].children.length:0}}if(null===o&&null!==e){o=e;const t=l(o);c=t>=0&&Array.isArray(s[t].children)?s[t].children.length:0}let d=null;if(null===e){const[e]=s.splice(t.index,1);d=e}else{const n=l(e);if(n>=0){const e=Array.isArray(s[n].children)?Array.from(s[n].children):[],[i]=e.splice(t.index,1);d=i,s[n]=(0,a.A)((0,a.A)({},s[n]),{},{children:e})}}if(!d)return;if(null===o)s.splice(n.index,0,d);else{const e=l(o);if(e>=0){const t=Array.isArray(s[e].children)?Array.from(s[e].children):[];t.splice(c,0,d),s[e]=(0,a.A)((0,a.A)({},s[e]),{},{children:t})}}g(s);try{if(await(0,te.ds)(d.id,{parent_id:null===o?null:o,display_order:null===o?n.index:c}),null===e){const e=s.map((e,t)=>({id:e.id,display_order:t}));await(0,te.O3)(e)}else{const t=l(e);if(t>=0){const e=(s[t].children||[]).map((e,t)=>({id:e.id,display_order:t}));await(0,te.O3)(e)}}if(null===o){const e=s.map((e,t)=>({id:e.id,display_order:t}));await(0,te.O3)(e)}else{const e=l(o);if(e>=0){const t=(s[e].children||[]).map((e,t)=>({id:e.id,display_order:t}));await(0,te.O3)(t)}}he({title:"P\u0159esunuto",status:"success",duration:2e3})}catch(r){he({title:"Chyba p\u0159i p\u0159esunu",status:"error",duration:3e3}),_e()}}else if(t.droppableId.startsWith("frontend-children-")||n.droppableId.startsWith("frontend-children-")||"frontend-nav"===t.droppableId&&n.droppableId.startsWith("frontend-children-")||t.droppableId.startsWith("frontend-children-")&&"frontend-nav"===n.droppableId){const e=o(t.droppableId);let i=o(n.droppableId);const s=Array.from(u),l=e=>null===e?-1:s.findIndex(t=>t.id===e);let c=n.index;if(null===i){const e=s[n.index],t=n.index>0?s[n.index-1]:void 0;let a=null;if(e&&"dropdown"===e.type?a=e.id:t&&"dropdown"===t.type&&(a=t.id),a){i=a;const e=l(i);c=e>=0&&Array.isArray(s[e].children)?s[e].children.length:0}}let d=null;if(null===e){const[e]=s.splice(t.index,1);d=e}else{const n=l(e);if(n>=0){const e=Array.isArray(s[n].children)?Array.from(s[n].children):[],[i]=e.splice(t.index,1);d=i,s[n]=(0,a.A)((0,a.A)({},s[n]),{},{children:e})}}if(!d)return;if(null===i)s.splice(n.index,0,d);else{const e=l(i);if(e>=0){const t=Array.isArray(s[e].children)?Array.from(s[e].children):[];t.splice(c,0,d),s[e]=(0,a.A)((0,a.A)({},s[e]),{},{children:t})}}h(s);try{if(await(0,te.ds)(d.id,{parent_id:null===i?null:i,display_order:null===i?n.index:c}),null===e){const e=s.map((e,t)=>({id:e.id,display_order:t}));await(0,te.O3)(e)}else{const t=l(e);if(t>=0){const e=(s[t].children||[]).map((e,t)=>({id:e.id,display_order:t}));await(0,te.O3)(e)}}if(null===i){const e=s.map((e,t)=>({id:e.id,display_order:t}));await(0,te.O3)(e)}else{const e=l(i);if(e>=0){const t=(s[e].children||[]).map((e,t)=>({id:e.id,display_order:t}));await(0,te.O3)(t)}}he({title:"P\u0159esunuto",status:"success",duration:2e3})}catch(r){he({title:"Chyba p\u0159i p\u0159esunu",status:"error",duration:3e3}),_e()}}},children:(0,oe.jsxs)(M.t,{children:[(0,oe.jsxs)(F.w,{children:[(0,oe.jsx)(R.o,{children:"Webov\xe1 navigace"}),(0,oe.jsx)(R.o,{children:"Admin panel"})]}),(0,oe.jsxs)(I.T,{children:[(0,oe.jsx)(P.K,{children:(0,oe.jsxs)(D.T,{spacing:4,align:"stretch",children:[(0,oe.jsxs)(T.z,{children:[(0,oe.jsx)(d.$,{leftIcon:(0,oe.jsx)(Z.R,{}),colorScheme:"blue",onClick:()=>Ce(),children:"P\u0159idat hlavn\xed polo\u017eku"}),(0,oe.jsx)(q.E,{fontSize:"sm",color:"gray.500",children:"P\u0159etahujte polo\u017eky nahoru/dol\u016f pro zm\u011bnu po\u0159ad\xed. Klikn\u011bte na \u0161ipku pro zobrazen\xed podpolo\u017eek."})]}),(0,oe.jsxs)(r.F,{status:"info",borderRadius:"md",children:[(0,oe.jsx)(s._,{}),(0,oe.jsxs)(c.a,{children:[(0,oe.jsx)(q.E,{fontWeight:"bold",children:"Tipy pro spr\xe1vu navigace:"}),(0,oe.jsxs)(q.E,{fontSize:"sm",mt:1,children:['\u2022 Pou\u017eijte typ "Dropdown" pro polo\u017eky s podpolo\u017ekami',(0,oe.jsx)("br",{}),"\u2022 Podpolo\u017eky se zobraz\xed p\u0159i najet\xed my\u0161\xed na hlavn\xed polo\u017eku",(0,oe.jsx)("br",{}),"\u2022 Polo\u017eky m\u016f\u017eete skr\xfdt bez smaz\xe1n\xed pomoc\xed p\u0159ep\xedna\u010de viditelnosti"]})]})]}),(0,oe.jsx)(D.T,{spacing:2,align:"stretch",children:0===u.length?(0,oe.jsxs)(r.F,{status:"warning",variant:"left-accent",children:[(0,oe.jsx)(s._,{}),(0,oe.jsxs)(c.a,{flex:"1",children:[(0,oe.jsx)(q.E,{fontWeight:"bold",children:"\u017d\xe1dn\xe9 polo\u017eky navigace"}),(0,oe.jsx)(q.E,{fontSize:"sm",mt:1,mb:2,children:"Nebyly nalezeny \u017e\xe1dn\xe9 polo\u017eky navigace. M\u016f\u017eete vytvo\u0159it v\xfdchoz\xed navigaci nebo p\u0159idat polo\u017eky ru\u010dn\u011b."}),(0,oe.jsxs)(T.z,{spacing:2,children:[(0,oe.jsx)(d.$,{size:"sm",colorScheme:"blue",onClick:async()=>{if(await ke({title:"Vytvo\u0159it v\xfdchoz\xed navigaci",message:"Vytvo\u0159it v\xfdchoz\xed naviga\u010dn\xed polo\u017eky? Toto lze prov\xe9st pouze pokud datab\xe1ze je pr\xe1zdn\xe1.",confirmText:"Vytvo\u0159it",cancelText:"Zru\u0161it",isDanger:!1}))try{const e=await(0,te.D)();e.seeded?(he({title:"V\xfdchoz\xed navigace vytvo\u0159ena",description:"Vytvo\u0159eno ".concat(e.count," polo\u017eek"),status:"success",duration:3e3,isClosable:!0}),_e()):he({title:"Navigace ji\u017e existuje",description:e.message,status:"info",duration:3e3,isClosable:!0})}catch(n){var e,t;console.error("Chyba p\u0159i seedov\xe1n\xed navigace:",n),he({title:"Chyba p\u0159i vytv\xe1\u0159en\xed v\xfdchoz\xed navigace",description:(null===n||void 0===n||null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||(null===n||void 0===n?void 0:n.message)||"Nezn\xe1m\xe1 chyba",status:"error",duration:5e3,isClosable:!0})}},children:"Vytvo\u0159it v\xfdchoz\xed navigaci"}),(0,oe.jsx)(d.$,{size:"sm",variant:"outline",onClick:()=>Ce(),children:"P\u0159idat polo\u017eku ru\u010dn\u011b"})]})]})]}):(0,oe.jsx)(K.gL,{droppableId:"frontend-nav",children:e=>(0,oe.jsxs)(c.a,(0,a.A)((0,a.A)({ref:e.innerRef},e.droppableProps),{},{children:[u.map((e,t)=>(0,oe.jsx)(K.sx,{draggableId:"nav-".concat(e.id),index:t,children:n=>(0,oe.jsx)(c.a,(0,a.A)((0,a.A)((0,a.A)({ref:n.innerRef},n.draggableProps),n.dragHandleProps),{},{children:(0,oe.jsx)(ce,{item:e,index:t,total:u.length,onMoveUp:()=>Se(t,"up"),onMoveDown:()=>Se(t,"down"),onEdit:()=>Ce(e),onDelete:()=>Te(e.id),onAddChild:()=>Ce(void 0,e.id),isExpanded:Q.has(e.id),onToggleExpand:()=>Ee(e.id),cardBg:me,borderColor:pe,hoverBg:xe,onChildMoveUp:(e,t)=>ze(e,t,"up"),onChildMoveDown:(e,t)=>ze(e,t,"down"),onToggleVisible:we,childrenDroppableId:"frontend-children-".concat(e.id),draggableChildPrefix:"front-child",onEditTarget:e=>Ce(e),onDeleteTarget:e=>Te(e.id)})}))},String(e.id))),e.placeholder]}))})})]})}),(0,oe.jsx)(P.K,{children:(0,oe.jsxs)(D.T,{spacing:4,align:"stretch",children:[(0,oe.jsxs)(T.z,{children:[(0,oe.jsx)(d.$,{leftIcon:(0,oe.jsx)(Z.R,{}),colorScheme:"purple",onClick:()=>Ce(void 0,void 0,!0),children:"P\u0159idat polo\u017eku do admin panelu"}),(0,oe.jsx)(q.E,{fontSize:"sm",color:"gray.500",children:"Spr\xe1va bo\u010dn\xedho menu v administraci"})]}),(0,oe.jsxs)(r.F,{status:"info",borderRadius:"md",colorScheme:"purple",children:[(0,oe.jsx)(s._,{}),(0,oe.jsxs)(c.a,{children:[(0,oe.jsx)(q.E,{fontWeight:"bold",children:"Spr\xe1va admin panelu:"}),(0,oe.jsxs)(q.E,{fontSize:"sm",mt:1,children:["\u2022 Vyberte z p\u0159ednastaven\xfdch str\xe1nek nebo p\u0159idejte vlastn\xed",(0,oe.jsx)("br",{}),"\u2022 Skryjte nepot\u0159ebn\xe9 sekce pomoc\xed viditelnosti",(0,oe.jsx)("br",{}),"\u2022 P\u0159idejte extern\xed odkazy (nap\u0159. Webmail)",(0,oe.jsx)("br",{}),"\u2022 Kategorizujte pomoc\xed dropdown menu"]})]})]}),(0,oe.jsxs)(D.T,{spacing:2,align:"stretch",children:[(0,oe.jsx)(K.gL,{droppableId:"admin-nav",children:e=>(0,oe.jsxs)(c.a,(0,a.A)((0,a.A)({ref:e.innerRef},e.droppableProps),{},{children:[m.map((e,t)=>(0,oe.jsx)(K.sx,{draggableId:"admin-".concat(e.id),index:t,children:n=>(0,oe.jsx)(c.a,(0,a.A)((0,a.A)((0,a.A)({ref:n.innerRef},n.draggableProps),n.dragHandleProps),{},{children:(0,oe.jsx)(ce,{item:e,index:t,total:m.length,onMoveUp:()=>Ae(t,"up"),onMoveDown:()=>Ae(t,"down"),onEdit:()=>Ce(e,void 0,!0),onDelete:()=>Te(e.id),onAddChild:()=>Ce(void 0,e.id,!0),isExpanded:Q.has(e.id),onToggleExpand:()=>Ee(e.id),cardBg:me,borderColor:pe,hoverBg:xe,onChildMoveUp:(e,t)=>ze(e,t,"up"),onChildMoveDown:(e,t)=>ze(e,t,"down"),onToggleVisible:we,childrenDroppableId:"admin-children-".concat(e.id),draggableChildPrefix:"admin-child",onEditTarget:e=>Ce(e,void 0,!0),onDeleteTarget:e=>Te(e.id)})}))},String(e.id))),e.placeholder]}))}),0===m.length&&(0,oe.jsxs)(r.F,{status:"warning",children:[(0,oe.jsx)(s._,{}),'\u017d\xe1dn\xe9 vlastn\xed polo\u017eky v admin panelu. Pou\u017eijte tla\u010d\xedtko "P\u0159idat polo\u017eku" pro vytvo\u0159en\xed vlastn\xed navigace.']})]})]})})]})]})})]})}),(0,oe.jsxs)(S.aF,{isOpen:ge,onClose:je,size:"xl",children:[(0,oe.jsx)(z.m,{}),(0,oe.jsxs)(A.$,{children:[(0,oe.jsxs)(w.r,{children:[null!==J&&void 0!==J&&J.id?"Upravit polo\u017eku":"Nov\xe1 polo\u017eka",de&&(0,oe.jsx)(l.E,{ml:2,colorScheme:"purple",children:"Admin panel"})]}),(0,oe.jsx)(k.s,{}),(0,oe.jsx)(f.c,{children:(0,oe.jsxs)(D.T,{spacing:4,children:[de&&!(null!==J&&void 0!==J&&J.id)&&(0,oe.jsxs)(r.F,{status:"info",fontSize:"sm",children:[(0,oe.jsx)(s._,{}),"Vytv\xe1\u0159ejte polo\u017eku pro bo\u010dn\xed menu v administraci. M\u016f\u017eete vybrat p\u0159ednastaven\xe9 str\xe1nky nebo p\u0159idat vlastn\xed odkazy."]}),(0,oe.jsxs)(v.MJ,{isRequired:!0,children:[(0,oe.jsx)(j.l,{children:"N\xe1zev"}),(0,oe.jsx)(y.p,{value:(null===J||void 0===J?void 0:J.label)||"",onChange:e=>G((0,a.A)((0,a.A)({},J),{},{label:e.target.value})),placeholder:de?"Nap\u0159. N\xe1st\u011bnka, Webmail":"Nap\u0159. Dom\u016f, O klubu"})]}),(0,oe.jsxs)(v.MJ,{isRequired:!0,children:[(0,oe.jsxs)(j.l,{display:"flex",alignItems:"center",justifyContent:"space-between",sx:{".chakra-form__required-indicator":{display:"none"}},children:[(0,oe.jsxs)(T.z,{spacing:1,children:[(0,oe.jsx)(c.a,{children:"Typ"}),(0,oe.jsx)(q.E,{as:"span",color:"red.500",children:"*"})]}),(0,oe.jsx)(ne.tX,{label:"Jak\xfd typ zvolit",title:"Typ naviga\u010dn\xed polo\u017eky",items:["Str\xe1nka / Admin str\xe1nka \u2013 odkaz na existuj\xedc\xed str\xe1nku v r\xe1mci webu nebo administrace.","Intern\xed odkaz \u2013 vlastn\xed URL v r\xe1mci webu (nap\u0159. /info/partners).","Extern\xed odkaz \u2013 odkaz mimo web (nap\u0159. klubov\xfd webmail, svazov\xfd web).","Dropdown / Kategorie \u2013 skupina, kter\xe1 sama neotev\xedr\xe1 str\xe1nku, ale obsahuje podpolo\u017eky."]})]}),(0,oe.jsx)(C.l,{value:(null===J||void 0===J?void 0:J.type)||(de?"internal":"page"),onChange:e=>G((0,a.A)((0,a.A)({},J),{},{type:e.target.value})),children:de?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("option",{value:"internal",children:"Admin str\xe1nka (vyberte existuj\xedc\xed)"}),(0,oe.jsx)("option",{value:"external",children:"Extern\xed odkaz (nap\u0159. Webmail)"}),(0,oe.jsx)("option",{value:"dropdown",children:"Kategorie (m\xe1 podpolo\u017eky)"})]}):(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("option",{value:"page",children:"Str\xe1nka (vyberte existuj\xedc\xed)"}),(0,oe.jsx)("option",{value:"internal",children:"Intern\xed odkaz (vlastn\xed URL)"}),(0,oe.jsx)("option",{value:"external",children:"Extern\xed odkaz"}),(0,oe.jsx)("option",{value:"dropdown",children:"Dropdown (m\xe1 podpolo\u017eky)"})]})})]}),"page"===(null===J||void 0===J?void 0:J.type)&&!de&&(0,oe.jsxs)(v.MJ,{isRequired:!0,children:[(0,oe.jsx)(j.l,{children:"Webov\xe1 str\xe1nka"}),(0,oe.jsxs)(C.l,{value:(null===J||void 0===J?void 0:J.page_type)||"",onChange:e=>{const t=n.find(t=>t.value===e.target.value);G((0,a.A)((0,a.A)({},J),{},{page_type:e.target.value,url:(null===t||void 0===t?void 0:t.url)||"",label:(null===J||void 0===J?void 0:J.label)||(null===t||void 0===t?void 0:t.label)||""}))},children:[(0,oe.jsx)("option",{value:"",children:"-- Vyberte str\xe1nku --"}),n.map(e=>(0,oe.jsxs)("option",{value:e.value,children:[e.label," (",e.url,")"]},e.value))]})]}),"internal"===(null===J||void 0===J?void 0:J.type)&&de&&(0,oe.jsxs)(v.MJ,{isRequired:!0,children:[(0,oe.jsx)(j.l,{children:"Admin str\xe1nka"}),(0,oe.jsxs)(C.l,{value:(null===J||void 0===J?void 0:J.page_type)||"",onChange:e=>{var t;const n=re.find(t=>t.value===e.target.value),i=null===n||void 0===n||null===(t=n.url)||void 0===t?void 0:t.startsWith("http");G((0,a.A)((0,a.A)({},J),{},{page_type:e.target.value,url:(null===n||void 0===n?void 0:n.url)||"",label:(null===J||void 0===J?void 0:J.label)||(null===n||void 0===n?void 0:n.label)||"",type:i?"external":"internal"}))},children:[(0,oe.jsx)("option",{value:"",children:"-- Vyberte admin str\xe1nku --"}),(0,oe.jsxs)("optgroup",{label:"Hlavn\xed",children:[(0,oe.jsx)("option",{value:"dashboard",children:"N\xe1st\u011bnka (/admin)"}),(0,oe.jsx)("option",{value:"analytics",children:"Analytika (/admin/analytika)"})]}),(0,oe.jsxs)("optgroup",{label:"Obsah",children:[(0,oe.jsx)("option",{value:"teams",children:"T\xfdmy (/admin/tymy)"}),(0,oe.jsx)("option",{value:"matches",children:"Z\xe1pasy (/admin/zapasy)"}),(0,oe.jsx)("option",{value:"activities",children:"Aktivity (/admin/aktivity)"}),(0,oe.jsx)("option",{value:"players",children:"Hr\xe1\u010di (/admin/hraci)"}),(0,oe.jsx)("option",{value:"articles",children:"\u010cl\xe1nky (/admin/clanky)"}),(0,oe.jsx)("option",{value:"categories",children:"Kategorie (/admin/kategorie)"}),(0,oe.jsx)("option",{value:"comments",children:"Koment\xe1\u0159e (/admin/komentare)"}),(0,oe.jsx)("option",{value:"videos",children:"Videa (/admin/videa)"}),(0,oe.jsx)("option",{value:"gallery",children:"Galerie (/admin/galerie)"})]}),(0,oe.jsxs)("optgroup",{label:"Marketing",children:[(0,oe.jsx)("option",{value:"sponsors",children:"Sponzo\u0159i (/admin/sponzori)"}),(0,oe.jsx)("option",{value:"banners",children:"Bannery (/admin/bannery)"}),(0,oe.jsx)("option",{value:"shortlinks",children:"Zkr\xe1cen\xe9 odkazy (/admin/shortlinks)"}),(0,oe.jsx)("option",{value:"polls",children:"Ankety (/admin/ankety)"}),(0,oe.jsx)("option",{value:"sweepstakes",children:"Sout\u011b\u017ee (/admin/sweepstakes)"}),(0,oe.jsx)("option",{value:"engagement",children:"Odm\u011bny & \xdasp\u011bchy (/admin/engagement)"})]}),(0,oe.jsxs)("optgroup",{label:"N\xe1stroje",children:[(0,oe.jsx)("option",{value:"scoreboard",children:"Tabule (Scoreboard) (/admin/scoreboard)"}),(0,oe.jsx)("option",{value:"scoreboard_remote",children:"Scoreboard Remote (/admin/scoreboard/remote)"}),(0,oe.jsx)("option",{value:"clothing",children:"Oble\u010den\xed (/admin/obleceni)"})]}),(0,oe.jsxs)("optgroup",{label:"Komunikace",children:[(0,oe.jsx)("option",{value:"messages",children:"Zpr\xe1vy (/admin/zpravy)"}),(0,oe.jsx)("option",{value:"contacts",children:"Kontakty (/admin/kontakty)"}),(0,oe.jsx)("option",{value:"newsletter",children:"Zpravodaj (/admin/newsletter)"})]}),(0,oe.jsxs)("optgroup",{label:"Nastaven\xed",children:[(0,oe.jsx)("option",{value:"navigation",children:"Navigace (/admin/navigace)"}),(0,oe.jsx)("option",{value:"competition_aliases",children:"Alias sout\u011b\u017e\xed (/admin/aliasy-soutezi)"}),(0,oe.jsx)("option",{value:"users",children:"U\u017eivatel\xe9 (/admin/uzivatele)"}),(0,oe.jsx)("option",{value:"settings",children:"Nastaven\xed (/admin/nastaveni)"}),(0,oe.jsx)("option",{value:"files",children:"Soubory (/admin/soubory)"}),(0,oe.jsx)("option",{value:"prefetch",children:"Prefetch (/admin/prefetch)"}),(0,oe.jsx)("option",{value:"docs",children:"Dokumentace (/admin/docs)"})]}),(0,oe.jsx)("optgroup",{label:"Extern\xed odkazy",children:(0,oe.jsx)("option",{value:"webmail",children:"Webmail (vlastn\xed URL)"})})]})]}),"dropdown"===(null===J||void 0===J?void 0:J.type)&&(0,oe.jsxs)(r.F,{status:"info",fontSize:"sm",children:[(0,oe.jsx)(s._,{}),'Po vytvo\u0159en\xed t\xe9to polo\u017eky m\u016f\u017eete p\u0159idat podpolo\u017eky kliknut\xedm na tla\u010d\xedtko "P\u0159idat podpolo\u017eku".']}),("internal"===(null===J||void 0===J?void 0:J.type)||"external"===(null===J||void 0===J?void 0:J.type))&&(0,oe.jsxs)(v.MJ,{isRequired:!0,children:[(0,oe.jsx)(j.l,{children:"URL"}),(0,oe.jsx)(y.p,{value:(null===J||void 0===J?void 0:J.url)||"",onChange:e=>G((0,a.A)((0,a.A)({},J),{},{url:e.target.value})),placeholder:"external"===(null===J||void 0===J?void 0:J.type)?"https://example.com":"/vlastni-stranka"})]}),(0,oe.jsxs)(v.MJ,{children:[(0,oe.jsx)(j.l,{children:"Ikona"}),(0,oe.jsxs)(C.l,{value:(null===J||void 0===J?void 0:J.icon)||"",onChange:e=>G((0,a.A)((0,a.A)({},J),{},{icon:e.target.value||void 0})),children:[(0,oe.jsx)("option",{value:"",children:"Bez ikony"}),se.map(e=>(0,oe.jsx)("option",{value:e.value,children:e.label},e.value))]}),(null===J||void 0===J?void 0:J.icon)&&(0,oe.jsxs)(T.z,{mt:2,spacing:2,align:"center",children:[(0,oe.jsx)(b.I,{as:le[J.icon],boxSize:5}),(0,oe.jsx)(q.E,{fontSize:"sm",children:J.icon})]})]}),(null===J||void 0===J?void 0:J.parent_id)&&(0,oe.jsxs)(r.F,{status:"warning",fontSize:"sm",children:[(0,oe.jsx)(s._,{}),"Toto je podpolo\u017eka. Zobraz\xed se v dropdown menu rodi\u010dovsk\xe9 polo\u017eky."]}),(0,oe.jsxs)(v.MJ,{children:[(0,oe.jsx)(j.l,{children:"Popis (voliteln\xe9)"}),(0,oe.jsx)(L.T,{value:(null===J||void 0===J?void 0:J.css_class)||"",onChange:e=>G((0,a.A)((0,a.A)({},J),{},{css_class:e.target.value})),placeholder:"Kr\xe1tk\xfd popis pro administr\xe1tory",rows:2})]}),"external"===(null===J||void 0===J?void 0:J.type)&&(0,oe.jsxs)(v.MJ,{children:[(0,oe.jsx)(j.l,{children:"Target"}),(0,oe.jsxs)(C.l,{value:(null===J||void 0===J?void 0:J.target)||"_self",onChange:e=>G((0,a.A)((0,a.A)({},J),{},{target:e.target.value})),children:[(0,oe.jsx)("option",{value:"_self",children:"Stejn\xe9 okno"}),(0,oe.jsx)("option",{value:"_blank",children:"Nov\xe9 okno"})]})]}),de&&"dropdown"!==(null===J||void 0===J?void 0:J.type)&&(0,oe.jsxs)(v.MJ,{display:"flex",alignItems:"center",children:[(0,oe.jsx)(j.l,{mb:"0",children:"Povolit editor\u016fm"}),(0,oe.jsx)(N.d,{isChecked:!(null===J||void 0===J||!J.allow_editor),onChange:e=>G((0,a.A)((0,a.A)({},J),{},{allow_editor:e.target.checked}))})]}),(0,oe.jsxs)(v.MJ,{display:"flex",alignItems:"center",children:[(0,oe.jsx)(j.l,{mb:"0",children:"Viditeln\xe9"}),(0,oe.jsx)(N.d,{isChecked:null===(e=null===J||void 0===J?void 0:J.visible)||void 0===e||e,onChange:e=>G((0,a.A)((0,a.A)({},J),{},{visible:e.target.checked}))})]})]})}),(0,oe.jsxs)(_.j,{children:[(0,oe.jsx)(d.$,{variant:"ghost",mr:3,onClick:je,children:"Zru\u0161it"}),(0,oe.jsx)(d.$,{colorScheme:"blue",onClick:async()=>{if(J)try{J.id?(await(0,te.ds)(J.id,J),he({title:"Polo\u017eka aktualizov\xe1na",status:"success",duration:2e3})):(await(0,te.Ky)(J),he({title:"Polo\u017eka vytvo\u0159ena",status:"success",duration:2e3})),je(),_e()}catch(e){he({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed",status:"error",duration:3e3})}},children:"Ulo\u017eit"})]})]})]})]})}},8053:(e,t,n)=>{n.r(t),n.d(t,{default:()=>M});var a=n(89379),i=n(65043),o=n(40378),r=n(87139),s=n(22107),l=n(44093),c=n(98939),d=n(5371),u=n(7189),h=n(76659),m=n(80511),p=n(82595),x=n(67813),g=n(83201),v=n(3313),j=n(55395),b=n(14566),y=n(31411),f=n(10227),k=n(51794),_=n(3109),w=n(28846),z=n(39081),S=n(70082),A=n(81398),C=n(95182),E=n(57550),T=n(85638),D=n(56644),N=n(46291),R=n(74117),F=n(70579);function P(e){try{const t=String(e||"");if(!t)return;const n=t.match(/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/);return n?n[0].toLowerCase():void 0}catch(t){return}}const I=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")){const t=new URL(N.API_URL,"undefined"!==typeof window?window.location.origin:void 0);return new URL(e,"".concat(t.protocol,"//").concat(t.host)).toString()}return e}catch(t){return e}},M=()=>{const{t:e}=(0,R.Bd)(),[t,n]=(0,i.useState)(!0),[N,M]=(0,i.useState)(null),[L,W]=(0,i.useState)([]),[U,O]=(0,i.useState)({}),[q,K]=(0,i.useState)(null),[B,Z]=(0,i.useState)(!1),[V,H]=(0,i.useState)(null),{data:$}=(0,E.s)(),J=(0,l.dU)("white","gray.800"),G=(0,l.dU)("gray.200","gray.700"),X=(0,l.dU)("gray.600","gray.400"),Y=(0,l.dU)("white","gray.800"),Q=(0,l.dU)("var(--primary, #C53030)","var(--primary, #9b2c2c)"),ee=(0,l.dU)("gray.800","gray.200"),te=(0,l.dU)("white","gray.800"),ne=(0,l.dU)("gray.50","gray.700"),[ae,ie]=(0,i.useState)({}),oe=e=>{if("number"===typeof e)return e;const t=parseFloat(String(null!==e&&void 0!==e?e:"").replace(/[^0-9\-\.]/g,""));return isNaN(t)?0:t},re=e=>{const t=String(null!==e&&void 0!==e?e:"").trim(),n=t.match(/(-?\d+)\s*[:\-]\s*(-?\d+)/);return n?Number(n[1])-Number(n[2]):oe(t)},se=(e,t)=>{const n=ae[e];if(!n||n.key!==t)return void ie((0,a.A)((0,a.A)({},ae),{},{[e]:{key:t,order:"desc"}}));if("desc"===n.order)return void ie((0,a.A)((0,a.A)({},ae),{},{[e]:{key:t,order:"asc"}}));const i=(0,a.A)({},ae);i[e]=null,ie(i)},le=(e,t)=>{const n=ae[e];return n&&n.key===t?"desc"===n.order?"\u25bc":"\u25b2":""};(0,i.useEffect)(()=>{let e=!1;return(async()=>{n(!0),M(null);try{try{const n=Date.now();let i=null;try{const e=await fetch("/api/v1/public/team-logo-overrides?t=".concat(n),{cache:"no-cache"});e.ok&&(i=await e.json())}catch(t){}if(!i)try{const e=await fetch("/cache/prefetch/team_logo_overrides.json",{cache:"no-cache"});e.ok&&(i=await e.json())}catch(a){}e||H(i||{by_id:{},by_name:{}})}catch(i){}let n={};try{(await(0,S.xN)()||[]).forEach(e=>{null!==e&&void 0!==e&&e.code&&null!==e&&void 0!==e&&e.alias&&(n[e.code]={alias:e.alias,original_name:e.original_name,display_order:e.display_order})})}catch(o){}const r=await fetch(I("/cache/prefetch/facr_tables.json"),{cache:"no-cache"});if(!r.ok)throw new Error("HTTP ".concat(r.status));const s=await r.json(),l=Array.isArray(null===s||void 0===s?void 0:s.competitions)?s.competitions.map((e,t)=>{var a,i,o,r,s,l,c,d;const u=(null===e||void 0===e||null===(a=e.table)||void 0===a?void 0:a.overall)||[],h=Array.isArray(u)?u.map(e=>{var t,n,a,i,o,r,s,l;return{rank:String(null!==(t=e.rank)&&void 0!==t?t:""),team:String(null!==(n=e.team)&&void 0!==n?n:""),team_id:e.team_id,team_logo_url:e.team_logo_url?I(e.team_logo_url):void 0,played:String(null!==(a=e.played)&&void 0!==a?a:""),wins:String(null!==(i=e.wins)&&void 0!==i?i:""),draws:String(null!==(o=e.draws)&&void 0!==o?o:""),losses:String(null!==(r=e.losses)&&void 0!==r?r:""),score:String(null!==(s=e.score)&&void 0!==s?s:""),points:String(null!==(l=e.points)&&void 0!==l?l:"")}}):[];return{id:String(e.id||t),name:(null===n||void 0===n||null===(i=n[null===e||void 0===e?void 0:e.code])||void 0===i?void 0:i.alias)||(null===n||void 0===n||null===(o=n[String(e.id||t)])||void 0===o?void 0:o.alias)||e.name||e.code||"Sout\u011b\u017e ".concat(t+1),alias:(null===n||void 0===n||null===(r=n[null===e||void 0===e?void 0:e.code])||void 0===r?void 0:r.alias)||(null===n||void 0===n||null===(s=n[String(e.id||t)])||void 0===s?void 0:s.alias),display_order:null!==(l=null===n||void 0===n||null===(c=n[null===e||void 0===e?void 0:e.code])||void 0===c?void 0:c.display_order)&&void 0!==l?l:null===n||void 0===n||null===(d=n[String(e.id||t)])||void 0===d?void 0:d.display_order,code:e.code,matches_link:e.matches_link,rows:h}}):[];if(!e){O(n);const e=(l||[]).filter(e=>Array.isArray(e.rows)&&e.rows.length>0),t=(0,T.tJ)(e);W(t)}}catch(r){e||M((null===r||void 0===r?void 0:r.message)||"Nepoda\u0159ilo se na\u010d\xedst tabulky.")}finally{e||n(!1)}})(),()=>{e=!0}},[]);const ce=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),de=e=>{let t=ce(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,""),t.replace(/\s+/g," ").trim()},ue=(0,i.useMemo)(()=>{const e={},t=(null===V||void 0===V?void 0:V.by_name)||{};for(const n of Object.keys(t))e[ce(n)]=t[n];return e},[V]),he=(0,i.useMemo)(()=>(null===V||void 0===V?void 0:V.by_id)||{},[V]),me=(0,i.useMemo)(()=>{const e={};try{for(const[t,n]of Object.entries(he)){const a=String((null===n||void 0===n?void 0:n.name)||"").trim();if(!a)continue;const i=ce(a);i&&(e[i]={id:t,name:a})}}catch(t){}return e},[he]),pe=(e,t,n)=>{var a;const i=String(e||"")||P(n)||"",o=i?null===he||void 0===he||null===(a=he[i])||void 0===a?void 0:a.name:void 0;if(o&&String(o).trim().length>0)return String(o);const r=String(t||"");if(r){var s;const e=ce(r);let t=me[e];if(!t)for(const[n,a]of Object.entries(me))if(n&&(e.endsWith(n)||n.endsWith(e))){t=a;break}if(!t){const n=e.split(" ")[0];if(n&&n.length>=5)for(const[e,a]of Object.entries(me)){if(String(e).split(" ")[0]===n){t=a;break}}}if(null!==(s=t)&&void 0!==s&&s.name)return t.name}return r};return(0,F.jsxs)(o.A,{children:[(0,F.jsxs)(c.m,{maxW:"7xl",py:{base:6,md:10},children:[(0,F.jsx)(w.D,{as:"h1",size:"xl",mb:2,children:e("tables.title")}),(0,F.jsx)(z.E,{color:X,mb:6,children:e("tables.subtitle")}),t&&(0,F.jsxs)(d.s,{align:"center",gap:3,color:X,mb:6,children:[(0,F.jsx)(h.y,{size:"sm"}),(0,F.jsx)("span",{children:e("tables.loading")})]}),N&&(0,F.jsx)(s.a,{color:"red.600",mb:6,children:N}),!!L.length&&(0,F.jsxs)(_.t,{variant:"enclosed",size:"sm",children:[(0,F.jsx)(y.w,{px:2,pt:2,overflowX:"auto",overflowY:"hidden",css:{"&::-webkit-scrollbar":{height:"4px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"var(--chakra-colors-gray-300)",borderRadius:"4px"}},children:L.map(e=>(0,F.jsx)(b.o,{_selected:{bg:"brand.primary",color:"text.onPrimary",borderColor:"brand.primary"},_hover:{bg:"rgba(0,0,0,0.04)"},flex:"0 0 auto",px:3,py:2,children:(0,F.jsx)(z.E,{as:"span",noOfLines:1,maxW:"300px",title:e.name,children:e.name})},e.id))}),(0,F.jsx)(k.T,{children:L.map(t=>(0,F.jsxs)(f.K,{px:0,children:[(0,F.jsxs)(d.s,{align:"center",justify:"space-between",mb:3,children:[(0,F.jsx)(w.D,{as:"h2",size:"md",children:t.name}),t.matches_link&&(0,F.jsx)(u.N,{href:t.matches_link,isExternal:!0,color:"brand.primary",_hover:{filter:"brightness(0.9)"},children:e("tables.schedule_link")})]}),(0,F.jsx)(s.a,{borderWidth:"1px",borderColor:G,borderRadius:"lg",overflowX:"auto",boxShadow:"sm",bg:Y,children:(0,F.jsxs)(m.X,{size:"sm",variant:"unstyled",color:ee,children:[(0,F.jsx)(v.d,{position:"sticky",top:0,zIndex:2,children:(0,F.jsxs)(j.Tr,{bg:Q,color:"white",children:[(0,F.jsxs)(g.Th,{w:"56px",color:"white",cursor:"pointer",onClick:()=>se(t.id,"rank"),children:[e("tables.rank")," ",le(t.id,"rank")]}),(0,F.jsxs)(g.Th,{color:"white",cursor:"pointer",onClick:()=>se(t.id,"team"),children:[e("tables.team")," ",le(t.id,"team")]}),(0,F.jsxs)(g.Th,{isNumeric:!0,color:"white",cursor:"pointer",onClick:()=>se(t.id,"played"),children:[e("tables.played")," ",le(t.id,"played")]}),(0,F.jsxs)(g.Th,{isNumeric:!0,color:"white",cursor:"pointer",onClick:()=>se(t.id,"wins"),children:[e("tables.wins")," ",le(t.id,"wins")]}),(0,F.jsxs)(g.Th,{isNumeric:!0,color:"white",cursor:"pointer",onClick:()=>se(t.id,"draws"),children:[e("tables.draws")," ",le(t.id,"draws")]}),(0,F.jsxs)(g.Th,{isNumeric:!0,color:"white",cursor:"pointer",onClick:()=>se(t.id,"losses"),children:[e("tables.losses")," ",le(t.id,"losses")]}),(0,F.jsxs)(g.Th,{isNumeric:!0,color:"white",cursor:"pointer",onClick:()=>se(t.id,"score"),children:[e("tables.score")," ",le(t.id,"score")]}),(0,F.jsxs)(g.Th,{isNumeric:!0,color:"white",cursor:"pointer",onClick:()=>se(t.id,"points"),children:[e("tables.points")," ",le(t.id,"points")]})]})}),(0,F.jsx)(p.N,{children:(()=>{const e=ae[t.id],n=[...t.rows||[]];return e&&n.sort((t,n)=>{let a,i,o=!1;switch(e.key){case"team":a=pe(t.team_id,t.team,t.team_logo_url),i=pe(n.team_id,n.team,n.team_logo_url),o=!0;break;case"rank":a=oe(t.rank),i=oe(n.rank);break;case"played":a=oe(t.played),i=oe(n.played);break;case"wins":a=oe(t.wins),i=oe(n.wins);break;case"draws":a=oe(t.draws),i=oe(n.draws);break;case"losses":a=oe(t.losses),i=oe(n.losses);break;case"score":a=re(t.score),i=re(n.score);break;case"points":a=oe(t.points),i=oe(n.points);break;default:a=0,i=0}let r=o?String(a).localeCompare(String(i)):a-i;if("desc"===e.order&&(r=-r),0===r){r=oe(t.rank)-oe(n.rank)}return r}),n.map((e,n)=>{const a=pe(e.team_id,e.team,e.team_logo_url),i=((e,t,n)=>{var a;if(e&&null!==he&&void 0!==he&&null!==(a=he[e])&&void 0!==a&&a.logo_url)return he[e].logo_url;if(t){const e=((null===V||void 0===V?void 0:V.by_name)||{})[t];if(e)return e;const n=ce(t),a=ue[n];if(a)return a;const i=de(t);for(const t of Object.keys((null===V||void 0===V?void 0:V.by_name)||{})){const e=de(t);if(e&&(i.endsWith(e)||e.endsWith(i)))return V.by_name[t]}}return n})(e.team_id,a,e.team_logo_url);return(0,F.jsxs)(j.Tr,{transition:"all 0.15s",_hover:{transform:"translateY(-3px)",boxShadow:"lg",zIndex:3,cursor:"pointer"},position:"relative",bg:n%2===0?te:ne,onClick:()=>(K(e),void Z(!0)),children:[(0,F.jsx)(x.Td,{children:(0,F.jsx)(r.E,{variant:"subtle",bg:(0,l.dU)("gray.100","gray.700"),color:ee,borderWidth:"1px",borderColor:G,children:e.rank})}),(0,F.jsx)(x.Td,{children:(0,F.jsxs)(d.s,{align:"center",gap:3,children:[(0,F.jsx)(D.L,{teamId:e.team_id||P(e.team_logo_url),teamName:a,facrLogo:i,size:"small",alt:a,objectFit:"contain",bg:J,borderWidth:"1px",borderColor:G}),(0,F.jsx)(z.E,{fontWeight:"medium",color:ee,children:a})]})}),(0,F.jsx)(x.Td,{isNumeric:!0,color:ee,children:e.played}),(0,F.jsx)(x.Td,{isNumeric:!0,color:ee,children:e.wins}),(0,F.jsx)(x.Td,{isNumeric:!0,color:ee,children:e.draws}),(0,F.jsx)(x.Td,{isNumeric:!0,color:ee,children:e.losses}),(0,F.jsx)(x.Td,{isNumeric:!0,color:ee,children:e.score}),(0,F.jsx)(x.Td,{isNumeric:!0,children:(0,F.jsx)(r.E,{variant:"solid",bg:"blue.600",color:"white",children:e.points})})]},"".concat(t.id,"-").concat(e.rank,"-").concat(e.team))})})()})]})})]},t.id))})]}),!t&&!N&&0===L.length&&(0,F.jsx)(z.E,{color:X,children:e("tables.no_tables")})]}),(0,F.jsx)(A.A,{}),(0,F.jsx)(C.A,{isOpen:B,onClose:()=>Z(!1),club:q,clubType:(null===$||void 0===$?void 0:$.club_type)||"football"})]})}},9976:(e,t,n)=>{n.d(t,{AT:()=>h,C$:()=>c,GO:()=>x,RE:()=>v,Ui:()=>j,_n:()=>b,d1:()=>o,eF:()=>i,hR:()=>d,jE:()=>l,mG:()=>m,rz:()=>p,tc:()=>u,tp:()=>g,uw:()=>s,v9:()=>r});var a=n(46291);async function i(){return(await a.Ay.get("/sweepstakes/current")).data}async function o(e){await a.Ay.post("/sweepstakes/".concat(e,"/enter"),{})}async function r(e){await a.Ay.post("/sweepstakes/".concat(e,"/played"),{})}async function s(){return(await a.Ay.get("/sweepstakes/my-winnings")).data}async function l(e){var t;return(null===(t=(await a.Ay.get("/admin/sweepstakes",{params:e})).data)||void 0===t?void 0:t.items)||[]}async function c(e){return(await a.Ay.post("/admin/sweepstakes",e)).data}async function d(e,t){return(await a.Ay.put("/admin/sweepstakes/".concat(e),t)).data}async function u(e){return(await a.Ay.delete("/admin/sweepstakes/".concat(e))).data}async function h(e,t){return(await a.Ay.post("/admin/sweepstakes/".concat(e,"/finalize"),t?{seed:t}:{})).data}async function m(e){return(await a.Ay.get("/admin/sweepstakes/".concat(e,"/visual"))).data}async function p(e){var t;return(null===(t=(await a.Ay.get("/admin/sweepstakes/".concat(e,"/prizes"))).data)||void 0===t?void 0:t.items)||[]}async function x(e,t){return(await a.Ay.post("/admin/sweepstakes/".concat(e,"/prizes"),t)).data}async function g(e,t,n){return(await a.Ay.put("/admin/sweepstakes/".concat(e,"/prizes/").concat(t),n)).data}async function v(e,t){return(await a.Ay.delete("/admin/sweepstakes/".concat(e,"/prizes/").concat(t))).data}async function j(e,t){return(await a.Ay.post("/admin/sweepstakes/".concat(e,"/prizes/reorder"),{order:t})).data}async function b(e,t,n){return(await a.Ay.patch("/admin/sweepstakes/".concat(e,"/winners/").concat(t),n)).data}},11711:()=>{},12255:(e,t,n)=>{n.d(t,{A:()=>q});var a=n(89379),i=n(65043),o=n(30502),r=n(96870),s=n(99956),l=n(42703),c=n(98662),d=n(59883),u=n(86236),h=n(91872),m=n(53560),p=n(22107),x=n(78460),g=n(11054),v=n(85421),j=n(15071),b=n(67516),y=n(19077),f=n(39081),k=n(73212),_=n(33572),w=n(56529),z=n(88306),S=n(92330),A=n(24405),C=n(44632),E=n(72313),T=n(29066),D=n(47704),N=n(34636),R=n(46291);function F(e){var t;if(!e)return"";if("undefined"===typeof window)return e.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();const n=document.createElement("div");return n.innerHTML=e,null===(t=n.textContent||n.innerText||"")||void 0===t?void 0:t.replace(/\s+/g," ").trim()}function P(e){const t=String(e||"").trim(),n=t.match(/^(\d{1,2})\.(\d{1,2})\.(\d{4})(?:\s+(\d{1,2}):(\d{2}))?$/);if(n){const e=parseInt(n[1],10),t=parseInt(n[2],10),a=parseInt(n[3],10),i=n[4]?parseInt(n[4],10):0,o=n[5]?parseInt(n[5],10):0,r=new Date(a,t-1,e,i,o),s=r.toLocaleDateString("cs-CZ"),l=n[4]?r.toLocaleTimeString("cs-CZ",{hour:"2-digit",minute:"2-digit"}):"";return l?"".concat(s," ").concat(l):s}try{const e=new Date(t);if(!isNaN(e.getTime()))return"".concat(e.toLocaleDateString("cs-CZ")," ").concat(e.toLocaleTimeString("cs-CZ",{hour:"2-digit",minute:"2-digit"}))}catch(a){}return t}function I(e){try{return String(e||"").trim().split(" - ")[0].trim()}catch(t){return e}}function M(e){return e.replace(/(?:[\0-\/:-@\[-`\{-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u065F\u066A-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07BF\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0965\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09E5\u09F2\u09F3\u09FA\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A65\u0A70\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AE5\u0AF0-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B65\u0B70\u0B78-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0BE5\u0BF3-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C65\u0C70-\u0C77\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CE5\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57\u0D62-\u0D65\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DE5\u0DF0-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F1F\u0F34-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u104A-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u1368\u137D-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u17DF\u17EA-\u17EF\u17FA-\u180F\u181A-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19FF\u1A17-\u1A1F\u1A55-\u1A7F\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B4F\u1B5A-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BFF\u1C24-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C8B-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u206F\u2072\u2073\u207A-\u207E\u208A-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A-\u245F\u249C-\u24E9\u2500-\u2775\u2794-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFC\u2CFE\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3008-\u3020\u302A-\u3030\u3036\u3037\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u3191\u3196-\u319F\u31C0-\u31EF\u3200-\u321F\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6F0-\uA716\uA720\uA721\uA789\uA78A\uA7CE\uA7CF\uA7D2\uA7D4\uA7DD-\uA7F1\uA802\uA806\uA80B\uA823-\uA82F\uA836-\uA83F\uA874-\uA881\uA8B4-\uA8CF\uA8DA-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9DA-\uA9DF\uA9E5\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD06\uDD34-\uDD3F\uDD79-\uDD89\uDD8C-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEE0\uDEFC-\uDEFF\uDF24-\uDF2C\uDF4B-\uDF4F\uDF76-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6F\uDD7B\uDD8B\uDD93\uDD96\uDDA2\uDDB2\uDDBA\uDDBD-\uDDBF\uDDF4-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDF7F\uDF86\uDFB1\uDFBB-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC57\uDC77\uDC78\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE01-\uDE0F\uDE14\uDE18\uDE36-\uDE3F\uDE49-\uDE5F\uDE7F\uDEA0-\uDEBF\uDEC8\uDEE5-\uDEEA\uDEF0-\uDEFF\uDF36-\uDF3F\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDFA8\uDFB0-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD24-\uDD2F\uDD3A-\uDD3F\uDD66-\uDD6E\uDD86-\uDE5F\uDE7F\uDEAA-\uDEAF\uDEB2-\uDEC1\uDEC5-\uDEFF\uDF28-\uDF2F\uDF46-\uDF50\uDF55-\uDF6F\uDF82-\uDFAF\uDFCC-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC00-\uDC02\uDC38-\uDC51\uDC70\uDC73\uDC74\uDC76-\uDC82\uDCB0-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDD02\uDD27-\uDD35\uDD40-\uDD43\uDD45\uDD46\uDD48-\uDD4F\uDD73-\uDD75\uDD77-\uDD82\uDDB3-\uDDC0\uDDC5-\uDDCF\uDDDB\uDDDD-\uDDE0\uDDF5-\uDDFF\uDE12\uDE2C-\uDE3E\uDE41-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEDF-\uDEEF\uDEFA-\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A-\uDF3C\uDF3E-\uDF4F\uDF51-\uDF5C\uDF62-\uDF7F\uDF8A\uDF8C\uDF8D\uDF8F\uDFB6\uDFB8-\uDFD0\uDFD2\uDFD4-\uDFFF]|\uD805[\uDC35-\uDC46\uDC4B-\uDC4F\uDC5A-\uDC5E\uDC62-\uDC7F\uDCB0-\uDCC3\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDAF-\uDDD7\uDDDC-\uDDFF\uDE30-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEBF\uDECA-\uDECF\uDEE4-\uDEFF\uDF1B-\uDF2F\uDF3C-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCF3-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFBF\uDFE1-\uDFEF\uDFFA-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC4F\uDC6D-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDF4F\uDF5A-\uDFAF\uDFB1-\uDFBF\uDFD5-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD812-\uD817\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD832\uD836\uD83D\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDC5F]|\uD810[\uDFFB-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD818[\uDC00-\uDCFF\uDD1E-\uDD2F\uDD3A-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6F\uDEBF\uDECA-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDD3F\uDD6D-\uDD6F\uDD7A-\uDE3F\uDE97-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFE\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD833[\uDC00-\uDCEF\uDCFA-\uDFFF]|\uD834[\uDC00-\uDEBF\uDED4-\uDEDF\uDEF4-\uDF5F\uDF79-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDEEF\uDEFA-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDCEF\uDCFA-\uDDCF\uDDEE\uDDEF\uDDFB-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD0-\uDCFF\uDD44-\uDD4A\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDC70\uDCAC\uDCB0\uDCB5-\uDD00\uDD2E\uDD3E-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+/g,"").replace(/[\xe1\xe4]/gi,"a").replace(/[\u010d]/gi,"c").replace(/[\u010f]/gi,"d").replace(/[\xe9\u011b\xeb]/gi,"e").replace(/[\xed\xef]/gi,"i").replace(/[\u013e\u013a]/gi,"l").replace(/[\u0148]/gi,"n").replace(/[\xf3\xf6]/gi,"o").replace(/[\u0159]/gi,"r").replace(/[\u0161]/gi,"s").replace(/[\u0165]/gi,"t").replace(/[\xfa\u016f\xfc]/gi,"u").replace(/[\xfd]/gi,"y").replace(/[\u017e]/gi,"z")}var L=n(31629),W=n(57550),U=n(89962),O=n(70579);const q=e=>{let{article:t,activity:n,match:q,targetUrl:K,size:B="md",placement:Z="fixed",mr:V=6,mb:H=6,zIndex:$=40,variant:J="icon",onGenerated:G,align:X="right",position:Y="top-right"}=e;const{user:Q}=(0,T.A)(),ee="admin"===String((null===Q||void 0===Q?void 0:Q.role)||"").toLowerCase(),{data:te}=(0,W.s)(),ne=(0,o.d)(),{isOpen:ae,onOpen:ie,onClose:oe}=(0,r.j)(),[re,se]=i.useState(""),[le,ce]=i.useState(""),[de,ue]=i.useState(!1),[he,me]=i.useState(void 0),[pe,xe]=i.useState(null),[ge,ve]=i.useState([]),je=i.useMemo(()=>null!==t&&void 0!==t&&t.id?"article-".concat(t.id):null!==n&&void 0!==n&&n.id?"activity-".concat(n.id):"share",[null===t||void 0===t?void 0:t.id,null===n||void 0===n?void 0:n.id]),be=()=>K||("undefined"!==typeof window?window.location.href:""),ye=async e=>{e&&(e.preventDefault(),e.stopPropagation());try{ue(!0),me(0),xe(Date.now()),ve([]);const e=setInterval(()=>{me(e=>void 0===e||e>=95?e:Math.min(e+20*Math.random()+10,95))},1500),m=(e=>{try{const t=new URL(e,"undefined"!==typeof window?window.location.origin:"http://localhost");return t.searchParams.get("utm_source")||t.searchParams.set("utm_source","instagram"),t.searchParams.get("utm_medium")||t.searchParams.set("utm_medium","social"),t.searchParams.get("utm_campaign")||t.searchParams.set("utm_campaign",je),t.toString()}catch(t){return e}})(be());if(!m)throw new Error("Nelze zjistit URL \u010dl\xe1nku/aktivity");const p=null!==t&&void 0!==t&&t.id?"ig-a".concat(t.id):null!==n&&void 0!==n&&n.id?"ig-e".concat(n.id):"ig-share",x={target_url:m,title:(null===t||void 0===t?void 0:t.title)||(null===n||void 0===n?void 0:n.title)||"Link",source_type:t?"article":n?"event":"other",source_id:(null===t||void 0===t?void 0:t.id)||(null===n||void 0===n?void 0:n.id),code:p};let g="";try{const e=await(0,D.fn)(x);g=(null===e||void 0===e?void 0:e.short_url)||""}catch(r){try{const e=await(0,D.yL)({target_url:m,title:(null===t||void 0===t?void 0:t.title)||(null===n||void 0===n?void 0:n.title)||"Link"});g=(null===e||void 0===e?void 0:e.short_url)||m}catch(s){g=m}}ce(g||m);const v=(null===te||void 0===te?void 0:te.club_name)||void 0;let j="";if(t){let e=q||null;if(!e&&null!==t&&void 0!==t&&t.id)try{const n=await(0,N.Om)(t.id),a=null===n||void 0===n?void 0:n.external_match_id;if(a)try{const t=new URL(R.API_URL,window.location.origin).origin,n=await fetch("".concat(t,"/cache/prefetch/facr_club_info.json"),{cache:"no-cache"});if(n.ok){const t=await n.json(),i=Array.isArray(null===t||void 0===t?void 0:t.competitions)?t.competitions:[];let o=null;for(const e of i){const t=Array.isArray(e.matches)?e.matches:[];for(const n of t){if(String(n.match_id||n.id)===String(a)){let t="";null!==n&&void 0!==n&&n.score&&"vs"!==n.score?t=String(n.score):null!=(null===n||void 0===n?void 0:n.result_home)&&null!=(null===n||void 0===n?void 0:n.result_away)&&(t="".concat(n.result_home,":").concat(n.result_away)),o={external_match_id:String(a),competition:String(e.name||""),date_time:String(n.date_time||n.date||""),venue:n.venue?String(n.venue):void 0,home:String(n.home||n.home_team||""),away:String(n.away||n.away_team||""),score:t};break}}if(o)break}o&&(e=o)}}catch(l){}}catch(c){}try{var a,i;const n=await(0,L.i4)({type:"article",title:t.title,content:F(t.content),club_name:v,link:g||m,category:(null===t||void 0===t||null===(a=t.category)||void 0===a?void 0:a.name)||(null===t||void 0===t?void 0:t.category_name),match:e?{home:e.home,away:e.away,competition:e.competition,date_time:e.date_time?P(e.date_time):void 0,venue:e.venue?I(e.venue):void 0,score:e.score}:void 0});j=(null===n||void 0===n||null===(i=n.text)||void 0===i?void 0:i.trim())||""}catch(d){}j||(j=function(e){var t,n;const{article:a,trackingUrl:i,clubName:o,hashtags:r=[],match:s}=e,l=(null===(t=a.title)||void 0===t?void 0:t.trim())||"",c=(null===a||void 0===a||null===(n=a.category)||void 0===n?void 0:n.name)||(null===a||void 0===a?void 0:a.category_name)||"",d=F(a.content).slice(0,160),u=r.length?r:["#".concat(M(o||"FKKrnov")),"#fotbal","#modrazluta"];if(s&&(s.home||s.away)){const e=s.home||"",t=s.away||"",n=s.competition?"".concat(s.competition):"",a=s.date_time?P(s.date_time):"",r=s.score&&/\d/.test(s.score)?s.score:"";return["\ud83d\udc99\ud83d\udc9b ".concat(c||o||"N\xe1\u0161 klub",": ").concat(l," \ud83d\udc9b\ud83d\udc99"),"",r?"V\xfdsledek: ".concat(e," ").concat(r," ").concat(t):"".concat(e," vs ").concat(t),n||a?"".concat(n).concat(n&&a?" \u2022 ":"").concat(a):"",s.venue?"M\xedsto: ".concat(I(String(s.venue))):"","",d?"".concat(d).concat(160===d.length?"\u2026":""):"","","\ud83d\udcf8 Cel\xfd \u010dl\xe1nek najde\u0161 tady \ud83d\udc47","\ud83d\udd17 ".concat(i),"",u.join(" "),"\ud83d\udc99\ud83d\udc9b"].filter(Boolean).join("\n")}return["\ud83d\udc99\ud83d\udc9b ".concat(c||o||"N\xe1\u0161 klub",": ").concat(l," \ud83d\udc9b\ud83d\udc99"),"",d,"","\ud83d\udcf8 Cel\xfd \u010dl\xe1nek najde\u0161 tady \ud83d\udc47","\ud83d\udd17 ".concat(i),"",u.join(" "),"\ud83d\udc99\ud83d\udc9b"].join("\n")}({article:t,trackingUrl:g||m,clubName:v,match:e}))}else if(n){try{var o;const e=await(0,L.i4)({type:"event",title:String((null===n||void 0===n?void 0:n.title)||""),content:F(String((null===n||void 0===n?void 0:n.description)||"")),club_name:v,link:g||m});j=(null===e||void 0===e||null===(o=e.text)||void 0===o?void 0:o.trim())||""}catch(u){}j||(j=function(e){const{activity:t,trackingUrl:n,clubName:a,hashtags:i=[]}=e,o=String((null===t||void 0===t?void 0:t.title)||"").trim(),r=F(String((null===t||void 0===t?void 0:t.description)||"")).slice(0,280),s=null!==t&&void 0!==t&&t.start_time?P(t.start_time):"",l=null!==t&&void 0!==t&&t.location?String(t.location):"",c=i.length?i:["#".concat(M(a||"FKKrnov")),"#aktivity","#fotbal"];return["\ud83d\udc99\ud83d\udc9b ".concat(a||"N\xe1\u0161 klub",": ").concat(o," \ud83d\udc9b\ud83d\udc99"),"",s||l?"".concat(s).concat(s&&l?" \u2022 ":"").concat(l):"",r,"","\ud83d\udcf8 V\xedce informac\xed najde\u0161 tady \ud83d\udc47","\ud83d\udd17 ".concat(n),"",c.join(" "),"\ud83d\udc99\ud83d\udc9b"].filter(Boolean).join("\n")}({activity:n,trackingUrl:g||m,clubName:v}))}else j="".concat(v||"N\xe1\u0161 klub","\n\n\ud83d\udd17 ").concat(g||m);try{const e=(null===te||void 0===te?void 0:te.primary_color)||"",a=(null===te||void 0===te?void 0:te.secondary_color)||"",i=t?'N\xe1vrh instagramov\xe9ho obr\xe1zku k \u010dl\xe1nku "'.concat(t.title,'" pro ofici\xe1ln\xed profil fotbalov\xe9ho klubu').concat(v?" "+v:"","."):n?'N\xe1vrh instagramov\xe9ho obr\xe1zku k aktivit\u011b "'.concat(n.title,'" pro ofici\xe1ln\xed profil fotbalov\xe9ho klubu').concat(v?" "+v:"","."):"N\xe1vrh univerz\xe1ln\xedho instagramov\xe9ho obr\xe1zku pro ofici\xe1ln\xed profil fotbalov\xe9ho klubu".concat(v?" "+v:"",".");let o="";(e||a)&&(o=" Klubov\xe9 barvy: ".concat(e||"").concat(e&&a?", ":"").concat(a||"","."));const r="".concat(i," Zobraz stadion, hr\xe1\u010de nebo fanou\u0161ky na\u0161eho klubu, \u017e\xe1dn\xe9 loga soupe\u0159e ani text v obr\xe1zku.").concat(o," Styl: realistick\xfd, modern\xed, sportovn\xed, pom\u011br stran 4:5, bez textu, vhodn\xe9 jako hlavn\xed vizu\xe1l p\u0159\xedsp\u011bvku."),s=await(0,L.yv)({prompt:r,aspect:"4:5",count:2});Array.isArray(null===s||void 0===s?void 0:s.urls)&&s.urls.length>0&&ve(s.urls)}catch(h){console.error("Instagram image generation failed",h)}clearInterval(e),me(100),se(j),null===G||void 0===G||G(j,g||m),setTimeout(()=>{ie()},500)}catch(r){ne({status:"error",title:"Nelze vygenerovat p\u0159\xedsp\u011bvek",description:(null===r||void 0===r?void 0:r.message)||"Zkuste to pros\xedm znovu."})}finally{setTimeout(()=>{ue(!1),me(void 0),xe(null)},1e3)}},fe=async e=>{const a=(e=>{const t=be();try{const n=new URL(t,"undefined"!==typeof window?window.location.origin:"http://localhost");return n.searchParams.get("utm_source")||n.searchParams.set("utm_source",e),n.searchParams.get("utm_medium")||n.searchParams.set("utm_medium","social"),n.searchParams.get("utm_campaign")||n.searchParams.set("utm_campaign",je),n.toString()}catch(n){return t}})(e),i=await(async e=>{try{const a=await(0,D.yL)({target_url:e,title:(null===t||void 0===t?void 0:t.title)||(null===n||void 0===n?void 0:n.title)});return(null===a||void 0===a?void 0:a.short_url)||e}catch(a){return e}})(a);if("copy"!==e){if("twitter"===e){const e=(null===t||void 0===t?void 0:t.title)||(null===n||void 0===n?void 0:n.title)||"",a="https://twitter.com/intent/tweet?url=".concat(encodeURIComponent(i),"&text=").concat(encodeURIComponent(e));return void window.open(a,"_blank")}if("facebook"===e){const e="https://www.facebook.com/sharer/sharer.php?u=".concat(encodeURIComponent(i));return void window.open(e,"_blank")}try{await navigator.clipboard.writeText(i),ne({status:"info",title:"Kr\xe1tk\xfd odkaz zkop\xedrov\xe1n",description:"Vlo\u017ete jej do Instagramu."})}catch(o){}window.open("https://www.instagram.com/","_blank")}else try{await navigator.clipboard.writeText(i),ne({status:"success",title:"Kr\xe1tk\xfd odkaz zkop\xedrov\xe1n"})}catch(r){ne({status:"warning",title:"Kop\xedrov\xe1n\xed se nezda\u0159ilo"})}},ke=(0,O.jsx)(s.m,{label:"Vygenerovat Instagram p\u0159\xedsp\u011bvek",placement:"right",children:"icon"===J?(0,O.jsx)(l.K,{"aria-label":"Instagram p\u0159\xedsp\u011bvek",icon:(0,O.jsx)(z.A,{size:18}),colorScheme:"brand",onClick:ye,isDisabled:de,size:B}):(0,O.jsx)(c.$,{leftIcon:(0,O.jsx)(z.A,{size:18}),colorScheme:"brand",onClick:ye,isDisabled:de,size:B,children:"Instagram p\u0159\xedsp\u011bvek"})}),_e=(0,O.jsxs)(d.W,{placement:"top-start",children:[(0,O.jsx)(u.I,{as:l.K,"aria-label":"Sd\xedlet",icon:(0,O.jsx)(z.A,{size:18}),variant:"solid",colorScheme:"brand",onClick:e=>{e.preventDefault(),e.stopPropagation()},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onTouchStart:e=>{e.preventDefault(),e.stopPropagation()}}),(0,O.jsxs)(h.c,{children:[(0,O.jsx)(m.D,{onClick:()=>fe("instagram"),icon:(0,O.jsx)(S.A,{size:16}),children:"Instagram"}),(0,O.jsx)(m.D,{onClick:()=>fe("twitter"),icon:(0,O.jsx)(A.A,{size:16}),children:"Twitter"}),(0,O.jsx)(m.D,{onClick:()=>fe("facebook"),icon:(0,O.jsx)(C.A,{size:16}),children:"Facebook"}),(0,O.jsx)(m.D,{onClick:()=>fe("copy"),icon:(0,O.jsx)(E.A,{size:16}),children:"Kop\xedrovat odkaz"})]})]});return(0,O.jsxs)(O.Fragment,{children:["fixed"===Z?(0,O.jsx)(p.a,(0,a.A)((0,a.A)({position:"fixed",bottom:H,zIndex:$},"left"===X?{left:V}:{right:V}),{},{children:ee?ke:_e})):(0,O.jsx)(p.a,(0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)({position:"absolute",zIndex:$},"top-left"===Y?{top:2,left:2}:{}),"top-right"===Y?{top:2,right:2}:{}),"bottom-left"===Y?{bottom:2,left:2}:{}),"bottom-right"===Y?{bottom:2,right:2}:{}),{},{children:ee?ke:_e})),(0,O.jsxs)(x.aF,{isOpen:ae,onClose:oe,size:"xl",children:[(0,O.jsx)(g.m,{}),(0,O.jsxs)(v.$,{children:[(0,O.jsx)(j.r,{children:"Instagram p\u0159\xedsp\u011bvek"}),(0,O.jsxs)(b.c,{children:[(0,O.jsx)(y.T,{value:re,onChange:e=>se(e.target.value),rows:12,fontFamily:"mono"}),ge.length>0&&(0,O.jsxs)(p.a,{mt:4,children:[(0,O.jsx)(f.E,{fontSize:"sm",mb:2,children:"N\xe1vrhy obr\xe1zk\u016f pro Instagram (Grok):"}),(0,O.jsx)(k.r,{columns:{base:1,md:2},spacing:3,children:ge.map((e,t)=>(0,O.jsxs)(p.a,{children:[(0,O.jsx)(_._,{src:e,alt:"Instagram obr\xe1zek ".concat(t+1),borderRadius:"md",w:"100%",objectFit:"cover"}),(0,O.jsx)(c.$,{mt:2,size:"xs",variant:"outline",onClick:()=>{window.open(e,"_blank")},children:"Otev\u0159\xedt v nov\xe9m okn\u011b"})]},t))})]})]}),(0,O.jsxs)(w.j,{gap:3,children:[(0,O.jsx)(c.$,{variant:"outline",onClick:async()=>{try{await navigator.clipboard.writeText(re),ne({status:"success",title:"Zkop\xedrov\xe1no",description:"Text p\u0159\xedsp\u011bvku byl zkop\xedrov\xe1n do schr\xe1nky."})}catch(e){ne({status:"warning",title:"Nelze kop\xedrovat",description:"Zkop\xedrujte pros\xedm ru\u010dn\u011b."})}},children:"Kop\xedrovat"}),(0,O.jsx)(c.$,{onClick:oe,children:"Zav\u0159\xedt"})]})]})]}),(0,O.jsx)(U.A,{isOpen:de,onClose:()=>{},title:"AI generuje Instagram p\u0159\xedsp\u011bvek",message:"Pracuji na vytvo\u0159en\xed p\u0159\xedsp\u011bvku pro Instagram...",progress:he,estimatedTime:pe?20:void 0})]})}},13316:(e,t,n)=>{n.d(t,{A:()=>p});var a=n(89379),i=n(65043),o=n(73216),r=n(35475),s=(n(80348),n(57550)),l=n(78801),c=n(1029),d=n(66286),u=n(25189),h=n(74117),m=n(70579);const p=()=>{const{t:e}=(0,h.Bd)(),{data:t}=(0,s.s)(),n=(0,l.N)(),p=(0,o.zy)(),[x,g]=(0,i.useState)(!1),[v,j]=(0,i.useState)([]),[b,y]=(0,i.useState)(!0),[f,k]=(0,i.useState)(null);(0,i.useEffect)(()=>{let e=!0;return(async()=>{try{const n=await(0,c.hZ)();if(e&&Array.isArray(n)){const a=n.filter(e=>!e.requires_admin);if(0===a.length)try{await(0,c.D)();const t=await(0,c.hZ)();if(e&&Array.isArray(t)){const e=t.filter(e=>!e.requires_admin);j(e)}}catch(t){j([])}else j(a)}}catch(n){}finally{e&&y(!1)}})(),()=>{e=!1}},[]),(0,i.useEffect)(()=>{let e=!0;return(async()=>{try{const n=await(0,d.bW)();e&&Array.isArray(n)&&n.length>0?k(n):e&&Array.isArray(null===t||void 0===t?void 0:t.categories)&&k(t.categories)}catch(n){e&&Array.isArray(null===t||void 0===t?void 0:t.categories)&&k(t.categories)}})(),()=>{e=!1}},[null===t||void 0===t?void 0:t.categories]);const _=t=>{const n=t=>{const n={"Dom\u016f":"nav.home",Aktuality:"nav.news","Z\xe1pasy":"nav.matches","Hr\xe1\u010di":"nav.players",Fotogalerie:"nav.gallery",Videa:"nav.videos",Kontakt:"nav.contact","O klubu":"nav.about",Aktivity:"nav.activities","Sponzo\u0159i":"nav.sponsors","\u010cl\xe1nky":"nav.news",Blog:"nav.news","Kalend\xe1\u0159":"nav.calendar",Tabulky:"nav.table"}[t];return n?e(n):t},a={label:n(t.label),to:t.url||"#",external:"external"===t.type};return"dropdown"===t.type&&t.children&&t.children.length>0&&(a.items=t.children.map(e=>({label:n(e.label),to:e.url||"#"}))),a},w=(0,i.useMemo)(()=>(Array.isArray(f)&&f.length>0?f:[]).map(e=>({label:e.name,to:e.url||(e.id?"/blog?category_id=".concat(e.id):e.slug?"/blog?category=".concat(encodeURIComponent(e.slug)):"/blog")})),[f]),z=(0,i.useMemo)(()=>{if(!b&&v.length>0){const e=v.map(_);if(w.length>0){const t=e.findIndex(e=>"\u010cl\xe1nky"===e.label||"Blog"===e.label||"/blog"===e.to);-1!==t&&(e[t]=(0,a.A)((0,a.A)({},e[t]),{},{items:w}))}return e}return[{label:"Dom\u016f",to:"/"},...!1===(null===t||void 0===t?void 0:t.show_about_in_nav)?[]:[{label:"O klubu",to:"/o-klubu"}],{label:"Kalend\xe1\u0159",to:"/kalendar"},{label:"Z\xe1pasy",to:"/zapasy"},{label:"Aktivity",to:"/aktivity"},{label:"Hr\xe1\u010di",to:"/hraci"},w.length>0?{label:"\u010cl\xe1nky",to:"/blog",items:w}:{label:"\u010cl\xe1nky",to:"/blog"},{label:"Videa",to:"/videa"},{label:(null===t||void 0===t?void 0:t.gallery_label)||e("nav.gallery"),to:"/galerie"},...null!==t&&void 0!==t&&t.shop_url?[{label:"Fanshop",to:t.shop_url,external:!0}]:[],{label:"Sponzo\u0159i",to:"/sponzori"},{label:"Kontakt",to:"/kontakt"}]},[b,v,null===t||void 0===t?void 0:t.show_about_in_nav,null===t||void 0===t?void 0:t.shop_url,null===t||void 0===t?void 0:t.gallery_label,w]),S=(0,u.uq)((null===t||void 0===t?void 0:t.club_logo_url)||n.logoUrl)||(null===t||void 0===t?void 0:t.club_logo_url)||n.logoUrl||"/dist/img/logo-club-empty.svg",A=(null===t||void 0===t?void 0:t.club_name)||n.name||"Klub";return(0,m.jsx)("div",{className:"sparta-navbar-container",children:(0,m.jsxs)("div",{className:"sparta-navbar",children:[(0,m.jsx)("button",{"aria-label":"Menu",className:"sparta-navbar-toggle",onClick:()=>g(e=>!e),children:(0,m.jsxs)("div",{className:"sparta-burger-icon","aria-hidden":!0,children:[(0,m.jsx)("div",{className:"sparta-burger-line"}),(0,m.jsx)("div",{className:"sparta-burger-line"}),(0,m.jsx)("div",{className:"sparta-burger-line"})]})}),(0,m.jsx)(r.N_,{to:"/",className:"sparta-navbar-brand",onClick:()=>g(!1),children:(0,m.jsx)("img",{src:S,alt:A})}),(0,m.jsx)("nav",{className:"sparta-navbar-links",style:{display:x?"flex":void 0,flexWrap:"wrap"},children:z.map(e=>{!!(t=e.to)&&(p.pathname===t||p.pathname.startsWith((t||"")+"/"));var t;const n="sparta-button-tertiary";return e.items&&e.items.length>0&&("\u010cl\xe1nky"===e.label||"Blog"===e.label||(e.to||"").startsWith("/blog"))?(0,m.jsxs)(i.Fragment,{children:[(0,m.jsx)(r.N_,{to:e.to||"/blog",className:n,onClick:()=>g(!1),children:e.label}),e.items.map(t=>(0,m.jsx)(r.N_,{to:t.to,className:n,onClick:()=>g(!1),children:t.label},"".concat(e.label,"-").concat(t.to)))]},e.label):e.external&&e.to?(0,m.jsx)("a",{href:e.to,target:"_blank",rel:"noreferrer",className:n,onClick:()=>g(!1),children:e.label},e.label):(0,m.jsx)(r.N_,{to:e.to||"#",className:n,onClick:()=>g(!1),children:e.label},e.label)})})]})})}},16328:(e,t,n)=>{n.r(t),n.d(t,{default:()=>W});var a=n(89379),i=n(65043),o=n(6583),r=n(96870),s=n(87139),l=n(22107),c=n(98662),d=n(42703),u=n(35699),h=n(7189),m=n(67516),p=n(35929),x=n(56529),g=n(15071),v=n(11054),j=n(78460),b=n(85421),y=n(61724),f=n(96148),k=n(10202),_=n(80511),w=n(82595),z=n(67813),S=n(83201),A=n(3313),C=n(55395),E=n(30502),T=n(39081),D=n(72526),N=n(59781),R=n(29066),F=n(47704),P=n(1009),I=n(34636),M=n(38376),L=n(70579);const W=()=>{var e,t,n,W,U;const O=(0,E.d)(),{user:q}=(0,R.A)(),K="admin"===(null===q||void 0===q?void 0:q.role),B=(0,N.jE)(),[Z,V]=i.useState(""),[H,$]=i.useState(""),[J,G]=i.useState(""),[X,Y]=i.useState(!1),Q=(0,r.j)(),[ee,te]=i.useState(null),[ne,ae]=i.useState(null),ie=(0,D.I)({queryKey:["admin-shortlinks"],queryFn:F.Gf,staleTime:6e4}),oe=(0,D.I)({queryKey:["shortlinks-articles"],queryFn:()=>(0,I.GE)({published:!0,page_size:50}),staleTime:6e4}),re=(0,D.I)({queryKey:["shortlinks-events"],queryFn:()=>(0,M.kQ)(),staleTime:6e4}),se=i.useMemo(()=>[{label:"Dom\u016f",path:"/"},{label:"Blog",path:"/blog"},{label:"Kalend\xe1\u0159",path:"/kalendar"},{label:"Aktivity",path:"/aktivity"},{label:"Tabulky",path:"/tabulky"},{label:"Z\xe1pasy",path:"/zapasy"},{label:"Hr\xe1\u010di",path:"/hraci"},{label:"Sponzo\u0159i",path:"/sponzori"},{label:"Galerie",path:"/galerie"},{label:"Videa",path:"/videa"},{label:"Kontakt",path:"/kontakt"},{label:"O klubu",path:"/o-klubu"},{label:"Oble\u010den\xed",path:"/obleceni"}],[]);return(0,L.jsx)(o.A,{requireAdmin:!1,children:(0,L.jsxs)(l.a,{children:[(0,L.jsxs)(f.z,{justify:"space-between",mb:4,children:[(0,L.jsx)(T.E,{fontSize:"xl",fontWeight:"bold",children:"Zkr\xe1cen\xe9 odkazy"}),(0,L.jsx)(d.K,{"aria-label":"Obnovit",icon:(0,L.jsx)(P.wO2,{}),onClick:()=>B.invalidateQueries({queryKey:["admin-shortlinks"]})})]}),(0,L.jsxs)(l.a,{borderWidth:"1px",borderRadius:"lg",p:4,mb:6,bg:"bg.card",children:[(0,L.jsx)(T.E,{fontWeight:"semibold",mb:2,children:"Vytvo\u0159it nov\xfd odkaz"}),(0,L.jsxs)(f.z,{spacing:2,flexWrap:"wrap",children:[(0,L.jsxs)(y.l,{placeholder:"Vyberte c\xedl",value:Z,onChange:e=>V(e.target.value),flex:3,children:[(0,L.jsx)("option",{value:"",disabled:!0,children:"\u2014 Vnit\u0159n\xed str\xe1nky \u2014"}),se.map(e=>(0,L.jsx)("option",{value:"static:".concat(e.path),children:e.label},e.path)),(0,L.jsx)("option",{value:"",disabled:!0,children:"\u2014 \u010cl\xe1nky (publikovan\xe9) \u2014"}),((null===(e=oe.data)||void 0===e?void 0:e.data)||[]).map(e=>(0,L.jsx)("option",{value:"article:".concat(e.id,":").concat(e.slug||"").replace(/:$/,""),children:e.title},e.id)),(0,L.jsx)("option",{value:"",disabled:!0,children:"\u2014 Aktivity \u2014"}),(re.data||[]).filter(e=>!1!==(null===e||void 0===e?void 0:e.is_public)).slice(0,50).map(e=>(0,L.jsx)("option",{value:"event:".concat(e.id),children:e.title},e.id))]}),(0,L.jsx)(u.p,{placeholder:"Titulek (voliteln\xfd)",value:H,onChange:e=>$(e.target.value),flex:2}),(0,L.jsx)(u.p,{placeholder:"Vlastn\xed k\xf3d (voliteln\xe9)",value:J,onChange:e=>G(e.target.value),flex:1,maxLength:16,pattern:"[A-Za-z0-9_-]+",title:"Povoleno: p\xedsmena, \u010d\xedsla, -, _ (max 16 znak\u016f)"}),(0,L.jsx)(c.$,{onClick:async()=>{const e=Z.trim();if(e)try{Y(!0);const t=J.trim(),n=t?t.replace(/[^a-zA-Z0-9_-]/g,"").slice(0,16):void 0;let i,o,r="";const s="undefined"!==typeof window?window.location.origin:"";if(e.startsWith("static:")){r=s+e.substring(7),i="page"}else if(e.startsWith("article:")){const t=e.substring(8),[n,a]=t.split(":"),l=Number(n);i="article",isNaN(l)||(o=l),r=s+"/articles/".concat(n)}else if(e.startsWith("event:")){const t=e.substring(6),n=Number(t);i="event",isNaN(n)||(o=n),r=s+"/aktivita/".concat(t)}if(!r)return void O({title:"Neplatn\xe1 volba c\xedle",status:"error"});const l=!n&&o&&i?"article"===i?"a".concat(o):"event"===i?"e".concat(o):void 0:void 0,c=await(0,F.fn)((0,a.A)((0,a.A)({target_url:r,title:H.trim()||void 0,code:n||l,active:!0},i?{source_type:i}:{}),o?{source_id:o}:{}));await navigator.clipboard.writeText(c.short_url),O({title:"Odkaz vytvo\u0159en",description:"Zkop\xedrov\xe1no: ".concat(c.short_url),status:"success"}),V(""),$(""),G(""),B.invalidateQueries({queryKey:["admin-shortlinks"]})}catch(r){var t,n,i,o;const e=(null===r||void 0===r||null===(t=r.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===r||void 0===r||null===(i=r.response)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.details)||(null===r||void 0===r?void 0:r.message)||"Zkuste to znovu";O({title:"Vytvo\u0159en\xed selhalo",description:String(e),status:"error"})}finally{Y(!1)}else O({title:"Vyberte c\xedl odkazu",status:"warning"})},isLoading:X,colorScheme:"blue",children:"Vytvo\u0159it"})]})]}),(0,L.jsx)(l.a,{borderWidth:"1px",borderRadius:"lg",overflowX:"auto",bg:"bg.card",children:(0,L.jsxs)(_.X,{size:"sm",children:[(0,L.jsx)(A.d,{children:(0,L.jsxs)(C.Tr,{children:[(0,L.jsx)(S.Th,{children:"K\xf3d"}),(0,L.jsx)(S.Th,{children:"C\xedl"}),(0,L.jsx)(S.Th,{children:"Titulek"}),(0,L.jsx)(S.Th,{children:"Zdroj"}),(0,L.jsx)(S.Th,{children:"Prokliky"}),(0,L.jsx)(S.Th,{children:"Akce"})]})}),(0,L.jsxs)(w.N,{children:[null===(t=ie.data)||void 0===t||null===(n=t.items)||void 0===n?void 0:n.map(e=>{var t;const n="".concat(window.location.origin,"/s/").concat(e.code),a=e.source_type?"".concat(e.source_type).concat(e.source_id?"#".concat(e.source_id):""):"-";return(0,L.jsxs)(C.Tr,{children:[(0,L.jsx)(z.Td,{children:(0,L.jsx)(s.E,{colorScheme:"blue",children:e.code})}),(0,L.jsx)(z.Td,{maxW:"420px",children:(0,L.jsx)(h.N,{href:e.target_url,isExternal:!0,color:"blue.600",children:e.target_url})}),(0,L.jsx)(z.Td,{children:e.title||"-"}),(0,L.jsx)(z.Td,{children:a}),(0,L.jsx)(z.Td,{children:null!==(t=e.click_count)&&void 0!==t?t:0}),(0,L.jsx)(z.Td,{children:(0,L.jsxs)(f.z,{children:[(0,L.jsx)(d.K,{"aria-label":"Otev\u0159\xedt kr\xe1tkou URL",icon:(0,L.jsx)(P.HaR,{}),as:h.N,href:n,isExternal:!0}),(0,L.jsx)(d.K,{"aria-label":"Zkop\xedrovat",icon:(0,L.jsx)(P.ydS,{}),onClick:async()=>{await navigator.clipboard.writeText(n),O({title:"Zkop\xedrov\xe1no",description:n,status:"success",duration:2e3})}}),K&&(0,L.jsx)(d.K,{"aria-label":"Statistiky",icon:(0,L.jsx)(P.vQY,{}),onClick:()=>(async e=>{try{te(e),ae(null),Q.onOpen();const t=await(0,F.IK)(e.id);ae(t)}catch(t){O({title:"Na\u010dten\xed statistik selhalo",status:"error"})}})(e)})]})})]},e.id)}),(!(null!==(W=ie.data)&&void 0!==W&&W.items)||0===ie.data.items.length)&&(0,L.jsx)(C.Tr,{children:(0,L.jsx)(z.Td,{colSpan:6,children:(0,L.jsx)(T.E,{p:3,children:"\u017d\xe1dn\xe9 odkazy"})})})]})]})}),K&&(0,L.jsxs)(j.aF,{isOpen:Q.isOpen,onClose:Q.onClose,size:"xl",children:[(0,L.jsx)(v.m,{}),(0,L.jsxs)(b.$,{children:[(0,L.jsxs)(g.r,{children:["Statistiky: ",null===ee||void 0===ee?void 0:ee.code]}),(0,L.jsx)(p.s,{}),(0,L.jsx)(m.c,{children:ne?(0,L.jsxs)(k.T,{align:"stretch",spacing:3,children:[(0,L.jsxs)(l.a,{children:[(0,L.jsx)(T.E,{fontWeight:"semibold",mb:1,children:"Prokliky za posledn\xedch 30 dn\xed"}),(0,L.jsxs)(_.X,{size:"sm",variant:"simple",children:[(0,L.jsx)(A.d,{children:(0,L.jsxs)(C.Tr,{children:[(0,L.jsx)(S.Th,{children:"Den"}),(0,L.jsx)(S.Th,{isNumeric:!0,children:"Po\u010det"})]})}),(0,L.jsx)(w.N,{children:null===(U=ne.timeseries)||void 0===U?void 0:U.map((e,t)=>(0,L.jsxs)(C.Tr,{children:[(0,L.jsx)(z.Td,{children:e.date}),(0,L.jsx)(z.Td,{isNumeric:!0,children:e.count})]},t))})]})]}),(0,L.jsxs)(l.a,{children:[(0,L.jsx)(T.E,{fontWeight:"semibold",mb:1,children:"Referrers (Top)"}),(0,L.jsxs)(_.X,{size:"sm",variant:"simple",children:[(0,L.jsx)(A.d,{children:(0,L.jsxs)(C.Tr,{children:[(0,L.jsx)(S.Th,{children:"Referrer"}),(0,L.jsx)(S.Th,{isNumeric:!0,children:"Po\u010det"})]})}),(0,L.jsx)(w.N,{children:(ne.referrers||[]).map((e,t)=>(0,L.jsxs)(C.Tr,{children:[(0,L.jsx)(z.Td,{children:e.Referrer||"-"}),(0,L.jsx)(z.Td,{isNumeric:!0,children:e.Count})]},t))})]})]}),(0,L.jsxs)(l.a,{children:[(0,L.jsx)(T.E,{fontWeight:"semibold",mb:1,children:"UTM kombinace (Top)"}),(0,L.jsxs)(_.X,{size:"sm",variant:"simple",children:[(0,L.jsx)(A.d,{children:(0,L.jsxs)(C.Tr,{children:[(0,L.jsx)(S.Th,{children:"Source"}),(0,L.jsx)(S.Th,{children:"Medium"}),(0,L.jsx)(S.Th,{children:"Campaign"}),(0,L.jsx)(S.Th,{isNumeric:!0,children:"Po\u010det"})]})}),(0,L.jsx)(w.N,{children:(ne.utms||[]).map((e,t)=>(0,L.jsxs)(C.Tr,{children:[(0,L.jsx)(z.Td,{children:e.Source||"-"}),(0,L.jsx)(z.Td,{children:e.Medium||"-"}),(0,L.jsx)(z.Td,{children:e.Campaign||"-"}),(0,L.jsx)(z.Td,{isNumeric:!0,children:e.Count})]},t))})]})]})]}):(0,L.jsx)(T.E,{children:"Na\u010d\xedt\xe1n\xed\u2026"})}),(0,L.jsx)(x.j,{children:(0,L.jsx)(c.$,{onClick:Q.onClose,children:"Zav\u0159\xedt"})})]})]})]})})}},16349:(e,t,n)=>{n.r(t),n.d(t,{default:()=>te});var a=n(44093),i=n(22107),o=n(96148),r=n(94217),s=n(53332),l=n(78149),c=n(94085),d=n(25011),u=n(39081),h=n(28846),m=n(88787),p=n(85871),x=n(33430),g=n(34334),v=n(98662),j=n(73212),b=n(99032),y=n(7189),f=n(10202),k=n(82459),_=n(80511),w=n(3313),z=n(55395),S=n(83201),A=n(82595),C=n(67813),E=n(87139),T=n(99956),D=n(72526),N=n(6583),R=n(40548),F=n(54156),P=n(33572),I=n(85369),M=n(35475),L=n(46291),W=n(99863),U=n(69023),O=n(24653),q=n(6175),K=n(70579);const B=()=>{const{data:e=[],isLoading:t,error:n}=(0,D.I)({queryKey:["recentArticles"],queryFn:async()=>{try{const{data:e}=await L.FH.get("/articles",{params:{page:1,page_size:3,published:!0}});return e.items||[]}catch(e){return console.error("Error fetching articles:",e),[]}},staleTime:3e5});return t?(0,K.jsx)(W.x,{title:"Posledn\xed \u010dl\xe1nky",icon:I.Nhm,children:(0,K.jsx)(f.T,{spacing:4,align:"stretch",children:[1,2,3].map(e=>(0,K.jsxs)(i.a,{children:[(0,K.jsx)(b.E,{height:"120px",mb:2,borderRadius:"md"}),(0,K.jsx)(b.E,{height:"20px",mb:2,width:"80%"}),(0,K.jsx)(b.E,{height:"16px",width:"60%"})]},e))})}):n||!e.length?(0,K.jsx)(W.x,{title:"Posledn\xed \u010dl\xe1nky",icon:I.Nhm,children:(0,K.jsx)(f.T,{p:4,spacing:4,children:(0,K.jsxs)(i.a,{p:4,bg:"gray.50",borderRadius:"md",textAlign:"center",w:"full",children:[(0,K.jsx)(d.I,{as:I.Nhm,boxSize:6,color:"gray.400",mb:2}),(0,K.jsx)(u.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 \u010dl\xe1nky nebyly nalezeny"})]})})}):(0,K.jsx)(W.x,{title:"Posledn\xed \u010dl\xe1nky",icon:I.Nhm,children:(0,K.jsxs)(f.T,{spacing:3,align:"stretch",divider:(0,K.jsx)(i.a,{borderBottomWidth:"1px",borderColor:"gray.100"}),children:[e.map(e=>{var t,n,a;return(0,K.jsx)(y.N,{as:M.N_,to:"/clanky/".concat(e.slug),_hover:{textDecoration:"none"},display:"block",children:(0,K.jsx)(i.a,{_hover:{bg:"gray.50"},borderRadius:"md",p:2,children:(0,K.jsxs)(o.z,{align:"flex-start",spacing:3,children:[(0,K.jsx)(i.a,{flexShrink:0,width:"60px",height:"60px",bg:"gray.100",borderRadius:"md",overflow:"hidden",position:"relative",children:e.image_url?(0,K.jsx)(P._,{src:e.image_url,alt:e.title,width:"100%",height:"100%",objectFit:"cover"}):(0,K.jsx)(i.a,{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bg:"gray.200",children:(0,K.jsx)(d.I,{as:I.Nhm,color:"gray.400",boxSize:5})})}),(0,K.jsxs)(i.a,{flex:1,minW:0,children:[(0,K.jsx)(u.E,{fontWeight:"medium",fontSize:"sm",noOfLines:2,mb:1,children:e.title}),(0,K.jsxs)(o.z,{spacing:3,fontSize:"xs",color:"gray.500",children:[(0,K.jsxs)(o.z,{spacing:1,children:[(0,K.jsx)(d.I,{as:I.x$1,boxSize:3}),(0,K.jsx)(u.E,{children:null!==(t=e.author)&&void 0!==t&&t.first_name&&null!==(n=e.author)&&void 0!==n&&n.last_name?"".concat(e.author.first_name," ").concat(e.author.last_name):(null===(a=e.author)||void 0===a?void 0:a.email)||"Autor"})]}),(0,K.jsxs)(o.z,{spacing:1,children:[(0,K.jsx)(d.I,{as:I.bfZ,boxSize:3}),(0,K.jsx)(u.E,{children:e.created_at&&(0,U.GP)((0,O.H)(e.created_at),"d. M. yyyy",{locale:q.cs})})]})]})]})]})})},e.id)}),(0,K.jsx)(i.a,{textAlign:"right",mt:2,children:(0,K.jsx)(y.N,{as:M.N_,to:"/admin/clanky",color:"blue.500",fontWeight:"medium",fontSize:"sm",_hover:{textDecoration:"underline"},children:"Zobrazit v\u0161echny \u010dl\xe1nky \u2192"})})]})})};var Z=n(27024),V=n(44318),H=n(74770);const $=()=>{const{data:e,isLoading:t}=(0,D.I)({queryKey:["public-settings"],queryFn:H.l3,staleTime:3e5}),{data:n,isLoading:a,error:r}=(0,D.I)({queryKey:["facr-tables-cache"],queryFn:V.g,staleTime:3e5}),s=e=>{let t=String(e||"");t=t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),t=t.replace(/[\u2012\u2013\u2014\u2015\u2212]/g,"-"),t=t.replace(/[,\s]*(z\.?\s*s\.?|o\.?\s*s\.?)\s*$/g,"");const n=["fotbalovy klub","sportovni klub","telovychovna jednota","skolni sportovni klub","fotbal","futsal"];for(const a of n){const e=new RegExp("(^|\\b)".concat(a,"(\\b|$)"),"g");t=t.replace(e," ")}return t=t.replace(/\b(1\.)?\s*(sfc|afc|fc|fk|mfk|tj|sk|afk)\b\.?/g," "),t=t.replace(/[\.,!;:()\[\]{}]/g," "),t=t.replace(/\s+/g," ").trim(),t},l=s(null===e||void 0===e?void 0:e.club_name),c=(()=>{const e={},t=Array.isArray(null===n||void 0===n?void 0:n.competitions)?n.competitions:[];for(const n of t){var a;const t=Array.isArray(null===n||void 0===n||null===(a=n.table)||void 0===a?void 0:a.overall)?n.table.overall:[];for(const n of t){const t=((null===n||void 0===n?void 0:n.team)||"").trim();if(!t)continue;const a=s(t);a&&a===l||(e[a]||(e[a]={id:a,name:t,logoUrl:null===n||void 0===n?void 0:n.team_logo_url}))}}return Object.values(e).slice(0,8)})();return t||a?(0,K.jsx)(W.x,{title:"T\xfdmy klubu",icon:I.YXz,children:(0,K.jsx)(f.T,{spacing:3,align:"stretch",children:[1,2,3].map(e=>(0,K.jsxs)(o.z,{p:2,spacing:3,children:[(0,K.jsx)(b.E,{boxSize:"40px",borderRadius:"md"}),(0,K.jsxs)(i.a,{flex:1,children:[(0,K.jsx)(b.E,{height:"16px",width:"80%",mb:1}),(0,K.jsx)(b.E,{height:"12px",width:"60%"})]})]},e))})}):r?(0,K.jsx)(W.x,{title:"T\xfdmy klubu",icon:I.YXz,children:(0,K.jsxs)(m.F,{status:"info",variant:"left-accent",children:[(0,K.jsx)(p._,{}),"Nepoda\u0159ilo se na\u010d\xedst seznam t\xfdm\u016f z cache."]})}):0===c.length?(0,K.jsx)(W.x,{title:"T\xfdmy klubu",icon:I.YXz,children:(0,K.jsx)(f.T,{p:4,spacing:4,children:(0,K.jsxs)(i.a,{p:4,bg:"gray.50",borderRadius:"md",textAlign:"center",w:"full",children:[(0,K.jsx)(d.I,{as:I.i0U,boxSize:6,color:"gray.400",mb:2}),(0,K.jsx)(u.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 t\xfdmy nebyly nalezeny"})]})})}):(0,K.jsx)(W.x,{title:"T\xfdmy klubu",icon:I.YXz,children:(0,K.jsx)(f.T,{spacing:3,align:"stretch",divider:(0,K.jsx)(i.a,{borderBottomWidth:"1px",borderColor:"gray.100"}),children:c.map(e=>(0,K.jsx)(i.a,{p:3,_hover:{bg:"gray.50",cursor:"pointer"},borderRadius:"md",children:(0,K.jsxs)(o.z,{spacing:3,children:[(0,K.jsx)(Z.e,{name:e.name,src:e.logoUrl,size:"sm",bg:"blue.100",color:"blue.700",icon:(0,K.jsx)(I.i0U,{})}),(0,K.jsx)(i.a,{flex:1,minW:0,children:(0,K.jsx)(u.E,{fontWeight:"medium",isTruncated:!0,children:e.name})})]})},e.id))})})};var J=n(88019);const G=(e,t)=>{const n=e.toLowerCase();return n.includes("sunny")||n.includes("clear")?t?I.wQq:I.V6H:n.includes("partly cloudy")||n.includes("partly sunny")?I.vZy:n.includes("cloudy")||n.includes("overcast")?I.tmj:n.includes("rain")||n.includes("drizzle")||n.includes("shower")?I.bk_:n.includes("snow")||n.includes("sleet")||n.includes("blizzard")?I.YhS:I.tmj},X=()=>{const{data:e,isLoading:t,error:n,refetch:r}=(0,D.I)({queryKey:["weather","club"],queryFn:async()=>(await L.Ay.get("/weather/club")).data,staleTime:6e5,refetchInterval:9e5}),s=(0,a.dU)("white","gray.800"),l=(0,a.dU)("gray.200","gray.700"),c=(0,a.dU)("gray.600","gray.400");if(t)return(0,K.jsx)(i.a,{bg:s,p:6,borderRadius:"xl",boxShadow:"md",borderWidth:"1px",borderColor:l,children:(0,K.jsxs)(f.T,{spacing:4,align:"stretch",children:[(0,K.jsx)(b.E,{height:"20px",width:"60%"}),(0,K.jsx)(b.E,{height:"40px",width:"80%"}),(0,K.jsx)(b.E,{height:"16px",width:"40%"}),(0,K.jsx)(b.E,{height:"16px",width:"50%"})]})});if(n||!e)return(0,K.jsx)(i.a,{bg:s,p:6,borderRadius:"xl",boxShadow:"md",borderWidth:"1px",borderColor:l,children:(0,K.jsxs)(f.T,{spacing:4,align:"center",children:[(0,K.jsx)(d.I,{as:I.tmj,boxSize:12,color:"gray.400"}),(0,K.jsx)(u.E,{color:"gray.500",textAlign:"center",children:"Po\u010das\xed nen\xed dostupn\xe9"}),(0,K.jsx)(u.E,{fontSize:"sm",color:"gray.400",textAlign:"center",children:"Zkuste to znovu pozd\u011bji"})]})});const h=G(e.current.condition.text,e.current.is_day),m=(p=e.current.uv)<=2?"green":p<=5?"yellow":p<=7?"orange":p<=10?"red":"purple";var p;const x=(e=>e<=2?"N\xedzk\xe9":e<=5?"St\u0159edn\xed":e<=7?"Vysok\xe9":e<=10?"Velmi vysok\xe9":"Extr\xe9mn\xed")(e.current.uv);return(0,K.jsxs)(i.a,{bg:s,p:6,borderRadius:"xl",boxShadow:"md",borderWidth:"1px",borderColor:l,position:"relative",overflow:"hidden",children:[(0,K.jsx)(i.a,{position:"absolute",top:4,right:4,children:(0,K.jsx)(T.m,{label:"Obnovit po\u010das\xed",children:(0,K.jsx)(i.a,{as:"button",onClick:()=>r(),p:2,borderRadius:"md",_hover:{bg:(0,a.dU)("gray.100","gray.700")},transition:"all 0.2s",children:(0,K.jsx)(d.I,{as:I.KP4,color:c,boxSize:4})})})}),(0,K.jsxs)(f.T,{spacing:4,align:"stretch",children:[(0,K.jsxs)(o.z,{spacing:2,color:c,children:[(0,K.jsx)(d.I,{as:I.vq8,boxSize:3}),(0,K.jsxs)(u.E,{fontSize:"sm",fontWeight:"medium",children:[e.location.name,e.location.region&&", ".concat(e.location.region)]})]}),(0,K.jsxs)(o.z,{spacing:4,align:"center",children:[(0,K.jsxs)(f.T,{spacing:1,align:"center",minW:"80px",children:[(0,K.jsx)(d.I,{as:h,boxSize:12,color:"blue.400"}),(0,K.jsx)(u.E,{fontSize:"sm",color:c,textAlign:"center",children:e.current.condition.text})]}),(0,K.jsxs)(f.T,{spacing:1,align:"start",flex:1,children:[(0,K.jsxs)(u.E,{fontSize:"4xl",fontWeight:"bold",lineHeight:"1",children:[Math.round(e.current.temp_c),"\xb0C"]}),(0,K.jsxs)(u.E,{fontSize:"sm",color:c,children:["Pocitov\u011b ",Math.round(e.current.feelslike_c),"\xb0C"]})]})]}),(0,K.jsx)(k.c,{}),(0,K.jsxs)(j.r,{columns:2,spacing:3,children:[(0,K.jsxs)(o.z,{spacing:2,children:[(0,K.jsx)(d.I,{as:I.YiW,boxSize:4,color:c}),(0,K.jsxs)(f.T,{spacing:0,align:"start",children:[(0,K.jsx)(u.E,{fontSize:"xs",color:c,children:"V\xedtr"}),(0,K.jsxs)(u.E,{fontSize:"sm",fontWeight:"medium",children:[e.current.wind_kph," km/h ",(g=e.current.wind_degree,["S","SV","V","JV","J","JZ","Z","SZ"][Math.round(g/45)%8])]})]})]}),(0,K.jsxs)(o.z,{spacing:2,children:[(0,K.jsx)(d.I,{as:I.DFS,boxSize:4,color:c}),(0,K.jsxs)(f.T,{spacing:0,align:"start",children:[(0,K.jsx)(u.E,{fontSize:"xs",color:c,children:"Vlhkost"}),(0,K.jsxs)(u.E,{fontSize:"sm",fontWeight:"medium",children:[e.current.humidity,"%"]})]})]}),(0,K.jsxs)(o.z,{spacing:2,children:[(0,K.jsx)(d.I,{as:I.Ny1,boxSize:4,color:c}),(0,K.jsxs)(f.T,{spacing:0,align:"start",children:[(0,K.jsx)(u.E,{fontSize:"xs",color:c,children:"Viditelnost"}),(0,K.jsxs)(u.E,{fontSize:"sm",fontWeight:"medium",children:[e.current.vis_km," km"]})]})]}),(0,K.jsxs)(o.z,{spacing:2,children:[(0,K.jsx)(d.I,{as:I.R_2,boxSize:4,color:c}),(0,K.jsxs)(f.T,{spacing:0,align:"start",children:[(0,K.jsx)(u.E,{fontSize:"xs",color:c,children:"Tlak"}),(0,K.jsxs)(u.E,{fontSize:"sm",fontWeight:"medium",children:[e.current.pressure_mb," hPa"]})]})]})]}),(0,K.jsxs)(i.a,{children:[(0,K.jsxs)(o.z,{justify:"space-between",mb:1,children:[(0,K.jsx)(u.E,{fontSize:"xs",color:c,children:"UV Index"}),(0,K.jsxs)(E.E,{colorScheme:m,fontSize:"xs",children:[x," (",e.current.uv,")"]})]}),(0,K.jsx)(J.k,{value:Math.min(10*e.current.uv,100),size:"xs",colorScheme:m,borderRadius:"md"})]}),e.forecast.forecastday.length>1&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(k.c,{}),(0,K.jsx)(u.E,{fontSize:"sm",fontWeight:"bold",mb:2,children:"P\u0159edpov\u011b\u010f na n\xe1sleduj\xedc\xed dny"}),(0,K.jsx)(j.r,{columns:2,spacing:3,children:e.forecast.forecastday.slice(1,3).map((e,t)=>{const n=G(e.day.condition.text,1),r=new Date(e.date).toLocaleDateString("cs-CZ",{weekday:"short"});return(0,K.jsx)(i.a,{p:3,bg:(0,a.dU)("gray.50","gray.700"),borderRadius:"md",border:"1px solid",borderColor:(0,a.dU)("gray.200","gray.600"),children:(0,K.jsxs)(o.z,{spacing:3,align:"center",children:[(0,K.jsx)(d.I,{as:n,boxSize:6,color:"blue.400"}),(0,K.jsxs)(f.T,{spacing:1,align:"start",flex:1,children:[(0,K.jsx)(u.E,{fontSize:"xs",fontWeight:"medium",children:r}),(0,K.jsxs)(o.z,{spacing:2,children:[(0,K.jsxs)(u.E,{fontSize:"sm",fontWeight:"bold",children:[Math.round(e.day.maxtemp_c),"\xb0"]}),(0,K.jsxs)(u.E,{fontSize:"sm",color:c,children:[Math.round(e.day.mintemp_c),"\xb0"]})]}),e.day.daily_chance_of_rain>0&&(0,K.jsxs)(E.E,{size:"xs",colorScheme:"blue",children:[e.day.daily_chance_of_rain,"% d\xe9\u0161\u0165"]})]})]})},t)})})]}),(0,K.jsxs)(u.E,{fontSize:"xs",color:c,textAlign:"center",children:["Aktualizov\xe1no: ",new Date(e.current.last_updated).toLocaleTimeString("cs-CZ",{hour:"2-digit",minute:"2-digit"})]})]})]});var g},Y=()=>(0,K.jsx)(i.a,{mt:6,children:(0,K.jsxs)(m.F,{status:"info",borderRadius:"md",children:[(0,K.jsx)(p._,{}),(0,K.jsxs)(u.E,{children:["Pro kompletn\xed dokumentaci nav\u0161tivte"," ",(0,K.jsx)(y.N,{href:"/docs",color:"blue.600",fontWeight:"semibold",textDecoration:"underline",children:"dokumentaci administrace"})]})]})});var Q=n(29066);const ee=e=>{let{label:t,value:n,help:u,icon:h,color:m="blue"}=e;const p=(0,a.dU)("white","gray.800"),x=(0,a.dU)("gray.200","gray.700"),g=(0,a.dU)("".concat(m,".50"),"".concat(m,".900")),v=(0,a.dU)("".concat(m,".600"),"".concat(m,".300"));return(0,K.jsx)(i.a,{bg:p,p:6,borderRadius:"xl",boxShadow:"md",borderWidth:"1px",borderColor:x,_hover:{shadow:"lg",transform:"translateY(-2px)"},transition:"all 0.2s",children:(0,K.jsxs)(o.z,{justify:"space-between",align:"start",mb:3,children:[(0,K.jsxs)(r.r,{children:[(0,K.jsx)(s.v,{fontSize:"sm",fontWeight:"medium",color:"gray.500",children:t}),(0,K.jsx)(l.k,{fontSize:"3xl",fontWeight:"bold",mt:2,children:n}),u&&(0,K.jsx)(c.h,{fontSize:"xs",mt:1,children:u})]}),h&&(0,K.jsx)(i.a,{p:3,bg:g,borderRadius:"xl",children:(0,K.jsx)(d.I,{as:h,boxSize:6,color:v})})]})})},te=()=>{var e,t,n,r,s,l,c,P,W,U,O,q,Z,H,J,G,te;const{user:ne}=(0,Q.A)(),ae=String((null===ne||void 0===ne?void 0:ne.role)||"").toLowerCase(),ie="editor"===ae,{data:oe,isLoading:re,error:se,refetch:le,isFetching:ce}=(0,D.I)({queryKey:["admin","analytics"],queryFn:R.P5,staleTime:3e5}),{data:de,isLoading:ue}=(0,D.I)({queryKey:["admin","analytics","overview"],queryFn:R.Or,staleTime:3e5}),{data:he}=(0,D.I)({queryKey:["admin","analytics","top-pages"],queryFn:()=>(0,R.MC)(5),staleTime:6e5}),{data:me}=(0,D.I)({queryKey:["admin","analytics","umami-events"],queryFn:async()=>(await L.Ay.get("/admin/insights/breakdown/event?days=7")).data||[],staleTime:6e5}),{data:pe}=(0,D.I)({queryKey:["facr-tables-cache"],queryFn:V.g,staleTime:3e5}),xe=(Array.isArray(null===pe||void 0===pe?void 0:pe.competitions)&&pe.competitions.length,(()=>{try{const t=Array.isArray(null===pe||void 0===pe?void 0:pe.competitions)?pe.competitions:[],n=new Set;for(const a of t){var e;const t=Array.isArray(null===a||void 0===a||null===(e=a.table)||void 0===e?void 0:e.overall)?a.table.overall:[];for(const e of t){const t=String((null===e||void 0===e?void 0:e.team)||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase();t&&n.add(t)}}return n.size}catch(t){return 0}})(),ie?[{label:"Nov\xfd \u010dl\xe1nek",icon:I.Nhm,to:"/admin/clanky",color:"green"},{label:"Nov\xe1 aktivita",icon:I.bfZ,to:"/admin/aktivity",color:"teal"},{label:"Videa",icon:I.HiP,to:"/admin/videa",color:"purple"},{label:"Galerie",icon:I.kQE,to:"/admin/galerie",color:"pink"}]:[{label:"Nastaven\xed",icon:I.Pcn,to:"/admin/nastaveni",color:"blue"},{label:"Dokumentace",icon:I.vd0,to:"/admin/docs",color:"purple"},{label:"Nov\xfd \u010dl\xe1nek",icon:I.uoG,to:"/admin/clanky",color:"green"},{label:"Prefetch",icon:I.YYR,to:"/admin/prefetch",color:"orange"}]);return(0,K.jsx)(N.A,{requireAdmin:!1,children:(0,K.jsxs)(i.a,{maxW:"1600px",mx:"auto",children:[(0,K.jsxs)(i.a,{mb:8,children:[(0,K.jsxs)(o.z,{spacing:3,mb:2,children:[(0,K.jsx)(u.E,{fontSize:"3xl",children:"\ud83d\udc4b"}),(0,K.jsx)(h.D,{size:"xl",children:"V\xedtejte v administraci"})]}),(0,K.jsx)(u.E,{color:"gray.500",fontSize:"lg",children:"P\u0159ehled kl\xed\u010dov\xfdch statistik a rychl\xfd p\u0159\xedstup k nejd\u016fle\u017eit\u011bj\u0161\xedm funkc\xedm"})]}),!!se&&(0,K.jsxs)(m.F,{status:"error",mb:4,borderRadius:"md",children:[(0,K.jsx)(p._,{}),(0,K.jsxs)(i.a,{children:[(0,K.jsx)(x.X,{children:"Nelze na\u010d\xedst statistiky"}),(0,K.jsx)(g.T,{children:"Zkontrolujte p\u0159ipojen\xed nebo p\u0159ihl\xe1\u0161en\xed spr\xe1vce a zkuste to znovu."})]}),(0,K.jsx)(v.$,{onClick:()=>le(),ml:"auto",size:"sm",isLoading:ce,children:"Zkusit znovu"})]}),(0,K.jsx)(j.r,{columns:{base:1,sm:2,lg:3},spacing:4,mb:6,children:re?(0,K.jsx)(K.Fragment,{children:[1,2,3].map(e=>(0,K.jsxs)(i.a,{bg:"white",p:4,borderRadius:"lg",boxShadow:"sm",borderWidth:"1px",children:[(0,K.jsx)(b.E,{height:"20px",width:"40%",mb:2}),(0,K.jsx)(b.E,{height:"28px",width:"50%",mb:2}),(0,K.jsx)(b.E,{height:"16px",width:"35%"})]},e))}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ee,{label:"U\u017eivatel\xe9 (admin)",value:null!==(e=null===oe||void 0===oe||null===(t=oe.users)||void 0===t?void 0:t.total)&&void 0!==e?e:"\u2014",help:null!==oe&&void 0!==oe&&oe.users?"Nov\xfdch tento t\xfdden: ".concat(null!==(n=oe.users.new_this_week)&&void 0!==n?n:0):void 0,icon:I.YXz,color:"blue"}),(0,K.jsx)(ee,{label:"Ud\xe1losti",value:null!==(r=null===oe||void 0===oe||null===(s=oe.events)||void 0===s?void 0:s.total)&&void 0!==r?r:"\u2014",help:null!==oe&&void 0!==oe&&oe.events?"Nadch\xe1zej\xedc\xed: ".concat(null!==(l=oe.events.upcoming)&&void 0!==l?l:0):void 0,icon:I.bfZ,color:"green"}),(0,K.jsx)(ee,{label:"\u010cl\xe1nky",value:null!==(c=null===oe||void 0===oe||null===(P=oe.articles)||void 0===P?void 0:P.total)&&void 0!==c?c:"\u2014",help:null!==oe&&void 0!==oe&&oe.articles?"Publikovan\xfdch: ".concat(null!==(W=oe.articles.published)&&void 0!==W?W:0):void 0,icon:I.Nhm,color:"purple"}),(0,K.jsx)(ee,{label:"Zobrazen\xed str\xe1nek",value:null!==(U=null===de||void 0===de||null===(O=de.total_page_views)||void 0===O?void 0:O.toLocaleString("cs-CZ"))&&void 0!==U?U:"\u2014",help:de?"Dnes: ".concat(null!==(q=de.page_views_today)&&void 0!==q?q:0):void 0,icon:I.Ny1,color:"cyan"}),(0,K.jsx)(ee,{label:"Unik\xe1tn\xed n\xe1v\u0161t\u011bvn\xedci",value:null!==(Z=null===de||void 0===de||null===(H=de.unique_visitors)||void 0===H?void 0:H.toLocaleString("cs-CZ"))&&void 0!==Z?Z:"\u2014",help:de?"Tento t\xfdden: ".concat(null!==(J=de.unique_visitors_week)&&void 0!==J?J:0):void 0,icon:I.YYR,color:"teal"}),(0,K.jsx)(ee,{label:"Zobrazen\xed (t\xfdden)",value:null!==(G=null===de||void 0===de||null===(te=de.page_views_week)||void 0===te?void 0:te.toLocaleString("cs-CZ"))&&void 0!==G?G:"\u2014",help:"Za posledn\xedch 7 dn\xed",icon:I.ugv,color:"orange"})]})}),(0,K.jsxs)(i.a,{mb:8,children:[(0,K.jsx)(h.D,{size:"md",mb:4,children:"Rychl\xe9 akce"}),(0,K.jsx)(j.r,{columns:{base:2,md:4},spacing:4,children:xe.map((e,t)=>(0,K.jsx)(y.N,{as:M.N_,to:e.to,_hover:{textDecoration:"none"},children:(0,K.jsx)(i.a,{bg:(0,a.dU)("white","gray.800"),p:4,borderRadius:"lg",borderWidth:"1px",borderColor:(0,a.dU)("gray.200","gray.700"),textAlign:"center",cursor:"pointer",_hover:{shadow:"lg",transform:"translateY(-2px)",borderColor:"".concat(e.color,".400")},transition:"all 0.2s",children:(0,K.jsxs)(f.T,{spacing:2,children:[(0,K.jsx)(i.a,{p:3,bg:(0,a.dU)("".concat(e.color,".50"),"".concat(e.color,".900")),borderRadius:"lg",children:(0,K.jsx)(d.I,{as:e.icon,boxSize:6,color:(0,a.dU)("".concat(e.color,".600"),"".concat(e.color,".300"))})}),(0,K.jsx)(u.E,{fontWeight:"semibold",fontSize:"sm",children:e.label})]})})},t))})]}),(0,K.jsx)(k.c,{my:8}),!ie&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(h.D,{size:"md",mb:4,children:"Analytika n\xe1v\u0161t\u011bvnosti"}),(0,K.jsxs)(j.r,{columns:{base:1,lg:2},spacing:6,mb:8,children:[(0,K.jsxs)(i.a,{bg:(0,a.dU)("white","gray.800"),p:5,borderRadius:"xl",boxShadow:"md",borderWidth:"1px",borderColor:(0,a.dU)("gray.200","gray.700"),children:[(0,K.jsxs)(o.z,{justify:"space-between",mb:4,children:[(0,K.jsx)(u.E,{fontWeight:"bold",fontSize:"lg",children:"Nejnav\u0161t\u011bvovan\u011bj\u0161\xed str\xe1nky"}),(0,K.jsx)(y.N,{as:M.N_,to:"/admin/analytika",color:"blue.500",fontSize:"sm",fontWeight:"semibold",children:"V\xedce \u2192"})]}),he&&he.length>0?(0,K.jsxs)(_.X,{size:"sm",variant:"simple",children:[(0,K.jsx)(w.d,{children:(0,K.jsxs)(z.Tr,{children:[(0,K.jsx)(S.Th,{children:"Str\xe1nka"}),(0,K.jsx)(S.Th,{isNumeric:!0,children:"Zobrazen\xed"}),(0,K.jsx)(S.Th,{isNumeric:!0,children:"N\xe1v\u0161t\u011bvn\xedci"})]})}),(0,K.jsx)(A.N,{children:he.map((e,t)=>(0,K.jsxs)(z.Tr,{children:[(0,K.jsx)(C.Td,{fontSize:"sm",children:(0,K.jsx)(u.E,{isTruncated:!0,maxW:"200px",title:e.page_name||e.page_path,children:e.page_name||e.page_path})}),(0,K.jsx)(C.Td,{isNumeric:!0,fontWeight:"semibold",children:e.view_count}),(0,K.jsx)(C.Td,{isNumeric:!0,children:e.unique_visitors})]},t))})]}):(0,K.jsx)(u.E,{color:"gray.500",fontSize:"sm",children:"Zat\xedm \u017e\xe1dn\xe1 data"})]}),(0,K.jsxs)(i.a,{bg:(0,a.dU)("white","gray.800"),p:5,borderRadius:"xl",boxShadow:"md",borderWidth:"1px",borderColor:(0,a.dU)("gray.200","gray.700"),children:[(0,K.jsxs)(o.z,{justify:"space-between",mb:4,children:[(0,K.jsx)(u.E,{fontWeight:"bold",fontSize:"lg",children:"Nej\u010dast\u011bj\u0161\xed interakce"}),(0,K.jsx)(E.E,{colorScheme:"blue",children:"7 dn\xed"})]}),me&&me.length>0?(0,K.jsxs)(_.X,{size:"sm",variant:"simple",children:[(0,K.jsx)(w.d,{children:(0,K.jsxs)(z.Tr,{children:[(0,K.jsx)(S.Th,{children:"Akce"}),(0,K.jsx)(S.Th,{isNumeric:!0,children:"Po\u010det"})]})}),(0,K.jsx)(A.N,{children:me.slice(0,10).map((e,t)=>{const n=(e=>({"Contact Form Submit":{name:"Odesl\xe1n\xed kontaktn\xedho formul\xe1\u0159e",source:"Kontaktn\xed str\xe1nka",description:"U\u017eivatel odeslal kontaktn\xed formul\xe1\u0159 na str\xe1nce Kontakt"},"Contact Form":{name:"Zobrazen\xed kontaktn\xedho formul\xe1\u0159e",source:"Kontaktn\xed str\xe1nka",description:"U\u017eivatel zobrazil kontaktn\xed formul\xe1\u0159"},"Form Submit":{name:"Odesl\xe1n\xed formul\xe1\u0159e",source:"R\u016fzn\xe9 str\xe1nky",description:"Obecn\xe9 odesl\xe1n\xed formul\xe1\u0159e na webu"},"Newsletter Subscribe":{name:"Odb\u011br newsletteru",source:"Newsletter formul\xe1\u0159",description:"U\u017eivatel se p\u0159ihl\xe1sil k odb\u011bru newsletteru"},"Newsletter Submit":{name:"Potvrzen\xed newsletteru",source:"Newsletter formul\xe1\u0159",description:"U\u017eivatel potvrdil p\u0159ihl\xe1\u0161en\xed k newsletteru"},"Newsletter Unsubscribe":{name:"Odhl\xe1\u0161en\xed z newsletteru",source:"Nastaven\xed newsletteru",description:"U\u017eivatel se odhl\xe1sil z odb\u011bru newsletteru"},"Newsletter Preferences Saved":{name:"Ulo\u017een\xed p\u0159edvoleb newsletteru",source:"Nastaven\xed newsletteru",description:"U\u017eivatel ulo\u017eil sv\xe9 p\u0159edvolby pro newsletter"},Unsubscribe:{name:"Odhl\xe1\u0161en\xed z odb\u011bru",source:"Nastaven\xed",description:"U\u017eivatel se odhl\xe1sil z odb\u011bru"},"Save Preferences":{name:"Ulo\u017een\xed p\u0159edvoleb",source:"Nastaven\xed",description:"U\u017eivatel ulo\u017eil sv\xe9 p\u0159edvolby (souhlas s cookies apod.)"},"Refresh Preferences":{name:"Obnoven\xed p\u0159edvoleb",source:"Nastaven\xed",description:"U\u017eivatel obnovil nebo zm\u011bnil sv\xe9 p\u0159edvolby"},"Article View":{name:"Zobrazen\xed \u010dl\xe1nku",source:"Blog",description:"U\u017eivatel si zobrazil \u010dl\xe1nek na blogu"},"Match View":{name:"Zobrazen\xed z\xe1pasu",source:"Str\xe1nka z\xe1pas\u016f",description:"U\u017eivatel si zobrazil detail z\xe1pasu"},"Gallery View":{name:"Zobrazen\xed galerie",source:"Galerie",description:"U\u017eivatel si otev\u0159el galerii fotografi\xed"},"Video Play":{name:"P\u0159ehr\xe1n\xed videa",source:"Video sekce",description:"U\u017eivatel spustil p\u0159ehr\xe1v\xe1n\xed videa"},"Social Share":{name:"Sd\xedlen\xed na soci\xe1ln\xedch s\xedt\xedch",source:"Sd\xedlec\xed tla\u010d\xedtka",description:"U\u017eivatel sd\xedlel obsah na soci\xe1ln\xed s\xed\u0165"},Download:{name:"Sta\u017een\xed souboru",source:"R\u016fzn\xe9 str\xe1nky",description:"U\u017eivatel st\xe1hl soubor"},"External Link Click":{name:"Kliknut\xed na extern\xed odkaz",source:"R\u016fzn\xe9 str\xe1nky",description:"U\u017eivatel klikl na odkaz vedouc\xed mimo web"},"Button Click":{name:"Kliknut\xed na tla\u010d\xedtko",source:"R\u016fzn\xe9 str\xe1nky",description:"U\u017eivatel klikl na tla\u010d\xedtko"},Navigation:{name:"Navigace",source:"Menu / odkazy",description:"U\u017eivatel p\u0159e\u0161el na jinou str\xe1nku"},Search:{name:"Vyhled\xe1v\xe1n\xed",source:"Vyhled\xe1v\xe1n\xed",description:"U\u017eivatel vyhled\xe1val na webu"},"Email Open":{name:"Otev\u0159en\xed e\u2011mailu",source:"E\u2011mail",description:"P\u0159\xedjemce otev\u0159el e\u2011mail"},"Email Click":{name:"Kliknut\xed v e\u2011mailu",source:"E\u2011mail",description:"P\u0159\xedjemce klikl na odkaz v e\u2011mailu"},"Email Spam":{name:"Ozna\u010deno jako spam",source:"E\u2011mail",description:"P\u0159\xedjemce ozna\u010dil zpr\xe1vu jako spam"},"Email Unsubscribe":{name:"Odhl\xe1\u0161en\xed z e\u2011mailu",source:"E\u2011mail",description:"P\u0159\xedjemce se odhl\xe1sil z odb\u011bru"},"ShortLink Click":{name:"Kliknut\xed na zkr\xe1cen\xfd odkaz",source:"Zkr\xe1cen\xe9 odkazy",description:"U\u017eivatel klikl na zkr\xe1cen\xfd odkaz"},"Link Redirect":{name:"P\u0159esm\u011brov\xe1n\xed odkazu",source:"Sledov\xe1n\xed odkaz\u016f",description:"Zaznamenan\xe9 p\u0159esm\u011brov\xe1n\xed sledovan\xe9ho odkazu"}}[e]||{name:e,source:"Nezn\xe1m\xfd zdroj",description:"Ud\xe1lost: ".concat(e)}))(e.x||"");return(0,K.jsxs)(z.Tr,{children:[(0,K.jsx)(C.Td,{fontSize:"sm",children:(0,K.jsx)(T.m,{label:n.description,placement:"top",hasArrow:!0,children:(0,K.jsxs)(i.a,{children:[(0,K.jsx)(u.E,{fontWeight:"medium",children:n.name}),(0,K.jsx)(u.E,{fontSize:"xs",color:"gray.500",children:n.source})]})})}),(0,K.jsx)(C.Td,{isNumeric:!0,children:(0,K.jsx)(E.E,{colorScheme:"blue",fontWeight:"semibold",children:e.y})})]},t)})})]}):(0,K.jsx)(u.E,{color:"gray.500",fontSize:"sm",children:"Zat\xedm \u017e\xe1dn\xe1 data"})]})]}),(0,K.jsx)(k.c,{my:8})]}),(0,K.jsx)(h.D,{size:"md",mb:4,children:"P\u0159ehled aktivit"}),(0,K.jsxs)(j.r,{columns:{base:1,md:2,xl:4},spacing:6,mb:8,children:[(0,K.jsx)(X,{}),(0,K.jsx)(F.C,{}),(0,K.jsx)(B,{}),ie&&(0,K.jsx)($,{})]}),(0,K.jsx)(Y,{})]})})}},16834:(e,t,n)=>{n.d(t,{FD:()=>l,Nd:()=>s,SF:()=>r,lX:()=>o});var a=n(46291);const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};Object.entries(e).forEach(e=>{let[n,a]=e;if(void 0!==a)if("boolean"!==typeof a&&"number"!==typeof a)if("string"!==typeof a){if(Array.isArray(a)){const e=a.map(e=>"string"===typeof e?e.trim():null===e||void 0===e?"":String(e)).filter(e=>""!==e);return void(t[n]=e.join(", "))}if(null!==a)try{t[n]=JSON.stringify(a)}catch(i){t[n]=String(a)}else t[n]=null}else t[n]=a.trim();else t[n]=a});const n=t.competitions;return"string"!==typeof n||t.categories||(t.categories=n),t};async function o(e){const{data:t}=await a.FH.get("/newsletter/preferences",{params:{token:e}});return t}async function r(e,t){const n=i(t);"string"!==typeof n.competitions||n.categories||(n.categories=n.competitions);const{data:o}=await a.FH.post("/newsletter/preferences",{token:e,preferences:n});return o}async function s(e){const{data:t}=await a.FH.post("/newsletter/unsubscribe-token",{token:e});return t}async function l(){const{data:e}=await a.FH.get("/newsletter/token/me");return e}},16942:(e,t,n)=>{n.r(t),n.d(t,{default:()=>j});var a=n(65043),i=n(73216),o=n(30502),r=n(98939),s=n(10202),l=n(76659),c=n(39081),d=n(28846),u=n(98662),h=n(22107),m=n(79722);const p={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic",REACT_APP_ESHOP_URL:"http://localhost:3100",REACT_APP_ERROR_INGEST_URL:"http://127.0.0.1:8083/api/v1/errors",REACT_APP_ERROR_INGEST_TOKEN:""}.REACT_APP_API_BASE_URL||"",x=async e=>(await m.A.post("".concat(p,"/api/v1/newsletter/unsubscribe/").concat(encodeURIComponent(e)))).data;var g=n(82047),v=n(70579);function j(){const{email:e}=(0,i.g)(),[t,n]=(0,a.useState)(!0),[m,p]=(0,a.useState)(!1),[j,b]=(0,a.useState)(null),y=(0,o.d)(),f=(0,i.Zp)();(0,a.useEffect)(()=>{(async()=>{if(!e)return b("Neplatn\xfd odhla\u0161ovac\xed odkaz"),void n(!1);try{const t=decodeURIComponent(e);await x(t),p(!0),(0,g.sx)("Newsletter Unsubscribe",{success:!0,source:"email_link"})}catch(t){const e=t instanceof Error?t.message:"P\u0159i odhla\u0161ov\xe1n\xed z newsletteru do\u0161lo k chyb\u011b";b(e),y({title:"Chyba",description:e,status:"error",duration:5e3,isClosable:!0})}finally{n(!1)}})()},[e,y]);const k=()=>{f("/")};return t?(0,v.jsx)(r.m,{maxW:"container.md",py:10,children:(0,v.jsxs)(s.T,{spacing:6,textAlign:"center",children:[(0,v.jsx)(l.y,{size:"xl"}),(0,v.jsx)(c.E,{children:"Zpracov\xe1v\xe1m va\u0161i \u017e\xe1dost o odhl\xe1\u0161en\xed..."})]})}):j?(0,v.jsx)(r.m,{maxW:"container.md",py:10,children:(0,v.jsxs)(s.T,{spacing:6,textAlign:"center",children:[(0,v.jsx)(d.D,{as:"h1",size:"xl",color:"red.500",children:"Chyba p\u0159i odhla\u0161ov\xe1n\xed"}),(0,v.jsx)(c.E,{fontSize:"lg",children:j}),(0,v.jsx)(u.$,{colorScheme:"blue",onClick:k,children:"Zp\u011bt na \xfavodn\xed str\xe1nku"})]})}):m?(0,v.jsx)(r.m,{maxW:"container.md",py:10,children:(0,v.jsxs)(s.T,{spacing:6,textAlign:"center",children:[(0,v.jsxs)(h.a,{children:[(0,v.jsx)(d.D,{as:"h1",size:"xl",color:"green.500",mb:4,children:"Byl jste \xfasp\u011b\u0161n\u011b odhl\xe1\u0161en"}),(0,v.jsx)(c.E,{fontSize:"lg",children:"Je n\xe1m l\xedto, \u017ee odch\xe1z\xedte. Va\u0161e e-mailov\xe1 adresa byla odebr\xe1na z na\u0161eho seznamu odb\u011bratel\u016f."})]}),(0,v.jsx)(c.E,{color:"gray.600",children:"Pokud jste se odhl\xe1sili omylem, m\u016f\u017eete se znovu p\u0159ihl\xe1sit k odb\u011bru na na\u0161ich webov\xfdch str\xe1nk\xe1ch."}),(0,v.jsx)(u.$,{colorScheme:"blue",onClick:k,"data-umami-event":"Back to Home","data-umami-event-from":"unsubscribe",children:"Zp\u011bt na \xfavodn\xed str\xe1nku"})]})}):null}},17707:(e,t,n)=>{n.d(t,{N:()=>r});var a=n(89379),i=n(65043),o=n(47021);const r=e=>{const[t,n]=(0,i.useState)({}),[r,s]=(0,i.useState)({}),[l,c]=(0,i.useState)({}),[d,u]=(0,i.useState)([]),[h,m]=(0,i.useState)(!0),[p,x]=(0,i.useState)(0);(0,i.useEffect)(()=>{let t=!0;const i=e=>{const t=document.querySelector(".myuibrix-viewport-wrapper")||document.querySelector(".container");if(!t)return;const n=Array.from(t.querySelectorAll("[data-element]")),a=new Map;n.forEach(e=>{const t=e.getAttribute("data-element");t&&a.set(t,e)}),e.forEach(e=>{const n=a.get(e);n&&n.parentElement===t&&t.appendChild(n)})},r=e=>{try{const t="myuibrix-style-props";let n=document.getElementById(t);n||(n=document.createElement("style"),n.id=t,document.head.appendChild(n));const a=[],i=(e,t,n,a)=>{if(void 0===n||null===n||""===n)return;const i="number"===typeof n&&"px"===a?"".concat(n,"px"):"".concat(n);e.push("".concat(t,": ").concat(i," !important;"))},o=e=>e.replace(/[A-Z]/g,e=>"-".concat(e.toLowerCase()));Object.entries(e||{}).forEach(e=>{let[t,n]=e;if(!n||"object"!==typeof n)return;const r=[],s=new Set;i(r,"font-family",n.fontFamily),s.add("fontFamily"),i(r,"font-size",n.fontSize,"px"),s.add("fontSize"),i(r,"font-weight",n.fontWeight),s.add("fontWeight"),i(r,"line-height",n.lineHeight),s.add("lineHeight"),i(r,"letter-spacing",n.letterSpacing,"px"),s.add("letterSpacing"),i(r,"text-transform",n.textTransform),s.add("textTransform"),i(r,"color",n.color),s.add("color"),i(r,"background-color",n.backgroundColor),s.add("backgroundColor"),i(r,"padding-top",n.paddingTop,"px"),s.add("paddingTop"),i(r,"padding-right",n.paddingRight,"px"),s.add("paddingRight"),i(r,"padding-bottom",n.paddingBottom,"px"),s.add("paddingBottom"),i(r,"padding-left",n.paddingLeft,"px"),s.add("paddingLeft"),i(r,"margin-top",n.marginTop,"px"),s.add("marginTop"),i(r,"margin-right",n.marginRight,"px"),s.add("marginRight"),i(r,"margin-bottom",n.marginBottom,"px"),s.add("marginBottom"),i(r,"margin-left",n.marginLeft,"px"),s.add("marginLeft"),void 0!==n.width&&i(r,"width",n.width,"number"===typeof n.width?"px":""),s.add("width"),void 0!==n.height&&i(r,"height",n.height,"number"===typeof n.height?"px":""),s.add("height"),i(r,"display",n.display),s.add("display"),i(r,"grid-template-columns",n.gridTemplateColumns),s.add("gridTemplateColumns"),i(r,"grid-template-rows",n.gridTemplateRows),s.add("gridTemplateRows"),i(r,"grid-auto-flow",n.gridAutoFlow),s.add("gridAutoFlow"),i(r,"grid-column-gap",n.gridColumnGap,"px"),s.add("gridColumnGap"),i(r,"grid-row-gap",n.gridRowGap,"px"),s.add("gridRowGap"),i(r,"align-items",n.alignItems),s.add("alignItems"),i(r,"justify-items",n.justifyItems),s.add("justifyItems"),i(r,"gap",n.gap,"px"),s.add("gap"),i(r,"border",n.border),s.add("border"),void 0!==n.borderTop&&i(r,"border-top",n.borderTop),s.add("borderTop"),void 0!==n.borderRight&&i(r,"border-right",n.borderRight),s.add("borderRight"),void 0!==n.borderBottom&&i(r,"border-bottom",n.borderBottom),s.add("borderBottom"),void 0!==n.borderLeft&&i(r,"border-left",n.borderLeft),s.add("borderLeft"),void 0!==n.borderRadius&&i(r,"border-radius",n.borderRadius,"number"===typeof n.borderRadius?"px":""),s.add("borderRadius"),void 0!==n.borderTopLeftRadius&&i(r,"border-top-left-radius",n.borderTopLeftRadius,"number"===typeof n.borderTopLeftRadius?"px":""),s.add("borderTopLeftRadius"),void 0!==n.borderTopRightRadius&&i(r,"border-top-right-radius",n.borderTopRightRadius,"number"===typeof n.borderTopRightRadius?"px":""),s.add("borderTopRightRadius"),void 0!==n.borderBottomLeftRadius&&i(r,"border-bottom-left-radius",n.borderBottomLeftRadius,"number"===typeof n.borderBottomLeftRadius?"px":""),s.add("borderBottomLeftRadius"),void 0!==n.borderBottomRightRadius&&i(r,"border-bottom-right-radius",n.borderBottomRightRadius,"number"===typeof n.borderBottomRightRadius?"px":""),s.add("borderBottomRightRadius"),i(r,"box-shadow",n.boxShadow),s.add("boxShadow"),i(r,"opacity",n.opacity),s.add("opacity"),i(r,"position",n.position),s.add("position"),void 0!==n.top&&i(r,"top",n.top,"number"===typeof n.top?"px":""),s.add("top"),void 0!==n.right&&i(r,"right",n.right,"number"===typeof n.right?"px":""),s.add("right"),void 0!==n.bottom&&i(r,"bottom",n.bottom,"number"===typeof n.bottom?"px":""),s.add("bottom"),void 0!==n.left&&i(r,"left",n.left,"number"===typeof n.left?"px":""),s.add("left"),i(r,"z-index",n.zIndex),s.add("zIndex"),i(r,"overflow",n.overflow),s.add("overflow"),i(r,"overflow-x",n.overflowX),s.add("overflowX"),i(r,"overflow-y",n.overflowY),s.add("overflowY"),i(r,"justify-content",n.justifyContent),s.add("justifyContent"),i(r,"align-content",n.alignContent),s.add("alignContent"),i(r,"justify-self",n.justifySelf),s.add("justifySelf"),i(r,"align-self",n.alignSelf),s.add("alignSelf"),i(r,"place-items",n.placeItems),s.add("placeItems"),i(r,"place-content",n.placeContent),s.add("placeContent"),i(r,"place-self",n.placeSelf),s.add("placeSelf"),void 0!==n.maxWidth&&i(r,"max-width",n.maxWidth,"number"===typeof n.maxWidth?"px":""),s.add("maxWidth"),void 0!==n.minWidth&&i(r,"min-width",n.minWidth,"number"===typeof n.minWidth?"px":""),s.add("minWidth"),void 0!==n.maxHeight&&i(r,"max-height",n.maxHeight,"number"===typeof n.maxHeight?"px":""),s.add("maxHeight"),void 0!==n.minHeight&&i(r,"min-height",n.minHeight,"number"===typeof n.minHeight?"px":""),s.add("minHeight"),i(r,"text-align",n.textAlign),s.add("textAlign"),Object.keys(n).forEach(e=>{if("customCSS"!==e&&!s.has(e)){const t=n[e];void 0!==t&&null!==t&&""!==t&&i(r,o(e),t)}}),r.length>0&&a.push('\nbody [data-element="'.concat(t,'"],\n.container [data-element="').concat(t,'"],\n[data-element="').concat(t,'"].chakra-box,\n[data-element="').concat(t,'"].section,\n[data-element="').concat(t,'"] {\n ').concat(r.join("\n "),"\n}"))}),n.textContent="/* MyUIbrix Dynamic Styles - Auto-generated */\n".concat(a.join("\n\n")),"undefined"!==typeof document&&document.body.offsetHeight}catch(t){console.error("[MyUIbrix] Style injection failed:",t)}};(async()=>{try{const l=await(0,o.Lg)(e);if(t){const e={},t={},o={},d=[...l].sort((e,t)=>(e.display_order||0)-(t.display_order||0)),h=d.map(e=>e.element_name);d.forEach(n=>{e[n.element_name]=n.variant,t[n.element_name]=!1!==n.visible;try{const e=n.settings&&n.settings.styles||{};e&&"object"===typeof e&&Object.keys(e).length>0&&(o[n.element_name]=e)}catch(s){}try{var a,i,r;const e=String((null===(a=n.settings)||void 0===a?void 0:a.customCSS)||(null===(i=n.settings)||void 0===i||null===(r=i.styles)||void 0===r?void 0:r.customCSS)||"").trim(),t="custom-css-".concat(n.element_name),o=document.getElementById(t);if(o&&o.remove(),e){const a=document.createElement("style");a.id=t;if(/\{[^}]*\}|@media|@keyframes/.test(e))a.textContent=e;else{const t=e.split(";").map(e=>e.trim()).filter(Boolean).map(e=>/!important\s*$/.test(e)?e:"".concat(e," !important")).join(";\n ");a.textContent='\n [data-element="'.concat(n.element_name,'"] {\n ').concat(t,";\n }\n ")}document.head.appendChild(a)}}catch(l){}}),n(e),s(t),Object.keys(o).length>0?c(o):c({}),u(h);try{const t=e["style-pack"]||"default",n=document.body;Array.from(n.classList).filter(e=>e.startsWith("style-pack-")).forEach(e=>n.classList.remove(e)),n.classList.add("style-pack-".concat(t))}catch(a){}r(o);const m=(()=>{try{var e,t;if("undefined"!==typeof document&&null!==(e=document.body)&&void 0!==e&&null!==(t=e.classList)&&void 0!==t&&t.contains("myuibrix-edit-mode"))return!0;return"edit"===new URLSearchParams(window.location.search).get("myuibrix")}catch(n){return!1}})();h.length>0&&m&&requestAnimationFrame(()=>{i(h)})}}catch(l){console.error("Failed to load page element configs:",l)}finally{t&&m(!1)}})();const d=e=>{const{elementName:t,variant:i,visible:o,previewMode:r,timestamp:l}=e.detail;if(r){if(console.log("[usePageElementConfig] Variant change: ".concat(t," -> ").concat(i)),n(e=>(0,a.A)((0,a.A)({},e),{},{[t]:i})),s(e=>(0,a.A)((0,a.A)({},e),{},{[t]:o})),"style-pack"===t)try{const e=document.body;Array.from(e.classList).filter(e=>e.startsWith("style-pack-")).forEach(t=>e.classList.remove(t)),e.classList.add("style-pack-".concat(i||"default"))}catch(c){}x(e=>e+1)}},h=e=>{const{order:t}=e.detail;u(t);try{var n,a;((null===(n=document.body)||void 0===n||null===(a=n.classList)||void 0===a?void 0:a.contains("myuibrix-edit-mode"))||!1)&&i(t)}catch(o){}},p=e=>{const{elementName:t,styles:n,previewMode:i}=e.detail;i&&(console.log("[MyUIbrix] Style change received for: ".concat(t),n),c(e=>{const i=(0,a.A)((0,a.A)({},e),{},{[t]:n});requestAnimationFrame(()=>{r(i)});try{const e=String(n&&n.customCSS||"").trim(),a="custom-css-".concat(t),i=document.getElementById(a);if(i&&i.remove(),e){const n=document.createElement("style");n.id=a;if(/\{[^}]*\}|@media|@keyframes/.test(e))n.textContent="/* Custom CSS for ".concat(t," */\n").concat(e);else{const a=e.split(";").map(e=>e.trim()).filter(Boolean).map(e=>/!important\s*$/.test(e)?e:"".concat(e," !important")).join(";\n ");n.textContent="/* Custom CSS for ".concat(t,' */\nbody [data-element="').concat(t,'"],\n.container [data-element="').concat(t,'"] {\n ').concat(a,";\n}")}document.head.appendChild(n)}}catch(o){console.error("[MyUIbrix] Custom CSS injection failed for ".concat(t,":"),o)}return i}),x(e=>e+1))};window.addEventListener("myuibrix-change",d),window.addEventListener("myuibrix-reorder",h),window.addEventListener("myuibrix-style-change",p);const g=e=>{r(l)};return window.addEventListener("myuibrix-force-refresh",g),()=>{t=!1,window.removeEventListener("myuibrix-change",d),window.removeEventListener("myuibrix-reorder",h),window.removeEventListener("myuibrix-style-change",p),window.removeEventListener("myuibrix-force-refresh",g);try{const e=document.getElementById("myuibrix-style-props");e&&e.remove()}catch(e){}}},[e]);return{configs:t,visibility:r,styles:l,elementOrder:d,getVariant:function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unified";return t[e]||n},isVisible:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return void 0!==r[e]?r[e]:t},getStyles:e=>l[e],loading:h,refreshKey:p}}},18786:(e,t,n)=>{n.d(t,{Z:()=>i,g:()=>o});var a=n(46291);async function i(){return(await a.Ay.get("/admin/seo")).data||{}}async function o(e){return(await a.Ay.put("/admin/seo",e)).data}},20515:(e,t,n)=>{n.d(t,{t:()=>u});var a=n(89379),i=n(72526),o=n(59781),r=n(12836),s=n(46291);const l=async()=>{const{data:e}=await s.FH.get("/settings");return e},c=async e=>{const{data:t}=await s.FH.put("/settings",e);return t},d={id:"default",clubId:"",clubType:"",primaryColor:"#3182ce",theme:{primaryColor:"#3182ce",secondaryColor:"#2b6cb0",fontFamily:"Inter, sans-serif"},socialLinks:{},contactInfo:{address:"Ulice a \u010d\xedslo, M\u011bsto, PS\u010c",phone:"+420 123 456 789",email:"info@vas-klub.cz",website:"www.vas-klub.cz",workingHours:"Pond\u011bl\xed - P\xe1tek: 9:00 - 17:00"},features:{darkMode:!1,notifications:!0,analytics:!1},updatedAt:(new Date).toISOString(),createdAt:(new Date).toISOString()},u=()=>{const e=(0,o.jE)(),{data:t=d,isLoading:n}=(0,i.I)({queryKey:["settings"],queryFn:l,staleTime:3e5,onError:e=>{console.error("Failed to load settings:",e)}}),s=(0,r.n)({mutationFn:c,onSuccess:t=>{e.setQueryData(["settings"],e=>(0,a.A)((0,a.A)((0,a.A)({},d),e),t))}});return{settings:t,isLoading:n,updateTheme:e=>{s.mutate({theme:(0,a.A)((0,a.A)({},t.theme),e)})},updateSocialLinks:e=>{s.mutate({socialLinks:(0,a.A)((0,a.A)({},t.socialLinks),e)})},updateFeatures:e=>{s.mutate({features:(0,a.A)((0,a.A)({},t.features),e)})},updateSettings:s.mutateAsync,isUpdating:s.isLoading}}},20724:(e,t,n)=>{n.d(t,{A:()=>x});var a=n(65043),i=n(22107),o=n(33572),r=n(96148),s=n(39081),l=n(70579);const c=e=>{let{state:t}=e;const n=t.theme||"pill",a=!!t.sidesFlipped,c={short:(a?t.awayShort:t.homeShort)||m(a?t.awayName:t.homeName),logo:a?t.awayLogo:t.homeLogo,color:(a?t.secondaryColor:t.primaryColor)||"#1e3a8a",score:a?t.awayScore:t.homeScore,fouls:Math.max(0,Math.min(5,a?t.awayFouls||0:t.homeFouls||0)),name:a?t.awayName:t.homeName,textColor:(a?t.awayTextColor:t.homeTextColor)||"#ffffff"},p={short:(a?t.homeShort:t.awayShort)||m(a?t.homeName:t.awayName),logo:a?t.homeLogo:t.awayLogo,color:(a?t.primaryColor:t.secondaryColor)||"#2563eb",score:a?t.homeScore:t.awayScore,fouls:Math.max(0,Math.min(5,a?t.homeFouls||0:t.awayFouls||0)),name:a?t.homeName:t.awayName,textColor:(a?t.homeTextColor:t.awayTextColor)||"#ffffff"},x=t.timer||"00:00";switch(n){case"pill":return(0,l.jsxs)(i.a,{maxW:"100%",overflowX:"auto",children:[(0,l.jsxs)(r.z,{spacing:2,px:1.5,py:1,borderRadius:"full",bg:"white",borderWidth:"1px",borderColor:"gray.200",boxShadow:"sm",width:"max-content",children:[(0,l.jsx)(u,{children:x}),(0,l.jsxs)(d,{colorA:c.color,textColor:c.textColor,left:!0,children:[c.logo?(0,l.jsx)(o._,{src:c.logo,alt:"home",boxSize:"16px",objectFit:"contain"}):null,(0,l.jsx)(s.E,{textTransform:"uppercase",fontSize:"sm",lineHeight:1,children:c.short})]}),(0,l.jsxs)(u,{children:[c.score," \u2013 ",p.score]}),(0,l.jsxs)(d,{colorA:p.color,textColor:p.textColor,right:!0,children:[(0,l.jsx)(s.E,{textTransform:"uppercase",fontSize:"sm",lineHeight:1,children:p.short}),p.logo?(0,l.jsx)(o._,{src:p.logo,alt:"away",boxSize:"16px",objectFit:"contain"}):null]})]}),(0,l.jsx)(h,{leftCount:c.fouls,rightCount:p.fouls,leftColor:c.color,rightColor:p.color})]});case"classic":case"var1":return(0,l.jsxs)(i.a,{children:[(0,l.jsxs)(r.z,{spacing:3,bgGradient:"linear(to-b, #c8d4dc, #a8b8c4)",px:5,py:3,borderRadius:"lg",boxShadow:"md",width:"max-content",children:[(0,l.jsx)(i.a,{bg:"white",color:"black",fontWeight:"bold",px:3,py:1,borderRadius:"md",fontSize:"lg",children:x}),(0,l.jsx)(i.a,{bg:c.color,color:"white",px:4,py:2,borderRadius:"md",fontWeight:"bold",children:c.short}),(0,l.jsxs)(s.E,{fontWeight:"bold",color:"black",children:[c.score,"-",p.score]}),(0,l.jsx)(i.a,{bg:p.color,color:"white",px:4,py:2,borderRadius:"md",fontWeight:"bold",children:p.short})]}),(0,l.jsx)(h,{leftCount:c.fouls,rightCount:p.fouls,leftColor:c.color,rightColor:p.color})]});case"var2":return(0,l.jsxs)(i.a,{children:[(0,l.jsxs)(r.z,{spacing:0,borderRadius:"md",overflow:"hidden",boxShadow:"md",width:"max-content",children:[(0,l.jsx)(i.a,{bgGradient:"linear(135deg, #4a5568, #2d3748)",color:"white",px:3,py:2,fontWeight:"bold",children:x}),(0,l.jsx)(i.a,{bgGradient:"linear(135deg, #2c5282, #2a4365)",color:"white",px:4,py:2,fontWeight:"bold",children:c.short}),(0,l.jsxs)(i.a,{bgGradient:"linear(135deg, #2c5282, #2a4365)",color:"white",px:3,py:2,fontWeight:"bold",children:[c.score,"-",p.score]}),(0,l.jsx)(i.a,{bgGradient:"linear(135deg, #2c5282, #2a4365)",color:"white",px:4,py:2,fontWeight:"bold",children:p.short})]}),(0,l.jsx)(h,{leftCount:c.fouls,rightCount:p.fouls,leftColor:c.color,rightColor:p.color})]});case"var3":return(0,l.jsxs)(i.a,{textAlign:"center",fontFamily:"Poppins, Arial, sans-serif",children:[(0,l.jsxs)(r.z,{spacing:0,justify:"center",children:[(0,l.jsxs)(i.a,{w:"102px",h:"38px",bg:"#F6F6F6",lineHeight:"41px",position:"relative",children:[(0,l.jsx)(i.a,{position:"absolute",left:"-8px",top:0,w:"6px",h:"38px",bg:c.color}),(0,l.jsx)(s.E,{children:c.short})]}),(0,l.jsx)(i.a,{w:"102px",h:"38px",bg:"#F6F6F6",lineHeight:"41px",zIndex:2,boxShadow:"0 3px 10px rgba(0,0,0,0.7)",children:(0,l.jsxs)(s.E,{fontWeight:"bold",children:[c.score,"-",p.score]})}),(0,l.jsxs)(i.a,{w:"102px",h:"38px",bg:"#F6F6F6",lineHeight:"41px",position:"relative",children:[(0,l.jsx)(i.a,{position:"absolute",right:"-8px",top:0,w:"6px",h:"38px",bg:p.color}),(0,l.jsx)(s.E,{children:p.short})]})]}),(0,l.jsx)(i.a,{mt:2,w:"306px",mx:"auto",bg:"#F6F6F6",children:(0,l.jsx)(s.E,{children:x})}),(0,l.jsx)(h,{leftCount:c.fouls,rightCount:p.fouls,leftColor:c.color,rightColor:p.color})]});case"var4":return(0,l.jsxs)(i.a,{children:[(0,l.jsxs)(i.a,{w:"340px",borderWidth:"1px",borderRadius:"xl",boxShadow:"xl",p:4,bg:"white",color:"gray.900",children:[(0,l.jsxs)(r.z,{children:[(0,l.jsx)(s.E,{fontWeight:"bold",children:c.name}),(0,l.jsx)(s.E,{ml:"auto",fontWeight:"extrabold",children:c.score})]}),(0,l.jsx)(i.a,{textAlign:"center",fontWeight:"extrabold",py:1,children:"VS"}),(0,l.jsxs)(r.z,{children:[(0,l.jsx)(s.E,{fontWeight:"bold",children:p.name}),(0,l.jsx)(s.E,{ml:"auto",fontWeight:"extrabold",children:p.score})]}),(0,l.jsx)(r.z,{justify:"flex-end",fontSize:"sm",opacity:.8,pt:2,children:(0,l.jsx)(s.E,{children:x})})]}),(0,l.jsx)(h,{leftCount:c.fouls,rightCount:p.fouls,leftColor:c.color,rightColor:p.color})]});default:return(0,l.jsxs)(i.a,{children:[(0,l.jsxs)(r.z,{spacing:3,bg:"gray.900",color:"white",px:4,py:3,borderRadius:"lg",boxShadow:"lg",width:"max-content",children:[(0,l.jsx)(s.E,{fontWeight:"bold",children:c.name}),(0,l.jsxs)(s.E,{fontWeight:"black",children:[c.score," : ",p.score]}),(0,l.jsx)(s.E,{fontWeight:"bold",children:p.name})]}),(0,l.jsx)(h,{leftCount:c.fouls,rightCount:p.fouls,leftColor:c.color,rightColor:p.color})]})}},d=e=>{let{colorA:t="#1e3a8a",textColor:n="#ffffff",left:a,right:i,children:o}=e;return(0,l.jsx)(r.z,{px:2,py:.5,borderRadius:"full",bgGradient:"linear(to-r, ".concat(t,", ").concat(p(t,20),")"),color:n,spacing:1.5,minW:"46px",children:o})},u=e=>{let{children:t}=e;return(0,l.jsx)(i.a,{px:2,py:.5,borderRadius:"md",bg:"gray.50",borderWidth:"1px",borderColor:"gray.200",fontWeight:"800",minW:"58px",textAlign:"center",fontSize:"sm",children:t})},h=e=>{let{leftCount:t,rightCount:n,leftColor:a,rightColor:o}=e;const s=e=>{let{active:t,color:n}=e;return(0,l.jsx)(i.a,{w:"8px",h:"8px",borderRadius:"full",bg:t?n:"gray.200",borderWidth:t?0:1,borderColor:"gray.300"})};return(0,l.jsxs)(r.z,{spacing:6,justify:"center",mt:2,width:"100%",children:[(0,l.jsx)(r.z,{spacing:1,children:Array.from({length:5}).map((e,n)=>(0,l.jsx)(s,{active:n<t,color:a},n))}),(0,l.jsx)(r.z,{spacing:1,children:Array.from({length:5}).map((e,t)=>(0,l.jsx)(s,{active:t<n,color:o},t))})]})};function m(e){if(!e)return"---";const t=String(e).trim().toUpperCase();if(!t)return"---";const n={"\xc1":"A","\xc4":"A","\xc5":"A","\xc2":"A","\xc0":"A","\u010c":"C","\u0106":"C","\xc7":"C","\u010e":"D","\xc9":"E","\u011a":"E","\xc8":"E","\xcb":"E","\xca":"E","\xcd":"I","\xcc":"I","\xcf":"I","\xce":"I","\u0147":"N","\u0143":"N","\xd3":"O","\xd6":"O","\xd4":"O","\xd2":"O","\u0158":"R","\u0160":"S","\u015a":"S","\u0164":"T","\xda":"U","\u016e":"U","\xd9":"U","\xdc":"U","\xdb":"U","\xdd":"Y","\u017d":"Z"};let a="";for(const i of t){const e=n[i]||i;if(e>="A"&&e<="Z"&&(a+=e,3===a.length))break}for(;a.length<3;)a+="-";return a}function p(e,t){try{let n=e.replace("#","");if(3===n.length||4===n.length){const e=n.slice(0,3);n=e.split("").map(e=>e+e).join("")}else 8===n.length&&(n=n.slice(0,6));if(6!==n.length)return e;const a=parseInt(n,16);let i=a>>16&255,o=a>>8&255,r=255&a;return i=Math.min(255,Math.max(0,Math.round(i+t/100*255))),o=Math.min(255,Math.max(0,Math.round(o+t/100*255))),r=Math.min(255,Math.max(0,Math.round(r+t/100*255))),"#".concat([i,o,r].map(e=>e.toString(16).padStart(2,"0")).join(""))}catch(n){return e}}const x=a.memo(c)},21122:(e,t,n)=>{n.r(t),n.d(t,{default:()=>M});var a=n(89379),i=n(65043),o=n(87139),r=n(22107),s=n(98662),l=n(73225),c=n(76668),d=n(73212),u=n(25011),h=n(35699),m=n(61724),p=n(96148),x=n(10202),g=n(14566),v=n(31411),j=n(10227),b=n(51794),y=n(3109),f=n(19077),k=n(30502),_=n(28846),w=n(39081),z=n(1009),S=n(6583),A=n(24122),C=n(89962),E=n(46291),T=n(31629),D=n(57550),N=n(36695),R=n(60215),F=n(23978),P=n(63988),I=n(70579);const M=()=>{var e,t,n;const M=(0,k.d)(),{data:L}=(0,D.s)(),[W,U]=(0,i.useState)(!1),[O,q]=(0,i.useState)(!1),[K,B]=(0,i.useState)(!1),[Z,V]=(0,i.useState)(void 0),[H,$]=(0,i.useState)(null),[J,G]=(0,i.useState)(""),[X,Y]=(0,i.useState)("Fanou\u0161ci klubu"),[Q,ee]=(0,i.useState)((0,F.xU)()),[te,ne]=(0,i.useState)([]),[ae,ie]=(0,i.useState)(""),[oe,re]=(0,i.useState)([{year:"",title:""}]),[se,le]=(0,i.useState)({title:"",subtitle:"",style:"default",content:"",sections:"[]",seo_title:"",seo_description:""});(0,i.useEffect)(()=>{ce(),de()},[]);const ce=async()=>{U(!0);try{const e=await E.Ay.get("/admin/about");e.data&&le(e.data)}catch(e){M({title:"Chyba",description:"Nepoda\u0159ilo se na\u010d\xedst data",status:"error"})}finally{U(!1)}},de=async()=>{try{const e=await(0,N.bW)();ne(e||[])}catch(e){}},ue=async()=>{if(se.title.trim()){q(!0);try{await E.Ay.put("/admin/about",se),M({title:"Ulo\u017eeno",description:"Str\xe1nka O klubu byla ulo\u017eena",status:"success"}),await ce()}catch(n){var e,t;M({title:"Chyba",description:(null===n||void 0===n||null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||"Nepoda\u0159ilo se ulo\u017eit",status:"error"})}finally{q(!1)}}else M({title:"Chyba",description:"Vypl\u0148te n\xe1zev str\xe1nky",status:"warning"})},he=async()=>{if(!J.trim())return void M({title:"Chyba",description:"Zadejte pozn\xe1mky pro AI",status:"warning"});B(!0),V(0),$(Date.now());const e=setInterval(()=>{V(e=>void 0===e||e>=95?e:Math.min(e+15*Math.random()+5,95))},2e3);try{const t=(null===L||void 0===L?void 0:L.club_name)||"",n=te&&te.length?"Rubriky (kategorie): ".concat(te.map(e=>"".concat(e.name).concat(e.description?" \u2013 ".concat(e.description):"")).join("; ")):"",i="Zvolen\xfd styl: ".concat(se.style,"."),o="timeline"===se.style?"\n\u010casov\xe1 osa \u2013 dodate\u010dn\xe9 informace:\nRok zalo\u017een\xed: ".concat(ae||"neuvedeno",".\nKl\xed\u010dov\xe9 miln\xedky (rok: ud\xe1lost):\n").concat(oe.filter(e=>e.year.trim()||e.title.trim()).map(e=>"- ".concat(e.year.trim()||"????",": ").concat(e.title.trim()||"")).join("\n")):"",r="timeline"===se.style?"Pi\u0161 chronologicky, pou\u017e\xedvej podnadpisy (h3) s rokem, pod nimi kr\xe1tk\xfd odstavec. Kde se hod\xed, vlo\u017e seznamy (ul/li).":"Rozd\u011bl text do sekc\xed s h2/h3 a odstavci. Kde se hod\xed, vlo\u017e seznamy (ul/li).",s="".concat(J.trim(),"\n\nInformace o klubu:\nN\xe1zev klubu: ").concat(t||"Fotbalov\xfd klub",".\n").concat(n,"\n").concat(i).concat(o,"\n\nPokyny pro v\xfdstup: ").concat(r),l=await(0,T.ts)({prompt:s,audience:X,style:se.style,club_name:t,model:Q});clearInterval(e),V(100),le(e=>(0,a.A)((0,a.A)({},e),{},{content:(0,P.F0)(l.html||e.content,{cleanText:!0,preserveHtmlTags:!0}),title:(0,P.ry)(l.title||e.title),subtitle:(0,P.ry)(l.subtitle||e.subtitle),seo_title:(0,P.ry)(l.seo_title||e.seo_title),seo_description:(0,P.ry)(l.seo_description||e.seo_description)})),M({title:"Hotovo!",description:"AI \xfasp\u011b\u0161n\u011b vygenerovala obsah",status:"success"})}catch(i){var t,n;clearInterval(e),console.error("AI generation error:",i),M({title:"Chyba AI",description:(null===i||void 0===i||null===(t=i.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se vygenerovat obsah",status:"error"})}finally{clearInterval(e),setTimeout(()=>{B(!1),V(void 0),$(null)},1e3)}},me={default:{name:"V\xfdchoz\xed",desc:"Jednoduch\xfd layout s titulkem a obsahem"},modern:{name:"Modern\xed",desc:"Vizu\xe1ln\u011b atraktivn\xed s hero obr\xe1zkem a sekcemi"},timeline:{name:"Timeline",desc:"Historie klubu na \u010dasov\xe9 ose"},custom:{name:"Vlastn\xed HTML",desc:"Pln\xe1 kontrola nad obsahem a stylingem"}};return(0,I.jsxs)(S.A,{requireAdmin:!1,children:[(0,I.jsxs)(r.a,{children:[(0,I.jsxs)(p.z,{justify:"space-between",mb:4,children:[(0,I.jsx)(_.D,{size:"lg",children:"Str\xe1nka O klubu"}),(0,I.jsx)(p.z,{children:(0,I.jsx)(s.$,{leftIcon:(0,I.jsx)(z.Bc_,{}),colorScheme:"brand",onClick:ue,isLoading:O,children:"Ulo\u017eit"})})]}),(0,I.jsxs)(w.E,{color:"gray.600",mb:6,children:["Vytvo\u0159te nebo upravte str\xe1nku O klubu. Dostupn\xe1 na ",(0,I.jsx)("strong",{children:"/o-klubu"}),"."]}),(0,I.jsxs)(y.t,{variant:"enclosed",colorScheme:"brand",children:[(0,I.jsxs)(v.w,{children:[(0,I.jsxs)(g.o,{children:[(0,I.jsx)(u.I,{as:z.Iy6,mr:2})," Obsah"]}),(0,I.jsxs)(g.o,{children:[(0,I.jsx)(u.I,{as:z.PjK,mr:2})," Styl"]}),(0,I.jsxs)(g.o,{children:[(0,I.jsx)(u.I,{as:z.Vap,mr:2})," SEO"]})]}),(0,I.jsxs)(b.T,{children:[(0,I.jsx)(j.K,{children:(0,I.jsxs)(x.T,{align:"stretch",spacing:4,children:[(0,I.jsxs)(l.MJ,{isRequired:!0,children:[(0,I.jsx)(c.l,{children:"N\xe1zev str\xe1nky"}),(0,I.jsx)(h.p,{value:se.title,onChange:e=>le(t=>(0,a.A)((0,a.A)({},t),{},{title:e.target.value})),placeholder:"O na\u0161\xed klubu"})]}),(0,I.jsxs)(l.MJ,{children:[(0,I.jsx)(c.l,{children:"Podtitulek"}),(0,I.jsx)(h.p,{value:se.subtitle,onChange:e=>le(t=>(0,a.A)((0,a.A)({},t),{},{subtitle:e.target.value})),placeholder:"Na\u0161e historie, hodnoty a komunita"})]}),(0,I.jsxs)(l.MJ,{children:[(0,I.jsx)(c.l,{children:"Styl str\xe1nky"}),(0,I.jsx)(m.l,{value:se.style,onChange:e=>le(t=>(0,a.A)((0,a.A)({},t),{},{style:e.target.value})),children:Object.entries(me).map(e=>{let[t,{name:n}]=e;return(0,I.jsx)("option",{value:t,children:n},t)})}),(0,I.jsx)(w.E,{fontSize:"sm",color:"gray.600",mt:2,children:null===(e=me[se.style])||void 0===e?void 0:e.desc})]}),"timeline"===se.style&&(0,I.jsxs)(r.a,{borderWidth:"1px",borderRadius:"md",p:4,bg:"gray.50",children:[(0,I.jsx)(_.D,{size:"sm",mb:3,children:"\u010casov\xe1 osa \u2013 podklady"}),(0,I.jsxs)(x.T,{align:"stretch",spacing:3,children:[(0,I.jsxs)(l.MJ,{children:[(0,I.jsx)(c.l,{children:"Rok zalo\u017een\xed"}),(0,I.jsx)(h.p,{type:"text",value:ae,onChange:e=>ie(e.target.value),placeholder:"nap\u0159. 1932"})]}),(0,I.jsxs)(r.a,{children:[(0,I.jsxs)(p.z,{justify:"space-between",mb:2,children:[(0,I.jsx)(w.E,{fontWeight:"semibold",children:"Kl\xed\u010dov\xe9 miln\xedky"}),(0,I.jsx)(s.$,{size:"sm",leftIcon:(0,I.jsx)(z.GGD,{}),onClick:()=>re(e=>[...e,{year:"",title:""}]),children:"P\u0159idat miln\xedk"})]}),(0,I.jsx)(x.T,{align:"stretch",spacing:2,children:oe.map((e,t)=>(0,I.jsxs)(p.z,{spacing:2,align:"stretch",children:[(0,I.jsx)(h.p,{placeholder:"Rok",value:e.year,onChange:e=>re(n=>n.map((n,i)=>i===t?(0,a.A)((0,a.A)({},n),{},{year:e.target.value}):n)),maxW:"120px"}),(0,I.jsx)(h.p,{placeholder:"Ud\xe1lost / popis",value:e.title,onChange:e=>re(n=>n.map((n,i)=>i===t?(0,a.A)((0,a.A)({},n),{},{title:e.target.value}):n))}),(0,I.jsx)(s.$,{"aria-label":"Odebrat",size:"sm",colorScheme:"red",variant:"outline",onClick:()=>re(e=>e.filter((e,n)=>n!==t)),children:(0,I.jsx)(u.I,{as:z.Q_v})})]},t))})]})]})]}),(0,I.jsxs)(r.a,{borderWidth:"1px",borderRadius:"md",p:4,bg:"gray.50",children:[(0,I.jsxs)(p.z,{justify:"space-between",mb:3,align:"flex-start",children:[(0,I.jsxs)(r.a,{children:[(0,I.jsx)(_.D,{size:"sm",mb:1,children:"AI gener\xe1tor obsahu"}),(0,I.jsx)(w.E,{fontSize:"sm",color:"gray.600",children:"Napi\u0161te kr\xe1tk\xe9 pozn\xe1mky (nap\u0159. historie, \xfasp\u011bchy, hodnoty) a nechte AI p\u0159ipravit n\xe1vrh str\xe1nky."})]}),(0,I.jsx)(s.$,{leftIcon:(0,I.jsx)(z.FrA,{}),colorScheme:"gray",variant:"solid",onClick:he,isDisabled:K,children:"Vygenerovat"})]}),(0,I.jsxs)(x.T,{align:"stretch",spacing:3,children:[(0,I.jsxs)(l.MJ,{children:[(0,I.jsx)(c.l,{children:"Pozn\xe1mky pro AI"}),(0,I.jsx)(R.A,{value:J,onChange:G,onSubmit:(e,t)=>(ee(t),he()),isSubmitting:K,placeholder:"Popi\u0161te historii klubu, sou\u010dasn\xe9 c\xedle, p\u0159\xedstup k ml\xe1de\u017ei...",helperText:"AI p\u0159iprav\xed n\xe1vrh str\xe1nky O klubu na z\xe1klad\u011b t\u011bchto pozn\xe1mek."})]}),(0,I.jsxs)(l.MJ,{children:[(0,I.jsx)(c.l,{children:"C\xedlov\xe9 publikum"}),(0,I.jsx)(h.p,{value:X,onChange:e=>Y(e.target.value),placeholder:"Fanou\u0161ci klubu"})]})]})]}),(0,I.jsxs)(l.MJ,{children:[(0,I.jsx)(c.l,{children:"Obsah str\xe1nky"}),(0,I.jsx)(A.A,{value:se.content,onChange:e=>le(t=>(0,a.A)((0,a.A)({},t),{},{content:e})),height:"400px",toolbar:"full",showImageResize:!0,placeholder:"Zadejte obsah str\xe1nky O n\xe1s..."})]})]})}),(0,I.jsx)(j.K,{children:(0,I.jsxs)(x.T,{align:"stretch",spacing:4,children:[(0,I.jsxs)(l.MJ,{children:[(0,I.jsx)(c.l,{children:"Styl str\xe1nky"}),(0,I.jsx)(m.l,{value:se.style,onChange:e=>le(t=>(0,a.A)((0,a.A)({},t),{},{style:e.target.value})),children:Object.entries(me).map(e=>{let[t,{name:n,desc:a}]=e;return(0,I.jsx)("option",{value:t,children:n},t)})}),(0,I.jsx)(w.E,{fontSize:"sm",color:"gray.600",mt:2,children:null===(t=me[se.style])||void 0===t?void 0:t.desc})]}),(0,I.jsxs)(r.a,{p:4,borderWidth:"1px",borderRadius:"md",bg:"blue.50",borderColor:"blue.200",children:[(0,I.jsxs)(_.D,{size:"sm",mb:2,children:["Vybran\xfd styl: ",null===(n=me[se.style])||void 0===n?void 0:n.name]}),(0,I.jsxs)(d.r,{columns:{base:1,md:2},spacing:3,mb:3,children:[(0,I.jsxs)(r.a,{children:[(0,I.jsx)(o.E,{colorScheme:"blue",mb:1,children:"V\xfdchoz\xed"}),(0,I.jsx)(w.E,{fontSize:"sm",children:"Jednoduch\xfd layout, ide\xe1ln\xed pro text"})]}),(0,I.jsxs)(r.a,{children:[(0,I.jsx)(o.E,{colorScheme:"purple",mb:1,children:"Modern\xed"}),(0,I.jsx)(w.E,{fontSize:"sm",children:"Hero obr\xe1zek + sekce karet"})]}),(0,I.jsxs)(r.a,{children:[(0,I.jsx)(o.E,{colorScheme:"green",mb:1,children:"Timeline"}),(0,I.jsx)(w.E,{fontSize:"sm",children:"Historie klubu chronologicky"})]}),(0,I.jsxs)(r.a,{children:[(0,I.jsx)(o.E,{colorScheme:"orange",mb:1,children:"Vlastn\xed"}),(0,I.jsx)(w.E,{fontSize:"sm",children:"Pln\xe1 kontrola p\u0159es HTML/CSS"})]})]})]}),"custom"===se.style&&(0,I.jsxs)(r.a,{p:3,bg:"yellow.50",borderWidth:"1px",borderColor:"yellow.300",borderRadius:"md",children:[(0,I.jsx)(w.E,{fontSize:"sm",fontWeight:"semibold",mb:1,children:"Vlastn\xed HTML re\u017eim"}),(0,I.jsx)(w.E,{fontSize:"sm",children:"V editoru m\u016f\u017eete pou\u017e\xedt jak\xe9koliv HTML a CSS. Ujist\u011bte se, \u017ee je k\xf3d validn\xed."})]})]})}),(0,I.jsx)(j.K,{children:(0,I.jsxs)(x.T,{align:"stretch",spacing:4,children:[(0,I.jsxs)(l.MJ,{children:[(0,I.jsx)(c.l,{children:"SEO Titulek"}),(0,I.jsx)(h.p,{value:se.seo_title,onChange:e=>le(t=>(0,a.A)((0,a.A)({},t),{},{seo_title:e.target.value})),placeholder:"Pokud pr\xe1zdn\xe9, pou\u017eije se n\xe1zev str\xe1nky"})]}),(0,I.jsxs)(l.MJ,{children:[(0,I.jsx)(c.l,{children:"SEO Popis"}),(0,I.jsx)(f.T,{value:se.seo_description,onChange:e=>le(t=>(0,a.A)((0,a.A)({},t),{},{seo_description:e.target.value})),placeholder:"Kr\xe1tk\xfd popis pro vyhled\xe1va\u010de (doporu\u010deno 150-160 znak\u016f)",rows:4}),(0,I.jsxs)(w.E,{fontSize:"sm",color:"gray.600",mt:1,children:["D\xe9lka: ",se.seo_description.length," znak\u016f"]})]})]})})]})]}),(0,I.jsx)(r.a,{mt:6,pt:4,borderTopWidth:"1px",children:(0,I.jsxs)(p.z,{justify:"space-between",children:[(0,I.jsx)(s.$,{colorScheme:"red",variant:"outline",onClick:async()=>{if(confirm("Opravdu smazat str\xe1nku O klubu?"))try{await E.Ay.delete("/admin/about"),M({title:"Smaz\xe1no",description:"Str\xe1nka byla smaz\xe1na",status:"info"}),le({title:"",subtitle:"",style:"default",content:"",sections:"[]",seo_title:"",seo_description:""})}catch(e){M({title:"Chyba",description:"Nepoda\u0159ilo se smazat",status:"error"})}},children:"Smazat str\xe1nku"}),(0,I.jsxs)(p.z,{children:[(0,I.jsx)(s.$,{as:"a",href:"/o-klubu",target:"_blank",variant:"outline",children:"N\xe1hled"}),(0,I.jsx)(s.$,{leftIcon:(0,I.jsx)(z.Bc_,{}),colorScheme:"brand",onClick:ue,isLoading:O,children:"Ulo\u017eit zm\u011bny"})]})]})})]}),(0,I.jsx)(C.A,{isOpen:K,onClose:()=>{},title:"AI generuje obsah",message:"AI pracuje na generov\xe1n\xed obsahu pro str\xe1nku O klubu...",progress:Z,estimatedTime:H?30:void 0})]})}},21361:(e,t,n)=>{n.r(t),n.d(t,{default:()=>U});var a=n(65043),i=n(44093),o=n(98939),r=n(10202),s=n(99032),l=n(22107),c=n(28846),d=n(29904),u=n(39081),h=n(98662),m=n(96148),p=n(33572),x=n(49367),g=n(46291),v=n(87977),j=n(57550),b=n(74117),y=n(40378),f=n(89379),k=n(87139),_=n(3109),w=n(31411),z=n(14566),S=n(51794),A=n(10227),C=n(72526),E=n(40384),T=n(70082),D=n(56644),N=n(85638),R=n(25189),F=(n(79708),n(70579));const P=e=>{let{d:t,h:n,hid:a,hl:i,a:o,aid:r,al:s,s:c,clubName:d,clubId:h}=e;return(0,F.jsxs)(m.z,{justify:"space-between",borderRadius:"lg",p:3,bg:"white",boxShadow:"sm",children:[(0,F.jsx)(u.E,{w:"140px",fontSize:"sm",color:"gray.600",children:t}),(0,F.jsxs)(m.z,{flex:1,justify:"flex-end",spacing:4,children:[(0,F.jsxs)(m.z,{minW:"40%",justify:"flex-end",spacing:2,children:[(0,F.jsx)(u.E,{noOfLines:1,textAlign:"right",flex:1,children:(0,R.Lt)(n)}),(0,F.jsx)(l.a,{className:"logo-container",w:"28px",h:"28px",children:(0,F.jsx)(D.L,{teamId:a,teamName:n,facrLogo:i,size:"custom",boxSize:"28px"})})]}),(0,F.jsxs)(m.z,{minW:"60px",justify:"center",spacing:2,children:[(0,F.jsx)(u.E,{fontWeight:"bold",textAlign:"center",children:c||"-:-"}),(()=>{if(!c)return null;const e=c.match(/^(\d+)\s*[:\-]\s*(\d+)$/);if(!e)return null;const t=parseInt(e[1],10),i=parseInt(e[2],10);let s=!1,l=!1;if(h&&a&&r&&(s=a===h,l=r===h),!s&&!l&&d){const e=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),t=t=>e(t).replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,"").replace(/\s+/g," ").trim(),a=t(n),i=t(d);s=Boolean(a&&i&&(a===i||a.endsWith(i)||i.endsWith(a)));const r=t(o);l=Boolean(r&&i&&(r===i||r.endsWith(i)||i.endsWith(r)))}if(!s&&!l)return null;if(t===i)return(0,F.jsx)(k.E,{colorScheme:"blue",variant:"subtle",children:"Rem\xedza"});return(s?t:i)>(s?i:t)?(0,F.jsx)(k.E,{colorScheme:"green",variant:"subtle",children:"V\xfdhra"}):(0,F.jsx)(k.E,{colorScheme:"red",variant:"subtle",children:"Prohra"})})()]}),(0,F.jsxs)(m.z,{minW:"40%",spacing:2,children:[(0,F.jsx)(l.a,{className:"logo-container",w:"28px",h:"28px",children:(0,F.jsx)(D.L,{teamId:r,teamName:o,facrLogo:s,size:"custom",boxSize:"28px"})}),(0,F.jsx)(u.E,{noOfLines:1,flex:1,children:(0,R.Lt)(o)})]})]})]})},I=()=>{var e;const{data:t}=(0,j.s)(),n=null===t||void 0===t?void 0:t.club_id,i=(null===t||void 0===t?void 0:t.club_type)||"football",{data:o,isLoading:c}=(0,C.I)({queryKey:["facr-club",n,i],queryFn:()=>E.J.getClub(n,i),enabled:!!n}),[d,h]=a.useState({});a.useEffect(()=>{let e=!0;return(async()=>{try{const t=await(0,T.xN)();if(!e)return;const n={};(t||[]).forEach(e=>{null!==e&&void 0!==e&&e.code&&null!==e&&void 0!==e&&e.alias&&(n[e.code]={alias:e.alias,original_name:e.original_name,display_order:e.display_order})}),h(n)}catch(t){}})(),()=>{e=!1}},[]);const m=null!==(e=null===o||void 0===o?void 0:o.competitions)&&void 0!==e?e:[],p=a.useMemo(()=>{const e=Array.isArray(m)?m:[];return(0,N.tJ)(e.map(e=>{var t,n,a,i,o,r,s;return(0,f.A)((0,f.A)({},e),{},{name:(null===(t=d[e.code])||void 0===t?void 0:t.alias)||(null===(n=d[e.id])||void 0===n?void 0:n.alias)||e.name,alias:(null===(a=d[e.code])||void 0===a?void 0:a.alias)||(null===(i=d[e.id])||void 0===i?void 0:i.alias),display_order:null!==(o=null===(r=d[e.code])||void 0===r?void 0:r.display_order)&&void 0!==o?o:null===(s=d[e.id])||void 0===s?void 0:s.display_order})}))},[m,d]);return c?(0,F.jsx)(s.E,{height:"200px"}):n?o&&o.competitions&&0!==o.competitions.length?(0,F.jsx)(l.a,{children:(0,F.jsxs)(_.t,{variant:"soft-rounded",colorScheme:"blue",size:"sm",children:[(0,F.jsx)(w.w,{px:2,pt:2,overflowX:"auto",overflowY:"hidden",css:{"&::-webkit-scrollbar":{height:"4px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"gray.300",borderRadius:"4px"}},children:p.map(e=>{const t=e.alias||e.name;return(0,F.jsx)(z.o,{flex:"0 0 auto",px:3,py:2,fontSize:"sm",children:(0,F.jsx)(u.E,{as:"span",noOfLines:1,maxW:"220px",title:t,children:t})},e.id)})}),(0,F.jsx)(S.T,{children:p.map(e=>(0,F.jsx)(A.K,{px:0,children:(0,F.jsxs)(r.T,{align:"stretch",spacing:3,children:[(e.matches||[]).slice(0,6).map((e,t)=>(0,F.jsx)(P,{d:e.date_time,h:e.home,hid:e.home_id,hl:e.home_logo_url,a:e.away,aid:e.away_id,al:e.away_logo_url,s:e.score,clubName:o.name,clubId:o.club_internal_id},e.match_id||t)),0===(e.matches||[]).length&&(0,F.jsx)(u.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 z\xe1pasy k dispozici."})]})},e.id))})]})}):(0,F.jsx)(l.a,{p:4,bg:"gray.50",borderRadius:"md",borderWidth:"1px",borderColor:"gray.200",children:(0,F.jsx)(u.E,{color:"gray.600",children:"\u017d\xe1dn\xe9 sout\u011b\u017ee ani z\xe1pasy nejsou k dispozici pro vybran\xfd klub."})}):(0,F.jsx)(l.a,{p:4,bg:"yellow.50",borderRadius:"md",borderWidth:"1px",borderColor:"yellow.200",children:(0,F.jsx)(u.E,{color:"gray.700",children:"Pro zobrazen\xed z\xe1pas\u016f je pot\u0159eba nastavit klub v administraci (Nastaven\xed \u2192 Z\xe1kladn\xed \xfadaje)."})})};var M=n(36695),L=n(35475),W=n(81398);const U=()=>{const{t:e}=(0,b.Bd)(),[t,n]=(0,a.useState)(!0),[f,k]=(0,a.useState)(null),[_,w]=(0,a.useState)(""),{data:z}=(0,j.s)(),[S,A]=(0,a.useState)([]),C=(0,i.dU)("white","gray.800"),E=(0,i.dU)("gray.600","gray.400"),T=(0,i.dU)("gray.100","gray.700");(0,a.useEffect)(()=>{D(),N()},[]);const D=async()=>{n(!0),w("");try{const e=await g.Ay.get("/about");k(e.data)}catch(t){var e;404===(null===t||void 0===t||null===(e=t.response)||void 0===e?void 0:e.status)?w("About page has not been created yet."):w("Nepoda\u0159ilo se na\u010d\xedst str\xe1nku.")}finally{n(!1)}},N=async()=>{try{const e=await(0,M.bW)();A(e||[])}catch(e){}};if((0,a.useEffect)(()=>{try{document.querySelectorAll(".about-content img, .about-timeline img").forEach(e=>{e instanceof HTMLImageElement&&(e.loading="lazy",e.decoding="async",e.style.maxWidth="100%",e.style.height="auto",e.style.display="block")})}catch(e){}},[f]),t)return(0,F.jsx)(y.A,{children:(0,F.jsx)(o.m,{maxW:"container.lg",py:8,children:(0,F.jsxs)(r.T,{align:"stretch",spacing:4,children:[(0,F.jsx)(s.E,{height:"60px"}),(0,F.jsx)(s.E,{height:"400px"})]})})});const P=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return 0===S.length?null:(0,F.jsxs)(l.a,{mt:t,children:[(0,F.jsx)(c.D,{as:"h2",size:"md",mb:4,children:e("blog.categories")}),(0,F.jsx)(r.T,{align:"stretch",spacing:3,children:S.map(t=>(0,F.jsxs)(d.B,{direction:{base:"column",sm:"row"},spacing:{base:3,sm:4},align:{base:"flex-start",sm:"center"},bg:C,borderRadius:"md",p:{base:4,md:5},boxShadow:"sm",borderWidth:"1px",borderColor:T,w:"100%",children:[(0,F.jsxs)(l.a,{flex:"1",minW:0,children:[(0,F.jsx)(c.D,{as:"h3",size:"sm",mb:t.description?1:0,children:t.name}),t.description&&(0,F.jsx)(u.E,{fontSize:"sm",color:E,noOfLines:{base:3,md:2},children:t.description})]}),(0,F.jsx)(h.$,{as:L.N_,to:"/blog?category=".concat(t.id),size:"sm",variant:"outline",colorScheme:"blue",fontWeight:"bold",w:{base:"full",sm:"auto"},children:e("action.open")})]},t.id))})]})};if(_||!f)return(0,F.jsxs)(y.A,{children:[(0,F.jsxs)(x.mg,{children:[(0,F.jsx)("title",{children:null!==z&&void 0!==z&&z.club_name?"".concat(e("nav.club")," | ").concat(z.club_name):e("nav.club")}),(0,F.jsx)("meta",{name:"description",content:e("about.meta_description")}),(null===z||void 0===z?void 0:z.club_logo_url)&&(0,F.jsx)("meta",{property:"og:image",content:(0,R.uq)(z.club_logo_url)||z.club_logo_url})]}),(0,F.jsxs)(o.m,{maxW:"container.lg",py:8,children:[(0,F.jsxs)(l.a,{textAlign:"center",py:6,children:[(0,F.jsx)(c.D,{size:"xl",mb:2,children:e("nav.club")}),(0,F.jsx)(u.E,{color:E,children:e("about.page_not_setup")})]}),(0,F.jsxs)(l.a,{mt:4,mb:10,children:[(0,F.jsx)(c.D,{as:"h2",size:"md",mb:4,children:e("about.matches_by_competition")}),(0,F.jsx)(I,{})]}),P()]})]});const U=f.seo_title||f.title,O=f.seo_description||f.subtitle,q=(null===z||void 0===z?void 0:z.club_name)||f.title,K=null!==z&&void 0!==z&&z.club_logo_url?(0,R.uq)(z.club_logo_url)||z.club_logo_url:void 0,B=v.A.sanitize(f.content,{USE_PROFILES:{html:!0},ADD_TAGS:["iframe"],ADD_ATTR:["class","style","data-bullets","data-list","target","rel","allow","allowfullscreen"]});return(0,F.jsxs)(y.A,{children:[(0,F.jsxs)(x.mg,{children:[(0,F.jsx)("title",{children:U||q}),(0,F.jsx)("meta",{name:"description",content:O||"Informace o na\u0161em klubu, sout\u011b\u017e\xedch, nadch\xe1zej\xedc\xedch z\xe1pasech a rubrik\xe1ch."}),(0,F.jsx)("meta",{property:"og:title",content:U||q}),(0,F.jsx)("meta",{property:"og:description",content:O||"Informace o na\u0161em klubu, sout\u011b\u017e\xedch, nadch\xe1zej\xedc\xedch z\xe1pasech a rubrik\xe1ch."}),K&&(0,F.jsx)("meta",{property:"og:image",content:K})]}),(0,F.jsxs)(o.m,{maxW:"container.lg",py:8,children:[(()=>{switch(f.style){case"modern":return(0,F.jsxs)(l.a,{children:[(0,F.jsxs)(m.z,{spacing:4,mb:8,align:"center",children:[K&&(0,F.jsx)(p._,{src:K,alt:q,boxSize:"64px",objectFit:"contain"}),(0,F.jsxs)(r.T,{align:"start",spacing:1,children:[(0,F.jsx)(c.D,{size:"2xl",children:q}),f.subtitle&&(0,F.jsx)(u.E,{fontSize:"xl",color:E,children:f.subtitle})]})]}),(0,F.jsx)(l.a,{className:"about-content",dangerouslySetInnerHTML:{__html:B},sx:{"& p":{mb:4,lineHeight:1.8},"& a":{color:"blue.600",textDecoration:"underline",_hover:{color:"blue.700"}},"& blockquote":{borderLeft:"4px solid #3182ce",paddingLeft:"16px",margin:"1em 0",color:E,fontStyle:"italic",backgroundColor:"gray.50",padding:"12px 16px",borderRadius:"4px"},"& h1, & h2, & h3":{mt:8,mb:4,fontWeight:"bold"},"& h1":{fontSize:"2xl"},"& h2":{fontSize:"xl"},"& h3":{fontSize:"lg"},"& img":{maxW:"100%",borderRadius:"md",my:6},"& ul, & ol":{pl:8,mb:4,listStylePosition:"outside"},"& ul":{listStyleType:"disc"},'& ul[data-bullets="disc"]':{listStyleType:"disc"},'& ul[data-bullets="circle"]':{listStyleType:"circle"},'& ul[data-bullets="square"]':{listStyleType:"square"},'& ul[data-bullets="none"]':{listStyleType:"none"},"& ol":{listStyleType:"decimal"},"& li":{mb:2}}})]});case"timeline":return(0,F.jsxs)(l.a,{children:[(0,F.jsxs)(m.z,{spacing:4,mb:8,align:"center",children:[K&&(0,F.jsx)(p._,{src:K,alt:q,boxSize:"64px",objectFit:"contain"}),(0,F.jsxs)(r.T,{align:"start",spacing:1,children:[(0,F.jsx)(c.D,{size:"2xl",children:q}),f.subtitle&&(0,F.jsx)(u.E,{fontSize:"xl",color:E,children:f.subtitle})]})]}),(0,F.jsx)(l.a,{className:"about-timeline",dangerouslySetInnerHTML:{__html:B},sx:{position:"relative","&::before":{content:'""',position:"absolute",left:"20px",top:0,bottom:0,width:"2px",bg:"gray.300"},"& p":{mb:4,lineHeight:1.8,pl:12,position:"relative"},"& h1, & h2, & h3":{mt:8,mb:4,fontWeight:"bold",pl:12,position:"relative","&::before":{content:'""',position:"absolute",left:"11px",top:"8px",width:"20px",height:"20px",borderRadius:"full",bg:"brand.500",border:"4px solid white",boxShadow:"md"}},"& ul, & ol":{pl:12,mb:4,listStylePosition:"outside"},"& ul":{listStyleType:"disc"},'& ul[data-bullets="disc"]':{listStyleType:"disc"},'& ul[data-bullets="circle"]':{listStyleType:"circle"},'& ul[data-bullets="square"]':{listStyleType:"square"},'& ul[data-bullets="none"]':{listStyleType:"none"},"& ol":{listStyleType:"decimal"},"& li":{mb:2},"& img":{maxW:"100%",borderRadius:"md",my:6,ml:12}}})]});case"custom":return(0,F.jsx)(l.a,{dangerouslySetInnerHTML:{__html:B}});default:return(0,F.jsxs)(l.a,{children:[(0,F.jsxs)(m.z,{spacing:4,mb:8,align:"center",children:[K&&(0,F.jsx)(p._,{src:K,alt:q,boxSize:"64px",objectFit:"contain"}),(0,F.jsxs)(r.T,{align:"start",spacing:1,children:[(0,F.jsx)(c.D,{size:"2xl",children:q}),f.subtitle&&(0,F.jsx)(u.E,{fontSize:"xl",color:E,children:f.subtitle})]})]}),(0,F.jsx)(l.a,{className:"about-content",dangerouslySetInnerHTML:{__html:B},sx:{"& p":{mb:4,lineHeight:1.8},"& a":{color:"blue.600",textDecoration:"underline",_hover:{color:"blue.700"}},"& blockquote":{borderLeft:"4px solid #3182ce",paddingLeft:"16px",margin:"1em 0",color:E,fontStyle:"italic",backgroundColor:"gray.50",padding:"12px 16px",borderRadius:"4px"},"& h1, & h2, & h3":{mt:6,mb:3,fontWeight:"bold"},"& h1":{fontSize:"2xl"},"& h2":{fontSize:"xl"},"& h3":{fontSize:"lg"},"& img":{maxW:"100%",borderRadius:"md",my:4},"& ul, & ol":{pl:8,mb:4,listStylePosition:"outside"},"& ul":{listStyleType:"disc"},'& ul[data-bullets="disc"]':{listStyleType:"disc"},'& ul[data-bullets="circle"]':{listStyleType:"circle"},'& ul[data-bullets="square"]':{listStyleType:"square"},'& ul[data-bullets="none"]':{listStyleType:"none"},"& ol":{listStyleType:"decimal"},"& li":{mb:2}}})]})}})(),P({base:10,md:12})]}),(0,F.jsx)(W.A,{})]})}},21718:(e,t,n)=>{n.r(t),n.d(t,{default:()=>O});var a=n(65043),i=n(73216),o=n(35475),r=n(96870),s=n(44093),l=n(98939),c=n(10202),d=n(76659),u=n(39081),h=n(98662),m=n(22107),p=n(49027),x=n(26806),g=n(32332),v=n(96148),j=n(28846),b=n(87139),y=n(73212),f=n(33572),k=n(38326),_=n(28646),w=n(70067),z=n(70764),S=n(40378),A=n(46291),C=n(78460),E=n(11054),T=n(35929),D=n(85421),N=n(67516),R=n(25011),F=n(40614),P=n(74117),I=n(70579);const M=e=>{let{isOpen:t,onClose:n,photoUrl:i,pageUrl:o,albumTitle:r}=e;const{t:l}=(0,P.Bd)(),[d,p]=a.useState({width:0,height:0}),[x,g]=a.useState(!1),j=(0,s.dU)("white","gray.800"),b=(0,s.dU)("gray.200","gray.600"),y=(0,s.dU)("gray.700","gray.200"),k=d.width>1.5*d.height;return(0,I.jsxs)(C.aF,{isOpen:t,onClose:n,size:"full",isCentered:!0,scrollBehavior:"inside",children:[(0,I.jsx)(E.m,{bg:"blackAlpha.900",backdropFilter:"blur(8px)"}),!k&&(0,I.jsx)(T.s,{color:"white",bg:"blackAlpha.600",_hover:{bg:"blackAlpha.800"},size:"lg",top:4,right:4,zIndex:10,borderRadius:"full"}),(0,I.jsx)(D.$,{bg:"transparent",boxShadow:"none",maxW:"100vw",maxH:"100vh",position:"relative",overflow:"hidden",children:(0,I.jsx)(N.c,{p:0,m:0,children:(0,I.jsxs)(c.T,{spacing:0,align:"stretch",h:"100vh",children:[(0,I.jsxs)(m.a,{flex:1,display:"flex",alignItems:"center",justifyContent:"center",position:"relative",minH:"60vh",children:[(0,I.jsx)(f._,{src:i,alt:r||l("gallery.photo_modal_title"),maxH:"85vh",maxW:"95vw",objectFit:"contain",loading:"eager",onLoad:e=>{const t=e.currentTarget;p({width:t.naturalWidth,height:t.naturalHeight}),g(!0)},fallback:(0,I.jsx)(m.a,{w:"400px",h:"300px",bg:"gray.200",borderRadius:"lg",display:"flex",alignItems:"center",justifyContent:"center",children:(0,I.jsx)(u.E,{color:"gray.500",children:l("common.loading")})})}),k&&x&&(0,I.jsx)(h.$,{position:"absolute",top:4,right:4,color:"white",bg:"blackAlpha.600",_hover:{bg:"blackAlpha.800"},borderRadius:"full",p:2,minW:"auto",h:"auto",onClick:n,zIndex:10,children:(0,I.jsx)(R.I,{as:F.A,boxSize:6})})]}),(0,I.jsx)(m.a,{bg:j,borderTop:"1px solid",borderColor:b,p:4,boxShadow:"0 -4px 6px -1px rgba(0, 0, 0, 0.1)",children:(0,I.jsxs)(c.T,{spacing:3,align:"stretch",maxW:"800px",mx:"auto",children:[r&&(0,I.jsx)(u.E,{fontSize:"md",fontWeight:"600",color:y,textAlign:"center",noOfLines:2,children:r}),(0,I.jsxs)(v.z,{spacing:3,justify:"center",flexWrap:"wrap",children:[(0,I.jsx)(h.$,{as:"a",href:o,target:"_blank",rel:"noopener noreferrer",leftIcon:(0,I.jsx)(z.A,{size:18}),colorScheme:"purple",size:"sm",variant:"solid",children:l("gallery.view_original")}),(0,I.jsx)(h.$,{onClick:n,colorScheme:"gray",size:"sm",variant:"outline",children:l("common.close")})]})]})})]})})})]})};var L=n(61269),W=n(49367);const U=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(A.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}},O=()=>{const{t:e}=(0,P.Bd)(),{id:t}=(0,i.g)(),[n,C]=(0,a.useState)(null),[E,T]=(0,a.useState)(!0),[D,N]=(0,a.useState)(""),[R,F]=(0,a.useState)(null),{isOpen:O,onOpen:q,onClose:K}=(0,r.j)(),B=(0,s.dU)("#f8f9fb","#0f1115"),Z=(0,s.dU)("white","#1a1d29"),V=(0,s.dU)("#e5e7eb","#2a2e3a"),H=(0,s.dU)("gray.800","gray.100"),$=(0,s.dU)("gray.600","gray.300"),J=(0,s.dU)("blue.50","blue.900"),G=(0,s.dU)("blue.200","blue.700"),X=(0,s.dU)("blue.800","blue.200");(0,a.useEffect)(()=>{(async()=>{if(t){T(!0),N("");try{const[n,a]=await Promise.allSettled([fetch(U("/cache/prefetch/zonerama_profile.json"),{cache:"no-cache"}),fetch(U("/cache/prefetch/zonerama_albums.json"),{cache:"no-cache"})]);let i=null;if("fulfilled"===n.status&&n.value.ok){const e=await n.value.json();i=(e.albums||[]).find(e=>e.id===t)}if(!i&&"fulfilled"===a.status&&a.value.ok){const e=await a.value.json();i=(Array.isArray(e)?e:[]).find(e=>e.id===t)}if(!i){try{const e="https://eu.zonerama.com/Album/".concat(t),n=new URLSearchParams({link:e,photo_limit:"200",rendered:"true"}),a=await fetch("".concat(A.API_URL,"/zonerama-album?").concat(n.toString()));if(a.ok){const n=await a.json();let i=null,o=[];if(Array.isArray(null===n||void 0===n?void 0:n.albums)&&n.albums.length>0?(i=n.albums[0],o=i.photos||[]):null!==n&&void 0!==n&&n.album&&Array.isArray(null===n||void 0===n?void 0:n.photos)&&(i=n.album,o=n.photos),i){const n={id:String(i.id||t),title:String(i.title||""),url:String(i.url||e),date:String(i.date||""),photos_count:Array.isArray(o)?o.length:0,views_count:"number"===typeof i.views_count?i.views_count:void 0,photos:(o||[]).map(e=>({id:String(e.id||""),page_url:String(e.page_url||""),image_1500:String(e.image_1500||"")})),fetched_at:i.fetched_at};return void C(n)}}}catch(e){}throw new Error("Album nenalezeno")}C(i)}catch(n){N(n.message||"Chyba p\u0159i na\u010d\xedt\xe1n\xed alba")}finally{T(!1)}}})()},[t]);return E?(0,I.jsx)(S.A,{children:(0,I.jsx)(l.m,{maxW:"7xl",py:8,children:(0,I.jsxs)(c.T,{spacing:4,children:[(0,I.jsx)(d.y,{size:"xl",color:"brand.primary"}),(0,I.jsx)(u.E,{color:$,children:e("gallery.loading_album")})]})})}):D||!n?(0,I.jsx)(S.A,{children:(0,I.jsx)(l.m,{maxW:"7xl",py:8,children:(0,I.jsxs)(c.T,{spacing:4,children:[(0,I.jsx)(u.E,{color:"red.500",fontSize:"lg",children:D||e("gallery.album_not_found")}),(0,I.jsx)(h.$,{as:o.N_,to:"/galerie",colorScheme:"blue",children:e("gallery.back_to_gallery")})]})})}):(0,I.jsxs)(S.A,{children:[(0,I.jsxs)(W.mg,{children:[(0,I.jsxs)("title",{children:[n.title," | ",e("gallery.page_title")]}),(0,I.jsx)("meta",{name:"description",content:"".concat(e("gallery.page_title"),": ").concat(n.title,".")})]}),(0,I.jsx)(m.a,{bg:B,minH:"100vh",py:8,children:(0,I.jsxs)(l.m,{maxW:"7xl",children:[(0,I.jsxs)(p.Q,{spacing:2,separator:(0,I.jsx)(k.A,{size:16,color:"gray"}),mb:6,fontSize:"sm",children:[(0,I.jsx)(x.J,{children:(0,I.jsx)(g.w,{as:o.N_,to:"/",children:e("nav.home")})}),(0,I.jsx)(x.J,{children:(0,I.jsx)(g.w,{as:o.N_,to:"/galerie",children:e("nav.gallery")})}),(0,I.jsx)(x.J,{isCurrentPage:!0,children:(0,I.jsx)(g.w,{children:n.title})})]}),(0,I.jsxs)(c.T,{align:"stretch",spacing:4,mb:8,children:[(0,I.jsxs)(v.z,{justify:"space-between",align:"start",flexWrap:"wrap",gap:4,children:[(0,I.jsxs)(c.T,{align:"start",spacing:2,flex:1,children:[(0,I.jsx)(j.D,{size:"xl",color:H,children:n.title}),(0,I.jsxs)(v.z,{spacing:4,flexWrap:"wrap",fontSize:"sm",color:$,children:[n.date&&(0,I.jsxs)(v.z,{spacing:1,children:[(0,I.jsx)(_.A,{size:16}),(0,I.jsx)(u.E,{children:n.date})]}),(0,I.jsxs)(v.z,{spacing:1,children:[(0,I.jsx)(w.A,{size:16}),(0,I.jsx)(u.E,{children:1===n.photos_count?e("gallery.photos_count_one",{count:n.photos_count}):n.photos_count>=2&&n.photos_count<=4?e("gallery.photos_count_few",{count:n.photos_count}):e("gallery.photos_count_many",{count:n.photos_count})})]}),void 0!==n.views_count&&n.views_count>0&&(0,I.jsx)(b.E,{colorScheme:"purple",children:1===n.views_count?e("gallery.views_count_one",{count:n.views_count}):n.views_count>=2&&n.views_count<=4?e("gallery.views_count_few",{count:n.views_count}):e("gallery.views_count_many",{count:n.views_count})})]})]}),(0,I.jsx)(h.$,{as:"a",href:n.url,target:"_blank",rel:"noopener noreferrer",rightIcon:(0,I.jsx)(z.A,{size:18}),colorScheme:"purple",size:"md",children:e("gallery.view_on_zonerama")})]}),(0,I.jsx)(m.a,{bg:J,borderWidth:"1px",borderColor:G,borderRadius:"md",p:3,children:(0,I.jsxs)(u.E,{fontSize:"sm",color:X,children:[e("gallery.photos_from_zonerama")," ",(0,I.jsx)(u.E,{as:"a",href:n.url||"https://zonerama.com",target:"_blank",rel:"noopener noreferrer",fontWeight:"600",color:"blue.600",_hover:{textDecoration:"underline"},children:"Zonerama"})]})})]}),n.photos&&n.photos.length>0?(0,I.jsx)(y.r,{columns:{base:2,md:3,lg:4,xl:5},spacing:4,children:n.photos.map(e=>(0,I.jsx)(m.a,{cursor:"pointer",onClick:()=>(e=>{F(e),q()})(e),borderRadius:"lg",overflow:"hidden",boxShadow:"md",borderWidth:"1px",borderColor:V,transition:"all 0.2s",_hover:{transform:"translateY(-4px)",boxShadow:"xl",borderColor:(0,s.dU)("gray.300","gray.600")},bg:Z,children:(0,I.jsx)(f._,{src:U(e.image_1500),alt:"Fotka ".concat(e.id),w:"100%",h:"200px",objectFit:"cover",loading:"lazy"})},e.id))}):(0,I.jsx)(m.a,{bg:"bg.card",borderWidth:"1px",borderColor:"border.subtle",borderRadius:"lg",p:8,textAlign:"center",children:(0,I.jsx)(u.E,{color:"gray.500",children:e("gallery.no_photos_in_album")})}),n.id&&(0,I.jsx)(m.a,{mt:6,children:(0,I.jsx)(L.A,{targetType:"gallery_album",targetId:String(n.id)})})]})}),R&&(0,I.jsx)(M,{isOpen:O,onClose:()=>{K(),F(null)},photoUrl:U(R.image_1500),pageUrl:R.page_url,albumTitle:n.title})]})}},22192:(e,t,n)=>{n.r(t),n.d(t,{default:()=>z});var a=n(65043),i=n(88787),o=n(85871),r=n(87139),s=n(22107),l=n(44093),c=n(98939),d=n(73212),u=n(76659),h=n(10202),m=n(14566),p=n(31411),x=n(10227),g=n(51794),v=n(3109),j=n(28846),b=n(39081),y=n(72526),f=n(40378),k=n(35349),_=n(71093),w=n(70579);const z=()=>{const[e,t]=(0,a.useState)(0),n=(0,l.dU)("white","gray.800"),{data:z,isLoading:S}=(0,y.I)({queryKey:["polls"],queryFn:()=>(0,_.Ps)(),staleTime:12e4}),{data:A,isLoading:C}=(0,y.I)({queryKey:["polls-details",null===z||void 0===z?void 0:z.map(e=>e.id)],queryFn:async()=>{if(!z||0===z.length)return[];const e=z.map(e=>(0,_.gU)(e.id));return await Promise.all(e)},enabled:!!z&&z.length>0}),E=(null===A||void 0===A?void 0:A.filter(e=>e.poll.featured))||[],T=(null===A||void 0===A?void 0:A.filter(e=>e.is_active))||[],D=A||[];return S||C?(0,w.jsx)(f.A,{children:(0,w.jsx)(c.m,{maxW:"7xl",py:8,children:(0,w.jsxs)(h.T,{spacing:4,children:[(0,w.jsx)(u.y,{size:"xl"}),(0,w.jsx)(b.E,{children:"Na\u010d\xedt\xe1n\xed anket..."})]})})}):z&&0!==z.length?(0,w.jsx)(f.A,{children:(0,w.jsx)(s.a,{bg:n,minH:"100vh",children:(0,w.jsx)(c.m,{maxW:"7xl",py:8,children:(0,w.jsxs)(h.T,{spacing:8,align:"stretch",children:[(0,w.jsxs)(h.T,{spacing:2,align:"start",children:[(0,w.jsx)(j.D,{size:"xl",children:"Ankety a hlasov\xe1n\xed"}),(0,w.jsx)(b.E,{color:"gray.600",children:"Hlasujte v anket\xe1ch a pod\u011blte se o sv\u016fj n\xe1zor s ostatn\xedmi fanou\u0161ky!"})]}),(0,w.jsxs)(v.t,{index:e,onChange:t,colorScheme:"blue",children:[(0,w.jsxs)(p.w,{children:[(0,w.jsxs)(m.o,{children:["V\u0161echny",D.length>0&&(0,w.jsx)(r.E,{ml:2,colorScheme:"blue",children:D.length})]}),(0,w.jsxs)(m.o,{children:["Aktivn\xed",T.length>0&&(0,w.jsx)(r.E,{ml:2,colorScheme:"green",children:T.length})]}),E.length>0&&(0,w.jsxs)(m.o,{children:["Zv\xfdrazn\u011bn\xe9",(0,w.jsx)(r.E,{ml:2,colorScheme:"purple",children:E.length})]})]}),(0,w.jsxs)(g.T,{children:[(0,w.jsx)(x.K,{children:(0,w.jsx)(d.r,{columns:{base:1,md:2,lg:3},spacing:6,children:D.map(e=>(0,w.jsx)(k.A,{poll:e.poll,hasVoted:e.has_voted,isActive:e.is_active,canShowResults:e.can_show_results},e.poll.id))})}),(0,w.jsx)(x.K,{children:T.length>0?(0,w.jsx)(d.r,{columns:{base:1,md:2,lg:3},spacing:6,children:T.map(e=>(0,w.jsx)(k.A,{poll:e.poll,hasVoted:e.has_voted,isActive:e.is_active,canShowResults:e.can_show_results},e.poll.id))}):(0,w.jsxs)(i.F,{status:"info",children:[(0,w.jsx)(o._,{}),"Moment\xe1ln\u011b nejsou k dispozici \u017e\xe1dn\xe9 aktivn\xed ankety."]})}),E.length>0&&(0,w.jsx)(x.K,{children:(0,w.jsx)(d.r,{columns:{base:1,md:2,lg:3},spacing:6,children:E.map(e=>(0,w.jsx)(k.A,{poll:e.poll,hasVoted:e.has_voted,isActive:e.is_active,canShowResults:e.can_show_results},e.poll.id))})})]})]})]})})})}):(0,w.jsx)(f.A,{children:(0,w.jsx)(c.m,{maxW:"7xl",py:8,children:(0,w.jsxs)(h.T,{spacing:6,align:"stretch",children:[(0,w.jsx)(j.D,{size:"xl",children:"Ankety a hlasov\xe1n\xed"}),(0,w.jsxs)(i.F,{status:"info",children:[(0,w.jsx)(o._,{}),"Moment\xe1ln\u011b nejsou k dispozici \u017e\xe1dn\xe9 ankety. Brzy p\u0159id\xe1me nov\xe9!"]})]})})})}},22210:(e,t,n)=>{n.d(t,{YA:()=>i,_y:()=>o,f_:()=>r});var a=n(46291);const i=async()=>(await a.Ay.get("/setup/status")).data,o=async e=>(await a.Ay.post("/setup/initialize",e,{timeout:3e4})).data,r=async e=>(await a.Ay.post("/setup/validate-smtp",e,{timeout:3e4})).data},23857:(e,t,n)=>{n.d(t,{EA:()=>c,Jm:()=>l,Tu:()=>s,Wj:()=>d,eG:()=>u,eT:()=>o,fg:()=>i,vv:()=>r});var a=n(46291);async function i(e){return(await a.Ay.get("/comments",{params:e})).data}async function o(e){return(await a.Ay.post("/comments",e)).data}async function r(e,t){return(await a.Ay.put("/comments/".concat(e),t)).data}async function s(e){return(await a.Ay.delete("/comments/".concat(e))).data}async function l(e,t){return(await a.Ay.post("/comments/".concat(e,"/react"),{type:t})).data}async function c(e){return(await a.Ay.delete("/comments/".concat(e,"/react"))).data}async function d(e){return(await a.Ay.post("/comments/unban-request",{message:e})).data}async function u(e,t){return(await a.Ay.post("/comments/".concat(e,"/report"),{reason:t})).data}},23978:(e,t,n)=>{n.d(t,{pU:()=>i,wY:()=>r,xU:()=>o});const a=[{id:"deepseek-chat",label:"DeepSeek Chat",provider:"deepseek",description:"Rychl\xfd univerz\xe1ln\xed model pro textov\xe9 \xfalohy."},{id:"deepseek-reasoner",label:"DeepSeek Reasoner",provider:"deepseek",description:"Model zam\u011b\u0159en\xfd na hlub\u0161\xed vysv\u011btlov\xe1n\xed a \u0159et\u011bzen\xed \xfavah."},{id:"mistral-small-latest",label:"Mistral Small",provider:"mistral",description:"Leh\u010d\xed Mistral pro rychlej\u0161\xed odpov\u011bdi."},{id:"ministral-14b-latest",label:"Ministral 14B",provider:"mistral",description:"V\xfdkonn\u011bj\u0161\xed Mistral 14B pro kvalitn\u011bj\u0161\xed text."},{id:"openrouter-primary",label:"OpenRouter (v\xfdchoz\xed)",provider:"openrouter",description:"Konfigurace OpenRouter dle backendu."},{id:"grok-4-1-fast-non-reasoning",label:"Grok 4.1 Fast",provider:"grok",description:"Rychl\xfd model od xAI pro b\u011b\u017en\xe9 \xfalohy."},{id:"grok-4-1-fast-reasoning",label:"Grok 4.1 Fast Reasoning",provider:"grok",description:"Model s reasoning pro hlub\u0161\xed anal\xfdzu (m\u016f\u017ee trvat d\xe9le)."}];function i(){try{return function(e){const t=({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic",REACT_APP_ESHOP_URL:"http://localhost:3100",REACT_APP_ERROR_INGEST_URL:"http://127.0.0.1:8083/api/v1/errors",REACT_APP_ERROR_INGEST_TOKEN:""}[e]||"").toString().trim().toLowerCase();return!!t&&("1"===t||"true"===t||"yes"===t)}("REACT_APP_OPENROUTER_ON")?a.filter(e=>"openrouter"===e.provider):a.filter(e=>"openrouter"!==e.provider)}catch(e){return a.filter(e=>"deepseek"===e.provider||"mistral"===e.provider)}}function o(){try{var e,t;return null!==(e=null===(t=i()[0])||void 0===t?void 0:t.id)&&void 0!==e?e:"deepseek-chat"}catch(n){return"deepseek-chat"}}function r(e){return a.find(t=>t.id===e)}},24122:(e,t,n)=>{n.d(t,{A:()=>oe});var a=n(65043),i=n(89379),o=n(30502),r=n(22107),s=n(10202),l=n(96148),c=n(98662),d=n(39081),u=n(42703),h=n(99956),m=n(35699),p=n(73225),x=n(76668),g=n(78460),v=n(11054),j=n(85421),b=n(15071),y=n(35929),f=n(67516),k=n(56529),_=n(63935),w=n(19542),z=n(19077),S=n(68455),A=n(34946),C=n(73212),E=n(92823),T=n.n(E),D=n(71586),N=n(87977),R=(n(57590),n(89576),n(93777),n(70067)),F=n(72105),P=n(7365),I=n(40614),M=n(83149),L=n(1441),W=n(54348),U=n(94805),O=n(30086),q=n(18864),K=n(38638),B=n(9855),Z=n(27940),V=n(85034),H=n(94699),$=n(35087),J=n(38298),G=n(56099),X=n(36210),Y=n(33572),Q=n(46291),ee=n(25189);const te=async e=>{const t=(await Q.Ay.post("/image-processing/quick-edit",e)).data||{};return t&&"string"===typeof t.url&&(t.url=(0,ee.uq)(t.url)||t.url),t};var ne=n(70579);const ae=e=>{let{value:t,onChange:E,placeholder:ae="Za\u010dn\u011bte ps\xe1t...",height:ie="400px",readOnly:oe=!1,onImageUpload:re,showImageResize:se=!0,toolbar:le="full"}=e;const ce=(0,o.d)(),de=(0,a.useRef)(null),ue=(0,a.useRef)(null),he=(0,a.useRef)(E),me=(0,a.useRef)(null),pe=(0,a.useRef)(""),xe=(0,a.useRef)(null),ge=(0,a.useRef)(()=>{}),ve=(0,a.useRef)({active:!1,startX:0,startY:0,startLeft:0,startTop:0}),[je,be]=(0,a.useState)(!1);(0,a.useEffect)(()=>(be(!0),()=>be(!1)),[]),(0,a.useEffect)(()=>{he.current=E},[E]),(0,a.useEffect)(()=>()=>{null!==me.current&&(window.clearTimeout(me.current),me.current=null)},[]);const[ye,fe]=(0,a.useState)(!1),[ke,_e]=(0,a.useState)(null),[we,ze]=(0,a.useState)(null),[Se,Ae]=(0,a.useState)({unit:"%",width:80,height:80,x:10,y:10}),[Ce,Ee]=(0,a.useState)(85),[Te,De]=(0,a.useState)(1600),[Ne,Re]=(0,a.useState)(!1),Fe=(0,a.useRef)(null),[Pe,Ie]=(0,a.useState)(!1),[Me,Le]=(0,a.useState)(""),[We,Ue]=(0,a.useState)(""),Oe=(0,a.useRef)(null),[qe,Ke]=(0,a.useState)(!1),[Be,Ze]=(0,a.useState)(""),Ve=(0,a.useRef)(null),He=(0,a.useRef)(!1),[$e,Je]=(0,a.useState)(null),[Ge,Xe]=(0,a.useState)("block"),[Ye,Qe]=(0,a.useState)(!1),et=(0,a.useRef)(null),[tt,nt]=(0,a.useState)(!1),at=(0,a.useRef)(""),it=(0,a.useRef)(""),ot="gray.200",[rt,st]=(0,a.useState)(null),[lt,ct]=(0,a.useState)({brightness:100,contrast:100,saturation:100,blur:0,grayscale:0,sepia:0,hueRotate:0,rotation:0,flipH:!1,flipV:!1}),[dt,ut]=(0,a.useState)(!1),[ht,mt]=(0,a.useState)({top:0,left:0}),[pt,xt]=(0,a.useState)(null),[gt,vt]=(0,a.useState)(!1),[jt,bt]=(0,a.useState)(0),[yt,ft]=(0,a.useState)(""),[kt,_t]=(0,a.useState)(0),wt={full:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"}],[{align:[]}],["link","image"],["blockquote"],["clean"]],basic:[[{header:[1,2,3,!1]}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"}],[{align:[]}],["link","image"],["clean"]],minimal:[["bold","italic","underline"],[{list:"bullet"}],["link"],["clean"]]},zt=(0,a.useMemo)(()=>wt[le]||wt.full,[le]),St=(0,a.useCallback)(e=>{try{const t=document.createElement("div");t.innerHTML=e||"";return t.querySelectorAll("img").forEach(e=>{try{e.removeAttribute("draggable");const t=(e.getAttribute("style")||"").trim();if(t){const n=t.split(";").map(e=>e.trim()).filter(Boolean).filter(e=>{var t;const n=null===(t=e.split(":")[0])||void 0===t?void 0:t.trim().toLowerCase();return"outline"!==n&&"box-shadow"!==n&&"cursor"!==n}).join("; ");n?e.setAttribute("style",n):e.removeAttribute("style")}}catch(t){}}),t.innerHTML}catch(t){return e}},[]),At=(0,a.useCallback)((e,t,n)=>{if(oe)return;if("user"!==n)return;const a=St(e||"");a!==pe.current&&(pe.current=a,null!==me.current&&window.clearTimeout(me.current),me.current=window.setTimeout(()=>{me.current=null;try{he.current(a)}catch(e){console.error("CustomRichEditor onChange error",e)}},150))},[oe,St]),Ct=(0,a.useCallback)(()=>{const e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept","image/*"),e.onchange=async()=>{const t=(e.files||[])[0];if(!t)return;ze(t);const n=new FileReader;n.onload=()=>{_e(n.result),fe(!0)},n.readAsDataURL(t)},e.click()},[]),Et=(0,a.useCallback)(()=>{var e;const t=null===(e=de.current)||void 0===e?void 0:e.getEditor();if(!t)return;const n=t.getSelection(),a=n?n.index:t.getLength(),i=n?n.length:0;Oe.current={index:a,length:i};const o=i>0?t.getText(a,i):"";Le(o||""),Ue(""),Ie(!0)},[]),Tt=(0,a.useCallback)(function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"block";const n=null===(e=de.current)||void 0===e?void 0:e.getEditor();if(!n)return;const a=n.getSelection();if(Xe(t),"document"===t)try{var i;const e=(null===(i=n.root)||void 0===i?void 0:i.innerHTML)||"";Ze(St(e)),Ve.current={index:0,length:n.getLength()}}catch(o){Ze(""),Ve.current={index:0,length:0}}else Ve.current=a?{index:a.index,length:a.length}:{index:n.getLength(),length:0},Ze("");Ke(!0)},[St]),Dt=(0,a.useCallback)(()=>{var e;const t=null===(e=de.current)||void 0===e?void 0:e.getEditor();if(!t)return;const n=Be.trim();if(!n)return void ce({title:"Pr\xe1zdn\xfd HTML k\xf3d",description:"Zadejte HTML, kter\xe9 chcete vlo\u017eit.",status:"warning",duration:2e3});const a=N.A.sanitize(n,{USE_PROFILES:{html:!0},ADD_TAGS:["iframe"],ADD_ATTR:["class","target","rel","allow","allowfullscreen","style","data-filters","data-img-id","data-bullets","data-list"]});if("document"===Ge){if(!("undefined"!==typeof window&&"1"===window.localStorage.getItem("rte_skip_full_html_confirm")))return at.current=a,it.current=n,nt(!1),void Qe(!0);const e=t.getLength();t.focus();try{t.deleteText(0,e,"api")}catch(o){}try{t.clipboard.dangerouslyPasteHTML(0,a,"user")}catch(r){const e=N.A.sanitize(n,{USE_PROFILES:{html:!0}});t.insertText(0,e,"user")}return he.current(St(t.root.innerHTML)),Ke(!1),Ze(""),void ce({title:"Obsah aktualizov\xe1n",status:"success",duration:2e3})}const i=(Ve.current||t.getSelection()||{index:t.getLength(),length:0}).index;t.focus();try{t.clipboard.dangerouslyPasteHTML(i,a,"user")}catch(s){const e=N.A.sanitize(n,{USE_PROFILES:{html:!0}});t.insertText(i,e,"user")}he.current(St(t.root.innerHTML)),Ke(!1),Ze(""),ce({title:"HTML vlo\u017eeno",status:"success",duration:2e3})},[Be,ce,St,Ge]),Nt=(0,a.useMemo)(()=>({toolbar:{container:zt,handlers:{image:re?Ct:void 0,link:Et}},clipboard:{matchVisual:!1}}),[zt,re,Ct,Et]);(0,a.useEffect)(()=>{var e;if(!je||oe)return;const t=null===(e=de.current)||void 0===e?void 0:e.getEditor();if(!t)return;const n=(e,n,a)=>{if("user"!==a||He.current||qe)return;let i="";if(Array.isArray(null===e||void 0===e?void 0:e.ops)&&e.ops.forEach(e=>{"string"===typeof e.insert&&(i+=e.insert)}),!i||!/[<>]/.test(i))return;const o=t.getSelection();if(!o)return;const r=Math.max(0,o.index-200),s=t.getText(r,o.index-r),l=s.lastIndexOf("<");if(l<0)return;let c=s.slice(l);if(c=(c||"").trim(),!/^<\/?[A-Za-z]/.test(c))return;const d=r+l,u=o.index-d;if(!(u<=0||u>200)){He.current=!0;try{t.deleteText(d,u,"api")}catch(h){}try{Ve.current={index:d,length:0}}catch(m){}Ke(!0),Ze(c),setTimeout(()=>{He.current=!1},120)}};return t.on("text-change",n),()=>{try{t.off("text-change",n)}catch(e){}}},[je,oe,qe]),(0,a.useEffect)(()=>{let e=!0;return qe&&!$e&&n.e(158).then(n.bind(n,77158)).then(t=>{e&&Je(()=>t.default||t)}).catch(()=>{}),()=>{e=!1}},[qe,$e]);const Rt=(0,a.useMemo)(()=>["header","bold","italic","underline","strike","blockquote","list","indent","align","link","image","color","background"],[]);(0,a.useEffect)(()=>{var e,t;if(!je)return;const n=null===(e=de.current)||void 0===e?void 0:e.getEditor();if(!n)return;const a=null===(t=n.root)||void 0===t?void 0:t.parentElement,i=null===a||void 0===a?void 0:a.previousElementSibling;if(!i)return;const o=(e,t)=>{i.querySelectorAll(e).forEach(e=>{e.setAttribute("title",t),e.setAttribute("aria-label",t)})};o("button.ql-bold","Tu\u010dn\xe9"),o("button.ql-italic","Kurz\xedva"),o("button.ql-underline","Podtr\u017een\xed"),o("button.ql-strike","P\u0159e\u0161krtnut\xed"),o("button.ql-link","Vlo\u017eit odkaz"),o("button.ql-image","Vlo\u017eit obr\xe1zek"),o("button.ql-blockquote","Citace"),o("button.ql-clean","Vy\u010distit form\xe1tov\xe1n\xed"),o('button.ql-list[value="ordered"]',"\u010c\xedslovan\xfd seznam"),o('button.ql-list[value="bullet"]',"Odr\xe1\u017ekov\xfd seznam"),o("button.ql-align","Zarovn\xe1n\xed"),o('button.ql-align[value=""]',"Zarovnat vlevo"),o('button.ql-align[value="center"]',"Zarovnat na st\u0159ed"),o('button.ql-align[value="right"]',"Zarovnat vpravo"),o('button.ql-align[value="justify"]',"Do bloku"),o(".ql-color .ql-picker-label","Barva textu"),o(".ql-background .ql-picker-label","Barva pozad\xed"),o(".ql-header .ql-picker-label","Nadpis"),o('.ql-header .ql-picker-item[data-value="1"]',"Nadpis 1"),o('.ql-header .ql-picker-item[data-value="2"]',"Nadpis 2"),o('.ql-header .ql-picker-item[data-value="3"]',"Nadpis 3")},[je,le]);(0,a.useEffect)(()=>{var e;const t=null===(e=de.current)||void 0===e?void 0:e.getEditor();if(!t||oe)return;let n=null,a=null,i=!1,o=0,r=0,s=0,l=0;const c=()=>{a&&a.parentNode&&(a.parentNode.removeChild(a),a=null)},d=e=>{n&&(n.style.outline="",n.style.cursor="",n.style.boxShadow=""),n=e;let l=e.getAttribute("data-img-id")||"";if(!l){l="img-"+Date.now()+"-"+Math.random().toString(36).slice(2);try{e.setAttribute("data-img-id",l)}catch(j){}}xe.current=l,e.style.outline="3px solid #3182ce",e.style.cursor="move",e.style.boxShadow="0 4px 12px rgba(49, 130, 206, 0.3)",e.setAttribute("draggable","true"),(e=>{c();const n=document.createElement("div");n.className="custom-image-resize-container",n.style.cssText="\n position: absolute;\n pointer-events: none;\n z-index: 1000;\n ";const l=t.root.parentElement;if(!l)return null;const d=document.createElement("div");d.style.cssText="\n position: absolute;\n top: -26px;\n right: 0;\n background: rgba(26,32,44,0.9);\n color: #fff;\n font-size: 11px;\n line-height: 1;\n padding: 4px 6px;\n border-radius: 4px;\n pointer-events: none;\n box-shadow: 0 2px 6px rgba(0,0,0,0.3);\n ";const u=n=>{try{const a=t.root.clientWidth||n||1,i=Math.max(1,Math.min(100,Math.round(n/a*100))),o=e.getAttribute("data-img-id")||"";d.textContent="".concat(Math.round(n)," px (").concat(i,"%)").concat(o?" \u2022 ".concat(o):"")}catch(a){const t=e.getAttribute("data-img-id")||"";d.textContent="".concat(Math.round(n)," px").concat(t?" \u2022 ".concat(t):"")}},h=()=>{const a=e.getBoundingClientRect(),i=l.getBoundingClientRect(),o=t.root.scrollTop,r=t.root.scrollLeft;n.style.left="".concat(a.left-i.left+r,"px"),n.style.top="".concat(a.top-i.top+o,"px"),n.style.width="".concat(a.width,"px"),n.style.height="".concat(a.height,"px")};[{position:"bottom-right",cursor:"nwse-resize",width:"20px",height:"20px",isCorner:!0},{position:"bottom-left",cursor:"nesw-resize",width:"20px",height:"20px",isCorner:!0},{position:"top-right",cursor:"nesw-resize",width:"20px",height:"20px",isCorner:!0},{position:"top-left",cursor:"nwse-resize",width:"20px",height:"20px",isCorner:!0}].forEach(a=>{let{position:l,cursor:c,width:d,height:m,isCorner:p}=a;const x=document.createElement("div");x.className="custom-image-resize-handle custom-resize-".concat(l);let g="position: absolute; pointer-events: auto; transition: all 0.2s;";p?(g+="\n width: ".concat(d,";\n height: ").concat(m,";\n background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);\n border: 3px solid white;\n border-radius: 50%;\n box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 0 1px rgba(49, 130, 206, 0.3);\n "),"bottom-right"===l?g+="right: -8px; bottom: -8px;":"bottom-left"===l?g+="left: -8px; bottom: -8px;":"top-right"===l?g+="right: -8px; top: -8px;":"top-left"===l&&(g+="left: -8px; top: -8px;")):(g+="\n background: rgba(49, 130, 206, 0.6);\n border: 1px solid rgba(49, 130, 206, 0.8);\n ","right"===l?g+="width: ".concat(d,"; height: ").concat(m,"; right: -4px; top: 50%; transform: translateY(-50%);"):"bottom"===l?g+="width: ".concat(d,"; height: ").concat(m,"; bottom: -4px; left: 50%; transform: translateX(-50%);"):"left"===l?g+="width: ".concat(d,"; height: ").concat(m,"; left: -4px; top: 50%; transform: translateY(-50%);"):"top"===l&&(g+="width: ".concat(d,"; height: ").concat(m,"; top: -4px; left: 50%; transform: translateX(-50%);"))),g+="cursor: ".concat(c,";"),x.style.cssText=g,p?(x.addEventListener("mouseenter",()=>{x.style.transform="scale(1.3)",x.style.boxShadow="0 3px 12px rgba(0,0,0,0.5), 0 0 0 2px rgba(49, 130, 206, 0.5)"}),x.addEventListener("mouseleave",()=>{i||(x.style.transform="scale(1)",x.style.boxShadow="0 2px 8px rgba(0,0,0,0.4), 0 0 0 1px rgba(49, 130, 206, 0.3)")})):(x.addEventListener("mouseenter",()=>{x.style.background="rgba(49, 130, 206, 0.9)"}),x.addEventListener("mouseleave",()=>{i||(x.style.background="rgba(49, 130, 206, 0.6)")})),x.addEventListener("pointerdown",n=>{n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),i=!0,o=n.clientX,r=n.clientY,s=e.offsetWidth;const a=e.offsetHeight,c=s/a,d=n=>{if(!i)return;const a=n.clientX-o,d=n.clientY-r;let m=s;l.includes("right")?m=s+a:l.includes("left")?m=s-a:(l.includes("bottom")||l.includes("top"))&&(m=s+d*c),m=Math.max(50,Math.min(m,t.root.clientWidth-40)),e.style.width="".concat(m,"px"),e.style.maxWidth="100%",e.style.height="auto";try{e.setAttribute("width",String(Math.round(m)))}catch(p){}bt(m),ft(m.toString());try{const e=t.root.clientWidth||m||1;_t(Math.max(1,Math.min(100,Math.round(m/e*100))))}catch(x){}h(),u(m)},m=()=>{i=!1,document.removeEventListener("pointermove",d),document.removeEventListener("pointerup",m),he.current(St(t.root.innerHTML));const e=xe.current;setTimeout(()=>{if(e)try{var t;null===(t=ge.current)||void 0===t||t.call(ge,e)}catch(n){}},30)};document.addEventListener("pointermove",d),document.addEventListener("pointerup",m)}),n.appendChild(x)}),h(),u(e.offsetWidth||e.width||0),l.style.position=l.style.position||"relative",l.appendChild(n),n.appendChild(d),a=n})(e),st(e);const d=e.offsetWidth||e.width;bt(d),ft(d.toString());try{const e=t.root.clientWidth||d||1;_t(Math.max(1,Math.min(100,Math.round(d/e*100))))}catch(b){}const u=e.getAttribute("data-filters");if(u)try{const e=JSON.parse(u);ct(e)}catch(y){ct({brightness:100,contrast:100,saturation:100,blur:0,grayscale:0,sepia:0,hueRotate:0,rotation:0,flipH:!1,flipV:!1})}const h=e.getBoundingClientRect(),m=t.root.getBoundingClientRect(),p=t.root.scrollTop,x=t.root.scrollLeft;let g=h.left-m.left+x+(h.width>388?h.width-380-8:8);g=Math.max(8,Math.min(g,m.width-380-8));let v=h.top-m.top+p+8;v=Math.max(8,v),mt({top:v,left:g}),ut(!0)};ge.current=e=>{var t;const n=null===(t=de.current)||void 0===t?void 0:t.getEditor();if(!n)return;const a=n.root.querySelector('img[data-img-id="'.concat(e,'"]'));a&&d(a)};const u=()=>{n&&(n.style.outline="",n.style.cursor="",n.style.boxShadow="",n=null),c(),st(null),ut(!1),bt(0),ft("")},h=e=>{const t=e.target,n="IMG"===t.tagName?t:t.closest("img");if(!n)return t.classList.contains("custom-image-resize-handle")||t.classList.contains("custom-image-resize-container")||ue.current&&(ue.current===t||ue.current.contains(t))?(e.preventDefault(),void e.stopPropagation()):void u();if(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),oe){const e=n.src;return xt(e),void vt(!0)}d(n)},m=e=>{const a=e.target,i=null===a||void 0===a?void 0:a.tagName;"INPUT"===i||"TEXTAREA"===i||a&&a.isContentEditable||!n||"Delete"!==e.key&&"Backspace"!==e.key||(e.preventDefault(),n.remove(),u(),he.current(St(t.root.innerHTML)),ce({title:"Obr\xe1zek odstran\u011bn",status:"info",duration:1500}))},p=()=>{n&&a&&(l&&cancelAnimationFrame(l),l=requestAnimationFrame(()=>{const e=n.getBoundingClientRect(),i=t.root.parentElement,o=i?i.getBoundingClientRect():t.root.getBoundingClientRect(),r=t.root.scrollTop,s=t.root.scrollLeft;a.style.left="".concat(e.left-o.left+s,"px"),a.style.top="".concat(e.top-o.top+r,"px"),a.style.width="".concat(e.width,"px"),a.style.height="".concat(e.height,"px")}))};let x=null;const g=e=>{const t=e.target;if(t&&"IMG"===t.tagName){x=t;try{var n;null===(n=e.dataTransfer)||void 0===n||n.setData("text/plain",t.src||""),e.dataTransfer.effectAllowed="move"}catch(a){}}},v=e=>{x&&(e.preventDefault(),e.dataTransfer.dropEffect="move")},j=e=>{var t;if(!x)return;e.preventDefault(),e.stopPropagation();const n=null===(t=de.current)||void 0===t?void 0:t.getEditor();if(!n)return;try{const t=window.getSelection(),n=document,a=document,i=a.caretRangeFromPoint?a.caretRangeFromPoint.call(document,e.clientX,e.clientY):"function"===typeof n.caretPositionFromPoint?(()=>{const t=n.caretPositionFromPoint(e.clientX,e.clientY),a=document.createRange();return a.setStart(t.offsetNode,t.offset),a.setEnd(t.offsetNode,t.offset),a})():null;i&&t&&(t.removeAllRanges(),t.addRange(i))}catch(r){}const a=n.getSelection(!0)||{index:n.getLength(),length:0},i=x.src;try{x.remove()}catch(s){}n.insertEmbed(a.index,"image",i,"user"),n.setSelection(a.index+1,0,"user"),he.current(St(n.root.innerHTML));const o=xe.current;o&&setTimeout(()=>{try{var e;null===(e=ge.current)||void 0===e||e.call(ge,o)}catch(t){}},30),x=null},b=t.root;return b.addEventListener("click",h),b.addEventListener("scroll",p),b.addEventListener("dragstart",g),b.addEventListener("dragover",v),b.addEventListener("drop",j),document.addEventListener("keydown",m),window.addEventListener("resize",p),document.addEventListener("scroll",p,!0),()=>{t.root.removeEventListener("click",h);const e=t.root;e.removeEventListener("scroll",p),e.removeEventListener("dragstart",g),e.removeEventListener("dragover",v),e.removeEventListener("drop",j),document.removeEventListener("keydown",m),window.removeEventListener("resize",p),document.removeEventListener("scroll",p,!0),l&&cancelAnimationFrame(l),c(),u()}},[oe,ce,je]),(0,a.useEffect)(()=>{var e;const t=null===(e=de.current)||void 0===e?void 0:e.getEditor();if(!t||oe)return;const n=t.root,a=async e=>{try{if(!e||"1"===e.getAttribute("data-auto-resized"))return;const t=async()=>{if((e.naturalWidth||0)>1600){try{ce({title:"Optimalizace velk\xe9ho obr\xe1zku\u2026",status:"info",duration:1500})}catch(n){}try{const n=await te({image_url:e.src,width:1600,quality:85});if(null!==n&&void 0!==n&&n.url){var t;const a=(0,ee.uq)(n.url)||n.url;e.src=a,e.setAttribute("data-auto-resized","1"),e.style.maxWidth="100%",e.style.height="auto";const i=null===(t=de.current)||void 0===t?void 0:t.getEditor();if(i){he.current(St(i.root.innerHTML));const e=xe.current;e&&setTimeout(()=>{try{var t;null===(t=ge.current)||void 0===t||t.call(ge,e)}catch(n){}},30)}}}catch(a){console.error("Auto-resize failed",a)}}};e.complete?t():e.addEventListener("load",()=>t(),{once:!0})}catch(t){}};n.querySelectorAll("img").forEach(e=>a(e));const i=new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{var t;e instanceof HTMLImageElement?a(e):e instanceof HTMLElement&&(null===(t=e.querySelectorAll)||void 0===t||t.call(e,"img").forEach(e=>a(e)))})})});return i.observe(n,{childList:!0,subtree:!0}),()=>i.disconnect()},[oe,je,ce]);const Ft=(0,a.useCallback)((e,t)=>{const n="\n brightness(".concat(t.brightness,"%)\n contrast(").concat(t.contrast,"%)\n saturate(").concat(t.saturation,"%)\n blur(").concat(t.blur,"px)\n grayscale(").concat(t.grayscale,"%)\n sepia(").concat(t.sepia,"%)\n hue-rotate(").concat(t.hueRotate,"deg)\n ").trim(),a="\n rotate(".concat(t.rotation,"deg)\n scaleX(").concat(t.flipH?-1:1,")\n scaleY(").concat(t.flipV?-1:1,")\n ").trim();e.style.filter=n,e.style.transform=a,e.style.transformOrigin="center center",e.setAttribute("data-filters",JSON.stringify(t))},[]),Pt=(0,a.useCallback)(()=>{const e={brightness:100,contrast:100,saturation:100,blur:0,grayscale:0,sepia:0,hueRotate:0,rotation:0,flipH:!1,flipV:!1};if(ct(e),rt){var t;Ft(rt,e);const n=null===(t=de.current)||void 0===t?void 0:t.getEditor();n&&he.current(St(n.root.innerHTML))}},[rt,Ft]),It=(0,a.useCallback)((e,t)=>{ct(n=>{const a=(0,i.A)((0,i.A)({},n),{},{[e]:t});if(rt){var o;Ft(rt,a);const e=null===(o=de.current)||void 0===o?void 0:o.getEditor();if(e){he.current(St(e.root.innerHTML));try{e.root.dispatchEvent(new Event("scroll"))}catch(r){}}const t=xe.current;t&&setTimeout(()=>{try{var e;null===(e=ge.current)||void 0===e||e.call(ge,t)}catch(n){}},30)}return a})},[rt,Ft]),[Mt,Lt]=(0,a.useState)(!1),Wt=(0,a.useCallback)(async()=>{if(rt)try{var e;Lt(!0),ce({title:"Zpracov\xe1n\xed filtry...",status:"info",duration:2e3});const t=rt.src,n=lt.brightness-100,a=lt.contrast-100,i=lt.saturation-100,o=await te({image_url:t,width:rt.offsetWidth||void 0,rotation:lt.rotation,flip_h:lt.flipH,flip_v:lt.flipV,brightness:n,contrast:a,saturation:i,grayscale:lt.grayscale>0,quality:85}),r=(0,ee.uq)(o.url)||o.url;rt.src=r,ct({brightness:100,contrast:100,saturation:100,blur:0,grayscale:0,sepia:0,hueRotate:0,rotation:0,flipH:!1,flipV:!1}),rt.style.filter="",rt.style.transform="",rt.removeAttribute("data-filters");const s=null===(e=de.current)||void 0===e?void 0:e.getEditor();s&&he.current(St(s.root.innerHTML)),qt(),ce({title:"Filtry aplikov\xe1ny",status:"success",duration:2e3})}catch(a){var t,n;console.error("Apply filters error:",a),ce({title:"Aplikace filtr\u016f selhala",description:(null===a||void 0===a||null===(t=a.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===a||void 0===a?void 0:a.message),status:"error"})}finally{Lt(!1)}},[rt,lt,ce]),Ut=(0,a.useCallback)(()=>{var e;if(!rt)return;const t=null===(e=de.current)||void 0===e?void 0:e.getEditor();if(t){try{rt.remove()}catch(n){}try{const e=t.root.parentElement,n=null===e||void 0===e?void 0:e.querySelector(".custom-image-resize-container");n&&n.parentNode&&n.parentNode.removeChild(n)}catch(a){}xe.current=null,st(null),ut(!1),bt(0),ft(""),_t(0),he.current(St(t.root.innerHTML)),ce({title:"Obr\xe1zek odstran\u011bn",status:"info",duration:1500})}},[rt,ce,St]),Ot=(0,a.useCallback)(e=>{if(rt){var t;rt.style.display="block",rt.style.float="none","left"===e?(rt.style.marginLeft="0",rt.style.marginRight="auto"):"center"===e?(rt.style.marginLeft="auto",rt.style.marginRight="auto"):"right"===e&&(rt.style.marginLeft="auto",rt.style.marginRight="0");const a=null===(t=de.current)||void 0===t?void 0:t.getEditor();if(a){he.current(St(a.root.innerHTML));try{a.root.dispatchEvent(new Event("scroll"))}catch(n){}}qt(),ce({title:"Obr\xe1zek zarovn\xe1n ".concat("left"===e?"vlevo":"center"===e?"na st\u0159ed":"vpravo"),status:"success",duration:1500})}},[rt,ce]),qt=(0,a.useCallback)(()=>{const e=xe.current;e&&setTimeout(()=>{try{var t;null===(t=ge.current)||void 0===t||t.call(ge,e)}catch(n){}},30)},[]),Kt=(0,a.useCallback)((e,t)=>{var n;if(!rt)return;const a=null===(n=de.current)||void 0===n?void 0:n.getEditor(),i=a?a.root.clientWidth-40:1200,o=Math.min(Math.max(50,Math.round(e)),i);if(rt.style.width="".concat(o,"px"),rt.style.height="auto",rt.style.maxWidth="100%",rt.setAttribute("width",String(o)),bt(o),ft(o.toString()),a){he.current(St(a.root.innerHTML));try{a.root.dispatchEvent(new Event("scroll"))}catch(r){}}qt(),null!==t&&void 0!==t&&t.silent||ce({title:"\u0160\xed\u0159ka nastavena",description:"".concat(o,"px"),status:"success",duration:1500})},[rt,ce]),Bt=(0,a.useCallback)(()=>{var e;if(!rt)return;const t=null===(e=de.current)||void 0===e?void 0:e.getEditor();rt.style.width="",rt.style.height="",rt.style.maxWidth="100%",rt.removeAttribute("width");const n=rt.offsetWidth||rt.width||0;bt(n),ft(""),t&&he.current(St(t.root.innerHTML)),qt(),ce({title:"\u0160\xed\u0159ka resetov\xe1na",status:"info",duration:1200})},[rt,ce]),Zt=(0,a.useCallback)((e,t)=>{var n;const a=Math.max(5,Math.min(100,Math.round(e)));_t(a);const i=null===(n=de.current)||void 0===n?void 0:n.getEditor();if(i&&rt){const e=i.root.clientWidth*a/100;Kt(e,t)}},[Kt,rt]),Vt=(0,a.useCallback)(()=>{if(rt&&yt){const t=yt.trim();if(t.endsWith("%")){var e;const n=parseFloat(t.slice(0,-1)),a=null===(e=de.current)||void 0===e?void 0:e.getEditor();if(a&&!isNaN(n)&&n>0){const e=a.root.clientWidth*n/100;return void Kt(e)}}const n=parseInt(t,10);!isNaN(n)&&n>0?Kt(n):ce({title:"Neplatn\xe1 \u0161\xed\u0159ka",description:"Zadejte kladn\xe9 \u010d\xedslo nebo procenta (nap\u0159. 50%)",status:"warning",duration:1500})}},[rt,yt,ce,Kt]),Ht=((0,a.useCallback)(e=>{var t;const n=null===(t=de.current)||void 0===t?void 0:t.getEditor();if(!n)return;const a=n.getSelection();if(!a)return;const[i]=n.getLine(a.index),o=null===i||void 0===i?void 0:i.domNode;if(!o)return;let r=o;for(;r&&"UL"!==r.tagName&&r!==n.root;)r=r.parentElement;if(r&&"UL"===r.tagName){r.setAttribute("data-bullets",e);try{r.style.listStyleType="none"===e?"none":e}catch(s){}he.current(St(n.root.innerHTML))}},[he,St]),(0,a.useCallback)(()=>{var e;const t=null===(e=de.current)||void 0===e?void 0:e.getEditor();if(!t)return;const n=Oe.current||t.getSelection();if(!n)return;const a=(null===Me||void 0===Me?void 0:Me.trim())||(null===We||void 0===We?void 0:We.trim()),i=null===We||void 0===We?void 0:We.trim();i?(t.focus(),n.length>0?(t.deleteText(n.index,n.length,"user"),t.insertText(n.index,a||i,"link",i,"user"),t.setSelection(n.index+(a||i).length,0,"user")):(t.insertText(n.index,a||i,"link",i,"user"),t.setSelection(n.index+(a||i).length,0,"user")),he.current(St(t.root.innerHTML)),Ie(!1),Le(""),Ue("")):ce({title:"Zadejte URL",status:"warning",duration:1500})},[Me,We,ce,St]));return(0,a.useEffect)(()=>{var e,t;if(!je)return;const n=null===(e=de.current)||void 0===e?void 0:e.getEditor();if(!n)return;const a=null===(t=n.root)||void 0===t?void 0:t.parentElement,i=null===a||void 0===a?void 0:a.previousElementSibling;if(!i)return;const o=(e,t,n)=>{const a=i.querySelector(e);if(a&&!i.querySelector("button.".concat(t))){var o;const e=document.createElement("button");e.type="button",e.className=t,e.setAttribute("title","color"===n?"Reset barvy textu":"Reset barvy pozad\xed"),e.addEventListener("click",e=>{var t;e.preventDefault(),e.stopPropagation();const a=null===(t=de.current)||void 0===t?void 0:t.getEditor();a&&(a.format(n,!1,"user"),he.current(St(a.root.innerHTML)))}),null===(o=a.parentElement)||void 0===o||o.insertBefore(e,a.nextSibling)}};o(".ql-color .ql-picker-label","ql-color-reset","color"),o(".ql-background .ql-picker-label","ql-background-reset","background")},[je,St]),(0,ne.jsxs)(r.a,{children:[!oe&&(0,ne.jsx)(s.T,{align:"stretch",spacing:1,mb:2,children:(0,ne.jsxs)(l.z,{spacing:2,justify:"flex-start",flexWrap:"wrap",children:[re&&(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(c.$,{size:"sm",leftIcon:(0,ne.jsx)(R.A,{size:16}),colorScheme:"purple",onClick:Ct,children:"Vlo\u017eit obr\xe1zek"}),(0,ne.jsx)(d.E,{fontSize:"xs",color:"gray.500",children:"nebo pou\u017eijte tla\u010d\xedtko obr\xe1zku v n\xe1strojov\xe9 li\u0161t\u011b"})]}),(0,ne.jsx)(c.$,{size:"sm",leftIcon:(0,ne.jsx)(F.A,{size:16}),colorScheme:"blue",variant:"outline",onClick:()=>Tt("document"),children:"Otev\u0159\xedt v HTML"})]})}),(0,ne.jsx)(r.a,{position:"relative",borderWidth:"1px",borderColor:ot,borderRadius:"md",overflow:"visible",bg:"white",sx:{".ql-toolbar":{borderBottom:"1px solid",borderColor:ot,bg:"gray.50",display:"flex",flexWrap:"wrap",gap:"4px",padding:"12px","& button":{color:"gray.700 !important",width:"32px !important",height:"32px !important",borderRadius:"6px",transition:"all 0.2s","&:hover":{background:"rgba(49, 130, 206, 0.1) !important",transform:"scale(1.05)"},"&.ql-active":{background:"rgba(49, 130, 206, 0.2) !important",color:"#3182ce !important"}},"& .ql-stroke":{stroke:"gray.700 !important"},"& .ql-fill":{fill:"gray.700 !important"},"& .ql-active .ql-stroke":{stroke:"#3182ce !important"},"& .ql-active .ql-fill":{fill:"#3182ce !important"},"& .ql-picker":{color:"gray.700 !important"},"& .ql-picker-label":{borderRadius:"6px",padding:"4px 8px",transition:"all 0.2s","&:hover":{background:"rgba(49, 130, 206, 0.1) !important"}},"& .ql-picker-options":{background:"white",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"8px"}},".ql-container":{fontSize:"16px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',bg:"white"},".ql-editor":{minHeight:ie,maxHeight:"70vh",overflowY:"auto",bg:"white !important",color:"#1a202c",padding:"16px",lineHeight:"1.6","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-track":{bg:"gray.100"},"&::-webkit-scrollbar-thumb":{bg:"gray.400",borderRadius:"4px"},"h1, h2, h3, h4, h5, h6":{},h1:{fontSize:"2em !important",fontWeight:"bold !important",marginTop:"0.67em !important",marginBottom:"0.67em !important",lineHeight:"1.2 !important"},h2:{fontSize:"1.5em !important",fontWeight:"bold !important",marginTop:"0.83em !important",marginBottom:"0.83em !important",lineHeight:"1.3 !important"},h3:{fontSize:"1.17em !important",fontWeight:"bold !important",marginTop:"1em !important",marginBottom:"1em !important",lineHeight:"1.4 !important"},"p, li, span, div":{},"strong, b":{fontWeight:"bold"},a:{textDecoration:"underline"},blockquote:{borderLeft:"4px solid #3182ce",paddingLeft:"16px",margin:"1em 0",color:"#4a5568 !important",fontStyle:"italic",backgroundColor:"#f7fafc",padding:"12px 16px",borderRadius:"4px"},code:{backgroundColor:"#f7fafc",padding:"2px 6px",borderRadius:"3px",color:"#e53e3e !important",fontFamily:"monospace"},pre:{backgroundColor:"#2d3748",color:"#f7fafc !important",padding:"16px",borderRadius:"6px",overflow:"auto"},"ul, ol":{paddingLeft:"1.5em",margin:"0.5em 0"},img:{cursor:"pointer",maxWidth:"100%",height:"auto",display:"block",margin:"12px 0",transition:"all 0.2s ease",borderRadius:"4px",userSelect:"none",pointerEvents:"auto","&:hover":{opacity:.95,transform:"scale(1.01)"}}},".ql-editor.ql-blank::before":{color:"#a0aec0 !important",fontStyle:"italic"}},children:je&&(0,ne.jsx)(T(),{theme:"snow",value:t,onChange:At,readOnly:oe,placeholder:ae,ref:de,modules:Nt,formats:Rt})}),!oe&&(0,ne.jsxs)(d.E,{fontSize:"xs",color:"gray.500",mt:2,children:["\ud83d\udca1 ",(0,ne.jsx)("strong",{children:"Tip:"})," Klikn\u011bte na obr\xe1zek pro v\xfdb\u011br. Pot\xe9 m\u016f\u017eete: \u2022 P\u0159et\xe1hnout pro zarovn\xe1n\xed \u2022 Zm\u011bnit velikost ta\u017een\xedm modr\xe9ho bodu \u2022 Upravit filtry a transformace \u2022 Stisknout Delete pro smaz\xe1n\xed"]}),dt&&rt&&!oe&&(0,ne.jsx)(r.a,{ref:ue,position:"absolute",top:"".concat(ht.top,"px"),left:"".concat(ht.left,"px"),bg:"white",borderWidth:"2px",borderColor:"blue.400",borderRadius:"lg",boxShadow:"2xl",p:3,zIndex:9999,minW:"320px",maxW:"380px",maxH:"80vh",overflowY:"auto",pointerEvents:"auto",onClick:e=>{e.stopPropagation()},onMouseDown:e=>{e.stopPropagation()},css:{"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"#f1f1f1"},"&::-webkit-scrollbar-thumb":{background:"#888",borderRadius:"3px"},"&::-webkit-scrollbar-thumb:hover":{background:"#555"}},children:(0,ne.jsxs)(s.T,{align:"stretch",spacing:3,children:[(0,ne.jsxs)(l.z,{justify:"space-between",onMouseDown:e=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation(),ve.current.active=!0,ve.current.startX=e.clientX,ve.current.startY=e.clientY,ve.current.startLeft=ht.left,ve.current.startTop=ht.top;const t=e=>{if(!ve.current.active)return;const t=e.clientX-ve.current.startX,n=e.clientY-ve.current.startY;mt(e=>({top:Math.max(0,ve.current.startTop+n),left:Math.max(0,ve.current.startLeft+t)}))},n=()=>{ve.current.active=!1,document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",t),document.addEventListener("mouseup",n)},cursor:"move",children:[(0,ne.jsxs)(l.z,{spacing:2,children:[(0,ne.jsx)(P.A,{size:16}),(0,ne.jsx)(d.E,{fontWeight:"bold",fontSize:"sm",children:"\xdaprava obr\xe1zku"})]}),(0,ne.jsx)(u.K,{"aria-label":"Close",icon:(0,ne.jsx)(I.A,{size:16}),size:"xs",onClick:()=>ut(!1),variant:"ghost"})]}),(0,ne.jsxs)(s.T,{align:"stretch",spacing:2,children:[(0,ne.jsx)(d.E,{fontSize:"xs",fontWeight:"semibold",color:"gray.600",children:"Zarovn\xe1n\xed"}),(0,ne.jsxs)(l.z,{spacing:2,justify:"stretch",children:[(0,ne.jsx)(h.m,{label:"Zarovnat vlevo",children:(0,ne.jsx)(u.K,{"aria-label":"Align left",icon:(0,ne.jsx)(M.A,{size:16}),size:"sm",onClick:()=>Ot("left"),colorScheme:"teal",variant:"outline",flex:1})}),(0,ne.jsx)(h.m,{label:"Zarovnat na st\u0159ed",children:(0,ne.jsx)(u.K,{"aria-label":"Align center",icon:(0,ne.jsx)(L.A,{size:16}),size:"sm",onClick:()=>Ot("center"),colorScheme:"teal",variant:"outline",flex:1})}),(0,ne.jsx)(h.m,{label:"Zarovnat vpravo",children:(0,ne.jsx)(u.K,{"aria-label":"Align right",icon:(0,ne.jsx)(W.A,{size:16}),size:"sm",onClick:()=>Ot("right"),colorScheme:"teal",variant:"outline",flex:1})})]})]}),(0,ne.jsxs)(s.T,{align:"stretch",spacing:2,children:[(0,ne.jsx)(d.E,{fontSize:"xs",fontWeight:"semibold",color:"gray.600",children:"\u0160\xed\u0159ka obr\xe1zku"}),(0,ne.jsxs)(l.z,{spacing:2,children:[(0,ne.jsx)(m.p,{size:"sm",type:"number",value:yt,onChange:e=>ft(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.stopPropagation(),Vt())},placeholder:"\u0160\xed\u0159ka v px",min:50}),(0,ne.jsx)(c.$,{size:"sm",colorScheme:"blue",onClick:Vt,minW:"80px",children:"Nastavit"})]}),(0,ne.jsxs)(d.E,{fontSize:"xs",color:"gray.500",children:["Aktu\xe1ln\xed: ",jt,"px (",kt||0,"%)"]}),(0,ne.jsxs)(l.z,{spacing:2,children:[(0,ne.jsx)(c.$,{size:"xs",variant:"outline",onClick:()=>Zt(25,{silent:!0}),children:"25%"}),(0,ne.jsx)(c.$,{size:"xs",variant:"outline",onClick:()=>Zt(50,{silent:!0}),children:"50%"}),(0,ne.jsx)(c.$,{size:"xs",variant:"outline",onClick:()=>Zt(75,{silent:!0}),children:"75%"}),(0,ne.jsx)(c.$,{size:"xs",variant:"outline",onClick:()=>Zt(100,{silent:!0}),children:"100%"}),(0,ne.jsx)(c.$,{size:"xs",colorScheme:"gray",variant:"ghost",onClick:Bt,children:"Reset"})]}),(0,ne.jsxs)(p.MJ,{children:[(0,ne.jsxs)(l.z,{justify:"space-between",children:[(0,ne.jsx)(x.l,{fontSize:"xs",mb:0,children:"\u0160\xed\u0159ka (%)"}),(0,ne.jsxs)(d.E,{fontSize:"xs",color:"gray.500",children:[kt||0,"%"]})]}),(0,ne.jsx)("input",{type:"range",min:"5",max:"100",value:kt||0,onChange:e=>Zt(Number(e.target.value),{silent:!0}),style:{width:"100%"}})]})]}),(0,ne.jsxs)(s.T,{align:"stretch",spacing:2,children:[(0,ne.jsx)(d.E,{fontSize:"xs",fontWeight:"semibold",color:"gray.600",children:"Transformace"}),(0,ne.jsxs)(l.z,{spacing:2,flexWrap:"wrap",children:[(0,ne.jsx)(h.m,{label:"Oto\u010dit doleva",children:(0,ne.jsx)(u.K,{"aria-label":"Rotate left",icon:(0,ne.jsx)(U.A,{size:16}),size:"sm",onClick:()=>It("rotation",(lt.rotation-90)%360),colorScheme:"blue",variant:"outline"})}),(0,ne.jsx)(h.m,{label:"Oto\u010dit doprava",children:(0,ne.jsx)(u.K,{"aria-label":"Rotate right",icon:(0,ne.jsx)(O.A,{size:16}),size:"sm",onClick:()=>It("rotation",(lt.rotation+90)%360),colorScheme:"blue",variant:"outline"})}),(0,ne.jsx)(h.m,{label:"P\u0159evr\xe1tit horizont\xe1ln\u011b",children:(0,ne.jsx)(u.K,{"aria-label":"Flip horizontal",icon:(0,ne.jsx)(q.A,{size:16}),size:"sm",onClick:()=>It("flipH",!lt.flipH),colorScheme:"blue",variant:lt.flipH?"solid":"outline"})}),(0,ne.jsx)(h.m,{label:"P\u0159evr\xe1tit vertik\xe1ln\u011b",children:(0,ne.jsx)(u.K,{"aria-label":"Flip vertical",icon:(0,ne.jsx)(K.A,{size:16}),size:"sm",onClick:()=>It("flipV",!lt.flipV),colorScheme:"blue",variant:lt.flipV?"solid":"outline"})}),(0,ne.jsx)(h.m,{label:"Smazat obr\xe1zek",children:(0,ne.jsx)(u.K,{"aria-label":"Delete image",icon:(0,ne.jsx)(B.A,{size:16}),size:"sm",onClick:Ut,colorScheme:"red",variant:"outline"})}),(0,ne.jsx)(h.m,{label:"Resetovat filtry",children:(0,ne.jsx)(u.K,{"aria-label":"Reset filters",icon:(0,ne.jsx)(U.A,{size:16}),size:"sm",onClick:Pt,colorScheme:"gray",variant:"outline"})})]})]}),(0,ne.jsxs)(s.T,{align:"stretch",spacing:2,children:[(0,ne.jsxs)(p.MJ,{children:[(0,ne.jsxs)(l.z,{justify:"space-between",children:[(0,ne.jsxs)(l.z,{spacing:1,children:[(0,ne.jsx)(Z.A,{size:14}),(0,ne.jsx)(x.l,{fontSize:"xs",mb:0,children:"Jas"})]}),(0,ne.jsxs)(d.E,{fontSize:"xs",color:"gray.500",children:[lt.brightness,"%"]})]}),(0,ne.jsx)("input",{type:"range",min:"0",max:"200",value:lt.brightness,onChange:e=>It("brightness",Number(e.target.value)),style:{width:"100%"}})]}),(0,ne.jsxs)(p.MJ,{children:[(0,ne.jsxs)(l.z,{justify:"space-between",children:[(0,ne.jsxs)(l.z,{spacing:1,children:[(0,ne.jsx)(V.A,{size:14}),(0,ne.jsx)(x.l,{fontSize:"xs",mb:0,children:"Kontrast"})]}),(0,ne.jsxs)(d.E,{fontSize:"xs",color:"gray.500",children:[lt.contrast,"%"]})]}),(0,ne.jsx)("input",{type:"range",min:"0",max:"200",value:lt.contrast,onChange:e=>It("contrast",Number(e.target.value)),style:{width:"100%"}})]}),(0,ne.jsxs)(p.MJ,{children:[(0,ne.jsxs)(l.z,{justify:"space-between",children:[(0,ne.jsxs)(l.z,{spacing:1,children:[(0,ne.jsx)(H.A,{size:14}),(0,ne.jsx)(x.l,{fontSize:"xs",mb:0,children:"Sytost"})]}),(0,ne.jsxs)(d.E,{fontSize:"xs",color:"gray.500",children:[lt.saturation,"%"]})]}),(0,ne.jsx)("input",{type:"range",min:"0",max:"200",value:lt.saturation,onChange:e=>It("saturation",Number(e.target.value)),style:{width:"100%"}})]}),(0,ne.jsxs)(p.MJ,{children:[(0,ne.jsxs)(l.z,{justify:"space-between",children:[(0,ne.jsxs)(l.z,{spacing:1,children:[(0,ne.jsx)($.A,{size:14}),(0,ne.jsx)(x.l,{fontSize:"xs",mb:0,children:"Rozost\u0159en\xed"})]}),(0,ne.jsxs)(d.E,{fontSize:"xs",color:"gray.500",children:[lt.blur,"px"]})]}),(0,ne.jsx)("input",{type:"range",min:"0",max:"10",step:"0.5",value:lt.blur,onChange:e=>It("blur",Number(e.target.value)),style:{width:"100%"}})]})]}),(0,ne.jsxs)(l.z,{spacing:2,flexWrap:"wrap",children:[(0,ne.jsx)(c.$,{size:"xs",onClick:()=>{It("grayscale",100===lt.grayscale?0:100)},colorScheme:100===lt.grayscale?"purple":"gray",variant:100===lt.grayscale?"solid":"outline",leftIcon:(0,ne.jsx)(J.A,{size:12}),children:"\u010cernob\xedl\xe1"}),(0,ne.jsx)(c.$,{size:"xs",onClick:()=>{It("sepia",100===lt.sepia?0:100)},colorScheme:100===lt.sepia?"orange":"gray",variant:100===lt.sepia?"solid":"outline",leftIcon:(0,ne.jsx)(G.A,{size:12}),children:"Sepia"})]}),(0,ne.jsx)(c.$,{colorScheme:"green",size:"md",width:"full",onClick:Wt,isLoading:Mt,loadingText:"Zpracov\xe1n\xed...",leftIcon:(0,ne.jsx)(X.A,{size:16}),children:"Aplikovat v\u0161echny zm\u011bny"}),(0,ne.jsx)(d.E,{fontSize:"xs",color:"gray.500",textAlign:"center",children:"\ud83d\udca1 Filtry jsou pouze n\xe1hled. Klikn\u011bte pro trvalou aplikaci."})]})}),(0,ne.jsxs)(g.aF,{isOpen:Pe,onClose:()=>Ie(!1),isCentered:!0,children:[(0,ne.jsx)(v.m,{}),(0,ne.jsxs)(j.$,{maxW:"lg",children:[(0,ne.jsx)(b.r,{children:"Vlo\u017eit odkaz"}),(0,ne.jsx)(y.s,{}),(0,ne.jsx)(f.c,{children:(0,ne.jsxs)(s.T,{align:"stretch",spacing:3,children:[(0,ne.jsxs)(p.MJ,{children:[(0,ne.jsx)(x.l,{children:"Text odkazu"}),(0,ne.jsx)(m.p,{value:Me,onChange:e=>Le(e.target.value),placeholder:"Zobrazovan\xfd text (nepovinn\xe9)"})]}),(0,ne.jsxs)(p.MJ,{isRequired:!0,children:[(0,ne.jsx)(x.l,{children:"URL"}),(0,ne.jsx)(m.p,{value:We,onChange:e=>Ue(e.target.value),placeholder:"https://... nebo /cesta",onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),Ht())}}),(0,ne.jsx)(p.eK,{children:"Zadejte pln\xfd nebo relativn\xed odkaz"})]})]})}),(0,ne.jsxs)(k.j,{children:[(0,ne.jsx)(c.$,{variant:"ghost",mr:3,onClick:()=>Ie(!1),children:"Zru\u0161it"}),(0,ne.jsx)(c.$,{colorScheme:"blue",onClick:Ht,children:"Vlo\u017eit"})]})]})]}),(0,ne.jsxs)(_._s,{isOpen:qe,placement:"right",size:"lg",onClose:()=>Ke(!1),children:[(0,ne.jsx)(v.m,{}),(0,ne.jsxs)(w.z,{children:[(0,ne.jsx)(y.s,{}),(0,ne.jsx)(b.r,{children:"document"===Ge?"Upravit HTML (cel\xfd obsah)":"Vlo\u017eit vlastn\xed HTML"}),(0,ne.jsx)(f.c,{children:(0,ne.jsx)(s.T,{align:"stretch",spacing:4,children:(0,ne.jsxs)(p.MJ,{children:[(0,ne.jsx)(x.l,{children:"HTML k\xf3d"}),$e?(0,ne.jsx)($e,{height:"60vh",defaultLanguage:"html",language:"html",theme:"vs-light",value:Be,onChange:e=>Ze(e||""),options:{automaticLayout:!0,wordWrap:"on",minimap:{enabled:!1},tabSize:2,insertSpaces:!0,formatOnPaste:!0,formatOnType:!0,suggestOnTriggerCharacters:!0}}):(0,ne.jsx)(z.T,{value:Be,onChange:e=>Ze(e.target.value),minH:"200px",fontFamily:"monospace",fontSize:"sm"}),(0,ne.jsx)(p.eK,{children:"document"===Ge?"Upravujete cel\xfd obsah. Po potvrzen\xed se sou\u010dasn\xfd obsah editoru nahrad\xed va\u0161\xedm HTML.":"Vlo\u017ete libovoln\xfd HTML k\xf3d (nap\u0159. <h1>Nadpis</h1>, <p>odstavec</p>, <ul>...</ul>). Po vlo\u017een\xed se p\u0159evede na pln\u011b funk\u010dn\xed form\xe1tov\xe1n\xed v editoru."})]})})}),(0,ne.jsxs)(k.j,{children:[(0,ne.jsx)(c.$,{variant:"ghost",mr:3,onClick:()=>Ke(!1),children:"Zru\u0161it"}),(0,ne.jsx)(c.$,{colorScheme:"blue",onClick:Dt,children:"document"===Ge?"Pou\u017e\xedt HTML":"Vlo\u017eit do textu"})]})]})]}),(0,ne.jsxs)(S.Lt,{isOpen:Ye,leastDestructiveRef:et,onClose:()=>Qe(!1),isCentered:!0,children:[(0,ne.jsx)(v.m,{}),(0,ne.jsxs)(S.EO,{children:[(0,ne.jsx)(b.r,{children:"Nahradit cel\xfd obsah HTML?"}),(0,ne.jsx)(y.s,{}),(0,ne.jsxs)(f.c,{children:["Tato akce nahrad\xed aktu\xe1ln\xed obsah editoru va\u0161\xedm HTML. Chcete pokra\u010dovat?",(0,ne.jsx)(r.a,{mt:3,children:(0,ne.jsx)(A.S,{isChecked:tt,onChange:e=>nt(e.target.checked),children:"Neptat se p\u0159\xed\u0161t\u011b"})})]}),(0,ne.jsxs)(k.j,{children:[(0,ne.jsx)(c.$,{ref:et,onClick:()=>Qe(!1),mr:3,children:"Zru\u0161it"}),(0,ne.jsx)(c.$,{colorScheme:"blue",onClick:()=>{var e;try{tt&&window.localStorage.setItem("rte_skip_full_html_confirm","1")}catch(o){}const t=null===(e=de.current)||void 0===e?void 0:e.getEditor();if(!t)return void Qe(!1);const n=at.current,a=it.current,i=t.getLength();t.focus();try{t.deleteText(0,i,"api")}catch(r){}try{t.clipboard.dangerouslyPasteHTML(0,n,"user")}catch(s){const e=N.A.sanitize(a,{USE_PROFILES:{html:!0}});t.insertText(0,e,"user")}he.current(St(t.root.innerHTML)),Ke(!1),Ze(""),Qe(!1),ce({title:"Obsah aktualizov\xe1n",status:"success",duration:2e3})},children:"Pou\u017e\xedt HTML"})]})]})]}),(0,ne.jsxs)(g.aF,{isOpen:gt,onClose:()=>vt(!1),size:"6xl",isCentered:!0,children:[(0,ne.jsx)(v.m,{bg:"blackAlpha.800",backdropFilter:"blur(4px)"}),(0,ne.jsxs)(j.$,{maxW:"90vw",maxH:"90vh",bg:"transparent",boxShadow:"none",children:[(0,ne.jsx)(y.s,{color:"white",bg:"blackAlpha.600",_hover:{bg:"blackAlpha.700"}}),(0,ne.jsx)(f.c,{display:"flex",alignItems:"center",justifyContent:"center",p:0,children:pt&&(0,ne.jsx)(Y._,{src:pt,alt:"Preview",maxW:"100%",maxH:"90vh",objectFit:"contain",borderRadius:"md",boxShadow:"2xl"})})]})]}),(0,ne.jsxs)(g.aF,{isOpen:ye,onClose:()=>{fe(!1),_e(null)},size:"6xl",children:[(0,ne.jsx)(v.m,{bg:"blackAlpha.700",backdropFilter:"blur(4px)"}),(0,ne.jsxs)(j.$,{maxW:"90vw",maxH:"90vh",children:[(0,ne.jsx)(b.r,{children:"O\u0159\xedznout a upravit obr\xe1zek"}),(0,ne.jsx)(y.s,{}),(0,ne.jsx)(f.c,{maxH:"calc(90vh - 140px)",overflowY:"auto",overflowX:"hidden",children:(0,ne.jsxs)(s.T,{align:"stretch",spacing:4,children:[ke&&(0,ne.jsx)(r.a,{display:"flex",justifyContent:"center",alignItems:"center",p:4,bg:"gray.50",borderRadius:"md",children:(0,ne.jsx)(D.Ay,{crop:Se,onChange:e=>Ae(e),minWidth:50,minHeight:50,keepSelection:!0,children:(0,ne.jsx)("img",{ref:Fe,src:ke||"",alt:"Crop preview",style:{maxWidth:"100%",maxHeight:"60vh",display:"block",margin:"auto"}})})}),(0,ne.jsxs)(C.r,{columns:{base:1,md:2},spacing:4,children:[(0,ne.jsxs)(p.MJ,{children:[(0,ne.jsx)(x.l,{fontSize:"sm",children:"Max. \u0161\xed\u0159ka (px)"}),(0,ne.jsxs)(l.z,{children:[(0,ne.jsx)(m.p,{type:"number",value:Te,onChange:e=>De(Math.max(100,Math.min(3e3,Number(e.target.value)))),min:100,max:3e3,step:100,size:"sm"}),(0,ne.jsx)(d.E,{fontSize:"sm",color:"gray.600",whiteSpace:"nowrap",children:"px"})]}),(0,ne.jsx)(p.eK,{fontSize:"xs",children:"V\u011bt\u0161\xed obr\xe1zky budou zmen\u0161eny (optimalizace v\xfdkonu)"})]}),(0,ne.jsxs)(p.MJ,{children:[(0,ne.jsx)(x.l,{fontSize:"sm",children:"Kvalita JPEG"}),(0,ne.jsxs)(l.z,{children:[(0,ne.jsx)(m.p,{type:"number",value:Ce,onChange:e=>Ee(Math.max(1,Math.min(100,Number(e.target.value)))),min:1,max:100,step:5,size:"sm"}),(0,ne.jsx)(d.E,{fontSize:"sm",color:"gray.600",whiteSpace:"nowrap",children:"%"})]}),(0,ne.jsx)(p.eK,{fontSize:"xs",children:"85% je doporu\u010den\xe1 hodnota (men\u0161\xed velikost souboru)"})]})]}),(0,ne.jsx)(d.E,{fontSize:"sm",color:"gray.600",children:"\ud83d\udca1 P\u0159et\xe1hn\u011bte rohy a hrany modr\xe9 oblasti pro v\xfdb\u011br \u010d\xe1sti obr\xe1zku k o\u0159\xedznut\xed."})]})}),(0,ne.jsxs)(k.j,{children:[(0,ne.jsx)(c.$,{variant:"ghost",mr:3,onClick:()=>{fe(!1),_e(null),ze(null)},isDisabled:Ne,children:"Zru\u0161it"}),(0,ne.jsx)(c.$,{colorScheme:"blue",onClick:async()=>{try{var e;if(Re(!0),!we)return void ce({title:"Chyba",description:"Soubor nen\xed na\u010dten",status:"error"});if(!Fe.current)return void ce({title:"Chyba",description:"Obr\xe1zek nen\xed na\u010dten",status:"error"});const t=Fe.current,n=t.width,a=t.height,i=t.naturalWidth||n,o=t.naturalHeight||a,r=i/Math.max(1,n),s=o/Math.max(1,a),l=(e,t)=>"%"===Se.unit?e/100*t:e;let c;if(Se.width&&Se.height&&Se.width>0&&Se.height>0){const e=Math.max(0,l(Se.x||0,n)),t=Math.max(0,l(Se.y||0,a)),d=Math.min(n,l(Se.width||n,n)),u=Math.min(a,l(Se.height||a,a));let h=Math.round(e*r),m=Math.round(t*s),p=Math.round(d*r),x=Math.round(u*s);h+p>i&&(p=i-h),m+x>o&&(x=o-m),p=Math.max(1,p),x=Math.max(1,x),c={x:h,y:m,width:p,height:x}}ce({title:"Zpracov\xe1n\xed obr\xe1zku...",status:"info",duration:2e3});const d=await async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:85,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1500;const i=new FormData;i.append("image",e),t&&i.append("crop_data",JSON.stringify(t)),i.append("quality",n.toString()),i.append("max_width",a.toString());const o=(await Q.Ay.post("/image-processing/crop-upload",i,{headers:{"Content-Type":"multipart/form-data"}})).data||{};return o&&"string"===typeof o.url&&(o.url=(0,ee.uq)(o.url)||o.url),o}(we,c,Ce,Te);if(!d.url)throw new Error("Upload failed - no URL returned");const u=null===(e=de.current)||void 0===e?void 0:e.getEditor();u&&(u.focus(),setTimeout(()=>{try{const e=u.getSelection(),t=e?e.index:u.getLength(),n=(0,ee.uq)(d.url)||d.url,a=new Image;a.onload=()=>{try{u.insertEmbed(t,"image",n,"api");try{var e;const i=u,o=null!==i&&void 0!==i&&i.getLeaf?i.getLeaf(t):null,r=Array.isArray(o)?o[0]:null,s=(null===(e=u.root)||void 0===e?void 0:e.clientWidth)||0,l=Math.max(50,Math.round(.5*s));let c=null;if(r&&r.domNode&&"IMG"===r.domNode.tagName&&(c=r.domNode),c||(c=u.root.querySelector('img[src="'.concat(n,'"]'))),c){c.style.width="".concat(l,"px"),c.style.maxWidth="100%",c.style.height="auto";try{c.setAttribute("width",String(l))}catch(a){}}}catch(i){}u.setSelection(t+1,0,"api"),he.current(St(u.root.innerHTML)),ce({title:"Obr\xe1zek vlo\u017een",status:"success",duration:2e3})}catch(o){console.error("Insert after preload error:",o),ce({title:"Chyba p\u0159i vkl\xe1d\xe1n\xed obr\xe1zku",description:String(o),status:"error"})}},a.onerror=()=>{ce({title:"Obr\xe1zek nelze na\u010d\xedst",description:n,status:"error"})},a.src=n}catch(e){console.error("Error inserting image:",e),ce({title:"Chyba p\u0159i vkl\xe1d\xe1n\xed obr\xe1zku",description:String(e),status:"error"})}},50))}catch(a){var t,n;console.error("Crop and insert error:",a),ce({title:"Zpracov\xe1n\xed obr\xe1zku selhalo",description:(null===a||void 0===a||null===(t=a.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===a||void 0===a?void 0:a.message)||"Chyba",status:"error"})}finally{Re(!1),fe(!1),_e(null),ze(null),Ae({unit:"%",width:80,height:80,x:10,y:10}),Ee(85),De(1600)}},isLoading:Ne,loadingText:"Zpracov\xe1n\xed...",children:"O\u0159\xedznout a vlo\u017eit"})]})]})]})]})};var ie=n(34636);const oe=e=>{let{value:t,onChange:n,placeholder:a="Za\u010dn\u011bte ps\xe1t...",height:i="400px",readOnly:o=!1,onImageUpload:r=ie.QM,showImageResize:s=!0,toolbar:l="full"}=e;return(0,ne.jsx)(ae,{value:t,onChange:n,placeholder:a,height:i,readOnly:o,onImageUpload:async e=>{const t=await r(e);return{url:(0,ee.uq)(t.url)||t.url}},showImageResize:s,toolbar:l})}},24346:(e,t,n)=>{n.d(t,{S:()=>r});var a=n(89379),i=n(46291);let o=null;const r=async()=>{const e=Date.now();if(o&&e-o.fetchedAt<36e5)return l(o.payload);try{const t=await i.Ay.get("/youtube/videos"),n=null===t||void 0===t?void 0:t.data,a=Array.isArray(null===n||void 0===n?void 0:n.videos)&&n.videos.length>0;let r=null;return r=204!==t.status&&n&&a?n||null:await s(),r&&(o={payload:r,fetchedAt:e}),l(r)}catch(t){const n=await s();return n&&(o={payload:n,fetchedAt:e}),n}},s=async()=>{try{const e=new URL(i.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin,t="".concat(e,"/cache/prefetch/youtube_channel.json"),n=await fetch(t,{cache:"force-cache"});if(!n.ok)return null;const a=await n.json();return l(a)}catch(e){return null}},l=e=>{if(!e||!Array.isArray(e.videos))return null!==e&&void 0!==e?e:null;const t=(0,a.A)((0,a.A)({},e),{},{videos:[...e.videos]});return t.videos.sort((e,t)=>{const n=Date.parse(e.published_date||"")||0;return(Date.parse(t.published_date||"")||0)-n}),t}},24391:(e,t,n)=>{n.r(t),n.d(t,{default:()=>u});var a=n(65043),i=n(22107),o=n(68659),r=n(44093),s=n(76659),l=n(72526),c=n(48549),d=n(70579);const u=()=>{const e=(0,r.dU)("transparent","transparent"),{data:t,isLoading:n}=(0,l.I)({queryKey:["public-sponsors-list"],queryFn:c.lH,refetchInterval:6e4,staleTime:3e4}),u=(0,a.useMemo)(()=>Array.isArray(t)?t.slice(0,80):[],[t]),h=(0,a.useRef)(null),m=(0,a.useRef)(null),[p,x]=(0,a.useState)(40),[g,v]=(0,a.useState)(2),[j,b]=(0,a.useState)(0),[y,f]=(0,a.useState)(""),[k,_]=(0,a.useState)(!1),w=(0,a.useRef)(null);return(0,a.useEffect)(()=>{if(!h.current)return;const e=Array.from(h.current.querySelectorAll("img"));if(0===e.length)return x(40),v(2),void b(0);let t=0;const n=()=>{t++,t>=e.length&&(()=>{try{const e=Array.from(h.current.children),t=u.length;let n=0;const a=48;for(let c=0;c<Math.min(t,e.length);c++){const t=e[c];t&&"none"!==t.style.display&&(n+=t.getBoundingClientRect().width)}const i=Math.min(t,e.length);i>0&&(n+=(i-1)*a);const o=m.current?m.current.getBoundingClientRect().width:0,r=n>0&&o>0?Math.max(2,Math.min(10,Math.ceil(2*o/n)+1)):2;v(r),b(Math.max(0,Math.round(n)));const s=60,l=n>0?Math.max(15,n/s):40;x(Math.round(l))}catch(e){v(2),b(0),x(40)}})()};return e.forEach(e=>{e.complete&&e.naturalWidth>0?n():(e.addEventListener("load",n,{once:!0}),e.addEventListener("error",()=>{const t=e.parentElement;t&&(t.style.display="none"),n()},{once:!0}))}),()=>{e.forEach(e=>{e.onload=null,e.onerror=null})}},[u]),(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{const t=await(0,c.cf)();e&&t&&f(t)}catch(t){}try{const e=await(0,c.y)(),t=Math.max(1,Number(e.qrEvery||0===e.qrEvery?e.qrEvery:e.QRShowEveryMinutes||5)),n=Math.max(5,Number(e.qrDuration||0===e.qrDuration?e.qrDuration:e.QRShowDurationSeconds||60)),a=()=>{_(!0),window.setTimeout(()=>_(!1),1e3*n)};window.setTimeout(a,2500),w.current={intId:window.setInterval(a,60*t*1e3)}}catch(n){}})(),()=>{var t;e=!1,null!==(t=w.current)&&void 0!==t&&t.intId&&window.clearInterval(w.current.intId)}},[]),(0,d.jsxs)(i.a,{minH:"100vh",bg:e,children:[(0,d.jsx)("style",{children:"\nhtml, body { margin: 0; padding: 0; background: transparent; height: 100%; overflow: hidden; }\n.bar { position: fixed; left: 0; right: 0; bottom: 0; height: 80px; background: #000000; display: flex; align-items: center; padding: 0; box-sizing: border-box; overflow: hidden; }\n.scroller { position: relative; width: 100%; height: 100%; overflow: hidden; background: #ffffff; }\n.track { display: inline-flex; align-items: center; gap: 48px; height: 100%; white-space: nowrap; will-change: transform; animation: scroll linear infinite; animation-duration: var(--scroll-duration, 40s); }\n.item { height: 60px; width: auto; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }\n.item img { height: 30%; width: auto; max-width: 280px; min-width: 60px; object-fit: contain; display: block; filter: none; image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges; -webkit-backface-visibility: hidden; backface-visibility: hidden; transform: translateZ(0); }\n@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(var(--scroll-distance, -50%)); } }\n.qr-float { position: fixed; right: 16px; bottom: 100px; width: 160px; height: 160px; background: #ffffff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.22); display: grid; place-items: center; opacity: 0; visibility: hidden; transform: translateY(10px) scale(0.96); transition: opacity .35s ease, transform .35s ease, visibility 0s linear .35s; z-index: 9999; }\n.qr-float.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); transition: opacity .35s ease, transform .35s ease, visibility 0s; }\n.qr-float img { max-width: 88%; max-height: 88%; object-fit: contain; display: block; }\n"}),n?(0,d.jsx)(o.o,{minH:"100vh",children:(0,d.jsx)(s.y,{})}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"bar",ref:m,children:(0,d.jsx)("div",{className:"scroller",children:(0,d.jsx)("div",{className:"track",ref:h,style:{"--scroll-duration":"".concat(p,"s"),"--scroll-distance":j?"-".concat(j,"px"):void 0},children:Array.from({length:Math.max(2,g)}).flatMap((e,t)=>u.map((e,n)=>(0,d.jsx)("div",{className:"item",children:(0,d.jsx)("img",{src:e,alt:"",loading:"eager",decoding:"async",onError:e=>{e.currentTarget.parentElement.style.display="none"}})},"".concat(e,"-").concat(t,"-").concat(n))))})})}),y?(0,d.jsx)("div",{className:"qr-float".concat(k?" show":""),"aria-hidden":!k,children:(0,d.jsx)("img",{src:y,alt:"QR"})}):null]})]})}},25093:(e,t,n)=>{n.d(t,{A:()=>g});var a=n(89379),i=n(65043),o=n(22107),r=n(44093),s=n(73212),l=n(76659),c=n(10202),d=n(28846),u=n(39081),h=n(72526),m=n(71093),p=n(35349),x=n(70579);const g=e=>{let{articleId:t,eventId:n,videoUrl:g,title:v="Hlasov\xe1n\xed",showTitle:j=!0,maxPolls:b,unstyled:y=!1}=e;const f=(0,r.dU)("gray.50","gray.900"),k={};t&&(k.article_id=t),n&&(k.event_id=n),g&&(k.video_url=g);const{data:_,isLoading:w}=(0,h.I)({queryKey:["embedded-polls",k],queryFn:()=>(0,m.Ps)(k),enabled:!!(t||n||g),staleTime:12e4}),z=_||[],S=i.useMemo(()=>{const e=[...z].sort((e,t)=>{const n="rating"===e.type?1:0,a="rating"===t.type?1:0;if(n!==a)return a-n;const i=e.featured?1:0,o=t.featured?1:0;if(i!==o)return o-i;const r=new Date(e.created_at).getTime();return new Date(t.created_at).getTime()-r});return"number"===typeof b?e.slice(0,b):e},[z,b]),{data:A,isLoading:C}=(0,h.I)({queryKey:["embedded-polls-details",S.map(e=>e.id)],queryFn:async()=>{const e=S.map(e=>(0,m.gU)(e.id));return await Promise.all(e)},enabled:S.length>0});if(!t&&!n&&!g)return null;if(w)return(0,x.jsx)(o.a,{py:4,children:(0,x.jsxs)(c.T,{spacing:2,children:[(0,x.jsx)(l.y,{size:"sm"}),(0,x.jsx)(u.E,{fontSize:"sm",color:"gray.500",children:"Na\u010d\xedt\xe1n\xed hlasov\xe1n\xed..."})]})});if(!_||0===_.length||!A||0===A.length)return null;const E=y?{bg:"transparent",py:0,px:0,borderRadius:"none",my:0}:{bg:f,py:8,px:4,borderRadius:"xl",my:8};return(0,x.jsx)(o.a,(0,a.A)((0,a.A)({},E),{},{children:(0,x.jsxs)(c.T,{spacing:6,maxW:"6xl",mx:"auto",children:[j&&(0,x.jsx)(d.D,{size:"md",textAlign:"center",children:v}),C?(0,x.jsxs)(c.T,{py:8,children:[(0,x.jsx)(l.y,{}),(0,x.jsx)(u.E,{children:"Na\u010d\xedt\xe1n\xed..."})]}):(()=>{const e=[...A||[]].sort((e,t)=>{const n="rating"===e.poll.type?1:0,a="rating"===t.poll.type?1:0;if(n!==a)return a-n;const i=e.poll.featured?1:0,o=t.poll.featured?1:0;if(i!==o)return o-i;const r=new Date(e.poll.created_at).getTime();return new Date(t.poll.created_at).getTime()-r}),t="number"===typeof b?e.slice(0,b):e,n=t.length;if(1===n){const e=t[0];return(0,x.jsx)(o.a,{w:"full",children:(0,x.jsx)(p.A,{poll:e.poll,hasVoted:e.has_voted,isActive:e.is_active,canShowResults:e.can_show_results,flat:y})})}return 2===n?(0,x.jsx)(s.r,{w:"full",columns:{base:1,md:2},spacing:4,children:t.map(e=>(0,x.jsx)(o.a,{children:(0,x.jsx)(p.A,{poll:e.poll,hasVoted:e.has_voted,isActive:e.is_active,canShowResults:e.can_show_results,flat:y})},e.poll.id))}):(0,x.jsx)(s.r,{w:"full",columns:{base:1,sm:2,lg:3},spacing:4,children:t.map(e=>(0,x.jsx)(o.a,{children:(0,x.jsx)(p.A,{poll:e.poll,hasVoted:e.has_voted,isActive:e.is_active,canShowResults:e.can_show_results,flat:y})},e.poll.id))})})()]})}))}},25189:(e,t,n)=>{n.d(t,{Lt:()=>s,uq:()=>r});var a=n(46291);const i="http://127.0.0.1:8080",o={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic",REACT_APP_ESHOP_URL:"http://localhost:3100",REACT_APP_ERROR_INGEST_URL:"http://127.0.0.1:8083/api/v1/errors",REACT_APP_ERROR_INGEST_TOKEN:""}.REACT_APP_API_BASE_URL;function r(e){if(e)try{const t=String(e),n=function(){try{const e="undefined"!==typeof window?window.location.origin:"http://localhost",t="undefined"!==typeof window?window.location.port:"",n=o&&""!==o.trim()?o:a.API_URL,i=new URL(n,e);return/^(localhost|127\.0\.0\.1)$/i.test(i.hostname)&&"3000"===t?"".concat(i.protocol,"//").concat(i.hostname,":8080"):i.origin}catch(e){try{if(i&&""!==i.trim())return new URL(i,"undefined"!==typeof window?window.location.origin:"http://localhost").origin}catch(t){}return"undefined"!==typeof window?window.location.origin:""}}();if(/^data:/i.test(t))return t;if(/^(?:https?:)?\/\//i.test(t)){const e=new URL(t,window.location.origin),a=/^(localhost|127\.0\.0\.1)(:\d+)?$/i.test(e.host),i=e.pathname.startsWith("/uploads")||e.pathname.startsWith("/dist"),o="undefined"!==typeof window&&e.origin===window.location.origin;return(a||o)&&i?new URL(e.pathname+e.search+e.hash,n+"/").toString():e.toString()}return t.startsWith("/uploads")||t.startsWith("/dist")?new URL(t,n+"/").toString():t}catch(t){return e||void 0}}function s(e){if(!e)return"";let t=e.trim();return t=t.replace(/^T\u011blov\xfdchovn\xe1 jednota\s+/i,"TJ "),t=t.replace(/^Sportovn\xed klub\s+/i,"SK "),t=t.replace(/^Fotbalov\xfd klub\s+/i,"FK "),t=t.replace(/^Fotbal klub\s+/i,"FK "),t=t.replace(/^Sokol\s+/i,"SK "),t=t.replace(/,\s*(spolek|z\.\s*s\.|o\.\s*s\.|z\s*s|o\s*s|spolkov\xe1\s+organizace|spolek\s+registrovan\xfd|z\.s\.|o\.s\.)$/i,""),t.trim()}},25311:(e,t,n)=>{n.r(t),n.d(t,{default:()=>G});var a=n(65043),i=n(96870),o=n(87139),r=n(22107),s=n(98662),l=n(83169),c=n(24330),d=n(26201),u=n(44093),h=n(98939),m=n(82459),p=n(5371),x=n(73212),g=n(25011),v=n(67516),j=n(35929),b=n(15071),y=n(11054),f=n(78460),k=n(85421),_=n(61724),w=n(76659),z=n(96148),S=n(10202),A=n(94217),C=n(94085),E=n(53332),T=n(78149),D=n(80511),N=n(82595),R=n(67813),F=n(83201),P=n(3313),I=n(55395),M=n(14566),L=n(31411),W=n(10227),U=n(51794),O=n(3109),q=n(99956),K=n(28846),B=n(39081),Z=n(6583),V=n(46291),H=n(461),$=n(1009),J=n(70579);H.t1.register(H.PP,H.kc,H.E8,H.hE,H.m_,H.s$);const G=()=>{var e,t,n,H,G,X,Y;const[Q,ee]=(0,a.useState)(null),[te,ne]=(0,a.useState)([]),[ae,ie]=(0,a.useState)([]),[oe,re]=(0,a.useState)([]),[se,le]=(0,a.useState)([]),[ce,de]=(0,a.useState)([]),[ue,he]=(0,a.useState)([]),[me,pe]=(0,a.useState)([]),[xe,ge]=(0,a.useState)([]),[ve,je]=(0,a.useState)([]),[be,ye]=(0,a.useState)(!0),[fe,ke]=(0,a.useState)("0"),[_e,we]=(0,a.useState)(!1),[ze,Se]=(0,a.useState)(null),[Ae,Ce]=(0,a.useState)(null),[Ee,Te]=(0,a.useState)(null),[De,Ne]=(0,a.useState)(null),[Re,Fe]=(0,a.useState)(!1),[Pe,Ie]=(0,a.useState)(null),[Me,Le]=(0,a.useState)(!1),{isOpen:We,onOpen:Ue,onClose:Oe}=(0,i.j)(),qe=(0,u.dU)("white","gray.800"),Ke=(0,u.dU)("gray.200","gray.700");(0,a.useEffect)(()=>{(async e=>{ye(!0),Se(null),Ce(null);try{var t,n,a,i;const o=parseInt(e),r=await V.Ay.get("/admin/insights/summary?days=".concat(e));ee(r.data);const s=r.data&&((null===(t=r.data.pageviews)||void 0===t?void 0:t.value)&&r.data.pageviews.value>0||(null===(n=r.data.visitors)||void 0===n?void 0:n.value)&&r.data.visitors.value>0),[l,c,d,u,h,m,p,x]=await Promise.all([V.Ay.get("/admin/insights/breakdown/url?days=".concat(e)),V.Ay.get("/admin/insights/breakdown/browser?days=".concat(e)),V.Ay.get("/admin/insights/breakdown/os?days=".concat(e)),V.Ay.get("/admin/insights/breakdown/country?days=".concat(e)),V.Ay.get("/admin/insights/breakdown/device?days=".concat(e)),V.Ay.get("/admin/insights/breakdown/event?days=".concat(e)),V.Ay.get("/admin/insights/breakdown/query?days=".concat(e)).catch(()=>({data:[]})),V.Ay.get("/admin/insights/pageviews?days=".concat(e))]);ne(l.data||[]),ie([]),re(c.data||[]),le(d.data||[]),de(u.data||[]),he(h.data||[]),pe(m.data||[]),ge(p.data||[]);const g=[],v=x.data||[];if(v.length>0)for(const e of v){let t="";const n=e.t||e.time||e.date;if(0===o||1===o){const e=new Date(n);t="".concat(e.getHours().toString().padStart(2,"0"),":00")}else{const e=new Date(n);t="".concat(e.getDate(),". ").concat(e.getMonth()+1,".")}g.push({date:t,value:e.y||e.value||0})}je(g);const j=g.length>0&&g.some(e=>e.value>0),b=(null===(a=l.data)||void 0===a?void 0:a.length)>0||(null===(i=u.data)||void 0===i?void 0:i.length)>0;we(s||j||b),s||j||b?Ce(null):o<=1?Ce("Pro vybran\xe9 denn\xed obdob\xed zat\xedm nebyla zaznamen\xe1na \u017e\xe1dn\xe1 n\xe1v\u0161t\u011bvnost. Zkuste pozd\u011bji nebo zvolte del\u0161\xed obdob\xed."):Se("Umami nen\xed spr\xe1vn\u011b nakonfigurov\xe1no nebo je\u0161t\u011b nebyly zaznamen\xe1ny \u017e\xe1dn\xe9 n\xe1v\u0161t\u011bvy. Zkontrolujte UMAMI_WEBSITE_ID v .env souboru.")}catch(o){console.error("Failed to fetch analytics:",o),Se("Chyba p\u0159i na\u010d\xedt\xe1n\xed analytiky. Zkontrolujte p\u0159ipojen\xed k Umami."),we(!1)}finally{ye(!1)}})(fe),Be()},[fe]);const Be=async()=>{try{const e=await V.Ay.get("/insights/config");Ie(e.data)}catch(e){console.error("Failed to fetch Umami config:",e)}},Ze=e=>e?new Intl.NumberFormat("cs-CZ").format(e):"0",Ve=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,J.jsxs)(l.Z,{bg:qe,borderColor:Ke,children:[(0,J.jsx)(d.a,{children:(0,J.jsx)(K.D,{size:"sm",children:t})}),(0,J.jsx)(c.b,{children:(0,J.jsxs)(D.X,{variant:"simple",size:"sm",children:[(0,J.jsx)(P.d,{children:(0,J.jsxs)(I.Tr,{children:[(0,J.jsx)(F.Th,{children:"N\xe1zev"}),(0,J.jsx)(F.Th,{isNumeric:!0,children:"N\xe1v\u0161t\u011bvy"})]})}),(0,J.jsxs)(N.N,{children:[e.slice(0,10).map((e,t)=>{const a=n?{"Contact Form Submit":{name:"Odesl\xe1n\xed kontaktn\xedho formul\xe1\u0159e",source:"Kontaktn\xed str\xe1nka",description:"U\u017eivatel odeslal kontaktn\xed formul\xe1\u0159 na str\xe1nce Kontakt"},"Contact Form":{name:"Zobrazen\xed kontaktn\xedho formul\xe1\u0159e",source:"Kontaktn\xed str\xe1nka",description:"U\u017eivatel zobrazil kontaktn\xed formul\xe1\u0159"},"Form Submit":{name:"Odesl\xe1n\xed formul\xe1\u0159e",source:"R\u016fzn\xe9 str\xe1nky",description:"Obecn\xe9 odesl\xe1n\xed formul\xe1\u0159e na webu"},"Newsletter Subscribe":{name:"Odb\u011br newsletteru",source:"Newsletter formul\xe1\u0159",description:"U\u017eivatel se p\u0159ihl\xe1sil k odb\u011bru newsletteru"},"Newsletter Submit":{name:"Potvrzen\xed newsletteru",source:"Newsletter formul\xe1\u0159",description:"U\u017eivatel potvrdil p\u0159ihl\xe1\u0161en\xed k newsletteru"},"Newsletter Unsubscribe":{name:"Odhl\xe1\u0161en\xed z newsletteru",source:"Nastaven\xed newsletteru",description:"U\u017eivatel se odhl\xe1sil z odb\u011bru newsletteru"},"Newsletter Preferences Saved":{name:"Ulo\u017een\xed p\u0159edvoleb newsletteru",source:"Nastaven\xed newsletteru",description:"U\u017eivatel ulo\u017eil sv\xe9 p\u0159edvolby pro newsletter"},Unsubscribe:{name:"Odhl\xe1\u0161en\xed z odb\u011bru",source:"Nastaven\xed",description:"U\u017eivatel se odhl\xe1sil z odb\u011bru"},"Save Preferences":{name:"Ulo\u017een\xed p\u0159edvoleb",source:"Nastaven\xed",description:"U\u017eivatel ulo\u017eil sv\xe9 p\u0159edvolby (souhlas s cookies apod.)"},"Refresh Preferences":{name:"Obnoven\xed p\u0159edvoleb",source:"Nastaven\xed",description:"U\u017eivatel obnovil nebo zm\u011bnil sv\xe9 p\u0159edvolby"},"Article View":{name:"Zobrazen\xed \u010dl\xe1nku",source:"Blog",description:"U\u017eivatel si zobrazil \u010dl\xe1nek na blogu"},"Match View":{name:"Zobrazen\xed z\xe1pasu",source:"Str\xe1nka z\xe1pas\u016f",description:"U\u017eivatel si zobrazil detail z\xe1pasu"},"Gallery View":{name:"Zobrazen\xed galerie",source:"Galerie",description:"U\u017eivatel si otev\u0159el galerii fotografi\xed"},"Video Play":{name:"P\u0159ehr\xe1n\xed videa",source:"Video sekce",description:"U\u017eivatel spustil p\u0159ehr\xe1v\xe1n\xed videa"},"Social Share":{name:"Sd\xedlen\xed na soci\xe1ln\xedch s\xedt\xedch",source:"Sd\xedlec\xed tla\u010d\xedtka",description:"U\u017eivatel sd\xedlel obsah na soci\xe1ln\xed s\xed\u0165"},Download:{name:"Sta\u017een\xed souboru",source:"R\u016fzn\xe9 str\xe1nky",description:"U\u017eivatel st\xe1hl soubor"},"External Link Click":{name:"Kliknut\xed na extern\xed odkaz",source:"R\u016fzn\xe9 str\xe1nky",description:"U\u017eivatel klikl na odkaz vedouc\xed mimo web"},"Poll Vote":{name:"Hlasov\xe1n\xed v anket\u011b",source:"Ankety",description:"U\u017eivatel hlasoval v anket\u011b"},"Button Click":{name:"Kliknut\xed na tla\u010d\xedtko",source:"R\u016fzn\xe9 str\xe1nky",description:"U\u017eivatel klikl na tla\u010d\xedtko"},Navigation:{name:"Navigace",source:"Menu / odkazy",description:"U\u017eivatel p\u0159e\u0161el na jinou str\xe1nku"},Search:{name:"Vyhled\xe1v\xe1n\xed",source:"Vyhled\xe1v\xe1n\xed",description:"U\u017eivatel vyhled\xe1val na webu"},"Email Open":{name:"Otev\u0159en\xed e\u2011mailu",source:"E\u2011mail",description:"P\u0159\xedjemce otev\u0159el e\u2011mail"},"Email Click":{name:"Kliknut\xed v e\u2011mailu",source:"E\u2011mail",description:"P\u0159\xedjemce klikl na odkaz v e\u2011mailu"},"Email Spam":{name:"Ozna\u010deno jako spam",source:"E\u2011mail",description:"P\u0159\xedjemce ozna\u010dil zpr\xe1vu jako spam"},"Email Unsubscribe":{name:"Odhl\xe1\u0161en\xed z e\u2011mailu",source:"E\u2011mail",description:"P\u0159\xedjemce se odhl\xe1sil z odb\u011bru"},"ShortLink Click":{name:"Kliknut\xed na zkr\xe1cen\xfd odkaz",source:"Zkr\xe1cen\xe9 odkazy",description:"U\u017eivatel klikl na zkr\xe1cen\xfd odkaz"},"Link Redirect":{name:"P\u0159esm\u011brov\xe1n\xed odkazu",source:"Sledov\xe1n\xed odkaz\u016f",description:"Zaznamenan\xe9 p\u0159esm\u011brov\xe1n\xed sledovan\xe9ho odkazu"}}[i=e.x]||{name:i,source:"Nezn\xe1m\xfd zdroj",description:"Ud\xe1lost: ".concat(i)}:null;var i;return(0,J.jsxs)(I.Tr,{children:[(0,J.jsx)(R.Td,{children:n&&a?(0,J.jsx)(q.m,{label:a.description,placement:"top",hasArrow:!0,children:(0,J.jsxs)(r.a,{children:[(0,J.jsx)(B.E,{noOfLines:1,maxW:"300px",fontWeight:"medium",children:a.name}),(0,J.jsx)(B.E,{fontSize:"xs",color:"gray.500",children:a.source})]})}):(0,J.jsx)(B.E,{noOfLines:1,maxW:"300px",children:e.x||"(pr\xe1zdn\xe9)"})}),(0,J.jsx)(R.Td,{isNumeric:!0,children:(0,J.jsx)(o.E,{colorScheme:"blue",children:Ze(e.y)})})]},t)}),0===e.length&&(0,J.jsx)(I.Tr,{children:(0,J.jsx)(R.Td,{colSpan:2,textAlign:"center",children:(0,J.jsx)(B.E,{color:"gray.500",children:"\u017d\xe1dn\xe1 data"})})})]})]})})]})};return be&&!Q?(0,J.jsx)(Z.A,{children:(0,J.jsx)(h.m,{maxW:"container.xl",py:8,children:(0,J.jsxs)(S.T,{spacing:4,children:[(0,J.jsx)(w.y,{size:"xl"}),(0,J.jsx)(B.E,{children:"Na\u010d\xedt\xe1n\xed analytiky..."})]})})}):(0,J.jsxs)(Z.A,{children:[(0,J.jsx)(h.m,{maxW:"container.xl",py:8,children:(0,J.jsxs)(S.T,{spacing:6,align:"stretch",children:[(0,J.jsxs)(z.z,{justify:"space-between",align:"center",children:[(0,J.jsxs)(z.z,{spacing:3,children:[(0,J.jsx)(g.I,{as:$.wIk,color:"blue.500",boxSize:6}),(0,J.jsx)(K.D,{size:"lg",children:"Analytika webu"})]}),(0,J.jsxs)(z.z,{children:[(0,J.jsx)(g.I,{as:$.wIk,color:"gray.500",boxSize:4}),(0,J.jsxs)(_.l,{value:fe,onChange:e=>ke(e.target.value),maxW:"200px",children:[(0,J.jsx)("option",{value:"0",children:"Dnes (dne\u0161n\xed den)"}),(0,J.jsx)("option",{value:"1",children:"V\u010dera"}),(0,J.jsx)("option",{value:"7",children:"Posledn\xedch 7 dn\xed"}),(0,J.jsx)("option",{value:"30",children:"Posledn\xedch 30 dn\xed"}),(0,J.jsx)("option",{value:"90",children:"Posledn\xedch 90 dn\xed"}),(0,J.jsx)("option",{value:"365",children:"Posledn\xed rok"})]})]})]}),Ae&&(0,J.jsx)(l.Z,{bg:"yellow.50",borderColor:"yellow.300",borderWidth:2,children:(0,J.jsx)(c.b,{children:(0,J.jsxs)(z.z,{spacing:3,align:"start",children:[(0,J.jsx)(g.I,{as:$.S8s,color:"yellow.600",boxSize:6,mt:1}),(0,J.jsxs)(S.T,{align:"start",spacing:1,children:[(0,J.jsx)(B.E,{fontWeight:"bold",color:"yellow.800",children:"Zat\xedm \u017e\xe1dn\xe1 data"}),(0,J.jsx)(B.E,{fontSize:"sm",color:"yellow.700",children:Ae})]})]})})}),(0,J.jsxs)(x.r,{columns:{base:1,md:2,lg:5},spacing:4,children:[(0,J.jsx)(l.Z,{bg:qe,borderColor:Ke,children:(0,J.jsx)(c.b,{children:(0,J.jsxs)(A.r,{children:[(0,J.jsxs)(z.z,{spacing:2,mb:2,children:[(0,J.jsx)(g.I,{as:$.Vap,color:"blue.500",boxSize:5}),(0,J.jsx)(E.v,{children:"Zobrazen\xed str\xe1nek"})]}),(0,J.jsx)(T.k,{children:Ze(null===Q||void 0===Q||null===(e=Q.pageviews)||void 0===e?void 0:e.value)}),(0,J.jsx)(C.h,{children:"Celkov\xfd po\u010det zobrazen\xed"})]})})}),(0,J.jsx)(l.Z,{bg:qe,borderColor:Ke,children:(0,J.jsx)(c.b,{children:(0,J.jsxs)(A.r,{children:[(0,J.jsxs)(z.z,{spacing:2,mb:2,children:[(0,J.jsx)(g.I,{as:$.cfS,color:"green.500",boxSize:5}),(0,J.jsx)(E.v,{children:"N\xe1v\u0161t\u011bvn\xedci"})]}),(0,J.jsx)(T.k,{children:Ze(null===Q||void 0===Q||null===(t=Q.visitors)||void 0===t?void 0:t.value)}),(0,J.jsx)(C.h,{children:"Unik\xe1tn\xed n\xe1v\u0161t\u011bvn\xedci"})]})})}),(0,J.jsx)(l.Z,{bg:qe,borderColor:Ke,children:(0,J.jsx)(c.b,{children:(0,J.jsxs)(A.r,{children:[(0,J.jsxs)(z.z,{spacing:2,mb:2,children:[(0,J.jsx)(g.I,{as:$.z1n,color:"purple.500",boxSize:5}),(0,J.jsx)(E.v,{children:"N\xe1v\u0161t\u011bvy"})]}),(0,J.jsx)(T.k,{children:Ze(null===Q||void 0===Q||null===(n=Q.visits)||void 0===n?void 0:n.value)}),(0,J.jsx)(C.h,{children:"Celkov\xfd po\u010det relac\xed"})]})})}),(0,J.jsx)(l.Z,{bg:qe,borderColor:Ke,children:(0,J.jsx)(c.b,{children:(0,J.jsxs)(A.r,{children:[(0,J.jsxs)(z.z,{spacing:2,mb:2,children:[(0,J.jsx)(g.I,{as:$.fTJ,color:"orange.500",boxSize:5}),(0,J.jsx)(E.v,{children:"M\xedra opu\u0161t\u011bn\xed"})]}),(0,J.jsx)(T.k,{children:null!==Q&&void 0!==Q&&null!==(H=Q.bounces)&&void 0!==H&&H.value&&null!==Q&&void 0!==Q&&null!==(G=Q.visits)&&void 0!==G&&G.value?"".concat(Math.round(Q.bounces.value/Q.visits.value*100),"%"):"0%"}),(0,J.jsx)(C.h,{children:"Odchody po 1 str\xe1nce"})]})})}),(0,J.jsx)(l.Z,{bg:qe,borderColor:Ke,children:(0,J.jsx)(c.b,{children:(0,J.jsxs)(A.r,{children:[(0,J.jsxs)(z.z,{spacing:2,mb:2,children:[(0,J.jsx)(g.I,{as:$.Ohp,color:"teal.500",boxSize:5}),(0,J.jsx)(E.v,{children:"Pr\u016fm\u011brn\xfd \u010das"})]}),(0,J.jsx)(T.k,{children:(e=>{if(!e||0===e)return"0s";let t=e>1e4?Math.floor(e/1e3):Math.floor(e);const n=Math.floor(t/3600),a=Math.floor(t%3600/60),i=t%60;return n>0?"".concat(n,"h ").concat(a,"m ").concat(i,"s"):a>0?"".concat(a,"m ").concat(i,"s"):"".concat(i,"s")})(null!==Q&&void 0!==Q&&null!==(X=Q.totaltime)&&void 0!==X&&X.value&&null!==Q&&void 0!==Q&&null!==(Y=Q.visits)&&void 0!==Y&&Y.value?Q.totaltime.value/Q.visits.value:0)}),(0,J.jsx)(C.h,{children:"Pr\u016fm\u011brn\xe1 d\xe9lka n\xe1v\u0161t\u011bvy"})]})})})]}),(!_e||Me)&&(0,J.jsx)(l.Z,{bg:"blue.50",borderColor:"blue.300",borderWidth:2,children:(0,J.jsx)(c.b,{children:(0,J.jsxs)(z.z,{spacing:3,align:"start",children:[(0,J.jsx)(g.I,{as:$.z1n,color:"blue.500",boxSize:6,mt:1}),(0,J.jsxs)(S.T,{align:"start",spacing:3,flex:1,children:[(0,J.jsxs)(z.z,{justify:"space-between",w:"full",children:[(0,J.jsx)(B.E,{fontWeight:"bold",color:"blue.800",fontSize:"lg",children:"Diagnostika analytiky"}),(0,J.jsx)(s.$,{size:"xs",variant:"ghost",onClick:()=>Le(!Me),children:Me?"Skr\xfdt":"Zobrazit detaily"})]}),(0,J.jsxs)(r.a,{w:"full",children:[(0,J.jsxs)(z.z,{spacing:2,mb:2,children:[(0,J.jsx)(o.E,{colorScheme:null!==Pe&&void 0!==Pe&&Pe.enabled?"green":"red",children:null!==Pe&&void 0!==Pe&&Pe.enabled?"P\u0159ipojeno":"Nep\u0159ipojeno"}),(0,J.jsx)(B.E,{fontSize:"sm",fontWeight:"semibold",color:"blue.800",children:"Stav Umami"})]}),Pe&&(0,J.jsxs)(S.T,{align:"start",spacing:1,pl:4,children:[(0,J.jsxs)(B.E,{fontSize:"xs",color:"blue.700",children:[(0,J.jsx)("strong",{children:"Aktivov\xe1no:"})," ",Pe.enabled?"Ano":"Ne"]}),Pe.website_id&&(0,J.jsxs)(B.E,{fontSize:"xs",color:"blue.700",children:[(0,J.jsx)("strong",{children:"Website ID:"})," ",Pe.website_id]}),Pe.reason&&(0,J.jsxs)(B.E,{fontSize:"xs",color:"red.600",children:[(0,J.jsx)("strong",{children:"D\u016fvod:"})," ",Pe.reason]})]})]}),(0,J.jsx)(m.c,{borderColor:"blue.200"}),!_e&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(B.E,{fontSize:"sm",color:"blue.800",fontWeight:"semibold",children:"Pro\u010d nejsou k dispozici \u017e\xe1dn\xe1 data?"}),(0,J.jsxs)(S.T,{align:"start",spacing:1,pl:4,children:[(0,J.jsx)(B.E,{fontSize:"xs",color:"blue.700",children:"\u2022 Umami tracking je\u0161t\u011b nezaznamenal \u017e\xe1dn\xe9 n\xe1v\u0161t\u011bvy"}),(0,J.jsx)(B.E,{fontSize:"xs",color:"blue.700",children:"\u2022 Tracking script se na\u010d\xedt\xe1 pouze na ve\u0159ejn\xfdch str\xe1nk\xe1ch (ne na /admin)"}),(0,J.jsx)(B.E,{fontSize:"xs",color:"blue.700",children:"\u2022 Data se aktualizuj\xed v re\xe1ln\xe9m \u010dase po n\xe1v\u0161t\u011bv\u011b ve\u0159ejn\xfdch str\xe1nek"})]}),(0,J.jsx)(m.c,{borderColor:"blue.200"}),(0,J.jsx)(B.E,{fontSize:"sm",color:"blue.800",fontWeight:"semibold",children:"Jak vygenerovat testovac\xed data:"}),(0,J.jsxs)(S.T,{align:"start",spacing:1,pl:4,children:[(0,J.jsx)(B.E,{fontSize:"xs",color:"blue.700",children:"1. Otev\u0159ete hlavn\xed str\xe1nku webu v nov\xe9m okn\u011b inkognito"}),(0,J.jsx)(B.E,{fontSize:"xs",color:"blue.700",children:"2. Proch\xe1zejte n\u011bkolik ve\u0159ejn\xfdch str\xe1nek (Blog, O klubu, Kontakt...)"}),(0,J.jsx)(B.E,{fontSize:"xs",color:"blue.700",children:"3. Po\u010dkejte 1-2 minuty a obnovte tuto str\xe1nku analytiky"})]}),(0,J.jsxs)(z.z,{spacing:2,mt:2,children:[(0,J.jsx)(s.$,{size:"sm",colorScheme:"blue",leftIcon:(0,J.jsx)(g.I,{as:$.VeH}),onClick:()=>window.open("/","_blank"),children:"Otev\u0159\xedt hlavn\xed str\xe1nku"}),(0,J.jsx)(s.$,{size:"sm",colorScheme:"blue",variant:"outline",leftIcon:(0,J.jsx)(g.I,{as:$.FrA}),onClick:()=>window.location.reload(),children:"Obnovit analytiku"})]})]})]})]})})}),ze&&(0,J.jsx)(l.Z,{bg:"orange.50",borderColor:"orange.300",borderWidth:2,children:(0,J.jsx)(c.b,{children:(0,J.jsxs)(z.z,{spacing:3,align:"start",children:[(0,J.jsx)(g.I,{as:$.FrA,color:"orange.500",boxSize:6,mt:1}),(0,J.jsxs)(S.T,{align:"start",spacing:2,flex:1,children:[(0,J.jsx)(B.E,{fontWeight:"bold",color:"orange.800",fontSize:"lg",children:"Analytika nen\xed k dispozici"}),(0,J.jsx)(B.E,{fontSize:"sm",color:"orange.700",children:ze}),(0,J.jsx)(m.c,{borderColor:"orange.200"}),(0,J.jsx)(B.E,{fontSize:"sm",color:"orange.800",fontWeight:"semibold",children:"Mo\u017en\xe9 p\u0159\xed\u010diny:"}),(0,J.jsxs)(S.T,{align:"start",spacing:1,pl:4,children:[(0,J.jsx)(B.E,{fontSize:"xs",color:"orange.700",children:"\u2022 Umami nen\xed spu\u0161t\u011bno nebo nen\xed dostupn\xe9"}),(0,J.jsx)(B.E,{fontSize:"xs",color:"orange.700",children:"\u2022 V Umami instanci neexistuje \u017e\xe1dn\xfd web"}),(0,J.jsx)(B.E,{fontSize:"xs",color:"orange.700",children:"\u2022 Nebyly je\u0161t\u011b zaznamen\xe1ny \u017e\xe1dn\xe9 n\xe1v\u0161t\u011bvy"}),(0,J.jsx)(B.E,{fontSize:"xs",color:"orange.700",children:"\u2022 Chybn\xe9 p\u0159ihla\u0161ovac\xed \xfadaje v .env souboru"})]}),(0,J.jsx)(m.c,{borderColor:"orange.200"}),(0,J.jsx)(B.E,{fontSize:"sm",color:"orange.800",fontWeight:"semibold",children:"\u0158e\u0161en\xed:"}),(0,J.jsxs)(S.T,{align:"start",spacing:1,pl:4,children:[(0,J.jsxs)(B.E,{fontSize:"xs",color:"orange.700",children:["1. Zkontrolujte, \u017ee Umami b\u011b\u017e\xed na ",(0,J.jsx)("strong",{children:{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic",REACT_APP_ESHOP_URL:"http://localhost:3100",REACT_APP_ERROR_INGEST_URL:"http://127.0.0.1:8083/api/v1/errors",REACT_APP_ERROR_INGEST_TOKEN:""}.REACT_APP_UMAMI_URL||"nakonfigurovan\xe9 URL"})]}),(0,J.jsx)(B.E,{fontSize:"xs",color:"orange.700",children:"2. P\u0159ihlaste se do Umami a vytvo\u0159te nov\xfd web, pokud \u017e\xe1dn\xfd neexistuje"}),(0,J.jsx)(B.E,{fontSize:"xs",color:"orange.700",children:"3. Restartujte backend server pro op\u011btovn\xe9 p\u0159ipojen\xed"}),(0,J.jsx)(B.E,{fontSize:"xs",color:"orange.700",children:"4. Zkontrolujte backend logy pro detailn\xed chybov\xe9 zpr\xe1vy"})]}),(0,J.jsx)(s.$,{size:"sm",colorScheme:"orange",variant:"outline",leftIcon:(0,J.jsx)(g.I,{as:$.FrA}),onClick:()=>window.location.reload(),mt:2,children:"Znovu na\u010d\xedst str\xe1nku"})]})]})})}),(0,J.jsx)(m.c,{}),(0,J.jsxs)(l.Z,{bg:qe,borderColor:Ke,children:[(0,J.jsx)(d.a,{children:(0,J.jsxs)(z.z,{spacing:2,children:[(0,J.jsx)(g.I,{as:$.VeH,color:"green.500",boxSize:5}),(0,J.jsx)(K.D,{size:"md",children:"N\xe1v\u0161t\u011bvn\xedci podle zem\xed"})]})}),(0,J.jsx)(c.b,{children:be&&0===ce.length?(0,J.jsx)(p.s,{justify:"center",py:8,children:(0,J.jsx)(w.y,{size:"lg"})}):0===ce.length?(0,J.jsx)(B.E,{textAlign:"center",color:"gray.500",py:8,children:"\u017d\xe1dn\xe1 data o zem\xedch"}):(0,J.jsx)(x.r,{columns:{base:1,sm:2,md:3,lg:4},spacing:4,children:ce.slice(0,12).map((e,t)=>{var n;const a=(null===(n=e.x)||void 0===n?void 0:n.toUpperCase())||"",i=new Intl.DisplayNames(["cs","en"],{type:"region"}).of(a)||a,r=2===a.length?String.fromCodePoint(...[...a].map(e=>127397+e.charCodeAt(0))):"\ud83c\udff3\ufe0f";return(0,J.jsx)(l.Z,{variant:"outline",cursor:"pointer",transition:"all 0.2s",_hover:{transform:"translateY(-2px)",boxShadow:"md",borderColor:"blue.400"},onClick:()=>(async(e,t,n)=>{Te({code:e,name:t,value:n}),Fe(!0),Ue();try{const[t,n,a,i,o]=await Promise.all([V.Ay.get("/admin/insights/breakdown/url?days=".concat(fe,"&country=").concat(e)),V.Ay.get("/admin/insights/breakdown/browser?days=".concat(fe,"&country=").concat(e)),V.Ay.get("/admin/insights/breakdown/os?days=".concat(fe,"&country=").concat(e)),V.Ay.get("/admin/insights/breakdown/device?days=".concat(fe,"&country=").concat(e)),V.Ay.get("/admin/insights/breakdown/event?days=".concat(fe,"&country=").concat(e))]);Ne({pages:t.data||[],browsers:n.data||[],os:a.data||[],devices:i.data||[],events:o.data||[]})}catch(a){console.error("Failed to fetch country details:",a),Ne(null)}finally{Fe(!1)}})(a,i,e.y),children:(0,J.jsx)(c.b,{p:4,children:(0,J.jsxs)(S.T,{spacing:2,children:[(0,J.jsx)(B.E,{fontSize:"4xl",children:r}),(0,J.jsx)(B.E,{fontWeight:"semibold",fontSize:"sm",noOfLines:1,children:i}),(0,J.jsxs)(o.E,{colorScheme:"blue",fontSize:"sm",children:[Ze(e.y)," n\xe1v\u0161t\u011bv"]})]})})},t)})})})]}),(0,J.jsxs)(O.t,{colorScheme:"blue",children:[(0,J.jsxs)(L.w,{flexWrap:"wrap",children:[(0,J.jsx)(M.o,{children:(0,J.jsxs)(z.z,{spacing:2,children:[(0,J.jsx)(g.I,{as:$.QuH}),(0,J.jsx)(B.E,{children:"Str\xe1nky"})]})}),(0,J.jsx)(M.o,{children:(0,J.jsxs)(z.z,{spacing:2,children:[(0,J.jsx)(g.I,{as:$.ufi}),(0,J.jsx)(B.E,{children:"Prohl\xed\u017ee\u010de"})]})}),(0,J.jsx)(M.o,{children:(0,J.jsxs)(z.z,{spacing:2,children:[(0,J.jsx)(g.I,{as:$.Ojn}),(0,J.jsx)(B.E,{children:"Opera\u010dn\xed syst\xe9my"})]})}),(0,J.jsx)(M.o,{children:(0,J.jsxs)(z.z,{spacing:2,children:[(0,J.jsx)(g.I,{as:$.VeH}),(0,J.jsx)(B.E,{children:"Zem\u011b"})]})}),(0,J.jsx)(M.o,{children:(0,J.jsxs)(z.z,{spacing:2,children:[(0,J.jsx)(g.I,{as:$.PCV}),(0,J.jsx)(B.E,{children:"Za\u0159\xedzen\xed"})]})}),(0,J.jsx)(M.o,{children:(0,J.jsxs)(z.z,{spacing:2,children:[(0,J.jsx)(g.I,{as:$.FrA}),(0,J.jsx)(B.E,{children:"Ud\xe1losti"})]})}),(0,J.jsx)(M.o,{children:(0,J.jsxs)(z.z,{spacing:2,children:[(0,J.jsx)(g.I,{as:$.CKj}),(0,J.jsx)(B.E,{children:"Query parametry"})]})})]}),(0,J.jsxs)(U.T,{children:[(0,J.jsx)(W.K,{children:Ve(te,"Nejnav\u0161t\u011bvovan\u011bj\u0161\xed str\xe1nky")}),(0,J.jsx)(W.K,{children:Ve(oe,"Pou\u017e\xedvan\xe9 prohl\xed\u017ee\u010de")}),(0,J.jsx)(W.K,{children:Ve(se,"Opera\u010dn\xed syst\xe9my")}),(0,J.jsx)(W.K,{children:Ve(ce,"Zem\u011b n\xe1v\u0161t\u011bvn\xedk\u016f")}),(0,J.jsx)(W.K,{children:Ve(ue,"Typy za\u0159\xedzen\xed")}),(0,J.jsx)(W.K,{children:Ve(me,"Ud\xe1losti u\u017eivatel\u016f",!0)}),(0,J.jsx)(W.K,{children:Ve(xe,"Query parametry URL")})]})]})]})}),(0,J.jsxs)(f.aF,{isOpen:We,onClose:()=>{Oe(),Te(null),Ne(null)},size:"6xl",children:[(0,J.jsx)(y.m,{}),(0,J.jsxs)(k.$,{children:[(0,J.jsx)(b.r,{children:(0,J.jsxs)(p.s,{align:"center",gap:3,children:[(0,J.jsxs)(B.E,{children:["Analytika pro zemi: ",null===Ee||void 0===Ee?void 0:Ee.name]}),(0,J.jsxs)(o.E,{colorScheme:"blue",fontSize:"sm",children:[Ze(null===Ee||void 0===Ee?void 0:Ee.value)," n\xe1v\u0161t\u011bv"]})]})}),(0,J.jsx)(j.s,{}),(0,J.jsx)(v.c,{pb:6,children:Re?(0,J.jsxs)(p.s,{justify:"center",align:"center",py:8,children:[(0,J.jsx)(w.y,{size:"lg"}),(0,J.jsx)(B.E,{ml:3,children:"Na\u010d\xedt\xe1n\xed detail\u016f..."})]}):De?(0,J.jsxs)(O.t,{colorScheme:"blue",children:[(0,J.jsxs)(L.w,{children:[(0,J.jsx)(M.o,{children:"Str\xe1nky"}),(0,J.jsx)(M.o,{children:"Prohl\xed\u017ee\u010de"}),(0,J.jsx)(M.o,{children:"Opera\u010dn\xed syst\xe9my"}),(0,J.jsx)(M.o,{children:"Za\u0159\xedzen\xed"}),(0,J.jsx)(M.o,{children:"Ud\xe1losti"})]}),(0,J.jsxs)(U.T,{children:[(0,J.jsx)(W.K,{children:Ve(De.pages,"Nejnav\u0161t\u011bvovan\u011bj\u0161\xed str\xe1nky v ".concat(null===Ee||void 0===Ee?void 0:Ee.name))}),(0,J.jsx)(W.K,{children:Ve(De.browsers,"Pou\u017e\xedvan\xe9 prohl\xed\u017ee\u010de v ".concat(null===Ee||void 0===Ee?void 0:Ee.name))}),(0,J.jsx)(W.K,{children:Ve(De.os,"Opera\u010dn\xed syst\xe9my v ".concat(null===Ee||void 0===Ee?void 0:Ee.name))}),(0,J.jsx)(W.K,{children:Ve(De.devices,"Typy za\u0159\xedzen\xed v ".concat(null===Ee||void 0===Ee?void 0:Ee.name))}),(0,J.jsx)(W.K,{children:Ve(De.events,"Ud\xe1losti u\u017eivatel\u016f z ".concat(null===Ee||void 0===Ee?void 0:Ee.name),!0)})]})]}):(0,J.jsx)(r.a,{textAlign:"center",py:8,children:(0,J.jsx)(B.E,{color:"gray.500",children:"Pro vybranou zemi nejsou k dispozici detailn\xed data."})})})]})]})]})}},27328:(e,t,n)=>{n.r(t),n.d(t,{default:()=>te});var a=n(89379),i=n(65043),o=n(6583),r=n(96870),s=n(27024),l=n(87139),c=n(22107),d=n(98662),u=n(42703),h=n(34946),m=n(3053),p=n(44093),x=n(82459),g=n(73225),v=n(76668),j=n(33572),b=n(35699),y=n(67516),f=n(35929),k=n(56529),_=n(15071),w=n(11054),z=n(78460),S=n(85421),A=n(97569),C=n(88019),E=n(61724),T=n(96148),D=n(10202),N=n(98481),R=n(80511),F=n(82595),P=n(67813),I=n(83201),M=n(3313),L=n(55395),W=n(30502),U=n(28846),O=n(39081),q=n(58861),K=n(72526),B=n(59781),Z=n(12836),V=n(64920),H=n(1009),$=n(25189),J=n(2367),G=n(88500),X=n(70579);const Y=["XS","S","M","L","XL","XXL","XXXL","UNI"],Q=["\u010cern\xe1","B\xedl\xe1","Modr\xe1","\u010cerven\xe1","Zelen\xe1","\u017dlut\xe1","Oran\u017eov\xe1","Fialov\xe1","\u0160ed\xe1","R\u016f\u017eov\xe1","Hn\u011bd\xe1","Navy","B\xe9\u017eov\xe1","Tyrkysov\xe1","V\xednov\xe1"],ee=()=>{const[e,t]=i.useState(""),[n,a]=i.useState(""),[o,s]=i.useState(100),u=(0,B.jE)(),h=(0,W.d)(),m=(0,K.I)({queryKey:["admin-users"],queryFn:V._m,staleTime:3e4}),p=(0,K.I)({queryKey:["admin-engagement-tx",{userId:e,reason:n,limit:o}],queryFn:async()=>{const t={};return e.trim()&&(t.user_id=e.trim()),n.trim()&&(t.reason=n.trim()),o&&(t.limit=o),(0,V.rT)(t)}}),[x,j]=i.useState(""),[C,N]=i.useState(""),[q,H]=i.useState("admin_adjust"),$=(0,r.j)(),[G,Y]=i.useState(""),Q=(0,Z.n)({mutationFn:async()=>{const e=Number(x),t=Number(C);if(!e||!t)throw new Error("Zadejte platn\xe9 user_id a delta");return(0,V.k5)({user_id:e,delta:t,reason:q.trim()||"admin_adjust",current_password:G})},onSuccess:async()=>{N(""),Y(""),$.onClose(),await u.invalidateQueries({queryKey:["admin-engagement-tx"]}),h({status:"success",title:"Upraveno"})},onError:e=>h({status:"error",title:(null===e||void 0===e?void 0:e.message)||"Chyba p\u0159i \xfaprav\u011b bod\u016f"})});return(0,X.jsxs)(D.T,{align:"stretch",spacing:3,children:[(0,X.jsxs)(T.z,{flexWrap:"wrap",rowGap:2,children:[(0,X.jsx)(E.l,{placeholder:"V\u0161ichni u\u017eivatel\xe9",value:e,onChange:e=>t(e.target.value),maxW:"260px",children:(m.data||[]).map(e=>(0,X.jsxs)("option",{value:String(e.id),children:[e.name||e.email," (#",e.id,")"]},e.id))}),(0,X.jsxs)(E.l,{placeholder:"D\u016fvod",value:n,onChange:e=>a(e.target.value),maxW:"220px",children:[(0,X.jsx)("option",{value:"daily_checkin",children:"daily_checkin"}),(0,X.jsx)("option",{value:"article_read",children:"article_read"}),(0,X.jsx)("option",{value:"redeem",children:"redeem"}),(0,X.jsx)("option",{value:"redeem_refund",children:"redeem_refund"}),(0,X.jsx)("option",{value:"admin_adjust",children:"admin_adjust"})]}),(0,X.jsx)(A.Q7,{value:o,min:10,max:1e3,onChange:(e,t)=>s(Number.isFinite(t)?t:100),maxW:"160px",children:(0,X.jsx)(A.OO,{})}),(0,X.jsx)(d.$,{size:"sm",variant:"outline",onClick:()=>u.invalidateQueries({queryKey:["admin-engagement-tx"]}),children:"Obnovit"})]}),(0,X.jsx)(c.a,{borderWidth:"1px",borderRadius:"md",overflowX:"auto",children:(0,X.jsxs)(R.X,{size:"sm",children:[(0,X.jsx)(M.d,{children:(0,X.jsxs)(L.Tr,{children:[(0,X.jsx)(I.Th,{children:"ID"}),(0,X.jsx)(I.Th,{children:"U\u017eivatel"}),(0,X.jsx)(I.Th,{children:"Delta"}),(0,X.jsx)(I.Th,{children:"D\u016fvod"}),(0,X.jsx)(I.Th,{children:"Meta"}),(0,X.jsx)(I.Th,{children:"\u010cas"})]})}),(0,X.jsx)(F.N,{children:(p.data||[]).map(e=>{var t,n;return(0,X.jsxs)(L.Tr,{children:[(0,X.jsxs)(P.Td,{children:["#",e.id]}),(0,X.jsx)(P.Td,{children:null!==(t=(m.data||[]).find(t=>t.id===e.user_id))&&void 0!==t&&t.name?(0,X.jsxs)(T.z,{spacing:1,children:[(0,X.jsx)(O.E,{noOfLines:1,children:null===(n=(m.data||[]).find(t=>t.id===e.user_id))||void 0===n?void 0:n.name}),(0,X.jsxs)(O.E,{color:"gray.500",fontSize:"xs",children:["#",e.user_id]})]}):(0,X.jsxs)(O.E,{children:["#",e.user_id]})}),(0,X.jsx)(P.Td,{children:e.delta}),(0,X.jsx)(P.Td,{children:(0,X.jsx)(l.E,{children:e.reason})}),(0,X.jsx)(P.Td,{children:(0,X.jsx)(O.E,{fontSize:"xs",noOfLines:1,children:e.meta?JSON.stringify(e.meta):"-"})}),(0,X.jsx)(P.Td,{children:e.created_at?new Date(e.created_at).toLocaleString():"-"})]},e.id)})})]})}),(0,X.jsx)(U.D,{size:"xs",mt:4,children:"Manu\xe1ln\xed \xfaprava bod\u016f"}),(0,X.jsxs)(D.T,{align:"stretch",spacing:2,children:[(0,X.jsxs)(T.z,{flexWrap:"wrap",rowGap:2,children:[(0,X.jsx)(E.l,{placeholder:"Vyberte u\u017eivatele",value:x,onChange:e=>j(e.target.value),maxW:"260px",children:(m.data||[]).map(e=>(0,X.jsxs)("option",{value:String(e.id),children:[e.name||e.email," (#",e.id,")"]},e.id))}),(0,X.jsx)(b.p,{placeholder:"Delta (+/-)",value:C,onChange:e=>N(e.target.value),maxW:"160px"}),(0,X.jsxs)(E.l,{value:q,onChange:e=>H(e.target.value),maxW:"240px",children:[(0,X.jsx)("option",{value:"admin_adjust",children:"admin_adjust"}),(0,X.jsx)("option",{value:"bonus",children:"bonus"}),(0,X.jsx)("option",{value:"penalty",children:"penalty"})]})]}),(0,X.jsx)(d.$,{colorScheme:"blue",size:"sm",onClick:()=>$.onOpen(),isLoading:Q.isPending,isDisabled:!x||!C,children:"Upravit body"}),(0,X.jsxs)(z.aF,{isOpen:$.isOpen,onClose:$.onClose,isCentered:!0,children:[(0,X.jsx)(w.m,{}),(0,X.jsxs)(S.$,{children:[(0,X.jsx)(_.r,{children:"Potvrzen\xed \xfapravy bod\u016f"}),(0,X.jsx)(f.s,{}),(0,X.jsx)(y.c,{children:(0,X.jsxs)(D.T,{align:"stretch",spacing:3,children:[(0,X.jsx)(O.E,{children:"Potvr\u010fte akci zad\xe1n\xedm va\u0161eho administra\u010dn\xedho hesla."}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsxs)(v.l,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,X.jsx)(c.a,{children:"Heslo administr\xe1tora"}),(0,X.jsx)(J.II,{})]}),(0,X.jsx)(b.p,{type:"password",value:G,onChange:e=>Y(e.target.value)})]})]})}),(0,X.jsx)(k.j,{children:(0,X.jsxs)(T.z,{children:[(0,X.jsx)(d.$,{onClick:$.onClose,children:"Zru\u0161it"}),(0,X.jsx)(d.$,{colorScheme:"blue",onClick:()=>Q.mutate(),isLoading:Q.isPending,isDisabled:!G.trim(),children:"Potvrdit"})]})})]})]})]})]})},te=()=>{const e=(0,W.d)(),t=(0,B.jE)(),n=(0,p.dU)("white","gray.800"),te=(0,p.dU)("gray.200","gray.700"),[ne,ae]=i.useState("all"),ie=(0,K.I)({queryKey:["admin-engagement-rewards",ne],queryFn:()=>"all"===ne?(0,V.wl)():(0,V.wl)({active:"active"===ne})}),oe=(0,K.I)({queryKey:["admin-engagement-redemptions"],queryFn:()=>(0,V.ON)()}),[re,se]=i.useState({name:"",type:"merch_digital",cost_points:50,image_url:"",stock:-1,active:!0}),[le,ce]=i.useState(!0),[de,ue]=i.useState([]),[he,me]=i.useState([]),[pe,xe]=i.useState(""),[ge,ve]=i.useState(""),[je,be]=i.useState(null),ye=(0,r.j)(),[fe,ke]=i.useState({}),[_e,we]=i.useState({}),[ze,Se]=i.useState({}),Ae=(0,K.I)({queryKey:["admin-users"],queryFn:V._m,staleTime:3e4}),Ce=i.useMemo(()=>{const e=new Map;return(Ae.data||[]).forEach(t=>e.set(t.id,t)),e},[Ae.data]),Ee=(e,t)=>{const n=(0,a.A)((0,a.A)({},_e),{},{[e]:t});we(n)},Te=(e,t)=>{const n=(0,a.A)((0,a.A)({},ze),{},{[e]:t});Se(n)},De=(0,Z.n)({mutationFn:async()=>{const e=(0,a.A)({},Object.keys(_e).length?_e:{});le&&(delete e.valid_from,delete e.valid_to),de.length&&(e.size=de.join(",")),he.length&&(e.color=he.join(","));const t=Object.keys(e).length?e:void 0;return(0,V.bg)((0,a.A)((0,a.A)({},re),{},{metadata:t}))},onSuccess:async()=>{se({name:"",type:"merch_digital",cost_points:50,image_url:"",stock:-1,active:!0}),ce(!0),ue([]),me([]),xe(""),ve(""),we({}),await t.invalidateQueries({queryKey:["admin-engagement-rewards"]}),e({status:"success",title:"Odm\u011bna vytvo\u0159ena"})},onError:t=>{var n,a;return e({status:"error",title:(null===t||void 0===t?void 0:t.message)||(null===t||void 0===t||null===(n=t.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.error)||"Chyba p\u0159i vytv\xe1\u0159en\xed odm\u011bny"})}}),Ne=(0,Z.n)({mutationFn:e=>(0,V.wK)(e.id,e.body),onSuccess:async()=>{await t.invalidateQueries({queryKey:["admin-engagement-rewards"]}),e({status:"success",title:"Aktualizov\xe1no"})}}),Re=(0,Z.n)({mutationFn:e=>(0,V.aK)(e),onSuccess:async()=>{await t.invalidateQueries({queryKey:["admin-engagement-rewards"]}),e({status:"success",title:"Smaz\xe1no"})}}),Fe=(0,Z.n)({mutationFn:e=>(0,V.M0)(e.id,e.action),onSuccess:async()=>{await t.invalidateQueries({queryKey:["admin-engagement-redemptions"]}),e({status:"success",title:"Status aktualizov\xe1n"})}}),Pe=ie.data||[],Ie=oe.data||[],[Me,Le]=i.useState("points"),[We,Ue]=i.useState([]),[Oe,qe]=i.useState(!1),Ke=i.useMemo(()=>{const e=new Map;for(const t of Pe)e.set(t.id,t);return e},[Pe]);return i.useEffect(()=>{let e=!0;return(async()=>{try{qe(!0);const t=await(0,V.rs)(Me,50);e&&Ue(t.items||[])}catch(t){e&&Ue([])}finally{e&&qe(!1)}})(),()=>{e=!1}},[Me]),(0,X.jsxs)(o.A,{children:[(0,X.jsxs)(c.a,{children:[(0,X.jsx)(U.D,{size:"md",mb:4,children:"Odm\u011bny & \xdasp\u011bchy"}),(0,X.jsxs)(D.T,{align:"stretch",spacing:4,children:[(0,X.jsxs)(c.a,{children:[(0,X.jsx)(U.D,{size:"sm",mb:2,children:"\u017deb\u0159\xed\u010dky"}),(0,X.jsxs)(T.z,{justify:"space-between",mb:2,children:[(0,X.jsx)(O.E,{fontSize:"sm",color:"gray.500",children:"Top u\u017eivatel\xe9 podle zvolen\xe9ho metrick\xe9ho ukazatele"}),(0,X.jsxs)(E.l,{size:"sm",value:Me,onChange:e=>Le(e.target.value),maxW:"180px",children:[(0,X.jsx)("option",{value:"points",children:"Body"}),(0,X.jsx)("option",{value:"level",children:"\xdarove\u0148"}),(0,X.jsx)("option",{value:"xp",children:"XP"})]})]}),(0,X.jsx)(c.a,{borderWidth:"1px",borderRadius:"md",borderColor:te,bg:n,p:3,children:(0,X.jsxs)(D.T,{align:"stretch",spacing:2,children:[Oe&&(0,X.jsx)(O.E,{children:"Na\u010d\xedt\xe1m\u2026"}),!Oe&&0===We.length&&(0,X.jsx)(O.E,{children:"\u017d\xe1dn\xe1 data k zobrazen\xed."}),!Oe&&We.map(e=>{const t="points"===Me?e.points:"level"===Me?e.level:e.xp,n=Math.max(...We.map(e=>"points"===Me?e.points:"level"===Me?e.level:e.xp),1),a=Math.max(2,Math.floor(Number(t)/Number(n)*100)),i="".concat(e.first_name||""," ").concat(e.last_name||"").trim()||e.email||"#".concat(e.user_id);return(0,X.jsxs)(T.z,{spacing:3,children:[(0,X.jsx)(l.E,{colorScheme:"blue",children:e.rank}),(0,X.jsx)(s.e,{size:"sm",name:i,src:e.animated_avatar_url||e.avatar_url||void 0}),(0,X.jsxs)(c.a,{flex:1,children:[(0,X.jsxs)(T.z,{justify:"space-between",children:[(0,X.jsx)(O.E,{fontWeight:"600",noOfLines:1,children:i}),(0,X.jsx)(O.E,{fontSize:"sm",children:t})]}),(0,X.jsx)(C.k,{value:a,size:"sm",colorScheme:"blue",borderRadius:"full",mt:1})]})]},"lb-".concat(Me,"-").concat(e.user_id))})]})})]}),(0,X.jsxs)(c.a,{children:[(0,X.jsxs)(T.z,{justify:"space-between",align:"center",mb:2,children:[(0,X.jsx)(U.D,{size:"sm",children:"Vytvo\u0159it novou odm\u011bnu"}),(0,X.jsx)(J.tX,{label:"Jak nastavit odm\u011bnu",title:"Vytvo\u0159en\xed odm\u011bny pro v\u011brnostn\xed syst\xe9m",items:["Ka\u017ed\xe1 odm\u011bna m\xe1 typ (digit\xe1ln\xed, kupon, fyzick\xfd merch, vlastn\xed), kter\xfd ur\u010duje, jak\xe9 informace je pot\u0159eba vyplnit a co se stane po uplatn\u011bn\xed.","Pole Mno\u017estv\xed/Sklad pou\u017e\xedv\xe1 hodnotu -1 pro neomezen\xfd po\u010det kus\u016f a 0 pro vyprod\xe1no; u povinn\xfdch avatarov\xfdch odm\u011bn je sklad v\u017edy neomezen\xfd.","Cenu v bodech volte konzistentn\u011b s ostatn\xedmi odm\u011bnami, aby m\u011bly fanou\u0161ci jasnou p\u0159edstavu o \u201ehodnot\u011b\u201c bod\u016f."]})]}),(0,X.jsx)(D.T,{align:"stretch",spacing:3,borderWidth:"1px",borderRadius:"md",p:3,children:(0,X.jsxs)(T.z,{align:"start",spacing:4,children:[(0,X.jsxs)(D.T,{align:"stretch",spacing:3,flex:1,children:[(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"N\xe1zev"}),(0,X.jsx)(b.p,{placeholder:"Nap\u0159. Modr\xfd avatar #1",value:re.name,onChange:e=>se((0,a.A)((0,a.A)({},re),{},{name:e.target.value}))})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Typ odm\u011bny"}),(0,X.jsxs)(E.l,{value:re.type,onChange:e=>se((0,a.A)((0,a.A)({},re),{},{type:e.target.value})),children:[(0,X.jsx)("option",{value:"merch_digital",children:"Digit\xe1ln\xed odm\u011bna"}),(0,X.jsx)("option",{value:"merch_coupon",children:"Merch kupon"}),(0,X.jsx)("option",{value:"merch_physical",children:"Merch (fyzick\xfd)"}),(0,X.jsx)("option",{value:"custom",children:"Vlastn\xed"})]}),(0,X.jsx)(g.eK,{children:"Ovliv\u0148uje chov\xe1n\xed po uplatn\u011bn\xed (nap\u0159. nastaven\xed avataru)."})]}),(0,X.jsxs)(T.z,{children:[(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Body"}),(0,X.jsx)(A.Q7,{value:re.cost_points,min:0,onChange:(e,t)=>se((0,a.A)((0,a.A)({},re),{},{cost_points:Number.isFinite(t)?t:0})),children:(0,X.jsx)(A.OO,{placeholder:"Po\u010det bod\u016f"})}),(0,X.jsxs)(g.eK,{children:["~ ",Math.round(.1*Number(re.cost_points||0))," K\u010d"]})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Mno\u017estv\xed/Sklad"}),(0,X.jsxs)(T.z,{children:[(0,X.jsx)(A.Q7,{value:re.stock,min:-1,isDisabled:-1===re.stock,onChange:(e,t)=>se((0,a.A)((0,a.A)({},re),{},{stock:Number.isFinite(t)?t:-1})),children:(0,X.jsx)(A.OO,{placeholder:"Ks (-1 = neomezen\u011b, 0 = vyprod\xe1no)"})}),(0,X.jsxs)(T.z,{children:[(0,X.jsx)(O.E,{fontSize:"sm",children:"Neomezen\u011b"}),(0,X.jsx)(N.d,{isChecked:-1===re.stock,onChange:e=>se(t=>(0,a.A)((0,a.A)({},t),{},{stock:e.target.checked?-1:Math.max(0,-1===Number(t.stock)?0:Number(t.stock)||0)}))})]})]})]})]}),(0,X.jsxs)(D.T,{align:"stretch",spacing:2,mt:2,children:[(0,X.jsxs)(T.z,{children:[(0,X.jsx)(O.E,{children:"Neomezen\xe1 platnost"}),(0,X.jsx)(N.d,{isChecked:le,onChange:e=>{const t=e.target.checked;ce(t),t&&(Ee("valid_from",""),Ee("valid_to",""))}})]}),(0,X.jsxs)(g.MJ,{isDisabled:le,children:[(0,X.jsx)(v.l,{children:"Platnost od"}),(0,X.jsx)(b.p,{type:"datetime-local",value:_e.valid_from||"",onChange:e=>Ee("valid_from",e.target.value)})]}),(0,X.jsxs)(g.MJ,{isDisabled:le,children:[(0,X.jsx)(v.l,{children:"Platnost do"}),(0,X.jsx)(b.p,{type:"datetime-local",value:_e.valid_to||"",onChange:e=>Ee("valid_to",e.target.value)}),(0,X.jsx)(g.eK,{children:"Kdy\u017e je zapnuto \u201eNeomezen\xe1 platnost\u201c, datumy se nevy\u017eaduj\xed a ignoruj\xed."})]})]}),"merch_coupon"===re.type&&(0,X.jsxs)(D.T,{align:"stretch",spacing:2,children:[(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"K\xf3d kuponu"}),(0,X.jsx)(b.p,{value:_e.coupon_code||"",onChange:e=>Ee("coupon_code",e.target.value)})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Pozn\xe1mka"}),(0,X.jsx)(b.p,{value:_e.note||"",onChange:e=>Ee("note",e.target.value)})]})]}),"merch_physical"===re.type&&(0,X.jsxs)(D.T,{align:"stretch",spacing:2,children:[(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Velikosti"}),(0,X.jsx)(m.$,{value:de,onChange:e=>ue(e),children:(0,X.jsx)(q.B,{spacing:3,children:Y.map(e=>(0,X.jsx)(q.Q,{children:(0,X.jsx)(h.S,{value:e,children:e})},e))})}),(0,X.jsxs)(T.z,{mt:1,spacing:2,children:[(0,X.jsx)(b.p,{placeholder:"Vlastn\xed velikosti, odd\u011blte \u010d\xe1rkami",value:pe,onChange:e=>xe(e.target.value)}),(0,X.jsx)(d.$,{size:"sm",onClick:()=>{const e=(pe||"").split(",").map(e=>e.trim()).filter(Boolean);e.length&&(ue(t=>Array.from(new Set([...t,...e]))),xe(""))},children:"P\u0159idat"})]}),(0,X.jsx)(g.eK,{children:"Vyberte z nab\xeddky nebo zadejte vlastn\xed hodnoty, odd\u011blen\xe9 \u010d\xe1rkami (nap\u0159. 122, 128)."})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Barvy"}),(0,X.jsx)(m.$,{value:he,onChange:e=>me(e),children:(0,X.jsx)(q.B,{spacing:3,children:Q.map(e=>(0,X.jsx)(q.Q,{children:(0,X.jsx)(h.S,{value:e,children:e})},e))})}),(0,X.jsxs)(T.z,{mt:1,spacing:2,children:[(0,X.jsx)(b.p,{placeholder:"Vlastn\xed barvy, odd\u011blte \u010d\xe1rkami",value:ge,onChange:e=>ve(e.target.value)}),(0,X.jsx)(d.$,{size:"sm",onClick:()=>{const e=(ge||"").split(",").map(e=>e.trim()).filter(Boolean);e.length&&(me(t=>Array.from(new Set([...t,...e]))),ve(""))},children:"P\u0159idat"})]}),(0,X.jsx)(g.eK,{children:"Vyberte v\xedce mo\u017enost\xed nebo p\u0159idejte vlastn\xed barvy (odd\u011blen\xe9 \u010d\xe1rkami)."})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Pozn\xe1mka"}),(0,X.jsx)(b.p,{value:_e.note||"",onChange:e=>Ee("note",e.target.value)})]})]}),"merch_digital"===re.type&&(0,X.jsxs)(D.T,{align:"stretch",spacing:2,children:[(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Licen\u010dn\xed kl\xed\u010d"}),(0,X.jsx)(b.p,{value:_e.license_key||"",onChange:e=>Ee("license_key",e.target.value)})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Sta\u017een\xed (URL)"}),(0,X.jsx)(b.p,{value:_e.download_url||"",onChange:e=>Ee("download_url",e.target.value)})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Pozn\xe1mka"}),(0,X.jsx)(b.p,{value:_e.note||"",onChange:e=>Ee("note",e.target.value)})]})]}),"custom"===re.type&&(0,X.jsx)(D.T,{align:"stretch",spacing:2,children:(0,X.jsxs)(T.z,{children:[(0,X.jsx)(b.p,{placeholder:"kl\xed\u010d",id:"kv-key"}),(0,X.jsx)(b.p,{placeholder:"hodnota",id:"kv-value"}),(0,X.jsx)(d.$,{size:"sm",onClick:()=>{var e,t,n,a;const i=null===(e=document.getElementById("kv-key"))||void 0===e||null===(t=e.value)||void 0===t?void 0:t.trim(),o=null===(n=document.getElementById("kv-value"))||void 0===n||null===(a=n.value)||void 0===a?void 0:a.trim();i&&Ee(i,o||"")},children:"P\u0159idat"})]})}),(0,X.jsxs)(T.z,{children:[(0,X.jsx)(O.E,{children:"Aktivn\xed"}),(0,X.jsx)(N.d,{isChecked:re.active,onChange:e=>se((0,a.A)((0,a.A)({},re),{},{active:e.target.checked}))}),(0,X.jsx)(d.$,{colorScheme:"blue",onClick:()=>De.mutate(),isLoading:De.isPending,isDisabled:!re.name.trim(),children:"Vytvo\u0159it"})]})]}),(0,X.jsxs)(c.a,{children:[(0,X.jsx)(O.E,{fontSize:"sm",mb:2,color:"gray.500",children:"N\xe1hled"}),(0,X.jsx)(c.a,{borderWidth:"1px",borderRadius:"md",p:2,children:re.image_url?(0,X.jsx)(j._,{src:(0,$.uq)(re.image_url),alt:re.name,boxSize:"96px",objectFit:"cover",borderRadius:"md"}):(0,X.jsx)(c.a,{boxSize:"96px",borderWidth:"1px",borderRadius:"md",display:"flex",alignItems:"center",justifyContent:"center",color:"gray.400",children:"Bez obr\xe1zku"})})]})]})})]}),(0,X.jsx)(x.c,{}),(0,X.jsxs)(c.a,{children:[(0,X.jsx)(U.D,{size:"sm",mb:2,children:"Odm\u011bny"}),(0,X.jsxs)(T.z,{mb:2,children:[(0,X.jsx)(O.E,{fontSize:"sm",color:"gray.500",children:"Filtrovat:"}),(0,X.jsxs)(E.l,{size:"sm",value:ne,onChange:e=>ae(e.target.value),maxW:"200px",children:[(0,X.jsx)("option",{value:"all",children:"V\u0161e"}),(0,X.jsx)("option",{value:"active",children:"Pouze aktivn\xed"}),(0,X.jsx)("option",{value:"inactive",children:"Pouze neaktivn\xed"})]})]}),(0,X.jsx)(c.a,{borderWidth:"1px",borderRadius:"md",overflowX:"auto",children:(0,X.jsxs)(R.X,{size:"sm",children:[(0,X.jsx)(M.d,{children:(0,X.jsxs)(L.Tr,{children:[(0,X.jsx)(I.Th,{children:"ID"}),(0,X.jsx)(I.Th,{children:"N\xe1zev"}),(0,X.jsx)(I.Th,{children:"Typ"}),(0,X.jsx)(I.Th,{children:"Body"}),(0,X.jsx)(I.Th,{children:"Mno\u017estv\xed/Sklad"}),(0,X.jsx)(I.Th,{children:"Obr\xe1zek"}),(0,X.jsx)(I.Th,{children:"Platnost"}),(0,X.jsx)(I.Th,{children:"Aktivn\xed"}),(0,X.jsx)(I.Th,{children:"Akce"})]})}),(0,X.jsx)(F.N,{children:Pe.map(e=>{var t,n,i;return(0,X.jsxs)(L.Tr,{children:[(0,X.jsxs)(P.Td,{children:["#",e.id]}),(0,X.jsx)(P.Td,{children:(0,X.jsxs)(D.T,{align:"start",spacing:0,children:[(0,X.jsx)(O.E,{children:e.name}),"merch_physical"===e.type&&null!==(t=e.metadata)&&void 0!==t&&t.sku?(0,X.jsxs)(T.z,{spacing:1,children:[(0,X.jsxs)(O.E,{fontSize:"xs",color:"gray.500",children:["SKU: ",e.metadata.sku]}),(0,X.jsx)(u.K,{"aria-label":"Kop\xedrovat SKU",size:"xs",variant:"ghost",icon:(0,X.jsx)(H.nxz,{}),onClick:()=>{var t;return null===(t=navigator.clipboard)||void 0===t?void 0:t.writeText(String(e.metadata.sku||""))}})]}):null]})}),(0,X.jsx)(P.Td,{children:(0,X.jsx)(l.E,{children:e.type})}),(0,X.jsx)(P.Td,{children:(0,X.jsx)(A.Q7,{size:"sm",value:e.cost_points,min:0,maxW:"120px",isDisabled:!!e.type&&e.type.startsWith("avatar_"),onChange:(t,n)=>Ne.mutate({id:e.id,body:{cost_points:Number.isFinite(n)?n:0}}),children:(0,X.jsx)(A.OO,{})})}),(0,X.jsx)(P.Td,{children:(0,X.jsx)(A.Q7,{size:"sm",value:null!==(n=e.stock)&&void 0!==n?n:0,min:-1,maxW:"100px",isDisabled:!!e.type&&e.type.startsWith("avatar_"),onChange:(t,n)=>Ne.mutate({id:e.id,body:{stock:Number.isFinite(n)?n:0}}),children:(0,X.jsx)(A.OO,{})})}),(0,X.jsx)(P.Td,{children:e.image_url?(0,X.jsx)(j._,{src:(0,$.uq)(e.image_url),alt:e.name,boxSize:"40px",objectFit:"cover",borderRadius:"md"}):"-"}),(0,X.jsx)(P.Td,{children:(()=>{const t=e.metadata||{},n=t.valid_from?new Date(t.valid_from):null,a=t.valid_to?new Date(t.valid_to):null;return n||a?(0,X.jsxs)(D.T,{align:"start",spacing:0,children:[n&&(0,X.jsxs)(O.E,{fontSize:"xs",children:["od ",n.toLocaleString()]}),a&&(0,X.jsxs)(O.E,{fontSize:"xs",children:["do ",a.toLocaleString()]})]}):(0,X.jsx)(O.E,{color:"gray.500",children:"-"})})()}),(0,X.jsx)(P.Td,{children:(0,X.jsx)(N.d,{isChecked:!!e.active,isDisabled:!!e.type&&e.type.startsWith("avatar_"),onChange:t=>Ne.mutate({id:e.id,body:{active:t.target.checked}})})}),(0,X.jsx)(P.Td,{children:(0,X.jsxs)(T.z,{children:[(0,X.jsx)(u.K,{"aria-label":"Upravit",size:"xs",icon:(0,X.jsx)(H.WXf,{}),onClick:()=>{be(e),ke(e);const t=e.metadata||{},n=(0,a.A)({},t);try{"string"===typeof t.size&&(n.__size_list=String(t.size).split(",").map(e=>e.trim()).filter(Boolean))}catch(i){}try{"string"===typeof t.color&&(n.__color_list=String(t.color).split(",").map(e=>e.trim()).filter(Boolean))}catch(o){}Se(n),ye.onOpen()}}),!(null!==(i=e.type)&&void 0!==i&&i.startsWith("avatar_"))&&(0,X.jsx)(u.K,{"aria-label":"Smazat",size:"xs",icon:(0,X.jsx)(H.IXo,{}),onClick:()=>Re.mutate(e.id)})]})})]},e.id)})})]})})]}),(0,X.jsxs)(c.a,{children:[(0,X.jsxs)(T.z,{justify:"space-between",align:"center",mt:6,mb:2,children:[(0,X.jsx)(U.D,{size:"sm",children:"Uplatn\u011bn\xed odm\u011bn"}),(0,X.jsx)(J.tX,{label:"Jak pracovat s uplatn\u011bn\xedm",title:"Vy\u0159\xedzen\xed po\u017eadavk\u016f na odm\u011bny",items:["Zde vid\xedte po\u017eadavky u\u017eivatel\u016f na vyd\xe1n\xed odm\u011bn \u2013 ka\u017ed\xfd z\xe1znam odpov\xedd\xe1 konkr\xe9tn\xed odm\u011bn\u011b a u\u017eivateli.","Akce Schv\xe1lit/Zam\xedtnout/Vydat pom\xe1haj\xed sledovat stav vy\u0159\xedzen\xed (nap\u0159. fyzick\xe9 p\u0159ed\xe1n\xed merchu nebo zasl\xe1n\xed kuponu).","Doporu\u010dujeme, aby zm\u011bny stav\u016f prov\xe1d\u011bli pouze administr\xe1to\u0159i \u2013 kv\u016fli konzistenci bod\u016f a auditovatelnosti."]})]}),(0,X.jsx)(c.a,{borderWidth:"1px",borderRadius:"md",overflowX:"auto",children:(0,X.jsxs)(R.X,{size:"sm",children:[(0,X.jsx)(M.d,{children:(0,X.jsxs)(L.Tr,{children:[(0,X.jsx)(I.Th,{children:"ID"}),(0,X.jsx)(I.Th,{children:"U\u017eivatel"}),(0,X.jsx)(I.Th,{children:"Odm\u011bna"}),(0,X.jsx)(I.Th,{children:"Vytvo\u0159eno"}),(0,X.jsx)(I.Th,{children:"Status"}),(0,X.jsx)(I.Th,{children:"Akce"})]})}),(0,X.jsx)(F.N,{children:Ie.map(e=>{var t,n,a,i,o,r;return(0,X.jsxs)(L.Tr,{children:[(0,X.jsxs)(P.Td,{children:["#",e.id]}),(0,X.jsx)(P.Td,{children:null!==(t=Ce.get(e.user_id))&&void 0!==t&&t.name?(0,X.jsxs)(T.z,{spacing:1,children:[(0,X.jsx)(O.E,{noOfLines:1,children:null===(n=Ce.get(e.user_id))||void 0===n?void 0:n.name}),(0,X.jsxs)(O.E,{color:"gray.500",fontSize:"xs",children:["#",e.user_id]})]}):(0,X.jsxs)(O.E,{children:["#",e.user_id]})}),(0,X.jsx)(P.Td,{children:(0,X.jsxs)(T.z,{children:[(0,X.jsxs)(O.E,{children:["#",e.reward_id]}),(null===(a=Ke.get(e.reward_id))||void 0===a?void 0:a.name)&&(0,X.jsxs)(O.E,{as:"span",children:["\u2013 ",null===(i=Ke.get(e.reward_id))||void 0===i?void 0:i.name]}),(null===(o=Ke.get(e.reward_id))||void 0===o?void 0:o.type)&&(0,X.jsx)(l.E,{children:null===(r=Ke.get(e.reward_id))||void 0===r?void 0:r.type})]})}),(0,X.jsx)(P.Td,{children:e.created_at?new Date(e.created_at).toLocaleString():"-"}),(0,X.jsx)(P.Td,{children:(0,X.jsx)(l.E,{colorScheme:"approved"===e.status?"blue":"fulfilled"===e.status?"green":"rejected"===e.status?"red":"gray",children:e.status})}),(0,X.jsx)(P.Td,{children:(0,X.jsxs)(T.z,{children:[(0,X.jsx)(d.$,{size:"xs",variant:"outline",onClick:()=>Fe.mutate({id:e.id,action:"approve"}),children:"Schv\xe1lit"}),(0,X.jsx)(d.$,{size:"xs",variant:"outline",colorScheme:"red",onClick:()=>Fe.mutate({id:e.id,action:"reject"}),children:"Zam\xedtnout"}),(0,X.jsx)(d.$,{size:"xs",variant:"outline",colorScheme:"green",onClick:()=>Fe.mutate({id:e.id,action:"fulfill"}),children:"Vydat"})]})})]},e.id)})})]})})]}),(0,X.jsxs)(c.a,{children:[(0,X.jsxs)(T.z,{justify:"space-between",align:"center",mt:6,mb:2,children:[(0,X.jsx)(U.D,{size:"sm",children:"Transakce bod\u016f & \xdapravy"}),(0,X.jsx)(J.tX,{label:"Jak pracovat s body",title:"Transakce bod\u016f a ru\u010dn\xed \xfapravy",items:["Transakce ukazuj\xed historii pohyb\u016f bod\u016f (z\xedskan\xe9, utracen\xe9, ru\u010dn\u011b upraven\xe9) pro jednotliv\xe9 u\u017eivatele.","Ru\u010dn\xed \xfapravy bod\u016f pou\u017e\xedvejte v\xfdjime\u010dn\u011b \u2013 nap\u0159\xedklad k oprav\u011b chyb nebo speci\xe1ln\xedm odm\u011bn\xe1m mimo b\u011b\u017en\xe1 pravidla.","Pro dlouhodobou konzistenci je vhodn\xe9 m\xedt v t\xfdmu jasn\xe1 pravidla, kdo m\u016f\u017ee body upravovat a za jak\xfdch podm\xednek."]})]}),(0,X.jsx)(ee,{})]})]})]}),(0,X.jsxs)(z.aF,{isOpen:ye.isOpen,onClose:ye.onClose,isCentered:!0,children:[(0,X.jsx)(w.m,{}),(0,X.jsxs)(S.$,{children:[(0,X.jsxs)(_.r,{children:["Upravit odm\u011bnu #",null===je||void 0===je?void 0:je.id]}),(0,X.jsx)(f.s,{}),(0,X.jsx)(y.c,{children:(0,X.jsxs)(D.T,{align:"stretch",spacing:3,children:[(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"N\xe1zev"}),(0,X.jsx)(b.p,{value:fe.name||"",onChange:e=>ke((0,a.A)((0,a.A)({},fe),{},{name:e.target.value})),isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_")})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Typ"}),(0,X.jsxs)(E.l,{value:fe.type||"",onChange:e=>ke((0,a.A)((0,a.A)({},fe),{},{type:e.target.value})),isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_"),children:[(0,X.jsx)("option",{value:"merch_digital",children:"Digit\xe1ln\xed odm\u011bna"}),(0,X.jsx)("option",{value:"merch_coupon",children:"Merch kupon"}),(0,X.jsx)("option",{value:"merch_physical",children:"Merch (fyzick\xfd)"}),(0,X.jsx)("option",{value:"custom",children:"Vlastn\xed"})]})]}),(0,X.jsxs)(T.z,{children:[(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Body"}),(0,X.jsx)(A.Q7,{value:Number(fe.cost_points||0),min:0,onChange:(e,t)=>ke((0,a.A)((0,a.A)({},fe),{},{cost_points:Number.isFinite(t)?t:0})),isDisabled:!je||!!je.type&&!je.type.startsWith("avatar_")&&!1,children:(0,X.jsx)(A.OO,{})}),(0,X.jsxs)(g.eK,{children:["~ ",Math.round(.1*Number(fe.cost_points||0))," K\u010d"]})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Mno\u017estv\xed/Sklad"}),(0,X.jsxs)(T.z,{children:[(0,X.jsx)(A.Q7,{value:Number(fe.stock||0),min:-1,isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_")||-1===Number(fe.stock),onChange:(e,t)=>ke((0,a.A)((0,a.A)({},fe),{},{stock:Number.isFinite(t)?t:0})),children:(0,X.jsx)(A.OO,{})}),(0,X.jsxs)(T.z,{children:[(0,X.jsx)(O.E,{fontSize:"sm",children:"Neomezen\u011b"}),(0,X.jsx)(N.d,{isChecked:-1===Number(fe.stock),onChange:e=>ke(t=>(0,a.A)((0,a.A)({},t),{},{stock:e.target.checked?-1:Math.max(0,-1===Number(t.stock)?0:Number(t.stock)||0)})),isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_")})]})]}),(0,X.jsx)(g.eK,{children:"-1 = neomezen\u011b, 0 = vyprod\xe1no."})]})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Obr\xe1zek URL"}),(0,X.jsx)(b.p,{value:fe.image_url||"",onChange:e=>ke((0,a.A)((0,a.A)({},fe),{},{image_url:e.target.value})),isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_")}),(0,X.jsx)(g.eK,{children:"Vlo\u017ete URL z /uploads nebo nahr\xe1vac\xed tla\u010d\xedtko (proxy na frontend funguje)."}),(!(null!==je&&void 0!==je&&je.type)||!je.type.startsWith("avatar_"))&&(0,X.jsx)(c.a,{mt:2,children:(0,X.jsx)(G.A,{label:"Nahr\xe1t obr\xe1zek",description:"Nahrajte obr\xe1zek odm\u011bny.",accept:"image/*",multiple:!1,maxFiles:1,onUploadFinished:e=>{const t=e[e.length-1];t&&ke(e=>(0,a.A)((0,a.A)({},e),{},{image_url:t.url}))}})})]}),("merch_coupon"===fe.type||"merch_physical"===fe.type||"merch_digital"===fe.type||"custom"===fe.type)&&(0,X.jsxs)(D.T,{align:"stretch",spacing:2,children:["merch_coupon"===fe.type&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"K\xf3d kuponu"}),(0,X.jsx)(b.p,{isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_"),value:ze.coupon_code||"",onChange:e=>Te("coupon_code",e.target.value)})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Pozn\xe1mka"}),(0,X.jsx)(b.p,{isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_"),value:ze.note||"",onChange:e=>Te("note",e.target.value)})]})]}),"merch_physical"===fe.type&&(0,X.jsxs)(X.Fragment,{children:[null!==ze&&void 0!==ze&&ze.sku?(0,X.jsxs)(T.z,{spacing:2,children:[(0,X.jsxs)(O.E,{fontSize:"sm",color:"gray.500",children:["K\xf3d (SKU): ",ze.sku]}),(0,X.jsx)(u.K,{"aria-label":"Kop\xedrovat SKU",size:"xs",variant:"ghost",icon:(0,X.jsx)(H.nxz,{}),onClick:()=>{var e;return null===(e=navigator.clipboard)||void 0===e?void 0:e.writeText(String(ze.sku||""))}})]}):null,(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Velikosti"}),(0,X.jsx)(m.$,{value:ze.__size_list||[],onChange:e=>{const t=e;Se(e=>(0,a.A)((0,a.A)({},e),{},{__size_list:t}))},children:(0,X.jsx)(q.B,{spacing:3,children:Y.map(e=>(0,X.jsx)(q.Q,{children:(0,X.jsx)(h.S,{value:e,isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_"),children:e})},e))})}),(0,X.jsxs)(T.z,{mt:1,spacing:2,children:[(0,X.jsx)(b.p,{placeholder:"Vlastn\xed velikosti, odd\u011blte \u010d\xe1rkami",isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_"),value:ze.__size_custom||"",onChange:e=>Te("__size_custom",e.target.value)}),(0,X.jsx)(d.$,{size:"sm",isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_"),onClick:()=>{const e=String(ze.__size_custom||"").split(",").map(e=>e.trim()).filter(Boolean),t=Array.isArray(ze.__size_list)?ze.__size_list:[],n=Array.from(new Set([...t,...e]));Se(e=>(0,a.A)((0,a.A)({},e),{},{__size_list:n,__size_custom:""}))},children:"P\u0159idat"})]}),(0,X.jsx)(g.eK,{children:"Vyberte z nab\xeddky nebo p\u0159idejte vlastn\xed hodnoty (odd\u011blen\xe9 \u010d\xe1rkami)."})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Barvy"}),(0,X.jsx)(m.$,{value:ze.__color_list||[],onChange:e=>{const t=e;Se(e=>(0,a.A)((0,a.A)({},e),{},{__color_list:t}))},children:(0,X.jsx)(q.B,{spacing:3,children:Q.map(e=>(0,X.jsx)(q.Q,{children:(0,X.jsx)(h.S,{value:e,isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_"),children:e})},e))})}),(0,X.jsxs)(T.z,{mt:1,spacing:2,children:[(0,X.jsx)(b.p,{placeholder:"Vlastn\xed barvy, odd\u011blte \u010d\xe1rkami",isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_"),value:ze.__color_custom||"",onChange:e=>Te("__color_custom",e.target.value)}),(0,X.jsx)(d.$,{size:"sm",isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_"),onClick:()=>{const e=String(ze.__color_custom||"").split(",").map(e=>e.trim()).filter(Boolean),t=Array.isArray(ze.__color_list)?ze.__color_list:[],n=Array.from(new Set([...t,...e]));Se(e=>(0,a.A)((0,a.A)({},e),{},{__color_list:n,__color_custom:""}))},children:"P\u0159idat"})]}),(0,X.jsx)(g.eK,{children:"Vyberte v\xedce mo\u017enost\xed nebo p\u0159idejte vlastn\xed barvy (odd\u011blen\xe9 \u010d\xe1rkami)."})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Pozn\xe1mka"}),(0,X.jsx)(b.p,{isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_"),value:ze.note||"",onChange:e=>Te("note",e.target.value)})]})]}),"merch_digital"===fe.type&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Licen\u010dn\xed kl\xed\u010d"}),(0,X.jsx)(b.p,{isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_"),value:ze.license_key||"",onChange:e=>Te("license_key",e.target.value)})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Sta\u017een\xed (URL)"}),(0,X.jsx)(b.p,{isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_"),value:ze.download_url||"",onChange:e=>Te("download_url",e.target.value)})]}),(0,X.jsxs)(g.MJ,{children:[(0,X.jsx)(v.l,{children:"Pozn\xe1mka"}),(0,X.jsx)(b.p,{isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_"),value:ze.note||"",onChange:e=>Te("note",e.target.value)})]})]}),"custom"===fe.type&&(0,X.jsxs)(T.z,{children:[(0,X.jsx)(b.p,{placeholder:"kl\xed\u010d",id:"edit-kv-key",isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_")}),(0,X.jsx)(b.p,{placeholder:"hodnota",id:"edit-kv-value",isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_")}),(0,X.jsx)(d.$,{size:"sm",isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_"),onClick:()=>{var e,t,n,a;const i=null===(e=document.getElementById("edit-kv-key"))||void 0===e||null===(t=e.value)||void 0===t?void 0:t.trim(),o=null===(n=document.getElementById("edit-kv-value"))||void 0===n||null===(a=n.value)||void 0===a?void 0:a.trim();i&&Te(i,o||"")},children:"P\u0159idat"})]})]}),(0,X.jsxs)(D.T,{align:"stretch",spacing:2,children:[(0,X.jsxs)(T.z,{children:[(0,X.jsx)(O.E,{children:"Neomezen\xe1 platnost"}),(0,X.jsx)(N.d,{isChecked:!ze.valid_from&&!ze.valid_to,onChange:e=>{e.target.checked&&Se(e=>(0,a.A)((0,a.A)({},e),{},{valid_from:"",valid_to:""}))},isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_")})]}),(0,X.jsxs)(g.MJ,{isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_")||!ze.valid_from&&!ze.valid_to,children:[(0,X.jsx)(v.l,{children:"Platnost od"}),(0,X.jsx)(b.p,{type:"datetime-local",value:ze.valid_from||"",onChange:e=>Te("valid_from",e.target.value)})]}),(0,X.jsxs)(g.MJ,{isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_")||!ze.valid_from&&!ze.valid_to,children:[(0,X.jsx)(v.l,{children:"Platnost do"}),(0,X.jsx)(b.p,{type:"datetime-local",value:ze.valid_to||"",onChange:e=>Te("valid_to",e.target.value)}),(0,X.jsx)(g.eK,{children:"Kdy\u017e je zapnuto \u201eNeomezen\xe1 platnost\u201c, datumy se nevy\u017eaduj\xed a ignoruj\xed."})]})]}),(0,X.jsxs)(T.z,{children:[(0,X.jsx)(O.E,{children:"Aktivn\xed"}),(0,X.jsx)(N.d,{isChecked:!!fe.active,onChange:e=>ke((0,a.A)((0,a.A)({},fe),{},{active:e.target.checked})),isDisabled:!(null===je||void 0===je||!je.type)&&je.type.startsWith("avatar_")}),fe.image_url?(0,X.jsx)(j._,{src:(0,$.uq)(String(fe.image_url)),alt:String(fe.name||""),boxSize:"56px",objectFit:"cover",borderRadius:"md"}):null]})]})}),(0,X.jsx)(k.j,{children:(0,X.jsxs)(T.z,{children:[(0,X.jsx)(d.$,{onClick:ye.onClose,children:"Zru\u0161it"}),(0,X.jsx)(d.$,{colorScheme:"blue",isLoading:Ne.isPending,onClick:async()=>{if(je){if(je.type&&je.type.startsWith("avatar_"))await Ne.mutateAsync({id:je.id,body:{cost_points:fe.cost_points}});else{const e=(0,a.A)({},Object.keys(ze||{}).length?ze:{}),t=Array.isArray(e.__size_list)?e.__size_list:[],n=Array.isArray(e.__color_list)?e.__color_list:[];t.length&&(e.size=t.join(",")),n.length&&(e.color=n.join(",")),delete e.__size_list,delete e.__size_custom,delete e.__color_list,delete e.__color_custom;!e.valid_from&&!e.valid_to&&(delete e.valid_from,delete e.valid_to),await Ne.mutateAsync({id:je.id,body:{name:fe.name,type:fe.type,cost_points:fe.cost_points,stock:fe.stock,image_url:fe.image_url,active:fe.active,metadata:Object.keys(e).length?e:void 0}})}ye.onClose()}},children:"Ulo\u017eit"})]})})]})]})]})}},27793:(e,t,n)=>{n.r(t),n.d(t,{default:()=>g});var a=n(22107),i=n(98662),o=n(82459),r=n(25011),s=n(96148),l=n(10202),c=n(28846),d=n(39081),u=n(73216),h=n(35475),m=n(8860),p=n(40378),x=n(70579);const g=()=>{(0,u.zy)();const e=(0,u.Zp)();return(0,x.jsx)(p.A,{children:(0,x.jsx)(a.a,{minH:"60vh",display:"flex",alignItems:"center",justifyContent:"center",bgGradient:"linear(to-b, rgba(0,0,0,0.02), transparent)",px:6,children:(0,x.jsx)(a.a,{w:{base:"100%",sm:"560px"},textAlign:"center",bg:"white",_dark:{bg:"gray.800"},borderRadius:"xl",borderWidth:"1px",borderColor:"border.subtle",boxShadow:"md",p:{base:6,md:10},children:(0,x.jsxs)(l.T,{spacing:4,children:[(0,x.jsxs)(s.z,{spacing:3,color:"brand.primary",children:[(0,x.jsx)(r.I,{as:m.Rmk,boxSize:8}),(0,x.jsx)(c.D,{as:"h1",size:"2xl",letterSpacing:"wide",children:"403"}),(0,x.jsx)(r.I,{as:m.zIu,boxSize:8})]}),(0,x.jsx)(c.D,{as:"h2",size:"lg",bgGradient:"linear(to-r, brand.primary, brand.accent)",bgClip:"text",children:"P\u0159\xedstup odep\u0159en"}),(0,x.jsx)(d.E,{color:"gray.600",_dark:{color:"gray.300"},children:"Rozhod\u010d\xed p\xedsk\xe1: tato \u010d\xe1st h\u0159i\u0161t\u011b je jen pro kapit\xe1ny (adminy)."}),(0,x.jsx)(o.c,{}),(0,x.jsxs)(s.z,{spacing:3,pt:2,children:[(0,x.jsx)(i.$,{onClick:()=>e(-1),colorScheme:"blue",children:"Zp\u011bt"}),(0,x.jsx)(i.$,{as:h.N_,to:"/",variant:"outline",children:"Zp\u011bt na \xfavod"})]})]})})})})}},28465:(e,t,n)=>{n.r(t),n.d(t,{default:()=>K});var a=n(89379),i=n(65043),o=n(30502),r=n(44093),s=n(3109),l=n(31411),c=n(14566),d=n(51794),u=n(10227),h=n(78460),m=n(85421),p=n(15071),x=n(35929),g=n(67516),v=n(10202),j=n(5371),b=n(87139),y=n(33572),f=n(22107),k=n(39081),_=n(43533),w=n(28846),z=n(35699),S=n(98662),A=n(56529),C=n(40378),E=n(74770),T=n(70082),D=n(85638),N=n(25189),R=n(39183),F=(n(11711),n(46291));const P=async e=>{try{const t=(e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(F.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}})(e),n=await fetch(t,{cache:"no-cache"});return n.ok?await n.json():null}catch(t){return null}},I=async()=>{const[e,t]=await Promise.all([P("/api/v1/matches"),P("/api/v1/matches/history")]),n={},i=e=>{if(Array.isArray(e))for(const t of e){const e=String((null===t||void 0===t?void 0:t.match_id)||(null===t||void 0===t?void 0:t.id)||"").trim();e&&(n[e]?n[e]=(0,a.A)((0,a.A)({},n[e]),t):n[e]=t)}};return i(e),i(t),n};var M=n(74117),L=n(71942),W=n(69023),U=n(92410),O=n(6175),q=n(70579);const K=()=>{const{t:e}=(0,M.Bd)(),[t,n]=(0,i.useState)(""),[P,K]=(0,i.useState)(""),[B,Z]=(0,i.useState)("football"),[V,H]=(0,i.useState)([]),[$,J]=(0,i.useState)(0),[G,X]=(0,i.useState)(!1),[Y,Q]=(0,i.useState)(null),[ee,te]=(0,i.useState)([]),[ne,ae]=(0,i.useState)({}),[ie,oe]=(0,i.useState)(!0),[re,se]=(0,i.useState)({}),le=12,ce=(0,o.d)(),[de,ue]=(0,i.useState)(""),[he,me]=(0,i.useState)(!1),pe=(0,r.dU)("#f8f9fb","#0f1115"),xe=(0,r.dU)("#fff","#1a1d29"),ge=(0,r.dU)("#e5e7eb","#2a2e3a"),ve=(0,r.dU)("#1a1a1a","#e8eaf0"),je=(0,r.dU)("#666","#9ca3af"),be=(0,r.dU)("#000","#fff"),ye=(e,t)=>{console.log("Team clicked:",e,t)},fe=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:35;if(!e)return e;const n=(0,N.Lt)(e);return n.length<=t?n:n.substring(0,t).trim()+"\u2026"},ke=(e,t)=>{try{return new Date("".concat(e,"T").concat(t,":00")).toLocaleDateString("cs-CZ",{day:"numeric",month:"numeric",year:"numeric"})}catch(n){return e}},_e=e=>{let t=(e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase())(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,""),t.replace(/\s+/g," ").trim()},we=e=>{try{const n=_e(e),a=_e(t||"");if(!n||!a)return!1;const i=n.replace(/\bfk\b/g,"").replace(/\bfotbalov\xfd\s+klub\b/g,"").trim(),o=a.replace(/\bfk\b/g,"").replace(/\bfotbalov\xfd\s+klub\b/g,"").trim();return n===a||n.endsWith(a)||a.endsWith(n)||i===o||i.endsWith(o)||o.endsWith(i)}catch(n){return!1}},ze=t=>{const n=(e=>{if(!e)return null;const t=e.match(/^(\d+)\s*[:\-]\s*(\d+)$/);return t?{h:parseInt(t[1],10),a:parseInt(t[2],10)}:null})(t.score);if(!n)return null;let a=!1,i=!1;if(P&&(t.home_id&&(a=t.home_id===P),t.away_id&&(i=t.away_id===P)),a||i||(a=we(t.home),i=we(t.away)),!a&&!i)return null;if(n.h===n.a)return{label:e("matches.draw"),colorScheme:"blue"};return(a?n.h:n.a)>(a?n.a:n.h)?{label:e("matches.win"),colorScheme:"green"}:{label:e("matches.loss"),colorScheme:"red"}},Se=((0,i.useMemo)(()=>Date.now(),[]),(0,i.useMemo)(()=>{const t=V.map(e=>(0,a.A)((0,a.A)({},e),{},{matches:[...e.matches].sort((e,t)=>{const n=new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime(),a=new Date("".concat(t.date,"T").concat(t.time||"00:00",":00")).getTime();return ie?n-a:a-n})}));if(t.length>0){const n=t.flatMap(e=>e.matches.map(t=>(0,a.A)((0,a.A)({},t),{},{competitionName:e.name})));return n.sort((e,t)=>{const n=new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime(),a=new Date("".concat(t.date,"T").concat(t.time||"00:00",":00")).getTime();return ie?n-a:a-n}),[{name:e("matches.all_categories"),matches:n,matches_link:void 0},...t]}return t},[V,ie]));(0,i.useEffect)(()=>{const e={};Se.forEach((t,n)=>{void 0===re[n]&&(e[n]=le)}),Object.keys(e).length>0&&se(t=>(0,a.A)((0,a.A)({},t),e))},[Se.length]);const Ae=(0,i.useMemo)(()=>{if($>=Se.length)return[];const e=Se[$],t=Date.now();return((null===e||void 0===e?void 0:e.matches)||[]).filter(e=>new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime()>t)},[Se,$]),Ce=(0,R.M)(Ae,3e4);return(0,i.useEffect)(()=>{let e=!1;const t=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(F.API_URL,"undefined"!==typeof window?window.location.origin:void 0);return new URL(e,"".concat(t.protocol,"//").concat(t.host)).toString()}return e}catch(t){return e}},a=async e=>{try{const n=await fetch(t(e),{cache:"no-cache"});if(!n.ok)throw new Error("HTTP ".concat(n.status));return await n.json()}catch(n){return null}};return(async()=>{const[i,o,r,s,l]=await Promise.all([a("/cache/prefetch/settings.json"),a("/cache/prefetch/facr_club_info.json"),a("/api/v1/public/team-logo-overrides?t=".concat(Date.now())),a("/cache/prefetch/team_logo_overrides.json"),I().catch(()=>({}))]);let c=[];try{c=await(0,T.xN)()}catch(m){}const d={};(c||[]).forEach(e=>{null!==e&&void 0!==e&&e.code&&null!==e&&void 0!==e&&e.alias&&(d[e.code]={alias:e.alias,original_name:e.original_name,display_order:e.display_order})});let u=null;try{u=await(0,E.l3)()}catch(p){}if(!e){var h;te(c||[]),ae(d);const e=l||{},a=r&&(r.by_name||r.by_id)?r:s||{},m=(null===a||void 0===a?void 0:a.by_name)||{},p=(null===a||void 0===a?void 0:a.by_id)||{},x=e=>String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),g=e=>{let t=x(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,"").replace(/\s+/g," ").trim(),t},v=Object.keys(m||{}).reduce((e,t)=>(e[x(t)]=m[t],e),{}),j=Object.keys(m||{}).map(e=>({keyNorm:g(e),url:m[e]})),b=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[\u2012\u2013\u2014\u2015\u2212]/g,"-").replace(/\bn\.?\b/g," nad ").replace(/\bp\.?\b/g," pod ").replace(/[\,\s]*(z\.?\s*s\.?|o\.?\s*s\.?)\s*$/g,"").replace(/[\.,!;:()\[\]{}]/g," ").replace(/\s+/g," ").trim().toLowerCase(),y=(()=>{const e={};for(const n of Object.values(p||{})){const t=String((null===n||void 0===n?void 0:n.name)||"").trim(),a=String((null===n||void 0===n?void 0:n.logo_url)||"").trim();t&&a&&(e[a]=t)}const t={};for(const[n,a]of Object.entries(m||{})){const i=e[String(a)]||"",o=b(n);i&&o&&(t[o]=i)}return t})(),f=(()=>{const e={};for(const[t,n]of Object.entries(p||{})){const a=String((null===n||void 0===n?void 0:n.name)||"").trim(),i=String((null===n||void 0===n?void 0:n.logo_url)||"").trim();if(!a)continue;const o=b(a);o&&(e[o]={id:t,name:a,logo_url:i})}return e})(),k=(e,t)=>{var n;const a=t?String(t):"";if(a&&null!==p&&void 0!==p&&null!==(n=p[a])&&void 0!==n&&n.name&&String(p[a].name).trim())return String(p[a].name).trim();try{const t=b(e);if(y[t])return y[t];let n=f[t];if(!n)for(const[e,a]of Object.entries(f))if(e&&(t.endsWith(e)||e.endsWith(t))){n=a;break}if(n&&n.name)return String(n.name)}catch(i){}return String(e||"")},_=(e,n)=>{if(e){const n=(m||{})[e],a=x(e);let i=n||v[a];if(!i){const t=g(e);for(const{keyNorm:e,url:n}of j)if(e&&(t.endsWith(e)||e.endsWith(t))){i=n;break}}if(i)return"string"===typeof i&&i.startsWith("/")?t(i):i}if(n)return"string"===typeof n&&n.startsWith("/")?t(n):n},w=(e,n,a)=>{var i;if(n&&null!==p&&void 0!==p&&null!==(i=p[n])&&void 0!==i&&i.logo_url){const e=p[n].logo_url;return"string"===typeof e&&e.startsWith("/")?t(e):e}try{if(n&&null!==z&&void 0!==z&&z.club_id&&String(n)===String(z.club_id)&&null!==z&&void 0!==z&&z.club_logo_url){const e=z.club_logo_url;return"string"===typeof e&&e.startsWith("/")?t(e):e}}catch(o){}return n?"http://logoapi.sportcreative.eu/logos/".concat(n):_(e,a)},z=u||i;if(z){const e=(null===z||void 0===z?void 0:z.club_name)||(null===z||void 0===z?void 0:z.clubName)||"",t=(null===z||void 0===z?void 0:z.club_id)||(null===z||void 0===z?void 0:z.clubId)||"",a=(null===z||void 0===z?void 0:z.club_type)||"football";e&&n(e),t&&K(t),"football"!==a&&"futsal"!==a||Z(a)}if(null!==o&&void 0!==o&&null!==(h=o.competitions)&&void 0!==h&&h.length){const t=(o.competitions||[]).map(t=>{var n,a,i,o,r,s,l;return{name:(null===d||void 0===d||null===(n=d[null===t||void 0===t?void 0:t.code])||void 0===n?void 0:n.alias)||(null===d||void 0===d||null===(a=d[null===t||void 0===t?void 0:t.id])||void 0===a?void 0:a.alias)||t.name||t.code||"Sout\u011b\u017e",alias:(null===d||void 0===d||null===(i=d[null===t||void 0===t?void 0:t.code])||void 0===i?void 0:i.alias)||(null===d||void 0===d||null===(o=d[null===t||void 0===t?void 0:t.id])||void 0===o?void 0:o.alias),display_order:null!==(r=null===d||void 0===d||null===(s=d[null===t||void 0===t?void 0:t.code])||void 0===s?void 0:s.display_order)&&void 0!==r?r:null===d||void 0===d||null===(l=d[null===t||void 0===t?void 0:t.id])||void 0===l?void 0:l.display_order,matches_link:t.matches_link,matches:(Array.isArray(t.matches)?t.matches:[]).map((n,a)=>{const i=String(n.match_id||n.id||"").trim(),o=i?e[i]:void 0;let r=String(o&&(o.date_time||o.date)||n.date_time||"");if(r&&!r.includes("."))try{const e=new Date(r);if(!isNaN(e.getTime())){const t=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),a=e.getFullYear(),i=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0");r="".concat(t,".").concat(n,".").concat(a," ").concat(i,":").concat(o)}}catch(_){}const[s,l]=r.includes(" ")?r.split(" "):[r,""],[c,d,u]=(s||"").split("."),h=c&&d&&u?"".concat(u,"-").concat(d.padStart(2,"0"),"-").concat(c.padStart(2,"0")):(new Date).toISOString().slice(0,10),m=(l||"18:00").slice(0,5),p=o&&(o.home||o.home_team)||n.home,x=o&&(o.away||o.away_team)||n.away,g=k(p,n.home_id),v=k(x,n.away_id),j=String(o&&"undefined"!==typeof o.score?o.score||"":n.score||"").trim(),b=new Date("".concat(h,"T").concat(m,":00")).getTime()>Date.now(),y=!j||b?null:j,f=String(o&&"undefined"!==typeof o.venue&&null!==o.venue?o.venue:n.venue||"");return{id:n.match_id||a+1,date:h,time:m,home:g,away:v,home_id:n.home_id,away_id:n.away_id,home_logo_url:w(g,n.home_id,o&&o.home_logo_url||n.home_logo_url),away_logo_url:w(v,n.away_id,o&&o.away_logo_url||n.away_logo_url),score:y,facr_link:n.facr_link,report_url:n.report_url,venue:f,competition:t.name||t.code||""}})}}),n=(0,D.tJ)(t);H(n)}}})(),()=>{e=!0}},[]),(0,q.jsxs)(C.A,{children:[(0,q.jsxs)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"24px 16px",background:pe,minHeight:"100vh"},children:[(0,q.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:24,flexWrap:"wrap",gap:16},children:[(0,q.jsxs)("div",{children:[(0,q.jsx)("h1",{style:{fontSize:"2rem",fontWeight:800,marginBottom:8,color:be},children:e("matches.all_matches")}),(0,q.jsx)("p",{style:{color:je},children:t||"Klub"})]}),(0,q.jsxs)("button",{onClick:()=>oe(!ie),style:{padding:"10px 20px",background:"var(--primary-color, #3b82f6)",color:"white",border:"none",borderRadius:8,fontWeight:600,fontSize:"0.9rem",cursor:"pointer",transition:"all 0.2s",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",gap:8},onMouseEnter:e=>{e.currentTarget.style.transform="translateY(-2px)",e.currentTarget.style.boxShadow="0 4px 8px rgba(0,0,0,0.15)"},onMouseLeave:e=>{e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 2px 4px rgba(0,0,0,0.1)"},children:[(0,q.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:ie?(0,q.jsx)("path",{d:"M11 5h4M11 9h7M11 13h10M3 17l3 3m0 0l3-3m-3 3V4"}):(0,q.jsx)("path",{d:"M11 5h10M11 9h7M11 13h4M3 17l3-3m0 0l3 3m-3-3v16"})}),e(ie?"matches.oldest_first":"matches.newest_first")]})]}),Se.length>0?(0,q.jsxs)(s.t,{variant:"soft-rounded",colorScheme:"blue",index:$,onChange:J,children:[(0,q.jsx)(l.w,{mb:4,flexWrap:"wrap",gap:2,justifyContent:"flex-start",sx:{"& > button":{minW:"auto",px:{base:3,md:4},py:{base:1.5,md:2},fontSize:{base:"xs",md:"sm"},fontWeight:600,borderRadius:"md",transition:"all 0.2s",_selected:{bg:"brand.primary",color:"white",transform:"translateY(-2px)",boxShadow:"md"},_hover:{transform:"translateY(-1px)",boxShadow:"sm"}}},children:Se.map((e,t)=>(0,q.jsx)(c.o,{children:e.name},"".concat(e.name,"-").concat(t)))}),(0,q.jsx)(d.T,{children:Se.map((n,i)=>(0,q.jsx)(u.K,{px:0,children:0===n.matches.length?(0,q.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:je},children:e("matches.no_matches_to_display")}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:n.matches.slice(0,re[i]||le).map((i,o)=>{var r,s;const l=new Date("".concat(i.date,"T").concat(i.time||"00:00",":00")).getTime(),c=Date.now(),d=l>c,u=l<c,h=i.score&&""!==i.score.trim(),m=Ce[String(i.id)];return(0,q.jsxs)("div",{onClick:()=>(e=>{try{Q(e),X(!0)}catch(t){}})((0,a.A)((0,a.A)({},i),{},{competitionName:n.name})),style:{background:xe,border:"2px solid ".concat(ge),borderRadius:16,padding:20,cursor:"pointer",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",boxShadow:"0 2px 8px rgba(0,0,0,0.08)",color:ve,position:"relative",overflow:"hidden"},onMouseEnter:e=>{e.currentTarget.style.transform="translateY(-8px)",e.currentTarget.style.boxShadow="0 16px 40px rgba(0,0,0,0.12), 0 6px 16px rgba(0,0,0,0.08)",e.currentTarget.style.borderColor="var(--chakra-colors-brand-primary, #3b82f6)"},onMouseLeave:e=>{e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.08)",e.currentTarget.style.borderColor=ge},children:[(0,q.jsxs)("div",{style:{fontSize:"0.85rem",color:je,marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center",fontWeight:600},children:[(0,q.jsx)("span",{children:ke(i.date,i.time||"00:00")}),(0,q.jsx)("span",{style:{background:"var(--chakra-colors-brand-primary, #3b82f6)",color:"white",padding:"4px 10px",borderRadius:8,fontSize:"0.8rem",fontWeight:700},children:i.time})]}),(0,q.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flex:1,minWidth:0},children:[(0,q.jsx)("div",{style:{width:48,height:48,borderRadius:"50%",overflow:"hidden",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",background:"white",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,q.jsx)("img",{src:(0,N.uq)(i.home_logo_url)||"/images/club-logo-fallback.svg",alt:i.home,style:{width:40,height:40,objectFit:"contain",padding:null!==(r=(0,N.uq)(i.home_logo_url))&&void 0!==r&&r.includes("logoapi.sportcreative.eu")?"4px":"0px",boxSizing:"border-box"},onError:e=>{const t=e.target;t.src.includes("club-logo-fallback.svg")||(t.src="/images/club-logo-fallback.svg")}})}),(0,q.jsx)("span",{style:{fontWeight:700,fontSize:"1rem",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:i.home,children:fe(i.home)})]})}),(0,q.jsx)("div",{style:{textAlign:"center",margin:"20px 0",fontSize:"1.8rem",fontWeight:"bold"},children:d?m?(0,q.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6},children:[(0,q.jsx)("span",{style:{fontSize:"0.7rem",color:"#f97316",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.5px"},children:"Za\u010d\xe1tek za"}),(0,q.jsx)("span",{style:{fontSize:"1.4rem",color:"#f97316",fontWeight:800,fontFamily:"monospace"},children:m})]}):(0,q.jsx)("span",{style:{fontSize:"1.2rem",color:"#3b82f6",fontWeight:600},children:"vs"}):h?(0,q.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:(0,q.jsx)("span",{style:{fontSize:"2rem",fontWeight:800,background:"linear-gradient(135deg, #3b82f6, #2563eb)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:i.score})}):(0,q.jsx)("span",{style:{fontSize:"1.2rem",color:"#9ca3af",fontWeight:600},children:"\u2014:\u2014"})}),(0,q.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flex:1,minWidth:0},children:[(0,q.jsx)("div",{style:{width:48,height:48,borderRadius:"50%",overflow:"hidden",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",background:"white",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,q.jsx)("img",{src:(0,N.uq)(i.away_logo_url)||"/images/club-opponent.svg",alt:i.away,style:{width:40,height:40,objectFit:"contain",padding:null!==(s=(0,N.uq)(i.away_logo_url))&&void 0!==s&&s.includes("logoapi.sportcreative.eu")?"4px":"0px",boxSizing:"border-box"},onError:e=>{e.target.src="/images/club-opponent.svg"}})}),(0,q.jsx)("span",{style:{fontWeight:700,fontSize:"1rem",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:i.away,children:fe(i.away)})]})}),i.venue&&(0,q.jsx)("div",{style:{fontSize:"0.85rem",color:je,marginTop:12,textAlign:"center"},children:i.venue}),i.home&&t&&we(i.home)&&d&&(0,q.jsx)("div",{style:{marginTop:12},children:(0,q.jsx)(L.I,{matchDateTime:"".concat(i.date,"T").concat(i.time||"15:00",":00"),venue:void 0,isHomeMatch:!0,matchHasStarted:!1})}),i.competitionName&&0===$&&(0,q.jsx)("div",{style:{marginTop:12,textAlign:"center"},children:(0,q.jsx)("span",{style:{fontSize:"0.75rem",color:"white",background:"var(--chakra-colors-brand-primary, #3b82f6)",padding:"4px 12px",borderRadius:12,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.5px"},children:i.competitionName})}),(()=>{const t=h&&u?ze(i):null;if(t){const e={green:{bg:"linear-gradient(135deg, #10b981 0%, #059669 100%)",shadow:"rgba(16, 185, 129, 0.3)"},blue:{bg:"linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)",shadow:"rgba(59, 130, 246, 0.3)"},red:{bg:"linear-gradient(135deg, #ef4444 0%, #dc2626 100%)",shadow:"rgba(239, 68, 68, 0.3)"}}[t.colorScheme];return(0,q.jsx)("div",{style:{fontSize:"0.75rem",background:e.bg,color:"white",marginTop:12,padding:"6px 12px",borderRadius:8,textAlign:"center",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.5px",boxShadow:"0 2px 8px ".concat(e.shadow)},children:t.label})}return!h&&u?(0,q.jsx)("div",{style:{fontSize:"0.75rem",background:"linear-gradient(135deg, #6b7280 0%, #4b5563 100%)",color:"white",marginTop:12,padding:"6px 12px",borderRadius:8,textAlign:"center",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.5px",boxShadow:"0 2px 8px rgba(107, 114, 128, 0.3)"},children:e("matches.played")}):h||!d||m?null:(0,q.jsx)("div",{style:{fontSize:"0.75rem",background:"linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)",color:"white",marginTop:12,padding:"6px 12px",borderRadius:8,textAlign:"center",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.5px",boxShadow:"0 2px 8px rgba(59, 130, 246, 0.3)"},children:e("matches.upcoming")})})()]},i.id||o)})}),n.matches.length>(re[i]||le)&&(0,q.jsxs)("div",{style:{textAlign:"center",marginTop:32},children:[(0,q.jsxs)("button",{onClick:()=>{return e=i,void se(t=>(0,a.A)((0,a.A)({},t),{},{[e]:(t[e]||le)+le}));var e},style:{padding:"14px 32px",background:"var(--primary-color, #3b82f6)",color:"white",border:"none",borderRadius:12,fontWeight:700,fontSize:"1rem",cursor:"pointer",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",boxShadow:"0 4px 12px rgba(59, 130, 246, 0.3)",display:"inline-flex",alignItems:"center",gap:10},onMouseEnter:e=>{e.currentTarget.style.transform="translateY(-2px)",e.currentTarget.style.boxShadow="0 8px 20px rgba(59, 130, 246, 0.4)"},onMouseLeave:e=>{e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 4px 12px rgba(59, 130, 246, 0.3)"},children:[(0,q.jsx)("span",{children:e("matches.load_more_matches")}),(0,q.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,q.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,q.jsx)("div",{style:{marginTop:12,fontSize:"0.875rem",color:je,fontWeight:600},children:e("matches.showing_matches",{shown:Math.min(re[i]||le,n.matches.length),total:n.matches.length})})]})]})},"panel-".concat(n.name,"-").concat(i)))})]}):(0,q.jsxs)("div",{style:{textAlign:"center",padding:"60px 0",color:je},children:[(0,q.jsx)("p",{style:{fontSize:"1.2rem",marginBottom:8,color:be},children:e("matches.no_matches_to_display")}),(0,q.jsx)("p",{style:{fontSize:"0.9rem",color:je},children:e("matches.check_club_settings")})]})]}),(0,q.jsx)(h.aF,{isOpen:G,onClose:()=>X(!1),size:"lg",isCentered:!0,returnFocusOnClose:!1,children:(0,q.jsxs)(m.$,{children:[(0,q.jsx)(p.r,{children:Y&&(Y.competitionName||Y.competition)||"Detail z\xe1pasu"}),(0,q.jsx)(x.s,{}),(0,q.jsx)(g.c,{children:Y&&(0,q.jsxs)(v.T,{spacing:4,children:[(()=>{const e=ze(Y);if(e)return(0,q.jsx)(j.s,{justify:"center",children:(0,q.jsx)(b.E,{colorScheme:e.colorScheme,variant:"subtle",children:e.label})});const t=Y.competition||Y.competitionName;return t&&"V\u0161echny sout\u011b\u017ee"!==t?(0,q.jsx)(j.s,{justify:"center",children:(0,q.jsx)(b.E,{colorScheme:"purple",children:t})}):null})(),(0,q.jsxs)(j.s,{align:"center",justify:"center",gap:3,children:[Y.home_logo_url&&(0,q.jsx)(y._,{src:(0,N.uq)(Y.home_logo_url),alt:Y.home,boxSize:"40px",borderRadius:"full",cursor:"pointer",onClick:()=>ye(Y.home,Y.home_logo_url),_hover:{opacity:.8,transform:"scale(1.1)"},transition:"all 0.2s",title:"Klikn\u011bte pro zobrazen\xed statistik: ".concat(Y.home)}),(e=>{const t=new Date("".concat(Y.date,"T").concat(Y.time||"00:00",":00")).getTime()<=Date.now(),n=Boolean(Y.score);if(!t){const e=Ce[String(Y.id)];return e?(0,q.jsxs)(b.E,{colorScheme:"orange",fontSize:"md",px:3,py:1,children:["za ",e]}):(0,q.jsx)(b.E,{colorScheme:"gray",fontSize:"md",px:3,py:1,children:"vs"})}return(0,q.jsx)(b.E,{colorScheme:n&&(null===(e=ze(Y))||void 0===e?void 0:e.colorScheme)||"gray",fontSize:"md",px:3,py:1,children:n?Y.score:"vs"})})(),Y.away_logo_url&&(0,q.jsx)(y._,{src:(0,N.uq)(Y.away_logo_url),alt:Y.away,boxSize:"40px",borderRadius:"full",cursor:"pointer",onClick:()=>ye(Y.away,Y.away_logo_url),_hover:{opacity:.8,transform:"scale(1.1)"},transition:"all 0.2s",title:"Klikn\u011bte pro zobrazen\xed statistik: ".concat(Y.away)})]}),(0,q.jsxs)(f.a,{textAlign:"center",children:[(0,q.jsx)(k.E,{fontSize:"lg",fontWeight:"semibold",color:"gray.800",mb:1,children:(()=>{try{return(0,W.GP)((0,U.qg)(Y.date,"yyyy-MM-dd",new Date),"EEEE d. MMMM yyyy",{locale:O.cs})}catch(e){return Y.date}})()}),(0,q.jsx)(k.E,{fontSize:"md",color:"gray.700",children:Y.time||"\u2014"})]}),(()=>{const e=new Date("".concat(Y.date,"T").concat(Y.time||"00:00",":00")).getTime()<=Date.now(),t=Boolean(Y.score),n=Ce[String(Y.id)];if(!t&&!e&&n){const e=(e=>{try{let t=0;const n=e.toLowerCase().split(/\s+/);for(let e=0;e<n.length;e+=2){const a=parseInt(n[e],10),i=n[e+1];if(!isNaN(a)&&i)switch(i){case"d":t+=24*a*60*60*1e3;break;case"h":t+=60*a*60*1e3;break;case"m":t+=60*a*1e3;break;case"s":t+=1e3*a}}return t}catch(t){return 0}})(n);if(e>0){const t=Math.floor(e/864e5),n=Math.floor(e%864e5/36e5),a=Math.floor(e%36e5/6e4),i=Math.floor(e%6e4/1e3);return(0,q.jsxs)(f.a,{mt:4,p:4,bg:"orange.50",borderRadius:"lg",borderWidth:"2px",borderColor:"orange.200",children:[(0,q.jsx)(k.E,{fontSize:"sm",fontWeight:"semibold",color:"orange.800",mb:3,textAlign:"center",children:"Z\xe1pas za\u010d\xedn\xe1 za"}),(0,q.jsxs)(_.x,{templateColumns:t>0?"repeat(4, 1fr)":"repeat(3, 1fr)",gap:3,children:[t>0&&(0,q.jsxs)(f.a,{textAlign:"center",children:[(0,q.jsx)(f.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,q.jsx)(k.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:t})}),(0,q.jsx)(k.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===t?"den":t<5?"dny":"dn\xed"})]}),(0,q.jsxs)(f.a,{textAlign:"center",children:[(0,q.jsx)(f.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,q.jsx)(k.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:String(n).padStart(2,"0")})}),(0,q.jsx)(k.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===n?"hodina":n<5?"hodiny":"hodin"})]}),(0,q.jsxs)(f.a,{textAlign:"center",children:[(0,q.jsx)(f.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,q.jsx)(k.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:String(a).padStart(2,"0")})}),(0,q.jsx)(k.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===a?"minuta":a<5?"minuty":"minut"})]}),(0,q.jsxs)(f.a,{textAlign:"center",children:[(0,q.jsx)(f.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,q.jsx)(k.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:String(i).padStart(2,"0")})}),(0,q.jsx)(k.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===i?"sekunda":i<5?"sekundy":"sekund"})]})]})]})}}return null})(),(0,q.jsx)(f.a,{h:"1px",bg:"gray.200"}),Y.venue&&(0,q.jsxs)(k.E,{fontSize:"md",color:"gray.700",textAlign:"center",children:[(0,q.jsx)("strong",{children:"Kde:"})," ",Y.venue]}),(()=>{const e=new Date("".concat(Y.date,"T").concat(Y.time||"00:00",":00")).getTime()<=Date.now();return Y.home&&t&&we(Y.home)&&!e?(0,q.jsx)(f.a,{children:(0,q.jsx)(L.I,{matchDateTime:"".concat(Y.date,"T").concat(Y.time||"15:00",":00"),venue:void 0,isHomeMatch:!0,matchHasStarted:!1,delayLoad:!1})}):null})(),(0,q.jsx)(f.a,{h:"1px",bg:"gray.200"}),(0,q.jsx)(w.D,{as:"h3",size:"sm",children:"Odb\u011br notifikac\xed pro fanou\u0161ky"}),(0,q.jsx)(k.E,{fontSize:"sm",color:"gray.600",children:"Zadejte sv\u016fj email a budeme v\xe1s informovat o novink\xe1ch a z\xe1pasech."}),(0,q.jsxs)(j.s,{gap:2,align:"center",children:[(0,q.jsx)(z.p,{type:"email",placeholder:"v\xe1\u0161@email.cz",value:de,onChange:e=>ue(e.target.value)}),(0,q.jsx)(S.$,{colorScheme:"red",onClick:async()=>{if(de){me(!0);try{const e=await fetch("".concat(F.API_URL,"/api/v1/newsletter/subscribe"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:de})});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error((null===t||void 0===t?void 0:t.error)||"HTTP ".concat(e.status))}ce({title:"P\u0159ihl\xe1\u0161eno k odb\u011bru",status:"success"}),ue("")}catch(e){ce({title:"Chyba p\u0159ihl\xe1\u0161en\xed",description:(null===e||void 0===e?void 0:e.message)||String(e),status:"error"})}finally{me(!1)}}else ce({title:"Zadejte email",status:"warning"})},isLoading:he,children:"Odeb\xedrat"})]})]})}),(0,q.jsxs)(A.j,{children:[Y&&(Y.facr_link||Y.report_url)&&(0,q.jsx)(S.$,{colorScheme:"blue",mr:3,onClick:e=>{e.preventDefault();const t=Y.facr_link||Y.report_url;if(t){const e=document.createElement("a");e.href=t,e.target="_blank",e.rel="noopener noreferrer",e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}},children:"Detail na FA\u010cR"}),(0,q.jsx)(S.$,{onClick:()=>X(!1),children:"Zav\u0159\xedt"})]})]})})]})}},29066:(e,t,n)=>{n.d(t,{A:()=>d,O:()=>c});var a=n(89379),i=n(65043),o=n(71860),r=n(46291),s=n(70579);const l=(0,i.createContext)(void 0),c=e=>{let{children:t}=e;const[n,c]=(0,i.useState)(null),[d,u]=(0,i.useState)(!1),[h,m]=(0,i.useState)(!0),[p,x]=(0,i.useState)(!1);(0,i.useEffect)(()=>{(async()=>{const e=await(0,o.Ec)();x(e);const t=(0,o.gf)();if(t&&(0,o.wR)())try{const n=r.API_URL,i=await fetch("".concat(n,"/auth/me"),{credentials:"include",headers:{Authorization:"Bearer ".concat(t)}});if(i.ok){const o=await i.json(),r=o.user||o;if(c(r),u(!0),!e&&!r.role){if((await fetch("".concat(n,"/auth/make-admin"),{method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}})).ok){const e=(0,a.A)((0,a.A)({},r),{},{role:"admin"});c(e),x(!0)}}}else(0,o.L)()}catch(n){console.error("Error initializing auth:",n),(0,o.L)()}m(!1)})()},[]);return(0,s.jsx)(l.Provider,{value:{isAuthenticated:d,user:n,isLoading:h,adminExists:p,login:async function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if((0,o.WG)(e,n),"admin"===t.role)x(!0);else if(!p&&!t.role)try{const n=r.API_URL;(await fetch("".concat(n,"/auth/make-admin"),{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}})).ok&&(t.role="admin",x(!0))}catch(a){console.error("Error making user admin:",a)}c(t),u(!0)},logout:()=>{try{r.Ay.post("/auth/logout").catch(()=>{})}catch(e){}(0,o.L)(),c(null),u(!1)},updateUser:e=>{n&&c((0,a.A)((0,a.A)({},n),e))}},children:t})},d=()=>{const e=(0,i.useContext)(l);if(void 0===e)throw new Error("useAuth must be used within an AuthProvider");return e}},29559:(e,t,n)=>{n.r(t),n.d(t,{default:()=>E});var a=n(89379),i=n(22107),o=n(98662),r=n(44093),s=n(73225),l=n(10804),c=n(76668),d=n(73212),u=n(33572),h=n(35699),m=n(7189),p=n(76659),x=n(29904),g=n(10202),v=n(19077),j=n(30502),b=n(28846),y=n(39081),f=n(72526),k=n(12836),_=n(66286),w=n(40378),z=n(24858),S=n(25189),A=n(74117),C=n(70579);const E=()=>{var e,t,n,E;const{t:T}=(0,A.Bd)(),{data:D,isLoading:N,isError:R,error:F}=(0,f.I)({queryKey:["sponsors-page"],queryFn:_.sJ}),P=(0,j.d)(),I=(0,r.dU)("white","gray.800"),M=(0,r.dU)("gray.200","gray.700"),L=(0,r.dU)("gray.600","gray.400"),W=(0,r.dU)("gray.700","gray.300"),{register:U,handleSubmit:O,reset:q,formState:{errors:K}}=(0,z.mN)(),{mutate:B,isLoading:Z}=(0,k.n)({mutationFn:e=>(0,_.rx)((0,a.A)((0,a.A)({},e),{},{source:"sponsor"})),onSuccess:()=>{q(),P({title:T("sponsors.message_sent"),description:T("sponsors.message_sent_desc"),status:"success"})},onError:e=>{var t,n,a,i;const o=(null===e||void 0===e?void 0:e.code)||"",r=(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message),s="ECONNABORTED"===o||/timeout/i.test(String((null===e||void 0===e?void 0:e.message)||"")),l=!(null===e||void 0===e||!e.isAxiosError)&&!(null!==e&&void 0!==e&&e.response),c=r||(s?T("sponsors.timeout_error"):l?T("sponsors.network_error"):(null===e||void 0===e?void 0:e.message)||T("sponsors.send_error"));P({title:T("sponsors.error_title"),description:c,status:"error"})}});if(N)return(0,C.jsx)(p.y,{});if(R){var V,H;const e=(null===F||void 0===F||null===(V=F.response)||void 0===V||null===(H=V.data)||void 0===H?void 0:H.error)||(null===F||void 0===F?void 0:F.message)||T("sponsors.error_loading");return(0,C.jsx)(y.E,{color:"red.500",children:e})}const $=(e,t)=>{var n,a;const i=null!==(n=null===e||void 0===e?void 0:e.display_order)&&void 0!==n?n:9999,o=null!==(a=null===t||void 0===t?void 0:t.display_order)&&void 0!==a?a:9999;return i!==o?i-o:String((null===e||void 0===e?void 0:e.name)||"").localeCompare(String((null===t||void 0===t?void 0:t.name)||""))},J=((null===D||void 0===D?void 0:D.filter(e=>"general"===e.tier))||[]).slice().sort($),G=((null===D||void 0===D?void 0:D.filter(e=>"general"!==e.tier))||[]).slice().sort($);return(0,C.jsx)(w.A,{children:(0,C.jsxs)(g.T,{align:"stretch",spacing:10,maxW:"7xl",mx:"auto",px:{base:4,md:6},py:{base:6,md:10},children:[(0,C.jsxs)(i.a,{children:[(0,C.jsx)(b.D,{size:"lg",mb:6,children:T("sponsors.title")}),J.length>0&&(0,C.jsxs)(i.a,{mb:8,children:[(0,C.jsx)(b.D,{size:"md",mb:4,color:"brand.600",children:T("sponsors.main_partners")}),(0,C.jsx)(d.r,{columns:{base:1,md:2,lg:3},spacing:8,children:J.map(e=>(0,C.jsxs)(x.B,{align:"center",bg:I,p:6,borderRadius:"lg",borderWidth:"2px",borderColor:M,boxShadow:"md",children:[(0,C.jsx)(m.N,{href:e.website_url||"#",isExternal:!0,children:(0,C.jsx)(u._,{src:(0,S.uq)(e.logo_url)||"/sponsor-placeholder.svg",alt:e.name,height:"100px",objectFit:"contain"})}),(0,C.jsx)(y.E,{fontWeight:"semibold",fontSize:"lg",children:e.name})]},e.id))})]}),G.length>0&&(0,C.jsxs)(i.a,{children:[(0,C.jsx)(b.D,{size:"md",mb:4,color:W,children:T("sponsors.partners")}),(0,C.jsx)(d.r,{columns:{base:2,md:3,lg:5},spacing:6,children:G.map(e=>(0,C.jsxs)(x.B,{align:"center",bg:I,p:4,borderRadius:"md",borderWidth:"1px",borderColor:M,children:[(0,C.jsx)(m.N,{href:e.website_url||"#",isExternal:!0,children:(0,C.jsx)(u._,{src:(0,S.uq)(e.logo_url)||"/sponsor-placeholder.svg",alt:e.name,height:"60px",objectFit:"contain"})}),(0,C.jsx)(y.E,{fontSize:"sm",children:e.name})]},e.id))})]})]}),(0,C.jsxs)(i.a,{maxW:"600px",mx:"auto",w:"full",alignSelf:"stretch",children:[(0,C.jsxs)(i.a,{mb:4,children:[(0,C.jsx)(b.D,{size:"lg",mb:2,children:T("sponsors.become_partner")}),(0,C.jsx)(y.E,{color:L,children:T("sponsors.partnership_description")})]}),(0,C.jsx)(i.a,{bg:I,borderRadius:"lg",borderWidth:"1px",borderColor:M,boxShadow:"sm",p:6,children:(0,C.jsx)("form",{onSubmit:O(e=>B((0,a.A)({},e))),children:(0,C.jsxs)(g.T,{spacing:4,children:[(0,C.jsxs)(s.MJ,{isInvalid:!!K.name,children:[(0,C.jsx)(c.l,{htmlFor:"partner-name",children:T("sponsors.name_label")}),(0,C.jsx)(h.p,(0,a.A)({id:"partner-name",placeholder:T("sponsors.name_placeholder")},U("name",{required:T("sponsors.name_required")}))),(0,C.jsx)(l.Wt,{children:null===(e=K.name)||void 0===e?void 0:e.message})]}),(0,C.jsxs)(s.MJ,{isInvalid:!!K.email,children:[(0,C.jsx)(c.l,{htmlFor:"partner-email",children:T("sponsors.email_label")}),(0,C.jsx)(h.p,(0,a.A)({id:"partner-email",type:"email",placeholder:T("sponsors.email_placeholder")},U("email",{required:T("sponsors.email_required")}))),(0,C.jsx)(l.Wt,{children:null===(t=K.email)||void 0===t?void 0:t.message})]}),(0,C.jsxs)(s.MJ,{isInvalid:!!K.subject,children:[(0,C.jsx)(c.l,{htmlFor:"partner-subject",children:T("sponsors.subject_label")}),(0,C.jsx)(h.p,(0,a.A)({id:"partner-subject",placeholder:T("sponsors.subject_placeholder")},U("subject",{required:T("sponsors.subject_required")}))),(0,C.jsx)(l.Wt,{children:null===(n=K.subject)||void 0===n?void 0:n.message})]}),(0,C.jsxs)(s.MJ,{isInvalid:!!K.message,children:[(0,C.jsx)(c.l,{htmlFor:"partner-message",children:T("sponsors.message_label")}),(0,C.jsx)(v.T,(0,a.A)({id:"partner-message",rows:6,placeholder:T("sponsors.message_placeholder")},U("message",{required:T("sponsors.message_required")}))),(0,C.jsx)(l.Wt,{children:null===(E=K.message)||void 0===E?void 0:E.message})]}),(0,C.jsx)(o.$,{type:"submit",colorScheme:"brand",size:"lg",width:"full",mt:2,isLoading:Z,loadingText:T("sponsors.sending"),children:T("sponsors.send_message")})]})})})]})]})})}},29661:(e,t,n)=>{n.d(t,{BL:()=>l,Dq:()=>o,LX:()=>s,o$:()=>r});var a=n(46291);function i(e){var t,n,a,i,o,r,s,l,c,d,u,h,m,p,x,g,v,j,b,y,f,k,_,w,z,S,A,C,E,T,D;if(!e)return e;const N=null!==(t=e.id)&&void 0!==t?t:e.ID;return{id:"string"===typeof N?Number(N):N,first_name:null!==(n=null!==(a=e.first_name)&&void 0!==a?a:e.FirstName)&&void 0!==n?n:"",last_name:null!==(i=null!==(o=e.last_name)&&void 0!==o?o:e.LastName)&&void 0!==i?i:"",date_of_birth:null!==(r=null!==(s=e.date_of_birth)&&void 0!==s?s:e.DateOfBirth)&&void 0!==r?r:void 0,position:null!==(l=null!==(c=e.position)&&void 0!==c?c:e.Position)&&void 0!==l?l:void 0,jersey_number:null!==(d=null!==(u=e.jersey_number)&&void 0!==u?u:e.JerseyNumber)&&void 0!==d?d:void 0,team_id:null!==(h=null!==(m=e.team_id)&&void 0!==m?m:e.TeamID)&&void 0!==h?h:void 0,nationality:null!==(p=null!==(x=e.nationality)&&void 0!==x?x:e.Nationality)&&void 0!==p?p:void 0,height:null!==(g=null!==(v=e.height)&&void 0!==v?v:e.Height)&&void 0!==g?g:void 0,weight:null!==(j=null!==(b=e.weight)&&void 0!==b?b:e.Weight)&&void 0!==j?j:void 0,image_url:null!==(y=null!==(f=e.image_url)&&void 0!==f?f:e.ImageURL)&&void 0!==y?y:void 0,gender:null!==(k=null!==(_=e.gender)&&void 0!==_?_:e.Gender)&&void 0!==k?k:void 0,is_active:Boolean(null===(w=null!==(z=e.is_active)&&void 0!==z?z:e.IsActive)||void 0===w||w),created_at:null!==(S=null!==(A=e.created_at)&&void 0!==A?A:e.CreatedAt)&&void 0!==S?S:void 0,email:null!==(C=null!==(E=e.email)&&void 0!==E?E:e.Email)&&void 0!==C?C:void 0,phone:null!==(T=null!==(D=e.phone)&&void 0!==D?D:e.Phone)&&void 0!==T?T:void 0}}async function o(e){let t="/players";const n=new URLSearchParams;e&&!1===e.active&&n.set("active","false"),e&&null!=e.team_id&&n.set("team_id",String(e.team_id)),Array.from(n.keys()).length>0&&(t+="?".concat(n.toString()));const o=await a.Ay.get(t);return((Array.isArray(o.data)?o.data:o.data.data||o.data.items)||[]).map(i)}async function r(e){return i((await a.Ay.post("/players",e)).data)}async function s(e,t){return i((await a.Ay.put("/players/".concat(e),t)).data)}async function l(e){return(await a.Ay.delete("/players/".concat(e))).data}},29671:(e,t,n)=>{n.d(t,{CI:()=>c,Fv:()=>r,MO:()=>d,dq:()=>o,fk:()=>i,kK:()=>s,vY:()=>l});var a=n(46291);const i=async()=>(await a.Ay.get("/contacts")).data,o=async()=>(await a.Ay.get("/admin/contacts/categories")).data,r=async e=>(await a.Ay.post("/admin/contacts/categories",e)).data,s=async()=>(await a.Ay.get("/admin/contacts")).data,l=async e=>(await a.Ay.post("/admin/contacts",e)).data,c=async(e,t)=>(await a.Ay.put("/admin/contacts/".concat(e),t)).data,d=async e=>{await a.Ay.delete("/admin/contacts/".concat(e))}},30161:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var a=n(22107),i=n(44093),o=n(98939),r=n(82459),s=n(7189),l=n(47781),c=n(10202),d=n(28846),u=n(39081),h=n(40378),m=n(70579);const p=()=>{const e=(0,i.dU)("gray.700","gray.300"),t=(0,i.dU)("gray.900","gray.100"),n=(0,i.dU)("blue.50","blue.900"),p=(0,i.dU)("blue.900","blue.100");return(0,m.jsx)(h.A,{children:(0,m.jsx)(o.m,{maxW:"3xl",py:8,children:(0,m.jsxs)(c.T,{align:"stretch",spacing:6,children:[(0,m.jsx)(d.D,{as:"h1",size:"xl",mb:2,color:t,children:"Obchodn\xed podm\xednky"}),(0,m.jsxs)(u.E,{fontSize:"sm",color:e,children:["Posledn\xed aktualizace: ",(new Date).toLocaleDateString("cs-CZ")]}),(0,m.jsxs)(a.a,{bg:n,p:4,borderRadius:"md",children:[(0,m.jsx)(u.E,{fontWeight:"bold",mb:2,color:p,children:"Shrnut\xed"}),(0,m.jsx)(u.E,{fontSize:"sm",color:p,children:"Pou\u017e\xedv\xe1n\xedm tohoto webu souhlas\xedte s n\xed\u017ee uveden\xfdmi podm\xednkami. Obsah slou\u017e\xed pro informa\u010dn\xed \xfa\u010dely, bez z\xe1ruky \xfaplnosti a spr\xe1vnosti. Provozovatel m\u016f\u017ee podm\xednky a obsah kdykoli m\u011bnit."})]}),(0,m.jsx)(r.c,{}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"1. Provozovatel a kontakt"}),(0,m.jsxs)(u.E,{color:e,mb:4,children:["Provozovatelem webov\xfdch str\xe1nek je subjekt uveden\xfd v sekci ",(0,m.jsx)(s.N,{href:"/kontakt",color:"brand.primary",children:"Kontakt"}),". Pro ve\u0161ker\xe9 dotazy nebo podn\u011bty pros\xedm vyu\u017eijte uveden\xe9 kontaktn\xed \xfadaje."]})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"2. Rozsah a p\u0159ijet\xed podm\xednek"}),(0,m.jsx)(u.E,{color:e,mb:4,children:"Tyto podm\xednky upravuj\xed pou\u017e\xedv\xe1n\xed tohoto webu a souvisej\xedc\xedch slu\u017eeb (nap\u0159. newsletter). Vstupem na web a jeho pou\u017e\xedv\xe1n\xedm vyjad\u0159ujete souhlas s t\u011bmito podm\xednkami."})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"3. Obsah, zdroje dat a pr\xe1va k du\u0161evn\xedmu vlastnictv\xed"}),(0,m.jsxs)(l.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Autorsk\xe1 pr\xe1va:"})," Texty, grafika a prvky webu podl\xe9haj\xed ochran\u011b autorsk\xe9ho pr\xe1va. Kop\xedrov\xe1n\xed \u010di \u0161\xed\u0159en\xed je mo\u017en\xe9 pouze s p\u0159edchoz\xedm souhlasem."]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Extern\xed data FA\u010cR:"})," Informace o z\xe1pasech, sout\u011b\u017e\xedch a tabulk\xe1ch poch\xe1zej\xed z ve\u0159ejn\xfdch zdroj\u016f FA\u010cR (",(0,m.jsx)(s.N,{href:"https://www.fotbal.cz",isExternal:!0,color:"brand.primary",children:"www.fotbal.cz"}),") a jsou majetkem FA\u010cR. Zobrazujeme je v\xfdhradn\u011b pro informa\u010dn\xed \xfa\u010dely."]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Loga klub\u016f a t\xfdm\u016f:"})," Loga n\xe1le\u017e\xed p\u0159\xedslu\u0161n\xfdm klub\u016fm a organizac\xedm a slou\u017e\xed pouze k identifikaci."]}),(0,m.jsxs)(l.ck,{children:[(0,m.jsx)("strong",{children:"Fotografie a videa:"})," Medi\xe1ln\xed obsah m\u016f\u017ee poch\xe1zet z r\u016fzn\xfdch zdroj\u016f, v\u010detn\u011b YouTube a Zonerama. Ve\u0161ker\xe1 pr\xe1va n\xe1le\u017e\xed p\u016fvodn\xedm autor\u016fm."]})]})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"4. Pravidla chov\xe1n\xed u\u017eivatel\u016f"}),(0,m.jsxs)(l.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,m.jsx)(l.ck,{children:"Neporu\u0161ujte pr\xe1vn\xed p\u0159edpisy ani pr\xe1va t\u0159et\xedch osob."}),(0,m.jsx)(l.ck,{children:"Nevkl\xe1dejte \u0161kodliv\xfd k\xf3d a nepokou\u0161ejte se naru\u0161it bezpe\u010dnost webu."}),(0,m.jsx)(l.ck,{children:"Nevyu\u017e\xedvejte web k nevy\u017e\xe1dan\xe9 reklam\u011b ani automatizovan\xe9mu sb\u011bru dat (scraping) v rozporu s podm\xednkami."})]})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"5. Newsletter a \xfa\u010dty"}),(0,m.jsxs)(u.E,{color:e,mb:4,children:["P\u0159ihl\xe1\u0161en\xed k odb\u011bru newsletteru je dobrovoln\xe9 a lze jej kdykoli odhl\xe1sit prost\u0159ednictv\xedm odkazu v e\u2011mailu nebo na str\xe1nce ",(0,m.jsx)(s.N,{href:"/newsletter/preferences",color:"brand.primary",children:"nastaven\xed newsletteru"}),"."]})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"6. Odpov\u011bdnost a z\xe1ruky"}),(0,m.jsx)(u.E,{color:e,mb:4,children:"Obsah webu je poskytov\xe1n \u201etak jak je\u201c, bez jak\xfdchkoli z\xe1ruk. Provozovatel neodpov\xedd\xe1 za p\u0159\xedpadn\xe9 \u0161kody vznikl\xe9 u\u017e\xedv\xe1n\xedm webu, v nej\u0161ir\u0161\xedm rozsahu povolen\xe9m pr\xe1vem. Neodpov\xedd\xe1me za dostupnost a obsah extern\xedch odkaz\u016f (nap\u0159. FA\u010cR, YouTube, Zonerama)."})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"7. E\u2011shop a extern\xed slu\u017eby"}),(0,m.jsx)(u.E,{color:e,mb:4,children:"Pokud web odkazuje na extern\xed e\u2011shop nebo platebn\xed slu\u017ebu, n\xe1kup se \u0159\xedd\xed podm\xednkami dan\xe9ho poskytovatele. Provozovatel tohoto webu nen\xed stranou takov\xe9ho smluvn\xedho vztahu, pokud nen\xed v\xfdslovn\u011b uvedeno jinak."})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"8. Ochrana osobn\xedch \xfadaj\u016f a cookies"}),(0,m.jsxs)(u.E,{color:e,mb:4,children:["Zpracov\xe1n\xed osobn\xedch \xfadaj\u016f se \u0159\xedd\xed dokumentem ",(0,m.jsx)(s.N,{href:"/zasady-ochrany-osobnich-udaju",color:"brand.primary",children:"Z\xe1sady ochrany osobn\xedch \xfadaj\u016f"}),". Informace o cookies naleznete v ",(0,m.jsx)(s.N,{href:"/pravidla-cookies",color:"brand.primary",children:"Pravidlech pou\u017e\xedv\xe1n\xed cookies"}),"."]})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"9. Zm\u011bny podm\xednek"}),(0,m.jsx)(u.E,{color:e,mb:4,children:"Provozovatel si vyhrazuje pr\xe1vo tyto podm\xednky kdykoli upravit nebo doplnit. Zm\u011bny jsou \xfa\u010dinn\xe9 zve\u0159ejn\u011bn\xedm na tomto webu."})]}),(0,m.jsxs)(a.a,{children:[(0,m.jsx)(d.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"10. Rozhodn\xe9 pr\xe1vo"}),(0,m.jsx)(u.E,{color:e,mb:2,children:"Tyto podm\xednky se \u0159\xedd\xed pr\xe1vn\xedm \u0159\xe1dem \u010cesk\xe9 republiky. P\u0159\xedpadn\xe9 spory budou \u0159e\u0161eny u p\u0159\xedslu\u0161n\xfdch soud\u016f \u010cesk\xe9 republiky."}),(0,m.jsxs)(u.E,{color:e,children:["M\xe1te\u2011li dotazy, kontaktujte n\xe1s prost\u0159ednictv\xedm str\xe1nky ",(0,m.jsx)(s.N,{href:"/kontakt",color:"brand.primary",children:"Kontakt"}),"."]})]})]})})})}},30458:(e,t,n)=>{n.d(t,{IK:()=>o,LI:()=>d,Lv:()=>c,p4:()=>g,x_:()=>i,yN:()=>l});var a=n(46291);async function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;return new Promise((n,i)=>{const o=new Image;o.crossOrigin="anonymous",o.onload=()=>{try{const e=document.createElement("canvas"),a=e.getContext("2d");if(!a)return n([]);const i=160,r=o.naturalWidth||o.width||0,s=o.naturalHeight||o.height||0,l=r>0&&s>0?s/r:1,c=i,d=Math.max(1,Math.round(c*l));e.width=c,e.height=d,a.drawImage(o,0,0,c,d);const{data:u}=a.getImageData(0,0,c,d),h={};for(let t=0;t<u.length;t+=4){const e=u[t],n=u[t+1],a=u[t+2];if(u[t+3]<200)continue;const i=16,o=Math.round(e/i)*i,r=Math.round(n/i)*i,s=Math.round(a/i)*i,l="".concat(o,",").concat(r,",").concat(s);h[l]=(h[l]||0)+1}const m=Object.entries(h).sort((e,t)=>t[1]-e[1]),p=[],x=(e,t)=>Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2);for(const[t,n]of m){const[e,a,i]=t.split(",").map(Number);let o=!1;for(const t of p){const[r,s,l]=t.key.split(",").map(Number);if(x([e,a,i],[r,s,l])<24){t.count+=n,o=!0;break}}o||p.push({key:t,count:n})}p.sort((e,t)=>t.count-e.count);const g=e=>Math.max(0,Math.min(255,e)).toString(16).padStart(2,"0"),v=p.slice(0,t).map(e=>{const[t,n,a]=e.key.split(",").map(Number);return"#".concat(g(t)).concat(g(n)).concat(g(a))});if(v.length>1){const e=[];for(const n of v){const a=parseInt(n.slice(1,3),16),i=parseInt(n.slice(3,5),16),o=parseInt(n.slice(5,7),16);if(e.some(e=>{const t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return x([t,n,r],[a,i,o])<40})||e.push(n),e.length>=t)break}e.length?n(e):n(v)}else n(v)}catch(e){n([])}},o.onerror=()=>n([]);try{const t=new URL(a.API_URL).origin;let n=e||"";(n.startsWith("/uploads")||n.startsWith("/dist")||n.startsWith("/api/"))&&(n=t+n);const i=new URL(n,window.location.origin),r="data:"===i.protocol,s=i.origin===window.location.origin;o.src=r||s?i.toString():"".concat(a.API_URL,"/proxy/image?url=").concat(encodeURIComponent(i.toString()))}catch(r){o.src=e}})}function o(e){const t=e.replace("#","");return(299*parseInt(t.substring(0,2),16)+587*parseInt(t.substring(2,4),16)+114*parseInt(t.substring(4,6),16))/1e3>=128?"#000000":"#ffffff"}function r(e){const t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function s(e){const t=e.replace("#",""),n=parseInt(t.substring(0,2),16),a=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16);return.2126*r(n)+.7152*r(a)+.0722*r(i)}function l(e,t){try{const n=s(e),a=s(t),i=Math.max(n,a);return(i+.05)/(Math.min(n,a)+.05)}catch(n){return 1}}function c(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"AA";return l(e,t)>=("AAA"===n?7:4.5)}function d(){const e=new Uint8Array(arguments.length>0&&void 0!==arguments[0]?arguments[0]:48);window.crypto.getRandomValues(e);return btoa(String.fromCharCode(...Array.from(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function u(e){const t=e.replace("#","");return{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16)}}function h(e,t,n){const a=e=>{return Math.round(255*(t=e,Math.min(1,Math.max(0,t)))).toString(16).padStart(2,"0");var t};return"#".concat(a(e)).concat(a(t)).concat(a(n))}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;const{r:n,g:a,b:i}=u(e);return h(n/255+t,a/255+t,i/255+t)}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;const{r:n,g:a,b:i}=u(e);return h(n/255-t,a/255-t,i/255-t)}function x(e,t){const n=t||o(e);if(c(e,n,"AA"))return{text:n,bg:e};for(const a of[.1,.2,.3]){const t=p(e,a);if(c(t,n,"AA"))return{text:n,bg:t};const i=m(e,a);if(c(i,n,"AA"))return{text:n,bg:i}}return{text:"#000000"===n?"#ffffff":"#000000",bg:e}}function g(e){var t,n,a;const i=(e||[]).filter(Boolean),o=["#0b5cff","#ffd200","#141414","#ffffff"];function r(e){const{r:t,g:n,b:a}=u(e),i=t/255,o=n/255,r=a/255,s=Math.max(i,o,r),l=Math.min(i,o,r);let c=0,d=0,h=(s+l)/2;if(s!==l){const e=s-l;switch(d=h>.5?e/(2-s-l):e/(s+l),s){case i:c=(o-r)/e+(o<r?6:0);break;case o:c=(r-i)/e+2;break;case r:c=(i-o)/e+4}c/=6}return{h:c,s:d,l:h}}function s(e,t){if(!t||0===t.length)return o[2];let n=t[0],a=l(e,n);for(const i of t){const t=l(e,i);t>a&&(a=t,n=i)}return n}const c=[],d=(e,t,n,a,i)=>{const{text:o}=x(i,"#111111"),r=x(i,o);c.push({name:e,primary:t,secondary:n,accent:a,background:r.bg,text:r.text})},h=i.length?i:o,m=h[0]||o[0],p=h.find(e=>e.toLowerCase()!==m.toLowerCase())||o[1],g=s(m,h.slice(1))||o[2];d("Klasick\xfd",m,p,g,"#ffffff");const v=h.map(e=>({c:e,s:r(e).s}));v.sort((e,t)=>t.s-e.s);const j=(null===(t=v[0])||void 0===t?void 0:t.c)||m;d("\u017div\xfd",j,(null===(n=v[1])||void 0===n?void 0:n.c)||p,s(j,e)||g,"#ffffff");const b=(null===(a=v.slice(-1)[0])||void 0===a?void 0:a.c)||h[1]||o[1],y=h.find(e=>e!==b)||h[0]||o[1],f=s(b,h)||o[2];d("Tlumen\xfd",b,y,f,"#f8f9fb");const k=s("#0f1115",h)||g;d("Tmav\xfd",m,p,k,"#0f1115");let _=h[0]||o[2],w=-1;for(const u of h){let e=0;for(const t of h)e+=l(u,t);e>w&&(w=e,_=u)}return d("Akcentn\xed",m,h.find(e=>e!==_)||p,_,"#ffffff"),c}},31629:(e,t,n)=>{n.d(t,{Pi:()=>c,SE:()=>u,Uc:()=>l,i4:()=>r,os:()=>h,sn:()=>o,ts:()=>d,yv:()=>s});var a=n(46291);const i=Number({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic",REACT_APP_ESHOP_URL:"http://localhost:3100",REACT_APP_ERROR_INGEST_URL:"http://127.0.0.1:8083/api/v1/errors",REACT_APP_ERROR_INGEST_TOKEN:""}.REACT_APP_AI_TIMEOUT_MS||"")||9e4;async function o(e){const{data:t}=await a.Ay.post("/ai/blog/generate",e,{timeout:i});let n=t;if("string"===typeof t)try{n=JSON.parse(t)}catch(o){throw new Error("AI vr\xe1tila neplatn\xfd form\xe1t odpov\u011bdi")}return n}async function r(e){const{data:t}=await a.Ay.post("/ai/instagram/generate",e,{timeout:i});let n=t;if("string"===typeof n)try{n=JSON.parse(n)}catch(o){n={text:""}}return n}async function s(e){const{data:t}=await a.Ay.post("/ai/instagram/images",e,{timeout:i});let n=t;if("string"===typeof n)try{n=JSON.parse(n)}catch(o){n={urls:[]}}return n}async function l(e){const{data:t}=await a.Ay.post("/ai/main-image/generate",e,{timeout:i});let n=t;if("string"===typeof n)try{n=JSON.parse(n)}catch(o){n={url:""}}return n}async function c(e){const{data:t}=await a.Ay.post("/ai/css/generate",e,{timeout:i});let n=t;if("string"===typeof n)try{n=JSON.parse(n)}catch(o){n={css:""}}return n}async function d(e){const{data:t}=await a.Ay.post("/ai/about/generate",e,{timeout:i});let n=t;if("string"===typeof t)try{n=JSON.parse(t)}catch(o){throw new Error("AI vr\xe1tila neplatn\xfd form\xe1t odpov\u011bdi")}return n}async function u(e){const{data:t}=await a.Ay.post("/ai/ocr/process",e,{timeout:i});let n=t;if("string"===typeof n)try{n=JSON.parse(n)}catch(o){n={text:""}}return n}async function h(e){const{data:t}=await a.Ay.post("/ai/voice/transcribe",e,{timeout:i});let n=t;if("string"===typeof n)try{n=JSON.parse(n)}catch(o){n={text:"",language:""}}return n}},32386:(e,t,n)=>{n.d(t,{Gz:()=>s,Td:()=>i,Yf:()=>r,yl:()=>o});var a=n(46291);async function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={link:e};"number"===typeof t.photo_limit&&(n.photo_limit=String(t.photo_limit)),"boolean"===typeof t.rendered&&(n.rendered=String(t.rendered));return(await a.Ay.get("/zonerama/album",{params:n})).data}async function o(e){return(await a.Ay.post("/admin/zonerama/pick",e)).data}async function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return(await a.Ay.post("/admin/zonerama/save-album",{link:e,photo_limit:t})).data}async function s(){const e=await async function(){let e="";try{const t="http://127.0.0.1:8080".trim();t&&(e=new URL(t,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin)}catch(i){}if(!e)try{e=new URL(a.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin}catch(o){}const t="".concat(e,"/cache/prefetch/zonerama_flat.json"),n=await fetch(t,{cache:"no-cache"});if(!n.ok)return[];try{const e=await n.json();return Array.isArray(e)?e:[]}catch(r){return[]}}();if(e&&e.length>0)return e;let t="";try{const e="http://127.0.0.1:8080".trim();e&&(t=new URL(e,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin)}catch(n){}if(!t)try{t=new URL(a.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin}catch(i){}try{const e="".concat(t,"/cache/prefetch/zonerama_albums.json"),n=await fetch(e,{cache:"no-cache"});if(n.ok){const e=await n.json(),t=(Array.isArray(null===e||void 0===e?void 0:e.items)?e.items:[]).map(e=>({id:String(e.id||e.photo_id||""),album_id:String(e.album_id||""),src:String(e.src||e.image_url||""),local:String(e.local||e.local_url||e.image_local||""),page_url:String(e.page_url||e.url||"")}));if(t.length>0)return t}}catch(o){}try{const e="".concat(t,"/cache/prefetch/zonerama_profile.json"),n=await fetch(e,{cache:"no-cache"});if(n.ok){const e=await n.json();if(null!==e&&void 0!==e&&e.albums&&Array.isArray(e.albums)){const t=[];for(const n of e.albums)if(n.photos&&Array.isArray(n.photos))for(const e of n.photos)t.push({id:String(e.id||""),album_id:String(n.id||""),src:String(e.image_1500||""),local:String(e.image_1500||""),page_url:String(e.page_url||"")});if(t.length>0)return t}}}catch(r){}try{const e=await async function(){const e=await a.Ay.get("/zonerama/picks");return Array.isArray(e.data)?e.data:[]}();return e.map(e=>({id:String(e.id),album_id:String(e.album_id||""),src:String(e.image_url),local:String(e.image_url),page_url:String(e.page_url||e.album_url||"")}))}catch(s){}return[]}},32396:(e,t,n)=>{n.d(t,{A:()=>u});var a=n(98662),i=n(68455),o=n(67516),r=n(56529),s=n(15071),l=n(11054),c=n(65043),d=n(70579);function u(e){let{isOpen:t,onClose:n,onConfirm:u,title:h,message:m,confirmText:p="Potvrdit",cancelText:x="Zru\u0161it",isDanger:g=!1,isLoading:v=!1}=e;const j=(0,c.useRef)(null);return(0,d.jsx)(i.Lt,{isOpen:t,leastDestructiveRef:j,onClose:n,isCentered:!0,children:(0,d.jsx)(l.m,{children:(0,d.jsxs)(i.EO,{children:[(0,d.jsx)(s.r,{fontSize:"lg",fontWeight:"bold",children:h}),(0,d.jsx)(o.c,{children:m}),(0,d.jsxs)(r.j,{children:[(0,d.jsx)(a.$,{ref:j,onClick:n,isDisabled:v,children:x}),(0,d.jsx)(a.$,{colorScheme:g?"red":"blue",onClick:()=>{u()},ml:3,isLoading:v,loadingText:"Zpracov\xe1v\xe1m...",children:p})]})]})})})}},32545:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ee});var a=n(89379),i=n(65043),o=n(96870),r=n(87139),s=n(22107),l=n(98662),c=n(44093),d=n(82459),u=n(73225),h=n(76668),m=n(73212),p=n(33572),x=n(35699),g=n(68455),v=n(67516),j=n(35929),b=n(56529),y=n(15071),f=n(11054),k=n(78460),_=n(85421),w=n(97569),z=n(61724),S=n(96148),A=n(10202),C=n(14566),E=n(31411),T=n(10227),D=n(51794),N=n(3109),R=n(30502),F=n(28846),P=n(39081),I=n(80810),M=n(6583),L=n(20724),W=n(52976),U=n(2367),O=n(88500),q=n(48549),K=n(41172),B=n(46291),Z=n(72526),V=n(42687),H=n(44318),$=n(91296),J=n(70579);const G=["classic","pill","var1","var2","var3","var4"],X=e=>{if(e){if(e.startsWith("/uploads")||e.startsWith("/dist")||e.startsWith("/api/"))return e;if(/^https?:\/\//i.test(e)){const t=(B.API_URL||"").replace(/\/$/,"");return"".concat(t,"/proxy/image?url=").concat(encodeURIComponent(e))}return e}},Y=e=>{try{if(!e)return e||void 0;const t=new URL(B.API_URL||"","undefined"!==typeof window?window.location.origin:void 0),n="".concat(t.protocol,"//").concat(t.host);return e.startsWith("/uploads/")?n+e:e}catch(t){return e||void 0}},Q=e=>{try{if(!e)return e||void 0;const t=new URL(B.API_URL||"","undefined"!==typeof window?window.location.origin:void 0),n=new URL(e,t.origin);if(/\/proxy\/image$/i.test(n.pathname)){return n.searchParams.get("url")||e||void 0}return e||void 0}catch(t){return e||void 0}},ee=()=>{const e=(0,c.dU)("white","gray.800"),[t,n]=((0,c.dU)("gray.200","gray.700"),(0,c.dU)("white","gray.700"),(0,i.useState)(null)),[B,ee]=(0,i.useState)(!0),te=(0,i.useRef)((null===t||void 0===t?void 0:t.primaryColor)||"#1e3a8a"),ne=(0,i.useRef)((null===t||void 0===t?void 0:t.secondaryColor)||"#2563eb"),ae=(0,i.useRef)((null===t||void 0===t?void 0:t.homeTextColor)||"#ffffff"),ie=(0,i.useRef)((null===t||void 0===t?void 0:t.awayTextColor)||"#ffffff"),[oe,re]=(0,i.useState)((null===t||void 0===t?void 0:t.primaryColor)||"#1e3a8a"),[se,le]=(0,i.useState)((null===t||void 0===t?void 0:t.secondaryColor)||"#2563eb"),[ce,de]=(0,i.useState)((null===t||void 0===t?void 0:t.homeTextColor)||"#ffffff"),[ue,he]=(0,i.useState)((null===t||void 0===t?void 0:t.awayTextColor)||"#ffffff"),me=(0,R.d)(),[pe,xe]=(0,i.useState)(0),[ge,ve]=(0,i.useState)([]),[je,be]=(0,i.useState)(""),[ye,fe]=(0,i.useState)([]),[ke,_e]=(0,i.useState)(""),{isOpen:we,onOpen:ze,onClose:Se}=(0,o.j)(),[Ae,Ce]=(0,i.useState)([]),[Ee,Te]=(0,i.useState)([]),[De,Ne]=(0,i.useState)(!1),{isOpen:Re,onOpen:Fe,onClose:Pe}=(0,o.j)(),Ie=(0,i.useRef)(null),[Me,Le]=(0,i.useState)(!1),[We,Ue]=(0,i.useState)(!1),Oe=(0,i.useDeferredValue)(t),qe=(0,i.useMemo)(()=>{const e=Oe||t;return e?(0,a.A)((0,a.A)({},e),{},{primaryColor:te.current||e.primaryColor||"#1e3a8a",secondaryColor:ne.current||e.secondaryColor||"#2563eb",homeTextColor:ae.current||e.homeTextColor||"#ffffff",awayTextColor:ie.current||e.awayTextColor||"#ffffff"}):null},[Oe,t]),Ke=(0,i.useRef)(void 0),Be=(0,i.useRef)({}),Ze=()=>{if(!t)return;(e=>{Be.current=(0,a.A)((0,a.A)({},Be.current),e),Ke.current&&window.clearTimeout(Ke.current),Ke.current=window.setTimeout(()=>{const e=Be.current;Be.current={},Ke.current=void 0,(0,i.startTransition)(()=>{n(t=>(0,a.A)((0,a.A)({},t),e))});try{(0,q.vu)(e)}catch(t){}},250)})({primaryColor:te.current||t.primaryColor||"#1e3a8a",secondaryColor:ne.current||t.secondaryColor||"#2563eb",homeTextColor:ae.current||t.homeTextColor||"#ffffff",awayTextColor:ie.current||t.awayTextColor||"#ffffff"}),re(te.current),le(ne.current),de(ae.current),he(ie.current)},[Ve,He]=(0,i.useState)(""),[$e,Je]=(0,i.useState)("home"),{searchClubs:Ge,searchResults:Xe,searchLoading:Ye,searchError:Qe}=(0,K.E)();(0,i.useEffect)(()=>{(async()=>{const e=await(0,q.AI)();n(e),ee(!1);try{ve(await(0,q.nk)())}catch(t){}try{fe(await(0,q.L1)())}catch(a){}try{_e(await(0,q.cf)())}catch(i){}})()},[]);(0,i.useEffect)(()=>{t&&(We||(te.current=t.primaryColor||"#1e3a8a",ne.current=t.secondaryColor||"#2563eb",ae.current=t.homeTextColor||"#ffffff",ie.current=t.awayTextColor||"#ffffff",re(te.current),le(ne.current),de(ae.current),he(ie.current)))},[null===t||void 0===t?void 0:t.primaryColor,null===t||void 0===t?void 0:t.secondaryColor,null===t||void 0===t?void 0:t.homeTextColor,null===t||void 0===t?void 0:t.awayTextColor,We]),(0,i.useEffect)(()=>()=>{Ke.current&&(window.clearTimeout(Ke.current),Ke.current=void 0),Be.current={}},[]);const{data:et=[]}=(0,Z.I)({queryKey:["admin-matches"],queryFn:V.tb,staleTime:6e4}),{data:tt={}}=(0,Z.I)({queryKey:["team-logo-overrides-admin"],queryFn:V.a5,staleTime:3e5}),nt=(null===tt||void 0===tt?void 0:tt.by_id)||{},at=(null===tt||void 0===tt?void 0:tt.by_name)||{},it=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[\u2012\u2013\u2014\u2015\u2212]/g,"-").replace(/\bn\.?\b/g," nad ").replace(/\bp\.?\b/g," pod ").replace(/[\,\s]*(z\.?\s*s\.?|o\.?\s*s\.?)\s*$/g,"").replace(/[\.,!;:()\[\]{}]/g," ").replace(/\s+/g," ").trim().toLowerCase(),ot=i.useMemo(()=>{const e={};for(const n of Object.values(nt||{})){const t=String((null===n||void 0===n?void 0:n.name)||"").trim(),a=String((null===n||void 0===n?void 0:n.logo_url)||"").trim();t&&a&&(e[a]=t)}const t={};for(const[n,a]of Object.entries(at||{})){const i=e[String(a)]||"",o=it(n);i&&o&&(t[o]=i)}return t},[nt,at]),rt=i.useMemo(()=>{const e={};try{for(const[t,n]of Object.entries(nt||{})){const a=String((null===n||void 0===n?void 0:n.name)||"").trim(),i=String((null===n||void 0===n?void 0:n.logo_url)||"").trim();if(!a)continue;const o=it(a);o&&(e[o]={id:t,name:a,logo_url:i})}}catch(t){}return e},[nt]),st=(e,t)=>{var n;const a=t?String(t):"";if(a&&null!==nt&&void 0!==nt&&null!==(n=nt[a])&&void 0!==n&&n.name&&String(nt[a].name).trim())return String(nt[a].name).trim();try{const t=it(e);if(ot[t])return ot[t];let n=rt[t];if(!n)for(const[e,a]of Object.entries(rt))if(e&&(t.endsWith(e)||e.endsWith(t))){n=a;break}if(n&&n.name)return String(n.name)}catch(i){}return String(e||"")},lt=(e,t)=>{const n=(null===tt||void 0===tt?void 0:tt.by_name)||{},a=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),i=e=>{let t=a(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,""),t.replace(/\s+/g," ").trim()},o=Object.keys(n||{}).reduce((e,t)=>(e[a(t)]=n[t],e),{}),r=Object.keys(n||{}).map(e=>({key:i(e),url:n[e]}));return((e,t)=>{if(!e)return t;let s=n[e]||o[a(e)];if(!s){const t=i(e);for(const{key:e,url:n}of r)if(e&&(t.endsWith(e)||e.endsWith(t))){s=n;break}}return s||t})(e,t)},{data:ct}=(0,Z.I)({queryKey:["facr-club-info-cache"],queryFn:H.r,staleTime:6e5,refetchInterval:6e5}),dt=(0,i.useMemo)(()=>{const e=[];try{const t=(null===ct||void 0===ct?void 0:ct.competitions)||[];for(const n of t){const t=String((null===n||void 0===n?void 0:n.name)||(null===n||void 0===n?void 0:n.code)||"").trim(),a=(null===n||void 0===n?void 0:n.matches)||[];for(const n of a)e.push({match_id:(null===n||void 0===n?void 0:n.match_id)||(null===n||void 0===n?void 0:n.id)||"",id:(null===n||void 0===n?void 0:n.match_id)||(null===n||void 0===n?void 0:n.id)||"",home:(null===n||void 0===n?void 0:n.home)||"",away:(null===n||void 0===n?void 0:n.away)||"",date_time:(null===n||void 0===n?void 0:n.date_time)||(null===n||void 0===n?void 0:n.kickoff)||"",home_logo_url:(null===n||void 0===n?void 0:n.home_logo_url)||"",away_logo_url:(null===n||void 0===n?void 0:n.away_logo_url)||"",competition:t,league:t})}}catch(t){}return e},[ct]),ut=i.useMemo(()=>{const e=new Set;for(const t of et){const n=String(t.competition||t.league||"").trim();n&&e.add(n)}for(const t of dt){const n=String(t.competition||t.league||"").trim();n&&e.add(n)}return["V\u0161e",...Array.from(e)]},[et,dt]),[ht,mt]=(0,i.useState)("V\u0161e"),[pt,xt]=(0,i.useState)(""),gt=i.useMemo(()=>{const e=e=>{const t=String(e.date_time||e.date||"").slice(0,16);let n=Date.parse(t);return isNaN(n)&&t.includes(" ")&&(n=Date.parse(t.replace(" ","T")+":00")),n},t=Date.now();let n=[...et||[],...dt];if(ht&&"V\u0161e"!==ht&&(n=n.filter(e=>String(e.competition||e.league||"").trim()===ht)),pt.trim()){const e=pt.trim().toLowerCase();n=n.filter(t=>String(t.home||"").toLowerCase().includes(e)||String(t.away||"").toLowerCase().includes(e)||String(t.competition||t.league||"").toLowerCase().includes(e))}const a=n.map(t=>({m:t,ts:e(t)}));return{upcoming:a.filter(e=>"number"===typeof e.ts&&!isNaN(e.ts)&&e.ts>=t).sort((e,t)=>e.ts-t.ts).map(e=>e.m),recent:a.filter(e=>"number"===typeof e.ts&&!isNaN(e.ts)&&e.ts<t).sort((e,t)=>t.ts-e.ts).map(e=>e.m)}},[et,dt,ht,pt]);(0,i.useEffect)(()=>{const e=Ve.trim();if(!e)return;const t=setTimeout(()=>{Ge(e).catch(()=>{})},400);return()=>clearTimeout(t)},[Ve,Ge]);const vt=async e=>{const t=await(0,q.vu)(e);n(t)},jt=async e=>{var a,i;if(!t)return;const o=String(e.home||e.home_team||"").trim(),r=String(e.away||e.away_team||"").trim(),s=String(e.home_id||e.homeTeamId||e.home_team_id||""),l=String(e.away_id||e.awayTeamId||e.away_team_id||""),c=st(o,s)||o,d=st(r,l)||r,u=(s&&null!==nt&&void 0!==nt&&null!==(a=nt[s])&&void 0!==a&&a.logo_url?String(nt[s].logo_url):lt(o,e.home_logo_url||e.homeLogoURL||""))||"",h=(l&&null!==nt&&void 0!==nt&&null!==(i=nt[l])&&void 0!==i&&i.logo_url?String(nt[l].logo_url):lt(r,e.away_logo_url||e.awayLogoURL||""))||"",m={homeName:c,awayName:d,homeShort:(0,q.IL)(c),awayShort:(0,q.IL)(d),homeLogo:u||t.homeLogo,awayLogo:h||t.awayLogo,externalMatchId:String(e.match_id||e.id||"")},[p,x]=await Promise.all([(0,q.lR)(Q(u||t.homeLogo)),(0,q.lR)(Q(h||t.awayLogo))]);p&&(m.primaryColor=p),x&&(m.secondaryColor=x);const g=await(0,q.vu)(m);n(g),me({title:"Z\xe1pas vybr\xe1n",description:"Z\xe1kladn\xed \xfadaje byly p\u0159edvypln\u011bny.",status:"success"})};return!B&&t&&qe?(0,J.jsx)(M.A,{requireAdmin:!1,children:(0,J.jsxs)(s.a,{children:[(0,J.jsx)(F.D,{size:"lg",mb:2,children:"Tabule (Scoreboard)"}),(0,J.jsx)(P.E,{color:"gray.500",mb:2,children:"Napojte tabuli na konkr\xe9tn\xed z\xe1pas a ovl\xe1dejte sk\xf3re v re\xe1ln\xe9m \u010dase. Pokud je tabule propojen\xe1 se z\xe1pasem, propisujeme \u017eiv\xe9 sk\xf3re i do ve\u0159ejn\xe9 homepage."}),(0,J.jsxs)(S.z,{spacing:3,mb:4,children:[(0,J.jsx)(r.E,{colorScheme:"green",children:"OBS"}),(()=>{const e=("undefined"!==typeof window?window.location.origin.replace(/\/$/,""):"")+"/overlay/scoreboard";return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U.tX,{label:"Jak pou\u017e\xedt overlay",title:"Pou\u017eit\xed scoreboard overlay v OBS",items:["V OBS p\u0159idejte nov\xfd Browser Source a vlo\u017ete sem uvedenou URL overlaye.","Doporu\u010den\xe1 \u0161\xed\u0159ka zdroje je 1920 px, pozad\xed z\u016fst\xe1v\xe1 pr\u016fhledn\xe9 nad p\u0159enosem.","Overlay je ve\u0159ejn\xfd \u2013 sd\xedlejte URL jen s lidmi, kte\u0159\xed spravuj\xed p\u0159enos a v\xfdsledky."]}),(0,J.jsx)(l.$,{as:"a",href:e,target:"_blank",rel:"noreferrer",children:"Otev\u0159\xedt overlay"}),(0,J.jsxs)(S.z,{spacing:2,children:[(0,J.jsxs)(P.E,{fontSize:"sm",color:"gray.500",children:["Ve\u0159ejn\xe1 URL pro OBS: ",e]}),(0,J.jsx)(l.$,{size:"sm",leftIcon:(0,J.jsx)(I.T,{}),onClick:()=>{try{navigator.clipboard.writeText(e)}catch(t){}},children:"Kop\xedrovat"})]})]})})()]}),(0,J.jsxs)(s.a,{borderWidth:"1px",borderRadius:"lg",p:4,bg:e,mb:6,children:[(0,J.jsx)(F.D,{size:"md",mb:3,children:"Napojen\xed na z\xe1pas (FA\u010cR)"}),(0,J.jsxs)(m.r,{columns:{base:1,md:3},spacing:3,mb:3,children:[(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Sout\u011b\u017e"}),(0,J.jsx)(z.l,{value:ht,onChange:e=>mt(e.target.value),children:ut.map(e=>(0,J.jsx)("option",{value:e,children:e},e))})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Hledat z\xe1pas"}),(0,J.jsx)(x.p,{placeholder:"Hledat podle n\xe1zvu t\xfdmu nebo sout\u011b\u017ee",value:pt,onChange:e=>xt(e.target.value)})]}),(0,J.jsxs)(u.MJ,{display:"flex",alignItems:"center",children:[(0,J.jsx)(h.l,{mb:0,children:"Napojen\xed"}),null!==t&&void 0!==t&&t.externalMatchId?(0,J.jsxs)(r.E,{ml:3,colorScheme:"blue",children:["Z\xe1pas: ",t.externalMatchId]}):(0,J.jsx)(r.E,{ml:3,children:"Bez z\xe1pasu"})]})]}),(0,J.jsxs)(N.t,{index:pe,onChange:xe,variant:"enclosed",size:"sm",children:[(0,J.jsxs)(E.w,{children:[(0,J.jsx)(C.o,{children:"Nadch\xe1zej\xedc\xed"}),(0,J.jsx)(C.o,{children:"Ned\xe1vn\xe9"})]}),(0,J.jsxs)(D.T,{children:[(0,J.jsx)(T.K,{px:0,children:(0,J.jsx)(A.T,{align:"stretch",spacing:2,maxH:"320px",overflowY:"auto",children:gt.upcoming.map(e=>{const t=lt(String(e.home),e.home_logo_url||e.homeLogoURL||"");return(0,J.jsxs)(S.z,{spacing:3,p:2,borderWidth:"1px",borderRadius:"md",_hover:{bg:"gray.50"},children:[t?(0,J.jsx)(p._,{src:X(t),alt:String(e.home),boxSize:"28px",objectFit:"contain"}):null,(0,J.jsxs)(P.E,{fontWeight:"semibold",children:[String(e.home)," vs ",String(e.away)]}),(0,J.jsx)(r.E,{ml:"auto",children:String(e.date_time||e.date||"").slice(0,16).replace("T"," ")}),(0,J.jsx)(l.$,{size:"sm",onClick:()=>jt(e),children:"Vybrat z\xe1pas"})]},"".concat(e.match_id||e.id))})})}),(0,J.jsx)(T.K,{px:0,children:(0,J.jsx)(A.T,{align:"stretch",spacing:2,maxH:"320px",overflowY:"auto",children:gt.recent.map(e=>{const t=lt(String(e.home),e.home_logo_url||e.homeLogoURL||"");return(0,J.jsxs)(S.z,{spacing:3,p:2,borderWidth:"1px",borderRadius:"md",_hover:{bg:"gray.50"},children:[t?(0,J.jsx)(p._,{src:X(t),alt:String(e.home),boxSize:"28px",objectFit:"contain"}):null,(0,J.jsxs)(P.E,{fontWeight:"semibold",children:[String(e.home)," vs ",String(e.away)]}),(0,J.jsx)(r.E,{ml:"auto",colorScheme:"purple",children:String(e.date_time||e.date||"").slice(0,16).replace("T"," ")}),(0,J.jsx)(l.$,{size:"sm",variant:"outline",onClick:()=>jt(e),children:"Vybrat z\xe1pas"})]},"".concat(e.match_id||e.id))})})})]})]}),(0,J.jsx)(S.z,{mt:3,children:(0,J.jsx)(l.$,{variant:"ghost",onClick:async()=>{const e=await(0,q.vu)({externalMatchId:""});n(e),me({title:"Odpojeno",description:"Tabule odpojena od z\xe1pasu.",status:"info"})},children:"Odpojit od z\xe1pasu"})})]}),(0,J.jsx)(s.a,{display:"flex",justifyContent:"center",mb:6,children:(0,J.jsx)(L.A,{state:qe})}),(0,J.jsxs)(m.r,{columns:{base:1,md:2},spacing:6,children:[(0,J.jsxs)(s.a,{children:[(0,J.jsx)(F.D,{size:"md",mb:3,children:"Z\xe1kladn\xed \xfadaje"}),(0,J.jsxs)(m.r,{columns:2,spacing:4,children:[(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Dom\xe1c\xed t\xfdm"}),(0,J.jsx)(x.p,{value:t.homeName,onChange:async e=>{var n;const a=e.target.value;await vt({homeName:a,homeShort:null!==(n=t.homeShort)&&void 0!==n&&n.trim()?t.homeShort:(0,q.IL)(a)})}})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Zkratka dom\xe1c\xedch"}),(0,J.jsx)(x.p,{value:t.homeShort||"",maxLength:3,onChange:async e=>{await vt({homeShort:e.target.value.toUpperCase().slice(0,3)})}})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Hostuj\xedc\xed t\xfdm"}),(0,J.jsx)(x.p,{value:t.awayName,onChange:async e=>{var n;const a=e.target.value;await vt({awayName:a,awayShort:null!==(n=t.awayShort)&&void 0!==n&&n.trim()?t.awayShort:(0,q.IL)(a)})}})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Zkratka host\u016f"}),(0,J.jsx)(x.p,{value:t.awayShort||"",maxLength:3,onChange:async e=>{await vt({awayShort:e.target.value.toUpperCase().slice(0,3)})}})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Logo dom\xe1c\xedch (URL)"}),(0,J.jsx)(x.p,{value:t.homeLogo||"",onChange:async e=>{await vt({homeLogo:e.target.value})}})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Logo host\u016f (URL)"}),(0,J.jsx)(x.p,{value:t.awayLogo||"",onChange:async e=>{await vt({awayLogo:e.target.value})}})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"D\xe9lka polo\u010dasu (min)"}),(0,J.jsx)(w.Q7,{value:t.halfLength,min:1,max:60,onChange:async(e,t)=>vt({halfLength:Number.isFinite(t)?t:45}),children:(0,J.jsx)(w.OO,{})})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Styl"}),(0,J.jsx)(z.l,{value:t.theme,onChange:async e=>vt({theme:e.target.value}),children:G.map(e=>(0,J.jsx)("option",{value:e,children:e},e))})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Polo\u010das"}),(0,J.jsxs)(z.l,{value:String(t.half||1),onChange:async e=>vt({half:parseInt(e.target.value,10)||1}),children:[(0,J.jsx)("option",{value:"1",children:"1"}),(0,J.jsx)("option",{value:"2",children:"2"})]})]})]})]}),(0,J.jsxs)(s.a,{children:[(0,J.jsx)(F.D,{size:"md",mb:3,color:"black",children:"Barvy a vyhled\xe1n\xed klubu"}),(0,J.jsxs)(m.r,{columns:2,spacing:4,children:[(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Barva dom\xe1c\xedch"}),(0,J.jsx)(W.A,{value:oe,showAlpha:!0,onChange:e=>{te.current=e,re(e)},onChangeComplete:e=>{te.current=e,re(e),Ze()},recentStorageKey:"scoreboard-primary",onInteractionStart:()=>Ue(!0),onInteractionEnd:()=>Ue(!1)})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Barva host\u016f"}),(0,J.jsx)(W.A,{value:se,showAlpha:!0,onChange:e=>{ne.current=e,le(e)},onChangeComplete:e=>{ne.current=e,le(e),Ze()},recentStorageKey:"scoreboard-secondary",onInteractionStart:()=>Ue(!0),onInteractionEnd:()=>Ue(!1)})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Barva textu dom\xe1c\xedch"}),(0,J.jsx)(W.A,{value:ce,showAlpha:!0,onChange:e=>{ae.current=e,de(e)},onChangeComplete:e=>{ae.current=e,de(e),Ze()},recentStorageKey:"scoreboard-home-text",onInteractionStart:()=>Ue(!0),onInteractionEnd:()=>Ue(!1)})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Barva textu host\u016f"}),(0,J.jsx)(W.A,{value:ue,showAlpha:!0,onChange:e=>{ie.current=e,he(e)},onChangeComplete:e=>{ie.current=e,he(e),Ze()},recentStorageKey:"scoreboard-away-text",onInteractionStart:()=>Ue(!0),onInteractionEnd:()=>Ue(!1)})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"QR interval (minuty)"}),(0,J.jsx)(w.Q7,{value:t.qrEvery||5,min:1,max:120,onChange:async(e,t)=>vt({qrEvery:Math.max(1,Number.isFinite(t)?t:5)}),children:(0,J.jsx)(w.OO,{})})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"QR d\xe9lka zobrazen\xed (sekundy)"}),(0,J.jsx)(w.Q7,{value:t.qrDuration||60,min:5,max:600,onChange:async(e,t)=>vt({qrDuration:Math.max(5,Number.isFinite(t)?t:60)}),children:(0,J.jsx)(w.OO,{})})]})]}),(0,J.jsx)(d.c,{my:4}),(0,J.jsxs)(S.z,{spacing:3,align:"flex-start",children:[(0,J.jsxs)(z.l,{value:$e,onChange:e=>Je(e.target.value||"home"),maxW:"160px",children:[(0,J.jsx)("option",{value:"home",children:"Nastavit dom\xe1c\xed"}),(0,J.jsx)("option",{value:"away",children:"Nastavit hosty"})]}),(0,J.jsx)(x.p,{placeholder:"Hledat klub (FA\u010cR)",value:Ve,onChange:e=>He(e.target.value)}),(0,J.jsx)(l.$,{isLoading:Ye,onClick:()=>Ve.trim()&&Ge(Ve.trim()),children:"Hledat"})]}),Qe?(0,J.jsxs)(P.E,{color:"red.500",mt:2,children:["Chyba vyhled\xe1v\xe1n\xed: ",Qe.message]}):null,(0,J.jsx)(A.T,{align:"stretch",spacing:2,mt:3,maxH:"260px",overflowY:"auto",children:null===Xe||void 0===Xe?void 0:Xe.slice(0,8).map(e=>(0,J.jsxs)(S.z,{spacing:3,p:2,borderWidth:"1px",borderRadius:"md",_hover:{bg:"gray.50"},cursor:"pointer",onClick:()=>(async e=>{const n=e.logo_url||void 0,a=await(0,q.lR)(Q(n)||void 0);"home"===$e?await vt({homeName:e.name||"DOM\xc1C\xcd",homeShort:(0,q.IL)(e.name||""),homeLogo:n,primaryColor:a||(null===t||void 0===t?void 0:t.primaryColor)}):await vt({awayName:e.name||"HOST\xc9",awayShort:(0,q.IL)(e.name||""),awayLogo:n,secondaryColor:a||(null===t||void 0===t?void 0:t.secondaryColor)}),me({title:"Nastaveno pro ".concat("home"===$e?"dom\xe1c\xed":"hosty"),status:"success"})})(e),children:[e.logo_url?(0,J.jsx)(p._,{src:X(e.logo_url),alt:e.name,boxSize:"28px",objectFit:"contain"}):null,(0,J.jsxs)(s.a,{children:[(0,J.jsx)(P.E,{fontWeight:"medium",color:"black",children:e.name}),(0,J.jsx)(P.E,{fontSize:"sm",color:"black",children:e.club_type})]})]},"".concat(e.club_type,"-").concat(e.club_id)))})]})]}),(0,J.jsx)(d.c,{my:6}),(0,J.jsxs)(S.z,{spacing:3,children:[(0,J.jsx)(l.$,{variant:"outline",onClick:()=>vt({homeScore:0,awayScore:0}),children:"Reset sk\xf3re"}),(0,J.jsx)(l.$,{variant:"outline",onClick:async()=>{await(0,q.nz)();const e=await(0,q.AI)();n(e)},children:"Reset \u010das"}),(0,J.jsx)(l.$,{variant:"outline",onClick:()=>vt({homeFouls:0,awayFouls:0}),children:"Reset fauly"})]}),(0,J.jsx)(d.c,{my:6}),(0,J.jsxs)(s.a,{borderWidth:"1px",borderRadius:"lg",p:4,bg:e,mb:6,children:[(0,J.jsx)(F.D,{size:"md",mb:3,children:"Sponzo\u0159i (overlay)"}),(()=>{const e=("undefined"!==typeof window?window.location.origin.replace(/\/$/,""):"")+"/overlay/sponsors";return(0,J.jsxs)(S.z,{spacing:3,mb:3,children:[(0,J.jsx)(r.E,{colorScheme:"green",children:"OBS"}),(0,J.jsx)(l.$,{as:"a",href:e,target:"_blank",rel:"noreferrer",children:"Otev\u0159\xedt overlay sponzo\u0159i"}),(0,J.jsxs)(P.E,{fontSize:"sm",color:"gray.500",children:["Ve\u0159ejn\xe1 URL: ",e]})]})})(),(0,J.jsxs)(S.z,{spacing:3,mb:3,align:"flex-start",children:[(0,J.jsx)(s.a,{flex:"1",children:(0,J.jsx)(O.A,{label:"Nahr\xe1t loga",description:"Nahrajte loga sponzor\u016f pro overlay v p\u0159enosu.",accept:"image/*,image/svg+xml",multiple:!0,maxFiles:50,uploadFn:async e=>{const t=await(0,q.ZP)([e]),n=((null===t||void 0===t?void 0:t.files)||[]).filter(Boolean);if(n.length>0){const e=n.map(e=>{const t=Y(e),n=(e.split("/").pop()||"").replace(/\.[a-z0-9]+$/i,"");return{url:e,urlAbs:t,name:n,website:""}});Ce(e=>[...e,...n.map(e=>Y(e))]),Te(t=>[...t,...e]),we||ze()}try{fe(await(0,q.L1)())}catch(i){}const a=n[0]||"";return{url:(a?Y(a):void 0)||a||"",name:e.name,type:e.type||"image/*",size:e.size}},allowUrlImport:!1})}),(0,J.jsxs)(A.T,{align:"stretch",spacing:2,minW:"180px",children:[(0,J.jsx)(l.$,{variant:"ghost",onClick:async()=>{try{fe(await(0,q.L1)()),me({title:"Seznam aktualizov\xe1n",status:"info"})}catch(e){}},children:"Obnovit"}),(0,J.jsx)(l.$,{variant:"outline",onClick:async()=>{try{const e=await(0,q.JH)();fe(await(0,q.L1)()),me({title:"P\u0159edvypln\u011bno ze Sponzor\u016f",description:"P\u0159id\xe1no ".concat((null===e||void 0===e?void 0:e.saved)||0," log"),status:"success"})}catch(e){me({title:"P\u0159edvypln\u011bn\xed selhalo",description:null===e||void 0===e?void 0:e.message,status:"error"})}},children:"P\u0159edvyplnit ze str\xe1nky Sponzo\u0159i"}),(0,J.jsx)(l.$,{colorScheme:"red",variant:"outline",isDisabled:!ye.length,onClick:Fe,children:"Smazat v\u0161e"})]})]}),(0,J.jsx)(m.r,{columns:{base:2,md:4,lg:6},spacing:3,children:ye.map(e=>{const t=(e||"").split("/").pop()||"";return(0,J.jsxs)(A.T,{spacing:2,borderWidth:"1px",borderRadius:"md",p:2,children:[(0,J.jsx)(p._,{src:e,alt:t,boxSize:"64px",objectFit:"contain"}),(0,J.jsx)(P.E,{fontSize:"xs",noOfLines:1,maxW:"120px",children:t}),(0,J.jsx)(l.$,{size:"xs",colorScheme:"red",variant:"ghost",onClick:async()=>{try{await(0,q.Sm)(t),fe(await(0,q.L1)()),me({title:"Smaz\xe1no",status:"success"})}catch(e){me({title:"Smaz\xe1n\xed selhalo",status:"error"})}},children:"Smazat"})]},e)})})]}),(0,J.jsxs)(k.aF,{isOpen:we,onClose:Se,size:"lg",children:[(0,J.jsx)(f.m,{}),(0,J.jsxs)(_.$,{children:[(0,J.jsx)(y.r,{children:"P\u0159idat loga jako sponzory?"}),(0,J.jsx)(j.s,{}),(0,J.jsxs)(v.c,{children:[(0,J.jsx)(P.E,{mb:3,children:"Vypl\u0148te n\xe1zev a (voliteln\u011b) web pro ka\u017ed\xe9 nahran\xe9 logo. Z\xe1znamy bez n\xe1zvu budou p\u0159esko\u010deny."}),(0,J.jsx)(m.r,{columns:{base:1,md:2},spacing:4,children:Ee.map((e,t)=>(0,J.jsxs)(A.T,{align:"stretch",spacing:2,borderWidth:"1px",borderRadius:"md",p:3,children:[(0,J.jsx)(p._,{src:e.urlAbs,alt:"logo",boxSize:"64px",objectFit:"contain"}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"N\xe1zev"}),(0,J.jsx)(x.p,{value:e.name,onChange:e=>{const n=e.target.value;Te(e=>e.map((e,i)=>i===t?(0,a.A)((0,a.A)({},e),{},{name:n}):e))}})]}),(0,J.jsxs)(u.MJ,{children:[(0,J.jsx)(h.l,{children:"Web (https://\u2026)"}),(0,J.jsx)(x.p,{value:e.website,onChange:e=>{const n=e.target.value;Te(e=>e.map((e,i)=>i===t?(0,a.A)((0,a.A)({},e),{},{website:n}):e))}})]})]},e.urlAbs))})]}),(0,J.jsxs)(b.j,{children:[(0,J.jsx)(l.$,{mr:3,onClick:Se,children:"Ne"}),(0,J.jsx)(l.$,{colorScheme:"blue",isLoading:Me,onClick:async()=>{try{Le(!0);for(const t of Ee){const n=(t.name||"").trim();if(n)try{await(0,$.rR)({name:n,logo_url:t.url,website_url:(t.website||"").trim()||void 0,is_active:!0})}catch(e){}}me({title:"Sponzo\u0159i p\u0159id\xe1ni",status:"success"})}finally{Le(!1),Se(),Ce([]),Te([])}},children:"Ano, p\u0159idat"})]})]})]}),(0,J.jsx)(g.Lt,{isOpen:Re,leastDestructiveRef:Ie,onClose:Pe,children:(0,J.jsx)(f.m,{children:(0,J.jsxs)(g.EO,{children:[(0,J.jsx)(y.r,{children:"Smazat v\u0161echna loga?"}),(0,J.jsx)(v.c,{children:"Tato akce odstran\xed v\u0161echna nahran\xe1 loga pro overlay sponzor\u016f. Operaci nelze vr\xe1tit zp\u011bt."}),(0,J.jsxs)(b.j,{children:[(0,J.jsx)(l.$,{ref:Ie,onClick:Pe,mr:3,children:"Zru\u0161it"}),(0,J.jsx)(l.$,{colorScheme:"red",isLoading:De,onClick:async()=>{try{Ne(!0);const t=[...ye];for(const n of t){const t=(n||"").split("/").pop()||"";if(t)try{await(0,q.Sm)(t)}catch(e){}}fe(await(0,q.L1)()),me({title:"V\u0161echna loga smaz\xe1na",status:"success"})}finally{Ne(!1),Pe()}},children:"Smazat v\u0161e"})]})]})})}),(0,J.jsxs)(s.a,{borderWidth:"1px",borderRadius:"lg",p:4,bg:e,mb:6,children:[(0,J.jsx)(F.D,{size:"md",mb:3,children:"QR k\xf3d"}),(0,J.jsxs)(S.z,{spacing:4,align:"flex-start",flexWrap:"wrap",children:[(0,J.jsxs)(A.T,{align:"start",spacing:2,children:[(0,J.jsx)(P.E,{fontSize:"sm",color:"gray.500",children:"Aktu\xe1ln\xed QR:"}),ke?(0,J.jsx)(p._,{src:ke,alt:"QR",boxSize:"128px",objectFit:"contain",borderWidth:"1px",borderRadius:"md"}):(0,J.jsx)(P.E,{fontSize:"sm",color:"gray.400",children:"Nenahr\xe1n"})]}),(0,J.jsx)(s.a,{maxW:"360px",flex:"1",children:(0,J.jsx)(O.A,{label:"Nahr\xe1t QR",description:"Nahrajte obr\xe1zek QR k\xf3du pro scoreboard.",accept:"image/*",multiple:!1,maxFiles:1,uploadFn:async e=>{await(0,q.ZF)(e);const t=await(0,q.cf)();return _e(t),{url:t||"",name:e.name,type:e.type||"image/*",size:e.size}},allowUrlImport:!1})}),(0,J.jsx)(l.$,{variant:"ghost",onClick:async()=>{try{_e(await(0,q.cf)()),me({title:"Obnoveno",status:"info"})}catch(e){}},children:"Obnovit"}),(0,J.jsx)(l.$,{variant:"outline",colorScheme:"red",isDisabled:!ke,onClick:async()=>{try{await(0,q.t8)(),_e(""),me({title:"QR smaz\xe1n",status:"info"})}catch(e){me({title:"Smaz\xe1n\xed selhalo",status:"error"})}},children:"Smazat QR"})]})]}),(0,J.jsxs)(s.a,{borderWidth:"1px",borderRadius:"lg",p:4,bg:e,mb:6,children:[(0,J.jsx)(F.D,{size:"md",mb:3,children:"Presety"}),(0,J.jsxs)(S.z,{spacing:3,align:"center",flexWrap:"wrap",mb:3,children:[(0,J.jsx)(x.p,{placeholder:"N\xe1zev presetu (nap\u0159. derby-2025)",value:je,onChange:e=>be(e.target.value),maxW:"260px"}),(0,J.jsx)(l.$,{onClick:async()=>{try{await(0,q.vO)(je),ve(await(0,q.nk)()),be(""),me({title:"Preset ulo\u017een",status:"success"})}catch(e){me({title:"Ulo\u017een\xed selhalo",description:null===e||void 0===e?void 0:e.message,status:"error"})}},children:"Ulo\u017eit preset"})]}),(0,J.jsxs)(S.z,{spacing:3,align:"center",flexWrap:"wrap",children:[(0,J.jsx)(z.l,{placeholder:"Vyberte preset",maxW:"260px",onChange:e=>be(e.target.value),value:je,children:ge.map(e=>(0,J.jsx)("option",{value:e,children:e},e))}),(0,J.jsx)(l.$,{variant:"outline",onClick:async()=>{if(je)try{await(0,q._x)(je),n(await(0,q.AI)()),me({title:"Preset na\u010dten",status:"success"})}catch(e){me({title:"Na\u010dten\xed selhalo",description:null===e||void 0===e?void 0:e.message,status:"error"})}else me({title:"Vyberte preset",status:"warning"})},children:"Na\u010d\xedst preset"}),(0,J.jsx)(l.$,{variant:"ghost",onClick:async()=>{try{ve(await(0,q.nk)()),me({title:"Seznam aktualizov\xe1n",status:"info"})}catch(e){}},children:"Obnovit"})]})]}),(0,J.jsx)(F.D,{size:"md",mb:3,children:"Import / Export"}),(0,J.jsxs)(S.z,{spacing:4,align:"center",flexWrap:"wrap",children:[(0,J.jsx)(l.$,{onClick:()=>{try{const e=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),n=URL.createObjectURL(e),a=document.createElement("a");a.href=n,a.download="scoreboard-state.json",a.click(),URL.revokeObjectURL(n)}catch(e){me({title:"Export selhal",status:"error"})}},children:"Exportovat JSON"}),(0,J.jsxs)(l.$,{as:"label",children:["Importovat JSON",(0,J.jsx)(x.p,{type:"file",accept:"application/json",display:"none",onChange:async e=>{try{var t;const a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!a)return;const i=await a.text(),o=JSON.parse(i);await(0,q.x0)(o),n(await(0,q.AI)()),me({title:"Import dokon\u010den",status:"success"})}catch(a){me({title:"Import selhal",description:(null===a||void 0===a?void 0:a.message)||"Neplatn\xfd soubor",status:"error"})}finally{try{e.target&&(e.target.value="")}catch(i){}}}})]})]}),(0,J.jsx)(d.c,{my:8}),(0,J.jsx)(F.D,{size:"md",mb:2,children:"N\xe1vod k pou\u017eit\xed (CZ)"}),(0,J.jsxs)(A.T,{align:"start",spacing:2,color:"gray.700",children:[(0,J.jsx)(P.E,{children:"1) V horn\xed \u010d\xe1sti vyberte sout\u011b\u017e, p\u0159\xedpadn\u011b vyhledejte z\xe1pas podle n\xe1zvu t\xfdmu. Klikn\u011bte na \u201eVybrat z\xe1pas\u201c."}),(0,J.jsx)(P.E,{children:"2) Pole \u201eDom\xe1c\xed/Host\xe9\u201c, loga a zkratky se p\u0159edvypln\xed. Barvy se pokus\xedme odhadnout z log."}),(0,J.jsx)(P.E,{children:"3) Sk\xf3re upravujte tla\u010d\xedtky n\xed\u017ee nebo ru\u010dn\xedm zad\xe1n\xedm. Zm\u011bny se ukl\xe1daj\xed pr\u016fb\u011b\u017en\u011b."}),(0,J.jsx)(P.E,{children:"4) Jakmile je tabule propojen\xe1 se z\xe1pasem, \u017eiv\xe9 sk\xf3re se propisuje do ve\u0159ejn\xe9 homepage (nejbli\u017e\u0161\xed z\xe1pas) a do JSON cache."}),(0,J.jsx)(P.E,{children:"5) P\u0159epn\u011bte vzhled tabule (styl) dle pot\u0159eby. Pro p\u0159enos do streamu pou\u017eijte ve\u0159ejnou adresu /overlay/scoreboard."}),(0,J.jsx)(P.E,{children:"Tip: P\u0159i importu JSON pou\u017eijte p\u0159edchoz\xed export, form\xe1t je kompatibiln\xed."})]})]})}):(0,J.jsx)(M.A,{requireAdmin:!1,children:(0,J.jsx)(s.a,{children:"Na\u010d\xedt\xe1n\xed\u2026"})})}},33062:(e,t,n)=>{n.r(t),n.d(t,{default:()=>je});var a=n(89379),i=n(65043),o=n(44093),r=n(96870),s=n(30502),l=n(22107),c=n(5371),d=n(28846),u=n(39081),h=n(96148),m=n(98662),p=n(45973),x=n(29244),g=n(35699),v=n(61724),j=n(80511),b=n(3313),y=n(55395),f=n(83201),k=n(34946),_=n(82595),w=n(67813),z=n(87139),S=n(42703),A=n(78460),C=n(11054),E=n(85421),T=n(15071),D=n(35929),N=n(67516),R=n(10202),F=n(73225),P=n(76668),I=n(56529),M=n(24495),L=n(58584),W=n(44245),U=n(92835),O=n(59781),q=n(72526),K=n(12836),B=n(69023),Z=n(6175),V=n(6583),H=n(46291);const $=async e=>{const t=(await H.FH.get("/admin/contact-messages",{params:e})).data;return{data:t.data.map(e=>{var t,n,a,i,o,r;return{id:String(e.id),name:e.name,email:e.email,subject:e.subject,message:e.message,source:e.source,ipAddress:null!==(t=e.ipAddress)&&void 0!==t?t:e.ip_address,userAgent:null!==(n=e.userAgent)&&void 0!==n?n:e.user_agent,isRead:null!==(a=null!==(i=e.isRead)&&void 0!==i?i:e.is_read)&&void 0!==a&&a,createdAt:null!==(o=e.createdAt)&&void 0!==o?o:e.created_at,updatedAt:null!==(r=e.updatedAt)&&void 0!==r?r:e.updated_at}}),total:t.pagination.total,page:t.pagination.page,limit:t.pagination.limit,totalPages:t.pagination.pages}},J=async e=>{await H.FH.patch("/admin/contact-messages/".concat(e,"/read"),{isRead:!0})},G=async e=>{await H.FH.delete("/admin/contact-messages/".concat(e))},X=async e=>{const t=e.map(e=>"string"===typeof e?Number(e):e);await H.FH.delete("/admin/contact-messages",{data:t})},Y=async(e,t)=>{await H.FH.post("/admin/contact-messages/".concat(e,"/forward"),{to_email:t})},Q=async(e,t)=>{let n={};if(Array.isArray(e)){const t=e.map(e=>String(e||"").trim()).filter(Boolean);n=t.length>1?{to_emails:t}:{to_email:t[0]||""}}else{const t=String(e||"").split(/[;\,\s]+/).map(e=>e.trim()).filter(Boolean);n=t.length>1?{to_emails:t}:{to_email:t[0]||""}}null!==t&&void 0!==t&&t.saveDefault&&(n.save_default=!0);return(await H.FH.post("/admin/contact-messages/forward-all",n)).data};var ee=n(14261),te=n(63856),ne=n(70579);function ae(e){let{currentPage:t,totalPages:n,onPageChange:a,maxVisiblePages:i=5}=e;if(n<=1)return null;const o=(()=>{const e=[];let a=Math.max(1,t-Math.floor(i/2));const o=Math.min(n,a+i-1);o-a+1<i&&(a=Math.max(1,o-i+1));for(let t=a;t<=o;t++)e.push(t);return e})();return(0,ne.jsxs)(h.z,{spacing:1,children:[(0,ne.jsx)(m.$,{size:"sm",variant:"outline",onClick:()=>a(t-1),isDisabled:1===t,"aria-label":"P\u0159edchoz\xed str\xe1nka",children:(0,ne.jsx)(ee.Y,{})}),!o.includes(1)&&(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(m.$,{size:"sm",variant:1===t?"solid":"outline",onClick:()=>a(1),children:"1"}),!o.includes(2)&&(0,ne.jsx)(u.E,{children:"..."})]}),o.map(e=>(0,ne.jsx)(m.$,{size:"sm",variant:t===e?"solid":"outline",colorScheme:t===e?"blue":"gray",onClick:()=>a(e),"aria-current":t===e?"page":void 0,children:e},e)),!o.includes(n)&&(0,ne.jsxs)(ne.Fragment,{children:[!o.includes(n-1)&&(0,ne.jsx)(u.E,{children:"..."}),(0,ne.jsx)(m.$,{size:"sm",variant:t===n?"solid":"outline",onClick:()=>a(n),children:n})]}),(0,ne.jsx)(m.$,{size:"sm",variant:"outline",onClick:()=>a(t+1),isDisabled:t===n,"aria-label":"Dal\u0161\xed str\xe1nka",children:(0,ne.jsx)(te.v,{})})]})}var ie=n(97541),oe=n(82459),re=n(82846),se=n(75780),le=n(91765),ce=n(15983),de=n(91933),ue=n(68707),he=n(33192),me=n(72515),pe=n(80810);function xe(e){let{isOpen:t,onClose:n,message:a,onDelete:o,onMarkAsRead:c}=e;const d=(0,s.d)(),{hasCopied:p,onCopy:x}=((0,O.jE)(),(0,ie.i)(a.email)),{isOpen:v,onOpen:j,onClose:b}=(0,r.j)(),[y,f]=(0,i.useState)(""),k=(0,K.n)({mutationFn:e=>Y(a.id,e),onSuccess:()=>{d({title:"Zpr\xe1va p\u0159epos\xedl\xe1na",description:"Zpr\xe1va bude odesl\xe1na na ".concat(y),status:"success",duration:3e3,isClosable:!0}),f(""),b()},onError:()=>{d({title:"Chyba",description:"Nepoda\u0159ilo se p\u0159eposlat zpr\xe1vu",status:"error",duration:3e3,isClosable:!0})}});return(0,ne.jsxs)(A.aF,{isOpen:t,onClose:n,size:"xl",children:[(0,ne.jsx)(C.m,{}),(0,ne.jsxs)(E.$,{children:[(0,ne.jsx)(T.r,{children:(0,ne.jsxs)(l.a,{children:[(0,ne.jsx)(u.E,{fontSize:"lg",fontWeight:"bold",children:a.subject||"Bez p\u0159edm\u011btu"}),(0,ne.jsxs)(h.z,{mt:1,fontSize:"sm",color:"gray.500",children:[(0,ne.jsx)(u.E,{children:(_=a.createdAt,(0,B.GP)(new Date(_),"d. M. yyyy HH:mm",{locale:Z.cs}))}),!a.isRead&&(0,ne.jsx)(z.E,{colorScheme:"blue",children:"Nov\xe1 zpr\xe1va"}),a.source&&(0,ne.jsx)(z.E,{colorScheme:"sponsor"===a.source?"purple":"gray",children:"sponsor"===a.source?"Sponzor":"Kontakt"})]})]})}),(0,ne.jsx)(D.s,{}),(0,ne.jsx)(N.c,{children:(0,ne.jsxs)(R.T,{align:"stretch",spacing:4,children:[(0,ne.jsxs)(l.a,{children:[(0,ne.jsx)(u.E,{fontWeight:"bold",mb:1,children:"Od:"}),(0,ne.jsxs)(h.z,{children:[(0,ne.jsx)(u.E,{children:a.name}),(0,ne.jsxs)(h.z,{as:"button",onClick:()=>{x(),d({title:"E-mail zkop\xedrov\xe1n do schr\xe1nky",status:"success",duration:2e3,isClosable:!0})},color:"blue.500",_hover:{textDecoration:"underline"},spacing:1,children:[(0,ne.jsxs)(u.E,{children:["<",a.email,">"]}),p?(0,ne.jsx)(me.S,{boxSize:3}):(0,ne.jsx)(pe.T,{boxSize:3})]})]})]}),(0,ne.jsx)(oe.c,{}),(0,ne.jsxs)(l.a,{children:[(0,ne.jsx)(u.E,{fontWeight:"bold",mb:2,children:"Zpr\xe1va:"}),(0,ne.jsx)(u.E,{whiteSpace:"pre-wrap",p:3,bg:"gray.50",borderRadius:"md",children:a.message})]}),(a.ipAddress||a.userAgent)&&(0,ne.jsxs)(l.a,{mt:4,fontSize:"sm",color:"gray.500",children:[(0,ne.jsx)(u.E,{fontWeight:"bold",mb:1,children:"Technick\xe9 informace:"}),a.ipAddress&&(0,ne.jsxs)(u.E,{children:[(0,ne.jsx)(u.E,{as:"span",fontWeight:"medium",children:"IP adresa:"})," ",a.ipAddress]}),a.userAgent&&(0,ne.jsxs)(u.E,{mt:1,isTruncated:!0,title:a.userAgent,children:[(0,ne.jsx)(u.E,{as:"span",fontWeight:"medium",children:"Prohl\xed\u017ee\u010d:"})," ",a.userAgent.length>50?"".concat(a.userAgent.substring(0,47),"..."):a.userAgent]})]})]})}),(0,ne.jsx)(I.j,{children:(0,ne.jsxs)(h.z,{spacing:2,flexWrap:"wrap",justify:"flex-end",w:"full",children:[(0,ne.jsx)(m.$,{variant:"outline",colorScheme:"red",leftIcon:(0,ne.jsx)(L.d,{}),onClick:o,size:{base:"sm",md:"md"},children:"Smazat"}),(0,ne.jsxs)(re.A,{isOpen:v,onClose:b,children:[(0,ne.jsx)(se.W,{children:(0,ne.jsx)(m.$,{colorScheme:"teal",leftIcon:(0,ne.jsx)(M.s,{}),onClick:j,size:{base:"sm",md:"md"},children:"P\u0159eposlat"})}),(0,ne.jsxs)(le.h,{children:[(0,ne.jsx)(ce.R,{}),(0,ne.jsx)(de.q,{}),(0,ne.jsx)(ue.D,{children:"P\u0159eposlat zpr\xe1vu"}),(0,ne.jsx)(he.e,{children:(0,ne.jsxs)(R.T,{spacing:3,children:[(0,ne.jsxs)(F.MJ,{children:[(0,ne.jsx)(P.l,{fontSize:"sm",children:"E-mailov\xe1 adresa"}),(0,ne.jsx)(g.p,{placeholder:"prijemce@email.cz",value:y,onChange:e=>f(e.target.value),type:"email",size:"sm"})]}),(0,ne.jsx)(m.$,{size:"sm",colorScheme:"teal",width:"full",onClick:()=>{y&&y.includes("@")?k.mutate(y):d({title:"Chyba",description:"Zadejte platnou e-mailovou adresu",status:"error",duration:3e3})},isLoading:k.isLoading,children:"Odeslat"})]})})]})]}),!a.isRead&&(0,ne.jsx)(m.$,{colorScheme:"blue",leftIcon:(0,ne.jsx)(U.a,{}),onClick:c,size:{base:"sm",md:"md"},children:"Ozna\u010dit jako p\u0159e\u010dten\xe9"}),(0,ne.jsx)(m.$,{variant:"ghost",onClick:n,size:{base:"sm",md:"md"},children:"Zav\u0159\xedt"})]})})]})]});var _}var ge=n(32396),ve=n(29066);function je(){const e=(0,o.dU)("white","gray.800"),[t,n]=((0,o.dU)("gray.200","gray.700"),(0,o.dU)("white","gray.700"),(0,i.useState)([])),[H,Y]=(0,i.useState)(""),[ee,te]=(0,i.useState)("all"),[ie,oe]=(0,i.useState)({field:"createdAt",order:"desc"}),[re,se]=(0,i.useState)({page:1,limit:10}),{isOpen:le,onOpen:ce,onClose:de}=(0,r.j)(),{isOpen:ue,onOpen:he,onClose:me}=(0,r.j)(),{isOpen:pe,onOpen:je,onClose:be}=(0,r.j)(),[ye,fe]=(0,i.useState)(""),[ke,_e]=(0,i.useState)(!0),{user:we}=(0,ve.A)(),[ze,Se]=(0,i.useState)(null),Ae=(0,s.d)(),Ce=(0,O.jE)(),{data:Ee,isLoading:Te,isError:De}=(0,q.I)({queryKey:["admin","contact-messages",(0,a.A)((0,a.A)({},re),{},{searchTerm:H,statusFilter:ee,sortBy:ie})],queryFn:()=>$({page:re.page,limit:re.limit,search:H,isRead:"all"===ee?void 0:"read"===ee,sortBy:ie.field,sortOrder:ie.order}),keepPreviousData:!0}),Ne=(0,K.n)({mutationFn:J,onSuccess:()=>{Ce.invalidateQueries({queryKey:["admin","contact-messages"]}),Ae({title:"Zpr\xe1va ozna\u010dena jako p\u0159e\u010dten\xe1",status:"success",duration:3e3,isClosable:!0})}}),Re=(0,K.n)({mutationFn:G,onSuccess:()=>{Ce.invalidateQueries({queryKey:["admin","contact-messages"]}),Ae({title:"Zpr\xe1va smaz\xe1na",status:"success",duration:3e3,isClosable:!0})}}),Fe=(0,K.n)({mutationFn:X,onSuccess:()=>{Ce.invalidateQueries({queryKey:["admin","contact-messages"]}),n([]),Ae({title:"Vybran\xe9 zpr\xe1vy byly smaz\xe1ny",status:"success",duration:3e3,isClosable:!0})}}),Pe=(0,K.n)({mutationFn:e=>Q(e.emails,{saveDefault:e.saveDefault}),onSuccess:e=>{Ae({title:"Zpr\xe1vy se p\u0159epos\xedlaj\xed",description:e.message||"V\u0161echny zpr\xe1vy budou p\u0159eposl\xe1ny na zadan\xfd e-mail",status:"success",duration:5e3,isClosable:!0}),fe(""),be()},onError:()=>{Ae({title:"Chyba",description:"Nepoda\u0159ilo se p\u0159eposlat zpr\xe1vy",status:"error",duration:3e3,isClosable:!0})}}),Ie=e=>{Se(e),he()};(0,i.useEffect)(()=>{pe&&(!ye&&null!==we&&void 0!==we&&we.email&&fe(we.email),_e(!0))},[pe,null===we||void 0===we?void 0:we.email]);const Me=e=>{oe(t=>({field:e,order:t.field===e&&"asc"===t.order?"desc":"asc"}))},Le=e=>ie.field!==e?null:"asc"===ie.order?"\u2191":"\u2193";return(0,ne.jsxs)(V.A,{children:[(0,ne.jsxs)(l.a,{p:6,children:[(0,ne.jsxs)(c.s,{justify:"space-between",align:"center",mb:6,children:[(0,ne.jsxs)(l.a,{children:[(0,ne.jsx)(d.D,{size:"lg",mb:2,children:"P\u0159\xedchoz\xed zpr\xe1vy"}),(0,ne.jsx)(u.E,{color:"gray.600",children:"Spravujte p\u0159\xedchoz\xed zpr\xe1vy z kontaktn\xedho formul\xe1\u0159e"})]}),(0,ne.jsxs)(h.z,{spacing:3,flexWrap:"wrap",children:[(0,ne.jsx)(m.$,{colorScheme:"teal",variant:"outline",leftIcon:(0,ne.jsx)(M.s,{}),onClick:je,size:{base:"sm",md:"md"},children:"P\u0159eposlat v\u0161e"}),t.length>0&&(0,ne.jsxs)(m.$,{colorScheme:"red",variant:"outline",leftIcon:(0,ne.jsx)(L.d,{}),onClick:()=>{t.length>0&&Fe.mutate(t)},isLoading:Fe.isLoading,size:{base:"sm",md:"md"},children:["Smazat vybran\xe9 (",t.length,")"]})]})]}),(0,ne.jsxs)(l.a,{bg:e,borderRadius:"lg",boxShadow:"sm",p:4,mb:6,children:[(0,ne.jsxs)(c.s,{mb:4,gap:4,flexWrap:"wrap",children:[(0,ne.jsxs)(p.M,{maxW:"md",children:[(0,ne.jsx)(x.W,{pointerEvents:"none",children:(0,ne.jsx)(W.Q,{color:"gray.400"})}),(0,ne.jsx)(g.p,{placeholder:"Hledat v zpr\xe1v\xe1ch...",value:H,onChange:e=>Y(e.target.value)})]}),(0,ne.jsxs)(v.l,{value:ee,onChange:e=>te(e.target.value),maxW:"200px",children:[(0,ne.jsx)("option",{value:"all",children:"V\u0161echny zpr\xe1vy"}),(0,ne.jsx)("option",{value:"unread",children:"Nep\u0159e\u010dten\xe9"}),(0,ne.jsx)("option",{value:"read",children:"P\u0159e\u010dten\xe9"})]})]}),(0,ne.jsx)(l.a,{overflowX:"auto",children:(0,ne.jsxs)(j.X,{variant:"simple",children:[(0,ne.jsx)(b.d,{children:(0,ne.jsxs)(y.Tr,{children:[(0,ne.jsx)(f.Th,{w:"40px",children:(0,ne.jsx)(k.S,{isChecked:t.length>0&&t.length===(null===Ee||void 0===Ee?void 0:Ee.data.length),onChange:e=>{e.target.checked?n((null===Ee||void 0===Ee?void 0:Ee.data.map(e=>e.id))||[]):n([])}})}),(0,ne.jsxs)(f.Th,{cursor:"pointer",onClick:()=>Me("name"),_hover:{textDecoration:"underline"},children:["Jm\xe9no ",Le("name")]}),(0,ne.jsxs)(f.Th,{cursor:"pointer",onClick:()=>Me("email"),_hover:{textDecoration:"underline"},children:["E-mail ",Le("email")]}),(0,ne.jsx)(f.Th,{children:"P\u0159edm\u011bt"}),(0,ne.jsx)(f.Th,{children:"Zdroj"}),(0,ne.jsxs)(f.Th,{cursor:"pointer",onClick:()=>Me("createdAt"),_hover:{textDecoration:"underline"},children:["Datum ",Le("createdAt")]}),(0,ne.jsx)(f.Th,{children:"Stav"}),(0,ne.jsx)(f.Th,{w:"120px",children:"Akce"})]})}),(0,ne.jsx)(_.N,{children:Te?(0,ne.jsx)(y.Tr,{children:(0,ne.jsx)(w.Td,{colSpan:8,textAlign:"center",py:8,children:"Na\u010d\xedt\xe1n\xed..."})}):De?(0,ne.jsx)(y.Tr,{children:(0,ne.jsx)(w.Td,{colSpan:8,textAlign:"center",py:8,color:"red.500",children:"Chyba p\u0159i na\u010d\xedt\xe1n\xed zpr\xe1v"})}):0===(null===Ee||void 0===Ee?void 0:Ee.data.length)?(0,ne.jsx)(y.Tr,{children:(0,ne.jsx)(w.Td,{colSpan:8,textAlign:"center",py:8,color:"gray.500",children:"\u017d\xe1dn\xe9 zpr\xe1vy nenalezeny"})}):null===Ee||void 0===Ee?void 0:Ee.data.map(e=>{return(0,ne.jsxs)(y.Tr,{bg:e.isRead?"transparent":"blue.50",_hover:{bg:e.isRead?"gray.50":"blue.50"},children:[(0,ne.jsx)(w.Td,{children:(0,ne.jsx)(k.S,{isChecked:t.includes(e.id),onChange:t=>{return a=e.id,i=t.target.checked,void n(i?e=>[...e,a]:e=>e.filter(e=>e!==a));var a,i}})}),(0,ne.jsx)(w.Td,{fontWeight:e.isRead?"normal":"semibold",children:e.name}),(0,ne.jsx)(w.Td,{children:e.email}),(0,ne.jsx)(w.Td,{maxW:"200px",isTruncated:!0,title:e.subject||"Bez p\u0159edm\u011btu",children:e.subject||"\u2014"}),(0,ne.jsx)(w.Td,{children:"sponsor"===e.source?(0,ne.jsx)(z.E,{colorScheme:"purple",children:"Sponzor"}):(0,ne.jsx)(z.E,{colorScheme:"gray",children:"Kontakt"})}),(0,ne.jsx)(w.Td,{whiteSpace:"nowrap",children:(a=e.createdAt,(0,B.GP)(new Date(a),"d. M. yyyy HH:mm",{locale:Z.cs}))}),(0,ne.jsx)(w.Td,{children:e.isRead?(0,ne.jsx)(z.E,{colorScheme:"green",children:"P\u0159e\u010dteno"}):(0,ne.jsx)(z.E,{colorScheme:"blue",children:"Nov\xe1 zpr\xe1va"})}),(0,ne.jsx)(w.Td,{children:(0,ne.jsxs)(h.z,{spacing:2,children:[(0,ne.jsx)(S.K,{"aria-label":"Zobrazit zpr\xe1vu",icon:(0,ne.jsx)(U.a,{}),size:"sm",colorScheme:"blue",variant:"ghost",onClick:()=>(e=>{Se(e),e.isRead||Ne.mutate(e.id),ce()})(e)}),(0,ne.jsx)(S.K,{"aria-label":"Smazat zpr\xe1vu",icon:(0,ne.jsx)(L.d,{}),size:"sm",colorScheme:"red",variant:"ghost",onClick:()=>Ie(e),isLoading:Re.isLoading&&Re.variables===e.id})]})})]},e.id);var a})})]})}),Ee&&Ee.total>0&&(0,ne.jsxs)(c.s,{justify:"space-between",mt:4,alignItems:"center",children:[(0,ne.jsxs)(u.E,{color:"gray.600",fontSize:"sm",children:["Zobrazeno ",Ee.data.length," z ",Ee.total," zpr\xe1v"]}),(0,ne.jsx)(ae,{currentPage:re.page,totalPages:Ee.totalPages||1,onPageChange:e=>se(t=>(0,a.A)((0,a.A)({},t),{},{page:e}))})]})]})]}),ze&&(0,ne.jsx)(xe,{isOpen:le,onClose:de,message:ze,onDelete:()=>{de(),Ie(ze)},onMarkAsRead:()=>Ne.mutate(ze.id)}),(0,ne.jsx)(ge.A,{isOpen:ue,onClose:me,onConfirm:()=>{ze&&Re.mutate(ze.id),me()},title:"Smazat zpr\xe1vu",message:"Opravdu chcete smazat tuto zpr\xe1vu? Tato akce je nevratn\xe1.",confirmText:"Smazat",cancelText:"Zru\u0161it",isDanger:!0,isLoading:Re.isLoading}),(0,ne.jsxs)(A.aF,{isOpen:pe,onClose:be,children:[(0,ne.jsx)(C.m,{}),(0,ne.jsxs)(E.$,{children:[(0,ne.jsx)(T.r,{children:"P\u0159eposlat v\u0161echny zpr\xe1vy"}),(0,ne.jsx)(D.s,{}),(0,ne.jsx)(N.c,{children:(0,ne.jsxs)(R.T,{spacing:4,children:[(0,ne.jsx)(u.E,{children:"V\u0161echny p\u0159\xedchoz\xed zpr\xe1vy budou p\u0159eposl\xe1ny na zadanou e-mailovou adresu."}),(0,ne.jsxs)(F.MJ,{isRequired:!0,children:[(0,ne.jsx)(P.l,{children:"E-mailov\xe1 adresa"}),(0,ne.jsx)(g.p,{type:"email",placeholder:"nap\u0159. ja@klub.cz, info@klub.cz",value:ye,onChange:e=>fe(e.target.value)})]}),(0,ne.jsx)(h.z,{w:"full",justify:"space-between",children:(0,ne.jsx)(k.S,{isChecked:ke,onChange:e=>_e(e.target.checked),children:"Ulo\u017eit jako v\xfdchoz\xed (automaticky p\u0159epos\xedlat nov\xe9 zpr\xe1vy)"})})]})}),(0,ne.jsxs)(I.j,{children:[(0,ne.jsx)(m.$,{variant:"ghost",mr:3,onClick:be,children:"Zru\u0161it"}),(0,ne.jsx)(m.$,{colorScheme:"teal",onClick:()=>{ye&&ye.includes("@")?Pe.mutate({emails:ye,saveDefault:ke}):Ae({title:"Chyba",description:"Zadejte platnou e-mailovou adresu",status:"error",duration:3e3})},isLoading:Pe.isLoading,children:"P\u0159eposlat"})]})]})]})]})}},33084:(e,t,n)=>{n.r(t),n.d(t,{default:()=>A});var a=n(65043),i=n(35475),o=n(87139),r=n(22107),s=n(98662),l=n(44093),c=n(98939),d=n(73212),u=n(33572),h=n(76659),m=n(96148),p=n(10202),x=n(28846),g=n(39081),v=n(28646),j=n(70764),b=n(70067),y=n(40378),f=n(46291),k=n(81398),_=n(49367),w=n(74117),z=n(70579);const S=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){let a="";try{const e="http://127.0.0.1:8080".trim();e&&(a=new URL(e,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin)}catch(t){}if(!a)try{a=new URL(f.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin}catch(n){}return new URL(e,a||("undefined"!==typeof window?window.location.origin:"http://localhost:3000")).toString()}return e}catch(a){return e}},A=()=>{const{t:e}=(0,w.Bd)(),[t,n]=(0,a.useState)([]),[f,A]=(0,a.useState)(!0),[C,E]=(0,a.useState)(""),[T,D]=(0,a.useState)("https://zonerama.com"),N=(0,l.dU)("#f8f9fb","#0f1115"),R=(0,l.dU)("white","#1a1d29"),F=(0,l.dU)("#e5e7eb","#2a2e3a"),P=(0,l.dU)("gray.800","gray.100"),I=(0,l.dU)("gray.600","gray.300"),M=((0,l.dU)("blue.50","blue.900"),(0,l.dU)("blue.200","blue.700"),(0,l.dU)("blue.800","blue.200"),(0,l.dU)("red.50","red.900")),L=(0,l.dU)("red.200","red.700"),W=(0,l.dU)("red.600","red.300");return(0,a.useEffect)(()=>{(async()=>{A(!0),E("");try{const[e,t]=await Promise.allSettled([fetch(S("/cache/prefetch/zonerama_profile.json"),{cache:"no-cache"}),fetch(S("/cache/prefetch/zonerama_albums.json"),{cache:"no-cache"})]);let a=[];if("fulfilled"===e.status&&e.value.ok){const t=await e.value.json();a=[...t.albums||[]],t.input_link&&D(t.input_link)}if("fulfilled"===t.status&&t.value.ok){const e=await t.value.json(),n=(Array.isArray(e)?e:[]).filter(e=>e.id&&e.title&&!a.some(t=>t.id===e.id));a=[...a,...n]}a.sort((e,t)=>{const n=e=>{if(!e)return new Date(0);const t=e.split(/[.\s]+/).filter(Boolean);if(3===t.length){const[e,n,a]=t;return new Date("".concat(a,"-").concat(n.padStart(2,"0"),"-").concat(e.padStart(2,"0")))}return new Date(e)};return n(t.date).getTime()-n(e.date).getTime()}),n(a)}catch(t){E(t.message||e("gallery.error_loading_albums"))}finally{A(!1)}})()},[]),(0,z.jsxs)(y.A,{children:[(0,z.jsxs)(_.mg,{children:[(0,z.jsx)("title",{children:e("gallery.page_title")}),(0,z.jsx)("meta",{name:"description",content:e("gallery.page_description")})]}),(0,z.jsx)(r.a,{bg:N,minH:"100vh",py:8,children:(0,z.jsxs)(c.m,{maxW:"7xl",children:[(0,z.jsx)(p.T,{align:"stretch",spacing:6,mb:8,children:(0,z.jsx)(x.D,{size:"2xl",color:P,children:e("gallery.page_title")})}),f&&(0,z.jsxs)(p.T,{spacing:4,py:12,children:[(0,z.jsx)(h.y,{size:"xl",color:"brand.primary"}),(0,z.jsx)(g.E,{color:I,children:e("gallery.loading_albums")})]}),C&&!f&&(0,z.jsx)(r.a,{bg:M,borderWidth:"1px",borderColor:L,borderRadius:"md",p:4,textAlign:"center",children:(0,z.jsx)(g.E,{color:W,children:C})}),!f&&!C&&0===t.length&&(0,z.jsx)(r.a,{bg:R,borderWidth:"1px",borderColor:F,borderRadius:"lg",p:12,textAlign:"center",children:(0,z.jsxs)(p.T,{spacing:4,children:[(0,z.jsx)(b.A,{size:48,color:"gray"}),(0,z.jsx)(x.D,{size:"md",color:I,children:e("gallery.no_albums")}),(0,z.jsx)(g.E,{color:I,children:e("gallery.albums_will_appear")})]})}),!f&&!C&&t.length>0&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(d.r,{columns:{base:1,md:2,lg:3},spacing:6,children:t.map(t=>{const n=t.photos&&t.photos.length>0?t.photos[0]:null;return(0,z.jsxs)(r.a,{as:i.N_,to:"/galerie/album/".concat(t.id),bg:R,borderRadius:"lg",overflow:"hidden",boxShadow:"md",borderWidth:"1px",borderColor:F,transition:"all 0.2s",_hover:{transform:"translateY(-4px)",boxShadow:"xl",borderColor:(0,l.dU)("gray.300","gray.600")},cursor:"pointer",children:[n?(0,z.jsx)(u._,{src:S(n.image_1500),alt:t.title,w:"100%",h:"250px",objectFit:"cover",loading:"lazy"}):(0,z.jsx)(r.a,{w:"100%",h:"250px",bg:"gray.200",display:"flex",alignItems:"center",justifyContent:"center",children:(0,z.jsx)(b.A,{size:48,color:"gray"})}),(0,z.jsxs)(p.T,{align:"stretch",p:4,spacing:3,children:[(0,z.jsx)(x.D,{size:"md",color:P,noOfLines:2,children:t.title}),(0,z.jsxs)(m.z,{spacing:4,flexWrap:"wrap",fontSize:"sm",color:I,children:[t.date&&(0,z.jsxs)(m.z,{spacing:1,children:[(0,z.jsx)(v.A,{size:16}),(0,z.jsx)(g.E,{children:t.date})]}),(0,z.jsxs)(m.z,{spacing:1,children:[(0,z.jsx)(b.A,{size:16}),(0,z.jsx)(g.E,{children:1===t.photos_count?e("gallery.photos_count_one",{count:t.photos_count}):t.photos_count>=2&&t.photos_count<=4?e("gallery.photos_count_few",{count:t.photos_count}):e("gallery.photos_count_many",{count:t.photos_count})})]})]}),void 0!==t.views_count&&t.views_count>0&&(0,z.jsx)(m.z,{children:(0,z.jsx)(o.E,{colorScheme:"purple",fontSize:"xs",children:1===t.views_count?e("gallery.views_count_one",{count:t.views_count}):t.views_count>=2&&t.views_count<=4?e("gallery.views_count_few",{count:t.views_count}):e("gallery.views_count_many",{count:t.views_count})})})]})]},t.id)})}),(0,z.jsx)(r.a,{textAlign:"center",mt:8,children:(0,z.jsx)(s.$,{as:"a",href:T,target:"_blank",rel:"noopener noreferrer",rightIcon:(0,z.jsx)(j.A,{size:18}),colorScheme:"blue",size:"lg",variant:"outline",children:e("gallery.show_more_on_zonerama")})})]})]})}),(0,z.jsx)(k.A,{})]})}},34636:(e,t,n)=>{n.d(t,{A0:()=>c,GE:()=>d,N6:()=>h,Om:()=>r,PI:()=>v,QM:()=>g,Z6:()=>l,a:()=>p,iZ:()=>m,l6:()=>x,nX:()=>s,vO:()=>u});var a=n(89379),i=n(46291);const o=e=>{var t,n,i,o,r,s;if(!e)return e;const l=null!==(t=null!==(n=null!==(i=e.id)&&void 0!==i?i:e.ID)&&void 0!==n?n:e.article_id)&&void 0!==t?t:e.articleId,c=null!==(o=e.category)&&void 0!==o?o:e.Category,d=null!==(r=e.author)&&void 0!==r?r:e.Author;let u;const h=null!==(s=e.attachments)&&void 0!==s?s:e.Attachments;try{if(Array.isArray(h))u=h.map(e=>{if("string"===typeof e){return{name:e.split("/").pop()||"soubor",url:e}}return{name:(null===e||void 0===e?void 0:e.name)||String((null===e||void 0===e?void 0:e.url)||"").split("/").pop()||"soubor",url:(null===e||void 0===e?void 0:e.url)||"",mime_type:(null===e||void 0===e?void 0:e.mime_type)||(null===e||void 0===e?void 0:e.type),size:null===e||void 0===e?void 0:e.size}});else if("string"===typeof h&&""!==h.trim()){const e=JSON.parse(h);Array.isArray(e)&&(u=e.map(e=>{if("string"===typeof e){return{name:e.split("/").pop()||"soubor",url:e}}return{name:(null===e||void 0===e?void 0:e.name)||String((null===e||void 0===e?void 0:e.url)||"").split("/").pop()||"soubor",url:(null===e||void 0===e?void 0:e.url)||"",mime_type:(null===e||void 0===e?void 0:e.mime_type)||(null===e||void 0===e?void 0:e.type),size:null===e||void 0===e?void 0:e.size}}))}}catch(m){}return(0,a.A)((0,a.A)({},e),{},{id:l,category:c,author:d},u?{attachments:u}:{})};async function r(e){return(await i.Ay.get("/articles/".concat(e,"/match-link"))).data}async function s(e,t){return(await i.Ay.post("/articles/".concat(e,"/match-link"),t)).data}async function l(e){return(await i.Ay.delete("/articles/".concat(e,"/match-link"))).data}async function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(await i.Ay.get("/articles/featured",{params:e})).data||{},n=(Array.isArray(t.items)?t.items:Array.isArray(t.data)?t.data:[]).map(e=>o(e));return{data:n,total:"number"===typeof t.total?t.total:n.length,page:"number"===typeof t.page?t.page:e.page||1,page_size:"number"===typeof t.page_size?t.page_size:e.page_size||n.length}}async function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(await i.Ay.get("/articles",{params:e})).data||{},n=(Array.isArray(t.items)?t.items:Array.isArray(t.data)?t.data:[]).map(e=>o(e));return{data:n,total:"number"===typeof t.total?t.total:"number"===typeof t.count?t.count:n.length,page:"number"===typeof t.page?t.page:e.page||1,page_size:"number"===typeof t.page_size?t.page_size:e.page_size||n.length}}async function u(e){const t=await i.Ay.get("/articles/".concat(e));return o(t.data)}async function h(e){const t=await i.Ay.post("/articles",e);return o(t.data)}async function m(e,t){const n=await i.Ay.put("/articles/".concat(e),t);return o(n.data)}async function p(e){return(await i.Ay.delete("/articles/".concat(e))).data}async function x(e){try{const t=await i.Ay.get("/articles/slug/".concat(encodeURIComponent(e)));return o(t.data)}catch(n){var t;return null===(t=(await d({slug:e})).data)||void 0===t?void 0:t[0]}}async function g(e){const t=new FormData;t.append("file",e);const n=(await i.Ay.post("/upload",t)).data;let o=n.url||"";try{const e=new URL(o,window.location.origin),t=window.location.origin,n=new URL(i.API_URL).origin;(e.origin===t||e.origin===n)&&(o=e.pathname+e.search+e.hash)}catch(r){}return(0,a.A)((0,a.A)({},n),{},{url:o})}async function v(e){try{await i.Ay.post("/articles/".concat(e,"/track-view"),{})}catch(t){console.debug("Failed to track article view:",t)}}},35200:(e,t,n)=>{n.d(t,{G:()=>c,s:()=>l});var a=n(89379),i=n(65043),o=n(32396),r=n(70579);const s=(0,i.createContext)(void 0),l=e=>{let{children:t}=e;const[n,l]=(0,i.useState)({isOpen:!1,title:"",message:"",confirmText:"Potvrdit",cancelText:"Zru\u0161it",isDanger:!1,isLoading:!1}),c=(0,i.useRef)(null),d=(0,i.useCallback)(()=>{l(e=>(0,a.A)((0,a.A)({},e),{},{isOpen:!1,isLoading:!1})),c.current&&(c.current.resolve(!1),c.current=null)},[]),u=(0,i.useCallback)(()=>{l(e=>(0,a.A)((0,a.A)({},e),{},{isLoading:!1,isOpen:!1})),c.current&&(c.current.resolve(!0),c.current=null)},[]),h=(0,i.useCallback)(e=>new Promise(t=>{c.current={resolve:t},l({isOpen:!0,title:e.title||"Potvrzen\xed",message:e.message||"",confirmText:e.confirmText||"Potvrdit",cancelText:e.cancelText||"Zru\u0161it",isDanger:e.isDanger||!1,isLoading:!1})}),[]);return(0,r.jsxs)(s.Provider,{value:{confirm:h},children:[t,(0,r.jsx)(o.A,{isOpen:n.isOpen,onClose:d,onConfirm:u,title:n.title,message:n.message,confirmText:n.confirmText,cancelText:n.cancelText,isDanger:n.isDanger,isLoading:n.isLoading})]})},c=()=>{const e=(0,i.useContext)(s);if(!e)throw new Error("useConfirmDialog must be used within ConfirmDialogProvider");return e}},35315:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ze});var a=n(89379),i=n(65043),o=n(6583),r=n(44093),s=n(30502),l=n(96870),c=n(22107),d=n(96148),u=n(28846),h=n(98662),m=n(58861),p=n(80511),x=n(3313),g=n(55395),v=n(83201),j=n(82595),b=n(67813),y=n(33572),f=n(10202),k=n(39081),_=n(87139),w=n(42703),z=n(78460),S=n(11054),A=n(85421),C=n(15071),E=n(35929),T=n(67516),D=n(48239),N=n(73225),R=n(76668),F=n(61724),P=n(98481),I=n(99956),M=n(35699),L=n(73212),W=n(56529),U=n(1009),O=n(59781),q=n(72526),K=n(12836),B=n(34636),Z=n(38376),V=n(46291),H=n(74770),$=n(50271),J=n(29066),G=n(97717),X=n(40384),Y=n(70082),Q=n(91896),ee=n(88787),te=n(85871),ne=n(33430),ae=n(34334),ie=n(82459),oe=n(77327),re=n(85369),se=n(70579);const le=e=>{let{title:t,content:n,onTranslationComplete:a,disabled:i=!1,contentType:o="article"}=e;const{translateBlog:r,isTranslating:s,translationError:l,detectSourceLanguage:u,getTargetLanguage:m}=(0,oe.d)(),p=u(t+" "+n),x=m();if(!(p!==x&&t&&n))return(0,se.jsxs)(ee.F,{status:"info",borderRadius:"md",children:[(0,se.jsx)(te._,{as:re.gqt}),(0,se.jsxs)(c.a,{children:[(0,se.jsx)(ne.X,{children:"Translation not needed"}),(0,se.jsxs)(ae.T,{children:["Content is already in ","cs"===p?"Czech":"English"," or the target language is the same."]})]})]});const g=()=>{switch(o){case"activity":return"Activity";case"page":return"Page";case"sponsor":return"Sponsor";case"player":return"Player";default:return"Content"}};return(0,se.jsxs)(f.T,{spacing:3,align:"stretch",children:[(0,se.jsxs)(c.a,{children:[(0,se.jsxs)(d.z,{spacing:2,mb:2,children:[(0,se.jsx)(re.gqt,{}),(0,se.jsxs)(k.E,{fontWeight:"medium",children:["Translate ",g()," from ","cs"===p?"Czech":"English"," to ","cs"===x?"Czech":"English"]})]}),(0,se.jsx)(h.$,{colorScheme:"blue",onClick:async()=>{try{const e=await r(t,n);a(e.title,e.content)}catch(e){}},isLoading:s,loadingText:"Translating...",leftIcon:(0,se.jsx)(re.gqt,{}),disabled:i||s,size:"sm",children:s?"Translating...":"Translate ".concat(g())})]}),l&&(0,se.jsxs)(ee.F,{status:"error",borderRadius:"md",children:[(0,se.jsx)(te._,{as:re.BS8}),(0,se.jsxs)(c.a,{children:[(0,se.jsx)(ne.X,{children:"Translation Failed"}),(0,se.jsx)(ae.T,{children:l})]})]}),!s&&!l&&(0,se.jsxs)(ee.F,{status:"success",borderRadius:"md",children:[(0,se.jsx)(te._,{as:re.CMH}),(0,se.jsxs)(c.a,{children:[(0,se.jsx)(ne.X,{children:"Ready to Translate"}),(0,se.jsxs)(ae.T,{children:["Click the translate button to convert this ",g().toLowerCase()," to ","cs"===x?"Czech":"English","."]})]})]}),(0,se.jsx)(ie.c,{})]})};var ce=n(74138),de=n(24122),ue=n(24346),he=n(79787),me=n(66776),pe=n(46367),xe=n(25189),ge=n(47704),ve=n(72898),je=n(2367),be=n(88500),ye=n(60215),fe=n(23978),ke=(n(31629),n(63988)),_e=n(89962);const we=[{value:"match",label:"Z\xe1pas"},{value:"training",label:"Tr\xe9nink"},{value:"meeting",label:"Sch\u016fzka"},{value:"other",label:"Jin\xe9"}],ze=()=>{var e,t,n,ee,te;const{user:ne}=(0,J.A)(),ae="admin"===(null===ne||void 0===ne?void 0:ne.role),ie=(0,r.dU)("white","gray.800"),oe=(0,r.dU)("gray.200","gray.700"),re=((0,r.dU)("white","gray.700"),(0,r.dU)("gray.600","gray.400")),ze=(0,s.d)(),Se=(0,O.jE)(),{isOpen:Ae,onOpen:Ce,onClose:Ee}=(0,l.j)(),[Te,De]=(0,i.useState)(null),[Ne,Re]=(0,i.useState)(""),[Fe,Pe]=(0,i.useState)(null),[Ie,Me]=(0,i.useState)(""),[Le,We]=(0,i.useState)(!1),[Ue,Oe]=(0,i.useState)(void 0),[qe,Ke]=(0,i.useState)(null),[Be,Ze]=(0,i.useState)("informative"),[Ve,He]=(0,i.useState)(!0),[$e,Je]=(0,i.useState)((0,fe.xU)()),[Ge,Xe]=(0,i.useState)(void 0),[Ye,Qe]=(0,i.useState)(void 0),[et,tt]=(0,i.useState)([]),[nt,at]=(0,i.useState)("club"),[it,ot]=(0,i.useState)([]),[rt,st]=(0,i.useState)(""),[lt,ct]=(0,i.useState)(!1),{saveStatus:dt,lastSaved:ut,forceSave:ht,clearDraft:mt}=(0,me.UI)({data:Te||{},storageKey:Ne,onSave:async e=>{var t;if(e.id)try{return await(0,Z.qM)(e.id,e)}catch(o){var n;var i;if(404===(null===o||void 0===o||null===(n=o.response)||void 0===n?void 0:n.status))if(null!==(i=e.title)&&void 0!==i&&i.trim()&&e.start_time){const t=await(0,Z.lh)(e);if(null!==t&&void 0!==t&&t.id){De(e=>(0,a.A)((0,a.A)({},e),{},{id:t.id})),Re("draft-activity-".concat(t.id));try{localStorage.removeItem("draft-activity-new")}catch(r){}}return t}throw o}if(null!==(t=e.title)&&void 0!==t&&t.trim()&&e.start_time){const t=await(0,Z.lh)(e);if(null!==t&&void 0!==t&&t.id){De(e=>(0,a.A)((0,a.A)({},e),{},{id:t.id})),Re("draft-activity-".concat(t.id));try{localStorage.removeItem("draft-activity-new")}catch(s){}}return t}return{}},debounceMs:2e3,enabled:Ae&&null!==Te}),pt=i.useCallback(()=>{try{const e="draft-activity-new",t=(0,me.TS)(e);if(t&&t.age<1440){const t=(0,me.C_)(e);if(t){const e=(0,a.A)({},t);return e.id&&delete e.id,void Pe(e)}}}catch(e){}Pe(null)},[]);i.useEffect(()=>{pt()},[pt]);const{data:xt,isLoading:gt}=(0,q.I)({queryKey:["admin-events"],queryFn:()=>(0,Z.kQ)()}),vt=xt||[],[jt,bt]=(0,i.useState)(""),[yt,ft]=(0,i.useState)(""),kt=i.useMemo(()=>vt.filter(e=>{const t=e.start_time,n=t?new Date(t).getTime():NaN;if(isNaN(n))return!0;if(jt){const e=new Date(jt+"T00:00:00").getTime();if(!isNaN(e)&&n<e)return!1}if(yt){const e=new Date(yt+"T23:59:59").getTime();if(!isNaN(e)&&n>e)return!1}return!0}),[vt,jt,yt]),_t=e=>{const t=String(e||"").trim(),n=we.find(e=>e.value===t);return n?n.label:"Jin\xe9"};(0,i.useEffect)(()=>{(async()=>{try{const e=await(0,ue.S)();null!==e&&void 0!==e&&e.videos&&tt(e.videos.slice(0,20))}catch(e){console.error("Failed to load YouTube videos:",e)}})()},[]);const wt=(0,q.I)({queryKey:["public-settings"],queryFn:H.l3,staleTime:3e5});(0,i.useEffect)(()=>{try{const e=localStorage.getItem("admin_saved_locations"),t=e?JSON.parse(e):[],n=wt.data||{},a=[n.contact_address,n.contact_city,n.contact_zip].filter(e=>String(e||"").trim()).join(", "),i="number"===typeof n.location_latitude&&"number"===typeof n.location_longitude&&!isNaN(n.location_latitude)&&!isNaN(n.location_longitude),o=n.club_name?"Klub \u2013 ".concat(n.club_name):"Klub \u2013 Hlavn\xed m\xedsto";if(a||i){t.some(e=>a&&e.address===a||i&&e.lat===n.location_latitude&&e.lng===n.location_longitude)||t.unshift({id:"club-main",label:o,address:a||n.contact_city||"Klub",lat:i?n.location_latitude:void 0,lng:i?n.location_longitude:void 0})}ot(t)}catch(e){ot([])}},[wt.data]);const zt=e=>{try{localStorage.setItem("admin_saved_locations",JSON.stringify(e))}catch(t){}ot(e)},St=()=>{Re("draft-activity-new"),De(Fe||{title:"",description:"",type:"other",is_public:!0}),Xe(void 0),Qe(void 0),Ce()},At=()=>{De(null),Xe(void 0),Qe(void 0),Ee(),pt()},Ct=(0,K.n)({mutationFn:e=>(0,Z.lh)(e),onSuccess:()=>{ze({title:"Ud\xe1lost vytvo\u0159ena",status:"success"}),Se.invalidateQueries({queryKey:["admin-events"]}),At()},onError:e=>ze({title:"Chyba p\u0159i vytv\xe1\u0159en\xed",description:(null===e||void 0===e?void 0:e.message)||"Do\u0161lo k chyb\u011b",status:"error"})}),Et=(0,K.n)({mutationFn:e=>{let{id:t,payload:n}=e;return(0,Z.qM)(t,n)},onSuccess:()=>{ze({title:"Ud\xe1lost upravena",status:"success"}),Se.invalidateQueries({queryKey:["admin-events"]}),At()},onError:e=>ze({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed",description:(null===e||void 0===e?void 0:e.message)||"Do\u0161lo k chyb\u011b",status:"error"})}),Tt=(0,K.n)({mutationFn:e=>(0,Z.SX)(e),onSuccess:()=>{ze({title:"Smaz\xe1no",status:"success"}),Se.invalidateQueries({queryKey:["admin-events"]})},onError:e=>ze({title:"Smaz\xe1n\xed selhalo",description:(null===e||void 0===e?void 0:e.message)||"Do\u0161lo k chyb\u011b",status:"error"})}),[Dt,Nt]=(0,i.useState)([]),[Rt,Ft]=(0,i.useState)({});(0,i.useEffect)(()=>{(async()=>{try{const n=await(0,H.l3)(),a=(null===n||void 0===n?void 0:n.club_id)||"",i=(null===n||void 0===n?void 0:n.club_type)||"football",o=[];if(a)try{const e=await X.J.getClub(String(a),i);(Array.isArray(null===e||void 0===e?void 0:e.competitions)?e.competitions:[]).forEach(e=>o.push({code:e.code,name:e.name||e.code}))}catch(e){}let r={};try{(await(0,Y.xN)()).forEach(e=>{e.code&&e.alias&&(r[e.code]=e.alias)})}catch(t){}const s=o.map(e=>({code:e.code,name:e.code&&r[e.code]?r[e.code]:e.name}));Ft(r),Nt(s)}catch(n){}})()},[]);const Pt=async()=>{try{var e,t,n;We(!0),Oe(0),Ke(Date.now());const i=setInterval(()=>{Oe(e=>void 0===e||e>=95?e:Math.min(e+15*Math.random()+5,95))},2e3),o=Te||{},s=e=>String(e||"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),l=[],c=String((null===wt||void 0===wt||null===(e=wt.data)||void 0===e?void 0:e.club_name)||"").trim();if(c&&l.push("Klub: ".concat(c)),o.type&&l.push("Typ: ".concat(o.type)),!Ve&&o.description){const e=s(o.description);e&&l.push("St\xe1vaj\xedc\xed text (pro kontext): ".concat(e))}const d=l.join("\n"),u="informative"===Be?"neutr\xe1ln\xedm, v\u011bcn\xfdm a stru\u010dn\xfdm stylem (bez nads\xe1zky)":"formal"===Be?"form\xe1ln\xedm a profesion\xe1ln\xedm stylem (bez p\u0159\xedkras)":"p\u0159\xe1telsk\xfdm, ale v\u011bcn\xfdm a stru\u010dn\xfdm stylem (bez nads\xe1zky)",h=(Ie||"Napi\u0161 kr\xe1tkou neutr\xe1ln\xed pozv\xe1nku na klubovou aktivitu.").trim(),m="Nevkl\xe1dej datum ani m\xedsto (lokalitu) do textu. Neuv\xe1d\u011bj konkr\xe9tn\xed \u010das nebo adresu. Vyh\xfdbej se superlativ\u016fm, hyperbol\xe1m a marketingov\xfdm fr\xe1z\xedm. Nepou\u017e\xedvej slova jako \u201eneopakovateln\xfd\u201c, \u201eepick\xfd\u201c, \u201e\xfachvatn\xfd\u201c apod. Preferuj 2\u20133 kr\xe1tk\xe9 odstavce NEBO stru\u010dn\xfd seznam s odr\xe1\u017ekami. Pou\u017e\xedvej HTML zna\u010dky ul/li pro odr\xe1\u017eky a strong pro zv\xfdrazn\u011bn\xed. Bez nadpis\u016f (nepou\u017e\xedvej H1/H2). Dbej na v\u011bcn\xfd a st\u0159\xedzliv\xfd t\xf3n.",p="".concat(h,"\n\nPi\u0161 ").concat(u,", \u010desky, s d\u016frazem na jasnost a pozv\xe1nku k \xfa\u010dasti. ").concat(m,"\nC\xedlov\xe1 d\xe9lka: 80\u2013120 slov.\nDetaily:\n").concat(d).trim(),{data:x}=await V.FH.post("/ai/blog/generate",{prompt:p,audience:c?"Fanou\u0161ci klubu ".concat(c,", ozn\xe1men\xed/pozv\xe1nka"):"Fanou\u0161ci klubu, ozn\xe1men\xed/pozv\xe1nka",min_words:100,model:$e});clearInterval(i),Oe(100);let g=x;if("string"===typeof x)try{g=JSON.parse(x)}catch(r){throw new Error("AI vr\xe1tila neplatn\xfd form\xe1t odpov\u011bdi")}const v=(0,ke.ry)(String((null===(t=g)||void 0===t?void 0:t.title)||"").trim()),j=(0,ke.F0)(String((null===(n=g)||void 0===n?void 0:n.html)||"").trim(),{cleanText:!0,preserveHtmlTags:!0});if(!v&&!j)throw new Error("AI nevr\xe1tila obsah");De(e=>(0,a.A)((0,a.A)({},e||{}),{},{title:Ve?v||(null===e||void 0===e?void 0:e.title)||"":(null===e||void 0===e?void 0:e.title)||v||"",description:Ve?j||(null===e||void 0===e?void 0:e.description)||"":"".concat((null===e||void 0===e?void 0:e.description)||"").concat(null!==e&&void 0!==e&&e.description?"\n\n":"").concat(j)})),ze({title:"Vygenerov\xe1no pomoc\xed AI",status:"success",duration:3e3})}catch(s){var i,o;console.error("AI generation error:",s),ze({title:"AI generov\xe1n\xed selhalo",description:(null===s||void 0===s||null===(i=s.response)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.error)||(null===s||void 0===s?void 0:s.message)||"Zkuste doplnit v\xedce detail\u016f a opakovat.",status:"error",duration:5e3})}finally{setTimeout(()=>{We(!1),Oe(void 0),Ke(null)},1e3)}},[It,Mt]=(0,i.useState)(""),[Lt,Wt]=(0,i.useState)(""),[Ut,Ot]=(0,i.useState)(""),[qt,Kt]=(0,i.useState)("");(0,i.useEffect)(()=>{const e=null!==Te&&void 0!==Te&&Te.start_time?new Date(Te.start_time):null;if(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0");Mt("".concat(t,"-").concat(n,"-").concat(a)),Wt("".concat(i,":").concat(o))}else Mt(""),Wt("");const t=null!==Te&&void 0!==Te&&Te.end_time?new Date(Te.end_time):null;if(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0");Ot("".concat(e,"-").concat(n,"-").concat(a)),Kt("".concat(i,":").concat(o))}else Ot(""),Kt("")},[null===Te||void 0===Te?void 0:Te.start_time,null===Te||void 0===Te?void 0:Te.end_time]);const Bt=(e,t)=>{if(!e||!t)return null;const n=new Date("".concat(e,"T").concat(t,":00"));return isNaN(n.getTime())?null:n.toISOString()},Zt=!String((null===Te||void 0===Te?void 0:Te.title)||"").trim(),Vt=!It||!Lt;return(0,se.jsx)(o.A,{requireAdmin:!1,children:(0,se.jsxs)(c.a,{children:[(0,se.jsxs)(d.z,{justify:"space-between",mb:4,children:[(0,se.jsx)(u.D,{size:"lg",children:"Aktivity (Ud\xe1losti)"}),(0,se.jsx)(h.$,{leftIcon:(0,se.jsx)(U.GGD,{}),colorScheme:"blue",onClick:St,children:"Nov\xe1 aktivita"})]}),(0,se.jsxs)(m.B,{mb:4,spacing:3,align:"center",children:[(0,se.jsx)(m.Q,{children:(0,se.jsx)(ve.A,{from:jt||void 0,to:yt||void 0,onChange:(e,t)=>{bt(e),ft(t)},size:"sm"})}),(jt||yt)&&(0,se.jsx)(m.Q,{children:(0,se.jsx)(h.$,{size:"sm",variant:"outline",colorScheme:"red",onClick:()=>{bt(""),ft("")},borderRadius:"md",children:"Vymazat filtr"})})]}),(0,se.jsx)(c.a,{bg:ie,borderWidth:"1px",borderRadius:"lg",overflowX:"auto",boxShadow:"sm",mb:6,children:(0,se.jsxs)(p.X,{size:"sm",children:[(0,se.jsx)(x.d,{children:(0,se.jsxs)(g.Tr,{children:[(0,se.jsx)(v.Th,{children:"N\xe1hled"}),(0,se.jsx)(v.Th,{children:"N\xe1zev"}),(0,se.jsx)(v.Th,{children:"Typ"}),(0,se.jsx)(v.Th,{children:"Za\u010d\xe1tek"}),(0,se.jsx)(v.Th,{children:"Konec"}),(0,se.jsx)(v.Th,{children:"M\xedsto"}),(0,se.jsx)(v.Th,{w:"140px",children:"Akce"})]})}),(0,se.jsxs)(j.N,{children:[gt&&(0,se.jsx)(g.Tr,{children:(0,se.jsx)(b.Td,{colSpan:8,children:"Na\u010d\xedt\xe1n\xed\u2026"})}),!gt&&Fe&&(0,se.jsxs)(g.Tr,{opacity:.6,children:[(0,se.jsx)(b.Td,{children:Fe.image_url?(0,se.jsx)(pe.A,{src:(0,xe.uq)(Fe.image_url)||Fe.image_url,alt:Fe.title||"Koncept",size:"48px",previewSize:"350px"}):(0,se.jsx)(y._,{src:(0,xe.uq)(null===(e=wt.data)||void 0===e?void 0:e.club_logo_url)||(0,xe.uq)("/dist/img/logo-club-empty.svg")||"/dist/img/logo-club-empty.svg",alt:"No image",boxSize:"48px",objectFit:"contain",opacity:.3})}),(0,se.jsx)(b.Td,{children:(0,se.jsxs)(f.T,{align:"start",spacing:0,children:[(0,se.jsx)(k.E,{fontWeight:"medium",children:Fe.title||"Bez n\xe1zvu (koncept)"}),(0,se.jsx)(k.E,{fontSize:"xs",color:"gray.500",children:"Koncept (lok\xe1ln\u011b ulo\u017een\xfd)"})]})}),(0,se.jsx)(b.Td,{children:(0,se.jsx)(_.E,{colorScheme:"gray",fontSize:"xs",children:Fe.type?_t(Fe.type):"\u2014"})}),(0,se.jsx)(b.Td,{children:"\u2014"}),(0,se.jsx)(b.Td,{children:"\u2014"}),(0,se.jsx)(b.Td,{children:Fe.location||"\u2014"}),(0,se.jsx)(b.Td,{children:(0,se.jsx)(_.E,{colorScheme:"gray",children:"Koncept"})}),(0,se.jsx)(b.Td,{isNumeric:!0,children:(0,se.jsxs)(d.z,{spacing:1,justify:"flex-end",children:[(0,se.jsx)(w.K,{"aria-label":"Upravit koncept",size:"sm",icon:(0,se.jsx)(U.WXf,{}),onClick:St}),(0,se.jsx)(w.K,{"aria-label":"Smazat koncept",size:"sm",colorScheme:"red",icon:(0,se.jsx)(U.IXo,{}),onClick:()=>{try{localStorage.removeItem("draft-activity-new")}catch(e){}Pe(null),ze({title:"Koncept odstran\u011bn",status:"success",duration:2e3})}})]})})]},"local-draft"),!gt&&kt.map(e=>{var t;return(0,se.jsxs)(g.Tr,{children:[(0,se.jsx)(b.Td,{children:e.image_url?(0,se.jsx)(pe.A,{src:(0,xe.uq)(e.image_url)||e.image_url,alt:e.title,size:"48px",previewSize:"350px"}):(0,se.jsx)(y._,{src:(0,xe.uq)(null===(t=wt.data)||void 0===t?void 0:t.club_logo_url)||(0,xe.uq)("/dist/img/logo-club-empty.svg")||"/dist/img/logo-club-empty.svg",alt:"No image",boxSize:"48px",objectFit:"contain",opacity:.3})}),(0,se.jsx)(b.Td,{children:(0,se.jsxs)(f.T,{align:"start",spacing:0,children:[(0,se.jsx)(k.E,{fontWeight:"medium",children:e.title}),(0,se.jsx)(k.E,{fontSize:"xs",color:"gray.500",children:e.is_public?"\u2713 Ve\u0159ejn\xe1":"\u25cb Koncept"})]})}),(0,se.jsx)(b.Td,{children:_t(e.type)}),(0,se.jsx)(b.Td,{children:new Date(e.start_time).toLocaleString()}),(0,se.jsx)(b.Td,{children:e.end_time?new Date(e.end_time).toLocaleString():"-"}),(0,se.jsx)(b.Td,{children:e.location||"-"}),(0,se.jsx)(b.Td,{children:(0,se.jsxs)(d.z,{children:[(0,se.jsx)(w.K,{"aria-label":"Upravit",size:"sm",icon:(0,se.jsx)(U.WXf,{}),onClick:()=>(e=>{const t="draft-activity-".concat(e.id);Re(t),De((0,a.A)({},e)),e.latitude&&e.longitude?(Xe(e.latitude),Qe(e.longitude)):(Xe(void 0),Qe(void 0)),Ce()})(e)}),(0,se.jsx)(w.K,{"aria-label":"P\u0159elo\u017eit",size:"sm",colorScheme:"blue",icon:(0,se.jsx)(U.VeH,{}),title:"P\u0159elo\u017eit aktivitu",onClick:()=>(async e=>{if(e.title&&e.description)try{const t=(0,Q.od)(e.title+" "+e.description),n="cs"===t?"en":"cs";if(t===n)return void ze({title:"P\u0159eklad nen\xed pot\u0159eba",description:"Aktivita je ji\u017e v c\xedlov\xe9m jazyce.",status:"info",duration:3e3});const a=await(0,Q.IG)(e.title,e.description,t,n);await(0,Z.qM)(e.id,{title:a.translatedTitle,description:a.translatedContent}),Se.invalidateQueries({queryKey:["admin-events"]}),Se.invalidateQueries({queryKey:["events"]}),ze({title:"Aktivita p\u0159elo\u017eena",description:"Aktivita byla p\u0159elo\u017eena z ".concat("cs"===t?"\u010de\u0161tiny":"angli\u010dtiny"," do ").concat("cs"===n?"\u010de\u0161tiny":"angli\u010dtiny","."),status:"success",duration:3e3})}catch(t){ze({title:"Chyba p\u0159i p\u0159ekladu",description:(null===t||void 0===t?void 0:t.message)||"Nepoda\u0159ilo se p\u0159elo\u017eit aktivitu.",status:"error",duration:3e3})}else ze({title:"Nelze p\u0159elo\u017eit",description:"Aktivita mus\xed m\xedt n\xe1zev a popis.",status:"error",duration:3e3})})(e)}),(0,se.jsx)(w.K,{"aria-label":"Smazat",size:"sm",colorScheme:"red",icon:(0,se.jsx)(U.IXo,{}),onClick:()=>Tt.mutate(e.id)}),(0,se.jsx)(w.K,{"aria-label":"Zkr\xe1tit odkaz",size:"sm",icon:(0,se.jsx)(U.ayE,{}),title:"Zkr\xe1tit odkaz pro sd\xedlen\xed",onClick:async()=>{try{const t=window.location.origin,n="".concat(t,"/aktivita/").concat(e.id),a=await(0,ge.fn)({target_url:n,title:e.title,source_type:"event",source_id:e.id,code:"e".concat(e.id)});await navigator.clipboard.writeText(a.short_url),ze({title:"Zkr\xe1cen\xfd odkaz zkop\xedrov\xe1n",description:a.short_url,status:"success",duration:4e3})}catch(t){ze({title:"Vytvo\u0159en\xed odkazu selhalo",description:(null===t||void 0===t?void 0:t.message)||"Zkuste to znovu",status:"error"})}}})]})})]},e.id)})]})]})}),(0,se.jsxs)(z.aF,{isOpen:Ae,onClose:At,isCentered:!0,scrollBehavior:"inside",children:[(0,se.jsx)(S.m,{backdropFilter:"blur(3px)"}),(0,se.jsxs)(A.$,{maxW:{base:"96vw",md:"920px"},maxH:{base:"90vh",md:"86vh"},borderRadius:"2xl",overflow:"hidden",boxShadow:"2xl",children:[(0,se.jsx)(C.r,{children:(0,se.jsxs)(d.z,{justify:"space-between",align:"start",w:"full",pr:8,children:[(0,se.jsxs)(f.T,{align:"start",spacing:1,flex:1,children:[(0,se.jsx)(u.D,{size:"md",children:null!==Te&&void 0!==Te&&Te.id?"Upravit aktivitu":"Nov\xe1 aktivita"}),(0,se.jsx)(k.E,{fontSize:"sm",color:"gray.500",children:"Pl\xe1nujte klubov\xe9 akce, sd\xedlejte s fanou\u0161ky a t\xfdmem."})]}),(0,se.jsx)(he.A,{status:dt,lastSaved:ut,compact:!0})]})}),(0,se.jsx)(E.s,{}),(0,se.jsxs)(T.c,{overflowY:"auto",maxH:{base:"76vh",md:"70vh"},children:[(0,se.jsxs)(c.a,{borderWidth:"1px",borderRadius:"lg",p:4,mb:5,bg:(0,r.dU)("gray.50","gray.900"),children:[(0,se.jsxs)(d.z,{justify:"space-between",align:"start",mb:2,children:[(0,se.jsx)(u.D,{size:"sm",children:"AI generov\xe1n\xed"}),(0,se.jsxs)(d.z,{spacing:2,align:"center",children:[(0,se.jsx)(_.E,{colorScheme:"purple",variant:"subtle",children:"Beta"}),(0,se.jsx)(je.tX,{label:"Jak AI p\xed\u0161e text",title:"Jak funguje AI generov\xe1n\xed popisu",items:["AI pom\xe1h\xe1 s titulkem a popisem aktivity, ale nem\u011bn\xed datum, \u010das ani m\xedsto \u2013 ty nastavujete ru\u010dn\u011b.","Do promptu uve\u010fte typ akce, c\xedlovou skupinu a d\u016fle\u017eit\xe9 body programu. AI pou\u017eije klubov\xe9 informace z nastaven\xed.",'P\u0159ep\xedna\u010d \u201eP\u0159epsat existuj\xedc\xed obsah" ur\u010duje, zda AI m\u016f\u017ee p\u0159epsat u\u017e vypln\u011bn\xfd titulek a popis, nebo je jen dopln\xed.']})]})]}),(0,se.jsx)(k.E,{fontSize:"sm",color:"gray.600",mb:2,children:"Zadejte instrukce pro AI nebo klikn\u011bte na p\u0159edlohy n\xed\u017ee. AI m\u016f\u017ee vytvo\u0159it nebo doplnit titulek a popis ud\xe1losti."}),(0,se.jsx)(ye.A,{value:Ie,onChange:Me,onSubmit:(e,t)=>(Je(t),Pt()),isSubmitting:Le,placeholder:"Nap\u0159.: Tr\xe9nink A-t\xfdmu, h\u0159i\u0161t\u011b TJ Dvorce, 18:00\u201319:30, pro v\u0161echny hr\xe1\u010de.",helperText:"AI pop\xed\u0161e aktivitu bez data, \u010dasu a p\u0159esn\xe9ho m\xedsta."}),(0,se.jsx)(m.B,{spacing:2,mt:2,children:["Pozv\xe1nka na tr\xe9nink se zam\u011b\u0159en\xedm na kondici","Ozn\xe1men\xed p\u0159\xe1telsk\xe9ho z\xe1pasu pro fanou\u0161ky","Rodi\u010dovsk\xe1 sch\u016fzka ml\xe1de\u017ee \u2013 stru\u010dn\xfd program"].map((e,t)=>(0,se.jsx)(m.Q,{children:(0,se.jsx)(D.vw,{size:"sm",variant:"subtle",colorScheme:"blue",_hover:{cursor:"pointer",opacity:.9},onClick:()=>Me(e),children:(0,se.jsx)(D.d1,{children:e})})},t))}),(0,se.jsxs)(d.z,{mt:3,spacing:3,align:"center",children:[(0,se.jsxs)(N.MJ,{maxW:"220px",children:[(0,se.jsx)(R.l,{mb:1,children:"T\xf3n"}),(0,se.jsxs)(F.l,{size:"sm",value:Be,onChange:e=>Ze(e.target.value),children:[(0,se.jsx)("option",{value:"friendly",children:"P\u0159\xe1telsk\xfd"}),(0,se.jsx)("option",{value:"informative",children:"Informa\u010dn\xed"}),(0,se.jsx)("option",{value:"formal",children:"Form\xe1ln\xed"})]})]}),(0,se.jsxs)(N.MJ,{display:"flex",alignItems:"center",children:[(0,se.jsx)(R.l,{mb:"0",children:"P\u0159epsat existuj\xedc\xed obsah"}),(0,se.jsx)(P.d,{isChecked:Ve,onChange:e=>He(e.target.checked)})]}),(0,se.jsx)(I.m,{label:"AI dopln\xed titul a popis podle zadan\xfdch informac\xed.",hasArrow:!0,children:(0,se.jsx)(h.$,{size:"sm",onClick:Pt,isLoading:Le,leftIcon:(0,se.jsx)(U.GGD,{size:14}),bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},whiteSpace:"nowrap",children:"AI text"})})]})]}),(0,se.jsxs)(N.MJ,{isRequired:!0,mb:3,children:[(0,se.jsx)(R.l,{children:"N\xe1zev"}),(0,se.jsx)(M.p,{value:(null===Te||void 0===Te?void 0:Te.title)||"",onChange:e=>De(t=>(0,a.A)((0,a.A)({},t||{}),{},{title:e.target.value}))}),Zt&&(0,se.jsx)(k.E,{fontSize:"sm",color:"orange.500",mt:1,children:"Vypl\u0148te n\xe1zev aktivity."})]}),(0,se.jsxs)(N.MJ,{mb:3,children:[(0,se.jsx)(R.l,{children:"Popis (Rich Text Editor)"}),(0,se.jsx)(de.A,{value:(null===Te||void 0===Te?void 0:Te.description)||"",onChange:e=>De(t=>(0,a.A)((0,a.A)({},t||{}),{},{description:e})),height:"300px",toolbar:"full",showImageResize:!0,placeholder:"Zadejte popis ud\xe1losti..."})]}),(null===Te||void 0===Te?void 0:Te.title)&&(null===Te||void 0===Te?void 0:Te.description)&&(0,se.jsx)(le,{title:Te.title,content:Te.description,contentType:"activity",onTranslationComplete:(e,t)=>{De(n=>(0,a.A)((0,a.A)({},n),{},{title:e,description:t})),ze({title:"Aktivita p\u0159elo\u017eena",description:"Aktivita byla \xfasp\u011b\u0161n\u011b p\u0159elo\u017eena a ulo\u017eena do formul\xe1\u0159e.",status:"success",duration:3e3})}}),(0,se.jsxs)(c.a,{mb:3,children:[(0,se.jsx)(R.l,{children:"YouTube Video (voliteln\xe9)"}),(0,se.jsxs)(c.a,{borderWidth:"1px",borderRadius:"md",p:3,bg:(0,r.dU)("gray.50","gray.900"),children:[(0,se.jsxs)(d.z,{mb:3,spacing:2,children:[(0,se.jsxs)(h.$,{size:"sm",leftIcon:(0,se.jsx)(U.blI,{}),onClick:()=>at("club"),variant:"club"===nt?"solid":"outline",colorScheme:"club"===nt?"red":"gray",children:["Z kan\xe1lu klubu (",et.length,")"]}),(0,se.jsx)(h.$,{size:"sm",leftIcon:(0,se.jsx)(U.ayE,{}),onClick:()=>at("custom"),variant:"custom"===nt?"solid":"outline",colorScheme:"custom"===nt?"blue":"gray",children:"Vlastn\xed odkaz"})]}),"club"===nt&&(0,se.jsx)(c.a,{children:0===et.length?(0,se.jsx)(k.E,{fontSize:"sm",color:"gray.500",children:"\u017d\xe1dn\xe1 videa z kan\xe1lu klubu. Nastavte YouTube kan\xe1l v Nastaven\xed."}):(0,se.jsx)(f.T,{align:"stretch",spacing:2,maxH:"300px",overflowY:"auto",children:et.map(e=>{var t;const n="https://www.youtube.com/watch?v=".concat(e.video_id),i=null===Te||void 0===Te||null===(t=Te.youtube_url)||void 0===t?void 0:t.includes(e.video_id);return(0,se.jsxs)(d.z,{p:2,borderWidth:"1px",borderRadius:"md",borderColor:i?"red.500":oe,bg:i?(0,r.dU)("red.50","red.900"):ie,cursor:"pointer",_hover:{borderColor:"red.300",bg:(0,r.dU)("red.50","red.900")},onClick:()=>{De(e=>(0,a.A)((0,a.A)({},e||{}),{},{youtube_url:n})),ze({title:"Video vybr\xe1no",description:e.title,status:"success",duration:2e3})},children:[(0,se.jsx)(y._,{src:e.thumbnail_url,alt:e.title,boxSize:"60px",objectFit:"cover",borderRadius:"md"}),(0,se.jsxs)(f.T,{align:"start",flex:1,spacing:0,children:[(0,se.jsx)(k.E,{fontSize:"sm",fontWeight:"medium",noOfLines:2,children:e.title}),(0,se.jsxs)(d.z,{fontSize:"xs",color:"gray.500",children:[e.published_text&&(0,se.jsx)(k.E,{children:e.published_text}),e.views_text&&(0,se.jsxs)(k.E,{children:["\u2022 ",e.views_text]})]})]}),i&&(0,se.jsx)(_.E,{colorScheme:"red",children:"Vybr\xe1no"})]},e.video_id)})})}),"custom"===nt&&(0,se.jsxs)(f.T,{align:"stretch",spacing:2,children:[(0,se.jsx)(M.p,{value:(null===Te||void 0===Te?void 0:Te.youtube_url)||"",onChange:e=>De(t=>(0,a.A)((0,a.A)({},t||{}),{},{youtube_url:e.target.value})),placeholder:"https://www.youtube.com/watch?v=... nebo https://youtu.be/..."}),(0,se.jsx)(k.E,{fontSize:"xs",color:"gray.500",children:"Vlo\u017ete odkaz na jak\xe9koliv YouTube video (nemus\xed b\xfdt z va\u0161eho kan\xe1lu)."})]}),(null===Te||void 0===Te?void 0:Te.youtube_url)&&(0,se.jsxs)(d.z,{mt:2,spacing:2,children:[(0,se.jsx)(_.E,{colorScheme:"green",fontSize:"xs",children:"Video nastaveno"}),(0,se.jsx)(h.$,{size:"xs",variant:"ghost",colorScheme:"red",onClick:()=>De(e=>(0,a.A)((0,a.A)({},e||{}),{},{youtube_url:""})),children:"Zru\u0161it video"})]})]})]}),(0,se.jsxs)(c.a,{mt:3,children:[(0,se.jsx)(k.E,{fontWeight:"bold",mb:2,children:"Datum a \u010das"}),(0,se.jsx)(ve.A,{from:It||void 0,to:Ut||void 0,onChange:(e,t)=>{if(Mt(e||""),Ot(t||""),e&&Lt){const t=Bt(e,Lt);De(e=>(0,a.A)((0,a.A)({},e||{}),{},{start_time:t||(null===e||void 0===e?void 0:e.start_time)}))}if(t&&qt){const e=Bt(t,qt);De(t=>(0,a.A)((0,a.A)({},t||{}),{},{end_time:e}))}},size:"sm"}),(0,se.jsxs)(L.r,{columns:{base:1,md:2},spacing:3,mt:3,children:[(0,se.jsxs)(N.MJ,{isRequired:!0,children:[(0,se.jsx)(R.l,{children:"\u010cas za\u010d\xe1tku"}),(0,se.jsx)(M.p,{type:"time",step:"900",value:Lt,onChange:e=>{const t=e.target.value;if(Wt(t),It){const e=Bt(It,t);De(t=>{const n=e,i=null!==t&&void 0!==t&&t.end_time?new Date(t.end_time):null;let o=null===t||void 0===t?void 0:t.end_time;return i&&n&&i.getTime()<new Date(n).getTime()&&(o=new Date(new Date(n).getTime()+36e5).toISOString()),(0,a.A)((0,a.A)({},t||{}),{},{start_time:n,end_time:o})})}}}),Vt&&(0,se.jsx)(k.E,{fontSize:"sm",color:"orange.500",mt:1,children:"Vypl\u0148te datum i \u010das za\u010d\xe1tku."})]}),(0,se.jsxs)(N.MJ,{children:[(0,se.jsx)(R.l,{children:"\u010cas konce (voliteln\xe9)"}),(0,se.jsx)(M.p,{type:"time",step:"900",value:qt,onChange:e=>{const t=e.target.value;if(Kt(t),Ut){const e=Bt(Ut,t);De(t=>(0,a.A)((0,a.A)({},t||{}),{},{end_time:e}))}}}),(0,se.jsxs)(d.z,{mt:2,children:[(0,se.jsx)(h.$,{size:"sm",variant:"outline",onClick:()=>De(e=>{if(null===e||void 0===e||!e.start_time)return e||{};const t=new Date(e.start_time).getTime(),n=new Date(t+36e5).toISOString();return(0,a.A)((0,a.A)({},e||{}),{},{end_time:n})}),children:"+60m"}),(0,se.jsx)(h.$,{size:"sm",variant:"outline",onClick:()=>De(e=>{if(null===e||void 0===e||!e.start_time)return e||{};const t=new Date(e.start_time).getTime(),n=new Date(t+54e5).toISOString();return(0,a.A)((0,a.A)({},e||{}),{},{end_time:n})}),children:"+90m"}),(0,se.jsx)(h.$,{size:"sm",variant:"outline",onClick:()=>De(e=>{if(null===e||void 0===e||!e.start_time)return e||{};const t=new Date(e.start_time).getTime(),n=new Date(t+72e5).toISOString();return(0,a.A)((0,a.A)({},e||{}),{},{end_time:n})}),children:"+120m"}),(0,se.jsx)(h.$,{size:"sm",variant:"ghost",onClick:()=>{Ot(""),Kt(""),De(e=>(0,a.A)((0,a.A)({},e||{}),{},{end_time:null}))},children:"Zru\u0161it"})]})]})]}),(0,se.jsxs)(d.z,{mt:2,spacing:2,children:[(0,se.jsx)(h.$,{size:"sm",variant:"outline",onClick:()=>De(e=>{const t=new Date,n=t.getMinutes(),i=new Date(t.getTime()+(15-n%15)%15*6e4),o=i.getFullYear(),r=String(i.getMonth()+1).padStart(2,"0"),s=String(i.getDate()).padStart(2,"0"),l=String(i.getHours()).padStart(2,"0"),c=String(i.getMinutes()).padStart(2,"0");return Mt("".concat(o,"-").concat(r,"-").concat(s)),Wt("".concat(l,":").concat(c)),(0,a.A)((0,a.A)({},e||{}),{},{start_time:i.toISOString()})}),children:"Nyn\xed (zaokrouhlit 15m)"}),(0,se.jsx)(h.$,{size:"sm",variant:"outline",onClick:()=>De(e=>{const t=new Date;t.setHours(18,0,0,0);const n=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return Mt("".concat(n,"-").concat(i,"-").concat(o)),Wt("18:00"),(0,a.A)((0,a.A)({},e||{}),{},{start_time:t.toISOString()})}),children:"Dnes 18:00"}),(0,se.jsx)(h.$,{size:"sm",variant:"outline",onClick:()=>De(e=>{const t=new Date;t.setDate(t.getDate()+1),t.setHours(18,0,0,0);const n=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return Mt("".concat(n,"-").concat(i,"-").concat(o)),Wt("18:00"),(0,a.A)((0,a.A)({},e||{}),{},{start_time:t.toISOString()})}),children:"Z\xedtra 18:00"}),(0,se.jsx)(I.m,{label:"Rychl\xe9 nastaven\xed z\xedt\u0159ej\u0161\xedho r\xe1na",hasArrow:!0,children:(0,se.jsx)(h.$,{size:"sm",variant:"outline",onClick:()=>De(e=>{const t=new Date;t.setDate(t.getDate()+1),t.setHours(9,0,0,0);const n=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return Mt("".concat(n,"-").concat(i,"-").concat(o)),Wt("09:00"),(0,a.A)((0,a.A)({},e||{}),{},{start_time:t.toISOString()})}),children:"Z\xedtra 9:00"})})]}),(0,se.jsxs)(k.E,{mt:2,fontSize:"xs",color:"gray.500",children:["\u010casov\xe1 z\xf3na: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]}),(0,se.jsxs)(c.a,{mt:4,children:[(0,se.jsx)(u.D,{size:"sm",mb:3,children:"M\xedsto kon\xe1n\xed"}),(0,se.jsx)(c.a,{bg:(0,r.dU)("gray.50","gray.900"),p:4,borderRadius:"md",borderWidth:"1px",mb:3,children:(0,se.jsxs)(N.MJ,{children:[(0,se.jsx)(R.l,{fontSize:"sm",children:"Ulo\u017een\xe1 m\xedsta (rychl\xfd v\xfdb\u011br)"}),(0,se.jsxs)(d.z,{spacing:2,align:"center",children:[(0,se.jsx)(F.l,{size:"sm",placeholder:"Vyberte ulo\u017een\xe9 m\xedsto...",value:rt,onChange:e=>(e=>{st(e);const t=it.find(t=>t.id===e);t&&(Xe(t.lat),Qe(t.lng),De(e=>(0,a.A)((0,a.A)({},e||{}),{},{location:t.address,latitude:t.lat,longitude:t.lng})),ze({title:"M\xedsto vybr\xe1no",description:t.label,status:"success",duration:1500}))})(e.target.value),flex:1,children:it.map(e=>(0,se.jsxs)("option",{value:e.id,children:[e.label,e.address?" \u2014 ".concat(e.address):""]},e.id))}),(0,se.jsx)(h.$,{size:"sm",variant:"outline",onClick:()=>{const e=String((null===Te||void 0===Te?void 0:Te.location)||"").trim();if(!e&&!("number"===typeof Ge||"number"===typeof Ye))return void ze({title:"Nelze ulo\u017eit m\xedsto",description:"Zadejte n\xe1zev/adresu nebo vyberte sou\u0159adnice.",status:"warning"});const t=String(Date.now()),n=e||"Ulo\u017een\xe9 m\xedsto",a=[...it,{id:t,label:n,address:e,lat:Ge,lng:Ye}];zt(a),st(t),ze({title:"M\xedsto ulo\u017eeno",status:"success",duration:2e3})},children:"Ulo\u017eit aktu\xe1ln\xed"}),(0,se.jsx)(h.$,{size:"sm",variant:"ghost",colorScheme:"red",onClick:()=>{if(!rt)return;if("club-main"===rt)return void ze({title:"Nelze smazat klubov\xe9 m\xedsto",status:"info"});const e=it.filter(e=>e.id!==rt);zt(e),st(""),ze({title:"Ulo\u017een\xe9 m\xedsto smaz\xe1no",status:"success",duration:1500})},isDisabled:!rt||"club-main"===rt,children:"Smazat"})]}),(0,se.jsx)(k.E,{fontSize:"xs",color:re,mt:1,children:"Vyberte klubov\xe9 nebo d\u0159\xedve ulo\u017een\xe9 m\xedsto. \u201eUlo\u017eit aktu\xe1ln\xed\u201c p\u0159id\xe1 sou\u010dasn\xfd n\xe1zev/adresu a sou\u0159adnice."})]})}),(0,se.jsxs)(c.a,{bg:(0,r.dU)("gray.50","gray.900"),p:4,borderRadius:"md",borderWidth:"1px",mb:3,children:[(0,se.jsx)(k.E,{fontSize:"sm",fontWeight:"semibold",mb:2,children:"Importovat z odkazu na mapu"}),(0,se.jsx)(ce.A,{currentLatitude:Ge,currentLongitude:Ye,mapStyle:(null===(t=wt.data)||void 0===t?void 0:t.map_style)||"positron",clubPrimaryColor:null===(n=wt.data)||void 0===n?void 0:n.primary_color,clubSecondaryColor:null===(ee=wt.data)||void 0===ee?void 0:ee.accent_color,clubName:(null===Te||void 0===Te?void 0:Te.title)||(null===Te||void 0===Te?void 0:Te.location)||"M\xedsto ud\xe1losti",onImport:e=>{Xe(e.latitude),Qe(e.longitude);let t="";if(e.address)t=e.address;else{const n=[];e.street&&n.push(e.street),e.city&&n.push(e.city),e.zip&&n.push(e.zip),t=n.join(", ")}De(n=>(0,a.A)((0,a.A)({},n||{}),{},{latitude:e.latitude,longitude:e.longitude,location:t||(null===n||void 0===n?void 0:n.location)||""})),ze({title:"M\xedsto importov\xe1no",description:t||"Lat: ".concat(e.latitude.toFixed(6),", Lng: ").concat(e.longitude.toFixed(6)),status:"success",duration:3e3})}})]}),(0,se.jsxs)(d.z,{spacing:3,align:"start",mt:3,children:[(0,se.jsxs)(N.MJ,{flex:2,children:[(0,se.jsx)(R.l,{children:"N\xe1zev m\xedsta / Adresa"}),(0,se.jsx)(M.p,{value:(null===Te||void 0===Te?void 0:Te.location)||"",onChange:e=>De(t=>(0,a.A)((0,a.A)({},t||{}),{},{location:e.target.value})),placeholder:"nap\u0159. Sportovn\xed hala TJ Sokol"}),(0,se.jsx)(k.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Zobraz\xed se n\xe1v\u0161t\u011bvn\xedk\u016fm (s mo\u017enou mapou)"})]}),(0,se.jsxs)(N.MJ,{flex:1,children:[(0,se.jsx)(R.l,{children:"Typ"}),(0,se.jsx)(F.l,{value:(null===Te||void 0===Te?void 0:Te.type)||"other",onChange:e=>De(t=>(0,a.A)((0,a.A)({},t||{}),{},{type:e.target.value})),children:we.map(e=>(0,se.jsx)("option",{value:e.value,children:e.label},e.value))})]})]})]}),(0,se.jsxs)(N.MJ,{mt:3,children:[(0,se.jsx)(R.l,{children:"Kategorie (sout\u011b\u017e)"}),(0,se.jsx)(F.l,{placeholder:"Vyberte kategorii (voliteln\xe9)",value:(null===Te||void 0===Te?void 0:Te.category_name)||"",onChange:e=>De(t=>(0,a.A)((0,a.A)({},t||{}),{},{category_name:e.target.value})),children:Dt.map((e,t)=>(0,se.jsx)("option",{value:e.code&&Rt[e.code]?Rt[e.code]:e.name,children:e.code&&Rt[e.code]?Rt[e.code]:e.name},(e.code||e.name)+"_"+t))})]}),(0,se.jsxs)(N.MJ,{mt:3,children:[(0,se.jsx)(R.l,{children:"Obr\xe1zek/n\xe1hled"}),(0,se.jsxs)(f.T,{align:"stretch",spacing:3,children:[(0,se.jsx)(be.A,{label:"Obr\xe1zek aktivity",description:"Nahrajte nebo p\u0159et\xe1hn\u011bte obr\xe1zek/n\xe1hled pro aktivitu.",accept:"image/*",multiple:!1,maxFiles:1,allowUrlImport:!0,urlPlaceholder:"/uploads/... nebo https://example.com/obrazek.jpg",onChange:e=>{const t=e[e.length-1];De(e=>(0,a.A)((0,a.A)({},e||{}),{},{image_url:(null===t||void 0===t?void 0:t.url)||(null===e||void 0===e?void 0:e.image_url)||""}))}}),(0,se.jsxs)(d.z,{align:"center",spacing:3,children:[(0,se.jsx)(c.a,{boxSize:"80px",borderRadius:"md",overflow:"hidden",bg:"gray.100",children:null!==Te&&void 0!==Te&&Te.image_url?(0,se.jsx)(pe.A,{src:(0,xe.uq)(Te.image_url)||Te.image_url,alt:Te.title||"N\xe1hled aktivity",size:"80px",previewSize:"350px"}):(0,se.jsx)(y._,{src:(0,xe.uq)(null===(te=wt.data)||void 0===te?void 0:te.club_logo_url)||(0,xe.uq)("/dist/img/logo-club-empty.svg")||"/dist/img/logo-club-empty.svg",alt:"No image",boxSize:"80px",objectFit:"contain",opacity:.4})}),(0,se.jsx)(M.p,{value:(null===Te||void 0===Te?void 0:Te.image_url)||"",onChange:e=>De(t=>(0,a.A)((0,a.A)({},t||{}),{},{image_url:e.target.value})),placeholder:"/uploads/...jpg"})]}),(0,se.jsx)(k.E,{fontSize:"xs",color:"gray.500",children:"Doporu\u010den\xfd pom\u011br stran 16:9, minim\xe1ln\u011b 1200\xd7675 px."})]})]}),(0,se.jsxs)(N.MJ,{mt:4,children:[(0,se.jsx)(R.l,{children:"P\u0159\xedlohy (dokumenty, obr\xe1zky, ZIP)"}),(0,se.jsx)(N.eK,{mb:2,children:"P\u0159idejte dokumenty k aktivit\u011b (PDF, Word, Excel, PowerPoint, obr\xe1zky, ZIP). P\u0159\xedlohy se zobraz\xed pod textem ud\xe1losti."}),(0,se.jsx)(be.A,{label:"P\u0159\xedlohy aktivity",description:"Nahrajte dokumenty, obr\xe1zky nebo archivy jako p\u0159\xedlohy k aktivit\u011b.",accept:".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png,.gif,.webp,.txt,.zip,.rar",multiple:!0,maxFiles:30,uploadFn:async e=>{if(!(["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","image/jpeg","image/png","image/gif","image/webp","text/plain","application/zip","application/x-zip-compressed","application/x-rar-compressed","application/vnd.rar"].includes(e.type)||!!e.name.match(/\.(pdf|docx?|xlsx?|pptx?|jpe?g|png|gif|webp|txt|zip|rar)$/i)))throw new Error('Soubor "'.concat(e.name,'" nelze nahr\xe1t (nepodporovan\xfd form\xe1t).'));const t=await(0,B.QM)(e);return{url:t.url,name:e.name,type:e.type||t.type||"application/octet-stream",size:e.size||t.size||0}},onUploadFinished:e=>{e&&0!==e.length&&De(t=>{const n=Array.isArray(null===t||void 0===t?void 0:t.attachments)?t.attachments:[],i=e.map(e=>({name:e.name,url:e.url,mime_type:e.type,size:e.size}));return(0,a.A)((0,a.A)({},t||{}),{},{attachments:[...n,...i]})})}}),(0,se.jsx)(c.a,{mt:2,children:Array.isArray(null===Te||void 0===Te?void 0:Te.attachments)&&Te.attachments.length>0?(0,se.jsxs)(p.X,{size:"sm",variant:"simple",children:[(0,se.jsx)(x.d,{children:(0,se.jsxs)(g.Tr,{children:[(0,se.jsx)(v.Th,{children:"N\xe1zev"}),(0,se.jsx)(v.Th,{children:"Velikost"}),(0,se.jsx)(v.Th,{children:"Akce"})]})}),(0,se.jsx)(j.N,{children:Te.attachments.map((e,t)=>(0,se.jsx)(g.Tr,{children:(0,se.jsx)(b.Td,{colSpan:3,p:2,children:(0,se.jsxs)(d.z,{justify:"space-between",w:"full",children:[(0,se.jsx)(c.a,{flex:1,children:(0,se.jsx)(G.A,{url:e.url,name:e.name,mimeType:e.mime_type,size:e.size})}),(0,se.jsx)(h.$,{size:"xs",variant:"outline",colorScheme:"red",flexShrink:0,ml:2,onClick:()=>De(e=>(0,a.A)((0,a.A)({},e),{},{attachments:(e.attachments||[]).filter((e,n)=>n!==t)})),children:"Odebrat"})]})})},t))})]}):(0,se.jsx)(c.a,{color:"gray.500",children:"\u017d\xe1dn\xe9 p\u0159\xedlohy"})})]}),(0,se.jsxs)(c.a,{mt:6,pt:4,borderTopWidth:"1px",borderColor:oe,children:[(0,se.jsx)(u.D,{size:"sm",mb:3,children:"Anketa"}),ae&&null!==Te&&void 0!==Te&&Te.id?(0,se.jsx)($.A,{eventId:Te.id}):(0,se.jsx)(c.a,{bg:(0,r.dU)("blue.50","blue.900"),p:4,borderRadius:"md",borderWidth:"1px",borderColor:"blue.200",children:(0,se.jsx)(k.E,{fontSize:"sm",color:(0,r.dU)("blue.700","blue.200"),children:"\ud83d\udca1 Nejprve ulo\u017ete aktivitu, pot\xe9 budete moci vytvo\u0159it nebo p\u0159ipojit anketu p\u0159\xedmo zde."})})]})]}),(0,se.jsx)(W.j,{children:(0,se.jsxs)(d.z,{w:"100%",justify:"space-between",children:[(0,se.jsx)(k.E,{fontSize:"xs",color:"gray.500",children:"Ukl\xe1d\xe1n\xedm souhlas\xedte s publikac\xed podle nastaven\xed \u201eVe\u0159ejn\xe1\u201c."}),(0,se.jsxs)(d.z,{children:[(0,se.jsx)(h.$,{variant:"ghost",mr:1,onClick:At,children:"Zru\u0161it"}),(0,se.jsx)(h.$,{bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},onClick:async()=>{if(!Te)return;if(Zt)return void ze({title:"Zadejte n\xe1zev",status:"warning"});if(Vt)return void ze({title:"Vypl\u0148te datum a \u010das za\u010d\xe1tku",status:"warning"});const e=Bt(It,Lt),t=Ut&&qt?Bt(Ut,qt):null;if(t&&e&&new Date(t).getTime()<new Date(e).getTime())return void ze({title:"Konec mus\xed b\xfdt po za\u010d\xe1tku",status:"warning"});const n={title:(Te.title||"").trim(),description:(Te.description||"").trim(),start_time:e,end_time:t||null,location:(Te.location||"").trim(),type:Te.type||"other",is_public:!0,image_url:Te.image_url||void 0,file_url:Te.file_url||void 0,category_name:(null===Te||void 0===Te?void 0:Te.category_name)||void 0,attachments:Array.isArray(null===Te||void 0===Te?void 0:Te.attachments)?Te.attachments.map(e=>({name:e.name,url:e.url,mime_type:e.mime_type,size:e.size})):void 0,youtube_url:(null===Te||void 0===Te?void 0:Te.youtube_url)||void 0,latitude:(null===Te||void 0===Te?void 0:Te.latitude)||Ge||void 0,longitude:(null===Te||void 0===Te?void 0:Te.longitude)||Ye||void 0};Te.id?await Et.mutateAsync({id:Te.id,payload:n}):await Ct.mutateAsync(n)},isLoading:Ct.isLoading||Et.isLoading,children:"Ulo\u017eit"})]})]})})]})]}),(0,se.jsx)(_e.A,{isOpen:Le,onClose:()=>{},title:"AI generuje aktivitu",message:"AI pracuje na generov\xe1n\xed obsahu pro aktivitu...",progress:Ue,estimatedTime:qe?30:void 0})]})})}},35349:(e,t,n)=>{n.d(t,{A:()=>P});var a=n(65043),i=n(87139),o=n(22107),r=n(98662),s=n(34946),l=n(3053),c=n(44093),d=n(73225),u=n(76668),h=n(33572),m=n(35699),p=n(7189),x=n(88019),g=n(72431),v=n(66686),j=n(96148),b=n(10202),y=n(30502),f=n(28846),k=n(39081),_=n(72526),w=n(59781),z=n(12836),S=n(92293),A=n(72515),C=n(71093),E=n(64963),T=n(29066),D=n(73216),N=n(35475),R=n(74117),F=n(70579);const P=e=>{var t,n;let{poll:P,hasVoted:I,isActive:M,canShowResults:L,onVoteSuccess:W,flat:U=!1}=e;const{t:O}=(0,R.Bd)(),q=(0,y.d)(),K=(0,w.jE)(),{trackEvent:B}=(0,E.F)(),{isAuthenticated:Z,user:V}=(0,T.A)(),H=(0,D.zy)(),[$,J]=(0,a.useState)([]),[G,X]=(0,a.useState)(I),[Y,Q]=(0,a.useState)(L),[ee,te]=(0,a.useState)([]),[ne,ae]=(0,a.useState)(L),[ie,oe]=(0,a.useState)(""),[re,se]=(0,a.useState)(""),le="rating"===P.type,ce=[...P.options].sort((e,t)=>(e.display_order||0)-(t.display_order||0)),de=ce.length>0?Math.max(...ce.map(e=>e.display_order||0))||ce.length:5,[ue,he]=(0,a.useState)(null),me=P.style||"auto",pe="auto"!==me?me:le?de<=5?"rating-stars":"rating-scale":"choices-list",xe=e=>{he(e);const t=ce.find(t=>(t.display_order||0)===e),n=ce[e-1],a=t||n;a&&J([a.id])},ge=(0,c.dU)("white","gray.800"),ve=(0,c.dU)("gray.200","gray.600"),je=(0,c.dU)("gray.50","gray.700"),be=Y&&ne,{data:ye}=(0,_.I)({queryKey:["poll-results",P.id],queryFn:()=>(0,C.AF)(P.id),enabled:be,refetchInterval:3e4,refetchOnWindowFocus:!1}),fe=(0,z.n)({mutationFn:()=>{const e=(0,C.F$)();return(0,C.Wu)(P.id,{option_ids:$,session_token:e,voter_name:ie||(Z?null===V||void 0===V?void 0:V.name:void 0),voter_email:re||(Z?null===V||void 0===V?void 0:V.email:void 0)})},onSuccess:async()=>{X(!0),Q(!0),ae(!0);try{const e=await(0,C.AF)(P.id);te(e.results)}catch(e){console.error("Failed to fetch results:",e)}K.invalidateQueries({queryKey:["polls"]}),K.invalidateQueries({queryKey:["poll",P.id]}),K.invalidateQueries({queryKey:["poll-results",P.id]}),q({title:"Hlas zaznamen\xe1n!",description:"D\u011bkujeme za va\u0161i \xfa\u010dast v anket\u011b.",status:"success",duration:3e3});try{B("Poll Vote",{poll_id:P.id,poll_title:P.title,type:P.type,option_ids:$,rating:ue||void 0})}catch(t){}W&&W();try{window.dispatchEvent(new CustomEvent("engagement:refresh"))}catch(n){}},onError:e=>{var t,n;q({title:"Chyba",description:(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se zaznamenat v\xe1\u0161 hlas",status:"error",duration:5e3})}}),ke=e=>{if(P.allow_multiple){if($.includes(e))J($.filter(t=>t!==e));else{if($.length>=P.max_choices)return void q({title:"P\u0159\xedli\u0161 mnoho voleb",description:"M\u016f\u017eete vybrat maxim\xe1ln\u011b ".concat(P.max_choices," mo\u017enost\xed."),status:"warning",duration:3e3});J([...$,e])}}else J([e])};if(ne&&Y){var _e;const e=null!==(_e=null===ye||void 0===ye?void 0:ye.total_votes)&&void 0!==_e?_e:P.total_votes,t=(null===ye||void 0===ye?void 0:ye.results)||(ee.length>0?ee:P.options.map(t=>({option_id:t.id,text:t.text,vote_count:t.vote_count,percentage:e?t.vote_count/e*100:0,image_url:t.image_url})));return(0,F.jsx)(o.a,{className:U?void 0:"card",bg:U?"transparent":ge,borderWidth:U?"0":"1px",borderColor:U?"transparent":ve,p:U?0:6,children:(0,F.jsxs)(b.T,{spacing:4,align:"stretch",children:[P.image_url&&(0,F.jsx)(h._,{src:P.image_url,alt:P.title,borderRadius:"lg",maxH:"200px",objectFit:"cover"}),(0,F.jsxs)(j.z,{justify:"space-between",align:"start",children:[(0,F.jsx)(f.D,{size:"md",children:P.title}),G&&(0,F.jsx)(i.E,{colorScheme:"green",fontSize:"sm",children:(0,F.jsxs)(j.z,{spacing:1,children:[(0,F.jsx)(A.S,{boxSize:3}),(0,F.jsx)(k.E,{children:"Hlasov\xe1no"})]})})]}),P.description&&(0,F.jsx)(k.E,{fontSize:"sm",color:"gray.600",children:P.description}),(0,F.jsxs)(b.T,{spacing:3,align:"stretch",children:[(0,F.jsxs)(k.E,{fontWeight:"bold",fontSize:"sm",color:"gray.500",children:["V\xfdsledky (",e," hlas\u016f)"]}),t.map(e=>(0,F.jsxs)(o.a,{children:[(0,F.jsxs)(j.z,{justify:"space-between",mb:1,children:[(0,F.jsx)(k.E,{fontWeight:"medium",children:e.text}),(0,F.jsxs)(k.E,{fontSize:"sm",color:"gray.500",children:[e.vote_count," (",e.percentage.toFixed(1),"%)"]})]}),(0,F.jsx)(x.k,{value:e.percentage,colorScheme:"blue",borderRadius:"full",size:"sm"})]},e.option_id))]})]})})}return(0,F.jsx)(o.a,{className:U?void 0:"card",bg:U?"transparent":ge,borderWidth:U?"0":"1px",borderColor:U?"transparent":ve,p:U?0:6,children:(0,F.jsxs)(b.T,{spacing:4,align:"stretch",children:[P.image_url&&(0,F.jsx)(h._,{src:P.image_url,alt:P.title,borderRadius:"lg",maxH:"200px",objectFit:"cover"}),(0,F.jsx)(f.D,{size:"md",children:P.title}),P.description&&(0,F.jsx)(k.E,{fontSize:"sm",color:"gray.600",children:P.description}),!M&&(0,F.jsx)(i.E,{colorScheme:"orange",children:"Anketa je moment\xe1ln\u011b uzav\u0159ena"}),M&&(0,F.jsxs)(F.Fragment,{children:["rating-stars"===pe&&(0,F.jsx)(b.T,{align:"stretch",spacing:2,children:(0,F.jsxs)(j.z,{children:[Array.from({length:de}).map((e,t)=>(0,F.jsx)(S.G,{boxSize:6,cursor:"pointer",color:t<(ue||0)?"yellow.400":"gray.300",onClick:()=>xe(t+1)},t)),(0,F.jsx)(k.E,{ml:2,children:ue?"".concat(ue,"/").concat(de):"Vyberte hodnocen\xed"})]})}),"rating-scale"===pe&&(0,F.jsx)(j.z,{flexWrap:"wrap",spacing:2,children:Array.from({length:de}).map((e,t)=>(0,F.jsx)(r.$,{size:"sm",variant:ue===t+1?"solid":"outline",colorScheme:"blue",onClick:()=>xe(t+1),children:t+1},t))}),"choices-chips"===pe&&(0,F.jsxs)(b.T,{align:"stretch",spacing:2,children:[P.allow_multiple&&(0,F.jsxs)(k.E,{fontSize:"sm",color:"gray.500",children:["Vyberte a\u017e ",P.max_choices," mo\u017enost\xed"]}),(0,F.jsx)(j.z,{flexWrap:"wrap",spacing:2,children:P.options.map(e=>{const t=$.includes(e.id);return(0,F.jsx)(r.$,{size:"sm",borderRadius:"full",variant:t?"solid":"outline",colorScheme:"blue",onClick:()=>ke(e.id),children:e.text},e.id)})})]}),"choices-cards"===pe&&(0,F.jsx)(b.T,{spacing:3,align:"stretch",children:P.options.map(e=>{const t=$.includes(e.id);return(0,F.jsx)(o.a,{p:3,borderWidth:t?"2px":"1px",borderColor:t?"blue.400":ve,borderRadius:"md",_hover:{bg:je},cursor:"pointer",onClick:()=>ke(e.id),children:(0,F.jsxs)(j.z,{align:"start",spacing:3,children:[e.image_url&&(0,F.jsx)(h._,{src:e.image_url,alt:e.text,boxSize:"48px",objectFit:"cover",borderRadius:"md"}),(0,F.jsxs)(b.T,{align:"start",spacing:1,flex:1,children:[(0,F.jsx)(k.E,{fontWeight:"medium",children:e.text}),e.description&&(0,F.jsx)(k.E,{fontSize:"xs",color:"gray.500",children:e.description})]})]})},e.id)})}),"choices-list"===pe&&(0,F.jsx)(F.Fragment,{children:P.allow_multiple?(0,F.jsx)(l.$,{value:$.map(String),onChange:e=>{const t=e.map(e=>"string"===typeof e?parseInt(e):e);t.length<=P.max_choices&&J(t)},children:(0,F.jsxs)(b.T,{spacing:2,align:"stretch",children:[(0,F.jsxs)(k.E,{fontSize:"sm",color:"gray.500",children:["Vyberte a\u017e ",P.max_choices," mo\u017enost\xed"]}),P.options.map(e=>(0,F.jsx)(o.a,{p:3,borderWidth:"1px",borderRadius:"md",_hover:{bg:je},cursor:"pointer",role:"button",tabIndex:0,onClick:()=>ke(e.id),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),ke(e.id))},children:(0,F.jsx)(s.S,{value:String(e.id),onClick:e=>e.stopPropagation(),children:(0,F.jsxs)(b.T,{align:"start",spacing:1,children:[(0,F.jsx)(k.E,{children:e.text}),e.description&&(0,F.jsx)(k.E,{fontSize:"xs",color:"gray.500",children:e.description})]})})},e.id))]})}):(0,F.jsx)(v.z,{value:(null===(t=$[0])||void 0===t?void 0:t.toString())||"",onChange:e=>{J([parseInt(e)])},children:(0,F.jsx)(b.T,{spacing:2,align:"stretch",children:P.options.map(e=>(0,F.jsx)(o.a,{p:3,borderWidth:"1px",borderRadius:"md",_hover:{bg:je},cursor:"pointer",role:"button",tabIndex:0,onClick:()=>ke(e.id),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),ke(e.id))},children:(0,F.jsx)(g.s,{value:String(e.id),onClick:e=>e.stopPropagation(),children:(0,F.jsxs)(b.T,{align:"start",spacing:1,children:[(0,F.jsx)(k.E,{children:e.text}),e.description&&(0,F.jsx)(k.E,{fontSize:"xs",color:"gray.500",children:e.description}),e.player&&(0,F.jsxs)(j.z,{spacing:2,children:[e.player.image_url&&(0,F.jsx)(h._,{src:e.player.image_url,alt:"".concat(e.player.first_name," ").concat(e.player.last_name),boxSize:"24px",borderRadius:"full"}),(0,F.jsxs)(k.E,{fontSize:"xs",color:"gray.500",children:["#",e.player.jersey_number," ",e.player.first_name," ",e.player.last_name]})]})]})})},e.id))})})}),Z?(0,F.jsxs)(b.T,{spacing:3,align:"stretch",children:[(0,F.jsxs)(d.MJ,{children:[(0,F.jsx)(u.l,{fontSize:"sm",children:"Jm\xe9no (voliteln\xe9)"}),(0,F.jsx)(m.p,{size:"sm",autoComplete:"name",value:ie||(null===V||void 0===V?void 0:V.name)||"",onChange:e=>oe(e.target.value)})]}),(0,F.jsxs)(d.MJ,{children:[(0,F.jsx)(u.l,{fontSize:"sm",children:"E-mail (voliteln\xe9)"}),(0,F.jsx)(m.p,{size:"sm",type:"email",autoComplete:"email",value:re||(null===V||void 0===V?void 0:V.email)||"",onChange:e=>se(e.target.value)})]})]}):(0,F.jsxs)(b.T,{spacing:3,align:"stretch",children:[(0,F.jsxs)(d.MJ,{children:[(0,F.jsx)(u.l,{fontSize:"sm",children:"Jm\xe9no (voliteln\xe9)"}),(0,F.jsx)(m.p,{size:"sm",autoComplete:"name",value:ie,onChange:e=>oe(e.target.value)})]}),(0,F.jsxs)(d.MJ,{children:[(0,F.jsx)(u.l,{fontSize:"sm",children:"E-mail (voliteln\xe9)"}),(0,F.jsx)(m.p,{size:"sm",type:"email",autoComplete:"email",value:re,onChange:e=>se(e.target.value)})]}),(0,F.jsxs)(k.E,{fontSize:"xs",color:"gray.500",children:["P\u0159ihl\xe1\u0161en\xedm se jm\xe9no a e-mail dopln\xed automaticky."," ",(0,F.jsx)(p.N,{as:N.N_,color:"blue.500",to:"/login",state:{from:H},children:O("auth.login")})]})]}),(0,F.jsx)(r.$,{colorScheme:"blue",onClick:()=>{0!==$.length?P.allow_multiple&&$.length>P.max_choices?q({title:"P\u0159\xedli\u0161 mnoho voleb",description:"M\u016f\u017eete vybrat maxim\xe1ln\u011b ".concat(P.max_choices," mo\u017enost\xed."),status:"warning",duration:3e3}):fe.mutate():q({title:"Vyberte mo\u017enost",description:"P\u0159ed hlasov\xe1n\xedm vyberte alespo\u0148 jednu mo\u017enost.",status:"warning",duration:3e3})},isLoading:fe.isPending,isDisabled:!M||0===$.length,children:"Hlasovat"})]}),Y&&!ne&&(0,F.jsx)(r.$,{variant:"outline",onClick:async()=>{try{const e=await(0,C.AF)(P.id);te(e.results),ae(!0)}catch(e){q({title:"Chyba",description:"Nepoda\u0159ilo se na\u010d\xedst v\xfdsledky",status:"error",duration:3e3})}},size:"sm",children:"Zobrazit v\xfdsledky"}),(0,F.jsxs)(k.E,{fontSize:"xs",color:"gray.500",textAlign:"center",children:["Celkem hlas\u016f: ",null!==(n=null===ye||void 0===ye?void 0:ye.total_votes)&&void 0!==n?n:P.total_votes]})]})})}},35436:(e,t,n)=>{n.d(t,{N:()=>s,k:()=>l});var a=n(89379),i=n(44847);let o=0,r="";async function s(e){const t="http://127.0.0.1:8083/api/v1/errors";const n=Date.now(),s={origin:"frontend",language:e.language||"tsx",severity:e.severity||"error",message:e.message||"Unknown error",stack:e.stack,component:e.component,file:e.file,line:e.line,column:e.column,url:e.url||("undefined"!==typeof window?window.location.pathname+window.location.search:void 0),method:e.method,status:e.status,request_id:e.request_id,user_id:e.user_id,session_token:e.session_token,tags:(0,a.A)({service:"frontend",instance_env:String("production"),instance_host:"undefined"!==typeof window&&window.location&&window.location.hostname?window.location.hostname:""},e.tags||{}),context:(0,a.A)({userAgent:"undefined"!==typeof navigator?navigator.userAgent:void 0,referrer:"undefined"!==typeof document?document.referrer:void 0,viewport:"undefined"!==typeof window?{w:window.innerWidth,h:window.innerHeight}:void 0,recentActions:(0,i.z)(18)},e.context),env:e.env||"production",version:e.version,hostname:e.hostname||("undefined"!==typeof window?window.location.hostname:void 0),occurred_at:new Date(n).toISOString()},l=function(e){const t=[e.message,e.stack||"",e.url||"",e.component||""].join("|");let n=0;for(let a=0;a<t.length;a++)n=(n<<5)-n+t.charCodeAt(a),n|=0;return String(n)}(s);if(!(l===r&&n-o<1500)){r=l,o=n;try{await fetch(t,{method:"POST",headers:(0,a.A)({"Content-Type":"application/json"},{}),body:JSON.stringify(s),credentials:"omit",keepalive:!0})}catch(c){}}}function l(){"undefined"!==typeof window&&(window.addEventListener("error",e=>{var t;const n=void 0===e.message&&""===e.filename;s({message:e.message||(n?"Resource load error":"Unhandled error"),stack:null===(t=e.error)||void 0===t?void 0:t.stack,file:e.filename,line:e.lineno,column:e.colno,url:window.location.pathname+window.location.search})}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;s({message:"string"===typeof t?t:(null===t||void 0===t?void 0:t.message)||"Unhandled rejection",stack:"object"===typeof t&&(null===t||void 0===t?void 0:t.stack)||"",url:window.location.pathname+window.location.search})}))}},36152:(e,t,n)=>{n.r(t),n.d(t,{default:()=>M});var a=n(65043),i=n(88787),o=n(85871),r=n(22107),s=n(98662),l=n(83169),c=n(24330),d=n(26201),u=n(44093),h=n(5371),m=n(73212),p=n(25011),x=n(88019),g=n(76659),v=n(96148),j=n(10202),b=n(94217),y=n(26381),f=n(94085),k=n(53332),_=n(78149),w=n(14566),z=n(31411),S=n(10227),A=n(51794),C=n(3109),E=n(30502),T=n(28846),D=n(39081),N=n(1009),R=n(73216),F=n(6583),P=n(46291),I=n(70579);const M=()=>{var e;const[t,n]=(0,a.useState)(null),[M,L]=(0,a.useState)(!0),[W,U]=(0,a.useState)((new Date).getFullYear()),O=(0,E.d)(),q=(0,R.Zp)(),K=(0,u.dU)("white","gray.800"),B=(0,u.dU)("gray.200","gray.700");(0,a.useEffect)(()=>{Z()},[W]);const Z=async()=>{try{L(!0);const e=await P.FH.get("/admin/financial/dashboard?year=".concat(W));n(e.data)}catch(e){O({title:"Chyba p\u0159i na\u010d\xedt\xe1n\xed dat",description:"Nepoda\u0159ilo se na\u010d\xedst finan\u010dn\xed data",status:"error",duration:5e3,isClosable:!0})}finally{L(!1)}},V=e=>new Intl.NumberFormat("cs-CZ",{style:"currency",currency:"CZK"}).format(e);return M?(0,I.jsx)(h.s,{justify:"center",align:"center",minH:"400px",children:(0,I.jsxs)(j.T,{spacing:4,children:[(0,I.jsx)(g.y,{size:"xl"}),(0,I.jsx)(D.E,{children:"Na\u010d\xedt\xe1m finan\u010dn\xed data..."})]})}):t?(0,I.jsx)(F.A,{children:(0,I.jsxs)(j.T,{spacing:8,align:"stretch",maxW:"1200px",mx:"auto",p:8,children:[(0,I.jsx)(r.a,{children:(0,I.jsxs)(h.s,{justify:"space-between",align:"center",mb:4,children:[(0,I.jsxs)(r.a,{children:[(0,I.jsx)(T.D,{size:"lg",mb:2,children:"Finan\u010dn\xed p\u0159ehled"}),(0,I.jsxs)(v.z,{spacing:4,children:[(0,I.jsx)(D.E,{color:"gray.600",children:"Rok:"}),(0,I.jsx)("select",{value:W,onChange:e=>U(parseInt(e.target.value)),style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid #e2e8f0"},children:[W-2,W-1,W,W+1].map(e=>(0,I.jsx)("option",{value:e,children:e},e))})]})]}),(0,I.jsx)(s.$,{leftIcon:(0,I.jsx)(N.GGD,{}),colorScheme:"blue",onClick:()=>q("/admin/invoices"),children:"Nov\xe1 faktura"})]})}),(0,I.jsxs)(m.r,{columns:{base:1,md:2,lg:4},spacing:6,children:[(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"Cash Flow"}),(0,I.jsx)(_.k,{children:V(t.sponsorship_summary.received_this_year-t.expense_summary.total_expenses)}),(0,I.jsxs)(f.h,{children:[(0,I.jsx)(y.Ip,{type:t.sponsorship_summary.received_this_year-t.expense_summary.total_expenses>=0?"increase":"decrease"}),t.sponsorship_summary.received_this_year-t.expense_summary.total_expenses>=0?"P\u0159\xedjem":"V\xfddaj"]})]})})}),(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"Celkov\xe9 p\u0159\xedjmy"}),(0,I.jsx)(_.k,{children:V(t.sponsorship_summary.received_this_year)}),(0,I.jsxs)(f.h,{children:[(0,I.jsx)(p.I,{as:N.ARf,color:"green.500",mr:2}),"Od sponzor\u016f"]})]})})}),(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"Celkov\xe9 v\xfddaje"}),(0,I.jsx)(_.k,{children:V(t.expense_summary.total_expenses)}),(0,I.jsxs)(f.h,{children:[(0,I.jsx)(p.I,{as:N.JW4,color:"red.500",mr:2}),t.expense_summary.pending_count>0&&"".concat(t.expense_summary.pending_count," \u010dek\xe1 na schv\xe1len\xed")]})]})})}),(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"Vyu\u017eit\xed rozpo\u010dtu"}),(0,I.jsxs)(_.k,{children:[t.budget_summary.total_budget>0?(t.budget_summary.total_spend/t.budget_summary.total_budget*100).toFixed(1):"0","%"]}),(0,I.jsx)(x.k,{value:t.budget_summary.total_budget>0?Math.min(t.budget_summary.total_spend/t.budget_summary.total_budget*100,100):0,colorScheme:(H=t.budget_summary.total_budget>0?t.budget_summary.total_spend/t.budget_summary.total_budget*100:0,H>=100?"red":H>=80?"yellow":"green"),mt:2}),t.budget_summary.over_budget_count>0&&(0,I.jsxs)(f.h,{children:[(0,I.jsx)(p.I,{as:N.eHT,color:"red.500",mr:2}),t.budget_summary.over_budget_count," rozpo\u010dt\u016f p\u0159ekro\u010deno"]})]})})})]}),(0,I.jsxs)(C.t,{children:[(0,I.jsxs)(z.w,{children:[(0,I.jsx)(w.o,{children:"Rozpo\u010dty"}),(0,I.jsx)(w.o,{children:"Sponzoring"}),(0,I.jsx)(w.o,{children:"V\xfddaje"}),(0,I.jsx)(w.o,{children:"Cash Flow"})]}),(0,I.jsxs)(A.T,{children:[(0,I.jsx)(S.K,{children:(0,I.jsxs)(j.T,{spacing:6,align:"stretch",children:[(0,I.jsxs)(m.r,{columns:{base:1,md:3},spacing:6,children:[(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"Celkov\xfd rozpo\u010det"}),(0,I.jsx)(_.k,{children:V(t.budget_summary.total_budget)})]})})}),(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"Vyu\u017eito"}),(0,I.jsx)(_.k,{children:V(t.budget_summary.total_spend)})]})})}),(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"Zb\xfdv\xe1"}),(0,I.jsx)(_.k,{children:V(t.budget_summary.remaining_budget)})]})})})]}),(0,I.jsxs)(i.F,{status:"info",children:[(0,I.jsx)(o._,{}),"Detailn\xed rozpo\u010dty a kategorie budou dostupn\xe9 v dal\u0161\xed verzi."]})]})}),(0,I.jsx)(S.K,{children:(0,I.jsxs)(j.T,{spacing:6,align:"stretch",children:[(0,I.jsxs)(m.r,{columns:{base:1,md:2,lg:4},spacing:6,children:[(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"Aktivn\xed sponzo\u0159i"}),(0,I.jsx)(_.k,{children:t.sponsorship_summary.active_sponsors}),(0,I.jsxs)(f.h,{children:[(0,I.jsx)(p.I,{as:N.A3x,color:"green.500",mr:2}),"Celkov\xe1 hodnota: ",V(t.sponsorship_summary.total_value)]})]})})}),(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"P\u0159ijato tento rok"}),(0,I.jsx)(_.k,{children:V(t.sponsorship_summary.received_this_year)})]})})}),(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"Celkem sponzor\u016f"}),(0,I.jsx)(_.k,{children:t.sponsorship_summary.total_sponsors})]})})}),(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"Aktivn\xed smlouvy"}),(0,I.jsx)(_.k,{children:t.sponsorship_summary.active_sponsors}),(0,I.jsxs)(f.h,{children:[(0,I.jsx)(p.I,{as:N.A3x,color:"green.500",mr:2}),"Moment\xe1ln\u011b aktivn\xed"]})]})})})]}),(0,I.jsxs)(i.F,{status:"info",children:[(0,I.jsx)(o._,{}),"Detailn\xed smlouvy a platby budou dostupn\xe9 v dal\u0161\xed verzi."]})]})}),(0,I.jsx)(S.K,{children:(0,I.jsxs)(j.T,{spacing:6,align:"stretch",children:[(0,I.jsxs)(m.r,{columns:{base:1,md:2,lg:4},spacing:6,children:[(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"Celkem v\xfddaje"}),(0,I.jsx)(_.k,{children:V(t.expense_summary.total_expenses)})]})})}),(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"Schv\xe1leno"}),(0,I.jsx)(_.k,{children:V(t.expense_summary.approved_expenses)})]})})}),(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"\u010cek\xe1 na schv\xe1len\xed"}),(0,I.jsx)(_.k,{children:V(t.expense_summary.pending_expenses)})]})})}),(0,I.jsx)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:(0,I.jsx)(c.b,{children:(0,I.jsxs)(b.r,{children:[(0,I.jsx)(k.v,{children:"Tento m\u011bs\xedc"}),(0,I.jsx)(_.k,{children:V(t.expense_summary.this_month_expenses)}),(0,I.jsxs)(f.h,{children:[(0,I.jsx)(p.I,{as:N.jH2,color:"blue.500",mr:2}),t.expense_summary.expense_count," celkem v\xfddaj\u016f"]})]})})})]}),(0,I.jsxs)(i.F,{status:"info",children:[(0,I.jsx)(o._,{}),"Detailn\xed kategorie a trendy budou dostupn\xe9 v dal\u0161\xed verzi."]})]})}),(0,I.jsx)(S.K,{children:(0,I.jsx)(j.T,{spacing:6,align:"stretch",children:(0,I.jsxs)(i.F,{status:"info",children:[(0,I.jsx)(o._,{}),"M\u011bs\xed\u010dn\xed cash flow p\u0159ehled bude dostupn\xfd v dal\u0161\xed verzi."]})})})]})]}),(0,I.jsxs)(l.Z,{bg:K,borderWidth:1,borderColor:B,children:[(0,I.jsx)(d.a,{children:(0,I.jsx)(T.D,{size:"md",children:"Ned\xe1vn\xe1 aktivita"})}),(0,I.jsx)(c.b,{children:(0,I.jsxs)(j.T,{spacing:3,align:"stretch",children:[null===(e=t.recent_expenses)||void 0===e?void 0:e.slice(0,5).map((e,t)=>(0,I.jsxs)(v.z,{justify:"space-between",children:[(0,I.jsxs)(j.T,{align:"start",spacing:1,children:[(0,I.jsxs)(v.z,{children:[(0,I.jsx)(p.I,{as:N.lZI,color:"red.500"}),(0,I.jsx)(D.E,{children:e.title})]}),(0,I.jsx)(D.E,{fontSize:"sm",color:"gray.600",children:new Date(e.created_at).toLocaleDateString("cs-CZ")})]}),(0,I.jsx)(D.E,{fontWeight:"bold",children:V(e.total_amount)})]},t)),(!t.recent_expenses||0===t.recent_expenses.length)&&(0,I.jsx)(D.E,{color:"gray.500",textAlign:"center",children:"\u017d\xe1dn\xe1 ned\xe1vn\xe1 aktivita"})]})})]})]})}):(0,I.jsxs)(i.F,{status:"error",children:[(0,I.jsx)(o._,{}),"Nepoda\u0159ilo se na\u010d\xedst finan\u010dn\xed data"]});var H}},36695:(e,t,n)=>{n.d(t,{bW:()=>i});var a=n(46291);async function i(){const e=(await a.Ay.get("/categories")).data;return Array.isArray(e)?e:e&&Array.isArray(e.items)?e.items:e&&Array.isArray(e.data)?e.data:[]}},37018:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var a=n(65043),i=n(73216),o=n(30502),r=n(22107),s=n(10202),l=n(28846),c=n(73225),d=n(76668),u=n(35699),h=n(98662),m=n(39081),p=n(7189),x=n(29066),g=n(46291);function v(e){try{var t,n;const a=null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.status,i=(null===e||void 0===e||null===(n=e.response)||void 0===n?void 0:n.data)||{},o=function(e){if(!e)return"";try{return String(e).trim()}catch(t){return""}}(i.error||i.message||(null===e||void 0===e?void 0:e.message)),r=o.toLowerCase();return null!==e&&void 0!==e&&e.response?429===a?"P\u0159\xedli\u0161 mnoho pokus\u016f. Zkuste to pros\xedm za chv\xedli.":a&&a>=500?"Chyba serveru. Zkuste to pros\xedm pozd\u011bji.":/first_name/.test(r)&&/last_name/.test(r)?"Zadejte pros\xedm jm\xe9no i p\u0159\xedjmen\xed.":r.includes("invalid email address")?"Zadejte platn\xfd e\u2011mail.":/email already (registered|in use)/.test(r)?"Tento e\u2011mail je ji\u017e registrov\xe1n. P\u0159ihlaste se nebo pou\u017eijte jin\xfd e\u2011mail.":r.includes("invalid credentials")?"Nespr\xe1vn\xfd e\u2011mail nebo heslo.":r.includes("email is required")?"Zadejte e\u2011mail.":/password/.test(r)&&(/min/.test(r)||/at least/.test(r)||/min=8/.test(r))?"Heslo mus\xed m\xedt alespo\u0148 8 znak\u016f.":/failed to (hash password|create user|generate token)/.test(r)||/database error/.test(r)?"Na na\u0161\xed stran\u011b do\u0161lo k chyb\u011b. Zkuste to pros\xedm znovu.":400===a?"Zkontrolujte vypln\u011bn\xe1 pole.":401===a?"Nespr\xe1vn\xe9 \xfadaje. Zkuste to znovu.":403===a?"P\u0159\xedstup byl odep\u0159en.":o||"N\u011bco se nepovedlo. Zkuste to pros\xedm znovu.":"ECONNABORTED"===(null===e||void 0===e?void 0:e.code)?"Vypr\u0161el \u010dasov\xfd limit po\u017eadavku. Zkuste to pros\xedm znovu.":"Nelze se p\u0159ipojit k serveru. Zkontrolujte p\u0159ipojen\xed a zkuste to znovu."}catch(a){return"N\u011bco se nepovedlo. Zkuste to pros\xedm znovu."}}var j=n(2367),b=n(70579);const y=()=>{var e,t;const[n,y]=(0,a.useState)(""),[f,k]=(0,a.useState)(""),[_,w]=(0,a.useState)(""),[z,S]=(0,a.useState)(!1),{login:A}=(0,x.A)(),C=(0,i.Zp)(),E=(0,i.zy)(),T=(0,o.d)(),D=(null===(e=E.state)||void 0===e||null===(t=e.from)||void 0===t?void 0:t.pathname)||"/";return(0,b.jsx)(r.a,{minH:"100vh",display:"flex",alignItems:"center",justifyContent:"center",children:(0,b.jsx)(r.a,{w:"100%",maxW:"md",p:8,borderWidth:1,borderRadius:8,boxShadow:"lg",children:(0,b.jsxs)(s.T,{as:"form",onSubmit:async e=>{e.preventDefault(),S(!0);const t=n.trim(),a=f.trim().toLowerCase();if(!t||!t.includes(" "))return T({title:"Registrace selhala",description:"Zadejte pros\xedm jm\xe9no i p\u0159\xedjmen\xed.",status:"error",duration:5e3,isClosable:!0}),void S(!1);if(!a||!a.includes("@"))return T({title:"Registrace selhala",description:"Zadejte platn\xfd e\u2011mail.",status:"error",duration:5e3,isClosable:!0}),void S(!1);if(!_||_.length<8)return T({title:"Registrace selhala",description:"Heslo mus\xed m\xedt alespo\u0148 8 znak\u016f.",status:"error",duration:5e3,isClosable:!0}),void S(!1);try{const e=await g.Ay.post("/auth/register",{email:a,password:_,name:n}),{token:t,user:i}=e.data;await A(t,i,!0),T({title:"\xda\u010det vytvo\u0159en",status:"success",duration:3e3}),C(D,{replace:!0})}catch(i){T({title:"Registrace selhala",description:v(i,"register"),status:"error",duration:5e3,isClosable:!0})}finally{S(!1)}},spacing:4,align:"stretch",children:[(0,b.jsx)(l.D,{as:"h2",size:"lg",textAlign:"center",mb:2,children:"Vytvo\u0159it \xfa\u010det"}),(0,b.jsxs)(c.MJ,{id:"name",isRequired:!0,children:[(0,b.jsx)(d.l,{children:"Jm\xe9no a p\u0159\xedjmen\xed"}),(0,b.jsx)(u.p,{value:n,onChange:e=>y(e.target.value),placeholder:"nap\u0159. Jan Nov\xe1k"})]}),(0,b.jsxs)(c.MJ,{id:"email",isRequired:!0,children:[(0,b.jsx)(d.l,{children:"E\u2011mail"}),(0,b.jsx)(u.p,{type:"email",value:f,onChange:e=>k(e.target.value),placeholder:"nap\u0159. jan@klub.cz"})]}),(0,b.jsxs)(c.MJ,{id:"password",isRequired:!0,children:[(0,b.jsxs)(d.l,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,b.jsx)(r.a,{children:"Heslo"}),(0,b.jsx)(j.II,{})]}),(0,b.jsx)(u.p,{type:"password",value:_,onChange:e=>w(e.target.value),placeholder:"Zadejte heslo (min. 8 znak\u016f)"})]}),(0,b.jsx)(h.$,{type:"submit",colorScheme:"blue",width:"full",mt:2,isLoading:z,children:"Zaregistrovat se"}),(0,b.jsxs)(m.E,{fontSize:"sm",textAlign:"center",children:["U\u017e m\xe1te \xfa\u010det?"," ",(0,b.jsx)(p.N,{color:"blue.500",href:"/login",children:"P\u0159ihlaste se"})]})]})})})}},37752:(e,t,n)=>{n.r(t),n.d(t,{default:()=>L});var a=n(89379),i=n(65043),o=n(88787),r=n(85871),s=n(87139),l=n(22107),c=n(98662),d=n(42703),u=n(83169),h=n(24330),m=n(5371),p=n(73225),x=n(76668),g=n(73212),v=n(33572),j=n(35699),b=n(67516),y=n(35929),f=n(56529),k=n(15071),_=n(11054),w=n(78460),z=n(85421),S=n(76659),A=n(96148),C=n(10202),E=n(19077),T=n(30502),D=n(99956),N=n(28846),R=n(39081),F=n(1009),P=n(46291),I=n(6583),M=n(70579);const L=()=>{const[e,t]=(0,i.useState)([]),[n,L]=(0,i.useState)(!0),[W,U]=(0,i.useState)(!1),[O,q]=(0,i.useState)(!1),[K,B]=(0,i.useState)(null),[Z,V]=(0,i.useState)({name:"",description:"",target_url:""}),[H,$]=(0,i.useState)(!1),J=(0,T.d)();(0,i.useEffect)(()=>{G()},[]);const G=async()=>{try{L(!0);const e=await P.FH.get("/admin/qr-codes");t(e.data||[])}catch(e){console.error("Failed to fetch QR codes:",e),J({title:"Chyba p\u0159i na\u010d\xedt\xe1n\xed",description:"Nepoda\u0159ilo se na\u010d\xedst QR k\xf3dy",status:"error",duration:5e3,isClosable:!0})}finally{L(!1)}},X=async e=>{if(e.preventDefault(),Z.name&&Z.target_url)try{$(!0),K?(await P.FH.put("/admin/qr-codes/".concat(K.id),Z),J({title:"QR k\xf3d aktualizov\xe1n",status:"success",duration:5e3,isClosable:!0})):(await P.FH.post("/admin/qr-codes",Z),J({title:"QR k\xf3d vytvo\u0159en",status:"success",duration:5e3,isClosable:!0})),U(!1),q(!1),B(null),V({name:"",description:"",target_url:""}),G()}catch(t){console.error("Failed to save QR code:",t),J({title:"Chyba",description:"Nepoda\u0159ilo se ulo\u017eit QR k\xf3d",status:"error",duration:5e3,isClosable:!0})}finally{$(!1)}else J({title:"Chyba",description:"N\xe1zev a c\xedlov\xe1 URL jsou povinn\xe9",status:"error",duration:5e3,isClosable:!0})};return n?(0,M.jsx)(I.A,{children:(0,M.jsx)(m.s,{justify:"center",align:"center",minH:"400px",children:(0,M.jsxs)(C.T,{spacing:4,children:[(0,M.jsx)(S.y,{size:"xl"}),(0,M.jsx)(R.E,{children:"Na\u010d\xedt\xe1m QR k\xf3dy..."})]})})}):(0,M.jsx)(I.A,{children:(0,M.jsxs)(C.T,{spacing:6,align:"stretch",children:[(0,M.jsxs)(A.z,{justify:"space-between",children:[(0,M.jsx)(N.D,{size:"lg",children:"QR k\xf3dy"}),(0,M.jsx)(c.$,{leftIcon:(0,M.jsx)(F.GGD,{}),colorScheme:"blue",onClick:()=>U(!0),children:"Vytvo\u0159it QR k\xf3d"})]}),(0,M.jsxs)(o.F,{status:"info",children:[(0,M.jsx)(r._,{}),(0,M.jsxs)(l.a,{children:[(0,M.jsx)(R.E,{fontWeight:"bold",children:"QR k\xf3dy pro rychl\xfd p\u0159\xedstup"}),(0,M.jsx)(R.E,{fontSize:"sm",children:"Vytv\xe1\u0159ejte QR k\xf3dy pro r\u016fzn\xe9 str\xe1nky va\u0161eho webu - \u010dl\xe1nky, kontakty, sponzory atd. U\u017eivatel\xe9 mohou jednodu\u0161e naskenovat k\xf3d a okam\u017eit\u011b nav\u0161t\xedvit c\xedlovou str\xe1nku."})]})]}),0===e.length?(0,M.jsx)(u.Z,{children:(0,M.jsxs)(h.b,{textAlign:"center",py:12,children:[(0,M.jsx)(F.PjK,{size:48,color:"gray.400"}),(0,M.jsxs)(C.T,{spacing:4,mt:6,children:[(0,M.jsx)(N.D,{size:"md",color:"gray.600",children:"\u017d\xe1dn\xe9 QR k\xf3dy"}),(0,M.jsx)(R.E,{color:"gray.500",children:"Je\u0161t\u011b nebyly vytvo\u0159eny \u017e\xe1dn\xe9 QR k\xf3dy"}),(0,M.jsx)(c.$,{leftIcon:(0,M.jsx)(F.GGD,{}),colorScheme:"blue",variant:"outline",onClick:()=>U(!0),children:"Vytvo\u0159it prvn\xed QR k\xf3d"})]})]})}):(0,M.jsx)(g.r,{columns:{base:1,md:2,lg:3},spacing:6,children:e.map(e=>(0,M.jsx)(u.Z,{borderWidth:1,borderRadius:"lg",children:(0,M.jsx)(h.b,{children:(0,M.jsxs)(C.T,{spacing:4,children:[(0,M.jsx)(l.a,{p:4,bg:"white",borderRadius:"md",borderWidth:1,borderColor:"gray.200",children:(0,M.jsx)(v._,{src:e.qr_code_url,alt:"QR k\xf3d: ".concat(e.name),w:150,h:150,fallback:(0,M.jsx)(l.a,{w:150,h:150,bg:"gray.100"})})}),(0,M.jsxs)(C.T,{spacing:2,align:"start",width:"100%",children:[(0,M.jsxs)(A.z,{justify:"space-between",width:"100%",children:[(0,M.jsx)(R.E,{fontWeight:"bold",fontSize:"lg",noOfLines:1,children:e.name}),(0,M.jsx)(s.E,{colorScheme:e.is_active?"green":"gray",children:e.is_active?"Aktivn\xed":"Neaktivn\xed"})]}),e.description&&(0,M.jsx)(R.E,{fontSize:"sm",color:"gray.600",noOfLines:2,children:e.description}),(0,M.jsx)(R.E,{fontSize:"sm",color:"blue.600",noOfLines:1,children:e.target_url}),(0,M.jsxs)(A.z,{spacing:4,fontSize:"sm",color:"gray.500",children:[(0,M.jsxs)(R.E,{children:["\ud83d\udcca ",e.scan_count," skenov\xe1n\xed"]}),(0,M.jsxs)(R.E,{children:["\ud83d\udcc5 ",new Date(e.created_at).toLocaleDateString("cs-CZ")]})]})]}),(0,M.jsx)(C.T,{spacing:2,width:"100%",children:(0,M.jsxs)(A.z,{spacing:2,width:"100%",children:[(0,M.jsx)(D.m,{label:"St\xe1hnout QR k\xf3d",children:(0,M.jsx)(d.K,{"aria-label":"St\xe1hnout",icon:(0,M.jsx)(F.a4x,{}),size:"sm",onClick:()=>(async e=>{try{const t=await fetch(e.qr_code_url);if(!t.ok)throw new Error("Failed to fetch QR code image");const n=await t.blob(),a=window.URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.download="qr-".concat(e.name.replace(/[^a-z0-9]/gi,"_").toLowerCase(),".png"),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(a)}catch(t){console.error("Failed to download QR code:",t),J({title:"Chyba",description:"Nepoda\u0159ilo se st\xe1hnout QR k\xf3d",status:"error",duration:5e3,isClosable:!0})}})(e)})}),(0,M.jsx)(D.m,{label:"Kop\xedrovat URL",children:(0,M.jsx)(d.K,{"aria-label":"Kop\xedrovat",icon:(0,M.jsx)(F.nxz,{}),size:"sm",onClick:()=>(async e=>{try{await navigator.clipboard.writeText(e),J({title:"Zkop\xedrov\xe1no",description:"URL zkop\xedrov\xe1na do schr\xe1nky",status:"success",duration:3e3,isClosable:!0})}catch(t){J({title:"Chyba",description:"Nepoda\u0159ilo se zkop\xedrovat URL",status:"error",duration:3e3,isClosable:!0})}})(e.target_url)})}),(0,M.jsx)(D.m,{label:"Otev\u0159\xedt v nov\xe9m okn\u011b",children:(0,M.jsx)(d.K,{"aria-label":"Otev\u0159\xedt",icon:(0,M.jsx)(F.HaR,{}),size:"sm",as:"a",href:e.target_url,target:"_blank",rel:"noopener noreferrer"})}),(0,M.jsx)(l.a,{flex:1}),(0,M.jsx)(D.m,{label:"Upravit",children:(0,M.jsx)(d.K,{"aria-label":"Upravit",icon:(0,M.jsx)(F.SG1,{}),size:"sm",onClick:()=>(e=>{B(e),V({name:e.name,description:e.description||"",target_url:e.target_url}),q(!0)})(e)})}),(0,M.jsx)(D.m,{label:"Smazat",children:(0,M.jsx)(d.K,{"aria-label":"Smazat",icon:(0,M.jsx)(F.IXo,{}),size:"sm",colorScheme:"red",variant:"outline",onClick:()=>(async e=>{if(confirm("Opravdu chcete smazat tento QR k\xf3d?"))try{await P.FH.delete("/admin/qr-codes/".concat(e)),J({title:"QR k\xf3d smaz\xe1n",status:"success",duration:5e3,isClosable:!0}),G()}catch(t){console.error("Failed to delete QR code:",t),J({title:"Chyba",description:"Nepoda\u0159ilo se smazat QR k\xf3d",status:"error",duration:5e3,isClosable:!0})}})(e.id)})})]})})]})})},e.id))}),(0,M.jsxs)(w.aF,{isOpen:W,onClose:()=>U(!1),size:"md",children:[(0,M.jsx)(_.m,{}),(0,M.jsxs)(z.$,{children:[(0,M.jsx)(k.r,{children:"Vytvo\u0159it QR k\xf3d"}),(0,M.jsx)(y.s,{}),(0,M.jsxs)("form",{onSubmit:X,children:[(0,M.jsx)(b.c,{children:(0,M.jsxs)(C.T,{spacing:4,children:[(0,M.jsxs)(p.MJ,{isRequired:!0,children:[(0,M.jsx)(x.l,{children:"N\xe1zev"}),(0,M.jsx)(j.p,{value:Z.name,onChange:e=>V((0,a.A)((0,a.A)({},Z),{},{name:e.target.value})),placeholder:"Nap\u0159. Kontaktn\xed str\xe1nka"})]}),(0,M.jsxs)(p.MJ,{children:[(0,M.jsx)(x.l,{children:"Popis"}),(0,M.jsx)(E.T,{value:Z.description,onChange:e=>V((0,a.A)((0,a.A)({},Z),{},{description:e.target.value})),placeholder:"Kr\xe1tk\xfd popis \xfa\u010delu QR k\xf3du",rows:3})]}),(0,M.jsxs)(p.MJ,{isRequired:!0,children:[(0,M.jsx)(x.l,{children:"C\xedlov\xe1 URL"}),(0,M.jsx)(j.p,{value:Z.target_url,onChange:e=>V((0,a.A)((0,a.A)({},Z),{},{target_url:e.target.value})),placeholder:"https://vasweb.cz/stranka",type:"url"})]})]})}),(0,M.jsxs)(f.j,{children:[(0,M.jsx)(c.$,{variant:"outline",mr:3,onClick:()=>U(!1),children:"Zru\u0161it"}),(0,M.jsx)(c.$,{type:"submit",colorScheme:"blue",isLoading:H,children:"Vytvo\u0159it"})]})]})]})]}),(0,M.jsxs)(w.aF,{isOpen:O,onClose:()=>q(!1),size:"md",children:[(0,M.jsx)(_.m,{}),(0,M.jsxs)(z.$,{children:[(0,M.jsx)(k.r,{children:"Upravit QR k\xf3d"}),(0,M.jsx)(y.s,{}),(0,M.jsxs)("form",{onSubmit:X,children:[(0,M.jsx)(b.c,{children:(0,M.jsxs)(C.T,{spacing:4,children:[(0,M.jsxs)(p.MJ,{isRequired:!0,children:[(0,M.jsx)(x.l,{children:"N\xe1zev"}),(0,M.jsx)(j.p,{value:Z.name,onChange:e=>V((0,a.A)((0,a.A)({},Z),{},{name:e.target.value})),placeholder:"Nap\u0159. Kontaktn\xed str\xe1nka"})]}),(0,M.jsxs)(p.MJ,{children:[(0,M.jsx)(x.l,{children:"Popis"}),(0,M.jsx)(E.T,{value:Z.description,onChange:e=>V((0,a.A)((0,a.A)({},Z),{},{description:e.target.value})),placeholder:"Kr\xe1tk\xfd popis \xfa\u010delu QR k\xf3du",rows:3})]}),(0,M.jsxs)(p.MJ,{isRequired:!0,children:[(0,M.jsx)(x.l,{children:"C\xedlov\xe1 URL"}),(0,M.jsx)(j.p,{value:Z.target_url,onChange:e=>V((0,a.A)((0,a.A)({},Z),{},{target_url:e.target.value})),placeholder:"https://vasweb.cz/stranka",type:"url"})]})]})}),(0,M.jsxs)(f.j,{children:[(0,M.jsx)(c.$,{variant:"outline",mr:3,onClick:()=>q(!1),children:"Zru\u0161it"}),(0,M.jsx)(c.$,{type:"submit",colorScheme:"blue",isLoading:H,children:"Ulo\u017eit zm\u011bny"})]})]})]})]})]})})}},38376:(e,t,n)=>{n.d(t,{SX:()=>c,Zc:()=>d,kQ:()=>s,lh:()=>r,qM:()=>l,y6:()=>o});var a=n(46291),i=n(71860);const o=async()=>(await a.FH.get("/events/upcoming")).data,r=async e=>{const t=(0,i.gf)();return(await a.FH.post("/events",e,{headers:t?{Authorization:"Bearer ".concat(t)}:void 0})).data},s=async()=>(await a.FH.get("/events")).data,l=async(e,t)=>{const n=(0,i.gf)();return(await a.FH.put("/events/".concat(e),t,{headers:n?{Authorization:"Bearer ".concat(n)}:void 0})).data},c=async e=>{const t=(0,i.gf)();return(await a.FH.delete("/events/".concat(e),{headers:t?{Authorization:"Bearer ".concat(t)}:void 0})).data},d=async e=>(await a.FH.get("/events/".concat(e))).data},39140:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ie});var a=n(89379),i=n(65043),o=n(40378),r=n(96870),s=n(87139),l=n(22107),c=n(98662),d=n(96351),u=n(42703),h=n(44093),m=n(98939),p=n(5371),x=n(43533),g=n(33572),v=n(35699),j=n(7189),b=n(67516),y=n(35929),f=n(56529),k=n(15071),_=n(78460),w=n(85421),z=n(76659),S=n(29904),A=n(14566),C=n(31411),E=n(10227),T=n(51794),D=n(3109),N=n(30502),R=n(99956),F=n(28846),P=n(39081),I=n(14261),M=n(63856),L=n(66981),W=n(92885),U=n(69023),O=n(65757),q=n(92410),K=n(74912),B=n(1620),Z=n(6175),V=n(70082),H=n(35475),$=n(39183),J=n(81398),G=n(85638),X=n(95182),Y=n(25189),Q=n(46291),ee=n(56644),te=n(74117),ne=n(71942),ae=n(70579);const ie=()=>{var e;const{t:t,i18n:n}=(0,te.Bd)(),[ie,oe]=(0,i.useState)(!0),[re,se]=(0,i.useState)([]),[le,ce]=(0,i.useState)(null),[de,ue]=(0,i.useState)({}),[he,me]=(0,i.useState)({}),[pe,xe]=(0,i.useState)(0),[ge]=(0,H.ok)(),ve=(0,N.d)(),[je,be]=(0,i.useState)(""),[ye,fe]=(0,i.useState)(""),[ke,_e]=(0,i.useState)("football"),[we,ze]=(0,i.useState)([]),Se="en"===n.language?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Po","\xdat","St","\u010ct","P\xe1","So","Ne"];const Ae=e=>{const n=new Date("".concat(e.date,"T").concat(e.time||"00:00",":00"));if(!(Date.now()>=n.getTime()))return null;const a=wt(e.score);if(!a)return null;const i=it(e.home).includes(it(je)),o=it(e.away).includes(it(je));if(!i&&!o)return null;if(a.h===a.a)return{label:t("calendar.draw"),color:"blue"};return(i?a.h:a.a)>(i?a.a:a.h)?{label:t("calendar.win"),color:"green"}:{label:t("calendar.loss"),color:"red"}},Ce=(0,i.useMemo)(()=>re[pe],[re,pe]),Ee=(0,h.dU)("white","gray.800"),Te=(0,h.dU)("gray.200","gray.700"),De=(0,h.dU)("gray.50","gray.700"),Ne=(0,h.dU)("blue.50","blue.900"),Re=(0,h.dU)("white","gray.800"),Fe=(0,h.dU)("gray.200","gray.700"),Pe=(0,h.dU)("gray.50","gray.700"),Ie=(0,h.dU)("blue.50","blue.900"),Me=(0,h.dU)("gray.300","gray.600"),Le=(0,h.dU)("gray.800","gray.100"),We=(0,h.dU)("gray.50","gray.700"),Ue=(0,h.dU)("gray.200","gray.600"),Oe=(0,h.dU)("blue.50","blue.900"),qe=(0,h.dU)("gray.800","gray.100"),Ke=(0,h.dU)("gray.600","gray.400"),{isOpen:Be,onOpen:Ze,onClose:Ve}=((0,h.dU)("gray.700","gray.300"),(0,r.j)()),[He,$e]=(0,i.useState)(null),[Je,Ge]=(0,i.useState)(""),[Xe,Ye]=(0,i.useState)(!1),[Qe,et]=(0,i.useState)(!1),[tt,nt]=(0,i.useState)(null),at=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(Q.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}},it=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),ot=e=>{let t=it(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,""),t.replace(/\s+/g," ").trim()},rt=(e,t)=>{try{const n=it(e);let a=null;for(const e of we){const t=e.table||e.rows||[];for(const e of t){const t=it(e.team_name||e.team||"");if(t===n||t.includes(n)||n.includes(t)){a=e;break}}if(a)break}if(a){const n={team:a.team_name||a.team||e,team_id:a.team_id||String(a.position||0),team_logo_url:a.logo_url?(0,Y.uq)(a.logo_url)||a.logo_url:t,rank:a.position||a.rank||a.pos,played:a.played||a.matches,wins:a.wins||a.win,draws:a.draws||a.draw,losses:a.losses||a.loss,score:a.score||((a.goals_for||a.gf)&&(a.goals_against||a.ga)?"".concat(a.goals_for||a.gf,":").concat(a.goals_against||a.ga):void 0),points:a.points||a.pts};nt(n),et(!0)}else{nt({team:e,team_id:e,team_logo_url:t,rank:"-",played:"-",wins:"-",draws:"-",losses:"-",score:"-",points:"-"}),et(!0)}}catch(n){}};(0,i.useEffect)(()=>{let e=!1;return(async()=>{oe(!0),ce(null);try{var n,i;let u={};try{(await(0,V.xN)()||[]).forEach(e=>{null!==e&&void 0!==e&&e.code&&null!==e&&void 0!==e&&e.alias&&(u[e.code]={alias:e.alias,original_name:e.original_name,display_order:e.display_order})})}catch(r){}const h=Date.now();let m=null;try{const e=await fetch(at("/api/v1/public/team-logo-overrides?t=".concat(h)),{cache:"no-cache"});e.ok&&(m=await e.json())}catch(s){}if(!m)try{const e=await fetch(at("/cache/prefetch/team_logo_overrides.json"),{cache:"no-cache"});e.ok&&(m=await e.json())}catch(l){}const p=(null===(n=m)||void 0===n?void 0:n.by_name)||{},x=(null===(i=m)||void 0===i?void 0:i.by_id)||{},g=Object.keys(p||{}).reduce((e,t)=>(e[it(t)]=p[t],e),{}),v=Object.keys(p||{}).map(e=>({keyNorm:ot(e),url:p[e]})),j=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[\u2012\u2013\u2014\u2015\u2212]/g,"-").replace(/\bn\.?\b/g," nad ").replace(/\bp\.?\b/g," pod ").replace(/[\,\s]*(z\.?\s*s\.?|o\.?\s*s\.?)\s*$/g,"").replace(/[\.,!;:()\[\]{}]/g," ").replace(/\s+/g," ").trim().toLowerCase(),b=(()=>{const e={};for(const n of Object.values(x||{})){const t=String((null===n||void 0===n?void 0:n.name)||"").trim(),a=String((null===n||void 0===n?void 0:n.logo_url)||"").trim();t&&a&&(e[a]=t)}const t={};for(const[n,a]of Object.entries(p||{})){const i=e[String(a)]||"",o=j(n);i&&o&&(t[o]=i)}return t})(),y=(()=>{const e={};for(const[t,n]of Object.entries(x||{})){const a=String((null===n||void 0===n?void 0:n.name)||"").trim(),i=String((null===n||void 0===n?void 0:n.logo_url)||"").trim();if(!a)continue;const o=j(a);o&&(e[o]={id:t,name:a,logo_url:i})}return e})(),f=(e,t)=>{var n;const a=t?String(t):"";if(a&&null!==x&&void 0!==x&&null!==(n=x[a])&&void 0!==n&&n.name&&String(x[a].name).trim())return String(x[a].name).trim();try{const t=j(e);if(b[t])return b[t];let n=y[t];if(!n)for(const[e,a]of Object.entries(y))if(e&&(t.endsWith(e)||e.endsWith(t))){n=a;break}if(n&&n.name)return String(n.name)}catch(i){}return String(e||"")},k=(e,t,n)=>{var a;if(n&&null!==x&&void 0!==x&&null!==(a=x[n])&&void 0!==a&&a.logo_url){const e=x[n].logo_url;return"string"===typeof e&&e.startsWith("/")?at(e):e}if(!e)return t;const i=(p||{})[e],o=it(e);let r=i||g[o];if(!r){const t=ot(e);for(const{keyNorm:e,url:n}of v)if(e&&(t.endsWith(e)||e.endsWith(t))){r=n;break}}const s=r||t;return"string"===typeof s&&s.startsWith("/")?at(s):s},_=await fetch(at("/cache/prefetch/facr_club_info.json"),{cache:"no-cache"});if(!_.ok)throw new Error("HTTP ".concat(_.status));const w=await _.json(),z={},S=Array.isArray(null===w||void 0===w?void 0:w.competitions)?w.competitions.map((e,t)=>{var n,a;const i=String(e.id||t);e.matches_link&&(z[i]=String(e.matches_link));const o=(Array.isArray(e.matches)?e.matches:[]).map((e,n)=>{const a=String(e.date_time||""),[i,o]=a.includes(" ")?a.split(" "):[a,""],[r,s,l]=i.split("."),c=r&&s&&l?"".concat(l,"-").concat(s.padStart(2,"0"),"-").concat(r.padStart(2,"0")):(new Date).toISOString().slice(0,10),d=(o||"00:00").slice(0,5),u=(e.score||e.result||("number"===typeof e.goals_home&&"number"===typeof e.goals_away?"".concat(e.goals_home,":").concat(e.goals_away):"")||"").toString(),h=f(e.home,e.home_id),m=f(e.away,e.away_id);return{id:e.match_id||"".concat(t,"-").concat(n),date:c,time:d,home:h,away:m,home_id:e.home_id,away_id:e.away_id,venue:e.venue,home_logo_url:k(h,e.home_logo_url,e.home_id),away_logo_url:k(m,e.away_logo_url,e.away_id),report_url:e.report_url,facr_link:e.facr_link,score:u&&/\d+\s*:\s*\d+/.test(u)?u.replace(/\s+/g,""):void 0}}).sort((e,t)=>new Date("".concat(e.date,"T").concat(e.time,":00")).getTime()-new Date("".concat(t.date,"T").concat(t.time,":00")).getTime());return{id:i,code:e.code,name:(null===u||void 0===u||null===(n=u[null===e||void 0===e?void 0:e.code])||void 0===n?void 0:n.alias)||(null===u||void 0===u||null===(a=u[i])||void 0===a?void 0:a.alias)||e.name||e.code||"Sout\u011b\u017e ".concat(t+1),matches:o}}):[];let A=S;try{const e=null===w||void 0===w?void 0:w.club_id,t=(null===w||void 0===w?void 0:w.club_type)||"football";if(e){const n="/cache/facr/".concat(t,"_").concat(e,"_info.json"),i=await fetch(at(n),{cache:"no-cache"});if(i.ok){const e=await i.json();if(Array.isArray(null===e||void 0===e?void 0:e.competitions)){const t=(e,t)=>{const n=(Array.isArray(e.matches)?e.matches:[]).map((e,n)=>{const a=String(e.date_time||""),[i,o]=a.includes(" ")?a.split(" "):[a,""],[r,s,l]=i.split("."),c=r&&s&&l?"".concat(l,"-").concat(s.padStart(2,"0"),"-").concat(r.padStart(2,"0")):(new Date).toISOString().slice(0,10),d=(o||"00:00").slice(0,5),u=(e.score||e.result||("number"===typeof e.goals_home&&"number"===typeof e.goals_away?"".concat(e.goals_home,":").concat(e.goals_away):"")||"").toString();return{id:e.match_id||"".concat(t,"-").concat(n),date:c,time:d,home:f(e.home,e.home_id),away:f(e.away,e.away_id),home_id:e.home_id,away_id:e.away_id,venue:e.venue,home_logo_url:k(e.home,e.home_logo_url,e.home_id),away_logo_url:k(e.away,e.away_logo_url,e.away_id),report_url:e.report_url,score:u&&/\d+\s*:\s*\d+/.test(u)?u.replace(/\s+/g,""):void 0}}).sort((e,t)=>new Date("".concat(e.date,"T").concat(e.time,":00")).getTime()-new Date("".concat(t.date,"T").concat(t.time,":00")).getTime());return n};A=S.map(n=>{if(n.matches.length)return n;const i=e.competitions.find(e=>String(e.id)===String(n.id)||e.name===n.name||e.code===n.name||e.code===n.id);if(!i)return n;const o=t(i,0);return(0,a.A)((0,a.A)({},n),{},{matches:o})})}}}}catch(c){}const C=(0,G.tJ)(A.map(e=>{var t,n,i,o,r;return(0,a.A)((0,a.A)({},e),{},{alias:(null===u||void 0===u||null===(t=u[(null===e||void 0===e?void 0:e.code)||""])||void 0===t?void 0:t.alias)||(null===u||void 0===u||null===(n=u[null===e||void 0===e?void 0:e.id])||void 0===n?void 0:n.alias),display_order:null!==(i=null===u||void 0===u||null===(o=u[(null===e||void 0===e?void 0:e.code)||""])||void 0===o?void 0:o.display_order)&&void 0!==i?i:null===u||void 0===u||null===(r=u[null===e||void 0===e?void 0:e.id])||void 0===r?void 0:r.display_order})})),E=(C||[]).flatMap((e,t)=>(e.matches||[]).map(n=>{var i;return(0,a.A)((0,a.A)({},n),{},{__compId:e.id,__compName:e.name,__compDisplayOrder:null!==(i=e.display_order)&&void 0!==i?i:1e3+t})})).sort((e,t)=>new Date("".concat(e.date,"T").concat(e.time,":00")).getTime()-new Date("".concat(t.date,"T").concat(t.time,":00")).getTime()),T={id:"all",name:t("calendar.all_competitions"),matches:E};let D=[];try{const e=await fetch(at("/cache/prefetch/facr_tables.json"),{cache:"no-cache"});if(e.ok){var o;const t=await e.json();null!==t&&void 0!==t&&null!==(o=t.competitions)&&void 0!==o&&o.length&&(D=(t.competitions||[]).map(e=>{var t,n,a;return{name:(null===u||void 0===u||null===(t=u[null===e||void 0===e?void 0:e.code])||void 0===t?void 0:t.alias)||(null===u||void 0===u||null===(n=u[null===e||void 0===e?void 0:e.id])||void 0===n?void 0:n.alias)||e.name||e.code,table:((null===(a=e.table)||void 0===a?void 0:a.overall)||[]).map((e,t)=>{var n,a,i,o,r,s,l,c,d,u,h;const m=(()=>{const t=e.team;return"string"===typeof t?t:t&&"object"===typeof t?t.name||t.Name||t.team_name||t.TeamName||"-":e.team_name||e.TeamName||"-"})(),p=(()=>{const t=e.team;return t&&"object"===typeof t&&(t.id||t.team_id||t.teamId)||e.team_id})();return{position:Number(e.rank||t+1),team_name:p&&null!==x&&void 0!==x&&null!==(n=x[p])&&void 0!==n&&n.name&&String(x[p].name).trim()?String(x[p].name):m,team_id:p,points:Number(e.points||e.pts||0),played:Number(e.played||e.matches||0),wins:Number(e.wins||e.win||0),draws:Number(e.draws||e.draw||0),losses:Number(e.losses||e.loss||0),goals_for:Number(null!==(a=null!==(i=null!==(o=null!==(r=null!==(s=e.goals_for)&&void 0!==s?s:e.gf)&&void 0!==r?r:e.goalsFor)&&void 0!==o?o:e.scored)&&void 0!==i?i:e.goals)&&void 0!==a?a:0),goals_against:Number(null!==(l=null!==(c=null!==(d=null!==(u=e.goals_against)&&void 0!==u?u:e.ga)&&void 0!==d?d:e.goalsAgainst)&&void 0!==c?c:e.conceded)&&void 0!==l?l:0),logo_url:p&&null!==x&&void 0!==x&&null!==(h=x[p])&&void 0!==h&&h.logo_url?String(x[p].logo_url):e.team_logo_url||void 0}})}}))}}catch(d){}if(!e){me(u);const e=[T,...C];se(e),ue(z),ze(D),null!==w&&void 0!==w&&w.name&&be(String(w.name)),null!==w&&void 0!==w&&w.club_internal_id&&fe(String(w.club_internal_id)),null!==w&&void 0!==w&&w.club_type&&_e(w.club_type);const t=ge.get("comp");if(t){const n=e.findIndex(e=>String(e.id)===String(t));xe(n>=0?n:0)}else xe(0)}}catch(u){e||ce((null===u||void 0===u?void 0:u.message)||"Nepoda\u0159ilo se na\u010d\xedst kalend\xe1\u0159.")}finally{e||oe(!1)}})(),()=>{e=!0}},[]);const st=(0,$.L)(He?"".concat(He.match.date,"T").concat(He.match.time||"00:00",":00"):null,1e3),lt=(0,i.useMemo)(()=>((null===Ce||void 0===Ce?void 0:Ce.matches)||[]).filter(e=>new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime()>Date.now()),[Ce]),ct=(0,$.M)(lt,3e4),dt=(e,t)=>{$e({match:e,comp:t}),Ze()},ut=e=>{if(1===e.button){var t;const a=e.currentTarget,i=a.getAttribute&&a.getAttribute("data-href")||(null===(t=a.dataset)||void 0===t?void 0:t.href);if(i)try{e.preventDefault(),e.stopPropagation();const t=document.createElement("a");t.href=i,t.target="_blank",t.rel="noopener noreferrer",t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t),setTimeout(()=>{try{window.focus()}catch(e){}},0)}catch(n){window.open(i,"_blank","noopener,noreferrer")}}},ht=(0,i.useMemo)(()=>re.some(e=>e.matches.length),[re]),[mt,pt]=(0,i.useState)((0,K.w)(new Date)),[xt,gt]=(0,i.useState)("calendar"),[vt,jt]=(0,i.useState)({}),[bt,yt]=(0,i.useState)(!1),ft=(0,i.useMemo)(()=>{try{var e,t,n;const a=new Intl.DateTimeFormat("cs-CZ",{timeZone:"Europe/Prague",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date),i=null===(e=a.find(e=>"year"===e.type))||void 0===e?void 0:e.value,o=null===(t=a.find(e=>"month"===e.type))||void 0===t?void 0:t.value,r=null===(n=a.find(e=>"day"===e.type))||void 0===n?void 0:n.value;if(i&&o&&r)return"".concat(i,"-").concat(o,"-").concat(r)}catch(a){}return(0,U.GP)(new Date,"yyyy-MM-dd")},[]),kt=(0,i.useMemo)(()=>{const e=(0,B.k)((0,K.w)(mt),{weekStartsOn:1}),t=[];for(let n=0;n<42;n++)t.push((0,L.f)(e,n));return t},[mt]),_t=(e,t)=>{try{var n,a,i;let o=t;"all"!==(null===t||void 0===t?void 0:t.id)&&t||!e.__compId||(o=re.find(t=>String(t.id)===String(e.__compId)));const r=e.__compName||(null===(n=o)||void 0===n?void 0:n.name)||"";return{display:r,alias:null!==(a=o)&&void 0!==a&&a.code?null===(i=he[o.code])||void 0===i?void 0:i.alias:void 0}}catch(o){return{display:e.__compName||(null===t||void 0===t?void 0:t.name)||"",alias:void 0}}},wt=e=>{if(!e)return null;const t=e.match(/^(\d+)\s*[:\-]\s*(\d+)$/);return t?{h:parseInt(t[1],10),a:parseInt(t[2],10)}:null};return(0,ae.jsxs)(o.A,{children:[(0,ae.jsxs)(m.m,{maxW:"7xl",py:{base:6,md:10},children:[(0,ae.jsx)(F.D,{as:"h1",size:"xl",mb:2,children:t("calendar.title")}),(0,ae.jsx)(P.E,{color:"gray.600",mb:6,children:t("calendar.subtitle")}),ie&&(0,ae.jsxs)(p.s,{align:"center",gap:3,color:"gray.600",mb:6,children:[(0,ae.jsx)(z.y,{size:"sm"}),(0,ae.jsx)("span",{children:t("calendar.loading")})]}),le&&(0,ae.jsx)(l.a,{color:"red.600",mb:4,children:le}),!ie&&!ht&&!le&&(0,ae.jsx)(l.a,{color:"gray.600",children:t("calendar.no_matches")}),!!re.length&&(0,ae.jsxs)(D.t,{variant:"soft-rounded",colorScheme:"blue",index:pe,onChange:e=>xe(e),isLazy:!0,lazyBehavior:"keepMounted",children:[(0,ae.jsx)(l.a,{mb:3,position:"relative",zIndex:1,children:(0,ae.jsx)(C.w,{flexWrap:"wrap",gap:2,justifyContent:"flex-start",sx:{"& > button":{minW:"auto",px:{base:3,md:4},py:{base:1.5,md:2},fontSize:{base:"xs",md:"sm"},fontWeight:600,borderRadius:"md",transition:"all 0.2s",_selected:{bg:"brand.primary",color:"white",transform:"translateY(-2px)",boxShadow:"md"},_hover:{transform:"translateY(-1px)",boxShadow:"sm"}}},children:re.map(e=>(0,ae.jsx)(A.o,{children:e.name},e.id))})}),(0,ae.jsx)(T.T,{children:re.map((e,n)=>{const i=n===pe,o=i?(e=>{const t=new Map;return e.forEach(e=>{const n=e.date,a=t.get(n)||[];a.push(e),t.set(n,a)}),t.forEach((e,t)=>{e.sort((e,t)=>{var n,a;const i=null!==(n=e.__compDisplayOrder)&&void 0!==n?n:9999,o=null!==(a=t.__compDisplayOrder)&&void 0!==a?a:9999;if(i!==o)return i-o;const r=e.time||"00:00",s=t.time||"00:00";return r.localeCompare(s)})}),t})(e.matches):new Map,r=e=>{var t;return null!==(t=e.facr_link||e.report_url||void 0)&&void 0!==t?t:"/zapas/".concat(e.id)},h=i?Date.now():0,m=(e,t)=>new Date("".concat(t.date,"T").concat(t.time||"00:00",":00")).getTime()-new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime();let v=[];if(i)if("all"===e.id){const t={};(e.matches||[]).forEach(e=>{if(!e.score)return;const n=new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime();if(isNaN(n)||n>h)return;const a=e.__compId||"na";t[a]=t[a]||[],t[a].push(e)}),v=Object.values(t).map(e=>e.sort(m)[0]).filter(Boolean).sort(m)}else v=(e.matches||[]).filter(e=>!!e.score&&new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime()<=h).sort(m).slice(0,1);return(0,ae.jsxs)(E.K,{px:0,children:[i&&v.length>0&&(0,ae.jsxs)(l.a,{mb:4,children:[(0,ae.jsx)(F.D,{as:"h3",size:"md",mb:2,children:"Nejnov\u011bj\u0161\xed v\xfdsledky"}),(0,ae.jsx)(x.x,{templateColumns:{base:"1fr",sm:"repeat(2, 1fr)",lg:"repeat(3, 1fr)"},gap:3,children:v.map(t=>{var n;const a=r(t),i=_t(t,e);return(0,ae.jsx)(R.m,{label:(0,ae.jsxs)(l.a,{children:[(0,ae.jsxs)(P.E,{fontSize:"xs",children:["Kategorie: ",i.display||"\u2014"]}),i.alias&&i.alias!==i.display&&(0,ae.jsxs)(P.E,{fontSize:"xs",children:["Alias: ",i.alias]})]}),hasArrow:!0,placement:"top",openDelay:200,children:(0,ae.jsxs)(l.a,{position:"relative","data-href":a||void 0,onMouseDown:ut,onClick:()=>dt(t,e),borderWidth:"1px",borderRadius:"md",p:2,_hover:{textDecoration:"none",bg:"rgba(0,0,0,0.03)",borderColor:"brand.primary",cursor:"pointer"},children:[a&&(0,ae.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:e=>{e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.preventDefault()},onMouseDown:e=>{if(1===e.button){e.preventDefault(),e.stopPropagation();try{var t,n;const e=window.open(a,"_blank","noopener,noreferrer");null===e||void 0===e||null===(t=(n=e).blur)||void 0===t||t.call(n),setTimeout(()=>{try{window.focus()}catch(e){}},0)}catch(i){}}},onAuxClick:e=>{if(1===e.button){e.preventDefault(),e.stopPropagation();try{var t,n;const e=window.open(a,"_blank","noopener,noreferrer");null===e||void 0===e||null===(t=(n=e).blur)||void 0===t||t.call(n),setTimeout(()=>{try{window.focus()}catch(e){}},0)}catch(i){}}},style:{position:"absolute",inset:0,zIndex:1},"aria-hidden":!0}),(0,ae.jsxs)(p.s,{align:"center",justify:"space-between",mb:2,children:[(0,ae.jsxs)(P.E,{fontSize:"sm",color:"gray.700",children:[t.date," ",t.time||""]}),(0,ae.jsx)(s.E,{colorScheme:"purple",children:t.__compName||e.name})]}),(0,ae.jsxs)(p.s,{align:"center",gap:2,justify:"center",children:[(0,ae.jsx)(ee.L,{teamId:t.home_id,teamName:t.home,facrLogo:t.home_logo_url,size:"custom",boxSize:"18px",alt:t.home,borderRadius:"full"}),(0,ae.jsx)(P.E,{fontSize:"sm",children:t.home}),(0,ae.jsx)(s.E,{colorScheme:(null===(n=Ae(t))||void 0===n?void 0:n.color)||"gray",children:t.score||"vs"}),(0,ae.jsx)(ee.L,{teamId:t.away_id,teamName:t.away,facrLogo:t.away_logo_url,size:"custom",boxSize:"18px",alt:t.away,borderRadius:"full"}),(0,ae.jsx)(P.E,{fontSize:"sm",children:t.away})]}),a&&(0,ae.jsx)(j.N,{href:a,isExternal:!0,onClick:e=>e.stopPropagation(),display:"none"})]})},"latest-".concat(e.id,"-").concat(t.id))})})]}),(0,ae.jsx)(p.s,{align:"center",justify:"flex-end",mb:3,children:(0,ae.jsxs)(d.e,{size:"sm",isAttached:!0,children:[(0,ae.jsx)(c.$,{variant:"calendar"===xt?"solid":"outline",bg:"calendar"===xt?"brand.primary":void 0,color:"calendar"===xt?"text.onPrimary":void 0,_hover:{filter:"calendar"===xt?"brightness(0.95)":void 0,borderColor:"brand.primary",color:"calendar"===xt?"text.onPrimary":void 0},onClick:()=>gt("calendar"),children:t("calendar.title")}),(0,ae.jsx)(c.$,{variant:"list"===xt?"solid":"outline",bg:"list"===xt?"brand.primary":void 0,color:"list"===xt?"text.onPrimary":void 0,_hover:{filter:"list"===xt?"brightness(0.95)":void 0,borderColor:"brand.primary",color:"list"===xt?"text.onPrimary":void 0},onClick:()=>gt("list"),children:t("calendar.list_view")})]})}),"calendar"===xt?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsxs)(p.s,{align:"center",justify:"space-between",mb:3,gap:2,flexWrap:{base:"wrap",md:"nowrap"},children:[(0,ae.jsx)(u.K,{"aria-label":t("calendar.previous_month"),size:"sm",onClick:()=>pt((0,W.P)(mt,-1)),icon:(0,ae.jsx)(I.Y,{}),variant:"outline",_hover:{bg:"rgba(0,0,0,0.04)",borderColor:"brand.primary"}}),(0,ae.jsx)(c.$,{size:"sm",onClick:()=>pt(new Date),variant:"solid",bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:t("calendar.today")}),(0,ae.jsx)(u.K,{"aria-label":t("calendar.next_month"),size:"sm",onClick:()=>pt((0,W.P)(mt,1)),icon:(0,ae.jsx)(M.v,{}),variant:"outline",_hover:{bg:"rgba(0,0,0,0.04)",borderColor:"brand.primary"}})]}),(0,ae.jsx)(l.a,{overflowX:"auto",children:(0,ae.jsx)(x.x,{templateColumns:"repeat(7, 1fr)",gap:3,minW:"980px",children:Se.map(e=>(0,ae.jsx)(l.a,{textAlign:"center",fontWeight:"semibold",color:"gray.600",fontSize:{base:"xs",md:"sm"},children:e},e))})}),(0,ae.jsx)(l.a,{overflowX:"auto",children:(0,ae.jsx)(x.x,{templateColumns:"repeat(7, 1fr)",gap:{base:1,md:2},minW:"980px",children:kt.map((n,i)=>{const d=(0,U.GP)(n,"yyyy-MM-dd"),u=o.get(d)||[],h=!(0,O.t)(n,mt),m=(0,U.GP)(n,"yyyy-MM-dd")===ft;return(0,ae.jsxs)(l.a,{borderWidth:"1px",borderRadius:"md",p:2,minH:"120px",minW:"130px",bg:m?"rgba(59,130,246,0.06)":Ee,borderColor:m?"brand.primary":Te,opacity:h?.6:1,children:[(0,ae.jsxs)(p.s,{align:"center",justify:"space-between",mb:2,children:[(0,ae.jsx)(P.E,{fontWeight:"bold",children:(0,U.GP)(n,"d")}),!!u.length&&(0,ae.jsx)(s.E,{bg:"brand.primary",color:"text.onPrimary",borderRadius:"full",children:u.length})]}),(0,ae.jsxs)(S.B,{spacing:2,children:[(vt[d]?u:u.slice(0,3)).map(t=>{var n;const a=r(t),i=new Date("".concat(t.date,"T").concat(t.time||"00:00",":00")).getTime()<Date.now(),o=ct[String(t.id)],c=_t(t,e);return(0,ae.jsx)(R.m,{label:(0,ae.jsxs)(l.a,{children:[(0,ae.jsxs)(P.E,{fontSize:"xs",children:["Kategorie: ",c.display||"\u2014"]}),c.alias&&c.alias!==c.display&&(0,ae.jsxs)(P.E,{fontSize:"xs",children:["Alias: ",c.alias]})]}),hasArrow:!0,placement:"top",openDelay:200,children:(0,ae.jsxs)(l.a,{position:"relative",_hover:{textDecoration:"none"},"data-href":a||void 0,onMouseDown:ut,onClick:()=>dt(t,e),children:[a&&(0,ae.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:e=>{e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.preventDefault()},onMouseDown:e=>{if(1===e.button){e.preventDefault(),e.stopPropagation();try{var t,n;const e=window.open(a,"_blank","noopener,noreferrer");null===e||void 0===e||null===(t=(n=e).blur)||void 0===t||t.call(n),setTimeout(()=>{try{window.focus()}catch(e){}},0)}catch(i){}}},onAuxClick:e=>{if(1===e.button){e.preventDefault(),e.stopPropagation();try{var t,n;const e=window.open(a,"_blank","noopener,noreferrer");null===e||void 0===e||null===(t=(n=e).blur)||void 0===t||t.call(n),setTimeout(()=>{try{window.focus()}catch(e){}},0)}catch(i){}}},style:{position:"absolute",inset:0,zIndex:1},"aria-hidden":!0}),(0,ae.jsx)(l.a,{p:2,borderWidth:"1px",borderRadius:"md",bg:De,_hover:{bg:Ne,borderColor:"brand.primary",cursor:"pointer"},textAlign:"center",children:!i&&o?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsxs)(p.s,{align:"center",justify:"center",gap:2,mb:1,children:[t.home_logo_url&&(0,ae.jsx)(g._,{src:t.home_logo_url,alt:t.home,boxSize:"18px",borderRadius:"full",objectFit:"cover",loading:"lazy",decoding:"async"}),(0,ae.jsxs)(s.E,{colorScheme:"orange",children:["za ",o]}),t.away_logo_url&&(0,ae.jsx)(g._,{src:t.away_logo_url,alt:t.away,boxSize:"18px",borderRadius:"full",objectFit:"cover",loading:"lazy",decoding:"async"})]}),(0,ae.jsx)(P.E,{fontSize:"xs",color:"text.secondary",children:t.time||"\u2014"})]}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsxs)(p.s,{align:"center",justify:"center",gap:2,mb:1,children:[t.home_logo_url&&(0,ae.jsx)(g._,{src:t.home_logo_url,alt:t.home,boxSize:"18px",borderRadius:"full",objectFit:"cover",loading:"lazy",decoding:"async"}),(0,ae.jsx)(s.E,{colorScheme:i&&t.score&&(null===(n=Ae(t))||void 0===n?void 0:n.color)||"gray",children:i&&t.score?t.score:"vs"}),t.away_logo_url&&(0,ae.jsx)(g._,{src:t.away_logo_url,alt:t.away,boxSize:"18px",borderRadius:"full",objectFit:"cover",loading:"lazy",decoding:"async"})]}),(0,ae.jsx)(P.E,{fontSize:"xs",color:"text.secondary",children:t.time||"\u2014"})]})}),a&&(0,ae.jsx)(j.N,{href:a,isExternal:!0,onClick:e=>e.stopPropagation(),display:"none"})]})},t.id)}),u.length>3&&!vt[d]&&(0,ae.jsx)(c.$,{size:"xs",variant:"link",colorScheme:"gray",onClick:()=>jt(e=>(0,a.A)((0,a.A)({},e),{},{[d]:!0})),children:t("calendar.show_more",{count:u.length-3})}),vt[d]&&u.length>3&&(0,ae.jsx)(c.$,{size:"xs",variant:"link",colorScheme:"gray",onClick:()=>jt(e=>(0,a.A)((0,a.A)({},e),{},{[d]:!1})),children:t("calendar.show_less")})]})]},i)})})})]}):(0,ae.jsx)(S.B,{spacing:4,children:(()=>{const n=Array.from(o.keys()),a=ft,i=n.filter(e=>e<a).sort().reverse(),d=n.filter(e=>e>=a).sort(),u=(n,a)=>{const i=o.get(n)||[];return(0,ae.jsxs)(l.a,{borderWidth:"1px",borderRadius:"md",overflow:"hidden",bg:Re,borderColor:Fe,children:[(0,ae.jsx)(l.a,{px:3,py:2,bg:a?Ie:Pe,borderLeftWidth:"4px",borderLeftColor:a?"brand.primary":Me,children:(0,ae.jsxs)(p.s,{align:"center",gap:2,children:[(0,ae.jsx)(P.E,{fontWeight:"semibold",color:a?"brand.primary":Le,children:(0,U.GP)((0,q.qg)(n,"yyyy-MM-dd",new Date),"EEEE d. M. yyyy",{locale:Z.cs})}),a&&(0,ae.jsx)(s.E,{colorScheme:"blue",variant:"subtle",borderRadius:"full",children:t("calendar.today")})]})}),(0,ae.jsx)(S.B,{spacing:3,children:i.map(t=>{var n;const a=r(t),i=new Date("".concat(t.date,"T").concat(t.time||"00:00",":00")).getTime()<Date.now(),o=i?Ae(t):null,c=ct[String(t.id)],d=_t(t,e);return(0,ae.jsx)(R.m,{label:(0,ae.jsxs)(l.a,{children:[(0,ae.jsxs)(P.E,{fontSize:"xs",children:["Kategorie: ",d.display||"\u2014"]}),d.alias&&d.alias!==d.display&&(0,ae.jsxs)(P.E,{fontSize:"xs",children:["Alias: ",d.alias]})]}),hasArrow:!0,placement:"top",openDelay:200,children:(0,ae.jsxs)(l.a,{position:"relative",_hover:{textDecoration:"none"},"data-href":a||void 0,onMouseDown:ut,onClick:()=>dt(t,e),children:[a&&(0,ae.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:e=>{e.preventDefault()},onMouseDown:e=>{if(1===e.button){e.preventDefault(),e.stopPropagation();try{var t,n;const e=window.open(a,"_blank","noopener,noreferrer");null===e||void 0===e||null===(t=(n=e).blur)||void 0===t||t.call(n),setTimeout(()=>{try{window.focus()}catch(e){}},0)}catch(i){}}},onAuxClick:e=>{if(1===e.button){e.preventDefault(),e.stopPropagation();try{var t,n;const e=window.open(a,"_blank","noopener,noreferrer");null===e||void 0===e||null===(t=(n=e).blur)||void 0===t||t.call(n),setTimeout(()=>{try{window.focus()}catch(e){}},0)}catch(i){}}},style:{position:"absolute",inset:0,zIndex:1},"aria-hidden":!0}),(0,ae.jsxs)(p.s,{align:"center",justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",bg:We,borderColor:Ue,_hover:{bg:Oe,borderColor:"brand.primary",cursor:"pointer",transform:"translateY(-2px)",boxShadow:"md"},transition:"all 0.2s",gap:3,children:[(0,ae.jsxs)(p.s,{direction:"column",minW:"100px",children:[(0,ae.jsx)(P.E,{fontWeight:"semibold",color:qe,fontSize:"sm",children:t.date}),(0,ae.jsx)(P.E,{color:qe,fontSize:"sm",children:t.time||"\u2014"}),t.venue&&(0,ae.jsx)(P.E,{color:Ke,fontSize:"xs",mt:1,children:t.venue})]}),(0,ae.jsxs)(p.s,{align:"center",gap:3,flex:"1",children:[(0,ae.jsxs)(p.s,{align:"center",gap:2,flex:"1",justify:"flex-end",children:[(0,ae.jsx)(P.E,{fontSize:"sm",fontWeight:"medium",textAlign:"right",color:qe,children:t.home}),t.home_logo_url&&(0,ae.jsx)(g._,{src:t.home_logo_url,alt:t.home,boxSize:"32px",borderRadius:"full",objectFit:"cover",border:"2px solid",borderColor:"gray.200",loading:"lazy",decoding:"async"})]}),(0,ae.jsxs)(p.s,{direction:"column",align:"center",gap:1,minW:"80px",children:[!i&&c?(0,ae.jsxs)(s.E,{colorScheme:"orange",fontSize:"sm",px:2,children:["za ",c]}):(0,ae.jsx)(s.E,{colorScheme:i&&t.score&&(null===(n=Ae(t))||void 0===n?void 0:n.color)||"gray",fontSize:"md",px:3,py:1,children:i&&t.score?t.score:"vs"}),o&&(0,ae.jsx)(P.E,{fontSize:"xs",color:"".concat(o.color,".600"),fontWeight:"semibold",children:o.label})]}),(0,ae.jsxs)(p.s,{align:"center",gap:2,flex:"1",justify:"flex-start",children:[t.away_logo_url&&(0,ae.jsx)(g._,{src:t.away_logo_url,alt:t.away,boxSize:"32px",borderRadius:"full",objectFit:"cover",border:"2px solid",borderColor:"gray.200",loading:"lazy",decoding:"async"}),(0,ae.jsx)(P.E,{fontSize:"sm",fontWeight:"medium",textAlign:"left",color:qe,children:t.away})]})]})]}),a&&(0,ae.jsx)(j.N,{href:a,isExternal:!0,onClick:e=>e.stopPropagation(),display:"none"})]})},t.id)})})]},n)};return(0,ae.jsxs)(ae.Fragment,{children:[!!i.length&&(0,ae.jsxs)(l.a,{children:[bt?(0,ae.jsx)(c.$,{size:"sm",variant:"link",onClick:()=>yt(!1),children:t("calendar.hide_past_matches")}):(0,ae.jsxs)(c.$,{size:"sm",variant:"link",onClick:()=>yt(!0),children:["Zobrazit p\u0159edchoz\xed z\xe1pasy (",i.reduce((e,t)=>{var n;return e+((null===(n=o.get(t))||void 0===n?void 0:n.length)||0)},0),")"]}),bt&&(0,ae.jsx)(S.B,{spacing:4,mt:2,children:i.map(e=>u(e,!1))})]}),(0,ae.jsx)(S.B,{spacing:4,children:d.map(e=>u(e,e===a))})]})})()})]},e.id)})})]}),(0,ae.jsx)(_.aF,{isOpen:Be,onClose:Ve,size:"lg",isCentered:!0,returnFocusOnClose:!1,children:(0,ae.jsxs)(w.$,{children:[(0,ae.jsx)(k.r,{children:He&&(He.match.__compName||(null===(e=He.comp)||void 0===e?void 0:e.name))||"Detail z\xe1pasu"}),(0,ae.jsx)(y.s,{}),(0,ae.jsx)(b.c,{children:He&&(0,ae.jsxs)(S.B,{spacing:4,children:[(e=>{const t=Ae(He.match);if(t)return(0,ae.jsx)(p.s,{justify:"center",children:(0,ae.jsx)(s.E,{colorScheme:t.color,variant:"subtle",children:t.label})});const n=(null===(e=He.comp)||void 0===e?void 0:e.name)||He.match.__compName;return n&&"V\u0161echny sout\u011b\u017ee"!==n?(0,ae.jsx)(p.s,{justify:"center",children:(0,ae.jsx)(s.E,{colorScheme:"purple",children:n})}):null})(),(0,ae.jsxs)(p.s,{align:"center",justify:"center",gap:3,children:[He.match.home_logo_url&&(0,ae.jsx)(g._,{src:He.match.home_logo_url,alt:He.match.home,boxSize:"40px",borderRadius:"full",cursor:"pointer",onClick:()=>rt(He.match.home,He.match.home_logo_url),_hover:{opacity:.8,transform:"scale(1.1)"},transition:"all 0.2s",title:"Klikn\u011bte pro zobrazen\xed statistik: ".concat(He.match.home)}),(e=>{const t=new Date("".concat(He.match.date,"T").concat(He.match.time||"00:00",":00")),n=Date.now()>=t.getTime(),a=Boolean(He.match.score);return n?(0,ae.jsx)(s.E,{colorScheme:a&&(null===(e=Ae(He.match))||void 0===e?void 0:e.color)||"gray",fontSize:"md",px:3,py:1,children:a?He.match.score:"vs"}):st.countdownString?(0,ae.jsxs)(s.E,{colorScheme:"orange",fontSize:"md",px:3,py:1,children:["za ",st.countdownString]}):(0,ae.jsx)(s.E,{colorScheme:"gray",fontSize:"md",px:3,py:1,children:"vs"})})(),He.match.away_logo_url&&(0,ae.jsx)(g._,{src:He.match.away_logo_url,alt:He.match.away,boxSize:"40px",borderRadius:"full",cursor:"pointer",onClick:()=>rt(He.match.away,He.match.away_logo_url),_hover:{opacity:.8,transform:"scale(1.1)"},transition:"all 0.2s",title:"Klikn\u011bte pro zobrazen\xed statistik: ".concat(He.match.away)})]}),(0,ae.jsxs)(l.a,{textAlign:"center",children:[(0,ae.jsx)(P.E,{fontSize:"lg",fontWeight:"semibold",color:"gray.800",mb:1,children:(()=>{try{return(0,U.GP)((0,q.qg)(He.match.date,"yyyy-MM-dd",new Date),"EEEE d. MMMM yyyy",{locale:Z.cs})}catch(e){return He.match.date}})()}),(0,ae.jsx)(P.E,{fontSize:"md",color:"gray.700",children:He.match.time||"\u2014"})]}),(()=>{const e=new Date("".concat(He.match.date,"T").concat(He.match.time||"00:00",":00")),t=Date.now()>=e.getTime();if(!Boolean(He.match.score)&&!t&&st.isActive&&st.timeRemaining>0){const e=Math.floor(st.timeRemaining/864e5),t=Math.floor(st.timeRemaining%864e5/36e5),n=Math.floor(st.timeRemaining%36e5/6e4),a=Math.floor(st.timeRemaining%6e4/1e3);return(0,ae.jsxs)(l.a,{mt:4,p:4,bg:"orange.50",borderRadius:"lg",borderWidth:"2px",borderColor:"orange.200",children:[(0,ae.jsx)(P.E,{fontSize:"sm",fontWeight:"semibold",color:"orange.800",mb:3,textAlign:"center",children:"Z\xe1pas za\u010d\xedn\xe1 za"}),(0,ae.jsxs)(x.x,{templateColumns:e>0?"repeat(4, 1fr)":"repeat(3, 1fr)",gap:3,children:[e>0&&(0,ae.jsxs)(l.a,{textAlign:"center",children:[(0,ae.jsx)(l.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,ae.jsx)(P.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:e})}),(0,ae.jsx)(P.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===e?"den":e<5?"dny":"dn\xed"})]}),(0,ae.jsxs)(l.a,{textAlign:"center",children:[(0,ae.jsx)(l.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,ae.jsx)(P.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:String(t).padStart(2,"0")})}),(0,ae.jsx)(P.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===t?"hodina":t<5?"hodiny":"hodin"})]}),(0,ae.jsxs)(l.a,{textAlign:"center",children:[(0,ae.jsx)(l.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,ae.jsx)(P.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:String(n).padStart(2,"0")})}),(0,ae.jsx)(P.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===n?"minuta":n<5?"minuty":"minut"})]}),(0,ae.jsxs)(l.a,{textAlign:"center",children:[(0,ae.jsx)(l.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,ae.jsx)(P.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:String(a).padStart(2,"0")})}),(0,ae.jsx)(P.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===a?"sekunda":a<5?"sekundy":"sekund"})]})]})]})}return null})(),(0,ae.jsx)(l.a,{h:"1px",bg:"gray.200"}),(()=>{const e=new Date("".concat(He.match.date,"T").concat(He.match.time||"00:00",":00")),t=Date.now()>=e.getTime();return je&&He.match.home&&(e=>{try{const t=ot(e),n=ot(je||"");if(!t||!n)return!1;const a=t.replace(/\bfk\b/g,"").replace(/\bfotbalov\xfd\s+klub\b/g,"").trim(),i=n.replace(/\bfk\b/g,"").replace(/\bfotbalov\xfd\s+klub\b/g,"").trim();return t===n||t.endsWith(n)||n.endsWith(t)||a===i||a.endsWith(i)||i.endsWith(a)}catch(t){return!1}})(He.match.home)&&!t?(0,ae.jsx)(l.a,{children:(0,ae.jsx)(ne.I,{matchDateTime:"".concat(He.match.date,"T").concat(He.match.time||"15:00",":00"),venue:void 0,isHomeMatch:!0,matchHasStarted:!1,delayLoad:!1})}):null})(),(0,ae.jsx)(l.a,{h:"1px",bg:"gray.200"}),(0,ae.jsx)(F.D,{as:"h3",size:"sm",children:"Odb\u011br notifikac\xed pro fanou\u0161ky"}),(0,ae.jsx)(P.E,{fontSize:"sm",color:"gray.600",children:"Zadejte sv\u016fj email a budeme v\xe1s informovat o novink\xe1ch a z\xe1pasech."}),(0,ae.jsxs)(p.s,{gap:2,align:"center",children:[(0,ae.jsx)(v.p,{type:"email",placeholder:"v\xe1\u0161@email.cz",value:Je,onChange:e=>Ge(e.target.value)}),(0,ae.jsx)(c.$,{colorScheme:"red",onClick:async()=>{if(Je){Ye(!0);try{const e=await fetch(at("/api/v1/newsletter/subscribe"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:Je})});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error((null===t||void 0===t?void 0:t.error)||"HTTP ".concat(e.status))}ve({title:"P\u0159ihl\xe1\u0161eno k odb\u011bru",status:"success"}),Ge("")}catch(e){ve({title:"Chyba p\u0159ihl\xe1\u0161en\xed",description:(null===e||void 0===e?void 0:e.message)||String(e),status:"error"})}finally{Ye(!1)}}else ve({title:"Zadejte email",status:"warning"})},isLoading:Xe,children:"Odeb\xedrat"})]})]})}),(0,ae.jsxs)(f.j,{children:[He&&(He.match.facr_link||He.match.report_url)&&(0,ae.jsx)(c.$,{colorScheme:"blue",mr:3,onClick:e=>{e.preventDefault();const t=He.match.facr_link||He.match.report_url;if(t){const e=document.createElement("a");e.href=t,e.target="_blank",e.rel="noopener noreferrer",e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}},children:"Detail na FA\u010cR"}),(0,ae.jsx)(c.$,{onClick:Ve,children:"Zav\u0159\xedt"})]})]})})]}),(0,ae.jsx)(J.A,{}),(0,ae.jsx)(X.A,{isOpen:Qe,onClose:()=>et(!1),club:tt,clubType:ke})]})}},39183:(e,t,n)=>{n.d(t,{L:()=>i,M:()=>o});var a=n(65043);const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;const[n,i]=(0,a.useState)(0),[o,r]=(0,a.useState)(!1),s=(0,a.useMemo)(()=>{if(!e)return null;const t="string"===typeof e?new Date(e):e;return isNaN(t.getTime())?null:t.getTime()},[e]);(0,a.useEffect)(()=>{if(!s)return i(0),void r(!1);const e=()=>{const e=Date.now(),t=s-e;if(t<=0)return i(0),void r(!1);i(t),r(!0)};e();const n=setInterval(()=>{e()},t);return()=>clearInterval(n)},[s,t]);return{countdownString:(0,a.useMemo)(()=>{if(n<=0)return"";const e=Math.floor(n/864e5),t=Math.floor(n%864e5/36e5),a=Math.floor(n%36e5/6e4),i=Math.floor(n%6e4/1e3);return e>0?"".concat(e,"d ").concat(t,"h"):t>0?"".concat(t,"h ").concat(a,"m"):a>0?"".concat(a,"m ").concat(i,"s"):"".concat(i,"s")},[n]),timeRemaining:n,isActive:o,targetTime:s}},o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e4;const[n,i]=(0,a.useState)({});return(0,a.useEffect)(()=>{if(!e.length)return void i({});const n=()=>{const t=Date.now(),n={};e.forEach(e=>{const a=new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime();if(isNaN(a)||a<=t)return;const i=a-t,o=Math.floor(i/864e5),r=Math.floor(i%864e5/36e5),s=Math.floor(i%36e5/6e4);n[String(e.id)]=o>0?"".concat(o,"d ").concat(r,"h"):r>0?"".concat(r,"h ").concat(s,"m"):"".concat(s,"m")}),i(n)};n();const a=setInterval(n,t);return()=>clearInterval(a)},[e,t]),n}},40378:(e,t,n)=>{n.d(t,{A:()=>ze});var a=n(89379),i=n(22107),o=n(98939),r=n(42703),s=n(65043),l=n(1009),c=n(63935),d=n(11054),u=n(19542),h=n(35929),m=n(15071),p=n(67516),x=n(10202),g=n(98662),v=n(82459),j=n(39081),b=n(96870),y=n(30502),f=n(44093),k=n(5371),_=n(96148),w=n(99956),z=n(59883),S=n(86236),A=n(27024),C=n(91872),E=n(53560),T=n(88019),D=n(78460),N=n(85421),R=n(45973),F=n(29244),P=n(35699),I=n(92342),M=n(99973),L=n(5874),W=n(85369),U=n(35475),O=n(73216),q=n(29066),K=n(57550),B=n(78801),Z=n(33572),V=n(74117),H=n(25011),$=n(46291),J=n(70579);const G=()=>{const{i18n:e}=(0,V.Bd)(),[t,n]=(0,s.useState)([]),[a,i]=(0,s.useState)("cs"),[o,r]=(0,s.useState)(!0);(0,s.useEffect)(()=>{(async()=>{try{const t=(await $.FH.get("/i18n/languages")).data.languages.filter(e=>e.is_active);t.length>0?n(t):n([{id:"cs",name:"Czech",native_name:"\u010ce\u0161tina",code:"cs",is_default:!0,is_active:!0,sort_order:1},{id:"en",name:"English",native_name:"English",code:"en",is_default:!1,is_active:!0,sort_order:2}]);const a=e.language||"cs";i(a)}catch(t){n([{id:"cs",name:"Czech",native_name:"\u010ce\u0161tina",code:"cs",is_default:!0,is_active:!0,sort_order:1},{id:"en",name:"English",native_name:"English",code:"en",is_default:!1,is_active:!0,sort_order:2}]);const a=e.language||"cs";i(a)}finally{r(!1)}})()},[e.language]);return o||t.length<2?null:(0,J.jsxs)(z.W,{children:[(0,J.jsx)(S.I,{as:g.$,variant:"ghost",size:"sm",minWidth:"auto",px:2,py:1,borderRadius:"md",_hover:{bg:"gray.100"},_active:{bg:"gray.200"},fontSize:"sm",fontWeight:"medium",children:(0,J.jsxs)(_.z,{spacing:1,children:[(0,J.jsx)(H.I,{as:W.f35,fontSize:"sm"}),(0,J.jsx)(j.E,{fontSize:"sm",fontWeight:"medium",textTransform:"uppercase",children:"cs"===a?"CZ":"EN"}),(0,J.jsx)(H.I,{as:W.Vr3,fontSize:"xs"})]})}),(0,J.jsx)(C.c,{minWidth:"100px",p:1,boxShadow:"lg",border:"1px",borderColor:"gray.200",children:t.sort((e,t)=>e.sort_order-t.sort_order).map(t=>(0,J.jsx)(E.D,{onClick:()=>(async t=>{try{if(await e.changeLanguage(t),localStorage.getItem("token"))try{await $.FH.post("/i18n/user-language",{language_code:t})}catch(n){console.warn("Failed to save language preference to backend:",n)}document.cookie="lang=".concat(t,"; max-age=").concat(31536e3,"; path=/"),i(t),window.location.reload()}catch(n){console.error("Failed to change language:",n)}})(t.code),isDisabled:t.code===a,fontSize:"sm",borderRadius:"md",px:2,py:1,_hover:{bg:"gray.100"},_selected:{bg:"blue.50",color:"blue.600"},children:(0,J.jsxs)(_.z,{spacing:1,width:"100%",justifyContent:"space-between",children:[(0,J.jsx)(j.E,{fontSize:"sm",fontWeight:"medium",textTransform:"uppercase",children:"cs"===t.code?"CZ":"EN"}),t.code===a&&(0,J.jsx)(j.E,{fontSize:"sm",color:"blue.500",fontWeight:"bold",children:"\u2713"})]})},t.code))})]})};var X=n(16834),Y=n(25189),Q=n(87904),ee=n(76659),te=n(87139),ne=n(56529),ae=n(72526),ie=n(82054),oe=n(29868);const re=e=>{var t,n,a,i;let{isOpen:o,onClose:r,onOpenRewards:s}=e;const l=(0,f.dU)("gray.50","gray.800"),c=(0,ae.I)({queryKey:["engagement","achievements"],queryFn:Q.$_,enabled:o,staleTime:1e4}),u=(null===(t=c.data)||void 0===t?void 0:t.achievements)||[],v=(null===(n=c.data)||void 0===n?void 0:n.counters)||{};return(0,J.jsxs)(D.aF,{isOpen:o,onClose:r,size:"lg",children:[(0,J.jsx)(d.m,{}),(0,J.jsxs)(N.$,{children:[(0,J.jsx)(m.r,{children:"\xdasp\u011bchy"}),(0,J.jsx)(h.s,{}),(0,J.jsx)(p.c,{children:c.isLoading?(0,J.jsxs)(_.z,{children:[(0,J.jsx)(ee.y,{size:"sm"}),(0,J.jsx)(j.E,{children:"Na\u010d\xedt\xe1m\u2026"})]}):(0,J.jsxs)(x.T,{align:"stretch",spacing:3,children:[(0,J.jsxs)(_.z,{spacing:3,bg:l,p:3,borderRadius:"md",children:[(0,J.jsxs)(te.E,{colorScheme:"blue",children:["Koment\xe1\u0159e: ",null!==(a=null===v||void 0===v?void 0:v.comments)&&void 0!==a?a:0]}),(0,J.jsxs)(te.E,{colorScheme:"green",children:["Hlasov\xe1n\xed: ",null!==(i=null===v||void 0===v?void 0:v.votes)&&void 0!==i?i:0]}),(0,J.jsxs)(te.E,{colorScheme:null!==v&&void 0!==v&&v.newsletter?"purple":"gray",children:["Newsletter: ",null!==v&&void 0!==v&&v.newsletter?"ANO":"NE"]})]}),u.map(e=>(0,J.jsxs)(_.z,{spacing:3,p:2,borderWidth:"1px",borderRadius:"md",children:[(0,J.jsx)(H.I,{as:e.achieved?ie.A:oe.A,color:e.achieved?"green.400":"gray.400"}),(0,J.jsxs)(x.T,{align:"start",spacing:0,flex:1,children:[(0,J.jsx)(j.E,{fontWeight:"600",children:e.title}),(0,J.jsx)(j.E,{fontSize:"sm",color:"gray.500",children:e.description})]}),(0,J.jsxs)(te.E,{children:[e.points," bod\u016f"]})]},e.id))]})}),(0,J.jsxs)(ne.j,{children:[s&&(0,J.jsx)(g.$,{mr:3,onClick:()=>{r(),s()},colorScheme:"blue",children:"Odm\u011bny"}),(0,J.jsx)(g.$,{variant:"ghost",onClick:r,children:"Zav\u0159\xedt"})]})]})]})};var se=n(59781),le=n(12836);const ce=e=>{let{isOpen:t,onClose:n,availablePoints:a=0,onRedeemed:i}=e;const o=(0,f.dU)("gray.50","gray.800"),r=(0,y.d)(),s=(0,se.jE)(),l=(0,ae.I)({queryKey:["engagement","rewards"],queryFn:Q.gB,enabled:t,staleTime:1e4}),c=(0,le.n)({mutationFn:e=>(0,Q.Ao)(e),onSuccess:async e=>{r({title:"approved"===e.status?"Odm\u011bna aktivov\xe1na":"\u017d\xe1dost o odm\u011bnu odesl\xe1na",status:"success",duration:3e3}),await s.invalidateQueries({queryKey:["engagement","profile"]}),i&&i()},onError:e=>{var t,n;const a=(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se uplatnit odm\u011bnu";r({title:"Chyba",description:a,status:"error",duration:3500})}}),u=l.data||[];return(0,J.jsxs)(D.aF,{isOpen:t,onClose:n,size:"lg",children:[(0,J.jsx)(d.m,{}),(0,J.jsxs)(N.$,{children:[(0,J.jsx)(m.r,{children:"Odm\u011bny"}),(0,J.jsx)(h.s,{}),(0,J.jsx)(p.c,{children:l.isLoading?(0,J.jsxs)(_.z,{children:[(0,J.jsx)(ee.y,{size:"sm"}),(0,J.jsx)(j.E,{children:"Na\u010d\xedt\xe1m\u2026"})]}):(0,J.jsxs)(x.T,{align:"stretch",spacing:3,children:[(0,J.jsx)(_.z,{spacing:3,bg:o,p:3,borderRadius:"md",children:(0,J.jsxs)(te.E,{colorScheme:"blue",children:["Dostupn\xe9 body: ",a]})}),u.map(e=>(0,J.jsxs)(_.z,{spacing:3,p:2,borderWidth:"1px",borderRadius:"md",align:"center",children:[e.image_url&&(0,J.jsx)(Z._,{src:e.image_url,alt:e.name,boxSize:"48px",objectFit:"cover",borderRadius:"md"}),(0,J.jsxs)(x.T,{align:"start",spacing:0,flex:1,children:[(0,J.jsx)(j.E,{fontWeight:"600",children:e.name}),(0,J.jsx)(J.Fragment,{})]}),(0,J.jsxs)(te.E,{children:[e.cost_points," bod\u016f"]}),(0,J.jsx)(g.$,{size:"sm",colorScheme:"blue",onClick:()=>c.mutate(e.id),isLoading:c.isPending,isDisabled:a<(e.cost_points||0),children:"Uplatnit"})]},e.id)),0===u.length&&(0,J.jsx)(j.E,{color:"gray.500",children:"Zat\xedm nejsou k dispozici \u017e\xe1dn\xe9 odm\u011bny."})]})}),(0,J.jsx)(ne.j,{children:(0,J.jsx)(g.$,{variant:"ghost",onClick:n,children:"Zav\u0159\xedt"})})]})]})};var de=n(87024),ue=n(66286),he=n(1029),me=n(38376),pe=n(34636),xe=n(24346),ge=n(32386);const ve=(e,t)=>{let n=String(t||"").trim();if(!n)return null;if(n=n.replace(/\s+/g,""),n.startsWith("@")){const t=n.slice(1);if("facebook"===e)return"https://www.facebook.com/".concat(t);if("instagram"===e)return"https://www.instagram.com/".concat(t);if("youtube"===e)return"https://www.youtube.com/@".concat(t)}if(!/^https?:\/\//i.test(n)&&!n.includes("/")&&!n.includes(".")){if("facebook"===e)return"https://www.facebook.com/".concat(n);if("instagram"===e)return"https://www.instagram.com/".concat(n);if("youtube"===e)return"https://www.youtube.com/@".concat(n)}if(!/^https?:\/\//i.test(n)){if(/^facebook\.com\//i.test(n))return"https://www.".concat(n);if(/^instagram\.com\//i.test(n))return"https://www.".concat(n);if(/^youtube\.com\//i.test(n))return"https://www.".concat(n)}return n},je=e=>{var t;let{isOpen:n,onClose:i,isAdmin:o,isAuthenticated:r,menuBg:l,dividerColor:b,settings:y,categories:f,galleryHref:k,galleryLabel:_,hasTables:w,hasActivities:z,hasPlayers:S,hasArticles:A,hasVideos:C,hasGallery:E,dynamicNavItems:T,navLoading:D,t:N,i18n:R,handleSimpleLanguageChange:F}=e;return(0,J.jsxs)(c._s,{isOpen:n,placement:"left",onClose:i,children:[(0,J.jsx)(d.m,{}),(0,J.jsxs)(u.z,{bg:l,children:[(0,J.jsx)(h.s,{}),(0,J.jsx)(m.r,{borderBottomWidth:"1px",borderColor:"border.subtle",children:N("action.open_menu")}),(0,J.jsx)(p.c,{children:(0,J.jsxs)(x.T,{align:"stretch",spacing:2,children:[!D&&T&&T.length>0?T.map((e,t)=>{const n="external"===e.type,o="dropdown"===e.type&&e.children&&e.children.length>0,r=n?{href:e.url}:{to:e.url||"/"},l=n?"a":U.N_,c="\u010cl\xe1nky"===e.label||"Blog"===e.label||(e.url||"").startsWith("/blog"),d=Array.isArray(f)&&f.length>0;return c&&d?(0,J.jsxs)(s.Fragment,{children:[(0,J.jsx)(g.$,{as:U.N_,to:"/blog",onClick:i,variant:"ghost",justifyContent:"flex-start",fontWeight:"bold",children:e.label}),(0,J.jsx)(x.T,{align:"stretch",pl:4,spacing:1,children:f.map((e,t)=>{const n="string"===typeof e.url&&/^https?:\/\//i.test(e.url),o=e.url||(e.id?"/blog?category_id=".concat(e.id):e.slug?"/blog?category=".concat(encodeURIComponent(e.slug)):"/blog"),r=n?{href:o}:{to:o},s=n?"a":U.N_;return(0,J.jsx)(g.$,(0,a.A)((0,a.A)({as:s},r),{},{onClick:i,variant:"ghost",justifyContent:"flex-start",fontWeight:"normal",size:"sm",children:e.name}),e.slug||e.id||e.name)})})]},e.id||t):(0,J.jsxs)(s.Fragment,{children:[(0,J.jsx)(g.$,(0,a.A)((0,a.A)({as:l},r),{},{target:n?"_blank":void 0,rel:n?"noreferrer":void 0,variant:"ghost",justifyContent:"flex-start",fontWeight:o?"bold":"normal",children:e.label})),o&&(0,J.jsx)(x.T,{align:"stretch",pl:4,spacing:1,children:e.children.map(e=>{const t="external"===e.type,n=t?{href:e.url}:{to:e.url||"/"},i=t?"a":U.N_;return(0,J.jsx)(g.$,(0,a.A)((0,a.A)({as:i},n),{},{variant:"ghost",justifyContent:"flex-start",fontWeight:"normal",size:"sm",children:e.label}),e.id)})})]},e.id||t)}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(g.$,{as:U.N_,to:"/",variant:"ghost",justifyContent:"flex-start",children:N("nav.home")}),(null===(t=null===y||void 0===y?void 0:y.show_about_in_nav)||void 0===t||t)&&(0,J.jsx)(g.$,{as:U.N_,to:"/o-klubu",variant:"ghost",justifyContent:"flex-start",children:N("nav.club")}),(0,J.jsx)(g.$,{as:U.N_,to:"/kalendar",variant:"ghost",justifyContent:"flex-start",children:N("nav.calendar")}),(0,J.jsx)(g.$,{as:U.N_,to:"/zapasy",variant:"ghost",justifyContent:"flex-start",children:N("nav.matches")}),z&&(0,J.jsx)(g.$,{as:U.N_,to:"/aktivity",variant:"ghost",justifyContent:"flex-start",children:N("nav.activities")}),S&&(0,J.jsx)(g.$,{as:U.N_,to:"/hraci",variant:"ghost",justifyContent:"flex-start",children:N("nav.players")}),w&&(0,J.jsx)(g.$,{as:U.N_,to:"/tabulky",variant:"ghost",justifyContent:"flex-start",children:N("nav.tables")}),Array.isArray(null===y||void 0===y?void 0:y.custom_nav)&&y.custom_nav.length>0&&y.custom_nav.map((e,t)=>{const n="string"===typeof(null===e||void 0===e?void 0:e.url)&&/^https?:\/\//i.test(e.url),i=n?{href:e.url}:{to:e.url||"/"},o=n?"a":U.N_;return(0,J.jsx)(g.$,(0,a.A)((0,a.A)({as:o},i),{},{target:n?"_blank":void 0,rel:n?"noreferrer":void 0,variant:"ghost",justifyContent:"flex-start",children:(null===e||void 0===e?void 0:e.label)||N("common.page")}),"custom-nav-".concat(t,"-").concat((null===e||void 0===e?void 0:e.label)||"link"))}),A&&(0,J.jsx)(J.Fragment,{children:Array.isArray(f)&&f.length>0?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(g.$,{as:U.N_,to:"/blog",onClick:i,variant:"ghost",justifyContent:"flex-start",fontWeight:"bold",children:N("nav.articles")}),(0,J.jsx)(x.T,{align:"stretch",pl:4,spacing:1,children:f.map((e,t)=>{const n="string"===typeof e.url&&/^https?:\/\//i.test(e.url),o=e.url||(e.id?"/blog?category_id=".concat(e.id):e.slug?"/blog?category=".concat(encodeURIComponent(e.slug)):"/blog"),r=n?{href:o}:{to:o};return(0,J.jsx)(g.$,(0,a.A)((0,a.A)({as:n?"a":U.N_},r),{},{onClick:i,variant:"ghost",justifyContent:"flex-start",fontWeight:"normal",size:"sm",children:e.name}),e.slug||e.id||e.name)})})]}):(0,J.jsx)(g.$,{as:U.N_,to:"/blog",onClick:i,variant:"ghost",justifyContent:"flex-start",fontWeight:"bold",children:N("nav.articles")})}),C&&(0,J.jsx)(g.$,{as:U.N_,to:"/videa",variant:"ghost",justifyContent:"flex-start",children:N("nav.videos")}),(0,J.jsx)(g.$,{as:U.N_,to:"/hledat",variant:"ghost",justifyContent:"flex-start",children:N("action.search")}),E&&(0,J.jsx)(g.$,{as:U.N_,to:"/galerie",variant:"ghost",justifyContent:"flex-start",children:_||N("homepage.gallery")}),(null===y||void 0===y?void 0:y.shop_url)&&(0,J.jsx)(g.$,{as:"a",href:y.shop_url,target:"_blank",rel:"noreferrer",variant:"ghost",justifyContent:"flex-start",children:N("nav.shop")}),(0,J.jsx)(g.$,{as:U.N_,to:"/sponzori",variant:"ghost",justifyContent:"flex-start",children:N("nav.sponsors")}),(0,J.jsx)(g.$,{as:U.N_,to:"/kontakt",variant:"ghost",justifyContent:"flex-start",children:N("nav.contact")})]}),o&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(v.c,{my:2,borderColor:b}),(0,J.jsx)(j.E,{fontWeight:"bold",mt:2,color:b,children:N("nav.admin")}),(0,J.jsx)(g.$,{as:U.N_,to:"/admin",variant:"ghost",justifyContent:"flex-start",colorScheme:"blue",children:N("nav.admin")})]}),!r&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(v.c,{my:2,borderColor:b}),(0,J.jsx)(g.$,{as:U.N_,to:"/login",colorScheme:"blue",justifyContent:"flex-start",children:N("action.login")}),(0,J.jsx)(g.$,{as:U.N_,to:"/register",variant:"outline",justifyContent:"flex-start",children:N("common.register")})]}),(0,J.jsx)(G,{})]})})]})]})},be=e=>{let{label:t,items:n,to:a,isActive:i}=e;const o=(0,f.dU)("brand.primary","brand.accent"),r=(0,f.dU)("gray.700","gray.200"),l=(0,f.dU)("blackAlpha.50","whiteAlpha.100"),c=(0,f.dU)("blackAlpha.100","whiteAlpha.200"),d=(0,O.Zp)(),[u,h]=s.useState(!1),m=(0,s.useRef)(null),p=(0,s.useRef)(null),x=()=>{p.current&&(window.clearTimeout(p.current),p.current=null),u||(m.current=window.setTimeout(()=>h(!0),60))},v=()=>{m.current&&(window.clearTimeout(m.current),m.current=null),p.current=window.setTimeout(()=>h(!1),120)};(0,s.useEffect)(()=>()=>(m.current&&(window.clearTimeout(m.current),m.current=null),void(p.current&&(window.clearTimeout(p.current),p.current=null))),[]);const j="string"===typeof a&&a.trim().length>0,b=j&&/^https?:\/\//i.test(a);return(0,J.jsxs)(z.W,{isOpen:u,placement:"bottom-start",gutter:0,closeOnBlur:!1,isLazy:!0,children:[(0,J.jsx)(S.I,{as:g.$,rightIcon:(0,J.jsx)(L.D,{}),variant:"ghost",size:"sm",px:3,fontWeight:i?"700":"600",color:i?o:r,bg:i?l:"transparent",_hover:{bg:c,transform:"translateY(-1px)"},transition:"all 0.2s",onMouseEnter:x,onMouseLeave:v,onClick:e=>{j&&(b?window.open(a,"_blank","noopener,noreferrer"):d(a))},children:t}),(0,J.jsx)(C.c,{onMouseEnter:x,onMouseLeave:v,children:n.map(e=>/^https?:\/\//i.test(e.to)?(0,J.jsx)(E.D,{as:"a",href:e.to,target:"_blank",rel:"noreferrer",children:e.label},e.to):(0,J.jsx)(E.D,{as:U.N_,to:e.to,children:e.label},e.to))})]})},ye=e=>{var t,n,l;let{fullWidth:c=!1,variant:u="unified"}=e;const{t:v,i18n:L}=(0,V.Bd)(),{isAuthenticated:H,logout:ee,user:te}=(0,q.A)(),{isOpen:ne,onOpen:ae,onClose:ie}=(0,b.j)(),{isOpen:oe,onOpen:se,onClose:le}=(0,b.j)(),ye="admin"===(null===te||void 0===te?void 0:te.role),fe=ye?"/admin/nastaveni":"/semiadmin",{data:ke}=(0,K.s)(),_e=(0,B.N)(),we=(0,O.zy)(),ze=(0,O.Zp)(),Se=(0,y.d)(),Ae=(0,f.dU)("white","#0f1115"),Ce=(0,f.dU)("gray.600","gray.300"),Ee=(0,f.dU)("blackAlpha.100","whiteAlpha.200"),Te=(0,f.dU)("blackAlpha.50","whiteAlpha.100"),De=(0,f.dU)("brand.primary","brand.accent"),Ne=(0,f.dU)("gray.700","gray.200"),Re=(0,f.dU)("gray.50","blackAlpha.500"),[Fe,Pe]=(0,s.useState)(!1),Ie=c?"full":"7xl",[Me,Le]=(0,s.useState)("undefined"!==typeof window?window.innerWidth:1920),[We,Ue]=(0,s.useState)(null),{isOpen:Oe,onOpen:qe,onClose:Ke}=(0,b.j)(),{isOpen:Be,onOpen:Ze,onClose:Ve}=(0,b.j)(),He=((e,t)=>{const[n,a]=(0,s.useState)(null),[i,o]=(0,s.useState)([]),[r,l]=(0,s.useState)(!0),[c,d]=(0,s.useState)(!1),[u,h]=(0,s.useState)(!1),[m,p]=(0,s.useState)(!1),[x,g]=(0,s.useState)(!1),[v,j]=(0,s.useState)(!1),[b,y]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let n=!0;return(async()=>{try{const[r,s]=await Promise.all([(0,he.hZ)().catch(()=>[]),(0,ue.bW)().catch(()=>[])]);if(n){const n=Array.isArray(r)?r.filter(e=>!e.requires_admin):[];if(0===n.length&&e)try{console.log("Navigation empty, auto-seeding...")}catch(i){console.error("Auto-seed failed:",i)}o(n),Array.isArray(s)&&s.length>0?a(s):Array.isArray(null===t||void 0===t?void 0:t.categories)?a(t.categories):a(null)}}catch(r){console.error("Failed to load navigation/categories:",r),n&&(o([]),a(Array.isArray(null===t||void 0===t?void 0:t.categories)?t.categories:null))}finally{n&&l(!1)}})(),()=>{n=!1}},[e,null===t||void 0===t?void 0:t.categories]),(0,s.useEffect)(()=>{let e=!1;const t=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL($.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}};return(async()=>{try{const[n,a,i,o,r,s]=await Promise.allSettled([fetch(t("/cache/prefetch/facr_tables.json"),{cache:"no-cache"}),(0,me.kQ)().catch(()=>[]),(0,ue.Dq)().catch(()=>[]),(0,pe.GE)({page:1,page_size:1,published:!0}).catch(()=>({total:0})),(0,xe.S)().catch(()=>null),(0,ge.Gz)().catch(()=>[])]);if(!e){if("fulfilled"===n.status){const e=n.value;if(e.ok){const t=await e.json(),n=Array.isArray(null===t||void 0===t?void 0:t.competitions)&&t.competitions.some(e=>{var t;return Array.isArray(null===e||void 0===e||null===(t=e.table)||void 0===t?void 0:t.overall)&&e.table.overall.length>0});d(!!n)}else d(!1)}else d(!1);h("fulfilled"===a.status&&Array.isArray(a.value)&&a.value.length>0),p("fulfilled"===i.status&&Array.isArray(i.value)&&i.value.length>0),g("fulfilled"===o.status&&"object"===typeof o.value&&null!==o.value&&"total"in o.value&&o.value.total>0),j("fulfilled"===r.status&&null!==r.value&&"object"===typeof r.value&&"videos"in r.value&&Array.isArray(r.value.videos)&&r.value.videos.length>0),y("fulfilled"===s.status&&Array.isArray(s.value)&&s.value.length>0)}}catch(n){console.error("Failed to load content data:",n),e||(d(!1),h(!1),p(!1),g(!1),j(!1),y(!1))}})(),()=>{e=!0}},[]),{categories:n,dynamicNavItems:i,navLoading:r,hasTables:c,hasActivities:u,hasPlayers:m,hasArticles:x,hasVideos:v,hasGallery:b}})(ye,ke);(0,s.useEffect)(()=>{const e=()=>Le(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,s.useEffect)(()=>{let e=!0;return(async()=>{try{if(!H)return void Ue(null);const t=await(0,Q.E$)();e&&Ue(t)}catch(t){e&&Ue(null)}})(),()=>{e=!1}},[H]),(0,s.useEffect)(()=>{if(!H)return;let e=!1;const t=async()=>{try{const t=await(0,Q.E$)();e||Ue(t)}catch(t){}};return window.addEventListener("engagement:refresh",t),()=>{e=!0,window.removeEventListener("engagement:refresh",t)}},[H]);const[$e,Je]=(0,s.useState)("");(0,s.useEffect)(()=>{const e=()=>Pe(window.scrollY>8);return e(),window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)},[]);(0,s.useEffect)(()=>{const e=(null===ke||void 0===ke?void 0:ke.club_name)||_e.name;e&&"undefined"!==typeof document&&(document.title=e)},[null===ke||void 0===ke?void 0:ke.club_name,_e.name]),(0,s.useEffect)(()=>{try{const e=(null===ke||void 0===ke?void 0:ke.club_logo_url)||_e.logoUrl||"/dist/img/logo-club-empty.svg";if(!e)return;const t=(0,Y.uq)(e)||e,n=e=>{let n=document.querySelector('link[rel="'.concat(e,'"]'));n||(n=document.createElement("link"),n.rel=e,document.head.appendChild(n)),n.href=t,t.endsWith(".svg")&&(n.type="image/svg+xml")};n("icon"),n("shortcut icon")}catch(e){}},[null===ke||void 0===ke?void 0:ke.club_logo_url,_e.logoUrl]);const Ge=(null===ke||void 0===ke?void 0:ke.gallery_url)||(null===ke||void 0===ke?void 0:ke.zonerama_url),Xe=(null===ke||void 0===ke?void 0:ke.gallery_label)||v("homepage.gallery"),Ye=e=>!!e&&(we.pathname===e||we.pathname.startsWith(e+"/")),Qe=e=>{const t=e=>{const t={"Dom\u016f":"nav.home",Aktuality:"nav.news","Z\xe1pasy":"nav.matches","Hr\xe1\u010di":"nav.players",Fotogalerie:"nav.gallery",Videa:"nav.videos",Kontakt:"nav.contact","O klubu":"nav.about",Aktivity:"nav.activities","Sponzo\u0159i":"nav.sponsors","\u010cl\xe1nky":"nav.news",Blog:"nav.news","Kalend\xe1\u0159":"nav.calendar",Tabulky:"nav.table"}[e];return t?v(t):e},n={label:t(e.label),to:e.url||"#",external:"external"===e.type};return"dropdown"===e.type&&e.children&&e.children.length>0&&(n.items=e.children.map(e=>({label:t(e.label),to:e.url||"#"}))),n},et=(0,s.useMemo)(()=>(Array.isArray(He.categories)&&He.categories.length>0?He.categories:[]).map(e=>({label:e.name,to:e.url||(e.id?"/blog?category_id=".concat(e.id):e.slug?"/blog?category=".concat(encodeURIComponent(e.slug)):"/blog")})),[He.categories]),tt=(0,s.useMemo)(()=>{const e=t=>{const n=t.url||"";if(n.startsWith("/aktivity")&&!He.hasActivities)return null;if(n.startsWith("/hraci")&&!He.hasPlayers)return null;if(n.startsWith("/blog")&&!He.hasArticles)return null;if(n.startsWith("/videa")&&!He.hasVideos)return null;if(n.startsWith("/galerie")&&!He.hasGallery)return null;if("dropdown"===t.type&&Array.isArray(t.children)){const n=t.children.map(e).filter(Boolean);return(0,a.A)((0,a.A)({},t),{},{children:n})}return t};return He.dynamicNavItems.map(e).filter(Boolean)},[He.dynamicNavItems,He.hasActivities,He.hasPlayers,He.hasArticles,He.hasVideos,He.hasGallery]);let nt=(0,s.useMemo)(()=>{if(!He.navLoading&&tt.length>0){console.log("Navbar: Using dynamic navigation, items:",tt.length);const e=tt.map(Qe);if(et.length>0){const t=e.findIndex(e=>"\u010cl\xe1nky"===e.label||"Blog"===e.label||"/blog"===e.to);-1!==t&&(e[t]=(0,a.A)((0,a.A)({},e[t]),{},{items:et}))}return e.filter(e=>{const t=e.to||"";return t.startsWith("/aktivity")?He.hasActivities:t.startsWith("/hraci")?He.hasPlayers:t.startsWith("/blog")?He.hasArticles:t.startsWith("/videa")?He.hasVideos:!t.startsWith("/galerie")||He.hasGallery})}console.log("Navbar: Using fallback hardcoded navigation, language:",L.language);L.language;let e=[];const t=[{label:v("nav.home"),to:"/"}];!1!==(null===ke||void 0===ke?void 0:ke.show_about_in_nav)&&t.push({label:v("nav.club"),to:"/o-klubu"}),t.push({label:v("nav.calendar"),to:"/kalendar"},{label:v("nav.matches"),to:"/zapasy"}),He.hasActivities&&t.push({label:v("nav.activities"),to:"/aktivity"}),He.hasPlayers&&t.push({label:v("nav.players"),to:"/hraci"}),He.hasTables&&t.push({label:v("nav.tables"),to:"/tabulky"}),He.hasArticles&&t.push(et.length>0?{label:v("nav.articles"),to:"/blog",items:et}:{label:v("nav.articles"),to:"/blog"}),He.hasVideos&&t.push({label:v("nav.videos"),to:"/videa"}),He.hasGallery&&t.push({label:Xe,to:"/galerie"}),t.push({label:v("nav.sponsors"),to:"/sponzori"},{label:v("nav.contact"),to:"/kontakt"}),e=t,null!==ke&&void 0!==ke&&ke.shop_url&&e.push({label:v("nav.shop"),to:ke.shop_url,external:!0});const n=Array.isArray(null===ke||void 0===ke?void 0:ke.custom_nav)?ke.custom_nav:[];if(n.length>0){const t=n.map(e=>({label:String(e.label||"Str\xe1nka"),to:String(e.url||"#"),external:Boolean(e.external)})),a=e.findIndex(e=>"Tabulky"===e.label);e=a>=0?[...e.slice(0,a+1),...t,...e.slice(a+1)]:[...e,...t]}return e},[tt,He.navLoading,ke,et,He.hasTables,He.hasActivities,He.hasPlayers,He.hasArticles,He.hasVideos,He.hasGallery,Xe,L.language,v]);const at=(0,s.useMemo)(()=>{const e=nt;let t=8;if(t=Me>=1600?10:Me>=1400?9:Me>=1200?8:Me>=1100?7:6,e.length<=t)return{visible:e,overflow:[]};const n=Math.max(1,t-1);return{visible:e.slice(0,n),overflow:e.slice(n)}},[nt,Me]),it=(0,s.useMemo)(()=>{const e=[];return at.overflow.forEach(t=>{t.to&&e.push({label:t.label,to:t.to}),Array.isArray(t.items)&&t.items.forEach(t=>e.push({label:t.label,to:t.to}))}),e},[at]),ot=u||"unified",rt=(0,f.dU)("rgba(255,255,255,0.9)","rgba(15,17,21,0.85)"),st=(0,f.dU)("white","#0f1115"),lt="transparent"===ot,ct="minimal"===ot,dt=lt?"transparent":ct?st:rt,ut=lt||ct?"none":"saturate(180%) blur(10px)",ht=lt?"0px":"1px",mt=lt||ct?"none":Fe?"sm":"none",pt=(0,s.useMemo)(()=>{var e;let t=1,n=100,a=null!==(e=null===We||void 0===We?void 0:We.xp)&&void 0!==e?e:0;for(;a>=n&&t<200;)a-=n,t++,n+=100;return{pct:Math.max(0,Math.min(100,Math.floor(a/n*100)))}},[null===We||void 0===We?void 0:We.xp]);return(0,J.jsxs)(i.a,{position:"sticky",top:0,zIndex:1e3,children:[((null===ke||void 0===ke?void 0:ke.facebook_url)||(null===ke||void 0===ke?void 0:ke.instagram_url)||(null===ke||void 0===ke?void 0:ke.youtube_url)||(null===ke||void 0===ke?void 0:ke.shop_url))&&(0,J.jsx)(i.a,{bg:Re,borderBottomWidth:"1px",borderColor:"border.subtle",py:1,display:{base:"none",md:"block"},children:(0,J.jsx)(o.m,{maxW:Ie,px:c?0:void 0,children:(0,J.jsxs)(k.s,{align:"center",justify:"space-between",gap:2,children:[(0,J.jsx)(_.z,{spacing:2,children:(null===ke||void 0===ke?void 0:ke.shop_url)&&(0,J.jsx)(g.$,{as:"a",href:ke.shop_url,target:"_blank",rel:"noreferrer",variant:"link",size:"xs",leftIcon:(0,J.jsx)(W.IoZ,{}),children:v("nav.shop")})}),(0,J.jsxs)(_.z,{spacing:1,children:[ve("facebook",null===ke||void 0===ke?void 0:ke.facebook_url)&&(0,J.jsx)(r.K,{as:"a",href:ve("facebook",null===ke||void 0===ke?void 0:ke.facebook_url)||void 0,target:"_blank",rel:"noreferrer","aria-label":"Facebook",icon:(0,J.jsx)(W.iYk,{}),variant:"ghost",size:"xs"}),ve("instagram",null===ke||void 0===ke?void 0:ke.instagram_url)&&(0,J.jsx)(r.K,{as:"a",href:ve("instagram",null===ke||void 0===ke?void 0:ke.instagram_url)||void 0,target:"_blank",rel:"noreferrer","aria-label":"Instagram",icon:(0,J.jsx)(W.ao$,{}),variant:"ghost",size:"xs"}),ve("youtube",null===ke||void 0===ke?void 0:ke.youtube_url)&&(0,J.jsx)(r.K,{as:"a",href:ve("youtube",null===ke||void 0===ke?void 0:ke.youtube_url)||void 0,target:"_blank",rel:"noreferrer","aria-label":"YouTube",icon:(0,J.jsx)(W.Vk6,{}),variant:"ghost",size:"xs"})]})]})})}),(0,J.jsxs)(i.a,{bg:dt,backdropFilter:ut,borderBottomWidth:ht,borderColor:"border.subtle",boxShadow:mt,transition:"box-shadow 0.2s ease, background-color 0.2s ease, backdrop-filter 0.2s ease",children:[(0,J.jsx)(je,{isOpen:ne,onClose:ie,isAdmin:ye,isAuthenticated:H,menuBg:Ae,dividerColor:Ce,settings:ke,categories:He.categories,galleryHref:Ge,galleryLabel:Xe,hasTables:He.hasTables,hasActivities:He.hasActivities,hasPlayers:He.hasPlayers,hasArticles:He.hasArticles,hasVideos:He.hasVideos,hasGallery:He.hasGallery,dynamicNavItems:tt||[],navLoading:He.navLoading,t:v,i18n:L,handleSimpleLanguageChange:async e=>{try{await L.changeLanguage(e);try{localStorage.setItem("language",e)}catch(t){}document.cookie="lang=".concat(e,"; max-age=").concat(31536e3,"; path=/")}catch(n){console.error("Failed to change language:",n)}}}),(0,J.jsx)(o.m,{maxW:Ie,px:c?0:void 0,children:(0,J.jsxs)(k.s,{h:16,alignItems:"center",justifyContent:"space-between",children:[(0,J.jsxs)(_.z,{spacing:4,alignItems:"center",children:[(0,J.jsx)(_.z,{as:U.N_,to:"/",spacing:3,align:"center",children:((null===ke||void 0===ke?void 0:ke.club_logo_url)||_e.logoUrl)&&(0,J.jsx)(Z._,{src:(0,Y.uq)((null===ke||void 0===ke?void 0:ke.club_logo_url)||_e.logoUrl)||(null===ke||void 0===ke?void 0:ke.club_logo_url)||_e.logoUrl,alt:(null===ke||void 0===ke?void 0:ke.club_name)||_e.name||"Logo",boxSize:{base:"36px",md:"40px"},objectFit:"contain",borderRadius:"full",borderWidth:"2px",borderColor:"brand.primary",style:{padding:null!==(t=(null===ke||void 0===ke?void 0:ke.club_logo_url)||_e.logoUrl)&&void 0!==t&&t.includes("logoapi.sportcreative.eu")?"4px":"0px",boxSizing:"border-box"}})}),(0,J.jsxs)(_.z,{as:"nav",spacing:1,display:{base:"none",lg:"flex"},ml:4,children:[at.visible.map(e=>{const t={variant:"ghost",size:"sm",px:3,_hover:{bg:Ee,transform:"translateY(-1px)"},fontWeight:Ye(e.to)?"700":"600",color:Ye(e.to)?De:Ne,bg:Ye(e.to)?Te:"transparent",transition:"all 0.2s"};return e.items&&e.items.length>0?(0,J.jsx)(be,{label:e.label,to:e.to||"/blog",items:e.items,isActive:Ye(e.to)},e.label):e.external&&e.to?(0,J.jsx)(g.$,(0,a.A)((0,a.A)({as:"a",href:e.to,target:"_blank",rel:"noreferrer",rightIcon:(0,J.jsx)(W.EQc,{})},t),{},{children:e.label}),e.label):(0,J.jsx)(g.$,(0,a.A)((0,a.A)({as:U.N_,to:e.to||"#"},t),{},{children:e.label}),e.label)}),at.overflow.length>0&&(0,J.jsx)(be,{label:v("action.more"),items:it},"more")]})]}),(0,J.jsxs)(k.s,{alignItems:"center",children:[(0,J.jsx)(r.K,{display:{base:"flex",md:"none"},onClick:ae,icon:(0,J.jsx)(I.R,{}),"aria-label":v("action.open_menu"),variant:"ghost",mr:2}),(0,J.jsx)(i.a,{display:{base:"none",md:"flex"},mr:2}),(0,J.jsx)(w.m,{label:v("action.search"),hasArrow:!0,children:(0,J.jsx)(r.K,{"aria-label":v("action.search"),icon:(0,J.jsx)(W.KSO,{}),size:"sm",mr:2,variant:"ghost",onClick:se})}),ye&&(0,J.jsx)(w.m,{label:v("action.content_admin"),hasArrow:!0,children:(0,J.jsx)(r.K,{as:U.N_,to:"/admin","aria-label":v("action.content_admin"),icon:(0,J.jsx)(M.q,{}),size:"sm",mr:2,colorScheme:"blue",variant:"ghost"})}),(0,J.jsx)(G,{}),(0,J.jsx)(de.UW,{}),!H&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(g.$,{as:U.N_,to:"/register",size:"sm",variant:"outline",display:{base:"none",md:"inline-flex"},ml:2,mr:2,children:v("auth.register")}),(0,J.jsx)(g.$,{as:U.N_,to:"/login",size:"sm",colorScheme:"blue",display:{base:"none",md:"inline-flex"},mr:2,children:v("auth.login")})]}),H&&(0,J.jsxs)(z.W,{children:[(0,J.jsx)(S.I,{as:g.$,rounded:"full",variant:"link",cursor:"pointer",minW:0,ml:2,children:(0,J.jsx)(A.e,{size:"sm",name:(null===te||void 0===te?void 0:te.name)||v("common.user"),src:(null===We||void 0===We?void 0:We.animated_avatar_url)||(null===We||void 0===We?void 0:We.avatar_url)||void 0})}),(0,J.jsxs)(C.c,{children:[(0,J.jsx)(E.D,{isDisabled:!0,children:"".concat(v("engagement.level")," ").concat(null!==(n=null===We||void 0===We?void 0:We.level)&&void 0!==n?n:1," \u2022 ").concat(null!==(l=null===We||void 0===We?void 0:We.points)&&void 0!==l?l:0," ").concat(v("engagement.points"))}),(0,J.jsxs)(i.a,{px:3,py:2,children:[(0,J.jsx)(j.E,{fontSize:"xs",color:"gray.500",children:v("engagement.progress")}),(0,J.jsx)(T.k,{value:pt.pct,size:"xs",colorScheme:"blue",borderRadius:"full",mt:1})]}),!ye&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(E.D,{onClick:qe,children:v("engagement.achievements")}),(0,J.jsx)(E.D,{onClick:Ze,children:v("engagement.rewards")})]}),(0,J.jsx)(E.D,{as:U.N_,to:fe,children:v("common.my_account")}),(0,J.jsx)(E.D,{onClick:async()=>{try{const{token:e}=await(0,X.FD)();ze("/newsletter/preferences?token=".concat(encodeURIComponent(e)))}catch(e){Se({title:"Chyba",description:"Nelze na\u010d\xedst odkaz na e\u2011mailov\xe9 preference. Zkuste to pros\xedm znovu.",status:"error",duration:4e3})}},children:v("newsletter.email_preferences")}),ye&&(0,J.jsx)(E.D,{as:U.N_,to:"/admin/nastaveni",children:v("admin.page_settings")}),ye&&(0,J.jsx)(E.D,{as:U.N_,to:"/admin",children:v("nav.admin")}),(0,J.jsx)(E.D,{onClick:ee,children:v("auth.logout")})]})]})]})]})}),(0,J.jsxs)(D.aF,{isOpen:oe,onClose:le,size:"md",motionPreset:"scale",children:[(0,J.jsx)(d.m,{}),(0,J.jsxs)(N.$,{children:[(0,J.jsx)(m.r,{children:v("search.title")}),(0,J.jsx)(h.s,{}),(0,J.jsxs)(p.c,{pb:6,children:[(0,J.jsx)("form",{onSubmit:e=>{e.preventDefault(),(()=>{const e=$e.trim();e&&(le(),Je(""),ze("/hledat?q=".concat(encodeURIComponent(e))))})()},children:(0,J.jsxs)(x.T,{spacing:4,children:[(0,J.jsxs)(R.M,{size:"lg",children:[(0,J.jsx)(F.W,{pointerEvents:"none",children:(0,J.jsx)(W.KSO,{})}),(0,J.jsx)(P.p,{placeholder:v("search.placeholder"),value:$e,onChange:e=>Je(e.target.value),autoFocus:!0})]}),(0,J.jsx)(g.$,{type:"submit",colorScheme:"blue",size:"lg",w:"full",leftIcon:(0,J.jsx)(W.KSO,{}),children:v("search.search_button")})]})}),(0,J.jsx)(j.E,{fontSize:"sm",color:"gray.500",mt:4,textAlign:"center",children:v("search.search_hint")})]})]})]}),!ye&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(re,{isOpen:Oe,onClose:Ke,onOpenRewards:Ze}),(0,J.jsx)(ce,{isOpen:Be,onClose:Ve,availablePoints:(null===We||void 0===We?void 0:We.points)||0,onRedeemed:async()=>{try{const e=await(0,Q.E$)();Ue(e)}catch(e){}}})]})]})]})};var fe=n(58957),ke=n(17707),_e=n(13316),we=n(80309);const ze=e=>{let{children:t,headerInsideContainer:n=!1,showSponsorsSection:c=!0}=e;const[d,u]=(0,s.useState)(!1),{getStyles:h,getVariant:m,refreshKey:p}=(0,ke.N)("homepage"),x=m("header","unified"),g=m("sponsors","grid"),v=m("footer","standard"),j=m("container","boxed"),b="fullwidth"===j,y=b?"100%":"wide"===j?"1400px":"container.xl",f=n&&"fullwidth"!==x;(0,s.useEffect)(()=>{const e=()=>{try{u(window.scrollY>400)}catch(e){}};return window.addEventListener("scroll",e,{passive:!0}),e(),()=>window.removeEventListener("scroll",e)},[]);return(0,J.jsxs)(i.a,{minH:"100vh",bg:"bg.app",overflowX:"hidden",children:[(0,J.jsx)(i.a,{id:"top",position:"absolute",top:0,left:0}),f?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(o.m,{maxW:y,py:8,px:b?0:void 0,children:[(0,J.jsx)(i.a,{as:"header","data-element":"header","data-variant":x,style:(0,a.A)({},h("header")),children:"sparta_navbar"===x?(0,J.jsx)(_e.A,{}):(0,J.jsx)(ye,{fullWidth:"fullwidth"===x,variant:x})},"header-".concat(p,"-").concat(x)),t]}),c&&(0,J.jsx)(i.a,{"data-element":"sponsors","data-variant":g,style:(0,a.A)({},h("sponsors")),children:(0,J.jsx)(we.A,{})},"sponsors-".concat(p,"-").concat(g)),(0,J.jsx)(i.a,{as:"footer","data-element":"footer","data-variant":v,style:(0,a.A)({},h("footer")),children:(0,J.jsx)(fe.A,{})},"footer-".concat(p,"-").concat(v))]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(i.a,{as:"header","data-element":"header","data-variant":x,style:(0,a.A)({},h("header")),children:"sparta_navbar"===x?(0,J.jsx)(_e.A,{}):(0,J.jsx)(ye,{fullWidth:"fullwidth"===x,variant:x})},"header-".concat(p,"-").concat(x)),(0,J.jsx)(o.m,{maxW:y,py:8,px:b?0:void 0,children:t}),c&&(0,J.jsx)(i.a,{"data-element":"sponsors","data-variant":g,style:(0,a.A)({},h("sponsors")),children:(0,J.jsx)(we.A,{})},"sponsors-".concat(p,"-").concat(g)),(0,J.jsx)(i.a,{as:"footer","data-element":"footer","data-variant":v,style:(0,a.A)({},h("footer")),children:(0,J.jsx)(fe.A,{})},"footer-".concat(p,"-").concat(v))]}),d&&(0,J.jsx)(r.K,{"aria-label":"Zp\u011bt nahoru",icon:(0,J.jsx)(l.wAb,{}),position:"fixed",right:{base:4,md:6},bottom:{base:4,md:6},zIndex:1e3,colorScheme:"blue",onClick:()=>{try{window.scrollTo({top:0,behavior:"smooth"})}catch(e){window.scrollTo(0,0)}},borderRadius:"full",shadow:"md"})]})}},40384:(e,t,n)=>{n.d(t,{A:()=>p,J:()=>m});var a=n(89379),i=n(79722);const o=new Map,r=i.A.create({baseURL:"/api/v1/facr",timeout:parseInt("5000 # 5 seconds",10),headers:{"Content-Type":"application/json",Accept:"application/json"}}),s=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic",REACT_APP_ESHOP_URL:"http://localhost:3100",REACT_APP_ERROR_INGEST_URL:"http://127.0.0.1:8083/api/v1/errors",REACT_APP_ERROR_INGEST_TOKEN:""}.REACT_APP_API_BASE_URL||"/api/v1";if("undefined"===typeof window)return e;const n=t?new URL(t,window.location.origin).origin:window.location.origin;return new URL(e,n).toString()}return e}catch(t){return e}};let l=null;const c=async()=>{const e=Date.now();if(l&&e-l.ts<6e4)return l.data||{};try{const n=await fetch(s("/api/v1/public/team-logo-overrides?t=".concat(e)),{cache:"no-cache"});if(n.ok){var t;const a=await n.json(),i=JSON.stringify((null===(t=l)||void 0===t?void 0:t.data)||{}),r=JSON.stringify(a||{});return l={data:a,ts:e},i!==r&&o.clear(),a||{}}}catch(a){}try{const t=await fetch(s("/cache/prefetch/team_logo_overrides.json"),{cache:"no-cache"});if(t.ok){var n;const a=await t.json(),i=JSON.stringify((null===(n=l)||void 0===n?void 0:n.data)||{}),r=JSON.stringify(a||{});return l={data:a,ts:e},i!==r&&o.clear(),a||{}}}catch(i){}return l={data:{by_name:{}},ts:e},{by_name:{}}},d=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),u=e=>{let t=d(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,""),t.replace(/\s+/g," ").trim()};r.interceptors.request.use(e=>{var t;if("get"!==(null===(t=e.method)||void 0===t?void 0:t.toLowerCase()))return e;const n="".concat(e.method,":").concat(e.url,":").concat(JSON.stringify(e.params)),i=o.get(n),r=Date.now(),s=parseInt("3600000 # 1 hour in milliseconds",10);return i&&r-i.timestamp<s?(0,a.A)((0,a.A)({},e),{},{adapter:()=>Promise.resolve({data:i.data,status:200,statusText:"OK",headers:{},config:e})}):e},e=>Promise.reject(e)),r.interceptors.response.use(e=>{var t;const n=null===(t=e.config.method)||void 0===t?void 0:t.toLowerCase(),a=e.config.url,i=e.config.params;if("get"===n){const t="".concat(n,":").concat(a,":").concat(JSON.stringify(i));o.set(t,{data:e.data,timestamp:Date.now()})}return e},e=>(console.error("API Error:",e),Promise.reject(e)));const h=e=>{if(e.response){const t=e.response.data||{},n=t.message||"API request failed";throw console.error("API Error Response:",t),new Error(n)}throw e.request?(console.error("API Error: No response received",e.request),new Error("No response from server. Please check if the FACR scraper API is running.")):(console.error("API Error:",e.message),new Error("API request failed: ".concat(e.message)))},m={searchClubs:async e=>{try{return(await r.get("/club/search",{params:{q:e}})).data}catch(t){return h(t)}},getClub:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"football";try{const n=await r.get("/club/".concat(t,"/").concat(e)),i=await c(),o=((e,t)=>{var n;if(null===e||void 0===e||null===(n=e.competitions)||void 0===n||!n.length)return e;const i=(null===t||void 0===t?void 0:t.by_name)||{},o=(null===t||void 0===t?void 0:t.by_id)||{},r=Object.keys(i||{}).reduce((e,t)=>(e[d(t)]=i[t],e),{}),l=Object.keys(i||{}).map(e=>({key:u(e),url:i[e]})),c=(e,t,n)=>{var a;if(e&&null!==(a=o[e])&&void 0!==a&&a.logo_url){const t=o[e].logo_url;return"string"===typeof t&&t.startsWith("/")?s(t):t}if(!t)return n;const c=(i||{})[t],h=d(t);let m=c||r[h];if(!m){const e=u(t);for(const{key:t,url:n}of l)if(t&&(e.endsWith(t)||t.endsWith(e))){m=n;break}}const p=m||n;return"string"===typeof p&&p.startsWith("/")?s(p):p},h=(e,t)=>{var n;const a=e&&null!==(n=o[e])&&void 0!==n&&n.name?o[e].name:void 0;return a&&a.trim().length>0?a:t};return e.competitions=(e.competitions||[]).map(e=>(0,a.A)((0,a.A)({},e),{},{matches:(e.matches||[]).map(e=>(0,a.A)((0,a.A)({},e),{},{home:h(e.home_id,e.home),away:h(e.away_id,e.away),home_logo_url:c(e.home_id,e.home,e.home_logo_url),away_logo_url:c(e.away_id,e.away,e.away_logo_url)}))})),e})(n.data,i);return o}catch(n){return h(n)}},getClubTable:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"football";try{const n=(await r.get("/club/".concat(t,"/").concat(e,"/table"))).data,i=await c(),o=(null===i||void 0===i?void 0:i.by_name)||{},l=(null===i||void 0===i?void 0:i.by_id)||{},h=Object.keys(o||{}).reduce((e,t)=>(e[d(t)]=o[t],e),{}),m=Object.keys(o||{}).map(e=>({key:u(e),url:o[e]})),p=(e,t,n)=>{var a;if(e&&null!==(a=l[e])&&void 0!==a&&a.logo_url){const t=l[e].logo_url;return"string"===typeof t&&t.startsWith("/")?s(t):t}if(!t)return n;const i=(o||{})[t],r=d(t);let c=i||h[r];if(!c){const e=u(t);for(const{key:t,url:n}of m)if(t&&(e.endsWith(t)||t.endsWith(e))){c=n;break}}const p=c||n;return"string"===typeof p&&p.startsWith("/")?s(p):p},x=(e,t)=>{var n;const a=e&&null!==(n=l[e])&&void 0!==n&&n.name?l[e].name:void 0;return a&&a.trim().length>0?a:t};return Array.isArray(null===n||void 0===n?void 0:n.competitions)&&(n.competitions=n.competitions.map(e=>{var t;return(0,a.A)((0,a.A)({},e),{},{table:{overall:((null===(t=e.table)||void 0===t?void 0:t.overall)||[]).map(e=>(0,a.A)((0,a.A)({},e),{},{team:x(e.team_id,e.team),team_logo_url:p(e.team_id,e.team,e.team_logo_url)}))}})})),n}catch(n){return h(n)}},clearCache:()=>{o.clear()},getClubCompetitions:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"football";try{return(await m.getClub(e,t)).competitions||[]}catch(n){return h(n)}},getCompetitionMatches:async e=>{try{var t;const[n,a]=e.split("/"),i=null===(t=(await r.get("/club/".concat(n,"/").concat(a))).data.competitions)||void 0===t?void 0:t.find(t=>t.id===e);return(null===i||void 0===i?void 0:i.matches)||[]}catch(n){return h(n)}}},p=m},40548:(e,t,n)=>{n.d(t,{MC:()=>r,Or:()=>o,P5:()=>i,sx:()=>s});var a=n(46291);const i=async()=>(await a.Ay.get("/admin/analytics")).data,o=async()=>(await a.Ay.get("/admin/analytics/overview")).data,r=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return(await a.Ay.get("/admin/analytics/top-pages",{params:{limit:e}})).data},s=async e=>(await a.Ay.post("/analytics/track",e)).data},41172:(e,t,n)=>{n.d(t,{E:()=>o});var a=n(65043),i=n(40384);const o=()=>{const[e,t]=(0,a.useState)(!1),[n,o]=(0,a.useState)(null),[r,s]=(0,a.useState)([]),[l,c]=(0,a.useState)(!1),[d,u]=(0,a.useState)(null),h=(0,a.useCallback)(async e=>{t(!0),o(null);try{return await e()}catch(n){const e=n instanceof Error?n:new Error("An unknown error occurred");throw o(e),e}finally{t(!1)}},[]),m=(0,a.useCallback)(async e=>{c(!0),u(null);try{const t=await h(()=>i.A.searchClubs(e));return s(t.results||[]),t}catch(t){const e=t instanceof Error?t:new Error("Failed to search clubs");throw u(e),e}finally{c(!1)}},[h]);return{searchClubs:m,searchResults:r,searchLoading:l,searchError:d,getClub:(0,a.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"football";return h(()=>i.A.getClub(e,t))},[h]),getClubTable:(0,a.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"football";return h(()=>i.A.getClubTable(e,t))},[h]),getClubCompetitions:(0,a.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"football";return h(()=>i.A.getClubCompetitions(e,t))},[h]),getCompetitionMatches:(0,a.useCallback)(e=>h(()=>i.A.getCompetitionMatches(e)),[h]),clearCache:(0,a.useCallback)(()=>{i.A.clearCache()},[]),loading:e,error:n}}},42687:(e,t,n)=>{n.d(t,{FR:()=>l,Qm:()=>u,V6:()=>d,a5:()=>h,aS:()=>s,dt:()=>c,kw:()=>r,tb:()=>o});var a=n(89379),i=n(46291);async function o(){var e,t;const n=await i.Ay.get("/admin/matches");return Array.isArray(n.data)?n.data:null!==(e=null===(t=n.data)||void 0===t?void 0:t.data)&&void 0!==e?e:[]}async function r(e,t){const n=(0,a.A)({},t);if("string"===typeof n.date_time_override&&""!==n.date_time_override.trim()){const e=new Date(n.date_time_override);isNaN(e.getTime())||(n.date_time_override=e.toISOString())}try{return(await i.Ay.patch("/admin/match-overrides/".concat(encodeURIComponent(e)),n)).data}catch(s){var o,r;if(404===(null!==(o=null===s||void 0===s||null===(r=s.response)||void 0===r?void 0:r.status)&&void 0!==o?o:null===s||void 0===s?void 0:s.status))return async function(e,t){const n=(0,a.A)({},t);if("string"===typeof n.date_time_override&&""!==n.date_time_override.trim()){const e=new Date(n.date_time_override);isNaN(e.getTime())||(n.date_time_override=e.toISOString())}return(await i.Ay.put("/admin/match-overrides/".concat(encodeURIComponent(e)),n)).data}(e,n);throw s}}async function s(e,t,n){return(await i.Ay.put("/admin/team-logo-overrides/".concat(encodeURIComponent(e)),{team_name:t,logo_url:n})).data}async function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const a=new FormData,i=n.filename||(t instanceof File?t.name:"logo.png");a.append("file",t,i),a.append("club_name",n.clubName||"Nezn\xe1m\xfd klub"),n.clubType&&a.append("club_type",n.clubType);const o=await fetch("https://logoapi.sportcreative.eu/logos/".concat(e),{method:"POST",body:a}),r=await o.json().catch(()=>({}));if(!o.ok)return{success:!1,error:r.error||"HTTP ".concat(o.status,": ").concat(o.statusText)};return{success:!0,url:r.logo_url||r.logo_url_svg||r.logo_url_png||"https://logoapi.sportcreative.eu/logos/".concat(e,"/logo.svg")}}catch(a){return console.error("Error uploading logo:",a),{success:!1,error:(null===a||void 0===a?void 0:a.message)||"Nepoda\u0159ilo se nahr\xe1t logo. Zkuste to pros\xedm znovu."}}}async function c(e){try{let n=e;if(e.startsWith("/")){const t=new URL(i.API_URL).origin;n="".concat(t).concat(e)}const a=new URL(i.API_URL).origin;let o=n;try{new URL(n).origin!==a&&(o="".concat(a,"/api/v1/proxy/image?url=").concat(encodeURIComponent(n)))}catch(t){}const r=await fetch(o);return r.ok?await r.blob():null}catch(n){return console.error("Failed to fetch logo as blob:",n),null}}async function d(e){const t=new FormData;t.append("file",e);const n=(await i.Ay.post("/upload",t,{headers:{"Content-Type":"multipart/form-data"}})).data;let o=(null===n||void 0===n?void 0:n.url)||"";try{const e=new URL(o,window.location.origin),t=window.location.origin,n=new URL(i.API_URL).origin;e.origin!==t&&e.origin!==n||(o=e.pathname+e.search+e.hash)}catch(r){}return(0,a.A)((0,a.A)({},n||{}),{},{url:o})}async function u(e){var t,n,a;if(!e||e.trim().length<2)return[];const o=await i.Ay.get("/facr/club/search",{params:{q:e}}),r=null!==(t=null!==(n=null===(a=o.data)||void 0===a?void 0:a.results)&&void 0!==n?n:o.data)&&void 0!==t?t:[];return(Array.isArray(r)?r.map(e=>{var t,n,a,i,o,r,s;return{id:null!==(t=null!==(n=null!==(a=null===e||void 0===e?void 0:e.id)&&void 0!==a?a:null===e||void 0===e?void 0:e.club_id)&&void 0!==n?n:null===e||void 0===e?void 0:e.ClubID)&&void 0!==t?t:"",name:null!==(i=null!==(o=null===e||void 0===e?void 0:e.name)&&void 0!==o?o:null===e||void 0===e?void 0:e.Name)&&void 0!==i?i:"",logo_url:null!==(r=null!==(s=null===e||void 0===e?void 0:e.logo_url)&&void 0!==s?s:null===e||void 0===e?void 0:e.LogoURL)&&void 0!==r?r:void 0}}):[]).filter(e=>e.id&&e.name)}async function h(){try{var e;return null!==(e=(await i.Ay.get("/public/team-logo-overrides",{params:{t:Date.now()}})).data)&&void 0!==e?e:{}}catch(t){try{const e=(await i.Ay.get("/admin/team-logo-overrides",{params:{t:Date.now()}})).data;if(Array.isArray(e)){const t={};for(const n of e){const e=(null===n||void 0===n?void 0:n.team_name)||(null===n||void 0===n?void 0:n.TeamName),a=(null===n||void 0===n?void 0:n.logo_url)||(null===n||void 0===n?void 0:n.LogoURL);e&&a&&(t[String(e)]=String(a))}return{by_name:t}}return e&&"object"===typeof e&&e.by_name?e:{}}catch(n){return{}}}}},44318:(e,t,n)=>{n.d(t,{g:()=>r,r:()=>o});var a=n(46291);function i(e){try{if(/^https?:\/\//i.test(e))return e;const t=new URL(a.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e.startsWith("/")?e:"/".concat(e),t).toString()}catch(t){return e}}async function o(){const e=i("/cache/prefetch/facr_club_info.json"),t=await fetch(e,{cache:"no-cache"});return t.ok?t.json():null}async function r(){const e=i("/cache/prefetch/facr_tables.json"),t=await fetch(e,{cache:"no-cache"});return t.ok?t.json():null}},44847:(e,t,n)=>{n.d(t,{d:()=>o,z:()=>r});const a=200;let i=[];function o(e){i.push(e),i.length>a&&(i=i.slice(i.length-a))}function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12;const t=Math.max(1,Math.min(e,a));return i.slice(-t)}},45662:(e,t,n)=>{n.r(t),n.d(t,{default:()=>C});var a=n(65043),i=n(40378),o=n(22107),r=n(49027),s=n(26806),l=n(32332),c=n(98662),d=n(98939),u=n(5371),h=n(33572),m=n(76659),p=n(29904),x=n(30502),g=n(28846),v=n(39081),j=n(73216),b=n(35475),y=n(25189),f=n(57550),k=n(72526),_=n(70082),w=n(81398),z=n(46291),S=n(70579);const A=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(z.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}},C=()=>{const{id:e}=(0,j.g)(),t=(0,x.d)(),{data:n}=(0,f.s)(),[z,C]=(0,a.useState)(!0),[E,T]=(0,a.useState)(null),[D,N]=(0,a.useState)(""),[R,F]=(0,a.useState)(""),[P,I]=(0,a.useState)(""),[M,L]=(0,a.useState)(null),[W,U]=(0,a.useState)(null);(0,a.useEffect)(()=>{let a=!1;return(async()=>{if(e){C(!0);try{const t=await fetch(A("/cache/prefetch/facr_club_info.json"),{cache:"no-cache"});let i=null,o=[];if(t.ok){const n=await t.json();for(const t of(null===n||void 0===n?void 0:n.competitions)||[]){const n=[];for(const a of(null===t||void 0===t?void 0:t.matches)||[]){const o=String(a.match_id||"");if(o&&o===String(e)){const e=String(a.date_time||""),[n,r]=e.includes(" ")?e.split(" "):[e,""],[s,l,c]=n.split("."),d=s&&l&&c?"".concat(c,"-").concat(l.padStart(2,"0"),"-").concat(s.padStart(2,"0")):(new Date).toISOString().slice(0,10),u=(r||"00:00").slice(0,5),h=(a.score||a.result||("number"===typeof a.goals_home&&"number"===typeof a.goals_away?"".concat(a.goals_home,":").concat(a.goals_away):"")||"").toString();i={id:o,date:d,time:u,home:a.home,away:a.away,venue:a.venue,home_logo_url:a.home_logo_url,away_logo_url:a.away_logo_url,report_url:a.report_url,facr_link:a.facr_link,score:h&&/\d+\s*:\s*\d+/.test(h)?h.replace(/\s+/g,""):void 0},N(String((null===t||void 0===t?void 0:t.name)||(null===t||void 0===t?void 0:t.code)||"")),null!=(null===t||void 0===t?void 0:t.id)&&F(String(t.id)),null!==t&&void 0!==t&&t.code&&I(String(t.code));break}const r=String(a.date_time||""),[s,l]=r.includes(" ")?r.split(" "):[r,""],[c,d,u]=s.split("."),h=c&&d&&u?"".concat(u,"-").concat(d.padStart(2,"0"),"-").concat(c.padStart(2,"0")):(new Date).toISOString().slice(0,10),m=(l||"00:00").slice(0,5);n.push({id:a.match_id||"",date:h,time:m,home:a.home,away:a.away})}if(i)break;o=n}}if(!i&&null!==n&&void 0!==n&&n.club_id){const t=n.club_type||"football",a="/cache/facr/".concat(t,"_").concat(n.club_id,"_info.json"),r=await fetch(A(a),{cache:"no-cache"});if(r.ok){const t=await r.json();for(const n of(null===t||void 0===t?void 0:t.competitions)||[]){const t=[];for(const a of(null===n||void 0===n?void 0:n.matches)||[]){const o=String(a.match_id||"");if(o&&o===String(e)){const e=String(a.date_time||""),[t,r]=e.includes(" ")?e.split(" "):[e,""],[s,l,c]=t.split("."),d=s&&l&&c?"".concat(c,"-").concat(l.padStart(2,"0"),"-").concat(s.padStart(2,"0")):(new Date).toISOString().slice(0,10),u=(r||"00:00").slice(0,5),h=(a.score||a.result||("number"===typeof a.goals_home&&"number"===typeof a.goals_away?"".concat(a.goals_home,":").concat(a.goals_away):"")||"").toString();i={id:o,date:d,time:u,home:a.home,away:a.away,venue:a.venue,home_logo_url:a.home_logo_url,away_logo_url:a.away_logo_url,report_url:a.report_url,facr_link:a.facr_link,score:h&&/\d+\s*:\s*\d+/.test(h)?h.replace(/\s+/g,""):void 0},N(String((null===n||void 0===n?void 0:n.name)||(null===n||void 0===n?void 0:n.code)||"")),null!=(null===n||void 0===n?void 0:n.id)&&F(String(n.id)),null!==n&&void 0!==n&&n.code&&I(String(n.code));break}const r=String(a.date_time||""),[s,l]=r.includes(" ")?r.split(" "):[r,""],[c,d,u]=s.split("."),h=c&&d&&u?"".concat(u,"-").concat(d.padStart(2,"0"),"-").concat(c.padStart(2,"0")):(new Date).toISOString().slice(0,10),m=(l||"00:00").slice(0,5);t.push({id:a.match_id||"",date:h,time:m,home:a.home,away:a.away})}if(i)break;o=t}}}if(i&&o.length){const e=o.sort((e,t)=>new Date("".concat(e.date,"T").concat(e.time,":00")).getTime()-new Date("".concat(t.date,"T").concat(t.time,":00")).getTime()),t=e.findIndex(e=>String(e.id)===String(i.id));L(t>0?e[t-1]:null),U(t>=0&&t<e.length-1?e[t+1]:null)}else L(null),U(null);a||T(i)}catch(i){a||t({title:"Chyba",description:(null===i||void 0===i?void 0:i.message)||"Nelze na\u010d\xedst z\xe1pas",status:"error"})}finally{a||C(!1)}}})(),()=>{a=!0}},[e,n,t]);const O=(0,a.useMemo)(()=>!!E&&new Date("".concat(E.date,"T").concat(E.time||"00:00",":00")).getTime()<Date.now(),[E]),{data:q}=(0,k.I)({queryKey:["public-competition-aliases"],queryFn:_.xN}),K=(0,a.useMemo)(()=>{if(!P)return D;const e=(q||[]).find(e=>e.code===P);return(null===e||void 0===e?void 0:e.alias)||D},[q,P,D]);return(0,S.jsxs)(i.A,{children:[(0,S.jsxs)(d.m,{maxW:"3xl",py:{base:6,md:10},children:[(0,S.jsxs)(r.Q,{fontSize:"sm",mb:4,separator:"/",children:[(0,S.jsx)(s.J,{children:(0,S.jsx)(l.w,{as:b.N_,to:"/",children:"Dom\u016f"})}),(0,S.jsx)(s.J,{children:(0,S.jsx)(l.w,{as:b.N_,to:R?"/kalendar?comp=".concat(R):"/kalendar",children:"Kalend\xe1\u0159"})}),K&&(0,S.jsx)(s.J,{children:(0,S.jsx)(l.w,{as:b.N_,to:R?"/kalendar?comp=".concat(R):"/kalendar",children:K})}),E&&(0,S.jsx)(s.J,{isCurrentPage:!0,children:(0,S.jsxs)(l.w,{children:[E.home," vs ",E.away]})})]}),(0,S.jsx)(o.a,{mb:4,children:(0,S.jsx)(c.$,{as:b.N_,to:R?"/kalendar?comp=".concat(R):"/kalendar",size:"sm",variant:"outline",children:"Zp\u011bt na kalend\xe1\u0159"})}),z&&(0,S.jsxs)(u.s,{align:"center",gap:3,color:"gray.600",children:[(0,S.jsx)(m.y,{size:"sm"})," Na\u010d\xedt\xe1m\u2026"]}),!z&&!E&&(0,S.jsx)(o.a,{color:"gray.600",children:"Z\xe1pas nebyl nalezen."}),E&&(0,S.jsxs)(p.B,{spacing:5,children:[(0,S.jsxs)(g.D,{size:"lg",children:[E.home," vs ",E.away]}),(0,S.jsxs)(u.s,{align:"center",justify:"center",gap:4,children:[E.home_logo_url&&(0,S.jsx)(h._,{src:(0,y.uq)(E.home_logo_url)||E.home_logo_url,alt:E.home,boxSize:"56px",borderRadius:"full"}),(0,S.jsx)(v.E,{fontSize:"2xl",fontWeight:"bold",children:O&&E.score?E.score:"vs"}),E.away_logo_url&&(0,S.jsx)(h._,{src:(0,y.uq)(E.away_logo_url)||E.away_logo_url,alt:E.away,boxSize:"56px",borderRadius:"full"})]}),(0,S.jsxs)(v.E,{textAlign:"center",color:"gray.700",children:[E.date," ",E.time," ",E.venue?"\u2022 ".concat(E.venue):""]}),(M||W)&&(0,S.jsxs)(u.s,{justify:"space-between",mt:2,children:[(0,S.jsx)(o.a,{children:M&&(0,S.jsxs)(c.$,{as:b.N_,to:"/zapas/".concat(M.id),size:"sm",variant:"ghost",children:["\u2190 ",M.home," vs ",M.away]})}),(0,S.jsx)(o.a,{children:W&&(0,S.jsxs)(c.$,{as:b.N_,to:"/zapas/".concat(W.id),size:"sm",variant:"ghost",children:[W.home," vs ",W.away," \u2192"]})})]}),(E.facr_link||E.report_url)&&(0,S.jsxs)(u.s,{justify:"center",gap:3,children:[E.facr_link&&(0,S.jsx)(c.$,{colorScheme:"red",variant:"outline",onClick:e=>{e.preventDefault();const t=document.createElement("a");t.href=E.facr_link||"",t.target="_blank",t.rel="noopener noreferrer",t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:"FA\u010cR detail"}),E.report_url&&(0,S.jsx)(c.$,{variant:"outline",onClick:e=>{e.preventDefault();const t=document.createElement("a");t.href=E.report_url||"",t.target="_blank",t.rel="noopener noreferrer",t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:"Z\xe1pis"})]})]})]}),(0,S.jsx)(w.A,{})]})}},45754:(e,t,n)=>{var a=n(65043),i=n(84391),o=(n(50817),n(80348),n(57590),n(89576),n(93777),n(44978)),r=n(74117);o.Ay.use(r.r9).init({lng:(()=>{try{const e=localStorage.getItem("language");if(e&&["cs","en"].includes(e))return e}catch(t){}try{const e=document.cookie.split(";");for(const t of e){const[e,n]=t.trim().split("=");if("lang"===e&&["cs","en"].includes(n))return n}}catch(t){}const e=navigator.language.split("-")[0];return["cs","en"].includes(e)?e:"cs"})(),fallbackLng:"cs",debug:!1,resources:{cs:{translation:{nav:{home:"Dom\u016f",matches:"Z\xe1pasy",calendar:"Kalend\xe1\u0159",tables:"Tabulky",players:"Hr\xe1\u010di",gallery:"Galerie",videos:"Videa",articles:"\u010cl\xe1nky",activities:"Aktivity",contact:"Kontakt",shop:"E-shop",sponsors:"Sponzo\u0159i",club:"Klub",news:"Aktuality",all_articles:"Dal\u0161\xed \u010dl\xe1nky",all_matches:"V\u0161echny z\xe1pasy",all_tables:"Zobrazit v\u0161e",login:"P\u0159ihl\xe1sit se",register:"Registrovat se",admin:"Administrace",logout:"Odhl\xe1sit",view_all:"Zobrazit v\u0161e"},homepage:{nearest_matches:"Nejbli\u017e\u0161\xed z\xe1pasy",latest_news:"Aktuality",latest_title:"Nejnov\u011bj\u0161\xed titulek",more_articles_home:"Dal\u0161\xed aktuality",tables:"Tabulky",gallery:"Photos",sponsors:"Partne\u0159i",shop:"Fanshop",calendar:"Kalend\xe1\u0159",activities:"Aktivity",videos:"Videa",club:"Klub",contact:"Kontakt",welcome_to_club:"V\xedtejte v na\u0161em fotbalov\xe9m klubu",official_website:"Ofici\xe1ln\xed web klubu",read_more:"\u010c\xedst v\xedce",view_all:"Zobrazit v\u0161e",next_match:"P\u0159\xed\u0161t\xed z\xe1pas",match_details:"Detail z\xe1pasu",competition:"Sout\u011b\u017e",venue:"M\xedsto kon\xe1n\xed",result:"V\xfdsledek",standings:"Tabulka",position:"Poz.",team:"T\xfdm",points:"Body",played:"Z\xe1pasy",won:"V",drawn:"R",lost:"P",goals:"G\xf3ly",goal_difference:"Rozd\xedl",latest_results:"Posledn\xed v\xfdsledky",upcoming_events:"Nadch\xe1zej\xedc\xed akce",featured_articles:"Doporu\u010den\xe9 \u010dl\xe1nky",more_articles:"Dal\u0161\xed \u010dl\xe1nky",photo_gallery:"Photos",video_gallery:"Video galerie",our_partners:"Na\u0161i partne\u0159i",more_videos:"V\xedce vide\xed",all_matches:"V\u0161echny z\xe1pasy",partner_categories:{general:"Gener\xe1ln\xed partner",main:"Hlavn\xed partner",official:"Ofici\xe1ln\xed partner",media:"Medi\xe1ln\xed partner",technical:"Technick\xfd partner",supplier:"Dodavatel"}},news:{no_news:"Zat\xedm nejsou k dispozici \u017e\xe1dn\xe9 aktuality.",view_all_news:"Zobrazit v\u0161echny aktuality"},action:{save:"Ulo\u017eit",edit:"Upravit",delete:"Smazat",add:"P\u0159idat",create:"Vytvo\u0159it",update:"Aktualizovat",cancel:"Zru\u0161it",confirm:"Potvrdit",close:"Zav\u0159\xedt",back:"Zp\u011bt",next:"Dal\u0161\xed",previous:"P\u0159edchoz\xed",search:"Hledat",filter:"Filtrovat",sort:"Se\u0159adit",loading:"Na\u010d\xedt\xe1m...",error:"Chyba",success:"\xdasp\u011bch",warning:"Varov\xe1n\xed",info:"Informace",view:"Zobrazit",download:"St\xe1hnout",upload:"Nahr\xe1t",share:"Sd\xedlet",copy:"Kop\xedrovat",send:"Odeslat",submit:"Odeslat",reset:"Resetovat",refresh:"Obnovit",open:"Otev\u0159\xedt",close_window:"Zav\u0159\xedt okno",continue:"Pokra\u010dovat",finish:"Dokon\u010dit",start:"Za\u010d\xedt",stop:"Zastavit",pause:"Pauza",resume:"Pokra\u010dovat",select:"Vybrat",choose:"Vybrat",clear:"Vymazat",apply:"Pou\u017e\xedt",ok:"OK",yes:"Ano",no:"Ne",more:"Dal\u0161\xed",open_menu:"Otev\u0159\xedt menu",content_admin:"Spr\xe1va obsahu",play:"P\u0159ehr\xe1t",open_on_youtube:"Otev\u0159\xedt na YouTube"},message:{loading:"Na\u010d\xedt\xe1m...",saving:"Ukl\xe1d\xe1m...",saved:"Ulo\u017eeno",deleted:"Smaz\xe1no",updated:"Aktualizov\xe1no",created:"Vytvo\u0159eno",error_occurred:"Do\u0161lo k chyb\u011b",success_message:"Operace prob\u011bhla \xfasp\u011b\u0161n\u011b",confirm_delete:"Opravdu chcete smazat tuto polo\u017eku?",no_data_found:"\u017d\xe1dn\xe1 data nenalezena",network_error:"Chyba s\xedt\u011b",server_error:"Chyba serveru",validation_error:"Chyba validace",permission_denied:"P\u0159\xedstup zam\xedtnut",page_not_found:"Str\xe1nka nenalezena",session_expired:"Relace vypr\u0161ela",login_required:"Vy\u017eadov\xe1no p\u0159ihl\xe1\u0161en\xed",invalid_credentials:"Neplatn\xe9 p\u0159ihla\u0161ovac\xed \xfadaje",email_sent:"E-mail odesl\xe1n",email_error:"Chyba p\u0159i odes\xedl\xe1n\xed e-mailu",file_uploaded:"Soubor nahr\xe1n",file_error:"Chyba p\u0159i nahr\xe1v\xe1n\xed souboru",image_uploaded:"Obr\xe1zek nahr\xe1n",image_error:"Chyba p\u0159i nahr\xe1v\xe1n\xed obr\xe1zku"},footer:{articles:"\u010cl\xe1nky",matches:"Z\xe1pasy",table:"Tabulka",sponsors:"Sponzo\u0159i",contact:"Kontakt",cookies:"Cookies",terms:"Obchodn\xed podm\xednky",privacy:"Z\xe1sady ochrany osobn\xedch \xfadaj\u016f",eshop:"E\u2011shop",partners:"Na\u0161i partne\u0159i",follow_us:"Sledujte n\xe1s",copyright:"\xa9 {year} {club}. V\u0161echna pr\xe1va vyhrazena.",all_rights_reserved:"V\u0161echna pr\xe1va vyhrazena {year}",powered_by:"Str\xe1nku provozuje MyClub",powered_by_desc:"Profesion\xe1ln\xed webov\xe9 str\xe1nky pro sportovn\xed kluby",order_now:"Objednat",learn_more:"Zjistit v\xedce",quick_links:"Rychl\xe9 odkazy",contact_info:"Kontaktn\xed informace",address:"Adresa",phone:"Telefon",email:"E-mail",opening_hours:"Otev\xedrac\xed doba"},search:{title:"Vyhled\xe1v\xe1n\xed",description:"Prohled\xe1vejte kluby, z\xe1pasy, \u010dl\xe1nky, hr\xe1\u010de, akce a dal\u0161\xed obsah",placeholder:"Hledat...",search_button:"Vyhledat",search_error:"Chyba vyhled\xe1v\xe1n\xed",error_title:"Chyba p\u0159i vyhled\xe1v\xe1n\xed",no_results:"\u017d\xe1dn\xe9 v\xfdsledky",no_results_desc:'Pro dotaz "{query}" nebyly nalezeny \u017e\xe1dn\xe9 v\xfdsledky',try_different:"Zkuste jin\xe9 kl\xed\u010dov\xe9 slovo nebo hledejte obecn\u011bj\u0161\xed term\xedn",searching:"Hled\xe1m...",filters:"Filtry",results:"v\xfdsledky",search_hint:"Zadejte kl\xed\u010dov\xe1 slova pro vyhled\xe1v\xe1n\xed",loading:"Vyhled\xe1v\xe1m...",all:"V\u0161e",clubs:"Kluby",matches:"Z\xe1pasy",articles:"\u010cl\xe1nky",players:"Hr\xe1\u010di",events:"Akce",others:"Ostatn\xed",upcoming_matches:"Nadch\xe1zej\xedc\xed z\xe1pasy",past_matches:"Minul\xe9 z\xe1pasy",show_all_clubs:"Zobrazit v\u0161ech {count} klub\u016f",show_all_players:"Zobrazit v\u0161ech {count} hr\xe1\u010d\u016f",show_all_matches:"Zobrazit v\u0161echny z\xe1pasy",show_all_articles:"Zobrazit v\u0161ech {count} \u010dl\xe1nk\u016f",show_all_events:"Zobrazit v\u0161echny akce",no_clubs_found:"\u017d\xe1dn\xe9 kluby nenalezeny",no_matches_found:"\u017d\xe1dn\xe9 z\xe1pasy nenalezeny",no_articles_found:"\u017d\xe1dn\xe9 \u010dl\xe1nky nenalezeny",no_players_found:"\u017d\xe1dn\xed hr\xe1\u010di nenalezeni",no_events_found:"\u017d\xe1dn\xe9 akce nenalezeny",no_sponsors_found:"\u017d\xe1dn\xed sponzo\u0159i nenalezeni",no_contacts_found:"\u017d\xe1dn\xe9 kontakty nenalezeny",no_gallery_found:"\u017d\xe1dn\xe1 galerie nenalezena",no_categories_found:"\u017d\xe1dn\xe9 kategorie nenalezeny",teams:"T\xfdmy",sponsors:"Sponzo\u0159i",contacts:"Kontakty",gallery:"Galerie",photos:"fotek",no_other_results:"\u017d\xe1dn\xe9 dal\u0161\xed v\xfdsledky"},tables:{select_club:"Vyberte klub pro zobrazen\xed tabulky sout\u011b\u017ee.",loading_table:"Na\u010d\xedt\xe1m tabulku...",table_error:"Chyba p\u0159i na\u010d\xedt\xe1n\xed tabulky",rank:"#",team:"T\xfdm",played:"Z",wins:"V",draws:"R",losses:"P",score:"Sk\xf3re",points:"Body",position_place:"{{position}}. m\xedsto"},club_modal:{statistics:"Statistiky",matches_played:"Odehr\xe1no z\xe1pas\u016f",wins:"V\xfdhry",draws:"Rem\xedzy",losses:"Prohry",score:"Sk\xf3re",goals_scored:"Vst\u0159elen\xe9 g\xf3ly",goals_conceded:"Obdr\u017een\xe9 g\xf3ly",goal_difference:"Rozd\xedl sk\xf3re",points:"Body",form_last_5:"Forma (posledn\xedch 5 z\xe1pas\u016f)",close:"Zav\u0159\xedt"},calendar:{title:"Kalend\xe1\u0159",subtitle:"P\u0159ehled z\xe1pas\u016f podle sout\u011b\u017e\xed (FACR).",loading:"Na\u010d\xedt\xe1m rozpis\u2026",no_matches:"Zat\xedm nem\xe1me \u017e\xe1dn\xe9 z\xe1pasy k zobrazen\xed.",check_settings:"Zkontrolujte nastaven\xed klubu v administraci",all_competitions:"V\u0161echny sout\u011b\u017ee",month_view:"M\u011bs\xed\u010dn\xed pohled",week_view:"T\xfddenn\xed pohled",today:"Dnes",no_events:"\u017d\xe1dn\xe9 akce",match:"Z\xe1pas",event:"Akce",training:"Tr\xe9nink",competition:"Sout\u011b\u017e",venue:"M\xedsto kon\xe1n\xed",result:"V\xfdsledek",upcoming:"Nadch\xe1zej\xedc\xed",past:"Minul\xe9",activities_title:"Aktivity",activities_subtitle:"Kalend\xe1\u0159 tr\xe9nink\u016f, sch\u016fzek a dal\u0161\xedch klubov\xfdch aktivit.",all_types:"V\u0161echny typy",no_activities:"Zat\xedm nem\xe1me \u017e\xe1dn\xe9 aktivity k zobrazen\xed.",oldest_first:"Nejstar\u0161\xed prvn\xed",list_view:"Seznam",calendar_view:"Kalend\xe1\u0159",club:"Klub",matches_filter:"Z\xe1pasy",training_filter:"Tr\xe9ninky",meeting_filter:"Sch\u016fzky",other_filter:"Ostatn\xed",previous_month:"P\u0159edchoz\xed m\u011bs\xedc",next_month:"Dal\u0161\xed m\u011bs\xedc",loading_activities:"Na\u010d\xedt\xe1m aktivity\u2026",match_type:"Z\xe1pas",training_type:"Tr\xe9nink",meeting_type:"Sch\u016fzka",other_type:"Jin\xe9",more_events:"+{count} dal\u0161\xed\u2026",win:"V\xfdhra",draw:"Rem\xedza",loss:"Prohra",show_more:"+{count} dal\u0161\xed\u2026",show_less:"Zobrazit m\xe9n\u011b",show_past_matches:"Zobrazit p\u0159edchoz\xed z\xe1pasy ({count})",hide_past_matches:"Skr\xfdt p\u0159edchoz\xed z\xe1pasy"},players:{title:"Hr\xe1\u010di",search_placeholder:"Hledat jm\xe9no, \u010d\xedslo, pozici",gender:"Pohlav\xed",position:"Pozice",active_only:"Pouze aktivn\xed",male:"Mu\u017e",female:"\u017dena",loading_error:"Chyba p\u0159i na\u010d\xedt\xe1n\xed hr\xe1\u010d\u016f"},blog:{title:"Blog",search_articles:"Hledat \u010dl\xe1nky\u2026",search_match:"Hledat z\xe1pas\u2026",all_categories:"V\u0161echny kategorie",loading:"Na\u010d\xedt\xe1n\xed\u2026",category:"Kategorie",publish_date:"Datum publikace",read_time:"Doba \u010dten\xed",search_results:"V\xfdsledky hled\xe1n\xed \u010dl\xe1nk\u016f pro \u201e{query}\u201c.",category_articles:"\u010cl\xe1nky v kategorii {category}.",latest_articles:"Nejnov\u011bj\u0161\xed \u010dl\xe1nky, rozhovory a novinky z klubu.",match:"Z\xe1pas",subscribe:"P\u0159ihlaste se k odb\u011bru novinek",subscribe_description:"Budeme v\xe1s informovat o novink\xe1ch, z\xe1pasech a akc\xedch na\u0161eho klubu. Sou\u010dasn\u011b pro v\xe1s vytvo\u0159\xedme fanou\u0161kovsk\xfd \xfa\u010det a po\u0161leme heslo e\u2011mailem.",email_label:"V\xe1\u0161 e-mail",consent_text:"Odesl\xe1n\xedm formul\xe1\u0159e souhlas\xedte se zpracov\xe1n\xedm osobn\xedch \xfadaj\u016f. Z odb\u011bru se m\u016f\u017eete kdykoli odhl\xe1sit a nastaven\xed upravit v zaslan\xe9m e\u2011mailu. Heslo lze zm\u011bnit p\u0159es str\xe1nku pro obnoven\xed hesla.",subscribe_button:"Odeslat"},videos:{title:"Videa",description:"Sledujte na\u0161e nejnov\u011bj\u0161\xed videa a z\xe1pasy.",loading:"Na\u010d\xedt\xe1m videa...",watch_latest:"Sledujte na\u0161e nejnov\u011bj\u0161\xed videa a z\xe1pasy",all_from_youtube:"V\u0161echna videa jsou z YouTube",no_videos:"Zat\xedm nejsou k dispozici \u017e\xe1dn\xe1 videa",play:"P\u0159ehr\xe1t",youtube_channel:"YouTube kan\xe1l",open_on_youtube:"Otev\u0159\xedt na YouTube",more_videos:"V\xedce vide\xed"},sponsors:{title:"Na\u0161i partne\u0159i",main_partners:"Hlavn\xed partne\u0159i",partners:"Partne\u0159i",become_partner:"Sta\u0148te se partnerem klubu",partnership_description:"M\xe1te z\xe1jem o spolupr\xe1ci, reklamu nebo podporu klubu? Napi\u0161te n\xe1m p\xe1r informac\xed a my se v\xe1m ozveme zp\u011bt.",name_label:"Jm\xe9no a p\u0159\xedjmen\xed *",name_placeholder:"Jan Nov\xe1k",name_required:"Vypl\u0148te pros\xedm jm\xe9no",email_label:"E\u2011mail *",email_placeholder:"vas@email.cz",email_required:"Vypl\u0148te pros\xedm e\u2011mail",subject_label:"P\u0159edm\u011bt *",subject_placeholder:"Partnerstv\xed, reklama, podpora...",subject_required:"P\u0159edm\u011bt je povinn\xfd",message_label:"Zpr\xe1va *",message_placeholder:"Stru\u010dn\u011b n\xe1m napi\u0161te, o jakou spolupr\xe1ci m\xe1te z\xe1jem...",message_required:"Napi\u0161te pros\xedm kr\xe1tkou zpr\xe1vu",sending:"Odes\xedl\xe1m...",send_message:"Odeslat zpr\xe1vu",message_sent:"Zpr\xe1va odesl\xe1na",message_sent_desc:"D\u011bkujeme za zpr\xe1vu.",error_loading:"Chyba p\u0159i na\u010d\xedt\xe1n\xed sponzor\u016f",timeout_error:"Vypr\u0161el \u010dasov\xfd limit po\u017eadavku. Zkuste to pros\xedm znovu.",network_error:"Po\u017eadavek se nezda\u0159il (s\xed\u0165/CORS). Obnovte str\xe1nku a zkuste znovu.",send_error:"Odesl\xe1n\xed se nezda\u0159ilo",error_title:"Chyba"},contact:{title:"Kontakt",contact_info:"Kontaktn\xed \xfadaje",address:"Adresa",phone:"Telefon",email:"Email",contact_persons:"Kontaktn\xed osoby",others:"Ostatn\xed",no_contacts:"Pro tuto kategorii zat\xedm nem\xe1me kontaktn\xed osobu.",contact_us:"Kontaktujte n\xe1s",contact_description:"M\xe1te dotaz nebo p\u0159ipom\xednku? Napi\u0161te n\xe1m zpr\xe1vu a my se v\xe1m ozveme co nejd\u0159\xedve zp\u011bt.",name_label:"Jm\xe9no a p\u0159\xedjmen\xed *",name_placeholder:"Jan Nov\xe1k",name_required:"Toto pole je povinn\xe9",name_min_length:"Jm\xe9no mus\xed m\xedt alespo\u0148 2 znaky",email_label:"E-mailov\xe1 adresa *",email_placeholder:"vas@email.cz",email_required:"Toto pole je povinn\xe9",email_invalid:"Neplatn\xe1 e-mailov\xe1 adresa",subject_label:"P\u0159edm\u011bt",subject_placeholder:"P\u0159edm\u011bt zpr\xe1vy",subject_required:"P\u0159edm\u011bt je povinn\xfd",subject_max_length:"P\u0159edm\u011bt m\u016f\u017ee m\xedt maxim\xe1ln\u011b 100 znak\u016f",message_label:"Zpr\xe1va *",message_placeholder:"Napi\u0161te n\xe1m zpr\xe1vu...",message_required:"Toto pole je povinn\xe9",message_min_length:"Zpr\xe1va mus\xed m\xedt alespo\u0148 10 znak\u016f",message_max_length:"Zpr\xe1va m\u016f\u017ee m\xedt maxim\xe1ln\u011b 2000 znak\u016f",sending:"Odes\xedl\xe1m...",send_message:"Odeslat zpr\xe1vu",message_sent:"Zpr\xe1va odesl\xe1na",message_sent_desc:"D\u011bkujeme za va\u0161i zpr\xe1vu. Brzy se v\xe1m ozveme zp\u011bt.",timeout_error:"Vypr\u0161el \u010dasov\xfd limit po\u017eadavku. Zkuste to pros\xedm znovu za chv\xedli.",network_error:"Po\u017eadavek se nezda\u0159il (s\xed\u0165/CORS). Zkuste to znovu nebo obnovte str\xe1nku.",general_error:"N\u011bco se pokazilo. Zkuste to pros\xedm znovu pozd\u011bji."},matches:{title:"Z\xe1pasy",all_matches:"V\u0161echny z\xe1pasy",upcoming_matches:"Nadch\xe1zej\xedc\xed z\xe1pasy",past_matches:"Minul\xe9 z\xe1pasy",competition:"Sout\u011b\u017e",date:"Datum",time:"\u010cas",venue:"M\xedsto",result:"V\xfdsledek",score:"Sk\xf3re",report:"Report",details:"Detaily",no_matches:"\u017d\xe1dn\xe9 z\xe1pasy",load_more:"Na\u010d\xedst v\xedce",show_all:"Zobrazit v\u0161e",home_team:"Dom\xe1c\xed",away_team:"Host\xe9",versus:"vs",postponed:"P\u0159elo\u017eeno",oldest_first:"Nejstar\u0161\xed prvn\xed",newest_first:"Nejnov\u011bj\u0161\xed prvn\xed",no_matches_to_display:"\u017d\xe1dn\xe9 z\xe1pasy k zobrazen\xed",check_club_settings:"Zkontrolujte nastaven\xed klubu v administraci",played:"Odehr\xe1no",upcoming:"Nadch\xe1zej\xedc\xed",load_more_matches:"Na\u010d\xedst dal\u0161\xed z\xe1pasy",showing_matches:"Zobrazeno {shown} z {total} z\xe1pas\u016f",win:"V\xfdhra",draw:"Rem\xedza",loss:"Prohra",all_categories:"V\u0161echny kategorie",cancelled:"Zru\u0161eno"},gallery:{no_albums:"Zat\xedm nejsou k dispozici \u017e\xe1dn\xe1 alba",albums_will_appear:"Alba se zde zobraz\xed po jejich na\u010dten\xed ze Zonerama.",loading_albums:"Na\u010d\xedt\xe1m alba...",error_loading_albums:"Nepoda\u0159ilo se na\u010d\xedst alba",page_title:"Photos",page_description:"Prohl\xe9dn\u011bte si alba a fotografie na\u0161eho klubu.",photos_count:"{{count}} fotografi\xed",photos_count_one:"{{count}} fotografie",photos_count_few:"{{count}} fotografie",photos_count_many:"{{count}} fotografi\xed",photos_count_other:"{{count}} fotografi\xed",views_count:"{{count}} zhl\xe9dnut\xed",views_count_one:"{{count}} zhl\xe9dnut\xed",views_count_few:"{{count}} zhl\xe9dnut\xed",views_count_many:"{{count}} zhl\xe9dnut\xed",views_count_other:"{{count}} zhl\xe9dnut\xed",show_more_on_zonerama:"Zobrazit na Zonerama",latest_albums:"Nejnov\u011bj\u0161\xed alba z na\u0161ich akc\xed",view_all_albums:"Zobrazit v\u0161echna alba",album_not_found:"Album nenalezeno",error_loading_album:"Chyba p\u0159i na\u010d\xedt\xe1n\xed alba",back_to_gallery:"Zp\u011bt na galerii",loading_album:"Na\u010d\xedt\xe1m album...",view_on_zonerama:"Zobrazit na Zonerama",photos_from_zonerama:"\ud83d\udcf8 V\u0161echny fotografie jsou z platformy Zonerama",no_photos_in_album:"V tomto albu nejsou \u017e\xe1dn\xe9 fotografie.",view_original:"Zobrazit origin\xe1l",photo_modal_title:"Fotka"},auth:{login:"P\u0159ihl\xe1sit se",register:"Registrovat se",logout:"Odhl\xe1sit",forgot_password:"Zapomn\u011bli jste heslo?",reset_password:"Obnovit heslo",change_password:"Zm\u011bnit heslo",profile:"Profil",account:"\xda\u010det",sign_in:"P\u0159ihl\xe1sit se",sign_up:"Registrovat se",sign_out:"Odhl\xe1sit se",email:"E-mail",password:"Heslo",confirm_password:"Potvrdit heslo",old_password:"Star\xe9 heslo",new_password:"Nov\xe9 heslo",remember_me:"Zapamatovat si m\u011b",already_have_account:"Ji\u017e m\xe1te \xfa\u010det?",dont_have_account:"Nem\xe1te \xfa\u010det?",create_account:"Vytvo\u0159it \xfa\u010det",login_required:"Vy\u017eadov\xe1no p\u0159ihl\xe1\u0161en\xed",invalid_credentials:"Neplatn\xe9 p\u0159ihla\u0161ovac\xed \xfadaje",session_expired:"Relace vypr\u0161ela"},common:{welcome_message:"V\xedtejte v na\u0161em fotbalov\xe9m klubu",welcome_subtitle:"Ofici\xe1ln\xed str\xe1nky fotbalov\xe9ho klubu",club:"Klub",team:"T\xfdm",player:"Hr\xe1\u010d",players:"Hr\xe1\u010di",coach:"Tren\xe9r",staff:"T\xfdm",match:"Z\xe1pas",matches:"Z\xe1pasy",season:"Sez\xf3na",competition:"Sout\u011b\u017e",league:"Liga",cup:"Poh\xe1r",tournament:"Turnaj",training:"Tr\xe9nink",event:"Akce",events:"Akce",news:"Aktuality",article:"\u010cl\xe1nek",articles:"\u010cl\xe1nky",gallery:"Galerie",photo:"Fotka",photos:"Fotky",video:"Video",videos:"Videa",sponsor:"Sponzor",sponsors:"Sponzo\u0159i",partner:"Partner",partners:"Partne\u0159i",fan:"Fanou\u0161ek",fans:"Fanou\u0161ci",member:"\u010clen",members:"\u010clenov\xe9",contact:"Kontakt",address:"Adresa",phone:"Telefon",email:"E-mail",website:"Webov\xe9 str\xe1nky",facebook:"Facebook",instagram:"Instagram",youtube:"YouTube",twitter:"Twitter",linkedin:"LinkedIn",date:"Datum",time:"\u010cas",place:"M\xedsto",result:"V\xfdsledek",score:"Sk\xf3re",goals:"G\xf3ly",points:"Body",position:"Pozice",rank:"Po\u0159ad\xed",table:"Tabulka",standings:"Tabulka",schedule:"Program",calendar:"Kalend\xe1\u0159",archive:"Archiv",history:"Historie",statistics:"Statistiky",stats:"Statistiky",profile:"Profil",settings:"Nastaven\xed",account:"\xda\u010det",user:"U\u017eivatel",users:"U\u017eivatel\xe9",admin:"Administr\xe1tor",role:"Role",permission:"Opr\xe1vn\u011bn\xed",login:"P\u0159ihl\xe1\u0161en\xed",logout:"Odhl\xe1\u0161en\xed",password:"Heslo",register:"Registrace",signup:"Registrace",signin:"P\u0159ihl\xe1\u0161en\xed",signout:"Odhl\xe1\u0161en\xed",forgot_password:"Zapomn\u011bli jste heslo?",reset_password:"Obnovit heslo",change_password:"Zm\u011bnit heslo",old_password:"Star\xe9 heslo",new_password:"Nov\xe9 heslo",confirm_password:"Potvrdit heslo",first_name:"Jm\xe9no",last_name:"P\u0159\xedjmen\xed",full_name:"Cel\xe9 jm\xe9no",name:"N\xe1zev",title:"N\xe1zev",description:"Popis",content:"Obsah",category:"Kategorie",categories:"Kategorie",tag:"\u0160t\xedtek",tags:"\u0160t\xedtky",image:"Obr\xe1zek",images:"Obr\xe1zky",file:"Soubor",files:"Soubory",link:"Odkaz",url:"URL",read_time:"min \u010dten\xed",price:"Cena",cost:"Cena",amount:"\u010c\xe1stka",quantity:"Mno\u017estv\xed",size:"Velikost",weight:"V\xe1ha",color:"Barva",colors:"Barvy",type:"Typ",types:"Typy",status:"Stav",active:"Aktivn\xed",inactive:"Neaktivn\xed",enabled:"Povoleno",disabled:"Zak\xe1z\xe1no",visible:"Viditeln\xfd",hidden:"Skryt\xfd",public:"Ve\u0159ejn\xfd",private:"Soukrom\xfd",published:"Publikov\xe1no",draft:"Koncept",featured:"Doporu\u010den\xe9",new:"Nov\xe9",old:"Star\xe9",latest:"Nejnov\u011bj\u0161\xed",popular:"Popul\xe1rn\xed",recommended:"Doporu\u010den\xe9",all:"V\u0161e",none:"\u017d\xe1dn\xfd",other:"Ostatn\xed",more:"V\xedce",less:"M\xe9n\u011b",show:"Zobrazit",hide:"Skr\xfdt",expand:"Rozbalit",collapse:"Sbalit",search:"Hledat",filter:"Filtr",sort:"Se\u0159adit",order:"Po\u0159ad\xed",ascending:"Vzestupn\u011b",descending:"Sestupn\u011b",first:"Prvn\xed",last:"Posledn\xed",next:"Dal\u0161\xed",previous:"P\u0159edchoz\xed",page:"Str\xe1nka",pages:"Str\xe1nky",total:"Celkem",count:"Po\u010det",number:"\u010c\xedslo",index:"Index",id:"ID",code:"K\xf3d",key:"Kl\xed\u010d",value:"Hodnota",data:"Data",info:"Informace",details:"Detaily",summary:"Shrnut\xed",overview:"P\u0159ehled",list:"Seznam",grid:"M\u0159\xed\u017eka",graph:"Graf",map:"Mapa",location:"Lokace",country:"Zem\u011b",region:"Region",district:"Okres",zip:"PS\u010c",street:"Ulice",building:"Budova",floor:"Patro",room:"M\xedstnost",stadium:"Stadion",field:"H\u0159i\u0161t\u011b",pitch:"H\u0159i\u0161t\u011b",locker_room:"\u0160atna",office:"Kancel\xe1\u0159",shop:"Obchod",store:"Obchod",restaurant:"Restaurace",cafe:"Kav\xe1rna",parking:"Parkovi\u0161t\u011b",entrance:"Vchod",exit:"V\xfdchod",emergency_exit:"Nouzov\xfd v\xfdchod",toilet:"Toaleta",wc:"WC",men:"Mu\u017ei",women:"\u017deny",accessible:"Bezbari\xe9rov\xfd",wheelchair:"Invalidn\xed voz\xedk",elevator:"V\xfdtah",stairs:"Schody",ramp:"Rampa",door:"Dve\u0159e",window:"Okno",roof:"St\u0159echa",wall:"Ze\u010f",floor_surface:"Podlaha",ceiling:"Strop",lighting:"Osv\u011btlen\xed",heating:"Topen\xed",cooling:"Chlazen\xed",ventilation:"V\u011btr\xe1n\xed",security:"Bezpe\u010dnost",safety:"Bezpe\u010dnost",fire_safety:"Po\u017e\xe1rn\xed bezpe\u010dnost",first_aid:"Prvn\xed pomoc",emergency:"Nouzov\xe9",warning:"Varov\xe1n\xed",danger:"Nebezpe\u010d\xed",caution:"Opatrn\u011b",notice:"Ozn\xe1men\xed",information:"Informace",help:"Pomoc",support:"Podpora",tiktok:"TikTok",snapchat:"Snapchat",pinterest:"Pinterest",reddit:"Reddit",whatsapp:"WhatsApp",telegram:"Telegram",signal:"Signal",viber:"Viber",messenger:"Messenger",skype:"Skype",zoom:"Zoom",teams:"Teams",slack:"Slack",discord:"Discord",github:"GitHub",gitlab:"GitLab",bitbucket:"Bitbucket",language:"Jazyk",my_account:"M\u016fj \xfa\u010det"},engagement:{level:"\xdarove\u0148",points:"bod\u016f",progress:"Progres",achievements:"\xdasp\u011bchy",rewards:"Odm\u011bny"},newsletter:{email_preferences:"E-mailov\xe9 preference",subscribe:"P\u0159ihlaste se k odb\u011bru novinek",subscribe_description:"Budeme v\xe1s informovat o novink\xe1ch, z\xe1pasech a akc\xedch na\u0161eho klubu. Sou\u010dasn\u011b pro v\xe1s vytvo\u0159\xedme fanou\u0161kovsk\xfd \xfa\u010det a po\u0161leme heslo e\u2011mailem.",email_label:"V\xe1\u0161 e-mail",consent_text:"Odesl\xe1n\xedm formul\xe1\u0159e souhlas\xedte se zpracov\xe1n\xedm osobn\xedch \xfadaj\u016f. Z odb\u011bru se m\u016f\u017eete kdykoli odhl\xe1sit a nastaven\xed upravit v zaslan\xe9m e\u2011mailu. Heslo lze zm\u011bnit p\u0159es str\xe1nku pro obnoven\xed hesla.",subscribe_button:"Odeslat",subscribe_success:"P\u0159ihl\xe1\u0161en\xed k odb\u011bru prob\u011bhlo \xfasp\u011b\u0161n\u011b",subscribe_success_desc:"Vytvo\u0159ili jsme v\xe1m fanou\u0161kovsk\xfd \xfa\u010det a poslali e\u2011mail s heslem a odkazy pro spr\xe1vu newsletteru.",subscribe_error:"Chyba",subscribe_error_desc:"Nastala chyba p\u0159i p\u0159ihla\u0161ov\xe1n\xed k odb\u011bru",email_required:"E-mail je povinn\xfd",email_invalid:"Neplatn\xe1 e-mailov\xe1 adresa",loading:"Odes\xedl\xe1m..."},admin:{page_settings:"Nastaven\xed str\xe1nky"},about:{page_not_setup:"Tato str\xe1nka je\u0161t\u011b nen\xed nastavena. Zde je p\u0159ehled klubu, sout\u011b\u017e\xed a rubrik.",matches_by_competition:"Z\xe1pasy podle sout\u011b\u017e\xed",club_info:"Ofici\xe1ln\xed informace o klubu",meta_description:"Informace o na\u0161em klubu, sout\u011b\u017e\xedch, nadch\xe1zej\xedc\xedch z\xe1pasech a rubrik\xe1ch."}}},en:{translation:{nav:{home:"Home",matches:"Matches",calendar:"Calendar",tables:"Tables",players:"Players",gallery:"Photo Gallery",videos:"Videos",articles:"Articles",activities:"Activities",contact:"Contact",shop:"E-shop",sponsors:"Sponsors",club:"Club",news:"News",all_articles:"More articles",all_matches:"All matches",all_tables:"View all",login:"Login",register:"Register",admin:"Admin",logout:"Logout",view_all:"View all"},homepage:{nearest_matches:"Next matches",latest_news:"Latest news",latest_title:"Latest title",more_articles_home:"More articles",tables:"Tables",gallery:"Photo gallery",sponsors:"Partners",shop:"Fanshop",calendar:"Calendar",activities:"Activities",videos:"Videos",club:"Club",contact:"Contact",welcome_to_club:"Welcome to our football club",official_website:"Official club website",read_more:"Read more",view_all:"View all",next_match:"Next match",match_details:"Match details",competition:"Competition",venue:"Venue",result:"Result",standings:"Standings",position:"Pos.",team:"Team",points:"Points",played:"Played",won:"W",drawn:"D",lost:"L",goals:"Goals",goal_difference:"Diff",latest_results:"Latest results",upcoming_events:"Upcoming events",featured_articles:"Featured articles",more_articles:"More articles",photo_gallery:"Photo gallery",video_gallery:"Video gallery",our_partners:"Our partners",more_videos:"More videos",all_matches:"All matches",partner_categories:{general:"General partner",main:"Main partner",official:"Official partner",media:"Media partner",technical:"Technical partner",supplier:"Supplier"}},news:{no_news:"No news available yet.",view_all_news:"View all articles"},action:{save:"Save",edit:"Edit",delete:"Delete",add:"Add",create:"Create",update:"Update",cancel:"Cancel",confirm:"Confirm",close:"Close",back:"Back",next:"Next",previous:"Previous",search:"Search",filter:"Filter",sort:"Sort",loading:"Loading...",error:"Error",success:"Success",warning:"Warning",info:"Info",view:"View",download:"Download",upload:"Upload",share:"Share",copy:"Copy",send:"Send",submit:"Submit",reset:"Reset",refresh:"Refresh",open:"Open",close_window:"Close window",continue:"Continue",finish:"Finish",start:"Start",stop:"Stop",pause:"Pause",resume:"Resume",select:"Select",choose:"Choose",clear:"Clear",apply:"Apply",ok:"OK",yes:"Yes",no:"No",more:"More",open_menu:"Open menu",content_admin:"Content Admin",play:"Play",open_on_youtube:"Open on YouTube"},message:{loading:"Loading...",saving:"Saving...",saved:"Saved",deleted:"Deleted",updated:"Updated",created:"Created",error_occurred:"An error occurred",success_message:"Operation completed successfully",confirm_delete:"Are you sure you want to delete this item?",no_data_found:"No data found",network_error:"Network error",server_error:"Server error",validation_error:"Validation error",permission_denied:"Access denied",page_not_found:"Page not found",session_expired:"Session expired",login_required:"Login required",invalid_credentials:"Invalid credentials",email_sent:"Email sent",email_error:"Error sending email",file_uploaded:"File uploaded",file_error:"Error uploading file",image_uploaded:"Image uploaded",image_error:"Error uploading image"},footer:{articles:"Articles",matches:"Matches",table:"Table",sponsors:"Sponsors",contact:"Contact",cookies:"Cookies",terms:"Terms of Service",privacy:"Privacy Policy",eshop:"E\u2011shop",partners:"Our Partners",follow_us:"Follow Us",copyright:"\xa9 {year} {club}. All rights reserved.",all_rights_reserved:"All rights reserved {year}",powered_by:"Powered by MyClub",powered_by_desc:"Professional websites for sports clubs",order_now:"Order Now",learn_more:"Learn More",quick_links:"Quick Links",contact_info:"Contact Information",address:"Address",phone:"Phone",email:"Email",opening_hours:"Opening Hours"},search:{title:"Search",description:"Search clubs, matches, articles, players, events and more content",placeholder:"Search clubs, matches, articles, players, events...",search_button:"Search",search_error:"Search error",error_title:"Search error",no_results:"No results",no_results_desc:'No results found for query "{query}"',try_different:"Try different keywords or search for more general terms",search_hint:"Enter keywords to search",loading:"Searching...",all:"All",clubs:"Clubs",matches:"Matches",articles:"Articles",players:"Players",events:"Events",others:"Others",upcoming_matches:"Upcoming Matches",past_matches:"Past Matches",show_all_clubs:"Show all {count} clubs",show_all_players:"Show all {count} players",show_all_matches:"Show all matches",show_all_articles:"Show all {count} articles",show_all_events:"Show all events",no_clubs_found:"No clubs found",no_matches_found:"No matches found",no_articles_found:"No articles found",no_players_found:"No players found",no_events_found:"No events found",no_sponsors_found:"No sponsors found",no_contacts_found:"No contacts found",no_gallery_found:"No gallery found",no_categories_found:"No categories found",teams:"Teams",sponsors:"Sponsors",contacts:"Contacts",gallery:"Gallery",photos:"photos",no_other_results:"No other results"},tables:{title:"Tables",subtitle:"Official FACR tables by competition.",loading:"Loading tables\u2026",no_tables:"No tables available for this club.",schedule_link:"Schedule and competition details",rank:"#",team:"Team",played:"P",wins:"W",draws:"D",losses:"L",score:"Score",points:"Points",position_place:"{{position}}. place",select_club:"Select a club to view competition table.",loading_table:"Loading table...",table_error:"Error loading table"},club_modal:{statistics:"Statistics",matches_played:"Matches Played",wins:"Wins",draws:"Draws",losses:"Losses",score:"Score",goals_scored:"Goals Scored",goals_conceded:"Goals Conceded",goal_difference:"Goal Difference",points:"Points",form_last_5:"Form (Last 5 Matches)",close:"Close"},calendar:{title:"Calendar",subtitle:"Overview of matches by competition (FACR).",loading:"Loading schedule...",no_matches:"No matches to display yet.",check_settings:"Check club settings in administration",all_competitions:"All Matches",month_view:"Month View",week_view:"Week View",today:"Today",no_events:"No Events",match:"Match",event:"Event",training:"Training",competition:"Competition",venue:"Venue",result:"Result",upcoming:"Upcoming",past:"Past",activities_title:"Activities",activities_subtitle:"Training calendar, meetings and other club activities.",all_types:"All Types",no_activities:"No activities to display yet.",oldest_first:"Oldest First",list_view:"List",calendar_view:"Calendar",club:"Club",matches_filter:"Matches",training_filter:"Training",meeting_filter:"Meetings",other_filter:"Other",previous_month:"Previous Month",next_month:"Next Month",loading_activities:"Loading activities\u2026",match_type:"Match",training_type:"Training",meeting_type:"Meeting",other_type:"Other",more_events:"+{count} more\u2026",win:"Win",draw:"Draw",loss:"Loss",show_more:"+{count} more\u2026",show_less:"Show Less",show_past_matches:"Show Past Matches ({count})",hide_past_matches:"Hide Past Matches"},players:{title:"Players",search_placeholder:"Search name, number, position",gender:"Gender",position:"Position",active_only:"Active only",male:"Male",female:"Female",loading_error:"Error loading players"},blog:{title:"Blog",search_articles:"Search articles\u2026",search_match:"Search match\u2026",all_categories:"All Categories",loading:"Loading\u2026",category:"Category",publish_date:"Publish Date",read_time:"Read Time",search_results:"Search results for articles \u201e{query}\u201c.",category_articles:"Articles in category {category}.",latest_articles:"Latest articles, reviews and news from the club.",match:"Match",subscribe:"Subscribe to newsletter",subscribe_description:"We will inform you about news, matches and events of our club. We will also create a fan account for you and send a password by email.",email_label:"Your email",consent_text:"By submitting the form you agree to the processing of personal data. You can unsubscribe at any time and adjust the settings in the sent email. Password can be changed via the password recovery page.",subscribe_button:"Subscribe"},videos:{title:"Videos",description:"Watch our latest videos and matches.",loading:"Loading videos...",watch_latest:"Watch our latest videos and matches",all_from_youtube:"All videos are from YouTube",no_videos:"No videos available yet",play:"Play",youtube_channel:"YouTube Channel",open_on_youtube:"Open on YouTube",more_videos:"More videos"},sponsors:{title:"Our Partners",main_partners:"Main Partners",partners:"Partners",become_partner:"Become a Club Partner",partnership_description:"Interested in cooperation, advertising or club support? Write us some information and we'll get back to you.",name_label:"Name and Surname *",name_placeholder:"John Doe",name_required:"Please fill in your name",email_label:"E\u2011mail *",email_placeholder:"your@email.com",email_required:"Please fill in your e\u2011mail",subject_label:"Subject *",subject_placeholder:"Partnership, advertising, support...",subject_required:"Subject is required",message_label:"Message *",message_placeholder:"Briefly write us what kind of cooperation you're interested in...",message_required:"Please write a short message",sending:"Sending...",send_message:"Send Message",message_sent:"Message Sent",message_sent_desc:"Thank you for your message.",error_loading:"Error loading sponsors",timeout_error:"Request timed out. Please try again.",network_error:"Request failed (network/CORS). Refresh page and try again.",send_error:"Sending failed",error_title:"Error"},contact:{title:"Contact",contact_info:"Contact Information",address:"Address",phone:"Phone",email:"Email",contact_persons:"Contact Persons",others:"Others",no_contacts:"No contact person for this category yet.",contact_us:"Contact Us",contact_description:"Have a question or comment? Write us a message and we'll get back to you as soon as possible.",name_label:"Name and Surname *",name_placeholder:"John Doe",name_required:"This field is required",name_min_length:"Name must be at least 2 characters",email_label:"Email Address *",email_placeholder:"your@email.com",email_required:"This field is required",email_invalid:"Invalid email address",subject_label:"Subject",subject_placeholder:"Message subject",subject_required:"Subject is required",subject_max_length:"Subject can be maximum 100 characters",message_label:"Message *",message_placeholder:"Write us a message...",message_required:"This field is required",message_min_length:"Message must be at least 10 characters",message_max_length:"Message can be maximum 2000 characters",sending:"Sending...",send_message:"Send Message",message_sent:"Message Sent",message_sent_desc:"Thank you for your message. We'll get back to you soon.",timeout_error:"Request timed out. Please try again in a moment.",network_error:"Request failed (network/CORS). Try again or refresh page.",general_error:"Something went wrong. Please try again later."},matches:{title:"Matches",all_matches:"All Matches",upcoming_matches:"Upcoming Matches",past_matches:"Past Matches",competition:"Competition",date:"Date",time:"Time",venue:"Venue",result:"Result",score:"Score",report:"Report",details:"Details",no_matches:"No Matches",load_more:"Load More",show_all:"Show All",home_team:"Home",away_team:"Away",versus:"vs",postponed:"Postponed",oldest_first:"Oldest First",newest_first:"Newest First",no_matches_to_display:"No matches to display",check_club_settings:"Check club settings in administration",played:"Played",upcoming:"Upcoming",load_more_matches:"Load more matches",showing_matches:"Showing {shown} of {total} matches",win:"Win",draw:"Draw",loss:"Loss",all_categories:"All Categories",cancelled:"Cancelled"},gallery:{no_albums:"No albums available yet",albums_will_appear:"Albums will appear here after loading from Zonerama.",loading_albums:"Loading albums...",error_loading_albums:"Failed to load albums",page_title:"Photo Gallery",page_description:"Browse albums and photos of our club.",photos_count:"{{count}} photos",photos_count_one:"{{count}} photo",photos_count_few:"{{count}} photos",photos_count_many:"{{count}} photos",photos_count_other:"{{count}} photos",views_count:"{{count}} views",views_count_one:"{{count}} view",views_count_few:"{{count}} views",views_count_many:"{{count}} views",views_count_other:"{{count}} views",show_more_on_zonerama:"Show more on Zonerama",latest_albums:"Latest albums from our events",view_all_albums:"View all albums",album_not_found:"Album not found",error_loading_album:"Error loading album",back_to_gallery:"Back to gallery",loading_album:"Loading album...",view_on_zonerama:"View on Zonerama",photos_from_zonerama:"\ud83d\udcf8 All photos are from Zonerama platform",no_photos_in_album:"There are no photos in this album.",view_original:"View original",photo_modal_title:"Photo"},auth:{login:"Login",register:"Register",logout:"Logout",forgot_password:"Forgot Password?",reset_password:"Reset Password",change_password:"Change Password",profile:"Profile",account:"Account",sign_in:"Sign In",sign_up:"Sign Up",sign_out:"Sign Out",email:"Email",password:"Password",confirm_password:"Confirm Password",old_password:"Old Password",new_password:"New Password",remember_me:"Remember Me",already_have_account:"Already have an account?",dont_have_account:"Don't have an account?",create_account:"Create Account",login_required:"Login Required",invalid_credentials:"Invalid Credentials",session_expired:"Session Expired"},common:{welcome_message:"Welcome to our football club",welcome_subtitle:"Official website of the football club",club:"Club",team:"Team",player:"Player",players:"Players",coach:"Coach",staff:"Staff",match:"Match",matches:"Matches",season:"Season",competition:"Competition",league:"League",cup:"Cup",tournament:"Tournament",training:"Training",event:"Event",events:"Events",news:"News",article:"Article",articles:"Articles",gallery:"Gallery",photo:"Photo",photos:"Photos",video:"Video",videos:"Videos",sponsor:"Sponsor",sponsors:"Sponsors",partner:"Partner",partners:"Partners",fan:"Fan",fans:"Fans",member:"Member",members:"Members",contact:"Contact",address:"Address",phone:"Phone",email:"Email",website:"Website",facebook:"Facebook",instagram:"Instagram",youtube:"YouTube",twitter:"Twitter",linkedin:"LinkedIn",date:"Date",time:"Time",place:"Place",result:"Result",score:"Score",goals:"Goals",points:"Points",position:"Position",rank:"Rank",table:"Table",standings:"Standings",schedule:"Schedule",calendar:"Calendar",archive:"Archive",history:"History",statistics:"Statistics",stats:"Stats",profile:"Profile",settings:"Settings",account:"Account",user:"User",users:"Users",admin:"Admin",role:"Role",permission:"Permission",login:"Login",logout:"Logout",password:"Password",register:"Register",signup:"Sign up",signin:"Sign in",signout:"Sign out",forgot_password:"Forgot password?",reset_password:"Reset password",change_password:"Change password",old_password:"Old password",new_password:"New password",confirm_password:"Confirm password",first_name:"First name",last_name:"Last name",full_name:"Full name",name:"Name",title:"Title",description:"Description",content:"Content",category:"Category",categories:"Categories",tag:"Tag",tags:"Tags",image:"Image",images:"Images",file:"File",files:"Files",link:"Link",url:"URL",read_time:"min read",price:"Price",cost:"Cost",amount:"Amount",quantity:"Quantity",size:"Size",weight:"Weight",color:"Color",colors:"Colors",type:"Type",types:"Types",status:"Status",active:"Active",inactive:"Inactive",enabled:"Enabled",disabled:"Disabled",visible:"Visible",hidden:"Hidden",public:"Public",private:"Private",published:"Published",draft:"Draft",featured:"Featured",new:"New",old:"Old",latest:"Latest",popular:"Popular",recommended:"Recommended",all:"All",none:"None",other:"Other",more:"More",less:"Less",show:"Show",hide:"Hide",expand:"Expand",collapse:"Collapse",search:"Search",filter:"Filter",sort:"Sort",order:"Order",ascending:"Ascending",descending:"Descending",first:"First",last:"Last",next:"Next",previous:"Previous",page:"Page",pages:"Pages",total:"Total",count:"Count",number:"Number",index:"Index",id:"ID",code:"Code",key:"Key",value:"Value",data:"Data",info:"Info",details:"Details",summary:"Summary",overview:"Overview",list:"List",grid:"Grid",graph:"Graph",map:"Map",location:"Location",country:"Country",region:"Region",district:"District",zip:"ZIP",street:"Street",building:"Building",floor:"Floor",room:"Room",stadium:"Stadium",field:"Field",pitch:"Pitch",locker_room:"Locker room",office:"Office",shop:"Shop",store:"Store",restaurant:"Restaurant",cafe:"Cafe",parking:"Parking",entrance:"Entrance",exit:"Exit",emergency_exit:"Emergency exit",toilet:"Toilet",wc:"WC",men:"Men",women:"Women",accessible:"Accessible",wheelchair:"Wheelchair",elevator:"Elevator",stairs:"Stairs",ramp:"Ramp",door:"Door",window:"Window",roof:"Roof",wall:"Wall",floor_surface:"Floor",ceiling:"Ceiling",lighting:"Lighting",heating:"Heating",cooling:"Cooling",ventilation:"Ventilation",security:"Security",safety:"Safety",fire_safety:"Fire safety",first_aid:"First aid",emergency:"Emergency",warning:"Warning",danger:"Danger",caution:"Caution",notice:"Notice",information:"Information",help:"Help",support:"Support",tiktok:"TikTok",snapchat:"Snapchat",pinterest:"Pinterest",reddit:"Reddit",whatsapp:"WhatsApp",telegram:"Telegram",signal:"Signal",viber:"Viber",messenger:"Messenger",skype:"Skype",zoom:"Zoom",teams:"Teams",slack:"Slack",discord:"Discord",github:"GitHub",gitlab:"GitLab",bitbucket:"Bitbucket",language:"Language",my_account:"My Account"},engagement:{level:"Level",points:"points",progress:"Progress",achievements:"Achievements",rewards:"Rewards"},newsletter:{email_preferences:"Email Preferences",subscribe:"Subscribe to newsletter",subscribe_description:"We will inform you about news, matches and events of our club. We will also create a fan account for you and send the password by email.",email_label:"Your email",consent_text:"By submitting the form you agree to the processing of personal data. You can unsubscribe and manage settings at any time in the email sent. Password can be changed via the password reset page.",subscribe_button:"Submit",subscribe_success:"Newsletter subscription successful",subscribe_success_desc:"We have created a fan account for you and sent an email with password and links for newsletter management.",subscribe_error:"Error",subscribe_error_desc:"An error occurred while subscribing to newsletter",email_required:"Email is required",email_invalid:"Invalid email address"},admin:{page_settings:"Page settings"},about:{page_not_setup:"This page is not set up yet. Here is an overview of the club, competitions and categories.",matches_by_competition:"Matches by competition",club_info:"Official club information",meta_description:"Information about our club, competitions, upcoming matches and categories."}}}},ns:["translation"],defaultNS:"translation",interpolation:{escapeValue:!1,formatSeparator:",",format:function(e,t,n){return"uppercase"===t?e.toUpperCase():"lowercase"===t?e.toLowerCase():"currency"===t?new Intl.NumberFormat(n,{style:"currency",currency:"CZK"}).format(e):"date"===t?new Intl.DateTimeFormat(n).format(new Date(e)):e}},react:{useSuspense:!1,bindI18n:"languageChanged",bindI18nStore:"added removed",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transKeepBasicHtmlNodesFor:["br","strong","i","em","span"]}}).catch(e=>{console.error("i18n: Initialization failed:",e)}),o.Ay.on("languageChanged",e=>{try{localStorage.setItem("language",e),document.cookie="lang=".concat(e,"; max-age=").concat(31536e3,"; path=/")}catch(t){}});var s=n(3309),l=n(9043),c=n(29066),d=(n(52716),n(37018),n(89563),n(94706),n(51587),n(70947),n(80275),n(92955),n(75753),n(45662),n(98202),n(39140),n(8053),n(28465),n(1112),n(89818),n(29559),n(97122),n(33084),n(21718),n(1352),n(76484),n(78715),n(16349),n(71263),n(2836),n(90202),n(93873),n(7157),n(52332),n(33062),n(67658),n(60551),n(7296),n(1540),n(48620),n(88115),n(91957),n(35315),n(91776),n(82787),n(21122),n(25311),n(99356),n(77786),n(7553),n(16328),n(5195),n(27328),n(50896),n(36152),n(37752),n(92724),n(64979),n(98405),n(63225),n(62527),n(67407),n(21361),n(69158),n(85203),n(32545),n(64381),n(22210)),u=(n(16942),n(97399),n(78801)),h=n(35200);const m=()=>{const{confirm:e}=(0,h.G)();return(0,a.useEffect)(()=>{const t=t=>{var n;const a=null===(n=t.detail)||void 0===n?void 0:n.registration;a&&(async()=>{await e({title:"Aktualizace aplikace",message:"Nov\xe1 verze aplikace je k dispozici. Chcete aktualizovat?",confirmText:"Aktualizovat",cancelText:"Pozd\u011bji"})&&a.waiting&&(a.waiting.postMessage({type:"SKIP_WAITING"}),window.location.reload())})()};return window.addEventListener("sw-update-available",t),()=>{window.removeEventListener("sw-update-available",t)}},[e]),null};n(93368),n(73062),n(24391);var p=n(89379),x=n(22107),g=n(5371),v=n(39081),j=n(7189),b=n(34946),y=n(98662),f=n(70579);const k="cookie_consent",_={version:1,necessary:!0,preferences:!1,analytics:!1,marketing:!1,timestamp:(new Date).toISOString()},w=()=>{const[e,t]=(0,a.useState)(!1),[n,i]=(0,a.useState)(!1),[o,r]=(0,a.useState)(_);(0,a.useEffect)(()=>{try{const e=localStorage.getItem(k);if(e){const n=JSON.parse(e);r(n),t(!1)}else t(!0)}catch(e){t(!0)}},[]),(0,a.useEffect)(()=>{const e=e=>{i(!0),t(!0)};return window.addEventListener("cookie-consent-open",e),()=>{window.removeEventListener("cookie-consent-open",e)}},[]);const s=e=>{const n=(0,p.A)((0,p.A)({},e),{},{timestamp:(new Date).toISOString()});localStorage.setItem(k,JSON.stringify(n)),r(n),t(!1),i(!1),window.dispatchEvent(new CustomEvent("cookie-consent-change",{detail:n}))};return e?(0,f.jsx)(x.a,{role:"dialog","aria-live":"polite",position:"fixed",bottom:{base:4,md:6},left:"50%",transform:"translateX(-50%)",bg:"blackAlpha.800",color:"gray.100",zIndex:1e3,px:{base:4,md:6},py:{base:4,md:5},borderRadius:"xl",boxShadow:"xl",borderWidth:"1px",borderColor:"whiteAlpha.300",w:{base:"calc(100% - 2rem)",sm:"calc(100% - 3rem)",md:"auto"},maxW:"3xl",style:{backdropFilter:"blur(6px)"},children:(0,f.jsxs)(g.s,{align:"start",justify:"space-between",gap:6,wrap:"wrap",children:[(0,f.jsxs)(x.a,{maxW:{base:"100%",md:"75%"},children:[(0,f.jsxs)(v.E,{fontSize:"sm",mb:2,children:[(0,f.jsx)("span",{role:"img","aria-label":"cookie",children:"\ud83c\udf6a"})," ","Tento web pou\u017e\xedv\xe1 soubory cookies pro zaji\u0161t\u011bn\xed spr\xe1vn\xe9ho fungov\xe1n\xed (nezbytn\xe9) a za \xfa\u010delem vylep\u0161en\xed obsahu. O vybran\xfdch kategori\xedch rozhodujete vy. Podrobnosti najdete v\xa0",(0,f.jsx)(j.N,{href:"/pravidla-cookies",color:"blue.300",textDecoration:"underline",children:"Pravidlech cookies"}),"."]}),n&&(0,f.jsxs)(x.a,{mt:3,bg:"gray.800",borderRadius:"lg",p:4,borderWidth:"1px",borderColor:"gray.700",children:[(0,f.jsx)(v.E,{fontWeight:"semibold",mb:2,children:"Nastaven\xed preferenc\xed"}),(0,f.jsxs)(g.s,{direction:"column",gap:2,children:[(0,f.jsx)(b.S,{isChecked:!0,isDisabled:!0,children:(0,f.jsx)(v.E,{fontSize:"sm",children:"Nezbytn\xe9 cookies (v\u017edy aktivn\xed)"})}),(0,f.jsx)(b.S,{isChecked:!!o.preferences,onChange:e=>r(t=>(0,p.A)((0,p.A)({},t),{},{preferences:e.target.checked})),children:(0,f.jsx)(v.E,{fontSize:"sm",children:"Preferen\u010dn\xed cookies (nap\u0159. zapamatov\xe1n\xed voleb)"})}),(0,f.jsx)(b.S,{isChecked:!!o.analytics,onChange:e=>r(t=>(0,p.A)((0,p.A)({},t),{},{analytics:e.target.checked})),children:(0,f.jsx)(v.E,{fontSize:"sm",children:"Analytick\xe9 cookies (anonymn\xed m\u011b\u0159en\xed n\xe1v\u0161t\u011bvnosti)"})}),(0,f.jsx)(b.S,{isChecked:!!o.marketing,onChange:e=>r(t=>(0,p.A)((0,p.A)({},t),{},{marketing:e.target.checked})),children:(0,f.jsx)(v.E,{fontSize:"sm",children:"Marketingov\xe9 cookies"})}),(0,f.jsxs)(g.s,{gap:2,mt:2,wrap:"wrap",children:[(0,f.jsx)(y.$,{size:"sm",colorScheme:"blue",onClick:()=>s(o),children:"Ulo\u017eit nastaven\xed"}),(0,f.jsx)(y.$,{size:"sm",variant:"outline",onClick:()=>i(!1),children:"Zp\u011bt"})]})]})]})]}),(0,f.jsxs)(g.s,{gap:2,align:"center",wrap:"wrap",children:[(0,f.jsx)(y.$,{size:"sm",onClick:()=>i(e=>!e),variant:"ghost",children:"Nastavit"}),(0,f.jsx)(y.$,{size:"sm",onClick:()=>{s((0,p.A)({},_))},variant:"outline",colorScheme:"gray",children:"Odm\xedtnout nepovinn\xe9"}),(0,f.jsx)(y.$,{size:"sm",colorScheme:"blue",onClick:()=>{s((0,p.A)((0,p.A)({},_),{},{preferences:!0,analytics:!0,marketing:!0}))},children:"P\u0159ijmout v\u0161e"})]})]})}):null};var z=n(49367),S=n(46291),A=n(25189),C=n(57550);function E(){const[e,t]=(0,a.useState)(null),[n,i]=(0,a.useState)(null),{data:o}=(0,C.s)();(0,a.useEffect)(()=>{let e=!0;return S.Ay.get("/seo").then(n=>{e&&t(n.data)}).catch(()=>{}),()=>{e=!1}},[]),(0,a.useEffect)(()=>{o&&i({facebook:o.facebook_url,instagram:o.instagram_url,youtube:o.youtube_url})},[o]);const r=null===o||void 0===o?void 0:o.club_name,s=(null===e||void 0===e?void 0:e.site_title)&&e.site_title.trim()||r&&r.trim()||"MyClub",l=(null===e||void 0===e?void 0:e.site_description)&&e.site_description.trim()||(r?"Official ".concat(r," Website"):"Official MyClub Website"),c=(null===e||void 0===e?void 0:e.meta_keywords)||"",d=(null===e||void 0===e?void 0:e.default_og_image_url)||(null===o||void 0===o?void 0:o.club_logo_url)||"/logo512.png",u=(0,A.uq)(d)||d,h=(null===e||void 0===e?void 0:e.twitter_handle)||"",m=(null===e||void 0===e?void 0:e.canonical_base_url)||("undefined"!==typeof window?window.location.origin:""),p=[];if(h){const e=h.startsWith("@")?h.slice(1):h;p.push("https://twitter.com/".concat(e))}null!==n&&void 0!==n&&n.facebook&&p.push(n.facebook),null!==n&&void 0!==n&&n.instagram&&p.push(n.instagram),null!==n&&void 0!==n&&n.youtube&&p.push(n.youtube);const x=!1===(null===e||void 0===e?void 0:e.enable_indexing)?"noindex, nofollow":"index, follow";return(0,a.useEffect)(()=>{"undefined"!==typeof document&&s&&(document.title=s)},[s]),(0,f.jsxs)(z.mg,{defaultTitle:s,titleTemplate:"%s | ".concat(r||s),children:[(0,f.jsx)("title",{children:s}),(0,f.jsx)("meta",{name:"description",content:l}),c&&(0,f.jsx)("meta",{name:"keywords",content:c}),(0,f.jsx)("meta",{name:"robots",content:x}),(null===o||void 0===o?void 0:o.club_logo_url)&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("link",{rel:"icon",href:(0,A.uq)(o.club_logo_url)}),(0,f.jsx)("link",{rel:"shortcut icon",href:(0,A.uq)(o.club_logo_url)}),(0,f.jsx)("link",{rel:"apple-touch-icon",href:(0,A.uq)(o.club_logo_url)})]}),(0,f.jsx)("meta",{property:"og:type",content:"website"}),(0,f.jsx)("meta",{property:"og:title",content:s}),(0,f.jsx)("meta",{property:"og:description",content:l}),(0,f.jsx)("meta",{property:"og:image",content:u}),(0,f.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),h&&(0,f.jsx)("meta",{name:"twitter:site",content:h}),(0,f.jsx)("meta",{name:"twitter:title",content:s}),(0,f.jsx)("meta",{name:"twitter:description",content:l}),(0,f.jsx)("meta",{name:"twitter:image",content:u}),(null===e||void 0===e?void 0:e.canonical_base_url)&&(0,f.jsx)("link",{rel:"canonical",href:e.canonical_base_url}),m&&(0,f.jsx)("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"WebSite",url:m,name:s,potentialAction:{"@type":"SearchAction",target:"".concat(m,"/blog?q={search_term_string}"),"query-input":"required name=search_term_string"}})}),m&&(0,f.jsx)("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"Organization",url:m,name:s,logo:u,sameAs:p.length?p:void 0})})]})}var T=n(73216);const D=e=>{let{children:t,requiredRole:n}=e;const{isAuthenticated:i,isLoading:o,user:r}=(0,c.A)(),s=(0,T.zy)(),[l,u]=(0,a.useState)(!0),[h,m]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{const t=await(0,d.YA)();e&&m(!!t.requires_setup)}catch(t){e&&m(!1)}finally{e&&u(!1)}})(),()=>{e=!1}},[]),o||l?(0,f.jsx)("div",{children:"Na\u010d\xedt\xe1n\xed\u2026"}):h?(0,f.jsx)(T.C5,{to:"/setup",replace:!0}):i?n&&r&&r.role&&r.role!==n&&"admin"!==r.role?(0,f.jsx)(T.C5,{to:"/403",state:{from:s.pathname},replace:!0}):t:(0,f.jsx)(T.C5,{to:"/login",state:{from:s},replace:!0})};n(30161),n(5722),n(27793),n(78139),n(73278),n(58853),n(418),n(22192);var N=n(64963),R=(n(87904),n(49483));new l.E({defaultOptions:{queries:{staleTime:3e5,cacheTime:6e5,refetchOnWindowFocus:!1,refetchOnMount:!1,retry:1}}});const F=(0,s.oY)({config:{initialColorMode:"light",useSystemColorMode:!1},colors:{brand:{50:"#e6f7ff",100:"#b3e0ff",200:"#80caff",300:"#4db3ff",400:"#1a9cff",500:"var(--club-primary, #0b5cff)",600:"#0066cc",700:"#004d99",800:"#003366",900:"#001a33"}},semanticTokens:{colors:{"brand.primary":{default:"var(--club-primary, #0b5cff)"},"brand.secondary":{default:"var(--club-secondary, #ffd200)"},"brand.accent":{default:"var(--club-accent, #141414)"},"text.onPrimary":{default:"var(--club-text-on-primary, #ffffff)"},"bg.app":{default:"#f8f9fb",_dark:"#0f1115"},"text.app":{default:"#1a1a1a",_dark:"#e8eaf0"},"border.subtle":{default:"rgba(0,0,0,0.06)",_dark:"rgba(255,255,255,0.12)"},"bg.card":{default:"#ffffff",_dark:"#1a1d29"},"bg.elevated":{default:"#ffffff",_dark:"#242831"}}},styles:{global:{"html, body, #root":{height:"100%",fontFamily:"var(--font-body, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial)"},body:{bg:"bg.app",color:"text.app",lineHeight:1.5,fontFamily:"var(--font-body, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial)"},"h1, h2, h3, h4, h5, h6":{fontFamily:"var(--font-heading, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial)"},a:{transition:"color 0.2s ease"},"::selection":{background:"brand.accent",color:"black"}}},components:{Container:{baseStyle:{px:{base:4,md:6}},sizes:{"7xl":"88rem"}},Button:{baseStyle:{fontWeight:"700",borderRadius:"md",letterSpacing:"0.4px",_hover:{transform:"translateY(-1px)",boxShadow:"md"},_active:{transform:"translateY(0)"}},variants:{solid:{bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"}},outline:{border:"2px solid",borderColor:"brand.primary",color:"brand.primary",_hover:{bg:"rgba(0,0,0,0.02)"}},ghost:{color:"brand.secondary",_hover:{bg:"rgba(0,0,0,0.04)"}}}},Card:{baseStyle:{container:{borderRadius:"lg",boxShadow:"sm",overflow:"hidden",transition:"all 0.2s",borderWidth:"1px",borderColor:"border.subtle",_hover:{transform:"translateY(-4px)",boxShadow:"lg"}}}},Divider:{baseStyle:{borderColor:"border.subtle"}},Heading:{baseStyle:{fontFamily:"var(--font-heading, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial)"}},Text:{baseStyle:{fontFamily:"var(--font-body, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial)"}}},fonts:{heading:"var(--font-heading, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial)",body:"var(--font-body, Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial)"}});var P=n(68659),I=n(76659),M=n(80359),L=n(59781),W=n(35475);const U=new l.E({defaultOptions:{queries:{staleTime:3e5,cacheTime:6e5,refetchOnWindowFocus:!1,refetchOnMount:!1,retry:1}}}),O=()=>(0,f.jsx)(P.o,{h:"100vh",children:(0,f.jsxs)(x.a,{textAlign:"center",children:[(0,f.jsx)(I.y,{size:"xl",color:"brand.primary",thickness:"4px"}),(0,f.jsx)(x.a,{mt:4,fontSize:"sm",color:"gray.600",children:"Na\u010d\xedt\xe1n\xed..."})]})}),q=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,89563))),K=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,94706))),B=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,51587))),Z=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,70947))),V=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,80275))),H=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,92955))),$=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,75753))),J=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,45662))),G=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,98202))),X=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,39140))),Y=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,8053))),Q=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,28465))),ee=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,1112))),te=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,89818))),ne=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,29559))),ae=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,97122))),ie=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,33084))),oe=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,21718))),re=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,52716))),se=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,37018))),le=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,1352))),ce=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,76484))),de=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,78715))),ue=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,21361))),he=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,62527))),me=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,67407))),pe=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,16942))),xe=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,97399))),ge=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,73278))),ve=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,58853))),je=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,418))),be=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,22192))),ye=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,73062))),fe=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,24391))),ke=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,78139))),_e=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,27793))),we=(0,a.lazy)(()=>n.e(798).then(n.bind(n,78798))),ze=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,93368))),Se=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,30161))),Ae=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,5722))),Ce=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,16349))),Ee=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,71263))),Te=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,2836))),De=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,90202))),Ne=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,93873))),Re=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,7157))),Fe=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,52332))),Pe=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,33062))),Ie=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,67658))),Me=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,60551))),Le=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,7296))),We=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,1540))),Ue=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,48620))),Oe=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,88115))),qe=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,91957))),Ke=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,35315))),Be=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,91776))),Ze=(0,a.lazy)(()=>n.e(620).then(n.bind(n,49620))),Ve=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,82787))),He=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,21122))),$e=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,25311))),Je=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,99356))),Ge=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,77786))),Xe=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,7553))),Ye=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,63225))),Qe=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,5195))),et=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,69158))),tt=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,32545))),nt=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,64381))),at=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,16328))),it=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,27328))),ot=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,50896))),rt=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,92724))),st=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,64979))),lt=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,98405))),ct=(0,a.lazy)(()=>n.e(548).then(n.bind(n,64548))),dt=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,85203))),ut=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,36152))),ht=(0,a.lazy)(()=>Promise.resolve().then(n.bind(n,37752))),mt=(0,a.lazy)(()=>n.e(501).then(n.bind(n,35501))),pt=(0,a.lazy)(()=>n.e(266).then(n.bind(n,9266))),xt=(0,a.lazy)(()=>n.e(452).then(n.bind(n,72452))),gt=(0,a.lazy)(()=>n.e(791).then(n.bind(n,23791))),vt=(0,a.lazy)(()=>n.e(579).then(n.bind(n,46579))),jt=()=>((0,N.F)(),null),bt=()=>((()=>{const{data:e}=(0,C.s)();(0,a.useEffect)(()=>{const t=(null===e||void 0===e?void 0:e.font_heading)||(null===e||void 0===e?void 0:e.font_body);let a;t&&(a=(0,R.QY)(t),!a)&&(a=n(49483).qE.find(e=>e.heading===t||e.body===t||e.id===t)),a||(a=(0,R.Tu)()),(0,R.Iu)(a)},[null===e||void 0===e?void 0:e.font_heading,null===e||void 0===e?void 0:e.font_body])})(),null),yt=e=>{let{children:t}=e;const{isAuthenticated:n,isLoading:i,user:o}=(0,c.A)(),[r,s]=(0,a.useState)(!0),[l,u]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{let e=!0;return(async()=>{try{const t=await(0,d.YA)();e&&u(!!t.requires_setup)}catch(t){e&&u(!1)}finally{e&&s(!1)}})(),()=>{e=!1}},[]),i||r)return(0,f.jsx)(O,{});if(n){const e=null===o||void 0===o?void 0:o.role;return"admin"===e?(0,f.jsx)(T.C5,{to:"/admin",replace:!0}):"editor"===e?(0,f.jsx)(T.C5,{to:"/admin/clanky",replace:!0}):(0,f.jsx)(T.C5,{to:"/",replace:!0})}const h=window.location.pathname;return l&&"/setup"!==h?(0,f.jsx)(T.C5,{to:"/setup",replace:!0}):(0,f.jsx)(f.Fragment,{children:t})},ft=()=>(0,f.jsx)(T.sv,{}),kt=()=>{const{user:e}=(0,c.A)(),t=String((null===e||void 0===e?void 0:e.role)||"").toLowerCase();return"admin"===t||"editor"===t?(0,f.jsx)(Ce,{}):(0,f.jsx)(T.C5,{to:"/403",replace:!0})},_t=()=>{const{data:e,isLoading:t}=(0,C.s)();return t&&!e?(0,f.jsx)(O,{}):null!==e&&void 0!==e&&e.premium?(0,f.jsx)(B,{}):(0,f.jsx)(q,{})},wt=()=>{const{data:e,isLoading:t}=(0,C.s)();return t&&!e?(0,f.jsx)(O,{}):null!==e&&void 0!==e&&e.premium?(0,f.jsx)(Z,{}):(0,f.jsx)(K,{})},zt=()=>{const{data:e,isLoading:t}=(0,C.s)();return t&&!e?(0,f.jsx)(O,{}):null!==e&&void 0!==e&&e.premium?(0,f.jsx)(V,{}):(0,f.jsx)(ke,{})},St=()=>(0,f.jsx)(M.s,{theme:F,children:(0,f.jsx)(L.Ht,{client:U,children:(0,f.jsx)(W.Kd,{children:(0,f.jsx)(c.O,{children:(0,f.jsx)(u.n,{children:(0,f.jsxs)(z.vd,{children:[(0,f.jsx)(jt,{}),(0,f.jsx)(bt,{}),(0,f.jsx)(E,{}),(0,f.jsxs)(h.s,{children:[(0,f.jsx)(m,{}),(0,f.jsx)(a.Suspense,{fallback:(0,f.jsx)(O,{}),children:(0,f.jsxs)(T.BV,{children:[(0,f.jsx)(T.qh,{path:"/",element:(0,f.jsx)(_t,{})}),(0,f.jsx)(T.qh,{path:"/hledat",element:(0,f.jsx)(ve,{})}),(0,f.jsx)(T.qh,{path:"/search",element:(0,f.jsx)(ve,{})}),(0,f.jsx)(T.qh,{path:"/overlay/scoreboard",element:(0,f.jsx)(ye,{})}),(0,f.jsx)(T.qh,{path:"/overlay/sponsors",element:(0,f.jsx)(fe,{})}),(0,f.jsx)(T.qh,{path:"/i18n-test",element:(0,f.jsx)(we,{})}),(0,f.jsx)(T.qh,{path:"/blog",element:(0,f.jsx)(wt,{})}),(0,f.jsx)(T.qh,{path:"/klub",element:(0,f.jsx)(G,{})}),(0,f.jsx)(T.qh,{path:"/o-klubu",element:(0,f.jsx)(ue,{})}),(0,f.jsx)(T.qh,{path:"/kalendar",element:(0,f.jsx)(X,{})}),(0,f.jsx)(T.qh,{path:"/aktivity",element:(0,f.jsx)(de,{})}),(0,f.jsx)(T.qh,{path:"/tabulky",element:(0,f.jsx)(Y,{})}),(0,f.jsx)(T.qh,{path:"/zapasy",element:(0,f.jsx)(Q,{})}),(0,f.jsx)(T.qh,{path:"/players",element:(0,f.jsx)(ee,{})}),(0,f.jsx)(T.qh,{path:"/hraci",element:(0,f.jsx)(ee,{})}),(0,f.jsx)(T.qh,{path:"/players/:id",element:(0,f.jsx)(te,{})}),(0,f.jsx)(T.qh,{path:"/hraci/:id",element:(0,f.jsx)(te,{})}),(0,f.jsx)(T.qh,{path:"/sponzori",element:(0,f.jsx)(ne,{})}),(0,f.jsx)(T.qh,{path:"/kontakt",element:(0,f.jsx)(ae,{})}),(0,f.jsx)(T.qh,{path:"/ankety",element:(0,f.jsx)(be,{})}),(0,f.jsx)(T.qh,{path:"/galerie",element:(0,f.jsx)(ie,{})}),(0,f.jsx)(T.qh,{path:"/galerie/album/:id",element:(0,f.jsx)(oe,{})}),(0,f.jsx)(T.qh,{path:"/videa",element:(0,f.jsx)(ge,{})}),(0,f.jsx)(T.qh,{path:"/obleceni",element:(0,f.jsx)(je,{})}),(0,f.jsx)(T.qh,{path:"/pravidla-cookies",element:(0,f.jsx)(ze,{})}),(0,f.jsx)(T.qh,{path:"/obchodni-podminky",element:(0,f.jsx)(Se,{})}),(0,f.jsx)(T.qh,{path:"/zasady-ochrany-osobnich-udaju",element:(0,f.jsx)(Ae,{})}),(0,f.jsx)(T.qh,{path:"/news",element:(0,f.jsx)(T.C5,{to:"/blog",replace:!0})}),(0,f.jsx)(T.qh,{path:"/news/:slug",element:(0,f.jsx)(H,{})}),(0,f.jsx)(T.qh,{path:"/articles/slug/:slug",element:(0,f.jsx)(H,{})}),(0,f.jsx)(T.qh,{path:"/articles/:id",element:(0,f.jsx)(H,{})}),(0,f.jsx)(T.qh,{path:"/zapas/:id",element:(0,f.jsx)(J,{})}),(0,f.jsx)(T.qh,{path:"/aktivita/:id",element:(0,f.jsx)($,{})}),(0,f.jsx)(T.qh,{path:"/clanky",element:(0,f.jsx)(T.C5,{to:"/blog",replace:!0})}),(0,f.jsx)(T.qh,{path:"/aktuality",element:(0,f.jsx)(T.C5,{to:"/blog",replace:!0})}),(0,f.jsx)(T.qh,{path:"/setup",element:(0,f.jsx)(yt,{children:(0,f.jsx)(he,{})})}),(0,f.jsx)(T.qh,{path:"/setup/styl",element:(0,f.jsx)(yt,{children:(0,f.jsx)(me,{})})}),(0,f.jsx)(T.qh,{path:"/login",element:(0,f.jsx)(yt,{children:(0,f.jsx)(re,{})})}),(0,f.jsx)(T.qh,{path:"/register",element:(0,f.jsx)(yt,{children:(0,f.jsx)(se,{})})}),(0,f.jsx)(T.qh,{path:"/forgot-password",element:(0,f.jsx)(le,{})}),(0,f.jsx)(T.qh,{path:"/reset-password",element:(0,f.jsx)(ce,{})}),(0,f.jsx)(T.qh,{path:"/newsletter/unsubscribe/:email",element:(0,f.jsx)(pe,{})}),(0,f.jsx)(T.qh,{path:"/newsletter/preferences",element:(0,f.jsx)(xe,{})}),(0,f.jsx)(T.qh,{path:"/403",element:(0,f.jsx)(_e,{})}),(0,f.jsx)(T.qh,{path:"/semiadmin",element:(0,f.jsx)(D,{children:(0,f.jsx)(lt,{})})}),(0,f.jsx)(T.qh,{path:"/admin",element:(0,f.jsx)(D,{children:(0,f.jsx)(kt,{})})}),(0,f.jsxs)(T.qh,{element:(0,f.jsx)(D,{requiredRole:"editor",children:(0,f.jsx)(ft,{})}),children:[(0,f.jsx)(T.qh,{path:"/admin/clanky",element:(0,f.jsx)(Ee,{})}),(0,f.jsx)(T.qh,{path:"/admin/aktivity",element:(0,f.jsx)(Ke,{})}),(0,f.jsx)(T.qh,{path:"/admin/shortlinks",element:(0,f.jsx)(at,{})}),(0,f.jsx)(T.qh,{path:"/admin/tymy",element:(0,f.jsx)(Re,{})}),(0,f.jsx)(T.qh,{path:"/admin/zapasy",element:(0,f.jsx)(De,{})}),(0,f.jsx)(T.qh,{path:"/admin/hraci",element:(0,f.jsx)(Ne,{})}),(0,f.jsx)(T.qh,{path:"/admin/aliasy-soutezi",element:(0,f.jsx)(We,{})}),(0,f.jsx)(T.qh,{path:"/admin/o-klubu",element:(0,f.jsx)(He,{})}),(0,f.jsx)(T.qh,{path:"/admin/videa",element:(0,f.jsx)(Oe,{})}),(0,f.jsx)(T.qh,{path:"/admin/galerie",element:(0,f.jsx)(qe,{})}),(0,f.jsx)(T.qh,{path:"/admin/scoreboard",element:(0,f.jsx)(tt,{})}),(0,f.jsx)(T.qh,{path:"/admin/scoreboard/remote",element:(0,f.jsx)(nt,{})})]}),(0,f.jsxs)(T.qh,{element:(0,f.jsx)(D,{requiredRole:"admin",children:(0,f.jsx)(ft,{})}),children:[(0,f.jsx)(T.qh,{path:"/admin/docs",element:(0,f.jsx)(et,{})}),(0,f.jsx)(T.qh,{path:"/admin/eshop-produkty",element:(0,f.jsx)(Ze,{})}),(0,f.jsx)(T.qh,{path:"/admin/obleceni",element:(0,f.jsx)(Be,{})}),(0,f.jsx)(T.qh,{path:"/admin/sponzori",element:(0,f.jsx)(Te,{})}),(0,f.jsx)(T.qh,{path:"/admin/uzivatele",element:(0,f.jsx)(Me,{})}),(0,f.jsx)(T.qh,{path:"/admin/bannery",element:(0,f.jsx)(Fe,{})}),(0,f.jsx)(T.qh,{path:"/admin/zpravy",element:(0,f.jsx)(Pe,{})}),(0,f.jsx)(T.qh,{path:"/admin/nastaveni",element:(0,f.jsx)(Ie,{})}),(0,f.jsx)(T.qh,{path:"/admin/newsletter",element:(0,f.jsx)(Le,{})}),(0,f.jsx)(T.qh,{path:"/admin/ankety",element:(0,f.jsx)(Ye,{})}),(0,f.jsx)(T.qh,{path:"/admin/prefetch",element:(0,f.jsx)(Ue,{})}),(0,f.jsx)(T.qh,{path:"/admin/users/send-reset",element:(0,f.jsx)(Ve,{})}),(0,f.jsx)(T.qh,{path:"/admin/analytika",element:(0,f.jsx)($e,{})}),(0,f.jsx)(T.qh,{path:"/admin/errors",element:(0,f.jsx)(ct,{})}),(0,f.jsx)(T.qh,{path:"/admin/soubory",element:(0,f.jsx)(Je,{})}),(0,f.jsx)(T.qh,{path:"/admin/kontakty",element:(0,f.jsx)(Ge,{})}),(0,f.jsx)(T.qh,{path:"/admin/navigace",element:(0,f.jsx)(Xe,{})}),(0,f.jsx)(T.qh,{path:"/admin/komentare",element:(0,f.jsx)(Qe,{})}),(0,f.jsx)(T.qh,{path:"/admin/shortlinks",element:(0,f.jsx)(at,{})}),(0,f.jsx)(T.qh,{path:"/admin/engagement",element:(0,f.jsx)(it,{})}),(0,f.jsx)(T.qh,{path:"/admin/sweepstakes",element:(0,f.jsx)(ot,{})}),(0,f.jsx)(T.qh,{path:"/admin/sweepstakes/:id/visual",element:(0,f.jsx)(rt,{})}),(0,f.jsx)(T.qh,{path:"/admin/i18n",element:(0,f.jsx)(st,{})}),(0,f.jsx)(T.qh,{path:"/admin/manual-data",element:(0,f.jsx)(dt,{})}),(0,f.jsx)(T.qh,{path:"/admin/financial-dashboard",element:(0,f.jsx)(ut,{})}),(0,f.jsx)(T.qh,{path:"/admin/qr-codes",element:(0,f.jsx)(ht,{})}),(0,f.jsx)(T.qh,{path:"/admin/expenses",element:(0,f.jsx)(mt,{})}),(0,f.jsx)(T.qh,{path:"/admin/invoices",element:(0,f.jsx)(pt,{})}),(0,f.jsx)(T.qh,{path:"/admin/invoice-settings",element:(0,f.jsx)(xt,{})}),(0,f.jsx)(T.qh,{path:"/admin/customers",element:(0,f.jsx)(gt,{})}),(0,f.jsx)(T.qh,{path:"/admin/tickets",element:(0,f.jsx)(vt,{})})]}),(0,f.jsx)(T.qh,{path:"/dashboard",element:(0,f.jsx)(T.C5,{to:"/admin",replace:!0})}),(0,f.jsx)(T.qh,{path:"/admin/sponsors",element:(0,f.jsx)(D,{requiredRole:"admin",children:(0,f.jsx)(Te,{})})}),(0,f.jsx)(T.qh,{path:"/admin/banners",element:(0,f.jsx)(D,{requiredRole:"admin",children:(0,f.jsx)(Fe,{})})}),(0,f.jsx)(T.qh,{path:"/admin/messages",element:(0,f.jsx)(D,{requiredRole:"admin",children:(0,f.jsx)(Pe,{})})}),(0,f.jsx)(T.qh,{path:"/admin/settings",element:(0,f.jsx)(D,{requiredRole:"admin",children:(0,f.jsx)(Ie,{})})}),(0,f.jsx)(T.qh,{path:"*",element:(0,f.jsx)(zt,{})})]})}),(0,f.jsx)(w,{})]})]})})})})})});var At=n(38025);const Ct=e=>{e&&e instanceof Function&&n.e(453).then(n.bind(n,46453)).then(t=>{let{getCLS:n,getFID:a,getFCP:i,getLCP:o,getTTFB:r}=t;n(e),a(e),i(e),o(e),r(e)})},Et=Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function Tt(e,t){navigator.serviceWorker.register(e).then(e=>{e.onupdatefound=()=>{const n=e.installing;null!=n&&(n.onstatechange=()=>{"installed"===n.state&&(navigator.serviceWorker.controller?(console.log("New content available; please refresh."),t&&t.onUpdate&&t.onUpdate(e)):(console.log("Content cached for offline use."),t&&t.onSuccess&&t.onSuccess(e)))})}}).catch(e=>{console.error("Error during service worker registration:",e)})}var Dt=n(35436);class Nt extends a.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){(0,Dt.N)({message:e.message,stack:e.stack,component:"ErrorBoundary",context:{react:t.componentStack}}),console.error("Error caught by ErrorBoundary:",e,t)}render(){return this.state.hasError?(0,f.jsxs)("div",{style:{padding:"20px",fontFamily:"Arial, sans-serif"},children:[(0,f.jsx)("h2",{children:"Something went wrong."}),(0,f.jsx)("p",{children:"Please refresh the page or try again later."})]}):this.props.children}}(0,Dt.k)(),window.addEventListener("unhandledrejection",e=>{const t=e.reason,n="string"===typeof t?t:(null===t||void 0===t?void 0:t.message)||"Unhandled rejection",a="object"===typeof t&&(null===t||void 0===t?void 0:t.stack)||"";(0,Dt.N)({message:n,stack:a})});const Rt=document.getElementById("root");if(Rt)try{var Ft,Pt,It,Mt,Lt,Wt,Ut,Ot;const e=document.documentElement;let t=null;try{const e=localStorage.getItem("club_theme_cache");if(e){t=JSON.parse(e);Date.now()-(t.timestamp||0)>864e5&&(t=null)}}catch(Kt){}e.style.setProperty("--club-primary",(null===(Ft=t)||void 0===Ft?void 0:Ft.primary)||"#0b5cff"),e.style.setProperty("--club-secondary",(null===(Pt=t)||void 0===Pt?void 0:Pt.secondary)||"#ffd200"),e.style.setProperty("--club-accent",(null===(It=t)||void 0===It?void 0:It.accent)||"#141414"),e.style.setProperty("--club-text-on-primary",(null===(Mt=t)||void 0===Mt?void 0:Mt.textOnPrimary)||"#ffffff"),null!==(Lt=t)&&void 0!==Lt&&Lt.textOnSecondary&&e.style.setProperty("--club-text-on-secondary",t.textOnSecondary),null!==(Wt=t)&&void 0!==Wt&&Wt.textOnAccent&&e.style.setProperty("--club-text-on-accent",t.textOnAccent),e.style.setProperty("--club-bg-light",(null===(Ut=t)||void 0===Ut?void 0:Ut.background)||"#ffffff"),e.style.setProperty("--club-text-light",(null===(Ot=t)||void 0===Ot?void 0:Ot.text)||"#000000");const n=document.createElement("link");n.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@600;700;800&display=swap",n.rel="stylesheet",document.head.appendChild(n);i.createRoot(document.getElementById("root")).render((0,f.jsx)(a.StrictMode,{children:(0,f.jsx)(z.vd,{children:(0,f.jsxs)(Nt,{children:[(0,f.jsx)(At.m,{initialColorMode:F.config.initialColorMode}),(0,f.jsx)(St,{})]})})}));const o=(()=>{try{const e=localStorage.getItem("cookie_consent");return e?JSON.parse(e):null}catch(e){return null}})();null!==o&&void 0!==o&&o.analytics,qt=e=>{null!==e&&void 0!==e&&e.analytics},window.addEventListener("cookie-consent-change",e=>{const t=e.detail;qt(t||{})})}catch(Bt){Rt.innerHTML='\n <div style="padding: 20px; font-family: Arial, sans-serif; color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb; border-radius: 4px;">\n <h2>Application Error</h2>\n <p>'.concat(String(Bt),"</p>\n <p>Please check the console for more details and refresh the page.</p>\n </div>\n ")}else;var qt;Ct(),function(e){if("serviceWorker"in navigator){if(new URL("",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{const t="".concat("","/service-worker.js");Et?(!function(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(n=>{const a=n.headers.get("content-type");404===n.status||null!=a&&-1===a.indexOf("javascript")?navigator.serviceWorker.ready.then(e=>{e.unregister().then(()=>{window.location.reload()})}):Tt(e,t)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}(t,e),navigator.serviceWorker.ready.then(()=>{console.log("Service worker is ready in development mode")})):Tt(t,e)})}}({onUpdate:function(e){try{const t=new CustomEvent("sw-update-available",{detail:{registration:e}});window.dispatchEvent(t)}catch(t){e.waiting&&(e.waiting.postMessage({type:"SKIP_WAITING"}),window.location.reload())}}})},46291:(e,t,n)=>{n.d(t,{API_URL:()=>c,Ay:()=>m,FH:()=>d,V6:()=>h});var a=n(89379),i=n(79722),o=n(35436),r=n(71860),s=n(44847);function l(e){try{return localStorage.getItem(e)}catch(t){return null}}let c=("undefined"!==typeof window?l("fc_api_base_url")||l("api_base_url"):null)||"/api/v1";try{const e=new URL(c,"undefined"!==typeof window?window.location.origin:void 0);/\/api\//.test(e.pathname)||(e.pathname=e.pathname.replace(/\/$/,"")+"/api/v1"),c=e.toString()}catch(p){}const d=i.A.create({baseURL:c,headers:(0,a.A)((0,a.A)({},{}),{}),withCredentials:!0,timeout:2e4});let u=null;d.interceptors.request.use(async e=>{e.metadata=(0,a.A)((0,a.A)({},e.metadata),{},{start:Date.now()});const t=(0,r.gf)();e.headers=e.headers||{},t&&(e.headers.Authorization="Bearer ".concat(t));const n=(e.method||"get").toLowerCase(),i="post"===n||"put"===n||"patch"===n||"delete"===n,o=!!e.headers.Authorization;if(i&&!o){const t=await async function(){try{const e=Date.now();if(u&&e-u.fetchedAt<27e5)return u.token;const t=await fetch("".concat(c.replace(/\/$/,""),"/csrf-token"),{credentials:"include",headers:{Accept:"application/json"}});if(!t.ok)return null;const n=await t.json(),a=(null===n||void 0===n?void 0:n.csrf_token)||null;return a&&(u={token:a,fetchedAt:e}),a}catch(e){return null}}();t&&(e.headers["X-CSRF-Token"]=t)}return e},e=>Promise.reject(e)),d.interceptors.response.use(e=>e,e=>{var t;try{var n;const t=null===e||void 0===e||null===(n=e.response)||void 0===n?void 0:n.status;try{var a;const n=(null===e||void 0===e?void 0:e.config)||{},i=((null===n||void 0===n?void 0:n.method)||"get").toUpperCase(),o=(null===n||void 0===n?void 0:n.url)||"",r=null===n||void 0===n||null===(a=n.metadata)||void 0===a?void 0:a.start,l="number"===typeof r?Date.now()-r:void 0;(0,s.d)({type:"request",at:Date.now(),method:i,url:o,status:t,ms:l,ok:!1})}catch(m){}if("number"===typeof t&&t>=500){var i,r,l,c,d,u;const n=(null===(i=e.config)||void 0===i?void 0:i.url)||"",a=((null===(r=e.config)||void 0===r?void 0:r.method)||"get").toUpperCase(),s=(null===(l=e.response)||void 0===l||null===(c=l.headers)||void 0===c?void 0:c["x-request-id"])||(null===(d=e.response)||void 0===d||null===(u=d.headers)||void 0===u?void 0:u["X-Request-ID"]);(0,o.N)({message:"HTTP ".concat(t," ").concat(a," ").concat(n),status:t,method:a,url:n,request_id:s})}}catch(p){}if(401===(null===(t=e.response)||void 0===t?void 0:t.status)){var h;const t=(null===(h=e.config)||void 0===h?void 0:h.url)||"",n=t.endsWith("/auth/login")||t.includes("/auth/login"),a=t.endsWith("/upload")||t.includes("/upload");n||a||"/login"!==window.location.pathname&&(window.location.href="/login")}return Promise.reject(e)}),d.interceptors.response.use(e=>{try{var t;const n=e.config||{},a=((null===n||void 0===n?void 0:n.method)||"get").toUpperCase(),i=(null===n||void 0===n?void 0:n.url)||"",o=null===n||void 0===n||null===(t=n.metadata)||void 0===t?void 0:t.start,r="number"===typeof o?Date.now()-o:void 0,l=e.status;(0,s.d)({type:"request",at:Date.now(),method:a,url:i,status:l,ms:r,ok:!0})}catch(n){}return e});const h=async e=>(await d.post("/upload",e,{headers:{"Content-Type":"multipart/form-data"}})).data,m=d},46367:(e,t,n)=>{n.d(t,{A:()=>h});n(65043);var a=n(22107),i=n(44093),o=n(33572),r=n(82846),s=n(33192),l=n(91765),c=n(75780),d=n(22205),u=n(70579);const h=e=>{let{src:t,alt:n,size:h="48px",previewSize:m="300px",borderRadius:p="md",objectFit:x="cover"}=e;const g=(0,i.dU)("gray.200","gray.700"),v=(0,i.dU)("white","gray.800");return(0,u.jsxs)(r.A,{trigger:"hover",placement:"right",openDelay:200,closeDelay:100,children:[(0,u.jsx)(c.W,{children:(0,u.jsx)(a.a,{cursor:"pointer",transition:"all 0.2s",_hover:{transform:"scale(1.05)",boxShadow:"md"},children:(0,u.jsx)(o._,{src:t,alt:n,boxSize:h,objectFit:x,borderRadius:p,borderWidth:"1px",borderColor:g,fallbackSrc:"/dist/img/logo-club-empty.svg",loading:"lazy"})})}),(0,u.jsx)(d.Z,{children:(0,u.jsx)(l.h,{width:m,borderColor:g,boxShadow:"2xl",bg:v,_focus:{boxShadow:"2xl"},children:(0,u.jsx)(s.e,{p:0,children:(0,u.jsx)(o._,{src:t,alt:"".concat(n," - preview"),width:"100%",maxH:"400px",objectFit:"contain",borderRadius:"md",fallbackSrc:"/dist/img/logo-club-empty.svg",loading:"lazy"})})})})]})}},47021:(e,t,n)=>{n.d(t,{Ec:()=>l,Lg:()=>o,TD:()=>s,mj:()=>r});var a=n(46291),i=n(85369);const o=async e=>(await a.Ay.get("/page-elements",{params:{page_type:e}})).data||[],r=async e=>(await a.Ay.post("/admin/page-elements/batch",e)).data,s=[{name:"style-pack",label:"Styl bal\xed\u010dek",description:"Glob\xe1ln\xed vizu\xe1ln\xed bal\xed\u010dek pro celou str\xe1nku",icon:i.$ZR,category:"layout",defaultVariant:"default"},{name:"container",label:"\u0160\xed\u0159ka str\xe1nky",description:"Celkov\xe1 \u0161\xed\u0159ka rozlo\u017een\xed (boxed / pln\xe1 \u0161\xed\u0159ka)",icon:i.vgu,category:"layout",defaultVariant:"boxed"},{name:"header",label:"Hlavi\u010dka",description:"Hlavi\u010dka str\xe1nky s logem a navigac\xed",icon:i.O6N,category:"layout",defaultVariant:"unified"},{name:"hero-topbar",label:"Klub li\u0161ta nad hero",description:"Pruh nad hero s logem klubu, n\xe1zvem a akcemi",icon:i.$ZR,category:"layout",defaultVariant:"minimal"},{name:"hero",label:"Hlavn\xed Sekce",description:"Hlavn\xed obsahov\xe1 oblast s \xfavodn\xedm obsahem",icon:i.RBv,category:"layout",defaultVariant:"grid"},{name:"footer",label:"Pati\u010dka",description:"Spodn\xed \u010d\xe1st str\xe1nky s odkazy a kontakty",icon:i.Iz3,category:"layout",defaultVariant:"standard"},{name:"sidebar",label:"Bo\u010dn\xed Panel",description:"Bo\u010dn\xed sloupec s dopl\u0148kov\xfdm obsahem",icon:i.vgu,category:"layout",defaultVariant:"right"},{name:"banner",label:"Banner",description:"Reklamn\xed nebo informa\u010dn\xed banner",icon:i.O5k,category:"layout",defaultVariant:"top"},{name:"news",label:"Novinky",description:"Nejnov\u011bj\u0161\xed \u010dl\xe1nky a zpr\xe1vy",icon:i.Nhm,category:"content",defaultVariant:"grid_one"},{name:"matches",label:"Z\xe1pasy",description:"Nadch\xe1zej\xedc\xed a posledn\xed z\xe1pasy",icon:i.i0U,category:"content",defaultVariant:"compact"},{name:"matches-slider",label:"Z\xe1pasy (slider)",description:"P\u0159ehled z\xe1pas\u016f podle sout\u011b\u017ee ve slideru",icon:i.i0U,category:"content",defaultVariant:"carousel"},{name:"team",label:"T\xfdm",description:"Hr\xe1\u010di a realiza\u010dn\xed t\xfdm",icon:i.YXz,category:"content",defaultVariant:"grid"},{name:"table",label:"Tabulka",description:"Ligov\xe1 tabulka",icon:i.ist,category:"content",defaultVariant:"split_news"},{name:"stats",label:"Statistiky",description:"T\xfdmov\xe9 a hr\xe1\u010dsk\xe9 statistiky",icon:i.YYR,category:"content",defaultVariant:"cards"},{name:"activities",label:"Akce",description:"Nadch\xe1zej\xedc\xed ud\xe1losti a aktivity",icon:i.bfZ,category:"content",defaultVariant:"list"},{name:"sponsors",label:"Partne\u0159i",description:"Loga a odkazy partner\u016f",icon:i.DDN,category:"content",defaultVariant:"grid"},{name:"merch",label:"Fanshop",description:"Prodej klubov\xe9ho zbo\u017e\xed",icon:i.umw,category:"content",defaultVariant:"grid"},{name:"testimonials",label:"Reference",description:"Hodnocen\xed a ohlasy fanou\u0161k\u016f",icon:i.hYw,category:"content",defaultVariant:"carousel"},{name:"achievements",label:"\xdasp\u011bchy",description:"Trofeje a ocen\u011bn\xed klubu",icon:i.SBv,category:"content",defaultVariant:"timeline"},{name:"history",label:"Historie",description:"Historie a miln\xedky klubu",icon:i.hko,category:"content",defaultVariant:"timeline"},{name:"gallery",label:"Galerie",description:"Photos",icon:i.kQE,category:"media",defaultVariant:"grid"},{name:"videos",label:"Videa",description:"YouTube videa a sest\u0159ihy",icon:i.HiP,category:"media",defaultVariant:"carousel"},{name:"live",label:"Live Stream",description:"\u017div\xe9 p\u0159enosy z\xe1pas\u016f",icon:i.Uhg,category:"media",defaultVariant:"featured"},{name:"podcast",label:"Podcast",description:"Zvukov\xe9 podcasty a koment\xe1\u0159e",icon:i._G3,category:"media",defaultVariant:"list"},{name:"social",label:"Soci\xe1ln\xed S\xedt\u011b",description:"P\u0159\xedsp\u011bvky ze soci\xe1ln\xedch s\xedt\xed",icon:i.amN,category:"media",defaultVariant:"grid"},{name:"newsletter",label:"Newsletter",description:"Formul\xe1\u0159 pro odb\u011br novinek",icon:i.L2J,category:"interactive",defaultVariant:"default"},{name:"contact",label:"Kontakt",description:"Kontaktn\xed formul\xe1\u0159",icon:i.dRU,category:"interactive",defaultVariant:"form"},{name:"countdown",label:"Odpo\u010det",description:"Odpo\u010det do p\u0159\xed\u0161t\xedho z\xe1pasu",icon:i.lhZ,category:"interactive",defaultVariant:"default"},{name:"poll",label:"Anketa",description:"Hlasov\xe1n\xed a ankety pro fanou\u0161ky",icon:i.l2R,category:"interactive",defaultVariant:"vertical"},{name:"quiz",label:"Kv\xedz",description:"Interaktivn\xed kv\xedzy",icon:i.gZZ,category:"interactive",defaultVariant:"card"},{name:"search",label:"Vyhled\xe1v\xe1n\xed",description:"Vyhled\xe1vac\xed pole",icon:i.KSO,category:"interactive",defaultVariant:"header"},{name:"map",label:"Mapa",description:"Mapa stadionu a are\xe1lu",icon:i.ZYm,category:"interactive",defaultVariant:"default"},{name:"calendar",label:"Kalend\xe1\u0159",description:"Kalend\xe1\u0159 z\xe1pas\u016f a akc\xed",icon:i.gUT,category:"interactive",defaultVariant:"month"},{name:"weather",label:"Po\u010das\xed",description:"Informace o po\u010das\xed na stadionu",icon:i.vZy,category:"interactive",defaultVariant:"widget"},{name:"ticketing",label:"Vstupenky",description:"Prodej a rezervace vstupenek",icon:i.tVd,category:"interactive",defaultVariant:"widget"}],l={"style-pack":[{value:"default",label:"V\xfdchoz\xed",description:"Z\xe1kladn\xed sjednocen\xfd styl"},{value:"modern",label:"Modern\xed",description:"Zaoblen\xe9 rohy, lehk\xe9 st\xedny, v\xedce prostoru"},{value:"minimal",label:"Minimal",description:"\u010cist\xe9, bez st\xedn\u016f, tenk\xe9 r\xe1me\u010dky"},{value:"sparta",label:"Sparta",description:"P\u0159ibl\xed\u017een\xed k Sparta packu"}],container:[{value:"boxed",label:"Boxovan\xe9 rozlo\u017een\xed",description:"Obsah je zarovn\xe1n na st\u0159ed s odsazen\xedm od okraj\u016f"},{value:"wide",label:"\u0160ir\u0161\xed obsah",description:"O n\u011bco \u0161ir\u0161\xed hlavn\xed obsah (nap\u0159. pro v\u011bt\u0161\xed monitory)"},{value:"fullwidth",label:"Na celou \u0161\xed\u0159ku",description:"Obsah p\u0159es celou \u0161\xed\u0159ku okna, bez bo\u010dn\xedch okraj\u016f"}],header:[{value:"unified",label:"Jednotn\xfd",description:"Klasick\xe1 hlavi\u010dka s logem a navigac\xed"},{value:"edge",label:"Okrajov\xfd",description:"Modern\xed hlavi\u010dka s gradientem"},{value:"minimal",label:"Minim\xe1ln\xed",description:"\u010cist\xfd minimalistick\xfd design"},{value:"modern",label:"Modern\xed",description:"Odv\xe1\u017en\xfd modern\xed styl s akcenty"},{value:"sticky",label:"P\u0159ilepen\xfd",description:"Pevn\u011b p\u0159ilepen\xe1 hlavi\u010dka p\u0159i scrollov\xe1n\xed"},{value:"transparent",label:"Pr\u016fhledn\xfd",description:"Pr\u016fhledn\xe1 hlavi\u010dka s efektem"},{value:"sparta_navbar",label:"Sparta Navbar",description:"AC Sparta Praha styl - burger menu, logo, navigace, vyhled\xe1v\xe1n\xed"},{value:"current",label:"Sou\u010dasn\xfd",description:"St\xe1vaj\xedc\xed navigace"},{value:"fullwidth",label:"\u0160\xed\u0159ka 100%",description:"Navigace p\u0159es celou \u0161\xed\u0159ku obrazovky"}],"hero-topbar":[{value:"brand",label:"Brand",description:"Barevn\xe1 li\u0161ta s klubov\xfdmi barvami a akcemi"},{value:"minimal",label:"Minimal",description:"Pr\u016fhledn\xe1/nen\xe1padn\xe1 li\u0161ta"},{value:"badge",label:"Badge",description:"Pill styl s klubovou barvou"}],hero:[{value:"grid",label:"M\u0159\xed\u017eka",description:"Rozlo\u017een\xed ve form\u011b m\u0159\xed\u017eky"},{value:"swiper",label:"Karusel",description:"Posuvn\xfd karusel"},{value:"swiper_full",label:"Cel\xfd Karusel",description:"Celoobrazovkov\xfd karusel"},{value:"edge",label:"Okrajov\xfd",description:"Modern\xed okrajov\xfd styl"},{value:"video",label:"Video",description:"Hero s pozad\xedm videa"},{value:"split",label:"Rozd\u011blen\xfd",description:"Rozd\u011blen\xe9 rozlo\u017een\xed text/obraz"},{value:"featured_sidebar",label:"Zv\xfdrazn\u011bn\xfd + Sidebar",description:"Velk\xfd \u010dl\xe1nek vlevo + 4 \u010dl\xe1nky vpravo. Kategorie: BLOG/T\xddM. Tla\u010d\xedtko: P\u0158EHR\xc1T. Sidebar link: V\xcdCE NOVINEK. P\u0159ekr\xfdv\xe1 se s nadch\xe1zej\xedc\xedm z\xe1pasem"},{value:"sparta_featured_carousel",label:"Sparta Featured Carousel",description:"Hero header s pozad\xedm, \u010dl\xe1nek s kategoriemi, thumbnail navigace, auto-swap"}],news:[{value:"grid_one",label:"M\u0159\xed\u017eka (1 sloupec)",description:"Jednosloupcov\xe1 m\u0159\xed\u017eka bez tabulek vpravo (skryje sekci Tabulky)"},{value:"grid_two",label:"M\u0159\xed\u017eka (2 sloupce)",description:"Aktuality vlevo a Tabulky vpravo (pokud jsou k dispozici)"},{value:"grid",label:"M\u0159\xed\u017eka",description:"Rozlo\u017een\xed karet v m\u0159\xed\u017ece"},{value:"scroller",label:"Posuvn\xedk",description:"Horizont\xe1ln\xed posuvn\xedk"},{value:"hero_carousel",label:"Hero Karusel",description:"Jeden \u010dl\xe1nek najednou. Tla\u010d\xedtko: ZJISTIT V\xcdCE (vlevo dole). Numerace: 01 02 03 (vpravo dole). Auto-swap"},{value:"featured_sidebar",label:"Zv\xfdrazn\u011bn\xfd + Sidebar",description:"Velk\xfd \u010dl\xe1nek vlevo + 4 \u010dl\xe1nky vpravo. Kategorie: BLOG/NOVINKY. Tla\u010d\xedtko: P\u0158EHR\xc1T/\u010c\xcdST V\xcdCE. Link: V\xcdCE NOVINEK"},{value:"list",label:"Seznam",description:"Vertik\xe1ln\xed seznam"},{value:"magazine",label:"Magaz\xedn",description:"Stylizace jako \u010dasopis"},{value:"masonry",label:"Zdivo",description:"Pinterest styl zdiva"},{value:"timeline",label:"\u010casov\xe1 Osa",description:"Chronologick\xe1 \u010dasov\xe1 osa"}],matches:[{value:"compact",label:"Kompaktn\xed",description:"Kompaktn\xed karty z\xe1pas\u016f - jeden sloupec (slider + taby dole)"},{value:"compact_split",label:"Kompaktn\xed Rozd\u011blen\xfd",description:"Kompaktn\xed karty z\xe1pas\u016f - dva sloupce (slider vlevo + taby vpravo)"},{value:"expanded",label:"Roz\u0161\xed\u0159en\xfd",description:"Detailn\xed informace o z\xe1pasech"},{value:"timeline",label:"\u010casov\xe1 Osa",description:"Zobrazen\xed \u010dasov\xe9 osy"},{value:"calendar",label:"Kalend\xe1\u0159",description:"Kalend\xe1\u0159n\xed zobrazen\xed"},{value:"live",label:"\u017div\u011b",description:"\u017div\xe9 v\xfdsledky"},{value:"scoreboard",label:"Tabule",description:"TV broadcast style - velk\xe1 tabule sk\xf3re s live aktualizacemi"},{value:"ticker",label:"Ticker",description:"Scrolluj\xedc\xed ticker s v\xfdsledky a nadch\xe1zej\xedc\xedmi z\xe1pasy"}],"matches-slider":[{value:"carousel",label:"Karusel",description:"Horizont\xe1ln\xed karusel z\xe1pas\u016f"},{value:"scroller",label:"Posuvn\xedk",description:"Plynul\xfd horizont\xe1ln\xed posuvn\xedk"},{value:"ticker",label:"Ticker",description:"\xdazk\xfd ticker v\xfdsledk\u016f a z\xe1pas\u016f"},{value:"compact_split",label:"Kompaktn\xed rozd\u011blen\xfd",description:"Slider vlevo a taby jako svisl\xe9 menu vpravo"}],sponsors:[{value:"grid",label:"M\u0159\xed\u017eka",description:"M\u0159\xed\u017ekov\xe9 rozlo\u017een\xed"},{value:"slider",label:"Posuvn\xedk",description:"Animovan\xfd posuvn\xedk"},{value:"scroller",label:"Horizont\xe1ln\xed",description:"Horizont\xe1ln\xed posuvn\xedk"},{value:"logos3",label:"Horizont\xe1ln\xed (Logos3)",description:"Minimalistick\xfd horizont\xe1ln\xed scroller ve stylu shadcn/ui Logos3"},{value:"pyramid",label:"Pyramida",description:"Pyramidov\xe9 rozlo\u017een\xed"},{value:"wall",label:"Ze\u010f",description:"Ze\u010f partner\u016f"},{value:"tiered",label:"Vrstven\xfd",description:"\xdarovn\u011b partner\u016f - Hlavn\xed / Zlat\xed / St\u0159\xedbrn\xed / Bronzov\xed"},{value:"spotlight",label:"Spotlight",description:"Velk\xfd hlavn\xed partner + men\u0161\xed partne\u0159i okolo"},{value:"sparta_partners_pyramid",label:"Sparta Partners Pyramid",description:"T\u0159\xed-\xfarov\u0148ov\xe1 pyramida partner\u016f (1 hlavn\xed / 4 st\u0159edn\xed / v\xedce mal\xfdch)"}],gallery:[{value:"grid",label:"M\u0159\xed\u017eka",description:"Fotom\u0159\xed\u017eka"},{value:"masonry",label:"Zdivo",description:"Pinterest styl"},{value:"slider",label:"Posuvn\xedk",description:"Slideshow prezentace"},{value:"lightbox",label:"Lightbox",description:"Otev\u0159en\xed v lightboxu"},{value:"collage",label:"Kol\xe1\u017e",description:"Kreativn\xed kol\xe1\u017e"},{value:"featured_grid",label:"Zv\xfdrazn\u011bn\xe1 + M\u0159\xed\u017eka",description:"Velk\xe1 hlavn\xed fotka vlevo + mal\xe9 fotky vpravo v m\u0159\xed\u017ece"},{value:"stories",label:"Stories",description:"Instagram-style stories kruhov\xe9 thumbnaily s full-screen view"}],videos:[{value:"grid",label:"M\u0159\xed\u017eka",description:"Video m\u0159\xed\u017eka"},{value:"featured",label:"Zv\xfdrazn\u011bn\xe9",description:"Hlavn\xed video + seznam"},{value:"carousel",label:"Karusel",description:"Video karusel"},{value:"playlist",label:"Playlist",description:"Playlist styl"},{value:"highlight_reel",label:"Sest\u0159ih",description:"TV broadcast style - hlavn\xed sest\u0159ih + kategorie (G\xf3ly, Z\xe1kroky, Highlights)"},{value:"channel",label:"Kan\xe1l",description:"YouTube channel style s playlists a navigac\xed"},{value:"sparta_horizontal_slider",label:"Sparta Horizontal Slider",description:"Horizont\xe1ln\xed posuvn\xedk s kartami, UNLIMITED odznaky, prev/next tla\u010d\xedtka, drag support"}],team:[{value:"grid",label:"M\u0159\xed\u017eka",description:"Karty hr\xe1\u010d\u016f v m\u0159\xed\u017ece"},{value:"list",label:"Seznam",description:"Seznam hr\xe1\u010d\u016f"},{value:"carousel",label:"Karusel",description:"Posuvn\xfd karusel"},{value:"auto_scroller",label:"Auto Scroller",description:"Horizont\xe1ln\xed auto-scroll. Jm\xe9no hr\xe1\u010de + \u010d\xedslo dresu + odkaz. Taby: MU\u017dI / \u017dENY. Fotky hr\xe1\u010d\u016f na pozad\xed"},{value:"table",label:"Tabulka",description:"Tabulkov\xe9 zobrazen\xed"},{value:"hierarchy",label:"Hierarchie",description:"Organiza\u010dn\xed hierarchie"},{value:"formation",label:"Rozestaven\xed",description:"Fotbalov\xe9 rozestaven\xed na h\u0159i\u0161ti (4-4-2, 4-3-3, atd.)"},{value:"depth_chart",label:"Hloubka K\xe1dru",description:"Pozice s hlavn\xedmi hr\xe1\u010di a n\xe1hradn\xedky"},{value:"sparta_tabs_stats",label:"Sparta Tabs & Stats",description:"Tabovan\xfd v\xfdb\u011br t\xfdmu s fotkou, statistikami a CTA tla\u010d\xedtky (Koupit dres, Detail t\xfdmu)"}],activities:[{value:"list",label:"Seznam",description:"Seznam ud\xe1lost\xed"},{value:"calendar",label:"Kalend\xe1\u0159",description:"Kalend\xe1\u0159n\xed zobrazen\xed"},{value:"timeline",label:"\u010casov\xe1 Osa",description:"Zobrazen\xed \u010dasov\xe9 osy"},{value:"cards",label:"Karty",description:"Kartov\xe9 rozlo\u017een\xed"},{value:"featured_event",label:"Zv\xfdrazn\u011bn\xe1 Akce",description:"Velk\xe1 hlavn\xed akce + men\u0161\xed nadch\xe1zej\xedc\xed akce"},{value:"countdown_grid",label:"Odpo\u010det + M\u0159\xed\u017eka",description:"Odpo\u010det k nejbli\u017e\u0161\xed akci + m\u0159\xed\u017eka dal\u0161\xedch akc\xed"}],newsletter:[{value:"default",label:"V\xfdchoz\xed",description:"Standardn\xed formul\xe1\u0159"},{value:"popup",label:"Vyskakovac\xed",description:"Vyskakovac\xed okno"},{value:"inline",label:"Vlo\u017een\xfd",description:"Vlo\u017een\xfd minim\xe1ln\xed"},{value:"sidebar",label:"Bo\u010dn\xed",description:"Bo\u010dn\xed panel"},{value:"banner",label:"Banner",description:"Sticky top banner s minimalistick\xfdm formul\xe1\u0159em"},{value:"hero_cta",label:"Hero CTA",description:"Velk\xfd call-to-action s benefity (Z\xedskejte exkluzivn\xed obsah, slevy...)"}],social:[{value:"grid",label:"M\u0159\xed\u017eka",description:"M\u0159\xed\u017eka p\u0159\xedsp\u011bvk\u016f"},{value:"sidebar",label:"Bo\u010dn\xed Panel",description:"Bo\u010dn\xed widgety"},{value:"floating",label:"Plovouc\xed",description:"Plovouc\xed ikony"},{value:"feed",label:"Tok",description:"Tok p\u0159\xedsp\u011bvk\u016f"},{value:"wall",label:"Soci\xe1ln\xed Ze\u010f",description:"Twitter/Instagram ze\u010f s \u017eiv\xfdmi p\u0159\xedsp\u011bvky z v\u0161ech platforem"},{value:"highlights",label:"Highlights",description:"Nejlep\u0161\xed p\u0159\xedsp\u011bvky t\xfddne s most liked/shared"}],stats:[{value:"cards",label:"Karty",description:"Karty statistik"},{value:"table",label:"Tabulka",description:"Datov\xe1 tabulka"},{value:"charts",label:"Grafy",description:"Vizu\xe1ln\xed grafy"},{value:"dashboard",label:"Dashboard",description:"P\u0159ehledov\xe1 deska"},{value:"leaderboard",label:"\u017deb\u0159\xed\u010dek",description:"Top hr\xe1\u010di - nejlep\u0161\xed st\u0159elci, asistence, \u010dist\xe9 konto, atd."},{value:"comparison",label:"Porovn\xe1n\xed",description:"Side-by-side porovn\xe1n\xed hr\xe1\u010d\u016f nebo t\xfdm\u016f"}],countdown:[{value:"default",label:"V\xfdchoz\xed",description:"Standardn\xed odpo\u010det"},{value:"minimal",label:"Minim\xe1ln\xed",description:"Minim\xe1ln\xed \u010dasova\u010d"},{value:"large",label:"Velk\xfd",description:"Velk\xe9 zobrazen\xed"},{value:"circular",label:"Kruhov\xfd",description:"Kruhov\xfd odpo\u010det"}],map:[{value:"default",label:"V\xfdchoz\xed",description:"Standardn\xed mapa"},{value:"satellite",label:"Satelit",description:"Satelitn\xed zobrazen\xed"},{value:"minimal",label:"Minim\xe1ln\xed",description:"Minim\xe1ln\xed design"},{value:"interactive",label:"Interaktivn\xed",description:"Pln\u011b interaktivn\xed mapa"}],merch:[{value:"grid",label:"M\u0159\xed\u017eka",description:"Produktov\xe1 m\u0159\xed\u017eka"},{value:"carousel",label:"Karusel",description:"Produktov\xfd karusel"},{value:"featured",label:"Zv\xfdrazn\u011bn\xe9",description:"Zv\xfdrazn\u011bn\xe9 produkty"},{value:"list",label:"Seznam",description:"Seznam produkt\u016f"},{value:"sparta_product_slider",label:"Sparta Product Slider",description:"Produktov\xfd karusel s fotkami, cenami a tla\u010d\xedtky Koupit"}],footer:[{value:"standard",label:"Standardn\xed",description:"Klasick\xe1 pati\u010dka"},{value:"minimal",label:"Minim\xe1ln\xed",description:"Minimalistick\xe1 pati\u010dka"},{value:"extended",label:"Roz\u0161\xed\u0159en\xe1",description:"Roz\u0161\xed\u0159en\xe1 s v\xedce sloupci"},{value:"centered",label:"Centrovan\xe1",description:"Centrovan\xe9 rozlo\u017een\xed"},{value:"sparta_extended",label:"Sparta Extended",description:"Roz\u0161\xed\u0159en\xe1 pati\u010dka s partnery, navigac\xed, newsletterem a soci\xe1ln\xedmi s\xedt\u011bmi"}],sidebar:[{value:"right",label:"Prav\xfd",description:"Prav\xfd bo\u010dn\xed panel"},{value:"left",label:"Lev\xfd",description:"Lev\xfd bo\u010dn\xed panel"},{value:"sticky",label:"P\u0159ilepen\xfd",description:"P\u0159ilepen\xfd p\u0159i scrollov\xe1n\xed"}],banner:[{value:"top",label:"Naho\u0159e",description:"Banner v horn\xed \u010d\xe1sti"},{value:"bottom",label:"Dole",description:"Banner ve spodn\xed \u010d\xe1sti"},{value:"sidebar",label:"Bo\u010dn\xed",description:"Bo\u010dn\xed banner"},{value:"overlay",label:"P\u0159ekryvn\xfd",description:"P\u0159ekryvn\xfd banner"}],table:[{value:"split_news",label:"Rozd\u011blen\xfd s Aktualitami",description:"Dva sloupce - Aktuality vlevo + Tabulka vpravo (v\xfdchoz\xed)"},{value:"standard",label:"Standardn\xed",description:"Klasick\xe1 tabulka - jeden sloupec"},{value:"compact",label:"Kompaktn\xed",description:"Kompaktn\xed zobrazen\xed"},{value:"detailed",label:"Detailn\xed",description:"Detailn\xed informace"}],testimonials:[{value:"carousel",label:"Karusel",description:"Posuvn\xfd karusel"},{value:"grid",label:"M\u0159\xed\u017eka",description:"M\u0159\xed\u017eka referenc\xed"},{value:"wall",label:"Ze\u010f",description:"Ze\u010f ohlas\u016f"}],achievements:[{value:"timeline",label:"\u010casov\xe1 Osa",description:"Chronologick\xe1 osa"},{value:"grid",label:"M\u0159\xed\u017eka",description:"M\u0159\xed\u017eka \xfasp\u011bch\u016f"},{value:"showcase",label:"V\xfdloha",description:"V\xfdloha trofej\xed"}],history:[{value:"timeline",label:"\u010casov\xe1 Osa",description:"Historick\xe1 \u010dasov\xe1 osa"},{value:"story",label:"P\u0159\xedb\u011bh",description:"Vypr\xe1v\u011bc\xed form\xe1t"},{value:"milestones",label:"Miln\xedky",description:"Kl\xed\u010dov\xe9 miln\xedky"}],live:[{value:"featured",label:"Zv\xfdrazn\u011bn\xfd",description:"Hlavn\xed live stream"},{value:"embedded",label:"Vlo\u017een\xfd",description:"Vlo\u017een\xfd p\u0159ehr\xe1va\u010d"},{value:"multi",label:"V\xedce Kamer",description:"V\xedce kamer najednou"}],podcast:[{value:"list",label:"Seznam",description:"Seznam epizod"},{value:"player",label:"P\u0159ehr\xe1va\u010d",description:"Integrovan\xfd p\u0159ehr\xe1va\u010d"},{value:"featured",label:"Zv\xfdrazn\u011bn\xfd",description:"Zv\xfdrazn\u011bn\xe9 epizody"}],contact:[{value:"form",label:"Formul\xe1\u0159",description:"Kontaktn\xed formul\xe1\u0159"},{value:"info",label:"Informace",description:"Kontaktn\xed \xfadaje"},{value:"combined",label:"Kombinovan\xfd",description:"Formul\xe1\u0159 + \xfadaje"}],poll:[{value:"vertical",label:"Vertik\xe1ln\xed",description:"Vertik\xe1ln\xed rozlo\u017een\xed"},{value:"horizontal",label:"Horizont\xe1ln\xed",description:"Horizont\xe1ln\xed rozlo\u017een\xed"},{value:"cards",label:"Karty",description:"Kartov\xe9 rozlo\u017een\xed"}],quiz:[{value:"card",label:"Karta",description:"Karta po kart\u011b"},{value:"form",label:"Formul\xe1\u0159",description:"Formul\xe1\u0159ov\xfd styl"},{value:"interactive",label:"Interaktivn\xed",description:"Pln\u011b interaktivn\xed"}],search:[{value:"header",label:"Hlavi\u010dka",description:"V hlavi\u010dce"},{value:"overlay",label:"P\u0159ekryvn\xfd",description:"P\u0159ekryvn\xe9 vyhled\xe1v\xe1n\xed"},{value:"inline",label:"Vlo\u017een\xfd",description:"Vlo\u017een\xfd do str\xe1nky"}],calendar:[{value:"month",label:"M\u011bs\xedc",description:"M\u011bs\xed\u010dn\xed zobrazen\xed"},{value:"week",label:"T\xfdden",description:"T\xfddenn\xed zobrazen\xed"},{value:"list",label:"Seznam",description:"Seznam ud\xe1lost\xed"}],weather:[{value:"widget",label:"Widget",description:"Widget po\u010das\xed"},{value:"detailed",label:"Detailn\xed",description:"Detailn\xed p\u0159edpov\u011b\u010f"},{value:"minimal",label:"Minim\xe1ln\xed",description:"Z\xe1kladn\xed info"}],ticketing:[{value:"widget",label:"Widget",description:"Widget vstupenek"},{value:"full",label:"Pln\xfd",description:"Pln\xfd syst\xe9m"},{value:"link",label:"Odkaz",description:"Pouze odkaz"}]}},47704:(e,t,n)=>{n.d(t,{Gf:()=>s,IK:()=>l,fn:()=>o,yL:()=>r});var a=n(89379),i=n(46291);async function o(e){const t=(0,a.A)({},e);if(t.target_url&&!/^https?:\/\//i.test(t.target_url)&&(t.target_url="https://".concat(t.target_url)),"string"===typeof t.code){const e=t.code.trim().replace(/[^a-zA-Z0-9_-]/g,"").slice(0,16);t.code=e||void 0}try{return(await i.Ay.post("/admin/shortlinks",t)).data}catch(n){try{return(await i.Ay.post("/shortlinks",t)).data}catch(o){return(await i.Ay.post("/shortlinks/public",{target_url:t.target_url,title:t.title})).data}}}async function r(e){const t=(0,a.A)({},e);t.target_url&&!/^https?:\/\//i.test(t.target_url)&&(t.target_url="https://".concat(t.target_url));return(await i.Ay.post("/shortlinks/public",t)).data}async function s(){try{return(await i.Ay.get("/admin/shortlinks")).data}catch(e){return(await i.Ay.get("/shortlinks")).data}}async function l(e){return(await i.Ay.get("/admin/shortlinks/".concat(e,"/stats"))).data}},48549:(e,t,n)=>{n.d(t,{AI:()=>l,Cd:()=>p,IL:()=>A,Ip:()=>m,JH:()=>_,L1:()=>y,SJ:()=>g,Sm:()=>k,ZF:()=>S,ZP:()=>f,_x:()=>b,cJ:()=>d,cf:()=>z,lH:()=>w,lR:()=>C,nk:()=>v,nz:()=>x,t8:()=>D,vO:()=>j,vu:()=>c,x0:()=>u,y:()=>h});var a=n(89379),i=n(30458),o=n(46291);const r={homeName:"DOM\xc1C\xcd",awayName:"HOST\xc9",homeLogo:"",awayLogo:"",homeShort:"DOM",awayShort:"HOS",primaryColor:"#1e3a8a",secondaryColor:"#2563eb",homeScore:0,awayScore:0,homeFouls:0,awayFouls:0,halfLength:45,theme:"pill",externalMatchId:"",active:!1,timer:"00:00",running:!1,sidesFlipped:!1,half:1,qrEvery:5,qrDuration:60},s="scoreboard_state_v1";async function l(){try{const e=E((await o.Ay.get("/admin/scoreboard")).data);return localStorage.setItem(s,JSON.stringify(e)),(0,a.A)((0,a.A)({},r),e)}catch(e){try{const e=(o.API_URL||"").replace(/\/$/,""),t=await fetch("".concat(e,"/scoreboard"),{credentials:"include"});if(t.ok){const e=E(await t.json());return localStorage.setItem(s,JSON.stringify(e)),(0,a.A)((0,a.A)({},r),e)}}catch(t){}try{const e=localStorage.getItem(s);if(!e)return r;const t=JSON.parse(e);return(0,a.A)((0,a.A)({},r),t)}catch(n){return r}}}async function c(e){let t=(0,a.A)({},r);try{const e=localStorage.getItem(s);if(e){const n=JSON.parse(e);t=(0,a.A)((0,a.A)({},r),n||{})}}catch(i){}const n=(0,a.A)((0,a.A)({},t),e);try{localStorage.setItem(s,JSON.stringify(n))}catch(l){}try{await o.Ay.put("/admin/scoreboard",T(e))}catch(c){}return n}async function d(){const e=E((await o.Ay.get("/admin/scoreboard")).data);return localStorage.setItem(s,JSON.stringify(e)),(0,a.A)((0,a.A)({},r),e)}async function u(e){const t=E((await o.Ay.put("/admin/scoreboard",T(e))).data);return localStorage.setItem(s,JSON.stringify(t)),(0,a.A)((0,a.A)({},r),t)}async function h(){const e=(o.API_URL||"").replace(/\/$/,""),t=await fetch("".concat(e,"/scoreboard"),{credentials:"include"});if(!t.ok)throw new Error("Failed to load public scoreboard");const n=E(await t.json());return(0,a.A)((0,a.A)({},r),n)}async function m(){await o.Ay.post("/admin/scoreboard/timer/start")}async function p(){await o.Ay.post("/admin/scoreboard/timer/pause")}async function x(){await o.Ay.post("/admin/scoreboard/timer/reset")}async function g(){await o.Ay.post("/admin/scoreboard/second-half")}async function v(){return((await o.Ay.get("/admin/scoreboard/saves")).data||[]).slice()}async function j(e){const t=e&&e.trim()?{filename:e.trim()}:{};return(await o.Ay.post("/admin/scoreboard/save",t)).data}async function b(e){const t=(e||"").trim();if(!t)throw new Error("Missing filename");await o.Ay.post("/admin/scoreboard/load",{filename:t})}async function y(){const e=(await o.Ay.get("/admin/scoreboard/sponsors")).data||[];try{const t=new URL(o.API_URL||"","undefined"!==typeof window?window.location.origin:void 0),n="".concat(t.protocol,"//").concat(t.host);return e.map(e=>e&&e.startsWith("/uploads/")?n+e:e)}catch(t){return e}}async function f(e){const t=new FormData;for(const n of e)t.append("files",n);return(await o.Ay.post("/admin/scoreboard/sponsors/upload",t,{headers:{"Content-Type":"multipart/form-data"}})).data||{saved:0}}async function k(e){await o.Ay.delete("/admin/scoreboard/sponsors",{params:{name:e}})}async function _(e){const t=Array.isArray(e)&&e.length?{ids:e}:{};return(await o.Ay.post("/admin/scoreboard/sponsors/prefill",t)).data||{saved:0}}async function w(){const e=(await o.Ay.get("/scoreboard/sponsors")).data||[];try{const t=new URL(o.API_URL||"","undefined"!==typeof window?window.location.origin:void 0),n="".concat(t.protocol,"//").concat(t.host);return e.map(e=>e&&e.startsWith("/uploads/")?n+e:e)}catch(t){return e}}async function z(){try{var e;const n=(null===(e=(await o.Ay.get("/admin/scoreboard/qr")).data)||void 0===e?void 0:e.qr)||"";if(n&&n.startsWith("/uploads/"))try{const e=new URL(o.API_URL||"","undefined"!==typeof window?window.location.origin:void 0);return"".concat(e.protocol,"//").concat(e.host).concat(n)}catch(t){}return n}catch(n){try{const e=(o.API_URL||"").replace(/\/$/,""),t=await fetch("".concat(e,"/scoreboard/qr"),{credentials:"include"});if(t.ok){const e=await t.json(),n=(null===e||void 0===e?void 0:e.qr)||"";if(n&&n.startsWith("/uploads/"))try{const e=new URL(o.API_URL||"","undefined"!==typeof window?window.location.origin:void 0);return"".concat(e.protocol,"//").concat(e.host).concat(n)}catch(a){}return n}}catch(i){}return""}}async function S(e){const t=new FormData;t.append("file",e),await o.Ay.post("/admin/scoreboard/qr",t,{headers:{"Content-Type":"multipart/form-data"}})}function A(e){if(!e)return"---";const t=String(e).trim().toUpperCase();if(!t)return"---";const n={"\xc1":"A","\xc4":"A","\xc5":"A","\xc2":"A","\xc0":"A","\u010c":"C","\u0106":"C","\xc7":"C","\u010e":"D","\xc9":"E","\u011a":"E","\xc8":"E","\xcb":"E","\xca":"E","\xcd":"I","\xcc":"I","\xcf":"I","\xce":"I","\u0147":"N","\u0143":"N","\xd3":"O","\xd6":"O","\xd4":"O","\xd2":"O","\u0158":"R","\u0160":"S","\u015a":"S","\u0164":"T","\xda":"U","\u016e":"U","\xd9":"U","\xdc":"U","\xdb":"U","\xdd":"Y","\u017d":"Z"};let a="";for(const i of t){let e=n[i]||i;if(e>="A"&&e<="Z"&&(a+=e,3===a.length))break}for(;a.length<3;)a+="-";return a}async function C(e){if(!e)return null;try{const t=await(0,i.x_)(e,5);return(null===t||void 0===t?void 0:t[0])||null}catch(t){return null}}function E(e){if(!e)return{};const t=e=>{try{if(!e)return"";const t=String(e);if(t.startsWith("/uploads/")||t.startsWith("/dist/")){const e=new URL(o.API_URL||"","undefined"!==typeof window?window.location.origin:void 0);return"".concat(e.protocol,"//").concat(e.host).concat(t)}return t}catch(t){return e||""}},n=e.homeLogo||e.home_logo||e.home_logo_url||e.HomeLogoURL||"",a=e.awayLogo||e.away_logo||e.away_logo_url||e.AwayLogoURL||"";return{homeName:e.homeName||e.home_name||e.HomeName||"",awayName:e.awayName||e.away_name||e.AwayName||"",homeLogo:t(n),awayLogo:t(a),homeShort:e.homeShort||e.home_short||e.HomeShort||"",awayShort:e.awayShort||e.away_short||e.AwayShort||"",primaryColor:e.primaryColor||e.primary_color||e.PrimaryColor||void 0,secondaryColor:e.secondaryColor||e.secondary_color||e.SecondaryColor||void 0,homeTextColor:e.homeTextColor||e.home_text_color||e.HomeTextColor||void 0,awayTextColor:e.awayTextColor||e.away_text_color||e.AwayTextColor||void 0,homeScore:"number"===typeof e.homeScore?e.homeScore:"number"===typeof e.home_score?e.home_score:0,awayScore:"number"===typeof e.awayScore?e.awayScore:"number"===typeof e.away_score?e.away_score:0,homeFouls:"number"===typeof e.homeFouls?e.homeFouls:"number"===typeof e.home_fouls?e.home_fouls:0,awayFouls:"number"===typeof e.awayFouls?e.awayFouls:"number"===typeof e.away_fouls?e.away_fouls:0,halfLength:"number"===typeof e.halfLength?e.halfLength:"number"===typeof e.half_length?e.half_length:45,theme:e.theme||"pill",externalMatchId:e.externalMatchId||e.external_match_id||e.ExternalMatchID||"",active:"boolean"===typeof e.active?e.active:void 0,timer:e.timer||e.Timer||"00:00",running:"boolean"===typeof e.running?e.running:void 0,sidesFlipped:"boolean"===typeof e.sidesFlipped?e.sidesFlipped:"boolean"===typeof e.sides_flipped?e.sides_flipped:void 0,half:"number"===typeof e.half?e.half:void 0,qrEvery:"number"===typeof e.qrEvery?e.qrEvery:"number"===typeof e.qr_show_every_minutes?e.qr_show_every_minutes:void 0,qrDuration:"number"===typeof e.qrDuration?e.qrDuration:"number"===typeof e.qr_show_duration_seconds?e.qr_show_duration_seconds:void 0}}function T(e){const t={};return void 0!==e.homeName&&(t.homeName=e.homeName),void 0!==e.awayName&&(t.awayName=e.awayName),void 0!==e.homeLogo&&(t.homeLogo=e.homeLogo),void 0!==e.awayLogo&&(t.awayLogo=e.awayLogo),void 0!==e.homeShort&&(t.homeShort=e.homeShort),void 0!==e.awayShort&&(t.awayShort=e.awayShort),void 0!==e.primaryColor&&(t.primaryColor=e.primaryColor),void 0!==e.secondaryColor&&(t.secondaryColor=e.secondaryColor),void 0!==e.homeTextColor&&(t.homeTextColor=e.homeTextColor),void 0!==e.awayTextColor&&(t.awayTextColor=e.awayTextColor),void 0!==e.homeScore&&(t.homeScore=e.homeScore),void 0!==e.awayScore&&(t.awayScore=e.awayScore),void 0!==e.homeFouls&&(t.homeFouls=e.homeFouls),void 0!==e.awayFouls&&(t.awayFouls=e.awayFouls),void 0!==e.halfLength&&(t.halfLength=e.halfLength),void 0!==e.theme&&(t.theme=e.theme),void 0!==e.externalMatchId&&(t.externalMatchId=e.externalMatchId),void 0!==e.active&&(t.active=e.active),void 0!==e.timer&&(t.timer=e.timer),void 0!==e.sidesFlipped&&(t.sidesFlipped=e.sidesFlipped),void 0!==e.half&&(t.half=e.half),void 0!==e.qrEvery&&(t.qrEvery=e.qrEvery),void 0!==e.qrDuration&&(t.qrDuration=e.qrDuration),t}async function D(){await o.Ay.delete("/admin/scoreboard/qr")}},48620:(e,t,n)=>{n.r(t),n.d(t,{default:()=>M});var a=n(65043),i=n(87139),o=n(22107),r=n(98662),s=n(83169),l=n(24330),c=n(26201),d=n(82459),u=n(73212),h=n(67516),m=n(35929),p=n(56529),x=n(15071),g=n(11054),v=n(78460),j=n(85421),b=n(96148),y=n(29904),f=n(10202),k=n(94217),_=n(94085),w=n(53332),z=n(78149),S=n(19077),A=n(30502),C=n(28846),E=n(39081),T=n(72526),D=n(59781),N=n(12836),R=n(90944),F=n(6583),P=n(46291),I=n(70579);const M=()=>{var e;const t=(0,A.d)(),n=(0,D.jE)(),[M,L]=a.useState(!1),[W,U]=a.useState(""),[O,q]=a.useState(!1),[K,B]=a.useState(null),[Z,V]=a.useState(""),{data:H,isError:$,error:J}=(0,T.I)({queryKey:["admin","cache","list"],queryFn:async()=>(await P.Ay.get("/admin/cache/list")).data,staleTime:3e4,retry:1}),G=async e=>{q(!0),B(null),V("");try{const n=(await P.Ay.get("/admin/cache/file?path=".concat(encodeURIComponent(e)),{transformResponse:[e=>e]})).data;try{const e=JSON.parse(n);V(JSON.stringify(e,null,2))}catch(t){V(n)}}catch(n){B((null===n||void 0===n?void 0:n.message)||"Nelze na\u010d\xedst data")}finally{q(!1)}},{data:X,isLoading:Y,isFetching:Q}=(0,T.I)({queryKey:["admin","prefetch","status"],queryFn:R.w,refetchInterval:3e4}),ee=(0,N.n)({mutationFn:R.E,onSuccess:async()=>{t({title:"Prefetch spu\u0161t\u011bn",status:"success"}),await n.invalidateQueries({queryKey:["admin","prefetch","status"]})},onError:e=>{t({title:"Spu\u0161t\u011bn\xed prefetch selhalo",description:String((null===e||void 0===e?void 0:e.message)||e),status:"error"})}}),te=null!==X&&void 0!==X&&X.lastUpdated?new Date(X.lastUpdated):null,ne=null!==X&&void 0!==X&&X.nextApproximate?new Date(X.nextApproximate):null;return(0,I.jsx)(F.A,{children:(0,I.jsxs)(o.a,{children:[(0,I.jsx)(C.D,{size:"lg",mb:4,children:"Prefetch & Cache"}),(0,I.jsx)(E.E,{color:"gray.600",mb:6,children:"Na pozad\xed b\u011b\u017e\xed \xfaloha, kter\xe1 pravideln\u011b stahuje JSON snapshoty z ve\u0159ejn\xfdch API pro rychlej\u0161\xed na\u010d\xedt\xe1n\xed str\xe1nek. Zde uvid\xedte aktu\xe1ln\xed pl\xe1n a m\u016f\u017eete spustit ru\u010dn\xed sta\u017een\xed."}),(0,I.jsxs)(u.r,{columns:{base:1,md:3},spacing:4,mb:6,children:[(0,I.jsxs)(s.Z,{children:[(0,I.jsx)(c.a,{children:(0,I.jsx)(E.E,{fontWeight:"bold",children:"Re\u017eim"})}),(0,I.jsx)(l.b,{children:(0,I.jsxs)(k.r,{children:[(0,I.jsx)(w.v,{children:"Aktu\xe1ln\xed re\u017eim"}),(0,I.jsx)(z.k,{children:null!==X&&void 0!==X&&X.fastMode?(0,I.jsx)(i.E,{colorScheme:"green",children:"Rychl\xfd (b\u011bhem z\xe1pasu)"}):(0,I.jsx)(i.E,{children:"Norm\xe1ln\xed"})}),(0,I.jsx)(_.h,{children:"V dob\u011b kon\xe1n\xed z\xe1pas\u016f se automaticky p\u0159epne do rychl\xe9ho re\u017eimu."})]})})]}),(0,I.jsxs)(s.Z,{children:[(0,I.jsx)(c.a,{children:(0,I.jsx)(E.E,{fontWeight:"bold",children:"Posledn\xed aktualizace"})}),(0,I.jsx)(l.b,{children:(0,I.jsxs)(k.r,{children:[(0,I.jsx)(w.v,{children:"Posledn\xed prefetch"}),(0,I.jsx)(z.k,{fontSize:"lg",children:te?te.toLocaleString():"Unknown"}),(0,I.jsx)(_.h,{children:Q?"Obnovuji\u2026":"Aktu\xe1ln\xed"})]})})]}),(0,I.jsxs)(s.Z,{children:[(0,I.jsx)(c.a,{children:(0,I.jsx)(E.E,{fontWeight:"bold",children:"Dal\u0161\xed spu\u0161t\u011bn\xed"})}),(0,I.jsx)(l.b,{children:(0,I.jsxs)(k.r,{children:[(0,I.jsx)(w.v,{children:"P\u0159ibli\u017en\u011b"}),(0,I.jsx)(z.k,{fontSize:"lg",children:ne?ne.toLocaleString():"\u2014"}),(0,I.jsxs)(_.h,{children:["Interval: ",null!==(e=null===X||void 0===X?void 0:X.intervalMinutes)&&void 0!==e?e:30," min"]})]})})]})]}),(0,I.jsxs)(s.Z,{children:[(0,I.jsx)(c.a,{children:(0,I.jsxs)(y.B,{direction:{base:"column",sm:"row"},align:"center",justify:"space-between",children:[(0,I.jsx)(E.E,{fontWeight:"bold",children:"Ovl\xe1d\xe1n\xed"}),(0,I.jsxs)(y.B,{direction:"row",spacing:3,children:[(0,I.jsx)(r.$,{colorScheme:"blue",isLoading:ee.isLoading,onClick:()=>ee.mutate(),children:"Spustit sta\u017een\xed"}),(0,I.jsx)(r.$,{variant:"outline",onClick:()=>n.invalidateQueries({queryKey:["admin","prefetch","status"]}),children:"Obnovit stav"}),(0,I.jsx)(r.$,{variant:"outline",onClick:()=>{var e;L(!0);const t=null===H||void 0===H||null===(e=H.files)||void 0===e?void 0:e[0];t?(U(t.path),G(t.path)):$?B("Nelze na\u010d\xedst seznam soubor\u016f"):null!==H&&void 0!==H&&H.files&&0!==H.files.length||B("\u017d\xe1dn\xe9 cache soubory nebyly nalezeny")},isDisabled:$&&!H,children:"Zobrazit RAW data"})]})]})}),(0,I.jsx)(d.c,{}),(0,I.jsx)(l.b,{children:(0,I.jsx)(E.E,{color:"gray.600",children:"Ru\u010dn\xed spu\u0161t\u011bn\xed zah\xe1j\xed na pozad\xed obnovu v\u0161ech ve\u0159ejn\xfdch endpoint\u016f a zdroj\u016f FA\u010cR. Nezablokuje u\u017eivatelsk\xe9 rozhran\xed."})})]}),(0,I.jsxs)(v.aF,{isOpen:M,onClose:()=>L(!1),size:"6xl",scrollBehavior:"inside",children:[(0,I.jsx)(g.m,{}),(0,I.jsxs)(j.$,{children:[(0,I.jsx)(x.r,{children:"RAW data (prefetch & cache)"}),(0,I.jsx)(m.s,{}),(0,I.jsx)(h.c,{children:$?(0,I.jsxs)(o.a,{p:4,textAlign:"center",children:[(0,I.jsx)(E.E,{color:"red.500",mb:2,children:"Chyba p\u0159i na\u010d\xedt\xe1n\xed seznamu soubor\u016f"}),(0,I.jsx)(E.E,{color:"gray.500",fontSize:"sm",children:String(J)})]}):null!==H&&void 0!==H&&H.files&&0!==H.files.length?(0,I.jsxs)(u.r,{columns:{base:1,md:4},spacing:4,children:[(0,I.jsx)(f.T,{align:"stretch",spacing:2,gridColumn:{base:"1",md:"span 1"},children:H.files.map(e=>(0,I.jsx)(r.$,{variant:W===e.path?"solid":"outline",onClick:()=>{U(e.path),G(e.path)},justifyContent:"flex-start",size:"sm",children:(0,I.jsx)(E.E,{noOfLines:1,fontSize:"xs",textAlign:"left",w:"full",children:e.label})},e.path))}),(0,I.jsxs)(o.a,{gridColumn:{base:"1",md:"span 3"},children:[(0,I.jsxs)(b.z,{justify:"space-between",mb:2,children:[(0,I.jsx)(E.E,{fontWeight:"semibold",fontSize:"sm",noOfLines:1,children:W||"Vyberte soubor"}),(0,I.jsxs)(b.z,{children:[(0,I.jsx)(r.$,{size:"sm",variant:"ghost",onClick:()=>G(W),isLoading:O,isDisabled:!W,children:"Obnovit"}),(0,I.jsx)(r.$,{size:"sm",as:"a",href:"".concat(P.API_URL,"/admin/cache/file?path=").concat(encodeURIComponent(W)),target:"_blank",rel:"noreferrer",isDisabled:!W,children:"Otev\u0159\xedt v nov\xe9 z\xe1lo\u017ece"})]})]}),K&&(0,I.jsx)(o.a,{color:"red.500",mb:2,p:2,bg:"red.50",borderRadius:"md",children:K}),(0,I.jsx)(S.T,{value:Z,onChange:()=>{},readOnly:!0,fontFamily:"mono",rows:24,fontSize:"xs"})]})]}):(0,I.jsxs)(o.a,{p:4,textAlign:"center",children:[(0,I.jsx)(E.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 cache soubory nebyly nalezeny"}),(0,I.jsx)(E.E,{fontSize:"sm",color:"gray.400",mt:2,children:"Zkuste spustit prefetch sta\u017een\xed nejprve"})]})}),(0,I.jsx)(p.j,{children:(0,I.jsx)(r.$,{onClick:()=>L(!1),children:"Zav\u0159\xedt"})})]})]})]})})}},48644:(e,t,n)=>{n.r(t),n.d(t,{default:()=>R});var a=n(96870),i=n(32077),o=n(87139),r=n(22107),s=n(98662),l=n(44093),c=n(73212),d=n(25011),u=n(7189),h=n(67516),m=n(35929),p=n(11054),x=n(78460),g=n(85421),v=n(96148),j=n(10202),b=n(28846),y=n(39081),f=n(35475),k=n(85369),_=n(74117),w=n(70118),z=n(78801),S=n(57550),A=n(24346),C=n(65043),E=n(61269),T=n(70579);const D=e=>{try{if(e.includes("youtube.com")||e.includes("youtu.be")){const t=new URL(e);if(t.hostname.includes("youtu.be")){const e=t.pathname.replace("/","");return"https://www.youtube.com/embed/".concat(e)}const n=t.searchParams.get("v");if(n)return"https://www.youtube.com/embed/".concat(n)}}catch(t){}return"https://www.youtube.com/embed/".concat(e)},N=e=>{var t,n,N;let{videos:R,variant:F}=e;const{t:P}=(0,_.Bd)(),I=(0,l.dU)("white","gray.800"),M=(0,z.N)(),{data:L}=(0,S.s)(),[W,U]=(0,C.useState)([]),{isOpen:O,onOpen:q,onClose:K}=(0,a.j)(),[B,Z]=(0,C.useState)(null),V=(null===L||void 0===L?void 0:L.videos_title_overrides)||{},H=Boolean((null===L||void 0===L||null===(t=L.videos_items)||void 0===t?void 0:t.length)||(null===L||void 0===L||null===(n=L.videos)||void 0===n?void 0:n.length)),$=Boolean((null===L||void 0===L?void 0:L.youtube_url)||(null===L||void 0===L?void 0:L.social_youtube)),J="boolean"===typeof(null===L||void 0===L?void 0:L.videos_module_enabled)?Boolean(null===L||void 0===L?void 0:L.videos_module_enabled):H||"auto"===((null===L||void 0===L?void 0:L.videos_source)||"auto")&&$,G="carousel"===F?"slider":"grid"===F?"grid":(null===L||void 0===L?void 0:L.videos_style)||"slider",X=(null===L||void 0===L?void 0:L.videos_source)||"auto",Y=Math.max(1,Math.min(12,null!==(N=null===L||void 0===L?void 0:L.videos_limit)&&void 0!==N?N:6));(null===L||void 0===L?void 0:L.youtube_url)||null===L||void 0===L||L.social_youtube;(0,C.useEffect)(()=>{try{O&&K(),Z(null)}catch(e){}},[G]),(0,C.useEffect)(()=>{let e=!1;return(async()=>{const t=await(0,A.S)();if(!t)return;const n=(t.videos||[]).slice().sort((e,t)=>(Date.parse(t.published_date||"")||0)-(Date.parse(e.published_date||"")||0));e||U(n)})(),()=>{e=!0}},[]);const Q=e=>{var t;if(null!==e&&void 0!==e&&e.includes("/embed/"))return null===(t=e.split("/embed/")[1])||void 0===t?void 0:t.split("?")[0]},ee=(0,C.useMemo)(()=>{const e=(()=>{const e=((null===L||void 0===L?void 0:L.videos_items)||[]).map((e,t)=>{const n=D(e.url);return{key:"".concat(t,"-").concat(e.url),title:e.title||"Video ".concat(t+1),embedUrl:n,thumbnail:e.thumbnail_url,date:e.uploaded_at,videoId:Q(n)}}),t=(R||(null===L||void 0===L?void 0:L.videos)||[]).map((e,t)=>{const n=D(e);return{key:"".concat(t,"-").concat(e),title:"Video ".concat(t+1),embedUrl:n,videoId:Q(n)}});return e.length?e:t})(),t=(W||[]).map(e=>{var t;return{key:e.video_id,title:(null===V||void 0===V||null===(t=V[e.video_id])||void 0===t?void 0:t.trim())||e.title,embedUrl:D(e.video_id),thumbnail:e.thumbnail_url,date:e.published_date,videoId:e.video_id}}),n=[],a=new Set,i=e=>{const t=e.videoId||e.embedUrl||e.key;t&&(a.has(t)||(a.add(t),n.push(e)))};e.forEach(i),t.forEach(i);return n.slice().sort((e,t)=>{const n=Date.parse(e.date||"")||0;return(Date.parse(t.date||"")||0)-n}).slice(0,Y)},[X,W,null===L||void 0===L?void 0:L.videos_items,null===L||void 0===L?void 0:L.videos,R,Y,V]);if(!J||0===ee.length)return null;const te=e=>{Z(e),q()},ne=e=>{let{it:t,idx:n}=e;const a=t.thumbnail||(t.videoId?"https://i.ytimg.com/vi/".concat(t.videoId,"/hqdefault.jpg"):void 0),c=(0,l.dU)("gray.200","gray.600"),h=(0,l.dU)("gray.100","gray.700"),m=(0,l.dU)("gray.400","gray.500"),p=M.primary;return(0,T.jsxs)(r.a,{className:"video-card card",bg:I,overflow:"hidden",borderWidth:"2px",borderColor:c,transition:"all 0.3s",position:"relative",sx:{"&:hover":{transform:"translateY(-8px)",boxShadow:"0 20px 40px rgba(0,0,0,0.15)",borderColor:"brand.primary"},"&:hover .play-overlay":{opacity:1},"&:hover .play-overlay > div":{transform:"scale(1.05)"}},children:[(0,T.jsx)(i.g,{ratio:16/9,children:(0,T.jsxs)(r.a,{position:"relative",cursor:"pointer",role:"button",tabIndex:0,"aria-label":"".concat(P("action.play"),": ").concat(t.title),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),te(t))},onClick:()=>te(t),children:[a?(0,T.jsx)(r.a,{as:"img",src:a,alt:t.title,width:"100%",height:"100%",loading:"lazy",decoding:"async",referrerPolicy:"origin-when-cross-origin",style:{objectFit:"cover"},"data-fallback-idx":0,onError:e=>{try{const n=e.currentTarget,a=Number(n.dataset.fallbackIdx||"0"),i=t.videoId||"",o=i?["https://i.ytimg.com/vi/".concat(i,"/mqdefault.jpg"),"https://i.ytimg.com/vi/".concat(i,"/sddefault.jpg"),"https://i.ytimg.com/vi/".concat(i,"/hqdefault.jpg"),"/dist/img/logo-club-empty.svg"]:["/dist/img/logo-club-empty.svg"];a<o.length&&(n.src=o[a],n.dataset.fallbackIdx=String(a+1))}catch(n){}}}):(0,T.jsx)(r.a,{bg:h,display:"flex",alignItems:"center",justifyContent:"center",children:(0,T.jsx)(d.I,{as:k.gSK,boxSize:12,color:m})}),(0,T.jsx)(r.a,{className:"play-overlay",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:0,transition:"opacity 0.3s ease",pointerEvents:"none",children:(0,T.jsxs)(r.a,{bg:"white",color:"brand.primary",borderRadius:"full",px:8,py:4,fontWeight:"bold",display:"flex",alignItems:"center",gap:2,transform:"scale(0.9)",transition:"transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)",boxShadow:"0 12px 32px rgba(0,0,0,0.4)",children:[(0,T.jsx)(d.I,{as:k.gSK,boxSize:5}),(0,T.jsx)(y.E,{fontSize:"lg",children:P("action.play")})]})})]})}),(0,T.jsx)(r.a,{p:4,borderTopWidth:"2px",borderTopColor:p,children:(0,T.jsxs)(j.T,{align:"start",spacing:2,children:[(0,T.jsx)(y.E,{fontWeight:"bold",fontSize:"md",color:p,noOfLines:2,children:t.title}),(0,T.jsxs)(v.z,{justify:"space-between",width:"100%",children:[t.date&&(0,T.jsx)(o.E,{colorScheme:"gray",fontSize:"0.7rem",children:new Date(t.date).toLocaleDateString("cs-CZ")}),t.videoId&&(0,T.jsx)(u.N,{href:"https://www.youtube.com/watch?v=".concat(t.videoId),isExternal:!0,onClick:e=>e.stopPropagation(),children:(0,T.jsx)(s.$,{size:"xs",variant:"ghost",colorScheme:"red",leftIcon:(0,T.jsx)(d.I,{as:k.Vk6}),children:"YouTube"})})]})]})})]})};if("slider"===G)return(0,T.jsxs)(r.a,{children:[(0,T.jsxs)(r.a,{className:"section-head",style:{marginTop:8,marginBottom:16},children:[(0,T.jsx)(v.z,{spacing:3,children:(0,T.jsx)(b.D,{as:"h3",size:"lg",fontWeight:"700",id:"home-videos-heading",children:P("nav.videos")})}),(0,T.jsx)(u.N,{as:f.N_,to:"/videa",children:(0,T.jsx)(s.$,{size:"md",variant:"solid",bg:M.primary,color:"white",rightIcon:(0,T.jsx)(r.a,{as:"span",children:"\u2192"}),_hover:{opacity:.9,transform:"translateX(4px)"},transition:"all 0.2s",children:P("homepage.more_videos")})})]}),(0,T.jsx)(w.A,{draggable:!0,children:ee.map((e,t)=>(0,T.jsx)(r.a,{minW:{base:"85%",md:"60%",lg:"33%"},display:"flex",flexDirection:"column",children:(0,T.jsx)(ne,{it:e,idx:t})},e.key))},"videos-hs-".concat(G,"-").concat(ee.length)),(0,T.jsxs)(x.aF,{isOpen:O,onClose:K,size:"6xl",isCentered:!0,children:[(0,T.jsx)(p.m,{bg:"blackAlpha.800"}),(0,T.jsxs)(g.$,{bg:"transparent",boxShadow:"none",maxW:"90vw",children:[(0,T.jsx)(m.s,{color:"white",size:"lg",bg:"blackAlpha.600",_hover:{bg:"blackAlpha.700"},borderRadius:"full",zIndex:2}),(0,T.jsx)(h.c,{p:0,children:B&&(0,T.jsxs)(r.a,{children:[(0,T.jsx)(i.g,{ratio:16/9,maxH:"90vh",children:(0,T.jsx)("iframe",{src:"".concat(B.embedUrl,"?autoplay=1&vq=hd1080&rel=0&modestbranding=1&playsinline=1"),title:B.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,loading:"lazy",referrerPolicy:"strict-origin-when-cross-origin",style:{borderRadius:"8px"}})}),(0,T.jsxs)(r.a,{bg:(0,l.dU)("white","gray.800"),p:4,borderRadius:"md",mt:2,children:[(0,T.jsxs)(v.z,{justify:"space-between",align:"start",children:[(0,T.jsxs)(j.T,{align:"start",flex:1,children:[(0,T.jsx)(y.E,{fontWeight:"bold",fontSize:"lg",children:B.title}),B.date&&(0,T.jsx)(y.E,{color:(0,l.dU)("gray.600","gray.300"),fontSize:"sm",children:new Date(B.date).toLocaleDateString("cs-CZ",{year:"numeric",month:"long",day:"numeric"})})]}),B.videoId&&(0,T.jsx)(u.N,{href:"https://www.youtube.com/watch?v=".concat(B.videoId),isExternal:!0,children:(0,T.jsx)(s.$,{size:"sm",colorScheme:"red",leftIcon:(0,T.jsx)(d.I,{as:k.Vk6}),children:P("action.open_on_youtube")})})]}),B.videoId&&(0,T.jsx)(r.a,{mt:4,children:(0,T.jsx)(E.A,{targetType:"youtube_video",targetId:B.videoId})})]})]})})]})]})]});const ae="grid3"===G?{base:1,md:3}:{base:1,md:2,lg:3};return(0,T.jsxs)(r.a,{children:[(0,T.jsxs)(r.a,{className:"section-head",children:[(0,T.jsx)(b.D,{as:"h3",size:"md",id:"home-videos-heading",children:P("nav.videos")}),(0,T.jsx)(u.N,{as:f.N_,to:"/videa",children:(0,T.jsx)(s.$,{size:"sm",variant:"outline",colorScheme:"blue",children:P("homepage.more_videos")})})]}),(0,T.jsx)(c.r,{columns:ae,spacing:4,children:ee.map((e,t)=>(0,T.jsx)(ne,{it:e,idx:t},e.key))},"videos-grid-".concat(G,"-").concat(ee.length)),(0,T.jsxs)(x.aF,{isOpen:O,onClose:K,size:"6xl",isCentered:!0,children:[(0,T.jsx)(p.m,{bg:"blackAlpha.800"}),(0,T.jsxs)(g.$,{bg:"transparent",boxShadow:"none",maxW:"90vw",children:[(0,T.jsx)(m.s,{color:"white",size:"lg",bg:"blackAlpha.600",_hover:{bg:"blackAlpha.700"},borderRadius:"full",zIndex:2}),(0,T.jsx)(h.c,{p:0,children:B&&(0,T.jsxs)(r.a,{children:[(0,T.jsx)(i.g,{ratio:16/9,maxH:"90vh",children:(0,T.jsx)("iframe",{src:"".concat(B.embedUrl,"?autoplay=1&vq=hd1080&rel=0&modestbranding=1&playsinline=1"),title:B.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,loading:"lazy",referrerPolicy:"strict-origin-when-cross-origin"})}),(0,T.jsxs)(r.a,{bg:(0,l.dU)("white","gray.800"),p:4,borderRadius:"md",mt:2,children:[(0,T.jsxs)(v.z,{justify:"space-between",align:"start",children:[(0,T.jsxs)(j.T,{align:"start",flex:1,children:[(0,T.jsx)(y.E,{fontWeight:"bold",fontSize:"lg",children:B.title}),B.date&&(0,T.jsx)(y.E,{color:(0,l.dU)("gray.600","gray.300"),fontSize:"sm",children:new Date(B.date).toLocaleDateString("cs-CZ",{year:"numeric",month:"long",day:"numeric"})})]}),B.videoId&&(0,T.jsx)(u.N,{href:"https://www.youtube.com/watch?v=".concat(B.videoId),isExternal:!0,children:(0,T.jsx)(s.$,{size:"sm",colorScheme:"red",leftIcon:(0,T.jsx)(d.I,{as:k.Vk6}),children:P("action.open_on_youtube")})})]}),B.videoId&&(0,T.jsx)(r.a,{mt:4,children:(0,T.jsx)(E.A,{targetType:"youtube_video",targetId:B.videoId})})]})]})})]})]})]})},R=C.memo(N)},49483:(e,t,n)=>{n.d(t,{Fd:()=>r,Iu:()=>s,QY:()=>i,Tu:()=>o,iD:()=>l,qE:()=>a});const a=[{id:"inter-inter",name:"Inter (Modern Clean)",heading:"Inter",body:"Inter",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap",cssHeading:"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",cssBody:"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",description:"Modern\xed univerz\xe1ln\xed font navr\u017een\xfd pro digit\xe1ln\xed \u010dten\xed",style:"modern"},{id:"montserrat-opensans",name:"Montserrat & Open Sans (Klasika)",heading:"Montserrat",body:"Open Sans",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800;900&family=Open+Sans:wght@400;500;600;700&display=swap",cssHeading:"'Montserrat', -apple-system, sans-serif",cssBody:"'Open Sans', -apple-system, sans-serif",description:"Obl\xedben\xe1 kombinace pro \u010ditelnost a profesionalitu",style:"classic"},{id:"poppins-roboto",name:"Poppins & Roboto (Sportovn\xed)",heading:"Poppins",body:"Roboto",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800;900&family=Roboto:wght@400;500;600;700&display=swap",cssHeading:"'Poppins', -apple-system, sans-serif",cssBody:"'Roboto', -apple-system, sans-serif",description:"Dynamick\xe1 kombinace vhodn\xe1 pro sportovn\xed weby",style:"bold"},{id:"raleway-lato",name:"Raleway & Lato (Elegantn\xed)",heading:"Raleway",body:"Lato",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Raleway:wght@600;700;800;900&family=Lato:wght@400;500;600;700&display=swap",cssHeading:"'Raleway', -apple-system, sans-serif",cssBody:"'Lato', -apple-system, sans-serif",description:"Elegantn\xed a lehk\xe1 kombinace pro pr\xe9miov\xfd vzhled",style:"elegant"},{id:"oswald-sourcesan",name:"Oswald & Source Sans (Siln\xe9)",heading:"Oswald",body:"Source Sans 3",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Oswald:wght@600;700&family=Source+Sans+3:wght@400;500;600;700&display=swap",cssHeading:"'Oswald', -apple-system, sans-serif",cssBody:"'Source Sans 3', -apple-system, sans-serif",description:"V\xfdrazn\xe9 nadpisy s \u010diteln\xfdm textem",style:"bold"},{id:"nunito-nunito",name:"Nunito (P\u0159\xe1telsk\xe9)",heading:"Nunito",body:"Nunito",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap",cssHeading:"'Nunito', -apple-system, sans-serif",cssBody:"'Nunito', -apple-system, sans-serif",description:"P\u0159\xe1telsk\xfd a p\u0159\xedstupn\xfd vzhled pro komunitn\xed weby",style:"playful"},{id:"worksans-worksans",name:"Work Sans (Tech)",heading:"Work Sans",body:"Work Sans",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700;800;900&display=swap",cssHeading:"'Work Sans', -apple-system, sans-serif",cssBody:"'Work Sans', -apple-system, sans-serif",description:"Modern\xed technick\xfd vzhled s v\xfdbornou \u010ditelnost\xed",style:"tech"},{id:"rubik-rubik",name:"Rubik (Zaoblen\xe9)",heading:"Rubik",body:"Rubik",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700;800;900&display=swap",cssHeading:"'Rubik', -apple-system, sans-serif",cssBody:"'Rubik', -apple-system, sans-serif",description:"Zaoblen\xfd a modern\xed design s p\u0159\xe1telsk\xfdm dojmem",style:"playful"},{id:"playfair-sourcesans",name:"Playfair & Source Sans (Presti\u017en\xed)",heading:"Playfair Display",body:"Source Sans 3",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800;900&family=Source+Sans+3:wght@400;500;600;700&display=swap",cssHeading:"'Playfair Display', Georgia, serif",cssBody:"'Source Sans 3', -apple-system, sans-serif",description:"Presti\u017en\xed serifov\xfd nadpis s modern\xedm textem",style:"elegant"},{id:"bebas-opensans",name:"Bebas Neue & Open Sans (Impact)",heading:"Bebas Neue",body:"Open Sans",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Open+Sans:wght@400;500;600;700&display=swap",cssHeading:"'Bebas Neue', -apple-system, sans-serif",cssBody:"'Open Sans', -apple-system, sans-serif",description:"Masivn\xed nadpisy pro maxim\xe1ln\xed dojem",style:"bold"},{id:"archivo-archivo",name:"Archivo (Kompaktn\xed)",heading:"Archivo",body:"Archivo",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800;900&display=swap",cssHeading:"'Archivo', -apple-system, sans-serif",cssBody:"'Archivo', -apple-system, sans-serif",description:"Kompaktn\xed a efektivn\xed pro hust\u0161\xed obsah",style:"tech"},{id:"exo-exo",name:"Exo 2 (Futuristick\xe9)",heading:"Exo 2",body:"Exo 2",googleFontsUrl:"https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600;700;800;900&display=swap",cssHeading:"'Exo 2', -apple-system, sans-serif",cssBody:"'Exo 2', -apple-system, sans-serif",description:"Futuristick\xfd a technologick\xfd vzhled",style:"tech"}],i=e=>a.find(t=>t.id===e),o=()=>a[0],r=e=>{if(document.querySelector('link[href="'.concat(e,'"]')))return;const t=document.createElement("link");t.href=e,t.rel="stylesheet",t.crossOrigin="anonymous",document.head.appendChild(t)},s=e=>{r(e.googleFontsUrl),document.documentElement.style.setProperty("--font-heading",e.cssHeading),document.documentElement.style.setProperty("--font-body",e.cssBody),document.documentElement.style.setProperty("--chakra-fonts-heading",e.cssHeading),document.documentElement.style.setProperty("--chakra-fonts-body",e.cssBody)},l=e=>({modern:"blue",classic:"gray",elegant:"purple",bold:"orange",playful:"pink",tech:"cyan"}[e]||"gray")},50271:(e,t,n)=>{n.d(t,{A:()=>O});var a=n(89379),i=n(65043),o=n(88787),r=n(85871),s=n(87139),l=n(22107),c=n(98662),d=n(42703),u=n(44093),h=n(82459),m=n(73225),p=n(76668),x=n(35699),g=n(61724),v=n(76659),j=n(96148),b=n(10202),y=n(98481),f=n(14566),k=n(31411),_=n(10227),w=n(51794),z=n(3109),S=n(19077),A=n(30502),C=n(53407),E=n(39081),T=n(72526),D=n(59781),N=n(12836),R=n(12730),F=n(58584),P=n(5874),I=n(84937),M=n(37575),L=n(71093),W=n(35200),U=n(70579);const O=e=>{let{articleId:t,eventId:n,onPollsChanged:O}=e;const q=(0,A.d)(),K=(0,D.jE)(),[B,Z]=(0,i.useState)(!0),[V,H]=(0,i.useState)(""),[$,J]=(0,i.useState)(!1),{confirm:G}=(0,W.G)(),[X,Y]=(0,i.useState)({title:"",description:"",type:"single",style:"auto",status:"active",allow_multiple:!1,max_choices:1,show_results:"after_vote",require_auth:!1,allow_guest_vote:!0,featured:!1,options:[{text:"",display_order:0},{text:"",display_order:1}]}),Q=(0,u.dU)("gray.50","gray.700"),ee=(0,u.dU)("gray.200","gray.600"),te=t?{article_id:t}:n?{event_id:n}:{},{data:ne,isLoading:ae}=(0,T.I)({queryKey:["linked-polls",te],queryFn:()=>(0,L.Ps)(te),enabled:!(!t&&!n)}),{data:ie,isLoading:oe}=(0,T.I)({queryKey:["all-admin-polls"],queryFn:()=>(0,L.cB)({status:"active"})}),re=(0,N.n)({mutationFn:async e=>{const a={};return t&&(a.related_article_id=t),n&&(a.related_event_id=n),(0,L.J8)(e,a)},onSuccess:()=>{K.invalidateQueries({queryKey:["linked-polls"]}),K.invalidateQueries({queryKey:["all-admin-polls"]}),q({title:"Anketa propojena",status:"success",duration:3e3}),H(""),O&&O()},onError:e=>{var t,n;q({title:"Chyba",description:(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se propojit anketu",status:"error",duration:5e3})}}),se=(0,N.n)({mutationFn:async e=>{const a={};return t&&(a.related_article_id=null),n&&(a.related_event_id=null),(0,L.J8)(e,a)},onSuccess:()=>{K.invalidateQueries({queryKey:["linked-polls"]}),K.invalidateQueries({queryKey:["all-admin-polls"]}),q({title:"Anketa odpojena",status:"success",duration:3e3}),O&&O()},onError:e=>{var t,n;q({title:"Chyba",description:(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se odpojit anketu",status:"error",duration:5e3})}}),le=(0,N.n)({mutationFn:async e=>{const i=(0,a.A)({},e);return t&&(i.related_article_id=t),n&&(i.related_event_id=n),(0,L.Gi)(i)},onSuccess:()=>{K.invalidateQueries({queryKey:["linked-polls"]}),K.invalidateQueries({queryKey:["all-admin-polls"]}),q({title:"Anketa vytvo\u0159ena a propojena",status:"success",duration:3e3}),J(!1),ce(),O&&O()},onError:e=>{var t,n;q({title:"Chyba p\u0159i vytv\xe1\u0159en\xed ankety",description:(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se vytvo\u0159it anketu",status:"error",duration:5e3})}}),ce=()=>{Y({title:"",description:"",type:"single",style:"auto",status:"active",allow_multiple:!1,max_choices:1,show_results:"after_vote",require_auth:!1,allow_guest_vote:!0,featured:!1,options:[{text:"",display_order:0},{text:"",display_order:1}]})},de=new Set((null===ne||void 0===ne?void 0:ne.map(e=>e.id))||[]),ue=(null===ie||void 0===ie?void 0:ie.filter(e=>!de.has(e.id)))||[],he=ie||[];return t||n?(0,U.jsx)(l.a,{borderWidth:"1px",borderColor:ee,borderRadius:"md",p:4,bg:Q,children:(0,U.jsxs)(b.T,{align:"stretch",spacing:3,children:[(0,U.jsxs)(j.z,{justify:"space-between",children:[(0,U.jsxs)(j.z,{children:[(0,U.jsxs)(E.E,{fontWeight:"bold",fontSize:"sm",children:["Ankety (",(null===ne||void 0===ne?void 0:ne.length)||0,")"]}),((null===ne||void 0===ne?void 0:ne.length)||0)>0&&(0,U.jsxs)(s.E,{colorScheme:"blue",children:[ne.length," p\u0159ipojeno"]})]}),(0,U.jsx)(d.K,{"aria-label":B?"Skr\xfdt":"Zobrazit",icon:B?(0,U.jsx)(I.M,{}):(0,U.jsx)(P.D,{}),size:"sm",variant:"ghost",onClick:()=>Z(!B)})]}),(0,U.jsx)(C.S,{in:B,children:(0,U.jsxs)(b.T,{spacing:4,align:"stretch",children:[ae?(0,U.jsxs)(j.z,{justify:"center",py:4,children:[(0,U.jsx)(v.y,{size:"sm"}),(0,U.jsx)(E.E,{fontSize:"sm",children:"Na\u010d\xedt\xe1n\xed anket..."})]}):ne&&ne.length>0?(0,U.jsxs)(b.T,{spacing:2,align:"stretch",children:[(0,U.jsx)(E.E,{fontSize:"xs",fontWeight:"bold",color:"gray.500",children:"P\u0159ipojen\xe9 ankety:"}),ne.map(e=>(0,U.jsxs)(j.z,{p:2,borderWidth:"1px",borderRadius:"md",justify:"space-between",bg:"white",_dark:{bg:"gray.800"},children:[(0,U.jsxs)(b.T,{align:"start",spacing:0,flex:1,children:[(0,U.jsx)(E.E,{fontSize:"sm",fontWeight:"medium",children:e.title}),(0,U.jsxs)(j.z,{spacing:2,children:[(0,U.jsx)(s.E,{size:"sm",colorScheme:"active"===e.status?"green":"gray",children:e.status}),(0,U.jsxs)(E.E,{fontSize:"xs",color:"gray.500",children:[e.total_votes," hlas\u016f"]})]})]}),(0,U.jsx)(d.K,{"aria-label":"Odpojit anketu",icon:(0,U.jsx)(F.d,{}),size:"sm",colorScheme:"red",variant:"ghost",onClick:()=>(async e=>{await G({title:"Odpojit anketu",message:"Opravdu chcete odpojit tuto anketu?",confirmText:"Odpojit",cancelText:"Zru\u0161it",isDanger:!0})&&se.mutate(e)})(e.id),isLoading:se.isPending})]},e.id))]}):(0,U.jsxs)(o.F,{status:"info",size:"sm",children:[(0,U.jsx)(r._,{}),(0,U.jsx)(E.E,{fontSize:"sm",children:"\u017d\xe1dn\xe9 ankety nejsou p\u0159ipojeny"})]}),(0,U.jsx)(h.c,{}),(0,U.jsxs)(z.t,{size:"sm",variant:"enclosed",defaultIndex:1,children:[(0,U.jsxs)(k.w,{children:[(0,U.jsx)(f.o,{children:"Propojit existuj\xedc\xed"}),(0,U.jsx)(f.o,{children:"Vytvo\u0159it novou"})]}),(0,U.jsxs)(w.T,{children:[(0,U.jsx)(_.K,{px:0,py:3,children:oe?(0,U.jsx)(j.z,{justify:"center",py:4,children:(0,U.jsx)(v.y,{size:"sm"})}):ue.length>0?(0,U.jsx)(b.T,{spacing:3,align:"stretch",children:(0,U.jsxs)(j.z,{children:[(0,U.jsx)(g.l,{value:V,onChange:e=>H(e.target.value),placeholder:"Vyberte anketu...",size:"sm",flex:1,children:ue.map(e=>(0,U.jsxs)("option",{value:e.id,children:[e.title," (",e.status,") - ",e.total_votes," hlas\u016f"]},e.id))}),(0,U.jsx)(c.$,{leftIcon:(0,U.jsx)(R.R,{}),onClick:()=>{V?re.mutate(parseInt(V)):q({title:"Vyberte anketu",description:"Pros\xedm vyberte anketu ze seznamu",status:"warning",duration:3e3})},size:"sm",colorScheme:"blue",isLoading:re.isPending,isDisabled:!V,children:"P\u0159ipojit"})]})}):he.length>0?(0,U.jsxs)(o.F,{status:"warning",size:"sm",children:[(0,U.jsx)(r._,{}),(0,U.jsxs)(b.T,{align:"start",spacing:2,children:[(0,U.jsx)(E.E,{fontSize:"sm",children:"V\u0161echny aktivn\xed ankety jsou ji\u017e propojeny s touto aktivitou."}),(0,U.jsxs)(E.E,{fontSize:"xs",color:"gray.600",children:["Dostupn\xe9 ankety (",he.length,"): ",he.map(e=>e.title).join(", ")]})]})]}):(0,U.jsxs)(o.F,{status:"info",size:"sm",children:[(0,U.jsx)(r._,{}),(0,U.jsx)(E.E,{fontSize:"sm",children:"\u017d\xe1dn\xe9 dostupn\xe9 ankety. Vytvo\u0159te novou v druh\xe9 z\xe1lo\u017ece."})]})}),(0,U.jsx)(_.K,{px:0,py:3,children:(0,U.jsxs)(b.T,{spacing:3,align:"stretch",children:[(0,U.jsxs)(j.z,{spacing:2,flexWrap:"wrap",children:[(0,U.jsx)(c.$,{size:"xs",onClick:()=>Y(e=>(0,a.A)((0,a.A)({},e),{},{title:"Hodnocen\xed z\xe1pasu",description:"Ohodno\u0165te z\xe1pas (1 = nejhor\u0161\xed, 5 = nejlep\u0161\xed)",type:"rating",style:"rating-stars",allow_multiple:!1,max_choices:1,options:Array.from({length:5}).map((e,t)=>({text:String(t+1),display_order:t+1}))})),children:"\u2b50 5"}),(0,U.jsx)(c.$,{size:"xs",onClick:()=>Y(e=>(0,a.A)((0,a.A)({},e),{},{title:"Hodnocen\xed (1\u201310)",description:"Ohodno\u0165te (1 = nejhor\u0161\xed, 10 = nejlep\u0161\xed)",type:"rating",style:"rating-scale",allow_multiple:!1,max_choices:1,options:Array.from({length:10}).map((e,t)=>({text:String(t+1),display_order:t+1}))})),children:"1\u201310"}),(0,U.jsx)(c.$,{size:"xs",onClick:()=>Y(e=>(0,a.A)((0,a.A)({},e),{},{title:"Doch\xe1zka",description:"Dej v\u011bd\u011bt, zda doraz\xed\u0161.",type:"single",style:"choices-chips",allow_multiple:!1,max_choices:1,options:[{text:"Ano",display_order:0},{text:"Ne",display_order:1},{text:"Mo\u017en\xe1",display_order:2}]})),children:"Doch\xe1zka"}),(0,U.jsx)(c.$,{size:"xs",onClick:()=>Y(e=>(0,a.A)((0,a.A)({},e),{},{title:"Doch\xe1zka (v\xedce mo\u017enost\xed)",description:"Vyberte jednu nebo dv\u011b mo\u017enosti.",type:"multiple",style:"choices-cards",allow_multiple:!0,max_choices:2,options:[{text:"Ano",display_order:0},{text:"Pozd\u011b doraz\xedm",display_order:1},{text:"Ne",display_order:2}]})),children:"Doch\xe1zka (multi)"}),(0,U.jsx)(c.$,{size:"xs",onClick:()=>Y(e=>(0,a.A)((0,a.A)({},e),{},{title:"V\xfdb\u011br mo\u017enost\xed",description:"Vyber a\u017e t\u0159i mo\u017enosti.",type:"multiple",style:"choices-list",allow_multiple:!0,max_choices:3,options:[{text:"A",display_order:0},{text:"B",display_order:1},{text:"C",display_order:2},{text:"D",display_order:3}]})),children:"Multi (3)"})]}),(0,U.jsxs)(m.MJ,{isRequired:!0,children:[(0,U.jsx)(p.l,{fontSize:"sm",children:"N\xe1zev ankety"}),(0,U.jsx)(x.p,{size:"sm",placeholder:"nap\u0159. Doraz\xed\u0161 na p\u0159\xed\u0161t\xed tr\xe9nink?",value:X.title,onChange:e=>Y(t=>(0,a.A)((0,a.A)({},t),{},{title:e.target.value}))})]}),(0,U.jsxs)(m.MJ,{children:[(0,U.jsx)(p.l,{fontSize:"sm",children:"Popis (voliteln\xe9)"}),(0,U.jsx)(S.T,{size:"sm",placeholder:"Dopl\u0148uj\xedc\xed informace k anket\u011b...",rows:2,value:X.description,onChange:e=>Y(t=>(0,a.A)((0,a.A)({},t),{},{description:e.target.value}))})]}),(0,U.jsxs)(m.MJ,{children:[(0,U.jsx)(p.l,{fontSize:"sm",children:"Typ ankety"}),(0,U.jsxs)(g.l,{size:"sm",value:X.type,onChange:e=>Y(t=>(0,a.A)((0,a.A)({},t),{},{type:e.target.value})),children:[(0,U.jsx)("option",{value:"single",children:"Jedna odpov\u011b\u010f"}),(0,U.jsx)("option",{value:"multiple",children:"V\xedce odpov\u011bd\xed"}),(0,U.jsx)("option",{value:"rating",children:"Hodnocen\xed"})]})]}),(0,U.jsxs)(m.MJ,{children:[(0,U.jsx)(p.l,{fontSize:"sm",children:"Styl"}),(0,U.jsxs)(g.l,{size:"sm",value:X.style||"auto",onChange:e=>Y(t=>(0,a.A)((0,a.A)({},t),{},{style:e.target.value})),children:[(0,U.jsx)("option",{value:"auto",children:"Automaticky"}),"rating"===X.type?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("option",{value:"rating-stars",children:"Hv\u011bzdi\u010dky"}),(0,U.jsx)("option",{value:"rating-scale",children:"\u010c\xedseln\xe1 stupnice"})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)("option",{value:"choices-list",children:"Seznam"}),(0,U.jsx)("option",{value:"choices-chips",children:"\u0160t\xedtky"}),(0,U.jsx)("option",{value:"choices-cards",children:"Karty"})]})]})]}),(0,U.jsxs)(m.MJ,{children:[(0,U.jsx)(p.l,{fontSize:"sm",children:"Mo\u017enosti (min. 2)"}),(0,U.jsxs)(b.T,{spacing:2,align:"stretch",children:[X.options.map((e,t)=>(0,U.jsxs)(j.z,{children:[(0,U.jsx)(x.p,{size:"sm",placeholder:"Mo\u017enost ".concat(t+1),value:e.text,onChange:e=>((e,t)=>{Y(n=>(0,a.A)((0,a.A)({},n),{},{options:n.options.map((n,i)=>i===e?(0,a.A)((0,a.A)({},n),{},{text:t}):n)}))})(t,e.target.value)}),X.options.length>2&&(0,U.jsx)(d.K,{"aria-label":"Odebrat mo\u017enost",icon:(0,U.jsx)(M.U,{}),size:"sm",variant:"ghost",colorScheme:"red",onClick:()=>(e=>{X.options.length<=2?q({title:"Anketa mus\xed m\xedt alespo\u0148 2 mo\u017enosti",status:"warning",duration:2e3}):Y(t=>(0,a.A)((0,a.A)({},t),{},{options:t.options.filter((t,n)=>n!==e).map((e,t)=>(0,a.A)((0,a.A)({},e),{},{display_order:t}))}))})(t)})]},t)),(0,U.jsx)(c.$,{size:"sm",variant:"outline",leftIcon:(0,U.jsx)(R.R,{}),onClick:()=>{Y(e=>(0,a.A)((0,a.A)({},e),{},{options:[...e.options,{text:"",display_order:e.options.length}]}))},children:"P\u0159idat mo\u017enost"})]})]}),(0,U.jsxs)(j.z,{spacing:4,children:[(0,U.jsxs)(m.MJ,{display:"flex",alignItems:"center",children:[(0,U.jsx)(p.l,{fontSize:"sm",mb:"0",mr:2,children:"Povolit hlasov\xe1n\xed host\u016f"}),(0,U.jsx)(y.d,{size:"sm",isChecked:X.allow_guest_vote,onChange:e=>Y(t=>(0,a.A)((0,a.A)({},t),{},{allow_guest_vote:e.target.checked}))})]}),(0,U.jsxs)(m.MJ,{display:"flex",alignItems:"center",children:[(0,U.jsx)(p.l,{fontSize:"sm",mb:"0",mr:2,children:"Aktivn\xed"}),(0,U.jsx)(y.d,{size:"sm",isChecked:"active"===X.status,onChange:e=>Y(t=>(0,a.A)((0,a.A)({},t),{},{status:e.target.checked?"active":"draft"}))})]})]}),(0,U.jsx)(c.$,{colorScheme:"green",size:"sm",leftIcon:(0,U.jsx)(R.R,{}),onClick:()=>{if(!X.title.trim())return void q({title:"Chyb\xed n\xe1zev ankety",status:"warning",duration:3e3});const e=X.options.filter(e=>e.text.trim());e.length<2?q({title:"Anketa mus\xed m\xedt alespo\u0148 2 mo\u017enosti",status:"warning",duration:3e3}):le.mutate((0,a.A)((0,a.A)({},X),{},{options:e}))},isLoading:le.isPending,children:"Vytvo\u0159it anketu"})]})})]})]}),(0,U.jsxs)(E.E,{fontSize:"xs",color:"gray.500",mt:2,children:["\ud83d\udca1 Tip: Ankety se zobraz\xed automaticky na konci ",t?"\u010dl\xe1nku":"aktivity"]})]})})]})}):null}},50817:()=>{},50896:(e,t,n)=>{n.r(t),n.d(t,{default:()=>se});var a=n(89379),i=n(65043),o=n(96870),r=n(87139),s=n(22107),l=n(98662),c=n(42703),d=n(98939),u=n(82459),h=n(73225),m=n(76668),p=n(73212),x=n(33572),g=n(35699),v=n(67516),j=n(35929),b=n(56529),y=n(15071),f=n(11054),k=n(78460),_=n(85421),w=n(97569),z=n(61724),S=n(96148),A=n(10202),C=n(80511),E=n(82595),T=n(67813),D=n(83201),N=n(3313),R=n(55395),F=n(14566),P=n(31411),I=n(10227),M=n(51794),L=n(3109),W=n(19077),U=n(30502),O=n(28846),q=n(39081),K=n(35475),B=n(6583),Z=n(72898),V=n(9976),H=n(12730),$=n(58584),J=n(99973),G=n(76479),X=n(96420),Y=n(34636),Q=n(91276),ee=n(79787),te=n(66776),ne=n(88500),ae=n(35200),ie=n(70579);const oe=e=>{if(!e)return"";const t=new Date(e);return isNaN(t.getTime())?"":t.toLocaleString("cs-CZ")},re={title:"",description:"",image_url:"",rules_url:"",start_at:"",end_at:"",picker_style:"cycler",total_prizes:1,prize_summary:"",entry_cost_points:0,max_entries_per_user:1},se=()=>{var e,t,n,se;const le=(0,U.d)(),[ce,de]=(0,i.useState)([]),[ue,he]=(0,i.useState)(!0),[me,pe]=(0,i.useState)(""),{confirm:xe}=(0,ae.G)(),{isOpen:ge,onOpen:ve,onClose:je}=(0,o.j)(),[be,ye]=(0,i.useState)(re),[fe,ke]=(0,i.useState)(null),_e=(0,i.useRef)(null);(0,i.useEffect)(()=>{_e.current=fe},[fe]);const[we,ze]=(0,i.useState)("draft-sweepstake-new"),[Se,Ae]=(0,i.useState)(!1),[Ce,Ee]=(0,i.useState)(null),[Te,De]=(0,i.useState)([]),[Ne,Re]=(0,i.useState)(()=>({name:"",quantity:1,image_url:"",kind:"physical",points:0,xp:0,description:""})),[Fe,Pe]=(0,i.useState)(!1),{isOpen:Ie,onOpen:Me,onClose:Le}=(0,o.j)(),[We,Ue]=(0,i.useState)(null),[Oe,qe]=(0,i.useState)({name:"",quantity:1,image_url:"",kind:"physical",points:0,xp:0,description:""}),[Ke,Be]=(0,i.useState)(0),[Ze,Ve]=(0,i.useState)(""),He=e=>{const t=new Date,n=e.start_at?new Date(e.start_at):new Date(t.getTime()+36e5),a=e.end_at?new Date(e.end_at):new Date(n.getTime()+12096e5),i=Number(e.total_prizes||1),o=Number.isFinite(i)?Math.floor(i):1,r=o<1?1:o>100?100:o,s=Math.max(0,Number(e.entry_cost_points)||0),l=Math.max(1,Number(e.max_entries_per_user)||1);return{title:(e.title||"").trim()||"Nov\xe1 sout\u011b\u017e",description:e.description||"",image_url:e.image_url||"",rules_url:e.rules_url||"",picker_style:e.picker_style||"cycler",prize_summary:e.prize_summary||"",total_prizes:r,entry_cost_points:s,max_entries_per_user:l,start_at:isNaN(n.getTime())?new Date(t.getTime()+36e5).toISOString():n.toISOString(),end_at:isNaN(a.getTime())?new Date(t.getTime()+1296e6).toISOString():a.toISOString()}},{saveStatus:$e,lastSaved:Je,forceSave:Ge,clearDraft:Xe,hasDraft:Ye,draftAge:Qe}=(0,te.UI)({data:(0,a.A)({id:null===fe||void 0===fe?void 0:fe.id},be),storageKey:we,onSave:async e=>{const t=He(e);if(e.id){return await(0,V.hR)(e.id,t)}if((e.title||"").trim()){const e=await(0,V.C$)(t);ke(e),ze("draft-sweepstake-".concat(e.id));try{localStorage.removeItem("draft-sweepstake-new")}catch(n){}return e}return{}},debounceMs:2e3,enabled:ge}),et=async()=>{try{if(_e.current)return _e.current;await Ge();const t=Date.now();for(;!_e.current&&Date.now()-t<1500;)await new Promise(e=>setTimeout(e,100));if(_e.current)return _e.current;const n=He(be),a=await(0,V.C$)(n);ke(a),ze("draft-sweepstake-".concat(a.id));try{De(await(0,V.rz)(a.id))}catch(e){De([])}return Be(2),le({status:"success",title:"Koncept sout\u011b\u017ee vytvo\u0159en"}),a}catch(t){return le({status:"error",title:"Nelze automaticky vytvo\u0159it sout\u011b\u017e"}),null}},tt=async()=>{he(!0);try{const e=await(0,V.jE)(me?{status:me}:void 0);de(e)}finally{he(!1)}},nt=async(e,t)=>{if(!fe)return;const n=[...Te],a=e+t;if(a<0||a>=n.length)return;const i=n[e];n[e]=n[a],n[a]=i,De(n),await(0,V.Ui)(fe.id,n.map(e=>e.id))};(0,i.useEffect)(()=>{tt()},[me]);const at=e=>{var t,n;ke(e),ye({title:e.title,description:e.description||"",image_url:e.image_url||"",rules_url:e.rules_url||"",start_at:e.start_at?String(e.start_at).slice(0,16):"",end_at:e.end_at?String(e.end_at).slice(0,16):"",picker_style:e.picker_style||"wheel",total_prizes:e.total_prizes||1,prize_summary:e.prize_summary||"",entry_cost_points:null!==(t=e.entry_cost_points)&&void 0!==t?t:0,max_entries_per_user:null!==(n=e.max_entries_per_user)&&void 0!==n?n:1}),Be(0),ve(),(async()=>{try{De(await(0,V.rz)(e.id))}catch(t){De([])}})()};return(0,ie.jsx)(B.A,{children:(0,ie.jsxs)(d.m,{maxW:"7xl",py:8,children:[(0,ie.jsxs)(S.z,{justify:"space-between",mb:4,flexWrap:"wrap",children:[(0,ie.jsx)(O.D,{size:"lg",children:"Sout\u011b\u017ee"}),(0,ie.jsxs)(S.z,{flexWrap:"wrap",children:[(0,ie.jsxs)(z.l,{value:me,onChange:e=>pe(e.target.value),size:"sm",maxW:"220px",children:[(0,ie.jsx)("option",{value:"",children:"V\u0161echny"}),(0,ie.jsx)("option",{value:"draft",children:"Koncepty"}),(0,ie.jsx)("option",{value:"scheduled",children:"Napl\xe1novan\xe9"}),(0,ie.jsx)("option",{value:"active",children:"Aktivn\xed"}),(0,ie.jsx)("option",{value:"finalized",children:"Dokon\u010den\xe9"}),(0,ie.jsx)("option",{value:"archived",children:"Archiv"})]}),(0,ie.jsx)(l.$,{colorScheme:"blue",onClick:()=>{const e="draft-sweepstake-new";ze(e);const t=(0,te.C_)(e);t&&Object.keys(t||{}).length?(Ee(t),Ae(!0)):(Ee(null),Ae(!1)),ke(null),ye(re),De([]),Be(0),ve()},minW:"max-content",children:"Nov\xe1 sout\u011b\u017e"})]})]}),ue?(0,ie.jsx)(q.E,{children:"Na\u010d\xedt\xe1m\u2026"}):(0,ie.jsx)(s.a,{overflowX:"auto",children:(0,ie.jsxs)(C.X,{size:"sm",children:[(0,ie.jsx)(N.d,{children:(0,ie.jsxs)(R.Tr,{children:[(0,ie.jsx)(D.Th,{children:"N\xe1zev"}),(0,ie.jsx)(D.Th,{children:"Obdob\xed"}),(0,ie.jsx)(D.Th,{children:"Stav"}),(0,ie.jsx)(D.Th,{children:"V\xfdhry"}),(0,ie.jsx)(D.Th,{children:"Akce"})]})}),(0,ie.jsx)(E.N,{children:ce.map(e=>{return(0,ie.jsxs)(R.Tr,{children:[(0,ie.jsx)(T.Td,{children:(0,ie.jsxs)(A.T,{align:"start",spacing:0,children:[(0,ie.jsx)(q.E,{fontWeight:"bold",children:e.title}),e.prize_summary&&(0,ie.jsx)(q.E,{fontSize:"xs",opacity:.8,children:e.prize_summary}),(0,ie.jsxs)(S.z,{spacing:2,wrap:"wrap",children:[(0,ie.jsx)(r.E,{colorScheme:e.entry_cost_points?"purple":"green",fontSize:"0.7rem",children:e.entry_cost_points?"Vstup: ".concat(e.entry_cost_points," bod\u016f"):"Vstup: zdarma"}),e.max_entries_per_user>1&&(0,ie.jsxs)(r.E,{colorScheme:"gray",fontSize:"0.7rem",children:["max ",e.max_entries_per_user,"\xd7/osoba"]})]})]})}),(0,ie.jsxs)(T.Td,{children:[oe(e.start_at)," \u2013 ",oe(e.end_at)]}),(0,ie.jsx)(T.Td,{children:(t=e.status,(0,ie.jsx)(r.E,{colorScheme:{draft:"gray",scheduled:"purple",active:"green",locked:"orange",finalized:"blue",archived:"red"}[t]||"gray",children:t}))}),(0,ie.jsx)(T.Td,{children:e.total_prizes||"-"}),(0,ie.jsx)(T.Td,{children:(0,ie.jsxs)(S.z,{spacing:2,children:[(0,ie.jsx)(l.$,{size:"xs",variant:"outline",onClick:()=>(e=>{ze("draft-sweepstake-".concat(e.id));const t=(0,te.C_)("draft-sweepstake-".concat(e.id));t&&Object.keys(t||{}).length?(Ee(t),Ae(!0)):(Ee(null),Ae(!1)),at(e)})(e),children:"Upravit"}),(0,ie.jsx)(l.$,{size:"xs",variant:"outline",onClick:()=>(async e=>{at(e),Be(2);try{De(await(0,V.rz)(e.id))}catch(t){De([])}})(e),children:"V\xfdhry"}),(0,ie.jsx)(l.$,{size:"xs",as:K.N_,to:"/admin/sweepstakes/".concat(e.id,"/visual"),variant:"outline",children:"Vizualizace"}),(0,ie.jsx)(l.$,{size:"xs",variant:"outline",onClick:()=>(async e=>{if(await xe({title:"Spustit losov\xe1n\xed",message:"Spustit losov\xe1n\xed a vybrat v\xfdherce?",confirmText:"Losovat",cancelText:"Zru\u0161it",isDanger:!0}))try{await(0,V.AT)(e.id),le({status:"success",title:"Losov\xe1n\xed dokon\u010deno"}),await tt()}catch(a){var t,n;le({status:"error",title:"Chyba",description:(null===a||void 0===a||null===(t=a.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nelze dokon\u010dit"})}})(e),isDisabled:"finalized"===e.status,children:"Losovat"}),(0,ie.jsx)(l.$,{size:"xs",colorScheme:"red",variant:"outline",onClick:()=>(async e=>{if(await xe({title:"Smazat sout\u011b\u017e",message:"Smazat sout\u011b\u017e?",confirmText:"Smazat",cancelText:"Zru\u0161it",isDanger:!0}))try{await(0,V.tc)(e.id),le({status:"success",title:"Smaz\xe1no"}),await tt()}catch(a){var t,n;le({status:"error",title:"Chyba",description:(null===a||void 0===a||null===(t=a.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nelze smazat"})}})(e),children:"Smazat"})]})})]},e.id);var t})})]})}),(0,ie.jsxs)(k.aF,{isOpen:ge,onClose:je,size:{base:"full",md:"full",lg:"full"},scrollBehavior:"inside",isCentered:!1,children:[(0,ie.jsx)(f.m,{}),(0,ie.jsxs)(_.$,{maxW:"none",w:{base:"100%",md:"95vw",lg:"90vw"},h:"90vh",mx:4,children:[(0,ie.jsx)(y.r,{children:(0,ie.jsxs)(S.z,{justify:"space-between",flexWrap:"wrap",children:[(0,ie.jsx)(q.E,{fontSize:"lg",fontWeight:"bold",children:fe?"Upravit sout\u011b\u017e":"Nov\xe1 sout\u011b\u017e"}),(0,ie.jsxs)(S.z,{spacing:3,flexShrink:0,children:[(0,ie.jsx)(ee.A,{status:$e,lastSaved:Je,compact:!0}),(0,ie.jsx)(l.$,{size:"sm",variant:"outline",onClick:Ge,children:"Ulo\u017eit nyn\xed"})]})]})}),(0,ie.jsx)(j.s,{}),(0,ie.jsxs)(v.c,{minH:"400px",maxH:"calc(90vh - 120px)",children:[Se&&(0,ie.jsx)(s.a,{mb:3,p:3,borderRadius:"md",bg:"yellow.50",borderWidth:"1px",borderColor:"yellow.200",children:(0,ie.jsxs)(S.z,{justify:"space-between",align:"center",children:[(0,ie.jsxs)(q.E,{children:["Byl nalezen m\xedstn\xed koncept",null!=Qe?" (p\u0159ed ".concat(Qe," min)"):"",". Chcete jej obnovit?"]}),(0,ie.jsxs)(S.z,{children:[(0,ie.jsx)(l.$,{size:"sm",onClick:()=>{if(Ce){const e=Ce;ye(t=>(0,a.A)((0,a.A)({},t),e))}Ae(!1)},children:"Obnovit"}),(0,ie.jsx)(l.$,{size:"sm",variant:"outline",onClick:()=>{Xe(),Ae(!1),Ee(null)},children:"Zahodit"})]})]})}),(0,ie.jsxs)(L.t,{index:Ke,onChange:Be,isFitted:!0,children:[(0,ie.jsxs)(P.w,{children:[(0,ie.jsx)(F.o,{children:"Z\xe1kladn\xed"}),(0,ie.jsx)(F.o,{children:"Term\xedny a limity"}),(0,ie.jsx)(F.o,{children:"V\xfdhry"})]}),(0,ie.jsxs)(M.T,{children:[(0,ie.jsx)(I.K,{children:(0,ie.jsxs)(A.T,{spacing:4,align:"stretch",children:[(0,ie.jsxs)(h.MJ,{isRequired:!0,children:[(0,ie.jsx)(m.l,{children:"N\xe1zev"}),(0,ie.jsx)(g.p,{value:be.title,onChange:e=>ye((0,a.A)((0,a.A)({},be),{},{title:e.target.value}))})]}),(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Popis"}),(0,ie.jsx)(W.T,{value:be.description,onChange:e=>ye((0,a.A)((0,a.A)({},be),{},{description:e.target.value}))})]}),(0,ie.jsxs)(p.r,{columns:2,spacing:4,children:[(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Tituln\xed obr\xe1zek"}),(0,ie.jsxs)(A.T,{align:"start",spacing:2,children:[(0,ie.jsx)(ne.A,{label:"Tituln\xed obr\xe1zek sout\u011b\u017ee",description:"Nahrajte nebo p\u0159et\xe1hn\u011bte tituln\xed obr\xe1zek sout\u011b\u017ee.",accept:"image/*",multiple:!1,maxFiles:1,uploadFn:async e=>{const t=await(0,Y.QM)(e);return ye(e=>(0,a.A)((0,a.A)({},e),{},{image_url:t.url})),{url:t.url,name:e.name,type:e.type||t.type||"image/*",size:e.size||t.size||0}},allowUrlImport:!0,urlPlaceholder:"/uploads/... nebo https://example.com/cover.jpg",onChange:e=>{const t=e[e.length-1];null!==t&&void 0!==t&&t.url&&(Ve(""),ye(e=>(0,a.A)((0,a.A)({},e),{},{image_url:t.url})))}}),(0,ie.jsxs)(S.z,{children:[(0,ie.jsx)(x._,{src:Ze||(0,Q.V)(be.image_url)||"/dist/img/logo-club-empty.svg",alt:"cover",boxSize:"80px",objectFit:"cover",borderRadius:"md"}),be.image_url&&(0,ie.jsx)(l.$,{size:"sm",variant:"ghost",onClick:()=>{ye(e=>(0,a.A)((0,a.A)({},e),{},{image_url:""})),Ve("")},children:"Odebrat"})]}),(0,ie.jsx)(g.p,{placeholder:"nebo vlo\u017ete URL",value:be.image_url,onChange:e=>ye((0,a.A)((0,a.A)({},be),{},{image_url:e.target.value}))})]})]}),(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Pravidla"}),(0,ie.jsxs)(A.T,{align:"start",spacing:2,children:[(0,ie.jsxs)(S.z,{flexWrap:"wrap",spacing:2,align:"flex-start",children:[(0,ie.jsx)(ne.A,{label:"Pravidla sout\u011b\u017ee",description:"Nahrajte PDF nebo obr\xe1zek s pravidly sout\u011b\u017ee.",accept:"image/*,application/pdf",multiple:!1,maxFiles:1,uploadFn:async e=>{const t=await(0,Y.QM)(e);return ye(e=>(0,a.A)((0,a.A)({},e),{},{rules_url:t.url})),{url:t.url,name:e.name,type:e.type||t.type||"application/octet-stream",size:e.size||t.size||0}},allowUrlImport:!0,urlPlaceholder:"/uploads/... nebo https://example.com/pravidla.pdf",onChange:e=>{const t=e[e.length-1];null!==t&&void 0!==t&&t.url&&ye(e=>(0,a.A)((0,a.A)({},e),{},{rules_url:t.url}))}}),(0,ie.jsx)(l.$,{variant:"outline",onClick:async()=>{try{const e=(be.title?"Pravidla sout\u011b\u017ee: ".concat(be.title):"Pravidla sout\u011b\u017ee").trim(),t=await(0,Y.N6)({title:e,content:"<p>Zde dopl\u0148te pravidla sout\u011b\u017ee.</p>",published:!0}),n="/articles/".concat(t.id);ye(e=>(0,a.A)((0,a.A)({},e),{},{rules_url:n})),le({status:"success",title:"Str\xe1nka pravidel vytvo\u0159ena"})}catch(e){le({status:"error",title:"Nelze vytvo\u0159it str\xe1nku pravidel"})}},children:"Vytvo\u0159it str\xe1nku"}),be.rules_url&&(0,ie.jsx)(l.$,{as:"a",href:(0,Q.V)(be.rules_url)||be.rules_url,target:"_blank",rel:"noreferrer noopener",variant:"ghost",children:"Otev\u0159\xedt"})]}),(0,ie.jsx)(g.p,{placeholder:"nebo vlo\u017ete URL",value:be.rules_url,onChange:e=>ye((0,a.A)((0,a.A)({},be),{},{rules_url:e.target.value}))})]})]})]})]})}),(0,ie.jsx)(I.K,{children:(0,ie.jsxs)(A.T,{spacing:4,align:"stretch",children:[(0,ie.jsx)(p.r,{columns:2,spacing:4,children:(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Za\u010d\xe1tek"}),(0,ie.jsx)(Z.A,{from:be.start_at||void 0,to:be.end_at||void 0,onChange:(e,t)=>{ye((0,a.A)((0,a.A)({},be),{},{start_at:e||"",end_at:t||""}))}})]})}),(0,ie.jsxs)(p.r,{columns:2,spacing:4,children:[(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Styl vizualizace"}),(0,ie.jsxs)(z.l,{value:be.picker_style,onChange:e=>ye((0,a.A)((0,a.A)({},be),{},{picker_style:e.target.value})),children:[(0,ie.jsx)("option",{value:"wheel",children:"Kolo \u0161t\u011bst\xed"}),(0,ie.jsx)("option",{value:"cycler",children:"N\xe1hodn\xfd p\u0159ep\xedna\u010d"})]})]}),(0,ie.jsxs)(h.MJ,{isInvalid:Number(be.total_prizes)<1||Number(be.total_prizes)>100,children:[(0,ie.jsx)(m.l,{children:"Po\u010det v\xfdherc\u016f"}),(0,ie.jsx)(w.Q7,{value:String(null!==(e=be.total_prizes)&&void 0!==e?e:""),min:1,keepWithinRange:!1,clampValueOnBlur:!1,onChange:e=>ye((0,a.A)((0,a.A)({},be),{},{total_prizes:e})),children:(0,ie.jsx)(w.OO,{})}),(0,ie.jsx)(h.eK,{children:"Max. 100 v\xfdherc\u016f"})]})]}),(0,ie.jsxs)(p.r,{columns:3,spacing:4,children:[(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Vstupn\xe9 (body)"}),(0,ie.jsx)(w.Q7,{min:0,value:Number(be.entry_cost_points)||0,onChange:e=>ye((0,a.A)((0,a.A)({},be),{},{entry_cost_points:Number(e)||0})),children:(0,ie.jsx)(w.OO,{})})]}),(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Max. \xfa\u010dast\xed / u\u017eivatel"}),(0,ie.jsx)(w.Q7,{min:1,keepWithinRange:!1,clampValueOnBlur:!1,value:String(null!==(t=be.max_entries_per_user)&&void 0!==t?t:""),onChange:e=>ye((0,a.A)((0,a.A)({},be),{},{max_entries_per_user:e})),children:(0,ie.jsx)(w.OO,{})})]})]})]})}),(0,ie.jsx)(I.K,{children:(0,ie.jsxs)(A.T,{align:"stretch",spacing:3,children:[(0,ie.jsxs)(S.z,{flexWrap:"wrap",spacing:2,children:[(0,ie.jsx)(l.$,{size:"sm",onClick:()=>Be(0),variant:"outline",children:"Zp\u011bt na z\xe1kladn\xed"}),(0,ie.jsx)(l.$,{size:"sm",onClick:async()=>{fe||await et(),Be(2),Re((0,a.A)((0,a.A)({},Ne),{},{name:"Hlavn\xed v\xfdhra",quantity:1,kind:"physical"})),le({status:"info",title:"P\u0159edvypln\u011bno: Hlavn\xed v\xfdhra",description:"Upravte a klikn\u011bte P\u0159idat"})},children:"1\xd7 Hlavn\xed v\xfdhra"}),(0,ie.jsx)(l.$,{size:"sm",onClick:async()=>{fe||await et(),Be(2),Re((0,a.A)((0,a.A)({},Ne),{},{name:"Men\u0161\xed v\xfdhra",quantity:3,kind:"physical"})),le({status:"info",title:"P\u0159edvypln\u011bno: 3\xd7 Men\u0161\xed v\xfdhra",description:"Upravte a klikn\u011bte P\u0159idat"})},children:"3\xd7 Men\u0161\xed v\xfdhry"}),(0,ie.jsx)(l.$,{size:"sm",onClick:async()=>{fe||await et(),Be(2),Re((0,a.A)((0,a.A)({},Ne),{},{name:"100 bod\u016f",quantity:10,kind:"points",points:100})),le({status:"info",title:"P\u0159edvypln\u011bno: 10\xd7 100 bod\u016f",description:"Upravte a klikn\u011bte P\u0159idat"})},children:"10\xd7 100 bod\u016f"}),(0,ie.jsx)(l.$,{size:"sm",onClick:async()=>{fe||await et(),Be(2),Re((0,a.A)((0,a.A)({},Ne),{},{name:"500 XP",quantity:5,kind:"xp",xp:500})),le({status:"info",title:"P\u0159edvypln\u011bno: 5\xd7 500 XP",description:"Upravte a klikn\u011bte P\u0159idat"})},children:"5\xd7 500 XP"})]}),(0,ie.jsx)(u.c,{}),0===Te.length&&(0,ie.jsx)(q.E,{color:"gray.500",children:"Zat\xedm \u017e\xe1dn\xe9 v\xfdhry"}),(0,ie.jsx)(A.T,{align:"stretch",spacing:2,children:Te.map((e,t)=>(0,ie.jsxs)(S.z,{spacing:2,borderWidth:"1px",borderRadius:"md",p:2,flexWrap:"wrap",children:[(0,ie.jsx)(c.K,{"aria-label":"Nahoru",size:"xs",icon:(0,ie.jsx)(G.K,{}),onClick:()=>nt(t,-1),flexShrink:0}),(0,ie.jsx)(c.K,{"aria-label":"Dol\u016f",size:"xs",icon:(0,ie.jsx)(X.Z,{}),onClick:()=>nt(t,1),flexShrink:0}),e.image_url?(0,ie.jsx)(x._,{src:(0,Q.V)(e.image_url)||e.image_url,alt:e.name,boxSize:"36px",objectFit:"cover",borderRadius:"md",flexShrink:0}):null,(0,ie.jsxs)(A.T,{align:"start",spacing:0,flex:1,minW:"250px",children:[(0,ie.jsx)(q.E,{fontWeight:"600",children:e.name}),e.description&&(0,ie.jsx)(q.E,{fontSize:"xs",color:"gray.600",noOfLines:1,children:e.description})]}),(0,ie.jsxs)(q.E,{flexShrink:0,children:["\xd7",e.quantity]}),e.kind&&(0,ie.jsx)(q.E,{fontSize:"xs",px:2,py:.5,borderRadius:"md",borderWidth:"1px",color:"gray.600",flexShrink:0,children:"physical"===e.kind?"fyzick\xe1":"points"===e.kind?"body ".concat(e.points||0):"xp"===e.kind?"XP ".concat(e.xp||0):"body ".concat(e.points||0," + XP ").concat(e.xp||0)}),(0,ie.jsx)(c.K,{"aria-label":"Upravit",size:"xs",icon:(0,ie.jsx)(J.q,{}),onClick:()=>(e=>{Ue(e),qe({name:e.name||"",quantity:e.quantity||1,image_url:e.image_url||"",kind:e.kind||"physical",points:e.points||0,xp:e.xp||0,description:e.description||""}),Me()})(e),flexShrink:0}),(0,ie.jsx)(c.K,{"aria-label":"Smazat",size:"xs",colorScheme:"red",icon:(0,ie.jsx)($.d,{}),onClick:()=>(async e=>{if(!fe)return;await xe({title:"Smazat v\xfdhru",message:"Smazat v\xfdhru?",confirmText:"Smazat",cancelText:"Zru\u0161it",isDanger:!0})&&(await(0,V.RE)(fe.id,e.id),De(await(0,V.rz)(fe.id)))})(e),flexShrink:0})]},e.id))}),(0,ie.jsx)(u.c,{}),(0,ie.jsx)(O.D,{size:"sm",children:"P\u0159idat v\xfdhru"}),(0,ie.jsxs)(p.r,{columns:{base:1,lg:4},spacing:3,alignItems:"end",children:[(0,ie.jsxs)(h.MJ,{isRequired:!0,children:[(0,ie.jsx)(m.l,{children:"N\xe1zev"}),(0,ie.jsx)(g.p,{value:Ne.name,onChange:e=>Re((0,a.A)((0,a.A)({},Ne),{},{name:e.target.value}))})]}),(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Po\u010det"}),(0,ie.jsx)(w.Q7,{min:1,keepWithinRange:!1,clampValueOnBlur:!1,value:String(null!==(n=Ne.quantity)&&void 0!==n?n:""),onChange:e=>Re((0,a.A)((0,a.A)({},Ne),{},{quantity:e})),children:(0,ie.jsx)(w.OO,{})})]}),(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Obr\xe1zek URL"}),(0,ie.jsxs)(S.z,{align:"flex-start",spacing:2,children:[(0,ie.jsx)(g.p,{value:Ne.image_url,onChange:e=>Re((0,a.A)((0,a.A)({},Ne),{},{image_url:e.target.value}))}),(0,ie.jsx)(s.a,{flexShrink:0,children:(0,ie.jsx)(ne.A,{label:"Obr\xe1zek v\xfdhry",description:"Nahrajte obr\xe1zek v\xfdhry.",accept:"image/*",multiple:!1,maxFiles:1,uploadFn:async e=>{const t=await(0,Y.QM)(e);return Re(e=>(0,a.A)((0,a.A)({},e),{},{image_url:t.url})),{url:t.url,name:e.name,type:e.type||t.type||"image/*",size:e.size||t.size||0}}})})]})]}),(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Typ v\xfdhry"}),(0,ie.jsxs)(z.l,{value:Ne.kind||"physical",onChange:e=>Re((0,a.A)((0,a.A)({},Ne),{},{kind:e.target.value})),children:[(0,ie.jsx)("option",{value:"physical",children:"Fyzick\xe1 v\xfdhra"}),(0,ie.jsx)("option",{value:"points",children:"Body"}),(0,ie.jsx)("option",{value:"xp",children:"XP"}),(0,ie.jsx)("option",{value:"points_xp",children:"Body + XP"})]})]})]}),(0,ie.jsxs)(p.r,{columns:{base:1,lg:2},spacing:3,alignItems:"end",children:[("points"===Ne.kind||"points_xp"===Ne.kind)&&(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Body"}),(0,ie.jsx)(w.Q7,{min:0,value:Number(Ne.points)||0,onChange:e=>Re((0,a.A)((0,a.A)({},Ne),{},{points:Number(e)||0})),children:(0,ie.jsx)(w.OO,{})})]}),("xp"===Ne.kind||"points_xp"===Ne.kind)&&(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"XP"}),(0,ie.jsx)(w.Q7,{min:0,value:Number(Ne.xp)||0,onChange:e=>Re((0,a.A)((0,a.A)({},Ne),{},{xp:Number(e)||0})),children:(0,ie.jsx)(w.OO,{})})]})]}),(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Popis (voliteln\xe9)"}),(0,ie.jsx)(g.p,{value:Ne.description||"",onChange:e=>Re((0,a.A)((0,a.A)({},Ne),{},{description:e.target.value}))})]}),(0,ie.jsx)(S.z,{justify:"flex-end",children:(0,ie.jsx)(l.$,{leftIcon:(0,ie.jsx)(H.R,{}),colorScheme:"blue",size:"sm",onClick:async()=>{if(fe)if(Ne.name.trim())try{Pe(!0),await(0,V.GO)(fe.id,{name:Ne.name,quantity:Math.max(1,parseInt(String(Ne.quantity||"1"),10)||1),image_url:Ne.image_url,display_order:Te.length,kind:Ne.kind,points:Ne.points,xp:Ne.xp,description:Ne.description}),Re({name:"",quantity:1,image_url:"",kind:"physical",points:0,xp:0,description:""}),De(await(0,V.rz)(fe.id))}catch(e){le({status:"error",title:"Nelze ulo\u017eit v\xfdhru"})}finally{Pe(!1)}else le({status:"error",title:"N\xe1zev v\xfdhry je povinn\xfd"});else le({status:"info",title:"Ulo\u017ete sout\u011b\u017e a pot\xe9 p\u0159idejte v\xfdhry"})},isLoading:Fe,children:"P\u0159idat"})})]})})]})]})]}),(0,ie.jsx)(b.j,{children:(0,ie.jsxs)(S.z,{children:[(0,ie.jsx)(l.$,{onClick:je,variant:"ghost",children:"Zav\u0159\xedt"}),(0,ie.jsx)(l.$,{colorScheme:"blue",onClick:async()=>{try{if(!be.title||!be.start_at||!be.end_at)return void le({status:"error",title:"Vypl\u0148te n\xe1zev a datumy"});const e=Number(be.total_prizes||1),t=Number.isFinite(e)?Math.floor(e):1,i=t<1?1:t>100?100:t,o=Math.max(0,Number(be.entry_cost_points)||0),r=Math.max(1,Number(be.max_entries_per_user)||1),s=new Date(be.start_at),l=new Date(be.end_at),c=(0,a.A)((0,a.A)({},be),{},{total_prizes:i,entry_cost_points:o,max_entries_per_user:r,start_at:isNaN(s.getTime())?be.start_at:s.toISOString(),end_at:isNaN(l.getTime())?be.end_at:l.toISOString()});if(fe)await(0,V.hR)(fe.id,c),le({status:"success",title:"Ulo\u017eeno"}),je(),await tt();else{const e=await(0,V.C$)(c);le({status:"success",title:"Vytvo\u0159eno",description:"Nyn\xed m\u016f\u017eete p\u0159idat v\xfdhry"}),ke(e),Be(2);try{De(await(0,V.rz)(e.id))}catch(n){De([])}await tt()}}catch(i){var e,t;le({status:"error",title:"Chyba",description:(null===i||void 0===i||null===(e=i.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||"Operace selhala"})}},children:"Ulo\u017eit"})]})})]})]}),(0,ie.jsxs)(k.aF,{isOpen:Ie,onClose:()=>{Le(),Ue(null)},size:"lg",isCentered:!0,children:[(0,ie.jsx)(f.m,{}),(0,ie.jsxs)(_.$,{children:[(0,ie.jsx)(y.r,{children:"Upravit v\xfdhru"}),(0,ie.jsx)(j.s,{}),(0,ie.jsx)(v.c,{children:(0,ie.jsxs)(A.T,{spacing:3,align:"stretch",children:[(0,ie.jsxs)(p.r,{columns:{base:1,md:2},spacing:3,children:[(0,ie.jsxs)(h.MJ,{isRequired:!0,children:[(0,ie.jsx)(m.l,{children:"N\xe1zev"}),(0,ie.jsx)(g.p,{value:Oe.name,onChange:e=>qe((0,a.A)((0,a.A)({},Oe),{},{name:e.target.value}))})]}),(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Po\u010det"}),(0,ie.jsx)(w.Q7,{min:1,keepWithinRange:!1,clampValueOnBlur:!1,value:String(null!==(se=Oe.quantity)&&void 0!==se?se:""),onChange:e=>qe((0,a.A)((0,a.A)({},Oe),{},{quantity:e})),children:(0,ie.jsx)(w.OO,{})})]})]}),(0,ie.jsx)(p.r,{columns:{base:1,md:2},spacing:3,children:(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Obr\xe1zek URL"}),(0,ie.jsxs)(S.z,{align:"flex-start",spacing:2,children:[(0,ie.jsx)(g.p,{value:Oe.image_url||"",onChange:e=>qe((0,a.A)((0,a.A)({},Oe),{},{image_url:e.target.value}))}),(0,ie.jsx)(s.a,{flexShrink:0,children:(0,ie.jsx)(ne.A,{label:"Obr\xe1zek v\xfdhry",description:"Nahrajte obr\xe1zek v\xfdhry.",accept:"image/*",multiple:!1,maxFiles:1,uploadFn:async e=>{const t=await(0,Y.QM)(e);return qe(e=>(0,a.A)((0,a.A)({},e),{},{image_url:t.url})),{url:t.url,name:e.name,type:e.type||t.type||"image/*",size:e.size||t.size||0}}})})]})]})}),(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Popis (voliteln\xe9)"}),(0,ie.jsx)(g.p,{value:Oe.description||"",onChange:e=>qe((0,a.A)((0,a.A)({},Oe),{},{description:e.target.value}))})]}),(0,ie.jsxs)(p.r,{columns:{base:1,md:3},spacing:3,children:[(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Typ v\xfdhry"}),(0,ie.jsxs)(z.l,{value:Oe.kind||"physical",onChange:e=>qe((0,a.A)((0,a.A)({},Oe),{},{kind:e.target.value})),children:[(0,ie.jsx)("option",{value:"physical",children:"Fyzick\xe1 v\xfdhra"}),(0,ie.jsx)("option",{value:"points",children:"Body"}),(0,ie.jsx)("option",{value:"xp",children:"XP"}),(0,ie.jsx)("option",{value:"points_xp",children:"Body + XP"})]})]}),("points"===Oe.kind||"points_xp"===Oe.kind)&&(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"Body"}),(0,ie.jsx)(w.Q7,{min:0,value:Number(Oe.points)||0,onChange:e=>qe((0,a.A)((0,a.A)({},Oe),{},{points:Number(e)||0})),children:(0,ie.jsx)(w.OO,{})})]}),("xp"===Oe.kind||"points_xp"===Oe.kind)&&(0,ie.jsxs)(h.MJ,{children:[(0,ie.jsx)(m.l,{children:"XP"}),(0,ie.jsx)(w.Q7,{min:0,value:Number(Oe.xp)||0,onChange:e=>qe((0,a.A)((0,a.A)({},Oe),{},{xp:Number(e)||0})),children:(0,ie.jsx)(w.OO,{})})]})]})]})}),(0,ie.jsx)(b.j,{children:(0,ie.jsxs)(S.z,{children:[(0,ie.jsx)(l.$,{onClick:()=>{Le(),Ue(null)},variant:"ghost",children:"Zru\u0161it"}),(0,ie.jsx)(l.$,{colorScheme:"blue",onClick:async()=>{if(fe&&We)try{Pe(!0),await(0,V.tp)(fe.id,We.id,{name:Oe.name,quantity:Math.max(1,parseInt(String(Oe.quantity||"1"),10)||1),image_url:Oe.image_url,kind:Oe.kind,points:Oe.points,xp:Oe.xp,description:Oe.description}),le({status:"success",title:"V\xfdhra upravena"}),Le(),Ue(null),De(await(0,V.rz)(fe.id))}catch(e){le({status:"error",title:"Nelze upravit v\xfdhru"})}finally{Pe(!1)}},isLoading:Fe,children:"Ulo\u017eit"})]})})]})]})]})})}},51587:(e,t,n)=>{n.r(t),n.d(t,{default:()=>S});var a=n(65043),i=n(73449),o=n(57550),r=n(34636),s=(n(91296),n(46291),n(25189)),l=(n(29661),n(79219),n(22107)),c=n(28846),d=n(39081),u=n(73212),h=n(40384);const m={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic",REACT_APP_ESHOP_URL:"http://localhost:3100",REACT_APP_ERROR_INGEST_URL:"http://127.0.0.1:8083/api/v1/errors",REACT_APP_ERROR_INGEST_TOKEN:""}.REACT_APP_FACR_CLUB_ID||"",p={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic",REACT_APP_ESHOP_URL:"http://localhost:3100",REACT_APP_ERROR_INGEST_URL:"http://127.0.0.1:8083/api/v1/errors",REACT_APP_ERROR_INGEST_TOKEN:""}.REACT_APP_FACR_CLUB_TYPE||"football";var x=n(89910),g=n(69522),v=n(82501),j=n(48644),b=n(86403),y=n(5371),f=n(7189),k=n(42703),_=n(1009),w=(n(80348),n(70579));const z=e=>{var t,n;let{title:i,titleLink:o="#",articles:r,itemsPerView:s={mobile:1,tablet:2,desktop:3},gap:d=16,showControls:u=!0,enableDrag:h=!0,showUnlimitedBadge:m=!0,showCategories:p=!0,showDuration:x=!0}=e;const[g,v]=(0,a.useState)(0),[j,b]=(0,a.useState)(!1),[z,S]=(0,a.useState)(0),[A,C]=(0,a.useState)(0),E=(0,a.useRef)(null),T=()=>{if("undefined"===typeof window)return s.desktop;const e=window.innerWidth;return e<768?s.mobile:e<1024?s.tablet:s.desktop},[D,N]=(0,a.useState)(T());(0,a.useEffect)(()=>{const e=()=>{N(T())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const R=Math.max(0,r.length-D),F=g<R,P=g>0,I=()=>{b(!1)},M=-g*(((null===(t=E.current)||void 0===t||null===(n=t.children[0])||void 0===n?void 0:n.clientWidth)||0)+d);return(0,w.jsxs)(l.a,{className:"sparta-slider-container sparta-container sparta-section",children:[(0,w.jsxs)(y.s,{className:"sparta-slider-header",justifyContent:"space-between",alignItems:"center",mb:4,children:[(0,w.jsx)(c.D,{className:"sparta-slider-title",as:"h2",children:(0,w.jsxs)(f.N,{href:o,display:"inline-flex",alignItems:"center",gap:2,children:[i,(0,w.jsx)(l.a,{as:_.dyV})]})}),u&&(0,w.jsxs)(y.s,{className:"sparta-slider-controls",gap:2,children:[(0,w.jsx)(k.K,{"aria-label":"Previous",icon:(0,w.jsx)(_.irw,{}),onClick:()=>{P&&v(e=>Math.max(e-1,0))},isDisabled:!P,className:"sparta-slider-button",variant:"ghost"}),(0,w.jsx)(k.K,{"aria-label":"Next",icon:(0,w.jsx)(_.fOo,{}),onClick:()=>{F&&v(e=>Math.min(e+1,R))},isDisabled:!F,className:"sparta-slider-button",variant:"ghost"})]})]}),(0,w.jsx)(l.a,{className:"sparta-slider-viewport",overflow:"hidden",children:(0,w.jsx)(y.s,{ref:E,className:"sparta-slider-track",gap:"".concat(d,"px"),transition:"transform 0.3s cubic-bezier(0.4, 0, 0.6, 1)",transform:"translate3d(".concat(M,"px, 0, 0)"),cursor:h?j?"grabbing":"grab":"default",onMouseDown:e=>{h&&E.current&&(b(!0),S(e.pageX-E.current.offsetLeft),C(E.current.scrollLeft))},onMouseUp:I,onMouseMove:e=>{if(!j||!E.current)return;e.preventDefault();const t=2*(e.pageX-E.current.offsetLeft-z);E.current.scrollLeft=A-t},onMouseLeave:I,children:r.map(e=>(0,w.jsx)(l.a,{className:"sparta-slider-slide",flexShrink:0,"data-dragging":j,children:(0,w.jsxs)(f.N,{href:"/articles/".concat(e.slug),className:"sparta-article-card",textDecoration:"none",_hover:{textDecoration:"none"},children:[(0,w.jsxs)(l.a,{className:"sparta-article-image",position:"relative",children:[(0,w.jsx)("img",{src:e.image,alt:e.title,loading:"lazy",draggable:!1}),m&&e.unlimited&&(0,w.jsx)(l.a,{className:"sparta-article-meta",children:(0,w.jsx)(l.a,{className:"sparta-article-badge",children:"UNLIMITED"})}),x&&e.duration&&(0,w.jsx)(l.a,{position:"absolute",bottom:"8px",right:"8px",padding:"4px 8px",background:"rgba(0, 0, 0, 0.8)",borderRadius:"4px",fontSize:"0.75rem",fontWeight:"500",children:e.duration})]}),(0,w.jsxs)(l.a,{className:"sparta-article-details",children:[p&&e.categories.length>0&&(0,w.jsx)(y.s,{className:"sparta-article-categories",children:e.categories.map((t,n)=>(0,w.jsxs)(a.Fragment,{children:[(0,w.jsx)("span",{children:t}),n<e.categories.length-1&&(0,w.jsx)(l.a,{className:"sparta-hero-separator"})]},n))}),(0,w.jsx)(c.D,{className:"sparta-article-title",as:"h3",size:"sm",children:e.title}),(0,w.jsx)(l.a,{className:"sparta-article-date",mt:"auto",children:new Date(e.date).toLocaleDateString("cs-CZ",{year:"numeric",month:"long",day:"numeric"})})]})]})},e.id))})})]})},S=()=>{var e;const{data:t}=(0,o.s)(),n=(null===t||void 0===t?void 0:t.club_name)||"Fotbal Club",y=(null===t||void 0===t?void 0:t.club_id)||m,f=(null===t||void 0===t?void 0:t.club_type)||p,[k,_]=a.useState([]),[S,A]=a.useState([]),[C,E]=a.useState([]),[T,D]=a.useState([]),[N,R]=a.useState(null),[F,P]=a.useState(void 0),[I,M]=a.useState(void 0);a.useEffect(()=>{let e=!1;const t=e=>{try{const[t,n]=String(e||"").split(" "),a=(t||"").split(".").map(e=>Number(e)),i=a[0],o=a[1],r=a[2],[s,l]=(n||"").split(":").map(e=>Number(e));return i&&o&&r?new Date(r,(o||1)-1,i,s||0,l||0):null}catch(t){return null}};return(async()=>{try{const[t,n]=await Promise.all([(0,r.A0)({page_size:4}).catch(()=>({data:[]})),(0,r.GE)({page:1,page_size:8,published:!0}).catch(()=>({data:[]}))]);if(e)return;const a=(null===t||void 0===t?void 0:t.data)||[],i=(null===n||void 0===n?void 0:n.data)||[];_(a.slice(0,3)),A(i);const o=new Set(a.map(e=>e.id)),s=[...a,...i].filter(e=>!o.has(e.id)).slice(0,8).map(e=>({id:e.id,title:e.title,excerpt:e.excerpt||void 0,image:e.image_url,slug:e.slug}));E(s)}catch(a){}try{if(!y)return;const[a,o]=await Promise.all([h.J.getClub(String(y),f||"football").catch(()=>null),h.J.getClubTable(String(y),f||"football").catch(()=>null)]);if(e)return;if(a&&Array.isArray(a.competitions)){const n=a.competitions||[],o=Date.now();let r=null;if(n.forEach(e=>{const n=e.name||e.code||"Sout\u011b\u017e";(e.matches||[]).forEach(e=>{const a=t(e.date_time);if(!a)return;const i=a.getTime();i<o||(!r||i<r.dt.getTime())&&(r={m:e,compName:n,dt:a})})}),!r&&n.length>0){const e=n[0],a=(e.matches||[]).slice().reverse()[0];if(a){const n=t(a.date_time)||new Date;r={m:a,compName:e.name||e.code||"Sout\u011b\u017e",dt:n}}}if(r&&!e){R({competition:r.compName,home:r.m.home,home_id:r.m.home_id,home_logo_url:r.m.home_logo_url,away:r.m.away,away_id:r.m.away_id,away_logo_url:r.m.away_logo_url}),P(r.compName);try{const e="".concat(r.dt.toLocaleDateString("cs-CZ")," ").concat(r.dt.toLocaleTimeString("cs-CZ",{hour:"2-digit",minute:"2-digit"}));M(e)}catch(i){M(void 0)}}}if(o&&Array.isArray(o.competitions)){var n;const e=(o.competitions||[]).find(e=>{var t;return Array.isArray(null===(t=e.table)||void 0===t?void 0:t.overall)&&e.table.overall.length>0});e&&Array.isArray(null===(n=e.table)||void 0===n?void 0:n.overall)&&D(e.table.overall)}}catch(o){}})(),()=>{e=!0}},[y,f]);const L=k[0],W=a.useMemo(()=>{const e=new Map;return[...k,...S].forEach(t=>{t&&(e.has(t.id)||e.set(t.id,t))}),Array.from(e.values()).slice(0,10).map(e=>{var t;return{id:String(e.id),title:e.title,slug:e.slug||String(e.id),image:(0,s.uq)(e.image_url)||"/images/news/placeholder.jpg",categories:null!==(t=e.category)&&void 0!==t&&t.name?[e.category.name]:[],date:e.published_at||e.created_at||(new Date).toISOString()}})},[k,S]);return(0,w.jsxs)(i.A,{children:[(0,w.jsx)(l.a,{className:"sparta-hero-container sparta-container sparta-section",children:L&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(l.a,{className:"sparta-hero-background",children:(0,w.jsx)("img",{src:(0,s.uq)(L.image_url)||"/dist/img/logo-club-empty.svg",alt:L.title})}),(0,w.jsxs)(l.a,{className:"sparta-hero-article",children:[(0,w.jsxs)(l.a,{className:"sparta-hero-categories",children:[(0,w.jsx)("span",{className:"sparta-hero-category-badge",children:n}),(null===(e=L.category)||void 0===e?void 0:e.name)&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(l.a,{className:"sparta-hero-separator"}),(0,w.jsx)("span",{children:L.category.name})]})]}),(0,w.jsx)(c.D,{as:"h1",className:"sparta-hero-title",children:L.title}),L.content&&(0,w.jsx)(d.E,{className:"sparta-hero-description",children:(()=>{const e=(e=>{if(!e)return"";try{return e.replace(/<[^>]+>/g," ")}catch(t){return e}})(L.content);return e.length>180?"".concat(e.slice(0,180),"\u2026"):e})()}),(0,w.jsx)(l.a,{mt:4,className:"sparta-hero-button",children:(0,w.jsx)("a",{href:L.slug?"/news/".concat(L.slug):"/articles/".concat(L.id),className:"sparta-button-primary",children:"\u010c\xedst \u010dl\xe1nek"})})]})]})}),W.length>0&&(0,w.jsx)(l.a,{className:"sparta-container sparta-section",children:(0,w.jsx)(z,{title:"Aktuality",titleLink:"/blog",articles:W})}),(N||T.length>0)&&(0,w.jsx)(l.a,{className:"sparta-container sparta-section",children:(0,w.jsxs)(u.r,{columns:{base:1,lg:3},spacing:8,children:[N&&(0,w.jsxs)(l.a,{gridColumn:{base:"span 1",lg:"span 2"},children:[(0,w.jsx)(c.D,{as:"h2",size:"md",mb:3,textTransform:"uppercase",children:"Nejbli\u017e\u0161\xed z\xe1pas"}),(0,w.jsx)(v.A,{data:N,competitionName:F,countdown:I})]}),T.length>0&&(0,w.jsxs)(l.a,{children:[(0,w.jsx)(c.D,{as:"h2",size:"md",mb:3,textTransform:"uppercase",children:"Tabulka"}),(0,w.jsx)(g.default,{rows:T})]})]})}),(0,w.jsxs)(l.a,{className:"sparta-container sparta-section",children:[(0,w.jsx)(c.D,{as:"h2",size:"md",mb:3,textTransform:"uppercase",children:"Novinky"}),(0,w.jsx)(x.A,{items:C,seeAllHref:"/blog",seeAllLabel:"V\u0161echny \u010dl\xe1nky"})]}),(0,w.jsx)(l.a,{className:"sparta-container sparta-section",children:(0,w.jsx)(j.default,{variant:"grid"})}),(0,w.jsx)(l.a,{className:"sparta-container sparta-section",children:(0,w.jsx)(b.default,{variant:"carousel"})})]})}},52332:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Y});var a=n(89379),i=n(65043),o=n(96870),r=n(88787),s=n(34334),l=n(85871),c=n(33430),d=n(87139),u=n(22107),h=n(98662),m=n(42703),p=n(44093),x=n(82459),g=n(73225),v=n(76668),j=n(33572),b=n(35699),y=n(67516),f=n(35929),k=n(56529),_=n(15071),w=n(11054),z=n(78460),S=n(85421),A=n(61724),C=n(76659),E=n(96148),T=n(10202),D=n(98481),N=n(80511),R=n(82595),F=n(67813),P=n(83201),I=n(3313),M=n(55395),L=n(30502),W=n(28846),U=n(39081),O=n(1009),q=n(72526),K=n(59781),B=n(12836),Z=n(6583),V=n(6484),H=n(34636),$=n(25189),J=n(88500),G=n(70579);const X=[{value:"homepage_middle",label:"St\u0159edn\xed banner (Homepage - st\u0159ed)",description:"Banner ve st\u0159edu str\xe1nky mezi obsahem",width:970,height:250,aspectRatio:3.88,position:"middle"},{value:"homepage_footer",label:"Spodn\xed banner (Homepage - z\xe1pat\xed)",description:"Banner v doln\xed \u010d\xe1sti str\xe1nky p\u0159ed z\xe1pat\xedm",width:1200,height:200,aspectRatio:6,position:"footer"},{value:"article_inline",label:"Banner v \u010dl\xe1nc\xedch",description:"Banner zobrazen\xfd v textu \u010dl\xe1nk\u016f",width:728,height:90,aspectRatio:8.09,position:"article"},{value:"article_sidebar",label:"Banner v \u010dl\xe1nku (sidebar)",description:"Banner v prav\xe9m sloupci detailu \u010dl\xe1nku",width:300,height:250,aspectRatio:1.2,position:"article"},{value:"homepage_under_table",label:"Pod tabulkou (Homepage)",description:"Banner pod sekc\xed Tabulky na tituln\xed str\xe1nce",width:970,height:90,aspectRatio:10.78,position:"under_table"}],Y=()=>{(0,p.dU)("white","gray.800");const e=(0,p.dU)("gray.200","gray.700"),t=(0,p.dU)("white","gray.700"),n=(0,L.d)(),Y=(0,K.jE)(),{data:Q,isLoading:ee}=(0,q.I)(["admin-banners"],()=>(0,V.Oh)()),[te,ne]=(0,i.useState)(null),[ae,ie]=(0,i.useState)(null),[oe,re]=(0,i.useState)([]),[se,le]=(0,i.useState)(!0),{isOpen:ce,onOpen:de,onClose:ue}=(0,o.j)(),he=e=>X.find(t=>t.value===e),me=()=>{ne(null),ie(null),re([]),ue()};(0,i.useEffect)(()=>{(async()=>{try{var e,t,n;const a=await(0,H.GE)({page:1,page_size:1,published:!0});le((null!==(e=null===a||void 0===a?void 0:a.total)&&void 0!==e?e:0)>0||(null!==(t=null===a||void 0===a||null===(n=a.data)||void 0===n?void 0:n.length)&&void 0!==t?t:0)>0)}catch(a){le(!0)}})()},[]);const pe=(0,B.n)({mutationFn:e=>(0,V.Zt)(e),onSuccess:()=>{n({title:"Banner vytvo\u0159en",status:"success"}),Y.invalidateQueries({queryKey:["admin-banners"]}),me()},onError:e=>{var t,a;return n({title:"Vytvo\u0159en\xed selhalo",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.message)||"Chyba",status:"error"})}}),xe=(0,B.n)({mutationFn:e=>{let{id:t,payload:n}=e;return(0,V.cQ)(t,n)},onSuccess:()=>{n({title:"Banner upraven",status:"success"}),Y.invalidateQueries({queryKey:["admin-banners"]}),me()},onError:e=>{var t,a;return n({title:"Aktualizace selhala",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.message)||"Chyba",status:"error"})}}),ge=(0,B.n)({mutationFn:e=>(0,V.Oe)(e),onSuccess:()=>{n({title:"Banner smaz\xe1n",status:"success"}),Y.invalidateQueries({queryKey:["admin-banners"]})},onError:e=>{var t,a;return n({title:"Smaz\xe1n\xed selhalo",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.message)||"Chyba",status:"error"})}}),ve=Q||[];return(0,G.jsx)(Z.A,{children:(0,G.jsxs)(u.a,{children:[(0,G.jsxs)(E.z,{justify:"space-between",mb:4,children:[(0,G.jsx)(W.D,{size:"lg",children:"Bannery a reklamn\xed plochy"}),(0,G.jsx)(h.$,{leftIcon:(0,G.jsx)(O.GGD,{}),colorScheme:"blue",onClick:()=>{const e=X[0];ne({name:"",is_active:!0,placement:e.value,width:e.width,height:e.height}),ie(null),re([]),de()},children:"Nov\xfd banner"})]}),(0,G.jsx)(U.E,{color:"gray.500",mb:6,children:"Spr\xe1va banner\u016f a reklamn\xedch ploch zobrazovan\xfdch na webu. M\u016f\u017eete p\u0159id\xe1vat, upravovat a odeb\xedrat bannery."}),(0,G.jsx)(u.a,{bg:(0,p.dU)("white","gray.800"),borderWidth:"1px",borderRadius:"lg",overflowX:"auto",boxShadow:"sm",mb:6,children:(0,G.jsxs)(N.X,{size:"sm",children:[(0,G.jsx)(I.d,{children:(0,G.jsxs)(M.Tr,{children:[(0,G.jsx)(P.Th,{w:"100px",children:"N\xe1hled"}),(0,G.jsx)(P.Th,{children:"N\xe1zev"}),(0,G.jsx)(P.Th,{children:"Um\xedst\u011bn\xed"}),(0,G.jsx)(P.Th,{children:"Rozm\u011bry"}),(0,G.jsx)(P.Th,{w:"100px",children:"Aktivn\xed"}),(0,G.jsx)(P.Th,{w:"160px",children:"Akce"})]})}),(0,G.jsxs)(R.N,{children:[ee&&(0,G.jsx)(M.Tr,{children:(0,G.jsxs)(F.Td,{colSpan:6,textAlign:"center",children:[(0,G.jsx)(C.y,{size:"sm",mr:2}),"Na\u010d\xedt\xe1n\xed\u2026"]})}),!ee&&ve.map(e=>{const n=he(e.placement);return(0,G.jsxs)(M.Tr,{opacity:e.is_active?1:.6,children:[(0,G.jsx)(F.Td,{children:(0,G.jsx)(j._,{src:(0,$.uq)(e.image_url)||"/sponsor-placeholder.svg",alt:e.name,boxSize:"56px",objectFit:"contain",bg:t,borderRadius:"md"})}),(0,G.jsxs)(F.Td,{children:[(0,G.jsx)(U.E,{fontWeight:"500",children:e.name}),e.click_url&&(0,G.jsx)(U.E,{fontSize:"xs",color:"gray.500",noOfLines:1,children:e.click_url})]}),(0,G.jsx)(F.Td,{children:n?(0,G.jsxs)(T.T,{align:"start",spacing:0,children:[(0,G.jsx)(U.E,{fontSize:"sm",fontWeight:"500",children:n.label}),(0,G.jsx)(d.E,{colorScheme:"blue",fontSize:"xs",children:n.position})]}):(0,G.jsx)(U.E,{fontSize:"xs",color:"gray.500",children:"-"})}),(0,G.jsx)(F.Td,{children:e.width&&e.height?(0,G.jsxs)(U.E,{fontSize:"xs",children:[e.width," \xd7 ",e.height]}):"-"}),(0,G.jsx)(F.Td,{children:(0,G.jsx)(d.E,{colorScheme:e.is_active?"green":"gray",children:e.is_active?"Ano":"Ne"})}),(0,G.jsx)(F.Td,{children:(0,G.jsxs)(E.z,{children:[(0,G.jsx)(m.K,{"aria-label":"Upravit",size:"sm",icon:(0,G.jsx)(O.WXf,{}),onClick:()=>{return t=e,ne((0,a.A)({},t)),ie(null),re([]),void de();var t}}),(0,G.jsx)(m.K,{"aria-label":"Smazat",size:"sm",colorScheme:"red",icon:(0,G.jsx)(O.IXo,{}),onClick:()=>{null!=e.id&&ge.mutate(e.id)}})]})})]},e.id)})]})]})}),(0,G.jsxs)(z.aF,{isOpen:ce,onClose:me,size:"lg",children:[(0,G.jsx)(w.m,{}),(0,G.jsxs)(S.$,{maxW:"90vw",maxH:"90vh",overflowY:"auto",children:[(0,G.jsx)(_.r,{children:null!==te&&void 0!==te&&te.id?"Upravit banner":"Nov\xfd banner"}),(0,G.jsx)(f.s,{}),(0,G.jsx)(y.c,{children:(0,G.jsxs)(T.T,{align:"stretch",spacing:4,children:[(0,G.jsxs)(g.MJ,{isRequired:!0,children:[(0,G.jsx)(v.l,{children:"N\xe1zev"}),(0,G.jsx)(b.p,{value:(null===te||void 0===te?void 0:te.name)||"",onChange:e=>ne(t=>(0,a.A)((0,a.A)({},t),{},{name:e.target.value}))})]}),(0,G.jsxs)(g.MJ,{children:[(0,G.jsx)(v.l,{children:"Odkaz (po kliku)"}),(0,G.jsx)(b.p,{type:"url",value:(null===te||void 0===te?void 0:te.click_url)||"",onChange:e=>ne(t=>(0,a.A)((0,a.A)({},t),{},{click_url:e.target.value})),placeholder:"https://partner.cz"})]}),ae&&(0,G.jsxs)(r.F,{status:"info",borderRadius:"md",children:[(0,G.jsx)(l._,{}),(0,G.jsxs)(u.a,{flex:"1",children:[(0,G.jsxs)(c.X,{fontSize:"sm",children:["Rozli\u0161en\xed obr\xe1zku: ",ae.width," \xd7 ",ae.height," px"]}),(0,G.jsxs)(s.T,{fontSize:"xs",children:["Pom\u011br stran: ",(ae.width/ae.height).toFixed(2),":1"]})]})]}),oe.length>0&&(0,G.jsxs)(u.a,{p:3,bg:(0,p.dU)("blue.50","blue.900"),borderRadius:"md",children:[(0,G.jsxs)(U.E,{fontSize:"sm",fontWeight:"600",mb:2,color:(0,p.dU)("blue.700","blue.200"),children:[(0,G.jsx)(O.A3x,{style:{display:"inline",marginRight:"6px"}}),"Doporu\u010den\xe1 um\xedst\u011bn\xed na z\xe1klad\u011b rozli\u0161en\xed:"]}),(0,G.jsx)(T.T,{align:"stretch",spacing:1,children:oe.map((e,t)=>(0,G.jsxs)(E.z,{justify:"space-between",fontSize:"xs",children:[(0,G.jsxs)(U.E,{children:[(0,G.jsx)(d.E,{colorScheme:0===t?"green":"blue",mr:2,children:0===t?"Nejlep\u0161\xed":"#".concat(t+1)}),e.label," (",e.width,"\xd7",e.height,")"]}),(null===te||void 0===te?void 0:te.placement)!==e.value&&(0,G.jsx)(h.$,{size:"xs",variant:"link",colorScheme:"blue",onClick:()=>{ne(t=>(0,a.A)((0,a.A)({},t),{},{placement:e.value,width:e.width,height:e.height}))},children:"Pou\u017e\xedt"})]},e.value))})]}),(0,G.jsxs)(g.MJ,{isRequired:!0,children:[(0,G.jsx)(v.l,{children:"Um\xedst\u011bn\xed na webu"}),(0,G.jsxs)(A.l,{value:(null===te||void 0===te?void 0:te.placement)||"",onChange:e=>{const t=e.target.value,n=he(t);ne(e=>(0,a.A)((0,a.A)({},e),{},{placement:t,width:null===n||void 0===n?void 0:n.width,height:null===n||void 0===n?void 0:n.height}))},children:[(0,G.jsx)("option",{value:"",children:"\u2014 vyberte um\xedst\u011bn\xed \u2014"}),X.map(e=>{const t="article_inline"===e.value,n=t&&!se,a=t&&!se?"".concat(e.label," \u2014 nelze pou\u017e\xedt (na webu zat\xedm nen\xed \u017e\xe1dn\xfd \u010dl\xe1nek)"):"".concat(e.label," (").concat(e.width,"\xd7").concat(e.height,")");return(0,G.jsx)("option",{value:e.value,disabled:n,title:t&&!se?"Tuto pozici lze pou\u017e\xedt a\u017e kdy\u017e existuje alespo\u0148 1 publikovan\xfd \u010dl\xe1nek.":e.description,children:a},e.value)})]}),(null===te||void 0===te?void 0:te.placement)&&(()=>{const e=he(te.placement);return e?(0,G.jsx)(U.E,{fontSize:"xs",color:"gray.500",mt:1,children:e.description}):null})()]}),(null===te||void 0===te?void 0:te.placement)&&(()=>{const n=he(te.placement);return n?(0,G.jsxs)(u.a,{p:3,bg:t,borderRadius:"md",borderWidth:"1px",borderColor:e,children:[(0,G.jsxs)(E.z,{justify:"space-between",mb:1,children:[(0,G.jsx)(U.E,{fontSize:"sm",fontWeight:"600",children:"Rozm\u011bry banneru:"}),(0,G.jsxs)(d.E,{colorScheme:"blue",children:[n.width," \xd7 ",n.height," px"]})]}),(0,G.jsxs)(U.E,{fontSize:"xs",color:"gray.500",children:["Pom\u011br stran: ",n.aspectRatio.toFixed(2),":1 \u2022 Pozice: ",n.position]})]}):null})(),(0,G.jsx)(x.c,{}),(0,G.jsxs)(g.MJ,{children:[(0,G.jsx)(v.l,{children:"Obr\xe1zek banneru"}),(0,G.jsxs)(T.T,{align:"stretch",spacing:3,children:[(null===te||void 0===te?void 0:te.image_url)&&(()=>{const n=he(null===te||void 0===te?void 0:te.placement),a=n?Math.min(n.width,600):300,i=n?a/n.aspectRatio:150;return(0,G.jsxs)(u.a,{children:[(0,G.jsx)(U.E,{fontSize:"xs",color:"gray.500",mb:2,children:"N\xe1hled banneru:"}),(0,G.jsx)(u.a,{borderWidth:"2px",borderColor:e,borderRadius:"md",p:2,bg:t,children:(0,G.jsx)(j._,{src:(0,$.uq)(null===te||void 0===te?void 0:te.image_url)||"/sponsor-placeholder.svg",alt:"banner preview",width:"".concat(a,"px"),height:"".concat(i,"px"),objectFit:"contain",mx:"auto",display:"block"})}),n&&(0,G.jsxs)(U.E,{fontSize:"xs",color:"gray.500",mt:1,textAlign:"center",children:["Zobrazen\xed v pozici: ",n.label]})]})})(),(0,G.jsx)(J.A,{label:"Obr\xe1zek banneru",description:"Nahrajte obr\xe1zek banneru. Rozli\u0161en\xed pou\u017eijeme pro doporu\u010den\xed ide\xe1ln\xedho um\xedst\u011bn\xed.",accept:"image/*",multiple:!1,maxFiles:1,allowUrlImport:!1,uploadFn:async e=>{const t=new window.Image,n=new Promise((n,a)=>{t.onload=()=>n({width:t.width,height:t.height}),t.onerror=a,t.src=URL.createObjectURL(e)});try{const i=await n;ie(i);const o=((e,t)=>{const n=e/t;return X.map(a=>({preset:a,score:2*Math.abs(a.aspectRatio-n)+Math.abs(a.width-e)/a.width+Math.abs(a.height-t)/a.height})).sort((e,t)=>e.score-t.score).slice(0,3).map(e=>e.preset)})(i.width,i.height);re(o);const r=await(0,H.QM)(e);if(ne(e=>(0,a.A)((0,a.A)({},e||{}),{},{image_url:r.url})),(null===te||void 0===te||!te.placement)&&o.length>0){const e=o[0];ne(t=>(0,a.A)((0,a.A)({},t||{}),{},{placement:e.value,width:e.width,height:e.height}))}return URL.revokeObjectURL(t.src),{url:r.url,name:e.name,type:e.type||r.type||"image/*",size:e.size||r.size||0}}catch(i){const e=(null===i||void 0===i?void 0:i.message)||"Nahr\xe1n\xed selhalo";throw new Error(e)}}}),!(null!==te&&void 0!==te&&te.image_url)&&(0,G.jsxs)(r.F,{status:"warning",fontSize:"xs",children:[(0,G.jsx)(l._,{boxSize:"12px"}),(0,G.jsx)(U.E,{fontSize:"xs",children:"Nahrajte obr\xe1zek pro automatick\xe9 doporu\u010den\xed um\xedst\u011bn\xed"})]})]})]}),(0,G.jsxs)(g.MJ,{display:"flex",alignItems:"center",children:[(0,G.jsx)(v.l,{mb:"0",children:"Aktivn\xed"}),(0,G.jsx)(D.d,{isChecked:!(null===te||void 0===te||!te.is_active),onChange:e=>ne(t=>(0,a.A)((0,a.A)({},t),{},{is_active:e.target.checked}))})]})]})}),(0,G.jsxs)(k.j,{children:[(0,G.jsx)(h.$,{variant:"ghost",mr:3,onClick:me,children:"Zru\u0161it"}),(0,G.jsx)(h.$,{colorScheme:"blue",onClick:async()=>{var e;if(!te)return;const t={name:te.name||"",image_url:te.image_url,click_url:te.click_url,is_active:null===(e=te.is_active)||void 0===e||e,placement:te.placement||"",width:te.width||void 0,height:te.height||void 0};null!=te.id?await xe.mutateAsync({id:te.id,payload:t}):await pe.mutateAsync(t)},isLoading:pe.isLoading||xe.isLoading,children:"Ulo\u017eit"})]})]})]})]})})}},52716:(e,t,n)=>{n.r(t),n.d(t,{default:()=>S});var a=n(65043),i=n(73216),o=n(22107),r=n(98662),s=n(68659),l=n(34946),c=n(44093),d=n(73225),u=n(76668),h=n(33572),m=n(35699),p=n(45973),x=n(29244),g=n(10202),v=n(30502),j=n(28846),b=n(29066),y=n(46291),f=n(74117),k=n(74770),_=n(25189),w=n(2367),z=n(70579);const S=()=>{var e,t;const{t:n}=(0,f.Bd)(),{isAuthenticated:S,adminExists:A,login:C}=(0,b.A)(),[E,T]=(0,a.useState)(""),[D,N]=(0,a.useState)(""),[R,F]=(0,a.useState)(!1),[P,I]=(0,a.useState)(!1),[M,L]=(0,a.useState)(!0),[W,U]=(0,a.useState)(null),O=(0,i.Zp)(),q=(0,i.zy)(),K=(0,v.d)(),B=(0,c.dU)("white","gray.800");if((0,a.useEffect)(()=>{let e=!0;return(async()=>{try{const t=await(0,k.l3)();e&&U(t)}catch(t){}})(),()=>{e=!1}},[]),S)return(0,z.jsx)(i.C5,{to:"/admin",replace:!0});null===(e=q.state)||void 0===e||null===(t=e.from)||void 0===t||t.pathname;return(0,z.jsx)(o.a,{minH:"100vh",display:"flex",alignItems:"center",justifyContent:"center",bg:"gray.50",children:(0,z.jsxs)(o.a,{w:"100%",maxW:"md",p:8,bg:B,borderRadius:"lg",boxShadow:"lg",children:[(0,z.jsx)(s.o,{mb:4,children:null!==W&&void 0!==W&&W.club_logo_url?(0,z.jsx)(h._,{src:(0,_.uq)(W.club_logo_url)||W.club_logo_url,alt:W.club_name||"Club logo",maxH:"64px",objectFit:"contain"}):(0,z.jsx)(j.D,{size:"md",children:"P\u0159ihl\xe1\u0161en\xed"})}),(0,z.jsxs)(g.T,{as:"form",onSubmit:async e=>{e.preventDefault(),I(!0);try{var t,n;const e=await y.Ay.post("/auth/login",{email:E,password:D}),{token:a,user:i}=e.data;C(a,i,M),K({title:"P\u0159ihl\xe1\u0161en\xed prob\u011bhlo \xfasp\u011b\u0161n\u011b",status:"success",duration:3e3,isClosable:!0});const o=String((null===i||void 0===i?void 0:i.role)||"").toLowerCase(),r=null===(t=q.state)||void 0===t||null===(n=t.from)||void 0===n?void 0:n.pathname;let l=null;try{l=localStorage.getItem("fc_post_setup_target"),l&&localStorage.removeItem("fc_post_setup_target")}catch(s){}if("admin"===o||"editor"===o){O(r||l||"/admin",{replace:!0})}else O("/",{replace:!0})}catch(l){var a,i,o,r;K({title:"P\u0159ihl\xe1\u0161en\xed selhalo",description:(null===(a=l.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||(null===(o=l.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.message)||"Neplatn\xfd e-mail nebo heslo",status:"error",duration:5e3,isClosable:!0})}finally{I(!1)}},spacing:4,align:"stretch",children:[(0,z.jsxs)(d.MJ,{id:"login-email",isRequired:!0,children:[(0,z.jsx)(u.l,{children:"E-mailov\xe1 adresa"}),(0,z.jsx)(m.p,{type:"email",value:E,onChange:e=>T(e.target.value),placeholder:"Zadejte sv\u016fj e-mail"})]}),(0,z.jsxs)(d.MJ,{id:"login-password",children:[(0,z.jsxs)(u.l,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,z.jsxs)(o.a,{as:"span",display:"inline-flex",alignItems:"center",children:[(0,z.jsx)(o.a,{as:"span",mr:1,children:"Heslo"}),(0,z.jsx)(o.a,{as:"span",color:"red.500",children:"*"})]}),(0,z.jsx)(w.II,{})]}),(0,z.jsxs)(p.M,{children:[(0,z.jsx)(m.p,{type:R?"text":"password",value:D,onChange:e=>N(e.target.value),placeholder:"Zadejte sv\xe9 heslo",required:!0,"aria-required":"true"}),(0,z.jsx)(x.t,{width:"4.5rem",children:(0,z.jsx)(r.$,{h:"1.75rem",size:"sm",onClick:()=>F(e=>!e),children:R?"Skr\xfdt":"Zobrazit"})})]})]}),(0,z.jsx)(l.S,{isChecked:M,onChange:e=>L(e.target.checked),children:"Zapamatovat p\u0159ihl\xe1\u0161en\xed"}),(0,z.jsx)(r.$,{type:"submit",colorScheme:"blue",isLoading:P,loadingText:"P\u0159ihla\u0161uji...",mt:4,children:n("auth.login")}),(0,z.jsx)(o.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",children:(0,z.jsx)(r.$,{variant:"link",colorScheme:"blue",onClick:()=>O("/forgot-password?admin=1"),children:n("auth.forgot_password")})})]})]})})}},52976:(e,t,n)=>{n.d(t,{A:()=>S});var a=n(89379),i=n(65043),o=n(22107),r=n(98662),s=n(42703),l=n(44093),c=n(73212),d=n(35699),u=n(7360),h=n(96148),m=n(10202),p=n(99956),x=n(39081),g=n(2127),v=n(70579);const j={manual:[],recent:[]},b="myclub-colorpicker-v1";function y(e){return Math.min(1,Math.max(0,e))}function f(e){if(!e)return null;let t=e.trim();if(t.startsWith("#")||(t="#".concat(t)),t=t.slice(1),![3,4,6,8].includes(t.length))return null;3!==t.length&&4!==t.length||(t=t.split("").map(e=>e+e).join(""));const n=8===t.length,a=parseInt(t.slice(0,2),16),i=parseInt(t.slice(2,4),16),o=parseInt(t.slice(4,6),16),r=n?parseInt(t.slice(6,8),16)/255:1;return Number.isNaN(a)||Number.isNaN(i)||Number.isNaN(o)||Number.isNaN(r)?null:{r:a,g:i,b:o,a:r}}function k(e){const t=f(e)||{r:255,g:0,b:0,a:1},n=t.r/255,a=t.g/255,i=t.b/255,o=Math.max(n,a,i),r=o-Math.min(n,a,i);let s=0;const l=o,c=0===o?0:r/o;if(0!==r)switch(o){case n:s=60*((a-i)/r+(a<i?6:0));break;case a:s=60*((i-n)/r+2);break;default:s=60*((n-a)/r+4)}return Number.isFinite(s)||(s=0),{h:s,s:c,v:l,a:t.a}}function _(e){const t=(e.h%360+360)%360,n=y(e.s),a=y(e.v),i=y(e.a),o=a*n,r=o*(1-Math.abs(t/60%2-1)),s=a-o;let l=0,c=0,d=0;t<60?(l=o,c=r,d=0):t<120?(l=r,c=o,d=0):t<180?(l=0,c=o,d=r):t<240?(l=0,c=r,d=o):t<300?(l=r,c=0,d=o):(l=o,c=0,d=r);return function(e,t,n,a){const i=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0"),o=i(e),r=i(t),s=i(n),l=i(255*a);return a>=.999?"#".concat(o).concat(r).concat(s):"#".concat(o).concat(r).concat(s).concat(l)}(255*(l+s),255*(c+s),255*(d+s),i)}function w(e){if("undefined"===typeof window)return j;try{const t=window.localStorage.getItem(e||b);if(!t)return j;const n=JSON.parse(t);return n&&"object"===typeof n?{manual:Array.isArray(n.manual)?n.manual:[],recent:Array.isArray(n.recent)?n.recent:[]}:j}catch(t){return j}}function z(e,t){if("undefined"!==typeof window)try{window.localStorage.setItem(t||b,JSON.stringify(e))}catch(n){}}const S=e=>{let{value:t,onChange:n,onChangeComplete:j,label:b,showAlpha:S=!1,showEyeDropper:A=!0,recentStorageKey:C,onInteractionStart:E,onInteractionEnd:T,compact:D=!1,hideHistory:N=!1}=e;const R=(0,l.dU)("white","gray.800"),F=(0,l.dU)("gray.200","gray.700"),P=(0,l.dU)("gray.700","gray.100"),I=(0,l.dU)("gray.500","gray.400"),[M,L]=(0,i.useState)(()=>k(t||"#ff0000")),[W,U]=(0,i.useState)(()=>_(M)),[O,q]=(0,i.useState)(W.toUpperCase()),[K,B]=(0,i.useState)(!1),[Z,V]=(0,i.useState)(()=>w(C)),[H,$]=(0,i.useState)(!1),J=(0,i.useRef)(null),G=(0,i.useRef)(M);(0,i.useEffect)(()=>{"undefined"!==typeof window&&window.EyeDropper&&$(!0)},[]),(0,i.useEffect)(()=>{const e=_(k(t||W));L(k(e)),U(e),K||q(e.toUpperCase())},[t]),(0,i.useEffect)(()=>{G.current=M},[M]),(0,i.useEffect)(()=>{V(w(C))},[C]);const X=(0,i.useCallback)(function(e){let{complete:t,addToRecent:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=_(e);L(e),U(o),K||q(o.toUpperCase()),n(o),i&&V(e=>{const t=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;const i=(t||"").toLowerCase();if(!i)return e;const o=[i,...e.recent.filter(e=>e!==i)];return(0,a.A)((0,a.A)({},e),{},{recent:o.slice(0,n)})}(e,o);return z(t,C),t}),t&&j&&j(o)},[K,n,j,C]),Y=(0,i.useCallback)((e,t)=>{var n;const i=null===(n=J.current)||void 0===n?void 0:n.getBoundingClientRect();if(!i)return;const o=y((e-i.left)/i.width),r=1-y((t-i.top)/i.height),s=G.current;X((0,a.A)((0,a.A)({},s),{},{s:o,v:r}),{addToRecent:!1})},[X]),Q=(0,i.useCallback)(e=>{var t,n;let a;e.preventDefault(),null===E||void 0===E||E(),null===(t=(n=e.target).setPointerCapture)||void 0===t||t.call(n,e.pointerId),Y(e.clientX,e.clientY);const i=e=>{a&&cancelAnimationFrame(a),a=requestAnimationFrame(()=>{Y(e.clientX,e.clientY)})},o=e=>{a&&(cancelAnimationFrame(a),a=void 0),Y(e.clientX,e.clientY),window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",o);const t=G.current;X(t,{complete:!0,addToRecent:!0}),null===T||void 0===T||T()};window.addEventListener("pointermove",i),window.addEventListener("pointerup",o)},[Y,X,M,T,E]),ee=(0,i.useCallback)(e=>{X((0,a.A)((0,a.A)({},M),{},{h:e}),{addToRecent:!1})},[M,X]),te=(0,i.useCallback)(e=>{X((0,a.A)((0,a.A)({},M),{},{h:e}),{complete:!0,addToRecent:!0}),null===T||void 0===T||T()},[M,X,T]),ne=(0,i.useCallback)(e=>{X((0,a.A)((0,a.A)({},M),{},{a:y(e/100)}),{addToRecent:!1})},[M,X]),ae=(0,i.useCallback)(e=>{X((0,a.A)((0,a.A)({},M),{},{a:y(e/100)}),{complete:!0,addToRecent:!0})},[M,X]),ie=(0,i.useMemo)(()=>"linear-gradient(to top, black, transparent), linear-gradient(to right, white, hsl(".concat(M.h,", 100%, 50%))"),[M.h]),oe=(0,i.useMemo)(()=>{const e=100*M.s,t=100*(1-M.v);return{left:"".concat(e,"%"),top:"".concat(t,"%")}},[M.s,M.v]),re=Math.round(100*M.a),se=W;return(0,v.jsxs)(o.a,{borderWidth:"1px",borderRadius:"lg",p:D?2:3,bg:R,borderColor:F,boxShadow:"sm",children:[b?(0,v.jsx)(x.E,{fontSize:"sm",fontWeight:"medium",mb:2,color:P,children:b}):null,(0,v.jsx)(o.a,{ref:J,position:"relative",borderRadius:"lg",overflow:"hidden",height:D?"110px":"140px",cursor:"crosshair",backgroundImage:ie,onPointerDown:Q,children:(0,v.jsx)(o.a,{position:"absolute",width:"16px",height:"16px",borderRadius:"full",borderWidth:"2px",borderColor:"white",boxShadow:"0 0 0 1px rgba(0,0,0,0.4)",transform:"translate(-50%, -50%)",style:oe})}),(0,v.jsx)(o.a,{mt:3,children:(0,v.jsxs)(u.Ap,{"aria-label":"Hue",min:0,max:360,value:M.h,onChange:ee,onChangeStart:()=>{null===E||void 0===E||E()},onChangeEnd:te,size:"sm",children:[(0,v.jsx)(u.hB,{bg:"linear-gradient(to right, red, #ff0, #0f0, #0ff, #00f, #f0f, red)",h:"8px",borderRadius:"full",children:(0,v.jsx)(u.hJ,{bg:"transparent"})}),(0,v.jsx)(u.OQ,{boxSize:4,borderWidth:"2px",borderColor:"white"})]})}),S&&(0,v.jsx)(o.a,{mt:3,children:(0,v.jsxs)(u.Ap,{"aria-label":"Opacity",min:0,max:100,value:re,onChange:ne,onChangeEnd:ae,size:"sm",children:[(0,v.jsx)(u.hB,{bg:"linear-gradient(to right, transparent, ".concat(se,")"),h:"8px",borderRadius:"full",children:(0,v.jsx)(u.hJ,{bg:"transparent"})}),(0,v.jsx)(u.OQ,{boxSize:4,borderWidth:"2px",borderColor:"white"})]})}),(0,v.jsxs)(h.z,{spacing:2,mt:3,align:"center",children:[(0,v.jsx)(o.a,{width:"32px",height:"32px",borderRadius:"full",borderWidth:"1px",borderColor:F,bg:se}),(0,v.jsx)(d.p,{value:O,onChange:e=>{B(!0),q(e.target.value)},onBlur:()=>{B(!1);if(!f(O))return void q(W.toUpperCase());const e=k(O);X(e,{complete:!0,addToRecent:!0})},size:"sm",fontFamily:"mono",maxW:"130px"}),S&&(0,v.jsx)(d.p,{value:"".concat(re,"%"),onChange:e=>{const t=e.target.value.replace(/[^0-9]/g,""),n=Math.max(0,Math.min(100,parseInt(t||"0",10)));X((0,a.A)((0,a.A)({},M),{},{a:n/100}),{addToRecent:!1})},onBlur:()=>ae(re),size:"sm",maxW:"80px"}),A&&(0,v.jsx)(p.m,{label:H?"Vybrat barvu z obrazovky":"Pipeta nen\xed v tomto prohl\xed\u017ee\u010di podporov\xe1na.",children:(0,v.jsx)(s.K,{"aria-label":"Vybrat barvu z obrazovky",icon:(0,v.jsx)(g.jBq,{}),size:"sm",variant:"outline",onClick:H?async()=>{if("undefined"!==typeof window&&H&&window.EyeDropper)try{null===E||void 0===E||E();const e=new(0,window.EyeDropper),t=await e.open(),n=null===t||void 0===t?void 0:t.sRGBHex;if(n){const e=G.current,t=k(n),i=(0,a.A)((0,a.A)({},t),{},{a:e.a});X(i,{complete:!0,addToRecent:!0})}}catch(e){}finally{null===T||void 0===T||T()}}:void 0,isDisabled:!H})})]}),!N&&(0,v.jsxs)(m.T,{align:"stretch",spacing:2,mt:3,children:[Z.manual.length>0&&(0,v.jsxs)(o.a,{children:[(0,v.jsx)(x.E,{fontSize:"xs",mb:1,color:I,children:"Ulo\u017een\xe9 barvy"}),(0,v.jsx)(c.r,{columns:8,spacing:1,children:Z.manual.map(e=>(0,v.jsx)(o.a,{as:"button",type:"button",onClick:t=>{t.preventDefault(),X(k(e),{complete:!0,addToRecent:!0})},width:"18px",height:"18px",borderRadius:"full",borderWidth:se.toLowerCase()===e?"2px":"1px",borderColor:se.toLowerCase()===e?"blue.500":F,bg:e},"manual-".concat(e)))})]}),Z.recent.length>0&&(0,v.jsxs)(o.a,{children:[(0,v.jsx)(x.E,{fontSize:"xs",mb:1,color:I,children:"Posledn\xed barvy"}),(0,v.jsx)(c.r,{columns:8,spacing:1,children:Z.recent.map(e=>(0,v.jsx)(o.a,{as:"button",type:"button",onClick:t=>{t.preventDefault(),X(k(e),{complete:!0,addToRecent:!0})},width:"16px",height:"16px",borderRadius:"full",borderWidth:se.toLowerCase()===e?"2px":"1px",borderColor:se.toLowerCase()===e?"blue.500":F,bg:e},"recent-".concat(e)))})]}),(0,v.jsx)(r.$,{mt:1,variant:"ghost",size:"sm",onClick:()=>{V(e=>{const t=function(e,t){const n=(t||"").toLowerCase();return n?e.manual.includes(n)?e:(0,a.A)((0,a.A)({},e),{},{manual:[...e.manual,n]}):e}(e,W);return z(t,C),t})},children:"+ P\u0159idat barvu"})]})]})}},54156:(e,t,n)=>{n.d(t,{C:()=>I});var a=n(89379),i=n(88787),o=n(85871),r=n(87139),s=n(22107),l=n(98662),c=n(25011),d=n(35699),u=n(76659),h=n(96148),m=n(10202),p=n(30502),x=n(39081),g=n(65043),v=n(73216),j=n(85369),b=n(72526),y=n(46291),f=n(20515),k=n(74117),_=n(99863),w=n(69023),z=n(57735),S=n(28344),A=n(4178),C=n(92410),E=n(42687),T=n(25189),D=n(70082),N=n(56644),R=(n(79708),n(70579));const F="dd.MM.yyyy HH:mm",P=e=>{try{const t=(0,C.qg)(e,F,new Date);return(0,S.c)(t)?(0,w.GP)(t,"HH:mm"):(0,A.e)(t)?(0,w.GP)(t,"HH:mm '(z\xedtra)'"):(0,w.GP)(t,"dd.MM. HH:mm")}catch(t){return console.error("Error formatting date:",t,e),e}},I=e=>{var t;let{categoryName:n,hideEmpty:w=!1,onMatchClick:S}=e;const{t:A}=(0,k.Bd)(),I=(0,p.d)(),[M,L]=(0,g.useState)(""),[W,U]=(0,g.useState)(!0),[O,q]=(0,g.useState)(!0),[K,B]=(0,g.useState)(!1),Z=(0,v.zy)(),V=String(Z.pathname||"").startsWith("/admin"),{settings:H}=(0,f.t)(),$=e=>{if(null===e||void 0===e||!e.home||!H)return!1;const t=(0,T.Lt)(e.home).toLowerCase(),n=(0,T.Lt)((null===H||void 0===H?void 0:H.club_name)||"").toLowerCase();return t.includes(n)||n.includes(t)},{data:J={}}=(0,b.I)({queryKey:["teamLogoOverrides"],queryFn:E.a5,staleTime:3e5}),G=(null===J||void 0===J?void 0:J.by_id)||{},X=(null===J||void 0===J?void 0:J.by_name)||{},Y=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[\u2012\u2013\u2014\u2015\u2212]/g,"-").replace(/\bn\.?\b/g," nad ").replace(/\bp\.?\b/g," pod ").replace(/[\,\s]*(z\.?\s*s\.?|o\.?\s*s\.?)\s*$/g,"").replace(/[\.,!;:()\[\]{}]/g," ").replace(/\s+/g," ").trim().toLowerCase(),Q=g.useMemo(()=>{const e={};for(const n of Object.values(G||{})){const t=String((null===n||void 0===n?void 0:n.name)||"").trim(),a=String((null===n||void 0===n?void 0:n.logo_url)||"").trim();t&&a&&(e[a]=t)}const t={};for(const[n,a]of Object.entries(X||{})){const i=e[String(a)]||"",o=Y(n);i&&o&&(t[o]=i)}return t},[G,X]),ee=g.useMemo(()=>{const e={};try{for(const[t,n]of Object.entries(G||{})){const a=String((null===n||void 0===n?void 0:n.name)||"").trim(),i=String((null===n||void 0===n?void 0:n.logo_url)||"").trim();if(!a)continue;const o=Y(a);o&&(e[o]={id:t,name:a,logo_url:i})}}catch(t){}return e},[G]),te=(e,t)=>{var n;const a=t?String(t):"";if(a&&null!==G&&void 0!==G&&null!==(n=G[a])&&void 0!==n&&n.name&&String(G[a].name).trim())return String(G[a].name).trim();try{const t=Y(e);if(Q[t])return Q[t];let n=ee[t];if(!n)for(const[e,a]of Object.entries(ee))if(e&&(t.endsWith(e)||e.endsWith(t))){n=a;break}if(n&&n.name)return String(n.name)}catch(i){}return String(e||"")},ne=(e,t)=>{const n=(null===J||void 0===J?void 0:J.by_name)||{},a=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),i=e=>{let t=a(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,""),t.replace(/\s+/g," ").trim()},o=Object.keys(n||{}).reduce((e,t)=>(e[a(t)]=n[t],e),{}),r=Object.keys(n||{}).map(e=>({key:i(e),url:n[e]}));return((e,t)=>{if(!e)return t;let s=n[e]||o[a(e)];if(!s){const t=i(e);for(const{key:e,url:n}of r)if(e&&(t.endsWith(e)||e.endsWith(t))){s=n;break}}const l=s||t;if("string"===typeof l&&l.startsWith("/")){return new URL(y.API_URL,window.location.origin).origin+l}return l||(0,T.uq)("/dist/img/logo-club-empty.svg")})(e,t)},{data:ae=[],isLoading:ie,error:oe}=(0,b.I)({queryKey:["upcomingMatchesCache"],queryFn:async()=>{const e=new URL(y.API_URL,window.location.origin).origin,t="".concat(e,"/cache/prefetch/facr_club_info.json"),n=await fetch(t,{headers:{"Cache-Control":"no-cache"}});if(!n.ok)throw new Error("Failed to load cache: ".concat(n.status));const i=await n.json(),o=(Array.isArray(null===i||void 0===i?void 0:i.competitions)?i.competitions:[]).flatMap(e=>(Array.isArray(e.matches)?e.matches:[]).map(t=>(0,a.A)((0,a.A)({},t),{},{competitionName:e.name,competition_id:e.id}))),r=new Date;return o.map(e=>(0,a.A)((0,a.A)({},e),{},{__dt:(0,C.qg)(String(e.date_time||e.date),F,new Date)})).filter(e=>(0,z.d)(e.__dt,r)).sort((e,t)=>e.__dt.getTime()-t.__dt.getTime()).slice(0,5).map(e=>{var t,n;return{id:e.match_id,date_time:e.date_time||e.date,competitionName:e.competitionName,home:te(e.home||e.home_team,e.home_id),away:te(e.away||e.away_team,e.away_id),score:e.score,venue:e.venue,home_logo_url:e.home_id&&null!==G&&void 0!==G&&null!==(t=G[e.home_id])&&void 0!==t&&t.logo_url?String(G[e.home_id].logo_url):ne(e.home||e.home_team,e.home_logo_url),away_logo_url:e.away_id&&null!==G&&void 0!==G&&null!==(n=G[e.away_id])&&void 0!==n&&n.logo_url?String(G[e.away_id].logo_url):ne(e.away||e.away_team,e.away_logo_url),home_id:e.home_id,away_id:e.away_id}})}}),re=(0,b.I)({queryKey:["competition-aliases-public"],queryFn:async()=>{try{return{list:await(0,D.xN)()}}catch(e){return{list:[]}}},staleTime:3e5}),se=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),le=g.useCallback(e=>{var t;const n=String(e||""),a=se(n),i=(null===(t=re.data)||void 0===t?void 0:t.list)||[];for(const o of i){const e=se(o.alias),t=se(o.original_name||"");if(t&&(a.includes(t)||t.includes(a)))return o.alias;if(e&&(a.includes(e)||e.includes(a)))return o.alias}return n},[null===(t=re.data)||void 0===t?void 0:t.list]),ce=g.useMemo(()=>{if(!Array.isArray(ae))return[];if(!n)return ae;const e=se(n);return ae.filter(t=>{const n=String(t.competitionName||""),a=le(n),i=se(n),o=se(a);return!(!o||o!==e)||(i===e||(o&&o.includes(e)||i.includes(e)))})},[ae,n,le]);return ie?(0,R.jsx)(_.x,{title:A("matches.upcoming"),children:(0,R.jsxs)(m.T,{p:4,children:[(0,R.jsx)(u.y,{size:"md"}),(0,R.jsx)(x.E,{children:A("matches.loading")})]})}):oe?(0,R.jsx)(_.x,{title:A("matches.upcoming"),children:(0,R.jsxs)(i.F,{status:"error",variant:"left-accent",children:[(0,R.jsx)(o._,{}),A("matches.error")]})}):ce&&0!==ce.length?(0,R.jsx)(_.x,{title:A("matches.upcoming"),children:(0,R.jsxs)(m.T,{spacing:{base:2,md:3},align:"stretch",divider:(0,R.jsx)(s.a,{borderBottomWidth:"1px",borderColor:"gray.200"}),children:[ce.map(e=>(0,R.jsxs)(s.a,{p:{base:3,md:4},bg:"gray.50",_hover:{bg:"gray.100"},borderRadius:"lg",transition:"background-color 0.2s",shadow:"sm",cursor:S?"pointer":"default",role:S?"button":void 0,tabIndex:S?0:void 0,onClick:()=>S&&S(e),onKeyDown:t=>{S&&("Enter"!==t.key&&" "!==t.key||(t.preventDefault(),S(e)))},children:[(0,R.jsxs)(h.z,{justify:"space-between",mb:1,spacing:2,flexWrap:"wrap",children:[(0,R.jsx)(x.E,{fontSize:{base:"xs",sm:"sm"},color:"gray.700",fontWeight:"medium",whiteSpace:"nowrap",children:P(e.date_time)}),(0,R.jsxs)(h.z,{spacing:1,children:[$(e)&&(0,R.jsx)(c.I,{as:j.tmj,boxSize:3,color:"blue.500",title:"Dom\xe1c\xed z\xe1pas - po\u010das\xed v mod\xe1lu"}),(0,R.jsx)(r.E,{colorScheme:"blue",variant:"subtle",fontSize:"xs",bg:"blue.50",color:"blue.700",children:e.competitionName})]})]}),(0,R.jsxs)(h.z,{justify:"space-between",align:"center",children:[(0,R.jsxs)(h.z,{flex:1,minW:0,spacing:2,children:[(0,R.jsx)(s.a,{flexShrink:0,className:"match-widget-logo",children:(0,R.jsx)(N.L,{teamId:e.home_id,teamName:e.home,facrLogo:e.home_logo_url,size:"small",fallbackIcon:(0,R.jsx)(c.I,{as:j.i0U,color:"gray.400",boxSize:{base:4,md:5}})})}),(0,R.jsx)(x.E,{fontSize:{base:"xs",sm:"sm"},fontWeight:"medium",isTruncated:!0,color:"gray.800",children:(0,T.Lt)(e.home)})]}),(0,R.jsx)(x.E,{fontSize:{base:"xs",sm:"sm"},fontWeight:"bold",minW:{base:"32px",sm:"40px"},textAlign:"center",color:"gray.900",flexShrink:0,children:e.score||"vs"}),(0,R.jsxs)(h.z,{flex:1,justify:"flex-end",spacing:2,minW:0,children:[(0,R.jsx)(x.E,{fontSize:{base:"xs",sm:"sm"},fontWeight:"medium",isTruncated:!0,textAlign:"right",color:"gray.800",children:(0,T.Lt)(e.away)}),(0,R.jsx)(s.a,{flexShrink:0,className:"match-widget-logo",children:(0,R.jsx)(N.L,{teamId:e.away_id,teamName:e.away,facrLogo:e.away_logo_url,size:"small",fallbackIcon:(0,R.jsx)(c.I,{as:j.i0U,color:"gray.400",boxSize:{base:4,md:5}})})})]})]}),e.venue&&(0,R.jsxs)(h.z,{mt:2,spacing:2,color:"gray.500",fontSize:"sm",children:[(0,R.jsx)(c.I,{as:j.vq8,boxSize:3}),(0,R.jsx)(x.E,{isTruncated:!0,children:e.venue})]})]},e.id)),!V&&(0,R.jsxs)(m.T,{p:3,spacing:2,align:"stretch",children:[(0,R.jsx)(x.E,{fontSize:"sm",color:"gray.600",children:A("matches.subscribe_prompt")}),(0,R.jsxs)(h.z,{children:[(0,R.jsx)(d.p,{type:"email",placeholder:A("form.email_placeholder"),value:M,onChange:e=>L(e.target.value)}),(0,R.jsx)(l.$,{colorScheme:"red",onClick:async()=>{if(M){B(!0);try{const e=await fetch((e=>{try{return/^https?:\/\//i.test(e)?e:new URL(y.API_URL,window.location.origin).origin+e}catch(t){return e}})("/api/v1/newsletter/subscribe"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:M,preferences:{weekly:W,matches:O}})});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error((null===t||void 0===t?void 0:t.error)||"HTTP ".concat(e.status))}I({title:A("matches.subscribe_success"),status:"success"}),L("")}catch(e){I({title:A("matches.subscribe_error"),description:(null===e||void 0===e?void 0:e.message)||String(e),status:"error"})}finally{B(!1)}}else I({title:A("form.email_required"),status:"warning"})},isLoading:K,children:A("matches.subscribe")})]})]})]})}):w?null:(0,R.jsx)(_.x,{title:A("matches.upcoming"),children:(0,R.jsxs)(m.T,{p:4,spacing:4,children:[(0,R.jsx)(c.I,{as:j.bfZ,boxSize:8,color:"gray.400"}),(0,R.jsx)(x.E,{color:"gray.500",textAlign:"center",children:A("matches.none_found")})]})})}},56379:(e,t,n)=>{n.d(t,{A:()=>l,u:()=>s});var a=n(65043),i=n(22107),o=n(70579);let r=null;const s={positron:{name:"Positron (Light)",url:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",attribution:"\xa9 OpenStreetMap \xa9 CartoDB",description:"Clean light map, perfect for overlays"},"positron-no-labels":{name:"Positron No Labels",url:"https://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}{r}.png",attribution:"\xa9 OpenStreetMap \xa9 CartoDB",description:"Minimal light map without labels"},dark:{name:"Dark Matter",url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:"\xa9 OpenStreetMap \xa9 CartoDB",description:"Dark theme, great for night mode"},"dark-no-labels":{name:"Dark No Labels",url:"https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png",attribution:"\xa9 OpenStreetMap \xa9 CartoDB",description:"Dark map without labels"},toner:{name:"Toner (B&W)",url:"https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}{r}.png",attribution:"\xa9 Stamen Design \xa9 OpenStreetMap",description:"High contrast black and white"},"toner-lite":{name:"Toner Lite (B&W)",url:"https://tiles.stadiamaps.com/tiles/stamen_toner_lite/{z}/{x}/{y}{r}.png",attribution:"\xa9 Stamen Design \xa9 OpenStreetMap",description:"Subtle black and white"},voyager:{name:"Voyager",url:"https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png",attribution:"\xa9 OpenStreetMap \xa9 CartoDB",description:"Balanced colors, good readability"},terrain:{name:"Terrain",url:"https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}{r}.jpg",attribution:"\xa9 Stamen Design \xa9 OpenStreetMap",description:"Natural terrain visualization"},watercolor:{name:"Watercolor",url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg",attribution:"\xa9 Stamen Design \xa9 OpenStreetMap",description:"Artistic watercolor style"},default:{name:"OpenStreetMap",url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"\xa9 OpenStreetMap contributors",description:"Standard OpenStreetMap"},satellite:{name:"Satellite",url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",attribution:"\xa9 Esri",description:"Satellite imagery"}},l=e=>{let{latitude:t,longitude:n,zoom:l=15,address:c,clubName:d,mapStyle:u="default",height:h=400,clubPrimaryColor:m,clubSecondaryColor:p}=e;const x=(0,a.useRef)(null),g=(0,a.useRef)(null),v=(0,a.useRef)(null),j=(0,a.useRef)(null),[b,y]=a.useState(!1),[f,k]=a.useState(null);return(0,a.useEffect)(()=>{(async()=>{try{if(window.L)return r=window.L,void y(!0);if(!document.getElementById("leaflet-css")){const e=document.createElement("link");e.id="leaflet-css",e.rel="stylesheet",e.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",e.integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=",e.crossOrigin="",document.head.appendChild(e)}if(!document.getElementById("leaflet-js")){const e=document.createElement("script");e.id="leaflet-js",e.src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js",e.integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=",e.crossOrigin="",e.onload=()=>{r=window.L,y(!0)},e.onerror=()=>{k("Failed to load map library")},document.head.appendChild(e)}}catch(e){k("Error loading map")}})()},[]),(0,a.useEffect)(()=>{if(b&&r&&x.current&&!g.current){try{const a=r.map(x.current,{center:[t,n],zoom:l,scrollWheelZoom:!1});g.current=a;const{tileUrl:i,attribution:o}=(()=>{let e="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",t='\xa9 <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';if(u&&s[u]){const n=s[u];e=n.url,t=n.attribution}else u&&u.startsWith("http")&&(e=u);return{tileUrl:e,attribution:t}})();v.current=r.tileLayer(i,{attribution:o,maxZoom:19}).addTo(a);const h=function(e,t){const n='\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 36" width="36" height="54">\n <defs>\n <filter id="shadow" x="-50%" y="-50%" width="200%" height="200%">\n <feGaussianBlur in="SourceAlpha" stdDeviation="2"/>\n <feOffset dx="0" dy="2" result="offsetblur"/>\n <feComponentTransfer>\n <feFuncA type="linear" slope="0.3"/>\n </feComponentTransfer>\n <feMerge>\n <feMergeNode/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>\n </defs>\n <path fill="'.concat(e,'" stroke="#fff" stroke-width="1.5" filter="url(#shadow)"\n d="M12 0C7.03 0 3 4.03 3 9c0 7.5 9 18 9 18s9-10.5 9-18c0-4.97-4.03-9-9-9z"/>\n <circle cx="12" cy="9" r="3" fill="#fff"/>\n </svg>\n '),a="data:image/svg+xml;base64,"+btoa(n);return t.icon({iconUrl:a,iconSize:[36,54],iconAnchor:[18,54],popupAnchor:[0,-54]})}(m||"#3388ff",r);if(j.current=r.marker([t,n],{icon:h}).addTo(a),d||c){let e="";d&&(e+="<b>".concat(d,"</b><br>")),c&&(e+=c),j.current.bindPopup(e)}a.on("click",()=>{a.scrollWheelZoom.enable()}),a.on("mouseout",()=>{a.scrollWheelZoom.disable()});try{setTimeout(()=>{try{a.invalidateSize()}catch(e){}},150)}catch(e){}}catch(a){console.error("Error initializing map:",a),k("Failed to initialize map")}return()=>{try{g.current&&g.current.remove()}finally{g.current=null,v.current=null,j.current=null}}}},[b]),(0,a.useEffect)(()=>{if(!x.current)return;const e=x.current,t=new IntersectionObserver(e=>{const t=e[0];if(t&&t.isIntersecting&&g.current)try{requestAnimationFrame(()=>{try{g.current.invalidateSize()}catch(e){}})}catch(n){}},{root:null,threshold:.1});return t.observe(e),()=>t.disconnect()},[b]),(0,a.useEffect)(()=>{if(!x.current||!("ResizeObserver"in window))return;const e=x.current,t=new ResizeObserver(()=>{if(g.current)try{g.current.invalidateSize()}catch(e){}});return t.observe(e),()=>t.disconnect()},[b]),(0,a.useEffect)(()=>{if(g.current&&r)try{const e=g.current;"number"===typeof t&&"number"===typeof n&&(e.setView([t,n],"number"===typeof l?l:e.getZoom()),j.current&&j.current.setLatLng([t,n]))}catch(e){}},[t,n,l]),(0,a.useEffect)(()=>{if(g.current&&r)try{const e=g.current;let t="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",n='\xa9 <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';if(u&&s[u]){const e=s[u];t=e.url,n=e.attribution}else u&&u.startsWith("http")&&(t=u);v.current&&e.removeLayer(v.current),v.current=r.tileLayer(t,{attribution:n,maxZoom:19}).addTo(e)}catch(e){}},[u]),(0,a.useEffect)(()=>{try{if(j.current)if(d||c){let e="";d&&(e+="<b>".concat(d,"</b><br>")),c&&(e+=c),j.current.bindPopup(e)}else j.current.unbindPopup()}catch(e){}},[d,c]),f?(0,o.jsx)(i.a,{ref:x,w:"100%",h:"".concat(h,"px"),bg:"gray.100",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"md",children:f}):(0,o.jsx)(i.a,{ref:x,w:"100%",h:"".concat(h,"px"),borderRadius:"md",overflow:"hidden",boxShadow:"md"})}},56644:(e,t,n)=>{n.d(t,{L:()=>v,A:()=>j});var a=n(89379),i=n(80045),o=n(65043),r=n(99032),s=n(33572),l=n(60790);const c=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"medium";const a=(e=>Boolean(null===e||void 0===e?void 0:e.includes("logoapi.sportcreative.eu")))(e);if(a&&t){return{padding:{small:"2px",medium:"4px",large:"6px"}[n],boxSizing:"border-box",objectFit:"contain"}}return{objectFit:"contain"}},d=function(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"medium";const n=[];return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&n.push("circular-logo-container"),n.push("match-logo-".concat(t)),n.join(" ")};n(79708);var u=n(57550),h=n(25189);var m=n(70579);const p=["teamId","teamName","facrLogo","size","fallbackIcon","alt"];let x=null;const g=e=>{let t=String(e||"");t=t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),t=t.replace(/[\u2012\u2013\u2014\u2015\u2212]/g,"-"),t=t.replace(/\bn\.?\b/g," nad "),t=t.replace(/\bp\.?\b/g," pod "),t=t.replace(/[.,!;:()\[\]{}]/g," "),t=t.replace(/[\s,]*(z\.?\s*s\.?|o\.?\s*s\.?)\s*$/g,"");const n=["fotbalovy klub","sportovni klub","telovychovna jednota","skolni sportovni klub","spolek","fotbal","futsal"];for(const a of n){const e=new RegExp("(^|\\b)"+a+"(\\b|$)","g");t=t.replace(e," ")}return t=t.replace(/\b(1\.)?\s*(sfc|afc|fc|fk|mfk|tj|sk|afk|bfk|hfk)\b\.?/g," "),t=t.replace(/\s+/g," ").trim(),t},v=e=>{var t;let{teamId:n,teamName:v,facrLogo:j,size:b="medium",fallbackIcon:y,alt:f}=e,k=(0,i.A)(e,p);const[_,w]=(0,o.useState)(null),[z,S]=(0,o.useState)(!0),[A,C]=(0,o.useState)(!1),{data:E}=(0,u.s)(),[T,D]=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{threshold:t=.1,root:n=null,rootMargin:a="0px",freezeOnceVisible:i=!1}=e,r=(0,o.useRef)(null),[s,l]=(0,o.useState)(!1),[c,d]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{const e=r.current;if(!e)return;if(i&&c)return;const o=new IntersectionObserver(e=>{let[t]=e;const n=t.isIntersecting;l(n),n&&(d(!0),i&&o.disconnect())},{threshold:t,root:n,rootMargin:a});return o.observe(e),()=>{o.disconnect()}},[t,n,a,i,c]),[r,i?c:s]}({threshold:.01,rootMargin:"150px 0px",freezeOnceVisible:!0}),N=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!D)return;let e=!0;N.current&&clearTimeout(N.current);const t=async()=>{try{var t,a,i;S(!0),C(!1);let c={};try{c=await(async()=>{const e=Date.now();if(x&&e-x.ts<3e4)return x.data||{};try{const t=await fetch("/api/v1/public/team-logo-overrides?t=".concat(e),{cache:"no-cache"});if(t.ok){const n=await t.json();return x={ts:e,data:n||{}},n||{}}}catch(t){}try{const t=await fetch("/cache/prefetch/team_logo_overrides.json",{cache:"no-cache"});if(t.ok){const n=await t.json();return x={ts:e,data:n||{}},n||{}}}catch(n){}return x?x.data||{}:(x={ts:e,data:{}},{})})()}catch(r){}const d=null===E||void 0===E?void 0:E.club_id,u=null===E||void 0===E?void 0:E.club_logo_url;if(n&&d&&String(n)===String(d)&&u)e&&w((0,h.uq)(u)||u);else if(n&&null!==(t=c)&&void 0!==t&&null!==(a=t.by_id)&&void 0!==a&&null!==(i=a[n])&&void 0!==i&&i.logo_url){const t=c.by_id[n].logo_url;e&&("string"===typeof t&&t.startsWith("/")?w((0,h.uq)(t)||t):w(t))}else{let t=!1;try{var o;const n=(null===(o=c)||void 0===o?void 0:o.by_name)||{};if(v&&n&&Object.keys(n).length>0){const a={};for(const e of Object.keys(n))a[g(e)]=n[e];const i=g(v);let o=n[v]||a[i];if(!o){const e=Object.keys(n).map(e=>({keyNorm:g(e),url:n[e]}));for(const{keyNorm:t,url:n}of e)if(t&&(i.endsWith(t)||t.endsWith(i))){o=n;break}}if(!o){const e=i.split(" ")[0];if(e&&e.length>=5)for(const{keyNorm:t,url:a}of Object.keys(n).map(e=>({keyNorm:g(e),url:n[e]}))){if(String(t).split(" ")[0]===e){o=a;break}}}o&&(t=!0,e&&("string"===typeof o&&o.startsWith("/")?w((0,h.uq)(o)||o):w(o)))}}catch(s){}if(!t){const t=await(0,l.Nw)(n,v,j);e&&w(t)}}}catch(c){console.error("Failed to fetch logo:",c),e&&(C(!0),w(j||"/logo-placeholder.svg"))}finally{e&&S(!1)}};return N.current=setTimeout(()=>{t()},100),()=>{e=!1,N.current&&clearTimeout(N.current)}},[n,v,j,D]);const R="custom"!==b?{small:{boxSize:"24px"},medium:{boxSize:"32px"},large:{boxSize:"48px"},custom:{}}[b]:{},F="match-logo-".concat(b," ").concat(k.className||"").trim();if(z)return(0,m.jsx)("div",{ref:T,style:{display:"inline-block"},children:(0,m.jsx)(r.E,(0,a.A)((0,a.A)({},R),{},{borderRadius:"4px",className:"logo-loading"}))});const P="full"===k.borderRadius||"50%"===(null===(t=k.style)||void 0===t?void 0:t.borderRadius),I="custom"!==b?b:"medium",M=c(_,P,I),L=d(_,P,I);return(0,m.jsx)("div",{ref:T,style:{display:"inline-block"},children:(0,m.jsx)(s._,(0,a.A)((0,a.A)((0,a.A)({src:(0,h.uq)(_||void 0)||_||"/logo-placeholder.svg",alt:f||v||"Team logo",decoding:"async",draggable:!1},R),k),{},{className:"".concat(F," ").concat(L),objectFit:"contain",loading:"lazy",fallback:y,style:(0,a.A)((0,a.A)({},k.style),M),onError:()=>{if(!A)if(C(!0),_&&_.startsWith("/uploads/logos/facr/")&&n){const e="https://is1.fotbal.cz/media/kluby/".concat(n,"/").concat(n,"_crop.jpg");w(e),C(!1)}else w(j||"/logo-placeholder.svg")}}))})},j=v},57550:(e,t,n)=>{n.d(t,{s:()=>o});var a=n(72526),i=n(74770);const o=()=>(0,a.I)({queryKey:["public-settings"],queryFn:i.l3,staleTime:3e5,cacheTime:18e5,refetchOnWindowFocus:!1,refetchOnMount:!1})},58853:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ee});var a=n(65043),i=n(44093),o=n(98939),r=n(10202),s=n(22107),l=n(28846),c=n(39081),d=n(45973),u=n(29244),h=n(25011),m=n(35699),p=n(98662),x=n(96148),g=n(5371),v=n(76659),j=n(3109),b=n(31411),y=n(14566),f=n(51794),k=n(10227),_=n(87139),w=n(73212),z=n(33572),S=n(29904),A=n(7189),C=n(85369),E=n(35475),T=n(73216),D=n(40378),N=n(46291),R=n(34636),F=n(36695),P=n(66286),I=n(38376),M=n(91296),L=n(40384),W=n(80045),U=n(25189);const O=["lastPlayedDate"],q=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),K=async e=>{try{const t=await fetch((e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(N.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}})(e),{cache:"no-cache"});return t.ok?await t.json():null}catch(t){return null}};let B=null;const Z=e=>{if(!e)return[];const t=q(e.name||""),n=Array.isArray(e.competitions)?e.competitions:[],a=new Map,i=e=>{var n,i;const o=null===(n=e.name)||void 0===n?void 0:n.trim();if(!o)return;const r=q(o);if(!r||r===t)return;const s=a.get(r),l=(null!==(i=null===s||void 0===s?void 0:s.matches_played)&&void 0!==i?i:0)+1,c=e.occurredAt&&(null===s||void 0===s||!s.lastPlayedDate||e.occurredAt>s.lastPlayedDate)?e.occurredAt:null===s||void 0===s?void 0:s.lastPlayedDate,d=e.logo||(null===s||void 0===s?void 0:s.logo_url),u=e.competition||(null===s||void 0===s?void 0:s.competition);a.set(r,{id:e.id||(null===s||void 0===s?void 0:s.id)||r,name:o,logo_url:d?(0,U.uq)(d)||d:null===s||void 0===s?void 0:s.logo_url,competition:u,matches_played:l,last_played_iso:c?c.toISOString():null===s||void 0===s?void 0:s.last_played_iso,lastPlayedDate:c})};return n.forEach(e=>{(Array.isArray(null===e||void 0===e?void 0:e.matches)?e.matches:[]).forEach(t=>{const n=(e=>{if(!e)return null;const[t,n="00:00"]=String(e).split(" "),[a,i,o]=(t||"").split(".");if(!a||!i||!o)return null;const r="".concat(o,"-").concat(i.padStart(2,"0"),"-").concat(a.padStart(2,"0"),"T").concat(n.slice(0,5),":00"),s=new Date(r);return Number.isNaN(s.getTime())?null:s})(null===t||void 0===t?void 0:t.date_time);i({name:null===t||void 0===t?void 0:t.home,id:(null===t||void 0===t?void 0:t.home_id)||(null===t||void 0===t?void 0:t.homeId),logo:null===t||void 0===t?void 0:t.home_logo_url,competition:null===e||void 0===e?void 0:e.name,occurredAt:n}),i({name:null===t||void 0===t?void 0:t.away,id:(null===t||void 0===t?void 0:t.away_id)||(null===t||void 0===t?void 0:t.awayId),logo:null===t||void 0===t?void 0:t.away_logo_url,competition:null===e||void 0===e?void 0:e.name,occurredAt:n})})}),Array.from(a.values()).map(e=>{let{lastPlayedDate:t}=e;return(0,W.A)(e,O)}).sort((e,t)=>{const n=e.last_played_iso?new Date(e.last_played_iso).getTime():0;return(t.last_played_iso?new Date(t.last_played_iso).getTime():0)-n})},V=async()=>(B||(B=(async()=>{const e=await K("/cache/prefetch/facr_club_info.json");return e?Z(e):[]})().catch(()=>[])),B),H=(e,t)=>{const n=(e,t)=>{if(!e||!t)return 0;if(e===t)return 100;if(e.startsWith(t))return 80;const n=e.indexOf(t);if(n>=0)return 60-Math.min(n,30);const a=t.split(/\s+/).filter(e=>e.length>1);if(a.length>1){let t=0,n=0;for(const i of a)if(e.includes(i)){t++;const a=e.indexOf(i);n+=0===a?25:15-Math.min(a,10)}if(t>=a.length/2)return Math.min(55,n*(t/a.length))}const i=t.split("");let o=-1,r=0;for(const s of i){const t=e.indexOf(s,o+1);t>o&&(r++,o=t)}return r>=.8*i.length?Math.min(25,Math.floor(r/i.length*25)):0},a=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),i=(e||"").toLowerCase(),o=(t||"").toLowerCase(),r=a(i),s=a(o);return Math.max(n(i,o),n(r,s))},$=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(N.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}},J=async e=>{try{const t=$(e),n=await fetch(t,{cache:"no-cache"});return n.ok?await n.json():null}catch(t){return null}},G=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase();var X=n(81398),Y=n(74117),Q=n(70579);const ee=()=>{const{t:e}=(0,Y.Bd)(),[t,n]=(0,E.ok)(),W=(0,T.Zp)(),O=String(t.get("q")||t.get("s")||""),[q,K]=(0,a.useState)(O),[B,Z]=(0,a.useState)(O),[ee,te]=(0,a.useState)(!1),[ne,ae]=(0,a.useState)(null),[ie,oe]=(0,a.useState)({clubs:[],matches:[],matchesPast:[],articles:[],players:[],events:[],sponsors:[],teams:[],contacts:[],gallery:[],categories:[],total:0}),[re,se]=(0,a.useState)("all"),[le,ce]=(0,a.useState)(10),[de,ue]=(0,a.useState)(10),[he,me]=(0,a.useState)(12),[pe,xe]=(0,a.useState)(12),[ge,ve]=(0,a.useState)(10),je=((0,a.useRef)(null),(0,i.dU)("white","gray.800"));(0,i.dU)("gray.200","gray.600");(0,a.useEffect)(()=>{const e=setTimeout(()=>Z(q.trim()),400);return()=>clearTimeout(e)},[q]);const be=(0,a.useCallback)(async t=>{if(t){te(!0),ae(null);try{const e=await async function(e){if(!e||0===e.trim().length)return{clubs:[],matches:[],matchesPast:[],articles:[],players:[],events:[],sponsors:[],teams:[],contacts:[],gallery:[],categories:[],total:0};const t=e.trim().toLowerCase();try{var n,a;const i=V(),[o,r,s,l,c,d,u,h,m,p,x,g]=await Promise.allSettled([i,L.A.searchClubs(e).catch(()=>({results:[]})),(async()=>{const t=$("/api/v1/matches?q=".concat(encodeURIComponent(e)));try{const e=await fetch(t,{cache:"no-cache"});let n=[];if(e.ok&&(n=await e.json()),!Array.isArray(n)||0===n.length){const e=await J("/cache/prefetch/matches.json");return Array.isArray(e)?e:[]}return n}catch(n){const e=await J("/cache/prefetch/matches.json");return Array.isArray(e)?e:[]}})(),(async()=>{const t=$("/api/v1/matches/history?q=".concat(encodeURIComponent(e)));try{const e=await fetch(t,{cache:"no-cache"});let n=[];if(e.ok&&(n=await e.json()),Array.isArray(n)&&n.length>0)return n}catch(o){}const n=await J("/cache/prefetch/facr_club_info.json");if(!n||!Array.isArray(null===n||void 0===n?void 0:n.competitions))return[];const a=new Date,i=[];for(const e of n.competitions){const t=String((null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.code)||"").trim(),n=Array.isArray(null===e||void 0===e?void 0:e.matches)?e.matches:[];for(const e of n){const n=String((null===e||void 0===e?void 0:e.date_time)||"").trim();if(!n)continue;const[o,r="00:00"]=n.split(" "),[s,l,c]=String(o||"").split(".");if(!s||!l||!c)continue;const d="".concat(c,"-").concat(String(l).padStart(2,"0"),"-").concat(String(s).padStart(2,"0")),u=String(r).slice(0,5),h=new Date("".concat(d,"T").concat(u||"00:00",":00"));if(!(h instanceof Date)||isNaN(h.getTime()))continue;if(h.getTime()>=a.getTime())continue;const m=String((null===e||void 0===e?void 0:e.score)||"").trim();let p,x;if(m){const e=m.match(/^(\d+)\s*:\s*(\d+)$/);e&&(p=parseInt(e[1],10),x=parseInt(e[2],10))}i.push({id:(null===e||void 0===e?void 0:e.match_id)||(null===e||void 0===e?void 0:e.matchId),home:null===e||void 0===e?void 0:e.home,away:null===e||void 0===e?void 0:e.away,competition:t,date:d,time:u||void 0,venue:null===e||void 0===e?void 0:e.venue,home_logo_url:null===e||void 0===e?void 0:e.home_logo_url,away_logo_url:null===e||void 0===e?void 0:e.away_logo_url,score:m||void 0,result_home:p,result_away:x})}}return i})(),(0,R.GE)({q:e,published:!0,page:1,page_size:50}),(0,P.Dq)(),(0,I.y6)(),(0,M.sJ)(),(async e=>{const t=await N.Ay.get("/teams");return Array.isArray(t.data)?t.data:(null===(e=t.data)||void 0===e?void 0:e.data)||[]})(),(async()=>{try{var e,t;const n=await N.Ay.get("/contacts"),a=(null===(e=n.data)||void 0===e?void 0:e.categories)||{},i=[...(null===(t=n.data)||void 0===t?void 0:t.uncategorized)||[]];return Object.values(a).forEach(e=>{Array.isArray(e)&&i.push(...e)}),i}catch(n){return[]}})(),(async()=>{try{var e,t;const n=await N.Ay.get("/gallery/albums");return Array.isArray(n.data)?n.data:(null===(e=n.data)||void 0===e?void 0:e.data)||(null===(t=n.data)||void 0===t?void 0:t.albums)||[]}catch(n){return[]}})(),(0,F.bW)()]),v="fulfilled"===o.status?o.value:[],j=new Map,b=new Map;v.forEach(e=>{const t=String(e.id||"").toLowerCase();t&&j.set(t,e);const n=G(e.name);n&&b.set(n,e)});const y=j.size>0||b.size>0,f=("fulfilled"===r.status&&(null===(n=r.value)||void 0===n?void 0:n.results)||[]).filter(e=>!!String(e.name||"").trim()).map(e=>{const n=String(e.club_id||e.id||"").toLowerCase(),a=G(e.name),i=n&&j.get(n)||a&&b.get(a)||null,o=Math.max(H(e.name,t),H(e.category||"",t)),r=(null===i||void 0===i?void 0:i.logo_url)||e.logo_url,s=(null===i||void 0===i?void 0:i.competition)||e.category||e.club_type;return{type:"club",id:e.club_id||e.id,title:e.name,subtitle:s,logo_url:r?$(r):void 0,metadata:{club_type:e.club_type,last_played_iso:null===i||void 0===i?void 0:i.last_played_iso,matches_played:null===i||void 0===i?void 0:i.matches_played},score:o}}).sort((e,t)=>(t.score||0)-(e.score||0)),k=(e,t,n,a)=>{if(!y)return!0;const i=G(e||""),o=G(t||"");if(i&&b.has(i))return!0;if(o&&b.has(o))return!0;const r=String(n||"").toLowerCase(),s=String(a||"").toLowerCase();return!(!r||!j.has(r))||!(!s||!j.has(s))},_="fulfilled"===s.status?s.value:[],w=(Array.isArray(_)?_:[]).filter(e=>{const n=e.competition||e.competition_name||e.league||"",a=H(e.home||"",t)>0||H(e.away||"",t)>0||H(e.venue||"",t)>0||H(n,t)>0;return k(e.home,e.away,e.home_id||e.homeId,e.away_id||e.awayId)||a}).filter(e=>{const n=e.competition||e.competition_name||e.league||"";return H(e.home||"",t)>0||H(e.away||"",t)>0||H(e.venue||"",t)>0||H(n,t)>0}).map((e,n)=>({type:"match",id:e.id||n,title:"".concat(e.home||"TBD"," vs ").concat(e.away||"TBD"),subtitle:e.competition||e.competition_name||e.league,date:e.date,time:e.time,metadata:{home:e.home,away:e.away,home_logo_url:e.home_logo_url,away_logo_url:e.away_logo_url,venue:e.venue,external_match_id:e.match_id||e.id},score:Math.max(H(e.home||"",t),H(e.away||"",t),H(e.venue||"",t),H(e.competition||e.competition_name||e.league||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0)),z="fulfilled"===l.status?l.value:[],S=(Array.isArray(z)?z:[]).filter(e=>{const n=e.competition||e.competition_name||e.league||"",a=H(e.home||"",t)>0||H(e.away||"",t)>0||H(e.venue||"",t)>0||H(n,t)>0;return k(e.home,e.away,e.home_id||e.homeId,e.away_id||e.awayId)||a}).filter(e=>{const n=e.competition||e.competition_name||e.league||"";return H(e.home||"",t)>0||H(e.away||"",t)>0||H(e.venue||"",t)>0||H(n,t)>0}).map((e,n)=>({type:"match_past",id:"past-".concat(e.id||n),title:"".concat(e.home||"TBD"," vs ").concat(e.away||"TBD"),subtitle:e.competition||e.competition_name||e.league,date:e.date,time:e.time,metadata:{home:e.home,away:e.away,home_logo_url:e.home_logo_url,away_logo_url:e.away_logo_url,venue:e.venue,external_match_id:e.match_id||e.id,result:e.result||e.result_text||e.score||void 0,result_home:"number"===typeof e.result_home?e.result_home:void 0,result_away:"number"===typeof e.result_away?e.result_away:void 0},score:Math.max(H(e.home||"",t),H(e.away||"",t),H(e.venue||"",t),H(e.competition||e.competition_name||e.league||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0)),A=("fulfilled"===c.status&&(null===(a=c.value)||void 0===a?void 0:a.data)||[]).filter(e=>{var n;const a=H(e.title||"",t),i=H(e.excerpt||"",t),o=H(e.content||"",t),r=H((null===e||void 0===e||null===(n=e.category)||void 0===n?void 0:n.name)||(null===e||void 0===e?void 0:e.category_name)||"",t);return a>0||i>0||o>0||r>0}).map(e=>{var n;return{type:"article",id:e.id,title:e.title,description:e.excerpt,image_url:e.image_url,url:"/blog/".concat(e.slug||e.id),date:e.published_at||e.created_at,score:Math.max(H(e.title||"",t),.7*H(e.excerpt||"",t),.3*H(e.content||"",t),.8*H((null===e||void 0===e||null===(n=e.category)||void 0===n?void 0:n.name)||(null===e||void 0===e?void 0:e.category_name)||"",t))}}).sort((e,t)=>(t.score||0)-(e.score||0)),C=(e,t)=>{const n=[];for(const i of e){var a;if(n.length>=t)break;const e=String((null===i||void 0===i||null===(a=i.metadata)||void 0===a?void 0:a.external_match_id)||"").trim();e&&!n.includes(e)&&n.push(e)}return n},E=C(w,3),T=C(S,3),D=Array.from(new Set([...E,...T])).slice(0,5);let W=[];if(D.length>0){const e=await Promise.allSettled(D.map(e=>(0,R.GE)({match_id:e,published:!0,page:1,page_size:10})));for(const t of e)"fulfilled"===t.status&&t.value&&Array.isArray(t.value.data)&&W.push(...t.value.data)}const U=e=>{var n;return{type:"article",id:e.id,title:e.title,description:e.excerpt,image_url:e.image_url,url:"/blog/".concat(e.slug||e.id),date:e.published_at||e.created_at,score:Math.max(H(e.title||"",t),.7*H(e.excerpt||"",t),.3*H(e.content||"",t),.8*H((null===e||void 0===e||null===(n=e.category)||void 0===n?void 0:n.name)||(null===e||void 0===e?void 0:e.category_name)||"",t))+5}},O=(W||[]).map(U),q=new Set(A.map(e=>e.id)),K=O.filter(e=>!q.has(e.id)),B=[...A,...K].sort((e,t)=>(t.score||0)-(e.score||0)),Z="fulfilled"===d.status?d.value:[],X=(Array.isArray(Z)?Z:[]).filter(e=>{const n="".concat(e.first_name||""," ").concat(e.last_name||""),a=H(n,t),i=H(e.position||"",t);return a>0||i>0}).map(e=>({type:"player",id:e.id,title:"".concat(e.first_name," ").concat(e.last_name),subtitle:e.position,image_url:e.image_url,url:"/hraci/".concat(e.id),metadata:{jersey_number:e.jersey_number},score:Math.max(H("".concat(e.first_name," ").concat(e.last_name),t),H(e.position||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0)),Y="fulfilled"===u.status?u.value:[],Q=(Array.isArray(Y)?Y:[]).filter(e=>{const n=H(e.title||"",t),a=H(e.description||"",t),i=H(e.location||"",t);return n>0||a>0||i>0}).map(e=>({type:"event",id:e.id,title:e.title,description:e.description,date:e.event_date,time:e.event_time,metadata:{location:e.location},score:Math.max(H(e.title||"",t),.7*H(e.description||"",t),.5*H(e.location||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0)),ee="fulfilled"===h.status?h.value:[],te=(Array.isArray(ee)?ee:[]).filter(e=>H(e.name||"",t)>0).map(e=>({type:"sponsor",id:e.id,title:e.name,logo_url:e.logo_url,url:e.website_url,score:H(e.name||"",t)})).sort((e,t)=>(t.score||0)-(e.score||0)),ne="fulfilled"===m.status?m.value:[],ae=(Array.isArray(ne)?ne:[]).filter(e=>{if(!String(e.name||"").trim())return!1;const n=H(e.name||"",t),a=H(e.short_name||"",t);return n>0||a>0}).map(e=>({type:"team",id:e.id,title:e.name,subtitle:e.short_name,logo_url:e.logo_url,description:e.description,score:Math.max(H(e.name||"",t),H(e.short_name||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0)),ie="fulfilled"===p.status?p.value:[],oe=(Array.isArray(ie)?ie:[]).filter(e=>{const n=H(e.name||"",t),a=H(e.position||"",t),i=H(e.email||"",t);return n>0||a>0||i>0}).map(e=>({type:"contact",id:e.id,title:e.name,subtitle:e.position,description:e.description,image_url:e.image_url,metadata:{email:e.email,phone:e.phone},score:Math.max(H(e.name||"",t),H(e.position||"",t),.5*H(e.email||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0)),re="fulfilled"===x.status?x.value:[],se=(Array.isArray(re)?re:[]).filter(e=>{const n=H(e.title||e.name||"",t),a=H(e.description||"",t);return n>0||a>0}).map(e=>({type:"gallery",id:e.id,title:e.title||e.name,description:e.description,image_url:e.cover_url||e.thumbnail_url,url:"/galerie/".concat(e.id),metadata:{photo_count:e.photo_count},score:Math.max(H(e.title||e.name||"",t),.7*H(e.description||"",t))})).sort((e,t)=>(t.score||0)-(e.score||0)),le=g&&"fulfilled"===g.status?g.value:[],ce=(Array.isArray(le)?le:[]).filter(e=>H((null===e||void 0===e?void 0:e.name)||"",t)>0).map(e=>({type:"category",id:e.id,title:e.name,description:e.description,url:"/blog?category_id=".concat(e.id),score:H((null===e||void 0===e?void 0:e.name)||"",t)})).sort((e,t)=>(t.score||0)-(e.score||0));return{clubs:f,matches:w,matchesPast:S,articles:B,players:X,events:Q,sponsors:te,teams:ae,contacts:oe,gallery:se,categories:ce,total:f.length+w.length+S.length+B.length+X.length+Q.length+te.length+ae.length+oe.length+se.length+ce.length}}catch(ne){return console.error("Search error:",ne),{clubs:[],matches:[],matchesPast:[],articles:[],players:[],events:[],sponsors:[],teams:[],contacts:[],gallery:[],categories:[],total:0}}}(t);oe(e)}catch(n){ae((null===n||void 0===n?void 0:n.message)||e("search.search_error"))}finally{te(!1)}}else oe({clubs:[],matches:[],matchesPast:[],articles:[],players:[],events:[],sponsors:[],teams:[],contacts:[],gallery:[],categories:[],total:0})},[]);(0,a.useEffect)(()=>{const e=String(t.get("q")||""),a=String(t.get("s")||"");if(B!==e||B!==a){const e=new URLSearchParams(t.toString());B?(e.set("q",B),e.set("s",B)):(e.delete("q"),e.delete("s")),n(e,{replace:!0})}ce(10),ue(10),me(12),xe(12),ve(10),be(B)},[B]);const ye=(0,a.useMemo)(()=>ie.total>0,[ie.total]),fe=(0,a.useMemo)(()=>ie.clubs.filter(e=>e.title&&String(e.title).trim()),[ie.clubs]),ke=(e,t)=>{const n=String(e||""),a=String(t||"").trim();if(!n||!a)return n;try{const e=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=new RegExp(e,"gi"),i=n.split(t),o=n.match(t)||[],r=[];return i.forEach((e,t)=>{r.push(e),t<o.length&&r.push((0,Q.jsx)("mark",{style:{backgroundColor:"#fde68a"},children:o[t]},t))}),(0,Q.jsx)(Q.Fragment,{children:r})}catch(i){return n}};return(0,Q.jsx)(D.A,{children:(0,Q.jsxs)(o.m,{maxW:"7xl",py:{base:6,md:10},children:[(0,Q.jsxs)(r.T,{align:"stretch",spacing:8,children:[(0,Q.jsxs)(s.a,{children:[(0,Q.jsx)(l.D,{as:"h1",size:{base:"xl",md:"2xl"},mb:2,children:e("search.title")}),(0,Q.jsx)(c.E,{color:"gray.600",children:e("search.description")})]}),(0,Q.jsxs)(s.a,{as:"form",onSubmit:e=>{e.preventDefault();const n=q.trim();K(n),Z(n);const a=new URLSearchParams(t.toString());n?(a.set("q",n),a.set("s",n)):(a.delete("q"),a.delete("s")),W("/hledat?".concat(a.toString()))},children:[(0,Q.jsxs)(d.M,{size:"lg",children:[(0,Q.jsx)(u.W,{pointerEvents:"none",children:(0,Q.jsx)(h.I,{as:C.KSO,color:"gray.400"})}),(0,Q.jsx)(m.p,{placeholder:e("search.placeholder"),value:q,onChange:e=>{K(e.target.value)},bg:je,_focus:{borderColor:"brand.primary",boxShadow:"0 0 0 1px var(--chakra-colors-brand-primary)"}})]}),(0,Q.jsx)(p.$,{type:"submit",mt:3,colorScheme:"blue",size:"lg",children:e("search.search_button")})]}),!ee&&ye&&(0,Q.jsxs)(x.z,{spacing:2,wrap:"wrap",children:[(0,Q.jsxs)(p.$,{size:"sm",variant:"all"===re?"solid":"outline",colorScheme:"blue",leftIcon:(0,Q.jsx)(C.KSO,{}),onClick:()=>se("all"),children:[e("search.all")," (",ie.total,")"]}),(0,Q.jsxs)(p.$,{size:"sm",variant:"clubs"===re?"solid":"outline",onClick:()=>se("clubs"),children:[e("search.clubs")," (",fe.length,")"]}),(0,Q.jsxs)(p.$,{size:"sm",variant:"matches"===re?"solid":"outline",onClick:()=>se("matches"),children:[e("search.matches")," (",ie.matches.length+ie.matchesPast.length,")"]}),(0,Q.jsxs)(p.$,{size:"sm",variant:"articles"===re?"solid":"outline",onClick:()=>se("articles"),children:[e("search.articles")," (",ie.articles.length,")"]}),(0,Q.jsxs)(p.$,{size:"sm",variant:"players"===re?"solid":"outline",leftIcon:(0,Q.jsx)(C.YXz,{}),onClick:()=>se("players"),children:[e("search.players")," (",ie.players.length,")"]}),(0,Q.jsxs)(p.$,{size:"sm",variant:"events"===re?"solid":"outline",leftIcon:(0,Q.jsx)(C.itz,{}),onClick:()=>se("events"),children:[e("search.events")," (",ie.events.length,")"]}),(0,Q.jsxs)(p.$,{size:"sm",variant:"other"===re?"solid":"outline",onClick:()=>se("other"),children:[e("search.others")," (",ie.teams.length+ie.sponsors.length+ie.contacts.length+ie.gallery.length+ie.categories.length,")"]})]}),ee&&(0,Q.jsx)(g.s,{justify:"center",my:12,children:(0,Q.jsxs)(r.T,{spacing:3,children:[(0,Q.jsx)(v.y,{size:"xl",color:"brand.primary",thickness:"4px"}),(0,Q.jsx)(c.E,{color:"gray.500",children:e("search.loading")})]})}),ne&&(0,Q.jsxs)(s.a,{p:4,bg:"red.50",borderRadius:"md",borderWidth:"1px",borderColor:"red.200",children:[(0,Q.jsx)(c.E,{color:"red.700",fontWeight:"medium",children:e("search.error_title")}),(0,Q.jsx)(c.E,{color:"red.600",fontSize:"sm",children:ne})]}),!ee&&!ye&&B&&(0,Q.jsxs)(s.a,{textAlign:"center",py:12,children:[(0,Q.jsx)(h.I,{as:C.KSO,boxSize:16,color:"gray.300",mb:4}),(0,Q.jsx)(l.D,{size:"md",mb:2,children:e("search.no_results")}),(0,Q.jsx)(c.E,{color:"gray.500",children:e("search.no_results_desc",{query:B})}),(0,Q.jsx)(c.E,{color:"gray.500",fontSize:"sm",mt:2,children:e("search.try_different")})]}),ye&&(0,Q.jsxs)(j.t,{variant:"enclosed",colorScheme:"blue",index:["all","clubs","matches","articles","players","events","other"].indexOf(re),onChange:e=>se(["all","clubs","matches","articles","players","events","other"][e]),children:[(0,Q.jsxs)(b.w,{flexWrap:"wrap",children:[(0,Q.jsxs)(y.o,{children:[(0,Q.jsx)(h.I,{as:C.KSO,mr:2}),e("search.all")," (",ie.total,")"]}),(0,Q.jsxs)(y.o,{children:[e("search.clubs")," (",fe.length,")"]}),(0,Q.jsxs)(y.o,{children:[e("search.matches")," (",ie.matches.length+ie.matchesPast.length,")"]}),(0,Q.jsxs)(y.o,{children:[e("search.articles")," (",ie.articles.length,")"]}),(0,Q.jsxs)(y.o,{children:[(0,Q.jsx)(h.I,{as:C.YXz,mr:2}),e("search.players")," (",ie.players.length,")"]}),(0,Q.jsxs)(y.o,{children:[(0,Q.jsx)(h.I,{as:C.itz,mr:2}),e("search.events")," (",ie.events.length,")"]}),(0,Q.jsxs)(y.o,{children:[e("search.others")," (",ie.teams.length+ie.sponsors.length+ie.contacts.length+ie.gallery.length+ie.categories.length,")"]})]}),(0,Q.jsxs)(f.T,{children:[(0,Q.jsx)(k.K,{px:0,children:(0,Q.jsxs)(r.T,{align:"stretch",spacing:8,children:[fe.length>0&&(0,Q.jsxs)(s.a,{children:[(0,Q.jsxs)(x.z,{justify:"space-between",mb:4,children:[(0,Q.jsx)(l.D,{size:"md",children:e("search.clubs")}),(0,Q.jsx)(_.E,{colorScheme:"blue",fontSize:"md",children:fe.length})]}),(0,Q.jsx)(w.r,{columns:{base:1,md:2},spacing:4,children:fe.slice(0,6).map(e=>(0,Q.jsxs)(g.s,{p:4,bg:je,borderWidth:"1px",borderRadius:"md",align:"center",gap:3,children:[e.logo_url&&(0,Q.jsx)(z._,{src:e.logo_url,alt:e.title,boxSize:"50px",objectFit:"contain"}),(0,Q.jsxs)(r.T,{align:"start",spacing:1,children:[(0,Q.jsx)(c.E,{fontWeight:"bold",children:ke(e.title,q)}),e.subtitle&&(0,Q.jsx)(c.E,{fontSize:"sm",color:"gray.500",children:e.subtitle})]})]},e.id))}),fe.length>6&&(0,Q.jsx)(p.$,{mt:3,size:"sm",onClick:()=>se("clubs"),children:e("search.show_all_clubs",{count:fe.length})})]}),ie.categories.length>0&&(0,Q.jsxs)(s.a,{children:[(0,Q.jsxs)(x.z,{justify:"space-between",mb:4,children:[(0,Q.jsx)(l.D,{size:"md",children:e("search.categories")}),(0,Q.jsx)(_.E,{colorScheme:"pink",fontSize:"md",children:ie.categories.length})]}),(0,Q.jsx)(w.r,{columns:{base:2,md:3,lg:4},spacing:4,children:ie.categories.slice(0,8).map(e=>(0,Q.jsx)(p.$,{as:E.N_,to:e.url||"#",variant:"outline",colorScheme:"pink",justifyContent:"flex-start",children:ke(e.title,q)},e.id))})]}),ie.players.length>0&&(0,Q.jsxs)(s.a,{children:[(0,Q.jsxs)(x.z,{justify:"space-between",mb:4,children:[(0,Q.jsxs)(l.D,{size:"md",children:[(0,Q.jsx)(h.I,{as:C.YXz,mr:2}),e("search.players")]}),(0,Q.jsx)(_.E,{colorScheme:"green",fontSize:"md",children:ie.players.length})]}),(0,Q.jsx)(w.r,{columns:{base:2,md:4,lg:6},spacing:4,children:ie.players.slice(0,6).map(e=>(0,Q.jsxs)(S.B,{as:E.N_,to:e.url||"#",borderWidth:"1px",borderRadius:"lg",overflow:"hidden",bg:je,_hover:{boxShadow:"md",transform:"translateY(-2px)"},transition:"all 0.2s",children:[(0,Q.jsx)(z._,{src:(0,U.uq)(e.image_url)||"/logo512.png",alt:e.title,objectFit:"cover",w:"100%",h:"140px"}),(0,Q.jsxs)(r.T,{p:2,spacing:1,align:"start",children:[(0,Q.jsx)(c.E,{fontWeight:"bold",fontSize:"xs",noOfLines:1,children:ke(e.title,q)}),e.subtitle&&(0,Q.jsx)(c.E,{fontSize:"xs",color:"gray.500",noOfLines:1,children:e.subtitle})]})]},e.id))}),ie.players.length>6&&(0,Q.jsx)(p.$,{mt:3,size:"sm",onClick:()=>se("players"),children:e("search.show_all_players",{count:ie.players.length})})]}),ie.matches.length+ie.matchesPast.length>0&&(0,Q.jsxs)(s.a,{children:[(0,Q.jsxs)(x.z,{justify:"space-between",mb:4,children:[(0,Q.jsx)(l.D,{size:"md",children:e("search.matches")}),(0,Q.jsx)(_.E,{colorScheme:"purple",fontSize:"md",children:ie.matches.length+ie.matchesPast.length})]}),(0,Q.jsxs)(r.T,{align:"stretch",spacing:3,children:[ie.matches.slice(0,3).map(e=>{var t,n;return(0,Q.jsxs)(g.s,{p:3,bg:je,borderWidth:"1px",borderRadius:"md",justify:"space-between",flexWrap:"wrap",gap:2,children:[(0,Q.jsxs)(x.z,{gap:2,children:[(null===(t=e.metadata)||void 0===t?void 0:t.home_logo_url)&&(0,Q.jsx)(z._,{src:(0,U.uq)(e.metadata.home_logo_url)||e.metadata.home_logo_url,alt:"",boxSize:"24px",objectFit:"contain"}),(0,Q.jsx)(c.E,{fontSize:"sm",fontWeight:"medium",children:ke(e.title,q)}),(null===(n=e.metadata)||void 0===n?void 0:n.away_logo_url)&&(0,Q.jsx)(z._,{src:(0,U.uq)(e.metadata.away_logo_url)||e.metadata.away_logo_url,alt:"",boxSize:"24px",objectFit:"contain"})]}),e.date&&(0,Q.jsxs)(c.E,{fontSize:"xs",color:"gray.500",children:[e.date," ",e.time]})]},e.id)}),ie.matches.length<3&&ie.matchesPast.slice(0,3-ie.matches.length).map(e=>{var t,n,a,i,o;return(0,Q.jsxs)(g.s,{p:3,bg:je,borderWidth:"1px",borderRadius:"md",justify:"space-between",flexWrap:"wrap",gap:2,children:[(0,Q.jsxs)(x.z,{gap:2,children:[(null===(t=e.metadata)||void 0===t?void 0:t.home_logo_url)&&(0,Q.jsx)(z._,{src:(0,U.uq)(e.metadata.home_logo_url)||e.metadata.home_logo_url,alt:"",boxSize:"24px",objectFit:"contain"}),(0,Q.jsx)(c.E,{fontSize:"sm",fontWeight:"medium",children:ke(e.title,q)}),(null===(n=e.metadata)||void 0===n?void 0:n.away_logo_url)&&(0,Q.jsx)(z._,{src:(0,U.uq)(e.metadata.away_logo_url)||e.metadata.away_logo_url,alt:"",boxSize:"24px",objectFit:"contain"})]}),(0,Q.jsxs)(x.z,{gap:2,children:["number"===typeof(null===(a=e.metadata)||void 0===a?void 0:a.result_home)&&"number"===typeof(null===(i=e.metadata)||void 0===i?void 0:i.result_away)?(0,Q.jsxs)(_.E,{colorScheme:"purple",fontSize:"xs",children:[e.metadata.result_home,":",e.metadata.result_away]}):null!==(o=e.metadata)&&void 0!==o&&o.result?(0,Q.jsx)(_.E,{colorScheme:"purple",fontSize:"xs",children:e.metadata.result}):null,e.date&&(0,Q.jsxs)(c.E,{fontSize:"xs",color:"gray.500",children:[e.date," ",e.time]})]})]},e.id)})]}),ie.matches.length+ie.matchesPast.length>3&&(0,Q.jsx)(p.$,{mt:3,size:"sm",onClick:()=>se("matches"),children:e("search.show_all_matches")})]}),ie.articles.length>0&&(0,Q.jsxs)(s.a,{children:[(0,Q.jsxs)(x.z,{justify:"space-between",mb:4,children:[(0,Q.jsx)(l.D,{size:"md",children:e("search.articles")}),(0,Q.jsx)(_.E,{colorScheme:"teal",fontSize:"md",children:ie.articles.length})]}),(0,Q.jsx)(w.r,{columns:{base:1,md:2,lg:3},spacing:4,children:ie.articles.slice(0,6).map(e=>(0,Q.jsxs)(S.B,{as:E.N_,to:e.url||"#",borderWidth:"1px",borderRadius:"lg",overflow:"hidden",bg:je,_hover:{boxShadow:"lg",transform:"translateY(-2px)"},transition:"all 0.2s",children:[e.image_url&&(0,Q.jsx)(z._,{src:e.image_url,alt:e.title,objectFit:"cover",w:"100%",h:"140px"}),(0,Q.jsxs)(r.T,{p:3,spacing:2,align:"start",children:[(0,Q.jsx)(c.E,{fontWeight:"bold",fontSize:"sm",noOfLines:2,children:ke(e.title,q)}),e.description&&(0,Q.jsx)(c.E,{fontSize:"xs",color:"gray.600",noOfLines:2,children:ke(e.description,q)})]})]},e.id))}),ie.articles.length>6&&(0,Q.jsx)(p.$,{mt:3,size:"sm",onClick:()=>se("articles"),children:e("search.show_all_articles",{count:ie.articles.length})})]}),ie.events.length>0&&(0,Q.jsxs)(s.a,{children:[(0,Q.jsxs)(x.z,{justify:"space-between",mb:4,children:[(0,Q.jsxs)(l.D,{size:"md",children:[(0,Q.jsx)(h.I,{as:C.itz,mr:2}),e("search.events")]}),(0,Q.jsx)(_.E,{colorScheme:"orange",fontSize:"md",children:ie.events.length})]}),(0,Q.jsx)(w.r,{columns:{base:1,md:2},spacing:4,children:ie.events.slice(0,4).map(e=>(0,Q.jsxs)(g.s,{p:3,bg:je,borderWidth:"1px",borderRadius:"md",gap:2,children:[(0,Q.jsx)(h.I,{as:C.itz,boxSize:5,color:"orange.400",mt:1}),(0,Q.jsxs)(r.T,{align:"start",spacing:1,flex:1,children:[(0,Q.jsx)(c.E,{fontWeight:"bold",fontSize:"sm",children:ke(e.title,q)}),e.description&&(0,Q.jsx)(c.E,{fontSize:"xs",color:"gray.600",noOfLines:2,children:ke(e.description,q)}),e.date&&(0,Q.jsxs)(c.E,{fontSize:"xs",color:"gray.500",children:[e.date," ",e.time]})]})]},e.id))}),ie.events.length>4&&(0,Q.jsx)(p.$,{mt:3,size:"sm",onClick:()=>se("events"),children:e("search.show_all_events")})]})]})}),(0,Q.jsx)(k.K,{px:0,children:fe.length>0?(0,Q.jsx)(w.r,{columns:{base:1,md:2},spacing:4,children:fe.map(e=>(0,Q.jsxs)(g.s,{p:4,bg:je,borderWidth:"1px",borderRadius:"md",align:"center",gap:3,children:[e.logo_url&&(0,Q.jsx)(z._,{src:e.logo_url,alt:e.title,boxSize:"60px",objectFit:"contain"}),(0,Q.jsxs)(r.T,{align:"start",spacing:1,children:[(0,Q.jsx)(c.E,{fontWeight:"bold",children:ke(e.title,q)}),e.subtitle&&(0,Q.jsx)(c.E,{fontSize:"sm",color:"gray.500",children:e.subtitle})]})]},e.id))}):(0,Q.jsx)(c.E,{color:"gray.500",children:e("search.no_clubs_found")})}),(0,Q.jsx)(k.K,{px:0,children:(0,Q.jsxs)(r.T,{align:"stretch",spacing:6,children:[ie.matches.length>0&&(0,Q.jsxs)(s.a,{children:[(0,Q.jsx)(l.D,{size:"sm",mb:3,children:e("search.upcoming_matches")}),(0,Q.jsx)(r.T,{align:"stretch",spacing:3,children:ie.matches.map(e=>{var t,n;return(0,Q.jsxs)(g.s,{p:4,bg:je,borderWidth:"1px",borderRadius:"md",justify:"space-between",flexWrap:"wrap",gap:3,children:[(0,Q.jsxs)(x.z,{gap:2,children:[(null===(t=e.metadata)||void 0===t?void 0:t.home_logo_url)&&(0,Q.jsx)(z._,{src:(0,U.uq)(e.metadata.home_logo_url)||e.metadata.home_logo_url,alt:"",boxSize:"32px",objectFit:"contain"}),(0,Q.jsx)(c.E,{fontWeight:"medium",children:ke(e.title,q)}),(null===(n=e.metadata)||void 0===n?void 0:n.away_logo_url)&&(0,Q.jsx)(z._,{src:(0,U.uq)(e.metadata.away_logo_url)||e.metadata.away_logo_url,alt:"",boxSize:"32px",objectFit:"contain"})]}),(0,Q.jsxs)(x.z,{gap:2,children:[e.date&&(0,Q.jsxs)(c.E,{fontSize:"sm",color:"gray.500",children:[e.date," ",e.time]}),e.subtitle&&(0,Q.jsx)(_.E,{children:ke(e.subtitle,q)})]})]},e.id)})})]}),ie.matchesPast.length>0&&(0,Q.jsxs)(s.a,{children:[(0,Q.jsx)(l.D,{size:"sm",mb:3,children:e("search.past_matches")}),(0,Q.jsx)(r.T,{align:"stretch",spacing:3,children:ie.matchesPast.map(e=>{var t,n,a,i,o;return(0,Q.jsxs)(g.s,{p:4,bg:je,borderWidth:"1px",borderRadius:"md",justify:"space-between",flexWrap:"wrap",gap:3,children:[(0,Q.jsxs)(x.z,{gap:2,children:[(null===(t=e.metadata)||void 0===t?void 0:t.home_logo_url)&&(0,Q.jsx)(z._,{src:(0,U.uq)(e.metadata.home_logo_url)||e.metadata.home_logo_url,alt:"",boxSize:"32px",objectFit:"contain"}),(0,Q.jsx)(c.E,{fontWeight:"medium",children:ke(e.title,q)}),(null===(n=e.metadata)||void 0===n?void 0:n.away_logo_url)&&(0,Q.jsx)(z._,{src:(0,U.uq)(e.metadata.away_logo_url)||e.metadata.away_logo_url,alt:"",boxSize:"32px",objectFit:"contain"})]}),(0,Q.jsxs)(x.z,{gap:2,children:["number"===typeof(null===(a=e.metadata)||void 0===a?void 0:a.result_home)&&"number"===typeof(null===(i=e.metadata)||void 0===i?void 0:i.result_away)?(0,Q.jsxs)(_.E,{colorScheme:"purple",fontSize:"sm",children:[e.metadata.result_home,":",e.metadata.result_away]}):null!==(o=e.metadata)&&void 0!==o&&o.result?(0,Q.jsx)(_.E,{colorScheme:"purple",fontSize:"sm",children:e.metadata.result}):null,e.date&&(0,Q.jsxs)(c.E,{fontSize:"sm",color:"gray.500",children:[e.date," ",e.time]}),e.subtitle&&(0,Q.jsx)(_.E,{children:ke(e.subtitle,q)})]})]},e.id)})})]}),0===ie.matches.length&&0===ie.matchesPast.length&&(0,Q.jsx)(c.E,{color:"gray.500",children:e("search.no_matches_found")})]})}),(0,Q.jsx)(k.K,{px:0,children:ie.articles.length>0?(0,Q.jsx)(w.r,{columns:{base:1,md:2,lg:3},spacing:4,children:ie.articles.map(e=>(0,Q.jsxs)(S.B,{as:E.N_,to:e.url||"#",borderWidth:"1px",borderRadius:"lg",overflow:"hidden",bg:je,_hover:{boxShadow:"lg",transform:"translateY(-2px)"},transition:"all 0.2s",children:[e.image_url&&(0,Q.jsx)(z._,{src:e.image_url,alt:e.title,objectFit:"cover",w:"100%",h:"160px"}),(0,Q.jsxs)(r.T,{p:4,spacing:2,align:"start",children:[(0,Q.jsx)(c.E,{fontWeight:"bold",noOfLines:2,children:ke(e.title,q)}),e.description&&(0,Q.jsx)(c.E,{fontSize:"sm",color:"gray.600",noOfLines:3,children:ke(e.description,q)})]})]},e.id))}):(0,Q.jsx)(c.E,{color:"gray.500",children:e("search.no_articles_found")})}),(0,Q.jsx)(k.K,{px:0,children:ie.players.length>0?(0,Q.jsx)(w.r,{columns:{base:2,md:3,lg:4},spacing:4,children:ie.players.map(e=>{var t;return(0,Q.jsxs)(S.B,{as:E.N_,to:e.url||"#",borderWidth:"1px",borderRadius:"lg",overflow:"hidden",bg:je,_hover:{boxShadow:"md",transform:"translateY(-2px)"},transition:"all 0.2s",children:[(0,Q.jsx)(z._,{src:(0,U.uq)(e.image_url)||"/logo512.png",alt:e.title,objectFit:"cover",w:"100%",h:"200px"}),(0,Q.jsxs)(r.T,{p:3,spacing:1,align:"start",children:[(0,Q.jsx)(c.E,{fontWeight:"bold",fontSize:"sm",children:ke(e.title,q)}),e.subtitle&&(0,Q.jsx)(c.E,{fontSize:"xs",color:"gray.500",children:e.subtitle}),(null===(t=e.metadata)||void 0===t?void 0:t.jersey_number)&&(0,Q.jsxs)(_.E,{colorScheme:"blue",children:["#",e.metadata.jersey_number]})]})]},e.id)})}):(0,Q.jsx)(c.E,{color:"gray.500",children:e("search.no_players_found")})}),(0,Q.jsx)(k.K,{px:0,children:ie.events.length>0?(0,Q.jsx)(w.r,{columns:{base:1,md:2},spacing:4,children:ie.events.map(e=>{var t;return(0,Q.jsxs)(g.s,{p:4,bg:je,borderWidth:"1px",borderRadius:"md",gap:3,children:[(0,Q.jsx)(h.I,{as:C.itz,boxSize:8,color:"orange.400"}),(0,Q.jsxs)(r.T,{align:"start",spacing:1,flex:1,children:[(0,Q.jsx)(c.E,{fontWeight:"bold",children:ke(e.title,q)}),e.description&&(0,Q.jsx)(c.E,{fontSize:"sm",color:"gray.600",noOfLines:2,children:ke(e.description,q)}),(0,Q.jsxs)(x.z,{fontSize:"sm",color:"gray.500",spacing:3,children:[e.date&&(0,Q.jsxs)(c.E,{children:[e.date," ",e.time]}),(null===(t=e.metadata)||void 0===t?void 0:t.location)&&(0,Q.jsxs)(x.z,{spacing:1,children:[(0,Q.jsx)(h.I,{as:C.vq8}),(0,Q.jsx)(c.E,{children:e.metadata.location})]})]})]})]},e.id)})}):(0,Q.jsx)(c.E,{color:"gray.500",children:e("search.no_events_found")})}),(0,Q.jsx)(k.K,{px:0,children:(0,Q.jsxs)(r.T,{align:"stretch",spacing:8,children:[ie.categories.length>0&&(0,Q.jsxs)(s.a,{children:[(0,Q.jsx)(l.D,{size:"sm",mb:3,children:e("search.categories")}),(0,Q.jsx)(w.r,{columns:{base:2,md:3,lg:4},spacing:3,children:ie.categories.map(e=>(0,Q.jsx)(p.$,{as:E.N_,to:e.url||"#",variant:"outline",size:"sm",colorScheme:"pink",justifyContent:"flex-start",children:ke(e.title,q)},e.id))})]}),ie.teams.length>0&&(0,Q.jsxs)(s.a,{children:[(0,Q.jsx)(l.D,{size:"sm",mb:3,children:e("search.teams")}),(0,Q.jsx)(w.r,{columns:{base:1,md:2},spacing:4,children:ie.teams.map(e=>(0,Q.jsxs)(g.s,{p:4,bg:je,borderWidth:"1px",borderRadius:"md",gap:3,children:[e.logo_url&&(0,Q.jsx)(z._,{src:e.logo_url,alt:e.title,boxSize:"48px",objectFit:"contain"}),(0,Q.jsxs)(r.T,{align:"start",spacing:1,children:[(0,Q.jsx)(c.E,{fontWeight:"bold",children:ke(e.title,q)}),e.subtitle&&(0,Q.jsx)(c.E,{fontSize:"sm",color:"gray.500",children:e.subtitle})]})]},e.id))})]}),ie.sponsors.length>0&&(0,Q.jsxs)(s.a,{children:[(0,Q.jsxs)(l.D,{size:"sm",mb:3,children:[(0,Q.jsx)(h.I,{as:C.DDN,mr:2}),e("search.sponsors")]}),(0,Q.jsx)(w.r,{columns:{base:2,md:4},spacing:4,children:ie.sponsors.map(e=>(0,Q.jsx)(g.s,{as:e.url?A.N:void 0,href:e.url,isExternal:!!e.url,p:4,bg:je,borderWidth:"1px",borderRadius:"md",align:"center",justify:"center",children:e.logo_url?(0,Q.jsx)(z._,{src:e.logo_url,alt:e.title,maxH:"60px",maxW:"100%",objectFit:"contain"}):(0,Q.jsx)(c.E,{fontWeight:"medium",children:ke(e.title,q)})},e.id))})]}),ie.contacts.length>0&&(0,Q.jsxs)(s.a,{children:[(0,Q.jsxs)(l.D,{size:"sm",mb:3,children:[(0,Q.jsx)(h.I,{as:C.maD,mr:2}),e("search.contacts")]}),(0,Q.jsx)(w.r,{columns:{base:1,md:2},spacing:4,children:ie.contacts.map(e=>{var t,n;return(0,Q.jsxs)(g.s,{p:4,bg:je,borderWidth:"1px",borderRadius:"md",gap:3,children:[e.image_url?(0,Q.jsx)(z._,{src:e.image_url,alt:e.title,boxSize:"50px",borderRadius:"full",objectFit:"cover"}):(0,Q.jsx)(h.I,{as:C.YXz,boxSize:10,color:"gray.400"}),(0,Q.jsxs)(r.T,{align:"start",spacing:1,flex:1,children:[(0,Q.jsx)(c.E,{fontWeight:"bold",children:ke(e.title,q)}),e.subtitle&&(0,Q.jsx)(c.E,{fontSize:"sm",color:"gray.600",children:e.subtitle}),(null===(t=e.metadata)||void 0===t?void 0:t.email)&&(0,Q.jsxs)(x.z,{fontSize:"xs",color:"gray.500",children:[(0,Q.jsx)(h.I,{as:C.maD}),(0,Q.jsx)(c.E,{children:e.metadata.email})]}),(null===(n=e.metadata)||void 0===n?void 0:n.phone)&&(0,Q.jsxs)(x.z,{fontSize:"xs",color:"gray.500",children:[(0,Q.jsx)(h.I,{as:C.Cab}),(0,Q.jsx)(c.E,{children:e.metadata.phone})]})]})]},e.id)})})]}),ie.gallery.length>0&&(0,Q.jsxs)(s.a,{children:[(0,Q.jsxs)(l.D,{size:"sm",mb:3,children:[(0,Q.jsx)(h.I,{as:C.dkL,mr:2}),e("search.gallery")]}),(0,Q.jsx)(w.r,{columns:{base:2,md:3,lg:4},spacing:4,children:ie.gallery.map(t=>{var n;return(0,Q.jsxs)(S.B,{as:E.N_,to:t.url||"#",borderWidth:"1px",borderRadius:"lg",overflow:"hidden",bg:je,_hover:{boxShadow:"md",transform:"translateY(-2px)"},transition:"all 0.2s",children:[t.image_url&&(0,Q.jsx)(z._,{src:t.image_url,alt:t.title,objectFit:"cover",w:"100%",h:"120px"}),(0,Q.jsxs)(r.T,{p:3,spacing:1,align:"start",children:[(0,Q.jsx)(c.E,{fontWeight:"bold",fontSize:"sm",noOfLines:1,children:ke(t.title,q)}),(null===(n=t.metadata)||void 0===n?void 0:n.photo_count)&&(0,Q.jsxs)(c.E,{fontSize:"xs",color:"gray.500",children:[t.metadata.photo_count," ",e("search.photos",{count:t.metadata.photo_count})]})]})]},t.id)})})]}),0===ie.categories.length&&0===ie.teams.length&&0===ie.sponsors.length&&0===ie.contacts.length&&0===ie.gallery.length&&(0,Q.jsx)(c.E,{color:"gray.500",children:e("search.no_other_results")})]})})]})]})]}),(0,Q.jsx)(X.A,{})]})})}},58957:(e,t,n)=>{n.d(t,{A:()=>A});var a=n(22107),i=n(98662),o=n(42703),r=n(98939),s=n(73212),l=n(33572),c=n(7189),d=n(96148),u=n(29904),h=n(10202),m=n(28846),p=n(39081),x=n(58861),g=n(65043),v=n(1009),j=n(85369),b=n(82047),y=n(78801),f=n(57550),k=n(25189),_=n(46291),w=n(74117),z=n(70579);const S=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")){const t=new URL(_.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}},A=()=>{const{t:e,i18n:t}=(0,w.Bd)(),n=(new Date).getFullYear(),[A,C]=(0,g.useState)("Fotbal Club"),[E,T]=(0,g.useState)(null),[D,N]=(0,g.useState)([]),{data:R}=((0,y.N)(),(0,f.s)());return(0,g.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await fetch(S("/cache/prefetch/facr_club_info.json"),{cache:"no-cache"});if(!t.ok)return;const n=await t.json();if(e)return;null!==n&&void 0!==n&&n.name&&C(String(n.name))}catch(t){}try{const t=await fetch(S("/cache/prefetch/settings.json"),{cache:"no-cache"});if(null!==t&&void 0!==t&&t.ok){const n=await t.json();!e&&n&&T((null===n||void 0===n?void 0:n.shop_url)||(null===n||void 0===n?void 0:n.eshop_url)||null)}}catch(n){}try{const t=await fetch("".concat(_.API_URL,"/sponsors"));if(t.ok){const n=await t.json();if(!e&&Array.isArray(n)){const e=n.filter(e=>!1!==e.is_active);N(e)}}}catch(a){}})(),()=>{e=!0}},[]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(a.a,{bg:"gray.800",color:"white",mt:12,py:8,borderTop:"1px",borderColor:"whiteAlpha.200",children:(0,z.jsx)(r.m,{maxW:"container.xl",children:(0,z.jsxs)(u.B,{direction:{base:"column",lg:"row"},spacing:6,justify:"space-between",align:{base:"flex-start",lg:"center"},w:"100%",children:[(0,z.jsx)(d.z,{spacing:3,align:"center",children:(0,z.jsx)(p.E,{fontWeight:"700",fontSize:"lg",children:A})}),(0,z.jsxs)(x.B,{spacing:4,shouldWrapChildren:!0,children:[(0,z.jsx)(x.Q,{children:(0,z.jsx)(c.N,{href:"/blog",color:"whiteAlpha.900",fontWeight:"600",_hover:{color:"white",textDecoration:"underline"},children:e("footer.articles")})}),(0,z.jsx)(x.Q,{children:(0,z.jsx)(c.N,{href:"/kalendar",color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},children:e("footer.matches")})}),(0,z.jsx)(x.Q,{children:(0,z.jsx)(c.N,{href:"/tabulky",color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},children:e("footer.table")})}),(0,z.jsx)(x.Q,{children:(0,z.jsx)(c.N,{href:"/sponzori",color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},children:e("footer.sponsors")})}),(0,z.jsx)(x.Q,{children:(0,z.jsx)(c.N,{href:"/kontakt",color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},children:e("footer.contact")})}),(0,z.jsx)(x.Q,{children:(0,z.jsx)(c.N,{href:"/pravidla-cookies",color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},children:e("footer.cookies")})}),(0,z.jsx)(x.Q,{children:(0,z.jsx)(c.N,{href:"/obchodni-podminky",color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},children:e("footer.terms")})}),(0,z.jsx)(x.Q,{children:(0,z.jsx)(c.N,{href:"/zasady-ochrany-osobnich-udaju",color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},children:e("footer.privacy")})}),E&&(0,z.jsx)(x.Q,{children:(0,z.jsxs)(c.N,{href:E,color:"whiteAlpha.800",_hover:{color:"white",textDecoration:"underline"},isExternal:!0,display:"inline-flex",alignItems:"center",gap:1,children:[e("footer.eshop")," ",(0,z.jsx)(v.qdV,{})]})})]})]})})}),D.length>0&&(0,z.jsx)(a.a,{bg:"gray.700",color:"white",py:8,borderTop:"1px",borderColor:"whiteAlpha.200",children:(0,z.jsx)(r.m,{maxW:"container.xl",children:(0,z.jsxs)(h.T,{spacing:6,children:[(0,z.jsx)(m.D,{size:"md",color:"whiteAlpha.900",children:e("footer.partners")}),(0,z.jsx)(s.r,{columns:{base:2,sm:3,md:4,lg:6},spacing:6,w:"full",children:[...D].sort((e,t)=>{var n,a;const i="general"===(null===e||void 0===e?void 0:e.tier)?0:1,o="general"===(null===t||void 0===t?void 0:t.tier)?0:1;if(i!==o)return i-o;const r=null!==(n=null===e||void 0===e?void 0:e.display_order)&&void 0!==n?n:9999,s=null!==(a=null===t||void 0===t?void 0:t.display_order)&&void 0!==a?a:9999;return r!==s?r-s:String((null===e||void 0===e?void 0:e.name)||"").localeCompare(String((null===t||void 0===t?void 0:t.name)||""))}).map(e=>(0,z.jsx)(c.N,{href:e.website_url||"#",isExternal:!!e.website_url,target:e.website_url?"_blank":void 0,rel:e.website_url?"noopener noreferrer":void 0,display:"flex",alignItems:"center",justifyContent:"center",p:3,bg:"whiteAlpha.100",borderRadius:"md",_hover:{bg:"whiteAlpha.200",transform:"translateY(-2px)"},transition:"all 0.2s",onClick:()=>(0,b.UQ)("footer","sponsor_".concat(e.name)),children:(0,z.jsx)(l._,{src:(0,k.uq)(e.logo_url)||"/sponsor-placeholder.svg",alt:e.name,maxH:"60px",maxW:"full",objectFit:"contain",opacity:.9,_hover:{opacity:1}})},e.id))})]})})}),((null===R||void 0===R?void 0:R.facebook_url)||(null===R||void 0===R?void 0:R.instagram_url)||(null===R||void 0===R?void 0:R.youtube_url))&&(0,z.jsx)(a.a,{bg:"gray.600",color:"white",py:6,borderTop:"1px",borderColor:"whiteAlpha.200",children:(0,z.jsx)(r.m,{maxW:"container.xl",children:(0,z.jsxs)(h.T,{spacing:4,children:[(0,z.jsx)(p.E,{fontSize:"lg",fontWeight:"600",color:"whiteAlpha.900",children:e("footer.follow_us")}),(0,z.jsxs)(d.z,{spacing:4,children:[(null===R||void 0===R?void 0:R.facebook_url)&&(0,z.jsx)(o.K,{as:"a",href:R.facebook_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Facebook",icon:(0,z.jsx)(j.iYk,{}),size:"lg",colorScheme:"facebook",variant:"ghost",color:"white",_hover:{bg:"whiteAlpha.200",transform:"translateY(-2px)",color:"#1877F2"},transition:"all 0.2s",onClick:()=>(0,b.UQ)("footer","social_facebook")}),(null===R||void 0===R?void 0:R.instagram_url)&&(0,z.jsx)(o.K,{as:"a",href:R.instagram_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Instagram",icon:(0,z.jsx)(j.ao$,{}),size:"lg",variant:"ghost",color:"white",_hover:{bg:"whiteAlpha.200",transform:"translateY(-2px)",color:"#E4405F"},transition:"all 0.2s",onClick:()=>(0,b.UQ)("footer","social_instagram")}),(null===R||void 0===R?void 0:R.youtube_url)&&(0,z.jsx)(o.K,{as:"a",href:R.youtube_url,target:"_blank",rel:"noopener noreferrer","aria-label":"YouTube",icon:(0,z.jsx)(j.Vk6,{}),size:"lg",variant:"ghost",color:"white",_hover:{bg:"whiteAlpha.200",transform:"translateY(-2px)",color:"#FF0000"},transition:"all 0.2s",onClick:()=>(0,b.UQ)("footer","social_youtube")})]})]})})}),(0,z.jsx)(a.a,{bg:"gray.900",color:"whiteAlpha.900",py:4,children:(0,z.jsx)(r.m,{maxW:"container.xl",children:(0,z.jsxs)(p.E,{fontSize:"sm",textAlign:"center",children:["\xa9 ",n," ",A,". ","en"===t.language?"All rights reserved.":"V\u0161echna pr\xe1va vyhrazena."]})})}),(0,z.jsx)(a.a,{bg:"white",borderTop:"1px",borderColor:"gray.200",py:6,"data-watermark":"myclub",children:(0,z.jsx)(r.m,{maxW:"container.xl",children:(0,z.jsxs)(u.B,{direction:{base:"column",md:"row"},spacing:6,justify:"space-between",align:"center",children:[(0,z.jsxs)(d.z,{spacing:4,align:"center",children:[(0,z.jsx)(l._,{src:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 50'%3E%3Crect width='200' height='50' fill='%23007bff'/%3E%3Ctext x='10' y='35' font-family='Arial' font-size='24' font-weight='bold' fill='%23fff'%3EMyClub%3C/text%3E%3C/svg%3E",alt:"MyClub",h:{base:"32px",md:"40px"},w:"auto",loading:"lazy",fallbackSrc:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 50'%3E%3Ctext x='10' y='35' font-family='Arial' font-size='24' font-weight='bold' fill='%23000'%3EMyClub%3C/text%3E%3C/svg%3E"}),(0,z.jsxs)(h.T,{align:"start",spacing:0,children:[(0,z.jsx)(p.E,{fontSize:{base:"sm",md:"md"},fontWeight:"600",color:"gray.800",children:e("footer.powered_by")}),(0,z.jsx)(p.E,{fontSize:{base:"xs",md:"sm"},color:"gray.600",children:e("footer.powered_by_desc")})]})]}),(0,z.jsxs)(d.z,{spacing:3,children:[(0,z.jsx)(i.$,{as:"a",href:"https://myclub.sportcreative.eu/kontakt",target:"_blank",rel:"noopener noreferrer",size:{base:"sm",md:"md"},colorScheme:"blue",variant:"solid",leftIcon:(0,z.jsx)(v.pHD,{}),_hover:{transform:"translateY(-2px)",boxShadow:"lg"},transition:"all 0.2s",children:e("footer.order_now")}),(0,z.jsx)(i.$,{as:"a",href:"https://myclub.sportcreative.eu",target:"_blank",rel:"noopener noreferrer",size:{base:"sm",md:"md"},variant:"outline",colorScheme:"gray",rightIcon:(0,z.jsx)(v.qdV,{}),_hover:{bg:"gray.50"},children:e("footer.learn_more")})]})]})})})]})}},60215:(e,t,n)=>{n.d(t,{A:()=>O});var a=n(65043),i=n(22107),o=n(44093),r=n(30502),s=n(96870),l=n(5371),c=n(19077),d=n(96148),u=n(59883),h=n(86236),m=n(42703),p=n(39081),x=n(91872),g=n(53560),v=n(76659),j=n(99956),b=n(78460),y=n(11054),f=n(85421),k=n(15071),_=n(35929),w=n(67516),z=n(56529),S=n(98662),A=n(13729),C=n(96938),E=n(1009),T=n(57234),D=n(23978),N=n(46291);async function R(){return(await N.FH.get("/ai/usage/status")).data.status}var F=n(88500),P=n(31629),I=n(34636),M=n(70579);const L=(0,A.P)(i.a),W=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:14;if(!e)return null;const n=16===t?20:t;return"deepseek"===e.provider?(0,M.jsx)("img",{src:"/deepseek.svg",alt:"DeepSeek",width:n,height:n}):"mistral"===e.provider?"mistral-small-latest"===e.id?(0,M.jsx)("img",{src:"/mistral_small.png",alt:"Mistral",width:n,height:n}):(0,M.jsx)("img",{src:"/ministral.png",alt:"Ministral",width:n,height:n}):"openrouter"===e.provider?(0,M.jsx)(T.A,{size:t}):"grok"===e.provider?(0,M.jsx)("img",{src:"/grok.svg",alt:"Grok",width:n,height:n}):null},U=e=>e.includes("reasoning")||e.includes("reasoner"),O=e=>{let{value:t,onChange:n,onSubmit:A,isSubmitting:T,placeholder:N,helperText:O,initialModelId:q,onModelChange:K,onAttachClick:B,onVoiceClick:Z}=e;const V=(0,a.useMemo)(()=>(0,D.pU)(),[]),H=(0,a.useMemo)(()=>q||(0,D.xU)(),[q]),[$,J]=(0,a.useState)(H),[G,X]=(0,a.useState)({}),[Y,Q]=(0,a.useState)(!1),ee=(0,a.useCallback)(e=>{const t=G[e];return t?t.unlimited?-1:t.remaining:10},[G]),[te,ne]=(0,a.useState)(()=>ee(H)),ae=(0,a.useRef)(null),ie=(0,o.dU)("white","gray.800"),oe=(0,o.dU)("gray.50","gray.700"),re=(0,o.dU)("gray.200","gray.600"),se=(0,o.dU)("gray.500","gray.400"),le=(0,o.dU)("gray.100","gray.600"),ce=(0,r.d)(),{isOpen:de,onOpen:ue,onClose:he}=(0,s.j)(),{isOpen:me,onOpen:pe,onClose:xe}=(0,s.j)(),[ge,ve]=(0,a.useState)([]),[je,be]=(0,a.useState)(""),[ye,fe]=(0,a.useState)(!1),ke=(0,a.useRef)(null),_e=(0,a.useRef)(null),we=(0,a.useRef)([]),ze=(0,a.useRef)(null),Se=(0,a.useRef)(null),Ae=(0,a.useRef)(null),Ce=(0,a.useRef)(null),[Ee,Te]=(0,a.useState)(!1),[De,Ne]=(0,a.useState)(!1),[Re,Fe]=(0,a.useState)(!1),[Pe,Ie]=(0,a.useState)(0),[Me,Le]=(0,a.useState)(()=>new Array(32).fill(0)),We=(0,a.useCallback)(e=>{const t=ae.current;if(!t)return;if(e)return void(t.style.height="".concat(96,"px"));t.style.height="auto";const n=Math.max(96,Math.min(t.scrollHeight,260));t.style.height="".concat(n,"px")},[]);(0,a.useEffect)(()=>{We()},[t,We]),(0,a.useEffect)(()=>{const e=()=>We();return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[We]),(0,a.useEffect)(()=>{(async()=>{Q(!0);try{const e=await R();X(e)}catch(e){console.error("Failed to fetch AI usage status:",e)}finally{Q(!1)}})()},[]),(0,a.useEffect)(()=>{ne(ee($))},[ee,$]);const Ue=e=>{const t=G[e];return t?t.limit:10},Oe=async()=>{const e=t.trim();if(!e)return;const n=G[$];if(n&&!n.unlimited&&n.remaining<=0)ce({title:"Denn\xed limit vy\u010derp\xe1n",description:"Denn\xed limit pro tento AI model byl vy\u010derp\xe1n. Zkuste to znovu z\xedtra.",status:"warning",duration:5e3,isClosable:!0});else try{const t=A(e,$);t&&"function"===typeof t.then&&await t;const n=await R();X(n)}catch(a){}},qe=(0,D.wY)($),Ke=T||!t.trim()||te<=0,Be=e=>{const a=e.trim();if(!a)return;const i=t?"".concat(t,"\n\n").concat(a):a;n(i)},Ze=()=>{if(_e.current&&(_e.current.getTracks().forEach(e=>e.stop()),_e.current=null),null!==Ae.current&&(cancelAnimationFrame(Ae.current),Ae.current=null),null!==Ce.current&&(window.clearInterval(Ce.current),Ce.current=null),ze.current){try{ze.current.close()}catch(e){}ze.current=null,Se.current=null}},Ve=()=>{if(Ee)try{var e;null===(e=ke.current)||void 0===e||e.stop()}catch(t){Ze(),Te(!1)}};return(0,M.jsxs)(i.a,{w:"100%",py:2,children:[(0,M.jsx)(i.a,{bg:ie,borderRadius:"2xl",p:3,borderWidth:"1px",borderColor:re,boxShadow:(0,o.dU)("sm","dark-lg"),_hover:{borderColor:(0,o.dU)("gray.300","gray.500")},transition:"all 0.2s ease",children:(0,M.jsx)(i.a,{position:"relative",children:(0,M.jsxs)(l.s,{direction:"column",children:[(0,M.jsx)(i.a,{overflowY:"auto",maxH:"360px",children:(0,M.jsx)(c.T,{ref:ae,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),T||Oe())},placeholder:N||"Napi\u0161te, s \u010d\xedm m\xe1 AI pomoci...",resize:"none",border:"none",bg:oe,borderRadius:"xl",px:4,py:3,minH:"".concat(96,"px"),_focusVisible:{boxShadow:"none",bg:(0,o.dU)("white","gray.700")},_placeholder:{color:se},fontSize:"sm"})}),(0,M.jsx)(i.a,{h:"60px",bg:oe,borderBottomRadius:"xl",borderTop:"1px solid",borderColor:re,mt:-1,_hover:{bg:le},transition:"all 0.2s ease",children:(0,M.jsxs)(l.s,{position:"absolute",left:3,right:3,bottom:2,align:"center",justify:"space-between",children:[(0,M.jsxs)(d.z,{spacing:2,align:"center",children:[(0,M.jsxs)(u.W,{children:[(0,M.jsx)(h.I,{as:m.K,size:"sm",variant:"ghost",colorScheme:"gray","aria-label":"Vybrat AI model",px:2,_hover:{bg:le},children:(0,M.jsx)(C.N,{mode:"wait",children:(0,M.jsxs)(L,{display:"flex",alignItems:"center",gap:2,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.15},children:[(0,M.jsx)(i.a,{bg:"blue.50",p:1,borderRadius:"md",children:W(qe,14)}),(0,M.jsx)(p.E,{fontSize:"xs",fontWeight:"600",color:"gray.700",children:(null===qe||void 0===qe?void 0:qe.label)||"Model"}),(0,M.jsx)(E.fK4,{size:12,color:"gray.500"})]},$)})}),(0,M.jsx)(x.c,{fontSize:"sm",zIndex:1500,children:V.map(e=>{const t=ee(e.id);return(0,M.jsx)(g.D,{onClick:()=>{return t=e.id,J(t),void(K&&K(t));var t},children:(0,M.jsxs)(d.z,{justify:"space-between",w:"100%",spacing:3,children:[(0,M.jsxs)(i.a,{children:[(0,M.jsxs)(d.z,{spacing:2,align:"center",children:[(0,M.jsx)(i.a,{bg:"gray.50",p:1,borderRadius:"md",children:W(e,16)}),(0,M.jsx)(p.E,{fontWeight:"600",color:"gray.800",children:e.label})]}),e.description&&(0,M.jsx)(p.E,{fontSize:"xs",color:"gray.600",mt:1,children:e.description}),U(e.id)&&(0,M.jsx)(p.E,{fontSize:"xs",color:"blue.600",mt:1,fontWeight:"medium",children:"Reasoning model - p\u0159em\xfd\u0161l\xed p\u0159ed odpov\u011bd\xed"})]}),(0,M.jsxs)(d.z,{spacing:2,align:"center",children:[Y?(0,M.jsx)(v.y,{size:"xs",color:"gray.500"}):(0,M.jsx)(p.E,{fontSize:"xs",color:"gray.600",fontWeight:"500",children:"deepseek"===e.provider?"\u221e":"".concat(Math.max(0,t),"/").concat(Ue(e.id))}),$===e.id&&(0,M.jsx)(i.a,{bg:"green.100",p:1,borderRadius:"full",children:(0,M.jsx)(E.YrT,{size:12,color:"green.600"})})]})]})},e.id)})})]}),(0,M.jsx)(i.a,{h:"4",w:"1px",bg:re,mx:1}),U($)&&(0,M.jsx)(j.m,{label:"Reasoning modely p\u0159em\xfd\u0161l\xed nad odpov\u011bd\xed - poskytuj\xed hlub\u0161\xed anal\xfdzu, ale mohou trvat d\xe9le",children:(0,M.jsx)(p.E,{fontSize:"xs",color:"blue.600",px:2,py:1,bg:"blue.50",borderRadius:"md",fontWeight:"medium",children:"Reasoning"})}),(0,M.jsx)(j.m,{label:"P\u0159ilo\u017eit soubor (obr\xe1zek / PDF)",children:(0,M.jsx)(m.K,{"aria-label":"P\u0159ilo\u017eit soubor",icon:(0,M.jsx)(E._mV,{}),size:"sm",variant:"ghost",colorScheme:"gray",_hover:{bg:le},onClick:()=>{B?B():(ve([]),be(""),ue())}})}),(0,M.jsx)(j.m,{label:"Nahr\xe1t hlas pro p\u0159epis",children:(0,M.jsx)(m.K,{"aria-label":"Nahr\xe1t hlas",icon:(0,M.jsx)(E.Rrl,{}),size:"sm",variant:"ghost",colorScheme:"gray",_hover:{bg:le},onClick:()=>{Z?Z():(we.current=[],Fe(!1),Ne(!1),pe())}})}),O&&(0,M.jsx)(p.E,{fontSize:"xs",color:"gray.500",ml:2,noOfLines:1,children:O})]}),(0,M.jsxs)(d.z,{spacing:3,align:"center",children:[Y?(0,M.jsx)(v.y,{size:"xs",color:"gray.500"}):(0,M.jsx)(p.E,{fontSize:"xs",color:"gray.600",fontWeight:"500",children:"deepseek"===(null===qe||void 0===qe?void 0:qe.provider)?"\u221e":"Zb\xfdv\xe1 ".concat(Ue($)===1/0?"\u221e":"".concat(te,"/").concat(Ue($)))}),(0,M.jsx)(j.m,{label:te<=0?"Denn\xed limit pro tento model byl vy\u010derp\xe1n.":"Odeslat (Enter). Shift+Enter vlo\u017e\xed nov\xfd \u0159\xe1dek.",children:(0,M.jsx)("span",{children:(0,M.jsx)(m.K,{"aria-label":"Odeslat AI po\u017eadavek",icon:(0,M.jsx)(E.kGk,{}),size:"sm",variant:"ghost",colorScheme:"blue",_hover:{bg:"blue.50"},isLoading:T&&!Y,isDisabled:Ke,onClick:Oe})})})]})]})})]})})}),(0,M.jsxs)(b.aF,{isOpen:de,onClose:he,isCentered:!0,size:"lg",children:[(0,M.jsx)(y.m,{}),(0,M.jsxs)(f.$,{children:[(0,M.jsx)(k.r,{children:"P\u0159ilo\u017eit soubor pro OCR"}),(0,M.jsx)(_.s,{}),(0,M.jsxs)(w.c,{children:[(0,M.jsx)(F.A,{label:"Soubor pro AI (PDF / obr\xe1zek)",description:"Nahrajte dokument nebo obr\xe1zek, ze kter\xe9ho m\xe1 AI p\u0159e\u010d\xedst text.",value:ge,onChange:ve,accept:"application/pdf,image/*",maxFiles:1,onUploadFinished:async e=>{if(!e||0===e.length)return;const t=e[e.length-1];if(null!==t&&void 0!==t&&t.url){fe(!0);try{const e=(t.type||"").startsWith("image/"),n=await(0,P.SE)({document_url:e?"":t.url,image_url:e?t.url:"",model:"mistral-ocr-latest"});be(n.text||""),(n.text||"").trim()?(Be(n.text||""),ce({title:"Text z dokumentu byl vlo\u017een do AI promptu",status:"success",duration:3e3,isClosable:!0})):ce({title:"OCR nena\u0161lo \u010diteln\xfd text",status:"info",duration:3e3,isClosable:!0})}catch(n){ce({title:"OCR selhalo",description:(null===n||void 0===n?void 0:n.message)||"Zkuste to pros\xedm znovu.",status:"error",duration:4e3,isClosable:!0})}finally{fe(!1)}}}}),ye&&(0,M.jsxs)(d.z,{mt:4,spacing:2,align:"center",children:[(0,M.jsx)(v.y,{size:"sm"}),(0,M.jsx)(p.E,{fontSize:"sm",children:"Prob\xedh\xe1 zpracov\xe1n\xed textu\u2026"})]}),!!je&&!ye&&(0,M.jsxs)(i.a,{mt:4,children:[(0,M.jsx)(p.E,{fontSize:"sm",fontWeight:"semibold",mb:2,children:"Rozpoznan\xfd text"}),(0,M.jsx)(i.a,{borderWidth:"1px",borderRadius:"md",borderColor:re,bg:oe,p:3,maxH:"200px",overflowY:"auto",fontSize:"sm",whiteSpace:"pre-wrap",children:je})]})]}),(0,M.jsx)(z.j,{children:(0,M.jsx)(d.z,{spacing:3,children:(0,M.jsx)(S.$,{variant:"ghost",onClick:he,children:"Zav\u0159\xedt"})})})]})]}),(0,M.jsxs)(b.aF,{isOpen:me,onClose:()=>{Ee&&Ve(),xe()},isCentered:!0,size:"md",children:[(0,M.jsx)(y.m,{}),(0,M.jsxs)(f.$,{children:[(0,M.jsx)(k.r,{children:"Hlasov\xfd vstup pro AI"}),(0,M.jsx)(_.s,{}),(0,M.jsxs)(w.c,{children:[(0,M.jsx)(p.E,{fontSize:"sm",mb:3,children:"Nahrajte kr\xe1tkou hlasovou zpr\xe1vu, kterou AI p\u0159ep\xed\u0161e do textu a vlo\u017e\xed do promptu."}),(0,M.jsxs)(d.z,{spacing:4,align:"center",children:[(0,M.jsx)(S.$,{onClick:Ee?Ve:async()=>{var e;if(!Ee)if("undefined"!==typeof navigator&&null!==(e=navigator.mediaDevices)&&void 0!==e&&e.getUserMedia)try{const e=await navigator.mediaDevices.getUserMedia({audio:!0});_e.current=e,we.current=[],Ie(0);try{const t="undefined"!==typeof window?window.AudioContext||window.webkitAudioContext:null;if(t){const n=ze.current||new t;ze.current=n;const a=n.createMediaStreamSource(e),i=n.createAnalyser();i.fftSize=256,Se.current=i,a.connect(i);const o=i.frequencyBinCount,r=new Uint8Array(o),s=()=>{if(!Se.current)return;Se.current.getByteTimeDomainData(r);let e=0;for(let a=0;a<o;a+=1){const t=(r[a]-128)/128;e+=t*t}const t=Math.sqrt(e/o),n=Math.max(0,Math.min(1,4*t));Le(e=>e.map((e,t)=>{const a=.2*Math.sin(Date.now()/120+t),i=n+a;return Math.max(.1,Math.min(1,i))})),Ae.current=requestAnimationFrame(s)};null!==Ae.current&&cancelAnimationFrame(Ae.current),Ae.current=requestAnimationFrame(s)}}catch(t){}const n=new MediaRecorder(e);ke.current=n,n.ondataavailable=e=>{e.data&&e.data.size>0&&we.current.push(e.data)},n.onstop=()=>{Ze(),Te(!1),Fe(we.current.length>0)},n.start(),Te(!0),Fe(!1),null!==Ce.current&&window.clearInterval(Ce.current),Ce.current=window.setInterval(()=>{Ie(e=>e+1)},1e3)}catch(n){ce({title:"Nelze z\xedskat p\u0159\xedstup k mikrofonu",description:(null===n||void 0===n?void 0:n.message)||"Zkontrolujte opr\xe1vn\u011bn\xed prohl\xed\u017ee\u010de.",status:"error",duration:4e3,isClosable:!0})}else ce({title:"Prohl\xed\u017ee\u010d nepodporuje nahr\xe1v\xe1n\xed zvuku",status:"error",duration:4e3,isClosable:!0})},isDisabled:De,bg:Ee?"red.500":"blackAlpha.700",color:"white",_hover:{bg:Ee?"red.600":"blackAlpha.800"},_active:{bg:Ee?"red.700":"blackAlpha.900"},children:Ee?"Zastavit nahr\xe1v\xe1n\xed":"Za\u010d\xedt nahr\xe1vat"}),Re&&!Ee&&(0,M.jsx)(p.E,{fontSize:"sm",color:"green.500",children:"Nahr\xe1vka je p\u0159ipravena k p\u0159episu."})]}),Ee&&(0,M.jsxs)(i.a,{mt:4,children:[(0,M.jsxs)(d.z,{justify:"space-between",mb:1,children:[(0,M.jsx)(p.E,{fontSize:"xs",color:"gray.500",children:"Nahr\xe1v\xe1n\xed\u2026"}),(0,M.jsx)(p.E,{fontSize:"xs",fontFamily:"mono",color:"gray.600",children:"".concat(String(Math.floor(Pe/60)).padStart(2,"0"),":").concat(String(Pe%60).padStart(2,"0"))})]}),(0,M.jsx)(d.z,{spacing:1,align:"flex-end",h:"40px",children:Me.map((e,t)=>(0,M.jsx)(i.a,{w:"2px",borderRadius:"full",bg:"green.400",h:"".concat(Math.max(8,100*e),"%")},t))})]}),De&&(0,M.jsxs)(d.z,{mt:4,spacing:2,align:"center",children:[(0,M.jsx)(v.y,{size:"sm"}),(0,M.jsx)(p.E,{fontSize:"sm",children:"Prob\xedh\xe1 p\u0159epis hlasu\u2026"})]})]}),(0,M.jsx)(z.j,{children:(0,M.jsxs)(d.z,{spacing:3,children:[(0,M.jsx)(S.$,{onClick:async()=>{if(!we.current.length)return void ce({title:"Nejprve nahrajte hlasovou zpr\xe1vu",status:"info",duration:3e3,isClosable:!0});const e=new Blob(we.current,{type:"audio/webm"}),t=new File([e],"voice-message.webm",{type:"audio/webm"});Ne(!0);try{const e=await(0,I.QM)(t),n=await(0,P.os)({file_url:e.url,model:"voxtral-mini-latest",language:"cs"});(n.text||"").trim()?(Be(n.text||""),ce({title:"P\u0159epis hlasu vlo\u017een do AI promptu",status:"success",duration:3e3,isClosable:!0}),xe()):ce({title:"P\u0159epis neobsahuje text",status:"info",duration:3e3,isClosable:!0})}catch(n){ce({title:"P\u0159epis hlasu selhal",description:(null===n||void 0===n?void 0:n.message)||"Zkuste to pros\xedm znovu.",status:"error",duration:4e3,isClosable:!0})}finally{Ne(!1)}},isDisabled:!Re||Ee||De,isLoading:De,bg:"blackAlpha.800",color:"white",_hover:{bg:"blackAlpha.900"},_active:{bg:"blackAlpha.900"},children:"P\u0159epsat a vlo\u017eit do promptu"}),(0,M.jsx)(S.$,{variant:"ghost",onClick:()=>{Ee&&Ve(),xe()},children:"Zav\u0159\xedt"})]})})]})]})]})}},60551:(e,t,n)=>{n.r(t),n.d(t,{default:()=>X});var a=n(89379),i=n(65043),o=n(96870),r=n(87139),s=n(22107),l=n(98662),c=n(42703),d=n(34946),u=n(44093),h=n(73225),m=n(76668),p=n(35699),x=n(59883),g=n(86236),v=n(53560),j=n(91872),b=n(67516),y=n(35929),f=n(56529),k=n(15071),_=n(11054),w=n(78460),z=n(85421),S=n(61724),A=n(76659),C=n(96148),E=n(10202),T=n(98481),D=n(80511),N=n(82595),R=n(67813),F=n(83201),P=n(3313),I=n(55395),M=n(30502),L=n(28846),W=n(39081),U=n(12730),O=n(58584),q=n(99973),K=n(92342),B=n(29066),Z=n(35200),V=n(46291),H=n(6583),$=n(1029),J=n(2367),G=n(70579);const X=()=>{const[e,t]=(0,i.useState)([]),[n,X]=(0,i.useState)(!0),[Y,Q]=(0,i.useState)(!1),{isOpen:ee,onOpen:te,onClose:ne}=(0,o.j)(),[ae,ie]=(0,i.useState)(null),[oe,re]=(0,i.useState)({name:"",email:"",password:"",currentPassword:"",role:"editor",isActive:!0}),se=(0,M.d)(),le=(0,u.dU)("white","gray.800"),ce=(0,u.dU)("gray.200","gray.700"),{user:de}=(0,B.A)(),{confirm:ue}=(0,Z.G)(),[he,me]=(0,i.useState)([]),[pe,xe]=(0,i.useState)(!1),[ge,ve]=(0,i.useState)(null),je=async()=>{try{const e=await V.Ay.get("/admin/users");t(e.data)}catch(e){console.error("Error fetching users:",e),se({title:"Chyba",description:"Nepoda\u0159ilo se na\u010d\xedst u\u017eivatele",status:"error",duration:5e3,isClosable:!0})}finally{X(!1)}};(0,i.useEffect)(()=>{je(),(async()=>{try{xe(!0);const e=(await(0,$.g9)()||[]).filter(e=>e.requires_admin),t=[];for(const n of e)if("dropdown"!==n.type&&t.push(n),Array.isArray(n.children))for(const e of n.children)e.requires_admin&&"dropdown"!==e.type&&t.push(e);me(t)}catch(e){console.error("Error fetching editor pages:",e),se({title:"Chyba",description:"Nepoda\u0159ilo se na\u010d\xedst seznam str\xe1nek pro editory",status:"error",duration:5e3,isClosable:!0})}finally{xe(!1)}})()},[]);const be=e=>{const{name:t,value:n}=e.target;re(i=>(0,a.A)((0,a.A)({},i),{},{[t]:"isActive"===t?e.target.checked:n}))},ye=async t=>{const n=e.find(e=>e.id===t);if("admin"===(null===n||void 0===n?void 0:n.role))return void se({title:"Zak\xe1z\xe1no",description:"Admin u\u017eivatele nelze smazat.",status:"warning"});if(de&&String(de.id)===String(t))return void se({title:"Zak\xe1z\xe1no",description:"Nem\u016f\u017eete smazat s\xe1m sebe.",status:"warning"});if(await ue({title:"Smazat u\u017eivatele",message:"Opravdu smazat tohoto u\u017eivatele?",confirmText:"Smazat",cancelText:"Zru\u0161it",isDanger:!0}))try{await V.Ay.delete("/admin/users/".concat(t)),se({title:"Hotovo",description:"U\u017eivatel smaz\xe1n",status:"success",duration:3e3,isClosable:!0}),je()}catch(s){var a,i,o,r;console.error("Error deleting user:",s),se({title:"Chyba",description:(null===(a=s.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||(null===(o=s.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.message)||"Nepoda\u0159ilo se smazat u\u017eivatele",status:"error",duration:5e3,isClosable:!0})}},fe=()=>{re({name:"",email:"",password:"",currentPassword:"",role:"editor",isActive:!0}),ie(null)},ke=e=>{ie(e),re({name:e.name,email:e.email,password:"",currentPassword:"",role:e.role,isActive:e.isActive}),te()};return(0,G.jsx)(H.A,{children:(0,G.jsxs)(s.a,{children:[(0,G.jsxs)(C.z,{justify:"space-between",mb:4,children:[(0,G.jsx)(L.D,{size:"lg",children:"Spr\xe1va u\u017eivatel\u016f"}),(0,G.jsx)(l.$,{leftIcon:(0,G.jsx)(U.R,{}),colorScheme:"blue",onClick:()=>{fe(),te()},children:"P\u0159idat u\u017eivatele"})]}),(0,G.jsxs)(W.E,{color:"gray.500",mb:6,children:["Spr\xe1va u\u017eivatelsk\xfdch \xfa\u010dt\u016f a jejich opr\xe1vn\u011bn\xed. ",(0,G.jsx)("strong",{children:"Editor"})," m\u016f\u017ee vytv\xe1\u0159et a upravovat \u010dl\xe1nky a aktivity. ",(0,G.jsx)("strong",{children:"Admin"})," m\xe1 p\u0159\xedstup ke v\u0161em funkc\xedm."]}),(0,G.jsx)(L.D,{size:"md",mb:2,children:"Admini a edito\u0159i"}),(0,G.jsx)(s.a,{bg:le,borderRadius:"md",boxShadow:"sm",overflowX:"auto",mb:8,children:(0,G.jsxs)(D.X,{variant:"simple",children:[(0,G.jsx)(P.d,{children:(0,G.jsxs)(I.Tr,{children:[(0,G.jsx)(F.Th,{children:"Jm\xe9no"}),(0,G.jsx)(F.Th,{children:"E\u2011mail"}),(0,G.jsx)(F.Th,{children:"Role"}),(0,G.jsx)(F.Th,{children:"Stav"}),(0,G.jsx)(F.Th,{children:"Vytvo\u0159eno"}),(0,G.jsx)(F.Th,{children:"Akce"})]})}),(0,G.jsx)(N.N,{children:e.filter(e=>"fan"!==e.role).map(e=>(0,G.jsxs)(I.Tr,{children:[(0,G.jsx)(R.Td,{children:e.name}),(0,G.jsx)(R.Td,{children:e.email}),(0,G.jsx)(R.Td,{children:(0,G.jsx)(r.E,{colorScheme:"admin"===e.role?"purple":"blue",children:"admin"===e.role?"Admin":"Editor"})}),(0,G.jsx)(R.Td,{children:(0,G.jsx)(r.E,{colorScheme:e.isActive?"green":"red",children:e.isActive?"Aktivn\xed":"Neaktivn\xed"})}),(0,G.jsx)(R.Td,{children:new Date(e.createdAt).toLocaleDateString()}),(0,G.jsx)(R.Td,{children:(0,G.jsxs)(x.W,{children:[(0,G.jsx)(g.I,{as:c.K,"aria-label":"Options",icon:(0,G.jsx)(K.R,{}),size:"sm",variant:"ghost"}),(0,G.jsxs)(j.c,{children:[(0,G.jsx)(v.D,{icon:(0,G.jsx)(q.q,{}),onClick:()=>ke(e),children:"Upravit"}),(0,G.jsx)(v.D,{onClick:async()=>{try{await V.Ay.post("/admin/users/".concat(e.id,"/reset-password")),se({title:"Hotovo",description:"Instrukce pro obnoven\xed hesla byly odesl\xe1ny.",status:"success"})}catch(s){var t,n,a,i,o,r;const e=(null===s||void 0===s||null===(t=s.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.message)||(null===s||void 0===s||null===(a=s.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||(null===s||void 0===s?void 0:s.message)||"Nelze odeslat reset hesla",l=null===s||void 0===s||null===(o=s.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.details;se({title:"Chyba p\u0159i odes\xedl\xe1n\xed resetu hesla",description:l?"".concat(e,"\n\n").concat(l):e,status:"error",duration:1e4,isClosable:!0})}},children:"Odeslat reset hesla"}),"admin"!==e.role&&String(null===de||void 0===de?void 0:de.id)!==String(e.id)&&(0,G.jsx)(v.D,{icon:(0,G.jsx)(O.d,{}),color:"red.500",onClick:()=>ye(e.id),children:"Smazat"})]})]})})]},e.id))})]})}),(0,G.jsx)(L.D,{size:"md",mb:2,children:"Fanou\u0161ci"}),(0,G.jsx)(s.a,{bg:le,borderRadius:"md",boxShadow:"sm",overflowX:"auto",children:(0,G.jsxs)(D.X,{variant:"simple",children:[(0,G.jsx)(P.d,{children:(0,G.jsxs)(I.Tr,{children:[(0,G.jsx)(F.Th,{children:"Jm\xe9no"}),(0,G.jsx)(F.Th,{children:"E\u2011mail"}),(0,G.jsx)(F.Th,{children:"Role"}),(0,G.jsx)(F.Th,{children:"Stav"}),(0,G.jsx)(F.Th,{children:"Vytvo\u0159eno"}),(0,G.jsx)(F.Th,{children:"Akce"})]})}),(0,G.jsx)(N.N,{children:e.filter(e=>"fan"===e.role).map(e=>(0,G.jsxs)(I.Tr,{children:[(0,G.jsx)(R.Td,{children:e.name}),(0,G.jsx)(R.Td,{children:e.email}),(0,G.jsx)(R.Td,{children:(0,G.jsx)(r.E,{colorScheme:"gray",children:"Fanou\u0161ek"})}),(0,G.jsx)(R.Td,{children:(0,G.jsx)(r.E,{colorScheme:e.isActive?"green":"red",children:e.isActive?"Aktivn\xed":"Neaktivn\xed"})}),(0,G.jsx)(R.Td,{children:new Date(e.createdAt).toLocaleDateString()}),(0,G.jsx)(R.Td,{children:(0,G.jsxs)(x.W,{children:[(0,G.jsx)(g.I,{as:c.K,"aria-label":"Options",icon:(0,G.jsx)(K.R,{}),size:"sm",variant:"ghost"}),(0,G.jsxs)(j.c,{children:[(0,G.jsx)(v.D,{icon:(0,G.jsx)(q.q,{}),onClick:()=>ke(e),children:"Upravit"}),String(null===de||void 0===de?void 0:de.id)!==String(e.id)&&(0,G.jsx)(v.D,{icon:(0,G.jsx)(O.d,{}),color:"red.500",onClick:()=>ye(e.id),children:"Smazat"})]})]})})]},e.id))})]})}),(0,G.jsxs)(w.aF,{isOpen:ee,onClose:ne,size:"lg",children:[(0,G.jsx)(_.m,{}),(0,G.jsxs)(z.$,{as:"form",onSubmit:async e=>{e.preventDefault(),Q(!0);try{if(ae){const e={name:oe.name,email:oe.email,role:oe.role,isActive:oe.isActive};if("admin"===ae.role){if(!oe.currentPassword)throw new Error("Pro \xfapravu administr\xe1torsk\xe9ho \xfa\u010dtu zadejte pros\xedm sou\u010dasn\xe9 heslo.");e.current_password=oe.currentPassword}await V.Ay.put("/admin/users/".concat(ae.id),e),se({title:"Hotovo",description:"U\u017eivatel aktualizov\xe1n",status:"success",duration:3e3,isClosable:!0})}else await V.Ay.post("/admin/users",oe),se({title:"Hotovo",description:"U\u017eivatel vytvo\u0159en",status:"success",duration:3e3,isClosable:!0});ne(),je(),fe()}catch(o){var t,n,a,i;console.error("Error saving user:",o),se({title:"Chyba",description:(null===(t=o.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===(a=o.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message)||"Nepoda\u0159ilo se ulo\u017eit u\u017eivatele",status:"error",duration:5e3,isClosable:!0})}finally{Q(!1)}},children:[(0,G.jsx)(k.r,{children:ae?"Upravit u\u017eivatele":"P\u0159idat u\u017eivatele"}),(0,G.jsx)(y.s,{}),(0,G.jsx)(b.c,{pb:6,children:(0,G.jsxs)(E.T,{spacing:4,children:[(0,G.jsxs)(h.MJ,{isRequired:!0,children:[(0,G.jsx)(m.l,{children:"Jm\xe9no a p\u0159\xedjmen\xed"}),(0,G.jsx)(p.p,{name:"name",value:oe.name,onChange:be,placeholder:"Zadejte jm\xe9no a p\u0159\xedjmen\xed"})]}),(0,G.jsxs)(h.MJ,{isRequired:!0,children:[(0,G.jsx)(m.l,{children:"E\u2011mail"}),(0,G.jsx)(p.p,{type:"email",name:"email",value:oe.email,onChange:be,placeholder:"Zadejte e\u2011mail"})]}),!ae&&(0,G.jsxs)(h.MJ,{isRequired:!ae,children:[(0,G.jsxs)(m.l,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,G.jsx)(s.a,{children:"Heslo"}),(0,G.jsx)(J.II,{})]}),(0,G.jsx)(p.p,{type:"password",name:"password",value:oe.password,onChange:be,placeholder:"Zadejte heslo",minLength:8}),(0,G.jsx)(h.eK,{children:"Heslo mus\xed m\xedt alespo\u0148 8 znak\u016f"})]}),ae&&"admin"===ae.role&&(0,G.jsxs)(h.MJ,{children:[(0,G.jsx)(m.l,{children:"Sou\u010dasn\xe9 heslo (potvrzen\xed)"}),(0,G.jsx)(p.p,{type:"password",name:"currentPassword",value:oe.currentPassword,onChange:be,placeholder:"Zadejte sou\u010dasn\xe9 heslo administr\xe1tora"}),(0,G.jsx)(h.eK,{children:"Pro \xfapravu administr\xe1torsk\xe9ho \xfa\u010dtu je nutn\xe9 zadat sou\u010dasn\xe9 heslo."})]}),(0,G.jsxs)(h.MJ,{children:[(0,G.jsx)(m.l,{children:"Role"}),(0,G.jsxs)(S.l,{name:"role",value:oe.role,onChange:be,children:[(0,G.jsx)("option",{value:"fan",children:"Fanou\u0161ek"}),(0,G.jsx)("option",{value:"editor",disabled:!!ae&&"admin"===ae.role,children:"Editor"}),(0,G.jsx)("option",{value:"admin",children:"Admin"})]}),"admin"===(null===ae||void 0===ae?void 0:ae.role)&&(0,G.jsx)(h.eK,{children:"Administr\xe1torsk\xfd \xfa\u010det nelze degradovat na editora p\u0159es tuto obrazovku."})]}),"editor"===oe.role&&(0,G.jsxs)(s.a,{w:"100%",borderWidth:"1px",borderRadius:"md",borderColor:ce,p:3,mt:2,children:[(0,G.jsxs)(C.z,{justify:"space-between",align:"center",mb:1,children:[(0,G.jsx)(W.E,{fontSize:"sm",fontWeight:"semibold",children:"P\u0159\xedstup editor\u016f k administraci"}),(0,G.jsx)(J.tX,{label:"Jak funguje p\u0159\xedstup",title:"P\u0159\xedstup editor\u016f k administraci",items:["Nastaven\xed plat\xed pro v\u0161echny u\u017eivatele s rol\xed editor \u2013 ne pro jednotlivce.","Editor uvid\xed pouze ty admin str\xe1nky, kter\xe9 jsou v seznamu n\xed\u017ee povolen\xe9.","Citliv\xe9 sekce (nap\u0159. Nastaven\xed, U\u017eivatel\xe9) ponechte typicky pouze pro administr\xe1tory."]})]}),(0,G.jsxs)(W.E,{fontSize:"xs",color:"gray.500",mb:2,children:["Toto nastaven\xed plat\xed pro v\u0161echny u\u017eivatele s rol\xed ",(0,G.jsx)("strong",{children:"editor"}),". Zvolte, kter\xe9 str\xe1nky v administraci maj\xed b\xfdt editor\u016fm dostupn\xe9."]}),pe?(0,G.jsxs)(C.z,{spacing:2,children:[(0,G.jsx)(A.y,{size:"xs"}),(0,G.jsx)(W.E,{fontSize:"xs",color:"gray.500",children:"Na\u010d\xedt\xe1n\xed seznamu str\xe1nek\u2026"})]}):0===he.length?(0,G.jsxs)(W.E,{fontSize:"xs",color:"gray.500",children:["Nebyly nalezeny \u017e\xe1dn\xe9 admin str\xe1nky v navigaci. Nastavte je pros\xedm v sekci ",(0,G.jsx)("strong",{children:"Navigace"}),"."]}):(0,G.jsx)(E.T,{align:"stretch",maxH:"200px",overflowY:"auto",spacing:1,mt:1,children:he.slice().sort((e,t)=>{var n,a;return(null!==(n=e.display_order)&&void 0!==n?n:0)-(null!==(a=t.display_order)&&void 0!==a?a:0)}).map(e=>(0,G.jsx)(d.S,{isChecked:!!e.allow_editor,onChange:()=>(async e=>{if(!e.id)return;const t=!e.allow_editor;ve(e.id);try{await(0,$.ds)(e.id,{allow_editor:t}),me(n=>n.map(n=>n.id===e.id?(0,a.A)((0,a.A)({},n),{},{allow_editor:t}):n)),se({title:"Ulo\u017eeno",description:t?"Str\xe1nka byla povolena editor\u016fm.":"Str\xe1nka byla editor\u016fm zak\xe1z\xe1na.",status:"success",duration:3e3,isClosable:!0})}catch(s){var n,i,o,r;console.error("Error updating editor page access:",s),se({title:"Chyba",description:(null===s||void 0===s||null===(n=s.response)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.error)||(null===s||void 0===s||null===(o=s.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.message)||"Nepoda\u0159ilo se ulo\u017eit nastaven\xed p\u0159\xedstupu editor\u016f",status:"error",duration:5e3,isClosable:!0})}finally{ve(null)}})(e),isDisabled:ge===e.id,size:"sm",children:(0,G.jsxs)(C.z,{spacing:2,align:"center",children:[(0,G.jsx)(W.E,{fontSize:"sm",children:e.label}),e.page_type&&(0,G.jsx)(r.E,{colorScheme:"purple",fontSize:"0.6rem",children:e.page_type}),(0,G.jsx)(W.E,{fontSize:"xs",color:"gray.500",children:e.url||"\u2014"})]})},e.id))})]}),(0,G.jsxs)(h.MJ,{display:"flex",alignItems:"center",children:[(0,G.jsx)(m.l,{mb:"0",mr:2,children:"Aktivn\xed"}),(0,G.jsx)(T.d,{name:"isActive",isChecked:oe.isActive,onChange:be,colorScheme:"blue"})]})]})}),(0,G.jsxs)(f.j,{children:[(0,G.jsx)(l.$,{variant:"ghost",mr:3,onClick:ne,children:"Zru\u0161it"}),(0,G.jsx)(l.$,{colorScheme:"blue",type:"submit",isLoading:Y,loadingText:"Ukl\xe1d\xe1m...",children:ae?"Ulo\u017eit":"Vytvo\u0159it"})]})]})]})]})})}},60790:(e,t,n)=>{n.d(t,{Br:()=>g,JG:()=>h,Nw:()=>v,i:()=>x,oU:()=>m});var a=n(89379);const i="logos";let o=null;const r=()=>o||(o=new Promise((e,t)=>{const n=indexedDB.open("LogoCache",1);n.onerror=()=>t(n.error),n.onsuccess=()=>e(n.result),n.onupgradeneeded=e=>{const t=e.target.result;if(!t.objectStoreNames.contains(i)){const e=t.createObjectStore(i,{keyPath:"id"});e.createIndex("lastUsed","lastUsed",{unique:!1}),e.createIndex("source","source",{unique:!1})}}}),o),s=async e=>{try{const t=await r(),n=t.transaction(i,"readonly").objectStore(i);return new Promise(t=>{const a=n.get(e);a.onsuccess=()=>{const e=a.result;if(!e)return void t(null);Date.now()-e.timestamp>6048e5?t(null):t(e)},a.onerror=()=>t(null)})}catch(t){return null}},l=async e=>{try{const t=(await r()).transaction(i,"readwrite");t.objectStore(i).put(e),await new Promise((e,n)=>{t.oncomplete=()=>e(),t.onerror=()=>n(t.error)})}catch(t){console.warn("Failed to cache logo:",t)}},c=async e=>{try{const t=await s(e);t&&(t.lastUsed=Date.now(),await l(t))}catch(t){}};let d={failures:0,lastFailureTime:0,isOpen:!1,maxFailures:5,resetTimeout:6e4};const u=()=>{d.failures++,d.lastFailureTime=Date.now(),d.failures>=d.maxFailures&&(d.isOpen=!0,console.warn("Logo API circuit breaker opened due to repeated failures"))},h=async(e,t)=>{if((()=>{const e=Date.now();return d.isOpen&&e-d.lastFailureTime>d.resetTimeout?(d.isOpen=!1,d.failures=0,!1):d.isOpen})())return console.warn("Logo API circuit breaker is open, skipping request for team ".concat(e)),null;try{const t=await s(e);if(null!==t&&void 0!==t&&t.url&&!t.url.startsWith("blob:"))return await c(e),t.url;const n=new AbortController,a=setTimeout(()=>n.abort(),5e3),i=await fetch("https://logoapi.sportcreative.eu/logos/".concat(e,"/json"),{method:"GET",headers:{Accept:"application/json"},signal:n.signal});if(clearTimeout(a),!i.ok)return u(),null;const o=await i.json(),r=o.logo_url_svg||o.logo_url_png||o.logo_url;return r?(await l({id:e,url:r,timestamp:Date.now(),source:"logoapi",lastUsed:Date.now()}),d.failures>0&&(d.failures=Math.max(0,d.failures-1)),r):(u(),null)}catch(n){return u(),console.warn("Failed to fetch logo for team ".concat(e,":"),n),null}},m=async e=>{try{const t=await fetch("https://logoapi.sportcreative.eu/logos/".concat(e,"/json"),{method:"GET",headers:{Accept:"application/json"}});if(!t.ok)return null;const n=await t.json(),a=n.logo_url_svg||n.logo_url_png||n.logo_url,i=n.club_name;return a||i?(a&&await l({id:e,url:a,timestamp:Date.now(),source:"logoapi",lastUsed:Date.now()}),{clubName:i||void 0,logoUrl:a||void 0}):null}catch(t){return console.warn("Failed to fetch club info for team ".concat(e,":"),t),null}};let p={totalRequests:0,successfulRequests:0,failedRequests:0,lastResetTime:Date.now(),windowMs:6e4};const x=()=>{const e=Date.now();return e-p.lastResetTime>p.windowMs&&(p={totalRequests:0,successfulRequests:0,failedRequests:0,lastResetTime:e,windowMs:p.windowMs}),(0,a.A)({},p)},g=async e=>{if(!e.length)return{};const t=x();if(t.totalRequests>200)return console.warn("Request volume too high (".concat(t.totalRequests,"/min). Skipping batch logo fetch.")),{};try{const t={};for(let n=0;n<e.length;n+=10){const a=e.slice(n,n+10).map(async e=>{const t=await s(e);if(null!==t&&void 0!==t&&t.url&&!t.url.startsWith("blob:"))return await c(e),{id:e,url:t.url,cached:!0};const n=await h(e);var a;return a=!!n,p.totalRequests++,a?p.successfulRequests++:p.failedRequests++,p.totalRequests>100&&console.warn("High logo API request volume detected: ".concat(p.totalRequests," requests in last minute")),{id:e,url:n,cached:!1}});(await Promise.all(a)).forEach(e=>{let{id:n,url:a,cached:i}=e;a&&(t[n]=a)}),n+10<e.length&&await new Promise(e=>setTimeout(e,100))}return t}catch(n){return console.error("Error in batchFetchLogosFromSportLogosAPI (logoapi.sportcreative.eu):",n),{}}},v=async(e,t,n)=>{if(e){const n=await h(e,t);if(n)return n}if(n)return n.includes("fotbal.cz")||n.includes("is1.fotbal.cz")||n.startsWith("/uploads/logos/facr/"),n;if(e){return"https://is1.fotbal.cz/media/kluby/".concat(e,"/").concat(e,"_crop.jpg")}return"/logo192.png"}},61269:(e,t,n)=>{n.d(t,{A:()=>N});var a=n(89379),i=n(65043),o=n(27024),r=n(87139),s=n(22107),l=n(98662),c=n(42703),d=n(44093),u=n(7189),h=n(76659),m=n(96148),p=n(10202),x=n(19077),g=n(99956),v=n(28846),j=n(39081),b=n(59781),y=n(12836),f=n(11100),k=n(23857),_=n(29066),w=n(65505),z=n(35746),S=n(9855),A=n(76833),C=n(35475),E=n(74117),T=n(70579);const D=e=>{const{i18n:t}=(0,E.Bd)(),n="en"===t.language;if(!e)return n?"Anonymous":"Anonym";const a=(e.username||"").trim();if(a)return a;return"".concat(e.first_name||""," ").concat(e.last_name||"").trim()||(n?"User":"U\u017eivatel")},N=e=>{var t;let{targetType:n,targetId:N}=e;const{t:R,i18n:F}=(0,E.Bd)(),P=(0,d.dU)("white","gray.800"),I=(0,d.dU)("gray.200","gray.700"),M=(0,d.dU)("gray.600","gray.400"),L=(0,d.dU)("gray.50","gray.700"),W=(0,d.dU)("blue.600","blue.300"),U=(0,b.jE)(),{isAuthenticated:O,user:q}=(0,_.A)(),K="en"===F.language,B=(0,f.q)({queryKey:["comments",n,N],queryFn:e=>{let{pageParam:t=1}=e;return(0,k.fg)({target_type:n,target_id:N,page:t,page_size:20})},getNextPageParam:(e,t)=>t.reduce((e,t)=>{var n;return e+((null===(n=t.items)||void 0===n?void 0:n.length)||0)},0)<e.total?t.length+1:void 0,staleTime:3e4}),Z=((null===(t=B.data)||void 0===t?void 0:t.pages)||[]).flatMap(e=>e.items||[]),[V,H]=i.useState(""),[$,J]=i.useState(null),[G,X]=i.useState(""),[Y,Q]=i.useState(null),[ee,te]=i.useState(null),[ne,ae]=i.useState(!1),[ie,oe]=i.useState("Please unblock my comments. Thank you."),[re,se]=i.useState({}),[le,ce]=i.useState(new Set),de=(0,y.n)({mutationFn:e=>(0,k.eT)({target_type:n,target_id:N,content:e.content,parent_id:e.parent_id}),onSuccess:async e=>{H(""),Q(null),te(null),await U.invalidateQueries({queryKey:["comments",n,N]}),"hidden"===(null===e||void 0===e?void 0:e.status)&&te(K?"Your comment is awaiting approval (automatic moderation).":"V\xe1\u0161 koment\xe1\u0159 \u010dek\xe1 na schv\xe1len\xed (automatick\xe1 moderace).");try{window.dispatchEvent(new CustomEvent("engagement:refresh"))}catch(t){}},onError:e=>{var t,n,a;const i=(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(K?"Failed to post comment":"Nepoda\u0159ilo se odeslat koment\xe1\u0159");te(i),403===((null===e||void 0===e||null===(a=e.response)||void 0===a?void 0:a.status)||0)&&ae(!0)}}),ue=(0,y.n)({mutationFn:e=>(0,k.vv)(e.id,{content:e.content}),onSuccess:async()=>{J(null),X(""),await U.invalidateQueries({queryKey:["comments",n,N]})}}),he=(0,y.n)({mutationFn:e=>(0,k.Tu)(e),onSuccess:async()=>{await U.invalidateQueries({queryKey:["comments",n,N]})}}),me=(0,y.n)({mutationFn:e=>(0,k.Jm)(e.id,e.type),onMutate:async e=>{let{id:t,type:i}=e;ce(e=>new Set(e).add(t));const o=["comments",n,N];await U.cancelQueries({queryKey:o});const r=U.getQueryData(o);return se(e=>(0,a.A)((0,a.A)({},e),{},{[t]:i})),U.setQueryData(o,e=>{if(!e)return e;const n=(e.pages||[]).map(e=>{const n=(e.items||[]).map(e=>{var n;if(e.id!==t)return e;const o=(0,a.A)((0,a.A)({},e),{},{reactions:(0,a.A)({},e.reactions||{})}),r=null===(n=o.my_reaction)||void 0===n?void 0:n.trim();if(r&&r!==i){const e="number"===typeof o.reactions[r]?o.reactions[r]:1,t=Math.max(0,e-1);t<=0?delete o.reactions[r]:o.reactions[r]=t}return o.reactions[i]=(o.reactions[i]||0)+1,o.my_reaction=i,"admin"===(null===q||void 0===q?void 0:q.role)&&(o.admin_liked="thumbs_up"===i||"like"===i),o});return(0,a.A)((0,a.A)({},e),{},{items:n})});return(0,a.A)((0,a.A)({},e),{},{pages:n})}),{previous:r}},onError:(e,t,a)=>{const i=["comments",n,N];null!==a&&void 0!==a&&a.previous&&U.setQueryData(i,a.previous)},onSettled:async(e,t,i)=>{null!==i&&void 0!==i&&i.id&&ce(e=>{const t=new Set(e);return t.delete(i.id),t}),setTimeout(()=>{se(e=>{const t=(0,a.A)({},e);return delete t[null===i||void 0===i?void 0:i.id],t})},100),await U.invalidateQueries({queryKey:["comments",n,N]});try{window.dispatchEvent(new CustomEvent("engagement:refresh"))}catch(o){}}}),pe=(0,y.n)({mutationFn:e=>(0,k.EA)(e),onMutate:async e=>{ce(t=>new Set(t).add(e));const t=["comments",n,N];await U.cancelQueries({queryKey:t});const i=U.getQueryData(t);return se(t=>(0,a.A)((0,a.A)({},t),{},{[e]:""})),U.setQueryData(t,t=>{if(!t)return t;const n=(t.pages||[]).map(t=>{const n=(t.items||[]).map(t=>{var n;if(t.id!==e)return t;const i=(0,a.A)((0,a.A)({},t),{},{reactions:(0,a.A)({},t.reactions||{})}),o=null===(n=i.my_reaction)||void 0===n?void 0:n.trim();if(o){const e="number"===typeof i.reactions[o]?i.reactions[o]:1,t=Math.max(0,e-1);t<=0?delete i.reactions[o]:i.reactions[o]=t}return i.my_reaction="","admin"===(null===q||void 0===q?void 0:q.role)&&(i.admin_liked=!1),i});return(0,a.A)((0,a.A)({},t),{},{items:n})});return(0,a.A)((0,a.A)({},t),{},{pages:n})}),{previous:i}},onError:(e,t,a)=>{const i=["comments",n,N];null!==a&&void 0!==a&&a.previous&&U.setQueryData(i,a.previous)},onSettled:async(e,t,i)=>{i&&ce(e=>{const t=new Set(e);return t.delete(i),t}),setTimeout(()=>{se(e=>{const t=(0,a.A)({},e);return delete t[i],t})},100),await U.invalidateQueries({queryKey:["comments",n,N]});try{window.dispatchEvent(new CustomEvent("engagement:refresh"))}catch(o){}}}),xe=(0,y.n)({mutationFn:e=>(0,k.Wj)(e),onSuccess:()=>{ae(!1),te(K?"Unban request sent.":"\u017d\xe1dost o odblokov\xe1n\xed odesl\xe1na."),oe(K?"Please unblock my comments. Thank you.":"Pros\xedm o odblokov\xe1n\xed koment\xe1\u0159\u016f. D\u011bkuji.")}}),ge=(0,y.n)({mutationFn:e=>(0,k.eG)(e.id,e.reason),onSuccess:async()=>{te(K?"Thank you for reporting. A moderator will review the comment.":"D\u011bkujeme za nahl\xe1\u0161en\xed. Moder\xe1tor se na koment\xe1\u0159 pod\xedv\xe1.")}}),ve=e=>{var t;return!!q&&("admin"===q.role||Number(q.id)===Number(null===(t=e.user)||void 0===t?void 0:t.id))},je=i.useMemo(()=>{const e={};for(const t of Z){const n=String(t.parent_id||0);(e[n]=e[n]||[]).push(t)}return e},[Z]),be=e=>{let{c:t}=e;const n=[{key:"thumbs_up",label:"\ud83d\udc4d",color:"green",name:K?"Thumbs up":"Palec nahoru"},{key:"heart",label:"\u2764\ufe0f",color:"pink",name:K?"Heart":"Srd\xed\u010dko"},{key:"smile",label:"\ud83d\ude00",color:"yellow",name:K?"Smile":"\xdasm\u011bv"},{key:"surprised",label:"\ud83d\ude2e",color:"purple",name:K?"Surprised":"P\u0159ekvapen\xed"},{key:"thumbs_down",label:"\ud83d\udc4e",color:"red",name:K?"Thumbs down":"Palec dol\u016f"}],o=t.reactions||{},r=i.useMemo(()=>{const e=(re[t.id]||"").trim();return""!==e?e:(t.my_reaction||"").trim()},[t.my_reaction,re,t.id]),s=i.useMemo(()=>{const e=(0,a.A)({},o),n=((r||"").trim(),(t.my_reaction||"").trim()),i=(re[t.id]||"").trim();if(""!==i&&i!==n){if(n){const t="number"===typeof e[n]?e[n]:0;t>0&&(e[n]=t-1,e[n]<=0&&delete e[n])}e[i]=(e[i]||0)+1}else if(""===i&&n){const t="number"===typeof e[n]?e[n]:0;t>0&&(e[n]=t-1,e[n]<=0&&delete e[n])}return e},[o,r,t.my_reaction,re,t.id]),c=me.isPending||pe.isPending||le.has(t.id);return(0,T.jsx)(m.z,{spacing:2,mt:1,children:n.map(e=>(0,T.jsx)(g.m,{label:e.name,placement:"top",hasArrow:!0,children:(0,T.jsx)(l.$,{size:"xs",colorScheme:e.color,variant:r===e.key?"solid":"outline",isDisabled:!O||c,isActive:r===e.key,onClick:()=>{O&&!c&&(r===e.key?pe.mutate(t.id):me.mutate({id:t.id,type:e.key}))},children:(0,T.jsxs)(m.z,{spacing:1,children:[(0,T.jsx)(j.E,{as:"span",children:e.label}),(0,T.jsx)(j.E,{as:"span",fontSize:"xs",children:s[e.key]||0})]})})},e.key))})},ye=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=je[String(e||0)]||[];return(0,T.jsx)(p.T,{align:"stretch",spacing:3,pl:t?6:0,children:n.map(e=>{var n,a;return(0,T.jsxs)(m.z,{align:"start",spacing:3,borderWidth:"1px",borderColor:I,borderRadius:"md",p:3,children:[(0,T.jsx)(o.e,{name:D(e.user),size:"sm",src:(null===e||void 0===e||null===(n=e.user)||void 0===n?void 0:n.avatar_url)||void 0}),(0,T.jsxs)(p.T,{align:"stretch",spacing:1,flex:1,children:[(0,T.jsxs)(m.z,{justify:"space-between",children:[(0,T.jsxs)(m.z,{spacing:2,children:[(0,T.jsx)(j.E,{fontWeight:"600",children:D(e.user)}),"admin"===(null===(a=e.user)||void 0===a?void 0:a.role)&&(0,T.jsx)(r.E,{colorScheme:"purple",variant:"subtle",children:"Admin"}),(0,T.jsx)(j.E,{fontSize:"sm",color:M,children:new Date(e.created_at).toLocaleString()}),e.is_edited&&(0,T.jsxs)(j.E,{fontSize:"xs",color:M,children:["(",K?"(edited)":"(upraveno)",")"]})]}),ve(e)&&(0,T.jsxs)(m.z,{spacing:1,children:[(0,T.jsx)(c.K,{"aria-label":K?"Edit":"Upravit",size:"xs",variant:"ghost",icon:(0,T.jsx)(w.A,{size:16}),onClick:()=>{J(e.id),X(e.content)}}),(0,T.jsx)(c.K,{"aria-label":K?"Delete":"Smazat",size:"xs",variant:"ghost",colorScheme:"red",icon:(0,T.jsx)(S.A,{size:16}),onClick:()=>he.mutate(e.id)})]})]}),$===e.id?(0,T.jsxs)(p.T,{align:"stretch",spacing:2,children:[(0,T.jsx)(x.T,{value:G,onChange:e=>X(e.target.value),rows:3}),(0,T.jsxs)(m.z,{children:[(0,T.jsx)(l.$,{size:"sm",colorScheme:"blue",onClick:()=>ue.mutate({id:e.id,content:G.trim()}),isLoading:ue.isPending,children:K?"Save":"Ulo\u017eit"}),(0,T.jsx)(l.$,{size:"sm",variant:"ghost",onClick:()=>{J(null),X("")},children:K?"Cancel":"Zru\u0161it"})]})]}):e.content_html?(0,T.jsx)(s.a,{sx:{".cw":{textDecoration:"underline dotted",cursor:"help"}},dangerouslySetInnerHTML:{__html:e.content_html}}):(0,T.jsx)(j.E,{whiteSpace:"pre-wrap",children:e.content}),(0,T.jsx)(be,{c:e}),e.admin_liked&&(0,T.jsxs)(m.z,{spacing:2,mt:1,color:W,children:[(0,T.jsx)(A.A,{size:16}),(0,T.jsx)(j.E,{fontSize:"sm",children:K?"Marked by administrator":"Ozna\u010deno administr\xe1torem"})]}),(0,T.jsxs)(m.z,{children:[O&&(0,T.jsx)(l.$,{size:"xs",variant:"ghost",onClick:()=>Q(e.id),children:K?"Reply":"Odpov\u011bd\u011bt"}),O&&(0,T.jsx)(l.$,{size:"xs",variant:"ghost",colorScheme:"red",onClick:()=>ge.mutate({id:e.id}),children:K?"Report":"Nahl\xe1sit"}),"hidden"===e.status&&(0,T.jsx)(r.E,{colorScheme:"yellow",children:K?"Awaiting approval":"\u010cek\xe1 na schv\xe1len\xed"})]}),ye(e.id,t+1)]})]},e.id)})})};return(0,T.jsxs)(s.a,{mt:6,borderWidth:"1px",borderColor:I,borderRadius:"lg",bg:P,p:4,children:[(0,T.jsx)(m.z,{justify:"space-between",align:"center",mb:3,children:(0,T.jsx)(v.D,{as:"h3",size:"md",children:K?"Comments":"Koment\xe1\u0159e"})}),B.isLoading?(0,T.jsxs)(m.z,{children:[(0,T.jsx)(h.y,{size:"sm"}),(0,T.jsx)(j.E,{children:K?"Loading...":"Na\u010d\xedt\xe1m\u2026"})]}):(0,T.jsxs)(p.T,{align:"stretch",spacing:3,children:[0===Z.length&&(0,T.jsx)(j.E,{color:M,children:K?"No comments yet.":"Zat\xedm \u017e\xe1dn\xe9 koment\xe1\u0159e."}),ye(null),B.hasNextPage&&(0,T.jsx)(l.$,{onClick:()=>B.fetchNextPage(),isLoading:B.isFetchingNextPage,alignSelf:"center",size:"sm",variant:"outline",children:K?"Load more":"Na\u010d\xedst dal\u0161\xed"})]}),(0,T.jsxs)(s.a,{mt:4,children:[ee&&(0,T.jsx)(j.E,{color:"orange.500",fontSize:"sm",mb:2,children:ee}),O?(0,T.jsxs)(p.T,{align:"stretch",spacing:2,children:[Y&&(0,T.jsxs)(m.z,{justify:"space-between",children:[(0,T.jsx)(j.E,{fontSize:"sm",color:M,children:K?"Reply to comment #".concat(Y):"Odpov\u011b\u010f na koment\xe1\u0159 #".concat(Y)}),(0,T.jsx)(l.$,{size:"xs",variant:"ghost",onClick:()=>Q(null),children:K?"Cancel reply":"Zru\u0161it odpov\u011b\u010f"})]}),(0,T.jsx)(x.T,{placeholder:K?"Write a comment...":"Napi\u0161te koment\xe1\u0159\u2026",value:V,onChange:e=>H(e.target.value),rows:3}),(0,T.jsxs)(m.z,{children:[(0,T.jsx)(l.$,{leftIcon:(0,T.jsx)(z.A,{size:16}),colorScheme:"blue",onClick:()=>de.mutate({content:V.trim(),parent_id:Y}),isLoading:de.isPending,isDisabled:V.trim().length<6,children:K?"Send":"Odeslat"}),(0,T.jsx)(j.E,{fontSize:"sm",color:M,children:K?"Please respect the rules of decent discussion.":"Respektujte pros\xedm pravidla slu\u0161n\xe9 diskuse."})]}),ne&&(0,T.jsxs)(p.T,{align:"stretch",spacing:2,borderWidth:"1px",borderColor:I,borderRadius:"md",p:3,bg:L,children:[(0,T.jsx)(j.E,{fontSize:"sm",color:M,children:K?"Your account is temporarily blocked from commenting. You can send an unban request with a brief explanation.":"V\xe1\u0161 \xfa\u010det je do\u010dasn\u011b zablokov\xe1n pro komentov\xe1n\xed. M\u016f\u017eete odeslat \u017e\xe1dost o odblokov\xe1n\xed s kr\xe1tk\xfdm vysv\u011btlen\xedm."}),(0,T.jsx)(x.T,{placeholder:K?"Your message for administrators...":"Va\u0161e zpr\xe1va pro administr\xe1tory\u2026",value:ie,onChange:e=>oe(e.target.value),rows:3}),(0,T.jsx)(m.z,{children:(0,T.jsx)(l.$,{size:"sm",variant:"outline",onClick:()=>xe.mutate(ie.trim()||(K?"Please unblock my comments. Thank you.":"Pros\xedm o odblokov\xe1n\xed koment\xe1\u0159\u016f. D\u011bkuji.")),isLoading:xe.isPending,children:K?"Send unban request":"Odeslat \u017e\xe1dost o odblokov\xe1n\xed"})})]})]}):(0,T.jsxs)(j.E,{color:M,children:[K?"To add a comment, please ":"Pro p\u0159id\xe1n\xed koment\xe1\u0159e se pros\xedm ",(0,T.jsx)(u.N,{as:C.N_,to:"/login",color:"blue.500",children:K?"log in":"p\u0159ihlaste"}),"."]})]})]})}},62527:(e,t,n)=>{n.r(t),n.d(t,{default:()=>X});var a=n(65043),i=n(30502),o=n(44093),r=n(22107),s=n(10202),l=n(28846),c=n(39081),d=n(88787),u=n(85871),h=n(73212),m=n(73225),p=n(76668),x=n(35699),g=n(96148),v=n(45973),j=n(29244),b=n(98662),y=n(76659),f=n(47781),k=n(33572),_=n(82459),w=n(34946),z=n(99956),S=n(87139),A=n(17401),C=n(73216),E=n(22210),T=n(46291);const D=async()=>(await T.Ay.get("/rembg/status",{timeout:2e4})).data;var N=n(18786),R=n(25189),F=n(41172),P=n(30458),I=n(71860),M=n(49483),L=n(74138),W=n(74117),U=n(60790),O=n(2367),q=n(82846),K=n(75780),B=n(91765),Z=n(33192),V=n(52976),H=n(70579);const $=e=>{let{value:t,onChange:n,recentStorageKey:i}=e;const s=(0,o.dU)("gray.200","gray.700"),l=(0,o.dU)("white","gray.800"),[c,d]=(0,a.useState)(t||"#000000");return(0,a.useEffect)(()=>{d(t||"#000000")},[t]),(0,H.jsxs)(q.A,{placement:"bottom-start",closeOnBlur:!0,closeOnEsc:!0,autoFocus:!1,returnFocusOnClose:!1,children:[(0,H.jsx)(K.W,{children:(0,H.jsxs)(g.z,{spacing:2,cursor:"pointer",align:"center",children:[(0,H.jsx)(r.a,{width:"32px",height:"32px",borderRadius:"full",borderWidth:"1px",borderColor:s,bg:t||"#000000"}),(0,H.jsx)(x.p,{value:(t||"").toUpperCase(),isReadOnly:!0,size:"sm",maxW:"120px",fontFamily:"mono",bg:l})]})}),(0,H.jsx)(B.h,{w:"auto",maxW:"280px",_focus:{boxShadow:"none"},children:(0,H.jsx)(Z.e,{p:3,children:(0,H.jsx)(V.A,{value:c,onChange:e=>{d(e),n(e)},onChangeComplete:e=>{d(e),n(e)},recentStorageKey:i,compact:!0})})})]})};var J=n(57550);const G=(e,t)=>{let n=(e||"").trim();if(!n)return"";if(n=n.replace(/[\s\-.()]/g,""),n=n.replace(/^00/,"+"),n.startsWith("+"))return n;if(/^420\d{9}$/.test(n))return"+"+n;if(/^\d{9}$/.test(n)){const e=(t||"").toLowerCase();if(e.includes("\u010desk")||e.includes("czech"))return"+420"+n}return n},X=()=>{const{t:e}=(0,W.Bd)(),[t,n]=(0,a.useState)(!0),[q,K]=(0,a.useState)(!1),[B,Z]=(0,a.useState)(!1),[V,X]=(0,a.useState)(""),[Y,Q]=(0,a.useState)(""),[ee,te]=(0,a.useState)(!1),[ne,ae]=(0,a.useState)(""),[ie,oe]=(0,a.useState)(""),[re,se]=(0,a.useState)(""),[le,ce]=(0,a.useState)(""),[de,ue]=(0,a.useState)("football"),[he,me]=(0,a.useState)(""),[pe,xe]=(0,a.useState)(""),[ge,ve]=(0,a.useState)(!1),[je,be]=(0,a.useState)(""),[ye,fe]=(0,a.useState)(""),[ke,_e]=(0,a.useState)(""),{data:we}=(0,J.s)(),ze="manual"===((null===we||void 0===we?void 0:we.club_data_mode)||"").toLowerCase(),{searchClubs:Se,searchResults:Ae,searchLoading:Ce}=(0,F.E)(),Ee=e=>{if(e){if(e.includes("logoapi.sportcreative.eu"))return e;if(e.startsWith("/uploads")||e.startsWith("/dist")||e.startsWith("/api/"))return(0,R.uq)(e);if(/^https?:\/\//i.test(e)){const t=(T.API_URL||"").replace(/\/$/,"");return"".concat(t,"/proxy/image?url=").concat(encodeURIComponent(e))}return e}},[Te,De]=(0,a.useState)("#2d74da"),[Ne,Re]=(0,a.useState)("#f6f8fb"),[Fe,Pe]=(0,a.useState)("#ffb703"),[Ie,Me]=(0,a.useState)("#ffffff"),[Le,We]=(0,a.useState)("#111827"),[Ue,Oe]=(0,a.useState)("unified"),[qe,Ke]=(0,a.useState)([]),[Be,Ze]=(0,a.useState)(null),[Ve,He]=(0,a.useState)("inter-inter"),[$e,Je]=(0,a.useState)(""),[Ge,Xe]=(0,a.useState)(""),[Ye,Qe]=(0,a.useState)(""),[et,tt]=(0,a.useState)("positron"),[nt,at]=(0,a.useState)(""),[it,ot]=(0,a.useState)(""),[rt,st]=(0,a.useState)(""),[lt,ct]=(0,a.useState)("\u010cesk\xe1 republika"),[dt,ut]=(0,a.useState)(""),[ht,mt]=(0,a.useState)(""),[pt,xt]=(0,a.useState)(""),[gt,vt]=(0,a.useState)(""),[jt,bt]=(0,a.useState)(""),[yt,ft]=(0,a.useState)(""),[kt,_t]=(0,a.useState)(!1),[wt,zt]=(0,a.useState)(!1),[St,At]=(0,a.useState)(""),[Ct,Et]=(0,a.useState)(!0),[Tt,Dt]=(0,a.useState)(!1),[Nt,Rt]=(0,a.useState)(""),[Ft,Pt]=(0,a.useState)(""),[It,Mt]=(0,a.useState)(""),[Lt,Wt]=(0,a.useState)(""),[Ut,Ot]=(0,a.useState)(""),[qt,Kt]=(0,a.useState)(""),[Bt,Zt]=(0,a.useState)(!1),[Vt,Ht]=(0,a.useState)(!1),[$t,Jt]=(0,a.useState)(!1),[Gt,Xt]=(0,a.useState)(!1),[Yt,Qt]=(0,a.useState)(0),[en,tn]=(0,a.useState)(0),nn=(0,i.d)(),an=(0,C.Zp)(),on=(0,o.dU)("white","gray.800"),rn=(0,o.dU)("gray.200","gray.600"),sn=e=>(e||"").replace(/\s+/g,""),ln=e=>/^(?:[^\s@]+)@(?:[^\s@]+)\.(?:[^\s@]+)$/.test((e||"").trim());(0,a.useEffect)(()=>{let e=!0;try{(0,I.L)(),(0,I.aK)(!1)}catch(t){}return(async()=>{try{const t=await(0,E.YA)();if(!e)return;Z(!!t.requires_setup)}catch(t){Z(!1)}finally{e&&n(!1)}})(),()=>{e=!1}},[]),(0,a.useEffect)(()=>{try{const e=window.location,t=e.hostname,n=e.origin,a=/^(localhost|127\.0\.0\.1)$/i.test(t),i=/^\d{1,3}(?:\.\d{1,3}){3}$/.test(t);if(a||i){Zt(!1),Ot(n);const a="".concat(e.protocol,"//").concat(t,":8080");Kt(a.replace(/\/$/,"")+"/api/v1")}else Zt(!0),Ot(n),Kt(n.replace(/\/$/,"")+"/api/v1")}catch(e){}},[]),(0,a.useEffect)(()=>{B&&!re&&se((0,P.LI)())},[B,re]),(0,a.useEffect)(()=>{const e=ke.trim();if(!e)return;const t=setTimeout(()=>{Se(e).catch(()=>{})},300);return()=>clearTimeout(t)},[ke,Se]),(0,a.useEffect)(()=>{Bt&&!Vt&&Ut&&Kt(Ut.replace(/\/$/,"")+"/api/v1")},[Bt,Vt,Ut]),(0,a.useEffect)(()=>{const e=M.qE.find(e=>e.id===Ve);e&&(0,M.Iu)(e)},[Ve]),(0,a.useEffect)(()=>{ht&&ln(ht)&&!wt&&bt(ht)},[ht,wt]);const cn=(0,a.useMemo)(()=>Ie&&Le?(0,P.yN)(Ie,Le):null,[Ie,Le]),dn=(0,a.useMemo)(()=>Te&&Le?(0,P.yN)(Te,Le):null,[Te,Le]),un=(0,a.useMemo)(()=>null==cn||(0,P.Lv)(Ie,Le,"AA"),[cn,Ie,Le]),hn=(0,a.useMemo)(()=>{const e=Y||"",t=e.length>=8,n=/[A-Z]/.test(e),a=/[a-z]/.test(e),i=/[0-9]/.test(e),o=/[^0-9A-Za-z]/.test(e);let r=0;t&&r++,n&&a&&r++,i&&r++,o&&r++;let s="Zat\xedm \u017e\xe1dn\xe9 heslo",l="gray.500";return e?t?r<=2?(s="Slab\xe9",l="red.500"):3===r?(s="St\u0159edn\xed",l="orange.500"):(s="Siln\xe9",l="green.500"):(s="P\u0159\xedli\u0161 kr\xe1tk\xe9 (min. 8 znak\u016f)",l="red.500"):(s="Zat\xedm \u017e\xe1dn\xe9 heslo",l="gray.500"),{label:s,color:l,score:e?r:0,maxScore:4,items:[{text:"Minim\xe1ln\u011b 8 znak\u016f (povinn\xe9)",ok:t},{text:"Kombinaci mal\xfdch a velk\xfdch p\xedsmen",ok:n&&a},{text:"\u010c\xedsla",ok:i},{text:"Speci\xe1ln\xed znaky (doporu\u010deno)",ok:o}]}},[Y]);if((0,a.useEffect)(()=>{t||B||an("/login",{replace:!0})},[t,B,an]),t)return(0,H.jsx)(r.a,{p:8,children:"Na\u010d\xedt\xe1n\xed\u2026"});if(!B)return null;const mn=M.qE.find(e=>e.id===Ve),pn=(null===mn||void 0===mn?void 0:mn.cssHeading)||"inherit",xn=(null===mn||void 0===mn?void 0:mn.cssBody)||"inherit";return(0,H.jsxs)(r.a,{minH:"100vh",bg:"gray.50",display:"flex",alignItems:"center",justifyContent:"center",px:8,py:8,fontFamily:xn,children:[(0,H.jsxs)(r.a,{as:"form",onSubmit:async e=>{e.preventDefault(),K(!0);try{var t,n;const e=sn(Y);if(!/^\S{8,128}$/.test(e))return nn({title:"Neplatn\xe9 heslo",description:"Heslo mus\xed m\xedt 8\u2013128 znak\u016f a nesm\xed obsahovat mezery.",status:"error"}),void K(!1);const o=St&&jt?"".concat(St," <").concat(jt,">"):jt||void 0,r={admin_email:V,admin_password:e,first_name:ne||void 0,last_name:ie||void 0,jwt_secret:re||void 0,club_id:le||void 0,club_type:de||void 0,club_name:he||void 0,club_logo_url:pe||void 0,club_url:je||void 0,frontend_base_url:Ut||void 0,api_base_url:qt||void 0,frontpage_style:Ue||void 0,primary_color:Te||void 0,secondary_color:Ne||void 0,accent_color:Fe||void 0,background_color:Ie||void 0,text_color:Le||void 0,font_heading:(null===(t=M.qE.find(e=>e.id===Ve))||void 0===t?void 0:t.heading)||void 0,font_body:(null===(n=M.qE.find(e=>e.id===Ve))||void 0===n?void 0:n.body)||void 0,facebook_url:Nt||void 0,instagram_url:Ft||void 0,youtube_url:It||void 0,gallery_url:Lt||void 0,location_latitude:"number"===typeof Ge?Ge:void 0,location_longitude:"number"===typeof Ye?Ye:void 0,map_style:et||void 0,contact_address:nt||void 0,contact_city:it||void 0,contact_zip:rt||void 0,contact_country:lt||void 0,contact_phone:G(dt,lt)||void 0,contact_email:ht||void 0,smtp:pt||gt||jt||yt||St?{host:pt||void 0,port:"number"===typeof gt?gt:void 0,username:jt||void 0,password:yt||void 0,from:o,use_tls:Ct}:null};try{const e=(Ut||"").trim().replace(/\/$/,"");let t=(qt||"").trim();if(e||t){try{const n=new URL(t||"",e||("undefined"!==typeof window?window.location.origin:""));/\/api\//.test(n.pathname)||(n.pathname=n.pathname.replace(/\/$/,"")+"/api/v1"),t=n.toString()}catch(s){}try{localStorage.setItem("fc_frontend_base_url",e)}catch(l){}try{localStorage.setItem("fc_api_base_url",t)}catch(c){}try{localStorage.setItem("api_base_url",t)}catch(d){}}}catch(u){}await(0,E._y)(r);try{const e=("undefined"!==typeof window?window.location.origin:"").replace(/\/$/,""),t=(Ut||e||"").replace(/\/$/,"");await(0,N.g)({site_title:he||"Fotbal Club",site_description:he?"".concat(he," \u2013 ofici\xe1ln\xed klubov\xfd web: aktuality, z\xe1pasy, tabulky, hr\xe1\u010di."):"Ofici\xe1ln\xed klubov\xfd web: aktuality, z\xe1pasy, tabulky, hr\xe1\u010di.",default_og_image_url:pe||void 0,canonical_base_url:t||void 0,enable_indexing:!0})}catch(h){}nn({title:"Nastaven\xed dokon\u010deno",status:"success",duration:3e3,isClosable:!0});let f=!1;try{var a,i;const e=await(async()=>(await T.Ay.post("/rembg/start",null,{timeout:2e4})).data)().catch(()=>null);f=!!e&&(e.started||(null===(a=e.status)||void 0===a?void 0:a.running)||((null===(i=e.status)||void 0===i?void 0:i.total)||0)>0)}catch(m){}if(f){Xt(!0);try{const e=Date.now()+12e4;let t=!1;for(;Date.now()<e;){const e=await D();if(Qt((null===e||void 0===e?void 0:e.total)||0),tn((null===e||void 0===e?void 0:e.done)||0),null!==e&&void 0!==e&&e.running||((null===e||void 0===e?void 0:e.total)||0)>0||((null===e||void 0===e?void 0:e.done)||0)>0){t=!0;break}await new Promise(e=>setTimeout(e,1e3))}if(t)for(;;){const e=await D();if(Qt((null===e||void 0===e?void 0:e.total)||0),tn((null===e||void 0===e?void 0:e.done)||0),null===e||void 0===e||!e.running)break;await new Promise(e=>setTimeout(e,1200))}}catch(p){}Xt(!1)}try{const e=(Ut||"").trim().replace(/\/$/,"");let t=(qt||"").trim();if(e||t){try{const n=new URL(t||"",e||("undefined"!==typeof window?window.location.origin:""));/\/api\//.test(n.pathname)||(n.pathname=n.pathname.replace(/\/$/,"")+"/api/v1"),t=n.toString()}catch(x){}try{localStorage.setItem("fc_frontend_base_url",e)}catch(g){}try{localStorage.setItem("fc_api_base_url",t)}catch(v){}try{localStorage.setItem("api_base_url",t)}catch(j){}}}catch(b){}if(ze)try{localStorage.setItem("fc_post_setup_target","/admin/manual-data")}catch(y){}an("/login",{replace:!0}),setTimeout(()=>{try{window.location.reload()}catch(e){}},800)}catch(f){var o,r;nn({title:"Nastaven\xed selhalo",description:(null===f||void 0===f||null===(o=f.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.error)||"Zkontrolujte pros\xedm sv\xe9 \xfadaje",status:"error"})}finally{K(!1)}},w:"100%",maxW:"3xl",p:8,bg:on,borderRadius:"xl",boxShadow:"lg",borderWidth:"1px",borderColor:rn,fontFamily:xn,children:[(0,H.jsxs)(s.T,{spacing:3,mb:6,align:"stretch",children:[(0,H.jsx)(l.D,{size:"xl",fontFamily:pn,children:"\ud83d\ude80 V\xedtejte v nastaven\xed va\u0161eho webu!"}),ze&&(0,H.jsx)(c.E,{fontSize:"sm",color:"gray.600",children:"Krok 1/2 \u2013 z\xe1kladn\xed nastaven\xed klubu a administr\xe1tora. Po dokon\u010den\xed budete v dal\u0161\xedm kroku nahr\xe1vat z\xe1pasy a tabulky."}),(0,H.jsx)(c.E,{fontSize:"md",color:"gray.600",children:"Nastavte z\xe1kladn\xed informace o va\u0161em klubu. M\u016f\u017eete v\u0161e vyplnit nyn\xed, nebo n\u011bkter\xe9 \xfadaje doplnit pozd\u011bji v administraci."}),(0,H.jsxs)(d.F,{status:"info",borderRadius:"md",children:[(0,H.jsx)(u._,{}),(0,H.jsx)(r.a,{children:ze?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(c.E,{fontSize:"sm",fontWeight:"medium",children:"\ud83d\udca1 Tip: V manu\xe1ln\xedm re\u017eimu sta\u010d\xed nyn\xed nastavit klub, logo a barvy."}),(0,H.jsx)(c.E,{fontSize:"sm",children:"V dal\u0161\xedm kroku (Manu\xe1ln\xed data sout\u011b\u017e\xed) nahrajete z\xe1pasy a tabulky pomoc\xed CSV/Excel \u0161ablon."})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(c.E,{fontSize:"sm",fontWeight:"medium",children:"\ud83d\udca1 Tip: Vyhledejte v\xe1\u0161 klub v datab\xe1zi FA\u010cR"}),(0,H.jsx)(c.E,{fontSize:"sm",children:"Logo, barvy a z\xe1kladn\xed \xfadaje se dopln\xed automaticky."})]})})]})]}),(0,H.jsxs)(h.r,{columns:[1,1,2],spacing:6,children:[(0,H.jsxs)(r.a,{children:[(0,H.jsx)(l.D,{as:"h3",size:"md",mb:4,fontFamily:pn,children:"\ud83d\udd10 Administr\xe1torsk\xfd \xfa\u010det"}),(0,H.jsxs)(s.T,{align:"stretch",spacing:4,children:[(0,H.jsxs)(m.MJ,{isRequired:!0,children:[(0,H.jsx)(p.l,{children:"E\u2011mail administr\xe1tora"}),(0,H.jsx)(x.p,{type:"email",value:V,onChange:e=>X(e.target.value),placeholder:"admin@example.com"})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsxs)(p.l,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,H.jsxs)(g.z,{spacing:1,children:[(0,H.jsx)(r.a,{children:"Heslo administr\xe1tora"}),(0,H.jsx)(c.E,{as:"span",color:"red.500",children:"*"})]}),(0,H.jsx)(O.II,{})]}),(0,H.jsxs)(v.M,{children:[(0,H.jsx)(x.p,{type:ee?"text":"password",value:Y,onChange:e=>Q(sn(e.target.value)),placeholder:"Minim\xe1ln\u011b 8 znak\u016f, bez mezer",minLength:8}),(0,H.jsx)(j.t,{width:"4.5rem",children:(0,H.jsx)(b.$,{h:"1.75rem",size:"sm",onClick:()=>te(e=>!e),children:ee?"Skr\xfdt":"Zobrazit"})})]}),(0,H.jsx)(m.eK,{mt:2,children:(0,H.jsxs)(s.T,{align:"stretch",spacing:1,children:[(0,H.jsxs)(g.z,{justify:"space-between",align:"center",spacing:3,children:[(0,H.jsx)(c.E,{fontSize:"xs",color:"gray.600",children:"Bez mezer. 8\u2013128 znak\u016f. Pou\u017eijte p\xedsmena, \u010d\xedslice a speci\xe1ln\xed znaky."}),(0,H.jsx)(c.E,{as:"span",fontSize:"xs",fontWeight:"semibold",color:hn.color,whiteSpace:"nowrap",children:hn.label})]}),(0,H.jsx)(r.a,{mt:1,w:"100%",h:"6px",borderRadius:"full",bg:"gray.200",overflow:"hidden",children:(0,H.jsx)(r.a,{h:"100%",w:"".concat(hn.score/hn.maxScore*100,"%"),bg:hn.color,transition:"width 0.2s ease-out, background-color 0.2s ease-out"})})]})}),(0,H.jsxs)(g.z,{mt:2,spacing:2,children:[(0,H.jsx)(b.$,{size:"sm",variant:"outline",onClick:()=>Q((()=>{const e="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789!@#$%^&*()-_=+[]{};:,.?";let t="";for(let n=0;n<16;n++)t+=e.charAt(Math.floor(80*Math.random()));return t})()),children:"Vygenerovat siln\xe9 heslo"}),(0,H.jsx)(b.$,{size:"sm",variant:"ghost",onClick:()=>Q(""),children:"Vymazat"})]})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"Jm\xe9no"}),(0,H.jsx)(x.p,{value:ne,onChange:e=>ae(e.target.value)})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"P\u0159\xedjmen\xed"}),(0,H.jsx)(x.p,{value:ie,onChange:e=>oe(e.target.value)})]})]})]}),(0,H.jsxs)(r.a,{children:[(0,H.jsx)(l.D,{as:"h3",size:"md",mb:4,fontFamily:pn,children:"\u26bd Informace o klubu"}),(0,H.jsxs)(s.T,{align:"stretch",spacing:4,children:[!ze&&(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"Hledat klub (FA\u010cR)"}),(0,H.jsxs)(v.M,{children:[(0,H.jsx)(x.p,{value:ke,onChange:e=>_e(e.target.value),placeholder:"Hledejte podle n\xe1zvu klubu"}),(0,H.jsx)(j.t,{children:Ce?(0,H.jsx)(y.y,{size:"sm"}):null})]}),ke&&(null===Ae||void 0===Ae?void 0:Ae.length)>0&&(0,H.jsx)(r.a,{mt:2,borderWidth:"1px",borderRadius:"md",maxH:"240px",overflowY:"auto",children:(0,H.jsx)(f.B8,{spacing:0,children:Ae.filter(e=>e.name&&""!==e.name.trim()).slice(0,8).map(e=>(0,H.jsx)(f.ck,{px:3,py:2,_hover:{bg:"gray.50",cursor:"pointer"},onClick:()=>(async e=>{const t=e.club_id||"";ce(t),ue(e.club_type||"football"),me(e.name||""),be(e.url||""),_e(e.name||"");let n="",a=e.name||"";if(t)try{const e=await(0,U.oU)(t);null!==e&&void 0!==e&&e.logoUrl&&(n=e.logoUrl),null!==e&&void 0!==e&&e.clubName&&(a=e.clubName,me(e.clubName))}catch(i){}!n&&e.logo_url&&(n=e.logo_url),xe(n),!St&&a&&At(a);try{"undefined"!==typeof document&&a&&(document.title=a)}catch(o){}n&&(0,P.x_)(n,5).then(e=>{if(!e||0===e.length)return;const t=(0,P.p4)(e);Ke(t);const n=t[0];n&&(De(n.primary),Re(n.secondary),Pe(n.accent),Me(n.background),We(n.text),Ze(0))}).catch(()=>{})})(e),children:(0,H.jsxs)(g.z,{spacing:3,children:[e.logo_url?(0,H.jsx)(k._,{src:Ee(e.logo_url),alt:e.name,boxSize:"24px",objectFit:"contain"}):null,(0,H.jsxs)(r.a,{children:[(0,H.jsx)(c.E,{fontWeight:"medium",children:e.name}),(0,H.jsx)(c.E,{fontSize:"sm",color:"gray.500",children:e.club_type})]})]})},"".concat(e.club_type,"-").concat(e.club_id)))})})]}),ze&&(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"Odkaz na klub (fotbal.cz)"}),(0,H.jsx)(x.p,{value:ye,onChange:e=>{const t=e.target.value;fe(t),be(t)},onBlur:async()=>{const e=(ye||"").trim();if(!e)return;let t=e;try{/^https?:\/\//i.test(t)||(t="https://"+t);t=new URL(t).toString()}catch(i){}const n=(e=>{try{const t=/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/,n=e.match(t);if(n&&n[0])return n[0]}catch(t){}return null})(t);n&&ce(n);const a=(e=>{const t=(e||"").toLowerCase();return t.includes("/futsal")||t.includes("futsal.fotbal.cz")?"futsal":"football"})(t);if(ue(a),be(t),n)try{const e=await(0,U.oU)(n);let t=null===e||void 0===e?void 0:e.logoUrl;if(null!==e&&void 0!==e&&e.clubName&&!he){me(e.clubName),St||At(e.clubName);try{"undefined"!==typeof document&&(document.title=e.clubName)}catch(o){}}t||(t="https://is1.fotbal.cz/media/kluby/".concat(n,"/").concat(n,"_crop.jpg")),t&&(xe(t),(0,P.x_)(t,5).then(e=>{if(!e||0===e.length)return;const t=(0,P.p4)(e);Ke(t);const n=t[0];n&&(De(n.primary),Re(n.secondary),Pe(n.accent),Me(n.background),We(n.text),Ze(0))}).catch(()=>{}))}catch(r){}},placeholder:"https://www.fotbal.cz/klub/\u2026 nebo www.fotbal.cz/futsal/klub/\u2026"}),(0,H.jsx)(m.eK,{fontSize:"xs",children:"Vlo\u017ete ve\u0159ejn\xfd odkaz na v\xe1\u0161 klub z webu fotbal.cz / futsal.fotbal.cz. ID klubu a typ sportu se vypln\xed automaticky."})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"Typ klubu"}),(0,H.jsx)(x.p,{value:de,onChange:e=>ue(e.target.value),placeholder:"football nebo futsal"})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"ID klubu"}),(0,H.jsx)(x.p,{value:le,onChange:e=>ce(e.target.value),placeholder:"FA\u010cR ID klubu"})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"N\xe1zev klubu"}),(0,H.jsx)(x.p,{value:he,onChange:e=>me(e.target.value)})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"URL loga klubu"}),(0,H.jsx)(x.p,{id:"clubLogoUrlInput",value:pe,onChange:e=>xe(e.target.value)}),(0,H.jsxs)(g.z,{mt:2,spacing:3,children:[(0,H.jsxs)(b.$,{as:"label",size:"sm",leftIcon:(0,H.jsx)(A.Y,{}),children:["Nahr\xe1t logo",(0,H.jsx)(x.p,{type:"file",display:"none",accept:"image/*,image/svg+xml,application/pdf",id:"clubLogoFileInput",onChange:e=>{var t;(async t=>{if(t){ve(!0);try{const e=new FormData;e.append("file",t),e.append("preserve_quality","true");const r="".concat((T.API_URL||"").replace(/\/$/,""),"/upload"),s=await fetch(r,{method:"POST",body:e});if(!s.ok)throw new Error("Upload failed");const l=await s.json();let c=(null===l||void 0===l?void 0:l.url)||"";try{const e=new URL(c,window.location.origin);c=e.pathname+e.search+e.hash}catch(n){}if(xe(c),le)try{const e=new FormData;if(e.append("logo",t),(await fetch("https://logoapi.sportcreative.eu/logos/".concat(le),{method:"POST",body:e})).ok){nn({title:"Logo nahr\xe1no",description:"Logo bylo nahr\xe1no na logoapi i lok\xe1ln\u011b",status:"success",duration:3e3});try{const e=await(0,U.JG)(le,he||void 0);e&&xe(e)}catch(a){}}}catch(i){console.warn("Failed to upload to logoapi:",i)}try{const e=await(0,P.x_)(c,5),t=(0,P.p4)(e);Ke(t),t[0]&&(De(t[0].primary),Re(t[0].secondary),Pe(t[0].accent),Me(t[0].background),We(t[0].text),Ze(0))}catch(o){}}catch(e){nn({title:"Nahr\xe1n\xed loga selhalo",status:"error"})}finally{ve(!1)}}})((null===(t=e.target.files)||void 0===t?void 0:t[0])||null);try{e.target.value=""}catch(n){}}})]}),ge?(0,H.jsx)(c.E,{fontSize:"sm",children:"Nahr\xe1v\xe1m\u2026"}):null]})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"URL klubu"}),(0,H.jsx)(x.p,{value:je,onChange:e=>be(e.target.value)})]}),(0,H.jsxs)(r.a,{children:[(0,H.jsx)(c.E,{mb:2,children:"N\xe1hled loga"}),(0,H.jsx)(k._,{src:Ee(pe)||(0,R.uq)("/dist/img/logo-club-empty.svg"),alt:"Logo preview",maxH:"80px",objectFit:"contain"})]})]})]})]}),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(_.c,{my:6}),(0,H.jsx)(l.D,{as:"h3",size:"md",mb:2,fontFamily:pn,children:"\ud83c\udf10 Adresa webu"}),(0,H.jsx)(c.E,{fontSize:"sm",mb:3,color:"gray.600",children:"Zadejte adresu, kde bude web dostupn\xfd."}),!Bt&&(0,H.jsxs)(d.F,{status:"warning",borderRadius:"md",mb:4,children:[(0,H.jsx)(u._,{}),(0,H.jsxs)(r.a,{children:[(0,H.jsx)(c.E,{fontSize:"sm",fontWeight:"medium",children:"Doporu\u010dujeme nastavit fin\xe1ln\xed dom\xe9nu"}),(0,H.jsx)(c.E,{fontSize:"sm",children:"Aktu\xe1ln\u011b pou\u017e\xedv\xe1te localhost/IP. Nastaven\xed bez vlastn\xed dom\xe9ny nemus\xed fungovat spr\xe1vn\u011b (CORS, cookies, p\u0159ihl\xe1\u0161en\xed, galerie\u2026). Dom\xe9nu m\u016f\u017eete doplnit nyn\xed nebo kdykoli pozd\u011bji v Nastaven\xed nebo zde."})]})]}),(0,H.jsxs)(s.T,{align:"stretch",spacing:4,children:[(0,H.jsxs)(m.MJ,{isRequired:!0,children:[(0,H.jsxs)(p.l,{display:"flex",alignItems:"center",justifyContent:"space-between",sx:{".chakra-form__required-indicator":{display:"none"}},children:[(0,H.jsxs)(g.z,{spacing:1,children:[(0,H.jsx)(r.a,{children:"URL webu"}),(0,H.jsx)(c.E,{as:"span",color:"red.500",children:"*"})]}),(0,H.jsx)(O.tX,{label:"Jak vyplnit",title:"Doporu\u010den\xed pro adresu webu",items:["Pou\u017eijte fin\xe1ln\xed dom\xe9nu klubu (nap\u0159. https://www.vasklub.cz).","Nezad\xe1vejte /api \u2013 API adresa se dopln\xed automaticky.","V produkci v\u017edy pou\u017e\xedvejte zabezpe\u010den\xe9 HTTPS."]})]}),(0,H.jsx)(x.p,{placeholder:"https://www.vasklub.cz",value:Ut,onChange:e=>{const t=e.target.value;Ot(t);let n="";try{n=(/^https?:\/\//i.test(t)?new URL(t):new URL("https://"+t)).hostname}catch(o){}const a=/^(localhost|127\.0\.0\.1)$/i.test(n),i=/^\d{1,3}(?:\.\d{1,3}){3}$/.test(n);if(!!n&&!a&&!i&&(Ht(!0),!$t)){let e=(t||"").trim();e&&!/^https?:\/\//i.test(e)&&(e="https://"+e);try{const t=new URL(e);/\/api\//.test(t.pathname)||(t.pathname=t.pathname.replace(/\/$/,"")+"/api/v1"),Kt(t.toString())}catch(r){Kt(e.replace(/\/$/,"")+"/api/v1")}}}})]}),(0,H.jsx)(w.S,{isChecked:Vt,onChange:e=>Ht(e.target.checked),children:"Zadat vlastn\xed API URL"}),Vt&&(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"API URL"}),(0,H.jsx)(x.p,{placeholder:"https://api.vasklub.cz/api/v1",value:qt,onChange:e=>{Jt(!0),Kt(e.target.value)}}),(0,H.jsxs)(m.eK,{children:["V\xfdchoz\xed: ",Ut?"".concat(Ut.replace(/\/$/,""),"/api/v1"):""]})]})]})]}),(0,H.jsx)(_.c,{my:6}),(0,H.jsx)(l.D,{as:"h3",size:"md",mb:2,fontFamily:pn,children:"\ud83c\udfa8 Barvy a vzhled webu"}),(0,H.jsx)(c.E,{fontSize:"sm",mb:3,color:"gray.600",children:"Automaticky z loga (lze upravit). Vyberte jednu z p\u0159edloh nebo barvy ru\u010dn\u011b dola\u010fte."}),qe.length>0&&(0,H.jsxs)(r.a,{mb:4,children:[(0,H.jsx)(c.E,{fontWeight:"semibold",mb:2,children:"P\u0159edlohy z loga"}),(0,H.jsx)(h.r,{columns:{base:1,md:5},spacing:3,children:qe.map((e,t)=>(0,H.jsxs)(r.a,{borderWidth:Be===t?"2px":"1px",borderColor:Be===t?"blue.400":"gray.200",borderRadius:"md",p:3,cursor:"pointer",onClick:()=>(e=>{const t=qe[e];t&&(De(t.primary),Re(t.secondary),Pe(t.accent),Me(t.background),We(t.text),Ze(e))})(t),children:[(0,H.jsxs)(r.a,{mb:2,display:"flex",gap:"6px",alignItems:"center",children:[(0,H.jsx)(r.a,{flex:"1",h:"48px",borderRadius:"6px",bg:e.primary,display:"flex",alignItems:"center",justifyContent:"center",color:e.text}),(0,H.jsx)(r.a,{w:"48px",h:"48px",borderRadius:"6px",bg:e.secondary}),(0,H.jsx)(r.a,{w:"48px",h:"48px",borderRadius:"6px",bg:e.accent})]}),(0,H.jsx)(c.E,{fontSize:"sm",fontWeight:"semibold",children:e.name}),(0,H.jsx)(c.E,{fontSize:"xs",color:"gray.500",children:"Prim\xe1rn\xed / Sekund\xe1rn\xed / Akcent"})]},e.name+t))}),(0,H.jsx)(b.$,{mt:3,variant:"ghost",onClick:async()=>{const e=null===pe||void 0===pe?void 0:pe.trim();if(e)try{const t=await(0,P.x_)(e,5),n=(0,P.p4)(t);Ke(n),n[0]&&(De(n[0].primary),Re(n[0].secondary),Pe(n[0].accent),Me(n[0].background),We(n[0].text),Ze(0))}catch(t){}},children:"Znovu z loga"})]}),(0,H.jsxs)(h.r,{columns:[1,1,2],spacing:6,children:[(0,H.jsxs)(m.MJ,{children:[(0,H.jsxs)(p.l,{children:["Prim\xe1rn\xed",(0,H.jsx)(z.m,{label:"Hlavn\xed barva zna\u010dky (tla\u010d\xedtka, odkazy, zv\xfdrazn\u011bn\xed).",hasArrow:!0,children:(0,H.jsx)(A.Y,{ml:2})})]}),(0,H.jsx)($,{value:Te,onChange:e=>(0,a.startTransition)(()=>De(e)),recentStorageKey:"setup-theme"}),(0,H.jsx)(c.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Pou\u017e\xedv\xe1 se na hlavn\xedch prvc\xedch."})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsxs)(p.l,{children:["Sekund\xe1rn\xed",(0,H.jsx)(z.m,{label:"Dopl\u0148kov\xe1 barva pro m\xe9n\u011b d\u016fle\u017eit\xe9 prvky a plochy.",hasArrow:!0,children:(0,H.jsx)(A.Y,{ml:2})})]}),(0,H.jsx)($,{value:Ne,onChange:e=>(0,a.startTransition)(()=>Re(e)),recentStorageKey:"setup-theme"}),(0,H.jsx)(c.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Podp\u016frn\xe9 zv\xfdrazn\u011bn\xed."})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsxs)(p.l,{children:["Akcent",(0,H.jsx)(z.m,{label:"Kontrastn\xed barva pro odznaky, \u0161t\xedtky a mal\xe9 akce.",hasArrow:!0,children:(0,H.jsx)(A.Y,{ml:2})})]}),(0,H.jsx)($,{value:Fe,onChange:e=>(0,a.startTransition)(()=>Pe(e)),recentStorageKey:"setup-theme"}),(0,H.jsx)(c.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Men\u0161\xed prvky a upozorn\u011bn\xed."})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"Pozad\xed"}),(0,H.jsx)($,{value:Ie,onChange:e=>(0,a.startTransition)(()=>Me(e)),recentStorageKey:"setup-theme"}),(0,H.jsx)(c.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Barva ploch str\xe1nky."})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"Text"}),(0,H.jsx)($,{value:Le,onChange:e=>(0,a.startTransition)(()=>We(e)),recentStorageKey:"setup-theme"}),(0,H.jsx)(c.E,{fontSize:"xs",color:"gray.500",mt:1,children:"Z\xe1kladn\xed barva textu."})]})]}),!un&&(0,H.jsxs)(d.F,{status:"warning",mt:4,borderRadius:"md",children:[(0,H.jsx)(u._,{}),"Slab\xfd kontrast textu v\u016f\u010di pozad\xed (pom\u011br ",null===cn||void 0===cn?void 0:cn.toFixed(2),"). Pro \u010ditelnost upravte barvy nebo",(0,H.jsx)(b.$,{variant:"link",colorScheme:"blue",ml:2,onClick:()=>{if(!Ie)return;const e=(0,P.IK)(Ie);We(e)},children:"automaticky opravit barvu textu"}),"."]}),null!==dn&&dn<4.5&&(0,H.jsxs)(d.F,{status:"warning",mt:3,borderRadius:"md",children:[(0,H.jsx)(u._,{}),"Text na prim\xe1rn\xed barv\u011b m\xe1 n\xedzk\xfd kontrast (pom\u011br ",dn.toFixed(2),"). Zva\u017ete jinou barvu textu nebo prim\xe1rn\xed barvy."]}),(0,H.jsx)(_.c,{my:6}),(0,H.jsxs)(l.D,{as:"h3",size:"md",mb:2,fontFamily:pn,children:["\ud83d\udcf1 Soci\xe1ln\xed s\xedt\u011b a ",e("homepage.gallery")]}),(0,H.jsxs)(c.E,{fontSize:"sm",mb:3,color:"gray.600",children:["Zadejte odkazy na profily klubu a voliteln\u011b na ",e("homepage.gallery").toLowerCase(),". Lze pozd\u011bji upravit v administraci."]}),(0,H.jsxs)(h.r,{columns:[1,1,2],spacing:6,mb:2,children:[(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"Facebook URL"}),(0,H.jsx)(x.p,{placeholder:"https://www.facebook.com/vas.klub",value:Nt,onChange:e=>Rt(e.target.value)})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"Instagram URL"}),(0,H.jsx)(x.p,{placeholder:"https://www.instagram.com/vas.klub",value:Ft,onChange:e=>Pt(e.target.value)})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"YouTube URL"}),(0,H.jsx)(x.p,{placeholder:"https://www.youtube.com/@vas_klub",value:It,onChange:e=>Mt(e.target.value)})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsxs)(p.l,{children:["URL ",e("homepage.gallery")]}),(0,H.jsx)(x.p,{placeholder:"https://photos.example.com/club",value:Lt,onChange:e=>Wt(e.target.value)}),(0,H.jsx)(m.eK,{children:"M\u016f\u017eete pou\u017e\xedt libovoln\xfd web (SmugMug, Flickr, Google Photos, Zonerama...)."})]})]}),(0,H.jsx)(_.c,{my:6}),(0,H.jsx)(l.D,{as:"h3",size:"md",mb:2,fontFamily:pn,children:"\u270d\ufe0f P\xedsmo a typografie"}),(0,H.jsx)(c.E,{fontSize:"sm",mb:3,color:"gray.600",children:"Vyberte vzhled p\xedsma pro v\xe1\u0161 web. N\xe1hled se aplikuje okam\u017eit\u011b na celou str\xe1nku."}),(0,H.jsxs)(r.a,{mb:4,children:[(0,H.jsx)(h.r,{columns:{base:1,md:3},spacing:3,children:M.qE.map(e=>(0,H.jsx)(r.a,{borderWidth:Ve===e.id?"2px":"1px",borderColor:Ve===e.id?"blue.400":"gray.200",borderRadius:"md",p:3,cursor:"pointer",onClick:()=>He(e.id),children:(0,H.jsxs)(s.T,{align:"stretch",spacing:2,children:[(0,H.jsxs)(g.z,{justify:"space-between",children:[(0,H.jsx)(c.E,{fontSize:"sm",fontWeight:"medium",children:e.name}),(0,H.jsx)(S.E,{colorScheme:(0,M.iD)(e.style),children:e.style})]}),(0,H.jsx)(c.E,{fontFamily:e.cssHeading,fontSize:"lg",fontWeight:"bold",children:"Nadpis"}),(0,H.jsx)(c.E,{fontFamily:e.cssBody,fontSize:"sm",children:"Text b\u011b\u017en\xe9ho odstavce"})]})},e.id))}),(0,H.jsxs)(c.E,{fontSize:"xs",color:"gray.500",mt:2,children:["Zobrazeno ",M.qE.length," dostupn\xfdch styl\u016f p\xedsma."]})]}),(0,H.jsx)(_.c,{my:6}),(0,H.jsx)(l.D,{as:"h3",size:"md",mb:2,fontFamily:pn,children:"\ud83d\udccd GPS poloha a mapa"}),(0,H.jsx)(c.E,{fontSize:"sm",mb:4,color:"gray.600",children:"Nastavte polohu va\u0161eho stadionu. M\u016f\u017eete vlo\u017eit odkaz z mapy, nebo zadat sou\u0159adnice ru\u010dn\u011b. Vyberte tak\xe9 styl mapy."}),(0,H.jsx)(r.a,{mb:4,children:(0,H.jsx)(L.A,{currentLatitude:"number"===typeof Ge?Ge:void 0,currentLongitude:"number"===typeof Ye?Ye:void 0,currentZoom:15,mapStyle:et,onMapStyleChange:tt,clubPrimaryColor:Te,clubSecondaryColor:Fe,clubName:he||"V\xe1\u0161 klub",onImport:e=>{Xe(e.latitude),Qe(e.longitude),e.street?at(e.street):e.houseNumber&&e.city&&at("".concat(e.city," ").concat(e.houseNumber)),e.city&&ot(e.city),e.zip&&st(e.zip),e.country&&ct(e.country),nn({title:"Poloha importov\xe1na",description:e.city?"GPS sou\u0159adnice a adresa (".concat(e.city,") na\u010dteny"):"GPS sou\u0159adnice na\u010dteny",status:"success",duration:3e3})}})}),(0,H.jsx)(_.c,{my:6}),(0,H.jsx)(l.D,{as:"h3",size:"md",mb:2,fontFamily:pn,children:"\ud83d\udce7 Kontaktn\xed \xfadaje"}),(0,H.jsx)(c.E,{fontSize:"sm",mb:3,color:"gray.600",children:"Tyto \xfadaje se automaticky vypln\xed p\u0159i importu z mapy. M\u016f\u017eete je upravit nebo doplnit ru\u010dn\u011b."}),(0,H.jsxs)(h.r,{columns:[1,1,2],spacing:4,mb:4,children:[(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"Adresa (ulice a \u010d\xedslo)"}),(0,H.jsx)(x.p,{placeholder:"Hlavn\xed 123",value:nt,onChange:e=>at(e.target.value)})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"M\u011bsto"}),(0,H.jsx)(x.p,{placeholder:"Krnov",value:it,onChange:e=>ot(e.target.value)})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"PS\u010c"}),(0,H.jsx)(x.p,{placeholder:"794 01",value:rt,onChange:e=>st(e.target.value)})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"Zem\u011b"}),(0,H.jsx)(x.p,{placeholder:"\u010cesk\xe1 republika",value:lt,onChange:e=>ct(e.target.value)})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"Telefon"}),(0,H.jsx)(x.p,{type:"tel",placeholder:"+420 123 456 789",value:dt,onChange:e=>ut(e.target.value)}),(0,H.jsx)(m.eK,{children:"Hlavn\xed kontaktn\xed telefon klubu"})]}),(0,H.jsxs)(m.MJ,{children:[(0,H.jsx)(p.l,{children:"E-mail"}),(0,H.jsx)(x.p,{type:"email",placeholder:"kontakt@klub.cz",value:ht,onChange:e=>mt(e.target.value),onBlur:()=>{!wt&&ln(ht)&&bt(ht)}}),(0,H.jsx)(m.eK,{children:"Hlavn\xed kontaktn\xed e-mail klubu"})]})]}),(0,H.jsx)(_.c,{my:6}),(0,H.jsx)(l.D,{as:"h3",size:"md",mb:4,fontFamily:pn,children:"\ud83d\udd12 Zabezpe\u010den\xed a SMTP"}),(0,H.jsxs)(h.r,{columns:[1,1,2],spacing:6,children:[(0,H.jsxs)(m.MJ,{children:[(0,H.jsxs)(p.l,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(r.a,{children:"JWT tajemstv\xed"}),(0,H.jsx)(O.tX,{label:"Co je JWT tajemstv\xed",title:"JWT tajemstv\xed (secret key)",items:["Pou\u017e\xedv\xe1 se k podepisov\xe1n\xed p\u0159ihla\u0161ovac\xedch token\u016f (JWT).","Udr\u017eujte ho v tajnosti \u2013 nem\u011blo by se sd\xedlet ani pos\xedlat e\u2011mailem.","Pokud si nejste jisti, pou\u017eijte tla\u010d\xedtko \u201eVygenerovat bezpe\u010dn\xe9 tajemstv\xed\u201c."]})]}),(0,H.jsx)(x.p,{value:re,onChange:e=>se(e.target.value),placeholder:"Ponechte pr\xe1zdn\xe9 pro st\xe1vaj\xedc\xed hodnotu"}),(0,H.jsx)(m.eK,{children:"Tajn\xfd kl\xed\u010d pro p\u0159ihl\xe1\u0161en\xed (JWT). Nechte pr\xe1zdn\xe9 pro ponech\xe1n\xed st\xe1vaj\xedc\xed hodnoty."}),(0,H.jsx)(b.$,{mt:2,size:"sm",onClick:()=>se((0,P.LI)()),children:"Vygenerovat bezpe\u010dn\xe9 tajemstv\xed"})]}),(0,H.jsxs)(r.a,{children:[(0,H.jsxs)(m.MJ,{mb:3,children:[(0,H.jsx)(p.l,{children:"SMTP hostitel"}),(0,H.jsx)(x.p,{value:pt,onChange:e=>xt(e.target.value),placeholder:"smtp.example.com"})]}),(0,H.jsxs)(m.MJ,{mb:3,children:[(0,H.jsx)(p.l,{children:"SMTP port"}),(0,H.jsx)(x.p,{type:"number",value:gt,onChange:e=>vt(e.target.value?Number(e.target.value):""),placeholder:"587"})]}),(0,H.jsxs)(m.MJ,{mb:3,children:[(0,H.jsx)(p.l,{children:"SMTP u\u017eivatelsk\xe9 jm\xe9no"}),(0,H.jsx)(x.p,{value:jt,onChange:e=>{bt(e.target.value),zt(!0)}})]}),(0,H.jsxs)(m.MJ,{mb:3,children:[(0,H.jsx)(p.l,{children:"SMTP heslo"}),(0,H.jsxs)(v.M,{children:[(0,H.jsx)(x.p,{type:kt?"text":"password",value:yt,onChange:e=>ft(e.target.value)}),(0,H.jsx)(j.t,{width:"4.5rem",children:(0,H.jsx)(b.$,{h:"1.75rem",size:"sm",onClick:()=>_t(e=>!e),children:kt?"Skr\xfdt":"Zobrazit"})})]})]}),(0,H.jsxs)(m.MJ,{mb:3,children:[(0,H.jsx)(p.l,{children:"Jm\xe9no odes\xedlatele"}),(0,H.jsx)(x.p,{value:St,onChange:e=>At(e.target.value),placeholder:"N\xe1zev klubu (nap\u0159. Fotbal Club)"}),(0,H.jsx)(m.eK,{children:"Jako adresu pou\u017eijeme v\xe1\u0161 SMTP username (e\u2011mail). Zde vypl\u0148te pouze zobrazovan\xe9 jm\xe9no."})]}),(0,H.jsx)(w.S,{isChecked:Ct,onChange:e=>Et(e.target.checked),children:"Pou\u017e\xedt TLS"}),(0,H.jsxs)(g.z,{mt:3,spacing:3,children:[(0,H.jsx)(b.$,{size:"sm",onClick:async()=>{const e=pt.trim(),t="number"===typeof gt?gt:0;if(e&&t){Dt(!0);try{const n=St&&jt?"".concat(St," <").concat(jt,">"):St||void 0,a=await(0,E.f_)({host:e,port:t,username:jt||void 0,password:yt||void 0,from:n,use_tls:Ct});a.ok?nn({title:"SMTP ov\u011b\u0159eno",description:"P\u0159ipojen\xed a p\u0159\xedpadn\xe1 autentizace prob\u011bhly v po\u0159\xe1dku.",status:"success"}):nn({title:"SMTP selhalo",description:a.error||"Zkontrolujte pros\xedm \xfadaje (host, port, \u0161ifrov\xe1n\xed, jm\xe9no/heslo).",status:"error",duration:7e3})}catch(i){var n,a;const e=(null===i||void 0===i||null===(n=i.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.error)||(null===i||void 0===i?void 0:i.message)||"Nezn\xe1m\xe1 chyba";nn({title:"SMTP selhalo",description:e,status:"error",duration:7e3})}finally{Dt(!1)}}else nn({title:"Zadejte SMTP host a port",status:"warning"})},isLoading:Tt,children:"Otestovat SMTP"}),(0,H.jsx)(O.tX,{label:"Jak funguje test SMTP",title:"Jak funguje test SMTP",items:["Neodes\xedl\xe1 re\xe1ln\xfd e\u2011mail, pouze testuje spojen\xed se serverem a p\u0159\xedpadn\xe9 p\u0159ihl\xe1\u0161en\xed.","Pro port 465 obvykle pou\u017eijte SSL (\u0161ifrovan\xe9 spojen\xed).","Pro port 587 za\u010dn\u011bte s TLS/STARTTLS a ujist\u011bte se, \u017ee u\u017eivatelsk\xe9 jm\xe9no a heslo odpov\xeddaj\xed nastaven\xed poskytovatele."]})]}),(0,H.jsxs)(d.F,{status:"info",mt:4,borderRadius:"md",children:[(0,H.jsx)(u._,{}),(0,H.jsxs)(r.a,{children:[(0,H.jsx)(c.E,{fontWeight:"medium",children:"P\u0159ed dokon\u010den\xedm nastaven\xed otestujte SMTP p\u0159ipojen\xed."}),(0,H.jsx)(c.E,{fontSize:"sm",mt:1,children:"Nej\u010dast\u011bj\u0161\xed chyba: nespr\xe1vn\xe9 heslo. Ujist\u011bte se, \u017ee heslo je zkop\xedrov\xe1no p\u0159esn\u011b bez mezer."})]})]})]})]}),(0,H.jsx)(b.$,{type:"submit",colorScheme:"blue",mt:8,isLoading:q,loadingText:"Ukl\xe1d\xe1m\u2026",children:"Dokon\u010dit nastaven\xed"})]}),Gt&&(0,H.jsx)(r.a,{position:"fixed",top:0,left:0,right:0,bottom:0,bg:"rgba(0,0,0,0.6)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",children:(0,H.jsxs)(s.T,{spacing:3,bg:on,p:8,borderRadius:"xl",boxShadow:"xl",children:[(0,H.jsx)(y.y,{size:"xl"}),(0,H.jsx)(l.D,{size:"md",children:"P\u0159ipravuji klubov\xe1 loga"}),(0,H.jsxs)(c.E,{children:["Odstra\u0148uji pozad\xed: ",en,"/",Yt]}),(0,H.jsx)(c.E,{fontSize:"sm",color:"gray.500",children:"Pros\xedm vy\u010dkejte, dokon\u010duji p\u0159\xedpravu webu\u2026"})]})})]})}},63225:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ve});var a=n(89379),i=n(65043),o=n(96870),r=n(88787),s=n(85871),l=n(87139),c=n(22107),d=n(98662),u=n(42703),h=n(83169),m=n(24330),p=n(98939),x=n(73225),g=n(76668),v=n(73212),j=n(33572),b=n(35699),y=n(59883),f=n(86236),k=n(53560),_=n(91872),w=n(67516),z=n(35929),S=n(56529),A=n(15071),C=n(11054),E=n(78460),T=n(85421),D=n(97569),N=n(61724),R=n(76659),F=n(96148),P=n(10202),I=n(94217),M=n(94085),L=n(53332),W=n(78149),U=n(98481),O=n(80511),q=n(82595),K=n(67813),B=n(83201),Z=n(3313),V=n(55395),H=n(14566),$=n(31411),J=n(10227),G=n(51794),X=n(3109),Y=n(19077),Q=n(30502),ee=n(28846),te=n(39081),ne=n(72526),ae=n(59781),ie=n(12836),oe=n(12730),re=n(55206),se=n(58584),le=n(99973),ce=n(5874),de=n(6583),ue=n(71093),he=n(24346),me=n(35200),pe=n(6058),xe=n(461),ge=n(70579);xe.t1.register(xe.Bs,xe.m_,xe.s$,xe.PP,xe.kc,xe.FN,xe.No,xe.E8);const ve=()=>{var e,t,n,xe,ve,je;const be=(0,Q.d)(),ye=(0,ae.jE)(),{confirm:fe}=(0,me.G)(),{isOpen:ke,onOpen:_e,onClose:we}=(0,o.j)(),{isOpen:ze,onOpen:Se,onClose:Ae}=(0,o.j)(),[Ce,Ee]=(0,i.useState)(""),[Te,De]=(0,i.useState)(null),[Ne,Re]=(0,i.useState)(null),[Fe,Pe]=(0,i.useState)([]),[Ie,Me]=(0,i.useState)(!1),[Le,We]=(0,i.useState)({title:"",description:"",type:"single",style:"auto",status:"draft",allow_multiple:!1,max_choices:1,show_results:"after_vote",require_auth:!1,allow_guest_vote:!0,featured:!1,options:[{text:"",display_order:0},{text:"",display_order:1}]}),{data:Ue,isLoading:Oe}=(0,ne.I)({queryKey:["admin-polls",Ce],queryFn:()=>(0,ue.cB)(Ce?{status:Ce}:void 0)}),qe=(0,ie.n)({mutationFn:ue.Gi,onSuccess:()=>{ye.invalidateQueries({queryKey:["admin-polls"]}),be({title:"Anketa vytvo\u0159ena",status:"success",duration:3e3}),we(),Je()},onError:e=>{var t,n;be({title:"Chyba",description:(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se vytvo\u0159it anketu",status:"error",duration:5e3})}}),Ke=(0,ie.n)({mutationFn:e=>{let{id:t,data:n}=e;return(0,ue.J8)(t,n)},onSuccess:()=>{ye.invalidateQueries({queryKey:["admin-polls"]}),be({title:"Anketa aktualizov\xe1na",status:"success",duration:3e3}),we(),Je()},onError:e=>{var t,n;be({title:"Chyba",description:(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se aktualizovat anketu",status:"error",duration:5e3})}}),Be=(0,ie.n)({mutationFn:ue.pF,onSuccess:()=>{ye.invalidateQueries({queryKey:["admin-polls"]}),be({title:"Anketa smaz\xe1na",status:"success",duration:3e3})},onError:e=>{var t,n;be({title:"Chyba",description:(null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nepoda\u0159ilo se smazat anketu",status:"error",duration:5e3})}}),{data:Ze,isLoading:Ve}=(0,ne.I)({queryKey:["poll-stats",null===Ne||void 0===Ne||null===(e=Ne.poll)||void 0===e?void 0:e.id],queryFn:()=>(0,ue.jX)(Ne.poll.id),enabled:!(null===Ne||void 0===Ne||null===(t=Ne.poll)||void 0===t||!t.id)}),{data:He,isLoading:$e}=(0,ne.I)({queryKey:["poll-votes",null===Ne||void 0===Ne||null===(n=Ne.poll)||void 0===n?void 0:n.id],queryFn:()=>(0,ue.dr)(Ne.poll.id),enabled:!(null===Ne||void 0===Ne||null===(xe=Ne.poll)||void 0===xe||!xe.id)}),Je=()=>{We({title:"",description:"",type:"single",style:"auto",status:"draft",allow_multiple:!1,max_choices:1,show_results:"after_vote",require_auth:!1,allow_guest_vote:!0,featured:!1,options:[{text:"",display_order:0},{text:"",display_order:1}]}),De(null)},Ge=e=>{if("rating5"===e){const e=Array.from({length:5}).map((e,t)=>({text:String(t+1),display_order:t+1}));We({title:"Hodnocen\xed z\xe1pasu",description:"Ohodno\u0165te z\xe1pas (1 = nejhor\u0161\xed, 5 = nejlep\u0161\xed)",type:"rating",style:"rating-stars",status:"active",allow_multiple:!1,max_choices:1,show_results:"after_vote",require_auth:!1,allow_guest_vote:!0,featured:!1,options:e})}else if("rating10"===e){const e=Array.from({length:10}).map((e,t)=>({text:String(t+1),display_order:t+1}));We({title:"Hodnocen\xed z\xe1pasu (1\u201310)",description:"Ohodno\u0165te z\xe1pas (1 = nejhor\u0161\xed, 10 = nejlep\u0161\xed)",type:"rating",style:"rating-scale",status:"active",allow_multiple:!1,max_choices:1,show_results:"after_vote",require_auth:!1,allow_guest_vote:!0,featured:!1,options:e})}else"attendance"===e&&We({title:"Doraz\xed\u0161 na sch\u016fzku?",description:"Dej n\xe1m v\u011bd\u011bt, zda doraz\xed\u0161.",type:"single",style:"choices-chips",status:"active",allow_multiple:!1,max_choices:1,show_results:"after_vote",require_auth:!1,allow_guest_vote:!0,featured:!1,options:[{text:"Ano",display_order:0},{text:"Ne",display_order:1},{text:"Mo\u017en\xe1",display_order:2}]});_e()},Xe=(e,t,n)=>{const i=[...Le.options];i[e]=(0,a.A)((0,a.A)({},i[e]),{},{[t]:n}),We((0,a.A)((0,a.A)({},Le),{},{options:i}))};(0,i.useEffect)(()=>{ke&&0===Fe.length&&(Me(!0),(0,he.S)().then(e=>{null!==e&&void 0!==e&&e.videos&&Pe(e.videos)}).catch(()=>{be({title:"Chyba",description:"Nepoda\u0159ilo se na\u010d\xedst videa",status:"error",duration:3e3})}).finally(()=>{Me(!1)}))},[ke,Fe.length,be]),(0,i.useEffect)(()=>{if("rating"!==Le.type)return;const e=Le.style||"auto",t="rating-scale"===e?"rating-scale":"rating-stars",n="rating-scale"===t?10:5,i=Le.options.length===n&&Le.options.every((e,t)=>String(e.text)===String(t+1));e===t&&!Le.allow_multiple&&1===(Le.max_choices||1)&&i||We((0,a.A)((0,a.A)({},Le),{},{style:t,allow_multiple:!1,max_choices:1,options:Array.from({length:n}).map((e,t)=>({text:String(t+1),display_order:t}))}))},[Le.type,Le.style,Le.options,Le.allow_multiple,Le.max_choices]);return Oe?(0,ge.jsx)(de.A,{children:(0,ge.jsx)(p.m,{maxW:"7xl",py:8,children:(0,ge.jsxs)(P.T,{spacing:4,children:[(0,ge.jsx)(R.y,{size:"xl"}),(0,ge.jsx)(te.E,{children:"Na\u010d\xedt\xe1n\xed anket..."})]})})}):(0,ge.jsx)(de.A,{children:(0,ge.jsxs)(p.m,{maxW:"7xl",py:8,children:[(0,ge.jsxs)(P.T,{spacing:6,align:"stretch",children:[(0,ge.jsxs)(F.z,{justify:"space-between",children:[(0,ge.jsx)(ee.D,{size:"lg",children:"Spr\xe1va anket"}),(0,ge.jsxs)(F.z,{children:[(0,ge.jsxs)(y.W,{children:[(0,ge.jsx)(f.I,{as:d.$,rightIcon:(0,ge.jsx)(ce.D,{}),variant:"outline",children:"P\u0159edvolby"}),(0,ge.jsxs)(_.c,{children:[(0,ge.jsx)(k.D,{onClick:()=>Ge("rating5"),children:"Hodnocen\xed z\xe1pasu (5 hv\u011bzd)"}),(0,ge.jsx)(k.D,{onClick:()=>Ge("rating10"),children:"Hodnocen\xed z\xe1pasu (1\u201310)"}),(0,ge.jsx)(k.D,{onClick:()=>Ge("attendance"),children:"Doraz\xed\u0161 na sch\u016fzku?"})]})]}),(0,ge.jsx)(d.$,{leftIcon:(0,ge.jsx)(oe.R,{}),colorScheme:"blue",onClick:()=>{Je(),_e()},children:"Nov\xe1 anketa"})]})]}),(0,ge.jsxs)(r.F,{status:"info",children:[(0,ge.jsx)(s._,{}),(0,ge.jsxs)(c.a,{children:[(0,ge.jsx)(te.E,{fontWeight:"bold",children:"Ankety a hlasov\xe1n\xed"}),(0,ge.jsx)(te.E,{fontSize:"sm",children:"Vytvo\u0159te interaktivn\xed ankety pro fanou\u0161ky - Hr\xe1\u010d z\xe1pasu, p\u0159edpov\u011b\u010f v\xfdsledku, designov\xe9 ankety a dal\u0161\xed."})]})]}),(0,ge.jsx)(F.z,{children:(0,ge.jsxs)(N.l,{value:Ce,onChange:e=>Ee(e.target.value),maxW:"200px",children:[(0,ge.jsx)("option",{value:"",children:"V\u0161echny stavy"}),(0,ge.jsx)("option",{value:"draft",children:"Koncepty"}),(0,ge.jsx)("option",{value:"active",children:"Aktivn\xed"}),(0,ge.jsx)("option",{value:"closed",children:"Uzav\u0159en\xe9"}),(0,ge.jsx)("option",{value:"archived",children:"Archivovan\xe9"})]})}),(0,ge.jsx)(c.a,{overflowX:"auto",children:(0,ge.jsxs)(O.X,{variant:"simple",children:[(0,ge.jsx)(Z.d,{children:(0,ge.jsxs)(V.Tr,{children:[(0,ge.jsx)(B.Th,{children:"N\xe1zev"}),(0,ge.jsx)(B.Th,{children:"Typ"}),(0,ge.jsx)(B.Th,{children:"Stav"}),(0,ge.jsx)(B.Th,{children:"Po\u010det hlas\u016f"}),(0,ge.jsx)(B.Th,{children:"Vytvo\u0159eno"}),(0,ge.jsx)(B.Th,{children:"Akce"})]})}),(0,ge.jsx)(q.N,{children:null===Ue||void 0===Ue?void 0:Ue.map(e=>{return(0,ge.jsxs)(V.Tr,{opacity:"draft"===e.status?.6:1,children:[(0,ge.jsx)(K.Td,{children:(0,ge.jsxs)(P.T,{align:"start",spacing:0,children:[(0,ge.jsx)(te.E,{fontWeight:"bold",children:e.title}),e.featured&&(0,ge.jsx)(l.E,{colorScheme:"purple",children:"Zv\xfdrazn\u011bn\xe1"})]})}),(0,ge.jsx)(K.Td,{children:e.type}),(0,ge.jsx)(K.Td,{children:(t=e.status,(0,ge.jsx)(l.E,{colorScheme:{draft:"gray",active:"green",closed:"orange",archived:"red"}[t]||"gray",children:t}))}),(0,ge.jsx)(K.Td,{children:e.total_votes}),(0,ge.jsx)(K.Td,{children:new Date(e.created_at).toLocaleDateString("cs-CZ")}),(0,ge.jsx)(K.Td,{children:(0,ge.jsxs)(F.z,{spacing:2,children:[(0,ge.jsx)(u.K,{"aria-label":"Statistiky",icon:(0,ge.jsx)(re.t,{}),size:"sm",onClick:()=>(async e=>{try{const t=await(0,ue.jX)(e.id);Re(t),Se()}catch(t){be({title:"Chyba",description:"Nepoda\u0159ilo se na\u010d\xedst statistiky",status:"error",duration:3e3})}})(e)}),(0,ge.jsx)(u.K,{"aria-label":"Upravit",icon:(0,ge.jsx)(le.q,{}),size:"sm",onClick:()=>(e=>{De(e),We({title:e.title,description:e.description,type:e.type,style:e.style||"auto",status:e.status,start_date:e.start_date,end_date:e.end_date,allow_multiple:e.allow_multiple,max_choices:e.max_choices,show_results:e.show_results,require_auth:e.require_auth,allow_guest_vote:e.allow_guest_vote,featured:e.featured,category_id:e.category_id,related_match_id:e.related_match_id,related_article_id:e.related_article_id,related_event_id:e.related_event_id,related_video_url:e.related_video_url,image_url:e.image_url,options:e.options.map(e=>({text:e.text,description:e.description,image_url:e.image_url,display_order:e.display_order,player_id:e.player_id}))}),_e()})(e)}),(0,ge.jsx)(u.K,{"aria-label":"Smazat",icon:(0,ge.jsx)(se.d,{}),size:"sm",colorScheme:"red",onClick:()=>(async e=>{await fe({title:"Smazat anketu",message:"Opravdu chcete smazat tuto anketu?",confirmText:"Smazat",cancelText:"Zru\u0161it",isDanger:!0})&&Be.mutate(e)})(e.id)})]})})]},e.id);var t})})]})}),0===(null===Ue||void 0===Ue?void 0:Ue.length)&&(0,ge.jsxs)(r.F,{status:"info",children:[(0,ge.jsx)(s._,{}),"Zat\xedm nem\xe1te \u017e\xe1dn\xe9 ankety. Vytvo\u0159te prvn\xed anketu pomoc\xed tla\u010d\xedtka v\xfd\u0161e."]})]}),(0,ge.jsxs)(E.aF,{isOpen:ke,onClose:we,size:"4xl",children:[(0,ge.jsx)(C.m,{}),(0,ge.jsxs)(T.$,{children:[(0,ge.jsx)(A.r,{children:Te?"Upravit anketu":"Nov\xe1 anketa"}),(0,ge.jsx)(z.s,{}),(0,ge.jsx)(w.c,{children:(0,ge.jsxs)(X.t,{children:[(0,ge.jsxs)($.w,{children:[(0,ge.jsx)(H.o,{children:"Z\xe1kladn\xed"}),"rating"!==Le.type&&(0,ge.jsx)(H.o,{children:"Mo\u017enosti"}),(0,ge.jsx)(H.o,{children:"Nastaven\xed"})]}),(0,ge.jsxs)(G.T,{children:[(0,ge.jsx)(J.K,{children:(0,ge.jsxs)(P.T,{spacing:4,children:[(0,ge.jsxs)(F.z,{w:"full",justify:"space-between",children:[(0,ge.jsx)(te.E,{fontWeight:"semibold",children:"Doporu\u010den\xe9 p\u0159edvolby"}),(0,ge.jsxs)(F.z,{children:[(0,ge.jsx)(d.$,{size:"sm",onClick:()=>Ge("rating5"),children:"Hodnocen\xed (5 hv\u011bzd)"}),(0,ge.jsx)(d.$,{size:"sm",onClick:()=>Ge("rating10"),children:"Hodnocen\xed (1\u201310)"}),(0,ge.jsx)(d.$,{size:"sm",onClick:()=>Ge("attendance"),children:"Doch\xe1zka"})]})]}),(0,ge.jsxs)(x.MJ,{isRequired:!0,children:[(0,ge.jsx)(g.l,{children:"N\xe1zev ankety"}),(0,ge.jsx)(b.p,{value:Le.title,onChange:e=>We((0,a.A)((0,a.A)({},Le),{},{title:e.target.value})),placeholder:"Nap\u0159. Hr\xe1\u010d z\xe1pasu"})]}),(0,ge.jsxs)(x.MJ,{children:[(0,ge.jsx)(g.l,{children:"Popis"}),(0,ge.jsx)(Y.T,{value:Le.description,onChange:e=>We((0,a.A)((0,a.A)({},Le),{},{description:e.target.value})),placeholder:"Voliteln\xfd popis ankety"})]}),(0,ge.jsxs)(v.r,{columns:3,spacing:4,w:"full",children:[(0,ge.jsxs)(x.MJ,{children:[(0,ge.jsx)(g.l,{children:"Typ"}),(0,ge.jsxs)(N.l,{value:Le.type,onChange:e=>We((0,a.A)((0,a.A)({},Le),{},{type:e.target.value})),children:[(0,ge.jsx)("option",{value:"single",children:"Jedna volba"}),(0,ge.jsx)("option",{value:"multiple",children:"V\xedce voleb"}),(0,ge.jsx)("option",{value:"rating",children:"Hodnocen\xed"})]})]}),(0,ge.jsxs)(x.MJ,{children:[(0,ge.jsx)(g.l,{children:"Stav"}),(0,ge.jsxs)(N.l,{value:Le.status,onChange:e=>We((0,a.A)((0,a.A)({},Le),{},{status:e.target.value})),children:[(0,ge.jsx)("option",{value:"draft",children:"Koncept"}),(0,ge.jsx)("option",{value:"active",children:"Aktivn\xed"}),(0,ge.jsx)("option",{value:"closed",children:"Uzav\u0159en\xe1"}),(0,ge.jsx)("option",{value:"archived",children:"Archivovan\xe1"})]})]}),(0,ge.jsxs)(x.MJ,{children:[(0,ge.jsx)(g.l,{children:"Styl"}),(0,ge.jsxs)(N.l,{value:Le.style||"auto",onChange:e=>We((0,a.A)((0,a.A)({},Le),{},{style:e.target.value})),children:[(0,ge.jsx)("option",{value:"auto",children:"Automaticky"}),"rating"===Le.type?(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)("option",{value:"rating-stars",children:"Hv\u011bzdi\u010dky"}),(0,ge.jsx)("option",{value:"rating-scale",children:"\u010c\xedseln\xe1 stupnice"})]}):(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)("option",{value:"choices-list",children:"Seznam"}),(0,ge.jsx)("option",{value:"choices-chips",children:"\u0160t\xedtky"}),(0,ge.jsx)("option",{value:"choices-cards",children:"Karty"})]})]})]})]}),"rating"===Le.type&&(0,ge.jsxs)(c.a,{w:"full",borderWidth:"1px",borderRadius:"md",p:3,bg:"gray.50",children:[(0,ge.jsx)(te.E,{fontSize:"sm",mb:2,children:"Mo\u017enosti se generuj\xed automaticky podle stylu:"}),(0,ge.jsx)(te.E,{fontSize:"sm",children:Array.from({length:"rating-scale"===Le.style?10:5}).map((e,t)=>String(t+1)).join(", ")})]}),(0,ge.jsxs)(v.r,{columns:2,spacing:4,w:"full",children:[(0,ge.jsxs)(x.MJ,{children:[(0,ge.jsx)(g.l,{children:"Datum zah\xe1jen\xed"}),(0,ge.jsx)(b.p,{type:"datetime-local",value:Le.start_date||"",onChange:e=>We((0,a.A)((0,a.A)({},Le),{},{start_date:e.target.value}))})]}),(0,ge.jsxs)(x.MJ,{children:[(0,ge.jsx)(g.l,{children:"Datum ukon\u010den\xed"}),(0,ge.jsx)(b.p,{type:"datetime-local",value:Le.end_date||"",onChange:e=>We((0,a.A)((0,a.A)({},Le),{},{end_date:e.target.value}))})]})]}),(0,ge.jsxs)(x.MJ,{children:[(0,ge.jsx)(g.l,{children:"Video z klubov\xe9ho kan\xe1lu (voliteln\xe9)"}),(0,ge.jsx)(te.E,{fontSize:"sm",color:"gray.500",mb:2,children:"P\u0159ipojte anketu k videu z va\u0161eho YouTube kan\xe1lu"}),Ie?(0,ge.jsxs)(F.z,{children:[(0,ge.jsx)(R.y,{size:"sm"}),(0,ge.jsx)(te.E,{fontSize:"sm",children:"Na\u010d\xedt\xe1n\xed vide\xed..."})]}):0===Fe.length?(0,ge.jsxs)(r.F,{status:"info",size:"sm",children:[(0,ge.jsx)(s._,{}),(0,ge.jsx)(te.E,{fontSize:"sm",children:"\u017d\xe1dn\xe1 videa nenalezena. P\u0159idejte videa v Nastaven\xed \u2192 Videa."})]}):(0,ge.jsxs)(P.T,{spacing:3,align:"stretch",children:[(0,ge.jsx)(N.l,{value:Le.related_video_url||"",onChange:e=>We((0,a.A)((0,a.A)({},Le),{},{related_video_url:e.target.value})),placeholder:"Vyberte video (nebo nechte pr\xe1zdn\xe9)",children:Fe.map(e=>(0,ge.jsxs)("option",{value:"https://www.youtube.com/watch?v=".concat(e.video_id),children:[e.title," ",e.published_text?"(".concat(e.published_text,")"):""]},e.video_id))}),Le.related_video_url&&(0,ge.jsxs)(c.a,{borderWidth:"1px",borderRadius:"md",p:2,children:[(0,ge.jsx)(te.E,{fontSize:"sm",fontWeight:"semibold",mb:2,children:"N\xe1hled vybran\xe9ho videa:"}),(()=>{const e=Fe.find(e=>"https://www.youtube.com/watch?v=".concat(e.video_id)===Le.related_video_url);return e?(0,ge.jsxs)(F.z,{spacing:3,children:[(0,ge.jsx)(j._,{src:e.thumbnail_url,alt:e.title,boxSize:"120px",objectFit:"cover",borderRadius:"md"}),(0,ge.jsxs)(P.T,{align:"start",spacing:1,children:[(0,ge.jsx)(te.E,{fontSize:"sm",fontWeight:"medium",children:e.title}),e.published_text&&(0,ge.jsx)(l.E,{size:"sm",children:e.published_text})]})]}):null})()]})]}),(0,ge.jsx)(te.E,{fontSize:"xs",color:"gray.500",mt:2,children:"Pozn\xe1mka: Propojen\xed s \u010dl\xe1nky a aktivitami se nastavuje p\u0159\xedmo v editoru \u010dl\xe1nku/aktivity."})]})]})}),"rating"!==Le.type&&(0,ge.jsx)(J.K,{children:(0,ge.jsxs)(P.T,{spacing:4,align:"stretch",children:[Le.options.map((e,t)=>(0,ge.jsx)(h.Z,{children:(0,ge.jsx)(m.b,{children:(0,ge.jsxs)(F.z,{align:"start",children:[(0,ge.jsxs)(P.T,{flex:1,spacing:3,children:[(0,ge.jsxs)(x.MJ,{isRequired:!0,children:[(0,ge.jsxs)(g.l,{children:["Mo\u017enost ",t+1]}),(0,ge.jsx)(b.p,{value:e.text,onChange:e=>Xe(t,"text",e.target.value),placeholder:"Text mo\u017enosti"})]}),(0,ge.jsxs)(x.MJ,{children:[(0,ge.jsx)(g.l,{children:"Popis (voliteln\xe9)"}),(0,ge.jsx)(b.p,{value:e.description||"",onChange:e=>Xe(t,"description",e.target.value),placeholder:"Dopl\u0148uj\xedc\xed informace"})]})]}),Le.options.length>2&&(0,ge.jsx)(u.K,{"aria-label":"Odstranit mo\u017enost",icon:(0,ge.jsx)(se.d,{}),colorScheme:"red",variant:"ghost",onClick:()=>(e=>{Le.options.length>2&&We((0,a.A)((0,a.A)({},Le),{},{options:Le.options.filter((t,n)=>n!==e)}))})(t)})]})})},t)),(0,ge.jsx)(d.$,{leftIcon:(0,ge.jsx)(oe.R,{}),onClick:()=>{We((0,a.A)((0,a.A)({},Le),{},{options:[...Le.options,{text:"",display_order:Le.options.length}]}))},variant:"outline",colorScheme:"blue",children:"P\u0159idat mo\u017enost"})]})}),(0,ge.jsx)(J.K,{children:(0,ge.jsxs)(P.T,{spacing:4,children:["rating"!==Le.type&&(0,ge.jsxs)(x.MJ,{display:"flex",alignItems:"center",children:[(0,ge.jsx)(g.l,{mb:"0",children:"Povolit v\xedce voleb"}),(0,ge.jsx)(U.d,{isChecked:Le.allow_multiple,onChange:e=>We((0,a.A)((0,a.A)({},Le),{},{allow_multiple:e.target.checked}))})]}),"rating"!==Le.type&&Le.allow_multiple&&(0,ge.jsxs)(x.MJ,{children:[(0,ge.jsx)(g.l,{children:"Max. po\u010det voleb"}),(0,ge.jsxs)(D.Q7,{value:Le.max_choices,min:1,max:Le.options.length,onChange:(e,t)=>We((0,a.A)((0,a.A)({},Le),{},{max_choices:t})),children:[(0,ge.jsx)(D.OO,{}),(0,ge.jsxs)(D.lw,{children:[(0,ge.jsx)(D.Q0,{}),(0,ge.jsx)(D.Sh,{})]})]})]}),(0,ge.jsxs)(x.MJ,{children:[(0,ge.jsx)(g.l,{children:"Zobrazen\xed v\xfdsledk\u016f"}),(0,ge.jsxs)(N.l,{value:Le.show_results,onChange:e=>We((0,a.A)((0,a.A)({},Le),{},{show_results:e.target.value})),children:[(0,ge.jsx)("option",{value:"always",children:"V\u017edy"}),(0,ge.jsx)("option",{value:"after_vote",children:"Po hlasov\xe1n\xed"}),(0,ge.jsx)("option",{value:"after_end",children:"Po ukon\u010den\xed"}),(0,ge.jsx)("option",{value:"never",children:"Nikdy (pouze admin)"})]})]}),(0,ge.jsxs)(x.MJ,{display:"flex",alignItems:"center",children:[(0,ge.jsx)(g.l,{mb:"0",children:"Vy\u017eadovat p\u0159ihl\xe1\u0161en\xed"}),(0,ge.jsx)(U.d,{isChecked:Le.require_auth,onChange:e=>We((0,a.A)((0,a.A)({},Le),{},{require_auth:e.target.checked}))})]}),(0,ge.jsxs)(x.MJ,{display:"flex",alignItems:"center",children:[(0,ge.jsx)(g.l,{mb:"0",children:"Povolit hlasov\xe1n\xed host\u016f"}),(0,ge.jsx)(U.d,{isChecked:Le.allow_guest_vote,onChange:e=>We((0,a.A)((0,a.A)({},Le),{},{allow_guest_vote:e.target.checked}))})]}),(0,ge.jsxs)(x.MJ,{display:"flex",alignItems:"center",children:[(0,ge.jsx)(g.l,{mb:"0",children:"Zv\xfdraznit na hlavn\xed str\xe1nce"}),(0,ge.jsx)(U.d,{isChecked:Le.featured,onChange:e=>We((0,a.A)((0,a.A)({},Le),{},{featured:e.target.checked}))})]})]})})]})]})}),(0,ge.jsxs)(S.j,{children:[(0,ge.jsx)(d.$,{variant:"ghost",mr:3,onClick:we,children:"Zru\u0161it"}),(0,ge.jsx)(d.$,{colorScheme:"blue",onClick:()=>{if("rating"!==Le.type){if(Le.options.filter(e=>!e.text||""===e.text.trim()).length>0)return void be({title:"Chyba",description:"V\u0161echny mo\u017enosti mus\xed m\xedt vypln\u011bn\xfd text",status:"error",duration:3e3})}Te?Ke.mutate({id:Te.id,data:Le}):qe.mutate(Le)},isLoading:qe.isPending||Ke.isPending,children:Te?"Ulo\u017eit":"Vytvo\u0159it"})]})]})]}),(0,ge.jsxs)(E.aF,{isOpen:ze,onClose:Ae,size:"4xl",children:[(0,ge.jsx)(C.m,{}),(0,ge.jsxs)(T.$,{children:[(0,ge.jsx)(A.r,{children:"Statistiky ankety"}),(0,ge.jsx)(z.s,{}),(0,ge.jsx)(w.c,{children:Ve?(0,ge.jsxs)(P.T,{py:8,children:[(0,ge.jsx)(R.y,{size:"xl"}),(0,ge.jsx)(te.E,{children:"Na\u010d\xedt\xe1n\xed statistik..."})]}):Ze?(0,ge.jsxs)(P.T,{spacing:6,align:"stretch",children:[(0,ge.jsxs)(v.r,{columns:3,spacing:4,children:[(0,ge.jsxs)(I.r,{children:[(0,ge.jsx)(L.v,{children:"Celkem hlas\u016f"}),(0,ge.jsx)(W.k,{children:Ze.poll.total_votes})]}),(0,ge.jsxs)(I.r,{children:[(0,ge.jsx)(L.v,{children:"P\u0159ihl\xe1\u0161en\xed u\u017eivatel\xe9"}),(0,ge.jsx)(W.k,{children:Ze.authenticated_votes}),(0,ge.jsx)(M.h,{children:Ze.poll.total_votes>0?"".concat(Math.round(Ze.authenticated_votes/Ze.poll.total_votes*100),"%"):"0%"})]}),(0,ge.jsxs)(I.r,{children:[(0,ge.jsx)(L.v,{children:"Host\xe9"}),(0,ge.jsx)(W.k,{children:Ze.guest_votes}),(0,ge.jsx)(M.h,{children:Ze.poll.total_votes>0?"".concat(Math.round(Ze.guest_votes/Ze.poll.total_votes*100),"%"):"0%"})]})]}),(0,ge.jsxs)(c.a,{children:[(0,ge.jsx)(ee.D,{size:"sm",mb:4,children:"V\xfdsledky"}),(0,ge.jsx)(P.T,{spacing:2,align:"stretch",children:(Ze.poll.options||[]).map(e=>{const t=Ze.poll.total_votes>0?e.vote_count/Ze.poll.total_votes*100:0;return(0,ge.jsxs)(c.a,{children:[(0,ge.jsxs)(F.z,{justify:"space-between",mb:1,children:[(0,ge.jsx)(te.E,{fontWeight:"medium",children:e.text}),(0,ge.jsxs)(te.E,{fontSize:"sm",color:"gray.500",children:[e.vote_count," hlas\u016f (",t.toFixed(1),"%)"]})]}),(0,ge.jsx)(c.a,{w:"full",h:"8px",bg:"gray.200",borderRadius:"full",overflow:"hidden",children:(0,ge.jsx)(c.a,{h:"full",bg:"blue.500",w:"".concat(t,"%"),transition:"width 0.3s"})})]},e.id)})})]}),(null!==(ve=null===(je=Ze.votes_by_day)||void 0===je?void 0:je.length)&&void 0!==ve?ve:0)>0&&(0,ge.jsxs)(c.a,{children:[(0,ge.jsx)(ee.D,{size:"sm",mb:4,children:"Hlasy podle dn\u016f"}),(0,ge.jsxs)(v.r,{columns:{base:1,md:2},spacing:6,children:[(0,ge.jsx)(c.a,{children:(0,ge.jsx)(P.T,{spacing:2,align:"stretch",children:(Ze.votes_by_day||[]).map(e=>(0,ge.jsxs)(F.z,{justify:"space-between",children:[(0,ge.jsx)(te.E,{children:new Date(e.date).toLocaleDateString("cs-CZ")}),(0,ge.jsxs)(l.E,{children:[e.count," hlas\u016f"]})]},e.date))})}),(0,ge.jsx)(c.a,{children:(0,ge.jsx)(pe.N1,{data:{labels:(Ze.votes_by_day||[]).map(e=>new Date(e.date).toLocaleDateString("cs-CZ")),datasets:[{label:"Hlasy",data:(Ze.votes_by_day||[]).map(e=>e.count),borderColor:"#3182ce",backgroundColor:"rgba(49,130,206,0.2)",tension:.3}]},options:{responsive:!0,plugins:{legend:{display:!1}}}})})]})]}),(0,ge.jsxs)(v.r,{columns:{base:1,md:2},spacing:6,children:[(0,ge.jsxs)(c.a,{children:[(0,ge.jsx)(ee.D,{size:"sm",mb:3,children:"Slo\u017een\xed hlasuj\xedc\xedch"}),(0,ge.jsx)(pe.nu,{data:{labels:["P\u0159ihl\xe1\u0161en\xed","Host\xe9"],datasets:[{data:[Ze.authenticated_votes,Ze.guest_votes],backgroundColor:["#2f855a","#718096"]}]},options:{plugins:{legend:{position:"bottom"}}}})]}),(0,ge.jsxs)(c.a,{children:[(0,ge.jsx)(ee.D,{size:"sm",mb:3,children:"Rozd\u011blen\xed hlas\u016f podle mo\u017enost\xed"}),(0,ge.jsx)(pe.yP,{data:{labels:(Ze.poll.options||[]).map(e=>e.text),datasets:[{label:"Hlasy",data:(Ze.poll.options||[]).map(e=>e.vote_count),backgroundColor:"#3182ce"}]},options:{responsive:!0,plugins:{legend:{display:!1}},scales:{y:{beginAtZero:!0,ticks:{precision:0}}}}})]})]}),(0,ge.jsxs)(c.a,{children:[(0,ge.jsxs)(F.z,{justify:"space-between",mb:3,children:[(0,ge.jsx)(ee.D,{size:"sm",children:"Hlasuj\xedc\xed"}),(0,ge.jsx)(d.$,{size:"sm",onClick:()=>{var e;if(!He)return;const t=He.map(e=>{var t;return[e.id,e.poll_id,e.option_id,JSON.stringify(e.option_text||""),null!==(t=e.user_id)&&void 0!==t?t:"",e.user_email||"",e.user_first_name||"",e.user_last_name||"",e.voter_name||"",e.voter_email||"",e.session_token||"",e.created_at]}),n=[["id","poll_id","option_id","option_text","user_id","user_email","user_first_name","user_last_name","voter_name","voter_email","session_token","created_at"].join(","),...t.map(e=>e.join(","))].join("\n"),a=new Blob([n],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(a),o=document.createElement("a");o.href=i,o.download="poll_".concat((null===Ne||void 0===Ne||null===(e=Ne.poll)||void 0===e?void 0:e.id)||"","_votes.csv"),o.click(),URL.revokeObjectURL(i)},isDisabled:!He||0===He.length,children:"Export CSV"})]}),$e?(0,ge.jsxs)(F.z,{children:[(0,ge.jsx)(R.y,{size:"sm"}),(0,ge.jsx)(te.E,{children:"Na\u010d\xedt\xe1n\xed hlas\u016f..."})]}):He&&He.length>0?(0,ge.jsxs)(c.a,{overflowX:"auto",children:[(0,ge.jsxs)(O.X,{size:"sm",variant:"simple",children:[(0,ge.jsx)(Z.d,{children:(0,ge.jsxs)(V.Tr,{children:[(0,ge.jsx)(B.Th,{children:"Datum"}),(0,ge.jsx)(B.Th,{children:"Jm\xe9no"}),(0,ge.jsx)(B.Th,{children:"E-mail"}),(0,ge.jsx)(B.Th,{children:"Typ"}),(0,ge.jsx)(B.Th,{children:"Mo\u017enost"}),(0,ge.jsx)(B.Th,{children:"Session"})]})}),(0,ge.jsx)(q.N,{children:He.slice(0,100).map(e=>{const t=e.voter_name||((e.user_first_name||"")+" "+(e.user_last_name||"")).trim(),n=e.voter_email||e.user_email||"",a=e.user_id?"P\u0159ihl\xe1\u0161en\xfd":"Host",i=(e.session_token||"").slice(-8);return(0,ge.jsxs)(V.Tr,{children:[(0,ge.jsx)(K.Td,{children:new Date(e.created_at).toLocaleString("cs-CZ")}),(0,ge.jsx)(K.Td,{children:t||"-"}),(0,ge.jsx)(K.Td,{children:n||"-"}),(0,ge.jsx)(K.Td,{children:(0,ge.jsx)(l.E,{colorScheme:e.user_id?"green":"gray",children:a})}),(0,ge.jsx)(K.Td,{children:e.option_text}),(0,ge.jsx)(K.Td,{children:i})]},e.id)})})]}),He.length>100&&(0,ge.jsxs)(te.E,{fontSize:"xs",color:"gray.500",mt:2,children:["Zobrazeno 100 z ",He.length," hlas\u016f"]})]}):(0,ge.jsx)(te.E,{fontSize:"sm",color:"gray.500",children:"\u017d\xe1dn\xe9 hlasy k zobrazen\xed."})]})]}):null}),(0,ge.jsx)(S.j,{children:(0,ge.jsx)(d.$,{onClick:Ae,children:"Zav\u0159\xedt"})})]})]})]})})}},63988:(e,t,n)=>{function a(e){return e&&"string"===typeof e?e.replace(/\u2022/g,"").replace(/(\S)(?=<strong>)/g,"$1 ").replace(/\n/g,"").replace(/\s{2,}/g," ").trim():""}function i(e){return"number"!==typeof e||isNaN(e)?0:Math.round(Math.max(0,Math.min(100,e)))}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{cleanText:!0,roundPercentages:!0,preserveHtmlTags:!1};if(!e||"string"!==typeof e)return"";let n=e;return t.cleanText&&(n=t.preserveHtmlTags?n.replace(/>([^<]+)</g,(e,t)=>{const n=t.replace(/\u2022/g,"").replace(/(\S)(?=<strong>)/g,"$1 ").replace(/\n/g,"").replace(/\s{2,}/g," ").trim();return">".concat(n,"<")}):a(n)),t.roundPercentages&&(n=n.replace(/(\d+(?:\.\d+)?)%/g,(e,t)=>{const n=parseFloat(t);return"".concat(i(n),"%")})),n}n.d(t,{F0:()=>o,ry:()=>a})},64381:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var a=n(65043),i=n(87139),o=n(22107),r=n(98662),s=n(68659),l=n(44093),c=n(73212),d=n(33572),u=n(96148),h=n(10202),m=n(30502),p=n(28846),x=n(39081),g=n(6583),v=n(72526),j=n(59781),b=n(48549),y=n(70579);const f=()=>{const e=(0,m.d)(),t=(0,j.jE)(),n=(0,l.dU)("white","gray.800"),f=(0,l.dU)("gray.200","gray.700"),{data:k,isLoading:_}=(0,v.I)({queryKey:["admin-scoreboard-mobile"],queryFn:b.cJ,refetchInterval:e=>!(null===e||void 0===e||!e.running)&&1e3,staleTime:500}),w=async n=>{try{await(0,b.x0)(n),await t.invalidateQueries({queryKey:["admin-scoreboard-mobile"]})}catch(a){e({title:"Ulo\u017een\xed selhalo",status:"error"})}},z=(0,a.useMemo)(()=>(null===k||void 0===k?void 0:k.timer)||"00:00",[null===k||void 0===k?void 0:k.timer]);return _||!k?(0,y.jsx)(g.A,{requireAdmin:!1,children:(0,y.jsx)(s.o,{minH:"50vh",children:"Na\u010d\xedt\xe1n\xed\u2026"})}):(0,y.jsx)(g.A,{requireAdmin:!1,children:(0,y.jsxs)(o.a,{p:3,children:[(0,y.jsx)(p.D,{size:"md",mb:3,children:"Mobiln\xed ovl\xe1d\xe1n\xed tabule"}),(0,y.jsxs)(h.T,{align:"stretch",spacing:3,children:[(0,y.jsx)(o.a,{borderWidth:"1px",borderColor:f,bg:n,borderRadius:"lg",p:{base:3,md:4},children:(0,y.jsxs)(h.T,{spacing:3,align:"stretch",children:[(0,y.jsxs)(u.z,{justify:"space-between",align:"center",flexWrap:"wrap",children:[(0,y.jsxs)(x.E,{fontSize:{base:"4xl",md:"5xl"},fontWeight:"black",lineHeight:"1",children:[k.homeScore," : ",k.awayScore]}),(0,y.jsx)(x.E,{fontSize:{base:"3xl",md:"4xl"},fontFamily:"mono",fontWeight:"semibold",children:z})]}),(0,y.jsxs)(u.z,{spacing:2,wrap:"wrap",children:[(0,y.jsx)(r.$,{size:"lg",colorScheme:k.running?"red":"green",onClick:()=>k.running?(async()=>{await(0,b.Cd)(),await t.invalidateQueries({queryKey:["admin-scoreboard-mobile"]})})():(async()=>{await(0,b.Ip)(),await t.invalidateQueries({queryKey:["admin-scoreboard-mobile"]})})(),children:k.running?"Stop":"Start"}),(0,y.jsx)(r.$,{size:"lg",variant:"outline",onClick:async()=>{await(0,b.nz)(),await t.invalidateQueries({queryKey:["admin-scoreboard-mobile"]})},children:"Reset"}),(0,y.jsx)(r.$,{size:"lg",colorScheme:"purple",onClick:async()=>{try{await(0,b.SJ)(),await t.invalidateQueries({queryKey:["admin-scoreboard-mobile"]}),e({title:"Za\u010dal 2. polo\u010das",status:"success"})}catch(n){e({title:"Akce selhala",status:"error"})}},children:"Za\u010d\xedt 2. polo\u010das"}),(0,y.jsxs)(i.E,{ml:"auto",colorScheme:"purple",fontSize:{base:"sm",md:"md"},children:["Polo\u010das: ",k.half||1]})]})]})}),(0,y.jsxs)(c.r,{columns:{base:1,sm:2},spacing:3,alignItems:"stretch",children:[(0,y.jsxs)(h.T,{spacing:3,borderWidth:"1px",borderColor:f,bg:n,borderRadius:"lg",p:{base:3,md:4},align:"stretch",children:[k.homeLogo?(0,y.jsx)(d._,{src:k.homeLogo,alt:"DOM",boxSize:{base:"56px",md:"64px"},objectFit:"contain",alignSelf:"center"}):null,(0,y.jsx)(x.E,{fontWeight:"bold",textAlign:"center",children:k.homeShort||"DOM"}),(0,y.jsxs)(u.z,{justify:"center",children:[(0,y.jsx)(r.$,{size:"lg",onClick:()=>w({homeScore:Math.max(0,(k.homeScore||0)-1)}),children:"\u2212"}),(0,y.jsx)(r.$,{size:"lg",colorScheme:"green",onClick:()=>w({homeScore:(k.homeScore||0)+1}),children:"+"})]}),(0,y.jsxs)(u.z,{justify:"center",children:[(0,y.jsx)(r.$,{size:"sm",onClick:()=>w({homeFouls:Math.max(0,Math.min(5,(k.homeFouls||0)-1))}),children:"\u2212 Faul"}),(0,y.jsx)(x.E,{fontWeight:"semibold",children:Math.max(0,Math.min(5,k.homeFouls||0))}),(0,y.jsx)(r.$,{size:"sm",colorScheme:"orange",onClick:()=>w({homeFouls:Math.max(0,Math.min(5,(k.homeFouls||0)+1))}),children:"+ Faul"})]})]}),(0,y.jsxs)(h.T,{spacing:3,borderWidth:"1px",borderColor:f,bg:n,borderRadius:"lg",p:{base:3,md:4},align:"stretch",children:[k.awayLogo?(0,y.jsx)(d._,{src:k.awayLogo,alt:"HOS",boxSize:{base:"56px",md:"64px"},objectFit:"contain",alignSelf:"center"}):null,(0,y.jsx)(x.E,{fontWeight:"bold",textAlign:"center",children:k.awayShort||"HOS"}),(0,y.jsxs)(u.z,{justify:"center",children:[(0,y.jsx)(r.$,{size:"lg",onClick:()=>w({awayScore:Math.max(0,(k.awayScore||0)-1)}),children:"\u2212"}),(0,y.jsx)(r.$,{size:"lg",colorScheme:"green",onClick:()=>w({awayScore:(k.awayScore||0)+1}),children:"+"})]}),(0,y.jsxs)(u.z,{justify:"center",children:[(0,y.jsx)(r.$,{size:"sm",onClick:()=>w({awayFouls:Math.max(0,Math.min(5,(k.awayFouls||0)-1))}),children:"\u2212 Faul"}),(0,y.jsx)(x.E,{fontWeight:"semibold",children:Math.max(0,Math.min(5,k.awayFouls||0))}),(0,y.jsx)(r.$,{size:"sm",colorScheme:"orange",onClick:()=>w({awayFouls:Math.max(0,Math.min(5,(k.awayFouls||0)+1))}),children:"+ Faul"})]})]})]})]})]})})}},64920:(e,t,n)=>{n.d(t,{M0:()=>c,ON:()=>l,_m:()=>m,aK:()=>s,bg:()=>o,k5:()=>h,rT:()=>u,rs:()=>d,wK:()=>r,wl:()=>i});var a=n(46291);async function i(e){return(await a.Ay.get("/admin/engagement/rewards",{params:e})).data.items||[]}async function o(e){return(await a.Ay.post("/admin/engagement/rewards",e)).data}async function r(e,t){return(await a.Ay.put("/admin/engagement/rewards/".concat(e),t)).data}async function s(e){return(await a.Ay.delete("/admin/engagement/rewards/".concat(e))).data}async function l(e){return(await a.Ay.get("/admin/engagement/redemptions",{params:e})).data.items||[]}async function c(e,t){return(await a.Ay.patch("/admin/engagement/redemptions/".concat(e),{action:t})).data}async function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"points",t=arguments.length>1?arguments[1]:void 0;return(await a.Ay.get("/admin/engagement/leaderboard",{params:{metric:e,limit:t}})).data}async function u(e){var t;return(null===(t=(await a.Ay.get("/admin/engagement/transactions",{params:e})).data)||void 0===t?void 0:t.items)||[]}async function h(e){return(await a.Ay.post("/admin/engagement/adjust",e)).data}async function m(){return(await a.Ay.get("/admin/users")).data||[]}},64963:(e,t,n)=>{n.d(t,{F:()=>l});var a=n(65043),i=n(79722),o=n(46291),r=n(73216),s=n(40548);const l=()=>{const[e,t]=(0,a.useState)(null),[n,l]=(0,a.useState)(!1),c=(0,r.zy)(),d=e=>e.startsWith("/admin")||"/login"===e||"/setup"===e;(0,a.useEffect)(()=>{if(d(c.pathname))return void console.log("Umami tracking disabled for admin pages");(async()=>{try{const e=(await i.A.get("".concat(o.API_URL,"/insights/config"))).data;t(e),e.enabled&&e.website_id&&!n&&u(e.script_url,e.website_id)}catch(e){console.error("Failed to load Umami config:",e)}})()},[c.pathname]),(0,a.useEffect)(()=>{c.pathname&&!d(c.pathname)&&(0,s.sx)({event_type:"page_view",page_path:c.pathname,page_name:document.title}).catch(e=>{console.debug("Analytics tracking failed:",e)})},[c.pathname]);const u=(e,t)=>{if(document.querySelector('script[data-website-id="'.concat(t,'"]')))return void l(!0);const n=document.createElement("script");n.async=!0,n.defer=!0,n.src=e,n.setAttribute("data-website-id",t),n.onload=()=>{console.log("Umami tracking loaded"),l(!0)},n.onerror=()=>{console.error("Failed to load Umami script")},document.head.appendChild(n)};return{isEnabled:(null===e||void 0===e?void 0:e.enabled)||!1,isLoaded:n,trackEvent:(e,t)=>{d(c.pathname)||(window.umami&&n&&window.umami.track(e,t),(0,s.sx)({event_type:e,page:c.pathname,data:t}).catch(e=>{console.debug("Backend tracking failed:",e)}))}}}},64979:(e,t,n)=>{n.r(t),n.d(t,{default:()=>W});var a=n(65043),i=n(96870),o=n(87139),r=n(22107),s=n(98662),l=n(42703),c=n(5371),d=n(73225),u=n(76668),h=n(35699),m=n(45973),p=n(29244),x=n(67516),g=n(35929),v=n(56529),j=n(15071),b=n(11054),y=n(78460),f=n(85421),k=n(61724),_=n(96148),w=n(10202),z=n(80511),S=n(82595),A=n(67813),C=n(83201),E=n(3313),T=n(55395),D=n(19077),N=n(30502),R=n(99956),F=n(28846),P=n(39081),I=n(85369),M=n(46291),L=n(70579);const W=()=>{const[e,t]=(0,a.useState)([]),[n,W]=(0,a.useState)([]),[U,O]=(0,a.useState)(""),[q,K]=(0,a.useState)(""),[B,Z]=(0,a.useState)(""),[V,H]=(0,a.useState)(!1),[$,J]=(0,a.useState)(0),[G,X]=(0,a.useState)(1),[Y]=(0,a.useState)(50),{isOpen:Q,onOpen:ee,onClose:te}=(0,i.j)(),{isOpen:ne,onOpen:ae,onClose:ie}=(0,i.j)(),[oe,re]=(0,a.useState)(null),se=(0,N.d)(),le=async()=>{try{const e=await M.FH.get("/admin/i18n/languages");t(e.data.languages)}catch(e){se({title:"Chyba p\u0159i na\u010d\xedt\xe1n\xed jazyk\u016f",description:"Nepoda\u0159ilo se na\u010d\xedst seznam jazyk\u016f",status:"error",duration:3e3})}},ce=async()=>{H(!0);try{const e=new URLSearchParams({page:G.toString(),limit:Y.toString()});U&&e.append("language",U),q&&e.append("context",q);const t=await M.FH.get("/admin/i18n/translations?".concat(e));W(t.data.translations),J(t.data.total)}catch(e){se({title:"Chyba p\u0159i na\u010d\xedt\xe1n\xed p\u0159eklad\u016f",description:"Nepoda\u0159ilo se na\u010d\xedst seznam p\u0159eklad\u016f",status:"error",duration:3e3})}finally{H(!1)}},de=n.filter(e=>e.key.toLowerCase().includes(B.toLowerCase())||e.value.toLowerCase().includes(B.toLowerCase()));return(0,a.useEffect)(()=>{le()},[]),(0,a.useEffect)(()=>{ce()},[U,q,G]),(0,L.jsxs)(r.a,{p:6,children:[(0,L.jsxs)(w.T,{spacing:6,align:"stretch",children:[(0,L.jsxs)(c.s,{justify:"space-between",align:"center",children:[(0,L.jsxs)(F.D,{size:"lg",display:"flex",alignItems:"center",gap:2,children:[(0,L.jsx)(I.f35,{}),"Spr\xe1va p\u0159eklad\u016f"]}),(0,L.jsxs)(_.z,{spacing:2,children:[(0,L.jsx)(s.$,{colorScheme:"blue",onClick:ee,leftIcon:(0,L.jsx)(I.OiG,{}),children:"P\u0159idat jazyk"}),(0,L.jsx)(s.$,{colorScheme:"green",onClick:ae,leftIcon:(0,L.jsx)(I.OiG,{}),children:"P\u0159idat p\u0159eklad"})]})]}),(0,L.jsxs)(r.a,{bg:"white",p:6,borderRadius:"lg",shadow:"sm",children:[(0,L.jsx)(F.D,{size:"md",mb:4,children:"Jazyky"}),(0,L.jsxs)(z.X,{children:[(0,L.jsx)(E.d,{children:(0,L.jsxs)(T.Tr,{children:[(0,L.jsx)(C.Th,{children:"K\xf3d"}),(0,L.jsx)(C.Th,{children:"N\xe1zev"}),(0,L.jsx)(C.Th,{children:"Domorod\xfd n\xe1zev"}),(0,L.jsx)(C.Th,{children:"V\xfdchoz\xed"}),(0,L.jsx)(C.Th,{children:"Aktivn\xed"}),(0,L.jsx)(C.Th,{children:"Po\u0159ad\xed"}),(0,L.jsx)(C.Th,{children:"Akce"})]})}),(0,L.jsx)(S.N,{children:e.map(e=>(0,L.jsxs)(T.Tr,{children:[(0,L.jsx)(A.Td,{children:(0,L.jsx)(o.E,{colorScheme:e.is_default?"blue":"gray",children:e.code})}),(0,L.jsx)(A.Td,{children:e.name}),(0,L.jsx)(A.Td,{children:e.native_name}),(0,L.jsx)(A.Td,{children:(0,L.jsx)(o.E,{colorScheme:e.is_default?"green":"gray",children:e.is_default?"Ano":"Ne"})}),(0,L.jsx)(A.Td,{children:(0,L.jsx)(o.E,{colorScheme:e.is_active?"green":"red",children:e.is_active?"Ano":"Ne"})}),(0,L.jsx)(A.Td,{children:e.sort_order}),(0,L.jsx)(A.Td,{children:(0,L.jsxs)(_.z,{spacing:2,children:[(0,L.jsx)(R.m,{label:"Upravit",children:(0,L.jsx)(l.K,{"aria-label":"Upravit",icon:(0,L.jsx)(I.uO9,{}),size:"sm",variant:"ghost",onClick:()=>{re(e),ee()}})}),!e.is_default&&(0,L.jsx)(R.m,{label:"Smazat",children:(0,L.jsx)(l.K,{"aria-label":"Smazat",icon:(0,L.jsx)(I.qbC,{}),size:"sm",variant:"ghost",colorScheme:"red",onClick:()=>(async e=>{if(confirm("Opravdu chcete smazat tento jazyk?"))try{await M.FH.delete("/admin/i18n/languages/".concat(e)),se({title:"Jazyk smaz\xe1n",description:"Jazyk byl \xfasp\u011b\u0161n\u011b smaz\xe1n",status:"success",duration:3e3}),await le()}catch(t){se({title:"Chyba p\u0159i maz\xe1n\xed jazyka",description:"Nepoda\u0159ilo se smazat jazyk",status:"error",duration:3e3})}})(e.id)})})]})})]},e.id))})]})]}),(0,L.jsxs)(r.a,{bg:"white",p:6,borderRadius:"lg",shadow:"sm",children:[(0,L.jsxs)(w.T,{spacing:4,align:"stretch",mb:6,children:[(0,L.jsx)(F.D,{size:"md",children:"P\u0159eklady"}),(0,L.jsxs)(_.z,{spacing:4,children:[(0,L.jsx)(k.l,{placeholder:"V\u0161echny jazyky",value:U,onChange:e=>O(e.target.value),maxW:"200px",children:e.map(e=>(0,L.jsx)("option",{value:e.code,children:e.native_name},e.code))}),(0,L.jsxs)(k.l,{placeholder:"V\u0161echny kontexty",value:q,onChange:e=>K(e.target.value),maxW:"200px",children:[(0,L.jsx)("option",{value:"common",children:"Obecn\xe9"}),(0,L.jsx)("option",{value:"nav",children:"Navigace"}),(0,L.jsx)("option",{value:"admin",children:"Admin"}),(0,L.jsx)("option",{value:"form",children:"Formul\xe1\u0159e"}),(0,L.jsx)("option",{value:"content",children:"Obsah"}),(0,L.jsx)("option",{value:"match",children:"Z\xe1pasy"}),(0,L.jsx)("option",{value:"team",children:"T\xfdmy"}),(0,L.jsx)("option",{value:"gallery",children:"Galerie"}),(0,L.jsx)("option",{value:"search",children:"Vyhled\xe1v\xe1n\xed"}),(0,L.jsx)("option",{value:"pagination",children:"Str\xe1nkov\xe1n\xed"}),(0,L.jsx)("option",{value:"date",children:"Datum"}),(0,L.jsx)("option",{value:"auth",children:"Autentizace"}),(0,L.jsx)("option",{value:"error",children:"Chyby"})]}),(0,L.jsxs)(m.M,{maxW:"300px",children:[(0,L.jsx)(p.W,{children:(0,L.jsx)(I.KSO,{})}),(0,L.jsx)(h.p,{placeholder:"Hledat p\u0159eklad...",value:B,onChange:e=>Z(e.target.value)})]})]})]}),(0,L.jsxs)(z.X,{children:[(0,L.jsx)(E.d,{children:(0,L.jsxs)(T.Tr,{children:[(0,L.jsx)(C.Th,{children:"Kl\xed\u010d"}),(0,L.jsx)(C.Th,{children:"Jazyk"}),(0,L.jsx)(C.Th,{children:"Hodnota"}),(0,L.jsx)(C.Th,{children:"Kontext"}),(0,L.jsx)(C.Th,{children:"Akce"})]})}),(0,L.jsx)(S.N,{children:V?(0,L.jsx)(T.Tr,{children:(0,L.jsx)(A.Td,{colSpan:5,textAlign:"center",children:(0,L.jsx)(P.E,{children:"Na\u010d\xedt\xe1n\xed..."})})}):0===de.length?(0,L.jsx)(T.Tr,{children:(0,L.jsx)(A.Td,{colSpan:5,textAlign:"center",children:(0,L.jsx)(P.E,{children:"\u017d\xe1dn\xe9 p\u0159eklady"})})}):de.map(e=>(0,L.jsxs)(T.Tr,{children:[(0,L.jsx)(A.Td,{children:(0,L.jsx)(P.E,{fontFamily:"mono",fontSize:"sm",children:e.key})}),(0,L.jsx)(A.Td,{children:(0,L.jsx)(o.E,{colorScheme:"blue",children:e.language_code})}),(0,L.jsx)(A.Td,{children:(0,L.jsx)(P.E,{maxW:"300px",noOfLines:2,children:e.value})}),(0,L.jsx)(A.Td,{children:(0,L.jsx)(o.E,{colorScheme:"gray",children:e.context||"\u2014"})}),(0,L.jsx)(A.Td,{children:(0,L.jsxs)(_.z,{spacing:2,children:[(0,L.jsx)(R.m,{label:"Upravit",children:(0,L.jsx)(l.K,{"aria-label":"Upravit",icon:(0,L.jsx)(I.uO9,{}),size:"sm",variant:"ghost",onClick:()=>{re(e),ae()}})}),(0,L.jsx)(R.m,{label:"Smazat",children:(0,L.jsx)(l.K,{"aria-label":"Smazat",icon:(0,L.jsx)(I.qbC,{}),size:"sm",variant:"ghost",colorScheme:"red",onClick:()=>(async e=>{if(confirm("Opravdu chcete smazat tento p\u0159eklad?"))try{await M.FH.delete("/admin/i18n/translations/".concat(e)),se({title:"P\u0159eklad smaz\xe1n",description:"P\u0159eklad byl \xfasp\u011b\u0161n\u011b smaz\xe1n",status:"success",duration:3e3}),await ce()}catch(t){se({title:"Chyba p\u0159i maz\xe1n\xed p\u0159ekladu",description:"Nepoda\u0159ilo se smazat p\u0159eklad",status:"error",duration:3e3})}})(e.id)})})]})})]},e.id))})]}),$>Y&&(0,L.jsx)(c.s,{justify:"center",mt:4,children:(0,L.jsxs)(_.z,{spacing:2,children:[(0,L.jsx)(s.$,{onClick:()=>X(Math.max(1,G-1)),isDisabled:1===G,children:"P\u0159edchoz\xed"}),(0,L.jsxs)(P.E,{children:["Strana ",G," z ",Math.ceil($/Y)]}),(0,L.jsx)(s.$,{onClick:()=>X(Math.min(Math.ceil($/Y),G+1)),isDisabled:G>=Math.ceil($/Y),children:"Dal\u0161\xed"})]})})]})]}),(0,L.jsxs)(y.aF,{isOpen:Q,onClose:te,children:[(0,L.jsx)(b.m,{}),(0,L.jsxs)(f.$,{children:[(0,L.jsx)(j.r,{children:null!==oe&&void 0!==oe&&oe.id?"Upravit jazyk":"P\u0159idat jazyk"}),(0,L.jsx)(g.s,{}),(0,L.jsx)(x.c,{children:(0,L.jsxs)(w.T,{spacing:4,children:[(0,L.jsxs)(d.MJ,{isRequired:!0,children:[(0,L.jsx)(u.l,{children:"ID"}),(0,L.jsx)(h.p,{defaultValue:(null===oe||void 0===oe?void 0:oe.id)||"",placeholder:"cs, en, de..."})]}),(0,L.jsxs)(d.MJ,{isRequired:!0,children:[(0,L.jsx)(u.l,{children:"N\xe1zev"}),(0,L.jsx)(h.p,{defaultValue:(null===oe||void 0===oe?void 0:oe.name)||"",placeholder:"Czech, English..."})]}),(0,L.jsxs)(d.MJ,{isRequired:!0,children:[(0,L.jsx)(u.l,{children:"Domorod\xfd n\xe1zev"}),(0,L.jsx)(h.p,{defaultValue:(null===oe||void 0===oe?void 0:oe.native_name)||"",placeholder:"\u010ce\u0161tina, English..."})]}),(0,L.jsxs)(d.MJ,{isRequired:!0,children:[(0,L.jsx)(u.l,{children:"K\xf3d"}),(0,L.jsx)(h.p,{defaultValue:(null===oe||void 0===oe?void 0:oe.code)||"",placeholder:"cs, en, de..."})]}),(0,L.jsxs)(d.MJ,{children:[(0,L.jsx)(u.l,{children:"Po\u0159ad\xed"}),(0,L.jsx)(h.p,{type:"number",defaultValue:(null===oe||void 0===oe?void 0:oe.sort_order)||0})]})]})}),(0,L.jsxs)(v.j,{children:[(0,L.jsx)(s.$,{variant:"ghost",onClick:te,children:"Zru\u0161it"}),(0,L.jsx)(s.$,{colorScheme:"blue",onClick:()=>{const e=document.querySelector("form"),t=new FormData(e);(async e=>{try{null!==oe&&void 0!==oe&&oe.id?(await M.FH.put("/admin/i18n/languages/".concat(oe.id),e),se({title:"Jazyk aktualizov\xe1n",description:"Jazyk byl \xfasp\u011b\u0161n\u011b aktualizov\xe1n",status:"success",duration:3e3})):(await M.FH.post("/admin/i18n/languages",e),se({title:"Jazyk vytvo\u0159en",description:"Nov\xfd jazyk byl \xfasp\u011b\u0161n\u011b vytvo\u0159en",status:"success",duration:3e3})),await le(),te(),re(null)}catch(t){se({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed jazyka",description:"Nepoda\u0159ilo se ulo\u017eit jazyk",status:"error",duration:3e3})}})(Object.fromEntries(t.entries()))},children:"Ulo\u017eit"})]})]})]}),(0,L.jsxs)(y.aF,{isOpen:ne,onClose:ie,children:[(0,L.jsx)(b.m,{}),(0,L.jsxs)(f.$,{children:[(0,L.jsx)(j.r,{children:null!==oe&&void 0!==oe&&oe.id?"Upravit p\u0159eklad":"P\u0159idat p\u0159eklad"}),(0,L.jsx)(g.s,{}),(0,L.jsx)(x.c,{children:(0,L.jsxs)(w.T,{spacing:4,children:[(0,L.jsxs)(d.MJ,{isRequired:!0,children:[(0,L.jsx)(u.l,{children:"Kl\xed\u010d"}),(0,L.jsx)(h.p,{defaultValue:(null===oe||void 0===oe?void 0:oe.key)||"",placeholder:"nav.home, form.required..."})]}),(0,L.jsxs)(d.MJ,{isRequired:!0,children:[(0,L.jsx)(u.l,{children:"Jazyk"}),(0,L.jsx)(k.l,{defaultValue:(null===oe||void 0===oe?void 0:oe.language_code)||"",children:e.map(e=>(0,L.jsx)("option",{value:e.code,children:e.native_name},e.code))})]}),(0,L.jsxs)(d.MJ,{isRequired:!0,children:[(0,L.jsx)(u.l,{children:"Hodnota"}),(0,L.jsx)(D.T,{defaultValue:(null===oe||void 0===oe?void 0:oe.value)||"",placeholder:"P\u0159elo\u017een\xfd text...",rows:3})]}),(0,L.jsxs)(d.MJ,{children:[(0,L.jsx)(u.l,{children:"Kontext"}),(0,L.jsxs)(k.l,{defaultValue:(null===oe||void 0===oe?void 0:oe.context)||"",children:[(0,L.jsx)("option",{value:"",children:"\u017d\xe1dn\xfd"}),(0,L.jsx)("option",{value:"common",children:"Obecn\xe9"}),(0,L.jsx)("option",{value:"nav",children:"Navigace"}),(0,L.jsx)("option",{value:"admin",children:"Admin"}),(0,L.jsx)("option",{value:"form",children:"Formul\xe1\u0159e"}),(0,L.jsx)("option",{value:"content",children:"Obsah"}),(0,L.jsx)("option",{value:"match",children:"Z\xe1pasy"}),(0,L.jsx)("option",{value:"team",children:"T\xfdmy"}),(0,L.jsx)("option",{value:"gallery",children:"Galerie"}),(0,L.jsx)("option",{value:"search",children:"Vyhled\xe1v\xe1n\xed"}),(0,L.jsx)("option",{value:"pagination",children:"Str\xe1nkov\xe1n\xed"}),(0,L.jsx)("option",{value:"date",children:"Datum"}),(0,L.jsx)("option",{value:"auth",children:"Autentizace"}),(0,L.jsx)("option",{value:"error",children:"Chyby"})]})]})]})}),(0,L.jsxs)(v.j,{children:[(0,L.jsx)(s.$,{variant:"ghost",onClick:ie,children:"Zru\u0161it"}),(0,L.jsx)(s.$,{colorScheme:"blue",onClick:()=>{const e=document.querySelector("form"),t=new FormData(e);(async e=>{try{null!==oe&&void 0!==oe&&oe.id?(await M.FH.put("/admin/i18n/translations/".concat(oe.id),e),se({title:"P\u0159eklad aktualizov\xe1n",description:"P\u0159eklad byl \xfasp\u011b\u0161n\u011b aktualizov\xe1n",status:"success",duration:3e3})):(await M.FH.post("/admin/i18n/translations",e),se({title:"P\u0159eklad vytvo\u0159en",description:"Nov\xfd p\u0159eklad byl \xfasp\u011b\u0161n\u011b vytvo\u0159en",status:"success",duration:3e3})),await ce(),ie(),re(null)}catch(t){se({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed p\u0159ekladu",description:"Nepoda\u0159ilo se ulo\u017eit p\u0159eklad",status:"error",duration:3e3})}})(Object.fromEntries(t.entries()))},children:"Ulo\u017eit"})]})]})]})]})}},66286:(e,t,n)=>{n.d(t,{Dq:()=>o,ZG:()=>c,bW:()=>d,iV:()=>r,rx:()=>l,sJ:()=>s});var a=n(46291);function i(e){var t,n,a,i,o,r,s,l,c,d,u,h,m,p,x,g,v,j,b,y,f,k,_,w,z,S,A,C,E,T,D,N,R,F,P,I,M,L,W,U,O;if(!e)return e;const q=null!==(t=e.id)&&void 0!==t?t:e.ID;return{id:"string"===typeof q?Number(q):q,first_name:null!==(n=null!==(a=e.first_name)&&void 0!==a?a:e.FirstName)&&void 0!==n?n:"",last_name:null!==(i=null!==(o=e.last_name)&&void 0!==o?o:e.LastName)&&void 0!==i?i:"",position:null!==(r=null!==(s=e.position)&&void 0!==s?s:e.Position)&&void 0!==r?r:void 0,jersey_number:null!==(l=null!==(c=e.jersey_number)&&void 0!==c?c:e.JerseyNumber)&&void 0!==l?l:void 0,image_url:null!==(d=null!==(u=e.image_url)&&void 0!==u?u:e.ImageURL)&&void 0!==d?d:void 0,gender:null!==(h=null!==(m=e.gender)&&void 0!==m?m:e.Gender)&&void 0!==h?h:void 0,is_active:Boolean(null===(p=null!==(x=e.is_active)&&void 0!==x?x:e.IsActive)||void 0===p||p),nationality:null!==(g=null!==(v=e.nationality)&&void 0!==v?v:e.Nationality)&&void 0!==g?g:void 0,date_of_birth:null!==(j=null!==(b=e.date_of_birth)&&void 0!==b?b:e.DateOfBirth)&&void 0!==j?j:void 0,height:null!==(y=null!==(f=e.height)&&void 0!==f?f:e.Height)&&void 0!==y?y:void 0,weight:null!==(k=null!==(_=e.weight)&&void 0!==_?_:e.Weight)&&void 0!==k?k:void 0,email:null!==(w=null!==(z=e.email)&&void 0!==z?z:e.Email)&&void 0!==w?w:void 0,phone:null!==(S=null!==(A=e.phone)&&void 0!==A?A:e.Phone)&&void 0!==S?S:void 0,team_id:null!==(C=null!==(E=null!==(T=e.team_id)&&void 0!==T?T:e.TeamID)&&void 0!==E?E:null!==(D=null===(N=e.team)||void 0===N?void 0:N.id)&&void 0!==D?D:null===(R=e.Team)||void 0===R?void 0:R.ID)&&void 0!==C?C:void 0,team:e.team||e.Team?{id:null!==(F=null===(P=e.team)||void 0===P?void 0:P.id)&&void 0!==F?F:null===(I=e.Team)||void 0===I?void 0:I.ID,name:null!==(M=null!==(L=null===(W=e.team)||void 0===W?void 0:W.name)&&void 0!==L?L:null===(U=e.Team)||void 0===U?void 0:U.Name)&&void 0!==M?M:null===(O=e.Team)||void 0===O?void 0:O.name}:void 0}}async function o(e){let t="/players";const n=new URLSearchParams;e&&!1===e.active&&n.set("active","false"),e&&null!=e.team_id&&n.set("team_id",String(e.team_id)),Array.from(n.keys()).length>0&&(t+="?".concat(n.toString()));const o=await a.Ay.get(t);return((Array.isArray(o.data)?o.data:o.data.data||o.data.items)||[]).map(i)}async function r(e){return i((await a.Ay.get("/players/".concat(e))).data)}async function s(){const e=await a.Ay.get("/sponsors");return Array.isArray(e.data)?e.data:e.data.data}async function l(e){return(await a.Ay.post("/contact",e)).data}async function c(e,t){const n={email:e};try{var i,o;const e=null===(i=window)||void 0===i||null===(o=i.location)||void 0===o?void 0:o.origin;e&&(n.site_base_url=e)}catch(r){}t&&(n.preferences=t);return(await a.Ay.post("/newsletter/subscribe",n)).data}async function d(){const e=await a.Ay.get("/categories");return Array.isArray(e.data)?e.data:e.data.data}},66776:(e,t,n)=>{n.d(t,{C_:()=>r,TS:()=>s,UI:()=>o});var a=n(65043),i=n(30502);function o(e){let{data:t,storageKey:n,onSave:o,onError:r,debounceMs:s=2e3,enabled:l=!0,requiresId:c=!1}=e;const d=(0,i.d)(),[u,h]=(0,a.useState)("idle"),[m,p]=(0,a.useState)(null),[x,g]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),b=(0,a.useRef)(),y=(0,a.useRef)(""),f=(0,a.useRef)(""),k=(0,a.useRef)(!1),_=(0,a.useRef)(null),w=(0,a.useRef)();(0,a.useEffect)(()=>{try{const e=localStorage.getItem(n);if(e){const t=JSON.parse(e);if(g(!0),t.timestamp){const e=Math.floor((Date.now()-t.timestamp)/6e4);j(e)}}}catch(e){console.warn("Failed to check for draft:",e)}},[n]);const z=(0,a.useCallback)(e=>{try{const t={data:e,timestamp:Date.now(),version:1};localStorage.setItem(n,JSON.stringify(t)),g(!0),j(0)}catch(t){console.error("Failed to save to localStorage:",t)}},[n]),S=(0,a.useCallback)(async e=>{if(!c||e.id)if(k.current)console.log("Save already in progress, skipping...");else try{k.current=!0,h("saving");const t=await o(e);h("saved"),p(new Date),null!==t&&void 0!==t&&t.id&&!e.id&&console.log("Draft saved with new ID:",t.id),setTimeout(()=>h("idle"),2e3)}catch(i){if(console.error("Auto-save error:",i),h("error"),r)r(i);else{var t;const e=null===i||void 0===i||null===(t=i.response)||void 0===t?void 0:t.status;var n,a;if(401!==e&&403!==e)d({title:"Automatick\xe9 ulo\u017een\xed selhalo",description:(null===i||void 0===i||null===(n=i.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.error)||(null===i||void 0===i?void 0:i.message)||"Koncept je ulo\u017een lok\xe1ln\u011b",status:"warning",duration:3e3,isClosable:!0})}setTimeout(()=>h("idle"),3e3)}finally{k.current=!1}else console.log("Skipping backend save - no ID yet")},[o,r,d,c]);(0,a.useEffect)(()=>{if(l&&_.current!==t)return _.current=t,w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{try{const e=JSON.stringify(t);e!==y.current&&(y.current=e,z(t))}catch(e){console.error("Local draft serialize error:",e)}},300),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{try{const e=JSON.stringify(t);e!==f.current&&(f.current=e,S(t))}catch(e){console.error("Backend draft serialize error:",e)}},s),()=>{b.current&&clearTimeout(b.current),w.current&&clearTimeout(w.current)}},[t,l,s,z,S]);const A=(0,a.useCallback)(async()=>{b.current&&clearTimeout(b.current),z(t),await S(t)},[t,z,S]),C=(0,a.useCallback)(()=>{try{localStorage.removeItem(n),g(!1),j(null),b.current&&clearTimeout(b.current)}catch(e){console.error("Failed to clear draft:",e)}},[n]);return(0,a.useEffect)(()=>()=>{b.current&&clearTimeout(b.current),w.current&&clearTimeout(w.current)},[]),{saveStatus:u,lastSaved:m,forceSave:A,clearDraft:C,hasDraft:x,draftAge:v}}function r(e){try{const t=localStorage.getItem(e);if(!t)return null;return JSON.parse(t).data||null}catch(t){return console.error("Failed to load draft:",t),null}}function s(e){try{const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t);if(!n.timestamp)return null;const a=Math.floor((Date.now()-n.timestamp)/6e4);return{timestamp:n.timestamp,age:a}}catch(t){return console.error("Failed to get draft metadata:",t),null}}},67407:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_});var a=n(65043),i=n(32077),o=n(87139),r=n(22107),s=n(98662),l=n(44093),c=n(98939),d=n(82459),u=n(73212),h=n(25011),m=n(33572),p=n(96148),x=n(10202),g=n(28846),v=n(39081),j=n(1009),b=n(73216),y=n(70579);const f=[{id:"unified",name:"Unified",description:"Klasick\xfd a univerz\xe1ln\xed styl s grid layoutem, ide\xe1ln\xed pro v\u011bt\u0161inu klub\u016f",features:["Grid layout pro \u010dl\xe1nky","Panel nejbli\u017e\u0161\xedho z\xe1pasu","T\u0159i sloupce obsahu","Sekce sponzor\u016f"],recommended:!0,imageUrl:"/dist/img/style-preview-unified.jpg"},{id:"magazine",name:"Magazine",description:"Modern\xed magaz\xednov\xfd styl s barevn\xfdmi pruhy a dynamick\xfdm layoutem",features:["Barevn\xe9 klubov\xe9 pruhy","Magaz\xednov\xfd header","R\u016fzn\xe9 velikosti karet","Modern\xed navigace"],recommended:!1,imageUrl:"/dist/img/style-preview-magazine.jpg"},{id:"pro",name:"Pro",description:"Pr\xe9miov\xfd styl s fullscreen hero obrazem pro maxim\xe1ln\xed dojem",features:["Fullscreen hero slideshow","Premium vzhled","Horizont\xe1ln\xed scrollery","Velk\xe9 vizu\xe1ln\xed prvky"],recommended:!1,imageUrl:"/dist/img/style-preview-pro.jpg"},{id:"edge",name:"Edge",description:"Minimalistick\xfd a modern\xed full-width design",features:["Full-width layout","Minimalistick\xfd design","Modern\xed dla\u017edice","Sticky navigace"],recommended:!1,imageUrl:"/dist/img/style-preview-edge.jpg"}],k={clubId:"441d3783-06aa-436a-b438-359300ee0371",clubName:"FC Bizoni UH",clubLogo:"/dist/img/logo-club-empty.svg",primaryColor:"#1e40af",secondaryColor:"#dc2626",youtube:"https://www.youtube.com/@FCBizoniUH",instagram:"https://www.instagram.com/fcbizoni_uh/",facebook:"https://www.facebook.com/bizoniuh/?locale=cs_CZ",gallery:"https://eu.zonerama.com/Fcbizoni/1419417",maps:"https://www.google.com/maps/place/Sportovi%C5%A1t%C4%9B+m%C4%9Bsta+Uhersk%C3%A9+Hradi%C5%A1t%C4%9B/@49.066982,17.4702993,19.5z/data=!4m6!3m5!1s0x4713144f4e888bd3:0xf6b552dcecd165df!8m2!3d49.0669271!4d17.4708283!16s%2Fg%2F1tdvc9kh?entry=ttu&g_ep=EgoyMDI1MTAwOC4wIKXMDSoASAFQAw%3D%3D",articles:[{title:"Velk\xe9 v\xedt\u011bzstv\xed v derby",date:"15. b\u0159ezna 2024",category:"Z\xe1pasy"},{title:"Nov\xe1 posila v t\xfdmu",date:"12. b\u0159ezna 2024",category:"Aktuality"},{title:"Pozv\xe1nka na tr\xe9nink ml\xe1de\u017ee",date:"10. b\u0159ezna 2024",category:"Ml\xe1de\u017e"}],nextMatch:{opponent:"TJ Slov\xe1cko B",date:"2024-03-20",time:"17:00",location:"Sportovi\u0161te m\u011bsta Uhersk\xe9 Hradi\u0161t\u011b"}},_=()=>{var e,t;const[n,_]=(0,a.useState)(null),w=(0,b.Zp)(),z=(0,l.dU)("white","gray.800"),S=(0,l.dU)("gray.200","gray.600");return(0,y.jsx)(r.a,{minH:"100vh",bg:"gray.50",py:8,children:(0,y.jsx)(c.m,{maxW:"7xl",children:(0,y.jsxs)(x.T,{spacing:8,align:"stretch",children:[(0,y.jsxs)(r.a,{textAlign:"center",children:[(0,y.jsx)(g.D,{size:"2xl",mb:3,children:"Vyberte styl webu"}),(0,y.jsx)(v.E,{fontSize:"lg",color:"gray.600",children:"Zvolte vzhled, kter\xfd nejl\xe9pe reprezentuje v\xe1\u0161 klub. M\u016f\u017eete kdykoliv zm\u011bnit v administraci."})]}),(0,y.jsx)(u.r,{columns:[1,1,2],spacing:8,children:f.map(e=>(0,y.jsxs)(r.a,{borderWidth:n===e.id?"3px":"1px",borderColor:n===e.id?"blue.500":S,borderRadius:"xl",overflow:"hidden",bg:z,cursor:"pointer",onClick:()=>{return t=e.id,void _(t);var t},transition:"all 0.3s",_hover:{transform:"translateY(-4px)",boxShadow:"xl",borderColor:"blue.400"},position:"relative",children:[e.recommended&&(0,y.jsx)(o.E,{colorScheme:"green",position:"absolute",top:4,right:4,zIndex:2,fontSize:"sm",px:3,py:1,children:"Doporu\u010deno"}),n===e.id&&(0,y.jsx)(r.a,{position:"absolute",top:4,left:4,zIndex:2,bg:"blue.500",color:"white",borderRadius:"full",p:2,children:(0,y.jsx)(h.I,{as:j.YrT,boxSize:5})}),(0,y.jsx)(i.g,{ratio:16/9,children:(0,y.jsx)(m._,{src:e.imageUrl,alt:"".concat(e.name," style preview"),objectFit:"cover",fallback:(0,y.jsx)(r.a,{bg:"gray.200",w:"100%",h:"100%",display:"flex",alignItems:"center",justifyContent:"center",children:(0,y.jsxs)(x.T,{spacing:2,children:[(0,y.jsx)(v.E,{fontWeight:"bold",fontSize:"2xl",color:"gray.500",children:e.name}),(0,y.jsx)(v.E,{fontSize:"sm",color:"gray.500",children:"N\xe1hled bude p\u0159id\xe1n"})]})})})}),(0,y.jsxs)(x.T,{align:"stretch",p:6,spacing:4,children:[(0,y.jsx)(p.z,{justify:"space-between",align:"flex-start",children:(0,y.jsxs)(x.T,{align:"stretch",spacing:1,flex:1,children:[(0,y.jsx)(g.D,{size:"lg",children:e.name}),(0,y.jsx)(v.E,{fontSize:"sm",color:"gray.600",children:e.description})]})}),(0,y.jsx)(d.c,{}),(0,y.jsxs)(x.T,{align:"stretch",spacing:2,children:[(0,y.jsx)(v.E,{fontWeight:"semibold",fontSize:"sm",color:"gray.700",children:"Kl\xed\u010dov\xe9 vlastnosti:"}),e.features.map((e,t)=>(0,y.jsxs)(p.z,{spacing:2,children:[(0,y.jsx)(h.I,{as:j.YrT,color:"green.500"}),(0,y.jsx)(v.E,{fontSize:"sm",children:e})]},t))]}),(0,y.jsx)(s.$,{variant:"outline",leftIcon:(0,y.jsx)(j.HaR,{}),onClick:t=>{t.stopPropagation(),window.open("/?style=".concat(e.id,"&preview=1"),"_blank")},size:"sm",children:"\u017div\xfd n\xe1hled"})]})]},e.id))}),(0,y.jsxs)(r.a,{bg:z,borderRadius:"xl",borderWidth:"1px",borderColor:S,p:8,children:[(0,y.jsx)(g.D,{size:"lg",mb:4,children:"N\xe1hled s va\u0161imi daty"}),(0,y.jsxs)(v.E,{fontSize:"sm",color:"gray.600",mb:6,children:["Uk\xe1zka stylu ",n?null===(e=f.find(e=>e.id===n))||void 0===e?void 0:e.name:"vyberte styl v\xfd\u0161e"," s uk\xe1zkov\xfdmi daty klubu FC Bizoni UH"]}),n&&(0,y.jsxs)(r.a,{children:[(0,y.jsxs)(p.z,{spacing:4,mb:6,p:4,bg:"gray.50",borderRadius:"lg",children:[(0,y.jsx)(m._,{src:k.clubLogo,alt:k.clubName,boxSize:"64px",borderRadius:"md"}),(0,y.jsxs)(x.T,{align:"stretch",spacing:1,children:[(0,y.jsx)(g.D,{size:"md",children:k.clubName}),(0,y.jsxs)(p.z,{spacing:3,children:[(0,y.jsx)(o.E,{colorScheme:"blue",children:"Fotbal"}),(0,y.jsx)(o.E,{colorScheme:"green",children:"Aktivn\xed"})]})]})]}),(0,y.jsx)(u.r,{columns:[1,2,3],spacing:4,children:k.articles.map((e,t)=>(0,y.jsxs)(r.a,{p:4,borderWidth:"1px",borderRadius:"lg",borderColor:S,_hover:{boxShadow:"md"},children:[(0,y.jsx)(o.E,{colorScheme:"blue",mb:2,children:e.category}),(0,y.jsx)(g.D,{size:"sm",mb:1,noOfLines:2,children:e.title}),(0,y.jsx)(v.E,{fontSize:"xs",color:"gray.500",children:e.date})]},t))}),(0,y.jsxs)(r.a,{mt:6,p:6,bg:"blue.50",borderRadius:"lg",borderWidth:"1px",borderColor:"blue.200",children:[(0,y.jsx)(v.E,{fontSize:"sm",fontWeight:"semibold",color:"blue.700",mb:2,children:"NEJBLI\u017d\u0160\xcd Z\xc1PAS"}),(0,y.jsx)(g.D,{size:"lg",mb:2,children:k.nextMatch.opponent}),(0,y.jsxs)(p.z,{spacing:4,fontSize:"sm",color:"gray.700",children:[(0,y.jsx)(v.E,{children:new Date(k.nextMatch.date).toLocaleDateString("cs-CZ")}),(0,y.jsx)(v.E,{children:"\u2022"}),(0,y.jsx)(v.E,{children:k.nextMatch.time})]}),(0,y.jsx)(v.E,{fontSize:"sm",color:"gray.600",mt:2,children:k.nextMatch.location})]}),(0,y.jsxs)(p.z,{spacing:4,mt:6,justify:"center",children:[(0,y.jsx)(s.$,{size:"sm",colorScheme:"facebook",leftIcon:(0,y.jsx)(j.HaR,{}),children:"Facebook"}),(0,y.jsx)(s.$,{size:"sm",colorScheme:"pink",leftIcon:(0,y.jsx)(j.HaR,{}),children:"Instagram"}),(0,y.jsx)(s.$,{size:"sm",colorScheme:"red",leftIcon:(0,y.jsx)(j.HaR,{}),children:"YouTube"})]})]})]}),(0,y.jsxs)(p.z,{justify:"space-between",children:[(0,y.jsx)(s.$,{variant:"ghost",onClick:()=>w("/setup"),children:"Zp\u011bt na nastaven\xed"}),(0,y.jsxs)(s.$,{colorScheme:"blue",size:"lg",isDisabled:!n,onClick:()=>{n&&w("/setup?style=".concat(n))},rightIcon:(0,y.jsx)(h.I,{as:j.YrT}),children:["Pokra\u010dovat s ",n?null===(t=f.find(e=>e.id===n))||void 0===t?void 0:t.name:"vybran\xfdm stylem"]})]})]})})})}},67658:(e,t,n)=>{n.r(t),n.d(t,{default:()=>L});var a=n(89379),i=n(65043),o=n(87139),r=n(22107),s=n(98662),l=n(82459),c=n(73225),d=n(76668),u=n(73212),h=n(33572),m=n(35699),p=n(61724),x=n(96148),g=n(10202),v=n(98481),j=n(14566),b=n(31411),y=n(10227),f=n(51794),k=n(3109),_=n(19077),w=n(30502),z=n(28846),S=n(39081),A=n(74117),C=n(6583),E=n(74770),T=n(3200),D=n(18786),N=n(25189),R=n(90944),F=n(46291),P=n(2367),I=n(88500),M=n(70579);const L=()=>{var e,t,n,L;const{t:W}=(0,A.Bd)(),U=(0,w.d)(),[O,q]=(0,i.useState)(!1),[K,B]=(0,i.useState)(!1),[Z,V]=(0,i.useState)({}),[H,$]=(0,i.useState)(""),[J,G]=(0,i.useState)(!1),[X,Y]=(0,i.useState)({}),[Q,ee]=(0,i.useState)(0),[te,ne]=(0,i.useState)(""),[ae,ie]=(0,i.useState)(""),[oe,re]=(0,i.useState)(""),[se,le]=(0,i.useState)(!1),[ce,de]=(0,i.useState)(null);(0,i.useEffect)(()=>{q(!0),(0,E.rC)().then(e=>{const t=e||{},n=(0,a.A)({},t);(!n.storage_warn_threshold||n.storage_warn_threshold<=0)&&(n.storage_warn_threshold=80),(!n.storage_critical_threshold||n.storage_critical_threshold<=0)&&(n.storage_critical_threshold=95),V(n)}).catch(()=>{U({title:"Chyba",description:"Nepoda\u0159ilo se na\u010d\xedst nastaven\xed",status:"error"})}).finally(()=>q(!1)),(0,D.Z)().then(e=>Y(e||{})).catch(()=>{}).finally(()=>{}),ue()},[U]),(0,i.useEffect)(()=>{const e=window.location.hash.replace("#",""),t={obecne:0,"socialni-site":1,videa:2,smtp:3,analytika:4,seo:5};void 0!==t[e]&&ee(t[e])},[]);const ue=async()=>{try{var e;const t=await F.Ay.get("/insights/config");if(de(t.data),null!==(e=t.data)&&void 0!==e&&e.website_id&&ne(t.data.website_id),!ae){const e=window.location.hostname;ie(e)}!oe&&Z.club_name&&re(Z.club_name)}catch(t){console.error("Failed to fetch Umami config:",t)}};(0,i.useEffect)(()=>{Y(e=>{const t=(0,a.A)({},e);let n=!1;return!t.site_title&&Z.club_name&&(t.site_title=Z.club_name,n=!0),!t.default_og_image_url&&Z.club_logo_url&&(t.default_og_image_url=Z.club_logo_url,n=!0),n?t:e})},[Z.club_name,Z.club_logo_url]);const he=e=>t=>{V(n=>(0,a.A)((0,a.A)({},n),{},{[e]:t.target.value}))},me=e=>t=>{const n="checkbox"===t.target.type?t.target.checked:t.target.value;Y(t=>(0,a.A)((0,a.A)({},t),{},{[e]:n}))},pe=e=>t=>{const n=t.target.value,i=""===n?void 0:Number(n);V(t=>(0,a.A)((0,a.A)({},t),{},{[e]:Number.isFinite(i)?i:void 0}))},xe=e=>t=>{const n=t.target.checked;V(t=>(0,a.A)((0,a.A)({},t),{},{[e]:n}))},ge=e=>t=>{V(n=>(0,a.A)((0,a.A)({},n),{},{[e]:t.target.value}))},ve=async()=>{B(!0);try{var e,t;const u=(0,a.A)((0,a.A)({club_name:Z.club_name,club_logo_url:Z.club_logo_url,facebook_url:Z.facebook_url,instagram_url:Z.instagram_url,youtube_url:Z.youtube_url,gallery_url:Z.gallery_url,zonerama_url:Z.zonerama_url,smtp_host:Z.smtp_host,smtp_port:Z.smtp_port,smtp_user:Z.smtp_user,smtp_password:Z.smtp_password,smtp_from:Z.smtp_from,smtp_from_name:Z.smtp_from_name,smtp_encryption:Z.smtp_encryption},"boolean"===typeof Z.smtp_auth?{smtp_auth:Z.smtp_auth}:{}),{},{smtp_skip_verify:Z.smtp_skip_verify,videos_module_enabled:Z.videos_module_enabled,videos_source:Z.videos_source,contact_address:Z.contact_address,contact_city:Z.contact_city,contact_zip:Z.contact_zip,contact_country:Z.contact_country,contact_phone:Z.contact_phone,contact_email:Z.contact_email,location_latitude:Z.location_latitude,location_longitude:Z.location_longitude,map_zoom_level:Z.map_zoom_level,show_map_on_homepage:"number"===typeof Z.location_latitude&&"number"===typeof Z.location_longitude,map_style:Z.map_style,frontend_base_url:Z.frontend_base_url,api_base_url:Z.api_base_url,finished_match_display_days:Z.finished_match_display_days,storage_warn_threshold:(null!==(e=Z.storage_warn_threshold)&&void 0!==e?e:0)>0?Z.storage_warn_threshold:80,storage_critical_threshold:(null!==(t=Z.storage_critical_threshold)&&void 0!==t?t:0)>0?Z.storage_critical_threshold:95,error_review_admin_token:Z.error_review_admin_token,error_review_ingest_token:Z.error_review_ingest_token}),h=await(0,E.CX)(u);V(e=>(0,a.A)((0,a.A)({},e),h)),U({title:"Ulo\u017eeno",description:"Nastaven\xed bylo \xfasp\u011b\u0161n\u011b aktualizov\xe1no",status:"success"});try{await(0,R.E)()}catch(n){}try{const e=String(h.frontend_base_url||Z.frontend_base_url||"").replace(/\/$/,"");let t=String(h.api_base_url||Z.api_base_url||"").trim();if(e||t){try{const n=new URL(t||"",e||("undefined"!==typeof window?window.location.origin:""));/\/api\//.test(n.pathname)||(n.pathname=n.pathname.replace(/\/$/,"")+"/api/v1"),t=n.toString()}catch(i){}try{localStorage.setItem("fc_frontend_base_url",e)}catch(o){}try{localStorage.setItem("fc_api_base_url",t)}catch(r){}try{localStorage.setItem("api_base_url",t)}catch(s){}try{F.Ay.defaults.baseURL=t}catch(l){}setTimeout(()=>{try{window.location.reload()}catch(e){}},600)}try{const e=h.error_review_ingest_token||Z.error_review_ingest_token;e&&localStorage.setItem("fc_error_ingest_token",String(e))}catch(c){}}catch(d){}}catch(u){U({title:"Chyba",description:(null===u||void 0===u?void 0:u.message)||"Ulo\u017een\xed nastaven\xed se nezda\u0159ilo",status:"error"})}finally{B(!1)}};return(0,M.jsx)(C.A,{children:(0,M.jsxs)(r.a,{children:[(0,M.jsx)(z.D,{size:"lg",mb:4,children:"Nastaven\xed webu"}),(0,M.jsxs)(k.t,{variant:"enclosed",colorScheme:"brand",index:Q,onChange:ee,children:[(0,M.jsx)(b.w,{flexWrap:"wrap",children:["Obecn\xe9","Soci\xe1ln\xed s\xedt\u011b","Videa","SMTP","Analytika","SEO"].map(e=>(0,M.jsx)(j.o,{_selected:{bg:"brand.primary",color:"text.onPrimary",borderColor:"brand.primary"},_hover:{bg:"rgba(0,0,0,0.04)",borderColor:"brand.500"},children:e},e))}),(0,M.jsxs)(f.T,{children:[(0,M.jsx)(y.K,{children:(0,M.jsxs)(g.T,{align:"stretch",spacing:4,children:[(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"N\xe1zev klubu"}),(0,M.jsx)(m.p,{value:Z.club_name||"",onChange:he("club_name")})]}),(0,M.jsx)(z.D,{size:"sm",children:"\xdalo\u017ei\u0161t\u011b soubor\u016f"}),(0,M.jsxs)(u.r,{columns:{base:1,md:3},spacing:4,children:[(0,M.jsxs)(c.MJ,{children:[(0,M.jsxs)(d.l,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,M.jsx)(r.a,{children:"Varov\xe1n\xed p\u0159i (%)"}),(0,M.jsx)(P.tX,{label:"Jak funguj\xed limity",title:"Varovn\xe9 a kritick\xe9 limity \xfalo\u017ei\u0161t\u011b",items:["Varov\xe1n\xed (nap\u0159. 80 %) upozorn\xed administr\xe1tory, \u017ee se bl\xed\u017e\xedte limitu \xfalo\u017ei\u0161t\u011b.","Kritick\xe9 (nap\u0159. 95 %) je siln\u011bj\u0161\xed upozorn\u011bn\xed \u2013 v krajn\xedm p\u0159\xedpad\u011b m\u016f\u017ee b\xfdt nahr\xe1v\xe1n\xed soubor\u016f omezeno.","Doporu\u010den\xe9 hodnoty jsou 80 % / 95 % \u2013 p\u0159\xedli\u0161 n\xedzk\xe9 hodnoty vedou k \u010dast\xfdm upozorn\u011bn\xedm."]})]}),(0,M.jsx)(m.p,{type:"number",min:0,max:100,value:(null!==(e=Z.storage_warn_threshold)&&void 0!==e?e:0)>0?Z.storage_warn_threshold:80,onChange:pe("storage_warn_threshold")})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"Kritick\xe9 p\u0159i (%)"}),(0,M.jsx)(m.p,{type:"number",min:0,max:100,value:(null!==(t=Z.storage_critical_threshold)&&void 0!==t?t:0)>0?Z.storage_critical_threshold:95,onChange:pe("storage_critical_threshold")})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"P\u0159ednastavit"}),(0,M.jsx)(s.$,{onClick:()=>{V(e=>(0,a.A)((0,a.A)({},e),{},{storage_warn_threshold:80,storage_critical_threshold:95}))},variant:"outline",children:"80 % / 95 %"})]})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"Logo klubu"}),(0,M.jsxs)(g.T,{align:"stretch",spacing:3,children:[(0,M.jsx)(I.A,{label:"Logo klubu",description:"Nahrajte logo ve form\xe1tu PNG, SVG nebo PDF (max. 5 MB).",accept:"image/png,image/svg+xml,application/pdf",multiple:!1,maxFiles:1,maxFileSizeMB:5,allowUrlImport:!1,onChange:e=>{const t=e[e.length-1];V(e=>(0,a.A)((0,a.A)({},e),{},{club_logo_url:(null===t||void 0===t?void 0:t.url)||""}))}}),Z.club_logo_url&&(0,M.jsxs)(x.z,{align:"center",spacing:3,children:[(0,M.jsx)(h._,{src:(0,N.uq)(Z.club_logo_url)||Z.club_logo_url,alt:"Logo",boxSize:"56px",borderRadius:"md"}),(0,M.jsx)(S.E,{fontSize:"sm",color:"gray.500",children:Z.club_logo_url})]})]})]}),(0,M.jsx)(l.c,{}),(0,M.jsx)(z.D,{size:"sm",children:"Nastaven\xed URL"}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsxs)(d.l,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,M.jsx)(r.a,{children:"URL webu"}),(0,M.jsx)(P.tX,{label:"Jak vyplnit",title:"Doporu\u010den\xed pro adresu webu",items:["Pou\u017eijte fin\xe1ln\xed dom\xe9nu klubu (nap\u0159. https://www.vasklub.cz).","Nezad\xe1vejte /api \u2013 API adresa se dopln\xed a spravuje zvl\xe1\u0161\u0165.","V produkci v\u017edy pou\u017e\xedvejte zabezpe\u010den\xe9 HTTPS."]})]}),(0,M.jsx)(m.p,{value:Z.frontend_base_url||"",onChange:he("frontend_base_url"),placeholder:"https://www.vasklub.cz"})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"API URL"}),(0,M.jsx)(m.p,{value:Z.api_base_url||"",onChange:he("api_base_url"),placeholder:"https://api.vasklub.cz/api/v1"}),(0,M.jsx)(c.eK,{children:"Ujist\u011bte se, \u017ee adresa kon\u010d\xed na /api/v1"})]}),(0,M.jsx)(z.D,{size:"sm",children:"Zobrazen\xed z\xe1pas\u016f"}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"Po\u010det dn\xed zobrazen\xed dokon\u010den\xfdch z\xe1pas\u016f"}),(0,M.jsx)(m.p,{type:"number",min:0,max:30,value:null!==(n=Z.finished_match_display_days)&&void 0!==n?n:2,onChange:e=>{const t=parseInt(e.target.value,10);V(e=>(0,a.A)((0,a.A)({},e),{},{finished_match_display_days:isNaN(t)?2:t}))}}),(0,M.jsx)(c.eK,{children:"Po\u010det dn\xed, po kter\xe9 se na \xfavodn\xed str\xe1nce zobraz\xed dokon\u010den\xfd z\xe1pas s v\xfdsledkem m\xedsto p\u0159\xed\u0161t\xedho z\xe1pasu (v\xfdchoz\xed: 2 dny)."})]}),(0,M.jsx)(x.z,{children:(0,M.jsx)(s.$,{onClick:ve,isLoading:K,bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Ulo\u017eit nastaven\xed"})})]})}),(0,M.jsx)(y.K,{children:(0,M.jsxs)(g.T,{align:"stretch",spacing:4,children:[(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"Facebook URL"}),(0,M.jsx)(m.p,{value:Z.facebook_url||"",onChange:he("facebook_url")})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"Instagram URL"}),(0,M.jsx)(m.p,{value:Z.instagram_url||"",onChange:he("instagram_url")})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"YouTube URL"}),(0,M.jsx)(m.p,{value:Z.youtube_url||"",onChange:he("youtube_url")}),(0,M.jsx)(c.eK,{children:"Pro automatick\xe9 na\u010d\xedt\xe1n\xed vide\xed vypl\u0148te YouTube kan\xe1l."})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsxs)(d.l,{children:[W("homepage.gallery")," URL"]}),(0,M.jsx)(m.p,{value:Z.gallery_url||"",onChange:he("gallery_url")})]}),(0,M.jsx)(x.z,{children:(0,M.jsx)(s.$,{onClick:ve,isLoading:K,bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Ulo\u017eit nastaven\xed"})})]})}),(0,M.jsx)(y.K,{children:(0,M.jsxs)(g.T,{align:"stretch",spacing:4,children:[(0,M.jsxs)(r.a,{p:4,bg:"blue.50",borderRadius:"md",borderLeft:"4px solid",borderColor:"blue.500",children:[(0,M.jsxs)(x.z,{spacing:2,mb:2,children:[(0,M.jsx)(S.E,{fontWeight:"bold",fontSize:"sm",children:"\u2139\ufe0f Sekce Videa"}),Z.videos_module_enabled&&(0,M.jsx)(o.E,{colorScheme:"green",children:"Aktivn\xed"})]}),(0,M.jsxs)(S.E,{fontSize:"sm",color:"gray.700",children:["Videa spravujte na str\xe1nce"," ",(0,M.jsx)(s.$,{as:"a",href:"/admin/videa",variant:"link",colorScheme:"blue",size:"sm",fontWeight:"bold",children:"Videa"}),". Zde nastavte zobrazen\xed na tituln\xed str\xe1nce.",Z.youtube_url&&(0,M.jsx)(S.E,{as:"span",color:"green.700",fontWeight:"semibold",ml:1,children:"Sekce se automaticky aktivuje p\u0159i vypln\u011bn\xed YouTube kan\xe1lu v tab\u011b Soci\xe1ln\xed s\xedt\u011b."})]})]}),(0,M.jsxs)(c.MJ,{display:"flex",alignItems:"center",children:[(0,M.jsx)(d.l,{mb:0,children:"Zobrazit sekci Videa na tituln\xed str\xe1nce"}),(0,M.jsx)(v.d,{isChecked:!!Z.videos_module_enabled,onChange:xe("videos_module_enabled"),colorScheme:"green"})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"Zdroj vide\xed"}),(0,M.jsxs)(p.l,{value:Z.videos_source||"auto",onChange:ge("videos_source"),children:[(0,M.jsx)("option",{value:"auto",children:"Automaticky (YouTube kan\xe1l)"}),(0,M.jsx)("option",{value:"manual",children:"Ru\u010dn\u011b (spr\xe1va v sekci Videa)"})]}),(0,M.jsx)(c.eK,{children:'Pro automatick\xfd zdroj vypl\u0148te v tab\u011b \u201eSoci\xe1ln\xed s\xedt\u011b" pole YouTube URL.'})]}),(0,M.jsx)(x.z,{children:(0,M.jsx)(s.$,{onClick:ve,isLoading:K,bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Ulo\u017eit nastaven\xed"})})]})}),(0,M.jsx)(y.K,{children:(0,M.jsxs)(g.T,{align:"stretch",spacing:4,children:[(0,M.jsxs)(u.r,{columns:{base:1,md:2},spacing:4,children:[(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"SMTP Host"}),(0,M.jsx)(m.p,{value:Z.smtp_host||"",onChange:he("smtp_host"),placeholder:"smtp.seznam.cz nebo smtp.gmail.com"}),(0,M.jsx)(c.eK,{children:"Adresa SMTP serveru. P\u0159\xedklad: smtp.seznam.cz, smtp.gmail.com, smtp.office365.com"})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"SMTP Port"}),(0,M.jsx)(m.p,{type:"number",value:null!==(L=Z.smtp_port)&&void 0!==L?L:"",onChange:pe("smtp_port"),placeholder:"587 pro TLS, 465 pro SSL, 25 bez \u0161ifrov\xe1n\xed"}),(0,M.jsx)(c.eK,{children:"Nej\u010dast\u011bji 587 (TLS/STARTTLS) nebo 465 (SSL). Port 25 je bez \u0161ifrov\xe1n\xed a \u010dasto blokovan\xfd."})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"SMTP U\u017eivatel"}),(0,M.jsx)(m.p,{value:Z.smtp_user||"",onChange:he("smtp_user"),placeholder:"v\u011bt\u0161inou cel\xe1 e\u2011mailov\xe1 adresa"}),(0,M.jsx)(c.eK,{children:"P\u0159ihla\u0161ovac\xed jm\xe9no k SMTP (obvykle e\u2011mailov\xe1 adresa). Nechte pr\xe1zdn\xe9, pokud server nevy\u017eaduje p\u0159ihl\xe1\u0161en\xed."})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"SMTP Heslo"}),(0,M.jsx)(m.p,{type:"password",value:Z.smtp_password||"",onChange:he("smtp_password"),placeholder:"heslo nebo aplika\u010dn\xed heslo"}),(0,M.jsx)(c.eK,{children:"Heslo k \xfa\u010dtu nebo aplika\u010dn\xed heslo (Gmail/Seznam/Office 365 \u010dasto vy\u017eaduj\xed). Vkl\xe1dejte bez mezer."})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"From e\u2011mail"}),(0,M.jsx)(m.p,{value:Z.smtp_from||"",onChange:he("smtp_from"),placeholder:"noreply@vasklub.cz"}),(0,M.jsx)(c.eK,{children:"Adresa odes\xedlatele uveden\xe1 v e\u2011mailech. Ide\xe1ln\u011b existuj\xedc\xed schr\xe1nka na va\u0161em SMTP serveru."})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"From jm\xe9no"}),(0,M.jsx)(m.p,{value:Z.smtp_from_name||"",onChange:he("smtp_from_name"),placeholder:"FK V\xe1\u0161 Klub"}),(0,M.jsx)(c.eK,{children:"Zobrazovan\xe9 jm\xe9no odes\xedlatele (nap\u0159. FK V\xe1\u0161 Klub)."})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"\u0160ifrov\xe1n\xed"}),(0,M.jsxs)(p.l,{value:Z.smtp_encryption||"none",onChange:ge("smtp_encryption"),children:[(0,M.jsx)("option",{value:"none",children:"\u017d\xe1dn\xe9"}),(0,M.jsx)("option",{value:"ssl",children:"SSL"}),(0,M.jsx)("option",{value:"tls",children:"TLS"})]}),(0,M.jsx)(c.eK,{children:"SSL = implicitn\xed \u0161ifrov\xe1n\xed (obvykle port 465). TLS/STARTTLS = \u0161ifrov\xe1n\xed po nav\xe1z\xe1n\xed spojen\xed (obvykle port 587)."})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"Autentizace"}),(0,M.jsxs)(p.l,{value:Z.smtp_auth||"plain",onChange:ge("smtp_auth"),children:[(0,M.jsx)("option",{value:"plain",children:"PLAIN"}),(0,M.jsx)("option",{value:"login",children:"LOGIN"}),(0,M.jsx)("option",{value:"cram-md5",children:"CRAM\u2011MD5"})]}),(0,M.jsx)(c.eK,{children:"Mechanismus p\u0159ihl\xe1\u0161en\xed k SMTP. Pokud si nejste jisti, zvolte PLAIN nebo LOGIN. N\u011bkte\u0159\xed poskytovatel\xe9 vy\u017eaduj\xed konkr\xe9tn\xed metodu."})]})]}),(0,M.jsxs)(c.MJ,{display:"flex",alignItems:"center",children:[(0,M.jsxs)(d.l,{mb:0,display:"flex",alignItems:"center",justifyContent:"space-between",flex:"1",children:[(0,M.jsx)(r.a,{children:"P\u0159esko\u010dit ov\u011b\u0159en\xed certifik\xe1tu"}),(0,M.jsx)(P.tX,{label:"Bezpe\u010dnost",title:"Kdy (ne) p\u0159eskakovat ov\u011b\u0159en\xed certifik\xe1tu",items:["Standardn\u011b ponechte kontrolu certifik\xe1tu zapnutou \u2013 chr\xe1n\xed spojen\xed se SMTP serverem.","Volbu zapn\u011bte jen p\u0159i testov\xe1n\xed na serverech se self\u2011signed nebo neplatn\xfdm certifik\xe1tem.","V produkci je p\u0159eskakov\xe1n\xed ov\u011b\u0159en\xed certifik\xe1tu nedoporu\u010den\xe9 \u2013 zvy\u0161uje riziko MITM \xfatok\u016f."]})]}),(0,M.jsx)(v.d,{isChecked:!!Z.smtp_skip_verify,onChange:xe("smtp_skip_verify")}),(0,M.jsx)(c.eK,{ml:{base:0,md:4},children:"Pokro\u010dil\xe9: povolte pouze p\u0159i chyb\xe1ch certifik\xe1tu (self\u2011signed apod.). Nedoporu\u010deno v produkci \u2013 sni\u017euje bezpe\u010dnost."})]}),(0,M.jsx)(l.c,{}),(0,M.jsxs)(x.z,{justify:"space-between",align:"center",children:[(0,M.jsx)(z.D,{size:"sm",children:"Test e\u2011mail"}),(0,M.jsx)(P.tX,{label:"Jak funguje test",title:"Co d\u011bl\xe1 testovac\xed e\u2011mail",items:["Ode\u0161le kr\xe1tk\xfd e\u2011mail pomoc\xed aktu\xe1ln\u011b vypln\u011bn\xe9ho SMTP nastaven\xed.","M\u016f\u017eete zadat libovolnou platnou adresu; pokud ji nech\xe1te pr\xe1zdnou, pou\u017eije se v\xfdchoz\xed administr\xe1torsk\xfd e\u2011mail z nastaven\xed.","Hod\xed se pro rychl\xe9 ov\u011b\u0159en\xed spr\xe1vnosti hosta, portu, \u0161ifrov\xe1n\xed a p\u0159ihla\u0161ovac\xedch \xfadaj\u016f."]})]}),(0,M.jsxs)(x.z,{children:[(0,M.jsx)(m.p,{placeholder:"test@example.com (voliteln\xe9)",value:H,onChange:e=>$(e.target.value),maxW:{base:"100%",md:"320px"}}),(0,M.jsx)(s.$,{onClick:async()=>{G(!0);try{const e={type:"newsletter"};H&&H.trim()&&(e.email=H.trim()),await(0,T.sendNewsletterTestAdvanced)(e),U({title:"Test odesl\xe1n",description:H?"Zkontrolujte schr\xe1nku ".concat(H):"Test odesl\xe1n na v\xfdchoz\xed administr\xe1torsk\xfd e\u2011mail.",status:"success",duration:5e3})}catch(n){var e,t;const a=(null===n||void 0===n||null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||(null===n||void 0===n?void 0:n.message)||"Nezn\xe1m\xe1 chyba",i=a.includes("535")||a.toLowerCase().includes("authentication failed");U({title:i?"\u26a0\ufe0f Chyba autentizace SMTP (535)":"Chyba p\u0159i odesl\xe1n\xed testu",description:i?"Zkontrolujte SMTP heslo. Ujist\u011bte se, \u017ee je spr\xe1vn\u011b zkop\xedrovan\xe9 bez mezer. N\u011bkter\xe9 poskytovatele vy\u017eaduj\xed aplika\u010dn\xed heslo m\xedsto b\u011b\u017en\xe9ho hesla.":a+" Zkuste upravit SMTP nastaven\xed.",status:"error",duration:1e4,isClosable:!0})}finally{G(!1)}},isLoading:J,children:"Odeslat test"})]}),(0,M.jsx)(l.c,{}),(0,M.jsx)(x.z,{children:(0,M.jsx)(s.$,{onClick:ve,isLoading:K,bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Ulo\u017eit nastaven\xed"})})]})}),(0,M.jsx)(y.K,{children:(0,M.jsxs)(g.T,{align:"stretch",spacing:4,children:[(0,M.jsx)(z.D,{size:"sm",children:"Webov\xe1 analytika"}),(0,M.jsx)(S.E,{fontSize:"sm",color:"gray.600",children:"Nastaven\xed sledov\xe1n\xed n\xe1v\u0161t\u011bvnosti webu pomoc\xed open-source n\xe1stroje pro webovou analytiku."}),null!==ce&&void 0!==ce&&ce.enabled&&null!==ce&&void 0!==ce&&ce.website_id?(0,M.jsxs)(r.a,{p:4,borderWidth:"1px",borderRadius:"md",bg:"green.50",borderColor:"green.200",children:[(0,M.jsx)(x.z,{spacing:2,mb:2,children:(0,M.jsx)(S.E,{fontWeight:"bold",color:"green.700",children:"\u2713 Analytika je aktivn\xed"})}),(0,M.jsxs)(S.E,{fontSize:"sm",color:"gray.700",children:["Website ID: ",(0,M.jsx)("strong",{children:ce.website_id})]})]}):(0,M.jsxs)(r.a,{p:4,borderWidth:"1px",borderRadius:"md",bg:"yellow.50",borderColor:"yellow.200",children:[(0,M.jsx)(S.E,{fontWeight:"bold",color:"yellow.700",children:"\u26a0 Analytika nen\xed nakonfigurov\xe1na"}),(0,M.jsx)(S.E,{fontSize:"sm",color:"gray.700",mt:1,children:"Vytvo\u0159te webovou str\xe1nku pro aktivaci sledov\xe1n\xed."})]}),(0,M.jsx)(l.c,{}),(0,M.jsx)(z.D,{size:"sm",children:"Vytvo\u0159it novou webovou str\xe1nku"}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"N\xe1zev webov\xe9 str\xe1nky"}),(0,M.jsx)(m.p,{value:oe,onChange:e=>re(e.target.value),placeholder:Z.club_name||"Fotbal Club"}),(0,M.jsx)(c.eK,{children:"N\xe1zev, kter\xfd se zobraz\xed v dashboardu analytiky"})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"Dom\xe9na"}),(0,M.jsx)(m.p,{value:ae,onChange:e=>ie(e.target.value),placeholder:window.location.hostname}),(0,M.jsx)(c.eK,{children:"Dom\xe9na va\u0161eho webu (nap\u0159. fotbal.example.com)"})]}),(0,M.jsxs)(x.z,{children:[(0,M.jsx)(s.$,{onClick:async()=>{if(oe&&ae){le(!0);try{const e=await F.Ay.post("/admin/insights/initialize",{name:oe,domain:ae});ne(e.data.website_id),U({title:"\xdasp\u011bch",description:"Webov\xe1 str\xe1nka pro analytiku vytvo\u0159ena! ID: ".concat(e.data.website_id),status:"success",duration:5e3}),await ue()}catch(n){var e,t;const a=(null===n||void 0===n||null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||n.message||"Vytvo\u0159en\xed selhalo";U({title:"Chyba",description:a,status:"error",duration:7e3})}finally{le(!1)}}else U({title:"Chyba",description:"Vypl\u0148te n\xe1zev i dom\xe9nu",status:"error"})},isLoading:se,bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Vytvo\u0159it webovou str\xe1nku"}),(0,M.jsx)(s.$,{onClick:ue,variant:"outline",children:"Aktualizovat stav"})]}),(0,M.jsx)(S.E,{fontSize:"xs",color:"gray.500",mt:2,children:"Pozn\xe1mka: Pro aktivaci analytiky je nutn\xe9 m\xedt nastaven\xe9 p\u0159ihla\u0161ovac\xed \xfadaje v .env souboru."})]})}),(0,M.jsx)(y.K,{children:(0,M.jsxs)(g.T,{align:"stretch",spacing:4,children:[(0,M.jsx)(z.D,{size:"sm",children:"SEO nastaven\xed"}),(0,M.jsx)(S.E,{fontSize:"sm",color:"gray.600",mb:4,children:"Z\xe1kladn\xed SEO nastaven\xed pro lep\u0161\xed viditelnost ve vyhled\xe1va\u010d\xedch."}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"Titulek webu"}),(0,M.jsx)(m.p,{value:X.site_title||"",onChange:me("site_title")}),(0,M.jsx)(c.eK,{children:"Hlavn\xed n\xe1zev webu, zobraz\xed se v z\xe1lo\u017ece prohl\xed\u017ee\u010de a ve v\xfdsledc\xedch vyhled\xe1v\xe1n\xed"})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"Popis webu"}),(0,M.jsx)(_.T,{value:X.site_description||"",onChange:e=>Y(t=>(0,a.A)((0,a.A)({},t),{},{site_description:e.target.value})),rows:3}),(0,M.jsx)(c.eK,{children:"Kr\xe1tk\xfd popis webu pro vyhled\xe1va\u010de (doporu\u010deno 150-160 znak\u016f)"})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"Kl\xed\u010dov\xe1 slova"}),(0,M.jsx)(m.p,{value:X.keywords||"",onChange:e=>Y(t=>(0,a.A)((0,a.A)({},t),{},{keywords:e.target.value}))}),(0,M.jsx)(c.eK,{children:"Kl\xed\u010dov\xe1 slova odd\u011blen\xe1 \u010d\xe1rkou (nap\u0159: fotbal, klub, sport)"})]}),(0,M.jsx)(l.c,{}),(0,M.jsx)(z.D,{size:"sm",children:"Open Graph (soci\xe1ln\xed s\xedt\u011b)"}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"V\xfdchoz\xed OG obr\xe1zek (URL)"}),(0,M.jsx)(m.p,{value:X.default_og_image_url||"",onChange:me("default_og_image_url")}),(0,M.jsx)(c.eK,{children:"V\xfdchoz\xed obr\xe1zek pro sd\xedlen\xed na soci\xe1ln\xedch s\xedt\xedch (doporu\u010deno 1200x630px)"})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"OG Type"}),(0,M.jsxs)(p.l,{value:X.og_type||"website",onChange:e=>Y(t=>(0,a.A)((0,a.A)({},t),{},{og_type:e.target.value})),children:[(0,M.jsx)("option",{value:"website",children:"Website"}),(0,M.jsx)("option",{value:"article",children:"Article"}),(0,M.jsx)("option",{value:"profile",children:"Profile"})]}),(0,M.jsx)(c.eK,{children:"Typ obsahu pro Open Graph"})]}),(0,M.jsx)(l.c,{}),(0,M.jsx)(z.D,{size:"sm",children:"Twitter Card"}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"Twitter Card Type"}),(0,M.jsxs)(p.l,{value:X.twitter_card||"summary_large_image",onChange:e=>Y(t=>(0,a.A)((0,a.A)({},t),{},{twitter_card:e.target.value})),children:[(0,M.jsx)("option",{value:"summary",children:"Summary"}),(0,M.jsx)("option",{value:"summary_large_image",children:"Summary Large Image"})]}),(0,M.jsx)(c.eK,{children:"Typ karty pro Twitter"})]}),(0,M.jsxs)(c.MJ,{children:[(0,M.jsx)(d.l,{children:"Twitter Site"}),(0,M.jsx)(m.p,{value:X.twitter_site||"",onChange:e=>Y(t=>(0,a.A)((0,a.A)({},t),{},{twitter_site:e.target.value})),placeholder:"@nazev_uctu"}),(0,M.jsx)(c.eK,{children:"Twitter \xfa\u010det webu (nap\u0159. @fotbalklub)"})]}),(0,M.jsx)(x.z,{children:(0,M.jsx)(s.$,{onClick:async()=>{try{await(0,D.g)(X),U({title:"SEO ulo\u017eeno",status:"success"})}catch(e){U({title:"Chyba",description:(null===e||void 0===e?void 0:e.message)||"Ulo\u017een\xed SEO nastaven\xed se nezda\u0159ilo",status:"error"})}},bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Ulo\u017eit SEO"})})]})})]})]}),(0,M.jsx)(l.c,{my:4}),(0,M.jsx)(x.z,{children:(0,M.jsx)(s.$,{onClick:ve,isLoading:K,bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:"Ulo\u017eit nastaven\xed"})})]})})}},69158:(e,t,n)=>{n.r(t),n.d(t,{default:()=>D});var a=n(65043),i=n(33171),o=n(62468),r=n(68655),s=n(23913),l=n(59218),c=n(88787),d=n(34334),u=n(85871),h=n(33430),m=n(22107),p=n(42703),x=n(91751),g=n(44093),v=n(82459),j=n(73212),b=n(25011),y=n(7189),f=n(47781),k=n(96148),_=n(10202),w=n(30502),z=n(28846),S=n(39081),A=n(74117),C=n(85369),E=n(6583),T=n(70579);const D=()=>{const{t:e}=(0,A.Bd)(),t=(0,a.useMemo)(()=>[{id:"uvod",label:"\xdavod a p\u0159ehled",icon:C.ZPX},{id:"nastaveni",label:"Nastaven\xed klubu",icon:C.Pcn},{id:"dashboard",label:"Dashboard a p\u0159ehledy",icon:C.$BV},{id:"clanky",label:"\u010cl\xe1nky a kategorie",icon:C.Nhm},{id:"zapasy",label:"Z\xe1pasy a tabulky",icon:C.i0U},{id:"hraci-tymy",label:"Hr\xe1\u010di a t\xfdmy",icon:C.YXz},{id:"media",label:"M\xe9dia a soubory",icon:C.T0M},{id:"gallery",label:"Galerie",icon:C.dkL},{id:"files",label:"Spr\xe1va soubor\u016f",icon:C.g1V},{id:"sponzori-bannery",label:"Sponzo\u0159i a bannery",icon:C.DDN},{id:"newsletter",label:"Newsletter a e-maily",icon:C.maD},{id:"aliasy",label:"Alias sout\u011b\u017e\xed",icon:C.Z0L},{id:"prefetch",label:"Prefetch a cache",icon:C.KP4},{id:"videa",label:"Videa",icon:C.HiP},{id:"aktivity",label:"Aktivity",icon:C.bfZ},{id:"merch",label:"Oble\u010den\xed",icon:C.lV_},{id:"zpravy",label:"Zpr\xe1vy",icon:C.g5D},{id:"contacts",label:"Kontakty a formul\xe1\u0159e",icon:C.toK},{id:"analytics",label:"Analytics a reporty",icon:C.YYR},{id:"scoreboard",label:"Tabule (Scoreboard)",icon:C.vF8},{id:"mobile-scoreboard",label:"Mobiln\xed scoreboard",icon:C.rle},{id:"uzivatele",label:"U\u017eivatel\xe9 a p\u0159\xedstupy",icon:C.pXu},{id:"docs",label:"Intern\xed dokumentace",icon:C.__w},{id:"checklist",label:"Checklisty a postupy",icon:C.lfF},{id:"seo",label:"SEO a metadata",icon:C.KSO},{id:"troubleshooting",label:"\u0158e\u0161en\xed probl\xe9m\u016f",icon:C.KRc}],[]),[n,D]=(0,a.useState)(""),N=(0,w.d)();(0,a.useEffect)(()=>{const e=new IntersectionObserver(e=>{const t=e.filter(e=>e.isIntersecting).sort((e,t)=>e.boundingClientRect.top>t.boundingClientRect.top?1:-1);t[0]&&D(t[0].target.id)},{rootMargin:"-20% 0px -60% 0px",threshold:[0,.25,.5,.75,1]});return t.map(e=>document.getElementById(e.id)).filter(Boolean).forEach(t=>e.observe(t)),()=>e.disconnect()},[t]),(0,a.useEffect)(()=>{if(n)try{localStorage.setItem("adminDocs:lastAnchor",n)}catch(e){}},[n]),(0,a.useEffect)(()=>{const e=setTimeout(()=>{let e=(window.location.hash||"").replace("#","").trim();if(!e)try{e=localStorage.getItem("adminDocs:lastAnchor")||""}catch(t){}if(e){const t=document.getElementById(e);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),D(e))}},50);return()=>clearTimeout(e)},[]);const R=(0,g.dU)("blue.700","blue.300"),F=(0,g.dU)("blue.50","blue.900"),P=(0,g.dU)("white","gray.800"),I=(0,g.dU)("gray.200","gray.700"),M=e=>{let{id:t,icon:n,title:a}=e;return(0,T.jsxs)(k.z,{align:"center",justify:"space-between",mb:4,id:t,scrollMarginTop:"100px",children:[(0,T.jsxs)(k.z,{spacing:3,children:[(0,T.jsx)(m.a,{p:2,bg:(0,g.dU)("blue.50","blue.900"),borderRadius:"lg",children:(0,T.jsx)(b.I,{as:n,color:(0,g.dU)("blue.600","blue.300"),boxSize:5})}),(0,T.jsx)(z.D,{size:"lg",color:(0,g.dU)("gray.800","white"),children:a})]}),(0,T.jsx)(p.K,{"aria-label":"Zkop\xedrovat odkaz",variant:"ghost",size:"sm",icon:(0,T.jsx)(C.AnD,{}),onClick:()=>(async e=>{try{const t="".concat(window.location.origin).concat(window.location.pathname,"#").concat(e);await navigator.clipboard.writeText(t),N({title:"Odkaz zkop\xedrov\xe1n",status:"success",duration:1500,isClosable:!0})}catch(t){N({title:"Nelze zkop\xedrovat odkaz",status:"error",duration:2e3,isClosable:!0})}})(t),borderRadius:"full"})]})};return(0,T.jsx)(E.A,{children:(0,T.jsx)(m.a,{maxW:"1400px",mx:"auto",children:(0,T.jsxs)(m.a,{display:{base:"block",lg:"grid"},gridTemplateColumns:{base:"1fr",lg:"280px 1fr"},gap:8,children:[(0,T.jsx)(m.a,{display:{base:"none",lg:"block"},children:(0,T.jsx)(m.a,{position:"sticky",top:"100px",maxH:"calc(100vh - 120px)",overflowY:"auto",children:(0,T.jsxs)(m.a,{bg:P,p:5,borderRadius:"xl",borderWidth:"1px",borderColor:I,shadow:"md",children:[(0,T.jsxs)(k.z,{mb:4,spacing:2,children:[(0,T.jsx)(b.I,{as:C.vd0,color:(0,g.dU)("blue.600","blue.300"),boxSize:4}),(0,T.jsx)(z.D,{size:"sm",color:(0,g.dU)("gray.700","gray.200"),children:"Rychl\xe1 navigace"})]}),(0,T.jsx)(_.T,{spacing:1.5,align:"stretch",children:t.map(e=>(0,T.jsxs)(y.N,{href:"#".concat(e.id),display:"flex",alignItems:"center",px:3,py:2.5,borderRadius:"lg",bg:n===e.id?F:"transparent",color:n===e.id?R:"inherit",fontWeight:n===e.id?"semibold":"medium",fontSize:"sm",_hover:{bg:F,textDecoration:"none"},transition:"all 0.2s",onClick:t=>{t.preventDefault();try{localStorage.setItem("adminDocs:lastAnchor",e.id)}catch(a){}const n=document.getElementById(e.id);n&&(n.scrollIntoView({behavior:"smooth",block:"nearest"}),window.history.pushState(null,"","#".concat(e.id)))},children:[(0,T.jsx)(b.I,{as:e.icon,mr:2.5,boxSize:4}),(0,T.jsx)(S.E,{flex:1,children:e.label})]},e.id))})]})})}),(0,T.jsx)(m.a,{children:(0,T.jsxs)(m.a,{bg:P,p:8,borderRadius:"xl",borderWidth:"1px",borderColor:I,shadow:"sm",children:[(0,T.jsx)(m.a,{id:"top",mb:4}),(0,T.jsxs)(m.a,{mb:8,children:[(0,T.jsxs)(k.z,{mb:3,spacing:3,children:[(0,T.jsx)(b.I,{as:C.hko,color:(0,g.dU)("blue.600","blue.400"),boxSize:10}),(0,T.jsx)(z.D,{size:"2xl",children:"Dokumentace"})]}),(0,T.jsx)(S.E,{color:"gray.600",fontSize:"lg",mb:6,children:"Kompletn\xed pr\u016fvodce administrac\xed va\u0161eho klubov\xe9ho webu - vytvo\u0159eno pro ka\u017ed\xe9ho, i bez technick\xfdch znalost\xed"}),(0,T.jsxs)(c.F,{status:"info",borderRadius:"lg",variant:"left-accent",mb:4,children:[(0,T.jsx)(u._,{}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(h.X,{fontSize:"md",children:"V\xedtejte v admin panelu!"}),(0,T.jsxs)(d.T,{fontSize:"sm",children:["Tato dokumentace v\xe1s krok za krokem provede v\u0161emi funkcemi syst\xe9mu. Pro rychl\xfd start doporu\u010dujeme za\u010d\xedt"," ",(0,T.jsx)(y.N,{href:"#nastaveni",color:"blue.600",fontWeight:"semibold",children:"nastaven\xedm klubu"}),"."]})]})]}),(0,T.jsxs)(c.F,{status:"success",borderRadius:"lg",variant:"left-accent",children:[(0,T.jsx)(u._,{}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(h.X,{fontSize:"md",children:(0,T.jsxs)(k.z,{spacing:2,display:"inline-flex",children:[(0,T.jsx)(b.I,{as:C.uN,boxSize:4}),(0,T.jsx)(S.E,{as:"span",children:"Pot\u0159ebujete pomoc nebo vlastn\xed \xfapravy?"})]})}),(0,T.jsxs)(d.T,{fontSize:"sm",children:[(0,T.jsx)("strong",{children:"Technick\xe1 podpora:"})," M\xe1te-li jak\xe9koli dotazy nebo naraz\xedte na probl\xe9m, napi\u0161te n\xe1m na"," ",(0,T.jsx)(y.N,{href:"mailto:help@tdvorak.dev",color:"blue.600",fontWeight:"bold",children:"help@tdvorak.dev"})," ","\u2014 odpov\xedd\xe1me do 24 hodin.",(0,T.jsx)("br",{}),(0,T.jsx)("strong",{children:"Vlastn\xed \xfapravy:"})," Hled\xe1te specifick\xe9 funkce nebo p\u0159izp\u016fsoben\xed webu va\u0161im pot\u0159eb\xe1m? Kontaktujte n\xe1s a spole\u010dn\u011b zjist\xedme, zda je va\u0161e p\u0159edstava realizovateln\xe1. R\xe1di v\xe1m pom\u016f\u017eeme!"]})]})]})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{id:"uvod",scrollMarginTop:"100px",children:[(0,T.jsx)(M,{id:"uvod",icon:C.ZPX,title:"\xdavod a p\u0159ehled"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:8,children:[(0,T.jsxs)(S.E,{fontSize:"md",color:"gray.700",children:["Tento administra\u010dn\xed syst\xe9m v\xe1m umo\u017e\u0148uje jednodu\u0161e spravovat kompletn\xed klubov\xfd web \u2014 od \u010dl\xe1nk\u016f, p\u0159es z\xe1pasy a v\xfdsledky, a\u017e po newsletter a galerie. ",(0,T.jsx)("strong",{children:"Nen\xed pot\u0159eba \u017e\xe1dn\xe9 programov\xe1n\xed ani technick\xe9 znalosti."})," V\u0161e je navr\u017eeno tak, aby to zvl\xe1dl ka\u017ed\xfd \u010dlen klubu."]}),(0,T.jsx)(m.a,{p:4,bg:(0,g.dU)("blue.50","blue.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"blue.500",children:(0,T.jsxs)(S.E,{fontSize:"md",color:"blue.800",fontWeight:"medium",children:[(0,T.jsx)("strong",{children:"Co m\u016f\u017eete d\u011blat:"})," P\u0159id\xe1vat \u010dl\xe1nky, spravovat z\xe1pasy, nahr\xe1vat fotky do galerie, pos\xedlat newslettery fanou\u0161k\u016fm, upravovat vzhled webu a mnoho dal\u0161\xedho. V\u0161e p\u0159ehledn\u011b na jednom m\xedst\u011b."]})}),(0,T.jsxs)(k.z,{mt:4,mb:2,spacing:2,children:[(0,T.jsx)(b.I,{as:C.lHQ,color:(0,g.dU)("orange.500","orange.300"),boxSize:4}),(0,T.jsx)(z.D,{size:"sm",children:"Rychl\xe9 odkazy na nejpou\u017e\xedvan\u011bj\u0161\xed sekce"})]}),(0,T.jsx)(j.r,{columns:{base:1,md:2},spacing:3,children:[{icon:C.Nhm,title:"\u010cl\xe1nky",desc:"Publikujte novinky a report\xe1\u017ee",link:"/admin/clanky"},{icon:C.i0U,title:"Z\xe1pasy",desc:"Automatick\xe9 na\u010d\xedt\xe1n\xed z FA\u010cR",link:"/admin/zapasy"},{icon:C.YXz,title:"Hr\xe1\u010di a t\xfdmy",desc:"Spr\xe1va soupisek",link:"/admin/hraci"},{icon:C.dkL,title:"Galerie",desc:"".concat(e("homepage.gallery")," a alba"),link:"/admin/galerie"},{icon:C.T0M,title:"M\xe9dia",desc:"Nahr\xe1v\xe1n\xed obr\xe1zk\u016f a soubor\u016f",link:"/admin/soubory"},{icon:C.maD,title:"Newsletter",desc:"E-mailov\xe9 kampan\u011b",link:"/admin/newsletter"},{icon:C.Pcn,title:"Nastaven\xed klubu",desc:"Logo, barvy, kontakty",link:"/admin/nastaveni"},{icon:C.DDN,title:"Sponzo\u0159i",desc:"Spr\xe1va partner\u016f klubu",link:"/admin/sponzori"},{icon:C.HiP,title:"Videa",desc:"YouTube a dal\u0161\xed videa",link:"/admin/videa"},{icon:C.bfZ,title:"Aktivity",desc:"Kalend\xe1\u0159 akc\xed",link:"/admin/aktivity"},{icon:C.YYR,title:"Analytics",desc:"Statistiky n\xe1v\u0161t\u011bvnosti",link:"/admin/analytika"},{icon:C.KP4,title:"Prefetch",desc:"Aktualizace dat z FA\u010cR",link:"/admin/prefetch"}].map((e,t)=>(0,T.jsx)(y.N,{href:e.link,_hover:{textDecoration:"none"},children:(0,T.jsxs)(k.z,{p:4,bg:(0,g.dU)("gray.50","gray.700"),borderRadius:"lg",borderWidth:"1px",borderColor:I,_hover:{shadow:"md",transform:"translateY(-2px)",borderColor:"blue.400"},transition:"all 0.2s",cursor:"pointer",children:[(0,T.jsx)(m.a,{p:2,bg:"blue.50",borderRadius:"md",children:(0,T.jsx)(b.I,{as:e.icon,color:"blue.600",boxSize:5})}),(0,T.jsxs)(_.T,{align:"start",spacing:0,flex:1,children:[(0,T.jsx)(S.E,{fontWeight:"semibold",fontSize:"sm",children:e.title}),(0,T.jsx)(S.E,{fontSize:"xs",color:"gray.500",children:e.desc})]})]})},t))}),(0,T.jsxs)(c.F,{status:"info",borderRadius:"lg",mt:4,children:[(0,T.jsx)(u._,{}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(h.X,{fontSize:"sm",children:(0,T.jsxs)(k.z,{spacing:2,display:"inline-flex",children:[(0,T.jsx)(b.I,{as:C.ZPX,boxSize:3}),(0,T.jsx)(S.E,{as:"span",children:"Tip pro za\u010d\xe1te\u010dn\xedky"})]})}),(0,T.jsxs)(d.T,{fontSize:"sm",children:["Pokud jste zde poprv\xe9, za\u010dn\u011bte v po\u0159ad\xed: ",(0,T.jsx)("strong",{children:"1) Nastaven\xed"})," (vypl\u0148te n\xe1zev klubu a logo),",(0,T.jsx)("strong",{children:"2) M\xe9dia"})," (nahrajte p\xe1r obr\xe1zk\u016f), ",(0,T.jsx)("strong",{children:"3) \u010cl\xe1nky"})," (vytvo\u0159te prvn\xed p\u0159\xedsp\u011bvek). Zbytek m\u016f\u017eete prozkoum\xe1vat postupn\u011b!"]})]})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"nastaveni",icon:C.Pcn,title:"Nastaven\xed klubu"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsxs)(c.F,{status:"warning",borderRadius:"lg",children:[(0,T.jsx)(u._,{}),(0,T.jsxs)(S.E,{fontSize:"sm",children:[(0,T.jsxs)("strong",{children:[(0,T.jsx)(b.I,{as:C.BS8,boxSize:3,display:"inline",mr:1}),"Za\u010dn\u011bte zde!"]})," Nastaven\xed je prvn\xed, co byste m\u011bli vyplnit. Ovliv\u0148uje vzhled webu, e-maily, na\u010d\xedt\xe1n\xed z\xe1pas\u016f a dal\u0161\xed funkce. Bez spr\xe1vn\xe9ho nastaven\xed web nebude fungovat optim\xe1ln\u011b."]})]}),(0,T.jsx)(y.N,{href:"/admin/nastaveni",isExternal:!0,children:(0,T.jsxs)(k.z,{p:3,bg:(0,g.dU)("blue.50","blue.900"),borderRadius:"lg",_hover:{bg:(0,g.dU)("blue.100","blue.800")},transition:"all 0.2s",children:[(0,T.jsx)(b.I,{as:C.Pcn,color:"blue.600",boxSize:5}),(0,T.jsx)(S.E,{fontWeight:"bold",color:"blue.700",children:"\u2192 Otev\u0159\xedt Nastaven\xed klubu"})]})}),(0,T.jsxs)(k.z,{mt:2,spacing:2,children:[(0,T.jsx)(b.I,{as:C.kkc,color:(0,g.dU)("blue.600","blue.300"),boxSize:4}),(0,T.jsx)(z.D,{size:"sm",children:"Co nastavit? (Krok za krokem)"})]}),(0,T.jsxs)(f._J,{spacing:3,pl:5,children:[(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"N\xe1zev klubu"})," \u2014 Pln\xfd n\xe1zev va\u0161eho fotbalov\xe9ho klubu (zobrazuje se v z\xe1hlav\xed webu, e-mailech a v\u0161ude na str\xe1nk\xe1ch)"]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Logo klubu"})," \u2014 Nejd\u0159\xedve nahrajte logo do sekce"," ",(0,T.jsx)(y.N,{href:"/admin/soubory",color:"blue.600",fontWeight:"bold",children:"M\xe9dia"}),", pot\xe9 zkop\xedrujte adresu obr\xe1zku (URL) a vlo\u017ete ji sem"]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Barvy"})," \u2014 Prim\xe1rn\xed barva (hlavn\xed barva klubu) a sekund\xe1rn\xed barva (dopl\u0148kov\xe1). Pou\u017eijte barevn\xe9 k\xf3dy jako nap\u0159. #FF0000 pro \u010dervenou"]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"SMTP nastaven\xed (pro e-maily)"})," \u2014 Nutn\xe9 pro odes\xedl\xe1n\xed newsletter\u016f a automatick\xfdch e-mail\u016f. Pot\u0159ebujete: adresu serveru (host), port (465 nebo 587), u\u017eivatelsk\xe9 jm\xe9no a heslo"]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"FA\u010cR \xfadaje"})," \u2014 Club ID a Club Type z\xedsk\xe1te z"," ",(0,T.jsx)(y.N,{href:"https://is.fotbal.cz",color:"blue.600",isExternal:!0,children:"is.fotbal.cz"}),". Tyto \xfadaje slou\u017e\xed k automatick\xe9mu na\u010d\xedt\xe1n\xed z\xe1pas\u016f a tabulek"]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Soci\xe1ln\xed s\xedt\u011b"})," \u2014 Vlo\u017ete odkazy na Facebook, Instagram, YouTube profily klubu. Ikony se zobraz\xed v pati\u010dce webu"]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Kontaktn\xed \xfadaje"})," \u2014 E-mail, telefon a adresa klubu pro kontaktn\xed str\xe1nku"]})]}),(0,T.jsxs)(m.a,{p:4,bg:(0,g.dU)("blue.50","blue.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"blue.500",children:[(0,T.jsxs)(k.z,{spacing:2,mb:2,children:[(0,T.jsx)(b.I,{as:C.ZPX,color:"blue.600"}),(0,T.jsx)(S.E,{fontWeight:"semibold",color:"blue.800",children:"Tip pro SMTP (e-mailov\xe9 nastaven\xed)"})]}),(0,T.jsxs)(S.E,{fontSize:"sm",color:"blue.700",mb:2,children:[(0,T.jsx)("strong",{children:"Port 465"})," pou\u017e\xedv\xe1 SSL zabezpe\u010den\xed, ",(0,T.jsx)("strong",{children:"port 587"})," pou\u017e\xedv\xe1 STARTTLS."]}),(0,T.jsxs)(S.E,{fontSize:"sm",color:"blue.700",children:[(0,T.jsx)("strong",{children:"Pou\u017e\xedv\xe1te Gmail?"}),' Gmail vy\u017eaduje \u201eApp Password" (heslo aplikace), ne va\u0161e b\u011b\u017en\xe9 heslo! Nastavte si ho v Google Account \u2192 Security \u2192 2-Step Verification \u2192 App passwords.']})]}),(0,T.jsxs)(m.a,{p:4,bg:(0,g.dU)("green.50","green.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"green.500",children:[(0,T.jsxs)(k.z,{spacing:2,mb:2,children:[(0,T.jsx)(b.I,{as:C.ZPX,color:"green.600"}),(0,T.jsx)(S.E,{fontWeight:"semibold",color:"green.800",children:"Nejste si jist\xed n\u011bkter\xfdm nastaven\xedm?"})]}),(0,T.jsxs)(S.E,{fontSize:"sm",color:"green.700",children:["\u017d\xe1dn\xfd probl\xe9m! Napi\u0161te n\xe1m na"," ",(0,T.jsx)(y.N,{href:"mailto:help@tdvorak.dev",color:"green.600",fontWeight:"bold",children:"help@tdvorak.dev"})," ","a pom\u016f\u017eeme v\xe1m se v\u0161\xedm nastavit. Odpov\xedd\xe1me do 24 hodin."]})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"dashboard",icon:C.$BV,title:"Dashboard a p\u0159ehledy"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsxs)(S.E,{children:["Hned po p\u0159ihl\xe1\u0161en\xed najdete v sekci"," ",(0,T.jsx)(y.N,{href:"/admin",color:"blue.600",children:"Dashboard"})," souhrn nejd\u016fle\u017eit\u011bj\u0161\xedch informac\xed o webu a klubu."]}),(0,T.jsx)(j.r,{columns:{base:1,md:2},spacing:4,children:[{title:"Rychl\xfd p\u0159ehled",desc:"Posledn\xed \u010dl\xe1nky, pl\xe1n z\xe1pas\u016f, e-mailov\xe9 statistiky."},{title:"Ak\u010dn\xed dla\u017edice",desc:"Tla\u010d\xedtka pro vytvo\u0159en\xed \u010dl\xe1nku, spu\u0161t\u011bn\xed prefetch nebo import alias\u016f."},{title:"Notifikace",desc:"Varov\xe1n\xed na chyb\u011bj\xedc\xed nastaven\xed nebo ne\xfasp\u011b\u0161n\xe9 importy."},{title:"Widget aktivit",desc:"Seznam nejbli\u017e\u0161\xedch akc\xed z kalend\xe1\u0159e aktivit."}].map((e,t)=>(0,T.jsxs)(m.a,{p:4,borderWidth:"1px",borderColor:I,borderRadius:"lg",bg:(0,g.dU)("gray.50","gray.700"),children:[(0,T.jsx)(z.D,{size:"sm",mb:2,children:e.title}),(0,T.jsx)(S.E,{fontSize:"sm",color:"gray.600",children:e.desc})]},t))}),(0,T.jsxs)(c.F,{status:"info",borderRadius:"lg",children:[(0,T.jsx)(u._,{}),(0,T.jsxs)(S.E,{fontSize:"sm",children:["Dashboard vych\xe1z\xed z real-time dat. Pokud n\u011bco chyb\xed, spus\u0165te"," ",(0,T.jsx)(y.N,{href:"/admin/prefetch",color:"blue.600",children:"Prefetch"})," nebo obnovte str\xe1nku."]})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"clanky",icon:C.Nhm,title:"\u010cl\xe1nky a kategorie"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"\u010cl\xe1nky jsou hlavn\xed zp\u016fsob, jak komunikovat s fanou\u0161ky. M\u016f\u017eete publikovat novinky, report\xe1\u017ee, rozhovory a dal\u0161\xed obsah. Je to jednoduch\xe9 jako psan\xed p\u0159\xedsp\u011bvku na Facebook!"}),(0,T.jsx)(y.N,{href:"/admin/clanky",isExternal:!0,children:(0,T.jsxs)(k.z,{p:3,bg:(0,g.dU)("blue.50","blue.900"),borderRadius:"lg",_hover:{bg:(0,g.dU)("blue.100","blue.800")},transition:"all 0.2s",children:[(0,T.jsx)(b.I,{as:C.Nhm,color:"blue.600",boxSize:5}),(0,T.jsx)(S.E,{fontWeight:"bold",color:"blue.700",children:"\u2192 Otev\u0159\xedt \u010cl\xe1nky"})]})}),(0,T.jsxs)(i.n,{allowToggle:!0,children:[(0,T.jsxs)(s.A,{borderColor:I,children:[(0,T.jsx)("h3",{children:(0,T.jsxs)(o.J,{_expanded:{bg:"blue.50",color:"blue.700"},children:[(0,T.jsxs)(k.z,{flex:"1",textAlign:"left",fontWeight:"semibold",children:[(0,T.jsx)(b.I,{as:C.uO9,boxSize:4}),(0,T.jsx)(S.E,{children:"Jak vytvo\u0159it \u010dl\xe1nek? (Krok za krokem)"})]}),(0,T.jsx)(r.Q,{})]})}),(0,T.jsx)(l.v,{pb:4,children:(0,T.jsxs)(f._J,{spacing:2,children:[(0,T.jsxs)(f.ck,{children:["Otev\u0159ete sekci"," ",(0,T.jsx)(y.N,{href:"/admin/clanky",color:"blue.600",fontWeight:"bold",children:"\u010cl\xe1nky"})]}),(0,T.jsx)(f.ck,{children:'Klikn\u011bte na zelen\xe9 tla\u010d\xedtko \u201eVytvo\u0159it \u010dl\xe1nek" (vpravo naho\u0159e)'}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Vypl\u0148te n\xe1zev \u010dl\xe1nku"}),' \u2014 nap\u0159. "V\xedt\u011bzstv\xed 3:1 proti Sokolu"']}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Napi\u0161te obsah"})," \u2014 M\u016f\u017eete ps\xe1t norm\xe1ln\xed text. Pro pokro\u010dil\xe9: podporov\xe1n HTML/Markdown form\xe1t"]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Vyberte kategorii"}),' \u2014 nap\u0159. "Z\xe1pasy", "Aktuality", "Rozhovory". Pokud kategorie neexistuje, vytvo\u0159te novou']}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"P\u0159idejte hlavn\xed obr\xe1zek"})," \u2014 Nejprve nahrajte obr\xe1zek do"," ",(0,T.jsx)(y.N,{href:"/admin/soubory",color:"blue.600",fontWeight:"bold",children:"M\xe9dia"}),', pot\xe9 zkop\xedrujte jeho adresu (URL) a vlo\u017ete ji do pole "Obr\xe1zek"']}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Vypl\u0148te SEO titulek a popis"})," \u2014 Pom\xe1h\xe1 n\xe1v\u0161t\u011bvn\xedk\u016fm naj\xedt \u010dl\xe1nek p\u0159es Google"]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:'Za\u0161krtn\u011bte \u201ePublikovat"'})," pokud chcete \u010dl\xe1nek hned zve\u0159ejnit. Pokud ne, m\u016f\u017eete ho ulo\u017eit jako koncept"]}),(0,T.jsxs)(f.ck,{children:['Klikn\u011bte na \u201eUlo\u017eit" \u2014 Hotovo! ',(0,T.jsx)(b.I,{as:C.A7C,boxSize:3,display:"inline",color:"green.500"})]})]})})]}),(0,T.jsxs)(s.A,{borderColor:I,children:[(0,T.jsx)("h3",{children:(0,T.jsxs)(o.J,{children:[(0,T.jsxs)(k.z,{flex:"1",textAlign:"left",fontWeight:"semibold",children:[(0,T.jsx)(b.I,{as:C.IFh,boxSize:4}),(0,T.jsx)(S.E,{children:"Jak p\u0159idat obr\xe1zky a videa do \u010dl\xe1nku?"})]}),(0,T.jsx)(r.Q,{})]})}),(0,T.jsxs)(l.v,{pb:4,children:[(0,T.jsx)(S.E,{mb:2,fontSize:"sm",children:(0,T.jsx)("strong",{children:"Pro obr\xe1zky:"})}),(0,T.jsxs)(f._J,{spacing:2,fontSize:"sm",children:[(0,T.jsxs)(f.ck,{children:["Nahrajte obr\xe1zek v sekci ",(0,T.jsx)(y.N,{href:"/admin/soubory",color:"blue.600",children:"M\xe9dia"})]}),(0,T.jsxs)(f.ck,{children:["Zkop\xedrujte adresu obr\xe1zku (nap\u0159. ",(0,T.jsx)(x.C,{children:"/uploads/2025/01/foto.jpg"}),")"]}),(0,T.jsxs)(f.ck,{children:["V editoru \u010dl\xe1nku pou\u017eijte HTML: ",(0,T.jsx)(x.C,{children:'<img src="/uploads/2025/01/foto.jpg" alt="Popis" />'})]})]}),(0,T.jsx)(S.E,{mt:3,mb:2,fontSize:"sm",children:(0,T.jsx)("strong",{children:"Pro YouTube videa:"})}),(0,T.jsx)(S.E,{fontSize:"sm",children:"Zkop\xedrujte YouTube odkaz a vlo\u017ete p\u0159\xedmo do obsahu, nebo pou\u017eijte HTML embed k\xf3d z YouTube."})]})]}),(0,T.jsxs)(s.A,{borderColor:I,children:[(0,T.jsx)("h3",{children:(0,T.jsxs)(o.J,{children:[(0,T.jsxs)(k.z,{flex:"1",textAlign:"left",fontWeight:"semibold",children:[(0,T.jsx)(b.I,{as:C.KSO,boxSize:4}),(0,T.jsx)(S.E,{children:"SEO optimalizace (pro lep\u0161\xed viditelnost)"})]}),(0,T.jsx)(r.Q,{})]})}),(0,T.jsxs)(l.v,{pb:4,children:[(0,T.jsx)(S.E,{fontSize:"sm",mb:3,children:"SEO pom\xe1h\xe1 lidem naj\xedt va\u0161e \u010dl\xe1nky p\u0159es Google. Vypl\u0148te tyto pole:"}),(0,T.jsxs)(f.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"SEO Titulek:"}),' 50-60 znak\u016f, obsahuje kl\xed\u010dov\xe1 slova (nap\u0159. "FK Dvorinka zv\xedt\u011bzil 3:1 - report\xe1\u017e ze z\xe1pasu")']}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"SEO Popis:"})," 150-160 znak\u016f, kr\xe1tk\xe9 shrnut\xed \u010dl\xe1nku pro Google v\xfdsledky"]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"URL Slug:"}),' Kr\xe1tk\xfd text bez diakritiky, s poml\u010dkami (nap\u0159. "vitezstvi-3-1-sokol")']}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Obr\xe1zek:"})," Optimalizujte velikost (max 1MB, ide\xe1ln\u011b 1200x630 px)"]})]})]})]})]}),(0,T.jsxs)(c.F,{status:"success",borderRadius:"lg",mt:2,children:[(0,T.jsx)(u._,{}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(h.X,{fontSize:"sm",children:(0,T.jsxs)(k.z,{spacing:2,display:"inline-flex",children:[(0,T.jsx)(b.I,{as:C.ZPX,boxSize:3}),(0,T.jsx)(S.E,{as:"span",children:"Tip: Kategorie"})]})}),(0,T.jsx)(d.T,{fontSize:"sm",children:'Vytvo\u0159te si kategorie jako "Z\xe1pasy", "Aktuality", "Ml\xe1de\u017e", "Rozhovory" atd. Pomohou fanou\u0161k\u016fm rychle naj\xedt konkr\xe9tn\xed typ obsahu!'})]})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"zapasy",icon:C.i0U,title:"Z\xe1pasy a tabulky"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsxs)(S.E,{children:["Ve\u0161ker\xe1 data o z\xe1pasech, tabulk\xe1ch a v\xfdsledc\xedch se ",(0,T.jsx)("strong",{children:"automaticky na\u010d\xedtaj\xed z FA\u010cR"})," (Fotbalov\xe1 asociace \u010cR). Nemus\xedte nic zad\xe1vat ru\u010dn\u011b \u2014 sta\u010d\xed spr\xe1vn\xe9 nastaven\xed a syst\xe9m v\u0161e st\xe1hne s\xe1m!"]}),(0,T.jsxs)(j.r,{columns:{base:1,md:2},spacing:3,children:[(0,T.jsx)(y.N,{href:"/admin/zapasy",isExternal:!0,children:(0,T.jsxs)(k.z,{p:3,bg:(0,g.dU)("blue.50","blue.900"),borderRadius:"lg",_hover:{bg:(0,g.dU)("blue.100","blue.800")},transition:"all 0.2s",children:[(0,T.jsx)(b.I,{as:C.i0U,color:"blue.600",boxSize:5}),(0,T.jsx)(S.E,{fontWeight:"bold",color:"blue.700",children:"\u2192 Zobrazit z\xe1pasy"})]})}),(0,T.jsx)(y.N,{href:"/admin/prefetch",isExternal:!0,children:(0,T.jsxs)(k.z,{p:3,bg:(0,g.dU)("green.50","green.900"),borderRadius:"lg",_hover:{bg:(0,g.dU)("green.100","green.800")},transition:"all 0.2s",children:[(0,T.jsx)(b.I,{as:C.KP4,color:"green.600",boxSize:5}),(0,T.jsx)(S.E,{fontWeight:"bold",color:"green.700",children:"\u2192 Aktualizovat data (Prefetch)"})]})})]}),(0,T.jsxs)(k.z,{mt:2,spacing:2,children:[(0,T.jsx)(b.I,{as:C.Pcn,color:(0,g.dU)("blue.600","blue.300"),boxSize:4}),(0,T.jsx)(z.D,{size:"sm",children:"Jak nastavit automatick\xe9 na\u010d\xedt\xe1n\xed z\xe1pas\u016f?"})]}),(0,T.jsxs)(f._J,{spacing:2,pl:5,children:[(0,T.jsxs)(f.ck,{children:["P\u0159ejd\u011bte do"," ",(0,T.jsx)(y.N,{href:"/admin/nastaveni",color:"blue.600",fontWeight:"bold",children:"Nastaven\xed"})," klubu"]}),(0,T.jsxs)(f.ck,{children:["Najd\u011bte sekci ",(0,T.jsx)("strong",{children:'"FA\u010cR \xfadaje"'})]}),(0,T.jsxs)(f.ck,{children:["Vypl\u0148te ",(0,T.jsx)("strong",{children:"Club ID"})," a ",(0,T.jsx)("strong",{children:"Club Type"})," (z\xedsk\xe1te z"," ",(0,T.jsx)(y.N,{href:"https://is.fotbal.cz",color:"blue.600",isExternal:!0,children:"is.fotbal.cz"}),")"]}),(0,T.jsxs)(f.ck,{children:["Ulo\u017ete nastaven\xed a spus\u0165te"," ",(0,T.jsx)(y.N,{href:"/admin/prefetch",color:"blue.600",fontWeight:"bold",children:"Prefetch"})," pro na\u010dten\xed dat"]}),(0,T.jsxs)(f.ck,{children:["Hotovo! Z\xe1pasy a tabulky se budou automaticky aktualizovat ",(0,T.jsx)(b.I,{as:C.A7C,boxSize:3,display:"inline",color:"green.500"})]})]}),(0,T.jsxs)(m.a,{p:4,bg:(0,g.dU)("blue.50","blue.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"blue.500",children:[(0,T.jsxs)(k.z,{spacing:2,mb:2,children:[(0,T.jsx)(b.I,{as:C.ZPX,color:"blue.600"}),(0,T.jsx)(S.E,{fontWeight:"semibold",color:(0,g.dU)("blue.800","blue.200"),children:"Co jsou aliasy sout\u011b\u017e\xed?"})]}),(0,T.jsxs)(S.E,{fontSize:"sm",color:(0,g.dU)("blue.700","blue.200"),mb:2,children:["Z FA\u010cR n\u011bkdy p\u0159ich\xe1zej\xed dlouh\xe9 a nep\u0159ehledn\xe9 n\xe1zvy sout\u011b\u017e\xed. V sekci"," ",(0,T.jsx)(y.N,{href:"/admin/aliasy-soutezi",color:"blue.600",fontWeight:"bold",children:"Alias sout\u011b\u017e\xed"})," ","si m\u016f\u017eete n\xe1zvy zkr\xe1tit a upravit, jak se maj\xed zobrazovat na webu."]}),(0,T.jsx)(S.E,{fontSize:"xs",color:(0,g.dU)("blue.600","blue.300"),children:'P\u0159\xedklad: "I. A t\u0159\xedda skupina B - mu\u017ei" \u2192 "I.A t\u0159\xedda"'})]}),(0,T.jsxs)(c.F,{status:"info",borderRadius:"lg",children:[(0,T.jsx)(u._,{}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(h.X,{fontSize:"sm",children:(0,T.jsxs)(k.z,{spacing:2,display:"inline-flex",children:[(0,T.jsx)(b.I,{as:C.KP4,boxSize:3}),(0,T.jsx)(S.E,{as:"span",children:"Aktualizace dat"})]})}),(0,T.jsxs)(d.T,{fontSize:"sm",children:["Data se automaticky aktualizuj\xed pravideln\u011b. Pokud pot\u0159ebujete aktualizovat hned, pou\u017eijte tla\u010d\xedtko v sekci"," ",(0,T.jsx)(y.N,{href:"/admin/prefetch",color:"blue.600",fontWeight:"bold",children:"Prefetch"}),"."]})]})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"hraci-tymy",icon:C.YXz,title:"Hr\xe1\u010di a t\xfdmy"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"Udr\u017eujte seznam t\xfdm\u016f a hr\xe1\u010d\u016f aktu\xe1ln\xed, aby fanou\u0161ci i tren\xe9\u0159i m\u011bli okam\u017eit\xfd p\u0159ehled o soupisce."}),(0,T.jsxs)(f.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,T.jsxs)(f.ck,{children:["V sekci"," ",(0,T.jsx)(y.N,{href:"/admin/tymy",color:"blue.600",children:"T\xfdmy"})," spravujete z\xe1kladn\xed \xfadaje a fotografie."]}),(0,T.jsx)(f.ck,{children:"Hr\xe1\u010de p\u0159i\u0159azujte k t\xfdm\u016fm, dopl\u0148te \u010d\xedsla dres\u016f, pozice a profilov\xe9 obr\xe1zky."}),(0,T.jsxs)(f.ck,{children:["V p\u0159\xedpad\u011b chybn\u011b na\u010dten\xfdch log \u010di n\xe1zv\u016f vyu\u017eijte"," ",(0,T.jsx)(y.N,{href:"/admin/aliasy-soutezi",color:"blue.600",children:"aliasy sout\u011b\u017e\xed"})," nebo manu\xe1ln\xed \xfapravy t\xfdm\u016f."]})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"media",icon:C.T0M,title:"M\xe9dia a soubory"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsxs)(S.E,{children:["Sekce M\xe9dia je va\u0161e ",(0,T.jsx)("strong",{children:"centr\xe1ln\xed \xfalo\u017ei\u0161t\u011b pro v\u0161echny obr\xe1zky, loga a soubory"}),". V\u0161e, co nahrajete zde, m\u016f\u017eete pak pou\u017e\xedt v \u010dl\xe1nc\xedch, bannerech, newsletterech nebo na str\xe1nce O klubu."]}),(0,T.jsx)(y.N,{href:"/admin/soubory",isExternal:!0,children:(0,T.jsxs)(k.z,{p:3,bg:(0,g.dU)("blue.50","blue.900"),borderRadius:"lg",_hover:{bg:(0,g.dU)("blue.100","blue.800")},transition:"all 0.2s",children:[(0,T.jsx)(b.I,{as:C.T0M,color:"blue.600",boxSize:5}),(0,T.jsx)(S.E,{fontWeight:"bold",color:"blue.700",children:"\u2192 Otev\u0159\xedt M\xe9dia"})]})}),(0,T.jsxs)(k.z,{mt:2,spacing:2,children:[(0,T.jsx)(b.I,{as:C.T0M,color:(0,g.dU)("blue.600","blue.300"),boxSize:4}),(0,T.jsx)(z.D,{size:"sm",children:"Jak nahr\xe1t obr\xe1zek nebo soubor?"})]}),(0,T.jsxs)(f._J,{spacing:2,pl:5,children:[(0,T.jsxs)(f.ck,{children:["Otev\u0159ete sekci"," ",(0,T.jsx)(y.N,{href:"/admin/soubory",color:"blue.600",fontWeight:"bold",children:"M\xe9dia"})]}),(0,T.jsxs)(f.ck,{children:["Klikn\u011bte na tla\u010d\xedtko ",(0,T.jsx)("strong",{children:'"Nahr\xe1t soubor"'})," nebo ",(0,T.jsx)("strong",{children:'"Upload"'})]}),(0,T.jsx)(f.ck,{children:"Vyberte obr\xe1zek ze sv\xe9ho po\u010d\xedta\u010de (doporu\u010den\xe9 form\xe1ty: JPG, PNG, max 5 MB)"}),(0,T.jsxs)(f.ck,{children:["Po nahr\xe1n\xed se zobraz\xed ",(0,T.jsx)("strong",{children:"adresa souboru"})," (URL) \u2014 nap\u0159. ",(0,T.jsx)(x.C,{children:"/uploads/2025/01/foto.jpg"})]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Zkop\xedrujte tuto adresu"})," a pou\u017eijte ji tam, kde pot\u0159ebujete (\u010dl\xe1nky, nastaven\xed loga atd.)"]})]}),(0,T.jsxs)(m.a,{p:4,bg:(0,g.dU)("blue.50","blue.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"blue.500",children:[(0,T.jsxs)(k.z,{spacing:2,mb:2,children:[(0,T.jsx)(b.I,{as:C.ZPX,color:"blue.600"}),(0,T.jsx)(S.E,{fontWeight:"semibold",color:(0,g.dU)("blue.800","blue.200"),children:"Tipy pro pr\xe1ci s obr\xe1zky"})]}),(0,T.jsxs)(f.B8,{spacing:1,styleType:"disc",pl:5,fontSize:"sm",color:(0,g.dU)("blue.700","blue.200"),children:[(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Optimalizujte velikost:"})," Ide\xe1ln\xed \u0161\xed\u0159ka 1200-2000 px, velikost souboru max 1 MB"]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Pou\u017e\xedvejte popisn\xe9 n\xe1zvy:"}),' nap\u0159. "zapas-sokol-2025-01.jpg" m\xedsto "IMG_1234.jpg"']}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Form\xe1ty:"})," JPG pro fotky, PNG pro loga s pr\u016fhlednost\xed"]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Z\xe1loha:"})," D\u016fle\u017eit\xe9 fotky si uchov\xe1vejte i lok\xe1ln\u011b na po\u010d\xedta\u010di"]})]})]}),(0,T.jsxs)(c.F,{status:"warning",borderRadius:"lg",children:[(0,T.jsx)(u._,{}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(h.X,{fontSize:"sm",children:(0,T.jsxs)(k.z,{spacing:2,display:"inline-flex",children:[(0,T.jsx)(b.I,{as:C.BS8,boxSize:3}),(0,T.jsx)(S.E,{as:"span",children:"Pozor p\u0159i maz\xe1n\xed soubor\u016f!"})]})}),(0,T.jsx)(d.T,{fontSize:"sm",children:"Ne\u017e sma\u017eete obr\xe1zek, ov\u011b\u0159te, \u017ee ho nepou\u017e\xedv\xe1te v \u010dl\xe1nc\xedch, bannerech nebo jinde na webu. Po smaz\xe1n\xed se m\xedsto obr\xe1zku zobraz\xed chybov\xe1 hl\xe1\u0161k\xe1 (404)."})]})]}),(0,T.jsxs)(c.F,{status:"info",borderRadius:"lg",children:[(0,T.jsx)(u._,{}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(h.X,{fontSize:"sm",children:(0,T.jsxs)(k.z,{spacing:2,display:"inline-flex",children:[(0,T.jsx)(b.I,{as:C.g1V,boxSize:3}),(0,T.jsx)(S.E,{as:"span",children:"Spr\xe1va soubor\u016f"})]})}),(0,T.jsxs)(d.T,{fontSize:"sm",children:["Pro pokro\u010dilou spr\xe1vu v\u0161ech nahran\xfdch soubor\u016f pou\u017eijte sekci"," ",(0,T.jsx)(y.N,{href:"/admin/files",color:"blue.600",fontWeight:"bold",children:"Soubory"}),", kde vid\xedte celkov\xfd p\u0159ehled, velikosti a m\u016f\u017eete je filtrovat."]})]})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"gallery",icon:C.dkL,title:"Galerie"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"V sekci Galerie spravujete fotografie z akc\xed, z\xe1pas\u016f a dal\u0161\xedch klubov\xfdch ud\xe1lost\xed. M\u016f\u017eete vyu\u017e\xedt propojen\xed se slu\u017ebou Zonerama nebo nahr\xe1vat fotky p\u0159\xedmo."}),(0,T.jsx)(y.N,{href:"/admin/gallery",isExternal:!0,children:(0,T.jsxs)(k.z,{p:3,bg:(0,g.dU)("blue.50","blue.900"),borderRadius:"lg",_hover:{bg:(0,g.dU)("blue.100","blue.800")},transition:"all 0.2s",children:[(0,T.jsx)(b.I,{as:C.dkL,color:"blue.600",boxSize:5}),(0,T.jsx)(S.E,{fontWeight:"bold",color:"blue.700",children:"\u2192 Otev\u0159\xedt Galerii"})]})}),(0,T.jsxs)(k.z,{mt:2,spacing:2,children:[(0,T.jsx)(b.I,{as:C.dkL,color:(0,g.dU)("blue.600","blue.300"),boxSize:4}),(0,T.jsx)(z.D,{size:"sm",children:"Jak p\u0159idat fotogalerii?"})]}),(0,T.jsxs)(f._J,{spacing:2,pl:5,children:[(0,T.jsxs)(f.ck,{children:["Otev\u0159ete sekci"," ",(0,T.jsx)(y.N,{href:"/admin/gallery",color:"blue.600",fontWeight:"bold",children:"Galerie"})]}),(0,T.jsx)(f.ck,{children:'Klikn\u011bte na \u201eP\u0159idat album" nebo \u201eVytvo\u0159it galerii"'}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Vypl\u0148te n\xe1zev alba"}),' \u2014 nap\u0159. "Z\xe1pas proti Spartaku 15.10.2025"']}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"P\u0159idejte popis"})," \u2014 kr\xe1tk\xfd text, co fotky zobrazuj\xed"]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Nahrajte n\xe1hledov\xfd obr\xe1zek"})," \u2014 reprezentativn\xed foto, kter\xe9 se zobraz\xed jako n\xe1hled"]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Propojte se Zoneramou"})," (voliteln\xe9) \u2014 Pokud m\xe1te fotky na Zonerama.cz, vlo\u017ete odkaz na album"]}),(0,T.jsxs)(f.ck,{children:["Ulo\u017ete album \u2014 zobraz\xed se fanou\u0161k\u016fm na webu! ",(0,T.jsx)(b.I,{as:C.A7C,boxSize:3,display:"inline",color:"green.500"})]})]}),(0,T.jsxs)(m.a,{p:4,bg:(0,g.dU)("purple.50","purple.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"purple.500",children:[(0,T.jsxs)(k.z,{spacing:2,mb:2,children:[(0,T.jsx)(b.I,{as:C.__w,color:"purple.600"}),(0,T.jsx)(S.E,{fontWeight:"semibold",color:(0,g.dU)("purple.800","purple.200"),children:"Co je Zonerama?"})]}),(0,T.jsxs)(S.E,{fontSize:"sm",color:(0,g.dU)("purple.700","purple.200"),children:["Zonerama je \u010desk\xfd fotoserver, kde m\u016f\u017eete zdarma ukl\xe1dat fotky. Pokud tam u\u017e m\xe1te ",e("homepage.gallery").toLowerCase(),", m\u016f\u017eete je propojit s va\u0161\xedm webem a nemus\xedte je nahr\xe1vat znovu! Sta\u010d\xed vlo\u017eit odkaz."]})]}),(0,T.jsxs)(c.F,{status:"info",borderRadius:"lg",children:[(0,T.jsx)(u._,{}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(h.X,{fontSize:"sm",children:(0,T.jsxs)(k.z,{spacing:2,display:"inline-flex",children:[(0,T.jsx)(b.I,{as:C.ZPX,boxSize:3}),(0,T.jsx)(S.E,{as:"span",children:"Tip pro organizaci"})]})}),(0,T.jsx)(d.T,{fontSize:"sm",children:'Vytv\xe1\u0159ejte alba systematicky: "Sez\xf3na 2024/25 - Dom\xe1c\xed z\xe1pasy", "Letn\xed soust\u0159ed\u011bn\xed 2025" atd. Fanou\u0161k\u016fm se pak l\xe9pe hledaj\xed konkr\xe9tn\xed fotky!'})]})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"files",icon:C.g1V,title:"Spr\xe1va soubor\u016f"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsxs)(S.E,{children:["Sekce ",(0,T.jsx)(y.N,{href:"/admin/files",color:"blue.600",children:"Soubory"})," nab\xedz\xed p\u0159ehled v\u0161ech nahran\xfdch polo\u017eek v\u010detn\u011b velikosti a data nahr\xe1n\xed."]}),(0,T.jsxs)(f._J,{spacing:2,pl:5,children:[(0,T.jsx)(f.ck,{children:"Filtrujte podle typu souboru nebo n\xe1zvu \u2013 snadno najdete star\u0161\xed materi\xe1ly."}),(0,T.jsx)(f.ck,{children:"St\xe1hn\u011bte soubor p\u0159\xedmo z administrace pro lok\xe1ln\xed z\xe1lohu."}),(0,T.jsx)(f.ck,{children:"P\u0159i hromadn\xe9m \xfaklidu postupujte opatrn\u011b a dr\u017ete se doporu\u010den\xed v `FILES_MANAGEMENT_SYSTEM.md`."})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"sponzori-bannery",icon:C.DDN,title:"Sponzo\u0159i a bannery"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"Zobrazujte partnery klubu a spravujte reklamn\xed plochy na webu i v newsletterech."}),(0,T.jsxs)(f.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,T.jsxs)(f.ck,{children:["V sekci"," ",(0,T.jsx)(y.N,{href:"/admin/sponzori",color:"blue.600",children:"Sponzo\u0159i"})," p\u0159idejte logo, odkaz a po\u0159ad\xed zobrazen\xed."]}),(0,T.jsxs)(f.ck,{children:["Bannery vkl\xe1dejte p\u0159es"," ",(0,T.jsx)(y.N,{href:"/admin/bannery",color:"blue.600",children:"Bannery"}),"; nastavte c\xedlovou URL a obdob\xed platnosti."]}),(0,T.jsxs)(f.ck,{children:["Statistiky prokliku sledujte v sekci"," ",(0,T.jsx)(y.N,{href:"/admin/analytics",color:"blue.600",children:"Analytics"}),"."]})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"newsletter",icon:C.maD,title:"Newsletter a e-maily"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"Newsletter v\xe1m umo\u017e\u0148uje pos\xedlat hromadn\xe9 e-maily v\u0161em fanou\u0161k\u016fm, kte\u0159\xed se k odb\u011bru p\u0159ihl\xe1sili. Ide\xe1ln\xed pro ozn\xe1men\xed o z\xe1pasech, akc\xedch nebo d\u016fle\u017eit\xe9 informace o klubu."}),(0,T.jsx)(y.N,{href:"/admin/newsletter",isExternal:!0,children:(0,T.jsxs)(k.z,{p:3,bg:(0,g.dU)("blue.50","blue.900"),borderRadius:"lg",_hover:{bg:(0,g.dU)("blue.100","blue.800")},transition:"all 0.2s",children:[(0,T.jsx)(b.I,{as:C.maD,color:"blue.600",boxSize:5}),(0,T.jsx)(S.E,{fontWeight:"bold",color:"blue.700",children:"\u2192 Otev\u0159\xedt Newsletter"})]})}),(0,T.jsxs)(c.F,{status:"warning",borderRadius:"lg",children:[(0,T.jsx)(u._,{}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(h.X,{fontSize:"sm",children:(0,T.jsxs)(k.z,{spacing:2,display:"inline-flex",children:[(0,T.jsx)(b.I,{as:C.BS8,boxSize:3}),(0,T.jsx)(S.E,{as:"span",children:"P\u0159ed odesl\xe1n\xedm newsletteru"})]})}),(0,T.jsxs)(d.T,{fontSize:"sm",children:[(0,T.jsx)("strong",{children:"V\u017edy nejprve otestujte e-mail na sv\xe9 adrese!"})," Zkontrolujte, \u017ee v\u0161e vypad\xe1 dob\u0159e, \u017ee nejsou p\u0159eklepy a \u017ee obr\xe1zky se zobrazuj\xed spr\xe1vn\u011b. A\u017e pak ode\u0161lete v\u0161em."]})]})]}),(0,T.jsxs)(k.z,{spacing:2,children:[(0,T.jsx)(b.I,{as:C.maD,color:(0,g.dU)("blue.600","blue.300"),boxSize:4}),(0,T.jsx)(z.D,{size:"sm",children:"Postup: Jak odeslat newsletter?"})]}),(0,T.jsxs)(f._J,{spacing:2,pl:5,children:[(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Zkontrolujte SMTP nastaven\xed"})," \u2014 Mus\xed b\xfdt spr\xe1vn\u011b vypln\u011bn\xe9 v"," ",(0,T.jsx)(y.N,{href:"/admin/nastaveni",color:"blue.600",fontWeight:"bold",children:"Nastaven\xed"}),". Bez n\u011bj e-maily nep\u016fjdou odeslat!"]}),(0,T.jsxs)(f.ck,{children:["Otev\u0159ete"," ",(0,T.jsx)(y.N,{href:"/admin/newsletter",color:"blue.600",fontWeight:"bold",children:"Newsletter"})]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Vypl\u0148te p\u0159edm\u011bt e-mailu"}),' \u2014 nap\u0159. "Pozv\xe1nka na z\xe1pas s Technikou Brno"']}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"Napi\u0161te obsah"})," \u2014 M\u016f\u017eete pou\u017e\xedt norm\xe1ln\xed text nebo HTML form\xe1tov\xe1n\xed pro hez\u010d\xed vzhled"]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)("strong",{children:"D\u016eLE\u017dIT\xc9: Po\u0161lete testovac\xed e-mail"}),' \u2014 Klikn\u011bte na \u201eOdeslat test" a zadejte svou e-mailovou adresu. Zkontrolujte, jak e-mail vypad\xe1']}),(0,T.jsxs)(f.ck,{children:["Pokud v\u0161e vypad\xe1 dob\u0159e, klikn\u011bte na ",(0,T.jsx)("strong",{children:'\u201eOdeslat v\u0161em"'})," \u2014 e-mail se roze\u0161le v\u0161em p\u0159ihl\xe1\u0161en\xfdm"]})]}),(0,T.jsxs)(m.a,{p:4,bg:(0,g.dU)("blue.50","blue.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"blue.500",children:[(0,T.jsxs)(k.z,{spacing:2,mb:2,children:[(0,T.jsx)(b.I,{as:C.ZPX,color:"blue.600"}),(0,T.jsx)(S.E,{fontWeight:"semibold",color:(0,g.dU)("blue.800","blue.200"),children:"Tipy pro \xfasp\u011b\u0161n\xfd newsletter"})]}),(0,T.jsxs)(f.B8,{spacing:1,styleType:"disc",pl:5,fontSize:"sm",color:(0,g.dU)("blue.700","blue.200"),children:[(0,T.jsx)(f.ck,{children:"Pi\u0161te stru\u010dn\u011b a jasn\u011b \u2014 \u010dten\xe1\u0159i maj\xed m\xe1lo \u010dasu"}),(0,T.jsx)(f.ck,{children:"Pou\u017e\xedvejte poutav\xfd p\u0159edm\u011bt \u2014 zv\xfd\u0161\xed to \u0161anci, \u017ee e-mail otev\u0159ou"}),(0,T.jsx)(f.ck,{children:"P\u0159id\xe1vejte odkazy na web pro v\xedce informac\xed"}),(0,T.jsx)(f.ck,{children:"Nepos\xedlejte newslettery p\u0159\xedli\u0161 \u010dasto (doporu\u010deno: max 1-2x t\xfddn\u011b)"})]})]}),(0,T.jsxs)(m.a,{p:4,bg:(0,g.dU)("orange.50","orange.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"orange.500",children:[(0,T.jsxs)(k.z,{spacing:2,mb:2,children:[(0,T.jsx)(b.I,{as:C.BS8,color:"orange.600"}),(0,T.jsx)(S.E,{fontWeight:"semibold",color:(0,g.dU)("orange.800","orange.200"),children:"Probl\xe9m s odes\xedl\xe1n\xedm?"})]}),(0,T.jsxs)(S.E,{fontSize:"sm",color:(0,g.dU)("orange.700","orange.200"),children:["Pokud e-maily nejdou odeslat nebo padaj\xed do spamu, napi\u0161te n\xe1m na"," ",(0,T.jsx)(y.N,{href:"mailto:help@tdvorak.dev",color:"orange.600",fontWeight:"bold",children:"help@tdvorak.dev"})," ","a pom\u016f\u017eeme v\xe1m nastavit SMTP a dal\u0161\xed pokro\u010dil\xe9 v\u011bci (SPF, DKIM z\xe1znamy)."]})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"aliasy",icon:C.Z0L,title:"Alias sout\u011b\u017e\xed"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"Alias spr\xe1va slou\u017e\xed pro p\u0159ejmenov\xe1n\xed sout\u011b\u017e\xed importovan\xfdch z FA\u010cR tak, aby byly na webu srozumiteln\xe9 a jednotn\xe9."}),(0,T.jsxs)(f._J,{spacing:2,pl:5,children:[(0,T.jsxs)(f.ck,{children:["Otev\u0159ete"," ",(0,T.jsx)(y.N,{href:"/admin/aliasy-soutezi",color:"blue.600",children:"Alias sout\u011b\u017e\xed"}),"."]}),(0,T.jsx)(f.ck,{children:'Vyu\u017eijte automatick\xfd import ze soubor\u016f cache (tla\u010d\xedtko \u201eImportovat ze sout\u011b\u017e\xed").'}),(0,T.jsx)(f.ck,{children:"Upravte aliasy ru\u010dn\u011b nebo p\u0159et\xe1hn\u011bte po\u0159ad\xed pro prioritn\xed sout\u011b\u017ee."})]}),(0,T.jsxs)(c.F,{status:"info",borderRadius:"lg",children:[(0,T.jsx)(u._,{}),(0,T.jsx)(S.E,{fontSize:"sm",children:"Ka\u017ed\xe1 zm\u011bna se prop\xed\u0161e na front-end b\u011bhem n\u011bkolika sekund po ulo\u017een\xed."})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"prefetch",icon:C.KP4,title:"Prefetch a cache"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"Prefetch vytv\xe1\u0159\xed lok\xe1ln\xed cache dat (z\xe1pasy, videa, \u010dl\xe1nky) a v\xfdrazn\u011b zrychluje na\u010d\xedt\xe1n\xed webu."}),(0,T.jsxs)(f._J,{spacing:2,pl:5,children:[(0,T.jsxs)(f.ck,{children:["V sekci"," ",(0,T.jsx)(y.N,{href:"/admin/prefetch",color:"blue.600",children:"Prefetch"})," zkontrolujte posledn\xed b\u011bh a stav jednotliv\xfdch modul\u016f."]}),(0,T.jsx)(f.ck,{children:"Spus\u0165te ru\u010dn\u011b po v\u011bt\u0161\xedch obsahov\xfdch zm\u011bn\xe1ch nebo p\u0159i neaktu\xe1ln\xedch datech."}),(0,T.jsx)(f.ck,{children:"Sledujte upozorn\u011bn\xed na chyb\u011bj\xedc\xed tokeny \u010di API kl\xed\u010de (nap\u0159. YouTube). Bez nich se data neobnov\xed."})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"videa",icon:C.HiP,title:"Videa"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"Integrace s YouTube a dal\u0161\xedmi platformami umo\u017e\u0148uje vkl\xe1dat playlisty i jednotliv\xe1 videa."}),(0,T.jsxs)(f.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,T.jsxs)(f.ck,{children:["P\u0159id\xe1vejte videa v sekci"," ",(0,T.jsx)(y.N,{href:"/admin/videa",color:"blue.600",children:"Videa"})," pomoc\xed URL nebo ID videa."]}),(0,T.jsxs)(f.ck,{children:["Aktivujte automatick\xfd import playlistu p\u0159es"," ",(0,T.jsx)(y.N,{href:"/admin/prefetch",color:"blue.600",children:"Prefetch"}),"."]}),(0,T.jsx)(f.ck,{children:"N\xe1hledy se ukl\xe1daj\xed do cache; p\u0159i probl\xe9mech spus\u0165te znovu Prefetch modul Videa."})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"aktivity",icon:C.bfZ,title:"Aktivity"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"Klubov\xe9 akce, tr\xe9ninky a mimo-sout\u011b\u017en\xed ud\xe1losti m\u016f\u017eete prezentovat v kalend\xe1\u0159i i na \xfavodn\xed str\xe1nce."}),(0,T.jsxs)(f._J,{spacing:2,pl:5,children:[(0,T.jsxs)(f.ck,{children:["V sekci"," ",(0,T.jsx)(y.N,{href:"/admin/aktivity",color:"blue.600",children:"Aktivity"})," nastavte datum, m\xedsto a kr\xe1tk\xfd popis."]}),(0,T.jsx)(f.ck,{children:"P\u0159idejte obr\xe1zek nebo ikonu pro lep\u0161\xed vizu\xe1ln\xed zobrazen\xed."}),(0,T.jsx)(f.ck,{children:"Aktivitu ozna\u010dte jako ve\u0159ejnou, chcete-li ji zobrazit na webu."})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"merch",icon:C.lV_,title:"Oble\u010den\xed"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"Spravujte polo\u017eky klubov\xe9ho merche a informujte fanou\u0161ky o dostupnosti zbo\u017e\xed."}),(0,T.jsxs)(f.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,T.jsxs)(f.ck,{children:["P\u0159idejte polo\u017eky v"," ",(0,T.jsx)(y.N,{href:"/admin/merch",color:"blue.600",children:"Oble\u010den\xed"})," s popisem, cenou a fotkou."]}),(0,T.jsx)(f.ck,{children:'Vyu\u017eijte \u0161t\xedtky pro kategorizaci (nap\u0159. "dresy", "fan shop").'}),(0,T.jsx)(f.ck,{children:"Sledujte z\xe1jem fanou\u0161k\u016f p\u0159es kontaktn\xed formul\xe1\u0159 nebo dedikovan\xfd e-shop."})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"zpravy",icon:C.g5D,title:"Zpr\xe1vy"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"Zpr\xe1vy zahrnuj\xed kontaktn\xed formul\xe1\u0159e, p\u0159ihl\xe1\u0161ky a dal\u0161\xed komunikaci sm\u011brem ke klubu."}),(0,T.jsxs)(f.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,T.jsxs)(f.ck,{children:["V"," ",(0,T.jsx)(y.N,{href:"/admin/zpravy",color:"blue.600",children:"Zpr\xe1v\xe1ch"})," vid\xedte p\u0159ijat\xe9 zpr\xe1vy a jejich stav."]}),(0,T.jsx)(f.ck,{children:"Odpov\xeddejte z vlastn\xed e-mailov\xe9 schr\xe1nky; syst\xe9m uchov\xe1v\xe1 historii pouze informativn\u011b."}),(0,T.jsx)(f.ck,{children:"Ozna\u010dte vy\u0159\xedzen\xe9 zpr\xe1vy pro p\u0159ehlednost t\xfdmu."})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"contacts",icon:C.toK,title:"Kontakty a formul\xe1\u0159e"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsxs)(S.E,{children:["V sekci"," ",(0,T.jsx)(y.N,{href:"/admin/kontakty",color:"blue.600",children:"Kontakty"})," spravujete kontaktn\xed \xfadaje klubu a odpov\u011bdn\xe9 osoby pro jednotliv\xe9 typy dotaz\u016f."]}),(0,T.jsxs)(f._J,{spacing:2,pl:5,children:[(0,T.jsx)(f.ck,{children:"Zadejte telefon, e-mail a roli pro ka\u017ed\xe9ho kontaktn\xedho pracovn\xedka."}),(0,T.jsx)(f.ck,{children:"U formul\xe1\u0159\u016f lze nastavit c\xedlovou e-mailovou adresu a potvrzovac\xed zpr\xe1vu."}),(0,T.jsxs)(f.ck,{children:["Zkontrolujte odd\xedl ",(0,T.jsx)(y.N,{href:"/admin/zpravy",color:"blue.600",children:"Zpr\xe1vy"}),", zda se odes\xedlan\xe9 formul\xe1\u0159e ukl\xe1daj\xed spr\xe1vn\u011b."]})]}),(0,T.jsxs)(c.F,{status:"info",borderRadius:"lg",children:[(0,T.jsx)(u._,{}),(0,T.jsx)(S.E,{fontSize:"sm",children:"Kontaktn\xed \xfadaje se propisuj\xed do pati\u010dky webu i do automatick\xfdch e-mail\u016f."})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"analytics",icon:C.YYR,title:"Analytics a reporty"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsxs)(S.E,{children:["Sekce"," ",(0,T.jsx)(y.N,{href:"/admin/analytika",color:"blue.600",children:"Analytics"})," kombinuje statistiky z Umami a intern\xedch metrik syst\xe9mu. Sledujte n\xe1v\u0161t\u011bvnost, interakce a v\xfdkon jednotliv\xfdch str\xe1nek."]}),(0,T.jsxs)(f.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,T.jsx)(f.ck,{children:"P\u0159ehled n\xe1v\u0161t\u011bv podle \u010dasov\xe9ho obdob\xed a zdroj\u016f."}),(0,T.jsx)(f.ck,{children:"Top \u010dl\xe1nky, nej\u010dten\u011bj\u0161\xed kategorie a popularita vide\xed."}),(0,T.jsx)(f.ck,{children:"Informace o p\u0159ihl\xe1\u0161k\xe1ch k newsletteru a konverz\xedch formul\xe1\u0159\u016f."})]}),(0,T.jsx)(m.a,{p:4,bg:(0,g.dU)("green.50","green.900"),borderRadius:"lg",borderLeftWidth:"4px",borderLeftColor:"green.500",children:(0,T.jsx)(S.E,{fontSize:"sm",color:(0,g.dU)("green.700","green.200"),children:"Podrobn\xfd postup integrace najdete v souboru `UMAMI_SETUP_WITH_CLUB_NAME.md`. Doporu\u010dujeme nastavit i `UMAMI_ADMIN_EXCLUSION.md`, aby se nezapo\u010d\xedt\xe1valy administr\xe1torsk\xe9 n\xe1v\u0161t\u011bvy."})})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"scoreboard",icon:C.vF8,title:"Tabule (Scoreboard)"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsxs)(S.E,{children:["Scoreboard v"," ",(0,T.jsx)(y.N,{href:"/admin/scoreboard",color:"blue.600",children:"Tabuli"})," pou\u017e\xedv\xe1 data ze z\xe1pas\u016f a umo\u017e\u0148uje p\u0159ipravit grafiku na klubov\xe9 obrazovky."]}),(0,T.jsxs)(f._J,{spacing:2,pl:5,children:[(0,T.jsx)(f.ck,{children:"Vyberte sout\u011b\u017e a konkr\xe9tn\xed z\xe1pas pro zobrazen\xed."}),(0,T.jsx)(f.ck,{children:"Nastavte barevn\xe9 t\xe9ma v souladu s brandingem klubu."}),(0,T.jsx)(f.ck,{children:"Exportujte URL pro sd\xedlen\xed na velkoplo\u0161n\xfdch displej\xedch."})]}),(0,T.jsxs)(c.F,{status:"warning",borderRadius:"lg",children:[(0,T.jsx)(u._,{}),(0,T.jsxs)(S.E,{fontSize:"sm",children:["Scoreboard vy\u017eaduje aktu\xe1ln\xed data z FA\u010cR. Pokud se z\xe1pas nezobrazuje, ov\u011b\u0159te nastaven\xed v sekci ",(0,T.jsx)(y.N,{href:"/admin/aliasy-soutezi",color:"blue.600",children:"Alias sout\u011b\u017e\xed"})," a spus\u0165te Prefetch."]})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"mobile-scoreboard",icon:C.rle,title:"Mobiln\xed scoreboard"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsxs)(S.E,{children:["Pro ovl\xe1d\xe1n\xed tabule na d\xe1lku pou\u017eijte"," ",(0,T.jsx)(y.N,{href:"/admin/scoreboard/remote",color:"blue.600",children:"Mobiln\xed scoreboard"}),". Umo\u017e\u0148uje aktualizovat sk\xf3re v pr\u016fb\u011bhu utk\xe1n\xed p\u0159\xedmo z telefonu."]}),(0,T.jsxs)(f.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,T.jsx)(f.ck,{children:"P\u0159ihlaste se stejn\xfdm \xfa\u010dtem jako v administraci."}),(0,T.jsx)(f.ck,{children:"Vyberte z\xe1pas, kter\xfd sledujete, a nastavte sk\xf3re i \u010das."}),(0,T.jsx)(f.ck,{children:"Ov\u011b\u0159te internetov\xe9 p\u0159ipojen\xed \u2013 zm\u011bny se synchronizuj\xed okam\u017eit\u011b na ve\u0159ejn\xe9 tabuli."})]}),(0,T.jsxs)(c.F,{status:"success",borderRadius:"lg",children:[(0,T.jsx)(u._,{}),(0,T.jsx)(S.E,{fontSize:"sm",children:"Funkce je optimalizovan\xe1 pro PWA. P\u0159idejte si ji na domovskou obrazovku pro rychl\xfd p\u0159\xedstup."})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"uzivatele",icon:C.pXu,title:"U\u017eivatel\xe9 a p\u0159\xedstupy"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"Spravujte p\u0159\xedstupy administr\xe1tor\u016f i redaktor\u016f, nastavujte role a resetujte hesla."}),(0,T.jsxs)(f._J,{spacing:2,pl:5,children:[(0,T.jsxs)(f.ck,{children:["V"," ",(0,T.jsx)(y.N,{href:"/admin/uzivatele",color:"blue.600",children:"U\u017eivatel\xedch"})," p\u0159idejte nov\xe9 \xfa\u010dty a p\u0159id\u011blte roli ",(0,T.jsx)(x.C,{children:"admin"})," nebo ",(0,T.jsx)(x.C,{children:"user"}),"."]}),(0,T.jsxs)(f.ck,{children:["Pro reset hesla vyu\u017eijte n\xe1stroj"," ",(0,T.jsx)(y.N,{href:"/admin/users/send-reset",color:"blue.600",children:"Odeslat reset"}),"."]}),(0,T.jsx)(f.ck,{children:"Doporu\u010dujeme zapnout dvoufaktorov\xe9 ov\u011b\u0159en\xed na e-mailov\xfdch \xfa\u010dtech administr\xe1tor\u016f."})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"docs",icon:C.__w,title:"Intern\xed dokumentace"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"V repozit\xe1\u0159i najdete rozs\xe1hl\xe9 manu\xe1ly k jednotliv\xfdm oblastem. Doporu\u010dujeme proj\xedt alespo\u0148 tyto:"}),(0,T.jsxs)(f.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,T.jsxs)(f.ck,{children:[(0,T.jsx)(x.C,{children:"FRONTEND_FUNCTIONALITY_REPORT.md"})," \u2013 podrobn\xfd popis ve\u0159ejn\xe9ho webu."]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)(x.C,{children:"BACKEND_FUNCTIONALITY_REPORT.md"})," \u2013 vysv\u011btlen\xed API a datov\xfdch tok\u016f."]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)(x.C,{children:"NEWSLETTER_SYSTEM.md"})," a ",(0,T.jsx)(x.C,{children:"FILES_MANAGEMENT_SYSTEM.md"})," \u2013 detailn\xed pracovn\xed postupy."]})]}),(0,T.jsxs)(c.F,{status:"info",borderRadius:"lg",children:[(0,T.jsx)(u._,{}),(0,T.jsx)(S.E,{fontSize:"sm",children:"Kompletn\xed seznam manu\xe1l\u016f najdete v adres\xe1\u0159i `docs/` (ko\u0159en projektu). Dokumenty jsou pr\u016fb\u011b\u017en\u011b aktualizovan\xe9 \u2013 sledujte datum posledn\xed revize."})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"checklist",icon:C.lfF,title:"Checklisty a postupy"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"Pro rychl\xe9 spu\u0161t\u011bn\xed nov\xfdch funkc\xed vyu\u017eijte p\u0159ipraven\xe9 checklisty. Najdete je v ko\u0159enov\xe9m adres\xe1\u0159i projektu a v administraci slou\u017e\xed jako dopln\u011bk k t\xe9to dokumentaci."}),(0,T.jsxs)(f._J,{spacing:2,pl:5,children:[(0,T.jsxs)(f.ck,{children:[(0,T.jsx)(x.C,{children:"NEWSLETTER_FEATURE_CHECKLIST.md"})," \u2013 krok za krokem konfigurace newsletteru."]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)(x.C,{children:"FILES_MANAGEMENT_TESTING.md"})," \u2013 co ov\u011b\u0159it, ne\u017e nasad\xedte novou sadu soubor\u016f."]}),(0,T.jsxs)(f.ck,{children:[(0,T.jsx)(x.C,{children:"MAP_IMPORT_COMPLETE_IMPLEMENTATION.md"})," a souvisej\xedc\xed checklisty pro import mapov\xfdch dat."]})]}),(0,T.jsxs)(c.F,{status:"success",borderRadius:"lg",children:[(0,T.jsx)(u._,{}),(0,T.jsx)(S.E,{fontSize:"sm",children:"Checklisty si m\u016f\u017eete st\xe1hnout jako PDF a sd\xedlet v r\xe1mci klubu \u2013 usnadn\xedte tak za\u0161kolen\xed nov\xfdch \u010dlen\u016f t\xfdmu."})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"seo",icon:C.KSO,title:"SEO a Analytics"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:4,mb:6,children:[(0,T.jsx)(S.E,{children:"Spr\xe1vn\xe9 SEO nastaven\xed a analytika v\xe1m pom\u016f\u017eou sledovat n\xe1v\u0161t\u011bvnost webu a optimalizovat obsah."}),(0,T.jsxs)(f.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,T.jsxs)(f.ck,{children:["U ka\u017ed\xe9ho \u010dl\xe1nku vypl\u0148te ",(0,T.jsx)("strong",{children:"SEO titulek"}),", ",(0,T.jsx)("strong",{children:"SEO popis"})," a slug bez diakritiky."]}),(0,T.jsxs)(f.ck,{children:["Integrujte slu\u017ebu"," ",(0,T.jsx)(y.N,{href:"/admin/analytics",color:"blue.600",children:"Umami Analytics"})," dle pr\u016fvodce v souboru `UMAMI_SETUP_WITH_CLUB_NAME.md`."]}),(0,T.jsx)(f.ck,{children:"Pro soci\xe1ln\xed s\xedt\u011b dopl\u0148te Open Graph a Twitter metatagy v nastaven\xed."})]}),(0,T.jsxs)(c.F,{status:"success",borderRadius:"lg",children:[(0,T.jsx)(u._,{}),(0,T.jsx)(S.E,{fontSize:"sm",children:"Auditujte SEO pravideln\u011b \u2014 jednoduch\xe9 \xfapravy nadpis\u016f a popis\u016f v\xfdrazn\u011b zlep\u0161\xed dosah."})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{children:[(0,T.jsx)(M,{id:"troubleshooting",icon:C.KRc,title:"\u0158e\u0161en\xed probl\xe9m\u016f"}),(0,T.jsxs)(_.T,{align:"stretch",spacing:6,mb:6,children:[(0,T.jsxs)(i.n,{allowMultiple:!0,children:[(0,T.jsxs)(s.A,{borderColor:I,children:[(0,T.jsx)("h3",{children:(0,T.jsxs)(o.J,{children:[(0,T.jsxs)(k.z,{flex:"1",textAlign:"left",fontWeight:"semibold",children:[(0,T.jsx)(b.I,{as:C.BS8,boxSize:4}),(0,T.jsx)(S.E,{children:"E-maily se neodes\xedlaj\xed"})]}),(0,T.jsx)(r.Q,{})]})}),(0,T.jsx)(l.v,{pb:4,children:(0,T.jsxs)(f._J,{spacing:2,pl:5,children:[(0,T.jsxs)(f.ck,{children:["Zkontrolujte SMTP nastaven\xed v"," ",(0,T.jsx)(y.N,{href:"/admin/nastaveni",color:"blue.600",children:"Nastaven\xed"})]}),(0,T.jsx)(f.ck,{children:"Ov\u011b\u0159te port: 465 = SSL, 587 = STARTTLS"}),(0,T.jsx)(f.ck,{children:'Gmail vy\u017eaduje \u201eApp Password", ne b\u011b\u017en\xe9 heslo'}),(0,T.jsx)(f.ck,{children:"Zkuste odeslat testovac\xed e-mail z Newsletteru"}),(0,T.jsx)(f.ck,{children:"Zkontrolujte serverov\xe9 logy pro chybov\xe9 hl\xe1\u0161ky"})]})})]}),(0,T.jsxs)(s.A,{borderColor:I,children:[(0,T.jsx)("h3",{children:(0,T.jsxs)(o.J,{children:[(0,T.jsxs)(k.z,{flex:"1",textAlign:"left",fontWeight:"semibold",children:[(0,T.jsx)(b.I,{as:C.dkL,boxSize:4}),(0,T.jsx)(S.E,{children:"Obr\xe1zky se nezobrazuj\xed"})]}),(0,T.jsx)(r.Q,{})]})}),(0,T.jsx)(l.v,{pb:4,children:(0,T.jsxs)(f.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,T.jsxs)(f.ck,{children:["Nahrajte obr\xe1zek do"," ",(0,T.jsx)(y.N,{href:"/admin/soubory",color:"blue.600",children:"M\xe9dia"})]}),(0,T.jsxs)(f.ck,{children:["Pou\u017eijte relativn\xed cestu: ",(0,T.jsx)(x.C,{children:"/uploads/2025/01/obrazek.jpg"})]}),(0,T.jsxs)(f.ck,{children:["Pro extern\xed zdroje pou\u017eijte proxy: ",(0,T.jsx)(x.C,{children:"/api/v1/proxy/image?url=..."})]}),(0,T.jsx)(f.ck,{children:"Zkontrolujte, \u017ee soubor existuje a je ve\u0159ejn\u011b p\u0159\xedstupn\xfd"})]})})]}),(0,T.jsxs)(s.A,{borderColor:I,children:[(0,T.jsx)("h3",{children:(0,T.jsxs)(o.J,{children:[(0,T.jsxs)(k.z,{flex:"1",textAlign:"left",fontWeight:"semibold",children:[(0,T.jsx)(b.I,{as:C.i0U,boxSize:4}),(0,T.jsx)(S.E,{children:"FA\u010cR data nejsou aktu\xe1ln\xed"})]}),(0,T.jsx)(r.Q,{})]})}),(0,T.jsx)(l.v,{pb:4,children:(0,T.jsxs)(f._J,{spacing:2,pl:5,children:[(0,T.jsxs)(f.ck,{children:["Spus\u0165te"," ",(0,T.jsx)(y.N,{href:"/admin/prefetch",color:"blue.600",children:"Prefetch"})," ","ru\u010dn\u011b"]}),(0,T.jsx)(f.ck,{children:"Zkontrolujte Club ID a Club Type v Nastaven\xed"}),(0,T.jsx)(f.ck,{children:"Ov\u011b\u0159te \u010das posledn\xedho b\u011bhu v Prefetch statusu"}),(0,T.jsx)(f.ck,{children:"Zkontrolujte internetov\xe9 p\u0159ipojen\xed serveru"})]})})]}),(0,T.jsxs)(s.A,{borderColor:I,children:[(0,T.jsx)("h3",{children:(0,T.jsxs)(o.J,{children:[(0,T.jsxs)(k.z,{flex:"1",textAlign:"left",fontWeight:"semibold",children:[(0,T.jsx)(b.I,{as:C.pXu,boxSize:4}),(0,T.jsx)(S.E,{children:"Nelze se p\u0159ihl\xe1sit"})]}),(0,T.jsx)(r.Q,{})]})}),(0,T.jsx)(l.v,{pb:4,children:(0,T.jsxs)(f.B8,{spacing:2,styleType:"disc",pl:5,children:[(0,T.jsx)(f.ck,{children:"Ov\u011b\u0159te e-mail a heslo (hesla jsou case-sensitive)"}),(0,T.jsx)(f.ck,{children:'Pou\u017eijte \u201eZapomenut\xe9 heslo" pro reset'}),(0,T.jsxs)(f.ck,{children:["Zkontrolujte, \u017ee \xfa\u010det m\xe1 roli ",(0,T.jsx)(x.C,{children:"admin"})]}),(0,T.jsx)(f.ck,{children:"Vy\u010dkejte 5 minut po n\u011bkolika ne\xfasp\u011b\u0161n\xfdch pokusech (ochrana proti brute-force)"})]})})]})]}),(0,T.jsxs)(m.a,{p:5,bg:(0,g.dU)("green.50","green.900"),borderRadius:"lg",borderWidth:"2px",borderColor:(0,g.dU)("green.300","green.600"),children:[(0,T.jsxs)(k.z,{spacing:2,mb:3,children:[(0,T.jsx)(b.I,{as:C.Qro,color:"green.600",boxSize:5}),(0,T.jsx)(S.E,{fontWeight:"bold",color:(0,g.dU)("green.800","green.200"),fontSize:"lg",children:"Pot\u0159ebujete pomoc?"})]}),(0,T.jsx)(S.E,{fontSize:"sm",color:(0,g.dU)("green.700","green.200"),mb:3,children:"Pokud probl\xe9m p\u0159etrv\xe1v\xe1 nebo si nev\xedte rady, zkuste nejprve tyto kroky:"}),(0,T.jsxs)(f.B8,{spacing:2,styleType:"disc",pl:5,fontSize:"sm",color:(0,g.dU)("green.700","green.200"),mb:4,children:[(0,T.jsx)(f.ck,{children:"Vyma\u017ete cache (mezipam\u011b\u0165) prohl\xed\u017ee\u010de a obnovte str\xe1nku (Ctrl+F5)"}),(0,T.jsx)(f.ck,{children:"Zkuste jin\xfd prohl\xed\u017ee\u010d (Chrome, Firefox, Edge)"}),(0,T.jsx)(f.ck,{children:"Odhlaste se a p\u0159ihlaste znovu"}),(0,T.jsx)(f.ck,{children:"Zkontrolujte internetov\xe9 p\u0159ipojen\xed"})]}),(0,T.jsx)(v.c,{borderColor:(0,g.dU)("green.300","green.600"),mb:3}),(0,T.jsxs)(k.z,{spacing:2,mb:2,children:[(0,T.jsx)(b.I,{as:C.maD,color:(0,g.dU)("green.600","green.300"),boxSize:4}),(0,T.jsx)(S.E,{fontSize:"md",fontWeight:"bold",color:(0,g.dU)("green.800","green.100"),children:"St\xe1le nefunguje? Ozv\u011bte se n\xe1m!"})]}),(0,T.jsxs)(S.E,{fontSize:"sm",color:(0,g.dU)("green.700","green.200"),mb:2,children:["Napi\u0161te n\xe1m na"," ",(0,T.jsx)(y.N,{href:"mailto:help@tdvorak.dev",color:"green.600",fontWeight:"bold",fontSize:"md",children:"help@tdvorak.dev"})," ","a popi\u0161te probl\xe9m. Odpov\xedd\xe1me do 24 hodin a r\xe1di v\xe1m pom\u016f\u017eeme!"]}),(0,T.jsx)(S.E,{fontSize:"xs",color:(0,g.dU)("green.600","green.300"),fontStyle:"italic",children:"Tip: Do e-mailu p\u0159ilo\u017ete screenshot probl\xe9mu, urychl\xedte t\xedm \u0159e\u0161en\xed."})]})]}),(0,T.jsx)(y.N,{href:"#top",color:"blue.600",fontSize:"sm",children:(0,T.jsxs)(k.z,{as:"span",spacing:1,children:[(0,T.jsx)(b.I,{as:C.uCC,boxSize:3}),(0,T.jsx)(S.E,{children:"Zp\u011bt na za\u010d\xe1tek"})]})})]}),(0,T.jsx)(v.c,{my:8}),(0,T.jsxs)(m.a,{p:6,bg:(0,g.dU)("purple.50","purple.900"),borderRadius:"xl",borderWidth:"2px",borderColor:(0,g.dU)("purple.200","purple.700"),textAlign:"center",mb:6,children:[(0,T.jsx)(b.I,{as:C.maD,boxSize:12,color:"purple.500",mb:3}),(0,T.jsx)(z.D,{size:"lg",mb:3,color:(0,g.dU)("purple.800","purple.200"),children:"Pot\u0159ebujete pomoc?"}),(0,T.jsx)(S.E,{fontSize:"md",mb:4,color:(0,g.dU)("purple.700","purple.300"),children:"M\xe1te dotazy, narazili jste na probl\xe9m nebo hled\xe1te vlastn\xed \xfapravy a roz\u0161\xed\u0159en\xed syst\xe9mu?"}),(0,T.jsxs)(_.T,{spacing:3,children:[(0,T.jsxs)(m.a,{children:[(0,T.jsxs)(k.z,{spacing:2,justify:"center",mb:2,children:[(0,T.jsx)(b.I,{as:C.maD,color:"purple.600",boxSize:5}),(0,T.jsx)(S.E,{fontWeight:"bold",fontSize:"lg",color:(0,g.dU)("purple.900","purple.100"),children:"Technick\xe1 podpora"})]}),(0,T.jsx)(y.N,{href:"mailto:help@tdvorak.dev",fontSize:"xl",color:"purple.600",fontWeight:"bold",_hover:{color:"purple.700",textDecoration:"underline"},children:"help@tdvorak.dev"}),(0,T.jsx)(S.E,{fontSize:"sm",color:(0,g.dU)("purple.600","purple.400"),mt:1,children:"Odpov\xedd\xe1me do 24 hodin"})]}),(0,T.jsx)(v.c,{borderColor:(0,g.dU)("purple.300","purple.600")}),(0,T.jsxs)(m.a,{children:[(0,T.jsxs)(k.z,{spacing:2,justify:"center",mb:2,children:[(0,T.jsx)(b.I,{as:C.ZPX,color:"purple.600",boxSize:4}),(0,T.jsx)(S.E,{fontWeight:"bold",fontSize:"md",color:(0,g.dU)("purple.900","purple.100"),children:"Vlastn\xed \xfapravy a implementace"})]}),(0,T.jsxs)(S.E,{fontSize:"sm",color:(0,g.dU)("purple.700","purple.300"),children:["Chcete p\u0159idat nov\xe9 funkce nebo p\u0159izp\u016fsobit syst\xe9m va\u0161im specifick\xfdm pot\u0159eb\xe1m?",(0,T.jsx)("br",{}),"Kontaktujte n\xe1s a spole\u010dn\u011b zjist\xedme, zda je va\u0161e p\u0159edstava realizovateln\xe1.",(0,T.jsx)("br",{}),(0,T.jsx)("strong",{children:"R\xe1di v\xe1m pom\u016f\u017eeme roz\u0161\xed\u0159it syst\xe9m dle va\u0161ich po\u017eadavk\u016f!"})]})]})]})]}),(0,T.jsxs)(m.a,{textAlign:"center",py:6,color:"gray.500",children:[(0,T.jsxs)(k.z,{spacing:2,justify:"center",children:[(0,T.jsx)(b.I,{as:C.hko,color:"gray.500",boxSize:4}),(0,T.jsx)(S.E,{fontSize:"sm",fontWeight:"medium",children:"Dokumentace administra\u010dn\xedho syst\xe9mu \u2022 Verze 1.0"})]}),(0,T.jsxs)(S.E,{fontSize:"xs",mt:1,children:["Posledn\xed aktualizace: ",(new Date).toLocaleDateString("cs-CZ")]}),(0,T.jsx)(S.E,{fontSize:"xs",mt:3,color:"gray.400",children:"Vytvo\u0159eno pro snadnou spr\xe1vu klubov\xfdch web\u016f \u2022 \u017d\xe1dn\xe9 technick\xe9 znalosti nejsou nutn\xe9"})]})]})})]})})})}},69522:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var a=n(65043),i=n(74117),o=n(25189),r=n(56644),s=n(70579);function l(e){try{const t=String(e||"");if(!t)return;const n=t.match(/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/);return n?n[0].toLowerCase():void 0}catch(t){return}}const c=e=>{let{rows:t,onRowClick:n,variant:c="logos"}=e;const{t:d}=(0,i.Bd)(),u=Array.isArray(t)?t:[],[h,m]=(0,a.useState)(null),[p,x]=(0,a.useState)(null),[g,v]=(0,a.useState)({}),j=e=>{if("number"===typeof e)return e;const t=parseFloat(String(null!==e&&void 0!==e?e:"").replace(/[^0-9\-\.]/g,""));return isNaN(t)?0:t},b=e=>{const t=String(null!==e&&void 0!==e?e:"").trim(),n=t.match(/(-?\d+)\s*[:\-]\s*(-?\d+)/);return n?Number(n[1])-Number(n[2]):j(t)},y=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[\u2012\u2013\u2014\u2015\u2212]/g,"-").replace(/[.,!;:()\[\]{}]/g," ").replace(/[\s,]*(z\.?\s*s\.?|o\.?\s*s\.?)\s*$/g,"").replace(/\s+/g," ").trim().toLowerCase(),f=(0,a.useMemo)(()=>(null===g||void 0===g?void 0:g.by_id)||{},[g]),k=(0,a.useMemo)(()=>{const e={};try{for(const[t,n]of Object.entries(f)){const a=String((null===n||void 0===n?void 0:n.name)||"").trim();if(!a)continue;const i=y(a);i&&(e[i]={id:t,name:a})}}catch(t){}return e},[f]),_=(e,t,n)=>{var a;const i=String(e||"")||l(n)||"",o=i&&(null===(a=f[i])||void 0===a?void 0:a.name)||"";if(o&&o.trim().length>0)return o;if(t){var r;const e=y(t);let n=k[e];if(!n)for(const[t,a]of Object.entries(k))if(t&&(e.endsWith(t)||t.endsWith(e))){n=a;break}if(null!==(r=n)&&void 0!==r&&r.name)return n.name}return t||""};(0,a.useEffect)(()=>{let e=!0;return(async()=>{const t=Date.now();let n=null;try{const e=await fetch("/api/v1/public/team-logo-overrides?t=".concat(t),{cache:"no-cache"});e.ok&&(n=await e.json())}catch(a){}if(!n)try{const e=await fetch("/cache/prefetch/team_logo_overrides.json",{cache:"no-cache"});e.ok&&(n=await e.json())}catch(i){}e&&v(n||{by_id:{},by_name:{}})})(),()=>{e=!1}},[]);const w=e=>{var t,n,a,i;return(0,o.Lt)(_(null===e||void 0===e?void 0:e.team_id,null!==(t=null!==(n=null!==(a=null===e||void 0===e||null===(i=e.team)||void 0===i?void 0:i.name)&&void 0!==a?a:null===e||void 0===e?void 0:e.team)&&void 0!==n?n:null===e||void 0===e?void 0:e.club)&&void 0!==t?t:"",null===e||void 0===e?void 0:e.team_logo_url))},z=e=>{var t,n;return j(null!==(t=null!==(n=null===e||void 0===e?void 0:e.rank)&&void 0!==n?n:null===e||void 0===e?void 0:e.pos)&&void 0!==t?t:null===e||void 0===e?void 0:e.position)},S=e=>{if(h!==e)return m(e),void x("desc");"desc"!==p?(m(null),x(null)):x("asc")},A=(0,a.useMemo)(()=>{if(!h||!p)return u;const e=[...u];return e.sort((e,t)=>{var n,a,i,o,r,s,l,c,d,u;let m,x,g=!1;switch(h){case"team":m=w(e),x=w(t),g=!0;break;case"rank":m=z(e),x=z(t);break;case"played":m=j(null!==(n=null===e||void 0===e?void 0:e.played)&&void 0!==n?n:null===e||void 0===e?void 0:e.matches),x=j(null!==(a=null===t||void 0===t?void 0:t.played)&&void 0!==a?a:null===t||void 0===t?void 0:t.matches);break;case"wins":m=j(null!==(i=null===e||void 0===e?void 0:e.wins)&&void 0!==i?i:null===e||void 0===e?void 0:e.win),x=j(null!==(o=null===t||void 0===t?void 0:t.wins)&&void 0!==o?o:null===t||void 0===t?void 0:t.win);break;case"draws":m=j(null!==(r=null===e||void 0===e?void 0:e.draws)&&void 0!==r?r:null===e||void 0===e?void 0:e.draw),x=j(null!==(s=null===t||void 0===t?void 0:t.draws)&&void 0!==s?s:null===t||void 0===t?void 0:t.draw);break;case"losses":m=j(null!==(l=null===e||void 0===e?void 0:e.losses)&&void 0!==l?l:null===e||void 0===e?void 0:e.loss),x=j(null!==(c=null===t||void 0===t?void 0:t.losses)&&void 0!==c?c:null===t||void 0===t?void 0:t.loss);break;case"score":m=b(null===e||void 0===e?void 0:e.score),x=b(null===t||void 0===t?void 0:t.score);break;case"points":m=j(null!==(d=null===e||void 0===e?void 0:e.points)&&void 0!==d?d:null===e||void 0===e?void 0:e.pts),x=j(null!==(u=null===t||void 0===t?void 0:t.points)&&void 0!==u?u:null===t||void 0===t?void 0:t.pts);break;default:m=0,x=0}let v=g?String(m).localeCompare(String(x)):m-x;if("desc"===p&&(v=-v),0===v){v=z(e)-z(t)}return v}),e},[u,h,p]),C=e=>h===e?"desc"===p?" \u25bc":" \u25b2":"";return(0,s.jsx)("div",{className:"table-card",children:(0,s.jsx)("div",{className:"standings-table-wrapper",style:{overflowX:"auto"},children:(0,s.jsxs)("table",{className:"standings-table-compact",style:{width:"100%",borderCollapse:"separate",borderSpacing:"0 4px"},children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{style:{fontSize:"0.75rem",color:"var(--dark-gray)",textTransform:"uppercase"},children:[(0,s.jsxs)("th",{onClick:()=>S("rank"),style:{padding:"6px 8px",textAlign:"left",fontWeight:600,cursor:"pointer",userSelect:"none"},children:["# ",C("rank")]}),(0,s.jsxs)("th",{onClick:()=>S("team"),style:{padding:"6px 8px",textAlign:"left",fontWeight:600,cursor:"pointer",userSelect:"none"},children:[d("homepage.team"),C("team")]}),(0,s.jsxs)("th",{onClick:()=>S("played"),style:{padding:"6px 4px",textAlign:"center",fontWeight:600,cursor:"pointer",userSelect:"none"},children:[d("homepage.played"),C("played")]}),(0,s.jsxs)("th",{onClick:()=>S("wins"),style:{padding:"6px 4px",textAlign:"center",fontWeight:600,cursor:"pointer",userSelect:"none"},children:[d("homepage.won"),C("wins")]}),(0,s.jsxs)("th",{onClick:()=>S("draws"),style:{padding:"6px 4px",textAlign:"center",fontWeight:600,cursor:"pointer",userSelect:"none"},children:[d("homepage.drawn"),C("draws")]}),(0,s.jsxs)("th",{onClick:()=>S("losses"),style:{padding:"6px 4px",textAlign:"center",fontWeight:600,cursor:"pointer",userSelect:"none"},children:[d("homepage.lost"),C("losses")]}),(0,s.jsxs)("th",{onClick:()=>S("score"),style:{padding:"6px 4px",textAlign:"center",fontWeight:600,display:"none",cursor:"pointer",userSelect:"none"},className:"hide-mobile",children:[d("homepage.goals"),C("score")]}),(0,s.jsxs)("th",{onClick:()=>S("points"),style:{padding:"6px 8px",textAlign:"center",fontWeight:600,cursor:"pointer",userSelect:"none"},children:[d("homepage.points"),C("points")]})]})}),(0,s.jsx)("tbody",{children:A.slice(0,8).map((e,t)=>{var a,i,u,h,m,p,x,g,v,j,b,y,f,k,w,z,S,A;const C=null!==(a=null!==(i=null!==(u=null===(h=e.team)||void 0===h?void 0:h.name)&&void 0!==u?u:e.team)&&void 0!==i?i:e.club)&&void 0!==a?a:"-",E=(0,o.Lt)(_(e.team_id,C,e.team_logo_url)),T=e.team_id||l(e.team_logo_url);return(0,s.jsxs)("tr",{onClick:()=>null===n||void 0===n?void 0:n(e,t),style:{cursor:n?"pointer":"default",background:"var(--card-bg)",border:"1px solid var(--card-border)",borderRadius:"8px",transition:"all 0.2s ease"},onMouseEnter:e=>{e.currentTarget.style.boxShadow="0 4px 12px rgba(0,0,0,0.08)",e.currentTarget.style.borderColor="var(--primary)"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="none",e.currentTarget.style.borderColor="var(--card-border)"},children:[(0,s.jsx)("td",{style:{padding:"10px 8px",fontWeight:700,color:"var(--secondary)"},children:null!==(m=null!==(p=null!==(x=e.position)&&void 0!==x?x:e.pos)&&void 0!==p?p:e.rank)&&void 0!==m?m:t+1}),(0,s.jsx)("td",{style:{padding:"10px 8px",fontWeight:600},children:"logos"===c?(0,s.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,minWidth:0},children:[(0,s.jsx)(r.L,{teamId:T,teamName:E,facrLogo:e.team_logo_url,size:"small",alt:E||d("homepage.team"),borderRadius:"full"}),(0,s.jsx)("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:E})]}):E}),(0,s.jsx)("td",{style:{padding:"10px 4px",textAlign:"center"},children:null!==(g=null!==(v=e.played)&&void 0!==v?v:e.matches)&&void 0!==g?g:"-"}),(0,s.jsx)("td",{style:{padding:"10px 4px",textAlign:"center"},children:null!==(j=null!==(b=e.wins)&&void 0!==b?b:e.win)&&void 0!==j?j:"-"}),(0,s.jsx)("td",{style:{padding:"10px 4px",textAlign:"center"},children:null!==(y=null!==(f=e.draws)&&void 0!==f?f:e.draw)&&void 0!==y?y:"-"}),(0,s.jsx)("td",{style:{padding:"10px 4px",textAlign:"center"},children:null!==(k=null!==(w=e.losses)&&void 0!==w?w:e.loss)&&void 0!==k?k:"-"}),(0,s.jsx)("td",{style:{padding:"10px 4px",textAlign:"center",display:"none"},className:"hide-mobile",children:null!==(z=e.score)&&void 0!==z?z:"-"}),(0,s.jsx)("td",{style:{padding:"10px 8px",textAlign:"center",fontWeight:800},children:null!==(S=null!==(A=e.points)&&void 0!==A?A:e.pts)&&void 0!==S?S:"-"})]},t)})})]})})})}},70082:(e,t,n)=>{n.d(t,{BI:()=>l,V1:()=>r,hA:()=>o,hv:()=>s,xN:()=>i});var a=n(46291);async function i(){const e=await a.Ay.get("/competition-aliases");return Array.isArray(e.data)?e.data:e.data.data}async function o(){const e=await a.Ay.get("/admin/competition-aliases");return Array.isArray(e.data)?e.data:e.data.data}async function r(e,t){const n=await a.Ay.put("/admin/competition-aliases/".concat(encodeURIComponent(e)),t);return n.data.code?n.data:n.data.data}async function s(e){const t=await a.Ay.delete("/admin/competition-aliases/".concat(encodeURIComponent(e)));return t.data&&"undefined"!==typeof t.data.ok?t.data:void 0}async function l(e){return(await a.Ay.post("/admin/competition-aliases/reorder",{items:e})).data}},70118:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(65043),i=n(22107),o=n(42703),r=n(44093),s=n(96148),l=n(28846),c=n(14261),d=n(63856),u=n(78801),h=n(70579);const m=e=>{let{title:t,rightAction:n,children:m,draggable:p=!1,autoScroll:x=!1,autoSpeed:g=1.2,rewindLoop:v=!0,pauseOnHover:j=!0,infiniteScroll:b=!1}=e;const y=(0,a.useRef)(null),f=(0,u.N)(),[k,_]=((0,r.dU)("white","gray.800"),(0,a.useState)(!1)),w=(0,a.useRef)(!1),z=(0,a.useRef)(0),S=(0,a.useRef)(0),A=(0,a.useRef)(!1),C=(0,a.useRef)(null),E=e=>{const t=y.current;if(!t)return;const n=Math.floor(.7*t.clientWidth)*e;t.scrollBy({left:n,behavior:"smooth"})},T=e=>{const t=y.current;t&&(w.current=!0,A.current=!1,z.current=e,S.current=t.scrollLeft,t.style.scrollSnapType="none",t.style.cursor="grabbing",document.body.style.userSelect="none")},D=e=>{const t=y.current;if(!t||!w.current)return;const n=e-z.current;Math.abs(n)>3&&(A.current=!0),t.scrollLeft=S.current-n},N=()=>{const e=y.current;w.current=!1,e&&(e.style.cursor="grab"),document.body.style.userSelect="",e&&setTimeout(()=>{e&&(e.style.scrollSnapType="x mandatory")},100)};return(0,a.useEffect)(()=>{const e=y.current;if(!x||!e)return;if(b){const t=e.scrollWidth/2;e.scrollLeft=t}let t=!0;const n=()=>{if(!t||!e)return;const a=e.scrollLeft,i=e.scrollWidth,o=e.clientWidth;if(!(j&&k||w.current))if(b){a>=i/2?e.scrollLeft=0:e.scrollLeft+=g}else{const t=a+o>=i-2;t&&v?e.scrollLeft=0:t||(e.scrollLeft+=g)}C.current=requestAnimationFrame(n)};return C.current=requestAnimationFrame(n),()=>{t=!1,null!==C.current&&(cancelAnimationFrame(C.current),C.current=null)}},[x,g,j,k,v,b]),(0,h.jsxs)(i.a,{position:"relative",children:[(t||n)&&(0,h.jsxs)(s.z,{justify:"space-between",mb:3,children:[t&&(0,h.jsx)(l.D,{size:"lg",letterSpacing:"0.04em",style:{textTransform:"uppercase"},children:t}),n]}),(0,h.jsx)(i.a,{pointerEvents:"none",position:"absolute",left:0,top:0,bottom:0,w:{base:16,md:24},bgGradient:(0,r.dU)("linear(to-r, white, rgba(255,255,255,0.9), rgba(255,255,255,0.4), transparent)","linear(to-r, gray.900, rgba(17,25,40,0.9), rgba(17,25,40,0.4), transparent)"),zIndex:1}),(0,h.jsx)(i.a,{pointerEvents:"none",position:"absolute",right:0,top:0,bottom:0,w:{base:16,md:24},bgGradient:(0,r.dU)("linear(to-l, white, rgba(255,255,255,0.9), rgba(255,255,255,0.4), transparent)","linear(to-l, gray.900, rgba(17,25,40,0.9), rgba(17,25,40,0.4), transparent)"),zIndex:1}),(0,h.jsxs)(s.z,{ref:y,spacing:4,overflowX:"auto",py:2,px:1,cursor:p?"grab":"default",role:"region","aria-roledescription":"carousel","aria-label":t?"Posuvn\xedk: ".concat(t):"Posuvn\xedk obsahu",tabIndex:0,onKeyDown:e=>{const t=y.current;t&&("ArrowLeft"===e.key?(e.preventDefault(),E(-1)):"ArrowRight"===e.key?(e.preventDefault(),E(1)):"Home"===e.key?(e.preventDefault(),t.scrollTo({left:0,behavior:"smooth"})):"End"===e.key&&(e.preventDefault(),t.scrollTo({left:t.scrollWidth,behavior:"smooth"})))},onMouseEnter:()=>_(!0),onMouseLeave:()=>{_(!1),p&&N()},onMouseDown:e=>{p&&(e.preventDefault(),T(e.clientX))},onMouseMove:e=>{p&&D(e.clientX)},onMouseUp:()=>{p&&N()},onTouchStart:e=>{p&&e.touches[0]&&T(e.touches[0].clientX)},onTouchMove:e=>{p&&e.touches[0]&&D(e.touches[0].clientX)},onTouchEnd:()=>{p&&N()},css:{scrollSnapType:b?"none":"x proximity",scrollBehavior:"smooth",WebkitOverflowScrolling:"touch","&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:(0,r.dU)("rgba(0,0,0,0.15)","rgba(255,255,255,0.15)"),borderRadius:"3px"},"&::-webkit-scrollbar-thumb:hover":{background:(0,r.dU)("rgba(0,0,0,0.25)","rgba(255,255,255,0.25)")}},children:[m,b&&m]}),(0,h.jsx)(o.K,{"aria-label":"Posunout doleva",icon:(0,h.jsx)(c.Y,{boxSize:6}),onClick:e=>{e.preventDefault(),e.stopPropagation(),E(-1)},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onTouchStart:e=>{e.preventDefault(),e.stopPropagation()},position:"absolute",top:"50%",transform:"translateY(-50%)",left:{base:1,md:2},size:"lg",colorScheme:"blackAlpha",bg:(0,r.dU)("rgba(255,255,255,0.95)","rgba(45,55,72,0.95)"),color:(0,r.dU)("gray.800","white"),boxShadow:"xl",_hover:{bg:(0,r.dU)("white","gray.600"),transform:"translateY(-50%) scale(1.15)",boxShadow:"2xl"},_active:{transform:"translateY(-50%) scale(0.95)"},transition:"all 0.2s",zIndex:30,borderRadius:"full",pointerEvents:"auto"}),(0,h.jsx)(o.K,{"aria-label":"Posunout doprava",icon:(0,h.jsx)(d.v,{boxSize:6}),onClick:e=>{e.preventDefault(),e.stopPropagation(),E(1)},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onTouchStart:e=>{e.preventDefault(),e.stopPropagation()},position:"absolute",top:"50%",transform:"translateY(-50%)",right:{base:1,md:2},size:"lg",colorScheme:"blackAlpha",bg:(0,r.dU)("rgba(255,255,255,0.95)","rgba(45,55,72,0.95)"),color:(0,r.dU)("gray.800","white"),boxShadow:"xl",_hover:{bg:(0,r.dU)("white","gray.600"),transform:"translateY(-50%) scale(1.15)",boxShadow:"2xl"},_active:{transform:"translateY(-50%) scale(0.95)"},transition:"all 0.2s",zIndex:30,borderRadius:"full",pointerEvents:"auto"}),(0,h.jsx)(i.a,{mt:2,h:"2px",bg:f.primary,borderRadius:"full"})]})}},70947:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var a=n(65043),i=n(73449),o=n(72526),r=n(11100),s=n(34636),l=n(25189),c=n(22107),d=n(43533),u=n(25527),h=n(33572),m=n(75081),p=n(99032),x=n(28846),g=n(39081),v=n(35475),j=n(70579);const b=e=>{let{article:t,variant:n}=e;const a=t.slug?"/news/".concat(t.slug):"/articles/".concat(t.id),i="large"===n?{base:"260px",md:"360px"}:"small"===n?{base:"160px",md:"200px"}:{base:"220px",md:"240px"};return(0,j.jsx)(m.Q,{as:v.N_,to:a,borderRadius:"lg",overflow:"hidden",bg:"rgba(0,0,0,0.4)",_hover:{transform:"translateY(-4px)",boxShadow:"xl",bg:"rgba(0,0,0,0.6)"},transition:"all 0.25s ease",children:(0,j.jsxs)(c.a,{position:"relative",children:[(0,j.jsx)(h._,{src:(0,l.uq)(t.image_url)||"/stadium-placeholder.jpg",alt:t.title,w:"100%",h:i,objectFit:"cover"}),(0,j.jsx)(c.a,{position:"absolute",inset:0,bgGradient:"linear(to-t, rgba(0,0,0,0.7), rgba(0,0,0,0.15))"}),(0,j.jsx)(x.D,{as:"h3",fontSize:"large"===n?{base:"xl",md:"2xl"}:{base:"lg",md:"xl"},fontWeight:"800",letterSpacing:"0.3px",textTransform:"uppercase",position:"absolute",bottom:3,left:4,right:4,color:"white",noOfLines:2,children:t.title})]})})},y=()=>{var e,t;const n=(0,o.I)(["articles-featured",{page_size:3}],()=>(0,s.A0)({page_size:3}),{staleTime:3e5}),{data:l,isLoading:h,isFetchingNextPage:m,hasNextPage:v,fetchNextPage:y}=(0,r.q)(["articles-public",{page_size:18,published:!0}],e=>{let{pageParam:t=1}=e;return(0,s.GE)({page:t,page_size:18,published:!0})},{getNextPageParam:(e,t)=>{const n=t.reduce((e,t)=>{var n;return e+((null===t||void 0===t||null===(n=t.data)||void 0===n?void 0:n.length)||0)},0);if(e)return n<(e.total||0)?t.length+1:void 0}}),f=(null===l||void 0===l||null===(e=l.pages)||void 0===e?void 0:e.flatMap(e=>(null===e||void 0===e?void 0:e.data)||[]))||[],k=(null===(t=n.data)||void 0===t?void 0:t.data)||[],_=f.filter(e=>!k.some(t=>t.id===e.id)),w=a.useRef(null);a.useEffect(()=>{if(!v||!w.current)return;const e=w.current,t=new IntersectionObserver(e=>{e[0].isIntersecting&&v&&!m&&y()},{rootMargin:"400px"});return t.observe(e),()=>t.disconnect()},[v,m,y]);const z=k[0],S=k.slice(1,3);return(0,j.jsxs)(i.A,{children:[(0,j.jsxs)(c.a,{className:"sparta-container sparta-section",mb:4,children:[(0,j.jsx)(x.D,{as:"h1",size:"2xl",textTransform:"uppercase",children:"Blog"}),(0,j.jsx)(g.E,{mt:2,opacity:.8,children:"Nejnov\u011bj\u0161\xed \u010dl\xe1nky, rozhovory a zpr\xe1vy z klubu."})]}),z&&(0,j.jsx)(c.a,{className:"sparta-container sparta-section",mb:6,children:(0,j.jsxs)(d.x,{templateColumns:{base:"1fr",md:"2fr 1fr"},gap:6,children:[(0,j.jsx)(u.E,{children:(0,j.jsx)(b,{article:z,variant:"large"})}),S.length>0&&(0,j.jsx)(u.E,{children:(0,j.jsx)(d.x,{templateRows:"repeat(2, minmax(0, 1fr))",gap:4,children:S.map(e=>(0,j.jsx)(b,{article:e,variant:"small"},e.id))})})]})}),(0,j.jsxs)(c.a,{className:"sparta-container sparta-section",children:[(0,j.jsxs)(d.x,{templateColumns:{base:"1fr",md:"repeat(3, 1fr)"},gap:6,children:[h&&Array.from({length:9}).map((e,t)=>(0,j.jsx)(p.E,{h:{base:"260px",md:"280px"},borderRadius:"lg"},t)),!h&&_.map(e=>(0,j.jsx)(u.E,{children:(0,j.jsx)(b,{article:e})},e.id))]}),m&&(0,j.jsx)(c.a,{mt:4,textAlign:"center",children:(0,j.jsx)(g.E,{opacity:.8,children:"Na\u010d\xedt\xe1n\xed\u2026"})}),(0,j.jsx)(c.a,{ref:w,h:"1px"})]})]})}},71093:(e,t,n)=>{n.d(t,{AF:()=>l,F$:()=>x,Gi:()=>d,J8:()=>u,Ps:()=>o,Wu:()=>s,cB:()=>c,dr:()=>p,gU:()=>r,jX:()=>m,pF:()=>h});var a=n(89379),i=n(46291);const o=async e=>(await i.Ay.get("/polls",{params:e,headers:{"X-Session-Token":x()}})).data,r=async e=>{const t=x();return(await i.Ay.get("/polls/".concat(e),{headers:{"X-Session-Token":t}})).data},s=async(e,t)=>{const n=t.session_token||x();return(await i.Ay.post("/polls/".concat(e,"/vote"),(0,a.A)((0,a.A)({},t),{},{session_token:n}),{headers:{"X-Session-Token":n}})).data},l=async e=>{const t=x();return(await i.Ay.get("/polls/".concat(e,"/results"),{headers:{"X-Session-Token":t}})).data},c=async e=>(await i.Ay.get("/admin/polls",{params:e})).data,d=async e=>(await i.Ay.post("/admin/polls",e)).data,u=async(e,t)=>(await i.Ay.put("/admin/polls/".concat(e),t)).data,h=async e=>{await i.Ay.delete("/admin/polls/".concat(e))},m=async e=>(await i.Ay.get("/admin/polls/".concat(e,"/stats"))).data,p=async e=>(await i.Ay.get("/admin/polls/".concat(e,"/votes"))).data.votes,x=()=>{const e=localStorage.getItem("poll_session_token");if(e)return e;const t="guest_".concat(Date.now(),"_").concat(Math.random().toString(36).substring(2,15));return localStorage.setItem("poll_session_token",t),t}},71263:(e,t,n)=>{n.r(t),n.d(t,{default:()=>qe});var a=n(89379),i=n(65043),o=n(87139),r=n(96148),s=n(42703),l=n(30502),c=n(96870),d=n(44093),u=n(22107),h=n(28846),m=n(98662),p=n(39081),x=n(73212),g=n(35699),v=n(80511),j=n(3313),b=n(55395),y=n(83201),f=n(82595),k=n(67813),_=n(76659),w=n(10202),z=n(98481),S=n(78460),A=n(11054),C=n(85421),E=n(15071),T=n(35929),D=n(67516),N=n(3109),R=n(31411),F=n(14566),P=n(51794),I=n(10227),M=n(73225),L=n(76668),W=n(61724),U=n(45973),O=n(29244),q=n(25011),K=n(33572),B=n(32077),Z=n(7189),V=n(88787),H=n(85871),$=n(56529),J=n(34946),G=n(1009),X=n(72526),Y=n(59781),Q=n(12836),ee=n(6583),te=n(29066),ne=n(34636),ae=n(31629),ie=(n(87977),n(24122)),oe=n(25189),re=n(74770),se=n(32386),le=n(40384),ce=n(46291),de=n(90944);const ue=e=>new Promise(t=>setTimeout(t,e));function he(e){return String(null!==e&&void 0!==e?e:"").trim()}function me(e){const t=function(e){try{const t=Array.isArray(e)?e:"string"===typeof e?JSON.parse(e):[];if(!Array.isArray(t)||0===t.length)return;return t.map(e=>"string"===typeof e?{name:e.split("/").pop()||"soubor",url:e}:{name:(null===e||void 0===e?void 0:e.name)||String((null===e||void 0===e?void 0:e.url)||"").split("/").pop()||"soubor",url:String((null===e||void 0===e?void 0:e.url)||""),mime_type:(null===e||void 0===e?void 0:e.mime_type)||(null===e||void 0===e?void 0:e.type),size:"number"===typeof(null===e||void 0===e?void 0:e.size)?e.size:void 0})}catch(t){return}}(null===e||void 0===e?void 0:e.attachments),n=function(e){if(Array.isArray(e))return e.map(String);if("string"===typeof e){try{const t=JSON.parse(e);if(Array.isArray(t))return t.map(String)}catch(t){}return e.split(",").map(e=>e.trim()).filter(Boolean)}}(null===e||void 0===e?void 0:e.gallery_photo_ids);return(0,a.A)((0,a.A)((0,a.A)({title:he(null===e||void 0===e?void 0:e.title),content:"string"===typeof(null===e||void 0===e?void 0:e.content)?e.content:"",image_url:he(null===e||void 0===e?void 0:e.image_url)},"number"===typeof(null===e||void 0===e?void 0:e.category_id)?{category_id:e.category_id}:{}),{},{category_name:he(null===e||void 0===e?void 0:e.category_name),slug:he(null===e||void 0===e?void 0:e.slug),seo_title:he(null===e||void 0===e?void 0:e.seo_title),seo_description:he(null===e||void 0===e?void 0:e.seo_description),og_image_url:he(null===e||void 0===e?void 0:e.og_image_url),featured:!(null===e||void 0===e||!e.featured),gallery_album_id:he(null===e||void 0===e?void 0:e.gallery_album_id),gallery_album_url:he(null===e||void 0===e?void 0:e.gallery_album_url)},n?{gallery_photo_ids:n}:{}),{},{youtube_video_id:he(null===e||void 0===e?void 0:e.youtube_video_id),youtube_video_title:he(null===e||void 0===e?void 0:e.youtube_video_title),youtube_video_url:he(null===e||void 0===e?void 0:e.youtube_video_url),youtube_video_thumbnail:he(null===e||void 0===e?void 0:e.youtube_video_thumbnail)},t?{attachments:t}:{})}async function pe(e){const t=null===e||void 0===e?void 0:e.id,n=!!t,a=me(e),i=function(e){return me(e)}(e);let o;for(let d=1;d<=3;d++)try{var r;let e;if(n)try{e=await(0,ne.iZ)(t,a)}catch(l){var s;if(404!==(null===l||void 0===l||null===(s=l.response)||void 0===s?void 0:s.status))throw l;e=await(0,ne.N6)(i)}else e=await(0,ne.N6)(i);if(null!==(r=e)&&void 0!==r&&r.published)try{await(0,de.E)()}catch(c){}return e}catch(l){if(o=l,d<3){await ue(400*d);continue}throw l}throw o}var xe=n(7104),ge=n(70764),ve=n(70579);const je=e=>{let{isOpen:t,onClose:n,onPhotosSelected:a}=e;const[s,c]=(0,i.useState)(""),[d,h]=(0,i.useState)(!1),[v,j]=(0,i.useState)(null),[b,y]=(0,i.useState)(new Set),[f,k]=(0,i.useState)(60),z=(0,l.d)(),N=async()=>{if(s.trim())if(s.includes("/Album/")){h(!0);try{const e=await(0,se.Td)(s,{photo_limit:100});let t=null,n=[];if(e.albums&&Array.isArray(e.albums)&&e.albums.length>0)t=e.albums[0],n=t.photos||[];else{if(!e.album||!e.photos)throw new Error("Album nenalezeno - neplatn\xe1 odpov\u011b\u010f ze serveru");t=e.album,n=e.photos}if(!t)throw new Error("Album nenalezeno");const a=n.map(e=>({id:e.id,page_url:e.page_url,image_1500:e.image_1500||""}));j({id:t.id||"",title:t.title||"",url:t.url||s,date:t.date||"",photos_count:a.length,photos:a}),y(new Set),k(60),z({title:"Album na\u010dteno",description:"".concat(a.length," fotografi\xed"),status:"success",duration:2e3})}catch(e){console.error("Album fetch error:",e),z({title:"Chyba na\u010d\xedt\xe1n\xed alba",description:e.message||"Nepoda\u0159ilo se na\u010d\xedst album",status:"error",duration:5e3})}finally{h(!1)}}else z({title:"Neplatn\xfd odkaz",description:'URL mus\xed obsahovat "/Album/"',status:"error",duration:3e3});else z({title:"Zadejte URL alba",status:"warning",duration:3e3})},R=()=>{c(""),j(null),y(new Set),k(60),n()};return(0,ve.jsxs)(S.aF,{isOpen:t,onClose:R,size:"6xl",children:[(0,ve.jsx)(A.m,{}),(0,ve.jsxs)(C.$,{maxH:"90vh",children:[(0,ve.jsx)(E.r,{children:"Vybrat fotografie z alba"}),(0,ve.jsx)(T.s,{}),(0,ve.jsx)(D.c,{overflowY:"auto",children:(0,ve.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,ve.jsxs)(M.MJ,{children:[(0,ve.jsx)(L.l,{children:"URL Zonerama alba"}),(0,ve.jsxs)(r.z,{children:[(0,ve.jsx)(g.p,{value:s,onChange:e=>c(e.target.value),placeholder:"https://eu.zonerama.com/Account/Album/12345",onKeyPress:e=>"Enter"===e.key&&N()}),(0,ve.jsx)(m.$,{onClick:N,isLoading:d,colorScheme:"blue",leftIcon:(0,ve.jsx)(xe.A,{size:18}),children:"Na\u010d\xedst"})]}),(0,ve.jsx)(M.eK,{children:"Vlo\u017ete odkaz na Zonerama album (mus\xed obsahovat /Album/)"})]}),d&&(0,ve.jsxs)(w.T,{py:8,children:[(0,ve.jsx)(_.y,{size:"xl",color:"blue.500"}),(0,ve.jsx)(p.E,{color:"gray.600",children:"Na\u010d\xedt\xe1m album..."})]}),v&&!d&&(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)(u.a,{p:4,bg:"blue.50",borderRadius:"md",borderWidth:"1px",borderColor:"blue.200",children:(0,ve.jsxs)(w.T,{align:"start",spacing:2,children:[(0,ve.jsxs)(r.z,{justify:"space-between",w:"full",children:[(0,ve.jsx)(p.E,{fontWeight:"bold",fontSize:"lg",children:v.title}),(0,ve.jsx)(m.$,{as:"a",href:v.url,target:"_blank",rel:"noopener noreferrer",size:"sm",variant:"ghost",rightIcon:(0,ve.jsx)(ge.A,{size:14}),children:"Zonerama"})]}),(0,ve.jsxs)(r.z,{spacing:4,fontSize:"sm",color:"gray.700",children:[v.date&&(0,ve.jsxs)(p.E,{children:["\ud83d\udcc5 ",v.date]}),(0,ve.jsxs)(o.E,{colorScheme:"blue",children:[v.photos.length," fotografi\xed"]})]})]})}),(0,ve.jsx)(r.z,{justify:"space-between",children:(0,ve.jsxs)(J.S,{isChecked:b.size===v.photos.length,isIndeterminate:b.size>0&&b.size<v.photos.length,onChange:()=>{v&&(b.size===v.photos.length?y(new Set):y(new Set(v.photos.map(e=>e.id))))},children:["Vybrat v\u0161e (",b.size,"/",v.photos.length,")"]})}),(0,ve.jsx)(x.r,{columns:{base:3,md:4,lg:5},spacing:3,children:v.photos.slice(0,f).map(e=>(0,ve.jsxs)(u.a,{position:"relative",cursor:"pointer",onClick:()=>(e=>{const t=new Set(b);t.has(e)?t.delete(e):t.add(e),y(t)})(e.id),borderRadius:"md",overflow:"hidden",borderWidth:"2px",borderColor:b.has(e.id)?"blue.500":"transparent",transition:"all 0.2s",_hover:{transform:"scale(1.05)"},children:[(0,ve.jsx)(K._,{src:e.image_1500,alt:e.id,w:"100%",h:"150px",objectFit:"cover",loading:"lazy",decoding:"async"}),(0,ve.jsx)(J.S,{position:"absolute",top:2,right:2,isChecked:b.has(e.id),pointerEvents:"none",bg:"white",borderRadius:"sm"})]},e.id))}),v.photos.length>f&&(0,ve.jsx)(r.z,{justify:"center",pt:2,children:(0,ve.jsx)(m.$,{size:"sm",onClick:()=>k(e=>e+60),children:"Na\u010d\xedst dal\u0161\xed"})})]})]})}),(0,ve.jsx)($.j,{children:(0,ve.jsxs)(r.z,{spacing:3,children:[(0,ve.jsx)(m.$,{variant:"ghost",onClick:R,children:"Zru\u0161it"}),(0,ve.jsxs)(m.$,{colorScheme:"blue",onClick:()=>{if(!v||0===b.size)return void z({title:"Vyberte fotografie",status:"warning",duration:3e3});const e=v.photos.filter(e=>b.has(e.id));a(e,v),R()},isDisabled:!v||0===b.size,children:["Vybrat (",b.size,")"]})]})})]})]})};var be=n(50271),ye=n(46367),fe=n(97717),ke=n(79787),_e=n(89962),we=n(88500),ze=n(66776),Se=n(24346),Ae=n(47704),Ce=n(60215),Ee=n(23978),Te=n(63988),De=n(70082),Ne=n(33430),Re=n(34334),Fe=n(82459),Pe=n(77327),Ie=n(85369);const Me=e=>{let{title:t,content:n,onTranslationComplete:a,disabled:i=!1}=e;const{translateBlog:o,isTranslating:s,translationError:l,detectSourceLanguage:c,getTargetLanguage:d}=(0,Pe.d)(),h=c(t+" "+n),x=d();return h!==x&&t&&n?(0,ve.jsxs)(w.T,{spacing:3,align:"stretch",children:[(0,ve.jsxs)(u.a,{children:[(0,ve.jsxs)(r.z,{spacing:2,mb:2,children:[(0,ve.jsx)(Ie.gqt,{}),(0,ve.jsxs)(p.E,{fontWeight:"medium",children:["Translate from ","cs"===h?"Czech":"English"," to ","cs"===x?"Czech":"English"]})]}),(0,ve.jsx)(m.$,{colorScheme:"blue",onClick:async()=>{try{const e=await o(t,n);a(e.title,e.content)}catch(e){}},isLoading:s,loadingText:"Translating...",leftIcon:(0,ve.jsx)(Ie.gqt,{}),disabled:i||s,size:"sm",children:s?"Translating...":"Translate Blog"})]}),l&&(0,ve.jsxs)(V.F,{status:"error",borderRadius:"md",children:[(0,ve.jsx)(H._,{as:Ie.BS8}),(0,ve.jsxs)(u.a,{children:[(0,ve.jsx)(Ne.X,{children:"Translation Failed"}),(0,ve.jsx)(Re.T,{children:l})]})]}),!s&&!l&&(0,ve.jsxs)(V.F,{status:"success",borderRadius:"md",children:[(0,ve.jsx)(H._,{as:Ie.CMH}),(0,ve.jsxs)(u.a,{children:[(0,ve.jsx)(Ne.X,{children:"Ready to Translate"}),(0,ve.jsxs)(Re.T,{children:["Click the translate button to convert this blog content to ","cs"===x?"Czech":"English","."]})]})]}),(0,ve.jsx)(Fe.c,{})]}):(0,ve.jsxs)(V.F,{status:"info",borderRadius:"md",children:[(0,ve.jsx)(H._,{as:Ie.gqt}),(0,ve.jsxs)(u.a,{children:[(0,ve.jsx)(Ne.X,{children:"Translation not needed"}),(0,ve.jsxs)(Re.T,{children:["Content is already in ","cs"===h?"Czech":"English"," or the target language is the same."]})]})]})};var Le=n(91896);const We=e=>{var t;let{articleId:n}=e;const i=(0,X.I)({queryKey:["article-match-link",n],queryFn:()=>(0,ne.Om)(n),enabled:"undefined"!==typeof n&&null!==n&&("number"===typeof n?n>0:""!==String(n).trim()),staleTime:6e4,retry:!1}),l=null===(t=i.data)||void 0===t?void 0:t.external_match_id,c=(0,X.I)({queryKey:["facr-cached-match",l],enabled:!!l,staleTime:6e4,retry:!1,queryFn:async()=>{try{const e=new URL(ce.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin,t="".concat(e,"/cache/prefetch/facr_club_info.json"),n=await fetch(t,{cache:"no-cache"});if(!n.ok)return null;const i=await n.json(),o=Array.isArray(null===i||void 0===i?void 0:i.competitions)?i.competitions:[];for(const r of o){const e=Array.isArray(r.matches)?r.matches:[];for(const t of e){if(String(t.match_id||t.id)===String(l))return(0,a.A)((0,a.A)({},t),{},{competitionName:r.name})}}return null}catch(e){return console.error("Failed to fetch FACR match data:",e),null}}});if(i.isLoading)return(0,ve.jsx)(o.E,{colorScheme:"gray",children:"Na\u010d\xedt\xe1n\xed..."});if(!l)return(0,ve.jsx)(o.E,{colorScheme:"gray",children:"Nepropojeno"});if(c.isError||i.isError)return(0,ve.jsx)(o.E,{colorScheme:"red",children:"Chyba na\u010d\xedt\xe1n\xed"});const d=c.data,u=d?d.score||(null!=d.result_home&&null!=d.result_away?"".concat(d.result_home,":").concat(d.result_away):"vs"):"",h=!!d&&!!u&&"vs"!==u?"green":"yellow",m=d?"".concat(String(d.home||d.home_team||"")," ").concat(String(u)," ").concat(String(d.away||d.away_team||"")):"ID: ".concat(String(l)),p=d&&(d.facr_link||d.report_url)?String(d.facr_link||d.report_url):"",x=p?(e=>{try{const t=new URL(e,"undefined"!==typeof window?window.location.origin:"http://localhost:3000");return"is.fotbal.cz"===t.hostname&&(t.hostname="www.fotbal.cz"),t.toString()}catch(t){return e}})(p):"";return(0,ve.jsxs)(r.z,{spacing:2,children:[(0,ve.jsxs)(o.E,{colorScheme:h,title:null!==d&&void 0!==d&&d.competitionName?String(d.competitionName):void 0,children:["Z\xe1pas: ",m]}),x?(0,ve.jsx)(s.K,{"aria-label":"Otev\u0159\xedt z\xe1pas na fotbal.cz",size:"xs",as:"a",href:x,target:"_blank",rel:"noopener noreferrer",icon:(0,ve.jsx)(G.HaR,{}),variant:"ghost"}):null]})},Ue="white",Oe=e=>String(e||"").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),qe=()=>{var e,t,n,ue;const{user:he}=(0,te.A)(),me="admin"===(null===he||void 0===he?void 0:he.role),xe=(0,l.d)(),ge=(0,Y.jE)(),[Ne,Re]=(0,i.useState)(1),[Fe,Pe]=(0,i.useState)(""),[Ie,qe]=(0,i.useState)(null),[Ke,Be]=(0,i.useState)(!1),[Ze,Ve]=(0,i.useState)(""),[He,$e]=(0,i.useState)(null),[Je,Ge]=(0,i.useState)(!1),[Xe,Ye]=(0,i.useState)(null),[Qe,et]=(0,i.useState)(!1);i.useEffect(()=>{(async()=>{try{const e=new URL(ce.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin,t="".concat(e,"/cache/prefetch/facr_club_info.json"),n=await fetch(t,{headers:{"Cache-Control":"no-cache"}});if(!n.ok)return;const a=await n.json(),i=(Array.isArray(null===a||void 0===a?void 0:a.competitions)?a.competitions:[]).flatMap(e=>(Array.isArray(e.matches)?e.matches:[]).map(t=>{const n=t.score||(null!=t.result_home&&null!=t.result_away?"".concat(t.result_home,":").concat(t.result_away):"vs");return{id:String(t.match_id||t.id||""),date:t.date_time||t.date||"",label:"".concat(t.date_time||t.date||""," \u2022 ").concat(t.home||t.home_team||""," ").concat(n," ").concat(t.away||t.away_team||""," ").concat(null!==e&&void 0!==e&&e.name?"("+e.name+")":"").trim(),competition:(null===e||void 0===e?void 0:e.name)||"",competition_code:(null===e||void 0===e?void 0:e.code)||(null===e||void 0===e?void 0:e.id)||"",home:t.home||t.home_team||"",away:t.away||t.away_team||"",score:n}}));It(i.slice(-200).reverse())}catch(e){}})()},[]);const{data:tt,isLoading:nt}=(0,X.I)({queryKey:["admin-articles",{page:Ne,page_size:10,q:Fe,published:!1}],queryFn:()=>(0,ne.GE)({page:Ne,page_size:10,published:!1,q:Fe}),keepPreviousData:!0}),at=(0,X.I)({queryKey:["public-settings"],queryFn:re.l3,staleTime:3e5}),{isOpen:it,onOpen:ot,onClose:rt}=(0,c.j)(),[st,lt]=(0,i.useState)(""),[ct,dt]=(0,i.useState)("Fanou\u0161ci klubu"),[ut,ht]=(0,i.useState)(500),[mt,pt]=(0,i.useState)("500"),[xt,gt]=(0,i.useState)(void 0),[vt,jt]=(0,i.useState)(null),[bt,yt]=(0,i.useState)((0,Ee.xU)()),[ft,kt]=(0,i.useState)(!1),[_t,wt]=(0,i.useState)([]),[zt,St]=(0,i.useState)({}),[At,Ct]=(0,i.useState)([]),[Et,Tt]=(0,i.useState)(""),[Dt,Nt]=(0,i.useState)(""),[Rt,Ft]=(0,i.useState)(""),[Pt,It]=(0,i.useState)([]),[Mt,Lt]=(0,i.useState)(""),[Wt,Ut]=(0,i.useState)(0),[Ot,qt]=(0,i.useState)(""),[Kt,Bt]=(0,i.useState)(""),[Zt,Vt]=(0,i.useState)(""),[Ht,$t]=(0,i.useState)([]),[Jt,Gt]=(0,i.useState)(!1),[Xt,Yt]=(0,i.useState)(!1),{isOpen:Qt,onOpen:en,onClose:tn}=(0,c.j)(),{isOpen:nn,onOpen:an,onClose:on}=(0,c.j)(),[rn,sn]=(0,i.useState)([]),[ln,cn]=(0,i.useState)(!1),[dn,un]=(0,i.useState)(null),[hn,mn]=(0,i.useState)(48),[pn,xn]=(0,i.useState)([]),[gn,vn]=(0,i.useState)(!1),[jn,bn]=(0,i.useState)(""),[yn,fn]=(0,i.useState)(""),{isOpen:kn,onOpen:_n,onClose:wn}=(0,c.j)(),{isOpen:zn,onOpen:Sn,onClose:An}=(0,c.j)(),[Cn,En]=(0,i.useState)(24),[Tn,Dn]=(0,i.useState)(null),[Nn,Rn]=(0,i.useState)(new Set),[Fn,Pn]=(0,i.useState)(48),[In,Mn]=(0,i.useState)(!1);i.useEffect(()=>{if(null==Xe)return void et(!1);et(!0);const e=window.setTimeout(()=>{Xe&&Date.now()-Xe>=800&&et(!1)},800);return()=>window.clearTimeout(e)},[Xe]);const Ln=i.useMemo(()=>Ie?(0,a.A)((0,a.A)({},Ie),{},{__autosaveTs:Xe||0}):{},[Ie,Xe]),{saveStatus:Wn,lastSaved:Un,forceSave:On,clearDraft:qn}=(0,ze.UI)({data:Ln,storageKey:Ze,onSave:async e=>{var t;if(null!==e&&void 0!==e&&e.id||null!==e&&void 0!==e&&null!==(t=e.title)&&void 0!==t&&t.trim()){const t=await pe(e);if(null!==t&&void 0!==t&&t.id&&(null===e||void 0===e||!e.id)){qe(e=>(0,a.A)((0,a.A)({},e),{},{id:t.id})),Ve("draft-article-".concat(t.id));try{localStorage.removeItem("draft-article-new")}catch(n){}}return t}return{}},debounceMs:2e3,enabled:it&&null!==Ie&&!Je&&!Qe}),Kn=i.useCallback(()=>{try{const e="draft-article-new",t=(0,ze.TS)(e);if(t&&t.age<1440){const t=(0,ze.C_)(e);if(t){const e=(0,a.A)({},t);return e.id&&delete e.id,void $e(e)}}}catch(e){}$e(null)},[]);i.useEffect(()=>{Kn()},[Kn]);const Bn=(0,i.useCallback)(async()=>{try{cn(!0);let i="";try{const e="http://127.0.0.1:8080".trim();e&&(i=new URL(e,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin)}catch(e){}if(!i)try{i=new URL("/api/v1","undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin}catch(t){}const o="".concat(i,"/cache/prefetch/zonerama_profile.json"),r="".concat(i,"/cache/prefetch/zonerama_albums.json"),[s,l]=await Promise.allSettled([fetch(o,{cache:"no-cache"}),fetch(r,{cache:"no-cache"})]);let c=[];if("fulfilled"===l.status&&l.value.ok){const e=await l.value.json();if(c=Array.isArray(e)?e:[],Array.isArray(c)&&c.length>0){const e=c.filter(e=>Array.isArray(null===e||void 0===e?void 0:e.photos)&&e.photos.length>0);c=e.length>0?e:[]}}if(0===c.length&&"fulfilled"===s.status&&s.value.ok){const e=await s.value.json();c=(Array.isArray(null===e||void 0===e?void 0:e.albums)?e.albums:[]).filter(e=>Array.isArray(e.photos)&&e.photos.length>0)}if(0===c.length)try{const e=await(0,se.Gz)();if(Array.isArray(e)&&e.length>0){const t={};e.forEach(e=>{const n=String(e.album_id||"unknown");(t[n]=t[n]||[]).push(e)}),c=Object.entries(t).map(e=>{let[t,n]=e;return{id:t,title:"Album",url:n[0].page_url||"#",date:"",photos_count:n.length,photos:n.slice(0,100).map(e=>({id:String(e.id||""),image_1500:String(e.src||e.local||""),page_url:String(e.page_url||"")}))}})}}catch(n){}c=c.map(e=>{const t=(Array.isArray(e.photos)?e.photos:[]).map(e=>({id:String(e.id||""),image_1500:String(e.image_1500||e.src||e.local||""),page_url:String(e.page_url||"")}));return(0,a.A)((0,a.A)({},e),{},{photos:t})});const d=e=>{const t=String(e||"").trim();if(!t)return 0;const n=Date.parse(t);if(!Number.isNaN(n))return n;const a=t.match(/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/);if(a){const e=parseInt(a[1],10),t=parseInt(a[2],10)-1,n=parseInt(a[3],10);return new Date(n,t,e).getTime()}return 0},u=[...c].sort((e,t)=>d(t.date)-d(e.date));sn(u),0===u.length&&xe({title:"\u017d\xe1dn\xe9 alba nenalezena",description:"Cache galerie je pr\xe1zdn\xe1 nebo neobsahuje fotografie.",status:"info",duration:4e3})}catch(i){xe({title:"Na\u010dten\xed galerie selhalo",description:(null===i||void 0===i?void 0:i.message)||"Zkuste to pros\xedm znovu.",status:"error"})}finally{cn(!1)}},[]),Zn=(0,i.useCallback)(async()=>{try{vn(!0);const e=await(0,Se.S)();let t=[];e&&Array.isArray(e.videos)&&(t=e.videos),xn(t),e&&0!==t.length||xe({title:"YouTube videa nenalezena",description:"Zkontrolujte nastaven\xed YouTube kan\xe1lu nebo zkuste obnovit cache.",status:"info",duration:4e3})}catch(e){xe({title:"Na\u010dten\xed YouTube vide\xed selhalo",description:(null===e||void 0===e?void 0:e.message)||"Zkuste to pros\xedm znovu.",status:"error"})}finally{vn(!1)}},[]);i.useEffect(()=>{kn&&0===pn.length&&!gn&&Zn()},[kn,pn.length,gn,Zn]),i.useEffect(()=>{nn&&0===rn.length&&!ln&&Bn()},[nn,rn.length,ln,Bn]),i.useEffect(()=>{zn&&0===rn.length&&!ln&&Bn()},[zn,rn.length,ln,Bn]);const Vn=(0,i.useMemo)(()=>{const e=jn.trim().toLowerCase();return e?pn.filter(t=>(t.title||"").toLowerCase().includes(e)||String(t.video_id||"").toLowerCase().includes(e)):pn},[pn,jn]),Hn=(0,i.useCallback)(e=>{qe(t=>(0,a.A)((0,a.A)({},t),{},{youtube_video_id:e.video_id,youtube_video_title:e.title,youtube_video_url:"https://www.youtube.com/watch?v=".concat(e.video_id),youtube_video_thumbnail:e.thumbnail_url})),xe({title:"Video p\u0159id\xe1no k \u010dl\xe1nku",description:e.title,status:"success"}),wn()},[xe,wn]),$n=(0,i.useCallback)(()=>{qe(e=>(0,a.A)((0,a.A)({},e),{},{youtube_video_id:"",youtube_video_title:"",youtube_video_url:"",youtube_video_thumbnail:""})),xe({title:"Video odstran\u011bno",status:"info"})},[xe]),Jn=(0,i.useCallback)(async()=>{if(Ie&&Ie.title&&Ie.title.trim())try{var e,t,n,i;Mn(!0);const o=(null===Ie||void 0===Ie?void 0:Ie.category_name)||(null===Ie||void 0===Ie||null===(e=Ie.category)||void 0===e?void 0:e.name)||"",r=(null===(t=at.data)||void 0===t?void 0:t.club_name)||"",s=(null===(n=at.data)||void 0===n?void 0:n.primary_color)||"",l=(null===(i=at.data)||void 0===i?void 0:i.secondary_color)||"",c=await(0,ae.Uc)({subject:"article",title:Ie.title,category:o,club_name:r,primary_color:s,secondary_color:l});if(!c||!c.url)return void xe({title:"AI nevr\xe1tila obr\xe1zek",description:"Zkuste to pros\xedm znovu nebo nastavte obr\xe1zek ru\u010dn\u011b.",status:"warning",duration:5e3});qe(e=>(0,a.A)((0,a.A)({},e),{},{image_url:c.url})),xe({title:"Tituln\xed obr\xe1zek vygenerov\xe1n",description:"Obr\xe1zek byl nastaven k \u010dl\xe1nku.",status:"success",duration:4e3})}catch(s){var o,r;xe({title:"Generov\xe1n\xed obr\xe1zku selhalo",description:(null===s||void 0===s||null===(o=s.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.error)||(null===s||void 0===s?void 0:s.message)||"Zkuste to pros\xedm znovu.",status:"error",duration:5e3})}finally{Mn(!1)}else xe({title:"Chyb\xed titulek \u010dl\xe1nku",description:"Nejprve zadejte titulek, aby AI v\u011bd\u011bla, co m\xe1 zobrazit.",status:"warning",duration:4e3})},[Ie,xe]),Gn=(0,i.useCallback)(()=>{const e=(e=>{const t=String(e||"").trim();if(!t)return"";try{const e=new URL(t.startsWith("http")?t:"https://".concat(t));if(e.hostname.includes("youtu.be")){const t=e.pathname.split("/").filter(Boolean);if(t.length>0)return t[0]}if(e.pathname.includes("/shorts/")){const t=e.pathname.split("/shorts/");if(t.length>1){const e=t[1].split(/[?&]/)[0];if(/^[0-9A-Za-z_-]{11}$/.test(e))return e}}const n=e.searchParams.get("v");if(n&&/^[0-9A-Za-z_-]{11}$/.test(n))return n}catch(a){}const n=t.match(/(?:v=|\/)([0-9A-Za-z_-]{11})(?![0-9A-Za-z_-])/);return n&&n[1]?n[1]:/^[0-9A-Za-z_-]{11}$/.test(t)?t:""})(yn);if(!e)return void xe({title:"Neplatn\xfd YouTube odkaz",description:"Zadejte pros\xedm platn\xe9 ID nebo odkaz na video.",status:"warning"});const t=pn.find(t=>t.video_id===e),n=(null===t||void 0===t?void 0:t.title)||"YouTube video",i=(null===t||void 0===t?void 0:t.thumbnail_url)||"https://i.ytimg.com/vi/".concat(e,"/hqdefault.jpg");qe(t=>(0,a.A)((0,a.A)({},t),{},{youtube_video_id:e,youtube_video_title:n,youtube_video_url:"https://www.youtube.com/watch?v=".concat(e),youtube_video_thumbnail:i})),xe({title:"Video nastaveno",description:n,status:"success"}),fn("")},[yn,pn,xe]),Xn=(0,i.useCallback)(async e=>{try{qe(t=>{const n=t||{};let i=String(e.album_id||"").trim();if(!i&&e.album_url)try{const t=e.album_url.match(/\/Album\/(\d+)/i);t&&t[1]&&(i=t[1])}catch(r){}const o=!n.gallery_album_url;return(0,a.A)((0,a.A)({},n),{},{image_url:e.image_url,gallery_album_url:o?e.album_url:n.gallery_album_url},i?{gallery_album_id:i}:{})}),me?(await(0,se.yl)({id:e.id,album_id:e.album_id,album_url:e.album_url,page_url:e.page_url,image_url:e.image_url,title:e.title}),xe({title:"Obr\xe1zek vybr\xe1n ze Zonerama",description:"Album bylo tak\xe9 propojeno s \u010dl\xe1nkem.",status:"success"})):xe({title:"Obr\xe1zek nastaven",description:"Album bylo tak\xe9 propojeno s \u010dl\xe1nkem.",status:"success"})}catch(i){var t,n;xe({title:"Ulo\u017een\xed v\xfdb\u011bru selhalo",description:(null===i||void 0===i||null===(t=i.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===i||void 0===i?void 0:i.message)||"Chyba",status:"error"})}},[xe]),Yn=(0,i.useCallback)(async(e,t)=>{try{const i=!(null!==t&&void 0!==t&&t.url);if(me&&null!==t&&void 0!==t&&t.url&&!i){xe({title:"Ukl\xe1d\xe1m album...",status:"info",duration:2e3});const n=Math.max(500,Number((null===t||void 0===t?void 0:t.photos_count)||0)||e.length||100);await(0,se.Yf)(t.url,n)}if(qe(n=>{const o=(null===n||void 0===n?void 0:n.content)||"",r=e.map(e=>'<img src="'.concat(e.image_1500,'" alt="Gallery photo" data-page-url="').concat(e.page_url,'" data-img-id="').concat(e.id,'" />')).join("\n"),s=i?null===n||void 0===n?void 0:n.gallery_album_url:t.url,l={content:o+"\n"+r};return(!i||!(null!==n&&void 0!==n&&n.gallery_album_id))&&(l.gallery_album_id=t.id,l.gallery_album_url=s,l.gallery_photo_ids=e.map(e=>e.id)),(0,a.A)((0,a.A)({},n),l)}),!i){var n;const a=(null===(n=t.photos)||void 0===n?void 0:n.map(e=>({id:e.id,page_url:e.page_url,image_1500:e.image_1500||"",title:e.title||""})))||e.map(e=>({id:e.id,page_url:e.page_url,image_1500:e.image_1500||"",title:""}));Vt(t.url||""),$t(a)}xe({title:i?"Fotografie propojeny s \u010dl\xe1nkem":"Album p\u0159id\xe1no",description:"".concat(e.length," fotografi\xed vlo\u017eeno do \u010dl\xe1nku."),status:"success",duration:4e3})}catch(i){xe({title:"Chyba",description:i.message||"Nepoda\u0159ilo se p\u0159idat album",status:"error",duration:5e3})}},[xe]),Qn=(0,i.useCallback)(async()=>{const e=Zt.trim();if(e)try{Gt(!0);const n=new URLSearchParams({link:e,photo_limit:"24",rendered:"true"}),a=await fetch("".concat(ce.API_URL,"/zonerama-album?").concat(n.toString()));if(!a.ok)throw new Error("Failed to fetch album");const i=await a.json();let o=[];var t;if(Array.isArray(null===i||void 0===i?void 0:i.albums)&&i.albums.length>0)o=(null===(t=i.albums[0])||void 0===t?void 0:t.photos)||[];else Array.isArray(null===i||void 0===i?void 0:i.photos)&&(o=i.photos);0===o.length&&xe({title:"Album na\u010dteno, ale neobsahuje \u017e\xe1dn\xe9 fotografie",status:"info"}),$t(o)}catch(n){xe({title:"Na\u010dten\xed alba selhalo",description:(null===n||void 0===n?void 0:n.message)||"Chyba",status:"error"})}finally{Gt(!1)}},[Zt,xe]),ea=(0,i.useMemo)(()=>{let e=Pt;const t=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),n=String((null===Ie||void 0===Ie?void 0:Ie.category_name)||"").trim(),a=t(n);if(a){const n=new Set;for(const e of At){const i=t(e.alias),o=t(e.original_name||"");(i&&i===a||o&&o===a)&&n.add(e.code)}e=e.filter(e=>{const i=String(e.competition||""),o=t(i),r=t((e=>{const n=t(e);for(const a of At){const e=t(a.alias),i=t(a.original_name||"");if(i&&(n===i||n.includes(i)||i.includes(n))||e&&(n===e||n.includes(e)||e.includes(n)))return a.alias}return String(e||"")})(i)),s=String(e.competition_code||"");return!!(n.size>0&&s)&&n.has(s)||o===a||r===a||o.includes(a)||r.includes(a)})}const i=Mt.trim().toLowerCase();i&&(e=e.filter(e=>e.label.toLowerCase().includes(i))),Ot&&(e=e.filter(e=>(e.date||"").includes(Ot)));const o=Date.now(),r=e=>{if(!e)return Number.MAX_SAFE_INTEGER;const t=e.match(/^(\d{1,2})\.(\d{1,2})\.(\d{4})(?:\s+(\d{1,2}):(\d{2}))?/);if(t){const e=parseInt(t[1],10),n=parseInt(t[2],10)-1,a=parseInt(t[3],10),i=t[4]?parseInt(t[4],10):0,o=t[5]?parseInt(t[5],10):0;return new Date(a,n,e,i,o).getTime()}const n=Date.parse(e);return isNaN(n)?Number.MAX_SAFE_INTEGER:n};return e=e.sort((e,t)=>{const n=r(e.date),a=r(t.date),i=n-o,s=a-o,l=i>=0;return l!==s>=0?l?-1:1:l?i-s:Math.abs(i)-Math.abs(s)}),e},[Pt,Mt,Ot,null===Ie||void 0===Ie?void 0:Ie.category_name,At]);i.useEffect(()=>{(async()=>{try{const a=await(0,re.l3)(),i=(null===a||void 0===a?void 0:a.club_id)||"",o=(null===a||void 0===a?void 0:a.club_type)||"football";let r={};try{const e=await(0,De.xN)();e.forEach(e=>{e.code&&e.alias&&(r[e.code]=e.alias)}),Ct(e)}catch(e){}let s=[];try{const e=new URL(ce.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin,t=await fetch("".concat(e,"/cache/prefetch/facr_club_info.json"),{cache:"no-cache"});if(t.ok){const e=await t.json();s=(Array.isArray(null===e||void 0===e?void 0:e.competitions)?e.competitions:[]).map(e=>({code:e.code||e.id,name:e.name||e.code||e.id}))}}catch(t){}if(0===s.length&&i)try{const e=await le.J.getClub(String(i),o);s=((null===e||void 0===e?void 0:e.competitions)||[]).map(e=>({code:e.code,name:e.name||e.code}))}catch(n){}const l=s.map(e=>({code:e.code,name:e.code&&r[e.code]?r[e.code]:e.name}));St(r),wt(l)}catch(a){}})()},[]);const ta=(0,Q.n)({mutationFn:async()=>{gt(0),jt(Date.now());const e=setInterval(()=>{gt(e=>void 0===e||e>=95?e:Math.min(e+15*Math.random()+5,95))},2e3);try{var t;const n=parseInt(String(mt||"").trim(),10),a=Number.isFinite(n)&&!isNaN(n)&&n>0?n:ut,i=String(st||"").trim(),o=(null===(t=at.data)||void 0===t?void 0:t.club_name)||"Fotbalov\xfd klub",r="\n\nInformace o klubu:\nN\xe1zev klubu: ".concat(o,"."),s=["Pi\u0161 \u010desky a strukturovan\u011b pro blog fotbalov\xe9ho klubu.","Pou\u017e\xedvej bohat\xe9 HTML prvky: rozd\u011bl \u010dl\xe1nek do 2\u20134 sekc\xed s <h2>/<h3>, kr\xe1tk\xe9 odstavce <p>, alespo\u0148 jeden seznam <ul><li>, zv\xfdrazn\u011bn\xed <strong>/<em>.","Pokud se to hod\xed, vlo\u017e kr\xe1tk\xfd cit\xe1t pomoc\xed <blockquote>\u2026</blockquote> (max. 1\xd7).","Nevkl\xe1dej <html>, <head> ani <body>. Vra\u0165 jen validn\xed HTML \u010d\xe1sti obsahu.","Zachovej fakta zadan\xe1 u\u017eivatelem, vyh\xfdbej se hyperbolem a marketingov\xfdm fr\xe1z\xedm."].join(" "),l="".concat(i).concat(r,"\n\n").concat(s).trim(),c=await(0,ae.sn)({prompt:l,audience:ct,min_words:a,model:bt});return clearInterval(e),gt(100),await new Promise(e=>setTimeout(e,500)),c}catch(n){throw clearInterval(e),n}},onSuccess:e=>{console.log("AI blog response:",e);const t=(0,Te.ry)(String((null===e||void 0===e?void 0:e.title)||"").trim()),n=String((null===e||void 0===e?void 0:e.slug)||"").trim(),i=(0,Te.F0)(String((null===e||void 0===e?void 0:e.html)||"").trim(),{cleanText:!0,preserveHtmlTags:!0});if(!t||!i)return console.error("AI response missing title or html:",e),void xe({title:"AI odpov\u011b\u010f ne\xfapln\xe1",description:"Chyb\xed n\xe1zev nebo obsah \u010dl\xe1nku",status:"error"});qe(e=>(0,a.A)((0,a.A)({},e),{},{title:t,slug:n,content:i})),lt(""),Ut(1),xe({title:"\u010cl\xe1nek hotov",description:"AI rozvinula v\xe1\u0161 text a vyplnila n\xe1zev, slug a obsah. Zkontrolujte v\xfdsledek v z\xe1lo\u017ece Z\xe1kladn\xed.",status:"success",duration:5e3})},onError:e=>{var t,n;console.error("AI generation error:",e),xe({title:"Generov\xe1n\xed selhalo",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===e||void 0===e?void 0:e.message)||"Zkuste to pros\xedm znovu.",status:"error"})},onSettled:()=>{setTimeout(()=>{gt(void 0),jt(null)},1e3)}}),na=()=>{Ve("draft-article-new"),Tt(""),Ft(""),Bt(""),He?(qe(He),Ut(1)):(qe({title:"",content:"",featured:!1,published:!1}),Ut(0)),lt(""),ot()},aa=()=>{Bt(""),Ft(""),Tt(""),qe(null),rt(),Kn()},ia=(0,Q.n)({mutationFn:e=>(0,ne.N6)(e),onSuccess:async e=>{console.log("Article created successfully in mutation callback:",e),Bt(""),Ft("");try{null!==e&&void 0!==e&&e.published&&await(0,de.E)()}catch(t){}ge.invalidateQueries({queryKey:["admin-articles"]}),ge.invalidateQueries({queryKey:["articles"]}),ge.invalidateQueries({queryKey:["recentArticles"]}),ge.invalidateQueries({queryKey:["article-match-link"]})},onError:e=>{var t,n;console.error("Error creating article:",e),xe({title:"Chyba p\u0159i vytv\xe1\u0159en\xed \u010dl\xe1nku",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.message)||"Do\u0161lo k chyb\u011b p\u0159i ukl\xe1d\xe1n\xed",status:"error",duration:5e3,isClosable:!0})}}),oa=((0,Q.n)({mutationFn:e=>{let{id:t,payload:n}=e;return(0,ne.iZ)(t,n)},onSuccess:async(e,t)=>{const n=t.id;console.log("Article updated successfully in mutation callback:",n);try{null!==e&&void 0!==e&&e.published&&await(0,de.E)()}catch(a){}ge.invalidateQueries({queryKey:["admin-articles"]}),ge.invalidateQueries({queryKey:["articles"]}),ge.invalidateQueries({queryKey:["recentArticles"]}),ge.invalidateQueries({queryKey:["article-match-link",n]}),ge.invalidateQueries({queryKey:["article","id:".concat(n)]})},onError:e=>{var t,n;console.error("Error updating article:",e),xe({title:"Chyba p\u0159i aktualizaci \u010dl\xe1nku",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.message)||"Do\u0161lo k chyb\u011b p\u0159i ukl\xe1d\xe1n\xed",status:"error",duration:5e3,isClosable:!0})}}),(0,Q.n)({mutationFn:e=>(0,ne.a)(e),onSuccess:()=>{xe({title:"\u010cl\xe1nek smaz\xe1n",status:"success"}),ge.invalidateQueries({queryKey:["admin-articles"]})},onError:e=>{var t,n,a,i;return xe({title:"Smaz\xe1n\xed selhalo",description:(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.message)||(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.chyba)||"Chyba",status:"error"})}}),(0,i.useCallback)(e=>{var t,n,a;const i=null!==(t=null!==(n=null!==(a=null===e||void 0===e?void 0:e.id)&&void 0!==a?a:null===e||void 0===e?void 0:e.ID)&&void 0!==n?n:null===e||void 0===e?void 0:e.article_id)&&void 0!==t?t:null===e||void 0===e?void 0:e.articleId;if(void 0===i||null===i||""===i)return void xe({title:"Chyb\u011bj\xedc\xed ID \u010dl\xe1nku",description:"Nepoda\u0159ilo se zjistit identifik\xe1tor \u010dl\xe1nku pro smaz\xe1n\xed.",status:"error"});const o="number"===typeof i||"string"===typeof i?i:Number(i);(void 0===o||null===o||"number"===typeof o&&Number.isNaN(o))&&xe({title:"Neplatn\xe9 ID \u010dl\xe1nku",description:"Zadan\xfd identifik\xe1tor \u010dl\xe1nku nen\xed platn\xfd.",status:"error"})},[ge,xe])),ra=(null===tt||void 0===tt?void 0:tt.data)||[],sa=(null===tt||void 0===tt?void 0:tt.total)||0,la=Math.max(1,Math.ceil(sa/10)),ca=(0,d.dU)("blue.50","blue.900"),da=(0,d.dU)("white","gray.700"),ua=(0,d.dU)("blue.50","gray.600"),ha=(0,d.dU)("green.50","green.900"),ma=(0,d.dU)("white","gray.700");return(0,ve.jsx)(ee.A,{requireAdmin:!1,children:(0,ve.jsxs)(u.a,{children:[(0,ve.jsxs)(r.z,{justify:"space-between",mb:4,children:[(0,ve.jsx)(h.D,{size:"lg",children:"\u010cl\xe1nky"}),(0,ve.jsx)(m.$,{leftIcon:(0,ve.jsx)(G.GGD,{}),colorScheme:"blue",onClick:na,children:"Nov\xfd \u010dl\xe1nek"})]}),(0,ve.jsx)(p.E,{color:"gray.500",mb:6,children:"Spr\xe1va \u010dl\xe1nk\u016f a novinek na webu. M\u016f\u017eete vytv\xe1\u0159et, upravovat a publikovat \u010dl\xe1nky."}),(0,ve.jsx)(x.r,{columns:{base:1,md:2},spacing:4,mb:6,children:(0,ve.jsx)(g.p,{placeholder:"Hledat \u010dl\xe1nky...",value:Fe,onChange:e=>Pe(e.target.value),mr:2})}),(0,ve.jsx)(u.a,{bg:(0,d.dU)("white","gray.800"),borderWidth:"1px",borderRadius:"lg",overflowX:"auto",boxShadow:"sm",mb:6,children:(0,ve.jsxs)(v.X,{size:"sm",children:[(0,ve.jsx)(j.d,{children:(0,ve.jsxs)(b.Tr,{children:[(0,ve.jsx)(y.Th,{children:"Obr\xe1zek"}),(0,ve.jsx)(y.Th,{children:"Titulek"}),(0,ve.jsx)(y.Th,{children:"Kategorie"}),(0,ve.jsx)(y.Th,{children:"\u2b50 Prim\xe1rn\xed"}),(0,ve.jsx)(y.Th,{children:"Z\xe1pas"}),(0,ve.jsx)(y.Th,{isNumeric:!0,children:"Akce"})]})}),(0,ve.jsxs)(f.N,{children:[nt&&(0,ve.jsx)(b.Tr,{children:(0,ve.jsx)(k.Td,{colSpan:6,children:(0,ve.jsx)(_.y,{size:"sm"})})}),!nt&&He&&(0,ve.jsxs)(b.Tr,{opacity:.6,children:[(0,ve.jsx)(k.Td,{children:(0,ve.jsx)(ye.A,{src:(0,oe.uq)(He.image_url)||"/dist/img/logo-club-empty.svg",alt:He.title||"Koncept",size:"48px",previewSize:"350px"})}),(0,ve.jsx)(k.Td,{children:(0,ve.jsxs)(w.T,{align:"start",spacing:0,children:[(0,ve.jsx)(p.E,{fontWeight:"medium",children:He.title||"Bez n\xe1zvu (koncept)"}),(0,ve.jsx)(p.E,{fontSize:"xs",color:"gray.500",children:"Koncept (lok\xe1ln\u011b ulo\u017een\xfd)"})]})}),(0,ve.jsx)(k.Td,{children:(0,ve.jsx)(o.E,{colorScheme:"gray",fontSize:"xs",children:He.category_name||"Bez kategorie"})}),(0,ve.jsx)(k.Td,{children:(0,ve.jsx)(z.d,{size:"sm",isChecked:!!He.featured,isDisabled:!0})}),(0,ve.jsx)(k.Td,{children:(0,ve.jsx)(o.E,{colorScheme:"gray",children:"Koncept"})}),(0,ve.jsx)(k.Td,{isNumeric:!0,children:(0,ve.jsxs)(r.z,{spacing:1,justify:"flex-end",children:[(0,ve.jsx)(s.K,{"aria-label":"Upravit koncept",size:"sm",icon:(0,ve.jsx)(G.WXf,{}),onClick:na}),(0,ve.jsx)(s.K,{"aria-label":"Smazat koncept",size:"sm",colorScheme:"red",icon:(0,ve.jsx)(G.IXo,{}),onClick:()=>{try{localStorage.removeItem("draft-article-new")}catch(e){}$e(null),xe({title:"Koncept odstran\u011bn",status:"success",duration:2e3})}})]})})]},"local-draft"),!nt&&ra.map(e=>{var t;return(0,ve.jsxs)(b.Tr,{opacity:e.published?1:.6,children:[(0,ve.jsx)(k.Td,{children:(0,ve.jsx)(ye.A,{src:(0,oe.uq)(e.image_url)||"/dist/img/logo-club-empty.svg",alt:e.title,size:"48px",previewSize:"350px"})}),(0,ve.jsx)(k.Td,{children:(0,ve.jsxs)(w.T,{align:"start",spacing:0,children:[(0,ve.jsx)(p.E,{fontWeight:"medium",children:e.title}),(0,ve.jsx)(p.E,{fontSize:"xs",color:"gray.500",children:e.published?"\u2713 Publikov\xe1no":"\u25cb Koncept"})]})}),(0,ve.jsx)(k.Td,{children:(0,ve.jsx)(o.E,{colorScheme:"blue",fontSize:"xs",children:(null===(t=e.category)||void 0===t?void 0:t.name)||e.category_name||"Bez kategorie"})}),(0,ve.jsx)(k.Td,{children:(0,ve.jsx)(z.d,{size:"sm",isChecked:!!e.featured,onChange:t=>{(async(e,n)=>{try{if(n){let n=(ra||[]).filter(e=>e.featured);const o=n.some(t=>t.id===e.id);if(n.length>=3&&!o)try{n=(await(0,ne.GE)({page:1,page_size:50,featured:!0,published:!1})).data||n}catch(s){}if(n.length>=3&&!o){const o=e=>{const t=(null===e||void 0===e?void 0:e.published_at)||(null===e||void 0===e?void 0:e.created_at)||(null===e||void 0===e?void 0:e.updated_at)||"",n=Date.parse(t);return Number.isNaN(n)?0:n},r=[...n].sort((e,t)=>{const n=o(e)-o(t);return 0!==n?n:(e.id||0)-(t.id||0)})[0];if(r&&r.id!==e.id)try{await(0,ne.iZ)(r.id,{featured:!1}),xe({title:"Uvoln\u011bno m\xedsto pro prim\xe1rn\xed",description:"Zru\u0161ena prim\xe1rnost: ".concat(r.title),status:"info"})}catch(t){var a,i;return void xe({title:"Nelze uvolnit m\xedsto",description:(null===t||void 0===t||null===(a=t.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message)||"Zkuste znovu.",status:"error"})}}await(0,ne.iZ)(e.id,{featured:!0})}else await(0,ne.iZ)(e.id,{featured:!1});ge.invalidateQueries({queryKey:["admin-articles"]}),ge.invalidateQueries({queryKey:["articles"]}),ge.invalidateQueries({queryKey:["featured-articles"]}),xe({title:n?"\u010cl\xe1nek nastaven jako prim\xe1rn\xed":"\u010cl\xe1nek odstran\u011bn z prim\xe1rn\xedch",status:"success",duration:2e3})}catch(l){var o,r;xe({title:"Chyba p\u0159i aktualizaci",description:(null===l||void 0===l||null===(o=l.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.error)||"Nepoda\u0159ilo se zm\u011bnit stav",status:"error"})}})(e,t.target.checked)}})}),(0,ve.jsx)(k.Td,{children:(0,ve.jsx)(We,{articleId:e.id})}),(0,ve.jsx)(k.Td,{isNumeric:!0,children:(0,ve.jsxs)(r.z,{spacing:1,children:[(0,ve.jsx)(s.K,{"aria-label":"Upravit",size:"sm",icon:(0,ve.jsx)(G.WXf,{}),onClick:()=>(e=>{var t,n;const i="draft-article-".concat(e.id);if(Ve(i),qe((0,a.A)((0,a.A)({},e),{},{category_name:(null===(t=e.category)||void 0===t?void 0:t.name)||e.category_name||""})),null!==e&&void 0!==e&&null!==(n=e.match_link)&&void 0!==n&&n.external_match_id){const t=String(e.match_link.external_match_id);Tt(t),Ft(t)}else Tt(""),Ft("");Ut(1),lt(""),ot()})(e)}),(0,ve.jsx)(s.K,{"aria-label":"P\u0159elo\u017eit",size:"sm",colorScheme:"blue",icon:(0,ve.jsx)(G.VeH,{}),title:"P\u0159elo\u017eit \u010dl\xe1nek",onClick:()=>(async e=>{if(e.title&&e.content)try{const t=(0,Le.od)(e.title+" "+e.content),n="cs"===t?"en":"cs";if(t===n)return void xe({title:"P\u0159eklad nen\xed pot\u0159eba",description:"\u010cl\xe1nek je ji\u017e v c\xedlov\xe9m jazyce.",status:"info",duration:3e3});const a=await(0,Le.IG)(e.title,e.content,t,n);await(0,ne.iZ)(e.id,{title:a.translatedTitle,content:a.translatedContent,slug:Oe(a.translatedTitle)}),ge.invalidateQueries({queryKey:["admin-articles"]}),ge.invalidateQueries({queryKey:["articles"]}),xe({title:"\u010cl\xe1nek p\u0159elo\u017een",description:"\u010cl\xe1nek byl p\u0159elo\u017een z ".concat("cs"===t?"\u010de\u0161tiny":"angli\u010dtiny"," do ").concat("cs"===n?"\u010de\u0161tiny":"angli\u010dtiny","."),status:"success",duration:3e3})}catch(t){xe({title:"Chyba p\u0159i p\u0159ekladu",description:(null===t||void 0===t?void 0:t.message)||"Nepoda\u0159ilo se p\u0159elo\u017eit \u010dl\xe1nek.",status:"error",duration:3e3})}else xe({title:"Nelze p\u0159elo\u017eit",description:"\u010cl\xe1nek mus\xed m\xedt n\xe1zev a obsah.",status:"error",duration:3e3})})(e)}),(0,ve.jsx)(s.K,{"aria-label":"Smazat",size:"sm",colorScheme:"red",icon:(0,ve.jsx)(G.IXo,{}),onClick:()=>oa(e)}),(0,ve.jsx)(s.K,{"aria-label":"Zkr\xe1tit odkaz",size:"sm",icon:(0,ve.jsx)(G.ayE,{}),title:"Zkr\xe1tit odkaz pro sd\xedlen\xed",onClick:async()=>{try{const t=window.location.origin,n=(null===e||void 0===e?void 0:e.slug)||(null===e||void 0===e?void 0:e.Slug),a=n?"/news/".concat(n):"/articles/".concat(e.id),i="".concat(t).concat(a),o=await(0,Ae.fn)({target_url:i,title:e.title,source_type:"article",source_id:e.id,code:"a".concat(e.id)});await navigator.clipboard.writeText(o.short_url),xe({title:"Zkr\xe1cen\xfd odkaz zkop\xedrov\xe1n",description:o.short_url,status:"success",duration:4e3})}catch(t){xe({title:"Vytvo\u0159en\xed odkazu selhalo",description:(null===t||void 0===t?void 0:t.message)||"Zkuste to znovu",status:"error"})}}})]})})]},e.id)})]})]})}),(0,ve.jsxs)(r.z,{mt:4,justify:"flex-end",children:[(0,ve.jsx)(m.$,{onClick:()=>Re(e=>Math.max(1,e-1)),isDisabled:Ne<=1,children:"P\u0159edchoz\xed"}),(0,ve.jsx)(m.$,{onClick:()=>Re(e=>Math.min(la,e+1)),isDisabled:Ne>=la,children:"Dal\u0161\xed"})]}),(0,ve.jsxs)(S.aF,{isOpen:it,onClose:aa,size:"xl",isCentered:!0,children:[(0,ve.jsx)(A.m,{}),(0,ve.jsxs)(C.$,{maxW:"90vw",maxH:"90vh",children:[(0,ve.jsx)(E.r,{children:(0,ve.jsxs)(r.z,{justify:"space-between",align:"center",w:"full",pr:8,children:[(0,ve.jsx)(p.E,{children:null!==Ie&&void 0!==Ie&&Ie.id?"Upravit \u010dl\xe1nek":"Nov\xfd \u010dl\xe1nek"}),(0,ve.jsx)(ke.A,{status:Wn,lastSaved:Un})]})}),(0,ve.jsx)(T.s,{}),(0,ve.jsx)(D.c,{maxH:"calc(90vh - 120px)",overflowY:"auto",children:(0,ve.jsxs)(N.t,{variant:"enclosed",colorScheme:"blue",isFitted:!0,index:Wt,onChange:e=>Ut(e),isLazy:!0,lazyBehavior:"keepMounted",children:[(0,ve.jsxs)(R.w,{children:[(0,ve.jsx)(F.o,{children:"AI"}),(0,ve.jsx)(F.o,{children:"Z\xe1kladn\xed"}),(0,ve.jsx)(F.o,{children:"Obsah"}),(0,ve.jsx)(F.o,{children:"M\xe9dia"}),(0,ve.jsx)(F.o,{children:"Anketa"})]}),(0,ve.jsxs)(P.T,{children:[(0,ve.jsx)(I.K,{children:(0,ve.jsxs)(u.a,{borderWidth:"1px",borderRadius:"md",p:4,bg:"blue.50",children:[(0,ve.jsx)(h.D,{as:"h3",size:"sm",mb:2,children:"\u270d\ufe0f AI: Rozvi\u0148te V\xc1\u0160 TEXT na \u010dl\xe1nek"}),(0,ve.jsxs)(p.E,{fontSize:"sm",color:"gray.700",mb:3,children:[(0,ve.jsx)("strong",{children:"Napi\u0161te sv\u016fj text"})," s d\u016fle\u017eit\xfdmi informacemi - fakta, jm\xe9na, v\xfdsledky, ud\xe1losti. AI v\xe1\u0161 text pou\u017eije jako z\xe1klad, p\u0159id\xe1 strukturu a pokud je text kr\xe1tk\xfd, roz\u0161\xed\u0159\xed ho o kontext a detaily kolem va\u0161ich informac\xed. ",(0,ve.jsx)("strong",{children:"\u010c\xedm v\xedce nap\xed\u0161ete, t\xedm m\xe9n\u011b AI p\u0159id\xe1v\xe1."})," Dlouh\xfd text = jen form\xe1tov\xe1n\xed."]}),(0,ve.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,ve.jsxs)(M.MJ,{children:[(0,ve.jsx)(L.l,{fontWeight:"bold",children:"V\xe1\u0161 text (\u010desky)"}),(0,ve.jsx)(Ce.A,{value:st,onChange:lt,onSubmit:(e,t)=>(yt(t),ta.mutateAsync()),isSubmitting:ta.isLoading,placeholder:"Napi\u0161te sv\u016fj text s d\u016fle\u017eit\xfdmi informacemi. P\u0159\xedklad: Dnes na\u0161e mu\u017estvo zvl\xe1dlo d\u016fle\u017eit\xfd z\xe1pas proti TJ Sokol P\u0159\xedbram...",helperText:"Kr\xe1tk\xfd text AI roz\u0161\xed\u0159\xed, dlouh\xfd text hlavn\u011b naform\xe1tuje do HTML."})]}),(0,ve.jsxs)(r.z,{children:[(0,ve.jsxs)(M.MJ,{children:[(0,ve.jsx)(L.l,{children:"Publikum"}),(0,ve.jsx)(g.p,{value:ct,onChange:e=>dt(e.target.value),bg:Ue})]}),(0,ve.jsxs)(M.MJ,{w:"180px",children:[(0,ve.jsx)(L.l,{children:"Min. slov"}),(0,ve.jsx)(g.p,{type:"text",inputMode:"numeric",placeholder:"500",value:mt,onChange:e=>{const t=e.target.value.replace(/[^0-9]/g,"");pt(t)},onBlur:()=>{const e=parseInt(String(mt||"").trim(),10);!isNaN(e)&&Number.isFinite(e)&&e>0?(ht(e),pt(String(e))):pt(String(ut||500))},bg:Ue})]})]}),(0,ve.jsxs)(r.z,{children:[(0,ve.jsx)(m.$,{size:"md",colorScheme:"purple",onClick:()=>ta.mutateAsync(),isDisabled:ta.isLoading||!st.trim(),children:"Rozvinout text na \u010dl\xe1nek"}),(0,ve.jsx)(u.a,{fontSize:"sm",color:"gray.600",children:"AI zachov\xe1 v\xe1\u0161 text a roz\u0161\xed\u0159\xed ho pokud je kr\xe1tk\xfd, p\u0159id\xe1 strukturu a vygeneruje n\xe1zev."})]})]})]})}),(0,ve.jsx)(I.K,{children:(0,ve.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,ve.jsxs)(M.MJ,{isRequired:!0,children:[(0,ve.jsx)(L.l,{fontWeight:"bold",children:"N\xe1zev \u010dl\xe1nku"}),(0,ve.jsx)(g.p,{value:(null===Ie||void 0===Ie?void 0:Ie.title)||"",onChange:e=>{return t=e.target.value,void(Ie&&qe(e=>(0,a.A)((0,a.A)({},e),{},{title:t},null!==e&&void 0!==e&&e.slugModified?{}:{slug:Oe(t)})));var t},placeholder:"Zadejte n\xe1zev \u010dl\xe1nku",size:"lg"})]}),(0,ve.jsxs)(M.MJ,{children:[(0,ve.jsx)(L.l,{children:"URL adresa (slug)"}),(0,ve.jsx)(g.p,{placeholder:"moje-clanek-slug",value:(null===Ie||void 0===Ie?void 0:Ie.slug)||"",onChange:e=>{return t=e.target.value,void(Ie&&qe(e=>(0,a.A)((0,a.A)({},e),{},{slug:t,slugModified:!0})));var t}}),(0,ve.jsx)(M.eK,{children:"Automaticky generov\xe1no z n\xe1zvu \u010dl\xe1nku"})]}),(0,ve.jsxs)(M.MJ,{children:[(0,ve.jsx)(L.l,{fontWeight:"bold",children:"Kategorie (sout\u011b\u017e)"}),(0,ve.jsx)(W.l,{placeholder:"Vyberte kategorii (voliteln\xe9)",value:(null===Ie||void 0===Ie?void 0:Ie.category_name)||"",onChange:e=>qe(t=>(0,a.A)((0,a.A)({},t),{},{category_name:e.target.value})),size:"lg",children:_t.map((e,t)=>(0,ve.jsx)("option",{value:e.code&&zt[e.code]?zt[e.code]:e.name,children:e.code&&zt[e.code]?zt[e.code]:e.name},(e.code||e.name)+"_"+t))}),(0,ve.jsx)(M.eK,{children:"Kategorie ur\u010duje, ve kter\xe9 sekci se \u010dl\xe1nek zobraz\xed (voliteln\xe9)"})]}),(null===Ie||void 0===Ie?void 0:Ie.title)&&(null===Ie||void 0===Ie?void 0:Ie.content)&&(0,ve.jsx)(Me,{title:Ie.title,content:Ie.content,onTranslationComplete:(e,t)=>{qe(n=>(0,a.A)((0,a.A)({},n),{},{title:e,content:t,slug:Oe(e)})),xe({title:"\u010cl\xe1nek p\u0159elo\u017een",description:"\u010cl\xe1nek byl \xfasp\u011b\u0161n\u011b p\u0159elo\u017een a ulo\u017een do formul\xe1\u0159e.",status:"success",duration:3e3})}}),(0,ve.jsx)(u.a,{borderWidth:"2px",borderRadius:"lg",p:4,bg:(0,d.dU)("orange.50","orange.900"),borderColor:(0,d.dU)("orange.300","orange.600"),children:(0,ve.jsxs)(M.MJ,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,ve.jsxs)(u.a,{children:[(0,ve.jsx)(L.l,{mb:"1",fontSize:"lg",fontWeight:"bold",children:"\u2b50 Prim\xe1rn\xed na \xfavodn\xed str\xe1nce"}),(0,ve.jsx)(p.E,{fontSize:"sm",color:(0,d.dU)("gray.600","gray.400"),children:"Zv\xfdrazn\xed \u010dl\xe1nek jako hlavn\xed p\u0159\xedsp\u011bvek na domovsk\xe9 str\xe1nce"}),(0,ve.jsx)(p.E,{fontSize:"xs",color:(0,d.dU)("gray.600","gray.400"),mt:1,children:"Maxim\xe1ln\u011b 3 \u010dl\xe1nky mohou b\xfdt prim\xe1rn\xed. Pokud vyberete dal\u0161\xed, nejstar\u0161\xed prim\xe1rn\xed se automaticky zru\u0161\xed."})]}),(0,ve.jsx)(z.d,{size:"lg",isChecked:!(null===Ie||void 0===Ie||!Ie.featured),isDisabled:ft,onChange:e=>(async t=>{if(!Ie)return;const n=!(null===Ie||void 0===Ie||!Ie.featured);if(t&&t!==n)try{kt(!0);let t=(ra||[]).filter(e=>e.featured);if(t.length>=3)try{t=(await(0,ne.GE)({page:1,page_size:50,featured:!0,published:!1})).data||t}catch(r){}if(t.length>=3){const n=e=>{const t=(null===e||void 0===e?void 0:e.published_at)||(null===e||void 0===e?void 0:e.created_at)||(null===e||void 0===e?void 0:e.updated_at)||"",n=Date.parse(t);return isNaN(n)?0:n},a=[...t].sort((e,t)=>{const a=n(e)-n(t);return 0!==a?a:(e.id||0)-(t.id||0)})[0];if(a&&a.id!==(null===Ie||void 0===Ie?void 0:Ie.id))try{await(0,ne.iZ)(a.id,{featured:!1}),xe({title:"Uvoln\u011bno m\xedsto pro prim\xe1rn\xed",description:"Zru\u0161ena prim\xe1rnost: ".concat(a.title),status:"info"}),ge.invalidateQueries({queryKey:["admin-articles"]}),ge.invalidateQueries({queryKey:["articles"]}),ge.invalidateQueries({queryKey:["featured-articles"]})}catch(e){var i,o;return xe({title:"Nelze uvolnit m\xedsto",description:(null===e||void 0===e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.message)||"Zkuste znovu.",status:"error"}),void kt(!1)}}qe(e=>(0,a.A)((0,a.A)({},e),{},{featured:!0}))}finally{kt(!1)}else qe(e=>(0,a.A)((0,a.A)({},e),{},{featured:t}))})(e.target.checked)})]})}),(0,ve.jsxs)(u.a,{borderWidth:"1px",borderRadius:"lg",p:4,bg:(0,d.dU)("blue.50","blue.900"),borderColor:"blue.200",children:[(0,ve.jsxs)(r.z,{justify:"space-between",mb:3,children:[(0,ve.jsx)(h.D,{as:"h3",size:"sm",children:"\u26bd Propojit se z\xe1pasem (voliteln\xe9)"}),Et&&(0,ve.jsx)(o.E,{colorScheme:"green",children:"Propojeno"})]}),(0,ve.jsxs)(w.T,{align:"stretch",spacing:3,children:[!(null!==Ie&&void 0!==Ie&&Ie.category_name)&&(0,ve.jsx)(p.E,{fontSize:"sm",color:"orange.600",fontWeight:"bold",children:"\u26a0\ufe0f Nejprve vyberte kategorii v\xfd\u0161e pro zobrazen\xed relevantn\xedch z\xe1pas\u016f"}),(0,ve.jsxs)(M.MJ,{isDisabled:!(null!==Ie&&void 0!==Ie&&Ie.category_name),children:[(0,ve.jsx)(L.l,{fontSize:"sm",children:"Rychl\xe9 vyhled\xe1v\xe1n\xed"}),(0,ve.jsxs)(r.z,{spacing:2,children:[(0,ve.jsx)(g.p,{placeholder:"Hledat z\xe1pas (t\xfdm, soupe\u0159...)",value:Mt,onChange:e=>Lt(e.target.value),bg:Ue,size:"sm"}),(0,ve.jsx)(g.p,{type:"date",value:Ot,onChange:e=>qt(e.target.value),bg:Ue,size:"sm",w:"160px"})]})]}),(0,ve.jsxs)(u.a,{children:[(0,ve.jsxs)(r.z,{justify:"space-between",mb:2,children:[(0,ve.jsxs)(p.E,{fontSize:"sm",fontWeight:"medium",mb:0,children:["Vyberte z\xe1pas (",ea.length,")"]}),Et&&(null===Ie||void 0===Ie?void 0:Ie.id)&&(0,ve.jsx)(m.$,{size:"xs",variant:"ghost",colorScheme:"red",onClick:async()=>{try{await(0,ne.Z6)(Ie.id),Tt(""),Ft(""),Bt(""),xe({title:"Propojen\xed zru\u0161eno",status:"success"})}catch(n){var e,t;xe({title:"Zru\u0161en\xed selhalo",description:(null===n||void 0===n||null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||(null===n||void 0===n?void 0:n.message),status:"error"})}},children:"Zru\u0161it propojen\xed"})]}),(0,ve.jsxs)(u.a,{maxH:"400px",overflowY:"auto",bg:(0,d.dU)("white","gray.800"),borderRadius:"md",borderWidth:"1px",p:2,children:[0===ea.length&&(0,ve.jsx)(p.E,{fontSize:"sm",color:"gray.500",textAlign:"center",py:4,children:"\u017d\xe1dn\xe9 z\xe1pasy pro vybranou kategorii"}),(0,ve.jsx)(w.T,{spacing:2,align:"stretch",children:ea.slice(0,100).map(e=>{const t=String(e.id||""),n=Et===t,a=Rt===t&&!n,i=n||a,s=new Date(e.date||""),l=!isNaN(s.getTime()),c=l?s.toLocaleDateString("cs-CZ",{day:"numeric",month:"short",year:"numeric"}):e.date||"N/A",d=l?s.toLocaleTimeString("cs-CZ",{hour:"2-digit",minute:"2-digit"}):"",h=e.home||"",m=e.away||"",x=e.score||"vs",g="vs"!==x,v="".concat(h," ").concat(x," ").concat(m).trim();return(0,ve.jsx)(u.a,{p:3,borderWidth:"2px",borderRadius:"md",borderColor:n?"green.500":a?"blue.500":"gray.200",bg:i?ca:da,cursor:"pointer",_hover:{borderColor:n?"green.400":"blue.300",bg:ua},transition:"all 0.2s",onClick:async()=>{const e=t;if(Ft(e),Bt(e),e&&null!==Ie&&void 0!==Ie&&Ie.id)try{const t=await(0,ne.nX)(Ie.id,{external_match_id:String(e).trim(),title:(null===Ie||void 0===Ie?void 0:Ie.title)||""});Tt(t.external_match_id||String(e).trim()),xe({title:"Propojeno se z\xe1pasem",status:"success",duration:2e3})}catch(i){var n,a;xe({title:"Propojen\xed selhalo",description:(null===i||void 0===i||null===(n=i.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.error)||(null===i||void 0===i?void 0:i.message),status:"error"})}else!e||null!==Ie&&void 0!==Ie&&Ie.id||xe({title:"Propojen\xed bude ulo\u017eeno po vytvo\u0159en\xed \u010dl\xe1nku",status:"info",duration:2e3})},children:(0,ve.jsxs)(r.z,{justify:"space-between",spacing:3,children:[(0,ve.jsxs)(w.T,{align:"start",spacing:1,flex:1,children:[(0,ve.jsxs)(r.z,{spacing:2,children:[(0,ve.jsx)(o.E,{colorScheme:g?"green":"gray",fontSize:"xs",children:c}),(0,ve.jsx)(o.E,{colorScheme:"blue",fontSize:"xs",children:d})]}),(0,ve.jsx)(p.E,{fontSize:"sm",fontWeight:"bold",noOfLines:1,children:v}),e.competition&&(0,ve.jsx)(p.E,{fontSize:"xs",color:"gray.500",noOfLines:1,children:e.competition})]}),n&&(0,ve.jsx)(o.E,{colorScheme:"green",fontSize:"xs",p:2,children:"Ji\u017e m\xe1 \u010dl\xe1nek"}),!n&&a&&(0,ve.jsx)(o.E,{colorScheme:"blue",fontSize:"xs",p:2,children:"Vybr\xe1no"})]})},e.id)})})]}),ea.length>100&&(0,ve.jsx)(p.E,{fontSize:"xs",color:"gray.500",mt:2,children:"Zobrazeno prvn\xedch 100 z\xe1pas\u016f. Pou\u017eijte vyhled\xe1v\xe1n\xed pro z\xfa\u017een\xed v\xfdsledk\u016f."})]})]})]})]})}),(0,ve.jsx)(I.K,{children:(0,ve.jsxs)(M.MJ,{children:[(0,ve.jsx)(L.l,{children:"Obsah"}),(0,ve.jsxs)(r.z,{justify:"space-between",mb:2,children:[(0,ve.jsx)(m.$,{size:"sm",colorScheme:"purple",leftIcon:(0,ve.jsx)(G.GGD,{}),onClick:en,children:"Vlo\u017eit fotografie z alba"}),(0,ve.jsx)(m.$,{size:"sm",variant:"outline",leftIcon:(0,ve.jsx)(G.CKj,{}),onClick:Sn,children:"Vybrat z alba"})]}),2===Wt&&(0,ve.jsx)(ie.A,{value:(null===Ie||void 0===Ie?void 0:Ie.content)||"",onChange:e=>{Ye(Date.now()),qe(t=>(0,a.A)((0,a.A)({},t),{},{content:e}))},placeholder:"Za\u010dn\u011bte ps\xe1t obsah \u010dl\xe1nku...",height:"60vh",onImageUpload:ne.QM,toolbar:"full"})]})}),(0,ve.jsx)(I.K,{children:(0,ve.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,ve.jsxs)(u.a,{borderWidth:"1px",borderRadius:"md",p:3,bg:"gray.50",children:[(0,ve.jsx)(h.D,{as:"h3",size:"sm",mb:2,children:"Zonerama v\xfdb\u011br"}),(0,ve.jsxs)(w.T,{align:"stretch",spacing:2,children:[(0,ve.jsxs)(M.MJ,{children:[(0,ve.jsx)(L.l,{children:"Odkaz na album Zonerama"}),(0,ve.jsxs)(U.M,{children:[(0,ve.jsx)(O.W,{pointerEvents:"none",children:(0,ve.jsx)(q.I,{as:G.CKj,color:"gray.400"})}),(0,ve.jsx)(g.p,{placeholder:"https://eu.zonerama.com/\u2026",value:Zt,onChange:e=>Vt(e.target.value),bg:Ht.length>0?ha:void 0})]}),(0,ve.jsx)(M.eK,{fontSize:"xs",children:Ht.length>0?"\u2713 Album na\u010dteno (".concat(Ht.length," fotografi\xed). M\u016f\u017eete vlo\u017eit jin\xe9 album nebo vybrat fotky n\xed\u017ee."):"Vlo\u017ete odkaz na album, nebo album se automaticky na\u010dte p\u0159i v\xfdb\u011bru fotografi\xed v sekci Obsah."}),(null===Ie||void 0===Ie?void 0:Ie.gallery_album_url)&&Zt&&Ie.gallery_album_url===Zt&&(0,ve.jsx)(p.E,{fontSize:"xs",color:"blue.600",fontWeight:"bold",mt:1,children:"\ud83d\udd17 Album propojeno s \u010dl\xe1nkem (zobrazeno v sekci Obsah)"})]}),(0,ve.jsxs)(r.z,{children:[(0,ve.jsx)(m.$,{size:"sm",onClick:Qn,isLoading:Jt,children:"Na\u010d\xedst album"}),(0,ve.jsx)(m.$,{size:"sm",colorScheme:"purple",onClick:an,children:"Vybrat z galerie"}),Zt?(0,ve.jsx)(m.$,{size:"sm",as:"a",href:Zt,target:"_blank",rel:"noopener noreferrer",rightIcon:(0,ve.jsx)(G.HaR,{}),children:"Otev\u0159\xedt album"}):null]}),Jt&&0===Ht.length&&(0,ve.jsxs)(r.z,{spacing:2,color:"gray.600",mt:2,children:[(0,ve.jsx)(_.y,{size:"sm"}),(0,ve.jsx)(p.E,{children:"Album se na\u010d\xedt\xe1\u2026"})]}),!Jt&&0===Ht.length&&Zt&&(0,ve.jsx)(p.E,{fontSize:"sm",color:"gray.500",mt:2,children:'Zadejte odkaz na Zonerama album a klikn\u011bte na "Na\u010d\xedst album"'}),Ht.length>0&&(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)(x.r,{columns:{base:3,md:6},spacing:2,mt:2,children:Ht.slice(0,Cn).map(e=>(0,ve.jsx)(u.a,{borderWidth:"1px",borderRadius:"md",overflow:"hidden",_hover:{boxShadow:"md"},cursor:"pointer",onClick:()=>Xn({id:e.id,album_id:"",album_url:Zt,page_url:e.page_url,image_url:e.image_1500||"",title:e.title}),children:(0,ve.jsx)(K._,{src:e.image_1500||"",alt:e.id,w:"100%",h:"100px",objectFit:"cover",loading:"lazy",decoding:"async"})},e.id))}),Ht.length>Cn&&(0,ve.jsx)(r.z,{justify:"center",mt:2,children:(0,ve.jsx)(m.$,{size:"sm",onClick:()=>En(e=>e+24),children:"Na\u010d\xedst dal\u0161\xed"})})]})]})]}),(0,ve.jsxs)(M.MJ,{children:[(0,ve.jsx)(L.l,{fontWeight:"bold",children:"Tituln\xed obr\xe1zek"}),(0,ve.jsx)(M.eK,{mb:2,children:"Vyberte obr\xe1zek ze Zonerama v\xfd\u0161e nebo nahrajte vlastn\xed soubor."}),(0,ve.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,ve.jsx)(we.A,{label:"Tituln\xed obr\xe1zek",description:"Nahrajte nebo p\u0159et\xe1hn\u011bte tituln\xed obr\xe1zek \u010dl\xe1nku.",accept:"image/*",multiple:!1,maxFiles:1,allowUrlImport:!0,urlPlaceholder:"/uploads/... nebo https://example.com/obrazek.jpg",onChange:e=>{const t=e[e.length-1];qe(e=>(0,a.A)((0,a.A)({},e),{},{image_url:(null===t||void 0===t?void 0:t.url)||(null===e||void 0===e?void 0:e.image_url)||""}))}}),(0,ve.jsxs)(r.z,{children:[(0,ve.jsx)(K._,{src:(0,oe.uq)(null===Ie||void 0===Ie?void 0:Ie.image_url)||"/dist/img/logo-club-empty.svg",alt:"cover",boxSize:"80px",objectFit:"cover",borderRadius:"md"}),(null===Ie||void 0===Ie?void 0:Ie.image_url)&&(0,ve.jsx)(p.E,{fontSize:"sm",color:"gray.500",noOfLines:1,children:Ie.image_url})]}),(0,ve.jsxs)(r.z,{justify:"space-between",children:[(0,ve.jsx)(p.E,{fontSize:"xs",color:"gray.500",children:"Pokud nech\xe1te obr\xe1zek pr\xe1zdn\xfd, m\u016f\u017ee b\xfdt p\u0159i ulo\u017een\xed \u010dl\xe1nku vygenerov\xe1n automaticky."}),(0,ve.jsx)(m.$,{size:"xs",variant:"outline",colorScheme:"purple",onClick:Jn,isLoading:In,children:"Vygenerovat tituln\xed obr\xe1zek (Grok)"})]})]})]}),(0,ve.jsxs)(u.a,{borderWidth:"1px",borderRadius:"md",p:3,bg:"gray.50",children:[(0,ve.jsxs)(r.z,{justify:"space-between",align:"center",mb:2,children:[(0,ve.jsxs)(h.D,{as:"h3",size:"sm",display:"flex",alignItems:"center",gap:2,children:[(0,ve.jsx)(q.I,{as:G.pVQ}),"YouTube video k \u010dl\xe1nku"]}),(0,ve.jsx)(m.$,{size:"sm",variant:"outline",leftIcon:(0,ve.jsx)(G.pVQ,{}),onClick:_n,children:"Vybrat z kan\xe1lu"})]}),(0,ve.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,ve.jsxs)(M.MJ,{children:[(0,ve.jsx)(L.l,{fontSize:"sm",children:"P\u0159idat ru\u010dn\u011b (ID nebo odkaz)"}),(0,ve.jsxs)(r.z,{children:[(0,ve.jsx)(g.p,{placeholder:"https://www.youtube.com/watch?v=...",value:yn,onChange:e=>fn(e.target.value),bg:Ue}),(0,ve.jsx)(m.$,{size:"sm",colorScheme:"blue",onClick:Gn,children:"P\u0159idat"})]}),(0,ve.jsx)(M.eK,{fontSize:"xs",children:"Podporujeme pln\xe9 URL, zkr\xe1cen\xe9 odkazy i ID videa."})]}),null!==Ie&&void 0!==Ie&&Ie.youtube_video_id?(0,ve.jsx)(u.a,{borderWidth:"1px",borderRadius:"md",p:3,bg:Ue,children:(0,ve.jsxs)(r.z,{align:"start",spacing:3,children:[(0,ve.jsx)(B.g,{ratio:16/9,w:"160px",children:(0,ve.jsx)(K._,{src:(null===Ie||void 0===Ie?void 0:Ie.youtube_video_thumbnail)||"https://i.ytimg.com/vi/".concat(null===Ie||void 0===Ie?void 0:Ie.youtube_video_id,"/hqdefault.jpg"),alt:(null===Ie||void 0===Ie?void 0:Ie.youtube_video_title)||"YouTube thumbnail",objectFit:"cover",borderRadius:"md"})}),(0,ve.jsxs)(w.T,{align:"stretch",spacing:1,flex:1,children:[(0,ve.jsx)(p.E,{fontWeight:"semibold",children:(null===Ie||void 0===Ie?void 0:Ie.youtube_video_title)||"YouTube video"}),(0,ve.jsx)(Z.N,{href:null===Ie||void 0===Ie?void 0:Ie.youtube_video_url,isExternal:!0,color:"blue.500",children:null===Ie||void 0===Ie?void 0:Ie.youtube_video_url}),(0,ve.jsx)(r.z,{spacing:2,children:(0,ve.jsxs)(o.E,{colorScheme:"red",children:["ID: ",null===Ie||void 0===Ie?void 0:Ie.youtube_video_id]})})]}),(0,ve.jsx)(s.K,{"aria-label":"Odebrat video",icon:(0,ve.jsx)(G.yGN,{}),size:"sm",onClick:$n})]})}):(0,ve.jsx)(p.E,{fontSize:"sm",color:"gray.600",children:"\u017d\xe1dn\xe9 video nen\xed p\u0159ipojeno. Vyberte video z kan\xe1lu nebo vlo\u017ete odkaz."})]})]}),(0,ve.jsxs)(M.MJ,{children:[(0,ve.jsx)(L.l,{fontWeight:"bold",children:"P\u0159\xedlohy"}),(0,ve.jsx)(M.eK,{mb:2,children:"P\u0159idejte dokumenty, obr\xe1zky nebo jin\xe9 soubory k \u010dl\xe1nku (PDF, Word, Excel, PowerPoint, obr\xe1zky, ZIP)"}),(0,ve.jsx)(we.A,{label:"P\u0159\xedlohy k \u010dl\xe1nku",description:"Nahrajte dokumenty, obr\xe1zky nebo archivy jako p\u0159\xedlohy k \u010dl\xe1nku.",accept:".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png,.gif,.webp,.txt,.zip,.rar",multiple:!0,maxFiles:30,uploadFn:async e=>{if(!(["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","image/jpeg","image/png","image/gif","image/webp","text/plain","application/zip","application/x-zip-compressed","application/x-rar-compressed","application/vnd.rar"].includes(e.type)||!!e.name.match(/\.(pdf|docx?|xlsx?|pptx?|jpe?g|png|gif|webp|txt|zip|rar)$/i)))throw new Error('Soubor "'.concat(e.name,'" nelze nahr\xe1t (nepodporovan\xfd form\xe1t).'));const t=await(0,ne.QM)(e);return{url:t.url,name:e.name,type:e.type||t.type||"application/octet-stream",size:e.size||t.size||0}},onUploadFinished:e=>{e&&0!==e.length&&qe(t=>{const n=Array.isArray(null===t||void 0===t?void 0:t.attachments)?t.attachments:[],i=e.map(e=>({name:e.name,url:e.url,mime_type:e.type,size:e.size}));return(0,a.A)((0,a.A)({},t),{},{attachments:[...n,...i]})})}}),(0,ve.jsx)(u.a,{mt:2,children:Array.isArray(null===Ie||void 0===Ie?void 0:Ie.attachments)&&Ie.attachments.length>0?(0,ve.jsxs)(v.X,{size:"sm",variant:"simple",children:[(0,ve.jsx)(j.d,{children:(0,ve.jsxs)(b.Tr,{children:[(0,ve.jsx)(y.Th,{children:"N\xe1zev"}),(0,ve.jsx)(y.Th,{children:"Velikost"}),(0,ve.jsx)(y.Th,{children:"Akce"})]})}),(0,ve.jsx)(f.N,{children:Ie.attachments.map((e,t)=>(0,ve.jsx)(b.Tr,{children:(0,ve.jsx)(k.Td,{colSpan:3,p:2,children:(0,ve.jsxs)(r.z,{justify:"space-between",w:"full",children:[(0,ve.jsx)(u.a,{flex:1,children:(0,ve.jsx)(fe.A,{url:e.url,name:e.name,mimeType:e.mime_type,size:e.size})}),(0,ve.jsx)(m.$,{size:"xs",variant:"outline",colorScheme:"red",flexShrink:0,ml:2,onClick:()=>qe(e=>(0,a.A)((0,a.A)({},e),{},{attachments:(e.attachments||[]).filter((e,n)=>n!==t)})),children:"Odebrat"})]})})},t))})]}):(0,ve.jsx)(u.a,{color:"gray.500",fontSize:"sm",children:"\u017d\xe1dn\xe9 p\u0159\xedlohy"})})]})]})}),(0,ve.jsx)(I.K,{children:(0,ve.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,ve.jsxs)(u.a,{borderWidth:"1px",borderRadius:"md",p:4,bg:(0,d.dU)("purple.50","purple.900"),children:[(0,ve.jsx)(h.D,{as:"h3",size:"sm",mb:2,children:"\ud83d\udcca Ankety k \u010dl\xe1nku"}),(0,ve.jsx)(p.E,{fontSize:"sm",color:"gray.700",mb:3,children:"Vytvo\u0159te nebo p\u0159ipojte ankety p\u0159\xedmo k tomuto \u010dl\xe1nku. Ankety se zobraz\xed automaticky na konci \u010dl\xe1nku a \u010dten\xe1\u0159i mohou hlasovat."})]}),me&&null!==Ie&&void 0!==Ie&&Ie.id?(0,ve.jsx)(be.A,{articleId:Ie.id,onPollsChanged:()=>{ge.invalidateQueries({queryKey:["linked-polls"]})}}):(0,ve.jsxs)(V.F,{status:"info",borderRadius:"md",children:[(0,ve.jsx)(H._,{}),(0,ve.jsxs)(w.T,{align:"start",spacing:2,children:[(0,ve.jsx)(p.E,{fontWeight:"semibold",children:"saving"===Wn?"Ukl\xe1d\xe1n\xed \u010dl\xe1nku...":"\u010cl\xe1nek se ukl\xe1d\xe1 automaticky"}),(0,ve.jsx)(p.E,{fontSize:"sm",children:'Za\u010dn\u011bte ps\xe1t \u010dl\xe1nek na z\xe1lo\u017ek\xe1ch v\xfd\u0161e. Syst\xe9m automaticky ukl\xe1d\xe1 ka\u017edou zm\u011bnu jako koncept. Jakmile bude \u010dl\xe1nek ulo\u017een (v z\xe1hlav\xed se zobraz\xed "Ulo\u017eeno"), budete moci p\u0159idat ankety.'}),"saving"===Wn&&(0,ve.jsx)(_.y,{size:"sm",color:"blue.500"}),"idle"===Wn&&(0,ve.jsx)(p.E,{fontSize:"xs",color:"gray.600",children:"\ud83d\udca1 Vypl\u0148te n\xe1zev \u010dl\xe1nku pro aktivaci automatick\xe9ho ukl\xe1d\xe1n\xed"}),(0,ve.jsx)(m.$,{size:"sm",colorScheme:"blue",onClick:async()=>{try{await On(),Ut(4)}catch(e){}},isLoading:ia.isLoading,children:"Ulo\u017eit jako koncept a p\u0159idat ankety"})]})]})]})})]})]})}),(0,ve.jsx)($.j,{children:(0,ve.jsx)(m.$,{variant:"ghost",onClick:aa,children:"Zru\u0161it"})})]})]}),(0,ve.jsx)(je,{isOpen:Qt,onClose:tn,onPhotosSelected:Yn}),(0,ve.jsxs)(S.aF,{isOpen:zn,onClose:()=>{Dn(null),Rn(new Set),Pn(60),An()},size:"6xl",scrollBehavior:"inside",children:[(0,ve.jsx)(A.m,{}),(0,ve.jsxs)(C.$,{maxH:"90vh",display:"flex",flexDirection:"column",children:[(0,ve.jsx)(E.r,{borderBottom:"1px solid",borderColor:(0,d.dU)("gray.200","gray.700"),children:"Vybrat z existuj\xedc\xedch alb"}),(0,ve.jsx)(T.s,{}),(0,ve.jsx)(D.c,{flex:"1",overflowY:"auto",py:6,px:6,children:(0,ve.jsxs)(w.T,{align:"stretch",spacing:4,children:[!Tn&&(0,ve.jsxs)(ve.Fragment,{children:[ln&&(0,ve.jsxs)(r.z,{spacing:2,justify:"center",py:8,children:[(0,ve.jsx)(_.y,{size:"lg",color:"purple.500"}),(0,ve.jsx)(p.E,{color:"gray.600",children:"Na\u010d\xedt\xe1m alba z galerie..."})]}),!ln&&rn.length>0&&(0,ve.jsx)(w.T,{align:"stretch",spacing:6,children:rn.map(e=>{var t;return(0,ve.jsxs)(u.a,{borderWidth:"1px",borderRadius:"md",p:4,bg:ma,cursor:"pointer",onClick:()=>{Dn(e),Rn(new Set),Pn(60)},transition:"all 0.2s",_hover:{transform:"scale(1.02)",boxShadow:"md"},children:[(0,ve.jsxs)(r.z,{justify:"space-between",mb:3,children:[(0,ve.jsxs)(w.T,{align:"start",spacing:0,children:[(0,ve.jsx)(p.E,{fontWeight:"bold",fontSize:"lg",children:e.title||"Album bez n\xe1zvu"}),(0,ve.jsxs)(p.E,{fontSize:"sm",color:"gray.500",children:[e.date," \u2022 ",(null===(t=e.photos)||void 0===t?void 0:t.length)||0," fotografi\xed"]})]}),(0,ve.jsx)(q.I,{as:G.HaR,color:"purple.500",boxSize:5})]}),(0,ve.jsx)(x.r,{columns:{base:6,md:10},spacing:2,children:(e.photos||[]).slice(0,20).map(e=>(0,ve.jsx)(B.g,{ratio:1,children:(0,ve.jsx)(K._,{src:e.image_1500,alt:e.id,objectFit:"cover",loading:"lazy",decoding:"async"})},e.id))})]},e.id)})}),!ln&&0===rn.length&&(0,ve.jsxs)(w.T,{py:8,spacing:3,children:[(0,ve.jsx)(q.I,{as:G.CKj,boxSize:12,color:"gray.400"}),(0,ve.jsx)(p.E,{color:"gray.600",textAlign:"center",children:"\u017d\xe1dn\xe1 alba nebyla nalezena v cache."}),(0,ve.jsx)(m.$,{size:"sm",onClick:Bn,leftIcon:(0,ve.jsx)(G.wO2,{}),children:"Obnovit seznam"})]})]}),Tn&&(0,ve.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,ve.jsxs)(r.z,{justify:"space-between",children:[(0,ve.jsx)(m.$,{size:"sm",variant:"ghost",onClick:()=>{Dn(null),Rn(new Set),Pn(60)},children:"\u2190 Zp\u011bt na seznam alb"}),(0,ve.jsxs)(J.S,{isChecked:!!Tn&&Nn.size===((null===(e=Tn.photos)||void 0===e?void 0:e.length)||0),isIndeterminate:!!Tn&&(Nn.size>0&&Nn.size<((null===(t=Tn.photos)||void 0===t?void 0:t.length)||0)),onChange:()=>{var e;Tn&&(Nn.size===((null===(e=Tn.photos)||void 0===e?void 0:e.length)||0)?Rn(new Set):Rn(new Set((Tn.photos||[]).map(e=>e.id))))},children:["Vybrat v\u0161e (",Nn.size,"/",Tn&&(null===(n=Tn.photos)||void 0===n?void 0:n.length)||0,")"]})]}),(0,ve.jsx)(x.r,{columns:{base:3,md:4,lg:5},spacing:3,children:((null===Tn||void 0===Tn?void 0:Tn.photos)||[]).slice(0,Fn).map(e=>{const t=Nn.has(e.id);return(0,ve.jsxs)(u.a,{position:"relative",cursor:"pointer",onClick:()=>{const t=new Set(Nn);t.has(e.id)?t.delete(e.id):t.add(e.id),Rn(t)},borderRadius:"md",overflow:"hidden",borderWidth:"2px",borderColor:t?"purple.500":"transparent",transition:"all 0.2s",_hover:{transform:"scale(1.05)"},children:[(0,ve.jsx)(K._,{src:e.image_1500,alt:e.id,w:"100%",h:"150px",objectFit:"cover",loading:"lazy",decoding:"async"}),(0,ve.jsx)(J.S,{position:"absolute",top:2,right:2,isChecked:t,pointerEvents:"none",bg:"white",borderRadius:"sm"})]},e.id)})}),((null===Tn||void 0===Tn||null===(ue=Tn.photos)||void 0===ue?void 0:ue.length)||0)>Fn&&(0,ve.jsx)(r.z,{justify:"center",pt:2,children:(0,ve.jsx)(m.$,{size:"sm",onClick:()=>Pn(e=>e+60),children:"Na\u010d\xedst dal\u0161\xed"})})]})]})}),(0,ve.jsx)($.j,{children:(0,ve.jsxs)(r.z,{spacing:3,children:[(0,ve.jsx)(m.$,{variant:"ghost",onClick:()=>{Dn(null),Rn(new Set),An()},children:"Zru\u0161it"}),(0,ve.jsxs)(m.$,{colorScheme:"purple",onClick:()=>{var e;if(!Tn||0===Nn.size)return;const t=(Tn.photos||[]).filter(e=>Nn.has(e.id));Yn(t,{id:Tn.id,title:Tn.title||"",url:"",date:Tn.date,photos_count:(null===(e=Tn.photos)||void 0===e?void 0:e.length)||0,photos:Tn.photos||[]}),Dn(null),Rn(new Set),An()},isDisabled:!Tn||0===Nn.size,children:["Vlo\u017eit vybran\xe9 (",Nn.size||0,")"]})]})})]})]}),(0,ve.jsxs)(S.aF,{isOpen:kn,onClose:wn,size:"6xl",children:[(0,ve.jsx)(A.m,{}),(0,ve.jsxs)(C.$,{maxH:"90vh",children:[(0,ve.jsx)(E.r,{children:"Vybrat video z YouTube kan\xe1lu"}),(0,ve.jsx)(T.s,{}),(0,ve.jsx)(D.c,{overflowY:"auto",children:(0,ve.jsxs)(w.T,{align:"stretch",spacing:4,children:[(0,ve.jsxs)(M.MJ,{children:[(0,ve.jsx)(L.l,{children:"Vyhledat video"}),(0,ve.jsxs)(U.M,{children:[(0,ve.jsx)(O.W,{pointerEvents:"none",children:(0,ve.jsx)(q.I,{as:G.CKj,color:"gray.400"})}),(0,ve.jsx)(g.p,{placeholder:"N\xe1zev videa nebo ID...",value:jn,onChange:e=>bn(e.target.value)})]})]}),gn&&(0,ve.jsxs)(r.z,{spacing:2,justify:"center",py:8,children:[(0,ve.jsx)(_.y,{size:"lg",color:"blue.500"}),(0,ve.jsx)(p.E,{color:"gray.600",children:"Na\u010d\xedt\xe1m videa z kan\xe1lu..."})]}),!gn&&Vn.length>0&&(0,ve.jsx)(x.r,{columns:{base:1,md:2,lg:3},spacing:4,children:Vn.map(e=>(0,ve.jsxs)(u.a,{borderWidth:"1px",borderRadius:"md",overflow:"hidden",cursor:"pointer",transition:"all 0.2s",_hover:{boxShadow:"lg",transform:"scale(1.02)"},onClick:()=>Hn(e),children:[(0,ve.jsx)(B.g,{ratio:16/9,children:(0,ve.jsx)(K._,{src:e.thumbnail_url,alt:e.title,objectFit:"cover"})}),(0,ve.jsxs)(u.a,{p:3,children:[(0,ve.jsx)(p.E,{fontWeight:"semibold",fontSize:"sm",noOfLines:2,children:e.title}),e.published_date&&(0,ve.jsx)(p.E,{fontSize:"xs",color:"gray.500",mt:1,children:new Date(e.published_date).toLocaleDateString("cs-CZ")})]})]},e.video_id))}),!gn&&0===Vn.length&&0===pn.length&&(0,ve.jsxs)(w.T,{py:8,spacing:3,children:[(0,ve.jsx)(q.I,{as:G.pVQ,boxSize:12,color:"gray.400"}),(0,ve.jsx)(p.E,{color:"gray.600",textAlign:"center",children:"\u017d\xe1dn\xe1 videa nebyla nalezena."}),(0,ve.jsx)(p.E,{fontSize:"sm",color:"gray.500",textAlign:"center",children:"Zkontrolujte nastaven\xed YouTube kan\xe1lu v administraci."}),(0,ve.jsx)(m.$,{size:"sm",onClick:Zn,leftIcon:(0,ve.jsx)(G.wO2,{}),children:"Obnovit seznam"})]}),!gn&&0===Vn.length&&pn.length>0&&(0,ve.jsxs)(w.T,{py:8,children:[(0,ve.jsx)(p.E,{color:"gray.600",children:"\u017d\xe1dn\xe1 videa neodpov\xeddaj\xed va\u0161emu hled\xe1n\xed."}),(0,ve.jsx)(m.$,{size:"sm",variant:"link",onClick:()=>bn(""),children:"Zobrazit v\u0161echna videa"})]})]})}),(0,ve.jsx)($.j,{children:(0,ve.jsx)(m.$,{variant:"ghost",onClick:wn,children:"Zav\u0159\xedt"})})]})]}),(0,ve.jsxs)(S.aF,{isOpen:nn,onClose:on,size:"6xl",scrollBehavior:"inside",children:[(0,ve.jsx)(A.m,{}),(0,ve.jsxs)(C.$,{maxH:"90vh",children:[(0,ve.jsx)(E.r,{children:"Vybrat fotku z galerie"}),(0,ve.jsx)(T.s,{}),(0,ve.jsx)(D.c,{overflowY:"auto",children:(0,ve.jsxs)(w.T,{align:"stretch",spacing:4,children:[ln&&(0,ve.jsxs)(r.z,{spacing:2,justify:"center",py:8,children:[(0,ve.jsx)(_.y,{size:"lg",color:"purple.500"}),(0,ve.jsx)(p.E,{color:"gray.600",children:"Na\u010d\xedt\xe1m alba z galerie..."})]}),!ln&&rn.length>0&&(0,ve.jsx)(w.T,{align:"stretch",spacing:6,children:rn.map(e=>{const t=dn===e.id,n=e.photos||[];return(0,ve.jsxs)(u.a,{borderWidth:"1px",borderRadius:"md",p:4,bg:ma,children:[(0,ve.jsxs)(r.z,{justify:"space-between",mb:3,children:[(0,ve.jsxs)(w.T,{align:"start",spacing:0,children:[(0,ve.jsx)(p.E,{fontWeight:"bold",fontSize:"lg",children:e.title||"Album bez n\xe1zvu"}),(0,ve.jsxs)(p.E,{fontSize:"sm",color:"gray.500",children:[e.date," \u2022 ",n.length," fotografi\xed"]})]}),(0,ve.jsxs)(r.z,{spacing:2,children:[n.length>0&&(0,ve.jsx)(m.$,{size:"sm",variant:"outline",onClick:()=>{t?un(null):(un(e.id),mn(48))},children:t?"Skr\xfdt fotky":"Zobrazit fotky"}),e.url&&(0,ve.jsx)(m.$,{as:"a",size:"sm",href:e.url,target:"_blank",rel:"noopener noreferrer",leftIcon:(0,ve.jsx)(G.HaR,{}),variant:"ghost",children:"Otev\u0159\xedt album"})]})]}),t&&n.length>0&&(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)(x.r,{columns:{base:3,md:4,lg:6},spacing:2,children:n.slice(0,hn).map(t=>(0,ve.jsx)(u.a,{borderWidth:"1px",borderRadius:"md",overflow:"hidden",cursor:"pointer",transition:"all 0.2s",_hover:{boxShadow:"lg",transform:"scale(1.05)"},onClick:()=>{Xn({id:t.id,album_id:e.id,album_url:e.url||"https://eu.zonerama.com/Album/".concat(e.id),page_url:t.page_url,image_url:t.image_1500,title:e.title}),on()},children:(0,ve.jsx)(B.g,{ratio:1,children:(0,ve.jsx)(K._,{src:t.image_1500,alt:t.id,objectFit:"cover",loading:"lazy",decoding:"async"})})},t.id))}),n.length>hn&&(0,ve.jsx)(r.z,{justify:"center",mt:2,children:(0,ve.jsx)(m.$,{size:"sm",onClick:()=>mn(e=>e+48),children:"Na\u010d\xedst dal\u0161\xed"})})]})]},e.id)})}),!ln&&0===rn.length&&(0,ve.jsxs)(w.T,{py:8,spacing:3,children:[(0,ve.jsx)(q.I,{as:G.CKj,boxSize:12,color:"gray.400"}),(0,ve.jsx)(p.E,{color:"gray.600",textAlign:"center",children:"\u017d\xe1dn\xe1 alba nebyla nalezena v cache."}),(0,ve.jsx)(p.E,{fontSize:"sm",color:"gray.500",textAlign:"center",children:"Zkontrolujte nastaven\xed Zonerama nebo obnovte cache."}),(0,ve.jsx)(m.$,{size:"sm",onClick:Bn,leftIcon:(0,ve.jsx)(G.wO2,{}),children:"Obnovit seznam"})]})]})}),(0,ve.jsx)($.j,{children:(0,ve.jsx)(m.$,{variant:"ghost",onClick:on,children:"Zav\u0159\xedt"})})]})]}),(0,ve.jsx)(_e.A,{isOpen:ta.isLoading,onClose:()=>{},title:"AI generuje \u010dl\xe1nek",message:"AI pracuje na rozvinut\xed va\u0161eho textu do plnohodnotn\xe9ho \u010dl\xe1nku...",progress:xt,estimatedTime:vt?25:void 0})]})})}},71860:(e,t,n)=>{n.d(t,{Ec:()=>d,L:()=>s,WG:()=>r,aK:()=>c,gf:()=>o,wR:()=>l});const a="auth_token",i="fotbal_club_has_admin",o=()=>{try{var e;return null!==(e=localStorage.getItem(a))&&void 0!==e?e:sessionStorage.getItem(a)}catch(t){return null}},r=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{localStorage.removeItem(a)}catch(n){}try{sessionStorage.removeItem(a)}catch(i){}if(t)try{localStorage.setItem(a,e)}catch(o){}else try{sessionStorage.setItem(a,e)}catch(r){}},s=()=>{try{localStorage.removeItem(a)}catch(e){}try{sessionStorage.removeItem(a)}catch(t){}},l=()=>!!o(),c=e=>{localStorage.setItem(i,String(e))},d=async()=>{try{const{API_URL:t}=await Promise.resolve().then(n.bind(n,46291)),a=await fetch("".concat(t,"/auth/admin/exists"),{headers:{Accept:"application/json"}});if(a.ok){var e;const t=await a.json(),n=Boolean(t&&(null!==(e=t.hasAdmin)&&void 0!==e?e:t.has_admin));return c(n),n}return!1}catch(t){return console.error("Error checking admin status:",t),!1}}},71942:(e,t,n)=>{n.d(t,{A:()=>k,I:()=>f});var a=n(89379),i=(n(65043),n(87139)),o=n(22107),r=n(44093),s=n(82459),l=n(73212),c=n(25011),d=n(99032),u=n(96148),h=n(10202),m=n(39081),p=n(74117),x=n(72526),g=n(85369),v=n(46291),j=n(70579);const b={cs:{weather:"Po\u010das\xed",forecast:"P\u0159edpov\u011b\u010f po\u010das\xed",temperature:"Teplota",feelsLike:"Pocitov\u011b",wind:"V\xedtr",humidity:"Vlhkost",visibility:"Viditelnost",pressure:"Tlak",precipitation:"Sr\xe1\u017eky",chanceOfRain:"\u0160ance na d\xe9\u0161\u0165",chanceOfSnow:"\u0160ance na sn\xedh",atMatchTime:"V \u010dase z\xe1pasu",weatherUnavailable:"P\u0159edpov\u011b\u010f po\u010das\xed nen\xed dostupn\xe1",forecastNotAvailable:"P\u0159edpov\u011b\u010f nen\xed dostupn\xe1 pro tento z\xe1pas",tooFarInFuture:"Z\xe1pas je p\u0159\xedli\u0161 daleko v budoucnosti",matchInPast:"Z\xe1pas ji\u017e prob\u011bhl",loading:"Na\u010d\xedt\xe1m po\u010das\xed..."},en:{weather:"Weather",forecast:"Weather Forecast",temperature:"Temperature",feelsLike:"Feels Like",wind:"Wind",humidity:"Humidity",visibility:"Visibility",pressure:"Pressure",precipitation:"Precipitation",chanceOfRain:"Rain Chance",chanceOfSnow:"Snow Chance",atMatchTime:"At Match Time",weatherUnavailable:"Weather forecast unavailable",forecastNotAvailable:"Forecast not available for this match",tooFarInFuture:"Match is too far in the future",matchInPast:"Match has already taken place",loading:"Loading weather..."}},y=(e,t)=>{const n=e.toLowerCase();return n.includes("sunny")||n.includes("clear")?t?g.wQq:g.V6H:n.includes("partly cloudy")||n.includes("partly sunny")?g.vZy:n.includes("cloudy")||n.includes("overcast")?g.tmj:n.includes("rain")||n.includes("drizzle")||n.includes("shower")?g.bk_:n.includes("snow")||n.includes("sleet")||n.includes("blizzard")?g.YhS:g.tmj},f=e=>{let{matchDateTime:t,venue:n,isHomeMatch:f,matchHasStarted:k,delayLoad:_=!1}=e;const{i18n:w}=(0,p.Bd)(),z=b[w.language]||b.cs,S=(0,r.dU)("white","gray.800"),A=(0,r.dU)("gray.200","gray.700"),C=(0,r.dU)("gray.600","gray.400");if(!f||k)return null;const{data:E,isLoading:T,error:D}=(0,x.I)({queryKey:["matchWeather",t,n],queryFn:async()=>{const e=new URLSearchParams((0,a.A)({match_datetime:t},n&&{location:n}));return(await v.Ay.get("/weather/match?".concat(e))).data},staleTime:18e5,enabled:f&&!k&&!_});if(T)return(0,j.jsx)(o.a,{bg:S,p:4,borderRadius:"lg",borderWidth:"1px",borderColor:A,mt:4,children:(0,j.jsxs)(h.T,{spacing:3,align:"stretch",children:[(0,j.jsx)(m.E,{fontSize:"sm",fontWeight:"bold",color:C,children:z.weather}),(0,j.jsx)(d.E,{height:"20px",width:"60%"}),(0,j.jsx)(d.E,{height:"16px",width:"40%"}),(0,j.jsx)(d.E,{height:"16px",width:"50%"})]})});if(D||!E){let e=z.weatherUnavailable;const t=String(D||"");return t.includes("too far in the future")?e=z.tooFarInFuture:t.includes("match is in the past")?e=z.matchInPast:t.includes("no location specified")&&(e=z.forecastNotAvailable),(0,j.jsx)(o.a,{bg:S,p:4,borderRadius:"lg",borderWidth:"1px",borderColor:A,mt:4,children:(0,j.jsxs)(h.T,{spacing:2,align:"center",children:[(0,j.jsx)(c.I,{as:g.BS8,boxSize:6,color:"orange.400"}),(0,j.jsx)(m.E,{fontSize:"sm",color:"gray.500",textAlign:"center",children:e})]})})}const{weather:N,closest_hour:R}=E,F=y(N.current.condition.text,N.current.is_day),P=y(R.condition.text,R.is_day);return(0,j.jsx)(o.a,{bg:S,p:4,borderRadius:"lg",borderWidth:"1px",borderColor:A,mt:4,children:(0,j.jsxs)(h.T,{spacing:4,align:"stretch",children:[(0,j.jsxs)(u.z,{spacing:2,align:"center",children:[(0,j.jsx)(c.I,{as:g.tmj,boxSize:4,color:"blue.500"}),(0,j.jsx)(m.E,{fontSize:"sm",fontWeight:"bold",children:z.forecast}),(0,j.jsx)(i.E,{fontSize:"xs",colorScheme:"blue",variant:"subtle",children:N.location.name})]}),(0,j.jsx)(s.c,{}),(0,j.jsxs)(u.z,{spacing:3,align:"center",children:[(0,j.jsx)(c.I,{as:F,boxSize:8,color:"blue.400"}),(0,j.jsxs)(h.T,{spacing:1,align:"start",flex:1,children:[(0,j.jsxs)(m.E,{fontSize:"lg",fontWeight:"bold",children:[Math.round(N.current.temp_c),"\xb0C"]}),(0,j.jsxs)(m.E,{fontSize:"xs",color:C,children:[z.feelsLike," ",Math.round(N.current.feelslike_c),"\xb0C"]})]}),(0,j.jsxs)(h.T,{spacing:1,align:"end",children:[(0,j.jsx)(m.E,{fontSize:"xs",color:C,children:N.current.condition.text}),(R.will_it_rain>0||R.chance_of_rain>0)&&(0,j.jsxs)(i.E,{size:"xs",colorScheme:"blue",children:[z.chanceOfRain,": ",R.chance_of_rain,"%"]}),(R.will_it_snow>0||R.chance_of_snow>0)&&(0,j.jsxs)(i.E,{size:"xs",colorScheme:"cyan",children:[z.chanceOfSnow,": ",R.chance_of_snow,"%"]})]})]}),(0,j.jsxs)(o.a,{children:[(0,j.jsx)(m.E,{fontSize:"xs",fontWeight:"bold",color:C,mb:2,children:z.atMatchTime}),(0,j.jsxs)(u.z,{spacing:3,align:"center",bg:(0,r.dU)("gray.50","gray.700"),p:3,borderRadius:"md",children:[(0,j.jsx)(c.I,{as:P,boxSize:6,color:"blue.400"}),(0,j.jsxs)(h.T,{spacing:1,align:"start",flex:1,children:[(0,j.jsxs)(m.E,{fontSize:"md",fontWeight:"bold",children:[Math.round(R.temp_c),"\xb0C"]}),(0,j.jsx)(m.E,{fontSize:"xs",color:C,children:R.condition.text})]}),(0,j.jsxs)(u.z,{spacing:4,fontSize:"xs",color:C,children:[(0,j.jsxs)(u.z,{spacing:1,children:[(0,j.jsx)(c.I,{as:g.YiW,boxSize:3}),(0,j.jsxs)(m.E,{children:[R.wind_kph," km/h"]})]}),(0,j.jsxs)(u.z,{spacing:1,children:[(0,j.jsx)(c.I,{as:g.DFS,boxSize:3}),(0,j.jsxs)(m.E,{children:[R.humidity,"%"]})]})]})]})]}),(0,j.jsxs)(l.r,{columns:2,spacing:2,fontSize:"xs",children:[(0,j.jsxs)(u.z,{spacing:2,children:[(0,j.jsx)(c.I,{as:g.YiW,boxSize:3,color:C}),(0,j.jsxs)(m.E,{color:C,children:[z.wind,": ",N.current.wind_kph," km/h ",(I=N.current.wind_degree,["S","SV","V","JV","J","JZ","Z","SZ"][Math.round(I/45)%8])]})]}),(0,j.jsxs)(u.z,{spacing:2,children:[(0,j.jsx)(c.I,{as:g.DFS,boxSize:3,color:C}),(0,j.jsxs)(m.E,{color:C,children:[z.humidity,": ",N.current.humidity,"%"]})]}),(0,j.jsxs)(u.z,{spacing:2,children:[(0,j.jsx)(c.I,{as:g.Ny1,boxSize:3,color:C}),(0,j.jsxs)(m.E,{color:C,children:[z.visibility,": ",N.current.vis_km," km"]})]}),(0,j.jsxs)(u.z,{spacing:2,children:[(0,j.jsx)(c.I,{as:g.R_2,boxSize:3,color:C}),(0,j.jsxs)(m.E,{color:C,children:[z.pressure,": ",N.current.pressure_mb," hPa"]})]})]})]})});var I},k=f},72898:(e,t,n)=>{n.d(t,{A:()=>K});var a=n(65043),i=n(22107),o=n(98662),r=n(44093),s=n(82459),l=n(73212),c=n(82846),d=n(15983),u=n(33192),h=n(91765),m=n(75780),p=n(96148),x=n(29904),g=n(10202),v=n(39081),j=n(14261),b=n(63856),y=n(98971),f=n(66981),k=n(92885),_=n(33695),w=n(38605),z=n(69023),S=n(47891),A=n(66465),C=n(65757),E=n(20563),T=n(24653),D=n(18943),N=n(76672),R=n(74912),F=n(1620),P=n(91208),I=n(6175),M=n(70579);function L(e){if(!e)return null;try{const t=(0,T.H)(e);if(!isNaN(t.getTime()))return t}catch(t){}return null}function W(e){return!e||isNaN(e.getTime())?"":(0,z.GP)(e,"yyyy-MM-dd")}const U=["Leden","\xdanor","B\u0159ezen","Duben","Kv\u011bten","\u010cerven","\u010cervenec","Srpen","Z\xe1\u0159\xed","\u0158\xedjen","Listopad","Prosinec"],O=(()=>{const e=(0,F.k)(new Date,{weekStartsOn:1});return Array.from({length:7}).map((t,n)=>(0,z.GP)((0,f.f)(e,n),"EEEEE",{locale:I.cs}))})(),q=(()=>{const e=new Date,t=W(e),n=t=>{const n=e;return{from:W((0,f.f)(n,1-t)),to:W(n)}};return[{key:"today",label:"Dnes",getRange:()=>({from:t,to:t})},{key:"last7",label:"Posledn\xedch 7 dn\xed",getRange:()=>n(7)},{key:"last30",label:"Posledn\xedch 30 dn\xed",getRange:()=>n(30)},{key:"thisWeek",label:"Tento t\xfdden",getRange:()=>(()=>{const t=(0,F.k)(e,{weekStartsOn:1}),n=(0,w.$)(e,{weekStartsOn:1});return{from:W(t),to:W(n)}})()},{key:"next30",label:"Nadch\xe1zej\xedc\xedch 30 dn\xed",getRange:()=>(()=>{const t=e,n=(0,f.f)(t,30);return{from:W(t),to:W(n)}})()},{key:"thisMonth",label:"Tento m\u011bs\xedc",getRange:()=>(()=>{const t=(0,R.w)(e),n=(0,_.p)(e);return{from:W(t),to:W(n)}})()},{key:"last3months",label:"Posledn\xed 3 m\u011bs\xedce",getRange:()=>(()=>{const t=e;return{from:W((0,k.P)((0,R.w)(t),-2)),to:W(t)}})()},{key:"last12months",label:"Posledn\xedch 12 m\u011bs\xedc\u016f",getRange:()=>(()=>{const t=e;return{from:W((0,k.P)((0,R.w)(t),-11)),to:W(t)}})()},{key:"thisYear",label:"Tento rok",getRange:()=>(()=>{const t=e.getFullYear(),n=new Date(t,0,1),a=new Date(t,11,31);return{from:W(n),to:W(a)}})()}]})(),K=e=>{let{from:t,to:n,onChange:T,size:K="sm"}=e;const[B,Z]=(0,a.useState)(()=>L(t)||L(n)||new Date),[V,H]=(0,a.useState)(()=>L(t)),[$,J]=(0,a.useState)(()=>L(n)),[G,X]=(0,a.useState)(null),[Y,Q]=(0,a.useState)("calendar"),[ee,te]=(0,a.useState)(()=>(L(t)||L(n)||new Date).getFullYear()-6),ne=(0,r.dU)("white","gray.800"),ae=(0,r.dU)("gray.50","gray.900"),ie=(0,r.dU)("blue.50","blue.900"),oe=(0,r.dU)("blue.700","blue.100"),re=(0,r.dU)("gray.200","gray.700"),se=(0,r.dU)("blue.500","blue.400"),le=(0,r.dU)("blue.50","blue.900"),ce=(0,r.dU)("white","gray.900"),de=(0,r.dU)("gray.400","gray.500"),ue=(0,r.dU)("white","gray.800"),he=(0,r.dU)("gray.50","gray.700"),me=(0,r.dU)("gray.300","gray.600");(0,a.useEffect)(()=>{const e=L(t),a=L(n);H(e),J(a);const i=e||a||new Date;Z(i),te(i.getFullYear()-6)},[t,n]);const pe=(0,a.useMemo)(()=>{const e=L(t),a=L(n);return e&&a?"".concat((0,z.GP)(e,"d.M.yyyy",{locale:I.cs})," \u2013 ").concat((0,z.GP)(a,"d.M.yyyy",{locale:I.cs})):e?"Od ".concat((0,z.GP)(e,"d.M.yyyy",{locale:I.cs})):a?"Do ".concat((0,z.GP)(a,"d.M.yyyy",{locale:I.cs})):"Libovoln\xe9 obdob\xed"},[t,n]),xe=e=>{if(!V||V&&$)return H(e),void J(null);V&&!$&&(e<V?(J(V),H(e)):(e.getTime(),V.getTime(),J(e)))},ge=(0,a.useMemo)(()=>V||$?V&&$?V<=$?{start:V,end:$}:{start:$,end:V}:V&&G?V<=G?{start:V,end:G}:{start:G,end:V}:null:null,[V,$,G]),ve=(0,R.w)(B),je=(0,_.p)(B),be=(0,F.k)(ve,{weekStartsOn:1}),ye=(0,w.$)(je,{weekStartsOn:1}),fe=[];for(let a=be;a<=ye;a=(0,f.f)(a,1))fe.push(a);const ke=[];for(let a=0;a<fe.length;a+=7)ke.push(fe.slice(a,a+7));const _e=(0,a.useMemo)(()=>Array.from({length:12}).map((e,t)=>ee+t),[ee]),we=V||$||B,ze=we.getFullYear(),Se=we.getMonth(),Ae=(0,S.P)(new Date(ze,Se,1)),Ce=(0,z.GP)(we,"d.",{locale:I.cs}),Ee=()=>{H(null),J(null),X(null)},Te=B.getFullYear(),De=U[B.getMonth()];return(0,M.jsxs)(c.A,{placement:"bottom-start",onOpen:()=>{const e=L(t),a=L(n);H(e),J(a);const i=e||a||new Date;Z(i),te(i.getFullYear()-6),Q("calendar")},children:[(0,M.jsx)(m.W,{children:(0,M.jsx)(o.$,{size:K,variant:"outline",leftIcon:(0,M.jsx)(y.C,{}),borderRadius:"full",px:5,py:3,minW:{base:"220px",md:"260px",lg:"300px"},bg:ue,borderColor:me,boxShadow:"sm",_hover:{bg:he,boxShadow:"md"},overflow:"hidden",children:(0,M.jsxs)(p.z,{spacing:3,align:"center",w:"100%",justify:"space-between",children:[(0,M.jsx)(v.E,{fontSize:"sm",color:"gray.600",flexShrink:0,children:"Obdob\xed:"}),(0,M.jsx)(v.E,{fontSize:"sm",fontWeight:"medium",flex:"1",minW:0,textAlign:"right",isTruncated:!0,noOfLines:1,children:pe})]})})}),(0,M.jsxs)(h.h,{w:{base:"100%",sm:"360px",md:"520px"},maxW:"520px",borderRadius:"xl",boxShadow:"xl",bg:ne,borderColor:re,children:[(0,M.jsx)(d.R,{}),(0,M.jsx)(u.e,{p:0,children:(0,M.jsxs)(x.B,{direction:{base:"column",md:"row"},spacing:0,divider:(0,M.jsx)(s.c,{orientation:"vertical",display:{base:"none",md:"block"}}),children:[(0,M.jsx)(i.a,{w:{base:"100%",md:"200px"},borderBottomWidth:{base:"1px",md:0},bg:ae,p:4,children:(0,M.jsxs)(g.T,{align:"stretch",spacing:2,children:[q.map(e=>(0,M.jsx)(o.$,{size:"sm",justifyContent:"flex-start",variant:"ghost",borderRadius:"md",px:3,py:2,fontSize:"sm",_hover:{bg:ie,color:oe},onClick:()=>{const t=e.getRange();H(L(t.from)),J(L(t.to))},children:e.label},e.key)),(0,M.jsx)(o.$,{size:"sm",variant:"ghost",borderRadius:"md",px:3,py:2,fontSize:"sm",onClick:Ee,children:"Vymazat"})]})}),(0,M.jsx)(i.a,{flex:"1",p:4,children:(0,M.jsxs)(g.T,{align:"stretch",spacing:4,children:[(0,M.jsxs)(p.z,{justify:"space-between",align:"center",children:[(0,M.jsxs)(p.z,{spacing:2,children:[(0,M.jsx)(o.$,{size:"xs",borderRadius:"full",variant:"year"===Y?"solid":"outline",colorScheme:"year"===Y?"blue":void 0,onClick:()=>Q("year"),children:Te}),(0,M.jsx)(o.$,{size:"xs",borderRadius:"full",variant:"month"===Y?"solid":"outline",colorScheme:"month"===Y?"blue":void 0,onClick:()=>Q("month"),children:De}),(0,M.jsx)(o.$,{size:"xs",borderRadius:"full",variant:"day"===Y?"solid":"outline",colorScheme:"day"===Y?"blue":void 0,onClick:()=>Q("day"),children:Ce})]}),(0,M.jsxs)(p.z,{spacing:1,children:[(0,M.jsx)(o.$,{size:"xs",variant:"ghost",onClick:()=>Z(e=>(0,P.a)(e,1)),children:(0,M.jsx)(j.Y,{})}),(0,M.jsx)(o.$,{size:"xs",variant:"ghost",onClick:()=>Z(e=>(0,k.P)(e,1)),children:(0,M.jsx)(b.v,{})})]})]}),"calendar"===Y&&(0,M.jsxs)(g.T,{align:"stretch",spacing:4,children:[(0,M.jsx)(l.r,{columns:7,spacing:2,fontSize:"sm",textTransform:"uppercase",color:de,children:O.map(e=>(0,M.jsx)(i.a,{textAlign:"center",children:e},e))}),(0,M.jsx)(g.T,{spacing:2,align:"stretch",children:ke.map((e,t)=>(0,M.jsx)(p.z,{spacing:2,children:e.map(e=>{const t=!(0,C.t)(e,ve),n=V&&(0,A.r)(e,V),a=$&&(0,A.r)(e,$);let i,r,s=!1,l=!1;!!ge&&(0,E.v)(e,ge)&&(i=le),(n||a)&&(i=se,r=ce,s=!0,l=!0);const c=t?de:void 0;return(0,M.jsx)(o.$,{size:K,variant:i?"solid":"ghost",flex:"1",borderRadius:i&&s&&l?"full":"md",bg:i,color:r||c,_hover:{bg:i||le},onClick:()=>xe(e),onMouseEnter:()=>X(e),onMouseLeave:()=>X(null),w:"100%",h:"2.5rem",px:0,children:(0,z.GP)(e,"d")},e.toISOString())})},t))})]}),"year"===Y&&(0,M.jsxs)(g.T,{align:"stretch",spacing:3,children:[(0,M.jsxs)(p.z,{justify:"space-between",children:[(0,M.jsx)(o.$,{size:"xs",variant:"ghost",leftIcon:(0,M.jsx)(j.Y,{}),onClick:()=>te(e=>e-12),children:"Star\u0161\xed"}),(0,M.jsxs)(v.E,{fontSize:"sm",fontWeight:"semibold",children:[_e[0]," \u2013 ",_e[_e.length-1]]}),(0,M.jsx)(o.$,{size:"xs",variant:"ghost",rightIcon:(0,M.jsx)(b.v,{}),onClick:()=>te(e=>e+12),children:"Nov\u011bj\u0161\xed"})]}),(0,M.jsx)(l.r,{columns:3,spacing:2,children:_e.map(e=>(0,M.jsx)(o.$,{size:K,variant:e===ze?"solid":"ghost",colorScheme:e===ze?"blue":void 0,onClick:()=>{const t=(0,N.i)(B,e);Z(t),Q("month")},children:e},e))})]}),"month"===Y&&(0,M.jsx)(l.r,{columns:3,spacing:2,children:U.map((e,t)=>(0,M.jsx)(o.$,{size:K,variant:t===Se?"solid":"ghost",colorScheme:t===Se?"blue":void 0,onClick:()=>{const e=(0,D.Z)(B,t);Z((0,R.w)(e)),Q("calendar")},children:"".concat(t+1,". ").concat(e)},e))}),"day"===Y&&(0,M.jsx)(l.r,{columns:7,spacing:2,children:Array.from({length:Ae}).map((e,t)=>{const n=t+1,a=new Date(ze,Se,n),i=V&&(0,A.r)(a,V),r=$&&(0,A.r)(a,$);let s,l;return!!ge&&(0,E.v)(a,ge)&&(s=le),(i||r)&&(s=se,l=ce),(0,M.jsx)(o.$,{size:K,variant:s?"solid":"ghost",bg:s,color:l,_hover:{bg:s||le},onClick:()=>xe(a),borderRadius:"full",w:"100%",h:"2.5rem",px:0,children:n},n)})}),"calendar"!==Y&&(0,M.jsx)(o.$,{size:"xs",alignSelf:"flex-start",variant:"link",onClick:()=>Q("calendar"),children:"Zp\u011bt na kalend\xe1\u0159"}),(0,M.jsxs)(p.z,{justify:"space-between",pt:2,children:[(0,M.jsxs)(v.E,{fontSize:"xs",color:"gray.500",children:["Rozsah:"," ",V&&$?"".concat((0,z.GP)(V,"d.M.yyyy",{locale:I.cs})," \u2013 ").concat((0,z.GP)($,"d.M.yyyy",{locale:I.cs})):V?"Od ".concat((0,z.GP)(V,"d.M.yyyy",{locale:I.cs})):$?"Do ".concat((0,z.GP)($,"d.M.yyyy",{locale:I.cs})):"nenastaveno"]}),(0,M.jsxs)(p.z,{spacing:2,children:[(0,M.jsx)(o.$,{size:"sm",variant:"ghost",onClick:Ee,children:"Zru\u0161it"}),(0,M.jsx)(o.$,{size:"sm",colorScheme:"blue",onClick:()=>{const e=W(V||null),t=W($||V||null);T(e,t)},isDisabled:!V&&!$,children:"Pou\u017e\xedt"})]})]})]})})]})})]})]})}},73062:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});n(65043);var a=n(44093),i=n(22107),o=n(68659),r=n(76659),s=n(72526),l=n(48549),c=n(70579);function d(e){if(!e)return"---";const t=String(e).trim().toUpperCase();if(!t)return"---";const n={"\xc1":"A","\xc4":"A","\xc5":"A","\xc2":"A","\xc0":"A","\u010c":"C","\u0106":"C","\xc7":"C","\u010e":"D","\xc9":"E","\u011a":"E","\xc8":"E","\xcb":"E","\xca":"E","\xcd":"I","\xcc":"I","\xcf":"I","\xce":"I","\u0147":"N","\u0143":"N","\xd3":"O","\xd6":"O","\xd4":"O","\xd2":"O","\u0158":"R","\u0160":"S","\u015a":"S","\u0164":"T","\xda":"U","\u016e":"U","\xd9":"U","\xdc":"U","\xdb":"U","\xdd":"Y","\u017d":"Z"};let a="";for(const i of t){const e=n[i]||i;if(e>="A"&&e<="Z"&&(a+=e,3===a.length))break}for(;a.length<3;)a+="-";return a}function u(e,t){try{const n=e.replace("#",""),a=parseInt(3===n.length?n.split("").map(e=>e+e).join(""):n,16);let i=a>>16&255,o=a>>8&255,r=255&a;return i=Math.min(255,Math.max(0,Math.round(i+t/100*255))),o=Math.min(255,Math.max(0,Math.round(o+t/100*255))),r=Math.min(255,Math.max(0,Math.round(r+t/100*255))),"#".concat([i,o,r].map(e=>e.toString(16).padStart(2,"0")).join(""))}catch(n){return e}}const h="\n.pill-wrapper { width: max-content; margin: 24px auto; display: flex; flex-direction: column; align-items: center; gap: 18px; }\n.scoreboard { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.75); color: #ffffff; padding: 18px 28px; font-size: 32px; font-weight: 700; border-radius: 14px; width: min(90vw, 900px); margin: 24px auto; gap: 20px; box-shadow: 0 8px 24px rgba(0,0,0,0.35); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.15); }\n.scoreboard.pill { background: var(--pill-bg, #f8fafc); color: var(--pill-text, #0f172a); border: 1px solid #e5e7eb; box-shadow: 0 10px 30px rgba(2,6,23,0.18); border-radius: 999px; padding: 4px 6px; width: max-content; margin: 0 auto; gap: 6px; backdrop-filter: none; font-size: 15px; transform: scale(var(--pill-scale, 1.7)); transform-origin: center; will-change: transform; }\n.scoreboard.pill .seg { display: flex; align-items: center; justify-content: center; height: 36px; }\n.scoreboard.pill .seg.timer { font-variant-numeric: tabular-nums; font-weight: 800; background: linear-gradient(180deg, #eef2f7 0%, #e2e8f0 100%); padding: 0 12px 0 8px; border-radius: 999px; font-size: 15px; color: #0f172a; }\n.scoreboard.pill .seg.team { padding: 0 10px; border-radius: 10px; font-weight: 800; letter-spacing: 0.5px; min-width: 46px; text-transform: uppercase; position: relative; overflow: visible; }\n.scoreboard.pill .seg.team.home { background: linear-gradient(90deg, var(--home-dark), var(--home-light)); color: var(--home-text, #ffffff); }\n.scoreboard.pill .seg.team.away { background: linear-gradient(90deg, var(--away-dark), var(--away-light)); color: var(--away-text, #ffffff); }\n.scoreboard.pill .seg.score { background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%); border: 1px solid #e5e7eb; border-radius: 10px; padding: 0 10px; font-weight: 800; color: #0f172a; min-width: 58px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.9); font-size: 15px; }\n.scoreboard.pill .divider { width: 2px; height: 14px; background: rgba(15,23,42,0.35); border-radius: 1px; align-self: center; }\n.scoreboard.pill .team .logo { width: 24px; height: 24px; object-fit: contain; margin-right: 6px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2)); }\n.scoreboard.pill .team.away .logo { margin-left: 6px; margin-right: 0; }\n.fouls-bar { display: flex; align-items: center; justify-content: space-between; gap: 32px; width: 100%; padding: 18px 18px 0; transform: scale(var(--pill-scale, 1.7)); transform-origin: center; }\n.fouls-group { display: flex; gap: 6px; }\n.foul-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.9); background: rgba(255,255,255,0.15); box-shadow: 0 1px 2px rgba(0,0,0,0.25); }\n.foul-dot.active { background: #ff1f1f; border-color: #ff1f1f; }\n@media (max-width: 640px) {\n .pill-wrapper { margin: 24px auto 16px; gap: 14px; }\n .scoreboard.pill { padding: 6px 8px; transform: scale(1.0); transform-origin: center; }\n .pill .seg.timer, .pill .seg.score { padding: 4px 10px; }\n .fouls-bar { gap: 20px; padding: 12px 12px 0; transform: scale(1.0); }\n}\n",m=e=>{let{state:t}=e;t.theme;const n=!!t.sidesFlipped,a={short:(n?t.awayShort:t.homeShort)||d(n?t.awayName:t.homeName),logo:n?t.awayLogo:t.homeLogo,color:(n?t.secondaryColor:t.primaryColor)||"#1e3a8a",score:n?t.awayScore:t.homeScore,fouls:Math.max(0,Math.min(5,n?t.awayFouls||0:t.homeFouls||0))},i={short:(n?t.homeShort:t.awayShort)||d(n?t.homeName:t.awayName),logo:n?t.homeLogo:t.awayLogo,color:(n?t.primaryColor:t.secondaryColor)||"#2563eb",score:n?t.homeScore:t.awayScore,fouls:Math.max(0,Math.min(5,n?t.homeFouls||0:t.awayFouls||0))},o=t.timer||"00:00",r={"--home-dark":a.color,"--home-light":u(a.color,20),"--away-dark":i.color,"--away-light":u(i.color,20),"--home-text":t.homeTextColor||"#ffffff","--away-text":t.awayTextColor||"#ffffff"};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("style",{children:h}),(0,c.jsxs)("div",{className:"pill-wrapper",style:r,children:[(0,c.jsxs)("div",{className:"scoreboard pill",children:[(0,c.jsx)("div",{className:"seg timer",children:(0,c.jsx)("span",{children:o})}),(0,c.jsxs)("div",{className:"seg team home",children:[(0,c.jsx)("img",{className:"logo",alt:"",src:a.logo||""}),(0,c.jsx)("span",{children:a.short})]}),(0,c.jsx)("span",{className:"divider","aria-hidden":"true"}),(0,c.jsx)("div",{className:"seg score",children:(0,c.jsxs)("span",{children:[a.score,"-",i.score]})}),(0,c.jsx)("span",{className:"divider","aria-hidden":"true"}),(0,c.jsxs)("div",{className:"seg team away",children:[(0,c.jsx)("span",{children:i.short}),(0,c.jsx)("img",{className:"logo",alt:"",src:i.logo||""})]})]}),(0,c.jsxs)("div",{className:"fouls-bar",children:[(0,c.jsx)("div",{className:"fouls-group",children:Array.from({length:5}).map((e,t)=>(0,c.jsx)("span",{className:"foul-dot".concat(t<a.fouls?" active":"")},t))}),(0,c.jsx)("div",{className:"fouls-group",children:Array.from({length:5}).map((e,t)=>(0,c.jsx)("span",{className:"foul-dot".concat(t<i.fouls?" active":"")},t))})]})]})]})};var p=n(20724);const x=()=>{const e=(0,a.dU)("transparent","transparent"),{data:t,isLoading:n}=(0,s.I)({queryKey:["public-scoreboard"],queryFn:l.y,refetchInterval:1e3,staleTime:3e3});return(0,c.jsx)(i.a,{minH:"100vh",bg:e,display:"flex",alignItems:"center",justifyContent:"center",p:4,children:n||!t?(0,c.jsx)(o.o,{children:(0,c.jsx)(r.y,{})}):"pill"===t.theme?(0,c.jsx)(m,{state:t}):(0,c.jsx)(p.A,{state:t})})}},73278:(e,t,n)=>{n.r(t),n.d(t,{default:()=>I});var a=n(65043),i=n(40378),o=n(96870),r=n(32077),s=n(87139),l=n(22107),c=n(98662),d=n(44093),u=n(98939),h=n(73212),m=n(25011),p=n(7189),x=n(67516),g=n(35929),v=n(11054),j=n(78460),b=n(85421),y=n(76659),f=n(96148),k=n(10202),_=n(28846),w=n(39081),z=n(78801),S=n(57550),A=n(24346),C=n(85369),E=n(81398),T=n(61269),D=n(49367),N=n(74117),R=n(70579);const F=e=>{try{if(e.includes("youtube.com")||e.includes("youtu.be")){const t=new URL(e);if(t.hostname.includes("youtu.be")){const e=t.pathname.replace("/","");return"https://www.youtube.com/embed/".concat(e)}const n=t.searchParams.get("v");if(n)return"https://www.youtube.com/embed/".concat(n)}}catch(t){}return"https://www.youtube.com/embed/".concat(e)},P=e=>{var t;if(null!==e&&void 0!==e&&e.includes("/embed/"))return null===(t=e.split("/embed/")[1])||void 0===t?void 0:t.split("?")[0]},I=()=>{const{t:e}=(0,N.Bd)(),t=(0,d.dU)("white","gray.800"),n=(0,d.dU)("gray.200","gray.600"),I=(0,d.dU)("gray.800","gray.100"),M=(0,d.dU)("gray.600","gray.300"),L=(0,d.dU)("gray.500","gray.400"),W=(0,d.dU)("white","gray.800"),U=(0,d.dU)("gray.100","gray.700"),O=(0,d.dU)("gray.400","gray.500"),q=(0,d.dU)("brand.primary","brand.accent"),K=(0,z.N)(),{data:B,isLoading:Z}=(0,S.s)(),[V,H]=(0,a.useState)([]),[$,J]=(0,a.useState)(!0),{isOpen:G,onOpen:X,onClose:Y}=(0,o.j)(),[Q,ee]=(0,a.useState)(null),te=(null===B||void 0===B||B.videos_source,(null===B||void 0===B?void 0:B.youtube_url)||(null===B||void 0===B?void 0:B.social_youtube)||null),ne=(null===B||void 0===B?void 0:B.videos_title_overrides)||{};(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await(0,A.S)();if(!t)return void J(!1);const n=(t.videos||[]).slice().sort((e,t)=>(Date.parse(t.published_date||"")||0)-(Date.parse(e.published_date||"")||0));e||H(n)}catch(t){console.error("Failed to load videos:",t)}finally{e||J(!1)}})(),()=>{e=!0}},[]);const ae=(0,a.useMemo)(()=>{const e=(()=>{const e=((null===B||void 0===B?void 0:B.videos_items)||[]).map((e,t)=>{const n=F(e.url);return{key:"".concat(t,"-").concat(e.url),title:e.title||"Video ".concat(t+1),embedUrl:n,thumbnail:e.thumbnail_url,date:e.uploaded_at,videoId:P(n)}}),t=((null===B||void 0===B?void 0:B.videos)||[]).map((e,t)=>{const n=F(e);return{key:"".concat(t,"-").concat(e),title:"Video ".concat(t+1),embedUrl:n,videoId:P(n)}});return e.length?e:t})(),t=(V||[]).map(e=>{var t;return{key:e.video_id,title:(null===ne||void 0===ne||null===(t=ne[e.video_id])||void 0===t?void 0:t.trim())||e.title,embedUrl:F(e.video_id),thumbnail:e.thumbnail_url,date:e.published_date,videoId:e.video_id}}),n=[],a=new Set,i=e=>{const t=e.videoId||e.embedUrl||e.key;t&&(a.has(t)||(a.add(t),n.push(e)))};e.forEach(i),t.forEach(i);return n.slice().sort((e,t)=>{const n=Date.parse(e.date||"")||0;return(Date.parse(t.date||"")||0)-n})},[V,null===B||void 0===B?void 0:B.videos_items,null===B||void 0===B?void 0:B.videos,ne]),ie=a=>{let{item:i}=a;const o=i.thumbnail||(i.videoId?"https://i.ytimg.com/vi/".concat(i.videoId,"/hqdefault.jpg"):void 0);return(0,R.jsxs)(l.a,{bg:t,borderRadius:"xl",overflow:"hidden",boxShadow:"sm",borderWidth:"2px",borderColor:n,transition:"all 0.3s",_hover:{transform:"translateY(-8px)",boxShadow:"0 20px 40px rgba(0,0,0,0.15)",borderColor:"brand.primary"},children:[(0,R.jsx)(r.g,{ratio:16/9,children:(0,R.jsxs)(l.a,{position:"relative",cursor:"pointer",onClick:()=>(e=>{ee(e),X()})(i),children:[o?(0,R.jsx)(l.a,{as:"img",src:o,alt:i.title,width:"100%",height:"100%",loading:"lazy",decoding:"async",referrerPolicy:"origin-when-cross-origin",style:{objectFit:"cover"},"data-fallback-idx":0,onError:e=>{try{const t=e.currentTarget,n=Number(t.dataset.fallbackIdx||"0"),a=i.videoId||"",o=a?["https://i.ytimg.com/vi/".concat(a,"/mqdefault.jpg"),"https://i.ytimg.com/vi/".concat(a,"/sddefault.jpg"),"https://i.ytimg.com/vi/".concat(a,"/hqdefault.jpg"),"/dist/img/logo-club-empty.svg"]:["/dist/img/logo-club-empty.svg"];n<o.length&&(t.src=o[n],t.dataset.fallbackIdx=String(n+1))}catch(t){}}}):(0,R.jsx)(l.a,{bg:U,display:"flex",alignItems:"center",justifyContent:"center",children:(0,R.jsx)(m.I,{as:C.gSK,boxSize:12,color:O})}),(0,R.jsx)(l.a,{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",bg:"blackAlpha.600",opacity:0,_hover:{opacity:1},transition:"opacity 0.3s",children:(0,R.jsxs)(l.a,{bg:"brand.primary",color:"white",borderRadius:"full",px:8,py:4,fontWeight:"bold",display:"flex",alignItems:"center",gap:2,transform:"scale(1)",_hover:{transform:"scale(1.1)"},transition:"transform 0.2s",boxShadow:"0 8px 24px rgba(0,0,0,0.3)",children:[(0,R.jsx)(m.I,{as:C.gSK,boxSize:5}),(0,R.jsx)(w.E,{fontSize:"lg",children:e("videos.play")})]})})]})}),(0,R.jsx)(l.a,{p:4,borderTopWidth:"2px",borderTopColor:q,children:(0,R.jsxs)(k.T,{align:"start",spacing:2,children:[(0,R.jsx)(w.E,{fontWeight:"bold",fontSize:"md",color:q,noOfLines:2,children:i.title}),(0,R.jsxs)(f.z,{justify:"space-between",width:"100%",children:[i.date&&(0,R.jsx)(s.E,{colorScheme:"gray",fontSize:"0.7rem",children:new Date(i.date).toLocaleDateString("cs-CZ")}),i.videoId&&(0,R.jsx)(p.N,{href:"https://www.youtube.com/watch?v=".concat(i.videoId),isExternal:!0,onClick:e=>e.stopPropagation(),children:(0,R.jsx)(c.$,{size:"xs",variant:"ghost",colorScheme:"red",leftIcon:(0,R.jsx)(m.I,{as:C.Vk6}),children:"YouTube"})})]})]})})]})};return Z||$?(0,R.jsx)(i.A,{children:(0,R.jsx)(u.m,{maxW:"7xl",py:{base:6,md:10},children:(0,R.jsxs)(k.T,{spacing:4,children:[(0,R.jsx)(y.y,{size:"xl",color:K.accent}),(0,R.jsx)(w.E,{color:M,children:e("videos.loading")})]})})}):(0,R.jsxs)(i.A,{children:[(0,R.jsxs)(D.mg,{children:[(0,R.jsx)("title",{children:e("videos.title")}),(0,R.jsx)("meta",{name:"description",content:e("videos.description")})]}),(0,R.jsxs)(u.m,{maxW:"7xl",py:{base:6,md:10},children:[(0,R.jsxs)(l.a,{mb:6,children:[(0,R.jsxs)(f.z,{justify:"space-between",mb:2,flexWrap:"wrap",children:[(0,R.jsx)(_.D,{as:"h1",size:"xl",color:I,children:e("videos.title")}),te&&(0,R.jsx)(p.N,{href:te,isExternal:!0,children:(0,R.jsx)(c.$,{size:"sm",variant:"outline",colorScheme:"red",rightIcon:(0,R.jsx)(m.I,{as:C.EQc}),children:e("videos.youtube_channel")})})]}),(0,R.jsxs)(k.T,{align:"start",spacing:1,children:[(0,R.jsx)(w.E,{color:M,children:e("videos.watch_latest")}),(0,R.jsxs)(f.z,{spacing:1,color:L,fontSize:"sm",children:[(0,R.jsx)(m.I,{as:C.Vk6,color:"red.500"}),(0,R.jsx)(w.E,{children:e("videos.all_from_youtube")})]})]})]}),0===ae.length?(0,R.jsxs)(l.a,{textAlign:"center",py:12,children:[(0,R.jsx)(m.I,{as:C.gSK,boxSize:16,color:O,mb:4}),(0,R.jsx)(w.E,{color:M,fontSize:"lg",children:e("videos.no_videos")})]}):(0,R.jsx)(h.r,{columns:{base:1,md:2,lg:3},spacing:6,children:ae.map(e=>(0,R.jsx)(ie,{item:e},e.key))})]}),(0,R.jsxs)(j.aF,{isOpen:G,onClose:Y,size:"6xl",isCentered:!0,children:[(0,R.jsx)(v.m,{bg:"blackAlpha.800"}),(0,R.jsxs)(b.$,{bg:"transparent",boxShadow:"none",maxW:"90vw",children:[(0,R.jsx)(g.s,{color:"white",bg:"blackAlpha.600",_hover:{bg:"blackAlpha.800"},size:"lg",top:2,right:2,zIndex:2}),(0,R.jsx)(x.c,{p:0,children:Q&&(0,R.jsxs)(l.a,{children:[(0,R.jsx)(r.g,{ratio:16/9,maxH:"80vh",children:(0,R.jsx)("iframe",{src:"".concat(Q.embedUrl,"?autoplay=1&vq=hd1080&rel=0&modestbranding=1&playsinline=1"),title:Q.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,loading:"lazy",referrerPolicy:"strict-origin-when-cross-origin",style:{borderRadius:"8px"}})}),(0,R.jsxs)(l.a,{bg:W,p:4,borderRadius:"md",mt:2,children:[(0,R.jsxs)(f.z,{justify:"space-between",align:"start",children:[(0,R.jsxs)(k.T,{align:"start",flex:1,children:[(0,R.jsx)(w.E,{fontWeight:"bold",fontSize:"lg",children:Q.title}),Q.date&&(0,R.jsx)(w.E,{color:M,fontSize:"sm",children:new Date(Q.date).toLocaleDateString("cs-CZ",{year:"numeric",month:"long",day:"numeric"})})]}),Q.videoId&&(0,R.jsx)(p.N,{href:"https://www.youtube.com/watch?v=".concat(Q.videoId),isExternal:!0,children:(0,R.jsx)(c.$,{size:"sm",colorScheme:"red",leftIcon:(0,R.jsx)(m.I,{as:C.Vk6}),children:e("videos.open_on_youtube")})})]}),Q.videoId&&(0,R.jsx)(l.a,{mt:4,children:(0,R.jsx)(T.A,{targetType:"youtube_video",targetId:Q.videoId})})]})]})})]})]}),(0,R.jsx)(E.A,{})]})}},73449:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(65043),i=n(22107),o=n(98939),r=n(57550);n(74117),n(25189);n(29066);const s={primaryColor:"#1e3a8a",secondaryColor:"#0ea5a4",textColor:"#0f172a",backgroundColor:"#ffffff",accentColor:"#2563eb",isDarkMode:!1,colors:{primary:"#1e3a8a",secondary:"#0ea5a4",text:"#0f172a",background:"#ffffff",accent:"#2563eb"}},l=()=>{const{data:e}=(0,r.s)();return(0,a.useMemo)(()=>{if(!e)return s;const t=e.primary_color||s.primaryColor,n=e.secondary_color||s.secondaryColor,a=e.text_color||s.textColor,i=e.background_color||s.backgroundColor,o=e.accent_color||s.accentColor;return{primaryColor:t,secondaryColor:n,textColor:a,backgroundColor:i,accentColor:o,isDarkMode:!1,logoUrl:e.club_logo_url,faviconUrl:void 0,colors:{primary:t,secondary:n,text:a,background:i,accent:o}}},[e])};var c=n(13316),d=n(80309),u=n(58957),h=n(70579);const m=e=>{let{children:t}=e;const{data:n}=(0,r.s)(),s=l();return a.useEffect(()=>{try{const e=document.documentElement;e.style.setProperty("--colorAccent",s.primaryColor),e.style.setProperty("--colorAccentHover",s.secondaryColor||s.primaryColor),e.style.setProperty("--colorBgPrimary","#0e0e0e"),e.style.setProperty("--colorBgSecondary","#181818"),e.style.setProperty("--colorBgTertiary","#202020"),e.style.setProperty("--colorTextPrimary","#ffffff"),e.style.setProperty("--colorTextSecondary","rgba(255,255,255,0.72)"),e.style.setProperty("--colorBorder","rgba(255,255,255,0.16)")}catch(e){}},[s.primaryColor,s.secondaryColor]),a.useEffect(()=>{try{["style-pack-default","style-pack-modern","style-pack-minimal","style-pack-sparta"].forEach(e=>document.body.classList.remove(e)),document.body.classList.add("style-pack-sparta")}catch(e){}return()=>{try{document.body.classList.remove("style-pack-sparta")}catch(e){}}},[]),(0,h.jsxs)(i.a,{minH:"100vh",bg:"var(--colorBgPrimary, #0e0e0e)",color:"var(--colorTextPrimary, #ffffff)",children:[(0,h.jsx)(i.a,{as:"header",children:(0,h.jsx)(c.A,{})}),(0,h.jsx)(o.m,{maxW:"container.xl",py:8,children:t}),(0,h.jsx)(i.a,{as:"section",mt:4,children:(0,h.jsx)(d.A,{layout:"grid",theme:"dark"})}),(0,h.jsx)(i.a,{as:"footer",mt:0,children:(0,h.jsx)(u.A,{})})]})}},73523:(e,t,n)=>{n.d(t,{A:()=>C});var a=n(65043),i=n(87139),o=n(22107),r=n(98662),s=n(82459),l=n(5371),c=n(43533),d=n(33572),u=n(67516),h=n(35929),m=n(56529),p=n(15071),x=n(11054),g=n(78460),v=n(85421),j=n(10202),b=n(39081),y=n(39183),f=n(20515),k=n(25189),_=n(71942),w=n(69023),z=n(92410),S=n(6175),A=n(70579);const C=e=>{let{isOpen:t,match:n,onClose:C,onTeamClick:E}=e;const{settings:T}=(0,f.t)(),D=(0,a.useMemo)(()=>{if(!n)return null;if(n.date&&n.time)return"".concat(n.date,"T").concat(n.time||"00:00",":00");if(n.date_time){const e=String(n.date_time),[t,a]=e.split(" "),[i,o,r]=(t||"").split(".");return i&&o&&r?"".concat(r,"-").concat(o.padStart(2,"0"),"-").concat(i.padStart(2,"0"),"T").concat(a||"00:00",":00"):n.date_time}return null},[n]),{countdownString:N,isActive:R,timeRemaining:F}=(0,y.L)(D,1e3),P=(null===n||void 0===n?void 0:n.facr_link)||(null===n||void 0===n?void 0:n.report_url)||null,I=((e=>{if(!e)return"";try{if(e.date&&e.time){const t=new Date("".concat(e.date,"T").concat(e.time||"00:00",":00"));if(!isNaN(t.getTime()))return t.toLocaleString()}if(e.date_time){const t=String(e.date_time),[n,a]=t.split(" "),[i,o,r]=(n||"").split(".");if(i&&o&&r){const e="".concat(r,"-").concat(o.padStart(2,"0"),"-").concat(i.padStart(2,"0"),"T").concat(a||"00:00",":00"),t=new Date(e);if(!isNaN(t.getTime()))return t.toLocaleString()}return e.date_time}}catch(t){}})(n),!!D&&(new Date(D).getTime(),Date.now()),(null===n||void 0===n?void 0:n.score)&&n.score.trim(),(0,a.useMemo)(()=>{if(null===n||void 0===n||!n.home||!T)return!1;const e=(0,k.Lt)(n.home).toLowerCase(),t=(0,k.Lt)((null===T||void 0===T?void 0:T.club_name)||"").toLowerCase();return e.includes(t)||t.includes(e)},[n,T]));return(0,A.jsxs)(g.aF,{isOpen:t,onClose:C,isCentered:!0,size:"lg",returnFocusOnClose:!1,children:[(0,A.jsx)(x.m,{}),(0,A.jsxs)(v.$,{children:[(0,A.jsxs)(p.r,{children:[(0,k.Lt)(null===n||void 0===n?void 0:n.home)||"Dom\xe1c\xed"," vs ",(0,k.Lt)(null===n||void 0===n?void 0:n.away)||"Host\xe9"]}),(0,A.jsx)(h.s,{}),(0,A.jsx)(u.c,{children:n&&(0,A.jsxs)(j.T,{align:"stretch",spacing:4,children:[(()=>{const e=!!D&&new Date(D).getTime()<=Date.now(),t=(null===n||void 0===n?void 0:n.score)&&""!==n.score.trim();if(e){if(t){const e=(e=>{if(!e)return null;const t=e.match(/^(\d+)\s*[:\-]\s*(\d+)$/);return t?{h:parseInt(t[1],10),a:parseInt(t[2],10)}:null})(n.score);if(e){const t=T&&n.home&&((0,k.Lt)(n.home).toLowerCase().includes((0,k.Lt)((null===T||void 0===T?void 0:T.club_name)||"").toLowerCase())||(0,k.Lt)((null===T||void 0===T?void 0:T.club_name)||"").toLowerCase().includes((0,k.Lt)(n.home).toLowerCase())),a=T&&n.away&&((0,k.Lt)(n.away).toLowerCase().includes((0,k.Lt)((null===T||void 0===T?void 0:T.club_name)||"").toLowerCase())||(0,k.Lt)((null===T||void 0===T?void 0:T.club_name)||"").toLowerCase().includes((0,k.Lt)(n.away).toLowerCase()));if(t||a){const n=t?e.h:e.a,a=t?e.a:e.h;let o="Rem\xedza",r="blue";return n>a?(o="V\xfdhra",r="green"):n<a&&(o="Prohra",r="red"),(0,A.jsx)(l.s,{justify:"center",children:(0,A.jsx)(i.E,{colorScheme:r,variant:"subtle",children:o})})}}}}else{const e=n.competition||n.competitionName;if(e&&"V\u0161echny sout\u011b\u017ee"!==e)return(0,A.jsx)(l.s,{justify:"center",children:(0,A.jsx)(i.E,{colorScheme:"purple",children:e})})}return null})(),(0,A.jsxs)(l.s,{align:"center",justify:"center",gap:3,children:[n.home_logo_url&&(0,A.jsx)(d._,{src:n.home_logo_url,alt:n.home,boxSize:"40px",borderRadius:"full",cursor:"pointer",onClick:()=>E&&E(n.home||"",n.home_logo_url),_hover:{opacity:.8,transform:"scale(1.1)"},transition:"all 0.2s",title:"Klikn\u011bte pro zobrazen\xed statistik: ".concat(n.home)}),(()=>{const e=!!D&&new Date(D).getTime()<=Date.now(),t=Boolean(n.score);return e?(0,A.jsx)(i.E,{colorScheme:"gray",fontSize:"md",px:3,py:1,children:t?n.score:"vs"}):R&&N?(0,A.jsxs)(i.E,{colorScheme:"orange",fontSize:"md",px:3,py:1,children:["za ",N]}):(0,A.jsx)(i.E,{colorScheme:"gray",fontSize:"md",px:3,py:1,children:"vs"})})(),n.away_logo_url&&(0,A.jsx)(d._,{src:n.away_logo_url,alt:n.away,boxSize:"40px",borderRadius:"full",cursor:"pointer",onClick:()=>E&&E(n.away||"",n.away_logo_url),_hover:{opacity:.8,transform:"scale(1.1)"},transition:"all 0.2s",title:"Klikn\u011bte pro zobrazen\xed statistik: ".concat(n.away)})]}),(0,A.jsx)(s.c,{}),(0,A.jsxs)(o.a,{textAlign:"center",children:[(0,A.jsx)(b.E,{fontSize:"lg",fontWeight:"semibold",color:"gray.800",mb:1,children:(()=>{try{if(n.date){let e;const t=(0,z.qg)(n.date,"yyyy-MM-dd",new Date);if(isNaN(t.getTime())){const t=(0,z.qg)(n.date,"dd.MM.yyyy",new Date);if(isNaN(t.getTime()))return n.date;e=t}else e=t;return(0,w.GP)(e,"EEEE d. MMMM yyyy",{locale:S.cs})}return""}catch(e){return console.error("Date formatting error:",e),n.date||""}})()}),(0,A.jsx)(b.E,{fontSize:"md",color:"gray.700",children:n.time||"\u2014"})]}),(()=>{const e=!!D&&new Date(D).getTime()<=Date.now();if(!Boolean(n.score)&&!e&&R&&F&&F>0){const e=Math.floor(F/864e5),t=Math.floor(F%864e5/36e5),n=Math.floor(F%36e5/6e4),a=Math.floor(F%6e4/1e3);return(0,A.jsxs)(o.a,{mt:4,p:4,bg:"orange.50",borderRadius:"lg",borderWidth:"2px",borderColor:"orange.200",children:[(0,A.jsx)(b.E,{fontSize:"sm",fontWeight:"semibold",color:"orange.800",mb:3,textAlign:"center",children:"Z\xe1pas za\u010d\xedn\xe1 za"}),(0,A.jsxs)(c.x,{templateColumns:e>0?"repeat(4, 1fr)":"repeat(3, 1fr)",gap:3,children:[e>0&&(0,A.jsxs)(o.a,{textAlign:"center",children:[(0,A.jsx)(o.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,A.jsx)(b.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:e})}),(0,A.jsx)(b.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===e?"den":e<5?"dny":"dn\xed"})]}),(0,A.jsxs)(o.a,{textAlign:"center",children:[(0,A.jsx)(o.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,A.jsx)(b.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:String(t).padStart(2,"0")})}),(0,A.jsx)(b.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===t?"hodina":t<5?"hodiny":"hodin"})]}),(0,A.jsxs)(o.a,{textAlign:"center",children:[(0,A.jsx)(o.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,A.jsx)(b.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:String(n).padStart(2,"0")})}),(0,A.jsx)(b.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===n?"minuta":n<5?"minuty":"minut"})]}),(0,A.jsxs)(o.a,{textAlign:"center",children:[(0,A.jsx)(o.a,{bg:"white",borderRadius:"md",p:3,borderWidth:"1px",borderColor:"orange.300",boxShadow:"sm",children:(0,A.jsx)(b.E,{fontSize:"2xl",fontWeight:"bold",color:"orange.600",children:String(a).padStart(2,"0")})}),(0,A.jsx)(b.E,{fontSize:"xs",color:"gray.600",mt:1,fontWeight:"medium",children:1===a?"sekunda":a<5?"sekundy":"sekund"})]})]})]})}return null})(),(0,A.jsx)(o.a,{h:"1px",bg:"gray.200"}),n.venue&&(0,A.jsxs)(b.E,{fontSize:"md",color:"gray.700",textAlign:"center",children:[(0,A.jsx)("strong",{children:"Kde:"})," ",n.venue]}),(()=>{const e=!!D&&new Date(D).getTime()<=Date.now(),t=Boolean(n.score);return!I||e||t?null:(0,A.jsx)(o.a,{children:(0,A.jsx)(_.A,{matchDateTime:D||"",venue:n.venue,isHomeMatch:!0,matchHasStarted:!1})})})()]})}),(0,A.jsxs)(m.j,{children:[P&&(0,A.jsx)(r.$,{colorScheme:"blue",mr:3,onClick:e=>{e.preventDefault();const t=document.createElement("a");t.href=P,t.target="_blank",t.rel="noopener noreferrer",t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:"Detail na FA\u010cR"}),(0,A.jsx)(r.$,{onClick:C,children:"Zav\u0159\xedt"})]})]})]})}},74138:(e,t,n)=>{n.d(t,{A:()=>C});var a=n(89379),i=n(65043),o=n(44093),r=n(10202),s=n(22107),l=n(73225),c=n(76668),d=n(35699),u=n(96148),h=n(39081),m=n(7189),p=n(88787),x=n(85871),g=n(33430),v=n(34334),j=n(87139),b=n(98662),y=n(82459),f=n(61724),k=n(73212),_=n(56379),w=n(70579);const z=e=>{let{value:t,onChange:n,clubPrimaryColor:a,clubSecondaryColor:i,showPreview:d=!0}=e;const m=(0,o.dU)("gray.50","gray.700"),p=(0,o.dU)("blue.50","blue.900"),x=(0,o.dU)("blue.200","blue.700"),g=(0,o.dU)("gray.700","gray.300"),v=(0,o.dU)("gray.600","gray.400"),b=(0,o.dU)("white","gray.700"),y=_.u[t]||_.u.default;return(0,w.jsxs)(r.T,{align:"stretch",spacing:4,children:[(0,w.jsxs)(l.MJ,{children:[(0,w.jsx)(c.l,{children:"Styl mapy"}),(0,w.jsx)(f.l,{value:t,onChange:e=>n(e.target.value),bg:b,children:Object.entries({"Light & Minimal":["positron","positron-no-labels","default"],"Dark Themes":["dark","dark-no-labels"],"Black & White":["toner","toner-lite"],Colorful:["voyager","terrain","watercolor"],Satellite:["satellite"]}).map(e=>{let[t,n]=e;return(0,w.jsx)("optgroup",{label:t,children:n.map(e=>{const t=_.u[e];return(0,w.jsx)("option",{value:e,children:t.name},e)})},t)})})]}),d&&(0,w.jsxs)(r.T,{align:"stretch",spacing:3,children:[(0,w.jsx)(s.a,{p:4,borderWidth:"1px",borderRadius:"md",bg:m,children:(0,w.jsxs)(r.T,{align:"stretch",spacing:3,children:[(0,w.jsxs)(u.z,{justify:"space-between",children:[(0,w.jsx)(h.E,{fontWeight:"semibold",children:y.name}),(0,w.jsx)(j.E,{colorScheme:"blue",children:"N\xe1hled stylu"})]}),(0,w.jsx)(h.E,{fontSize:"sm",color:v,children:y.description}),a&&(0,w.jsxs)(s.a,{children:[(0,w.jsx)(h.E,{fontSize:"sm",fontWeight:"medium",mb:2,children:"Barvy klubu:"}),(0,w.jsxs)(u.z,{children:[(0,w.jsx)(s.a,{w:"40px",h:"40px",borderRadius:"md",bg:a,borderWidth:"1px",borderColor:"gray.300"}),i&&(0,w.jsx)(s.a,{w:"40px",h:"40px",borderRadius:"md",bg:i,borderWidth:"1px",borderColor:"gray.300"}),(0,w.jsx)(h.E,{fontSize:"xs",color:v,children:"Pou\u017eity pro marker a overlay"})]})]})]})}),(0,w.jsx)(s.a,{borderWidth:"1px",borderRadius:"md",overflow:"hidden",boxShadow:"sm",children:(0,w.jsx)(_.A,{latitude:50.0755,longitude:14.4378,zoom:13,address:"Praha, \u010cesk\xe1 republika",clubName:"N\xe1hled mapy",mapStyle:t,clubPrimaryColor:a,clubSecondaryColor:i,height:300})}),(0,w.jsx)(h.E,{fontSize:"xs",color:v,textAlign:"center",children:"N\xe1hled interaktivn\xed mapy se zvolen\xfdm stylem"})]}),(0,w.jsxs)(s.a,{p:3,bg:p,borderWidth:"1px",borderColor:x,borderRadius:"md",children:[(0,w.jsx)(h.E,{fontSize:"sm",fontWeight:"semibold",mb:1,children:"\ud83d\udca1 Tipy pro v\xfdb\u011br stylu:"}),(0,w.jsxs)(k.r,{columns:{base:1,md:2},spacing:2,children:[(0,w.jsxs)(h.E,{fontSize:"xs",color:g,children:["\u2022 ",(0,w.jsx)("strong",{children:"Positron/Toner Lite"})," - nejlep\u0161\xed pro barevn\xe9 markery"]}),(0,w.jsxs)(h.E,{fontSize:"xs",color:g,children:["\u2022 ",(0,w.jsx)("strong",{children:"Dark Matter"})," - skv\u011bl\xe9 pro tmav\xfd design"]}),(0,w.jsxs)(h.E,{fontSize:"xs",color:g,children:["\u2022 ",(0,w.jsx)("strong",{children:"Toner B&W"})," - vysok\xfd kontrast, elegantn\xed"]}),(0,w.jsxs)(h.E,{fontSize:"xs",color:g,children:["\u2022 ",(0,w.jsx)("strong",{children:"Voyager"})," - vyv\xe1\u017een\u011b pro v\u0161echny p\u0159\xedpady"]})]})]}),(0,w.jsxs)(h.E,{fontSize:"xs",color:v,children:["V\u0161echny mapy jsou open-source a bezplatn\xe9.",a&&" Mapa bude automaticky obarvena barvami klubu."]})]})};var S=n(1009);function A(e){if(!e||"string"!==typeof e)return null;let t=e.trim();t.startsWith("http://")||t.startsWith("https://")||(t="https://"+t);const n=function(e){try{const t=new URL(e);if(!t.hostname.includes("mapy.cz")&&!t.hostname.includes("mapy.com"))return null;const n=t.searchParams,a=n.get("x"),i=n.get("y"),o=n.get("z"),r=n.get("q");if(a&&i){const e=parseFloat(a),t=parseFloat(i),n=o?parseInt(o):void 0;return isNaN(t)||isNaN(e)?null:{latitude:t,longitude:e,zoom:n,address:r?decodeURIComponent(r):void 0,source:"mapy.cz"}}return null}catch(t){return console.error("Error parsing mapy.cz URL:",t),null}}(t);if(n)return n;const a=function(e){try{const t=new URL(e);if(!t.hostname.includes("google.com")&&!t.hostname.includes("google.cz"))return null;const n=t.pathname.match(/@(-?\d+\.\d+),(-?\d+\.\d+),(\d+)z/);if(n){const e=parseFloat(n[1]),a=parseFloat(n[2]),i=parseInt(n[3]);if(!isNaN(e)&&!isNaN(a)){const n=t.pathname.match(/\/place\/([^/]+)/),o=n?decodeURIComponent(n[1].replace(/\+/g," ")):void 0;return{latitude:e,longitude:a,zoom:isNaN(i)?void 0:i,address:o,source:"google-maps"}}}const a=t.searchParams.get("q");if(a){const e=a.match(/(-?\d+\.\d+),(-?\d+\.\d+)/);if(e){const t=parseFloat(e[1]),n=parseFloat(e[2]);if(!isNaN(t)&&!isNaN(n))return{latitude:t,longitude:n,address:a.includes(",")?void 0:a,source:"google-maps"}}}const i=t.pathname.match(/!3d(-?\d+\.\d+)!4d(-?\d+\.\d+)/);if(i){const e=parseFloat(i[1]),t=parseFloat(i[2]);if(!isNaN(e)&&!isNaN(t))return{latitude:e,longitude:t,source:"google-maps"}}return null}catch(t){return console.error("Error parsing Google Maps URL:",t),null}}(t);return a||null}const C=e=>{let{onImport:t,currentLatitude:n,currentLongitude:f,currentZoom:k,mapStyle:C,onMapStyleChange:E,clubPrimaryColor:T,clubSecondaryColor:D,clubName:N}=e;const[R,F]=(0,i.useState)(""),[P,I]=(0,i.useState)(null),[M,L]=(0,i.useState)(null),[W,U]=(0,i.useState)(null),O=((0,o.dU)("white","gray.800"),(0,o.dU)("gray.200","gray.700"));(0,i.useEffect)(()=>{n&&f&&U({latitude:n,longitude:f,zoom:k,source:"unknown"})},[n,f,k]);return(0,w.jsxs)(r.T,{spacing:4,align:"stretch",children:[(0,w.jsxs)(s.a,{children:[(0,w.jsxs)(l.MJ,{children:[(0,w.jsxs)(c.l,{display:"flex",alignItems:"center",gap:2,children:[(0,w.jsx)(S.HzC,{})," Importovat z URL mapy"]}),(0,w.jsx)(d.p,{placeholder:"Vlo\u017ete URL z mapy.cz nebo Google Maps...",value:R,onChange:async e=>{const t=e.target.value;if(F(t),L(null),I(null),!t.trim())return;const n=A(t);if(n)if(i=n.latitude,o=n.longitude,!isNaN(i)&&!isNaN(o)&&i>=-90&&i<=90&&o>=-180&&o<=180)try{const e=await async function(e,t){try{const n=await fetch("https://nominatim.openstreetmap.org/reverse?format=json&lat=".concat(e,"&lon=").concat(t,"&addressdetails=1&accept-language=cs"),{headers:{"User-Agent":"FotbalClub/1.0"}});if(!n.ok)throw new Error("Reverse geocoding failed");const a=await n.json(),i=a.address||{};return{address:a.display_name,street:i.road||i.street||i.pedestrian||i.footway,houseNumber:i.house_number,city:i.city||i.town||i.village||i.municipality,zip:i.postcode,country:i.country||"\u010cesk\xe1 republika"}}catch(M){return console.error("Reverse geocoding error:",M),{}}}(n.latitude,n.longitude),t=(0,a.A)((0,a.A)({},n),e);I(t),U(t),L(null)}catch(r){I(n),U(n),L(null)}else L("Sou\u0159adnice jsou mimo platn\xfd rozsah"),I(null);else L("Nepoda\u0159ilo se rozpoznat URL mapy. Podporovan\xe9: mapy.cz, Google Maps"),I(null);var i,o},size:"md"}),(0,w.jsxs)(u.z,{mt:2,spacing:3,fontSize:"sm",children:[(0,w.jsx)(h.E,{color:"gray.600",children:"Rychl\xe9 odkazy:"}),(0,w.jsxs)(m.N,{href:"https://mapy.com/cs/",isExternal:!0,color:"blue.500",display:"flex",alignItems:"center",gap:1,_hover:{color:"blue.600",textDecoration:"underline"},children:["Mapy.cz ",(0,w.jsx)(S.HaR,{size:12})]}),(0,w.jsx)(h.E,{color:"gray.400",children:"\u2022"}),(0,w.jsxs)(m.N,{href:"https://www.google.com/maps/",isExternal:!0,color:"blue.500",display:"flex",alignItems:"center",gap:1,_hover:{color:"blue.600",textDecoration:"underline"},children:["Google Maps ",(0,w.jsx)(S.HaR,{size:12})]})]})]}),P&&(0,w.jsxs)(p.F,{status:"success",mt:3,borderRadius:"md",children:[(0,w.jsx)(x._,{}),(0,w.jsxs)(s.a,{flex:"1",children:[(0,w.jsx)(g.X,{children:"\xdasp\u011b\u0161n\u011b rozpozn\xe1no!"}),(0,w.jsx)(v.T,{display:"block",children:(0,w.jsxs)(r.T,{align:"start",spacing:1,mt:2,children:[(0,w.jsx)(u.z,{children:(0,w.jsx)(j.E,{colorScheme:"green",children:"mapy.cz"===P.source?"Mapy.cz":"Google Maps"})}),(0,w.jsxs)(h.E,{fontSize:"sm",children:[(0,w.jsx)("strong",{children:"\u0160\xed\u0159ka:"})," ",P.latitude.toFixed(7)]}),(0,w.jsxs)(h.E,{fontSize:"sm",children:[(0,w.jsx)("strong",{children:"D\xe9lka:"})," ",P.longitude.toFixed(7)]}),P.zoom&&(0,w.jsxs)(h.E,{fontSize:"sm",children:[(0,w.jsx)("strong",{children:"Zoom:"})," ",P.zoom]}),P.street&&(0,w.jsxs)(h.E,{fontSize:"sm",children:[(0,w.jsx)("strong",{children:"Ulice:"})," ",P.street]}),P.city&&(0,w.jsxs)(h.E,{fontSize:"sm",children:[(0,w.jsx)("strong",{children:"M\u011bsto:"})," ",P.city]}),P.zip&&(0,w.jsxs)(h.E,{fontSize:"sm",children:[(0,w.jsx)("strong",{children:"PS\u010c:"})," ",P.zip]}),P.country&&(0,w.jsxs)(h.E,{fontSize:"sm",children:[(0,w.jsx)("strong",{children:"Zem\u011b:"})," ",P.country]}),P.address&&(0,w.jsxs)(h.E,{fontSize:"sm",children:[(0,w.jsx)("strong",{children:"Cel\xe1 adresa:"})," ",P.address]})]})})]}),(0,w.jsxs)(u.z,{ml:2,children:[(0,w.jsx)(b.$,{leftIcon:(0,w.jsx)(S.YrT,{}),colorScheme:"green",size:"sm",onClick:()=>{P&&(t(P),F(""),I(null),L(null))},children:"Importovat"}),(0,w.jsx)(b.$,{leftIcon:(0,w.jsx)(S.yGN,{}),variant:"ghost",size:"sm",onClick:()=>{F(""),I(null),L(null),U(n&&f?{latitude:n,longitude:f,zoom:k,source:"unknown"}:null)},children:"Zru\u0161it"})]})]}),M&&(0,w.jsxs)(p.F,{status:"error",mt:3,borderRadius:"md",children:[(0,w.jsx)(x._,{}),(0,w.jsx)(v.T,{children:M})]})]}),W&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(y.c,{}),(0,w.jsxs)(s.a,{children:[(0,w.jsx)(h.E,{fontWeight:"semibold",mb:2,children:"N\xe1hled mapy"}),(0,w.jsx)(s.a,{borderRadius:"md",overflow:"hidden",borderWidth:"1px",borderColor:O,minH:"300px",children:(0,w.jsx)(_.A,{latitude:W.latitude,longitude:W.longitude,zoom:W.zoom||15,address:W.address,clubName:N,mapStyle:C||"positron",clubPrimaryColor:T,clubSecondaryColor:D,height:300})}),(0,w.jsxs)(h.E,{fontSize:"xs",color:"gray.500",mt:2,children:["Sou\u0159adnice: ",W.latitude.toFixed(6),", ",W.longitude.toFixed(6),W.zoom&&" | Zoom: ".concat(W.zoom)]})]}),E&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(y.c,{}),(0,w.jsxs)(s.a,{children:[(0,w.jsx)(h.E,{fontWeight:"semibold",mb:2,children:"Styl mapy"}),(0,w.jsx)(h.E,{fontSize:"sm",color:"gray.600",mb:3,children:"Vyberte vzhled mapy, kter\xfd se zobraz\xed na va\u0161em webu."}),(0,w.jsx)(z,{value:C||"positron",onChange:E,clubPrimaryColor:T,clubSecondaryColor:D,showPreview:!1})]})]})]}),!W&&n&&f&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(y.c,{}),(0,w.jsxs)(s.a,{children:[(0,w.jsx)(h.E,{fontWeight:"semibold",mb:2,children:"N\xe1hled mapy"}),(0,w.jsx)(s.a,{borderRadius:"md",overflow:"hidden",borderWidth:"1px",borderColor:O,minH:"300px",children:(0,w.jsx)(_.A,{latitude:n,longitude:f,zoom:k||15,address:void 0,clubName:N,mapStyle:C||"positron",clubPrimaryColor:T,clubSecondaryColor:D,height:300})}),(0,w.jsxs)(h.E,{fontSize:"xs",color:"gray.500",mt:2,children:["Sou\u0159adnice: ",n.toFixed(6),", ",f.toFixed(6),k&&" | Zoom: ".concat(k)]})]})]})]})}},74770:(e,t,n)=>{n.d(t,{CX:()=>r,l3:()=>i,rC:()=>o});var a=n(46291);const i=async()=>(await a.Ay.get("/settings")).data,o=async()=>(await a.Ay.get("/admin/settings")).data,r=async e=>(await a.Ay.put("/admin/settings",e)).data},75753:(e,t,n)=>{n.r(t),n.d(t,{default:()=>O});var a=n(65043),i=n(40378),o=n(73216),r=n(35475),s=n(38376),l=n(44093),c=n(22107),d=n(98939),u=n(96148),h=n(76659),m=n(39081),p=n(10202),x=n(33572),g=n(28846),v=n(87139),j=n(25011),b=n(98662),y=n(7189),f=n(82459),k=n(1009),_=n(87977),w=n(25189),z=n(46291),S=n(82047),A=n(88787),C=n(85871),E=n(56379),T=n(74770),D=n(70579);const N={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic",REACT_APP_ESHOP_URL:"http://localhost:3100",REACT_APP_ERROR_INGEST_URL:"http://127.0.0.1:8083/api/v1/errors",REACT_APP_ERROR_INGEST_TOKEN:""}.REACT_APP_NOMINATIM_URL||"https://nominatim.openstreetmap.org",R={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic",REACT_APP_ESHOP_URL:"http://localhost:3100",REACT_APP_ERROR_INGEST_URL:"http://127.0.0.1:8083/api/v1/errors",REACT_APP_ERROR_INGEST_TOKEN:""}.REACT_APP_NOMINATIM_EMAIL,F=new Map;const P=()=>(0,D.jsxs)(c.a,{display:"flex",alignItems:"center",gap:2,color:"gray.500",children:[(0,D.jsx)(h.y,{size:"sm"}),(0,D.jsx)(m.E,{children:"Na\u010d\xedt\xe1m mapu\u2026"})]}),I=e=>{let{location:t,title:n,latitude:i,longitude:o}=e;const[r,s]=a.useState(!1),[l,d]=a.useState(null),[u,h]=a.useState(null),[x,g]=a.useState(null);if(a.useEffect(()=>{(0,T.l3)().then(g).catch(()=>{})},[]),a.useEffect(()=>{const e=(t||"").trim();if(!e)return h(null),void d(null);if(null!=i&&null!=o&&Number.isFinite(i)&&Number.isFinite(o))return h({lat:i,lon:o,displayName:e}),s(!1),void d(null);let n=!0;const a=new AbortController;return s(!0),d(null),async function(e,t){const n=e.trim().toLowerCase();if(F.has(n))return F.get(n);const a=new URLSearchParams({format:"jsonv2",limit:"1",q:e,"accept-language":"cs"});R&&a.append("email",R);const i="".concat(N,"/search?").concat(a.toString()),o=await fetch(i,{headers:{Accept:"application/json"},signal:t});if(!o.ok)throw new Error("Nepoda\u0159ilo se na\u010d\xedst mapov\xe1 data.");const r=await o.json();if(!Array.isArray(r)||0===r.length)throw new Error("Poloha nebyla nalezena.");const s=r[0],l=Number(s.lat),c=Number(s.lon);if(!Number.isFinite(l)||!Number.isFinite(c))throw new Error("Neplatn\xe9 sou\u0159adnice.");const d={lat:l,lon:c,displayName:String(s.display_name||e)};return F.set(n,d),d}(e,a.signal).then(e=>{n&&h(e)}).catch(e=>{n&&(h(null),d((null===e||void 0===e?void 0:e.message)||"Mapu se nepoda\u0159ilo na\u010d\xedst."))}).finally(()=>{n&&s(!1)}),()=>{n=!1,a.abort()}},[t,i,o]),null===t||void 0===t||!t.trim())return null;const v=encodeURIComponent(t.trim()),j=u?"https://www.openstreetmap.org/?mlat=".concat(u.lat,"&mlon=").concat(u.lon,"#map=17/").concat(u.lat,"/").concat(u.lon):"https://www.openstreetmap.org/search?query=".concat(v),b=u?"https://www.google.com/maps/search/?api=1&query=".concat(u.lat,",").concat(u.lon):"https://www.google.com/maps/search/?api=1&query=".concat(v),f=u?"https://mapy.cz/zakladni?x=".concat(u.lon,"&y=").concat(u.lat,"&z=17"):"https://mapy.cz/zakladni?q=".concat(v);return(0,D.jsxs)(p.T,{align:"stretch",spacing:3,mt:4,"data-testid":"event-location-map",children:[(0,D.jsx)(m.E,{fontWeight:"semibold",fontSize:"lg",children:"Mapa m\xedsta"}),r&&(0,D.jsx)(P,{}),!r&&l&&(0,D.jsxs)(A.F,{status:"error",borderRadius:"md",children:[(0,D.jsx)(C._,{}),(0,D.jsxs)(c.a,{children:[(0,D.jsx)(m.E,{mb:1,children:l}),(0,D.jsxs)(m.E,{children:[(0,D.jsx)(y.N,{href:j,isExternal:!0,color:"blue.400",children:"Otev\u0159\xedt v OpenStreetMap"})," \xb7 ",(0,D.jsx)(y.N,{href:b,isExternal:!0,color:"blue.400",children:"Otev\u0159\xedt v Google Maps"})," \xb7 ",(0,D.jsx)(y.N,{href:f,isExternal:!0,color:"blue.400",children:"Otev\u0159\xedt v Mapy.cz"})]})]})]}),!r&&!l&&u&&(0,D.jsx)(c.a,{borderWidth:"1px",borderRadius:"lg",overflow:"hidden",borderColor:"border.subtle",children:(0,D.jsx)(E.A,{latitude:u.lat,longitude:u.lon,zoom:15,address:u.displayName,clubName:n,height:320,mapStyle:(null===x||void 0===x?void 0:x.map_style)||"default",clubPrimaryColor:null===x||void 0===x?void 0:x.primary_color,clubSecondaryColor:null===x||void 0===x?void 0:x.accent_color})}),(0,D.jsxs)(m.E,{fontSize:"sm",color:"gray.500",children:["P\u0159esnost ur\u010dena pomoc\xed otev\u0159en\xfdch mapov\xfdch dat. Zobrazit v"," ",(0,D.jsx)(y.N,{href:j,isExternal:!0,color:"blue.400",children:"OpenStreetMap"})," \xb7 ",(0,D.jsx)(y.N,{href:b,isExternal:!0,color:"blue.400",children:"Google Maps"})," \xb7 ",(0,D.jsx)(y.N,{href:f,isExternal:!0,color:"blue.400",children:"Mapy.cz"})]})]})};var M=n(25093),L=n(97717),W=n(12255),U=n(61269);const O=()=>{const{id:e}=(0,o.g)(),[t,n]=a.useState(!0),[A,C]=a.useState(null),[E,T]=a.useState(null);a.useEffect(()=>{let t=!0;return(async()=>{try{if(!e)return;const n=await(0,s.Zc)(e);t&&T(n)}catch(a){t&&C((null===a||void 0===a?void 0:a.message)||"Nelze na\u010d\xedst aktivitu")}finally{t&&n(!1)}})(),()=>{t=!1}},[e]);const N=a.useRef(null);a.useEffect(()=>{const e=N.current;if(!e)return;const t=e=>{const t=e.target;if(!t)return;const n=t.closest?t.closest("a"):null;if(n&&n.href){const e=n.getAttribute("href")||n.href;try{(0,S.sx)("Link Click",{href:e,page:window.location.pathname,context:"activity_content"})}catch(a){}}};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}},[N.current]);const R=a.useCallback(e=>{if(!e)return"";try{const t=new URL(z.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return e.replace(/src=("|')\s*(\/uploads\/[^"']+)("')/g,(e,n,a,i)=>"src=".concat(n).concat(t).concat(a).concat(i)).replace(/href=("|')\s*(\/uploads\/[^"']+)("')/g,(e,n,a,i)=>"href=".concat(n).concat(t).concat(a).concat(i)).replace(/src=("|')\s*https?:\/\/(?:localhost|127\.0\.0\.1)(?::\d+)?(\/uploads\/[^"']+)("')/g,(e,n,a,i)=>"src=".concat(n).concat(t).concat(a).concat(i)).replace(/href=("|')\s*https?:\/\/(?:localhost|127\.0\.0\.1)(?::\d+)?(\/uploads\/[^"']+)("')/g,(e,n,a,i)=>"href=".concat(n).concat(t).concat(a).concat(i))}catch(t){return e||""}},[]),F=e=>{if(!e)return null;if(e.includes("youtube.com/embed/"))return e;let t=null;const n=e.match(/[?&]v=([^&#]+)/);n&&(t=n[1]);const a=e.match(/youtu\.be\/([^?&#]+)/);a&&(t=a[1]);const i=e.match(/youtube\.com\/embed\/([^?&#]+)/);return i&&(t=i[1]),t?"https://www.youtube.com/embed/".concat(t):null},P=(0,l.dU)("white","gray.800"),O=(0,l.dU)("gray.200","gray.700"),q=(0,l.dU)("gray.600","gray.300"),K=(0,l.dU)("blue.600","blue.300"),B=(0,l.dU)("blue.700","blue.200"),Z=(0,l.dU)("#4a5568","#cbd5e0"),V=(0,l.dU)("#f7fafc","#1a202c");return(0,D.jsx)(i.A,{children:(0,D.jsxs)(c.a,{py:10,bg:"transparent",children:[(0,D.jsx)(W.A,{activity:E,targetUrl:"undefined"!==typeof window?window.location.href:void 0,placement:"fixed",size:"md",align:"left"}),(0,D.jsxs)(d.m,{maxW:"3xl",children:[t&&(0,D.jsxs)(u.z,{children:[(0,D.jsx)(h.y,{size:"sm"}),(0,D.jsx)(m.E,{children:"Na\u010d\xedt\xe1n\xed\u2026"})]}),!t&&A&&(0,D.jsx)(m.E,{color:"red.500",children:A}),!t&&!A&&E&&(0,D.jsxs)(p.T,{align:"stretch",spacing:5,children:[E.image_url&&(0,D.jsx)(c.a,{borderRadius:"xl",overflow:"hidden",borderWidth:"1px",children:(0,D.jsx)(x._,{src:(0,w.uq)(E.image_url)||E.image_url,alt:E.title,w:"100%",maxH:"420px",objectFit:"cover",fallbackSrc:"/dist/img/logo-club-empty.svg"})}),(0,D.jsxs)(p.T,{align:"stretch",spacing:1,children:[(0,D.jsxs)(u.z,{justify:"space-between",align:"start",children:[(0,D.jsx)(g.D,{as:"h1",size:"lg",lineHeight:1.2,children:E.title}),(0,D.jsx)(v.E,{colorScheme:(H=E.type,"match"===H?"red":"training"===H?"blue":"meeting"===H?"green":"gray"),children:(e=>"match"===e?"Z\xe1pas":"training"===e?"Tr\xe9nink":"meeting"===e?"Sch\u016fzka":"Jin\xe9")(E.type)})]}),(0,D.jsxs)(u.z,{spacing:4,color:q,fontSize:"sm",children:[E.location&&(0,D.jsxs)(u.z,{children:[(0,D.jsx)(j.I,{as:k.HzC}),(0,D.jsx)(m.E,{children:E.location})]}),(0,D.jsxs)(u.z,{children:[(0,D.jsx)(j.I,{as:k.Ohp}),(0,D.jsxs)(m.E,{children:[new Date(E.start_time).toLocaleString()," ",E.end_time?"\u2013 ".concat(new Date(E.end_time).toLocaleString()):""]})]})]})]}),E.description&&(0,D.jsx)(c.a,{bg:P,borderWidth:"1px",borderColor:O,borderRadius:"lg",p:5,className:"blog-content",sx:{" ul, ol":{pl:6,listStylePosition:"outside",mb:3}," ul":{listStyleType:"disc"},' ul[data-bullets="disc"]':{listStyleType:"disc"},' ul[data-bullets="circle"]':{listStyleType:"circle"},' ul[data-bullets="square"]':{listStyleType:"square"}," ol":{listStyleType:"decimal"}," li":{mb:2}," h1, h2, h3, h4":{fontWeight:"bold",mt:3}," p":{lineHeight:1.8,mb:3}," a":{color:K,textDecoration:"underline",_hover:{color:B}}," blockquote":{borderLeft:"4px solid #3182ce",paddingLeft:"16px",margin:"1em 0",color:Z,fontStyle:"italic",backgroundColor:V,padding:"12px 16px",borderRadius:"4px"}," img":{display:"block",maxWidth:"100%",height:"auto",mt:2,border:"none !important",outline:"none !important",boxShadow:"none !important",cursor:"default",borderRadius:"md"}},ref:N,dangerouslySetInnerHTML:{__html:_.A.sanitize(R(String(E.description)),{USE_PROFILES:{html:!0},ADD_TAGS:["iframe"],ADD_ATTR:["class","target","rel","allow","allowfullscreen","style","data-filters","data-img-id","data-bullets","data-list"]})}}),E.youtube_url&&F(E.youtube_url)&&(0,D.jsx)(c.a,{borderRadius:"lg",overflow:"hidden",boxShadow:"md",children:(0,D.jsx)(c.a,{position:"relative",paddingBottom:"56.25%",height:0,children:(0,D.jsx)("iframe",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},src:F(E.youtube_url)||"",title:E.title,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",loading:"lazy",referrerPolicy:"strict-origin-when-cross-origin",allowFullScreen:!0})})}),E.location&&(0,D.jsx)(I,{location:E.location,title:E.title,latitude:E.latitude,longitude:E.longitude}),(null===E||void 0===E?void 0:E.id)&&(0,D.jsx)(M.A,{eventId:E.id,maxPolls:2}),(null===E||void 0===E?void 0:E.id)&&(0,D.jsx)(U.A,{targetType:"event",targetId:String(E.id)}),Array.isArray(E.attachments)&&E.attachments.length>0&&(0,D.jsxs)(p.T,{align:"stretch",spacing:3,children:[(0,D.jsx)(g.D,{as:"h3",size:"sm",children:"P\u0159\xedlohy"}),(0,D.jsx)(p.T,{align:"stretch",spacing:3,children:E.attachments.map((e,t)=>{var n;return(0,D.jsx)(L.A,{url:e.url,name:e.name,mimeType:e.mime_type,size:e.size,showInline:null===(n=e.mime_type)||void 0===n?void 0:n.startsWith("image/")},t)})})]}),E.file_url&&(0,D.jsx)(u.z,{children:(0,D.jsx)(b.$,{as:y.N,href:(0,w.uq)(E.file_url)||E.file_url,isExternal:!0,variant:"outline",leftIcon:(0,D.jsx)(k.a4x,{}),children:"St\xe1hnout p\u0159\xedlohu"})}),(0,D.jsx)(f.c,{}),(0,D.jsxs)(u.z,{children:[(0,D.jsx)(b.$,{as:r.N_,to:"/aktivity",variant:"outline",children:"Zp\u011bt na aktivity"}),(0,D.jsx)(b.$,{as:r.N_,to:"/",variant:"ghost",children:"Dom\u016f"})]})]})]})]})});var H}},76484:(e,t,n)=>{n.r(t),n.d(t,{default:()=>j});var a=n(65043),i=n(22107),o=n(98662),r=n(73225),s=n(76668),l=n(35699),c=n(10202),d=n(30502),u=n(28846),h=n(39081),m=n(35475),p=n(73216),x=n(46291),g=n(2367),v=n(70579);const j=()=>{const[e]=(0,m.ok)(),t=(0,p.Zp)(),n=e.get("token")||"",[j,b]=(0,a.useState)(""),[y,f]=(0,a.useState)(""),[k,_]=(0,a.useState)(!1),w=(0,d.d)();(0,a.useEffect)(()=>{n||w({title:"Chyb\xed token",description:"Odkaz pro reset je neplatn\xfd.",status:"error"})},[n,w]);return(0,v.jsx)(i.a,{minH:"100vh",display:"flex",alignItems:"center",justifyContent:"center",children:(0,v.jsx)(i.a,{w:"100%",maxW:"md",p:8,borderWidth:1,borderRadius:8,boxShadow:"lg",children:(0,v.jsxs)(c.T,{as:"form",onSubmit:async e=>{if(e.preventDefault(),j.length<8)w({title:"Slab\xe9 heslo",description:"Heslo mus\xed m\xedt alespo\u0148 8 znak\u016f.",status:"warning"});else if(j===y){_(!0);try{await x.Ay.post("/auth/reset-password",{token:n,new_password:j}),w({title:"Hotovo",description:"Heslo bylo zm\u011bn\u011bno. P\u0159ihlaste se nov\xfdm heslem.",status:"success"}),t("/login")}catch(o){var a,i;w({title:"Chyba",description:(null===(a=o.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||"Reset hesla se nezda\u0159il.",status:"error"})}finally{_(!1)}}else w({title:"Nesoulad hesel",description:"Hesla se neshoduj\xed.",status:"warning"})},spacing:4,align:"stretch",children:[(0,v.jsx)(u.D,{as:"h2",size:"lg",textAlign:"center",children:"Nastavit nov\xe9 heslo"}),!n&&(0,v.jsx)(h.E,{textAlign:"center",color:"red.500",children:"Chyb\xed token v URL. Zkontrolujte odkaz v e-mailu."}),(0,v.jsxs)(r.MJ,{id:"password",isRequired:!0,children:[(0,v.jsxs)(s.l,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,v.jsx)(i.a,{children:"Nov\xe9 heslo"}),(0,v.jsx)(g.II,{})]}),(0,v.jsx)(l.p,{type:"password",value:j,onChange:e=>b(e.target.value),placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"})]}),(0,v.jsxs)(r.MJ,{id:"confirm",isRequired:!0,children:[(0,v.jsx)(s.l,{children:"Potvrzen\xed hesla"}),(0,v.jsx)(l.p,{type:"password",value:y,onChange:e=>f(e.target.value),placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"})]}),(0,v.jsx)(o.$,{type:"submit",colorScheme:"blue",isLoading:k,isDisabled:!n,children:"Zm\u011bnit heslo"})]})})})}},77327:(e,t,n)=>{n.d(t,{d:()=>r});var a=n(65043),i=n(74117),o=n(91896);const r=()=>{const{i18n:e}=(0,i.Bd)(),[t,n]=(0,a.useState)(!1),[r,s]=(0,a.useState)(null),l=e=>(0,o.od)(e),c=()=>"cs"===e.language?"en":"cs";return{translateBlog:async(e,t)=>{n(!0),s(null);try{const n=l(e+" "+t),a=c();if(n===a)return{title:e,content:t};const i=await(0,o.IG)(e,t,n,a);return{title:i.translatedTitle,content:i.translatedContent}}catch(a){const e=a instanceof Error?a.message:"Translation failed";throw s(e),a}finally{n(!1)}},isTranslating:t,translationError:r,detectSourceLanguage:l,getTargetLanguage:c}}},77786:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Y});var a=n(89379),i=n(65043),o=n(87139),r=n(22107),s=n(98662),l=n(42703),c=n(44093),d=n(73225),u=n(76668),h=n(73212),m=n(35699),p=n(68455),x=n(67516),g=n(35929),v=n(56529),j=n(15071),b=n(11054),y=n(78460),f=n(85421),k=n(61724),_=n(96148),w=n(10202),z=n(98481),S=n(80511),A=n(82595),C=n(67813),E=n(83201),T=n(3313),D=n(55395),N=n(14566),R=n(31411),F=n(10227),P=n(51794),I=n(3109),M=n(19077),L=n(30502),W=n(28846),U=n(39081),O=n(1009),q=n(6583),K=n(29671),B=n(70082),Z=n(46291),V=n(91276),H=n(74770),$=n(74138),J=n(44318),G=n(88500),X=n(70579);const Y=()=>{var e,t,n;const Y=(0,c.dU)("white","gray.800"),Q=(0,c.dU)("gray.200","gray.700"),ee=(0,c.dU)("white","gray.700"),te=(0,c.dU)("gray.600","gray.400"),ne=(0,c.dU)("gray.50","gray.900"),ae=(0,c.dU)("white","gray.800"),ie=((0,c.dU)("gray.50","gray.700"),(0,c.dU)("blue.50","blue.900")),oe=(0,c.dU)("blue.200","blue.700"),[re,se]=(0,i.useState)([]),[le,ce]=(0,i.useState)([]),[de,ue]=(0,i.useState)(!1),[he,me]=(0,i.useState)(null),[pe,xe]=(0,i.useState)(!1),[ge,ve]=(0,i.useState)(null),je=i.useRef(null),be=(0,L.d)(),[ye,fe]=(0,i.useState)({name:"",position:"",email:"",phone:"",category_id:void 0,image_url:"",description:"",display_order:0,is_active:!0}),[ke,_e]=(0,i.useState)(!1),[we,ze]=(0,i.useState)({}),[Se,Ae]=(0,i.useState)(!1),[Ce,Ee]=(0,i.useState)([]),[Te,De]=(0,i.useState)({});(0,i.useEffect)(()=>{Ne(),Ie()},[]),(0,i.useEffect)(()=>{(async()=>{try{const e=await(0,B.xN)().catch(()=>[]),t={};(e||[]).forEach(e=>{const n=String((null===e||void 0===e?void 0:e.code)||"").trim(),a=String((null===e||void 0===e?void 0:e.alias)||"").trim();n&&a&&(t[n]=a)}),De(t)}catch(e){}})()},[]);const Ne=async()=>{ue(!0);try{const[t,n,a]=await Promise.all([(0,K.kK)(),(0,K.dq)(),(0,J.g)()]);if(se(t),ce(n),Ee(Array.isArray(null===a||void 0===a?void 0:a.competitions)?a.competitions:[]),0===(n||[]).length&&Array.isArray(null===a||void 0===a?void 0:a.competitions)&&a.competitions.length>0)try{const t=await(0,B.xN)().catch(()=>[]),n={};(t||[]).forEach(e=>{null!==e&&void 0!==e&&e.code&&null!==e&&void 0!==e&&e.alias&&(n[String(e.code)]=String(e.alias))});const i=new Set;for(const e of a.competitions){const t=String((null===e||void 0===e?void 0:e.code)||"").trim(),a=String((null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.code)||"").trim(),o=t&&n[t]?n[t]:a;o&&i.add(o)}const o=Array.from(i);if(o.length>0){let t=0;for(const a of o)try{await(0,K.Fv)({name:a,display_order:t,is_active:!0}),t+=10}catch(e){}const n=await(0,K.dq)();ce(n),be({title:"Kategorie dopln\u011bny",description:"Kategorie pro kontakty byly dopln\u011bny podle sout\u011b\u017e\xed klubu.",status:"success",duration:3e3})}}catch(e){}}catch(t){be({title:"Chyba p\u0159i na\u010d\xedt\xe1n\xed",description:"Nepoda\u0159ilo se na\u010d\xedst kontakty a kategorie",status:"error",duration:3e3})}finally{ue(!1)}},Re=(0,i.useMemo)(()=>{try{const e=new Set;for(const t of Ce||[]){const n=String((null===t||void 0===t?void 0:t.name)||"").trim();n&&e.add(n);const a=String((null===t||void 0===t?void 0:t.code)||"").trim(),i=a&&Te[a]?String(Te[a]).trim():"";i&&e.add(i)}return Array.from(e)}catch(e){return[]}},[Ce,Te]),Fe=(0,i.useMemo)(()=>{try{if(!Array.isArray(le))return[];if(0===(Re||[]).length)return le;const e=new Set(Re.map(e=>String(e))),t=le.filter(t=>e.has(String(t.name)));return t.length>0?t:le}catch(e){return le}},[le,Re]),Pe=e=>{e?(me(e),fe({name:e.name,position:e.position,email:e.email,phone:e.phone,category_id:e.category_id,image_url:e.image_url||"",description:e.description||"",display_order:e.display_order,is_active:e.is_active})):(me(null),fe({name:"",position:"",email:"",phone:"",category_id:void 0,image_url:"",description:"",display_order:10*re.length,is_active:!0})),xe(!0)},Ie=async()=>{try{const e=await(0,H.rC)();ze(e||{})}catch(e){console.error("Failed to load settings:",e)}},Me=e=>t=>{ze(n=>(0,a.A)((0,a.A)({},n),{},{[e]:t.target.value}))},Le=e=>t=>{const n=t.target.value,i=""===n?void 0:Number(n);ze(t=>(0,a.A)((0,a.A)({},t),{},{[e]:Number.isFinite(i)?i:void 0}))};return(0,X.jsx)(q.A,{children:(0,X.jsxs)(r.a,{p:6,bg:ne,minH:"100vh",children:[(0,X.jsx)(W.D,{size:"lg",mb:6,children:"Spr\xe1va kontakt\u016f"}),(0,X.jsxs)(I.t,{colorScheme:"blue",children:[(0,X.jsxs)(R.w,{children:[(0,X.jsx)(N.o,{children:"Kontakty"}),(0,X.jsx)(N.o,{children:"Mapa a adresa"})]}),(0,X.jsxs)(P.T,{children:[(0,X.jsxs)(F.K,{children:[(0,X.jsxs)(_.z,{justify:"space-between",mb:4,children:[(0,X.jsx)(U.E,{children:"Spravujte kontaktn\xed osoby va\u0161eho klubu"}),(0,X.jsx)(s.$,{leftIcon:(0,X.jsx)(O.GGD,{}),colorScheme:"blue",onClick:()=>Pe(),children:"P\u0159idat kontakt"})]}),(0,X.jsx)(r.a,{overflowX:"auto",bg:ae,borderRadius:"md",borderWidth:"1px",borderColor:Q,children:(0,X.jsxs)(S.X,{variant:"simple",children:[(0,X.jsx)(T.d,{children:(0,X.jsxs)(D.Tr,{children:[(0,X.jsx)(E.Th,{children:"Foto"}),(0,X.jsx)(E.Th,{children:"Jm\xe9no"}),(0,X.jsx)(E.Th,{children:"Pozice"}),(0,X.jsx)(E.Th,{children:"Sout\u011b\u017e"}),(0,X.jsx)(E.Th,{children:"Email"}),(0,X.jsx)(E.Th,{children:"Telefon"}),(0,X.jsx)(E.Th,{children:"Po\u0159ad\xed"}),(0,X.jsx)(E.Th,{children:"Stav"}),(0,X.jsx)(E.Th,{children:"Akce"})]})}),(0,X.jsxs)(A.N,{children:[re.map(e=>{var t;return(0,X.jsxs)(D.Tr,{children:[(0,X.jsx)(C.Td,{children:e.image_url?(0,X.jsx)(r.a,{as:"img",src:(0,V.V)(e.image_url),alt:e.name,boxSize:"40px",objectFit:"cover",borderRadius:"md"}):(0,X.jsx)(r.a,{boxSize:"40px",bg:"gray.200",borderRadius:"md",display:"flex",alignItems:"center",justifyContent:"center",children:(0,X.jsx)(O.JXP,{})})}),(0,X.jsx)(C.Td,{fontWeight:"bold",children:e.name}),(0,X.jsx)(C.Td,{children:e.position}),(0,X.jsx)(C.Td,{children:e.category_id?(0,X.jsx)(o.E,{colorScheme:"purple",children:(null===(t=le.find(t=>t.id===e.category_id))||void 0===t?void 0:t.name)||e.category_id}):(0,X.jsx)(U.E,{fontSize:"sm",color:"gray.500",children:"Bez kategorie"})}),(0,X.jsx)(C.Td,{children:e.email}),(0,X.jsx)(C.Td,{children:e.phone}),(0,X.jsx)(C.Td,{children:e.display_order}),(0,X.jsx)(C.Td,{children:(0,X.jsx)(o.E,{colorScheme:e.is_active?"green":"red",children:e.is_active?"Aktivn\xed":"Neaktivn\xed"})}),(0,X.jsx)(C.Td,{children:(0,X.jsxs)(_.z,{spacing:2,children:[(0,X.jsx)(l.K,{"aria-label":"Upravit",icon:(0,X.jsx)(O.SG1,{}),size:"sm",onClick:()=>Pe(e)}),(0,X.jsx)(l.K,{"aria-label":"Smazat",icon:(0,X.jsx)(O.IXo,{}),size:"sm",colorScheme:"red",onClick:()=>ve({type:"contact",id:e.id})})]})})]},e.id)}),0===re.length&&(0,X.jsx)(D.Tr,{children:(0,X.jsx)(C.Td,{colSpan:9,textAlign:"center",py:8,children:(0,X.jsx)(U.E,{color:"gray.500",children:"Zat\xedm \u017e\xe1dn\xe9 kontakty. P\u0159idejte sv\u016fj prvn\xed kontakt!"})})})]})]})})]}),(0,X.jsx)(F.K,{children:(0,X.jsxs)(w.T,{align:"stretch",spacing:6,children:[(0,X.jsxs)(r.a,{bg:Y,p:6,borderRadius:"lg",borderWidth:"1px",borderColor:Q,children:[(0,X.jsx)(W.D,{size:"md",mb:4,children:"Kontaktn\xed \xfadaje"}),(0,X.jsxs)(h.r,{columns:{base:1,md:2},spacing:4,children:[(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"Adresa"}),(0,X.jsx)(m.p,{bg:ee,value:we.contact_address||"",onChange:Me("contact_address"),placeholder:"Ulice a \u010d.p."})]}),(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"M\u011bsto"}),(0,X.jsx)(m.p,{bg:ee,value:we.contact_city||"",onChange:Me("contact_city"),placeholder:"M\u011bsto"})]}),(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"PS\u010c"}),(0,X.jsx)(m.p,{bg:ee,value:we.contact_zip||"",onChange:Me("contact_zip"),placeholder:"12345"})]}),(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"Zem\u011b"}),(0,X.jsx)(m.p,{bg:ee,value:we.contact_country||"",onChange:Me("contact_country"),placeholder:"\u010cesk\xe1 republika"})]}),(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"Telefon"}),(0,X.jsx)(m.p,{bg:ee,value:we.contact_phone||"",onChange:Me("contact_phone"),placeholder:"+420 123 456 789"})]}),(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"E-mail"}),(0,X.jsx)(m.p,{bg:ee,type:"email",value:we.contact_email||"",onChange:Me("contact_email"),placeholder:"kontakt@klub.cz"})]})]})]}),(0,X.jsxs)(r.a,{bg:Y,p:6,borderRadius:"lg",borderWidth:"1px",borderColor:Q,children:[(0,X.jsx)(W.D,{size:"md",mb:4,children:"Poloha na map\u011b"}),(0,X.jsx)($.A,{currentLatitude:we.location_latitude,currentLongitude:we.location_longitude,currentZoom:we.map_zoom_level,mapStyle:we.map_style||"positron",onMapStyleChange:e=>{ze(t=>(0,a.A)((0,a.A)({},t),{},{map_style:e}))},clubPrimaryColor:we.primary_color,clubSecondaryColor:we.accent_color,clubName:we.club_name,onImport:e=>{ze(t=>(0,a.A)((0,a.A)({},t),{},{location_latitude:e.latitude,location_longitude:e.longitude,map_zoom_level:e.zoom,contact_address:e.street||t.contact_address,contact_city:e.city||t.contact_city,contact_zip:e.zip||t.contact_zip,contact_country:e.country||t.contact_country})),be({title:"Sou\u0159adnice a adresa importov\xe1ny",description:"GPS poloha".concat(e.city?" a kontaktn\xed \xfadaje":""," byly na\u010dteny"),status:"success",duration:3e3})}}),(0,X.jsx)(U.E,{fontSize:"sm",color:te,mt:2,fontStyle:"italic",children:"Mapa se automaticky zobraz\xed na tituln\xed str\xe1nce p\u0159i nastaven\xed GPS sou\u0159adnic."})]}),(0,X.jsxs)(r.a,{bg:Y,p:6,borderRadius:"lg",borderWidth:"1px",borderColor:Q,children:[(0,X.jsx)(W.D,{size:"md",mb:4,children:"Ru\u010dn\xed nastaven\xed sou\u0159adnic"}),(0,X.jsxs)(h.r,{columns:{base:1,md:3},spacing:4,children:[(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"Zem\u011bpisn\xe1 \u0161\xed\u0159ka (Latitude)"}),(0,X.jsx)(m.p,{bg:ee,type:"number",step:"0.000001",value:null!==(e=we.location_latitude)&&void 0!==e?e:"",onChange:Le("location_latitude"),placeholder:"50.0947"}),(0,X.jsx)(d.eK,{fontSize:"xs",children:"Rozsah: -90 a\u017e 90"})]}),(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"Zem\u011bpisn\xe1 d\xe9lka (Longitude)"}),(0,X.jsx)(m.p,{bg:ee,type:"number",step:"0.000001",value:null!==(t=we.location_longitude)&&void 0!==t?t:"",onChange:Le("location_longitude"),placeholder:"17.6997"}),(0,X.jsx)(d.eK,{fontSize:"xs",children:"Rozsah: -180 a\u017e 180"})]}),(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"\xdarove\u0148 p\u0159ibl\xed\u017een\xed (Zoom)"}),(0,X.jsx)(m.p,{bg:ee,type:"number",min:"1",max:"20",value:null!==(n=we.map_zoom_level)&&void 0!==n?n:15,onChange:Le("map_zoom_level"),placeholder:"15"}),(0,X.jsx)(d.eK,{fontSize:"xs",children:"Rozsah: 1-20 (vy\u0161\u0161\xed = v\u011bt\u0161\xed p\u0159ibl\xed\u017een\xed)"})]})]})]}),(0,X.jsx)(r.a,{bg:ie,p:4,borderRadius:"md",borderWidth:"1px",borderColor:oe,children:(0,X.jsxs)(_.z,{justify:"space-between",align:"center",children:[(0,X.jsxs)(w.T,{align:"start",spacing:1,children:[(0,X.jsx)(U.E,{fontSize:"sm",fontWeight:"semibold",children:"\ud83d\udccd Nezapome\u0148te ulo\u017eit zm\u011bny"}),(0,X.jsx)(U.E,{fontSize:"xs",color:te,children:"Ulo\u017ete nastaven\xed, aby se zm\u011bny projevily na webu."})]}),(0,X.jsx)(s.$,{colorScheme:"blue",size:"lg",onClick:async()=>{Ae(!0);try{const e="number"===typeof we.location_latitude?we.location_latitude:void 0,t="number"===typeof we.location_longitude?we.location_longitude:void 0,n="number"===typeof we.map_zoom_level?we.map_zoom_level:void 0,a=void 0!==e&&void 0!==t,i={};void 0!==we.contact_address&&(i.contact_address=we.contact_address),void 0!==we.contact_city&&(i.contact_city=we.contact_city),void 0!==we.contact_zip&&(i.contact_zip=we.contact_zip),void 0!==we.contact_country&&(i.contact_country=we.contact_country),void 0!==we.contact_phone&&(i.contact_phone=we.contact_phone),void 0!==we.contact_email&&(i.contact_email=we.contact_email),void 0!==e&&(i.location_latitude=e),void 0!==t&&(i.location_longitude=t),void 0!==n&&(i.map_zoom_level=n),void 0!==we.map_style&&(i.map_style=we.map_style),i.show_map_on_homepage=a,await(0,H.CX)(i),be({title:"Nastaven\xed ulo\u017eeno",description:"Kontaktn\xed informace a mapa byly aktualizov\xe1ny",status:"success",duration:3e3})}catch(r){var e,t,n,a,i,o;const s=(null===r||void 0===r||null===(e=r.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.chyba)||(null===r||void 0===r||null===(n=r.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.detail)||(null===r||void 0===r||null===(i=r.response)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.error)||(null===r||void 0===r?void 0:r.message)||"Ulo\u017een\xed nastaven\xed se nezda\u0159ilo";console.error("Settings save error:",r),be({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed",description:s,status:"error",duration:5e3,isClosable:!0})}finally{Ae(!1)}},isLoading:Se,loadingText:"Ukl\xe1d\xe1m...",children:"Ulo\u017eit nastaven\xed"})]})})]})})]})]}),(0,X.jsxs)(y.aF,{isOpen:pe,onClose:()=>xe(!1),size:"xl",children:[(0,X.jsx)(b.m,{}),(0,X.jsxs)(f.$,{children:[(0,X.jsx)(j.r,{children:he?"Upravit kontakt":"P\u0159idat kontakt"}),(0,X.jsx)(g.s,{}),(0,X.jsx)(x.c,{children:(0,X.jsxs)(w.T,{spacing:4,children:[(0,X.jsxs)(d.MJ,{isRequired:!0,children:[(0,X.jsx)(u.l,{children:"Jm\xe9no"}),(0,X.jsx)(m.p,{value:ye.name,onChange:e=>fe((0,a.A)((0,a.A)({},ye),{},{name:e.target.value})),placeholder:"Jan Nov\xe1k"})]}),(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"Pozice"}),(0,X.jsx)(m.p,{value:ye.position,onChange:e=>fe((0,a.A)((0,a.A)({},ye),{},{position:e.target.value})),placeholder:"P\u0159edseda, Hlavn\xed tren\xe9r, atd."})]}),(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"Kategorie"}),(0,X.jsxs)(k.l,{value:ye.category_id||"",onChange:e=>fe((0,a.A)((0,a.A)({},ye),{},{category_id:e.target.value?parseInt(e.target.value):void 0})),children:[(0,X.jsx)("option",{value:"",children:"Bez p\u0159i\u0159azen\xed"}),Fe.map(e=>(0,X.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,X.jsx)(d.eK,{fontSize:"xs",children:"P\u0159i\u0159a\u010fte kontakt ke konkr\xe9tn\xed kategorii (podle sout\u011b\u017e\xed klubu)"})]}),(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"Email"}),(0,X.jsx)(m.p,{type:"email",value:ye.email,onChange:e=>fe((0,a.A)((0,a.A)({},ye),{},{email:e.target.value})),placeholder:"john@example.com"})]}),(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"Telefon"}),(0,X.jsx)(m.p,{value:ye.phone,onChange:e=>fe((0,a.A)((0,a.A)({},ye),{},{phone:e.target.value})),placeholder:"+420 123 456 789"})]}),(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"Fotografie"}),(0,X.jsxs)(w.T,{align:"stretch",spacing:3,children:[(0,X.jsx)(G.A,{label:"Fotografie kontaktu",description:"Nahrajte fotografii kontaktn\xed osoby (max. 5 MB).",accept:"image/*",multiple:!1,maxFiles:1,maxFileSizeMB:5,allowUrlImport:!1,uploadFn:async e=>{if(!e.type.startsWith("image/"))throw new Error("Nahrajte pros\xedm obr\xe1zkov\xfd soubor");_e(!0);try{const t=new FormData;t.append("file",e);const n=await(0,Z.V6)(t);return fe(e=>(0,a.A)((0,a.A)({},e),{},{image_url:n.url})),{url:n.url,name:e.name,type:e.type||"image/*",size:e.size}}catch(i){var t,n;const e=(null===i||void 0===i||null===(t=i.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nahr\xe1n\xed obr\xe1zku se nezda\u0159ilo";throw new Error(e)}finally{_e(!1)}}}),ye.image_url&&(0,X.jsx)(o.E,{colorScheme:"green",children:"Nahr\xe1no"})]}),ye.image_url&&(0,X.jsx)(r.a,{mt:2,children:(0,X.jsx)("img",{src:(0,V.V)(ye.image_url),alt:"N\xe1hled",style:{maxWidth:"200px",borderRadius:"8px"}})})]}),(0,X.jsxs)(d.MJ,{children:[(0,X.jsx)(u.l,{children:"Popis"}),(0,X.jsx)(M.T,{value:ye.description,onChange:e=>fe((0,a.A)((0,a.A)({},ye),{},{description:e.target.value})),placeholder:"Stru\u010dn\xfd popis nebo bio",rows:3})]}),(0,X.jsxs)(d.MJ,{display:"flex",alignItems:"center",children:[(0,X.jsx)(u.l,{mb:"0",children:"Aktivn\xed"}),(0,X.jsx)(z.d,{isChecked:ye.is_active,onChange:e=>fe((0,a.A)((0,a.A)({},ye),{},{is_active:e.target.checked}))})]})]})}),(0,X.jsxs)(v.j,{children:[(0,X.jsx)(s.$,{variant:"ghost",mr:3,onClick:()=>xe(!1),children:"Zru\u0161it"}),(0,X.jsx)(s.$,{colorScheme:"blue",onClick:async()=>{if(ye.name.trim()){ue(!0);try{he?(await(0,K.CI)(he.id,ye),be({title:"Kontakt aktualizov\xe1n",status:"success",duration:2e3})):(await(0,K.vY)(ye),be({title:"Kontakt vytvo\u0159en",status:"success",duration:2e3})),xe(!1),Ne()}catch(n){var e,t;be({title:"Chyba",description:(null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||"Ulo\u017een\xed kontaktu se nezda\u0159ilo",status:"error",duration:3e3})}finally{ue(!1)}}else be({title:"Chyba validace",description:"Jm\xe9no je povinn\xe9",status:"error",duration:3e3})},isLoading:de,children:he?"Aktualizovat":"Vytvo\u0159it"})]})]})]}),(0,X.jsx)(p.Lt,{isOpen:null!==ge,leastDestructiveRef:je,onClose:()=>ve(null),children:(0,X.jsx)(b.m,{children:(0,X.jsxs)(p.EO,{children:[(0,X.jsx)(j.r,{fontSize:"lg",fontWeight:"bold",children:"Smazat kontakt"}),(0,X.jsx)(x.c,{children:"Opravdu chcete smazat tento kontakt? Tuto akci nelze vr\xe1tit zp\u011bt."}),(0,X.jsxs)(v.j,{children:[(0,X.jsx)(s.$,{ref:je,onClick:()=>ve(null),children:"Zru\u0161it"}),(0,X.jsx)(s.$,{colorScheme:"red",onClick:()=>{ge&&(async e=>{ue(!0);try{await(0,K.MO)(e),be({title:"Kontakt smaz\xe1n",status:"success",duration:2e3}),Ne()}catch(t){be({title:"Chyba",description:"Smaz\xe1n\xed kontaktu se nezda\u0159ilo",status:"error",duration:3e3})}finally{ue(!1),ve(null)}})(ge.id)},ml:3,isLoading:de,children:"Smazat"})]})]})})})]})})}},78139:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var a=n(22107),i=n(98662),o=n(82459),r=n(25011),s=n(96148),l=n(10202),c=n(28846),d=n(39081),u=n(73216),h=n(35475),m=n(8860),p=n(27149),x=n(40378),g=n(70579);const v=()=>{const e=(0,u.Zp)();return(0,g.jsx)(x.A,{children:(0,g.jsx)(a.a,{minH:"60vh",display:"flex",alignItems:"center",justifyContent:"center",bgGradient:"linear(to-b, rgba(0,0,0,0.02), transparent)",px:6,children:(0,g.jsx)(a.a,{w:{base:"100%",sm:"560px"},textAlign:"center",bg:"white",_dark:{bg:"gray.800"},borderRadius:"xl",borderWidth:"1px",borderColor:"border.subtle",boxShadow:"md",p:{base:6,md:10},children:(0,g.jsxs)(l.T,{spacing:4,children:[(0,g.jsxs)(s.z,{spacing:3,color:"brand.primary",children:[(0,g.jsx)(r.I,{as:m.zIu,boxSize:8}),(0,g.jsx)(c.D,{as:"h1",size:"2xl",letterSpacing:"wide",children:"404"}),(0,g.jsx)(r.I,{as:p.oDq,boxSize:8})]}),(0,g.jsx)(c.D,{as:"h2",size:"lg",bgGradient:"linear(to-r, brand.primary, brand.accent)",bgClip:"text",children:"Str\xe1nka nenalezena"}),(0,g.jsx)(d.E,{color:"gray.600",_dark:{color:"gray.300"},children:"M\xed\u010d je mimo h\u0159i\u0161t\u011b \u2013 zkuste to znovu nebo vra\u0165te se."}),(0,g.jsx)(o.c,{}),(0,g.jsxs)(s.z,{spacing:3,pt:2,children:[(0,g.jsx)(i.$,{onClick:()=>e(-1),colorScheme:"blue",children:"Zp\u011bt"}),(0,g.jsx)(i.$,{as:h.N_,to:"/",variant:"outline",children:"Zp\u011bt na \xfavod"})]})]})})})})}},78715:(e,t,n)=>{n.r(t),n.d(t,{default:()=>W});var a=n(65043),i=n(35475),o=n(40378),r=n(87139),s=n(22107),l=n(98662),c=n(96351),d=n(42703),u=n(44093),h=n(98939),m=n(5371),p=n(43533),x=n(61724),g=n(76659),v=n(29904),j=n(30502),b=n(28846),y=n(39081),f=n(14261),k=n(63856),_=n(66981),w=n(92885),z=n(69023),S=n(66465),A=n(65757),C=n(92410),E=n(74912),T=n(1620),D=n(6175),N=n(38376),R=n(74117),F=n(70579);const P=["Mo","Tu","We","Th","Fr","Sa","Su"],I=(e,t)=>{if(!t)return"match"===e?"Z\xe1pas":"training"===e?"Tr\xe9nink":"meeting"===e?"Sch\u016fzka":"Jin\xe9";switch(e){case"match":return t("calendar.match_type");case"training":return t("calendar.training_type");case"meeting":return t("calendar.meeting_type");default:return t("calendar.other_type")}},M=e=>"match"===e?"red":"training"===e?"blue":"meeting"===e?"green":"gray",L=e=>{try{return(0,z.GP)(new Date(e),"yyyy-MM-dd")}catch(t){return e.slice(0,10)}},W=()=>{const{t:e}=(0,R.Bd)(),[t,n]=(0,a.useState)(!0),[W,U]=(0,a.useState)(null),[O,q]=(0,a.useState)([]),[K,B]=(0,a.useState)("all"),[Z,V]=(0,a.useState)("calendar"),H=((0,j.d)(),(0,u.dU)("gray.600","gray.300")),$=(0,u.dU)("gray.500","gray.400"),J=(0,u.dU)("rgba(0,0,0,0.08)","rgba(255,255,255,0.16)"),G=(0,u.dU)("white","gray.800"),X=(0,u.dU)("rgba(0,0,0,0.03)","rgba(255,255,255,0.08)"),Y=(0,u.dU)("gray.50","whiteAlpha.100"),Q=(0,u.dU)("rgba(59,130,246,0.08)","rgba(59,130,246,0.16)"),[ee,te]=(0,a.useState)((0,E.w)(new Date)),ne=(0,a.useMemo)(()=>{const e=(0,T.k)((0,E.w)(ee),{weekStartsOn:1}),t=[];for(let n=0;n<42;n++)t.push((0,_.f)(e,n));return t},[ee]),ae=(0,a.useMemo)(()=>"all"===K?O:O.filter(e=>e.type===K),[O,K]),ie=(0,a.useMemo)(()=>{const e=new Map;return ae.forEach(t=>{const n=L(t.start_time),a=t.end_time?L(t.end_time):n;if(n===a)return void e.set(n,[...e.get(n)||[],t]);const i=new Date(n),o=new Date(a);if(Number.isNaN(i.getTime())||Number.isNaN(o.getTime()))e.set(n,[...e.get(n)||[],t]);else for(let r=new Date(i);r.getTime()<=o.getTime();r.setDate(r.getDate()+1)){const n=(0,z.GP)(r,"yyyy-MM-dd");e.set(n,[...e.get(n)||[],t])}}),Array.from(e.keys()).forEach(t=>{const n=e.get(t)||[];n.sort((e,t)=>new Date(e.start_time).getTime()-new Date(t.start_time).getTime()),e.set(t,n)}),e},[ae]);(0,a.useEffect)(()=>{let t=!0;return(async()=>{n(!0),U(null);try{const e=(await(0,N.kQ)()||[]).map(e=>({id:e.id,title:e.title,start_time:e.start_time,end_time:e.end_time,location:e.location,type:e.type,image_url:e.image_url}));t&&q(e)}catch(a){t&&U((null===a||void 0===a?void 0:a.message)||e("message.error_occurred"))}finally{t&&n(!1)}})(),()=>{t=!1}},[]);const oe=ae.length>0;return(0,F.jsx)(o.A,{children:(0,F.jsxs)(h.m,{maxW:"7xl",py:{base:6,md:10},children:[(0,F.jsx)(b.D,{as:"h1",size:"xl",mb:2,children:e("nav.activities")}),(0,F.jsx)(y.E,{color:H,mb:6,children:e("calendar.activities_subtitle")}),(0,F.jsxs)(m.s,{align:"center",justify:"space-between",mb:3,gap:2,flexWrap:{base:"wrap",md:"nowrap"},children:[(0,F.jsx)(m.s,{align:"center",gap:2,children:(0,F.jsxs)(x.l,{size:"sm",value:K,onChange:e=>B(e.target.value),width:{base:"100%",sm:"220px"},children:[(0,F.jsx)("option",{value:"all",children:e("calendar.all_types")}),(0,F.jsx)("option",{value:"match",children:e("calendar.matches_filter")}),(0,F.jsx)("option",{value:"training",children:e("calendar.training_filter")}),(0,F.jsx)("option",{value:"meeting",children:e("calendar.meeting_filter")}),(0,F.jsx)("option",{value:"other",children:e("calendar.other_filter")})]})}),(0,F.jsxs)(c.e,{size:"sm",isAttached:!0,children:[(0,F.jsx)(l.$,{variant:"calendar"===Z?"solid":"outline",bg:"calendar"===Z?"brand.primary":void 0,color:"calendar"===Z?"text.onPrimary":void 0,_hover:{filter:"calendar"===Z?"brightness(0.95)":void 0,borderColor:"brand.primary",color:"calendar"===Z?"text.onPrimary":void 0},onClick:()=>V("calendar"),children:e("calendar.calendar_view")}),(0,F.jsx)(l.$,{variant:"list"===Z?"solid":"outline",bg:"list"===Z?"brand.primary":void 0,color:"list"===Z?"text.onPrimary":void 0,_hover:{filter:"list"===Z?"brightness(0.95)":void 0,borderColor:"brand.primary",color:"list"===Z?"text.onPrimary":void 0},onClick:()=>V("list"),children:e("calendar.list_view")})]})]}),t&&(0,F.jsxs)(m.s,{align:"center",gap:3,color:H,mb:6,children:[(0,F.jsx)(g.y,{size:"sm"}),(0,F.jsx)("span",{children:e("calendar.loading_activities")})]}),W&&(0,F.jsx)(s.a,{color:"red.400",mb:4,children:W}),!t&&!oe&&!W&&(0,F.jsx)(s.a,{color:H,children:e("calendar.no_activities")}),!t&&oe&&("calendar"===Z?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(m.s,{align:"center",justify:"space-between",mb:3,gap:2,flexWrap:{base:"wrap",md:"nowrap"},children:[(0,F.jsx)(d.K,{"aria-label":e("calendar.previous_month"),size:"sm",onClick:()=>te((0,w.P)(ee,-1)),icon:(0,F.jsx)(f.Y,{}),variant:"outline",_hover:{bg:"rgba(0,0,0,0.04)",borderColor:"brand.primary"}}),(0,F.jsx)(l.$,{size:"sm",onClick:()=>te(new Date),variant:"solid",bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},children:e("calendar.today")}),(0,F.jsx)(d.K,{"aria-label":e("calendar.next_month"),size:"sm",onClick:()=>te((0,w.P)(ee,1)),icon:(0,F.jsx)(k.v,{}),variant:"outline",_hover:{bg:"rgba(0,0,0,0.04)",borderColor:"brand.primary"}})]}),(0,F.jsx)(s.a,{overflowX:"auto",children:(0,F.jsx)(p.x,{templateColumns:"repeat(7, 1fr)",gap:3,minW:"980px",children:P.map(e=>(0,F.jsx)(s.a,{textAlign:"center",fontWeight:"semibold",color:H,fontSize:{base:"xs",md:"sm"},children:e},e))})}),(0,F.jsx)(s.a,{overflowX:"auto",children:(0,F.jsx)(p.x,{templateColumns:"repeat(7, 1fr)",gap:{base:1,md:2},minW:"980px",children:ne.map((t,n)=>{const a=(0,z.GP)(t,"yyyy-MM-dd"),o=ie.get(a)||[],l=!(0,A.t)(t,ee),c=(()=>{try{var e,n,a;const i=new Intl.DateTimeFormat("cs-CZ",{timeZone:"Europe/Prague",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date),o=null===(e=i.find(e=>"year"===e.type))||void 0===e?void 0:e.value,r=null===(n=i.find(e=>"month"===e.type))||void 0===n?void 0:n.value,s=null===(a=i.find(e=>"day"===e.type))||void 0===a?void 0:a.value;if(o&&r&&s){const e=(0,C.qg)("".concat(o,"-").concat(r,"-").concat(s),"yyyy-MM-dd",new Date);return(0,S.r)(t,e)}}catch(i){}return(0,S.r)(t,new Date)})();return(0,F.jsxs)(s.a,{borderWidth:"1px",borderColor:c?"brand.primary":J,borderRadius:"md",p:2,minH:"120px",minW:"130px",bg:c?Q:void 0,opacity:l?.6:1,children:[(0,F.jsxs)(m.s,{align:"center",justify:"space-between",mb:2,children:[(0,F.jsx)(y.E,{fontWeight:"bold",children:(0,z.GP)(t,"d")}),!!o.length&&(0,F.jsx)(r.E,{bg:"brand.primary",color:"text.onPrimary",borderRadius:"full",children:o.length})]}),(0,F.jsxs)(v.B,{spacing:2,children:[o.slice(0,3).map(t=>(0,F.jsxs)(s.a,{as:i.N_,to:"/aktivita/".concat(t.id),p:2,borderWidth:"1px",borderRadius:"md",_hover:{bg:"rgba(0,0,0,0.03)",borderColor:"brand.primary"},children:[(0,F.jsxs)(m.s,{align:"center",gap:2,children:[(0,F.jsx)(r.E,{colorScheme:M(t.type),children:I(t.type,e)}),(0,F.jsxs)(y.E,{fontSize:"xs",children:[(0,z.GP)(new Date(t.start_time),"HH:mm"),t.end_time&&!(0,S.r)(new Date(t.start_time),new Date(t.end_time))?" \u2013 ".concat((0,z.GP)(new Date(t.end_time),"d.M.")):t.end_time?" \u2013 ".concat((0,z.GP)(new Date(t.end_time),"HH:mm")):""]})]}),(0,F.jsx)(y.E,{fontSize:"sm",mt:1,children:t.title})]},t.id)),o.length>3&&(0,F.jsx)(y.E,{fontSize:"xs",color:$,children:e("calendar.more_events",{count:o.length-3})})]})]},n)})})})]}):(0,F.jsx)(v.B,{spacing:4,children:Array.from(ie.keys()).sort().map(t=>{const n=ie.get(t)||[];return(0,F.jsxs)(s.a,{borderWidth:"1px",borderColor:J,borderRadius:"md",overflow:"hidden",bg:G,children:[(0,F.jsx)(s.a,{px:3,py:2,bg:Y,borderLeftWidth:"4px",borderLeftColor:"brand.primary",children:(0,F.jsxs)(m.s,{align:"center",gap:2,children:[(0,F.jsx)(y.E,{fontWeight:"semibold",children:(0,z.GP)((0,C.qg)(t,"yyyy-MM-dd",new Date),"EEEE d. M. yyyy",{locale:D.cs})}),(0,F.jsx)(r.E,{colorScheme:"purple",borderRadius:"full",children:n.length})]})}),(0,F.jsx)(v.B,{spacing:3,children:n.map(t=>(0,F.jsxs)(m.s,{as:i.N_,to:"/aktivita/".concat(t.id),align:"center",justify:"space-between",p:3,borderWidth:"1px",borderColor:J,borderRadius:"md",bg:G,_hover:{bg:X,borderColor:"brand.primary"},children:[(0,F.jsxs)(m.s,{direction:"column",minW:"200px",children:[(0,F.jsxs)(y.E,{fontWeight:"semibold",children:[(0,z.GP)(new Date(t.start_time),"HH:mm"),t.end_time&&!(0,S.r)(new Date(t.start_time),new Date(t.end_time))?" \u2013 ".concat((0,z.GP)(new Date(t.end_time),"d.M. HH:mm")):t.end_time?" \u2013 ".concat((0,z.GP)(new Date(t.end_time),"HH:mm")):""]}),t.location&&(0,F.jsx)(y.E,{color:H,fontSize:"sm",children:t.location})]}),(0,F.jsxs)(m.s,{align:"center",gap:2,flex:"1",justify:"center",children:[(0,F.jsx)(r.E,{colorScheme:M(t.type),children:I(t.type,e)}),(0,F.jsx)(y.E,{children:t.title})]})]},t.id))})]},t)})}))]})})}},78801:(e,t,n)=>{n.d(t,{N:()=>u,n:()=>h});var a=n(65043),i=n(57550),o=n(40384),r=n(30458),s=n(60790),l=n(70579);const c={primary:"#0b5cff",secondary:"#ffd200",accent:"#141414",textOnPrimary:"#ffffff"},d=(0,a.createContext)(c),u=()=>(0,a.useContext)(d),h=e=>{let{children:t}=e;const{data:n}=(0,i.s)(),u=null===n||void 0===n?void 0:n.club_id,h=(null===n||void 0===n?void 0:n.club_type)||"football",[m,p]=(0,a.useState)(c),x=(0,a.useMemo)(()=>{if(!n)return null;return JSON.stringify({primary_color:n.primary_color,secondary_color:n.secondary_color,accent_color:n.accent_color,text_color:n.text_color,background_color:n.background_color,club_logo_url:n.club_logo_url,club_id:n.club_id,club_type:n.club_type,club_name:n.club_name})},[n]);(0,a.useEffect)(()=>{if(!x)return;let e=!0;return(async()=>{try{const d=null!==n&&void 0!==n&&n.primary_color&&""!==n.primary_color.trim()?n.primary_color:void 0,x=null!==n&&void 0!==n&&n.secondary_color&&""!==n.secondary_color.trim()?n.secondary_color:void 0,g=null!==n&&void 0!==n&&n.accent_color&&""!==n.accent_color.trim()?n.accent_color:void 0,v=null!==n&&void 0!==n&&n.text_color&&""!==n.text_color.trim()?n.text_color:void 0,j=null===n||void 0===n?void 0:n.club_logo_url,b=null===n||void 0===n?void 0:n.club_name,y=null!==n&&void 0!==n&&n.background_color&&""!==n.background_color.trim()?n.background_color:void 0;let f,k,_=d,w=x,z=g,S=v,A=j,C=b,E=y,T=v;if(!_||!w||!z||!A||!C){if((!A||!C)&&u)try{const e=await o.J.getClub(u,h);A=A||e.logo_url,C=C||e.name}catch(t){}let e=[];try{e=A?await(0,r.x_)(A,5):[]}catch(a){e=[]}_=_||e[0]||c.primary,w=w||e[1]||c.secondary,z=z||e.find(e=>"#ffffff"===(0,r.IK)(e))||"#1a1a1a"}if(S=S||(0,r.IK)(_),f=(0,r.IK)(w),k=(0,r.IK)(z),E=E||"#ffffff",T=T||(0,r.IK)(E),(0,r.Lv)(_,S)||(S=(0,r.IK)(_)),(0,r.Lv)(w,f)||(f=(0,r.IK)(w)),(0,r.Lv)(z,k)||(k=(0,r.IK)(z)),!j&&u)try{const e=await(0,s.JG)(String(u),C);e&&(A=e)}catch(i){}const D={primary:_,secondary:w,accent:z,textOnPrimary:S,textOnSecondary:f,textOnAccent:k,background:E,text:T,logoUrl:A,name:C};if(e&&(m.primary!==D.primary||m.secondary!==D.secondary||m.accent!==D.accent||m.textOnPrimary!==D.textOnPrimary||m.logoUrl!==D.logoUrl||m.name!==D.name)){p(D);const e=document.documentElement;e.style.setProperty("--club-primary",D.primary),e.style.setProperty("--club-secondary",D.secondary),e.style.setProperty("--club-accent",D.accent),e.style.setProperty("--club-text-on-primary",D.textOnPrimary),D.textOnSecondary&&e.style.setProperty("--club-text-on-secondary",D.textOnSecondary),D.textOnAccent&&e.style.setProperty("--club-text-on-accent",D.textOnAccent),e.style.setProperty("--club-bg-light",E),e.style.setProperty("--club-text-light",T);try{localStorage.setItem("club_theme_cache",JSON.stringify({primary:D.primary,secondary:D.secondary,accent:D.accent,textOnPrimary:D.textOnPrimary,textOnSecondary:D.textOnSecondary,textOnAccent:D.textOnAccent,background:E,text:T,timestamp:Date.now()}))}catch(l){}}}catch(d){console.warn("ClubTheme: Error updating theme:",d)}})(),()=>{e=!1}},[x]);const g=(0,a.useMemo)(()=>m,[m]);return(0,l.jsx)(d.Provider,{value:g,children:t})}},79219:(e,t,n)=>{n.d(t,{bM:()=>i,g6:()=>o,n7:()=>r,oQ:()=>l,ug:()=>s});var a=n(46291);const i=async()=>(await a.Ay.get("/clothing")).data.data,o=async()=>(await a.Ay.get("/admin/clothing")).data.data,r=async e=>(await a.Ay.post("/admin/clothing",e)).data,s=async(e,t)=>(await a.Ay.put("/admin/clothing/".concat(e),t)).data,l=async e=>{await a.Ay.delete("/admin/clothing/".concat(e))}},79708:()=>{},79787:(e,t,n)=>{n.d(t,{A:()=>d});n(65043);var a=n(25011),i=n(76659),o=n(96148),r=n(99956),s=n(39081),l=n(1009),c=n(70579);const d=e=>{let{status:t,lastSaved:n,compact:d=!1}=e;const{icon:u,text:h,color:m}=(()=>{switch(t){case"saving":return{icon:(0,c.jsx)(i.y,{size:"xs",color:"blue.500"}),text:"Ukl\xe1d\xe1n\xed...",color:"blue.500"};case"saved":return{icon:(0,c.jsx)(a.I,{as:l.YrT,color:"green.500"}),text:"Ulo\u017eeno",color:"green.500"};case"error":return{icon:(0,c.jsx)(a.I,{as:l.y3G,color:"orange.500"}),text:"Ulo\u017eeno lok\xe1ln\u011b",color:"orange.500"};default:return{icon:(0,c.jsx)(a.I,{as:l.Ohp,color:"gray.400"}),text:"\u010cek\xe1 se na zm\u011bny...",color:"gray.400"}}})(),p=(()=>{if(!n)return null;const e=new Date,t=Math.floor((e.getTime()-n.getTime())/1e3);return t<60?"p\u0159ed chv\xedl\xed":t<3600?"p\u0159ed ".concat(Math.floor(t/60)," min"):t<86400?"p\u0159ed ".concat(Math.floor(t/3600)," h"):n.toLocaleString("cs-CZ",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})})();return d?(0,c.jsx)(r.m,{label:p?"".concat(h," ").concat(p):h,hasArrow:!0,children:(0,c.jsx)(o.z,{spacing:1,children:u})}):(0,c.jsxs)(o.z,{spacing:2,fontSize:"sm",children:[u,(0,c.jsx)(s.E,{color:m,fontWeight:"medium",children:h}),p&&"saved"===t&&(0,c.jsx)(s.E,{color:"gray.500",fontSize:"xs",children:p})]})}},80275:(e,t,n)=>{n.r(t),n.d(t,{default:()=>d});n(65043);var a=n(73449),i=n(22107),o=n(98662),r=n(28846),s=n(39081),l=n(35475),c=n(70579);const d=()=>(0,c.jsx)(a.A,{children:(0,c.jsxs)(i.a,{className:"sparta-container sparta-section",py:20,textAlign:"center",children:[(0,c.jsx)(r.D,{as:"h1",fontSize:{base:"5xl",md:"6xl"},mb:4,textTransform:"uppercase",children:"404"}),(0,c.jsx)(s.E,{fontSize:{base:"lg",md:"xl"},mb:4,opacity:.9,children:"Oops! Str\xe1nka nebyla nalezena."}),(0,c.jsx)(s.E,{fontSize:"md",mb:8,opacity:.8,children:"Str\xe1nka, kterou hled\xe1te, byla pravd\u011bpodobn\u011b smaz\xe1na nebo p\u0159esunuta."}),(0,c.jsx)(o.$,{as:l.N_,to:"/",size:"lg",className:"sparta-button-primary",children:"Zp\u011bt na \xfavodn\xed str\xe1nku"})]})})},80309:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(65043),i=n(25189),o=n(46291),r=n(70579);const s=e=>{let{layout:t="grid",theme:n="light"}=e;const[s,l]=(0,a.useState)([]),[c,d]=(0,a.useState)(!0);if((0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await fetch("".concat(o.API_URL,"/sponsors"));if(t.ok){const n=await t.json();if(!e&&Array.isArray(n)){const e=n.map(e=>({id:e.id,name:e.name,logo:(0,i.uq)(e.logo_url)||"/images/sponsors/placeholder.png",url:e.website_url||void 0,tier:e.tier,display_order:"number"===typeof e.display_order?e.display_order:void 0}));return l(e),void d(!1)}}}catch(t){}try{const t=await fetch((e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(o.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}})("/cache/prefetch/settings.json"),{cache:"no-cache"});if(t.ok){const n=await t.json();if(!e){const e=(null===n||void 0===n?void 0:n.sponsors)||(null===n||void 0===n?void 0:n.partners)||[];Array.isArray(e)&&e.length&&l(e.map((e,t)=>{var n;return{id:null!==(n=e.id)&&void 0!==n?n:t+1,name:e.name||"Sponsor",logo:(0,i.uq)(e.logo_url||e.logoUrl||e.logo)||"/images/sponsors/placeholder.png",url:e.url||e.website||e.link||"#",tier:e.tier,display_order:"number"===typeof e.display_order?e.display_order:void 0}}))}}}catch(n){}e||d(!1)})(),()=>{e=!0}},[]),c||0===s.length)return null;const u=[...s].sort((e,t)=>{var n,a;const i="general"===e.tier?0:1,o="general"===t.tier?0:1;if(i!==o)return i-o;const r=null!==(n=e.display_order)&&void 0!==n?n:9999,s=null!==(a=t.display_order)&&void 0!==a?a:9999;return r!==s?r-s:String(e.name||"").localeCompare(String(t.name||""))}),h=u.find(e=>"general"===e.tier)||u[0],m=u.filter(e=>e!==h);return(0,r.jsxs)("section",{className:"sponsors ".concat("dark"===n?"dark":""),style:{width:"100vw",position:"relative",left:"50%",right:"50%",transform:"translateX(-50%)",paddingLeft:"max(16px, calc((100vw - 1200px) / 2))",paddingRight:"max(16px, calc((100vw - 1200px) / 2))",boxSizing:"border-box",marginTop:"32px",marginBottom:"32px"},children:[(0,r.jsx)("div",{className:"section-head",children:(0,r.jsx)("h3",{children:"Sponzo\u0159i"})}),"grid"===t?(0,r.jsxs)(r.Fragment,{children:[h&&(0,r.jsx)("div",{className:"title-sponsor",children:(0,r.jsx)("a",{className:"sponsor-tile",href:h.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,r.jsx)("img",{src:h.logo,alt:h.name})})}),(0,r.jsx)("div",{className:"divider","aria-hidden":!0}),(0,r.jsx)("div",{className:"sponsors-grid",children:m.map(e=>(0,r.jsx)("a",{className:"sponsor-tile",href:e.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,r.jsx)("img",{src:e.logo,alt:e.name})},e.id))})]}):(0,r.jsx)("div",{className:"sponsors-slider",children:(0,r.jsx)("div",{className:"track",children:[...s,...s].map((e,t)=>(0,r.jsx)("a",{className:"sponsor-tile",href:e.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,r.jsx)("img",{src:e.logo,alt:e.name})},"".concat(e.id,"-").concat(t)))})})]})}},80348:()=>{},81398:(e,t,n)=>{n.d(t,{A:()=>o});n(65043);var a=n(2210),i=n(70579);const o=()=>(0,i.jsx)("section",{className:"newsletter-cta",style:{marginTop:24,marginBottom:24},children:(0,i.jsx)("div",{className:"card",style:{maxWidth:960,margin:"0 auto"},children:(0,i.jsx)(a.default,{})})})},82047:(e,t,n)=>{n.d(t,{$n:()=>d,PI:()=>s,UQ:()=>r,Up:()=>u,g7:()=>l,py:()=>c,sx:()=>i,w:()=>o});var a=n(40548);const i=(e,t)=>{"undefined"!==typeof window&&window.umami&&window.umami.track(e,t),(0,a.sx)({event_type:e,page:"undefined"!==typeof window?window.location.pathname:void 0,data:t}).catch(e=>{console.debug("Backend tracking failed:",e)})},o=function(e){i("Form Submit",{form:e,success:!(arguments.length>1&&void 0!==arguments[1])||arguments[1]})},r=(e,t)=>{i("Navigation",{destination:e,source:t||window.location.pathname})},s=(e,t)=>{i("Article View",{id:e,title:t})},l=e=>{i("Match View",{id:e})},c=(e,t)=>{i("Video Play",{id:e,title:t})},d=e=>{i("Newsletter Subscribe",{source:e||window.location.pathname})},u=function(){i("Contact Form",{success:!(arguments.length>0&&void 0!==arguments[0])||arguments[0]})}},82501:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(89379),i=(n(65043),n(1009)),o=n(56644),r=n(25189),s=n(70579);const l=e=>{let{data:t,competitionName:n,countdown:l,onPrev:c,onNext:d,onOpen:u,elementProps:h}=e;const m=t;return(0,s.jsxs)("section",(0,a.A)((0,a.A)({className:"next-match"},h),{},{role:u?"button":"region","aria-label":"Dal\u0161\xed z\xe1pas: ".concat((0,r.Lt)((null===m||void 0===m?void 0:m.home)||"")," vs ").concat((0,r.Lt)((null===m||void 0===m?void 0:m.away)||"")).concat(n?", ".concat(n):""),tabIndex:u?0:-1,onKeyDown:e=>{u&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),null===u||void 0===u||u()))},onClick:e=>{e.stopPropagation(),null===u||void 0===u||u()},style:(0,a.A)({cursor:u?"pointer":"default",position:"relative"},(null===h||void 0===h?void 0:h.style)||{}),children:[c&&(0,s.jsx)("button",{"aria-label":"P\u0159edchoz\xed sout\u011b\u017e",type:"button",onClick:e=>{e.stopPropagation(),null===c||void 0===c||c()},className:"nav prev",style:{background:"transparent",border:"none",color:"var(--text-on-primary)"},children:(0,s.jsx)(i.irw,{size:24})}),(0,s.jsxs)("div",{className:"team",children:[(0,s.jsx)(o.L,{className:"logo",teamId:null===m||void 0===m?void 0:m.home_id,teamName:null===m||void 0===m?void 0:m.home,facrLogo:null===m||void 0===m?void 0:m.home_logo_url,size:"custom",alt:"Dom\xe1c\xed",borderRadius:"full"}),(0,s.jsx)("div",{children:(0,r.Lt)((null===m||void 0===m?void 0:m.home)||"")})]}),(0,s.jsxs)("div",{className:"countdown",children:[n&&(0,s.jsx)("div",{style:{fontSize:"0.8rem",opacity:.85,marginBottom:4},children:n}),l||"\u2014",(0,s.jsx)("div",{style:{fontSize:"0.8rem",opacity:.85},children:"Za\u010d\xe1tek z\xe1pasu"})]}),(0,s.jsxs)("div",{className:"team",children:[(0,s.jsx)(o.L,{className:"logo",teamId:null===m||void 0===m?void 0:m.away_id,teamName:null===m||void 0===m?void 0:m.away,facrLogo:null===m||void 0===m?void 0:m.away_logo_url,size:"custom",alt:"Host\xe9",borderRadius:"full"}),(0,s.jsx)("div",{children:(0,r.Lt)((null===m||void 0===m?void 0:m.away)||"")})]}),d&&(0,s.jsx)("button",{"aria-label":"Dal\u0161\xed sout\u011b\u017e",type:"button",onClick:e=>{e.stopPropagation(),null===d||void 0===d||d()},className:"nav next",style:{background:"transparent",border:"none",color:"var(--text-on-primary)"},children:(0,s.jsx)(i.fOo,{size:24})})]}))}},82787:(e,t,n)=>{n.r(t),n.d(t,{default:()=>g});var a=n(65043),i=n(6583),o=n(22107),r=n(98662),s=n(73225),l=n(76668),c=n(35699),d=n(10202),u=n(30502),h=n(28846),m=n(39081),p=n(46291),x=n(70579);const g=()=>{const[e,t]=(0,a.useState)(""),[n,g]=(0,a.useState)(!1),[v,j]=(0,a.useState)(!1),b=(0,u.d)();return(0,x.jsx)(i.A,{children:(0,x.jsxs)(o.a,{maxW:"lg",children:[(0,x.jsx)(h.D,{size:"md",mb:4,children:"Odeslat reset hesla"}),(0,x.jsx)(m.E,{fontSize:"sm",color:"gray.600",mb:3,children:"Tato akce ode\u0161le u\u017eivateli e-mail s odkazem pro nastaven\xed nov\xe9ho hesla. Pou\u017eije se speci\xe1ln\xed SMTP konfigurace ur\u010den\xe1 pouze pro reset."}),(0,x.jsxs)(d.T,{as:"form",onSubmit:async t=>{t.preventDefault(),g(!0);try{await p.Ay.post("/admin/users/send-reset",{email:e}),j(!0),b({status:"success",title:"Odesl\xe1no",description:"Pokud \xfa\u010det existuje, byl odesl\xe1n e-mail pro reset hesla."})}catch(i){var n,a;b({status:"error",title:"Chyba",description:(null===(n=i.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.error)||"Nepoda\u0159ilo se odeslat e-mail."})}finally{g(!1)}},spacing:4,align:"stretch",children:[(0,x.jsxs)(s.MJ,{isRequired:!0,children:[(0,x.jsx)(l.l,{children:"Email u\u017eivatele"}),(0,x.jsx)(c.p,{type:"email",value:e,onChange:e=>t(e.target.value),placeholder:"uzivatel@example.com"})]}),(0,x.jsx)(r.$,{colorScheme:"blue",type:"submit",isLoading:n,children:"Odeslat e-mail"}),v&&(0,x.jsx)(m.E,{color:"green.600",children:"Pokud adresa existuje, e-mail s odkazem byl odesl\xe1n."})]})]})})}},85203:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Y});var a=n(89379),i=n(65043),o=n(30502),r=n(44093),s=n(22107),l=n(88787),c=n(85871),d=n(33430),u=n(34334),h=n(96870),m=n(28846),p=n(39081),x=n(5371),g=n(10202),v=n(73225),j=n(76668),b=n(96148),y=n(35699),f=n(98662),k=n(19077),_=n(47781),w=n(76659),z=n(80511),S=n(3313),A=n(55395),C=n(83201),E=n(82595),T=n(67813),D=n(87139),N=n(42703),R=n(78460),F=n(11054),P=n(85421),I=n(15071),M=n(35929),L=n(67516),W=n(56529),U=n(59781),O=n(72526),q=n(12836),K=n(1009),B=n(6583),Z=n(46291);async function V(){const e=await Z.Ay.get("/admin/manual/competitions");return Array.isArray(e.data)?e.data:e.data.data}var H=n(57550),$=n(88500),J=n(35200),G=n(2367),X=n(70579);const Y=()=>{const e=(0,o.d)(),t=(0,U.jE)(),n=(0,r.dU)("white","gray.800"),Y=(0,r.dU)("gray.200","gray.700"),{data:Q}=(0,H.s)(),ee=(((null===Q||void 0===Q?void 0:Q.club_data_mode)||"").toLowerCase(),"true"==={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"/api/v1",REACT_APP_ASSET_BASE_URL:"http://127.0.0.1:8080",REACT_APP_NAME:"Fotbal Club Manager",REACT_APP_ENV:"development",REACT_APP_FACR_API_BASE_URL:"/api/v1/facr",REACT_APP_FACR_API_TIMEOUT:"5000 # 5 seconds",REACT_APP_FACR_CACHE_TTL:"3600000 # 1 hour in milliseconds",REACT_APP_HOMEPAGE_LAYOUT:"classic",REACT_APP_ESHOP_URL:"http://localhost:3100",REACT_APP_ERROR_INGEST_URL:"http://127.0.0.1:8083/api/v1/errors",REACT_APP_ERROR_INGEST_TOKEN:""}.REACT_APP_MANUAL_FACR_MODE),{confirm:te}=(0,J.G)();if(!ee)return(0,X.jsx)(s.a,{maxW:"1400px",mx:"auto",p:6,children:(0,X.jsxs)(l.F,{status:"warning",borderRadius:"md",children:[(0,X.jsx)(c._,{}),(0,X.jsxs)(s.a,{children:[(0,X.jsx)(d.X,{children:"Manu\xe1ln\xed FA\u010cR re\u017eim nen\xed aktivn\xed"}),(0,X.jsx)(u.T,{children:"Tato str\xe1nka je dostupn\xe1 pouze p\u0159i zapnut\xe9m manu\xe1ln\xedm FA\u010cR re\u017eimu. Kontaktujte administr\xe1tora pro aktivaci t\xe9to funkce."})]})]})});const{data:ne,isLoading:ae,refetch:ie}=(0,O.I)({queryKey:["manual-competitions"],queryFn:V}),oe=(0,i.useMemo)(()=>ne||[],[ne]),[re,se]=(0,i.useState)(null),[le,ce]=(0,i.useState)({code:"",name:"",external_id:"",team_count:""}),[de,ue]=(0,i.useState)(""),[he,me]=(0,i.useState)(""),[pe,xe]=(0,i.useState)(""),[ge,ve]=(0,i.useState)(!1),[je,be]=(0,i.useState)(!1),[ye,fe]=(0,i.useState)(null),{isOpen:ke,onOpen:_e,onClose:we}=(0,h.j)(),ze=()=>{se(null),ce({code:"",name:"",external_id:"",team_count:""}),ue("")},Se=(0,q.n)({mutationFn:async()=>{var e;const t={code:le.code.trim(),name:le.name.trim(),external_id:le.external_id.trim(),team_count:(null===(e=le.team_count)||void 0===e?void 0:e.trim())||void 0};if(!t.code||!t.name||!t.external_id)throw new Error("K\xf3d, n\xe1zev a external_id jsou povinn\xe9.");return null!=re?async function(e,t){const n=await Z.Ay.put("/admin/manual/competitions/".concat(e),t);return n.data.id?n.data:n.data.data}(re,t):async function(e){const t=await Z.Ay.post("/admin/manual/competitions",e);return t.data.id?t.data:t.data.data}(t)},onSuccess:async()=>{e({title:"Sout\u011b\u017e ulo\u017eena",status:"success"}),ze(),await t.invalidateQueries({queryKey:["manual-competitions"]})},onError:t=>{e({title:"Ulo\u017een\xed selhalo",description:(null===t||void 0===t?void 0:t.message)||"Zkuste to pros\xedm znovu.",status:"error"})}}),Ae=(0,q.n)({mutationFn:async e=>{await async function(e){await Z.Ay.delete("/admin/manual/competitions/".concat(e))}(e)},onSuccess:async()=>{e({title:"Sout\u011b\u017e smaz\xe1na",status:"success"}),await t.invalidateQueries({queryKey:["manual-competitions"]}),null!=re&&ze()},onError:t=>{e({title:"Smaz\xe1n\xed selhalo",description:(null===t||void 0===t?void 0:t.message)||"Zkuste to pros\xedm znovu.",status:"error"})}}),Ce=e=>{const t="matches"===e?function(){const e=(Z.API_URL||"").replace(/\/$/,"");return"".concat(e,"/admin/manual/matches/template")}():function(){const e=(Z.API_URL||"").replace(/\/$/,"");return"".concat(e,"/admin/manual/tables/template")}();window.open(t,"_blank"),fe(e),_e()};return(0,X.jsxs)(B.A,{requireAdmin:!0,children:[(0,X.jsxs)(s.a,{maxW:"1400px",mx:"auto",children:[(0,X.jsxs)(s.a,{mb:6,children:[(0,X.jsx)(m.D,{size:"lg",mb:1,children:"Krok 2/2: Manu\xe1ln\xed data sout\u011b\u017e\xed (FA\u010cR)"}),(0,X.jsx)(p.E,{color:"gray.600",fontSize:"xs",mb:1,children:"Po \xfavodn\xedm nastaven\xed (krok 1) zde nahrajete z\xe1pasy a tabulky z CSV / Excel (XLSX) soubor\u016f nebo JSON payload\u016f, aby se zobrazovaly na webu."}),(0,X.jsx)(p.E,{color:"gray.600",fontSize:"sm",children:"Zde m\u016f\u017eete spravovat sout\u011b\u017ee, do kter\xfdch v\xe1\u0161 klub pat\u0159\xed, a hromadn\u011b importovat z\xe1pasy i tabulky z CSV nebo Excelu (XLSX). V manu\xe1ln\xedm re\u017eimu backend nevol\xe1 FACR / fotbal.cz \u2013 ve\u0161ker\xe1 data poch\xe1z\xed z t\u011bchto ru\u010dn\xedch vstup\u016f."})]}),(0,X.jsxs)(l.F,{status:"info",borderRadius:"md",mb:6,children:[(0,X.jsx)(c._,{}),(0,X.jsxs)(s.a,{children:[(0,X.jsx)(d.X,{children:"Jak postupovat"}),(0,X.jsxs)(u.T,{fontSize:"sm",children:["1) P\u0159idejte sout\u011b\u017ee (k\xf3d, n\xe1zev, extern\xed ID z odkazu na sout\u011b\u017e). 2) St\xe1hn\u011bte si XLSX \u0161ablony pro z\xe1pasy a tabulky, otev\u0159ete je v Excelu / Google Sheets, dopl\u0148te data a soubor pak nahrajte zp\u011bt jako XLSX nebo p\u0159\xedpadn\u011b ulo\u017ete do CSV \u2013 import podporuje oba form\xe1ty. Sloupec ",(0,X.jsx)("code",{children:"kod_souteze"})," nebo ",(0,X.jsx)("code",{children:"id_souteze_uuid"})," mus\xed odpov\xeddat zde zalo\u017een\xfdm sout\u011b\u017e\xedm."]})]})]}),(0,X.jsxs)(x.s,{gap:6,align:"flex-start",direction:{base:"column",lg:"row"},children:[(0,X.jsxs)(s.a,{flex:"1",bg:n,borderWidth:"1px",borderColor:Y,borderRadius:"lg",p:6,children:[(0,X.jsx)(m.D,{size:"md",mb:4,children:re?"Upravit sout\u011b\u017e":"Nov\xe1 sout\u011b\u017e"}),(0,X.jsx)("form",{onSubmit:e=>{e.preventDefault(),Se.mutate()},children:(0,X.jsxs)(g.T,{align:"stretch",spacing:4,children:[(0,X.jsxs)(v.MJ,{children:[(0,X.jsx)(j.l,{children:"Vlo\u017eit v\u0161e z FACR \u0159\xe1dku"}),(0,X.jsxs)(b.z,{align:"flex-start",spacing:2,children:[(0,X.jsx)(y.p,{value:de,onChange:e=>ue(e.target.value),placeholder:"A1A SATUM 5. liga mu\u017e\u016f 16"}),(0,X.jsx)(f.$,{size:"sm",onClick:()=>{const t=(e=>{const t=(e||"").trim();if(!t)return null;const n=t.split(/\r?\n/).map(e=>e.trim()).filter(e=>""!==e);if(n.length>=3){const e=n[0],t=n[n.length-1],a=n.slice(1,n.length-1).join(" "),i=t.match(/^\d{1,3}$/),o=i?i[0]:void 0;return e&&a?{code:e,name:a,teamCount:o}:null}const a=t.replace(/\t+/g," ").split(/\s+/).filter(e=>""!==e);if(a.length<2)return null;const i=a[0];let o;const r=a[a.length-1];/^\d{1,3}$/.test(r)&&(o=r,a.pop());const s=a.slice(1).join(" ").trim();return i&&s?{code:i,name:s,teamCount:o}:null})(de);t?ce(e=>{var n;return(0,a.A)((0,a.A)({},e),{},{code:t.code||e.code,name:t.name||e.name,team_count:null!==(n=t.teamCount)&&void 0!==n?n:e.team_count})}):e({title:"Nelze rozpoznat sout\u011b\u017e",description:'Zkontrolujte form\xe1t. O\u010dek\xe1v\xe1 se nap\u0159\xedklad "A1A SATUM 5. liga mu\u017e\u016f 16" nebo t\u0159i \u0159\xe1dky: k\xf3d, n\xe1zev, po\u010det t\xfdm\u016f.',status:"warning"})},children:"Vyplnit pole"})]}),(0,X.jsx)(v.eK,{fontSize:"xs",children:"Vlo\u017ete \u0159\xe1dek z tabulky \u201eNov\xe1 sout\u011b\u017e\u201c (k\xf3d, n\xe1zev, po\u010det t\xfdm\u016f). Podporov\xe1no je i v\xedce\u0159\xe1dkov\xe9 vlo\u017een\xed: prvn\xed \u0159\xe1dek k\xf3d, druh\xfd n\xe1zev, t\u0159et\xed po\u010det t\xfdm\u016f."})]}),(0,X.jsxs)(v.MJ,{isRequired:!0,children:[(0,X.jsx)(j.l,{children:"K\xf3d sout\u011b\u017ee (nap\u0159. A1A)"}),(0,X.jsx)(y.p,{value:le.code,onChange:e=>ce(t=>(0,a.A)((0,a.A)({},t),{},{code:e.target.value})),placeholder:"K\xf3d sout\u011b\u017ee (FACR)"})]}),(0,X.jsxs)(v.MJ,{isRequired:!0,children:[(0,X.jsx)(j.l,{children:"N\xe1zev sout\u011b\u017ee"}),(0,X.jsx)(y.p,{value:le.name,onChange:e=>ce(t=>(0,a.A)((0,a.A)({},t),{},{name:e.target.value})),placeholder:"Nap\u0159. SATUM 5. liga mu\u017e\u016f"})]}),(0,X.jsxs)(v.MJ,{isRequired:!0,children:[(0,X.jsx)(j.l,{children:(0,X.jsxs)(b.z,{spacing:2,align:"center",children:[(0,X.jsx)(s.a,{as:"span",children:"Extern\xed ID sout\u011b\u017ee (UUID z odkazu)"}),(0,X.jsx)(G.tX,{label:"N\xe1pov\u011bda k extern\xedmu ID sout\u011b\u017ee",title:"Jak z\xedskat extern\xed ID (UUID) sout\u011b\u017ee",items:["Pou\u017eijte libovoln\xfd odkaz na sout\u011b\u017e na fotbal.cz (nap\u0159. se segmentem /zapas/, /hlavni/ nebo /table/).","M\u016f\u017eete vlo\u017eit cel\xfd odkaz \u2013 syst\xe9m z n\u011bj automaticky vybere samotn\xe9 UUID.","UUID pak slou\u017e\xed k vygenerov\xe1n\xed odkaz\u016f na z\xe1pasy i tabulku dan\xe9 sout\u011b\u017ee."]})]})}),(0,X.jsx)(y.p,{value:le.external_id,onChange:e=>ce(t=>(0,a.A)((0,a.A)({},t),{},{external_id:e.target.value})),placeholder:"UUID nebo cel\xfd odkaz na sout\u011b\u017e z fotbal.cz"}),(0,X.jsxs)(v.eK,{fontSize:"xs",children:["Nap\u0159. z adresy",(0,X.jsx)("code",{children:" https://www.fotbal.cz/souteze/turnaje/hlavni/e3127865-a109-45cd-9048-3e6429e2eb11"}),"nebo",(0,X.jsx)("code",{children:" https://www.fotbal.cz/souteze/turnaje/table/e3127865-a109-45cd-9048-3e6429e2eb11"}),"sta\u010d\xed vlo\u017eit cel\xfd odkaz \u2013 UUID se vybere automaticky."]})]}),(0,X.jsxs)(v.MJ,{children:[(0,X.jsx)(j.l,{children:"Po\u010det t\xfdm\u016f (voliteln\xe9)"}),(0,X.jsx)(y.p,{value:le.team_count,onChange:e=>ce(t=>(0,a.A)((0,a.A)({},t),{},{team_count:e.target.value})),placeholder:"Nap\u0159. 14"})]}),(0,X.jsxs)(b.z,{spacing:3,pt:2,children:[(0,X.jsx)(f.$,{type:"submit",colorScheme:"blue",leftIcon:(0,X.jsx)(K.Bc_,{}),isLoading:Se.isPending,children:re?"Ulo\u017eit zm\u011bny":"P\u0159idat sout\u011b\u017e"}),null!=re&&(0,X.jsx)(f.$,{variant:"outline",onClick:ze,children:"Zru\u0161it \xfapravy"}),(0,X.jsx)(f.$,{variant:"ghost",leftIcon:(0,X.jsx)(K.wO2,{}),onClick:()=>ie(),children:"Obnovit seznam"})]})]})}),(0,X.jsxs)(s.a,{mt:4,children:[(0,X.jsxs)(p.E,{fontSize:"sm",color:"gray.600",mb:2,children:["Pokro\u010dil\xe9: m\u016f\u017eete tak\xe9 vlo\u017eit JSON payload (nap\u0159. ",(0,X.jsx)("code",{children:'{"items":[{"competition_code":"A1A","round":"1. kolo",...}]}'}),") podle API sch\xe9matu a importovat jej p\u0159\xedmo."]}),(0,X.jsx)(k.T,{rows:4,value:he,onChange:e=>me(e.target.value),placeholder:'{"items":[{"competition_code":"A1A","round":"1. kolo",...}]}'}),(0,X.jsxs)(b.z,{spacing:3,mt:2,children:[(0,X.jsx)(f.$,{size:"sm",leftIcon:(0,X.jsx)(K.B88,{}),onClick:async()=>{const n=he.trim();if(!n)return void e({title:"Vlo\u017ete JSON payload pro import z\xe1pas\u016f",status:"warning"});let a;try{a=JSON.parse(n)}catch(i){return void e({title:"Neplatn\xfd JSON",description:"Zkontrolujte pros\xedm syntaxi JSON payloadu.",status:"error"})}ve(!0);try{const n=await async function(e){const t=(await Z.Ay.post("/admin/manual/matches/import-json",e)).data||{};return{imported:"number"===typeof t.imported?t.imported:0,updated:"number"===typeof t.updated?t.updated:0,errors:Array.isArray(t.errors)?t.errors:[]}}(a);e({title:"JSON import z\xe1pas\u016f dokon\u010den",description:"Nov\u011b: ".concat(n.imported,", aktualizov\xe1no: ").concat(n.updated,"."),status:"success",duration:6e3,isClosable:!0}),n.errors&&n.errors.length&&console.warn("Chyby JSON importu z\xe1pas\u016f:",n.errors),await t.invalidateQueries({queryKey:["manual-competitions"]})}catch(i){e({title:"JSON import z\xe1pas\u016f selhal",description:(null===i||void 0===i?void 0:i.message)||"Zkontrolujte form\xe1t JSON payloadu.",status:"error"})}finally{ve(!1)}},isLoading:ge,colorScheme:"purple",children:"Importovat JSON"}),(0,X.jsx)(f.$,{size:"sm",variant:"ghost",onClick:()=>me('{\n "items": [\n {\n "competition_code": "A1A",\n "competition_external_id": "",\n "round": "1. kolo",\n "is_home": "home",\n "opponent_name": "FC Host\xe9",\n "opponent_club_link": "https://www.fotbal.cz/klub/...",\n "external_match_id": "MATCH-1",\n "kickoff_date": "2024-08-01",\n "kickoff_time": "17:00",\n "score_fulltime": "",\n "score_halftime": "",\n "match_link": "",\n "venue": "Dom\xe1c\xed stadion",\n "note": ""\n }\n ]\n}'),children:"Vlo\u017eit uk\xe1zku"})]})]})]}),(0,X.jsxs)(g.T,{flex:"1",spacing:6,align:"stretch",children:[(0,X.jsxs)(s.a,{bg:n,borderWidth:"1px",borderColor:Y,borderRadius:"lg",p:6,children:[(0,X.jsx)(m.D,{size:"md",mb:3,children:"Import z\xe1pas\u016f z Excelu (XLSX) nebo CSV"}),(0,X.jsxs)(p.E,{fontSize:"sm",color:"gray.600",mb:1,children:["XLSX \u0161ablona obsahuje list ",(0,X.jsx)("code",{children:"Z\xe1pasy"})," se sloupci pro v\u0161echny sout\u011b\u017ee, list ",(0,X.jsx)("code",{children:"Souteze"}),"s p\u0159ehledem sout\u011b\u017e\xed a list ",(0,X.jsx)("code",{children:"Tymy"})," s n\xe1zvy t\xfdm\u016f z ulo\u017een\xfdch tabulek. M\u016f\u017eete pou\u017e\xedt jeden soubor pro v\u0161echny sout\u011b\u017ee nebo jeden soubor na ka\u017edou sout\u011b\u017e."]}),(0,X.jsxs)(p.E,{fontSize:"xs",color:"gray.500",mb:2,children:["Sloupce v \u0161ablon\u011b (list ",(0,X.jsx)("code",{children:"Z\xe1pasy"}),"): ",(0,X.jsx)("code",{children:"kod_souteze"}),", ",(0,X.jsx)("code",{children:"id_souteze_uuid"}),", ",(0,X.jsx)("code",{children:"kolo"}),", ",(0,X.jsx)("code",{children:"doma_venku"}),", ",(0,X.jsx)("code",{children:"nazev_soupere"}),", ",(0,X.jsx)("code",{children:"odkaz_klub_soupere"}),", ",(0,X.jsx)("code",{children:"id_zapasu"}),", ",(0,X.jsx)("code",{children:"datum"}),", ",(0,X.jsx)("code",{children:"cas"}),", ",(0,X.jsx)("code",{children:"vysledek"}),", ",(0,X.jsx)("code",{children:"vysledek_polocas"}),", ",(0,X.jsx)("code",{children:"odkaz_na_zapas"}),", ",(0,X.jsx)("code",{children:"hriste"}),"."]}),(0,X.jsxs)(_.Xy,{children:[(0,X.jsxs)(_.ck,{children:[(0,X.jsx)("code",{children:"vysledek"})," a ",(0,X.jsx)("code",{children:"vysledek_polocas"})," jsou voliteln\xe9 texty (nap\u0159. \u201e3:1\u201c nebo \u201e3:1 (1:0)\u201c)."]}),(0,X.jsxs)(_.ck,{children:[(0,X.jsx)("code",{children:"hriste"})," je voliteln\xe9 pole pro popis h\u0159i\u0161t\u011b (m\u011bsto, are\xe1l apod.)."]})]}),(0,X.jsx)(b.z,{spacing:3,mb:3,children:(0,X.jsx)(f.$,{size:"sm",leftIcon:(0,X.jsx)(K.a4x,{}),onClick:()=>Ce("matches"),children:"St\xe1hnout \u0161ablonu pro Excel (XLSX)"})}),(0,X.jsx)($.A,{label:"Soubor se z\xe1pasy (CSV / XLSX)",description:"Nahrajte CSV nebo Excel (XLSX) soubor vypln\u011bn\xfd podle sta\u017een\xe9 \u0161ablony. Import se spust\xed automaticky po nahr\xe1n\xed.",accept:".csv,text/csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,.xlsx",multiple:!1,maxFiles:1,allowUrlImport:!1,uploadFn:async n=>{try{const a=await async function(e){const t=new FormData;t.append("file",e);const n=(await Z.Ay.post("/admin/manual/matches/import",t,{headers:{"Content-Type":"multipart/form-data"}})).data||{};return{imported:"number"===typeof n.imported?n.imported:0,updated:"number"===typeof n.updated?n.updated:0,errors:Array.isArray(n.errors)?n.errors:[]}}(n);e({title:"Import z\xe1pas\u016f dokon\u010den",description:"Nov\u011b: ".concat(a.imported,", aktualizov\xe1no: ").concat(a.updated,"."),status:"success",duration:6e3,isClosable:!0}),a.errors&&a.errors.length&&console.warn("Chyby importu z\xe1pas\u016f:",a.errors),await t.invalidateQueries({queryKey:["manual-competitions"]})}catch(a){throw e({title:"Import z\xe1pas\u016f selhal",description:(null===a||void 0===a?void 0:a.message)||"Zkontrolujte form\xe1t CSV nebo XLSX.",status:"error"}),a}return{url:n.name,name:n.name,type:n.type||"application/octet-stream",size:n.size}}}),(0,X.jsxs)(p.E,{mt:2,fontSize:"xs",color:"gray.500",children:["\u0160ablona se stahuje jako Excel (XLSX). Otev\u0159ete ji v Excelu nebo Google Sheets, vypl\u0148te list ",(0,X.jsx)("code",{children:"Z\xe1pasy"}),"a soubor pak nahrajte zp\u011bt jako XLSX nebo p\u0159\xedpadn\u011b ulo\u017ete do CSV \u2013 import podporuje oba form\xe1ty."]})]}),(0,X.jsxs)(s.a,{bg:n,borderWidth:"1px",borderColor:Y,borderRadius:"lg",p:6,children:[(0,X.jsx)(m.D,{size:"md",mb:3,children:"Import tabulek z Excelu (XLSX) nebo CSV"}),(0,X.jsxs)(p.E,{fontSize:"sm",color:"gray.600",mb:1,children:["XLSX \u0161ablona obsahuje list ",(0,X.jsx)("code",{children:"Tabulky"})," s \u0159\xe1dky tabulek, list ",(0,X.jsx)("code",{children:"Souteze"})," a list",(0,X.jsx)("code",{children:" Tymy"})," s n\xe1zvy t\xfdm\u016f. V pol\xedch ",(0,X.jsx)("code",{children:"kod_souteze"})," a ",(0,X.jsx)("code",{children:"nazev_tymu"})," jsou k dispozici rozbalovac\xed nab\xeddky podle t\u011bchto dat. Ka\u017ed\xfd \u0159\xe1dek reprezentuje jeden t\xfdm v tabulce."]}),(0,X.jsxs)(p.E,{fontSize:"xs",color:"gray.500",mb:2,children:["Sloupce v \u0161ablon\u011b (list ",(0,X.jsx)("code",{children:"Tabulky"}),"): ",(0,X.jsx)("code",{children:"kod_souteze"}),", ",(0,X.jsx)("code",{children:"id_souteze_uuid"}),", ",(0,X.jsx)("code",{children:"poradi"}),", ",(0,X.jsx)("code",{children:"nazev_tymu"}),", ",(0,X.jsx)("code",{children:"odkaz_na_klub"}),", ",(0,X.jsx)("code",{children:"zapasy"}),", ",(0,X.jsx)("code",{children:"vyhry"}),", ",(0,X.jsx)("code",{children:"remizy"}),", ",(0,X.jsx)("code",{children:"prohry"}),", ",(0,X.jsx)("code",{children:" skore"}),", ",(0,X.jsx)("code",{children:"body"}),"."]}),(0,X.jsx)(b.z,{spacing:3,mb:3,children:(0,X.jsx)(f.$,{size:"sm",leftIcon:(0,X.jsx)(K.a4x,{}),onClick:()=>Ce("tables"),children:"St\xe1hnout \u0161ablonu pro Excel (XLSX)"})}),(0,X.jsx)($.A,{label:"Soubor s tabulkami (CSV / XLSX)",description:"Nahrajte CSV nebo Excel (XLSX) soubor vypln\u011bn\xfd podle sta\u017een\xe9 \u0161ablony. Import se spust\xed automaticky po nahr\xe1n\xed.",accept:".csv,text/csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,.xlsx",multiple:!1,maxFiles:1,allowUrlImport:!1,uploadFn:async n=>{try{const a=await async function(e){const t=new FormData;t.append("file",e);const n=(await Z.Ay.post("/admin/manual/tables/import",t,{headers:{"Content-Type":"multipart/form-data"}})).data||{};return{imported:"number"===typeof n.imported?n.imported:0,errors:Array.isArray(n.errors)?n.errors:[]}}(n);e({title:"Import tabulek dokon\u010den",description:"Na\u010dteno \u0159\xe1dk\u016f: ".concat(a.imported,"."),status:"success",duration:6e3,isClosable:!0}),a.errors&&a.errors.length&&console.warn("Chyby importu tabulek:",a.errors),await t.invalidateQueries({queryKey:["manual-competitions"]})}catch(a){throw e({title:"Import tabulek selhal",description:(null===a||void 0===a?void 0:a.message)||"Zkontrolujte form\xe1t CSV nebo XLSX.",status:"error"}),a}return{url:n.name,name:n.name,type:n.type||"application/octet-stream",size:n.size}}}),(0,X.jsxs)(p.E,{mt:2,fontSize:"xs",color:"gray.500",children:["\u0160ablona se stahuje jako Excel (XLSX). Otev\u0159ete ji v Excelu nebo Google Sheets, vypl\u0148te list ",(0,X.jsx)("code",{children:"Tabulky"}),"a soubor pak nahrajte zp\u011bt jako XLSX nebo p\u0159\xedpadn\u011b ulo\u017ete do CSV \u2013 import podporuje oba form\xe1ty."]}),(0,X.jsxs)(s.a,{mt:4,children:[(0,X.jsxs)(p.E,{fontSize:"sm",color:"gray.600",mb:2,children:["Pokro\u010dil\xe9: m\u016f\u017eete tak\xe9 importovat tabulky z JSON payloadu (pole ",(0,X.jsx)("code",{children:"items"})," se stejn\xfdmi sloupci jako v CSV)."]}),(0,X.jsx)(k.T,{rows:4,value:pe,onChange:e=>xe(e.target.value),placeholder:'{"items":[{"competition_code":"A1A","team_name":"V\xe1\u0161 klub",...}]}'}),(0,X.jsxs)(b.z,{spacing:3,mt:2,children:[(0,X.jsx)(f.$,{size:"sm",leftIcon:(0,X.jsx)(K.B88,{}),onClick:async()=>{const n=pe.trim();if(!n)return void e({title:"Vlo\u017ete JSON payload pro import tabulek",status:"warning"});let a;try{a=JSON.parse(n)}catch(i){return void e({title:"Neplatn\xfd JSON",description:"Zkontrolujte pros\xedm syntaxi JSON payloadu.",status:"error"})}be(!0);try{const n=await async function(e){const t=(await Z.Ay.post("/admin/manual/tables/import-json",e)).data||{};return{imported:"number"===typeof t.imported?t.imported:0,errors:Array.isArray(t.errors)?t.errors:[]}}(a);e({title:"JSON import tabulek dokon\u010den",description:"Na\u010dteno \u0159\xe1dk\u016f: ".concat(n.imported,"."),status:"success",duration:6e3,isClosable:!0}),n.errors&&n.errors.length&&console.warn("Chyby JSON importu tabulek:",n.errors),await t.invalidateQueries({queryKey:["manual-competitions"]})}catch(i){e({title:"JSON import tabulek selhal",description:(null===i||void 0===i?void 0:i.message)||"Zkontrolujte form\xe1t JSON payloadu.",status:"error"})}finally{be(!1)}},isLoading:je,colorScheme:"purple",children:"Importovat JSON"}),(0,X.jsx)(f.$,{size:"sm",variant:"ghost",onClick:()=>xe('{\n "items": [\n {\n "competition_code": "A1A",\n "competition_external_id": "",\n "rank": "1",\n "team_name": "V\xe1\u0161 klub",\n "team_club_link": "https://www.fotbal.cz/klub/...",\n "played": "1",\n "wins": "1",\n "draws": "0",\n "losses": "0",\n "score": "3:0",\n "points": "3"\n }\n ]\n}'),children:"Vlo\u017eit uk\xe1zku"})]})]})]})]})]}),(0,X.jsxs)(s.a,{mt:8,bg:n,borderWidth:"1px",borderColor:Y,borderRadius:"lg",p:6,children:[(0,X.jsx)(m.D,{size:"md",mb:4,children:"P\u0159ehled sout\u011b\u017e\xed"}),ae?(0,X.jsxs)(b.z,{spacing:3,children:[(0,X.jsx)(w.y,{size:"sm"}),(0,X.jsx)(p.E,{children:"Na\u010d\xedt\xe1m sout\u011b\u017ee\u2026"})]}):0===oe.length?(0,X.jsx)(p.E,{color:"gray.500",fontSize:"sm",children:"Zat\xedm nejsou zalo\u017eeny \u017e\xe1dn\xe9 sout\u011b\u017ee."}):(0,X.jsx)(s.a,{overflowX:"auto",children:(0,X.jsxs)(z.X,{size:"sm",variant:"simple",children:[(0,X.jsx)(S.d,{children:(0,X.jsxs)(A.Tr,{children:[(0,X.jsx)(C.Th,{children:"K\xf3d"}),(0,X.jsx)(C.Th,{children:"N\xe1zev"}),(0,X.jsx)(C.Th,{children:"External ID"}),(0,X.jsx)(C.Th,{children:"Z\xe1pasy"}),(0,X.jsx)(C.Th,{children:"Tabulka"}),(0,X.jsx)(C.Th,{children:"Po\u010det t\xfdm\u016f"}),(0,X.jsx)(C.Th,{isNumeric:!0,children:"Akce"})]})}),(0,X.jsx)(E.N,{children:oe.map(e=>(0,X.jsxs)(A.Tr,{children:[(0,X.jsx)(T.Td,{children:(0,X.jsx)(D.E,{colorScheme:"blue",fontFamily:"mono",children:e.code})}),(0,X.jsx)(T.Td,{children:e.name}),(0,X.jsx)(T.Td,{fontFamily:"mono",fontSize:"xs",children:e.external_id}),(0,X.jsx)(T.Td,{maxW:"260px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",children:e.matches_link}),(0,X.jsx)(T.Td,{maxW:"260px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",children:e.table_link}),(0,X.jsx)(T.Td,{children:e.team_count}),(0,X.jsx)(T.Td,{isNumeric:!0,children:(0,X.jsxs)(b.z,{spacing:2,justify:"flex-end",children:[(0,X.jsx)(N.K,{"aria-label":"Upravit",icon:(0,X.jsx)(K.SG1,{}),size:"xs",variant:"ghost",onClick:()=>(e=>{se(e.id),ce({code:e.code||"",name:e.name||"",external_id:e.external_id||"",team_count:e.team_count||""})})(e)}),(0,X.jsx)(N.K,{"aria-label":"Smazat",icon:(0,X.jsx)(K.IXo,{}),size:"xs",variant:"ghost",colorScheme:"red",onClick:()=>(async e=>{await te({title:"Smazat sout\u011b\u017e",message:"Opravdu chcete smazat sout\u011b\u017e ".concat(e.code," \u2013 ").concat(e.name,"?\nBudou tak\xe9 odstran\u011bny v\u0161echny ru\u010dn\xed z\xe1pasy a tabulky."),confirmText:"Smazat",cancelText:"Zru\u0161it",isDanger:!0})&&Ae.mutate(e.id)})(e)})]})})]},e.id))})]})})]})]}),(0,X.jsxs)(R.aF,{isOpen:ke,onClose:we,size:"xl",children:[(0,X.jsx)(F.m,{}),(0,X.jsxs)(P.$,{children:[(0,X.jsx)(I.r,{children:"matches"===ye?"Jak pracovat se \u0161ablonou z\xe1pas\u016f (XLSX)":"Jak pracovat se \u0161ablonou tabulek (XLSX)"}),(0,X.jsx)(M.s,{}),(0,X.jsxs)(L.c,{children:[(0,X.jsx)(s.a,{mb:4,position:"relative",w:"100%",pb:"56.25%",borderRadius:"md",overflow:"hidden",bg:(0,r.dU)("gray.100","gray.700"),children:(0,X.jsx)(x.s,{position:"absolute",top:0,left:0,right:0,bottom:0,align:"center",justify:"center",children:(0,X.jsx)(p.E,{fontSize:"sm",color:"gray.600",textAlign:"center",px:4,children:"Zde bude kr\xe1tk\xe9 video s n\xe1vodem, jak \u0161ablonu vyplnit. Prozat\xedm pou\u017eijte textov\xfd n\xe1vod n\xed\u017ee."})})}),"matches"===ye?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(p.E,{fontSize:"sm",mb:2,children:["\u0160ablona pro z\xe1pasy obsahuje list ",(0,X.jsx)("code",{children:"Z\xe1pasy"})," pro samotn\xe9 z\xe1pasy, list ",(0,X.jsx)("code",{children:"Souteze"}),"s p\u0159ehledem sout\u011b\u017e\xed a list ",(0,X.jsx)("code",{children:"Tymy"})," s n\xe1zvy t\xfdm\u016f. Z t\u011bchto list\u016f se dopl\u0148uj\xed dropdowny v pol\xedch",(0,X.jsx)("code",{children:" kod_souteze"})," a ",(0,X.jsx)("code",{children:"nazev_soupere"}),"."]}),(0,X.jsxs)(_.Xy,{spacing:1,fontSize:"sm",mt:2,children:[(0,X.jsxs)(_.ck,{children:["Vyberte ",(0,X.jsx)("code",{children:"kod_souteze"})," z rozbalovac\xedho seznamu \u2013 mus\xed odpov\xeddat sout\u011b\u017e\xedm v p\u0159ehledu na t\xe9to str\xe1nce."]}),(0,X.jsxs)(_.ck,{children:["V poli ",(0,X.jsx)("code",{children:"nazev_soupere"})," se zobrazuj\xed t\xfdmy z listu ",(0,X.jsx)("code",{children:"Tymy"})," a jsou automaticky filtrovan\xe9 podle zvolen\xe9ho ",(0,X.jsx)("code",{children:"kod_souteze"})," v dan\xe9m \u0159\xe1dku."]}),(0,X.jsxs)(_.ck,{children:[(0,X.jsx)("code",{children:"id_souteze_uuid"})," je voliteln\xe9 \u201epokro\u010dil\xe9\u201c pole \u2013 typicky sta\u010d\xed vyplnit pouze ",(0,X.jsx)("code",{children:"kod_souteze"}),"."]}),(0,X.jsxs)(_.ck,{children:["V poli ",(0,X.jsx)("code",{children:"doma_venku"})," pou\u017eijte hodnoty z dropdownu (nap\u0159. ",(0,X.jsx)("code",{children:"doma"})," / ",(0,X.jsx)("code",{children:"venku"}),")."]}),(0,X.jsxs)(_.ck,{children:["Pro ",(0,X.jsx)("code",{children:"id_zapasu"})," m\u016f\u017eete bu\u010f vlo\u017eit \u010dist\xe9 ID, nebo jednodu\u0161e vyplnit ",(0,X.jsx)("code",{children:"odkaz_na_zapas"}),"cel\xfdm URL z fotbal.cz \u2013 syst\xe9m z n\u011bj ID automaticky vyextrahuje."]}),(0,X.jsxs)(_.ck,{children:["Datum a \u010das vypl\u0148ujte ve form\xe1tu ",(0,X.jsx)("code",{children:"YYYY-MM-DD"})," a ",(0,X.jsx)("code",{children:"HH:MM"})," (nap\u0159. ",(0,X.jsx)("code",{children:"2024-08-01"}),", ",(0,X.jsx)("code",{children:"17:00"}),")."]})]})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(p.E,{fontSize:"sm",mb:2,children:["\u0160ablona pro tabulky obsahuje list ",(0,X.jsx)("code",{children:"Tabulky"}),", list ",(0,X.jsx)("code",{children:"Souteze"})," a list",(0,X.jsx)("code",{children:" Tymy"}),". V pol\xedch ",(0,X.jsx)("code",{children:"kod_souteze"})," a ",(0,X.jsx)("code",{children:"nazev_tymu"})," jsou dropdowny vych\xe1zej\xedc\xed z t\u011bchto dat \u2013 n\xe1zvy t\xfdm\u016f jsou automaticky filtrovan\xe9 podle sout\u011b\u017ee v dan\xe9m \u0159\xe1dku. Ka\u017ed\xfd \u0159\xe1dek reprezentuje jeden t\xfdm v tabulce."]}),(0,X.jsxs)(_.Xy,{spacing:1,fontSize:"sm",mt:2,children:[(0,X.jsxs)(_.ck,{children:["Vyberte ",(0,X.jsx)("code",{children:"kod_souteze"})," z dropdownu podle sout\u011b\u017ee, ke kter\xe9 tabulka pat\u0159\xed."]}),(0,X.jsxs)(_.ck,{children:[(0,X.jsx)("code",{children:"id_souteze_uuid"})," je op\u011bt voliteln\xe9 \u2013 sta\u010d\xed se dr\u017eet ",(0,X.jsx)("code",{children:"kod_souteze"}),"."]}),(0,X.jsxs)(_.ck,{children:["Pro ",(0,X.jsx)("code",{children:"nazev_tymu"})," pou\u017eijte stejn\xfd n\xe1zev, jak\xfd chcete zobrazovat v tabulce na webu."]}),(0,X.jsxs)(_.ck,{children:["\u010c\xedseln\xe9 hodnoty jako ",(0,X.jsx)("code",{children:"zapasy"}),", ",(0,X.jsx)("code",{children:"vyhry"}),", ",(0,X.jsx)("code",{children:"remizy"}),", ",(0,X.jsx)("code",{children:"prohry"}),",",(0,X.jsx)("code",{children:" skore"})," a ",(0,X.jsx)("code",{children:"body"})," vypl\u0148ujte jako text/\u010d\xedslo p\u0159esn\u011b tak, jak je chcete ukazovat v p\u0159ehledu."]})]})]})]}),(0,X.jsx)(W.j,{children:(0,X.jsx)(f.$,{onClick:we,colorScheme:"blue",children:"Zav\u0159\xedt n\xe1vod"})})]})]})]})}},85638:(e,t,n)=>{function a(e){if(!e)return 9999;if(function(e){if(!e)return!1;const t=e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"");return/\b(muzi|mu\u017e|muze|dospeli|dosp\u011bl\xed|a[\s-]?team|a[\s-]?tym|senior)\b/i.test(t)}(e))return 0;const t=function(e){if(!e)return null;const t=e.match(/\bU(\d+)\b/i);return t?parseInt(t[1],10):null}(e);return null!==t?1e3-t:2e3}function i(e,t){const n=e.alias||e.name||"",i=t.alias||t.name||"",o=a(n),r=a(i);return o!==r?o-r:n.localeCompare(i,"cs")}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"display_order";return[...e].sort((e,n)=>{const a=e[t],o=n[t];return"number"===typeof a&&"number"===typeof o&&a!==o?a-o:"number"===typeof a?-1:"number"===typeof o?1:i(e,n)})}n.d(t,{tJ:()=>o})},86403:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var a=n(87139),i=n(22107),o=n(98662),r=n(44093),s=n(73212),l=n(7189),c=n(96148),d=n(28846),u=n(39081),h=n(65043),m=n(70118),p=n(79219),x=n(35475),g=n(70579);const v=e=>{let{variant:t="grid"}=e;const[n,v]=(0,h.useState)([]),[j,b]=(0,h.useState)(!0),y=(0,r.dU)("white","gray.800"),f="http://localhost:3100";return(0,h.useEffect)(()=>{(async()=>{try{const e=await(0,p.bM)();v(e.slice(0,5))}catch(e){console.error("Failed to fetch clothing items:",e)}finally{b(!1)}})()},[]),j||0===n.length?null:"carousel"===t?(0,g.jsxs)(i.a,{children:[(0,g.jsxs)(c.z,{justify:"space-between",mb:3,children:[(0,g.jsx)(d.D,{as:"h3",size:"md",children:"Oble\u010den\xed t\xfdmu"}),(0,g.jsxs)(c.z,{spacing:2,children:[(0,g.jsx)(l.N,{as:x.N_,to:"/obleceni",children:(0,g.jsx)(o.$,{size:"sm",variant:"outline",colorScheme:"blue",children:"Zobrazit v\u0161e"})}),f&&(0,g.jsx)(o.$,{as:l.N,href:f,size:"sm",colorScheme:"blue",variant:"solid",isExternal:!0,children:"E-shop"})]})]}),(0,g.jsx)(m.A,{draggable:!0,children:n.map(e=>(0,g.jsx)(i.a,{minW:{base:"70%",md:"45%",lg:"28%"},children:(0,g.jsx)("a",{href:e.url||"/obleceni",target:e.url?"_blank":void 0,rel:e.url?"noreferrer noopener":void 0,children:(0,g.jsxs)(i.a,{className:"card",bg:y,overflow:"hidden",borderWidth:"1px",transition:"all 0.2s",_hover:{transform:"translateY(-4px)",boxShadow:"md"},children:[(0,g.jsx)(i.a,{"aria-hidden":!0,height:{base:140,md:180},bgSize:"cover",bgPos:"center",style:{backgroundImage:"url(".concat(e.image_url,")")}}),(0,g.jsxs)(i.a,{p:3,borderTopWidth:"1px",children:[(0,g.jsx)(u.E,{noOfLines:1,fontWeight:"semibold",fontSize:"sm",children:e.title}),e.price&&e.price>0&&(0,g.jsxs)(a.E,{colorScheme:"blue",mt:1,fontSize:"xs",children:[e.price," ",e.currency||"K\u010d"]})]})]})})},e.id))})]}):(0,g.jsxs)(i.a,{children:[(0,g.jsxs)(c.z,{justify:"space-between",mb:3,children:[(0,g.jsx)(d.D,{as:"h3",size:"md",children:"Oble\u010den\xed t\xfdmu"}),(0,g.jsxs)(c.z,{spacing:2,children:[(0,g.jsx)(l.N,{as:x.N_,to:"/obleceni",children:(0,g.jsx)(o.$,{size:"sm",variant:"outline",colorScheme:"blue",children:"Zobrazit v\u0161e"})}),f&&(0,g.jsx)(o.$,{as:l.N,href:f,size:"sm",colorScheme:"blue",variant:"solid",isExternal:!0,children:"E-shop"})]})]}),(0,g.jsx)(s.r,{columns:{base:2,md:3,lg:5},spacing:4,children:n.map(e=>(0,g.jsx)("a",{href:e.url||"/obleceni",target:e.url?"_blank":void 0,rel:e.url?"noreferrer noopener":void 0,children:(0,g.jsxs)(i.a,{className:"card",bg:y,overflow:"hidden",borderWidth:"1px",transition:"all 0.2s",_hover:{transform:"translateY(-4px)",boxShadow:"md"},children:[(0,g.jsx)(i.a,{"aria-hidden":!0,height:{base:140,md:180},bgSize:"cover",bgPos:"center",style:{backgroundImage:"url(".concat(e.image_url,")")}}),(0,g.jsxs)(i.a,{p:3,borderTopWidth:"1px",children:[(0,g.jsx)(u.E,{noOfLines:1,fontWeight:"semibold",fontSize:"sm",children:e.title}),e.price&&e.price>0&&(0,g.jsxs)(a.E,{colorScheme:"blue",mt:1,fontSize:"xs",children:[e.price," ",e.currency||"K\u010d"]})]})]})},e.id))})]})}},87024:(e,t,n)=>{n.d(t,{UW:()=>l});n(65043);var a=n(42703),i=n(44093),o=n(53710),r=n(17813),s=n(70579);const l=()=>{const{colorMode:e,toggleColorMode:t}=(0,i.G6)();return(0,s.jsx)(a.K,{size:"sm",fontSize:"lg","aria-label":"P\u0159epnout barevn\xe9 t\xe9ma",variant:"ghost",color:"current",onClick:t,icon:"light"===e?(0,s.jsx)(o.r,{}):(0,s.jsx)(r.g,{})})}},87904:(e,t,n)=>{n.d(t,{$_:()=>c,Ao:()=>l,E$:()=>i,Ee:()=>d,Gu:()=>s,Pd:()=>h,Uy:()=>o,gB:()=>r,kP:()=>u});var a=n(46291);async function i(){return(await a.Ay.get("/engagement/profile")).data}async function o(e){return(await a.Ay.patch("/engagement/profile",e)).data}async function r(){return(await a.Ay.get("/engagement/rewards")).data}async function s(e){return(await a.Ay.patch("/engagement/avatar",e)).data}async function l(e){return(await a.Ay.post("/engagement/redeem",{reward_id:e})).data}async function c(){return(await a.Ay.get("/engagement/achievements")).data}async function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"points",t=arguments.length>1?arguments[1]:void 0;return(await a.Ay.get("/engagement/leaderboard",{params:{metric:e,limit:t}})).data}async function u(e){var t;return(null===(t=(await a.Ay.get("/engagement/transactions",{params:e})).data)||void 0===t?void 0:t.items)||[]}async function h(e){return(await a.Ay.post("/engagement/article-read",{article_id:e})).data}},88115:(e,t,n)=>{n.r(t),n.d(t,{default:()=>B});var a=n(89379),i=n(65043),o=n(6583),r=n(96870),s=n(88787),l=n(85871),c=n(87139),d=n(22107),u=n(98662),h=n(42703),m=n(34946),p=n(73225),x=n(76668),g=n(73212),v=n(33572),j=n(35699),b=n(7189),y=n(67516),f=n(35929),k=n(56529),_=n(15071),w=n(11054),z=n(78460),S=n(85421),A=n(76659),C=n(96148),E=n(10202),T=n(98481),D=n(14566),N=n(31411),R=n(10227),F=n(51794),P=n(3109),I=n(30502),M=n(28846),L=n(39081),W=n(74770),U=n(1009),O=n(90944),q=n(24346),K=n(70579);const B=()=>{const[e,t]=(0,i.useState)(!0),[n,B]=(0,i.useState)(!1),[Z,V]=(0,i.useState)([]),H="auto",[$,J]=(0,i.useState)(!0),G=(0,I.d)(),{isOpen:X,onOpen:Y,onClose:Q}=(0,r.j)(),[ee,te]=(0,i.useState)(""),[ne,ae]=(0,i.useState)(!1),[ie,oe]=(0,i.useState)(""),[re,se]=(0,i.useState)([]),[le,ce]=(0,i.useState)({}),[de,ue]=(0,i.useState)([]),[he,me]=(0,i.useState)(!1),[pe,xe]=(0,i.useState)(""),[ge,ve]=(0,i.useState)(""),[je,be]=(0,i.useState)({}),[ye,fe]=(0,i.useState)(""),[ke,_e]=(0,i.useState)(!1),we=(0,i.useMemo)(()=>(ee||"").trim().length>0,[ee]);(0,i.useEffect)(()=>{let e=!0;return(async()=>{try{const t=await(0,W.rC)();if(!e)return;const n=Array.isArray(t.videos_items)?t.videos_items:[],a=Array.isArray(t.videos)?t.videos.map(e=>({url:e})):[];V(n.length?n:a);const i=t.videos_module_enabled,o=n.length+a.length>0;J("boolean"===typeof i?Boolean(i):o);const r=t.youtube_url||t.social_youtube||"";r&&te(r),be(t.videos_title_overrides||{})}catch(n){}finally{e&&t(!1)}})(),()=>{e=!1}},[]);const ze=async e=>{try{const t="https://noembed.com/embed?url=".concat(encodeURIComponent(e)),n=await fetch(t,{method:"GET"});if(!n.ok)return;const a=await n.json();return((null===a||void 0===a?void 0:a.title)||"").toString().trim()||void 0}catch(t){return}};(0,i.useEffect)(()=>{let t=!0;return(async()=>{if(!e){xe(""),me(!0);try{const e=await(0,q.S)();if(!t)return;ue((null===e||void 0===e?void 0:e.videos)||[])}catch(n){if(!t)return;xe("Nepoda\u0159ilo se na\u010d\xedst cache vide\xed. Zkuste Aktualizovat.")}finally{t&&me(!1)}}})(),()=>{t=!1}},[e]),(0,i.useEffect)(()=>{if(e||ke)return;const t=(Z||[]).filter(e=>(e.url||"").trim().length>0&&!(e.title||"").trim()).slice(0,5);if(0===t.length)return;let n=!1;return(async()=>{const e=[...Z];let i=!1;for(const r of t){if(n)break;const t=await ze(r.url);if(t){const n=e.findIndex(e=>e.url===r.url);n>=0&&(e[n]=(0,a.A)((0,a.A)({},e[n]),{},{title:t}),i=!0)}}if(!n&&i){V(e);try{await(0,W.CX)({videos_items:e,videos_module_enabled:$})}catch(o){}}n||_e(!0)})(),()=>{n=!0}},[e,Z,$,ke]);const Se=(0,i.useMemo)(()=>{const e=(Z||[]).filter(e=>(e.url||"").trim().length>0).map((e,t)=>{let n;try{const t=(e.url||"").trim();var a;if(t.includes("youtu.be/"))n=null===(a=t.split("youtu.be/")[1])||void 0===a?void 0:a.split(/[?&#]/)[0];else if(t.includes("youtube.com")){n=new URL(t).searchParams.get("v")||void 0}}catch(i){}return{key:"m-".concat(t,"-").concat(e.url),title:e.title||"Video ".concat(t+1),thumbnail_url:e.thumbnail_url,published_date:e.uploaded_at,video_id:n,source:"manual",url:e.url}}),t=(de||[]).map(e=>({key:"a-".concat(e.video_id),title:e.title,thumbnail_url:e.thumbnail_url,published_date:e.published_date,video_id:e.video_id,source:"auto"})),n=[],a=new Set,i=e=>{const t=e.video_id||e.url||e.key;t&&(a.has(t)||(a.add(t),n.push(e)))};e.forEach(i),t.forEach(i);const o=n.filter(e=>(e.title||"").toLowerCase().includes(ge.toLowerCase())).slice().sort((e,t)=>{const n=Date.parse(e.published_date||"")||0;return(Date.parse(t.published_date||"")||0)-n});return{list:o,count:o.length}},[Z,de,ge]);(0,i.useEffect)(()=>{e||!we&&0===Z.length&&$&&J(!1)},[e,we,Z.length,$]),(0,i.useEffect)(()=>{if(e)return;if(!(ee||"").trim())return;const t="youtube_autoload_last";let n=0;try{n=Number(localStorage.getItem(t)||"0")}catch(a){}(!n||Date.now()-n>828e5)&&(async()=>{try{await(0,O.E)();try{localStorage.setItem(t,String(Date.now()))}catch(e){}G({status:"info",title:"Aktualizace vide\xed",description:"Na pozad\xed se aktualizuje cache vide\xed z YouTube.",duration:3e3})}catch(n){}})()},[e,H,ee,G]);const Ae=e=>{try{const a=e.trim();if(!a)return;if(a.includes("youtu.be/")){var t;const e=null===(t=a.split("youtu.be/")[1])||void 0===t?void 0:t.split(/[?&#]/)[0];return e?"https://i.ytimg.com/vi/".concat(e,"/hqdefault.jpg"):void 0}if(a.includes("youtube.com")){try{const e=new URL(a).searchParams.get("v")||"";if(e)return"https://i.ytimg.com/vi/".concat(e,"/hqdefault.jpg")}catch(n){}const e=a.match(/[?&]v=([^&#]+)/),t=null===e||void 0===e?void 0:e[1];return t?"https://i.ytimg.com/vi/".concat(t,"/hqdefault.jpg"):void 0}}catch(a){}};return(0,K.jsx)(o.A,{requireAdmin:!1,children:(0,K.jsxs)(d.a,{children:[(0,K.jsx)(M.D,{size:"md",mb:2,children:"Videa (pro tituln\xed str\xe1nku)"}),(0,K.jsx)(L.E,{fontSize:"sm",color:"gray.600",mb:2,children:"P\u0159idejte a\u017e 5 vide\xed (doporu\u010deno). Prvn\xed se zobraz\xed jako hlavn\xed, dal\u0161\xed 4 v m\u0159\xed\u017ece. Podporov\xe1no YouTube/Vimeo URL."}),(0,K.jsxs)(C.z,{justify:"space-between",mb:3,flexWrap:"wrap",children:[(0,K.jsx)(C.z,{spacing:2,children:(0,K.jsx)(u.$,{leftIcon:(0,K.jsx)(U.GGD,{}),colorScheme:"green",size:"sm",onClick:Y,children:"P\u0159idat video"})}),(0,K.jsxs)(p.MJ,{display:"flex",alignItems:"center",w:"auto",children:[(0,K.jsx)(x.l,{mb:0,children:"Zobrazit sekci Videa na tituln\xed str\xe1nce"}),(0,K.jsx)(T.d,{isChecked:$,isDisabled:e||n,onChange:async e=>{const t=e.target.checked;if(t&&!we&&0===Z.length)return J(!1),G({status:"warning",title:"Dopl\u0148te kan\xe1l nebo videa",description:"Pro zobrazen\xed sekce vypl\u0148te YouTube kan\xe1l nebo p\u0159idejte alespo\u0148 jedno video.",duration:4e3}),void setTimeout(()=>{const e=document.getElementById("admin-videos-channel-input");e&&e.focus()},0);J(t);try{await(0,W.CX)({videos_module_enabled:t})}catch(n){G({status:"error",title:"Ulo\u017een\xed selhalo",description:"Nepoda\u0159ilo se ulo\u017eit zm\u011bnu zobrazen\xed sekce.",duration:3e3})}}})]})]}),!we&&0===Z.length&&(0,K.jsx)(L.E,{fontSize:"sm",color:"orange.600",mb:2,children:"Pro aktivaci sekce vypl\u0148te YouTube kan\xe1l nebo p\u0159idejte video."}),(0,K.jsxs)(s.F,{status:"info",mb:3,borderRadius:"md",children:[(0,K.jsx)(l._,{}),"Automatick\xfd re\u017eim je zapnut\xfd. Videa se na\u010d\xedtaj\xed z YouTube kan\xe1lu z Nastaven\xed \u2192 Soci\xe1ln\xed s\xedt\u011b (YouTube URL). Ru\u010dn\u011b p\u0159idan\xe1 videa se zobraz\xed p\u0159ed automatick\xfdmi."]}),(0,K.jsxs)(d.a,{borderWidth:"1px",borderRadius:"md",p:3,mb:4,children:[(0,K.jsxs)(C.z,{justify:"space-between",align:"center",mb:2,flexWrap:"wrap",children:[(0,K.jsx)(M.D,{size:"sm",children:"N\xe1hled: v\u0161echna videa (aktivn\xed zdroj)"}),(0,K.jsxs)(C.z,{spacing:2,flexWrap:"wrap",children:[(0,K.jsx)(j.p,{size:"sm",placeholder:"Filtrovat podle n\xe1zvu",value:ge,onChange:e=>ve(e.target.value),width:{base:"100%",md:"260px"}}),(0,K.jsx)(u.$,{size:"sm",onClick:async()=>{xe(""),me(!0);try{await(0,O.E)();const e=await(0,q.S)();ue((null===e||void 0===e?void 0:e.videos)||[]),G({status:"success",title:"Aktualizov\xe1no",description:"Cache vide\xed byla obnovena.",duration:3e3})}catch(e){xe("Aktualizace cache selhala.")}finally{me(!1)}},isLoading:he,variant:"outline",flexShrink:0,minW:"max-content",children:"Aktualizovat cache"}),(0,K.jsx)(u.$,{size:"sm",colorScheme:"blue",variant:"solid",onClick:async()=>{try{await(0,W.CX)({videos_title_overrides:je}),G({status:"success",title:"P\u0159episy ulo\u017eeny",description:"N\xe1zvy vide\xed byly aktualizov\xe1ny.",duration:2500})}catch(e){G({status:"error",title:"Chyba",description:"Nepoda\u0159ilo se ulo\u017eit p\u0159episy n\xe1zv\u016f.",duration:3e3})}},flexShrink:0,minW:"max-content",children:"Ulo\u017eit p\u0159episy n\xe1zv\u016f"})]})]}),(0,K.jsxs)(K.Fragment,{children:[pe&&(0,K.jsxs)(s.F,{status:"error",mb:2,borderRadius:"md",children:[(0,K.jsx)(l._,{}),pe]}),he?(0,K.jsxs)(C.z,{color:"gray.600",children:[(0,K.jsx)(A.y,{size:"sm"}),(0,K.jsx)(L.E,{children:"Na\u010d\xedt\xe1m videa\u2026"})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(L.E,{fontSize:"sm",color:"gray.600",mb:2,children:["Po\u010det vide\xed: ",Se.count]}),(0,K.jsx)(g.r,{columns:{base:1,sm:2,md:3,lg:4},spacing:3,children:Se.list.map(e=>{var t,n,i,o,r;return(0,K.jsx)(d.a,{borderWidth:"1px",borderRadius:"md",p:2,children:(0,K.jsxs)(E.T,{align:"stretch",spacing:2,children:[(0,K.jsx)(v._,{src:e.thumbnail_url||("manual"===e.source?Ae(e.url||""):void 0),alt:e.title,borderRadius:"md","data-fallback-idx":0,onError:t=>{const n=t.currentTarget,a=Number(n.dataset.fallbackIdx||"0"),i=e.video_id||"",o=i?["https://i.ytimg.com/vi/".concat(i,"/mqdefault.jpg"),"https://i.ytimg.com/vi/".concat(i,"/sddefault.jpg"),"https://i.ytimg.com/vi/".concat(i,"/hqdefault.jpg"),"/images/sponsors/placeholder.png"]:["/images/sponsors/placeholder.png"];a<o.length&&(n.src=o[a],n.dataset.fallbackIdx=String(a+1))}}),(0,K.jsxs)(d.a,{children:[(0,K.jsxs)(C.z,{justify:"space-between",align:"start",children:[(0,K.jsxs)(d.a,{flex:"1",children:[(0,K.jsx)(L.E,{fontWeight:"semibold",noOfLines:2,children:"auto"===e.source&&e.video_id&&(null!==(t=je[e.video_id])&&void 0!==t&&null!==(n=t.trim())&&void 0!==n&&n.length?je[e.video_id]:e.title)||e.title}),(0,K.jsxs)(C.z,{spacing:2,color:"gray.600",fontSize:"sm",children:[e.published_date&&(0,K.jsx)(c.E,{children:new Date(e.published_date).toLocaleDateString("cs-CZ")}),"manual"===e.source&&(0,K.jsx)(c.E,{colorScheme:"purple",children:"Ru\u010dn\u011b"})]})]}),"manual"===e.source&&(0,K.jsx)(h.K,{"aria-label":"Smazat",icon:(0,K.jsx)(U.IXo,{}),size:"sm",variant:"ghost",colorScheme:"red",onClick:async()=>{const t=Z.filter(t=>t.url!==e.url);try{await(0,W.CX)({videos_items:t,videos_module_enabled:$}),V(t),G({status:"success",title:"Smaz\xe1no",description:"Video bylo odstran\u011bno."})}catch(n){G({status:"error",title:"Chyba",description:"Odstran\u011bn\xed se nepoda\u0159ilo."})}}})]}),"auto"===e.source&&e.video_id&&(0,K.jsxs)(p.MJ,{mt:2,children:[(0,K.jsx)(x.l,{fontSize:"xs",mb:1,children:"P\u0159epis n\xe1zvu (voliteln\xe9)"}),(0,K.jsx)(j.p,{size:"sm",placeholder:"Nap\u0159. Z\xe1pas A\u2011t\xfdmu vs. B\u2011t\xfdm",value:null!==(i=je[e.video_id])&&void 0!==i?i:"",onChange:t=>{const n=t.target.value;be(t=>(0,a.A)((0,a.A)({},t),{},{[e.video_id]:n}))}})]}),"manual"===e.source&&e.url&&(0,K.jsxs)(p.MJ,{mt:2,children:[(0,K.jsx)(x.l,{fontSize:"xs",mb:1,children:"N\xe1zev videa"}),(0,K.jsx)(j.p,{size:"sm",placeholder:"Zadejte vlastn\xed n\xe1zev",value:null!==(o=null===(r=Z.find(t=>t.url===e.url))||void 0===r?void 0:r.title)&&void 0!==o?o:"",onChange:t=>{const n=t.target.value;V(t=>t.map(t=>t.url===e.url?(0,a.A)((0,a.A)({},t),{},{title:n}):t))},onBlur:async t=>{const n=t.target.value,i=Z.map(t=>t.url===e.url?(0,a.A)((0,a.A)({},t),{},{title:n}):t);try{await(0,W.CX)({videos_items:i,videos_module_enabled:$}),V(i)}catch(o){}}})]})]})]})},e.key)})}),0===Se.count&&(0,K.jsx)(L.E,{color:"gray.600",children:"Zat\xedm \u017e\xe1dn\xe1 videa."})]})]})]}),(0,K.jsx)(C.z,{justify:"flex-end",mb:3,children:(0,K.jsx)(u.$,{colorScheme:"blue",leftIcon:(0,K.jsx)(U.Bc_,{}),onClick:async()=>{B(!0);try{await(0,W.CX)({videos_items:Z,videos_module_enabled:$,videos_title_overrides:je}),G({status:"success",title:"Ulo\u017eeno",description:"Nastaven\xed vide\xed bylo ulo\u017eeno.",duration:2500})}catch(e){G({status:"error",title:"Chyba",description:"Nepoda\u0159ilo se ulo\u017eit nastaven\xed vide\xed.",duration:3e3})}finally{B(!1)}},isLoading:n,children:"Ulo\u017eit v\u0161e"})}),(0,K.jsxs)(z.aF,{isOpen:X,onClose:Q,size:"4xl",children:[(0,K.jsx)(w.m,{}),(0,K.jsxs)(S.$,{children:[(0,K.jsx)(_.r,{children:"P\u0159idat video"}),(0,K.jsx)(f.s,{}),(0,K.jsx)(y.c,{children:(0,K.jsxs)(P.t,{variant:"enclosed",children:[(0,K.jsxs)(N.w,{children:[(0,K.jsx)(D.o,{children:"Odkaz na video"}),(0,K.jsx)(D.o,{children:"Na\u010d\xedst z YouTube kan\xe1lu"})]}),(0,K.jsxs)(F.T,{children:[(0,K.jsx)(R.K,{children:(0,K.jsxs)(E.T,{align:"stretch",spacing:3,children:[(0,K.jsxs)(p.MJ,{children:[(0,K.jsx)(x.l,{children:"URL videa"}),(0,K.jsx)(j.p,{placeholder:"https://www.youtube.com/watch?v=...",value:ye,onChange:e=>fe(e.target.value)})]}),(0,K.jsx)(C.z,{children:(0,K.jsx)(u.$,{colorScheme:"green",onClick:async()=>{await(async()=>{const e=(ye||"").trim();if(!e)return void G({status:"warning",title:"Zadejte odkaz",description:"Vlo\u017ete URL videa."});const t=(new Date).toISOString().slice(0,10),n={url:e,title:await ze(e),uploaded_at:t,thumbnail_url:Ae(e)};if(Z.find(e=>e.url===n.url))return void G({status:"info",title:"Video u\u017e existuje",description:"Tento odkaz je ji\u017e v seznamu."});const a=[...Z,n];try{await(0,W.CX)({videos_items:a,videos_module_enabled:$}),V(a),fe(""),G({status:"success",title:"Video p\u0159id\xe1no",description:"Video bylo p\u0159id\xe1no k automatick\xfdm vide\xedm."})}catch(i){G({status:"error",title:"Chyba",description:"Nepoda\u0159ilo se ulo\u017eit video."})}})(),Q()},children:"P\u0159idat"})})]})}),(0,K.jsx)(R.K,{children:(0,K.jsxs)(E.T,{align:"stretch",spacing:3,children:[(0,K.jsxs)(L.E,{fontSize:"sm",color:"gray.600",children:["Pou\u017eijte Scraper API. Zadejte handle (nap\u0159. ",(0,K.jsx)("code",{children:"@FotbalKunovice"}),") nebo URL kan\xe1lu a na\u010dt\u011bte videa z karty \u201eVidea\u201c. Slu\u017eba: ",(0,K.jsx)(b.N,{href:"https://youtube.tdvorak.dev/",isExternal:!0,color:"blue.500",children:"youtube.tdvorak.dev"})]}),(0,K.jsxs)(C.z,{align:"start",spacing:3,flexWrap:"wrap",children:[(0,K.jsxs)(p.MJ,{maxW:{base:"100%",md:"400px"},children:[(0,K.jsx)(x.l,{children:"Kan\xe1l (handle nebo URL)"}),(0,K.jsx)(j.p,{id:"admin-videos-channel-input",placeholder:"@FCBizoniUH nebo https://www.youtube.com/@FCBizoniUH/videos",value:ee,onChange:e=>te(e.target.value)})]}),(0,K.jsx)(u.$,{onClick:async()=>{const e=null===ee||void 0===ee?void 0:ee.trim();if(e){oe(""),ae(!0),se([]),ce({});try{const t="https://youtube.tdvorak.dev/channel_videos?channel=".concat(encodeURIComponent(e)),n=await fetch(t,{method:"GET"});if(!n.ok)throw new Error("HTTP ".concat(n.status));const a=await n.json(),i=Array.isArray(null===a||void 0===a?void 0:a.videos)?a.videos:[];se(i),0===i.length&&oe("Na kan\xe1lu nebyla nalezena \u017e\xe1dn\xe1 videa.")}catch(t){console.error(t),oe("Nepoda\u0159ilo se na\u010d\xedst videa z API. Zkontrolujte dostupnost slu\u017eby na https://youtube.tdvorak.dev/ a CORS.")}finally{ae(!1)}}else G({status:"warning",title:"Zadejte kan\xe1l",description:"Zadejte YouTube handle nebo URL kan\xe1lu."})},isLoading:ne,variant:"outline",flexShrink:0,minW:"max-content",children:"Na\u010d\xedst videa"}),(0,K.jsx)(u.$,{colorScheme:"green",onClick:async()=>{await(async()=>{const e=re.filter(e=>le[e.video_id]);if(0===e.length)return void G({status:"info",title:"Nic k importu",description:"Vyberte alespo\u0148 jedno video."});const t=e.map(e=>({url:"https://www.youtube.com/watch?v=".concat(e.video_id),title:e.title,length:e.length,uploaded_at:(e.published_date||"").slice(0,10),thumbnail_url:e.thumbnail_url})),n=(()=>{const e=new Set(Z.map(e=>e.url)),n=[...Z];for(const a of t)e.has(a.url)||(n.push(a),e.add(a.url));return n})();try{await(0,W.CX)({videos_items:n,videos_module_enabled:$}),V(n),G({status:"success",title:"Videa p\u0159id\xe1na",description:"".concat(e.length," vide\xed bylo p\u0159id\xe1no do seznamu.")})}catch(a){G({status:"error",title:"Chyba",description:"Nepoda\u0159ilo se ulo\u017eit p\u0159idan\xe1 videa."})}})(),Q()},isDisabled:0===re.length,flexShrink:0,minW:"max-content",children:"P\u0159idat vybran\xe1"})]}),ie&&(0,K.jsxs)(s.F,{status:"error",borderRadius:"md",children:[(0,K.jsx)(l._,{}),ie]}),ne&&(0,K.jsxs)(C.z,{color:"gray.600",children:[(0,K.jsx)(A.y,{size:"sm"}),(0,K.jsx)(L.E,{children:"Na\u010d\xedt\xe1m videa\u2026"})]}),!ne&&re.length>0&&(0,K.jsx)(g.r,{columns:{base:1,sm:2,md:3,lg:4},spacing:3,children:re.map(e=>(0,K.jsx)(d.a,{borderWidth:"1px",borderRadius:"md",p:2,children:(0,K.jsxs)(E.T,{align:"stretch",spacing:2,children:[(0,K.jsx)(v._,{src:e.thumbnail_url,alt:e.title,borderRadius:"md"}),(0,K.jsx)(m.S,{isChecked:!!le[e.video_id],onChange:()=>{return t=e.video_id,void ce(e=>(0,a.A)((0,a.A)({},e),{},{[t]:!e[t]}));var t},children:"Vybrat"}),(0,K.jsxs)(d.a,{children:[(0,K.jsx)(L.E,{fontWeight:"semibold",noOfLines:2,children:e.title}),(0,K.jsxs)(C.z,{spacing:2,color:"gray.600",fontSize:"sm",children:[e.length&&(0,K.jsx)(c.E,{children:e.length}),e.published_text&&(0,K.jsx)(L.E,{children:e.published_text})]})]})]})},e.video_id))})]})})]})]})}),(0,K.jsx)(k.j,{children:(0,K.jsx)(u.$,{variant:"ghost",onClick:Q,children:"Zav\u0159\xedt"})})]})]})]})})}},88500:(e,t,n)=>{n.d(t,{A:()=>w});var a=n(65043),i=n(22107),o=n(98662),r=n(42703),s=n(44093),l=n(5371),c=n(25011),d=n(35699),u=n(45973),h=n(29244),m=n(88019),p=n(96148),x=n(29904),g=n(10202),v=n(30502),j=n(53407),b=n(39081),y=n(1009),f=n(34636),k=n(70579);const _=10,w=e=>{let{label:t="Nahr\xe1t soubory",description:n="Vyberte soubory k nahr\xe1n\xed nebo je p\u0159et\xe1hn\u011bte do oblasti n\xed\u017ee.",value:w,onChange:z,accept:S="image/*,application/pdf",maxFiles:A=10,maxFileSizeMB:C=_,multiple:E=!0,uploadFn:T,allowUrlImport:D=!0,onUrlImport:N,urlPlaceholder:R="Vlo\u017eit URL souboru",onUploadFinished:F}=e;const[P,I]=(0,a.useState)(()=>w||[]),[M,L]=(0,a.useState)(!1),[W,U]=(0,a.useState)(0),[O,q]=(0,a.useState)(!1),[K,B]=(0,a.useState)(""),Z=(0,a.useRef)(null),V=(0,v.d)(),H=(0,s.dU)("gray.200","gray.700"),$=(0,s.dU)("white","gray.800"),J=(0,s.dU)("gray.50","gray.900"),G=(0,s.dU)("gray.50","gray.900");(0,a.useEffect)(()=>{w&&I(w)},[w]);const X=e=>{if(!e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return"".concat(Math.round(e/Math.pow(1024,t)*100)/100," ").concat(["B","KB","MB","GB"][t])},Y=(0,a.useCallback)(e=>{I(e),z&&z(e)},[z]),Q=(0,a.useCallback)(async e=>{if(T)return T(e);const t=await(0,f.QM)(e);return{url:t.url,name:e.name,type:e.type||t.type||"application/octet-stream",size:e.size||t.size||0}},[T]),ee=(0,a.useCallback)(async e=>{const t=Array.from(e||[]);if(!t.length)return;if(P.length+t.length>A)return void V({title:"P\u0159\xedli\u0161 mnoho soubor\u016f",description:"M\u016f\u017eete nahr\xe1t maxim\xe1ln\u011b ".concat(A," soubor\u016f"),status:"warning"});const n=1024*C*1024,a=t.filter(e=>!(e.size>n)||(V({title:"Soubor je p\u0159\xedli\u0161 velk\xfd",description:"".concat(e.name," p\u0159ekra\u010duje limit ").concat(C," MB"),status:"error"}),!1));if(!a.length)return;L(!0),U(0);const i=[],o=a.length;try{for(let e=0;e<a.length;e+=1){const t=a[e];try{const e=await Q(t);i.push(e)}catch(r){V({title:"Chyba p\u0159i nahr\xe1v\xe1n\xed",description:(null===r||void 0===r?void 0:r.message)||t.name,status:"error"})}U((e+1)/o*100)}if(i.length){const e=[...P,...i];Y(e),F&&F(i,e),V({title:"Nahr\xe1v\xe1n\xed dokon\u010deno",description:"".concat(i.length," soubor\u016f bylo nahr\xe1no"),status:"success"})}}finally{L(!1),U(0),Z.current&&(Z.current.value="")}},[Q,Y,P,C,A,F,V]),te=async()=>{const e=K.trim();if(e)try{N&&await N(e);const t=[...P,{url:e,name:e,type:"text/url",size:0}];Y(t),B(""),V({title:"URL p\u0159id\xe1na",status:"success",duration:2e3})}catch(t){V({title:"Nelze p\u0159idat URL",description:(null===t||void 0===t?void 0:t.message)||"Zkontrolujte odkaz a zkuste to znovu.",status:"error"})}};return(0,k.jsx)(i.a,{borderWidth:"1px",borderRadius:"xl",borderColor:H,bg:$,p:4,children:(0,k.jsxs)(g.T,{align:"stretch",spacing:4,children:[(0,k.jsxs)(p.z,{justify:"space-between",align:"flex-start",children:[(0,k.jsxs)(i.a,{children:[(0,k.jsxs)(p.z,{spacing:2,mb:1,children:[(0,k.jsx)(c.I,{as:y.YoE,color:"blue.500"}),(0,k.jsx)(b.E,{fontWeight:"semibold",children:t})]}),(0,k.jsx)(b.E,{fontSize:"sm",color:"gray.500",children:n})]}),P.length>0&&(0,k.jsxs)(p.z,{spacing:1,align:"center",color:"gray.500",fontSize:"xs",children:[(0,k.jsx)(c.I,{as:y.A3x,color:"green.400"}),(0,k.jsxs)(b.E,{children:[P.length," soubor\u016f"]})]})]}),(0,k.jsxs)(i.a,{borderWidth:"1px",borderRadius:"lg",borderStyle:O?"solid":"dashed",borderColor:O?"blue.400":H,bg:O?J:"transparent",p:6,textAlign:"center",cursor:"pointer",transition:"all 0.15s ease-out",onClick:()=>{var e;return null===(e=Z.current)||void 0===e?void 0:e.click()},onDrop:e=>{var t,n;e.preventDefault(),e.stopPropagation(),q(!1),null!==(t=e.dataTransfer)&&void 0!==t&&null!==(n=t.files)&&void 0!==n&&n.length&&ee(e.dataTransfer.files)},onDragOver:e=>{e.preventDefault(),e.stopPropagation(),O||q(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),q(!1)},children:[(0,k.jsxs)(g.T,{spacing:2,children:[(0,k.jsx)(c.I,{as:y.YoE,boxSize:7,color:"blue.400"}),(0,k.jsx)(b.E,{fontWeight:"medium",children:"Zvolte soubor nebo jej p\u0159et\xe1hn\u011bte sem"}),(0,k.jsxs)(b.E,{fontSize:"xs",color:"gray.500",children:["Podporovan\xe9 form\xe1ty: ",S||"soubor"," \u2022 Limit ",C," MB / soubor"]}),(0,k.jsx)(o.$,{size:"sm",variant:"outline",leftIcon:(0,k.jsx)(y.YoE,{}),children:"Vybrat soubor"})]}),(0,k.jsx)("input",{ref:Z,type:"file",multiple:E,accept:S,style:{display:"none"},onChange:e=>{e.target.files&&ee(e.target.files)}})]}),(0,k.jsxs)(j.S,{in:M||W>0,animateOpacity:!0,children:[M&&(0,k.jsxs)(p.z,{spacing:2,align:"center",children:[(0,k.jsx)(c.I,{as:y.y3G,color:"blue.400"}),(0,k.jsx)(b.E,{fontSize:"sm",children:"Nahr\xe1v\xe1m soubory\u2026"})]}),W>0&&(0,k.jsx)(m.k,{mt:2,value:W,size:"sm",colorScheme:"blue",borderRadius:"full"})]}),P.length>0&&(0,k.jsx)(i.a,{borderTopWidth:"1px",borderColor:H,pt:3,children:(0,k.jsx)(x.B,{spacing:2,children:P.map((e,t)=>{const n=(a=e.type||"").startsWith("image/")?y.fZZ:a.includes("pdf")?y.jH2:y.QuH;var a;return(0,k.jsxs)(l.s,{align:"center",justify:"space-between",p:2,borderRadius:"md",_hover:{bg:G},children:[(0,k.jsxs)(p.z,{spacing:3,flex:1,minW:0,children:[(0,k.jsx)(c.I,{as:n,boxSize:5,color:"blue.500"}),(0,k.jsxs)(i.a,{flex:1,minW:0,children:[(0,k.jsx)(b.E,{fontSize:"sm",noOfLines:1,children:e.name||e.url}),(0,k.jsxs)(p.z,{spacing:2,fontSize:"xs",color:"gray.500",children:[e.size?(0,k.jsx)(b.E,{children:X(e.size)}):null,(0,k.jsx)(b.E,{children:e.type})]})]})]}),(0,k.jsx)(r.K,{"aria-label":"Odebrat soubor",icon:(0,k.jsx)(y.yGN,{}),size:"xs",variant:"ghost",onClick:e=>{e.stopPropagation(),(e=>{const t=P.filter((t,n)=>n!==e);Y(t)})(t)}})]},"".concat(e.url,"-").concat(t))})})}),D&&(0,k.jsxs)(i.a,{pt:2,borderTopWidth:P.length?"1px":"0",borderColor:H,children:[(0,k.jsx)(b.E,{fontSize:"xs",color:"gray.500",mb:1,children:"nebo importujte z URL odkazu"}),(0,k.jsxs)(p.z,{spacing:2,children:[(0,k.jsxs)(u.M,{children:[(0,k.jsx)(h.W,{pointerEvents:"none",children:(0,k.jsx)(c.I,{as:y.yx1,color:"gray.400"})}),(0,k.jsx)(d.p,{size:"sm",placeholder:R,value:K,onChange:e=>B(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),te())}})]}),(0,k.jsx)(o.$,{size:"sm",onClick:te,isDisabled:!K.trim(),children:"P\u0159idat"})]})]})]})})}},89563:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Y});var a=n(80045),i=n(89379),o=n(65043),r=n(99956),s=n(42703),l=n(40378),c=n(1009),d=(n(11711),n(80348),n(50817),n(74770)),u=n(25189),h=n(29661),m=n(91296),p=n(6484),x=n(34636),g=n(70082),v=n(38376),j=n(95182),b=n(73523),y=n(17707),f=n(46291),k=n(56644),_=n(57550),w=n(78801),z=n(74117),S=n(70579);const A=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")},C=e=>{let{variant:t="minimal",fullBleed:n=!1}=e;const{t:a}=(0,z.Bd)(),{data:i}=(0,_.s)(),o=(0,w.N)(),r=(null===i||void 0===i?void 0:i.club_name)||o.name||"Fotbalov\xfd klub",s=a("homepage.official_website"),l=(0,u.uq)((null===i||void 0===i?void 0:i.club_logo_url)||o.logoUrl)||(null===i||void 0===i?void 0:i.club_logo_url)||o.logoUrl||"/dist/img/logo-club-empty.svg",c=(null===i||void 0===i?void 0:i.shop_url)||void 0;return(0,S.jsxs)("div",{className:A("club-hero-topbar",n&&"full-bleed","brand"===t&&"club-hero-topbar--brand","minimal"===t&&"club-hero-topbar--minimal","badge"===t&&"club-hero-topbar--badge"),children:[(0,S.jsx)("div",{className:"club-hero-topbar__logo",children:(0,S.jsx)("img",{src:l,alt:r,style:{width:36,height:36,objectFit:"contain"}})}),(0,S.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,S.jsx)("div",{className:"club-hero-topbar__title",children:r}),(0,S.jsx)("div",{className:"club-hero-topbar__tagline",children:s})]}),(0,S.jsx)("div",{className:"club-hero-topbar__spacer"}),"minimal"!==t&&(0,S.jsxs)("div",{className:"club-hero-topbar__actions",children:[(0,S.jsx)("a",{href:"/kalendar",className:"sparta-button-tertiary",children:"Kalend\xe1\u0159"}),c&&(0,S.jsx)("a",{href:c,target:"_blank",rel:"noreferrer",className:"sparta-button-primary",children:"Fanshop"})]})]})};var E=n(89910),T=n(82501);const D=e=>{let{items:t}=e;const n=Array.isArray(t)?t.slice(0,4):[];return(0,S.jsx)("div",{className:"blog-list",children:n.map(e=>(0,S.jsxs)("a",{href:"/aktivita/".concat(e.id),className:"card",style:{textDecoration:"none",color:"inherit"},children:[(0,S.jsx)("div",{className:"thumb",style:{backgroundImage:"url(".concat((0,u.uq)(e.image_url)||"/images/news/placeholder.jpg",")")}}),(0,S.jsxs)("div",{children:[(0,S.jsx)("h4",{children:e.title}),(0,S.jsxs)("div",{style:{color:"var(--dark-gray)",fontSize:"0.9rem"},children:[new Date(e.start_time).toLocaleDateString()," ",e.location?"\u2022 ".concat(e.location):""]})]})]},e.id))})};var N=n(29066),R=n(9976),F=n(30502),P=n(91276);const I=e=>{if(!e)return"";const t=new Date(e);return isNaN(t.getTime())?"":t.toLocaleString("cs-CZ")},M=()=>{const{t:e}=(0,z.Bd)(),{user:t}=(0,N.A)(),[n,a]=(0,o.useState)(null),[i,r]=(0,o.useState)(!0),[s,l]=(0,o.useState)(!1),[c,d]=(0,o.useState)(!1),u=(0,o.useRef)(!1),h=(0,F.d)(),m=async()=>{r(!0);try{const e=await(0,R.eF)();a(e)}finally{r(!1)}};(0,o.useEffect)(()=>{m()},[]);const p=null===n||void 0===n?void 0:n.sweepstake,x=(null===n||void 0===n||n.prizes,(null===n||void 0===n?void 0:n.winners)||[]),g=(null===n||void 0===n?void 0:n.state)||"upcoming",v=!!t,j="admin"===String((null===t||void 0===t?void 0:t.role)||"").toLowerCase(),b=(0,o.useMemo)(()=>{if(!v||null===x||void 0===x||!x.length)return!1;const e=null===t||void 0===t?void 0:t.id;return x.some(t=>t.user_id===e)},[x,v,t]),y=!(null===n||void 0===n||!n.has_entered),f=!(null===n||void 0===n||!n.can_enter);if((0,o.useEffect)(()=>{if(!p||!v||null===x||void 0===x||!x.length)return;if("finalized"!==g)return;if(null!==n&&void 0!==n&&n.visual_played_at)return;if(c||u.current)return;if(j)return;d(!0),u.current=!0;const e=setTimeout(async()=>{try{await(0,R.v9)(p.id)}catch(e){}d(!1),await m()},3e3);return()=>clearTimeout(e)},[p,v,x,g,null===n||void 0===n?void 0:n.visual_played_at,c,j]),i)return null;if(!p)return null;if("finalized"===((null===n||void 0===n?void 0:n.state)||"upcoming")&&!b)return null;return(0,S.jsxs)("section",{"data-element":"sweepstakes","data-variant":"default",style:{marginTop:16,marginBottom:8},children:[(0,S.jsxs)("div",{className:"card",style:{maxWidth:1200,margin:"0 auto",padding:16},children:["upcoming"===g&&(0,S.jsxs)("div",{children:[(0,S.jsxs)("div",{className:"section-head",style:{marginTop:0},children:[(0,S.jsx)("h3",{children:"Sout\u011b\u017e"}),p.rules_url&&(0,S.jsx)("a",{href:(0,P.V)(p.rules_url)||p.rules_url,className:"see-all",target:"_blank",rel:"noreferrer noopener",children:"Pravidla"})]}),(0,S.jsxs)("div",{style:{display:"flex",gap:16,alignItems:"center",flexWrap:"wrap"},children:[p.image_url&&(0,S.jsx)("img",{src:(0,P.V)(p.image_url),style:{width:120,height:120,objectFit:"cover",borderRadius:8}}),(0,S.jsxs)("div",{style:{flex:1,minWidth:240},children:[(0,S.jsx)("div",{style:{fontWeight:700,fontSize:18,marginBottom:4},children:p.title}),p.description&&(0,S.jsx)("div",{style:{opacity:.8},children:p.description}),(0,S.jsxs)("div",{style:{marginTop:8,fontSize:14,opacity:.8},children:["Za\u010d\xedn\xe1: ",I(p.start_at)," \u2022 Kon\u010d\xed: ",I(p.end_at)]})]}),v?y?(0,S.jsx)("span",{style:{fontWeight:600},children:"U\u017e jste p\u0159ihl\xe1\u0161eni do sout\u011b\u017ee \u2713"}):(0,S.jsxs)("span",{style:{fontSize:14,opacity:.85},children:["Sout\u011b\u017e je\u0161t\u011b neza\u010dala. Vstup bude mo\u017en\xfd od ",I(p.start_at),"."]}):(0,S.jsx)("a",{href:"/login",className:"btn",style:{padding:"10px 16px"},children:e("auth.login")})]})]}),"active"===g&&(0,S.jsxs)("div",{children:[(0,S.jsxs)("div",{className:"section-head",style:{marginTop:0},children:[(0,S.jsx)("h3",{children:"Sout\u011b\u017e"}),p.rules_url&&(0,S.jsx)("a",{href:(0,P.V)(p.rules_url)||p.rules_url,className:"see-all",target:"_blank",rel:"noreferrer noopener",children:"Pravidla"})]}),(0,S.jsxs)("div",{style:{display:"flex",gap:16,alignItems:"center",flexWrap:"wrap"},children:[p.image_url&&(0,S.jsx)("img",{src:(0,P.V)(p.image_url),style:{width:120,height:120,objectFit:"cover",borderRadius:8}}),(0,S.jsxs)("div",{style:{flex:1,minWidth:240},children:[(0,S.jsx)("div",{style:{fontWeight:700,fontSize:18,marginBottom:4},children:p.title}),p.description&&(0,S.jsx)("div",{style:{opacity:.8},children:p.description}),(0,S.jsxs)("div",{style:{marginTop:8,fontSize:14,opacity:.8},children:["Konec: ",I(p.end_at)]}),(0,S.jsxs)("div",{style:{marginTop:6,display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[(0,S.jsxs)("span",{style:{fontSize:13,background:"#eef",color:"#223",padding:"2px 8px",borderRadius:12},children:["Vstup: ",p.entry_cost_points?"".concat(p.entry_cost_points," bod\u016f"):"zdarma"]}),p.max_entries_per_user>1&&(0,S.jsxs)("span",{style:{fontSize:13,background:"#f3f3f3",color:"#333",padding:"2px 8px",borderRadius:12},children:["max ",p.max_entries_per_user,"\xd7/osoba"]})]})]}),v?y?(0,S.jsx)("span",{style:{fontWeight:600},children:"U\u017e jste p\u0159ihl\xe1\u0161eni do sout\u011b\u017ee \u2713"}):f?(0,S.jsx)("button",{className:"btn",onClick:async()=>{if(p){l(!0);try{await(0,R.d1)(p.id),h({status:"success",title:"\xdasp\u011b\u0161n\u011b jste se p\u0159ihl\xe1sili do sout\u011b\u017ee"}),await m()}catch(n){var e,t;const a=(null===n||void 0===n||null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||"Nelze se p\u0159ihl\xe1sit do sout\u011b\u017ee";h({status:"error",title:a})}finally{l(!1)}}},disabled:s,children:s?"P\u0159ihla\u0161uji\u2026":"P\u0159ihl\xe1sit do sout\u011b\u017ee"}):(0,S.jsx)("span",{style:{fontWeight:600},children:"Vstup nen\xed dostupn\xfd"}):(0,S.jsx)("a",{href:"/login",className:"btn",style:{padding:"10px 16px"},children:e("auth.login")})]})]}),"finalized"===g&&(0,S.jsxs)("div",{children:[(0,S.jsxs)("div",{className:"section-head",style:{marginTop:0},children:[(0,S.jsx)("h3",{children:"V\xfdherci sout\u011b\u017ee"}),p.rules_url&&(0,S.jsx)("a",{href:(0,P.V)(p.rules_url),className:"see-all",target:"_blank",rel:"noreferrer noopener",children:"Pravidla"})]}),0===x.length?(0,S.jsx)("div",{children:"V\xfdherci budou vyhl\xe1\u0161eni brzy."}):(0,S.jsxs)("div",{children:[!(null!==n&&void 0!==n&&n.visual_played_at)&&v&&(0,S.jsx)("div",{style:{marginBottom:12},children:c?(0,S.jsxs)("div",{style:{padding:16,border:"1px dashed #999",borderRadius:8,textAlign:"center"},children:[(0,S.jsx)("div",{style:{fontWeight:700,marginBottom:6},children:"Losuji v\xfdherce\u2026"}),(0,S.jsx)("div",{className:"spinner",style:{width:24,height:24,borderRadius:"50%",border:"3px solid #ccc",borderTopColor:"#333",margin:"0 auto",animation:"spin 0.9s linear infinite"}})]}):(0,S.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,S.jsx)("button",{className:"btn",onClick:async()=>{if(!p)return;d(!0);const e=setTimeout(async()=>{try{await(0,R.v9)(p.id)}catch(e){}d(!1),await m()},2500);return()=>clearTimeout(e)},children:"Spustit losov\xe1n\xed"}),(0,S.jsx)("span",{style:{opacity:.8,fontSize:14},children:"(animace pouze jednou na u\u017eivatele)"})]})}),(0,S.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:12},children:x.map(e=>(0,S.jsxs)("div",{className:"card",style:{padding:12},children:[(0,S.jsx)("div",{style:{fontWeight:700},children:e.prize_name||"V\xfdhra"}),(0,S.jsxs)("div",{style:{fontSize:14,opacity:.8},children:["V\xfdherce: ",t&&e.user_id===t.id?"Vy":"Vybran\xfd u\u017eivatel"]})]},e.id))}),b&&(0,S.jsxs)("div",{style:{marginTop:8},children:[(0,S.jsx)("div",{style:{fontWeight:800},children:"Vyhr\xe1li jste! V\xedce informac\xed najdete ve sv\xe9m e-mailu."}),(0,S.jsxs)("div",{style:{marginTop:6},children:["Pokud pot\u0159ebujete pomoc, ",(0,S.jsx)("a",{href:"/kontakt?subject="+encodeURIComponent("Sout\u011b\u017e \u2013 v\xfdhra: "+(p.title||"")),className:"see-all",children:"kontaktujte n\xe1s"}),"."]})]})]})]})]}),(0,S.jsx)("style",{children:"@keyframes spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}"})]})};var L=n(85638);const W=["__ts"],U=o.lazy(()=>n.e(469).then(n.bind(n,69469))),O=o.lazy(()=>n.e(910).then(n.bind(n,15910))),q=o.lazy(()=>n.e(154).then(n.bind(n,91154))),K=o.lazy(()=>Promise.resolve().then(n.bind(n,48644))),B=o.lazy(()=>Promise.resolve().then(n.bind(n,86403))),Z=o.lazy(()=>n.e(771).then(n.bind(n,69771))),V=o.lazy(()=>n.e(558).then(n.bind(n,29558))),H=o.lazy(()=>Promise.resolve().then(n.bind(n,2210))),$=o.lazy(()=>n.e(334).then(n.bind(n,1334))),J=o.lazy(()=>n.e(118).then(n.bind(n,58118))),G=o.lazy(()=>Promise.resolve().then(n.bind(n,69522))),X=o.lazy(()=>n.e(339).then(n.bind(n,22339)));const Y=()=>{const{t:e}=(0,z.Bd)(),[t,n]=(0,o.useState)([]),[_,w]=(0,o.useState)([]),[A,R]=(0,o.useState)(""),[F,P]=(0,o.useState)(""),[I,Y]=(0,o.useState)(""),[Q,ee]=(0,o.useState)([]),[te,ne]=(0,o.useState)(0),[ae,ie]=(0,o.useState)("grid"),[oe,re]=(0,o.useState)(null),[se,le]=(0,o.useState)(null),[ce,de]=(0,o.useState)(null),[ue,he]=(0,o.useState)(null),[me,pe]=(0,o.useState)(null),[xe,ge]=(0,o.useState)(e("homepage.gallery")),[ve,je]=(0,o.useState)("light"),[be,ye]=(0,o.useState)(e("common.all")),[fe,ke]=(0,o.useState)("grid"),[_e,we]=(0,o.useState)(0),[ze,Se]=(0,o.useState)(0),[Ae,Ce]=(0,o.useState)(!1),[Ee,Te]=(0,o.useState)(0),[De,Ne]=((0,o.useRef)(null),(0,o.useState)([])),[Re,Fe]=(0,o.useState)(0),[Pe,Ie]=(0,o.useState)(null),[Me,Le]=(0,o.useState)(!1),[We,Ue]=(0,o.useState)(null),[Oe,qe]=(0,o.useState)(!1),[Ke,Be]=(0,o.useState)(0),[Ze,Ve]=(0,o.useState)(void 0),[He,$e]=(0,o.useState)(112),[Je,Ge]=(0,o.useState)([]),[Xe,Ye]=(0,o.useState)([]),[Qe,et]=(0,o.useState)([]),[tt,nt]=(0,o.useState)([]),[at,it]=(0,o.useState)([]),[ot,rt]=(0,o.useState)([]),[st,lt]=(0,o.useState)([]),[ct,dt]=(0,o.useState)(!1),[ut,ht]=(0,o.useState)([]),[mt,pt]=(0,o.useState)(!1),[xt,gt]=(0,o.useState)(!1),[vt,jt]=(0,o.useState)([]),[bt,yt]=(0,o.useState)({}),[ft,kt]=(0,o.useState)(null),[_t,wt]=(0,o.useState)(!0),[zt,St]=(0,o.useState)(!1),{user:At}=(0,N.A)(),{getVariant:Ct,isVisible:Et,getStyles:Tt,loading:Dt,refreshKey:Nt}=(0,y.N)("homepage"),Rt=Ct("style-pack","default"),Ft=Ct("container","boxed");(0,o.useEffect)(()=>{try{const e="style-pack-".concat(Rt);["style-pack-default","style-pack-modern","style-pack-minimal","style-pack-sparta"].forEach(e=>document.body.classList.remove(e)),document.body.classList.add(e)}catch(e){}},[Rt]),(0,o.useEffect)(()=>{(window.requestIdleCallback||(e=>setTimeout(e,1)))(()=>gt(!0))},[]),(0,o.useEffect)(()=>{try{const e="undefined"!==typeof document&&document.body.classList.contains("myuibrix-edit-mode");St(!!e)}catch(e){}},[]),(0,o.useEffect)(()=>{const e=()=>{try{const e=document.querySelector('header[data-element="header"]')||document.querySelector("header"),t=e?Math.round(e.getBoundingClientRect().height):96;$e(Math.max(64,t+16))}catch(e){}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[Nt]);const Pt=(0,o.useMemo)(()=>tt.map((e,t)=>({id:"number"===typeof e.id?e.id:t,title:e.title,excerpt:e.excerpt,image:e.image,date:e.date,category:e.category?{id:t,name:e.category}:void 0,slug:e.slug})),[tt]),It=(0,o.useMemo)(()=>{const e=Date.now();try{return(De||[]).map((t,n)=>{const a=(Array.isArray(null===t||void 0===t?void 0:t.matches)?t.matches:[]).some(t=>{const n=new Date("".concat(t.date||"","T").concat(t.time||"00:00",":00")).getTime();return!isNaN(n)&&n>e});return a?n:-1}).filter(e=>-1!==e)}catch(t){return[]}},[De]);return(0,o.useEffect)(()=>{try{if(!Array.isArray(It)||0===It.length)return;It.includes(Ke)||Be(It[0])}catch(e){}},[It,Ke]),(0,o.useEffect)(()=>{try{Be(Re)}catch(e){}},[Re]),(0,o.useEffect)(()=>{let t=!1;const o=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){const t=new URL(f.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return new URL(e,t).toString()}return e}catch(t){return e}},r=async e=>{try{const t=await fetch(o(e),{cache:"no-cache"});if(!t.ok)throw new Error("HTTP ".concat(t.status));return await t.json()}catch(t){return null}};return(async()=>{const[s,l,c,v,j,b,y,f,k]=await Promise.all([r("/cache/prefetch/articles.json"),r("/cache/prefetch/matches.json"),r("/cache/prefetch/settings.json"),r("/cache/prefetch/facr_club_info.json"),r("/cache/prefetch/facr_tables.json"),r("/api/v1/public/team-logo-overrides?t=".concat(Date.now())),r("/cache/prefetch/team_logo_overrides.json"),r("/api/v1/matches?t=".concat(Date.now())),r("/api/v1/matches/history?t=".concat(Date.now()))]);let _=[];try{_=await(0,g.xN)()}catch(M){}const z={};(_||[]).forEach(e=>{null!==e&&void 0!==e&&e.code&&null!==e&&void 0!==e&&e.alias&&(z[e.code]={alias:e.alias,original_name:e.original_name,display_order:e.display_order})});let S=null;try{S=await(0,d.l3)()}catch(U){}if(!t){var A,C;n((R=s)?(Array.isArray(R)?R:Array.isArray(null===R||void 0===R?void 0:R.items)?R.items:Array.isArray(null===R||void 0===R?void 0:R.data)?R.data:[]).slice(0,6).map((e,t)=>{var n,a,i,o,r,s,l,c,d,u,h,m,p,x,g,v,j,b,y,f,k;return{id:null!==(n=e.id)&&void 0!==n?n:t+1,title:null!==(a=null!==(i=e.title)&&void 0!==i?i:e.name)&&void 0!==a?a:"Article",excerpt:null!==(o=null!==(r=null!==(s=e.excerpt)&&void 0!==s?s:e.summary)&&void 0!==r?r:null===(l=e.content)||void 0===l||null===(c=l.slice)||void 0===c?void 0:c.call(l,0,140))&&void 0!==o?o:"",image:null!==(d=null!==(u=null!==(h=e.imageUrl)&&void 0!==h?h:e.image_url)&&void 0!==u?u:e.cover)&&void 0!==d?d:"/images/news/placeholder.jpg",date:null!==(m=null!==(p=null!==(x=null!==(g=e.createdAt)&&void 0!==g?g:e.created_at)&&void 0!==x?x:e.publishedAt)&&void 0!==p?p:e.published_at)&&void 0!==m?m:(new Date).toISOString(),category:null!==(v=null!==(j=null===(b=e.category)||void 0===b?void 0:b.name)&&void 0!==j?j:e.category)&&void 0!==v?v:"News",slug:null!==(y=null!==(f=null!==(k=e.slug)&&void 0!==k?k:e.urlSlug)&&void 0!==f?f:e.seoSlug)&&void 0!==y?y:void 0}}):[]),jt(_||[]),yt(z);const t=S||c,r=b&&(b.by_name||b.by_id)?b:y||{},d=(null===r||void 0===r?void 0:r.by_name)||{},g=(null===r||void 0===r?void 0:r.by_id)||{},M=e=>String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),U=e=>{let t=M(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,"").replace(/\s+/g," ").trim(),t},V=Object.keys(d||{}).reduce((e,t)=>(e[M(t)]=d[t],e),{}),H=Object.keys(d||{}).map(e=>({keyNorm:U(e),url:d[e]})),$=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[\u2012\u2013\u2014\u2015\u2212]/g,"-").replace(/\bn\.?\b/g," nad ").replace(/\bp\.?\b/g," pod ").replace(/[\,\s]*(z\.?\s*s\.?|o\.?\s*s\.?)\s*$/g,"").replace(/[\.,!;:()\[\]{}]/g," ").replace(/\s+/g," ").trim().toLowerCase(),J=(()=>{const e={};for(const n of Object.values(g||{})){const t=String((null===n||void 0===n?void 0:n.name)||"").trim(),a=String((null===n||void 0===n?void 0:n.logo_url)||"").trim();t&&a&&(e[a]=t)}const t={};for(const[n,a]of Object.entries(d||{})){const i=e[String(a)]||"",o=$(n);i&&o&&(t[o]=i)}return t})(),G=(()=>{const e={};for(const[t,n]of Object.entries(g||{})){const a=String((null===n||void 0===n?void 0:n.name)||"").trim(),i=String((null===n||void 0===n?void 0:n.logo_url)||"").trim();if(!a)continue;const o=$(a);o&&(e[o]={id:t,name:a,logo_url:i})}return e})(),X=(e,t)=>{var n;const a=t?String(t):"";if(a&&null!==g&&void 0!==g&&null!==(n=g[a])&&void 0!==n&&n.name&&String(g[a].name).trim())return String(g[a].name).trim();try{const t=$(e);if(J[t])return J[t];let n=G[t];if(!n)for(const[e,a]of Object.entries(G))if(e&&(t.endsWith(e)||e.endsWith(t))){n=a;break}if(n&&n.name)return String(n.name)}catch(i){}return String(e||"")},Q=(e,t)=>{if(e){const t=(d||{})[e],n=M(e);let a=t||V[n];if(!a){const t=U(e);for(const{keyNorm:e,url:n}of H)if(e&&(t.endsWith(e)||e.endsWith(t))){a=n;break}}if(a)return"string"===typeof a&&a.startsWith("/")?o(a):a}if(t)return"string"===typeof t&&t.startsWith("/")?o(t):t},te=(e,n,a)=>{var i;if(n&&null!==g&&void 0!==g&&null!==(i=g[n])&&void 0!==i&&i.logo_url){const e=g[n].logo_url;return"string"===typeof e&&e.startsWith("/")?o(e):e}try{if(n&&null!==t&&void 0!==t&&t.club_id&&String(n)===String(t.club_id)&&null!==t&&void 0!==t&&t.club_logo_url){const e=t.club_logo_url;return"string"===typeof e&&e.startsWith("/")?o(e):e}}catch(r){}return n?"http://logoapi.sportcreative.eu/logos/".concat(n):Q(e,a)},ne={},ae=e=>{if(Array.isArray(e))for(const t of e){const e=String((null===t||void 0===t?void 0:t.match_id)||(null===t||void 0===t?void 0:t.id)||"").trim(),n=String((null===t||void 0===t?void 0:t.score)||"").trim();e&&n&&(ne[e]=n)}};if(ae(f),ae(k),null!==v&&void 0!==v&&null!==(A=v.competitions)&&void 0!==A&&A.length){var E;const e=(v.competitions||[]).flatMap(e=>(Array.isArray(e.matches)?e.matches:[]).map((t,n)=>{const a=String(t.date_time||""),[i,o]=a.includes(" ")?a.split(" "):[a,""],[r,s,l]=i.split("."),c=r&&s&&l?"".concat(l,"-").concat(s.padStart(2,"0"),"-").concat(r.padStart(2,"0")):(new Date).toISOString().slice(0,10),d=(o||"18:00").slice(0,5),u=String(t.match_id||"").trim(),h=u&&ne[u]?ne[u]:t.score;return{id:t.match_id||n+1,homeTeam:X(t.home,t.home_id),awayTeam:X(t.away,t.away_id),competition:t.competition||t.competition_name||(null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.code)||"",date:c,time:d,venue:t.venue||"",isHome:null===v||void 0===v||!v.name||(t.home||"").toLowerCase().includes(String(v.name).toLowerCase()),homeLogoURL:te(t.home,t.home_id,t.home_logo_url),awayLogoURL:te(t.away,t.away_id,t.away_logo_url),score:h,facr_link:t.facr_link,report_url:t.report_url}})),t=(e,t)=>new Date("".concat(e,"T").concat(t||"00:00",":00")).getTime(),n=Date.now(),o=12096e5,r=n-o,s=n+o,l=e.map(e=>(0,i.A)((0,i.A)({},e),{},{__ts:t(e.date,e.time)})).filter(e=>{const t=e.__ts;return"number"===typeof t&&!isNaN(t)&&t>=r&&t<=s}).sort((e,t)=>e.__ts-t.__ts).map(e=>{let{__ts:t}=e;return(0,a.A)(e,W)});w(l);const c=(v.competitions||[]).map(e=>{var t,n;const a=(Array.isArray(e.matches)?e.matches:[]).map((e,t)=>{const n=String(e.date_time||""),[a,i]=n.includes(" ")?n.split(" "):[n,""],[o,r,s]=(a||"").split("."),l=o&&r&&s?"".concat(s,"-").concat(r.padStart(2,"0"),"-").concat(o.padStart(2,"0")):(new Date).toISOString().slice(0,10),c=(i||"18:00").slice(0,5),d=String(e.match_id||"").trim(),u=d&&ne[d]?ne[d]:e.score,h=X(e.home,e.home_id),m=X(e.away,e.away_id);return{id:e.match_id||t+1,date:l,time:c,home:h,away:m,home_id:e.home_id,away_id:e.away_id,home_logo_url:te(h,e.home_id,e.home_logo_url),away_logo_url:te(m,e.away_id,e.away_logo_url),score:u,facr_link:e.facr_link,report_url:e.report_url,venue:e.venue||""}}),i=a.filter(e=>{const t=new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime();return!isNaN(t)&&t>=r&&t<=s});return{name:(null===z||void 0===z||null===(t=z[null===e||void 0===e?void 0:e.code])||void 0===t?void 0:t.alias)||e.name||e.code||"Sout\u011b\u017e",matches_link:e.matches_link,matches:i,display_order:null===z||void 0===z||null===(n=z[null===e||void 0===e?void 0:e.code])||void 0===n?void 0:n.display_order}}),d=(0,L.tJ)(c);Ne(d);const u=null===l||void 0===l?void 0:l[0];Ve(u&&(u.facr_link||u.report_url)||(null===c||void 0===c||null===(E=c[0])||void 0===E?void 0:E.matches_link)||(null===v||void 0===v?void 0:v.url))}else w((e=>e?(Array.isArray(e)?e:Array.isArray(null===e||void 0===e?void 0:e.items)?e.items:Array.isArray(null===e||void 0===e?void 0:e.data)?e.data:[]).slice(0,2).map((e,t)=>{var n,a,i,o,r,s,l,c,d,u,h,m,p,x,g,v,j,b,y,f,k,_,w,z,S,A,C,E;return{id:null!==(n=e.id)&&void 0!==n?n:t+1,homeTeam:null!==(a=null!==(i=null!==(o=e.homeTeam)&&void 0!==o?o:e.home_team)&&void 0!==i?i:e.home)&&void 0!==a?a:"Home",awayTeam:null!==(r=null!==(s=null!==(l=e.awayTeam)&&void 0!==l?l:e.away_team)&&void 0!==s?s:e.away)&&void 0!==r?r:"Away",competition:null!==(c=null!==(d=e.competition)&&void 0!==d?d:e.league)&&void 0!==c?c:"Match",date:null!==(u=null!==(h=null!==(m=e.date)&&void 0!==m?m:e.kickoffDate)&&void 0!==h?h:e.kickoff_date)&&void 0!==u?u:(new Date).toISOString().slice(0,10),time:null!==(p=null!==(x=null!==(g=e.time)&&void 0!==g?g:e.kickoffTime)&&void 0!==x?x:e.kickoff_time)&&void 0!==p?p:"18:00",venue:null!==(v=e.venue)&&void 0!==v?v:"Stadium",isHome:Boolean(null===(j=null!==(b=e.isHome)&&void 0!==b?b:e.is_home)||void 0===j||j),homeLogoURL:null!==(y=null!==(f=null!==(k=null!==(_=null!==(w=e.homeLogoURL)&&void 0!==w?w:e.HomeLogoURL)&&void 0!==_?_:e.home_logo_url)&&void 0!==k?k:e.home_logo)&&void 0!==f?f:e.homeLogo)&&void 0!==y?y:void 0,awayLogoURL:null!==(z=null!==(S=null!==(A=null!==(C=null!==(E=e.awayLogoURL)&&void 0!==E?E:e.AwayLogoURL)&&void 0!==C?C:e.away_logo_url)&&void 0!==A?A:e.away_logo)&&void 0!==S?S:e.awayLogo)&&void 0!==z?z:void 0}}):[])(l));if(kt(t),t){var T,D,N;const a=(null===t||void 0===t?void 0:t.club_name)||(null===t||void 0===t?void 0:t.clubName)||(null===t||void 0===t?void 0:t.name)||(null===t||void 0===t?void 0:t.siteName),i=(null===t||void 0===t?void 0:t.club_logo_url)||(null===t||void 0===t?void 0:t.clubLogo)||(null===t||void 0===t?void 0:t.logo)||(null===t||void 0===t?void 0:t.logoUrl)||(null===t||void 0===t?void 0:t.logoURL);a&&P(a),i&&Y(i);try{const e=(await(0,h.Dq)()||[]).map(e=>({id:e.id,name:[e.first_name,e.last_name].filter(Boolean).join(" "),number:e.jersey_number,position:e.position,image:(0,u.uq)(e.image_url)||void 0,nationality:e.nationality,active:Boolean(e.is_active),age:function(e){if(!e)return;const t=new Date(e);if(isNaN(t.getTime()))return;const n=new Date;let a=n.getFullYear()-t.getFullYear();const i=n.getMonth()-t.getMonth();return(i<0||0===i&&n.getDate()<t.getDate())&&a--,a}(e.date_of_birth)}));Ge(e)}catch(O){}try{const e=(await(0,m.sJ)()||[]).map(e=>({id:e.id,name:e.name,logo:(0,u.uq)(e.logo_url)||"/images/sponsors/placeholder.png",url:e.website_url||void 0,tier:e.tier}));Ye(e)}catch(q){}try{const e=(await(0,p.Oh)({active:!0})||[]).map(e=>({id:e.id,name:e.name,image:(0,u.uq)(e.image_url)||"/images/sponsors/placeholder.png",url:e.click_url||void 0,placement:e.placement,width:"number"===typeof e.width?e.width:void 0,height:"number"===typeof e.height?e.height:void 0}));et(e)}catch(K){}try{const t=await(0,x.A0)({page_size:3}),a=((null===t||void 0===t?void 0:t.data)||[]).map((t,n)=>{var a,i,o,r;return{id:null!==(a=t.id)&&void 0!==a?a:n+1,title:t.title,excerpt:t.excerpt||(t.content||"").slice(0,140),image:t.image||t.image_url||"/images/news/placeholder.jpg",date:t.published_at||t.created_at||(new Date).toISOString(),category:(null===t||void 0===t||null===(i=t.category)||void 0===i?void 0:i.name)||(null===t||void 0===t?void 0:t.category_name)||e("homepage.latest_news"),slug:t.slug,readTime:null!==(o=null===t||void 0===t?void 0:t.read_time)&&void 0!==o?o:null===t||void 0===t?void 0:t.estimated_read_minutes,viewCount:null!==(r=null===t||void 0===t?void 0:t.view_count)&&void 0!==r?r:null===t||void 0===t?void 0:t.read_count}}).slice(0,3);nt(a),n(e=>{const t=new Set(a.map(e=>e.slug?"s:".concat(e.slug):"i:".concat(e.id)));return(e||[]).filter(e=>!t.has(e.slug?"s:".concat(e.slug):"i:".concat(e.id)))});try{const t=await(0,x.GE)({page:1,page_size:12,published:!0}),i=((null===t||void 0===t?void 0:t.data)||[]).map((t,n)=>{var a,i,o,r;return{id:null!==(a=t.id)&&void 0!==a?a:n+1,title:t.title,excerpt:t.excerpt||(t.content||"").slice(0,140),image:t.image||t.image_url||"/images/news/placeholder.jpg",date:t.published_at||t.created_at||(new Date).toISOString(),category:(null===t||void 0===t||null===(i=t.category)||void 0===i?void 0:i.name)||(null===t||void 0===t?void 0:t.category_name)||e("homepage.latest_news"),slug:t.slug,readTime:null!==(o=null===t||void 0===t?void 0:t.read_time)&&void 0!==o?o:null===t||void 0===t?void 0:t.estimated_read_minutes,viewCount:null!==(r=null===t||void 0===t?void 0:t.view_count)&&void 0!==r?r:null===t||void 0===t?void 0:t.read_count,featured:t.featured||!1}}),o=new Set(a.map(e=>e.id)),r=i.filter(e=>!o.has(e.id)&&!e.featured);n(r)}catch(B){}}catch(Z){}const o=(null===t||void 0===t?void 0:t.shop_url)||(null===t||void 0===t?void 0:t.shopUrl)||(null===t||void 0===t?void 0:t.eshop_url)||(null===t||void 0===t?void 0:t.e_shop_url)||null;o&&re(String(o));const r=(null===t||void 0===t?void 0:t.hero_style)||(null===t||void 0===t||null===(T=t.homepage)||void 0===T?void 0:T.hero_style)||(null===t||void 0===t?void 0:t.frontpage_hero_style);"grid"!==r&&"scroller"!==r&&"swiper"!==r&&"swiper_full"!==r||ke(r);const s=(null===t||void 0===t||null===(D=t.homepage)||void 0===D?void 0:D.sponsors_layout)||(null===t||void 0===t?void 0:t.sponsors_layout)||(null===t||void 0===t?void 0:t.sponsorsLayout);"slider"!==s&&"grid"!==s&&"scroller"!==s&&"pyramid"!==s||ie(s);const l=(null===t||void 0===t?void 0:t.sponsors_theme)||(null===t||void 0===t||null===(N=t.homepage)||void 0===N?void 0:N.sponsors_theme)||(null===t||void 0===t?void 0:t.sponsorsTheme);"dark"!==l&&"light"!==l||je(l);const c=(null===t||void 0===t?void 0:t.sponsors)||(null===t||void 0===t?void 0:t.partners)||null;Array.isArray(c)&&c.length&&Ye(c.map((e,t)=>{var n;return{id:null!==(n=e.id)&&void 0!==n?n:t+1,name:e.name||"Sponsor",logo:e.logo_url||e.logoUrl||e.logo||"/images/sponsors/placeholder.png",url:e.url||e.website||e.link||"#",tier:e.tier}})),le((null===t||void 0===t?void 0:t.facebook_url)||null),de((null===t||void 0===t?void 0:t.instagram_url)||null),he((null===t||void 0===t?void 0:t.youtube_url)||null),pe((null===t||void 0===t?void 0:t.gallery_url)||(null===t||void 0===t?void 0:t.zonerama_url)||null),ge((null===t||void 0===t?void 0:t.gallery_label)||e("homepage.gallery")),Array.isArray(null===t||void 0===t?void 0:t.videos)&&it(t.videos),Array.isArray(null===t||void 0===t?void 0:t.videos_items)&&rt(t.videos_items),"boolean"===typeof(null===t||void 0===t?void 0:t.merch_module_enabled)&&dt(!!t.merch_module_enabled),Array.isArray(null===t||void 0===t?void 0:t.merch_items)&&lt(t.merch_items.map((e,t)=>{var n;return{id:null!==(n=e.id)&&void 0!==n?n:t,title:e.title,image_url:e.image_url,url:e.url}}))}if(null!==j&&void 0!==j&&null!==(C=j.competitions)&&void 0!==C&&C.length){const e=(j.competitions||[]).map(e=>{var t,n,a;return{name:(null===z||void 0===z||null===(t=z[null===e||void 0===e?void 0:e.code])||void 0===t?void 0:t.alias)||e.name||e.code,display_order:null===z||void 0===z||null===(n=z[null===e||void 0===e?void 0:e.code])||void 0===n?void 0:n.display_order,code:e.code,table:((null===(a=e.table)||void 0===a?void 0:a.overall)||[]).map((e,t)=>({position:Number(e.rank||t+1),team:e.team||e.team_name||"-",team_logo_url:te(e.team||e.team_name,e.team_id,e.team_logo_url),team_id:e.team_id,points:Number(e.points||e.pts||0),played:Number(e.played||0),wins:Number(e.wins||0),draws:Number(e.draws||0),losses:Number(e.losses||0),score:e.score||"0:0"}))}}),t=(0,L.tJ)(e);ee(t)}v&&(v.name&&!F&&P(v.name),v.logo_url&&!I&&Y(v.logo_url),v.name&&P(v.name),v.logo_url&&Y(v.logo_url)),wt(!1)}var R})(),()=>{t=!0}},[]),(0,o.useEffect)(()=>{const e=()=>{if(De.length){const e=(e=>{var t;return(null===(t=(Array.isArray(null===e||void 0===e?void 0:e.matches)?e.matches:[]).map(e=>({m:e,t:new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime()})).filter(e=>!isNaN(e.t)&&e.t>Date.now()).sort((e,t)=>e.t-t.t)[0])||void 0===t?void 0:t.m)||null})(De[Math.max(0,Math.min(Re,De.length-1))]);if(e){const t="".concat(e.date,"T").concat(e.time||"00:00",":00"),n=new Date(t);return isNaN(n.getTime())?null:n}}if(!_.length)return null;const e=_[0],t="".concat(e.date,"T").concat(e.time||"00:00",":00"),n=new Date(t);return isNaN(n.getTime())?null:n},t=()=>{const t=e();if(!t)return void R("");const n=t.getTime()-Date.now();if(n<=0)return void R("Za\u010d\xe1tek");const a=Math.floor(n/1e3),i=Math.floor(a/86400),o=Math.floor(a%86400/3600),r=Math.floor(a%3600/60),s=a%60;R("".concat(i," d ").concat(o," h ").concat(r," m ").concat(s," s"))};t();const n=setInterval(t,1e3);return()=>clearInterval(n)},[_,De,Re]),(0,o.useEffect)(()=>{let e=!0;return(async()=>{try{const t=(await(0,v.y6)()||[]).map(e=>({id:e.id,title:e.title,start_time:e.start_time,end_time:e.end_time,location:e.location,type:e.type,image_url:e.image_url}));e&&ht(t)}catch(t){}finally{e&&pt(!0)}})(),()=>{e=!1}},[]),(0,S.jsxs)(l.A,{showSponsorsSection:!1,children:[(0,S.jsxs)("div",{className:"container","data-element":"container","data-variant":Ft,style:"fullwidth"===Ft?(0,i.A)({maxWidth:"100%",paddingLeft:0,paddingRight:0},Tt("container")):"wide"===Ft?(0,i.A)({maxWidth:"1400px"},Tt("container")):(0,i.A)({},Tt("container")),children:[(0,S.jsx)("div",{"data-element":"style-pack","data-variant":Rt,style:{display:"none"}}),Et("hero-topbar",!0)&&(0,S.jsx)("section",{"data-element":"hero-topbar","data-variant":Ct("hero-topbar","minimal"),style:(0,i.A)({},Tt("hero-topbar")),children:(0,S.jsx)(C,{variant:Ct("hero-topbar","minimal"),fullBleed:"fullwidth"===Ct("header","unified")})},"hero-topbar-".concat(Nt,"-").concat(Ct("hero-topbar","minimal"))),!Et("hero-topbar",!0)&&(0,S.jsxs)("div",{className:"home-header",children:[(0,S.jsx)(k.L,{teamId:null===ft||void 0===ft?void 0:ft.club_id,teamName:F,facrLogo:(0,u.uq)(I)||void 0,size:"custom",alt:"Klub",borderRadius:"full",style:{width:56,height:56}}),(0,S.jsxs)("div",{children:[(0,S.jsx)("h1",{style:{margin:0},children:F}),(0,S.jsx)("div",{className:"subtitle",style:{fontSize:"0.95rem"},children:e("homepage.official_website")})]})]}),"grid"===Ct("hero",fe)&&Et("hero",!0)&&(0,S.jsxs)("section",{"data-element":"hero","data-variant":Ct("hero",fe),className:"hero-grid",style:(0,i.A)({position:"relative"},Tt("hero")),children:[tt[0]?(0,S.jsxs)("a",{href:"/news/".concat(tt[0].slug||tt[0].id),className:"hero-card big",style:{textDecoration:"none"},children:[(0,S.jsx)("div",{className:"bg",style:{backgroundImage:"url(".concat((0,u.uq)(tt[0].image)||"/images/news/placeholder.jpg",")")}}),(0,S.jsxs)("div",{className:"overlay",children:[(0,S.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",opacity:.9,fontSize:"0.8rem",color:"#ffffff"},children:[(0,S.jsx)("span",{children:tt[0].category||e("homepage.latest_news")}),"number"===typeof tt[0].readTime&&tt[0].readTime>0&&(0,S.jsxs)("span",{children:[tt[0].readTime," ",e("common.read_time")]})]}),(0,S.jsx)("h2",{style:{margin:"4px 0 0 0",color:"#ffffff"},children:tt[0].title})]})]}):_t?(0,S.jsx)("div",{className:"hero-card big skeleton",style:{borderRadius:16}}):(0,S.jsxs)("a",{href:"/news",className:"hero-card big",style:{textDecoration:"none"},children:[(0,S.jsx)("div",{className:"bg",style:{backgroundImage:"url('/images/news/placeholder.jpg')"}}),(0,S.jsxs)("div",{className:"overlay",children:[(0,S.jsx)("div",{style:{opacity:.9,fontSize:"0.8rem",color:"#ffffff"},children:e("homepage.latest_news")}),(0,S.jsx)("h2",{style:{margin:"4px 0 0 0",color:"#ffffff"},children:e("homepage.latest_title")})]})]}),(0,S.jsxs)("div",{className:"small-col",children:[tt.slice(1,3).map((t,n)=>(0,S.jsxs)("a",{href:"/news/".concat(t.slug||t.id),className:"hero-card small",style:{textDecoration:"none"},children:[(0,S.jsx)("div",{className:"bg",style:{backgroundImage:"url(".concat((0,u.uq)(t.image)||"/images/news/placeholder.jpg",")")}}),(0,S.jsxs)("div",{className:"overlay",children:[(0,S.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",opacity:.9,fontSize:"0.8rem",color:"#ffffff"},children:[(0,S.jsx)("span",{children:t.category||e("homepage.latest_news")}),"number"===typeof t.readTime&&t.readTime>0&&(0,S.jsxs)("span",{children:[t.readTime," ",e("common.read_time")]})]}),(0,S.jsx)("h3",{style:{margin:"4px 0 0 0",color:"#ffffff"},children:t.title})]})]},t.id)),Array.from({length:Math.max(0,2-Math.min(2,Math.max(0,tt.length-1)))}).map((t,n)=>_t?(0,S.jsx)("div",{className:"hero-card small skeleton",style:{borderRadius:16}},"placeholder-".concat(n)):(0,S.jsxs)("a",{href:"/news",className:"hero-card small",style:{textDecoration:"none"},children:[(0,S.jsx)("div",{className:"bg",style:{backgroundImage:"url('/images/news/placeholder.jpg')",filter:"grayscale(50%) brightness(0.7)"}}),(0,S.jsxs)("div",{className:"overlay",children:[(0,S.jsx)("div",{style:{opacity:.8,fontSize:"0.8rem",color:"#fff"},children:e("homepage.latest_news")}),(0,S.jsx)("h3",{style:{margin:"4px 0 0 0",color:"#fff"},children:e("message.loading")})]})]},"placeholder-".concat(n)))]})]},"hero-grid-".concat(Nt)),(Qe||[]).some(e=>"homepage_middle"===e.placement)&&Et("banner",!0)&&(0,S.jsx)("section",{"data-element":"banner","data-variant":Ct("banner","top"),className:"banner banner-middle",style:(0,i.A)({margin:"24px 0",textAlign:"center"},Tt("banner")),children:(Qe||[]).filter(e=>"homepage_middle"===e.placement).map(e=>(0,S.jsx)("a",{href:e.url||"#",target:e.url?"_blank":void 0,rel:e.url?"noopener noreferrer":void 0,style:{display:"inline-block",margin:8},children:(0,S.jsx)("img",{loading:"lazy",decoding:"async",src:e.image,alt:e.name,style:{maxWidth:"100%",width:e.width?"".concat(e.width,"px"):void 0,height:e.height?"".concat(e.height,"px"):"auto"}})},e.id))}),"scroller"===Ct("hero",fe)&&Et("hero",!0)&&(0,S.jsx)("section",{"data-element":"hero","data-variant":Ct("hero",fe),style:(0,i.A)({position:"relative"},Tt("hero")),children:(0,S.jsx)(o.Suspense,{fallback:(0,S.jsx)("div",{style:{minHeight:240}}),children:(0,S.jsx)(O,{})})},"hero-scroller-".concat(Nt)),("swiper"===Ct("hero",fe)||"swiper_full"===Ct("hero",fe))&&Et("hero",!0)&&(0,S.jsx)("section",{"data-element":"hero","data-variant":Ct("hero",fe),style:(0,i.A)({position:"relative"},Tt("hero")),children:(0,S.jsx)(o.Suspense,{fallback:(0,S.jsx)("div",{style:{minHeight:280}}),children:(0,S.jsx)(q,{fallbackArticles:Pt})})},"hero-swiper-".concat(Nt)),Et("matches",!0)?De.length>0?(e=>{if(0===It.length)return null;const t=Math.max(0,Math.min(Re,De.length-1)),n=De[t],a=null===(e=(Array.isArray(null===n||void 0===n?void 0:n.matches)?n.matches:[]).map(e=>({m:e,t:new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime()})).filter(e=>!isNaN(e.t)&&e.t>Date.now()).sort((e,t)=>e.t-t.t)[0])||void 0===e?void 0:e.m;if(!a)return null;const o=a,r=o&&(o.facr_link||o.report_url)||(null===n||void 0===n?void 0:n.matches_link)||Ze,s=It.indexOf(t),l=It[(Math.max(0,s)-1+It.length)%It.length],c=It[(Math.max(0,s)+1)%It.length];return(0,S.jsx)(T.A,{data:o,competitionName:null===n||void 0===n?void 0:n.name,countdown:A,onPrev:()=>{Be(l),Fe(l)},onNext:()=>{Be(c),Fe(c)},onOpen:()=>{o?(Ue((0,i.A)((0,i.A)({},o),{},{competition:null===n||void 0===n?void 0:n.name})),qe(!0)):r&&window.open(r,"_blank","noopener,noreferrer")},elementProps:{"data-element":"matches","data-variant":Ct("matches","compact"),"aria-live":"polite",style:(0,i.A)({},Tt("matches"))}})})():(e=>{if(!_||0===_.length)return null;const t=null===(e=_.map(e=>({m:e,t:new Date("".concat(e.date,"T").concat(e.time||"00:00",":00")).getTime()})).filter(e=>!isNaN(e.t)&&e.t>Date.now()).sort((e,t)=>e.t-t.t)[0])||void 0===e?void 0:e.m;return t?(0,S.jsx)("div",{className:"card",children:(0,S.jsx)(T.A,{data:{home:(null===t||void 0===t?void 0:t.homeTeam)||F,home_logo_url:(null===t||void 0===t?void 0:t.homeLogoURL)||I,away:(null===t||void 0===t?void 0:t.awayTeam)||"Soupe\u0159",away_logo_url:null===t||void 0===t?void 0:t.awayLogoURL},countdown:A,elementProps:{"data-element":"matches","data-variant":Ct("matches","compact"),"aria-live":"polite",style:(0,i.A)({position:"relative"},Tt("matches"))}},"matches-".concat(Nt,"-").concat(Ct("matches","compact")))}):null})():null,(0,S.jsx)(M,{}),De.length>0&&(xt?(0,S.jsx)(o.Suspense,{fallback:null,children:(0,S.jsx)(X,{comps:De,activeIndex:Re,onActiveChange:Fe,onMatchClick:(e,t)=>{Ue((0,i.A)((0,i.A)({},e),{},{competition:t,competitionName:t})),qe(!0)},variant:Ct("matches-slider","carousel"),elementProps:{"data-element":"matches-slider","data-variant":Ct("matches-slider","carousel"),style:(0,i.A)({position:"relative"},Tt("matches-slider"))}},"matches-slider-".concat(Nt,"-").concat(Ct("matches-slider","carousel")))}):null),0===De.length&&_t&&(0,S.jsxs)("section",{"data-element":"matches-slider","data-variant":Ct("matches-slider","carousel"),"aria-label":"Z\xe1pasy",style:(0,i.A)({position:"relative",contentVisibility:"auto",containIntrinsicSize:"280px"},Tt("matches-slider")),children:[(0,S.jsxs)("div",{className:"section-head",style:{marginTop:16,marginBottom:16},children:[(0,S.jsx)("h3",{children:e("nav.matches")}),(0,S.jsx)("a",{href:"/kalendar",className:"see-all",children:e("nav.all_matches")})]}),(0,S.jsx)("div",{style:{display:"flex",gap:18,overflow:"hidden",padding:"8px 2px 16px 2px"},children:[1,2,3].map(e=>(0,S.jsx)("div",{className:"card skeleton",style:{minWidth:340,height:160,borderRadius:12}},e))})]}),(()=>{const n=De[Re],a=(null===n||void 0===n?void 0:n.name)||"",r=Q.find(e=>e.name===a),s=!!r&&(r.table&&r.table.length>0||r.rows&&r.rows.length>0),l=Ct("news","grid_one"),d=Et("news",!0);let u=Et("table",!0)&&s;"grid_one"===l&&(u=!1);const h=d&&u?void 0:"standard";return d||u?(0,S.jsxs)("section",{className:"standings","data-variant":h,style:{marginTop:32},children:[d&&(0,S.jsxs)("section",{"data-element":"news","data-variant":l,className:"news-list","aria-labelledby":"home-news-heading",style:(0,i.A)((0,i.A)({},Tt("news")),{},{contentVisibility:"auto",containIntrinsicSize:"600px"}),children:[(0,S.jsxs)("div",{className:"section-head",style:{marginTop:0},children:[(0,S.jsx)("h3",{id:"home-news-heading",children:e("homepage.more_articles_home")}),(0,S.jsxs)("a",{href:"/news",className:"see-all",style:{fontSize:"0.85rem"},children:[e("nav.view_all")," ",(0,S.jsx)(c.dyV,{size:14})]})]}),"scroller"===l?(0,S.jsx)(O,{}):!_t||t&&0!==t.length?(0,S.jsx)(E.A,{items:t}):(0,S.jsx)("div",{className:"blog-list",children:[1,2,3,4].map(e=>(0,S.jsx)("div",{className:"card skeleton",style:{height:96,borderRadius:12}},e))})]},"news-".concat(Nt,"-").concat(l)),u&&(0,S.jsxs)("div",{"data-element":"table","data-variant":Ct("table","split_news"),role:"region","aria-labelledby":"home-table-heading",style:(0,i.A)((0,i.A)({},Tt("table")),{},{contentVisibility:"auto",containIntrinsicSize:"520px"}),children:[(0,S.jsxs)("div",{className:"section-head",style:{marginTop:0,marginBottom:12},children:[(0,S.jsx)("h3",{id:"home-table-heading",children:e("homepage.tables")}),(0,S.jsxs)("a",{href:"/tabulky",className:"see-all",style:{fontSize:"0.85rem"},children:[e("nav.view_all")," ",(0,S.jsx)(c.dyV,{size:14})]})]}),xt?(0,S.jsx)(o.Suspense,{fallback:null,children:(0,S.jsx)(G,{variant:"plain"===Ct("table_rows","logos")?"plain":"logos",rows:(null===r||void 0===r?void 0:r.table)||(null===r||void 0===r?void 0:r.rows)||[],onRowClick:e=>{var t,n,a,i,o,r,s,l,c,d,u,h,m,p,x,g,v,j;const b={team:null!==(t=null!==(n=null!==(a=null===(i=e.team)||void 0===i?void 0:i.name)&&void 0!==a?a:e.team)&&void 0!==n?n:e.club)&&void 0!==t?t:"-",team_id:e.team_id||"",team_logo_url:e.team_logo_url,rank:null!==(o=null!==(r=null!==(s=e.position)&&void 0!==s?s:e.pos)&&void 0!==r?r:e.rank)&&void 0!==o?o:0,played:null!==(l=null!==(c=e.played)&&void 0!==c?c:e.matches)&&void 0!==l?l:"-",wins:null!==(d=null!==(u=e.wins)&&void 0!==u?u:e.win)&&void 0!==d?d:"-",draws:null!==(h=null!==(m=e.draws)&&void 0!==m?m:e.draw)&&void 0!==h?h:"-",losses:null!==(p=null!==(x=e.losses)&&void 0!==x?x:e.loss)&&void 0!==p?p:"-",score:null!==(g=e.score)&&void 0!==g?g:"-",points:null!==(v=null!==(j=e.points)&&void 0!==j?j:e.pts)&&void 0!==v?v:"-"};Ie(b),Le(!0)}})}):(0,S.jsx)("div",{className:"table-card",children:(0,S.jsx)("div",{className:"standings",children:[1,2,3,4,5,6,7,8].map(e=>(0,S.jsx)("div",{className:"standing-row skeleton",style:{borderRadius:12}},e))})}),(Qe||[]).some(e=>"homepage_under_table"===e.placement)&&(xt?(0,S.jsx)(o.Suspense,{fallback:null,children:(0,S.jsx)(U,{banners:Qe,placement:"homepage_under_table"})}):null)]},"table-".concat(Nt,"-").concat(Ct("table","split_news")))]},"news-table-".concat(Nt,"-").concat(l,"-").concat(Ct("table","split_news"))):null})(),Et("activities",!0)&&!mt&&(0,S.jsx)("section",{"data-element":"activities","data-variant":Ct("activities","list"),"aria-labelledby":"home-activities-heading",style:(0,i.A)({marginTop:32,marginBottom:16,position:"relative",contentVisibility:"auto",containIntrinsicSize:"600px"},Tt("activities")),children:(0,S.jsxs)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"0 12px"},children:[(0,S.jsxs)("div",{className:"section-head",style:{marginTop:0},children:[(0,S.jsx)("h3",{id:"home-activities-heading",children:e("nav.activities")}),(0,S.jsxs)("a",{href:"/aktivity",className:"see-all",children:[e("nav.view_all")," ",(0,S.jsx)(c.dyV,{})]})]}),(0,S.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr",gap:12},children:[1,2,3].map(e=>(0,S.jsx)("div",{className:"card skeleton",style:{height:120,borderRadius:12}},e))})]})}),ut.length>0&&Et("activities",!0)&&(0,S.jsx)("section",{"data-element":"activities","data-variant":Ct("activities","list"),"aria-labelledby":"home-activities-heading",style:(0,i.A)({marginTop:32,marginBottom:16,position:"relative",contentVisibility:"auto",containIntrinsicSize:"600px"},Tt("activities")),children:(0,S.jsxs)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"0 12px"},children:[(0,S.jsxs)("div",{className:"section-head",style:{marginTop:0},children:[(0,S.jsx)("h3",{id:"home-activities-heading",children:e("nav.activities")}),(0,S.jsxs)("a",{href:"/aktivity",className:"see-all",children:[e("nav.view_all")," ",(0,S.jsx)(c.dyV,{})]})]}),(0,S.jsx)(D,{items:ut})]})},"activities-".concat(Nt,"-").concat(Ct("activities","list"))),Et("team",!1)&&0===Je.length&&_t&&(0,S.jsx)("section",{"data-element":"team","data-variant":Ct("team","grid"),className:"players-scroller","aria-labelledby":"home-players-heading",style:(0,i.A)({marginTop:32,position:"relative",contentVisibility:"auto",containIntrinsicSize:"600px"},Tt("team")),children:(0,S.jsxs)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"0 12px"},children:[(0,S.jsxs)("div",{className:"section-head",children:[(0,S.jsx)("h3",{id:"home-players-heading",children:"Hr\xe1\u010di"}),(0,S.jsxs)("a",{href:"/players",className:"see-all",children:[e("nav.view_all")," ",(0,S.jsx)(c.dyV,{})]})]}),(0,S.jsx)("div",{className:"scroll-x",children:[1,2,3,4,5,6].map(e=>(0,S.jsx)("div",{className:"player-card skeleton",style:{width:170,height:210,borderRadius:14}},e))})]})}),Je.length>0&&Et("team",!1)&&(0,S.jsx)("section",{"data-element":"team","data-variant":Ct("team","grid"),className:"players-scroller","aria-labelledby":"home-players-heading",style:(0,i.A)({marginTop:32,position:"relative",contentVisibility:"auto",containIntrinsicSize:"600px"},Tt("team")),children:(0,S.jsxs)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"0 12px"},children:[(0,S.jsxs)("div",{className:"section-head",children:[(0,S.jsx)("h3",{id:"home-players-heading",children:"Hr\xe1\u010di"}),(0,S.jsxs)("a",{href:"/players",className:"see-all",children:[e("nav.view_all")," ",(0,S.jsx)(c.dyV,{})]})]}),(0,S.jsx)("div",{className:"scroll-x",children:Je.map(e=>(0,S.jsxs)("a",{href:e.slug?"/players/".concat(e.slug):"/players/".concat(e.id),className:"player-card card",style:{opacity:!1===e.active?.6:1},children:[(0,S.jsx)("div",{className:"photo",style:{backgroundImage:"url(".concat((0,u.uq)(e.image)||e.image,")")}}),(0,S.jsx)("div",{className:"meta",children:"undefined"!==typeof e.number?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("span",{className:"nr",children:["#",e.number]})," ",e.name]}):e.name}),(0,S.jsx)("div",{className:"pos",children:e.position})]},e.id))})]})},"team-".concat(Nt,"-").concat(Ct("team","grid"))),Et("gallery",!0)&&(0,S.jsx)("section",{"data-element":"gallery","data-variant":Ct("gallery","grid"),"aria-labelledby":"home-gallery-heading",style:(0,i.A)({marginTop:32,marginBottom:32,position:"relative",contentVisibility:"auto",containIntrinsicSize:"700px"},Tt("gallery")),children:(0,S.jsx)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"0 12px"},children:xt?(0,S.jsx)(o.Suspense,{fallback:null,children:(0,S.jsx)(V,{zoneramaUrl:me})}):null})},"gallery-".concat(Nt,"-").concat(Ct("gallery","grid"))),Et("videos",!1)&&(0,S.jsx)("section",{"data-element":"videos","data-variant":Ct("videos","carousel"),"aria-labelledby":"home-videos-heading",style:(0,i.A)({marginTop:32,marginBottom:32,position:"relative",contentVisibility:"auto",containIntrinsicSize:"700px"},Tt("videos")),children:(0,S.jsx)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"0 12px"},children:xt?(0,S.jsx)(o.Suspense,{fallback:null,children:(0,S.jsx)(K,{variant:Ct("videos","carousel")},"videos-comp-".concat(Nt,"-").concat(Ct("videos","carousel")))}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{className:"section-head",children:[(0,S.jsx)("h3",{id:"home-videos-heading",children:"Videa"}),(0,S.jsx)("a",{href:"/videa",className:"see-all",children:e("videos.more_videos",{defaultValue:"More videos"})})]}),(0,S.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr",gap:12},children:[1,2,3].map(e=>(0,S.jsx)("div",{className:"card skeleton",style:{height:240,borderRadius:12}},e))})]})})},"videos-".concat(Nt,"-").concat(Ct("videos","carousel"))),Et("merch",!0)&&(0,S.jsx)("section",{"data-element":"merch","data-variant":Ct("merch","grid"),"aria-labelledby":"home-merch-heading",style:(0,i.A)({marginTop:24,marginBottom:24,position:"relative",contentVisibility:"auto",containIntrinsicSize:"600px"},Tt("merch")),children:(0,S.jsx)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"0 12px"},children:xt?(0,S.jsx)(o.Suspense,{fallback:null,children:(0,S.jsx)(B,{variant:Ct("merch","grid")})}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{className:"section-head",children:[(0,S.jsx)("h3",{id:"home-merch-heading",children:"Oble\u010den\xed t\xfdmu"}),(0,S.jsx)("a",{href:"/obleceni",className:"see-all",children:e("nav.view_all")})]}),(0,S.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:12},children:[1,2,3,4,5].map(e=>(0,S.jsx)("div",{className:"card skeleton",style:{height:180,borderRadius:12}},e))})]})})},"merch-".concat(Nt,"-").concat(Ct("merch","grid"))),Et("poll",!1)&&(0,S.jsx)("section",{"data-element":"poll","data-variant":Ct("poll","vertical"),"aria-label":"Anketa",style:(0,i.A)({marginTop:32,marginBottom:32,position:"relative",contentVisibility:"auto",containIntrinsicSize:"500px"},Tt("poll")),children:(0,S.jsx)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"0 12px"},children:xt?(0,S.jsx)(o.Suspense,{fallback:null,children:(0,S.jsx)(Z,{featuredOnly:!1,maxPolls:1,title:"Anketa"})}):(0,S.jsx)("div",{className:"card skeleton",style:{height:320,borderRadius:12}})})},"poll-".concat(Nt,"-").concat(Ct("poll","vertical"))),(Qe||[]).some(e=>"homepage_footer"===e.placement)&&(0,S.jsx)("section",{"data-element":"banner","data-variant":Ct("banner","bottom"),className:"banner banner-footer",style:(0,i.A)({margin:"24px 0",textAlign:"center"},Tt("banner")),children:(Qe||[]).filter(e=>"homepage_footer"===e.placement).map(e=>(0,S.jsx)("a",{href:e.url||"#",target:e.url?"_blank":void 0,rel:e.url?"noopener noreferrer":void 0,style:{display:"inline-block",margin:8},children:(0,S.jsx)("img",{loading:"lazy",decoding:"async",src:e.image,alt:e.name,style:{maxWidth:"100%",width:e.width?"".concat(e.width,"px"):void 0,height:e.height?"".concat(e.height,"px"):"auto"}})},e.id))}),Et("newsletter",!1)&&(0,S.jsx)("section",{"data-element":"newsletter","data-variant":Ct("newsletter","default"),className:"newsletter-cta","aria-label":"P\u0159ihl\xe1\u0161en\xed k newsletteru",style:(0,i.A)({marginTop:24,marginBottom:24,position:"relative",contentVisibility:"auto",containIntrinsicSize:"420px"},Tt("newsletter")),children:(0,S.jsx)("div",{className:"card",style:{maxWidth:960,margin:"0 auto"},children:xt?(0,S.jsx)(o.Suspense,{fallback:null,children:(0,S.jsx)(H,{})}):(0,S.jsx)("div",{className:"skeleton",style:{height:280,borderRadius:12}})})},"newsletter-".concat(Nt,"-").concat(Ct("newsletter","default"))),Et("sponsors",!0)&&(()=>{const t=Ct("sponsors",ae),n=Xe||[],a=n.filter(e=>"general"===String(e.tier||"").toLowerCase()||"title"===String(e.tier||"").toLowerCase()||"main"===String(e.tier||"").toLowerCase()),o=n.filter(e=>!("general"===String(e.tier||"").toLowerCase()||"title"===String(e.tier||"").toLowerCase()||"main"===String(e.tier||"").toLowerCase())),r=[...a,...o];return(0,S.jsxs)("section",{"data-element":"sponsors","data-variant":t,className:"sponsors ".concat("dark"===ve?"dark":""),"aria-labelledby":"home-sponsors-heading",style:(0,i.A)({width:"100vw",position:"relative",left:"50%",right:"50%",transform:"translateX(-50%)",paddingLeft:"max(16px, calc((100vw - 1200px) / 2))",paddingRight:"max(16px, calc((100vw - 1200px) / 2))",boxSizing:"border-box",contentVisibility:"auto",containIntrinsicSize:"520px"},Tt("sponsors")),children:[(0,S.jsx)("div",{className:"section-head",children:(0,S.jsx)("h3",{id:"home-sponsors-heading",children:e("nav.sponsors")})}),_t&&0===r.length&&(0,S.jsx)("div",{className:"sponsors-grid",children:[1,2,3,4,5,6,7,8].map(e=>(0,S.jsx)("div",{className:"sponsor-tile skeleton",style:{minHeight:90,borderRadius:12}},e))}),"grid"===t&&(0,S.jsxs)(S.Fragment,{children:[a.length>0&&(0,S.jsx)("div",{className:"title-sponsor",children:a.map(e=>(0,S.jsx)("a",{className:"sponsor-tile",href:e.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,S.jsx)("img",{loading:"lazy",decoding:"async",src:(0,u.uq)(e.logo)||"/images/sponsors/placeholder.png",alt:e.name})},"g-".concat(e.id)))}),a.length>0&&o.length>0&&(0,S.jsx)("div",{className:"divider","aria-hidden":!0}),(0,S.jsx)("div",{className:"sponsors-grid",children:(o.length>0?o:0===a.length?r:[]).map(e=>(0,S.jsx)("a",{className:"sponsor-tile",href:e.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,S.jsx)("img",{loading:"lazy",decoding:"async",src:(0,u.uq)(e.logo)||"/images/sponsors/placeholder.png",alt:e.name})},e.id))})]}),"pyramid"===t&&(()=>{const e=[1,4,8,12,16],t=t=>{const n=[];let a=0;for(let o=0;a<t.length&&o<e.length;o++){const i=e[o];n.push(t.slice(a,a+i)),a+=i}const i=e[e.length-1];for(;a<t.length;)n.push(t.slice(a,a+i)),a+=i;return n},n=t(a),i=t(o);return(0,S.jsxs)("div",{className:"pyramid",children:[n.map((e,t)=>(0,S.jsx)("div",{className:"pyramid-row",style:{display:"grid",gridTemplateColumns:"repeat(".concat(Math.max(1,e.length),", 1fr)"),gap:16,marginBottom:12},children:e.map(e=>(0,S.jsx)("a",{className:"sponsor-tile",href:e.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,S.jsx)("img",{src:(0,u.uq)(e.logo)||"/images/sponsors/placeholder.png",alt:e.name})},"g-".concat(e.id)))},"gen-".concat(t))),n.length>0&&i.length>0&&(0,S.jsx)("div",{className:"divider","aria-hidden":!0}),i.map((e,t)=>(0,S.jsx)("div",{className:"pyramid-row",style:{display:"grid",gridTemplateColumns:"repeat(".concat(Math.max(1,e.length),", 1fr)"),gap:16,marginBottom:12},children:e.map(e=>(0,S.jsx)("a",{className:"sponsor-tile",href:e.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,S.jsx)("img",{src:(0,u.uq)(e.logo)||"/images/sponsors/placeholder.png",alt:e.name})},"s-".concat(e.id)))},"std-".concat(t)))]})})(),"slider"===t&&(0,S.jsx)("div",{className:"sponsors-slider",children:(0,S.jsx)("div",{className:"track",children:[...r,...r].map((e,t)=>(0,S.jsx)("a",{className:"sponsor-tile",href:e.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,S.jsx)("img",{loading:"lazy",decoding:"async",src:(0,u.uq)(e.logo)||"/images/sponsors/placeholder.png",alt:e.name})},"".concat(e.id,"-").concat(t)))})}),("scroller"===t||"logos3"===t)&&(0,S.jsx)("div",{className:"sponsors-scroller".concat("logos3"===t?" sponsors-scroller-logos3":""),children:(0,S.jsx)("div",{className:"belt",children:[...r,...r,...r].map((e,t)=>(0,S.jsx)("a",{className:"sponsor-tile",href:e.url||"#",target:"_blank",rel:"noreferrer noopener",children:(0,S.jsx)("img",{loading:"lazy",decoding:"async",src:(0,u.uq)(e.logo)||"/images/sponsors/placeholder.png",alt:e.name})},"".concat(e.id,"-").concat(t)))})})]})})()]}),(0,S.jsx)(j.A,{isOpen:Me,onClose:()=>Le(!1),club:Pe,clubType:(null===ft||void 0===ft?void 0:ft.club_type)||"football"}),(0,S.jsx)(b.A,{isOpen:Oe,onClose:()=>qe(!1),match:We,onTeamClick:(e,t)=>{console.log("Team clicked:",e)}}),zt?(0,S.jsx)(o.Suspense,{fallback:null,children:(0,S.jsx)(J,{children:(0,S.jsx)($,{pageType:"homepage"})})}):null,"admin"!==(null===At||void 0===At?void 0:At.role)||zt?null:(0,S.jsx)("div",{style:{position:"fixed",left:16,bottom:16,zIndex:1e4},children:(0,S.jsx)(r.m,{label:"Aktivovat MyUIbrix Editor",placement:"right",children:(0,S.jsx)(s.K,{"aria-label":"Upravit str\xe1nku",icon:(0,S.jsx)(c.SG1,{}),colorScheme:"blue",size:"lg",borderRadius:"full",onClick:()=>{try{const e=new URL(window.location.href);e.searchParams.set("myuibrix","edit"),window.history.replaceState({},"",e.toString())}catch(e){}try{document.body.classList.add("myuibrix-edit-mode")}catch(t){}St(!0)}})})})]})}},89818:(e,t,n)=>{n.r(t),n.d(t,{default:()=>M});n(65043);var a=n(73216),i=n(35475),o=n(72526),r=n(66286),s=n(25189),l=n(32077),c=n(87139),d=n(22107),u=n(98662),h=n(44093),m=n(98939),p=n(82459),x=n(73212),g=n(33572),v=n(99032),j=n(96148),b=n(29904),y=n(10202),f=n(94217),k=n(53332),_=n(78149),w=n(14566),z=n(31411),S=n(10227),A=n(51794),C=n(3109),E=n(28846),T=n(39081),D=n(40378),N=n(81398),R=n(97278),F=n(70579);function P(e){return 1===e?"rok":e>=2&&e<=4?"roky":"let"}function I(e){if(!e)return"";let t=String(e).trim();return t=t.replace(/[\s\-()]/g,""),t.startsWith("00")&&(t="+"+t.slice(2)),t=t.replace(/(?!^)[^\d]/g,""),"+"!==t[0]&&t.startsWith("+"),t}const M=()=>{var e;const{id:t}=(0,a.g)(),{data:n,isLoading:M,isError:L}=(0,o.I)({queryKey:["player",t],queryFn:()=>(0,r.iV)(String(t))}),W=(0,h.dU)("white","gray.800"),U=(0,h.dU)("gray.200","gray.700");if(M)return(0,F.jsx)(D.A,{children:(0,F.jsx)(m.m,{maxW:"7xl",py:8,children:(0,F.jsx)(v.E,{height:"320px"})})});if(L||!n)return(0,F.jsx)(D.A,{children:(0,F.jsx)(m.m,{maxW:"7xl",py:8,children:(0,F.jsx)(T.E,{color:"red.500",children:"Hr\xe1\u010de se nepoda\u0159ilo na\u010d\xedst."})})});const O=[n.first_name,n.last_name].filter(Boolean).join(" "),q=n.date_of_birth?function(e){try{const t=new Date(e);if(isNaN(t.getTime()))return null;const n=new Date;let a=n.getFullYear()-t.getFullYear();const i=n.getMonth()-t.getMonth();return(i<0||0===i&&n.getDate()<t.getDate())&&a--,a}catch(t){return null}}(n.date_of_birth):null,K=Boolean(n.email||n.phone);return(0,F.jsx)(D.A,{children:(0,F.jsxs)(d.a,{children:[(0,F.jsx)(m.m,{maxW:"7xl",py:{base:6,md:10},children:(0,F.jsxs)(y.T,{align:"stretch",spacing:6,children:[(0,F.jsxs)(j.z,{justify:"space-between",children:[(0,F.jsxs)(j.z,{spacing:3,children:[(0,F.jsx)(E.D,{as:"h1",size:{base:"xl",md:"2xl"},children:O}),"number"===typeof n.jersey_number&&(0,F.jsxs)(c.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:["#",n.jersey_number]}),n.position&&(0,F.jsx)(c.E,{variant:"subtle",colorScheme:"purple",fontSize:"md",px:3,py:1,children:n.position}),!n.is_active&&(0,F.jsx)(c.E,{colorScheme:"gray",fontSize:"md",px:3,py:1,children:"Neaktivn\xed"})]}),(0,F.jsx)(u.$,{as:i.N_,to:"/hraci",variant:"outline",children:"Zp\u011bt na p\u0159ehled"})]}),(0,F.jsxs)(x.r,{columns:{base:1,md:2},spacing:6,children:[(0,F.jsx)(d.a,{children:(0,F.jsx)(l.g,{ratio:3/4,children:(0,F.jsx)(g._,{src:(0,s.uq)(n.image_url)||"/logo512.png",alt:O,borderRadius:"lg",objectFit:"cover",w:"100%"})})}),(0,F.jsxs)(b.B,{spacing:5,bg:W,borderWidth:"1px",borderColor:U,borderRadius:"lg",p:6,shadow:"sm",children:[(0,F.jsxs)(x.r,{columns:{base:2,md:4},spacing:4,children:[(0,F.jsx)(d.a,{borderWidth:"1px",borderColor:U,borderRadius:"md",p:4,textAlign:"center",children:(0,F.jsxs)(f.r,{children:[(0,F.jsx)(k.v,{children:"V\u011bk"}),(0,F.jsx)(_.k,{children:null!=q?q:"\u2014"})]})}),(0,F.jsx)(d.a,{borderWidth:"1px",borderColor:U,borderRadius:"md",p:4,textAlign:"center",children:(0,F.jsxs)(f.r,{children:[(0,F.jsx)(k.v,{children:"V\xfd\u0161ka"}),(0,F.jsx)(_.k,{children:n.height?"".concat(n.height," cm"):"\u2014"})]})}),(0,F.jsx)(d.a,{borderWidth:"1px",borderColor:U,borderRadius:"md",p:4,textAlign:"center",children:(0,F.jsxs)(f.r,{children:[(0,F.jsx)(k.v,{children:"V\xe1ha"}),(0,F.jsx)(_.k,{children:n.weight?"".concat(n.weight," kg"):"\u2014"})]})}),(0,F.jsx)(d.a,{borderWidth:"1px",borderColor:U,borderRadius:"md",p:4,textAlign:"center",children:(0,F.jsxs)(f.r,{children:[(0,F.jsx)(k.v,{children:"Dres"}),(0,F.jsx)(_.k,{children:"number"===typeof n.jersey_number?"#".concat(n.jersey_number):"\u2014"})]})})]}),(0,F.jsx)(p.c,{}),(0,F.jsxs)(C.t,{variant:"soft-rounded",colorScheme:"blue",children:[(0,F.jsxs)(z.w,{children:[(0,F.jsx)(w.o,{children:"Profil"}),K&&(0,F.jsx)(w.o,{children:"Kontakt"})]}),(0,F.jsxs)(A.T,{children:[(0,F.jsx)(S.K,{px:0,children:(0,F.jsxs)(b.B,{spacing:3,children:[n.position&&(0,F.jsxs)(T.E,{children:[(0,F.jsx)("b",{children:"Pozice:"})," ",n.position]}),n.date_of_birth&&(0,F.jsxs)(T.E,{children:[(0,F.jsx)("b",{children:"Datum narozen\xed:"})," ",new Date(n.date_of_birth).toLocaleDateString("cs-CZ")," ",null!=q?"\u2014 ".concat(q," ").concat(P(q)):""]}),null!==(e=n.team)&&void 0!==e&&e.name?(0,F.jsxs)(T.E,{children:[(0,F.jsx)("b",{children:"T\xfdm:"})," ",n.team.name]}):"number"===typeof n.team_id&&n.team_id>0?(0,F.jsxs)(T.E,{children:[(0,F.jsx)("b",{children:"T\xfdm ID:"})," ",n.team_id]}):null,n.nationality&&(0,F.jsxs)(j.z,{children:[(0,F.jsx)(T.E,{children:(0,F.jsx)("b",{children:"N\xe1rodnost:"})}),(0,F.jsx)(T.E,{as:"span",fontSize:"xl",children:(0,R.xg)(n.nationality)}),(0,F.jsx)(T.E,{children:(0,R.Pd)(n.nationality)})]})]})}),K&&(0,F.jsx)(S.K,{px:0,children:(0,F.jsxs)(b.B,{spacing:3,children:[n.email&&(0,F.jsxs)(T.E,{children:[(0,F.jsx)("b",{children:"Email:"})," ",(0,F.jsx)("a",{href:"mailto:".concat(n.email),children:n.email})]}),n.phone&&(0,F.jsxs)(T.E,{children:[(0,F.jsx)("b",{children:"Telefon:"})," ",(0,F.jsx)("a",{href:"tel:".concat(I(n.phone)),children:n.phone})]})]})})]})]})]})]})]})}),(0,F.jsx)(N.A,{})]})})}},89910:(e,t,n)=>{n.d(t,{A:()=>r});n(65043);var a=n(25189),i=n(74117),o=n(70579);const r=e=>{let{items:t,emptyText:n,seeAllHref:r,seeAllLabel:s}=e;const{t:l}=(0,i.Bd)(),c=n||l("news.no_news"),d=s||l("news.view_all_news");return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"blog-list",children:t&&t.length>0?t.slice(0,4).map(e=>(0,o.jsxs)("a",{href:"/news/".concat(e.slug||e.id),className:"card",style:{textDecoration:"none",color:"inherit"},children:[(0,o.jsx)("div",{className:"thumb",style:{backgroundImage:"url(".concat((0,a.uq)(e.image)||"/images/news/placeholder.jpg",")")}}),(0,o.jsxs)("div",{children:[(0,o.jsx)("h4",{children:e.title}),e.excerpt&&(0,o.jsx)("div",{style:{color:"var(--dark-gray)",fontSize:"0.9rem"},children:e.excerpt})]})]},e.id)):(0,o.jsx)("div",{style:{padding:"24px",textAlign:"center",color:"var(--dark-gray)",background:"var(--bg-soft)",borderRadius:"12px"},children:(0,o.jsx)("p",{children:c})})}),r&&t&&t.length>0&&(0,o.jsx)("div",{style:{marginTop:12},children:(0,o.jsx)("a",{className:"btn",href:r,children:d})})]})}},89962:(e,t,n)=>{n.d(t,{A:()=>b});n(65043);var a=n(22107),i=n(44093),o=n(25011),r=n(67516),s=n(56529),l=n(15071),c=n(11054),d=n(78460),u=n(85421),h=n(88019),m=n(76659),p=n(96148),x=n(10202),g=n(39081),v=n(1009),j=n(70579);const b=e=>{let{isOpen:t,onClose:n,title:b="AI generuje obsah",message:y="Pracuji na va\u0161em po\u017eadavku...",progress:f,estimatedTime:k}=e;const _=(0,i.dU)("white","gray.800"),w=(0,i.dU)("gray.700","gray.200"),z=(0,i.dU)("blue.500","blue.300"),S=(0,i.dU)("gray.200","gray.600"),A=()=>{if(k&&void 0!==f&&f>0){const e=Math.ceil(k*(100-f)/100);if(e>0)return"P\u0159edpokl\xe1dan\xfd \u010das: ".concat(e,"s")}return k?"P\u0159edpokl\xe1dan\xfd \u010das: ".concat(k,"s"):""};return(0,j.jsxs)(d.aF,{isOpen:t,onClose:n,isCentered:!0,closeOnEsc:!1,closeOnOverlayClick:!1,children:[(0,j.jsx)(c.m,{bg:"blackAlpha.400",backdropFilter:"blur(6px)"}),(0,j.jsxs)(u.$,{bg:_,borderRadius:"2xl",boxShadow:"2xl",border:"1px solid",borderColor:S,children:[(0,j.jsx)(l.r,{borderBottom:"1px solid",borderColor:S,pb:4,children:(0,j.jsx)(x.T,{spacing:3,align:"center",children:(0,j.jsxs)(p.z,{spacing:3,children:[(0,j.jsx)(a.a,{bg:"blue.50",p:2,borderRadius:"full",children:(0,j.jsx)(o.I,{as:v.Ojn,color:"blue.500",boxSize:5})}),(0,j.jsx)(g.E,{fontSize:"lg",fontWeight:"600",color:w,children:b})]})})}),(0,j.jsx)(r.c,{py:8,children:(0,j.jsxs)(x.T,{spacing:6,align:"center",children:[(0,j.jsxs)(x.T,{spacing:4,children:[(0,j.jsx)(a.a,{bg:"blue.50",p:4,borderRadius:"full",children:(0,j.jsx)(o.I,{as:v.Ojn,color:"blue.500",boxSize:6})}),(0,j.jsx)(m.y,{size:"lg",color:"blue.500",thickness:"3px"})]}),(0,j.jsx)(g.E,{fontSize:"md",color:w,textAlign:"center",fontWeight:"500",children:void 0!==f?f<25?"AI analyzuje po\u017eadavek...":f<50?"AI komunikuje s modelem...":f<75?"AI zpracov\xe1v\xe1 obsah...":f<90?"AI optimalizuje v\xfdstup...":"AI dokon\u010duje...":y}),void 0!==f&&(0,j.jsxs)(a.a,{w:"100%",maxW:"400px",children:[(0,j.jsx)(h.k,{value:f,size:"lg",colorScheme:"blue",borderRadius:"full",bg:"gray.100",sx:{"& > div":{bg:z,transition:"width 0.4s ease-out"}}}),(0,j.jsxs)(g.E,{fontSize:"sm",color:"gray.600",mt:3,textAlign:"center",fontWeight:"500",children:[void 0!==f?Math.round(f):0,"% hotovo"]})]}),A()&&(0,j.jsxs)(p.z,{spacing:2,color:"gray.500",children:[(0,j.jsx)(o.I,{as:v.Ohp,boxSize:4}),(0,j.jsx)(g.E,{fontSize:"sm",children:A()})]}),(0,j.jsxs)(x.T,{spacing:2,align:"center",pt:2,children:[(0,j.jsx)(g.E,{fontSize:"sm",color:"gray.400",fontStyle:"italic",children:"AI pracuje na va\u0161em obsahu"}),(0,j.jsx)(g.E,{fontSize:"xs",color:"gray.400",children:"Vygenerovan\xfd obsah bude automaticky vlo\u017een do formul\xe1\u0159e"})]})]})}),(0,j.jsx)(s.j,{borderTop:"1px solid",borderColor:S,children:(0,j.jsx)(g.E,{fontSize:"sm",color:"gray.400",children:"Pros\xedm \u010dekejte, proces nelze p\u0159eru\u0161it"})})]})]})}},90202:(e,t,n)=>{n.r(t),n.d(t,{default:()=>G});var a=n(89379),i=n(88787),o=n(85871),r=n(87139),s=n(22107),l=n(98662),c=n(44093),d=n(73225),u=n(10804),h=n(76668),m=n(35699),p=n(6773),x=n(67516),g=n(56529),v=n(15071),j=n(11054),b=n(63935),y=n(19542),f=n(61724),k=n(76659),_=n(96148),w=n(29904),z=n(80511),S=n(82595),A=n(67813),C=n(83201),E=n(3313),T=n(55395),D=n(30502),N=n(28846),R=n(39081),F=n(58861),P=n(72526),I=n(59781),M=n(12836),L=n(6583),W=n(42687),U=n(74770),O=n(65043),q=n(35475),K=n(69023),B=n(92410),Z=n(46291),V=n(56644),H=n(72898),$=n(70082),J=n(70579);const G=()=>{const e=(0,I.jE)(),t=(0,D.d)(),[n,G]=(0,O.useState)(!1),[X,Y]=(0,O.useState)(null),[Q,ee]=(0,O.useState)({venue_override:"",date_time_edit:"",score_override:""}),[te,ne]=(0,O.useState)(""),ae=e=>{let t=String(e||"");t=t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),t=t.replace(/[\u2012\u2013\u2014\u2015\u2212]/g,"-");const n=["fotbalovy klub","sportovni klub","telovychovna jednota","skolni sportovni klub","fotbal","futsal"];for(const a of n){const e=new RegExp("(^|\\b)".concat(a,"(\\b|$)"),"g");t=t.replace(e," ")}return t=t.replace(/\b(1\.)?\s*(sfc|afc|fc|fk|mfk|tj|sk|afk)\b\.?/g," "),t=t.replace(/[\.,!;:()\[\]{}]/g," "),t=t.replace(/\s+/g," ").trim(),t},{data:ie=[],isLoading:oe,error:re}=(0,P.I)({queryKey:["admin-matches-list-cache"],queryFn:async()=>{const e=await(0,W.tb)(),t=e=>{const t=String((null===e||void 0===e?void 0:e.date_time)||(null!==e&&void 0!==e&&e.date&&null!==e&&void 0!==e&&e.time?"".concat(e.date," ").concat(e.time):null===e||void 0===e?void 0:e.date)||"").trim();if(!t)return Number.MAX_SAFE_INTEGER;try{const e=(0,B.qg)(t,"dd.MM.yyyy HH:mm",new Date);if(!isNaN(e.getTime()))return e.getTime()}catch(a){}const n=new Date(t);return isNaN(n.getTime())?Number.MAX_SAFE_INTEGER:n.getTime()};return e.sort((e,n)=>t(e)-t(n)),e}}),[se,le]=(0,O.useState)(""),[ce,de]=(0,O.useState)(""),[ue,he]=(0,O.useState)(""),[me,pe]=(0,O.useState)(""),[xe,ge]=(0,O.useState)(""),ve=se.trim().toLowerCase(),je="dd.MM.yyyy HH:mm",be=(e,t)=>{const n=String((e&&t?"".concat(e," ").concat(t):e)||"").trim();if(!n)return"";try{const e=(0,B.qg)(n,je,new Date);if(!isNaN(e.getTime()))return(0,K.GP)(e,je)}catch(i){}const a=new Date(n);return isNaN(a.getTime())?n:(0,K.GP)(a,je)},{data:ye}=(0,P.I)({queryKey:["public-settings"],queryFn:U.l3}),{data:fe}=(0,P.I)({queryKey:["facr-club-info-name"],queryFn:async()=>{const e=new URL(Z.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin,t="".concat(e,"/cache/prefetch/facr_club_info.json"),n=await fetch(t,{headers:{"Cache-Control":"no-cache"}});return n.ok?await n.json():null}}),ke=(null===ye||void 0===ye?void 0:ye.club_name)||(null===fe||void 0===fe?void 0:fe.name)||"",_e=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),we=e=>{let t=_e(e);return t=t.replace(/\b(mestsky|m\.?f\.?k\.?|mfk|tj|sk|sokol|fotbalovy|fotbalov\xfd|fotbalovy\s+klub|fotbalovy\s+klub)\b/g,"").replace(/\s+/g," ").trim(),t},ze=_e(ke),Se=we(ke),Ae=e=>{const t=_e(e),n=we(e);return!!ze&&(t.includes(ze)||n.includes(Se)||t.endsWith(Se)||Se.endsWith(n))},{data:Ce=[]}=(0,P.I)({queryKey:["competition-aliases-public"],queryFn:$.xN}),Ee=(0,O.useMemo)(()=>{const e=new Set,t=new Map;for(const n of ie)if(n.competitionName){const a=String(n.competitionName);if(!e.has(a)){e.add(a);let n=null,i=Number.MAX_SAFE_INTEGER;const o=ae(a);if(Array.isArray(Ce)&&Ce.length>0)for(let e=0;e<Ce.length;e++){const t=Ce[e],a=ae(String(t.alias||"")),r=ae(String(t.original_name||""));if(a&&(o.includes(a)||a.includes(o))||r&&(o.includes(r)||r.includes(o))){n=t,i=e;break}}t.set(a,{name:a,alias:n?String(n.alias||""):void 0,order:i})}}return Array.from(t.values()).sort((e,t)=>e.order!==t.order?e.order-t.order:e.name.localeCompare(t.name))},[ie,Ce]),Te=ie.filter(e=>{if(!(!ve||("home"===xe?[e.home,e.home_team].filter(Boolean).some(e=>String(e).toLowerCase().includes(ve)):"away"===xe?[e.away,e.away_team].filter(Boolean).some(e=>String(e).toLowerCase().includes(ve)):[e.home,e.home_team,e.away,e.away_team].filter(Boolean).some(e=>String(e).toLowerCase().includes(ve)))))return!1;if(me&&String(e.competitionName||"")!==me)return!1;if(xe&&ze){const t=String(e.home||e.home_team||""),n=String(e.away||e.away_team||"");if("home"===xe&&!Ae(t))return!1;if("away"===xe&&!Ae(n))return!1}const t=String(e.date_time||(e.date&&e.time?"".concat(e.date," ").concat(e.time):e.date)||"");let n=NaN;try{n=(0,B.qg)(t,je,new Date).getTime()}catch(a){n=new Date(t).getTime()}if(isNaN(n))return!0;if(ce){const e=new Date(ce+"T00:00:00").getTime();if(!isNaN(e)&&n<e)return!1}if(ue){const e=new Date(ue+"T23:59:59").getTime();if(!isNaN(e)&&n>e)return!1}return!0}),[De,Ne]=(0,O.useState)(50),[Re,Fe]=(0,O.useState)(50),[Pe,Ie]=(0,q.ok)();(0,O.useEffect)(()=>{const e=Pe.get("team")||"",t=Pe.get("from")||"",n=Pe.get("to")||"",a=Pe.get("comp")||"",i=(Pe.get("venue"),Pe.get("side")||""),o=parseInt(Pe.get("size")||"")||void 0,r=parseInt(Pe.get("limit")||"")||void 0;e&&le(e),t&&de(t),n&&he(n),a&&pe(a),"home"!==i&&"away"!==i||ge(i),o&&(Ne(o),Fe(o)),r&&Fe(r)},[]),(0,O.useEffect)(()=>{const e={};se&&(e.team=se),ce&&(e.from=ce),ue&&(e.to=ue),me&&(e.comp=me),xe&&(e.side=xe),50!==De&&(e.size=String(De)),Re!==De&&(e.limit=String(Re)),Ie(e,{replace:!0})},[se,ce,ue,me,xe,De,Re,Ie]),(0,O.useEffect)(()=>{Fe(De)},[ve,ce,ue,me,xe,ze,De]);const Me=Te.slice(0,Re),Le=""!==Q.date_time_edit.trim()&&isNaN(new Date(Q.date_time_edit).getTime()),We=(0,M.n)({mutationFn:async()=>{var e,t;const n=String(null!==(e=null!==(t=null===X||void 0===X?void 0:X.match_id)&&void 0!==t?t:null===X||void 0===X?void 0:X.id)&&void 0!==e?e:"").trim();if(!n)throw new Error("Chyb\xed match_id");const a={},i=String((null===X||void 0===X?void 0:X.venue)||"");Q.venue_override.trim()!==i&&(a.venue_override=""===Q.venue_override.trim()?null:Q.venue_override.trim());const o=String((null===X||void 0===X?void 0:X.score)||(null!=(null===X||void 0===X?void 0:X.result_home)&&null!=(null===X||void 0===X?void 0:X.result_away)?"".concat(X.result_home,":").concat(X.result_away):"")||"");return Q.score_override.trim()!==o&&(a.score_override=""===Q.score_override.trim()?null:Q.score_override.trim()),Q.date_time_edit!==te&&(a.date_time_override=""===Q.date_time_edit.trim()?null:Q.date_time_edit),0===Object.keys(a).length||await(0,W.kw)(n,a),{ok:!0}},onSuccess:()=>{t({title:"Ulo\u017eeno",status:"success"}),G(!1),Y(null),e.invalidateQueries({queryKey:["admin-matches-list-cache"]})},onError:e=>{t({title:"Ulo\u017een\xed selhalo",description:(null===e||void 0===e?void 0:e.message)||"Zkuste to znovu",status:"error"})}}),Ue=e=>{Y(e);const t=e.date_time||(e.date&&e.time?"".concat(e.date," ").concat(e.time):e.date)||"";let n="";if(t)try{const e=(0,B.qg)(String(t),"dd.MM.yyyy HH:mm",new Date);if(!isNaN(e.getTime())){const t=e=>String(e).padStart(2,"0");n="".concat(e.getFullYear(),"-").concat(t(e.getMonth()+1),"-").concat(t(e.getDate()),"T").concat(t(e.getHours()),":").concat(t(e.getMinutes()))}}catch(a){const e=new Date(t);if(!isNaN(e.getTime())){const t=e=>String(e).padStart(2,"0");n="".concat(e.getFullYear(),"-").concat(t(e.getMonth()+1),"-").concat(t(e.getDate()),"T").concat(t(e.getHours()),":").concat(t(e.getMinutes()))}}ne(n),ee({venue_override:e.venue||"",date_time_edit:n,score_override:String(e.score||(null!=e.result_home&&null!=e.result_away?"".concat(e.result_home,":").concat(e.result_away):"")||"")}),G(!0)},Oe=(0,p.A)({base:"full",md:"md"}),qe=(0,O.useRef)(null),[Ke,Be]=(0,O.useState)(!1),[Ze,Ve]=(0,O.useState)(!1),[He,$e]=(0,O.useState)(!0),[Je,Ge]=(0,O.useState)(!1),[Xe,Ye]=(0,O.useState)(0),[Qe,et]=(0,O.useState)(0),tt=(0,O.useRef)(0),nt=(0,O.useRef)(0),at=(0,O.useRef)(0),it=(0,O.useRef)(null),ot=(0,O.useRef)(null),rt=()=>{const e=qe.current;if(!e)return;const t=e.scrollLeft>0,n=e.scrollLeft+e.clientWidth<e.scrollWidth-1;t!==Ke&&Be(t),n!==Ze&&Ve(n)};(0,O.useEffect)(()=>{rt();const e=()=>rt();return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),it.current&&cancelAnimationFrame(it.current)}},[]);const st=(0,c.dU)("brand.primary","gray.700"),lt=(0,c.dU)("text.onPrimary","white"),ct=(0,c.dU)("white","gray.800"),dt=(0,c.dU)("gray.200","gray.700"),ut=(0,c.dU)("linear(to-r, white, transparent)","linear(to-r, gray.800, transparent)"),ht=(0,c.dU)("linear(to-l, white, transparent)","linear(to-l, gray.800, transparent)"),mt=(0,c.dU)("gray.100","gray.700"),pt=(0,c.dU)("white","gray.800"),xt=(0,c.dU)("gray.200","gray.600"),gt=(0,c.dU)("gray.50","gray.700");return(0,J.jsxs)(L.A,{requireAdmin:!1,children:[(0,J.jsxs)(s.a,{children:[(0,J.jsxs)(s.a,{mb:6,children:[(0,J.jsx)(N.D,{size:"lg",mb:2,children:"Spr\xe1va z\xe1pas\u016f"}),(0,J.jsx)(R.E,{color:(0,c.dU)("gray.600","gray.400"),children:"Spr\xe1va a \xfaprava z\xe1pas\u016f. M\u016f\u017eete upravovat informace o z\xe1pasech, v\u010detn\u011b n\xe1zv\u016f t\xfdm\u016f, term\xedn\u016f, log a dal\u0161\xedch detail\u016f."})]}),oe?(0,J.jsxs)(_.z,{spacing:3,mb:4,children:[(0,J.jsx)(k.y,{}),(0,J.jsx)(R.E,{children:"Na\u010d\xedt\xe1m z\xe1pasy\u2026"})]}):re?(0,J.jsxs)(i.F,{status:"error",variant:"left-accent",mb:4,children:[(0,J.jsx)(o._,{}),"Nepoda\u0159ilo se na\u010d\xedst z\xe1pasy."]}):(0,J.jsxs)(s.a,{children:[(0,J.jsxs)(F.B,{mb:4,spacing:3,align:"center",children:[(0,J.jsx)(F.Q,{minW:"160px",children:(0,J.jsxs)(f.l,{size:"sm",value:xe,onChange:e=>ge(e.target.value||""),children:[(0,J.jsx)("option",{value:"",children:"V\u0161echny strany"}),(0,J.jsx)("option",{value:"home",children:"Dom\xe1c\xed"}),(0,J.jsx)("option",{value:"away",children:"Host\xe9"})]})}),(0,J.jsx)(F.Q,{flex:1,minW:"220px",children:(0,J.jsx)(m.p,{placeholder:"Filtrovat podle t\xfdmu\u2026",value:se,onChange:e=>le(e.target.value),size:"sm"})}),(0,J.jsx)(F.Q,{children:(0,J.jsx)(H.A,{from:ce||void 0,to:ue||void 0,onChange:(e,t)=>{de(e),he(t)},size:"sm"})}),(0,J.jsx)(F.Q,{minW:"220px",children:(0,J.jsxs)(f.l,{size:"sm",value:me,onChange:e=>pe(e.target.value),children:[(0,J.jsx)("option",{value:"",children:"V\u0161echny sout\u011b\u017ee"}),Ee.map(e=>(0,J.jsx)("option",{value:e.name,children:e.alias?"".concat(e.alias," - ").concat(e.name):e.name},e.name))]})}),(se||ce||ue||me||xe)&&(0,J.jsx)(F.Q,{children:(0,J.jsx)(l.$,{size:"sm",variant:"outline",colorScheme:"red",onClick:()=>{le(""),de(""),he(""),pe(""),ge("")},borderRadius:"md",children:"Vymazat filtry"})}),(0,J.jsx)(F.Q,{children:(0,J.jsxs)(_.z,{children:[(0,J.jsx)(R.E,{fontSize:"sm",children:"Na str\xe1nku:"}),(0,J.jsxs)(f.l,{size:"sm",value:De,onChange:e=>Ne(parseInt(e.target.value)||25),width:"auto",children:[(0,J.jsx)("option",{value:25,children:"25"}),(0,J.jsx)("option",{value:50,children:"50"}),(0,J.jsx)("option",{value:100,children:"100"}),(0,J.jsx)("option",{value:200,children:"200"})]})]})}),(0,J.jsx)(F.Q,{children:(0,J.jsx)(l.$,{size:"sm",onClick:()=>{const e=Te.map(e=>({date:e.date_time||e.date||"",competition:e.competitionName||"",home:e.home||e.home_team||"",away:e.away||e.away_team||"",score:e.score||(null!=e.result_home&&null!=e.result_away?"".concat(e.result_home,":").concat(e.result_away):""),venue:e.venue||""})),t=["date","competition","home","away","score","venue"],n=[t.join(","),...e.map(e=>t.map(t=>(e=>{const t=String(null!==e&&void 0!==e?e:"");return/[",\n]/.test(t)?'"'+t.replace(/"/g,'""')+'"':t})(e[t])).join(","))].join("\n"),a=new Blob([n],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(a),o=document.createElement("a");o.href=i,o.download="matches.csv",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)},bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},borderRadius:"md",children:"Export CSV"})}),(0,J.jsx)(F.Q,{children:(0,J.jsxs)(R.E,{color:"gray.500",fontSize:"sm",children:["Zobrazeno ",Me.length," / ",Te.length]})})]}),He&&(0,J.jsx)(R.E,{fontSize:"xs",color:"blue.600",fontWeight:"600",mb:2,display:"flex",alignItems:"center",gap:1,children:"\ud83d\udca1 Tip: Tabulku m\u016f\u017eete plynule posouvat ta\u017een\xedm my\u0161\xed nebo prstem \u2192"}),(0,J.jsxs)(s.a,{ref:qe,overflowX:"auto",borderWidth:"2px",borderRadius:"xl",borderColor:dt,w:"full",bg:ct,boxShadow:"md",maxW:"100%",position:"relative",cursor:"grab",onMouseDown:e=>{qe.current&&(it.current&&(cancelAnimationFrame(it.current),it.current=null),Ge(!0),Ye(e.pageX-qe.current.offsetLeft),et(qe.current.scrollLeft),tt.current=e.pageX,nt.current=Date.now(),at.current=0,qe.current.style.cursor="grabbing",qe.current.style.userSelect="none",qe.current.style.scrollBehavior="auto")},onMouseLeave:()=>{Ge(!1),qe.current&&(qe.current.style.cursor="grab",qe.current.style.userSelect="auto")},onMouseUp:()=>{if(Ge(!1),qe.current){qe.current.style.cursor="grab",qe.current.style.userSelect="auto",qe.current.style.scrollBehavior="smooth";const e=at.current;if(Math.abs(e)>.5){const e=()=>{qe.current&&(at.current*=.95,qe.current.scrollLeft-=at.current,Math.abs(at.current)>.5?it.current=requestAnimationFrame(e):it.current=null)};it.current=requestAnimationFrame(e)}}},onMouseMove:e=>{if(!Je||!qe.current)return;e.preventDefault();const t=1.5*(e.pageX-qe.current.offsetLeft-Xe);qe.current.scrollLeft=Qe-t;const n=Date.now(),a=n-nt.current;if(a>0){const t=e.pageX,i=t-tt.current;at.current=i/a*16,tt.current=t,nt.current=n}},onTouchStart:e=>{if(!qe.current)return;it.current&&(cancelAnimationFrame(it.current),it.current=null);const t=e.touches[0];Ge(!0),Ye(t.pageX-qe.current.offsetLeft),et(qe.current.scrollLeft),tt.current=t.pageX,nt.current=Date.now(),at.current=0,qe.current&&(qe.current.style.scrollBehavior="auto")},onTouchMove:e=>{if(!Je||!qe.current)return;const t=e.touches[0],n=1.5*(t.pageX-qe.current.offsetLeft-Xe);qe.current.scrollLeft=Qe-n;const a=Date.now(),i=a-nt.current;if(i>0){const e=t.pageX,n=e-tt.current;at.current=n/i*16,tt.current=e,nt.current=a}},onTouchEnd:()=>{if(Ge(!1),qe.current){qe.current.style.scrollBehavior="smooth";const e=at.current;if(Math.abs(e)>.5){const e=()=>{qe.current&&(at.current*=.95,qe.current.scrollLeft-=at.current,Math.abs(at.current)>.5?it.current=requestAnimationFrame(e):it.current=null)};it.current=requestAnimationFrame(e)}}},onScroll:e=>{null==ot.current&&(ot.current=requestAnimationFrame(()=>{const e=qe.current;e&&(rt(),e.scrollLeft>0&&He&&$e(!1)),ot.current=null}))},sx:{WebkitOverflowScrolling:"touch",scrollBehavior:"smooth",transform:"translateZ(0)",willChange:"transform",overscrollBehaviorX:"contain",touchAction:"pan-x","th, td":{whiteSpace:"nowrap"},"::-webkit-scrollbar":{height:"14px"},"::-webkit-scrollbar-thumb":{background:"#3182ce",borderRadius:"10px",border:"3px solid transparent",backgroundClip:"content-box",transition:"background 0.2s ease","&:hover":{background:"#2c5aa0",backgroundClip:"content-box"},"&:active":{background:"#2a4e8a",backgroundClip:"content-box"}},"::-webkit-scrollbar-track":{background:(0,c.dU)("#f7fafc","#2d3748"),borderRadius:"10px",margin:"0 8px",border:"1px solid",borderColor:(0,c.dU)("#e2e8f0","#4a5568")}},children:[Ke&&(0,J.jsx)(s.a,{position:"sticky",left:0,top:0,bottom:0,w:"24px",pointerEvents:"none",bgGradient:ut,zIndex:1}),Ze&&(0,J.jsx)(s.a,{position:"sticky",right:0,top:0,bottom:0,w:"24px",pointerEvents:"none",bgGradient:ht,zIndex:1}),(0,J.jsxs)(z.X,{size:"sm",sx:{width:"max-content"},children:[(0,J.jsx)(E.d,{sx:{position:"sticky",top:0,zIndex:2,backgroundColor:st,th:{bg:st,color:lt,fontWeight:"bold",textTransform:"uppercase",fontSize:"xs",letterSpacing:"0.05em"}},children:(0,J.jsxs)(T.Tr,{children:[(0,J.jsx)(C.Th,{minW:"140px",children:"Datum"}),(0,J.jsx)(C.Th,{minW:"200px",children:"Sout\u011b\u017e"}),(0,J.jsx)(C.Th,{minW:"260px",children:"Dom\xe1c\xed"}),(0,J.jsx)(C.Th,{minW:"80px",textAlign:"center",children:"Sk\xf3re"}),(0,J.jsx)(C.Th,{minW:"260px",children:"Host\xe9"}),(0,J.jsx)(C.Th,{minW:"220px",children:"M\xedsto"}),(0,J.jsx)(C.Th,{minW:"180px",children:"Akce"})]})}),(0,J.jsx)(S.N,{children:0===Te.length?(0,J.jsx)(T.Tr,{children:(0,J.jsx)(A.Td,{colSpan:6,children:(0,J.jsx)(R.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 z\xe1pasy k zobrazen\xed."})})}):Me.map((e,t)=>{var n;const a=(e=>{if(!e)return!1;try{const t=(0,B.qg)(e,je,new Date);if(!isNaN(t.getTime()))return t.getTime()<Date.now()}catch(n){}try{const t=(0,B.qg)(e,"dd.MM.yyyy",new Date);if(!isNaN(t.getTime()))return t.getTime()<Date.now()}catch(a){}const t=new Date(e);return!isNaN(t.getTime())&&t.getTime()<Date.now()})(e.date_time||(e.date&&e.time?"".concat(e.date," ").concat(e.time):e.date)||""),i=e.score||null!=e.result_home&&null!=e.result_away;return(0,J.jsxs)(T.Tr,{bg:a?mt:pt,_hover:{bg:a?xt:gt},opacity:a?.85:1,transition:"all 0.2s",children:[(0,J.jsx)(A.Td,{children:(0,J.jsxs)(_.z,{spacing:2,children:[(0,J.jsx)(R.E,{children:be(String(e.date||e.date_time||""),String(e.time||""))}),a&&(0,J.jsx)(r.E,{colorScheme:"gray",fontSize:"xs",children:"Odehr\xe1no"}),!a&&(0,J.jsx)(r.E,{colorScheme:"green",fontSize:"xs",children:"Nadch\xe1zej\xedc\xed"})]})}),(0,J.jsx)(A.Td,{children:(0,J.jsx)(_.z,{spacing:2,children:(0,J.jsx)(r.E,{bg:"brand.primary",color:"text.onPrimary",borderRadius:"md",children:e.competitionName})})}),(0,J.jsx)(A.Td,{children:(0,J.jsxs)(_.z,{spacing:2,children:[(0,J.jsx)(V.A,{teamId:e.home_id?String(e.home_id):void 0,teamName:e.home||e.home_team||"",facrLogo:e.home_logo_url,size:"small",alt:e.home||e.home_team||"",loading:"lazy",decoding:"async",draggable:!1}),(0,J.jsx)(R.E,{fontWeight:a?"normal":"medium",children:e.home||e.home_team||""}),(0,J.jsx)(l.$,{size:"xs",variant:"outline",onClick:()=>Ue(e),borderRadius:"md",_hover:{borderColor:"brand.primary",color:"brand.primary"},children:"T\xfdm"})]})}),(0,J.jsx)(A.Td,{textAlign:"center",children:(0,J.jsx)(R.E,{fontWeight:i?"bold":"normal",color:i?"blue.600":"gray.500",children:e.score||(null!=e.result_home&&null!=e.result_away?"".concat(e.result_home,":").concat(e.result_away):"\u2013:\u2013")})}),(0,J.jsx)(A.Td,{children:(0,J.jsxs)(_.z,{spacing:2,children:[(0,J.jsx)(V.A,{teamId:e.away_id?String(e.away_id):void 0,teamName:e.away||e.away_team||"",facrLogo:e.away_logo_url,size:"small",alt:e.away||e.away_team||"",loading:"lazy",decoding:"async",draggable:!1}),(0,J.jsx)(R.E,{fontWeight:a?"normal":"medium",children:e.away||e.away_team||""}),(0,J.jsx)(l.$,{size:"xs",variant:"outline",onClick:()=>Ue(e),borderRadius:"md",_hover:{borderColor:"brand.primary",color:"brand.primary"},children:"T\xfdm"})]})}),(0,J.jsx)(A.Td,{children:e.venue||""}),(0,J.jsx)(A.Td,{children:(0,J.jsx)(_.z,{spacing:2,children:(0,J.jsx)(l.$,{size:"xs",onClick:()=>Ue(e),bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},borderRadius:"md",children:"Upravit"})})})]},null!==(n=e.id)&&void 0!==n?n:t)})})]})]}),Te.length>Me.length&&(0,J.jsx)(_.z,{justify:"center",mt:6,children:(0,J.jsxs)(l.$,{onClick:()=>Fe(e=>e+De),size:"lg",bg:"brand.primary",color:"text.onPrimary",_hover:{filter:"brightness(0.95)"},borderRadius:"lg",px:8,children:["Na\u010d\xedst dal\u0161\xed (",Te.length-Me.length," z\xe1pas\u016f)"]})})]})]}),(0,J.jsxs)(b._s,{isOpen:n,placement:"right",onClose:()=>G(!1),size:Oe,children:[(0,J.jsx)(j.m,{}),(0,J.jsxs)(y.z,{children:[(0,J.jsx)(v.r,{children:"Upravit z\xe1pas"}),(0,J.jsx)(x.c,{children:X?(0,J.jsxs)(w.B,{spacing:4,children:[(0,J.jsxs)(d.MJ,{children:[(0,J.jsx)(h.l,{children:"Datum a \u010das"}),(0,J.jsx)(m.p,{type:"datetime-local",value:Q.date_time_edit,onChange:e=>ee(t=>(0,a.A)((0,a.A)({},t),{},{date_time_edit:e.target.value}))}),Le&&(0,J.jsx)(u.Wt,{children:"Neplatn\xfd form\xe1t data/\u010dasu"})]}),(0,J.jsxs)(d.MJ,{children:[(0,J.jsx)(h.l,{children:"M\xedsto"}),(0,J.jsx)(m.p,{placeholder:"M\xedsto kon\xe1n\xed",value:Q.venue_override,onChange:e=>ee(t=>(0,a.A)((0,a.A)({},t),{},{venue_override:e.target.value}))})]}),(0,J.jsxs)(d.MJ,{children:[(0,J.jsx)(h.l,{children:"Sk\xf3re"}),(0,J.jsx)(m.p,{placeholder:"nap\u0159. 2:1",value:Q.score_override,onChange:e=>ee(t=>(0,a.A)((0,a.A)({},t),{},{score_override:e.target.value}))})]})]}):(0,J.jsx)(R.E,{color:"gray.500",children:"Nen\xed vybr\xe1n \u017e\xe1dn\xfd z\xe1pas."})}),(0,J.jsx)(g.j,{children:(0,J.jsxs)(_.z,{spacing:3,children:[(0,J.jsx)(l.$,{variant:"outline",onClick:()=>G(!1),children:"Zav\u0159\xedt"}),(0,J.jsx)(l.$,{colorScheme:"blue",isLoading:We.isPending,onClick:()=>We.mutate(),isDisabled:Le,children:"Ulo\u017eit zm\u011bny"})]})})]})]})]})}},90944:(e,t,n)=>{n.d(t,{E:()=>o,w:()=>i});var a=n(46291);async function i(){const{data:e}=await a.Ay.get("/admin/prefetch/status");return e}async function o(){const{data:e}=await a.Ay.post("/admin/prefetch/trigger",{});return e}},91276:(e,t,n)=>{n.d(t,{V:()=>i});var a=n(25189);const i=e=>{if(!e)return;return(0,a.uq)(e)||e||void 0}},91296:(e,t,n)=>{n.d(t,{Sm:()=>l,gm:()=>s,rR:()=>r,sJ:()=>o});var a=n(89379),i=n(46291);async function o(){const e=(await i.Ay.get("/sponsors")).data;return((Array.isArray(e)?e:Array.isArray(null===e||void 0===e?void 0:e.data)?e.data:[])||[]).map(e=>{var t,n,i;return(0,a.A)((0,a.A)({},e),{},{id:null!==(t=null!==(n=null!==(i=e.id)&&void 0!==i?i:e.ID)&&void 0!==n?n:e.Id)&&void 0!==t?t:e.iD})})}async function r(e){return(await i.Ay.post("/sponsors",e)).data}async function s(e,t){return(await i.Ay.put("/sponsors/".concat(e),t)).data}async function l(e){return(await i.Ay.delete("/sponsors/".concat(e))).data}},91776:(e,t,n)=>{n.r(t),n.d(t,{default:()=>D});var a=n(89379),i=n(65043),o=n(6583),r=n(87139),s=n(22107),l=n(98662),c=n(42703),d=n(44093),u=n(82459),h=n(73225),m=n(76668),p=n(73212),x=n(33572),g=n(35699),v=n(7189),j=n(97569),b=n(96148),y=n(10202),f=n(98481),k=n(19077),_=n(30502),w=n(28846),z=n(39081),S=n(79219),A=n(1009),C=n(70579);const E={title:"",description:"",price:0,currency:"K\u010d",image_url:"",url:"",is_active:!0,display_order:0},T=e=>{let{item:t}=e;const n=(0,d.dU)("white","gray.800"),a=(0,d.dU)("gray.200","gray.700");return(0,C.jsxs)(s.a,{role:"group",bg:n,borderWidth:"1px",borderColor:a,borderRadius:"xl",overflow:"hidden",transition:"all 0.3s",_hover:{transform:"translateY(-4px)",boxShadow:"lg"},children:[(0,C.jsxs)(s.a,{position:"relative",paddingTop:"100%",overflow:"hidden",children:[(0,C.jsx)(x._,{src:t.image_url,alt:t.title||"N\xe1hled produktu",position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",fallbackSrc:"/images/placeholder-clothing.jpg"}),t.url&&(0,C.jsx)(s.a,{position:"absolute",top:2,right:2,bg:"white",borderRadius:"full",p:2,opacity:0,_groupHover:{opacity:1},transition:"opacity 0.2s",children:(0,C.jsx)(A.HaR,{size:16})})]}),(0,C.jsxs)(y.T,{align:"stretch",p:4,spacing:2,children:[(0,C.jsx)(w.D,{as:"h3",size:"sm",noOfLines:2,children:t.title||"N\xe1zev produktu"}),t.description&&(0,C.jsx)(z.E,{fontSize:"sm",color:"gray.600",noOfLines:2,children:t.description}),(0,C.jsxs)(b.z,{justify:"space-between",mt:2,children:[t.price&&t.price>0?(0,C.jsxs)(r.E,{colorScheme:"blue",fontSize:"md",px:2,py:1,children:[t.price," ",t.currency||"K\u010d"]}):(0,C.jsx)(s.a,{}),t.url&&(0,C.jsx)(z.E,{fontSize:"xs",color:"blue.500",children:"Zobrazit \u2192"})]})]})]})},D=()=>{const[e,t]=(0,i.useState)(!0),[n,r]=(0,i.useState)(!1),[d,x]=(0,i.useState)([]),D=(0,_.d)(),N="http://localhost:3100",R=async()=>{try{const e=await(0,S.g6)();x(e)}catch(e){D({status:"error",title:"Chyba",description:"Nepoda\u0159ilo se na\u010d\xedst oble\u010den\xed."})}finally{t(!1)}};(0,i.useEffect)(()=>{R()},[]);const F=(e,t,n)=>{x(i=>i.map((i,o)=>o===e?(0,a.A)((0,a.A)({},i),{},{[t]:n}):i))};return(0,C.jsx)(o.A,{children:(0,C.jsxs)(s.a,{children:[(0,C.jsx)(w.D,{size:"md",mb:2,children:"Oble\u010den\xed a Fan Shop"}),(0,C.jsx)(z.E,{fontSize:"sm",color:"gray.600",mb:2,children:"Spravujte polo\u017eky oble\u010den\xed a merchandisingu. Na tituln\xed str\xe1nce se zobraz\xed 5 nejnov\u011bj\u0161\xedch polo\u017eek, v\u0161echny polo\u017eky jsou k dispozici na str\xe1nce /obleceni."}),(0,C.jsx)(s.a,{mb:4,p:3,bg:"blue.50",borderRadius:"md",borderLeft:"4px solid",borderColor:"blue.500",children:(0,C.jsxs)(z.E,{fontSize:"sm",color:"blue.800",children:["\ud83d\udca1 ",(0,C.jsx)("strong",{children:"Tip:"})," P\u0159idejte cenu pro lep\u0161\xed p\u0159ehlednost. Na ve\u0159ejn\xe9 str\xe1nce se zobraz\xed pouze aktivn\xed polo\u017eky."]})}),N&&(0,C.jsx)(s.a,{mb:4,p:3,bg:"green.50",borderRadius:"md",borderLeft:"4px solid",borderColor:"green.500",children:(0,C.jsxs)(z.E,{fontSize:"sm",color:"green.800",children:["E-shop je zapnut\xfd. Tato sekce slou\u017e\xed jako v\xfdloha na hlavn\xedm webu."," ","Pro plnou spr\xe1vu objedn\xe1vek a produkt\u016f pou\u017eijte samostatn\xfd e-shop na adrese"," ",(0,C.jsx)(v.N,{href:N,isExternal:!0,color:"green.900",fontWeight:"semibold",children:N}),"."]})}),(0,C.jsx)(b.z,{justify:"space-between",mb:3,children:(0,C.jsx)(l.$,{leftIcon:(0,C.jsx)(A.GGD,{}),onClick:()=>{const e=(0,a.A)({},E);x(t=>[...t,e])},children:"P\u0159idat polo\u017eku"})}),(0,C.jsx)(u.c,{my:3}),e?(0,C.jsx)(z.E,{children:"Na\u010d\xedt\xe1n\xed\u2026"}):(0,C.jsxs)(y.T,{align:"stretch",spacing:4,children:[d.map((e,t)=>(0,C.jsxs)(s.a,{borderWidth:"1px",borderRadius:"md",p:4,bg:"white",children:[(0,C.jsxs)(b.z,{justify:"space-between",mb:3,children:[(0,C.jsxs)(w.D,{size:"sm",children:[e.title||"Polo\u017eka #".concat(t+1),!e.is_active&&(0,C.jsx)(z.E,{as:"span",ml:2,fontSize:"xs",color:"gray.500",children:"(neaktivn\xed)"})]}),(0,C.jsxs)(b.z,{children:[(0,C.jsx)(l.$,{size:"sm",colorScheme:"blue",leftIcon:(0,C.jsx)(A.Bc_,{}),onClick:()=>(async e=>{const t=d[e];if(t.title&&t.image_url){r(!0);try{t.id?(await(0,S.ug)(t.id,t),D({status:"success",title:"Ulo\u017eeno",description:"Polo\u017eka byla aktualizov\xe1na."})):(await(0,S.n7)(t),D({status:"success",title:"Ulo\u017eeno",description:"Polo\u017eka byla vytvo\u0159ena."}),R())}catch(n){D({status:"error",title:"Chyba",description:"Nepoda\u0159ilo se ulo\u017eit polo\u017eku."})}finally{r(!1)}}else D({status:"warning",title:"Upozorn\u011bn\xed",description:"Vypl\u0148te alespo\u0148 n\xe1zev a obr\xe1zek."})})(t),isLoading:n,children:"Ulo\u017eit"}),(0,C.jsx)(c.K,{"aria-label":"Smazat",icon:(0,C.jsx)(A.IXo,{}),onClick:()=>(async e=>{const t=d[e];if(t.id)try{await(0,S.oQ)(t.id),D({status:"success",title:"Smaz\xe1no",description:"Polo\u017eka byla smaz\xe1na."}),R()}catch(n){D({status:"error",title:"Chyba",description:"Nepoda\u0159ilo se smazat polo\u017eku."})}else x(t=>t.filter((t,n)=>n!==e))})(t),variant:"outline",colorScheme:"red",size:"sm"})]})]}),(0,C.jsxs)(p.r,{columns:{base:1,md:2},spacing:3,children:[(0,C.jsxs)(h.MJ,{isRequired:!0,children:[(0,C.jsx)(m.l,{children:"N\xe1zev"}),(0,C.jsx)(g.p,{value:e.title||"",onChange:e=>F(t,"title",e.target.value),placeholder:"nap\u0159. Dres dom\xe1c\xed 2024/25"})]}),(0,C.jsxs)(h.MJ,{isRequired:!0,children:[(0,C.jsx)(m.l,{children:"Obr\xe1zek (URL)"}),(0,C.jsx)(g.p,{value:e.image_url||"",onChange:e=>F(t,"image_url",e.target.value),placeholder:"https://example.com/img.jpg"})]}),(0,C.jsxs)(h.MJ,{children:[(0,C.jsx)(m.l,{children:"Cena"}),(0,C.jsxs)(b.z,{children:[(0,C.jsx)(j.Q7,{value:e.price||0,onChange:(e,n)=>F(t,"price",n),min:0,precision:2,flex:1,children:(0,C.jsx)(j.OO,{placeholder:"0.00"})}),(0,C.jsx)(g.p,{value:e.currency||"K\u010d",onChange:e=>F(t,"currency",e.target.value),placeholder:"K\u010d",width:"80px"})]})]}),(0,C.jsxs)(h.MJ,{children:[(0,C.jsx)(m.l,{children:"Odkaz (e\u2011shop)"}),(0,C.jsx)(g.p,{value:e.url||"",onChange:e=>F(t,"url",e.target.value),placeholder:"https://eshop.example.com/produkt"})]}),(0,C.jsxs)(h.MJ,{children:[(0,C.jsx)(m.l,{children:"Po\u0159ad\xed zobrazen\xed"}),(0,C.jsx)(j.Q7,{value:e.display_order||0,onChange:(e,n)=>F(t,"display_order",n),min:0,children:(0,C.jsx)(j.OO,{})})]}),(0,C.jsxs)(h.MJ,{display:"flex",alignItems:"center",children:[(0,C.jsx)(m.l,{mb:0,children:"Aktivn\xed"}),(0,C.jsx)(f.d,{isChecked:!1!==e.is_active,onChange:e=>F(t,"is_active",e.target.checked)})]})]}),(0,C.jsxs)(h.MJ,{mt:3,children:[(0,C.jsx)(m.l,{children:"Popis"}),(0,C.jsx)(k.T,{value:e.description||"",onChange:e=>F(t,"description",e.target.value),placeholder:"Voliteln\xfd popis polo\u017eky",rows:2})]}),(0,C.jsxs)(s.a,{mt:4,children:[(0,C.jsx)(w.D,{size:"xs",mb:2,children:"N\xe1hled ve\u0159ejn\xe9 karty"}),(0,C.jsx)(s.a,{maxW:"360px",children:(0,C.jsx)(T,{item:e})})]})]},t)),0===d.length&&(0,C.jsx)(z.E,{color:"gray.600",children:'Zat\xedm \u017e\xe1dn\xe9 polo\u017eky. Pou\u017eijte tla\u010d\xedtko \u201eP\u0159idat polo\u017eku".'})]})]})})}},91896:(e,t,n)=>{n.d(t,{IG:()=>o,od:()=>r});n(46291);const a="https://translate.tdvorak.dev/translate";new Map;async function i(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};try{const o=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({q:e,source:t,target:n,format:i.format||"text",alternatives:i.alternatives||0})});if(!o.ok)throw new Error("Translation API error: ".concat(o.status," ").concat(o.statusText));return await o.json()}catch(o){throw console.error("Translation error:",o),o}}async function o(e,t,n,a){try{const[o,r]=await Promise.all([i(e,n,a,{format:"text"}),i(t,n,a,{format:"html"})]);return{translatedTitle:o.translatedText,translatedContent:r.translatedText}}catch(o){throw console.error("Blog translation error:",o),o}}function r(e){return/[\xe1\u010d\u010f\xe9\u011b\xed\u0148\xf3\u0159\u0161\u0165\xfa\u016f\xfd\u017e]/i.test(e)||/\b(a|je|v|na|z|do|od|po|pro|p\u0159i|pod|p\u0159ed|s|se|si|k|ke|t|ti|tom|tomu|t\xedm|t\u011bm|t\u011bmu|toho|tomu|jeho|jeho\u017e|jej\xed|jejich|sv\u016fj|sv\xe1|sv\xe9|sv\xfdch|b\xfdt|b\xfdt|jsem|jsi|je|jsme|jste|jsou|m\xedt|m\xedt|m\xe1m|m\xe1\u0161|m\xe1|n\xe1\u0161|va\u0161e|kter\xfd|kter\xe1|kter\xe9|kter\xfdm|kter\xfdmi|kter\xfdch|aby|aby|jako|jako|kdy|kdy\u017e|kde|kam|kudy|co|pro\u010d|jak|jak|kolik|kdo|kdy|jestli|li|jestli\u017ee|pokud|a\u010dkoli|i kdy\u017e|proto|proto\u017ee|tud\xed\u017e|tedy|v\u0161ak|ale|av\u0161ak|nebo|bu\u010f|anebo|ani|kdy\u017e|pokud|jestli|li|jestli\u017ee|aby|aby|by|bych|bys|bychom|byste|by|by|by|by|by)\b/i.test(e)?"cs":"en"}},91957:(e,t,n)=>{n.r(t),n.d(t,{default:()=>J});var a=n(65043),i=n(96870),o=n(88787),r=n(34334),s=n(85871),l=n(33430),c=n(87139),d=n(22107),u=n(98662),h=n(44093),m=n(98939),p=n(73225),x=n(76668),g=n(33572),v=n(35699),j=n(7189),b=n(67516),y=n(35929),f=n(56529),k=n(15071),_=n(11054),w=n(78460),z=n(85421),S=n(76659),A=n(96148),C=n(10202),E=n(80511),T=n(82595),D=n(67813),N=n(83201),R=n(3313),F=n(55395),P=n(30502),I=n(28846),M=n(39081),L=n(28646),W=n(70764),U=n(35087),O=n(70067),q=n(71360),K=n(50516),B=n(6583),Z=n(46291),V=n(32386),H=n(70579);const $=e=>{try{if(/^https?:\/\//i.test(e))return e;if(e.startsWith("/cache")||e.startsWith("/uploads")||e.startsWith("/api/")){let a="";try{const e="http://127.0.0.1:8080".trim();e&&(a=new URL(e,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin)}catch(t){}if(!a)try{a=new URL(Z.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin}catch(n){}return new URL(e,a||("undefined"!==typeof window?window.location.origin:"http://localhost:3000")).toString()}return e}catch(a){return e}},J=()=>{const e=(0,h.dU)("white","gray.800"),[t,n]=((0,h.dU)("gray.200","gray.700"),(0,h.dU)("gray.600","gray.400"),(0,a.useState)([])),[J,G]=(0,a.useState)(!0),[X,Y]=(0,a.useState)(!1),[Q,ee]=(0,a.useState)(""),te=(0,P.d)(),{isOpen:ne,onOpen:ae,onClose:ie}=(0,i.j)(),[oe,re]=(0,a.useState)(""),[se,le]=(0,a.useState)(50),[ce,de]=(0,a.useState)(!1),ue=async()=>{G(!0),ee("");try{const[t,a]=await Promise.allSettled([fetch($("/cache/prefetch/zonerama_profile.json"),{cache:"no-cache"}),fetch($("/cache/prefetch/zonerama_albums.json"),{cache:"no-cache"})]);let i=[];if("fulfilled"===t.status&&t.value.ok){const e=await t.value.json();e.albums&&Array.isArray(e.albums)&&(i=[...e.albums])}if("fulfilled"===a.status&&a.value.ok){const e=await a.value.json(),t=(Array.isArray(e)?e:[]).filter(e=>e.id&&e.title&&!i.some(t=>t.id===e.id));i=[...i,...t]}if(!i||0===i.length)try{const e=await(0,V.Gz)();if(Array.isArray(e)&&e.length>0){const t={};e.forEach(e=>{const n=String(e.album_id||"unknown");(t[n]=t[n]||[]).push(e)});const n=Object.entries(t).map(e=>{let[t,n]=e;return{id:t,title:"Album",url:n[0].page_url||"#",date:"",photos_count:n.length,photos:n.slice(0,12).map(e=>({id:String(e.id||""),page_url:String(e.page_url||""),image_1500:String(e.src||e.local||"")}))}});i=n}}catch(e){}const o=e=>{const t=String(e||"").trim();if(!t)return 0;const n=Date.parse(t);if(!Number.isNaN(n))return n;const a=t.match(/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/);if(a){const e=parseInt(a[1],10),t=parseInt(a[2],10)-1,n=parseInt(a[3],10);return new Date(n,t,e).getTime()}return 0};return i=[...i].sort((e,t)=>{const n=o(e.date),a=o(t.date);return a!==n?a-n:String(t.id||"").localeCompare(String(e.id||""))}),n(i),i}catch(t){return ee(t.message||"Nepoda\u0159ilo se na\u010d\xedst alba"),[]}finally{G(!1)}},he=async()=>{Y(!0);try{await Z.Ay.post("/admin/gallery/refresh",{}),te({title:"Galerie obnovena",description:"Data z Zonerama byla \xfasp\u011b\u0161n\u011b na\u010dtena",status:"success",duration:3e3,isClosable:!0});let e=[];for(let t=0;t<5&&(await new Promise(e=>setTimeout(e,1200)),e=await ue(),!(e&&e.length>0));t++);}catch(n){var e,t;const a=(null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||n.message||"Nepoda\u0159ilo se obnovit galerii";te({title:"Chyba p\u0159i obnov\u011b galerie",description:a,status:"error",duration:5e3,isClosable:!0}),console.error("Gallery refresh error:",n)}finally{Y(!1)}};(0,a.useEffect)(()=>{ue()},[]);const me=t.reduce((e,t)=>e+t.photos_count,0),pe=t.reduce((e,t)=>e+(t.views_count||0),0);return(0,H.jsx)(B.A,{requireAdmin:!1,children:(0,H.jsx)(m.m,{maxW:"7xl",py:8,children:(0,H.jsxs)(C.T,{align:"stretch",spacing:6,children:[(0,H.jsxs)(A.z,{justify:"space-between",align:"center",flexWrap:"wrap",children:[(0,H.jsxs)(C.T,{align:"start",spacing:1,children:[(0,H.jsx)(I.D,{size:"xl",children:"Spr\xe1va galerie"}),(0,H.jsx)(M.E,{color:"gray.600",children:"Spr\xe1va alb a fotografi\xed ze Zonerama"})]}),(0,H.jsxs)(A.z,{spacing:3,children:[(0,H.jsx)(u.$,{leftIcon:(0,H.jsx)(q.A,{size:18}),colorScheme:"green",onClick:ae,children:"P\u0159idat album"}),(0,H.jsx)(u.$,{leftIcon:(0,H.jsx)(K.A,{size:18}),colorScheme:"blue",onClick:he,isLoading:X,loadingText:"Obnova...",children:"Obnovit z Zonerama"})]})]}),(0,H.jsxs)(o.F,{status:"info",borderRadius:"md",children:[(0,H.jsx)(s._,{}),(0,H.jsxs)(d.a,{children:[(0,H.jsx)(l.X,{children:"Zonerama integrace"}),(0,H.jsx)(r.T,{children:'Alba jsou automaticky na\u010d\xedt\xe1na ze Zonerama profilu. Klikn\u011bte na "Obnovit z Zonerama" pro synchronizaci s nejnov\u011bj\u0161\xedmi daty.'})]})]}),!J&&!Q&&t.length>0&&(0,H.jsxs)(A.z,{spacing:4,flexWrap:"wrap",children:[(0,H.jsxs)(c.E,{colorScheme:"purple",fontSize:"md",p:3,borderRadius:"md",children:[t.length," alb"]}),(0,H.jsxs)(c.E,{colorScheme:"blue",fontSize:"md",p:3,borderRadius:"md",children:[me," fotografi\xed"]}),(0,H.jsxs)(c.E,{colorScheme:"green",fontSize:"md",p:3,borderRadius:"md",children:[pe," zhl\xe9dnut\xed"]})]}),J&&(0,H.jsxs)(C.T,{spacing:4,py:12,children:[(0,H.jsx)(S.y,{size:"xl",color:"brand.primary"}),(0,H.jsx)(M.E,{color:"gray.600",children:"Na\u010d\xedt\xe1m alba..."})]}),Q&&!J&&(0,H.jsxs)(o.F,{status:"error",borderRadius:"md",children:[(0,H.jsx)(s._,{}),(0,H.jsx)(r.T,{children:Q})]}),!J&&!Q&&0===t.length&&(0,H.jsx)(d.a,{bg:e,borderWidth:"1px",borderRadius:"lg",p:12,textAlign:"center",children:(0,H.jsxs)(C.T,{spacing:4,children:[(0,H.jsx)(O.A,{size:48,color:"gray"}),(0,H.jsx)(I.D,{size:"md",color:"gray.600",children:"Zat\xedm nejsou k dispozici \u017e\xe1dn\xe1 alba"}),(0,H.jsx)(M.E,{color:"gray.500",children:'Klikn\u011bte na tla\u010d\xedtko "Obnovit z Zonerama" pro na\u010dten\xed alb.'}),(0,H.jsx)(u.$,{leftIcon:(0,H.jsx)(K.A,{size:18}),colorScheme:"blue",onClick:he,isLoading:X,children:"Obnovit z Zonerama"})]})}),!J&&!Q&&t.length>0&&(0,H.jsx)(d.a,{bg:e,borderWidth:"1px",borderRadius:"lg",overflow:"hidden",boxShadow:"sm",children:(0,H.jsxs)(E.X,{variant:"simple",children:[(0,H.jsx)(R.d,{bg:(0,h.dU)("gray.50","gray.900"),children:(0,H.jsxs)(F.Tr,{children:[(0,H.jsx)(N.Th,{width:"100px",children:"N\xe1hled"}),(0,H.jsx)(N.Th,{children:"N\xe1zev"}),(0,H.jsx)(N.Th,{width:"120px",children:"Datum"}),(0,H.jsx)(N.Th,{width:"100px",isNumeric:!0,children:"Fotky"}),(0,H.jsx)(N.Th,{width:"120px",isNumeric:!0,children:"Zhl\xe9dnut\xed"}),(0,H.jsx)(N.Th,{width:"180px",children:"Akce"})]})}),(0,H.jsx)(T.N,{children:t.map(e=>{const t=e.photos&&e.photos.length>0?e.photos[0]:null;return(0,H.jsxs)(F.Tr,{_hover:{bg:"gray.50"},children:[(0,H.jsx)(D.Td,{children:t?(0,H.jsx)(g._,{src:$(t.image_1500),alt:e.title,boxSize:"60px",objectFit:"cover",borderRadius:"md"}):(0,H.jsx)(d.a,{boxSize:"60px",bg:"gray.200",borderRadius:"md",display:"flex",alignItems:"center",justifyContent:"center",children:(0,H.jsx)(O.A,{size:24,color:"gray"})})}),(0,H.jsx)(D.Td,{children:(0,H.jsx)(M.E,{fontWeight:"600",color:"gray.800",noOfLines:2,children:e.title})}),(0,H.jsx)(D.Td,{children:(0,H.jsxs)(A.z,{spacing:1,fontSize:"sm",color:"gray.600",children:[(0,H.jsx)(L.A,{size:14}),(0,H.jsx)(M.E,{children:e.date})]})}),(0,H.jsx)(D.Td,{isNumeric:!0,children:(0,H.jsx)(c.E,{colorScheme:"blue",children:e.photos_count})}),(0,H.jsx)(D.Td,{isNumeric:!0,children:(0,H.jsxs)(A.z,{spacing:1,justify:"flex-end",children:[(0,H.jsx)(U.A,{size:14}),(0,H.jsx)(M.E,{fontSize:"sm",children:e.views_count||0})]})}),(0,H.jsx)(D.Td,{children:(0,H.jsxs)(A.z,{spacing:2,children:[(0,H.jsx)(u.$,{as:j.N,href:"/galerie/album/".concat(e.id),target:"_blank",size:"sm",colorScheme:"purple",variant:"outline",children:"N\xe1hled"}),(0,H.jsx)(u.$,{as:j.N,href:e.url,target:"_blank",rel:"noopener noreferrer",size:"sm",colorScheme:"blue",variant:"ghost",rightIcon:(0,H.jsx)(W.A,{size:14}),children:"Zonerama"})]})})]},e.id)})})]})}),(0,H.jsxs)(w.aF,{isOpen:ne,onClose:ie,size:"lg",children:[(0,H.jsx)(_.m,{}),(0,H.jsxs)(z.$,{children:[(0,H.jsx)(k.r,{children:"P\u0159idat Zonerama album"}),(0,H.jsx)(y.s,{}),(0,H.jsx)(b.c,{children:(0,H.jsxs)(C.T,{align:"stretch",spacing:4,children:[(0,H.jsxs)(p.MJ,{children:[(0,H.jsx)(x.l,{children:"URL Zonerama alba"}),(0,H.jsx)(v.p,{placeholder:"https://eu.zonerama.com/\u2026/Album/12345",value:oe,onChange:e=>re(e.target.value)})]}),(0,H.jsxs)(p.MJ,{children:[(0,H.jsx)(x.l,{children:"Limit fotek"}),(0,H.jsx)(v.p,{type:"number",min:1,max:200,value:String(se),onChange:e=>{const t=parseInt(e.target.value||"0",10);le(Number.isFinite(t)?t:50)}})]})]})}),(0,H.jsx)(f.j,{children:(0,H.jsxs)(A.z,{spacing:3,children:[(0,H.jsx)(u.$,{variant:"ghost",onClick:ie,children:"Zru\u0161it"}),(0,H.jsx)(u.$,{colorScheme:"blue",onClick:async()=>{const e=oe.trim();if(e&&e.includes("/Album/")){de(!0);try{const t=Number.isFinite(se)&&se>0?se:50;await Z.Ay.post("/admin/gallery/albums/fetch",{link:e,photo_limit:t}),te({title:"Album p\u0159id\xe1no",description:"Album bylo na\u010dteno a ulo\u017eeno.",status:"success",duration:3e3,isClosable:!0}),ie(),re(""),await ue()}catch(a){var t,n;const e=(null===a||void 0===a||null===(t=a.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||(null===a||void 0===a?void 0:a.message)||"Nepoda\u0159ilo se p\u0159idat album";te({title:"Chyba p\u0159i p\u0159id\xe1n\xed alba",description:e,status:"error",duration:5e3,isClosable:!0})}finally{de(!1)}}else te({title:"Neplatn\xfd odkaz",description:'URL mus\xed obsahovat "/Album/"',status:"error",duration:4e3,isClosable:!0})},isLoading:ce,children:"Na\u010d\xedst album"})]})})]})]})]})})})}},92724:(e,t,n)=>{n.r(t),n.d(t,{default:()=>k});var a=n(89379),i=n(65043),o=n(22107),r=n(98662),s=n(68659),l=n(98939),c=n(61724),d=n(76659),u=n(96148),h=n(10202),m=n(30502),p=n(28846),x=n(39081),g=n(73216),v=n(35475),j=n(6583),b=n(9976),y=n(57550),f=n(70579);const k=()=>{var e;const{id:t}=(0,g.g)(),n=(0,m.d)(),[k,_]=(0,i.useState)(null),[w,z]=(0,i.useState)(!0),[S,A]=(0,i.useState)("roulette"),[C,E]=(0,i.useState)("dark"),[T,D]=(0,i.useState)(!0),[N,R]=(0,i.useState)(!0),[F,P]=(0,i.useState)(0),[I,M]=(0,i.useState)(!1),[L,W]=(0,i.useState)(0),U=(0,i.useRef)(null),[O,q]=((0,i.useRef)(null),(0,i.useRef)(null),(0,i.useRef)(0),(0,i.useState)(0)),[K,B]=((0,i.useRef)({}),(0,i.useState)([])),Z=(0,i.useRef)(null),[V,H]=(0,i.useState)([]),[$,J]=(0,i.useState)(0),[G,X]=(0,i.useState)(0),[Y,Q]=(0,i.useState)(!0),[ee,te]=(0,i.useState)("normal"),[ne,ae]=(0,i.useState)(3),[ie,oe]=(0,i.useState)(4600),re=(null===k||void 0===k?void 0:k.entries)||[],se=(null===k||void 0===k?void 0:k.winners)||[],{data:le}=(0,y.s)(),ce=(null===le||void 0===le||le.club_logo_url,((null===le||void 0===le?void 0:le.primary_color)||"#1e3a8a").trim(),null===(e=se[F])||void 0===e?void 0:e.user_id),de=(0,i.useMemo)(()=>re.findIndex(e=>e.user_id===ce),[re,ce]),ue=()=>{if(N)try{const e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),n=e.createGain();t.connect(n),n.connect(e.destination),t.type="triangle",t.frequency.value=880,n.gain.value=.001,t.start(),n.gain.exponentialRampToValueAtTime(.5,e.currentTime+.02),n.gain.exponentialRampToValueAtTime(1e-4,e.currentTime+.18),t.stop(e.currentTime+.2)}catch(e){}},he=()=>{if(!T)return;const e=document.getElementById("visual-host");if(!e)return;for(let t=0;t<80;t++){const t=document.createElement("div");t.className="confetti";const n=6+6*Math.random();t.style.position="absolute",t.style.left=10+80*Math.random()+"%",t.style.top="0%",t.style.width="".concat(n,"px"),t.style.height="".concat(n*(.5+Math.random()),"px"),t.style.background="hsl(".concat(Math.floor(360*Math.random()),", 80%, 60%)"),t.style.opacity="0.9",t.style.transform="translate(-50%,-50%) rotate(".concat(360*Math.random(),"deg)"),t.style.borderRadius="1px",t.style.pointerEvents="none",t.style.animation="fall ".concat(1.5+1.5*Math.random(),"s ease-out forwards"),e.appendChild(t),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t)},3500)}},me=()=>{if(!re.length||F>=se.length)return;M(!0);let e=50,t=0;const n=()=>{if(W(e=>(e+1)%re.length),t++,t<40)U.current=window.setTimeout(n,e);else if(t<80)e+=5,U.current=window.setTimeout(n,e);else if(t<160)e+=15,U.current=window.setTimeout(n,e);else{const t=(L+1)%re.length;W(t);t===de?(M(!1),P(e=>e+1),ue(),he()):(e+=30,U.current=window.setTimeout(n,e))}};n()},pe=()=>{(()=>{if(!re.length||F>=se.length)return;const e=de;if(e<0)return void me();M(!0);const t=new Map;for(const s of re)t.has(s.user_id)||t.set(s.user_id,s);const n=Y?re:Array.from(t.values()),a=Math.max(80,Math.min(240,4*n.length)),i=e=>Math.floor(Math.random()*e),o=[];for(let s=0;s<a-10;s++)o.push(n[i(n.length)]);const r=re[e];for(let s=0;s<5;s++)o.push(n[i(n.length)]);o.push(r),H(o),window.requestAnimationFrame(()=>{try{const e=document.getElementById("visual-host"),t=Z.current;if(!e||!t)return void M(!1);const n=e.getBoundingClientRect(),a=72,r=a+8,s=(o.length-1)*r-Math.max(0,(n.width-a)/2);J(0),X(e=>e+1),setTimeout(()=>{const e=Math.max(0,Math.min(5,Number(ne)||3)),t=n.width*e+i(n.width);J(s+t);const a="slow"===ee?1.25:"fast"===ee?.75:1,o=Math.round(4600*a);oe(o),window.setTimeout(()=>{M(!1),P(e=>e+1),ue(),he()},o+50)},40)}catch(e){M(!1)}})})()},[xe,ge]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if(xe){if(!I&&F<se.length){const e=window.setTimeout(()=>pe(),400);return()=>window.clearTimeout(e)}F>=se.length&&ge(!1)}},[xe,I,F,se.length,S]);if((0,i.useEffect)(()=>{let e=!0;return(async()=>{try{z(!0);const n=await(0,b.mG)(Number(t));if(!e)return;_(n),A("roulette");try{const n=await(0,b.rz)(Number(t));e&&B(n)}catch(a){}}catch(i){n({status:"error",title:"Nelze na\u010d\xedst data vizualizace"})}finally{e&&z(!1)}})(),()=>{e=!1,U.current&&window.clearTimeout(U.current)}},[t]),w)return(0,f.jsx)(j.A,{children:(0,f.jsx)(l.m,{maxW:"6xl",py:8,children:(0,f.jsx)(d.y,{})})});if(!k)return(0,f.jsx)(j.A,{children:(0,f.jsx)(l.m,{maxW:"6xl",py:8,children:(0,f.jsx)(x.E,{children:"\u017d\xe1dn\xe1 data"})})});const ve=se.slice(0,F);return(0,f.jsxs)(j.A,{children:[(0,f.jsxs)(l.m,{maxW:"6xl",py:6,children:[(0,f.jsxs)(u.z,{justify:"space-between",mb:3,children:[(0,f.jsxs)(p.D,{size:"lg",children:["Vizualizace \u2013 ",k.sweepstake.title]}),(0,f.jsxs)(u.z,{children:[(0,f.jsx)(r.$,{as:v.N_,to:"/admin/sweepstakes",variant:"outline",children:"Zp\u011bt"}),(0,f.jsx)(r.$,{onClick:()=>{const e=document.getElementById("visual-host");e&&e.requestFullscreen&&e.requestFullscreen().catch(()=>{})},variant:"outline",children:"Fullscreen"})]})]}),(0,f.jsxs)(u.z,{mb:4,spacing:4,children:[(0,f.jsxs)(c.l,{value:C,onChange:e=>E(e.target.value),maxW:"200px",children:[(0,f.jsx)("option",{value:"dark",children:"Tmav\xe9 pozad\xed"}),(0,f.jsx)("option",{value:"light",children:"Sv\u011btl\xe9 pozad\xed"})]}),(0,f.jsxs)(c.l,{value:ee,onChange:e=>te(e.target.value),maxW:"200px",children:[(0,f.jsx)("option",{value:"slow",children:"Rychlost: Pomal\xe1"}),(0,f.jsx)("option",{value:"normal",children:"Rychlost: Norm\xe1ln\xed"}),(0,f.jsx)("option",{value:"fast",children:"Rychlost: Rychl\xe1"})]}),(0,f.jsxs)(c.l,{value:String(ne),onChange:e=>ae(Number(e.target.value)||3),maxW:"200px",children:[(0,f.jsx)("option",{value:"1",children:"Drama: 1"}),(0,f.jsx)("option",{value:"2",children:"Drama: 2"}),(0,f.jsx)("option",{value:"3",children:"Drama: 3"}),(0,f.jsx)("option",{value:"4",children:"Drama: 4"}),(0,f.jsx)("option",{value:"5",children:"Drama: 5"})]}),(0,f.jsxs)(u.z,{children:[(0,f.jsx)(r.$,{size:"sm",variant:T?"solid":"outline",onClick:()=>D(e=>!e),children:T?"Konfety: Zap":"Konfety: Vyp"}),(0,f.jsx)(r.$,{size:"sm",variant:N?"solid":"outline",onClick:()=>R(e=>!e),children:N?"Zvuk: Zap":"Zvuk: Vyp"}),(0,f.jsx)(r.$,{size:"sm",variant:Y?"solid":"outline",onClick:()=>Q(e=>!e),children:Y?"V\xe1\u017eit \xfa\u010dast\xed: Zap":"V\xe1\u017eit \xfa\u010dast\xed: Vyp"})]}),(0,f.jsx)(r.$,{colorScheme:"blue",onClick:pe,isDisabled:I||F>=se.length,children:F>=se.length?"V\u0161ichni v\xfdherci odhaleni":I?"Prob\xedh\xe1\u2026":"Start"}),(0,f.jsx)(r.$,{variant:"outline",onClick:()=>ge(!0),isDisabled:I||F>=se.length,children:"Odhalit v\u0161echny"}),(0,f.jsx)(r.$,{variant:"outline",onClick:()=>{const e=se.map(e=>{const t=re.find(t=>t.user_id===e.user_id);return[e.user_id,((null===t||void 0===t?void 0:t.display_name)||"").replaceAll('"','""'),(e.prize_name||"").replaceAll('"','""')]}),n=["user_id,name,prize"].concat(e.map(e=>"".concat(e[0],',"').concat(e[1],'","').concat(e[2],'"'))).join("\n"),a=new Blob([n],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(a),o=document.createElement("a");o.href=i,o.download="soutez_".concat(t,"_vitezove.csv"),o.click(),URL.revokeObjectURL(i)},children:"Export CSV"}),(0,f.jsxs)(x.E,{color:"gray.500",children:["V\xfdherci: ",F,"/",se.length]})]}),(0,f.jsx)(o.a,{id:"visual-host",borderWidth:"1px",borderRadius:"md",p:4,minH:"400px",position:"relative",overflow:"hidden",bg:"dark"===C?"black":"white",color:"dark"===C?"white":"black",children:(0,f.jsx)(s.o,{h:"380px",flexDir:"column",children:(0,f.jsxs)(o.a,{position:"relative",w:"100%",maxW:"960px",h:"220px",children:[(0,f.jsx)(o.a,{position:"absolute",left:"50%",top:"10px",transform:"translateX(-50%)",zIndex:3,borderLeft:"10px solid transparent",borderRight:"10px solid transparent",borderBottom:"16px solid ".concat("dark"===C?"#e2e8f0":"#1a202c")}),(0,f.jsx)(o.a,{pointerEvents:"none",position:"absolute",left:"50%",top:42,bottom:22,width:"2px",transform:"translateX(-1px)",zIndex:2,style:{background:"dark"===C?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.2)"}}),(0,f.jsxs)(o.a,{position:"absolute",left:0,right:0,top:40,bottom:20,overflow:"hidden",borderRadius:"md",borderWidth:"1px",bg:"dark"===C?"#0b0b0b":"#f9fafb",children:[(0,f.jsx)("div",{ref:Z,style:{display:"flex",alignItems:"center",gap:8,padding:"8px",transform:"translateX(-".concat($,"px)"),transition:I?"transform ".concat(ie/1e3,"s cubic-bezier(.2,.8,.2,1)"):void 0},children:V.map((e,t)=>(0,f.jsx)("div",{style:{width:72,height:72,borderRadius:12,background:"dark"===C?"#111":"#fff",boxShadow:"dark"===C?"0 1px 2px rgba(255,255,255,0.08)":"0 1px 2px rgba(0,0,0,0.08)",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",border:"1px solid rgba(0,0,0,0.08)"},children:null!==e&&void 0!==e&&e.avatar_url?(0,f.jsx)("img",{src:e.avatar_url,style:{width:"100%",height:"100%",objectFit:"cover"}}):(0,f.jsx)("span",{style:{fontSize:24,fontWeight:800},children:((null===e||void 0===e?void 0:e.display_name)||"?").slice(0,1)})},t))}),(0,f.jsx)(o.a,{pointerEvents:"none",position:"absolute",left:0,top:0,bottom:0,width:"120px",zIndex:1,style:{background:"dark"===C?"linear-gradient(to right, rgba(0,0,0,0.85), rgba(0,0,0,0))":"linear-gradient(to right, rgba(255,255,255,0.95), rgba(255,255,255,0))"}}),(0,f.jsx)(o.a,{pointerEvents:"none",position:"absolute",right:0,top:0,bottom:0,width:"120px",zIndex:1,style:{background:"dark"===C?"linear-gradient(to left, rgba(0,0,0,0.85), rgba(0,0,0,0))":"linear-gradient(to left, rgba(255,255,255,0.95), rgba(255,255,255,0))"}})]},G),(0,f.jsx)(x.E,{mt:4,opacity:.8,textAlign:"center",children:"Ruleta"})]})})}),(0,f.jsxs)(h.T,{align:"stretch",mt:6,spacing:2,children:[(0,f.jsx)(p.D,{size:"md",children:"Odhalen\xed"}),0===ve.length&&(0,f.jsx)(x.E,{color:"gray.500",children:"Zat\xedm \u017e\xe1dn\xfd v\xfdherce"}),ve.map((e,i)=>{const o=re.find(t=>t.user_id===e.user_id),[r,s]=[e.claim_status||"pending",void 0];return(0,f.jsxs)(u.z,{spacing:8,borderWidth:"1px",borderRadius:"md",p:3,align:"center",children:[(0,f.jsxs)(u.z,{spacing:3,flex:1,children:[(null===o||void 0===o?void 0:o.avatar_url)&&(0,f.jsx)("img",{src:o.avatar_url,alt:"avatar",style:{width:36,height:36,borderRadius:"50%"}}),(0,f.jsx)(x.E,{fontWeight:"700",children:(null===o||void 0===o?void 0:o.display_name)||"U\u017eivatel #".concat(e.user_id)}),e.prize_name&&(0,f.jsxs)(x.E,{color:"gray.500",children:["\u2014 ",e.prize_name]})]}),(0,f.jsx)(u.z,{children:(0,f.jsxs)(c.l,{size:"sm",value:e.claim_status||"pending",onChange:async o=>{const r=o.target.value;try{e.id&&await(0,b._n)(Number(t),e.id,{claim_status:r}),_(e=>e?(0,a.A)((0,a.A)({},e),{},{winners:e.winners.map((e,t)=>t===i?(0,a.A)((0,a.A)({},e),{},{claim_status:r}):e)}):e)}catch(s){n({status:"error",title:"Nelze ulo\u017eit stav"})}},maxW:"160px",children:[(0,f.jsx)("option",{value:"pending",children:"\u010dek\xe1"}),(0,f.jsx)("option",{value:"claimed",children:"vyzvednuto"}),(0,f.jsx)("option",{value:"delivered",children:"p\u0159ed\xe1no"})]})})]},"".concat(e.user_id,"-").concat(i))})]})]}),(0,f.jsx)("style",{children:"\n @keyframes fall { \n 0% { transform: translate(-50%,-50%) rotate(0deg); top: 0%; opacity: 1 }\n 100% { transform: translate(-50%, 520px) rotate(360deg); top: 100%; opacity: 0.2 }\n }\n "})]})}},92955:(e,t,n)=>{n.r(t),n.d(t,{default:()=>fe});var a=n(89379),i=n(32077),o=n(87139),r=n(22107),s=n(49027),l=n(26806),c=n(32332),d=n(98662),u=n(42703),h=n(44093),m=n(98939),p=n(5371),x=n(73212),g=n(33572),v=n(7189),j=n(67516),b=n(35929),y=n(11054),f=n(78460),k=n(85421),_=n(76659),w=n(96148),z=n(29904),S=n(10202),A=n(48239),C=n(30502),E=n(28846),T=n(39081),D=n(72526),N=n(73216),R=n(35475),F=n(34636),P=n(87904),I=n(40378),M=n(87977),L=n(49367),W=n(81398),U=n(25093),O=n(9463),q=n(38326),K=n(75088),B=n(72313),Z=n(70764),V=n(35087),H=n(64830),$=n(69477),J=n(65043),G=n(74117),X=n(82047),Y=n(25189),Q=n(46291),ee=n(56644),te=n(73523),ne=n(30458),ae=n(60790),ie=n(6484),oe=n(97717),re=n(57550),se=n(12255),le=n(99863),ce=n(54156),de=n(70082),ue=n(38376),he=n(61269),me=n(66981),pe=n(92885),xe=n(69023),ge=n(65757),ve=n(74912),je=n(1620),be=n(6175),ye=n(70579);const fe=()=>{var e,t,n,fe,ke,_e,we,ze,Se,Ae,Ce,Ee,Te,De,Ne;const{t:Re}=(0,G.Bd)(),{id:Fe,slug:Pe}=(0,N.g)(),Ie=(0,N.Zp)(),{data:Me,isLoading:Le,isError:We}=(0,D.I)({queryKey:["article",Pe?"slug:".concat(Pe):"id:".concat(Fe)],queryFn:()=>Pe?(0,F.l6)(Pe):(0,F.vO)(Fe),enabled:Boolean(Pe||Fe)}),Ue=(0,D.I)({queryKey:["competition-aliases-public"],queryFn:async()=>{try{return{list:await(0,de.xN)()}}catch(e){return{list:[]}}},staleTime:3e5}),Oe=e=>String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),qe=J.useCallback(e=>{var t;const n=String(e||""),a=Oe(n),i=(null===(t=Ue.data)||void 0===t?void 0:t.list)||[];for(const o of i){const e=Oe(o.alias),t=Oe(o.original_name||"");if(t&&(a.includes(t)||t.includes(a)))return o.alias;if(e&&(a.includes(e)||e.includes(a)))return o.alias}return n},[null===(e=Ue.data)||void 0===e?void 0:e.list]),Ke=J.useMemo(()=>{var e;const t=null===Me||void 0===Me?void 0:Me.competition_alias;if(t)return t;const n=null===Me||void 0===Me||null===(e=Me.category)||void 0===e?void 0:e.name;return n?qe(n):void 0},[null===Me||void 0===Me?void 0:Me.competition_alias,null===Me||void 0===Me||null===(t=Me.category)||void 0===t?void 0:t.name,qe]),{data:Be}=(0,re.s)(),Ze=(0,h.dU)("white","gray.900"),Ve=(0,h.dU)("gray.50","gray.800"),He=(0,h.dU)("gray.600","gray.400"),$e=(0,h.dU)("gray.700","gray.300"),Je=(0,h.dU)("gray.50","gray.800"),Ge=(0,h.dU)("gray.200","gray.700"),Xe=(0,h.dU)("gray.50","gray.800"),Ye=(0,h.dU)("blue.50","blue.900"),Qe=(0,h.dU)("gray.50","gray.700"),et=(0,h.dU)("white","gray.900"),[tt,nt]=J.useState(!1),[at,it]=J.useState([]),[ot,rt]=J.useState(0),st=(0,C.d)(),[lt,ct]=J.useState(0),[dt,ut]=J.useState(null),[ht,mt]=J.useState(!1),[pt,xt]=J.useState(null),[gt,vt]=J.useState(!1);J.useEffect(()=>{Me&&Me.id&&((0,F.PI)(Me.id),(0,X.PI)(Me.id,Me.title))},[Me]),J.useEffect(()=>{if(Fe)try{const e=null===Me||void 0===Me?void 0:Me.slug;if(e&&"string"===typeof e){const t="/news/".concat(e),n="undefined"!==typeof window?window.location.pathname+(window.location.search||""):"";n&&!n.startsWith(t)&&Ie(t,{replace:!0})}}catch(e){}},[Fe,null===Me||void 0===Me?void 0:Me.slug,Ie]),J.useEffect(()=>{const e=null===Me||void 0===Me?void 0:Me.id;if(!e)return;let t;const n="fc_ar_read_".concat(e);return(()=>{try{return"1"===localStorage.getItem(n)}catch(e){return!1}})()||(t=setTimeout(async()=>{try{await(0,P.Pd)(Number(e));try{localStorage.setItem(n,"1")}catch(t){}}catch(a){}},15e3)),()=>{t&&clearTimeout(t)}},[null===Me||void 0===Me?void 0:Me.id]);const jt=J.useRef(null),bt=J.useCallback(e=>{if(!e)return"";try{const t=new URL(Q.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin;return e.replace(/src=("|')\s*(\/uploads\/[^"']+)("')/g,(e,n,a,i)=>"src=".concat(n).concat(t).concat(a).concat(i)).replace(/href=("|')\s*(\/uploads\/[^"']+)("')/g,(e,n,a,i)=>"href=".concat(n).concat(t).concat(a).concat(i)).replace(/src=("|')\s*https?:\/\/(?:localhost|127\.0\.0\.1)(?::\d+)?(\/uploads\/[^"']+)("')/g,(e,n,a,i)=>"src=".concat(n).concat(t).concat(a).concat(i)).replace(/href=("|')\s*https?:\/\/(?:localhost|127\.0\.0\.1)(?::\d+)?(\/uploads\/[^"']+)("')/g,(e,n,a,i)=>"href=".concat(n).concat(t).concat(a).concat(i))}catch(t){return e}},[]),yt=J.useMemo(()=>{const e=bt(null===Me||void 0===Me?void 0:Me.content);return M.A.sanitize(e||"",{USE_PROFILES:{html:!0},ADD_TAGS:["iframe"],ADD_ATTR:["class","target","rel","allow","allowfullscreen","style","data-filters","data-img-id","data-bullets","data-list"]})},[null===Me||void 0===Me?void 0:Me.content,bt]),ft=(0,D.I)({queryKey:["article-gallery-album",(null===Me||void 0===Me?void 0:Me.gallery_album_id)||(null===Me||void 0===Me?void 0:Me.gallery_album_url)],enabled:Boolean((null===Me||void 0===Me?void 0:Me.gallery_album_id)||(null===Me||void 0===Me?void 0:Me.gallery_album_url)),queryFn:async()=>{const e=null===Me||void 0===Me?void 0:Me.gallery_album_id;let t=[];const n=null===Me||void 0===Me?void 0:Me.gallery_photo_ids;if(Array.isArray(n))t=n;else if("string"===typeof n)try{const e=JSON.parse(n);t=Array.isArray(e)?e.map(String):n.split(",").map(e=>e.trim()).filter(Boolean)}catch(c){t=n.split(",").map(e=>e.trim()).filter(Boolean)}let i="";try{const e="http://127.0.0.1:8080".trim();e&&(i=new URL(e,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin)}catch(d){}if(!i)try{i=new URL(Q.API_URL,"undefined"!==typeof window?window.location.origin:"http://localhost:3000").origin}catch(u){}const[o,r]=await Promise.allSettled([fetch("".concat(i,"/cache/prefetch/zonerama_profile.json"),{cache:"no-cache"}),fetch("".concat(i,"/cache/prefetch/zonerama_albums.json"),{cache:"no-cache"})]);if("fulfilled"===o.status&&o.value.ok){const t=((await o.value.json()).albums||[]).find(t=>t.id===e);if(t){const e=t.photos;return(0,a.A)((0,a.A)({},t),{},{photos:e})}}if("fulfilled"===r.status&&r.value.ok){const t=await r.value.json(),n=(Array.isArray(t)?t:[]).find(t=>t.id===e);if(n){const e=n.photos;return(0,a.A)((0,a.A)({},n),{},{photos:e})}}const s=null===Me||void 0===Me?void 0:Me.gallery_album_url;if(s){const e=new URLSearchParams({link:s,photo_limit:"12",rendered:"true"}),t=await fetch("".concat(Q.API_URL,"/zonerama-album?").concat(e.toString()));if(t.ok){const e=await t.json();let n=[];var l;if(Array.isArray(null===e||void 0===e?void 0:e.albums)&&e.albums.length>0)n=(null===(l=e.albums[0])||void 0===l?void 0:l.photos)||[];else Array.isArray(null===e||void 0===e?void 0:e.photos)&&(n=e.photos);return{id:s,title:"Album",date:"",photos:n}}}return null},staleTime:6e4}),kt=J.useMemo(()=>{try{const e=document.createElement("div");e.innerHTML=yt||"";const t=Array.from(e.querySelectorAll("img")).map(e=>e.getAttribute("src")||"").filter(Boolean),n=new Set,a=[];for(const i of t)n.has(i)||(n.add(i),a.push(i));return a}catch(e){return[]}},[yt]),_t=J.useMemo(()=>{var e,t;const n=Array.isArray(null===(e=ft.data)||void 0===e?void 0:e.photos)?null===(t=ft.data)||void 0===t?void 0:t.photos:[],a=null===Me||void 0===Me?void 0:Me.gallery_photo_ids;let i=[];if(Array.isArray(a))i=a.map(String);else if("string"===typeof a&&""!==a.trim())try{const e=JSON.parse(a);i=Array.isArray(e)?e.map(String):a.split(",").map(e=>e.trim()).filter(Boolean)}catch(s){i=a.split(",").map(e=>e.trim()).filter(Boolean)}const o=n.filter(e=>i.includes(String(e.id))),r=n.filter(e=>!i.includes(String(e.id)));return{selected:o,extra:[...r].sort(()=>Math.random()-.5).slice(0,Math.min(5,r.length))}},[null===(n=ft.data)||void 0===n?void 0:n.photos,null===Me||void 0===Me?void 0:Me.gallery_photo_ids,lt]),wt=J.useMemo(()=>{const e=null!==Me&&void 0!==Me&&Me.image_url?(0,Y.uq)(Me.image_url)||Me.image_url:null,t=[..._t.selected.map(e=>String(e.image_1500||"")),..._t.extra.map(e=>String(e.image_1500||""))].filter(Boolean),n=[...e?[e]:[],...kt,...t],a=new Set,i=[];for(const o of n)o&&!a.has(o)&&(a.add(o),i.push(o));return i},[null===Me||void 0===Me?void 0:Me.image_url,kt,_t.selected,_t.extra]),zt=J.useCallback(e=>{const t=wt.findIndex(t=>t===e),n=t>=0?t:0;it(wt),rt(n),nt(!0),ct(e=>e+1)},[wt]),St=J.useCallback(()=>{rt(e=>(e-1+at.length)%at.length)},[at.length]),At=J.useCallback(()=>{rt(e=>(e+1)%at.length)},[at.length]);J.useEffect(()=>{const e=jt.current;if(!e)return;const t=e=>{const t=e.target;if(!t)return;const n=t.closest?t.closest("img"):null;if(n&&n.getAttribute("src")){e.preventDefault();const t=n.getAttribute("src");return void zt(t)}const a=t.closest?t.closest("a"):null;if(a&&a.href)try{const e=a.getAttribute("href")||a.href;(0,X.sx)("Link Click",{href:e,page:window.location.pathname,context:"article_content"})}catch(i){}};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}},[jt.current,zt]),J.useEffect(()=>{if(!tt)return;const e=e=>{"Escape"===e.key?nt(!1):"ArrowLeft"===e.key?St():"ArrowRight"===e.key&&At()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[tt,St,At]);const Ct=(0,D.I)({queryKey:["article-match-link",null===Me||void 0===Me?void 0:Me.id],queryFn:()=>(0,F.Om)(null===Me||void 0===Me?void 0:Me.id),enabled:Boolean(null===Me||void 0===Me?void 0:Me.id),staleTime:6e4}),Et=(0,D.I)({queryKey:["facr-cached-match",null===(fe=Ct.data)||void 0===fe?void 0:fe.external_match_id],enabled:Boolean(null===(ke=Ct.data)||void 0===ke?void 0:ke.external_match_id),queryFn:async()=>{const e=new URL(Q.API_URL,window.location.origin).origin,t="".concat(e,"/cache/prefetch/facr_club_info.json"),n=await fetch(t,{cache:"no-cache"});if(!n.ok)return null;const i=await n.json(),o=Array.isArray(null===i||void 0===i?void 0:i.competitions)?i.competitions:[];for(const s of o){const e=Array.isArray(s.matches)?s.matches:[];for(const t of e){var r;if(String(t.match_id||t.id)===String(null===(r=Ct.data)||void 0===r?void 0:r.external_match_id))return(0,a.A)((0,a.A)({},t),{},{competitionName:s.name})}}return null},staleTime:6e4});J.useEffect(()=>{let e=!1;return(async()=>{try{const t=null===Et||void 0===Et?void 0:Et.data;if(!t)return void(e||ut(null));const n=String((null===t||void 0===t?void 0:t.away_team_id)||(null===t||void 0===t?void 0:t.away_id)||"")||void 0,a=String((null===t||void 0===t?void 0:t.away)||(null===t||void 0===t?void 0:t.away_team)||"")||void 0,i=null===t||void 0===t?void 0:t.away_logo_url,o=await(0,ae.Nw)(n,a,i),r=await(0,ne.x_)(o),s=Array.isArray(r)&&r.length?r.slice(0,2):[];e||ut(s)}catch(t){e||ut(null)}})(),()=>{e=!0}},[null===Et||void 0===Et?void 0:Et.data]),J.useEffect(()=>{var e;const t=null===(e=Ct.data)||void 0===e?void 0:e.external_match_id;t&&(0,X.g7)(t)},[null===(_e=Ct.data)||void 0===_e?void 0:_e.external_match_id]);const Tt=J.useMemo(()=>{const e=null===Et||void 0===Et?void 0:Et.data;if(e){var t;let n="";return null!==e&&void 0!==e&&e.score&&"vs"!==e.score?n=String(e.score):null!=(null===e||void 0===e?void 0:e.result_home)&&null!=(null===e||void 0===e?void 0:e.result_away)&&(n="".concat(e.result_home,":").concat(e.result_away)),{external_match_id:String((null===(t=Ct.data)||void 0===t?void 0:t.external_match_id)||""),competition:String(e.competitionName||""),date_time:String(e.date_time||e.date||""),venue:e.venue?String(e.venue):void 0,home:String(e.home||e.home_team||""),away:String(e.away||e.away_team||""),score:n}}const n=null===Me||void 0===Me?void 0:Me.match_snapshot;return n?{external_match_id:n.external_match_id,competition:n.competition||n.competitionName,date_time:n.date_time||n.date,venue:n.venue,home:n.home,away:n.away,score:n.score}:null},[null===Et||void 0===Et?void 0:Et.data,null===(we=Ct.data)||void 0===we?void 0:we.external_match_id,null===Me||void 0===Me?void 0:Me.match_snapshot]);J.useEffect(()=>{const e=null===Me||void 0===Me?void 0:Me.gallery_album_id;var t,n;e&&ft.data&&(0,X.sx)("Gallery Section Shown",{album_id:e,photos:(null===(t=ft.data)||void 0===t||null===(n=t.photos)||void 0===n?void 0:n.length)||0})},[null===Me||void 0===Me?void 0:Me.gallery_album_id,ft.data]);const Dt=(0,D.I)({queryKey:["banners",{placement:"article_inline"}],queryFn:()=>(0,ie.Oh)({active:!0,placement:"article_inline"}),staleTime:6e4}).data||[],Nt=(0,D.I)({queryKey:["banners",{placement:"article_sidebar"}],queryFn:()=>(0,ie.Oh)({active:!0,placement:"article_sidebar"}),staleTime:6e4}).data||[],Rt=(0,D.I)({queryKey:["related-articles",(null===Me||void 0===Me||null===(ze=Me.category)||void 0===ze?void 0:ze.id)||"none",null===Me||void 0===Me?void 0:Me.id],enabled:Boolean(null===Me||void 0===Me?void 0:Me.id),queryFn:()=>{var e;return(0,F.GE)((0,a.A)({page:1,page_size:6,published:!0},null!==Me&&void 0!==Me&&null!==(e=Me.category)&&void 0!==e&&e.id?{category_id:Me.category.id}:{}))},staleTime:6e4}),Ft=(0,D.I)({queryKey:["upcoming-events-sidebar"],queryFn:ue.y6,staleTime:6e4}),Pt=(0,D.I)({queryKey:["latest-articles"],queryFn:()=>(0,F.GE)({page:1,page_size:6,published:!0}),enabled:Boolean((We||!Me)&&(Pe||Fe)),staleTime:6e4}),It=(0,D.I)({queryKey:["facr-all-matches-mini"],queryFn:async()=>{const e=new URL(Q.API_URL,window.location.origin).origin,t="".concat(e,"/cache/prefetch/facr_club_info.json"),n=await fetch(t,{cache:"no-cache"});if(!n.ok)return[];const i=await n.json(),o=Array.isArray(null===i||void 0===i?void 0:i.competitions)?i.competitions:[],r=[];for(const s of o){const e=Array.isArray(s.matches)?s.matches:[];for(const t of e)r.push((0,a.A)((0,a.A)({},t),{},{competitionName:s.name}))}return r},staleTime:6e4}),Mt=J.useMemo(()=>{try{const e=Array.isArray(It.data)?It.data:[],t=Date.now(),n=Ke?Oe(Ke):"",a=e.filter(e=>{const a=String(e.competitionName||""),i=qe(a),o=Oe(a),r=Oe(i),s=String(e.date_time||"").split(" "),[l,c]=[s[0]||"",s[1]||""],[d,u,h]=(l||"").split("."),m=d&&u&&h?"".concat(h,"-").concat(String(u).padStart(2,"0"),"-").concat(String(d).padStart(2,"0"),"T").concat(c||"00:00",":00"):"";return!!((m?new Date(m).getTime():0)>t)&&(!n||(!(!r||r!==n)||(o===n||(r&&r.includes(n)||o.includes(n)))))});return a}catch(e){return[]}},[It.data,Ke,qe]),[Lt,Wt]=J.useState((0,ve.w)(new Date)),Ut=J.useMemo(()=>{const e=(0,je.k)((0,ve.w)(Lt),{weekStartsOn:1}),t=[];for(let n=0;n<42;n++)t.push((0,me.f)(e,n));return t},[Lt]),[Ot,qt]=J.useState(null),Kt=J.useMemo(()=>{const e=new Map;return(!Ke||0===(Mt||[]).length?Array.isArray(It.data)?It.data:[]:Mt||[]).forEach(t=>{const n=(e=>{try{const[t,n="00:00"]=String(e||"").split(" "),[a,i,o]=String(t||"").split(".");if(a&&i&&o)return"".concat(o,"-").concat(String(i).padStart(2,"0"),"-").concat(String(a).padStart(2,"0"))}catch(t){}return""})(String(t.date_time||""));if(!n)return;const a=e.get(n)||[];a.push(t),e.set(n,a)}),Array.from(e.keys()).forEach(t=>{const n=e.get(t)||[];n.sort((e,t)=>{const n=String(e.date_time||"").split(" ")[1]||"00:00",a=String(t.date_time||"").split(" ")[1]||"00:00";return n.localeCompare(a)}),e.set(t,n)}),e},[It.data,Mt,Ke]);if(Le)return(0,ye.jsx)(_.y,{});if(We||!Me)return(0,ye.jsxs)(I.A,{children:[(0,ye.jsxs)(L.mg,{children:[(0,ye.jsx)("title",{children:"\u010cl\xe1nek nenalezen"}),(0,ye.jsx)("meta",{name:"robots",content:"noindex"})]}),(0,ye.jsxs)(m.m,{maxW:"4xl",py:{base:12,md:16},children:[(0,ye.jsxs)(z.B,{spacing:6,align:"center",textAlign:"center",children:[(0,ye.jsx)(r.a,{color:"blue.500",children:(0,ye.jsx)($.A,{size:64})}),(0,ye.jsx)(E.D,{size:"xl",children:"\u010cl\xe1nek nenalezen"}),(0,ye.jsx)(T.E,{color:He,maxW:"2xl",children:"Je n\xe1m l\xedto, ale hledan\xfd \u010dl\xe1nek neexistuje, byl smaz\xe1n nebo byl p\u0159esunut."}),(0,ye.jsxs)(w.z,{spacing:3,children:[(0,ye.jsx)(d.$,{as:R.N_,to:"/news",colorScheme:"blue",children:"Zp\u011bt na novinky"}),(0,ye.jsx)(d.$,{as:R.N_,to:"/",variant:"ghost",children:"Dom\u016f"})]})]}),Array.isArray(null===(Se=Pt.data)||void 0===Se?void 0:Se.data)&&((null===(Ae=Pt.data)||void 0===Ae||null===(Ce=Ae.data)||void 0===Ce?void 0:Ce.length)||0)>0&&(0,ye.jsxs)(r.a,{mt:12,children:[(0,ye.jsx)(E.D,{as:"h2",size:"md",mb:4,children:"Nejnov\u011bj\u0161\xed \u010dl\xe1nky"}),(0,ye.jsx)(x.r,{columns:{base:1,sm:2,md:3},spacing:4,children:(Pt.data.data||[]).slice(0,6).map(e=>{const t=e.slug?"/news/".concat(e.slug):"/articles/".concat(e.id);return(0,ye.jsxs)(r.a,{as:R.N_,to:t,borderWidth:"1px",borderRadius:"lg",p:3,bg:Ze,_hover:{textDecoration:"none",boxShadow:"md"},children:[(0,ye.jsx)(g._,{src:(0,Y.uq)(e.image_url)||"/stadium-placeholder.jpg",alt:e.title,w:"100%",h:"140px",objectFit:"cover",borderRadius:"md",mb:2}),(0,ye.jsx)(T.E,{fontWeight:"600",noOfLines:2,children:e.title}),e.published_at&&(0,ye.jsx)(T.E,{fontSize:"sm",color:He,children:new Date(e.published_at).toLocaleDateString("cs-CZ")})]},e.id)})})]})]})]});const Bt=Me.seo_title||Me.title,Zt=Me.seo_description||(e=>{if(!e)return"";const t=document.createElement("div");return t.innerHTML=e,(t.textContent||t.innerText||"").replace(/\s+/g," ").trim()})(Me.content).slice(0,160),Vt=Me.og_image_url||Me.image_url||"/logo512.png",Ht=(0,Y.uq)(Vt)||Vt,$t="undefined"!==typeof window?window.location.href:void 0,Jt=Me.published_at||Me.created_at,Gt=(()=>{if(!Jt)return"";try{const e=new Date(Jt);return"".concat(e.getFullYear(),"-").concat(String(e.getMonth()+1).padStart(2,"0"))}catch(e){return""}})();return(0,ye.jsxs)(I.A,{children:[(0,ye.jsxs)(r.a,{children:[(0,ye.jsx)(se.A,{article:Me,match:Tt,targetUrl:"undefined"!==typeof window?window.location.href:void 0,placement:"fixed",size:"md",align:"left"}),(0,ye.jsxs)(L.mg,{children:[(0,ye.jsx)("title",{children:Bt}),(0,ye.jsx)("meta",{name:"description",content:Zt}),(0,ye.jsx)("meta",{property:"og:type",content:"article"}),(0,ye.jsx)("meta",{property:"og:title",content:Bt}),(0,ye.jsx)("meta",{property:"og:description",content:Zt}),(0,ye.jsx)("meta",{property:"og:image",content:Ht}),(0,ye.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,ye.jsx)("meta",{name:"twitter:title",content:Bt}),(0,ye.jsx)("meta",{name:"twitter:description",content:Zt}),(0,ye.jsx)("meta",{name:"twitter:image",content:Ht}),$t&&(0,ye.jsx)("link",{rel:"canonical",href:$t}),(0,ye.jsx)("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"NewsArticle",headline:Bt,image:[Ht],datePublished:Me.published_at||Me.created_at,dateModified:Me.updated_at||Me.published_at||Me.created_at,author:Me.author?{"@type":"Person",name:"".concat(Me.author.first_name||""," ").concat(Me.author.last_name||"").trim()||Me.author.email}:void 0,description:Zt,mainEntityOfPage:$t||void 0})}),(0,ye.jsx)("script",{type:"application/ld+json",children:JSON.stringify(((e,t)=>{const n=[{"@type":"ListItem",position:1,name:"Dom\u016f",item:("undefined"!==typeof window?window.location.origin:"")+"/"},{"@type":"ListItem",position:2,name:"Blog",item:("undefined"!==typeof window?window.location.origin:"")+"/blog"}],a=(null===Me||void 0===Me||null===(e=Me.category)||void 0===e?void 0:e.id)||(null===Me||void 0===Me?void 0:Me.category_id),i=(null===Me||void 0===Me||null===(t=Me.category)||void 0===t?void 0:t.name)||(null===Me||void 0===Me?void 0:Me.category_name);return i&&n.push({"@type":"ListItem",position:3,name:String(i),item:("undefined"!==typeof window?window.location.origin:"")+(a?"/blog?category_id=".concat(a):"/blog?category=".concat(encodeURIComponent(String(i))))}),n.push({"@type":"ListItem",position:n.length+1,name:Bt,item:$t||void 0}),{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:n}})())})]}),(0,ye.jsx)(r.a,{bg:"transparent",color:"inherit",py:{base:6,md:8},mb:2,children:(0,ye.jsxs)(m.m,{maxW:"7xl",children:[(0,ye.jsx)(E.D,{as:"h1",size:{base:"xl",md:"2xl"},mb:2,children:Me.title}),(0,ye.jsxs)(w.z,{spacing:2,rowGap:2,wrap:"wrap",fontSize:"sm",color:He,children:[Me.read_time||Me.estimated_read_minutes?(0,ye.jsxs)(w.z,{spacing:1,children:[(0,ye.jsx)(K.A,{size:16}),(0,ye.jsxs)(T.E,{children:[Me.read_time||Me.estimated_read_minutes," min \u010dten\xed"]})]}):null,Jt&&(0,ye.jsx)(A.vw,{as:R.N_,to:"/blog?month=".concat(Gt),size:"sm",variant:"subtle",children:new Date(Jt).toLocaleDateString("cs-CZ")}),(null===Me||void 0===Me||null===(Ee=Me.category)||void 0===Ee?void 0:Ee.id)&&(0,ye.jsx)(A.vw,{as:R.N_,to:"/blog?category_id=".concat(Me.category.id),size:"sm",variant:"subtle",children:Me.category.name||"Kategorie"}),(null===(Te=Ct.data)||void 0===Te?void 0:Te.external_match_id)&&(0,ye.jsx)(A.vw,{as:R.N_,to:"/blog?match_id=".concat(Ct.data.external_match_id),size:"sm",variant:"subtle",children:"Z\xe1pas"}),Me.view_count?(0,ye.jsxs)(w.z,{spacing:1,ml:{base:0,md:2},children:[(0,ye.jsx)(V.A,{size:16}),(0,ye.jsxs)(T.E,{children:[Me.view_count," zobrazen\xed"]})]}):null]}),(0,ye.jsxs)(s.Q,{fontSize:"sm",mt:2,color:He,separator:"/",children:[(0,ye.jsx)(l.J,{children:(0,ye.jsx)(c.w,{as:R.N_,to:"/",children:"Dom\u016f"})}),(0,ye.jsx)(l.J,{children:(0,ye.jsx)(c.w,{as:R.N_,to:"/blog",children:"Blog"})}),((e,t)=>{const n=(null===Me||void 0===Me||null===(e=Me.category)||void 0===e?void 0:e.id)||(null===Me||void 0===Me?void 0:Me.category_id),a=(null===Me||void 0===Me||null===(t=Me.category)||void 0===t?void 0:t.name)||(null===Me||void 0===Me?void 0:Me.category_name);if(!a)return null;const i=n?"/blog?category_id=".concat(n):"/blog?category=".concat(encodeURIComponent(String(a)));return(0,ye.jsx)(l.J,{children:(0,ye.jsx)(c.w,{as:R.N_,to:i,children:String(a)})})})(),(0,ye.jsx)(l.J,{isCurrentPage:!0,children:(0,ye.jsx)(c.w,{children:Me.title})})]})]})}),(0,ye.jsx)(m.m,{maxW:"7xl",children:(0,ye.jsxs)(x.r,{columns:{base:1,lg:12},spacing:6,children:[(0,ye.jsx)(r.a,{gridColumn:{base:"1 / -1",lg:"span 8"},children:(0,ye.jsxs)(z.B,{spacing:6,children:[Me.image_url&&(0,ye.jsx)(r.a,{borderRadius:"xl",overflow:"hidden",cursor:"pointer",onClick:()=>zt((0,Y.uq)(Me.image_url)||Me.image_url),children:(0,ye.jsx)(g._,{src:(0,Y.uq)(Me.image_url)||Me.image_url,alt:Me.title,w:"100%",h:"auto",objectFit:"contain"})}),(null===(De=Ct.data)||void 0===De?void 0:De.external_match_id)&&(0,ye.jsxs)(r.a,{position:"relative",borderWidth:"1px",borderRadius:"lg",p:{base:4,md:5},bg:Ze,overflow:"hidden",cursor:"pointer",onClick:()=>{const e=null===Et||void 0===Et?void 0:Et.data;if(e)return xt((0,a.A)((0,a.A)({},e),{},{competition:e.competitionName})),void mt(!0);Tt&&(xt({date_time:Tt.date_time,venue:Tt.venue,home:Tt.home,away:Tt.away,competition:Tt.competition,score:Tt.score||""}),mt(!0))},children:[(0,ye.jsx)(E.D,{as:"h3",size:"md",mb:3,children:"Z\xe1pas k \u010dl\xe1nku"}),Et.isLoading?(0,ye.jsx)(T.E,{color:He,children:"Na\u010d\xedt\xe1m \xfadaje o z\xe1pasu\u2026"}):Et.data?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsxs)(w.z,{spacing:2,wrap:"wrap",mb:3,children:[Et.data.competitionName&&(0,ye.jsx)(o.E,{colorScheme:"blue",children:String(Et.data.competitionName)}),(0,ye.jsx)(o.E,{children:String(Et.data.date_time||Et.data.date||"")})]}),(0,ye.jsxs)(p.s,{align:"center",justify:"space-between",gap:4,children:[(0,ye.jsxs)(S.T,{flex:1,spacing:2,minW:"0",children:[(0,ye.jsx)(ee.A,{size:"custom",style:{width:64,height:64},teamId:String(Et.data.home_team_id||Et.data.home_id||""),teamName:String(Et.data.home||Et.data.home_team||""),facrLogo:Et.data.home_logo_url}),(0,ye.jsx)(T.E,{fontWeight:"600",noOfLines:2,textAlign:"center",children:String(Et.data.home||Et.data.home_team||"")})]}),(0,ye.jsxs)(S.T,{minW:{base:"100px",md:"140px"},children:[(()=>{const e=String(Et.data.date_time||Et.data.date||"");if(null!=Et.data.result_home&&null!=Et.data.result_away||Boolean(Et.data.score&&"vs"!==Et.data.score)){const e=String(Et.data.score||"".concat(Et.data.result_home,":").concat(Et.data.result_away));return(0,ye.jsx)(E.D,{size:"2xl",children:e})}const t=(e=>{const t=e.match(/^(\d{1,2})\.(\d{1,2})\.(\d{4})(?:\s+(\d{1,2}):(\d{2}))?/);if(t){const e=parseInt(t[1],10),n=parseInt(t[2],10)-1,a=parseInt(t[3],10),i=t[4]?parseInt(t[4],10):0,o=t[5]?parseInt(t[5],10):0;return new Date(a,n,e,i,o)}const n=Date.parse(e);return isNaN(n)?new Date:new Date(n)})(e),n=Date.now(),a=t.getTime()-n,i=Math.max(0,Math.floor(a/864e5)),o=Math.max(0,Math.floor(a%864e5/36e5)),r=Math.max(0,Math.floor(a%36e5/6e4));return(0,ye.jsxs)(T.E,{fontSize:"lg",fontWeight:"700",children:["Za ",i," d ",o," h ",r," min"]})})(),(()=>{const e=String(Et.data.date_time||Et.data.date||""),t=e.match(/^(\d{1,2})\.(\d{1,2})\.(\d{4})(?:\s+(\d{1,2}):(\d{2}))?/);let n;if(t){const e=parseInt(t[1],10),a=parseInt(t[2],10)-1,i=parseInt(t[3],10),o=t[4]?parseInt(t[4],10):0,r=t[5]?parseInt(t[5],10):0;n=new Date(i,a,e,o,r)}else{const t=Date.parse(e);n=isNaN(t)?new Date:new Date(t)}return(0,ye.jsxs)(T.E,{fontSize:"sm",color:He,children:[n.toLocaleDateString("cs-CZ")," ",n.toLocaleTimeString("cs-CZ",{hour:"2-digit",minute:"2-digit"})]})})(),Et.data.venue&&(0,ye.jsx)(T.E,{fontSize:"sm",color:He,children:String(Et.data.venue)})]}),(0,ye.jsxs)(S.T,{flex:1,spacing:2,minW:"0",children:[(0,ye.jsx)(ee.A,{size:"custom",style:{width:64,height:64},teamId:String(Et.data.away_team_id||Et.data.away_id||""),teamName:String(Et.data.away||Et.data.away_team||""),facrLogo:Et.data.away_logo_url}),(0,ye.jsx)(T.E,{fontWeight:"600",noOfLines:2,textAlign:"center",children:String(Et.data.away||Et.data.away_team||"")})]})]}),(Et.data.facr_link||Et.data.report_url)&&(0,ye.jsx)(r.a,{mt:5,pt:2,textAlign:"center",children:(()=>{const e=String(Et.data.facr_link||Et.data.report_url||"").replace("is.fotbal.cz","www.fotbal.cz");return(0,ye.jsx)(d.$,{as:v.N,href:e,isExternal:!0,rightIcon:(0,ye.jsx)(Z.A,{size:16}),size:"sm",variant:"link",colorScheme:"blue",children:"Zobrazit v\xedce informac\xed na fotbal.cz"})})()}),(0,ye.jsxs)(T.E,{mt:2,fontSize:"xs",color:He,position:"absolute",right:3,bottom:2,children:["Data poch\xe1zej\xed z"," ",(0,ye.jsx)(v.N,{href:"https://www.fotbal.cz",isExternal:!0,color:"blue.600",textDecoration:"underline",children:"FA\u010cR"})]})]}):(0,ye.jsxs)(T.E,{color:He,children:["Propojeno s FACR ID: ",null===(Ne=Ct.data)||void 0===Ne?void 0:Ne.external_match_id]})]}),(0,ye.jsx)(r.a,{className:"article-content",bg:(0,h.dU)("white","gray.900"),borderRadius:"lg",p:{base:4,md:6},ref:jt,sx:{"ul, ol":{pl:6,listStylePosition:"outside"},ul:{listStyleType:"disc"},'ul[data-bullets="disc"]':{listStyleType:"disc"},'ul[data-bullets="circle"]':{listStyleType:"circle"},'ul[data-bullets="square"]':{listStyleType:"square"},'ul[data-bullets="none"]':{listStyleType:"none"},ol:{listStyleType:"decimal"},li:{mb:2},a:{color:"blue.600",textDecoration:"underline",_hover:{color:"blue.700"}},blockquote:{borderLeft:"4px solid #3182ce",paddingLeft:"16px",margin:"1em 0",color:(0,h.dU)("#4a5568","#cbd5e0"),fontStyle:"italic",backgroundColor:(0,h.dU)("#f7fafc","#1a202c"),padding:"12px 16px",borderRadius:"4px"},img:{display:"block",maxWidth:"100%",height:"auto",mt:2,border:"none !important",outline:"none !important",boxShadow:"none !important",cursor:"pointer"}},dangerouslySetInnerHTML:{__html:yt}}),Dt.length>0&&(0,ye.jsx)(r.a,{textAlign:"center",mt:{base:4,md:6},children:(0,ye.jsx)("a",{href:Dt[0].click_url||"#",target:Dt[0].click_url?"_blank":void 0,rel:Dt[0].click_url?"noopener noreferrer":void 0,style:{display:"inline-block"},children:(0,ye.jsx)(g._,{src:(0,Y.uq)(Dt[0].image_url)||"/images/sponsors/placeholder.png",alt:Dt[0].name,maxW:"100%",w:Dt[0].width?"".concat(Dt[0].width,"px"):"100%",h:Dt[0].height?"".concat(Dt[0].height,"px"):"auto",borderRadius:"md",loading:"lazy",decoding:"async"})})}),(null===Me||void 0===Me?void 0:Me.youtube_video_id)&&(0,ye.jsx)(r.a,{borderWidth:"1px",borderRadius:"lg",overflow:"hidden",bg:Ve,children:(0,ye.jsxs)(r.a,{role:"group",cursor:"pointer",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),vt(!0),(0,X.sx)("Video Widget Shown",{id:Me.youtube_video_id,title:Me.youtube_video_title}))},onClick:()=>{vt(!0),(0,X.sx)("Video Widget Shown",{id:Me.youtube_video_id,title:Me.youtube_video_title})},children:[(0,ye.jsx)(i.g,{ratio:16/9,children:(0,ye.jsxs)(r.a,{position:"relative",children:[(0,ye.jsx)(g._,{src:Me.youtube_video_thumbnail||"https://i.ytimg.com/vi/".concat(Me.youtube_video_id,"/hqdefault.jpg"),alt:Me.youtube_video_title||"YouTube video",objectFit:"cover"}),(0,ye.jsx)(r.a,{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",bg:"blackAlpha.500",pointerEvents:"none",transition:"background-color 0.2s ease",_groupHover:{bg:"blackAlpha.600"},children:(0,ye.jsxs)(r.a,{bg:"brand.primary",color:"white",borderRadius:"full",px:5,py:3,display:"flex",alignItems:"center",gap:2,transform:"scale(1)",transition:"transform 0.2s ease, box-shadow 0.2s ease",boxShadow:"0 8px 24px rgba(0,0,0,0.3)",_groupHover:{transform:"scale(1.06)",boxShadow:"0 12px 32px rgba(0,0,0,0.35)"},children:[(0,ye.jsx)(H.A,{size:18}),(0,ye.jsx)(T.E,{fontWeight:"bold",children:"P\u0159ehr\xe1t"})]})})]})}),(0,ye.jsxs)(r.a,{p:3,children:[(0,ye.jsx)(T.E,{fontWeight:"700",color:$e,noOfLines:2,children:Me.youtube_video_title||"Video"}),Me.published_at&&(0,ye.jsx)(T.E,{fontSize:"sm",color:He,children:new Date(Me.published_at).toLocaleDateString("cs-CZ")}),Me.youtube_video_url&&(0,ye.jsx)(v.N,{href:Me.youtube_video_url,isExternal:!0,color:"blue.600",onClick:e=>{e.stopPropagation()},children:"Otev\u0159\xedt na YouTube"})]})]})}),((null===Me||void 0===Me?void 0:Me.gallery_album_id)||(null===Me||void 0===Me?void 0:Me.gallery_album_url))&&(0,ye.jsx)(r.a,{borderWidth:"1px",borderRadius:"lg",p:{base:3,md:4},bg:Je,borderColor:Ge,children:(0,ye.jsxs)(r.a,{mb:3,children:[(0,ye.jsx)(E.D,{as:"h3",size:"md",textAlign:"center",children:Re("gallery.page_title")}),((e,t)=>{if(0===(Array.isArray(null===(e=ft.data)||void 0===e?void 0:e.photos)?null===(t=ft.data)||void 0===t?void 0:t.photos:[]).length)return null;const n=_t.selected,a=_t.extra,i=(a.length?a:n).slice(0,5);return 0===i.length?null:(0,ye.jsx)(r.a,{children:i.length<5?(0,ye.jsx)(x.r,{columns:{base:2,sm:3},spacing:2,role:"group",children:i.map(e=>(0,ye.jsx)(g._,{src:e.image_1500,alt:String(e.id),w:"100%",h:"140px",objectFit:"cover",borderRadius:"md",cursor:"pointer",onClick:()=>zt(String(e.image_1500))},"extra-".concat(e.id)))}):(0,ye.jsxs)(r.a,{position:"relative",role:"group",sx:{display:"grid",gridTemplateColumns:"1fr 1.2fr 1fr",gridTemplateRows:"repeat(2, 140px)",gap:"8px"},children:[(0,ye.jsx)(g._,{src:i[0].image_1500,alt:String(i[0].id),sx:{gridColumn:1,gridRow:1},objectFit:"cover",w:"100%",h:"100%",borderRadius:"md",cursor:"pointer",onClick:()=>zt(String(i[0].image_1500))}),(0,ye.jsx)(g._,{src:i[1].image_1500,alt:String(i[1].id),sx:{gridColumn:1,gridRow:2},objectFit:"cover",w:"100%",h:"100%",borderRadius:"md",cursor:"pointer",onClick:()=>zt(String(i[1].image_1500))}),(0,ye.jsx)(g._,{src:i[2].image_1500,alt:String(i[2].id),sx:{gridColumn:2,gridRow:"1 / span 2"},objectFit:"cover",w:"100%",h:"100%",borderRadius:"md",cursor:"pointer",onClick:()=>zt(String(i[2].image_1500))}),(0,ye.jsx)(g._,{src:i[3].image_1500,alt:String(i[3].id),sx:{gridColumn:3,gridRow:1},objectFit:"cover",w:"100%",h:"100%",borderRadius:"md",cursor:"pointer",onClick:()=>zt(String(i[3].image_1500))}),(0,ye.jsx)(g._,{src:i[4].image_1500,alt:String(i[4].id),sx:{gridColumn:3,gridRow:2},objectFit:"cover",w:"100%",h:"100%",borderRadius:"md",cursor:"pointer",onClick:()=>zt(String(i[4].image_1500))}),(0,ye.jsx)(d.$,{as:R.N_,to:Me.gallery_album_id?"/galerie/album/".concat(Me.gallery_album_id):"#",size:"sm",colorScheme:"blue",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",cursor:"pointer",transition:"all 0.2s ease",boxShadow:"sm",_hover:{transform:"translate(-50%, -50%) scale(1.06)",boxShadow:"md"},_active:{transform:"translate(-50%, -50%) scale(0.98)"},_focusVisible:{boxShadow:"0 0 0 3px var(--chakra-colors-blue-300)"},onClick:()=>(0,X.sx)("Gallery Link Click",{album_id:Me.gallery_album_id}),children:"Zobrazit celou galerii"})]})})})()]})})]})}),(0,ye.jsxs)(S.T,{align:"stretch",spacing:6,gridColumn:{base:"1 / -1",lg:"span 4"},children:[Rt.isLoading?null:(e=>{const t=((null===(e=Rt.data)||void 0===e?void 0:e.data)||[]).filter(e=>(null===e||void 0===e?void 0:e.id)!==(null===Me||void 0===Me?void 0:Me.id)).slice(0,4);return t.length?(0,ye.jsx)(le.x,{title:"Podobn\xe9 \u010dl\xe1nky",children:(0,ye.jsx)(S.T,{spacing:3,align:"stretch",children:t.map(e=>{const t=e.slug?"/news/".concat(e.slug):"/articles/".concat(e.id);return(0,ye.jsxs)(w.z,{align:"flex-start",spacing:3,as:R.N_,to:t,_hover:{textDecoration:"none"},children:[(0,ye.jsx)(g._,{src:(0,Y.uq)(e.image_url)||"/stadium-placeholder.jpg",alt:e.title,boxSize:"64px",objectFit:"cover",borderRadius:"md"}),(0,ye.jsxs)(S.T,{align:"start",spacing:1,flex:1,minW:0,children:[(0,ye.jsx)(T.E,{fontWeight:"600",noOfLines:2,children:e.title}),e.published_at&&(0,ye.jsx)(T.E,{fontSize:"sm",color:He,children:new Date(e.published_at).toLocaleDateString("cs-CZ")})]})]},e.id)})})}):null})(),(0,ye.jsx)(ce.C,{categoryName:Ke,hideEmpty:!0,onMatchClick:e=>{xt((0,a.A)((0,a.A)({},e),{},{competition:e.competitionName,competitionName:e.competitionName})),mt(!0)}}),(()=>{if(!(!Ke||0===(Mt||[]).length))return null;const e=(()=>{try{const e=new Date;return"".concat(e.getFullYear(),"-").concat(String(e.getMonth()+1).padStart(2,"0"),"-").concat(String(e.getDate()).padStart(2,"0"))}catch(e){return""}})();return(0,ye.jsx)(le.x,{title:"Kalend\xe1\u0159 z\xe1pas\u016f",children:(0,ye.jsxs)(S.T,{align:"stretch",spacing:2,children:[(0,ye.jsx)(w.z,{justify:"space-between",children:(0,ye.jsxs)(w.z,{spacing:2,children:[(0,ye.jsx)(d.$,{size:"xs",variant:"outline",onClick:()=>Wt((0,pe.P)(Lt,-1)),children:"\u2039"}),(0,ye.jsx)(T.E,{fontWeight:"600",children:(0,xe.GP)(Lt,"LLLL yyyy",{locale:be.cs})}),(0,ye.jsx)(d.$,{size:"xs",variant:"outline",onClick:()=>Wt(new Date),children:"Dnes"}),(0,ye.jsx)(d.$,{size:"xs",variant:"outline",onClick:()=>Wt((0,pe.P)(Lt,1)),children:"\u203a"})]})}),(0,ye.jsxs)(x.r,{columns:7,spacing:1,children:[["Po","\xdat","St","\u010ct","P\xe1","So","Ne"].map(e=>(0,ye.jsx)(r.a,{textAlign:"center",fontSize:"xs",color:He,children:e},e)),Ut.map((t,n)=>{const a=(0,xe.GP)(t,"yyyy-MM-dd"),i=Kt.get(a)||[],s=!(0,ge.t)(t,Lt),l=a===e;return(0,ye.jsx)(r.a,{p:1,borderWidth:"2px",borderColor:Ot===a?"blue.500":l?"blue.400":"gray.200",borderRadius:"md",bg:Ot===a||l?Ye:void 0,cursor:i.length?"pointer":"default",opacity:s?.6:1,onClick:()=>{i.length&&qt(e=>e===a?null:a)},children:(0,ye.jsxs)(w.z,{justify:"space-between",children:[(0,ye.jsx)(T.E,{fontSize:"xs",fontWeight:"600",children:(0,xe.GP)(t,"d",{locale:be.cs})}),!!i.length&&(0,ye.jsx)(o.E,{colorScheme:"blue",borderRadius:"full",fontSize:"9px",children:i.length})]})},n)})]}),Ot&&(Kt.get(Ot)||[]).length>0&&(0,ye.jsx)(S.T,{align:"stretch",spacing:1,children:(Kt.get(Ot)||[]).slice(0,5).map((e,t)=>(0,ye.jsxs)(w.z,{spacing:2,align:"center",onClick:()=>{const t={date_time:e.date_time,venue:e.venue,home:e.home,away:e.away,competition:e.competitionName,score:e.score||"",facr_link:e.facr_link,report_url:e.report_url,home_logo_url:e.home_logo_url,away_logo_url:e.away_logo_url};xt(t),mt(!0)},cursor:"pointer",_hover:{bg:Qe},p:1,borderRadius:"md",children:[(0,ye.jsx)(T.E,{fontSize:"xs",color:He,minW:"42px",children:String(e.date_time||"").split(" ")[1]||"\u2014"}),(0,ye.jsx)(ee.A,{size:"small",teamId:String(e.home_id||""),teamName:String(e.home||""),facrLogo:e.home_logo_url}),(0,ye.jsxs)(T.E,{fontSize:"sm",noOfLines:1,flex:1,minW:0,children:[e.home," vs ",e.away]}),(0,ye.jsx)(ee.A,{size:"small",teamId:String(e.away_id||""),teamName:String(e.away||""),facrLogo:e.away_logo_url})]},"".concat(Ot,"-").concat(t)))})]})})})(),(e=>{const t=Array.isArray(Ft.data)?Ft.data:[],n=null===Me||void 0===Me||null===(e=Me.category)||void 0===e?void 0:e.name,a=n?t.filter(e=>!(null!==e&&void 0!==e&&e.category_name)||String(e.category_name)===String(n)).slice(0,3):t.slice(0,3);return a.length?(0,ye.jsx)(le.x,{title:"Nejbli\u017e\u0161\xed aktivity",children:(0,ye.jsx)(S.T,{spacing:3,align:"stretch",children:a.map(e=>(0,ye.jsx)(w.z,{as:R.N_,to:"/aktivita/".concat(e.id),align:"flex-start",spacing:3,px:3,py:2,borderWidth:"1px",borderRadius:"md",borderColor:Ge,bg:Xe,style:{borderLeftWidth:4,borderLeftColor:"#3182ce"},_hover:{textDecoration:"none",bg:Qe,borderColor:"blue.300",boxShadow:"sm",transform:"translateX(2px)"},children:(0,ye.jsxs)(r.a,{flex:1,minW:0,children:[(0,ye.jsx)(T.E,{fontWeight:"700",noOfLines:2,children:e.title}),(0,ye.jsx)(T.E,{fontSize:"sm",color:He,children:(()=>{try{return new Date(e.start_time).toLocaleDateString("cs-CZ")+(e.location?" \u2022 ".concat(e.location):"")}catch(t){return e.start_time}})()})]})},e.id))})}):null})(),(null===Me||void 0===Me?void 0:Me.id)&&(0,ye.jsx)(U.A,{articleId:Me.id,maxPolls:2,showTitle:!1}),Array.isArray(null===Me||void 0===Me?void 0:Me.attachments)&&Me.attachments.length>0&&(0,ye.jsx)(le.x,{title:"P\u0159\xedlohy",children:(0,ye.jsx)(S.T,{align:"stretch",spacing:2,children:Me.attachments.map((e,t)=>(0,ye.jsx)(oe.A,{url:(0,Y.uq)(e.url)||e.url,name:e.name||"",mimeType:e.mime_type||"",size:e.size},t))})}),Nt.length>0&&(0,ye.jsx)(r.a,{children:(0,ye.jsx)("a",{href:Nt[0].click_url||"#",target:Nt[0].click_url?"_blank":void 0,rel:Nt[0].click_url?"noopener noreferrer":void 0,style:{display:"block"},children:(0,ye.jsx)("img",{src:(0,Y.uq)(Nt[0].image_url)||"/images/sponsors/placeholder.png",alt:Nt[0].name,style:{width:"100%",height:"auto",display:"block",borderRadius:8},loading:"lazy",decoding:"async"})})})]})]})})]}),null!==Me&&void 0!==Me&&Me.id?(0,ye.jsx)(m.m,{maxW:"7xl",mt:6,pb:{base:8,md:12},children:(0,ye.jsx)(he.A,{targetType:"article",targetId:String(Me.id)})}):null,(0,ye.jsx)(W.A,{}),(0,ye.jsx)(te.A,{isOpen:ht,onClose:()=>mt(!1),match:pt}),(0,ye.jsxs)(f.aF,{isOpen:tt,onClose:()=>nt(!1),size:"6xl",isCentered:!0,children:[(0,ye.jsx)(y.m,{bg:"blackAlpha.800"}),(0,ye.jsxs)(k.$,{bg:"transparent",boxShadow:"none",maxW:"90vw",children:[(0,ye.jsx)(b.s,{color:"white",bg:"blackAlpha.600",_hover:{bg:"blackAlpha.700"},borderRadius:"full",zIndex:2}),(0,ye.jsxs)(j.c,{p:0,position:"relative",children:[(0,ye.jsxs)(r.a,{position:"relative",maxH:"85vh",display:"flex",alignItems:"center",justifyContent:"center",children:[at[ot]&&(0,ye.jsx)(g._,{src:at[ot],alt:"Obr\xe1zek ".concat(ot+1,"/").concat(at.length),maxH:"85vh",maxW:"100%",objectFit:"contain"}),at.length>1&&(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(u.K,{"aria-label":"P\u0159edchoz\xed",icon:(0,ye.jsx)(O.A,{}),onClick:St,position:"absolute",left:{base:"4%",md:"5%"},top:"50%",transform:"translateY(-50%)",colorScheme:"blackAlpha",variant:"solid",zIndex:3,_hover:{bg:"blackAlpha.700",transform:"translateY(-50%)"},_active:{bg:"blackAlpha.800",transform:"translateY(-50%)"}}),(0,ye.jsx)(u.K,{"aria-label":"Dal\u0161\xed",icon:(0,ye.jsx)(q.A,{}),onClick:At,position:"absolute",right:{base:"4%",md:"5%"},top:"50%",transform:"translateY(-50%)",colorScheme:"blackAlpha",variant:"solid",zIndex:3,_hover:{bg:"blackAlpha.700",transform:"translateY(-50%)"},_active:{bg:"blackAlpha.800",transform:"translateY(-50%)"}})]}),(0,ye.jsx)(r.a,{position:"absolute",left:0,top:0,bottom:0,w:{base:"6%",md:"8%"},onClick:()=>nt(!1),zIndex:1}),(0,ye.jsx)(r.a,{position:"absolute",right:0,top:0,bottom:0,w:{base:"6%",md:"8%"},onClick:()=>nt(!1),zIndex:1})]}),(0,ye.jsx)(S.T,{align:"stretch",spacing:2,mt:3,px:2,children:(0,ye.jsx)(r.a,{display:"flex",justifyContent:"center",children:(0,ye.jsxs)(w.z,{spacing:2,bg:"blackAlpha.600",px:3,py:2,borderRadius:"full",children:[(0,ye.jsx)(d.$,{size:"sm",leftIcon:(0,ye.jsx)(B.A,{size:16}),onClick:async()=>{try{await navigator.clipboard.writeText(at[ot]||""),st({title:"Zkop\xedrov\xe1no",status:"success",duration:1500})}catch(e){st({title:"Nepoda\u0159ilo se zkop\xedrovat",status:"error",duration:1500})}},children:"Kop\xedrovat odkaz"}),(0,ye.jsx)(d.$,{as:v.N,href:at[ot]||"#",target:"_blank",rel:"noopener noreferrer",size:"sm",leftIcon:(0,ye.jsx)(Z.A,{size:16}),children:"Otev\u0159\xedt origin\xe1l"})]})})})]})]})]}),(0,ye.jsxs)(f.aF,{isOpen:gt,onClose:()=>vt(!1),size:"6xl",isCentered:!0,children:[(0,ye.jsx)(y.m,{bg:"blackAlpha.800"}),(0,ye.jsxs)(k.$,{bg:"black",maxW:"90vw",children:[(0,ye.jsx)(b.s,{color:"white",_hover:{bg:"whiteAlpha.200"}}),(0,ye.jsxs)(j.c,{p:0,children:[(null===Me||void 0===Me?void 0:Me.youtube_video_id)&&(0,ye.jsx)(i.g,{ratio:16/9,children:(0,ye.jsx)(r.a,{as:"iframe",src:"https://www.youtube-nocookie.com/embed/".concat(Me.youtube_video_id,"?autoplay=1"),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,title:Me.youtube_video_title||"YouTube video",onLoad:()=>(0,X.py)(Me.youtube_video_id,Me.youtube_video_title)})}),(null===Me||void 0===Me?void 0:Me.youtube_video_id)&&(0,ye.jsx)(r.a,{bg:et,p:4,children:(0,ye.jsx)(he.A,{targetType:"youtube_video",targetId:Me.youtube_video_id})})]})]})]})]})}},93368:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});var a=n(22107),i=n(98662),o=n(44093),r=n(98939),s=n(82459),l=n(7189),c=n(47781),d=n(10202),u=n(28846),h=n(39081),m=n(40378),p=n(70579);const x=()=>{const e=(0,o.dU)("gray.700","gray.300"),t=(0,o.dU)("gray.900","gray.100"),n=(0,o.dU)("blue.50","blue.900"),x=(0,o.dU)("blue.900","blue.100");return(0,p.jsx)(m.A,{children:(0,p.jsx)(r.m,{maxW:"3xl",py:8,children:(0,p.jsxs)(d.T,{align:"stretch",spacing:6,children:[(0,p.jsx)(u.D,{as:"h1",size:"xl",mb:2,color:t,children:"Pravidla pou\u017e\xedv\xe1n\xed soubor\u016f cookies"}),(0,p.jsxs)(h.E,{fontSize:"sm",color:e,children:["Posledn\xed aktualizace: ",(new Date).toLocaleDateString("cs-CZ")]}),(0,p.jsxs)(a.a,{bg:n,p:4,borderRadius:"md",children:[(0,p.jsx)(h.E,{fontWeight:"bold",mb:2,color:x,children:"Shrnut\xed"}),(0,p.jsx)(h.E,{fontSize:"sm",color:x,children:"Cookies pou\u017e\xedv\xe1me pro zaji\u0161t\u011bn\xed nezbytn\xfdch funkc\xed webu, zlep\u0161en\xed u\u017eivatelsk\xe9ho z\xe1\u017eitku a m\u011b\u0159en\xed n\xe1v\u0161t\u011bvnosti. Nepovinn\xe9 cookies ukl\xe1d\xe1me pouze na z\xe1klad\u011b va\u0161eho souhlasu."})]}),(0,p.jsx)(s.c,{}),(0,p.jsxs)(a.a,{children:[(0,p.jsx)(u.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"1. Co jsou cookies?"}),(0,p.jsx)(h.E,{color:e,mb:4,children:"Cookies jsou mal\xe9 textov\xe9 soubory ukl\xe1dan\xe9 do va\u0161eho za\u0159\xedzen\xed p\u0159i n\xe1v\u0161t\u011bv\u011b webu. Umo\u017e\u0148uj\xed rozpoznat prohl\xed\u017ee\u010d, pamatovat si va\u0161e volby a zajistit fungov\xe1n\xed webu."})]}),(0,p.jsxs)(a.a,{children:[(0,p.jsx)(u.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"2. Jak\xe9 cookies pou\u017e\xedv\xe1me"}),(0,p.jsxs)(c.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsxs)(c.ck,{children:[(0,p.jsx)("strong",{children:"Nezbytn\xe9:"})," zaji\u0161\u0165uj\xed bezpe\u010dnost a z\xe1kladn\xed funkce webu. V\u017edy aktivn\xed."]}),(0,p.jsxs)(c.ck,{children:[(0,p.jsx)("strong",{children:"Preferen\u010dn\xed:"})," pamatuj\xed si va\u0161e volby (nap\u0159. jazyk, zobrazen\xed)."]}),(0,p.jsxs)(c.ck,{children:[(0,p.jsx)("strong",{children:"Analytick\xe9:"})," anonymn\xed m\u011b\u0159en\xed n\xe1v\u0161t\u011bvnosti a v\xfdkonu str\xe1nek."]}),(0,p.jsxs)(c.ck,{children:[(0,p.jsx)("strong",{children:"Marketingov\xe9:"})," p\u0159izp\u016fsoben\xed obsahu a p\u0159\xedpadn\xe9ho marketingu."]})]})]}),(0,p.jsxs)(a.a,{children:[(0,p.jsx)(u.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"3. Pr\xe1vn\xed z\xe1klady a \xfa\u010dely"}),(0,p.jsxs)(c.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsxs)(c.ck,{children:[(0,p.jsx)("strong",{children:"Nezbytn\xe9 cookies:"})," opr\xe1vn\u011bn\xfd z\xe1jem na provozu a zabezpe\u010den\xed webu (GDPR \u010dl. 6 odst. 1 p\xedsm. f)."]}),(0,p.jsxs)(c.ck,{children:[(0,p.jsx)("strong",{children:"Preferen\u010dn\xed, analytick\xe9, marketingov\xe9:"})," pouze na z\xe1klad\u011b va\u0161eho souhlasu (GDPR \u010dl. 6 odst. 1 p\xedsm. a), kter\xfd m\u016f\u017eete kdykoli odvolat."]})]})]}),(0,p.jsxs)(a.a,{children:[(0,p.jsx)(u.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"4. Spr\xe1va souhlasu"}),(0,p.jsx)(h.E,{color:e,mb:3,children:"Nastaven\xed cookies m\u016f\u017eete kdykoli zm\u011bnit pomoc\xed tla\u010d\xedtka n\xed\u017ee nebo v nastaven\xed prohl\xed\u017ee\u010de. Odvol\xe1n\xed souhlasu nem\xe1 vliv na z\xe1konnost p\u0159edchoz\xedho zpracov\xe1n\xed."}),(0,p.jsx)(i.$,{onClick:()=>{window.dispatchEvent(new Event("cookie-consent-open"))},colorScheme:"blue",size:"sm",children:"Otev\u0159\xedt nastaven\xed cookies"})]}),(0,p.jsxs)(a.a,{children:[(0,p.jsx)(u.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"5. Doba uchov\xe1v\xe1n\xed"}),(0,p.jsxs)(c.B8,{spacing:2,mb:4,styleType:"disc",pl:6,color:e,children:[(0,p.jsxs)(c.ck,{children:[(0,p.jsx)("strong",{children:"Nezbytn\xe9 cookies:"})," po dobu nezbytnou pro fungov\xe1n\xed relace \u010di bezpe\u010dnost."]}),(0,p.jsxs)(c.ck,{children:[(0,p.jsx)("strong",{children:"Preferen\u010dn\xed a analytick\xe9:"})," typicky 6\u201326 m\u011bs\xedc\u016f, nebo do odvol\xe1n\xed souhlasu."]}),(0,p.jsxs)(c.ck,{children:[(0,p.jsx)("strong",{children:"Marketingov\xe9:"})," dle konkr\xe9tn\xed kategorie, nejd\xe9le do odvol\xe1n\xed souhlasu."]})]})]}),(0,p.jsxs)(a.a,{children:[(0,p.jsx)(u.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"6. T\u0159et\xed strany"}),(0,p.jsx)(h.E,{color:e,mb:4,children:"Pro analytiku nebo m\u011b\u0159en\xed m\u016f\u017eeme vyu\u017e\xedvat n\xe1stroje t\u0159et\xedch stran. Tyto slu\u017eby zpracov\xe1vaj\xed \xfadaje pouze v rozsahu nezbytn\xe9m pro poskytov\xe1n\xed m\u011b\u0159en\xed a jsou v\xe1z\xe1ny smluvn\xedmi z\xe1vazky ochrany \xfadaj\u016f."})]}),(0,p.jsxs)(a.a,{children:[(0,p.jsx)(u.D,{as:"h2",size:"md",mt:4,mb:3,color:t,children:"7. Dal\u0161\xed informace"}),(0,p.jsxs)(h.E,{color:e,mb:2,children:["Podrobnosti o zpracov\xe1n\xed osobn\xedch \xfadaj\u016f najdete v ",(0,p.jsx)(l.N,{href:"/zasady-ochrany-osobnich-udaju",color:"brand.primary",children:"Z\xe1sad\xe1ch ochrany osobn\xedch \xfadaj\u016f"}),"."]}),(0,p.jsxs)(h.E,{color:e,children:["V p\u0159\xedpad\u011b dotaz\u016f n\xe1s kontaktujte prost\u0159ednictv\xedm str\xe1nky ",(0,p.jsx)(l.N,{href:"/kontakt",color:"brand.primary",children:"Kontakt"}),"."]})]})]})})})}},93777:()=>{},93873:(e,t,n)=>{n.r(t),n.d(t,{default:()=>$});var a=n(89379),i=n(65043),o=n(96870),r=n(22107),s=n(98662),l=n(42703),c=n(44093),d=n(73225),u=n(10804),h=n(76668),m=n(73212),p=n(33572),x=n(35699),g=n(67516),v=n(35929),j=n(56529),b=n(15071),y=n(11054),f=n(78460),k=n(85421),_=n(97569),w=n(61724),z=n(96148),S=n(10202),A=n(98481),C=n(80511),E=n(82595),T=n(67813),D=n(83201),N=n(3313),R=n(55395),F=n(30502),P=n(28846),I=n(1009),M=n(72526),L=n(59781),W=n(12836),U=n(6583),O=n(29661),q=n(34636),K=n(97278),B=n(46367),Z=n(25189),V=n(88500),H=n(70579);const $=()=>{const e=(0,c.dU)("white","gray.800"),t=((0,c.dU)("gray.200","gray.700"),(0,c.dU)("white","gray.700"),(0,F.d)());function n(e){return e?e.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0))):""}const[$,J]=(0,i.useState)([]),[G,X]=(0,i.useState)(""),Y=(0,i.useRef)(null),Q=(0,i.useRef)(null);function ee(e,t){if(!t)return 0;const n=(e||"").toLowerCase(),a=(t||"").toLowerCase();if(n===a)return 1e3;if(n.startsWith(a))return 800-(n.length-a.length);let i=0,o=0,r=0,s=0;for(;i<n.length&&o<a.length;)n[i]===a[o]?(s+=1,r+=10+s,o++):s=0,i++;return o===a.length?r-Math.abs(n.length-a.length):-1/0}const te=(0,i.useMemo)(()=>{const e=G.trim();if(!e)return $;return $.map(t=>({c:t,s:Math.max(ee(t.name,e),ee(t.cca2,e))})).filter(e=>e.s>-1/0).sort((e,t)=>t.s-e.s||e.c.name.localeCompare(t.c.name,"cs",{sensitivity:"base"})).map(e=>e.c)},[$,G]);(0,i.useEffect)(()=>{let e=!0;return(async()=>{try{let a=null;const i=["https://restcountries.com/v3.1/all?fields=name,cca2","https://restcountries.com/v2/all?fields=name,alpha2Code","https://restcountries.com/v3.1/all"];let o=null;for(const e of i)try{const t=await fetch(e);if(!t.ok)throw new Error("countries ".concat(t.status));const n=await t.json();if(Array.isArray(n)){a=n;break}}catch(t){o=t}if(!e)return;if(!a)throw o||new Error("countries fetch failed");const r=(a||[]).map(e=>{var t;const a=(null===e||void 0===e||null===(t=e.name)||void 0===t?void 0:t.common)||(null===e||void 0===e?void 0:e.name)||"",i=(null===e||void 0===e?void 0:e.cca2)||(null===e||void 0===e?void 0:e.alpha2Code)||"";return{name:a,cca2:i,emoji:n(i)}}).filter(e=>e.name&&e.cca2).sort((e,t)=>e.name.localeCompare(t.name,"cs",{sensitivity:"base"}));J(r)}catch(a){const e=[{name:"Czechia",cca2:"CZ",emoji:n("CZ")},{name:"Slovakia",cca2:"SK",emoji:n("SK")},{name:"Poland",cca2:"PL",emoji:n("PL")},{name:"Germany",cca2:"DE",emoji:n("DE")},{name:"Austria",cca2:"AT",emoji:n("AT")},{name:"Ukraine",cca2:"UA",emoji:n("UA")},{name:"France",cca2:"FR",emoji:n("FR")},{name:"Spain",cca2:"ES",emoji:n("ES")},{name:"Italy",cca2:"IT",emoji:n("IT")},{name:"England",cca2:"GB",emoji:n("GB")}];J(e)}})(),()=>{e=!1}},[]),(0,i.useEffect)(()=>{try{const e=localStorage.getItem("playersAdmin.countryQuery");e&&X(e)}catch(e){}},[]),(0,i.useEffect)(()=>{try{localStorage.setItem("playersAdmin.countryQuery",G)}catch(e){}},[G]);const ne=async e=>{const t=await function(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=()=>{const e=new window.Image;e.onload=()=>t(e),e.onerror=n,e.src=a.result},a.onerror=n,a.readAsDataURL(e)})}(e),n=1400;let{width:a,height:i}=t;if(a>n||i>n){const e=Math.min(n/a,n/i);a=Math.round(a*e),i=Math.round(i*e)}const o=document.createElement("canvas");o.width=a,o.height=i;o.getContext("2d").drawImage(t,0,0,a,i);const r=await new Promise(e=>o.toBlob(e,"image/jpeg",.78));if(!r)throw new Error("compression failed");const s=new File([r],e.name.replace(/\.[^/.]+$/,"")+".jpg",{type:"image/jpeg"});return await(0,q.QM)(s)};const ae=(0,L.jE)(),{data:ie,isLoading:oe}=(0,M.I)({queryKey:["admin-players",{active:!1}],queryFn:()=>(0,O.Dq)({active:!1})}),[re,se]=(0,i.useState)(null),{isOpen:le,onOpen:ce,onClose:de}=(0,o.j)(),ue=250,he=400,[me,pe]=(0,i.useState)({day:"",month:"",year:""}),xe=()=>{se(null),de()},ge=(0,W.n)({mutationFn:e=>(0,O.o$)(e),onSuccess:e=>{try{ae.setQueryData(["admin-players",{active:!1}],t=>{const n=Array.isArray(t)?t:(null===t||void 0===t?void 0:t.data)||[],i=[e,...n];return t&&t.data?(0,a.A)((0,a.A)({},t),{},{data:i}):i})}catch(n){}t({title:"Hr\xe1\u010d vytvo\u0159en",status:"success"}),ae.invalidateQueries({queryKey:["admin-players",{active:!1}]}),xe()},onError:e=>{var n,a,i,o,r;const s=null===e||void 0===e||null===(n=e.response)||void 0===n?void 0:n.status,l=(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.chyba)||(null===e||void 0===e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.error)||(null===e||void 0===e?void 0:e.message)||"Chyba";t({title:"Vytvo\u0159en\xed selhalo",description:s?"HTTP ".concat(s,": ").concat(l):l,status:"error"})}}),ve=(0,W.n)({mutationFn:e=>{let{id:t,payload:n}=e;return(0,O.LX)(t,n)},onSuccess:()=>{t({title:"Hr\xe1\u010d upraven",status:"success"}),ae.invalidateQueries({queryKey:["admin-players",{active:!1}]}),xe()},onError:e=>{var n,a,i,o,r;const s=null===e||void 0===e||null===(n=e.response)||void 0===n?void 0:n.status,l=(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.chyba)||(null===e||void 0===e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.error)||(null===e||void 0===e?void 0:e.message)||"Chyba";t({title:"Aktualizace selhala",description:s?"HTTP ".concat(s,": ").concat(l):l,status:"error"})}}),je=(0,W.n)({mutationFn:e=>(0,O.BL)(e),onSuccess:()=>{t({title:"Hr\xe1\u010d smaz\xe1n",status:"success"}),ae.invalidateQueries({queryKey:["admin-players",{active:!1}]})},onError:e=>{var n,a,i,o,r;const s=null===e||void 0===e||null===(n=e.response)||void 0===n?void 0:n.status,l=(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.chyba)||(null===e||void 0===e||null===(o=e.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.error)||(null===e||void 0===e?void 0:e.message)||"Chyba";t({title:"Smaz\xe1n\xed selhalo",description:s?"HTTP ".concat(s,": ").concat(l):l,status:"error"})}});return(0,H.jsxs)(U.A,{requireAdmin:!1,children:[(0,H.jsx)(P.D,{size:"lg",mb:4,children:"Hr\xe1\u010di"}),(0,H.jsx)(z.z,{mb:4,children:(0,H.jsx)(s.$,{leftIcon:(0,H.jsx)(I.GGD,{}),colorScheme:"blue",onClick:()=>{se({first_name:"",last_name:"",is_active:!0,email:"",phone:"",gender:""}),be(""),ce()},children:"Nov\xfd hr\xe1\u010d"})}),(0,H.jsx)(r.a,{bg:e,borderWidth:"1px",borderRadius:"md",overflowX:"auto",children:(0,H.jsxs)(C.X,{size:"sm",children:[(0,H.jsx)(N.d,{children:(0,H.jsxs)(R.Tr,{children:[(0,H.jsx)(D.Th,{w:"80px",children:"Fotka"}),(0,H.jsx)(D.Th,{children:"Jm\xe9no"}),(0,H.jsx)(D.Th,{children:"Pozice"}),(0,H.jsx)(D.Th,{children:"Pohlav\xed"}),(0,H.jsx)(D.Th,{children:"N\xe1rodnost"}),(0,H.jsx)(D.Th,{w:"120px",children:"\u010c\xedslo"}),(0,H.jsx)(D.Th,{w:"120px",children:"Aktivn\xed"}),(0,H.jsx)(D.Th,{w:"160px",children:"Akce"})]})}),(0,H.jsxs)(E.N,{children:[oe&&(0,H.jsx)(R.Tr,{children:(0,H.jsx)(T.Td,{colSpan:7,children:"Na\u010d\xedt\xe1m..."})}),!oe&&(ie||[]).map(e=>{var t;return(0,H.jsxs)(R.Tr,{opacity:e.is_active?1:.6,children:[(0,H.jsx)(T.Td,{children:(0,H.jsx)(B.A,{src:(0,Z.uq)(e.image_url)||"/dist/img/player-placeholder.svg",alt:"".concat(e.first_name," ").concat(e.last_name),size:"48px",previewSize:"300px",borderRadius:"md"})}),(0,H.jsxs)(T.Td,{children:[e.first_name," ",e.last_name]}),(0,H.jsx)(T.Td,{children:e.position||"-"}),(0,H.jsx)(T.Td,{children:e.gender?"women"===String(e.gender).toLowerCase()?"\u017dena":"Mu\u017e":"-"}),(0,H.jsx)(T.Td,{children:e.nationality?(0,H.jsxs)(z.z,{spacing:2,children:[(0,H.jsx)("span",{children:(0,K.xg)(e.nationality)}),(0,H.jsx)("span",{children:(0,K.Pd)(e.nationality)})]}):"-"}),(0,H.jsx)(T.Td,{children:null!==(t=e.jersey_number)&&void 0!==t?t:"-"}),(0,H.jsx)(T.Td,{children:(0,H.jsx)(A.d,{isChecked:!!e.is_active,onChange:()=>{null!=e.id&&ve.mutate({id:e.id,payload:{is_active:!e.is_active}})}})}),(0,H.jsx)(T.Td,{children:(0,H.jsxs)(z.z,{children:[(0,H.jsx)(l.K,{"aria-label":"Upravit",size:"sm",icon:(0,H.jsx)(I.WXf,{}),onClick:()=>(e=>{se((0,a.A)({},e)),be(e.date_of_birth||""),ce()})(e)}),(0,H.jsx)(l.K,{"aria-label":"Smazat",size:"sm",colorScheme:"red",icon:(0,H.jsx)(I.IXo,{}),onClick:async()=>{confirm("Opravdu smazat z\xe1znam?")&&null!=e.id&&await je.mutateAsync(e.id)}})]})})]},e.id)})]})]})}),(0,H.jsxs)(f.aF,{isOpen:le,onClose:xe,size:"lg",children:[(0,H.jsx)(y.m,{}),(0,H.jsxs)(k.$,{maxW:"90vw",maxH:"90vh",overflowY:"auto",children:[(0,H.jsx)(b.r,{children:null!==re&&void 0!==re&&re.id?"Upravit hr\xe1\u010de":"Nov\xfd hr\xe1\u010d"}),(0,H.jsx)(v.s,{}),(0,H.jsx)(g.c,{children:(0,H.jsxs)(S.T,{align:"stretch",spacing:4,children:[(0,H.jsxs)(m.r,{columns:[1,2],spacing:4,children:[(0,H.jsxs)(d.MJ,{isRequired:!0,children:[(0,H.jsx)(h.l,{children:"Jm\xe9no"}),(0,H.jsx)(x.p,{value:(null===re||void 0===re?void 0:re.first_name)||"",onChange:e=>se(t=>(0,a.A)((0,a.A)({},t),{},{first_name:e.target.value})),onBlur:()=>{se(e=>{if(!e)return e;const t=(e.first_name||"").trim();if(!(e.last_name||"").trim()&&t.includes(" ")){const n=t.split(/\s+/).filter(Boolean);if(n.length>=2)return(0,a.A)((0,a.A)({},e),{},{first_name:n[0],last_name:n[n.length-1]})}return e})}})]}),(0,H.jsxs)(d.MJ,{isRequired:!0,children:[(0,H.jsx)(h.l,{children:"P\u0159\xedjmen\xed"}),(0,H.jsx)(x.p,{value:(null===re||void 0===re?void 0:re.last_name)||"",onChange:e=>se(t=>(0,a.A)((0,a.A)({},t),{},{last_name:e.target.value}))})]}),(0,H.jsxs)(d.MJ,{isRequired:!0,children:[(0,H.jsx)(h.l,{children:"Datum narozen\xed"}),(0,H.jsxs)(z.z,{children:[(0,H.jsxs)(w.l,{value:me.day,onChange:e=>ye("day",e.target.value),children:[(0,H.jsx)("option",{value:"",disabled:!0,children:"Den"}),Array.from({length:31}).map((e,t)=>(0,H.jsx)("option",{value:(t+1).toString(),children:t+1},t+1))]}),(0,H.jsxs)(w.l,{value:me.month,onChange:e=>ye("month",e.target.value),children:[(0,H.jsx)("option",{value:"",disabled:!0,children:"M\u011bs\xedc"}),Array.from({length:12}).map((e,t)=>(0,H.jsx)("option",{value:(t+1).toString(),children:t+1},t+1))]}),(0,H.jsxs)(w.l,{value:me.year,onChange:e=>ye("year",e.target.value),children:[(0,H.jsx)("option",{value:"",disabled:!0,children:"Rok"}),Array.from({length:80}).map((e,t)=>{const n=(new Date).getFullYear()-t;return(0,H.jsx)("option",{value:String(n),children:n},n)})]})]}),(0,H.jsxs)(r.a,{mt:2,fontSize:"sm",color:"gray.500",children:[function(e){const t=e.day?e.day.toString().padStart(2,"0"):"__",n=e.month?e.month.toString().padStart(2,"0"):"__",a=e.year||"____";return"".concat(t,".").concat(n,".").concat(a)}(me),(()=>{const e=function(e){if(!e.day||!e.month||!e.year)return null;const t=Number(e.year),n=Number(e.month),a=Number(e.day);if(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(a))return null;const i=new Date;let o=i.getFullYear()-t;const r=i.getMonth()+1,s=i.getDate();(r<n||r===n&&s<a)&&o--;return o}(me);return null!=e?" \u2014 ".concat(e," ").concat(1===(t=e)?"rok":t>=2&&t<=4?"roky":"let"):"";var t})()]})]}),(0,H.jsxs)(d.MJ,{children:[(0,H.jsx)(h.l,{children:"Pozice"}),(0,H.jsxs)(w.l,{value:(null===re||void 0===re?void 0:re.position)||"",onChange:e=>se(t=>(0,a.A)((0,a.A)({},t),{},{position:e.target.value})),children:[(0,H.jsx)("option",{value:"",children:"\u2014 vyberte pozici \u2014"}),(0,H.jsx)("option",{value:"Brank\xe1\u0159",children:"Brank\xe1\u0159"}),(0,H.jsx)("option",{value:"Obr\xe1nce",children:"Obr\xe1nce"}),(0,H.jsx)("option",{value:"Z\xe1lo\u017en\xedk",children:"Z\xe1lo\u017en\xedk"}),(0,H.jsx)("option",{value:"\xdato\u010dn\xedk",children:"\xdato\u010dn\xedk"}),(0,H.jsx)("option",{value:"Univerz\xe1l",children:"Univerz\xe1l"})]})]}),(0,H.jsxs)(d.MJ,{children:[(0,H.jsx)(h.l,{children:"Pohlav\xed"}),(0,H.jsxs)(w.l,{value:(null===re||void 0===re?void 0:re.gender)||"",onChange:e=>se(t=>(0,a.A)((0,a.A)({},t),{},{gender:e.target.value})),children:[(0,H.jsx)("option",{value:"",children:"\u2014 nevybr\xe1no \u2014"}),(0,H.jsx)("option",{value:"men",children:"Mu\u017e"}),(0,H.jsx)("option",{value:"women",children:"\u017dena"})]})]}),(0,H.jsxs)(d.MJ,{children:[(0,H.jsx)(h.l,{children:"\u010c\xedslo dresu"}),(0,H.jsx)(_.Q7,{min:0,keepWithinRange:!1,clampValueOnBlur:!1,value:"number"===typeof(null===re||void 0===re?void 0:re.jersey_number)?null===re||void 0===re?void 0:re.jersey_number:"",onChange:(e,t)=>se(e=>(0,a.A)((0,a.A)({},e),{},{jersey_number:Number.isFinite(t)&&t>=0?t:void 0})),children:(0,H.jsx)(_.OO,{inputMode:"numeric"})})]}),(0,H.jsxs)(d.MJ,{children:[(0,H.jsx)(h.l,{children:"N\xe1rodnost"}),(0,H.jsxs)(S.T,{align:"stretch",spacing:2,children:[(0,H.jsx)(x.p,{placeholder:"Hledat zemi (nap\u0159. cz, czechia)\u2026",value:G,onChange:e=>X(e.target.value),ref:Y,onKeyDown:e=>{var t;if("ArrowDown"===e.key)e.preventDefault(),null===(t=Q.current)||void 0===t||t.focus();else if("Escape"===e.key)X("");else if("Enter"===e.key&&1===te.length){var n;const e=te[0];se(t=>(0,a.A)((0,a.A)({},t),{},{nationality:e.name})),null===(n=Q.current)||void 0===n||n.focus()}}}),(0,H.jsx)(w.l,{placeholder:"\u2014 vyberte zemi \u2014",value:(null===re||void 0===re?void 0:re.nationality)||"",onChange:e=>se(t=>(0,a.A)((0,a.A)({},t),{},{nationality:e.target.value})),ref:Q,onKeyDown:e=>{var t;"ArrowUp"===e.key&&0===e.target.selectedIndex&&(e.preventDefault(),null===(t=Y.current)||void 0===t||t.focus())},children:te.map(e=>(0,H.jsxs)("option",{value:e.name,children:[e.emoji," ",(0,K.Pd)(e.name)," (",e.name,")"]},e.cca2))})]})]}),(0,H.jsxs)(d.MJ,{isInvalid:"number"===typeof(null===re||void 0===re?void 0:re.height)&&(null===re||void 0===re?void 0:re.height)>ue,children:[(0,H.jsx)(h.l,{children:"V\xfd\u0161ka (cm)"}),(0,H.jsx)(_.Q7,{min:0,max:ue,keepWithinRange:!1,clampValueOnBlur:!1,value:"number"===typeof(null===re||void 0===re?void 0:re.height)?null===re||void 0===re?void 0:re.height:"",onChange:(e,t)=>se(e=>(0,a.A)((0,a.A)({},e),{},{height:Number.isFinite(t)?t:void 0})),children:(0,H.jsx)(_.OO,{inputMode:"numeric"})}),(0,H.jsxs)(u.Wt,{children:["Maxim\xe1ln\xed v\xfd\u0161ka je ",ue," cm."]})]}),(0,H.jsxs)(d.MJ,{isInvalid:"number"===typeof(null===re||void 0===re?void 0:re.weight)&&(null===re||void 0===re?void 0:re.weight)>he,children:[(0,H.jsx)(h.l,{children:"V\xe1ha (kg)"}),(0,H.jsx)(_.Q7,{min:0,max:he,keepWithinRange:!1,clampValueOnBlur:!1,value:"number"===typeof(null===re||void 0===re?void 0:re.weight)?null===re||void 0===re?void 0:re.weight:"",onChange:(e,t)=>se(e=>(0,a.A)((0,a.A)({},e),{},{weight:Number.isFinite(t)?t:void 0})),children:(0,H.jsx)(_.OO,{inputMode:"numeric"})}),(0,H.jsxs)(u.Wt,{children:["Maxim\xe1ln\xed v\xe1ha je ",he," kg."]})]}),(0,H.jsxs)(d.MJ,{children:[(0,H.jsx)(h.l,{children:"Email (nepovinn\xe9)"}),(0,H.jsx)(x.p,{type:"email",value:(null===re||void 0===re?void 0:re.email)||"",onChange:e=>se(t=>(0,a.A)((0,a.A)({},t),{},{email:e.target.value}))})]}),(0,H.jsxs)(d.MJ,{children:[(0,H.jsx)(h.l,{children:"Telefon (nepovinn\xe9)"}),(0,H.jsx)(x.p,{type:"tel",inputMode:"tel",value:(null===re||void 0===re?void 0:re.phone)||"",onChange:e=>{const t=e.target.value.replace(/[^0-9+\s()-]/g,"");se(e=>(0,a.A)((0,a.A)({},e),{},{phone:t}))},onKeyDown:e=>{1!==e.key.length||!/[^0-9+\s()-]/.test(e.key)||e.ctrlKey||e.metaKey||e.altKey||e.preventDefault()},onPaste:e=>{const t=e.clipboardData.getData("text"),n=t.replace(/[^0-9+\s()-]/g,"");if(t!==n){e.preventDefault();const t=e.currentTarget,i=t.selectionStart||0,o=t.selectionEnd||0,r=t.value,s=r.slice(0,i)+n+r.slice(o);se(e=>(0,a.A)((0,a.A)({},e),{},{phone:s})),requestAnimationFrame(()=>{try{t.setSelectionRange(i+n.length,i+n.length)}catch(e){}})}}})]}),(0,H.jsx)(r.a,{gridColumn:"1 / -1",fontSize:"sm",color:"gray.600",children:"Upozorn\u011bn\xed: telefonn\xed \u010d\xedslo a e\u2011mail budou viditeln\xe9 na hlavn\xed str\xe1nce. \xdadaje nejsou povinn\xe9 \u2014 pokud je nechcete zad\xe1vat, ponechte je pr\xe1zdn\xe9."})]}),(0,H.jsxs)(d.MJ,{children:[(0,H.jsx)(h.l,{children:"Fotka"}),(0,H.jsxs)(z.z,{align:"flex-start",spacing:3,children:[(0,H.jsx)(p._,{src:(0,Z.uq)(null===re||void 0===re?void 0:re.image_url)||"/player-placeholder.svg",alt:"photo",boxSize:"56px",objectFit:"cover",borderRadius:"md",fallbackSrc:"/dist/img/logo-club-empty.svg"}),(0,H.jsx)(r.a,{flex:"1",children:(0,H.jsx)(V.A,{label:"Nahr\xe1t fotku hr\xe1\u010de",description:"Nahrajte fotku hr\xe1\u010de (portr\xe9t).",accept:"image/*,image/svg+xml",multiple:!1,maxFiles:1,uploadFn:async e=>{const t="image/svg+xml"===e.type?await(0,q.QM)(e):await ne(e);return{url:t.url,name:e.name,type:e.type||t.type||"image/*",size:e.size||t.size||0}},allowUrlImport:!1,onUploadFinished:e=>{const t=e[e.length-1];t&&se(e=>(0,a.A)((0,a.A)({},e),{},{image_url:t.url}))}})})]})]}),(0,H.jsxs)(d.MJ,{display:"flex",alignItems:"center",children:[(0,H.jsx)(h.l,{mb:"0",children:"Aktivn\xed"}),(0,H.jsx)(A.d,{isChecked:!(null===re||void 0===re||!re.is_active),onChange:e=>se(t=>(0,a.A)((0,a.A)({},t),{},{is_active:e.target.checked}))})]})]})}),(0,H.jsxs)(j.j,{children:[(0,H.jsx)(s.$,{variant:"ghost",mr:3,onClick:xe,children:"Zru\u0161it"}),(0,H.jsx)(s.$,{colorScheme:"blue",onClick:async()=>{if(!re)return;let e=(re.first_name||"").trim(),n=(re.last_name||"").trim();if(!n&&e.includes(" ")){const t=e.split(/\s+/).filter(Boolean);t.length>=2&&(e=t[0],n=t[t.length-1])}if(!e||!n)return void t({title:"Jm\xe9no a p\u0159\xedjmen\xed jsou povinn\xe9",status:"warning"});if("number"===typeof re.height&&Number.isFinite(re.height)&&re.height>ue||"number"===typeof re.weight&&Number.isFinite(re.weight)&&re.weight>he)return void t({title:"Neplatn\xe1 \u010d\xedsla",description:"Maxima: v\xfd\u0161ka ".concat(ue," cm, v\xe1ha ").concat(he," kg"),status:"warning"});if(!me.day||!me.month||!me.year)return void t({title:"Datum narozen\xed je povinn\xe9",description:"Vyberte den, m\u011bs\xedc i rok.",status:"warning"});const a={first_name:e,last_name:n};re.date_of_birth&&(a.date_of_birth=re.date_of_birth),re.position&&(a.position=re.position),"number"===typeof re.jersey_number&&Number.isFinite(re.jersey_number)&&re.jersey_number>=0&&(a.jersey_number=re.jersey_number),re.nationality&&(a.nationality=re.nationality),"number"===typeof re.height&&Number.isFinite(re.height)&&re.height>0&&(a.height=re.height),"number"===typeof re.weight&&Number.isFinite(re.weight)&&re.weight>0&&(a.weight=re.weight),re.image_url&&(a.image_url=re.image_url),re.gender&&(a.gender=re.gender),"boolean"===typeof re.is_active&&(a.is_active=re.is_active);const i=(re.email||"").trim(),o=(re.phone||"").trim();i&&(a.email=i),o&&(a.phone=o);try{null!=re.id?await ve.mutateAsync({id:re.id,payload:a}):await ge.mutateAsync(a)}catch(r){}},isLoading:ge.isLoading||ve.isLoading,children:"Ulo\u017eit"})]})]})]})]});function be(e){const t=function(e){if(!e)return null;const t=String(e).match(/^(\d{4})-(\d{2})-(\d{2})(?:$|T)/);if(!t)return null;const n=Number(t[1]),a=Number(t[2]),i=Number(t[3]);return n&&a&&i?{y:n,m:a,d:i}:null}(e||null);pe(t?{day:String(t.d),month:String(t.m),year:String(t.y)}:{day:"",month:"",year:""})}function ye(e,t){pe(n=>{let i=(0,a.A)((0,a.A)({},n),{},{[e]:t});const o=Number(i.year||"0"),r=Number(i.month||"0"),s=Number(i.day||"0");if(o&&r&&s){const e=new Date(o,r,0).getDate();s>e&&(i.day=String(e))}const l=Number(i.year||"0"),c=Number(i.month||"0"),d=Number(i.day||"0");if(l&&c&&d){const e="".concat(l,"-").concat(String(c).padStart(2,"0"),"-").concat(String(d).padStart(2,"0"));se(t=>(0,a.A)((0,a.A)({},t),{},{date_of_birth:e}))}else se(e=>(0,a.A)((0,a.A)({},e),{},{date_of_birth:""}));return i})}}},94706:(e,t,n)=>{n.r(t),n.d(t,{default:()=>q});var a=n(89379),i=n(65043),o=n(87139),r=n(22107),s=n(42703),l=n(44093),c=n(98939),d=n(43533),u=n(25527),h=n(33572),m=n(35699),p=n(45973),x=n(29244),g=n(75081),v=n(87381),j=n(61724),b=n(99032),y=n(96148),f=n(10202),k=n(99956),_=n(28846),w=n(39081),z=n(72526),S=n(11100),A=n(34636),C=n(6484),E=n(35475),T=n(25189),D=n(40378),N=n(36695),R=n(81398),F=n(75088),P=n(39292),I=n(40614),M=n(12255),L=n(49367),W=n(74117),U=n(70579);const O=e=>{var t;let{article:n,variant:a}=e;const{t:i}=(0,W.Bd)(),s=n.slug?"/news/".concat(n.slug):"/articles/".concat(n.id),c=n.read_time||n.estimated_read_minutes,d=(n.view_count,(0,l.dU)("white","gray.800")),u=(null===n||void 0===n||null===(t=n.category)||void 0===t?void 0:t.name)||(null===n||void 0===n?void 0:n.category_name),m="large"===a?{base:"280px",md:"360px"}:"small"===a?{base:"160px",md:"180px"}:{base:"200px",md:"220px"},p=n.published_at||n.created_at,x=p?(()=>{try{return new Date(p).toLocaleDateString("cs-CZ")}catch(e){return""}})():"";return(0,U.jsxs)(g.Q,{as:E.N_,to:s,borderRadius:"md",overflow:"hidden",bg:d,borderWidth:"0",_hover:{boxShadow:"xl",transform:"translateY(-3px)"},transition:"all 0.25s ease",position:"relative",children:[(0,U.jsxs)(r.a,{position:"relative",children:[(0,U.jsx)(h._,{src:(0,T.uq)(n.image_url)||"/stadium-placeholder.jpg",alt:n.title,w:"100%",h:m,objectFit:"cover",loading:"large"===a?"eager":"lazy",decoding:"async",sizes:"large"===a?"(min-width: 768px) 60vw, 100vw":"100vw",fetchPriority:"large"===a?"high":"auto"}),(0,U.jsx)(r.a,{position:"absolute",inset:0,bgGradient:"linear(to-t, rgba(0,0,0,0.55), rgba(0,0,0,0.15))"}),(0,U.jsxs)(y.z,{position:"absolute",top:2,left:2,right:2,justify:"space-between",align:"center",children:[u?(0,U.jsx)(k.m,{label:i("blog.category"),hasArrow:!0,children:(0,U.jsx)(o.E,{bg:"rgba(0,0,0,0.7)",color:"white",fontSize:"xs",px:2,py:1,borderRadius:"md",children:u})}):(0,U.jsx)(r.a,{}),x?(0,U.jsx)(k.m,{label:i("blog.publish_date"),hasArrow:!0,children:(0,U.jsx)(o.E,{bg:"rgba(0,0,0,0.7)",color:"white",fontSize:"xs",px:2,py:1,borderRadius:"md",children:x})}):(0,U.jsx)(r.a,{}),c?(0,U.jsx)(k.m,{label:i("blog.read_time"),hasArrow:!0,children:(0,U.jsxs)(o.E,{display:"flex",alignItems:"center",gap:1,bg:"rgba(0,0,0,0.7)",color:"white",fontSize:"xs",px:2,py:1,borderRadius:"md",children:[(0,U.jsx)(F.A,{size:12}),c," min"]})}):(0,U.jsx)(r.a,{})]}),(0,U.jsx)(_.D,{as:"h3",fontSize:"large"===a?{base:"xl",md:"2xl"}:{base:"lg",md:"xl"},fontWeight:"800",letterSpacing:"0.3px",textTransform:"uppercase",position:"absolute",bottom:3,left:4,right:4,color:"white",noOfLines:2,children:n.title})]}),(0,U.jsx)(M.A,{article:n,targetUrl:"undefined"!==typeof window?new URL(s,window.location.origin).toString():void 0,placement:"inline",position:"bottom-right",size:"sm"})]})},q=()=>{var e,t;const{t:n}=(0,W.Bd)(),[o,h]=i.useState([]),[g,k]=(0,E.ok)(),F=i.useMemo(()=>{const e=g.get("category_id");return e?Number(e):""},[]),[M,q]=i.useState(F),K=g.get("month")||"",B=g.get("match_id")||"",Z=g.get("q")||"",[V,H]=i.useState(Z),[$,J]=i.useState(""),G=(0,l.dU)("gray.200","gray.700"),X=(0,l.dU)("gray.500","gray.400"),Y=(0,l.dU)("white","gray.800"),Q=(0,l.dU)("gray.200","gray.700"),ee=(0,l.dU)("gray.50","gray.700");i.useEffect(()=>{(async()=>{try{const e=await(0,N.bW)();h(e||[])}catch(e){}})()},[]),i.useEffect(()=>{const e=g.get("category_id"),t=g.get("category");if(null===e){if(t){const e=decodeURIComponent(t).toLowerCase(),n=o.find(n=>(null===n||void 0===n?void 0:n.slug)===t||String(n.name).toLowerCase()===e);return void q((null===n||void 0===n?void 0:n.id)||"")}q("")}else q(e?Number(e):"")},[g,o]),i.useEffect(()=>{H(Z)},[Z]);const te=(0,z.I)(["blog-match-suggest",{q:$}],()=>(0,A.GE)({page:1,page_size:50,published:!0,q:$}),{enabled:$.trim().length>=2}),ne=i.useMemo(()=>{var e;const t=(null===(e=te.data)||void 0===e?void 0:e.data)||[],n=new Map;return t.forEach(e=>{const t=null===e||void 0===e?void 0:e.match_snapshot,a=String((null===t||void 0===t?void 0:t.external_match_id)||"")||"";a&&(n.has(a)||n.set(a,{id:a,title:e.title,date:(null===t||void 0===t?void 0:t.date_time)||(null===t||void 0===t?void 0:t.date),home:null===t||void 0===t?void 0:t.home,away:null===t||void 0===t?void 0:t.away,comp:(null===t||void 0===t?void 0:t.competition)||(null===t||void 0===t?void 0:t.competitionName)}))}),Array.from(n.values()).slice(0,10)},[te.data]),{data:ae,isLoading:ie,isFetchingNextPage:oe,hasNextPage:re,fetchNextPage:se}=(0,S.q)(["articles-public",{page_size:18,published:!0,category_id:M||void 0,month:K||void 0,match_id:B||void 0,q:Z||void 0}],e=>{let{pageParam:t=1}=e;return(0,A.GE)((0,a.A)((0,a.A)((0,a.A)((0,a.A)({page:t,page_size:18,published:!0},M?{category_id:Number(M)}:{}),K?{month:K}:{}),B?{match_id:B}:{}),Z?{q:Z}:{}))},{getNextPageParam:(e,t)=>{const n=t.reduce((e,t)=>{var n;return e+((null===t||void 0===t||null===(n=t.data)||void 0===n?void 0:n.length)||0)},0);if(e)return n<(e.total||0)?t.length+1:void 0}}),le=(null===ae||void 0===ae||null===(e=ae.pages)||void 0===e?void 0:e.flatMap(e=>(null===e||void 0===e?void 0:e.data)||[]))||[],ce=i.useMemo(()=>le.slice(0,3),[le]),de=i.useMemo(()=>le.slice(3),[le]),ue=(0,z.I)(["banners",{placement:"article_inline"}],()=>(0,C.Oh)({active:!0,placement:"article_inline"}),{staleTime:6e4}).data||[],[he]=(0,v.U)("(min-width: 30em)"),me=he?5:2,pe=i.useRef(null);i.useEffect(()=>{if(!re||!pe.current)return;const e=pe.current,t=new IntersectionObserver(e=>{e[0].isIntersecting&&re&&!oe&&se()},{rootMargin:"400px"});return t.observe(e),()=>t.disconnect()},[re,oe,se]);const xe=[n("blog.title")];if(M){const e=o.find(e=>e.id===Number(M));null!==e&&void 0!==e&&e.name&&xe.push(e.name)}K&&xe.push(K),B&&xe.push(n("blog.match")),Z&&xe.push("Hled\xe1n\xed: ".concat(Z));const ge=xe.join(" \xb7 "),ve=Z?n("blog.search_results",{query:Z}):M?n("blog.category_articles",{category:(null===(t=o.find(e=>e.id===Number(M)))||void 0===t?void 0:t.name)||""}):n("blog.latest_articles"),je="undefined"!==typeof window?window.location.href:void 0;return i.useEffect(()=>{const e={};M&&(e.category_id=String(M)),K&&(e.month=K),B&&(e.match_id=B),V&&(e.q=V);const t=window.setTimeout(()=>k(e),400);return()=>window.clearTimeout(t)},[V,M,K,B]),(0,U.jsxs)(D.A,{children:[(0,U.jsxs)(L.mg,{children:[(0,U.jsx)("title",{children:ge}),(0,U.jsx)("meta",{name:"description",content:ve}),je&&(0,U.jsx)("link",{rel:"canonical",href:je}),(0,U.jsx)("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"ItemList",itemListElement:(le||[]).slice(0,12).map((e,t)=>({"@type":"ListItem",position:t+1,url:("undefined"!==typeof window?window.location.origin:"")+(e.slug?"/news/".concat(e.slug):"/articles/".concat(e.id)),name:e.title}))})})]}),(0,U.jsxs)(r.a,{children:[(0,U.jsx)(r.a,{bg:"transparent",color:"inherit",py:{base:8,md:10},mb:4,borderBottom:"1px",borderColor:G,children:(0,U.jsx)(c.m,{maxW:"7xl",children:(0,U.jsxs)(y.z,{justify:"space-between",align:"center",spacing:4,wrap:"wrap",children:[(0,U.jsx)(_.D,{as:"h1",size:{base:"xl",md:"2xl"},children:n("blog.title")}),(0,U.jsxs)(y.z,{spacing:3,w:{base:"100%",md:"620px"},children:[(0,U.jsx)(r.a,{flex:"1",children:(0,U.jsxs)(p.M,{children:[(0,U.jsx)(x.W,{pointerEvents:"none",children:(0,U.jsx)(P.A,{size:16})}),(0,U.jsx)(m.p,{placeholder:n("blog.search_articles"),value:V,onChange:e=>H(e.target.value)}),V&&(0,U.jsx)(x.t,{children:(0,U.jsx)(s.K,{"aria-label":"Clear search",size:"sm",variant:"ghost",onClick:()=>{H("");const e={};M&&(e.category_id=String(M)),K&&(e.month=K),B&&(e.match_id=B),k(e)},icon:(0,U.jsx)(I.A,{size:14})})})]})}),!!o.length&&(0,U.jsx)(j.l,{maxW:{base:"48%",md:"220px"},placeholder:n("blog.all_categories"),value:M,onChange:e=>{const t=e.target.value?Number(e.target.value):"";q(t);const n={};t&&(n.category_id=String(t)),Z&&(n.q=Z),K&&(n.month=K),B&&(n.match_id=B),k(n)},children:o.map(e=>(0,U.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,U.jsxs)(r.a,{flex:{base:"1",md:"0 0 220px"},position:"relative",children:[(0,U.jsx)(p.M,{children:(0,U.jsx)(m.p,{placeholder:n("blog.search_match"),value:$,onChange:e=>J(e.target.value),onKeyDown:e=>{if("Enter"===e.key){const e=$.trim();if(/^\d+$/.test(e)){const t={};t.match_id=e,M&&(t.category_id=String(M)),K&&(t.month=K),Z&&(t.q=Z),k(t)}}}})}),$.trim().length>=2&&ne.length>0&&(0,U.jsx)(r.a,{position:"absolute",top:"100%",left:0,right:0,bg:Y,borderWidth:"1px",borderColor:Q,borderRadius:"md",mt:1,zIndex:10,maxH:"260px",overflowY:"auto",boxShadow:"lg",children:ne.map(e=>(0,U.jsxs)(r.a,{px:3,py:2,_hover:{bg:ee},cursor:"pointer",onClick:()=>{const t={match_id:String(e.id)};M&&(t.category_id=String(M)),K&&(t.month=K),Z&&(t.q=Z),k(t),J("")},children:[(0,U.jsxs)(w.E,{fontSize:"sm",fontWeight:"600",noOfLines:1,children:[e.home," vs ",e.away]}),(0,U.jsxs)(w.E,{fontSize:"xs",color:X,noOfLines:1,children:[e.date||"",e.comp?" \u2022 ".concat(e.comp):""]})]},e.id))})]})]})]})})}),ce.length>0&&(0,U.jsx)(c.m,{maxW:"7xl",mb:6,children:(0,U.jsxs)(d.x,{templateColumns:{base:"1fr",md:"2fr 1fr"},gap:6,children:[(0,U.jsx)(u.E,{children:(0,U.jsx)(O,{article:ce[0],variant:"large"})}),(0,U.jsx)(u.E,{children:(0,U.jsx)(f.T,{spacing:6,align:"stretch",children:ce.slice(1,3).map(e=>(0,U.jsx)(O,{article:e,variant:"small"},e.id))})})]})}),(0,U.jsxs)(c.m,{maxW:"7xl",children:[(0,U.jsxs)(d.x,{templateColumns:{base:"1fr",sm:"repeat(2, 1fr)",lg:"repeat(4, 1fr)"},gap:8,children:[ie&&Array.from({length:9}).map((e,t)=>(0,U.jsx)(b.E,{h:{base:"260px",md:"300px"},borderRadius:"md"},t)),!ie&&de.map((e,t)=>(0,U.jsxs)(i.Fragment,{children:[(0,U.jsx)(u.E,{children:(0,U.jsx)(O,{article:e})}),ue.length>0&&t===me&&(0,U.jsx)(u.E,{colSpan:{base:1,sm:2,lg:3},children:(0,U.jsx)("a",{href:ue[0].click_url||"#",target:ue[0].click_url?"_blank":void 0,rel:ue[0].click_url?"noopener noreferrer":void 0,style:{display:"block"},children:(0,U.jsx)("img",{src:(0,T.uq)(ue[0].image_url)||"/images/sponsors/placeholder.png",alt:ue[0].name,style:{width:"100%",height:"auto",display:"block",borderRadius:8},loading:"lazy",decoding:"async"})})},"banner-inline-".concat(ue[0].id))]},"row-".concat(e.id)))]}),oe&&(0,U.jsx)(f.T,{py:6,children:(0,U.jsx)(w.E,{color:X,children:n("blog.loading")})})]}),(0,U.jsx)(R.A,{})]})]})}},95182:(e,t,n)=>{n.d(t,{A:()=>f});n(65043);var a=n(87139),i=n(22107),o=n(98662),r=n(44093),s=n(5371),l=n(67516),c=n(35929),d=n(56529),u=n(15071),h=n(11054),m=n(78460),p=n(85421),x=n(96148),g=n(10202),v=n(39081),j=n(74117),b=n(56644),y=n(70579);const f=e=>{let{isOpen:t,onClose:n,club:f,clubType:k="football"}=e;const{t:_}=(0,j.Bd)();if(!f)return null;const w=(0,r.dU)("white","gray.800"),z=(0,r.dU)("gray.200","whiteAlpha.300"),S=(0,r.dU)("gray.100","gray.700"),A=(0,r.dU)("gray.600","gray.300");return(0,y.jsxs)(m.aF,{isOpen:t,onClose:n,size:"lg",isCentered:!0,children:[(0,y.jsx)(h.m,{bg:"blackAlpha.600",backdropFilter:"blur(4px)"}),(0,y.jsxs)(p.$,{children:[(0,y.jsx)(u.r,{children:(0,y.jsxs)(s.s,{align:"center",gap:3,children:[(0,y.jsx)(b.L,{teamId:f.team_id,teamName:f.team,facrLogo:f.team_logo_url,size:"large",alt:f.team,borderRadius:"full",bg:w,borderWidth:"1px",borderColor:z,fallbackIcon:(0,y.jsx)(i.a,{w:"48px",h:"48px",bg:S,borderRadius:"full",display:"flex",alignItems:"center",justifyContent:"center",color:A,fontSize:"lg",fontWeight:"bold",borderWidth:"1px",borderColor:z,children:f.team.substring(0,2).toUpperCase()})}),(0,y.jsxs)(i.a,{children:[(0,y.jsx)(v.E,{fontSize:"xl",fontWeight:"bold",children:f.team}),f.rank&&(0,y.jsx)(a.E,{colorScheme:"blue",fontSize:"sm",children:_("table.position_place",{position:f.rank})})]})]})}),(0,y.jsx)(c.s,{}),(0,y.jsx)(l.c,{children:(0,y.jsxs)(g.T,{spacing:4,align:"stretch",children:[(0,y.jsxs)(i.a,{borderWidth:"1px",borderRadius:"lg",p:4,bg:(0,r.dU)("gray.50","gray.700"),borderColor:z,children:[(0,y.jsx)(v.E,{fontSize:"md",fontWeight:"semibold",mb:3,color:(0,r.dU)("gray.700","gray.200"),children:_("club_modal.statistics")}),(0,y.jsxs)(g.T,{spacing:2,align:"stretch",children:[(0,y.jsxs)(x.z,{justify:"space-between",children:[(0,y.jsxs)(v.E,{color:(0,r.dU)("gray.600","gray.300"),children:[_("club_modal.matches_played"),":"]}),(0,y.jsx)(v.E,{fontWeight:"bold",color:(0,r.dU)("gray.800","gray.100"),children:f.played||0})]}),(0,y.jsxs)(x.z,{justify:"space-between",children:[(0,y.jsxs)(v.E,{color:(0,r.dU)("gray.600","gray.300"),children:[_("club_modal.wins"),":"]}),(0,y.jsx)(v.E,{fontWeight:"bold",color:"green.600",children:f.wins||0})]}),(0,y.jsxs)(x.z,{justify:"space-between",children:[(0,y.jsxs)(v.E,{color:(0,r.dU)("gray.600","gray.300"),children:[_("club_modal.draws"),":"]}),(0,y.jsx)(v.E,{fontWeight:"bold",color:(0,r.dU)("gray.600","gray.400"),children:f.draws||0})]}),(0,y.jsxs)(x.z,{justify:"space-between",children:[(0,y.jsxs)(v.E,{color:(0,r.dU)("gray.600","gray.300"),children:[_("club_modal.losses"),":"]}),(0,y.jsx)(v.E,{fontWeight:"bold",color:"red.600",children:f.losses||0})]}),(0,y.jsxs)(x.z,{justify:"space-between",children:[(0,y.jsxs)(v.E,{color:(0,r.dU)("gray.600","gray.300"),children:[_("club_modal.score"),":"]}),(0,y.jsx)(v.E,{fontWeight:"bold",color:(0,r.dU)("gray.800","gray.100"),children:f.score||"0:0"})]}),(void 0!==f.goals_scored||void 0!==f.goals_conceded)&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(x.z,{justify:"space-between",children:[(0,y.jsxs)(v.E,{color:(0,r.dU)("gray.600","gray.300"),children:[_("club_modal.goals_scored"),":"]}),(0,y.jsx)(v.E,{fontWeight:"bold",color:"green.500",children:f.goals_scored||0})]}),(0,y.jsxs)(x.z,{justify:"space-between",children:[(0,y.jsxs)(v.E,{color:(0,r.dU)("gray.600","gray.300"),children:[_("club_modal.goals_conceded"),":"]}),(0,y.jsx)(v.E,{fontWeight:"bold",color:"red.500",children:f.goals_conceded||0})]})]}),void 0!==f.goal_difference&&(0,y.jsxs)(x.z,{justify:"space-between",children:[(0,y.jsxs)(v.E,{color:(0,r.dU)("gray.600","gray.300"),children:[_("club_modal.goal_difference"),":"]}),(0,y.jsxs)(v.E,{fontWeight:"bold",color:Number(f.goal_difference)>=0?"green.600":"red.600",children:[Number(f.goal_difference)>0?"+":"",f.goal_difference]})]}),(0,y.jsxs)(x.z,{justify:"space-between",pt:2,borderTopWidth:"1px",borderColor:z,children:[(0,y.jsxs)(v.E,{color:(0,r.dU)("gray.700","gray.200"),fontWeight:"semibold",children:[_("club_modal.points"),":"]}),(0,y.jsx)(a.E,{colorScheme:"blue",fontSize:"lg",px:3,py:1,children:f.points||0})]})]})]}),f.form&&(0,y.jsxs)(i.a,{borderWidth:"1px",borderRadius:"lg",p:4,bg:(0,r.dU)("gray.50","gray.700"),borderColor:z,children:[(0,y.jsx)(v.E,{fontSize:"md",fontWeight:"semibold",mb:3,color:(0,r.dU)("gray.700","gray.200"),children:_("club_modal.form_last_5")}),(0,y.jsx)(x.z,{spacing:2,justify:"center",children:f.form.split("").map((e,t)=>(0,y.jsx)(a.E,{colorScheme:"W"===e?"green":"D"===e?"yellow":"red",fontSize:"md",px:3,py:1,borderRadius:"md",children:"W"===e?"V":"D"===e?"R":"P"},t))})]})]})}),(0,y.jsx)(d.j,{children:(0,y.jsx)(o.$,{colorScheme:"gray",onClick:n,children:_("club_modal.close")})})]})]})}},97122:(e,t,n)=>{n.r(t),n.d(t,{default:()=>B});var a=n(89379),i=n(65043),o=n(12836),r=n(27024),s=n(87139),l=n(22107),c=n(98662),d=n(44093),u=n(98939),h=n(82459),m=n(73225),p=n(10804),x=n(76668),g=n(73212),v=n(25011),j=n(35699),b=n(7189),y=n(96148),f=n(10202),k=n(14566),_=n(31411),w=n(10227),z=n(51794),S=n(3109),A=n(19077),C=n(30502),E=n(28846),T=n(39081),D=n(24858),N=n(66286),R=n(20515),F=n(40378),P=n(1009),I=n(82047),M=n(56379),L=n(29671),W=n(40384),U=n(70082),O=n(91276),q=n(74117),K=n(70579);const B=()=>{const{t:e}=(0,q.Bd)(),t=(0,C.d)(),{settings:n}=(0,R.t)(),B=(0,d.dU)("white","gray.800"),Z=(0,d.dU)("gray.200","gray.700"),V=(0,d.dU)("white","gray.800"),H=(0,d.dU)("gray.200","gray.700"),[$,J]=(0,i.useState)(null),[G,X]=(0,i.useState)(!0),[Y,Q]=(0,i.useState)([]),[ee,te]=(0,i.useState)({}),{register:ne,handleSubmit:ae,reset:ie,formState:{errors:oe,isSubmitting:re}}=(0,D.mN)(),{mutate:se,isLoading:le}=(0,o.n)({mutationFn:e=>(0,N.rx)((0,a.A)((0,a.A)({},e),{},{source:"contact"})),onSuccess:()=>{ie(),(0,I.Up)(!0),(0,I.w)("Contact Form",!0),t({title:e("contact.message_sent"),description:e("contact.message_sent_desc"),status:"success",duration:5e3,isClosable:!0})},onError:n=>{var a,i,o,r;const s=(null===n||void 0===n?void 0:n.code)||"",l=(null===n||void 0===n||null===(a=n.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||(null===n||void 0===n||null===(o=n.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.message),c="ECONNABORTED"===s||/timeout/i.test(String((null===n||void 0===n?void 0:n.message)||"")),d=!(null===n||void 0===n||!n.isAxiosError)&&!(null!==n&&void 0!==n&&n.response),u=l||e(c?"contact.timeout_error":d?"contact.network_error":"contact.general_error");(0,I.Up)(!1),(0,I.w)("Contact Form",!1),t({title:e("contact.error_title"),description:u,status:"error",duration:6e3,isClosable:!0})}});(0,i.useEffect)(()=>{let e=!0;return(async()=>{try{const t=await(0,L.fk)();e&&J(t)}catch(t){console.error("Failed to load contacts",t)}finally{e&&X(!1)}})(),()=>{e=!1}},[]),(0,i.useEffect)(()=>{(async()=>{try{const a=(null===n||void 0===n?void 0:n.club_id)||"",i=(null===n||void 0===n?void 0:n.club_type)||"football";let o=[];if(a)try{const e=await W.J.getClub(String(a),i);(Array.isArray(null===e||void 0===e?void 0:e.competitions)?e.competitions:[]).forEach(e=>o.push({code:e.code,name:e.name||e.code}))}catch(e){}let r={};try{(await(0,U.xN)()).forEach(e=>{e.code&&e.alias&&(r[e.code]=e.alias)})}catch(t){}const s=o.map(e=>({code:e.code,name:e.code&&r[e.code]?r[e.code]:e.name}));te(r),Q(s)}catch(a){}})()},[n]);return(0,K.jsx)(F.A,{children:(0,K.jsx)(u.m,{maxW:"container.xl",children:(0,K.jsxs)(f.T,{align:"stretch",spacing:8,children:[(0,K.jsxs)(l.a,{children:[(0,K.jsx)(E.D,{size:"xl",mb:4,children:"Kontakt"}),(()=>{const t=null===n||void 0===n?void 0:n.location_latitude,a=null===n||void 0===n?void 0:n.location_longitude,i=!!t&&!!a,o=Object.entries((null===$||void 0===$?void 0:$.categories)||{}),c=(null===$||void 0===$?void 0:$.uncategorized)||[],d=o.length>0||c.length>0,u=!!(null!==n&&void 0!==n&&n.contact_address||null!==n&&void 0!==n&&n.contact_phone||null!==n&&void 0!==n&&n.contact_email);return i||d||u?(0,K.jsxs)(g.r,{columns:{base:1,md:2},spacing:8,alignItems:"start",children:[i&&(0,K.jsx)(l.a,{borderRadius:"lg",overflow:"hidden",boxShadow:"md",alignSelf:"start",children:(0,K.jsx)(M.A,{latitude:t,longitude:a,zoom:(null===n||void 0===n?void 0:n.map_zoom_level)||15,address:null===n||void 0===n?void 0:n.contact_address,clubName:(null===n||void 0===n?void 0:n.club_name)||(null===n||void 0===n?void 0:n.site_title),mapStyle:(null===n||void 0===n?void 0:n.map_style)||"default",clubPrimaryColor:null===n||void 0===n?void 0:n.primary_color,clubSecondaryColor:null===n||void 0===n?void 0:n.accent_color})}),(u||d)&&(0,K.jsxs)(f.T,{align:"stretch",spacing:4,children:[u&&(0,K.jsxs)(l.a,{bg:V,p:4,borderRadius:"lg",borderWidth:"1px",borderColor:H,boxShadow:"sm",children:[(0,K.jsx)(E.D,{size:"md",mb:3,children:e("contact.contact_info")}),(0,K.jsxs)(f.T,{align:"stretch",spacing:3,children:[(null===n||void 0===n?void 0:n.contact_address)&&(0,K.jsxs)(y.z,{align:"start",children:[(0,K.jsx)(v.I,{as:P.HzC,boxSize:5,color:"blue.500",mt:1}),(0,K.jsxs)(f.T,{align:"start",spacing:0,children:[(0,K.jsx)(T.E,{fontWeight:"bold",children:e("contact.address")}),(0,K.jsx)(T.E,{children:null===n||void 0===n?void 0:n.contact_address}),(null===n||void 0===n?void 0:n.contact_city)&&(0,K.jsxs)(T.E,{children:[(null===n||void 0===n?void 0:n.contact_zip)&&"".concat(null===n||void 0===n?void 0:n.contact_zip," "),null===n||void 0===n?void 0:n.contact_city]}),(null===n||void 0===n?void 0:n.contact_country)&&(0,K.jsx)(T.E,{children:null===n||void 0===n?void 0:n.contact_country})]})]}),(null===n||void 0===n?void 0:n.contact_phone)&&(0,K.jsxs)(y.z,{align:"start",children:[(0,K.jsx)(v.I,{as:P.QFc,boxSize:5,color:"blue.500",mt:1}),(0,K.jsxs)(f.T,{align:"start",spacing:0,children:[(0,K.jsx)(T.E,{fontWeight:"bold",children:e("contact.phone")}),(0,K.jsx)(b.N,{href:"tel:".concat(null===n||void 0===n?void 0:n.contact_phone),color:"blue.500",children:null===n||void 0===n?void 0:n.contact_phone})]})]}),(null===n||void 0===n?void 0:n.contact_email)&&(0,K.jsxs)(y.z,{align:"start",children:[(0,K.jsx)(v.I,{as:P.pHD,boxSize:5,color:"blue.500",mt:1}),(0,K.jsxs)(f.T,{align:"start",spacing:0,children:[(0,K.jsx)(T.E,{fontWeight:"bold",children:e("contact.email")}),(0,K.jsx)(b.N,{href:"mailto:".concat(null===n||void 0===n?void 0:n.contact_email),color:"blue.500",children:null===n||void 0===n?void 0:n.contact_email})]})]})]})]}),d&&(0,K.jsxs)(l.a,{bg:V,p:4,borderRadius:"lg",borderWidth:"1px",borderColor:H,boxShadow:"sm",children:[(0,K.jsx)(E.D,{size:"md",mb:3,children:e("contact.contact_persons")}),(0,K.jsx)(S.t,{colorScheme:"blue",isFitted:!0,isLazy:!0,children:(()=>{const t=Object.entries((null===$||void 0===$?void 0:$.categories)||{}),n=Y.map(e=>e.code&&ee[e.code]?ee[e.code]:e.name).filter(Boolean),a=t.length>0,i=a?t.map(e=>{let[t]=e;return t}):n,o=c.length>0;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(_.w,{children:[i.map(e=>(0,K.jsx)(k.o,{children:e},e)),o&&(0,K.jsx)(k.o,{children:e("contact.others")})]}),(0,K.jsxs)(z.T,{children:[a?t.map(e=>{let[t,n]=e;return(0,K.jsx)(w.K,{pt:4,children:(0,K.jsx)(g.r,{columns:{base:1,sm:2},spacing:4,children:n.map(e=>(0,K.jsx)(l.a,{bg:V,p:4,borderRadius:"md",borderWidth:"1px",borderColor:H,children:(0,K.jsxs)(f.T,{align:"start",spacing:3,children:[e.image_url&&(0,K.jsx)(r.e,{src:(0,O.V)(e.image_url),name:e.name,size:"lg"}),(0,K.jsxs)(l.a,{children:[(0,K.jsx)(E.D,{size:"sm",children:e.name}),e.position&&(0,K.jsx)(s.E,{colorScheme:"blue",mt:1,children:e.position})]}),e.description&&(0,K.jsx)(T.E,{fontSize:"sm",color:"gray.600",children:e.description}),(0,K.jsxs)(f.T,{align:"start",spacing:1,children:[e.email&&(0,K.jsxs)(y.z,{spacing:2,children:[(0,K.jsx)(v.I,{as:P.pHD,color:"blue.500"}),(0,K.jsx)(b.N,{href:"mailto:".concat(e.email),color:"blue.500",fontSize:"sm",children:e.email})]}),e.phone&&(0,K.jsxs)(y.z,{spacing:2,children:[(0,K.jsx)(v.I,{as:P.QFc,color:"blue.500"}),(0,K.jsx)(b.N,{href:"tel:".concat(e.phone),color:"blue.500",fontSize:"sm",children:e.phone})]})]})]})},e.id))})},t)}):i.map(t=>{const n=((null===$||void 0===$?void 0:$.categories)||{})[t]||[];return(0,K.jsx)(w.K,{pt:4,children:n.length>0?(0,K.jsx)(g.r,{columns:{base:1,sm:2},spacing:4,children:n.map(e=>(0,K.jsx)(l.a,{bg:V,p:4,borderRadius:"md",borderWidth:"1px",borderColor:H,children:(0,K.jsxs)(f.T,{align:"start",spacing:3,children:[e.image_url&&(0,K.jsx)(r.e,{src:(0,O.V)(e.image_url),name:e.name,size:"lg"}),(0,K.jsxs)(l.a,{children:[(0,K.jsx)(E.D,{size:"sm",children:e.name}),e.position&&(0,K.jsx)(s.E,{colorScheme:"blue",mt:1,children:e.position})]}),e.description&&(0,K.jsx)(T.E,{fontSize:"sm",color:"gray.600",children:e.description}),(0,K.jsxs)(f.T,{align:"start",spacing:1,children:[e.email&&(0,K.jsxs)(y.z,{spacing:2,children:[(0,K.jsx)(v.I,{as:P.pHD,color:"blue.500"}),(0,K.jsx)(b.N,{href:"mailto:".concat(e.email),color:"blue.500",fontSize:"sm",children:e.email})]}),e.phone&&(0,K.jsxs)(y.z,{spacing:2,children:[(0,K.jsx)(v.I,{as:P.QFc,color:"blue.500"}),(0,K.jsx)(b.N,{href:"tel:".concat(e.phone),color:"blue.500",fontSize:"sm",children:e.phone})]})]})]})},e.id))}):(0,K.jsx)(T.E,{color:"gray.500",children:e("contact.no_contacts")})},t)}),o&&(0,K.jsx)(w.K,{pt:4,children:(0,K.jsx)(g.r,{columns:{base:1,sm:2},spacing:4,children:c.map(e=>(0,K.jsx)(l.a,{bg:V,p:4,borderRadius:"md",borderWidth:"1px",borderColor:H,children:(0,K.jsxs)(f.T,{align:"start",spacing:3,children:[e.image_url&&(0,K.jsx)(r.e,{src:(0,O.V)(e.image_url),name:e.name,size:"lg"}),(0,K.jsxs)(l.a,{children:[(0,K.jsx)(E.D,{size:"sm",children:e.name}),e.position&&(0,K.jsx)(s.E,{colorScheme:"blue",mt:1,children:e.position})]}),e.description&&(0,K.jsx)(T.E,{fontSize:"sm",color:"gray.600",children:e.description}),(0,K.jsxs)(f.T,{align:"start",spacing:1,children:[e.email&&(0,K.jsxs)(y.z,{spacing:2,children:[(0,K.jsx)(v.I,{as:P.pHD,color:"blue.500"}),(0,K.jsx)(b.N,{href:"mailto:".concat(e.email),color:"blue.500",fontSize:"sm",children:e.email})]}),e.phone&&(0,K.jsxs)(y.z,{spacing:2,children:[(0,K.jsx)(v.I,{as:P.QFc,color:"blue.500"}),(0,K.jsx)(b.N,{href:"tel:".concat(e.phone),color:"blue.500",fontSize:"sm",children:e.phone})]})]})]})},e.id))})})]})]})})()})]})]})]}):null})()]}),(0,K.jsx)(h.c,{}),(0,K.jsxs)(l.a,{children:[(0,K.jsx)(E.D,{size:"lg",mb:2,color:(null===n||void 0===n?void 0:n.primaryColor)||"brand.500",children:e("contact.contact_us")}),(0,K.jsx)(T.E,{color:"gray.500",children:e("contact.contact_description")})]}),(0,K.jsx)(l.a,{bg:B,borderRadius:"lg",borderWidth:"1px",borderColor:Z,boxShadow:"sm",p:6,children:(0,K.jsx)("form",{onSubmit:ae(e=>{se(e)}),children:(0,K.jsxs)(f.T,{spacing:4,children:[(0,K.jsxs)(m.MJ,{isInvalid:!!oe.name,children:[(0,K.jsx)(x.l,{htmlFor:"name",children:e("contact.name_label")}),(0,K.jsx)(j.p,(0,a.A)({id:"name",placeholder:e("contact.name_placeholder")},ne("name",{required:e("contact.name_required"),minLength:{value:2,message:e("contact.name_min_length")}}))),(0,K.jsx)(p.Wt,{children:oe.name&&oe.name.message})]}),(0,K.jsxs)(m.MJ,{isInvalid:!!oe.email,children:[(0,K.jsx)(x.l,{htmlFor:"email",children:e("contact.email_label")}),(0,K.jsx)(j.p,(0,a.A)({id:"email",type:"email",placeholder:e("contact.email_placeholder")},ne("email",{required:e("contact.email_required"),pattern:{value:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,message:e("contact.email_invalid")}}))),(0,K.jsx)(p.Wt,{children:oe.email&&oe.email.message})]}),(0,K.jsxs)(m.MJ,{isInvalid:!!oe.subject,children:[(0,K.jsx)(x.l,{htmlFor:"subject",children:e("contact.subject_label")}),(0,K.jsx)(j.p,(0,a.A)({id:"subject",placeholder:e("contact.subject_placeholder")},ne("subject",{required:e("contact.subject_required"),maxLength:{value:100,message:e("contact.subject_max_length")}}))),(0,K.jsx)(p.Wt,{children:oe.subject&&oe.subject.message})]}),(0,K.jsxs)(m.MJ,{isInvalid:!!oe.message,children:[(0,K.jsx)(x.l,{htmlFor:"message",children:e("contact.message_label")}),(0,K.jsx)(A.T,(0,a.A)({id:"message",rows:6,placeholder:e("contact.message_placeholder")},ne("message",{required:e("contact.message_required"),minLength:{value:10,message:e("contact.message_min_length")},maxLength:{value:2e3,message:e("contact.message_max_length")}}))),(0,K.jsx)(p.Wt,{children:oe.message&&oe.message.message})]}),(0,K.jsx)(c.$,{type:"submit",colorScheme:(null===n||void 0===n?void 0:n.primaryColor)||"brand",size:"lg",width:"full",mt:4,isLoading:le,loadingText:e("contact.sending"),"data-umami-event":"Contact Form Submit",children:e("contact.send_message")})]})})})]})})})}},97278:(e,t,n)=>{function a(e){const t=String(null!==e&&void 0!==e?e:"");if(!t)return"";const n={CZ:"\u010cesk\xe1 republika",SK:"Slovensko",PL:"Polsko",DE:"N\u011bmecko",AT:"Rakousko",UA:"Ukrajina",FR:"Francie",ES:"\u0160pan\u011blsko",IT:"It\xe1lie",GB:"Anglie",UK:"Velk\xe1 Brit\xe1nie",US:"USA",BR:"Braz\xedlie",AR:"Argentina",PT:"Portugalsko",NL:"Nizozemsko",BE:"Belgie",CH:"\u0160v\xfdcarsko",SE:"\u0160v\xe9dsko",NO:"Norsko",DK:"D\xe1nsko",FI:"Finsko",RU:"Rusko",HR:"Chorvatsko",RS:"Srbsko",SI:"Slovinsko",HU:"Ma\u010farsko",RO:"Rumunsko",BG:"Bulharsko",GR:"\u0158ecko",TR:"Turecko",JP:"Japonsko",CN:"\u010c\xedna",KR:"Ji\u017en\xed Korea",AU:"Austr\xe1lie",NZ:"Nov\xfd Z\xe9land",CA:"Kanada",MX:"Mexiko",IE:"Irsko",IS:"Island"},a={Czechia:"\u010cesk\xe1 republika","Czech Republic":"\u010cesk\xe1 republika",Slovakia:"Slovensko",Poland:"Polsko",Germany:"N\u011bmecko",Austria:"Rakousko",Ukraine:"Ukrajina",France:"Francie",Spain:"\u0160pan\u011blsko",Italy:"It\xe1lie",England:"Anglie","United Kingdom":"Velk\xe1 Brit\xe1nie","United States":"USA",Brazil:"Braz\xedlie",Argentina:"Argentina",Portugal:"Portugalsko",Netherlands:"Nizozemsko",Belgium:"Belgie",Switzerland:"\u0160v\xfdcarsko",Sweden:"\u0160v\xe9dsko",Norway:"Norsko",Denmark:"D\xe1nsko",Finland:"Finsko",Russia:"Rusko",Croatia:"Chorvatsko",Serbia:"Srbsko",Slovenia:"Slovinsko",Hungary:"Ma\u010farsko",Romania:"Rumunsko",Bulgaria:"Bulharsko",Greece:"\u0158ecko",Turkey:"Turecko",Japan:"Japonsko",China:"\u010c\xedna","South Korea":"Ji\u017en\xed Korea",Australia:"Austr\xe1lie","New Zealand":"Nov\xfd Z\xe9land",Canada:"Kanada",Mexico:"Mexiko",Ireland:"Irsko",Iceland:"Island","Bosnia and Herzegovina":"Bosna a Hercegovina",Montenegro:"\u010cern\xe1 Hora","North Macedonia":"Severn\xed Makedonie",Albania:"Alb\xe1nie",Luxembourg:"Lucembursko",Moldova:"Moldavsko",Lithuania:"Litva",Latvia:"Loty\u0161sko",Estonia:"Estonsko",Belarus:"B\u011blorusko"},i=t.toUpperCase();if(n[i])return n[i];const o=t.toLowerCase();for(const[r,s]of Object.entries(a))if(r.toLowerCase()===o)return s;return t}function i(e){if(!e)return"";const t=String(e).trim().toUpperCase();return/^[A-Z]{2}$/.test(t)?t.replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0))):""}function o(e){if(!e)return"";const t=String(e).trim();if(!t)return"";if(/^[A-Za-z]{2}$/.test(t)){return i("UK"===t.toUpperCase()?"GB":t.toUpperCase())}const n={Czechia:"CZ","Czech Republic":"CZ","\u010cesk\xe1 republika":"CZ",Slovakia:"SK",Slovensko:"SK",Poland:"PL",Polsko:"PL",Germany:"DE","N\u011bmecko":"DE",Austria:"AT",Rakousko:"AT",Ukraine:"UA",Ukrajina:"UA",France:"FR",Francie:"FR",Spain:"ES","\u0160pan\u011blsko":"ES",Italy:"IT","It\xe1lie":"IT",England:"GB","United Kingdom":"GB","Velk\xe1 Brit\xe1nie":"GB","United States":"US",USA:"US",Brazil:"BR",Argentina:"AR",Portugal:"PT",Netherlands:"NL",Nizozemsko:"NL",Belgium:"BE",Belgie:"BE",Switzerland:"CH","\u0160v\xfdcarsko":"CH",Sweden:"SE","\u0160v\xe9dsko":"SE",Norway:"NO",Norsko:"NO",Denmark:"DK","D\xe1nsko":"DK",Finland:"FI",Finsko:"FI",Russia:"RU",Rusko:"RU",Croatia:"HR",Chorvatsko:"HR",Serbia:"RS",Srbsko:"RS",Slovenia:"SI",Slovinsko:"SI",Hungary:"HU","Ma\u010farsko":"HU",Romania:"RO",Rumunsko:"RO",Bulgaria:"BG",Bulharsko:"BG",Greece:"GR","\u0158ecko":"GR",Turkey:"TR",Turecko:"TR",Japan:"JP",Japonsko:"JP",China:"CN","\u010c\xedna":"CN","South Korea":"KR","Ji\u017en\xed Korea":"KR",Australia:"AU","Austr\xe1lie":"AU","New Zealand":"NZ","Nov\xfd Z\xe9land":"NZ",Canada:"CA",Kanada:"CA",Mexico:"MX",Mexiko:"MX",Ireland:"IE",Irsko:"IE",Iceland:"IS",Island:"IS","Bosnia and Herzegovina":"BA","Bosna a Hercegovina":"BA",Montenegro:"ME","\u010cern\xe1 Hora":"ME","North Macedonia":"MK","Severn\xed Makedonie":"MK",Albania:"AL","Alb\xe1nie":"AL",Luxembourg:"LU",Lucembursko:"LU",Moldova:"MD",Moldavsko:"MD",Lithuania:"LT",Litva:"LT",Latvia:"LV","Loty\u0161sko":"LV",Estonia:"EE",Estonsko:"EE",Belarus:"BY","B\u011blorusko":"BY"},a=n[t]||n[t.replace(/\s+/g," ").trim()]||n[t.toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())];return a?i(a):""}n.d(t,{Pd:()=>a,xg:()=>o})},97399:(e,t,n)=>{n.r(t),n.d(t,{default:()=>I});var a=n(89379),i=n(65043),o=n(88787),r=n(85871),s=n(87139),l=n(22107),c=n(98662),d=n(83169),u=n(24330),h=n(98939),m=n(82459),p=n(73225),x=n(76668),g=n(73212),v=n(35699),j=n(73669),b=n(76659),y=n(96148),f=n(10202),k=n(98481),_=n(30502),w=n(28846),z=n(39081),S=n(35475),A=n(73216),C=n(72526),E=n(59781),T=n(12836),D=n(16834),N=n(57550),R=n(40384),F=n(82047),P=n(70579);const I=()=>{const[e]=(0,S.ok)(),t=e.get("token")||"",n=(0,_.d)(),I=(0,A.Zp)(),M=(0,E.jE)(),{data:L,isLoading:W,isError:U}=(0,C.I)({queryKey:["newsletter","prefs",t],queryFn:()=>(0,D.lX)(t),enabled:!!t}),{data:O}=(0,N.s)(),q=null===O||void 0===O?void 0:O.club_id,K=(null===O||void 0===O?void 0:O.club_type)||"football",{data:B}=(0,C.I)({queryKey:["facr","competitions",q,K],queryFn:async()=>{if(!q)return[];return await R.J.getClubCompetitions(q,K)||[]},enabled:!!q}),Z=(0,i.useMemo)(()=>(0,a.A)({blogs:!0,matches:!0,events:!0,scores:!0,weekly:!0},(null===L||void 0===L?void 0:L.preferences)||{}),[L]),[V,H]=(0,i.useState)(Z);i.useEffect(()=>{H(Z)},[Z]),i.useEffect(()=>{if(Array.isArray(B)&&B.length>0){if(!String(V.competitions||"").trim()){const e=B.map((e,t)=>String((null===e||void 0===e?void 0:e.code)||(null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.name)||"comp-".concat(t))).filter(Boolean);e.length>0&&H(t=>(0,a.A)((0,a.A)({},t),{},{competitions:e.join(", ")}))}}},[B]);const $=(0,T.n)({mutationFn:()=>(0,D.SF)(t,V),onSuccess:()=>{n({title:"Preference ulo\u017eeny",status:"success"}),M.invalidateQueries({queryKey:["newsletter","prefs",t]}),(0,F.sx)("Newsletter Preferences Saved",{blogs:V.blogs,matches:V.matches,events:V.events,scores:V.scores})},onError:e=>{var t,a;return n({title:"Chyba p\u0159i ukl\xe1d\xe1n\xed",description:String((null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.error)||(null===e||void 0===e?void 0:e.message)||e),status:"error"})}}),J=(0,T.n)({mutationFn:()=>(0,D.Nd)(t),onSuccess:()=>{n({title:"Odb\u011br byl zru\u0161en",status:"success"}),M.invalidateQueries({queryKey:["newsletter","prefs",t]}),(0,F.sx)("Newsletter Unsubscribe",{success:!0,source:"preferences_page"}),setTimeout(()=>I("/"),1500)},onError:e=>{var t,a;return n({title:"Chyba p\u0159i odhl\xe1\u0161en\xed",description:String((null===e||void 0===e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.error)||(null===e||void 0===e?void 0:e.message)||e),status:"error"})}}),G=(0,i.useMemo)(()=>{const e=V.competitions||"";return new Set(e.split(",").map(e=>e.trim()).filter(Boolean))},[V.competitions]);if(!t)return(0,P.jsx)(l.a,{maxW:"640px",mx:"auto",p:6,children:(0,P.jsxs)(o.F,{status:"error",borderRadius:"md",children:[(0,P.jsx)(r._,{}),"Chyb\xed parametr token v adrese."]})});if(W)return(0,P.jsx)(h.m,{maxW:"container.md",py:8,children:(0,P.jsxs)(y.z,{children:[(0,P.jsx)(b.y,{}),(0,P.jsx)(z.E,{children:"Na\u010d\xedt\xe1n\xed\u2026"})]})});if(U||!L)return(0,P.jsx)(l.a,{maxW:"640px",mx:"auto",p:6,children:(0,P.jsxs)(o.F,{status:"error",borderRadius:"md",children:[(0,P.jsx)(r._,{}),"Neplatn\xfd nebo expirovan\xfd token."]})});const X=e=>H((0,a.A)((0,a.A)({},V),{},{blogs:e,matches:e,events:e,scores:e,weekly:e}));return(0,P.jsxs)(h.m,{maxW:"container.md",py:8,children:[(0,P.jsxs)(y.z,{mb:2,align:"center",children:[(0,P.jsx)(w.D,{size:"lg",children:"Nastaven\xed newsletteru"}),(0,P.jsx)(j.h,{}),(0,P.jsx)(c.$,{size:"sm",variant:"outline",onClick:()=>X(!0),children:"Zapnout v\u0161e"}),(0,P.jsx)(c.$,{size:"sm",variant:"ghost",onClick:()=>X(!1),children:"Vypnout v\u0161e"})]}),(0,P.jsxs)(y.z,{mb:6,color:"gray.600",children:[(0,P.jsx)(z.E,{children:"Spravujte, jak\xe9 e-maily chcete dost\xe1vat na adresu"}),(0,P.jsx)(s.E,{colorScheme:L.is_active?"green":"red",children:L.email})]}),(0,P.jsx)(d.Z,{mb:6,children:(0,P.jsx)(u.b,{children:(0,P.jsxs)(f.T,{spacing:6,align:"stretch",children:[(0,P.jsxs)(g.r,{columns:{base:1,md:2},spacing:4,children:[(0,P.jsxs)(p.MJ,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,P.jsx)(x.l,{m:0,children:"\u010cl\xe1nky (blog)"}),(0,P.jsx)(k.d,{isChecked:!!V.blogs,onChange:e=>H((0,a.A)((0,a.A)({},V),{},{blogs:e.target.checked}))})]}),(0,P.jsxs)(p.MJ,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,P.jsx)(x.l,{m:0,children:"Nadch\xe1zej\xedc\xed z\xe1pasy"}),(0,P.jsx)(k.d,{isChecked:!!V.matches,onChange:e=>H((0,a.A)((0,a.A)({},V),{},{matches:e.target.checked}))})]}),(0,P.jsxs)(p.MJ,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,P.jsx)(x.l,{m:0,children:"Ud\xe1losti"}),(0,P.jsx)(k.d,{isChecked:!!V.events,onChange:e=>H((0,a.A)((0,a.A)({},V),{},{events:e.target.checked}))})]}),(0,P.jsxs)(p.MJ,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,P.jsx)(x.l,{m:0,children:"V\xfdsledky (souhrn t\xfddne)"}),(0,P.jsx)(k.d,{isChecked:!!V.scores,onChange:e=>H((0,a.A)((0,a.A)({},V),{},{scores:e.target.checked}))})]}),(0,P.jsxs)(p.MJ,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,P.jsx)(x.l,{m:0,children:"T\xfddenn\xed souhrn (digest)"}),(0,P.jsx)(k.d,{isChecked:!!V.weekly,onChange:e=>H((0,a.A)((0,a.A)({},V),{},{weekly:e.target.checked}))})]})]}),(0,P.jsx)(m.c,{}),(0,P.jsxs)(p.MJ,{children:[(0,P.jsx)(x.l,{children:"Preferovan\xe9 sout\u011b\u017ee"}),Array.isArray(B)&&B.length>0?(0,P.jsxs)(f.T,{align:"stretch",spacing:1,maxH:"220px",overflowY:"auto",borderWidth:"1px",borderRadius:"md",p:3,children:[(0,P.jsxs)(y.z,{mb:1,children:[(0,P.jsx)(c.$,{size:"xs",variant:"outline",onClick:()=>{const e=B.map((e,t)=>String((null===e||void 0===e?void 0:e.code)||(null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.name)||"comp-".concat(t))).filter(Boolean);H((0,a.A)((0,a.A)({},V),{},{competitions:e.join(", ")}))},children:"Zapnout v\u0161e"}),(0,P.jsx)(c.$,{size:"xs",variant:"ghost",onClick:()=>H((0,a.A)((0,a.A)({},V),{},{competitions:""})),children:"Vypnout v\u0161e"})]}),B.map((e,t)=>{const n=(null===e||void 0===e?void 0:e.code)||(null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.name)||"comp-".concat(t),i=(null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.code)||n,o=G.has(String(n));return(0,P.jsxs)(y.z,{justify:"space-between",children:[(0,P.jsx)(z.E,{children:i}),(0,P.jsx)(k.d,{isChecked:o,onChange:e=>((e,t)=>{const n=new Set(G);t?n.add(e):n.delete(e);const i=Array.from(n).join(", ");H((0,a.A)((0,a.A)({},V),{},{competitions:i}))})(String(n),e.target.checked)})]},n)})]}):(0,P.jsx)(v.p,{placeholder:"nap\u0159. 5LM, POH",value:V.competitions||"",onChange:e=>H((0,a.A)((0,a.A)({},V),{},{competitions:e.target.value}))}),(0,P.jsx)(z.E,{mt:2,fontSize:"sm",color:"gray.500",children:"Pokud nen\xed seznam k dispozici, m\u016f\u017eete zadat k\xf3dy sout\u011b\u017e\xed ru\u010dn\u011b, odd\u011blen\xe9 \u010d\xe1rkou."})]})]})})}),(0,P.jsxs)(y.z,{spacing:3,pt:2,borderTopWidth:"1px",children:[(0,P.jsx)(c.$,{colorScheme:"blue",onClick:()=>$.mutate(),isLoading:$.isLoading,"data-umami-event":"Save Preferences",children:"Ulo\u017eit"}),(0,P.jsx)(c.$,{variant:"outline",onClick:()=>M.invalidateQueries({queryKey:["newsletter","prefs",t]}),"data-umami-event":"Refresh Preferences",children:"Obnovit"}),(0,P.jsx)(j.h,{}),(0,P.jsx)(c.$,{colorScheme:"red",variant:"outline",onClick:()=>J.mutate(),isLoading:J.isLoading,"data-umami-event":"Unsubscribe","data-umami-event-source":"preferences",children:"Zru\u0161it odb\u011br"})]})]})}},97717:(e,t,n)=>{n.d(t,{A:()=>h});n(65043);var a=n(98662),i=n(44093),o=n(25011),r=n(96148),s=n(10202),l=n(39081),c=n(1009),d=n(25189),u=n(70579);const h=e=>{let{url:t,name:n,mimeType:h="",size:m,buttonOnly:p=!1}=e;const x=(0,d.uq)(t)||t,g=n||t.split("/").pop()||"file",v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:34;const n=String(e||"").trim();if(n.length<=t)return n;const a=n.lastIndexOf("."),i=a>0?n.slice(a):"",o=Math.max(10,t-(i.length+3));return"".concat(n.slice(0,o),"\u2026").concat(i)}(g),j=h.toLowerCase(),b=(0,i.dU)("gray.200","gray.700"),y=(0,i.dU)("white","gray.800"),f=(0,i.dU)("gray.600","gray.300"),k=j.startsWith("image/")?{type:"image",icon:c.fZZ,color:"purple.500",canPreview:!0}:"application/pdf"===j?{type:"pdf",icon:c.jH2,color:"red.500",canPreview:!0}:j.startsWith("video/")?{type:"video",icon:c.pVQ,color:"pink.500",canPreview:!0}:j.startsWith("audio/")?{type:"audio",icon:c.$Mw,color:"green.500",canPreview:!0}:j.includes("word")||j.includes("document")?{type:"document",icon:c.jH2,color:"blue.500",canPreview:!1}:j.includes("sheet")||j.includes("excel")?{type:"spreadsheet",icon:c.QuH,color:"green.600",canPreview:!1}:j.includes("presentation")||j.includes("powerpoint")?{type:"presentation",icon:c.QuH,color:"orange.500",canPreview:!1}:{type:"other",icon:c.QuH,color:"gray.500",canPreview:!1},_="number"===typeof m?Math.round(m/1024):void 0,w=_&&_>1024?(_/1024).toFixed(1):void 0,z=w?"".concat(w," MB"):_?"".concat(_," kB"):"",S=async()=>{const e=()=>{try{const e=document.createElement("a");e.href=x,e.setAttribute("download",g),document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(e){}};try{const t=await fetch(x);if(!t.ok)return e();const n=await t.blob(),a=URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.setAttribute("download",g),document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(()=>URL.revokeObjectURL(a),2e3)}catch(t){e()}};return p?(0,u.jsx)(a.$,{size:"xs",leftIcon:(0,u.jsx)(c.a4x,{}),colorScheme:"blue",variant:"outline",onClick:S,children:"St\xe1hnout"}):(0,u.jsxs)(r.z,{justify:"space-between",p:3,borderWidth:"1px",borderColor:b,borderRadius:"md",bg:y,flexWrap:"wrap",w:"100%",children:[(0,u.jsxs)(r.z,{flex:1,minW:0,children:[(0,u.jsx)(o.I,{as:k.icon,color:k.color,flexShrink:0}),(0,u.jsxs)(s.T,{align:"start",spacing:0,flex:1,minW:0,children:[(0,u.jsx)(l.E,{fontWeight:"medium",isTruncated:!0,maxW:"100%",children:v}),z&&(0,u.jsx)(l.E,{fontSize:"xs",color:f,children:z})]})]}),(0,u.jsx)(r.z,{spacing:2,flexShrink:0,children:(0,u.jsx)(a.$,{size:"sm",leftIcon:(0,u.jsx)(c.a4x,{}),colorScheme:"blue",onClick:S,children:"St\xe1hnout"})})]})}},98202:(e,t,n)=>{n.r(t),n.d(t,{default:()=>g});n(65043);var a=n(40378),i=n(22107),o=n(98939),r=n(82459),s=n(33572),l=n(29904),c=n(28846),d=n(39081),u=n(57550),h=n(74117),m=n(25189),p=n(81398),x=n(70579);const g=()=>{const{data:e}=(0,u.s)(),{t:t}=(0,h.Bd)();return(0,x.jsxs)(a.A,{children:[(0,x.jsx)(o.m,{maxW:"7xl",py:{base:6,md:10},children:(0,x.jsxs)(l.B,{spacing:8,children:[(0,x.jsxs)(l.B,{direction:{base:"column",md:"row"},align:{base:"flex-start",md:"center"},spacing:6,children:[(null===e||void 0===e?void 0:e.club_logo_url)&&(0,x.jsx)(s._,{src:(0,m.uq)(e.club_logo_url),alt:(null===e||void 0===e?void 0:e.club_name)||"Logo",boxSize:{base:"64px",md:"80px"},objectFit:"contain"}),(0,x.jsxs)(i.a,{children:[(0,x.jsx)(c.D,{as:"h1",size:"xl",children:(null===e||void 0===e?void 0:e.club_name)||t("nav.club")}),(0,x.jsx)(d.E,{color:"gray.600",children:t("about.club_info")})]})]}),null!==e&&void 0!==e&&e.about_html?(0,x.jsx)(i.a,{children:(0,x.jsx)(i.a,{className:"prose",color:"gray.800",dangerouslySetInnerHTML:{__html:e.about_html}})}):(0,x.jsxs)(i.a,{children:[(0,x.jsx)(c.D,{as:"h2",size:"md",mb:3,children:"Zna\u010dka a identita"}),(0,x.jsx)(d.E,{color:"gray.700",children:"Zde m\u016f\u017ee b\xfdt popis historie, vize a hodnot klubu. Dopln\xedme dle pot\u0159eby v dal\u0161\xed iteraci."})]}),(0,x.jsx)(r.c,{}),(0,x.jsxs)(i.a,{children:[(0,x.jsx)(c.D,{as:"h2",size:"md",mb:3,children:"Stadion"}),(0,x.jsx)(d.E,{color:"gray.700",children:"Informace o stadionu, adresa, kapacita a fotografie (voliteln\xe9)."})]})]})}),(0,x.jsx)(p.A,{})]})}},98405:(e,t,n)=>{n.r(t),n.d(t,{default:()=>L});var a=n(65043),i=n(27024),o=n(87139),r=n(22107),s=n(98662),l=n(42703),c=n(44093),d=n(98939),u=n(73225),h=n(76668),m=n(73212),p=n(33572),x=n(35699),g=n(7189),v=n(88019),j=n(61724),b=n(96148),y=n(10202),f=n(14566),k=n(31411),_=n(10227),w=n(51794),z=n(3109),S=n(30502),A=n(28846),C=n(39081),E=n(29066),T=n(46291),D=n(87904),N=n(9976),R=n(65505),F=n(50516),P=n(50797),I=n(88500),M=n(70579);const L=()=>{var e;const{user:t,updateUser:n}=(0,E.A)(),L=e=>{const t=String(e||"").trim();if(!t)return{fn:"",ln:""};const n=t.split(/\s+/);return 1===n.length?{fn:n[0],ln:""}:{fn:n[0],ln:n.slice(1).join(" ")}},W=L(null===t||void 0===t?void 0:t.name),[U,O]=(0,a.useState)(W.fn),[q,K]=(0,a.useState)(W.ln),[B,Z]=(0,a.useState)(!1),[V,H]=(0,a.useState)(""),$=(0,S.d)();(0,a.useEffect)(()=>{const e=L(null===t||void 0===t?void 0:t.name);O(e.fn),K(e.ln)},[null===t||void 0===t?void 0:t.name]),(0,a.useEffect)(()=>{(async()=>{try{var e;const t=await T.Ay.get("/newsletter/token/me");H((null===(e=t.data)||void 0===e?void 0:e.token)||"")}catch(t){}})()},[]);const J=async()=>{je(!0);try{const e=await(0,D.E$)();ge(e),we(e.username||"")}finally{je(!1)}};(0,a.useEffect)(()=>{J(),(async()=>{ke(!0);try{ye(await(0,D.gB)())}finally{ke(!1)}})()},[]),(0,a.useEffect)(()=>{(async()=>{ie(!0);try{const e=await(0,D.kP)({limit:100});re(e)}finally{ie(!1)}})(),(async()=>{le(!0);try{const e=await(0,D.$_)();de(e.achievements||[])}finally{le(!1)}})()},[]),(0,a.useEffect)(()=>{const e=()=>{J().catch(()=>{})};return window.addEventListener("engagement:refresh",e),()=>window.removeEventListener("engagement:refresh",e)},[]);const G=V?"/newsletter/preferences?token=".concat(encodeURIComponent(V)):"",[X,Y]=(0,a.useState)("points"),[Q,ee]=(0,a.useState)([]),[te,ne]=(0,a.useState)(!1),[ae,ie]=(0,a.useState)(!1),[oe,re]=(0,a.useState)([]),[se,le]=(0,a.useState)(!1),[ce,de]=(0,a.useState)([]),[ue,he]=(0,a.useState)(!1),[me,pe]=(0,a.useState)([]);(0,a.useEffect)(()=>{(async()=>{try{he(!0);const e=await(0,N.uw)();pe((e.items||[]).map(e=>({id:e.id,prize_name:e.prize_name,claim_status:e.claim_status,created_at:e.created_at})))}catch(e){pe([])}finally{he(!1)}})()},[]);const[xe,ge]=(0,a.useState)(null),[ve,je]=(0,a.useState)(!0),[be,ye]=(0,a.useState)([]),[fe,ke]=(0,a.useState)(!1),[_e,we]=(0,a.useState)(""),[ze,Se]=(0,a.useState)(!1),Ae=(0,c.dU)("white","gray.800"),Ce=(0,c.dU)("gray.200","gray.700");(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{ne(!0);const t=await(0,D.Ee)(X,20);e&&ee(t.items||[])}catch(t){e&&ee([])}finally{e&&ne(!1)}})(),()=>{e=!1}},[X]);const Ee=(0,a.useMemo)(()=>{if(!xe)return{level:1,xp:0,currentBase:0,nextBase:100,pct:0};const e=Math.max(1,Number(xe.level||1)),t=Number(xe.xp||0),n=50*(e-1)*e,a=100*e,i=n+a,o=Math.max(0,t-n);return{level:e,xp:t,currentBase:n,nextBase:i,pct:Math.max(0,Math.min(100,Math.floor(o/Math.max(1,a)*100))),inLevel:o,nextInc:a}},[xe]),Te=(0,c.dU)("gray.800","gray.100"),De=(0,a.useMemo)(()=>{const e=Ee.level;return e>=20?"yellow.400":e>=15?"purple.400":e>=10?"blue.400":e>=5?"teal.400":Te},[Ee.level,Te]);return(0,M.jsxs)(d.m,{maxW:"5xl",py:8,children:[(0,M.jsx)(A.D,{size:"lg",mb:6,children:"Fan z\xf3na"}),(0,M.jsx)(r.a,{borderWidth:"1px",borderColor:Ce,bg:Ae,borderRadius:"lg",p:5,mb:6,textAlign:"center",children:(0,M.jsxs)(y.T,{spacing:3,align:"center",children:[(0,M.jsxs)(r.a,{position:"relative",display:"inline-block",children:[(0,M.jsx)(i.e,{size:"2xl",name:(null===t||void 0===t?void 0:t.name)||(null===xe||void 0===xe?void 0:xe.username)||"U\u017eivatel",src:(null===xe||void 0===xe?void 0:xe.animated_avatar_url)||(null===xe||void 0===xe?void 0:xe.avatar_url)||void 0}),(0,M.jsx)(l.K,{"aria-label":"Nahr\xe1t avatar",icon:(0,M.jsx)(P.A,{size:16}),size:"sm",variant:"solid",colorScheme:"blue",position:"absolute",left:"-10px",top:"50%",transform:"translateY(-50%)",onClick:()=>{if(null===xe||void 0===xe||!xe.avatar_upload_unlocked){$({status:"info",title:"Odemkn\u011bte nahr\xe1n\xed avataru",description:"V obchod\u011b n\xed\u017ee m\u016f\u017eete odemknout mo\u017enost nahr\xe1t vlastn\xed profilov\xfd obr\xe1zek.",duration:3500});const e=document.getElementById("rewards-store");return void(e&&e.scrollIntoView({behavior:"smooth"}))}const e=document.getElementById("avatar-upload-panel");e&&e.scrollIntoView({behavior:"smooth",block:"center"})}}),(0,M.jsxs)(o.E,{position:"absolute",right:"-10px",top:"50%",transform:"translateY(-50%)",colorScheme:"yellow",fontSize:"0.8rem",p:2,borderRadius:"md",children:["Lv ",Ee.level]}),(0,M.jsx)(l.K,{"aria-label":"N\xe1hodn\xfd avatar",icon:(0,M.jsx)(F.A,{size:16}),size:"xs",variant:"ghost",position:"absolute",bottom:"-6px",right:"50%",transform:"translateX(50%)",onClick:async()=>{const e=Math.random().toString(36).slice(2,10),t="https://api.dicebear.com/7.x/pixel-art/svg?radius=50&seed=".concat(encodeURIComponent(e));await(0,D.Gu)({avatar_url:t}),await J(),$({status:"success",title:"N\xe1hodn\xfd avatar nastaven"})}})]}),(null===xe||void 0===xe?void 0:xe.avatar_upload_unlocked)&&(0,M.jsx)(r.a,{id:"avatar-upload-panel",mt:4,children:(0,M.jsx)(I.A,{label:"Nahr\xe1t avatar",description:"Nahrajte vlastn\xed profilov\xfd obr\xe1zek.",accept:"image/*,image/gif",multiple:!1,maxFiles:1,uploadFn:async e=>{var t,n;if(null===xe||void 0===xe||!xe.avatar_upload_unlocked)throw new Error("Nahr\xe1n\xed avataru nen\xed odem\u010deno.");const a=new FormData;a.append("file",e);const i=await T.Ay.post("/upload",a,{headers:{"Content-Type":"multipart/form-data"}}),o=(null===(t=i.data)||void 0===t?void 0:t.url)||(null===(n=i.data)||void 0===n?void 0:n.absolute_url);if(!o)throw new Error("Upload selhal");return await(0,D.Gu)({avatar_url:o}),await J(),{url:o,name:e.name,type:e.type||"image/*",size:e.size||0}},allowUrlImport:!1})}),(0,M.jsxs)(b.z,{spacing:2,children:[!ze&&(0,M.jsx)(C.E,{fontSize:"xl",fontWeight:"700",color:De,children:((null===xe||void 0===xe?void 0:xe.username)||"").trim()||"Nastavte u\u017eivatelsk\xe9 jm\xe9no"}),(0,M.jsx)(l.K,{"aria-label":"Upravit",size:"xs",variant:"ghost",icon:(0,M.jsx)(R.A,{size:16}),onClick:()=>Se(e=>!e)})]}),ze&&(0,M.jsxs)(b.z,{spacing:2,children:[(0,M.jsx)(x.p,{value:_e,onChange:e=>we(e.target.value),placeholder:"u\u017eivatelsk\xe9-jm\xe9no",maxW:"260px"}),(0,M.jsx)(s.$,{colorScheme:"blue",size:"sm",isLoading:ze,onClick:async()=>{const e=_e.trim();if(e)try{Se(!0),await(0,D.Uy)({username:e}),$({status:"success",title:"U\u017eivatelsk\xe9 jm\xe9no ulo\u017eeno"}),await J()}catch(a){var t,n;$({status:"error",title:"Chyba",description:(null===a||void 0===a||null===(t=a.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nelze ulo\u017eit"})}finally{Se(!1)}else $({status:"warning",title:"U\u017eivatelsk\xe9 jm\xe9no je pr\xe1zdn\xe9"})},children:"Ulo\u017eit"})]}),(0,M.jsx)(C.E,{color:(0,c.dU)("gray.600","gray.400"),children:"".concat(U||""," ").concat(q||"").trim()||"\u2014"}),(0,M.jsxs)(b.z,{w:"100%",maxW:"lg",spacing:3,align:"center",children:[(0,M.jsxs)(r.a,{flex:1,children:[(0,M.jsx)(v.k,{value:Ee.pct,size:"md",borderRadius:"full",colorScheme:"blue"}),(0,M.jsxs)(C.E,{fontSize:"sm",color:(0,c.dU)("gray.600","gray.400"),mt:1,children:[Ee.inLevel||0," / ",Ee.nextInc," XP do dal\u0161\xed \xfarovn\u011b"]})]}),(0,M.jsxs)(o.E,{colorScheme:"yellow",children:["Lv ",Ee.level]})]}),(0,M.jsxs)(C.E,{children:["Aktu\xe1ln\xed body: ",(0,M.jsx)(C.E,{as:"span",fontWeight:"700",children:null!==(e=null===xe||void 0===xe?void 0:xe.points)&&void 0!==e?e:0})]})]})}),(0,M.jsxs)(r.a,{id:"rewards-store",borderWidth:"1px",borderColor:Ce,bg:Ae,borderRadius:"lg",p:5,mb:8,children:[(0,M.jsx)(A.D,{size:"md",mb:3,children:"Obchod s odm\u011bnami"}),fe?(0,M.jsx)(C.E,{children:"Na\u010d\xedt\xe1m\u2026"}):(0,M.jsx)(m.r,{minChildWidth:"220px",spacing:4,children:be.map(e=>(0,M.jsx)(r.a,{borderWidth:"1px",borderColor:Ce,borderRadius:"md",p:3,children:(0,M.jsxs)(y.T,{align:"stretch",spacing:2,children:[(0,M.jsx)(C.E,{fontWeight:"700",children:e.name}),e.image_url&&(0,M.jsx)(p._,{src:e.image_url,alt:e.name,borderRadius:"md"}),(0,M.jsxs)(C.E,{fontSize:"sm",color:(0,c.dU)("gray.600","gray.400"),children:["Cena: ",e.cost_points," bod\u016f"]}),(0,M.jsx)(s.$,{size:"sm",colorScheme:"blue",onClick:async()=>{try{const t=await(0,D.Ao)(e.id);$({status:"success",title:"Odm\u011bna uplatn\u011bna",description:t.status}),await J()}catch(a){var t,n;$({status:"error",title:"Chyba",description:(null===a||void 0===a||null===(t=a.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Nelze uplatnit odm\u011bnu"})}},children:"Uplatnit"})]})},e.id))}),(0,M.jsxs)(r.a,{mt:4,children:[(0,M.jsx)(A.D,{size:"sm",mb:2,children:"Jak z\xedskat body"}),(0,M.jsxs)(y.T,{align:"start",spacing:1,fontSize:"sm",color:(0,c.dU)("gray.700","gray.300"),children:[(0,M.jsx)(C.E,{children:"\u2022 Napi\u0161te smyslupln\xfd koment\xe1\u0159 (+5)"}),(0,M.jsx)(C.E,{children:"\u2022 Hlasujte v anket\u011b (+3, 1\xd7 denn\u011b)"}),(0,M.jsx)(C.E,{children:"\u2022 P\u0159ihlaste se k newsletteru (+12)"})]})]})]}),(0,M.jsxs)(z.t,{colorScheme:"blue",isFitted:!0,variant:"enclosed",children:[(0,M.jsxs)(k.w,{children:[(0,M.jsx)(f.o,{children:"Osobn\xed \xfadaje"}),(0,M.jsx)(f.o,{children:"Newsletter"}),(0,M.jsx)(f.o,{children:"\u017deb\u0159\xed\u010dky"}),(0,M.jsx)(f.o,{children:"Historie bod\u016f"}),(0,M.jsx)(f.o,{children:"\xdasp\u011bchy"}),(0,M.jsx)(f.o,{children:"V\xfdhry"})]}),(0,M.jsxs)(w.T,{children:[(0,M.jsx)(_.K,{children:(0,M.jsx)(r.a,{as:"form",onSubmit:async e=>{e.preventDefault(),Z(!0);try{var t;const e=null===(t=(await T.Ay.put("/me",{first_name:U,last_name:q})).data)||void 0===t?void 0:t.user;if(e){const t="".concat(e.first_name||U," ").concat(e.last_name||q).trim();n({name:t})}$({title:"Ulo\u017eeno",description:"Osobn\xed \xfadaje byly aktualizov\xe1ny.",status:"success",duration:3e3})}catch(o){var a,i;$({title:"Chyba",description:(null===o||void 0===o||null===(a=o.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||"Nelze ulo\u017eit zm\u011bny",status:"error"})}finally{Z(!1)}},maxW:"lg",children:(0,M.jsxs)(y.T,{align:"stretch",spacing:4,children:[(0,M.jsxs)(u.MJ,{children:[(0,M.jsx)(h.l,{children:"Jm\xe9no"}),(0,M.jsx)(x.p,{value:U,onChange:e=>O(e.target.value),placeholder:"Jm\xe9no"})]}),(0,M.jsxs)(u.MJ,{children:[(0,M.jsx)(h.l,{children:"P\u0159\xedjmen\xed"}),(0,M.jsx)(x.p,{value:q,onChange:e=>K(e.target.value),placeholder:"P\u0159\xedjmen\xed"})]}),(0,M.jsx)(b.z,{children:(0,M.jsx)(s.$,{type:"submit",colorScheme:"blue",isLoading:B,children:"Ulo\u017eit"})})]})})}),(0,M.jsx)(_.K,{children:(0,M.jsxs)(y.T,{align:"start",spacing:4,children:[(0,M.jsx)(C.E,{children:"Spravujte p\u0159edvolby newsletteru nebo se odhlaste."}),G?(0,M.jsx)(s.$,{as:g.N,href:G,colorScheme:"blue",children:"Otev\u0159\xedt nastaven\xed newsletteru"}):(0,M.jsx)(C.E,{children:"Na\u010d\xedt\xe1m odkaz na nastaven\xed\u2026"})]})}),(0,M.jsx)(_.K,{children:(0,M.jsxs)(y.T,{align:"stretch",spacing:4,children:[(0,M.jsxs)(b.z,{justify:"space-between",children:[(0,M.jsx)(A.D,{size:"md",children:"\u017deb\u0159\xed\u010dky"}),(0,M.jsx)(b.z,{children:(0,M.jsxs)(j.l,{size:"sm",value:X,onChange:e=>Y(e.target.value),maxW:"180px",children:[(0,M.jsx)("option",{value:"points",children:"Body"}),(0,M.jsx)("option",{value:"level",children:"\xdarove\u0148"}),(0,M.jsx)("option",{value:"xp",children:"XP"})]})})]}),(0,M.jsx)(r.a,{borderWidth:"1px",borderColor:Ce,borderRadius:"md",bg:Ae,p:3,children:(0,M.jsxs)(y.T,{align:"stretch",spacing:2,children:[te&&(0,M.jsx)(C.E,{children:"Na\u010d\xedt\xe1m\u2026"}),!te&&0===Q.length&&(0,M.jsx)(C.E,{children:"\u017d\xe1dn\xe1 data k zobrazen\xed."}),!te&&Q.map(e=>{const t="points"===X?e.points:"level"===X?e.level:e.xp,n=Math.max(...Q.map(e=>"points"===X?e.points:"level"===X?e.level:e.xp),1),a=Math.max(2,Math.floor(Number(t)/Number(n)*100)),s=(e.username||"").trim()||"".concat(e.first_name||""," ").concat(e.last_name||"").trim()||"#".concat(e.user_id);return(0,M.jsxs)(b.z,{spacing:3,children:[(0,M.jsx)(o.E,{colorScheme:"blue",children:e.rank}),(0,M.jsx)(i.e,{size:"sm",name:s,src:e.animated_avatar_url||e.avatar_url||void 0}),(0,M.jsxs)(r.a,{flex:1,children:[(0,M.jsxs)(b.z,{justify:"space-between",children:[(0,M.jsx)(C.E,{fontWeight:"600",noOfLines:1,children:s}),(0,M.jsx)(C.E,{fontSize:"sm",children:t})]}),(0,M.jsx)(v.k,{value:a,size:"sm",colorScheme:"blue",borderRadius:"full",mt:1})]})]},"".concat(X,"-").concat(e.user_id))})]})})]})}),(0,M.jsx)(_.K,{children:(0,M.jsx)(y.T,{align:"stretch",spacing:3,children:ae?(0,M.jsx)(C.E,{children:"Na\u010d\xedt\xe1m\u2026"}):(0,M.jsx)(r.a,{borderWidth:"1px",borderColor:Ce,borderRadius:"md",overflowX:"auto",children:(0,M.jsxs)(r.a,{as:"table",w:"100%",style:{borderCollapse:"collapse"},children:[(0,M.jsx)(r.a,{as:"thead",bg:(0,c.dU)("gray.50","gray.700"),children:(0,M.jsxs)(r.a,{as:"tr",children:[(0,M.jsx)(r.a,{as:"th",p:2,textAlign:"left",children:"\u010cas"}),(0,M.jsx)(r.a,{as:"th",p:2,textAlign:"left",children:"Delta"}),(0,M.jsx)(r.a,{as:"th",p:2,textAlign:"left",children:"D\u016fvod"}),(0,M.jsx)(r.a,{as:"th",p:2,textAlign:"left",children:"Meta"})]})}),(0,M.jsxs)(r.a,{as:"tbody",children:[oe.map(e=>(0,M.jsxs)(r.a,{as:"tr",borderTopWidth:"1px",borderColor:Ce,children:[(0,M.jsx)(r.a,{as:"td",p:2,children:e.created_at?new Date(e.created_at).toLocaleString():"-"}),(0,M.jsx)(r.a,{as:"td",p:2,children:(0,M.jsx)(o.E,{colorScheme:e.delta>=0?"green":"red",children:e.delta>=0?"+".concat(e.delta):e.delta})}),(0,M.jsx)(r.a,{as:"td",p:2,children:(0,M.jsx)(o.E,{children:e.reason})}),(0,M.jsx)(r.a,{as:"td",p:2,children:(0,M.jsx)(C.E,{fontSize:"xs",noOfLines:1,children:e.meta?JSON.stringify(e.meta):"-"})})]},e.id)),0===oe.length&&(0,M.jsx)(r.a,{as:"tr",children:(0,M.jsx)(r.a,{as:"td",p:3,colSpan:4,children:(0,M.jsx)(C.E,{color:(0,c.dU)("gray.600","gray.400"),children:"\u017d\xe1dn\xe9 transakce."})})})]})]})})})}),(0,M.jsx)(_.K,{children:(0,M.jsx)(y.T,{align:"stretch",spacing:3,children:se?(0,M.jsx)(C.E,{children:"Na\u010d\xedt\xe1m\u2026"}):(0,M.jsxs)(m.r,{minChildWidth:"220px",spacing:4,children:[ce.map(e=>(0,M.jsx)(r.a,{borderWidth:"1px",borderColor:Ce,borderRadius:"md",p:3,bg:Ae,children:(0,M.jsxs)(y.T,{align:"stretch",spacing:1,children:[(0,M.jsxs)(b.z,{justify:"space-between",children:[(0,M.jsx)(C.E,{fontWeight:"600",children:e.title}),e.achieved?(0,M.jsx)(o.E,{colorScheme:"green",children:"Spln\u011bno"}):(0,M.jsx)(o.E,{colorScheme:"gray",children:"Nespln\u011bno"})]}),(0,M.jsx)(C.E,{fontSize:"sm",color:(0,c.dU)("gray.600","gray.400"),children:e.description}),(0,M.jsxs)(b.z,{children:[(0,M.jsxs)(o.E,{children:[e.points," bod\u016f"]}),e.achieved_at&&(0,M.jsx)(C.E,{fontSize:"xs",color:(0,c.dU)("gray.500","gray.400"),children:new Date(e.achieved_at).toLocaleString()})]})]})},e.id)),0===ce.length&&(0,M.jsx)(C.E,{color:(0,c.dU)("gray.600","gray.400"),children:"\u017d\xe1dn\xe9 \xfasp\u011bchy k zobrazen\xed."})]})})})]})]})]})}},99356:(e,t,n)=>{n.r(t),n.d(t,{default:()=>he});var a=n(30502),i=n(96870),o=n(44093),r=n(55395),s=n(67813),l=n(96148),c=n(33572),d=n(25011),u=n(10202),h=n(39081),m=n(87139),p=n(42703),x=n(99956),g=n(28846),v=n(98662),j=n(88787),b=n(85871),y=n(22107),f=n(33430),k=n(34334),_=n(73669),w=n(88019),z=n(3109),S=n(31411),A=n(14566),C=n(51794),E=n(10227),T=n(45973),D=n(29244),N=n(35699),R=n(61724),F=n(80511),P=n(3313),I=n(83201),M=n(82595),L=n(91751),W=n(82459),U=n(78460),O=n(11054),q=n(85421),K=n(15071),B=n(35929),Z=n(67516),V=n(7189),H=n(56529),$=n(29904),J=n(65043),G=n(59781),X=n(72526),Y=n(12836),Q=n(1009),ee=n(6583),te=n(35200),ne=n(46291);const ae=async()=>(await ne.Ay.get("/admin/files/unused")).data,ie=async()=>(await ne.Ay.get("/admin/files/duplicates")).data,oe=async()=>(await ne.Ay.get("/admin/files/usage")).data,re=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];await ne.Ay.delete("/admin/files/".concat(e),{params:{force:t}})},se=async()=>(await ne.Ay.post("/admin/files/scan",{})).data,le=async e=>(await ne.Ay.post("/admin/files/refresh-tracking",{},{params:e?{entity_type:e}:{}})).data,ce=e=>{if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return Math.round(e/Math.pow(1024,t)*100)/100+" "+["B","KB","MB","GB"][t]};var de=n(25189),ue=n(70579);const he=()=>{var e,t;const n=(0,a.d)(),he=(0,G.jE)(),[me,pe]=(0,J.useState)(""),[xe,ge]=(0,J.useState)(""),[ve,je]=(0,J.useState)(null),[be,ye]=(0,J.useState)(null),[fe,ke]=(0,J.useState)(!1),[_e,we]=(0,J.useState)(null),[ze,Se]=(0,J.useState)(null),[Ae,Ce]=(0,J.useState)(!1),[Ee,Te]=(0,J.useState)(!1),{confirm:De}=(0,te.G)(),{isOpen:Ne,onOpen:Re,onClose:Fe}=(0,i.j)(),{isOpen:Pe,onOpen:Ie,onClose:Me}=(0,i.j)(),{isOpen:Le,onOpen:We,onClose:Ue}=(0,i.j)(),{isOpen:Oe,onOpen:qe,onClose:Ke}=(0,i.j)(),Be=(0,o.dU)("gray.200","gray.600"),Ze=(0,o.dU)("gray.50","gray.700"),Ve=(0,J.useRef)(!1),{data:He=[],isLoading:$e,refetch:Je}=(0,X.I)({queryKey:["admin-files",me,xe],queryFn:()=>(async e=>(await ne.Ay.get("/admin/files",{params:e})).data)({search:me,mime_type:xe})}),{data:Ge=[]}=(0,X.I)({queryKey:["admin-files-unused"],queryFn:ae}),{data:Xe={}}=(0,X.I)({queryKey:["admin-files-duplicates"],queryFn:ie}),{data:Ye}=(0,X.I)({queryKey:["admin-files-usage"],queryFn:oe}),Qe=(0,Y.n)({mutationFn:e=>{let{id:t,force:n}=e;return re(t,n)},onSuccess:()=>{n({title:"Soubor smaz\xe1n",status:"success"}),he.invalidateQueries({queryKey:["admin-files"]}),he.invalidateQueries({queryKey:["admin-files-unused"]}),he.invalidateQueries({queryKey:["admin-files-duplicates"]}),he.invalidateQueries({queryKey:["admin-files-usage"]}),Me(),ye(null),ke(!1)},onError:e=>{var t,a,i;409===(null===(t=e.response)||void 0===t?void 0:t.status)?(ke(!1),n({title:"Soubor je pou\u017e\xedv\xe1n",description:"Soubor je pou\u017e\xedv\xe1n. Zkontrolujte pou\u017eit\xed a potvr\u010fte smaz\xe1n\xed.",status:"warning",duration:5e3})):n({title:"Chyba p\u0159i maz\xe1n\xed",description:(null===e||void 0===e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||"Nepoda\u0159ilo se smazat soubor",status:"error"})}}),et=(0,Y.n)({mutationFn:se,onSuccess:e=>{we(e),We(),he.invalidateQueries({queryKey:["admin-files"]}),he.invalidateQueries({queryKey:["admin-files-unused"]}),he.invalidateQueries({queryKey:["admin-files-duplicates"]}),he.invalidateQueries({queryKey:["admin-files-usage"]})},onError:()=>{n({title:"Chyba p\u0159i skenov\xe1n\xed",status:"error"})}}),tt=(0,Y.n)({mutationFn:le,onSuccess:e=>{Se(e),qe(),he.invalidateQueries({queryKey:["admin-files"]}),he.invalidateQueries({queryKey:["admin-files-unused"]}),he.invalidateQueries({queryKey:["admin-files-duplicates"]})},onError:()=>{n({title:"Chyba p\u0159i aktualizaci sledov\xe1n\xed",status:"error"})}});(0,J.useEffect)(()=>{Ve.current||(Ve.current=!0,(async()=>{try{await se()}catch(e){n({title:"Automatick\xe9 skenov\xe1n\xed selhalo",status:"error"})}try{await le()}catch(e){n({title:"Automatick\xe1 aktualizace sledov\xe1n\xed selhala",status:"error"})}he.invalidateQueries({queryKey:["admin-files"]}),he.invalidateQueries({queryKey:["admin-files-unused"]}),he.invalidateQueries({queryKey:["admin-files-duplicates"]}),he.invalidateQueries({queryKey:["admin-files-usage"]})})())},[he,n]);const nt=e=>(0,de.uq)(e)||e,at=(0,J.useMemo)(()=>{const e=new Set;return He.forEach(t=>{if(t.mime_type){const n=t.mime_type.split("/")[0];e.add(n)}}),Array.from(e)},[He]),it=e=>{var t,a;let{file:i,showUsageCount:o=!0}=e;return(0,ue.jsxs)(r.Tr,{_hover:{bg:Ze},children:[(0,ue.jsx)(s.Td,{children:(0,ue.jsxs)(l.z,{children:[null!==(t=i.mime_type)&&void 0!==t&&t.startsWith("image/")?(0,ue.jsx)(c._,{src:nt(i.file_url),alt:i.filename,boxSize:"40px",objectFit:"cover",borderRadius:"md",fallbackSrc:"/article-placeholder.svg"}):(0,ue.jsx)(d.I,{as:(g=i.mime_type||"",g.startsWith("image/")?Q.fZZ:"application/pdf"===g?Q.jH2:g.startsWith("video/")?Q.pVQ:Q.QuH),boxSize:6,color:"blue.500"}),(0,ue.jsxs)(u.T,{align:"start",spacing:0,children:[(0,ue.jsx)(h.E,{fontWeight:"medium",fontSize:"sm",children:i.filename}),(0,ue.jsx)(h.E,{fontSize:"xs",color:"gray.500",children:i.file_path})]})]})}),(0,ue.jsx)(s.Td,{fontSize:"sm",children:ce(i.file_size)}),(0,ue.jsx)(s.Td,{fontSize:"sm",children:(0,ue.jsx)(m.E,{colorScheme:null!==(a=i.mime_type)&&void 0!==a&&a.startsWith("image/")?"blue":"gray",children:i.mime_type})}),o&&(0,ue.jsx)(s.Td,{children:(0,ue.jsxs)(l.z,{children:[(0,ue.jsx)(m.E,{colorScheme:i.usage_count>0?"green":"red",children:i.usage_count}),i.usage_count>0&&(0,ue.jsx)(p.K,{"aria-label":"Zobrazit pou\u017eit\xed",icon:(0,ue.jsx)(Q.HaR,{}),size:"xs",variant:"ghost",onClick:()=>(e=>{je(e),Re()})(i)})]})}),(0,ue.jsx)(s.Td,{fontSize:"sm",children:new Date(i.created_at).toLocaleDateString("cs-CZ")}),(0,ue.jsx)(s.Td,{children:(0,ue.jsxs)(l.z,{spacing:1,children:[(0,ue.jsx)(x.m,{label:"Kop\xedrovat URL",children:(0,ue.jsx)(p.K,{"aria-label":"Kop\xedrovat URL",icon:(0,ue.jsx)(Q.nxz,{}),size:"sm",variant:"ghost",onClick:()=>{return e=i.file_url,navigator.clipboard.writeText(e),void n({title:"Zkop\xedrov\xe1no",status:"success",duration:2e3});var e}})}),(0,ue.jsx)(x.m,{label:"Smazat",children:(0,ue.jsx)(p.K,{"aria-label":"Smazat",icon:(0,ue.jsx)(Q.IXo,{}),size:"sm",variant:"ghost",colorScheme:"red",onClick:()=>(e=>{ye(e),ke(!1),Ie()})(i)})})]})})]});var g},ot=Object.entries(Xe);return(0,ue.jsxs)(ee.A,{requireAdmin:!0,children:[(0,ue.jsxs)(u.T,{align:"stretch",spacing:6,children:[(0,ue.jsxs)(l.z,{justify:"space-between",children:[(0,ue.jsx)(g.D,{size:"lg",children:"Spr\xe1va soubor\u016f"}),(0,ue.jsxs)(l.z,{spacing:2,children:[(0,ue.jsx)(v.$,{leftIcon:(0,ue.jsx)(Q.jTZ,{}),onClick:()=>tt.mutate(void 0),isLoading:tt.isPending,colorScheme:"green",size:"sm",variant:"outline",children:"Aktualizovat sledov\xe1n\xed"}),(0,ue.jsx)(v.$,{leftIcon:(0,ue.jsx)(Q.jTZ,{}),onClick:()=>et.mutate(),isLoading:et.isPending,colorScheme:"blue",size:"sm",children:"Skenovat soubory"})]})]}),Ye&&(0,ue.jsxs)(u.T,{align:"stretch",spacing:2,children:[("warn"===Ye.status||"critical"===Ye.status)&&(0,ue.jsxs)(j.F,{status:"critical"===Ye.status?"error":"warning",borderRadius:"md",children:[(0,ue.jsx)(b._,{}),(0,ue.jsxs)(y.a,{children:[(0,ue.jsx)(f.X,{children:"critical"===Ye.status?"\xdalo\u017ei\u0161t\u011b t\xe9m\u011b\u0159 pln\xe9":"Doch\xe1z\xed m\xedsto v \xfalo\u017ei\u0161ti"}),(0,ue.jsxs)(k.T,{children:["Vyu\u017eito ",Ye.percent.toFixed(1),"% (",ce(Ye.used_bytes)," z ",ce(Ye.quota_bytes),")."]})]})]}),(0,ue.jsxs)(l.z,{children:[(0,ue.jsx)(h.E,{fontWeight:"medium",children:"Vyu\u017eit\xed \xfalo\u017ei\u0161t\u011b"}),(0,ue.jsx)(_.h,{}),(0,ue.jsxs)(h.E,{fontSize:"sm",color:"gray.500",children:[ce(Ye.used_bytes)," / ",ce(Ye.quota_bytes)," (",Ye.percent.toFixed(1),"%)"]})]}),(0,ue.jsx)(w.k,{value:Math.min(100,Ye.percent),colorScheme:"critical"===Ye.status?"red":"warn"===Ye.status?"orange":"blue",height:"10px",borderRadius:"md"})]}),(0,ue.jsxs)(z.t,{colorScheme:"blue",variant:"enclosed",children:[(0,ue.jsxs)(S.w,{children:[(0,ue.jsxs)(A.o,{children:["V\u0161echny soubory (",He.length,")"]}),(0,ue.jsxs)(A.o,{children:["Nepou\u017e\xedvan\xe9 (",Ge.length,")"]}),(0,ue.jsxs)(A.o,{children:["Duplicity (",ot.length,")"]})]}),(0,ue.jsxs)(C.T,{children:[(0,ue.jsx)(E.K,{children:(0,ue.jsxs)(u.T,{align:"stretch",spacing:4,children:[0===He.length&&!$e&&(0,ue.jsxs)(j.F,{status:"info",borderRadius:"md",children:[(0,ue.jsx)(b._,{}),(0,ue.jsxs)(y.a,{flex:"1",children:[(0,ue.jsx)(f.X,{children:"\u017d\xe1dn\xe9 soubory v datab\xe1zi"}),(0,ue.jsx)(k.T,{children:'Klikn\u011bte na tla\u010d\xedtko "Skenovat soubory" pro na\u010dten\xed soubor\u016f z uploads slo\u017eky do datab\xe1ze.'})]})]}),(0,ue.jsxs)(l.z,{spacing:4,children:[(0,ue.jsxs)(T.M,{maxW:"400px",children:[(0,ue.jsx)(D.W,{pointerEvents:"none",children:(0,ue.jsx)(Q.CKj,{})}),(0,ue.jsx)(N.p,{placeholder:"Hledat soubory...",value:me,onChange:e=>pe(e.target.value)})]}),(0,ue.jsx)(R.l,{placeholder:"V\u0161echny typy",maxW:"200px",value:xe,onChange:e=>ge(e.target.value),children:at.map(e=>(0,ue.jsx)("option",{value:e,children:e},e))}),(0,ue.jsx)(_.h,{}),(0,ue.jsxs)(h.E,{fontSize:"sm",color:"gray.500",children:["Celkem: ",He.length," soubor\u016f"]})]}),(0,ue.jsx)(y.a,{overflowX:"auto",borderWidth:"1px",borderRadius:"md",borderColor:Be,children:(0,ue.jsxs)(F.X,{size:"sm",children:[(0,ue.jsx)(P.d,{children:(0,ue.jsxs)(r.Tr,{children:[(0,ue.jsx)(I.Th,{children:"Soubor"}),(0,ue.jsx)(I.Th,{children:"Velikost"}),(0,ue.jsx)(I.Th,{children:"Typ"}),(0,ue.jsx)(I.Th,{children:"Pou\u017eit\xed"}),(0,ue.jsx)(I.Th,{children:"Vytvo\u0159eno"}),(0,ue.jsx)(I.Th,{children:"Akce"})]})}),(0,ue.jsx)(M.N,{children:$e?(0,ue.jsx)(r.Tr,{children:(0,ue.jsx)(s.Td,{colSpan:6,textAlign:"center",py:8,children:"Na\u010d\xedt\xe1n\xed..."})}):0===He.length?(0,ue.jsx)(r.Tr,{children:(0,ue.jsx)(s.Td,{colSpan:6,textAlign:"center",py:8,children:"\u017d\xe1dn\xe9 soubory nenalezeny"})}):He.map(e=>(0,ue.jsx)(it,{file:e},e.id))})]})})]})}),(0,ue.jsx)(E.K,{children:(0,ue.jsxs)(u.T,{align:"stretch",spacing:4,children:[(0,ue.jsxs)(j.F,{status:"info",borderRadius:"md",children:[(0,ue.jsx)(b._,{}),(0,ue.jsxs)(y.a,{children:[(0,ue.jsx)(f.X,{children:"Nepou\u017e\xedvan\xe9 soubory"}),(0,ue.jsx)(k.T,{children:"Tyto soubory nejsou pou\u017eity v \u017e\xe1dn\xe9m \u010dl\xe1nku, hr\xe1\u010di, sponzorovi nebo jin\xe9 entit\u011b."})]})]}),(0,ue.jsxs)(l.z,{children:[(0,ue.jsx)(_.h,{}),(0,ue.jsx)(v.$,{leftIcon:(0,ue.jsx)(Q.IXo,{}),colorScheme:"red",size:"sm",onClick:async()=>{if(0===Ge.length)return;if(!await De({title:"Vymazat nepou\u017e\xedvan\xe9 soubory",message:"Opravdu chcete smazat ".concat(Ge.length," nepou\u017e\xedvan\xfdch soubor\u016f? Tuto akci nelze vr\xe1tit."),confirmText:"Vymazat",cancelText:"Zru\u0161it",isDanger:!0}))return;Ce(!0);let e=0,t=0;for(const n of Ge)try{await re(n.id,!1),e++}catch(a){t++}Ce(!1),he.invalidateQueries({queryKey:["admin-files"]}),he.invalidateQueries({queryKey:["admin-files-unused"]}),he.invalidateQueries({queryKey:["admin-files-duplicates"]}),he.invalidateQueries({queryKey:["admin-files-usage"]}),n({title:"Hromadn\xe9 maz\xe1n\xed dokon\u010deno",description:"Smaz\xe1no ".concat(e," / ").concat(Ge.length,". Chyby: ").concat(t,"."),status:t>0?"warning":"success"})},isLoading:Ae,isDisabled:0===Ge.length,children:"Vymazat v\u0161e"})]}),(0,ue.jsx)(y.a,{overflowX:"auto",borderWidth:"1px",borderRadius:"md",borderColor:Be,children:(0,ue.jsxs)(F.X,{size:"sm",children:[(0,ue.jsx)(P.d,{children:(0,ue.jsxs)(r.Tr,{children:[(0,ue.jsx)(I.Th,{children:"Soubor"}),(0,ue.jsx)(I.Th,{children:"Velikost"}),(0,ue.jsx)(I.Th,{children:"Typ"}),(0,ue.jsx)(I.Th,{children:"Vytvo\u0159eno"}),(0,ue.jsx)(I.Th,{children:"Akce"})]})}),(0,ue.jsx)(M.N,{children:0===Ge.length?(0,ue.jsx)(r.Tr,{children:(0,ue.jsx)(s.Td,{colSpan:5,textAlign:"center",py:8,children:"V\u0161echny soubory jsou pou\u017e\xedv\xe1ny"})}):Ge.map(e=>(0,ue.jsx)(it,{file:e,showUsageCount:!1},e.id))})]})})]})}),(0,ue.jsx)(E.K,{children:(0,ue.jsxs)(u.T,{align:"stretch",spacing:4,children:[(0,ue.jsxs)(j.F,{status:"warning",borderRadius:"md",children:[(0,ue.jsx)(b._,{}),(0,ue.jsxs)(y.a,{children:[(0,ue.jsx)(f.X,{children:"Duplicitn\xed soubory"}),(0,ue.jsx)(k.T,{children:"Tyto soubory maj\xed identick\xfd obsah (MD5 hash). M\u016f\u017eete je smazat a aktualizovat odkazy."})]})]}),(0,ue.jsxs)(l.z,{children:[(0,ue.jsx)(_.h,{}),(0,ue.jsx)(v.$,{leftIcon:(0,ue.jsx)(Q.IXo,{}),colorScheme:"red",size:"sm",onClick:async()=>{if(0===ot.length)return;if(!await De({title:"Vymazat duplicitn\xed soubory",message:"Smazat v\u0161echny duplicitn\xed soubory bez pou\u017eit\xed? V ka\u017ed\xe9 skupin\u011b bude ponech\xe1n 1 soubor. Pou\u017e\xedvan\xe9 soubory budou p\u0159esko\u010deny.",confirmText:"Vymazat",cancelText:"Zru\u0161it",isDanger:!0}))return;Te(!0);const e=[];ot.forEach(t=>{let[,n]=t;if(n.length<=1)return;const a=[...n].sort((e,t)=>new Date(e.created_at).getTime()-new Date(t.created_at).getTime()),[,...i]=a;i.forEach(t=>{var n;0===(null!==(n=t.usage_count)&&void 0!==n?n:0)&&e.push(t)})});let t=0,a=0,i=0;for(const n of e)try{await re(n.id,!1),t++}catch(o){i++}ot.forEach(e=>{let[,t]=e;if(t.length<=1)return;const n=[...t].sort((e,t)=>new Date(e.created_at).getTime()-new Date(t.created_at).getTime()),[,...i]=n;i.forEach(e=>{var t;(null!==(t=e.usage_count)&&void 0!==t?t:0)>0&&a++})}),Te(!1),he.invalidateQueries({queryKey:["admin-files"]}),he.invalidateQueries({queryKey:["admin-files-unused"]}),he.invalidateQueries({queryKey:["admin-files-duplicates"]}),he.invalidateQueries({queryKey:["admin-files-usage"]}),n({title:"Maz\xe1n\xed duplicit dokon\u010deno",description:"Smaz\xe1no ".concat(t,", p\u0159esko\u010deno (pou\u017eit\xe9) ").concat(a,", chyby ").concat(i,"."),status:i>0?"warning":"success"})},isLoading:Ee,isDisabled:0===ot.length,children:"Vymazat v\u0161e"})]}),0===ot.length?(0,ue.jsx)(y.a,{textAlign:"center",py:8,children:(0,ue.jsx)(h.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 duplicity nenalezeny"})}):ot.map(e=>{let[t,n]=e;return(0,ue.jsx)(y.a,{borderWidth:"1px",borderRadius:"md",p:4,borderColor:Be,children:(0,ue.jsxs)(u.T,{align:"stretch",spacing:2,children:[(0,ue.jsxs)(l.z,{children:[(0,ue.jsx)(Q.eHT,{color:"orange"}),(0,ue.jsxs)(h.E,{fontWeight:"bold",fontSize:"sm",children:["Duplicitn\xed skupina (",n.length," soubor\u016f)"]}),(0,ue.jsxs)(L.C,{fontSize:"xs",children:[t.substring(0,12),"..."]})]}),(0,ue.jsx)(W.c,{}),(0,ue.jsxs)(F.X,{size:"sm",variant:"simple",children:[(0,ue.jsx)(P.d,{children:(0,ue.jsxs)(r.Tr,{children:[(0,ue.jsx)(I.Th,{children:"Soubor"}),(0,ue.jsx)(I.Th,{children:"Velikost"}),(0,ue.jsx)(I.Th,{children:"Pou\u017eit\xed"}),(0,ue.jsx)(I.Th,{children:"Vytvo\u0159eno"}),(0,ue.jsx)(I.Th,{children:"Akce"})]})}),(0,ue.jsx)(M.N,{children:n.map(e=>(0,ue.jsx)(it,{file:e},e.id))})]})]})},t)})]})})]})]})]}),(0,ue.jsxs)(U.aF,{isOpen:Ne,onClose:Fe,size:"xl",children:[(0,ue.jsx)(O.m,{}),(0,ue.jsxs)(q.$,{children:[(0,ue.jsx)(K.r,{children:"Pou\u017eit\xed souboru"}),(0,ue.jsx)(B.s,{}),(0,ue.jsx)(Z.c,{children:ve&&(0,ue.jsxs)(u.T,{align:"stretch",spacing:4,children:[(0,ue.jsxs)(l.z,{children:[(null===(e=ve.mime_type)||void 0===e?void 0:e.startsWith("image/"))&&(0,ue.jsx)(c._,{src:nt(ve.file_url),alt:ve.filename,maxH:"100px",borderRadius:"md"}),(0,ue.jsxs)(u.T,{align:"start",flex:1,children:[(0,ue.jsx)(h.E,{fontWeight:"bold",children:ve.filename}),(0,ue.jsx)(h.E,{fontSize:"sm",color:"gray.500",children:ve.file_path})]})]}),(0,ue.jsx)(W.c,{}),(0,ue.jsxs)(u.T,{align:"stretch",spacing:2,children:[(0,ue.jsxs)(h.E,{fontWeight:"bold",children:["Pou\u017e\xedv\xe1no v (",ve.usage_count,"):"]}),ve.usages&&ve.usages.length>0?ve.usages.map(e=>{var t,n,a;return(0,ue.jsx)(y.a,{p:3,borderWidth:"1px",borderRadius:"md",children:(0,ue.jsxs)(l.z,{justify:"space-between",children:[(0,ue.jsxs)(u.T,{align:"start",spacing:0,children:[(0,ue.jsx)(m.E,{colorScheme:"purple",children:e.entity_type}),(0,ue.jsx)(h.E,{fontSize:"sm",mt:1,children:(null===(t=e.entity_info)||void 0===t?void 0:t.title)||(null===(n=e.entity_info)||void 0===n?void 0:n.name)||"ID: ".concat(e.entity_id)}),e.field_name&&(0,ue.jsxs)(h.E,{fontSize:"xs",color:"gray.500",children:["Pole: ",e.field_name]})]}),(null===(a=e.entity_info)||void 0===a?void 0:a.url)&&(0,ue.jsx)(V.N,{href:e.entity_info.url,isExternal:!0,children:(0,ue.jsx)(p.K,{"aria-label":"Otev\u0159\xedt",icon:(0,ue.jsx)(Q.HaR,{}),size:"sm",variant:"ghost"})})]})},e.id)}):(0,ue.jsx)(h.E,{color:"gray.500",fontSize:"sm",children:"Soubor nen\xed nikde pou\u017eit"})]})]})}),(0,ue.jsx)(H.j,{children:(0,ue.jsx)(v.$,{onClick:Fe,children:"Zav\u0159\xedt"})})]})]}),(0,ue.jsxs)(U.aF,{isOpen:Pe,onClose:Me,children:[(0,ue.jsx)(O.m,{}),(0,ue.jsxs)(q.$,{children:[(0,ue.jsx)(K.r,{children:"Smazat soubor"}),(0,ue.jsx)(B.s,{}),(0,ue.jsx)(Z.c,{children:be&&(0,ue.jsxs)(u.T,{align:"stretch",spacing:4,children:[(0,ue.jsxs)(h.E,{children:["Opravdu chcete smazat soubor ",(0,ue.jsx)("strong",{children:be.filename}),"?"]}),be.usage_count>0&&(0,ue.jsxs)(j.F,{status:"warning",children:[(0,ue.jsx)(b._,{}),(0,ue.jsxs)(y.a,{children:[(0,ue.jsx)(f.X,{children:"Pozor!"}),(0,ue.jsxs)(k.T,{children:["Tento soubor je pou\u017eit na ",be.usage_count," m\xedstech. Smaz\xe1n\xedm m\u016f\u017ee doj\xedt k nefunk\u010dnosti odkaz\u016f."]})]})]})]})}),(0,ue.jsx)(H.j,{children:(0,ue.jsxs)(l.z,{spacing:3,children:[(0,ue.jsx)(v.$,{variant:"ghost",onClick:Me,children:"Zru\u0161it"}),(0,ue.jsx)(v.$,{colorScheme:"red",onClick:()=>{be&&Qe.mutate({id:be.id,force:fe})},isLoading:Qe.isPending,children:(null!==(t=null===be||void 0===be?void 0:be.usage_count)&&void 0!==t?t:0)>0?"P\u0159esto smazat":"Smazat"})]})})]})]}),(0,ue.jsxs)(U.aF,{isOpen:Le,onClose:Ue,size:"lg",children:[(0,ue.jsx)(O.m,{}),(0,ue.jsxs)(q.$,{children:[(0,ue.jsx)(K.r,{children:"V\xfdsledky skenov\xe1n\xed soubor\u016f"}),(0,ue.jsx)(B.s,{}),(0,ue.jsx)(Z.c,{children:_e&&(0,ue.jsxs)(u.T,{align:"stretch",spacing:4,children:[(0,ue.jsxs)(j.F,{status:"success",borderRadius:"md",children:[(0,ue.jsx)(b._,{}),(0,ue.jsxs)(y.a,{flex:"1",children:[(0,ue.jsx)(f.X,{children:"Skenov\xe1n\xed dokon\u010deno"}),(0,ue.jsx)(k.T,{children:_e.message})]})]}),(0,ue.jsxs)($.B,{spacing:3,children:[(0,ue.jsxs)(l.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,ue.jsx)(h.E,{fontWeight:"medium",children:"Nalezen\xfdch soubor\u016f:"}),(0,ue.jsx)(m.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:_e.found_files})]}),(0,ue.jsxs)(l.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,ue.jsx)(h.E,{fontWeight:"medium",children:"Nov\u011b p\u0159idan\xfdch:"}),(0,ue.jsx)(m.E,{colorScheme:"green",fontSize:"md",px:3,py:1,children:_e.new_files})]}),void 0!==_e.skipped_files&&_e.skipped_files>0&&(0,ue.jsxs)(l.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,ue.jsx)(h.E,{fontWeight:"medium",children:"P\u0159esko\u010den\xfdch (.gitkeep, atd.):"}),(0,ue.jsx)(m.E,{colorScheme:"gray",fontSize:"md",px:3,py:1,children:_e.skipped_files})]}),_e.orphaned_files>0&&(0,ue.jsxs)(l.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",borderColor:"orange.300",children:[(0,ue.jsx)(h.E,{fontWeight:"medium",children:"Osi\u0159el\xfdch z\xe1znam\u016f:"}),(0,ue.jsx)(m.E,{colorScheme:"orange",fontSize:"md",px:3,py:1,children:_e.orphaned_files})]})]}),_e.new_files_list&&_e.new_files_list.length>0&&(0,ue.jsxs)(y.a,{children:[(0,ue.jsx)(h.E,{fontWeight:"bold",mb:2,children:"Nov\u011b p\u0159idan\xe9 soubory:"}),(0,ue.jsx)(y.a,{maxH:"200px",overflowY:"auto",borderWidth:"1px",borderRadius:"md",p:3,children:(0,ue.jsx)(u.T,{align:"stretch",spacing:1,children:_e.new_files_list.map((e,t)=>(0,ue.jsxs)(h.E,{fontSize:"sm",fontFamily:"monospace",children:["\u2713 ",e]},t))})})]}),_e.orphaned_list&&_e.orphaned_list.length>0&&(0,ue.jsxs)(y.a,{children:[(0,ue.jsx)(h.E,{fontWeight:"bold",mb:2,color:"orange.500",children:"Osi\u0159el\xe9 z\xe1znamy (soubory v DB, ale ne na disku):"}),(0,ue.jsx)(y.a,{maxH:"200px",overflowY:"auto",borderWidth:"1px",borderRadius:"md",p:3,borderColor:"orange.300",children:(0,ue.jsx)(u.T,{align:"stretch",spacing:1,children:_e.orphaned_list.map((e,t)=>(0,ue.jsxs)(h.E,{fontSize:"sm",fontFamily:"monospace",color:"orange.600",children:["\u26a0 ",e]},t))})})]})]})}),(0,ue.jsx)(H.j,{children:(0,ue.jsx)(v.$,{colorScheme:"blue",onClick:Ue,children:"Zav\u0159\xedt"})})]})]}),(0,ue.jsxs)(U.aF,{isOpen:Oe,onClose:Ke,size:"lg",children:[(0,ue.jsx)(O.m,{}),(0,ue.jsxs)(q.$,{children:[(0,ue.jsx)(K.r,{children:"V\xfdsledky aktualizace sledov\xe1n\xed"}),(0,ue.jsx)(B.s,{}),(0,ue.jsx)(Z.c,{children:ze&&(0,ue.jsxs)(u.T,{align:"stretch",spacing:4,children:[(0,ue.jsxs)(j.F,{status:"success",children:[(0,ue.jsx)(b._,{}),(0,ue.jsxs)(y.a,{children:[(0,ue.jsx)(f.X,{children:"Sledov\xe1n\xed aktualizov\xe1no!"}),(0,ue.jsx)(k.T,{children:ze.message})]})]}),(0,ue.jsxs)($.B,{spacing:3,children:[(0,ue.jsx)(h.E,{fontWeight:"bold",fontSize:"lg",mb:2,children:"Statistiky:"}),(0,ue.jsxs)(l.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,ue.jsx)(h.E,{fontWeight:"medium",children:"\u010cl\xe1nky:"}),(0,ue.jsx)(m.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:ze.stats.articles_scanned})]}),(0,ue.jsxs)(l.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,ue.jsx)(h.E,{fontWeight:"medium",children:"Aktivity:"}),(0,ue.jsx)(m.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:ze.stats.events_scanned})]}),(0,ue.jsxs)(l.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,ue.jsx)(h.E,{fontWeight:"medium",children:"Hr\xe1\u010di:"}),(0,ue.jsx)(m.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:ze.stats.players_scanned})]}),(0,ue.jsxs)(l.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,ue.jsx)(h.E,{fontWeight:"medium",children:"Sponzo\u0159i:"}),(0,ue.jsx)(m.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:ze.stats.sponsors_scanned})]}),(0,ue.jsxs)(l.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,ue.jsx)(h.E,{fontWeight:"medium",children:"Kontakty:"}),(0,ue.jsx)(m.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:ze.stats.contacts_scanned})]}),(0,ue.jsxs)(l.z,{justify:"space-between",p:3,borderWidth:"1px",borderRadius:"md",children:[(0,ue.jsx)(h.E,{fontWeight:"medium",children:"T\xfdmy:"}),(0,ue.jsx)(m.E,{colorScheme:"blue",fontSize:"md",px:3,py:1,children:ze.stats.teams_scanned})]})]})]})}),(0,ue.jsx)(H.j,{children:(0,ue.jsx)(v.$,{colorScheme:"blue",onClick:Ke,children:"Zav\u0159\xedt"})})]})]})]})}},99863:(e,t,n)=>{n.d(t,{x:()=>u});var a=n(89379),i=n(80045),o=n(22107),r=n(44093),s=n(25011),l=n(28846),c=n(70579);const d=["title","icon","children"],u=e=>{let{title:t,icon:n,children:u}=e,h=(0,i.A)(e,d);return(0,c.jsxs)(o.a,(0,a.A)((0,a.A)({bg:(0,r.dU)("white","gray.800"),p:4,borderRadius:"lg",boxShadow:"sm",borderWidth:"1px",borderColor:(0,r.dU)("gray.200","gray.700"),_hover:{boxShadow:"md"},transition:"all 0.2s"},h),{},{children:[(0,c.jsxs)(l.D,{size:"md",mb:4,display:"flex",alignItems:"center",children:[n&&(0,c.jsx)(s.I,{as:n,mr:2}),t]}),u]}))}}},e=>{e.O(0,[664],()=>{return t=45754,e(e.s=t);var t});e.O()}]);
//# sourceMappingURL=main.dd323bc8.js.map