<script>
  (function(d, s) {
      var xhr = new XMLHttpRequest();
      xhr.open('GET', 'https://charlie.humans.land/wp-json/custom/v1/chatbot?token=d6367d6454d36a842bef2aad826d85e5', true);
        xhr.onload = function() {
          if (xhr.status === 200) {
              var cleanResponseText = xhr.responseText.replace(/\\|\s+|"/g, '').trim();
              localStorage.setItem('asst_user_id', 142);
              localStorage.setItem('asst_id', 'asst_zjMwN03n9TlQlcYWTICUf0g9');
                  
              var script = document.createElement('script');
              script.async = false;
              script.defer = true;
              script.src = cleanResponseText;
              document.head.appendChild(script);
          } else {
              console.error('Erro ao carregar o chatbot: ', xhr.status, xhr.statusText);
          }
      };
        xhr.onerror = function() {
          console.error('Erro na conexão com o servidor do chatbot.');
      };
        xhr.send();
  })(document, 'script');
</script>
