import{p as e,F as t,G as n,H as r,h as o,I as i,E as a,f as s,J as l,L as u,K as c,u as d,N as p,O as f,P as h,Q as m,T as g,U as v,V as y,W as b,X as w,Y as S,Z as k,_ as x,$ as C,a0 as E,a1 as I,a2 as T,l as _,a3 as F,a4 as P,a5 as z,a6 as R,a7 as M,a8 as A,a9 as O,aa as D,ab as V,ac as B,t as L,ad as N,ae as $,o as j,q,r as W,af as H,ag as U,j as G,ah as Z,ai as J,aj as X,ak as Y,al as Q,am as K,an as ee,ao as te,ap as ne,aq as re,ar as oe,as as ie,at as ae,au as se,av as le,aw as ue,ax as ce,ay as de,az as pe,aA as fe,aB as he,aC as me,aD as ge,aE as ve,aF as ye,a as be,aG as we,aH as Se,aI as ke,aJ as xe,aK as Ce,aL as Ee,aM as Ie}from"./0.CA-0OlvF.chunk.js";import{b as Te,i as _e,f as Fe,c as Pe,d as ze,s as Re,h as Me,a as Ae,j as Oe,k as De,n as Ve}from"./7.DaJJFJ3Z.chunk.js";import{d as Be,n as Le,a as Ne,g as $e,r as je,c as qe}from"./3.CJvEkDRx.chunk.js";import{l as We,n as He,o as Ue,f as Ge,t as Ze,h as Je,c as Xe}from"./2.pu7iWzia.chunk.js";import{i as Ye}from"./9.DNzTqRPk.chunk.js";import{f as Qe,a as Ke,b as et,r as tt,c as nt,e as rt,h as ot,i as it,j as at,g as st,k as lt}from"./16.Mn4CHqb3.chunk.js";import{r as ut}from"./10.BORa1An7.chunk.js";import{d as ct}from"./8.al-9NYxR.chunk.js";import{i as dt,m as pt,a as ft,C as ht}from"./11.DYv5DkRF.chunk.js";function mt(e,t){return e+t}function gt(e,t){return function(t,n){if(0===t){var r=0,o=setTimeout(function(){n(1,r++),n(2)},e instanceof Date?e-Date.now():e);n(0,function(e){2===e&&clearTimeout(o)})}}}const vt="https://accounts.livechatinc.com",yt=e=>{let{code:t,message:n}=e;const r=new Error(n);return r.code=t,r},bt=(e,t)=>d(`${((e,t)=>`${"production"===t?vt:vt.replace("accounts.",`accounts.${t}.`)}${(e=>{let{uniqueGroups:t,organizationId:n,groupId:r}=e;return t?`/v2/customer/${n}/${r}/token`:"/v2/customer/token"})(e)}`)(e,t)}`,{method:"POST",credentials:"include",body:JSON.stringify({response_type:"token",grant_type:"cookie",client_id:e.clientId,organization_id:e.organizationId,redirect_uri:Te(String(window.location))+window.location.pathname})}).then(e=>e.json()).then(t=>((e,t)=>{if("identity_exception"in e)throw yt({code:"SSO_IDENTITY_EXCEPTION",message:e.identity_exception});if("oauth_exception"in e)throw yt({code:"SSO_OAUTH_EXCEPTION",message:e.oauth_exception});return{accessToken:e.access_token,entityId:e.entity_id,expiresIn:1e3*e.expires_in,tokenType:e.token_type,creationDate:Date.now(),organizationId:t}})(t,e.organizationId)),wt=e=>{let{organizationId:t,clientId:n}=e;if("string"!=typeof t||"string"!=typeof n)throw new Error("You need to pass valid configuration object: { organizationId, clientId }.")},St=(e,t)=>{wt(e);const n=e.env,r=n&&["labs","staging"].includes(n)?n:"production",o=p(t),i=`${e.tokenStoragePrefix||"@@lc_auth_token:"}${e.organizationId}`+(e.uniqueGroups?`:${e.groupId}`:"");let a=null,s=null,l=o.getItem(i).then(e=>{null!==l&&(l=null,e&&(s=JSON.parse(e)))});const u=()=>(a=bt(e,r).then(e=>(a=null,o.setItem(i,JSON.stringify(e)),s=e,e),e=>{throw a=null,e}),a),c=()=>a||(s&&!(e=>{let{creationDate:t,expiresIn:n}=e;return Date.now()>=t+n})(s)?Promise.resolve(s):l?l.then(c):u()),d=()=>l?l.then(d):Promise.resolve(!!s);return{getFreshToken:u,getToken:c,hasToken:d,invalidate:()=>(s=null,l=null,o.removeItem(i))}},kt=e=>k(e).some(e=>{if("form"!==e.type)return!1;const{fields:t}=e.properties;return t.some(e=>"group_chooser"===e.type)}),xt=n=>{const r=e(s(n,e=>f(e,"maximized")),c(1),Ge(Boolean));e(r,Ze(1),Ge(()=>!Math.floor(1e3*Math.random())),Je(()=>(e=>{h({isMessagingModeEnabled:v(e),isCustomerInvited:g(e),groupAvailability:e.getApplicationState().availability,minimizedType:m(e)})})(n))),e((n=>e(i(n,a),t(()=>e(s(n,e=>l(e,u).active),c(1),Ge(Boolean)))))(n),Je(()=>(e=>{const{s:t,embedded:n,testGroup:r,actingAsDirectLink:o,config:i,language:a,integrationName:s,clientChatNumber:l,clientVisitNumber:c,wrapperVersion:d}=e.getApplicationState(),p=i&&i.theme&&i.theme.name,f=y()||"none",h=b(),v=w(e),T=!!S(e,u),_=!!e.getSessionUser().email,F=g(e)?"invitation":"other",P=m(e),z=k(e),R=z.find(e=>!!e.properties.invitation),M=x(z.filter(e=>"message"===e.type||"message_draft"===e.type)),A=z.filter(e=>"file"===e.properties.serverType).length,O=C(e),D=E(e);I({s:t,embedded:n,themeName:p,testGroup:r,uniqueGroups:h,minimizedType:P,language:a||"unknown",integrationName:s||"none",mobileBridgeType:f,chatHistoryEnabled:v,hasPreviousChatThreads:T,hasGroupChooser:String(kt(e)),hasBeenImmediatelyQueued:String(e.getChat(u).properties.queued),isCustomerEmailSet:_,actingAsDirectLink:o,chatWidgetWidth:window.innerWidth,chatWidgetHeight:window.innerHeight,clientChatNumber:l+1,clientVisitNumber:c,chatSource:F,fromGreeting:!!Ke(!1,"properties.fromGreeting",M),homescreenEnabled:O,isTextAppEnabled:D,startingFileCount:A,..."android"===f&&d&&{wrapper_version:d},..."invitation"===F&&R&&{greetingId:R.properties.id,greetingUniqueId:R.properties.uniqueId,greetingType:R.properties.type,greetingSubtype:R.properties.subtype,greetingAddon:R.properties.addon||"none"}})})(n)))};window.performance&&"function"==typeof window.performance.mark&&window.performance.mark("lc_js_loaded");const Ct=e=>new Promise(t=>{const n=performance.getEntriesByName(e);if(!_e(n))return void t(n[0]);if("undefined"==typeof PerformanceObserver)return void t(null);const r=setTimeout(()=>{o.disconnect(),t(null)},6e4),o=new PerformanceObserver(n=>{const i=Fe(t=>t.name===e,n.getEntries());i&&(o.disconnect(),clearTimeout(r),t(i))});o.observe({entryTypes:["paint"]})}),Et=()=>{const e=`lc_get_time_${Pe()}`;window.performance&&"function"==typeof window.performance.mark&&window.performance.mark(e);const[{startTime:t}]=performance.getEntriesByName(e);return performance.clearMarks(e),t},It=()=>{if("undefined"==typeof PerformanceObserver)return null;const e=Et(),t=[],n=new PerformanceObserver(e=>{t.push.apply(t,e.getEntries())});n.observe({entryTypes:["longtask"]});const r=()=>{const n=x(t);return n?(r=n,Et()-r.startTime+r.duration):Et()-e;var r};return{disconnect:()=>n.disconnect(),getLongTasks:()=>[].concat(t),waitForIdle:e=>new Promise(o=>{const i=()=>{t.push.apply(t,n.takeRecords());const a=r();a>=e?o():setTimeout(i,Math.ceil(e-a))};i()})}},Tt="first-paint",_t=(e,t)=>{if(!e||!t)return null;const n=x(e);return n?Math.max(n.startTime+n.duration,t.startTime):t.startTime},Ft=()=>{if(Math.floor(1e3*Math.random()))return;const e=function(e){const t=It();return t?Ct(e).then(e=>e?t.waitForIdle(5e3).then(()=>(t.disconnect(),t.getLongTasks())):null):Promise.resolve(null)}(Tt);return{getLogs:()=>Promise.all([e,Ct(Tt)]).then(e=>{let[t,n]=e;return T(e=>{return e&&(t=2,Number(e.toFixed(t)));var t},{totalBlockingTime:t&&(r=t.map(e=>e.duration),r.reduce(mt,0)),firstContentfulPaint:null==n?void 0:n.startTime,timeToInteractive:_t(t,n)});var r})}},Pt=new RegExp(`(${["BetterJsPop","LOCAL_STORAGE is null","Can't find variable: auto","Can't find variable: ext","Can't find variable: $","_avast_submit","No license or organization found in the URL.","getNewsReadStatus4Vivo","is banned!","Object Not Found Matching Id"].join("|")})`),zt=new RegExp(`(${["chrome-extension://","https://www.smybeds.com/"].join("|")})`),Rt=["CONNECTION_LOST"],Mt=e=>{if(e.code&&Rt.includes(e.code))return!0;if(e.message&&Pt.test(e.message)||e.stack&&zt.test(e.stack))return!0;try{const t=JSON.stringify(e);if(t&&Pt.test(t))return!0}catch(t){}return!1};window.addEventListener("error",e=>{let{error:t}=e;if(t&&!Mt(t)){if(t.message&&-1!==t.message.indexOf("Incorrect locale information provided")){const e=navigator.language||navigator.userLanguage||"en-US";return void _("onerror",t,{"navigator.language":navigator.language,"navigator.userLanguage":navigator.userLanguage,locale:e,err:(()=>{try{return new Intl.Locale(e),!1}catch(t){return!0}})()})}_("onerror",t)}}),window.addEventListener("unhandledrejection",e=>{e&&e.reason&&(Mt(e.reason)||_("unhandledrejection",e.reason))});const At=e=>{var t,n;const r=(null==(n=null==(t=e.entities)?void 0:t.chats)?void 0:n.byIds)||{};return Object.values(r).reduce((e,t)=>{var n,r;return e+((null==(r=null==(n=t.events)?void 0:n.orderedIds)?void 0:r.length)??0)},0)},Ot=t=>{e(s(t,At),Je(()=>{const e=(e=>{var t,n;const r=(null==(n=null==(t=e.getState().entities)?void 0:t.chats)?void 0:n.byIds)||{},o=[],i={};return Object.values(r).forEach(e=>{var t,n;const r=(null==(t=e.events)?void 0:t.orderedIds)||[],a=(null==(n=e.events)?void 0:n.byIds)||{};r.forEach(e=>{var t,n,r,s,l,u,c,d;const p=a[e];"image_preview"===(null==p?void 0:p.type)&&(o.push(p.id),i[p.id]={eventId:p.id,link:(null==(t=p.properties)?void 0:t.link)||(null==(n=p.properties)?void 0:n.url),url:null==(r=p.properties)?void 0:r.url,alt:null==(s=p.properties)?void 0:s.alternativeText,name:null==(l=p.properties)?void 0:l.name,srcSet:null==(u=p.properties)?void 0:u.srcSet,width:null==(c=p.properties)?void 0:c.width,height:null==(d=p.properties)?void 0:d.height})})}),{orderedEventIds:o,eventIdDataMap:i}})(t),n=t.getApplicationState("lightbox");t.setApplicationState({lightbox:{...n,images:e}})}))},Dt=(e,t,n)=>{try{const r=((e,t,n)=>`@@lc_tab_id:${e}${n?`:${t}`:""}`)(e,t,n),o=window.sessionStorage.getItem(r);if(o)return o;const i=Pe();return window.sessionStorage.setItem(r,i),i}catch{return null}},Vt=e=>e.some(dt),Bt=(i,a)=>{const s=e(function(){const e=Ue(()=>!!document.hasFocus&&document.hasFocus()),t=o(()=>!0)(We(window,"focus")),n=o(()=>!1)(We(window,"blur"));return He(e,t,n)}(),F);if(!a)return void e(s,Je(e=>{i.setApplicationState({pageFocused:e,applicationFocused:e})}));const l=(u=a,e(Be(()=>r(Promise.race([u.call("isFocused"),new Promise(e=>{return n="focus",r=e,void(t=u).on(n,function e(o){t.off(n,e),r(o)});var t,n,r})]))),t(t=>e(Qe(u,"focus"),n(t)))));var u;e(s,Je(e=>{i.setApplicationState({applicationFocused:e}),a.emit("focus",e)})),e(P(s,l),ct(50),o(Vt),z(),Je(e=>{i.setApplicationState({pageFocused:e})}))},Lt=/(?:^|[/\-_.?&=])(?:checkouts?|carts?|payments?|orders)(?:[/\-_.?&=]|$)/i,Nt=e=>Lt.test((e=>{try{const{pathname:t,search:n,hash:r}=new URL(e,window.location.origin);return`${t}${n}${r}`}catch{return e}})(e)),$t=t=>{if(!R())return;const n=e(s(t,e=>e.application.destroyed),Ge(Boolean),Ze(1));e(s(t,e=>{var t;return null==(t=e.application.page)?void 0:t.url}),o(e=>!!e&&Nt(e)),z(),M(n),Je(e=>{t.setApplicationState({minimizedInputUrlRestricted:e}),e&&(e=>{const{state:t,deferred:n}=e.getApplicationState("minimizedMessageInput");"hidden"===t&&n||A(e,{state:"hidden",deferred:!0},{render:"hidden"!==t})})(t)}))},jt="new_message",qt=e=>"function"==typeof e.start&&"function"==typeof e.stop,Wt=e=>{qt(e)?e.start(0):e.noteOn(0)},Ht=()=>{const e=new(window.AudioContext||window.webkitAudioContext);let t=!0,n=[];const r=t=>new Promise((n,r)=>{e.decodeAudioData(t,n,r)}),o=t=>({play:()=>{const n=e.createBufferSource();n.connect(e.destination),n.buffer=t;return{playback:new Promise((t,r)=>{if(n.onended=()=>t(),Wt(n),"running"!==e.state){const t=new Error(`Playback failed, AudioContext is in incorrect state '${e.state}'`);t.name="PlaybackError",r(t)}}),stop(){(e=>{qt(e)?e.stop(0):e.noteOff(0)})(n)}}}});return{preload:e=>(e=>new Promise((t,n)=>{const r=new XMLHttpRequest;r.onload=()=>{t(r.response)},r.onerror=n,r.open("GET",e),r.responseType="arraybuffer",r.send()}))(e).then(r).then(o),playSound:e=>{const r=e.play();return t&&n.push(r),r.playback},unlock:()=>new Promise(r=>{const o=()=>{document.removeEventListener("click",o,!0),t&&(n.forEach(e=>{e.stop()}),n=[],t=!1),e.resume(),(()=>{const t=e.createBuffer(1,1,22050),n=e.createBufferSource();n.buffer=t,n.connect(e.destination),Wt(n)})(),r()};document.addEventListener("click",o,!0)})}},Ut=/\.(\w+)$/i,Gt=new Audio,Zt={mp3:"audio/mpeg",ogg:"audio/ogg"},Jt=e=>{const t=(e=>{const t=e.match(Ut);return t?t[1].toLowerCase():""})(e);return t in Zt&&"function"==typeof Gt.canPlayType&&""!==Gt.canPlayType(Zt[t])},Xt=()=>"function"==typeof window.webkitAudioContext||"function"==typeof window.AudioContext,Yt=e=>new Promise((t,n)=>{const r=new Audio(e);r.onloadeddata=()=>{t(r)},r.onerror=n}),Qt=e=>{const t=e.play();return(n=t)&&"function"==typeof n.then?t:Promise.resolve();var n},Kt=()=>Xt()?(()=>{const e=Ht(),t=pt(t=>{const n=e.preload(t);return n.catch(Le),n});return{play:n=>{const r=t(n).then(e.playSound);return r.catch(Le),r},preload:t,unlock:()=>e.unlock()}})():(()=>{const e=pt(Yt);return{play:t=>e(t).then(Qt),preload:e,unlock:()=>Promise.resolve()}})(),en=e=>{const t=Kt(),n=(e=>Object.keys(e).reduce((t,n)=>{const r=Fe(e=>Jt(e),O(e[n]));return t[n]=r,t},{}))(e);return{play:e=>{const r=n[e];if(!r)return Promise.resolve();t.play(r).then(Le,Le)},preload:e=>{const r=n[e];if(!r)return Promise.resolve();t.preload(r).then(Le,Le)},unlock:()=>t.unlock()}},tn=()=>{const e=en({[jt]:["https://cdn.livechatinc.com/widget/static/media/new_message.CTorF0S8.ogg","https://cdn.livechatinc.com/widget/static/media/new_message.C32z5SiC.mp3"]});return ze&&(window.parent.soundPlayer=e),e.unlock().then(()=>function(e,t){let n=0;return function(){Date.now()-n>=e&&(n=Date.now(),t(...arguments))}}(2e3,t=>{e.play(t)}))},nn={isIframeActive:null,hasIframeUnlocked:!1};var rn,on={},an={};function sn(){if(rn)return an;rn=1;var e=Ne();function t(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n