/*! For license information please see project.js.LICENSE.txt */ !function(){var t=[,function(t,e){"use strict";!0;var i=/iPhone/i,s=/iPod/i,n=/iPad/i,a=/\biOS-universal(?:.+)Mac\b/i,o=/\bAndroid(?:.+)Mobile\b/i,r=/Android/i,c=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,l=/Silk/i,d=/Windows Phone/i,h=/\bWindows(?:.+)ARM\b/i,u=/BlackBerry/i,p=/BB10/i,g=/Opera Mini/i,m=/\b(CriOS|Chrome)(?:.+)Mobile/i,f=/Mobile(?:.+)Firefox\b/i,b=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function v(t){return function(e){return e.test(t)}}function w(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var w=e.userAgent,y=w.split("[FBAN");void 0!==y[1]&&(w=y[0]);void 0!==(y=w.split("Twitter"))[1]&&(w=y[0]);var E=v(w),I={apple:{phone:E(i)&&!E(d),ipod:E(s),tablet:!E(i)&&(E(n)||b(e))&&!E(d),universal:E(a),device:(E(i)||E(s)||E(n)||E(a)||b(e))&&!E(d)},amazon:{phone:E(c),tablet:!E(c)&&E(l),device:E(c)||E(l)},android:{phone:!E(d)&&E(c)||!E(d)&&E(o),tablet:!E(d)&&!E(c)&&!E(o)&&(E(l)||E(r)),device:!E(d)&&(E(c)||E(l)||E(o)||E(r))||E(/\bokhttp\b/i)},windows:{phone:E(d),tablet:E(h),device:E(d)||E(h)},other:{blackberry:E(u),blackberry10:E(p),opera:E(g),firefox:E(f),chrome:E(m),device:E(u)||E(p)||E(g)||E(f)||E(m)},any:!1,phone:!1,tablet:!1};I.any=I.apple.device||I.android.device||I.windows.device||I.other.device;I.phone=I.apple.phone||I.android.phone||I.windows.phone;I.tablet=I.apple.tablet||I.android.tablet||I.windows.tablet;return I}e.default=w},function(t){e=function(){return function t(e,i,s){function n(o,r){if(!i[o]){if(!e[o]){0;if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=i[o]={exports:{}};e[o][0].call(l.exports,(function(t){return n(e[o][1][t]||t)}),l,l.exports,t,e,i,s)}return i[o].exports}for(var a=void 0,o=0;o{if(t)return;let s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let t=0;s=new Error(`Invariant Violation: ${e.replace(/%s/g,(()=>i[t++]))}`)}throw s};const dt=(t,e="")=>lt("string"==typeof t,"Expected %s to be a string, not a %s",e||t,typeof t),ht=(t,e="")=>lt("object"==typeof t&&null!==t,"Expected %s to be an object",e||t);class ut{constructor(t,{allowedOrigin:e,iframeUuid:i}){ht(t);dt(e);dt(i);this.allowedOrigin=e;this.iframeUuid=i;this._handlers=t;this.handleMessage=this.handleMessage.bind(this);window.addEventListener("message",this.handleMessage)}isOriginAllowed(t){return t===this.allowedOrigin}handleMessage(t){const{data:e,origin:i,source:s}=t;if(this.isOriginAllowed(i))try{const t=JSON.parse(e);if(t.uuid!==this.iframeUuid)return;const{type:i,data:n}=t,a=this._handlers[i];"function"==typeof a&&a({data:n,source:s})}catch(t){return}}register(t,e){this._handlers[t]=e}}const pt=1250;class gt{constructor(){this.handleShow=this.handleShow.bind(this);this.handleClear=this.handleClear.bind(this);this.notificationIntervalId=0;this.notificationMessageIsInPageTitle=!1;this.cachedOriginalDocumentTitle=document.title}clearNotificationInterval(){clearInterval(this.notificationIntervalId)}notificationIntervalIsRunning(){return Boolean(this.notificationIntervalId)}start({title:t}){if(!this.notificationIntervalIsRunning()){this.cachedOriginalDocumentTitle=document.title;this.togglePageTitle({notificationTitle:t});this.notificationIntervalId=setInterval((()=>{this.togglePageTitle({notificationTitle:t})}),pt)}}stop(){if(this.notificationIntervalIsRunning()){this.clearNotificationInterval();this.updatePageTitle(this.cachedOriginalDocumentTitle);this.notificationIntervalId=0;this.notificationMessageIsInPageTitle=!1;this.cachedOriginalDocumentTitle=""}}togglePageTitle({notificationTitle:t}){if(this.notificationMessageIsInPageTitle){this.updatePageTitle(this.cachedOriginalDocumentTitle);this.notificationMessageIsInPageTitle=!1}else{this.updatePageTitle(t);this.notificationMessageIsInPageTitle=!0}}handleShow({data:t}){this.start({title:t.title})}handleClear(){this.stop()}updatePageTitle(t){dt(t);document.title=t}}var mt=gt;const ft="@type",bt=t=>null==t?void 0:t[ft],vt=864e5;var wt={TWO_MINUTES:12e4,THIRTY_MINUTES:18e5,ONE_DAY:vt,SIX_MONTHS:30*vt*6};let yt=!1;function Et(t){let e="";if(document.cookie&&""!==document.cookie){const i=document.cookie.split(";");for(let s=0;s-1)s.push("Secure");else if(!yt){console.warn("HubSpot Conversations: You are using conversations on a non-https site! Not using https puts your visitor's data at risk, please enforce using https.");yt=!0}const n=s.join(";");document.cookie=n}const St={HUBSPOT:"hubspotutk",MESSAGES:"messagesUtk",IS_OPEN:"hs-messages-is-open",HIDE_WELCOME_MESSAGE:"hs-messages-hide-welcome-message",WIDGET_POSITION:"hs-messages-widget-position",WIDGET_SIZE:"hs-messages-widget-size",SPOTLIGHT_LAYOUT:"hs-spotlight-layout",SPOTLIGHT_FLOAT_POSITION:"hs-spotlight-float-position",HUBSPOT_API_CSRF:"hubspotapi-csrf",HSTC:"__hstc",HSSC:"__hssc",GLOBAL_COOKIE_OPT_OUT:"__hs_opt_out"},kt={GLOBAL_COOKIE_OPT_OUT_YES:"yes",GLOBAL_COOKIE_OPT_OUT_NO:"no"};function Tt(t){xt(t,"",-1)}const Ot="resetWidget";function Ct(t){Tt(St.MESSAGES);Tt(St.IS_OPEN);Tt(St.HIDE_WELCOME_MESSAGE);Tt(`${St.WIDGET_POSITION}_right`);Tt(`${St.WIDGET_POSITION}_left`);Tt(St.WIDGET_SIZE);if(null!=t&&t[Ot]){window.hubspot_live_messages_running=!1;ea()}}const _t="hs-messages-widget-open",Lt="hs-messages-mobile",Mt="hs-shadow-container",Dt="internal",Rt="widget-align-left",Ut="widget-align-right",Pt="hs-widget-hide-on-print",At="widget-align-center",qt="hs-messages-lightbox-expanded",Ht="HIDE_WIDGET";function $t(t){xt(St.MESSAGES,t)}const Wt=53,Nt=99535353,zt=100048175,Bt=/^(?:app|local)\.hubspot(?:qa)?\.com$/,jt=/(?:pricing)\/[0-9]+/,Ft=/signup-hubspot/,Gt="pricing";function Vt({portalId:t,hostname:e=window.location.hostname,pathname:i=window.location.pathname}){const s=-1!==i.indexOf(Gt)&&!jt.test(i),n=Ft.test(i);return!(!Bt.test(e)||s||n)&&(-1!==e.indexOf("qa")?t===Wt||t===Nt||t===zt:t===Wt)}const Kt=/^\/(?:[A-Za-z0-9-_]*)\/(\d+)(?:\/|$)/;function Jt(t){try{return Kt.exec(t)[1]}catch(t){return""}}const Xt=[Object.prototype.toJSON,Array.prototype.toJSON,String.prototype.toJSON],Yt=()=>{const t=Xt.filter((t=>!!t)).length;return Boolean(t)},Zt=({portalId:t})=>{var e;const i=!!Jt(window.location.pathname),s=Vt({portalId:t})&&!i,n=null===(e=window)||void 0===e||null===(e=e.disabledHsPopups)||void 0===e?void 0:e.includes("LIVE_CHAT");return c()?{shouldRender:!1,reason:"WINDOWS_PHONE"}:Yt()?{shouldRender:!1,reason:"UNSUPPORTED_FRAMEWORK"}:s?{shouldRender:!1,reason:"MISSING_PORTAL_ID"}:n?{shouldRender:!1,reason:"IS_EMBEDDED_MEETINGS"}:{shouldRender:!0}},Qt=t=>Boolean(Et(t)),te="HubSpotConversations",ee="hsConversationsOnReady",ie="hsConversationsSettings",se="ON_EXIT_INTENT",ne="ON_WIDGET_LOAD",ae=(t,e)=>lt(!0===t||!1===t,"Expected %s to be a boolean but received a %s",e||t,typeof t);function oe(t,e,i){lt(i.indexOf(t)>-1,`Expected %s to be one of ${i.toString()} but got %s`,e,t)}const re={loadImmediately:!0,isFullscreen:!1,inlineEmbedSelector:"",disableAttachment:!1,enableWidgetCookieBanner:!1,identificationEmail:"",identificationToken:"",disableInitialInputFocus:!1,hideScrollToButton:!0,hideNewThreadLink:!1,shouldHideChatOnPrint:!1,enableEmailCapturedEvent:!1};function ce(t){return Object.fromEntries(Object.entries(t).filter((([t,e])=>void 0!==e)))}function le(){const t=window[ie],e=Object.assign({},re,ce(t||{}));ae(e.loadImmediately,"mergedSettings.loadImmediately");ae(e.isFullscreen,"mergedSettings.isFullscreen");ae(e.disableAttachment,"mergedSettings.disableAttachment");ae(e.disableInitialInputFocus,"mergedSettings.disableInitialInputFocus");ae(e.hideNewThreadLink,"mergedSettings.hideNewThreadLink");ae(e.shouldHideChatOnPrint,"mergedSettings.shouldHideChatOnPrint");ae(e.enableEmailCapturedEvent,"mergedSettings.enableEmailCapturedEvent");oe(e.enableWidgetCookieBanner,"mergedSettings.enableWidgetCookieBanner",[!1,!0,ne,se]);dt(e.inlineEmbedSelector,"mergedSettings.inlineEmbedSelector");dt(e.identificationEmail,"mergedSettings.identificationEmail");dt(e.identificationToken,"mergedSettings.identificationToken");return e}const de=()=>!!le().loadImmediately,he=()=>!!le().isFullscreen,ue=()=>le().inlineEmbedSelector,pe=()=>!!le().inlineEmbedSelector,ge=()=>!!le().disableAttachment,me=()=>!!le().disableInitialInputFocus,fe=()=>le().enableWidgetCookieBanner,be=()=>le().identificationEmail,ve=()=>le().identificationToken,we=()=>le().hideScrollToButton,ye=()=>le().hideNewThreadLink,Ee=()=>!!le().enableEmailCapturedEvent,Ie=new RegExp("#hs-chat-open","i"),xe=t=>Ie.test(t),Se=t=>"true"===t;function ke(){const t=pe();if(!t&&Qt(St.IS_OPEN)){const t=Et(St.IS_OPEN);return Se(t)}return t||xe(window.location.href)||void 0}const Te="hubspot-messages-iframe-container",Oe="hubspot-conversations-inline-parent",Ce="hubspot-conversations-inline-iframe",_e="hubspot-conversations-iframe";function Le(t){window[te]=t}function Me(t){let{logger:e,trackCallback:i}=t;const s=window[ee];if(Array.isArray(s)){i&&i();s.forEach((t=>{try{t()}catch(t){t instanceof Error&&e.error(t.message)}}))}}class De{constructor({debug:t}={}){this._debug=Boolean(t);this.debug=this.debug.bind(this)}_isDebugMode(){return this._debug}debug(t){this._debug=t}log(t){this._isDebugMode()&&console.log(`${De.LOGGING_PREFIX} ${t}`)}error(t){this._isDebugMode()&&console.error(`${De.LOGGING_PREFIX} ${t}`)}}De.LOGGING_PREFIX="HubSpot Conversations log:";var Re=De,Ue=i(2),Pe=i.n(Ue);const Ae=t=>lt("function"==typeof t&&null!==t,"Expected %s to be a function",t),qe="HubSpotConversations",He="conversationStarted",$e="conversationClosed",We="unreadConversationCountChanged",Ne="inputStaging",ze="contactAssociated",Be="emailCaptured",je="userInteractedWithWidget",Fe="quickReplyButtonClick",Ge="quickLinkButtonClick",Ve="widgetLoaded",Ke="widgetClosed",Je="userSelectedThread",Xe="widgetHidden",Ye="sdkCloseButtonClick",Ze="messageInputStateChanged",Qe="inputTextChanged",ti=Object.values(t),ei=t=>lt(-1!==ti.indexOf(t),"Expected a valid event type but received %s. Valid event types include %s.",t,ti);class ii{constructor(){this._eventEmitter=new(Pe());this._namespacedEventType=this._namespacedEventType.bind(this);this.on=this.on.bind(this);this.off=this.off.bind(this);this.trigger=this.trigger.bind(this)}_namespacedEventType(t){return`${qe}:${t}`}on(t,e){dt(t);Ae(e);if(!t.length)return;const i=this._namespacedEventType(t);this._eventEmitter.addListener(i,e)}off(t,e){dt(t);Ae(e);if(!t.length)return;const i=this._namespacedEventType(t);this._eventEmitter.removeListener(i,e)}trigger(t,e){ei(t);const i=this._namespacedEventType(t);this._eventEmitter.emit(i,e)}}var si=ii;const ni=({data:t},{eventEmitter:e})=>{dt(t.eventType);ht(t.payload);(t.eventType!==Be||Ee())&&e.trigger(t.eventType,t.payload)},ai=t=>{t.setRequestHeader("X-HubSpot-CSRF-hubspotapi",Et(St.HUBSPOT_API_CSRF))},oi=t=>{ai(t);t.withCredentials=!0},ri="X-HubSpot-Messages-Uri",ci=4,li=[200,304],di=[204,404],hi=t=>li.indexOf(t)>-1,ui=t=>!hi(t)&&di.indexOf(t)<0,pi=()=>{};function gi({requestUrl:t,portalId:e},i,s=pi){var n;const a=new XMLHttpRequest;a.addEventListener("readystatechange",(()=>{if(a.readyState===ci)if(hi(a.status))try{const t=JSON.parse(a.responseText);i(t)}catch(t){console.warn("Initial messages API response is invalid");s()}else{ui(a.status)&&console.warn("Initial messages API call failed");s()}}));a.open("GET",t);const o=null===(n=window)||void 0===n||null===(n=n.messagesConfig)||void 0===n?void 0:n.messagesPageUri;let r;if(o)r=o;else if("about:srcdoc"===window.location.href){var c,l;r=null!==(c=null===(l=window.top)||void 0===l?void 0:l.location.href)&&void 0!==c?c:window.location.href}else r=window.location.href;a.setRequestHeader(ri,r);Vt({portalId:e})&&oi(a);a.send()}const mi="hubspot:messages:";function fi(t,e){let i;const s=`${mi}${t}`;if("function"==typeof window.Event)i=Object.assign(new Event(s),e);else{i=Object.assign(document.createEvent("Event"),e);i.initEvent(s,!0,!0)}window.dispatchEvent(i)}const bi={messagesInitialized:({messageWillRender:t,reason:e})=>{fi("initialized",{messageWillRender:t,reason:e})}};function vi(t,e){let i=!1,s=null;return(...n)=>{if(i)s=()=>{t(...n)};else{i=!0;t(...n);setTimeout((()=>{i=!1;"function"==typeof s&&s();s=null}),e)}}}function wi(){return!!Et(St.HIDE_WELCOME_MESSAGE)||!1}const yi=()=>void 0!==window.hsVars;function Ei({messagesUtk:t,hubspotUtk:e,portalId:i,iframeUuid:s,globalCookieOptOut:n,isFirstVisitorSession:a,hstc:c}){const d=o(),h=pe(),u=ke(),p=me(),g=ye(),m=h&&p;!h&&p&&console.warn("hsConversationsSettings: the `disableInitialInputFocus` object is only enabled for use when an `inlineEmbedSelector` object is also set");const f={uuid:s,mobile:d,mobileSafari:r(),hideWelcomeMessage:wi(),hstc:c,domain:It(),inApp53:Vt({portalId:i}),messagesUtk:t,url:window.location.href,inline:h,isFullscreen:he(),globalCookieOptOut:n,isFirstVisitorSession:a,isAttachmentDisabled:ge(),isInitialInputFocusDisabled:m,enableWidgetCookieBanner:fe(),isInCMS:yi(),hideScrollToButton:we(),isIOSMobile:l()};void 0!==u&&(f.startOpen=u);e&&(f.hubspotUtk=e);g&&(f.hideNewThreadLink=!0);return f}const Ii=()=>document.body.scrollTop||document.documentElement.scrollTop,xi=()=>Math.max(window.innerHeight||0,document.documentElement.clientHeight),Si=()=>Math.max(document.body.offsetHeight,document.body.scrollHeight);class ki{constructor({onScroll:t}){this._onScroll=t;this._handleScroll=this._handleScroll.bind(this);this.add=this.add.bind(this);this.remove=this.remove.bind(this)}_handleScroll(){const t=Si()-xi();if(0===t)return;const e=100*Ii()/t;this._onScroll({scrollPercentage:e})}_add(){window.addEventListener("scroll",this._handleScroll,{capture:!0,passive:!0})}add(){this.remove();this._add()}remove(){window.removeEventListener("scroll",this._handleScroll,{capture:!0})}registerPostMessageReceivers(t){t.register(E,this.add);t.register(I,this.remove)}}var Ti=ki;class Oi{constructor({onExitIntent:t}){this._onExitIntent=t;this._handleMouseOut=this._handleMouseOut.bind(this);this._isExitIntent=this._isExitIntent.bind(this);this.add=this.add.bind(this);this.remove=this.remove.bind(this)}_isExitIntent(t){if(!t)return!1;const e=t.relatedTarget||t.toElement;return(!e||"HTML"===e.nodeName)&&t.clientY<100}_handleMouseOut(t){this._isExitIntent(t)&&this._onExitIntent()}_add(){window.document.addEventListener("mouseout",this._handleMouseOut)}add(){this.remove();this._add()}remove(){window.document.removeEventListener("mouseout",this._handleMouseOut)}addExitIntentTracker(){this.add()}removeExitIntentTracker(){this.remove()}registerPostMessageReceivers(t){t.register(x,this.add);t.register(S,this.remove)}}var Ci=Oi;const _i="embed-script-start-pre-delay",Li="embed-script-end-pre-delay",Mi="embed-script-start-post-delay",Di="embed-script-end-post-delay",Ri="embed-script-load-time-post-delay",Ui="embed-script-load-time-pre-delay";function Pi(){try{performance.mark(Di)}catch(t){}}function Ai(){try{performance.mark(Li)}catch(t){}}const qi={["LEFT_ALIGNED"]:Rt,["RIGHT_ALIGNED"]:Ut},Hi=({widgetLocation:t,classList:e})=>{const i=qi[t];if(e.contains(i))return;Object.keys(qi).filter((e=>e!==t)).forEach((t=>{e.remove(t)}));e.add(i)},$i="widgetLocation",Wi="__hsUserToken",Ni=()=>{Ct();window[Wi]="";window.hubspot_live_messages_running=!1;ea()};class zi{constructor({postMessageToIframe:t}){if("function"!=typeof t)throw new TypeError("ApiUsageTracker: postMessageToIframe was not a function");this._postMessageToIframe=t;this.sendEventToTracker=this.sendEventToTracker.bind(this);this.trackSettingsUsed=this.trackSettingsUsed.bind(this);this.trackMethod=this.trackMethod.bind(this);this.trackEventListener=this.trackEventListener.bind(this);this.trackOnReady=this.trackOnReady.bind(this)}sendEventToTracker(t,e={}){this._postMessageToIframe(Y,{eventName:t,properties:e})}trackSettingsUsed(t){const e={};!1===t.loadImmediately&&(e.loadImmediately=!0);t.inlineEmbedSelector&&(e.inlineEmbedSelector=!0);t.enableWidgetCookieBanner&&(e.enableWidgetCookieBanner=!0);t.disableAttachment&&(e.disableAttachment=!0);t.disableInitialInputFocus&&(e.disableInitialInputFocus=!0);Object.keys(e).length>0&&this.sendEventToTracker("HubspotConversations-hsConversationsSettings-used",e)}trackMethod(t){this.sendEventToTracker("HubspotConversations-api-method-used",{method:t})}trackEventListener(t){this.sendEventToTracker("HubspotConversations-api-event-listener-registered",{event:t})}trackOnReady(){this.sendEventToTracker("HubspotConversations-hsConversationsOnReady-used",{method:"hsConversationsOnReady"})}}const Bi=4,ji=t=>t>=300,Fi=t=>(e,i)=>s=>{const n=new XMLHttpRequest;n.addEventListener("readystatechange",(()=>{if(n.readyState===Bi)try{const t=JSON.parse(n.responseText);ji(n.status)?s(null,t):s(t)}catch(t){s(null,"Invalid api response")}}));n.open(t,e);n.send(i);return n};Fi("GET"),Fi("POST"),Fi("PUT");class Gi{constructor(t){this.makeApiRequest=({data:t})=>{const{type:e,url:i,data:s}=t,n=`/_hcms${i}`;this.currentRequest&&this.currentRequest.readyState!==Bi&&this.abortCurrentApiRequest();this.currentRequest=Fi(e)(n,s)(((t,e)=>{e?this.postMessage(et,{result:"failed",data:e,url:i}):this.postMessage(et,{result:"succeeded",data:t,url:i})}))};this.postMessage=t;this.currentRequest=null}abortCurrentApiRequest(){this.currentRequest&&this.currentRequest.abort()}}function Vi({portalId:t}){Vt({portalId:t})&&!wi()&&xt(St.HIDE_WELCOME_MESSAGE,!0,wt.ONE_DAY)}const Ki=({source:t,widgetData:e,embedScriptContext:i,apiUsageTracker:s})=>{const{notificationAudio:n}=le();t.postMessage(JSON.stringify({type:$,data:Object.assign({},e,Ei(i),{notificationAudio:n})}),"*");Vi(i);s.trackSettingsUsed(le())},Ji=({postMessageToIframe:t})=>{const e=e=>{const i=e.categories?e.categories.functionality:e.allowed,s=i?kt.GLOBAL_COOKIE_OPT_OUT_NO:kt.GLOBAL_COOKIE_OPT_OUT_YES;t(z,{globalCookieOptOut:s});i||Tt(St.MESSAGES)};window._hsq=window._hsq||[];window._hsq.push(["addPrivacyConsentListener",e]);window._hsq.push(["addUserTokenListener",e=>t(N,{utk:e})])},Xi=({requestWidgetOpen:t,isOpen:e})=>{window.addEventListener("hashchange",(()=>{xe(window.location.href)&&!e&&t()}))},Yi=({onRestore:t})=>{const e=e=>{e.persisted&&t()};window.addEventListener("pageshow",e);return()=>window.removeEventListener("pageshow",e)},Zi=({resizeCallbackFn:t})=>{window.addEventListener("resize",t,{passive:!0})},Qi=()=>{const t=pe()?ue():`#${Te}`;return document.querySelector(`${t} iframe`)},ts=({iframe:t,iframeSrc:e,type:i,data:s})=>{var n;let a;try{a=null==t?void 0:t.contentWindow}catch(e){a=null==t?void 0:t.contentWindow}return null===(n=a)||void 0===n?void 0:n.postMessage(JSON.stringify({type:i,data:s}),e)},es=({iframe:t,iframeSrc:e,eventQueue:i})=>{do{const s=i.dequeue();if(s){const{type:i,data:n}=s;ts({iframe:t,iframeSrc:e,type:i,data:n})}}while(i.peek()&&0!==Object.keys(i.peek()).length)},is=()=>{const t=[];return{enqueue:e=>t.unshift(e),dequeue:()=>t.shift(),peek:()=>t[0]}},ss=({iframeSrc:t})=>{const e=is();return{post:(i,s={})=>{var n;const a=Qi(),o="about:blank"===(null==a||null===(n=a.contentDocument)||void 0===n?void 0:n.URL);if(!a||o)e.enqueue({type:i,data:s});else{ts({iframe:a,iframeSrc:t,type:i,data:s});es({iframe:a,iframeSrc:t,eventQueue:e})}}}},ns=({targetWindow:t,iframeSrc:e,type:i,data:s})=>{if(!t.closed)return t.postMessage(JSON.stringify({type:i,data:s}),e)},as=()=>{xt(St.HIDE_WELCOME_MESSAGE,!0,wt.ONE_DAY)},os=({height:t,width:e})=>{const i=document.getElementById(Te);if(i&&e&&t){i.style.width=`${e}px`;i.style.height=`${t}px`}},rs="PILL",cs="DEFAULT",ls="SPOTLIGHT",ds=(t,e)=>{const{message:i}=t,{popOpenWelcomeMessage:s,popOpenWidget:n,popMessageOnSmallScreens:a,clientTriggers:o,launcherType:r}=i,{displayOnTimeDelay:c}=o,{enabled:l,timeDelaySeconds:d}=c,h=1e3*d,u=(t.routingRuleDefinitionAI||t.systemChatflow)&&(r===rs||r===cs);return e?{shouldDelayLoadingIframe:!a&&l&&!window.ONLY_53_DISPLAY_LAUNCHER_ON_MOBILE,timeDelay:h}:{shouldDelayLoadingIframe:!u&&!n&&!s&&l,timeDelay:h}};function hs(){try{performance.mark(_i)}catch(t){}}function us(){try{performance.mark(Mi)}catch(t){}}const ps=(t,e,i)=>s=>{const n=!(bt(s)===Ht)&&!!s.sessionId;if(n){const{shouldDelayLoadingIframe:i,timeDelay:n}=ds(s,o());Ai();if(i)setTimeout((()=>{t(s);us();e()}),n);else{t(s);us();e()}}else{const{description:t,reason:e}=s.metadata||{};i({description:t,reason:e})}bi.messagesInitialized({messageWillRender:n})};function gs(){return Et(St.GLOBAL_COOKIE_OPT_OUT)}const ms="NEVER",fs="#ffffff",bs="#676565",vs="#141414",ws=10485760;class ys{constructor(t){this.setWidgetVisibility=t=>{const e=document.getElementById(Te);e&&e.style.setProperty("opacity",t?"1":"0")};this.wrapText=(t,e,i)=>{const s=[];let n="";for(const a of e){const e=n+a;if(t.measureText(e).width>i&&n.length>0){s.push(n);n=a}else n=e}n&&s.push(n);return s};this.addUrlToImage=(t,e)=>{const i=t.getContext("2d"),s=Math.max(12,.018*t.height),n=`500 ${s}px ui-monospace, SFMono-Regular, Menlo, Consolas, Liberation Mono, monospace`;i.font=n;const a=16,o=this.wrapText(i,e,t.width-2*a),r=s+6,c=o.length*r+a,l=i.getImageData(0,0,t.width,t.height),d=t.height;t.height=d+c;i.putImageData(l,0,0);i.font=n;i.fillStyle=vs;i.fillRect(0,d,t.width,c);i.fillStyle=fs;i.textBaseline="top";const h=d+(c-o.length*r)/2;o.forEach(((t,e)=>{i.fillText(t,a,h+e*r)}))};this.estimateDataUrlBytes=t=>{const e=t.slice(t.indexOf(",")+1);return Math.ceil(3*e.length/4)};this.captureScreenshot=async()=>{try{const t=await navigator.mediaDevices.getDisplayMedia({preferCurrentTab:!0,video:{displaySurface:"browser"}}),e=document.createElement("video");e.srcObject=t;await e.play();const i=5184e3,s=e.videoWidth*e.videoHeight;let n,a;if(s>i){const t=Math.sqrt(i/s);n=Math.round(e.videoWidth*t);a=Math.round(e.videoHeight*t)}else{n=e.videoWidth;a=e.videoHeight}const o=document.createElement("canvas"),r=(t,i)=>{o.width=t;o.height=i;const s=o.getContext("2d");if(s){s.drawImage(e,0,0,t,i);this.addUrlToImage(o,window.location.href)}};r(n,a);t.getTracks().forEach((t=>t.stop()));let c=o.toDataURL("image/png");this.estimateDataUrlBytes(c)>ws&&(c=o.toDataURL("image/jpeg",.85));if(this.estimateDataUrlBytes(c)>ws){const t=ws/this.estimateDataUrlBytes(c),e=Math.sqrt(t);r(Math.round(n*e),Math.round(a*e));c=o.toDataURL("image/jpeg",.85)}const l=this.estimateDataUrlBytes(c);if(l>ws){const t=`Screenshot exceeds maximum file size and could not be compressed (${n}x${a}px, ~${Math.round(l/1024)}KB)`;this.widgetShell.devLogger.error(t);this.widgetShell.logError(t)}return c}catch(t){this.widgetShell.devLogger.error(t instanceof Error?t.message:"Unknown error")}};this.handleScreenCaptureRequest=async()=>{this.setWidgetVisibility(!1);const t=await this.captureScreenshot();if(t){const e=t.startsWith("data:image/jpeg")?"jpg":"png",i=`${document.title}-${Date.now()}.${e}`;this.widgetShell.iframeMessage.post(Q,{dataUrl:t,fileName:i})}this.setWidgetVisibility(!0)};this.widgetShell=t}}const Es=75;function Is(t){const e=t.fftSize,i=new Uint8Array(e);t.getByteTimeDomainData(i);let s=0;for(let t=0;t{try{if("undefined"==typeof MediaRecorder){this.widgetShell.iframeMessage.post(ct);return}this.stream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}});this.startRecording();this.widgetShell.iframeMessage.post(ot)}catch(t){this.cleanup();this.widgetShell.iframeMessage.post(ct)}};this.handleVoiceRecordingConfirm=()=>{this.cleanup()};this.handleVoiceRecordingDiscard=()=>{this.cleanup()};this.widgetShell=t}startRecording(){if(this.stream){this.setupAnalyser(this.stream);this.startWaveformStreaming();this.recorder=new MediaRecorder(this.stream);this.recorder.start()}}setupAnalyser(t){const e=window.AudioContext||window.webkitAudioContext;if(!e)throw new Error("AudioContext is not supported in this browser");this.audioContext=new e;"suspended"===this.audioContext.state&&this.audioContext.resume();this.analyser=this.audioContext.createAnalyser();this.analyser.fftSize=2048;this.audioContext.createMediaStreamSource(t).connect(this.analyser)}startWaveformStreaming(){this.waveformTimer=setInterval((()=>{this.analyser&&this.widgetShell.iframeMessage.post(rt,{level:Is(this.analyser)})}),Es)}cleanup(){if(this.waveformTimer){clearInterval(this.waveformTimer);this.waveformTimer=null}this.recorder&&"inactive"!==this.recorder.state&&this.recorder.stop();this.recorder=null;this.audioContext&&"closed"!==this.audioContext.state&&this.audioContext.close();this.audioContext=null;this.analyser=null;if(this.stream){this.stream.getTracks().forEach((t=>t.stop()));this.stream=null}}}const Ss="help-widget",ks=()=>{};class Ts{constructor(t,e,i){this.handleDragStart=t=>{const e=document.getElementById(Te);this.isDragging=!0;const i="RIGHT_ALIGNED"===this.widgetData[$i];this.offsetX=i?e.getBoundingClientRect().right-t.clientX:t.clientX-e.getBoundingClientRect().left;this.offsetY=e.getBoundingClientRect().bottom-t.clientY;this.dragOverlayEl instanceof HTMLDivElement&&this.dragOverlayEl.style.setProperty("display","block");this.dragHandleEl instanceof HTMLDivElement&&this.dragHandleEl.style.setProperty("cursor","grabbing")};this.handleDragEnd=()=>{if(!this.dragHandleEl||!this.isDragging)return;this.iframeMessage.post(Z,{timeOnPage:performance&&Math.round(performance.now()/1e3),isOpen:this.isOpen||!1});this.dragHandleEl.style.setProperty("cursor","grab");this.dragOverlayEl instanceof HTMLDivElement&&this.dragOverlayEl.style.setProperty("display","none");this.isDragging=!1;const t=this.widgetData?"RIGHT_ALIGNED"===this.widgetData[$i]:"RIGHT_ALIGNED",e=t?"right":"left",i=`${St.WIDGET_POSITION}_${e}`,s=document.getElementById(Te),n=window.getComputedStyle(s),a=parseInt(n.bottom,10),o=t?parseInt(n.right,10):parseInt(n.left,10);if(o||a)xt(i,JSON.stringify({bottom:a,horizontal:o}),wt.THIRTY_MINUTES);else{s.style.removeProperty(e);s.style.removeProperty("bottom");Tt(i)}};this.handleDrag=t=>{if(!this.isDragging)return;const e=document.getElementById(Te),i=this.widgetData?"RIGHT_ALIGNED"===this.widgetData[$i]:"RIGHT_ALIGNED",s=i?"right":"left",n=i?window.innerWidth-t.clientX-this.offsetX:t.clientX-this.offsetX,a=window.innerHeight-t.clientY-this.offsetY;e.style.setProperty(s,`${Math.min(Math.max(0,n),window.innerWidth-e.clientWidth)}px`,"important");e.style.setProperty("bottom",`${Math.min(Math.max(0,a),window.innerHeight-e.clientHeight)}px`,"important");e.style.setProperty("position","fixed","!important")};this.unintializeDrag=()=>{if(this.dragHandleEl){this.dragHandleEl.removeEventListener("mousedown",this.handleDragStart);window.removeEventListener("mousemove",this.handleDrag);window.removeEventListener("mouseup",this.handleDragEnd);window.removeEventListener("mouseleave",this.handleDragEnd);this.dragHandleEl.remove()}};this.isSpotlight=()=>{var t,e;const i=null===(t=this.widgetData)||void 0===t?void 0:t.gates,s=null===(e=this.widgetData)||void 0===e?void 0:e.message;return(null==i?void 0:i[d])&&(null==s?void 0:s.launcherType)===ls};this.initalizeDrag=()=>{const{draggable:t}=this.widgetData;if(!t||this.isSpotlight()||o()||le().isFullscreen)return;this.dragHandleEl=document.createElement("div");this.dragHandleEl.classList.add("hs-drag-handle");this.dragHandleEl.title="Drag";this.dragHandleEl.style.setProperty("color",bs);this.dragHandleEl.innerHTML=`\n \n \n \n `;this.dragOverlayEl=document.createElement("div");this.dragOverlayEl.classList.add("hs-drag-overlay");const e=document.getElementById(Te);e.appendChild(this.dragOverlayEl);e.appendChild(this.dragHandleEl);e.style.setProperty("user-select","none");this.dragHandleEl.addEventListener("mousedown",this.handleDragStart);window.addEventListener("mousemove",this.handleDrag);window.addEventListener("mouseup",this.handleDragEnd);window.addEventListener("mouseleave",this.handleDragEnd)};this.getDefaultSize=()=>({width:100,height:96});this.getStartPosition=()=>{if(!this.widgetData.draggable||this.isSpotlight()||o()||le().isFullscreen)return null;const t=(this.widgetData?"RIGHT_ALIGNED"===this.widgetData[$i]:"RIGHT_ALIGNED")?"right":"left",e=Et(`${St.WIDGET_POSITION}_${t}`);if(!e)return null;try{return JSON.parse(e)}catch(t){console.error("Error parsing cookie",t);return null}};this.loadIFrame=()=>{o()&&document.documentElement.classList.add(Lt);const t=document.createElement("iframe");this.iframeSrc=this.embedScriptContext.getIFrameSrc();t.src=this.iframeSrc;t.id=_e;t.title="Chat Widget";t.allowFullscreen=!0;t.setAttribute("data-test-id","chat-widget-iframe");t.addEventListener("load",this.handleIframeLoad);const e=document.createElement("div");e.role="region";e.ariaLabel="Chat Widget";e.style.colorScheme="light";if(pe()){const i=document.querySelector(ue());if(!i){this.devLogger.error(`cannot embed widget - element at \`${ue()}\` cannot be found`);return}e.id=Oe;t.id=Ce;this.iframe=e.appendChild(t);i.appendChild(e);return}if(document.getElementById(Te)){console.warn(`Element with id ${Te} already exists. Unable to load HubSpot Conversations Widget.`);return}e.id=Te;le().shouldHideChatOnPrint&&e.classList.add(Pt);const i=this.getStartPosition();if(i){const t="RIGHT_ALIGNED"===this.widgetData[$i]?"right":"left";e.style.setProperty(t,`${i.horizontal}px`,"important");e.style.setProperty("bottom",`${i.bottom}px`,"important")}const{height:s,width:n}=this.getDefaultSize();e.style.minHeight=`${s}px`;e.style.minWidth=`${n}px`;const a=document.createElement("div");a.className=Mt;const r=Vt(this.embedScriptContext);if(r){e.classList.add(Dt);a.classList.add(Dt)}e.appendChild(a);r&&(t.id=Ss);this.iframe=e.appendChild(t);document.body.appendChild(e);this.initalizeDrag();this.setFrameClass()};this.handleI18nLabels=({data:t})=>{if(!this.iframe||!t)return;const e=t["conversations-visitor-ui.visitorExperienceAriaLabels.chatWidget"],i=t["conversations-visitor-experience-components.visitorExperienceAriaLabels.drag"],s=document.getElementById(pe()?Oe:Te);if(e){this.iframe.setAttribute("title",e);s&&(s.ariaLabel=e)}i&&this.dragHandleEl&&this.dragHandleEl.setAttribute("title",i)};this.clampPosition=()=>{var t;if(null===(t=this.widgetData)||void 0===t||!t.draggable||this.isSpotlight()||o()||le().isFullscreen)return;let e=!1;const i=document.getElementById(Te),s="RIGHT_ALIGNED"===this.widgetData[$i];if(!i||!i.getBoundingClientRect)return;const{top:n,left:a,right:r}=i.getBoundingClientRect(),{innerWidth:c,innerHeight:l}=window,{clientWidth:d,clientHeight:h}=i;if(n<0){e=!0;i.style.setProperty("bottom",`${Math.max(l-h,0)}px`,"important")}if(s&&a<0){e=!0;i.style.setProperty("right",`${Math.max(c-d,0)}px`,"important")}if(!s&&c-r<0){e=!0;i.style.setProperty("left",`${Math.max(c-d,0)}px`,"important")}e&&this.handleDragEnd()};this.handleClickOutside=t=>{if(o())return;const e=document.getElementById(Te);e&&!e.contains(t.target)&&this.requestWidgetClose()};this.setWidgetData=t=>{this.widgetData=t;this.setFrameClass()};this.embedScriptContext=t;this.detachedVisitorWindow=null;this.dragHandleEl=null;this.dragOverlayEl=null;this.isDragging=!1;this.offsetX=0;this.offsetY=0;this.isOpen=ke();this.spotlightMenuHeight=null;this.iframe=null;this.iframeSrc=null;this.hasLoadedIframe=!1;this.isLoadingIframe=!1;this.requestWidgetOpen=this.requestWidgetOpen.bind(this);this.requestWidgetClose=this.requestWidgetClose.bind(this);this.requestWidgetRefresh=vi(this.requestWidgetRefresh.bind(this),1e3);this.requestSetInputText=this.requestSetInputText.bind(this);this.handleBfcacheRestore=this.handleBfcacheRestore.bind(this);this.handleWindowResize=this.handleWindowResize.bind(this);this.handleIframeLoad=this.handleIframeLoad.bind(this);this.handleResizeMessage=this.handleResizeMessage.bind(this);this.handleResizeDragExpand=this.handleResizeDragExpand.bind(this);this.handleStoreWidgetSizePreference=this.handleStoreWidgetSizePreference.bind(this);this.handleOpenChange=this.handleOpenChange.bind(this);this.handleStoreMessagesCookie=this.handleStoreMessagesCookie.bind(this);this.handleRequestWidget=this.handleRequestWidget.bind(this);this.handleWidgetRefresh=this.handleWidgetRefresh.bind(this);this.setWidgetNotLoaded=this.setWidgetNotLoaded.bind(this);this.removeIframe=this.removeIframe.bind(this);this.handleExternalApiEventMessage=this.handleExternalApiEventMessage.bind(this);this.loadWidget=vi(this.loadWidget.bind(this),1e3);this.resetAndReloadWidget=this.resetAndReloadWidget.bind(this);this.setWidgetOpenCookie=this.setWidgetOpenCookie.bind(this);this.getStatus=this.getStatus.bind(this);this.handleScroll=this.handleScroll.bind(this);this.handleExitIntent=this.handleExitIntent.bind(this);this.extendedClearCookiesFunction=this.extendedClearCookiesFunction.bind(this);this.openToNewThread=this.openToNewThread.bind(this);this.handleDragHandlePositionChange=this.handleDragHandlePositionChange.bind(this);this.handleSpotlightMenuResize=this.handleSpotlightMenuResize.bind(this);this.handleLightboxOpen=this.handleLightboxOpen.bind(this);this.handleLightboxClose=this.handleLightboxClose.bind(this);this.handleInputTextChanged=this.handleInputTextChanged.bind(this);this.handleRestoreSavedLauncherPosition=this.handleRestoreSavedLauncherPosition.bind(this);this.handleResetToDefaultLauncherPosition=this.handleResetToDefaultLauncherPosition.bind(this);this.handleSpotlightLayoutChanged=this.handleSpotlightLayoutChanged.bind(this);this.devLogger=new Re;this.eventEmitter=i||new si;this.logError=e?e.logError:ks;this.scrollPercentageTracker=new Ti({onScroll:this.handleScroll});this.exitIntentTracker=new Ci({onExitIntent:this.handleExitIntent});this.screenCapturePlugin=new ys(this);this.voiceRecorderPlugin=new xs(this);const s=ss({iframeSrc:this.embedScriptContext.getIFrameSrc()});this.iframeMessage={post:(t,e={})=>{s.post(t,e);this.postToDetachedVisitorWindowIfOpen(t,e)}};this.apiUsageTracker=new zi({postMessageToIframe:this.iframeMessage.post});const n=new Gi(this.iframeMessage.post);this.pageTitleNotifications=new mt;this.postMessageReceiver=new ut({[h]:this.pageTitleNotifications.handleShow,[u]:this.pageTitleNotifications.handleClear,[v]:this.handleRequestWidget,[j]:this.requestWidgetRefresh,[p]:this.handleResizeMessage,[g]:this.handleResizeDragExpand,[m]:this.handleStoreWidgetSizePreference,[f]:this.handleOpenChange,[b]:as,[w]:this.handleStoreMessagesCookie,[y]:this.handleExternalApiEventMessage,[k]:n.makeApiRequest,[T]:this.handleI18nLabels,[O]:this.screenCapturePlugin.handleScreenCaptureRequest,[A]:this.voiceRecorderPlugin.handleVoiceRecordingRequest,[q]:this.voiceRecorderPlugin.handleVoiceRecordingConfirm,[H]:this.voiceRecorderPlugin.handleVoiceRecordingDiscard,[C]:this.handleDragHandlePositionChange,[_]:this.handleSpotlightMenuResize,[L]:this.handleLightboxOpen,[M]:this.handleLightboxClose,[D]:this.handleInputTextChanged,[R]:this.handleRestoreSavedLauncherPosition,[U]:this.handleResetToDefaultLauncherPosition,[P]:this.handleSpotlightLayoutChanged},{allowedOrigin:this.embedScriptContext.getIFrameDomain(),iframeUuid:this.embedScriptContext.iframeUuid});this.exitIntentTracker.registerPostMessageReceivers(this.postMessageReceiver);this.scrollPercentageTracker.registerPostMessageReceivers(this.postMessageReceiver)}handleExternalApiEventMessage(t){ni(t,{eventEmitter:this.eventEmitter})}handleScroll({scrollPercentage:t}){this.iframeMessage.post(K,{scrollPercentage:t})}handleExitIntent(){this.iframeMessage.post(J)}getStatus(){return{loaded:this.hasLoadedIframe,pending:this.isLoadingIframe}}handleIframeLoad(){setTimeout((()=>this.eventEmitter.trigger("widgetLoaded",{message:"widget has loaded"})));this.handleWindowResize();this.hasLoadedIframe=!0;this.isLoadingIframe=!1;Pi();this.postPerfAttributes(this.embedScriptContext.getPerfAttributes())}postPerfAttributes(t){Math.random()<.5&&this.iframeMessage.post(X,{perfAttributes:t})}resetAndReloadWidget(){this.removeIframe();Ni()}removeIframe(){this.unintializeDrag();document.removeEventListener("mousedown",this.handleClickOutside);const t=pe()?document.getElementById(Oe):document.getElementById(Te);t&&t.remove();this.iframeSrc=null;this.hasLoadedIframe=!1;this.isLoadingIframe=!1}handleResizeMessage({data:{height:t,width:e}={}}){os({height:t,width:e});this.clampPosition()}handleResizeDragExpand({data:{height:t,width:e}={}}){os({height:t,width:e})}handleSpotlightMenuResize({data:{isOpen:t,extraHeight:e}={}}){const i=document.getElementById(Te);if(i)if(t){null==this.spotlightMenuHeight&&(this.spotlightMenuHeight=i.getBoundingClientRect().height);i.style.height=`${this.spotlightMenuHeight+(null!=e?e:0)}px`}else if(null!=this.spotlightMenuHeight){i.style.height=`${this.spotlightMenuHeight}px`;this.spotlightMenuHeight=null}}handleLightboxOpen(){var t;null===(t=document.getElementById(Te))||void 0===t||null===(t=t.classList)||void 0===t||t.add(qt)}handleLightboxClose(){var t;null===(t=document.getElementById(Te))||void 0===t||null===(t=t.classList)||void 0===t||t.remove(qt)}setWidgetOpenCookie({isOpen:t}){xt(St.IS_OPEN,t,wt.THIRTY_MINUTES)}handleOpenChange({data:{isOpen:t,isUser:e}}){const i=document.documentElement,s=document.getElementById(Te).getElementsByClassName(Mt)[0];this.isOpen=t;e&&this.setWidgetOpenCookie({isOpen:this.isOpen});if(this.isOpen){i.classList.add(_t);s.classList.add("active")}else{i.classList.remove(_t);s.classList.remove("active");this.handleLightboxClose()}this.isOpen&&this.isSpotlight()&&!o()?document.addEventListener("mousedown",this.handleClickOutside):document.removeEventListener("mousedown",this.handleClickOutside)}handleDragHandlePositionChange({data:{dragHandleState:t}}){const{draggable:e,routingRuleDefinitionAI:i,message:s,systemChatflow:n}=this.widgetData,a=(null==s?void 0:s.launcherType)||cs,r=Boolean(i),c=Boolean(n),l=(r||c)&&(a===rs||a===cs);if(!e||this.isSpotlight()||o()||le().isFullscreen)return;const d="RIGHT_ALIGNED"===this.widgetData[$i]?"right":"left",h=()=>{this.dragHandleEl&&Array.from(this.dragHandleEl.classList).forEach((t=>{if(t.startsWith("hs-drag-handle--")){var e;null===(e=this.dragHandleEl)||void 0===e||e.classList.remove(t)}}))};if(this.dragHandleEl){h();"hidden"===t?this.dragHandleEl.style.setProperty("display","none"):this.dragHandleEl.style.setProperty("display","flex");l?this.dragHandleEl.classList.add(`hs-drag-handle--v2--${t}--${d}`):this.dragHandleEl.classList.add(`hs-drag-handle--v1--${d}`)}}handleInputTextChanged({data:{text:t}}){this.eventEmitter.trigger(Qe,{text:t})}handleRestoreSavedLauncherPosition(){var t;if(null===(t=this.widgetData)||void 0===t||!t.draggable||this.isSpotlight()||o()||le().isFullscreen)return;const e=document.getElementById(Te);if(!e)return;const i=this.getStartPosition();if(i){const t="RIGHT_ALIGNED"===this.widgetData[$i]?"right":"left";e.style.setProperty(t,`${i.horizontal}px`,"important");e.style.setProperty("bottom",`${i.bottom}px`,"important")}}handleResetToDefaultLauncherPosition(){const t=document.getElementById(Te);if(t){t.style.removeProperty("right");t.style.removeProperty("left");t.style.removeProperty("bottom")}}handleSpotlightLayoutChanged(t){}handleRequestWidget({source:t,data:e}){var i,s;const n=null!==(i=null===(s=this.iframe)||void 0===s?void 0:s.contentWindow)&&void 0!==i?i:null;if((null==n||t!==n)&&!0===(null==e?void 0:e.isDetachedVisitor)){this.detachedVisitorWindow&&!this.detachedVisitorWindow.closed&&this.detachedVisitorWindow!==t&&this.logError("handleRequestWidget: replacing an open detached visitor window with a new one");this.detachedVisitorWindow=t}Ki({source:t,widgetData:this.widgetData,embedScriptContext:this.embedScriptContext,apiUsageTracker:this.apiUsageTracker});const a=this.getWidgetSizePreference();a&&this.iframeMessage.post(W,a)}getWidgetSizePreference(){const t=Et(St.WIDGET_SIZE);if(!t)return null;try{return JSON.parse(t)}catch(t){return null}}handleStoreWidgetSizePreference({data:t}){xt(St.WIDGET_SIZE,JSON.stringify(t),wt.SIX_MONTHS)}postToDetachedVisitorWindowIfOpen(t,e={}){const i=this.detachedVisitorWindow;if(i&&!i.closed)try{ns({targetWindow:i,iframeSrc:this.embedScriptContext.getIFrameSrc(),type:t,data:e})}catch(e){this.logError(`Failed to post ${t} to detached visitor window: ${String(e)}`)}else this.detachedVisitorWindow=null}handleStoreMessagesCookie({data:t}){this.embedScriptContext.isFirstVisitorSession=!1;this.iframeMessage.post(B,{isFirstVisitorSession:!1});"yes"===gs()&&this.widgetData.gdprConsentOptions.cookieConsentPrompt!==ms&&window._hsp.push(["showBanner"]);$t(t)}requestWidgetOpen(){this.isOpen?this.devLogger.log("cannot open the widget, it is already open."):this.iframeMessage.post(F)}requestWidgetClose(){this.isOpen?this.iframeMessage.post(G):this.devLogger.log("cannot close the widget, it is already closed")}requestOpenToKBContent(t){var e;if(this.hasLoadedIframe)if(null!==(e=this.widgetData.message)&&void 0!==e&&e.knowledgeBaseEnabled)if(this.isSpotlight())this.devLogger.log("knowledge base navigation is not supported in Spotlight mode");else{this.requestWidgetOpen();this.iframeMessage.post(at,t)}else this.devLogger.log("cannot open to knowledge base, knowledge base is not enabled");else this.devLogger.log("cannot open to knowledge base, widget is not loaded")}requestSetInputText(t,e){this.iframe?this.iframeMessage.post(nt,{text:t,sendMessage:e}):this.devLogger.log("cannot set input text, widget is not loaded")}handleBfcacheRestore(){if(this.embedScriptContext.portalId===Wt){this.removeIframe();window.hubspot_live_messages_running=!1;this.loadWidget()}}handleWindowResize(){const t={height:window.innerHeight,width:window.innerWidth};this.iframeMessage.post(V,t);this.clampPosition()}requestWidgetRefresh({openToNewThread:t,setIdentification:e=!1}={}){const{portalId:i}=this.embedScriptContext;if(this.hasLoadedIframe||!this.isLoadingIframe)if(this.hasLoadedIframe){const s=this.embedScriptContext.getInitialRequestUrl(e);e&&this.postVisitorIdentificationAttributes();gi({requestUrl:s,portalId:i},(e=>{this.handleWidgetRefresh(e);t&&this.openToNewThread()}))}else{this.loadWidget();t&&this.openToNewThread()}else this.devLogger.log("Cannot refresh the widget - it is currently loading.")}openToNewThread(){this.iframeMessage.post(tt)}extendedClearCookiesFunction(t){t&&t[Ot]&&this.removeIframe();Ct(t)}handleWidgetRefresh(t){this.setWidgetData(t);bt(this.widgetData)===Ht?this.removeIframe():this.iframeMessage.post(j,Object.assign({},this.widgetData,Ei(this.embedScriptContext)))}setWidgetNotLoaded({reason:t,description:e}){this.hasLoadedIframe=!1;this.isLoadingIframe=!1;(t||e)&&this.eventEmitter.trigger(Xe,{reason:t,description:e})}loadWidget(t={}){const{portalId:e}=this.embedScriptContext;if(this.isLoadingIframe)this.devLogger.log("Cannot load the widget - The widget is already being loaded.");else if(this.hasLoadedIframe)this.devLogger.log("Cannot load the widget - the widget has already loaded.");else{this.isLoadingIframe=!0;t.widgetOpen&&this.setWidgetOpenCookie({isOpen:!0});gi({requestUrl:this.embedScriptContext.getInitialRequestUrl(),portalId:e},ps(this.setWidgetData,this.loadIFrame,this.setWidgetNotLoaded),(()=>{bi.messagesInitialized({messageWillRender:!1})}))}}start(){const{shouldRender:t}=Zt(this.embedScriptContext);if(t){Le({debug:this.devLogger.debug,on:(t,e)=>{this.eventEmitter.on(t,e);this.apiUsageTracker.trackEventListener(t)},off:this.eventEmitter.off,clear:t=>{this.extendedClearCookiesFunction(t);this.apiUsageTracker.trackMethod("clear")},resetAndReloadWidget:this.resetAndReloadWidget,widget:{load:t=>{this.loadWidget(t);this.apiUsageTracker.trackMethod("load")},remove:()=>{this.removeIframe();this.apiUsageTracker.trackMethod("remove")},open:()=>{this.requestWidgetOpen();this.apiUsageTracker.trackMethod("open")},close:()=>{this.requestWidgetClose();this.apiUsageTracker.trackMethod("close")},refresh:(...t)=>{this.requestWidgetRefresh(...t);this.apiUsageTracker.trackMethod("refresh")},status:()=>{this.apiUsageTracker.trackMethod("status");return this.getStatus()},updateEntryUrlMetadata:t=>{this.postEntryUrlMetadata(t);this.apiUsageTracker.trackMethod("updateEntryUrlMetadata")},setInputText:(t,e)=>{this.requestSetInputText(t,e);this.apiUsageTracker.trackMethod("setInputText")},openToKnowledgeBase:()=>{this.requestOpenToKBContent({type:"knowledge-base"});this.apiUsageTracker.trackMethod("openToKnowledgeBase")},openToCategory:t=>{this.requestOpenToKBContent({type:"category",categoryId:t});this.apiUsageTracker.trackMethod("openToCategory")},openToArticle:t=>{this.requestOpenToKBContent({type:"article",articleId:t});this.apiUsageTracker.trackMethod("openToArticle")}}});Me({logger:this.devLogger,trackCallback:this.apiUsageTracker.trackOnReady});Xi({requestWidgetOpen:this.requestWidgetOpen,isOpen:this.isOpen});Zi({resizeCallbackFn:this.handleWindowResize});Yi({onRestore:this.handleBfcacheRestore});Ji({postMessageToIframe:this.iframeMessage.post});de()&&this.loadWidget();this.postVisitorIdentificationAttributes();this.postEntryUrlMetadata();this.registerEntryUrlMetadataObserver()}else try{bi.messagesInitialized({messageWillRender:!1})}catch(t){this.devLogger.log("widget load aborted")}}postVisitorIdentificationAttributes(){const{identificationEmail:t,identificationToken:e}=this.embedScriptContext;this.iframeMessage.post(it,{identificationEmail:t,identificationToken:e})}postEntryUrlMetadata(t){var e;const i="string"==typeof(null==t?void 0:t.title)?t.title:document.title,s="string"==typeof(null==t?void 0:t.description)?t.description:(null===(e=document.querySelector('meta[name="description"]'))||void 0===e?void 0:e.getAttribute("content"))||"";this.iframeMessage.post(st,{title:i,description:s})}registerEntryUrlMetadataObserver(){const t=document.querySelector("title"),e=document.querySelector('meta[name="description"]'),i=new MutationObserver((t=>{this.pageTitleNotifications.notificationIntervalIsRunning()||t.forEach((()=>{setTimeout((()=>{this.postEntryUrlMetadata()}),0)}))}));t&&i.observe(t,{childList:!0});e&&i.observe(e,{attributes:!0})}setFrameClass(){const t=document.getElementById(Te);if(!t)return;const e=this.widgetData[$i];this.isSpotlight()&&!o()?t.classList.add(At):Hi({widgetLocation:e,classList:t.classList})}}var Os=i(3),Cs=i.n(Os);function _s(t){const{hsConversationsSettings:e}=window;if(null!=e&&e.avoidInlineStyles){const e=t.createElement("link");e.setAttribute("rel","stylesheet");e.setAttribute("type","text/css");e.setAttribute("href",Cs().replace(".sass",".css"));t.head.appendChild(e);return}const s=i(4),n=t.createElement("style");n.setAttribute("type","text/css");const a=document.createTextNode(s);n.appendChild(a);t.head.appendChild(n)}function Ls(){let t=(new Date).getTime();return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(e=>{const i=(t+16*Math.random())%16|0;t=Math.floor(t/16);return("x"===e?i:3&i|8).toString(16)}))}function Ms(){const t=window.crypto||window.msCrypto,e=new Uint16Array(8);t.getRandomValues(e);const i=t=>{let e=t.toString(16);for(;e.length<4;)e=`0${e}`;return e};return i(e[0])+i(e[1])+i(e[2])+i(e[3])+i(e[4])+i(e[5])+i(e[6])+i(e[7])}function Ds(){var t;const e=window.crypto||window.msCrypto;return null==e||!e.getRandomValues||null!==(t=window)&&void 0!==t&&t.Uint16Array?Ls():Ms()}function Rs({existingMessagesUtk:t}={}){let e,i=!1;if(t)e=t;else{i=!0;e=Ds()}return{messagesUtk:e,isFirstVisitorSession:i}}const Us=/[a-zA-Z\d]{32}/;function Ps(t){return Us.test(t)}function As(){const t=Et(St.MESSAGES);return Ps(t)?t:void 0}function qs(){return Et(St.HUBSPOT)}function Hs(){return Et(St.HSTC)}function $s(){return Et(St.HSSC)}const Ws=()=>{const t=As();t&&$t(t);const e=qs(),i=Hs(),s=$s(),n=gs(),{messagesUtk:a,isFirstVisitorSession:o}=Rs({existingMessagesUtk:t});return{messagesUtk:a,hubspotUtk:e,hstc:i,hssc:s,globalCookieOptOut:n,isFirstVisitorSession:o}},Ns=()=>{const t=document.getElementById("hubspot-messages-loader");return parseInt(t.getAttribute("data-hsjs-portal"),10)},zs=()=>document.getElementById("hubspot-messages-loader").getAttribute("data-hsjs-env"),Bs=()=>document.getElementById("hubspot-messages-loader").getAttribute("data-hsjs-hublet"),js=()=>"true"===document.getElementById("hubspot-messages-loader").getAttribute("data-hsjs-local");function Fs(){return{ungatedFor:document.getElementById("hubspot-messages-loader").getAttribute("ungated-for"),portalId:Ns(),messagesEnv:zs(),messagesHublet:Bs(),isLocal:js()}}const Gs=(t,e="")=>lt("number"==typeof t,"Expected %s to be a number, not a %s",e||t,typeof t),Vs=["api","local","app","private","platform","tools","meetings","payments","mcp"],Ks=["hubspotstarter","hubspotfree","hubspotemail"],Js=["growth"],Xs={com:["hubspot","hubteam","grader","getsignals","getsidekick","gettally","hubspotemail","customer-hub","hubspotservicehub","hubspotquote","hubspotdocuments","hubspotrecap","hs-data-privacy"].join("|"),net:Ks.join("|"),org:Js.join("|")},Ys=function t(e){const i=new RegExp(`^(?!local|test|selenium)(.*\\.)?(${Object.entries(Xs).map((([t,e])=>`(?:${e})(qa)?\\.${t}`)).join("|")}|(?:connect)\\.com|(?:connect)(qa)\\.co|wthubspot\\.(com|de|es|fr|jp))$`),s=new RegExp("^(?:[^.]+)\\.(?:preview).app(-[a-z]+[0-9])?\\.hubspotqa\\.com"),n=new RegExp("^(?:[^.]+)\\.(?:local)\\.(app|tools|private)(-[a-z]+[0-9])?\\.(hubspot|hubteam)(qa)?\\.com"),a=new RegExp("^(?:[^.]+)\\.local(-[a-z]+[0-9])?\\.(hubspot|hubteam)(qa)?\\.com"),o=i.test(e.hostname),r=n.test(e.hostname)||a.test(e.hostname),c=s.test(e.hostname),l=o&&!r||c,d=new RegExp(`${Object.entries(Xs).map((([t,e])=>`(?:${e})qa\\.${t}`)).join("|")}|(?:connect)qa\\.co|wthubspot\\.(com|de|es|fr|jp)|hsqa-sales(?:crm)?-sub\\.com|(?:hubspotstarter|hubspotfree|hubspotemail)(qa)(?:-.*)\\.net|(?:hubspotemail)(qa)(?:-.*)\\.com`),h=[new RegExp(`^(?:${Vs.join("|")})-(.*).(?:hubspot|hubteam)(?:qa)?.com`),new RegExp("^(.*).(?:hubspotquote)(?:qa)?.com"),new RegExp("^app-(.*).(?:hubspotdocuments)(?:qa)?.com"),new RegExp("^app-(.*).(?:hubspotrecap)(?:qa)?.com"),new RegExp("^(?:[0-9]+).(.*).hs(?:qa)?-sales(?:crm)?-sub.com"),new RegExp("^(?:[a-zA-Z0-9-]+)\\.([a-z0-9]+)\\.hs(?:qa)?-sales(?:crm)?-sub\\.com"),new RegExp("^hs-(?:[0-9]+).s.(?:hubspotfree|hubspotstarter|hubspotemail)(?:qa)?-(.*).net"),new RegExp("^hs-(?:[0-9]+).s.(?:hubspotemail)(?:qa)?-(.*).com"),new RegExp("^t.sidekickopen(?:\\d)+-([a-z]+[0-9]).com"),new RegExp("^([a-z]+[0-9]).hs-data-privacy(?:qa)?.com"),new RegExp("^(?:[^.]+)\\.(?:preview|local)\\.app-([a-z]+[0-9])\\.hubspot(qa)?\\.com"),new RegExp("^(?:[^.]+)\\.local-([a-z]+[0-9])\\.(hubspot|hubteam)(qa)?\\.com")],u="ENV",p="Enviro error: the default argument for .get and .getShort is no longer supported",g=t=>{let e=window[t];if(null==e)try{e=window.sessionStorage.getItem(t)}catch(t){}if(null==e)try{e=window.localStorage.getItem(t)}catch(t){}return e},m=()=>{const t=g(u);return t||(d.test(e.host)?"qa":"prod")},f=(t,e)=>{window[t]=e;return e},b={prod:"production",qa:"development"},v=t=>{if("string"==typeof t){const e=t.toLowerCase();return b[e]||e}return t},w=t=>{t="string"==typeof t?t.toLowerCase():void 0;return Object.keys(b).find((e=>t===b[e]))||t},y=(t,e)=>{if(null!=e)throw new Error(p);let i=null;if(t){const e=t.split(".").reverse();for(let t=0;t{if(null!=e)throw new Error(p);return w(y(t))},x=I,S=t=>"prod"===x(t),k=t=>"qa"===x(t),T=()=>{const t=g("HUBLET");if(t)return t;for(const t of h)if(t.test(e.hostname))return t.exec(e.hostname)[1];return"na1"};function O({isNa1:t,isNonNa1:e},i){i||(i=T());return"na1"===i?"function"==typeof t?t(i):void 0:"function"==typeof e?e(i):void 0}return{createEnviro:t,debug:(t,e=!1)=>{let i;"string"==typeof t&&(i=g(`${t.toUpperCase()}_DEBUG`));null==i&&(i=g("DEBUG"));return null==i?e:i},denormalize:w,deployed:t=>{let e;"string"==typeof t&&(e=g(`${t.toUpperCase()}_DEPLOYED`));null==e&&(e=g("DEPLOYED"));return null==e?l:!!e},enabled:(t,e=!1)=>{let i=g(`${t.toUpperCase()}_ENABLED`);null==i&&(i=JSON.stringify(e));return"true"===`${i}`.toLowerCase()},get:y,getHublet:T,getInternal:I,getShort:x,isProd:S,isQa:k,ifHublet:O,normalize:v,set:E,setDebug:(t,e=!0)=>{if("string"==typeof t)try{e?localStorage.setItem(`${t.toUpperCase()}_DEBUG`,JSON.stringify(!0)):localStorage.removeItem(`${t.toUpperCase()}_DEBUG`)}catch(i){f(`${t.toUpperCase()}_DEBUG`,e||void 0)}else{e=null==t||t;try{e?localStorage.setItem("DEBUG",JSON.stringify(e)):localStorage.removeItem("DEBUG")}catch(t){f("DEBUG",e||void 0)}}}}};var Zs=Ys(document.location);const Qs="na1",tn={APP:"app",APP_API:"app-api"};function en(t,e){const i=e&&e.hubletOverride?e.hubletOverride:t,s=e&&!0===e.hubletizeNa1;return i!==Qs||s?`-${i}`:""}function sn(t,e,i){if(i&&i.hubletPostfixLocation&&"domain"===i.hubletPostfixLocation)return e;e===tn.APP_API&&(e=tn.APP);return`${e}${en(t,i)}`}function nn(t,e,i){return`${on(i)}${an(e,i)}${rn(t,i)}`}function an(t,e){return"qa"===(e&&e.envOverride?e.envOverride:t)?"qa":""}function on(t){return t&&t.domainOverride?t.domainOverride:"hubspot"}function rn(t,e){return e&&e.hubletPostfixLocation&&"domain"===e.hubletPostfixLocation?en(t,e):""}function cn(t){return t&&t.tldOverride?t.tldOverride:"com"}function ln(t){return t===tn.APP_API?"/api":""}function dn(t){return t&&t.hubletOverride?t.hubletOverride:Zs.getHublet()}function hn(t){return t&&t.envOverride?t.envOverride:Zs.getShort()}function un(t,e){return sn(dn(e),t,e)}function pn(t){return nn(dn(t),hn(t),t)}function gn(t){return cn(t)}function mn(t){return ln(t)}function fn(t,e){return`https://${un(t,e)}.${pn(e)}.${gn(e)}${mn(t)}`}var bn={mode:"compressed",staticDomainPrefix:"//static.hsappstatic.net",bender:{depVersions:{"conversations-embed":"static-1.28672","conversations-internal-schema":"static-1.13612","head-dlb":"static-1.5007","hs-test-utils":"static-1.8504","hubspot-url-utils":"static-1.4458",HubStyleTokens:"static-2.11956",I18n:"static-7.1705","jasmine-runner":"static-1.6919",quartz:"static-1.7645",react:"static-7.203",reselect:"static-3.16",sinon:"static-1.9",StyleGuideUI:"static-3.517","webpack-env":"static-1.54","visitor-ui-component-library":"static-1.6625",enviro:"static-4.455","hs-promise-rejection-tracking":"static-1.5587",PortalIdParser:"static-2.404",raven:"static-3.5925","raven-hubspot":"static-1.6232",moment:"static-3.75","customer-data-email":"static-1.18626","cv-backend-services":"static-1.1607","hub-http":"static-1.6675",immutable:"static-2.91","immutable-less":"static-1.5120","quartz-config":"static-1.1423","quartz-core":"static-1.6864",transmute:"static-2.97",HeadJS:"static-2.819","react-dom":"static-7.85","foundations-components":"static-1.8734","framer-motion":"static-1.83","hs-test-utils-bend-plugin":"static-1.3615",msw:"static-1.102","msw-config":"static-1.26","react-redux":"static-7.83",redux:"static-4.84","testing-library":"static-1.163","foundations-theming":"static-1.4955","i18n-data":"static-1.234","metrics-js":"static-1.10105","moment-timezone":"static-5.95","react-utils":"static-2.5652",jasmine:"static-4.4776",csstype:"static-1.50","hoist-non-react-statics":"static-3.9",PatternValidationJS:"static-1.3353","react-aria":"static-1.76","styled-components":"static-2.103",UIComponents:"static-3.8902","visitor-ui-component-library-icons":"static-1.6436","apollo-dlb":"static-3.98","apollo-link-hub-http":"static-2.5054","apollo-stack-hubspot":"static-3.98",classnames:"static-2.10",cssUtils:"static-1.1091","customer-data-objects":"static-1.8166","customer-data-ui-utilities":"static-1.10303","data-fetching-client":"static-1.10106",FileManagerCore:"static-1.40319",FileManagerLib:"static-1.40460","foundations-assets":"static-1.5353",graphql:"static-1.93","hs-promise-utils":"static-1.6059","hubspot-apollo-client":"static-1.5347",icons:"static-2.701","react-immutable-proptypes":"static-2.8","react-immutable-render-mixin":"static-1.9","react-input-autosize":"static-2.17","react-select-plus":"static-1.117","react-virtualized":"static-2.111","rpc-client-utils":"static-1.5138",salesImages:"static-1.725","timezone-utils":"static-2.5699","ui-gdpr-components":"static-1.10654","ts-schema":"static-1.4390","hs-locale-management":"static-1.396","hs-lodash":"static-4.45",immer:"static-1.105","opentelemetry-fe-types":"static-1-unrevert-default-instrumentation.4",dispatcher:"static-1.147","general-store":"static-6.20","hub-http-janus":"static-1.904","hubspotter-http":"static-1.4972","mobile-manifest-mixins":"static-1.603","module-federation":"static-1.37","opentelemetry-fe":"static-1-unrevert-default-instrumentation.4","quartz-auth":"static-1.1320","quartz-head":"static-1.1310","quartz-i18n":"static-1.1320","quartz-routing":"static-1.1075","quartz-test":"static-1.1320","quartz-tracking":"static-1.1024","quick-fetch":"static-1.4227","react-rhumb":"static-1.17203","trellis-components":"static-1.3082","ui-fonts":"static-1.1218","usage-tracker-container":"static-1.7779","usage-tracker-core":"static-1.7639","bend-plugin-foundations-components":"static-1.5003","floating-ui":"static-1.67","foundations-theming-specialty":"static-1.2671","hs-story-utils":"static-1.9891","react-create-root-preference":"static-1.100","tanstack-table":"static-1.65","trellis-assets":"static-1.3063","ui-images":"static-2.1275","bender-build-tools":"static-1.3556","bend-plugin-foundations-theming":"static-1.3438","foundations-theming-base":"static-1.3940",stylex:"static-1.46","beacon-keepalive-queue":"static-1.168","bend-plugin-metrics-js":"static-1.82",HubStyle:"static-2.12263","opentelemetry-web":"static-1.22",sassPrefix:"static-1.356","inbound-db-properties-service-client":"static-1.4148","property-translator":"static-1.5847","react-dnd-compat":"static-1.5079","fast-json-stable-stringify":"static-1.4","ai-components-ui-library":"static-1.10003","audio-components":"static-1.6557","breeze-artifacts-sdk":"static-1.910",ContentUtils:"static-1.69455","copilot-toolkit":"static-1.12130",cropperjs:"static-1.10","feedback-loader":"static-1.30047","file-manager-components":"static-1.24820",FileManagerImages:"static-1.37971","foundations-components-legacy":"static-1.1759","html-to-image":"static-1.65",immerable:"static-1.4610","react-colorpicker":"static-2.10677","redux-toolkit":"static-1.82","ui-universal-auth":"static-1.9715",urlinator:"static-1.4983","usage-tracker":"static-1.7789","video-components":"static-1.14417","video-data-lib":"static-1.36073","video-embed":"static-1.36907","redux-thunk":"static-2.84","hubspot-apollo-cache":"static-1.806","bend-plugin-chirp-manifest":"static-1.548","chirp-fetch":"static-1.2371","hub-http-shared-msw-handlers":"static-1.10886","hubspotter-http-shared-msw-handlers":"static-1.10884","usage-tracker-session-replay":"static-1.5475","web-vitals":"static-1.19","base-ui":"static-1.27","react-day-picker":"static-1.14","trellis-theming":"static-1.1465","tanstack-virtual":"static-1.42","stylex-utils":"static-1.172","react-dnd":"static-5.6","react-dnd-html5-backend":"static-5.6",autolinker:"static-3.11","chatspot-core":"static-1.23816","customer-data-objects-ui-components":"static-1.13500",sanitize:"static-1.4941","sanitize-text":"static-1.8626","content-assistance-lib":"static-1.8410","breeze-engine-core":"static-1.1406","cms-field-types":"static-1.5278","content-icons-ui":"static-1.2450","integrations-lib":"static-1.17414",underscore:"static-1.8","breeze-engine-lib":"static-1.2128","magpie-lib":"static-1.5903","magpie-types":"static-1.5363","simple-logging-lib":"static-1.3519",superstore:"static-1.5225","nudge-client-utils":"static-1.3406","poll-commands":"static-1.3944","ui-addon-iframeable":"static-1.9542","video-components-external":"static-1.12415","unified-auth-core-lib":"static-1.1511","social-insights-client-types":"static-1.22913",SharedI18nStrings:"static-1.187",outpost:"static-1.4597","amplitude-session-replay-browser":"static-1.60","markdown-it":"static-1.6",atom:"static-1.5542","avatar-components":"static-1.2954","reference-resolvers":"static-1.8648","ui-addon-video-player":"static-1.9092","ui-coaching-tips":"static-1.29575","flux-actions":"static-1.380","frontend-preferences-client":"static-1.8388","integrations-error-boundary-lib":"static-1.14829","integrations-tracking-lib":"static-1.6084","laboratory-lib":"static-3.7616","native-integrations-shared-strings":"static-1.8230","redux-observable":"static-1.79",ReduxMessenger:"static-2.10837",rxjs:"static-5.10","ui-addon-i18n":"static-1.11614","ui-shepherd-react":"static-3.10744",ably:"static-2.2","batch-promise":"static-1.2014","breeze-engine-chat-components":"static-1.1106","highlight.js":"static-1.90",pulse:"static-1.1113","idb-keyval":"static-1.55","reactive-lib":"static-1.1190","nudge-custom-function-registry":"static-1.3163","nudge-renderer-utils":"static-1.3482","onboarding-tours":"static-1.17388","whisper-core-api":"static-1.7621","navigation-messaging":"static-1.8477","content-media-composition-data-lib":"static-1.13577","content-media-compositions":"static-2.17584","media-bridge-lib":"static-1.19627",fsm:"static-1.4226","trellis-migration-context":"static-1.46","growth-onboarding-feedback-components":"static-1.7050","universal-page-editor-lib":"static-1.3476","foundations-components-test-utils":"static-1.6217","bend-plugin-pulse":"static-1.616","event-emitter":"static-1.1430","fast-json-patch":"static-1.74","getting-started-shared-tasks":"static-1.19547","growth-data-modal":"static-1.6122","growth-onboarding-confetti":"static-1.3528","growth-onboarding-next-action-utils":"static-1.2968","navigation-components":"static-1.19150",nest:"static-1.703","onboarding-tours-client":"static-1.5603","onboarding-tours-utils":"static-1.1455","ui-shepherd-tracker":"static-1.8125","user-context":"static-1.5521","nav-meta":"static-1.30787","js-cookie":"static-1.18","crm-record-cards-service-types":"static-1.3869","framework-data-schema-resolvers":"static-1.7360","location-customization-utils-lib":"static-1.10400","onboarding-data-sync-lib":"static-1.2829","growth-onboarding-next-action-components":"static-1.2996","user-context-client":"static-1.4978","getting-started-shared-tasks-store":"static-1.18665","conditional-properties-service-client":"static-1.4109","crm-pipelines-api-client-types":"static-1.4440","fdsr-migration-layer":"static-1.479","framework-builder-read-service-client":"static-1.4331","framework-data-schema-quick-fetch":"static-1.7265","inbound-db-meta-service-client":"static-1.3772","multi-currency-client-types":"static-1.4004","persist-promise":"static-1.4171",InboxConnectUtils:"static-4.15828","meetings-connect-utils-lib":"static-1.8085","onboarding-scopes":"static-1.6920","hub-http-contrib":"static-1.3498","ui-addon-sales-email":"static-1.5670"},depPathPrefixes:{"conversations-embed":"/conversations-embed/static-1.28672","conversations-internal-schema":"/conversations-internal-schema/static-1.13612","head-dlb":"/head-dlb/static-1.5007","hs-test-utils":"/hs-test-utils/static-1.8504","hubspot-url-utils":"/hubspot-url-utils/static-1.4458",HubStyleTokens:"/HubStyleTokens/static-2.11956",I18n:"/I18n/static-7.1705","jasmine-runner":"/jasmine-runner/static-1.6919",quartz:"/quartz/static-1.7645",react:"/react/static-7.203",reselect:"/reselect/static-3.16",sinon:"/sinon/static-1.9",StyleGuideUI:"/StyleGuideUI/static-3.517","webpack-env":"/webpack-env/static-1.54","visitor-ui-component-library":"/visitor-ui-component-library/static-1.6625",enviro:"/enviro/static-4.455","hs-promise-rejection-tracking":"/hs-promise-rejection-tracking/static-1.5587",PortalIdParser:"/PortalIdParser/static-2.404",raven:"/raven/static-3.5925","raven-hubspot":"/raven-hubspot/static-1.6232",moment:"/moment/static-3.75","customer-data-email":"/customer-data-email/static-1.18626","cv-backend-services":"/cv-backend-services/static-1.1607","hub-http":"/hub-http/static-1.6675",immutable:"/immutable/static-2.91","immutable-less":"/immutable-less/static-1.5120","quartz-config":"/quartz-config/static-1.1423","quartz-core":"/quartz-core/static-1.6864",transmute:"/transmute/static-2.97",HeadJS:"/HeadJS/static-2.819","react-dom":"/react-dom/static-7.85","foundations-components":"/foundations-components/static-1.8734","framer-motion":"/framer-motion/static-1.83","hs-test-utils-bend-plugin":"/hs-test-utils-bend-plugin/static-1.3615",msw:"/msw/static-1.102","msw-config":"/msw-config/static-1.26","react-redux":"/react-redux/static-7.83",redux:"/redux/static-4.84","testing-library":"/testing-library/static-1.163","foundations-theming":"/foundations-theming/static-1.4955","i18n-data":"/i18n-data/static-1.234","metrics-js":"/metrics-js/static-1.10105","moment-timezone":"/moment-timezone/static-5.95","react-utils":"/react-utils/static-2.5652",jasmine:"/jasmine/static-4.4776",csstype:"/csstype/static-1.50","hoist-non-react-statics":"/hoist-non-react-statics/static-3.9",PatternValidationJS:"/PatternValidationJS/static-1.3353","react-aria":"/react-aria/static-1.76","styled-components":"/styled-components/static-2.103",UIComponents:"/UIComponents/static-3.8902","visitor-ui-component-library-icons":"/visitor-ui-component-library-icons/static-1.6436","apollo-dlb":"/apollo-dlb/static-3.98","apollo-link-hub-http":"/apollo-link-hub-http/static-2.5054","apollo-stack-hubspot":"/apollo-stack-hubspot/static-3.98",classnames:"/classnames/static-2.10",cssUtils:"/cssUtils/static-1.1091","customer-data-objects":"/customer-data-objects/static-1.8166","customer-data-ui-utilities":"/customer-data-ui-utilities/static-1.10303","data-fetching-client":"/data-fetching-client/static-1.10106",FileManagerCore:"/FileManagerCore/static-1.40319",FileManagerLib:"/FileManagerLib/static-1.40460","foundations-assets":"/foundations-assets/static-1.5353",graphql:"/graphql/static-1.93","hs-promise-utils":"/hs-promise-utils/static-1.6059","hubspot-apollo-client":"/hubspot-apollo-client/static-1.5347",icons:"/icons/static-2.701","react-immutable-proptypes":"/react-immutable-proptypes/static-2.8","react-immutable-render-mixin":"/react-immutable-render-mixin/static-1.9","react-input-autosize":"/react-input-autosize/static-2.17","react-select-plus":"/react-select-plus/static-1.117","react-virtualized":"/react-virtualized/static-2.111","rpc-client-utils":"/rpc-client-utils/static-1.5138",salesImages:"/salesImages/static-1.725","timezone-utils":"/timezone-utils/static-2.5699","ui-gdpr-components":"/ui-gdpr-components/static-1.10654","ts-schema":"/ts-schema/static-1.4390","hs-locale-management":"/hs-locale-management/static-1.396","hs-lodash":"/hs-lodash/static-4.45",immer:"/immer/static-1.105","opentelemetry-fe-types":"/opentelemetry-fe-types/static-1-unrevert-default-instrumentation.4",dispatcher:"/dispatcher/static-1.147","general-store":"/general-store/static-6.20","hub-http-janus":"/hub-http-janus/static-1.904","hubspotter-http":"/hubspotter-http/static-1.4972","mobile-manifest-mixins":"/mobile-manifest-mixins/static-1.603","module-federation":"/module-federation/static-1.37","opentelemetry-fe":"/opentelemetry-fe/static-1-unrevert-default-instrumentation.4","quartz-auth":"/quartz-auth/static-1.1320","quartz-head":"/quartz-head/static-1.1310","quartz-i18n":"/quartz-i18n/static-1.1320","quartz-routing":"/quartz-routing/static-1.1075","quartz-test":"/quartz-test/static-1.1320","quartz-tracking":"/quartz-tracking/static-1.1024","quick-fetch":"/quick-fetch/static-1.4227","react-rhumb":"/react-rhumb/static-1.17203","trellis-components":"/trellis-components/static-1.3082","ui-fonts":"/ui-fonts/static-1.1218","usage-tracker-container":"/usage-tracker-container/static-1.7779","usage-tracker-core":"/usage-tracker-core/static-1.7639","bend-plugin-foundations-components":"/bend-plugin-foundations-components/static-1.5003","floating-ui":"/floating-ui/static-1.67","foundations-theming-specialty":"/foundations-theming-specialty/static-1.2671","hs-story-utils":"/hs-story-utils/static-1.9891","react-create-root-preference":"/react-create-root-preference/static-1.100","tanstack-table":"/tanstack-table/static-1.65","trellis-assets":"/trellis-assets/static-1.3063","ui-images":"/ui-images/static-2.1275","bender-build-tools":"/bender-build-tools/static-1.3556","bend-plugin-foundations-theming":"/bend-plugin-foundations-theming/static-1.3438","foundations-theming-base":"/foundations-theming-base/static-1.3940",stylex:"/stylex/static-1.46","beacon-keepalive-queue":"/beacon-keepalive-queue/static-1.168","bend-plugin-metrics-js":"/bend-plugin-metrics-js/static-1.82",HubStyle:"/HubStyle/static-2.12263","opentelemetry-web":"/opentelemetry-web/static-1.22",sassPrefix:"/sassPrefix/static-1.356","inbound-db-properties-service-client":"/inbound-db-properties-service-client/static-1.4148","property-translator":"/property-translator/static-1.5847","react-dnd-compat":"/react-dnd-compat/static-1.5079","fast-json-stable-stringify":"/fast-json-stable-stringify/static-1.4","ai-components-ui-library":"/ai-components-ui-library/static-1.10003","audio-components":"/audio-components/static-1.6557","breeze-artifacts-sdk":"/breeze-artifacts-sdk/static-1.910",ContentUtils:"/ContentUtils/static-1.69455","copilot-toolkit":"/copilot-toolkit/static-1.12130",cropperjs:"/cropperjs/static-1.10","feedback-loader":"/feedback-loader/static-1.30047","file-manager-components":"/file-manager-components/static-1.24820",FileManagerImages:"/FileManagerImages/static-1.37971","foundations-components-legacy":"/foundations-components-legacy/static-1.1759","html-to-image":"/html-to-image/static-1.65",immerable:"/immerable/static-1.4610","react-colorpicker":"/react-colorpicker/static-2.10677","redux-toolkit":"/redux-toolkit/static-1.82","ui-universal-auth":"/ui-universal-auth/static-1.9715",urlinator:"/urlinator/static-1.4983","usage-tracker":"/usage-tracker/static-1.7789","video-components":"/video-components/static-1.14417","video-data-lib":"/video-data-lib/static-1.36073","video-embed":"/video-embed/static-1.36907","redux-thunk":"/redux-thunk/static-2.84","hubspot-apollo-cache":"/hubspot-apollo-cache/static-1.806","bend-plugin-chirp-manifest":"/bend-plugin-chirp-manifest/static-1.548","chirp-fetch":"/chirp-fetch/static-1.2371","hub-http-shared-msw-handlers":"/hub-http-shared-msw-handlers/static-1.10886","hubspotter-http-shared-msw-handlers":"/hubspotter-http-shared-msw-handlers/static-1.10884","usage-tracker-session-replay":"/usage-tracker-session-replay/static-1.5475","web-vitals":"/web-vitals/static-1.19","base-ui":"/base-ui/static-1.27","react-day-picker":"/react-day-picker/static-1.14","trellis-theming":"/trellis-theming/static-1.1465","tanstack-virtual":"/tanstack-virtual/static-1.42","stylex-utils":"/stylex-utils/static-1.172","react-dnd":"/react-dnd/static-5.6","react-dnd-html5-backend":"/react-dnd-html5-backend/static-5.6",autolinker:"/autolinker/static-3.11","chatspot-core":"/chatspot-core/static-1.23816","customer-data-objects-ui-components":"/customer-data-objects-ui-components/static-1.13500",sanitize:"/sanitize/static-1.4941","sanitize-text":"/sanitize-text/static-1.8626","content-assistance-lib":"/content-assistance-lib/static-1.8410","breeze-engine-core":"/breeze-engine-core/static-1.1406","cms-field-types":"/cms-field-types/static-1.5278","content-icons-ui":"/content-icons-ui/static-1.2450","integrations-lib":"/integrations-lib/static-1.17414",underscore:"/underscore/static-1.8","breeze-engine-lib":"/breeze-engine-lib/static-1.2128","magpie-lib":"/magpie-lib/static-1.5903","magpie-types":"/magpie-types/static-1.5363","simple-logging-lib":"/simple-logging-lib/static-1.3519",superstore:"/superstore/static-1.5225","nudge-client-utils":"/nudge-client-utils/static-1.3406","poll-commands":"/poll-commands/static-1.3944","ui-addon-iframeable":"/ui-addon-iframeable/static-1.9542","video-components-external":"/video-components-external/static-1.12415","unified-auth-core-lib":"/unified-auth-core-lib/static-1.1511","social-insights-client-types":"/social-insights-client-types/static-1.22913",SharedI18nStrings:"/SharedI18nStrings/static-1.187",outpost:"/outpost/static-1.4597","amplitude-session-replay-browser":"/amplitude-session-replay-browser/static-1.60","markdown-it":"/markdown-it/static-1.6",atom:"/atom/static-1.5542","avatar-components":"/avatar-components/static-1.2954","reference-resolvers":"/reference-resolvers/static-1.8648","ui-addon-video-player":"/ui-addon-video-player/static-1.9092","ui-coaching-tips":"/ui-coaching-tips/static-1.29575","flux-actions":"/flux-actions/static-1.380","frontend-preferences-client":"/frontend-preferences-client/static-1.8388","integrations-error-boundary-lib":"/integrations-error-boundary-lib/static-1.14829","integrations-tracking-lib":"/integrations-tracking-lib/static-1.6084","laboratory-lib":"/laboratory-lib/static-3.7616","native-integrations-shared-strings":"/native-integrations-shared-strings/static-1.8230","redux-observable":"/redux-observable/static-1.79",ReduxMessenger:"/ReduxMessenger/static-2.10837",rxjs:"/rxjs/static-5.10","ui-addon-i18n":"/ui-addon-i18n/static-1.11614","ui-shepherd-react":"/ui-shepherd-react/static-3.10744",ably:"/ably/static-2.2","batch-promise":"/batch-promise/static-1.2014","breeze-engine-chat-components":"/breeze-engine-chat-components/static-1.1106","highlight.js":"/highlight.js/static-1.90",pulse:"/pulse/static-1.1113","idb-keyval":"/idb-keyval/static-1.55","reactive-lib":"/reactive-lib/static-1.1190","nudge-custom-function-registry":"/nudge-custom-function-registry/static-1.3163","nudge-renderer-utils":"/nudge-renderer-utils/static-1.3482","onboarding-tours":"/onboarding-tours/static-1.17388","whisper-core-api":"/whisper-core-api/static-1.7621","navigation-messaging":"/navigation-messaging/static-1.8477","content-media-composition-data-lib":"/content-media-composition-data-lib/static-1.13577","content-media-compositions":"/content-media-compositions/static-2.17584","media-bridge-lib":"/media-bridge-lib/static-1.19627",fsm:"/fsm/static-1.4226","trellis-migration-context":"/trellis-migration-context/static-1.46","growth-onboarding-feedback-components":"/growth-onboarding-feedback-components/static-1.7050","universal-page-editor-lib":"/universal-page-editor-lib/static-1.3476","foundations-components-test-utils":"/foundations-components-test-utils/static-1.6217","bend-plugin-pulse":"/bend-plugin-pulse/static-1.616","event-emitter":"/event-emitter/static-1.1430","fast-json-patch":"/fast-json-patch/static-1.74","getting-started-shared-tasks":"/getting-started-shared-tasks/static-1.19547","growth-data-modal":"/growth-data-modal/static-1.6122","growth-onboarding-confetti":"/growth-onboarding-confetti/static-1.3528","growth-onboarding-next-action-utils":"/growth-onboarding-next-action-utils/static-1.2968","navigation-components":"/navigation-components/static-1.19150",nest:"/nest/static-1.703","onboarding-tours-client":"/onboarding-tours-client/static-1.5603","onboarding-tours-utils":"/onboarding-tours-utils/static-1.1455","ui-shepherd-tracker":"/ui-shepherd-tracker/static-1.8125","user-context":"/user-context/static-1.5521","nav-meta":"/nav-meta/static-1.30787","js-cookie":"/js-cookie/static-1.18","crm-record-cards-service-types":"/crm-record-cards-service-types/static-1.3869","framework-data-schema-resolvers":"/framework-data-schema-resolvers/static-1.7360","location-customization-utils-lib":"/location-customization-utils-lib/static-1.10400","onboarding-data-sync-lib":"/onboarding-data-sync-lib/static-1.2829","growth-onboarding-next-action-components":"/growth-onboarding-next-action-components/static-1.2996","user-context-client":"/user-context-client/static-1.4978","getting-started-shared-tasks-store":"/getting-started-shared-tasks-store/static-1.18665","conditional-properties-service-client":"/conditional-properties-service-client/static-1.4109","crm-pipelines-api-client-types":"/crm-pipelines-api-client-types/static-1.4440","fdsr-migration-layer":"/fdsr-migration-layer/static-1.479","framework-builder-read-service-client":"/framework-builder-read-service-client/static-1.4331","framework-data-schema-quick-fetch":"/framework-data-schema-quick-fetch/static-1.7265","inbound-db-meta-service-client":"/inbound-db-meta-service-client/static-1.3772","multi-currency-client-types":"/multi-currency-client-types/static-1.4004","persist-promise":"/persist-promise/static-1.4171",InboxConnectUtils:"/InboxConnectUtils/static-4.15828","meetings-connect-utils-lib":"/meetings-connect-utils-lib/static-1.8085","onboarding-scopes":"/onboarding-scopes/static-1.6920","hub-http-contrib":"/hub-http-contrib/static-1.3498","ui-addon-sales-email":"/ui-addon-sales-email/static-1.5670"},bundlingPackage:"conversations-embed",bundlingPackageVersion:"static-1.28672",project:"conversations-embed",staticDomain:"//static.hsappstatic.net",staticDomainPrefix:"//static.hsappstatic.net"}};function vn(){return new URL(window.location.href).searchParams.get("chatflow")||""}function wn({messagesEnv:t,portalId:e,messagesUtk:i,messagesHublet:s}){const n=Jt(window.location.pathname);return`${fn("api",{envOverride:t,hubletOverride:s})}/livechat/v1/message/public/hubspot-app?portalId=${n}&mobile=${o()}&embeddedPortalId=${e}&traceId=${i}`}function yn({messagesUtk:t,hubspotUtk:e,portalId:i,referrer:s,hstc:n,hssc:a,email:r,identificationToken:c}){let l=`?portalId=${i}&${bn.bender.project}=${bn.bender.depVersions[bn.bender.project]}&mobile=${o()}`;t&&(l=`${l}&messagesUtk=${t}&traceId=${t}`);e&&(l=`${l}&hubspotUtk=${e}`);n&&(l=`${l}&__hstc=${n}`);a&&(l=`${l}&__hssc=${a}`);s&&(l=`${l}&referrer=${s}`);c&&(l=`${l}&identificationToken=${c}`);r&&(l=`${l}&email=${r}`);return l}function En({messagesUtk:t,hubspotUtk:e,portalId:i,referrer:s,hstc:n,hssc:a,email:o,identificationToken:r}){return`/_hcms/livechat/widget${yn({messagesUtk:t,hubspotUtk:e,portalId:i,referrer:s,hstc:n,hssc:a,email:o,identificationToken:r})}`}function In({messagesHublet:t,messagesEnv:e,messagesUtk:i,hubspotUtk:s,portalId:n,referrer:a,hstc:o,hssc:r,email:c,identificationToken:l}){return`${fn("api",{envOverride:e,hubletOverride:t})}/livechat-public/v1/message/public${yn({messagesUtk:i,hubspotUtk:s,portalId:n,referrer:a,hstc:o,hssc:r,email:c,identificationToken:l})}`}function xn({messagesHublet:t,messagesEnv:e,messagesUtk:i,hubspotUtk:s,portalId:n,referrer:a,hstc:o,hssc:r,email:c,identificationToken:l}){return`${fn("api",{envOverride:e,hubletOverride:t})}/livechat-public/v1/message/public/mobile${yn({messagesUtk:i,hubspotUtk:s,portalId:n,referrer:a,hstc:o,hssc:r,email:c,identificationToken:l})}&chatflow=${vn()}`}const Sn=t=>Object.keys(t).map((e=>[e,`${t[e]}`])),kn=t=>new URLSearchParams(Sn(t)).toString(),Tn=()=>{var t;return!(null===(t=document.querySelector('meta[name="x-hs-portals-instance-id"]'))||void 0===t||!t.getAttribute("content"))},On=({portalId:t})=>`/hs/scriptloader/${t}.js`,Cn=({portalId:t})=>{const e=On({portalId:t});return`${document.location.origin}${e}`},_n=({env:t="",portalId:e})=>`${document.location.protocol}//js.hs-scripts${t}.com/${e}.js`;function Ln({portalId:t,messagesEnv:e}){try{const i="qa"===e?"qa":"",s=_n({env:i,portalId:t}),n=On({portalId:t}),a=Cn({portalId:t}),o=`https://js.usemessages${i}.com/conversations-embed.js`,r=performance.getEntries().map((({name:t})=>t)),c=r.find((t=>t.includes(s)))||s,l=r.find((t=>t.includes(a)))||a,d=Boolean(document.querySelector(`script[src^="${n}"]`));performance.measure(Ui,_i,Li);performance.measure(Ri,Mi,Di);const h=performance.getEntriesByName(Ui)[0],u=performance.getEntriesByName(Ri)[0],p=h.duration+u.duration,g=performance.getEntriesByName(c)[0],m=performance.getEntriesByName(l)[0],f=(d?m:g).duration,b=performance.getEntriesByName(o)[0].duration;if(p&&f&&b)return{iframeLoadTime:p,scriptLoaderScriptTime:f,embedScriptTime:b}}catch(t){}return null}const Mn=/Hub[sS]pot ?Mobile ?SDK/,Dn=/\/(\d+\.\d+\.\d+)/,Rn=(new RegExp(Mn.source+Dn.source),()=>Mn.test(window.navigator.userAgent));class Un{constructor(t){const{globalCookieOptOut:e,hubspotUtk:i,hstc:s,hssc:n,iFrameDomainOverride:a,iframeUuid:o,isFirstVisitorSession:r,messagesEnv:c,messagesUtk:l,referrer:d,portalId:h,useLocalBuild:u,identificationEmail:p,identificationToken:g,messagesHublet:m}=t;dt(o,"iframeUuid");dt(c,"messagesEnv");dt(l,"messagesUtk");Gs(h,"portalId");this.globalCookieOptOut=e;this.hubspotUtk=i;this.hstc=s;this.hssc=n;this.iFrameDomainOverride=a;this.iframeUuid=o;this.isFirstVisitorSession=r;this.messagesEnv=c;this.messagesUtk=l;this.referrer=d;this.portalId=h;this.useLocalBuild=u;this.identificationEmail=p;this.identificationToken=g;this.messagesHublet=m||Qs;this.getIFrameDomain=this.getIFrameDomain.bind(this);this.getIFrameSrc=this.getIFrameSrc.bind(this);this.getInitialRequestUrl=this.getInitialRequestUrl.bind(this)}getIFrameDomain(){return this.iFrameDomainOverride?this.iFrameDomainOverride:fn(this.useLocalBuild?"local":"app",{envOverride:this.messagesEnv,hubletOverride:this.messagesHublet})}getIFrameSrc(){const t=kn(Ei({messagesUtk:this.messagesUtk,hubspotUtk:this.hubspotUtk,portalId:this.portalId,iframeUuid:this.iframeUuid,globalCookieOptOut:this.globalCookieOptOut,isFirstVisitorSession:this.isFirstVisitorSession,hstc:this.hstc}));return`${this.getIFrameDomain()}/conversations-visitor/${this.portalId}/threads/utk/${this.messagesUtk}?${t}`}getEncodedIdentificationEmail(){let t=this.identificationEmail;t.includes("@")||(t=decodeURIComponent(t));return encodeURIComponent(t)}getInitialRequestUrl(t){if(t){this.identificationEmail=be();this.identificationToken=ve()}if(yi()||Tn())return En({messagesUtk:this.messagesUtk,hubspotUtk:this.hubspotUtk,portalId:this.portalId,referrer:this.referrer,hstc:this.hstc,hssc:this.hssc,email:this.identificationEmail&&this.getEncodedIdentificationEmail(),identificationToken:this.identificationToken});if(Vt({portalId:this.portalId}))return wn({messagesHublet:this.messagesHublet,messagesEnv:this.messagesEnv,messagesUtk:this.messagesUtk,portalId:this.portalId});return(Rn()?xn:In)({messagesHublet:this.messagesHublet,messagesEnv:this.messagesEnv,messagesUtk:this.messagesUtk,hubspotUtk:this.hubspotUtk,portalId:this.portalId,referrer:this.referrer,hstc:this.hstc,hssc:this.hssc,email:this.identificationEmail&&this.getEncodedIdentificationEmail(),identificationToken:this.identificationToken})}getPerfAttributes(){const t=Ln({portalId:this.portalId,messagesEnv:this.messagesEnv});if(de()&&t)return t}}var Pn=Un;function An(){var t;const{messagesEnv:e,portalId:i,messagesHublet:s}=Fs();let n=!1;try{n=localStorage&&"true"===localStorage["live-chat-local-toggle"]}catch(t){}const a=(null===(t=window)||void 0===t||null===(t=t.messagesConfig)||void 0===t?void 0:t.iFrameDomain)||"",o=Ds(),r=encodeURIComponent(document.referrer),{messagesUtk:c,hubspotUtk:l,hstc:d,hssc:h,globalCookieOptOut:u,isFirstVisitorSession:p}=Ws();return new Pn({messagesHublet:s,globalCookieOptOut:u,hubspotUtk:l,hstc:d,hssc:h,iFrameDomainOverride:a,iframeUuid:o,isFirstVisitorSession:p,messagesEnv:e,messagesUtk:c,referrer:r,portalId:i,useLocalBuild:n,identificationEmail:be(),identificationToken:ve()})}function qn(){function t(){}try{t.toString=function(){};return!0}catch(t){return!1}}function Hn(t){return["function"==typeof t.WeakMap,"function"==typeof t.requestAnimationFrame,"function"==typeof t.URLSearchParams,"function"==typeof Object.fromEntries,qn()].every((t=>t))}const $n="?";function Wn(){return"undefined"==typeof document||null==document.location?"":document.location.href}function Nn(){return"undefined"==typeof document||null==document.location?"":document.location.origin?document.location.origin:`${document.location.protocol}//${document.location.hostname}${document.location.port?`:${document.location.port}`:""}`}function zn(t){if(void 0===t.stack||!t.stack)return null;const e=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|native|eval|webpack||[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,i=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx(?:-web)|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,s=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,n=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,a=/\((\S*)(?::(\d+))(?::(\d+))\)/,o=t.stack.split("\n"),r=[];let c,l,d;for(let h=0,u=o.length;h eval")>-1&&(c=n.exec(l[3]))){l[3]=c[1];l[4]=c[2];l[5]=null}else 0!==h||l[5]||void 0===t.columnNumber||(r[0].column=t.columnNumber+1);d={filename:l[3],function:l[1]||$n,args:l[2]?l[2].split(","):[],lineno:l[4]?+l[4]:null,colno:l[5]?+l[5]:null}}!d.function&&d.line&&(d.function=$n);if(d.filename&&"blob:"===d.filename.substr(0,5)){const t=new XMLHttpRequest;t.open("GET",d.filename,!1);t.send(null);if(200===t.status){let e=t.responseText||"";e=e.slice(-300);const i=e.match(/\/\/# sourceMappingURL=(.*)$/);if(i){let t=i[1];"~"===t.charAt(0)&&(t=Nn()+t.slice(1));d.url=t.slice(0,-4)}}}r.push(d)}return r.length?{name:t.name,message:t.message,url:Wn(),stack:r}:null}function Bn(t,e,i){const s={filename:e,lineno:i};if(s.filename&&s.lineno){t.incomplete=!1;s.function||(s.function=$n);if(t.stack.length>0&&t.stack[0].filename===s.filename){if(t.stack[0].lineno===s.lineno)return!1;if(!t.stack[0].lineno&&t.stack[0].function===s.function){t.stack[0].lineno=s.lineno;return!1}}t.stack.unshift(s);t.partial=!0;return!0}t.incomplete=!0;return!1}function jn(t,e){const i=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,s=[],n={};let a,o,r=!1;for(let t=jn.caller;t&&!r;t=t.caller)if(t!==Fn){o={filename:null,function:$n,lineno:null,colno:null};t.name?o.function=t.name:(a=i.exec(t.toString()))&&(o.function=a[1]);if(void 0===o.function)try{o.function=a.input.substring(0,a.input.indexOf("{"))}catch(t){}n[`${t}`]?r=!0:n[`${t}`]=!0;s.push(o)}e&&s.splice(0,e);const c={name:t.name,message:t.message,filename:Wn(),stack:s};Bn(c,t.sourceURL||t.fileName,t.line||t.lineNumber,t.message||t.description);return c}function Fn(t,e){let i=null;e=null==e?0:+e;try{i=zn(t);if(i)return i}catch(t){}try{i=jn(t,e+1);if(i)return i}catch(t){}return{name:t.name,message:t.message,filename:Wn()}}const Gn="7ab6425e7a7c4b01b71fdb51e76514bf",Vn=4;function Kn(){return Date.now()/1e3}function Jn(){const t=window.crypto||window.msCrypto;if(void 0!==typeof t&&t.getRandomValues){const e=new Uint16Array(8);t.getRandomValues(e);e[3]=4095&e[3]|16384;e[4]=16383&e[4]|32768;const i=function(t){let e=t.toString(16);for(;e.length<4;)e=`0${e}`;return e};return i(e[0])+i(e[1])+i(e[2])+i(e[3])+i(e[4])+i(e[5])+i(e[6])+i(e[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}function Xn(t,e){const i=new XMLHttpRequest;i.addEventListener("readystatechange",(()=>{i.readyState===Vn&&i.status>=300&&console.warn("Failed logging HSConversations error")}));i.open("POST",t);i.setRequestHeader("Content-Type","text/plain;charset=UTF-8");i.send(JSON.stringify(e))}class Yn{constructor(){const t=zs(),e=Bs();this.config={environment:t,tags:{portalId:Ns(),env:t,project:"conversations-embed"},logger:"javascript",platform:"javascript",request:{headers:{"User-Agent":navigator.userAgent},url:window.location.href}};const i=null==e||e===Qs?"":`-${e}`,s=null==t||"prod"===t?"":"qa",n=`sentry_version=7&sentry_client=raven-js%2F3.19.1&sentry_key=${Gn}`;this.sentryUrl=`https://exceptions${i}.hubspot${s}.com/v2/api/store/?${n}`;this.logError=this.logError.bind(this)}logError(t){const e=Kn();Xn(this.sentryUrl,Object.assign({},this.config,{event_id:Jn(),transaction:"conversations embed error",level:"error",exception:{values:[{mechanism:{handled:!0,type:"generic"},type:t,value:t}]},timestamp:e}))}captureErrors(t){try{t()}catch(t){const e=Kn();if(t instanceof Error&&"Aborting: redirection in progress"!==t.message){const i=Fn(t);Xn(this.sentryUrl,Object.assign({},this.config,{event_id:Jn(),transaction:i.stack[0].filename,level:"error",exception:{values:[{mechanism:{handled:!0,type:"generic"},type:i.name,value:i.message,stacktrace:{frames:i.stack.reverse()}}]},timestamp:e}))}throw t}}}const Zn=()=>{console.warn(`loadImmediately is set to false and widget.load() has not been called on window.${te} yet. Please call widget.load() first or set loadImmediately on window.${ie} to true.`)};function Qn({eventEmitter:t,logError:e}){const i=An(),s=new Ts(i,e,t);if(window.hubspot_live_messages_running)console.warn("duplicate instance of live chat exists on page");else{window.hubspot_live_messages_running=!0;s.start()}return s}function ta(t){_s(document);if(le().loadImmediately)Qn({logError:t});else{const e=new si,i=new Re;Le({debug:Zn,on:e.on,off:e.off,clear:Zn,resetAndReloadWidget:Zn,widget:{load:i=>{Qn({eventEmitter:e,logError:t}).loadWidget(i)},remove:Zn,open:Zn,close:Zn,refresh:Zn,status:()=>({loaded:!1,pending:!1}),setInputText:Zn,updateEntryUrlMetadata:Zn,openToKnowledgeBase:Zn,openToCategory:Zn}});Me({logger:i})}}function ea(){if(Hn(window)){if(!new RegExp("^/_hcms/(livechat/embedded-content|customer-agent-embed)$","i").test(window.location.pathname)){const t=new Yn;js()?ta():t.captureErrors((()=>{ta(t)}))}}}hs();const ia=()=>{ea();document.removeEventListener("DOMContentLoaded",ia)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",ia):ea()}()}(); //# sourceMappingURL=//static.hsappstatic.net/conversations-embed/static-1.28672/bundles/project.js.map