(()=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}var e=null,n=null,l=null,i="chtl-chat-iframe",r="chatling-embed-script",o="chtl-script",a="chatling-inline-bot",u="chtl-inline-bot",c=null,s=null,d=null,h=null,f="chtl-open-chat-icon",p="chtl-close-chat-icon",y="chtl-chat-icon-container",m=null;null==m&&(m="1.3.15");var v=null,g=640,b=700,w=2147483647,x=null,_=365,E=!1,C=!1,A=null,I=0,k=null,S=null,B="floating",O="fullscreen",L="page_inline",T="floating",z=null,N=200,M=!1,D=[],j=!1,P=null,R=null,W=null,F=!0,J="pointer";function V(t){try{if(!t)return!1;var e=t.key;return"Enter"===e||" "===e||"Spacebar"===e}catch(t){return!1}}try{window.addEventListener("keydown",(function(){J="keyboard"}),!0),window.addEventListener("pointerdown",(function(){J="pointer"}),!0),window.addEventListener("mousedown",(function(){J="pointer"}),!0),window.addEventListener("touchstart",(function(){J="pointer"}),!0)}catch(t){}function H(t,e){try{if(!t)return;e?(t.setAttribute("tabindex","0"),t.removeAttribute("aria-hidden")):(t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"))}catch(t){}}var G,q={LAST_PAGEVIEW:"chtl_last_pageview",SESSION_ID:"chtl_sid",LOCAL_STORAGE_SESSION_ID:"chtl_lsid"};function $(){return null!=e&&("1"==e||"1.0"==e)}function U(){return null!=e&&("2"==e||"2.0"==e)}window.addEventListener("message",(function(t){try{if(t&&"chtl_chat_minimized"===t.data)ct();else{if(null==t)return;if(null==t.data)return;if(null==t.data.event_id)return;var n=t.data.event_id,i=null,r=null;if(null==n)return;if("chtl_new_chat"==n)null!=(i=t.data.data)&&function(t,e){var n=et();if(null==n)return;var l=pt();null==l&&(l=[]);l=[];var i={chat_gid:t,customer_gid:e,created_at:Date.now()};l.push(i);var r=JSON.stringify(l),o=btoa(r);yt(n,o,30)}(r=i.chat_gid,null);else if("chtl_chat_created_w2"==n)null!=(i=t.data.data)&&(r=i.chat_id,S=r,function(t){var n=et();if(null==n)return;var l=pt();null==l&&(l=[]);l=[];var i={chat_gid:t,chatbot_version:e,created_at:Date.now()};l.push(i);var r=JSON.stringify(l),o=btoa(r);yt(n,o,30)}(r));else if("chtl_customer_info_collected"==n){if(null==t.data.data)return;var o=t.data.data.customer;null!=o&&(x=o,rt(o))}else if("chtl_loaded"==n){if(null!=l){if(null!=x&&ot({event_id:"chtl_cust_load",cust:x,custgid:null}),ut()&&ot({event_id:"is_mobile",window_width:at()}),$()&&null!=k&&k.length>0&&ot({event_id:"chtl_conversation_history",lcg:S,messages:k}),U()){var a=mt();ot({event_id:"chtl_chatbot_init",lcg:S,cuid:a,display_type:B,locale:z,ru:M,page_url:window.location.href,page_title:xt(),browser:function(){try{var t=navigator.userAgent,e=null;return t.includes("Chrome")?e="chrome":t.includes("Firefox")?e="firefox":t.includes("Safari")&&!t.includes("Chrome")?e="safari":t.includes("Edge")?e="edge":t.includes("Opera")||t.includes("OPR")?e="opera":(t.includes("MSIE")||t.includes("Trident/"))&&(e="ie"),e}catch(t){return null}}(),device_type:function(){try{var t=navigator.userAgent;return/tablet|ipad|playbook|silk/i.test(t)&&!/mobile/i.test(t)?"tablet":/Mobile|Android|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)?"mobile":/SmartTV|TV/i.test(t)?"tv":"desktop"}catch(t){return null}}(),os:function(){try{var t=navigator.userAgent;return/Windows/.test(t)?"windows":/Mac OS X/.test(t)?"macos":/Linux/.test(t)?"linux":/iPhone|iPad|iPod/.test(t)?"ios":/Android/.test(t)?"android":/BlackBerry|BB10/.test(t)?"blackberry":/Windows Phone/.test(t)?"windows-phone":/PlayBook/.test(t)?"playbook":/Silk/.test(t)?"silk":/Kindle/.test(t)?"kindle":null}catch(t){}}(),variables:R,language:wt()})}}}else if("chtl_chat_cleared"==n)!function(){var t=et();if(null==t)return;gt(t)}();else if("chtl_chatbot_loaded"==n)B==O||B==L?st():St();else if("chtl_gvia"==n){if(null==t.data.data)return;var u=t.data.data.t;if(null==u)return;c=function(t){if(null!=t){var e=btoa(t);ot({event_id:"chtl_gvia_fetched",data:{t:u,c:e}})}},function(t){fetch("https://api.ipify.org?format=json").then((function(t){return t.json()})).then((function(e){return e&&e.ip?void t(e.ip):void t(null)})).catch((function(e){t(null)}))}((function(t){null==t?function(t){try{fetch("https://www.cloudflare.com/cdn-cgi/trace").then((function(t){return t.text()})).then((function(e){var n=e.match(/ip=(.+)/);if(n&&n[1]){var l=n[1];if(null!=t)return void t(l)}t(null)})).catch((function(e){t(null)}))}catch(e){t(null)}}((function(t){null==t||c(t)})):c(t)}))}}}catch(t){}var c})),function(){var t,e=(t=localStorage.getItem(q.LAST_PAGEVIEW))?parseInt(t,10):null;if(!e)return!1;var n=Math.floor(Date.now()/1e3);M=n-e>=10800}(),G=Math.floor(Date.now()/1e3),localStorage.setItem(q.LAST_PAGEVIEW,G);var K=null,X=!1,Y=null;function Z(t){try{if(null!=K)return;K=setTimeout((function(){K=null,function(t){try{r=window.location.href,null!=(e=null==r?null:r.replace(/\?.*$/,"").replace(/#.*$/,"").replace(/\/$/,""))&&D.includes(e)?function(){try{ct(),ft(),j=!0;try{null!=s&&(s.style.display="none")}catch(t){}try{null!=h&&(h.style.display="none")}catch(t){}}catch(t){}}():function(){try{j&&(ft(),j=!1)}catch(t){}}(),function(){try{if(null==l&&(l=document.getElementById(i)),null==c&&(c=document.getElementById(y)),null==s&&(s=document.getElementById(f)),null==d&&(d=document.getElementById(p)),null!=W){var t=document.getElementById(i);if(null!=t?l=t:null!=n&&n.length>0&&Ct(W),B==T){var e=document.getElementById(y);null!=e?c=e:(Q(f),Q(p),_t(W))}var r=It();null==l||null==r||document.documentElement.contains(l)||r.appendChild(l),null==c||null==r||document.documentElement.contains(c)||r.appendChild(c),null!=l&&B==T&&Et(W)}}catch(t){}}()}catch(t){}var e,r}()}),50)}catch(t){}}function Q(t){try{if(null==t)return;var e=document.getElementById(t);null!=e&&e.remove()}catch(t){}}function tt(){return it("chtl_cus")}function et(){return it("chtl_chats")}function nt(){return it("chtl_opened")}function lt(){return it("chtl_hmt")}function it(t){return null==t||0==t.length||0==(t=t.trim()).length?null:(null==n&&(n=bt()),null!=n?t+"_"+n:null)}function rt(t){if(null!=t)try{var e=tt();if(null==e)return;for(var n in t)null===t[n]&&delete t[n];var l=JSON.stringify(t);yt(e,btoa(l),_)}catch(t){}}function ot(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"*";try{null!=l&&l.contentWindow.postMessage(t,e)}catch(t){}}function at(){try{return window.innerWidth}catch(t){return null}}function ut(){var t=at();return null!==t&&t<g}function ct(){try{var t=l;null==t&&(t=document.getElementById(i)),null!=t&&(t.style.transform="scale(0)",setTimeout((function(){t.style.zIndex=-1,t.style.display="none"}),N)),ot({event_id:"chtl_chat_widget_closed"})}catch(t){}ft();try{var e=s||document.getElementById(f),n=d||document.getElementById(p);e&&e.setAttribute("aria-expanded","false"),n&&n.setAttribute("aria-expanded","false")}catch(t){}}function st(t){try{var e=l;null==e&&(e=document.getElementById(i)),null!=e&&(e.style.zIndex=w,e.style.display="block",setTimeout((function(){e.style.transform="scale(1)"}),10));var n=nt();null!=n&&yt(n,!0,30),ht("hide");var r=t;null!=r&&0!=r.length||(r=J||"pointer"),ot({event_id:"chtl_chat_widget_opened",data:{input_modality:r}})}catch(t){}!function(){try{if(s)s.style.display="none",H(s,!1);else{var t=document.getElementById(f);t&&(t.style.display="none",H(t,!1))}if(!ut())if(d)d.style.display="flex",H(d,!0);else{var e=document.getElementById(p);e&&(e.style.display="flex",H(e,!0))}}catch(t){}}(),null!=v&&clearTimeout(v);try{var o=s||document.getElementById(f),a=d||document.getElementById(p);o&&o.setAttribute("aria-expanded","true"),a&&a.setAttribute("aria-expanded","true")}catch(t){}}function dt(){try{if(l){if("block"==l.style.display)return!0}else if(1==document.getElementById(i).style.scale)return!0}catch(t){}return!1}function ht(t){try{null!=h&&("hide"==t?(h.style.display="none",function(){var t=lt();if(null!=t){var e=Math.floor(Date.now()/1e3);if(null!=P){var n=P.frequency_id;if(null!=n&&1!=n){var l=function(t){var e={1:0,2:365,3:1,4:7,5:30};return null==t?null:t in e?e[t]:null}(n);null!==l&&yt(t,e,l)}}}}()):"show"==t&&function(){var t=lt();if(null==t)return!1;var e=vt(t),n=P.frequency_id;if(null===n)return!1;if(dt())return!1;if(1==n)return gt(t),!0;var l=!1,i=null,r=Math.floor(Date.now()/1e3);return null==e?l=!0:i=r-e,2==n&&i>31536e3&&(l=!0),3==n&&i>86400&&(l=!0),4==n&&i>604800&&(l=!0),5==n&&i>2592e3&&(l=!0),!!l}()&&(h.style.display="block"))}catch(t){}}function ft(){try{if(s)s.style.display="flex",H(s,!0);else{var t=document.getElementById(f);t&&(t.style.display="flex",H(t,!0))}if(d)d.style.display="none",H(d,!1);else{var e=document.getElementById(p);e&&(e.style.display="none",H(e,!1))}}catch(t){}}function pt(){var t=et();if(null==t)return null;var e=vt(t),n=[];if(null==e)return n;try{var l=atob(e);if(null==l||0==l.length)return n;var i=JSON.parse(l);return null==i?n:i}catch(t){return n}}function yt(t,e,n){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"Strict",i="";if(n){var r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3),i=";expires="+r.toUTCString()}var o=null;try{null!=(o=window.location.hostname)&&0!=o.length||(o=location.hostname)}catch(t){}null!=o&&o.length>0&&(document.cookie=t+"="+(e||"")+i+";path=/;domain=."+o+";SameSite="+l)}function mt(){var t=null;null==x&&(x=function(){try{var t=tt();if(null==t)return;var e=vt(t);if(null==e)return;var n=atob(e);return JSON.parse(n)}catch(t){return null}}());try{null!=x&&(t=x.uuid)}catch(t){}return t}function vt(t){if(null==t||0==t.length)return null;if(0==(t=t.trim()).length)return null;for(var e=t+"=",n=decodeURIComponent(document.cookie).split(";"),l=0;l<n.length;l++){for(var i=n[l];" "===i.charAt(0);)i=i.substring(1);if(0===i.indexOf(e))return i.substring(e.length,i.length)}return null}function gt(t){if(null!=t&&0!=t.length)try{document.cookie=t+"=; Max-Age=-99999999;"}catch(t){}}function bt(){var t=null;try{null!=window.chtlConfig&&(t=window.chtlConfig.chatbotId)}catch(t){}if(null==t||0==t.length){var e=document.getElementById(r);null==e&&(e=document.getElementById(o)),null!=e&&(t=e.getAttribute("data-id"))}return null!=t&&(t=t.trim()),t}function wt(){var t=null;try{window&&window.chtlConfig&&(t=window.chtlConfig.language)}catch(t){}return null==t&&(t=null),t}function xt(){try{return document.title}catch(t){return null}}function _t(t){var e=t.chat_icon.url,n=t.position.value,l=t.position.x,r=t.position.y;if(null!=l)try{l=parseInt(l)}catch(t){}if(null!=r)try{r=parseInt(r)}catch(t){}var o=t.primary_color,a=t.chat_icon.border_radius,u=t.chat_icon.size,m=t.chat_icon.color;(c=document.createElement("div")).setAttribute("id",y),c.style.position="fixed",c.style.zIndex=w,"bl"==n?(c.style.bottom=r+"px",c.style.left=l+"px"):"tl"==n?(c.style.top=r+"px",c.style.left=l+"px"):"tr"==n?(c.style.top=r+"px",c.style.right=l+"px"):(c.style.bottom=r+"px",c.style.right=l+"px"),F||(c.style.display="none"),(s=document.createElement("button")).setAttribute("id",f),s.setAttribute("type","button"),s.style.justifyContent="center",s.style.alignItems="center",s.style.cursor="pointer",s.style.borderRadius=a,s.setAttribute("aria-label","Open chat"),s.setAttribute("aria-controls",i),s.setAttribute("aria-expanded","false"),s.style.border="none",s.style.padding="0",s.style.margin="0",s.style.outline="none",s.style.background="transparent",s.style.webkitAppearance="none",s.style.appearance="none";var v=document.createElement("div");v.style.height=u+"px",v.style.width=u+"px",v.style.cursor="pointer",v.style.borderRadius=a;var g=v.cloneNode(!0);if(null==e){s.style.backgroundColor=o,v.style.display="flex",v.style.justifyContent="center",v.style.alignItems="center",v.style.backgroundColor=o;var b=document.createElementNS("http://www.w3.org/2000/svg","svg");b.setAttribute("style","transition: width ease-in-out 0.05s; width: "+u/2+"px; height: "+u/2+"px;"),b.setAttribute("viewBox","0 0 820 760"),b.setAttribute("fill","none");var x=document.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d","M400 0C179.44 0 9.84565e-05 161.493 9.84565e-05 360C9.84565e-05 429.4 21.9601 496.613 63.5734 554.72C55.6934 641.88 34.5734 706.587 3.90677 737.24C-0.146568 741.293 -1.1599 747.493 1.4001 752.613C3.6801 757.187 8.33343 760 13.3334 760C13.9468 760 14.5734 759.96 15.2001 759.867C20.6001 759.107 146.04 741.04 236.76 688.693C288.293 709.48 343.173 720 400 720C620.56 720 800 558.507 800 360C800 161.493 620.56 0 400 0Z"),x.setAttribute("fill",m),b.appendChild(x),v.appendChild(b)}else v.style.backgroundImage="url("+e+")",v.style.backgroundSize="cover",v.style.backgroundRepeat="no-repeat",v.style.backgroundPosition="center";(d=s.cloneNode(!0)).setAttribute("id",p),d.setAttribute("type","button"),d.setAttribute("aria-label","Close chat"),d.setAttribute("aria-expanded","false"),g.style.display="flex",g.style.justifyContent="center",g.style.alignItems="center",g.style.backgroundColor=o;var _=document.createElementNS("http://www.w3.org/2000/svg","svg");_.setAttribute("style","width: "+.6*u+"px; height: "+.6*u+"px; position: relative; transition: transform 0.3s ease; rotate: 90deg; padding: 0;"),_.setAttribute("viewBox","0 0 24 24"),_.setAttribute("fill","none");var E=document.createElementNS("http://www.w3.org/2000/svg","path");E.setAttribute("d","M9.00005 6L15 12L9 18"),E.setAttribute("stroke",m),E.setAttribute("stroke-width","1.5"),E.setAttribute("stroke-miterlimit","16"),_.appendChild(E),g.appendChild(_),d.appendChild(g),s.style.display="flex",H(s,!0),d.style.display="none",H(d,!1),s.appendChild(v),c.appendChild(s),c.appendChild(d),At(c),function(t){try{if(null==t)return;var e=t.attention_grabber;if(P=t.hovering_message,null==e)return;if(null==P)return;var n=P.font,l=P.border,i=P.shadow,r=P.background_color||"#ffffff",o=15,a="#000000",u=1,s="#e6e9ee",d=5,f=!0;null!=n&&(null!==n.size&&(o=n.size),null!=n.color&&(a=n.color)),null!=l&&(null!==l.size&&(u=l.size),null!=l.color&&(s=l.color),null!==l.roundness&&(d=l.roundness)),null!=i&&null!==i.enabled&&(f=i.enabled);var p=e.delay;if(1!=(ut()?e.mobile.enabled:e.desktop.enabled))return;var y=e.messages;if(null==y||0==y.length)return;if(0==(y=y.filter((function(t){return null!=t&&(null!=(t=t.trim())&&0!=t.length)}))).length)return;var m=350,v=at();(h=document.createElement("div")).style.position="absolute";var g=0,b=5,w=t.position.x,x=t.position.y;if(null!=w)try{w=parseInt(w)}catch(t){}if(null!=x)try{x=parseInt(x)}catch(t){}var _=t.chat_icon.size;null!=x&&(g=_);var E=t.position.value,C=g+b,A=0,I=document.createElement("div");I.style.position="absolute",I.style.top="-25px",I.style.zIndex="1",I.style.cursor="pointer",I.style.background=r,I.style.borderRadius="999px",I.style.padding="5px",I.style.border="1px solid "+s,I.style.display="flex",I.style.alignItems="center",I.style.justifyContent="center",I.setAttribute("id","cthl-hovering-message-close-btn");var k=document.createElementNS("http://www.w3.org/2000/svg","svg");k.setAttribute("style","width: 8px; height: 8px; padding: 0;"),k.setAttribute("viewBox","0 0 16 16"),k.setAttribute("fill","none");var S=document.createElementNS("http://www.w3.org/2000/svg","path");S.setAttribute("d","M2 14L14 2M2 2L14 14"),S.setAttribute("stroke",a),S.setAttribute("stroke-width","3"),S.setAttribute("stroke-linecap","round"),S.setAttribute("stroke-linejoin","round"),k.appendChild(S),I.appendChild(k),"bl"==E?(h.style.bottom=C+"px",h.style.left=A+"px",I.style.left="0px"):"tl"==E?(h.style.top=C+"px",h.style.left=A+"px",I.style.left="0px"):"tr"==E?(h.style.top=C+"px",h.style.right=A+"px",I.style.right="0px"):(h.style.bottom=C+"px",h.style.right=A+"px",I.style.right="0px"),h.style.display="none",null!=v&&ut()?(m>v&&(m=v-25),h.style.width=m+"px"):h.style.width=m+"px",h.appendChild(I);var B=document.createElement("div");B.style.display="flex",B.style.width="100%",B.style.flexDirection="column",B.style.gap="5px";y.forEach((function(t){var e=document.createElement("div");e.style.cursor="pointer",e.classList.add("chtl-hovering-message-container"),e.style.padding="10px 15px",e.style.position="relative",e.style.borderRadius=d+"px",e.style.width="fit-content",e.style.maxWidth="100%",e.style.whiteSpace="pre-wrap",e.style.wordBreak="break-word",B.style.alignItems="bl"==E||"tl"==E?"flex-start":"flex-end",e.style.backgroundColor=r,e.style.fontSize=o+"px",e.style.color=a,e.style.border=u+"px solid "+s,f&&(e.style.boxShadow="-2px 0px 10px rgba(0, 0, 0, 0.05)",e.style.mozBoxShadow="-2px 0px 10px rgba(0, 0, 0, 0.05)"),e.innerHTML=t,e.addEventListener("click",(function(){st()})),B.appendChild(e)})),c.appendChild(h),h.appendChild(B),I.addEventListener("click",(function(){ht("hide")})),(null==p||p<0)&&(p=0),setTimeout((function(){ht("show")}),1e3*p)}catch(t){}}(t),s.addEventListener("click",(function(){st("pointer")})),s.addEventListener("keydown",(function(t){if(V(t)){try{t.preventDefault()}catch(t){}st("keyboard")}})),d.addEventListener("click",(function(){ct()})),d.addEventListener("keydown",(function(t){if(V(t)){try{t.preventDefault()}catch(t){}ct()}}))}function Et(t){if(null!=t){var e=t.position.value,n=t.position.x,i=t.position.y,r=t.chat_icon.size;if(null!=n)try{n=parseInt(n)}catch(t){}if(null!=i)try{i=parseInt(i)}catch(t){}var o=F?i+r+20:i;null!=i&&window.innerHeight-o-50>b&&b,"bl"==e?(l.style.bottom=o+"px",l.style.left=n+"px",l.style.transformOrigin="bottom left"):"tl"==e?(l.style.top=o+"px",l.style.left=n+"px",l.style.transformOrigin="top left"):"tr"==e?(l.style.top=o+"px",l.style.right=n+"px",l.style.transformOrigin="top right"):(l.style.bottom=o+"px",l.style.right=n+"px",l.style.transformOrigin="bottom right")}}function Ct(t){var e=null,r=null;null!=t&&(e=t.custom_domain,r=null==t?void 0:t.type);var o="https://embed.chatling.ai";if(null!=e&&(o="https://"+e),(l=document.createElement("iframe")).setAttribute("allow","microphone"),l.setAttribute("allowfullscreen","true"),l.setAttribute("mozallowfullscreen","true"),l.setAttribute("webkitallowfullscreen","true"),2==r)l.src=o+"/ag/"+n;else if($())l.src="https://embed.chatling.ai/widgets/"+n;else{if(!U())return;l.src=o+"/w2/"+n}if(l.style.border="none",B==O)l.style.position="fixed",l.style.height="100%",l.style.width="100%",l.style.minHeight="80px",l.style.zIndex=w,l.style.overflow="hidden",l.style.borderRadius="0",l.style.top="0",l.style.left="0";else if(B==L)l.style.height="100%",l.style.width="100%",l.style.overflow="hidden",l.style.borderRadius="0";else{var c=t.chat_interface.width,s=b;l.style.display="none",l.style.position="fixed",l.style.height="80vh",l.style.minHeight="80px",l.style.maxHeight=s+"px",l.style.overflow="hidden",l.style.width="100%",l.style.maxWidth=c+"px",l.style.borderRadius="15px",l.style.transition="transform "+N+"ms ease-in-out 0s",l.style.transform="scale(0)",l.style.zIndex="-1"}if(Et(t),l.setAttribute("id",i),l.setAttribute("class","chtl-display-"+B),l.addEventListener("load",(function(){B==T&&(l.style.boxShadow="rgba(0, 0, 0, 0.01) 0px 5px 10px 0px, rgba(0, 0, 0, 0.1) 0px 7px 12px 0px")})),B==L){var d=document.getElementById(a);null==d&&(d=document.getElementById(u)),null!=d&&d.appendChild(l)}else At(l)}function At(t){var e=It();e?e.appendChild(t):setTimeout((function(){var e=It();e&&e.appendChild(t)}),4e3)}function It(){try{if(null==document)return null;var t=document.body,e=document.documentElement;if(null==t)return e;try{var n=window.getComputedStyle(t);if(null!=n){var l=n.transform||n.webkitTransform,i=n.filter||n.webkitFilter,r=n.perspective||n.webkitPerspective;if(l&&"none"!==l||i&&"none"!==i||r&&"none"!==r)return e||t}}catch(t){}return t}catch(t){return document.body||document.documentElement}}function kt(t){var e="";if(null!=t){var n=t.hovering_message,l="#000";null!=n&&null!=n.font&&(null!=n.font.color&&(l=n.font.color),null!==n.font.size&&n.font.size),B==T&&(e="@media all and (max-width: 640px) {#chtl-chat-iframe.chtl-display-"+T+" {    width: 100% !important;    max-width: initial !important;    right: 0px !important;    top: 0px !important;    left: 0 !important;    bottom: 0px !important;    max-height: initial !important;    height: 100% !important;    border-radius: 0px !important;}}#"+f+", #"+p+" {    -webkit-appearance: none !important;    appearance: none !important;    border: 0 !important;    background: transparent !important;    background-color: transparent !important;    background-image: none !important;    box-shadow: none !important;    text-shadow: none !important;    margin: 0 !important;    padding: 0 !important;    font: inherit !important;    color: inherit !important;    line-height: 0 !important;    text-transform: none !important;    overflow: visible !important;    isolation: isolate !important;}#"+f+"::-moz-focus-inner, #"+p+"::-moz-focus-inner {    border: 0 !important;    padding: 0 !important;}#"+f+", #"+p+" {    transition: scale 0.2s ease 0s;    scale: 1;}#"+f+":hover, #"+p+":hover {    scale: 1.1;}#"+f+":focus-visible, #"+p+":focus-visible {    outline: 2px solid #111827 !important;    outline-offset: 3px !important;    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(17, 24, 39, 0.9) !important;}"),e+=".chtl-hovering-message-container *, .chtl-hovering-message-container *::before, .chtl-hovering-message-container *::after {    font-size: inherit !important;}.chtl-hovering-message-container p, .chtl-hovering-message-container p span, .chtl-hovering-message-container p em, .chtl-hovering-message-container p u {    color: "+l+" !important;    margin: 0 !important;    font-weight: 400 !important;}";var i=document.createElement("style");i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e)),document.head.appendChild(i)}}function St(){"open_once"==A&&function(){var t=nt();if(null==t)return!1;var e=vt(t);return 1==e||"true"==e}()||(ut()?E&&(v=setTimeout((function(){st()}),1e3*I)):C&&(v=setTimeout((function(){st()}),1e3*I)))}!function(){if(!X){X=!0;try{["pushState","replaceState"].forEach((function(t){try{var e=history[t];if("function"!=typeof e)return;history[t]=function(){var t=e.apply(history,arguments);return Z(),t}}catch(t){}})),window.addEventListener("popstate",(function(){Z()})),window.addEventListener("hashchange",(function(){Z()}))}catch(t){}}}(),function(){try{if(null!=Y)return;if("undefined"==typeof MutationObserver)return;Y=new MutationObserver((function(){try{var t=null==document.getElementById(i),e=B==T&&null==document.getElementById(y);(t||e)&&Z()}catch(t){}}));var t=document.documentElement||document.body;null!=t&&Y.observe(t,{childList:!0,subtree:!0})}catch(t){}}(),function(){if(n=bt(),B=function(){var t=null,e=T;try{null!=window.chtlConfig&&(t=window.chtlConfig.display)}catch(t){}if(null==t||0==t.length){var n=document.getElementById(r);null==n&&(n=document.getElementById(o)),null!=n&&null!=(t=n.getAttribute("data-display"))&&t.length>0&&(t=t.trim())}(null==t||0==t.length||t!=O&&t!=L&&t!=T)&&(t=e);return t}(),F=function(){var t=true;try{window&&window.chtlConfig&&(t=window.chtlConfig.chatIconVisible)}catch(t){}null==t&&(t=true);return 1==t}(),R=function(){if(null==window||null==window.chtlConfig)return null;var t=window.chtlConfig.variables;return null==t?null:t}(),!n)return;try{z=navigator.language||navigator.languages[0]}catch(t){}try{var t=function(){try{var t=pt();return null==t||0==t.length?null:t[t.length-1]}catch(t){return null}}();null!=t&&(S=t.chat_gid)}catch(t){}var l=mt();!function(){var t=tt();if(null==t)return;var e=vt(t);if(null==e)return;yt(t,e,_)}();var i={widget_id:n,lcg:S,cuid:l,display_type:B,locale:z,page_url:window.location.href};fetch("https://chatling.ai/public/embed/chatbot/setup",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i)}).then((function(t){try{t.json().then((function(t){if(null!=t&&null!=t.success&&0!=t.success){var n=t.data;if(null!=n){try{var i=n.chat;if(null!=i){var r=i.messages;null!=r&&r.length>0&&(k=r)}}catch(t){}if(null==l){var o=n.cuid;null!=o&&o.length>0&&(null==x?x={uuid:o}:x.uuid=o,rt(x))}D=n.hide_pages,e=n.version,($()||U())&&(W=n,$()||B==T?(B=T,_t(n),Ct(n),kt(n),function(t){try{if(null==t)return;var e=t.auto_open;if(null!=e){C=e.enable_on_desktop,E=e.enable_on_mobile;var n=e.delay;A=e.behavior,(null==n||n<0)&&(n=0),I=n,$()&&St()}}catch(t){}}(n)):(B==O||B==L)&&(Ct(n),kt(n)))}}}))}catch(t){}})).catch((function(t){}))}(),null!=window&&(window.Chatling={setVariables:function(e,l){if(!$())if(null!=e)if("object"===t(e))if(0!==Object.keys(e).length){var i=null;window&&window.location&&window.location.hostname&&(i=window.location.hostname);var r={variables:e,cgid:S,egid:n,domain:i,cuid:mt()};fetch("https://chatling.ai/public/embed/chatbot/v2/chat/svv",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(r)}).then((function(t){if(!t.ok){var e="Failed to save variables (CODE 7005)",n=t.status;return 429==n?e="You're sending too many requests. Please try again later.":500==n?e="Server error.":200!=n&&(e="Failed to save variables (CODE 7006)"),void l(!1,e)}try{t.json().then((function(t){null!=t?null!=t.success?0!=t.success?1!=t.success||l(!0,null):l(!1,t.data):l(!1,"Failed to save variables (CODE 7002)"):l(!1,"Failed to save variables (CODE 7001)")}))}catch(t){l(!1,"Failed to save variables (CODE 7003)")}})).catch((function(t){l(!1,"Failed to save variables (CODE 7004)")}))}else null!=l&&l(!1,"No variables provided");else null!=l&&l(!1,"Invalid variables. Must be an object with key-value pairs.");else null!=l&&l(!1,"No variables provided")},open:st,minimize:ct,destroy:function(){try{var t=l;if(null==t&&(t=document.getElementById(i)),null!=t){t.remove();var e=document.getElementById(f),n=document.getElementById(p);null!=e&&e.remove(),null!=n&&n.remove()}}catch(t){}},showChatIcon:function(){if(null==c)return;c.style.display="",F=!0,Et(W)},hideChatIcon:function(){if(null==c)return;c.style.display="none",F=!1,Et(W)}})})();