"use strict";(globalThis.webpackChunkblocksy_companion=globalThis.webpackChunkblocksy_companion||[]).push([[985,726],{726:function(e,t,r){function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}r.d(t,{Q:function(){return i},R:function(){return l}});var i=function(){var e=JSON.parse(localStorage.getItem("blocksyPastPopups")),t={};return Array.isArray(e)?e.forEach((function(e){t[e]={closed:{reason:"cancel",timestamp:(new Date).getTime()},pages:[]}})):t=e,(t=Object.keys(t||{}).reduce((function(e,r){var n=t[r],i=n.isExpired,l=a(n,["isExpired"]);return o(o({},e),{},c({},r,o(o({},l),l.closed?{}:{closed:i?{reason:"cancel",timestamp:(new Date).getTime()}:null})))}),{}))||{}},l=function(e){var t=e.id.replace("ct-popup-",""),r=i()[t];if(e.dataset.popupRelaunch&&e.dataset.popupRelaunch.indexOf("custom")>-1&&r){var n=e.dataset.popupRelaunch.split(":"),o=0,c=0;n.length>1&&(c=o=parseInt(n[1])),n.length>2&&(c=parseInt(n[2]));var a=r.closed;if(!a||!a.timestamp)return!1;var l="cancel"===a.reason?o:c;return!((new Date-new Date(a.timestamp))/864e5>l)}return r&&r.closed}},985:function(e,t,r){r.r(t),r.d(t,{handleScrollModePopups:function(){return i}});var n=r(696),o=r(726);function c(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var i=function(){c(document.querySelectorAll('[data-popup-mode*="scroll"]')).filter((function(e){return!(0,o.R)(e)})).map((function(e){var t=e.dataset.popupMode.indexOf("up")>-1,r=scrollY;window.addEventListener("scroll",(function o(){var c=e.dataset.popupMode.split(":")[1];if(c.indexOf("px")>-1&&(c=parseFloat(c)),c.toString().indexOf("%")>-1){var a=document.body,i=document.documentElement,l=Math.max(a.scrollHeight,a.offsetHeight,i.clientHeight,i.scrollHeight,i.offsetHeight);c=parseFloat(c)/100*l}c.toString().indexOf("vh")>-1&&(c=parseFloat(c)/100*innerHeight),t?scrollY>r?r=scrollY:Math.abs(r-scrollY)>c&&((0,n.openMicroPopup)(e),window.removeEventListener("scroll",o,!0)):c<=scrollY?(e.classList.contains("active")||((0,n.openMicroPopup)(e),e.unmount=function(){window.removeEventListener("scroll",o,!0)}),-1===e.dataset.popupMode.indexOf("close-back")&&window.removeEventListener("scroll",o,!0)):e.classList.contains("active")&&(0,n.closeMicroPopup)(e,{unmount:!1})}),!0)}))}}}]);