1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9988],{9988:(e,t,n)=>{n.r(t),n.d(t,{OnlineChat:()=>b});var i=n(37876),l=n(14232),a=n(34448),r=n(42692),o=n(51507),s=n(60305);let d=e=>{let{className:t="fill-global-black",...n}=e;return(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,...n,children:(0,i.jsx)("path",{d:"M15 4V11H5.17L4 12.17V4H15ZM16 2H3C2.73478 2 2.48043 2.10536 2.29289 2.29289C2.10536 2.48043 2 2.73478 2 3V17L6 13H16C16.2652 13 16.5196 12.8946 16.7071 12.7071C16.8946 12.5196 17 12.2652 17 12V3C17 2.73478 16.8946 2.48043 16.7071 2.29289C16.5196 2.10536 16.2652 2 16 2ZM21 6H19V15H6V17C6 17.2652 6.10536 17.5196 6.29289 17.7071C6.48043 17.8946 6.73478 18 7 18H18L22 22V7C22 6.73478 21.8946 6.48043 21.7071 6.29289C21.5196 6.10536 21.2652 6 21 6Z"})})},c="Microsoft_Omnichannel_LCWidget_Chat_Iframe_Window",w="minimize_iframe",u="Microsoft_Omnichannel_LCWidget";var m=n(33918),h=n(89099),v=n(18422),f=n(16286),C=n(13032);let b=()=>{let e=(0,l.useRef)(null),{t}=(0,a.Bd)(),{isChatWidgetReady:n,isOpen:b,setOpen:g,isError:E,isChatBtnVisible:p}=(0,l.useContext)(m.$);return(e=>{let{locale:t}=(0,h.useRouter)(),{isMobile:n}=(0,v.useBreakpoint)(),{t:i}=(0,a.Bd)(),{currentLocale:r,setCurrentLocale:o,setChatWidgetReady:s,isChatWidgetReady:d,setChatBtnVisible:w,isOpen:b,setOpen:g,setError:E,isError:p}=(0,l.useContext)(m.$),x=()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect().left-16,l=document.getElementById(c);l&&(l.style.left="auto",l.style.right="calc(100vw - ".concat(n,"px)"),l.setAttribute("title",i("openOnlineChat")))},L=()=>{g(!0)},y=()=>{g(!1)};(0,l.useEffect)(()=>{if(p&&d){var e,t;null==(e=window.Microsoft)||e.Omnichannel.LiveChatWidget.SDK.closeChat(),null==(t=window.Microsoft)||t.Omnichannel.LiveChatWidget.SDK.closeChat()}},[p,d]);let M=()=>({Brand:{value:"Metrolinx",isDisplayable:!0}}),O=()=>{E(!1),s(!0),window.Microsoft.Omnichannel.LiveChatWidget.SDK.setContextProvider(M),x()},_=()=>E(!0);(0,l.useEffect)(()=>(window.addEventListener("lcw:startChat",L),window.addEventListener("lcw:onMaximize",L),window.addEventListener("lcw:onClose",y),window.addEventListener("lcw:onMinimize",y),window.addEventListener("resize",x),window.addEventListener("lcw:error",_),()=>{window.removeEventListener("lcw:startChat",L),window.removeEventListener("lcw:onMaximize",L),window.removeEventListener("lcw:onClose",y),window.removeEventListener("lcw:onMinimize",y),window.removeEventListener("resize",x),window.removeEventListener("lcw:error",_)}),[]),(0,l.useEffect)(()=>{n&&(b?document.body.style.overflow="hidden":document.body.style.overflow="")},[n,b]),(0,l.useEffect)(()=>{d&&x()},[d,e.current]),(0,l.useEffect)(()=>(t&&t!==r&&((()=>{let e=document.getElementById(u),t=document.getElementById(c);null==e||e.remove(),null==t||t.remove()})(),y(),s(!1),w(!1),(e=>{let{url:t,id:n,attributes:i}=e,l=document.createElement("script");l.src=t,l.id=n,l.async=!0,l.setAttribute("data-testid","online-chat"),i.forEach(e=>{let[t,n]=e;return l.setAttribute(t,n)}),document.body.appendChild(l)})({url:f.MJ,id:u,attributes:(e=>{let t=[["data-lcw-version","prod"],["data-org-url",f.kC],["data-org-id",f.U3],["data-app-id",e===C.h7.FR?f.G4:f.Dc],["data-hide-chat-button","true"],["data-render-mobile","false"],["data-color-override","#191919"],["data-font-family-override","MX Sans, Arial, sans-serif"],["data-enable-telemetry","false"],["data-enable-lcw-autofill","true"]];return f.SP&&t.push([f.SP,""]),t})(t)}),o(t),setTimeout(()=>w(!0),2e3)),window.addEventListener("lcw:ready",O),()=>{window.removeEventListener("lcw:ready",O)}),[t])})(e),(0,i.jsx)("div",{className:"h-0 cx-container sticky bottom-[88px] z-10",children:(0,i.jsx)("div",{className:"col-start-[-1] xl:col-start-[15] translate-y-16 xl:translate-x-8",children:(p||n)&&(0,i.jsx)(o.q,{ref:e,"aria-label":b?t("closeOnlineChat"):t("openOnlineChat"),onClick:b?()=>{let e=document.getElementById(c);e&&e.classList.add(w),g(!1)}:()=>{let e=document.getElementById(c);if(E||!e)r.y.failure(t("serviceCurrentlyDown"));else{var n;null==(n=window.Microsoft)||n.Omnichannel.LiveChatWidget.SDK.startChat({inNewWindow:!1}),e.classList.remove(w),e.focus(),g(!0)}}
1,buttonClasses:"flex text-global-white bg-global-black hover:bg-neutral-700 active:bg-neutral-700 w-56 h-56 rounded-full justify-center border-[2px] border-global-white","aria-haspopup":"true","aria-expanded":b,customIconRenderer:()=>b?(0,i.jsx)(s.bm,{className:"fill-global-white"}):(0,i.jsx)(d,{className:"fill-global-white"}),"data-testid":"online-chat-btn"})})})}}}]);
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.