<template>
  <NuxtLayout>
    <NuxtPage />
  </NuxtLayout>
</template>

<script setup lang="ts">
useHead({
  script: [
    {
      innerHTML: `
        (function(d,t) {
          var BASE_URL="https://chatwoot.optovia.ru";
          var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
          g.src=BASE_URL+"/packs/js/sdk.js";
          g.defer = true;
          g.async = true;
          s.parentNode.insertBefore(g,s);
          g.onload=function(){
            window.chatwootSDK.run({
              websiteToken: 'bc668ge3hM5ZpPeUgGEV1ZU9',
              baseUrl: BASE_URL
            })
          }
        })(document,"script");
      `,
      type: 'text/javascript'
    }
  ]
})
</script>
