diff --git a/src/theme/Root.js b/src/theme/Root.js index 314ee1efd8..77c26f7794 100644 --- a/src/theme/Root.js +++ b/src/theme/Root.js @@ -4,7 +4,7 @@ import React, { useEffect } from 'react'; export default function Root({ children }) { useEffect(() => { - // Paste the embed script here: + // DocsBot initialization window.DocsBotAI=window.DocsBotAI||{},DocsBotAI.init=function(e){return new Promise((t,r)=>{var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://widget.docsbot.ai/chat.js";let o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(n,o),n.addEventListener("load",()=>{let n;Promise.all([new Promise((t,r)=>{window.DocsBotAI.mount(Object.assign({}, e)).then(t).catch(r)}),(n=function e(t){return new Promise(e=>{if(document.querySelector(t))return e(document.querySelector(t));let r=new MutationObserver(n=>{if(document.querySelector(t))return e(document.querySelector(t)),r.disconnect()});r.observe(document.body,{childList:!0,subtree:!0})})})("#docsbotai-root"),]).then(()=>t()).catch(r)}),n.addEventListener("error",e=>{r(e.message)})})}; DocsBotAI.init({ id: "iGrxSYKM42GJfYYLMX16/1JkGxSdnjkCj8KfeJbfV" }); }, []);