@botfabrik/engine-webclient 4.117.1-alpha.0 → 4.117.2
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.
|
@@ -58,7 +58,7 @@ ${w.current.stack}
|
|
|
58
58
|
`}if(n.optimizeForStreaming){var s=o.lastIndexOf(`<`);s!==-1&&o.indexOf(`>`,s)===-1&&(o=o.slice(0,s)),s=e.lastIndexOf(`<`),s!==-1&&e.indexOf(`>`,s)===-1&&(e=e.slice(0,s))}return bc(fc(t?e:o,{inline:t,refs:a},i),{...i,forceInline:t})}let a={};return i(e)}var Sc=({children:e,options:t,...n})=>{if(!(typeof x.useContext<`u`)){let r={...t,overrides:{...t?.overrides},wrapperProps:{...t?.wrapperProps,...n}};return xc(e??``,r)}let r=x.useContext(gc),i=x.useMemo(()=>({...r,...t,overrides:{...r?.overrides,...t?.overrides},wrapperProps:{...r?.wrapperProps,...t?.wrapperProps,...n}}),[r,t,n]),a=e??``;return x.useMemo(()=>xc(a,i),[a,i])},Cc={generalConditionsContainer:`_generalConditionsContainer_55hjg_1`,generalConditions:`_generalConditions_55hjg_1`,generalConditionsHeader:`_generalConditionsHeader_55hjg_15`,generalConditionsBody:`_generalConditionsBody_55hjg_26`,generalConditionsAccept:`_generalConditionsAccept_55hjg_35`},wc=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Z=o(((e,t)=>{t.exports=wc()}))(),Tc=()=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1rem`,height:`1rem`,fill:`currentColor`,viewBox:`0 0 256 256`,children:(0,Z.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`})}),Ec=()=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1rem`,height:`1rem`,fill:`currentColor`,viewBox:`0 0 256 256`,children:(0,Z.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`})}),Dc=`general-conditions.header`,Oc=`general-conditions.body`,kc=`general-conditions.accept-conditions-note`,Ac=()=>{let e=$i(),[t,n]=(0,x.useState)(!1),r=()=>n(!t),i=e=>{e.key===`ArrowDown`||e.key===`ArrowRight`?n(!0):e.key===`ArrowUp`||e.key===`ArrowLeft`||e.key===`Escape`?n(!1):(e.key===`Enter`||e.key===`Space`||e.key===` `)&&r()},a=e(Dc),o=e(kc);return(0,Z.jsxs)(`div`,{className:z(Cc.generalConditionsContainer,`chat__generalConditions`),children:[!!a?.length&&(0,Z.jsxs)(`div`,{className:Cc.generalConditions,children:[(0,Z.jsxs)(`div`,{role:`button`,onClick:r,onKeyDown:i,tabIndex:0,className:z(Cc.generalConditionsHeader,`chat__generalConditions__header`),"aria-controls":`general-conditions-body`,"aria-expanded":t?`true`:`false`,"aria-pressed":t?`true`:`false`,children:[(0,Z.jsx)(Sc,{children:a}),t?(0,Z.jsx)(Ec,{}):(0,Z.jsx)(Tc,{})]}),(0,Z.jsx)(`div`,{className:z(Cc.generalConditionsBody,`chat__generalConditions__body`),id:`general-conditions-body`,role:`region`,tabIndex:-1,children:t&&(0,Z.jsx)(Sc,{children:e(Oc)||``})})]}),!!o?.length&&(0,Z.jsx)(`div`,{className:z(Cc.generalConditionsAccept,`chat__generalConditions__accept`),tabIndex:0,children:(0,Z.jsx)(Sc,{children:e(kc)||``})})]})},Q={messageContainer:`_messageContainer_1rxi5_1`,message:`_message_1rxi5_1`,messageBot:`_messageBot_1rxi5_14`,messageBotLast:`_messageBotLast_1rxi5_45`,avatar:`_avatar_1rxi5_45`,messageBotFirst:`_messageBotFirst_1rxi5_54`,messageBotAnimated:`_messageBotAnimated_1rxi5_67`,fadeInLeft:`_fadeInLeft_1rxi5_1`,messageGuest:`_messageGuest_1rxi5_78`,messageGuestFirst:`_messageGuestFirst_1rxi5_84`,messageGuestLast:`_messageGuestLast_1rxi5_90`,botAvatar:`_botAvatar_1rxi5_104`,agentAvatar:`_agentAvatar_1rxi5_108`,bubble:`_bubble_1rxi5_112`,bubbleContent:`_bubbleContent_1rxi5_118`,bubbleLeft:`_bubbleLeft_1rxi5_132`,leftText:`_leftText_1rxi5_143`,bubbleRight:`_bubbleRight_1rxi5_150`,rightText:`_rightText_1rxi5_160`,sourceInfoReference:`_sourceInfoReference_1rxi5_192`,sourceInfoReferenceActive:`_sourceInfoReferenceActive_1rxi5_204`},jc=(e,t)=>{(0,x.useEffect)(()=>{let n=n=>{e.current&&!e.current.contains(n.target)&&t()};return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e,t])};function Mc(e,t){let n=null,r=null,i=(...i)=>{r=i,n&&clearTimeout(n),n=setTimeout(()=>{e(...r),n=null,r=null},t)};return i.flush=()=>{n&&r&&(clearTimeout(n),e(...r),n=null,r=null)},i}function Nc(e,t){let n=0,r=null;return((...i)=>{let a=Date.now(),o=a-n;o>=t?(n=a,e(...i)):(r&&clearTimeout(r),r=setTimeout(()=>{n=Date.now(),e(...i)},t-o))})}var Pc={container:`_container_131ib_1`,categoryContainer:`_categoryContainer_131ib_13`,categoryButton:`_categoryButton_131ib_20`,active:`_active_131ib_35`,commentTextarea:`_commentTextarea_131ib_44`},Fc=(e,t,n)=>{(0,x.useEffect)(()=>{if(e){let e=()=>{let e=[`button:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`,`a[href]`,`input:not([disabled])`,`select:not([disabled])`].join(`,`),r=t.current?Array.from(t.current.querySelectorAll(e)):[],i=n.current?Array.from(n.current.querySelectorAll(e)):[];return[...r,...i]},r=t=>{if(t.key===`Tab`){let n=e();if(n.length>0){let e=n[0],r=n[n.length-1],i=document.activeElement;!t.shiftKey&&i===r?(t.preventDefault(),e.focus()):t.shiftKey&&i===e&&(t.preventDefault(),r.focus())}}};return document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`keydown`,r,!0)}}},[e,t,n])},Ic=({open:e,actionsRef:t,reaction:n,onReaction:r})=>{let i=$i(),a=(0,x.useRef)(null),o=Mc(e=>{r({...n,comment:e})},300);(0,x.useEffect)(()=>()=>o.flush(),[o]),Fc(e,t,a);let s=e=>{r({...n,category:n.category===e?void 0:e})};return e?(0,Z.jsxs)(`div`,{ref:a,className:Pc.container,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`bad-reaction-title`,children:[(0,Z.jsx)(`h2`,{id:`bad-reaction-title`,children:i(`bot-bubble.reaction.say-more`)}),(0,Z.jsx)(`div`,{className:Pc.categoryContainer,role:`radiogroup`,children:[`WRONG_INFORMATION`,`MISSING_INFORMATION`,`OLD_INFORMATION`,`UNCLEAR`,`OFF_TOPIC`].map(e=>(0,Z.jsx)(`button`,{className:z(Pc.categoryButton,n?.category===e&&Pc.active),onClick:()=>s(e),"aria-pressed":n?.category===e,"aria-label":i(`bot-bubble.reaction.category.${e}`),tabIndex:0,role:`radio`,children:i(`bot-bubble.reaction.category.${e}`)},e))}),(0,Z.jsx)(`textarea`,{id:`comment`,name:`comment`,placeholder:i(`bot-bubble.reaction.comment`),defaultValue:n?.comment,onChange:e=>o(e.target.value),className:Pc.commentTextarea,rows:3,"aria-label":i(`bot-bubble.reaction.comment`)})]}):null},Lc={botMessageActionContainer:`_botMessageActionContainer_g6hpe_1`,alwaysVisible:`_alwaysVisible_g6hpe_15`,active:`_active_g6hpe_19`,botMessageActionInnerContainer:`_botMessageActionInnerContainer_g6hpe_27`,header:`_header_g6hpe_52`,botMessageActions:`_botMessageActions_g6hpe_57`,reported:`_reported_g6hpe_68`,action:`_action_g6hpe_72`,anyReport:`_anyReport_g6hpe_120`,closeButton:`_closeButton_g6hpe_136`},Rc=({isSubmitting:e,onClick:t})=>{let n=$i();return(0,Z.jsx)(`button`,{className:z(Lc.action,Lc.closeButton,`tooltip--bottom-left`),"aria-label":n(`bot-bubble.reaction.close`),"data-title":n(`bot-bubble.reaction.close`),tabIndex:0,onClick:t,children:(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,children:e?(0,Z.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`}):(0,Z.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`})})})},zc=({alwaysVisible:e,senderType:t,reaction:n,botMessageRef:r,message:i,onReaction:a})=>{let o=$i(),[s,c]=(0,x.useState)(!1),[l,u]=(0,x.useState)(!1),[d,f]=(0,x.useState)(!1),p=(0,x.useRef)(null),m=(0,x.useRef)(null);jc(p,()=>{f(!1)});let h=e=>{e.key===`Escape`&&f(!1)};(0,x.useEffect)(()=>(document.addEventListener(`keydown`,h),()=>{document.removeEventListener(`keydown`,h)}),[]),(0,x.useEffect)(()=>{d&&p.current?.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`nearest`})},[d]);let g=e=>{m.current&&clearTimeout(m.current),u(!0),a(e),m.current=setTimeout(()=>{u(!1)},1e3)},_=(0,x.useCallback)(async()=>{if(r.current)try{c(!0);let e=r.current.innerHTML,t=r.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:`text/html`}),"text/plain":new Blob([t],{type:`text/plain`})})]),await new Promise(e=>setTimeout(e,1500))}finally{c(!1)}},[r]),v=()=>{f(!1),a(n?.type===`GOOD`?null:{type:`GOOD`})},y=()=>{a({...i.reaction,type:`BAD`}),f(!d)},b=e=>t=>{(t.key===`Enter`||t.key===` `)&&e()};return(0,Z.jsx)(`div`,{ref:p,className:z(Lc.botMessageActionContainer,e&&Lc.alwaysVisible,d&&Lc.active),"aria-hidden":`true`,children:(0,Z.jsxs)(`div`,{className:z(Lc.botMessageActionInnerContainer,e&&Lc.alwaysVisible,d&&Lc.active,n&&Lc.reported),role:`group`,"aria-label":o(`bot-bubble.actions.label`),children:[(0,Z.jsxs)(`div`,{className:Lc.header,children:[(0,Z.jsxs)(`div`,{className:z(Lc.botMessageActions,n&&Lc.reported),children:[t===ta.BOT&&(0,Z.jsx)(`button`,{className:z(Lc.action,n?.type&&Lc.anyReport,n?.type===`GOOD`&&Lc.reported,`tooltip--top-right`),tabIndex:0,"aria-label":o(n?.type===`GOOD`?`bot-bubble.reaction.remove`:`bot-bubble.reaction.good`),"aria-pressed":n?.type===`GOOD`,"data-title":o(n?.type===`GOOD`?`bot-bubble.reaction.remove`:`bot-bubble.reaction.good`),onPointerDown:v,onKeyDown:b(v),children:(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,children:n?.type===`GOOD`?(0,Z.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`}):(0,Z.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`})})}),t===ta.BOT&&(0,Z.jsx)(`button`,{className:z(Lc.action,n?.type&&Lc.anyReport,n?.type===`BAD`&&Lc.reported,`tooltip--top-right`),tabIndex:0,"aria-label":o(`bot-bubble.reaction.bad`),"aria-pressed":n?.type===`BAD`,"data-title":o(`bot-bubble.reaction.bad`),onPointerDown:y,onKeyDown:b(y),children:(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,children:n?.type===`BAD`?(0,Z.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`}):(0,Z.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`})})}),(0,Z.jsx)(`button`,{className:z(Lc.action,`tooltip--top-right`),style:{visibility:d?`hidden`:`visible`},tabIndex:0,"aria-label":o(`bot-bubble.copy`),"data-title":o(`bot-bubble.copy`),onClick:_,children:(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,children:s?(0,Z.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`}):(0,Z.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`})})})]}),d&&(0,Z.jsx)(Rc,{isSubmitting:l,onClick:()=>f(!1)})]}),i.reaction&&(0,Z.jsx)(Ic,{open:d,actionsRef:p,reaction:i.reaction,onReaction:g})]})})},Bc=(0,x.forwardRef)(({message:e,isAnimated:t,isLastMessage:n,isFirstMessageBySender:r,isLastMessageBySender:i,children:a,onReaction:o},s)=>{let c=$i(),l=(0,x.useRef)(null),u=e.sender.type===at.BOT;return(0,Z.jsxs)(`li`,{ref:s,className:z(Q.message,Q.messageBot,n&&Q.lastMessage,r&&Q.messageBotFirst,i&&Q.messageBotLast,`chat__bubbleContainer`,t&&Q.messageBotAnimated,t&&`chat__bubbleContainer--animated`,u?`chat__botBubbleContainer`:`chat__agentBubbleContainer`,r&&`chat__bubbleContainer--first`,i&&`chat__bubbleContainer--last`),role:`article`,children:[(0,Z.jsx)(`img`,{className:z(Q.avatar,u?Q.botAvatar:Q.agentAvatar,`chat__avatar`,u?`chat__botAvatar`:`chat__agentAvatar`),src:`${e.sender.avatar}`,alt:u?`Bot`:`Agent`,referrerPolicy:`no-referrer`,"aria-hidden":`true`}),(0,Z.jsxs)(`div`,{className:Q.messageContainer,children:[(0,Z.jsx)(`div`,{ref:l,className:z(Q.bubble,Q.bubbleLeft,`chat__bubble`,u?`chat__botBubble`:`chat__agentBubble`),tabIndex:0,role:`group`,"aria-label":c(u?`bot-bubble.label`:`agent-bubble.label`),children:(0,Z.jsx)(`div`,{className:z(Q.leftText),children:a})}),o&&(0,Z.jsx)(zc,{alwaysVisible:n&&i,senderType:e.sender.type,reaction:e.reaction,message:e,botMessageRef:l,onReaction:o})]})]})}),Vc={sourceList:`_sourceList_1sc0q_1`,source:`_source_1sc0q_1`,label:`_label_1sc0q_39`},Hc=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,...e,children:(0,Z.jsx)(`path`,{d:`M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z`})}),Uc=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,...e,children:(0,Z.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`})}),Wc=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,...e,children:(0,Z.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`})}),Gc=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,...e,children:(0,Z.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`})}),Kc=({type:e,...t})=>{switch(e){case`WEBSITE`:return(0,Z.jsx)(Hc,{...t});case`PDF`:return(0,Z.jsx)(Gc,{...t});case`DOCX`:return(0,Z.jsx)(Uc,{...t});default:return(0,Z.jsx)(Wc,{...t})}},qc=({sources:e,onLinkClick:t})=>{let n=$i(),r=e=>()=>{t(e.url)},i=e=>n=>{(n.key===`Enter`||n.key===` `)&&t(e.url)};return e.length?(0,Z.jsx)(`ul`,{className:Vc.sourceList,"aria-label":n(`bot-bubble.sources`),children:e.map(e=>(0,Z.jsx)(`li`,{className:Vc.source,children:(0,Z.jsxs)(`a`,{role:`button`,tabIndex:0,"aria-label":`${n(`bot-bubble.source.open`)}: ${e.label}`,onClick:r(e),onKeyDown:i(e),children:[(0,Z.jsx)(Kc,{type:e.type,"aria-hidden":`true`}),(0,Z.jsx)(`div`,{className:Vc.label,children:e.label})]})},e.url))}):null},Jc={button:`_button_3ui4g_1`,buttonDefault:`_buttonDefault_3ui4g_13`,buttonPrimary:`_buttonPrimary_3ui4g_28`},Yc=({className:e,children:t,...n})=>(0,Z.jsx)(`button`,{className:z(Jc.button,e),type:`button`,role:`button`,...n,children:t}),Xc={title:`_title_137pi_1`,buttons:`_buttons_137pi_6`,button:`_button_137pi_6`,imageContainer:`_imageContainer_137pi_29`,image:`_image_137pi_29`,video_container:`_video_container_137pi_44`,video:`_video_137pi_44`,only:`_only_137pi_58`},Zc=({buttons:e,onButtonClick:t})=>(0,Z.jsx)(`div`,{className:z(Xc.buttons,`chat__bubbleButtons`),children:e.map((e,n)=>(0,Z.jsx)(Yc,{className:z(Xc.button,`chat__bubbleButton`),onClick:()=>t(e),children:e.title},n))}),Qc=`newtab#`,$c=({markdown:e,markdownOptions:t={},onLinkClick:n})=>{let r=e=>t=>(t.preventDefault(),e&&n(e),!1),i=({title:e,href:t,children:n})=>t.indexOf(Qc)===0?(0,Z.jsx)(`a`,{href:t.slice(7),title:e,target:`_blank`,rel:`noopener noreferrer`,children:n}):(0,Z.jsx)(`a`,{onClick:r(t),title:e,href:t,children:n});return(0,Z.jsx)(Sc,{options:{...t,overrides:{a:i}},children:e})},el=({text:e,onLinkClick:t})=>e?(0,Z.jsx)(`div`,{children:(0,Z.jsx)($c,{markdown:e,onLinkClick:t})}):null,tl=({title:e})=>e?(0,Z.jsx)(`h1`,{className:Xc.title,children:e}):null,nl=({title:e,text:t,buttons:n,onButtonClick:r,onLinkClick:i})=>e?.length||t?.length||n?.length?(0,Z.jsxs)(`div`,{className:z(Q.bubbleContent),children:[(0,Z.jsx)(tl,{title:e}),(0,Z.jsx)(el,{text:t,onLinkClick:i}),(0,Z.jsx)(Zc,{buttons:n,onButtonClick:r})]}):null,rl=({alt:e,imageUrl:t,itemUrl:n,hasBody:r})=>t?n?n.indexOf(`youtube.com`)>-1?(0,Z.jsx)(`div`,{className:Xc.video_container,children:(0,Z.jsx)(`iframe`,{className:z(Xc.video,{[Xc.only]:!r}),title:`Youtube`,width:`100%`,src:n+`?rel=0`,frameBorder:`0`,allowFullScreen:!0})}):(0,Z.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,children:(0,Z.jsx)(`div`,{className:Xc.imageContainer,children:(0,Z.jsx)(`img`,{className:z(Xc.image,{[Xc.only]:!r}),src:t,alt:e})})}):(0,Z.jsx)(`div`,{className:Xc.imageContainer,children:(0,Z.jsx)(`img`,{className:z(Xc.image,{[Xc.only]:!r}),src:t,alt:e})}):null,il=({title:e,text:t,imageUrl:n,itemUrl:r,buttons:i,sources:a,onButtonClick:o,onLinkClick:s})=>{let c=!!e?.length||!!t?.length||!!i?.length;return(0,Z.jsxs)(`div`,{className:z(Xc.detailMessage),children:[(0,Z.jsx)(rl,{hasBody:c,imageUrl:n,itemUrl:r,alt:e||``}),c&&(0,Z.jsx)(nl,{title:e,text:t,buttons:i,onLinkClick:s,onButtonClick:o}),(0,Z.jsx)(qc,{sources:a,onLinkClick:s})]})},al=(0,x.forwardRef)(({isFirstMessageBySender:e,isLastMessageBySender:t,children:n},r)=>{let i=$i();return(0,Z.jsx)(`li`,{ref:r,className:z(Q.message,Q.messageGuest,e&&Q.messageGuestFirst,t&&Q.messageGuestLast,`chat__bubbleContainer`,`chat__guestBubbleContainer`,e&&`chat__bubbleContainer--first`,t&&`chat__bubbleContainer--last`),role:`article`,children:(0,Z.jsx)(`div`,{className:z(Q.bubble,Q.bubbleRight,`chat__bubble`,`chat__guestBubble`),tabIndex:0,role:`group`,"aria-label":i(`guest-bubble.label`),children:(0,Z.jsx)(`div`,{className:z(Q.rightText),children:n})})})}),ol=()=>(0,x.useMemo)(()=>Xt(),[]),sl={markdown:`_markdown_nw7vg_1`},cl=`source-info-reference`,ll=({actionId:e,markdown:t,sources:n,onLinkClick:r})=>{let i=ol(),a=Zi(),o=ul(),s=Qi(e=>{let t=e.chat.sourceInfos;if(t?.type===`loaded`||t?.type===`loading`)return t.chunkId}),c=t=>n=>{let r=n.key;(r===`ArrowDown`||r===`ArrowRight`||r===`Enter`||r===` `||r===`Space`)&&(n.stopPropagation(),a(Ai(i,e,t)))},l=t=>()=>{a(Ai(i,e,t))};return(0,x.useLayoutEffect)(()=>{document.querySelectorAll(`.${cl}`).forEach(e=>{let t=e.previousSibling;t&&t.nodeType===Node.TEXT_NODE&&t.textContent?.endsWith(` `)&&t.textContent?.trim().length&&e.classList.add(`${cl}--before-space`);let n=e.nextSibling;n&&n.nodeType===Node.TEXT_NODE&&n.textContent?.startsWith(` `)&&n.textContent?.trim().length&&e.classList.add(`${cl}--after-space`)})},[t]),(0,Z.jsxs)(`div`,{className:Q.bubbleContent,children:[(0,Z.jsx)(`div`,{className:sl.markdown,children:(0,Z.jsx)($c,{markdown:t,onLinkClick:r,markdownOptions:{renderRule(e,t,n,r){if(t.type===Y.footnoteReference){let e=t.text===s;return(0,Z.jsx)(`span`,{className:z(Q.sourceInfoReference,e&&Q.sourceInfoReferenceActive,cl),children:(0,Z.jsx)(`a`,{type:`button`,tabIndex:0,onClick:l(t.text),onKeyDown:c(t.text),children:o(t.text)})},r.key)}return e()}}})}),(0,Z.jsx)(qc,{sources:n,onLinkClick:r})]})},ul=()=>{let e=[];return t=>{let n=e.indexOf(t);return n>-1?n+1:(e.push(t),e.length)}},dl={text:`_text_gp0s0_1`,command:`_command_gp0s0_5`},fl=({text:e,commands:t=[]})=>{let n=t.find(t=>e.startsWith(`/${t}`)),r=n?e.slice(n.length+1):e;return(0,Z.jsxs)(`div`,{children:[n&&(0,Z.jsxs)(`code`,{className:dl.command,children:[`/`,n]}),r.split(`
|
|
59
59
|
`).map((e,t)=>(0,Z.jsxs)(`span`,{className:dl.text,children:[e,(0,Z.jsx)(`br`,{})]},t))]})},pl=({text:e,commands:t,sources:n,onLinkClick:r})=>(0,Z.jsxs)(`div`,{className:Q.bubbleContent,children:[(0,Z.jsx)(fl,{text:e,commands:t}),(0,Z.jsx)(qc,{sources:n,onLinkClick:r})]}),ml=(0,x.forwardRef)(({message:e,commands:t,isLastMessage:n,isFirstMessageBySender:r,isLastMessageBySender:i,onReaction:a,onButtonClick:o,onLinkClick:s},c)=>{let l=hl(e._id,e,t,o,s),u=t=>{a(e._id,t)};switch(e.sender.type){case at.GUEST:return(0,Z.jsx)(al,{ref:c,isFirstMessageBySender:r,isLastMessageBySender:i,children:l});default:return(0,Z.jsx)(Bc,{ref:c,message:e,isAnimated:!1,isLastMessage:n,isFirstMessageBySender:r,isLastMessageBySender:i,onReaction:u,children:l})}}),hl=(e,t,n,r,i)=>{switch(t.type){case st.TEXT:return(0,Z.jsx)(pl,{text:t.text,commands:n,sources:t.sources||[],onLinkClick:i});case st.DETAIL:{let e=t;return(0,Z.jsx)(il,{title:e.title,text:e.text,imageUrl:e.imageUrl,itemUrl:e.itemUrl,buttons:e.buttons,sources:t.sources||[],onButtonClick:r,onLinkClick:i})}case st.MARKDOWN:{let n=t;return(0,Z.jsx)(ll,{actionId:e,markdown:n.markdown,sources:n.sources||[],onLinkClick:i})}}},gl=x.memo(ml,(e,t)=>e.message._id===t.message._id&&e.message.reaction===t.message.reaction&&e.isLastMessage===t.isLastMessage&&e.isFirstMessageBySender===t.isFirstMessageBySender&&e.isLastMessageBySender===t.isLastMessageBySender),_l={ticontainer:`_ticontainer_xg0dn_1`,tiblock:`_tiblock_xg0dn_5`,tidot:`_tidot_xg0dn_12`,mercuryTypingAnimation:`_mercuryTypingAnimation_xg0dn_1`},vl=({isTyping:e=!1})=>(0,Z.jsx)(`div`,{className:_l.ticontainer,children:(0,Z.jsx)(`div`,{className:_l.tiblock,children:e?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:z(_l.tidot,`chat__typingIndicator`),"aria-hidden":`true`}),(0,Z.jsx)(`div`,{className:z(_l.tidot,`chat__typingIndicator`),"aria-hidden":`true`}),(0,Z.jsx)(`div`,{className:z(_l.tidot,`chat__typingIndicator`),"aria-hidden":`true`})]}):null})}),yl=Object.assign({_id:`typing-indicator`},new ft(``,new lt)),bl=({messages:e,isBotTyping:t,commands:n,onTranscriptItemReaction:r,onButtonClick:i,onLinkClick:a})=>{let o=$i(),s=(0,x.useRef)(0),c=(0,x.useRef)(!0),l=(0,x.useRef)(null),u=(0,x.useRef)(null),d=(0,x.useRef)(null),f=Qi(e=>e.settings.enableGeneralConditions);(0,x.useLayoutEffect)(()=>{if(e.length&&l.current&&(s.current<e.length||t)){if(u.current){let e=u.current.offsetTop;l.current.scrollTop=e}else if(d.current){let e=d.current.offsetTop;l.current.scrollTop=e}c.current&&=!1,s.current=e.length}},[e,c,t]);let p,m=e.length;return(0,Z.jsxs)(`div`,{ref:l,className:z(ra.messageContainer,`chat__messageContainer`),style:{scrollBehavior:e.length&&c.current?`auto`:`smooth`},id:`MessageContainer`,"aria-label":o(`conversation.label`),children:[f&&(0,Z.jsx)(Ac,{}),(0,Z.jsxs)(`ul`,{className:ra.messages,role:`list`,children:[e.map((o,s)=>{let c=xl(o,p),l=Sl(o,s,e,t);p=o.sender.type;let u=s+1===m,f=o._id||`added-${s}`;return(0,Z.jsx)(gl,{ref:u?d:null,message:o,commands:n,isLastMessage:u,isFirstMessageBySender:c,isLastMessageBySender:l,onButtonClick:i,onLinkClick:a,onReaction:r},f)}),t&&(0,Z.jsx)(Bc,{ref:u,message:yl,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:p!==at.BOT,isLastMessageBySender:!0,children:(0,Z.jsx)(vl,{isTyping:!0})},`last`)]})]})},xl=(e,t)=>!t||t!==e.sender.type,Sl=(e,t,n,r)=>{let i=e.sender.type,a=n.length;return t+1===a?!(i===at.BOT&&r):i!==n.at(t+1)?.sender.type},Cl={bottomSheet:`_bottomSheet_jp8dl_1`,bottomSheetOpen:`_bottomSheetOpen_jp8dl_15`,"slide-in":`_slide-in_jp8dl_1`,bottomSheetClose:`_bottomSheetClose_jp8dl_20`,"slide-out":`_slide-out_jp8dl_1`},wl={container:`_container_xc2nx_1`},Tl=({contentUrl:e})=>{let t=Qi(e=>e.connection.sessionId),[n,r]=(0,x.useState)(!1);(0,x.useEffect)(()=>{r(t=>t||!!e)},[e]);let i=(0,x.useMemo)(()=>{if(e&&t){let n=new URL(e,document.baseURI);return n.searchParams.set(`sessionId`,t),n.toString()}else return},[e,t]);return(0,Z.jsx)(`div`,{className:z(wl.container,Cl.bottomSheet,{[Cl.bottomSheetOpen]:!!e,[Cl.bottomSheetClose]:n&&!e}),children:i&&(0,Z.jsx)(`iframe`,{title:`Drawer`,id:`form-drawer`,src:i,className:wl.iframe})})},El={container:`_container_1634s_1`},Dl=({title:e,href:t,children:n})=>(0,Z.jsx)(`a`,{href:t,title:e,target:`_blank`,rel:`noopener noreferrer`,children:n}),Ol=()=>{let e=$i()(`powered-by`);return e&&e.length?(0,Z.jsx)(`div`,{className:z(El.container,`chat__poweredBy`),children:(0,Z.jsx)(Sc,{options:{overrides:{a:Dl}},children:e})}):null},kl=(e,t)=>{let n=new Map,r=0;return e.replace(/^#{1,6}\s+/gm,``).replace(/(\*\*|__)(.*?)\1/g,`$2`).replace(/(\*|_)(.*?)\1/g,`$2`).replace(/\[([^\]]+)\]\([^)]+\)/g,`$1`).replace(/\[\^([^\]]+)\]/g,(e,i)=>(n.has(i)||n.set(i,++r),`(${t} ${n.get(i)})`)).replace(/`([^`]+)`/g,`$1`).replace(/```[\s\S]*?```/g,``).replace(/^>\s+/gm,``).replace(/^(-{3,}|_{3,}|\*{3,})$/gm,``).replace(/^[\s]*[-*+]\s+/gm,``).replace(/^[\s]*\d+\.\s+/gm,``).replace(/\n{3,}/g,`
|
|
60
60
|
|
|
61
|
-
`).trim()},Al=({messages:e,isBotTyping:t})=>{let n=(0,x.useRef)(``),r=$i(),i=r(`bot-bubble.footnote`),a=e=>{switch(e.type){case`TEXT`:return e.text||``;case`MARKDOWN`:return kl(e.markdown||``,i);case`DETAIL`:return e.text||e.title||``;default:return``}},o=(()=>{if(t)return r(`chatbot.typing`)??`Chatbot is typing`;let n=[...e].reverse().find(e=>e.sender.type===ta.BOT);return n?a(n):``})();return(0,x.useEffect)(()=>{o!==n.current&&(n.current=o)},[o]),(0,Z.jsx)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`sr-only`,children:o})},jl=({className:e,children:t,...n})=>(0,Z.jsx)(Yc,{className:z(Jc.buttonDefault,e),type:`button`,...n,children:t}),Ml=({className:e,children:t,...n})=>(0,Z.jsx)(Yc,{className:z(Jc.buttonPrimary,e),...n,children:t}),Nl={container:`_container_h23mk_1`,formContainer:`_formContainer_h23mk_17`,emailInput:`_emailInput_h23mk_22`,description:`_description_h23mk_52`,actions:`_actions_h23mk_57`,validationError:`_validationError_h23mk_67`,submitted:`_submitted_h23mk_74`},Pl=({visible:e,onEmailExport:t,onClose:n})=>{let r=$i(),[i,a]=(0,x.useState)(void 0),[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(void 0),u=(0,x.useRef)(null);(0,x.useEffect)(()=>{e?(u.current?.focus(),s(!1),a(e)):i===!0&&a(!1)},[e,i]);let d=e=>{e.preventDefault(),c&&c.length>0&&(t(c),s(!0),setTimeout(n,3*1e3))},f=e=>{let t=e.target.value.trim();l(/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(t)?t:``)};return(0,Z.jsxs)(`div`,{className:z(Nl.container,Cl.bottomSheet,{[Cl.bottomSheetOpen]:i===!0,[Cl.bottomSheetClose]:i===!1}),children:[(0,Z.jsx)(`h2`,{children:r(`export-transcript.email.title`)}),(0,Z.jsx)(Sc,{className:Nl.description,children:r(`export-transcript.email.description`)||``}),(0,Z.jsxs)(`form`,{onSubmit:d,className:Nl.formContainer,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`input`,{disabled:o,ref:u,type:`email`,placeholder:r(`export-transcript.email.placeholder`),className:Nl.emailInput,onChange:f}),c?.length===0?(0,Z.jsx)(`div`,{className:Nl.validationError,children:r(`export-transcript.email.invalid`)}):null]}),(0,Z.jsxs)(`div`,{className:Nl.actions,children:[(0,Z.jsx)(jl,{onClick:n,children:r(`export-transcript.email.cancel`)}),(0,Z.jsx)(Ml,{type:`submit`,disabled:o||c===void 0||c.length===0,children:r(`export-transcript.email.send`)})]})]}),o&&(0,Z.jsx)(`div`,{className:Nl.submitted,children:r(`export-transcript.email.success`)})]})},Fl={inputContainer:`_inputContainer_fi5ao_1`},Il={blockUserInput:`_blockUserInput_pot9c_1`,"append-animate":`_append-animate_pot9c_1`},Ll=({visible:e})=>{let t=$i();return e?(0,Z.jsx)(`div`,{className:z(Il.blockUserInput,`chat__blockUserInput`),children:t(`block-user-input.title`)}):null},Rl={commandsDropdown:`_commandsDropdown_fmklx_1`,commands:`_commands_fmklx_1`,command:`_command_fmklx_1`,commandActive:`_commandActive_fmklx_49`},zl=(e,t,n,r,i)=>{(0,x.useEffect)(()=>{let a=a=>{if(e.length)switch(a.key){case`Enter`:n(e[t]);break;case`ArrowUp`:r(t=>t>0?t-1:e.length-1);break;case`ArrowDown`:r(t=>t<e.length-1?t+1:0);break;case`Escape`:i([]);break;default:break}};return document.addEventListener(`keydown`,a),()=>{document.removeEventListener(`keydown`,a)}},[e,t,n,r,i])},Bl=({text:e,commands:t,onSelectCommand:n,onVisibilityChange:r})=>{let i=(0,x.useRef)(null),a=$i(),[o,s]=(0,x.useState)([]),[c,l]=(0,x.useState)(Vl(t)),[u,d]=(0,x.useState)(0),f=e=>n(`/${e}`);return jc(i,()=>s([])),zl(o,u,f,d,s),(0,x.useEffect)(()=>{l(Vl(t))},[t]),(0,x.useEffect)(()=>{let n=e.length||0;n===0||n>c||!e.startsWith(`/`)?s([]):s(t.filter(Hl(e))),d(0)},[t,e,c]),(0,x.useEffect)(()=>{r(!!o.length)},[o,r]),o.length?(0,Z.jsx)(`div`,{ref:i,className:Rl.commandsDropdown,children:(0,Z.jsx)(`ul`,{id:`command-list`,className:Rl.commands,role:`listbox`,children:o.map((e,t)=>(0,Z.jsxs)(`li`,{className:z([Rl.command,u===t&&Rl.commandActive]),role:`option`,onClick:()=>f(e),onMouseOver:()=>d(t),children:[(0,Z.jsxs)(`h1`,{children:[`/`,e]}),(0,Z.jsx)(`p`,{children:a(`commands.${e}`)})]},e))})}):null},Vl=e=>Math.max(...e.map(e=>e.length+1)),Hl=e=>t=>{let n=`/${t}`;return n.startsWith(e)&&n.length>=e.length},Ul={callToActionContainer:`_callToActionContainer_d8izj_1`,"append-animate":`_append-animate_d8izj_1`,callToActionTitle:`_callToActionTitle_d8izj_23`,rateOverlay:`_rateOverlay_d8izj_30`,body:`_body_d8izj_52`,footer:`_footer_d8izj_60`,actions:`_actions_d8izj_75`,bubbles:`_bubbles_d8izj_89`,rateFeedbackBotBubble:`_rateFeedbackBotBubble_d8izj_118`,rateFeedbackGuestBubble:`_rateFeedbackGuestBubble_d8izj_124`,avatar:`_avatar_d8izj_130`,fadeInLeft:`_fadeInLeft_d8izj_1`,bubble:`_bubble_d8izj_89`,appear:`_appear_d8izj_1`,botBubble:`_botBubble_d8izj_156`,guestBubble:`_guestBubble_d8izj_167`,rateText:`_rateText_d8izj_186`,stars:`_stars_d8izj_191`,starsSmall:`_starsSmall_d8izj_205`,starsLarge:`_starsLarge_d8izj_211`,star:`_star_d8izj_191`,starReadonly:`_starReadonly_d8izj_225`,starIcon:`_starIcon_d8izj_235`,starsDescriptionContainer:`_starsDescriptionContainer_d8izj_253`,starsDescription:`_starsDescription_d8izj_253`},Wl=({value:e,index:t,count:n,readonly:r,onHover:i,onClick:a})=>{let o=e=>{a&&e.key===`Enter`&&a()};return(0,Z.jsx)(`li`,{className:z(Ul.star,{[Ul.starReadonly]:r},`chat__conversationRating__star`),children:(0,Z.jsx)(`div`,{role:`radio`,"aria-checked":e>t?`true`:`false`,"aria-posinset":t+1,"aria-setsize":n,tabIndex:0,onMouseOver:i,onKeyDown:o,onClick:a,children:(0,Z.jsx)(`span`,{role:`img`,"aria-label":`Star`,className:z(Ul.starIcon),children:(0,Z.jsx)(`svg`,{viewBox:`64 64 896 896`,focusable:`false`,"data-icon":`star`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,children:(0,Z.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`})})})})})},Gl=5,Kl=({value:e,size:t,readonly:n=!1,onChange:r})=>{let[i,a]=(0,x.useState)(void 0),o=()=>{a(void 0)},s=e=>()=>{n||a(e+1)},c=t=>()=>{r&&!n&&(r(t===0&&e===1?0:t+1),a(void 0))};return(0,Z.jsx)(`ul`,{tabIndex:0,role:`radiogroup`,className:z(Ul.stars,{[Ul.starsSmall]:t===`small`,[Ul.starsLarge]:t===`large`},`chat__conversationRating__stars`,{chat__conversationRating__stars__small:t===`small`,chat__conversationRating__stars__large:t===`large`}),onMouseOut:o,children:Array(Gl).fill(0).map((t,r)=>(0,Z.jsx)(Wl,{value:i===void 0?e:i,index:r,count:Gl,readonly:n,onHover:s(r),onClick:c(r)},r))})},ql=({visible:e,onRate:t})=>{let n=$i();return e?(0,Z.jsxs)(`div`,{className:z(Ul.callToActionContainer,`chat__conversationRating__callToAction`),children:[(0,Z.jsx)(`div`,{className:z(Ul.callToActionTitle,`chat__conversationRating__callToAction__title`),children:n(`conversation-rating.call-to-action.title`)}),(0,Z.jsx)(Kl,{value:0,size:`small`,onChange:t})]}):null},Jl=({isFirstMessageBySender:e,isLastMessageBySender:t,children:n})=>(0,Z.jsxs)(`div`,{className:z(Q.message,Q.messageBot,e&&Q.messageBotFirst,t&&Q.messageBotLast,`chat__bubbleContainer`,`chat__botBubbleContainer`,e&&`chat__bubbleContainer--first`,t&&`chat__bubbleContainer--last`),children:[(0,Z.jsx)(`img`,{className:z(Q.avatar,Q.botAvatar),src:`bot.svg`,alt:`Bot`}),(0,Z.jsx)(`div`,{className:z(Q.bubble,Q.bubbleLeft,`chat__bubble`,`chat__botBubble`),children:(0,Z.jsx)(`div`,{className:z(Q.leftText,Q.bubbleContent),children:n})})]}),Yl=({children:e})=>(0,Z.jsx)(`div`,{className:z(Q.message,Q.messageGuest,Q.messageGuestFirst,Q.messageGuestLast,`chat__bubbleContainer`,`chat__guestBubbleContainer`,`chat__bubbleContainer--first`,`chat__bubbleContainer--last`),children:(0,Z.jsx)(`div`,{className:z(Q.bubble,Q.bubbleRight,`chat__bubble`,`chat__guestBubble`),children:(0,Z.jsx)(`div`,{className:z(Q.rightText,Q.bubbleContent),children:e})})}),Xl=()=>{let e=$i(),t=Zi(),n=Qi(e=>e.chat.conversationRating),[r,i]=(0,x.useState)(n.rating?.value||0),[a,o]=(0,x.useState)(void 0),[s,c]=(0,x.useState)(void 0),[l,u]=(0,x.useState)({submitted:!1,feedback:``}),d=(0,x.useRef)(null),[f,p]=(0,x.useState)(!1);(0,x.useEffect)(()=>{n.opener?(u({submitted:!1,feedback:``}),c(!0)):s===!0&&c(!1)},[n.opener,s]),(0,x.useEffect)(()=>{i(n.rating?.value||0)},[n.rating?.value,n.opener]),(0,x.useEffect)(()=>{d.current&&(d.current.value=n.rating?.feedback||``)},[n.rating?.feedback]),(0,x.useEffect)(()=>{let t=r>0?e(`conversation-rating.overlay.bot-message.rate-feedback.value-${r}`):void 0;o(t?.length?t:void 0)},[r,e]),(0,x.useEffect)(()=>{l.submitted?setTimeout(()=>p(!0),l.feedback.length?500:0):p(!1)},[l]);let m=e=>{e.preventDefault();let n=d.current?.value?.trim()||``;t(Pt(r,n)),u({submitted:!0,feedback:n})},h=()=>{n.opener===`CLOSE_CHAT`?t(Ti()):n.opener===`RESTART_CHAT`?t(Yi()):t(ki())};return(0,Z.jsx)(`div`,{className:z(Ul.rateOverlay,Cl.bottomSheet,`chat__conversationRating__overlay`,{[Cl.bottomSheetOpen]:s===!0,[Cl.bottomSheetClose]:s===!1}),children:(0,Z.jsxs)(`form`,{onSubmit:m,children:[(0,Z.jsxs)(`div`,{className:z(Ul.body,`chat__conversationRating__overlay__body`),children:[(0,Z.jsx)(`div`,{}),(0,Z.jsx)(`div`,{className:z(Ul.bubbles),children:n.opener&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Jl,{isFirstMessageBySender:!0,isLastMessageBySender:!a,children:[(0,Z.jsx)(`h2`,{children:e(`conversation-rating.overlay.title`)}),(0,Z.jsxs)(`div`,{className:z(Ul.starsDescriptionContainer),children:[(0,Z.jsx)(Kl,{value:r,size:`large`,readonly:l.submitted,onChange:i}),(0,Z.jsxs)(`div`,{className:z(Ul.starsDescription),children:[(0,Z.jsx)(`div`,{children:e(`conversation-rating.overlay.star.very-bad`)}),(0,Z.jsx)(`div`,{children:e(`conversation-rating.overlay.star.very-good`)})]})]})]}),a&&(0,Z.jsx)(Jl,{isFirstMessageBySender:!1,isLastMessageBySender:!f||!!l.feedback.length,children:(0,Z.jsx)(`div`,{children:a})}),!!l.feedback.length&&(0,Z.jsx)(Yl,{children:l.feedback}),f&&(0,Z.jsx)(Jl,{isFirstMessageBySender:!!l.feedback.length,isLastMessageBySender:!0,children:(0,Z.jsx)(`div`,{children:e(`conversation-rating.overlay.bot-message.submit-feedback`)})})]})})]}),(0,Z.jsxs)(`div`,{className:z(Ul.footer,`chat__conversationRating__overlay__footer`),children:[!l.submitted&&(0,Z.jsx)(`input`,{ref:d,defaultValue:n.rating?.feedback||``,placeholder:e(`conversation-rating.overlay.guest-feedback.input-placeholder`)}),(0,Z.jsxs)(`div`,{className:z(Ul.actions,`chat__conversationRating__overlay__footer__actions`),children:[l.submitted?(0,Z.jsx)(Ml,{type:`button`,disabled:!r,onClick:h,children:n.opener===`CLOSE_CHAT`?e(`conversation-rating.overlay.action.close-chat`):n.opener===`RESTART_CHAT`?e(`conversation-rating.overlay.action.restart-chat`):e(`conversation-rating.overlay.action.back-to-chat`)},`close-button`):(0,Z.jsx)(Ml,{type:`submit`,disabled:!r,children:e(`conversation-rating.overlay.action.submit`)},`submit-button`),n.opener!==`CHAT`&&!l.submitted&&(0,Z.jsx)(jl,{onClick:h,children:n.opener===`CLOSE_CHAT`?e(`conversation-rating.overlay.action.close-chat`):n.opener===`RESTART_CHAT`?e(`conversation-rating.overlay.action.restart-chat`):e(`conversation-rating.overlay.action.cancel`)})]})]})]})})},Zl=(0,x.memo)(({numberOfMessagesFromGuest:e})=>{let t=Zi(),n=Qi(e=>e.chat.conversationRating),r=e=>{t(Oi(`CHAT`,e))},i=!n.rating?.value&&e>=1;return n.enabled?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ql,{visible:i,onRate:r}),(0,Z.jsx)(Xl,{})]}):null}),Ql={inputWrapper:`_inputWrapper_18j9q_1`,withOpenCommands:`_withOpenCommands_18j9q_13`,actions:`_actions_18j9q_18`,messageInputWrapper:`_messageInputWrapper_18j9q_53`,messageInput:`_messageInput_18j9q_53`,buttons:`_buttons_18j9q_78`,button:`_button_18j9q_78`},$l={audioRecorder:`_audioRecorder_g845f_1`,audioButton:`_audioButton_g845f_6`,recorderIcon:`_recorderIcon_g845f_37`,pulse:`_pulse_g845f_1`,spinning:`_spinning_g845f_60`,spin:`_spin_g845f_60`},eu=2048,tu=16e3,nu=class extends x.Component{audioInput=null;volume=null;leftchannel=[];recorder=null;recordingLength=0;sampleRate=null;mediaStream=null;constructor(e){super(e),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(e){this.mediaStream=e,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(e)}initRecording(e){let t=new(window.AudioContext||window.webkitAudioContext);this.sampleRate=t.sampleRate,this.volume=t.createGain(),this.audioInput=t.createMediaStreamSource(e),this.audioInput.connect(this.volume),this.recorder=t.createScriptProcessor(eu,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(t.destination)}processRecordingInput(e){if(this.state.recordingState===`connecting`&&this.setState({recordingState:`recording`}),this.state.recordingState!==`none`){let t=e.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(t)),this.recordingLength+=eu}}handleClickSubmitAudio(){let e=ru(ou(au(this.leftchannel,this.recordingLength),this.sampleRate||0));this.props.onAudioRecorded(e),this.handleClickStopAudio()}handleClickStopAudio(){this.setState({recordingState:`none`}),this.audioInput?.disconnect(),this.volume?.disconnect(),this.recorder?.disconnect(),this.mediaStream&&this.mediaStream?.getAudioTracks().forEach(e=>{e.stop()})}render(){return(0,Z.jsxs)(`div`,{className:$l.audioRecorder,children:[this.state.recordingState===`none`&&(0,Z.jsx)(`button`,{className:z($l.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:(0,Z.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,children:[(0,Z.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`}),(0,Z.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`})]})}),this.state.recordingState===`connecting`&&(0,Z.jsxs)(`svg`,{className:$l.spinning,xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,children:[(0,Z.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`}),(0,Z.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`})]}),this.state.recordingState===`recording`&&(0,Z.jsxs)(`div`,{className:$l.audioRecorder,children:[(0,Z.jsx)(`button`,{className:z($l.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate(`message-input.actions.stop-audio-recording.label`),tabIndex:0,children:(0,Z.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,children:[(0,Z.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`}),(0,Z.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`})]})}),(0,Z.jsx)(`div`,{className:$l.recorderIcon}),(0,Z.jsx)(`button`,{className:z($l.audioButton),type:`submit`,onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate(`message-input.actions.submit-audio-recording.label`),tabIndex:0,autoFocus:!0,children:(0,Z.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,children:[(0,Z.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),(0,Z.jsx)(`path`,{d:`M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z`})]})})]})]})}},ru=e=>{let t=new ArrayBuffer(44+e.length*2),n=new DataView(t);iu(n,0,`RIFF`),n.setUint32(4,44+e.length*2,!0),iu(n,8,`WAVE`),iu(n,12,`fmt `),n.setUint32(16,16,!0),n.setUint16(20,1,!0),n.setUint16(22,1,!0),n.setUint32(24,tu,!0),n.setUint32(28,tu*4,!0),n.setUint16(32,4,!0),n.setUint16(34,16,!0),iu(n,36,`data`),n.setUint32(40,e.length*2,!0);let r=e.length,i=44;for(let t=0;t<r;t++)n.setInt16(i,e[t]*(32767*1),!0),i+=2;return new Blob([n],{type:`audio/wav`})},iu=(e,t,n)=>{for(let r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))},au=(e,t)=>{let n=new Float32Array(t),r=0,i=e.length;for(let t=0;t<i;t++){let i=e[t];n.set(i,r),r+=i.length}return n},ou=(e,t)=>{if(tu===t)return e;let n=t/tu,r=Math.round(e.length/n),i=new Float32Array(r),a=0,o=0;for(;a<i.length;){let t=Math.round((a+1)*n),r=0,s=0;for(let n=o;n<t&&n<e.length;n++)r+=e[n],s++;i[a]=r/s,a++,o=t}return i},su=({onClick:e})=>{let t=$i();return(0,Z.jsxs)(`button`,{onClick:e,type:`button`,"aria-label":t(`message-input.actions.command.label`),children:[(0,Z.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`32`,height:`32`,fill:`#000000`,viewBox:`0 0 256 256`,children:[(0,Z.jsx)(`rect`,{x:`32`,y:`32`,width:`192`,height:`192`,rx:`16`,ry:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`16`}),(0,Z.jsx)(`line`,{x1:`80`,y1:`176`,x2:`176`,y2:`80`,stroke:`currentColor`,"stroke-width":`16`,"stroke-linecap":`round`})]}),(0,Z.jsx)(`span`,{children:t(`message-input.actions.command.label`)})]})},cu=({disabled:e,textInput:t,commandsVisible:n,hasCommands:r,onTextInput:i,onTextInputSubmit:a,onAudioRecorded:o})=>{let s=$i(),c=(0,x.useRef)(null),l=(0,x.useRef)(0),{enableSpeechSupport:u}=Qi(e=>e.settings),d=e=>{e.style.height=``;let{scrollHeight:t}=e,n=Math.max(l.current,Math.min(t,150));e.style.height=`${n}px`,e.style.overflowY=t>150?`auto`:`hidden`};(0,x.useEffect)(()=>{let e=c.current;e&&(l.current===0&&(l.current=e.scrollHeight),d(e),e.focus())},[t]);let f=()=>{let e=c.current;e&&t.trim().length>=1&&a(t.trim())&&(e.value=``,e.style.height=``,e.focus())};return(0,Z.jsxs)(`form`,{className:z(Ql.inputWrapper,n&&Ql.withOpenCommands,`chat__textInput`),onSubmit:e=>{e.preventDefault(),f()},children:[(0,Z.jsxs)(`div`,{className:Ql.messageInputWrapper,children:[(0,Z.jsx)(`textarea`,{id:`user_input`,ref:c,className:Ql.messageInput,tabIndex:0,placeholder:s(`message-input-placeholder`),value:t,onChange:e=>{let t=e.target.value;i(t),d(e.target)},onKeyDown:e=>{e.code===`Enter`&&!e.shiftKey?(e.repeat||f(),e.preventDefault()):n&&(e.code===`ArrowUp`||e.code===`ArrowDown`)&&e.preventDefault()},"aria-label":s(`message-input-label`),"aria-controls":r?`command-list`:void 0,"aria-haspopup":r?`listbox`:void 0}),r&&(0,Z.jsx)(`div`,{className:Ql.actions,children:(0,Z.jsx)(su,{onClick:()=>{t.startsWith(`/`)?i(``):i(`/`)}})})]}),(0,Z.jsx)(`div`,{className:z(Ql.buttons,`chat__buttons`),children:t.length||!u||navigator.mediaDevices===void 0?(0,Z.jsx)(`button`,{className:z(Ql.button,`chat__button`),type:`submit`,"aria-label":s(`message-input.actions.submit.label`),"data-title":s(`message-input.actions.submit.label`),tabIndex:0,disabled:e,children:(0,Z.jsx)(`svg`,{viewBox:`64 64 896 896`,focusable:`false`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,children:(0,Z.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`})})}):u&&navigator.mediaDevices!==void 0&&(0,Z.jsx)(nu,{translate:s,onAudioRecorded:o})})]})},lu={quickReplies:`_quickReplies_83npe_1`,quickReply:`_quickReply_83npe_9`},uu=({quickReplies:e,onQuickReplyClick:t})=>e.length?(0,Z.jsx)(`div`,{className:z(lu.quickReplies,`chat__quickReplies`),children:e.map(e=>(0,Z.jsx)(Yc,{tabIndex:0,className:z(lu.quickReply,`chat__button`,`chat__quickReply`),onClick:()=>t(e),children:e.label},e.label))}):null,du=5e3,fu=1e3,pu=({isBotTyping:e,quickReplies:t,numberOfMessagesFromGuest:n,commands:r,onTextInput:i,onQuickReplyClick:a,onAudioRecorded:o})=>{let[s,c]=(0,x.useState)(``),[l,u]=(0,x.useState)(!1),[d,f]=(0,x.useState)(!1),p=(0,x.useRef)(0),m=(0,x.useRef)(0);return(0,x.useEffect)(()=>{if(l&&!e){let e=p.current?Date.now()-p.current:0;e>du?u(!1):setTimeout(()=>{u(!1)},du-e)}},[l,e]),(0,x.useEffect)(()=>{l&&(p.current=Date.now())},[l]),(0,Z.jsxs)(`div`,{className:z(Fl.inputContainer),children:[(0,Z.jsx)(uu,{quickReplies:t,onQuickReplyClick:a}),(0,Z.jsx)(Ll,{visible:l}),!l&&(0,Z.jsx)(Zl,{numberOfMessagesFromGuest:n}),!!r?.length&&(0,Z.jsx)(Bl,{text:s,commands:r,onSelectCommand:e=>{c(e+` `)},onVisibilityChange:f}),(0,Z.jsx)(cu,{textInput:s,disabled:l,commandsVisible:d,hasCommands:!!r?.length,onTextInput:c,onTextInputSubmit:t=>{let n=Date.now()-m.current<fu;return d?!1:e||n?(u(!0),!1):(i(t),c(``),m.current=Date.now(),!0)},onAudioRecorded:o})]})},mu=We(e=>{let{messages:t,quickReplies:n,isBotTyping:r,drawerContentUrl:i}=e.chat;return{messages:t,quickReplies:n,isBotTyping:r,drawerContentUrl:i}},e=>({onRestartChat:()=>e(Yi()),onMessageFromUser:t=>e(ht(t)),onAudioRecorded:t=>e(kt(t)),onActionFromUser:t=>e(t),onQuickReplyClick:t=>e(mt(t)),onNluEvent:t=>e(Ft(t)),onButtonClick:t=>e(Lt(t)),onLinkClick:t=>e(Rt(t)),onTranscriptExport:t=>e(jt(t)),onTranscriptItemReaction:(t,n)=>{e(pt.transcriptItemGuestReaction(t,n?.type||null,n?.category,n?.comment))}}))(({clientName:e,messages:t,quickReplies:n,isBotTyping:r,drawerContentUrl:i,onMessageFromUser:a,onQuickReplyClick:o,onButtonClick:s,onLinkClick:c,onAudioRecorded:l,onTranscriptExport:u,onTranscriptItemReaction:d})=>{let f=Zi(),p=Qi(e=>e.connection.connectionState),{enableTranscriptExportEmail:m,commands:h}=Qi(e=>e.settings),{showTranscriptMailOverlay:g,conversationRating:_}=Qi(e=>e.chat),v=t.filter(e=>e.sender.type===ta.GUEST).length;return(0,x.useEffect)(()=>{p===ea.CONNECTED&&f(Ji(e))},[e,p,f]),(0,Z.jsxs)(`div`,{className:na.container,children:[(0,Z.jsx)(Al,{messages:t,isBotTyping:r}),(0,Z.jsxs)(`div`,{className:z([na.chatcontent,(g||_?.opener)&&na.accessabilityHidden]),children:[(0,Z.jsx)(bl,{messages:t,isBotTyping:r,commands:h,onButtonClick:s,onLinkClick:c,onTranscriptItemReaction:d}),(0,Z.jsx)(pu,{isBotTyping:r,quickReplies:r?[]:n,numberOfMessagesFromGuest:v,commands:h,onQuickReplyClick:o,onTextInput:a,onAudioRecorded:l}),(0,Z.jsx)(Ol,{})]}),m&&(0,Z.jsx)(Pl,{visible:!!g,onEmailExport:u,onClose:()=>{f(Di())}}),(0,Z.jsx)(Tl,{contentUrl:i})]})}),hu=()=>(0,x.useMemo)(()=>{try{return window.self!==window.top}catch{return!0}},[]),gu=e=>t=>{let n=t.key;(n===`ArrowDown`||n===`ArrowRight`||n===`Enter`||n===` `||n===`Space`)&&(t.stopPropagation(),e())},_u=({onClick:e})=>{let t=$i();return hu()?(0,Z.jsx)(`button`,{className:`tooltip--bottom-left`,"aria-label":t(`header.close-chat`),"data-title":t(`header.close-chat`),tabIndex:0,onClick:e,onKeyDown:gu(e),children:(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,children:(0,Z.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},vu={header:`_header_3gvbz_1`,logoContainer:`_logoContainer_3gvbz_14`,logo:`_logo_3gvbz_14`,actions:`_actions_3gvbz_28`,active:`_active_3gvbz_43`,menuContainer:`_menuContainer_3gvbz_56`,menu:`_menu_3gvbz_56`,divider:`_divider_3gvbz_86`},yu=({icon:e})=>{switch(e){case`arrow-counter-clockwise`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`})});case`download`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z`})});case`expand`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.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`})});case`mail`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z`})});case`phone`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M144.27,45.93a8,8,0,0,1,9.8-5.66,86.22,86.22,0,0,1,61.66,61.66,8,8,0,0,1-5.66,9.8A8.23,8.23,0,0,1,208,112a8,8,0,0,1-7.73-5.94,70.35,70.35,0,0,0-50.33-50.33A8,8,0,0,1,144.27,45.93Zm-2.33,41.8c13.79,3.68,22.65,12.54,26.33,26.33A8,8,0,0,0,176,120a8.23,8.23,0,0,0,2.07-.27,8,8,0,0,0,5.66-9.8c-5.12-19.16-18.5-32.54-37.66-37.66a8,8,0,1,0-4.13,15.46Zm81.94,95.35A56.26,56.26,0,0,1,168,232C88.6,232,24,167.4,24,88A56.26,56.26,0,0,1,72.92,32.12a16,16,0,0,1,16.62,9.52l21.12,47.15,0,.12A16,16,0,0,1,109.39,104c-.18.27-.37.52-.57.77L88,129.45c7.49,15.22,23.41,31,38.83,38.51l24.34-20.71a8.12,8.12,0,0,1,.75-.56,16,16,0,0,1,15.17-1.4l.13.06,47.11,21.11A16,16,0,0,1,223.88,183.08Zm-15.88-2s-.07,0-.11,0h0l-47-21.05-24.35,20.71a8.44,8.44,0,0,1-.74.56,16,16,0,0,1-15.75,1.14c-18.73-9.05-37.4-27.58-46.46-46.11a16,16,0,0,1,1-15.7,6.13,6.13,0,0,1,.57-.77L96,95.15l-21-47a.61.61,0,0,1,0-.12A40.2,40.2,0,0,0,40,88,128.14,128.14,0,0,0,168,216,40.21,40.21,0,0,0,208,181.07Z`})});case`scroll`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M96,104a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H104A8,8,0,0,1,96,104Zm8,40h64a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16Zm128,48a32,32,0,0,1-32,32H88a32,32,0,0,1-32-32V64a16,16,0,0,0-32,0c0,5.74,4.83,9.62,4.88,9.66h0A8,8,0,0,1,24,88a7.89,7.89,0,0,1-4.79-1.61h0C18.05,85.54,8,77.61,8,64A32,32,0,0,1,40,32H176a32,32,0,0,1,32,32V168h8a8,8,0,0,1,4.8,1.6C222,170.46,232,178.39,232,192ZM96.26,173.48A8.07,8.07,0,0,1,104,168h88V64a16,16,0,0,0-16-16H67.69A31.71,31.71,0,0,1,72,64V192a16,16,0,0,0,32,0c0-5.74-4.83-9.62-4.88-9.66A7.82,7.82,0,0,1,96.26,173.48ZM216,192a12.58,12.58,0,0,0-3.23-8h-94a26.92,26.92,0,0,1,1.21,8,31.82,31.82,0,0,1-4.29,16H200A16,16,0,0,0,216,192Z`})});case`star`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z`})});case`link`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z`})});default:return(0,Z.jsx)(`div`,{})}},bu=(0,x.forwardRef)(({selected:e,item:t,onClick:n},r)=>{let i=$i();return(0,Z.jsx)(`li`,{"aria-selected":e,role:`option`,className:t.withDivider?vu.divider:void 0,children:(0,Z.jsxs)(`a`,{ref:r,type:`button`,role:`button`,tabIndex:-1,onClick:e=>{e.preventDefault(),n()},children:[(0,Z.jsx)(yu,{icon:t.icon}),(0,Z.jsx)(`span`,{children:i(`header.menu.${t.id}`)})]})})}),xu=(e,t)=>{let n=hu(),{menuItems:r,enableStandaloneView:i,enableTranscriptExportPdf:a,enableTranscriptExportEmail:o}=Qi(e=>e.settings),s=Qi(e=>e.chat.conversationRating.enabled);return(0,x.useMemo)(()=>{let c=[],l=r.filter(({visibility:t})=>e?t===`always`||t===`chat-only`:t===`always`||t===`start-screen-only`);if(e&&(c.push({id:`restart-chat`,type:`restart-chat`,icon:`arrow-counter-clockwise`,visibility:`chat-only`}),n&&i&&c.push({id:`expand-chat-window`,type:`expand-chat-window`,icon:`expand`,visibility:`always`}),t&&a&&c.push({id:`download-transcript`,type:`download-transcript`,icon:`download`,visibility:`chat-only`}),t&&o&&c.push({id:`send-transcript`,type:`send-transcript`,icon:`mail`,visibility:`chat-only`}),t&&s&&c.push({id:`rate-conversation`,type:`rate-conversation`,icon:`star`,visibility:`chat-only`}),c.length>0&&l.length)){let e=c.pop();e&&r.length&&c.push({...e,withDivider:!0})}return c.push(...l),c},[e,t,a,o,i,s,n,r])},Su=({chatStarted:e,hasGuestMessages:t})=>{let n=Zi(),r=$i(),{enabled:i,opener:a}=Qi(e=>e.chat.conversationRating),[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(-1),u=(0,x.useRef)(null),d=(0,x.useRef)(null),f=(0,x.useRef)([]),p=xu(e,t);(0,x.useEffect)(()=>{f.current[c]?.focus()},[c]);let m=(0,x.useCallback)(()=>{n(t&&i&&!a?Oi(`RESTART_CHAT`):Yi()),s(!1),l(0)},[t,i,a,n]),h=(0,x.useCallback)(e=>{switch(e.type){case`restart-chat`:m();break;case`expand-chat-window`:{let e=new URL(window.location.origin);e.pathname=window.location.pathname,e.search=window.location.search,e.hash=window.location.hash,window.open(e.href,`_blank`);break}case`download-transcript`:n(Mt());break;case`send-transcript`:n(Di());break;case`rate-conversation`:n(Oi(`MENU`));break;case`link`:n(Rt(e.url));break;case`action`:n(JSON.parse(JSON.stringify(e.action)));break;default:break}s(!1)},[n,m,s]);return(0,x.useEffect)(()=>{let e=e=>{if(o)switch(e.key){case`Enter`:e.preventDefault(),h(p[c]);break;case`ArrowUp`:l(e=>e>0?e-1:p.length-1);break;case`ArrowDown`:l(e=>e<p.length-1?e+1:0);break;case`Escape`:s(!1);break;case`Tab`:c>-1&&s(!1);break;default:break}};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[o,c,p,l,s,h]),(0,x.useEffect)(()=>{o||l(-1)},[o,c]),jc(d,()=>s(!1)),p.length?(0,Z.jsxs)(`div`,{className:z(vu.menuContainer),ref:d,children:[(0,Z.jsx)(`button`,{ref:u,className:z(o&&vu.active,o?`tooltip-hidden`:`tooltip--bottom-left`),"aria-label":r(`header.menu.title`),"data-title":r(`header.menu.title`),onClick:()=>{s(e=>!e)},onBlur:()=>{setTimeout(()=>{let e=document.activeElement;d.current&&!d.current.contains(e)&&s(!1)},0)},children:(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`})})}),o&&(0,Z.jsx)(`nav`,{className:vu.menu,"aria-label":r(`header.menu.title`),children:(0,Z.jsx)(`ul`,{tabIndex:0,children:p.map((e,t)=>(0,Z.jsx)(bu,{ref:e=>{f.current[t]=e},selected:c===t,item:e,onClick:()=>h(e)},e.id))})})]}):null},Cu=({className:e,chatStarted:t,...n})=>{let r=Zi(),i=Qi(e=>e.chat.conversationRating),a=Qi(e=>e.chat.messages.some(e=>e.sender.type===at.GUEST)),o=()=>{i.enabled&&!i.opener&&a?r(Oi(`CLOSE_CHAT`)):r(Ti())};return(0,Z.jsxs)(`div`,{className:z(vu.header,e),...n,children:[(0,Z.jsx)(`div`,{className:vu.logoContainer,children:(0,Z.jsx)(`div`,{className:vu.logo})}),(0,Z.jsxs)(`div`,{className:vu.actions,children:[(0,Z.jsx)(Su,{chatStarted:t,hasGuestMessages:a}),(0,Z.jsx)(_u,{onClick:o})]})]})},wu={chatwindow:`_chatwindow_rkbir_1`,chatwindowWithAside:`_chatwindowWithAside_rkbir_21`},Tu=()=>{let[e,t]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),n=()=>t(e.matches);return n(),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e},Eu={sourceInfos:`_sourceInfos_vei0l_1`,waitForLoading:`_waitForLoading_vei0l_24`,loadingContent:`_loadingContent_vei0l_28`,sourceHeader:`_sourceHeader_vei0l_37`,sourceHeaderIcon:`_sourceHeaderIcon_vei0l_57`,sourceContent:`_sourceContent_vei0l_61`,openSourceButton:`_openSourceButton_vei0l_69`,sourceButtonLabel:`_sourceButtonLabel_vei0l_79`,closeSourceInfosButton:`_closeSourceInfosButton_vei0l_101`,loadingSourceInfos:`_loadingSourceInfos_vei0l_125`,loading:`_loading_vei0l_28`,rotate:`_rotate_vei0l_1`,loadingError:`_loadingError_vei0l_139`,highlightLoadingInfo:`_highlightLoadingInfo_vei0l_155`,highlightLoadingInfoInnerContainer:`_highlightLoadingInfoInnerContainer_vei0l_169`,highlightLoadingInfoContent:`_highlightLoadingInfoContent_vei0l_178`,highlightLoadingInfoCloseIcon:`_highlightLoadingInfoCloseIcon_vei0l_198`,highlightLoader:`_highlightLoader_vei0l_203`,highlightLoaderLoading:`_highlightLoaderLoading_vei0l_210`,loadingAnim:`_loadingAnim_vei0l_1`},Du=({onClick:e})=>{let t=$i();return(0,Z.jsx)(`button`,{className:z(Eu.closeSourceInfosButton,`tooltip--bottom-left`),"aria-label":t(`source-infos.close`),"data-title":t(`source-infos.close`),tabIndex:0,onClick:e,children:(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,children:(0,Z.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`})})})},Ou=(0,x.forwardRef)(({sourceInfos:e,onClose:t,...n},r)=>(0,Z.jsxs)(`div`,{className:Eu.sourceHeader,...n,ref:r,children:[(0,Z.jsx)(`div`,{children:e?(0,Z.jsx)(`p`,{id:`source-info-title`,children:e.title}):(0,Z.jsx)(`p`,{children:`\xA0`})}),(0,Z.jsx)(Du,{onClick:t})]})),ku=({loading:e})=>(0,Z.jsx)(`div`,{className:Eu.highlightLoader,children:e&&(0,Z.jsx)(`div`,{className:Eu.highlightLoaderLoading})}),{entries:Au,setPrototypeOf:ju,isFrozen:Mu,getPrototypeOf:Nu,getOwnPropertyDescriptor:Pu}=Object,{freeze:Fu,seal:Iu,create:Lu}=Object,{apply:Ru,construct:zu}=typeof Reflect<`u`&&Reflect;Fu||=function(e){return e},Iu||=function(e){return e},Ru||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},zu||=function(e){return new e(...[...arguments].slice(1))};var Bu=od(Array.prototype.forEach),Vu=od(Array.prototype.lastIndexOf),Hu=od(Array.prototype.pop),Uu=od(Array.prototype.push),Wu=od(Array.prototype.splice),Gu=Array.isArray,Ku=od(String.prototype.toLowerCase),qu=od(String.prototype.toString),Ju=od(String.prototype.match),Yu=od(String.prototype.replace),Xu=od(String.prototype.indexOf),Zu=od(String.prototype.trim),Qu=od(Number.prototype.toString),$u=od(Boolean.prototype.toString),ed=typeof BigInt>`u`?null:od(BigInt.prototype.toString),td=typeof Symbol>`u`?null:od(Symbol.prototype.toString),nd=od(Object.prototype.hasOwnProperty),rd=od(Object.prototype.toString),id=od(RegExp.prototype.test),ad=sd(TypeError);function od(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Ru(e,t,n)}}function sd(e){return function(){return zu(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ku;if(ju&&ju(e,null),!Gu(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Mu(t)||(t[r]=e),i=e)}e[i]=!0}return e}function cd(e){for(let t=0;t<e.length;t++)nd(e,t)||(e[t]=null);return e}function ld(e){let t=Lu(null);for(let[n,r]of Au(e))nd(e,n)&&(Gu(r)?t[n]=cd(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=ld(r):t[n]=r);return t}function ud(e){switch(typeof e){case`string`:return e;case`number`:return Qu(e);case`boolean`:return $u(e);case`bigint`:return ed?ed(e):`0`;case`symbol`:return td?td(e):`Symbol()`;case`undefined`:return rd(e);case`function`:case`object`:{if(e===null)return rd(e);let t=e,n=dd(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:rd(e)}return rd(e)}default:return rd(e)}}function dd(e,t){for(;e!==null;){let n=Pu(e,t);if(n){if(n.get)return od(n.get);if(typeof n.value==`function`)return od(n.value)}e=Nu(e)}function n(){return null}return n}function fd(e){try{return id(e,``),!0}catch{return!1}}var pd=Fu(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),md=Fu(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),hd=Fu([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),gd=Fu([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),_d=Fu(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),vd=Fu([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),yd=Fu([`#text`]),bd=Fu(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),xd=Fu(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Sd=Fu(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Cd=Fu([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),wd=Iu(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Td=Iu(/<%[\w\W]*|[\w\W]*%>/gm),Ed=Iu(/\$\{[\w\W]*/gm),Dd=Iu(/^data-[\-\w.\u00B7-\uFFFF]+$/),Od=Iu(/^aria-[\-\w]+$/),kd=Iu(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ad=Iu(/^(?:\w+script|data):/i),jd=Iu(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Md=Iu(/^html$/i),Nd=Iu(/^[a-z][.\w]*(-[.\w]+)+$/i),Pd=Object.freeze({__proto__:null,ARIA_ATTR:Od,ATTR_WHITESPACE:jd,CUSTOM_ELEMENT:Nd,DATA_ATTR:Dd,DOCTYPE_NAME:Md,ERB_EXPR:Td,IS_ALLOWED_URI:kd,IS_SCRIPT_OR_DATA:Ad,MUSTACHE_EXPR:wd,TMPLIT_EXPR:Ed}),Fd={element:1,text:3,progressingInstruction:7,comment:8,document:9},Id=function(){return typeof window>`u`?null:window},Ld=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Rd=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function zd(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Id(),t=e=>zd(e);if(t.version=`3.4.1`,t.removed=[],!e||!e.document||e.document.nodeType!==Fd.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=dd(m,`cloneNode`),g=dd(m,`remove`),_=dd(m,`nextSibling`),v=dd(m,`childNodes`),y=dd(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,x=``,{implementation:S,createNodeIterator:C,createDocumentFragment:w,getElementsByTagName:T}=n,{importNode:E}=r,D=Rd();t.isSupported=typeof Au==`function`&&typeof y==`function`&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:O,ERB_EXPR:ee,TMPLIT_EXPR:k,DATA_ATTR:te,ARIA_ATTR:A,IS_SCRIPT_OR_DATA:ne,ATTR_WHITESPACE:re,CUSTOM_ELEMENT:ie}=Pd,{IS_ALLOWED_URI:j}=Pd,M=null,ae=$({},[...pd,...md,...hd,..._d,...yd]),N=null,oe=$({},[...bd,...xd,...Sd,...Cd]),P=Object.seal(Lu(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),F=null,I=null,L=Object.seal(Lu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),se=!0,ce=!0,le=!1,ue=!0,de=!1,R=!0,fe=!1,pe=!1,me=!1,he=!1,ge=!1,_e=!1,ve=!0,ye=!1,be=`user-content-`,xe=!0,Se=!1,Ce={},we=null,Te=$({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),Ee=null,De=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Oe=null,ke=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ae=`http://www.w3.org/1998/Math/MathML`,je=`http://www.w3.org/2000/svg`,Me=`http://www.w3.org/1999/xhtml`,Ne=Me,Pe=!1,Fe=null,Ie=$({},[Ae,je,Me],qu),Le=$({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Re=$({},[`annotation-xml`]),ze=$({},[`title`,`style`,`font`,`a`,`script`]),Be=null,Ve=[`application/xhtml+xml`,`text/html`],He=null,Ue=null,We=n.createElement(`form`),Ge=function(e){return e instanceof RegExp||e instanceof Function},Ke=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ue&&Ue===e)return;(!e||typeof e!=`object`)&&(e={}),e=ld(e),Be=Ve.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,He=Be===`application/xhtml+xml`?qu:Ku,M=nd(e,`ALLOWED_TAGS`)&&Gu(e.ALLOWED_TAGS)?$({},e.ALLOWED_TAGS,He):ae,N=nd(e,`ALLOWED_ATTR`)&&Gu(e.ALLOWED_ATTR)?$({},e.ALLOWED_ATTR,He):oe,Fe=nd(e,`ALLOWED_NAMESPACES`)&&Gu(e.ALLOWED_NAMESPACES)?$({},e.ALLOWED_NAMESPACES,qu):Ie,Oe=nd(e,`ADD_URI_SAFE_ATTR`)&&Gu(e.ADD_URI_SAFE_ATTR)?$(ld(ke),e.ADD_URI_SAFE_ATTR,He):ke,Ee=nd(e,`ADD_DATA_URI_TAGS`)&&Gu(e.ADD_DATA_URI_TAGS)?$(ld(De),e.ADD_DATA_URI_TAGS,He):De,we=nd(e,`FORBID_CONTENTS`)&&Gu(e.FORBID_CONTENTS)?$({},e.FORBID_CONTENTS,He):Te,F=nd(e,`FORBID_TAGS`)&&Gu(e.FORBID_TAGS)?$({},e.FORBID_TAGS,He):ld({}),I=nd(e,`FORBID_ATTR`)&&Gu(e.FORBID_ATTR)?$({},e.FORBID_ATTR,He):ld({}),Ce=nd(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?ld(e.USE_PROFILES):e.USE_PROFILES:!1,se=e.ALLOW_ARIA_ATTR!==!1,ce=e.ALLOW_DATA_ATTR!==!1,le=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ue=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,de=e.SAFE_FOR_TEMPLATES||!1,R=e.SAFE_FOR_XML!==!1,fe=e.WHOLE_DOCUMENT||!1,he=e.RETURN_DOM||!1,ge=e.RETURN_DOM_FRAGMENT||!1,_e=e.RETURN_TRUSTED_TYPE||!1,me=e.FORCE_BODY||!1,ve=e.SANITIZE_DOM!==!1,ye=e.SANITIZE_NAMED_PROPS||!1,xe=e.KEEP_CONTENT!==!1,Se=e.IN_PLACE||!1,j=fd(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:kd,Ne=typeof e.NAMESPACE==`string`?e.NAMESPACE:Me,Le=nd(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?ld(e.MATHML_TEXT_INTEGRATION_POINTS):$({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Re=nd(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?ld(e.HTML_INTEGRATION_POINTS):$({},[`annotation-xml`]);let t=nd(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?ld(e.CUSTOM_ELEMENT_HANDLING):Lu(null);if(P=Lu(null),nd(t,`tagNameCheck`)&&Ge(t.tagNameCheck)&&(P.tagNameCheck=t.tagNameCheck),nd(t,`attributeNameCheck`)&&Ge(t.attributeNameCheck)&&(P.attributeNameCheck=t.attributeNameCheck),nd(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(P.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),de&&(ce=!1),ge&&(he=!0),Ce&&(M=$({},yd),N=Lu(null),Ce.html===!0&&($(M,pd),$(N,bd)),Ce.svg===!0&&($(M,md),$(N,xd),$(N,Cd)),Ce.svgFilters===!0&&($(M,hd),$(N,xd),$(N,Cd)),Ce.mathMl===!0&&($(M,_d),$(N,Sd),$(N,Cd))),L.tagCheck=null,L.attributeCheck=null,nd(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?L.tagCheck=e.ADD_TAGS:Gu(e.ADD_TAGS)&&(M===ae&&(M=ld(M)),$(M,e.ADD_TAGS,He))),nd(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?L.attributeCheck=e.ADD_ATTR:Gu(e.ADD_ATTR)&&(N===oe&&(N=ld(N)),$(N,e.ADD_ATTR,He))),nd(e,`ADD_URI_SAFE_ATTR`)&&Gu(e.ADD_URI_SAFE_ATTR)&&$(Oe,e.ADD_URI_SAFE_ATTR,He),nd(e,`FORBID_CONTENTS`)&&Gu(e.FORBID_CONTENTS)&&(we===Te&&(we=ld(we)),$(we,e.FORBID_CONTENTS,He)),nd(e,`ADD_FORBID_CONTENTS`)&&Gu(e.ADD_FORBID_CONTENTS)&&(we===Te&&(we=ld(we)),$(we,e.ADD_FORBID_CONTENTS,He)),xe&&(M[`#text`]=!0),fe&&$(M,[`html`,`head`,`body`]),M.table&&($(M,[`tbody`]),delete F.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw ad(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw ad(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);b=e.TRUSTED_TYPES_POLICY,x=b.createHTML(``)}else b===void 0&&(b=Ld(p,i)),b!==null&&typeof x==`string`&&(x=b.createHTML(``));Fu&&Fu(e),Ue=e},qe=$({},[...md,...hd,...gd]),Je=$({},[..._d,...vd]),Ye=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:Ne,tagName:`template`});let n=Ku(e.tagName),r=Ku(t.tagName);return Fe[e.namespaceURI]?e.namespaceURI===je?t.namespaceURI===Me?n===`svg`:t.namespaceURI===Ae?n===`svg`&&(r===`annotation-xml`||Le[r]):!!qe[n]:e.namespaceURI===Ae?t.namespaceURI===Me?n===`math`:t.namespaceURI===je?n===`math`&&Re[r]:!!Je[n]:e.namespaceURI===Me?t.namespaceURI===je&&!Re[r]||t.namespaceURI===Ae&&!Le[r]?!1:!Je[n]&&(ze[n]||!qe[n]):!!(Be===`application/xhtml+xml`&&Fe[e.namespaceURI]):!1},Xe=function(e){Uu(t.removed,{element:e});try{y(e).removeChild(e)}catch{g(e)}},Ze=function(e,n){try{Uu(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Uu(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(he||ge)try{Xe(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Qe=function(e){let t=null,r=null;if(me)e=`<remove></remove>`+e;else{let t=Ju(e,/^[\r\n\t ]+/);r=t&&t[0]}Be===`application/xhtml+xml`&&Ne===Me&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?b.createHTML(e):e;if(Ne===Me)try{t=new f().parseFromString(i,Be)}catch{}if(!t||!t.documentElement){t=S.createDocument(Ne,`template`,null);try{t.documentElement.innerHTML=Pe?x:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ne===Me?T.call(t,fe?`html`:`body`)[0]:fe?t.documentElement:a},$e=function(e){return C.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},et=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},tt=function(e){return typeof s==`function`&&e instanceof s};function nt(e,n,r){Bu(e,e=>{e.call(t,n,r,Ue)})}let z=function(e){let n=null;if(nt(D.beforeSanitizeElements,e,null),et(e))return Xe(e),!0;let r=He(e.nodeName);if(nt(D.uponSanitizeElement,e,{tagName:r,allowedTags:M}),R&&e.hasChildNodes()&&!tt(e.firstElementChild)&&id(/<[/\w!]/g,e.innerHTML)&&id(/<[/\w!]/g,e.textContent)||R&&e.namespaceURI===Me&&r===`style`&&tt(e.firstElementChild)||e.nodeType===Fd.progressingInstruction||R&&e.nodeType===Fd.comment&&id(/<[/\w]/g,e.data))return Xe(e),!0;if(F[r]||!(L.tagCheck instanceof Function&&L.tagCheck(r))&&!M[r]){if(!F[r]&&at(r)&&(P.tagNameCheck instanceof RegExp&&id(P.tagNameCheck,r)||P.tagNameCheck instanceof Function&&P.tagNameCheck(r)))return!1;if(xe&&!we[r]){let t=y(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);t.insertBefore(r,_(e))}}}return Xe(e),!0}return e instanceof c&&!Ye(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&id(/<\/no(script|embed|frames)/i,e.innerHTML)?(Xe(e),!0):(de&&e.nodeType===Fd.text&&(n=e.textContent,Bu([O,ee,k],e=>{n=Yu(n,e,` `)}),e.textContent!==n&&(Uu(t.removed,{element:e.cloneNode()}),e.textContent=n)),nt(D.afterSanitizeElements,e,null),!1)},rt=function(e,t,r){if(I[t]||ve&&(t===`id`||t===`name`)&&(r in n||r in We))return!1;if(!(ce&&!I[t]&&id(te,t))&&!(se&&id(A,t))&&!(L.attributeCheck instanceof Function&&L.attributeCheck(t,e))){if(!N[t]||I[t]){if(!(at(e)&&(P.tagNameCheck instanceof RegExp&&id(P.tagNameCheck,e)||P.tagNameCheck instanceof Function&&P.tagNameCheck(e))&&(P.attributeNameCheck instanceof RegExp&&id(P.attributeNameCheck,t)||P.attributeNameCheck instanceof Function&&P.attributeNameCheck(t,e))||t===`is`&&P.allowCustomizedBuiltInElements&&(P.tagNameCheck instanceof RegExp&&id(P.tagNameCheck,r)||P.tagNameCheck instanceof Function&&P.tagNameCheck(r))))return!1}else if(!Oe[t]&&!id(j,Yu(r,re,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Xu(r,`data:`)===0&&Ee[e])&&!(le&&!id(ne,Yu(r,re,``)))&&r)return!1}return!0},it=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),at=function(e){return!it[Ku(e)]&&id(ie,e)},ot=function(e){nt(D.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||et(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:N,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=He(a),l=s,u=a===`value`?l:Zu(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,nt(D.uponSanitizeAttribute,e,r),u=r.attrValue,ye&&(c===`id`||c===`name`)&&Xu(u,be)!==0&&(Ze(a,e),u=be+u),R&&id(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){Ze(a,e);continue}if(c===`attributename`&&Ju(u,`href`)){Ze(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Ze(a,e);continue}if(!ue&&id(/\/>/i,u)){Ze(a,e);continue}de&&Bu([O,ee,k],e=>{u=Yu(u,e,` `)});let d=He(e.nodeName);if(!rt(d,c,u)){Ze(a,e);continue}if(b&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=b.createHTML(u);break;case`TrustedScriptURL`:u=b.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),et(e)?Xe(e):Hu(t.removed)}catch{Ze(a,e)}}nt(D.afterSanitizeAttributes,e,null)},st=function(e){let t=null,n=$e(e);for(nt(D.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)nt(D.uponSanitizeShadowNode,t,null),z(t),ot(t),t.content instanceof a&&st(t.content);nt(D.afterSanitizeShadowDOM,e,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(Pe=!e,Pe&&(e=`<!-->`),typeof e!=`string`&&!tt(e)&&(e=ud(e),typeof e!=`string`))throw ad(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(pe||Ke(n),t.removed=[],typeof e==`string`&&(Se=!1),Se){let t=e.nodeName;if(typeof t==`string`){let e=He(t);if(!M[e]||F[e])throw ad(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=Qe(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===Fd.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!he&&!de&&!fe&&e.indexOf(`<`)===-1)return b&&_e?b.createHTML(e):e;if(i=Qe(e),!i)return he?null:_e?x:``}i&&me&&Xe(i.firstChild);let u=$e(Se?e:i);for(;c=u.nextNode();)z(c),ot(c),c.content instanceof a&&st(c.content);if(Se)return e;if(he){if(de){i.normalize();let e=i.innerHTML;Bu([O,ee,k],t=>{e=Yu(e,t,` `)}),i.innerHTML=e}if(ge)for(l=w.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(N.shadowroot||N.shadowrootmode)&&(l=E.call(r,l,!0)),l}let d=fe?i.outerHTML:i.innerHTML;return fe&&M[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&id(Md,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
61
|
+
`).trim()},Al=({messages:e,isBotTyping:t})=>{let n=(0,x.useRef)(``),r=$i(),i=r(`bot-bubble.footnote`),a=e=>{switch(e.type){case`TEXT`:return e.text||``;case`MARKDOWN`:return kl(e.markdown||``,i);case`DETAIL`:return e.text||e.title||``;default:return``}},o=(()=>{if(t)return r(`chatbot.typing`)??`Chatbot is typing`;let n=[...e].reverse().find(e=>e.sender.type===ta.BOT);return n?a(n):``})();return(0,x.useEffect)(()=>{o!==n.current&&(n.current=o)},[o]),(0,Z.jsx)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`sr-only`,children:o})},jl=({className:e,children:t,...n})=>(0,Z.jsx)(Yc,{className:z(Jc.buttonDefault,e),type:`button`,...n,children:t}),Ml=({className:e,children:t,...n})=>(0,Z.jsx)(Yc,{className:z(Jc.buttonPrimary,e),...n,children:t}),Nl={container:`_container_h23mk_1`,formContainer:`_formContainer_h23mk_17`,emailInput:`_emailInput_h23mk_22`,description:`_description_h23mk_52`,actions:`_actions_h23mk_57`,validationError:`_validationError_h23mk_67`,submitted:`_submitted_h23mk_74`},Pl=({visible:e,onEmailExport:t,onClose:n})=>{let r=$i(),[i,a]=(0,x.useState)(void 0),[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(void 0),u=(0,x.useRef)(null);(0,x.useEffect)(()=>{e?(u.current?.focus(),s(!1),a(e)):i===!0&&a(!1)},[e,i]);let d=e=>{e.preventDefault(),c&&c.length>0&&(t(c),s(!0),setTimeout(n,3*1e3))},f=e=>{let t=e.target.value.trim();l(/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(t)?t:``)};return(0,Z.jsxs)(`div`,{className:z(Nl.container,Cl.bottomSheet,{[Cl.bottomSheetOpen]:i===!0,[Cl.bottomSheetClose]:i===!1}),children:[(0,Z.jsx)(`h2`,{children:r(`export-transcript.email.title`)}),(0,Z.jsx)(Sc,{className:Nl.description,children:r(`export-transcript.email.description`)||``}),(0,Z.jsxs)(`form`,{onSubmit:d,className:Nl.formContainer,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`input`,{disabled:o,ref:u,type:`email`,placeholder:r(`export-transcript.email.placeholder`),className:Nl.emailInput,onChange:f}),c?.length===0?(0,Z.jsx)(`div`,{className:Nl.validationError,children:r(`export-transcript.email.invalid`)}):null]}),(0,Z.jsxs)(`div`,{className:Nl.actions,children:[(0,Z.jsx)(jl,{onClick:n,children:r(`export-transcript.email.cancel`)}),(0,Z.jsx)(Ml,{type:`submit`,disabled:o||c===void 0||c.length===0,children:r(`export-transcript.email.send`)})]})]}),o&&(0,Z.jsx)(`div`,{className:Nl.submitted,children:r(`export-transcript.email.success`)})]})},Fl={inputContainer:`_inputContainer_fi5ao_1`},Il={blockUserInput:`_blockUserInput_pot9c_1`,"append-animate":`_append-animate_pot9c_1`},Ll=({visible:e})=>{let t=$i();return e?(0,Z.jsx)(`div`,{className:z(Il.blockUserInput,`chat__blockUserInput`),children:t(`block-user-input.title`)}):null},Rl={commandsDropdown:`_commandsDropdown_fmklx_1`,commands:`_commands_fmklx_1`,command:`_command_fmklx_1`,commandActive:`_commandActive_fmklx_49`},zl=(e,t,n,r,i)=>{(0,x.useEffect)(()=>{let a=a=>{if(e.length)switch(a.key){case`Enter`:n(e[t]);break;case`ArrowUp`:r(t=>t>0?t-1:e.length-1);break;case`ArrowDown`:r(t=>t<e.length-1?t+1:0);break;case`Escape`:i([]);break;default:break}};return document.addEventListener(`keydown`,a),()=>{document.removeEventListener(`keydown`,a)}},[e,t,n,r,i])},Bl=({text:e,commands:t,onSelectCommand:n,onVisibilityChange:r})=>{let i=(0,x.useRef)(null),a=$i(),[o,s]=(0,x.useState)([]),[c,l]=(0,x.useState)(Vl(t)),[u,d]=(0,x.useState)(0),f=e=>n(`/${e}`);return jc(i,()=>s([])),zl(o,u,f,d,s),(0,x.useEffect)(()=>{l(Vl(t))},[t]),(0,x.useEffect)(()=>{let n=e.length||0;n===0||n>c||!e.startsWith(`/`)?s([]):s(t.filter(Hl(e))),d(0)},[t,e,c]),(0,x.useEffect)(()=>{r(!!o.length)},[o,r]),o.length?(0,Z.jsx)(`div`,{ref:i,className:Rl.commandsDropdown,children:(0,Z.jsx)(`ul`,{id:`command-list`,className:Rl.commands,role:`listbox`,children:o.map((e,t)=>(0,Z.jsxs)(`li`,{className:z([Rl.command,u===t&&Rl.commandActive]),role:`option`,onClick:()=>f(e),onMouseOver:()=>d(t),children:[(0,Z.jsxs)(`h1`,{children:[`/`,e]}),(0,Z.jsx)(`p`,{children:a(`commands.${e}`)})]},e))})}):null},Vl=e=>Math.max(...e.map(e=>e.length+1)),Hl=e=>t=>{let n=`/${t}`;return n.startsWith(e)&&n.length>=e.length},Ul={callToActionContainer:`_callToActionContainer_d8izj_1`,"append-animate":`_append-animate_d8izj_1`,callToActionTitle:`_callToActionTitle_d8izj_23`,rateOverlay:`_rateOverlay_d8izj_30`,body:`_body_d8izj_52`,footer:`_footer_d8izj_60`,actions:`_actions_d8izj_75`,bubbles:`_bubbles_d8izj_89`,rateFeedbackBotBubble:`_rateFeedbackBotBubble_d8izj_118`,rateFeedbackGuestBubble:`_rateFeedbackGuestBubble_d8izj_124`,avatar:`_avatar_d8izj_130`,fadeInLeft:`_fadeInLeft_d8izj_1`,bubble:`_bubble_d8izj_89`,appear:`_appear_d8izj_1`,botBubble:`_botBubble_d8izj_156`,guestBubble:`_guestBubble_d8izj_167`,rateText:`_rateText_d8izj_186`,stars:`_stars_d8izj_191`,starsSmall:`_starsSmall_d8izj_205`,starsLarge:`_starsLarge_d8izj_211`,star:`_star_d8izj_191`,starReadonly:`_starReadonly_d8izj_225`,starIcon:`_starIcon_d8izj_235`,starsDescriptionContainer:`_starsDescriptionContainer_d8izj_253`,starsDescription:`_starsDescription_d8izj_253`},Wl=({value:e,index:t,count:n,readonly:r,onHover:i,onClick:a})=>{let o=e=>{a&&e.key===`Enter`&&a()};return(0,Z.jsx)(`li`,{className:z(Ul.star,{[Ul.starReadonly]:r},`chat__conversationRating__star`),children:(0,Z.jsx)(`div`,{role:`radio`,"aria-checked":e>t?`true`:`false`,"aria-posinset":t+1,"aria-setsize":n,tabIndex:0,onMouseOver:i,onKeyDown:o,onClick:a,children:(0,Z.jsx)(`span`,{role:`img`,"aria-label":`Star`,className:z(Ul.starIcon),children:(0,Z.jsx)(`svg`,{viewBox:`64 64 896 896`,focusable:`false`,"data-icon":`star`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,children:(0,Z.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`})})})})})},Gl=5,Kl=({value:e,size:t,readonly:n=!1,onChange:r})=>{let[i,a]=(0,x.useState)(void 0),o=()=>{a(void 0)},s=e=>()=>{n||a(e+1)},c=t=>()=>{r&&!n&&(r(t===0&&e===1?0:t+1),a(void 0))};return(0,Z.jsx)(`ul`,{tabIndex:0,role:`radiogroup`,className:z(Ul.stars,{[Ul.starsSmall]:t===`small`,[Ul.starsLarge]:t===`large`},`chat__conversationRating__stars`,{chat__conversationRating__stars__small:t===`small`,chat__conversationRating__stars__large:t===`large`}),onMouseOut:o,children:Array(Gl).fill(0).map((t,r)=>(0,Z.jsx)(Wl,{value:i===void 0?e:i,index:r,count:Gl,readonly:n,onHover:s(r),onClick:c(r)},r))})},ql=({visible:e,onRate:t})=>{let n=$i();return e?(0,Z.jsxs)(`div`,{className:z(Ul.callToActionContainer,`chat__conversationRating__callToAction`),children:[(0,Z.jsx)(`div`,{className:z(Ul.callToActionTitle,`chat__conversationRating__callToAction__title`),children:n(`conversation-rating.call-to-action.title`)}),(0,Z.jsx)(Kl,{value:0,size:`small`,onChange:t})]}):null},Jl=({isFirstMessageBySender:e,isLastMessageBySender:t,children:n})=>(0,Z.jsxs)(`div`,{className:z(Q.message,Q.messageBot,e&&Q.messageBotFirst,t&&Q.messageBotLast,`chat__bubbleContainer`,`chat__botBubbleContainer`,e&&`chat__bubbleContainer--first`,t&&`chat__bubbleContainer--last`),children:[(0,Z.jsx)(`img`,{className:z(Q.avatar,Q.botAvatar),src:`bot.svg`,alt:`Bot`}),(0,Z.jsx)(`div`,{className:z(Q.bubble,Q.bubbleLeft,`chat__bubble`,`chat__botBubble`),children:(0,Z.jsx)(`div`,{className:z(Q.leftText,Q.bubbleContent),children:n})})]}),Yl=({children:e})=>(0,Z.jsx)(`div`,{className:z(Q.message,Q.messageGuest,Q.messageGuestFirst,Q.messageGuestLast,`chat__bubbleContainer`,`chat__guestBubbleContainer`,`chat__bubbleContainer--first`,`chat__bubbleContainer--last`),children:(0,Z.jsx)(`div`,{className:z(Q.bubble,Q.bubbleRight,`chat__bubble`,`chat__guestBubble`),children:(0,Z.jsx)(`div`,{className:z(Q.rightText,Q.bubbleContent),children:e})})}),Xl=()=>{let e=$i(),t=Zi(),n=Qi(e=>e.chat.conversationRating),[r,i]=(0,x.useState)(n.rating?.value||0),[a,o]=(0,x.useState)(void 0),[s,c]=(0,x.useState)(void 0),[l,u]=(0,x.useState)({submitted:!1,feedback:``}),d=(0,x.useRef)(null),[f,p]=(0,x.useState)(!1);(0,x.useEffect)(()=>{n.opener?(u({submitted:!1,feedback:``}),c(!0)):s===!0&&c(!1)},[n.opener,s]),(0,x.useEffect)(()=>{i(n.rating?.value||0)},[n.rating?.value,n.opener]),(0,x.useEffect)(()=>{d.current&&(d.current.value=n.rating?.feedback||``)},[n.rating?.feedback]),(0,x.useEffect)(()=>{let t=r>0?e(`conversation-rating.overlay.bot-message.rate-feedback.value-${r}`):void 0;o(t?.length?t:void 0)},[r,e]),(0,x.useEffect)(()=>{l.submitted?setTimeout(()=>p(!0),l.feedback.length?500:0):p(!1)},[l]);let m=e=>{e.preventDefault();let n=d.current?.value?.trim()||``;t(Pt(r,n)),u({submitted:!0,feedback:n})},h=()=>{n.opener===`CLOSE_CHAT`?t(Ti()):n.opener===`RESTART_CHAT`?t(Yi()):t(ki())};return(0,Z.jsx)(`div`,{className:z(Ul.rateOverlay,Cl.bottomSheet,`chat__conversationRating__overlay`,{[Cl.bottomSheetOpen]:s===!0,[Cl.bottomSheetClose]:s===!1}),children:(0,Z.jsxs)(`form`,{onSubmit:m,children:[(0,Z.jsxs)(`div`,{className:z(Ul.body,`chat__conversationRating__overlay__body`),children:[(0,Z.jsx)(`div`,{}),(0,Z.jsx)(`div`,{className:z(Ul.bubbles),children:n.opener&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Jl,{isFirstMessageBySender:!0,isLastMessageBySender:!a,children:[(0,Z.jsx)(`h2`,{children:e(`conversation-rating.overlay.title`)}),(0,Z.jsxs)(`div`,{className:z(Ul.starsDescriptionContainer),children:[(0,Z.jsx)(Kl,{value:r,size:`large`,readonly:l.submitted,onChange:i}),(0,Z.jsxs)(`div`,{className:z(Ul.starsDescription),children:[(0,Z.jsx)(`div`,{children:e(`conversation-rating.overlay.star.very-bad`)}),(0,Z.jsx)(`div`,{children:e(`conversation-rating.overlay.star.very-good`)})]})]})]}),a&&(0,Z.jsx)(Jl,{isFirstMessageBySender:!1,isLastMessageBySender:!f||!!l.feedback.length,children:(0,Z.jsx)(`div`,{children:a})}),!!l.feedback.length&&(0,Z.jsx)(Yl,{children:l.feedback}),f&&(0,Z.jsx)(Jl,{isFirstMessageBySender:!!l.feedback.length,isLastMessageBySender:!0,children:(0,Z.jsx)(`div`,{children:e(`conversation-rating.overlay.bot-message.submit-feedback`)})})]})})]}),(0,Z.jsxs)(`div`,{className:z(Ul.footer,`chat__conversationRating__overlay__footer`),children:[!l.submitted&&(0,Z.jsx)(`input`,{ref:d,defaultValue:n.rating?.feedback||``,placeholder:e(`conversation-rating.overlay.guest-feedback.input-placeholder`)}),(0,Z.jsxs)(`div`,{className:z(Ul.actions,`chat__conversationRating__overlay__footer__actions`),children:[l.submitted?(0,Z.jsx)(Ml,{type:`button`,disabled:!r,onClick:h,children:n.opener===`CLOSE_CHAT`?e(`conversation-rating.overlay.action.close-chat`):n.opener===`RESTART_CHAT`?e(`conversation-rating.overlay.action.restart-chat`):e(`conversation-rating.overlay.action.back-to-chat`)},`close-button`):(0,Z.jsx)(Ml,{type:`submit`,disabled:!r,children:e(`conversation-rating.overlay.action.submit`)},`submit-button`),n.opener!==`CHAT`&&!l.submitted&&(0,Z.jsx)(jl,{onClick:h,children:n.opener===`CLOSE_CHAT`?e(`conversation-rating.overlay.action.close-chat`):n.opener===`RESTART_CHAT`?e(`conversation-rating.overlay.action.restart-chat`):e(`conversation-rating.overlay.action.cancel`)})]})]})]})})},Zl=(0,x.memo)(({numberOfMessagesFromGuest:e})=>{let t=Zi(),n=Qi(e=>e.chat.conversationRating),r=e=>{t(Oi(`CHAT`,e))},i=!n.rating?.value&&e>=1;return n.enabled?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ql,{visible:i,onRate:r}),(0,Z.jsx)(Xl,{})]}):null}),Ql={inputWrapper:`_inputWrapper_18j9q_1`,withOpenCommands:`_withOpenCommands_18j9q_13`,actions:`_actions_18j9q_18`,messageInputWrapper:`_messageInputWrapper_18j9q_53`,messageInput:`_messageInput_18j9q_53`,buttons:`_buttons_18j9q_78`,button:`_button_18j9q_78`},$l={audioRecorder:`_audioRecorder_g845f_1`,audioButton:`_audioButton_g845f_6`,recorderIcon:`_recorderIcon_g845f_37`,pulse:`_pulse_g845f_1`,spinning:`_spinning_g845f_60`,spin:`_spin_g845f_60`},eu=2048,tu=16e3,nu=class extends x.Component{audioInput=null;volume=null;leftchannel=[];recorder=null;recordingLength=0;sampleRate=null;mediaStream=null;constructor(e){super(e),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(e){this.mediaStream=e,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(e)}initRecording(e){let t=new(window.AudioContext||window.webkitAudioContext);this.sampleRate=t.sampleRate,this.volume=t.createGain(),this.audioInput=t.createMediaStreamSource(e),this.audioInput.connect(this.volume),this.recorder=t.createScriptProcessor(eu,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(t.destination)}processRecordingInput(e){if(this.state.recordingState===`connecting`&&this.setState({recordingState:`recording`}),this.state.recordingState!==`none`){let t=e.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(t)),this.recordingLength+=eu}}handleClickSubmitAudio(){let e=ru(ou(au(this.leftchannel,this.recordingLength),this.sampleRate||0));this.props.onAudioRecorded(e),this.handleClickStopAudio()}handleClickStopAudio(){this.setState({recordingState:`none`}),this.audioInput?.disconnect(),this.volume?.disconnect(),this.recorder?.disconnect(),this.mediaStream&&this.mediaStream?.getAudioTracks().forEach(e=>{e.stop()})}render(){return(0,Z.jsxs)(`div`,{className:$l.audioRecorder,children:[this.state.recordingState===`none`&&(0,Z.jsx)(`button`,{className:z($l.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:(0,Z.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,children:[(0,Z.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`}),(0,Z.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`})]})}),this.state.recordingState===`connecting`&&(0,Z.jsxs)(`svg`,{className:$l.spinning,xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,children:[(0,Z.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`}),(0,Z.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`})]}),this.state.recordingState===`recording`&&(0,Z.jsxs)(`div`,{className:$l.audioRecorder,children:[(0,Z.jsx)(`button`,{className:z($l.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate(`message-input.actions.stop-audio-recording.label`),tabIndex:0,children:(0,Z.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,children:[(0,Z.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`}),(0,Z.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`})]})}),(0,Z.jsx)(`div`,{className:$l.recorderIcon}),(0,Z.jsx)(`button`,{className:z($l.audioButton),type:`submit`,onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate(`message-input.actions.submit-audio-recording.label`),tabIndex:0,autoFocus:!0,children:(0,Z.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,children:[(0,Z.jsx)(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),(0,Z.jsx)(`path`,{d:`M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z`})]})})]})]})}},ru=e=>{let t=new ArrayBuffer(44+e.length*2),n=new DataView(t);iu(n,0,`RIFF`),n.setUint32(4,44+e.length*2,!0),iu(n,8,`WAVE`),iu(n,12,`fmt `),n.setUint32(16,16,!0),n.setUint16(20,1,!0),n.setUint16(22,1,!0),n.setUint32(24,tu,!0),n.setUint32(28,tu*4,!0),n.setUint16(32,4,!0),n.setUint16(34,16,!0),iu(n,36,`data`),n.setUint32(40,e.length*2,!0);let r=e.length,i=44;for(let t=0;t<r;t++)n.setInt16(i,e[t]*(32767*1),!0),i+=2;return new Blob([n],{type:`audio/wav`})},iu=(e,t,n)=>{for(let r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))},au=(e,t)=>{let n=new Float32Array(t),r=0,i=e.length;for(let t=0;t<i;t++){let i=e[t];n.set(i,r),r+=i.length}return n},ou=(e,t)=>{if(tu===t)return e;let n=t/tu,r=Math.round(e.length/n),i=new Float32Array(r),a=0,o=0;for(;a<i.length;){let t=Math.round((a+1)*n),r=0,s=0;for(let n=o;n<t&&n<e.length;n++)r+=e[n],s++;i[a]=r/s,a++,o=t}return i},su=({onClick:e})=>{let t=$i();return(0,Z.jsxs)(`button`,{onClick:e,type:`button`,"aria-label":t(`message-input.actions.command.label`),children:[(0,Z.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`32`,height:`32`,fill:`#000000`,viewBox:`0 0 256 256`,children:[(0,Z.jsx)(`rect`,{x:`32`,y:`32`,width:`192`,height:`192`,rx:`16`,ry:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`16`}),(0,Z.jsx)(`line`,{x1:`80`,y1:`176`,x2:`176`,y2:`80`,stroke:`currentColor`,"stroke-width":`16`,"stroke-linecap":`round`})]}),(0,Z.jsx)(`span`,{children:t(`message-input.actions.command.label`)})]})},cu=({disabled:e,textInput:t,commandsVisible:n,hasCommands:r,onTextInput:i,onTextInputSubmit:a,onAudioRecorded:o})=>{let s=$i(),c=(0,x.useRef)(null),l=(0,x.useRef)(0),{enableSpeechSupport:u}=Qi(e=>e.settings),d=e=>{e.style.height=``;let{scrollHeight:t}=e,n=Math.max(l.current,Math.min(t,150));e.style.height=`${n}px`,e.style.overflowY=t>150?`auto`:`hidden`};(0,x.useEffect)(()=>{let e=c.current;e&&(l.current===0&&(l.current=e.scrollHeight),d(e),e.focus())},[t]);let f=()=>{let e=c.current;e&&t.trim().length>=1&&a(t.trim())&&(e.value=``,e.style.height=``,e.focus())};return(0,Z.jsxs)(`form`,{className:z(Ql.inputWrapper,n&&Ql.withOpenCommands,`chat__textInput`),onSubmit:e=>{e.preventDefault(),f()},children:[(0,Z.jsxs)(`div`,{className:Ql.messageInputWrapper,children:[(0,Z.jsx)(`textarea`,{id:`user_input`,ref:c,className:Ql.messageInput,tabIndex:0,placeholder:s(`message-input-placeholder`),value:t,onChange:e=>{let t=e.target.value;i(t),d(e.target)},onKeyDown:e=>{e.code===`Enter`&&!e.shiftKey?(e.repeat||f(),e.preventDefault()):n&&(e.code===`ArrowUp`||e.code===`ArrowDown`)&&e.preventDefault()},"aria-label":s(`message-input-label`),"aria-controls":r?`command-list`:void 0,"aria-haspopup":r?`listbox`:void 0}),r&&(0,Z.jsx)(`div`,{className:Ql.actions,children:(0,Z.jsx)(su,{onClick:()=>{t.startsWith(`/`)?i(``):i(`/`)}})})]}),(0,Z.jsx)(`div`,{className:z(Ql.buttons,`chat__buttons`),children:t.length||!u||navigator.mediaDevices===void 0?(0,Z.jsx)(`button`,{className:z(Ql.button,`chat__button`),type:`submit`,"aria-label":s(`message-input.actions.submit.label`),"data-title":s(`message-input.actions.submit.label`),tabIndex:0,disabled:e,children:(0,Z.jsx)(`svg`,{viewBox:`64 64 896 896`,focusable:`false`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,children:(0,Z.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`})})}):u&&navigator.mediaDevices!==void 0&&(0,Z.jsx)(nu,{translate:s,onAudioRecorded:o})})]})},lu={quickReplies:`_quickReplies_83npe_1`,quickReply:`_quickReply_83npe_9`},uu=({quickReplies:e,onQuickReplyClick:t})=>e.length?(0,Z.jsx)(`div`,{className:z(lu.quickReplies,`chat__quickReplies`),children:e.map(e=>(0,Z.jsx)(Yc,{tabIndex:0,className:z(lu.quickReply,`chat__button`,`chat__quickReply`),onClick:()=>t(e),children:e.label},e.label))}):null,du=5e3,fu=1e3,pu=({isBotTyping:e,quickReplies:t,numberOfMessagesFromGuest:n,commands:r,onTextInput:i,onQuickReplyClick:a,onAudioRecorded:o})=>{let[s,c]=(0,x.useState)(``),[l,u]=(0,x.useState)(!1),[d,f]=(0,x.useState)(!1),p=(0,x.useRef)(0),m=(0,x.useRef)(0);return(0,x.useEffect)(()=>{if(l&&!e){let e=p.current?Date.now()-p.current:0;e>du?u(!1):setTimeout(()=>{u(!1)},du-e)}},[l,e]),(0,x.useEffect)(()=>{l&&(p.current=Date.now())},[l]),(0,Z.jsxs)(`div`,{className:z(Fl.inputContainer),children:[(0,Z.jsx)(uu,{quickReplies:t,onQuickReplyClick:a}),(0,Z.jsx)(Ll,{visible:l}),!l&&(0,Z.jsx)(Zl,{numberOfMessagesFromGuest:n}),!!r?.length&&(0,Z.jsx)(Bl,{text:s,commands:r,onSelectCommand:e=>{c(e+` `)},onVisibilityChange:f}),(0,Z.jsx)(cu,{textInput:s,disabled:l,commandsVisible:d,hasCommands:!!r?.length,onTextInput:c,onTextInputSubmit:t=>{let n=Date.now()-m.current<fu;return d?!1:e||n?(u(!0),!1):(i(t),c(``),m.current=Date.now(),!0)},onAudioRecorded:o})]})},mu=We(e=>{let{messages:t,quickReplies:n,isBotTyping:r,drawerContentUrl:i}=e.chat;return{messages:t,quickReplies:n,isBotTyping:r,drawerContentUrl:i}},e=>({onRestartChat:()=>e(Yi()),onMessageFromUser:t=>e(ht(t)),onAudioRecorded:t=>e(kt(t)),onActionFromUser:t=>e(t),onQuickReplyClick:t=>e(mt(t)),onNluEvent:t=>e(Ft(t)),onButtonClick:t=>e(Lt(t)),onLinkClick:t=>e(Rt(t)),onTranscriptExport:t=>e(jt(t)),onTranscriptItemReaction:(t,n)=>{e(pt.transcriptItemGuestReaction(t,n?.type||null,n?.category,n?.comment))}}))(({clientName:e,messages:t,quickReplies:n,isBotTyping:r,drawerContentUrl:i,onMessageFromUser:a,onQuickReplyClick:o,onButtonClick:s,onLinkClick:c,onAudioRecorded:l,onTranscriptExport:u,onTranscriptItemReaction:d})=>{let f=Zi(),p=Qi(e=>e.connection.connectionState),{enableTranscriptExportEmail:m,commands:h}=Qi(e=>e.settings),{showTranscriptMailOverlay:g,conversationRating:_}=Qi(e=>e.chat),v=t.filter(e=>e.sender.type===ta.GUEST).length;return(0,x.useEffect)(()=>{p===ea.CONNECTED&&f(Ji(e))},[e,p,f]),(0,Z.jsxs)(`div`,{className:na.container,children:[(0,Z.jsx)(Al,{messages:t,isBotTyping:r}),(0,Z.jsxs)(`div`,{className:z([na.chatcontent,(g||_?.opener)&&na.accessabilityHidden]),children:[(0,Z.jsx)(bl,{messages:t,isBotTyping:r,commands:h,onButtonClick:s,onLinkClick:c,onTranscriptItemReaction:d}),(0,Z.jsx)(pu,{isBotTyping:r,quickReplies:r?[]:n,numberOfMessagesFromGuest:v,commands:h,onQuickReplyClick:o,onTextInput:a,onAudioRecorded:l}),(0,Z.jsx)(Ol,{})]}),m&&(0,Z.jsx)(Pl,{visible:!!g,onEmailExport:u,onClose:()=>{f(Di())}}),(0,Z.jsx)(Tl,{contentUrl:i})]})}),hu=()=>(0,x.useMemo)(()=>{try{return window.self!==window.top}catch{return!0}},[]),gu=e=>t=>{let n=t.key;(n===`ArrowDown`||n===`ArrowRight`||n===`Enter`||n===` `||n===`Space`)&&(t.stopPropagation(),e())},_u=({onClick:e})=>{let t=$i();return hu()?(0,Z.jsx)(`button`,{className:`tooltip--bottom-left`,"aria-label":t(`header.close-chat`),"data-title":t(`header.close-chat`),tabIndex:0,onClick:e,onKeyDown:gu(e),children:(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,children:(0,Z.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},vu={header:`_header_3gvbz_1`,logoContainer:`_logoContainer_3gvbz_14`,logo:`_logo_3gvbz_14`,actions:`_actions_3gvbz_28`,active:`_active_3gvbz_43`,menuContainer:`_menuContainer_3gvbz_56`,menu:`_menu_3gvbz_56`,divider:`_divider_3gvbz_86`},yu=({icon:e})=>{switch(e){case`arrow-counter-clockwise`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`})});case`download`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z`})});case`expand`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.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`})});case`mail`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z`})});case`phone`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M144.27,45.93a8,8,0,0,1,9.8-5.66,86.22,86.22,0,0,1,61.66,61.66,8,8,0,0,1-5.66,9.8A8.23,8.23,0,0,1,208,112a8,8,0,0,1-7.73-5.94,70.35,70.35,0,0,0-50.33-50.33A8,8,0,0,1,144.27,45.93Zm-2.33,41.8c13.79,3.68,22.65,12.54,26.33,26.33A8,8,0,0,0,176,120a8.23,8.23,0,0,0,2.07-.27,8,8,0,0,0,5.66-9.8c-5.12-19.16-18.5-32.54-37.66-37.66a8,8,0,1,0-4.13,15.46Zm81.94,95.35A56.26,56.26,0,0,1,168,232C88.6,232,24,167.4,24,88A56.26,56.26,0,0,1,72.92,32.12a16,16,0,0,1,16.62,9.52l21.12,47.15,0,.12A16,16,0,0,1,109.39,104c-.18.27-.37.52-.57.77L88,129.45c7.49,15.22,23.41,31,38.83,38.51l24.34-20.71a8.12,8.12,0,0,1,.75-.56,16,16,0,0,1,15.17-1.4l.13.06,47.11,21.11A16,16,0,0,1,223.88,183.08Zm-15.88-2s-.07,0-.11,0h0l-47-21.05-24.35,20.71a8.44,8.44,0,0,1-.74.56,16,16,0,0,1-15.75,1.14c-18.73-9.05-37.4-27.58-46.46-46.11a16,16,0,0,1,1-15.7,6.13,6.13,0,0,1,.57-.77L96,95.15l-21-47a.61.61,0,0,1,0-.12A40.2,40.2,0,0,0,40,88,128.14,128.14,0,0,0,168,216,40.21,40.21,0,0,0,208,181.07Z`})});case`scroll`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M96,104a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H104A8,8,0,0,1,96,104Zm8,40h64a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16Zm128,48a32,32,0,0,1-32,32H88a32,32,0,0,1-32-32V64a16,16,0,0,0-32,0c0,5.74,4.83,9.62,4.88,9.66h0A8,8,0,0,1,24,88a7.89,7.89,0,0,1-4.79-1.61h0C18.05,85.54,8,77.61,8,64A32,32,0,0,1,40,32H176a32,32,0,0,1,32,32V168h8a8,8,0,0,1,4.8,1.6C222,170.46,232,178.39,232,192ZM96.26,173.48A8.07,8.07,0,0,1,104,168h88V64a16,16,0,0,0-16-16H67.69A31.71,31.71,0,0,1,72,64V192a16,16,0,0,0,32,0c0-5.74-4.83-9.62-4.88-9.66A7.82,7.82,0,0,1,96.26,173.48ZM216,192a12.58,12.58,0,0,0-3.23-8h-94a26.92,26.92,0,0,1,1.21,8,31.82,31.82,0,0,1-4.29,16H200A16,16,0,0,0,216,192Z`})});case`star`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z`})});case`link`:return(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z`})});default:return(0,Z.jsx)(`div`,{})}},bu=(0,x.forwardRef)(({selected:e,item:t,onClick:n},r)=>{let i=$i();return(0,Z.jsx)(`li`,{"aria-selected":e,role:`option`,className:t.withDivider?vu.divider:void 0,children:(0,Z.jsxs)(`a`,{ref:r,type:`button`,role:`button`,tabIndex:-1,onClick:e=>{e.preventDefault(),n()},children:[(0,Z.jsx)(yu,{icon:t.icon}),(0,Z.jsx)(`span`,{children:i(`header.menu.${t.id}`)})]})})}),xu=(e,t)=>{let n=hu(),{menuItems:r,enableStandaloneView:i,enableTranscriptExportPdf:a,enableTranscriptExportEmail:o}=Qi(e=>e.settings),s=Qi(e=>e.chat.conversationRating.enabled);return(0,x.useMemo)(()=>{let c=[],l=r.filter(({visibility:t})=>e?t===`always`||t===`chat-only`:t===`always`||t===`start-screen-only`);if(e&&(c.push({id:`restart-chat`,type:`restart-chat`,icon:`arrow-counter-clockwise`,visibility:`chat-only`}),n&&i&&c.push({id:`expand-chat-window`,type:`expand-chat-window`,icon:`expand`,visibility:`always`}),t&&a&&c.push({id:`download-transcript`,type:`download-transcript`,icon:`download`,visibility:`chat-only`}),t&&o&&c.push({id:`send-transcript`,type:`send-transcript`,icon:`mail`,visibility:`chat-only`}),t&&s&&c.push({id:`rate-conversation`,type:`rate-conversation`,icon:`star`,visibility:`chat-only`}),c.length>0&&l.length)){let e=c.pop();e&&r.length&&c.push({...e,withDivider:!0})}return c.push(...l),c},[e,t,a,o,i,s,n,r])},Su=({chatStarted:e,hasGuestMessages:t})=>{let n=Zi(),r=$i(),{enabled:i,opener:a}=Qi(e=>e.chat.conversationRating),[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(-1),u=(0,x.useRef)(null),d=(0,x.useRef)(null),f=(0,x.useRef)([]),p=xu(e,t);(0,x.useEffect)(()=>{f.current[c]?.focus()},[c]);let m=(0,x.useCallback)(()=>{n(t&&i&&!a?Oi(`RESTART_CHAT`):Yi()),s(!1),l(0)},[t,i,a,n]),h=(0,x.useCallback)(e=>{switch(e.type){case`restart-chat`:m();break;case`expand-chat-window`:{let e=new URL(window.location.origin);e.pathname=window.location.pathname,e.search=window.location.search,e.hash=window.location.hash,window.open(e.href,`_blank`);break}case`download-transcript`:n(Mt());break;case`send-transcript`:n(Di());break;case`rate-conversation`:n(Oi(`MENU`));break;case`link`:n(Rt(e.url));break;case`action`:n(JSON.parse(JSON.stringify(e.action)));break;default:break}s(!1)},[n,m,s]);return(0,x.useEffect)(()=>{let e=e=>{if(o)switch(e.key){case`Enter`:e.preventDefault(),h(p[c]);break;case`ArrowUp`:l(e=>e>0?e-1:p.length-1);break;case`ArrowDown`:l(e=>e<p.length-1?e+1:0);break;case`Escape`:s(!1);break;case`Tab`:c>-1&&s(!1);break;default:break}};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[o,c,p,l,s,h]),(0,x.useEffect)(()=>{o||l(-1)},[o,c]),jc(d,()=>s(!1)),p.length?(0,Z.jsxs)(`div`,{className:z(vu.menuContainer),ref:d,children:[(0,Z.jsx)(`button`,{ref:u,className:z(o&&vu.active,o?`tooltip-hidden`:`tooltip--bottom-left`),"aria-label":r(`header.menu.title`),"data-title":r(`header.menu.title`),onClick:()=>{s(e=>!e)},onBlur:()=>{setTimeout(()=>{let e=document.activeElement;d.current&&!d.current.contains(e)&&s(!1)},0)},children:(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`})})}),o&&(0,Z.jsx)(`nav`,{className:vu.menu,"aria-label":r(`header.menu.title`),children:(0,Z.jsx)(`ul`,{tabIndex:0,children:p.map((e,t)=>(0,Z.jsx)(bu,{ref:e=>{f.current[t]=e},selected:c===t,item:e,onClick:()=>h(e)},e.id))})})]}):null},Cu=({className:e,chatStarted:t,...n})=>{let r=Zi(),i=Qi(e=>e.chat.conversationRating),a=Qi(e=>e.chat.messages.some(e=>e.sender.type===at.GUEST)),o=()=>{i.enabled&&!i.opener&&a?r(Oi(`CLOSE_CHAT`)):r(Ti())};return(0,Z.jsxs)(`div`,{className:z(vu.header,e),...n,children:[(0,Z.jsx)(`div`,{className:vu.logoContainer,children:(0,Z.jsx)(`div`,{className:vu.logo})}),(0,Z.jsxs)(`div`,{className:vu.actions,children:[(0,Z.jsx)(Su,{chatStarted:t,hasGuestMessages:a}),(0,Z.jsx)(_u,{onClick:o})]})]})},wu={chatwindow:`_chatwindow_rkbir_1`,chatwindowWithAside:`_chatwindowWithAside_rkbir_21`},Tu=()=>{let[e,t]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),n=()=>t(e.matches);return n(),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e},Eu={sourceInfos:`_sourceInfos_vei0l_1`,waitForLoading:`_waitForLoading_vei0l_24`,loadingContent:`_loadingContent_vei0l_28`,sourceHeader:`_sourceHeader_vei0l_37`,sourceHeaderIcon:`_sourceHeaderIcon_vei0l_57`,sourceContent:`_sourceContent_vei0l_61`,openSourceButton:`_openSourceButton_vei0l_69`,sourceButtonLabel:`_sourceButtonLabel_vei0l_79`,closeSourceInfosButton:`_closeSourceInfosButton_vei0l_101`,loadingSourceInfos:`_loadingSourceInfos_vei0l_125`,loading:`_loading_vei0l_28`,rotate:`_rotate_vei0l_1`,loadingError:`_loadingError_vei0l_139`,highlightLoadingInfo:`_highlightLoadingInfo_vei0l_155`,highlightLoadingInfoInnerContainer:`_highlightLoadingInfoInnerContainer_vei0l_169`,highlightLoadingInfoContent:`_highlightLoadingInfoContent_vei0l_178`,highlightLoadingInfoCloseIcon:`_highlightLoadingInfoCloseIcon_vei0l_198`,highlightLoader:`_highlightLoader_vei0l_203`,highlightLoaderLoading:`_highlightLoaderLoading_vei0l_210`,loadingAnim:`_loadingAnim_vei0l_1`},Du=({onClick:e})=>{let t=$i();return(0,Z.jsx)(`button`,{className:z(Eu.closeSourceInfosButton,`tooltip--bottom-left`),"aria-label":t(`source-infos.close`),"data-title":t(`source-infos.close`),tabIndex:0,onClick:e,children:(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,children:(0,Z.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`})})})},Ou=(0,x.forwardRef)(({sourceInfos:e,onClose:t,...n},r)=>(0,Z.jsxs)(`div`,{className:Eu.sourceHeader,...n,ref:r,children:[(0,Z.jsx)(`div`,{children:e?(0,Z.jsx)(`p`,{id:`source-info-title`,children:e.title}):(0,Z.jsx)(`p`,{children:`\xA0`})}),(0,Z.jsx)(Du,{onClick:t})]})),ku=({loading:e})=>(0,Z.jsx)(`div`,{className:Eu.highlightLoader,children:e&&(0,Z.jsx)(`div`,{className:Eu.highlightLoaderLoading})}),{entries:Au,setPrototypeOf:ju,isFrozen:Mu,getPrototypeOf:Nu,getOwnPropertyDescriptor:Pu}=Object,{freeze:Fu,seal:Iu,create:Lu}=Object,{apply:Ru,construct:zu}=typeof Reflect<`u`&&Reflect;Fu||=function(e){return e},Iu||=function(e){return e},Ru||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},zu||=function(e){return new e(...[...arguments].slice(1))};var Bu=od(Array.prototype.forEach),Vu=od(Array.prototype.lastIndexOf),Hu=od(Array.prototype.pop),Uu=od(Array.prototype.push),Wu=od(Array.prototype.splice),Gu=Array.isArray,Ku=od(String.prototype.toLowerCase),qu=od(String.prototype.toString),Ju=od(String.prototype.match),Yu=od(String.prototype.replace),Xu=od(String.prototype.indexOf),Zu=od(String.prototype.trim),Qu=od(Number.prototype.toString),$u=od(Boolean.prototype.toString),ed=typeof BigInt>`u`?null:od(BigInt.prototype.toString),td=typeof Symbol>`u`?null:od(Symbol.prototype.toString),nd=od(Object.prototype.hasOwnProperty),rd=od(Object.prototype.toString),id=od(RegExp.prototype.test),ad=sd(TypeError);function od(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Ru(e,t,n)}}function sd(e){return function(){return zu(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ku;if(ju&&ju(e,null),!Gu(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Mu(t)||(t[r]=e),i=e)}e[i]=!0}return e}function cd(e){for(let t=0;t<e.length;t++)nd(e,t)||(e[t]=null);return e}function ld(e){let t=Lu(null);for(let[n,r]of Au(e))nd(e,n)&&(Gu(r)?t[n]=cd(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=ld(r):t[n]=r);return t}function ud(e){switch(typeof e){case`string`:return e;case`number`:return Qu(e);case`boolean`:return $u(e);case`bigint`:return ed?ed(e):`0`;case`symbol`:return td?td(e):`Symbol()`;case`undefined`:return rd(e);case`function`:case`object`:{if(e===null)return rd(e);let t=e,n=dd(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:rd(e)}return rd(e)}default:return rd(e)}}function dd(e,t){for(;e!==null;){let n=Pu(e,t);if(n){if(n.get)return od(n.get);if(typeof n.value==`function`)return od(n.value)}e=Nu(e)}function n(){return null}return n}function fd(e){try{return id(e,``),!0}catch{return!1}}var pd=Fu(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),md=Fu(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),hd=Fu([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),gd=Fu([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),_d=Fu(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),vd=Fu([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),yd=Fu([`#text`]),bd=Fu(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),xd=Fu(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Sd=Fu(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Cd=Fu([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),wd=Iu(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Td=Iu(/<%[\w\W]*|[\w\W]*%>/gm),Ed=Iu(/\$\{[\w\W]*/gm),Dd=Iu(/^data-[\-\w.\u00B7-\uFFFF]+$/),Od=Iu(/^aria-[\-\w]+$/),kd=Iu(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ad=Iu(/^(?:\w+script|data):/i),jd=Iu(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Md=Iu(/^html$/i),Nd=Iu(/^[a-z][.\w]*(-[.\w]+)+$/i),Pd=Object.freeze({__proto__:null,ARIA_ATTR:Od,ATTR_WHITESPACE:jd,CUSTOM_ELEMENT:Nd,DATA_ATTR:Dd,DOCTYPE_NAME:Md,ERB_EXPR:Td,IS_ALLOWED_URI:kd,IS_SCRIPT_OR_DATA:Ad,MUSTACHE_EXPR:wd,TMPLIT_EXPR:Ed}),Fd={element:1,text:3,progressingInstruction:7,comment:8,document:9},Id=function(){return typeof window>`u`?null:window},Ld=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Rd=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function zd(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Id(),t=e=>zd(e);if(t.version=`3.4.2`,t.removed=[],!e||!e.document||e.document.nodeType!==Fd.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=dd(m,`cloneNode`),g=dd(m,`remove`),_=dd(m,`nextSibling`),v=dd(m,`childNodes`),y=dd(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,x=``,{implementation:S,createNodeIterator:C,createDocumentFragment:w,getElementsByTagName:T}=n,{importNode:E}=r,D=Rd();t.isSupported=typeof Au==`function`&&typeof y==`function`&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:O,ERB_EXPR:ee,TMPLIT_EXPR:k,DATA_ATTR:te,ARIA_ATTR:A,IS_SCRIPT_OR_DATA:ne,ATTR_WHITESPACE:re,CUSTOM_ELEMENT:ie}=Pd,{IS_ALLOWED_URI:j}=Pd,M=null,ae=$({},[...pd,...md,...hd,..._d,...yd]),N=null,oe=$({},[...bd,...xd,...Sd,...Cd]),P=Object.seal(Lu(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),F=null,I=null,L=Object.seal(Lu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),se=!0,ce=!0,le=!1,ue=!0,de=!1,R=!0,fe=!1,pe=!1,me=!1,he=!1,ge=!1,_e=!1,ve=!0,ye=!1,be=`user-content-`,xe=!0,Se=!1,Ce={},we=null,Te=$({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),Ee=null,De=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Oe=null,ke=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ae=`http://www.w3.org/1998/Math/MathML`,je=`http://www.w3.org/2000/svg`,Me=`http://www.w3.org/1999/xhtml`,Ne=Me,Pe=!1,Fe=null,Ie=$({},[Ae,je,Me],qu),Le=$({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Re=$({},[`annotation-xml`]),ze=$({},[`title`,`style`,`font`,`a`,`script`]),Be=null,Ve=[`application/xhtml+xml`,`text/html`],He=null,Ue=null,We=n.createElement(`form`),Ge=function(e){return e instanceof RegExp||e instanceof Function},Ke=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ue&&Ue===e)return;(!e||typeof e!=`object`)&&(e={}),e=ld(e),Be=Ve.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,He=Be===`application/xhtml+xml`?qu:Ku,M=nd(e,`ALLOWED_TAGS`)&&Gu(e.ALLOWED_TAGS)?$({},e.ALLOWED_TAGS,He):ae,N=nd(e,`ALLOWED_ATTR`)&&Gu(e.ALLOWED_ATTR)?$({},e.ALLOWED_ATTR,He):oe,Fe=nd(e,`ALLOWED_NAMESPACES`)&&Gu(e.ALLOWED_NAMESPACES)?$({},e.ALLOWED_NAMESPACES,qu):Ie,Oe=nd(e,`ADD_URI_SAFE_ATTR`)&&Gu(e.ADD_URI_SAFE_ATTR)?$(ld(ke),e.ADD_URI_SAFE_ATTR,He):ke,Ee=nd(e,`ADD_DATA_URI_TAGS`)&&Gu(e.ADD_DATA_URI_TAGS)?$(ld(De),e.ADD_DATA_URI_TAGS,He):De,we=nd(e,`FORBID_CONTENTS`)&&Gu(e.FORBID_CONTENTS)?$({},e.FORBID_CONTENTS,He):Te,F=nd(e,`FORBID_TAGS`)&&Gu(e.FORBID_TAGS)?$({},e.FORBID_TAGS,He):ld({}),I=nd(e,`FORBID_ATTR`)&&Gu(e.FORBID_ATTR)?$({},e.FORBID_ATTR,He):ld({}),Ce=nd(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?ld(e.USE_PROFILES):e.USE_PROFILES:!1,se=e.ALLOW_ARIA_ATTR!==!1,ce=e.ALLOW_DATA_ATTR!==!1,le=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ue=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,de=e.SAFE_FOR_TEMPLATES||!1,R=e.SAFE_FOR_XML!==!1,fe=e.WHOLE_DOCUMENT||!1,he=e.RETURN_DOM||!1,ge=e.RETURN_DOM_FRAGMENT||!1,_e=e.RETURN_TRUSTED_TYPE||!1,me=e.FORCE_BODY||!1,ve=e.SANITIZE_DOM!==!1,ye=e.SANITIZE_NAMED_PROPS||!1,xe=e.KEEP_CONTENT!==!1,Se=e.IN_PLACE||!1,j=fd(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:kd,Ne=typeof e.NAMESPACE==`string`?e.NAMESPACE:Me,Le=nd(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?ld(e.MATHML_TEXT_INTEGRATION_POINTS):$({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Re=nd(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?ld(e.HTML_INTEGRATION_POINTS):$({},[`annotation-xml`]);let t=nd(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?ld(e.CUSTOM_ELEMENT_HANDLING):Lu(null);if(P=Lu(null),nd(t,`tagNameCheck`)&&Ge(t.tagNameCheck)&&(P.tagNameCheck=t.tagNameCheck),nd(t,`attributeNameCheck`)&&Ge(t.attributeNameCheck)&&(P.attributeNameCheck=t.attributeNameCheck),nd(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(P.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),de&&(ce=!1),ge&&(he=!0),Ce&&(M=$({},yd),N=Lu(null),Ce.html===!0&&($(M,pd),$(N,bd)),Ce.svg===!0&&($(M,md),$(N,xd),$(N,Cd)),Ce.svgFilters===!0&&($(M,hd),$(N,xd),$(N,Cd)),Ce.mathMl===!0&&($(M,_d),$(N,Sd),$(N,Cd))),L.tagCheck=null,L.attributeCheck=null,nd(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?L.tagCheck=e.ADD_TAGS:Gu(e.ADD_TAGS)&&(M===ae&&(M=ld(M)),$(M,e.ADD_TAGS,He))),nd(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?L.attributeCheck=e.ADD_ATTR:Gu(e.ADD_ATTR)&&(N===oe&&(N=ld(N)),$(N,e.ADD_ATTR,He))),nd(e,`ADD_URI_SAFE_ATTR`)&&Gu(e.ADD_URI_SAFE_ATTR)&&$(Oe,e.ADD_URI_SAFE_ATTR,He),nd(e,`FORBID_CONTENTS`)&&Gu(e.FORBID_CONTENTS)&&(we===Te&&(we=ld(we)),$(we,e.FORBID_CONTENTS,He)),nd(e,`ADD_FORBID_CONTENTS`)&&Gu(e.ADD_FORBID_CONTENTS)&&(we===Te&&(we=ld(we)),$(we,e.ADD_FORBID_CONTENTS,He)),xe&&(M[`#text`]=!0),fe&&$(M,[`html`,`head`,`body`]),M.table&&($(M,[`tbody`]),delete F.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw ad(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw ad(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);b=e.TRUSTED_TYPES_POLICY,x=b.createHTML(``)}else b===void 0&&(b=Ld(p,i)),b!==null&&typeof x==`string`&&(x=b.createHTML(``));Fu&&Fu(e),Ue=e},qe=$({},[...md,...hd,...gd]),Je=$({},[..._d,...vd]),Ye=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:Ne,tagName:`template`});let n=Ku(e.tagName),r=Ku(t.tagName);return Fe[e.namespaceURI]?e.namespaceURI===je?t.namespaceURI===Me?n===`svg`:t.namespaceURI===Ae?n===`svg`&&(r===`annotation-xml`||Le[r]):!!qe[n]:e.namespaceURI===Ae?t.namespaceURI===Me?n===`math`:t.namespaceURI===je?n===`math`&&Re[r]:!!Je[n]:e.namespaceURI===Me?t.namespaceURI===je&&!Re[r]||t.namespaceURI===Ae&&!Le[r]?!1:!Je[n]&&(ze[n]||!qe[n]):!!(Be===`application/xhtml+xml`&&Fe[e.namespaceURI]):!1},Xe=function(e){Uu(t.removed,{element:e});try{y(e).removeChild(e)}catch{g(e)}},Ze=function(e,n){try{Uu(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Uu(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(he||ge)try{Xe(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Qe=function(e){let t=null,r=null;if(me)e=`<remove></remove>`+e;else{let t=Ju(e,/^[\r\n\t ]+/);r=t&&t[0]}Be===`application/xhtml+xml`&&Ne===Me&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?b.createHTML(e):e;if(Ne===Me)try{t=new f().parseFromString(i,Be)}catch{}if(!t||!t.documentElement){t=S.createDocument(Ne,`template`,null);try{t.documentElement.innerHTML=Pe?x:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ne===Me?T.call(t,fe?`html`:`body`)[0]:fe?t.documentElement:a},$e=function(e){return C.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},et=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},tt=function(e){return typeof s==`function`&&e instanceof s};function nt(e,n,r){Bu(e,e=>{e.call(t,n,r,Ue)})}let z=function(e){let n=null;if(nt(D.beforeSanitizeElements,e,null),et(e))return Xe(e),!0;let r=He(e.nodeName);if(nt(D.uponSanitizeElement,e,{tagName:r,allowedTags:M}),R&&e.hasChildNodes()&&!tt(e.firstElementChild)&&id(/<[/\w!]/g,e.innerHTML)&&id(/<[/\w!]/g,e.textContent)||R&&e.namespaceURI===Me&&r===`style`&&tt(e.firstElementChild)||e.nodeType===Fd.progressingInstruction||R&&e.nodeType===Fd.comment&&id(/<[/\w]/g,e.data))return Xe(e),!0;if(F[r]||!(L.tagCheck instanceof Function&&L.tagCheck(r))&&!M[r]){if(!F[r]&&at(r)&&(P.tagNameCheck instanceof RegExp&&id(P.tagNameCheck,r)||P.tagNameCheck instanceof Function&&P.tagNameCheck(r)))return!1;if(xe&&!we[r]){let t=y(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);t.insertBefore(r,_(e))}}}return Xe(e),!0}return e instanceof c&&!Ye(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&id(/<\/no(script|embed|frames)/i,e.innerHTML)?(Xe(e),!0):(de&&e.nodeType===Fd.text&&(n=e.textContent,Bu([O,ee,k],e=>{n=Yu(n,e,` `)}),e.textContent!==n&&(Uu(t.removed,{element:e.cloneNode()}),e.textContent=n)),nt(D.afterSanitizeElements,e,null),!1)},rt=function(e,t,r){if(I[t]||ve&&(t===`id`||t===`name`)&&(r in n||r in We))return!1;let i=N[t]||L.attributeCheck instanceof Function&&L.attributeCheck(t,e);if(!(ce&&!I[t]&&id(te,t))&&!(se&&id(A,t))){if(!i||I[t]){if(!(at(e)&&(P.tagNameCheck instanceof RegExp&&id(P.tagNameCheck,e)||P.tagNameCheck instanceof Function&&P.tagNameCheck(e))&&(P.attributeNameCheck instanceof RegExp&&id(P.attributeNameCheck,t)||P.attributeNameCheck instanceof Function&&P.attributeNameCheck(t,e))||t===`is`&&P.allowCustomizedBuiltInElements&&(P.tagNameCheck instanceof RegExp&&id(P.tagNameCheck,r)||P.tagNameCheck instanceof Function&&P.tagNameCheck(r))))return!1}else if(!Oe[t]&&!id(j,Yu(r,re,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Xu(r,`data:`)===0&&Ee[e])&&!(le&&!id(ne,Yu(r,re,``)))&&r)return!1}return!0},it=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),at=function(e){return!it[Ku(e)]&&id(ie,e)},ot=function(e){nt(D.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||et(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:N,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=He(a),l=s,u=a===`value`?l:Zu(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,nt(D.uponSanitizeAttribute,e,r),u=r.attrValue,ye&&(c===`id`||c===`name`)&&Xu(u,be)!==0&&(Ze(a,e),u=be+u),R&&id(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){Ze(a,e);continue}if(c===`attributename`&&Ju(u,`href`)){Ze(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Ze(a,e);continue}if(!ue&&id(/\/>/i,u)){Ze(a,e);continue}de&&Bu([O,ee,k],e=>{u=Yu(u,e,` `)});let d=He(e.nodeName);if(!rt(d,c,u)){Ze(a,e);continue}if(b&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=b.createHTML(u);break;case`TrustedScriptURL`:u=b.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),et(e)?Xe(e):Hu(t.removed)}catch{Ze(a,e)}}nt(D.afterSanitizeAttributes,e,null)},st=function(e){let t=null,n=$e(e);for(nt(D.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)nt(D.uponSanitizeShadowNode,t,null),z(t),ot(t),t.content instanceof a&&st(t.content);nt(D.afterSanitizeShadowDOM,e,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(Pe=!e,Pe&&(e=`<!-->`),typeof e!=`string`&&!tt(e)&&(e=ud(e),typeof e!=`string`))throw ad(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(pe||Ke(n),t.removed=[],typeof e==`string`&&(Se=!1),Se){let t=e.nodeName;if(typeof t==`string`){let e=He(t);if(!M[e]||F[e])throw ad(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=Qe(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===Fd.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!he&&!de&&!fe&&e.indexOf(`<`)===-1)return b&&_e?b.createHTML(e):e;if(i=Qe(e),!i)return he?null:_e?x:``}i&&me&&Xe(i.firstChild);let u=$e(Se?e:i);for(;c=u.nextNode();)z(c),ot(c),c.content instanceof a&&st(c.content);if(Se)return e;if(he){if(de){i.normalize();let e=i.innerHTML;Bu([O,ee,k],t=>{e=Yu(e,t,` `)}),i.innerHTML=e}if(ge)for(l=w.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(N.shadowroot||N.shadowrootmode)&&(l=E.call(r,l,!0)),l}let d=fe?i.outerHTML:i.innerHTML;return fe&&M[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&id(Md,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
62
62
|
`+d),de&&Bu([O,ee,k],e=>{d=Yu(d,e,` `)}),b&&_e?b.createHTML(d):d},t.setConfig=function(){Ke(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),pe=!0},t.clearConfig=function(){Ue=null,pe=!1},t.isValidAttribute=function(e,t,n){return Ue||Ke({}),rt(He(e),He(t),n)},t.addHook=function(e,t){typeof t==`function`&&Uu(D[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=Vu(D[e],t);return n===-1?void 0:Wu(D[e],n,1)[0]}return Hu(D[e])},t.removeHooks=function(e){D[e]=[]},t.removeAllHooks=function(){D=Rd()},t}var Bd=zd(),Vd=({onClose:e})=>{let t=$i();return(0,Z.jsxs)(`div`,{className:Eu.highlightLoadingInfo,onClick:e,children:[(0,Z.jsx)(`div`,{className:Eu.highlightLoadingInfoCloseIcon,children:(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,children:(0,Z.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`})})}),(0,Z.jsxs)(`div`,{className:Eu.highlightLoadingInfoInnerContainer,children:[(0,Z.jsxs)(`div`,{className:Eu.highlightLoadingInfoContent,children:[(0,Z.jsx)(`h3`,{children:t(`source-infos.highlight-loading.title`)}),(0,Z.jsx)(`p`,{children:t(`source-infos.highlight-loading.description`)})]}),(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`#000000`,viewBox:`0 0 256 256`,children:(0,Z.jsx)(`path`,{d:`M253.66,106.34a8,8,0,0,0-11.32,0L192,156.69,107.31,72l50.35-50.34a8,8,0,1,0-11.32-11.32L96,60.69A16,16,0,0,0,93.18,79.5L72,100.69a16,16,0,0,0,0,22.62L76.69,128,18.34,186.34a8,8,0,0,0,3.13,13.25l72,24A7.88,7.88,0,0,0,96,224a8,8,0,0,0,5.66-2.34L136,187.31l4.69,4.69a16,16,0,0,0,22.62,0l21.19-21.18A16,16,0,0,0,203.31,168l50.35-50.34A8,8,0,0,0,253.66,106.34ZM93.84,206.85l-55-18.35L88,139.31,124.69,176ZM152,180.69,83.31,112,104,91.31,172.69,160Z`})})]})]})},Hd=({title:e,href:t,children:n})=>(0,Z.jsx)(`a`,{href:t,title:e,target:`_blank`,rel:`noopener noreferrer`,children:n}),Ud=({className:e,children:t,...n})=>(0,Z.jsx)(`a`,{className:z(Jc.button,Jc.buttonDefault,e),type:`button`,role:`button`,...n,children:t}),Wd=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,...e,children:(0,Z.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`})}),Gd=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,...e,children:(0,Z.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`})}),Kd=({type:e,...t})=>{switch(e){case`WEBSITE`:return(0,Z.jsx)(Gd,{...t});case`PDF`:return(0,Z.jsx)(Gc,{...t});case`DOCX`:return(0,Z.jsx)(Uc,{...t});case`TEXT`:return(0,Z.jsx)(Wd,{...t});default:return(0,Z.jsx)(Wc,{...t})}},qd=({url:e,knowledgeBaseType:t})=>{let n=$i();return(0,Z.jsx)(Ud,{className:Eu.openSourceButton,href:e,target:`_blank`,children:(0,Z.jsxs)(`div`,{className:Eu.sourceButtonLabel,children:[(0,Z.jsx)(`div`,{className:Eu.sourceHeaderIcon,children:(0,Z.jsx)(Kd,{type:t})}),(0,Z.jsx)(`p`,{children:n(`source-infos.open-source`)})]})})},Jd=({sourceInfos:{content:e,url:t,knowledgeBaseType:n,highlighted:r}})=>{let[i,a]=(0,x.useState)(!r);(0,x.useEffect)(()=>{r&&a(!1)},[r]);let o=Bd.sanitize(e,{USE_PROFILES:{html:!0}});return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:z(Eu.sourceContent,sl.markdown),children:[(0,Z.jsx)(Sc,{options:{overrides:{a:Hd}},children:o}),i&&(0,Z.jsx)(Vd,{onClose:()=>a(!1)})]}),(0,Z.jsx)(qd,{url:t,knowledgeBaseType:n})]})},Yd=``+new URL(`undraw_fixing-bugs-D_eYxJc6.svg`,import.meta.url).href,Xd=()=>{let e=$i();return(0,Z.jsxs)(`div`,{className:Eu.loadingError,children:[(0,Z.jsx)(`h1`,{children:e(`source-infos.error.title`)}),(0,Z.jsx)(`img`,{src:Yd,title:e(`source-infos.error.title`)}),(0,Z.jsx)(`p`,{children:e(`source-infos.error.info`)})]})},Zd=()=>(0,Z.jsx)(`div`,{className:Eu.loadingSourceInfos,children:(0,Z.jsx)(`svg`,{className:Eu.loading,xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,children:(0,Z.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`})})});function Qd({sourceInfos:e,onClose:t,threshold:n=100}){let r=(0,x.useRef)(null),[i,a]=(0,x.useState)(0),[o,s]=(0,x.useState)(!1),c=(0,x.useRef)(null),l=(0,x.useRef)(null),u=(0,x.useCallback)(e=>{c.current=e,s(!0)},[]),d=(0,x.useCallback)(e=>{if(c.current!==null&&o){let t=e-c.current;t>0&&a(t)}},[o]),f=(0,x.useCallback)(()=>{s(!1),i>n&&t(),a(0),c.current=null},[i,n,t]),p=(0,x.useCallback)(e=>{let t=e=>u(e.touches[0].clientY),n=e=>d(e.touches[0].clientY),r=()=>f(),i=e=>{e.preventDefault(),u(e.clientY),window.addEventListener(`mousemove`,a),window.addEventListener(`mouseup`,o)},a=e=>d(e.clientY),o=()=>{f(),window.removeEventListener(`mousemove`,a),window.removeEventListener(`mouseup`,o)};e.addEventListener(`touchstart`,t),e.addEventListener(`touchmove`,n),e.addEventListener(`touchend`,r),e.addEventListener(`mousedown`,i),l.current=()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchmove`,n),e.removeEventListener(`touchend`,r),e.removeEventListener(`mousedown`,i),window.removeEventListener(`mousemove`,a),window.removeEventListener(`mouseup`,o)}},[u,d,f]);return(0,x.useEffect)(()=>{let e;return r.current?(l.current?.(),p(r.current)):(e=new MutationObserver(()=>{r.current&&(l.current?.(),p(r.current),e?.disconnect())}),e.observe(document.body,{childList:!0,subtree:!0})),()=>{e?.disconnect(),l.current?.()}},[p,e]),{ref:r,dragOffsetY:i,isDragging:o}}var $d=e=>{let[t,n]=(0,x.useState)(!0);return(0,x.useEffect)(()=>{let t=null;return e?.type===`loading`?(n(!0),t=setTimeout(()=>{n(!1)},300)):n(!e),()=>{t&&clearTimeout(t)}},[e]),t},ef=()=>{let e=Zi(),t=Qi(e=>e.chat.sourceInfos),n=Tu(),r=(0,x.useRef)(null),i=$d(t);(0,x.useEffect)(()=>{r.current&&t?.type===`loading`&&(n?r.current.showModal():(r.current.setAttribute(`open`,`true`),r.current?.focus()))},[t,n]);let a=(0,x.useCallback)(()=>{r.current&&(n?r.current.close():r.current.removeAttribute(`open`),e(Mi()))},[e,n]),{ref:o,dragOffsetY:s}=Qd({onClose:a,sourceInfos:t});return t?(0,Z.jsx)(`dialog`,{ref:r,className:z(Eu.sourceInfos,i?Eu.waitForLoading:t.type===`loading`?Eu.loadingContent:``),style:n&&s?{transform:`translateY(${s}px)`}:{},onClose:a,autoFocus:!0,role:`dialog`,"aria-labelledby":`source-info-title`,children:i?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ou,{ref:o,tabIndex:-1,sourceInfos:t.type===`loaded`?t:void 0,onClose:a}),t.type===`loading`?(0,Z.jsx)(Zd,{}):t.type===`loading-error`?(0,Z.jsx)(Xd,{}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ku,{loading:!t.highlighted}),(0,Z.jsx)(Jd,{sourceInfos:t})]})]})}):null},tf={container:`_container_5axup_1`,body:`_body_5axup_7`,intro:`_intro_5axup_14`,footer:`_footer_5axup_48`,footnote:`_footnote_5axup_52`,containerWithFootnote:`_containerWithFootnote_5axup_72`,startChatButton:`_startChatButton_5axup_87`,spinner:`_spinner_5axup_102`,spin:`_spin_5axup_102`,formFields:`_formFields_5axup_106`,formField:`_formField_5axup_106`,radio:`_radio_5axup_118`,checkbox:`_checkbox_5axup_125`,input:`_input_5axup_133`,inputLabel:`_inputLabel_5axup_167`,selectWrapper:`_selectWrapper_5axup_171`,select:`_select_5axup_171`,selectLabel:`_selectLabel_5axup_217`},nf=({name:e,label:t,defaultValue:n,required:r,onChange:i})=>(0,Z.jsxs)(`label`,{className:z(tf.checkbox,`chat__startScreen__checkbox`),htmlFor:e,children:[(0,Z.jsx)(`input`,{type:`checkbox`,id:e,name:e,defaultChecked:n===`true`,required:r,onChange:e=>{i(e.currentTarget.checked?`true`:`false`)}}),(0,Z.jsx)(`div`,{children:t})]}),rf=({type:e,name:t,label:n,defaultValue:r,placeholder:i,required:a,multiple:o,min:s,max:c,pattern:l,onChange:u})=>(0,Z.jsxs)(`label`,{className:z(tf.input,`chat__startScreen__input`),htmlFor:t,children:[(0,Z.jsx)(`div`,{className:z(tf.inputLabel),children:n}),(0,Z.jsx)(`input`,{type:e,id:t,name:t,defaultValue:r,placeholder:i,required:a,multiple:o,min:s,max:c,pattern:l,onChange:e=>{u(e.target.value)}})]}),af=({name:e,value:t,label:n,defaultChecked:r,required:i,onChange:a})=>{let o=`${e}-${t}`;return(0,Z.jsxs)(`label`,{className:z(tf.radio,`chat__startScreen__radio`),htmlFor:o,children:[(0,Z.jsx)(`input`,{id:o,type:`radio`,name:e,value:t,defaultChecked:r,required:i,onChange:e=>{a(e.target.value)}}),(0,Z.jsx)(`span`,{className:z(tf.label),children:n})]})},of=({name:e,label:t,defaultValue:n,required:r,multiple:i,options:a,onChange:o})=>(0,Z.jsxs)(`label`,{className:z(tf.select,`chat__startScreen__select`),htmlFor:e,children:[(0,Z.jsx)(`div`,{className:z(tf.selectLabel),children:t}),(0,Z.jsx)(`div`,{className:z(tf.selectWrapper),children:(0,Z.jsx)(`select`,{id:e,name:e,defaultValue:n,required:r,multiple:i,onChange:e=>{o(e.target.value)},children:Object.entries(a||{}).map(([e,t])=>(0,Z.jsx)(`option`,{value:e,selected:t===n,children:t}))})})]}),sf=`start-screen.intro`,cf=`start-screen.start-chat`,lf=`start-screen.waiting-for-login`,uf=`start-screen.footnote`,df=`start-screen.form`,ff=`${df}.fields`,pf=()=>{let e=$i(),t=Zi(),n=ol(),r=Qi(e=>e.startScreen.loginRequestToken),i=Qi(e=>e.settings.requiresUserAuthentication);(0,x.useEffect)(()=>{let e;if(r){let i=window.screenX+(window.outerWidth-600)/2,a=window.screenY+(window.outerHeight-700)/2,o=encodeURIComponent(n),s=new URL(window.location.origin);s.pathname=`/${o}/auth/login`,s.searchParams.set(`loginRequestToken`,r);let c=window.open(s.href,`Login`,`width=600,height=700,left=${i},top=${a},resizable=yes,scrollbars=yes`);e=setInterval(()=>{c?.closed&&(t(yi()),clearInterval(e))},500)}return()=>{e&&clearInterval(e)}},[n,r,t]);let[a,o]=(0,x.useState)({}),s=()=>{let e=Object.entries(a).reduce((e,[t,n])=>({...e,[t]:n.value}),{});t(i?vi({loginRequestToken:Jt(),formValues:e}):hi({formValues:e}))},c=e(sf),l=e(r?lf:cf),u=e(uf),d=(0,x.useMemo)(()=>e(ff)?.split(`;`).map(e=>e.trim())??[],[e(ff)]);(0,x.useEffect)(()=>{d.length&&Object.keys(a).length===0&&o(d.reduce((t,n)=>({...t,[n]:hf(n,e)}),{}))},[e,d,a]);let f=e=>{e.preventDefault(),s()},p=e=>t=>{o(n=>({...n,[e]:{...n[e],value:t}}))};return(0,Z.jsxs)(`form`,{onSubmit:f,className:z(tf.container,u&&tf.containerWithFootnote,`chat__startScreen`),children:[(0,Z.jsxs)(`div`,{className:z(tf.body,`chat__startScreen__body`),children:[c&&(0,Z.jsx)(`div`,{className:z(tf.intro,`chat__startScreen__intro`),children:(0,Z.jsx)(Sc,{options:{overrides:{a:mf}},children:c})}),(0,Z.jsx)(`div`,{className:z(tf.formFields,`chat__startScreen__fields`),children:Object.values(a).map(({type:e,name:t,label:n,placeholder:r,defaultValue:i,options:a,required:o,multiple:s,min:c,max:l,pattern:u})=>(0,Z.jsx)(`div`,{className:z(tf.formField,`chat__startScreen__field`),children:(()=>{switch(e){case`radio`:return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{children:n}),Object.entries(a||{}).map(([e,n])=>(0,Z.jsx)(af,{name:t,value:e,label:n,defaultChecked:e===i,required:o,onChange:p(t)},e))]});case`checkbox`:return(0,Z.jsx)(nf,{name:t,label:n,defaultValue:i,required:o,onChange:p(t)});case`select`:return(0,Z.jsx)(of,{name:t,label:n,defaultValue:i,required:o,multiple:s,options:a,onChange:p(t)});default:return(0,Z.jsx)(rf,{type:e,name:t,label:n,placeholder:r,defaultValue:i,required:o,multiple:s,min:c,max:l,pattern:u,onChange:p(t)})}})()},t))})]}),(0,Z.jsxs)(`div`,{className:z(tf.footer,`chat__startScreen__footer`),children:[(0,Z.jsxs)(Ml,{type:`submit`,className:tf.startChatButton,disabled:!!r,children:[!!r&&(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,viewBox:`0 0 256 256`,className:tf.spinner,children:(0,Z.jsx)(`path`,{d:`M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm88,88H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z`})}),(0,Z.jsx)(`div`,{children:l})]}),u&&(0,Z.jsx)(`div`,{className:tf.footnote,children:(0,Z.jsx)(Sc,{options:{overrides:{a:mf}},children:u})})]})]})},mf=({title:e,href:t,children:n})=>(0,Z.jsx)(`a`,{href:t,title:e,target:`_blank`,rel:`noopener noreferrer`,children:n}),hf=(e,t)=>{let n=t(`${df}.${e}.type`)||`text`,r=t(`${df}.${e}.required`)===`true`,i=t(`${df}.${e}.multiple`)===`true`,a=t(`${df}.${e}.placeholder`),o=t(`${df}.${e}.label`)||``,s=t(`${df}.${e}.defaultValue`),c=t(`${df}.${e}.min`),l=t(`${df}.${e}.max`),u=t(`${df}.${e}.pattern`),d=_f(t(`${df}.${e}.options`));return{name:e,label:o,placeholder:a,value:gf(n,s,d)||``,defaultValue:s,options:d,type:n,required:r,multiple:i,min:c,max:l,pattern:u}},gf=(e,t,n)=>t||e===`select`&&Object.keys(n)[0]||``,_f=(e=``)=>e.split(`;`).map(e=>e.trim()).reduce((e,t)=>{let[n,r]=t.split(`:`).map(e=>e.trim());return{...e,[n]:r}},{}),vf=()=>{let e=Qi(e=>e.intl.locale);(0,x.useEffect)(()=>{window.document.documentElement.lang=e},[e])},yf={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`},bf=({clientName:e})=>{vf();let t=Zi(),n=Qi(e=>e.intl.messages),r=$i(),i=Qi(e=>e.settings.enableStartScreen),a=Qi(e=>e.startScreen.startScreenStatus),o=Qi(e=>e.connection.queryString),s=Qi(e=>e.settings.allowedEmbedOrigins),c=(0,x.useMemo)(()=>new URLSearchParams(o||`?`).get(`cssClassName`),[o]);(0,x.useEffect)(()=>{let n=new URLSearchParams(o||``);t(Hi(e,Object.fromEntries(n.entries())))},[e,o,t]),(0,x.useEffect)(()=>{let e=e=>{if(!e.data?.type||!Object.values(yf).includes(e.data.type))return;let n=e.origin===window.location.origin,r=e.source===window.parent,i=s===void 0||s.includes(e.origin);if(!(n||r&&i)){console.warn(`Rejected postMessage from untrusted origin:`,e.origin);return}switch(e.data.type){case yf.TRIGGER_ACTION:t(e.data.action);break;case yf.TRIGGER_STORY:t(Ft(e.data.story));break;case yf.ON_CHAT_WINDOW_OPEN:t({type:`webclient.chatwindow.opened`});break;case yf.ON_CHAT_WINDOW_CLOSE:t({type:`webclient.chatwindow.closed`});break;case yf.CHAT_MESSAGE_FROM_GUEST:t(ht(e.data.text));break;case yf.RESTART_CHAT:t(Yi());break}};return window.addEventListener(`message`,e,!1),()=>window.removeEventListener(`message`,e)},[s,t]),(0,x.useEffect)(()=>{let e=r(`page.title`);e&&document&&(document.title=e)},[n,r]);let l=i===void 0,u=i===!1||a===`HIDDEN`;return(0,Z.jsx)(`div`,{className:z(wu.chatwindow,u&&wu.chatwindowWithAside,`chat__chatwindow`,c),children:l?null:u?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`header`,{children:(0,Z.jsx)(Cu,{chatStarted:!0})}),(0,Z.jsx)(`main`,{children:(0,Z.jsx)(mu,{clientName:e})}),(0,Z.jsx)(`aside`,{children:(0,Z.jsx)(ef,{})})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`header`,{children:(0,Z.jsx)(Cu,{chatStarted:!1})}),(0,Z.jsx)(`main`,{children:(0,Z.jsx)(pf,{})})]})})},xf=()=>{let e=ol(),t=Tu();return(0,Z.jsx)(`div`,{className:z([rt.app,t?`chat__small`:`chat__large`]),children:(0,Z.jsx)(bf,{clientName:e})})},Sf={"page.title":`Bubble Chat Chatbot`,"message-input-label":`Benutzereingabe`,"message-input-placeholder":`Nachricht eingeben`,"message-input.actions.submit.label":`Nachricht senden`,"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`,"message-input.actions.command.label":`Aktion ausführen`,"guest-bubble.label":`Ihre Nachricht`,"bot-bubble.label":`Nachricht des Chatbots`,"bot-bubble.actions.label":`Nachricht-Aktionen`,"bot-bubble.reaction.good":`Gefällt mir`,"bot-bubble.reaction.bad":`Gefällt mir nicht`,"bot-bubble.reaction.remove":`Markierung entfernen`,"bot-bubble.reaction.say-more":`Erzähle mir bitte mehr`,"bot-bubble.reaction.category.WRONG_INFORMATION":`Falsch`,"bot-bubble.reaction.category.MISSING_INFORMATION":`Unvollständig`,"bot-bubble.reaction.category.OLD_INFORMATION":`Veraltet`,"bot-bubble.reaction.category.UNCLEAR":`Unklar`,"bot-bubble.reaction.category.OFF_TOPIC":`Nicht zur Frage passend`,"bot-bubble.reaction.comment":`Gedanken mit mir teilen...`,"bot-bubble.reaction.close":`Schliessen`,"bot-bubble.copy":`Kopieren`,"bot-bubble.sources":`Quellenliste`,"bot-bubble.source.open":`Quelle öffnen`,"bot-bubble.footnote":`Fussnote`,"agent-bubble.label":`Nachricht des Live-Agenten`,"conversation.label":`Chat Verlauf`,"chatbot.typing":`Chatbot schreibt`,"export-transcript.email.title":`Chatverlauf per E-Mail versenden`,"export-transcript.email.description":`Bitte E-Mail-Adresse angeben, an die der Chatverlauf gesendet werden soll.`,"export-transcript.email.cancel":`Abbrechen`,"export-transcript.email.send":`Senden`,"export-transcript.email.placeholder":`E-Mail-Adresse`,"export-transcript.email.invalid":`Bitte gültige E-Mail-Adresse eingeben.`,"export-transcript.email.success":`Der Chatverlauf wurde an die hinterlegte E-Mail-Adresse übermittelt.`,"general-conditions.header":`**Nutzungsbedingungen**`,"general-conditions.body":`Bitte berücksichtigen Sie die folgenden Punkte:
|
|
63
63
|
|
|
64
64
|
- Der Chatverlauf wird im EU-Raum gespeichert und kann nur von autorisierten Personen eingesehen werden.
|
|
@@ -72,4 +72,4 @@ ${w.current.stack}
|
|
|
72
72
|
|
|
73
73
|
- La cronologia delle chat è memorizzata nell'area UE e può essere visualizzata solo da persone autorizzate.
|
|
74
74
|
- 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.back-to-chat":`Chiudere`,"conversation-rating.overlay.action.close-chat":`Minimizzare la chat`,"conversation-rating.overlay.action.restart-chat":`Riavviare la chat`,"conversation-rating.overlay.action.cancel":`Annulla`,"start-screen.intro":``,"start-screen.start-chat":`Avviare la chat`,"start-screen.waiting-for-login":`In attesa di login ...`,"header.close-chat":`Minimizzare la chat`,"header.menu.title":`Menu`,"header.menu.restart-chat":`Riavviare la chat`,"header.menu.expand-chat-window":`Espandere la finestra`,"header.menu.download-transcript":`Scaricare la trascrizione`,"header.menu.send-transcript":`Inviare la trascrizione`,"header.menu.export-transcript":`Esportare la trascrizione`,"header.menu.rate-conversation":`Valutare la conversazione`,"source-infos.close":`Chiudere`,"source-infos.open-source":`Fonte aperta`,"source-infos.error.title":`Errore`,"source-infos.error.info":`Ops! Qualcosa è andato storto. Riprovare o contattare l'assistenza se il problema persiste.`,"source-infos.highlight-loading.title":`Il contenuto rilevante è evidenziato...`,"source-infos.highlight-loading.description":`Un momento - la fonte è in fase di analisi`,"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`},Df=[`de`,`en`,`fr`,`it`],Of={locale:`de`,messages:Sf},kf=(e,t)=>{if(Df.includes(e)){let n=Af(e),r=wf(t);return{...n,...r}}return t},Af=e=>{switch(e.toString()){case`en`:return Cf;case`fr`:return Tf;case`it`:return Ef;default:return Sf}},jf=(e=Mf,t)=>{switch(t.type){case Pi:return Object.assign({},e,{connectionState:ea.CONNECTING});case Fi:return Object.assign({},e,{connectionState:ea.CONNECTED});case Ii:return Object.assign({},e,{connectionState:ea.DISCONNECTED});case Li:return Object.assign({},e,{connectionState:ea.RECONNECTED});case Ri:return Object.assign({},e,{sessionId:t.sessionId});case zi:return Object.assign({},e,{sessionId:t.payload.sessionId,userId:t.payload.userId});case Bi:return Object.assign({},e,{sessionId:void 0});default:return e}},Mf={connectionState:ea.DISCONNECTED,sessionId:void 0,userId:void 0,queryString:window.location.search},Nf=(e=Rf,t)=>{switch(t.type){case xi:return Rf;case zi:return Ff({type:`webclient.chat.started`}),e;case Bi:return Ff({type:`webclient.chat.ended`}),e;case it.TYPING_ON:return Object.assign({},e,{isBotTyping:!0});case it.TYPING_OFF:return Object.assign({},e,{isBotTyping:!1});case it.MESSAGE_FROM_GUEST:case it.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return Pf(e,t.message,t.meta);case it.MESSAGE_TO_GUEST:{Ff(t);let n=Object.assign({},t.message,{_id:t.meta.actionId}),r=e.messages.filter(e=>e._id===t.meta.actionId).length>0;return Object.assign({},e,{isBotTyping:!1,messages:r?e.messages:e.messages.concat([n]),quickReplies:n.quickReplies?n.quickReplies:[]})}case _t:{let n=t.messages,r=n.length?n[n.length-1]:void 0;return Object.assign({},e,{isBotTyping:!1,messages:n,quickReplies:r?.quickReplies||[]})}case gt:return Ff(t.message),e;case it.EVENT_TO_GUEST:return Ff(t.event),e;case it.DRAWER_OPEN:return Object.assign({},e,{drawerContentUrl:t.payload.parameters.contentUrl});case it.DRAWER_CLOSE:return Object.assign({},e,{drawerContentUrl:void 0});case it.GUEST_LOCALE_CHANGED:return Object.assign({},e,{locale:t.payload.locale});case Tt:return Ff(t),e;case Et:return Ff(t),{...e,conversationRating:{...e.conversationRating,opener:void 0}};case yt:{let n=new ft(t.transcription,new ut);return Pf(e,Object.assign({},n,{_id:Jt()}))}case it.TRANSCRIPT_ITEM_GUEST_REACTION:{let n=e.messages.map(e=>e._id===t.payload.actionId?Object.assign({},e,t.payload.reaction?{reaction:{type:t.payload.reaction,category:t.payload.category,comment:t.payload.comment}}:{reaction:void 0}):e);return Object.assign({},e,{messages:n})}case bt:{let n={enabled:!0,rating:t.payload.rating};return Object.assign({},e,{conversationRating:n})}case it.CONVERSATION_RATING_FROM_GUEST:{let n={...e.conversationRating,rating:t.payload};return Object.assign({},e,{conversationRating:n})}case Ci:{let n={...e.conversationRating,opener:t.payload.opener,...t.payload.defaultRating?{rating:{value:t.payload.defaultRating,feedback:e.conversationRating.rating?.feedback||``}}:{}};return Object.assign({},e,{conversationRating:n})}case wi:{let t={...e.conversationRating,opener:void 0};return Object.assign({},e,{conversationRating:t})}case Ct:return{...e,sourceInfos:{type:`loading`,chunkId:t.payload.chunkId}};case St:{let{highlighted:n}=t.payload;return e.sourceInfos?.type===`loaded`&&n?{...e,sourceInfos:{...e.sourceInfos,highlighted:!0}}:{...e,sourceInfos:{type:`loading-error`}}}case xt:{let n=e.sourceInfos?.type,{chunkId:r,knowledgeBaseType:i,title:a,content:o,highlighted:s,url:c}=t.payload,l=e.sourceInfos?.type===`loading`||e.sourceInfos?.type===`loaded`?e.sourceInfos?.chunkId:void 0;return l&&l!==r?e:n===`loading`||n===`loaded`&&s?{...e,sourceInfos:{type:`loaded`,chunkId:r,knowledgeBaseType:i,title:a,content:o,highlighted:s,url:c}}:e}case wt:return{...e,sourceInfos:void 0};case Si:return{...e,showTranscriptMailOverlay:!e.showTranscriptMailOverlay,conversationRating:{...e.conversationRating,opener:void 0}};default:return e}},Pf=(e,t,n)=>{let r=e.messages[e.messages.length-1],i=r?.text===t.text,a=!!n?.actionId,o=r&&!r._id&&r.sender.type===t.sender.type;if(a&&o){let r=Object.assign({},t,{_id:n.actionId}),i=[...e.messages];return i[i.length-1]=r,Object.assign({},e,{messages:i,quickReplies:[]})}return r&&r.sender.type===t.sender.type&&i?e:Object.assign({},e,{messages:e.messages.concat([t]),quickReplies:[]})},Ff=e=>{if(Lf()){let t=If();window.top?.postMessage(e,t)}else e.type===`webclient.change.url`&&window.open(e.url)},If=()=>{try{return document.referrer?new URL(document.referrer).origin:`*`}catch{return`*`}},Lf=()=>typeof window<`u`&&window.self!==window.top,Rf={messages:[],quickReplies:[],isBotTyping:!1,showTranscriptMailOverlay:!1,conversationRating:{enabled:!1}},zf=$r({name:`intl`,initialState:Of,reducers:{updateIntl:(e,t)=>{e.locale=t.payload.language,e.messages=t.payload.messages}}}),{updateIntl:Bf}=zf.actions,Vf=zf.reducer,Hf=$r({name:`settings`,initialState:{version:void 0,requiresUserAuthentication:!1,enableStartScreen:void 0,enableStandaloneView:!1,enableTranscriptExportEmail:!1,enableTranscriptExportPdf:!1,enableGeneralConditions:!1,enableSpeechSupport:!1,commands:[],menuItems:[],allowedEmbedOrigins:[]},reducers:{setSettings(e,t){e.version&&e.version!==t.payload.version?(console.log(`version changed, reloading chat window`),window.location.reload()):(e.version=t.payload.version,e.requiresUserAuthentication=t.payload.requiresUserAuthentication,e.enableStartScreen=t.payload.enableStartScreen,e.enableStandaloneView=t.payload.enableStandaloneView,e.enableTranscriptExportEmail=t.payload.enableTranscriptExportEmail,e.enableTranscriptExportPdf=t.payload.enableTranscriptExportPdf,e.enableGeneralConditions=t.payload.enableGeneralConditions,e.enableSpeechSupport=t.payload.enableSpeechSupport,e.commands=t.payload.commands,e.menuItems=t.payload.menuItems||[],e.allowedEmbedOrigins=t.payload.allowedEmbedOrigins)}}}),{setSettings:Uf}=Hf.actions,Wf=Hf.reducer,Gf=on({settings:Wf,chat:Nf,startScreen:bi,connection:jf,intl:Vf}),Kf=`bubble-chat`,qf=`state-last-saved-at`,Jf=`state`,Yf=e=>{try{if(!Qf()||Zf($f(e,qf)))return;{let t=$f(e,Jf);if(t===null)return;let n=JSON.parse(t),r=n.connection?.queryString;if(r!==void 0&&!np(r,window.location.search)){console.log(`Ignoring persisted state due to different query string`);return}else return n}}catch(e){console.error(e);return}},Xf=(e,t)=>{try{ep(e,Jf,JSON.stringify(t)),ep(e,qf,new Date().toISOString())}catch(e){console.error(e)}},Zf=e=>{if(e===null)return!1;let t=new Date(e);return t.setHours(t.getHours()+12),new Date>t},Qf=()=>typeof localStorage<`u`,$f=(e,t)=>{let n=tp(e,t);return localStorage.getItem(n)},ep=(e,t,n)=>{let r=tp(e,t);return localStorage.setItem(r,n)},tp=(e,t)=>`${Kf}-${e}-${t}`,np=(e,t)=>{let n=new URLSearchParams(e),r=new URLSearchParams(t);n.delete(`referrer`),r.delete(`referrer`);let i=Array.from(n.entries()).sort(),a=Array.from(r.entries()).sort();return i.length===a.length?i.every(([e,t],n)=>{let[r,i]=a[n];return e===r&&t===i}):!1},rp=Object.create(null);rp.open=`0`,rp.close=`1`,rp.ping=`2`,rp.pong=`3`,rp.message=`4`,rp.upgrade=`5`,rp.noop=`6`;var ip=Object.create(null);Object.keys(rp).forEach(e=>{ip[rp[e]]=e});var ap={type:`error`,data:`parser error`},op=typeof Blob==`function`||typeof Blob<`u`&&Object.prototype.toString.call(Blob)===`[object BlobConstructor]`,sp=typeof ArrayBuffer==`function`,cp=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,lp=({type:e,data:t},n,r)=>op&&t instanceof Blob?n?r(t):up(t,r):sp&&(t instanceof ArrayBuffer||cp(t))?n?r(t):up(new Blob([t]),r):r(rp[e]+(t||``)),up=(e,t)=>{let n=new FileReader;return n.onload=function(){let e=n.result.split(`,`)[1];t(`b`+(e||``))},n.readAsDataURL(e)};function dp(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var fp;function pp(e,t){if(op&&e.data instanceof Blob)return e.data.arrayBuffer().then(dp).then(t);if(sp&&(e.data instanceof ArrayBuffer||cp(e.data)))return t(dp(e.data));lp(e,!1,e=>{fp||=new TextEncoder,t(fp.encode(e))})}var mp=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,hp=typeof Uint8Array>`u`?[]:new Uint8Array(256);for(let e=0;e<64;e++)hp[mp.charCodeAt(e)]=e;var gp=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);let l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=hp[e.charCodeAt(r)],o=hp[e.charCodeAt(r+1)],s=hp[e.charCodeAt(r+2)],c=hp[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},_p=typeof ArrayBuffer==`function`,vp=(e,t)=>{if(typeof e!=`string`)return{type:`message`,data:bp(e,t)};let n=e.charAt(0);return n===`b`?{type:`message`,data:yp(e.substring(1),t)}:ip[n]?e.length>1?{type:ip[n],data:e.substring(1)}:{type:ip[n]}:ap},yp=(e,t)=>_p?bp(gp(e),t):{base64:!0,data:e},bp=(e,t)=>{switch(t){case`blob`:return e instanceof Blob?e:new Blob([e]);default:return e instanceof ArrayBuffer?e:e.buffer}},xp=``,Sp=(e,t)=>{let n=e.length,r=Array(n),i=0;e.forEach((e,a)=>{lp(e,!1,e=>{r[a]=e,++i===n&&t(r.join(xp))})})},Cp=(e,t)=>{let n=e.split(xp),r=[];for(let e=0;e<n.length;e++){let i=vp(n[e],t);if(r.push(i),i.type===`error`)break}return r};function wp(){return new TransformStream({transform(e,t){pp(e,n=>{let r=n.length,i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);let e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{i=new Uint8Array(9);let e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!=`string`&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}var Tp;function Ep(e){return e.reduce((e,t)=>e+t.length,0)}function Dp(e,t){if(e[0].length===t)return e.shift();let n=new Uint8Array(t),r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Op(e,t){Tp||=new TextDecoder;let n=[],r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(Ep(n)<1)break;let e=Dp(n,1);a=(e[0]&128)==128,i=e[0]&127,r=i<126?3:i===126?1:2}else if(r===1){if(Ep(n)<2)break;let e=Dp(n,2);i=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(r===2){if(Ep(n)<8)break;let e=Dp(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),a=t.getUint32(0);if(a>2**21-1){s.enqueue(ap);break}i=a*2**32+t.getUint32(4),r=3}else{if(Ep(n)<i)break;let e=Dp(n,i);s.enqueue(vp(a?e:Tp.decode(e),t)),r=0}if(i===0||i>e){s.enqueue(ap);break}}}})}function kp(e){if(e)return Ap(e)}function Ap(e){for(var t in kp.prototype)e[t]=kp.prototype[t];return e}kp.prototype.on=kp.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[`$`+e]=this._callbacks[`$`+e]||[]).push(t),this},kp.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},kp.prototype.off=kp.prototype.removeListener=kp.prototype.removeAllListeners=kp.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks[`$`+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks[`$`+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks[`$`+e],this},kp.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),n=this._callbacks[`$`+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},kp.prototype.emitReserved=kp.prototype.emit,kp.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[`$`+e]||[]},kp.prototype.hasListeners=function(e){return!!this.listeners(e).length};var jp=typeof Promise==`function`&&typeof Promise.resolve==`function`?e=>Promise.resolve().then(e):(e,t)=>t(e,0),Mp=typeof self<`u`?self:typeof window<`u`?window:Function(`return this`)(),Np=`arraybuffer`;function Pp(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}var Fp=Mp.setTimeout,Ip=Mp.clearTimeout;function Lp(e,t){t.useNativeTimers?(e.setTimeoutFn=Fp.bind(Mp),e.clearTimeoutFn=Ip.bind(Mp)):(e.setTimeoutFn=Mp.setTimeout.bind(Mp),e.clearTimeoutFn=Mp.clearTimeout.bind(Mp))}var Rp=1.33;function zp(e){return typeof e==`string`?Bp(e):Math.ceil((e.byteLength||e.size)*Rp)}function Bp(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Vp(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Hp(e){let t=``;for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+=`&`),t+=encodeURIComponent(n)+`=`+encodeURIComponent(e[n]));return t}function Up(e){let t={},n=e.split(`&`);for(let e=0,r=n.length;e<r;e++){let r=n[e].split(`=`);t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}var Wp=class extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type=`TransportError`}},Gp=class extends kp{constructor(e){super(),this.writable=!1,Lp(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved(`error`,new Wp(e,t,n)),this}open(){return this.readyState=`opening`,this.doOpen(),this}close(){return(this.readyState===`opening`||this.readyState===`open`)&&(this.doClose(),this.onClose()),this}send(e){this.readyState===`open`&&this.write(e)}onOpen(){this.readyState=`open`,this.writable=!0,super.emitReserved(`open`)}onData(e){let t=vp(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved(`packet`,e)}onClose(e){this.readyState=`closed`,super.emitReserved(`close`,e)}pause(e){}createUri(e,t={}){return e+`://`+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(`:`)===-1?e:`[`+e+`]`}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?`:`+this.opts.port:``}_query(e){let t=Hp(e);return t.length?`?`+t:``}},Kp=class extends Gp{constructor(){super(...arguments),this._polling=!1}get name(){return`polling`}doOpen(){this._poll()}pause(e){this.readyState=`pausing`;let t=()=>{this.readyState=`paused`,e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once(`pollComplete`,function(){--e||t()})),this.writable||(e++,this.once(`drain`,function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved(`poll`)}onData(e){Cp(e,this.socket.binaryType).forEach(e=>{if(this.readyState===`opening`&&e.type===`open`&&this.onOpen(),e.type===`close`)return this.onClose({description:`transport closed by the server`}),!1;this.onPacket(e)}),this.readyState!==`closed`&&(this._polling=!1,this.emitReserved(`pollComplete`),this.readyState===`open`&&this._poll())}doClose(){let e=()=>{this.write([{type:`close`}])};this.readyState===`open`?e():this.once(`open`,e)}write(e){this.writable=!1,Sp(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved(`drain`)})})}uri(){let e=this.opts.secure?`https`:`http`,t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=Vp()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}},qp=!1;try{qp=typeof XMLHttpRequest<`u`&&`withCredentials`in new XMLHttpRequest}catch{}var Jp=qp;function Yp(){}var Xp=class extends Kp{constructor(e){if(super(e),typeof location<`u`){let t=location.protocol===`https:`,n=location.port;n||=t?`443`:`80`,this.xd=typeof location<`u`&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){let n=this.request({method:`POST`,data:e});n.on(`success`,t),n.on(`error`,(e,t)=>{this.onError(`xhr post error`,e,t)})}doPoll(){let e=this.request();e.on(`data`,this.onData.bind(this)),e.on(`error`,(e,t)=>{this.onError(`xhr poll error`,e,t)}),this.pollXhr=e}},Zp=class e extends kp{constructor(e,t,n){super(),this.createRequest=e,Lp(this,n),this._opts=n,this._method=n.method||`GET`,this._uri=t,this._data=n.data===void 0?null:n.data,this._create()}_create(){var t;let n=Pp(this._opts,`agent`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`autoUnref`);n.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}}catch{}if(this._method===`POST`)try{r.setRequestHeader(`Content-type`,`text/plain;charset=UTF-8`)}catch{}try{r.setRequestHeader(`Accept`,`*/*`)}catch{}(t=this._opts.cookieJar)==null||t.addCookies(r),`withCredentials`in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;r.readyState===3&&((e=this._opts.cookieJar)==null||e.parseCookies(r.getResponseHeader(`set-cookie`))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status==`number`?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}typeof document<`u`&&(this._index=e.requestsCount++,e.requests[this._index]=this)}_onError(e){this.emitReserved(`error`,e,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(this._xhr===void 0||this._xhr===null)){if(this._xhr.onreadystatechange=Yp,t)try{this._xhr.abort()}catch{}typeof document<`u`&&delete e.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved(`data`,e),this.emitReserved(`success`),this._cleanup())}abort(){this._cleanup()}};if(Zp.requestsCount=0,Zp.requests={},typeof document<`u`){if(typeof attachEvent==`function`)attachEvent(`onunload`,Qp);else if(typeof addEventListener==`function`){let e=`onpagehide`in Mp?`pagehide`:`unload`;addEventListener(e,Qp,!1)}}function Qp(){for(let e in Zp.requests)Zp.requests.hasOwnProperty(e)&&Zp.requests[e].abort()}var $p=(function(){let e=tm({xdomain:!1});return e&&e.responseType!==null})(),em=class extends Xp{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=$p&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Zp(tm,this.uri(),e)}};function tm(e){let t=e.xdomain;try{if(typeof XMLHttpRequest<`u`&&(!t||Jp))return new XMLHttpRequest}catch{}if(!t)try{return new Mp[[`Active`,`Object`].join(`X`)](`Microsoft.XMLHTTP`)}catch{}}var nm=typeof navigator<`u`&&typeof navigator.product==`string`&&navigator.product.toLowerCase()===`reactnative`,rm=class extends Gp{get name(){return`websocket`}doOpen(){let e=this.uri(),t=this.opts.protocols,n=nm?{}:Pp(this.opts,`agent`,`perMessageDeflate`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`localAddress`,`protocolVersion`,`origin`,`maxPayload`,`family`,`checkServerIdentity`);this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(e){return this.emitReserved(`error`,e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:`websocket connection closed`,context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError(`websocket error`,e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;lp(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch{}r&&jp(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){this.ws!==void 0&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?`wss`:`ws`,t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Vp()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},im=Mp.WebSocket||Mp.MozWebSocket,am={websocket:class extends rm{createSocket(e,t,n){return nm?new im(e,t,n):t?new im(e,t):new im(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends Gp{get name(){return`webtransport`}doOpen(){try{this._transport=new WebTransport(this.createUri(`https`),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved(`error`,e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError(`webtransport error`,e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=Op(2**53-1,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=wp();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();let i=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),i())}).catch(e=>{})};i();let a={type:`open`};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&jp(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)==null||e.close()}},polling:em},om=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,sm=[`source`,`protocol`,`authority`,`userInfo`,`user`,`password`,`host`,`port`,`relative`,`path`,`directory`,`file`,`query`,`anchor`];function cm(e){if(e.length>8e3)throw`URI too long`;let t=e,n=e.indexOf(`[`),r=e.indexOf(`]`);n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,`;`)+e.substring(r,e.length));let i=om.exec(e||``),a={},o=14;for(;o--;)a[sm[o]]=i[o]||``;return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,`:`),a.authority=a.authority.replace(`[`,``).replace(`]`,``).replace(/;/g,`:`),a.ipv6uri=!0),a.pathNames=lm(a,a.path),a.queryKey=um(a,a.query),a}function lm(e,t){let n=t.replace(/\/{2,9}/g,`/`).split(`/`);return(t.slice(0,1)==`/`||t.length===0)&&n.splice(0,1),t.slice(-1)==`/`&&n.splice(n.length-1,1),n}function um(e,t){let n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}var dm=typeof addEventListener==`function`&&typeof removeEventListener==`function`,fm=[];dm&&addEventListener(`offline`,()=>{fm.forEach(e=>e())},!1);var pm=class e extends kp{constructor(e,t){if(super(),this.binaryType=Np,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e==`object`&&(t=e,e=null),e){let n=cm(e);t.hostname=n.host,t.secure=n.protocol===`https`||n.protocol===`wss`,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=cm(t.host).host);Lp(this,t),this.secure=t.secure==null?typeof location<`u`&&location.protocol===`https:`:t.secure,t.hostname&&!t.port&&(t.port=this.secure?`443`:`80`),this.hostname=t.hostname||(typeof location<`u`?location.hostname:`localhost`),this.port=t.port||(typeof location<`u`&&location.port?location.port:this.secure?`443`:`80`),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{let t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),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},t),this.opts.path=this.opts.path.replace(/\/$/,``)+(this.opts.addTrailingSlash?`/`:``),typeof this.opts.query==`string`&&(this.opts.query=Up(this.opts.query)),dm&&(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`})},fm.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);let n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved(`error`,`No transports available`)},0);return}let t=this.opts.rememberUpgrade&&e.priorWebsocketSuccess&&this.transports.indexOf(`websocket`)!==-1?`websocket`:this.transports[0];this.readyState=`opening`;let n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on(`drain`,this._onDrain.bind(this)).on(`packet`,this._onPacket.bind(this)).on(`error`,this._onError.bind(this)).on(`close`,e=>this._onClose(`transport close`,e))}onOpen(){this.readyState=`open`,e.priorWebsocketSuccess=this.transport.name===`websocket`,this.emitReserved(`open`),this.flush()}_onPacket(e){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`)switch(this.emitReserved(`packet`,e),this.emitReserved(`heartbeat`),e.type){case`open`:this.onHandshake(JSON.parse(e.data));break;case`ping`:this._sendPacket(`pong`),this.emitReserved(`ping`),this.emitReserved(`pong`),this._resetPingTimeout();break;case`error`:let t=Error(`server error`);t.code=e.data,this._onError(t);break;case`message`:this.emitReserved(`data`,e.data),this.emitReserved(`message`,e.data);break}}onHandshake(e){this.emitReserved(`handshake`,e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!==`closed`&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose(`ping timeout`)},e),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){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved(`flush`)}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name===`polling`&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){let n=this.writeBuffer[t].data;if(n&&(e+=zp(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,jp(()=>{this._onClose(`ping timeout`)},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket(`message`,e,t,n),this}send(e,t,n){return this._sendPacket(`message`,e,t,n),this}_sendPacket(e,t,n,r){if(typeof t==`function`&&(r=t,t=void 0),typeof n==`function`&&(r=n,n=null),this.readyState===`closing`||this.readyState===`closed`)return;n||={},n.compress=!1!==n.compress;let i={type:e,data:t,options:n};this.emitReserved(`packetCreate`,i),this.writeBuffer.push(i),r&&this.once(`flush`,r),this.flush()}close(){let e=()=>{this._onClose(`forced close`),this.transport.close()},t=()=>{this.off(`upgrade`,t),this.off(`upgradeError`,t),e()},n=()=>{this.once(`upgrade`,t),this.once(`upgradeError`,t)};return(this.readyState===`opening`||this.readyState===`open`)&&(this.readyState=`closing`,this.writeBuffer.length?this.once(`drain`,()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(t){if(e.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState===`opening`)return this.transports.shift(),this._open();this.emitReserved(`error`,t),this._onClose(`transport error`,t)}_onClose(e,t){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(),dm&&(this._beforeunloadEventListener&&removeEventListener(`beforeunload`,this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=fm.indexOf(this._offlineEventListener);e!==-1&&fm.splice(e,1)}this.readyState=`closed`,this.id=null,this.emitReserved(`close`,e,t),this.writeBuffer=[],this._prevBufferLen=0}}};pm.protocol=4;var mm=class extends pm{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState===`open`&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;pm.priorWebsocketSuccess=!1;let r=()=>{n||(t.send([{type:`ping`,data:`probe`}]),t.once(`packet`,e=>{if(!n)if(e.type===`pong`&&e.data===`probe`){if(this.upgrading=!0,this.emitReserved(`upgrading`,t),!t)return;pm.priorWebsocketSuccess=t.name===`websocket`,this.transport.pause(()=>{n||this.readyState!==`closed`&&(l(),this.setTransport(t),t.send([{type:`upgrade`}]),this.emitReserved(`upgrade`,t),t=null,this.upgrading=!1,this.flush())})}else{let e=Error(`probe error`);e.transport=t.name,this.emitReserved(`upgradeError`,e)}}))};function i(){n||(n=!0,l(),t.close(),t=null)}let a=e=>{let n=Error(`probe error: `+e);n.transport=t.name,i(),this.emitReserved(`upgradeError`,n)};function o(){a(`transport closed`)}function s(){a(`socket closed`)}function c(e){t&&e.name!==t.name&&i()}let l=()=>{t.removeListener(`open`,r),t.removeListener(`error`,a),t.removeListener(`close`,o),this.off(`close`,s),this.off(`upgrading`,c)};t.once(`open`,r),t.once(`error`,a),t.once(`close`,o),this.once(`close`,s),this.once(`upgrading`,c),this._upgrades.indexOf(`webtransport`)!==-1&&e!==`webtransport`?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}},hm=class extends mm{constructor(e,t={}){let n=typeof e==`object`?e:t;(!n.transports||n.transports&&typeof n.transports[0]==`string`)&&(n.transports=(n.transports||[`polling`,`websocket`,`webtransport`]).map(e=>am[e]).filter(e=>!!e)),super(e,n)}};hm.protocol;function gm(e,t=``,n){let r=e;n||=typeof location<`u`&&location,e??=n.protocol+`//`+n.host,typeof e==`string`&&(e.charAt(0)===`/`&&(e=e.charAt(1)===`/`?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=n===void 0?`https://`+e:n.protocol+`//`+e),r=cm(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port=`80`:/^(http|ws)s$/.test(r.protocol)&&(r.port=`443`)),r.path=r.path||`/`;let i=r.host.indexOf(`:`)===-1?r.host:`[`+r.host+`]`;return r.id=r.protocol+`://`+i+`:`+r.port+t,r.href=r.protocol+`://`+i+(n&&n.port===r.port?``:`:`+r.port),r}var _m=typeof ArrayBuffer==`function`,vm=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,ym=Object.prototype.toString,bm=typeof Blob==`function`||typeof Blob<`u`&&ym.call(Blob)===`[object BlobConstructor]`,xm=typeof File==`function`||typeof File<`u`&&ym.call(File)===`[object FileConstructor]`;function Sm(e){return _m&&(e instanceof ArrayBuffer||vm(e))||bm&&e instanceof Blob||xm&&e instanceof File}function Cm(e,t){if(!e||typeof e!=`object`)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(Cm(e[t]))return!0;return!1}if(Sm(e))return!0;if(e.toJSON&&typeof e.toJSON==`function`&&arguments.length===1)return Cm(e.toJSON(),!0);for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&Cm(e[t]))return!0;return!1}function wm(e){let t=[],n=e.data,r=e;return r.data=Tm(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Tm(e,t){if(!e)return e;if(Sm(e)){let n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=Tm(e[r],t);return n}else if(typeof e==`object`&&!(e instanceof Date)){let n={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Tm(e[r],t));return n}return e}function Em(e,t){return e.data=Dm(e.data,t),delete e.attachments,e}function Dm(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num==`number`&&e.num>=0&&e.num<t.length)return t[e.num];throw Error(`illegal attachments`)}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Dm(e[n],t);else if(typeof e==`object`)for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Dm(e[n],t));return e}var Om=s({Decoder:()=>Mm,Encoder:()=>jm,PacketType:()=>Am,isPacketValid:()=>zm,protocol:()=>5}),km=[`connect`,`connect_error`,`disconnect`,`disconnecting`,`newListener`,`removeListener`],Am;(function(e){e[e.CONNECT=0]=`CONNECT`,e[e.DISCONNECT=1]=`DISCONNECT`,e[e.EVENT=2]=`EVENT`,e[e.ACK=3]=`ACK`,e[e.CONNECT_ERROR=4]=`CONNECT_ERROR`,e[e.BINARY_EVENT=5]=`BINARY_EVENT`,e[e.BINARY_ACK=6]=`BINARY_ACK`})(Am||={});var jm=class{constructor(e){this.replacer=e}encode(e){return(e.type===Am.EVENT||e.type===Am.ACK)&&Cm(e)?this.encodeAsBinary({type:e.type===Am.EVENT?Am.BINARY_EVENT:Am.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=``+e.type;return(e.type===Am.BINARY_EVENT||e.type===Am.BINARY_ACK)&&(t+=e.attachments+`-`),e.nsp&&e.nsp!==`/`&&(t+=e.nsp+`,`),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=wm(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},Mm=class e extends kp{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e==`function`?{reviver:e}:e)}add(e){let t;if(typeof e==`string`){if(this.reconstructor)throw Error(`got plaintext data when reconstructing a packet`);t=this.decodeString(e);let n=t.type===Am.BINARY_EVENT;n||t.type===Am.BINARY_ACK?(t.type=n?Am.EVENT:Am.ACK,this.reconstructor=new Nm(t),t.attachments===0&&super.emitReserved(`decoded`,t)):super.emitReserved(`decoded`,t)}else if(Sm(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved(`decoded`,t));else throw Error(`got binary data when not reconstructing a packet`);else throw Error(`Unknown type: `+e)}decodeString(t){let n=0,r={type:Number(t.charAt(0))};if(Am[r.type]===void 0)throw Error(`unknown packet type `+r.type);if(r.type===Am.BINARY_EVENT||r.type===Am.BINARY_ACK){let e=n+1;for(;t.charAt(++n)!==`-`&&n!=t.length;);let i=t.substring(e,n);if(i!=Number(i)||t.charAt(n)!==`-`)throw Error(`Illegal attachments`);let a=Number(i);if(!Fm(a)||a<0)throw Error(`Illegal attachments`);if(a>this.opts.maxAttachments)throw Error(`too many attachments`);r.attachments=a}if(t.charAt(n+1)===`/`){let e=n+1;for(;++n&&!(t.charAt(n)===`,`||n===t.length););r.nsp=t.substring(e,n)}else r.nsp=`/`;let i=t.charAt(n+1);if(i!==``&&Number(i)==i){let e=n+1;for(;++n;){let e=t.charAt(n);if(e==null||Number(e)!=e){--n;break}if(n===t.length)break}r.id=Number(t.substring(e,n+1))}if(t.charAt(++n)){let i=this.tryParse(t.substr(n));if(e.isPayloadValid(r.type,i))r.data=i;else throw Error(`invalid payload`)}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case Am.CONNECT:return Lm(t);case Am.DISCONNECT:return t===void 0;case Am.CONNECT_ERROR:return typeof t==`string`||Lm(t);case Am.EVENT:case Am.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&km.indexOf(t[0])===-1);case Am.ACK:case Am.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&=(this.reconstructor.finishedReconstruction(),null)}},Nm=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let e=Em(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function Pm(e){return typeof e==`string`}var Fm=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e};function Im(e){return e===void 0||Fm(e)}function Lm(e){return Object.prototype.toString.call(e)===`[object Object]`}function Rm(e,t){switch(e){case Am.CONNECT:return t===void 0||Lm(t);case Am.DISCONNECT:return t===void 0;case Am.EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&km.indexOf(t[0])===-1);case Am.ACK:return Array.isArray(t);case Am.CONNECT_ERROR:return typeof t==`string`||Lm(t);default:return!1}}function zm(e){return Pm(e.nsp)&&Im(e.id)&&Rm(e.type,e.data)}function Bm(e,t,n){return e.on(t,n),function(){e.off(t,n)}}var Vm=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Hm=class extends kp{constructor(e,t,n){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=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[Bm(e,`open`,this.onopen.bind(this)),Bm(e,`packet`,this.onpacket.bind(this)),Bm(e,`error`,this.onerror.bind(this)),Bm(e,`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(...e){return e.unshift(`message`),this.emit.apply(this,e),this}emit(e,...t){if(Vm.hasOwnProperty(e))throw Error(`"`+e.toString()+`" is a reserved event name`);if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let n={type:Am.EVENT,data:t};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof t[t.length-1]==`function`){let e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}let r=this.io.engine?.transport?.writable,i=this.connected&&!this.io.engine?._hasPingExpired();return this.flags.volatile&&!r||(i?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){let n=this.flags.timeout??this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}let r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,Error(`operation has timed out`))},n),i=(...e)=>{this.io.clearTimeoutFn(r),t.apply(this,e)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((n,r)=>{let i=(e,t)=>e?r(e):n(t);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]==`function`&&(t=e.pop());let n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>(this._queue[0],e===null?(this._queue.shift(),t&&t(null,...r)):n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth==`function`?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Am.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved(`connect_error`,e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved(`disconnect`,e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){let t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,Error(`socket has been disconnected`))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Am.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved(`connect_error`,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 Am.EVENT:case Am.BINARY_EVENT:this.onevent(e);break;case Am.ACK:case Am.BINARY_ACK:this.onack(e);break;case Am.DISCONNECT:this.ondisconnect();break;case Am.CONNECT_ERROR:this.destroy();let t=Error(e.data.message);t.data=e.data.data,this.emitReserved(`connect_error`,t);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]==`string`&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,n=!1;return function(...r){n||(n=!0,t.packet({type:Am.ACK,id:e,data:r}))}}onack(e){let t=this.acks[e.id];typeof t==`function`&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved(`connect`)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose(`io server disconnect`)}destroy(){this.subs&&=(this.subs.forEach(e=>e()),void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Am.DISCONNECT}),this.destroy(),this.connected&&this.onclose(`io client disconnect`),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}};function Um(e){e||={},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Um.prototype.duration=function(){var e=this.ms*this.factor**+ this.attempts++;if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},Um.prototype.reset=function(){this.attempts=0},Um.prototype.setMin=function(e){this.ms=e},Um.prototype.setMax=function(e){this.max=e},Um.prototype.setJitter=function(e){this.jitter=e};var Wm=class extends kp{constructor(e,t){super(),this.nsps={},this.subs=[],e&&typeof e==`object`&&(t=e,e=void 0),t||={},t.path=t.path||`/socket.io`,this.opts=t,Lp(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor??.5),this.backoff=new Um({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState=`closed`,this.uri=e;let n=t.parser||Om;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)==null||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)==null||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)==null||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf(`open`))return this;this.engine=new hm(this.uri,this.opts);let t=this.engine,n=this;this._readyState=`opening`,this.skipReconnect=!1;let r=Bm(t,`open`,function(){n.onopen(),e&&e()}),i=t=>{this.cleanup(),this._readyState=`closed`,this.emitReserved(`error`,t),e?e(t):this.maybeReconnectOnOpen()},a=Bm(t,`error`,i);if(!1!==this._timeout){let e=this._timeout,n=this.setTimeoutFn(()=>{r(),i(Error(`timeout`)),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState=`open`,this.emitReserved(`open`);let e=this.engine;this.subs.push(Bm(e,`ping`,this.onping.bind(this)),Bm(e,`data`,this.ondata.bind(this)),Bm(e,`error`,this.onerror.bind(this)),Bm(e,`close`,this.onclose.bind(this)),Bm(this.decoder,`decoded`,this.ondecoded.bind(this)))}onping(){this.emitReserved(`ping`)}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose(`parse error`,e)}}ondecoded(e){jp(()=>{this.emitReserved(`packet`,e)},this.setTimeoutFn)}onerror(e){this.emitReserved(`error`,e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Hm(this,e,t),this.nsps[e]=n),n}_destroy(e){let t=Object.keys(this.nsps);for(let e of t)if(this.nsps[e].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose(`forced close`)}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)==null||n.close(),this.backoff.reset(),this._readyState=`closed`,this.emitReserved(`close`,e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved(`reconnect_failed`),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved(`reconnect_attempt`,e.backoff.attempts),!e.skipReconnect&&e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved(`reconnect_error`,t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved(`reconnect`,e)}},Gm={};function Km(e,t){typeof e==`object`&&(t=e,e=void 0),t||={};let n=gm(e,t.path||`/socket.io`),r=n.source,i=n.id,a=n.path,o=Gm[i]&&a in Gm[i].nsps,s=t.forceNew||t[`force new connection`]||!1===t.multiplex||o,c;return s?c=new Wm(r,t):(Gm[i]||(Gm[i]=new Wm(r,t)),c=Gm[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(Km,{Manager:Wm,Socket:Hm,io:Km,connect:Km});var qm=[it.MESSAGE_TO_GUEST,it.EVENT_TO_GUEST,it.TYPING_ON,it.TYPING_OFF,it.RESTART_CHAT_REQUEST,...Vi,...Ot,`@@localize/SET_ACTIVE_LANGUAGE`,`@@localize/ADD_TRANSLATION_FOR_LANGUAGE`],Jm=({dispatch:e,getState:t})=>n=>{let r=null;return i=>{let a=n(i);if(i.type===`CONNECT`)r?.disconnect(),e(Wi()),r=Km({path:`/website-messenger/${i.clientName}/socket.io`,query:i.querystrings}),r.on(`action`,e),r.on(`connect`,()=>e(Gi())),r.on(`disconnect`,()=>e(Ki())),r.on(`reconnect`,()=>e(qi())),r.on(`set-translations`,(t,n)=>{e(Bf({language:t,messages:kf(t,n)}))}),r.on(`set-settings`,t=>{e(Uf(t))}),r.on(`enable-conversation-rating`,t=>e(Nt(t))),r.on(`speech-transcription`,t=>e(At(t))),r.on(`restore-client-state`,t=>{e(Ui(t.sessionId)),e(It(t.messages))}),r.on(`expand-window`,({devices:t,initial:n=!1})=>{e({type:Tt,devices:t,initial:n})}),r.on(`restart-chat`,()=>{e(Yi())}),r.on(`login-success`,t=>{e(gi({loginToken:t.loginToken}))});else if(i.type===`start-screen/requestLogin`)r?.emit(`login-requested`,i.payload);else if(i.type===`START`)r?.emit(`start-chat`,i.payload);else if(i.type===`CLEAR_SESSION_ID`)r?.emit(`terminate-session`,i.payload);else if(i.type===`webclient.get.started`)r?.emit(`get-started`,JSON.stringify(i));else if(i.type===`AUDIO_MESSAGE_FROM_USER`)r?.emit(`audio-message`,i.buffer);else if(i.type===it.CONVERSATION_RATING_FROM_GUEST)r?.emit(`conversation-rating`,i.payload);else if(i.type===`webclient.transcript.pdf.download`){let{connection:{sessionId:e}}=t();if(e){let t=Xt(),n=new URL(`/${encodeURIComponent(t)}/transcript-pdf/${encodeURIComponent(e)}`,window.location.origin);window.location.href=n.toString()}}else qm.indexOf(i.type)===-1&&i.meta===void 0&&r&&r.emit(`action`,JSON.stringify(i));return a}},Ym=Xt(),Xm=Gr({middleware:e=>e().concat(Jm),reducer:Gf,preloadedState:{...Yf(Ym),intl:Of}});Xm.subscribe(Nc(()=>{let e=Xm.getState();Xf(Ym,{connection:e.connection,startScreen:e.startScreen})},1e3)),(0,b.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(Ke,{store:Xm,children:(0,Z.jsx)(xf,{})}));
|
|
75
|
-
//# sourceMappingURL=index-
|
|
75
|
+
//# sourceMappingURL=index-kLumE_Is.js.map
|