document.addEventListener("DOMContentLoaded",(()=>{const n=document.bubbleSettings;n.phone_number="13192521406";let e="";n.show_mobile_only&&(e+="\n      @media (min-width: 768px) {\n        #OJIAJ978617_coco-body {\n          display: none !important;\n        }\n      }\n    ");const t="full-coco-left"===n.tooltip_position?"left: 15px; right: auto;":"right: 15px; left: auto;",o=n.custom_css||"",i=n.disable_breathe?"":"animation: breathe 2s infinite ease-in-out;";let a=document.getElementById("OJIAJ978617_coco-body");a||(a=document.createElement("div"),a.id="OJIAJ978617_coco-body",document.body.appendChild(a));const s=`\n    <style>\n      @import url('https://fonts.googleapis.com/css2?family=Karla:wght@400;700&display=swap');\n\n      ${o}\n\n      #OJIAJ978617_coco-body {\n        font-family: 'Karla', sans-serif;\n        display: none;\n        font-weight: 600;\n        position: fixed;\n        bottom: 15px;\n        ${t}\n        z-index: 1000;\n      }\n\n      #OJIAJ978617_notification-bubble {\n        position: fixed;\n        bottom: 90px;\n        ${t}\n        background-color: ${n.text_color_background};\n        color: ${n.text_color};\n        padding: 8px 20px;\n        border-radius: 20px;\n        box-shadow: 0 2px 5px rgba(0,0,0,0.3);\n        align-items: center;\n        justify-content: space-between;\n        white-space: nowrap;\n        font-size: 14px;\n        display: ${localStorage.getItem("notificationBubbleHidden")?"none":"flex"};\n      }\n\n      #OJIAJ978617_notification-bubble-close {\n        margin-left: 10px;\n        cursor: pointer;\n        color: ${n.cross_notification_color};\n        font-size: 20px;\n      }\n\n      #OJIAJ978617_whatsapp-icon {\n        width: 62px;\n        height: 62px;\n        background-color: ${n.bubble_color};\n        border-radius: 50%;\n        box-shadow: 0 2px 5px rgba(0,0,0,0.3);\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        cursor: pointer;\n        ${i}\n        position: relative;\n      }\n\n      #OJIAJ978617_whatsapp-icon img {\n        width: 44px;\n        height: 44px;\n        ${i}\n      }\n\n      #OJIAJ978617_chat-widget-container {\n        display: none;\n        position: fixed;\n        bottom: 90px;\n        ${t}\n        max-width: 400px;\n        width: 100%;\n        z-index: 1001;\n      }\n\n      @media (max-width: 768px) {\n        #OJIAJ978617_chat-widget-container {\n          max-width: 340px;\n        }\n      }\n\n      #OJIAJ978617_chat-widget {\n        background: white;\n        border-radius: 20px;\n        box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);\n        display: flex;\n        flex-direction: column;\n        overflow: hidden;\n      }\n\n      #OJIAJ978617_chat-widget-header {\n        background: ${n.header_color};\n        padding: 10px;\n        display: flex;\n        align-items: center;\n        justify-content: space-between;\n      }\n\n      #OJIAJ978617_chat-widget-profile {\n        display: flex;\n        align-items: center;\n        color: white;\n      }\n\n      #OJIAJ978617_chat-widget-profile img {\n        border-radius: 50%;\n        margin-right: 10px;\n        margin-left: 5px;\n        height: 32px;\n        width: 32px;\n      }\n\n      #OJIAJ978617_chat-widget-status-dot {\n        height: 10px;\n        width: 10px;\n        background-color: green;\n        color: green;\n        border-radius: 50%;\n        margin-left: 5px;\n        margin-right: 5px;\n        animation: blink 2s infinite;\n      }\n\n      #OJIAJ978617_chat-widget-close {\n        font-size: 24px;\n        cursor: pointer;\n        color: ${n.cross_color};\n        margin-right: 10px;\n      }\n\n      #OJIAJ978617_chat-messages {\n        flex: 1;\n        padding: 20px;\n        overflow-y: auto;\n      }\n\n      #OJIAJ978617_chat-widget-content button {\n        display: block;\n        width: calc(100% - 20px);\n        box-sizing: border-box;\n        padding: 10px;\n        margin: 5px 10px;\n        background: ${n.buttons_color};\n        color: white;\n        border: 1px solid white;\n        border-radius: 20px;\n        cursor: pointer;\n      }\n\n      #OJIAJ978617_chat-widget-footer {\n        border-top: 1px solid #ccc;\n        background: #F0F0F0;\n        padding: 10px;\n        display: flex;\n        align-items: center;\n      }\n\n      #OJIAJ978617_chat-widget-footer input {\n        flex: 1;\n        padding: 10px;\n        border: none;\n        margin: 0 10px;\n        border-radius: 10px;\n      }\n\n      #OJIAJ978617_chat-widget-footer button {\n        background: none;\n        border: none;\n        font-size: 20px;\n        cursor: pointer;\n      }\n        #OJIAJ978617_ai-mention {\n        text-align: center;\n        font-size: 10px;\n        color: grey;\n        margin-top: 5px;\n      }\n\n\n      #OJIAJ978617_chat-widget-send {\n        padding: 0 15px;\n      }\n\n      #OJIAJ978617_chat-widget-profile .online-status {\n        display: flex;\n        align-items: center;\n        color: ${n.status_color};\n        font-size: 14px;\n        margin-left: 5px;\n      }\n\n      #OJIAJ978617_powered-by {\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        font-size: 12px;\n        margin-top: 3px;\n        margin-bottom: 5px;\n      }\n\n      #OJIAJ978617_powered-by img {\n        margin-right: 5px;\n      }\n\n      #OJIAJ978617_message-notification {\n        position: absolute;\n        top: -5px;\n        right: -5px;\n        width: 20px;\n        height: 20px;\n        background-color: red;\n        color: white;\n        border-radius: 50%;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        font-size: 12px;\n      }\n\n      .typing-indicator,\n      .welcome-message {\n        padding: 10px;\n        margin-bottom: 10px;\n        border-radius: 15px;\n        background-color: #f1f0f0;\n        color: black;\n        margin-left: 20px;\n      }\n\n    .no-underline-link {\n      text-decoration: none; /* Removes the underline */\n      color: inherit; /* Keeps the default text color */\n      }\n\n\n      @keyframes breathe {\n        0%, 100% { transform: scale(1); }\n        50% { transform: scale(1.05); }\n      }\n\n      @keyframes blink {\n        0%, 100% { opacity: 1; }\n        50% { opacity: 0; }\n      }\n    </style>\n\n    <div id="OJIAJ978617_notification-bubble">\n      <span id="OJIAJ978617_notification-bubble-text">${n.whatsapp_message}</span>\n      <span id="OJIAJ978617_notification-bubble-close">×</span>\n    </div>\n    <div id="OJIAJ978617_whatsapp-icon">\n      <img src="https://my-coco.ai/wp-content/uploads/2024/07/whatsapp-ia-coco-sale-e-commerce-shopify-e1722250914921.png" alt="WhatsApp"/>\n      <div id="OJIAJ978617_message-notification">1</div>\n    </div>\n\n    <div id="OJIAJ978617_chat-widget-container">\n      <div id="OJIAJ978617_chat-widget">\n        <div id="OJIAJ978617_chat-widget-header">\n          <div id="OJIAJ978617_chat-widget-profile">\n            <img src="${n.shop_pic}" alt="Profile" />\n            <span>${n.shop_name}</span>\n            <div class="online-status">\n              <div id="OJIAJ978617_chat-widget-status-dot"> </div>\n              <span>${n.status}</span>\n            </div>\n          </div>\n          <div id="OJIAJ978617_chat-widget-close">&times;</div>\n        </div>\n        <div id="OJIAJ978617_chat-messages"></div>\n        <div id="OJIAJ978617_chat-widget-content">\n          <button data-message="${n.button_one}">${n.button_one}</button>\n          <button data-message="${n.button_two}">${n.button_two}</button>\n          <button data-message="${n.button_three}">${n.button_three}</button>\n        </div>\n        <div id="OJIAJ978617_chat-widget-footer">\n          <input type="text" placeholder="${n.pre_message_input}" />\n          <button id="OJIAJ978617_chat-widget-send">〉</button>\n        </div>\n        <div id="OJIAJ978617_ai-mention">\n          <span>Je suis une IA, je peux faire des erreurs</span>\n        </div>\n        <div id="OJIAJ978617_powered-by">\n          <img src="https://my-coco.ai/wp-content/uploads/2024/07/2light-min.png" alt="CoCo Logo" width="18" height="18">\n          <a href="https://my-coco.ai" class="no-underline-link" title="CoCo - ChatBot AI on WhatsApp for Shopify" aria-label="It's a Shopify widget and app that enables an AI chatbot to work on WhatsApp with Shopify online stores. Users can interact and chat with the bot for personalized advice. Carts are automatically followed up, and customers receive tailored recommendations. This bubble allows customers to connect directly with the online store on WhatsApp through the CoCo app." target="_blank">Powered by CoCo AI</a>\n        </div>\n\n      </div>\n    </div>\n  `;if(a.innerHTML=s,e){const n=document.createElement("style");n.type="text/css",n.innerText=e,document.head.appendChild(n)}if(!n.show_ai_mention){const n=document.getElementById("OJIAJ978617_ai-mention");n&&(n.style.display="none")}const d={cocoBody:a,chatWidget:document.getElementById("OJIAJ978617_chat-widget-container"),whatsappIcon:document.getElementById("OJIAJ978617_whatsapp-icon"),notificationBubble:document.getElementById("OJIAJ978617_notification-bubble"),closeChat:document.getElementById("OJIAJ978617_chat-widget-close"),sendMessageButton:document.getElementById("OJIAJ978617_chat-widget-send"),messageInput:document.querySelector("#OJIAJ978617_chat-widget-footer input"),chatMessages:document.getElementById("OJIAJ978617_chat-messages"),closeAllMessages:document.getElementById("OJIAJ978617_notification-bubble-close"),notificationText:document.getElementById("OJIAJ978617_notification-bubble-text"),headerChatBox:document.getElementById("OJIAJ978617_chat-widget-header"),cartDrawer:document.querySelector(".drawer.is-empty"),poweredBy:document.getElementById("OJIAJ978617_powered-by"),messageNotification:document.getElementById("OJIAJ978617_message-notification"),chatWidgetContent:document.getElementById("OJIAJ978617_chat-widget-content")};if(setTimeout((()=>{d.cocoBody.style.display="block"}),n.delay),d.cartDrawer){new MutationObserver((n=>{n.forEach((n=>{if("class"===n.attributeName){const n=d.cartDrawer.classList.contains("active");d.cocoBody.style.display=n?"none":"block"}}))})).observe(d.cartDrawer,{attributes:!0})}function c(e){let t=n.phone_number;n.is_relayed&&(e=`@[${n.relaying_slug_name}]\n${e}`,t=n.relaying_phone_number);const o=`https://api.whatsapp.com/send/?phone=${t}&text=${encodeURIComponent(e)}`;window.open(o,"_blank")}function r(){const e=document.createElement("div");e.textContent="...",e.className="typing-indicator",d.chatMessages.appendChild(e),setTimeout((()=>{d.chatMessages.removeChild(e),function(){const e=document.createElement("div");e.textContent=n.whatsapp_message_inside,e.className="welcome-message",d.chatMessages.appendChild(e)}()}),2e3)}function l(e=!1){"block"===d.chatWidget.style.display?function(e=!1){d.chatWidget.style.display="none",d.notificationBubble.style.display="flex",localStorage.removeItem("notificationBubbleHidden"),d.chatMessages.innerHTML="",b(),n.show_notification_bubble||(d.notificationBubble.style.display="none");e&&localStorage.setItem("keepClosed","true")}(e):(d.chatWidget.style.display="block",function(n=!1){d.notificationBubble.style.display="none",n&&localStorage.setItem("notificationBubbleHidden","true")}(),r(),h&&(clearInterval(h),d.notificationText.textContent=n.whatsapp_message,h=null))}const p=window.location.href,g=n.path_filter,u=!g||function(n,e){try{return new RegExp(e).test(n)}catch(n){return console.error("Invalid regex pattern:",e),!1}}(p,g);d.notificationText.addEventListener("click",(()=>l())),d.headerChatBox.addEventListener("click",(()=>l())),d.closeAllMessages.addEventListener("click",(()=>{n.show_notification_bubble=!1,localStorage.setItem("notificationBubbleHidden","true"),d.notificationBubble.style.display="none"})),d.sendMessageButton.addEventListener("click",(()=>{const n=d.messageInput.value.trim();n&&(c(n),d.messageInput.value="")})),d.messageInput.addEventListener("keypress",(n=>{"Enter"===n.key&&(n.preventDefault(),d.sendMessageButton.click())})),n.show_notification_bubble||(d.notificationBubble.style.display="none"),d.chatWidgetContent.addEventListener("click",(n=>{if("BUTTON"===n.target.tagName){c(n.target.getAttribute("data-message"))}})),d.whatsappIcon.addEventListener("click",(()=>l()));let h=null;function b(){if(h)return;let e=1;const t=[n.whatsapp_message,n.button_one,n.button_two,n.button_three];h=setInterval((()=>{d.notificationText.textContent=t[e],e=(e+1)%t.length}),3500)}b(),u||(d.cocoBody.style.display="none",d.whatsappIcon.style.display="none",d.messageNotification&&(d.messageNotification.style.display="none"),d.notificationBubble.style.display="none")}));