{"version":3,"file":"Redirection_Touch.DZoK-JbO.mjs","names":["useRef","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/SWMDnjwMP8EyX3zEbfuj/QUvUBTP1JE9rY0Zm1gm5/Redirection_Touch.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";// Override que redirige tras un tiempo de inactividad desde la carga de la página\nexport function RedirectOnLoad(){const timeoutRef=useRef(null);useEffect(()=>{const redirectUrl=\"https://www.planeamusica.com/landingcraneamusica/touch-26\";const timeoutSeconds=50;const redirect=()=>{window.location.href=redirectUrl;};const resetTimer=()=>{if(timeoutRef.current){clearTimeout(timeoutRef.current);}timeoutRef.current=window.setTimeout(redirect,timeoutSeconds*1e3);};resetTimer();window.addEventListener(\"mousemove\",resetTimer);window.addEventListener(\"keypress\",resetTimer);window.addEventListener(\"scroll\",resetTimer);window.addEventListener(\"touchstart\",resetTimer);return()=>{if(timeoutRef.current){clearTimeout(timeoutRef.current);}window.removeEventListener(\"mousemove\",resetTimer);window.removeEventListener(\"keypress\",resetTimer);window.removeEventListener(\"scroll\",resetTimer);window.removeEventListener(\"touchstart\",resetTimer);};},[]);return{};}// Override que redirige tras un tiempo de inactividad pero solo después de detectar un touch\nexport function RedirectOnTouch(){const timeoutRef=useRef(null);useEffect(()=>{const redirectUrl=\"https://www.planeamusica.com/landingcraneamusica/touch-26\";const timeoutSeconds=15;const redirect=()=>{window.location.href=redirectUrl;};const resetTimer=()=>{if(timeoutRef.current){clearTimeout(timeoutRef.current);}timeoutRef.current=window.setTimeout(redirect,timeoutSeconds*1e3);};// Listener para detectar el primer touch e iniciar el temporizador\nconst startTimerOnTouch=()=>{resetTimer();// Solo necesitamos este listener una vez, así que lo removemos\nwindow.removeEventListener(\"touchstart\",startTimerOnTouch);// Ahora el temporizador se reiniciará con cada touch\nwindow.addEventListener(\"touchstart\",resetTimer);};window.addEventListener(\"touchstart\",startTimerOnTouch);return()=>{if(timeoutRef.current){clearTimeout(timeoutRef.current);}window.removeEventListener(\"touchstart\",startTimerOnTouch);window.removeEventListener(\"touchstart\",resetTimer);};},[]);return{};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withRedirectOnLoad(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...RedirectOnLoad(props)});};}withRedirectOnLoad.displayName=\"RedirectOnLoad\";export function withRedirectOnTouch(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...RedirectOnTouch(props)});};}withRedirectOnTouch.displayName=\"RedirectOnTouch\";\nexport const __FramerMetadata__ = {\"exports\":{\"withRedirectOnTouch\":{\"type\":\"reactHoc\",\"name\":\"withRedirectOnTouch\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRedirectOnLoad\":{\"type\":\"reactHoc\",\"name\":\"withRedirectOnLoad\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"RedirectOnLoad\":{\"type\":\"override\",\"name\":\"RedirectOnLoad\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"RedirectOnTouch\":{\"type\":\"override\",\"name\":\"RedirectOnTouch\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Redirection_Touch.map"],"mappings":"+LACA,SAAgB,GAAgB,CAAC,IAAM,EAAWA,EAAO,IAAI,EAAgyB,OAA9xB,MAAc,CAAC,IAA4G,MAAa,CAAC,EAAO,SAAS,KAAK,2DAAY,EAAQ,MAAe,CAAI,EAAW,SAAS,aAAa,EAAW,OAAO,EAAG,EAAW,QAAQ,EAAO,WAAW,EAAS,GAAe,GAAG,CAAE,EAA4M,OAA1M,EAAW,EAAE,EAAO,iBAAiB,YAAY,CAAU,EAAE,EAAO,iBAAiB,WAAW,CAAU,EAAE,EAAO,iBAAiB,SA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