window.addEventListener("message",(function(e){if(console.log("Event received"),"https://myaskai.com"===e.origin){if("string"==typeof e.data&&e.data.startsWith("myaskai-ve: ")){console.log("Storage event received");const n=e.data.substring(12);localStorage.setItem("myaskai-ve",n),console.log("Saved to local storage: "+n)}}else console.log("Message rejected")}),!1);var e=document.currentScript.id,n=document.createElement("style");n.innerHTML=".askai-hidden { display: none; }",document.head.appendChild(n);var t=document.createElement("meta");t.name="viewport",t.content="width=device-width, initial-scale=1, maximum-scale=1";var a=document.querySelector('meta[name="viewport"]');a?a.content=t.content:document.head.appendChild(t),document.addEventListener("DOMContentLoaded",(function(){var n=document.createElement("div");n.className="askai-frame-widget",n.setAttribute("data-id",e);var t=document.createElement("div");t.className="askai-hidden",t.id="askai-floating-button",t.innerHTML=" ",document.body.appendChild(n),document.body.appendChild(t);var a="\n    .askai-frame-widget {\n        position: fixed;\n        display: none;\n        bottom: 80px;\n        max-height: 500px !important;\n        right: 25px;\n        margin-left: 15px;\n        z-index: 99999999;\n        border-radius: 5px;\n        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n    }\n    \n    .askai-frame-widget iframe {\n        width: 450px;\n        max-width: 100%;\n    }\n    \n    .askai-hidden {\n        display: none;\n    }\n    \n    .askai-fade-in {\n        animation: fadeIn 0.6s ease-in-out forwards;\n    }\n    \n    @keyframes fadeIn {\n        from {\n            opacity: 0;\n        }\n        to {\n            opacity: 1;\n        }\n    }\n    \n    #askai-floating-button {\n        z-index: 99999999;\n        position: fixed;\n        width: 50px;\n        height: 50px;\n        min-width: 50px;\n        min-height: 50px;\n        max-width: 50px;\n        max-height: 50px;\n        bottom: 20px;\n        right: 20px;\n        padding: 0px;\n        background-size: cover;\n        color: #ffffff;\n        border: none;\n        border-radius: 80px;\n        cursor: pointer;\n        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n        transition: transform 0.3s;\n    }\n\n    .bg-image {\n        background-image: url('https://no-code-ai-model-trainer.cdn.bubble.io/f1681735473770x531519567854483700/Group%201000004040%20%281%29.png') !important;\n    }\n    \n    @media only screen and (min-width: 451px) {\n        #askai-floating-button:hover {\n            transform: scale(1.1);\n        }\n        .askai-frame-widget {\n            opacity: 0;\n            transform: translateY(15px);\n            display: none;\n        }\n        @keyframes fadeInUp {\n            0% {\n                opacity: 0;\n                transform: translateY(15px);\n            }\n            100% {\n                opacity: 1;\n                transform: translateY(0);\n            }\n        }\n        @keyframes fadeOutDown {\n            0% {\n                opacity: 1;\n                transform: translateY(0);\n            }\n            100% {\n                opacity: 0;\n                transform: translateY(15px);\n            }\n        }\n        .askai-frame-widget.visible {\n            display: block;\n            animation: fadeInUp 0.5s ease forwards;\n        }\n        .askai-frame-widget.hiding {\n            animation: fadeOutDown 0.5s ease forwards;\n        }\n    }\n    \n    @media only screen and (max-width: 450px) {\n        @keyframes fadeInUp {\n            0% {\n                opacity: 0;\n                transform: translateY(0px);\n            }\n            100% {\n                opacity: 1;\n                transform: translateY(0);\n            }\n        }\n        @keyframes fadeOutDown {\n            0% {\n                opacity: 1;\n                transform: translateY(0);\n            }\n            100% {\n                opacity: 0;\n                transform: translateY(0px);\n            }\n        }\n        .askai-frame-widget {\n            opacity: 0;\n            display: none;\n        }\n        .askai-frame-widget.visible {\n            display: block;\n            animation: fadeInUp 0.5s ease forwards;\n        }\n        .askai-frame-widget.hiding {\n            animation: fadeOutDown 0.5s ease forwards;\n        }\n    }\n    ";fetch("https://myaskai.com/api/1.1/wf/custom-chat-css?id="+e).then((function(e){return e.text()})).then((function(e){a+=e;var n=document.createElement("style");n.type="text/css",n.appendChild(document.createTextNode(a)),document.head.appendChild(n);var t=document.getElementById("askai-floating-button"),i=window.getComputedStyle(t).backgroundImage.slice(5,-2),o=new Image;o.onload=function(){setTimeout((function(){t.classList.remove("askai-hidden"),t.classList.add("askai-fade-in")}),1e3)},o.onerror=function(){console.error("Failed to load the background image:",i)},o.src=i})).catch((function(e){console.error("Error fetching external CSS:",e)})),function(){function e(e){let n=[],t=[];for(let a=0;a<e.length;a++){let i=e[a];if(null==i)continue;let o=i.getAttribute("data-id");if(i.children.length>0)continue;let s=document.createElement("iframe"),r=`askai-frame-${Math.random().toString(36).substr(2,9)}`;s.id=r;let d="";localStorage.getItem("myaskai-ve")&&(d="&veid="+localStorage.getItem("myaskai-ve")),s.setAttribute("src",`https://myaskai.com/share-ask-ai?i=${o}&embed=yes&chat=yes`+d),s.setAttribute("scrolling","no"),s.setAttribute("frameborder","0"),s.setAttribute("width","100%"),s.setAttribute("height","0px"),s.setAttribute("style","background-color: transparent !important; background-image: none !important;"),s.setAttribute("title","AskAI Embed Widget"),i.appendChild(s),n.push(s),t.push(r)}for(let e=0;e<n.length;e++){if(!n[e])continue;let a=t[e];window.iFrameResize&&iFrameResize({log:!1,checkOrigin:!1},`#${a}`)}}!function(){let n=document.createElement("script");n.src="https://myaskai.com/iframeResizer-min",n.type="text/javascript",n.async=!0;let t=document.querySelectorAll(".askai-frame-widget");n.onload=()=>{e(t),new MutationObserver((function(n){e(document.querySelectorAll(".askai-frame-widget"))})).observe(document,{attributes:!1,childList:!0,characterData:!1,subtree:!0})},document.body.appendChild(n)}()}()})),document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("askai-floating-button");e&&e.addEventListener("click",(function(){var n=document.querySelector(".askai-frame-widget");n.classList.contains("visible")?(n.classList.remove("visible"),n.classList.add("hiding"),e.classList.remove("close-floating-button"),setTimeout((function(){n.style.display="none",n.classList.remove("hiding")}),500)):(n.style.display="block",n.classList.add("visible"),e.classList.add("close-floating-button"))}))}));