@botfabrik/engine-webclient 4.85.2 → 4.85.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.
|
@@ -103,7 +103,7 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
|
|
|
103
103
|
`,{inline:x}));for(;typeof T[T.length-1]=="string"&&!T[T.length-1].trim();)T.pop();if(r.wrapper===null)return T;const z=r.wrapper||(x?"span":"div");let N;if(T.length>1||r.forceWrapper)N=T;else{if(T.length===1)return N=T[0],typeof N=="string"?i("span",{key:"outer"},N):N;N=null}return r.createElement(z,{key:"outer"},N)}function u(y,x){const T=x.match(WA);return T?T.reduce(function(z,N){const H=N.indexOf("=");if(H!==-1){const D=function(U){return U.indexOf("-")!==-1&&U.match(pO)===null&&(U=U.replace(vO,function(Y,K){return K.toUpperCase()})),U}(N.slice(0,H)).trim(),O=function(U){const Y=U[0];return(Y==='"'||Y==="'")&&U.length>=2&&U[U.length-1]===Y?U.slice(1,-1):U}(N.slice(H+1).trim()),R=Ey[D]||D;if(R==="ref")return z;const E=z[R]=function(U,Y,K,re){return Y==="style"?function(ee){const le=[];let ie="",de=!1,Ie=!1,Te="";if(!ee)return le;for(let X=0;X<ee.length;X++){const J=ee[X];if(J!=='"'&&J!=="'"||de||(Ie?J===Te&&(Ie=!1,Te=""):(Ie=!0,Te=J)),J==="("&&ie.endsWith("url")?de=!0:J===")"&&de&&(de=!1),J!==";"||Ie||de)ie+=J;else{const _e=ie.trim();if(_e){const w=_e.indexOf(":");if(w>0){const P=_e.slice(0,w).trim(),$=_e.slice(w+1).trim();le.push([P,$])}}ie=""}}const G=ie.trim();if(G){const X=G.indexOf(":");if(X>0){const J=G.slice(0,X).trim(),_e=G.slice(X+1).trim();le.push([J,_e])}}return le}(K).reduce(function(ee,[le,ie]){return ee[le.replace(/(-[a-z])/g,de=>de[1].toUpperCase())]=re(ie,U,le),ee},{}):JA.indexOf(Y)!==-1?re(K,U,Y):(K.match(gO)&&(K=K.slice(1,K.length-1)),K==="true"||K!=="false"&&K)}(y,D,O,r.sanitizer);typeof E=="string"&&(hh.test(E)||dh.test(E))&&(z[R]=l(E.trim()))}else N!=="style"&&(z[Ey[N]||N]=!0);return z},{}):null}r.overrides=r.overrides||{},r.sanitizer=r.sanitizer||$O,r.slugify=r.slugify||Zi,r.namedCodesToUnicode=r.namedCodesToUnicode?Zr({},Sy,r.namedCodesToUnicode):Sy,r.createElement=r.createElement||I.createElement;const f=[],h={},d={[ue.blockQuote]:{match:Gn(kb),order:1,parse(y,x,T){const[,z,N]=y[0].replace(nO,"").match(rO);return{alert:z,children:x(N,T)}},render(y,x,T){const z={key:T.key};return y.alert&&(z.className="markdown-alert-"+r.slugify(y.alert.toLowerCase(),Zi),y.children.unshift({attrs:{},children:[{type:ue.text,text:y.alert}],noInnerParse:!0,type:ue.htmlBlock,tag:"header"})),i("blockquote",z,x(y.children,T))}},[ue.breakLine]:{match:Xi(aO),order:1,parse:pf,render:(y,x,T)=>i("br",{key:T.key})},[ue.breakThematic]:{match:Gn(iO),order:1,parse:pf,render:(y,x,T)=>i("hr",{key:T.key})},[ue.codeBlock]:{match:Gn(qb),order:0,parse:y=>({lang:void 0,text:rs(y[0].replace(/^ {4}/gm,"")).replace(Ty,"$1")}),render:(y,x,T)=>i("pre",{key:T.key},i("code",Zr({},y.attrs,{className:y.lang?`lang-${y.lang}`:""}),y.text))},[ue.codeFenced]:{match:Gn(Gb),order:0,parse:y=>({attrs:u("code",y[3]||""),lang:y[2]||void 0,text:y[4],type:ue.codeBlock})},[ue.codeInline]:{match:_r(sO),order:3,parse:y=>({text:y[2].replace(Ty,"$1")}),render:(y,x,T)=>i("code",{key:T.key},y.text)},[ue.footnote]:{match:Gn(uO),order:0,parse:y=>(f.push({footnote:y[2],identifier:y[1]}),{}),render:gf},[ue.footnoteReference]:{match:yr(cO),order:1,parse:y=>({target:`#${r.slugify(y[1],Zi)}`,text:y[1]}),render:(y,x,T)=>i("a",{key:T.key,href:r.sanitizer(y.target,"a","href")},i("sup",{key:T.key},y.text))},[ue.gfmTask]:{match:yr(dO),order:1,parse:y=>({completed:y[1].toLowerCase()==="x"}),render:(y,x,T)=>i("input",{checked:y.completed,key:T.key,readOnly:!0,type:"checkbox"})},[ue.heading]:{match:Gn(r.enforceAtxHeadings?Fb:Ib),order:1,parse:(y,x,T)=>({children:eo(x,y[2],T),id:r.slugify(y[2],Zi),level:y[1].length}),render:(y,x,T)=>i(`h${y.level}`,{id:y.id,key:T.key},x(y.children,T))},[ue.headingSetext]:{match:Gn(Vb),order:0,parse:(y,x,T)=>({children:eo(x,y[1],T),level:y[2]==="="?1:2,type:ue.heading})},[ue.htmlBlock]:{match:Xi(hh),order:1,parse(y,x,T){const[,z]=y[3].match(LO),N=new RegExp(`^${z}`,"gm"),H=y[3].replace(N,""),D=(O=H,YO.some(K=>K.test(O))?WO:eo);var O;const R=y[1].toLowerCase(),E=$A.indexOf(R)!==-1,U=(E?R:y[1]).trim(),Y={attrs:u(U,y[2]),noInnerParse:E,tag:U};return T.inAnchor=T.inAnchor||R==="a",E?Y.text=y[3]:Y.children=D(x,H,T),T.inAnchor=!1,Y},render:(y,x,T)=>i(y.tag,Zr({key:T.key},y.attrs),y.text||(y.children?x(y.children,T):""))},[ue.htmlSelfClosing]:{match:Xi(dh),order:1,parse(y){const x=y[1].trim();return{attrs:u(x,y[2]||""),tag:x}},render:(y,x,T)=>i(y.tag,Zr({},y.attrs,{key:T.key}))},[ue.htmlComment]:{match:Xi(Pb),order:1,parse:()=>({}),render:gf},[ue.image]:{match:_r(PO),order:1,parse:y=>({alt:y[1],target:Ry(y[2]),title:y[3]}),render:(y,x,T)=>i("img",{key:T.key,alt:y.alt||void 0,title:y.title||void 0,src:r.sanitizer(y.target,"img","src")})},[ue.link]:{match:yr(VO),order:3,parse:(y,x,T)=>({children:JO(x,y[1],T),target:Ry(y[2]),title:y[3]}),render:(y,x,T)=>i("a",{key:T.key,href:r.sanitizer(y.target,"a","href"),title:y.title},x(y.children,T))},[ue.linkAngleBraceStyleDetector]:{match:yr(bO),order:0,parse:y=>({children:[{text:y[1],type:ue.text}],target:y[1],type:ue.link})},[ue.linkBareUrlDetector]:{match:Ga((y,x)=>x.inAnchor||r.disableAutoLink?null:yr(yO)(y,x)),order:0,parse:y=>({children:[{text:y[1],type:ue.text}],target:y[1],title:void 0,type:ue.link})},[ue.linkMailtoDetector]:{match:yr(_O),order:0,parse(y){let x=y[1],T=y[1];return eO.test(T)||(T="mailto:"+T),{children:[{text:x.replace("mailto:",""),type:ue.text}],target:T,type:ue.link}}},[ue.orderedList]:xy(i,1),[ue.unorderedList]:xy(i,2),[ue.newlineCoalescer]:{match:Gn(lO),order:3,parse:pf,render:()=>`
|
|
104
104
|
`},[ue.paragraph]:{match:Ga(QO),order:3,parse:mf,render:(y,x,T)=>i("p",{key:T.key},x(y.children,T))},[ue.ref]:{match:yr(EO),order:0,parse:y=>(h[y[1]]={target:y[2],title:y[4]},{}),render:gf},[ue.refImage]:{match:_r(SO),order:0,parse:y=>({alt:y[1]||void 0,ref:y[2]}),render:(y,x,T)=>h[y.ref]?i("img",{key:T.key,alt:y.alt,src:r.sanitizer(h[y.ref].target,"img","src"),title:h[y.ref].title}):null},[ue.refLink]:{match:yr(TO),order:0,parse:(y,x,T)=>({children:x(y[1],T),fallbackChildren:y[0],ref:y[2]}),render:(y,x,T)=>h[y.ref]?i("a",{key:T.key,href:r.sanitizer(h[y.ref].target,"a","href"),title:h[y.ref].title},x(y.children,T)):i("span",{key:T.key},y.fallbackChildren)},[ue.table]:{match:Gn(Yb),order:1,parse:XO,render(y,x,T){const z=y;return i("table",{key:T.key},i("thead",null,i("tr",null,z.header.map(function(N,H){return i("th",{key:H,style:Oy(z,H)},x(N,T))}))),i("tbody",null,z.cells.map(function(N,H){return i("tr",{key:H},N.map(function(D,O){return i("td",{key:O,style:Oy(z,O)},x(D,T))}))})))}},[ue.text]:{match:Xi(UO),order:4,parse:y=>({text:y[0].replace(mO,(x,T)=>r.namedCodesToUnicode[T]?r.namedCodesToUnicode[T]:x)}),render:y=>y.text},[ue.textBolded]:{match:_r(NO),order:2,parse:(y,x,T)=>({children:x(y[2],T)}),render:(y,x,T)=>i("strong",{key:T.key},x(y.children,T))},[ue.textEmphasized]:{match:_r(DO),order:3,parse:(y,x,T)=>({children:x(y[2],T)}),render:(y,x,T)=>i("em",{key:T.key},x(y.children,T))},[ue.textEscaped]:{match:_r(jO),order:1,parse:y=>({text:y[1],type:ue.text})},[ue.textMarked]:{match:_r(MO),order:3,parse:mf,render:(y,x,T)=>i("mark",{key:T.key},x(y.children,T))},[ue.textStrikethroughed]:{match:_r(BO),order:3,parse:mf,render:(y,x,T)=>i("del",{key:T.key},x(y.children,T))}};r.disableParsingRawHTML===!0&&(delete d[ue.htmlBlock],delete d[ue.htmlSelfClosing]);const m=function(y){let x=Object.keys(y);function T(z,N){let H,D,O=[],R="",E="";for(N.prevCapture=N.prevCapture||"";z;){let U=0;for(;U<x.length;){if(R=x[U],H=y[R],N.inline&&!H.match.inline){U++;continue}const Y=H.match(z,N);if(Y){E=Y[0],N.prevCapture+=E,z=z.substring(E.length),D=H.parse(Y,T,N),D.type==null&&(D.type=R),O.push(D);break}U++}}return N.prevCapture="",O}return x.sort(function(z,N){let H=y[z].order,D=y[N].order;return H!==D?H-D:z<N?-1:1}),function(z,N){return T(function(H){return H.replace(oO,`
|
|
105
105
|
`).replace(fO,"").replace(AO," ")}(z),N)}}(d),g=(_=function(y,x){return function(T,z,N){const H=y[T.type].render;return x?x(()=>H(T,z,N),T,z,N):H(T,z,N)}}(d,r.renderRule),function y(x,T={}){if(Array.isArray(x)){const z=T.key,N=[];let H=!1;for(let D=0;D<x.length;D++){T.key=D;const O=y(x[D],T),R=typeof O=="string";R&&H?N[N.length-1]+=O:O!==null&&N.push(O),H=R}return T.key=z,N}return _(x,y,T)});var _;const S=l(n);return f.length?i("div",null,S,i("footer",{key:"footer"},f.map(function(y){return i("div",{id:r.slugify(y.identifier,Zi),key:y.identifier},y.identifier,g(m(y.footnote,{inline:!0})))}))):S}const bn=n=>{let{children:r="",options:i}=n,l=function(u,f){if(u==null)return{};var h,d,m={},g=Object.keys(u);for(d=0;d<g.length;d++)f.indexOf(h=g[d])>=0||(m[h]=u[h]);return m}(n,KA);return I.cloneElement(tR(r,i),l)},nR="_generalConditionsContainer_55hjg_1",rR="_generalConditions_55hjg_1",aR="_generalConditionsHeader_55hjg_15",iR="_generalConditionsBody_55hjg_26",sR="_generalConditionsAccept_55hjg_35",Qi={generalConditionsContainer:nR,generalConditions:rR,generalConditionsHeader:aR,generalConditionsBody:iR,generalConditionsAccept:sR},lR=()=>b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:b.jsx("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"})}),oR=()=>b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:b.jsx("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"})}),uR="general-conditions.header",cR="general-conditions.body",wy="general-conditions.accept-conditions-note",fR=()=>{const n=We(),[r,i]=I.useState(!1),l=()=>i(!r),u=d=>{d.key==="ArrowDown"||d.key==="ArrowRight"?i(!0):d.key==="ArrowUp"||d.key==="ArrowLeft"||d.key==="Escape"?i(!1):(d.key==="Enter"||d.key==="Space"||d.key===" ")&&l()},f=n(uR),h=n(wy);return b.jsxs("div",{className:Z(Qi.generalConditionsContainer,"chat__generalConditions"),children:[!!(f!=null&&f.length)&&b.jsxs("div",{className:Qi.generalConditions,children:[b.jsxs("div",{role:"button",onClick:l,onKeyDown:u,tabIndex:0,className:Z(Qi.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":r?"true":"false","aria-pressed":r?"true":"false",children:[b.jsx(bn,{children:f}),r?b.jsx(oR,{}):b.jsx(lR,{})]}),b.jsx("div",{className:Z(Qi.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:r&&b.jsx(bn,{children:n(cR)||""})})]}),!!(h!=null&&h.length)&&b.jsx("div",{className:Z(Qi.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:b.jsx(bn,{children:n(wy)||""})})]})},hR="_message_59o8c_1",dR="_messageBot_59o8c_9",mR="_messageBotLast_59o8c_19",pR="_avatar_59o8c_19",gR="_messageBotFirst_59o8c_24",yR="_messageBotAnimated_59o8c_37",_R="_messageGuest_59o8c_48",bR="_messageGuestFirst_59o8c_54",vR="_messageGuestLast_59o8c_60",ER="_botAvatar_59o8c_74",SR="_agentAvatar_59o8c_78",TR="_bubble_59o8c_82",xR="_bubbleContent_59o8c_88",AR="_bubbleLeft_59o8c_102",OR="_leftText_59o8c_113",RR="_bubbleRight_59o8c_120",wR="_rightText_59o8c_130",CR="_sourceInfoReference_59o8c_162",NR="_sourceInfoReferenceActive_59o8c_176",me={message:hR,messageBot:dR,messageBotLast:mR,avatar:pR,messageBotFirst:gR,messageBotAnimated:yR,messageGuest:_R,messageGuestFirst:bR,messageGuestLast:vR,botAvatar:ER,agentAvatar:SR,bubble:TR,bubbleContent:xR,bubbleLeft:AR,leftText:OR,bubbleRight:RR,rightText:wR,sourceInfoReference:CR,sourceInfoReferenceActive:NR},DR="_botMessageActions_1dl7x_1",MR="_alwaysVisible_1dl7x_22",BR="_reported_1dl7x_29",jR="_action_1dl7x_33",br={botMessageActions:DR,alwaysVisible:MR,reported:BR,action:jR},UR=({alwaysVisible:n,reaction:r,botMessageRef:i,onReaction:l})=>{const u=We(),[f,h]=I.useState(!1),d=g=>()=>l(g),m=I.useCallback(async()=>{if(i.current)try{h(!0);const g=i.current.innerHTML,_=i.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([g],{type:"text/html"}),"text/plain":new Blob([_],{type:"text/plain"})})]),await new Promise(S=>setTimeout(S,1500))}finally{h(!1)}},[i]);return b.jsxs("div",{className:Z(br.botMessageActions,n&&br.alwaysVisible,r&&br.reported),children:[b.jsx("button",{className:Z(br.action,r==="GOOD"&&br.reported,"tooltip--right"),tabIndex:0,"aria-label":u(r==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),"data-title":u(r==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),onClick:d(r==="GOOD"?null:"GOOD"),children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:r==="GOOD"?b.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"}):b.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"})})}),b.jsx("button",{className:Z(br.action,r==="BAD"&&br.reported,"tooltip--right"),tabIndex:0,"aria-label":u(r==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),"data-title":u(r==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),onClick:d(r==="BAD"?null:"BAD"),children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:r==="BAD"?b.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"}):b.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"})})}),b.jsx("button",{className:Z(br.action,"tooltip--right"),tabIndex:0,"aria-label":u("bot-bubble.copy"),"data-title":u("bot-bubble.copy"),onClick:m,children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:f?b.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"}):b.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"})})})]})},nv=I.forwardRef(({message:n,isAnimated:r,isLastMessage:i,isFirstMessageBySender:l,isLastMessageBySender:u,children:f,onReaction:h},d)=>{const m=We(),g=I.useRef(null),_=n.sender.type===Ee.UserType.BOT;return b.jsxs("li",{ref:d,className:Z(me.message,me.messageBot,i&&me.lastMessage,l&&me.messageBotFirst,u&&me.messageBotLast,"chat__bubbleContainer",r&&me.messageBotAnimated,r&&"chat__bubbleContainer--animated",_?"chat__botBubbleContainer":"chat__agentBubbleContainer",l&&"chat__bubbleContainer--first",u&&"chat__bubbleContainer--last"),children:[b.jsx("img",{className:Z(me.avatar,_?me.botAvatar:me.agentAvatar,"chat__avatar",_?"chat__botAvatar":"chat__agentAvatar"),src:`${n.sender.avatar}`,alt:_?"Bot":"Agent",referrerPolicy:"no-referrer"}),b.jsx("div",{ref:g,className:Z(me.bubble,me.bubbleLeft,"chat__bubble",_?"chat__botBubble":"chat__agentBubble"),tabIndex:0,"aria-label":m(_?"bot-bubble.label":"agent-bubble.label"),children:b.jsx("div",{className:Z(me.leftText),children:f})}),h&&b.jsx(UR,{alwaysVisible:i&&u,reaction:n.reaction,botMessageRef:g,onReaction:h})]})}),HR="_sourceList_1p11n_1",LR="_source_1p11n_1",zR="_label_1p11n_36",_f={sourceList:HR,source:LR,label:zR},rv=n=>b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:b.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),av=n=>b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:b.jsx("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z"})}),iv=n=>b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:b.jsx("path",{d:"M222,152a6,6,0,0,1-6,6H190v20h18a6,6,0,0,1,0,12H190v18a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6h32A6,6,0,0,1,222,152ZM90,172a26,26,0,0,1-26,26H54v10a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6H64A26,26,0,0,1,90,172Zm-12,0a14,14,0,0,0-14-14H54v28H64A14,14,0,0,0,78,172Zm84,8a34,34,0,0,1-34,34H112a6,6,0,0,1-6-6V152a6,6,0,0,1,6-6h16A34,34,0,0,1,162,180Zm-12,0a22,22,0,0,0-22-22H118v44h10A22,22,0,0,0,150,180ZM42,112V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88v24a6,6,0,0,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,0,1-12,0ZM158,82h35.52L158,46.48Z"})}),sv=n=>b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:b.jsx("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"})}),kR=({type:n,...r})=>{switch(n){case"WEBSITE":return b.jsx(sv,{...r});case"PDF":return b.jsx(iv,{...r});case"DOCX":return b.jsx(rv,{...r});default:return b.jsx(av,{...r})}},Qh=({sources:n,onLinkClick:r})=>{const i=We(),l=f=>()=>{r(f.url)},u=f=>h=>{(h.key==="Enter"||h.key===" ")&&r(f.url)};return n.length?b.jsx("ul",{className:_f.sourceList,"aria-label":i("bot-bubble.sources"),children:n.map(f=>b.jsx("li",{className:_f.source,children:b.jsxs("a",{role:"button",tabIndex:0,"aria-label":`${i("bot-bubble.source.open")}: ${f.label}`,onClick:l(f),onKeyDown:u(f),children:[b.jsx(kR,{type:f.type,"aria-hidden":"true"}),b.jsx("div",{className:_f.label,children:f.label})]})},f.url))}):null},GR="_button_3ui4g_1",qR="_buttonDefault_3ui4g_13",IR="_buttonPrimary_3ui4g_28",as={button:GR,buttonDefault:qR,buttonPrimary:IR},Ao=({className:n,children:r,...i})=>b.jsx("button",{className:Z(as.button,n),type:"button",...i,children:r}),FR="_title_b904h_1",VR="_subtitle_b904h_6",PR="_buttons_b904h_11",YR="_button_b904h_11",ZR="_imageContainer_b904h_34",XR="_image_b904h_34",QR="_video_container_b904h_49",KR="_video_b904h_49",$R="_only_b904h_63",At={title:FR,subtitle:VR,buttons:PR,button:YR,imageContainer:ZR,image:XR,video_container:QR,video:KR,only:$R},JR=({buttons:n,onButtonClick:r})=>b.jsx("div",{className:Z(At.buttons,"chat__bubbleButtons"),children:n.map((i,l)=>b.jsx(Ao,{className:Z(At.button,"chat__bubbleButton"),onClick:()=>r(i),children:i.title},l))});var Il={},Fl={},Vl={},Cy;function WR(){if(Cy)return Vl;Cy=1,Object.defineProperty(Vl,"__esModule",{value:!0});var n=qa(),r=i(n);function i(l){if(l&&l.__esModule)return l;var u={};if(l!=null)for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(u[f]=l[f]);return u.default=l,u}return Vl.default=function(l,u,f){return r.createElement("a",{href:l,key:f},u)},Vl}var Pl={},Ny;function ew(){return Ny||(Ny=1,Object.defineProperty(Pl,"__esModule",{value:!0}),Pl.default=function(n){return n}),Pl}var Yl={},bf,Dy;function tw(){return Dy||(Dy=1,bf=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),bf}var vf,My;function nw(){return My||(My=1,vf=/[\0-\x1F\x7F-\x9F]/),vf}var Ef,By;function rw(){return By||(By=1,Ef=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),Ef}var Sf,jy;function aw(){return jy||(jy=1,Sf=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/),Sf}var Tf,Uy;function iw(){return Uy||(Uy=1,Tf=function(n){var r={};r.src_Any=tw().source,r.src_Cc=nw().source,r.src_Z=rw().source,r.src_P=aw().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+"|[.]).|"+(n&&n["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+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}),Tf}var xf,Hy;function sw(){if(Hy)return xf;Hy=1;function n(O){var R=Array.prototype.slice.call(arguments,1);return R.forEach(function(E){E&&Object.keys(E).forEach(function(U){O[U]=E[U]})}),O}function r(O){return Object.prototype.toString.call(O)}function i(O){return r(O)==="[object String]"}function l(O){return r(O)==="[object Object]"}function u(O){return r(O)==="[object RegExp]"}function f(O){return r(O)==="[object Function]"}function h(O){return O.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var d={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function m(O){return Object.keys(O||{}).reduce(function(R,E){return R||d.hasOwnProperty(E)},!1)}var g={"http:":{validate:function(O,R,E){var U=O.slice(R);return E.re.http||(E.re.http=new RegExp("^\\/\\/"+E.re.src_auth+E.re.src_host_port_strict+E.re.src_path,"i")),E.re.http.test(U)?U.match(E.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(O,R,E){var U=O.slice(R);return E.re.no_http||(E.re.no_http=new RegExp("^"+E.re.src_auth+"(?:localhost|(?:(?:"+E.re.src_domain+")\\.)+"+E.re.src_domain_root+")"+E.re.src_port+E.re.src_host_terminator+E.re.src_path,"i")),E.re.no_http.test(U)?R>=3&&O[R-3]===":"||R>=3&&O[R-3]==="/"?0:U.match(E.re.no_http)[0].length:0}},"mailto:":{validate:function(O,R,E){var U=O.slice(R);return E.re.mailto||(E.re.mailto=new RegExp("^"+E.re.src_email_name+"@"+E.re.src_host_strict,"i")),E.re.mailto.test(U)?U.match(E.re.mailto)[0].length:0}}},_="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]",S="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function y(O){O.__index__=-1,O.__text_cache__=""}function x(O){return function(R,E){var U=R.slice(E);return O.test(U)?U.match(O)[0].length:0}}function T(){return function(O,R){R.normalize(O)}}function z(O){var R=O.re=iw()(O.__opts__),E=O.__tlds__.slice();O.onCompile(),O.__tlds_replaced__||E.push(_),E.push(R.src_xn),R.src_tlds=E.join("|");function U(ee){return ee.replace("%TLDS%",R.src_tlds)}R.email_fuzzy=RegExp(U(R.tpl_email_fuzzy),"i"),R.link_fuzzy=RegExp(U(R.tpl_link_fuzzy),"i"),R.link_no_ip_fuzzy=RegExp(U(R.tpl_link_no_ip_fuzzy),"i"),R.host_fuzzy_test=RegExp(U(R.tpl_host_fuzzy_test),"i");var Y=[];O.__compiled__={};function K(ee,le){throw new Error('(LinkifyIt) Invalid schema "'+ee+'": '+le)}Object.keys(O.__schemas__).forEach(function(ee){var le=O.__schemas__[ee];if(le!==null){var ie={validate:null,link:null};if(O.__compiled__[ee]=ie,l(le)){u(le.validate)?ie.validate=x(le.validate):f(le.validate)?ie.validate=le.validate:K(ee,le),f(le.normalize)?ie.normalize=le.normalize:le.normalize?K(ee,le):ie.normalize=T();return}if(i(le)){Y.push(ee);return}K(ee,le)}}),Y.forEach(function(ee){O.__compiled__[O.__schemas__[ee]]&&(O.__compiled__[ee].validate=O.__compiled__[O.__schemas__[ee]].validate,O.__compiled__[ee].normalize=O.__compiled__[O.__schemas__[ee]].normalize)}),O.__compiled__[""]={validate:null,normalize:T()};var re=Object.keys(O.__compiled__).filter(function(ee){return ee.length>0&&O.__compiled__[ee]}).map(h).join("|");O.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+R.src_ZPCc+"))("+re+")","i"),O.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+R.src_ZPCc+"))("+re+")","ig"),O.re.pretest=RegExp("("+O.re.schema_test.source+")|("+O.re.host_fuzzy_test.source+")|@","i"),y(O)}function N(O,R){var E=O.__index__,U=O.__last_index__,Y=O.__text_cache__.slice(E,U);this.schema=O.__schema__.toLowerCase(),this.index=E+R,this.lastIndex=U+R,this.raw=Y,this.text=Y,this.url=Y}function H(O,R){var E=new N(O,R);return O.__compiled__[E.schema].normalize(E,O),E}function D(O,R){if(!(this instanceof D))return new D(O,R);R||m(O)&&(R=O,O={}),this.__opts__=n({},d,R),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=n({},g,O),this.__compiled__={},this.__tlds__=S,this.__tlds_replaced__=!1,this.re={},z(this)}return D.prototype.add=function(R,E){return this.__schemas__[R]=E,z(this),this},D.prototype.set=function(R){return this.__opts__=n(this.__opts__,R),this},D.prototype.test=function(R){if(this.__text_cache__=R,this.__index__=-1,!R.length)return!1;var E,U,Y,K,re,ee,le,ie,de;if(this.re.schema_test.test(R)){for(le=this.re.schema_search,le.lastIndex=0;(E=le.exec(R))!==null;)if(K=this.testSchemaAt(R,E[2],le.lastIndex),K){this.__schema__=E[2],this.__index__=E.index+E[1].length,this.__last_index__=E.index+E[0].length+K;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(ie=R.search(this.re.host_fuzzy_test),ie>=0&&(this.__index__<0||ie<this.__index__)&&(U=R.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(re=U.index+U[1].length,(this.__index__<0||re<this.__index__)&&(this.__schema__="",this.__index__=re,this.__last_index__=U.index+U[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(de=R.indexOf("@"),de>=0&&(Y=R.match(this.re.email_fuzzy))!==null&&(re=Y.index+Y[1].length,ee=Y.index+Y[0].length,(this.__index__<0||re<this.__index__||re===this.__index__&&ee>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=re,this.__last_index__=ee))),this.__index__>=0},D.prototype.pretest=function(R){return this.re.pretest.test(R)},D.prototype.testSchemaAt=function(R,E,U){return this.__compiled__[E.toLowerCase()]?this.__compiled__[E.toLowerCase()].validate(R,U,this):0},D.prototype.match=function(R){var E=0,U=[];this.__index__>=0&&this.__text_cache__===R&&(U.push(H(this,E)),E=this.__last_index__);for(var Y=E?R.slice(E):R;this.test(Y);)U.push(H(this,E)),Y=Y.slice(this.__last_index__),E+=this.__last_index__;return U.length?U:null},D.prototype.tlds=function(R,E){return R=Array.isArray(R)?R:[R],E?(this.__tlds__=this.__tlds__.concat(R).sort().filter(function(U,Y,K){return U!==K[Y-1]}).reverse(),z(this),this):(this.__tlds__=R.slice(),this.__tlds_replaced__=!0,z(this),this)},D.prototype.normalize=function(R){R.schema||(R.url="http://"+R.url),R.schema==="mailto:"&&!/^mailto:/i.test(R.url)&&(R.url="mailto:"+R.url)},D.prototype.onCompile=function(){},xf=D,xf}const lw=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","aw","aws","ax","axa","az","azure","ba","baby","baidu","banamex","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","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","ck","cl","claims","cleaning","click","clinic","clinique","clothing","cloud","club","clubmed","cm","cn","co","coach","codes","coffee","college","cologne","com","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","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","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","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","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","kerryproperties","kfh","kg","kh","ki","kia","kids","kim","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","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","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","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","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","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","shell","shia","shiksha","shoes","shop","shopping","shouji","show","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","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","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 Ly;function ow(){if(Ly)return Yl;Ly=1,Object.defineProperty(Yl,"__esModule",{value:!0});var n=sw(),r=u(n),i=lw,l=u(i);function u(h){return h&&h.__esModule?h:{default:h}}var f=new r.default;return f.tlds(l.default),Yl.default=function(h){return f.match(h)},Yl}var Zl={},zy;function uw(){return zy||(zy=1,Object.defineProperty(Zl,"__esModule",{value:!0}),Zl.default=function(n){return n}),Zl}var ky;function cw(){if(ky)return Fl;ky=1,Object.defineProperty(Fl,"__esModule",{value:!0});var n=function(){function H(D,O){for(var R=0;R<O.length;R++){var E=O[R];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(D,E.key,E)}}return function(D,O,R){return O&&H(D.prototype,O),R&&H(D,R),D}}(),r=qa(),i=y(r),l=WR(),u=S(l),f=ew(),h=S(f),d=ow(),m=S(d),g=uw(),_=S(g);function S(H){return H&&H.__esModule?H:{default:H}}function y(H){if(H&&H.__esModule)return H;var D={};if(H!=null)for(var O in H)Object.prototype.hasOwnProperty.call(H,O)&&(D[O]=H[O]);return D.default=H,D}function x(H,D){if(!(H instanceof D))throw new TypeError("Cannot call a class as a function")}function T(H,D){if(!H)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D&&(typeof D=="object"||typeof D=="function")?D:H}function z(H,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof D);H.prototype=Object.create(D&&D.prototype,{constructor:{value:H,enumerable:!1,writable:!0,configurable:!0}}),D&&(Object.setPrototypeOf?Object.setPrototypeOf(H,D):H.__proto__=D)}var N=function(H){z(D,H);function D(){return x(this,D),T(this,(D.__proto__||Object.getPrototypeOf(D)).apply(this,arguments))}return n(D,[{key:"parseString",value:function(R){var E=this;if(R==="")return R;var U=this.props.matchDecorator(R);if(!U)return R;var Y=[],K=0;return U.forEach(function(re,ee){re.index>K&&Y.push(R.substring(K,re.index));var le=E.props.hrefDecorator(re.url),ie=E.props.textDecorator(re.text),de=E.props.componentDecorator(le,ie,ee);Y.push(de),K=re.lastIndex}),R.length>K&&Y.push(R.substring(K)),Y.length===1?Y[0]:Y}},{key:"parse",value:function(R){var E=this,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof R=="string"?this.parseString(R):i.isValidElement(R)&&R.type!=="a"&&R.type!=="button"?i.cloneElement(R,{key:U},this.parse(R.props.children)):Array.isArray(R)?R.map(function(Y,K){return E.parse(Y,K)}):R}},{key:"render",value:function(){return i.createElement(i.Fragment,null,this.parse(this.props.children))}}]),D}(i.Component);return N.defaultProps={componentDecorator:u.default,hrefDecorator:h.default,matchDecorator:m.default,textDecorator:_.default},Fl.default=N,Fl}var Gy;function fw(){if(Gy)return Il;Gy=1,Object.defineProperty(Il,"__esModule",{value:!0});var n=cw(),r=i(n);function i(l){return l&&l.__esModule?l:{default:l}}return Il.default=r.default,Il}var hw=fw();const dw=ho(hw),mw="_text_gp0s0_1",pw="_command_gp0s0_5",qy={text:mw,command:pw},lv=({text:n,commands:r=[],onLinkClick:i})=>{const l=d=>m=>(m.preventDefault(),d&&i(d),!1),u=(d,m,g)=>b.jsx("a",{onClick:l(d),role:"button",children:m},g),f=r.find(d=>n.startsWith(`/${d}`)),h=f?n.slice(f.length+1):n;return b.jsxs("div",{children:[f&&b.jsxs("code",{className:qy.command,children:["/",f]}),h.split(`
|
|
106
|
-
`).map((d,m)=>b.jsxs("span",{className:qy.text,children:[b.jsx(dw,{componentDecorator:u,children:d}),b.jsx("br",{})]},m))]})},gw=({subtitle:n,onLinkClick:r})=>n?b.jsx("div",{className:At.subtitle,children:b.jsx(lv,{text:n,onLinkClick:r})}):null,Iy="newtab#",ov=({markdown:n,markdownOptions:r={},onLinkClick:i})=>{const l=f=>h=>(h.preventDefault(),f&&i(f),!1),u=({title:f,href:h,children:d})=>h.indexOf(Iy)===0?b.jsx("a",{href:h.slice(Iy.length),title:f,target:"_blank",rel:"noopener noreferrer",children:d}):b.jsx("a",{onClick:l(h),title:f,href:h,children:d});return b.jsx(bn,{options:{...r,overrides:{a:u}},children:n})},yw=({text:n,onLinkClick:r})=>n?b.jsx("div",{children:b.jsx(ov,{markdown:n,onLinkClick:r})}):null,_w=({title:n})=>n?b.jsx("h1",{className:At.title,children:n}):null,bw=({title:n,text:r,subtitle:i,buttons:l,onButtonClick:u,onLinkClick:f})=>(n==null?void 0:n.length)||(r==null?void 0:r.length)||(i==null?void 0:i.length)||(l==null?void 0:l.length)?b.jsxs("div",{className:Z(me.bubbleContent),children:[b.jsx(_w,{title:n}),b.jsx(yw,{text:r,onLinkClick:f}),b.jsx(gw,{subtitle:i,onLinkClick:f}),b.jsx(JR,{buttons:l,onButtonClick:u})]}):null,vw=({alt:n,imageUrl:r,itemUrl:i,hasBody:l})=>r?i?i.indexOf("youtube.com")>-1?b.jsx("div",{className:At.video_container,children:b.jsx("iframe",{className:Z(At.video,{[At.only]:!l}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):b.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:b.jsx("div",{className:At.imageContainer,children:b.jsx("img",{className:Z(At.image,{[At.only]:!l}),src:r,alt:n})})}):b.jsx("div",{className:At.imageContainer,children:b.jsx("img",{className:Z(At.image,{[At.only]:!l}),src:r,alt:n})}):null,Ew=({title:n,text:r,subtitle:i,imageUrl:l,itemUrl:u,buttons:f,sources:h,onButtonClick:d,onLinkClick:m})=>{const g=!!(n!=null&&n.length)||!!(r!=null&&r.length)||!!(i!=null&&i.length)||!!(f!=null&&f.length);return b.jsxs("div",{className:Z(At.detailMessage),children:[b.jsx(vw,{hasBody:g,imageUrl:l,itemUrl:u,alt:n||i}),g&&b.jsx(bw,{title:n,text:r,subtitle:i,buttons:f,onLinkClick:m,onButtonClick:d}),b.jsx(Qh,{sources:h,onLinkClick:m})]})},Sw=I.forwardRef(({isFirstMessageBySender:n,isLastMessageBySender:r,children:i},l)=>{const u=We();return b.jsx("li",{ref:l,className:Z(me.message,me.messageGuest,n&&me.messageGuestFirst,r&&me.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:b.jsx("div",{className:Z(me.bubble,me.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":u("guest-bubble.label"),children:b.jsx("div",{className:Z(me.rightText),children:i})})})}),Tw="_markdown_nw7vg_1",uv={markdown:Tw},Xl="source-info-reference",xw=({markdown:n,sources:r,onLinkClick:i})=>{const l=Fa(),u=Aw(),f=kt(m=>{const g=m.chat.sourceInfos;if((g==null?void 0:g.type)==="loaded"||(g==null?void 0:g.type)==="loading")return g.chunkId}),h=m=>g=>{const _=g.key;(_==="ArrowDown"||_==="ArrowRight"||_==="Enter"||_===" "||_==="Space")&&(g.stopPropagation(),l(_y(m)))},d=m=>()=>{l(_y(m))};return I.useLayoutEffect(()=>{document.querySelectorAll(`.${Xl}`).forEach(m=>{var S,y,x,T;const g=m.previousSibling;g&&g.nodeType===Node.TEXT_NODE&&((S=g.textContent)!=null&&S.endsWith(" "))&&((y=g.textContent)!=null&&y.trim().length)&&m.classList.add(`${Xl}--before-space`);const _=m.nextSibling;_&&_.nodeType===Node.TEXT_NODE&&((x=_.textContent)!=null&&x.startsWith(" "))&&((T=_.textContent)!=null&&T.trim().length)&&m.classList.add(`${Xl}--after-space`)})},[n]),b.jsxs("div",{className:me.bubbleContent,children:[b.jsx("div",{className:uv.markdown,children:b.jsx(ov,{markdown:n,onLinkClick:i,markdownOptions:{renderRule(m,g,_,S){if(g.type===ue.footnoteReference){const y=g.text===f;return b.jsx("span",{className:Z(me.sourceInfoReference,y&&me.sourceInfoReferenceActive,Xl),children:b.jsx("a",{type:"button",tabIndex:0,onClick:d(g.text),onKeyDown:h(g.text),children:u(g.text)})},S.key)}return m()}}})}),b.jsx(Qh,{sources:r,onLinkClick:i})]})},Aw=()=>{const n=[];return i=>{const l=n.indexOf(i);return l>-1?l+1:(n.push(i),n.length)}},Ow=({text:n,commands:r,sources:i,onLinkClick:l})=>b.jsxs("div",{className:me.bubbleContent,children:[b.jsx(lv,{text:n,commands:r,onLinkClick:l}),b.jsx(Qh,{sources:i,onLinkClick:l})]}),Rw=I.forwardRef(({message:n,commands:r,isLastMessage:i,isFirstMessageBySender:l,isLastMessageBySender:u,onReaction:f,onButtonClick:h,onLinkClick:d},m)=>{const g=ww(n,r,h,d);switch(n.sender.type){case Ee.UserType.GUEST:return b.jsx(Sw,{ref:m,isFirstMessageBySender:l,isLastMessageBySender:u,children:g});default:{const _=S=>f(n._id,S);return b.jsx(nv,{ref:m,message:n,isAnimated:!1,isLastMessage:i,isFirstMessageBySender:l,isLastMessageBySender:u,onReaction:_,children:g})}}}),ww=(n,r,i,l)=>{switch(n.type){case Ee.MessageTypeEnum.TEXT:{const u=n;return b.jsx(Ow,{text:u.text,commands:r,sources:n.sources||[],onLinkClick:l})}case Ee.MessageTypeEnum.DETAIL:{const u=n;return b.jsx(Ew,{title:u.title,text:u.text,subtitle:u.subtitle,imageUrl:u.imageUrl,itemUrl:u.itemUrl,buttons:u.buttons,sources:n.sources||[],onButtonClick:i,onLinkClick:l})}case Ee.MessageTypeEnum.MARKDOWN:{const u=n;return b.jsx(xw,{markdown:u.markdown,sources:u.sources||[],onLinkClick:l})}}},Cw=(n,r)=>n.message._id===r.message._id&&n.message.reaction===r.message.reaction&&n.isLastMessage===r.isLastMessage&&n.isFirstMessageBySender===r.isFirstMessageBySender&&n.isLastMessageBySender===r.isLastMessageBySender,Nw=O_.memo(Rw,Cw),Dw="_ticontainer_xg0dn_1",Mw="_tiblock_xg0dn_5",Bw="_tidot_xg0dn_12",Ki={ticontainer:Dw,tiblock:Mw,tidot:Bw},jw=({isTyping:n=!1})=>b.jsx("div",{className:Ki.ticontainer,children:b.jsx("div",{className:Ki.tiblock,children:n?b.jsxs(b.Fragment,{children:[b.jsx("div",{className:Z(Ki.tidot,"chat__typingIndicator")}),b.jsx("div",{className:Z(Ki.tidot,"chat__typingIndicator")}),b.jsx("div",{className:Z(Ki.tidot,"chat__typingIndicator")})]}):null})}),Uw=Object.assign({_id:"typing-indicator"},new Ee.TextMessage("",new Ee.BotUser)),Hw=({messages:n,isBotTyping:r,commands:i,onTranscriptItemReaction:l,onButtonClick:u,onLinkClick:f})=>{const h=I.useRef(0),d=I.useRef(!0),m=I.useRef(null),g=I.useRef(null),_=I.useRef(null),S=kt(T=>T.settings.enableGeneralConditions);I.useLayoutEffect(()=>{if(n.length&&m.current&&(h.current<n.length||r)){if(g.current){const T=g.current.offsetTop;m.current.scrollTop=T}else if(_.current){const T=_.current.offsetTop;m.current.scrollTop=T}d.current&&(d.current=!1),h.current=n.length}},[n,d,r]);let y;const x=n.length;return b.jsxs("div",{ref:m,className:Z(by.messageContainer,"chat__messageContainer"),style:{scrollBehavior:n.length&&d.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[S&&b.jsx(fR,{}),b.jsxs("ul",{className:by.messages,children:[n.map((T,z)=>{const N=Lw(T,y),H=zw(T,z,n,r);y=T.sender.type;const D=z+1===x;return b.jsx(Nw,{ref:D?_:null,message:T,commands:i,isLastMessage:D,isFirstMessageBySender:N,isLastMessageBySender:H,onButtonClick:u,onLinkClick:f,onReaction:l},D&&!r?"last":T._id)}),r&&b.jsx(nv,{ref:g,message:Uw,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:y!==Ee.UserType.BOT,isLastMessageBySender:!0,children:b.jsx(jw,{isTyping:!0})},"last")]})]})},Lw=(n,r)=>!r||r!==n.sender.type,zw=(n,r,i,l)=>{var d;const u=n.sender.type,f=i.length;return r+1===f?!(u===Ee.UserType.BOT&&l):u!==((d=i.at(r+1))==null?void 0:d.sender.type)},kw="_bottomSheet_jp8dl_1",Gw="_bottomSheetOpen_jp8dl_15",qw="_bottomSheetClose_jp8dl_20",Vn={bottomSheet:kw,bottomSheetOpen:Gw,bottomSheetClose:qw},Iw="_container_xc2nx_1",Fy={container:Iw},Fw=({contentUrl:n})=>{const r=kt(f=>f.connection.sessionId),[i,l]=I.useState(!1);I.useEffect(()=>{l(f=>f||!!n)},[n]);const u=I.useMemo(()=>{if(n&&r){const f=new URL(n,document.baseURI);return f.searchParams.set("sessionId",r),f.toString()}else return},[n,r]);return b.jsx("div",{className:Z(Fy.container,Vn.bottomSheet,{[Vn.bottomSheetOpen]:!!n,[Vn.bottomSheetClose]:i&&!n}),children:u&&b.jsx("iframe",{title:"Drawer",src:u,className:Fy.iframe})})},Vw="_container_tr4tn_1",Pw={container:Vw},Yw=({title:n,href:r,children:i})=>b.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),Zw=()=>{const r=We()("powered-by");return r&&r.length?b.jsx("div",{className:Z(Pw.container,"chat__poweredBy"),children:b.jsx(bn,{options:{overrides:{a:Yw}},children:r})}):null},Vy=({className:n,children:r,...i})=>b.jsx(Ao,{className:Z(as.buttonDefault,n),type:"button",...i,children:r}),is=({className:n,children:r,...i})=>b.jsx(Ao,{className:Z(as.buttonPrimary,n),...i,children:r}),Xw="_container_h23mk_1",Qw="_formContainer_h23mk_17",Kw="_emailInput_h23mk_22",$w="_description_h23mk_52",Jw="_actions_h23mk_57",Ww="_validationError_h23mk_67",eC="_submitted_h23mk_74",qn={container:Xw,formContainer:Qw,emailInput:Kw,description:$w,actions:Jw,validationError:Ww,submitted:eC},tC=({visible:n,enableTranscriptExportPdf:r,enableTranscriptExportEmail:i,onEmailExport:l,onPdfExport:u,onClose:f})=>{const h=We(),[d,m]=I.useState(void 0),[g,_]=I.useState(!1),[S,y]=I.useState(!1),[x,T]=I.useState(void 0),z=I.useRef(null);I.useEffect(()=>{var O;n?((O=z.current)==null||O.focus(),_(!1),y(!1),m(n)):d===!0&&m(!1)},[n,d]);const N=O=>{O.preventDefault(),x&&x.length>0&&(l(x),_(!0),setTimeout(f,3*1e3))},H=O=>{const R=O.target.value.trim(),E=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(R);T(E?R:"")},D=()=>{y(!0),u(),setTimeout(f,3*1e3)};return b.jsxs("div",{className:Z(qn.container,Vn.bottomSheet,{[Vn.bottomSheetOpen]:d===!0,[Vn.bottomSheetClose]:d===!1}),children:[r&&b.jsxs(b.Fragment,{children:[b.jsx("h2",{children:h("export-transcript.pdf.title")}),b.jsx(bn,{className:qn.description,children:h("export-transcript.pdf.description")||""}),b.jsxs("div",{className:qn.actions,children:[b.jsx(Vy,{onClick:f,children:h("export-transcript.pdf.cancel")}),b.jsx(is,{onClick:D,disabled:S,children:h("export-transcript.pdf.download")})]})]}),i&&b.jsxs(b.Fragment,{children:[b.jsx("h2",{children:h("export-transcript.email.title")}),b.jsx(bn,{className:qn.description,children:h("export-transcript.email.description")||""}),b.jsxs("form",{onSubmit:N,className:qn.formContainer,children:[b.jsxs("div",{children:[b.jsx("input",{disabled:g,ref:z,type:"email",placeholder:h("export-transcript.email.placeholder"),className:qn.emailInput,onChange:H}),(x==null?void 0:x.length)===0?b.jsx("div",{className:qn.validationError,children:h("export-transcript.email.invalid")}):null]}),b.jsxs("div",{className:qn.actions,children:[b.jsx(Vy,{onClick:f,children:h("export-transcript.email.cancel")}),b.jsx(is,{type:"submit",disabled:g||x===void 0||x.length===0,children:h("export-transcript.email.send")})]})]}),g&&b.jsx("div",{className:qn.submitted,children:h("export-transcript.email.success")})]})]})},nC="_inputContainer_fi5ao_1",rC={inputContainer:nC},aC="_blockUserInput_pot9c_1",iC={blockUserInput:aC},sC=({visible:n})=>{const r=We();return n?b.jsx("div",{className:Z(iC.blockUserInput,"chat__blockUserInput"),children:r("block-user-input.title")}):null},lC="_commandsDropdown_5ytuv_1",oC="_commands_5ytuv_1",uC="_command_5ytuv_1",cC="_commandActive_5ytuv_46",fC="_commandsSelections_5ytuv_55",Wi={commandsDropdown:lC,commands:oC,command:uC,commandActive:cC,commandsSelections:fC},hC=(n,r)=>{I.useEffect(()=>{const i=l=>{n.current&&!n.current.contains(l.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,r])},dC=(n,r,i,l,u)=>{I.useEffect(()=>{const f=h=>{if(n.length)switch(h.key){case"Enter":i(n[r]);break;case"ArrowUp":l(d=>d>0?d-1:n.length-1);break;case"ArrowDown":l(d=>d<n.length-1?d+1:0);break;case"Escape":u([]);break}};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[n,r,i,l,u])},mC=({text:n,commands:r,onSelectCommand:i,onVisibilityChange:l})=>{const u=I.useRef(null),f=We(),[h,d]=I.useState([]),[m,g]=I.useState(Py(r)),[_,S]=I.useState(0),y=x=>i(`/${x}`);return hC(u,()=>d([])),dC(h,_,y,S,d),I.useEffect(()=>{g(Py(r))},[r]),I.useEffect(()=>{const x=n.length||0;x===0||x>m||!n.startsWith("/")?d([]):d(r.filter(pC(n))),S(0)},[r,n,m]),I.useEffect(()=>{l(!!h.length)},[h,l]),h.length?b.jsx("div",{ref:u,className:Wi.commandsDropdown,children:b.jsx("ul",{className:Wi.commands,role:"listbox",children:h.map((x,T)=>b.jsxs("li",{className:Z([Wi.command,_===T&&Wi.commandActive]),role:"option",onClick:()=>y(x),onMouseOver:()=>S(T),children:[b.jsxs("h1",{children:["/",x]}),b.jsx("p",{children:f(`commands.${x}`)})]},x))})}):null},Py=n=>Math.max(...n.map(r=>r.length+1)),pC=n=>r=>{const i=`/${r}`;return i.startsWith(n)&&i.length>=n.length},Yy=3,gC=({commands:n,onSelectCommand:r})=>{const i=We(),[l,u]=I.useState(!1),f=g=>()=>{r(`/${g}`),u(!1)},h=()=>{u(!0)},d=()=>{u(!1)},m=l?n:n.slice(0,Yy);return b.jsxs("div",{className:Wi.commandsSelections,children:[m.map(g=>b.jsxs("button",{onClick:f(g),children:["/",g]},g)),m.length<n.length?b.jsx("button",{"aria-label":i("commands.show-more.tooltip"),"data-title":i("commands.show-more.tooltip"),tabIndex:0,onClick:h,children:i("commands.show-more.action")},"show-more"):m.length>Yy?b.jsx("button",{"aria-label":i("commands.show-less.tooltip"),"data-title":i("commands.show-less.tooltip"),tabIndex:0,onClick:d,children:i("commands.show-less.action")},"show-less"):null]})},yC="_callToActionContainer_bkfcm_1",_C="_callToActionTitle_bkfcm_23",bC="_rateOverlay_bkfcm_30",vC="_body_bkfcm_52",EC="_footer_bkfcm_60",SC="_actions_bkfcm_73",TC="_bubbles_bkfcm_101",xC="_stars_bkfcm_203",AC="_starsSmall_bkfcm_215",OC="_starsLarge_bkfcm_219",RC="_star_bkfcm_203",wC="_starReadonly_bkfcm_236",CC="_starIcon_bkfcm_246",NC="_starsDescriptionContainer_bkfcm_264",DC="_starsDescription_bkfcm_264",bt={callToActionContainer:yC,callToActionTitle:_C,rateOverlay:bC,body:vC,footer:EC,actions:SC,bubbles:TC,stars:xC,starsSmall:AC,starsLarge:OC,star:RC,starReadonly:wC,starIcon:CC,starsDescriptionContainer:NC,starsDescription:DC},MC=({value:n,index:r,count:i,readonly:l,onHover:u,onClick:f})=>{const h=d=>{f&&d.key==="Enter"&&f()};return b.jsx("li",{className:Z(bt.star,{[bt.starReadonly]:l},"chat__conversationRating__star"),children:b.jsx("div",{role:"radio","aria-checked":n>r?"true":"false","aria-posinset":r+1,"aria-setsize":i,tabIndex:0,onMouseOver:u,onKeyDown:h,onClick:f,children:b.jsx("span",{role:"img","aria-label":"Star",className:Z(bt.starIcon),children:b.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:b.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"})})})})})},Zy=5,cv=({value:n,size:r,readonly:i=!1,onChange:l})=>{const[u,f]=I.useState(void 0),h=()=>{f(void 0)},d=g=>()=>{if(!i){const _=g+1;f(_)}},m=g=>()=>{l&&!i&&(l(g===0&&n===1?0:g+1),f(void 0))};return b.jsx("ul",{tabIndex:0,role:"radiogroup",className:Z(bt.stars,{[bt.starsSmall]:r==="small",[bt.starsLarge]:r==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:r==="small",chat__conversationRating__stars__large:r==="large"}),onMouseOut:h,children:Array(Zy).fill(0).map((g,_)=>b.jsx(MC,{value:u===void 0?n:u,index:_,count:Zy,readonly:i,onHover:d(_),onClick:m(_)},_))})},BC=({visible:n,onRate:r})=>{const i=We();return n?b.jsxs("div",{className:Z(bt.callToActionContainer,"chat__conversationRating__callToAction"),children:[b.jsx("div",{className:Z(bt.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),b.jsx(cv,{value:0,size:"small",onChange:r})]}):null},Af=({isFirstMessageBySender:n,isLastMessageBySender:r,children:i})=>b.jsxs("div",{className:Z(me.message,me.messageBot,n&&me.messageBotFirst,r&&me.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:[b.jsx("img",{className:Z(me.avatar,me.botAvatar),src:"bot.svg",alt:"Bot"}),b.jsx("div",{className:Z(me.bubble,me.bubbleLeft,"chat__bubble","chat__botBubble"),children:b.jsx("div",{className:Z(me.leftText,me.bubbleContent),children:i})})]}),jC=({children:n})=>b.jsx("div",{className:Z(me.message,me.messageGuest,me.messageGuestFirst,me.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:b.jsx("div",{className:Z(me.bubble,me.bubbleRight,"chat__bubble","chat__guestBubble"),children:b.jsx("div",{className:Z(me.rightText,me.bubbleContent),children:n})})}),UC=({visible:n,rating:r,onRate:i,onClose:l})=>{const u=We(),[f,h]=I.useState(r),[d,m]=I.useState(void 0),[g,_]=I.useState(void 0),[S,y]=I.useState({submitted:!1,feedback:""}),[x,T]=I.useState(!1),z=I.useRef(null);I.useEffect(()=>{n?(y({submitted:!1,feedback:""}),_(n)):g===!0&&_(!1)},[n,g]),I.useEffect(()=>{h(r)},[r]),I.useEffect(()=>{const H=u(`conversation-rating.overlay.bot-message.rate-feedback.value-${f}`);m(H!=null&&H.length?H:void 0)},[f,u]),I.useEffect(()=>{S.submitted?setTimeout(()=>T(!0),S.feedback.length?500:0):T(!1)},[S]);const N=H=>{var O,R;H.preventDefault();const D=((R=(O=z.current)==null?void 0:O.value)==null?void 0:R.trim())||"";i(f,D),y({submitted:!0,feedback:D})};return b.jsx("div",{className:Z(bt.rateOverlay,Vn.bottomSheet,"chat__conversationRating__overlay",{[Vn.bottomSheetOpen]:g===!0,[Vn.bottomSheetClose]:g===!1}),children:b.jsxs("form",{onSubmit:N,children:[b.jsxs("div",{className:Z(bt.body,"chat__conversationRating__overlay__body"),children:[b.jsx("div",{}),b.jsx("div",{className:Z(bt.bubbles),children:n&&d&&b.jsxs(b.Fragment,{children:[b.jsxs(Af,{isFirstMessageBySender:!0,isLastMessageBySender:!1,children:[b.jsx("h2",{children:u("conversation-rating.overlay.title")}),b.jsxs("div",{className:Z(bt.starsDescriptionContainer),children:[b.jsx(cv,{value:f,size:"large",readonly:S.submitted,onChange:h}),b.jsxs("div",{className:Z(bt.starsDescription),children:[b.jsx("div",{children:u("conversation-rating.overlay.star.very-bad")}),b.jsx("div",{children:u("conversation-rating.overlay.star.very-good")})]})]})]}),b.jsx(Af,{isFirstMessageBySender:!1,isLastMessageBySender:!x||!!S.feedback.length,children:b.jsx("div",{children:d})}),!!S.feedback.length&&b.jsx(jC,{children:S.feedback}),x&&b.jsx(Af,{isFirstMessageBySender:!!S.feedback.length,isLastMessageBySender:!0,children:b.jsx("div",{children:u("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),b.jsxs("div",{className:Z(bt.footer,"chat__conversationRating__overlay__footer"),children:[!S.submitted&&b.jsx("input",{ref:z,placeholder:u("conversation-rating.overlay.guest-feedback.input-placeholder")}),b.jsx("div",{className:Z(bt.actions,"chat__conversationRating__overlay__footer__actions"),children:S.submitted?b.jsx(is,{type:"button",onClick:l,children:u("conversation-rating.overlay.action.close")}):b.jsx(is,{type:"submit",children:u("conversation-rating.overlay.action.submit")})})]})]})})},HC=({conversationRating:{enabled:n,rating:r},numberOfMessagesFromGuest:i,showRatingOverlay:l,setShowRatingOverlay:u,onRate:f})=>{const[h,d]=I.useState(0),m=S=>{d(S),u(!0)},g=()=>u(!1),_=!r&&i>=1;return n?b.jsxs(b.Fragment,{children:[b.jsx(BC,{visible:_,onRate:m}),b.jsx(UC,{visible:l,rating:h,onRate:f,onClose:g})]}):null},LC=I.memo(HC),zC="_inputWrapper_e3h44_1",kC="_withOpenCommands_e3h44_14",GC="_messageInputWrapper_e3h44_20",qC="_messageInput_e3h44_20",IC="_buttons_e3h44_44",FC="_button_e3h44_44",Fr={inputWrapper:zC,withOpenCommands:kC,messageInputWrapper:GC,messageInput:qC,buttons:IC,button:FC},VC="_audioRecorder_g845f_1",PC="_audioButton_g845f_6",YC="_recorderIcon_g845f_37",ZC="_spinning_g845f_60",Vr={audioRecorder:VC,audioButton:PC,recorderIcon:YC,spinning:ZC},Xy=2048,fo=16e3;class XC extends O_.Component{constructor(i){super(i);Ce(this,"audioInput",null);Ce(this,"volume",null);Ce(this,"leftchannel",[]);Ce(this,"recorder",null);Ce(this,"recordingLength",0);Ce(this,"sampleRate",null);Ce(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 l=window.AudioContext||window.webkitAudioContext,u=new l;this.sampleRate=u.sampleRate,this.volume=u.createGain(),this.audioInput=u.createMediaStreamSource(i),this.audioInput.connect(this.volume),this.recorder=u.createScriptProcessor(Xy,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(u.destination)}processRecordingInput(i){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const l=i.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(l)),this.recordingLength+=Xy}}handleClickSubmitAudio(){const i=KC(this.leftchannel,this.recordingLength),l=$C(i,this.sampleRate||0),u=QC(l);this.props.onAudioRecorded(u),this.handleClickStopAudio()}handleClickStopAudio(){var i,l,u,f;this.setState({recordingState:"none"}),(i=this.audioInput)==null||i.disconnect(),(l=this.volume)==null||l.disconnect(),(u=this.recorder)==null||u.disconnect(),this.mediaStream&&((f=this.mediaStream)==null||f.getAudioTracks().forEach(h=>{h.stop()}))}render(){return b.jsxs("div",{className:Vr.audioRecorder,children:[this.state.recordingState==="none"&&b.jsx("button",{className:Z(Vr.audioButton,"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:b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[b.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"}),b.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&b.jsxs("svg",{className:Vr.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[b.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"}),b.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&b.jsxs("div",{className:Vr.audioRecorder,children:[b.jsx("button",{className:Z(Vr.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[b.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"}),b.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),b.jsx("div",{className:Vr.recorderIcon}),b.jsx("button",{className:Z(Vr.audioButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[b.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),b.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const QC=n=>{const r=new ArrayBuffer(44+n.length*2),i=new DataView(r);Ql(i,0,"RIFF"),i.setUint32(4,44+n.length*2,!0),Ql(i,8,"WAVE"),Ql(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,fo,!0),i.setUint32(28,fo*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),Ql(i,36,"data"),i.setUint32(40,n.length*2,!0);const l=n.length;let u=44;const f=1;for(let h=0;h<l;h++)i.setInt16(u,n[h]*(32767*f),!0),u+=2;return new Blob([i],{type:"audio/wav"})},Ql=(n,r,i)=>{for(let l=0;l<i.length;l++)n.setUint8(r+l,i.charCodeAt(l))},KC=(n,r)=>{const i=new Float32Array(r);let l=0;const u=n.length;for(let f=0;f<u;f++){const h=n[f];i.set(h,l),l+=h.length}return i},$C=(n,r)=>{if(fo===r)return n;const i=r/fo,l=Math.round(n.length/i),u=new Float32Array(l);let f=0,h=0;for(;f<u.length;){const d=Math.round((f+1)*i);let m=0,g=0;for(let _=h;_<d&&_<n.length;_++)m+=n[_],g++;u[f]=m/g,f++,h=d}return u},JC=({disabled:n,textInput:r,commandsVisible:i,onTextInput:l,onTextInputSubmit:u,onAudioRecorded:f,onOpenTranscriptExportModal:h})=>{const d=We(),m=I.useRef(null),{enableTranscriptExportPdf:g,enableTranscriptExportEmail:_,enableSpeechSupport:S}=kt(N=>N.settings);I.useEffect(()=>{var N;(N=m.current)==null||N.focus()},[r]);const y=()=>{const N=m.current;N&&r.trim().length>=1&&u(r.trim())&&(N.value="",N.style.height="",N.focus())},x=N=>{N.preventDefault(),y()},T=N=>{const H=N.target.value;l(H),N.target.style.height="";const{scrollHeight:D}=N.target;N.target.style.height=`${D>150?150:D}px`},z=N=>{N.code==="Enter"&&!N.shiftKey?(N.repeat||y(),N.preventDefault()):i&&(N.code==="ArrowUp"||N.code==="ArrowDown")&&N.preventDefault()};return b.jsxs("form",{className:Z(Fr.inputWrapper,i&&Fr.withOpenCommands,"chat__textInput"),onSubmit:x,children:[b.jsx("div",{className:Fr.messageInputWrapper,children:b.jsx("textarea",{id:"user_input",ref:m,className:Fr.messageInput,tabIndex:0,placeholder:d("message-input-placeholder"),value:r,onChange:T,onKeyDown:z,"aria-label":d("message-input-label"),"aria-controls":"command-list","aria-haspopup":"listbox"})}),b.jsxs("div",{className:Z(Fr.buttons,"chat__buttons"),children:[!r.length&&(g||_)&&b.jsx("button",{type:"button",className:Z(Fr.button,"chat__button"),"aria-label":d("message-input.actions.export-transcript.label"),"data-title":d("message-input.actions.export-transcript.label"),tabIndex:0,onClick:h,children:b.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:b.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"})})}),r.length||!S||navigator.mediaDevices===void 0?b.jsx("button",{className:Z(Fr.button,"chat__button"),type:"submit","aria-label":d("message-input.actions.submit.label"),"data-title":d("message-input.actions.submit.label"),tabIndex:0,disabled:n,children:b.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:b.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"})})}):S&&navigator.mediaDevices!==void 0&&b.jsx(XC,{translate:d,onAudioRecorded:f})]})]})},WC="_quickReplies_83npe_1",e3="_quickReply_83npe_9",Qy={quickReplies:WC,quickReply:e3},t3=({quickReplies:n,onQuickReplyClick:r})=>n.length?b.jsx("div",{className:Z(Qy.quickReplies,"chat__quickReplies"),children:n.map(i=>b.jsx(Ao,{tabIndex:0,className:Z(Qy.quickReply,"chat__button","chat__quickReply"),onClick:()=>r(i),children:i.label},i.label))}):null,Ky=5e3,n3=1e3,r3=({isBotTyping:n,quickReplies:r,conversationRating:i,numberOfMessagesFromGuest:l,showRatingOverlay:u,commands:f,setShowRatingOverlay:h,onTextInput:d,onRate:m,onQuickReplyClick:g,onAudioRecorded:_,onOpenTranscriptExportModal:S})=>{const[y,x]=I.useState(""),[T,z]=I.useState(!1),[N,H]=I.useState(!1),D=I.useRef(0),O=I.useRef(0);I.useEffect(()=>{if(T&&!n){const U=D.current?Date.now()-D.current:0;U>Ky?z(!1):setTimeout(()=>{z(!1)},Ky-U)}},[T,n]),I.useEffect(()=>{T&&(D.current=Date.now())},[T]);const R=U=>{const Y=Date.now()-O.current<n3;return N?!1:n||Y?(z(!0),!1):(d(U),x(""),O.current=Date.now(),!0)},E=U=>{x(U+" ")};return b.jsxs("div",{className:Z(rC.inputContainer),children:[b.jsx(t3,{quickReplies:r,onQuickReplyClick:g}),b.jsx(sC,{visible:T}),!T&&b.jsx(LC,{conversationRating:i,numberOfMessagesFromGuest:l,onRate:m,showRatingOverlay:u,setShowRatingOverlay:h}),!!(f!=null&&f.length)&&b.jsx(mC,{text:y,commands:f,onSelectCommand:E,onVisibilityChange:H}),b.jsx(JC,{textInput:y,disabled:T,commandsVisible:N,onTextInput:x,onTextInputSubmit:R,onOpenTranscriptExportModal:S,onAudioRecorded:_}),!!(f!=null&&f.length)&&b.jsx(gC,{commands:f,onSelectCommand:x})]})},a3=({clientName:n,messages:r,quickReplies:i,isBotTyping:l,drawerContentUrl:u,conversationRating:f,onMessageFromUser:h,onRate:d,onQuickReplyClick:m,onButtonClick:g,onLinkClick:_,onAudioRecorded:S,onTranscriptExport:y,onPdfExport:x,onTranscriptItemReaction:T})=>{const z=Fa(),N=kt(ee=>ee.connection.connectionState),{enableTranscriptExportPdf:H,enableTranscriptExportEmail:D,commands:O}=kt(ee=>ee.settings),[R,E]=I.useState(!1),[U,Y]=I.useState(!1),K=H||D,re=r.filter(ee=>ee.sender.type===zb.GUEST).length;return I.useEffect(()=>{if(N===Xr.CONNECTED){const ee=go.parse(window.location.search);z(Lb(n,ee))}},[n,N,z]),b.jsxs("div",{className:df.container,children:[b.jsxs("div",{className:Z([df.chatcontent,(R||U)&&df.accessabilityHidden]),children:[b.jsx(Hw,{messages:r,isBotTyping:l,commands:O,onButtonClick:g,onLinkClick:_,onTranscriptItemReaction:T}),b.jsx(r3,{isBotTyping:l,quickReplies:l?[]:i,numberOfMessagesFromGuest:re,conversationRating:R?{enabled:!1}:f,showRatingOverlay:U,setShowRatingOverlay:Y,commands:O,onRate:d,onQuickReplyClick:m,onTextInput:h,onAudioRecorded:S,onOpenTranscriptExportModal:()=>E(!R)}),b.jsx(Zw,{})]}),K&&b.jsx(tC,{enableTranscriptExportPdf:H,enableTranscriptExportEmail:D,visible:R,onEmailExport:y,onPdfExport:x,onClose:()=>E(!1)}),b.jsx(Fw,{contentUrl:u})]})},i3=n=>{const{messages:r,quickReplies:i,isBotTyping:l,drawerContentUrl:u,conversationRating:f}=n.chat;return{messages:r,quickReplies:i,isBotTyping:l,drawerContentUrl:u,conversationRating:f}},s3=n=>({onRestartChat:(r,i)=>n(To(r,i)),onMessageFromUser:r=>n(pb(r)),onRate:(r,i)=>n(Gx(r,i)),onAudioRecorded:r=>n(Ux(r)),onActionFromUser:r=>n(r),onQuickReplyClick:r=>n(mb(r)),onNluEvent:r=>n(Eb(r)),onButtonClick:r=>n(Ix(r)),onLinkClick:r=>n(Fx(r)),onTranscriptExport:r=>n(Lx(r)),onPdfExport:()=>n(zx()),onTranscriptItemReaction:(r,i)=>n(Ee.transcriptItemGuestReaction(r,i||null))}),l3=fS(i3,s3)(a3),fv=()=>o3(window.location.pathname),o3=n=>{const r=n.split("/"),i=n.endsWith("/");return r[r.length-(i?2:1)]},hv=()=>I.useMemo(()=>fv(),[]),dv=()=>{const[n,r]=I.useState(!1);return I.useEffect(()=>{r((()=>{try{return window.self!==window.top}catch{return!0}})())},[]),n},Kh=n=>r=>{const i=r.key;(i==="ArrowDown"||i==="ArrowRight"||i==="Enter"||i===" "||i==="Space")&&(r.stopPropagation(),n())},u3=({onClick:n})=>{const r=We();return dv()?b.jsx("button",{className:"tooltip--bottom","aria-label":r("header.close-chat"),"data-title":r("header.close-chat"),tabIndex:0,onClick:n,onKeyDown:Kh(n),children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:b.jsx("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"})})}):null},c3=()=>{const n=We(),r=dv(),i=kt(u=>u.settings.enableStandaloneView),l=()=>{window.open(window.location.href,"_blank")};return r&&i?b.jsx("button",{className:"tooltip--bottom","aria-label":n("header.expand-chat"),"data-title":n("header.expand-chat"),tabIndex:0,onClick:l,onKeyDown:Kh(l),children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:b.jsx("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"})})}):null},f3="_header_1hky6_1",h3="_logoContainer_1hky6_13",d3="_logo_1hky6_13",m3="_actions_1hky6_27",Kl={header:f3,logoContainer:h3,logo:d3,actions:m3},p3=({onClick:n})=>{const r=We();return b.jsx("button",{className:"tooltip--bottom","aria-label":r("header.restart-chat"),"data-title":r("header.restart-chat"),tabIndex:0,onClick:n,onKeyDown:Kh(n),children:b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 32 32",children:[b.jsx("path",{d:"M14.506,23.578l-5.511,0l-3.993,3.501l-0.007,0.006c-0.302,0.261 -0.687,0.405 -1.084,0.405c-0.245,-0.001 -0.488,-0.055 -0.711,-0.161c-0.595,-0.277 -0.978,-0.886 -0.974,-1.551l-0,-19.558c-0,-0.939 0.761,-1.711 1.685,-1.711l21.189,-0c0.924,-0 1.685,0.772 1.685,1.711l0,5.104l-1.444,0l-0,-5.104c-0,-0.134 -0.109,-0.244 -0.241,-0.244l-21.189,-0c-0.132,-0 -0.24,0.11 -0.24,0.244l-0,19.558c0.001,0.133 0.109,0.242 0.24,0.242c0.056,-0 0.109,-0.019 0.152,-0.055l4.192,-3.675c0.131,-0.115 0.299,-0.179 0.472,-0.179l5.779,0l-0,1.467Z"}),b.jsx("path",{d:"M29.869,20.148c0,4.137 -3.373,7.556 -7.509,7.612l-0.102,-0c-1.943,0.004 -3.814,-0.741 -5.223,-2.078c-0.183,-0.172 -0.286,-0.412 -0.286,-0.664c-0,-0.501 0.412,-0.913 0.913,-0.913c0.233,-0 0.458,0.089 0.627,0.249c1.074,1.014 2.495,1.579 3.971,1.579c3.174,-0 5.785,-2.612 5.785,-5.785c-0,-3.173 -2.611,-5.784 -5.785,-5.784c-1.533,-0 -3.006,0.61 -4.09,1.694c-0.01,0.01 -0.019,0.019 -0.03,0.028l-1.447,1.322l1.302,0c0.502,0 0.914,0.413 0.914,0.914c-0,0.501 -0.412,0.913 -0.914,0.913l-3.653,0c-0.501,0 -0.913,-0.412 -0.913,-0.913l-0,-3.654c-0,-0.501 0.412,-0.913 0.913,-0.913c0.501,0 0.913,0.412 0.913,0.913l0,1.577l1.635,-1.496c1.426,-1.418 3.357,-2.215 5.368,-2.215c4.175,0 7.611,3.436 7.611,7.611c-0,0.001 -0,0.002 -0,0.003Z"})]})})},$y=({className:n,withActions:r=!0,...i})=>{const l=Fa(),u=hv(),f=()=>{const d=go.parse(window.location.search);l(To(u,d))},h=()=>{l(jA())};return b.jsxs("div",{className:Z([Kl.header,n]),...i,children:[b.jsx("div",{className:Kl.logoContainer,children:b.jsx("div",{className:Kl.logo})}),b.jsxs("div",{className:Kl.actions,children:[r&&b.jsx(p3,{onClick:f}),b.jsx(c3,{}),b.jsx(u3,{onClick:h})]})]})},g3="_chatwindow_6v6ob_1",y3="_chatwindowWithAside_6v6ob_46",Jy={chatwindow:g3,chatwindowWithAside:y3},_3="_sourceInfos_1878a_1",b3="_sourceDetails_1878a_16",v3="_sourceHeader_1878a_23",E3="_sourceHeaderIcon_1878a_43",S3="_openSourceButton_1878a_47",T3="_closeSourceInfosButton_1878a_70",x3="_sourceContent_1878a_85",A3="_loadingSourceInfos_1878a_109",O3="_loading_1878a_109",R3="_loadingError_1878a_123",Sn={sourceInfos:_3,sourceDetails:b3,sourceHeader:v3,sourceHeaderIcon:E3,openSourceButton:S3,closeSourceInfosButton:T3,sourceContent:x3,loadingSourceInfos:A3,loading:O3,loadingError:R3},w3=({onClick:n})=>{const r=We();return b.jsx("button",{className:Z(Sn.closeSourceInfosButton,"tooltip--bottom"),"aria-label":r("source-infos.close"),"data-title":r("source-infos.close"),tabIndex:0,onClick:n,children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:b.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})})},C3=n=>b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:b.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),N3=({type:n,...r})=>{switch(n){case"WEBSITE":return b.jsx(sv,{...r});case"PDF":return b.jsx(iv,{...r});case"DOCX":return b.jsx(rv,{...r});case"TEXT":return b.jsx(C3,{...r});default:return b.jsx(av,{...r})}},D3=({sourceInfos:n,onClose:r})=>b.jsxs("div",{className:Sn.sourceHeader,children:[b.jsx("div",{className:Sn.sourceHeaderIcon,children:n&&b.jsx(N3,{type:n.knowledgeBaseType})}),b.jsx("div",{children:n&&b.jsx("h1",{children:n.title})}),b.jsx(w3,{onClick:r})]}),M3=({title:n,href:r,children:i})=>b.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),B3=({className:n,children:r,...i})=>b.jsx("a",{className:Z(as.button,as.buttonPrimary,n),type:"button",...i,children:r}),j3=({label:n,url:r})=>b.jsxs(B3,{className:Sn.openSourceButton,href:r,target:"_blank",children:[b.jsx("p",{children:n}),b.jsx("div",{children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#000000",viewBox:"0 0 256 256",children:b.jsx("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"})})})]}),U3=({sourceInfos:n})=>b.jsxs(b.Fragment,{children:[b.jsx("div",{className:Z(Sn.sourceContent,uv.markdown),children:b.jsx(bn,{options:{overrides:{a:M3}},children:n.content})}),b.jsx(j3,{label:n.title,url:n.url})]}),H3=""+new URL("undraw_fixing-bugs-D_eYxJc6.svg",import.meta.url).href,L3=()=>{const n=We();return b.jsxs("div",{className:Sn.loadingError,children:[b.jsx("h1",{children:n("source-infos.error.title")}),b.jsx("img",{src:H3,title:n("source-infos.error.title")}),b.jsx("p",{children:n("source-infos.error.info")})]})},z3=()=>b.jsx("div",{className:Sn.loadingSourceInfos,children:b.jsx("svg",{className:Sn.loading,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:b.jsx("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"})})}),k3=()=>{const n=Fa(),r=kt(l=>l.chat.sourceInfos),i=()=>{n(HA())};return r?b.jsxs("div",{className:Sn.sourceInfos,children:[b.jsx("div",{className:Sn.sourceDetails,children:b.jsx(D3,{sourceInfos:r.type==="loaded"?r:void 0,onClose:i})}),r.type==="loading"?b.jsx(z3,{}):r.type==="loading-error"?b.jsx(L3,{}):b.jsx(U3,{sourceInfos:r})]}):null},G3="_container_114wy_1",q3="_body_114wy_7",I3="_intro_114wy_14",F3="_footer_114wy_39",V3="_footnote_114wy_43",P3="_containerWithFootnote_114wy_58",Y3="_startChatButton_114wy_73",Z3="_formFields_114wy_77",X3="_formField_114wy_77",Q3="_radio_114wy_89",K3="_checkbox_114wy_96",$3="_input_114wy_104",J3="_inputLabel_114wy_138",W3="_selectWrapper_114wy_142",e6="_select_114wy_142",t6="_selectLabel_114wy_188",ft={container:G3,body:q3,intro:I3,footer:F3,footnote:V3,containerWithFootnote:P3,startChatButton:Y3,formFields:Z3,formField:X3,radio:Q3,checkbox:K3,input:$3,inputLabel:J3,selectWrapper:W3,select:e6,selectLabel:t6},n6=({name:n,label:r,defaultValue:i,required:l,onChange:u})=>{const f=h=>{u(h.currentTarget.checked?"true":"false")};return b.jsxs("label",{className:Z(ft.checkbox,"chat__startScreen__checkbox"),htmlFor:n,children:[b.jsx("input",{type:"checkbox",id:n,name:n,defaultChecked:i==="true",required:l,onChange:f}),b.jsx("div",{children:r})]})},r6=({type:n,name:r,label:i,defaultValue:l,placeholder:u,required:f,multiple:h,min:d,max:m,pattern:g,onChange:_})=>{const S=y=>{_(y.target.value)};return b.jsxs("label",{className:Z(ft.input,"chat__startScreen__input"),htmlFor:r,children:[b.jsx("div",{className:Z(ft.inputLabel),children:i}),b.jsx("input",{type:n,id:r,name:r,defaultValue:l,placeholder:u,required:f,multiple:h,min:d,max:m,pattern:g,onChange:S})]})},a6=({name:n,value:r,label:i,defaultChecked:l,required:u,onChange:f})=>{const h=`${n}-${r}`,d=m=>{f(m.target.value)};return b.jsxs("label",{className:Z(ft.radio,"chat__startScreen__radio"),htmlFor:h,children:[b.jsx("input",{id:h,type:"radio",name:n,value:r,defaultChecked:l,required:u,onChange:d}),b.jsx("span",{className:Z(ft.label),children:i})]})},i6=({name:n,label:r,defaultValue:i,required:l,multiple:u,options:f,onChange:h})=>{const d=m=>{h(m.target.value)};return b.jsxs("label",{className:Z(ft.select,"chat__startScreen__select"),htmlFor:n,children:[b.jsx("div",{className:Z(ft.selectLabel),children:r}),b.jsx("div",{className:Z(ft.selectWrapper),children:b.jsx("select",{id:n,name:n,defaultValue:i,required:l,multiple:u,onChange:d,children:Object.entries(f||{}).map(([m,g])=>b.jsx("option",{value:m,selected:g===i,children:g}))})})]})},s6="start-screen.intro",l6="start-screen.start-chat",o6="start-screen.footnote",ln="start-screen.form",Wy=`${ln}.fields`,u6=()=>{const n=We(),r=Fa(),[i,l]=I.useState({}),u=()=>{const S=Object.entries(i).reduce((y,[x,T])=>({...y,[x]:T.value}),{});r(DA(S))},f=n(s6),h=n(l6),d=n(o6),m=I.useMemo(()=>{var S;return((S=n(Wy))==null?void 0:S.split(";").map(y=>y.trim()))??[]},[n(Wy)]);I.useEffect(()=>{m.length&&Object.keys(i).length===0&&l(m.reduce((S,y)=>({...S,[y]:c6(y,n)}),{}))},[n,m,i]);const g=S=>{S.preventDefault(),u()},_=S=>y=>{l(x=>({...x,[S]:{...x[S],value:y}}))};return b.jsxs("form",{onSubmit:g,className:Z(ft.container,d&&ft.containerWithFootnote,"chat__startScreen"),children:[b.jsxs("div",{className:Z(ft.body,"chat__startScreen__body"),children:[f&&b.jsx("div",{className:Z(ft.intro,"chat__startScreen__intro"),children:b.jsx(bn,{options:{overrides:{a:e_}},children:f})}),b.jsx("div",{className:Z(ft.formFields,"chat__startScreen__fields"),children:Object.values(i).map(({type:S,name:y,label:x,placeholder:T,defaultValue:z,options:N,required:H,multiple:D,min:O,max:R,pattern:E})=>b.jsx("div",{className:Z(ft.formField,"chat__startScreen__field"),children:(()=>{switch(S){case"radio":return b.jsxs(b.Fragment,{children:[b.jsx("div",{children:x}),Object.entries(N||{}).map(([U,Y])=>b.jsx(a6,{name:y,value:U,label:Y,defaultChecked:U===z,required:H,onChange:_(y)}))]});case"checkbox":return b.jsx(n6,{name:y,label:x,defaultValue:z,required:H,onChange:_(y)});case"select":return b.jsx(i6,{name:y,label:x,defaultValue:z,required:H,multiple:D,options:N,onChange:_(y)});default:return b.jsx(r6,{type:S,name:y,label:x,placeholder:T,defaultValue:z,required:H,multiple:D,min:O,max:R,pattern:E,onChange:_(y)})}})()},y))})]}),b.jsxs("div",{className:Z(ft.footer,"chat__startScreen__footer"),children:[b.jsx(is,{type:"submit",className:ft.startChatButton,children:h}),d&&b.jsx("div",{className:ft.footnote,children:b.jsx(bn,{options:{overrides:{a:e_}},children:d})})]})]})},e_=({title:n,href:r,children:i})=>b.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),c6=(n,r)=>{const i=r(`${ln}.${n}.type`)||"text",l=r(`${ln}.${n}.required`)==="true",u=r(`${ln}.${n}.multiple`)==="true",f=r(`${ln}.${n}.placeholder`),h=r(`${ln}.${n}.label`)||"",d=r(`${ln}.${n}.defaultValue`),m=r(`${ln}.${n}.min`),g=r(`${ln}.${n}.max`),_=r(`${ln}.${n}.pattern`),S=h6(r(`${ln}.${n}.options`));return{name:n,label:h,placeholder:f,value:f6(i,d,S)||"",defaultValue:d,options:S,type:i,required:l,multiple:u,min:m,max:g,pattern:_}},f6=(n,r,i)=>r||n==="select"&&Object.keys(i)[0]||"",h6=(n="")=>n.split(";").map(r=>r.trim()).reduce((r,i)=>{const[l,u]=i.split(":").map(f=>f.trim());return{...r,[l]:u}},{}),d6=()=>{const n=po();I.useEffect(()=>{window.document.documentElement.lang=n.locale},[n.locale])},La={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"},m6=({clientName:n})=>{d6();const r=Fa(),i=kt(_=>_.intl.messages),l=We(),u=kt(_=>_.settings.enableStartScreen),f=kt(_=>_.startScreen.startScreenStatus),[h,d]=I.useState(void 0);I.useEffect(()=>{const _=go.parse(window.location.search);_.cssClassName&&d(_.cssClassName);const S=y=>{switch(y.data.type){case La.TRIGGER_ACTION:r(y.data.action);break;case La.TRIGGER_STORY:r(Eb(y.data.story));break;case La.ON_CHAT_WINDOW_OPEN:r({type:"webclient.chatwindow.opened"});break;case La.ON_CHAT_WINDOW_CLOSE:r({type:"webclient.chatwindow.closed"});break;case La.CHAT_MESSAGE_FROM_GUEST:r(pb(y.data.text));break;case La.RESTART_CHAT:r(To(n,_));break}};return r(zA(n,_)),window.addEventListener("message",y=>S(y),!1),()=>window.removeEventListener("message",S)},[n,r]),I.useEffect(()=>{const _=l("page.title");_&&document&&(document.title=_)},[i,l]);const m=u===void 0,g=u===!1||f==="HIDDEN";return b.jsx("div",{className:Z(Jy.chatwindow,g&&Jy.chatwindowWithAside,"chat__chatwindow",h),children:m?null:g?b.jsxs(b.Fragment,{children:[b.jsx("header",{children:b.jsx($y,{})}),b.jsx("main",{children:b.jsx(l3,{clientName:n})}),b.jsx("aside",{children:b.jsx(k3,{})})]}):b.jsxs(b.Fragment,{children:[b.jsx("header",{children:b.jsx($y,{withActions:!1})}),b.jsx("main",{children:b.jsx(u6,{})})]})})},p6=1024,g6=()=>{const n=hv(),r=kt(f=>f.intl.locale),i=kt(f=>f.intl.messages),[l,u]=I.useState(t_());return I.useEffect(()=>{const f=()=>{u(t_())};return window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]),b.jsx(JT,{locale:r,messages:i,children:b.jsx("div",{className:Z([ex.app,l?"chat__large":"chat__small"]),children:b.jsx(m6,{clientName:n})})})},t_=()=>window.innerWidth>=p6;var Of,n_;function $h(){if(n_)return Of;n_=1;function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}return Of=n,Of}var Rf,r_;function y6(){if(r_)return Rf;r_=1;var n=typeof Tl=="object"&&Tl&&Tl.Object===Object&&Tl;return Rf=n,Rf}var wf,a_;function mv(){if(a_)return wf;a_=1;var n=y6(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();return wf=i,wf}var Cf,i_;function _6(){if(i_)return Cf;i_=1;var n=mv(),r=function(){return n.Date.now()};return Cf=r,Cf}var Nf,s_;function b6(){if(s_)return Nf;s_=1;var n=/\s/;function r(i){for(var l=i.length;l--&&n.test(i.charAt(l)););return l}return Nf=r,Nf}var Df,l_;function v6(){if(l_)return Df;l_=1;var n=b6(),r=/^\s+/;function i(l){return l&&l.slice(0,n(l)+1).replace(r,"")}return Df=i,Df}var Mf,o_;function pv(){if(o_)return Mf;o_=1;var n=mv(),r=n.Symbol;return Mf=r,Mf}var Bf,u_;function E6(){if(u_)return Bf;u_=1;var n=pv(),r=Object.prototype,i=r.hasOwnProperty,l=r.toString,u=n?n.toStringTag:void 0;function f(h){var d=i.call(h,u),m=h[u];try{h[u]=void 0;var g=!0}catch{}var _=l.call(h);return g&&(d?h[u]=m:delete h[u]),_}return Bf=f,Bf}var jf,c_;function S6(){if(c_)return jf;c_=1;var n=Object.prototype,r=n.toString;function i(l){return r.call(l)}return jf=i,jf}var Uf,f_;function T6(){if(f_)return Uf;f_=1;var n=pv(),r=E6(),i=S6(),l="[object Null]",u="[object Undefined]",f=n?n.toStringTag:void 0;function h(d){return d==null?d===void 0?u:l:f&&f in Object(d)?r(d):i(d)}return Uf=h,Uf}var Hf,h_;function x6(){if(h_)return Hf;h_=1;function n(r){return r!=null&&typeof r=="object"}return Hf=n,Hf}var Lf,d_;function A6(){if(d_)return Lf;d_=1;var n=T6(),r=x6(),i="[object Symbol]";function l(u){return typeof u=="symbol"||r(u)&&n(u)==i}return Lf=l,Lf}var zf,m_;function O6(){if(m_)return zf;m_=1;var n=v6(),r=$h(),i=A6(),l=NaN,u=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,h=/^0o[0-7]+$/i,d=parseInt;function m(g){if(typeof g=="number")return g;if(i(g))return l;if(r(g)){var _=typeof g.valueOf=="function"?g.valueOf():g;g=r(_)?_+"":_}if(typeof g!="string")return g===0?g:+g;g=n(g);var S=f.test(g);return S||h.test(g)?d(g.slice(2),S?2:8):u.test(g)?l:+g}return zf=m,zf}var kf,p_;function R6(){if(p_)return kf;p_=1;var n=$h(),r=_6(),i=O6(),l="Expected a function",u=Math.max,f=Math.min;function h(d,m,g){var _,S,y,x,T,z,N=0,H=!1,D=!1,O=!0;if(typeof d!="function")throw new TypeError(l);m=i(m)||0,n(g)&&(H=!!g.leading,D="maxWait"in g,y=D?u(i(g.maxWait)||0,m):y,O="trailing"in g?!!g.trailing:O);function R(de){var Ie=_,Te=S;return _=S=void 0,N=de,x=d.apply(Te,Ie),x}function E(de){return N=de,T=setTimeout(K,m),H?R(de):x}function U(de){var Ie=de-z,Te=de-N,G=m-Ie;return D?f(G,y-Te):G}function Y(de){var Ie=de-z,Te=de-N;return z===void 0||Ie>=m||Ie<0||D&&Te>=y}function K(){var de=r();if(Y(de))return re(de);T=setTimeout(K,U(de))}function re(de){return T=void 0,O&&_?R(de):(_=S=void 0,x)}function ee(){T!==void 0&&clearTimeout(T),N=0,_=z=S=T=void 0}function le(){return T===void 0?x:re(r())}function ie(){var de=r(),Ie=Y(de);if(_=arguments,S=this,z=de,Ie){if(T===void 0)return E(z);if(D)return clearTimeout(T),T=setTimeout(K,m),R(z)}return T===void 0&&(T=setTimeout(K,m)),x}return ie.cancel=ee,ie.flush=le,ie}return kf=h,kf}var Gf,g_;function w6(){if(g_)return Gf;g_=1;var n=R6(),r=$h(),i="Expected a function";function l(u,f,h){var d=!0,m=!0;if(typeof u!="function")throw new TypeError(i);return r(h)&&(d="leading"in h?!!h.leading:d,m="trailing"in h?!!h.trailing:m),n(u,f,{leading:d,maxWait:f,trailing:m})}return Gf=l,Gf}var C6=w6();const N6=ho(C6);function D6(n){return n&&n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function M6(n){return n}function B6(n,r){r=r||{};const i=r.delimiter||".",l=r.maxDepth,u=r.transformKey||M6,f={};function h(d,m,g){g=g||1,Object.keys(d).forEach(function(_){const S=d[_],y=r.safe&&Array.isArray(S),x=Object.prototype.toString.call(S),T=D6(S),z=x==="[object Object]"||x==="[object Array]",N=m?m+i+u(_):u(_);if(!y&&!T&&z&&Object.keys(S).length&&(!r.maxDepth||g<l))return h(S,N,g+1);f[N]=S})}return h(n),f}const gv={"page.title":"Bubble Chat Chatbot","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","bot-bubble.sources":"Quellenliste","bot-bubble.source.open":"Quelle öffnen","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:
|
|
106
|
+
`).map((d,m)=>b.jsxs("span",{className:qy.text,children:[b.jsx(dw,{componentDecorator:u,children:d}),b.jsx("br",{})]},m))]})},gw=({subtitle:n,onLinkClick:r})=>n?b.jsx("div",{className:At.subtitle,children:b.jsx(lv,{text:n,onLinkClick:r})}):null,Iy="newtab#",ov=({markdown:n,markdownOptions:r={},onLinkClick:i})=>{const l=f=>h=>(h.preventDefault(),f&&i(f),!1),u=({title:f,href:h,children:d})=>h.indexOf(Iy)===0?b.jsx("a",{href:h.slice(Iy.length),title:f,target:"_blank",rel:"noopener noreferrer",children:d}):b.jsx("a",{onClick:l(h),title:f,href:h,children:d});return b.jsx(bn,{options:{...r,overrides:{a:u}},children:n})},yw=({text:n,onLinkClick:r})=>n?b.jsx("div",{children:b.jsx(ov,{markdown:n,onLinkClick:r})}):null,_w=({title:n})=>n?b.jsx("h1",{className:At.title,children:n}):null,bw=({title:n,text:r,subtitle:i,buttons:l,onButtonClick:u,onLinkClick:f})=>(n==null?void 0:n.length)||(r==null?void 0:r.length)||(i==null?void 0:i.length)||(l==null?void 0:l.length)?b.jsxs("div",{className:Z(me.bubbleContent),children:[b.jsx(_w,{title:n}),b.jsx(yw,{text:r,onLinkClick:f}),b.jsx(gw,{subtitle:i,onLinkClick:f}),b.jsx(JR,{buttons:l,onButtonClick:u})]}):null,vw=({alt:n,imageUrl:r,itemUrl:i,hasBody:l})=>r?i?i.indexOf("youtube.com")>-1?b.jsx("div",{className:At.video_container,children:b.jsx("iframe",{className:Z(At.video,{[At.only]:!l}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):b.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:b.jsx("div",{className:At.imageContainer,children:b.jsx("img",{className:Z(At.image,{[At.only]:!l}),src:r,alt:n})})}):b.jsx("div",{className:At.imageContainer,children:b.jsx("img",{className:Z(At.image,{[At.only]:!l}),src:r,alt:n})}):null,Ew=({title:n,text:r,subtitle:i,imageUrl:l,itemUrl:u,buttons:f,sources:h,onButtonClick:d,onLinkClick:m})=>{const g=!!(n!=null&&n.length)||!!(r!=null&&r.length)||!!(i!=null&&i.length)||!!(f!=null&&f.length);return b.jsxs("div",{className:Z(At.detailMessage),children:[b.jsx(vw,{hasBody:g,imageUrl:l,itemUrl:u,alt:n||i}),g&&b.jsx(bw,{title:n,text:r,subtitle:i,buttons:f,onLinkClick:m,onButtonClick:d}),b.jsx(Qh,{sources:h,onLinkClick:m})]})},Sw=I.forwardRef(({isFirstMessageBySender:n,isLastMessageBySender:r,children:i},l)=>{const u=We();return b.jsx("li",{ref:l,className:Z(me.message,me.messageGuest,n&&me.messageGuestFirst,r&&me.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:b.jsx("div",{className:Z(me.bubble,me.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":u("guest-bubble.label"),children:b.jsx("div",{className:Z(me.rightText),children:i})})})}),Tw="_markdown_nw7vg_1",uv={markdown:Tw},Xl="source-info-reference",xw=({markdown:n,sources:r,onLinkClick:i})=>{const l=Fa(),u=Aw(),f=kt(m=>{const g=m.chat.sourceInfos;if((g==null?void 0:g.type)==="loaded"||(g==null?void 0:g.type)==="loading")return g.chunkId}),h=m=>g=>{const _=g.key;(_==="ArrowDown"||_==="ArrowRight"||_==="Enter"||_===" "||_==="Space")&&(g.stopPropagation(),l(_y(m)))},d=m=>()=>{l(_y(m))};return I.useLayoutEffect(()=>{document.querySelectorAll(`.${Xl}`).forEach(m=>{var S,y,x,T;const g=m.previousSibling;g&&g.nodeType===Node.TEXT_NODE&&((S=g.textContent)!=null&&S.endsWith(" "))&&((y=g.textContent)!=null&&y.trim().length)&&m.classList.add(`${Xl}--before-space`);const _=m.nextSibling;_&&_.nodeType===Node.TEXT_NODE&&((x=_.textContent)!=null&&x.startsWith(" "))&&((T=_.textContent)!=null&&T.trim().length)&&m.classList.add(`${Xl}--after-space`)})},[n]),b.jsxs("div",{className:me.bubbleContent,children:[b.jsx("div",{className:uv.markdown,children:b.jsx(ov,{markdown:n,onLinkClick:i,markdownOptions:{renderRule(m,g,_,S){if(g.type===ue.footnoteReference){const y=g.text===f;return b.jsx("span",{className:Z(me.sourceInfoReference,y&&me.sourceInfoReferenceActive,Xl),children:b.jsx("a",{type:"button",tabIndex:0,onClick:d(g.text),onKeyDown:h(g.text),children:u(g.text)})},S.key)}return m()}}})}),b.jsx(Qh,{sources:r,onLinkClick:i})]})},Aw=()=>{const n=[];return i=>{const l=n.indexOf(i);return l>-1?l+1:(n.push(i),n.length)}},Ow=({text:n,commands:r,sources:i,onLinkClick:l})=>b.jsxs("div",{className:me.bubbleContent,children:[b.jsx(lv,{text:n,commands:r,onLinkClick:l}),b.jsx(Qh,{sources:i,onLinkClick:l})]}),Rw=I.forwardRef(({message:n,commands:r,isLastMessage:i,isFirstMessageBySender:l,isLastMessageBySender:u,onReaction:f,onButtonClick:h,onLinkClick:d},m)=>{const g=ww(n,r,h,d);switch(n.sender.type){case Ee.UserType.GUEST:return b.jsx(Sw,{ref:m,isFirstMessageBySender:l,isLastMessageBySender:u,children:g});default:{const _=S=>f(n._id,S);return b.jsx(nv,{ref:m,message:n,isAnimated:!1,isLastMessage:i,isFirstMessageBySender:l,isLastMessageBySender:u,onReaction:_,children:g})}}}),ww=(n,r,i,l)=>{switch(n.type){case Ee.MessageTypeEnum.TEXT:{const u=n;return b.jsx(Ow,{text:u.text,commands:r,sources:n.sources||[],onLinkClick:l})}case Ee.MessageTypeEnum.DETAIL:{const u=n;return b.jsx(Ew,{title:u.title,text:u.text,subtitle:u.subtitle,imageUrl:u.imageUrl,itemUrl:u.itemUrl,buttons:u.buttons,sources:n.sources||[],onButtonClick:i,onLinkClick:l})}case Ee.MessageTypeEnum.MARKDOWN:{const u=n;return b.jsx(xw,{markdown:u.markdown,sources:u.sources||[],onLinkClick:l})}}},Cw=(n,r)=>n.message._id===r.message._id&&n.message.reaction===r.message.reaction&&n.isLastMessage===r.isLastMessage&&n.isFirstMessageBySender===r.isFirstMessageBySender&&n.isLastMessageBySender===r.isLastMessageBySender,Nw=O_.memo(Rw,Cw),Dw="_ticontainer_xg0dn_1",Mw="_tiblock_xg0dn_5",Bw="_tidot_xg0dn_12",Ki={ticontainer:Dw,tiblock:Mw,tidot:Bw},jw=({isTyping:n=!1})=>b.jsx("div",{className:Ki.ticontainer,children:b.jsx("div",{className:Ki.tiblock,children:n?b.jsxs(b.Fragment,{children:[b.jsx("div",{className:Z(Ki.tidot,"chat__typingIndicator")}),b.jsx("div",{className:Z(Ki.tidot,"chat__typingIndicator")}),b.jsx("div",{className:Z(Ki.tidot,"chat__typingIndicator")})]}):null})}),Uw=Object.assign({_id:"typing-indicator"},new Ee.TextMessage("",new Ee.BotUser)),Hw=({messages:n,isBotTyping:r,commands:i,onTranscriptItemReaction:l,onButtonClick:u,onLinkClick:f})=>{const h=I.useRef(0),d=I.useRef(!0),m=I.useRef(null),g=I.useRef(null),_=I.useRef(null),S=kt(T=>T.settings.enableGeneralConditions);I.useLayoutEffect(()=>{if(n.length&&m.current&&(h.current<n.length||r)){if(g.current){const T=g.current.offsetTop;m.current.scrollTop=T}else if(_.current){const T=_.current.offsetTop;m.current.scrollTop=T}d.current&&(d.current=!1),h.current=n.length}},[n,d,r]);let y;const x=n.length;return b.jsxs("div",{ref:m,className:Z(by.messageContainer,"chat__messageContainer"),style:{scrollBehavior:n.length&&d.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[S&&b.jsx(fR,{}),b.jsxs("ul",{className:by.messages,children:[n.map((T,z)=>{const N=Lw(T,y),H=zw(T,z,n,r);y=T.sender.type;const D=z+1===x;return b.jsx(Nw,{ref:D?_:null,message:T,commands:i,isLastMessage:D,isFirstMessageBySender:N,isLastMessageBySender:H,onButtonClick:u,onLinkClick:f,onReaction:l},D&&!r?"last":T._id)}),r&&b.jsx(nv,{ref:g,message:Uw,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:y!==Ee.UserType.BOT,isLastMessageBySender:!0,children:b.jsx(jw,{isTyping:!0})},"last")]})]})},Lw=(n,r)=>!r||r!==n.sender.type,zw=(n,r,i,l)=>{var d;const u=n.sender.type,f=i.length;return r+1===f?!(u===Ee.UserType.BOT&&l):u!==((d=i.at(r+1))==null?void 0:d.sender.type)},kw="_bottomSheet_jp8dl_1",Gw="_bottomSheetOpen_jp8dl_15",qw="_bottomSheetClose_jp8dl_20",Vn={bottomSheet:kw,bottomSheetOpen:Gw,bottomSheetClose:qw},Iw="_container_xc2nx_1",Fy={container:Iw},Fw=({contentUrl:n})=>{const r=kt(f=>f.connection.sessionId),[i,l]=I.useState(!1);I.useEffect(()=>{l(f=>f||!!n)},[n]);const u=I.useMemo(()=>{if(n&&r){const f=new URL(n,document.baseURI);return f.searchParams.set("sessionId",r),f.toString()}else return},[n,r]);return b.jsx("div",{className:Z(Fy.container,Vn.bottomSheet,{[Vn.bottomSheetOpen]:!!n,[Vn.bottomSheetClose]:i&&!n}),children:u&&b.jsx("iframe",{title:"Drawer",src:u,className:Fy.iframe})})},Vw="_container_tr4tn_1",Pw={container:Vw},Yw=({title:n,href:r,children:i})=>b.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),Zw=()=>{const r=We()("powered-by");return r&&r.length?b.jsx("div",{className:Z(Pw.container,"chat__poweredBy"),children:b.jsx(bn,{options:{overrides:{a:Yw}},children:r})}):null},Vy=({className:n,children:r,...i})=>b.jsx(Ao,{className:Z(as.buttonDefault,n),type:"button",...i,children:r}),is=({className:n,children:r,...i})=>b.jsx(Ao,{className:Z(as.buttonPrimary,n),...i,children:r}),Xw="_container_h23mk_1",Qw="_formContainer_h23mk_17",Kw="_emailInput_h23mk_22",$w="_description_h23mk_52",Jw="_actions_h23mk_57",Ww="_validationError_h23mk_67",eC="_submitted_h23mk_74",qn={container:Xw,formContainer:Qw,emailInput:Kw,description:$w,actions:Jw,validationError:Ww,submitted:eC},tC=({visible:n,enableTranscriptExportPdf:r,enableTranscriptExportEmail:i,onEmailExport:l,onPdfExport:u,onClose:f})=>{const h=We(),[d,m]=I.useState(void 0),[g,_]=I.useState(!1),[S,y]=I.useState(!1),[x,T]=I.useState(void 0),z=I.useRef(null);I.useEffect(()=>{var O;n?((O=z.current)==null||O.focus(),_(!1),y(!1),m(n)):d===!0&&m(!1)},[n,d]);const N=O=>{O.preventDefault(),x&&x.length>0&&(l(x),_(!0),setTimeout(f,3*1e3))},H=O=>{const R=O.target.value.trim(),E=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(R);T(E?R:"")},D=()=>{y(!0),u(),setTimeout(f,3*1e3)};return b.jsxs("div",{className:Z(qn.container,Vn.bottomSheet,{[Vn.bottomSheetOpen]:d===!0,[Vn.bottomSheetClose]:d===!1}),children:[r&&b.jsxs(b.Fragment,{children:[b.jsx("h2",{children:h("export-transcript.pdf.title")}),b.jsx(bn,{className:qn.description,children:h("export-transcript.pdf.description")||""}),b.jsxs("div",{className:qn.actions,children:[b.jsx(Vy,{onClick:f,children:h("export-transcript.pdf.cancel")}),b.jsx(is,{onClick:D,disabled:S,children:h("export-transcript.pdf.download")})]})]}),i&&b.jsxs(b.Fragment,{children:[b.jsx("h2",{children:h("export-transcript.email.title")}),b.jsx(bn,{className:qn.description,children:h("export-transcript.email.description")||""}),b.jsxs("form",{onSubmit:N,className:qn.formContainer,children:[b.jsxs("div",{children:[b.jsx("input",{disabled:g,ref:z,type:"email",placeholder:h("export-transcript.email.placeholder"),className:qn.emailInput,onChange:H}),(x==null?void 0:x.length)===0?b.jsx("div",{className:qn.validationError,children:h("export-transcript.email.invalid")}):null]}),b.jsxs("div",{className:qn.actions,children:[b.jsx(Vy,{onClick:f,children:h("export-transcript.email.cancel")}),b.jsx(is,{type:"submit",disabled:g||x===void 0||x.length===0,children:h("export-transcript.email.send")})]})]}),g&&b.jsx("div",{className:qn.submitted,children:h("export-transcript.email.success")})]})]})},nC="_inputContainer_fi5ao_1",rC={inputContainer:nC},aC="_blockUserInput_pot9c_1",iC={blockUserInput:aC},sC=({visible:n})=>{const r=We();return n?b.jsx("div",{className:Z(iC.blockUserInput,"chat__blockUserInput"),children:r("block-user-input.title")}):null},lC="_commandsDropdown_5ytuv_1",oC="_commands_5ytuv_1",uC="_command_5ytuv_1",cC="_commandActive_5ytuv_46",fC="_commandsSelections_5ytuv_55",Wi={commandsDropdown:lC,commands:oC,command:uC,commandActive:cC,commandsSelections:fC},hC=(n,r)=>{I.useEffect(()=>{const i=l=>{n.current&&!n.current.contains(l.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,r])},dC=(n,r,i,l,u)=>{I.useEffect(()=>{const f=h=>{if(n.length)switch(h.key){case"Enter":i(n[r]);break;case"ArrowUp":l(d=>d>0?d-1:n.length-1);break;case"ArrowDown":l(d=>d<n.length-1?d+1:0);break;case"Escape":u([]);break}};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[n,r,i,l,u])},mC=({text:n,commands:r,onSelectCommand:i,onVisibilityChange:l})=>{const u=I.useRef(null),f=We(),[h,d]=I.useState([]),[m,g]=I.useState(Py(r)),[_,S]=I.useState(0),y=x=>i(`/${x}`);return hC(u,()=>d([])),dC(h,_,y,S,d),I.useEffect(()=>{g(Py(r))},[r]),I.useEffect(()=>{const x=n.length||0;x===0||x>m||!n.startsWith("/")?d([]):d(r.filter(pC(n))),S(0)},[r,n,m]),I.useEffect(()=>{l(!!h.length)},[h,l]),h.length?b.jsx("div",{ref:u,className:Wi.commandsDropdown,children:b.jsx("ul",{className:Wi.commands,role:"listbox",children:h.map((x,T)=>b.jsxs("li",{className:Z([Wi.command,_===T&&Wi.commandActive]),role:"option",onClick:()=>y(x),onMouseOver:()=>S(T),children:[b.jsxs("h1",{children:["/",x]}),b.jsx("p",{children:f(`commands.${x}`)})]},x))})}):null},Py=n=>Math.max(...n.map(r=>r.length+1)),pC=n=>r=>{const i=`/${r}`;return i.startsWith(n)&&i.length>=n.length},Yy=3,gC=({commands:n,onSelectCommand:r})=>{const i=We(),[l,u]=I.useState(!1),f=g=>()=>{r(`/${g}`),u(!1)},h=()=>{u(!0)},d=()=>{u(!1)},m=l?n:n.slice(0,Yy);return b.jsxs("div",{className:Wi.commandsSelections,children:[m.map(g=>b.jsxs("button",{"aria-label":i(`commands.${g}`),"data-title":i(`commands.${g}`),tabIndex:0,onClick:f(g),children:["/",g]},g)),m.length<n.length?b.jsx("button",{"aria-label":i("commands.show-more.tooltip"),"data-title":i("commands.show-more.tooltip"),tabIndex:0,onClick:h,children:i("commands.show-more.action")},"show-more"):m.length>Yy?b.jsx("button",{"aria-label":i("commands.show-less.tooltip"),"data-title":i("commands.show-less.tooltip"),tabIndex:0,onClick:d,children:i("commands.show-less.action")},"show-less"):null]})},yC="_callToActionContainer_bkfcm_1",_C="_callToActionTitle_bkfcm_23",bC="_rateOverlay_bkfcm_30",vC="_body_bkfcm_52",EC="_footer_bkfcm_60",SC="_actions_bkfcm_73",TC="_bubbles_bkfcm_101",xC="_stars_bkfcm_203",AC="_starsSmall_bkfcm_215",OC="_starsLarge_bkfcm_219",RC="_star_bkfcm_203",wC="_starReadonly_bkfcm_236",CC="_starIcon_bkfcm_246",NC="_starsDescriptionContainer_bkfcm_264",DC="_starsDescription_bkfcm_264",bt={callToActionContainer:yC,callToActionTitle:_C,rateOverlay:bC,body:vC,footer:EC,actions:SC,bubbles:TC,stars:xC,starsSmall:AC,starsLarge:OC,star:RC,starReadonly:wC,starIcon:CC,starsDescriptionContainer:NC,starsDescription:DC},MC=({value:n,index:r,count:i,readonly:l,onHover:u,onClick:f})=>{const h=d=>{f&&d.key==="Enter"&&f()};return b.jsx("li",{className:Z(bt.star,{[bt.starReadonly]:l},"chat__conversationRating__star"),children:b.jsx("div",{role:"radio","aria-checked":n>r?"true":"false","aria-posinset":r+1,"aria-setsize":i,tabIndex:0,onMouseOver:u,onKeyDown:h,onClick:f,children:b.jsx("span",{role:"img","aria-label":"Star",className:Z(bt.starIcon),children:b.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:b.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"})})})})})},Zy=5,cv=({value:n,size:r,readonly:i=!1,onChange:l})=>{const[u,f]=I.useState(void 0),h=()=>{f(void 0)},d=g=>()=>{if(!i){const _=g+1;f(_)}},m=g=>()=>{l&&!i&&(l(g===0&&n===1?0:g+1),f(void 0))};return b.jsx("ul",{tabIndex:0,role:"radiogroup",className:Z(bt.stars,{[bt.starsSmall]:r==="small",[bt.starsLarge]:r==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:r==="small",chat__conversationRating__stars__large:r==="large"}),onMouseOut:h,children:Array(Zy).fill(0).map((g,_)=>b.jsx(MC,{value:u===void 0?n:u,index:_,count:Zy,readonly:i,onHover:d(_),onClick:m(_)},_))})},BC=({visible:n,onRate:r})=>{const i=We();return n?b.jsxs("div",{className:Z(bt.callToActionContainer,"chat__conversationRating__callToAction"),children:[b.jsx("div",{className:Z(bt.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),b.jsx(cv,{value:0,size:"small",onChange:r})]}):null},Af=({isFirstMessageBySender:n,isLastMessageBySender:r,children:i})=>b.jsxs("div",{className:Z(me.message,me.messageBot,n&&me.messageBotFirst,r&&me.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",n&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:[b.jsx("img",{className:Z(me.avatar,me.botAvatar),src:"bot.svg",alt:"Bot"}),b.jsx("div",{className:Z(me.bubble,me.bubbleLeft,"chat__bubble","chat__botBubble"),children:b.jsx("div",{className:Z(me.leftText,me.bubbleContent),children:i})})]}),jC=({children:n})=>b.jsx("div",{className:Z(me.message,me.messageGuest,me.messageGuestFirst,me.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:b.jsx("div",{className:Z(me.bubble,me.bubbleRight,"chat__bubble","chat__guestBubble"),children:b.jsx("div",{className:Z(me.rightText,me.bubbleContent),children:n})})}),UC=({visible:n,rating:r,onRate:i,onClose:l})=>{const u=We(),[f,h]=I.useState(r),[d,m]=I.useState(void 0),[g,_]=I.useState(void 0),[S,y]=I.useState({submitted:!1,feedback:""}),[x,T]=I.useState(!1),z=I.useRef(null);I.useEffect(()=>{n?(y({submitted:!1,feedback:""}),_(n)):g===!0&&_(!1)},[n,g]),I.useEffect(()=>{h(r)},[r]),I.useEffect(()=>{const H=u(`conversation-rating.overlay.bot-message.rate-feedback.value-${f}`);m(H!=null&&H.length?H:void 0)},[f,u]),I.useEffect(()=>{S.submitted?setTimeout(()=>T(!0),S.feedback.length?500:0):T(!1)},[S]);const N=H=>{var O,R;H.preventDefault();const D=((R=(O=z.current)==null?void 0:O.value)==null?void 0:R.trim())||"";i(f,D),y({submitted:!0,feedback:D})};return b.jsx("div",{className:Z(bt.rateOverlay,Vn.bottomSheet,"chat__conversationRating__overlay",{[Vn.bottomSheetOpen]:g===!0,[Vn.bottomSheetClose]:g===!1}),children:b.jsxs("form",{onSubmit:N,children:[b.jsxs("div",{className:Z(bt.body,"chat__conversationRating__overlay__body"),children:[b.jsx("div",{}),b.jsx("div",{className:Z(bt.bubbles),children:n&&d&&b.jsxs(b.Fragment,{children:[b.jsxs(Af,{isFirstMessageBySender:!0,isLastMessageBySender:!1,children:[b.jsx("h2",{children:u("conversation-rating.overlay.title")}),b.jsxs("div",{className:Z(bt.starsDescriptionContainer),children:[b.jsx(cv,{value:f,size:"large",readonly:S.submitted,onChange:h}),b.jsxs("div",{className:Z(bt.starsDescription),children:[b.jsx("div",{children:u("conversation-rating.overlay.star.very-bad")}),b.jsx("div",{children:u("conversation-rating.overlay.star.very-good")})]})]})]}),b.jsx(Af,{isFirstMessageBySender:!1,isLastMessageBySender:!x||!!S.feedback.length,children:b.jsx("div",{children:d})}),!!S.feedback.length&&b.jsx(jC,{children:S.feedback}),x&&b.jsx(Af,{isFirstMessageBySender:!!S.feedback.length,isLastMessageBySender:!0,children:b.jsx("div",{children:u("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),b.jsxs("div",{className:Z(bt.footer,"chat__conversationRating__overlay__footer"),children:[!S.submitted&&b.jsx("input",{ref:z,placeholder:u("conversation-rating.overlay.guest-feedback.input-placeholder")}),b.jsx("div",{className:Z(bt.actions,"chat__conversationRating__overlay__footer__actions"),children:S.submitted?b.jsx(is,{type:"button",onClick:l,children:u("conversation-rating.overlay.action.close")}):b.jsx(is,{type:"submit",children:u("conversation-rating.overlay.action.submit")})})]})]})})},HC=({conversationRating:{enabled:n,rating:r},numberOfMessagesFromGuest:i,showRatingOverlay:l,setShowRatingOverlay:u,onRate:f})=>{const[h,d]=I.useState(0),m=S=>{d(S),u(!0)},g=()=>u(!1),_=!r&&i>=1;return n?b.jsxs(b.Fragment,{children:[b.jsx(BC,{visible:_,onRate:m}),b.jsx(UC,{visible:l,rating:h,onRate:f,onClose:g})]}):null},LC=I.memo(HC),zC="_inputWrapper_e3h44_1",kC="_withOpenCommands_e3h44_14",GC="_messageInputWrapper_e3h44_20",qC="_messageInput_e3h44_20",IC="_buttons_e3h44_44",FC="_button_e3h44_44",Fr={inputWrapper:zC,withOpenCommands:kC,messageInputWrapper:GC,messageInput:qC,buttons:IC,button:FC},VC="_audioRecorder_g845f_1",PC="_audioButton_g845f_6",YC="_recorderIcon_g845f_37",ZC="_spinning_g845f_60",Vr={audioRecorder:VC,audioButton:PC,recorderIcon:YC,spinning:ZC},Xy=2048,fo=16e3;class XC extends O_.Component{constructor(i){super(i);Ce(this,"audioInput",null);Ce(this,"volume",null);Ce(this,"leftchannel",[]);Ce(this,"recorder",null);Ce(this,"recordingLength",0);Ce(this,"sampleRate",null);Ce(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 l=window.AudioContext||window.webkitAudioContext,u=new l;this.sampleRate=u.sampleRate,this.volume=u.createGain(),this.audioInput=u.createMediaStreamSource(i),this.audioInput.connect(this.volume),this.recorder=u.createScriptProcessor(Xy,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(u.destination)}processRecordingInput(i){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const l=i.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(l)),this.recordingLength+=Xy}}handleClickSubmitAudio(){const i=KC(this.leftchannel,this.recordingLength),l=$C(i,this.sampleRate||0),u=QC(l);this.props.onAudioRecorded(u),this.handleClickStopAudio()}handleClickStopAudio(){var i,l,u,f;this.setState({recordingState:"none"}),(i=this.audioInput)==null||i.disconnect(),(l=this.volume)==null||l.disconnect(),(u=this.recorder)==null||u.disconnect(),this.mediaStream&&((f=this.mediaStream)==null||f.getAudioTracks().forEach(h=>{h.stop()}))}render(){return b.jsxs("div",{className:Vr.audioRecorder,children:[this.state.recordingState==="none"&&b.jsx("button",{className:Z(Vr.audioButton,"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:b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[b.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"}),b.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&b.jsxs("svg",{className:Vr.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[b.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"}),b.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&b.jsxs("div",{className:Vr.audioRecorder,children:[b.jsx("button",{className:Z(Vr.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[b.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"}),b.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),b.jsx("div",{className:Vr.recorderIcon}),b.jsx("button",{className:Z(Vr.audioButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[b.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),b.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const QC=n=>{const r=new ArrayBuffer(44+n.length*2),i=new DataView(r);Ql(i,0,"RIFF"),i.setUint32(4,44+n.length*2,!0),Ql(i,8,"WAVE"),Ql(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,fo,!0),i.setUint32(28,fo*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),Ql(i,36,"data"),i.setUint32(40,n.length*2,!0);const l=n.length;let u=44;const f=1;for(let h=0;h<l;h++)i.setInt16(u,n[h]*(32767*f),!0),u+=2;return new Blob([i],{type:"audio/wav"})},Ql=(n,r,i)=>{for(let l=0;l<i.length;l++)n.setUint8(r+l,i.charCodeAt(l))},KC=(n,r)=>{const i=new Float32Array(r);let l=0;const u=n.length;for(let f=0;f<u;f++){const h=n[f];i.set(h,l),l+=h.length}return i},$C=(n,r)=>{if(fo===r)return n;const i=r/fo,l=Math.round(n.length/i),u=new Float32Array(l);let f=0,h=0;for(;f<u.length;){const d=Math.round((f+1)*i);let m=0,g=0;for(let _=h;_<d&&_<n.length;_++)m+=n[_],g++;u[f]=m/g,f++,h=d}return u},JC=({disabled:n,textInput:r,commandsVisible:i,onTextInput:l,onTextInputSubmit:u,onAudioRecorded:f,onOpenTranscriptExportModal:h})=>{const d=We(),m=I.useRef(null),{enableTranscriptExportPdf:g,enableTranscriptExportEmail:_,enableSpeechSupport:S}=kt(N=>N.settings);I.useEffect(()=>{var N;(N=m.current)==null||N.focus()},[r]);const y=()=>{const N=m.current;N&&r.trim().length>=1&&u(r.trim())&&(N.value="",N.style.height="",N.focus())},x=N=>{N.preventDefault(),y()},T=N=>{const H=N.target.value;l(H),N.target.style.height="";const{scrollHeight:D}=N.target;N.target.style.height=`${D>150?150:D}px`},z=N=>{N.code==="Enter"&&!N.shiftKey?(N.repeat||y(),N.preventDefault()):i&&(N.code==="ArrowUp"||N.code==="ArrowDown")&&N.preventDefault()};return b.jsxs("form",{className:Z(Fr.inputWrapper,i&&Fr.withOpenCommands,"chat__textInput"),onSubmit:x,children:[b.jsx("div",{className:Fr.messageInputWrapper,children:b.jsx("textarea",{id:"user_input",ref:m,className:Fr.messageInput,tabIndex:0,placeholder:d("message-input-placeholder"),value:r,onChange:T,onKeyDown:z,"aria-label":d("message-input-label"),"aria-controls":"command-list","aria-haspopup":"listbox"})}),b.jsxs("div",{className:Z(Fr.buttons,"chat__buttons"),children:[!r.length&&(g||_)&&b.jsx("button",{type:"button",className:Z(Fr.button,"chat__button"),"aria-label":d("message-input.actions.export-transcript.label"),"data-title":d("message-input.actions.export-transcript.label"),tabIndex:0,onClick:h,children:b.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:b.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"})})}),r.length||!S||navigator.mediaDevices===void 0?b.jsx("button",{className:Z(Fr.button,"chat__button"),type:"submit","aria-label":d("message-input.actions.submit.label"),"data-title":d("message-input.actions.submit.label"),tabIndex:0,disabled:n,children:b.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:b.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"})})}):S&&navigator.mediaDevices!==void 0&&b.jsx(XC,{translate:d,onAudioRecorded:f})]})]})},WC="_quickReplies_83npe_1",e3="_quickReply_83npe_9",Qy={quickReplies:WC,quickReply:e3},t3=({quickReplies:n,onQuickReplyClick:r})=>n.length?b.jsx("div",{className:Z(Qy.quickReplies,"chat__quickReplies"),children:n.map(i=>b.jsx(Ao,{tabIndex:0,className:Z(Qy.quickReply,"chat__button","chat__quickReply"),onClick:()=>r(i),children:i.label},i.label))}):null,Ky=5e3,n3=1e3,r3=({isBotTyping:n,quickReplies:r,conversationRating:i,numberOfMessagesFromGuest:l,showRatingOverlay:u,commands:f,setShowRatingOverlay:h,onTextInput:d,onRate:m,onQuickReplyClick:g,onAudioRecorded:_,onOpenTranscriptExportModal:S})=>{const[y,x]=I.useState(""),[T,z]=I.useState(!1),[N,H]=I.useState(!1),D=I.useRef(0),O=I.useRef(0);I.useEffect(()=>{if(T&&!n){const U=D.current?Date.now()-D.current:0;U>Ky?z(!1):setTimeout(()=>{z(!1)},Ky-U)}},[T,n]),I.useEffect(()=>{T&&(D.current=Date.now())},[T]);const R=U=>{const Y=Date.now()-O.current<n3;return N?!1:n||Y?(z(!0),!1):(d(U),x(""),O.current=Date.now(),!0)},E=U=>{x(U+" ")};return b.jsxs("div",{className:Z(rC.inputContainer),children:[b.jsx(t3,{quickReplies:r,onQuickReplyClick:g}),b.jsx(sC,{visible:T}),!T&&b.jsx(LC,{conversationRating:i,numberOfMessagesFromGuest:l,onRate:m,showRatingOverlay:u,setShowRatingOverlay:h}),!!(f!=null&&f.length)&&b.jsx(mC,{text:y,commands:f,onSelectCommand:E,onVisibilityChange:H}),b.jsx(JC,{textInput:y,disabled:T,commandsVisible:N,onTextInput:x,onTextInputSubmit:R,onOpenTranscriptExportModal:S,onAudioRecorded:_}),!!(f!=null&&f.length)&&b.jsx(gC,{commands:f,onSelectCommand:x})]})},a3=({clientName:n,messages:r,quickReplies:i,isBotTyping:l,drawerContentUrl:u,conversationRating:f,onMessageFromUser:h,onRate:d,onQuickReplyClick:m,onButtonClick:g,onLinkClick:_,onAudioRecorded:S,onTranscriptExport:y,onPdfExport:x,onTranscriptItemReaction:T})=>{const z=Fa(),N=kt(ee=>ee.connection.connectionState),{enableTranscriptExportPdf:H,enableTranscriptExportEmail:D,commands:O}=kt(ee=>ee.settings),[R,E]=I.useState(!1),[U,Y]=I.useState(!1),K=H||D,re=r.filter(ee=>ee.sender.type===zb.GUEST).length;return I.useEffect(()=>{if(N===Xr.CONNECTED){const ee=go.parse(window.location.search);z(Lb(n,ee))}},[n,N,z]),b.jsxs("div",{className:df.container,children:[b.jsxs("div",{className:Z([df.chatcontent,(R||U)&&df.accessabilityHidden]),children:[b.jsx(Hw,{messages:r,isBotTyping:l,commands:O,onButtonClick:g,onLinkClick:_,onTranscriptItemReaction:T}),b.jsx(r3,{isBotTyping:l,quickReplies:l?[]:i,numberOfMessagesFromGuest:re,conversationRating:R?{enabled:!1}:f,showRatingOverlay:U,setShowRatingOverlay:Y,commands:O,onRate:d,onQuickReplyClick:m,onTextInput:h,onAudioRecorded:S,onOpenTranscriptExportModal:()=>E(!R)}),b.jsx(Zw,{})]}),K&&b.jsx(tC,{enableTranscriptExportPdf:H,enableTranscriptExportEmail:D,visible:R,onEmailExport:y,onPdfExport:x,onClose:()=>E(!1)}),b.jsx(Fw,{contentUrl:u})]})},i3=n=>{const{messages:r,quickReplies:i,isBotTyping:l,drawerContentUrl:u,conversationRating:f}=n.chat;return{messages:r,quickReplies:i,isBotTyping:l,drawerContentUrl:u,conversationRating:f}},s3=n=>({onRestartChat:(r,i)=>n(To(r,i)),onMessageFromUser:r=>n(pb(r)),onRate:(r,i)=>n(Gx(r,i)),onAudioRecorded:r=>n(Ux(r)),onActionFromUser:r=>n(r),onQuickReplyClick:r=>n(mb(r)),onNluEvent:r=>n(Eb(r)),onButtonClick:r=>n(Ix(r)),onLinkClick:r=>n(Fx(r)),onTranscriptExport:r=>n(Lx(r)),onPdfExport:()=>n(zx()),onTranscriptItemReaction:(r,i)=>n(Ee.transcriptItemGuestReaction(r,i||null))}),l3=fS(i3,s3)(a3),fv=()=>o3(window.location.pathname),o3=n=>{const r=n.split("/"),i=n.endsWith("/");return r[r.length-(i?2:1)]},hv=()=>I.useMemo(()=>fv(),[]),dv=()=>{const[n,r]=I.useState(!1);return I.useEffect(()=>{r((()=>{try{return window.self!==window.top}catch{return!0}})())},[]),n},Kh=n=>r=>{const i=r.key;(i==="ArrowDown"||i==="ArrowRight"||i==="Enter"||i===" "||i==="Space")&&(r.stopPropagation(),n())},u3=({onClick:n})=>{const r=We();return dv()?b.jsx("button",{className:"tooltip--bottom","aria-label":r("header.close-chat"),"data-title":r("header.close-chat"),tabIndex:0,onClick:n,onKeyDown:Kh(n),children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:b.jsx("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"})})}):null},c3=()=>{const n=We(),r=dv(),i=kt(u=>u.settings.enableStandaloneView),l=()=>{window.open(window.location.href,"_blank")};return r&&i?b.jsx("button",{className:"tooltip--bottom","aria-label":n("header.expand-chat"),"data-title":n("header.expand-chat"),tabIndex:0,onClick:l,onKeyDown:Kh(l),children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:b.jsx("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"})})}):null},f3="_header_1hky6_1",h3="_logoContainer_1hky6_13",d3="_logo_1hky6_13",m3="_actions_1hky6_27",Kl={header:f3,logoContainer:h3,logo:d3,actions:m3},p3=({onClick:n})=>{const r=We();return b.jsx("button",{className:"tooltip--bottom","aria-label":r("header.restart-chat"),"data-title":r("header.restart-chat"),tabIndex:0,onClick:n,onKeyDown:Kh(n),children:b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 32 32",children:[b.jsx("path",{d:"M14.506,23.578l-5.511,0l-3.993,3.501l-0.007,0.006c-0.302,0.261 -0.687,0.405 -1.084,0.405c-0.245,-0.001 -0.488,-0.055 -0.711,-0.161c-0.595,-0.277 -0.978,-0.886 -0.974,-1.551l-0,-19.558c-0,-0.939 0.761,-1.711 1.685,-1.711l21.189,-0c0.924,-0 1.685,0.772 1.685,1.711l0,5.104l-1.444,0l-0,-5.104c-0,-0.134 -0.109,-0.244 -0.241,-0.244l-21.189,-0c-0.132,-0 -0.24,0.11 -0.24,0.244l-0,19.558c0.001,0.133 0.109,0.242 0.24,0.242c0.056,-0 0.109,-0.019 0.152,-0.055l4.192,-3.675c0.131,-0.115 0.299,-0.179 0.472,-0.179l5.779,0l-0,1.467Z"}),b.jsx("path",{d:"M29.869,20.148c0,4.137 -3.373,7.556 -7.509,7.612l-0.102,-0c-1.943,0.004 -3.814,-0.741 -5.223,-2.078c-0.183,-0.172 -0.286,-0.412 -0.286,-0.664c-0,-0.501 0.412,-0.913 0.913,-0.913c0.233,-0 0.458,0.089 0.627,0.249c1.074,1.014 2.495,1.579 3.971,1.579c3.174,-0 5.785,-2.612 5.785,-5.785c-0,-3.173 -2.611,-5.784 -5.785,-5.784c-1.533,-0 -3.006,0.61 -4.09,1.694c-0.01,0.01 -0.019,0.019 -0.03,0.028l-1.447,1.322l1.302,0c0.502,0 0.914,0.413 0.914,0.914c-0,0.501 -0.412,0.913 -0.914,0.913l-3.653,0c-0.501,0 -0.913,-0.412 -0.913,-0.913l-0,-3.654c-0,-0.501 0.412,-0.913 0.913,-0.913c0.501,0 0.913,0.412 0.913,0.913l0,1.577l1.635,-1.496c1.426,-1.418 3.357,-2.215 5.368,-2.215c4.175,0 7.611,3.436 7.611,7.611c-0,0.001 -0,0.002 -0,0.003Z"})]})})},$y=({className:n,withActions:r=!0,...i})=>{const l=Fa(),u=hv(),f=()=>{const d=go.parse(window.location.search);l(To(u,d))},h=()=>{l(jA())};return b.jsxs("div",{className:Z([Kl.header,n]),...i,children:[b.jsx("div",{className:Kl.logoContainer,children:b.jsx("div",{className:Kl.logo})}),b.jsxs("div",{className:Kl.actions,children:[r&&b.jsx(p3,{onClick:f}),b.jsx(c3,{}),b.jsx(u3,{onClick:h})]})]})},g3="_chatwindow_6v6ob_1",y3="_chatwindowWithAside_6v6ob_46",Jy={chatwindow:g3,chatwindowWithAside:y3},_3="_sourceInfos_1878a_1",b3="_sourceDetails_1878a_16",v3="_sourceHeader_1878a_23",E3="_sourceHeaderIcon_1878a_43",S3="_openSourceButton_1878a_47",T3="_closeSourceInfosButton_1878a_70",x3="_sourceContent_1878a_85",A3="_loadingSourceInfos_1878a_109",O3="_loading_1878a_109",R3="_loadingError_1878a_123",Sn={sourceInfos:_3,sourceDetails:b3,sourceHeader:v3,sourceHeaderIcon:E3,openSourceButton:S3,closeSourceInfosButton:T3,sourceContent:x3,loadingSourceInfos:A3,loading:O3,loadingError:R3},w3=({onClick:n})=>{const r=We();return b.jsx("button",{className:Z(Sn.closeSourceInfosButton,"tooltip--bottom"),"aria-label":r("source-infos.close"),"data-title":r("source-infos.close"),tabIndex:0,onClick:n,children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:b.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})})},C3=n=>b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:b.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),N3=({type:n,...r})=>{switch(n){case"WEBSITE":return b.jsx(sv,{...r});case"PDF":return b.jsx(iv,{...r});case"DOCX":return b.jsx(rv,{...r});case"TEXT":return b.jsx(C3,{...r});default:return b.jsx(av,{...r})}},D3=({sourceInfos:n,onClose:r})=>b.jsxs("div",{className:Sn.sourceHeader,children:[b.jsx("div",{className:Sn.sourceHeaderIcon,children:n&&b.jsx(N3,{type:n.knowledgeBaseType})}),b.jsx("div",{children:n&&b.jsx("h1",{children:n.title})}),b.jsx(w3,{onClick:r})]}),M3=({title:n,href:r,children:i})=>b.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),B3=({className:n,children:r,...i})=>b.jsx("a",{className:Z(as.button,as.buttonPrimary,n),type:"button",...i,children:r}),j3=({label:n,url:r})=>b.jsxs(B3,{className:Sn.openSourceButton,href:r,target:"_blank",children:[b.jsx("p",{children:n}),b.jsx("div",{children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#000000",viewBox:"0 0 256 256",children:b.jsx("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"})})})]}),U3=({sourceInfos:n})=>b.jsxs(b.Fragment,{children:[b.jsx("div",{className:Z(Sn.sourceContent,uv.markdown),children:b.jsx(bn,{options:{overrides:{a:M3}},children:n.content})}),b.jsx(j3,{label:n.title,url:n.url})]}),H3=""+new URL("undraw_fixing-bugs-D_eYxJc6.svg",import.meta.url).href,L3=()=>{const n=We();return b.jsxs("div",{className:Sn.loadingError,children:[b.jsx("h1",{children:n("source-infos.error.title")}),b.jsx("img",{src:H3,title:n("source-infos.error.title")}),b.jsx("p",{children:n("source-infos.error.info")})]})},z3=()=>b.jsx("div",{className:Sn.loadingSourceInfos,children:b.jsx("svg",{className:Sn.loading,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:b.jsx("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"})})}),k3=()=>{const n=Fa(),r=kt(l=>l.chat.sourceInfos),i=()=>{n(HA())};return r?b.jsxs("div",{className:Sn.sourceInfos,children:[b.jsx("div",{className:Sn.sourceDetails,children:b.jsx(D3,{sourceInfos:r.type==="loaded"?r:void 0,onClose:i})}),r.type==="loading"?b.jsx(z3,{}):r.type==="loading-error"?b.jsx(L3,{}):b.jsx(U3,{sourceInfos:r})]}):null},G3="_container_114wy_1",q3="_body_114wy_7",I3="_intro_114wy_14",F3="_footer_114wy_39",V3="_footnote_114wy_43",P3="_containerWithFootnote_114wy_58",Y3="_startChatButton_114wy_73",Z3="_formFields_114wy_77",X3="_formField_114wy_77",Q3="_radio_114wy_89",K3="_checkbox_114wy_96",$3="_input_114wy_104",J3="_inputLabel_114wy_138",W3="_selectWrapper_114wy_142",e6="_select_114wy_142",t6="_selectLabel_114wy_188",ft={container:G3,body:q3,intro:I3,footer:F3,footnote:V3,containerWithFootnote:P3,startChatButton:Y3,formFields:Z3,formField:X3,radio:Q3,checkbox:K3,input:$3,inputLabel:J3,selectWrapper:W3,select:e6,selectLabel:t6},n6=({name:n,label:r,defaultValue:i,required:l,onChange:u})=>{const f=h=>{u(h.currentTarget.checked?"true":"false")};return b.jsxs("label",{className:Z(ft.checkbox,"chat__startScreen__checkbox"),htmlFor:n,children:[b.jsx("input",{type:"checkbox",id:n,name:n,defaultChecked:i==="true",required:l,onChange:f}),b.jsx("div",{children:r})]})},r6=({type:n,name:r,label:i,defaultValue:l,placeholder:u,required:f,multiple:h,min:d,max:m,pattern:g,onChange:_})=>{const S=y=>{_(y.target.value)};return b.jsxs("label",{className:Z(ft.input,"chat__startScreen__input"),htmlFor:r,children:[b.jsx("div",{className:Z(ft.inputLabel),children:i}),b.jsx("input",{type:n,id:r,name:r,defaultValue:l,placeholder:u,required:f,multiple:h,min:d,max:m,pattern:g,onChange:S})]})},a6=({name:n,value:r,label:i,defaultChecked:l,required:u,onChange:f})=>{const h=`${n}-${r}`,d=m=>{f(m.target.value)};return b.jsxs("label",{className:Z(ft.radio,"chat__startScreen__radio"),htmlFor:h,children:[b.jsx("input",{id:h,type:"radio",name:n,value:r,defaultChecked:l,required:u,onChange:d}),b.jsx("span",{className:Z(ft.label),children:i})]})},i6=({name:n,label:r,defaultValue:i,required:l,multiple:u,options:f,onChange:h})=>{const d=m=>{h(m.target.value)};return b.jsxs("label",{className:Z(ft.select,"chat__startScreen__select"),htmlFor:n,children:[b.jsx("div",{className:Z(ft.selectLabel),children:r}),b.jsx("div",{className:Z(ft.selectWrapper),children:b.jsx("select",{id:n,name:n,defaultValue:i,required:l,multiple:u,onChange:d,children:Object.entries(f||{}).map(([m,g])=>b.jsx("option",{value:m,selected:g===i,children:g}))})})]})},s6="start-screen.intro",l6="start-screen.start-chat",o6="start-screen.footnote",ln="start-screen.form",Wy=`${ln}.fields`,u6=()=>{const n=We(),r=Fa(),[i,l]=I.useState({}),u=()=>{const S=Object.entries(i).reduce((y,[x,T])=>({...y,[x]:T.value}),{});r(DA(S))},f=n(s6),h=n(l6),d=n(o6),m=I.useMemo(()=>{var S;return((S=n(Wy))==null?void 0:S.split(";").map(y=>y.trim()))??[]},[n(Wy)]);I.useEffect(()=>{m.length&&Object.keys(i).length===0&&l(m.reduce((S,y)=>({...S,[y]:c6(y,n)}),{}))},[n,m,i]);const g=S=>{S.preventDefault(),u()},_=S=>y=>{l(x=>({...x,[S]:{...x[S],value:y}}))};return b.jsxs("form",{onSubmit:g,className:Z(ft.container,d&&ft.containerWithFootnote,"chat__startScreen"),children:[b.jsxs("div",{className:Z(ft.body,"chat__startScreen__body"),children:[f&&b.jsx("div",{className:Z(ft.intro,"chat__startScreen__intro"),children:b.jsx(bn,{options:{overrides:{a:e_}},children:f})}),b.jsx("div",{className:Z(ft.formFields,"chat__startScreen__fields"),children:Object.values(i).map(({type:S,name:y,label:x,placeholder:T,defaultValue:z,options:N,required:H,multiple:D,min:O,max:R,pattern:E})=>b.jsx("div",{className:Z(ft.formField,"chat__startScreen__field"),children:(()=>{switch(S){case"radio":return b.jsxs(b.Fragment,{children:[b.jsx("div",{children:x}),Object.entries(N||{}).map(([U,Y])=>b.jsx(a6,{name:y,value:U,label:Y,defaultChecked:U===z,required:H,onChange:_(y)}))]});case"checkbox":return b.jsx(n6,{name:y,label:x,defaultValue:z,required:H,onChange:_(y)});case"select":return b.jsx(i6,{name:y,label:x,defaultValue:z,required:H,multiple:D,options:N,onChange:_(y)});default:return b.jsx(r6,{type:S,name:y,label:x,placeholder:T,defaultValue:z,required:H,multiple:D,min:O,max:R,pattern:E,onChange:_(y)})}})()},y))})]}),b.jsxs("div",{className:Z(ft.footer,"chat__startScreen__footer"),children:[b.jsx(is,{type:"submit",className:ft.startChatButton,children:h}),d&&b.jsx("div",{className:ft.footnote,children:b.jsx(bn,{options:{overrides:{a:e_}},children:d})})]})]})},e_=({title:n,href:r,children:i})=>b.jsx("a",{href:r,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),c6=(n,r)=>{const i=r(`${ln}.${n}.type`)||"text",l=r(`${ln}.${n}.required`)==="true",u=r(`${ln}.${n}.multiple`)==="true",f=r(`${ln}.${n}.placeholder`),h=r(`${ln}.${n}.label`)||"",d=r(`${ln}.${n}.defaultValue`),m=r(`${ln}.${n}.min`),g=r(`${ln}.${n}.max`),_=r(`${ln}.${n}.pattern`),S=h6(r(`${ln}.${n}.options`));return{name:n,label:h,placeholder:f,value:f6(i,d,S)||"",defaultValue:d,options:S,type:i,required:l,multiple:u,min:m,max:g,pattern:_}},f6=(n,r,i)=>r||n==="select"&&Object.keys(i)[0]||"",h6=(n="")=>n.split(";").map(r=>r.trim()).reduce((r,i)=>{const[l,u]=i.split(":").map(f=>f.trim());return{...r,[l]:u}},{}),d6=()=>{const n=po();I.useEffect(()=>{window.document.documentElement.lang=n.locale},[n.locale])},La={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"},m6=({clientName:n})=>{d6();const r=Fa(),i=kt(_=>_.intl.messages),l=We(),u=kt(_=>_.settings.enableStartScreen),f=kt(_=>_.startScreen.startScreenStatus),[h,d]=I.useState(void 0);I.useEffect(()=>{const _=go.parse(window.location.search);_.cssClassName&&d(_.cssClassName);const S=y=>{switch(y.data.type){case La.TRIGGER_ACTION:r(y.data.action);break;case La.TRIGGER_STORY:r(Eb(y.data.story));break;case La.ON_CHAT_WINDOW_OPEN:r({type:"webclient.chatwindow.opened"});break;case La.ON_CHAT_WINDOW_CLOSE:r({type:"webclient.chatwindow.closed"});break;case La.CHAT_MESSAGE_FROM_GUEST:r(pb(y.data.text));break;case La.RESTART_CHAT:r(To(n,_));break}};return r(zA(n,_)),window.addEventListener("message",y=>S(y),!1),()=>window.removeEventListener("message",S)},[n,r]),I.useEffect(()=>{const _=l("page.title");_&&document&&(document.title=_)},[i,l]);const m=u===void 0,g=u===!1||f==="HIDDEN";return b.jsx("div",{className:Z(Jy.chatwindow,g&&Jy.chatwindowWithAside,"chat__chatwindow",h),children:m?null:g?b.jsxs(b.Fragment,{children:[b.jsx("header",{children:b.jsx($y,{})}),b.jsx("main",{children:b.jsx(l3,{clientName:n})}),b.jsx("aside",{children:b.jsx(k3,{})})]}):b.jsxs(b.Fragment,{children:[b.jsx("header",{children:b.jsx($y,{withActions:!1})}),b.jsx("main",{children:b.jsx(u6,{})})]})})},p6=1024,g6=()=>{const n=hv(),r=kt(f=>f.intl.locale),i=kt(f=>f.intl.messages),[l,u]=I.useState(t_());return I.useEffect(()=>{const f=()=>{u(t_())};return window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]),b.jsx(JT,{locale:r,messages:i,children:b.jsx("div",{className:Z([ex.app,l?"chat__large":"chat__small"]),children:b.jsx(m6,{clientName:n})})})},t_=()=>window.innerWidth>=p6;var Of,n_;function $h(){if(n_)return Of;n_=1;function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}return Of=n,Of}var Rf,r_;function y6(){if(r_)return Rf;r_=1;var n=typeof Tl=="object"&&Tl&&Tl.Object===Object&&Tl;return Rf=n,Rf}var wf,a_;function mv(){if(a_)return wf;a_=1;var n=y6(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();return wf=i,wf}var Cf,i_;function _6(){if(i_)return Cf;i_=1;var n=mv(),r=function(){return n.Date.now()};return Cf=r,Cf}var Nf,s_;function b6(){if(s_)return Nf;s_=1;var n=/\s/;function r(i){for(var l=i.length;l--&&n.test(i.charAt(l)););return l}return Nf=r,Nf}var Df,l_;function v6(){if(l_)return Df;l_=1;var n=b6(),r=/^\s+/;function i(l){return l&&l.slice(0,n(l)+1).replace(r,"")}return Df=i,Df}var Mf,o_;function pv(){if(o_)return Mf;o_=1;var n=mv(),r=n.Symbol;return Mf=r,Mf}var Bf,u_;function E6(){if(u_)return Bf;u_=1;var n=pv(),r=Object.prototype,i=r.hasOwnProperty,l=r.toString,u=n?n.toStringTag:void 0;function f(h){var d=i.call(h,u),m=h[u];try{h[u]=void 0;var g=!0}catch{}var _=l.call(h);return g&&(d?h[u]=m:delete h[u]),_}return Bf=f,Bf}var jf,c_;function S6(){if(c_)return jf;c_=1;var n=Object.prototype,r=n.toString;function i(l){return r.call(l)}return jf=i,jf}var Uf,f_;function T6(){if(f_)return Uf;f_=1;var n=pv(),r=E6(),i=S6(),l="[object Null]",u="[object Undefined]",f=n?n.toStringTag:void 0;function h(d){return d==null?d===void 0?u:l:f&&f in Object(d)?r(d):i(d)}return Uf=h,Uf}var Hf,h_;function x6(){if(h_)return Hf;h_=1;function n(r){return r!=null&&typeof r=="object"}return Hf=n,Hf}var Lf,d_;function A6(){if(d_)return Lf;d_=1;var n=T6(),r=x6(),i="[object Symbol]";function l(u){return typeof u=="symbol"||r(u)&&n(u)==i}return Lf=l,Lf}var zf,m_;function O6(){if(m_)return zf;m_=1;var n=v6(),r=$h(),i=A6(),l=NaN,u=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,h=/^0o[0-7]+$/i,d=parseInt;function m(g){if(typeof g=="number")return g;if(i(g))return l;if(r(g)){var _=typeof g.valueOf=="function"?g.valueOf():g;g=r(_)?_+"":_}if(typeof g!="string")return g===0?g:+g;g=n(g);var S=f.test(g);return S||h.test(g)?d(g.slice(2),S?2:8):u.test(g)?l:+g}return zf=m,zf}var kf,p_;function R6(){if(p_)return kf;p_=1;var n=$h(),r=_6(),i=O6(),l="Expected a function",u=Math.max,f=Math.min;function h(d,m,g){var _,S,y,x,T,z,N=0,H=!1,D=!1,O=!0;if(typeof d!="function")throw new TypeError(l);m=i(m)||0,n(g)&&(H=!!g.leading,D="maxWait"in g,y=D?u(i(g.maxWait)||0,m):y,O="trailing"in g?!!g.trailing:O);function R(de){var Ie=_,Te=S;return _=S=void 0,N=de,x=d.apply(Te,Ie),x}function E(de){return N=de,T=setTimeout(K,m),H?R(de):x}function U(de){var Ie=de-z,Te=de-N,G=m-Ie;return D?f(G,y-Te):G}function Y(de){var Ie=de-z,Te=de-N;return z===void 0||Ie>=m||Ie<0||D&&Te>=y}function K(){var de=r();if(Y(de))return re(de);T=setTimeout(K,U(de))}function re(de){return T=void 0,O&&_?R(de):(_=S=void 0,x)}function ee(){T!==void 0&&clearTimeout(T),N=0,_=z=S=T=void 0}function le(){return T===void 0?x:re(r())}function ie(){var de=r(),Ie=Y(de);if(_=arguments,S=this,z=de,Ie){if(T===void 0)return E(z);if(D)return clearTimeout(T),T=setTimeout(K,m),R(z)}return T===void 0&&(T=setTimeout(K,m)),x}return ie.cancel=ee,ie.flush=le,ie}return kf=h,kf}var Gf,g_;function w6(){if(g_)return Gf;g_=1;var n=R6(),r=$h(),i="Expected a function";function l(u,f,h){var d=!0,m=!0;if(typeof u!="function")throw new TypeError(i);return r(h)&&(d="leading"in h?!!h.leading:d,m="trailing"in h?!!h.trailing:m),n(u,f,{leading:d,maxWait:f,trailing:m})}return Gf=l,Gf}var C6=w6();const N6=ho(C6);function D6(n){return n&&n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function M6(n){return n}function B6(n,r){r=r||{};const i=r.delimiter||".",l=r.maxDepth,u=r.transformKey||M6,f={};function h(d,m,g){g=g||1,Object.keys(d).forEach(function(_){const S=d[_],y=r.safe&&Array.isArray(S),x=Object.prototype.toString.call(S),T=D6(S),z=x==="[object Object]"||x==="[object Array]",N=m?m+i+u(_):u(_);if(!y&&!T&&z&&Object.keys(S).length&&(!r.maxDepth||g<l))return h(S,N,g+1);f[N]=S})}return h(n),f}const gv={"page.title":"Bubble Chat Chatbot","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","bot-bubble.sources":"Quellenliste","bot-bubble.source.open":"Quelle öffnen","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:
|
|
107
107
|
|
|
108
108
|
- Der Chatverlauf wird im EU-Raum gespeichert und kann nur von autorisierten Personen eingesehen werden.
|
|
109
109
|
- 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.expand-chat":"Chat vergrössern","header.close-chat":"Chat minimieren","source-infos.close":"Schliessen","source-infos.error.title":"Fehler","source-infos.error.info":"Oops! Etwas ist schiefgelaufen. Bitte versuche es erneut oder kontaktiere den Support, falls das Problem weiterhin besteht.","commands.show-more.action":"Weitere ...","commands.show-more.tooltip":"Weitere Befehle anzeigen","commands.show-less.action":"Weniger ...","commands.show-less.tooltip":"Weniger Befehle anzeigen"},j6={"page.title":"Bubble Chat Chatbot","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","bot-bubble.sources":"Source list","bot-bubble.source.open":"Open source","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:
|
|
@@ -116,4 +116,4 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
|
|
|
116
116
|
|
|
117
117
|
- La cronologia delle chat è memorizzata nell'area UE e può essere visualizzata solo da persone autorizzate.
|
|
118
118
|
- 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.expand-chat":"Allarga la chat","header.close-chat":"Ridurre al minimo la chat","source-infos.close":"Chiudere","source-infos.error.title":"Errore","source-infos.error.info":"Ops! Qualcosa è andato storto. Riprovare o contattare l'assistenza se il problema persiste.","commands.show-more.action":"Di più","commands.show-more.tooltip":"Mostra più comandi","commands.show-less.action":"Meno","commands.show-less.tooltip":"Mostra meno comandi"},L6=["de","en","fr","it"],yv={locale:"de",messages:gv},z6=(n,r)=>{if(L6.includes(n)){const i=k6(n),l=B6(r);return{...i,...l}}return r},k6=n=>{switch(n.toString()){case"en":return j6;case"fr":return U6;case"it":return H6;default:return gv}},G6=(n=q6,r)=>{switch(r.type){case Ih:return Object.assign({},n,{connectionState:Xr.CONNECTING});case Fh:return Object.assign({},n,{connectionState:Xr.CONNECTED});case Vh:return Object.assign({},n,{connectionState:Xr.DISCONNECTED});case Ph:return Object.assign({},n,{connectionState:Xr.RECONNECTED});case Yh:return Object.assign({},n,{sessionId:r.sessionId});case Eo:return Object.assign({},n,{sessionId:r.payload.sessionId,userId:r.payload.userId});case So:return Object.assign({},n,{sessionId:void 0});default:return n}},q6={connectionState:Xr.DISCONNECTED,sessionId:void 0,userId:void 0},I6=(n=__,r)=>{switch(r.type){case Hb:return __;case Eo:return Pr({type:"webclient.chat.started"}),n;case So:return Pr({type:"webclient.chat.ended"}),n;case Ee.ActionTypes.TYPING_ON:return Object.assign({},n,{isBotTyping:!0});case Ee.ActionTypes.TYPING_OFF:return Object.assign({},n,{isBotTyping:!1});case Ee.ActionTypes.MESSAGE_FROM_GUEST:case Ee.ActionTypes.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return y_(n,r.message);case Ee.ActionTypes.MESSAGE_TO_GUEST:{Pr(r);const i=Object.assign({},r.message,{_id:r.meta.actionId}),l=n.messages.filter(u=>u._id===r.meta.actionId).length>0;return Object.assign({},n,{isBotTyping:!1,messages:l?n.messages:n.messages.concat([i]),quickReplies:i.quickReplies?i.quickReplies:[]})}case Dh:{const i=r.messages,l=i.length?i[i.length-1]:void 0;return Object.assign({},n,{isBotTyping:!1,messages:i,quickReplies:(l==null?void 0:l.quickReplies)||[]})}case Nh:return Pr(r.message),n;case Ee.ActionTypes.EVENT_TO_GUEST:return Pr(r.event),n;case Ee.ActionTypes.DRAWER_OPEN:return Object.assign({},n,{drawerContentUrl:r.payload.parameters.contentUrl});case Ee.ActionTypes.DRAWER_CLOSE:return Object.assign({},n,{drawerContentUrl:void 0});case Ee.ActionTypes.GUEST_LOCALE_CHANGED:return Object.assign({},n,{locale:r.payload.locale});case _b:return Pr(r),n;case bb:return Pr(r),n;case Bh:{const i=new Ee.TextMessage(r.transcription,new Ee.GuestUser),l=Object.assign({},i,{_id:ih()});return y_(n,l)}case Ee.ActionTypes.TRANSCRIPT_ITEM_GUEST_REACTION:{const i=n.messages.map(l=>l._id===r.payload.actionId?Object.assign({},l,{reaction:r.payload.reaction}):l);return Object.assign({},n,{messages:i})}case jh:{const i={enabled:!0,rating:r.payload.rating};return Object.assign({},n,{conversationRating:i})}case Ee.ActionTypes.CONVERSATION_RATING_FROM_GUEST:{const i={...n.conversationRating,rating:r.payload};return Object.assign({},n,{conversationRating:i})}case Uh:return{...n,sourceInfos:{type:"loading",chunkId:r.payload.chunkId}};case yb:return{...n,sourceInfos:{type:"loading-error"}};case gb:return{...n,sourceInfos:{type:"loaded",chunkId:r.payload.chunkId,knowledgeBaseType:r.payload.knowledgeBaseType,title:r.payload.title,content:r.payload.content,url:r.payload.url}};case Hh:return{...n,sourceInfos:void 0};default:return n}},y_=(n,r)=>{const i=n.messages[n.messages.length-1],l=(i==null?void 0:i.text)===r.text;return i&&i.sender.type===r.sender.type&&l?n:Object.assign({},n,{messages:n.messages.concat([r]),quickReplies:[]})},Pr=n=>{var r;F6()?(r=window.top)==null||r.postMessage(n,"*"):n.type==="webclient.change.url"&&window.open(n.url)},F6=()=>typeof window<"u"&&window.self!==window.top,__={messages:[],quickReplies:[],isBotTyping:!1,conversationRating:{enabled:!1}},_v=Gh({name:"intl",initialState:yv,reducers:{updateIntl:(n,r)=>{n.locale=r.payload.language,n.messages=r.payload.messages}}}),{updateIntl:V6}=_v.actions,P6=_v.reducer,Y6={enableStartScreen:!1,enableStandaloneView:!1,enableTranscriptExportEmail:!1,enableTranscriptExportPdf:!1,enableGeneralConditions:!1,enableSpeechSupport:!1,commands:[]},bv=Gh({name:"settings",initialState:Y6,reducers:{setSettings(n,r){n.enableStartScreen=r.payload.enableStartScreen,n.enableStandaloneView=r.payload.enableStandaloneView,n.enableTranscriptExportEmail=r.payload.enableTranscriptExportEmail,n.enableTranscriptExportPdf=r.payload.enableTranscriptExportPdf,n.enableGeneralConditions=r.payload.enableGeneralConditions,n.enableSpeechSupport=r.payload.enableSpeechSupport,n.commands=r.payload.commands}}}),{setSettings:Z6}=bv.actions,X6=bv.reducer,Q6=xb({settings:X6,chat:I6,startScreen:BA,connection:G6,intl:P6}),K6="bubble-chat",vv="state-last-saved-at",Ev="state",$6=n=>{try{if(!e4())return;const r=b_(n,vv);if(W6(r))return;{const i=b_(n,Ev);return i===null?void 0:JSON.parse(i)}}catch(r){console.error(r);return}},J6=(n,r)=>{try{const i=JSON.stringify(r);v_(n,Ev,i);const l=new Date().toISOString();v_(n,vv,l)}catch(i){console.error(i)}},W6=n=>{if(n===null)return!1;const r=new Date(n);return r.setHours(r.getHours()+12),new Date>r},e4=()=>typeof localStorage<"u",b_=(n,r)=>{const i=Sv(n,r);return localStorage.getItem(i)},v_=(n,r,i)=>{const l=Sv(n,r);return localStorage.setItem(l,i)},Sv=(n,r)=>`${K6}-${n}-${r}`,Tn=Object.create(null);Tn.open="0";Tn.close="1";Tn.ping="2";Tn.pong="3";Tn.message="4";Tn.upgrade="5";Tn.noop="6";const to=Object.create(null);Object.keys(Tn).forEach(n=>{to[Tn[n]]=n});const mh={type:"error",data:"parser error"},Tv=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",xv=typeof ArrayBuffer=="function",Av=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,Jh=({type:n,data:r},i,l)=>Tv&&r instanceof Blob?i?l(r):E_(r,l):xv&&(r instanceof ArrayBuffer||Av(r))?i?l(r):E_(new Blob([r]),l):l(Tn[n]+(r||"")),E_=(n,r)=>{const i=new FileReader;return i.onload=function(){const l=i.result.split(",")[1];r("b"+(l||""))},i.readAsDataURL(n)};function S_(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let qf;function t4(n,r){if(Tv&&n.data instanceof Blob)return n.data.arrayBuffer().then(S_).then(r);if(xv&&(n.data instanceof ArrayBuffer||Av(n.data)))return r(S_(n.data));Jh(n,!1,i=>{qf||(qf=new TextEncoder),r(qf.encode(i))})}const T_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",es=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<T_.length;n++)es[T_.charCodeAt(n)]=n;const n4=n=>{let r=n.length*.75,i=n.length,l,u=0,f,h,d,m;n[n.length-1]==="="&&(r--,n[n.length-2]==="="&&r--);const g=new ArrayBuffer(r),_=new Uint8Array(g);for(l=0;l<i;l+=4)f=es[n.charCodeAt(l)],h=es[n.charCodeAt(l+1)],d=es[n.charCodeAt(l+2)],m=es[n.charCodeAt(l+3)],_[u++]=f<<2|h>>4,_[u++]=(h&15)<<4|d>>2,_[u++]=(d&3)<<6|m&63;return g},r4=typeof ArrayBuffer=="function",Wh=(n,r)=>{if(typeof n!="string")return{type:"message",data:Ov(n,r)};const i=n.charAt(0);return i==="b"?{type:"message",data:a4(n.substring(1),r)}:to[i]?n.length>1?{type:to[i],data:n.substring(1)}:{type:to[i]}:mh},a4=(n,r)=>{if(r4){const i=n4(n);return Ov(i,r)}else return{base64:!0,data:n}},Ov=(n,r)=>{switch(r){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},Rv="",i4=(n,r)=>{const i=n.length,l=new Array(i);let u=0;n.forEach((f,h)=>{Jh(f,!1,d=>{l[h]=d,++u===i&&r(l.join(Rv))})})},s4=(n,r)=>{const i=n.split(Rv),l=[];for(let u=0;u<i.length;u++){const f=Wh(i[u],r);if(l.push(f),f.type==="error")break}return l};function l4(){return new TransformStream({transform(n,r){t4(n,i=>{const l=i.length;let u;if(l<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,l);else if(l<65536){u=new Uint8Array(3);const f=new DataView(u.buffer);f.setUint8(0,126),f.setUint16(1,l)}else{u=new Uint8Array(9);const f=new DataView(u.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(l))}n.data&&typeof n.data!="string"&&(u[0]|=128),r.enqueue(u),r.enqueue(i)})}})}let If;function $l(n){return n.reduce((r,i)=>r+i.length,0)}function Jl(n,r){if(n[0].length===r)return n.shift();const i=new Uint8Array(r);let l=0;for(let u=0;u<r;u++)i[u]=n[0][l++],l===n[0].length&&(n.shift(),l=0);return n.length&&l<n[0].length&&(n[0]=n[0].slice(l)),i}function o4(n,r){If||(If=new TextDecoder);const i=[];let l=0,u=-1,f=!1;return new TransformStream({transform(h,d){for(i.push(h);;){if(l===0){if($l(i)<1)break;const m=Jl(i,1);f=(m[0]&128)===128,u=m[0]&127,u<126?l=3:u===126?l=1:l=2}else if(l===1){if($l(i)<2)break;const m=Jl(i,2);u=new DataView(m.buffer,m.byteOffset,m.length).getUint16(0),l=3}else if(l===2){if($l(i)<8)break;const m=Jl(i,8),g=new DataView(m.buffer,m.byteOffset,m.length),_=g.getUint32(0);if(_>Math.pow(2,21)-1){d.enqueue(mh);break}u=_*Math.pow(2,32)+g.getUint32(4),l=3}else{if($l(i)<u)break;const m=Jl(i,u);d.enqueue(Wh(f?m:If.decode(m),r)),l=0}if(u===0||u>n){d.enqueue(mh);break}}}})}const wv=4;function Je(n){if(n)return u4(n)}function u4(n){for(var r in Je.prototype)n[r]=Je.prototype[r];return n}Je.prototype.on=Je.prototype.addEventListener=function(n,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(r),this};Je.prototype.once=function(n,r){function i(){this.off(n,i),r.apply(this,arguments)}return i.fn=r,this.on(n,i),this};Je.prototype.off=Je.prototype.removeListener=Je.prototype.removeAllListeners=Je.prototype.removeEventListener=function(n,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+n];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var l,u=0;u<i.length;u++)if(l=i[u],l===r||l.fn===r){i.splice(u,1);break}return i.length===0&&delete this._callbacks["$"+n],this};Je.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),i=this._callbacks["$"+n],l=1;l<arguments.length;l++)r[l-1]=arguments[l];if(i){i=i.slice(0);for(var l=0,u=i.length;l<u;++l)i[l].apply(this,r)}return this};Je.prototype.emitReserved=Je.prototype.emit;Je.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};Je.prototype.hasListeners=function(n){return!!this.listeners(n).length};const Oo=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")(),c4="arraybuffer";function Cv(n,...r){return r.reduce((i,l)=>(n.hasOwnProperty(l)&&(i[l]=n[l]),i),{})}const f4=Jt.setTimeout,h4=Jt.clearTimeout;function Ro(n,r){r.useNativeTimers?(n.setTimeoutFn=f4.bind(Jt),n.clearTimeoutFn=h4.bind(Jt)):(n.setTimeoutFn=Jt.setTimeout.bind(Jt),n.clearTimeoutFn=Jt.clearTimeout.bind(Jt))}const d4=1.33;function m4(n){return typeof n=="string"?p4(n):Math.ceil((n.byteLength||n.size)*d4)}function p4(n){let r=0,i=0;for(let l=0,u=n.length;l<u;l++)r=n.charCodeAt(l),r<128?i+=1:r<2048?i+=2:r<55296||r>=57344?i+=3:(l++,i+=4);return i}function Nv(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function g4(n){let r="";for(let i in n)n.hasOwnProperty(i)&&(r.length&&(r+="&"),r+=encodeURIComponent(i)+"="+encodeURIComponent(n[i]));return r}function y4(n){let r={},i=n.split("&");for(let l=0,u=i.length;l<u;l++){let f=i[l].split("=");r[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return r}class _4 extends Error{constructor(r,i,l){super(r),this.description=i,this.context=l,this.type="TransportError"}}class ed extends Je{constructor(r){super(),this.writable=!1,Ro(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,i,l){return super.emitReserved("error",new _4(r,i,l)),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=Wh(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=g4(r);return i.length?"?"+i:""}}class b4 extends ed{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 l=0;this._polling&&(l++,this.once("pollComplete",function(){--l||i()})),this.writable||(l++,this.once("drain",function(){--l||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const i=l=>{if(this.readyState==="opening"&&l.type==="open"&&this.onOpen(),l.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(l)};s4(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,i4(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]=Nv()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(r,i)}}let Dv=!1;try{Dv=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const v4=Dv;function E4(){}class S4 extends b4{constructor(r){if(super(r),typeof location<"u"){const i=location.protocol==="https:";let l=location.port;l||(l=i?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||l!==r.port}}doWrite(r,i){const l=this.request({method:"POST",data:r});l.on("success",i),l.on("error",(u,f)=>{this.onError("xhr post error",u,f)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(i,l)=>{this.onError("xhr poll error",i,l)}),this.pollXhr=r}}class vn extends Je{constructor(r,i,l){super(),this.createRequest=r,Ro(this,l),this._opts=l,this._method=l.method||"GET",this._uri=i,this._data=l.data!==void 0?l.data:null,this._create()}_create(){var r;const i=Cv(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const l=this._xhr=this.createRequest(i);try{l.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){l.setDisableHeaderCheck&&l.setDisableHeaderCheck(!0);for(let u in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(u)&&l.setRequestHeader(u,this._opts.extraHeaders[u])}}catch{}if(this._method==="POST")try{l.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{l.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(l),"withCredentials"in l&&(l.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(l.timeout=this._opts.requestTimeout),l.onreadystatechange=()=>{var u;l.readyState===3&&((u=this._opts.cookieJar)===null||u===void 0||u.parseCookies(l.getResponseHeader("set-cookie"))),l.readyState===4&&(l.status===200||l.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof l.status=="number"?l.status:0)},0))},l.send(this._data)}catch(u){this.setTimeoutFn(()=>{this._onError(u)},0);return}typeof document<"u"&&(this._index=vn.requestsCount++,vn.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=E4,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete vn.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()}}vn.requestsCount=0;vn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",x_);else if(typeof addEventListener=="function"){const n="onpagehide"in Jt?"pagehide":"unload";addEventListener(n,x_,!1)}}function x_(){for(let n in vn.requests)vn.requests.hasOwnProperty(n)&&vn.requests[n].abort()}const T4=function(){const n=Mv({xdomain:!1});return n&&n.responseType!==null}();class x4 extends S4{constructor(r){super(r);const i=r&&r.forceBase64;this.supportsBinary=T4&&!i}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new vn(Mv,this.uri(),r)}}function Mv(n){const r=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||v4))return new XMLHttpRequest}catch{}if(!r)try{return new Jt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Bv=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class A4 extends ed{get name(){return"websocket"}doOpen(){const r=this.uri(),i=this.opts.protocols,l=Bv?{}:Cv(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(l.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(r,i,l)}catch(u){return this.emitReserved("error",u)}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 l=r[i],u=i===r.length-1;Jh(l,this.supportsBinary,f=>{try{this.doWrite(l,f)}catch{}u&&Oo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},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]=Nv()),this.supportsBinary||(i.b64=1),this.createUri(r,i)}}const Ff=Jt.WebSocket||Jt.MozWebSocket;class O4 extends A4{createSocket(r,i,l){return Bv?new Ff(r,i,l):i?new Ff(r,i):new Ff(r)}doWrite(r,i){this.ws.send(i)}}class R4 extends ed{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=o4(Number.MAX_SAFE_INTEGER,this.socket.binaryType),l=r.readable.pipeThrough(i).getReader(),u=l4();u.readable.pipeTo(r.writable),this._writer=u.writable.getWriter();const f=()=>{l.read().then(({done:d,value:m})=>{d||(this.onPacket(m),f())}).catch(d=>{})};f();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const l=r[i],u=i===r.length-1;this._writer.write(l).then(()=>{u&&Oo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const w4={websocket:O4,webtransport:R4,polling:x4},C4=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,N4=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ph(n){if(n.length>8e3)throw"URI too long";const r=n,i=n.indexOf("["),l=n.indexOf("]");i!=-1&&l!=-1&&(n=n.substring(0,i)+n.substring(i,l).replace(/:/g,";")+n.substring(l,n.length));let u=C4.exec(n||""),f={},h=14;for(;h--;)f[N4[h]]=u[h]||"";return i!=-1&&l!=-1&&(f.source=r,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=D4(f,f.path),f.queryKey=M4(f,f.query),f}function D4(n,r){const i=/\/{2,9}/g,l=r.replace(i,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&l.splice(0,1),r.slice(-1)=="/"&&l.splice(l.length-1,1),l}function M4(n,r){const i={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(l,u,f){u&&(i[u]=f)}),i}const gh=typeof addEventListener=="function"&&typeof removeEventListener=="function",no=[];gh&&addEventListener("offline",()=>{no.forEach(n=>n())},!1);class vr extends Je{constructor(r,i){if(super(),this.binaryType=c4,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 l=ph(r);i.hostname=l.host,i.secure=l.protocol==="https"||l.protocol==="wss",i.port=l.port,l.query&&(i.query=l.query)}else i.host&&(i.hostname=ph(i.host).host);Ro(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(l=>{const u=l.prototype.name;this.transports.push(u),this._transportsByName[u]=l}),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=y4(this.opts.query)),gh&&(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"})},no.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const i=Object.assign({},this.opts.query);i.EIO=wv,i.transport=r,this.id&&(i.sid=this.id);const l=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](l)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&vr.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",vr.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 l=0;l<this.writeBuffer.length;l++){const u=this.writeBuffer[l].data;if(u&&(i+=m4(u)),l>0&&i>this._maxPayload)return this.writeBuffer.slice(0,l);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,Oo(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,i,l){return this._sendPacket("message",r,i,l),this}send(r,i,l){return this._sendPacket("message",r,i,l),this}_sendPacket(r,i,l,u){if(typeof i=="function"&&(u=i,i=void 0),typeof l=="function"&&(u=l,l=null),this.readyState==="closing"||this.readyState==="closed")return;l=l||{},l.compress=l.compress!==!1;const f={type:r,data:i,options:l};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),u&&this.once("flush",u),this.flush()}close(){const r=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),r()},l=()=>{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?l():r()}):this.upgrading?l():r()),this}_onError(r){if(vr.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(),gh&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const l=no.indexOf(this._offlineEventListener);l!==-1&&no.splice(l,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,i),this.writeBuffer=[],this._prevBufferLen=0}}}vr.protocol=wv;class B4 extends vr{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),l=!1;vr.priorWebsocketSuccess=!1;const u=()=>{l||(i.send([{type:"ping",data:"probe"}]),i.once("packet",S=>{if(!l)if(S.type==="pong"&&S.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;vr.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{l||this.readyState!=="closed"&&(_(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const y=new Error("probe error");y.transport=i.name,this.emitReserved("upgradeError",y)}}))};function f(){l||(l=!0,_(),i.close(),i=null)}const h=S=>{const y=new Error("probe error: "+S);y.transport=i.name,f(),this.emitReserved("upgradeError",y)};function d(){h("transport closed")}function m(){h("socket closed")}function g(S){i&&S.name!==i.name&&f()}const _=()=>{i.removeListener("open",u),i.removeListener("error",h),i.removeListener("close",d),this.off("close",m),this.off("upgrading",g)};i.once("open",u),i.once("error",h),i.once("close",d),this.once("close",m),this.once("upgrading",g),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{l||i.open()},200):i.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const i=[];for(let l=0;l<r.length;l++)~this.transports.indexOf(r[l])&&i.push(r[l]);return i}}let j4=class extends B4{constructor(r,i={}){const l=typeof r=="object"?r:i;(!l.transports||l.transports&&typeof l.transports[0]=="string")&&(l.transports=(l.transports||["polling","websocket","webtransport"]).map(u=>w4[u]).filter(u=>!!u)),super(r,l)}};function U4(n,r="",i){let l=n;i=i||typeof location<"u"&&location,n==null&&(n=i.protocol+"//"+i.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=i.protocol+n:n=i.host+n),/^(https?|wss?):\/\//.test(n)||(typeof i<"u"?n=i.protocol+"//"+n:n="https://"+n),l=ph(n)),l.port||(/^(http|ws)$/.test(l.protocol)?l.port="80":/^(http|ws)s$/.test(l.protocol)&&(l.port="443")),l.path=l.path||"/";const f=l.host.indexOf(":")!==-1?"["+l.host+"]":l.host;return l.id=l.protocol+"://"+f+":"+l.port+r,l.href=l.protocol+"://"+f+(i&&i.port===l.port?"":":"+l.port),l}const H4=typeof ArrayBuffer=="function",L4=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,jv=Object.prototype.toString,z4=typeof Blob=="function"||typeof Blob<"u"&&jv.call(Blob)==="[object BlobConstructor]",k4=typeof File=="function"||typeof File<"u"&&jv.call(File)==="[object FileConstructor]";function td(n){return H4&&(n instanceof ArrayBuffer||L4(n))||z4&&n instanceof Blob||k4&&n instanceof File}function ro(n,r){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let i=0,l=n.length;i<l;i++)if(ro(n[i]))return!0;return!1}if(td(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return ro(n.toJSON(),!0);for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&ro(n[i]))return!0;return!1}function G4(n){const r=[],i=n.data,l=n;return l.data=yh(i,r),l.attachments=r.length,{packet:l,buffers:r}}function yh(n,r){if(!n)return n;if(td(n)){const i={_placeholder:!0,num:r.length};return r.push(n),i}else if(Array.isArray(n)){const i=new Array(n.length);for(let l=0;l<n.length;l++)i[l]=yh(n[l],r);return i}else if(typeof n=="object"&&!(n instanceof Date)){const i={};for(const l in n)Object.prototype.hasOwnProperty.call(n,l)&&(i[l]=yh(n[l],r));return i}return n}function q4(n,r){return n.data=_h(n.data,r),delete n.attachments,n}function _h(n,r){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<r.length)return r[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let i=0;i<n.length;i++)n[i]=_h(n[i],r);else if(typeof n=="object")for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=_h(n[i],r));return n}const I4=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],F4=5;var Ae;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(Ae||(Ae={}));class V4{constructor(r){this.replacer=r}encode(r){return(r.type===Ae.EVENT||r.type===Ae.ACK)&&ro(r)?this.encodeAsBinary({type:r.type===Ae.EVENT?Ae.BINARY_EVENT:Ae.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let i=""+r.type;return(r.type===Ae.BINARY_EVENT||r.type===Ae.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=G4(r),l=this.encodeAsString(i.packet),u=i.buffers;return u.unshift(l),u}}function A_(n){return Object.prototype.toString.call(n)==="[object Object]"}class nd extends Je{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 l=i.type===Ae.BINARY_EVENT;l||i.type===Ae.BINARY_ACK?(i.type=l?Ae.EVENT:Ae.ACK,this.reconstructor=new P4(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(td(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 l={type:Number(r.charAt(0))};if(Ae[l.type]===void 0)throw new Error("unknown packet type "+l.type);if(l.type===Ae.BINARY_EVENT||l.type===Ae.BINARY_ACK){const f=i+1;for(;r.charAt(++i)!=="-"&&i!=r.length;);const h=r.substring(f,i);if(h!=Number(h)||r.charAt(i)!=="-")throw new Error("Illegal attachments");l.attachments=Number(h)}if(r.charAt(i+1)==="/"){const f=i+1;for(;++i&&!(r.charAt(i)===","||i===r.length););l.nsp=r.substring(f,i)}else l.nsp="/";const u=r.charAt(i+1);if(u!==""&&Number(u)==u){const f=i+1;for(;++i;){const h=r.charAt(i);if(h==null||Number(h)!=h){--i;break}if(i===r.length)break}l.id=Number(r.substring(f,i+1))}if(r.charAt(++i)){const f=this.tryParse(r.substr(i));if(nd.isPayloadValid(l.type,f))l.data=f;else throw new Error("invalid payload")}return l}tryParse(r){try{return JSON.parse(r,this.reviver)}catch{return!1}}static isPayloadValid(r,i){switch(r){case Ae.CONNECT:return A_(i);case Ae.DISCONNECT:return i===void 0;case Ae.CONNECT_ERROR:return typeof i=="string"||A_(i);case Ae.EVENT:case Ae.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&I4.indexOf(i[0])===-1);case Ae.ACK:case Ae.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class P4{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=q4(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Y4=Object.freeze(Object.defineProperty({__proto__:null,Decoder:nd,Encoder:V4,get PacketType(){return Ae},protocol:F4},Symbol.toStringTag,{value:"Module"}));function on(n,r,i){return n.on(r,i),function(){n.off(r,i)}}const Z4=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Uv extends Je{constructor(r,i,l){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,l&&l.auth&&(this.auth=l.auth),this._opts=Object.assign({},l),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const r=this.io;this.subs=[on(r,"open",this.onopen.bind(this)),on(r,"packet",this.onpacket.bind(this)),on(r,"error",this.onerror.bind(this)),on(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 l,u,f;if(Z4.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 h={type:Ae.EVENT,data:i};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const _=this.ids++,S=i.pop();this._registerAckCallback(_,S),h.id=_}const d=(u=(l=this.io.engine)===null||l===void 0?void 0:l.transport)===null||u===void 0?void 0:u.writable,m=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!d||(m?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(r,i){var l;const u=(l=this.flags.timeout)!==null&&l!==void 0?l:this._opts.ackTimeout;if(u===void 0){this.acks[r]=i;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let d=0;d<this.sendBuffer.length;d++)this.sendBuffer[d].id===r&&this.sendBuffer.splice(d,1);i.call(this,new Error("operation has timed out"))},u),h=(...d)=>{this.io.clearTimeoutFn(f),i.apply(this,d)};h.withError=!0,this.acks[r]=h}emitWithAck(r,...i){return new Promise((l,u)=>{const f=(h,d)=>h?u(h):l(d);f.withError=!0,i.push(f),this.emit(r,...i)})}_addToQueue(r){let i;typeof r[r.length-1]=="function"&&(i=r.pop());const l={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((u,...f)=>l!==this._queue[0]?void 0:(u!==null?l.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(u)):(this._queue.shift(),i&&i(null,...f)),l.pending=!1,this._drainQueue())),this._queue.push(l),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:Ae.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(l=>String(l.id)===r)){const l=this.acks[r];delete this.acks[r],l.withError&&l.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case Ae.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 Ae.EVENT:case Ae.BINARY_EVENT:this.onevent(r);break;case Ae.ACK:case Ae.BINARY_ACK:this.onack(r);break;case Ae.DISCONNECT:this.ondisconnect();break;case Ae.CONNECT_ERROR:this.destroy();const l=new Error(r.data.message);l.data=r.data.data,this.emitReserved("connect_error",l);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 l of i)l.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 l=!1;return function(...u){l||(l=!0,i.packet({type:Ae.ACK,id:r,data:u}))}}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:Ae.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 l=0;l<i.length;l++)if(r===i[l])return i.splice(l,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 l=0;l<i.length;l++)if(r===i[l])return i.splice(l,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 l of i)l.apply(this,r.data)}}}function Va(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}Va.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),i=Math.floor(r*this.jitter*n);n=(Math.floor(r*10)&1)==0?n-i:n+i}return Math.min(n,this.max)|0};Va.prototype.reset=function(){this.attempts=0};Va.prototype.setMin=function(n){this.ms=n};Va.prototype.setMax=function(n){this.max=n};Va.prototype.setJitter=function(n){this.jitter=n};class bh extends Je{constructor(r,i){var l;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,Ro(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((l=i.randomizationFactor)!==null&&l!==void 0?l:.5),this.backoff=new Va({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=r;const u=i.parser||Y4;this.encoder=new u.Encoder,this.decoder=new u.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 j4(this.uri,this.opts);const i=this.engine,l=this;this._readyState="opening",this.skipReconnect=!1;const u=on(i,"open",function(){l.onopen(),r&&r()}),f=d=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",d),r?r(d):this.maybeReconnectOnOpen()},h=on(i,"error",f);if(this._timeout!==!1){const d=this._timeout,m=this.setTimeoutFn(()=>{u(),f(new Error("timeout")),i.close()},d);this.opts.autoUnref&&m.unref(),this.subs.push(()=>{this.clearTimeoutFn(m)})}return this.subs.push(u),this.subs.push(h),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(on(r,"ping",this.onping.bind(this)),on(r,"data",this.ondata.bind(this)),on(r,"error",this.onerror.bind(this)),on(r,"close",this.onclose.bind(this)),on(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){Oo(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,i){let l=this.nsps[r];return l?this._autoConnect&&!l.active&&l.connect():(l=new Uv(this,r,i),this.nsps[r]=l),l}_destroy(r){const i=Object.keys(this.nsps);for(const l of i)if(this.nsps[l].active)return;this._close()}_packet(r){const i=this.encoder.encode(r);for(let l=0;l<i.length;l++)this.engine.write(i[l],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 l;this.cleanup(),(l=this.engine)===null||l===void 0||l.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 l=this.setTimeoutFn(()=>{r.skipReconnect||(this.emitReserved("reconnect_attempt",r.backoff.attempts),!r.skipReconnect&&r.open(u=>{u?(r._reconnecting=!1,r.reconnect(),this.emitReserved("reconnect_error",u)):r.onreconnect()}))},i);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const $i={};function ao(n,r){typeof n=="object"&&(r=n,n=void 0),r=r||{};const i=U4(n,r.path||"/socket.io"),l=i.source,u=i.id,f=i.path,h=$i[u]&&f in $i[u].nsps,d=r.forceNew||r["force new connection"]||r.multiplex===!1||h;let m;return d?m=new bh(l,r):($i[u]||($i[u]=new bh(l,r)),m=$i[u]),i.query&&!r.query&&(r.query=i.queryKey),m.socket(i.path,r)}Object.assign(ao,{Manager:bh,Socket:Uv,io:ao,connect:ao});const X4=[Ee.ActionTypes.MESSAGE_TO_GUEST,Ee.ActionTypes.EVENT_TO_GUEST,Ee.ActionTypes.TYPING_ON,Ee.ActionTypes.TYPING_OFF,Ee.ActionTypes.RESTART_CHAT_REQUEST,...LA,...jx,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],Q4=({dispatch:n,getState:r})=>i=>{let l=null;return u=>{const f=i(u);if(u.type===qh){l!=null&&l.disconnect(),n(GA());const h=`/chat?${go.stringify(u.querystrings)}`;l=ao(`/${u.clientName}${h}`),l.on("action",n),l.on("connect",()=>n(qA())),l.on("disconnect",()=>n(IA())),l.on("reconnect",()=>n(FA())),l.on("set-translations",(d,m)=>{n(V6({language:d,messages:z6(d,m)}))}),l.on("set-settings",d=>{n(Z6(d))}),l.on("enable-conversation-rating",d=>n(kx(d))),l.on("speech-transcription",d=>n(Hx(d))),l.on("restore-client-state",d=>{n(kA(d.sessionId)),n(qx(d.messages))}),l.on("expand-window",({devices:d,initial:m=!1})=>{n({type:_b,devices:d,initial:m})}),l.on("restart-chat",()=>{n(To(u.clientName,u.querystrings))})}else if(u.type===Eo)l==null||l.emit("start-chat",u.payload);else if(u.type===So)l==null||l.emit("terminate-session",u.payload);else if(u.type===Bx)l==null||l.emit("get-started",JSON.stringify(u));else if(u.type===Mh)l==null||l.emit("audio-message",u.buffer);else if(u.type===Ee.ActionTypes.CONVERSATION_RATING_FROM_GUEST)l==null||l.emit("conversation-rating",u.payload);else if(u.type===vb){const{connection:{sessionId:h}}=r();window.location.href=`/transcript-pdf/${h}`}else X4.indexOf(u.type)===-1&&u.meta===void 0&&l&&l.emit("action",JSON.stringify(u));return f}},Hv=fv(),K4={...$6(Hv),intl:yv},vh=_A({middleware:n=>n().concat(Q4),reducer:Q6,preloadedState:K4});vh.subscribe(N6(()=>{const n=vh.getState();J6(Hv,{connection:n.connection,startScreen:n.startScreen})},1e3));const $4=document.getElementById("root"),J4=g2.createRoot($4);J4.render(b.jsx(dS,{store:vh,children:b.jsx(g6,{})}));
|
|
119
|
-
//# sourceMappingURL=index-
|
|
119
|
+
//# sourceMappingURL=index-vNHf_Dzk.js.map
|