<body>
  <script>
    let cookies = document.cookie;
    let luigiCookie;
    let luigiCookieKey;
    if (cookies) {
      luigiCookie = cookies
        .split(';')
        .map(cookie => cookie.trim())
        .find(cookie => cookie == 'luigiCookie=true');
    }
    if (luigiCookie === 'luigiCookie=true') {
      luigiCookieKey = luigiCookie.split('=')[0];
      document.cookie = luigiCookieKey + '=; Max-Age=-99999999;';
    }
    document.cookie = 'luigiCookie=true';
    cookies = document.cookie;
    if (cookies) {
      luigiCookie = cookies
        .split(';')
        .map(cookie => cookie.trim())
        .find(cookie => cookie == 'luigiCookie=true');
    }
    if (luigiCookie === 'luigiCookie=true') {
      window.parent.postMessage('luigi.tpcEnabled', '*');
      document.cookie = luigiCookieKey + '=; Max-Age=-99999999;';
    } else {
      window.parent.postMessage('luigi.tpcDisabled', '*');
      console.warn('Third party cookies are not supported!');
    }
  </script>
</body>
