1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7587],{77587:function(t,e,o){"use strict";o.r(e),o.d(e,{getServerSideProps:function(){return S},getStaticProps:function(){return m}});var i=o(96911),l=o(53399),n=o(26175),d=o(85191),u=o(32862),a=o(87383),r=o(97803),s=o(11163),c=o(67294),v=o(54794),f=o(13040),b=o(74297),p=o.n(b),h=o(85893);const g=(0,f.jl)("Chatbot"),C="chatbot-embedded-script",m=async(t,e)=>S(t,e,{}),S=async(t,e)=>{var o;let i="";const u=null===e||void 0===e||null===(o=e.sitecore)||void 0===o?void 0:o.context,a=await(0,d.D4)(n.RM.SiteSetting,u)??null;if(a){const t=(0,l.XT)(v.EL,null===a||void 0===a?void 0:a.TealiumSettings);i=(0,l.XT)(t,null===a||void 0===a?void 0:a.CookieCode)??""}return{cookieCode:i,settingsItem:a}};e.default=t=>{var e,o,l,n,d,v,f,b,m,S,E,T;(0,r.Q6)("Chatbot",t.fields);const k=(0,s.useRouter)(),x=(0,u.z)(),y=(null===x||void 0===x||null===(e=x.sitecoreContext)||void 0===e?void 0:e.pageEditing)??!1,w=Boolean(null===x||void 0===x||null===(o=x.sitecoreContext)||void 0===o||null===(l=o.route)||void 0===l||null===(n=l.fields)||void 0===n||null===(d=n.HideChatbot)||void 0===d?void 0:d.value),_=(null===t||void 0===t||null===(v=t.fields)||void 0===v||null===(f=v.ChatbotScript)||void 0===f?void 0:f.value)??"",I=(null===t||void 0===t?void 0:t.cookieCode)??"",{0:j,1:B}=(0,c.useState)(!1),{0:O,1:P}=(0,c.useState)(!1),{0:A,1:N}=(0,c.useState)(""),{0:D,1:G}=(0,c.useState)(!1),L=!!I&&!!A&&I.split(",").some((t=>A.includes(t.trim())));(0,c.useEffect)((()=>{const t=()=>{var t;const e=null===(t=((null===globalThis||void 0===globalThis?void 0:globalThis.dataLayer)||[]).filter((t=>"OneTrustGroupsUpdated"===(null===t||void 0===t?void 0:t.event))).at(-1))||void 0===t?void 0:t.OnetrustActiveGroups;void 0!==e&&N(e),G(Boolean((0,i.Do)("OptanonAlertBoxClosed"))),B(!0)};t();const e=setInterval(t,300);return()=>clearInterval(e)}),[]),(0,c.useEffect)((()=>{P(!1)}),[k.asPath]);const R=(0,c.useCallback)((()=>{try{const t=document.createElement("script");t.id=C,t.type="text/javascript",t.text=_,document.body.appendChild(t)}catch(t){g.error(`Chatbot: script injection failed: ${t}`)}}),[_]),X=!y&&!w&&!!_&&(L||O);(0,c.useEffect)((()=>{if(!j)return;const t="undefined"!==typeof window.embeddedservice_bootstrap||!!document.getElementById(C);X&&!t?R():!X&&t&&window.location.reload()}),[j,X,k.asPath,R]);if(!j||y||w||!_)return null;if(X)return null;if(!D)return null;const z=(null===t||void 0===t||null===(b=t.fields)||void 0===b||null===(m=b.Icon)||void 0===m||null===(S=m.value)||void 0===S||null===(E=S.alt)||void 0===E?void 0:E.toString())??"";return(0,h.jsx)("button",{type:"button","data-testid":"chatbot-trigger",className:p().chatbotTrigger,"aria-label":z||"Open chat",onClick:()=>{P(!0)},children:(0,h.jsx)(a.E,{field:null===t||void 0===t||null===(T=t.fields)||void 0===T?void 0:T.Icon})})}},74297:function(t){t.exports={chatbotTrigger:"Chatbot_chatbotTrigger__5bAwE"}}}]);
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.