const DEFAULT_DURATION_MS=0xfa;function prefersReducedMotion(){try{return window['matchMedia']&&window['matchMedia']('(prefers-reduced-motion:\x20reduce)')['matches'];}catch{return![];}}function safeCancelAnimations(_0xca8c6a){if(!_0xca8c6a||typeof _0xca8c6a['getAnimations']!=='function')return;try{_0xca8c6a['getAnimations']()['forEach'](_0x3086e9=>_0x3086e9['cancel']());}catch{}}function animateRestoreFlip({contentEl:_0x21fe40,fromRect:_0x583588,toRect:_0xd559a6,durationMs:_0x3f5961}){if(!_0x21fe40)return;if(!_0x583588||!_0xd559a6)return;if(prefersReducedMotion())return;const _0x354b1c=_0xd559a6['width']||0x0,_0x519510=_0xd559a6['height']||0x0,_0x98f25a=_0x583588['width']||0x0,_0x3a12d4=_0x583588['height']||0x0;if(_0x354b1c<=0x0||_0x519510<=0x0||_0x98f25a<=0x0||_0x3a12d4<=0x0)return;const _0x439ea0=_0x583588['left']-_0xd559a6['left'],_0x1f9edd=_0x583588['top']-_0xd559a6['top'],_0x537301=_0x98f25a/_0x354b1c,_0x26b516=_0x3a12d4/_0x519510;if(!Number['isFinite'](_0x439ea0)||!Number['isFinite'](_0x1f9edd)||!Number['isFinite'](_0x537301)||!Number['isFinite'](_0x26b516))return;safeCancelAnimations(_0x21fe40);const _0x1a8aa2=_0x21fe40['style']['transition'],_0x590a64=_0x21fe40['style']['transformOrigin'],_0x13a9a7=_0x21fe40['style']['willChange'];_0x21fe40['style']['transition']='none',_0x21fe40['style']['transformOrigin']='top\x20left',_0x21fe40['style']['willChange']='transform';const _0x410d91='translate('+_0x439ea0+'px,\x20'+_0x1f9edd+'px)\x20scale('+_0x537301+',\x20'+_0x26b516+')',_0x5454e8=_0x21fe40['animate']([{'transform':_0x410d91},{'transform':'none'}],{'duration':_0x3f5961,'easing':'ease','fill':'both'}),_0x34b0f0=()=>{_0x21fe40['style']['transition']=_0x1a8aa2,_0x21fe40['style']['transformOrigin']=_0x590a64,_0x21fe40['style']['willChange']=_0x13a9a7;};_0x5454e8['addEventListener']('finish',_0x34b0f0,{'once':!![]}),_0x5454e8['addEventListener']('cancel',_0x34b0f0,{'once':!![]});}export function toggleModalMaximize(_0x58c204,_0x163ca6={}){if(!_0x58c204)return;const {storageKey:_0x5414e9,updateIcon:_0x46414a,onAfterToggle:_0x5e7cee,durationMs:durationMs=DEFAULT_DURATION_MS}=_0x163ca6,_0x53dd86=_0x58c204['querySelector']('.modal-content'),_0x257052=_0x58c204['classList']['contains']('maximized'),_0x100781=!_0x257052;if(!_0x53dd86){_0x58c204['classList']['toggle']('maximized'),_0x46414a?.(_0x100781),_0x5e7cee?.(_0x100781);if(_0x5414e9)try{localStorage['setItem'](_0x5414e9,String(_0x100781));}catch{}return;}if(_0x257052&&!prefersReducedMotion()){const _0x46e04d=_0x53dd86['getBoundingClientRect']();_0x58c204['classList']['remove']('maximized');const _0x2f64f2=_0x53dd86['getBoundingClientRect']();animateRestoreFlip({'contentEl':_0x53dd86,'fromRect':_0x46e04d,'toRect':_0x2f64f2,'durationMs':durationMs});}else _0x58c204['classList']['toggle']('maximized');_0x46414a?.(_0x100781),_0x5e7cee?.(_0x100781);if(_0x5414e9)try{localStorage['setItem'](_0x5414e9,String(_0x100781));}catch{}}