1(function(){const widgetScriptTag=document.querySelector('script[src*="chatWidget.js"]');if(!widgetScriptTag){return} 2const widgetBotId=widgetScriptTag.getAttribute('data-bot-id')||(()=>{const attrs=Array.from(widgetScriptTag.attributes||[]);const legacyAttr=attrs.find((attr)=>/bot/i.test(attr.name)&&/id/i.test(attr.name));return legacyAttr?legacyAttr.value:null})();if(!widgetBotId){console.error('Chat widget: missing data-bot-id attribute.');return} 3const widgetServerUrl=(()=>{const dataHost=widgetScriptTag.getAttribute('data-host');if(dataHost){return dataHost.replace(/\/$/,'')} 4try{const scriptOrigin=new URL(widgetScriptTag.src,window.location.href).origin;if(scriptOrigin===window.location.origin){return'https://app.thebotforge.ai'} 5return scriptOrigin}catch(error){return'https://app.thebotforge.ai'}})();const widgetCurrentDomain=window.location.hostname;const widgetStyle=document.createElement('style');const hideWelcomePopup=widgetScriptTag.getAttribute('data-hide-welcome-popup')==='true';const isAdminPreview=widgetScriptTag.getAttribute('data-admin-preview')==='true';const isMobileDevice=/Mobi|Android|iPhone|iPad|iPod|IEMobile|Opera Mini|BlackBerry|webOS|Windows Phone|Kindle|Silk-Accelerated|Mobile Safari|Fennec|Maemo|MeeGo|PlayBook|BB10/i.test(navigator.userAgent);const faLink=document.createElement('link');let widgetChatIconClicked=!1;let widgetWelcomePopupTimeoutId;let widgetWelcomePopupClosed=isMobileDevice&&localStorage.getItem(`welcomePopupClosed_${widgetBotId}`)==='true';const lastPopupShownTime=localStorage.getItem(`lastPopupShownTime_${widgetBotId}`);const currentTime=Date.now();const showFrequencyHours=24;faLink.href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css';faLink.rel='stylesheet';document.head.appendChild(faLink);widgetStyle.innerHTML=` 6 .wl-chat-widget-fade { 7 transition: opacity 0.25s; 8 opacity: 0; 9 } 10 11 .wl-chat-widget-fade.show { 12 opacity: 1; 13 } 14 15 .wl-chat-widget-close-icon { 16 color: #777 !important; 17 opacity: 0; 18 transition: opacity 0.25s; 19 font-family: 'Font Awesome 5 Free'; 20 font-weight: 900; 21 } 22 23 .wl-chat-widget-close-icon.show { 24 opacity: 1; 25 } 26 27 .wl-chat-widget-frame-container:hover .wl-chat-widget-close-icon, 28 .wl-chat-widget-popup-container:hover .wl-chat-widget-close-icon { 29 opacity: 1; 30 } 31 32 #wl-chat-widget-popup-container, #wl-chat-widget-popup-container * { 33 cursor: pointer; 34 font-family: 'Noto Sans', sans-serif; 35 font-size: 14px; 36 color: #333; 37 } 38 #wl-chat-widget-popup-container .wl-chat-widget-close-icon { 39 font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Brands'; 40 font-weight: 900; 41 } 42 @keyframes wl-chat-widget-bounce { 43 0%, 20%, 50%, 80%, 100% {transform: translateY(0);} 44 40% {transform: translateY(-30px);} 45 60% {transform: translateY(-15px);} 46 } 47 #wl-chat-widget-popup-container.show { 48 animation: wl-chat-widget-bounce 0.8s; 49 } 50 #wl-chat-widget-icon-container { 51 transition: transform 0.3s ease; 52 } 53 54 #wl-chat-widget-icon-container:hover { 55 transform: scale(1.1); 56 } 57 58 #wl-chat-widget-calendly-panel { 59 position: fixed; 60 top: 0; 61 right: 0; 62 height: 100vh; 63 width: 380px; 64 background: #ffffff; 65 box-shadow: -12px 0 24px rgba(0,0,0,0.15); 66 z-index: 99999; 67 display: none; 68 flex-direction: column; 69 } 70 71 #wl-chat-widget-calendly-panel.open { 72 display: flex; 73 } 74 75 #wl-chat-widget-calendly-header { 76 display: flex; 77 align-items: center; 78 justify-content: space-between; 79 padding: 12px 16px; 80 border-bottom: 1px solid rgba(0,0,0,0.08); 81 font-weight: 600; 82 background: #f8f9fb; 83 } 84 85 #wl-chat-widget-calendly-close { 86 border: none; 87 background: transparent; 88 color: #444; 89 font-size: 18px; 90 cursor: pointer; 91 } 92 93 #wl-chat-widget-calendly-body { 94 flex: 1; 95 overflow: hidden; 96 } 97 98 #wl-chat-widget-calendly-body .calendly-inline-widget { 99 width: 100%; 100 height: 100%; 101 } 102 103 @media (max-width: 768px) { 104 #wl-chat-widget-calendly-panel { 105 width: 100%; 106 left: 0; 107 right: 0; 108 box-shadow: 0 0 24px rgba(0,0,0,0.2); 109 } 110 } 111 `;document.head.appendChild(widgetStyle);function resetAndReplayAnimation(element){element.classList.remove('show');void element.offsetWidth;element.classList.add('show')} 112function isClickInsideWelcomePopup(target){while(target&&target!==document.body){if(target.id==='wl-chat-widget-popup-container'){return!0} 113target=target.parentNode} 114return!1} 115function shouldShowWelcomePopup(){if(!!getThreadId()||(isMobileDevice&&sessionStorage.getItem("mobileChatActive")==="true")){return!1} 116if(hideWelcomePopup&&isMobileDevice){return!1}
117if(widgetWelcomePopupClosed){if(isMobileDevice&&lastPopupShownTime){const hoursSinceLastShown=(currentTime-parseInt(lastPopupShownTime,10))/(1000*60*60);if(hoursSinceLastShown>=showFrequencyHours){localStorage.removeItem(`welcomePopupClosed_${widgetBotId}`);widgetWelcomePopupClosed=!1}else{return!1}}else{return!1}} 118if(isMobileDevice&&lastPopupShownTime){const hoursSinceLastShown=(currentTime-parseInt(lastPopupShownTime,10))/(1000*60*60);return hoursSinceLastShown>=showFrequencyHours} 119return!0} 120function getThreadId(){const threadId=localStorage.getItem(`threadId_${widgetBotId}`);const expiry=localStorage.getItem(`threadIdExpiry_${widgetBotId}`);const now=Date.now();if(!threadId){return null} 121if(!expiry){setThreadId(threadId);return threadId} 122if(now>parseInt(expiry,10)){clearThreadId();return null} 123return threadId} 124function setThreadId(threadId){const now=Date.now();const expiry=now+72*60*60*1000;localStorage.setItem(`threadId_${widgetBotId}`,threadId);localStorage.setItem(`threadIdExpiry_${widgetBotId}`,expiry.toString())} 125function clearThreadId(){localStorage.removeItem(`threadId_${widgetBotId}`);localStorage.removeItem(`threadIdExpiry_${widgetBotId}`);if(isMobileDevice){sessionStorage.removeItem("mobileChatActive")}} 126if(isMobileDevice&&!getThreadId()){sessionStorage.removeItem("mobileChatActive")} 127const SEC_IDS=['cart-icon-bubble','cart-notification','cart-drawer',];fetch(widgetServerUrl+'/api/chatwidget?botId='+widgetBotId+'&domain='+widgetCurrentDomain+'&hasActiveThread='+((!!getThreadId()||(isMobileDevice&&sessionStorage.getItem("mobileChatActive")==="true"))?'true':'false')+'&isAdminPreview='+isAdminPreview).then(response=>{if(!response.ok){return response.json().then(json=>{const msg=json&&json.message?`Chat widget: ${json.message}`:'Chat widget: Access denied. Check allowed domains or bot status.';throw new Error(msg)})} 128return response.json()}).then(data=>{const widgetChimeSound=data.welcomeChimeSelect;const widgetChatIcon=data.chatIcon;const widgetIconPlacement=data.iconPlacement;const widgetChatIconColor=data.chatIconColor;const widgetChatIconCircleColor=data.chatIconCircleColor;const widgetWelcomePopupEnabled=data.welcomePopupEnabled;const widgetWelcomePopupDelay=data.welcomePopupDelay;const widgetWelcomePopupMessage=data.welcomePopupMessage;const widgetWelcomePopupFontFamily=data.welcomePopupFontFamily||'Noto Sans, sans-serif';const widgetWelcomePopupFontSize=data.welcomePopupFontSize||'14px';const originalSvgPath='M27.91 11.79c.176.792.278 1.606.278 2.442 0 6.456-5.48 11.838-12.696 12.994 1.526.616 3.236.976 5.058.976 1.718 0 3.34-.316 4.804-.866 1.854.632 3.878.796 5.552.796A14.237 14.237 0 0 1 29 25.164c1.856-1.656 3-3.85 3-6.266 0-2.856-1.594-5.402-4.09-7.108zm-2.722 2.442C25.188 8.582 19.55 4 12.594 4S0 8.582 0 14.232c0 2.948 1.542 5.596 3.998 7.464a15.646 15.646 0 0 1-2.57 4.344c2.516 0 5.756-.33 8.25-1.862.938.182 1.912.288 2.916.288 6.956-.002 12.594-4.582 12.594-10.234z';const alternateSvgPath='M17 9.5L12 14.5L7 9.5';const googleAnalyticsId=(data.googleAnalyticsId||'').trim();if(googleAnalyticsId&&typeof window!=='undefined'&&!window._wlChatWidgetGtagInjected&&!isAdminPreview){window._wlChatWidgetGtagInjected=!0;const hasGlobalGtag=typeof window.gtag==='function';if(!hasGlobalGtag){window.dataLayer=window.dataLayer||[];window.gtag=function(){window.dataLayer.push(arguments)};const s=document.createElement('script');s.async=!0;s.src='https://www.googletagmanager.com/gtag/js?id='+encodeURIComponent(googleAnalyticsId);document.head.appendChild(s)} 129const dl=window.dataLayer||[];const idAlreadyConfigured=dl.some((e)=>Array.isArray(e)&&e[0]==='config'&&e[1]===googleAnalyticsId);window.gtag('js',new Date());window.gtag('config',googleAnalyticsId,{send_page_view:!idAlreadyConfigured})} 130const plausibleDomain=(data.plausibleDomain||'').trim();if(plausibleDomain&&typeof window!=='undefined'&&!window._wlChatWidgetPlausibleInjected&&!isAdminPreview){window._wlChatWidgetPlausibleInjected=!0;const alreadyLoaded=document.querySelector('script[data-domain="'+plausibleDomain+'"][src*="plausible"]');if(!alreadyLoaded){const ps=document.createElement('script');ps.defer=!0;ps.setAttribute('data-domain',plausibleDomain);
130ps.src='https://plausible.io/js/script.js';document.head.appendChild(ps)}} 131if(widgetWelcomePopupFontFamily){const fontLink=document.createElement('link');fontLink.href=`https://fonts.googleapis.com/css2?family=${encodeURIComponent(widgetWelcomePopupFontFamily.split(',')[0].replace(/'/g, ''))}&display=swap`;fontLink.rel='stylesheet';document.head.appendChild(fontLink)} 132let widgetChatUrl;let targetOrigin;if(data.customDomain){widgetChatUrl='https://'+data.customDomain+'/chat/'+widgetBotId;targetOrigin='https://'+data.customDomain}else{widgetChatUrl=widgetServerUrl+'/chat/'+widgetBotId;targetOrigin=widgetServerUrl} 133function createSvgElement(path,color,viewBox,isFilled=!0){const svg=document.createElementNS('http://www.w3.org/2000/svg','svg');svg.setAttribute('viewBox',viewBox);svg.setAttribute('width','35');svg.setAttribute('height','35');const pathEl=document.createElementNS('http://www.w3.org/2000/svg','path');pathEl.setAttribute('d',path);if(isFilled){pathEl.setAttribute('fill',color)}else{pathEl.setAttribute('stroke',color);pathEl.setAttribute('stroke-linecap','round');pathEl.setAttribute('stroke-linejoin','round');pathEl.setAttribute('fill','none')} 134svg.appendChild(pathEl);return svg} 135function dismissWelcomePopup(){widgetWelcomePopupClosed=!0;if(widgetWelcomePopupTimeoutId){clearTimeout(widgetWelcomePopupTimeoutId);widgetWelcomePopupTimeoutId=null} 136const popup=document.getElementById('wl-chat-widget-popup-container');if(popup){popup.classList.remove('show');popup.style.display='none'} 137document.body.removeEventListener('click',playSoundAndShowPopup)} 138function playSoundAndShowPopup(event){if(isClickInsideWelcomePopup(event.target)||!shouldShowWelcomePopup()){document.body.removeEventListener('click',playSoundAndShowPopup);return} 139if(widgetWelcomePopupEnabled&&!widgetChatIconClicked&&shouldShowWelcomePopup()){widgetPopupContainer.style.display='block';resetAndReplayAnimation(widgetPopupContainer);localStorage.setItem(`lastPopupShownTime_${widgetBotId}`,Date.now().toString());const lastPlayTime=sessionStorage.getItem("lastChimePlayTime");const currentTime=new Date().getTime();const timeDifference=(currentTime-(lastPlayTime||0))/(1000*60);if(lastPlayTime===null||timeDifference>30){if(widgetChimeSound){const chime=new Audio(widgetServerUrl+'/sounds/'+widgetChimeSound);chime.play().catch(function(error){console.log('Chat widget audio play failed due to user interaction restriction:',error)})} 140sessionStorage.setItem("lastChimePlayTime",currentTime.toString())}} 141document.body.removeEventListener('click',playSoundAndShowPopup)} 142const oldWidgetIconContainer=document.getElementById('wl-chat-widget-icon-container');if(oldWidgetIconContainer){oldWidgetIconContainer.parentNode.removeChild(oldWidgetIconContainer)} 143const widgetIconContainer=document.createElement('div');widgetIconContainer.id='wl-chat-widget-icon-container';widgetIconContainer.style.position='fixed';widgetIconContainer.style.bottom='20px';widgetIconContainer.style[widgetIconPlacement]='20px';widgetIconContainer.style.cursor='pointer';widgetIconContainer.style.zIndex='99999';document.body.appendChild(widgetIconContainer);while(widgetIconContainer.firstChild){widgetIconContainer.removeChild(widgetIconContainer.firstChild)} 144if(widgetChatIcon){const widgetIconImage=document.createElement('img');widgetIconImage.src=`${widgetServerUrl}/uploads/${encodeURIComponent(widgetChatIcon)}`;widgetIconImage.alt='Chat Icon';widgetIconImage.style.maxWidth='60px';widgetIconImage.style.maxHeight='60px';widgetIconImage.style.width='auto';widgetIconImage.style.height='auto';widgetIconContainer.appendChild(widgetIconImage)}else{const widgetIconBubble=document.createElement('div');widgetIconBubble.id='wl-chat-widget-icon-bubble';widgetIconBubble.style.width='60px';widgetIconBubble.style.height='60px';widgetIconBubble.style.borderRadius='50%';widgetIconBubble.style.backgroundColor=widgetChatIconCircleColor;widgetIconBubble.style.display='flex';widgetIconBubble.style.justifyContent='center';widgetIconBubble.style.alignItems='center';widgetIconBubble.style.boxShadow='10px 10px 10px 0px rgba(0,0,0,0.2)';const widgetSvgIcon=createSvgElement(originalSvgPath,widgetChatIconColor,'0 0 32 32',!0);widgetIconBubble.appendChild(widgetSvgIcon);widgetIconContainer.appendChild(widgetIconBubble)} 145const oldWidgetFrameContainer=document.getElementById('wl-chat-widget-frame-container');if(oldWidgetFrameContainer){oldWidgetFrameContainer.parentNode.removeChild(oldWidgetFrameContainer)} 146const widgetFrameContainer=document.createElement('div');widgetFrameContainer.id='wl-chat-widget-frame-container';widgetFrameContainer.style.position='fixed';widgetFrameContainer.style.bottom='80px';widgetFrameContainer.style[widgetIconPlacement]='20px';const chatWindowSize=data.chatWindowSize||'small';let chatWidth=400;let chatHeight=550;
146if(chatWindowSize==='medium'){chatWidth=450;chatHeight=600}else if(chatWindowSize==='large'){chatWidth=500;chatHeight=650} 147widgetFrameContainer.style.width=chatWidth+'px';widgetFrameContainer.style.height=chatHeight+'px';widgetFrameContainer.style.border='1px solid #ccc';widgetFrameContainer.style.borderRadius='10px';widgetFrameContainer.style.overflow='hidden';widgetFrameContainer.style.boxShadow='0 4px 6px rgba(0,0,0,0.1)';widgetFrameContainer.style.backgroundColor=widgetChatIconCircleColor;widgetFrameContainer.style.zIndex='99999';widgetFrameContainer.style.display='none';widgetFrameContainer.className='wl-chat-widget-fade';document.body.appendChild(widgetFrameContainer);const widgetIframe=document.createElement('iframe');widgetIframe.src=widgetChatUrl;widgetIframe.setAttribute('allow','microphone');widgetIframe.style.width='100%';widgetIframe.style.height='100%';widgetIframe.style.border='none';widgetIframe.onload=function(){if(sessionStorage.getItem("chatOpen")==="true"){widgetFrameContainer.style.display='block';setTimeout(function(){widgetFrameContainer.classList.add('show')},0)} 148sendThreadId()};widgetFrameContainer.appendChild(widgetIframe);const calendlyPanel=document.createElement('div');calendlyPanel.id='wl-chat-widget-calendly-panel';const calendlyHeader=document.createElement('div');calendlyHeader.id='wl-chat-widget-calendly-header';calendlyHeader.innerHTML='<span>Schedule a time</span>';const calendlyClose=document.createElement('button');calendlyClose.id='wl-chat-widget-calendly-close';calendlyClose.setAttribute('aria-label','Close Calendly panel');calendlyClose.textContent='Ã';calendlyHeader.appendChild(calendlyClose);const calendlyBody=document.createElement('div');calendlyBody.id='wl-chat-widget-calendly-body';calendlyPanel.appendChild(calendlyHeader);calendlyPanel.appendChild(calendlyBody);document.body.appendChild(calendlyPanel);let calendlyScriptPromise;function loadCalendlyStyles(){if(document.getElementById('calendly-widget-styles'))return;const link=document.createElement('link');link.id='calendly-widget-styles';link.rel='stylesheet';link.href='https://assets.calendly.com/assets/external/widget.css';document.head.appendChild(link)} 149function loadCalendlyOverrides(){if(document.getElementById('calendly-widget-overrides'))return;const style=document.createElement('style');style.id='calendly-widget-overrides';style.textContent=` 150 .calendly-overlay, 151 .calendly-popup, 152 .calendly-popup * { 153 z-index: 1000000 !important; 154 } 155 156 .calendly-overlay { 157 position: fixed !important; 158 inset: 0 !important; 159 display: flex !important; 160 align-items: center !important; 161 justify-content: center !important; 162 padding: 16px !important; 163 overflow: hidden !important; 164 } 165 166 .calendly-popup { 167 position: relative !important; 168 top: auto !important; 169 left: auto !important; 170 right: auto !important; 171 bottom: auto !important; 172 transform: none !important; 173 width: min(1100px, calc(100vw - 32px)) !important; 174 height: calc(100vh - 32px) !important; 175 max-width: calc(100vw - 32px) !important; 176 max-height: calc(100vh - 32px) !important; 177 margin: 0 !important; 178 border-radius: 12px !important; 179 box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22) !important; 180 } 181 182 .calendly-popup-content, 183 .calendly-popup iframe { 184 width: 100% !important; 185 height: 100% !important; 186 max-height: 100% !important; 187 } 188 189 @media (max-width: 768px) { 190 .calendly-overlay { 191 padding: 0 !important; 192 } 193 194 .calendly-popup { 195 width: 100vw !important; 196 height: 100vh !important; 197 max-width: 100vw !important; 198 max-height: 100vh !important; 199 border-radius: 0 !important; 200 } 201 } 202 `;document.head.appendChild(style)} 203function loadCalendlyScript(){loadCalendlyStyles();loadCalendlyOverrides();if(window.Calendly)return Promise.resolve();if(calendlyScriptPromise)return calendlyScriptPromise;calendlyScriptPromise=new Promise((resolve,reject)=>
203{const existing=document.getElementById('calendly-widget-script');if(existing){existing.addEventListener('load',resolve);existing.addEventListener('error',reject);return} 204const script=document.createElement('script');script.id='calendly-widget-script';script.src='https://assets.calendly.com/assets/external/widget.js';script.async=!0;script.onload=()=>resolve();script.onerror=()=>reject(new Error('Calendly script failed to load'));document.body.appendChild(script)});return calendlyScriptPromise} 205function attachCalendlySpinnerCleanup(){const popup=document.querySelector('.calendly-popup');if(!popup)return!1;const spinner=popup.querySelector('.calendly-spinner');const iframe=popup.querySelector('iframe');if(!spinner||!iframe)return!1;const hideSpinner=()=>{spinner.style.display='none';spinner.style.visibility='hidden'};iframe.addEventListener('load',hideSpinner,{once:!0});setTimeout(hideSpinner,4000);return!0} 206function openCalendlyScheduler(url,mode){if(!url)return;const displayMode=mode==='panel'?'panel':'modal';if(displayMode==='modal'){closeCalendlyPanel();loadCalendlyScript().then(()=>{if(window.Calendly&&window.Calendly.initPopupWidget){window.Calendly.initPopupWidget({url})} 207setTimeout(()=>{const poll=setInterval(()=>{if(attachCalendlySpinnerCleanup()){clearInterval(poll)}},250);setTimeout(()=>clearInterval(poll),5000)},0)}).catch(err=>console.error(err));return} 208calendlyBody.innerHTML='';const widget=document.createElement('div');widget.className='calendly-inline-widget';widget.dataset.url=url;widget.style.minWidth='320px';widget.style.height='100%';calendlyBody.appendChild(widget);loadCalendlyScript().then(()=>{if(window.Calendly&&window.Calendly.initInlineWidget){window.Calendly.initInlineWidget({url,parentElement:widget})}}).catch(err=>console.error(err));calendlyPanel.classList.add('open')} 209function closeCalendlyPanel(){calendlyPanel.classList.remove('open')} 210calendlyClose.addEventListener('click',closeCalendlyPanel);function sendThreadId(){const threadId=getThreadId();const shopifyCustomerId=window.botForgeShopify&&window.botForgeShopify.id;const shopifyEmail=window.botForgeShopify&&window.botForgeShopify.email;const shopifyCartToken=window.botForgeShopify&&window.botForgeShopify.cartId;widgetIframe.contentWindow.postMessage({threadId:threadId,shopifyCustomerId:shopifyCustomerId,shopifyEmail:shopifyEmail,shopifyCartToken:shopifyCartToken},targetOrigin)} 211window.addEventListener('message',async(ev)=>{if(!ev.data)return;const isWidgetIframeMessage=widgetIframe&&ev.source===widgetIframe.contentWindow;if(ev.data.threadId&&isWidgetIframeMessage){setThreadId(ev.data.threadId);dismissWelcomePopup()} 212if(ev.data.clearThreadId&&isWidgetIframeMessage)clearThreadId();if(ev.data.type==='openCalendly'){try{const replyOrigin=ev.origin&&ev.origin!=='null'?ev.origin:'*';if(ev.source&&typeof ev.source.postMessage==='function'){ev.source.postMessage({type:'calendlyHandled'},replyOrigin)}}catch(_){} 213openCalendlyScheduler(ev.data.calendlyUrl,ev.data.calendlyDisplayMode);return} 214if(!ev.data.newCartId)return;localStorage.setItem('cartToken',ev.data.newCartId);window.botForgeShopify=window.botForgeShopify||{};try{const gid=ev.data.newCartId;const match=/Cart\/(.+?)\?key=/.exec(gid);if(match&&match[1]){const cartToken=match[1];const expiry=new Date(Date.now()+24*3600*1000).toUTCString();document.cookie=`cart=${cartToken}; path=/; expires=${expiry}; SameSite=Lax`}}catch(e){console.warn('cart cookie set error',e)} 215window.botForgeShopify.cartId=ev.data.newCartId;try{const url=`${Shopify.routes.root}?sections=cart-icon-bubble,cart-notification,cart-drawer`;const htmlJSON=await(await fetch(url)).json();if(htmlJSON['cart-icon-bubble']){const badge=document.querySelector('[data-cart-count]');if(badge){badge.innerHTML=htmlJSON['cart-icon-bubble']}} 216const html=htmlJSON['cart-drawer']||htmlJSON['cart-notification'];if(html){const tmp=document.createElement('div');tmp.innerHTML=html;const fresh=tmp.querySelector('cart-drawer, cart-notification');const current=document.querySelector('cart-drawer, cart-notification');if(fresh&¤t){current.replaceWith(fresh);if(typeof fresh.open==='function')fresh.open();return}}}catch(_){} 217try{const cart=await(await fetch('/cart.js')).json();if(window.Shopify&&typeof Shopify.on==='function'){Shopify.on('cart:update',cart);return}}catch(_){} 218location.reload()},!1);const widgetIframeCloseIcon=document.createElement('i');widgetIframeCloseIcon.className='fa fa-times wl-chat-widget-close-icon wl-chat-widget-fade';widgetIframeCloseIcon.style.position='absolute';widgetIframeCloseIcon.style.top='8px';widgetIframeCloseIcon.style.right='8px';widgetIframeCloseIcon.style.cursor='pointer';widgetFrameContainer.appendChild(widgetIframeCloseIcon);widgetIframeCloseIcon.onclick=function(){widgetFrameContainer.classList.remove('show');setTimeout(()=>{widgetFrameContainer.style.display='none';sessionStorage.setItem("chatOpen","false");if(!widgetChatIcon){const widgetIconBubble=widgetIconContainer.querySelector('#wl-chat-widget-icon-bubble');widgetIconBubble.innerHTML='';widgetIconBubble.appendChild(createSvgElement(originalSvgPath,widgetChatIconColor,'0 0 32 32',!0))}},250)};widgetFrameContainer.onmouseover=function(){widgetIframeCloseIcon.classList.add('show')};widgetFrameContainer.onmouseout=function(){widgetIframeCloseIcon.classList.remove('show')};const oldWidgetPopupContainer=document.getElementById('wl-chat-widget-popup-container');if(oldWidgetPopupContainer){oldWidgetPopupContainer.parentNode.removeChild(oldWidgetPopupContainer)} 219const widgetPopupContainer=document.createElement('div');widgetPopupContainer.id='wl-chat-widget-popup-container';widgetPopupContainer.style.position='fixed';widgetPopupContainer.style.bottom=isMobileDevice?'100px':'80px';widgetPopupContainer.style[widgetIconPlacement]='20px';if(isMobileDevice){widgetPopupContainer.style.maxWidth='280px';widgetPopupContainer.style.width='280px';widgetPopupContainer.style.paddingTop='25px'}else{widgetPopupContainer.style.maxWidth='280px';widgetPopupContainer.style.width='auto'} 220widgetPopupContainer.style.padding='10px';widgetPopupContainer.style.border='1px solid #ccc';widgetPopupContainer.style.borderRadius='10px';widgetPopupContainer.style.boxShadow='0 4px 6px rgba(0,0,0,0.1)';widgetPopupContainer.style.backgroundColor='white';widgetPopupContainer.style.zIndex='99999';widgetPopupContainer.style.display='none';widgetPopupContainer.style.marginBottom='10px';
220widgetPopupContainer.style.fontFamily=widgetWelcomePopupFontFamily;widgetPopupContainer.style.fontSize=widgetWelcomePopupFontSize;widgetPopupContainer.innerText=widgetWelcomePopupMessage;document.body.appendChild(widgetPopupContainer);const widgetPopupCloseIcon=document.createElement('i');widgetPopupCloseIcon.className='fa fa-times wl-chat-widget-close-icon wl-chat-widget-fade';widgetPopupCloseIcon.style.position='absolute';if(isMobileDevice){widgetPopupCloseIcon.style.top='8px';widgetPopupCloseIcon.style.right='8px';widgetPopupCloseIcon.style.fontSize='20px';widgetPopupCloseIcon.style.padding='5px';widgetPopupCloseIcon.style.color='#333 !important';widgetPopupCloseIcon.style.background='#f0f0f0';widgetPopupCloseIcon.style.borderRadius='50%';widgetPopupCloseIcon.style.width='25px';widgetPopupCloseIcon.style.height='25px';widgetPopupCloseIcon.style.display='flex';widgetPopupCloseIcon.style.alignItems='center';widgetPopupCloseIcon.style.justifyContent='center';widgetPopupCloseIcon.classList.add('show')}else{widgetPopupCloseIcon.style.top='6px';widgetPopupCloseIcon.style.right='8px'} 221widgetPopupCloseIcon.style.cursor='pointer';widgetPopupContainer.appendChild(widgetPopupCloseIcon);widgetPopupCloseIcon.onclick=function(e){e.stopPropagation();widgetPopupContainer.classList.remove('show');setTimeout(function(){widgetPopupContainer.style.display='none'},250);document.body.removeEventListener('click',playSoundAndShowPopup);widgetWelcomePopupClosed=!0;if(isMobileDevice){localStorage.setItem(`welcomePopupClosed_${widgetBotId}`,'true')} 222localStorage.setItem(`lastPopupShownTime_${widgetBotId}`,Date.now().toString());if(widgetWelcomePopupTimeoutId){clearTimeout(widgetWelcomePopupTimeoutId)}};if(widgetWelcomePopupEnabled&&shouldShowWelcomePopup()){widgetWelcomePopupTimeoutId=setTimeout(function(){if(!widgetChatIconClicked&&!widgetWelcomePopupClosed&&shouldShowWelcomePopup()){widgetPopupContainer.style.display='block';widgetPopupContainer.classList.add('show');localStorage.setItem(`lastPopupShownTime_${widgetBotId}`,Date.now().toString())}},widgetWelcomePopupDelay*1000)} 223widgetIconContainer.onclick=function(){widgetChatIconClicked=!0;widgetPopupContainer.classList.remove('show');setTimeout(function(){widgetPopupContainer.style.display='none'},250);widgetWelcomePopupClosed=!0;if(isMobileDevice){sessionStorage.setItem("mobileChatActive","true");window.location.href=widgetChatUrl}else{if(widgetFrameContainer.classList.contains('show')){widgetFrameContainer.classList.remove('show');setTimeout(()=>{widgetFrameContainer.style.display='none';sessionStorage.setItem("chatOpen","false");if(!widgetChatIcon){const widgetIconBubble=widgetIconContainer.querySelector('#wl-chat-widget-icon-bubble');widgetIconBubble.innerHTML='';widgetIconBubble.appendChild(createSvgElement(originalSvgPath,widgetChatIconColor,'0 0 32 32',!0))}},250)}else{widgetFrameContainer.style.display='block';setTimeout(()=>{widgetFrameContainer.classList.add('show');sessionStorage.setItem("chatOpen","true");if(!widgetChatIcon){const widgetIconBubble=widgetIconContainer.querySelector('#wl-chat-widget-icon-bubble');widgetIconBubble.innerHTML='';widgetIconBubble.appendChild(createSvgElement(alternateSvgPath,widgetChatIconColor,'0 0 24 24',!1))}},0)}}};widgetPopupContainer.onclick=function(){widgetChatIconClicked=!0;widgetPopupContainer.classList.remove('show');widgetPopupContainer.style.display='none';widgetWelcomePopupClosed=!0;if(isMobileDevice){sessionStorage.setItem("mobileChatActive","true");window.location.href=widgetChatUrl}else{widgetFrameContainer.style.display='block';setTimeout(function(){widgetFrameContainer.classList.add('show');sessionStorage.setItem("chatOpen","true");if(!widgetChatIcon){const widgetIconBubble=widgetIconContainer.querySelector('#wl-chat-widget-icon-bubble');widgetIconBubble.innerHTML='';widgetIconBubble.appendChild(createSvgElement(alternateSvgPath,widgetChatIconColor,'0 0 24 24',!1))}},0)}};widgetPopupContainer.onmouseover=function(){widgetPopupCloseIcon.classList.add('show')};widgetPopupContainer.onmouseout=function(){widgetPopupCloseIcon.classList.remove('show')};const chatOpen=sessionStorage.getItem("chatOpen");if(chatOpen==="true"){widgetChatIconClicked=!0;if(!widgetChatIcon){const widgetIconBubble=widgetIconContainer.querySelector('#wl-chat-widget-icon-bubble');widgetIconBubble.innerHTML='';widgetIconBubble.appendChild(createSvgElement(alternateSvgPath,widgetChatIconColor,'0 0 24 24',!1))}} 224if(widgetChatIconClicked){document.body.removeEventListener('click',playSoundAndShowPopup)}else{document.body.addEventListener('click',playSoundAndShowPopup)}}).catch(error=>{if(error.message&&error.message.indexOf("Bot not found")!==-1){const existingErrorContainer=document.getElementById('wl-chat-widget-icon-container');if(existingErrorContainer){existingErrorContainer.remove()} 225const widgetErrorIconContainer=document.createElement('div');widgetErrorIconContainer.id='wl-chat-widget-icon-container';widgetErrorIconContainer.style.position='fixed';widgetErrorIconContainer.style.bottom='20px';widgetErrorIconContainer.style.right='20px';widgetErrorIconContainer.style.cursor='default';widgetErrorIconContainer.style.zIndex='99999';widgetErrorIconContainer.title='Chat widget unavailable';const widgetErrorBubble=document.createElement('div');widgetErrorBubble.id='wl-chat-widget-icon-bubble';widgetErrorBubble.style.width='60px';widgetErrorBubble.style.height='60px';widgetErrorBubble.style.borderRadius='50%';widgetErrorBubble.style.backgroundColor='#1DA1F2';widgetErrorBubble.style.display='flex';widgetErrorBubble.style.justifyContent='center';widgetErrorBubble.style.alignItems='center';
225widgetErrorBubble.style.boxShadow='10px 10px 10px 0px rgba(0,0,0,0.2)';function createSvgElement(path,color,viewBox,isFilled=!0){const svg=document.createElementNS('http://www.w3.org/2000/svg','svg');svg.setAttribute('viewBox',viewBox);svg.setAttribute('width','35');svg.setAttribute('height','35');const pathEl=document.createElementNS('http://www.w3.org/2000/svg','path');pathEl.setAttribute('d',path);if(isFilled){pathEl.setAttribute('fill',color)}else{pathEl.setAttribute('stroke',color);pathEl.setAttribute('stroke-linecap','round');pathEl.setAttribute('stroke-linejoin','round');pathEl.setAttribute('fill','none')} 226svg.appendChild(pathEl);return svg} 227const originalSvgPath='M27.91 11.79c.176.792.278 1.606.278 2.442 0 6.456-5.48 11.838-12.696 12.994 1.526.616 3.236.976 5.058.976 1.718 0 3.34-.316 4.804-.866 1.854.632 3.878.796 5.552.796A14.237 14.237 0 0 1 29 25.164c1.856-1.656 3-3.85 3-6.266 0-2.856-1.594-5.402-4.09-7.108zm-2.722 2.442C25.188 8.582 19.55 4 12.594 4S0 8.582 0 14.232c0 2.948 1.542 5.596 3.998 7.464a15.646 15.646 0 0 1-2.57 4.344c2.516 0 5.756-.33 8.25-1.862.938.182 1.912.288 2.916.288 6.956-.002 12.594-4.582 12.594-10.234z';const widgetErrorIcon=createSvgElement(originalSvgPath,'#ffffff','0 0 32 32',!0);widgetErrorBubble.appendChild(widgetErrorIcon);widgetErrorIconContainer.appendChild(widgetErrorBubble);document.body.appendChild(widgetErrorIconContainer);return} 228console.error('There was a problem with the fetch operation: '+error.message)})})()
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.