@eka-care/apollo-assist 0.1.36 → 0.1.37-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(){const n=()=>{if("undefined"==typeof document)return null;const{currentScript:n}=document;if(n instanceof HTMLScriptElement)return n;const e=document.querySelectorAll('script[src*="widget-loader.js"]');return e.length?e[e.length-1]:null},e=n();var t=e?.src?e.src.replace(/\/[^/]*$/,"/"):"https://unpkg.com/@eka-care/apollo-assist@latest/dist/",i={theme:"client",position:"bottom-right",scriptUrl:t+"widget.js",cssUrl:t+"assets/widget.css",mode:"widget",primaryColor:"#007C9E"},s={isLoaded:!1,isVisible:!1,instance:null,config:null,stage:1,inactivityTimer:null,stage2Timer:null,firstUserMessage:null,isClosed:!1};function a(n){const e=("; "+document.cookie).split("; "+n+"=");return 2===e.length?e.pop().split(";").shift():null}function o(n,e,t=1){const i=new Date;i.setTime(i.getTime()+24*t*60*60*1e3);const s=window.location.hostname;document.cookie=n+"="+e+";expires="+i.toUTCString()+";path=/; domain="+s+"; SameSite=Lax; Secure;"}function r(n,e){var i=document.createElement("img");i.src=t+"assets/apollo_icon.gif",i.alt="Apollo Assist",i.setAttribute("width",e),i.setAttribute("height",e),i.style.width=e+"px",i.style.height=e+"px",i.style.objectFit="contain",i.style.display="block",n.innerHTML="",n.appendChild(i)}function d(){var n=window.EkaMedAssist._button;if(n){var e=window.innerWidth<=768;if(n.className="eka-widget-button",n.innerHTML="",1===s.stage){n.className="eka-widget-button stage-1";var t=document.createElement("div");t.className="eka-icon-container",r(t,e?32:40),n.appendChild(t)}else if(2===s.stage){n.className="eka-widget-button stage-2",n.innerHTML='\n <div class="eka-stage-2-content" data-action="open">\n <button class="eka-chat-close" data-action="close">×</button>\n <div class="eka-stage-2-text">\n <p class="eka-stage-2-title">Hi, Need some help?</p>\n <p class="eka-stage-2-subtitle">I\'m happy to assist.</p>\n </div>\n <div class="eka-stage-2-icon"></div>\n </div>\n ';var i=n.querySelector(".eka-stage-2-icon");i&&r(i,e?28:36)}}}function l(){clearTimeout(s.inactivityTimer),clearTimeout(s.stage2Timer);"close"===a("medassist-preferences")&&(s.isClosed=!0),s.isClosed||(s.inactivityTimer=setTimeout(function(){s.isVisible||1!==s.stage||s.isClosed||c(2)},5e3))}function c(n){clearTimeout(s.inactivityTimer),clearTimeout(s.stage2Timer),s.stage=n,d(),1===n&&l()}function p(n,e){if(s.isLoaded)e();else{if(n.cssUrl){var t=document.createElement("link");t.rel="stylesheet",t.href=n.cssUrl,document.head.appendChild(t)}var i=document.createElement("script");i.src=n.scriptUrl,i.onload=function(){s.isLoaded=!0,e()},i.onerror=function(){},document.head.appendChild(i)}}function u(n){window.EkaMedAssistWidget&&window.EkaMedAssistWidget.init&&(s.instance=window.EkaMedAssistWidget.init({theme:n.theme,primaryColor:n.primaryColor,onMinimize:function(){f(),x()},onClose:function(){f(),x()},mode:n.mode,firstUserMessage:s?.firstUserMessage||""}),s.isVisible=!0,s.firstUserMessage=null,window._first_user_message=null,h())}function g(n){s.isLoaded?s.isVisible?f():m(n):(clearTimeout(s.inactivityTimer),clearTimeout(s.stage2Timer),p(n,function(){u(n)}))}function m(n){o("medassist-preferences","open"),s.isClosed=!1,s.isLoaded?s.isVisible||(s.instance?s.instance.container&&(s.instance.container.style.display="block"):u(n),s.isVisible=!0,h()):p(n,function(){u(n)})}function f(){s.instance&&s.isVisible&&(s.instance.destroy&&(s.instance.destroy(),s.instance=null),s.isClosed=!0,s.isVisible=!1,o("medassist-preferences","close"),x(),l())}function x(){window.EkaMedAssist._button&&(window.EkaMedAssist._button.style.display="flex",c(1))}function h(){window.EkaMedAssist._button&&(window.EkaMedAssist._button.style.display="none")}function w(e){var t;if(!window.EkaMedAssist||!window.EkaMedAssist._initialized)if(e=Object.assign({},i,e),(t=document.createElement("style")).id="eka-widget-styles",t.textContent="\n /* Reset and base styles */\n .eka-widget-button {\n all: initial; // prevents the button from inheriting styles from the parent page\n position: fixed;\n bottom: 20px;\n right: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n cursor: pointer;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n z-index: 2147483647;\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n }\n \n /* Stage 1: Icon only */\n .eka-widget-button.stage-1 {\n width: 56px;\n height: 56px;\n border-radius: 50%;\n position: fixed;\n bottom: 20px;\n right: 20px;\n background: #ffffff;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);\n padding: 0;\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n }\n\n .eka-widget-button.stage-1:hover {\n transform: scale(1.05);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);\n }\n\n /* Stage 2: Oval with text */\n .eka-widget-button.stage-2 {\n width: 280px;\n height: 60px;\n border-radius: 30px;\n position: fixed;\n bottom: 20px;\n right: 20px;\n background: #FDE047;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);\n padding: 8px 8px 8px 24px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n }\n\n .eka-widget-button.stage-2:hover {\n transform: translateY(-2px);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);\n }\n\n .eka-stage-2-content {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n gap: 16px;\n padding: 8px 24px 8px 8px;\n }\n\n .eka-stage-2-text {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 2px;\n }\n\n .eka-stage-2-title {\n font-size: 16px;\n font-weight: 600;\n color: #000000;\n line-height: 1.2;\n margin: 0;\n }\n\n .eka-stage-2-subtitle {\n font-size: 12px;\n font-weight: 400;\n color: #000000;\n line-height: 1.2;\n margin: 0;\n }\n\n .eka-stage-2-icon {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n background: #ffffff;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Stage 3: Full overlay with floating elements */\n .eka-chat-close {\n position: absolute;\n top: 2px;\n right: 8px;\n width: 12px;\n height: 12px;\n background: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 22px;\n color: #666666;\n line-height: 1;\n padding: 0;\n border-radius: 50%;\n transition: background-color 0.2s ease;\n }\n\n .eka-chat-close:hover {\n background: rgba(0, 0, 0, 0.1);\n }\n\n .eka-widget-icon-button:hover {\n transform: scale(1.05);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);\n }\n\n /* Icon container */\n .eka-icon-container {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Mobile responsive styles */\n @media (max-width: 992px) {\n .eka-stage-3-overlay {\n bottom: 82px;\n }\n }\n\n @media (max-width: 767px) {\n .eka-stage-3-overlay {\n bottom: 246px;\n }\n }\n\n @media (max-width: 768px) {\n .eka-widget-button {\n bottom: 16px;\n right: 16px;\n }\n\n .eka-widget-button.stage-1 {\n width: 50px;\n height: 50px;\n }\n\n .eka-widget-button.stage-2 {\n width: auto;\n height: 55px;\n border-radius: 27.5px;\n // padding: 2px 15px;\n }\n\n .eka-stage-2-icon {\n width: 35px;\n height: 35px;\n }\n\n .eka-stage-2-title {\n font-size: 13px;\n }\n\n .eka-stage-2-subtitle {\n font-size: 11px;\n }\n\n .eka-widget-icon-button {\n display: none;\n // bottom: 16px;\n // right: 16px;\n // width: 56px;\n // height: 56px;\n }\n }\n\n /* Animation keyframes */\n @keyframes fadeIn {\n from {\n opacity: 0;\n transform: translateY(10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n .eka-widget-icon-button {\n animation: fadeIn 0.3s ease;\n }\n\n @keyframes stage2FadeIn {\n from {\n opacity: 0;\n transform: scale(0.8) translateX(20px);\n }\n to {\n opacity: 1;\n transform: scale(1) translateX(0);\n }\n }\n\n @keyframes stage1FadeOut {\n from {\n opacity: 1;\n transform: scale(1);\n }\n to {\n opacity: 0;\n transform: scale(0.9);\n }\n }\n ",document.head.appendChild(t),function(){const n=a("medassist-preferences");null===n?(o("medassist-preferences","open"),s.isClosed=!1):s.isClosed="close"===n}(),"full"===function(){let e=n()?.src||null,t=null;e&&(t=new URL(e,window.location.href).searchParams.get("mode"));return t||i.mode}())g({...e,mode:"full"}),window.EkaMedAssist&&(window.EkaMedAssist._initialized=!0);else{var p=function(n){var e=document.createElement("button");e.className="eka-widget-button stage-1";var t=document.createElement("div");return t.className="eka-icon-container",r(t,40),e.appendChild(t),e.addEventListener("click",function(e){var t=e.target.closest("[data-action]");if(t){var i=t.getAttribute("data-action");e.stopPropagation(),"close"===i?(c(1),s.isClosed=!0,o("medassist-preferences","close")):"open"===i&&g(n)}else g(n)}),e.addEventListener("mouseenter",function(){1===s.stage&&l()}),window.addEventListener("resize",d),l(),e}(e);document.body.appendChild(p),window.EkaMedAssist&&(window.EkaMedAssist._initialized=!0,window.EkaMedAssist._button=p)}}function b(){window.EkaMedAssist._initialized||w(i)}window.EkaMedAssist={init:function(n){w(n)},show:m,hide:f,toggle:g,setStage:c,config:i,_initialized:!1,_button:null},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",b):b()}();
1
+ !function(){const n=()=>{if("undefined"==typeof document)return console.error("document is not defined"),null;const{currentScript:n}=document;if(n instanceof HTMLScriptElement)return n;const e=document.querySelectorAll('script[src*="widget-loader.js"]');return e.length?e[e.length-1]:null},e=n();var t=e?.src?e.src.replace(/\/[^/]*$/,"/"):"https://unpkg.com/@eka-care/apollo-assist@latest/dist/",i={theme:"client",position:"bottom-right",scriptUrl:t+"widget.js",cssUrl:t+"assets/widget.css",mode:"widget",primaryColor:"#007C9E"},s={isLoaded:!1,isVisible:!1,instance:null,config:null,stage:1,inactivityTimer:null,stage2Timer:null,firstUserMessage:null,isClosed:!1};function a(n){const e=("; "+document.cookie).split("; "+n+"=");return 2===e.length?e.pop().split(";").shift():null}function o(n,e,t=1){const i=new Date;i.setTime(i.getTime()+24*t*60*60*1e3);const s=window.location.hostname;document.cookie=n+"="+e+";expires="+i.toUTCString()+";path=/; domain="+s+"; SameSite=Lax; Secure;"}function r(n,e){var i=document.createElement("img");i.src=t+"assets/apollo_icon.gif",i.alt="Apollo Assist",i.setAttribute("width",e),i.setAttribute("height",e),i.style.width=e+"px",i.style.height=e+"px",i.style.objectFit="contain",i.style.display="block",n.innerHTML="",n.appendChild(i)}function d(){var n=window.EkaMedAssist._button;if(n){var e=window.innerWidth<=768;if(n.className="eka-widget-button",n.innerHTML="",1===s.stage){n.className="eka-widget-button stage-1";var t=document.createElement("div");t.className="eka-icon-container",r(t,e?32:40),n.appendChild(t)}else if(2===s.stage){n.className="eka-widget-button stage-2",n.innerHTML='\n <div class="eka-stage-2-content" data-action="open">\n <button class="eka-chat-close" data-action="close">×</button>\n <div class="eka-stage-2-text">\n <p class="eka-stage-2-title">Hi, Need some help?</p>\n <p class="eka-stage-2-subtitle">I\'m happy to assist.</p>\n </div>\n <div class="eka-stage-2-icon"></div>\n </div>\n ';var i=n.querySelector(".eka-stage-2-icon");i&&r(i,e?22:36)}}}function l(){clearTimeout(s.inactivityTimer),clearTimeout(s.stage2Timer);"close"===a("medassist-preferences")&&(s.isClosed=!0),s.isClosed||(s.inactivityTimer=setTimeout(function(){s.isVisible||1!==s.stage||s.isClosed||c(2)},5e3))}function c(n){clearTimeout(s.inactivityTimer),clearTimeout(s.stage2Timer),s.stage=n,d(),1===n&&l()}function p(n,e){if(s.isLoaded)e();else{if(n.cssUrl){var t=document.createElement("link");t.rel="stylesheet",t.href=n.cssUrl,document.head.appendChild(t)}var i=document.createElement("script");i.src=n.scriptUrl,i.onload=function(){s.isLoaded=!0,e()},i.onerror=function(){console.error("Failed to load bundle")},document.head.appendChild(i)}}function g(n){window.EkaMedAssistWidget&&window.EkaMedAssistWidget.init?(s.instance=window.EkaMedAssistWidget.init({theme:n.theme,primaryColor:n.primaryColor,onMinimize:function(){f(),x()},onClose:function(){f(),x()},mode:n.mode,firstUserMessage:s?.firstUserMessage||""}),s.isVisible=!0,s.firstUserMessage=null,window._first_user_message=null,h()):console.error("EkaMedAssistWidget not available")}function u(n){s.isLoaded?s.isVisible?f():m(n):(clearTimeout(s.inactivityTimer),clearTimeout(s.stage2Timer),p(n,function(){g(n)}))}function m(n){o("medassist-preferences","open"),s.isClosed=!1,s.isLoaded?s.isVisible||(s.instance?s.instance.container&&(s.instance.container.style.display="block"):g(n),s.isVisible=!0,h()):p(n,function(){g(n)})}function f(){s.instance&&s.isVisible&&(s.instance.destroy&&(s.instance.destroy(),s.instance=null),s.isClosed=!0,s.isVisible=!1,o("medassist-preferences","close"),x(),l())}function x(){window.EkaMedAssist._button&&(window.EkaMedAssist._button.style.display="flex",c(1))}function h(){window.EkaMedAssist._button&&(window.EkaMedAssist._button.style.display="none")}function w(e){var t;if(!window.EkaMedAssist||!window.EkaMedAssist._initialized)if(e=Object.assign({},i,e),(t=document.createElement("style")).id="eka-widget-styles",t.textContent="\n /* Reset and base styles */\n .eka-widget-button {\n all: initial; // prevents the button from inheriting styles from the parent page\n position: fixed;\n bottom: 20px;\n right: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n cursor: pointer;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n z-index: 2147483647;\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n }\n \n /* Stage 1: Icon only */\n .eka-widget-button.stage-1 {\n width: 56px;\n height: 56px;\n border-radius: 50%;\n position: fixed;\n bottom: 20px;\n right: 20px;\n background: #ffffff;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);\n padding: 0;\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n }\n\n .eka-widget-button.stage-1:hover {\n transform: scale(1.05);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);\n }\n\n /* Stage 2: Oval with text */\n .eka-widget-button.stage-2 {\n width: 280px;\n height: 60px;\n border-radius: 30px;\n position: fixed;\n bottom: 90px;\n right: 20px;\n background: #FDE047;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);\n padding: 8px 8px 8px 24px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n }\n\n .eka-widget-button.stage-2:hover {\n transform: translateY(-2px);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);\n }\n\n .eka-stage-2-content {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n gap: 16px;\n padding: 8px 24px 8px 8px;\n }\n\n .eka-stage-2-text {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 2px;\n }\n\n .eka-stage-2-title {\n font-size: 16px;\n font-weight: 600;\n color: #000000;\n line-height: 1.2;\n margin: 0;\n }\n\n .eka-stage-2-subtitle {\n font-size: 12px;\n font-weight: 400;\n color: #000000;\n line-height: 1.2;\n margin: 0;\n }\n\n .eka-stage-2-icon {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n background: #ffffff;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Stage 3: Full overlay with floating elements */\n .eka-chat-close {\n position: absolute;\n top: 2px;\n right: 8px;\n width: 12px;\n height: 12px;\n background: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 22px;\n color: #666666;\n line-height: 1;\n padding: 0;\n border-radius: 50%;\n transition: background-color 0.2s ease;\n }\n\n .eka-chat-close:hover {\n background: rgba(0, 0, 0, 0.1);\n }\n\n .eka-widget-icon-button:hover {\n transform: scale(1.05);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);\n }\n\n /* Icon container */\n .eka-icon-container {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Mobile responsive styles */\n @media (max-width: 992px) {\n .eka-stage-3-overlay {\n bottom: 82px;\n }\n\n .eka-widget-button {\n bottom: 82px !important;\n }\n }\n\n @media (max-width: 767px) {\n .eka-stage-3-overlay {\n bottom: 246px;\n }\n\n .eka-widget-button {\n bottom: 180px !important;\n }\n }\n\n @media (max-width: 768px) {\n .eka-widget-button {\n right: 16px;\n }\n\n .eka-widget-button.stage-1 {\n width: 50px;\n height: 50px;\n }\n\n .eka-widget-button.stage-2 {\n width: auto;\n height: 44px;\n border-radius: 22px;\n bottom: 12px;\n right: 12px;\n padding: 6px 6px 6px 14px;\n }\n\n .eka-stage-2-content {\n gap: 8px;\n padding: 4px 16px 4px 4px;\n }\n\n .eka-stage-2-icon {\n width: 30px;\n height: 30px;\n }\n\n .eka-stage-2-title {\n font-size: 12px;\n }\n\n .eka-stage-2-subtitle {\n font-size: 10px;\n }\n\n .eka-widget-icon-button {\n display: none;\n // bottom: 16px;\n // right: 16px;\n // width: 56px;\n // height: 56px;\n }\n }\n\n /* Animation keyframes */\n @keyframes fadeIn {\n from {\n opacity: 0;\n transform: translateY(10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n .eka-widget-icon-button {\n animation: fadeIn 0.3s ease;\n }\n\n @keyframes stage2FadeIn {\n from {\n opacity: 0;\n transform: scale(0.8) translateX(20px);\n }\n to {\n opacity: 1;\n transform: scale(1) translateX(0);\n }\n }\n\n @keyframes stage1FadeOut {\n from {\n opacity: 1;\n transform: scale(1);\n }\n to {\n opacity: 0;\n transform: scale(0.9);\n }\n }\n ",document.head.appendChild(t),function(){const n=a("medassist-preferences");null===n?(o("medassist-preferences","open"),s.isClosed=!1):s.isClosed="close"===n}(),"full"===function(){let e=n()?.src||null,t=null;e&&(t=new URL(e,window.location.href).searchParams.get("mode"));return t||i.mode}())u({...e,mode:"full"}),window.EkaMedAssist&&(window.EkaMedAssist._initialized=!0);else{var p=function(n){var e=document.createElement("button");e.className="eka-widget-button stage-1";var t=document.createElement("div");return t.className="eka-icon-container",r(t,40),e.appendChild(t),e.addEventListener("click",function(e){var t=e.target.closest("[data-action]");if(t){var i=t.getAttribute("data-action");e.stopPropagation(),"close"===i?(c(1),s.isClosed=!0,o("medassist-preferences","close")):"open"===i&&u(n)}else u(n)}),e.addEventListener("mouseenter",function(){1===s.stage&&l()}),window.addEventListener("resize",d),l(),e}(e);document.body.appendChild(p),window.EkaMedAssist&&(window.EkaMedAssist._initialized=!0,window.EkaMedAssist._button=p)}}function b(){window.EkaMedAssist._initialized||w(i)}window.EkaMedAssist={init:function(n){w(n)},show:m,hide:f,toggle:u,setStage:c,config:i,_initialized:!1,_button:null},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",b):b()}();