{"version":3,"file":"componentNewsletterBlock-B0-8Oi5R.js","sources":["../../../../SPAs/POCViteVue/src/components/molecules/NewsletterBlock/NewsletterBlock.vue","../../../../SPAs/POCViteVue/src/components/molecules/NewsletterBlock/mainNewsletterBlock.ts"],"sourcesContent":["<template>\r\n  <div class=\" max-w-1440 max-xl:max-w-screen-lg px-6 lg:px-8 bg-bg-primary rounded-3xl p-16 max-xl:mx-0\">\r\n    <div class=\"mx-auto grid max-w-full grid-cols-1 gap-x-8 gap-y-16 max-lg:gap-y-6 lg:max-w-none lg:grid-cols-2\">\r\n      <div class=\"max-w-full flex flex-col justify-between\">\r\n        <h2 class=\"text-3xl font-bold tracking-tight text-newsletter-color sm:text-4xl\">{{ translations[13862] }}</h2>\r\n        <p class=\"my-8 text-lg leading-8 text-newsletter-color font-medium\">{{ translations[13863] }}</p>\r\n        <div class=\"flex flex-col items-start max-lg:mb-8\">\r\n          <div class=\"rounded-3xl hidden max-lg:block -translate-x-0 w-full\">\r\n            <img class=\"rounded-3xl mb-3 h-auto w-full\" :src=\"'/src/images/newsletter.webp'\" alt=\"newsletter\" loading=\"lazy\" width=\"638\" height=\"192\">\r\n          </div>\r\n        </div>\r\n        <div class=\"klaviyo-form-YbmDZM klaviyo-form form-version-cid-2 [&_button]:!px-8\"></div>\r\n      </div>\r\n      <dl class=\"lg:pt-2\">\r\n        <div class=\"flex flex-col items-start\">\r\n          <dt class=\"rounded-3xl max-lg:hidden\">\r\n            <img class=\"rounded-3xl mb-8 h-auto w-full\" :src=\"'/src/images/newsletter.webp'\" alt=\"newsletter\" loading=\"lazy\" width=\"638\" height=\"192\">\r\n          </dt>\r\n          <dd class=\"mt-4 font-medium text-newsletter-color\" v-html=\"translations[13864]\"></dd>\r\n        </div>\r\n      </dl>\r\n    </div>\r\n  </div>\r\n</template>\r\n\r\n\r\n<script lang=\"ts\" setup>\r\n  import { onBeforeMount, ref } from \"vue\";\r\n  // import { storeToRefs } from 'pinia'\r\n  import { translate } from '@/services/translation.service'\r\n\r\n  // import { useTranslationStore } from \"@/store/translationStore\"\r\n  // const TRANSLATION_STORE = useTranslationStore();\r\n  // const { translationObject: TRANSLATION_OBJECT }: any = storeToRefs(TRANSLATION_STORE);\r\n\r\n  interface Translations {\r\n    [key: string]: string\r\n  }\r\n  const translations = ref<Translations>({})\r\n\r\n  onBeforeMount(async () => {\r\n    getTranslationsFromWindow()\r\n  })\r\n\r\n  const getTranslationsFromWindow = async () => {\r\n    if (\"translationIds\" in window) {\r\n      translations.value = <Translations>window.translationIds\r\n      return\r\n    }\r\n    translations.value = await translate({ id: [13862, 13863, 13864] })\r\n  }\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n\r\n</style>\r\n","import { createApp } from 'vue'\r\n\r\n// Select the App you want to run on main, each individual are on /appName/App.vue\r\nimport NewsletterBlock from './NewsletterBlock.vue'\r\n\r\n\r\n\r\n\r\nconst klaviyoNewsletter = document.getElementById('klaviyo-newsletter')\r\nconst app = createApp(NewsletterBlock);\r\n\r\n\r\nif (klaviyoNewsletter) {\r\n  // if the user is using an apple mobile device, we need to mount the search bar immediately\r\n  // for some reason, those devices requires two presses to open the modal, and not one like other browsers\r\n//   if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\r\n//     app.mount(\"#klaviyo-newsletter\");\r\n//   } else {\r\n//     klaviyoNewsletter.addEventListener('mouseover', (e) => {\r\n//       app.mount(\"#klaviyo-newsletter\");\r\n//     })\r\n//   }\r\n    const newsletterObserver = new IntersectionObserver(async (entries) => {\r\n        if (entries[0].isIntersecting) {\r\n            app.mount(\"#klaviyo-newsletter\");\r\n            newsletterObserver.disconnect();\r\n        }\r\n    });\r\n    newsletterObserver.observe(klaviyoNewsletter);\r\n}\r\n"],"names":["translations","ref","onBeforeMount","getTranslationsFromWindow","translate","klaviyoNewsletter","app","createApp","NewsletterBlock","newsletterObserver","entries"],"mappings":"8nBAsCQ,MAAAA,EAAeC,EAAkB,CAAA,CAAE,EAEzCC,EAAc,SAAY,CACEC,GAAA,CAC3B,EAED,MAAMA,EAA4B,SAAY,CAC5C,GAAI,mBAAoB,OAAQ,CAC9BH,EAAa,MAAsB,OAAO,eAC1C,MACF,CACaA,EAAA,MAAQ,MAAMI,EAAU,CAAE,GAAI,CAAC,MAAO,MAAO,KAAK,CAAA,CAAG,CAAA,y0BCzChEC,EAAoB,SAAS,eAAe,oBAAoB,EAChEC,EAAMC,EAAUC,CAAe,EAGrC,GAAIH,EAAmB,CAUnB,MAAMI,EAAqB,IAAI,qBAAqB,MAAOC,GAAY,CAC/DA,EAAQ,CAAC,EAAE,iBACXJ,EAAI,MAAM,qBAAqB,EAC/BG,EAAmB,WAAW,EAClC,CACH,EACDA,EAAmB,QAAQJ,CAAiB,CAChD"}