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AAApC,GAAAqC,eAAA3B,GAAA4B,eAAA,IAAAC,MAAA,CAAAC,QAAA,CAAAC,gBAAA,qBAAAC,OAAA,KAAAC,QAAA,CAAAC,WAAA,OAAAC,OAAA,OAAAC,aAAA,IAAAC,IAAA,MAAAC,KAAA,MAAAC,MAAA,OAAAC,OAAA,OAAAC,SAAA,SAAAC,WAAA,SAAAC,YAAA,OAAAC,QAAA,IAAAC,SAAA,QAAAC,UAAA,wBAAAC,MAAA,QAAA9B,SAAA,GAAAjG,EAAAkG,GAAA,SAAAE,UAAA,sBAAAH,SAAA,GAAAjG,EAAAkG,GAAA,EAAA1G,EAAA,CAAAgH,MAAA3D,EAAAoD,SAAA,GAAAjG,EAAAgG,IAAA,SAAAI,UAAA,8BAAAH,SAAA,IAAAjG,EAAAgG,IAAA,SAAAI,UAAA,2BAAAH,SAAA,CAAAxD,GAAA,GAAAzC,EAAAkG,GAAA,OAAAD,SAAAxD,CAAA,GAAAE,GAAA,GAAA3C,EAAAkG,GAAA,OAAAD,SAAAtD,CAAA,SAAA3C,EAAAgG,IAAA,SAAAI,UAAA,uCAAAH,SAAA,IAAAjG,EAAAkG,GAAA,yBAAAnD,EAAAqD,UAAA,oCAAAC,QAAAvB,GAAAmB,SAAAlD,CAAA,MAAA/C,EAAAkG,GAAA,yBAAAjD,EAAAmD,UAAA,mCAAAC,QAAArB,GAAAiB,SAAAhD,CAAA","sources":["webpack://_N_E/./components/PypestreamChat/PypestreamChat.js","webpack://_N_E/"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect, useState } from 'react';\nimport {PypestreamChatConstants} from '../../adapters/helpers/Constants';\nimport { AnalyticsConstants } from '../../adapters/helpers/ConstantsGA';\nimport Modal from 'react-modal';\nimport dynamic from 'next/dynamic';\nconst Image = dynamic(()=>import('../Image/Image'))\n\nfunction PypestreamChat(props) {\n /* global Pypestream */\n\n const modalDelay = props.document?.fields?.modalDelay;\n const popUpDisabled = props.document?.fields?.popUpDisabled || false;\n const moduleId = props.document?.fields?.moduleId;\n const modalTitle = props.document?.fields?.modalTitle;\n const modalContent = props.document?.fields?.modalContent;\n const modalBackgroundImage = props.document?.fields?.modalBackgroundImage;\n const modalAcceptButtonLabel = props.document?.fields?.modalAcceptButtonLabel;\n const modalDeclineButtonLabel = props.document?.fields?.modalDeclineButtonLabel;\n const toggleChatLabel = props.document?.fields?.toggleChatLabel;\n const toggleButtonIcon = props.document?.fields?.toggleButtonIcon;\n const apiScript = props.document?.fields?.apiScriptUrl;\n const configId = props.document?.fields?.configId;\n const configDomain = props.document?.fields?.configDomain;\n const configEnv = props.document?.fields?.configEnv;\n const configBeta = props.document?.fields?.configBeta;\n const localStorageVariable = PypestreamChatConstants.persistentChatTriggered + moduleId;\n\n const customModalStyles = {\n overlay: {\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n zIndex: 200\n },\n content : {\n background : 'none',\n border : 'none',\n borderRadius : '0',\n top : '50%',\n left : '50%',\n right : 'auto',\n bottom : 'auto',\n fontSize : '1.4rem',\n lineHeight : '2.1rem',\n marginRight : '-50%',\n padding : '0',\n maxWidth : '530px',\n transform : 'translate(-50%, -50%)',\n width : '90%'\n }\n };\n\n const [modalIsOpen, setModalIsOpen] = useState(false);\n const [modalWasVisited, setModalWasVisited] = useState(popUpDisabled);\n const [chatWasVisited, setChatWasVisited] = useState(false);\n\n const launchChat = () => {\n let chatContainer = document.getElementById(moduleId +'-module-container');\n\n closeModal();\n\n setChatWasVisited(true);\n\n Pypestream('config', {\n domain: configDomain,\n env: configEnv,\n beta: configBeta\n });\n\n Pypestream('boot', {\n APP_ID: configId\n }, chatContainer);\n };\n\n const toggleChat = () => {\n if(chatWasVisited) {\n Pypestream('toggle');\n } else {\n launchChat();\n }\n };\n\n const closeModal = () => {\n setModalIsOpen(false);\n setModalWasVisited(true);\n localStorage.setItem(localStorageVariable, true);\n };\n\n const appendScript = () => {\n const script = document.createElement('script');\n script.src = apiScript;\n script.async = true;\n document.head.appendChild(script);\n };\n\n useEffect(() => {\n appendScript();\n const persistentChatTriggered = localStorage.getItem(localStorageVariable);\n\n if(!popUpDisabled) {\n setModalWasVisited(persistentChatTriggered ? true : false);\n }\n\n if (!persistentChatTriggered && !popUpDisabled) {\n setTimeout(() => {\n setModalIsOpen(true);\n }, (modalDelay*1000));\n }\n }, []);\n\n return (\n
\n {modalWasVisited &&\n \n }\n\n
\n
\n\n {!modalWasVisited &&\n \n
\n \n
\n
\n {modalTitle &&\n

{modalTitle}

\n }\n {modalContent &&\n

{modalContent}

\n }\n
\n\n
\n \n\n \n
\n
\n \n
\n \n }\n
\n );\n}\n\nexport default PypestreamChat;\n\nPypestreamChat.propTypes = {\n document: PropTypes.object\n};","\"use strict\";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[45],{10045:function(e,l,n){n.r(l);var t=n(67294),o=n(24036),a=n(75176),d=n(83253),i=n.n(d),u=n(5152),s=n.n(u),c=n(85893),r=s()((function(){return Promise.resolve().then(n.bind(n,48084))}),{loadableGenerated:{webpack:function(){return[48084]}}});l.default=function(e){var l,n,d,u,s,m,p,f,b,v,g,h,x,y,j,k,C,N,I,S,_,B,E,P,D,w,L,T,R,z,A=null==(l=e.document)||null==(n=l.fields)?void 0:n.modalDelay,U=(null==(d=e.document)||null==(u=d.fields)?void 0:u.popUpDisabled)||!1,q=null==(s=e.document)||null==(m=s.fields)?void 0:m.moduleId,G=null==(p=e.document)||null==(f=p.fields)?void 0:f.modalTitle,H=null==(b=e.document)||null==(v=b.fields)?void 0:v.modalContent,M=null==(g=e.document)||null==(h=g.fields)?void 0:h.modalBackgroundImage,O=null==(x=e.document)||null==(y=x.fields)?void 0:y.modalAcceptButtonLabel,W=null==(j=e.document)||null==(k=j.fields)?void 0:k.modalDeclineButtonLabel,F=null==(C=e.document)||null==(N=C.fields)?void 0:N.toggleChatLabel,J=null==(I=e.document)||null==(S=I.fields)?void 0:S.toggleButtonIcon,K=null==(_=e.document)||null==(B=_.fields)?void 0:B.apiScriptUrl,Q=null==(E=e.document)||null==(P=E.fields)?void 0:P.configId,V=null==(D=e.document)||null==(w=D.fields)?void 0:w.configDomain,X=null==(L=e.document)||null==(T=L.fields)?void 0:T.configEnv,Y=null==(R=e.document)||null==(z=R.fields)?void 0:z.configBeta,Z=o.hN.persistentChatTriggered+q,$=(0,t.useState)(!1),ee=$[0],le=$[1],ne=(0,t.useState)(U),te=ne[0],oe=ne[1],ae=(0,t.useState)(!1),de=ae[0],ie=ae[1],ue=function(){var e=document.getElementById(q+\"-module-container\");se(),ie(!0),Pypestream(\"config\",{domain:V,env:X,beta:Y}),Pypestream(\"boot\",{APP_ID:Q},e)},se=function(){le(!1),oe(!0),localStorage.setItem(Z,!0)};return(0,t.useEffect)((function(){var e;(e=document.createElement(\"script\")).src=K,e.async=!0,document.head.appendChild(e);var l=localStorage.getItem(Z);U||oe(!!l),l||U||setTimeout((function(){le(!0)}),1e3*A)}),[]),(0,c.jsxs)(\"div\",{children:[te&&(0,c.jsx)(\"button\",{tabIndex:0,className:\"ob-pypestream-toggle-button event_button_click\",onClick:function(){de?Pypestream(\"toggle\"):ue()},\"data-action-detail\":a.k.openLiveChat,\"aria-label\":F.fields.text,children:(0,c.jsx)(r,{image:J})}),(0,c.jsx)(\"div\",{className:\"ob-pypestream-chat-container\",id:q+\"-module-container\"}),!te&&(0,c.jsx)(i(),{isOpen:ee,onRequestClose:se,closeTimeoutMS:250,style:{overlay:{backgroundColor:\"rgba(0, 0, 0, 0.5)\",zIndex:200},content:{background:\"none\",border:\"none\",borderRadius:\"0\",top:\"50%\",left:\"50%\",right:\"auto\",bottom:\"auto\",fontSize:\"1.4rem\",lineHeight:\"2.1rem\",marginRight:\"-50%\",padding:\"0\",maxWidth:\"530px\",transform:\"translate(-50%, -50%)\",width:\"90%\"}},children:(0,c.jsx)(\"div\",{className:\"ob-pypestream-modal\",children:(0,c.jsx)(r,{image:M,children:(0,c.jsxs)(\"div\",{className:\"ob-pypestream-modal-content\",children:[(0,c.jsxs)(\"div\",{className:\"ob-pypestream-modal-copy\",children:[G&&(0,c.jsx)(\"p\",{children:G}),H&&(0,c.jsx)(\"p\",{children:H})]}),(0,c.jsxs)(\"div\",{className:\"ob-pypestream-modal-button-container\",children:[(0,c.jsx)(\"button\",{\"aria-label\":O,className:\"ob-pypestream-modal-button launch\",onClick:ue,children:O}),(0,c.jsx)(\"button\",{\"aria-label\":W,className:\"ob-pypestream-modal-button close\",onClick:se,children:W})]})]})})})})]})}}}]);"],"names":["self","webpackChunk_N_E","push","e","l","n","r","t","o","a","d","i","u","s","c","Promise","resolve","then","bind","loadableGenerated","webpack","default","m","p","f","b","v","g","h","x","y","j","k","C","N","I","S","_","B","E","P","D","w","L","T","R","z","A","document","fields","modalDelay","U","popUpDisabled","q","moduleId","G","modalTitle","H","modalContent","M","modalBackgroundImage","O","modalAcceptButtonLabel","W","modalDeclineButtonLabel","F","toggleChatLabel","J","toggleButtonIcon","K","apiScriptUrl","Q","configId","V","configDomain","X","configEnv","Y","configBeta","Z","hN","persistentChatTriggered","$","useState","ee","le","ne","te","oe","ae","de","ie","ue","getElementById","se","Pypestream","domain","env","beta","APP_ID","localStorage","setItem","useEffect","createElement","src","async","head","appendChild","getItem","setTimeout","jsxs","children","jsx","tabIndex","className","onClick","openLiveChat","text","image","id","isOpen","onRequestClose","closeTimeoutMS","style","overlay","backgroundColor","zIndex","content","background","border","borderRadius","top","left","right","bottom","fontSize","lineHeight","marginRight","padding","maxWidth","transform","width"],"sourceRoot":""}