{
  "version": 3,
  "sources": ["/cdn/shop/t/4/assets/newsletter-popup.js?r=1789080886824"],
  "sourcesContent": ["(() => {\n  const DISMISS_UNTIL_KEY = 'eleftheria-newsletter-popup-dismiss-until';\n  const SUBSCRIBED_KEY = 'eleftheria-newsletter-popup-subscribed';\n  const DELAY_MS = 12000;\n  const DISMISS_DURATION_MS = 7 * 24 * 60 * 60 * 1000;\n\n  function readStorage(key) {\n    try {\n      return window.localStorage.getItem(key);\n    } catch (error) {\n      return null;\n    }\n  }\n\n  function writeStorage(key, value) {\n    try {\n      window.localStorage.setItem(key, value);\n    } catch (error) {\n      // The signup form remains usable when storage is unavailable.\n    }\n  }\n\n  function initNewsletterPopup() {\n    const popup = document.getElementById('newsletter-popup');\n    if (!popup) return;\n\n    const shouldAutoOpen =\n      popup.dataset.newsletterPopupAutoOpen === 'true' &&\n      !window.matchMedia('(max-width: 767px)').matches;\n\n    const closePopup = () => {\n      popup.hidden = true;\n      popup.setAttribute('aria-hidden', 'true');\n      writeStorage(DISMISS_UNTIL_KEY, String(Date.now() + DISMISS_DURATION_MS));\n    };\n\n    const openPopup = () => {\n      popup.hidden = false;\n      popup.setAttribute('aria-hidden', 'false');\n      popup.querySelector('input[type=\"email\"]')?.focus();\n    };\n\n    if (popup.querySelector('[data-newsletter-popup-success]')) {\n      writeStorage(SUBSCRIBED_KEY, '1');\n      openPopup();\n      return;\n    }\n\n    if (readStorage(SUBSCRIBED_KEY) === '1') return;\n\n    const dismissUntil = Number(readStorage(DISMISS_UNTIL_KEY));\n    if (Number.isFinite(dismissUntil) && dismissUntil > Date.now()) return;\n\n    popup.querySelectorAll('[data-newsletter-popup-close]').forEach((button) => {\n      button.addEventListener('click', closePopup);\n    });\n\n    document.addEventListener('keydown', (event) => {\n      if (event.key === 'Escape' && !popup.hidden) closePopup();\n    });\n\n    if (shouldAutoOpen) {\n      window.setTimeout(openPopup, DELAY_MS);\n    }\n  }\n\n  if (document.readyState === 'loading') {\n    document.addEventListener('DOMContentLo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