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

2 lines
3.9 KiB
JavaScript

"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[118],{58118:(e,t,r)=>{r.r(t),r.d(t,{default:()=>m});var o=r(65043),s=r(22107),n=r(98662),i=r(25011),a=r(10202),l=r(28846),c=r(39081),h=r(1009),u=r(70579);class d extends o.Component{constructor(e){super(e),this.resetTimeout=null,this.scheduleAutoReset=()=>{this.resetTimeout&&clearTimeout(this.resetTimeout),this.resetTimeout=setTimeout(()=>{this.handleReset()},3e3)},this.handleReset=()=>{this.resetTimeout&&(clearTimeout(this.resetTimeout),this.resetTimeout=null),this.cleanupDOMElements(),this.setState({hasError:!1,error:null,errorInfo:null}),this.props.onReset&&this.props.onReset()},this.cleanupDOMElements=()=>{try{document.querySelectorAll(".elementor-overlay").forEach(e=>{try{e.remove()}catch(t){console.warn("Failed to remove overlay:",t)}});const c=document.querySelector(".myuibrix-viewport-wrapper");if(c&&c.parentElement)try{const l=c.parentElement;if(l.hasAttribute("data-myuibrix-restore"))Array.from(c.children).forEach(e=>{try{l.appendChild(e)}catch(t){console.warn("Failed to move child:",t)}}),c.remove(),l.removeAttribute("data-myuibrix-restore");else{try{c.classList.remove("myuibrix-viewport-wrapper")}catch(e){}try{c.removeAttribute("data-myuibrix-wrapped")}catch(t){}try{c.style.width=""}catch(r){}try{c.style.maxWidth=""}catch(o){}try{c.style.transition=""}catch(s){}try{c.style.margin=""}catch(n){}try{c.style.transform=""}catch(i){}try{c.style.transformOrigin=""}catch(a){}}}catch(l){console.warn("Failed to cleanup viewport wrapper:",l)}document.body.style.paddingTop="0",document.body.style.backgroundColor="",document.body.style.userSelect=""}catch(l){console.error("Error during DOM cleanup:",l)}},this.state={hasError:!1,error:null,errorInfo:null,errorCount:0}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("MyUIbrix Error Boundary caught an error:",e,t),this.setState(e=>({errorInfo:t,errorCount:e.errorCount+1})),(e.message.includes("removeChild")||e.message.includes("insertBefore")||e.message.includes("replaceChild")||"DOMException"===e.name)&&(console.warn("DOM manipulation error detected - will auto-reset in 3 seconds"),this.scheduleAutoReset())}componentWillUnmount(){this.resetTimeout&&clearTimeout(this.resetTimeout)}render(){if(this.state.hasError&&this.state.error){const e=this.state.error.message.includes("removeChild")||this.state.error.message.includes("insertBefore")||this.state.error.message.includes("replaceChild")||"DOMException"===this.state.error.name;return(0,u.jsx)(s.a,{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",bg:"rgba(0, 0, 0, 0.85)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:99999,children:(0,u.jsxs)(a.T,{spacing:6,bg:"white",p:8,borderRadius:"2xl",boxShadow:"0 20px 60px rgba(0,0,0,0.5)",maxW:"600px",w:"90%",children:[(0,u.jsx)(i.I,{as:h.eHT,boxSize:16,color:"orange.500"}),(0,u.jsxs)(a.T,{spacing:2,children:[(0,u.jsx)(l.D,{size:"lg",color:"gray.800",children:e?"Chyba p\u0159i manipulaci s prvky":"Chyba editoru"}),(0,u.jsx)(c.E,{color:"gray.600",textAlign:"center",children:e?"Nastala chyba p\u0159i p\u0159esouv\xe1n\xed nebo upravov\xe1n\xed prvk\u016f. Editor se automaticky obnov\xed za 3 sekundy.":"V editoru nastala neo\u010dek\xe1van\xe1 chyba. Klikn\u011bte na tla\u010d\xedtko pro obnoven\xed."})]}),!1,(0,u.jsxs)(a.T,{spacing:3,w:"100%",children:[(0,u.jsx)(n.$,{leftIcon:(0,u.jsx)(h.jTZ,{}),colorScheme:"blue",size:"lg",w:"100%",onClick:this.handleReset,children:"Obnovit editor"}),this.state.errorCount>3&&(0,u.jsxs)(c.E,{fontSize:"sm",color:"orange.600",textAlign:"center",children:["\u26a0\ufe0f Opakovan\xe9 chyby (",this.state.errorCount,"x). Zva\u017ete obnoven\xed str\xe1nky."]}),this.state.errorCount>3&&(0,u.jsx)(n.$,{size:"sm",variant:"ghost",colorScheme:"gray",onClick:()=>window.location.reload(),children:"Obnovit celou str\xe1nku"})]})]})})}return this.props.children}}const m=d}}]);
//# sourceMappingURL=118.8a550f36.chunk.js.map