@botfabrik/engine-webclient 4.77.1 → 4.77.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{index-yILb8Y1Q.css → index-BiNNifhB.css} +1 -1
- package/dist/client/assets/{index-CkfLuaWz.js → index-RyoFceI4.js} +2 -2
- package/dist/client/assets/index-RyoFceI4.js.map +1 -0
- package/dist/client/index.html +2 -2
- package/package.json +4 -4
- package/dist/client/assets/index-CkfLuaWz.js.map +0 -1
|
@@ -94,7 +94,7 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
|
|
|
94
94
|
`,{inline:E}));for(;typeof v[v.length-1]=="string"&&!v[v.length-1].trim();)v.pop();if(r.wrapper===null)return v;const w=r.wrapper||(E?"span":"div");let C;if(v.length>1||r.forceWrapper)C=v;else{if(v.length===1)return C=v[0],typeof C=="string"?i("span",{key:"outer"},C):C;C=null}return r.createElement(w,{key:"outer"},C)}function l(m,E){const v=E.match($w);return v?v.reduce(function(w,C){const O=C.indexOf("=");if(O!==-1){const N=function(L){return L.indexOf("-")!==-1&&L.match(sx)===null&&(L=L.replace(fx,function(G,q){return q.toUpperCase()})),L}(C.slice(0,O)).trim(),S=function(L){const G=L[0];return(G==='"'||G==="'")&&L.length>=2&&L[L.length-1]===G?L.slice(1,-1):L}(C.slice(O+1).trim()),k=Hm[N]||N;if(k==="ref")return w;const x=w[k]=function(L,G,q,fe){return G==="style"?q.split(/;\s?/).reduce(function(te,oe){const pe=oe.slice(0,oe.indexOf(":"));return te[pe.trim().replace(/(-[a-z])/g,ue=>ue[1].toUpperCase())]=oe.slice(pe.length+1).trim(),te},{}):G==="href"||G==="src"?fe(q,L,G):(q.match(ax)&&(q=q.slice(1,q.length-1)),q==="true"||q!=="false"&&q)}(m,N,S,r.sanitizer);typeof x=="string"&&(Nc.test(x)||Ac.test(x))&&(w[k]=s(x.trim()))}else C!=="style"&&(w[Hm[C]||C]=!0);return w},{}):null}r.overrides=r.overrides||{},r.sanitizer=r.sanitizer||jx,r.slugify=r.slugify||qi,r.namedCodesToUnicode=r.namedCodesToUnicode?yr({},Gm,r.namedCodesToUnicode):Gm,r.createElement=r.createElement||B.createElement;const u=[],d={},h={[se.blockQuote]:{match:Sn(nv),order:1,parse(m,E,v){const[,w,C]=m[0].replace(Ww,"").match(Xw);return{alert:w,children:E(C,v)}},render(m,E,v){const w={key:v.key};return m.alert&&(w.className="markdown-alert-"+r.slugify(m.alert.toLowerCase(),qi),m.children.unshift({attrs:{},children:[{type:se.text,text:m.alert}],noInnerParse:!0,type:se.htmlBlock,tag:"header"})),i("blockquote",w,E(m.children,v))}},[se.breakLine]:{match:Vi(Qw),order:1,parse:Du,render:(m,E,v)=>i("br",{key:v.key})},[se.breakThematic]:{match:Sn(Kw),order:1,parse:Du,render:(m,E,v)=>i("hr",{key:v.key})},[se.codeBlock]:{match:Sn(iv),order:0,parse:m=>({lang:void 0,text:m[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}),render:(m,E,v)=>i("pre",{key:v.key},i("code",yr({},m.attrs,{className:m.lang?`lang-${m.lang}`:""}),m.text))},[se.codeFenced]:{match:Sn(rv),order:0,parse:m=>({attrs:l("code",m[3]||""),lang:m[2]||void 0,text:m[4],type:se.codeBlock})},[se.codeInline]:{match:Qn(Yw),order:3,parse:m=>({text:m[2]}),render:(m,E,v)=>i("code",{key:v.key},m.text)},[se.footnote]:{match:Sn(ex),order:0,parse:m=>(u.push({footnote:m[2],identifier:m[1]}),{}),render:Mu},[se.footnoteReference]:{match:Xn(tx),order:1,parse:m=>({target:`#${r.slugify(m[1],qi)}`,text:m[1]}),render:(m,E,v)=>i("a",{key:v.key,href:r.sanitizer(m.target,"a","href")},i("sup",{key:v.key},m.text))},[se.gfmTask]:{match:Xn(ix),order:1,parse:m=>({completed:m[1].toLowerCase()==="x"}),render:(m,E,v)=>i("input",{checked:m.completed,key:v.key,readOnly:!0,type:"checkbox"})},[se.heading]:{match:Sn(r.enforceAtxHeadings?sv:ov),order:1,parse:(m,E,v)=>({children:Hs(E,m[2],v),id:r.slugify(m[2],qi),level:m[1].length}),render:(m,E,v)=>i(`h${m.level}`,{id:m.id,key:v.key},E(m.children,v))},[se.headingSetext]:{match:Sn(av),order:0,parse:(m,E,v)=>({children:Hs(E,m[1],v),level:m[2]==="="?1:2,type:se.heading})},[se.htmlBlock]:{match:Vi(Nc),order:1,parse(m,E,v){const[,w]=m[3].match(Rx),C=new RegExp(`^${w}`,"gm"),O=m[3].replace(C,""),N=(S=O,Mx.some(q=>q.test(S))?Ux:Hs);var S;const k=m[1].toLowerCase(),x=Gw.indexOf(k)!==-1,L=(x?k:m[1]).trim(),G={attrs:l(L,m[2]),noInnerParse:x,tag:L};return v.inAnchor=v.inAnchor||k==="a",x?G.text=m[3]:G.children=N(E,O,v),v.inAnchor=!1,G},render:(m,E,v)=>i(m.tag,yr({key:v.key},m.attrs),m.text||(m.children?E(m.children,v):""))},[se.htmlSelfClosing]:{match:Vi(Ac),order:1,parse(m){const E=m[1].trim();return{attrs:l(E,m[2]||""),tag:E}},render:(m,E,v)=>i(m.tag,yr({},m.attrs,{key:v.key}))},[se.htmlComment]:{match:Vi(lv),order:1,parse:()=>({}),render:Mu},[se.image]:{match:Qn(Dx),order:1,parse:m=>({alt:m[1],target:Xm(m[2]),title:m[3]}),render:(m,E,v)=>i("img",{key:v.key,alt:m.alt||void 0,title:m.title||void 0,src:r.sanitizer(m.target,"img","src")})},[se.link]:{match:Xn(Ix),order:3,parse:(m,E,v)=>({children:zx(E,m[1],v),target:Xm(m[2]),title:m[3]}),render:(m,E,v)=>i("a",{key:v.key,href:r.sanitizer(m.target,"a","href"),title:m.title},E(m.children,v))},[se.linkAngleBraceStyleDetector]:{match:Xn(cx),order:0,parse:m=>({children:[{text:m[1],type:se.text}],target:m[1],type:se.link})},[se.linkBareUrlDetector]:{match:(m,E)=>E.inAnchor||r.disableAutoLink?null:Xn(lx)(m,E),order:0,parse:m=>({children:[{text:m[1],type:se.text}],target:m[1],title:void 0,type:se.link})},[se.linkMailtoDetector]:{match:Xn(ux),order:0,parse(m){let E=m[1],v=m[1];return qw.test(v)||(v="mailto:"+v),{children:[{text:E.replace("mailto:",""),type:se.text}],target:v,type:se.link}}},[se.orderedList]:qm(i,1),[se.unorderedList]:qm(i,2),[se.newlineCoalescer]:{match:Sn(Zw),order:3,parse:Du,render:()=>`
|
|
95
95
|
`},[se.paragraph]:{match:Bx,order:3,parse:Iu,render:(m,E,v)=>i("p",{key:v.key},E(m.children,v))},[se.ref]:{match:Xn(dx),order:0,parse:m=>(d[m[1]]={target:m[2],title:m[4]},{}),render:Mu},[se.refImage]:{match:Qn(hx),order:0,parse:m=>({alt:m[1]||void 0,ref:m[2]}),render:(m,E,v)=>d[m.ref]?i("img",{key:v.key,alt:m.alt,src:r.sanitizer(d[m.ref].target,"img","src"),title:d[m.ref].title}):null},[se.refLink]:{match:Xn(px),order:0,parse:(m,E,v)=>({children:E(m[1],v),fallbackChildren:m[0],ref:m[2]}),render:(m,E,v)=>d[m.ref]?i("a",{key:v.key,href:r.sanitizer(d[m.ref].target,"a","href"),title:d[m.ref].title},E(m.children,v)):i("span",{key:v.key},m.fallbackChildren)},[se.table]:{match:Sn(uv),order:1,parse:Lx,render(m,E,v){const w=m;return i("table",{key:v.key},i("thead",null,i("tr",null,w.header.map(function(C,O){return i("th",{key:O,style:Wm(w,O)},E(C,v))}))),i("tbody",null,w.cells.map(function(C,O){return i("tr",{key:O},C.map(function(N,S){return i("td",{key:S,style:Wm(w,S)},E(N,v))}))})))}},[se.text]:{match:Vi(Cx),order:4,parse:m=>({text:m[0].replace(ox,(E,v)=>r.namedCodesToUnicode[v]?r.namedCodesToUnicode[v]:E)}),render:m=>m.text},[se.textBolded]:{match:Qn(Sx),order:2,parse:(m,E,v)=>({children:E(m[2],v)}),render:(m,E,v)=>i("strong",{key:v.key},E(m.children,v))},[se.textEmphasized]:{match:Qn(bx),order:3,parse:(m,E,v)=>({children:E(m[2],v)}),render:(m,E,v)=>i("em",{key:v.key},E(m.children,v))},[se.textEscaped]:{match:Qn(Tx),order:1,parse:m=>({text:m[1],type:se.text})},[se.textMarked]:{match:Qn(wx),order:3,parse:Iu,render:(m,E,v)=>i("mark",{key:v.key},E(m.children,v))},[se.textStrikethroughed]:{match:Qn(xx),order:3,parse:Iu,render:(m,E,v)=>i("del",{key:v.key},E(m.children,v))}};r.disableParsingRawHTML===!0&&(delete h[se.htmlBlock],delete h[se.htmlSelfClosing]);const p=function(m){let E=Object.keys(m);function v(w,C){let O=[];for(C.prevCapture=C.prevCapture||"";w;){let N=0;for(;N<E.length;){const S=E[N],k=m[S],x=k.match(w,C);if(x){const L=x[0];C.prevCapture+=L,w=w.substring(L.length);const G=k.parse(x,v,C);G.type==null&&(G.type=S),O.push(G);break}N++}}return C.prevCapture="",O}return E.sort(function(w,C){let O=m[w].order,N=m[C].order;return O!==N?O-N:w<C?-1:1}),function(w,C){return v(function(O){return O.replace(Jw,`
|
|
96
96
|
`).replace(nx,"").replace(gx," ")}(w),C)}}(h),_=(y=function(m,E){return function(v,w,C){const O=m[v.type].render;return E?E(()=>O(v,w,C),v,w,C):O(v,w,C)}}(h,r.renderRule),function m(E,v={}){if(Array.isArray(E)){const w=v.key,C=[];let O=!1;for(let N=0;N<E.length;N++){v.key=N;const S=m(E[N],v),k=typeof S=="string";k&&O?C[C.length-1]+=S:S!==null&&C.push(S),O=k}return v.key=w,C}return y(E,m,v)});var y;const b=s(e);return u.length?i("div",null,b,i("footer",{key:"footer"},u.map(function(m){return i("div",{id:r.slugify(m.identifier,qi),key:m.identifier},m.identifier,_(p(m.footnote,{inline:!0})))}))):b}const Yn=e=>{let{children:r="",options:i}=e,s=function(l,u){if(l==null)return{};var d,h,p={},_=Object.keys(l);for(h=0;h<_.length;h++)u.indexOf(d=_[h])>=0||(p[d]=l[d]);return p}(e,Hw);return B.cloneElement(Gx(r,i),s)};var Sv={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Qm=xn.createContext&&xn.createContext(Sv),$x=["attr","size","title"];function qx(e,r){if(e==null)return{};var i=Vx(e,r),s,l;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(l=0;l<u.length;l++)s=u[l],!(r.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(i[s]=e[s])}return i}function Vx(e,r){if(e==null)return{};var i={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(r.indexOf(s)>=0)continue;i[s]=e[s]}return i}function Zs(){return Zs=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},Zs.apply(this,arguments)}function Km(e,r){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),i.push.apply(i,s)}return i}function Js(e){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};r%2?Km(Object(i),!0).forEach(function(s){Wx(e,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Km(Object(i)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(i,s))})}return e}function Wx(e,r,i){return r=Xx(r),r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}function Xx(e){var r=Qx(e,"string");return typeof r=="symbol"?r:r+""}function Qx(e,r){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var s=i.call(e,r||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function bv(e){return e&&e.map((r,i)=>xn.createElement(r.tag,Js({key:i},r.attr),bv(r.child)))}function wv(e){return r=>xn.createElement(Kx,Zs({attr:Js({},e.attr)},r),bv(e.child))}function Kx(e){var r=i=>{var{attr:s,size:l,title:u}=e,d=qx(e,$x),h=l||i.size||"1em",p;return i.className&&(p=i.className),e.className&&(p=(p?p+" ":"")+e.className),xn.createElement("svg",Zs({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},i.attr,s,d,{className:p,style:Js(Js({color:e.color||i.color},i.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),u&&xn.createElement("title",null,u),e.children)};return Qm!==void 0?xn.createElement(Qm.Consumer,null,i=>r(i)):r(Sv)}function Yx(e){return wv({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"},child:[]}]})(e)}function Zx(e){return wv({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z"},child:[]}]})(e)}const Jx="_generalConditionsContainer_1ijeb_1",eT="_generalConditions_1ijeb_1",tT="_generalConditionsHeader_1ijeb_15",nT="_generalConditionsBody_1ijeb_25",rT="_generalConditionsAccept_1ijeb_33",Wi={generalConditionsContainer:Jx,generalConditions:eT,generalConditionsHeader:tT,generalConditionsBody:nT,generalConditionsAccept:rT},iT="general-conditions.header",oT="general-conditions.body",Ym="general-conditions.accept-conditions-note",sT=()=>{const e=Pt(),[r,i]=B.useState(!1),s=()=>i(!r),l=h=>{h.key==="ArrowDown"||h.key==="ArrowRight"?i(!0):h.key==="ArrowUp"||h.key==="ArrowLeft"||h.key==="Escape"?i(!1):(h.key==="Enter"||h.key==="Space"||h.key===" ")&&s()},u=e(iT),d=e(Ym);return R.jsxs("div",{className:V(Wi.generalConditionsContainer,"chat__generalConditions"),children:[!!(u!=null&&u.length)&&R.jsxs("div",{className:Wi.generalConditions,children:[R.jsxs("div",{role:"button",onClick:s,onKeyDown:l,tabIndex:0,className:V(Wi.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":r?"true":"false","aria-pressed":r?"true":"false",children:[R.jsx(Yn,{children:u}),r?R.jsx(Zx,{}):R.jsx(Yx,{})]}),R.jsx("div",{className:V(Wi.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:r&&R.jsx(Yn,{children:e(oT)||""})})]}),!!(d!=null&&d.length)&&R.jsx("div",{className:V(Wi.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:R.jsx(Yn,{children:e(Ym)||""})})]})},aT="_message_iyv51_5",lT="_messageBot_iyv51_12",uT="_messageBotLast_iyv51_20",cT="_avatar_iyv51_20",fT="_messageBotFirst_iyv51_24",dT="_messageBotAnimated_iyv51_37",hT="_fadeInLeft_iyv51_1",pT="_messageGuest_iyv51_48",mT="_messageGuestFirst_iyv51_54",gT="_messageGuestLast_iyv51_60",yT="_botAvatar_iyv51_74",vT="_agentAvatar_iyv51_78",_T="_bubble_iyv51_82",ET="_bubbleContent_iyv51_88",ST="_bubbleLeft_iyv51_191",bT="_leftText_iyv51_200",wT="_bubbleRight_iyv51_207",xT="_rightText_iyv51_215",he={message:aT,messageBot:lT,messageBotLast:uT,avatar:cT,messageBotFirst:fT,messageBotAnimated:dT,fadeInLeft:hT,messageGuest:pT,messageGuestFirst:mT,messageGuestLast:gT,botAvatar:yT,agentAvatar:vT,bubble:_T,bubbleContent:ET,bubbleLeft:ST,leftText:bT,bubbleRight:wT,rightText:xT},TT="_botMessageActions_4blu2_1",CT="_alwaysVisible_4blu2_20",kT="_reported_4blu2_27",RT="_action_4blu2_31",Kn={botMessageActions:TT,alwaysVisible:CT,reported:kT,action:RT},OT=({alwaysVisible:e,reaction:r,botMessageRef:i,onReaction:s})=>{const l=Pt(),[u,d]=B.useState(!1),h=_=>()=>s(_),p=B.useCallback(async()=>{if(i.current)try{d(!0);const _=i.current.innerHTML,y=i.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([_],{type:"text/html"}),"text/plain":new Blob([y],{type:"text/plain"})})]),await new Promise(b=>setTimeout(b,1500))}finally{d(!1)}},[i]);return R.jsxs("div",{className:V(Kn.botMessageActions,e&&Kn.alwaysVisible,r&&Kn.reported),children:[R.jsx("button",{className:V(Kn.action,r==="GOOD"&&Kn.reported,"tooltip--right"),tabIndex:0,"aria-label":l(r==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),"data-title":l(r==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),onClick:h(r==="GOOD"?null:"GOOD"),children:R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:r==="GOOD"?R.jsx("path",{d:"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32Z"}):R.jsx("path",{d:"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32ZM223.94,97l-12,96a8,8,0,0,1-7.94,7H88V105.89l36.71-73.43A24,24,0,0,1,144,56V80a8,8,0,0,0,8,8h64a8,8,0,0,1,7.94,9Z"})})}),R.jsx("button",{className:V(Kn.action,r==="BAD"&&Kn.reported,"tooltip--right"),tabIndex:0,"aria-label":l(r==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),"data-title":l(r==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),onClick:h(r==="BAD"?null:"BAD"),children:R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:r==="BAD"?R.jsx("path",{d:"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Z"}):R.jsx("path",{d:"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Zm150,21.29a7.88,7.88,0,0,1-6,2.71H152a8,8,0,0,0-8,8v24a24,24,0,0,1-19.29,23.54L88,150.11V56H204a8,8,0,0,1,7.94,7l12,96A7.87,7.87,0,0,1,222,165.29Z"})})}),R.jsx("button",{className:V(Kn.action,"tooltip--right"),tabIndex:0,"aria-label":l("bot-bubble.copy"),"data-title":l("bot-bubble.copy"),onClick:p,children:R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:u?R.jsx("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}):R.jsx("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"})})})]})},xv=B.forwardRef(({message:e,isAnimated:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:l,children:u,onReaction:d},h)=>{const p=Pt(),_=B.useRef(null),y=e.sender.type===ge.UserType.BOT;return R.jsxs("li",{ref:h,className:V(he.message,he.messageBot,i&&he.lastMessage,s&&he.messageBotFirst,l&&he.messageBotLast,"chat__bubbleContainer",r&&he.messageBotAnimated,r&&"chat__bubbleContainer--animated",y?"chat__botBubbleContainer":"chat__agentBubbleContainer",s&&"chat__bubbleContainer--first",l&&"chat__bubbleContainer--last"),children:[R.jsx("img",{className:V(he.avatar,y?he.botAvatar:he.agentAvatar,"chat__avatar",y?"chat__botAvatar":"chat__agentAvatar"),src:`${e.sender.avatar}`,alt:y?"Bot":"Agent",referrerPolicy:"no-referrer"}),R.jsx("div",{ref:_,className:V(he.bubble,he.bubbleLeft,"chat__bubble",y?"chat__botBubble":"chat__agentBubble"),tabIndex:0,"aria-label":p(y?"bot-bubble.label":"agent-bubble.label"),children:R.jsx("div",{className:V(he.leftText),children:u})}),d&&R.jsx(OT,{alwaysVisible:i&&l,reaction:e.reaction,botMessageRef:_,onReaction:d})]})}),NT="_title_1mhh2_1",AT="_subtitle_1mhh2_6",PT="_buttons_1mhh2_11",IT="_button_1mhh2_11",DT="_imageContainer_1mhh2_33",MT="_image_1mhh2_33",FT="_video_container_1mhh2_44",LT="_video_1mhh2_44",BT="_only_1mhh2_54",St={title:NT,subtitle:AT,buttons:PT,button:IT,imageContainer:DT,image:MT,video_container:FT,video:LT,only:BT},jT=({buttons:e,onButtonClick:r})=>R.jsx("div",{className:V(St.buttons,"chat__bubbleButtons"),children:e.map((i,s)=>R.jsx("button",{className:V(St.button,it.button,"chat__bubbleButton"),onClick:()=>r(i),children:i.title},s))});var As={},Ps={},Is={},Zm;function zT(){if(Zm)return Is;Zm=1,Object.defineProperty(Is,"__esModule",{value:!0});var e=Jr(),r=i(e);function i(s){if(s&&s.__esModule)return s;var l={};if(s!=null)for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(l[u]=s[u]);return l.default=s,l}return Is.default=function(s,l,u){return r.createElement("a",{href:s,key:u},l)},Is}var Ds={},Jm;function UT(){return Jm||(Jm=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.default=function(e){return e}),Ds}var Ms={},Lu,eg;function HT(){return eg||(eg=1,Lu=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),Lu}var Bu,tg;function GT(){return tg||(tg=1,Bu=/[\0-\x1F\x7F-\x9F]/),Bu}var ju,ng;function $T(){return ng||(ng=1,ju=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),ju}var zu,rg;function qT(){return rg||(rg=1,zu=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/),zu}var Uu,ig;function VT(){return ig||(ig=1,Uu=function(e){var r={};r.src_Any=HT().source,r.src_Cc=GT().source,r.src_Z=$T().source,r.src_P=qT().source,r.src_ZPCc=[r.src_Z,r.src_P,r.src_Cc].join("|"),r.src_ZCc=[r.src_Z,r.src_Cc].join("|");var i="[><|]";return r.src_pseudo_letter="(?:(?!"+i+"|"+r.src_ZPCc+")"+r.src_Any+")",r.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",r.src_auth="(?:(?:(?!"+r.src_ZCc+"|[@/\\[\\]()]).)+@)?",r.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",r.src_host_terminator="(?=$|"+i+"|"+r.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+r.src_ZPCc+"))",r.src_path="(?:[/?#](?:(?!"+r.src_ZCc+"|"+i+`|[()[\\]{}.,"'?!\\-]).|\\[(?:(?!`+r.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+r.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+r.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+r.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+r.src_ZCc+"|[']).)+\\'|\\'(?="+r.src_pseudo_letter+"|[-]).|\\.{2,4}[a-zA-Z0-9%/]|\\.(?!"+r.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+r.src_ZCc+").|\\!(?!"+r.src_ZCc+"|[!]).|\\?(?!"+r.src_ZCc+"|[?]).)+|\\/)?",r.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',r.src_xn="xn--[a-z0-9\\-]{1,59}",r.src_domain_root="(?:"+r.src_xn+"|"+r.src_pseudo_letter+"{1,63})",r.src_domain="(?:"+r.src_xn+"|(?:"+r.src_pseudo_letter+")|(?:"+r.src_pseudo_letter+"(?:-|"+r.src_pseudo_letter+"){0,61}"+r.src_pseudo_letter+"))",r.src_host="(?:(?:(?:(?:"+r.src_domain+")\\.)*"+r.src_domain+"))",r.tpl_host_fuzzy="(?:"+r.src_ip4+"|(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%)))",r.tpl_host_no_ip_fuzzy="(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%))",r.src_host_strict=r.src_host+r.src_host_terminator,r.tpl_host_fuzzy_strict=r.tpl_host_fuzzy+r.src_host_terminator,r.src_host_port_strict=r.src_host+r.src_port+r.src_host_terminator,r.tpl_host_port_fuzzy_strict=r.tpl_host_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_port_no_ip_fuzzy_strict=r.tpl_host_no_ip_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+r.src_ZPCc+"|>|$))",r.tpl_email_fuzzy="(^|"+i+'|"|\\(|'+r.src_ZCc+")("+r.src_email_name+"@"+r.tpl_host_fuzzy_strict+")",r.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+r.src_ZPCc+"))((?![$+<=>^`||])"+r.tpl_host_port_fuzzy_strict+r.src_path+")",r.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+r.src_ZPCc+"))((?![$+<=>^`||])"+r.tpl_host_port_no_ip_fuzzy_strict+r.src_path+")",r}),Uu}var Hu,og;function WT(){if(og)return Hu;og=1;function e(S){var k=Array.prototype.slice.call(arguments,1);return k.forEach(function(x){x&&Object.keys(x).forEach(function(L){S[L]=x[L]})}),S}function r(S){return Object.prototype.toString.call(S)}function i(S){return r(S)==="[object String]"}function s(S){return r(S)==="[object Object]"}function l(S){return r(S)==="[object RegExp]"}function u(S){return r(S)==="[object Function]"}function d(S){return S.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var h={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function p(S){return Object.keys(S||{}).reduce(function(k,x){return k||h.hasOwnProperty(x)},!1)}var _={"http:":{validate:function(S,k,x){var L=S.slice(k);return x.re.http||(x.re.http=new RegExp("^\\/\\/"+x.re.src_auth+x.re.src_host_port_strict+x.re.src_path,"i")),x.re.http.test(L)?L.match(x.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(S,k,x){var L=S.slice(k);return x.re.no_http||(x.re.no_http=new RegExp("^"+x.re.src_auth+"(?:localhost|(?:(?:"+x.re.src_domain+")\\.)+"+x.re.src_domain_root+")"+x.re.src_port+x.re.src_host_terminator+x.re.src_path,"i")),x.re.no_http.test(L)?k>=3&&S[k-3]===":"||k>=3&&S[k-3]==="/"?0:L.match(x.re.no_http)[0].length:0}},"mailto:":{validate:function(S,k,x){var L=S.slice(k);return x.re.mailto||(x.re.mailto=new RegExp("^"+x.re.src_email_name+"@"+x.re.src_host_strict,"i")),x.re.mailto.test(L)?L.match(x.re.mailto)[0].length:0}}},y="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",b="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function m(S){S.__index__=-1,S.__text_cache__=""}function E(S){return function(k,x){var L=k.slice(x);return S.test(L)?L.match(S)[0].length:0}}function v(){return function(S,k){k.normalize(S)}}function w(S){var k=S.re=VT()(S.__opts__),x=S.__tlds__.slice();S.onCompile(),S.__tlds_replaced__||x.push(y),x.push(k.src_xn),k.src_tlds=x.join("|");function L(te){return te.replace("%TLDS%",k.src_tlds)}k.email_fuzzy=RegExp(L(k.tpl_email_fuzzy),"i"),k.link_fuzzy=RegExp(L(k.tpl_link_fuzzy),"i"),k.link_no_ip_fuzzy=RegExp(L(k.tpl_link_no_ip_fuzzy),"i"),k.host_fuzzy_test=RegExp(L(k.tpl_host_fuzzy_test),"i");var G=[];S.__compiled__={};function q(te,oe){throw new Error('(LinkifyIt) Invalid schema "'+te+'": '+oe)}Object.keys(S.__schemas__).forEach(function(te){var oe=S.__schemas__[te];if(oe!==null){var pe={validate:null,link:null};if(S.__compiled__[te]=pe,s(oe)){l(oe.validate)?pe.validate=E(oe.validate):u(oe.validate)?pe.validate=oe.validate:q(te,oe),u(oe.normalize)?pe.normalize=oe.normalize:oe.normalize?q(te,oe):pe.normalize=v();return}if(i(oe)){G.push(te);return}q(te,oe)}}),G.forEach(function(te){S.__compiled__[S.__schemas__[te]]&&(S.__compiled__[te].validate=S.__compiled__[S.__schemas__[te]].validate,S.__compiled__[te].normalize=S.__compiled__[S.__schemas__[te]].normalize)}),S.__compiled__[""]={validate:null,normalize:v()};var fe=Object.keys(S.__compiled__).filter(function(te){return te.length>0&&S.__compiled__[te]}).map(d).join("|");S.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+k.src_ZPCc+"))("+fe+")","i"),S.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+k.src_ZPCc+"))("+fe+")","ig"),S.re.pretest=RegExp("("+S.re.schema_test.source+")|("+S.re.host_fuzzy_test.source+")|@","i"),m(S)}function C(S,k){var x=S.__index__,L=S.__last_index__,G=S.__text_cache__.slice(x,L);this.schema=S.__schema__.toLowerCase(),this.index=x+k,this.lastIndex=L+k,this.raw=G,this.text=G,this.url=G}function O(S,k){var x=new C(S,k);return S.__compiled__[x.schema].normalize(x,S),x}function N(S,k){if(!(this instanceof N))return new N(S,k);k||p(S)&&(k=S,S={}),this.__opts__=e({},h,k),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=e({},_,S),this.__compiled__={},this.__tlds__=b,this.__tlds_replaced__=!1,this.re={},w(this)}return N.prototype.add=function(k,x){return this.__schemas__[k]=x,w(this),this},N.prototype.set=function(k){return this.__opts__=e(this.__opts__,k),this},N.prototype.test=function(k){if(this.__text_cache__=k,this.__index__=-1,!k.length)return!1;var x,L,G,q,fe,te,oe,pe,ue;if(this.re.schema_test.test(k)){for(oe=this.re.schema_search,oe.lastIndex=0;(x=oe.exec(k))!==null;)if(q=this.testSchemaAt(k,x[2],oe.lastIndex),q){this.__schema__=x[2],this.__index__=x.index+x[1].length,this.__last_index__=x.index+x[0].length+q;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(pe=k.search(this.re.host_fuzzy_test),pe>=0&&(this.__index__<0||pe<this.__index__)&&(L=k.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(fe=L.index+L[1].length,(this.__index__<0||fe<this.__index__)&&(this.__schema__="",this.__index__=fe,this.__last_index__=L.index+L[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(ue=k.indexOf("@"),ue>=0&&(G=k.match(this.re.email_fuzzy))!==null&&(fe=G.index+G[1].length,te=G.index+G[0].length,(this.__index__<0||fe<this.__index__||fe===this.__index__&&te>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=fe,this.__last_index__=te))),this.__index__>=0},N.prototype.pretest=function(k){return this.re.pretest.test(k)},N.prototype.testSchemaAt=function(k,x,L){return this.__compiled__[x.toLowerCase()]?this.__compiled__[x.toLowerCase()].validate(k,L,this):0},N.prototype.match=function(k){var x=0,L=[];this.__index__>=0&&this.__text_cache__===k&&(L.push(O(this,x)),x=this.__last_index__);for(var G=x?k.slice(x):k;this.test(G);)L.push(O(this,x)),G=G.slice(this.__last_index__),x+=this.__last_index__;return L.length?L:null},N.prototype.tlds=function(k,x){return k=Array.isArray(k)?k:[k],x?(this.__tlds__=this.__tlds__.concat(k).sort().filter(function(L,G,q){return L!==q[G-1]}).reverse(),w(this),this):(this.__tlds__=k.slice(),this.__tlds_replaced__=!0,w(this),this)},N.prototype.normalize=function(k){k.schema||(k.url="http://"+k.url),k.schema==="mailto:"&&!/^mailto:/i.test(k.url)&&(k.url="mailto:"+k.url)},N.prototype.onCompile=function(){},Hu=N,Hu}const XT=JSON.parse('["aaa","aarp","abb","abbott","abbvie","abc","able","abogado","abudhabi","ac","academy","accenture","accountant","accountants","aco","actor","ad","ads","adult","ae","aeg","aero","aetna","af","afl","africa","ag","agakhan","agency","ai","aig","airbus","airforce","airtel","akdn","al","alibaba","alipay","allfinanz","allstate","ally","alsace","alstom","am","amazon","americanexpress","americanfamily","amex","amfam","amica","amsterdam","analytics","android","anquan","anz","ao","aol","apartments","app","apple","aq","aquarelle","ar","arab","aramco","archi","army","arpa","art","arte","as","asda","asia","associates","at","athleta","attorney","au","auction","audi","audible","audio","auspost","author","auto","autos","avianca","aw","aws","ax","axa","az","azure","ba","baby","baidu","banamex","bananarepublic","band","bank","bar","barcelona","barclaycard","barclays","barefoot","bargains","baseball","basketball","bauhaus","bayern","bb","bbc","bbt","bbva","bcg","bcn","bd","be","beats","beauty","beer","bentley","berlin","best","bestbuy","bet","bf","bg","bh","bharti","bi","bible","bid","bike","bing","bingo","bio","biz","bj","black","blackfriday","blockbuster","blog","bloomberg","blue","bm","bms","bmw","bn","bnpparibas","bo","boats","boehringer","bofa","bom","bond","boo","book","booking","bosch","bostik","boston","bot","boutique","box","br","bradesco","bridgestone","broadway","broker","brother","brussels","bs","bt","build","builders","business","buy","buzz","bv","bw","by","bz","bzh","ca","cab","cafe","cal","call","calvinklein","cam","camera","camp","canon","capetown","capital","capitalone","car","caravan","cards","care","career","careers","cars","casa","case","cash","casino","cat","catering","catholic","cba","cbn","cbre","cbs","cc","cd","center","ceo","cern","cf","cfa","cfd","cg","ch","chanel","channel","charity","chase","chat","cheap","chintai","christmas","chrome","church","ci","cipriani","circle","cisco","citadel","citi","citic","city","cityeats","ck","cl","claims","cleaning","click","clinic","clinique","clothing","cloud","club","clubmed","cm","cn","co","coach","codes","coffee","college","cologne","com","comcast","commbank","community","company","compare","computer","comsec","condos","construction","consulting","contact","contractors","cooking","cool","coop","corsica","country","coupon","coupons","courses","cpa","cr","credit","creditcard","creditunion","cricket","crown","crs","cruise","cruises","cu","cuisinella","cv","cw","cx","cy","cymru","cyou","cz","dabur","dad","dance","data","date","dating","datsun","day","dclk","dds","de","deal","dealer","deals","degree","delivery","dell","deloitte","delta","democrat","dental","dentist","desi","design","dev","dhl","diamonds","diet","digital","direct","directory","discount","discover","dish","diy","dj","dk","dm","dnp","do","docs","doctor","dog","domains","dot","download","drive","dtv","dubai","dunlop","dupont","durban","dvag","dvr","dz","earth","eat","ec","eco","edeka","edu","education","ee","eg","email","emerck","energy","engineer","engineering","enterprises","epson","equipment","er","ericsson","erni","es","esq","estate","et","etisalat","eu","eurovision","eus","events","exchange","expert","exposed","express","extraspace","fage","fail","fairwinds","faith","family","fan","fans","farm","farmers","fashion","fast","fedex","feedback","ferrari","ferrero","fi","fidelity","fido","film","final","finance","financial","fire","firestone","firmdale","fish","fishing","fit","fitness","fj","fk","flickr","flights","flir","florist","flowers","fly","fm","fo","foo","food","football","ford","forex","forsale","forum","foundation","fox","fr","free","fresenius","frl","frogans","frontdoor","frontier","ftr","fujitsu","fun","fund","furniture","futbol","fyi","ga","gal","gallery","gallo","gallup","game","games","gap","garden","gay","gb","gbiz","gd","gdn","ge","gea","gent","genting","george","gf","gg","ggee","gh","gi","gift","gifts","gives","giving","gl","glass","gle","global","globo","gm","gmail","gmbh","gmo","gmx","gn","godaddy","gold","goldpoint","golf","goo","goodyear","goog","google","gop","got","gov","gp","gq","gr","grainger","graphics","gratis","green","gripe","grocery","group","gs","gt","gu","guardian","gucci","guge","guide","guitars","guru","gw","gy","hair","hamburg","hangout","haus","hbo","hdfc","hdfcbank","health","healthcare","help","helsinki","here","hermes","hiphop","hisamitsu","hitachi","hiv","hk","hkt","hm","hn","hockey","holdings","holiday","homedepot","homegoods","homes","homesense","honda","horse","hospital","host","hosting","hot","hotels","hotmail","house","how","hr","hsbc","ht","hu","hughes","hyatt","hyundai","ibm","icbc","ice","icu","id","ie","ieee","ifm","ikano","il","im","imamat","imdb","immo","immobilien","in","inc","industries","infiniti","info","ing","ink","institute","insurance","insure","int","international","intuit","investments","io","ipiranga","iq","ir","irish","is","ismaili","ist","istanbul","it","itau","itv","jaguar","java","jcb","je","jeep","jetzt","jewelry","jio","jll","jm","jmp","jnj","jo","jobs","joburg","jot","joy","jp","jpmorgan","jprs","juegos","juniper","kaufen","kddi","ke","kerryhotels","kerrylogistics","kerryproperties","kfh","kg","kh","ki","kia","kids","kim","kinder","kindle","kitchen","kiwi","km","kn","koeln","komatsu","kosher","kp","kpmg","kpn","kr","krd","kred","kuokgroup","kw","ky","kyoto","kz","la","lacaixa","lamborghini","lamer","lancaster","land","landrover","lanxess","lasalle","lat","latino","latrobe","law","lawyer","lb","lc","lds","lease","leclerc","lefrak","legal","lego","lexus","lgbt","li","lidl","life","lifeinsurance","lifestyle","lighting","like","lilly","limited","limo","lincoln","link","lipsy","live","living","lk","llc","llp","loan","loans","locker","locus","lol","london","lotte","lotto","love","lpl","lplfinancial","lr","ls","lt","ltd","ltda","lu","lundbeck","luxe","luxury","lv","ly","ma","madrid","maif","maison","makeup","man","management","mango","map","market","marketing","markets","marriott","marshalls","mattel","mba","mc","mckinsey","md","me","med","media","meet","melbourne","meme","memorial","men","menu","merckmsd","mg","mh","miami","microsoft","mil","mini","mint","mit","mitsubishi","mk","ml","mlb","mls","mm","mma","mn","mo","mobi","mobile","moda","moe","moi","mom","monash","money","monster","mormon","mortgage","moscow","moto","motorcycles","mov","movie","mp","mq","mr","ms","msd","mt","mtn","mtr","mu","museum","music","mv","mw","mx","my","mz","na","nab","nagoya","name","natura","navy","nba","nc","ne","nec","net","netbank","netflix","network","neustar","new","news","next","nextdirect","nexus","nf","nfl","ng","ngo","nhk","ni","nico","nike","nikon","ninja","nissan","nissay","nl","no","nokia","norton","now","nowruz","nowtv","np","nr","nra","nrw","ntt","nu","nyc","nz","obi","observer","office","okinawa","olayan","olayangroup","oldnavy","ollo","om","omega","one","ong","onl","online","ooo","open","oracle","orange","org","organic","origins","osaka","otsuka","ott","ovh","pa","page","panasonic","paris","pars","partners","parts","party","pay","pccw","pe","pet","pf","pfizer","pg","ph","pharmacy","phd","philips","phone","photo","photography","photos","physio","pics","pictet","pictures","pid","pin","ping","pink","pioneer","pizza","pk","pl","place","play","playstation","plumbing","plus","pm","pn","pnc","pohl","poker","politie","porn","post","pr","pramerica","praxi","press","prime","pro","prod","productions","prof","progressive","promo","properties","property","protection","pru","prudential","ps","pt","pub","pw","pwc","py","qa","qpon","quebec","quest","racing","radio","re","read","realestate","realtor","realty","recipes","red","redstone","redumbrella","rehab","reise","reisen","reit","reliance","ren","rent","rentals","repair","report","republican","rest","restaurant","review","reviews","rexroth","rich","richardli","ricoh","ril","rio","rip","ro","rocher","rocks","rodeo","rogers","room","rs","rsvp","ru","rugby","ruhr","run","rw","rwe","ryukyu","sa","saarland","safe","safety","sakura","sale","salon","samsclub","samsung","sandvik","sandvikcoromant","sanofi","sap","sarl","sas","save","saxo","sb","sbi","sbs","sc","sca","scb","schaeffler","schmidt","scholarships","school","schule","schwarz","science","scot","sd","se","search","seat","secure","security","seek","select","sener","services","seven","sew","sex","sexy","sfr","sg","sh","shangrila","sharp","shaw","shell","shia","shiksha","shoes","shop","shopping","shouji","show","showtime","si","silk","sina","singles","site","sj","sk","ski","skin","sky","skype","sl","sling","sm","smart","smile","sn","sncf","so","soccer","social","softbank","software","sohu","solar","solutions","song","sony","soy","spa","space","sport","spot","sr","srl","ss","st","stada","staples","star","statebank","statefarm","stc","stcgroup","stockholm","storage","store","stream","studio","study","style","su","sucks","supplies","supply","support","surf","surgery","suzuki","sv","swatch","swiss","sx","sy","sydney","systems","sz","tab","taipei","talk","taobao","target","tatamotors","tatar","tattoo","tax","taxi","tc","tci","td","tdk","team","tech","technology","tel","temasek","tennis","teva","tf","tg","th","thd","theater","theatre","tiaa","tickets","tienda","tips","tires","tirol","tj","tjmaxx","tjx","tk","tkmaxx","tl","tm","tmall","tn","to","today","tokyo","tools","top","toray","toshiba","total","tours","town","toyota","toys","tr","trade","trading","training","travel","travelers","travelersinsurance","trust","trv","tt","tube","tui","tunes","tushu","tv","tvs","tw","tz","ua","ubank","ubs","ug","uk","unicom","university","uno","uol","ups","us","uy","uz","va","vacations","vana","vanguard","vc","ve","vegas","ventures","verisign","vermögensberater","vermögensberatung","versicherung","vet","vg","vi","viajes","video","vig","viking","villas","vin","vip","virgin","visa","vision","viva","vivo","vlaanderen","vn","vodka","volkswagen","volvo","vote","voting","voto","voyage","vu","wales","walmart","walter","wang","wanggou","watch","watches","weather","weatherchannel","webcam","weber","website","wed","wedding","weibo","weir","wf","whoswho","wien","wiki","williamhill","win","windows","wine","winners","wme","wolterskluwer","woodside","work","works","world","wow","ws","wtc","wtf","xbox","xerox","xfinity","xihuan","xin","xxx","xyz","yachts","yahoo","yamaxun","yandex","ye","yodobashi","yoga","yokohama","you","youtube","yt","yun","za","zappos","zara","zero","zip","zm","zone","zuerich","zw","ελ","ευ","бг","бел","дети","ею","католик","ком","мкд","мон","москва","онлайн","орг","рус","рф","сайт","срб","укр","қаз","հայ","ישראל","קום","ابوظبي","اتصالات","ارامكو","الاردن","البحرين","الجزائر","السعودية","العليان","المغرب","امارات","ایران","بارت","بازار","بيتك","بھارت","تونس","سودان","سورية","شبكة","عراق","عرب","عمان","فلسطين","قطر","كاثوليك","كوم","مصر","مليسيا","موريتانيا","موقع","همراه","پاکستان","ڀارت","कॉम","नेट","भारत","भारतम्","भारोत","संगठन","বাংলা","ভারত","ভাৰত","ਭਾਰਤ","ભારત","ଭାରତ","இந்தியா","இலங்கை","சிங்கப்பூர்","భారత్","ಭಾರತ","ഭാരതം","ලංකා","คอม","ไทย","ລາວ","გე","みんな","アマゾン","クラウド","グーグル","コム","ストア","セール","ファッション","ポイント","世界","中信","中国","中國","中文网","亚马逊","企业","佛山","信息","健康","八卦","公司","公益","台湾","台灣","商城","商店","商标","嘉里","嘉里大酒店","在线","大拿","天主教","娱乐","家電","广东","微博","慈善","我爱你","手机","招聘","政务","政府","新加坡","新闻","时尚","書籍","机构","淡马锡","游戏","澳門","点看","移动","组织机构","网址","网店","网站","网络","联通","谷歌","购物","通販","集团","電訊盈科","飞利浦","食品","餐厅","香格里拉","香港","닷넷","닷컴","삼성","한국"]');var sg;function QT(){if(sg)return Ms;sg=1,Object.defineProperty(Ms,"__esModule",{value:!0});var e=WT(),r=l(e),i=XT,s=l(i);function l(d){return d&&d.__esModule?d:{default:d}}var u=new r.default;return u.tlds(s.default),Ms.default=function(d){return u.match(d)},Ms}var Fs={},ag;function KT(){return ag||(ag=1,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.default=function(e){return e}),Fs}var lg;function YT(){if(lg)return Ps;lg=1,Object.defineProperty(Ps,"__esModule",{value:!0});var e=function(){function O(N,S){for(var k=0;k<S.length;k++){var x=S[k];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(N,x.key,x)}}return function(N,S,k){return S&&O(N.prototype,S),k&&O(N,k),N}}(),r=Jr(),i=m(r),s=zT(),l=b(s),u=UT(),d=b(u),h=QT(),p=b(h),_=KT(),y=b(_);function b(O){return O&&O.__esModule?O:{default:O}}function m(O){if(O&&O.__esModule)return O;var N={};if(O!=null)for(var S in O)Object.prototype.hasOwnProperty.call(O,S)&&(N[S]=O[S]);return N.default=O,N}function E(O,N){if(!(O instanceof N))throw new TypeError("Cannot call a class as a function")}function v(O,N){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:O}function w(O,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);O.prototype=Object.create(N&&N.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(O,N):O.__proto__=N)}var C=function(O){w(N,O);function N(){return E(this,N),v(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return e(N,[{key:"parseString",value:function(k){var x=this;if(k==="")return k;var L=this.props.matchDecorator(k);if(!L)return k;var G=[],q=0;return L.forEach(function(fe,te){fe.index>q&&G.push(k.substring(q,fe.index));var oe=x.props.hrefDecorator(fe.url),pe=x.props.textDecorator(fe.text),ue=x.props.componentDecorator(oe,pe,te);G.push(ue),q=fe.lastIndex}),k.length>q&&G.push(k.substring(q)),G.length===1?G[0]:G}},{key:"parse",value:function(k){var x=this,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof k=="string"?this.parseString(k):i.isValidElement(k)&&k.type!=="a"&&k.type!=="button"?i.cloneElement(k,{key:L},this.parse(k.props.children)):Array.isArray(k)?k.map(function(G,q){return x.parse(G,q)}):k}},{key:"render",value:function(){return i.createElement(i.Fragment,null,this.parse(this.props.children))}}]),N}(i.Component);return C.defaultProps={componentDecorator:l.default,hrefDecorator:d.default,matchDecorator:p.default,textDecorator:y.default},Ps.default=C,Ps}var ug;function ZT(){if(ug)return As;ug=1,Object.defineProperty(As,"__esModule",{value:!0});var e=YT(),r=i(e);function i(s){return s&&s.__esModule?s:{default:s}}return As.default=r.default,As}var JT=ZT();const eC=ta(JT),tC="_text_ola9a_1",nC="_command_ola9a_5",cg={text:tC,command:nC},Tv=({text:e,commands:r=[],onLinkClick:i})=>{const s=h=>p=>(p.preventDefault(),h&&i(h),!1),l=(h,p,_)=>R.jsx("a",{onClick:s(h),role:"button",children:p},_),u=r.find(h=>e.startsWith(`/${h}`)),d=u?e.slice(u.length+1):e;return R.jsxs("div",{children:[u&&R.jsxs("code",{className:cg.command,children:["/",u]}),d.split(`
|
|
97
|
-
`).map((h,p)=>R.jsxs("span",{className:cg.text,children:[R.jsx(eC,{componentDecorator:l,children:h}),R.jsx("br",{})]},p))]})},rC=({subtitle:e,onLinkClick:r})=>e?R.jsx("div",{className:St.subtitle,children:R.jsx(Tv,{text:e,onLinkClick:r})}):null,fg="newtab#",Cv=({markdown:e,onLinkClick:r})=>{const i=l=>u=>(u.preventDefault(),l&&r(l),!1),s=({title:l,href:u,children:d})=>u.indexOf(fg)===0?R.jsx("a",{href:u.slice(fg.length),title:l,target:"_blank",rel:"noopener noreferrer",children:d}):R.jsx("a",{onClick:i(u),title:l,href:u,children:d});return R.jsx(Yn,{options:{overrides:{a:s}},children:e})},iC=({text:e,onLinkClick:r})=>e?R.jsx("div",{children:R.jsx(Cv,{markdown:e,onLinkClick:r})}):null,oC=({title:e})=>e?R.jsx("h1",{className:St.title,children:e}):null,sC=({title:e,text:r,subtitle:i,buttons:s,onButtonClick:l,onLinkClick:u})=>(e==null?void 0:e.length)||(r==null?void 0:r.length)||(i==null?void 0:i.length)||(s==null?void 0:s.length)?R.jsxs("div",{className:V(he.bubbleContent),children:[R.jsx(oC,{title:e}),R.jsx(iC,{text:r,onLinkClick:u}),R.jsx(rC,{subtitle:i,onLinkClick:u}),R.jsx(jT,{buttons:s,onButtonClick:l})]}):null,aC=({alt:e,imageUrl:r,itemUrl:i,hasBody:s})=>r?i?i.indexOf("youtube.com")>-1?R.jsx("div",{className:St.video_container,children:R.jsx("iframe",{className:V(St.video,{[St.only]:!s}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):R.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:R.jsx("div",{className:St.imageContainer,children:R.jsx("img",{className:V(St.image,{[St.only]:!s}),src:r,alt:e})})}):R.jsx("div",{className:St.imageContainer,children:R.jsx("img",{className:V(St.image,{[St.only]:!s}),src:r,alt:e})}):null,lC=({title:e,text:r,subtitle:i,imageUrl:s,itemUrl:l,buttons:u,onButtonClick:d,onLinkClick:h})=>{const p=!!(e!=null&&e.length)||!!(r!=null&&r.length)||!!(i!=null&&i.length)||!!(u!=null&&u.length);return R.jsxs("div",{className:V(St.detailMessage),children:[R.jsx(aC,{hasBody:p,imageUrl:s,itemUrl:l,alt:e||i}),p&&R.jsx(sC,{title:e,text:r,subtitle:i,buttons:u,onLinkClick:h,onButtonClick:d})]})},uC=B.forwardRef(({isFirstMessageBySender:e,isLastMessageBySender:r,children:i},s)=>{const l=Pt();return R.jsx("li",{ref:s,className:V(he.message,he.messageGuest,e&&he.messageGuestFirst,r&&he.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",e&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:R.jsx("div",{className:V(he.bubble,he.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":l("guest-bubble.label"),children:R.jsx("div",{className:V(he.rightText),children:i})})})}),cC=({markdown:e,className:r,onLinkClick:i})=>R.jsx("div",{className:V(he.bubbleContent,r),children:R.jsx(Cv,{markdown:e,onLinkClick:i})}),fC=({text:e,commands:r,onLinkClick:i})=>R.jsx("div",{className:he.bubbleContent,children:R.jsx(Tv,{text:e,commands:r,onLinkClick:i})}),dC=B.forwardRef(({message:e,commands:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:l,onReaction:u,onButtonClick:d,onLinkClick:h},p)=>{const _=hC(e,r,d,h);switch(e.sender.type){case ge.UserType.GUEST:return R.jsx(uC,{ref:p,isFirstMessageBySender:s,isLastMessageBySender:l,children:_});default:{const y=b=>u(e._id,b);return R.jsx(xv,{ref:p,message:e,isAnimated:!1,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:l,onReaction:y,children:_})}}}),hC=(e,r,i,s)=>{switch(e.type){case ge.MessageTypeEnum.TEXT:{const l=e;return R.jsx(fC,{text:l.text,commands:r,onLinkClick:s})}case ge.MessageTypeEnum.DETAIL:{const l=e;return R.jsx(lC,{title:l.title,text:l.text,subtitle:l.subtitle,imageUrl:l.imageUrl,itemUrl:l.itemUrl,buttons:l.buttons,onButtonClick:i,onLinkClick:s})}case ge.MessageTypeEnum.MARKDOWN:{const l=e;return R.jsx(cC,{markdown:l.markdown,className:l.className,onLinkClick:s})}}},pC=(e,r)=>e.message._id===r.message._id&&e.message.reaction===r.message.reaction&&e.isLastMessage===r.isLastMessage&&e.isFirstMessageBySender===r.isFirstMessageBySender&&e.isLastMessageBySender===r.isLastMessageBySender,mC=xn.memo(dC,pC),gC="_ticontainer_wftg7_1",yC="_tiblock_wftg7_5",vC="_tidot_wftg7_12",_C="_mercuryTypingAnimation_wftg7_1",Xi={ticontainer:gC,tiblock:yC,tidot:vC,mercuryTypingAnimation:_C},EC=({isTyping:e=!1})=>R.jsx("div",{className:Xi.ticontainer,children:R.jsx("div",{className:Xi.tiblock,children:e?R.jsxs(R.Fragment,{children:[R.jsx("div",{className:V(Xi.tidot,"chat__typingIndicator")}),R.jsx("div",{className:V(Xi.tidot,"chat__typingIndicator")}),R.jsx("div",{className:V(Xi.tidot,"chat__typingIndicator")})]}):null})}),SC=Object.assign({_id:"typing-indicator"},new ge.TextMessage("",new ge.BotUser)),bC=({messages:e,isBotTyping:r,showGeneralConditions:i,commands:s,onTranscriptItemReaction:l,onButtonClick:u,onLinkClick:d})=>{const h=B.useRef(0),p=B.useRef(!0),_=B.useRef(null),y=B.useRef(null),b=B.useRef(null);B.useLayoutEffect(()=>{if(e.length&&_.current&&(h.current<e.length||r)){if(y.current){const v=y.current.offsetTop;_.current.scrollTop=v}else if(b.current){const v=b.current.offsetTop;_.current.scrollTop=v}p.current&&(p.current=!1),h.current=e.length}},[e,p,r]);let m;const E=e.length;return R.jsxs("div",{ref:_,className:V(zm.messageContainer,"chat__messageContainer"),style:{scrollBehavior:e.length&&p.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[i&&R.jsx(sT,{}),R.jsxs("ul",{className:zm.messages,children:[e.map((v,w)=>{const C=wC(v,m),O=xC(v,w,e,r);m=v.sender.type;const N=w+1===E;return R.jsx(mC,{ref:N?b:null,message:v,commands:s,isLastMessage:N,isFirstMessageBySender:C,isLastMessageBySender:O,onButtonClick:u,onLinkClick:d,onReaction:l},N&&!r?"last":v._id)}),r&&R.jsx(xv,{ref:y,message:SC,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:m!==ge.UserType.BOT,isLastMessageBySender:!0,children:R.jsx(EC,{isTyping:!0})},"last")]})]})},wC=(e,r)=>!r||r!==e.sender.type,xC=(e,r,i,s)=>{var h;const l=e.sender.type,u=i.length;return r+1===u?!(l===ge.UserType.BOT&&s):l!==((h=i.at(r+1))==null?void 0:h.sender.type)},TC="_bottomSheet_8itd6_1",CC="_bottomSheetOpen_8itd6_15",kC="_bottomSheetClose_8itd6_20",Cn={bottomSheet:TC,bottomSheetOpen:CC,"slide-in":"_slide-in_8itd6_1",bottomSheetClose:kC,"slide-out":"_slide-out_8itd6_1"},RC="_container_ooyn8_1",dg={container:RC},OC=({contentUrl:e})=>{const r=_r(u=>u.connection.sessionId),[i,s]=B.useState(!1);B.useEffect(()=>{s(u=>u||!!e)},[e]);const l=B.useMemo(()=>{if(e&&r){const u=new URL(e,document.baseURI);return u.searchParams.set("sessionId",r),u.toString()}else return},[e,r]);return R.jsx("div",{className:V(dg.container,Cn.bottomSheet,{[Cn.bottomSheetOpen]:!!e,[Cn.bottomSheetClose]:i&&!e}),children:l&&R.jsx("iframe",{title:"Drawer",src:l,className:dg.iframe})})},NC="_container_t5oqt_1",AC={container:NC},PC=({title:e,href:r,children:i})=>R.jsx("a",{href:r,title:e,target:"_blank",rel:"noopener noreferrer",children:i}),IC=()=>{const r=Pt()("powered-by");return r&&r.length?R.jsx("div",{className:V(AC.container,"chat__poweredBy"),children:R.jsx(Yn,{options:{overrides:{a:PC}},children:r})}):null},DC="_container_rkqaf_1",MC="_formContainer_rkqaf_14",FC="_emailInput_rkqaf_19",LC="_description_rkqaf_48",BC="_actions_rkqaf_53",jC="_validationError_rkqaf_63",zC="_submitted_rkqaf_70",bn={container:DC,formContainer:MC,emailInput:FC,description:LC,actions:BC,validationError:jC,submitted:zC},UC=({visible:e,methods:r,onEmailExport:i,onPdfExport:s,onClose:l})=>{const u=Pt(),[d,h]=B.useState(void 0),[p,_]=B.useState(!1),[y,b]=B.useState(!1),[m,E]=B.useState(void 0),v=B.useRef(null);B.useEffect(()=>{var N;e?((N=v.current)==null||N.focus(),_(!1),b(!1),h(e)):d===!0&&h(!1)},[e,d]);const w=N=>{N.preventDefault(),m&&m.length>0&&(i(m),_(!0),setTimeout(l,3*1e3))},C=N=>{const S=N.target.value.trim(),k=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(S);E(k?S:"")},O=()=>{b(!0),s(),setTimeout(l,3*1e3)};return R.jsxs("div",{className:V(bn.container,Cn.bottomSheet,{[Cn.bottomSheetOpen]:d===!0,[Cn.bottomSheetClose]:d===!1}),children:[r.pdf&&R.jsxs(R.Fragment,{children:[R.jsx("h2",{children:u("export-transcript.pdf.title")}),R.jsx(Yn,{className:bn.description,children:u("export-transcript.pdf.description")||""}),R.jsxs("div",{className:bn.actions,children:[R.jsx("button",{type:"button",className:V(it.button,it.buttonDefault),onClick:l,children:u("export-transcript.pdf.cancel")}),R.jsx("button",{className:V(it.button,it.buttonPrimary),onClick:O,disabled:y,children:u("export-transcript.pdf.download")})]})]}),r.email&&R.jsxs(R.Fragment,{children:[R.jsx("h2",{children:u("export-transcript.email.title")}),R.jsx(Yn,{className:bn.description,children:u("export-transcript.email.description")||""}),R.jsxs("form",{onSubmit:w,className:bn.formContainer,children:[R.jsxs("div",{children:[R.jsx("input",{disabled:p,ref:v,type:"email",placeholder:u("export-transcript.email.placeholder"),className:bn.emailInput,onChange:C}),(m==null?void 0:m.length)===0?R.jsx("div",{className:bn.validationError,children:u("export-transcript.email.invalid")}):null]}),R.jsxs("div",{className:bn.actions,children:[R.jsx("button",{type:"button",className:V(it.button,it.buttonDefault),onClick:l,children:u("export-transcript.email.cancel")}),R.jsx("button",{type:"submit",disabled:p||m===void 0||m.length===0,className:V(it.button,it.buttonPrimary),children:u("export-transcript.email.send")})]})]}),p&&R.jsx("div",{className:bn.submitted,children:u("export-transcript.email.success")})]})]})},HC="_inputContainer_1px77_1",GC={inputContainer:HC},$C="_blockUserInput_rv0dg_1",qC={blockUserInput:$C,"append-animate":"_append-animate_rv0dg_1"},VC=({visible:e})=>{const r=Pt();return e?R.jsx("div",{className:V(qC.blockUserInput,"chat__blockUserInput"),children:r("block-user-input.title")}):null},WC="_container_318uy_1",XC="_commands_318uy_5",QC="_command_318uy_5",KC="_commandActive_318uy_40",Ls={container:WC,commands:XC,command:QC,commandActive:KC},YC=(e,r)=>{B.useEffect(()=>{const i=s=>{e.current&&!e.current.contains(s.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[e,r])},ZC=(e,r,i,s,l)=>{B.useEffect(()=>{const u=d=>{if(e.length)switch(d.key){case"Enter":i(e[r]);break;case"ArrowUp":s(h=>h>0?h-1:e.length-1);break;case"ArrowDown":s(h=>h<e.length-1?h+1:0);break;case"Escape":l([]);break}};return document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}},[e,r,i,s,l])},JC=({text:e,commands:r,onSelectCommand:i,onVisibilityChange:s})=>{const l=B.useRef(null),u=Pt(),[d,h]=B.useState([]),[p,_]=B.useState(hg(r)),[y,b]=B.useState(0),m=E=>i(`/${E}`);return YC(l,()=>h([])),ZC(d,y,m,b,h),B.useEffect(()=>{_(hg(r))},[r]),B.useEffect(()=>{const E=e.length||0;E===0||E>p||!e.startsWith("/")?h([]):h(r.filter(e2(e))),b(0)},[r,e,p]),B.useEffect(()=>{s(!!d.length)},[d,s]),d.length?R.jsx("div",{ref:l,className:Ls.container,children:R.jsx("ul",{className:Ls.commands,role:"listbox",children:d.map((E,v)=>R.jsxs("li",{className:V([Ls.command,y===v&&Ls.commandActive]),role:"option",onClick:()=>m(E),onMouseOver:()=>b(v),children:[R.jsxs("h1",{children:["/",E]}),R.jsx("p",{children:u(`commands.${E}`)})]},E))})}):null},hg=e=>Math.max(...e.map(r=>r.length+1)),e2=e=>r=>{const i=`/${r}`;return i.startsWith(e)&&i.length>=e.length},t2="_callToActionContainer_czz0p_1",n2="_callToActionTitle_czz0p_24",r2="_rateOverlay_czz0p_31",i2="_body_czz0p_50",o2="_footer_czz0p_58",s2="_actions_czz0p_73",a2="_bubbles_czz0p_85",l2="_rateFeedbackBotBubble_czz0p_112",u2="_rateFeedbackGuestBubble_czz0p_118",c2="_avatar_czz0p_124",f2="_fadeInLeft_czz0p_1",d2="_bubble_czz0p_85",h2="_appear_czz0p_1",p2="_botBubble_czz0p_150",m2="_guestBubble_czz0p_160",g2="_rateText_czz0p_176",y2="_stars_czz0p_181",v2="_starsSmall_czz0p_194",_2="_starsLarge_czz0p_198",E2="_star_czz0p_181",S2="_starReadonly_czz0p_215",b2="_starIcon_czz0p_223",w2="_starsDescriptionContainer_czz0p_241",x2="_starsDescription_czz0p_241",ht={callToActionContainer:t2,"append-animate":"_append-animate_czz0p_1",callToActionTitle:n2,rateOverlay:r2,body:i2,footer:o2,actions:s2,bubbles:a2,rateFeedbackBotBubble:l2,rateFeedbackGuestBubble:u2,avatar:c2,fadeInLeft:f2,bubble:d2,appear:h2,botBubble:p2,guestBubble:m2,rateText:g2,stars:y2,starsSmall:v2,starsLarge:_2,star:E2,starReadonly:S2,starIcon:b2,starsDescriptionContainer:w2,starsDescription:x2},T2=({value:e,index:r,count:i,readonly:s,onHover:l,onClick:u})=>{const d=h=>{u&&h.key==="Enter"&&u()};return R.jsx("li",{className:V(ht.star,{[ht.starReadonly]:s},"chat__conversationRating__star"),children:R.jsx("div",{role:"radio","aria-checked":e>r?"true":"false","aria-posinset":r+1,"aria-setsize":i,tabIndex:0,onMouseOver:l,onKeyDown:d,onClick:u,children:R.jsx("span",{role:"img","aria-label":"Star",className:V(ht.starIcon),children:R.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:R.jsx("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"})})})})})},pg=5,kv=({value:e,size:r,readonly:i=!1,onChange:s})=>{const[l,u]=B.useState(void 0),d=()=>{u(void 0)},h=_=>()=>{if(!i){const y=_+1;u(y)}},p=_=>()=>{s&&!i&&(s(_===0&&e===1?0:_+1),u(void 0))};return R.jsx("ul",{tabIndex:0,role:"radiogroup",className:V(ht.stars,{[ht.starsSmall]:r==="small",[ht.starsLarge]:r==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:r==="small",chat__conversationRating__stars__large:r==="large"}),onMouseOut:d,children:Array(pg).fill(0).map((_,y)=>R.jsx(T2,{value:l===void 0?e:l,index:y,count:pg,readonly:i,onHover:h(y),onClick:p(y)},y))})},C2=({visible:e,onRate:r})=>{const i=Pt();return e?R.jsxs("div",{className:V(ht.callToActionContainer,"chat__conversationRating__callToAction"),children:[R.jsx("div",{className:V(ht.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),R.jsx(kv,{value:0,size:"small",onChange:r})]}):null},mg=({isFirstMessageBySender:e,isLastMessageBySender:r,children:i})=>R.jsxs("div",{className:V(he.message,he.messageBot,e&&he.messageBotFirst,r&&he.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",e&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:[R.jsx("img",{className:V(he.avatar,he.botAvatar),src:"bot.svg",alt:"Bot"}),R.jsx("div",{className:V(he.bubble,he.bubbleLeft,"chat__bubble","chat__botBubble"),children:R.jsx("div",{className:V(he.leftText,he.bubbleContent),children:i})})]}),k2=({children:e})=>R.jsx("div",{className:V(he.message,he.messageGuest,he.messageGuestFirst,he.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:R.jsx("div",{className:V(he.bubble,he.bubbleRight,"chat__bubble","chat__guestBubble"),children:R.jsx("div",{className:V(he.rightText,he.bubbleContent),children:e})})}),R2=({visible:e,rating:r,onRate:i,onClose:s})=>{const l=Pt(),[u,d]=B.useState(r),[h,p]=B.useState(void 0),[_,y]=B.useState(void 0),[b,m]=B.useState({submitted:!1,feedback:""}),[E,v]=B.useState(!1),w=B.useRef(null);B.useEffect(()=>{e?(m({submitted:!1,feedback:""}),y(e)):_===!0&&y(!1)},[e,_]),B.useEffect(()=>{d(r)},[r]),B.useEffect(()=>{const O=l(`conversation-rating.overlay.bot-message.rate-feedback.value-${u}`);p(O!=null&&O.length?O:void 0)},[u,l]),B.useEffect(()=>{b.submitted?setTimeout(()=>v(!0),b.feedback.length?500:0):v(!1)},[b]);const C=O=>{var S,k;O.preventDefault();const N=((k=(S=w.current)==null?void 0:S.value)==null?void 0:k.trim())||"";i(u,N),m({submitted:!0,feedback:N})};return R.jsx("div",{className:V(ht.rateOverlay,Cn.bottomSheet,"chat__conversationRating__overlay",{[Cn.bottomSheetOpen]:_===!0,[Cn.bottomSheetClose]:_===!1}),children:R.jsxs("form",{onSubmit:C,children:[R.jsxs("div",{className:V(ht.body,"chat__conversationRating__overlay__body"),children:[R.jsxs("div",{children:[R.jsx("h2",{children:l("conversation-rating.overlay.title")}),R.jsxs("div",{className:V(ht.starsDescriptionContainer),children:[R.jsx(kv,{value:u,size:"large",readonly:b.submitted,onChange:d}),R.jsxs("div",{className:V(ht.starsDescription),children:[R.jsx("div",{children:l("conversation-rating.overlay.star.very-bad")}),R.jsx("div",{children:l("conversation-rating.overlay.star.very-good")})]})]})]}),R.jsx("div",{className:V(ht.bubbles),children:e&&h&&R.jsxs(R.Fragment,{children:[R.jsx(mg,{isFirstMessageBySender:!0,isLastMessageBySender:!E||!!b.feedback.length,children:R.jsx("div",{children:h})}),!!b.feedback.length&&R.jsx(k2,{children:b.feedback}),E&&R.jsx(mg,{isFirstMessageBySender:!!b.feedback.length,isLastMessageBySender:!0,children:R.jsx("div",{children:l("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),R.jsxs("div",{className:V(ht.footer,"chat__conversationRating__overlay__footer"),children:[!b.submitted&&R.jsx("input",{ref:w,placeholder:l("conversation-rating.overlay.guest-feedback.input-placeholder")}),R.jsx("div",{className:V(ht.actions,"chat__conversationRating__overlay__footer__actions"),children:b.submitted?R.jsx("button",{type:"button",className:V(it.button,it.buttonPrimary),onClick:s,children:l("conversation-rating.overlay.action.close")}):R.jsx("button",{type:"submit",className:V(it.button,it.buttonPrimary),children:l("conversation-rating.overlay.action.submit")})})]})]})})},O2=({conversationRating:{enabled:e,rating:r},numberOfMessagesFromGuest:i,showRatingOverlay:s,setShowRatingOverlay:l,onRate:u})=>{const[d,h]=B.useState(0),p=b=>{h(b),l(!0)},_=()=>l(!1),y=!r&&i>=1;return e?R.jsxs(R.Fragment,{children:[R.jsx(C2,{visible:y,onRate:p}),R.jsx(R2,{visible:s,rating:d,onRate:u,onClose:_})]}):null},N2="_inputWrapper_1o8hf_5",A2="_messageInputWrapper_1o8hf_14",P2="_messageInput_1o8hf_14",I2="_buttons_1o8hf_36",D2="_button_1o8hf_36",Xr={inputWrapper:N2,messageInputWrapper:A2,messageInput:P2,buttons:I2,button:D2},M2="_audioRecorder_xps9k_5",F2="_recordButton_xps9k_10",L2="_submitButton_xps9k_37",B2="_cancelButton_xps9k_64",j2="_recorderIcon_xps9k_91",z2="_pulse_xps9k_1",U2="_spinning_xps9k_113",H2="_spin_xps9k_113",mr={audioRecorder:M2,recordButton:F2,submitButton:L2,cancelButton:B2,recorderIcon:j2,pulse:z2,spinning:U2,spin:H2},gg=2048,ea=16e3;class G2 extends xn.Component{constructor(i){super(i);we(this,"audioInput",null);we(this,"volume",null);we(this,"leftchannel",[]);we(this,"recorder",null);we(this,"recordingLength",0);we(this,"sampleRate",null);we(this,"mediaStream",null);this.state={recordingState:"none"},this.triggerAudioRecording=this.triggerAudioRecording.bind(this),this.triggerAudioRecordingSuccess=this.triggerAudioRecordingSuccess.bind(this),this.initRecording=this.initRecording.bind(this),this.processRecordingInput=this.processRecordingInput.bind(this),this.handleClickSubmitAudio=this.handleClickSubmitAudio.bind(this),this.handleClickStopAudio=this.handleClickStopAudio.bind(this)}triggerAudioRecording(){this.setState({recordingState:"connecting"}),navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(this.triggerAudioRecordingSuccess)}triggerAudioRecordingSuccess(i){this.mediaStream=i,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(i)}initRecording(i){const s=window.AudioContext||window.webkitAudioContext,l=new s;this.sampleRate=l.sampleRate,this.volume=l.createGain(),this.audioInput=l.createMediaStreamSource(i),this.audioInput.connect(this.volume),this.recorder=l.createScriptProcessor(gg,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(l.destination)}processRecordingInput(i){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const s=i.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(s)),this.recordingLength+=gg}}handleClickSubmitAudio(){const i=q2(this.leftchannel,this.recordingLength),s=V2(i,this.sampleRate||0),l=$2(s);this.props.onAudioRecorded(l),this.handleClickStopAudio()}handleClickStopAudio(){var i,s,l,u;this.setState({recordingState:"none"}),(i=this.audioInput)==null||i.disconnect(),(s=this.volume)==null||s.disconnect(),(l=this.recorder)==null||l.disconnect(),this.mediaStream&&((u=this.mediaStream)==null||u.getAudioTracks().forEach(d=>{d.stop()}))}render(){return R.jsxs("div",{className:mr.audioRecorder,children:[this.state.recordingState==="none"&&R.jsx("button",{className:V(mr.recordButton,"chat__button"),type:"submit","aria-label":this.props.translate("message-input.actions.start-audio-recording.label"),"data-title":this.props.translate("message-input.actions.start-audio-recording.label"),tabIndex:0,onClick:this.triggerAudioRecording,children:R.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.jsx("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z"}),R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&R.jsxs("svg",{className:mr.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&R.jsxs("div",{className:mr.audioRecorder,children:[R.jsx("button",{className:V(mr.cancelButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:R.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),R.jsx("div",{className:mr.recorderIcon}),R.jsx("button",{className:V(mr.submitButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:R.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),R.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const $2=e=>{const r=new ArrayBuffer(44+e.length*2),i=new DataView(r);Bs(i,0,"RIFF"),i.setUint32(4,44+e.length*2,!0),Bs(i,8,"WAVE"),Bs(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,ea,!0),i.setUint32(28,ea*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),Bs(i,36,"data"),i.setUint32(40,e.length*2,!0);const s=e.length;let l=44;const u=1;for(let d=0;d<s;d++)i.setInt16(l,e[d]*(32767*u),!0),l+=2;return new Blob([i],{type:"audio/wav"})},Bs=(e,r,i)=>{for(let s=0;s<i.length;s++)e.setUint8(r+s,i.charCodeAt(s))},q2=(e,r)=>{const i=new Float32Array(r);let s=0;const l=e.length;for(let u=0;u<l;u++){const d=e[u];i.set(d,s),s+=d.length}return i},V2=(e,r)=>{if(ea===r)return e;const i=r/ea,s=Math.round(e.length/i),l=new Float32Array(s);let u=0,d=0;for(;u<l.length;){const h=Math.round((u+1)*i);let p=0,_=0;for(let y=d;y<h&&y<e.length;y++)p+=e[y],_++;l[u]=p/_,u++,d=h}return l},W2=({speechSupport:e,transcriptExportEnabled:r,disabled:i,textInput:s,commandsVisible:l,onTextInput:u,onTextInputSubmit:d,onAudioRecorded:h,onOpenTranscriptExportModal:p})=>{const _=Pt(),y=B.useRef(null);B.useEffect(()=>{var w;(w=y.current)==null||w.focus()},[s]);const b=()=>{const w=y.current;w&&s.trim().length>=1&&d(s.trim())&&(w.value="",w.style.height="",w.focus())},m=w=>{w.preventDefault(),b()},E=w=>{const C=w.target.value;u(C),w.target.style.height="";const{scrollHeight:O}=w.target;w.target.style.height=`${O>150?150:O}px`},v=w=>{w.code==="Enter"&&!w.shiftKey?(w.repeat||b(),w.preventDefault()):l&&(w.code==="ArrowUp"||w.code==="ArrowDown")&&w.preventDefault()};return R.jsxs("form",{className:V(Xr.inputWrapper,"chat__textInput"),onSubmit:m,children:[R.jsx("div",{className:Xr.messageInputWrapper,children:R.jsx("textarea",{id:"user_input",ref:y,className:Xr.messageInput,tabIndex:0,placeholder:_("message-input-placeholder"),value:s,onChange:E,onKeyDown:v,"aria-label":_("message-input-label"),"aria-controls":"command-list","aria-haspopup":"listbox"})}),R.jsxs("div",{className:V(Xr.buttons,"chat__buttons"),children:[!s.length&&r&&R.jsx("button",{type:"button",className:V(Xr.button,"chat__button"),"aria-label":_("message-input.actions.export-transcript.label"),"data-title":_("message-input.actions.export-transcript.label"),tabIndex:0,onClick:p,children:R.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:R.jsx("path",{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"})})}),s.length||!e||navigator.mediaDevices===void 0?R.jsx("button",{className:V(Xr.button,"chat__button"),type:"submit","aria-label":_("message-input.actions.submit.label"),"data-title":_("message-input.actions.submit.label"),tabIndex:0,disabled:i,children:R.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:R.jsx("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})})}):e&&navigator.mediaDevices!==void 0&&R.jsx(G2,{translate:_,onAudioRecorded:h})]})]})},X2="_quickReplies_11l22_1",Q2="_quickReply_11l22_9",yg={quickReplies:X2,quickReply:Q2},K2=({quickReplies:e,onQuickReplyClick:r})=>e.length?R.jsx("div",{className:V(yg.quickReplies,"chat__quickReplies"),children:e.map(i=>R.jsx("button",{tabIndex:0,className:V(yg.quickReply,it.button,"chat__button","chat__quickReply"),onClick:()=>r(i),children:i.label},i.label))}):null,vg=5e3,Y2=1e3,Z2=({isBotTyping:e,quickReplies:r,speechSupport:i,transcriptExportEnabled:s,conversationRating:l,numberOfMessagesFromGuest:u,showRatingOverlay:d,commands:h,setShowRatingOverlay:p,onTextInput:_,onRate:y,onQuickReplyClick:b,onAudioRecorded:m,onOpenTranscriptExportModal:E})=>{const[v,w]=B.useState(""),[C,O]=B.useState(!1),[N,S]=B.useState(!1),k=B.useRef(),x=B.useRef(0);B.useEffect(()=>{if(C&&!e){const q=k.current?Date.now()-k.current:0;q>vg?O(!1):setTimeout(()=>{O(!1)},vg-q)}},[C,e]),B.useEffect(()=>{C&&(k.current=Date.now())},[C]);const L=q=>{const fe=Date.now()-x.current<Y2;return N?!1:e||fe?(O(!0),!1):(_(q),w(""),x.current=Date.now(),!0)},G=q=>{w(q+" ")};return R.jsxs("div",{className:V(GC.inputContainer),children:[R.jsx(K2,{quickReplies:r,onQuickReplyClick:b}),R.jsx(VC,{visible:C}),!C&&R.jsx(O2,{conversationRating:l,numberOfMessagesFromGuest:u,onRate:y,showRatingOverlay:d,setShowRatingOverlay:p}),!!(h!=null&&h.length)&&R.jsx(JC,{text:v,commands:h,onSelectCommand:G,onVisibilityChange:S}),R.jsx(W2,{textInput:v,speechSupport:i,transcriptExportEnabled:s,disabled:C,commandsVisible:N,onTextInput:w,onTextInputSubmit:L,onOpenTranscriptExportModal:E,onAudioRecorded:m})]})},J2=({clientName:e,messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:d,conversationRating:h,showGeneralConditions:p,commands:_,onMessageFromUser:y,onRate:b,onQuickReplyClick:m,onButtonClick:E,onLinkClick:v,onAudioRecorded:w,onTranscriptExport:C,onPdfExport:O,onTranscriptItemReaction:N})=>{const S=qc(),k=_r(oe=>oe.connection.connectionState),[x,L]=B.useState(!1),[G,q]=B.useState(!1),fe=d.email||d.pdf,te=r.filter(oe=>oe.sender.type===tv.GUEST).length;return B.useEffect(()=>{if(k===vr.CONNECTED){const oe=Xc.parse(window.location.search);S(ev(e,oe))}},[e,k,S]),R.jsxs("div",{children:[R.jsxs("div",{className:`${jw.chatcontent} ${x||G?it.accessabilityHidden:""}`,children:[R.jsx(bC,{messages:r,isBotTyping:s,showGeneralConditions:p,commands:_,onButtonClick:E,onLinkClick:v,onTranscriptItemReaction:N}),R.jsx(Z2,{isBotTyping:s,quickReplies:s?[]:i,numberOfMessagesFromGuest:te,speechSupport:u,transcriptExportEnabled:fe,conversationRating:x?{enabled:!1}:h,showRatingOverlay:G,setShowRatingOverlay:q,commands:_,onRate:b,onQuickReplyClick:m,onTextInput:y,onAudioRecorded:w,onOpenTranscriptExportModal:()=>L(!x)}),R.jsx(IC,{})]}),fe&&R.jsx(UC,{methods:d,visible:x,onEmailExport:C,onPdfExport:O,onClose:()=>L(!1)}),R.jsx(OC,{contentUrl:l})]})},ek=e=>{const{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:d,conversationRating:h,showGeneralConditions:p,commands:_}=e.chat;return{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:d,conversationRating:h,showGeneralConditions:p,commands:_}},tk=e=>({onRestartChat:(r,i)=>e(mf(r,i)),onMessageFromUser:r=>e(Dy(r)),onRate:(r,i)=>e(kb(r,i)),onAudioRecorded:r=>e(vb(r)),onActionFromUser:r=>e(r),onQuickReplyClick:r=>e(Iy(r)),onNluEvent:r=>e(Ly(r)),onButtonClick:r=>e(Ob(r)),onLinkClick:r=>e(Nb(r)),onTranscriptExport:r=>e(bb(r)),onPdfExport:()=>e(Tb()),onTranscriptItemReaction:(r,i)=>e(ge.transcriptItemGuestReaction(r,i||null))}),nk=K1(ek,tk)(J2),rk="_chatwindow_phukm_1",ik="_chatcontent_phukm_13",ok={chatwindow:rk,chatcontent:ik},sk="_container_ophni_2",ak="_body_ophni_8",lk="_intro_ophni_13",uk="_footer_ophni_34",ck="_startChatButton_ophni_38",fk="_formFields_ophni_42",dk="_formField_ophni_42",hk="_radio_ophni_54",pk="_checkbox_ophni_61",mk="_input_ophni_69",gk="_inputLabel_ophni_99",yk="_selectWrapper_ophni_103",vk="_select_ophni_103",_k="_selectLabel_ophni_145",pt={container:sk,body:ak,intro:lk,footer:uk,startChatButton:ck,formFields:fk,formField:dk,radio:hk,checkbox:pk,input:mk,inputLabel:gk,selectWrapper:yk,select:vk,selectLabel:_k},Ek=({name:e,label:r,defaultValue:i,required:s,onChange:l})=>{const u=d=>{l(d.currentTarget.checked?"true":"false")};return R.jsxs("label",{className:V(pt.checkbox,"chat__startScreen__checkbox"),htmlFor:e,children:[R.jsx("input",{type:"checkbox",id:e,name:e,defaultChecked:i==="true",required:s,onChange:u}),R.jsx("div",{children:r})]})},Sk=({type:e,name:r,label:i,defaultValue:s,placeholder:l,required:u,multiple:d,min:h,max:p,pattern:_,onChange:y})=>{const b=m=>{y(m.target.value)};return R.jsxs("label",{className:V(pt.input,"chat__startScreen__input"),htmlFor:r,children:[R.jsx("div",{className:V(pt.inputLabel),children:i}),R.jsx("input",{type:e,id:r,name:r,defaultValue:s,placeholder:l,required:u,multiple:d,min:h,max:p,pattern:_,onChange:b})]})},bk=({name:e,value:r,label:i,defaultChecked:s,required:l,onChange:u})=>{const d=`${e}-${r}`,h=p=>{u(p.target.value)};return R.jsxs("label",{className:V(pt.radio,"chat__startScreen__radio"),htmlFor:d,children:[R.jsx("input",{id:d,type:"radio",name:e,value:r,defaultChecked:s,required:l,onChange:h}),R.jsx("span",{className:V(pt.label),children:i})]})},wk=({name:e,label:r,defaultValue:i,required:s,multiple:l,options:u,onChange:d})=>{const h=p=>{d(p.target.value)};return R.jsxs("label",{className:V(pt.select,"chat__startScreen__select"),htmlFor:e,children:[R.jsx("div",{className:V(pt.selectLabel),children:r}),R.jsx("div",{className:V(pt.selectWrapper),children:R.jsx("select",{id:e,name:e,defaultValue:i,required:s,multiple:l,onChange:h,children:Object.entries(u||{}).map(([p,_])=>R.jsx("option",{value:p,selected:_===i,children:_}))})})]})},xk="start-screen.intro",Tk="start-screen.start-chat",Yt="start-screen.form",_g=`${Yt}.fields`,Ck=()=>{const e=Pt(),r=qc(),[i,s]=B.useState({}),l=()=>{const y=Object.entries(i).reduce((b,[m,E])=>({...b,[m]:E.value}),{});r(yw(y))},u=e(xk),d=e(Tk),h=B.useMemo(()=>{var y;return((y=e(_g))==null?void 0:y.split(";").map(b=>b.trim()))??[]},[e(_g)]);B.useEffect(()=>{h.length&&Object.keys(i).length===0&&s(h.reduce((y,b)=>({...y,[b]:Rk(b,e)}),{}))},[e,h,i]);const p=y=>{y.preventDefault(),l()},_=y=>b=>{s(m=>({...m,[y]:{...m[y],value:b}}))};return R.jsxs("form",{onSubmit:p,className:V(pt.container,"chat__startScreen"),children:[R.jsxs("div",{className:V(pt.body,"chat__startScreen__body"),children:[u&&R.jsx("div",{className:V(pt.intro,"chat__startScreen__intro"),children:R.jsx(Yn,{options:{overrides:{a:kk}},children:u})}),R.jsx("div",{className:V(pt.formFields,"chat__startScreen__fields"),children:Object.values(i).map(({type:y,name:b,label:m,placeholder:E,defaultValue:v,options:w,required:C,multiple:O,min:N,max:S,pattern:k})=>R.jsx("div",{className:V(pt.formField,"chat__startScreen__field"),children:(()=>{switch(y){case"radio":return R.jsxs(R.Fragment,{children:[R.jsx("div",{children:m}),Object.entries(w||{}).map(([x,L])=>R.jsx(bk,{name:b,value:x,label:L,defaultChecked:x===v,required:C,onChange:_(b)}))]});case"checkbox":return R.jsx(Ek,{name:b,label:m,defaultValue:v,required:C,onChange:_(b)});case"select":return R.jsx(wk,{name:b,label:m,defaultValue:v,required:C,multiple:O,options:w,onChange:_(b)});default:return R.jsx(Sk,{type:y,name:b,label:m,placeholder:E,defaultValue:v,required:C,multiple:O,min:N,max:S,pattern:k,onChange:_(b)})}})()},b))})]}),R.jsx("div",{className:V(pt.footer,"chat__startScreen__footer"),children:R.jsx("button",{type:"submit",className:V(it.button,it.buttonPrimary,pt.startChatButton),children:d})})]})},kk=({title:e,href:r,children:i})=>R.jsx("a",{href:r,title:e,target:"_blank",rel:"noopener noreferrer",children:i}),Rk=(e,r)=>{const i=r(`${Yt}.${e}.type`)||"text",s=r(`${Yt}.${e}.required`)==="true",l=r(`${Yt}.${e}.multiple`)==="true",u=r(`${Yt}.${e}.placeholder`),d=r(`${Yt}.${e}.label`)||"",h=r(`${Yt}.${e}.defaultValue`),p=r(`${Yt}.${e}.min`),_=r(`${Yt}.${e}.max`),y=r(`${Yt}.${e}.pattern`),b=Nk(r(`${Yt}.${e}.options`));return{name:e,label:d,placeholder:u,value:Ok(i,h,b)||"",defaultValue:h,options:b,type:i,required:s,multiple:l,min:p,max:_,pattern:y}},Ok=(e,r,i)=>r||e==="select"&&Object.keys(i)[0]||"",Nk=(e="")=>e.split(";").map(r=>r.trim()).reduce((r,i)=>{const[s,l]=i.split(":").map(u=>u.trim());return{...r,[s]:l}},{}),Ak=()=>{const e=ra();B.useEffect(()=>{window.document.documentElement.lang=e.locale},[e.locale])},Qr={TRIGGER_ACTION:"TRIGGER_ACTION",TRIGGER_STORY:"TRIGGER_STORY",CHAT_MESSAGE_FROM_GUEST:"CHAT_MESSAGE_FROM_GUEST",ON_CHAT_WINDOW_OPEN:"ON_CHAT_WINDOW_OPEN",ON_CHAT_WINDOW_CLOSE:"ON_CHAT_WINDOW_CLOSE",RESTART_CHAT:"RESTART_CHAT"},Pk=({clientName:e})=>{Ak();const r=qc(),i=_r(y=>y.intl.messages),s=Pt(),l=_r(y=>y.startScreen.useStartScreen),u=_r(y=>y.startScreen.startScreenStatus),[d,h]=B.useState(void 0);B.useEffect(()=>{const y=Xc.parse(window.location.search);y.cssClassName&&h(y.cssClassName);const b=m=>{switch(m.data.type){case Qr.TRIGGER_ACTION:r(m.data.action);break;case Qr.TRIGGER_STORY:r(Ly(m.data.story));break;case Qr.ON_CHAT_WINDOW_OPEN:r({type:"webclient.chatwindow.opened"});break;case Qr.ON_CHAT_WINDOW_CLOSE:r({type:"webclient.chatwindow.closed"});break;case Qr.CHAT_MESSAGE_FROM_GUEST:r(Dy(m.data.text));break;case Qr.RESTART_CHAT:r(mf(e,y));break}};return r(Cw(e,y)),window.addEventListener("message",m=>b(m),!1),()=>window.removeEventListener("message",b)},[e,r]),B.useEffect(()=>{const y=s("header.restart-chat"),b=s("header.close-chat");r(Ab({header:{restartChat:y,closeChat:b}}))},[i,r,s]);const p=l===void 0,_=l===!1||u==="HIDDEN";return R.jsx("div",{className:V(ok.chatwindow,"chat__chatwindow",d),children:p?null:_?R.jsx(nk,{clientName:e}):R.jsx(Ck,{})})},Ik=()=>{const e=wy(),r=_r(s=>s.intl.locale),i=_r(s=>s.intl.messages);return R.jsx(PS,{locale:r,messages:i,children:R.jsx("div",{className:DS.app,children:R.jsx(Pk,{clientName:e})})})};var Gu,Eg;function vf(){if(Eg)return Gu;Eg=1;function e(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}return Gu=e,Gu}var $u,Sg;function Dk(){if(Sg)return $u;Sg=1;var e=typeof hs=="object"&&hs&&hs.Object===Object&&hs;return $u=e,$u}var qu,bg;function Rv(){if(bg)return qu;bg=1;var e=Dk(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=e||r||Function("return this")();return qu=i,qu}var Vu,wg;function Mk(){if(wg)return Vu;wg=1;var e=Rv(),r=function(){return e.Date.now()};return Vu=r,Vu}var Wu,xg;function Fk(){if(xg)return Wu;xg=1;var e=/\s/;function r(i){for(var s=i.length;s--&&e.test(i.charAt(s)););return s}return Wu=r,Wu}var Xu,Tg;function Lk(){if(Tg)return Xu;Tg=1;var e=Fk(),r=/^\s+/;function i(s){return s&&s.slice(0,e(s)+1).replace(r,"")}return Xu=i,Xu}var Qu,Cg;function Ov(){if(Cg)return Qu;Cg=1;var e=Rv(),r=e.Symbol;return Qu=r,Qu}var Ku,kg;function Bk(){if(kg)return Ku;kg=1;var e=Ov(),r=Object.prototype,i=r.hasOwnProperty,s=r.toString,l=e?e.toStringTag:void 0;function u(d){var h=i.call(d,l),p=d[l];try{d[l]=void 0;var _=!0}catch{}var y=s.call(d);return _&&(h?d[l]=p:delete d[l]),y}return Ku=u,Ku}var Yu,Rg;function jk(){if(Rg)return Yu;Rg=1;var e=Object.prototype,r=e.toString;function i(s){return r.call(s)}return Yu=i,Yu}var Zu,Og;function zk(){if(Og)return Zu;Og=1;var e=Ov(),r=Bk(),i=jk(),s="[object Null]",l="[object Undefined]",u=e?e.toStringTag:void 0;function d(h){return h==null?h===void 0?l:s:u&&u in Object(h)?r(h):i(h)}return Zu=d,Zu}var Ju,Ng;function Uk(){if(Ng)return Ju;Ng=1;function e(r){return r!=null&&typeof r=="object"}return Ju=e,Ju}var ec,Ag;function Hk(){if(Ag)return ec;Ag=1;var e=zk(),r=Uk(),i="[object Symbol]";function s(l){return typeof l=="symbol"||r(l)&&e(l)==i}return ec=s,ec}var tc,Pg;function Gk(){if(Pg)return tc;Pg=1;var e=Lk(),r=vf(),i=Hk(),s=NaN,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,d=/^0o[0-7]+$/i,h=parseInt;function p(_){if(typeof _=="number")return _;if(i(_))return s;if(r(_)){var y=typeof _.valueOf=="function"?_.valueOf():_;_=r(y)?y+"":y}if(typeof _!="string")return _===0?_:+_;_=e(_);var b=u.test(_);return b||d.test(_)?h(_.slice(2),b?2:8):l.test(_)?s:+_}return tc=p,tc}var nc,Ig;function $k(){if(Ig)return nc;Ig=1;var e=vf(),r=Mk(),i=Gk(),s="Expected a function",l=Math.max,u=Math.min;function d(h,p,_){var y,b,m,E,v,w,C=0,O=!1,N=!1,S=!0;if(typeof h!="function")throw new TypeError(s);p=i(p)||0,e(_)&&(O=!!_.leading,N="maxWait"in _,m=N?l(i(_.maxWait)||0,p):m,S="trailing"in _?!!_.trailing:S);function k(ue){var ze=y,Pe=b;return y=b=void 0,C=ue,E=h.apply(Pe,ze),E}function x(ue){return C=ue,v=setTimeout(q,p),O?k(ue):E}function L(ue){var ze=ue-w,Pe=ue-C,$e=p-ze;return N?u($e,m-Pe):$e}function G(ue){var ze=ue-w,Pe=ue-C;return w===void 0||ze>=p||ze<0||N&&Pe>=m}function q(){var ue=r();if(G(ue))return fe(ue);v=setTimeout(q,L(ue))}function fe(ue){return v=void 0,S&&y?k(ue):(y=b=void 0,E)}function te(){v!==void 0&&clearTimeout(v),C=0,y=w=b=v=void 0}function oe(){return v===void 0?E:fe(r())}function pe(){var ue=r(),ze=G(ue);if(y=arguments,b=this,w=ue,ze){if(v===void 0)return x(w);if(N)return clearTimeout(v),v=setTimeout(q,p),k(w)}return v===void 0&&(v=setTimeout(q,p)),E}return pe.cancel=te,pe.flush=oe,pe}return nc=d,nc}var rc,Dg;function qk(){if(Dg)return rc;Dg=1;var e=$k(),r=vf(),i="Expected a function";function s(l,u,d){var h=!0,p=!0;if(typeof l!="function")throw new TypeError(i);return r(d)&&(h="leading"in d?!!d.leading:h,p="trailing"in d?!!d.trailing:p),e(l,u,{leading:h,maxWait:u,trailing:p})}return rc=s,rc}var Vk=qk();const Wk=ta(Vk);var ic,Mg;function Xk(){if(Mg)return ic;Mg=1;function e(E,v){var w,C;if(typeof v=="function")C=v(E),C!==void 0&&(E=C);else if(Array.isArray(v))for(w=0;w<v.length;w++)C=v[w](E),C!==void 0&&(E=C);return E}function r(E,v){return E[0]==="-"&&Array.isArray(v)&&/^-\d+$/.test(E)?v.length+parseInt(E,10):E}function i(E){return/^\d+$/.test(E)}function s(E){return Object.prototype.toString.call(E)==="[object Object]"}function l(E){return Object(E)===E}function u(E){return Object.keys(E).length===0}var d=["__proto__","prototype","constructor"],h=function(E){return d.indexOf(E)===-1};function p(E,v){E.indexOf("[")>=0&&(E=E.replace(/\[/g,v).replace(/]/g,""));var w=E.split(v),C=w.filter(h);if(C.length!==w.length)throw Error("Refusing to update blacklisted property "+E);return w}var _=Object.prototype.hasOwnProperty;function y(E,v,w,C){if(!(this instanceof y))return new y(E,v,w,C);typeof v>"u"&&(v=!1),typeof w>"u"&&(w=!0),typeof C>"u"&&(C=!0),this.separator=E||".",this.override=v,this.useArray=w,this.useBrackets=C,this.keepArray=!1,this.cleanup=[]}var b=new y(".",!1,!0,!0);function m(E){return function(){return b[E].apply(b,arguments)}}return y.prototype._fill=function(E,v,w,C){var O=E.shift();if(E.length>0){if(v[O]=v[O]||(this.useArray&&i(E[0])?[]:{}),!l(v[O]))if(this.override)v[O]={};else{if(!(l(w)&&u(w)))throw new Error("Trying to redefine `"+O+"` which is a "+typeof v[O]);return}this._fill(E,v[O],w,C)}else{if(!this.override&&l(v[O])&&!u(v[O])){if(!(l(w)&&u(w)))throw new Error("Trying to redefine non-empty obj['"+O+"']");return}v[O]=e(w,C)}},y.prototype.object=function(E,v){var w=this;return Object.keys(E).forEach(function(C){var O=v===void 0?null:v[C],N=p(C,w.separator).join(w.separator);N.indexOf(w.separator)!==-1?(w._fill(N.split(w.separator),E,E[C],O),delete E[C]):E[C]=e(E[C],O)}),E},y.prototype.str=function(E,v,w,C){var O=p(E,this.separator).join(this.separator);return E.indexOf(this.separator)!==-1?this._fill(O.split(this.separator),w,v,C):w[E]=e(v,C),w},y.prototype.pick=function(E,v,w,C){var O,N,S,k,x;for(N=p(E,this.separator),O=0;O<N.length;O++)if(k=r(N[O],v),v&&typeof v=="object"&&k in v){if(O===N.length-1)return w?(S=v[k],C&&Array.isArray(v)?v.splice(k,1):delete v[k],Array.isArray(v)&&(x=N.slice(0,-1).join("."),this.cleanup.indexOf(x)===-1&&this.cleanup.push(x)),S):v[k];v=v[k]}else return;return w&&Array.isArray(v)&&(v=v.filter(function(L){return L!==void 0})),v},y.prototype.delete=function(E,v){return this.remove(E,v,!0)},y.prototype.remove=function(E,v,w){var C;if(this.cleanup=[],Array.isArray(E)){for(C=0;C<E.length;C++)this.pick(E[C],v,!0,w);return w||this._cleanup(v),v}else return this.pick(E,v,!0,w)},y.prototype._cleanup=function(E){var v,w,C,O;if(this.cleanup.length){for(w=0;w<this.cleanup.length;w++)C=this.cleanup[w].split("."),O=C.splice(0,-1).join("."),v=O?this.pick(O,E):E,v=v[C[0]].filter(function(N){return N!==void 0}),this.set(this.cleanup[w],v,E);this.cleanup=[]}},y.prototype.del=y.prototype.remove,y.prototype.move=function(E,v,w,C,O){return typeof C=="function"||Array.isArray(C)?this.set(v,e(this.pick(E,w,!0),C),w,O):(O=C,this.set(v,this.pick(E,w,!0),w,O)),w},y.prototype.transfer=function(E,v,w,C,O,N){return typeof O=="function"||Array.isArray(O)?this.set(v,e(this.pick(E,w,!0),O),C,N):(N=O,this.set(v,this.pick(E,w,!0),C,N)),C},y.prototype.copy=function(E,v,w,C,O,N){return typeof O=="function"||Array.isArray(O)?this.set(v,e(JSON.parse(JSON.stringify(this.pick(E,w,!1))),O),C,N):(N=O,this.set(v,this.pick(E,w,!1),C,N)),C},y.prototype.set=function(E,v,w,C){var O,N,S,k;if(typeof v>"u")return w;for(S=p(E,this.separator),O=0;O<S.length;O++){if(k=S[O],O===S.length-1)if(C&&s(v)&&s(w[k]))for(N in v)_.call(v,N)&&(w[k][N]=v[N]);else if(C&&Array.isArray(w[k])&&Array.isArray(v))for(var x=0;x<v.length;x++)w[S[O]].push(v[x]);else w[k]=v;else(!_.call(w,k)||!s(w[k])&&!Array.isArray(w[k]))&&(/^\d+$/.test(S[O+1])?w[k]=[]:w[k]={});w=w[k]}return w},y.prototype.transform=function(E,v,w){return v=v||{},w=w||{},Object.keys(E).forEach((function(C){this.set(E[C],this.pick(C,v),w)}).bind(this)),w},y.prototype.dot=function(E,v,w){v=v||{},w=w||[];var C=Array.isArray(E);return Object.keys(E).forEach((function(O){var N=C&&this.useBrackets?"["+O+"]":O;if(l(E[O])&&(s(E[O])&&!u(E[O])||Array.isArray(E[O])&&!this.keepArray&&E[O].length!==0))if(C&&this.useBrackets){var S=w[w.length-1]||"";return this.dot(E[O],v,w.slice(0,-1).concat(S+N))}else return this.dot(E[O],v,w.concat(N));else C&&this.useBrackets?v[w.join(this.separator).concat("["+O+"]")]=E[O]:v[w.concat(N).join(this.separator)]=E[O]}).bind(this)),v},y.pick=m("pick"),y.move=m("move"),y.transfer=m("transfer"),y.transform=m("transform"),y.copy=m("copy"),y.object=m("object"),y.str=m("str"),y.set=m("set"),y.delete=m("delete"),y.del=y.remove=m("remove"),y.dot=m("dot"),["override","overwrite"].forEach(function(E){Object.defineProperty(y,E,{get:function(){return b.override},set:function(v){b.override=!!v}})}),["useArray","keepArray","useBrackets"].forEach(function(E){Object.defineProperty(y,E,{get:function(){return b[E]},set:function(v){b[E]=v}})}),y._process=e,ic=y,ic}var Qk=Xk();const Nv={"message-input-label":"Benutzereingabe","message-input-placeholder":"Nachricht","message-input.actions.submit.label":"Nachricht senden","message-input.actions.export-transcript.label":"Konversation exportieren","message-input.actions.start-audio-recording.label":"Spracheingabe starten","message-input.actions.stop-audio-recording.label":"Spracheingabe stoppen","message-input.actions.submit-audio-recording.label":"Spracheingabe übermitteln","guest-bubble.label":"Ihre Nachricht","bot-bubble.label":"Nachricht des Chatbots","bot-bubble.reaction.good":"Gefällt mir","bot-bubble.reaction.bad":"Gefällt mir nicht","bot-bubble.reaction.remove":"Markierung entfernen","bot-bubble.copy":"Kopieren","agent-bubble.label":"Nachricht des Live-Agenten","export-transcript.email.title":"Konversation per E-Mail versenden","export-transcript.email.description":"Geben Sie Ihre E-Mail-Adresse ein, um den Chatverlauf zu erhalten.","export-transcript.email.cancel":"Abbrechen","export-transcript.email.send":"Senden","export-transcript.email.placeholder":"Ihre E-Mail-Adresse","export-transcript.email.invalid":"Bitte gültige E-Mail-Adresse eingeben.","export-transcript.email.success":"Ich habe den Chatverlauf an Ihre E-Mail-Adresse gesendet.","export-transcript.pdf.title":"Konversation als PDF erhalten","export-transcript.pdf.description":"Laden Sie die Konversation als PDF herunter.","export-transcript.pdf.cancel":"Abbrechen","export-transcript.pdf.download":"Herunterladen","general-conditions.header":"**Nutzungsbedingungen**","general-conditions.body":`Bitte berücksichtigen Sie die folgenden Punkte:
|
|
97
|
+
`).map((h,p)=>R.jsxs("span",{className:cg.text,children:[R.jsx(eC,{componentDecorator:l,children:h}),R.jsx("br",{})]},p))]})},rC=({subtitle:e,onLinkClick:r})=>e?R.jsx("div",{className:St.subtitle,children:R.jsx(Tv,{text:e,onLinkClick:r})}):null,fg="newtab#",Cv=({markdown:e,onLinkClick:r})=>{const i=l=>u=>(u.preventDefault(),l&&r(l),!1),s=({title:l,href:u,children:d})=>u.indexOf(fg)===0?R.jsx("a",{href:u.slice(fg.length),title:l,target:"_blank",rel:"noopener noreferrer",children:d}):R.jsx("a",{onClick:i(u),title:l,href:u,children:d});return R.jsx(Yn,{options:{overrides:{a:s}},children:e})},iC=({text:e,onLinkClick:r})=>e?R.jsx("div",{children:R.jsx(Cv,{markdown:e,onLinkClick:r})}):null,oC=({title:e})=>e?R.jsx("h1",{className:St.title,children:e}):null,sC=({title:e,text:r,subtitle:i,buttons:s,onButtonClick:l,onLinkClick:u})=>(e==null?void 0:e.length)||(r==null?void 0:r.length)||(i==null?void 0:i.length)||(s==null?void 0:s.length)?R.jsxs("div",{className:V(he.bubbleContent),children:[R.jsx(oC,{title:e}),R.jsx(iC,{text:r,onLinkClick:u}),R.jsx(rC,{subtitle:i,onLinkClick:u}),R.jsx(jT,{buttons:s,onButtonClick:l})]}):null,aC=({alt:e,imageUrl:r,itemUrl:i,hasBody:s})=>r?i?i.indexOf("youtube.com")>-1?R.jsx("div",{className:St.video_container,children:R.jsx("iframe",{className:V(St.video,{[St.only]:!s}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):R.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:R.jsx("div",{className:St.imageContainer,children:R.jsx("img",{className:V(St.image,{[St.only]:!s}),src:r,alt:e})})}):R.jsx("div",{className:St.imageContainer,children:R.jsx("img",{className:V(St.image,{[St.only]:!s}),src:r,alt:e})}):null,lC=({title:e,text:r,subtitle:i,imageUrl:s,itemUrl:l,buttons:u,onButtonClick:d,onLinkClick:h})=>{const p=!!(e!=null&&e.length)||!!(r!=null&&r.length)||!!(i!=null&&i.length)||!!(u!=null&&u.length);return R.jsxs("div",{className:V(St.detailMessage),children:[R.jsx(aC,{hasBody:p,imageUrl:s,itemUrl:l,alt:e||i}),p&&R.jsx(sC,{title:e,text:r,subtitle:i,buttons:u,onLinkClick:h,onButtonClick:d})]})},uC=B.forwardRef(({isFirstMessageBySender:e,isLastMessageBySender:r,children:i},s)=>{const l=Pt();return R.jsx("li",{ref:s,className:V(he.message,he.messageGuest,e&&he.messageGuestFirst,r&&he.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",e&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:R.jsx("div",{className:V(he.bubble,he.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":l("guest-bubble.label"),children:R.jsx("div",{className:V(he.rightText),children:i})})})}),cC=({markdown:e,className:r,onLinkClick:i})=>R.jsx("div",{className:V(he.bubbleContent,r),children:R.jsx(Cv,{markdown:e,onLinkClick:i})}),fC=({text:e,commands:r,onLinkClick:i})=>R.jsx("div",{className:he.bubbleContent,children:R.jsx(Tv,{text:e,commands:r,onLinkClick:i})}),dC=B.forwardRef(({message:e,commands:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:l,onReaction:u,onButtonClick:d,onLinkClick:h},p)=>{const _=hC(e,r,d,h);switch(e.sender.type){case ge.UserType.GUEST:return R.jsx(uC,{ref:p,isFirstMessageBySender:s,isLastMessageBySender:l,children:_});default:{const y=b=>u(e._id,b);return R.jsx(xv,{ref:p,message:e,isAnimated:!1,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:l,onReaction:y,children:_})}}}),hC=(e,r,i,s)=>{switch(e.type){case ge.MessageTypeEnum.TEXT:{const l=e;return R.jsx(fC,{text:l.text,commands:r,onLinkClick:s})}case ge.MessageTypeEnum.DETAIL:{const l=e;return R.jsx(lC,{title:l.title,text:l.text,subtitle:l.subtitle,imageUrl:l.imageUrl,itemUrl:l.itemUrl,buttons:l.buttons,onButtonClick:i,onLinkClick:s})}case ge.MessageTypeEnum.MARKDOWN:{const l=e;return R.jsx(cC,{markdown:l.markdown,className:l.className,onLinkClick:s})}}},pC=(e,r)=>e.message._id===r.message._id&&e.message.reaction===r.message.reaction&&e.isLastMessage===r.isLastMessage&&e.isFirstMessageBySender===r.isFirstMessageBySender&&e.isLastMessageBySender===r.isLastMessageBySender,mC=xn.memo(dC,pC),gC="_ticontainer_wftg7_1",yC="_tiblock_wftg7_5",vC="_tidot_wftg7_12",_C="_mercuryTypingAnimation_wftg7_1",Xi={ticontainer:gC,tiblock:yC,tidot:vC,mercuryTypingAnimation:_C},EC=({isTyping:e=!1})=>R.jsx("div",{className:Xi.ticontainer,children:R.jsx("div",{className:Xi.tiblock,children:e?R.jsxs(R.Fragment,{children:[R.jsx("div",{className:V(Xi.tidot,"chat__typingIndicator")}),R.jsx("div",{className:V(Xi.tidot,"chat__typingIndicator")}),R.jsx("div",{className:V(Xi.tidot,"chat__typingIndicator")})]}):null})}),SC=Object.assign({_id:"typing-indicator"},new ge.TextMessage("",new ge.BotUser)),bC=({messages:e,isBotTyping:r,showGeneralConditions:i,commands:s,onTranscriptItemReaction:l,onButtonClick:u,onLinkClick:d})=>{const h=B.useRef(0),p=B.useRef(!0),_=B.useRef(null),y=B.useRef(null),b=B.useRef(null);B.useLayoutEffect(()=>{if(e.length&&_.current&&(h.current<e.length||r)){if(y.current){const v=y.current.offsetTop;_.current.scrollTop=v}else if(b.current){const v=b.current.offsetTop;_.current.scrollTop=v}p.current&&(p.current=!1),h.current=e.length}},[e,p,r]);let m;const E=e.length;return R.jsxs("div",{ref:_,className:V(zm.messageContainer,"chat__messageContainer"),style:{scrollBehavior:e.length&&p.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[i&&R.jsx(sT,{}),R.jsxs("ul",{className:zm.messages,children:[e.map((v,w)=>{const C=wC(v,m),O=xC(v,w,e,r);m=v.sender.type;const N=w+1===E;return R.jsx(mC,{ref:N?b:null,message:v,commands:s,isLastMessage:N,isFirstMessageBySender:C,isLastMessageBySender:O,onButtonClick:u,onLinkClick:d,onReaction:l},N&&!r?"last":v._id)}),r&&R.jsx(xv,{ref:y,message:SC,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:m!==ge.UserType.BOT,isLastMessageBySender:!0,children:R.jsx(EC,{isTyping:!0})},"last")]})]})},wC=(e,r)=>!r||r!==e.sender.type,xC=(e,r,i,s)=>{var h;const l=e.sender.type,u=i.length;return r+1===u?!(l===ge.UserType.BOT&&s):l!==((h=i.at(r+1))==null?void 0:h.sender.type)},TC="_bottomSheet_8itd6_1",CC="_bottomSheetOpen_8itd6_15",kC="_bottomSheetClose_8itd6_20",Cn={bottomSheet:TC,bottomSheetOpen:CC,"slide-in":"_slide-in_8itd6_1",bottomSheetClose:kC,"slide-out":"_slide-out_8itd6_1"},RC="_container_ooyn8_1",dg={container:RC},OC=({contentUrl:e})=>{const r=_r(u=>u.connection.sessionId),[i,s]=B.useState(!1);B.useEffect(()=>{s(u=>u||!!e)},[e]);const l=B.useMemo(()=>{if(e&&r){const u=new URL(e,document.baseURI);return u.searchParams.set("sessionId",r),u.toString()}else return},[e,r]);return R.jsx("div",{className:V(dg.container,Cn.bottomSheet,{[Cn.bottomSheetOpen]:!!e,[Cn.bottomSheetClose]:i&&!e}),children:l&&R.jsx("iframe",{title:"Drawer",src:l,className:dg.iframe})})},NC="_container_t5oqt_1",AC={container:NC},PC=({title:e,href:r,children:i})=>R.jsx("a",{href:r,title:e,target:"_blank",rel:"noopener noreferrer",children:i}),IC=()=>{const r=Pt()("powered-by");return r&&r.length?R.jsx("div",{className:V(AC.container,"chat__poweredBy"),children:R.jsx(Yn,{options:{overrides:{a:PC}},children:r})}):null},DC="_container_rkqaf_1",MC="_formContainer_rkqaf_14",FC="_emailInput_rkqaf_19",LC="_description_rkqaf_48",BC="_actions_rkqaf_53",jC="_validationError_rkqaf_63",zC="_submitted_rkqaf_70",bn={container:DC,formContainer:MC,emailInput:FC,description:LC,actions:BC,validationError:jC,submitted:zC},UC=({visible:e,methods:r,onEmailExport:i,onPdfExport:s,onClose:l})=>{const u=Pt(),[d,h]=B.useState(void 0),[p,_]=B.useState(!1),[y,b]=B.useState(!1),[m,E]=B.useState(void 0),v=B.useRef(null);B.useEffect(()=>{var N;e?((N=v.current)==null||N.focus(),_(!1),b(!1),h(e)):d===!0&&h(!1)},[e,d]);const w=N=>{N.preventDefault(),m&&m.length>0&&(i(m),_(!0),setTimeout(l,3*1e3))},C=N=>{const S=N.target.value.trim(),k=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(S);E(k?S:"")},O=()=>{b(!0),s(),setTimeout(l,3*1e3)};return R.jsxs("div",{className:V(bn.container,Cn.bottomSheet,{[Cn.bottomSheetOpen]:d===!0,[Cn.bottomSheetClose]:d===!1}),children:[r.pdf&&R.jsxs(R.Fragment,{children:[R.jsx("h2",{children:u("export-transcript.pdf.title")}),R.jsx(Yn,{className:bn.description,children:u("export-transcript.pdf.description")||""}),R.jsxs("div",{className:bn.actions,children:[R.jsx("button",{type:"button",className:V(it.button,it.buttonDefault),onClick:l,children:u("export-transcript.pdf.cancel")}),R.jsx("button",{className:V(it.button,it.buttonPrimary),onClick:O,disabled:y,children:u("export-transcript.pdf.download")})]})]}),r.email&&R.jsxs(R.Fragment,{children:[R.jsx("h2",{children:u("export-transcript.email.title")}),R.jsx(Yn,{className:bn.description,children:u("export-transcript.email.description")||""}),R.jsxs("form",{onSubmit:w,className:bn.formContainer,children:[R.jsxs("div",{children:[R.jsx("input",{disabled:p,ref:v,type:"email",placeholder:u("export-transcript.email.placeholder"),className:bn.emailInput,onChange:C}),(m==null?void 0:m.length)===0?R.jsx("div",{className:bn.validationError,children:u("export-transcript.email.invalid")}):null]}),R.jsxs("div",{className:bn.actions,children:[R.jsx("button",{type:"button",className:V(it.button,it.buttonDefault),onClick:l,children:u("export-transcript.email.cancel")}),R.jsx("button",{type:"submit",disabled:p||m===void 0||m.length===0,className:V(it.button,it.buttonPrimary),children:u("export-transcript.email.send")})]})]}),p&&R.jsx("div",{className:bn.submitted,children:u("export-transcript.email.success")})]})]})},HC="_inputContainer_1px77_1",GC={inputContainer:HC},$C="_blockUserInput_rv0dg_1",qC={blockUserInput:$C,"append-animate":"_append-animate_rv0dg_1"},VC=({visible:e})=>{const r=Pt();return e?R.jsx("div",{className:V(qC.blockUserInput,"chat__blockUserInput"),children:r("block-user-input.title")}):null},WC="_container_1613s_1",XC="_commands_1613s_5",QC="_command_1613s_5",KC="_commandActive_1613s_47",Ls={container:WC,commands:XC,command:QC,commandActive:KC},YC=(e,r)=>{B.useEffect(()=>{const i=s=>{e.current&&!e.current.contains(s.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[e,r])},ZC=(e,r,i,s,l)=>{B.useEffect(()=>{const u=d=>{if(e.length)switch(d.key){case"Enter":i(e[r]);break;case"ArrowUp":s(h=>h>0?h-1:e.length-1);break;case"ArrowDown":s(h=>h<e.length-1?h+1:0);break;case"Escape":l([]);break}};return document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}},[e,r,i,s,l])},JC=({text:e,commands:r,onSelectCommand:i,onVisibilityChange:s})=>{const l=B.useRef(null),u=Pt(),[d,h]=B.useState([]),[p,_]=B.useState(hg(r)),[y,b]=B.useState(0),m=E=>i(`/${E}`);return YC(l,()=>h([])),ZC(d,y,m,b,h),B.useEffect(()=>{_(hg(r))},[r]),B.useEffect(()=>{const E=e.length||0;E===0||E>p||!e.startsWith("/")?h([]):h(r.filter(e2(e))),b(0)},[r,e,p]),B.useEffect(()=>{s(!!d.length)},[d,s]),d.length?R.jsx("div",{ref:l,className:Ls.container,children:R.jsx("ul",{className:Ls.commands,role:"listbox",children:d.map((E,v)=>R.jsxs("li",{className:V([Ls.command,y===v&&Ls.commandActive]),role:"option",onClick:()=>m(E),onMouseOver:()=>b(v),children:[R.jsxs("h1",{children:["/",E]}),R.jsx("p",{children:u(`commands.${E}`)})]},E))})}):null},hg=e=>Math.max(...e.map(r=>r.length+1)),e2=e=>r=>{const i=`/${r}`;return i.startsWith(e)&&i.length>=e.length},t2="_callToActionContainer_czz0p_1",n2="_callToActionTitle_czz0p_24",r2="_rateOverlay_czz0p_31",i2="_body_czz0p_50",o2="_footer_czz0p_58",s2="_actions_czz0p_73",a2="_bubbles_czz0p_85",l2="_rateFeedbackBotBubble_czz0p_112",u2="_rateFeedbackGuestBubble_czz0p_118",c2="_avatar_czz0p_124",f2="_fadeInLeft_czz0p_1",d2="_bubble_czz0p_85",h2="_appear_czz0p_1",p2="_botBubble_czz0p_150",m2="_guestBubble_czz0p_160",g2="_rateText_czz0p_176",y2="_stars_czz0p_181",v2="_starsSmall_czz0p_194",_2="_starsLarge_czz0p_198",E2="_star_czz0p_181",S2="_starReadonly_czz0p_215",b2="_starIcon_czz0p_223",w2="_starsDescriptionContainer_czz0p_241",x2="_starsDescription_czz0p_241",ht={callToActionContainer:t2,"append-animate":"_append-animate_czz0p_1",callToActionTitle:n2,rateOverlay:r2,body:i2,footer:o2,actions:s2,bubbles:a2,rateFeedbackBotBubble:l2,rateFeedbackGuestBubble:u2,avatar:c2,fadeInLeft:f2,bubble:d2,appear:h2,botBubble:p2,guestBubble:m2,rateText:g2,stars:y2,starsSmall:v2,starsLarge:_2,star:E2,starReadonly:S2,starIcon:b2,starsDescriptionContainer:w2,starsDescription:x2},T2=({value:e,index:r,count:i,readonly:s,onHover:l,onClick:u})=>{const d=h=>{u&&h.key==="Enter"&&u()};return R.jsx("li",{className:V(ht.star,{[ht.starReadonly]:s},"chat__conversationRating__star"),children:R.jsx("div",{role:"radio","aria-checked":e>r?"true":"false","aria-posinset":r+1,"aria-setsize":i,tabIndex:0,onMouseOver:l,onKeyDown:d,onClick:u,children:R.jsx("span",{role:"img","aria-label":"Star",className:V(ht.starIcon),children:R.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:R.jsx("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"})})})})})},pg=5,kv=({value:e,size:r,readonly:i=!1,onChange:s})=>{const[l,u]=B.useState(void 0),d=()=>{u(void 0)},h=_=>()=>{if(!i){const y=_+1;u(y)}},p=_=>()=>{s&&!i&&(s(_===0&&e===1?0:_+1),u(void 0))};return R.jsx("ul",{tabIndex:0,role:"radiogroup",className:V(ht.stars,{[ht.starsSmall]:r==="small",[ht.starsLarge]:r==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:r==="small",chat__conversationRating__stars__large:r==="large"}),onMouseOut:d,children:Array(pg).fill(0).map((_,y)=>R.jsx(T2,{value:l===void 0?e:l,index:y,count:pg,readonly:i,onHover:h(y),onClick:p(y)},y))})},C2=({visible:e,onRate:r})=>{const i=Pt();return e?R.jsxs("div",{className:V(ht.callToActionContainer,"chat__conversationRating__callToAction"),children:[R.jsx("div",{className:V(ht.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),R.jsx(kv,{value:0,size:"small",onChange:r})]}):null},mg=({isFirstMessageBySender:e,isLastMessageBySender:r,children:i})=>R.jsxs("div",{className:V(he.message,he.messageBot,e&&he.messageBotFirst,r&&he.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",e&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:[R.jsx("img",{className:V(he.avatar,he.botAvatar),src:"bot.svg",alt:"Bot"}),R.jsx("div",{className:V(he.bubble,he.bubbleLeft,"chat__bubble","chat__botBubble"),children:R.jsx("div",{className:V(he.leftText,he.bubbleContent),children:i})})]}),k2=({children:e})=>R.jsx("div",{className:V(he.message,he.messageGuest,he.messageGuestFirst,he.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:R.jsx("div",{className:V(he.bubble,he.bubbleRight,"chat__bubble","chat__guestBubble"),children:R.jsx("div",{className:V(he.rightText,he.bubbleContent),children:e})})}),R2=({visible:e,rating:r,onRate:i,onClose:s})=>{const l=Pt(),[u,d]=B.useState(r),[h,p]=B.useState(void 0),[_,y]=B.useState(void 0),[b,m]=B.useState({submitted:!1,feedback:""}),[E,v]=B.useState(!1),w=B.useRef(null);B.useEffect(()=>{e?(m({submitted:!1,feedback:""}),y(e)):_===!0&&y(!1)},[e,_]),B.useEffect(()=>{d(r)},[r]),B.useEffect(()=>{const O=l(`conversation-rating.overlay.bot-message.rate-feedback.value-${u}`);p(O!=null&&O.length?O:void 0)},[u,l]),B.useEffect(()=>{b.submitted?setTimeout(()=>v(!0),b.feedback.length?500:0):v(!1)},[b]);const C=O=>{var S,k;O.preventDefault();const N=((k=(S=w.current)==null?void 0:S.value)==null?void 0:k.trim())||"";i(u,N),m({submitted:!0,feedback:N})};return R.jsx("div",{className:V(ht.rateOverlay,Cn.bottomSheet,"chat__conversationRating__overlay",{[Cn.bottomSheetOpen]:_===!0,[Cn.bottomSheetClose]:_===!1}),children:R.jsxs("form",{onSubmit:C,children:[R.jsxs("div",{className:V(ht.body,"chat__conversationRating__overlay__body"),children:[R.jsxs("div",{children:[R.jsx("h2",{children:l("conversation-rating.overlay.title")}),R.jsxs("div",{className:V(ht.starsDescriptionContainer),children:[R.jsx(kv,{value:u,size:"large",readonly:b.submitted,onChange:d}),R.jsxs("div",{className:V(ht.starsDescription),children:[R.jsx("div",{children:l("conversation-rating.overlay.star.very-bad")}),R.jsx("div",{children:l("conversation-rating.overlay.star.very-good")})]})]})]}),R.jsx("div",{className:V(ht.bubbles),children:e&&h&&R.jsxs(R.Fragment,{children:[R.jsx(mg,{isFirstMessageBySender:!0,isLastMessageBySender:!E||!!b.feedback.length,children:R.jsx("div",{children:h})}),!!b.feedback.length&&R.jsx(k2,{children:b.feedback}),E&&R.jsx(mg,{isFirstMessageBySender:!!b.feedback.length,isLastMessageBySender:!0,children:R.jsx("div",{children:l("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),R.jsxs("div",{className:V(ht.footer,"chat__conversationRating__overlay__footer"),children:[!b.submitted&&R.jsx("input",{ref:w,placeholder:l("conversation-rating.overlay.guest-feedback.input-placeholder")}),R.jsx("div",{className:V(ht.actions,"chat__conversationRating__overlay__footer__actions"),children:b.submitted?R.jsx("button",{type:"button",className:V(it.button,it.buttonPrimary),onClick:s,children:l("conversation-rating.overlay.action.close")}):R.jsx("button",{type:"submit",className:V(it.button,it.buttonPrimary),children:l("conversation-rating.overlay.action.submit")})})]})]})})},O2=({conversationRating:{enabled:e,rating:r},numberOfMessagesFromGuest:i,showRatingOverlay:s,setShowRatingOverlay:l,onRate:u})=>{const[d,h]=B.useState(0),p=b=>{h(b),l(!0)},_=()=>l(!1),y=!r&&i>=1;return e?R.jsxs(R.Fragment,{children:[R.jsx(C2,{visible:y,onRate:p}),R.jsx(R2,{visible:s,rating:d,onRate:u,onClose:_})]}):null},N2="_inputWrapper_1o8hf_5",A2="_messageInputWrapper_1o8hf_14",P2="_messageInput_1o8hf_14",I2="_buttons_1o8hf_36",D2="_button_1o8hf_36",Xr={inputWrapper:N2,messageInputWrapper:A2,messageInput:P2,buttons:I2,button:D2},M2="_audioRecorder_xps9k_5",F2="_recordButton_xps9k_10",L2="_submitButton_xps9k_37",B2="_cancelButton_xps9k_64",j2="_recorderIcon_xps9k_91",z2="_pulse_xps9k_1",U2="_spinning_xps9k_113",H2="_spin_xps9k_113",mr={audioRecorder:M2,recordButton:F2,submitButton:L2,cancelButton:B2,recorderIcon:j2,pulse:z2,spinning:U2,spin:H2},gg=2048,ea=16e3;class G2 extends xn.Component{constructor(i){super(i);we(this,"audioInput",null);we(this,"volume",null);we(this,"leftchannel",[]);we(this,"recorder",null);we(this,"recordingLength",0);we(this,"sampleRate",null);we(this,"mediaStream",null);this.state={recordingState:"none"},this.triggerAudioRecording=this.triggerAudioRecording.bind(this),this.triggerAudioRecordingSuccess=this.triggerAudioRecordingSuccess.bind(this),this.initRecording=this.initRecording.bind(this),this.processRecordingInput=this.processRecordingInput.bind(this),this.handleClickSubmitAudio=this.handleClickSubmitAudio.bind(this),this.handleClickStopAudio=this.handleClickStopAudio.bind(this)}triggerAudioRecording(){this.setState({recordingState:"connecting"}),navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(this.triggerAudioRecordingSuccess)}triggerAudioRecordingSuccess(i){this.mediaStream=i,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(i)}initRecording(i){const s=window.AudioContext||window.webkitAudioContext,l=new s;this.sampleRate=l.sampleRate,this.volume=l.createGain(),this.audioInput=l.createMediaStreamSource(i),this.audioInput.connect(this.volume),this.recorder=l.createScriptProcessor(gg,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(l.destination)}processRecordingInput(i){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const s=i.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(s)),this.recordingLength+=gg}}handleClickSubmitAudio(){const i=q2(this.leftchannel,this.recordingLength),s=V2(i,this.sampleRate||0),l=$2(s);this.props.onAudioRecorded(l),this.handleClickStopAudio()}handleClickStopAudio(){var i,s,l,u;this.setState({recordingState:"none"}),(i=this.audioInput)==null||i.disconnect(),(s=this.volume)==null||s.disconnect(),(l=this.recorder)==null||l.disconnect(),this.mediaStream&&((u=this.mediaStream)==null||u.getAudioTracks().forEach(d=>{d.stop()}))}render(){return R.jsxs("div",{className:mr.audioRecorder,children:[this.state.recordingState==="none"&&R.jsx("button",{className:V(mr.recordButton,"chat__button"),type:"submit","aria-label":this.props.translate("message-input.actions.start-audio-recording.label"),"data-title":this.props.translate("message-input.actions.start-audio-recording.label"),tabIndex:0,onClick:this.triggerAudioRecording,children:R.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.jsx("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z"}),R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&R.jsxs("svg",{className:mr.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&R.jsxs("div",{className:mr.audioRecorder,children:[R.jsx("button",{className:V(mr.cancelButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:R.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),R.jsx("div",{className:mr.recorderIcon}),R.jsx("button",{className:V(mr.submitButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:R.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[R.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),R.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const $2=e=>{const r=new ArrayBuffer(44+e.length*2),i=new DataView(r);Bs(i,0,"RIFF"),i.setUint32(4,44+e.length*2,!0),Bs(i,8,"WAVE"),Bs(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,ea,!0),i.setUint32(28,ea*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),Bs(i,36,"data"),i.setUint32(40,e.length*2,!0);const s=e.length;let l=44;const u=1;for(let d=0;d<s;d++)i.setInt16(l,e[d]*(32767*u),!0),l+=2;return new Blob([i],{type:"audio/wav"})},Bs=(e,r,i)=>{for(let s=0;s<i.length;s++)e.setUint8(r+s,i.charCodeAt(s))},q2=(e,r)=>{const i=new Float32Array(r);let s=0;const l=e.length;for(let u=0;u<l;u++){const d=e[u];i.set(d,s),s+=d.length}return i},V2=(e,r)=>{if(ea===r)return e;const i=r/ea,s=Math.round(e.length/i),l=new Float32Array(s);let u=0,d=0;for(;u<l.length;){const h=Math.round((u+1)*i);let p=0,_=0;for(let y=d;y<h&&y<e.length;y++)p+=e[y],_++;l[u]=p/_,u++,d=h}return l},W2=({speechSupport:e,transcriptExportEnabled:r,disabled:i,textInput:s,commandsVisible:l,onTextInput:u,onTextInputSubmit:d,onAudioRecorded:h,onOpenTranscriptExportModal:p})=>{const _=Pt(),y=B.useRef(null);B.useEffect(()=>{var w;(w=y.current)==null||w.focus()},[s]);const b=()=>{const w=y.current;w&&s.trim().length>=1&&d(s.trim())&&(w.value="",w.style.height="",w.focus())},m=w=>{w.preventDefault(),b()},E=w=>{const C=w.target.value;u(C),w.target.style.height="";const{scrollHeight:O}=w.target;w.target.style.height=`${O>150?150:O}px`},v=w=>{w.code==="Enter"&&!w.shiftKey?(w.repeat||b(),w.preventDefault()):l&&(w.code==="ArrowUp"||w.code==="ArrowDown")&&w.preventDefault()};return R.jsxs("form",{className:V(Xr.inputWrapper,"chat__textInput"),onSubmit:m,children:[R.jsx("div",{className:Xr.messageInputWrapper,children:R.jsx("textarea",{id:"user_input",ref:y,className:Xr.messageInput,tabIndex:0,placeholder:_("message-input-placeholder"),value:s,onChange:E,onKeyDown:v,"aria-label":_("message-input-label"),"aria-controls":"command-list","aria-haspopup":"listbox"})}),R.jsxs("div",{className:V(Xr.buttons,"chat__buttons"),children:[!s.length&&r&&R.jsx("button",{type:"button",className:V(Xr.button,"chat__button"),"aria-label":_("message-input.actions.export-transcript.label"),"data-title":_("message-input.actions.export-transcript.label"),tabIndex:0,onClick:p,children:R.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:R.jsx("path",{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"})})}),s.length||!e||navigator.mediaDevices===void 0?R.jsx("button",{className:V(Xr.button,"chat__button"),type:"submit","aria-label":_("message-input.actions.submit.label"),"data-title":_("message-input.actions.submit.label"),tabIndex:0,disabled:i,children:R.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:R.jsx("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})})}):e&&navigator.mediaDevices!==void 0&&R.jsx(G2,{translate:_,onAudioRecorded:h})]})]})},X2="_quickReplies_11l22_1",Q2="_quickReply_11l22_9",yg={quickReplies:X2,quickReply:Q2},K2=({quickReplies:e,onQuickReplyClick:r})=>e.length?R.jsx("div",{className:V(yg.quickReplies,"chat__quickReplies"),children:e.map(i=>R.jsx("button",{tabIndex:0,className:V(yg.quickReply,it.button,"chat__button","chat__quickReply"),onClick:()=>r(i),children:i.label},i.label))}):null,vg=5e3,Y2=1e3,Z2=({isBotTyping:e,quickReplies:r,speechSupport:i,transcriptExportEnabled:s,conversationRating:l,numberOfMessagesFromGuest:u,showRatingOverlay:d,commands:h,setShowRatingOverlay:p,onTextInput:_,onRate:y,onQuickReplyClick:b,onAudioRecorded:m,onOpenTranscriptExportModal:E})=>{const[v,w]=B.useState(""),[C,O]=B.useState(!1),[N,S]=B.useState(!1),k=B.useRef(),x=B.useRef(0);B.useEffect(()=>{if(C&&!e){const q=k.current?Date.now()-k.current:0;q>vg?O(!1):setTimeout(()=>{O(!1)},vg-q)}},[C,e]),B.useEffect(()=>{C&&(k.current=Date.now())},[C]);const L=q=>{const fe=Date.now()-x.current<Y2;return N?!1:e||fe?(O(!0),!1):(_(q),w(""),x.current=Date.now(),!0)},G=q=>{w(q+" ")};return R.jsxs("div",{className:V(GC.inputContainer),children:[R.jsx(K2,{quickReplies:r,onQuickReplyClick:b}),R.jsx(VC,{visible:C}),!C&&R.jsx(O2,{conversationRating:l,numberOfMessagesFromGuest:u,onRate:y,showRatingOverlay:d,setShowRatingOverlay:p}),!!(h!=null&&h.length)&&R.jsx(JC,{text:v,commands:h,onSelectCommand:G,onVisibilityChange:S}),R.jsx(W2,{textInput:v,speechSupport:i,transcriptExportEnabled:s,disabled:C,commandsVisible:N,onTextInput:w,onTextInputSubmit:L,onOpenTranscriptExportModal:E,onAudioRecorded:m})]})},J2=({clientName:e,messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:d,conversationRating:h,showGeneralConditions:p,commands:_,onMessageFromUser:y,onRate:b,onQuickReplyClick:m,onButtonClick:E,onLinkClick:v,onAudioRecorded:w,onTranscriptExport:C,onPdfExport:O,onTranscriptItemReaction:N})=>{const S=qc(),k=_r(oe=>oe.connection.connectionState),[x,L]=B.useState(!1),[G,q]=B.useState(!1),fe=d.email||d.pdf,te=r.filter(oe=>oe.sender.type===tv.GUEST).length;return B.useEffect(()=>{if(k===vr.CONNECTED){const oe=Xc.parse(window.location.search);S(ev(e,oe))}},[e,k,S]),R.jsxs("div",{children:[R.jsxs("div",{className:`${jw.chatcontent} ${x||G?it.accessabilityHidden:""}`,children:[R.jsx(bC,{messages:r,isBotTyping:s,showGeneralConditions:p,commands:_,onButtonClick:E,onLinkClick:v,onTranscriptItemReaction:N}),R.jsx(Z2,{isBotTyping:s,quickReplies:s?[]:i,numberOfMessagesFromGuest:te,speechSupport:u,transcriptExportEnabled:fe,conversationRating:x?{enabled:!1}:h,showRatingOverlay:G,setShowRatingOverlay:q,commands:_,onRate:b,onQuickReplyClick:m,onTextInput:y,onAudioRecorded:w,onOpenTranscriptExportModal:()=>L(!x)}),R.jsx(IC,{})]}),fe&&R.jsx(UC,{methods:d,visible:x,onEmailExport:C,onPdfExport:O,onClose:()=>L(!1)}),R.jsx(OC,{contentUrl:l})]})},ek=e=>{const{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:d,conversationRating:h,showGeneralConditions:p,commands:_}=e.chat;return{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:d,conversationRating:h,showGeneralConditions:p,commands:_}},tk=e=>({onRestartChat:(r,i)=>e(mf(r,i)),onMessageFromUser:r=>e(Dy(r)),onRate:(r,i)=>e(kb(r,i)),onAudioRecorded:r=>e(vb(r)),onActionFromUser:r=>e(r),onQuickReplyClick:r=>e(Iy(r)),onNluEvent:r=>e(Ly(r)),onButtonClick:r=>e(Ob(r)),onLinkClick:r=>e(Nb(r)),onTranscriptExport:r=>e(bb(r)),onPdfExport:()=>e(Tb()),onTranscriptItemReaction:(r,i)=>e(ge.transcriptItemGuestReaction(r,i||null))}),nk=K1(ek,tk)(J2),rk="_chatwindow_phukm_1",ik="_chatcontent_phukm_13",ok={chatwindow:rk,chatcontent:ik},sk="_container_ophni_2",ak="_body_ophni_8",lk="_intro_ophni_13",uk="_footer_ophni_34",ck="_startChatButton_ophni_38",fk="_formFields_ophni_42",dk="_formField_ophni_42",hk="_radio_ophni_54",pk="_checkbox_ophni_61",mk="_input_ophni_69",gk="_inputLabel_ophni_99",yk="_selectWrapper_ophni_103",vk="_select_ophni_103",_k="_selectLabel_ophni_145",pt={container:sk,body:ak,intro:lk,footer:uk,startChatButton:ck,formFields:fk,formField:dk,radio:hk,checkbox:pk,input:mk,inputLabel:gk,selectWrapper:yk,select:vk,selectLabel:_k},Ek=({name:e,label:r,defaultValue:i,required:s,onChange:l})=>{const u=d=>{l(d.currentTarget.checked?"true":"false")};return R.jsxs("label",{className:V(pt.checkbox,"chat__startScreen__checkbox"),htmlFor:e,children:[R.jsx("input",{type:"checkbox",id:e,name:e,defaultChecked:i==="true",required:s,onChange:u}),R.jsx("div",{children:r})]})},Sk=({type:e,name:r,label:i,defaultValue:s,placeholder:l,required:u,multiple:d,min:h,max:p,pattern:_,onChange:y})=>{const b=m=>{y(m.target.value)};return R.jsxs("label",{className:V(pt.input,"chat__startScreen__input"),htmlFor:r,children:[R.jsx("div",{className:V(pt.inputLabel),children:i}),R.jsx("input",{type:e,id:r,name:r,defaultValue:s,placeholder:l,required:u,multiple:d,min:h,max:p,pattern:_,onChange:b})]})},bk=({name:e,value:r,label:i,defaultChecked:s,required:l,onChange:u})=>{const d=`${e}-${r}`,h=p=>{u(p.target.value)};return R.jsxs("label",{className:V(pt.radio,"chat__startScreen__radio"),htmlFor:d,children:[R.jsx("input",{id:d,type:"radio",name:e,value:r,defaultChecked:s,required:l,onChange:h}),R.jsx("span",{className:V(pt.label),children:i})]})},wk=({name:e,label:r,defaultValue:i,required:s,multiple:l,options:u,onChange:d})=>{const h=p=>{d(p.target.value)};return R.jsxs("label",{className:V(pt.select,"chat__startScreen__select"),htmlFor:e,children:[R.jsx("div",{className:V(pt.selectLabel),children:r}),R.jsx("div",{className:V(pt.selectWrapper),children:R.jsx("select",{id:e,name:e,defaultValue:i,required:s,multiple:l,onChange:h,children:Object.entries(u||{}).map(([p,_])=>R.jsx("option",{value:p,selected:_===i,children:_}))})})]})},xk="start-screen.intro",Tk="start-screen.start-chat",Yt="start-screen.form",_g=`${Yt}.fields`,Ck=()=>{const e=Pt(),r=qc(),[i,s]=B.useState({}),l=()=>{const y=Object.entries(i).reduce((b,[m,E])=>({...b,[m]:E.value}),{});r(yw(y))},u=e(xk),d=e(Tk),h=B.useMemo(()=>{var y;return((y=e(_g))==null?void 0:y.split(";").map(b=>b.trim()))??[]},[e(_g)]);B.useEffect(()=>{h.length&&Object.keys(i).length===0&&s(h.reduce((y,b)=>({...y,[b]:Rk(b,e)}),{}))},[e,h,i]);const p=y=>{y.preventDefault(),l()},_=y=>b=>{s(m=>({...m,[y]:{...m[y],value:b}}))};return R.jsxs("form",{onSubmit:p,className:V(pt.container,"chat__startScreen"),children:[R.jsxs("div",{className:V(pt.body,"chat__startScreen__body"),children:[u&&R.jsx("div",{className:V(pt.intro,"chat__startScreen__intro"),children:R.jsx(Yn,{options:{overrides:{a:kk}},children:u})}),R.jsx("div",{className:V(pt.formFields,"chat__startScreen__fields"),children:Object.values(i).map(({type:y,name:b,label:m,placeholder:E,defaultValue:v,options:w,required:C,multiple:O,min:N,max:S,pattern:k})=>R.jsx("div",{className:V(pt.formField,"chat__startScreen__field"),children:(()=>{switch(y){case"radio":return R.jsxs(R.Fragment,{children:[R.jsx("div",{children:m}),Object.entries(w||{}).map(([x,L])=>R.jsx(bk,{name:b,value:x,label:L,defaultChecked:x===v,required:C,onChange:_(b)}))]});case"checkbox":return R.jsx(Ek,{name:b,label:m,defaultValue:v,required:C,onChange:_(b)});case"select":return R.jsx(wk,{name:b,label:m,defaultValue:v,required:C,multiple:O,options:w,onChange:_(b)});default:return R.jsx(Sk,{type:y,name:b,label:m,placeholder:E,defaultValue:v,required:C,multiple:O,min:N,max:S,pattern:k,onChange:_(b)})}})()},b))})]}),R.jsx("div",{className:V(pt.footer,"chat__startScreen__footer"),children:R.jsx("button",{type:"submit",className:V(it.button,it.buttonPrimary,pt.startChatButton),children:d})})]})},kk=({title:e,href:r,children:i})=>R.jsx("a",{href:r,title:e,target:"_blank",rel:"noopener noreferrer",children:i}),Rk=(e,r)=>{const i=r(`${Yt}.${e}.type`)||"text",s=r(`${Yt}.${e}.required`)==="true",l=r(`${Yt}.${e}.multiple`)==="true",u=r(`${Yt}.${e}.placeholder`),d=r(`${Yt}.${e}.label`)||"",h=r(`${Yt}.${e}.defaultValue`),p=r(`${Yt}.${e}.min`),_=r(`${Yt}.${e}.max`),y=r(`${Yt}.${e}.pattern`),b=Nk(r(`${Yt}.${e}.options`));return{name:e,label:d,placeholder:u,value:Ok(i,h,b)||"",defaultValue:h,options:b,type:i,required:s,multiple:l,min:p,max:_,pattern:y}},Ok=(e,r,i)=>r||e==="select"&&Object.keys(i)[0]||"",Nk=(e="")=>e.split(";").map(r=>r.trim()).reduce((r,i)=>{const[s,l]=i.split(":").map(u=>u.trim());return{...r,[s]:l}},{}),Ak=()=>{const e=ra();B.useEffect(()=>{window.document.documentElement.lang=e.locale},[e.locale])},Qr={TRIGGER_ACTION:"TRIGGER_ACTION",TRIGGER_STORY:"TRIGGER_STORY",CHAT_MESSAGE_FROM_GUEST:"CHAT_MESSAGE_FROM_GUEST",ON_CHAT_WINDOW_OPEN:"ON_CHAT_WINDOW_OPEN",ON_CHAT_WINDOW_CLOSE:"ON_CHAT_WINDOW_CLOSE",RESTART_CHAT:"RESTART_CHAT"},Pk=({clientName:e})=>{Ak();const r=qc(),i=_r(y=>y.intl.messages),s=Pt(),l=_r(y=>y.startScreen.useStartScreen),u=_r(y=>y.startScreen.startScreenStatus),[d,h]=B.useState(void 0);B.useEffect(()=>{const y=Xc.parse(window.location.search);y.cssClassName&&h(y.cssClassName);const b=m=>{switch(m.data.type){case Qr.TRIGGER_ACTION:r(m.data.action);break;case Qr.TRIGGER_STORY:r(Ly(m.data.story));break;case Qr.ON_CHAT_WINDOW_OPEN:r({type:"webclient.chatwindow.opened"});break;case Qr.ON_CHAT_WINDOW_CLOSE:r({type:"webclient.chatwindow.closed"});break;case Qr.CHAT_MESSAGE_FROM_GUEST:r(Dy(m.data.text));break;case Qr.RESTART_CHAT:r(mf(e,y));break}};return r(Cw(e,y)),window.addEventListener("message",m=>b(m),!1),()=>window.removeEventListener("message",b)},[e,r]),B.useEffect(()=>{const y=s("header.restart-chat"),b=s("header.close-chat");r(Ab({header:{restartChat:y,closeChat:b}}))},[i,r,s]);const p=l===void 0,_=l===!1||u==="HIDDEN";return R.jsx("div",{className:V(ok.chatwindow,"chat__chatwindow",d),children:p?null:_?R.jsx(nk,{clientName:e}):R.jsx(Ck,{})})},Ik=()=>{const e=wy(),r=_r(s=>s.intl.locale),i=_r(s=>s.intl.messages);return R.jsx(PS,{locale:r,messages:i,children:R.jsx("div",{className:DS.app,children:R.jsx(Pk,{clientName:e})})})};var Gu,Eg;function vf(){if(Eg)return Gu;Eg=1;function e(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}return Gu=e,Gu}var $u,Sg;function Dk(){if(Sg)return $u;Sg=1;var e=typeof hs=="object"&&hs&&hs.Object===Object&&hs;return $u=e,$u}var qu,bg;function Rv(){if(bg)return qu;bg=1;var e=Dk(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=e||r||Function("return this")();return qu=i,qu}var Vu,wg;function Mk(){if(wg)return Vu;wg=1;var e=Rv(),r=function(){return e.Date.now()};return Vu=r,Vu}var Wu,xg;function Fk(){if(xg)return Wu;xg=1;var e=/\s/;function r(i){for(var s=i.length;s--&&e.test(i.charAt(s)););return s}return Wu=r,Wu}var Xu,Tg;function Lk(){if(Tg)return Xu;Tg=1;var e=Fk(),r=/^\s+/;function i(s){return s&&s.slice(0,e(s)+1).replace(r,"")}return Xu=i,Xu}var Qu,Cg;function Ov(){if(Cg)return Qu;Cg=1;var e=Rv(),r=e.Symbol;return Qu=r,Qu}var Ku,kg;function Bk(){if(kg)return Ku;kg=1;var e=Ov(),r=Object.prototype,i=r.hasOwnProperty,s=r.toString,l=e?e.toStringTag:void 0;function u(d){var h=i.call(d,l),p=d[l];try{d[l]=void 0;var _=!0}catch{}var y=s.call(d);return _&&(h?d[l]=p:delete d[l]),y}return Ku=u,Ku}var Yu,Rg;function jk(){if(Rg)return Yu;Rg=1;var e=Object.prototype,r=e.toString;function i(s){return r.call(s)}return Yu=i,Yu}var Zu,Og;function zk(){if(Og)return Zu;Og=1;var e=Ov(),r=Bk(),i=jk(),s="[object Null]",l="[object Undefined]",u=e?e.toStringTag:void 0;function d(h){return h==null?h===void 0?l:s:u&&u in Object(h)?r(h):i(h)}return Zu=d,Zu}var Ju,Ng;function Uk(){if(Ng)return Ju;Ng=1;function e(r){return r!=null&&typeof r=="object"}return Ju=e,Ju}var ec,Ag;function Hk(){if(Ag)return ec;Ag=1;var e=zk(),r=Uk(),i="[object Symbol]";function s(l){return typeof l=="symbol"||r(l)&&e(l)==i}return ec=s,ec}var tc,Pg;function Gk(){if(Pg)return tc;Pg=1;var e=Lk(),r=vf(),i=Hk(),s=NaN,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,d=/^0o[0-7]+$/i,h=parseInt;function p(_){if(typeof _=="number")return _;if(i(_))return s;if(r(_)){var y=typeof _.valueOf=="function"?_.valueOf():_;_=r(y)?y+"":y}if(typeof _!="string")return _===0?_:+_;_=e(_);var b=u.test(_);return b||d.test(_)?h(_.slice(2),b?2:8):l.test(_)?s:+_}return tc=p,tc}var nc,Ig;function $k(){if(Ig)return nc;Ig=1;var e=vf(),r=Mk(),i=Gk(),s="Expected a function",l=Math.max,u=Math.min;function d(h,p,_){var y,b,m,E,v,w,C=0,O=!1,N=!1,S=!0;if(typeof h!="function")throw new TypeError(s);p=i(p)||0,e(_)&&(O=!!_.leading,N="maxWait"in _,m=N?l(i(_.maxWait)||0,p):m,S="trailing"in _?!!_.trailing:S);function k(ue){var ze=y,Pe=b;return y=b=void 0,C=ue,E=h.apply(Pe,ze),E}function x(ue){return C=ue,v=setTimeout(q,p),O?k(ue):E}function L(ue){var ze=ue-w,Pe=ue-C,$e=p-ze;return N?u($e,m-Pe):$e}function G(ue){var ze=ue-w,Pe=ue-C;return w===void 0||ze>=p||ze<0||N&&Pe>=m}function q(){var ue=r();if(G(ue))return fe(ue);v=setTimeout(q,L(ue))}function fe(ue){return v=void 0,S&&y?k(ue):(y=b=void 0,E)}function te(){v!==void 0&&clearTimeout(v),C=0,y=w=b=v=void 0}function oe(){return v===void 0?E:fe(r())}function pe(){var ue=r(),ze=G(ue);if(y=arguments,b=this,w=ue,ze){if(v===void 0)return x(w);if(N)return clearTimeout(v),v=setTimeout(q,p),k(w)}return v===void 0&&(v=setTimeout(q,p)),E}return pe.cancel=te,pe.flush=oe,pe}return nc=d,nc}var rc,Dg;function qk(){if(Dg)return rc;Dg=1;var e=$k(),r=vf(),i="Expected a function";function s(l,u,d){var h=!0,p=!0;if(typeof l!="function")throw new TypeError(i);return r(d)&&(h="leading"in d?!!d.leading:h,p="trailing"in d?!!d.trailing:p),e(l,u,{leading:h,maxWait:u,trailing:p})}return rc=s,rc}var Vk=qk();const Wk=ta(Vk);var ic,Mg;function Xk(){if(Mg)return ic;Mg=1;function e(E,v){var w,C;if(typeof v=="function")C=v(E),C!==void 0&&(E=C);else if(Array.isArray(v))for(w=0;w<v.length;w++)C=v[w](E),C!==void 0&&(E=C);return E}function r(E,v){return E[0]==="-"&&Array.isArray(v)&&/^-\d+$/.test(E)?v.length+parseInt(E,10):E}function i(E){return/^\d+$/.test(E)}function s(E){return Object.prototype.toString.call(E)==="[object Object]"}function l(E){return Object(E)===E}function u(E){return Object.keys(E).length===0}var d=["__proto__","prototype","constructor"],h=function(E){return d.indexOf(E)===-1};function p(E,v){E.indexOf("[")>=0&&(E=E.replace(/\[/g,v).replace(/]/g,""));var w=E.split(v),C=w.filter(h);if(C.length!==w.length)throw Error("Refusing to update blacklisted property "+E);return w}var _=Object.prototype.hasOwnProperty;function y(E,v,w,C){if(!(this instanceof y))return new y(E,v,w,C);typeof v>"u"&&(v=!1),typeof w>"u"&&(w=!0),typeof C>"u"&&(C=!0),this.separator=E||".",this.override=v,this.useArray=w,this.useBrackets=C,this.keepArray=!1,this.cleanup=[]}var b=new y(".",!1,!0,!0);function m(E){return function(){return b[E].apply(b,arguments)}}return y.prototype._fill=function(E,v,w,C){var O=E.shift();if(E.length>0){if(v[O]=v[O]||(this.useArray&&i(E[0])?[]:{}),!l(v[O]))if(this.override)v[O]={};else{if(!(l(w)&&u(w)))throw new Error("Trying to redefine `"+O+"` which is a "+typeof v[O]);return}this._fill(E,v[O],w,C)}else{if(!this.override&&l(v[O])&&!u(v[O])){if(!(l(w)&&u(w)))throw new Error("Trying to redefine non-empty obj['"+O+"']");return}v[O]=e(w,C)}},y.prototype.object=function(E,v){var w=this;return Object.keys(E).forEach(function(C){var O=v===void 0?null:v[C],N=p(C,w.separator).join(w.separator);N.indexOf(w.separator)!==-1?(w._fill(N.split(w.separator),E,E[C],O),delete E[C]):E[C]=e(E[C],O)}),E},y.prototype.str=function(E,v,w,C){var O=p(E,this.separator).join(this.separator);return E.indexOf(this.separator)!==-1?this._fill(O.split(this.separator),w,v,C):w[E]=e(v,C),w},y.prototype.pick=function(E,v,w,C){var O,N,S,k,x;for(N=p(E,this.separator),O=0;O<N.length;O++)if(k=r(N[O],v),v&&typeof v=="object"&&k in v){if(O===N.length-1)return w?(S=v[k],C&&Array.isArray(v)?v.splice(k,1):delete v[k],Array.isArray(v)&&(x=N.slice(0,-1).join("."),this.cleanup.indexOf(x)===-1&&this.cleanup.push(x)),S):v[k];v=v[k]}else return;return w&&Array.isArray(v)&&(v=v.filter(function(L){return L!==void 0})),v},y.prototype.delete=function(E,v){return this.remove(E,v,!0)},y.prototype.remove=function(E,v,w){var C;if(this.cleanup=[],Array.isArray(E)){for(C=0;C<E.length;C++)this.pick(E[C],v,!0,w);return w||this._cleanup(v),v}else return this.pick(E,v,!0,w)},y.prototype._cleanup=function(E){var v,w,C,O;if(this.cleanup.length){for(w=0;w<this.cleanup.length;w++)C=this.cleanup[w].split("."),O=C.splice(0,-1).join("."),v=O?this.pick(O,E):E,v=v[C[0]].filter(function(N){return N!==void 0}),this.set(this.cleanup[w],v,E);this.cleanup=[]}},y.prototype.del=y.prototype.remove,y.prototype.move=function(E,v,w,C,O){return typeof C=="function"||Array.isArray(C)?this.set(v,e(this.pick(E,w,!0),C),w,O):(O=C,this.set(v,this.pick(E,w,!0),w,O)),w},y.prototype.transfer=function(E,v,w,C,O,N){return typeof O=="function"||Array.isArray(O)?this.set(v,e(this.pick(E,w,!0),O),C,N):(N=O,this.set(v,this.pick(E,w,!0),C,N)),C},y.prototype.copy=function(E,v,w,C,O,N){return typeof O=="function"||Array.isArray(O)?this.set(v,e(JSON.parse(JSON.stringify(this.pick(E,w,!1))),O),C,N):(N=O,this.set(v,this.pick(E,w,!1),C,N)),C},y.prototype.set=function(E,v,w,C){var O,N,S,k;if(typeof v>"u")return w;for(S=p(E,this.separator),O=0;O<S.length;O++){if(k=S[O],O===S.length-1)if(C&&s(v)&&s(w[k]))for(N in v)_.call(v,N)&&(w[k][N]=v[N]);else if(C&&Array.isArray(w[k])&&Array.isArray(v))for(var x=0;x<v.length;x++)w[S[O]].push(v[x]);else w[k]=v;else(!_.call(w,k)||!s(w[k])&&!Array.isArray(w[k]))&&(/^\d+$/.test(S[O+1])?w[k]=[]:w[k]={});w=w[k]}return w},y.prototype.transform=function(E,v,w){return v=v||{},w=w||{},Object.keys(E).forEach((function(C){this.set(E[C],this.pick(C,v),w)}).bind(this)),w},y.prototype.dot=function(E,v,w){v=v||{},w=w||[];var C=Array.isArray(E);return Object.keys(E).forEach((function(O){var N=C&&this.useBrackets?"["+O+"]":O;if(l(E[O])&&(s(E[O])&&!u(E[O])||Array.isArray(E[O])&&!this.keepArray&&E[O].length!==0))if(C&&this.useBrackets){var S=w[w.length-1]||"";return this.dot(E[O],v,w.slice(0,-1).concat(S+N))}else return this.dot(E[O],v,w.concat(N));else C&&this.useBrackets?v[w.join(this.separator).concat("["+O+"]")]=E[O]:v[w.concat(N).join(this.separator)]=E[O]}).bind(this)),v},y.pick=m("pick"),y.move=m("move"),y.transfer=m("transfer"),y.transform=m("transform"),y.copy=m("copy"),y.object=m("object"),y.str=m("str"),y.set=m("set"),y.delete=m("delete"),y.del=y.remove=m("remove"),y.dot=m("dot"),["override","overwrite"].forEach(function(E){Object.defineProperty(y,E,{get:function(){return b.override},set:function(v){b.override=!!v}})}),["useArray","keepArray","useBrackets"].forEach(function(E){Object.defineProperty(y,E,{get:function(){return b[E]},set:function(v){b[E]=v}})}),y._process=e,ic=y,ic}var Qk=Xk();const Nv={"message-input-label":"Benutzereingabe","message-input-placeholder":"Nachricht","message-input.actions.submit.label":"Nachricht senden","message-input.actions.export-transcript.label":"Konversation exportieren","message-input.actions.start-audio-recording.label":"Spracheingabe starten","message-input.actions.stop-audio-recording.label":"Spracheingabe stoppen","message-input.actions.submit-audio-recording.label":"Spracheingabe übermitteln","guest-bubble.label":"Ihre Nachricht","bot-bubble.label":"Nachricht des Chatbots","bot-bubble.reaction.good":"Gefällt mir","bot-bubble.reaction.bad":"Gefällt mir nicht","bot-bubble.reaction.remove":"Markierung entfernen","bot-bubble.copy":"Kopieren","agent-bubble.label":"Nachricht des Live-Agenten","export-transcript.email.title":"Konversation per E-Mail versenden","export-transcript.email.description":"Geben Sie Ihre E-Mail-Adresse ein, um den Chatverlauf zu erhalten.","export-transcript.email.cancel":"Abbrechen","export-transcript.email.send":"Senden","export-transcript.email.placeholder":"Ihre E-Mail-Adresse","export-transcript.email.invalid":"Bitte gültige E-Mail-Adresse eingeben.","export-transcript.email.success":"Ich habe den Chatverlauf an Ihre E-Mail-Adresse gesendet.","export-transcript.pdf.title":"Konversation als PDF erhalten","export-transcript.pdf.description":"Laden Sie die Konversation als PDF herunter.","export-transcript.pdf.cancel":"Abbrechen","export-transcript.pdf.download":"Herunterladen","general-conditions.header":"**Nutzungsbedingungen**","general-conditions.body":`Bitte berücksichtigen Sie die folgenden Punkte:
|
|
98
98
|
|
|
99
99
|
- Der Chatverlauf wird im EU-Raum gespeichert und kann nur von autorisierten Personen eingesehen werden.
|
|
100
100
|
- Geben Sie im Chatfenster keine persönlichen Daten ein (Passwörter, Geburtsdatum usw.).`,"general-conditions.accept-conditions-note":"Mit der Verwendung des Chats erklären Sie sich mit den Nutzungsbedingungen einverstanden.","block-user-input.title":"Bitte auf die Antwort des Chatbots warten.","conversation-rating.call-to-action.title":"Bewerten Sie diesen Chat","conversation-rating.overlay.title":"Wie zufrieden sind Sie mit diesem Chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Feedback bitte hier eingeben (optional)","conversation-rating.overlay.star.very-bad":"Sehr schlecht","conversation-rating.overlay.star.very-good":"Sehr gut","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"Durchschnitt ist nicht mein Ziel, was kann ich noch verbessern?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Knapp daneben ist auch vorbei. Was kann ich noch verbessern, um das nächste Mal alle Sterne zu erreichen?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfekt! Dann hoffe ich, dass ich Sie wieder einmal so gut beraten kann.","conversation-rating.overlay.bot-message.submit-feedback":"Vielen Dank für die Rückmeldung. Ich bin bestrebt, mich ständig zu verbessern.","conversation-rating.overlay.action.submit":"Bewertung senden","conversation-rating.overlay.action.close":"Zurück zum Chat","start-screen.intro":"","start-screen.start-chat":"Chat starten","header.restart-chat":"Chat neu starten","header.close-chat":"Chat minimieren"},Kk={"message-input-label":"User input","message-input-placeholder":"Message","message-input.actions.submit.label":"Send message","message-input.actions.export-transcript.label":"Export conversation","message-input.actions.start-audio-recording.label":"Start voice input","message-input.actions.stop-audio-recording.label":"Stop voice input","message-input.actions.submit-audio-recording.label":"Transmit voice input","guest-bubble.label":"Your message","bot-bubble.label":"Message from the chatbot","bot-bubble.reaction.good":"I like","bot-bubble.reaction.bad":"I don't like it","bot-bubble.reaction.remove":"Remove marker","bot-bubble.copy":"Copy","agent-bubble.label":"Message from the live agent","export-transcript.email.title":"Receive Conversation","export-transcript.email.description":"Enter your email address to receive the chat history.","export-transcript.email.cancel":"Cancel","export-transcript.email.send":"Send","export-transcript.email.placeholder":"Your email address","export-transcript.email.invalid":"Please enter a valid e-mail address.","export-transcript.email.success":"I have sent the chat history to your email address.","export-transcript.pdf.title":"Get conversation as PDF","export-transcript.pdf.description":"Download this conversation as PDF.","export-transcript.pdf.cancel":"Cancel","export-transcript.pdf.download":"Download","general-conditions.header":"**Terms of use**","general-conditions.body":`Please consider the following points:
|
|
@@ -107,4 +107,4 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
|
|
|
107
107
|
|
|
108
108
|
- La cronologia delle chat è memorizzata nell'area UE e può essere visualizzata solo da persone autorizzate.
|
|
109
109
|
- Non inserire dati personali nella finestra di chat (password, data di nascita, ecc.).`,"general-conditions.accept-conditions-note":"Utilizzando la chat si accettano le condizioni d'uso.","block-user-input.title":"Attendere la risposta del chatbot.","conversation-rating.call-to-action.title":"Valuta questa chat","conversation-rating.overlay.title":"Quanto sei soddisfatto di questa chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Inserisci qui il tuo feedback (opzionale)","conversation-rating.overlay.star.very-bad":"Molto male","conversation-rating.overlay.star.very-good":"Molto buono","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"La media non è il mio obiettivo, cosa posso ancora migliorare?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Anche l'assenza è finita. Cosa posso migliorare per ottenere tutte le stelle la prossima volta?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfetto! Allora spero di potervi consigliare ancora una volta bene.","conversation-rating.overlay.bot-message.submit-feedback":"Grazie mille per il feedback. Mi impegno costantemente per migliorare.","conversation-rating.overlay.action.submit":"Invia","conversation-rating.overlay.action.close":"Chiudere","start-screen.intro":"","start-screen.start-chat":"Avviare la chat","header.restart-chat":"Riavviare la chat","header.close-chat":"Ridurre al minimo la chat"},Jk=["de","en","fr","it"],Av={locale:"de",messages:Nv},eR=(e,r)=>{if(Jk.includes(e)){const i=tR(e),s=Qk.dot(r);return{...i,...s}}return r},tR=e=>{switch(e.toString()){case"en":return Kk;case"fr":return Yk;case"it":return Zk;default:return Nv}},nR=(e=rR,r)=>{switch(r.type){case cf:return Object.assign({},e,{connectionState:vr.CONNECTING});case ff:return Object.assign({},e,{connectionState:vr.CONNECTED});case df:return Object.assign({},e,{connectionState:vr.DISCONNECTED});case hf:return Object.assign({},e,{connectionState:vr.RECONNECTED});case pf:return Object.assign({},e,{sessionId:r.sessionId});case ua:return Object.assign({},e,{sessionId:r.payload.sessionId,userId:r.payload.userId});case ca:return Object.assign({},e,{sessionId:void 0});default:return e}},rR={connectionState:vr.DISCONNECTED,sessionId:void 0,userId:void 0},iR=(e=Lg,r)=>{switch(r.type){case Jy:return Lg;case ua:return Kr({type:"webclient.chat.started"}),e;case ca:return Kr({type:"webclient.chat.ended"}),e;case ge.ActionTypes.TYPING_ON:return Object.assign({},e,{isBotTyping:!0});case ge.ActionTypes.TYPING_OFF:return Object.assign({},e,{isBotTyping:!1});case ge.ActionTypes.MESSAGE_FROM_GUEST:case ge.ActionTypes.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return Fg(e,r.message);case ge.ActionTypes.MESSAGE_TO_GUEST:{Kr(r);const i=Object.assign({},r.message,{_id:r.meta.actionId}),s=e.messages.filter(l=>l._id===r.meta.actionId).length>0;return Object.assign({},e,{isBotTyping:!1,messages:s?e.messages:e.messages.concat([i]),quickReplies:i.quickReplies?i.quickReplies:[]})}case Yc:{const i=r.messages,s=i.length?i[i.length-1]:void 0;return Object.assign({},e,{isBotTyping:!1,messages:i,quickReplies:(s==null?void 0:s.quickReplies)||[]})}case ia:return Kr(r.message),e;case ge.ActionTypes.EVENT_TO_GUEST:return Kr(r.event),e;case ge.ActionTypes.DRAWER_OPEN:return Object.assign({},e,{drawerContentUrl:r.payload.parameters.contentUrl});case ge.ActionTypes.DRAWER_CLOSE:return Object.assign({},e,{drawerContentUrl:void 0});case ge.ActionTypes.GUEST_LOCALE_CHANGED:return Object.assign({},e,{locale:r.payload.locale});case My:return Kr(r),e;case Jc:return Object.assign({},e,{speechSupport:!0});case tf:{const i=new ge.TextMessage(r.transcription,new ge.GuestUser),s=Object.assign({},i,{_id:Oc()});return Fg(e,s)}case ef:return Object.assign({},e,{transcriptExportEnabled:r.methods});case nf:return Object.assign({},e,{showGeneralConditions:!0});case ge.ActionTypes.TRANSCRIPT_ITEM_GUEST_REACTION:{const i=e.messages.map(s=>s._id===r.payload.actionId?Object.assign({},s,{reaction:r.payload.reaction}):s);return Object.assign({},e,{messages:i})}case rf:{const i={enabled:!0,rating:r.payload.rating};return Object.assign({},e,{conversationRating:i})}case ge.ActionTypes.CONVERSATION_RATING_FROM_GUEST:{const i={...e.conversationRating,rating:r.payload};return Object.assign({},e,{conversationRating:i})}case of:return{...e,commands:r.payload.commands};default:return e}},Fg=(e,r)=>{const i=e.messages[e.messages.length-1],s=(i==null?void 0:i.text)===r.text;return i&&i.sender.type===r.sender.type&&s?e:Object.assign({},e,{messages:e.messages.concat([r]),quickReplies:[]})},Kr=e=>{var r;oR()?(r=window.top)==null||r.postMessage(e,"*"):e.type==="webclient.change.url"&&window.open(e.url)},oR=()=>typeof window<"u"&&window.self!==window.top,Lg={messages:[],quickReplies:[],isBotTyping:!1,speechSupport:!1,transcriptExportEnabled:{pdf:!1,email:!1},showGeneralConditions:!1,conversationRating:{enabled:!1},commands:[]},Pv=Yy({name:"intl",initialState:Av,reducers:{updateIntl:(e,r)=>{e.locale=r.payload.language,e.messages=r.payload.messages}}}),{updateIntl:sR}=Pv.actions,aR=Pv.reducer,lR=zy({chat:iR,startScreen:_w,connection:nR,intl:aR}),Iv="bf-webclient-state-last-saved-at",Dv="bf-webclient-state",uR=e=>{try{if(!dR())return;const r=Bg(e,Iv);if(fR(r))return;{const i=Bg(e,Dv);return i===null?void 0:JSON.parse(i)}}catch(r){console.error(r);return}},cR=(e,r)=>{try{const i=JSON.stringify(r);jg(e,Dv,i);const s=new Date().toISOString();jg(e,Iv,s)}catch(i){console.error(i)}},fR=e=>{if(e===null)return!1;const r=new Date(e);return r.setHours(r.getHours()+12),new Date>r},dR=()=>typeof localStorage<"u",Bg=(e,r)=>localStorage.getItem(`${e}_${r}`),jg=(e,r,i)=>localStorage.setItem(`${e}_${r}`,i),dn=Object.create(null);dn.open="0";dn.close="1";dn.ping="2";dn.pong="3";dn.message="4";dn.upgrade="5";dn.noop="6";const Gs=Object.create(null);Object.keys(dn).forEach(e=>{Gs[dn[e]]=e});const Pc={type:"error",data:"parser error"},Mv=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Fv=typeof ArrayBuffer=="function",Lv=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,_f=({type:e,data:r},i,s)=>Mv&&r instanceof Blob?i?s(r):zg(r,s):Fv&&(r instanceof ArrayBuffer||Lv(r))?i?s(r):zg(new Blob([r]),s):s(dn[e]+(r||"")),zg=(e,r)=>{const i=new FileReader;return i.onload=function(){const s=i.result.split(",")[1];r("b"+(s||""))},i.readAsDataURL(e)};function Ug(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let oc;function hR(e,r){if(Mv&&e.data instanceof Blob)return e.data.arrayBuffer().then(Ug).then(r);if(Fv&&(e.data instanceof ArrayBuffer||Lv(e.data)))return r(Ug(e.data));_f(e,!1,i=>{oc||(oc=new TextEncoder),r(oc.encode(i))})}const Hg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yi=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Hg.length;e++)Yi[Hg.charCodeAt(e)]=e;const pR=e=>{let r=e.length*.75,i=e.length,s,l=0,u,d,h,p;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const _=new ArrayBuffer(r),y=new Uint8Array(_);for(s=0;s<i;s+=4)u=Yi[e.charCodeAt(s)],d=Yi[e.charCodeAt(s+1)],h=Yi[e.charCodeAt(s+2)],p=Yi[e.charCodeAt(s+3)],y[l++]=u<<2|d>>4,y[l++]=(d&15)<<4|h>>2,y[l++]=(h&3)<<6|p&63;return _},mR=typeof ArrayBuffer=="function",Ef=(e,r)=>{if(typeof e!="string")return{type:"message",data:Bv(e,r)};const i=e.charAt(0);return i==="b"?{type:"message",data:gR(e.substring(1),r)}:Gs[i]?e.length>1?{type:Gs[i],data:e.substring(1)}:{type:Gs[i]}:Pc},gR=(e,r)=>{if(mR){const i=pR(e);return Bv(i,r)}else return{base64:!0,data:e}},Bv=(e,r)=>{switch(r){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},jv="",yR=(e,r)=>{const i=e.length,s=new Array(i);let l=0;e.forEach((u,d)=>{_f(u,!1,h=>{s[d]=h,++l===i&&r(s.join(jv))})})},vR=(e,r)=>{const i=e.split(jv),s=[];for(let l=0;l<i.length;l++){const u=Ef(i[l],r);if(s.push(u),u.type==="error")break}return s};function _R(){return new TransformStream({transform(e,r){hR(e,i=>{const s=i.length;let l;if(s<126)l=new Uint8Array(1),new DataView(l.buffer).setUint8(0,s);else if(s<65536){l=new Uint8Array(3);const u=new DataView(l.buffer);u.setUint8(0,126),u.setUint16(1,s)}else{l=new Uint8Array(9);const u=new DataView(l.buffer);u.setUint8(0,127),u.setBigUint64(1,BigInt(s))}e.data&&typeof e.data!="string"&&(l[0]|=128),r.enqueue(l),r.enqueue(i)})}})}let sc;function js(e){return e.reduce((r,i)=>r+i.length,0)}function zs(e,r){if(e[0].length===r)return e.shift();const i=new Uint8Array(r);let s=0;for(let l=0;l<r;l++)i[l]=e[0][s++],s===e[0].length&&(e.shift(),s=0);return e.length&&s<e[0].length&&(e[0]=e[0].slice(s)),i}function ER(e,r){sc||(sc=new TextDecoder);const i=[];let s=0,l=-1,u=!1;return new TransformStream({transform(d,h){for(i.push(d);;){if(s===0){if(js(i)<1)break;const p=zs(i,1);u=(p[0]&128)===128,l=p[0]&127,l<126?s=3:l===126?s=1:s=2}else if(s===1){if(js(i)<2)break;const p=zs(i,2);l=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),s=3}else if(s===2){if(js(i)<8)break;const p=zs(i,8),_=new DataView(p.buffer,p.byteOffset,p.length),y=_.getUint32(0);if(y>Math.pow(2,21)-1){h.enqueue(Pc);break}l=y*Math.pow(2,32)+_.getUint32(4),s=3}else{if(js(i)<l)break;const p=zs(i,l);h.enqueue(Ef(u?p:sc.decode(p),r)),s=0}if(l===0||l>e){h.enqueue(Pc);break}}}})}const zv=4;function We(e){if(e)return SR(e)}function SR(e){for(var r in We.prototype)e[r]=We.prototype[r];return e}We.prototype.on=We.prototype.addEventListener=function(e,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(r),this};We.prototype.once=function(e,r){function i(){this.off(e,i),r.apply(this,arguments)}return i.fn=r,this.on(e,i),this};We.prototype.off=We.prototype.removeListener=We.prototype.removeAllListeners=We.prototype.removeEventListener=function(e,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+e];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var s,l=0;l<i.length;l++)if(s=i[l],s===r||s.fn===r){i.splice(l,1);break}return i.length===0&&delete this._callbacks["$"+e],this};We.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),i=this._callbacks["$"+e],s=1;s<arguments.length;s++)r[s-1]=arguments[s];if(i){i=i.slice(0);for(var s=0,l=i.length;s<l;++s)i[s].apply(this,r)}return this};We.prototype.emitReserved=We.prototype.emit;We.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};We.prototype.hasListeners=function(e){return!!this.listeners(e).length};const da=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,i)=>i(r,0),jt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),bR="arraybuffer";function Uv(e,...r){return r.reduce((i,s)=>(e.hasOwnProperty(s)&&(i[s]=e[s]),i),{})}const wR=jt.setTimeout,xR=jt.clearTimeout;function ha(e,r){r.useNativeTimers?(e.setTimeoutFn=wR.bind(jt),e.clearTimeoutFn=xR.bind(jt)):(e.setTimeoutFn=jt.setTimeout.bind(jt),e.clearTimeoutFn=jt.clearTimeout.bind(jt))}const TR=1.33;function CR(e){return typeof e=="string"?kR(e):Math.ceil((e.byteLength||e.size)*TR)}function kR(e){let r=0,i=0;for(let s=0,l=e.length;s<l;s++)r=e.charCodeAt(s),r<128?i+=1:r<2048?i+=2:r<55296||r>=57344?i+=3:(s++,i+=4);return i}function Hv(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function RR(e){let r="";for(let i in e)e.hasOwnProperty(i)&&(r.length&&(r+="&"),r+=encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return r}function OR(e){let r={},i=e.split("&");for(let s=0,l=i.length;s<l;s++){let u=i[s].split("=");r[decodeURIComponent(u[0])]=decodeURIComponent(u[1])}return r}class NR extends Error{constructor(r,i,s){super(r),this.description=i,this.context=s,this.type="TransportError"}}class Sf extends We{constructor(r){super(),this.writable=!1,ha(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,i,s){return super.emitReserved("error",new NR(r,i,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(r){this.readyState==="open"&&this.write(r)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(r){const i=Ef(r,this.socket.binaryType);this.onPacket(i)}onPacket(r){super.emitReserved("packet",r)}onClose(r){this.readyState="closed",super.emitReserved("close",r)}pause(r){}createUri(r,i={}){return r+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const r=this.opts.hostname;return r.indexOf(":")===-1?r:"["+r+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(r){const i=RR(r);return i.length?"?"+i:""}}class AR extends Sf{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(r){this.readyState="pausing";const i=()=>{this.readyState="paused",r()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||i()})),this.writable||(s++,this.once("drain",function(){--s||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const i=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};vR(r,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const r=()=>{this.write([{type:"close"}])};this.readyState==="open"?r():this.once("open",r)}write(r){this.writable=!1,yR(r,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=Hv()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(r,i)}}let Gv=!1;try{Gv=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const PR=Gv;function IR(){}class DR extends AR{constructor(r){if(super(r),typeof location<"u"){const i=location.protocol==="https:";let s=location.port;s||(s=i?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||s!==r.port}}doWrite(r,i){const s=this.request({method:"POST",data:r});s.on("success",i),s.on("error",(l,u)=>{this.onError("xhr post error",l,u)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(i,s)=>{this.onError("xhr poll error",i,s)}),this.pollXhr=r}}class cn extends We{constructor(r,i,s){super(),this.createRequest=r,ha(this,s),this._opts=s,this._method=s.method||"GET",this._uri=i,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var r;const i=Uv(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(i);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let l in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(l)&&s.setRequestHeader(l,this._opts.extraHeaders[l])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var l;s.readyState===3&&((l=this._opts.cookieJar)===null||l===void 0||l.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(l){this.setTimeoutFn(()=>{this._onError(l)},0);return}typeof document<"u"&&(this._index=cn.requestsCount++,cn.requests[this._index]=this)}_onError(r){this.emitReserved("error",r,this._xhr),this._cleanup(!0)}_cleanup(r){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=IR,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete cn.requests[this._index],this._xhr=null}}_onLoad(){const r=this._xhr.responseText;r!==null&&(this.emitReserved("data",r),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}cn.requestsCount=0;cn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Gg);else if(typeof addEventListener=="function"){const e="onpagehide"in jt?"pagehide":"unload";addEventListener(e,Gg,!1)}}function Gg(){for(let e in cn.requests)cn.requests.hasOwnProperty(e)&&cn.requests[e].abort()}const MR=function(){const e=$v({xdomain:!1});return e&&e.responseType!==null}();class FR extends DR{constructor(r){super(r);const i=r&&r.forceBase64;this.supportsBinary=MR&&!i}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new cn($v,this.uri(),r)}}function $v(e){const r=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||PR))return new XMLHttpRequest}catch{}if(!r)try{return new jt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const qv=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class LR extends Sf{get name(){return"websocket"}doOpen(){const r=this.uri(),i=this.opts.protocols,s=qv?{}:Uv(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(r,i,s)}catch(l){return this.emitReserved("error",l)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=r=>this.onClose({description:"websocket connection closed",context:r}),this.ws.onmessage=r=>this.onData(r.data),this.ws.onerror=r=>this.onError("websocket error",r)}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const s=r[i],l=i===r.length-1;_f(s,this.supportsBinary,u=>{try{this.doWrite(s,u)}catch{}l&&da(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const r=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=Hv()),this.supportsBinary||(i.b64=1),this.createUri(r,i)}}const ac=jt.WebSocket||jt.MozWebSocket;class BR extends LR{createSocket(r,i,s){return qv?new ac(r,i,s):i?new ac(r,i):new ac(r)}doWrite(r,i){this.ws.send(i)}}class jR extends Sf{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(r){return this.emitReserved("error",r)}this._transport.closed.then(()=>{this.onClose()}).catch(r=>{this.onError("webtransport error",r)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(r=>{const i=ER(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=r.readable.pipeThrough(i).getReader(),l=_R();l.readable.pipeTo(r.writable),this._writer=l.writable.getWriter();const u=()=>{s.read().then(({done:h,value:p})=>{h||(this.onPacket(p),u())}).catch(h=>{})};u();const d={type:"open"};this.query.sid&&(d.data=`{"sid":"${this.query.sid}"}`),this._writer.write(d).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const s=r[i],l=i===r.length-1;this._writer.write(s).then(()=>{l&&da(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const zR={websocket:BR,webtransport:jR,polling:FR},UR=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,HR=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ic(e){if(e.length>8e3)throw"URI too long";const r=e,i=e.indexOf("["),s=e.indexOf("]");i!=-1&&s!=-1&&(e=e.substring(0,i)+e.substring(i,s).replace(/:/g,";")+e.substring(s,e.length));let l=UR.exec(e||""),u={},d=14;for(;d--;)u[HR[d]]=l[d]||"";return i!=-1&&s!=-1&&(u.source=r,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=GR(u,u.path),u.queryKey=$R(u,u.query),u}function GR(e,r){const i=/\/{2,9}/g,s=r.replace(i,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&s.splice(0,1),r.slice(-1)=="/"&&s.splice(s.length-1,1),s}function $R(e,r){const i={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,l,u){l&&(i[l]=u)}),i}const Dc=typeof addEventListener=="function"&&typeof removeEventListener=="function",$s=[];Dc&&addEventListener("offline",()=>{$s.forEach(e=>e())},!1);class Zn extends We{constructor(r,i){if(super(),this.binaryType=bR,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,r&&typeof r=="object"&&(i=r,r=null),r){const s=Ic(r);i.hostname=s.host,i.secure=s.protocol==="https"||s.protocol==="wss",i.port=s.port,s.query&&(i.query=s.query)}else i.host&&(i.hostname=Ic(i.host).host);ha(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(s=>{const l=s.prototype.name;this.transports.push(l),this._transportsByName[l]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=OR(this.opts.query)),Dc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},$s.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const i=Object.assign({},this.opts.query);i.EIO=zv,i.transport=r,this.id&&(i.sid=this.id);const s=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[r]);return new this._transportsByName[r](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&Zn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(r);i.open(),this.setTransport(i)}setTransport(r){this.transport&&this.transport.removeAllListeners(),this.transport=r,r.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",Zn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",r),this.emitReserved("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=r.data,this._onError(i);break;case"message":this.emitReserved("data",r.data),this.emitReserved("message",r.data);break}}onHandshake(r){this.emitReserved("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this._pingInterval=r.pingInterval,this._pingTimeout=r.pingTimeout,this._maxPayload=r.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const r=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+r,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},r),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const r=this._getWritablePackets();this.transport.send(r),this._prevBufferLen=r.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let s=0;s<this.writeBuffer.length;s++){const l=this.writeBuffer[s].data;if(l&&(i+=CR(l)),s>0&&i>this._maxPayload)return this.writeBuffer.slice(0,s);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,da(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,i,s){return this._sendPacket("message",r,i,s),this}send(r,i,s){return this._sendPacket("message",r,i,s),this}_sendPacket(r,i,s,l){if(typeof i=="function"&&(l=i,i=void 0),typeof s=="function"&&(l=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const u={type:r,data:i,options:s};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),l&&this.once("flush",l),this.flush()}close(){const r=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),r()},s=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():r()}):this.upgrading?s():r()),this}_onError(r){if(Zn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",r),this._onClose("transport error",r)}_onClose(r,i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Dc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=$s.indexOf(this._offlineEventListener);s!==-1&&$s.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,i),this.writeBuffer=[],this._prevBufferLen=0}}}Zn.protocol=zv;class qR extends Zn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let r=0;r<this._upgrades.length;r++)this._probe(this._upgrades[r])}_probe(r){let i=this.createTransport(r),s=!1;Zn.priorWebsocketSuccess=!1;const l=()=>{s||(i.send([{type:"ping",data:"probe"}]),i.once("packet",b=>{if(!s)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;Zn.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(y(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=i.name,this.emitReserved("upgradeError",m)}}))};function u(){s||(s=!0,y(),i.close(),i=null)}const d=b=>{const m=new Error("probe error: "+b);m.transport=i.name,u(),this.emitReserved("upgradeError",m)};function h(){d("transport closed")}function p(){d("socket closed")}function _(b){i&&b.name!==i.name&&u()}const y=()=>{i.removeListener("open",l),i.removeListener("error",d),i.removeListener("close",h),this.off("close",p),this.off("upgrading",_)};i.once("open",l),i.once("error",d),i.once("close",h),this.once("close",p),this.once("upgrading",_),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{s||i.open()},200):i.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const i=[];for(let s=0;s<r.length;s++)~this.transports.indexOf(r[s])&&i.push(r[s]);return i}}let VR=class extends qR{constructor(r,i={}){const s=typeof r=="object"?r:i;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(l=>zR[l]).filter(l=>!!l)),super(r,s)}};function WR(e,r="",i){let s=e;i=i||typeof location<"u"&&location,e==null&&(e=i.protocol+"//"+i.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=i.protocol+e:e=i.host+e),/^(https?|wss?):\/\//.test(e)||(typeof i<"u"?e=i.protocol+"//"+e:e="https://"+e),s=Ic(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const u=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+u+":"+s.port+r,s.href=s.protocol+"://"+u+(i&&i.port===s.port?"":":"+s.port),s}const XR=typeof ArrayBuffer=="function",QR=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Vv=Object.prototype.toString,KR=typeof Blob=="function"||typeof Blob<"u"&&Vv.call(Blob)==="[object BlobConstructor]",YR=typeof File=="function"||typeof File<"u"&&Vv.call(File)==="[object FileConstructor]";function bf(e){return XR&&(e instanceof ArrayBuffer||QR(e))||KR&&e instanceof Blob||YR&&e instanceof File}function qs(e,r){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let i=0,s=e.length;i<s;i++)if(qs(e[i]))return!0;return!1}if(bf(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return qs(e.toJSON(),!0);for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&qs(e[i]))return!0;return!1}function ZR(e){const r=[],i=e.data,s=e;return s.data=Mc(i,r),s.attachments=r.length,{packet:s,buffers:r}}function Mc(e,r){if(!e)return e;if(bf(e)){const i={_placeholder:!0,num:r.length};return r.push(e),i}else if(Array.isArray(e)){const i=new Array(e.length);for(let s=0;s<e.length;s++)i[s]=Mc(e[s],r);return i}else if(typeof e=="object"&&!(e instanceof Date)){const i={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=Mc(e[s],r));return i}return e}function JR(e,r){return e.data=Fc(e.data,r),delete e.attachments,e}function Fc(e,r){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<r.length)return r[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i]=Fc(e[i],r);else if(typeof e=="object")for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(e[i]=Fc(e[i],r));return e}const eO=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],tO=5;var Ee;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ee||(Ee={}));class nO{constructor(r){this.replacer=r}encode(r){return(r.type===Ee.EVENT||r.type===Ee.ACK)&&qs(r)?this.encodeAsBinary({type:r.type===Ee.EVENT?Ee.BINARY_EVENT:Ee.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let i=""+r.type;return(r.type===Ee.BINARY_EVENT||r.type===Ee.BINARY_ACK)&&(i+=r.attachments+"-"),r.nsp&&r.nsp!=="/"&&(i+=r.nsp+","),r.id!=null&&(i+=r.id),r.data!=null&&(i+=JSON.stringify(r.data,this.replacer)),i}encodeAsBinary(r){const i=ZR(r),s=this.encodeAsString(i.packet),l=i.buffers;return l.unshift(s),l}}function $g(e){return Object.prototype.toString.call(e)==="[object Object]"}class wf extends We{constructor(r){super(),this.reviver=r}add(r){let i;if(typeof r=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(r);const s=i.type===Ee.BINARY_EVENT;s||i.type===Ee.BINARY_ACK?(i.type=s?Ee.EVENT:Ee.ACK,this.reconstructor=new rO(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(bf(r)||r.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(r),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+r)}decodeString(r){let i=0;const s={type:Number(r.charAt(0))};if(Ee[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===Ee.BINARY_EVENT||s.type===Ee.BINARY_ACK){const u=i+1;for(;r.charAt(++i)!=="-"&&i!=r.length;);const d=r.substring(u,i);if(d!=Number(d)||r.charAt(i)!=="-")throw new Error("Illegal attachments");s.attachments=Number(d)}if(r.charAt(i+1)==="/"){const u=i+1;for(;++i&&!(r.charAt(i)===","||i===r.length););s.nsp=r.substring(u,i)}else s.nsp="/";const l=r.charAt(i+1);if(l!==""&&Number(l)==l){const u=i+1;for(;++i;){const d=r.charAt(i);if(d==null||Number(d)!=d){--i;break}if(i===r.length)break}s.id=Number(r.substring(u,i+1))}if(r.charAt(++i)){const u=this.tryParse(r.substr(i));if(wf.isPayloadValid(s.type,u))s.data=u;else throw new Error("invalid payload")}return s}tryParse(r){try{return JSON.parse(r,this.reviver)}catch{return!1}}static isPayloadValid(r,i){switch(r){case Ee.CONNECT:return $g(i);case Ee.DISCONNECT:return i===void 0;case Ee.CONNECT_ERROR:return typeof i=="string"||$g(i);case Ee.EVENT:case Ee.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&eO.indexOf(i[0])===-1);case Ee.ACK:case Ee.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class rO{constructor(r){this.packet=r,this.buffers=[],this.reconPack=r}takeBinaryData(r){if(this.buffers.push(r),this.buffers.length===this.reconPack.attachments){const i=JR(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const iO=Object.freeze(Object.defineProperty({__proto__:null,Decoder:wf,Encoder:nO,get PacketType(){return Ee},protocol:tO},Symbol.toStringTag,{value:"Module"}));function Zt(e,r,i){return e.on(r,i),function(){e.off(r,i)}}const oO=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Wv extends We{constructor(r,i,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=r,this.nsp=i,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const r=this.io;this.subs=[Zt(r,"open",this.onopen.bind(this)),Zt(r,"packet",this.onpacket.bind(this)),Zt(r,"error",this.onerror.bind(this)),Zt(r,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...r){return r.unshift("message"),this.emit.apply(this,r),this}emit(r,...i){var s,l,u;if(oO.hasOwnProperty(r))throw new Error('"'+r.toString()+'" is a reserved event name');if(i.unshift(r),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const d={type:Ee.EVENT,data:i};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const y=this.ids++,b=i.pop();this._registerAckCallback(y,b),d.id=y}const h=(l=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||l===void 0?void 0:l.writable,p=this.connected&&!(!((u=this.io.engine)===null||u===void 0)&&u._hasPingExpired());return this.flags.volatile&&!h||(p?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d)),this.flags={},this}_registerAckCallback(r,i){var s;const l=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(l===void 0){this.acks[r]=i;return}const u=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===r&&this.sendBuffer.splice(h,1);i.call(this,new Error("operation has timed out"))},l),d=(...h)=>{this.io.clearTimeoutFn(u),i.apply(this,h)};d.withError=!0,this.acks[r]=d}emitWithAck(r,...i){return new Promise((s,l)=>{const u=(d,h)=>d?l(d):s(h);u.withError=!0,i.push(u),this.emit(r,...i)})}_addToQueue(r){let i;typeof r[r.length-1]=="function"&&(i=r.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((l,...u)=>s!==this._queue[0]?void 0:(l!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(l)):(this._queue.shift(),i&&i(null,...u)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(r=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!r||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(r){r.nsp=this.nsp,this.io._packet(r)}onopen(){typeof this.auth=="function"?this.auth(r=>{this._sendConnectPacket(r)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(r){this.packet({type:Ee.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},r):r})}onerror(r){this.connected||this.emitReserved("connect_error",r)}onclose(r,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",r,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(r=>{if(!this.sendBuffer.some(s=>String(s.id)===r)){const s=this.acks[r];delete this.acks[r],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case Ee.CONNECT:r.data&&r.data.sid?this.onconnect(r.data.sid,r.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ee.EVENT:case Ee.BINARY_EVENT:this.onevent(r);break;case Ee.ACK:case Ee.BINARY_ACK:this.onack(r);break;case Ee.DISCONNECT:this.ondisconnect();break;case Ee.CONNECT_ERROR:this.destroy();const s=new Error(r.data.message);s.data=r.data.data,this.emitReserved("connect_error",s);break}}onevent(r){const i=r.data||[];r.id!=null&&i.push(this.ack(r.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(r){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const s of i)s.apply(this,r)}super.emit.apply(this,r),this._pid&&r.length&&typeof r[r.length-1]=="string"&&(this._lastOffset=r[r.length-1])}ack(r){const i=this;let s=!1;return function(...l){s||(s=!0,i.packet({type:Ee.ACK,id:r,data:l}))}}onack(r){const i=this.acks[r.id];typeof i=="function"&&(delete this.acks[r.id],i.withError&&r.data.unshift(null),i.apply(this,r.data))}onconnect(r,i){this.id=r,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(r=>this.emitEvent(r)),this.receiveBuffer=[],this.sendBuffer.forEach(r=>{this.notifyOutgoingListeners(r),this.packet(r)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(r=>r()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ee.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(r){return this.flags.compress=r,this}get volatile(){return this.flags.volatile=!0,this}timeout(r){return this.flags.timeout=r,this}onAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(r),this}prependAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(r),this}offAny(r){if(!this._anyListeners)return this;if(r){const i=this._anyListeners;for(let s=0;s<i.length;s++)if(r===i[s])return i.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(r),this}prependAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(r),this}offAnyOutgoing(r){if(!this._anyOutgoingListeners)return this;if(r){const i=this._anyOutgoingListeners;for(let s=0;s<i.length;s++)if(r===i[s])return i.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(r){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const s of i)s.apply(this,r.data)}}}function ti(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ti.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),i=Math.floor(r*this.jitter*e);e=Math.floor(r*10)&1?e+i:e-i}return Math.min(e,this.max)|0};ti.prototype.reset=function(){this.attempts=0};ti.prototype.setMin=function(e){this.ms=e};ti.prototype.setMax=function(e){this.max=e};ti.prototype.setJitter=function(e){this.jitter=e};class Lc extends We{constructor(r,i){var s;super(),this.nsps={},this.subs=[],r&&typeof r=="object"&&(i=r,r=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,ha(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((s=i.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new ti({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=r;const l=i.parser||iO;this.encoder=new l.Encoder,this.decoder=new l.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(r){return arguments.length?(this._reconnection=!!r,r||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(r){return r===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=r,this)}reconnectionDelay(r){var i;return r===void 0?this._reconnectionDelay:(this._reconnectionDelay=r,(i=this.backoff)===null||i===void 0||i.setMin(r),this)}randomizationFactor(r){var i;return r===void 0?this._randomizationFactor:(this._randomizationFactor=r,(i=this.backoff)===null||i===void 0||i.setJitter(r),this)}reconnectionDelayMax(r){var i;return r===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=r,(i=this.backoff)===null||i===void 0||i.setMax(r),this)}timeout(r){return arguments.length?(this._timeout=r,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(r){if(~this._readyState.indexOf("open"))return this;this.engine=new VR(this.uri,this.opts);const i=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const l=Zt(i,"open",function(){s.onopen(),r&&r()}),u=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),r?r(h):this.maybeReconnectOnOpen()},d=Zt(i,"error",u);if(this._timeout!==!1){const h=this._timeout,p=this.setTimeoutFn(()=>{l(),u(new Error("timeout")),i.close()},h);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(l),this.subs.push(d),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(Zt(r,"ping",this.onping.bind(this)),Zt(r,"data",this.ondata.bind(this)),Zt(r,"error",this.onerror.bind(this)),Zt(r,"close",this.onclose.bind(this)),Zt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(r){try{this.decoder.add(r)}catch(i){this.onclose("parse error",i)}}ondecoded(r){da(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,i){let s=this.nsps[r];return s?this._autoConnect&&!s.active&&s.connect():(s=new Wv(this,r,i),this.nsps[r]=s),s}_destroy(r){const i=Object.keys(this.nsps);for(const s of i)if(this.nsps[s].active)return;this._close()}_packet(r){const i=this.encoder.encode(r);for(let s=0;s<i.length;s++)this.engine.write(i[s],r.options)}cleanup(){this.subs.forEach(r=>r()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(r,i){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",r,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const r=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{r.skipReconnect||(this.emitReserved("reconnect_attempt",r.backoff.attempts),!r.skipReconnect&&r.open(l=>{l?(r._reconnecting=!1,r.reconnect(),this.emitReserved("reconnect_error",l)):r.onreconnect()}))},i);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const Qi={};function Vs(e,r){typeof e=="object"&&(r=e,e=void 0),r=r||{};const i=WR(e,r.path||"/socket.io"),s=i.source,l=i.id,u=i.path,d=Qi[l]&&u in Qi[l].nsps,h=r.forceNew||r["force new connection"]||r.multiplex===!1||d;let p;return h?p=new Lc(s,r):(Qi[l]||(Qi[l]=new Lc(s,r)),p=Qi[l]),i.query&&!r.query&&(r.query=i.queryKey),p.socket(i.path,r)}Object.assign(Vs,{Manager:Lc,Socket:Wv,io:Vs,connect:Vs});const sO=[ge.ActionTypes.MESSAGE_TO_GUEST,ge.ActionTypes.EVENT_TO_GUEST,ge.ActionTypes.TYPING_ON,ge.ActionTypes.TYPING_OFF,ge.ActionTypes.RESTART_CHAT_REQUEST,...Tw,...yb,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],aO=({dispatch:e,getState:r})=>i=>{let s=null;return l=>{const u=i(l);if(l.type===uf){s!=null&&s.disconnect(),e(Rw());const d=`/chat?${Xc.stringify(l.querystrings)}`;s=Vs(`/${l.clientName}${d}`),s.on("action",e),s.on("connect",()=>e(Ow())),s.on("disconnect",()=>e(Nw())),s.on("reconnect",()=>e(Aw())),s.on("set-use-start-screen",h=>{e(h?mw():gw())}),s.on("set-commands",(h=[])=>{e(xb(h))}),s.on("set-translations",(h,p)=>{e(sR({language:h,messages:eR(h,p)}))}),s.on("enable-speech-support",()=>e(_b())),s.on("enable-transcript-export",h=>e(Sb(h))),s.on("enable-conversation-rating",h=>e(Cb(h))),s.on("speech-transcription",h=>e(Eb(h))),s.on("restore-client-state",h=>{e(kw(h.sessionId)),e(Rb(h.messages))}),s.on("expand-window",({devices:h})=>e({type:My,devices:h})),s.on("show-general-conditions",()=>e(wb())),s.on("restart-chat",()=>{e(mf(l.clientName,l.querystrings))})}else if(l.type===ua)s==null||s.emit("start-chat",l.payload);else if(l.type===ca)s==null||s.emit("terminate-session",l.payload);else if(l.type===gb)s==null||s.emit("get-started",JSON.stringify(l));else if(l.type===Zc)s==null||s.emit("audio-message",l.buffer);else if(l.type===ge.ActionTypes.CONVERSATION_RATING_FROM_GUEST)s==null||s.emit("conversation-rating",l.payload);else if(l.type===Fy){const{connection:{sessionId:d}}=r();window.location.href=`/transcript-pdf/${d}`}else sO.indexOf(l.type)===-1&&l.meta===void 0&&s&&s.emit("action",JSON.stringify(l));return u}},Xv=wy(),lO={...uR(Xv),intl:Av},Bc=nw({middleware:e=>e().concat(aO),reducer:lR,preloadedState:lO});Bc.subscribe(Wk(()=>{const e=Bc.getState();cR(Xv,{connection:e.connection,startScreen:e.startScreen})},1e3));const uO=document.getElementById("root"),cO=t1.createRoot(uO);cO.render(R.jsx(Z1,{store:Bc,children:R.jsx(Ik,{})}));
|
|
110
|
-
//# sourceMappingURL=index-
|
|
110
|
+
//# sourceMappingURL=index-RyoFceI4.js.map
|