const DEFAULT_DURATION_MS=0xfa;function prefersReducedMotion(){try{return window['matchMedia']&&window['matchMedia']('(prefers-reduced-motion:\x20reduce)')['matches'];}catch{return![];}}function safeCancelAnimations(_0x4b0460){if(!_0x4b0460||typeof _0x4b0460['getAnimations']!=='function')return;try{_0x4b0460['getAnimations']()['forEach'](_0x80282b=>_0x80282b['cancel']());}catch{}}function animateRestoreFlip({contentEl:_0x1db379,fromRect:_0x399c93,toRect:_0x91cf5,durationMs:_0x2bc502}){if(!_0x1db379)return;if(!_0x399c93||!_0x91cf5)return;if(prefersReducedMotion())return;const _0x3a63d9=_0x91cf5['width']||0x0,_0x395dcc=_0x91cf5['height']||0x0,_0x1b79d5=_0x399c93['width']||0x0,_0x164428=_0x399c93['height']||0x0;if(_0x3a63d9<=0x0||_0x395dcc<=0x0||_0x1b79d5<=0x0||_0x164428<=0x0)return;const _0x4a0b7e=_0x399c93['left']-_0x91cf5['left'],_0x213ad9=_0x399c93['top']-_0x91cf5['top'],_0x1b686e=_0x1b79d5/_0x3a63d9,_0x2a1403=_0x164428/_0x395dcc;if(!Number['isFinite'](_0x4a0b7e)||!Number['isFinite'](_0x213ad9)||!Number['isFinite'](_0x1b686e)||!Number['isFinite'](_0x2a1403))return;safeCancelAnimations(_0x1db379);const _0xcfc549=_0x1db379['style']['transition'],_0x26c68d=_0x1db379['style']['transformOrigin'],_0x462347=_0x1db379['style']['willChange'];_0x1db379['style']['transition']='none',_0x1db379['style']['transformOrigin']='top\x20left',_0x1db379['style']['willChange']='transform';const _0x5473b5='translate('+_0x4a0b7e+'px,\x20'+_0x213ad9+'px)\x20scale('+_0x1b686e+',\x20'+_0x2a1403+')',_0x2766bf=_0x1db379['animate']([{'transform':_0x5473b5},{'transform':'none'}],{'duration':_0x2bc502,'easing':'ease','fill':'both'}),_0x2591e1=()=>{_0x1db379['style']['transition']=_0xcfc549,_0x1db379['style']['transformOrigin']=_0x26c68d,_0x1db379['style']['willChange']=_0x462347;};_0x2766bf['addEventListener']('finish',_0x2591e1,{'once':!![]}),_0x2766bf['addEventListener']('cancel',_0x2591e1,{'once':!![]});}export function toggleModalMaximize(_0x5bc2e1,_0x5b3948={}){if(!_0x5bc2e1)return;const {storageKey:_0x1bbff2,updateIcon:_0x40eee8,onAfterToggle:_0x52db51,durationMs:durationMs=DEFAULT_DURATION_MS}=_0x5b3948,_0x25556d=_0x5bc2e1['querySelector']('.modal-content'),_0x282728=_0x5bc2e1['classList']['contains']('maximized'),_0x2d58a3=!_0x282728;if(!_0x25556d){_0x5bc2e1['classList']['toggle']('maximized'),_0x40eee8?.(_0x2d58a3),_0x52db51?.(_0x2d58a3);if(_0x1bbff2)try{localStorage['setItem'](_0x1bbff2,String(_0x2d58a3));}catch{}return;}if(_0x282728&&!prefersReducedMotion()){const _0x12d204=_0x25556d['getBoundingClientRect']();_0x5bc2e1['classList']['remove']('maximized');const _0x3dc839=_0x25556d['getBoundingClientRect']();animateRestoreFlip({'contentEl':_0x25556d,'fromRect':_0x12d204,'toRect':_0x3dc839,'durationMs':durationMs});}else _0x5bc2e1['classList']['toggle']('maximized');_0x40eee8?.(_0x2d58a3),_0x52db51?.(_0x2d58a3);if(_0x1bbff2)try{localStorage['setItem'](_0x1bbff2,String(_0x2d58a3));}catch{}}