{"version":3,"file":"siteMetadata.Btz20dD4.mjs","names":[],"sources":["https:/framerusercontent.com/modules/rBEh7OuvunXlkFuYIVAw/qwRuWOHgsaOtKsu4xj9B/siteMetadata.js"],"sourcesContent":["// Generated by Framer (269977d)\nexport default function metadata(params,activeLocale){return{customHTMLBodyEnd:\"<!-- 🌊 BTP GLOBAL HELPERS — Meta, GA4, UTM, and Checkout Tracking -->\\n<script>\\n// =============== 1. META PIXEL ===============\\n!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?\\nn.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;\\nn.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;\\nt.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script',\\n'https://connect.facebook.net/en_US/fbevents.js');\\nfbq('init','1920070345458156'); // ✅ Your Meta Pixel\\nfbq('track','PageView');\\n\\n\\n// =============== 2. GA4 BASIC PAGEVIEW ===============\\nwindow.dataLayer = window.dataLayer || [];\\nfunction gtag(){dataLayer.push(arguments);}\\ngtag('js', new Date());\\ngtag('config', 'G-XXXXXXXXXX'); // ⚠️ Replace with your GA4 Measurement ID\\n\\n\\n// =============== 3. UTM CAPTURE + STORAGE ===============\\n(function(){\\n  function q(name){const p=new URLSearchParams(location.search);return p.get(name)||\\\"\\\";}\\n  const utm = {\\n    utm_source: q('utm_source') || sessionStorage.getItem('utm_source') || '',\\n    utm_medium: q('utm_medium') || sessionStorage.getItem('utm_medium') || '',\\n    utm_campaign: q('utm_campaign') || sessionStorage.getItem('utm_campaign') || '',\\n    utm_content: q('utm_content') || sessionStorage.getItem('utm_content') || '',\\n  };\\n  Object.entries(utm).forEach(([k,v])=>{\\n    if(v){\\n      sessionStorage.setItem(k,v);\\n      document.cookie = `${k}=${encodeURIComponent(v)};path=/;max-age=${60*60*24*30}`;\\n    }\\n  });\\n  window.__btp = window.__btp || {};\\n  window.__btp.utm = () => ({\\n    utm_source: sessionStorage.getItem('utm_source') || '',\\n    utm_medium: sessionStorage.getItem('utm_medium') || '',\\n    utm_campaign: sessionStorage.getItem('utm_campaign') || '',\\n    utm_content: sessionStorage.getItem('utm_content') || ''\\n  });\\n})();\\n\\n\\n// =============== 4. MAIN TRACKING & REDIRECT HELPER ===============\\nwindow.__btp.trackAndGo = async function({\\n  url,\\n  label,\\n  metaEvent,\\n  gaEvent,\\n  webhook,\\n  payload={},\\n  newTab=false\\n}) {\\n  try { if(metaEvent) fbq('track', metaEvent, {content_name: label||metaEvent, value: 0, currency: 'USD'}); } catch(e){}\\n  try { if(gaEvent && window.gtag) gtag('event', gaEvent, {event_label: label||gaEvent}); } catch(e){}\\n\\n  // Append UTMs to the outgoing link if domain is your site or Books2Read\\n  const u = new URL(url, location.origin);\\n  const utm = window.__btp.utm();\\n  Object.entries(utm).forEach(([k,v])=>{ if(v) u.searchParams.set(k,v); });\\n\\n  // Webhook call (used for Stripe checkout through Make)\\n  let redirect = u.toString();\\n  if (webhook) {\\n    const res = await fetch(webhook,{\\n      method:'POST',\\n      headers:{'Content-Type':'application/json'},\\n      body: JSON.stringify({...utm, ...payload})\\n    });\\n    try {\\n      const data = await res.json();\\n      if (data && data.url) redirect = data.url; // <- Stripe Checkout URL returned by Make\\n    } catch(e){}\\n  }\\n\\n  newTab ? window.open(redirect,'_blank') : (window.location.href = redirect);\\n};\\n\\n\\n// =============== 5. ADVANCED HELPER (used for fire-and-go checkout) ===============\\nasync function fireAndCheckout({webhookUrl, payload, fallbackUrl, delay=150}) {\\n  const controller = new AbortController();\\n  const timeout = setTimeout(()=>controller.abort(), 5000);\\n  let dest = null;\\n\\n  try {\\n    const res = await fetch(webhookUrl, {\\n      method: 'POST',\\n      headers: {'Content-Type':'application/json'},\\n      body: JSON.stringify(payload),\\n      signal: controller.signal\\n    });\\n    clearTimeout(timeout);\\n    if (res.ok) {\\n      const j = await res.json();\\n      if (j && j.url) dest = j.url;\\n    }\\n  } catch(e) {}\\n\\n  setTimeout(()=>{\\n    window.location.assign(dest || fallbackUrl);\\n  }, delay);\\n}\\n\\nwindow.__btpHelpers = { fireAndCheckout };\\n\\n</script>\\n\\n<!-- =============== 6. META NO-SCRIPT FALLBACK =============== -->\\n<noscript><img height=\\\"1\\\" width=\\\"1\\\" style=\\\"display:none\\\" src=\\\"https://www.facebook.com/tr?id=1920070345458156&amp;ev=PageView&amp;noscript=1\\\"></noscript>\\n\\n<!-- =============== 7. OPTIONAL STYLING FOR CLICKABLE LINKS =============== -->\\n<style>\\n.btp-link {\\n  color: #1a73e8;\\n  text-decoration: underline;\\n  cursor: pointer;\\n  transition: opacity 0.15s ease;\\n}\\n.btp-link:active {\\n  opacity: 0.75;\\n}\\n</style>\\n\\n<script>\\n/**\\n * Global helper: window.btpSend(action, detail?)\\n * Example: window.btpSend('play', { id: '01_intro' })\\n *          window.btpSend('unlock')\\n *          window.btpSend('toc')\\n */\\n(function () {\\n  const IFRAME_SELECTOR = 'iframe[src*=\\\"btpstream.vercel.app\\\"]'; // change if needed\\n  let cached;\\n\\n  function getIframe() {\\n    if (cached && document.body.contains(cached)) return cached;\\n    cached = document.querySelector(IFRAME_SELECTOR);\\n    return cached;\\n  }\\n\\n  window.btpSend = function (action, detail) {\\n    const frame = getIframe();\\n    if (!frame || !frame.contentWindow) {\\n      console.warn('[BTP] iframe not found. Is it on this page and loaded?');\\n      return;\\n    }\\n    if (action === 'play') {\\n      frame.contentWindow.postMessage({ type: 'btp:play', detail }, '*');\\n    } else if (action === 'unlock') {\\n      frame.contentWindow.postMessage({ type: 'btp:cmd', detail: { type: 'unlock', open: true } }, '*');\\n    } else if (action === 'toc') {\\n      frame.contentWindow.postMessage({ type: 'btp:cmd', detail: { type: 'toc', open: true } }, '*');\\n    } else {\\n      console.warn('[BTP] Unknown action', action);\\n    }\\n  };\\n\\n  // optional: auto-resize the embed if your player posts btp:resize\\n  window.addEventListener('message', (e) => {\\n    if (e?.data?.type === 'btp:resize' && e?.data?.height) {\\n      const frame = getIframe();\\n      if (frame) frame.style.height = e.data.height + 'px';\\n    }\\n  });\\n})();\\n</script>\\n\",customHTMLHeadEnd:\"<!-- Meta Pixel base -->\\n<script>\\n!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?\\nn.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;\\nn.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;\\nt.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,document,'script',\\n'https://connect.facebook.net/en_US/fbevents.js');\\nfbq('init','1920070345458156');   /* your pixel */\\nfbq('track','PageView');\\n</script>\\n<noscript></noscript>\",description:\"Landing site for the \\\"Bait To Plate\\\" book by author, Brendon 'Marley' Waters.\",robots:\"max-image-preview:large\",title:\"Bait To Plate\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"oDACA,SAAwB,EAAS,EAAO,EAAa,CAAC,MAAM,CAAC,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA+wL,kBAAkB;;;;;;;;;;uBAAuhB,YAAY,gFAAkF,OAAO,0BAA0B,MAAM,gBAAgB"}