@botfabrik/engine-webclient 4.104.28 → 4.104.31

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.
@@ -10,7 +10,7 @@ Error generating stack: `+h.message+`
10
10
  The error may be correlated with this previous error:
11
11
  ${Ee.current.stack}
12
12
 
13
- `),je}useIsomorphicLayoutEffect(()=>{Ee.current=void 0,ue.current=void 0,H.current=Me});const Ve=reactExports.useMemo(()=>reactExports.createElement(D,{...Me,ref:ne}),[ne,D,Me]);return reactExports.useMemo(()=>k?reactExports.createElement(oe.Provider,{value:Ae},Ve):Ve,[oe,Ve,Ae])}const Z=reactExports.memo(V);if(Z.WrappedComponent=D,Z.displayName=V.displayName=L,E){const Y=reactExports.forwardRef(function(fe,oe){return reactExports.createElement(Z,{...fe,reactReduxForwardedRef:oe})});return Y.displayName=L,Y.WrappedComponent=D,hoistNonReactStatics(Y,D)}return hoistNonReactStatics(Z,D)}}var connect_default=connect$1;function Provider(t){const{children:i,context:u,serverState:c,store:p}=t,g=reactExports.useMemo(()=>{const E=createSubscription(p);return{store:p,subscription:E,getServerState:c?()=>c:void 0}},[p,c]),v=reactExports.useMemo(()=>p.getState(),[p]);useIsomorphicLayoutEffect(()=>{const{subscription:E}=g;return E.onStateChange=E.notifyNestedSubs,E.trySubscribe(),v!==p.getState()&&E.notifyNestedSubs(),()=>{E.tryUnsubscribe(),E.onStateChange=void 0}},[g,v]);const x=u||ReactReduxContext;return reactExports.createElement(x.Provider,{value:g},i)}var Provider_default=Provider;function createReduxContextHook(t=ReactReduxContext){return function(){return reactExports.useContext(t)}}var useReduxContext=createReduxContextHook();function createStoreHook(t=ReactReduxContext){const i=t===ReactReduxContext?useReduxContext:createReduxContextHook(t),u=()=>{const{store:c}=i();return c};return Object.assign(u,{withTypes:()=>u}),u}var useStore=createStoreHook();function createDispatchHook(t=ReactReduxContext){const i=t===ReactReduxContext?useStore:createStoreHook(t),u=()=>i().dispatch;return Object.assign(u,{withTypes:()=>u}),u}var useDispatch=createDispatchHook(),refEquality=(t,i)=>t===i;function createSelectorHook(t=ReactReduxContext){const i=t===ReactReduxContext?useReduxContext:createReduxContextHook(t),u=(c,p={})=>{const{equalityFn:g=refEquality}=typeof p=="function"?{equalityFn:p}:p,v=i(),{store:x,subscription:E,getServerState:_}=v;reactExports.useRef(!0);const T=reactExports.useCallback({[c.name](R){return c(R)}}[c.name],[c]),w=withSelectorExports.useSyncExternalStoreWithSelector(E.addNestedSub,x.getState,_||x.getState,T,g);return reactExports.useDebugValue(w),w};return Object.assign(u,{withTypes:()=>u}),u}var useSelector=createSelectorHook();function r(t){var i,u,c="";if(typeof t=="string"||typeof t=="number")c+=t;else if(typeof t=="object")if(Array.isArray(t)){var p=t.length;for(i=0;i<p;i++)t[i]&&(u=r(t[i]))&&(c&&(c+=" "),c+=u)}else for(u in t)t[u]&&(c&&(c+=" "),c+=u);return c}function clsx(){for(var t,i,u=0,c="",p=arguments.length;u<p;u++)(t=arguments[u])&&(i=r(t))&&(c&&(c+=" "),c+=i);return c}const app="_app_1rj0t_1",styles$o={app},TYPING_ON="core.typing.on",TYPING_OFF="core.typing.off",MESSAGE_FROM_GUEST="core.message.from.guest",MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST="core.message.without.analysis.from.guest",MESSAGE_TO_GUEST="core.message.to.guest",NLU_REQUEST_EVENT="core.nlu.request.event",EVENT_TO_GUEST="core.event.to.guest",RESTART_CHAT_REQUEST="core.chat.restart.request",TRANSCRIPT_MAIL_REQUEST="core.transcript.mail.request",TRANSCRIPT_ITEM_GUEST_REACTION="core.transcript.item.guest.reaction",CONVERSATION_RATING_FROM_GUEST="core.conversation.rating.from.guest",DRAWER_OPEN="core.drawer.open",DRAWER_CLOSE="core.drawer.close",GUEST_LOCALE_CHANGED="core.guest.locale.changed";var ButtonTypeEnum;(function(t){t.WEB_URL="web_url",t.POSTBACK="postback"})(ButtonTypeEnum||(ButtonTypeEnum={}));var SatisfactionEnum;(function(t){t.GOOD="GOOD",t.BAD="BAD"})(SatisfactionEnum||(SatisfactionEnum={}));let Message$2=class{type;sender;sources;quickReplies;constructor(i,u,c=[],p=[]){this.type=i,this.sender=u,this.sources=c,this.quickReplies=p}addQuickReply(i,u){this.quickReplies.push({label:i,payload:u})}},TextMessage$1=class extends Message$2{text;constructor(i,u,c=[],p=[]){super(MessageTypeEnum.TEXT,u,c,p),this.text=i}};var MessageTypeEnum;(function(t){t.TEXT="TEXT",t.DETAIL="DETAIL",t.MARKDOWN="MARKDOWN",t.VIDEO="VIDEO",t.IMAGE="IMAGE",t.FILE="FILE",t.AUDIO="AUDIO"})(MessageTypeEnum||(MessageTypeEnum={}));class User{type;id;name;avatar;constructor(i,u,c,p){this.type=i,this.id=u,this.name=c,this.avatar=p}}class BotUser extends User{constructor(){super(UserType$1.BOT,null,"Chatbot","bot.svg")}}class GuestUser extends User{constructor(){super(UserType$1.GUEST,null,"Guest","visitor.svg")}}var UserType$1;(function(t){t.GUEST="GUEST",t.BOT="BOT",t.PERSON="PERSON"})(UserType$1||(UserType$1={}));const receiveTextMessageFromGuest=t=>{const i=new TextMessage$1(t,new GuestUser);return{type:MESSAGE_FROM_GUEST,message:i}},receiveTextMessageWithoutAnalysisFromGuest=(t,i={})=>{const u=new TextMessage$1(t,new GuestUser);return{type:MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST,message:u,payload:i}},requestNLUEvent$1=t=>({type:NLU_REQUEST_EVENT,event:t}),transcriptItemGuestReaction=(t,i,u=null,c=null)=>({type:TRANSCRIPT_ITEM_GUEST_REACTION,payload:{actionId:t,reaction:i,category:u,comment:c}}),handleQuickReplyClick=t=>i=>(t.payload.type!==MESSAGE_FROM_GUEST&&i(receiveTextMessageWithoutAnalysisFromGuest(t.label,t.payload)),i(t.payload)),sendMessageFromUser=t=>(i,u)=>{const{quickReplies:c}=u().chat,p=c.find(g=>t.toLocaleLowerCase().indexOf(g.label.toLocaleLowerCase())>-1);return i(p?handleQuickReplyClick({...p,label:t}):JSON.parse(JSON.stringify(receiveTextMessageFromGuest(t))))},MESSAGE_TO_PARENT_PAGE="MESSAGE_TO_PARENT_PAGE",RESTORE_PREVIOUS_CHAT_MESSAGES="RESTORE_PREVIOUS_CHAT_MESSAGES",AUDIO_MESSAGE_FROM_USER="AUDIO_MESSAGE_FROM_USER",RECEIVE_SPEECH_TRANSCRIPTION="RECEIVE_SPEECH_TRANSCRIPTION",ENABLE_CONVERSATION_RATING="ENABLE_CONVERSATION_RATING",LOAD_SOURCE_INFOS_RESPONSE="LOAD_SOURCE_INFOS_RESPONSE",LOAD_SOURCE_INFOS_ERROR="LOAD_SOURCE_INFOS_ERROR",LOAD_SOURCE_INFOS_REQUEST="LOAD_SOURCE_INFOS_REQUEST",CLOSE_SOURCE_INFOS="CLOSE_SOURCE_INFOS",GET_STARTED="webclient.get.started",EXPAND_WINDOW="webclient.window.expand",CLOSE_WINDOW="webclient.window.close",DOWNLOAD_TRANSCRIPT_PDF="webclient.transcript.pdf.download",INTERNAL_ACTIONS$1=[MESSAGE_TO_PARENT_PAGE,RESTORE_PREVIOUS_CHAT_MESSAGES,AUDIO_MESSAGE_FROM_USER,RECEIVE_SPEECH_TRANSCRIPTION,ENABLE_CONVERSATION_RATING,LOAD_SOURCE_INFOS_REQUEST,CLOSE_SOURCE_INFOS],sendAudioMessageFromUser=t=>({type:AUDIO_MESSAGE_FROM_USER,buffer:t}),receiveSpeechTranscription=t=>({type:RECEIVE_SPEECH_TRANSCRIPTION,transcription:t}),exportTranscript=t=>({type:TRANSCRIPT_MAIL_REQUEST,payload:{parameters:{mailTo:t}}}),downloadTranscriptPdf=()=>({type:DOWNLOAD_TRANSCRIPT_PDF}),enableConversationRating=({rating:t})=>({type:ENABLE_CONVERSATION_RATING,payload:{rating:t}}),handleRatingFromUser=(t,i)=>({type:CONVERSATION_RATING_FROM_GUEST,payload:{value:t,feedback:i}}),requestNLUEvent=t=>requestNLUEvent$1(t),restorePreviousChatMessages=t=>({type:RESTORE_PREVIOUS_CHAT_MESSAGES,messages:t}),handleButtonClick=t=>{switch(t.type){case ButtonTypeEnum.WEB_URL:return notifyParentToChangePath(t.url);case ButtonTypeEnum.POSTBACK:return t.payload;default:throw new Error(`unknown button type ${t.type}`)}},handleLinkClick=t=>notifyParentToChangePath(t),notifyParentToChangePath=t=>({type:MESSAGE_TO_PARENT_PAGE,message:{type:"webclient.change.url",url:t}});function assign(t){for(var i=1;i<arguments.length;i++){var u=arguments[i];for(var c in u)t[c]=u[c]}return t}var defaultConverter={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function init(t,i){function u(p,g,v){if(!(typeof document>"u")){v=assign({},i,v),typeof v.expires=="number"&&(v.expires=new Date(Date.now()+v.expires*864e5)),v.expires&&(v.expires=v.expires.toUTCString()),p=encodeURIComponent(p).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var x="";for(var E in v)v[E]&&(x+="; "+E,v[E]!==!0&&(x+="="+v[E].split(";")[0]));return document.cookie=p+"="+t.write(g,p)+x}}function c(p){if(!(typeof document>"u"||arguments.length&&!p)){for(var g=document.cookie?document.cookie.split("; "):[],v={},x=0;x<g.length;x++){var E=g[x].split("="),_=E.slice(1).join("=");try{var T=decodeURIComponent(E[0]);if(v[T]=t.read(_,T),p===T)break}catch{}}return p?v[p]:v}}return Object.create({set:u,get:c,remove:function(p,g){u(p,"",assign({},g,{expires:-1}))},withAttributes:function(p){return init(this.converter,assign({},this.attributes,p))},withConverter:function(p){return init(assign({},this.converter,p),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(t)}})}var api=init(defaultConverter,{path:"/"});const byteToHex=[];for(let t=0;t<256;++t)byteToHex.push((t+256).toString(16).slice(1));function unsafeStringify(t,i=0){return(byteToHex[t[i+0]]+byteToHex[t[i+1]]+byteToHex[t[i+2]]+byteToHex[t[i+3]]+"-"+byteToHex[t[i+4]]+byteToHex[t[i+5]]+"-"+byteToHex[t[i+6]]+byteToHex[t[i+7]]+"-"+byteToHex[t[i+8]]+byteToHex[t[i+9]]+"-"+byteToHex[t[i+10]]+byteToHex[t[i+11]]+byteToHex[t[i+12]]+byteToHex[t[i+13]]+byteToHex[t[i+14]]+byteToHex[t[i+15]]).toLowerCase()}let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");getRandomValues=crypto.getRandomValues.bind(crypto)}return getRandomValues(rnds8)}const randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native={randomUUID};function _v4(t,i,u){t=t||{};const c=t.random??t.rng?.()??rng();if(c.length<16)throw new Error("Random bytes length must be >= 16");return c[6]=c[6]&15|64,c[8]=c[8]&63|128,unsafeStringify(c)}function v4(t,i,u){return native.randomUUID&&!t?native.randomUUID():_v4(t)}const getClientName=()=>extractClientNameFromPathname(window.location.pathname),extractClientNameFromPathname=t=>{const i=t.split("/"),u=t.endsWith("/");return i[i.length-(u?2:1)]};function formatProdErrorMessage$1(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var $$observable=typeof Symbol=="function"&&Symbol.observable||"@@observable",symbol_observable_default=$$observable,randomString$1=()=>Math.random().toString(36).substring(7).split("").join("."),ActionTypes={INIT:`@@redux/INIT${randomString$1()}`,REPLACE:`@@redux/REPLACE${randomString$1()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${randomString$1()}`},actionTypes_default=ActionTypes;function isPlainObject$1(t){if(typeof t!="object"||t===null)return!1;let i=t;for(;Object.getPrototypeOf(i)!==null;)i=Object.getPrototypeOf(i);return Object.getPrototypeOf(t)===i||Object.getPrototypeOf(t)===null}function createStore(t,i,u){if(typeof t!="function")throw new Error(formatProdErrorMessage$1(2));if(typeof i=="function"&&typeof u=="function"||typeof u=="function"&&typeof arguments[3]=="function")throw new Error(formatProdErrorMessage$1(0));if(typeof i=="function"&&typeof u>"u"&&(u=i,i=void 0),typeof u<"u"){if(typeof u!="function")throw new Error(formatProdErrorMessage$1(1));return u(createStore)(t,i)}let c=t,p=i,g=new Map,v=g,x=0,E=!1;function _(){v===g&&(v=new Map,g.forEach((D,z)=>{v.set(z,D)}))}function T(){if(E)throw new Error(formatProdErrorMessage$1(3));return p}function w(D){if(typeof D!="function")throw new Error(formatProdErrorMessage$1(4));if(E)throw new Error(formatProdErrorMessage$1(5));let z=!0;_();const L=x++;return v.set(L,D),function(){if(z){if(E)throw new Error(formatProdErrorMessage$1(6));z=!1,_(),v.delete(L),g=null}}}function R(D){if(!isPlainObject$1(D))throw new Error(formatProdErrorMessage$1(7));if(typeof D.type>"u")throw new Error(formatProdErrorMessage$1(8));if(typeof D.type!="string")throw new Error(formatProdErrorMessage$1(17));if(E)throw new Error(formatProdErrorMessage$1(9));try{E=!0,p=c(p,D)}finally{E=!1}return(g=v).forEach(L=>{L()}),D}function M(D){if(typeof D!="function")throw new Error(formatProdErrorMessage$1(10));c=D,R({type:actionTypes_default.REPLACE})}function k(){const D=w;return{subscribe(z){if(typeof z!="object"||z===null)throw new Error(formatProdErrorMessage$1(11));function L(){const V=z;V.next&&V.next(T())}return L(),{unsubscribe:D(L)}},[symbol_observable_default](){return this}}}return R({type:actionTypes_default.INIT}),{dispatch:R,subscribe:w,getState:T,replaceReducer:M,[symbol_observable_default]:k}}function assertReducerShape(t){Object.keys(t).forEach(i=>{const u=t[i];if(typeof u(void 0,{type:actionTypes_default.INIT})>"u")throw new Error(formatProdErrorMessage$1(12));if(typeof u(void 0,{type:actionTypes_default.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(formatProdErrorMessage$1(13))})}function combineReducers(t){const i=Object.keys(t),u={};for(let g=0;g<i.length;g++){const v=i[g];typeof t[v]=="function"&&(u[v]=t[v])}const c=Object.keys(u);let p;try{assertReducerShape(u)}catch(g){p=g}return function(v={},x){if(p)throw p;let E=!1;const _={};for(let T=0;T<c.length;T++){const w=c[T],R=u[w],M=v[w],k=R(M,x);if(typeof k>"u")throw x&&x.type,new Error(formatProdErrorMessage$1(14));_[w]=k,E=E||k!==M}return E=E||c.length!==Object.keys(v).length,E?_:v}}function compose(...t){return t.length===0?i=>i:t.length===1?t[0]:t.reduce((i,u)=>(...c)=>i(u(...c)))}function applyMiddleware(...t){return i=>(u,c)=>{const p=i(u,c);let g=()=>{throw new Error(formatProdErrorMessage$1(15))};const v={getState:p.getState,dispatch:(E,..._)=>g(E,..._)},x=t.map(E=>E(v));return g=compose(...x)(p.dispatch),{...p,dispatch:g}}}function isAction(t){return isPlainObject$1(t)&&"type"in t&&typeof t.type=="string"}var NOTHING=Symbol.for("immer-nothing"),DRAFTABLE=Symbol.for("immer-draftable"),DRAFT_STATE=Symbol.for("immer-state");function die(t,...i){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var O=Object,getPrototypeOf$1=O.getPrototypeOf,CONSTRUCTOR="constructor",PROTOTYPE="prototype",CONFIGURABLE="configurable",ENUMERABLE="enumerable",WRITABLE="writable",VALUE="value",isDraft=t=>!!t&&!!t[DRAFT_STATE];function isDraftable(t){return t?isPlainObject(t)||isArray(t)||!!t[DRAFTABLE]||!!t[CONSTRUCTOR]?.[DRAFTABLE]||isMap(t)||isSet(t):!1}var objectCtorString=O[PROTOTYPE][CONSTRUCTOR].toString(),cachedCtorStrings=new WeakMap;function isPlainObject(t){if(!t||!isObjectish(t))return!1;const i=getPrototypeOf$1(t);if(i===null||i===O[PROTOTYPE])return!0;const u=O.hasOwnProperty.call(i,CONSTRUCTOR)&&i[CONSTRUCTOR];if(u===Object)return!0;if(!isFunction(u))return!1;let c=cachedCtorStrings.get(u);return c===void 0&&(c=Function.toString.call(u),cachedCtorStrings.set(u,c)),c===objectCtorString}function each(t,i,u=!0){getArchtype(t)===0?(u?Reflect.ownKeys(t):O.keys(t)).forEach(p=>{i(p,t[p],t)}):t.forEach((c,p)=>i(p,c,t))}function getArchtype(t){const i=t[DRAFT_STATE];return i?i.type_:isArray(t)?1:isMap(t)?2:isSet(t)?3:0}var has=(t,i,u=getArchtype(t))=>u===2?t.has(i):O[PROTOTYPE].hasOwnProperty.call(t,i),get=(t,i,u=getArchtype(t))=>u===2?t.get(i):t[i],set=(t,i,u,c=getArchtype(t))=>{c===2?t.set(i,u):c===3?t.add(u):t[i]=u};function is(t,i){return t===i?t!==0||1/t===1/i:t!==t&&i!==i}var isArray=Array.isArray,isMap=t=>t instanceof Map,isSet=t=>t instanceof Set,isObjectish=t=>typeof t=="object",isFunction=t=>typeof t=="function",isBoolean$1=t=>typeof t=="boolean";function isArrayIndex(t){const i=+t;return Number.isInteger(i)&&String(i)===t}var latest=t=>t.copy_||t.base_,getFinalValue=t=>t.modified_?t.copy_:t.base_;function shallowCopy(t,i){if(isMap(t))return new Map(t);if(isSet(t))return new Set(t);if(isArray(t))return Array[PROTOTYPE].slice.call(t);const u=isPlainObject(t);if(i===!0||i==="class_only"&&!u){const c=O.getOwnPropertyDescriptors(t);delete c[DRAFT_STATE];let p=Reflect.ownKeys(c);for(let g=0;g<p.length;g++){const v=p[g],x=c[v];x[WRITABLE]===!1&&(x[WRITABLE]=!0,x[CONFIGURABLE]=!0),(x.get||x.set)&&(c[v]={[CONFIGURABLE]:!0,[WRITABLE]:!0,[ENUMERABLE]:x[ENUMERABLE],[VALUE]:t[v]})}return O.create(getPrototypeOf$1(t),c)}else{const c=getPrototypeOf$1(t);if(c!==null&&u)return{...t};const p=O.create(c);return O.assign(p,t)}}function freeze$1(t,i=!1){return isFrozen$1(t)||isDraft(t)||!isDraftable(t)||(getArchtype(t)>1&&O.defineProperties(t,{set:dontMutateMethodOverride,add:dontMutateMethodOverride,clear:dontMutateMethodOverride,delete:dontMutateMethodOverride}),O.freeze(t),i&&each(t,(u,c)=>{freeze$1(c,!0)},!1)),t}function dontMutateFrozenCollections(){die(2)}var dontMutateMethodOverride={[VALUE]:dontMutateFrozenCollections};function isFrozen$1(t){return t===null||!isObjectish(t)?!0:O.isFrozen(t)}var PluginMapSet="MapSet",PluginPatches="Patches",PluginArrayMethods="ArrayMethods",plugins={};function getPlugin(t){const i=plugins[t];return i||die(0,t),i}var isPluginLoaded=t=>!!plugins[t],currentScope,getCurrentScope=()=>currentScope,createScope=(t,i)=>({drafts_:[],parent_:t,immer_:i,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:isPluginLoaded(PluginMapSet)?getPlugin(PluginMapSet):void 0,arrayMethodsPlugin_:isPluginLoaded(PluginArrayMethods)?getPlugin(PluginArrayMethods):void 0});function usePatchesInScope(t,i){i&&(t.patchPlugin_=getPlugin(PluginPatches),t.patches_=[],t.inversePatches_=[],t.patchListener_=i)}function revokeScope(t){leaveScope(t),t.drafts_.forEach(revokeDraft),t.drafts_=null}function leaveScope(t){t===currentScope&&(currentScope=t.parent_)}var enterScope=t=>currentScope=createScope(currentScope,t);function revokeDraft(t){const i=t[DRAFT_STATE];i.type_===0||i.type_===1?i.revoke_():i.revoked_=!0}function processResult(t,i){i.unfinalizedDrafts_=i.drafts_.length;const u=i.drafts_[0];if(t!==void 0&&t!==u){u[DRAFT_STATE].modified_&&(revokeScope(i),die(4)),isDraftable(t)&&(t=finalize(i,t));const{patchPlugin_:p}=i;p&&p.generateReplacementPatches_(u[DRAFT_STATE].base_,t,i)}else t=finalize(i,u);return maybeFreeze(i,t,!0),revokeScope(i),i.patches_&&i.patchListener_(i.patches_,i.inversePatches_),t!==NOTHING?t:void 0}function finalize(t,i){if(isFrozen$1(i))return i;const u=i[DRAFT_STATE];if(!u)return handleValue(i,t.handledSet_,t);if(!isSameScope(u,t))return i;if(!u.modified_)return u.base_;if(!u.finalized_){const{callbacks_:c}=u;if(c)for(;c.length>0;)c.pop()(t);generatePatchesAndFinalize(u,t)}return u.copy_}function maybeFreeze(t,i,u=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&freeze$1(i,u)}function markStateFinalized(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var isSameScope=(t,i)=>t.scope_===i,EMPTY_LOCATIONS_RESULT=[];function updateDraftInParent(t,i,u,c){const p=latest(t),g=t.type_;if(c!==void 0&&get(p,c,g)===i){set(p,c,u,g);return}if(!t.draftLocations_){const x=t.draftLocations_=new Map;each(p,(E,_)=>{if(isDraft(_)){const T=x.get(_)||[];T.push(E),x.set(_,T)}})}const v=t.draftLocations_.get(i)??EMPTY_LOCATIONS_RESULT;for(const x of v)set(p,x,u,g)}function registerChildFinalizationCallback(t,i,u){t.callbacks_.push(function(p){const g=i;if(!g||!isSameScope(g,p))return;p.mapSetPlugin_?.fixSetContents(g);const v=getFinalValue(g);updateDraftInParent(t,g.draft_??g,v,u),generatePatchesAndFinalize(g,p)})}function generatePatchesAndFinalize(t,i){if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){const{patchPlugin_:c}=i;if(c){const p=c.getPath(t);p&&c.generatePatches_(t,p,i)}markStateFinalized(t)}}function handleCrossReference(t,i,u){const{scope_:c}=t;if(isDraft(u)){const p=u[DRAFT_STATE];isSameScope(p,c)&&p.callbacks_.push(function(){prepareCopy(t);const v=getFinalValue(p);updateDraftInParent(t,u,v,i)})}else isDraftable(u)&&t.callbacks_.push(function(){const g=latest(t);t.type_===3?g.has(u)&&handleValue(u,c.handledSet_,c):get(g,i,t.type_)===u&&c.drafts_.length>1&&(t.assigned_.get(i)??!1)===!0&&t.copy_&&handleValue(get(t.copy_,i,t.type_),c.handledSet_,c)})}function handleValue(t,i,u){return!u.immer_.autoFreeze_&&u.unfinalizedDrafts_<1||isDraft(t)||i.has(t)||!isDraftable(t)||isFrozen$1(t)||(i.add(t),each(t,(c,p)=>{if(isDraft(p)){const g=p[DRAFT_STATE];if(isSameScope(g,u)){const v=getFinalValue(g);set(t,c,v,t.type_),markStateFinalized(g)}}else isDraftable(p)&&handleValue(p,i,u)})),t}function createProxyProxy(t,i){const u=isArray(t),c={type_:u?1:0,scope_:i?i.scope_:getCurrentScope(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:i,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let p=c,g=objectTraps;u&&(p=[c],g=arrayTraps);const{revoke:v,proxy:x}=Proxy.revocable(p,g);return c.draft_=x,c.revoke_=v,[x,c]}var objectTraps={get(t,i){if(i===DRAFT_STATE)return t;let u=t.scope_.arrayMethodsPlugin_;const c=t.type_===1&&typeof i=="string";if(c&&u?.isArrayOperationMethod(i))return u.createMethodInterceptor(t,i);const p=latest(t);if(!has(p,i,t.type_))return readPropFromProto(t,p,i);const g=p[i];if(t.finalized_||!isDraftable(g)||c&&t.operationMethod&&u?.isMutatingArrayMethod(t.operationMethod)&&isArrayIndex(i))return g;if(g===peek(t.base_,i)){prepareCopy(t);const v=t.type_===1?+i:i,x=createProxy(t.scope_,g,t,v);return t.copy_[v]=x}return g},has(t,i){return i in latest(t)},ownKeys(t){return Reflect.ownKeys(latest(t))},set(t,i,u){const c=getDescriptorFromProto(latest(t),i);if(c?.set)return c.set.call(t.draft_,u),!0;if(!t.modified_){const p=peek(latest(t),i),g=p?.[DRAFT_STATE];if(g&&g.base_===u)return t.copy_[i]=u,t.assigned_.set(i,!1),!0;if(is(u,p)&&(u!==void 0||has(t.base_,i,t.type_)))return!0;prepareCopy(t),markChanged(t)}return t.copy_[i]===u&&(u!==void 0||i in t.copy_)||Number.isNaN(u)&&Number.isNaN(t.copy_[i])||(t.copy_[i]=u,t.assigned_.set(i,!0),handleCrossReference(t,i,u)),!0},deleteProperty(t,i){return prepareCopy(t),peek(t.base_,i)!==void 0||i in t.base_?(t.assigned_.set(i,!1),markChanged(t)):t.assigned_.delete(i),t.copy_&&delete t.copy_[i],!0},getOwnPropertyDescriptor(t,i){const u=latest(t),c=Reflect.getOwnPropertyDescriptor(u,i);return c&&{[WRITABLE]:!0,[CONFIGURABLE]:t.type_!==1||i!=="length",[ENUMERABLE]:c[ENUMERABLE],[VALUE]:u[i]}},defineProperty(){die(11)},getPrototypeOf(t){return getPrototypeOf$1(t.base_)},setPrototypeOf(){die(12)}},arrayTraps={};for(let t in objectTraps){let i=objectTraps[t];arrayTraps[t]=function(){const u=arguments;return u[0]=u[0][0],i.apply(this,u)}}arrayTraps.deleteProperty=function(t,i){return arrayTraps.set.call(this,t,i,void 0)};arrayTraps.set=function(t,i,u){return objectTraps.set.call(this,t[0],i,u,t[0])};function peek(t,i){const u=t[DRAFT_STATE];return(u?latest(u):t)[i]}function readPropFromProto(t,i,u){const c=getDescriptorFromProto(i,u);return c?VALUE in c?c[VALUE]:c.get?.call(t.draft_):void 0}function getDescriptorFromProto(t,i){if(!(i in t))return;let u=getPrototypeOf$1(t);for(;u;){const c=Object.getOwnPropertyDescriptor(u,i);if(c)return c;u=getPrototypeOf$1(u)}}function markChanged(t){t.modified_||(t.modified_=!0,t.parent_&&markChanged(t.parent_))}function prepareCopy(t){t.copy_||(t.assigned_=new Map,t.copy_=shallowCopy(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var Immer2=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(i,u,c)=>{if(isFunction(i)&&!isFunction(u)){const g=u;u=i;const v=this;return function(E=g,..._){return v.produce(E,T=>u.call(this,T,..._))}}isFunction(u)||die(6),c!==void 0&&!isFunction(c)&&die(7);let p;if(isDraftable(i)){const g=enterScope(this),v=createProxy(g,i,void 0);let x=!0;try{p=u(v),x=!1}finally{x?revokeScope(g):leaveScope(g)}return usePatchesInScope(g,c),processResult(p,g)}else if(!i||!isObjectish(i)){if(p=u(i),p===void 0&&(p=i),p===NOTHING&&(p=void 0),this.autoFreeze_&&freeze$1(p,!0),c){const g=[],v=[];getPlugin(PluginPatches).generateReplacementPatches_(i,p,{patches_:g,inversePatches_:v}),c(g,v)}return p}else die(1,i)},this.produceWithPatches=(i,u)=>{if(isFunction(i))return(v,...x)=>this.produceWithPatches(v,E=>i(E,...x));let c,p;return[this.produce(i,u,(v,x)=>{c=v,p=x}),c,p]},isBoolean$1(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),isBoolean$1(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),isBoolean$1(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){isDraftable(t)||die(8),isDraft(t)&&(t=current(t));const i=enterScope(this),u=createProxy(i,t,void 0);return u[DRAFT_STATE].isManual_=!0,leaveScope(i),u}finishDraft(t,i){const u=t&&t[DRAFT_STATE];(!u||!u.isManual_)&&die(9);const{scope_:c}=u;return usePatchesInScope(c,i),processResult(void 0,c)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,i){let u;for(u=i.length-1;u>=0;u--){const p=i[u];if(p.path.length===0&&p.op==="replace"){t=p.value;break}}u>-1&&(i=i.slice(u+1));const c=getPlugin(PluginPatches).applyPatches_;return isDraft(t)?c(t,i):this.produce(t,p=>c(p,i))}};function createProxy(t,i,u,c){const[p,g]=isMap(i)?getPlugin(PluginMapSet).proxyMap_(i,u):isSet(i)?getPlugin(PluginMapSet).proxySet_(i,u):createProxyProxy(i,u);return(u?.scope_??getCurrentScope()).drafts_.push(p),g.callbacks_=u?.callbacks_??[],g.key_=c,u&&c!==void 0?registerChildFinalizationCallback(u,g,c):g.callbacks_.push(function(E){E.mapSetPlugin_?.fixSetContents(g);const{patchPlugin_:_}=E;g.modified_&&_&&_.generatePatches_(g,[],E)}),p}function current(t){return isDraft(t)||die(10,t),currentImpl(t)}function currentImpl(t){if(!isDraftable(t)||isFrozen$1(t))return t;const i=t[DRAFT_STATE];let u,c=!0;if(i){if(!i.modified_)return i.base_;i.finalized_=!0,u=shallowCopy(t,i.scope_.immer_.useStrictShallowCopy_),c=i.scope_.immer_.shouldUseStrictIteration()}else u=shallowCopy(t,!0);return each(u,(p,g)=>{set(u,p,currentImpl(g))},c),i&&(i.finalized_=!1),u}var immer=new Immer2,produce=immer.produce;function createThunkMiddleware(t){return({dispatch:u,getState:c})=>p=>g=>typeof g=="function"?g(u,c,t):p(g)}var thunk=createThunkMiddleware(),withExtraArgument=createThunkMiddleware,composeWithDevTools=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?compose:compose.apply(null,arguments)};function createAction(t,i){function u(...c){if(i){let p=i(...c);if(!p)throw new Error(formatProdErrorMessage(0));return{type:t,payload:p.payload,..."meta"in p&&{meta:p.meta},..."error"in p&&{error:p.error}}}return{type:t,payload:c[0]}}return u.toString=()=>`${t}`,u.type=t,u.match=c=>isAction(c)&&c.type===t,u}var Tuple=class Xr extends Array{constructor(...i){super(...i),Object.setPrototypeOf(this,Xr.prototype)}static get[Symbol.species](){return Xr}concat(...i){return super.concat.apply(this,i)}prepend(...i){return i.length===1&&Array.isArray(i[0])?new Xr(...i[0].concat(this)):new Xr(...i.concat(this))}};function freezeDraftable(t){return isDraftable(t)?produce(t,()=>{}):t}function getOrInsertComputed(t,i,u){return t.has(i)?t.get(i):t.set(i,u(i)).get(i)}function isBoolean(t){return typeof t=="boolean"}var buildGetDefaultMiddleware=()=>function(i){const{thunk:u=!0,immutableCheck:c=!0,serializableCheck:p=!0,actionCreatorCheck:g=!0}=i??{};let v=new Tuple;return u&&(isBoolean(u)?v.push(thunk):v.push(withExtraArgument(u.extraArgument))),v},SHOULD_AUTOBATCH="RTK_autoBatch",createQueueWithTimer=t=>i=>{setTimeout(i,t)},autoBatchEnhancer=(t={type:"raf"})=>i=>(...u)=>{const c=i(...u);let p=!0,g=!1,v=!1;const x=new Set,E=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:createQueueWithTimer(10):t.type==="callback"?t.queueNotification:createQueueWithTimer(t.timeout),_=()=>{v=!1,g&&(g=!1,x.forEach(T=>T()))};return Object.assign({},c,{subscribe(T){const w=()=>p&&T(),R=c.subscribe(w);return x.add(T),()=>{R(),x.delete(T)}},dispatch(T){try{return p=!T?.meta?.[SHOULD_AUTOBATCH],g=!p,g&&(v||(v=!0,E(_))),c.dispatch(T)}finally{p=!0}}})},buildGetDefaultEnhancers=t=>function(u){const{autoBatch:c=!0}=u??{};let p=new Tuple(t);return c&&p.push(autoBatchEnhancer(typeof c=="object"?c:void 0)),p};function configureStore(t){const i=buildGetDefaultMiddleware(),{reducer:u=void 0,middleware:c,devTools:p=!0,preloadedState:g=void 0,enhancers:v=void 0}=t||{};let x;if(typeof u=="function")x=u;else if(isPlainObject$1(u))x=combineReducers(u);else throw new Error(formatProdErrorMessage(1));let E;typeof c=="function"?E=c(i):E=i();let _=compose;p&&(_=composeWithDevTools({trace:!1,...typeof p=="object"&&p}));const T=applyMiddleware(...E),w=buildGetDefaultEnhancers(T);let R=typeof v=="function"?v(w):w();const M=_(...R);return createStore(x,g,M)}function executeReducerBuilderCallback(t){const i={},u=[];let c;const p={addCase(g,v){const x=typeof g=="string"?g:g.type;if(!x)throw new Error(formatProdErrorMessage(28));if(x in i)throw new Error(formatProdErrorMessage(29));return i[x]=v,p},addAsyncThunk(g,v){return v.pending&&(i[g.pending.type]=v.pending),v.rejected&&(i[g.rejected.type]=v.rejected),v.fulfilled&&(i[g.fulfilled.type]=v.fulfilled),v.settled&&u.push({matcher:g.settled,reducer:v.settled}),p},addMatcher(g,v){return u.push({matcher:g,reducer:v}),p},addDefaultCase(g){return c=g,p}};return t(p),[i,u,c]}function isStateFunction(t){return typeof t=="function"}function createReducer(t,i){let[u,c,p]=executeReducerBuilderCallback(i),g;if(isStateFunction(t))g=()=>freezeDraftable(t());else{const x=freezeDraftable(t);g=()=>x}function v(x=g(),E){let _=[u[E.type],...c.filter(({matcher:T})=>T(E)).map(({reducer:T})=>T)];return _.filter(T=>!!T).length===0&&(_=[p]),_.reduce((T,w)=>{if(w)if(isDraft(T)){const M=w(T,E);return M===void 0?T:M}else{if(isDraftable(T))return produce(T,R=>w(R,E));{const R=w(T,E);if(R===void 0){if(T===null)return T;throw Error("A case reducer on a non-draftable value must not return undefined")}return R}}return T},x)}return v.getInitialState=g,v}var asyncThunkSymbol=Symbol.for("rtk-slice-createasyncthunk");function getType(t,i){return`${t}/${i}`}function buildCreateSlice({creators:t}={}){const i=t?.asyncThunk?.[asyncThunkSymbol];return function(c){const{name:p,reducerPath:g=p}=c;if(!p)throw new Error(formatProdErrorMessage(11));const v=(typeof c.reducers=="function"?c.reducers(buildReducerCreators()):c.reducers)||{},x=Object.keys(v),E={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},_={addCase(U,V){const Q=typeof U=="string"?U:U.type;if(!Q)throw new Error(formatProdErrorMessage(12));if(Q in E.sliceCaseReducersByType)throw new Error(formatProdErrorMessage(13));return E.sliceCaseReducersByType[Q]=V,_},addMatcher(U,V){return E.sliceMatchers.push({matcher:U,reducer:V}),_},exposeAction(U,V){return E.actionCreators[U]=V,_},exposeCaseReducer(U,V){return E.sliceCaseReducersByName[U]=V,_}};x.forEach(U=>{const V=v[U],Q={reducerName:U,type:getType(p,U),createNotation:typeof c.reducers=="function"};isAsyncThunkSliceReducerDefinition(V)?handleThunkCaseReducerDefinition(Q,V,_,i):handleNormalReducerDefinition(Q,V,_)});function T(){const[U={},V=[],Q=void 0]=typeof c.extraReducers=="function"?executeReducerBuilderCallback(c.extraReducers):[c.extraReducers],Z={...U,...E.sliceCaseReducersByType};return createReducer(c.initialState,F=>{for(let Y in Z)F.addCase(Y,Z[Y]);for(let Y of E.sliceMatchers)F.addMatcher(Y.matcher,Y.reducer);for(let Y of V)F.addMatcher(Y.matcher,Y.reducer);Q&&F.addDefaultCase(Q)})}const w=U=>U,R=new Map,M=new WeakMap;let k;function A(U,V){return k||(k=T()),k(U,V)}function D(){return k||(k=T()),k.getInitialState()}function z(U,V=!1){function Q(F){let Y=F[U];return typeof Y>"u"&&V&&(Y=getOrInsertComputed(M,Q,D)),Y}function Z(F=w){const Y=getOrInsertComputed(R,V,()=>new WeakMap);return getOrInsertComputed(Y,F,()=>{const ne={};for(const[fe,oe]of Object.entries(c.selectors??{}))ne[fe]=wrapSelector(oe,F,()=>getOrInsertComputed(M,F,D),V);return ne})}return{reducerPath:U,getSelectors:Z,get selectors(){return Z(Q)},selectSlice:Q}}const L={name:p,reducer:A,actions:E.actionCreators,caseReducers:E.sliceCaseReducersByName,getInitialState:D,...z(g),injectInto(U,{reducerPath:V,...Q}={}){const Z=V??g;return U.inject({reducerPath:Z,reducer:A},Q),{...L,...z(Z,!0)}}};return L}}function wrapSelector(t,i,u,c){function p(g,...v){let x=i(g);return typeof x>"u"&&c&&(x=u()),t(x,...v)}return p.unwrapped=t,p}var createSlice=buildCreateSlice();function buildReducerCreators(){function t(i,u){return{_reducerDefinitionType:"asyncThunk",payloadCreator:i,...u}}return t.withTypes=()=>t,{reducer(i){return Object.assign({[i.name](...u){return i(...u)}}[i.name],{_reducerDefinitionType:"reducer"})},preparedReducer(i,u){return{_reducerDefinitionType:"reducerWithPrepare",prepare:i,reducer:u}},asyncThunk:t}}function handleNormalReducerDefinition({type:t,reducerName:i,createNotation:u},c,p){let g,v;if("reducer"in c){if(u&&!isCaseReducerWithPrepareDefinition(c))throw new Error(formatProdErrorMessage(17));g=c.reducer,v=c.prepare}else g=c;p.addCase(t,g).exposeCaseReducer(i,g).exposeAction(i,v?createAction(t,v):createAction(t))}function isAsyncThunkSliceReducerDefinition(t){return t._reducerDefinitionType==="asyncThunk"}function isCaseReducerWithPrepareDefinition(t){return t._reducerDefinitionType==="reducerWithPrepare"}function handleThunkCaseReducerDefinition({type:t,reducerName:i},u,c,p){if(!p)throw new Error(formatProdErrorMessage(18));const{payloadCreator:g,fulfilled:v,pending:x,rejected:E,settled:_,options:T}=u,w=p(t,g,T);c.exposeAction(i,w),v&&c.addCase(w.fulfilled,v),x&&c.addCase(w.pending,x),E&&c.addCase(w.rejected,E),_&&c.addMatcher(w.settled,_),c.exposeCaseReducer(i,{fulfilled:v||noop,pending:x||noop,rejected:E||noop,settled:_||noop})}function noop(){}function formatProdErrorMessage(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}const initialState$4={formValues:{}},startPageSlice=createSlice({name:"start-screen",initialState:initialState$4,reducers:{showStartScreen(t){t.startScreenStatus="VISIBLE",t.formValues={}},startChat(t,i){t.startScreenStatus="HIDDEN",t.formValues=i.payload.formValues},startAuthenticatedChat(t,i){t.startScreenStatus="HIDDEN",t.loginToken=i.payload.loginToken,t.loginRequestToken=void 0},requestLogin(t,i){t.loginRequestToken=i.payload.loginRequestToken,t.formValues=i.payload.formValues},loginWindowClosed(t){t.loginRequestToken=void 0}}}),{startChat:startChat$1,startAuthenticatedChat,showStartScreen,requestLogin,loginWindowClosed}=startPageSlice.actions,startScreenReducer=startPageSlice.reducer,RESET_CHAT_STATE="RESET_CHAT_STATE",TOGGLE_TRANSCRIPT_MAIL_OVERLAY="TOGGLE_TRANSCRIPT_MAIL_OVERLAY",SHOW_CONVERSATION_RATING_OVERLAY="SHOW_CONVERSATION_RATING_OVERLAY",HIDE_CONVERSATION_RATING_OVERLAY="HIDE_CONVERSATION_RATING_OVERLAY",closeChatWindow=()=>({type:CLOSE_WINDOW}),resetChatState=()=>({type:RESET_CHAT_STATE}),toggleTranscriptMailOverlay=()=>({type:TOGGLE_TRANSCRIPT_MAIL_OVERLAY}),showConversationRatingOverlay=(t,i=void 0)=>({type:SHOW_CONVERSATION_RATING_OVERLAY,payload:{opener:t,defaultRating:i}}),hideConversationRatingOverlay=()=>({type:HIDE_CONVERSATION_RATING_OVERLAY}),loadSourceInfosRequest=(t,i,u)=>(c,p)=>{try{const g=p().connection.sessionId;if(!g)throw new Error("Session ID is not available");c({type:LOAD_SOURCE_INFOS_REQUEST,payload:{chunkId:u}}),fetchSourceInfos(t,g,i,u,!1,c),fetchSourceInfos(t,g,i,u,!0,c)}catch(g){console.error("Error loading source infos:",g),c({type:LOAD_SOURCE_INFOS_ERROR})}},fetchSourceInfos=(t,i,u,c,p,g)=>{const v=`/${t}/me/chat-widget/transcript/${u}/chunks/${c}?highlight=${p}`;fetch(v,{headers:{"x-bubble-chat-session-id":i}}).then(x=>{if(!x.ok)throw new Error(`HTTP error! Status: ${x.status}`);return x.json()}).then(x=>{const E={...x,chunkId:c,highlighted:p};g({type:LOAD_SOURCE_INFOS_RESPONSE,payload:E})}).catch(x=>{console.error("Error fetching source infos:",x),g({type:LOAD_SOURCE_INFOS_ERROR,payload:{highlighted:p}})})},closeSourceInfos=()=>({type:CLOSE_SOURCE_INFOS}),CONNECT="CONNECT",CONNECTING="CONNECTING",CONNECTED="CONNECTED",DISCONNECTED="DISCONNECTED",RECONNECTED="RECONNECTED",RESTORE_SESSION_ID="RESTORE_SESSION_ID",START="START",TERMINATE_SESSION="CLEAR_SESSION_ID",INTERNAL_ACTIONS=[CONNECT,CONNECTING,CONNECTED,DISCONNECTED,RECONNECTED,RESTORE_SESSION_ID],connect=(t,i)=>({type:CONNECT,clientName:t,querystrings:i}),restoreSessionId=t=>({type:RESTORE_SESSION_ID,sessionId:t}),connecting=()=>({type:CONNECTING}),connected=()=>({type:CONNECTED}),disconnected=()=>({type:DISCONNECTED}),reconnected=()=>({type:RECONNECTED}),startChat=t=>(i,u)=>{const c=u().connection,{formValues:p,loginToken:g}=u().startScreen;let v=c.sessionId;v===void 0&&(v=v4());let x=c.userId;if(x===void 0){const T=api.get("bubble-chat-user-id")||api.get("bubble-chat-userId")||api.get("bf-webclient-userId");x=T||v4(),api.set("bubble-chat-user-id",x)}const E=new URLSearchParams(u().connection.queryString||""),_=Object.fromEntries(E.entries());i({type:START,payload:{sessionId:v,userId:x,clientName:t,loginToken:g,querystrings:{..._,...p}}})},restartChat=()=>(t,i)=>{const u=i().connection.sessionId||"";if(t(terminateSession(u)),t(resetChatState()),i().settings.enableStartScreen)t(showStartScreen());else{const c=getClientName();return t(startChat(c))}},terminateSession=t=>({type:TERMINATE_SESSION,payload:{sessionId:t}}),useAppDispatch=useDispatch,useAppSelector=useSelector,useTranslation=()=>{const t=useAppSelector(u=>u.intl.messages);return u=>t[u]||void 0};var ConnectionStateEnum=(t=>(t[t.CONNECTING=0]="CONNECTING",t[t.CONNECTED=1]="CONNECTED",t[t.RECONNECTED=2]="RECONNECTED",t[t.DISCONNECTED=3]="DISCONNECTED",t))(ConnectionStateEnum||{}),UserType=(t=>(t.GUEST="GUEST",t.BOT="BOT",t.PERSON="PERSON",t))(UserType||{});const container$6="_container_q2uun_1",chatcontent="_chatcontent_q2uun_6",accessabilityHidden="_accessabilityHidden_q2uun_12",styles$n={container:container$6,chatcontent,accessabilityHidden},messageContainer$1="_messageContainer_1t640_1",messages="_messages_1t640_13",styles$m={messageContainer:messageContainer$1,messages};var j;function B(t){if(!j)if(typeof document<"u")j=document.createElement("textarea");else return;var i="&"+t+";";j.innerHTML=i;var u=j.value;return u!==i?u:void 0}var C$1={},Z6=Object.defineProperty,G6=(t,i)=>{for(var u in i)Z6(t,u,{get:i[u],enumerable:!0,configurable:!0,set:c=>i[u]=()=>c})},f=32,l=9,X0=13,d=10,h0=96,t1=126,P1=91,_9=94,I1=62,T9=35,U1=45,d1=61,f1=92,S9=42,e1=95,q9=60,E9=64,D9=93,x9=33,P9=38,I9=58,i1=102,c1=104,b1=119,r9=116,B$=112,zZ=115,_Z=160,qZ=12,f9=46,j9=47,DZ=43,jZ=124,HZ=123,FZ=40,OZ=41,N$=120,b$=88,$9=48,Z9=57,a1=65,r1=90,G9=97,Y9=122,$1=128,WZ=32,Y6={blockQuote:0,breakLine:1,breakThematic:2,codeBlock:3,codeInline:4,footnote:5,footnoteReference:6,frontmatter:7,gfmTask:8,heading:9,htmlBlock:10,htmlComment:11,htmlSelfClosing:12,image:13,link:14,orderedList:15,paragraph:16,ref:17,refCollection:18,table:19,text:20,textFormatted:21,unorderedList:22},W=Y6,P$={};G6(P$,{startsWith:()=>s,slugify:()=>c0,skipWhitespace:()=>S0,shouldFilterTag:()=>$$,sanitizer:()=>s1,parseFrontmatterBounds:()=>L$,normalizeInput:()=>g1,normalizeCRLF:()=>j6,isVoidElement:()=>W9,isUnicodeWhitespace:()=>K9,isUnicodePunctuation:()=>t9,isAlnumCode:()=>o9,isASCIIWhitespace:()=>C9,isASCIIPunctuation:()=>_6,inlineCharTypeTable:()=>g9,includes:()=>V6,htmlAttrsToJSXProps:()=>s9,hasKeys:()=>e9,getTag:()=>H6,getOverrideProps:()=>F6,get:()=>x$,findLineEnd:()=>I,extractPlainText:()=>wZ,endsWith:()=>n9,decodeEntityReferences:()=>O9,charClassTable:()=>F9,applyTagFilterToText:()=>Z$,VOID_ELEMENTS:()=>R$,SHOULD_RENDER_AS_BLOCK_R:()=>T$,SANITIZE_R:()=>H9,NAMED_CODES_TO_UNICODE:()=>K6,HTML_TO_JSX_MAP:()=>AZ,HTML_CHAR_CODE_R:()=>vZ,ATTRIBUTES_TO_SANITIZE:()=>S$});function L$(t){if(!s(t,"---"))return null;let i=3;for(;i<t.length&&(t[i]===" "||t[i]===" ");)i++;if(i<t.length&&t[i]==="\r"&&i++,i>=t.length||t[i]!==`
13
+ `),je}useIsomorphicLayoutEffect(()=>{Ee.current=void 0,ue.current=void 0,H.current=Me});const Ve=reactExports.useMemo(()=>reactExports.createElement(D,{...Me,ref:ne}),[ne,D,Me]);return reactExports.useMemo(()=>k?reactExports.createElement(oe.Provider,{value:Ae},Ve):Ve,[oe,Ve,Ae])}const Z=reactExports.memo(V);if(Z.WrappedComponent=D,Z.displayName=V.displayName=L,E){const Y=reactExports.forwardRef(function(fe,oe){return reactExports.createElement(Z,{...fe,reactReduxForwardedRef:oe})});return Y.displayName=L,Y.WrappedComponent=D,hoistNonReactStatics(Y,D)}return hoistNonReactStatics(Z,D)}}var connect_default=connect$1;function Provider(t){const{children:i,context:u,serverState:c,store:p}=t,g=reactExports.useMemo(()=>{const E=createSubscription(p);return{store:p,subscription:E,getServerState:c?()=>c:void 0}},[p,c]),v=reactExports.useMemo(()=>p.getState(),[p]);useIsomorphicLayoutEffect(()=>{const{subscription:E}=g;return E.onStateChange=E.notifyNestedSubs,E.trySubscribe(),v!==p.getState()&&E.notifyNestedSubs(),()=>{E.tryUnsubscribe(),E.onStateChange=void 0}},[g,v]);const x=u||ReactReduxContext;return reactExports.createElement(x.Provider,{value:g},i)}var Provider_default=Provider;function createReduxContextHook(t=ReactReduxContext){return function(){return reactExports.useContext(t)}}var useReduxContext=createReduxContextHook();function createStoreHook(t=ReactReduxContext){const i=t===ReactReduxContext?useReduxContext:createReduxContextHook(t),u=()=>{const{store:c}=i();return c};return Object.assign(u,{withTypes:()=>u}),u}var useStore=createStoreHook();function createDispatchHook(t=ReactReduxContext){const i=t===ReactReduxContext?useStore:createStoreHook(t),u=()=>i().dispatch;return Object.assign(u,{withTypes:()=>u}),u}var useDispatch=createDispatchHook(),refEquality=(t,i)=>t===i;function createSelectorHook(t=ReactReduxContext){const i=t===ReactReduxContext?useReduxContext:createReduxContextHook(t),u=(c,p={})=>{const{equalityFn:g=refEquality}=typeof p=="function"?{equalityFn:p}:p,v=i(),{store:x,subscription:E,getServerState:_}=v;reactExports.useRef(!0);const T=reactExports.useCallback({[c.name](R){return c(R)}}[c.name],[c]),w=withSelectorExports.useSyncExternalStoreWithSelector(E.addNestedSub,x.getState,_||x.getState,T,g);return reactExports.useDebugValue(w),w};return Object.assign(u,{withTypes:()=>u}),u}var useSelector=createSelectorHook();function r(t){var i,u,c="";if(typeof t=="string"||typeof t=="number")c+=t;else if(typeof t=="object")if(Array.isArray(t)){var p=t.length;for(i=0;i<p;i++)t[i]&&(u=r(t[i]))&&(c&&(c+=" "),c+=u)}else for(u in t)t[u]&&(c&&(c+=" "),c+=u);return c}function clsx(){for(var t,i,u=0,c="",p=arguments.length;u<p;u++)(t=arguments[u])&&(i=r(t))&&(c&&(c+=" "),c+=i);return c}const app="_app_1rj0t_1",styles$o={app},TYPING_ON="core.typing.on",TYPING_OFF="core.typing.off",MESSAGE_FROM_GUEST="core.message.from.guest",MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST="core.message.without.analysis.from.guest",MESSAGE_TO_GUEST="core.message.to.guest",NLU_REQUEST_EVENT="core.nlu.request.event",EVENT_TO_GUEST="core.event.to.guest",RESTART_CHAT_REQUEST="core.chat.restart.request",TRANSCRIPT_MAIL_REQUEST="core.transcript.mail.request",TRANSCRIPT_ITEM_GUEST_REACTION="core.transcript.item.guest.reaction",CONVERSATION_RATING_FROM_GUEST="core.conversation.rating.from.guest",DRAWER_OPEN="core.drawer.open",DRAWER_CLOSE="core.drawer.close",GUEST_LOCALE_CHANGED="core.guest.locale.changed";var ButtonTypeEnum;(function(t){t.WEB_URL="web_url",t.POSTBACK="postback"})(ButtonTypeEnum||(ButtonTypeEnum={}));var SatisfactionEnum;(function(t){t.GOOD="GOOD",t.BAD="BAD"})(SatisfactionEnum||(SatisfactionEnum={}));let Message$2=class{type;sender;sources;quickReplies;constructor(i,u,c=[],p=[]){this.type=i,this.sender=u,this.sources=c,this.quickReplies=p}addQuickReply(i,u){this.quickReplies.push({label:i,payload:u})}},TextMessage$1=class extends Message$2{text;constructor(i,u,c=[],p=[]){super(MessageTypeEnum.TEXT,u,c,p),this.text=i}};var MessageTypeEnum;(function(t){t.TEXT="TEXT",t.DETAIL="DETAIL",t.MARKDOWN="MARKDOWN",t.VIDEO="VIDEO",t.IMAGE="IMAGE",t.FILE="FILE",t.AUDIO="AUDIO"})(MessageTypeEnum||(MessageTypeEnum={}));class User{type;id;name;avatar;constructor(i,u,c,p){this.type=i,this.id=u,this.name=c,this.avatar=p}}class BotUser extends User{constructor(){super(UserType$1.BOT,null,"Chatbot","bot.svg")}}class GuestUser extends User{constructor(){super(UserType$1.GUEST,null,"Guest","visitor.svg")}}var UserType$1;(function(t){t.GUEST="GUEST",t.BOT="BOT",t.PERSON="PERSON"})(UserType$1||(UserType$1={}));const receiveTextMessageFromGuest=t=>{const i=new TextMessage$1(t,new GuestUser);return{type:MESSAGE_FROM_GUEST,message:i}},receiveTextMessageWithoutAnalysisFromGuest=(t,i={})=>{const u=new TextMessage$1(t,new GuestUser);return{type:MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST,message:u,payload:i}},requestNLUEvent$1=t=>({type:NLU_REQUEST_EVENT,event:t}),transcriptItemGuestReaction=(t,i,u=null,c=null)=>({type:TRANSCRIPT_ITEM_GUEST_REACTION,payload:{actionId:t,reaction:i,category:u,comment:c}}),handleQuickReplyClick=t=>i=>(t.payload.type!==MESSAGE_FROM_GUEST&&i(receiveTextMessageWithoutAnalysisFromGuest(t.label,t.payload)),i(t.payload)),sendMessageFromUser=t=>(i,u)=>{const{quickReplies:c}=u().chat,p=c.find(g=>t.toLocaleLowerCase().indexOf(g.label.toLocaleLowerCase())>-1);return i(p?handleQuickReplyClick({...p,label:t}):JSON.parse(JSON.stringify(receiveTextMessageFromGuest(t))))},MESSAGE_TO_PARENT_PAGE="MESSAGE_TO_PARENT_PAGE",RESTORE_PREVIOUS_CHAT_MESSAGES="RESTORE_PREVIOUS_CHAT_MESSAGES",AUDIO_MESSAGE_FROM_USER="AUDIO_MESSAGE_FROM_USER",RECEIVE_SPEECH_TRANSCRIPTION="RECEIVE_SPEECH_TRANSCRIPTION",ENABLE_CONVERSATION_RATING="ENABLE_CONVERSATION_RATING",LOAD_SOURCE_INFOS_RESPONSE="LOAD_SOURCE_INFOS_RESPONSE",LOAD_SOURCE_INFOS_ERROR="LOAD_SOURCE_INFOS_ERROR",LOAD_SOURCE_INFOS_REQUEST="LOAD_SOURCE_INFOS_REQUEST",CLOSE_SOURCE_INFOS="CLOSE_SOURCE_INFOS",GET_STARTED="webclient.get.started",EXPAND_WINDOW="webclient.window.expand",CLOSE_WINDOW="webclient.window.close",DOWNLOAD_TRANSCRIPT_PDF="webclient.transcript.pdf.download",INTERNAL_ACTIONS$1=[MESSAGE_TO_PARENT_PAGE,RESTORE_PREVIOUS_CHAT_MESSAGES,AUDIO_MESSAGE_FROM_USER,RECEIVE_SPEECH_TRANSCRIPTION,ENABLE_CONVERSATION_RATING,LOAD_SOURCE_INFOS_REQUEST,CLOSE_SOURCE_INFOS],sendAudioMessageFromUser=t=>({type:AUDIO_MESSAGE_FROM_USER,buffer:t}),receiveSpeechTranscription=t=>({type:RECEIVE_SPEECH_TRANSCRIPTION,transcription:t}),exportTranscript=t=>({type:TRANSCRIPT_MAIL_REQUEST,payload:{parameters:{mailTo:t}}}),downloadTranscriptPdf=()=>({type:DOWNLOAD_TRANSCRIPT_PDF}),enableConversationRating=({rating:t})=>({type:ENABLE_CONVERSATION_RATING,payload:{rating:t}}),handleRatingFromUser=(t,i)=>({type:CONVERSATION_RATING_FROM_GUEST,payload:{value:t,feedback:i}}),requestNLUEvent=t=>requestNLUEvent$1(t),restorePreviousChatMessages=t=>({type:RESTORE_PREVIOUS_CHAT_MESSAGES,messages:t}),handleButtonClick=t=>{switch(t.type){case ButtonTypeEnum.WEB_URL:return notifyParentToChangePath(t.url);case ButtonTypeEnum.POSTBACK:return t.payload;default:throw new Error(`unknown button type ${t.type}`)}},handleLinkClick=t=>notifyParentToChangePath(t),notifyParentToChangePath=t=>({type:MESSAGE_TO_PARENT_PAGE,message:{type:"webclient.change.url",url:t}});function assign(t){for(var i=1;i<arguments.length;i++){var u=arguments[i];for(var c in u)t[c]=u[c]}return t}var defaultConverter={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function init(t,i){function u(p,g,v){if(!(typeof document>"u")){v=assign({},i,v),typeof v.expires=="number"&&(v.expires=new Date(Date.now()+v.expires*864e5)),v.expires&&(v.expires=v.expires.toUTCString()),p=encodeURIComponent(p).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var x="";for(var E in v)v[E]&&(x+="; "+E,v[E]!==!0&&(x+="="+v[E].split(";")[0]));return document.cookie=p+"="+t.write(g,p)+x}}function c(p){if(!(typeof document>"u"||arguments.length&&!p)){for(var g=document.cookie?document.cookie.split("; "):[],v={},x=0;x<g.length;x++){var E=g[x].split("="),_=E.slice(1).join("=");try{var T=decodeURIComponent(E[0]);if(v[T]=t.read(_,T),p===T)break}catch{}}return p?v[p]:v}}return Object.create({set:u,get:c,remove:function(p,g){u(p,"",assign({},g,{expires:-1}))},withAttributes:function(p){return init(this.converter,assign({},this.attributes,p))},withConverter:function(p){return init(assign({},this.converter,p),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(t)}})}var api=init(defaultConverter,{path:"/"});const byteToHex=[];for(let t=0;t<256;++t)byteToHex.push((t+256).toString(16).slice(1));function unsafeStringify(t,i=0){return(byteToHex[t[i+0]]+byteToHex[t[i+1]]+byteToHex[t[i+2]]+byteToHex[t[i+3]]+"-"+byteToHex[t[i+4]]+byteToHex[t[i+5]]+"-"+byteToHex[t[i+6]]+byteToHex[t[i+7]]+"-"+byteToHex[t[i+8]]+byteToHex[t[i+9]]+"-"+byteToHex[t[i+10]]+byteToHex[t[i+11]]+byteToHex[t[i+12]]+byteToHex[t[i+13]]+byteToHex[t[i+14]]+byteToHex[t[i+15]]).toLowerCase()}let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");getRandomValues=crypto.getRandomValues.bind(crypto)}return getRandomValues(rnds8)}const randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native={randomUUID};function _v4(t,i,u){t=t||{};const c=t.random??t.rng?.()??rng();if(c.length<16)throw new Error("Random bytes length must be >= 16");return c[6]=c[6]&15|64,c[8]=c[8]&63|128,unsafeStringify(c)}function v4(t,i,u){return native.randomUUID&&!t?native.randomUUID():_v4(t)}const getClientName=()=>extractClientNameFromPathname(window.location.pathname),extractClientNameFromPathname=t=>{const i=t.split("/"),u=t.endsWith("/");return i[i.length-(u?2:1)]};function formatProdErrorMessage$1(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var $$observable=typeof Symbol=="function"&&Symbol.observable||"@@observable",symbol_observable_default=$$observable,randomString$1=()=>Math.random().toString(36).substring(7).split("").join("."),ActionTypes={INIT:`@@redux/INIT${randomString$1()}`,REPLACE:`@@redux/REPLACE${randomString$1()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${randomString$1()}`},actionTypes_default=ActionTypes;function isPlainObject$1(t){if(typeof t!="object"||t===null)return!1;let i=t;for(;Object.getPrototypeOf(i)!==null;)i=Object.getPrototypeOf(i);return Object.getPrototypeOf(t)===i||Object.getPrototypeOf(t)===null}function createStore(t,i,u){if(typeof t!="function")throw new Error(formatProdErrorMessage$1(2));if(typeof i=="function"&&typeof u=="function"||typeof u=="function"&&typeof arguments[3]=="function")throw new Error(formatProdErrorMessage$1(0));if(typeof i=="function"&&typeof u>"u"&&(u=i,i=void 0),typeof u<"u"){if(typeof u!="function")throw new Error(formatProdErrorMessage$1(1));return u(createStore)(t,i)}let c=t,p=i,g=new Map,v=g,x=0,E=!1;function _(){v===g&&(v=new Map,g.forEach((D,z)=>{v.set(z,D)}))}function T(){if(E)throw new Error(formatProdErrorMessage$1(3));return p}function w(D){if(typeof D!="function")throw new Error(formatProdErrorMessage$1(4));if(E)throw new Error(formatProdErrorMessage$1(5));let z=!0;_();const L=x++;return v.set(L,D),function(){if(z){if(E)throw new Error(formatProdErrorMessage$1(6));z=!1,_(),v.delete(L),g=null}}}function R(D){if(!isPlainObject$1(D))throw new Error(formatProdErrorMessage$1(7));if(typeof D.type>"u")throw new Error(formatProdErrorMessage$1(8));if(typeof D.type!="string")throw new Error(formatProdErrorMessage$1(17));if(E)throw new Error(formatProdErrorMessage$1(9));try{E=!0,p=c(p,D)}finally{E=!1}return(g=v).forEach(L=>{L()}),D}function M(D){if(typeof D!="function")throw new Error(formatProdErrorMessage$1(10));c=D,R({type:actionTypes_default.REPLACE})}function k(){const D=w;return{subscribe(z){if(typeof z!="object"||z===null)throw new Error(formatProdErrorMessage$1(11));function L(){const V=z;V.next&&V.next(T())}return L(),{unsubscribe:D(L)}},[symbol_observable_default](){return this}}}return R({type:actionTypes_default.INIT}),{dispatch:R,subscribe:w,getState:T,replaceReducer:M,[symbol_observable_default]:k}}function assertReducerShape(t){Object.keys(t).forEach(i=>{const u=t[i];if(typeof u(void 0,{type:actionTypes_default.INIT})>"u")throw new Error(formatProdErrorMessage$1(12));if(typeof u(void 0,{type:actionTypes_default.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(formatProdErrorMessage$1(13))})}function combineReducers(t){const i=Object.keys(t),u={};for(let g=0;g<i.length;g++){const v=i[g];typeof t[v]=="function"&&(u[v]=t[v])}const c=Object.keys(u);let p;try{assertReducerShape(u)}catch(g){p=g}return function(v={},x){if(p)throw p;let E=!1;const _={};for(let T=0;T<c.length;T++){const w=c[T],R=u[w],M=v[w],k=R(M,x);if(typeof k>"u")throw x&&x.type,new Error(formatProdErrorMessage$1(14));_[w]=k,E=E||k!==M}return E=E||c.length!==Object.keys(v).length,E?_:v}}function compose(...t){return t.length===0?i=>i:t.length===1?t[0]:t.reduce((i,u)=>(...c)=>i(u(...c)))}function applyMiddleware(...t){return i=>(u,c)=>{const p=i(u,c);let g=()=>{throw new Error(formatProdErrorMessage$1(15))};const v={getState:p.getState,dispatch:(E,..._)=>g(E,..._)},x=t.map(E=>E(v));return g=compose(...x)(p.dispatch),{...p,dispatch:g}}}function isAction(t){return isPlainObject$1(t)&&"type"in t&&typeof t.type=="string"}var NOTHING=Symbol.for("immer-nothing"),DRAFTABLE=Symbol.for("immer-draftable"),DRAFT_STATE=Symbol.for("immer-state");function die(t,...i){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var O=Object,getPrototypeOf$1=O.getPrototypeOf,CONSTRUCTOR="constructor",PROTOTYPE="prototype",CONFIGURABLE="configurable",ENUMERABLE="enumerable",WRITABLE="writable",VALUE="value",isDraft=t=>!!t&&!!t[DRAFT_STATE];function isDraftable(t){return t?isPlainObject(t)||isArray(t)||!!t[DRAFTABLE]||!!t[CONSTRUCTOR]?.[DRAFTABLE]||isMap(t)||isSet(t):!1}var objectCtorString=O[PROTOTYPE][CONSTRUCTOR].toString(),cachedCtorStrings=new WeakMap;function isPlainObject(t){if(!t||!isObjectish(t))return!1;const i=getPrototypeOf$1(t);if(i===null||i===O[PROTOTYPE])return!0;const u=O.hasOwnProperty.call(i,CONSTRUCTOR)&&i[CONSTRUCTOR];if(u===Object)return!0;if(!isFunction(u))return!1;let c=cachedCtorStrings.get(u);return c===void 0&&(c=Function.toString.call(u),cachedCtorStrings.set(u,c)),c===objectCtorString}function each(t,i,u=!0){getArchtype(t)===0?(u?Reflect.ownKeys(t):O.keys(t)).forEach(p=>{i(p,t[p],t)}):t.forEach((c,p)=>i(p,c,t))}function getArchtype(t){const i=t[DRAFT_STATE];return i?i.type_:isArray(t)?1:isMap(t)?2:isSet(t)?3:0}var has=(t,i,u=getArchtype(t))=>u===2?t.has(i):O[PROTOTYPE].hasOwnProperty.call(t,i),get=(t,i,u=getArchtype(t))=>u===2?t.get(i):t[i],set=(t,i,u,c=getArchtype(t))=>{c===2?t.set(i,u):c===3?t.add(u):t[i]=u};function is(t,i){return t===i?t!==0||1/t===1/i:t!==t&&i!==i}var isArray=Array.isArray,isMap=t=>t instanceof Map,isSet=t=>t instanceof Set,isObjectish=t=>typeof t=="object",isFunction=t=>typeof t=="function",isBoolean$1=t=>typeof t=="boolean";function isArrayIndex(t){const i=+t;return Number.isInteger(i)&&String(i)===t}var latest=t=>t.copy_||t.base_,getFinalValue=t=>t.modified_?t.copy_:t.base_;function shallowCopy(t,i){if(isMap(t))return new Map(t);if(isSet(t))return new Set(t);if(isArray(t))return Array[PROTOTYPE].slice.call(t);const u=isPlainObject(t);if(i===!0||i==="class_only"&&!u){const c=O.getOwnPropertyDescriptors(t);delete c[DRAFT_STATE];let p=Reflect.ownKeys(c);for(let g=0;g<p.length;g++){const v=p[g],x=c[v];x[WRITABLE]===!1&&(x[WRITABLE]=!0,x[CONFIGURABLE]=!0),(x.get||x.set)&&(c[v]={[CONFIGURABLE]:!0,[WRITABLE]:!0,[ENUMERABLE]:x[ENUMERABLE],[VALUE]:t[v]})}return O.create(getPrototypeOf$1(t),c)}else{const c=getPrototypeOf$1(t);if(c!==null&&u)return{...t};const p=O.create(c);return O.assign(p,t)}}function freeze$1(t,i=!1){return isFrozen$1(t)||isDraft(t)||!isDraftable(t)||(getArchtype(t)>1&&O.defineProperties(t,{set:dontMutateMethodOverride,add:dontMutateMethodOverride,clear:dontMutateMethodOverride,delete:dontMutateMethodOverride}),O.freeze(t),i&&each(t,(u,c)=>{freeze$1(c,!0)},!1)),t}function dontMutateFrozenCollections(){die(2)}var dontMutateMethodOverride={[VALUE]:dontMutateFrozenCollections};function isFrozen$1(t){return t===null||!isObjectish(t)?!0:O.isFrozen(t)}var PluginMapSet="MapSet",PluginPatches="Patches",PluginArrayMethods="ArrayMethods",plugins={};function getPlugin(t){const i=plugins[t];return i||die(0,t),i}var isPluginLoaded=t=>!!plugins[t],currentScope,getCurrentScope=()=>currentScope,createScope=(t,i)=>({drafts_:[],parent_:t,immer_:i,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:isPluginLoaded(PluginMapSet)?getPlugin(PluginMapSet):void 0,arrayMethodsPlugin_:isPluginLoaded(PluginArrayMethods)?getPlugin(PluginArrayMethods):void 0});function usePatchesInScope(t,i){i&&(t.patchPlugin_=getPlugin(PluginPatches),t.patches_=[],t.inversePatches_=[],t.patchListener_=i)}function revokeScope(t){leaveScope(t),t.drafts_.forEach(revokeDraft),t.drafts_=null}function leaveScope(t){t===currentScope&&(currentScope=t.parent_)}var enterScope=t=>currentScope=createScope(currentScope,t);function revokeDraft(t){const i=t[DRAFT_STATE];i.type_===0||i.type_===1?i.revoke_():i.revoked_=!0}function processResult(t,i){i.unfinalizedDrafts_=i.drafts_.length;const u=i.drafts_[0];if(t!==void 0&&t!==u){u[DRAFT_STATE].modified_&&(revokeScope(i),die(4)),isDraftable(t)&&(t=finalize(i,t));const{patchPlugin_:p}=i;p&&p.generateReplacementPatches_(u[DRAFT_STATE].base_,t,i)}else t=finalize(i,u);return maybeFreeze(i,t,!0),revokeScope(i),i.patches_&&i.patchListener_(i.patches_,i.inversePatches_),t!==NOTHING?t:void 0}function finalize(t,i){if(isFrozen$1(i))return i;const u=i[DRAFT_STATE];if(!u)return handleValue(i,t.handledSet_,t);if(!isSameScope(u,t))return i;if(!u.modified_)return u.base_;if(!u.finalized_){const{callbacks_:c}=u;if(c)for(;c.length>0;)c.pop()(t);generatePatchesAndFinalize(u,t)}return u.copy_}function maybeFreeze(t,i,u=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&freeze$1(i,u)}function markStateFinalized(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var isSameScope=(t,i)=>t.scope_===i,EMPTY_LOCATIONS_RESULT=[];function updateDraftInParent(t,i,u,c){const p=latest(t),g=t.type_;if(c!==void 0&&get(p,c,g)===i){set(p,c,u,g);return}if(!t.draftLocations_){const x=t.draftLocations_=new Map;each(p,(E,_)=>{if(isDraft(_)){const T=x.get(_)||[];T.push(E),x.set(_,T)}})}const v=t.draftLocations_.get(i)??EMPTY_LOCATIONS_RESULT;for(const x of v)set(p,x,u,g)}function registerChildFinalizationCallback(t,i,u){t.callbacks_.push(function(p){const g=i;if(!g||!isSameScope(g,p))return;p.mapSetPlugin_?.fixSetContents(g);const v=getFinalValue(g);updateDraftInParent(t,g.draft_??g,v,u),generatePatchesAndFinalize(g,p)})}function generatePatchesAndFinalize(t,i){if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){const{patchPlugin_:c}=i;if(c){const p=c.getPath(t);p&&c.generatePatches_(t,p,i)}markStateFinalized(t)}}function handleCrossReference(t,i,u){const{scope_:c}=t;if(isDraft(u)){const p=u[DRAFT_STATE];isSameScope(p,c)&&p.callbacks_.push(function(){prepareCopy(t);const v=getFinalValue(p);updateDraftInParent(t,u,v,i)})}else isDraftable(u)&&t.callbacks_.push(function(){const g=latest(t);t.type_===3?g.has(u)&&handleValue(u,c.handledSet_,c):get(g,i,t.type_)===u&&c.drafts_.length>1&&(t.assigned_.get(i)??!1)===!0&&t.copy_&&handleValue(get(t.copy_,i,t.type_),c.handledSet_,c)})}function handleValue(t,i,u){return!u.immer_.autoFreeze_&&u.unfinalizedDrafts_<1||isDraft(t)||i.has(t)||!isDraftable(t)||isFrozen$1(t)||(i.add(t),each(t,(c,p)=>{if(isDraft(p)){const g=p[DRAFT_STATE];if(isSameScope(g,u)){const v=getFinalValue(g);set(t,c,v,t.type_),markStateFinalized(g)}}else isDraftable(p)&&handleValue(p,i,u)})),t}function createProxyProxy(t,i){const u=isArray(t),c={type_:u?1:0,scope_:i?i.scope_:getCurrentScope(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:i,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let p=c,g=objectTraps;u&&(p=[c],g=arrayTraps);const{revoke:v,proxy:x}=Proxy.revocable(p,g);return c.draft_=x,c.revoke_=v,[x,c]}var objectTraps={get(t,i){if(i===DRAFT_STATE)return t;let u=t.scope_.arrayMethodsPlugin_;const c=t.type_===1&&typeof i=="string";if(c&&u?.isArrayOperationMethod(i))return u.createMethodInterceptor(t,i);const p=latest(t);if(!has(p,i,t.type_))return readPropFromProto(t,p,i);const g=p[i];if(t.finalized_||!isDraftable(g)||c&&t.operationMethod&&u?.isMutatingArrayMethod(t.operationMethod)&&isArrayIndex(i))return g;if(g===peek(t.base_,i)){prepareCopy(t);const v=t.type_===1?+i:i,x=createProxy(t.scope_,g,t,v);return t.copy_[v]=x}return g},has(t,i){return i in latest(t)},ownKeys(t){return Reflect.ownKeys(latest(t))},set(t,i,u){const c=getDescriptorFromProto(latest(t),i);if(c?.set)return c.set.call(t.draft_,u),!0;if(!t.modified_){const p=peek(latest(t),i),g=p?.[DRAFT_STATE];if(g&&g.base_===u)return t.copy_[i]=u,t.assigned_.set(i,!1),!0;if(is(u,p)&&(u!==void 0||has(t.base_,i,t.type_)))return!0;prepareCopy(t),markChanged(t)}return t.copy_[i]===u&&(u!==void 0||i in t.copy_)||Number.isNaN(u)&&Number.isNaN(t.copy_[i])||(t.copy_[i]=u,t.assigned_.set(i,!0),handleCrossReference(t,i,u)),!0},deleteProperty(t,i){return prepareCopy(t),peek(t.base_,i)!==void 0||i in t.base_?(t.assigned_.set(i,!1),markChanged(t)):t.assigned_.delete(i),t.copy_&&delete t.copy_[i],!0},getOwnPropertyDescriptor(t,i){const u=latest(t),c=Reflect.getOwnPropertyDescriptor(u,i);return c&&{[WRITABLE]:!0,[CONFIGURABLE]:t.type_!==1||i!=="length",[ENUMERABLE]:c[ENUMERABLE],[VALUE]:u[i]}},defineProperty(){die(11)},getPrototypeOf(t){return getPrototypeOf$1(t.base_)},setPrototypeOf(){die(12)}},arrayTraps={};for(let t in objectTraps){let i=objectTraps[t];arrayTraps[t]=function(){const u=arguments;return u[0]=u[0][0],i.apply(this,u)}}arrayTraps.deleteProperty=function(t,i){return arrayTraps.set.call(this,t,i,void 0)};arrayTraps.set=function(t,i,u){return objectTraps.set.call(this,t[0],i,u,t[0])};function peek(t,i){const u=t[DRAFT_STATE];return(u?latest(u):t)[i]}function readPropFromProto(t,i,u){const c=getDescriptorFromProto(i,u);return c?VALUE in c?c[VALUE]:c.get?.call(t.draft_):void 0}function getDescriptorFromProto(t,i){if(!(i in t))return;let u=getPrototypeOf$1(t);for(;u;){const c=Object.getOwnPropertyDescriptor(u,i);if(c)return c;u=getPrototypeOf$1(u)}}function markChanged(t){t.modified_||(t.modified_=!0,t.parent_&&markChanged(t.parent_))}function prepareCopy(t){t.copy_||(t.assigned_=new Map,t.copy_=shallowCopy(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var Immer2=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(i,u,c)=>{if(isFunction(i)&&!isFunction(u)){const g=u;u=i;const v=this;return function(E=g,..._){return v.produce(E,T=>u.call(this,T,..._))}}isFunction(u)||die(6),c!==void 0&&!isFunction(c)&&die(7);let p;if(isDraftable(i)){const g=enterScope(this),v=createProxy(g,i,void 0);let x=!0;try{p=u(v),x=!1}finally{x?revokeScope(g):leaveScope(g)}return usePatchesInScope(g,c),processResult(p,g)}else if(!i||!isObjectish(i)){if(p=u(i),p===void 0&&(p=i),p===NOTHING&&(p=void 0),this.autoFreeze_&&freeze$1(p,!0),c){const g=[],v=[];getPlugin(PluginPatches).generateReplacementPatches_(i,p,{patches_:g,inversePatches_:v}),c(g,v)}return p}else die(1,i)},this.produceWithPatches=(i,u)=>{if(isFunction(i))return(v,...x)=>this.produceWithPatches(v,E=>i(E,...x));let c,p;return[this.produce(i,u,(v,x)=>{c=v,p=x}),c,p]},isBoolean$1(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),isBoolean$1(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),isBoolean$1(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){isDraftable(t)||die(8),isDraft(t)&&(t=current(t));const i=enterScope(this),u=createProxy(i,t,void 0);return u[DRAFT_STATE].isManual_=!0,leaveScope(i),u}finishDraft(t,i){const u=t&&t[DRAFT_STATE];(!u||!u.isManual_)&&die(9);const{scope_:c}=u;return usePatchesInScope(c,i),processResult(void 0,c)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,i){let u;for(u=i.length-1;u>=0;u--){const p=i[u];if(p.path.length===0&&p.op==="replace"){t=p.value;break}}u>-1&&(i=i.slice(u+1));const c=getPlugin(PluginPatches).applyPatches_;return isDraft(t)?c(t,i):this.produce(t,p=>c(p,i))}};function createProxy(t,i,u,c){const[p,g]=isMap(i)?getPlugin(PluginMapSet).proxyMap_(i,u):isSet(i)?getPlugin(PluginMapSet).proxySet_(i,u):createProxyProxy(i,u);return(u?.scope_??getCurrentScope()).drafts_.push(p),g.callbacks_=u?.callbacks_??[],g.key_=c,u&&c!==void 0?registerChildFinalizationCallback(u,g,c):g.callbacks_.push(function(E){E.mapSetPlugin_?.fixSetContents(g);const{patchPlugin_:_}=E;g.modified_&&_&&_.generatePatches_(g,[],E)}),p}function current(t){return isDraft(t)||die(10,t),currentImpl(t)}function currentImpl(t){if(!isDraftable(t)||isFrozen$1(t))return t;const i=t[DRAFT_STATE];let u,c=!0;if(i){if(!i.modified_)return i.base_;i.finalized_=!0,u=shallowCopy(t,i.scope_.immer_.useStrictShallowCopy_),c=i.scope_.immer_.shouldUseStrictIteration()}else u=shallowCopy(t,!0);return each(u,(p,g)=>{set(u,p,currentImpl(g))},c),i&&(i.finalized_=!1),u}var immer=new Immer2,produce=immer.produce;function createThunkMiddleware(t){return({dispatch:u,getState:c})=>p=>g=>typeof g=="function"?g(u,c,t):p(g)}var thunk=createThunkMiddleware(),withExtraArgument=createThunkMiddleware,composeWithDevTools=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?compose:compose.apply(null,arguments)};function createAction(t,i){function u(...c){if(i){let p=i(...c);if(!p)throw new Error(formatProdErrorMessage(0));return{type:t,payload:p.payload,..."meta"in p&&{meta:p.meta},..."error"in p&&{error:p.error}}}return{type:t,payload:c[0]}}return u.toString=()=>`${t}`,u.type=t,u.match=c=>isAction(c)&&c.type===t,u}var Tuple=class Xr extends Array{constructor(...i){super(...i),Object.setPrototypeOf(this,Xr.prototype)}static get[Symbol.species](){return Xr}concat(...i){return super.concat.apply(this,i)}prepend(...i){return i.length===1&&Array.isArray(i[0])?new Xr(...i[0].concat(this)):new Xr(...i.concat(this))}};function freezeDraftable(t){return isDraftable(t)?produce(t,()=>{}):t}function getOrInsertComputed(t,i,u){return t.has(i)?t.get(i):t.set(i,u(i)).get(i)}function isBoolean(t){return typeof t=="boolean"}var buildGetDefaultMiddleware=()=>function(i){const{thunk:u=!0,immutableCheck:c=!0,serializableCheck:p=!0,actionCreatorCheck:g=!0}=i??{};let v=new Tuple;return u&&(isBoolean(u)?v.push(thunk):v.push(withExtraArgument(u.extraArgument))),v},SHOULD_AUTOBATCH="RTK_autoBatch",createQueueWithTimer=t=>i=>{setTimeout(i,t)},autoBatchEnhancer=(t={type:"raf"})=>i=>(...u)=>{const c=i(...u);let p=!0,g=!1,v=!1;const x=new Set,E=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:createQueueWithTimer(10):t.type==="callback"?t.queueNotification:createQueueWithTimer(t.timeout),_=()=>{v=!1,g&&(g=!1,x.forEach(T=>T()))};return Object.assign({},c,{subscribe(T){const w=()=>p&&T(),R=c.subscribe(w);return x.add(T),()=>{R(),x.delete(T)}},dispatch(T){try{return p=!T?.meta?.[SHOULD_AUTOBATCH],g=!p,g&&(v||(v=!0,E(_))),c.dispatch(T)}finally{p=!0}}})},buildGetDefaultEnhancers=t=>function(u){const{autoBatch:c=!0}=u??{};let p=new Tuple(t);return c&&p.push(autoBatchEnhancer(typeof c=="object"?c:void 0)),p};function configureStore(t){const i=buildGetDefaultMiddleware(),{reducer:u=void 0,middleware:c,devTools:p=!0,preloadedState:g=void 0,enhancers:v=void 0}=t||{};let x;if(typeof u=="function")x=u;else if(isPlainObject$1(u))x=combineReducers(u);else throw new Error(formatProdErrorMessage(1));let E;typeof c=="function"?E=c(i):E=i();let _=compose;p&&(_=composeWithDevTools({trace:!1,...typeof p=="object"&&p}));const T=applyMiddleware(...E),w=buildGetDefaultEnhancers(T);let R=typeof v=="function"?v(w):w();const M=_(...R);return createStore(x,g,M)}function executeReducerBuilderCallback(t){const i={},u=[];let c;const p={addCase(g,v){const x=typeof g=="string"?g:g.type;if(!x)throw new Error(formatProdErrorMessage(28));if(x in i)throw new Error(formatProdErrorMessage(29));return i[x]=v,p},addAsyncThunk(g,v){return v.pending&&(i[g.pending.type]=v.pending),v.rejected&&(i[g.rejected.type]=v.rejected),v.fulfilled&&(i[g.fulfilled.type]=v.fulfilled),v.settled&&u.push({matcher:g.settled,reducer:v.settled}),p},addMatcher(g,v){return u.push({matcher:g,reducer:v}),p},addDefaultCase(g){return c=g,p}};return t(p),[i,u,c]}function isStateFunction(t){return typeof t=="function"}function createReducer(t,i){let[u,c,p]=executeReducerBuilderCallback(i),g;if(isStateFunction(t))g=()=>freezeDraftable(t());else{const x=freezeDraftable(t);g=()=>x}function v(x=g(),E){let _=[u[E.type],...c.filter(({matcher:T})=>T(E)).map(({reducer:T})=>T)];return _.filter(T=>!!T).length===0&&(_=[p]),_.reduce((T,w)=>{if(w)if(isDraft(T)){const M=w(T,E);return M===void 0?T:M}else{if(isDraftable(T))return produce(T,R=>w(R,E));{const R=w(T,E);if(R===void 0){if(T===null)return T;throw Error("A case reducer on a non-draftable value must not return undefined")}return R}}return T},x)}return v.getInitialState=g,v}var asyncThunkSymbol=Symbol.for("rtk-slice-createasyncthunk");function getType(t,i){return`${t}/${i}`}function buildCreateSlice({creators:t}={}){const i=t?.asyncThunk?.[asyncThunkSymbol];return function(c){const{name:p,reducerPath:g=p}=c;if(!p)throw new Error(formatProdErrorMessage(11));const v=(typeof c.reducers=="function"?c.reducers(buildReducerCreators()):c.reducers)||{},x=Object.keys(v),E={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},_={addCase(U,V){const Q=typeof U=="string"?U:U.type;if(!Q)throw new Error(formatProdErrorMessage(12));if(Q in E.sliceCaseReducersByType)throw new Error(formatProdErrorMessage(13));return E.sliceCaseReducersByType[Q]=V,_},addMatcher(U,V){return E.sliceMatchers.push({matcher:U,reducer:V}),_},exposeAction(U,V){return E.actionCreators[U]=V,_},exposeCaseReducer(U,V){return E.sliceCaseReducersByName[U]=V,_}};x.forEach(U=>{const V=v[U],Q={reducerName:U,type:getType(p,U),createNotation:typeof c.reducers=="function"};isAsyncThunkSliceReducerDefinition(V)?handleThunkCaseReducerDefinition(Q,V,_,i):handleNormalReducerDefinition(Q,V,_)});function T(){const[U={},V=[],Q=void 0]=typeof c.extraReducers=="function"?executeReducerBuilderCallback(c.extraReducers):[c.extraReducers],Z={...U,...E.sliceCaseReducersByType};return createReducer(c.initialState,F=>{for(let Y in Z)F.addCase(Y,Z[Y]);for(let Y of E.sliceMatchers)F.addMatcher(Y.matcher,Y.reducer);for(let Y of V)F.addMatcher(Y.matcher,Y.reducer);Q&&F.addDefaultCase(Q)})}const w=U=>U,R=new Map,M=new WeakMap;let k;function A(U,V){return k||(k=T()),k(U,V)}function D(){return k||(k=T()),k.getInitialState()}function z(U,V=!1){function Q(F){let Y=F[U];return typeof Y>"u"&&V&&(Y=getOrInsertComputed(M,Q,D)),Y}function Z(F=w){const Y=getOrInsertComputed(R,V,()=>new WeakMap);return getOrInsertComputed(Y,F,()=>{const ne={};for(const[fe,oe]of Object.entries(c.selectors??{}))ne[fe]=wrapSelector(oe,F,()=>getOrInsertComputed(M,F,D),V);return ne})}return{reducerPath:U,getSelectors:Z,get selectors(){return Z(Q)},selectSlice:Q}}const L={name:p,reducer:A,actions:E.actionCreators,caseReducers:E.sliceCaseReducersByName,getInitialState:D,...z(g),injectInto(U,{reducerPath:V,...Q}={}){const Z=V??g;return U.inject({reducerPath:Z,reducer:A},Q),{...L,...z(Z,!0)}}};return L}}function wrapSelector(t,i,u,c){function p(g,...v){let x=i(g);return typeof x>"u"&&c&&(x=u()),t(x,...v)}return p.unwrapped=t,p}var createSlice=buildCreateSlice();function buildReducerCreators(){function t(i,u){return{_reducerDefinitionType:"asyncThunk",payloadCreator:i,...u}}return t.withTypes=()=>t,{reducer(i){return Object.assign({[i.name](...u){return i(...u)}}[i.name],{_reducerDefinitionType:"reducer"})},preparedReducer(i,u){return{_reducerDefinitionType:"reducerWithPrepare",prepare:i,reducer:u}},asyncThunk:t}}function handleNormalReducerDefinition({type:t,reducerName:i,createNotation:u},c,p){let g,v;if("reducer"in c){if(u&&!isCaseReducerWithPrepareDefinition(c))throw new Error(formatProdErrorMessage(17));g=c.reducer,v=c.prepare}else g=c;p.addCase(t,g).exposeCaseReducer(i,g).exposeAction(i,v?createAction(t,v):createAction(t))}function isAsyncThunkSliceReducerDefinition(t){return t._reducerDefinitionType==="asyncThunk"}function isCaseReducerWithPrepareDefinition(t){return t._reducerDefinitionType==="reducerWithPrepare"}function handleThunkCaseReducerDefinition({type:t,reducerName:i},u,c,p){if(!p)throw new Error(formatProdErrorMessage(18));const{payloadCreator:g,fulfilled:v,pending:x,rejected:E,settled:_,options:T}=u,w=p(t,g,T);c.exposeAction(i,w),v&&c.addCase(w.fulfilled,v),x&&c.addCase(w.pending,x),E&&c.addCase(w.rejected,E),_&&c.addMatcher(w.settled,_),c.exposeCaseReducer(i,{fulfilled:v||noop,pending:x||noop,rejected:E||noop,settled:_||noop})}function noop(){}function formatProdErrorMessage(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}const initialState$4={formValues:{}},startPageSlice=createSlice({name:"start-screen",initialState:initialState$4,reducers:{showStartScreen(t){t.startScreenStatus="VISIBLE",t.formValues={}},startChat(t,i){t.startScreenStatus="HIDDEN",t.formValues=i.payload.formValues},startAuthenticatedChat(t,i){t.startScreenStatus="HIDDEN",t.loginToken=i.payload.loginToken,t.loginRequestToken=void 0},requestLogin(t,i){t.loginRequestToken=i.payload.loginRequestToken,t.formValues=i.payload.formValues},loginWindowClosed(t){t.loginRequestToken=void 0}}}),{startChat:startChat$1,startAuthenticatedChat,showStartScreen,requestLogin,loginWindowClosed}=startPageSlice.actions,startScreenReducer=startPageSlice.reducer,RESET_CHAT_STATE="RESET_CHAT_STATE",TOGGLE_TRANSCRIPT_MAIL_OVERLAY="TOGGLE_TRANSCRIPT_MAIL_OVERLAY",SHOW_CONVERSATION_RATING_OVERLAY="SHOW_CONVERSATION_RATING_OVERLAY",HIDE_CONVERSATION_RATING_OVERLAY="HIDE_CONVERSATION_RATING_OVERLAY",closeChatWindow=()=>({type:CLOSE_WINDOW}),resetChatState=()=>({type:RESET_CHAT_STATE}),toggleTranscriptMailOverlay=()=>({type:TOGGLE_TRANSCRIPT_MAIL_OVERLAY}),showConversationRatingOverlay=(t,i=void 0)=>({type:SHOW_CONVERSATION_RATING_OVERLAY,payload:{opener:t,defaultRating:i}}),hideConversationRatingOverlay=()=>({type:HIDE_CONVERSATION_RATING_OVERLAY}),loadSourceInfosRequest=(t,i,u)=>(c,p)=>{try{const g=p().connection.sessionId;if(!g)throw new Error("Session ID is not available");c({type:LOAD_SOURCE_INFOS_REQUEST,payload:{chunkId:u}}),fetchSourceInfos(t,g,i,u,!1,c),fetchSourceInfos(t,g,i,u,!0,c)}catch(g){console.error("Error loading source infos:",g),c({type:LOAD_SOURCE_INFOS_ERROR})}},fetchSourceInfos=(t,i,u,c,p,g)=>{const v=`/${t}/me/chat-widget/transcript/${u}/chunks/${c}?highlight=${p}`;fetch(v,{headers:{"x-bubble-chat-session-id":i}}).then(x=>{if(!x.ok)throw new Error(`HTTP error! Status: ${x.status}`);return x.json()}).then(x=>{const E={...x,chunkId:c,highlighted:p};g({type:LOAD_SOURCE_INFOS_RESPONSE,payload:E})}).catch(x=>{console.error("Error fetching source infos:",x),g({type:LOAD_SOURCE_INFOS_ERROR,payload:{highlighted:p}})})},closeSourceInfos=()=>({type:CLOSE_SOURCE_INFOS}),CONNECT="CONNECT",CONNECTING="CONNECTING",CONNECTED="CONNECTED",DISCONNECTED="DISCONNECTED",RECONNECTED="RECONNECTED",RESTORE_SESSION_ID="RESTORE_SESSION_ID",START="START",TERMINATE_SESSION="CLEAR_SESSION_ID",INTERNAL_ACTIONS=[CONNECT,CONNECTING,CONNECTED,DISCONNECTED,RECONNECTED,RESTORE_SESSION_ID],connect=(t,i)=>({type:CONNECT,clientName:t,querystrings:i}),restoreSessionId=t=>({type:RESTORE_SESSION_ID,sessionId:t}),connecting=()=>({type:CONNECTING}),connected=()=>({type:CONNECTED}),disconnected=()=>({type:DISCONNECTED}),reconnected=()=>({type:RECONNECTED}),startChat=t=>(i,u)=>{const c=u().connection,{formValues:p,loginToken:g}=u().startScreen;let v=c.sessionId;v===void 0&&(v=v4());let x=c.userId;if(x===void 0){const T=api.get("bubble-chat-user-id")||api.get("bubble-chat-userId")||api.get("bf-webclient-userId");x=T||v4(),api.set("bubble-chat-user-id",x,{expires:182})}const E=new URLSearchParams(u().connection.queryString||""),_=Object.fromEntries(E.entries());i({type:START,payload:{sessionId:v,userId:x,clientName:t,loginToken:g,querystrings:{..._,...p}}})},restartChat=()=>(t,i)=>{const u=i().connection.sessionId||"";if(t(terminateSession(u)),t(resetChatState()),i().settings.enableStartScreen)t(showStartScreen());else{const c=getClientName();return t(startChat(c))}},terminateSession=t=>({type:TERMINATE_SESSION,payload:{sessionId:t}}),useAppDispatch=useDispatch,useAppSelector=useSelector,useTranslation=()=>{const t=useAppSelector(u=>u.intl.messages);return u=>t[u]||void 0};var ConnectionStateEnum=(t=>(t[t.CONNECTING=0]="CONNECTING",t[t.CONNECTED=1]="CONNECTED",t[t.RECONNECTED=2]="RECONNECTED",t[t.DISCONNECTED=3]="DISCONNECTED",t))(ConnectionStateEnum||{}),UserType=(t=>(t.GUEST="GUEST",t.BOT="BOT",t.PERSON="PERSON",t))(UserType||{});const container$6="_container_q2uun_1",chatcontent="_chatcontent_q2uun_6",accessabilityHidden="_accessabilityHidden_q2uun_12",styles$n={container:container$6,chatcontent,accessabilityHidden},messageContainer$1="_messageContainer_1t640_1",messages="_messages_1t640_13",styles$m={messageContainer:messageContainer$1,messages};var j;function B(t){if(!j)if(typeof document<"u")j=document.createElement("textarea");else return;var i="&"+t+";";j.innerHTML=i;var u=j.value;return u!==i?u:void 0}var C$1={},Z6=Object.defineProperty,G6=(t,i)=>{for(var u in i)Z6(t,u,{get:i[u],enumerable:!0,configurable:!0,set:c=>i[u]=()=>c})},f=32,l=9,X0=13,d=10,h0=96,t1=126,P1=91,_9=94,I1=62,T9=35,U1=45,d1=61,f1=92,S9=42,e1=95,q9=60,E9=64,D9=93,x9=33,P9=38,I9=58,i1=102,c1=104,b1=119,r9=116,B$=112,zZ=115,_Z=160,qZ=12,f9=46,j9=47,DZ=43,jZ=124,HZ=123,FZ=40,OZ=41,N$=120,b$=88,$9=48,Z9=57,a1=65,r1=90,G9=97,Y9=122,$1=128,WZ=32,Y6={blockQuote:0,breakLine:1,breakThematic:2,codeBlock:3,codeInline:4,footnote:5,footnoteReference:6,frontmatter:7,gfmTask:8,heading:9,htmlBlock:10,htmlComment:11,htmlSelfClosing:12,image:13,link:14,orderedList:15,paragraph:16,ref:17,refCollection:18,table:19,text:20,textFormatted:21,unorderedList:22},W=Y6,P$={};G6(P$,{startsWith:()=>s,slugify:()=>c0,skipWhitespace:()=>S0,shouldFilterTag:()=>$$,sanitizer:()=>s1,parseFrontmatterBounds:()=>L$,normalizeInput:()=>g1,normalizeCRLF:()=>j6,isVoidElement:()=>W9,isUnicodeWhitespace:()=>K9,isUnicodePunctuation:()=>t9,isAlnumCode:()=>o9,isASCIIWhitespace:()=>C9,isASCIIPunctuation:()=>_6,inlineCharTypeTable:()=>g9,includes:()=>V6,htmlAttrsToJSXProps:()=>s9,hasKeys:()=>e9,getTag:()=>H6,getOverrideProps:()=>F6,get:()=>x$,findLineEnd:()=>I,extractPlainText:()=>wZ,endsWith:()=>n9,decodeEntityReferences:()=>O9,charClassTable:()=>F9,applyTagFilterToText:()=>Z$,VOID_ELEMENTS:()=>R$,SHOULD_RENDER_AS_BLOCK_R:()=>T$,SANITIZE_R:()=>H9,NAMED_CODES_TO_UNICODE:()=>K6,HTML_TO_JSX_MAP:()=>AZ,HTML_CHAR_CODE_R:()=>vZ,ATTRIBUTES_TO_SANITIZE:()=>S$});function L$(t){if(!s(t,"---"))return null;let i=3;for(;i<t.length&&(t[i]===" "||t[i]===" ");)i++;if(i<t.length&&t[i]==="\r"&&i++,i>=t.length||t[i]!==`
14
14
  `)return null;i++;let u=!1;for(;i<t.length;){let c=i;for(;i<t.length&&t[i]!==`
15
15
  `&&t[i]!=="\r";)i++;if(i>=t.length)break;let p=i;if(t[i]==="\r"&&i++,i<t.length&&t[i]===`
16
16
  `&&i++,s(t,"---",c))return{endPos:i,hasValidYaml:u};let g=t.indexOf(":",c);g!==-1&&g<p&&(u=!0)}return null}var K6=C$1,vZ=/&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi,AZ={class:"className",for:"htmlFor",allowfullscreen:"allowFullScreen",allowtransparency:"allowTransparency",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",classid:"classId",colspan:"colSpan",contenteditable:"contentEditable",contextmenu:"contextMenu",crossorigin:"crossOrigin",enctype:"encType",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",inputmode:"inputMode",keyparams:"keyParams",keytype:"keyType",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",novalidate:"noValidate",radiogroup:"radioGroup",readonly:"readOnly",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",usemap:"useMap"};function s9(t){var i={};for(var u in t){var c=u.toLowerCase(),p=AZ[c];i[p||u]=t[u]}return i}var T$=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/;function O9(t){return t.indexOf("&")===-1?t:t.replace(vZ,(i,u)=>{var c=B(u);if(c)return c;if(u[0]==="#"){var p=u[1]==="x"||u[1]==="X"?parseInt(u.slice(2),16):parseInt(u.slice(1),10);return p===0||p>=55296&&p<=57343||p>1114111?"�":p<=65535?String.fromCharCode(p):String.fromCharCode(55296+(p-65536>>10),56320+(p-65536&1023))}return i})}var H9=/(javascript|vbscript|data(?!:image)):/i;function s1(t){if(H9.test(t))return null;if(t.indexOf("%")===-1)return t;try{let i=decodeURIComponent(t).replace(/[^A-Za-z0-9/:]/g,"");if(H9.test(i))return null}catch{return null}return t}var I0={},p0,b0;p0=[192,193,194,195,196,197,224,225,226,227,228,229,230,198];for(b0=0;b0<p0.length;b0++)I0[p0[b0]]="a";I0[231]=I0[199]="c";I0[240]=I0[208]="d";p0=[200,201,202,203,233,232,234,235];for(b0=0;b0<p0.length;b0++)I0[p0[b0]]="e";p0=[207,239,206,238,205,237,204,236];for(b0=0;b0<p0.length;b0++)I0[p0[b0]]="i";I0[209]=I0[241]="n";p0=[248,216,339,338,213,245,212,244,211,243,210,242];for(b0=0;b0<p0.length;b0++)I0[p0[b0]]="o";p0=[220,252,219,251,218,250,217,249];for(b0=0;b0<p0.length;b0++)I0[p0[b0]]="u";I0[376]=I0[255]=I0[221]=I0[253]="y";function o9(t){return t>=$9&&t<=Z9||t>=a1&&t<=r1||t>=G9&&t<=Y9}function c0(t){for(var i=[],u=0;u<t.length;u++){var c=t.charCodeAt(u);if(o9(c))c>=a1&&c<=r1?i.push(String.fromCharCode(c+WZ)):i.push(t[u]);else if(c===f||c===U1)i.push("-");else{var p=I0[c];p&&i.push(p)}}return i.join("")}function V6(t,i){return t.indexOf(i)!==-1}function s(t,i,u){return t.startsWith(i,u)}function n9(t,i,u){return t.startsWith(i,(u===void 0?t.length:u)-i.length)}var R$=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr","circle","ellipse","line","path","polygon","polyline","rect","use","stop","animate","animateTransform","set"]);function W9(t){let i=t.toLowerCase();if(R$.has(i))return!0;let u=i.indexOf(":");return u!==-1?(i=i.slice(u+1),R$.has(i)):!1}var S$=["src","href","data","formAction","srcDoc","action"],E$=1,X9=2,MZ=1,U6=2,Q6=3,z6=4,F9=(function(){let t=new Uint8Array(128),i;for(t[l]=t[d]=t[qZ]=t[X0]=t[f]=E$,i=x9;i<=j9;i++)t[i]=X9;for(i=I9;i<=E9;i++)t[i]=X9;for(i=P1;i<=h0;i++)t[i]=X9;for(i=HZ;i<=t1;i++)t[i]=X9;return t})(),g9=(function(){let t=new Uint8Array(128);return t[f1]=U6,t[P1]=z6,t[S9]=t[e1]=t[t1]=t[d1]=Q6,t[h0]=t[q9]=t[E9]=t[D9]=t[d]=t[f]=t[x9]=MZ,t[i1]=t[c1]=t[b1]=MZ,t})();function _6(t){return t<$1&&(F9[t]&X9)!==0}function C9(t){return t<$1&&(F9[t]&E$)!==0}var q6=/[\p{P}\p{S}]/u,D6=new RegExp("\\p{Zs}","u");function K9(t){if(!t)return!0;let i=t.charCodeAt(0);return i<$1?(F9[i]&E$)!==0:D6.test(t)}function t9(t){if(typeof t=="number")return t<$1&&(F9[t]&X9)!==0;if(!t)return!1;let i=t.charCodeAt(0);return i<$1?(F9[i]&X9)!==0:q6.test(t)}function I(t,i){let u=t.indexOf(`
@@ -58,7 +58,7 @@ ${Ee.current.stack}
58
58
  `},...z),{processed:!0,newPos:C(t,u),wasBlank:!1}}let A=M6(t,i,v,M,E,_);if(A!==null)return{processed:!0,newPos:A,wasBlank:!1};let D=e$(M,E,_,{inline:!1,list:!0});if(D.length>0){if(T&&D[0].type===W.paragraph){let z=D[0];v.push({type:W.text,text:`
59
59
  `},...z.children),D.length>1&&v.push(...D.slice(1))}else if(!x&&D[0].type===W.paragraph&&v.length>0){let z=v[v.length-1],L=D[0];z.type===W.paragraph?z.children.push({type:W.text,text:`
60
60
  `},...L.children):z.type===W.heading?v.push(...L.children):m9(v)?v.push(...D):v.push({type:W.text,text:" "},...L.children),D.length>1&&v.push(...D.slice(1))}else v.push(...D);return{processed:!0,newPos:C(t,u),wasBlank:!1}}if(x){let z=W$(E,!0,()=>k1(M,0,M.length,E,_));v.push({type:W.paragraph,children:z})}else K$(M,v,E,_);return{processed:!0,newPos:C(t,u),wasBlank:!1}}function o$(t,i,u,c){if(u.inline)return null;var p=u.inList;if(u.inList=!0,i>0){var g=b(t,i-1);if(g!==d&&g!==X0)return u.inList=p,null}var v=I(t,i),x=n(t,i,v);if(x.spaceEquivalent>3&&!u.inList)return u.inList=p,null;var E=t.slice(i,v),_=x.charCount,T=E.slice(_),w=C$(T);if(!w)return u.inList=p,null;var{match:R,ordered:M,listItemRegex:k}=w,A=x.spaceEquivalent,D=M?parseInt(R[1],10):void 0,z=M?R[2]:void 0,L=M?void 0:R[1],U=M?R[3]==="":R[2]==="";function V(ye,De){if(ye===0)return!0;var He=b(t,ye-1);if(He!==d)return!1;if(!De)return!0;for(var Ce=ye-2;Ce>=0;){var Ne=b(t,Ce);if(Ne!==f&&Ne!==l)break;Ce--}return Ce<0||b(t,Ce)===d}if(U&&!V(i,!0))return u.inList=p,null;if(M&&D!==1&&!V(i,!1)||!M&&IZ(R,L))return null;var Q=R.index||0,Z=M?Q+R[1].length+R[2].length+1:U?Q+R[1].length:Q+R[1].length+1,F=i+_+Z,Y=j$(t,F,v,A,Z),ne=Y.contentStartColumn,fe=A+Q+R[1].length,oe=M?fe+R[2].length+1:U?fe:fe+1,le=[],Se=[];function ve(ye,De,He){return He?ye>=De:ye>De}function _e(){return le[le.length-1]}function K(){return Se[Se.length-1]??ne}function pe(ye,De){let He=lZ(De),Ce=u.inList;u.inList=!0;let Ne=o$(t,ye,u,c);return u.inList=Ce,Ne?(He.push(Ne),Ne):null}for(var te=C(t,v),Re=te,Ae=!1;Re<t.length;){var H=I(t,Re),ie=t.slice(Re,H);if(ie.trim()===""){for(var ue=C(t,H);ue<t.length;){var be=b(t,ue);if(be!==d){if(!x6.has(t[ue]))break}ue++}var me=I(t,ue),Ee=t.slice(ue,me),Te=n(t,ue,me),ke=Ee.slice(Te.charCount);if(o1(ke,Te,M,L,z,A,k))Ae=!0;else{var Me=s$(t,ue,me,Te,ke,u,c);if(Me){for(var Ve=Me;Ve<t.length&&b(t,Ve)===d;)Ve++;if(Ve<t.length){var ft=I(t,Ve),je=t.slice(Ve,ft),vt=n(t,Ve,ft),At=je.slice(vt.charCount);o1(At,vt,M,L,z,A,k)&&(Ae=!0)}}}break}var Ue=n(t,Re,H),dt=ie.slice(Ue.charCount),un=C$(dt);if(!un)break;var _n=un.match;if(M){if(_n[2]!==z)break}else if(_n[1]!==L)break;Re=C(t,H)}var Ye=M?R[3]:R[2];Ye=Ye.trimStart();for(var Zt=i+_+(R.index||0),wt=M?Zt+R[1].length+R[2].length:Zt+R[1].length,cn=wt;cn<t.length;){var be=b(t,cn);if(be!==f&&be!==l)break;cn++}for(var Tt=0,ot=wt;ot<v;){var be=b(t,ot);if(be===l)Tt+=4-Tt%4;else if(be===f)Tt++;else break;ot++}var An=!1;if(wt<t.length&&b(t,wt)===l){for(var Xt=1,Dt=wt+1;Dt<t.length&&b(t,Dt)===l;)Xt++,Dt++;Xt>=2&&(Ye=" "+Ye,An=!0)}M||(U=U&&Tt===0),Tt>=4&&!An&&(Ye=" ".repeat(Tt-1)+Ye.trimStart()),Ye.trim();let Pt=Ae;if(!Ae&&te<t.length)for(var pn=te;pn<t.length;){var mn=I(t,pn),Yn=t.slice(pn,mn);if(W1(t,pn,mn)){for(var at=C(t,mn);at<t.length;){var gn=I(t,at);if(W1(t,at,gn))at=C(t,gn);else break}if(at<t.length){var bt=n(t,at,t.length),pt=bt.spaceEquivalent;if(pt>=A){for(var tt=t.slice(at,I(t,at)),nt=tt.slice(bt.charCount).match(k),fn=nt&&(M?nt[2]===z:nt[1]===L),yn=null,qt=te;qt<pn;qt=I(t,qt)+1){var rt=I(t,qt),Jt=n(t,qt,rt),Ct=t.slice(qt,rt).slice(Jt.charCount).match(k),Cn=Ct&&Jt.spaceEquivalent>A&&Jt.spaceEquivalent>=ne&&(M?Ct[2]===z:Ct[1]===L);if(Cn){var On=Jt.spaceEquivalent+1,mt=M?On+Ct[1].length+Ct[2].length+1:On+Ct[1].length+1,dn=qt+Jt.charCount+Ct[0].length,Kn=j$(t,dn,rt,On,mt-On);yn=Kn.contentStartColumn;break}}var wn=Tt>=5?oe:ne;!fn&&pt>=wn&&(yn===null||pt+1<yn)&&(Pt=!0)}}break}var Zn=n(t,pn,mn),Ut=Zn.spaceEquivalent,$t=Yn.slice(Zn.charCount),vn=$t.match(k),Nt=vn&&(M?vn[2]===z:vn[1]===L);if(Nt&&Ut<=A)break;pn=C(t,mn)}var Ie=Ye;if(s(Ye,"```")||s(Ye,"~~~")){var kt=M?R[1].length+R[2].length+1:R[1].length+1,tn=dZ(t,Ye,te,kt);Ie=tn.content,te=tn.endPos}var It=!U&&Ye.trim()===""&&Tt>0&&Tt<5;if(!Pt)for(var ht=Ie.length>0?Ie[0]:"",Ke=ht===">",i=te;i<t.length;){var v=I(t,i),E=t.slice(i,v);if(E.trim()==="")break;var x=n(t,i,v);if(x.spaceEquivalent<oe)break;var T=E.slice(x.charCount);if(x.spaceEquivalent<=A&&o1(T,x,M,L,z,A,k)||g$(T)&&x.spaceEquivalent>A)break;var nn=T.length>0?T[0]:"",Lt=nn===">"&&Ke;if(nn===">"&&!Lt||nn==="#"||s(T,"```")||s(T,"~~~"))break;Ie+=`
61
- `+T,te=i=C(t,v)}if(le.push(iZ(Ie,Pt,u,c)),Se.push(ne),Pt&&(Tt>=5||It)){let ye=_e();te=xZ(t,ye,oe,te,A,M,L,z,k,u,c,!0)}else if(!Pt){let ye=oe-1;for(;te<t.length;){let De=I(t,te),He=t.slice(te,De),Ce=n(t,te,De),Ne=Ce.spaceEquivalent,We=He.slice(Ce.charCount);if(He.trim()===""||Ne<=A&&o1(We,Ce,M,L,z,A,k)||g$(We)&&Ne>A||Ne<ye)break;let Et=_e(),ze=V$(t,te,De,Ce,ye,ne,Et,!1,u,c,!0);if(ze.processed)te=ze.newPos;else break}}for(var Ze=!1;te<t.length;){let ye=I(t,te),De=t.slice(te,ye),He=n(t,te,ye),Ce=He.charCount,Ne=He.spaceEquivalent;if(De.trim()==="")Ae=!0,Ze=!0,te=C(t,ye);else if(Ne<A){let We=De.slice(Ce);if(We.startsWith("<")&&EZ(t,te,Ce,A,Ne,c))break;let Et=We.trim();if(Et.length>0&&le.length>0&&!u9(Et[0])&&!o1(We,He,M,L,z,A,k)){let ze=_e();if(ze.length>0){let ut=ze[ze.length-1];if(!Ze&&(ut.type===W.paragraph||ut.type===W.text)){K$(We,ze,u,c),Ze=!1,te=C(t,ye);continue}}}break}else{let We=De.slice(Ce);if(le.length>0){let Ge=Se[le.length-1]||ne;if(Ne+1>=Ge&&!o1(We,He,M,L,z,A,k)){let Ot=_e();if(Ot.length>0&&cZ(Ot,We,c)){te=C(t,ye);continue}}}if(D$(t,te))break;if(Ze){let Ge=s$(t,te,ye,He,We,u,c);if(Ge){te=Ge,Ze=!1;continue}}if(Ne<=A){if(We.startsWith("<")&&EZ(t,te,Ce,A,Ne,c))break;if(!o1(We,He,M,L,z,A,k)){if(Ne===A&&!Ze){let Ge=We.trim();if(Ge.length>0&&!u9(Ge[0])){let Ot=d9(t,te,u,c);if(Ot&&Ot.type!==W.paragraph)break;let Bt=_e();if(Bt.length>0&&!m9(Bt)){K$(We,Bt,u,c,!1),Ze=!1,te=C(t,ye);continue}}}break}}if(TZ(le,U,Ze,Ye))break;let Et=C$(We),ze=Et?Et.match:null,ut=ze&&(M?ze[2]===z:ze[1]===L);if(ut&&Ne>3&&Ze)break;if(ut&&Ne<=A+3){if(Ne>=4&&Ze)break;if(Ne===A){let Ge=M?ze[3]:ze[2];if(Ge=Ge.trimStart(),te=Y$(t,le,Se,Ge,te,ye,Ne,Ce,ze,M,Ae,u,c).newCurrentPos,Ze=!1,Ge.trim()===""){let Ot=le[le.length-1],Bt=K();te=xZ(t,Ot,Bt,te,A,M,L,z,k,u,c)}continue}if(Ne>A){if(Ze){let Fe=M?ze[3]:ze[2];Fe=Fe.trimStart(),te=Y$(t,le,Se,Fe,te,ye,Ne,Ce,ze,M,Ae,u,c).newCurrentPos,Ze=!1;continue}let Ge=_e(),Ot=Ne+1,Bt=ve(Ot,K(),m9(Ge));if(Bt){let Fe=pe(te,Ge);if(Fe){te=Fe.endPos,Ze=!1;continue}}if(!Bt&&ut){let Fe=M?ze[3]:ze[2];if(Fe=Fe.trimStart(),!Ae){let bn=C(t,ye);for(;bn<t.length;){let Vt=I(t,bn),Ht=t.slice(bn,Vt),Qt=n(t,bn,Vt),Ba=Qt.spaceEquivalent;if(Ht.trim()===""){let kn=C(t,Vt);if(kn<t.length){let za=n(t,kn,t.length).spaceEquivalent,Nn=Ne+(M?ze[1].length+ze[2].length+1:ze[1].length+1);if(za+1>Nn)break}break}else if(Ba<=A){let kn=Ht.slice(Qt.charCount).match(k);if(kn&&(M?kn[2]===z:kn[1]===L)&&Ba<=A)break}bn=C(t,Vt)}}te=Y$(t,le,Se,Fe,te,ye,Ne,Ce,ze,M,Ae,u,c).newCurrentPos,Ze=!1;continue}else if(!Bt&&!ut)break;{let Fe=_e(),bn=Fe.length===0;if(bn&&TZ(le,U,Ze,Ye))break;let Vt=Fe.some(Qt=>Qt.type===W.codeBlock||Qt.type===W.paragraph||Qt.type===W.blockQuote||Qt.type===W.orderedList||Qt.type===W.unorderedList||Qt.type===W.heading),Ht=bn&&le.length===1?oe:ne;if(Vt?Ne>=Ht:Ne>Ht){let Qt=V$(t,te,ye,He,Ht,ne,_e(),Ze,u,c,void 0);if(Qt.processed){Ze=Qt.wasBlank,te=Qt.newPos;continue}}else break}}else if(Ne===A){if(!M&&ze&&IZ(ze,ze[1]))break;let Ge=M?ze[3]:ze[2];Ge=Ge.trimStart(),te=Y$(t,le,Se,Ge,te,ye,A,Ce,ze,M,Ae,u,c).newCurrentPos,Ze=!1}}else if(Ne>A){let Ge=_e();if(g$(We)){let Bt=Ne+1;if(ve(Bt,K(),m9(Ge))){let Fe=pe(te,Ge);if(Fe){te=Fe.endPos,Ze=!1;continue}}if(Ne-A>3){let Fe=Ge.length>0?Ge[Ge.length-1]:null;if(Fe&&(Fe.type===W.paragraph||Fe.type===W.text)){K$(We,Ge,u,c),Ze=!1,te=C(t,ye);continue}}else break}else{let Bt=pe(te,Ge);if(Bt){te=Bt.endPos,Ze=!1;continue}}let Ot=ne;if(m9(Ge)?Ne>=Ot-1:Ne>Ot-1){let Bt=V$(t,te,ye,He,Ot-1,ne,_e(),Ze,u,c,void 0);if(Bt.processed){Ze=Bt.wasBlank,te=Bt.newPos;continue}}else break}else break}}if(Ae&&le.length>1&&le[0].length>0&&le[0][0].type!==W.paragraph){for(var jn=1;jn<le.length;jn++)if(le[jn].length>0&&le[jn][0].type===W.paragraph){for(var Dn=!1,xe=0;xe<le[0].length;xe++){var q=le[0][xe].type;if(q===W.codeBlock||q===W.heading||q===W.blockQuote||q===W.orderedList||q===W.unorderedList||q===W.htmlBlock||q===W.breakThematic){Dn=!0;break}}Dn||(le[0]=[{type:W.paragraph,children:le[0]}]);break}}let ge=M?{type:W.orderedList,items:le,ordered:!0,start:D}:{type:W.unorderedList,items:le,ordered:!1};return u.inList=p,{...ge,endPos:te}}function aZ(t,i,u,c){if(u.inline)return null;let p=[],g=i;for(;g<t.length;){let k=I(t,g);if(W1(t,g,k))break;let A=t.slice(g,k).trim();if(!(A.indexOf("|")!==-1||p.length>=3&&A&&!u9(A[0])))break;p.push(A),g=C(t,k)}if(p.length<2)return null;let v=k=>k[0]==="|"&&k[k.length-1]==="|"?k.slice(1,-1):k,x=k=>{let A=[],D="",z=!1;for(let L=0;L<k.length;L++){let U=k[L];U==="\\"&&L+1<k.length&&k[L+1]==="|"?(D+="|",L++):U==="`"?(z=!z,D+=U):U==="|"&&!z?(A.push(D.trim()),D=""):D+=U}return A.push(D.trim()),A},E=x(v(p[0]));if(!E.length)return null;let _=x(v(p[1]));if(_.length!==E.length||_.some(k=>!/^:?-+:?$/.test(k)))return null;let T=_.map(k=>{let A=k[0]===":",D=k[k.length-1]===":";return A&&D?"center":A?"left":D?"right":null}),w=k=>W$(u,!0,()=>k.map(A=>k1(A,0,A.length,u,c))),R=w(E),M=p.slice(2).map(k=>{let A=k.indexOf("|")!==-1?x(v(k)):[k.trim()],D=E.length;for(;A.length<D;)A.push("");return A.length=D,w(A)});return{type:W.table,header:R,cells:M,align:T,endPos:g}}var l6=["div","p","section","article","aside","nav","header","footer","main","h1","h2","h3","h4","h5","h6","blockquote","ul","ol","li","dl","dt","dd","table","thead","tbody","tfoot","tr","td","th","form","fieldset","hr","pre","details","summary","figure","figcaption"],d6=new Set(["pre","script","style","textarea"]);function h9(t){return l6.indexOf(t.toLowerCase())!==-1}function A9(t){return d6.has(t)}function W1(t,i,u){for(var c=i;c<u;c++){let p=b(t,c);if(p!==f&&p!==l&&p!==X0)return!1}return!0}function W$(t,i,u){let c=t.inline;t.inline=i;try{return u()}finally{t.inline=c}}function k$(t,i,u){for(var c=i;c<u;){var p=I(t,c);if(W1(t,c,p))return c;c=C(t,p)}return u}function m$(t,i,u){return{type:W.htmlComment,text:g1(t),endPos:i,...u}}function M9(t,i,u,c,p,g,v,x,E){var _=g1(i),T=_;if(x&&x.forceBlock&&i&&!g){var w=new RegExp("^<"+t.toLowerCase()+"(\\s[^>]*)?>$","i");w.test(i.trim())&&(T="")}var R=T,M=t.toLowerCase(),k=new RegExp("^<"+M+"[\\s>]","i");if(k.test(R)){var A=R.indexOf(">");if(A!==-1){R=R.slice(A+1);var D="</"+M+">",z=R.indexOf(D);z!==-1&&(R=R.slice(0,z))}}else{var L="</"+M+">",U=R.indexOf(L);U!==-1&&(R=R.slice(0,U))}var V=[];if(R&&x){var Q=E||{inline:!1,inHTML:!0,inAnchor:!1},Z=R.trim(),F=F$.test(Z),Y=O$.test(Z),ne=H$.test(Z);if(F||Y||ne){var fe={...Q,inline:!1,inHTML:!0,inAnchor:Q.inAnchor||M==="a"};V=i9(Z,fe,x)}else if(Z){var oe={...Q,inline:!0,inAnchor:Q.inAnchor||M==="a"};V=k1(Z,0,Z.length,oe,x)}}return{type:W.htmlBlock,tag:t,attrs:c||{},rawAttrs:p,children:V,rawText:T,text:R,verbatim:!0,isClosingTag:g,canInterruptParagraph:v,endPos:u}}function p9(t){let i=O$.test(t),u=F$.test(t),c=N6.test(t);return i||u&&!c}function fZ(t,i,u,c,p,g,v,x,E,_){if(!x.inHTML&&!x.inline&&!n9(p,`
61
+ `+T,te=i=C(t,v)}if(le.push(iZ(Ie,Pt,u,c)),Se.push(ne),Pt&&(Tt>=5||It)){let ye=_e();te=xZ(t,ye,oe,te,A,M,L,z,k,u,c,!0)}else if(!Pt){let ye=oe-1;for(;te<t.length;){let De=I(t,te),He=t.slice(te,De),Ce=n(t,te,De),Ne=Ce.spaceEquivalent,We=He.slice(Ce.charCount);if(He.trim()===""||Ne<=A&&o1(We,Ce,M,L,z,A,k)||g$(We)&&Ne>A||Ne<ye)break;let Et=_e(),ze=V$(t,te,De,Ce,ye,ne,Et,!1,u,c,!0);if(ze.processed)te=ze.newPos;else break}}for(var Ze=!1;te<t.length;){let ye=I(t,te),De=t.slice(te,ye),He=n(t,te,ye),Ce=He.charCount,Ne=He.spaceEquivalent;if(De.trim()==="")Ae=!0,Ze=!0,te=C(t,ye);else if(Ne<A){let We=De.slice(Ce);if(We.startsWith("<")&&EZ(t,te,Ce,A,Ne,c))break;let Et=We.trim();if(Et.length>0&&le.length>0&&!u9(Et[0])&&!o1(We,He,M,L,z,A,k)){let ze=_e();if(ze.length>0){let ut=ze[ze.length-1];if(!Ze&&(ut.type===W.paragraph||ut.type===W.text)){K$(We,ze,u,c),Ze=!1,te=C(t,ye);continue}}}break}else{let We=De.slice(Ce);if(le.length>0){let Ge=Se[le.length-1]||ne;if(Ne+1>=Ge&&!o1(We,He,M,L,z,A,k)){let Ot=_e();if(Ot.length>0&&cZ(Ot,We,c)){te=C(t,ye);continue}}}if(D$(t,te))break;if(Ze){let Ge=s$(t,te,ye,He,We,u,c);if(Ge){te=Ge,Ze=!1;continue}}if(Ne<=A){if(We.startsWith("<")&&EZ(t,te,Ce,A,Ne,c))break;if(!o1(We,He,M,L,z,A,k)){if(Ne===A&&!Ze){let Ge=We.trim();if(Ge.length>0&&!u9(Ge[0])){let Ot=d9(t,te,u,c);if(Ot&&Ot.type!==W.paragraph)break;let Bt=_e();if(Bt.length>0&&!m9(Bt)){K$(We,Bt,u,c,!0),Ze=!1,te=C(t,ye);continue}}}break}}if(TZ(le,U,Ze,Ye))break;let Et=C$(We),ze=Et?Et.match:null,ut=ze&&(M?ze[2]===z:ze[1]===L);if(ut&&Ne>3&&Ze)break;if(ut&&Ne<=A+3){if(Ne>=4&&Ze)break;if(Ne===A){let Ge=M?ze[3]:ze[2];if(Ge=Ge.trimStart(),te=Y$(t,le,Se,Ge,te,ye,Ne,Ce,ze,M,Ae,u,c).newCurrentPos,Ze=!1,Ge.trim()===""){let Ot=le[le.length-1],Bt=K();te=xZ(t,Ot,Bt,te,A,M,L,z,k,u,c)}continue}if(Ne>A){if(Ze){let Fe=M?ze[3]:ze[2];Fe=Fe.trimStart(),te=Y$(t,le,Se,Fe,te,ye,Ne,Ce,ze,M,Ae,u,c).newCurrentPos,Ze=!1;continue}let Ge=_e(),Ot=Ne+1,Bt=ve(Ot,K(),m9(Ge));if(Bt){let Fe=pe(te,Ge);if(Fe){te=Fe.endPos,Ze=!1;continue}}if(!Bt&&ut){let Fe=M?ze[3]:ze[2];if(Fe=Fe.trimStart(),!Ae){let bn=C(t,ye);for(;bn<t.length;){let Vt=I(t,bn),Ht=t.slice(bn,Vt),Qt=n(t,bn,Vt),Ba=Qt.spaceEquivalent;if(Ht.trim()===""){let kn=C(t,Vt);if(kn<t.length){let za=n(t,kn,t.length).spaceEquivalent,Nn=Ne+(M?ze[1].length+ze[2].length+1:ze[1].length+1);if(za+1>Nn)break}break}else if(Ba<=A){let kn=Ht.slice(Qt.charCount).match(k);if(kn&&(M?kn[2]===z:kn[1]===L)&&Ba<=A)break}bn=C(t,Vt)}}te=Y$(t,le,Se,Fe,te,ye,Ne,Ce,ze,M,Ae,u,c).newCurrentPos,Ze=!1;continue}else if(!Bt&&!ut)break;{let Fe=_e(),bn=Fe.length===0;if(bn&&TZ(le,U,Ze,Ye))break;let Vt=Fe.some(Qt=>Qt.type===W.codeBlock||Qt.type===W.paragraph||Qt.type===W.blockQuote||Qt.type===W.orderedList||Qt.type===W.unorderedList||Qt.type===W.heading),Ht=bn&&le.length===1?oe:ne;if(Vt?Ne>=Ht:Ne>Ht){let Qt=V$(t,te,ye,He,Ht,ne,_e(),Ze,u,c,void 0);if(Qt.processed){Ze=Qt.wasBlank,te=Qt.newPos;continue}}else break}}else if(Ne===A){if(!M&&ze&&IZ(ze,ze[1]))break;let Ge=M?ze[3]:ze[2];Ge=Ge.trimStart(),te=Y$(t,le,Se,Ge,te,ye,A,Ce,ze,M,Ae,u,c).newCurrentPos,Ze=!1}}else if(Ne>A){let Ge=_e();if(g$(We)){let Bt=Ne+1;if(ve(Bt,K(),m9(Ge))){let Fe=pe(te,Ge);if(Fe){te=Fe.endPos,Ze=!1;continue}}if(Ne-A>3){let Fe=Ge.length>0?Ge[Ge.length-1]:null;if(Fe&&(Fe.type===W.paragraph||Fe.type===W.text)){K$(We,Ge,u,c),Ze=!1,te=C(t,ye);continue}}else break}else{let Bt=pe(te,Ge);if(Bt){te=Bt.endPos,Ze=!1;continue}}let Ot=ne;if(m9(Ge)?Ne>=Ot-1:Ne>Ot-1){let Bt=V$(t,te,ye,He,Ot-1,ne,_e(),Ze,u,c,void 0);if(Bt.processed){Ze=Bt.wasBlank,te=Bt.newPos;continue}}else break}else break}}if(Ae&&le.length>1&&le[0].length>0&&le[0][0].type!==W.paragraph){for(var jn=1;jn<le.length;jn++)if(le[jn].length>0&&le[jn][0].type===W.paragraph){for(var Dn=!1,xe=0;xe<le[0].length;xe++){var q=le[0][xe].type;if(q===W.codeBlock||q===W.heading||q===W.blockQuote||q===W.orderedList||q===W.unorderedList||q===W.htmlBlock||q===W.breakThematic){Dn=!0;break}}Dn||(le[0]=[{type:W.paragraph,children:le[0]}]);break}}let ge=M?{type:W.orderedList,items:le,ordered:!0,start:D}:{type:W.unorderedList,items:le,ordered:!1};return u.inList=p,{...ge,endPos:te}}function aZ(t,i,u,c){if(u.inline)return null;let p=[],g=i;for(;g<t.length;){let k=I(t,g);if(W1(t,g,k))break;let A=t.slice(g,k).trim();if(!(A.indexOf("|")!==-1||p.length>=3&&A&&!u9(A[0])))break;p.push(A),g=C(t,k)}if(p.length<2)return null;let v=k=>k[0]==="|"&&k[k.length-1]==="|"?k.slice(1,-1):k,x=k=>{let A=[],D="",z=!1;for(let L=0;L<k.length;L++){let U=k[L];U==="\\"&&L+1<k.length&&k[L+1]==="|"?(D+="|",L++):U==="`"?(z=!z,D+=U):U==="|"&&!z?(A.push(D.trim()),D=""):D+=U}return A.push(D.trim()),A},E=x(v(p[0]));if(!E.length)return null;let _=x(v(p[1]));if(_.length!==E.length||_.some(k=>!/^:?-+:?$/.test(k)))return null;let T=_.map(k=>{let A=k[0]===":",D=k[k.length-1]===":";return A&&D?"center":A?"left":D?"right":null}),w=k=>W$(u,!0,()=>k.map(A=>k1(A,0,A.length,u,c))),R=w(E),M=p.slice(2).map(k=>{let A=k.indexOf("|")!==-1?x(v(k)):[k.trim()],D=E.length;for(;A.length<D;)A.push("");return A.length=D,w(A)});return{type:W.table,header:R,cells:M,align:T,endPos:g}}var l6=["div","p","section","article","aside","nav","header","footer","main","h1","h2","h3","h4","h5","h6","blockquote","ul","ol","li","dl","dt","dd","table","thead","tbody","tfoot","tr","td","th","form","fieldset","hr","pre","details","summary","figure","figcaption"],d6=new Set(["pre","script","style","textarea"]);function h9(t){return l6.indexOf(t.toLowerCase())!==-1}function A9(t){return d6.has(t)}function W1(t,i,u){for(var c=i;c<u;c++){let p=b(t,c);if(p!==f&&p!==l&&p!==X0)return!1}return!0}function W$(t,i,u){let c=t.inline;t.inline=i;try{return u()}finally{t.inline=c}}function k$(t,i,u){for(var c=i;c<u;){var p=I(t,c);if(W1(t,c,p))return c;c=C(t,p)}return u}function m$(t,i,u){return{type:W.htmlComment,text:g1(t),endPos:i,...u}}function M9(t,i,u,c,p,g,v,x,E){var _=g1(i),T=_;if(x&&x.forceBlock&&i&&!g){var w=new RegExp("^<"+t.toLowerCase()+"(\\s[^>]*)?>$","i");w.test(i.trim())&&(T="")}var R=T,M=t.toLowerCase(),k=new RegExp("^<"+M+"[\\s>]","i");if(k.test(R)){var A=R.indexOf(">");if(A!==-1){R=R.slice(A+1);var D="</"+M+">",z=R.indexOf(D);z!==-1&&(R=R.slice(0,z))}}else{var L="</"+M+">",U=R.indexOf(L);U!==-1&&(R=R.slice(0,U))}var V=[];if(R&&x){var Q=E||{inline:!1,inHTML:!0,inAnchor:!1},Z=R.trim(),F=F$.test(Z),Y=O$.test(Z),ne=H$.test(Z);if(F||Y||ne){var fe={...Q,inline:!1,inHTML:!0,inAnchor:Q.inAnchor||M==="a"};V=i9(Z,fe,x)}else if(Z){var oe={...Q,inline:!0,inAnchor:Q.inAnchor||M==="a"};V=k1(Z,0,Z.length,oe,x)}}return{type:W.htmlBlock,tag:t,attrs:c||{},rawAttrs:p,children:V,rawText:T,text:R,verbatim:!0,isClosingTag:g,canInterruptParagraph:v,endPos:u}}function p9(t){let i=O$.test(t),u=F$.test(t),c=N6.test(t);return i||u&&!c}function fZ(t,i,u,c,p,g,v,x,E,_){if(!x.inHTML&&!x.inline&&!n9(p,`
62
62
  `)){let Te=g,ke=v.length;for(;Te<ke;){let Me=I(v,Te);if(W1(v,Te,Me))break;let Ve=v.slice(Te,Me).trim();if(Ve.length>0&&u9(Ve[0])){let ft=M$(v,Te,x,_);if(ft){Te=ft.endPos;continue}let je=n1(v,Te);if(je){Te=je.endPos;continue}return null}Te=C(v,Me)}}let T=i,w=A9(T);var R=!w&&!W9(i),M=void 0;if(p){var k=p.indexOf(">");if(k!==-1){var A=p.slice(0,k+1);A.indexOf(`
63
63
  `)!==-1&&(M=A);for(var D=k,z=1;z<k;z++){var L=A[z];if(L===" "||L===" "||L===`
64
64
  `||L===">"){D=z;break}}u=A.slice(D,k)}}var U=u.replace(/^[\s\n\r\t]+/,""),V=C1(U,i,t,_),Q={...V},Z=!1,F=!1;if(R&&c.length>0){var Y="</"+T,ne=c.indexOf(Y);if(ne>=0){for(var fe=ne+Y.length;fe<c.length&&(c[fe]===" "||c[fe]===" ");)fe++;if(fe<c.length&&c[fe]===">"){var oe=c.slice(0,ne);p9(oe)?(c=oe,F=!0):Z=!0}}if(!F){var le=c.length-1;if(c[le]===`
@@ -114,21 +114,21 @@ ${Ee.current.stack}
114
114
  `+Q,U.text=U.rawText,D++}E.push(z)}t=E;let _={...u,slugify:D=>c(D,c0),sanitizer:p,tagfilter:u.tagfilter!==!1},T=t[0]&&t[0].type===W.refCollection?t[0].refs:{},w=Z5(u.renderRule,x,p,c,T,u),R=w(t,{inline:u.forceInline,refs:T}),M=[];for(let D in T)D.charCodeAt(0)===_9&&M.push({identifier:D,footnote:T[D].target});if(M.length&&R.push(x("footer",{key:"footer"},M.map(function(D){let z=D.identifier.charCodeAt(0)===_9?D.identifier.slice(1):D.identifier,L=c9(D.footnote,{inline:!0,refs:T},_);return x("div",{id:c(z,c0),key:D.identifier},z+": ",w(L,{inline:!0,refs:T}))}))),u.wrapper===null)return R;let k=u.wrapper||(u.forceInline?"span":"div"),A;if(R.length>1||u.forceWrapper)A=R;else return R.length===1?R[0]:null;return g(k,{key:"outer",...u.wrapperProps},A)}function A$(t="",i={}){let u={...i||{}};u.overrides=u.overrides||{};let c=u.slugify||c0,p=u.sanitizer||s1;function g(x){let E=u.forceInline||!u.forceBlock&&!T$.test(x),_={...u,slugify:R=>c(R,c0),sanitizer:p,tagfilter:u.tagfilter!==!1};E||v$(x,v,_);let T=x;if(!E){let R=T.length;for(;R>0&&(T[R-1]===`
115
115
  `||T[R-1]==="\r");)R--;T=T.slice(0,R),T=`${T.replace(t6,"")}
116
116
 
117
- `}let w=c9(E?x:T,{inline:E,refs:v},_);return J5(w,{..._,forceInline:E})}let v={};return g(t)}var oZ=({children:t,options:i,...u})=>{if(!(typeof reactExports.useContext<"u")){let v={...i,overrides:{...i?.overrides},wrapperProps:{...i?.wrapperProps,...u}};return A$(t??"",v)}let c=reactExports.useContext(ZZ),p=reactExports.useMemo(()=>({...c,...i,overrides:{...c?.overrides,...i?.overrides},wrapperProps:{...c?.wrapperProps,...i?.wrapperProps,...u}}),[c,i,u]),g=t??"";return reactExports.useMemo(()=>A$(g,p),[g,p])},X5=oZ;const generalConditionsContainer="_generalConditionsContainer_55hjg_1",generalConditions="_generalConditions_55hjg_1",generalConditionsHeader="_generalConditionsHeader_55hjg_15",generalConditionsBody="_generalConditionsBody_55hjg_26",generalConditionsAccept="_generalConditionsAccept_55hjg_35",styles$l={generalConditionsContainer,generalConditions,generalConditionsHeader,generalConditionsBody,generalConditionsAccept},CaretDown=()=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:jsxRuntimeExports.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"})}),CaretUp=()=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:jsxRuntimeExports.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"})}),HEADER_KEY="general-conditions.header",BODY_KEY="general-conditions.body",ACCEPT_KEY="general-conditions.accept-conditions-note",GeneralConditions=()=>{const t=useTranslation(),[i,u]=reactExports.useState(!1),c=()=>u(!i),p=x=>{x.key==="ArrowDown"||x.key==="ArrowRight"?u(!0):x.key==="ArrowUp"||x.key==="ArrowLeft"||x.key==="Escape"?u(!1):(x.key==="Enter"||x.key==="Space"||x.key===" ")&&c()},g=t(HEADER_KEY),v=t(ACCEPT_KEY);return jsxRuntimeExports.jsxs("div",{className:clsx(styles$l.generalConditionsContainer,"chat__generalConditions"),children:[!!g?.length&&jsxRuntimeExports.jsxs("div",{className:styles$l.generalConditions,children:[jsxRuntimeExports.jsxs("div",{role:"button",onClick:c,onKeyDown:p,tabIndex:0,className:clsx(styles$l.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":i?"true":"false","aria-pressed":i?"true":"false",children:[jsxRuntimeExports.jsx(X5,{children:g}),i?jsxRuntimeExports.jsx(CaretUp,{}):jsxRuntimeExports.jsx(CaretDown,{})]}),jsxRuntimeExports.jsx("div",{className:clsx(styles$l.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:i&&jsxRuntimeExports.jsx(X5,{children:t(BODY_KEY)||""})})]}),!!v?.length&&jsxRuntimeExports.jsx("div",{className:clsx(styles$l.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:jsxRuntimeExports.jsx(X5,{children:t(ACCEPT_KEY)||""})})]})},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",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",styles$k={messageContainer,message,messageBot,messageBotLast,avatar,messageBotFirst,messageBotAnimated,messageGuest,messageGuestFirst,messageGuestLast,botAvatar,agentAvatar,bubble,bubbleContent,bubbleLeft,leftText,bubbleRight,rightText,sourceInfoReference,sourceInfoReferenceActive},useClickOutsideEventListener=(t,i)=>{reactExports.useEffect(()=>{const u=c=>{t.current&&!t.current.contains(c.target)&&i()};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[t,i])};function debounce(t,i){let u=null,c=null;const p=(...g)=>{c=g,u&&clearTimeout(u),u=setTimeout(()=>{t(...c),u=null,c=null},i)};return p.flush=()=>{u&&c&&(clearTimeout(u),t(...c),u=null,c=null)},p}function throttle(t,i){let u=0,c=null;return((...p)=>{const g=Date.now(),v=g-u;v>=i?(u=g,t(...p)):(c&&clearTimeout(c),c=setTimeout(()=>{u=Date.now(),t(...p)},i-v))})}const container$5="_container_131ib_1",categoryContainer="_categoryContainer_131ib_13",categoryButton="_categoryButton_131ib_20",active$2="_active_131ib_35",commentTextarea="_commentTextarea_131ib_44",styles$j={container:container$5,categoryContainer,categoryButton,active:active$2,commentTextarea},useTrapFocusEffect=(t,i,u)=>{reactExports.useEffect(()=>{if(t){const c=()=>{const g=["button:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"a[href]","input:not([disabled])","select:not([disabled])"].join(","),v=i.current?Array.from(i.current.querySelectorAll(g)):[],x=u.current?Array.from(u.current.querySelectorAll(g)):[];return[...v,...x]},p=g=>{if(g.key==="Tab"){const v=c();if(v.length>0){const x=v[0],E=v[v.length-1],_=document.activeElement;!g.shiftKey&&_===E?(g.preventDefault(),x.focus()):g.shiftKey&&_===x&&(g.preventDefault(),E.focus())}}};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0)}}},[t,i,u])},BadReactionForm=({open:t,actionsRef:i,reaction:u,onReaction:c})=>{const p=useTranslation(),g=reactExports.useRef(null),v=debounce(_=>{c({...u,comment:_})},300);reactExports.useEffect(()=>()=>v.flush(),[v]),useTrapFocusEffect(t,i,g);const x=_=>{c({...u,category:u.category===_?void 0:_})},E=_=>v(_.target.value);return t?jsxRuntimeExports.jsxs("div",{ref:g,className:styles$j.container,role:"dialog","aria-modal":"true","aria-labelledby":"bad-reaction-title",children:[jsxRuntimeExports.jsx("h2",{id:"bad-reaction-title",children:p("bot-bubble.reaction.say-more")}),jsxRuntimeExports.jsx("div",{className:styles$j.categoryContainer,role:"radiogroup",children:["WRONG_INFORMATION","MISSING_INFORMATION","OLD_INFORMATION","UNCLEAR","OFF_TOPIC"].map(_=>jsxRuntimeExports.jsx("button",{className:clsx(styles$j.categoryButton,u?.category===_&&styles$j.active),onClick:()=>x(_),"aria-pressed":u?.category===_,"aria-label":p(`bot-bubble.reaction.category.${_}`),tabIndex:0,role:"radio",children:p(`bot-bubble.reaction.category.${_}`)},_))}),jsxRuntimeExports.jsx("textarea",{id:"comment",name:"comment",placeholder:p("bot-bubble.reaction.comment"),defaultValue:u?.comment,onChange:E,className:styles$j.commentTextarea,rows:3,"aria-label":p("bot-bubble.reaction.comment")})]}):null},botMessageActionContainer="_botMessageActionContainer_18fjb_1",alwaysVisible="_alwaysVisible_18fjb_15",active$1="_active_18fjb_19",botMessageActionInnerContainer="_botMessageActionInnerContainer_18fjb_27",header$1="_header_18fjb_52",botMessageActions="_botMessageActions_18fjb_57",reported="_reported_18fjb_68",action="_action_18fjb_72",wave="_wave_18fjb_86",anyReport="_anyReport_18fjb_156",closeButton="_closeButton_18fjb_172",styles$i={botMessageActionContainer,alwaysVisible,active:active$1,botMessageActionInnerContainer,header:header$1,botMessageActions,reported,action,wave,anyReport,closeButton},CloseButton=({isSubmitting:t,onClick:i})=>{const u=useTranslation();return jsxRuntimeExports.jsx("button",{className:clsx(styles$i.action,styles$i.closeButton,"tooltip--bottom-left"),"aria-label":u("bot-bubble.reaction.close"),"data-title":u("bot-bubble.reaction.close"),tabIndex:0,onClick:i,children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:t?jsxRuntimeExports.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"}):jsxRuntimeExports.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"})})})},BotMessageActions=({alwaysVisible:t,senderType:i,reaction:u,botMessageRef:c,message:p,animated:g,onReaction:v})=>{const x=useTranslation(),[E,_]=reactExports.useState(!1),[T,w]=reactExports.useState(!1),[R,M]=reactExports.useState(!1),k=reactExports.useRef(null),A=reactExports.useRef(null);useClickOutsideEventListener(k,()=>{M(!1)});const D=Z=>{Z.key==="Escape"&&M(!1)};reactExports.useEffect(()=>(document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}),[]),reactExports.useEffect(()=>{R&&k.current?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[R]);const z=Z=>{A.current&&clearTimeout(A.current),w(!0),v(Z),A.current=setTimeout(()=>{w(!1)},1e3)},L=reactExports.useCallback(async()=>{if(c.current)try{_(!0);const Z=c.current.innerHTML,F=c.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([Z],{type:"text/html"}),"text/plain":new Blob([F],{type:"text/plain"})})]),await new Promise(Y=>setTimeout(Y,1500))}finally{_(!1)}},[c]),U=()=>{M(!1),v(u?.type==="GOOD"?null:{type:"GOOD"})},V=()=>{v({...p.reaction,type:"BAD"}),M(!R)},Q=Z=>F=>{(F.key==="Enter"||F.key===" ")&&Z()};return jsxRuntimeExports.jsx("div",{ref:k,className:clsx(styles$i.botMessageActionContainer,t&&styles$i.alwaysVisible,R&&styles$i.active),"aria-hidden":"true",children:jsxRuntimeExports.jsxs("div",{className:clsx(styles$i.botMessageActionInnerContainer,t&&styles$i.alwaysVisible,R&&styles$i.active,u&&styles$i.reported),role:"group","aria-label":x("bot-bubble.actions.label"),children:[jsxRuntimeExports.jsxs("div",{className:styles$i.header,children:[jsxRuntimeExports.jsxs("div",{className:clsx(styles$i.botMessageActions,u&&styles$i.reported),children:[i===UserType.BOT&&jsxRuntimeExports.jsx("button",{className:clsx(styles$i.action,g&&styles$i.wave,u?.type&&styles$i.anyReport,u?.type==="GOOD"&&styles$i.reported,"tooltip--top-right"),tabIndex:0,"aria-label":x(u?.type==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),"aria-pressed":u?.type==="GOOD","data-title":x(u?.type==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),onPointerDown:U,onKeyDown:Q(U),children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:u?.type==="GOOD"?jsxRuntimeExports.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"}):jsxRuntimeExports.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"})})}),i===UserType.BOT&&jsxRuntimeExports.jsx("button",{className:clsx(styles$i.action,g&&styles$i.wave,u?.type&&styles$i.anyReport,u?.type==="BAD"&&styles$i.reported,"tooltip--top-right"),tabIndex:0,"aria-label":x("bot-bubble.reaction.bad"),"aria-pressed":u?.type==="BAD","data-title":x("bot-bubble.reaction.bad"),onPointerDown:V,onKeyDown:Q(V),children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:u?.type==="BAD"?jsxRuntimeExports.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"}):jsxRuntimeExports.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"})})}),jsxRuntimeExports.jsx("button",{className:clsx(styles$i.action,g&&styles$i.wave,"tooltip--top-right"),style:{visibility:R?"hidden":"visible"},tabIndex:0,"aria-label":x("bot-bubble.copy"),"data-title":x("bot-bubble.copy"),onClick:L,children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E?jsxRuntimeExports.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"}):jsxRuntimeExports.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"})})})]}),R&&jsxRuntimeExports.jsx(CloseButton,{isSubmitting:T,onClick:()=>M(!1)})]}),p.reaction&&jsxRuntimeExports.jsx(BadReactionForm,{open:R,actionsRef:k,reaction:p.reaction,onReaction:z})]})})},BotMessage=reactExports.forwardRef(({message:t,isAnimated:i,isFirstMessage:u,isLastMessage:c,isFirstMessageBySender:p,isLastMessageBySender:g,children:v,onReaction:x},E)=>{const _=useTranslation(),T=reactExports.useRef(null),w=t.sender.type===UserType$1.BOT;return jsxRuntimeExports.jsxs("li",{ref:E,className:clsx(styles$k.message,styles$k.messageBot,c&&styles$k.lastMessage,p&&styles$k.messageBotFirst,g&&styles$k.messageBotLast,"chat__bubbleContainer",i&&styles$k.messageBotAnimated,i&&"chat__bubbleContainer--animated",w?"chat__botBubbleContainer":"chat__agentBubbleContainer",p&&"chat__bubbleContainer--first",g&&"chat__bubbleContainer--last"),role:"article",children:[jsxRuntimeExports.jsx("img",{className:clsx(styles$k.avatar,w?styles$k.botAvatar:styles$k.agentAvatar,"chat__avatar",w?"chat__botAvatar":"chat__agentAvatar"),src:`${t.sender.avatar}`,alt:w?"Bot":"Agent",referrerPolicy:"no-referrer","aria-hidden":"true"}),jsxRuntimeExports.jsxs("div",{className:styles$k.messageContainer,children:[jsxRuntimeExports.jsx("div",{ref:T,className:clsx(styles$k.bubble,styles$k.bubbleLeft,"chat__bubble",w?"chat__botBubble":"chat__agentBubble"),tabIndex:0,role:"group","aria-label":_(w?"bot-bubble.label":"agent-bubble.label"),children:jsxRuntimeExports.jsx("div",{className:clsx(styles$k.leftText),children:v})}),x&&jsxRuntimeExports.jsx(BotMessageActions,{alwaysVisible:c&&g,senderType:t.sender.type,reaction:t.reaction,message:t,botMessageRef:T,animated:u,onReaction:x})]})]})}),sourceList="_sourceList_1sc0q_1",source="_source_1sc0q_1",label="_label_1sc0q_39",styles$h={sourceList,source,label},Docx=t=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:jsxRuntimeExports.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"})}),File$1=t=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:jsxRuntimeExports.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"})}),Pdf=t=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:jsxRuntimeExports.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"})}),Web=t=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:jsxRuntimeExports.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"})}),SourceIcon=({type:t,...i})=>{switch(t){case"WEBSITE":return jsxRuntimeExports.jsx(Web,{...i});case"PDF":return jsxRuntimeExports.jsx(Pdf,{...i});case"DOCX":return jsxRuntimeExports.jsx(Docx,{...i});default:return jsxRuntimeExports.jsx(File$1,{...i})}},MessageSources=({sources:t,onLinkClick:i})=>{const u=useTranslation(),c=g=>()=>{i(g.url)},p=g=>v=>{(v.key==="Enter"||v.key===" ")&&i(g.url)};return t.length?jsxRuntimeExports.jsx("ul",{className:styles$h.sourceList,"aria-label":u("bot-bubble.sources"),children:t.map(g=>jsxRuntimeExports.jsx("li",{className:styles$h.source,children:jsxRuntimeExports.jsxs("a",{role:"button",tabIndex:0,"aria-label":`${u("bot-bubble.source.open")}: ${g.label}`,onClick:c(g),onKeyDown:p(g),children:[jsxRuntimeExports.jsx(SourceIcon,{type:g.type,"aria-hidden":"true"}),jsxRuntimeExports.jsx("div",{className:styles$h.label,children:g.label})]})},g.url))}):null},button$2="_button_3ui4g_1",buttonDefault="_buttonDefault_3ui4g_13",buttonPrimary="_buttonPrimary_3ui4g_28",styles$g={button:button$2,buttonDefault,buttonPrimary},Button=({className:t,children:i,...u})=>jsxRuntimeExports.jsx("button",{className:clsx(styles$g.button,t),type:"button",role:"button",...u,children:i}),title="_title_137pi_1",buttons$1="_buttons_137pi_6",button$1="_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",styles$f={title,buttons:buttons$1,button:button$1,imageContainer,image,video_container,video,only},Buttons=({buttons:t,onButtonClick:i})=>jsxRuntimeExports.jsx("div",{className:clsx(styles$f.buttons,"chat__bubbleButtons"),children:t.map((u,c)=>jsxRuntimeExports.jsx(Button,{className:clsx(styles$f.button,"chat__bubbleButton"),onClick:()=>i(u),children:u.title},c))}),OPEN_LINK_IN_NEW_TAB_INDICATOR="newtab#",MarkdownText=({markdown:t,markdownOptions:i={},onLinkClick:u})=>{const c=g=>v=>(v.preventDefault(),g&&u(g),!1),p=({title:g,href:v,children:x})=>v.indexOf(OPEN_LINK_IN_NEW_TAB_INDICATOR)===0?jsxRuntimeExports.jsx("a",{href:v.slice(OPEN_LINK_IN_NEW_TAB_INDICATOR.length),title:g,target:"_blank",rel:"noopener noreferrer",children:x}):jsxRuntimeExports.jsx("a",{onClick:c(v),title:g,href:v,children:x});return jsxRuntimeExports.jsx(X5,{options:{...i,overrides:{a:p}},children:t})},Text$2=({text:t,onLinkClick:i})=>t?jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(MarkdownText,{markdown:t,onLinkClick:i})}):null,Title=({title:t})=>t?jsxRuntimeExports.jsx("h1",{className:styles$f.title,children:t}):null,Body=({title:t,text:i,buttons:u,onButtonClick:c,onLinkClick:p})=>t?.length||i?.length||u?.length?jsxRuntimeExports.jsxs("div",{className:clsx(styles$k.bubbleContent),children:[jsxRuntimeExports.jsx(Title,{title:t}),jsxRuntimeExports.jsx(Text$2,{text:i,onLinkClick:p}),jsxRuntimeExports.jsx(Buttons,{buttons:u,onButtonClick:c})]}):null,Image=({alt:t,imageUrl:i,itemUrl:u,hasBody:c})=>i?u?u.indexOf("youtube.com")>-1?jsxRuntimeExports.jsx("div",{className:styles$f.video_container,children:jsxRuntimeExports.jsx("iframe",{className:clsx(styles$f.video,{[styles$f.only]:!c}),title:"Youtube",width:"100%",src:u+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):jsxRuntimeExports.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",children:jsxRuntimeExports.jsx("div",{className:styles$f.imageContainer,children:jsxRuntimeExports.jsx("img",{className:clsx(styles$f.image,{[styles$f.only]:!c}),src:i,alt:t})})}):jsxRuntimeExports.jsx("div",{className:styles$f.imageContainer,children:jsxRuntimeExports.jsx("img",{className:clsx(styles$f.image,{[styles$f.only]:!c}),src:i,alt:t})}):null,DetailMessage=({title:t,text:i,imageUrl:u,itemUrl:c,buttons:p,sources:g,onButtonClick:v,onLinkClick:x})=>{const E=!!t?.length||!!i?.length||!!p?.length;return jsxRuntimeExports.jsxs("div",{className:clsx(styles$f.detailMessage),children:[jsxRuntimeExports.jsx(Image,{hasBody:E,imageUrl:u,itemUrl:c,alt:t||""}),E&&jsxRuntimeExports.jsx(Body,{title:t,text:i,buttons:p,onLinkClick:x,onButtonClick:v}),jsxRuntimeExports.jsx(MessageSources,{sources:g,onLinkClick:x})]})},UserMessage=reactExports.forwardRef(({isFirstMessageBySender:t,isLastMessageBySender:i,children:u},c)=>{const p=useTranslation();return jsxRuntimeExports.jsx("li",{ref:c,className:clsx(styles$k.message,styles$k.messageGuest,t&&styles$k.messageGuestFirst,i&&styles$k.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",t&&"chat__bubbleContainer--first",i&&"chat__bubbleContainer--last"),role:"article",children:jsxRuntimeExports.jsx("div",{className:clsx(styles$k.bubble,styles$k.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,role:"group","aria-label":p("guest-bubble.label"),children:jsxRuntimeExports.jsx("div",{className:clsx(styles$k.rightText),children:u})})})}),useClientName=()=>reactExports.useMemo(()=>getClientName(),[]),markdown="_markdown_nw7vg_1",markdownStyle={markdown},SOURCE_REFERENCE_CLASS="source-info-reference",MarkdownMessage=({actionId:t,markdown:i,sources:u,onLinkClick:c})=>{const p=useClientName(),g=useAppDispatch(),v=getFootnoteReferenceCounter(),x=useAppSelector(T=>{const w=T.chat.sourceInfos;if(w?.type==="loaded"||w?.type==="loading")return w.chunkId}),E=T=>w=>{const R=w.key;(R==="ArrowDown"||R==="ArrowRight"||R==="Enter"||R===" "||R==="Space")&&(w.stopPropagation(),g(loadSourceInfosRequest(p,t,T)))},_=T=>()=>{g(loadSourceInfosRequest(p,t,T))};return reactExports.useLayoutEffect(()=>{document.querySelectorAll(`.${SOURCE_REFERENCE_CLASS}`).forEach(T=>{const w=T.previousSibling;w&&w.nodeType===Node.TEXT_NODE&&w.textContent?.endsWith(" ")&&w.textContent?.trim().length&&T.classList.add(`${SOURCE_REFERENCE_CLASS}--before-space`);const R=T.nextSibling;R&&R.nodeType===Node.TEXT_NODE&&R.textContent?.startsWith(" ")&&R.textContent?.trim().length&&T.classList.add(`${SOURCE_REFERENCE_CLASS}--after-space`)})},[i]),jsxRuntimeExports.jsxs("div",{className:styles$k.bubbleContent,children:[jsxRuntimeExports.jsx("div",{className:markdownStyle.markdown,children:jsxRuntimeExports.jsx(MarkdownText,{markdown:i,onLinkClick:c,markdownOptions:{renderRule(T,w,R,M){if(w.type===W.footnoteReference){const k=w.text===x;return jsxRuntimeExports.jsx("span",{className:clsx(styles$k.sourceInfoReference,k&&styles$k.sourceInfoReferenceActive,SOURCE_REFERENCE_CLASS),children:jsxRuntimeExports.jsx("a",{type:"button",tabIndex:0,onClick:_(w.text),onKeyDown:E(w.text),children:v(w.text)})},M.key)}return T()}}})}),jsxRuntimeExports.jsx(MessageSources,{sources:u,onLinkClick:c})]})},getFootnoteReferenceCounter=()=>{const t=[];return u=>{const c=t.indexOf(u);return c>-1?c+1:(t.push(u),t.length)}},text$1="_text_gp0s0_1",command$1="_command_gp0s0_5",styles$e={text:text$1,command:command$1},Text$1=({text:t,commands:i=[]})=>{const u=i.find(p=>t.startsWith(`/${p}`)),c=u?t.slice(u.length+1):t;return jsxRuntimeExports.jsxs("div",{children:[u&&jsxRuntimeExports.jsxs("code",{className:styles$e.command,children:["/",u]}),c.split(`
118
- `).map((p,g)=>jsxRuntimeExports.jsxs("span",{className:styles$e.text,children:[p,jsxRuntimeExports.jsx("br",{})]},g))]})},TextMessage=({text:t,commands:i,sources:u,onLinkClick:c})=>jsxRuntimeExports.jsxs("div",{className:styles$k.bubbleContent,children:[jsxRuntimeExports.jsx(Text$1,{text:t,commands:i}),jsxRuntimeExports.jsx(MessageSources,{sources:u,onLinkClick:c})]}),Message=reactExports.forwardRef(({message:t,commands:i,isFirstMessage:u,isLastMessage:c,isFirstMessageBySender:p,isLastMessageBySender:g,onReaction:v,onButtonClick:x,onLinkClick:E},_)=>{const T=getMessageCmp(t._id,t,i,x,E),w=R=>{v(t._id,R)};return t.sender.type===UserType$1.GUEST?jsxRuntimeExports.jsx(UserMessage,{ref:_,isFirstMessageBySender:p,isLastMessageBySender:g,children:T}):jsxRuntimeExports.jsx(BotMessage,{ref:_,message:t,isAnimated:!1,isFirstMessage:u,isLastMessage:c,isFirstMessageBySender:p,isLastMessageBySender:g,onReaction:w,children:T})}),getMessageCmp=(t,i,u,c,p)=>{switch(i.type){case MessageTypeEnum.TEXT:{const g=i;return jsxRuntimeExports.jsx(TextMessage,{text:g.text,commands:u,sources:i.sources||[],onLinkClick:p})}case MessageTypeEnum.DETAIL:{const g=i;return jsxRuntimeExports.jsx(DetailMessage,{title:g.title,text:g.text,imageUrl:g.imageUrl,itemUrl:g.itemUrl,buttons:g.buttons,sources:i.sources||[],onButtonClick:c,onLinkClick:p})}case MessageTypeEnum.MARKDOWN:{const g=i;return jsxRuntimeExports.jsx(MarkdownMessage,{actionId:t,markdown:g.markdown,sources:g.sources||[],onLinkClick:p})}}},areEqual=(t,i)=>t.message._id===i.message._id&&t.message.reaction===i.message.reaction&&t.isFirstMessage===i.isFirstMessage&&t.isLastMessage===i.isLastMessage&&t.isFirstMessageBySender===i.isFirstMessageBySender&&t.isLastMessageBySender===i.isLastMessageBySender,Message$1=React.memo(Message,areEqual),ticontainer="_ticontainer_xg0dn_1",tiblock="_tiblock_xg0dn_5",tidot="_tidot_xg0dn_12",styles$d={ticontainer,tiblock,tidot},TypingIndicator=({isTyping:t=!1})=>jsxRuntimeExports.jsx("div",{className:styles$d.ticontainer,children:jsxRuntimeExports.jsx("div",{className:styles$d.tiblock,children:t?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:clsx(styles$d.tidot,"chat__typingIndicator"),"aria-hidden":"true"}),jsxRuntimeExports.jsx("div",{className:clsx(styles$d.tidot,"chat__typingIndicator"),"aria-hidden":"true"}),jsxRuntimeExports.jsx("div",{className:clsx(styles$d.tidot,"chat__typingIndicator"),"aria-hidden":"true"})]}):null})}),BotTypingMessage=Object.assign({_id:"typing-indicator"},new TextMessage$1("",new BotUser)),Conversation=({messages:t,isBotTyping:i,commands:u,onTranscriptItemReaction:c,onButtonClick:p,onLinkClick:g})=>{const v=useTranslation(),x=reactExports.useRef(0),E=reactExports.useRef(!0),_=reactExports.useRef(null),T=reactExports.useRef(null),w=reactExports.useRef(null),R=useAppSelector(A=>A.settings.enableGeneralConditions);reactExports.useLayoutEffect(()=>{if(t.length&&_.current&&(x.current<t.length||i)){if(T.current){const A=T.current.offsetTop;_.current.scrollTop=A}else if(w.current){const A=w.current.offsetTop;_.current.scrollTop=A}E.current&&(E.current=!1),x.current=t.length}},[t,E,i]);let M;const k=t.length;return jsxRuntimeExports.jsxs("div",{ref:_,className:clsx(styles$m.messageContainer,"chat__messageContainer"),style:{scrollBehavior:t.length&&E.current?"auto":"smooth"},id:"MessageContainer","aria-label":v("conversation.label"),children:[R&&jsxRuntimeExports.jsx(GeneralConditions,{}),jsxRuntimeExports.jsxs("ul",{className:styles$m.messages,role:"list",children:[t.map((A,D)=>{const z=getIsFirstMessageBySender(A,M),L=getIsLastMessageBySender(A,D,t,i);M=A.sender.type;const U=D+1===k,V=D===0,Q=A._id||`added-${D}`;return jsxRuntimeExports.jsx(Message$1,{ref:U?w:null,message:A,commands:u,isFirstMessage:V,isLastMessage:U,isFirstMessageBySender:z,isLastMessageBySender:L,onButtonClick:p,onLinkClick:g,onReaction:c},Q)}),i&&jsxRuntimeExports.jsx(BotMessage,{ref:T,message:BotTypingMessage,isFirstMessage:!1,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:M!==UserType$1.BOT,isLastMessageBySender:!0,children:jsxRuntimeExports.jsx(TypingIndicator,{isTyping:!0})},"last")]})]})},getIsFirstMessageBySender=(t,i)=>!i||i!==t.sender.type,getIsLastMessageBySender=(t,i,u,c)=>{const p=t.sender.type,g=u.length;return i+1===g?!(p===UserType$1.BOT&&c):p!==u.at(i+1)?.sender.type},bottomSheet="_bottomSheet_jp8dl_1",bottomSheetOpen="_bottomSheetOpen_jp8dl_15",bottomSheetClose="_bottomSheetClose_jp8dl_20",bottomSheetStyles={bottomSheet,bottomSheetOpen,bottomSheetClose},container$4="_container_xc2nx_1",styles$c={container:container$4},Drawer=({contentUrl:t})=>{const i=useAppSelector(g=>g.connection.sessionId),[u,c]=reactExports.useState(!1);reactExports.useEffect(()=>{c(g=>g||!!t)},[t]);const p=reactExports.useMemo(()=>{if(t&&i){const g=new URL(t,document.baseURI);return g.searchParams.set("sessionId",i),g.toString()}else return},[t,i]);return jsxRuntimeExports.jsx("div",{className:clsx(styles$c.container,bottomSheetStyles.bottomSheet,{[bottomSheetStyles.bottomSheetOpen]:!!t,[bottomSheetStyles.bottomSheetClose]:u&&!t}),children:p&&jsxRuntimeExports.jsx("iframe",{title:"Drawer",id:"form-drawer",src:p,className:styles$c.iframe})})},container$3="_container_vvbth_1",styles$b={container:container$3},Link$1=({title:t,href:i,children:u})=>jsxRuntimeExports.jsx("a",{href:i,title:t,target:"_blank",rel:"noopener noreferrer",children:u}),PoweredBy=()=>{const i=useTranslation()("powered-by");return i&&i.length?jsxRuntimeExports.jsx("div",{className:clsx(styles$b.container,"chat__poweredBy"),children:jsxRuntimeExports.jsx(X5,{options:{overrides:{a:Link$1}},children:i})}):null},markdownToPlainText=t=>t.replace(/^#{1,6}\s+/gm,"").replace(/(\*\*|__)(.*?)\1/g,"$2").replace(/(\*|_)(.*?)\1/g,"$2").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").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,`
117
+ `}let w=c9(E?x:T,{inline:E,refs:v},_);return J5(w,{..._,forceInline:E})}let v={};return g(t)}var oZ=({children:t,options:i,...u})=>{if(!(typeof reactExports.useContext<"u")){let v={...i,overrides:{...i?.overrides},wrapperProps:{...i?.wrapperProps,...u}};return A$(t??"",v)}let c=reactExports.useContext(ZZ),p=reactExports.useMemo(()=>({...c,...i,overrides:{...c?.overrides,...i?.overrides},wrapperProps:{...c?.wrapperProps,...i?.wrapperProps,...u}}),[c,i,u]),g=t??"";return reactExports.useMemo(()=>A$(g,p),[g,p])},X5=oZ;const generalConditionsContainer="_generalConditionsContainer_55hjg_1",generalConditions="_generalConditions_55hjg_1",generalConditionsHeader="_generalConditionsHeader_55hjg_15",generalConditionsBody="_generalConditionsBody_55hjg_26",generalConditionsAccept="_generalConditionsAccept_55hjg_35",styles$l={generalConditionsContainer,generalConditions,generalConditionsHeader,generalConditionsBody,generalConditionsAccept},CaretDown=()=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:jsxRuntimeExports.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"})}),CaretUp=()=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:jsxRuntimeExports.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"})}),HEADER_KEY="general-conditions.header",BODY_KEY="general-conditions.body",ACCEPT_KEY="general-conditions.accept-conditions-note",GeneralConditions=()=>{const t=useTranslation(),[i,u]=reactExports.useState(!1),c=()=>u(!i),p=x=>{x.key==="ArrowDown"||x.key==="ArrowRight"?u(!0):x.key==="ArrowUp"||x.key==="ArrowLeft"||x.key==="Escape"?u(!1):(x.key==="Enter"||x.key==="Space"||x.key===" ")&&c()},g=t(HEADER_KEY),v=t(ACCEPT_KEY);return jsxRuntimeExports.jsxs("div",{className:clsx(styles$l.generalConditionsContainer,"chat__generalConditions"),children:[!!g?.length&&jsxRuntimeExports.jsxs("div",{className:styles$l.generalConditions,children:[jsxRuntimeExports.jsxs("div",{role:"button",onClick:c,onKeyDown:p,tabIndex:0,className:clsx(styles$l.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":i?"true":"false","aria-pressed":i?"true":"false",children:[jsxRuntimeExports.jsx(X5,{children:g}),i?jsxRuntimeExports.jsx(CaretUp,{}):jsxRuntimeExports.jsx(CaretDown,{})]}),jsxRuntimeExports.jsx("div",{className:clsx(styles$l.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:i&&jsxRuntimeExports.jsx(X5,{children:t(BODY_KEY)||""})})]}),!!v?.length&&jsxRuntimeExports.jsx("div",{className:clsx(styles$l.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:jsxRuntimeExports.jsx(X5,{children:t(ACCEPT_KEY)||""})})]})},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",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",styles$k={messageContainer,message,messageBot,messageBotLast,avatar,messageBotFirst,messageBotAnimated,messageGuest,messageGuestFirst,messageGuestLast,botAvatar,agentAvatar,bubble,bubbleContent,bubbleLeft,leftText,bubbleRight,rightText,sourceInfoReference,sourceInfoReferenceActive},useClickOutsideEventListener=(t,i)=>{reactExports.useEffect(()=>{const u=c=>{t.current&&!t.current.contains(c.target)&&i()};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[t,i])};function debounce(t,i){let u=null,c=null;const p=(...g)=>{c=g,u&&clearTimeout(u),u=setTimeout(()=>{t(...c),u=null,c=null},i)};return p.flush=()=>{u&&c&&(clearTimeout(u),t(...c),u=null,c=null)},p}function throttle(t,i){let u=0,c=null;return((...p)=>{const g=Date.now(),v=g-u;v>=i?(u=g,t(...p)):(c&&clearTimeout(c),c=setTimeout(()=>{u=Date.now(),t(...p)},i-v))})}const container$5="_container_131ib_1",categoryContainer="_categoryContainer_131ib_13",categoryButton="_categoryButton_131ib_20",active$2="_active_131ib_35",commentTextarea="_commentTextarea_131ib_44",styles$j={container:container$5,categoryContainer,categoryButton,active:active$2,commentTextarea},useTrapFocusEffect=(t,i,u)=>{reactExports.useEffect(()=>{if(t){const c=()=>{const g=["button:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"a[href]","input:not([disabled])","select:not([disabled])"].join(","),v=i.current?Array.from(i.current.querySelectorAll(g)):[],x=u.current?Array.from(u.current.querySelectorAll(g)):[];return[...v,...x]},p=g=>{if(g.key==="Tab"){const v=c();if(v.length>0){const x=v[0],E=v[v.length-1],_=document.activeElement;!g.shiftKey&&_===E?(g.preventDefault(),x.focus()):g.shiftKey&&_===x&&(g.preventDefault(),E.focus())}}};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0)}}},[t,i,u])},BadReactionForm=({open:t,actionsRef:i,reaction:u,onReaction:c})=>{const p=useTranslation(),g=reactExports.useRef(null),v=debounce(_=>{c({...u,comment:_})},300);reactExports.useEffect(()=>()=>v.flush(),[v]),useTrapFocusEffect(t,i,g);const x=_=>{c({...u,category:u.category===_?void 0:_})},E=_=>v(_.target.value);return t?jsxRuntimeExports.jsxs("div",{ref:g,className:styles$j.container,role:"dialog","aria-modal":"true","aria-labelledby":"bad-reaction-title",children:[jsxRuntimeExports.jsx("h2",{id:"bad-reaction-title",children:p("bot-bubble.reaction.say-more")}),jsxRuntimeExports.jsx("div",{className:styles$j.categoryContainer,role:"radiogroup",children:["WRONG_INFORMATION","MISSING_INFORMATION","OLD_INFORMATION","UNCLEAR","OFF_TOPIC"].map(_=>jsxRuntimeExports.jsx("button",{className:clsx(styles$j.categoryButton,u?.category===_&&styles$j.active),onClick:()=>x(_),"aria-pressed":u?.category===_,"aria-label":p(`bot-bubble.reaction.category.${_}`),tabIndex:0,role:"radio",children:p(`bot-bubble.reaction.category.${_}`)},_))}),jsxRuntimeExports.jsx("textarea",{id:"comment",name:"comment",placeholder:p("bot-bubble.reaction.comment"),defaultValue:u?.comment,onChange:E,className:styles$j.commentTextarea,rows:3,"aria-label":p("bot-bubble.reaction.comment")})]}):null},botMessageActionContainer="_botMessageActionContainer_g6hpe_1",alwaysVisible="_alwaysVisible_g6hpe_15",active$1="_active_g6hpe_19",botMessageActionInnerContainer="_botMessageActionInnerContainer_g6hpe_27",header$1="_header_g6hpe_52",botMessageActions="_botMessageActions_g6hpe_57",reported="_reported_g6hpe_68",action="_action_g6hpe_72",anyReport="_anyReport_g6hpe_120",closeButton="_closeButton_g6hpe_136",styles$i={botMessageActionContainer,alwaysVisible,active:active$1,botMessageActionInnerContainer,header:header$1,botMessageActions,reported,action,anyReport,closeButton},CloseButton=({isSubmitting:t,onClick:i})=>{const u=useTranslation();return jsxRuntimeExports.jsx("button",{className:clsx(styles$i.action,styles$i.closeButton,"tooltip--bottom-left"),"aria-label":u("bot-bubble.reaction.close"),"data-title":u("bot-bubble.reaction.close"),tabIndex:0,onClick:i,children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:t?jsxRuntimeExports.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"}):jsxRuntimeExports.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"})})})},BotMessageActions=({alwaysVisible:t,senderType:i,reaction:u,botMessageRef:c,message:p,onReaction:g})=>{const v=useTranslation(),[x,E]=reactExports.useState(!1),[_,T]=reactExports.useState(!1),[w,R]=reactExports.useState(!1),M=reactExports.useRef(null),k=reactExports.useRef(null);useClickOutsideEventListener(M,()=>{R(!1)});const A=Q=>{Q.key==="Escape"&&R(!1)};reactExports.useEffect(()=>(document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}),[]),reactExports.useEffect(()=>{w&&M.current?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[w]);const D=Q=>{k.current&&clearTimeout(k.current),T(!0),g(Q),k.current=setTimeout(()=>{T(!1)},1e3)},z=reactExports.useCallback(async()=>{if(c.current)try{E(!0);const Q=c.current.innerHTML,Z=c.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([Q],{type:"text/html"}),"text/plain":new Blob([Z],{type:"text/plain"})})]),await new Promise(F=>setTimeout(F,1500))}finally{E(!1)}},[c]),L=()=>{R(!1),g(u?.type==="GOOD"?null:{type:"GOOD"})},U=()=>{g({...p.reaction,type:"BAD"}),R(!w)},V=Q=>Z=>{(Z.key==="Enter"||Z.key===" ")&&Q()};return jsxRuntimeExports.jsx("div",{ref:M,className:clsx(styles$i.botMessageActionContainer,t&&styles$i.alwaysVisible,w&&styles$i.active),"aria-hidden":"true",children:jsxRuntimeExports.jsxs("div",{className:clsx(styles$i.botMessageActionInnerContainer,t&&styles$i.alwaysVisible,w&&styles$i.active,u&&styles$i.reported),role:"group","aria-label":v("bot-bubble.actions.label"),children:[jsxRuntimeExports.jsxs("div",{className:styles$i.header,children:[jsxRuntimeExports.jsxs("div",{className:clsx(styles$i.botMessageActions,u&&styles$i.reported),children:[i===UserType.BOT&&jsxRuntimeExports.jsx("button",{className:clsx(styles$i.action,u?.type&&styles$i.anyReport,u?.type==="GOOD"&&styles$i.reported,"tooltip--top-right"),tabIndex:0,"aria-label":v(u?.type==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),"aria-pressed":u?.type==="GOOD","data-title":v(u?.type==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),onPointerDown:L,onKeyDown:V(L),children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:u?.type==="GOOD"?jsxRuntimeExports.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"}):jsxRuntimeExports.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"})})}),i===UserType.BOT&&jsxRuntimeExports.jsx("button",{className:clsx(styles$i.action,u?.type&&styles$i.anyReport,u?.type==="BAD"&&styles$i.reported,"tooltip--top-right"),tabIndex:0,"aria-label":v("bot-bubble.reaction.bad"),"aria-pressed":u?.type==="BAD","data-title":v("bot-bubble.reaction.bad"),onPointerDown:U,onKeyDown:V(U),children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:u?.type==="BAD"?jsxRuntimeExports.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"}):jsxRuntimeExports.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"})})}),jsxRuntimeExports.jsx("button",{className:clsx(styles$i.action,"tooltip--top-right"),style:{visibility:w?"hidden":"visible"},tabIndex:0,"aria-label":v("bot-bubble.copy"),"data-title":v("bot-bubble.copy"),onClick:z,children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:x?jsxRuntimeExports.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"}):jsxRuntimeExports.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"})})})]}),w&&jsxRuntimeExports.jsx(CloseButton,{isSubmitting:_,onClick:()=>R(!1)})]}),p.reaction&&jsxRuntimeExports.jsx(BadReactionForm,{open:w,actionsRef:M,reaction:p.reaction,onReaction:D})]})})},BotMessage=reactExports.forwardRef(({message:t,isAnimated:i,isLastMessage:u,isFirstMessageBySender:c,isLastMessageBySender:p,children:g,onReaction:v},x)=>{const E=useTranslation(),_=reactExports.useRef(null),T=t.sender.type===UserType$1.BOT;return jsxRuntimeExports.jsxs("li",{ref:x,className:clsx(styles$k.message,styles$k.messageBot,u&&styles$k.lastMessage,c&&styles$k.messageBotFirst,p&&styles$k.messageBotLast,"chat__bubbleContainer",i&&styles$k.messageBotAnimated,i&&"chat__bubbleContainer--animated",T?"chat__botBubbleContainer":"chat__agentBubbleContainer",c&&"chat__bubbleContainer--first",p&&"chat__bubbleContainer--last"),role:"article",children:[jsxRuntimeExports.jsx("img",{className:clsx(styles$k.avatar,T?styles$k.botAvatar:styles$k.agentAvatar,"chat__avatar",T?"chat__botAvatar":"chat__agentAvatar"),src:`${t.sender.avatar}`,alt:T?"Bot":"Agent",referrerPolicy:"no-referrer","aria-hidden":"true"}),jsxRuntimeExports.jsxs("div",{className:styles$k.messageContainer,children:[jsxRuntimeExports.jsx("div",{ref:_,className:clsx(styles$k.bubble,styles$k.bubbleLeft,"chat__bubble",T?"chat__botBubble":"chat__agentBubble"),tabIndex:0,role:"group","aria-label":E(T?"bot-bubble.label":"agent-bubble.label"),children:jsxRuntimeExports.jsx("div",{className:clsx(styles$k.leftText),children:g})}),v&&jsxRuntimeExports.jsx(BotMessageActions,{alwaysVisible:u&&p,senderType:t.sender.type,reaction:t.reaction,message:t,botMessageRef:_,onReaction:v})]})]})}),sourceList="_sourceList_1sc0q_1",source="_source_1sc0q_1",label="_label_1sc0q_39",styles$h={sourceList,source,label},Docx=t=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:jsxRuntimeExports.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"})}),File$1=t=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:jsxRuntimeExports.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"})}),Pdf=t=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:jsxRuntimeExports.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"})}),Web=t=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:jsxRuntimeExports.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"})}),SourceIcon=({type:t,...i})=>{switch(t){case"WEBSITE":return jsxRuntimeExports.jsx(Web,{...i});case"PDF":return jsxRuntimeExports.jsx(Pdf,{...i});case"DOCX":return jsxRuntimeExports.jsx(Docx,{...i});default:return jsxRuntimeExports.jsx(File$1,{...i})}},MessageSources=({sources:t,onLinkClick:i})=>{const u=useTranslation(),c=g=>()=>{i(g.url)},p=g=>v=>{(v.key==="Enter"||v.key===" ")&&i(g.url)};return t.length?jsxRuntimeExports.jsx("ul",{className:styles$h.sourceList,"aria-label":u("bot-bubble.sources"),children:t.map(g=>jsxRuntimeExports.jsx("li",{className:styles$h.source,children:jsxRuntimeExports.jsxs("a",{role:"button",tabIndex:0,"aria-label":`${u("bot-bubble.source.open")}: ${g.label}`,onClick:c(g),onKeyDown:p(g),children:[jsxRuntimeExports.jsx(SourceIcon,{type:g.type,"aria-hidden":"true"}),jsxRuntimeExports.jsx("div",{className:styles$h.label,children:g.label})]})},g.url))}):null},button$2="_button_3ui4g_1",buttonDefault="_buttonDefault_3ui4g_13",buttonPrimary="_buttonPrimary_3ui4g_28",styles$g={button:button$2,buttonDefault,buttonPrimary},Button=({className:t,children:i,...u})=>jsxRuntimeExports.jsx("button",{className:clsx(styles$g.button,t),type:"button",role:"button",...u,children:i}),title="_title_137pi_1",buttons$1="_buttons_137pi_6",button$1="_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",styles$f={title,buttons:buttons$1,button:button$1,imageContainer,image,video_container,video,only},Buttons=({buttons:t,onButtonClick:i})=>jsxRuntimeExports.jsx("div",{className:clsx(styles$f.buttons,"chat__bubbleButtons"),children:t.map((u,c)=>jsxRuntimeExports.jsx(Button,{className:clsx(styles$f.button,"chat__bubbleButton"),onClick:()=>i(u),children:u.title},c))}),OPEN_LINK_IN_NEW_TAB_INDICATOR="newtab#",MarkdownText=({markdown:t,markdownOptions:i={},onLinkClick:u})=>{const c=g=>v=>(v.preventDefault(),g&&u(g),!1),p=({title:g,href:v,children:x})=>v.indexOf(OPEN_LINK_IN_NEW_TAB_INDICATOR)===0?jsxRuntimeExports.jsx("a",{href:v.slice(OPEN_LINK_IN_NEW_TAB_INDICATOR.length),title:g,target:"_blank",rel:"noopener noreferrer",children:x}):jsxRuntimeExports.jsx("a",{onClick:c(v),title:g,href:v,children:x});return jsxRuntimeExports.jsx(X5,{options:{...i,overrides:{a:p}},children:t})},Text$2=({text:t,onLinkClick:i})=>t?jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(MarkdownText,{markdown:t,onLinkClick:i})}):null,Title=({title:t})=>t?jsxRuntimeExports.jsx("h1",{className:styles$f.title,children:t}):null,Body=({title:t,text:i,buttons:u,onButtonClick:c,onLinkClick:p})=>t?.length||i?.length||u?.length?jsxRuntimeExports.jsxs("div",{className:clsx(styles$k.bubbleContent),children:[jsxRuntimeExports.jsx(Title,{title:t}),jsxRuntimeExports.jsx(Text$2,{text:i,onLinkClick:p}),jsxRuntimeExports.jsx(Buttons,{buttons:u,onButtonClick:c})]}):null,Image=({alt:t,imageUrl:i,itemUrl:u,hasBody:c})=>i?u?u.indexOf("youtube.com")>-1?jsxRuntimeExports.jsx("div",{className:styles$f.video_container,children:jsxRuntimeExports.jsx("iframe",{className:clsx(styles$f.video,{[styles$f.only]:!c}),title:"Youtube",width:"100%",src:u+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):jsxRuntimeExports.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",children:jsxRuntimeExports.jsx("div",{className:styles$f.imageContainer,children:jsxRuntimeExports.jsx("img",{className:clsx(styles$f.image,{[styles$f.only]:!c}),src:i,alt:t})})}):jsxRuntimeExports.jsx("div",{className:styles$f.imageContainer,children:jsxRuntimeExports.jsx("img",{className:clsx(styles$f.image,{[styles$f.only]:!c}),src:i,alt:t})}):null,DetailMessage=({title:t,text:i,imageUrl:u,itemUrl:c,buttons:p,sources:g,onButtonClick:v,onLinkClick:x})=>{const E=!!t?.length||!!i?.length||!!p?.length;return jsxRuntimeExports.jsxs("div",{className:clsx(styles$f.detailMessage),children:[jsxRuntimeExports.jsx(Image,{hasBody:E,imageUrl:u,itemUrl:c,alt:t||""}),E&&jsxRuntimeExports.jsx(Body,{title:t,text:i,buttons:p,onLinkClick:x,onButtonClick:v}),jsxRuntimeExports.jsx(MessageSources,{sources:g,onLinkClick:x})]})},UserMessage=reactExports.forwardRef(({isFirstMessageBySender:t,isLastMessageBySender:i,children:u},c)=>{const p=useTranslation();return jsxRuntimeExports.jsx("li",{ref:c,className:clsx(styles$k.message,styles$k.messageGuest,t&&styles$k.messageGuestFirst,i&&styles$k.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",t&&"chat__bubbleContainer--first",i&&"chat__bubbleContainer--last"),role:"article",children:jsxRuntimeExports.jsx("div",{className:clsx(styles$k.bubble,styles$k.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,role:"group","aria-label":p("guest-bubble.label"),children:jsxRuntimeExports.jsx("div",{className:clsx(styles$k.rightText),children:u})})})}),useClientName=()=>reactExports.useMemo(()=>getClientName(),[]),markdown="_markdown_nw7vg_1",markdownStyle={markdown},SOURCE_REFERENCE_CLASS="source-info-reference",MarkdownMessage=({actionId:t,markdown:i,sources:u,onLinkClick:c})=>{const p=useClientName(),g=useAppDispatch(),v=getFootnoteReferenceCounter(),x=useAppSelector(T=>{const w=T.chat.sourceInfos;if(w?.type==="loaded"||w?.type==="loading")return w.chunkId}),E=T=>w=>{const R=w.key;(R==="ArrowDown"||R==="ArrowRight"||R==="Enter"||R===" "||R==="Space")&&(w.stopPropagation(),g(loadSourceInfosRequest(p,t,T)))},_=T=>()=>{g(loadSourceInfosRequest(p,t,T))};return reactExports.useLayoutEffect(()=>{document.querySelectorAll(`.${SOURCE_REFERENCE_CLASS}`).forEach(T=>{const w=T.previousSibling;w&&w.nodeType===Node.TEXT_NODE&&w.textContent?.endsWith(" ")&&w.textContent?.trim().length&&T.classList.add(`${SOURCE_REFERENCE_CLASS}--before-space`);const R=T.nextSibling;R&&R.nodeType===Node.TEXT_NODE&&R.textContent?.startsWith(" ")&&R.textContent?.trim().length&&T.classList.add(`${SOURCE_REFERENCE_CLASS}--after-space`)})},[i]),jsxRuntimeExports.jsxs("div",{className:styles$k.bubbleContent,children:[jsxRuntimeExports.jsx("div",{className:markdownStyle.markdown,children:jsxRuntimeExports.jsx(MarkdownText,{markdown:i,onLinkClick:c,markdownOptions:{renderRule(T,w,R,M){if(w.type===W.footnoteReference){const k=w.text===x;return jsxRuntimeExports.jsx("span",{className:clsx(styles$k.sourceInfoReference,k&&styles$k.sourceInfoReferenceActive,SOURCE_REFERENCE_CLASS),children:jsxRuntimeExports.jsx("a",{type:"button",tabIndex:0,onClick:_(w.text),onKeyDown:E(w.text),children:v(w.text)})},M.key)}return T()}}})}),jsxRuntimeExports.jsx(MessageSources,{sources:u,onLinkClick:c})]})},getFootnoteReferenceCounter=()=>{const t=[];return u=>{const c=t.indexOf(u);return c>-1?c+1:(t.push(u),t.length)}},text$1="_text_gp0s0_1",command$1="_command_gp0s0_5",styles$e={text:text$1,command:command$1},Text$1=({text:t,commands:i=[]})=>{const u=i.find(p=>t.startsWith(`/${p}`)),c=u?t.slice(u.length+1):t;return jsxRuntimeExports.jsxs("div",{children:[u&&jsxRuntimeExports.jsxs("code",{className:styles$e.command,children:["/",u]}),c.split(`
118
+ `).map((p,g)=>jsxRuntimeExports.jsxs("span",{className:styles$e.text,children:[p,jsxRuntimeExports.jsx("br",{})]},g))]})},TextMessage=({text:t,commands:i,sources:u,onLinkClick:c})=>jsxRuntimeExports.jsxs("div",{className:styles$k.bubbleContent,children:[jsxRuntimeExports.jsx(Text$1,{text:t,commands:i}),jsxRuntimeExports.jsx(MessageSources,{sources:u,onLinkClick:c})]}),Message=reactExports.forwardRef(({message:t,commands:i,isLastMessage:u,isFirstMessageBySender:c,isLastMessageBySender:p,onReaction:g,onButtonClick:v,onLinkClick:x},E)=>{const _=getMessageCmp(t._id,t,i,v,x),T=w=>{g(t._id,w)};return t.sender.type===UserType$1.GUEST?jsxRuntimeExports.jsx(UserMessage,{ref:E,isFirstMessageBySender:c,isLastMessageBySender:p,children:_}):jsxRuntimeExports.jsx(BotMessage,{ref:E,message:t,isAnimated:!1,isLastMessage:u,isFirstMessageBySender:c,isLastMessageBySender:p,onReaction:T,children:_})}),getMessageCmp=(t,i,u,c,p)=>{switch(i.type){case MessageTypeEnum.TEXT:{const g=i;return jsxRuntimeExports.jsx(TextMessage,{text:g.text,commands:u,sources:i.sources||[],onLinkClick:p})}case MessageTypeEnum.DETAIL:{const g=i;return jsxRuntimeExports.jsx(DetailMessage,{title:g.title,text:g.text,imageUrl:g.imageUrl,itemUrl:g.itemUrl,buttons:g.buttons,sources:i.sources||[],onButtonClick:c,onLinkClick:p})}case MessageTypeEnum.MARKDOWN:{const g=i;return jsxRuntimeExports.jsx(MarkdownMessage,{actionId:t,markdown:g.markdown,sources:g.sources||[],onLinkClick:p})}}},areEqual=(t,i)=>t.message._id===i.message._id&&t.message.reaction===i.message.reaction&&t.isLastMessage===i.isLastMessage&&t.isFirstMessageBySender===i.isFirstMessageBySender&&t.isLastMessageBySender===i.isLastMessageBySender,Message$1=React.memo(Message,areEqual),ticontainer="_ticontainer_xg0dn_1",tiblock="_tiblock_xg0dn_5",tidot="_tidot_xg0dn_12",styles$d={ticontainer,tiblock,tidot},TypingIndicator=({isTyping:t=!1})=>jsxRuntimeExports.jsx("div",{className:styles$d.ticontainer,children:jsxRuntimeExports.jsx("div",{className:styles$d.tiblock,children:t?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:clsx(styles$d.tidot,"chat__typingIndicator"),"aria-hidden":"true"}),jsxRuntimeExports.jsx("div",{className:clsx(styles$d.tidot,"chat__typingIndicator"),"aria-hidden":"true"}),jsxRuntimeExports.jsx("div",{className:clsx(styles$d.tidot,"chat__typingIndicator"),"aria-hidden":"true"})]}):null})}),BotTypingMessage=Object.assign({_id:"typing-indicator"},new TextMessage$1("",new BotUser)),Conversation=({messages:t,isBotTyping:i,commands:u,onTranscriptItemReaction:c,onButtonClick:p,onLinkClick:g})=>{const v=useTranslation(),x=reactExports.useRef(0),E=reactExports.useRef(!0),_=reactExports.useRef(null),T=reactExports.useRef(null),w=reactExports.useRef(null),R=useAppSelector(A=>A.settings.enableGeneralConditions);reactExports.useLayoutEffect(()=>{if(t.length&&_.current&&(x.current<t.length||i)){if(T.current){const A=T.current.offsetTop;_.current.scrollTop=A}else if(w.current){const A=w.current.offsetTop;_.current.scrollTop=A}E.current&&(E.current=!1),x.current=t.length}},[t,E,i]);let M;const k=t.length;return jsxRuntimeExports.jsxs("div",{ref:_,className:clsx(styles$m.messageContainer,"chat__messageContainer"),style:{scrollBehavior:t.length&&E.current?"auto":"smooth"},id:"MessageContainer","aria-label":v("conversation.label"),children:[R&&jsxRuntimeExports.jsx(GeneralConditions,{}),jsxRuntimeExports.jsxs("ul",{className:styles$m.messages,role:"list",children:[t.map((A,D)=>{const z=getIsFirstMessageBySender(A,M),L=getIsLastMessageBySender(A,D,t,i);M=A.sender.type;const U=D+1===k,V=A._id||`added-${D}`;return jsxRuntimeExports.jsx(Message$1,{ref:U?w:null,message:A,commands:u,isLastMessage:U,isFirstMessageBySender:z,isLastMessageBySender:L,onButtonClick:p,onLinkClick:g,onReaction:c},V)}),i&&jsxRuntimeExports.jsx(BotMessage,{ref:T,message:BotTypingMessage,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:M!==UserType$1.BOT,isLastMessageBySender:!0,children:jsxRuntimeExports.jsx(TypingIndicator,{isTyping:!0})},"last")]})]})},getIsFirstMessageBySender=(t,i)=>!i||i!==t.sender.type,getIsLastMessageBySender=(t,i,u,c)=>{const p=t.sender.type,g=u.length;return i+1===g?!(p===UserType$1.BOT&&c):p!==u.at(i+1)?.sender.type},bottomSheet="_bottomSheet_jp8dl_1",bottomSheetOpen="_bottomSheetOpen_jp8dl_15",bottomSheetClose="_bottomSheetClose_jp8dl_20",bottomSheetStyles={bottomSheet,bottomSheetOpen,bottomSheetClose},container$4="_container_xc2nx_1",styles$c={container:container$4},Drawer=({contentUrl:t})=>{const i=useAppSelector(g=>g.connection.sessionId),[u,c]=reactExports.useState(!1);reactExports.useEffect(()=>{c(g=>g||!!t)},[t]);const p=reactExports.useMemo(()=>{if(t&&i){const g=new URL(t,document.baseURI);return g.searchParams.set("sessionId",i),g.toString()}else return},[t,i]);return jsxRuntimeExports.jsx("div",{className:clsx(styles$c.container,bottomSheetStyles.bottomSheet,{[bottomSheetStyles.bottomSheetOpen]:!!t,[bottomSheetStyles.bottomSheetClose]:u&&!t}),children:p&&jsxRuntimeExports.jsx("iframe",{title:"Drawer",id:"form-drawer",src:p,className:styles$c.iframe})})},container$3="_container_vvbth_1",styles$b={container:container$3},Link$1=({title:t,href:i,children:u})=>jsxRuntimeExports.jsx("a",{href:i,title:t,target:"_blank",rel:"noopener noreferrer",children:u}),PoweredBy=()=>{const i=useTranslation()("powered-by");return i&&i.length?jsxRuntimeExports.jsx("div",{className:clsx(styles$b.container,"chat__poweredBy"),children:jsxRuntimeExports.jsx(X5,{options:{overrides:{a:Link$1}},children:i})}):null},markdownToPlainText=(t,i)=>{const u=new Map;let c=0;return t.replace(/^#{1,6}\s+/gm,"").replace(/(\*\*|__)(.*?)\1/g,"$2").replace(/(\*|_)(.*?)\1/g,"$2").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\[\^([^\]]+)\]/g,(p,g)=>(u.has(g)||u.set(g,++c),`(${i} ${u.get(g)})`)).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,`
119
119
 
120
- `).trim(),ScreenReaderAnnouncer=({messages:t,isBotTyping:i})=>{const u=reactExports.useRef(""),c=useTranslation(),p=x=>{switch(x.type){case"TEXT":return x.text||"";case"MARKDOWN":{const E=x.markdown||"";return markdownToPlainText(E)}case"DETAIL":return x.text||x.title||"";default:return""}},v=(()=>{if(i)return c("chatbot.typing")??"Chatbot is typing";const x=[...t].reverse().find(E=>E.sender.type===UserType.BOT);return x?p(x):""})();return reactExports.useEffect(()=>{v!==u.current&&(u.current=v)},[v]),jsxRuntimeExports.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:v})},DefaultButton=({className:t,children:i,...u})=>jsxRuntimeExports.jsx(Button,{className:clsx(styles$g.buttonDefault,t),type:"button",...u,children:i}),PrimaryButton=({className:t,children:i,...u})=>jsxRuntimeExports.jsx(Button,{className:clsx(styles$g.buttonPrimary,t),...u,children:i}),container$2="_container_h23mk_1",formContainer="_formContainer_h23mk_17",emailInput="_emailInput_h23mk_22",description="_description_h23mk_52",actions$3="_actions_h23mk_57",validationError="_validationError_h23mk_67",submitted="_submitted_h23mk_74",styles$a={container:container$2,formContainer,emailInput,description,actions:actions$3,validationError,submitted},TranscriptExport=({visible:t,onEmailExport:i,onClose:u})=>{const c=useTranslation(),[p,g]=reactExports.useState(void 0),[v,x]=reactExports.useState(!1),[E,_]=reactExports.useState(void 0),T=reactExports.useRef(null);reactExports.useEffect(()=>{t?(T.current?.focus(),x(!1),g(t)):p===!0&&g(!1)},[t,p]);const w=M=>{M.preventDefault(),E&&E.length>0&&(i(E),x(!0),setTimeout(u,3*1e3))},R=M=>{const k=M.target.value.trim(),A=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(k);_(A?k:"")};return jsxRuntimeExports.jsxs("div",{className:clsx(styles$a.container,bottomSheetStyles.bottomSheet,{[bottomSheetStyles.bottomSheetOpen]:p===!0,[bottomSheetStyles.bottomSheetClose]:p===!1}),children:[jsxRuntimeExports.jsx("h2",{children:c("export-transcript.email.title")}),jsxRuntimeExports.jsx(X5,{className:styles$a.description,children:c("export-transcript.email.description")||""}),jsxRuntimeExports.jsxs("form",{onSubmit:w,className:styles$a.formContainer,children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("input",{disabled:v,ref:T,type:"email",placeholder:c("export-transcript.email.placeholder"),className:styles$a.emailInput,onChange:R}),E?.length===0?jsxRuntimeExports.jsx("div",{className:styles$a.validationError,children:c("export-transcript.email.invalid")}):null]}),jsxRuntimeExports.jsxs("div",{className:styles$a.actions,children:[jsxRuntimeExports.jsx(DefaultButton,{onClick:u,children:c("export-transcript.email.cancel")}),jsxRuntimeExports.jsx(PrimaryButton,{type:"submit",disabled:v||E===void 0||E.length===0,children:c("export-transcript.email.send")})]})]}),v&&jsxRuntimeExports.jsx("div",{className:styles$a.submitted,children:c("export-transcript.email.success")})]})},inputContainer="_inputContainer_fi5ao_1",styles$9={inputContainer},blockUserInput="_blockUserInput_pot9c_1",styles$8={blockUserInput},BlockUserInput=({visible:t})=>{const i=useTranslation();return t?jsxRuntimeExports.jsx("div",{className:clsx(styles$8.blockUserInput,"chat__blockUserInput"),children:i("block-user-input.title")}):null},commandsDropdown="_commandsDropdown_fmklx_1",commands="_commands_fmklx_1",command="_command_fmklx_1",commandActive="_commandActive_fmklx_49",style={commandsDropdown,commands,command,commandActive},useKeyboardEffect=(t,i,u,c,p)=>{reactExports.useEffect(()=>{const g=v=>{if(t.length)switch(v.key){case"Enter":u(t[i]);break;case"ArrowUp":c(x=>x>0?x-1:t.length-1);break;case"ArrowDown":c(x=>x<t.length-1?x+1:0);break;case"Escape":p([]);break}};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[t,i,u,c,p])},CommandsDropdown=({text:t,commands:i,onSelectCommand:u,onVisibilityChange:c})=>{const p=reactExports.useRef(null),g=useTranslation(),[v,x]=reactExports.useState([]),[E,_]=reactExports.useState(calcMaxCommandLength(i)),[T,w]=reactExports.useState(0),R=M=>u(`/${M}`);return useClickOutsideEventListener(p,()=>x([])),useKeyboardEffect(v,T,R,w,x),reactExports.useEffect(()=>{_(calcMaxCommandLength(i))},[i]),reactExports.useEffect(()=>{const M=t.length||0;M===0||M>E||!t.startsWith("/")?x([]):x(i.filter(byText(t))),w(0)},[i,t,E]),reactExports.useEffect(()=>{c(!!v.length)},[v,c]),v.length?jsxRuntimeExports.jsx("div",{ref:p,className:style.commandsDropdown,children:jsxRuntimeExports.jsx("ul",{id:"command-list",className:style.commands,role:"listbox",children:v.map((M,k)=>jsxRuntimeExports.jsxs("li",{className:clsx([style.command,T===k&&style.commandActive]),role:"option",onClick:()=>R(M),onMouseOver:()=>w(k),children:[jsxRuntimeExports.jsxs("h1",{children:["/",M]}),jsxRuntimeExports.jsx("p",{children:g(`commands.${M}`)})]},M))})}):null},calcMaxCommandLength=t=>Math.max(...t.map(i=>i.length+1)),byText=t=>i=>{const u=`/${i}`;return u.startsWith(t)&&u.length>=t.length},callToActionContainer="_callToActionContainer_d8izj_1",callToActionTitle="_callToActionTitle_d8izj_23",rateOverlay="_rateOverlay_d8izj_30",body$1="_body_d8izj_52",footer$1="_footer_d8izj_60",actions$2="_actions_d8izj_75",bubbles="_bubbles_d8izj_89",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",styles$7={callToActionContainer,callToActionTitle,rateOverlay,body:body$1,footer:footer$1,actions:actions$2,bubbles,stars,starsSmall,starsLarge,star,starReadonly,starIcon,starsDescriptionContainer,starsDescription},Star=({value:t,index:i,count:u,readonly:c,onHover:p,onClick:g})=>{const v=x=>{g&&x.key==="Enter"&&g()};return jsxRuntimeExports.jsx("li",{className:clsx(styles$7.star,{[styles$7.starReadonly]:c},"chat__conversationRating__star"),children:jsxRuntimeExports.jsx("div",{role:"radio","aria-checked":t>i?"true":"false","aria-posinset":i+1,"aria-setsize":u,tabIndex:0,onMouseOver:p,onKeyDown:v,onClick:g,children:jsxRuntimeExports.jsx("span",{role:"img","aria-label":"Star",className:clsx(styles$7.starIcon),children:jsxRuntimeExports.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:jsxRuntimeExports.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"})})})})})},STAR_COUNT=5,Stars=({value:t,size:i,readonly:u=!1,onChange:c})=>{const[p,g]=reactExports.useState(void 0),v=()=>{g(void 0)},x=_=>()=>{if(!u){const T=_+1;g(T)}},E=_=>()=>{c&&!u&&(c(_===0&&t===1?0:_+1),g(void 0))};return jsxRuntimeExports.jsx("ul",{tabIndex:0,role:"radiogroup",className:clsx(styles$7.stars,{[styles$7.starsSmall]:i==="small",[styles$7.starsLarge]:i==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:i==="small",chat__conversationRating__stars__large:i==="large"}),onMouseOut:v,children:Array(STAR_COUNT).fill(0).map((_,T)=>jsxRuntimeExports.jsx(Star,{value:p===void 0?t:p,index:T,count:STAR_COUNT,readonly:u,onHover:x(T),onClick:E(T)},T))})},CallToAction=({visible:t,onRate:i})=>{const u=useTranslation();return t?jsxRuntimeExports.jsxs("div",{className:clsx(styles$7.callToActionContainer,"chat__conversationRating__callToAction"),children:[jsxRuntimeExports.jsx("div",{className:clsx(styles$7.callToActionTitle,"chat__conversationRating__callToAction__title"),children:u("conversation-rating.call-to-action.title")}),jsxRuntimeExports.jsx(Stars,{value:0,size:"small",onChange:i})]}):null},BotBubble=({isFirstMessageBySender:t,isLastMessageBySender:i,children:u})=>jsxRuntimeExports.jsxs("div",{className:clsx(styles$k.message,styles$k.messageBot,t&&styles$k.messageBotFirst,i&&styles$k.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",t&&"chat__bubbleContainer--first",i&&"chat__bubbleContainer--last"),children:[jsxRuntimeExports.jsx("img",{className:clsx(styles$k.avatar,styles$k.botAvatar),src:"bot.svg",alt:"Bot"}),jsxRuntimeExports.jsx("div",{className:clsx(styles$k.bubble,styles$k.bubbleLeft,"chat__bubble","chat__botBubble"),children:jsxRuntimeExports.jsx("div",{className:clsx(styles$k.leftText,styles$k.bubbleContent),children:u})})]}),GuestBubble=({children:t})=>jsxRuntimeExports.jsx("div",{className:clsx(styles$k.message,styles$k.messageGuest,styles$k.messageGuestFirst,styles$k.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:jsxRuntimeExports.jsx("div",{className:clsx(styles$k.bubble,styles$k.bubbleRight,"chat__bubble","chat__guestBubble"),children:jsxRuntimeExports.jsx("div",{className:clsx(styles$k.rightText,styles$k.bubbleContent),children:t})})}),RateOverlay=()=>{const t=useTranslation(),i=useAppDispatch(),u=useAppSelector(D=>D.chat.conversationRating),[c,p]=reactExports.useState(u.rating?.value||0),[g,v]=reactExports.useState(void 0),[x,E]=reactExports.useState(void 0),[_,T]=reactExports.useState({submitted:!1,feedback:""}),w=reactExports.useRef(null),[R,M]=reactExports.useState(!1);reactExports.useEffect(()=>{u.opener?(T({submitted:!1,feedback:""}),E(!0)):x===!0&&E(!1)},[u.opener,x]),reactExports.useEffect(()=>{p(u.rating?.value||0)},[u.rating?.value,u.opener]),reactExports.useEffect(()=>{w.current&&(w.current.value=u.rating?.feedback||"")},[u.rating?.feedback]),reactExports.useEffect(()=>{const D=c>0?t(`conversation-rating.overlay.bot-message.rate-feedback.value-${c}`):void 0;v(D?.length?D:void 0)},[c,t]),reactExports.useEffect(()=>{_.submitted?setTimeout(()=>M(!0),_.feedback.length?500:0):M(!1)},[_]);const k=D=>{D.preventDefault();const z=w.current?.value?.trim()||"";i(handleRatingFromUser(c,z)),T({submitted:!0,feedback:z})},A=()=>{u.opener==="CLOSE_CHAT"?i(closeChatWindow()):u.opener==="RESTART_CHAT"?i(restartChat()):i(hideConversationRatingOverlay())};return jsxRuntimeExports.jsx("div",{className:clsx(styles$7.rateOverlay,bottomSheetStyles.bottomSheet,"chat__conversationRating__overlay",{[bottomSheetStyles.bottomSheetOpen]:x===!0,[bottomSheetStyles.bottomSheetClose]:x===!1}),children:jsxRuntimeExports.jsxs("form",{onSubmit:k,children:[jsxRuntimeExports.jsxs("div",{className:clsx(styles$7.body,"chat__conversationRating__overlay__body"),children:[jsxRuntimeExports.jsx("div",{}),jsxRuntimeExports.jsx("div",{className:clsx(styles$7.bubbles),children:u.opener&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(BotBubble,{isFirstMessageBySender:!0,isLastMessageBySender:!g,children:[jsxRuntimeExports.jsx("h2",{children:t("conversation-rating.overlay.title")}),jsxRuntimeExports.jsxs("div",{className:clsx(styles$7.starsDescriptionContainer),children:[jsxRuntimeExports.jsx(Stars,{value:c,size:"large",readonly:_.submitted,onChange:p}),jsxRuntimeExports.jsxs("div",{className:clsx(styles$7.starsDescription),children:[jsxRuntimeExports.jsx("div",{children:t("conversation-rating.overlay.star.very-bad")}),jsxRuntimeExports.jsx("div",{children:t("conversation-rating.overlay.star.very-good")})]})]})]}),g&&jsxRuntimeExports.jsx(BotBubble,{isFirstMessageBySender:!1,isLastMessageBySender:!R||!!_.feedback.length,children:jsxRuntimeExports.jsx("div",{children:g})}),!!_.feedback.length&&jsxRuntimeExports.jsx(GuestBubble,{children:_.feedback}),R&&jsxRuntimeExports.jsx(BotBubble,{isFirstMessageBySender:!!_.feedback.length,isLastMessageBySender:!0,children:jsxRuntimeExports.jsx("div",{children:t("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),jsxRuntimeExports.jsxs("div",{className:clsx(styles$7.footer,"chat__conversationRating__overlay__footer"),children:[!_.submitted&&jsxRuntimeExports.jsx("input",{ref:w,defaultValue:u.rating?.feedback||"",placeholder:t("conversation-rating.overlay.guest-feedback.input-placeholder")}),jsxRuntimeExports.jsxs("div",{className:clsx(styles$7.actions,"chat__conversationRating__overlay__footer__actions"),children:[_.submitted?jsxRuntimeExports.jsx(PrimaryButton,{type:"button",disabled:!c,onClick:A,children:u.opener==="CLOSE_CHAT"?t("conversation-rating.overlay.action.close-chat"):u.opener==="RESTART_CHAT"?t("conversation-rating.overlay.action.restart-chat"):t("conversation-rating.overlay.action.back-to-chat")},"close-button"):jsxRuntimeExports.jsx(PrimaryButton,{type:"submit",disabled:!c,children:t("conversation-rating.overlay.action.submit")},"submit-button"),u.opener!=="CHAT"&&!_.submitted&&jsxRuntimeExports.jsx(DefaultButton,{onClick:A,children:u.opener==="CLOSE_CHAT"?t("conversation-rating.overlay.action.close-chat"):u.opener==="RESTART_CHAT"?t("conversation-rating.overlay.action.restart-chat"):t("conversation-rating.overlay.action.cancel")})]})]})]})})},ConversationRating=({numberOfMessagesFromGuest:t})=>{const i=useAppDispatch(),u=useAppSelector(g=>g.chat.conversationRating),c=g=>{i(showConversationRatingOverlay("CHAT",g))},p=!u.rating?.value&&t>=1;return u.enabled?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(CallToAction,{visible:p,onRate:c}),jsxRuntimeExports.jsx(RateOverlay,{})]}):null},ConversationRating$1=reactExports.memo(ConversationRating),inputWrapper="_inputWrapper_m3q4d_1",withOpenCommands="_withOpenCommands_m3q4d_13",actions$1="_actions_m3q4d_18",messageInputWrapper="_messageInputWrapper_m3q4d_53",messageInput="_messageInput_m3q4d_53",buttons="_buttons_m3q4d_78",button="_button_m3q4d_78",styles$6={inputWrapper,withOpenCommands,actions:actions$1,messageInputWrapper,messageInput,buttons,button},audioRecorder="_audioRecorder_g845f_1",audioButton="_audioButton_g845f_6",recorderIcon="_recorderIcon_g845f_37",spinning="_spinning_g845f_60",styles$5={audioRecorder,audioButton,recorderIcon,spinning},BUFFER_SIZE=2048,OUTPUT_SAMPLE_RATE=16e3;class AudioRecorder extends React.Component{audioInput=null;volume=null;leftchannel=[];recorder=null;recordingLength=0;sampleRate=null;mediaStream=null;constructor(i){super(i),this.state={recordingState:"none"},this.triggerAudioRecording=this.triggerAudioRecording.bind(this),this.triggerAudioRecordingSuccess=this.triggerAudioRecordingSuccess.bind(this),this.initRecording=this.initRecording.bind(this),this.processRecordingInput=this.processRecordingInput.bind(this),this.handleClickSubmitAudio=this.handleClickSubmitAudio.bind(this),this.handleClickStopAudio=this.handleClickStopAudio.bind(this)}triggerAudioRecording(){this.setState({recordingState:"connecting"}),navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(this.triggerAudioRecordingSuccess)}triggerAudioRecordingSuccess(i){this.mediaStream=i,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(i)}initRecording(i){const u=window.AudioContext||window.webkitAudioContext,c=new u;this.sampleRate=c.sampleRate,this.volume=c.createGain(),this.audioInput=c.createMediaStreamSource(i),this.audioInput.connect(this.volume),this.recorder=c.createScriptProcessor(BUFFER_SIZE,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(c.destination)}processRecordingInput(i){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const u=i.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(u)),this.recordingLength+=BUFFER_SIZE}}handleClickSubmitAudio(){const i=mergeBuffers(this.leftchannel,this.recordingLength),u=downsampleBuffer(i,this.sampleRate||0),c=createWav(u);this.props.onAudioRecorded(c),this.handleClickStopAudio()}handleClickStopAudio(){this.setState({recordingState:"none"}),this.audioInput?.disconnect(),this.volume?.disconnect(),this.recorder?.disconnect(),this.mediaStream&&this.mediaStream?.getAudioTracks().forEach(i=>{i.stop()})}render(){return jsxRuntimeExports.jsxs("div",{className:styles$5.audioRecorder,children:[this.state.recordingState==="none"&&jsxRuntimeExports.jsx("button",{className:clsx(styles$5.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:jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsxRuntimeExports.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"}),jsxRuntimeExports.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&jsxRuntimeExports.jsxs("svg",{className:styles$5.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsxRuntimeExports.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"}),jsxRuntimeExports.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&jsxRuntimeExports.jsxs("div",{className:styles$5.audioRecorder,children:[jsxRuntimeExports.jsx("button",{className:clsx(styles$5.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsxRuntimeExports.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"}),jsxRuntimeExports.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),jsxRuntimeExports.jsx("div",{className:styles$5.recorderIcon}),jsxRuntimeExports.jsx("button",{className:clsx(styles$5.audioButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsxRuntimeExports.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),jsxRuntimeExports.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const createWav=t=>{const i=new ArrayBuffer(44+t.length*2),u=new DataView(i);writeUTFBytes(u,0,"RIFF"),u.setUint32(4,44+t.length*2,!0),writeUTFBytes(u,8,"WAVE"),writeUTFBytes(u,12,"fmt "),u.setUint32(16,16,!0),u.setUint16(20,1,!0),u.setUint16(22,1,!0),u.setUint32(24,OUTPUT_SAMPLE_RATE,!0),u.setUint32(28,OUTPUT_SAMPLE_RATE*4,!0),u.setUint16(32,4,!0),u.setUint16(34,16,!0),writeUTFBytes(u,36,"data"),u.setUint32(40,t.length*2,!0);const c=t.length;let p=44;const g=1;for(let v=0;v<c;v++)u.setInt16(p,t[v]*(32767*g),!0),p+=2;return new Blob([u],{type:"audio/wav"})},writeUTFBytes=(t,i,u)=>{for(let c=0;c<u.length;c++)t.setUint8(i+c,u.charCodeAt(c))},mergeBuffers=(t,i)=>{const u=new Float32Array(i);let c=0;const p=t.length;for(let g=0;g<p;g++){const v=t[g];u.set(v,c),c+=v.length}return u},downsampleBuffer=(t,i)=>{if(OUTPUT_SAMPLE_RATE===i)return t;const u=i/OUTPUT_SAMPLE_RATE,c=Math.round(t.length/u),p=new Float32Array(c);let g=0,v=0;for(;g<p.length;){const x=Math.round((g+1)*u);let E=0,_=0;for(let T=v;T<x&&T<t.length;T++)E+=t[T],_++;p[g]=E/_,g++,v=x}return p},CommandButton=({onClick:t})=>{const i=useTranslation();return jsxRuntimeExports.jsxs("button",{onClick:t,type:"button","aria-label":i("message-input.actions.command.label"),children:[jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"#000000",viewBox:"0 0 256 256",children:[jsxRuntimeExports.jsx("rect",{x:"32",y:"32",width:"192",height:"192",rx:"16",ry:"16",fill:"none",stroke:"currentColor","stroke-width":"16"}),jsxRuntimeExports.jsx("line",{x1:"80",y1:"176",x2:"176",y2:"80",stroke:"currentColor","stroke-width":"16","stroke-linecap":"round"})]}),jsxRuntimeExports.jsx("span",{children:i("message-input.actions.command.label")})]})},TextInput=({disabled:t,textInput:i,commandsVisible:u,hasCommands:c,onTextInput:p,onTextInputSubmit:g,onAudioRecorded:v})=>{const x=useTranslation(),E=reactExports.useRef(null),{enableSpeechSupport:_}=useAppSelector(A=>A.settings);reactExports.useEffect(()=>{E.current?.focus()},[i]);const T=()=>{const A=E.current;A&&i.trim().length>=1&&g(i.trim())&&(A.value="",A.style.height="",A.focus())},w=A=>{A.preventDefault(),T()},R=A=>{const D=A.target.value;p(D),A.target.style.height="";const{scrollHeight:z}=A.target;A.target.style.height=`${z>150?150:z}px`},M=A=>{A.code==="Enter"&&!A.shiftKey?(A.repeat||T(),A.preventDefault()):u&&(A.code==="ArrowUp"||A.code==="ArrowDown")&&A.preventDefault()},k=()=>{i.startsWith("/")?p(""):p("/")};return jsxRuntimeExports.jsxs("form",{className:clsx(styles$6.inputWrapper,u&&styles$6.withOpenCommands,"chat__textInput"),onSubmit:w,children:[jsxRuntimeExports.jsxs("div",{className:styles$6.messageInputWrapper,children:[jsxRuntimeExports.jsx("textarea",{id:"user_input",ref:E,className:styles$6.messageInput,tabIndex:0,placeholder:x("message-input-placeholder"),value:i,onChange:R,onKeyDown:M,"aria-label":x("message-input-label"),"aria-controls":c?"command-list":void 0,"aria-haspopup":c?"listbox":void 0}),c&&jsxRuntimeExports.jsx("div",{className:styles$6.actions,children:jsxRuntimeExports.jsx(CommandButton,{onClick:k})})]}),jsxRuntimeExports.jsx("div",{className:clsx(styles$6.buttons,"chat__buttons"),children:i.length||!_||navigator.mediaDevices===void 0?jsxRuntimeExports.jsx("button",{className:clsx(styles$6.button,"chat__button"),type:"submit","aria-label":x("message-input.actions.submit.label"),"data-title":x("message-input.actions.submit.label"),tabIndex:0,disabled:t,children:jsxRuntimeExports.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:jsxRuntimeExports.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"})})}):_&&navigator.mediaDevices!==void 0&&jsxRuntimeExports.jsx(AudioRecorder,{translate:x,onAudioRecorded:v})})]})},quickReplies="_quickReplies_83npe_1",quickReply="_quickReply_83npe_9",styles$4={quickReplies,quickReply},QuickReplies=({quickReplies:t,onQuickReplyClick:i})=>t.length?jsxRuntimeExports.jsx("div",{className:clsx(styles$4.quickReplies,"chat__quickReplies"),children:t.map(u=>jsxRuntimeExports.jsx(Button,{tabIndex:0,className:clsx(styles$4.quickReply,"chat__button","chat__quickReply"),onClick:()=>i(u),children:u.label},u.label))}):null,MIN_USER_BLOCKED_TIME=5e3,MIN_TIME_BETWEEN_USER_REQUESTS=1e3,UserInput=({isBotTyping:t,quickReplies:i,numberOfMessagesFromGuest:u,commands:c,onTextInput:p,onQuickReplyClick:g,onAudioRecorded:v})=>{const[x,E]=reactExports.useState(""),[_,T]=reactExports.useState(!1),[w,R]=reactExports.useState(!1),M=reactExports.useRef(0),k=reactExports.useRef(0);reactExports.useEffect(()=>{if(_&&!t){const z=M.current?Date.now()-M.current:0;z>MIN_USER_BLOCKED_TIME?T(!1):setTimeout(()=>{T(!1)},MIN_USER_BLOCKED_TIME-z)}},[_,t]),reactExports.useEffect(()=>{_&&(M.current=Date.now())},[_]);const A=z=>{const L=Date.now()-k.current<MIN_TIME_BETWEEN_USER_REQUESTS;return w?!1:t||L?(T(!0),!1):(p(z),E(""),k.current=Date.now(),!0)},D=z=>{E(z+" ")};return jsxRuntimeExports.jsxs("div",{className:clsx(styles$9.inputContainer),children:[jsxRuntimeExports.jsx(QuickReplies,{quickReplies:i,onQuickReplyClick:g}),jsxRuntimeExports.jsx(BlockUserInput,{visible:_}),!_&&jsxRuntimeExports.jsx(ConversationRating$1,{numberOfMessagesFromGuest:u}),!!c?.length&&jsxRuntimeExports.jsx(CommandsDropdown,{text:x,commands:c,onSelectCommand:D,onVisibilityChange:R}),jsxRuntimeExports.jsx(TextInput,{textInput:x,disabled:_,commandsVisible:w,hasCommands:!!c?.length,onTextInput:E,onTextInputSubmit:A,onAudioRecorded:v})]})},ChatComponent=({clientName:t,messages:i,quickReplies:u,isBotTyping:c,drawerContentUrl:p,onMessageFromUser:g,onQuickReplyClick:v,onButtonClick:x,onLinkClick:E,onAudioRecorded:_,onTranscriptExport:T,onTranscriptItemReaction:w})=>{const R=useAppDispatch(),M=useAppSelector(V=>V.connection.connectionState),{enableTranscriptExportEmail:k,commands:A}=useAppSelector(V=>V.settings),{showTranscriptMailOverlay:D,conversationRating:z}=useAppSelector(V=>V.chat),L=i.filter(V=>V.sender.type===UserType.GUEST).length;reactExports.useEffect(()=>{M===ConnectionStateEnum.CONNECTED&&R(startChat(t))},[t,M,R]);const U=()=>{R(toggleTranscriptMailOverlay())};return jsxRuntimeExports.jsxs("div",{className:styles$n.container,children:[jsxRuntimeExports.jsx(ScreenReaderAnnouncer,{messages:i,isBotTyping:c}),jsxRuntimeExports.jsxs("div",{className:clsx([styles$n.chatcontent,(D||z?.opener)&&styles$n.accessabilityHidden]),children:[jsxRuntimeExports.jsx(Conversation,{messages:i,isBotTyping:c,commands:A,onButtonClick:x,onLinkClick:E,onTranscriptItemReaction:w}),jsxRuntimeExports.jsx(UserInput,{isBotTyping:c,quickReplies:c?[]:u,numberOfMessagesFromGuest:L,commands:A,onQuickReplyClick:v,onTextInput:g,onAudioRecorded:_}),jsxRuntimeExports.jsx(PoweredBy,{})]}),k&&jsxRuntimeExports.jsx(TranscriptExport,{visible:!!D,onEmailExport:T,onClose:U}),jsxRuntimeExports.jsx(Drawer,{contentUrl:p})]})},mapStateToProps=t=>{const{messages:i,quickReplies:u,isBotTyping:c,drawerContentUrl:p}=t.chat;return{messages:i,quickReplies:u,isBotTyping:c,drawerContentUrl:p}},bindAction=t=>({onRestartChat:()=>t(restartChat()),onMessageFromUser:i=>t(sendMessageFromUser(i)),onAudioRecorded:i=>t(sendAudioMessageFromUser(i)),onActionFromUser:i=>t(i),onQuickReplyClick:i=>t(handleQuickReplyClick(i)),onNluEvent:i=>t(requestNLUEvent(i)),onButtonClick:i=>t(handleButtonClick(i)),onLinkClick:i=>t(handleLinkClick(i)),onTranscriptExport:i=>t(exportTranscript(i)),onTranscriptItemReaction:(i,u)=>{t(transcriptItemGuestReaction(i,u?.type||null,u?.category,u?.comment))}}),Chat=connect_default(mapStateToProps,bindAction)(ChatComponent),useIsInIframe=()=>reactExports.useMemo(()=>{try{return window.self!==window.top}catch{return!0}},[]),onButtonKeyDownHandler=t=>i=>{const u=i.key;(u==="ArrowDown"||u==="ArrowRight"||u==="Enter"||u===" "||u==="Space")&&(i.stopPropagation(),t())},CloseChatWindowButton=({onClick:t})=>{const i=useTranslation();return useIsInIframe()?jsxRuntimeExports.jsx("button",{className:"tooltip--bottom-left","aria-label":i("header.close-chat"),"data-title":i("header.close-chat"),tabIndex:0,onClick:t,onKeyDown:onButtonKeyDownHandler(t),children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:jsxRuntimeExports.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},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",styles$3={header,logoContainer,logo,actions,active,menuContainer,menu,divider},MenuItemIcon=({icon:t})=>{switch(t){case"arrow-counter-clockwise":return jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("div",{})}},MenuItem=reactExports.forwardRef(({selected:t,item:i,onClick:u},c)=>{const p=useTranslation(),g=v=>{v.preventDefault(),u()};return jsxRuntimeExports.jsx("li",{"aria-selected":t,role:"option",className:i.withDivider?styles$3.divider:void 0,children:jsxRuntimeExports.jsxs("a",{ref:c,type:"button",role:"button",tabIndex:-1,onClick:g,children:[jsxRuntimeExports.jsx(MenuItemIcon,{icon:i.icon}),jsxRuntimeExports.jsx("span",{children:p(`header.menu.${i.id}`)})]})})}),useMenuItems=(t,i)=>{const u=useIsInIframe(),{menuItems:c,enableStandaloneView:p,enableTranscriptExportPdf:g,enableTranscriptExportEmail:v}=useAppSelector(_=>_.settings),x=useAppSelector(_=>_.chat.conversationRating.enabled);return reactExports.useMemo(()=>{const _=[],T=c.filter(({visibility:w})=>t?w==="always"||w==="chat-only":w==="always"||w==="start-screen-only");if(t&&(_.push({id:"restart-chat",type:"restart-chat",icon:"arrow-counter-clockwise",visibility:"chat-only"}),u&&p&&_.push({id:"expand-chat-window",type:"expand-chat-window",icon:"expand",visibility:"always"}),i&&g&&_.push({id:"download-transcript",type:"download-transcript",icon:"download",visibility:"chat-only"}),i&&v&&_.push({id:"send-transcript",type:"send-transcript",icon:"mail",visibility:"chat-only"}),i&&x&&_.push({id:"rate-conversation",type:"rate-conversation",icon:"star",visibility:"chat-only"}),_.length>0&&T.length)){const w=_.pop();w&&c.length&&_.push({...w,withDivider:!0})}return _.push(...T),_},[t,i,g,v,p,x,u,c])},Menu=({chatStarted:t,hasGuestMessages:i})=>{const u=useAppDispatch(),c=useTranslation(),{enabled:p,opener:g}=useAppSelector(L=>L.chat.conversationRating),[v,x]=reactExports.useState(!1),[E,_]=reactExports.useState(-1),T=reactExports.useRef(null),w=reactExports.useRef(null),R=reactExports.useRef([]),M=useMenuItems(t,i);reactExports.useEffect(()=>{R.current[E]?.focus()},[E]);const k=reactExports.useCallback(()=>{u(i&&p&&!g?showConversationRatingOverlay("RESTART_CHAT"):restartChat()),x(!1),_(0)},[i,p,g,u]),A=reactExports.useCallback(L=>{switch(L.type){case"restart-chat":{k();break}case"expand-chat-window":{const U=new URL(window.location.origin);U.pathname=window.location.pathname,U.search=window.location.search,U.hash=window.location.hash,window.open(U.href,"_blank");break}case"download-transcript":{u(downloadTranscriptPdf());break}case"send-transcript":{u(toggleTranscriptMailOverlay());break}case"rate-conversation":{u(showConversationRatingOverlay("MENU"));break}case"link":{u(handleLinkClick(L.url));break}case"action":{u(JSON.parse(JSON.stringify(L.action)));break}}x(!1)},[u,k,x]);reactExports.useEffect(()=>{const L=U=>{if(v)switch(U.key){case"Enter":U.preventDefault(),A(M[E]);break;case"ArrowUp":_(V=>V>0?V-1:M.length-1);break;case"ArrowDown":_(V=>V<M.length-1?V+1:0);break;case"Escape":x(!1);break;case"Tab":E>-1&&x(!1);break}};return document.addEventListener("keydown",L),()=>{document.removeEventListener("keydown",L)}},[v,E,M,_,x,A]),reactExports.useEffect(()=>{v||_(-1)},[v,E]),useClickOutsideEventListener(w,()=>x(!1));const D=()=>{x(L=>!L)},z=()=>{setTimeout(()=>{const L=document.activeElement;w.current&&!w.current.contains(L)&&x(!1)},0)};return M.length?jsxRuntimeExports.jsxs("div",{className:clsx(styles$3.menuContainer),ref:w,children:[jsxRuntimeExports.jsx("button",{ref:T,className:clsx(v&&styles$3.active,v?"tooltip-hidden":"tooltip--bottom-left"),"aria-label":c("header.menu.title"),"data-title":c("header.menu.title"),onClick:D,onBlur:z,children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:jsxRuntimeExports.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"})})}),v&&jsxRuntimeExports.jsx("nav",{className:styles$3.menu,"aria-label":c("header.menu.title"),children:jsxRuntimeExports.jsx("ul",{tabIndex:0,children:M.map((L,U)=>jsxRuntimeExports.jsx(MenuItem,{ref:V=>{R.current[U]=V},selected:E===U,item:L,onClick:()=>A(L)},L.id))})})]}):null},Header$1=({className:t,chatStarted:i,...u})=>{const c=useAppDispatch(),p=useAppSelector(x=>x.chat.conversationRating),g=useAppSelector(x=>x.chat.messages.some(E=>E.sender.type===UserType$1.GUEST)),v=()=>{p.enabled&&!p.opener&&g?c(showConversationRatingOverlay("CLOSE_CHAT")):c(closeChatWindow())};return jsxRuntimeExports.jsxs("div",{className:clsx(styles$3.header,t),...u,children:[jsxRuntimeExports.jsx("div",{className:styles$3.logoContainer,children:jsxRuntimeExports.jsx("div",{className:styles$3.logo})}),jsxRuntimeExports.jsxs("div",{className:styles$3.actions,children:[jsxRuntimeExports.jsx(Menu,{chatStarted:i,hasGuestMessages:g}),jsxRuntimeExports.jsx(CloseChatWindowButton,{onClick:v})]})]})},chatwindow="_chatwindow_rkbir_1",chatwindowWithAside="_chatwindowWithAside_rkbir_21",styles$2={chatwindow,chatwindowWithAside},useIsSmallScreen=()=>{const[t,i]=reactExports.useState(!1);return reactExports.useEffect(()=>{const u=window.matchMedia("(max-width: 1023px)"),c=()=>i(u.matches);return c(),u.addEventListener("change",c),()=>u.removeEventListener("change",c)},[]),t},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",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",styles$1={sourceInfos,waitForLoading,loadingContent,sourceHeader,sourceHeaderIcon,sourceContent,openSourceButton,sourceButtonLabel,closeSourceInfosButton,loadingSourceInfos,loading,loadingError,highlightLoadingInfo,highlightLoadingInfoInnerContainer,highlightLoadingInfoContent,highlightLoadingInfoCloseIcon,highlightLoader,highlightLoaderLoading},CloseSourceInfosButton=({onClick:t})=>{const i=useTranslation();return jsxRuntimeExports.jsx("button",{className:clsx(styles$1.closeSourceInfosButton,"tooltip--bottom-left"),"aria-label":i("source-infos.close"),"data-title":i("source-infos.close"),tabIndex:0,onClick:t,children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:jsxRuntimeExports.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"})})})},Header=reactExports.forwardRef(({sourceInfos:t,onClose:i,...u},c)=>jsxRuntimeExports.jsxs("div",{className:styles$1.sourceHeader,...u,ref:c,children:[jsxRuntimeExports.jsx("div",{children:t?jsxRuntimeExports.jsx("p",{id:"source-info-title",children:t.title}):jsxRuntimeExports.jsx("p",{children:" "})}),jsxRuntimeExports.jsx(CloseSourceInfosButton,{onClick:i})]})),HighlightLoader=({loading:t})=>jsxRuntimeExports.jsx("div",{className:styles$1.highlightLoader,children:t&&jsxRuntimeExports.jsx("div",{className:styles$1.highlightLoaderLoading})});const{entries,setPrototypeOf,isFrozen,getPrototypeOf,getOwnPropertyDescriptor}=Object;let{freeze,seal,create}=Object,{apply,construct}=typeof Reflect<"u"&&Reflect;freeze||(freeze=function(i){return i});seal||(seal=function(i){return i});apply||(apply=function(i,u){for(var c=arguments.length,p=new Array(c>2?c-2:0),g=2;g<c;g++)p[g-2]=arguments[g];return i.apply(u,p)});construct||(construct=function(i){for(var u=arguments.length,c=new Array(u>1?u-1:0),p=1;p<u;p++)c[p-1]=arguments[p];return new i(...c)});const arrayForEach=unapply(Array.prototype.forEach),arrayLastIndexOf=unapply(Array.prototype.lastIndexOf),arrayPop=unapply(Array.prototype.pop),arrayPush=unapply(Array.prototype.push),arraySplice=unapply(Array.prototype.splice),stringToLowerCase=unapply(String.prototype.toLowerCase),stringToString=unapply(String.prototype.toString),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf=unapply(String.prototype.indexOf),stringTrim=unapply(String.prototype.trim),objectHasOwnProperty=unapply(Object.prototype.hasOwnProperty),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=unconstruct(TypeError);function unapply(t){return function(i){i instanceof RegExp&&(i.lastIndex=0);for(var u=arguments.length,c=new Array(u>1?u-1:0),p=1;p<u;p++)c[p-1]=arguments[p];return apply(t,i,c)}}function unconstruct(t){return function(){for(var i=arguments.length,u=new Array(i),c=0;c<i;c++)u[c]=arguments[c];return construct(t,u)}}function addToSet(t,i){let u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:stringToLowerCase;setPrototypeOf&&setPrototypeOf(t,null);let c=i.length;for(;c--;){let p=i[c];if(typeof p=="string"){const g=u(p);g!==p&&(isFrozen(i)||(i[c]=g),p=g)}t[p]=!0}return t}function cleanArray(t){for(let i=0;i<t.length;i++)objectHasOwnProperty(t,i)||(t[i]=null);return t}function clone(t){const i=create(null);for(const[u,c]of entries(t))objectHasOwnProperty(t,u)&&(Array.isArray(c)?i[u]=cleanArray(c):c&&typeof c=="object"&&c.constructor===Object?i[u]=clone(c):i[u]=c);return i}function lookupGetter(t,i){for(;t!==null;){const c=getOwnPropertyDescriptor(t,i);if(c){if(c.get)return unapply(c.get);if(typeof c.value=="function")return unapply(c.value)}t=getPrototypeOf(t)}function u(){return null}return u}const html$1=freeze(["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"]),svg$1=freeze(["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"]),svgFilters=freeze(["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"]),svgDisallowed=freeze(["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"]),mathMl$1=freeze(["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"]),mathMlDisallowed=freeze(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),text=freeze(["#text"]),html=freeze(["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","slot"]),svg=freeze(["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"]),mathMl=freeze(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),xml=freeze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MUSTACHE_EXPR=seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ERB_EXPR=seal(/<%[\w\W]*|[\w\W]*%>/gm),TMPLIT_EXPR=seal(/\$\{[\w\W]*/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]+$/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DOCTYPE_NAME=seal(/^html$/i),CUSTOM_ELEMENT=seal(/^[a-z][.\w]*(-[.\w]+)+$/i);var EXPRESSIONS=Object.freeze({__proto__:null,ARIA_ATTR,ATTR_WHITESPACE,CUSTOM_ELEMENT,DATA_ATTR,DOCTYPE_NAME,ERB_EXPR,IS_ALLOWED_URI,IS_SCRIPT_OR_DATA,MUSTACHE_EXPR,TMPLIT_EXPR});const NODE_TYPE={element:1,text:3,progressingInstruction:7,comment:8,document:9},getGlobal=function t(){return typeof window>"u"?null:window},_createTrustedTypesPolicy=function t(i,u){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let c=null;const p="data-tt-policy-suffix";u&&u.hasAttribute(p)&&(c=u.getAttribute(p));const g="dompurify"+(c?"#"+c:"");try{return i.createPolicy(g,{createHTML(v){return v},createScriptURL(v){return v}})}catch{return console.warn("TrustedTypes policy "+g+" could not be created."),null}},_createHooksMap=function t(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function createDOMPurify(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:getGlobal();const i=xe=>createDOMPurify(xe);if(i.version="3.3.1",i.removed=[],!t||!t.document||t.document.nodeType!==NODE_TYPE.document||!t.Element)return i.isSupported=!1,i;let{document:u}=t;const c=u,p=c.currentScript,{DocumentFragment:g,HTMLTemplateElement:v,Node:x,Element:E,NodeFilter:_,NamedNodeMap:T=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:w,DOMParser:R,trustedTypes:M}=t,k=E.prototype,A=lookupGetter(k,"cloneNode"),D=lookupGetter(k,"remove"),z=lookupGetter(k,"nextSibling"),L=lookupGetter(k,"childNodes"),U=lookupGetter(k,"parentNode");if(typeof v=="function"){const xe=u.createElement("template");xe.content&&xe.content.ownerDocument&&(u=xe.content.ownerDocument)}let V,Q="";const{implementation:Z,createNodeIterator:F,createDocumentFragment:Y,getElementsByTagName:ne}=u,{importNode:fe}=c;let oe=_createHooksMap();i.isSupported=typeof entries=="function"&&typeof U=="function"&&Z&&Z.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:le,ERB_EXPR:Se,TMPLIT_EXPR:ve,DATA_ATTR:_e,ARIA_ATTR:K,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:te,CUSTOM_ELEMENT:Re}=EXPRESSIONS;let{IS_ALLOWED_URI:Ae}=EXPRESSIONS,H=null;const ie=addToSet({},[...html$1,...svg$1,...svgFilters,...mathMl$1,...text]);let ue=null;const be=addToSet({},[...html,...svg,...mathMl,...xml]);let me=Object.seal(create(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}})),Ee=null,Te=null;const ke=Object.seal(create(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Me=!0,Ve=!0,ft=!1,je=!0,vt=!1,At=!0,Ue=!1,dt=!1,un=!1,_n=!1,Ye=!1,Zt=!1,wt=!0,cn=!1;const Tt="user-content-";let ot=!0,An=!1,Xt={},Dt=null;const Pt=addToSet({},["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"]);let pn=null;const mn=addToSet({},["audio","video","img","source","image","track"]);let Yn=null;const at=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),gn="http://www.w3.org/1998/Math/MathML",bt="http://www.w3.org/2000/svg",pt="http://www.w3.org/1999/xhtml";let tt=pt,nt=!1,fn=null;const yn=addToSet({},[gn,bt,pt],stringToString);let qt=addToSet({},["mi","mo","mn","ms","mtext"]),rt=addToSet({},["annotation-xml"]);const Jt=addToSet({},["title","style","font","a","script"]);let Ct=null;const Cn=["application/xhtml+xml","text/html"],On="text/html";let mt=null,dn=null;const Kn=u.createElement("form"),wn=function(q){return q instanceof RegExp||q instanceof Function},Zn=function(){let q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(dn&&dn===q)){if((!q||typeof q!="object")&&(q={}),q=clone(q),Ct=Cn.indexOf(q.PARSER_MEDIA_TYPE)===-1?On:q.PARSER_MEDIA_TYPE,mt=Ct==="application/xhtml+xml"?stringToString:stringToLowerCase,H=objectHasOwnProperty(q,"ALLOWED_TAGS")?addToSet({},q.ALLOWED_TAGS,mt):ie,ue=objectHasOwnProperty(q,"ALLOWED_ATTR")?addToSet({},q.ALLOWED_ATTR,mt):be,fn=objectHasOwnProperty(q,"ALLOWED_NAMESPACES")?addToSet({},q.ALLOWED_NAMESPACES,stringToString):yn,Yn=objectHasOwnProperty(q,"ADD_URI_SAFE_ATTR")?addToSet(clone(at),q.ADD_URI_SAFE_ATTR,mt):at,pn=objectHasOwnProperty(q,"ADD_DATA_URI_TAGS")?addToSet(clone(mn),q.ADD_DATA_URI_TAGS,mt):mn,Dt=objectHasOwnProperty(q,"FORBID_CONTENTS")?addToSet({},q.FORBID_CONTENTS,mt):Pt,Ee=objectHasOwnProperty(q,"FORBID_TAGS")?addToSet({},q.FORBID_TAGS,mt):clone({}),Te=objectHasOwnProperty(q,"FORBID_ATTR")?addToSet({},q.FORBID_ATTR,mt):clone({}),Xt=objectHasOwnProperty(q,"USE_PROFILES")?q.USE_PROFILES:!1,Me=q.ALLOW_ARIA_ATTR!==!1,Ve=q.ALLOW_DATA_ATTR!==!1,ft=q.ALLOW_UNKNOWN_PROTOCOLS||!1,je=q.ALLOW_SELF_CLOSE_IN_ATTR!==!1,vt=q.SAFE_FOR_TEMPLATES||!1,At=q.SAFE_FOR_XML!==!1,Ue=q.WHOLE_DOCUMENT||!1,_n=q.RETURN_DOM||!1,Ye=q.RETURN_DOM_FRAGMENT||!1,Zt=q.RETURN_TRUSTED_TYPE||!1,un=q.FORCE_BODY||!1,wt=q.SANITIZE_DOM!==!1,cn=q.SANITIZE_NAMED_PROPS||!1,ot=q.KEEP_CONTENT!==!1,An=q.IN_PLACE||!1,Ae=q.ALLOWED_URI_REGEXP||IS_ALLOWED_URI,tt=q.NAMESPACE||pt,qt=q.MATHML_TEXT_INTEGRATION_POINTS||qt,rt=q.HTML_INTEGRATION_POINTS||rt,me=q.CUSTOM_ELEMENT_HANDLING||{},q.CUSTOM_ELEMENT_HANDLING&&wn(q.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(me.tagNameCheck=q.CUSTOM_ELEMENT_HANDLING.tagNameCheck),q.CUSTOM_ELEMENT_HANDLING&&wn(q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(me.attributeNameCheck=q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),q.CUSTOM_ELEMENT_HANDLING&&typeof q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(me.allowCustomizedBuiltInElements=q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),vt&&(Ve=!1),Ye&&(_n=!0),Xt&&(H=addToSet({},text),ue=[],Xt.html===!0&&(addToSet(H,html$1),addToSet(ue,html)),Xt.svg===!0&&(addToSet(H,svg$1),addToSet(ue,svg),addToSet(ue,xml)),Xt.svgFilters===!0&&(addToSet(H,svgFilters),addToSet(ue,svg),addToSet(ue,xml)),Xt.mathMl===!0&&(addToSet(H,mathMl$1),addToSet(ue,mathMl),addToSet(ue,xml))),q.ADD_TAGS&&(typeof q.ADD_TAGS=="function"?ke.tagCheck=q.ADD_TAGS:(H===ie&&(H=clone(H)),addToSet(H,q.ADD_TAGS,mt))),q.ADD_ATTR&&(typeof q.ADD_ATTR=="function"?ke.attributeCheck=q.ADD_ATTR:(ue===be&&(ue=clone(ue)),addToSet(ue,q.ADD_ATTR,mt))),q.ADD_URI_SAFE_ATTR&&addToSet(Yn,q.ADD_URI_SAFE_ATTR,mt),q.FORBID_CONTENTS&&(Dt===Pt&&(Dt=clone(Dt)),addToSet(Dt,q.FORBID_CONTENTS,mt)),q.ADD_FORBID_CONTENTS&&(Dt===Pt&&(Dt=clone(Dt)),addToSet(Dt,q.ADD_FORBID_CONTENTS,mt)),ot&&(H["#text"]=!0),Ue&&addToSet(H,["html","head","body"]),H.table&&(addToSet(H,["tbody"]),delete Ee.tbody),q.TRUSTED_TYPES_POLICY){if(typeof q.TRUSTED_TYPES_POLICY.createHTML!="function")throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof q.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');V=q.TRUSTED_TYPES_POLICY,Q=V.createHTML("")}else V===void 0&&(V=_createTrustedTypesPolicy(M,p)),V!==null&&typeof Q=="string"&&(Q=V.createHTML(""));freeze&&freeze(q),dn=q}},Ut=addToSet({},[...svg$1,...svgFilters,...svgDisallowed]),$t=addToSet({},[...mathMl$1,...mathMlDisallowed]),vn=function(q){let ge=U(q);(!ge||!ge.tagName)&&(ge={namespaceURI:tt,tagName:"template"});const ye=stringToLowerCase(q.tagName),De=stringToLowerCase(ge.tagName);return fn[q.namespaceURI]?q.namespaceURI===bt?ge.namespaceURI===pt?ye==="svg":ge.namespaceURI===gn?ye==="svg"&&(De==="annotation-xml"||qt[De]):!!Ut[ye]:q.namespaceURI===gn?ge.namespaceURI===pt?ye==="math":ge.namespaceURI===bt?ye==="math"&&rt[De]:!!$t[ye]:q.namespaceURI===pt?ge.namespaceURI===bt&&!rt[De]||ge.namespaceURI===gn&&!qt[De]?!1:!$t[ye]&&(Jt[ye]||!Ut[ye]):!!(Ct==="application/xhtml+xml"&&fn[q.namespaceURI]):!1},Nt=function(q){arrayPush(i.removed,{element:q});try{U(q).removeChild(q)}catch{D(q)}},Ie=function(q,ge){try{arrayPush(i.removed,{attribute:ge.getAttributeNode(q),from:ge})}catch{arrayPush(i.removed,{attribute:null,from:ge})}if(ge.removeAttribute(q),q==="is")if(_n||Ye)try{Nt(ge)}catch{}else try{ge.setAttribute(q,"")}catch{}},kt=function(q){let ge=null,ye=null;if(un)q="<remove></remove>"+q;else{const Ce=stringMatch(q,/^[\r\n\t ]+/);ye=Ce&&Ce[0]}Ct==="application/xhtml+xml"&&tt===pt&&(q='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+q+"</body></html>");const De=V?V.createHTML(q):q;if(tt===pt)try{ge=new R().parseFromString(De,Ct)}catch{}if(!ge||!ge.documentElement){ge=Z.createDocument(tt,"template",null);try{ge.documentElement.innerHTML=nt?Q:De}catch{}}const He=ge.body||ge.documentElement;return q&&ye&&He.insertBefore(u.createTextNode(ye),He.childNodes[0]||null),tt===pt?ne.call(ge,Ue?"html":"body")[0]:Ue?ge.documentElement:He},tn=function(q){return F.call(q.ownerDocument||q,q,_.SHOW_ELEMENT|_.SHOW_COMMENT|_.SHOW_TEXT|_.SHOW_PROCESSING_INSTRUCTION|_.SHOW_CDATA_SECTION,null)},It=function(q){return q instanceof w&&(typeof q.nodeName!="string"||typeof q.textContent!="string"||typeof q.removeChild!="function"||!(q.attributes instanceof T)||typeof q.removeAttribute!="function"||typeof q.setAttribute!="function"||typeof q.namespaceURI!="string"||typeof q.insertBefore!="function"||typeof q.hasChildNodes!="function")},ht=function(q){return typeof x=="function"&&q instanceof x};function Ke(xe,q,ge){arrayForEach(xe,ye=>{ye.call(i,q,ge,dn)})}const nn=function(q){let ge=null;if(Ke(oe.beforeSanitizeElements,q,null),It(q))return Nt(q),!0;const ye=mt(q.nodeName);if(Ke(oe.uponSanitizeElement,q,{tagName:ye,allowedTags:H}),At&&q.hasChildNodes()&&!ht(q.firstElementChild)&&regExpTest(/<[/\w!]/g,q.innerHTML)&&regExpTest(/<[/\w!]/g,q.textContent)||q.nodeType===NODE_TYPE.progressingInstruction||At&&q.nodeType===NODE_TYPE.comment&&regExpTest(/<[/\w]/g,q.data))return Nt(q),!0;if(!(ke.tagCheck instanceof Function&&ke.tagCheck(ye))&&(!H[ye]||Ee[ye])){if(!Ee[ye]&&Ze(ye)&&(me.tagNameCheck instanceof RegExp&&regExpTest(me.tagNameCheck,ye)||me.tagNameCheck instanceof Function&&me.tagNameCheck(ye)))return!1;if(ot&&!Dt[ye]){const De=U(q)||q.parentNode,He=L(q)||q.childNodes;if(He&&De){const Ce=He.length;for(let Ne=Ce-1;Ne>=0;--Ne){const We=A(He[Ne],!0);We.__removalCount=(q.__removalCount||0)+1,De.insertBefore(We,z(q))}}}return Nt(q),!0}return q instanceof E&&!vn(q)||(ye==="noscript"||ye==="noembed"||ye==="noframes")&&regExpTest(/<\/no(script|embed|frames)/i,q.innerHTML)?(Nt(q),!0):(vt&&q.nodeType===NODE_TYPE.text&&(ge=q.textContent,arrayForEach([le,Se,ve],De=>{ge=stringReplace(ge,De," ")}),q.textContent!==ge&&(arrayPush(i.removed,{element:q.cloneNode()}),q.textContent=ge)),Ke(oe.afterSanitizeElements,q,null),!1)},Lt=function(q,ge,ye){if(wt&&(ge==="id"||ge==="name")&&(ye in u||ye in Kn))return!1;if(!(Ve&&!Te[ge]&&regExpTest(_e,ge))){if(!(Me&&regExpTest(K,ge))){if(!(ke.attributeCheck instanceof Function&&ke.attributeCheck(ge,q))){if(!ue[ge]||Te[ge]){if(!(Ze(q)&&(me.tagNameCheck instanceof RegExp&&regExpTest(me.tagNameCheck,q)||me.tagNameCheck instanceof Function&&me.tagNameCheck(q))&&(me.attributeNameCheck instanceof RegExp&&regExpTest(me.attributeNameCheck,ge)||me.attributeNameCheck instanceof Function&&me.attributeNameCheck(ge,q))||ge==="is"&&me.allowCustomizedBuiltInElements&&(me.tagNameCheck instanceof RegExp&&regExpTest(me.tagNameCheck,ye)||me.tagNameCheck instanceof Function&&me.tagNameCheck(ye))))return!1}else if(!Yn[ge]){if(!regExpTest(Ae,stringReplace(ye,te,""))){if(!((ge==="src"||ge==="xlink:href"||ge==="href")&&q!=="script"&&stringIndexOf(ye,"data:")===0&&pn[q])){if(!(ft&&!regExpTest(pe,stringReplace(ye,te,"")))){if(ye)return!1}}}}}}}return!0},Ze=function(q){return q!=="annotation-xml"&&stringMatch(q,Re)},jn=function(q){Ke(oe.beforeSanitizeAttributes,q,null);const{attributes:ge}=q;if(!ge||It(q))return;const ye={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ue,forceKeepAttr:void 0};let De=ge.length;for(;De--;){const He=ge[De],{name:Ce,namespaceURI:Ne,value:We}=He,Et=mt(Ce),ze=We;let ut=Ce==="value"?ze:stringTrim(ze);if(ye.attrName=Et,ye.attrValue=ut,ye.keepAttr=!0,ye.forceKeepAttr=void 0,Ke(oe.uponSanitizeAttribute,q,ye),ut=ye.attrValue,cn&&(Et==="id"||Et==="name")&&(Ie(Ce,q),ut=Tt+ut),At&&regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i,ut)){Ie(Ce,q);continue}if(Et==="attributename"&&stringMatch(ut,"href")){Ie(Ce,q);continue}if(ye.forceKeepAttr)continue;if(!ye.keepAttr){Ie(Ce,q);continue}if(!je&&regExpTest(/\/>/i,ut)){Ie(Ce,q);continue}vt&&arrayForEach([le,Se,ve],Ot=>{ut=stringReplace(ut,Ot," ")});const Ge=mt(q.nodeName);if(!Lt(Ge,Et,ut)){Ie(Ce,q);continue}if(V&&typeof M=="object"&&typeof M.getAttributeType=="function"&&!Ne)switch(M.getAttributeType(Ge,Et)){case"TrustedHTML":{ut=V.createHTML(ut);break}case"TrustedScriptURL":{ut=V.createScriptURL(ut);break}}if(ut!==ze)try{Ne?q.setAttributeNS(Ne,Ce,ut):q.setAttribute(Ce,ut),It(q)?Nt(q):arrayPop(i.removed)}catch{Ie(Ce,q)}}Ke(oe.afterSanitizeAttributes,q,null)},Dn=function xe(q){let ge=null;const ye=tn(q);for(Ke(oe.beforeSanitizeShadowDOM,q,null);ge=ye.nextNode();)Ke(oe.uponSanitizeShadowNode,ge,null),nn(ge),jn(ge),ge.content instanceof g&&xe(ge.content);Ke(oe.afterSanitizeShadowDOM,q,null)};return i.sanitize=function(xe){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=null,ye=null,De=null,He=null;if(nt=!xe,nt&&(xe="<!-->"),typeof xe!="string"&&!ht(xe))if(typeof xe.toString=="function"){if(xe=xe.toString(),typeof xe!="string")throw typeErrorCreate("dirty is not a string, aborting")}else throw typeErrorCreate("toString is not a function");if(!i.isSupported)return xe;if(dt||Zn(q),i.removed=[],typeof xe=="string"&&(An=!1),An){if(xe.nodeName){const We=mt(xe.nodeName);if(!H[We]||Ee[We])throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place")}}else if(xe instanceof x)ge=kt("<!---->"),ye=ge.ownerDocument.importNode(xe,!0),ye.nodeType===NODE_TYPE.element&&ye.nodeName==="BODY"||ye.nodeName==="HTML"?ge=ye:ge.appendChild(ye);else{if(!_n&&!vt&&!Ue&&xe.indexOf("<")===-1)return V&&Zt?V.createHTML(xe):xe;if(ge=kt(xe),!ge)return _n?null:Zt?Q:""}ge&&un&&Nt(ge.firstChild);const Ce=tn(An?xe:ge);for(;De=Ce.nextNode();)nn(De),jn(De),De.content instanceof g&&Dn(De.content);if(An)return xe;if(_n){if(Ye)for(He=Y.call(ge.ownerDocument);ge.firstChild;)He.appendChild(ge.firstChild);else He=ge;return(ue.shadowroot||ue.shadowrootmode)&&(He=fe.call(c,He,!0)),He}let Ne=Ue?ge.outerHTML:ge.innerHTML;return Ue&&H["!doctype"]&&ge.ownerDocument&&ge.ownerDocument.doctype&&ge.ownerDocument.doctype.name&&regExpTest(DOCTYPE_NAME,ge.ownerDocument.doctype.name)&&(Ne="<!DOCTYPE "+ge.ownerDocument.doctype.name+`>
121
- `+Ne),vt&&arrayForEach([le,Se,ve],We=>{Ne=stringReplace(Ne,We," ")}),V&&Zt?V.createHTML(Ne):Ne},i.setConfig=function(){let xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zn(xe),dt=!0},i.clearConfig=function(){dn=null,dt=!1},i.isValidAttribute=function(xe,q,ge){dn||Zn({});const ye=mt(xe),De=mt(q);return Lt(ye,De,ge)},i.addHook=function(xe,q){typeof q=="function"&&arrayPush(oe[xe],q)},i.removeHook=function(xe,q){if(q!==void 0){const ge=arrayLastIndexOf(oe[xe],q);return ge===-1?void 0:arraySplice(oe[xe],ge,1)[0]}return arrayPop(oe[xe])},i.removeHooks=function(xe){oe[xe]=[]},i.removeAllHooks=function(){oe=_createHooksMap()},i}var purify=createDOMPurify();const HighlightLoadingInfo=({onClose:t})=>{const i=useTranslation();return jsxRuntimeExports.jsxs("div",{className:styles$1.highlightLoadingInfo,onClick:t,children:[jsxRuntimeExports.jsx("div",{className:styles$1.highlightLoadingInfoCloseIcon,children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:jsxRuntimeExports.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"})})}),jsxRuntimeExports.jsxs("div",{className:styles$1.highlightLoadingInfoInnerContainer,children:[jsxRuntimeExports.jsxs("div",{className:styles$1.highlightLoadingInfoContent,children:[jsxRuntimeExports.jsx("h3",{children:i("source-infos.highlight-loading.title")}),jsxRuntimeExports.jsx("p",{children:i("source-infos.highlight-loading.description")})]}),jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#000000",viewBox:"0 0 256 256",children:jsxRuntimeExports.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"})})]})]})},MarkdownLink=({title:t,href:i,children:u})=>jsxRuntimeExports.jsx("a",{href:i,title:t,target:"_blank",rel:"noopener noreferrer",children:u}),DefaultLinkButton=({className:t,children:i,...u})=>jsxRuntimeExports.jsx("a",{className:clsx(styles$g.button,styles$g.buttonDefault,t),type:"button",role:"button",...u,children:i}),Text=t=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:jsxRuntimeExports.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"})}),KnowledgeBaseTypeIcon=({type:t,...i})=>{switch(t){case"WEBSITE":return jsxRuntimeExports.jsx(Web,{...i});case"PDF":return jsxRuntimeExports.jsx(Pdf,{...i});case"DOCX":return jsxRuntimeExports.jsx(Docx,{...i});case"TEXT":return jsxRuntimeExports.jsx(Text,{...i});default:return jsxRuntimeExports.jsx(File$1,{...i})}},OpenButton=({url:t,knowledgeBaseType:i})=>{const u=useTranslation();return jsxRuntimeExports.jsx(DefaultLinkButton,{className:styles$1.openSourceButton,href:t,target:"_blank",children:jsxRuntimeExports.jsxs("div",{className:styles$1.sourceButtonLabel,children:[jsxRuntimeExports.jsx("div",{className:styles$1.sourceHeaderIcon,children:jsxRuntimeExports.jsx(KnowledgeBaseTypeIcon,{type:i})}),jsxRuntimeExports.jsx("p",{children:u("source-infos.open-source")})]})})},LoadedSourceInfos=({sourceInfos:{content:t,url:i,knowledgeBaseType:u,highlighted:c}})=>{const[p,g]=reactExports.useState(!c);reactExports.useEffect(()=>{c&&g(!1)},[c]);const v=purify.sanitize(t,{USE_PROFILES:{html:!0}});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:clsx(styles$1.sourceContent,markdownStyle.markdown),children:[jsxRuntimeExports.jsx(X5,{options:{overrides:{a:MarkdownLink}},children:v}),p&&jsxRuntimeExports.jsx(HighlightLoadingInfo,{onClose:()=>g(!1)})]}),jsxRuntimeExports.jsx(OpenButton,{url:i,knowledgeBaseType:u})]})},fixingError=""+new URL("undraw_fixing-bugs-D_eYxJc6.svg",import.meta.url).href,LoadingError=()=>{const t=useTranslation();return jsxRuntimeExports.jsxs("div",{className:styles$1.loadingError,children:[jsxRuntimeExports.jsx("h1",{children:t("source-infos.error.title")}),jsxRuntimeExports.jsx("img",{src:fixingError,title:t("source-infos.error.title")}),jsxRuntimeExports.jsx("p",{children:t("source-infos.error.info")})]})},LoadingSourceInfos=()=>jsxRuntimeExports.jsx("div",{className:styles$1.loadingSourceInfos,children:jsxRuntimeExports.jsx("svg",{className:styles$1.loading,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 useSwipeToClose({sourceInfos:t,onClose:i,threshold:u=100}){const c=reactExports.useRef(null),[p,g]=reactExports.useState(0),[v,x]=reactExports.useState(!1),E=reactExports.useRef(null),_=reactExports.useRef(null),T=reactExports.useCallback(k=>{E.current=k,x(!0)},[]),w=reactExports.useCallback(k=>{if(E.current!==null&&v){const A=k-E.current;A>0&&g(A)}},[v]),R=reactExports.useCallback(()=>{x(!1),p>u&&i(),g(0),E.current=null},[p,u,i]),M=reactExports.useCallback(k=>{const A=Q=>T(Q.touches[0].clientY),D=Q=>w(Q.touches[0].clientY),z=()=>R(),L=Q=>{Q.preventDefault(),T(Q.clientY),window.addEventListener("mousemove",U),window.addEventListener("mouseup",V)},U=Q=>w(Q.clientY),V=()=>{R(),window.removeEventListener("mousemove",U),window.removeEventListener("mouseup",V)};k.addEventListener("touchstart",A),k.addEventListener("touchmove",D),k.addEventListener("touchend",z),k.addEventListener("mousedown",L),_.current=()=>{k.removeEventListener("touchstart",A),k.removeEventListener("touchmove",D),k.removeEventListener("touchend",z),k.removeEventListener("mousedown",L),window.removeEventListener("mousemove",U),window.removeEventListener("mouseup",V)}},[T,w,R]);return reactExports.useEffect(()=>{let k;return c.current?(_.current?.(),M(c.current)):(k=new MutationObserver(()=>{c.current&&(_.current?.(),M(c.current),k?.disconnect())}),k.observe(document.body,{childList:!0,subtree:!0})),()=>{k?.disconnect(),_.current?.()}},[M,t]),{ref:c,dragOffsetY:p,isDragging:v}}const useWaitForLoadingEffect=t=>{const[i,u]=reactExports.useState(!0);return reactExports.useEffect(()=>{let c=null;return t?.type==="loading"?(u(!0),c=setTimeout(()=>{u(!1)},300)):u(!t),()=>{c&&clearTimeout(c)}},[t]),i},SourceInfos=()=>{const t=useAppDispatch(),i=useAppSelector(E=>E.chat.sourceInfos),u=useIsSmallScreen(),c=reactExports.useRef(null),p=useWaitForLoadingEffect(i);reactExports.useEffect(()=>{c.current&&i?.type==="loading"&&(u?c.current.showModal():(c.current.setAttribute("open","true"),c.current?.focus()))},[i,u]);const g=reactExports.useCallback(()=>{c.current&&(u?c.current.close():c.current.removeAttribute("open"),t(closeSourceInfos()))},[t,u]),{ref:v,dragOffsetY:x}=useSwipeToClose({onClose:g,sourceInfos:i});return i?jsxRuntimeExports.jsx("dialog",{ref:c,className:clsx(styles$1.sourceInfos,p?styles$1.waitForLoading:i.type==="loading"?styles$1.loadingContent:""),style:u&&x?{transform:`translateY(${x}px)`}:{},onClose:g,autoFocus:!0,role:"dialog","aria-labelledby":"source-info-title",children:p?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Header,{ref:v,tabIndex:-1,sourceInfos:i.type==="loaded"?i:void 0,onClose:g}),i.type==="loading"?jsxRuntimeExports.jsx(LoadingSourceInfos,{}):i.type==="loading-error"?jsxRuntimeExports.jsx(LoadingError,{}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(HighlightLoader,{loading:!i.highlighted}),jsxRuntimeExports.jsx(LoadedSourceInfos,{sourceInfos:i})]})]})}):null},container$1="_container_1aof3_1",body="_body_1aof3_7",intro="_intro_1aof3_14",footer="_footer_1aof3_39",footnote="_footnote_1aof3_43",containerWithFootnote="_containerWithFootnote_1aof3_58",startChatButton="_startChatButton_1aof3_73",spinner="_spinner_1aof3_88",formFields="_formFields_1aof3_92",formField="_formField_1aof3_92",radio="_radio_1aof3_104",checkbox="_checkbox_1aof3_111",input="_input_1aof3_119",inputLabel="_inputLabel_1aof3_153",selectWrapper="_selectWrapper_1aof3_157",select="_select_1aof3_157",selectLabel="_selectLabel_1aof3_203",styles={container:container$1,body,intro,footer,footnote,containerWithFootnote,startChatButton,spinner,formFields,formField,radio,checkbox,input,inputLabel,selectWrapper,select,selectLabel},Checkbox=({name:t,label:i,defaultValue:u,required:c,onChange:p})=>{const g=v=>{p(v.currentTarget.checked?"true":"false")};return jsxRuntimeExports.jsxs("label",{className:clsx(styles.checkbox,"chat__startScreen__checkbox"),htmlFor:t,children:[jsxRuntimeExports.jsx("input",{type:"checkbox",id:t,name:t,defaultChecked:u==="true",required:c,onChange:g}),jsxRuntimeExports.jsx("div",{children:i})]})},Input=({type:t,name:i,label:u,defaultValue:c,placeholder:p,required:g,multiple:v,min:x,max:E,pattern:_,onChange:T})=>{const w=R=>{T(R.target.value)};return jsxRuntimeExports.jsxs("label",{className:clsx(styles.input,"chat__startScreen__input"),htmlFor:i,children:[jsxRuntimeExports.jsx("div",{className:clsx(styles.inputLabel),children:u}),jsxRuntimeExports.jsx("input",{type:t,id:i,name:i,defaultValue:c,placeholder:p,required:g,multiple:v,min:x,max:E,pattern:_,onChange:w})]})},Radio=({name:t,value:i,label:u,defaultChecked:c,required:p,onChange:g})=>{const v=`${t}-${i}`,x=E=>{g(E.target.value)};return jsxRuntimeExports.jsxs("label",{className:clsx(styles.radio,"chat__startScreen__radio"),htmlFor:v,children:[jsxRuntimeExports.jsx("input",{id:v,type:"radio",name:t,value:i,defaultChecked:c,required:p,onChange:x}),jsxRuntimeExports.jsx("span",{className:clsx(styles.label),children:u})]})},Select=({name:t,label:i,defaultValue:u,required:c,multiple:p,options:g,onChange:v})=>{const x=E=>{v(E.target.value)};return jsxRuntimeExports.jsxs("label",{className:clsx(styles.select,"chat__startScreen__select"),htmlFor:t,children:[jsxRuntimeExports.jsx("div",{className:clsx(styles.selectLabel),children:i}),jsxRuntimeExports.jsx("div",{className:clsx(styles.selectWrapper),children:jsxRuntimeExports.jsx("select",{id:t,name:t,defaultValue:u,required:c,multiple:p,onChange:x,children:Object.entries(g||{}).map(([E,_])=>jsxRuntimeExports.jsx("option",{value:E,selected:_===u,children:_}))})})]})},INTRO_KEY="start-screen.intro",START_CHAT_KEY="start-screen.start-chat",WAITING_FOR_LOGIN_KEY="start-screen.waiting-for-login",FOOTNOTE_KEY="start-screen.footnote",FORM_KEY="start-screen.form",FORM_FIELDS_KEY=`${FORM_KEY}.fields`,StartScreen=()=>{const t=useTranslation(),i=useAppDispatch(),u=useClientName(),c=useAppSelector(k=>k.startScreen.loginRequestToken),p=useAppSelector(k=>k.settings.requiresUserAuthentication);reactExports.useEffect(()=>{let k;if(c){const z=window.screenX+(window.outerWidth-600)/2,L=window.screenY+(window.outerHeight-700)/2,U=encodeURIComponent(u),V=new URL(window.location.origin);V.pathname=`/${U}/auth/login`,V.searchParams.set("loginRequestToken",c);const Q=window.open(V.href,"Login",`width=600,height=700,left=${z},top=${L},resizable=yes,scrollbars=yes`);k=setInterval(()=>{Q?.closed&&(i(loginWindowClosed()),clearInterval(k))},500)}return()=>{k&&clearInterval(k)}},[u,c,i]);const[g,v]=reactExports.useState({}),x=()=>{const k=Object.entries(g).reduce((A,[D,z])=>({...A,[D]:z.value}),{});i(p?requestLogin({loginRequestToken:v4(),formValues:k}):startChat$1({formValues:k}))},E=t(INTRO_KEY),_=t(c?WAITING_FOR_LOGIN_KEY:START_CHAT_KEY),T=t(FOOTNOTE_KEY),w=reactExports.useMemo(()=>t(FORM_FIELDS_KEY)?.split(";").map(k=>k.trim())??[],[t(FORM_FIELDS_KEY)]);reactExports.useEffect(()=>{w.length&&Object.keys(g).length===0&&v(w.reduce((k,A)=>({...k,[A]:toFormField(A,t)}),{}))},[t,w,g]);const R=k=>{k.preventDefault(),x()},M=k=>A=>{v(D=>({...D,[k]:{...D[k],value:A}}))};return jsxRuntimeExports.jsxs("form",{onSubmit:R,className:clsx(styles.container,T&&styles.containerWithFootnote,"chat__startScreen"),children:[jsxRuntimeExports.jsxs("div",{className:clsx(styles.body,"chat__startScreen__body"),children:[E&&jsxRuntimeExports.jsx("div",{className:clsx(styles.intro,"chat__startScreen__intro"),children:jsxRuntimeExports.jsx(X5,{options:{overrides:{a:Link}},children:E})}),jsxRuntimeExports.jsx("div",{className:clsx(styles.formFields,"chat__startScreen__fields"),children:Object.values(g).map(({type:k,name:A,label:D,placeholder:z,defaultValue:L,options:U,required:V,multiple:Q,min:Z,max:F,pattern:Y})=>jsxRuntimeExports.jsx("div",{className:clsx(styles.formField,"chat__startScreen__field"),children:(()=>{switch(k){case"radio":return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{children:D}),Object.entries(U||{}).map(([ne,fe])=>jsxRuntimeExports.jsx(Radio,{name:A,value:ne,label:fe,defaultChecked:ne===L,required:V,onChange:M(A)},ne))]});case"checkbox":return jsxRuntimeExports.jsx(Checkbox,{name:A,label:D,defaultValue:L,required:V,onChange:M(A)});case"select":return jsxRuntimeExports.jsx(Select,{name:A,label:D,defaultValue:L,required:V,multiple:Q,options:U,onChange:M(A)});default:return jsxRuntimeExports.jsx(Input,{type:k,name:A,label:D,placeholder:z,defaultValue:L,required:V,multiple:Q,min:Z,max:F,pattern:Y,onChange:M(A)})}})()},A))})]}),jsxRuntimeExports.jsxs("div",{className:clsx(styles.footer,"chat__startScreen__footer"),children:[jsxRuntimeExports.jsxs(PrimaryButton,{type:"submit",className:styles.startChatButton,disabled:!!c,children:[!!c&&jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",className:styles.spinner,children:jsxRuntimeExports.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"})}),jsxRuntimeExports.jsx("div",{children:_})]}),T&&jsxRuntimeExports.jsx("div",{className:styles.footnote,children:jsxRuntimeExports.jsx(X5,{options:{overrides:{a:Link}},children:T})})]})]})},Link=({title:t,href:i,children:u})=>jsxRuntimeExports.jsx("a",{href:i,title:t,target:"_blank",rel:"noopener noreferrer",children:u}),toFormField=(t,i)=>{const u=i(`${FORM_KEY}.${t}.type`)||"text",c=i(`${FORM_KEY}.${t}.required`)==="true",p=i(`${FORM_KEY}.${t}.multiple`)==="true",g=i(`${FORM_KEY}.${t}.placeholder`),v=i(`${FORM_KEY}.${t}.label`)||"",x=i(`${FORM_KEY}.${t}.defaultValue`),E=i(`${FORM_KEY}.${t}.min`),_=i(`${FORM_KEY}.${t}.max`),T=i(`${FORM_KEY}.${t}.pattern`),w=toFormFieldOptions(i(`${FORM_KEY}.${t}.options`));return{name:t,label:v,placeholder:g,value:getTypeSpecificValue(u,x,w)||"",defaultValue:x,options:w,type:u,required:c,multiple:p,min:E,max:_,pattern:T}},getTypeSpecificValue=(t,i,u)=>i||t==="select"&&Object.keys(u)[0]||"",toFormFieldOptions=(t="")=>t.split(";").map(i=>i.trim()).reduce((i,u)=>{const[c,p]=u.split(":").map(g=>g.trim());return{...i,[c]:p}},{}),useSetDocumentLanguageEffect=()=>{const t=useAppSelector(i=>i.intl.locale);reactExports.useEffect(()=>{window.document.documentElement.lang=t},[t])},INCOMING_EVENTS={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"},RootScene=({clientName:t})=>{useSetDocumentLanguageEffect();const i=useAppDispatch(),u=useAppSelector(T=>T.intl.messages),c=useTranslation(),p=useAppSelector(T=>T.settings.enableStartScreen),g=useAppSelector(T=>T.startScreen.startScreenStatus),v=useAppSelector(T=>T.connection.queryString),x=reactExports.useMemo(()=>new URLSearchParams(v||"?").get("cssClassName"),[v]);reactExports.useEffect(()=>{const T=new URLSearchParams(v||""),w=Object.fromEntries(T.entries()),R=M=>{if(!(!M.data?.type||!Object.values(INCOMING_EVENTS).includes(M.data.type))){if(M.origin!==window.location.origin&&M.source!==window.parent){console.warn("Rejected postMessage from untrusted origin:",M.origin);return}switch(M.data.type){case INCOMING_EVENTS.TRIGGER_ACTION:i(M.data.action);break;case INCOMING_EVENTS.TRIGGER_STORY:i(requestNLUEvent(M.data.story));break;case INCOMING_EVENTS.ON_CHAT_WINDOW_OPEN:i({type:"webclient.chatwindow.opened"});break;case INCOMING_EVENTS.ON_CHAT_WINDOW_CLOSE:i({type:"webclient.chatwindow.closed"});break;case INCOMING_EVENTS.CHAT_MESSAGE_FROM_GUEST:i(sendMessageFromUser(M.data.text));break;case INCOMING_EVENTS.RESTART_CHAT:i(restartChat());break}}};return i(connect(t,w)),window.addEventListener("message",R,!1),()=>window.removeEventListener("message",R)},[t,v,i]),reactExports.useEffect(()=>{const T=c("page.title");T&&document&&(document.title=T)},[u,c]);const E=p===void 0,_=p===!1||g==="HIDDEN";return jsxRuntimeExports.jsx("div",{className:clsx(styles$2.chatwindow,_&&styles$2.chatwindowWithAside,"chat__chatwindow",x),children:E?null:_?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("header",{children:jsxRuntimeExports.jsx(Header$1,{chatStarted:!0})}),jsxRuntimeExports.jsx("main",{children:jsxRuntimeExports.jsx(Chat,{clientName:t})}),jsxRuntimeExports.jsx("aside",{children:jsxRuntimeExports.jsx(SourceInfos,{})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("header",{children:jsxRuntimeExports.jsx(Header$1,{chatStarted:!1})}),jsxRuntimeExports.jsx("main",{children:jsxRuntimeExports.jsx(StartScreen,{})})]})})},App=()=>{const t=useClientName(),i=useIsSmallScreen();return jsxRuntimeExports.jsx("div",{className:clsx([styles$o.app,i?"chat__small":"chat__large"]),children:jsxRuntimeExports.jsx(RootScene,{clientName:t})})},de={"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","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:
120
+ `).trim()},ScreenReaderAnnouncer=({messages:t,isBotTyping:i})=>{const u=reactExports.useRef(""),c=useTranslation(),p=c("bot-bubble.footnote"),g=E=>{switch(E.type){case"TEXT":return E.text||"";case"MARKDOWN":{const _=E.markdown||"";return markdownToPlainText(_,p)}case"DETAIL":return E.text||E.title||"";default:return""}},x=(()=>{if(i)return c("chatbot.typing")??"Chatbot is typing";const E=[...t].reverse().find(_=>_.sender.type===UserType.BOT);return E?g(E):""})();return reactExports.useEffect(()=>{x!==u.current&&(u.current=x)},[x]),jsxRuntimeExports.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:x})},DefaultButton=({className:t,children:i,...u})=>jsxRuntimeExports.jsx(Button,{className:clsx(styles$g.buttonDefault,t),type:"button",...u,children:i}),PrimaryButton=({className:t,children:i,...u})=>jsxRuntimeExports.jsx(Button,{className:clsx(styles$g.buttonPrimary,t),...u,children:i}),container$2="_container_h23mk_1",formContainer="_formContainer_h23mk_17",emailInput="_emailInput_h23mk_22",description="_description_h23mk_52",actions$3="_actions_h23mk_57",validationError="_validationError_h23mk_67",submitted="_submitted_h23mk_74",styles$a={container:container$2,formContainer,emailInput,description,actions:actions$3,validationError,submitted},TranscriptExport=({visible:t,onEmailExport:i,onClose:u})=>{const c=useTranslation(),[p,g]=reactExports.useState(void 0),[v,x]=reactExports.useState(!1),[E,_]=reactExports.useState(void 0),T=reactExports.useRef(null);reactExports.useEffect(()=>{t?(T.current?.focus(),x(!1),g(t)):p===!0&&g(!1)},[t,p]);const w=M=>{M.preventDefault(),E&&E.length>0&&(i(E),x(!0),setTimeout(u,3*1e3))},R=M=>{const k=M.target.value.trim(),A=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(k);_(A?k:"")};return jsxRuntimeExports.jsxs("div",{className:clsx(styles$a.container,bottomSheetStyles.bottomSheet,{[bottomSheetStyles.bottomSheetOpen]:p===!0,[bottomSheetStyles.bottomSheetClose]:p===!1}),children:[jsxRuntimeExports.jsx("h2",{children:c("export-transcript.email.title")}),jsxRuntimeExports.jsx(X5,{className:styles$a.description,children:c("export-transcript.email.description")||""}),jsxRuntimeExports.jsxs("form",{onSubmit:w,className:styles$a.formContainer,children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("input",{disabled:v,ref:T,type:"email",placeholder:c("export-transcript.email.placeholder"),className:styles$a.emailInput,onChange:R}),E?.length===0?jsxRuntimeExports.jsx("div",{className:styles$a.validationError,children:c("export-transcript.email.invalid")}):null]}),jsxRuntimeExports.jsxs("div",{className:styles$a.actions,children:[jsxRuntimeExports.jsx(DefaultButton,{onClick:u,children:c("export-transcript.email.cancel")}),jsxRuntimeExports.jsx(PrimaryButton,{type:"submit",disabled:v||E===void 0||E.length===0,children:c("export-transcript.email.send")})]})]}),v&&jsxRuntimeExports.jsx("div",{className:styles$a.submitted,children:c("export-transcript.email.success")})]})},inputContainer="_inputContainer_fi5ao_1",styles$9={inputContainer},blockUserInput="_blockUserInput_pot9c_1",styles$8={blockUserInput},BlockUserInput=({visible:t})=>{const i=useTranslation();return t?jsxRuntimeExports.jsx("div",{className:clsx(styles$8.blockUserInput,"chat__blockUserInput"),children:i("block-user-input.title")}):null},commandsDropdown="_commandsDropdown_fmklx_1",commands="_commands_fmklx_1",command="_command_fmklx_1",commandActive="_commandActive_fmklx_49",style={commandsDropdown,commands,command,commandActive},useKeyboardEffect=(t,i,u,c,p)=>{reactExports.useEffect(()=>{const g=v=>{if(t.length)switch(v.key){case"Enter":u(t[i]);break;case"ArrowUp":c(x=>x>0?x-1:t.length-1);break;case"ArrowDown":c(x=>x<t.length-1?x+1:0);break;case"Escape":p([]);break}};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[t,i,u,c,p])},CommandsDropdown=({text:t,commands:i,onSelectCommand:u,onVisibilityChange:c})=>{const p=reactExports.useRef(null),g=useTranslation(),[v,x]=reactExports.useState([]),[E,_]=reactExports.useState(calcMaxCommandLength(i)),[T,w]=reactExports.useState(0),R=M=>u(`/${M}`);return useClickOutsideEventListener(p,()=>x([])),useKeyboardEffect(v,T,R,w,x),reactExports.useEffect(()=>{_(calcMaxCommandLength(i))},[i]),reactExports.useEffect(()=>{const M=t.length||0;M===0||M>E||!t.startsWith("/")?x([]):x(i.filter(byText(t))),w(0)},[i,t,E]),reactExports.useEffect(()=>{c(!!v.length)},[v,c]),v.length?jsxRuntimeExports.jsx("div",{ref:p,className:style.commandsDropdown,children:jsxRuntimeExports.jsx("ul",{id:"command-list",className:style.commands,role:"listbox",children:v.map((M,k)=>jsxRuntimeExports.jsxs("li",{className:clsx([style.command,T===k&&style.commandActive]),role:"option",onClick:()=>R(M),onMouseOver:()=>w(k),children:[jsxRuntimeExports.jsxs("h1",{children:["/",M]}),jsxRuntimeExports.jsx("p",{children:g(`commands.${M}`)})]},M))})}):null},calcMaxCommandLength=t=>Math.max(...t.map(i=>i.length+1)),byText=t=>i=>{const u=`/${i}`;return u.startsWith(t)&&u.length>=t.length},callToActionContainer="_callToActionContainer_d8izj_1",callToActionTitle="_callToActionTitle_d8izj_23",rateOverlay="_rateOverlay_d8izj_30",body$1="_body_d8izj_52",footer$1="_footer_d8izj_60",actions$2="_actions_d8izj_75",bubbles="_bubbles_d8izj_89",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",styles$7={callToActionContainer,callToActionTitle,rateOverlay,body:body$1,footer:footer$1,actions:actions$2,bubbles,stars,starsSmall,starsLarge,star,starReadonly,starIcon,starsDescriptionContainer,starsDescription},Star=({value:t,index:i,count:u,readonly:c,onHover:p,onClick:g})=>{const v=x=>{g&&x.key==="Enter"&&g()};return jsxRuntimeExports.jsx("li",{className:clsx(styles$7.star,{[styles$7.starReadonly]:c},"chat__conversationRating__star"),children:jsxRuntimeExports.jsx("div",{role:"radio","aria-checked":t>i?"true":"false","aria-posinset":i+1,"aria-setsize":u,tabIndex:0,onMouseOver:p,onKeyDown:v,onClick:g,children:jsxRuntimeExports.jsx("span",{role:"img","aria-label":"Star",className:clsx(styles$7.starIcon),children:jsxRuntimeExports.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:jsxRuntimeExports.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"})})})})})},STAR_COUNT=5,Stars=({value:t,size:i,readonly:u=!1,onChange:c})=>{const[p,g]=reactExports.useState(void 0),v=()=>{g(void 0)},x=_=>()=>{if(!u){const T=_+1;g(T)}},E=_=>()=>{c&&!u&&(c(_===0&&t===1?0:_+1),g(void 0))};return jsxRuntimeExports.jsx("ul",{tabIndex:0,role:"radiogroup",className:clsx(styles$7.stars,{[styles$7.starsSmall]:i==="small",[styles$7.starsLarge]:i==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:i==="small",chat__conversationRating__stars__large:i==="large"}),onMouseOut:v,children:Array(STAR_COUNT).fill(0).map((_,T)=>jsxRuntimeExports.jsx(Star,{value:p===void 0?t:p,index:T,count:STAR_COUNT,readonly:u,onHover:x(T),onClick:E(T)},T))})},CallToAction=({visible:t,onRate:i})=>{const u=useTranslation();return t?jsxRuntimeExports.jsxs("div",{className:clsx(styles$7.callToActionContainer,"chat__conversationRating__callToAction"),children:[jsxRuntimeExports.jsx("div",{className:clsx(styles$7.callToActionTitle,"chat__conversationRating__callToAction__title"),children:u("conversation-rating.call-to-action.title")}),jsxRuntimeExports.jsx(Stars,{value:0,size:"small",onChange:i})]}):null},BotBubble=({isFirstMessageBySender:t,isLastMessageBySender:i,children:u})=>jsxRuntimeExports.jsxs("div",{className:clsx(styles$k.message,styles$k.messageBot,t&&styles$k.messageBotFirst,i&&styles$k.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",t&&"chat__bubbleContainer--first",i&&"chat__bubbleContainer--last"),children:[jsxRuntimeExports.jsx("img",{className:clsx(styles$k.avatar,styles$k.botAvatar),src:"bot.svg",alt:"Bot"}),jsxRuntimeExports.jsx("div",{className:clsx(styles$k.bubble,styles$k.bubbleLeft,"chat__bubble","chat__botBubble"),children:jsxRuntimeExports.jsx("div",{className:clsx(styles$k.leftText,styles$k.bubbleContent),children:u})})]}),GuestBubble=({children:t})=>jsxRuntimeExports.jsx("div",{className:clsx(styles$k.message,styles$k.messageGuest,styles$k.messageGuestFirst,styles$k.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:jsxRuntimeExports.jsx("div",{className:clsx(styles$k.bubble,styles$k.bubbleRight,"chat__bubble","chat__guestBubble"),children:jsxRuntimeExports.jsx("div",{className:clsx(styles$k.rightText,styles$k.bubbleContent),children:t})})}),RateOverlay=()=>{const t=useTranslation(),i=useAppDispatch(),u=useAppSelector(D=>D.chat.conversationRating),[c,p]=reactExports.useState(u.rating?.value||0),[g,v]=reactExports.useState(void 0),[x,E]=reactExports.useState(void 0),[_,T]=reactExports.useState({submitted:!1,feedback:""}),w=reactExports.useRef(null),[R,M]=reactExports.useState(!1);reactExports.useEffect(()=>{u.opener?(T({submitted:!1,feedback:""}),E(!0)):x===!0&&E(!1)},[u.opener,x]),reactExports.useEffect(()=>{p(u.rating?.value||0)},[u.rating?.value,u.opener]),reactExports.useEffect(()=>{w.current&&(w.current.value=u.rating?.feedback||"")},[u.rating?.feedback]),reactExports.useEffect(()=>{const D=c>0?t(`conversation-rating.overlay.bot-message.rate-feedback.value-${c}`):void 0;v(D?.length?D:void 0)},[c,t]),reactExports.useEffect(()=>{_.submitted?setTimeout(()=>M(!0),_.feedback.length?500:0):M(!1)},[_]);const k=D=>{D.preventDefault();const z=w.current?.value?.trim()||"";i(handleRatingFromUser(c,z)),T({submitted:!0,feedback:z})},A=()=>{u.opener==="CLOSE_CHAT"?i(closeChatWindow()):u.opener==="RESTART_CHAT"?i(restartChat()):i(hideConversationRatingOverlay())};return jsxRuntimeExports.jsx("div",{className:clsx(styles$7.rateOverlay,bottomSheetStyles.bottomSheet,"chat__conversationRating__overlay",{[bottomSheetStyles.bottomSheetOpen]:x===!0,[bottomSheetStyles.bottomSheetClose]:x===!1}),children:jsxRuntimeExports.jsxs("form",{onSubmit:k,children:[jsxRuntimeExports.jsxs("div",{className:clsx(styles$7.body,"chat__conversationRating__overlay__body"),children:[jsxRuntimeExports.jsx("div",{}),jsxRuntimeExports.jsx("div",{className:clsx(styles$7.bubbles),children:u.opener&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(BotBubble,{isFirstMessageBySender:!0,isLastMessageBySender:!g,children:[jsxRuntimeExports.jsx("h2",{children:t("conversation-rating.overlay.title")}),jsxRuntimeExports.jsxs("div",{className:clsx(styles$7.starsDescriptionContainer),children:[jsxRuntimeExports.jsx(Stars,{value:c,size:"large",readonly:_.submitted,onChange:p}),jsxRuntimeExports.jsxs("div",{className:clsx(styles$7.starsDescription),children:[jsxRuntimeExports.jsx("div",{children:t("conversation-rating.overlay.star.very-bad")}),jsxRuntimeExports.jsx("div",{children:t("conversation-rating.overlay.star.very-good")})]})]})]}),g&&jsxRuntimeExports.jsx(BotBubble,{isFirstMessageBySender:!1,isLastMessageBySender:!R||!!_.feedback.length,children:jsxRuntimeExports.jsx("div",{children:g})}),!!_.feedback.length&&jsxRuntimeExports.jsx(GuestBubble,{children:_.feedback}),R&&jsxRuntimeExports.jsx(BotBubble,{isFirstMessageBySender:!!_.feedback.length,isLastMessageBySender:!0,children:jsxRuntimeExports.jsx("div",{children:t("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),jsxRuntimeExports.jsxs("div",{className:clsx(styles$7.footer,"chat__conversationRating__overlay__footer"),children:[!_.submitted&&jsxRuntimeExports.jsx("input",{ref:w,defaultValue:u.rating?.feedback||"",placeholder:t("conversation-rating.overlay.guest-feedback.input-placeholder")}),jsxRuntimeExports.jsxs("div",{className:clsx(styles$7.actions,"chat__conversationRating__overlay__footer__actions"),children:[_.submitted?jsxRuntimeExports.jsx(PrimaryButton,{type:"button",disabled:!c,onClick:A,children:u.opener==="CLOSE_CHAT"?t("conversation-rating.overlay.action.close-chat"):u.opener==="RESTART_CHAT"?t("conversation-rating.overlay.action.restart-chat"):t("conversation-rating.overlay.action.back-to-chat")},"close-button"):jsxRuntimeExports.jsx(PrimaryButton,{type:"submit",disabled:!c,children:t("conversation-rating.overlay.action.submit")},"submit-button"),u.opener!=="CHAT"&&!_.submitted&&jsxRuntimeExports.jsx(DefaultButton,{onClick:A,children:u.opener==="CLOSE_CHAT"?t("conversation-rating.overlay.action.close-chat"):u.opener==="RESTART_CHAT"?t("conversation-rating.overlay.action.restart-chat"):t("conversation-rating.overlay.action.cancel")})]})]})]})})},ConversationRating=({numberOfMessagesFromGuest:t})=>{const i=useAppDispatch(),u=useAppSelector(g=>g.chat.conversationRating),c=g=>{i(showConversationRatingOverlay("CHAT",g))},p=!u.rating?.value&&t>=1;return u.enabled?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(CallToAction,{visible:p,onRate:c}),jsxRuntimeExports.jsx(RateOverlay,{})]}):null},ConversationRating$1=reactExports.memo(ConversationRating),inputWrapper="_inputWrapper_m3q4d_1",withOpenCommands="_withOpenCommands_m3q4d_13",actions$1="_actions_m3q4d_18",messageInputWrapper="_messageInputWrapper_m3q4d_53",messageInput="_messageInput_m3q4d_53",buttons="_buttons_m3q4d_78",button="_button_m3q4d_78",styles$6={inputWrapper,withOpenCommands,actions:actions$1,messageInputWrapper,messageInput,buttons,button},audioRecorder="_audioRecorder_g845f_1",audioButton="_audioButton_g845f_6",recorderIcon="_recorderIcon_g845f_37",spinning="_spinning_g845f_60",styles$5={audioRecorder,audioButton,recorderIcon,spinning},BUFFER_SIZE=2048,OUTPUT_SAMPLE_RATE=16e3;class AudioRecorder extends React.Component{audioInput=null;volume=null;leftchannel=[];recorder=null;recordingLength=0;sampleRate=null;mediaStream=null;constructor(i){super(i),this.state={recordingState:"none"},this.triggerAudioRecording=this.triggerAudioRecording.bind(this),this.triggerAudioRecordingSuccess=this.triggerAudioRecordingSuccess.bind(this),this.initRecording=this.initRecording.bind(this),this.processRecordingInput=this.processRecordingInput.bind(this),this.handleClickSubmitAudio=this.handleClickSubmitAudio.bind(this),this.handleClickStopAudio=this.handleClickStopAudio.bind(this)}triggerAudioRecording(){this.setState({recordingState:"connecting"}),navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(this.triggerAudioRecordingSuccess)}triggerAudioRecordingSuccess(i){this.mediaStream=i,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(i)}initRecording(i){const u=window.AudioContext||window.webkitAudioContext,c=new u;this.sampleRate=c.sampleRate,this.volume=c.createGain(),this.audioInput=c.createMediaStreamSource(i),this.audioInput.connect(this.volume),this.recorder=c.createScriptProcessor(BUFFER_SIZE,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(c.destination)}processRecordingInput(i){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const u=i.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(u)),this.recordingLength+=BUFFER_SIZE}}handleClickSubmitAudio(){const i=mergeBuffers(this.leftchannel,this.recordingLength),u=downsampleBuffer(i,this.sampleRate||0),c=createWav(u);this.props.onAudioRecorded(c),this.handleClickStopAudio()}handleClickStopAudio(){this.setState({recordingState:"none"}),this.audioInput?.disconnect(),this.volume?.disconnect(),this.recorder?.disconnect(),this.mediaStream&&this.mediaStream?.getAudioTracks().forEach(i=>{i.stop()})}render(){return jsxRuntimeExports.jsxs("div",{className:styles$5.audioRecorder,children:[this.state.recordingState==="none"&&jsxRuntimeExports.jsx("button",{className:clsx(styles$5.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:jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsxRuntimeExports.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"}),jsxRuntimeExports.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&jsxRuntimeExports.jsxs("svg",{className:styles$5.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsxRuntimeExports.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"}),jsxRuntimeExports.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&jsxRuntimeExports.jsxs("div",{className:styles$5.audioRecorder,children:[jsxRuntimeExports.jsx("button",{className:clsx(styles$5.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsxRuntimeExports.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"}),jsxRuntimeExports.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),jsxRuntimeExports.jsx("div",{className:styles$5.recorderIcon}),jsxRuntimeExports.jsx("button",{className:clsx(styles$5.audioButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsxRuntimeExports.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),jsxRuntimeExports.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const createWav=t=>{const i=new ArrayBuffer(44+t.length*2),u=new DataView(i);writeUTFBytes(u,0,"RIFF"),u.setUint32(4,44+t.length*2,!0),writeUTFBytes(u,8,"WAVE"),writeUTFBytes(u,12,"fmt "),u.setUint32(16,16,!0),u.setUint16(20,1,!0),u.setUint16(22,1,!0),u.setUint32(24,OUTPUT_SAMPLE_RATE,!0),u.setUint32(28,OUTPUT_SAMPLE_RATE*4,!0),u.setUint16(32,4,!0),u.setUint16(34,16,!0),writeUTFBytes(u,36,"data"),u.setUint32(40,t.length*2,!0);const c=t.length;let p=44;const g=1;for(let v=0;v<c;v++)u.setInt16(p,t[v]*(32767*g),!0),p+=2;return new Blob([u],{type:"audio/wav"})},writeUTFBytes=(t,i,u)=>{for(let c=0;c<u.length;c++)t.setUint8(i+c,u.charCodeAt(c))},mergeBuffers=(t,i)=>{const u=new Float32Array(i);let c=0;const p=t.length;for(let g=0;g<p;g++){const v=t[g];u.set(v,c),c+=v.length}return u},downsampleBuffer=(t,i)=>{if(OUTPUT_SAMPLE_RATE===i)return t;const u=i/OUTPUT_SAMPLE_RATE,c=Math.round(t.length/u),p=new Float32Array(c);let g=0,v=0;for(;g<p.length;){const x=Math.round((g+1)*u);let E=0,_=0;for(let T=v;T<x&&T<t.length;T++)E+=t[T],_++;p[g]=E/_,g++,v=x}return p},CommandButton=({onClick:t})=>{const i=useTranslation();return jsxRuntimeExports.jsxs("button",{onClick:t,type:"button","aria-label":i("message-input.actions.command.label"),children:[jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"#000000",viewBox:"0 0 256 256",children:[jsxRuntimeExports.jsx("rect",{x:"32",y:"32",width:"192",height:"192",rx:"16",ry:"16",fill:"none",stroke:"currentColor","stroke-width":"16"}),jsxRuntimeExports.jsx("line",{x1:"80",y1:"176",x2:"176",y2:"80",stroke:"currentColor","stroke-width":"16","stroke-linecap":"round"})]}),jsxRuntimeExports.jsx("span",{children:i("message-input.actions.command.label")})]})},TextInput=({disabled:t,textInput:i,commandsVisible:u,hasCommands:c,onTextInput:p,onTextInputSubmit:g,onAudioRecorded:v})=>{const x=useTranslation(),E=reactExports.useRef(null),{enableSpeechSupport:_}=useAppSelector(A=>A.settings);reactExports.useEffect(()=>{E.current?.focus()},[i]);const T=()=>{const A=E.current;A&&i.trim().length>=1&&g(i.trim())&&(A.value="",A.style.height="",A.focus())},w=A=>{A.preventDefault(),T()},R=A=>{const D=A.target.value;p(D),A.target.style.height="";const{scrollHeight:z}=A.target;A.target.style.height=`${z>150?150:z}px`},M=A=>{A.code==="Enter"&&!A.shiftKey?(A.repeat||T(),A.preventDefault()):u&&(A.code==="ArrowUp"||A.code==="ArrowDown")&&A.preventDefault()},k=()=>{i.startsWith("/")?p(""):p("/")};return jsxRuntimeExports.jsxs("form",{className:clsx(styles$6.inputWrapper,u&&styles$6.withOpenCommands,"chat__textInput"),onSubmit:w,children:[jsxRuntimeExports.jsxs("div",{className:styles$6.messageInputWrapper,children:[jsxRuntimeExports.jsx("textarea",{id:"user_input",ref:E,className:styles$6.messageInput,tabIndex:0,placeholder:x("message-input-placeholder"),value:i,onChange:R,onKeyDown:M,"aria-label":x("message-input-label"),"aria-controls":c?"command-list":void 0,"aria-haspopup":c?"listbox":void 0}),c&&jsxRuntimeExports.jsx("div",{className:styles$6.actions,children:jsxRuntimeExports.jsx(CommandButton,{onClick:k})})]}),jsxRuntimeExports.jsx("div",{className:clsx(styles$6.buttons,"chat__buttons"),children:i.length||!_||navigator.mediaDevices===void 0?jsxRuntimeExports.jsx("button",{className:clsx(styles$6.button,"chat__button"),type:"submit","aria-label":x("message-input.actions.submit.label"),"data-title":x("message-input.actions.submit.label"),tabIndex:0,disabled:t,children:jsxRuntimeExports.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:jsxRuntimeExports.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"})})}):_&&navigator.mediaDevices!==void 0&&jsxRuntimeExports.jsx(AudioRecorder,{translate:x,onAudioRecorded:v})})]})},quickReplies="_quickReplies_83npe_1",quickReply="_quickReply_83npe_9",styles$4={quickReplies,quickReply},QuickReplies=({quickReplies:t,onQuickReplyClick:i})=>t.length?jsxRuntimeExports.jsx("div",{className:clsx(styles$4.quickReplies,"chat__quickReplies"),children:t.map(u=>jsxRuntimeExports.jsx(Button,{tabIndex:0,className:clsx(styles$4.quickReply,"chat__button","chat__quickReply"),onClick:()=>i(u),children:u.label},u.label))}):null,MIN_USER_BLOCKED_TIME=5e3,MIN_TIME_BETWEEN_USER_REQUESTS=1e3,UserInput=({isBotTyping:t,quickReplies:i,numberOfMessagesFromGuest:u,commands:c,onTextInput:p,onQuickReplyClick:g,onAudioRecorded:v})=>{const[x,E]=reactExports.useState(""),[_,T]=reactExports.useState(!1),[w,R]=reactExports.useState(!1),M=reactExports.useRef(0),k=reactExports.useRef(0);reactExports.useEffect(()=>{if(_&&!t){const z=M.current?Date.now()-M.current:0;z>MIN_USER_BLOCKED_TIME?T(!1):setTimeout(()=>{T(!1)},MIN_USER_BLOCKED_TIME-z)}},[_,t]),reactExports.useEffect(()=>{_&&(M.current=Date.now())},[_]);const A=z=>{const L=Date.now()-k.current<MIN_TIME_BETWEEN_USER_REQUESTS;return w?!1:t||L?(T(!0),!1):(p(z),E(""),k.current=Date.now(),!0)},D=z=>{E(z+" ")};return jsxRuntimeExports.jsxs("div",{className:clsx(styles$9.inputContainer),children:[jsxRuntimeExports.jsx(QuickReplies,{quickReplies:i,onQuickReplyClick:g}),jsxRuntimeExports.jsx(BlockUserInput,{visible:_}),!_&&jsxRuntimeExports.jsx(ConversationRating$1,{numberOfMessagesFromGuest:u}),!!c?.length&&jsxRuntimeExports.jsx(CommandsDropdown,{text:x,commands:c,onSelectCommand:D,onVisibilityChange:R}),jsxRuntimeExports.jsx(TextInput,{textInput:x,disabled:_,commandsVisible:w,hasCommands:!!c?.length,onTextInput:E,onTextInputSubmit:A,onAudioRecorded:v})]})},ChatComponent=({clientName:t,messages:i,quickReplies:u,isBotTyping:c,drawerContentUrl:p,onMessageFromUser:g,onQuickReplyClick:v,onButtonClick:x,onLinkClick:E,onAudioRecorded:_,onTranscriptExport:T,onTranscriptItemReaction:w})=>{const R=useAppDispatch(),M=useAppSelector(V=>V.connection.connectionState),{enableTranscriptExportEmail:k,commands:A}=useAppSelector(V=>V.settings),{showTranscriptMailOverlay:D,conversationRating:z}=useAppSelector(V=>V.chat),L=i.filter(V=>V.sender.type===UserType.GUEST).length;reactExports.useEffect(()=>{M===ConnectionStateEnum.CONNECTED&&R(startChat(t))},[t,M,R]);const U=()=>{R(toggleTranscriptMailOverlay())};return jsxRuntimeExports.jsxs("div",{className:styles$n.container,children:[jsxRuntimeExports.jsx(ScreenReaderAnnouncer,{messages:i,isBotTyping:c}),jsxRuntimeExports.jsxs("div",{className:clsx([styles$n.chatcontent,(D||z?.opener)&&styles$n.accessabilityHidden]),children:[jsxRuntimeExports.jsx(Conversation,{messages:i,isBotTyping:c,commands:A,onButtonClick:x,onLinkClick:E,onTranscriptItemReaction:w}),jsxRuntimeExports.jsx(UserInput,{isBotTyping:c,quickReplies:c?[]:u,numberOfMessagesFromGuest:L,commands:A,onQuickReplyClick:v,onTextInput:g,onAudioRecorded:_}),jsxRuntimeExports.jsx(PoweredBy,{})]}),k&&jsxRuntimeExports.jsx(TranscriptExport,{visible:!!D,onEmailExport:T,onClose:U}),jsxRuntimeExports.jsx(Drawer,{contentUrl:p})]})},mapStateToProps=t=>{const{messages:i,quickReplies:u,isBotTyping:c,drawerContentUrl:p}=t.chat;return{messages:i,quickReplies:u,isBotTyping:c,drawerContentUrl:p}},bindAction=t=>({onRestartChat:()=>t(restartChat()),onMessageFromUser:i=>t(sendMessageFromUser(i)),onAudioRecorded:i=>t(sendAudioMessageFromUser(i)),onActionFromUser:i=>t(i),onQuickReplyClick:i=>t(handleQuickReplyClick(i)),onNluEvent:i=>t(requestNLUEvent(i)),onButtonClick:i=>t(handleButtonClick(i)),onLinkClick:i=>t(handleLinkClick(i)),onTranscriptExport:i=>t(exportTranscript(i)),onTranscriptItemReaction:(i,u)=>{t(transcriptItemGuestReaction(i,u?.type||null,u?.category,u?.comment))}}),Chat=connect_default(mapStateToProps,bindAction)(ChatComponent),useIsInIframe=()=>reactExports.useMemo(()=>{try{return window.self!==window.top}catch{return!0}},[]),onButtonKeyDownHandler=t=>i=>{const u=i.key;(u==="ArrowDown"||u==="ArrowRight"||u==="Enter"||u===" "||u==="Space")&&(i.stopPropagation(),t())},CloseChatWindowButton=({onClick:t})=>{const i=useTranslation();return useIsInIframe()?jsxRuntimeExports.jsx("button",{className:"tooltip--bottom-left","aria-label":i("header.close-chat"),"data-title":i("header.close-chat"),tabIndex:0,onClick:t,onKeyDown:onButtonKeyDownHandler(t),children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:jsxRuntimeExports.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},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",styles$3={header,logoContainer,logo,actions,active,menuContainer,menu,divider},MenuItemIcon=({icon:t})=>{switch(t){case"arrow-counter-clockwise":return jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 jsxRuntimeExports.jsx("div",{})}},MenuItem=reactExports.forwardRef(({selected:t,item:i,onClick:u},c)=>{const p=useTranslation(),g=v=>{v.preventDefault(),u()};return jsxRuntimeExports.jsx("li",{"aria-selected":t,role:"option",className:i.withDivider?styles$3.divider:void 0,children:jsxRuntimeExports.jsxs("a",{ref:c,type:"button",role:"button",tabIndex:-1,onClick:g,children:[jsxRuntimeExports.jsx(MenuItemIcon,{icon:i.icon}),jsxRuntimeExports.jsx("span",{children:p(`header.menu.${i.id}`)})]})})}),useMenuItems=(t,i)=>{const u=useIsInIframe(),{menuItems:c,enableStandaloneView:p,enableTranscriptExportPdf:g,enableTranscriptExportEmail:v}=useAppSelector(_=>_.settings),x=useAppSelector(_=>_.chat.conversationRating.enabled);return reactExports.useMemo(()=>{const _=[],T=c.filter(({visibility:w})=>t?w==="always"||w==="chat-only":w==="always"||w==="start-screen-only");if(t&&(_.push({id:"restart-chat",type:"restart-chat",icon:"arrow-counter-clockwise",visibility:"chat-only"}),u&&p&&_.push({id:"expand-chat-window",type:"expand-chat-window",icon:"expand",visibility:"always"}),i&&g&&_.push({id:"download-transcript",type:"download-transcript",icon:"download",visibility:"chat-only"}),i&&v&&_.push({id:"send-transcript",type:"send-transcript",icon:"mail",visibility:"chat-only"}),i&&x&&_.push({id:"rate-conversation",type:"rate-conversation",icon:"star",visibility:"chat-only"}),_.length>0&&T.length)){const w=_.pop();w&&c.length&&_.push({...w,withDivider:!0})}return _.push(...T),_},[t,i,g,v,p,x,u,c])},Menu=({chatStarted:t,hasGuestMessages:i})=>{const u=useAppDispatch(),c=useTranslation(),{enabled:p,opener:g}=useAppSelector(L=>L.chat.conversationRating),[v,x]=reactExports.useState(!1),[E,_]=reactExports.useState(-1),T=reactExports.useRef(null),w=reactExports.useRef(null),R=reactExports.useRef([]),M=useMenuItems(t,i);reactExports.useEffect(()=>{R.current[E]?.focus()},[E]);const k=reactExports.useCallback(()=>{u(i&&p&&!g?showConversationRatingOverlay("RESTART_CHAT"):restartChat()),x(!1),_(0)},[i,p,g,u]),A=reactExports.useCallback(L=>{switch(L.type){case"restart-chat":{k();break}case"expand-chat-window":{const U=new URL(window.location.origin);U.pathname=window.location.pathname,U.search=window.location.search,U.hash=window.location.hash,window.open(U.href,"_blank");break}case"download-transcript":{u(downloadTranscriptPdf());break}case"send-transcript":{u(toggleTranscriptMailOverlay());break}case"rate-conversation":{u(showConversationRatingOverlay("MENU"));break}case"link":{u(handleLinkClick(L.url));break}case"action":{u(JSON.parse(JSON.stringify(L.action)));break}}x(!1)},[u,k,x]);reactExports.useEffect(()=>{const L=U=>{if(v)switch(U.key){case"Enter":U.preventDefault(),A(M[E]);break;case"ArrowUp":_(V=>V>0?V-1:M.length-1);break;case"ArrowDown":_(V=>V<M.length-1?V+1:0);break;case"Escape":x(!1);break;case"Tab":E>-1&&x(!1);break}};return document.addEventListener("keydown",L),()=>{document.removeEventListener("keydown",L)}},[v,E,M,_,x,A]),reactExports.useEffect(()=>{v||_(-1)},[v,E]),useClickOutsideEventListener(w,()=>x(!1));const D=()=>{x(L=>!L)},z=()=>{setTimeout(()=>{const L=document.activeElement;w.current&&!w.current.contains(L)&&x(!1)},0)};return M.length?jsxRuntimeExports.jsxs("div",{className:clsx(styles$3.menuContainer),ref:w,children:[jsxRuntimeExports.jsx("button",{ref:T,className:clsx(v&&styles$3.active,v?"tooltip-hidden":"tooltip--bottom-left"),"aria-label":c("header.menu.title"),"data-title":c("header.menu.title"),onClick:D,onBlur:z,children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:jsxRuntimeExports.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"})})}),v&&jsxRuntimeExports.jsx("nav",{className:styles$3.menu,"aria-label":c("header.menu.title"),children:jsxRuntimeExports.jsx("ul",{tabIndex:0,children:M.map((L,U)=>jsxRuntimeExports.jsx(MenuItem,{ref:V=>{R.current[U]=V},selected:E===U,item:L,onClick:()=>A(L)},L.id))})})]}):null},Header$1=({className:t,chatStarted:i,...u})=>{const c=useAppDispatch(),p=useAppSelector(x=>x.chat.conversationRating),g=useAppSelector(x=>x.chat.messages.some(E=>E.sender.type===UserType$1.GUEST)),v=()=>{p.enabled&&!p.opener&&g?c(showConversationRatingOverlay("CLOSE_CHAT")):c(closeChatWindow())};return jsxRuntimeExports.jsxs("div",{className:clsx(styles$3.header,t),...u,children:[jsxRuntimeExports.jsx("div",{className:styles$3.logoContainer,children:jsxRuntimeExports.jsx("div",{className:styles$3.logo})}),jsxRuntimeExports.jsxs("div",{className:styles$3.actions,children:[jsxRuntimeExports.jsx(Menu,{chatStarted:i,hasGuestMessages:g}),jsxRuntimeExports.jsx(CloseChatWindowButton,{onClick:v})]})]})},chatwindow="_chatwindow_rkbir_1",chatwindowWithAside="_chatwindowWithAside_rkbir_21",styles$2={chatwindow,chatwindowWithAside},useIsSmallScreen=()=>{const[t,i]=reactExports.useState(!1);return reactExports.useEffect(()=>{const u=window.matchMedia("(max-width: 1023px)"),c=()=>i(u.matches);return c(),u.addEventListener("change",c),()=>u.removeEventListener("change",c)},[]),t},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",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",styles$1={sourceInfos,waitForLoading,loadingContent,sourceHeader,sourceHeaderIcon,sourceContent,openSourceButton,sourceButtonLabel,closeSourceInfosButton,loadingSourceInfos,loading,loadingError,highlightLoadingInfo,highlightLoadingInfoInnerContainer,highlightLoadingInfoContent,highlightLoadingInfoCloseIcon,highlightLoader,highlightLoaderLoading},CloseSourceInfosButton=({onClick:t})=>{const i=useTranslation();return jsxRuntimeExports.jsx("button",{className:clsx(styles$1.closeSourceInfosButton,"tooltip--bottom-left"),"aria-label":i("source-infos.close"),"data-title":i("source-infos.close"),tabIndex:0,onClick:t,children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:jsxRuntimeExports.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"})})})},Header=reactExports.forwardRef(({sourceInfos:t,onClose:i,...u},c)=>jsxRuntimeExports.jsxs("div",{className:styles$1.sourceHeader,...u,ref:c,children:[jsxRuntimeExports.jsx("div",{children:t?jsxRuntimeExports.jsx("p",{id:"source-info-title",children:t.title}):jsxRuntimeExports.jsx("p",{children:" "})}),jsxRuntimeExports.jsx(CloseSourceInfosButton,{onClick:i})]})),HighlightLoader=({loading:t})=>jsxRuntimeExports.jsx("div",{className:styles$1.highlightLoader,children:t&&jsxRuntimeExports.jsx("div",{className:styles$1.highlightLoaderLoading})});const{entries,setPrototypeOf,isFrozen,getPrototypeOf,getOwnPropertyDescriptor}=Object;let{freeze,seal,create}=Object,{apply,construct}=typeof Reflect<"u"&&Reflect;freeze||(freeze=function(i){return i});seal||(seal=function(i){return i});apply||(apply=function(i,u){for(var c=arguments.length,p=new Array(c>2?c-2:0),g=2;g<c;g++)p[g-2]=arguments[g];return i.apply(u,p)});construct||(construct=function(i){for(var u=arguments.length,c=new Array(u>1?u-1:0),p=1;p<u;p++)c[p-1]=arguments[p];return new i(...c)});const arrayForEach=unapply(Array.prototype.forEach),arrayLastIndexOf=unapply(Array.prototype.lastIndexOf),arrayPop=unapply(Array.prototype.pop),arrayPush=unapply(Array.prototype.push),arraySplice=unapply(Array.prototype.splice),stringToLowerCase=unapply(String.prototype.toLowerCase),stringToString=unapply(String.prototype.toString),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf=unapply(String.prototype.indexOf),stringTrim=unapply(String.prototype.trim),objectHasOwnProperty=unapply(Object.prototype.hasOwnProperty),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=unconstruct(TypeError);function unapply(t){return function(i){i instanceof RegExp&&(i.lastIndex=0);for(var u=arguments.length,c=new Array(u>1?u-1:0),p=1;p<u;p++)c[p-1]=arguments[p];return apply(t,i,c)}}function unconstruct(t){return function(){for(var i=arguments.length,u=new Array(i),c=0;c<i;c++)u[c]=arguments[c];return construct(t,u)}}function addToSet(t,i){let u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:stringToLowerCase;setPrototypeOf&&setPrototypeOf(t,null);let c=i.length;for(;c--;){let p=i[c];if(typeof p=="string"){const g=u(p);g!==p&&(isFrozen(i)||(i[c]=g),p=g)}t[p]=!0}return t}function cleanArray(t){for(let i=0;i<t.length;i++)objectHasOwnProperty(t,i)||(t[i]=null);return t}function clone(t){const i=create(null);for(const[u,c]of entries(t))objectHasOwnProperty(t,u)&&(Array.isArray(c)?i[u]=cleanArray(c):c&&typeof c=="object"&&c.constructor===Object?i[u]=clone(c):i[u]=c);return i}function lookupGetter(t,i){for(;t!==null;){const c=getOwnPropertyDescriptor(t,i);if(c){if(c.get)return unapply(c.get);if(typeof c.value=="function")return unapply(c.value)}t=getPrototypeOf(t)}function u(){return null}return u}const html$1=freeze(["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"]),svg$1=freeze(["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"]),svgFilters=freeze(["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"]),svgDisallowed=freeze(["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"]),mathMl$1=freeze(["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"]),mathMlDisallowed=freeze(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),text=freeze(["#text"]),html=freeze(["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","slot"]),svg=freeze(["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"]),mathMl=freeze(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),xml=freeze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MUSTACHE_EXPR=seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ERB_EXPR=seal(/<%[\w\W]*|[\w\W]*%>/gm),TMPLIT_EXPR=seal(/\$\{[\w\W]*/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]+$/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DOCTYPE_NAME=seal(/^html$/i),CUSTOM_ELEMENT=seal(/^[a-z][.\w]*(-[.\w]+)+$/i);var EXPRESSIONS=Object.freeze({__proto__:null,ARIA_ATTR,ATTR_WHITESPACE,CUSTOM_ELEMENT,DATA_ATTR,DOCTYPE_NAME,ERB_EXPR,IS_ALLOWED_URI,IS_SCRIPT_OR_DATA,MUSTACHE_EXPR,TMPLIT_EXPR});const NODE_TYPE={element:1,text:3,progressingInstruction:7,comment:8,document:9},getGlobal=function t(){return typeof window>"u"?null:window},_createTrustedTypesPolicy=function t(i,u){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let c=null;const p="data-tt-policy-suffix";u&&u.hasAttribute(p)&&(c=u.getAttribute(p));const g="dompurify"+(c?"#"+c:"");try{return i.createPolicy(g,{createHTML(v){return v},createScriptURL(v){return v}})}catch{return console.warn("TrustedTypes policy "+g+" could not be created."),null}},_createHooksMap=function t(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function createDOMPurify(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:getGlobal();const i=xe=>createDOMPurify(xe);if(i.version="3.3.1",i.removed=[],!t||!t.document||t.document.nodeType!==NODE_TYPE.document||!t.Element)return i.isSupported=!1,i;let{document:u}=t;const c=u,p=c.currentScript,{DocumentFragment:g,HTMLTemplateElement:v,Node:x,Element:E,NodeFilter:_,NamedNodeMap:T=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:w,DOMParser:R,trustedTypes:M}=t,k=E.prototype,A=lookupGetter(k,"cloneNode"),D=lookupGetter(k,"remove"),z=lookupGetter(k,"nextSibling"),L=lookupGetter(k,"childNodes"),U=lookupGetter(k,"parentNode");if(typeof v=="function"){const xe=u.createElement("template");xe.content&&xe.content.ownerDocument&&(u=xe.content.ownerDocument)}let V,Q="";const{implementation:Z,createNodeIterator:F,createDocumentFragment:Y,getElementsByTagName:ne}=u,{importNode:fe}=c;let oe=_createHooksMap();i.isSupported=typeof entries=="function"&&typeof U=="function"&&Z&&Z.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:le,ERB_EXPR:Se,TMPLIT_EXPR:ve,DATA_ATTR:_e,ARIA_ATTR:K,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:te,CUSTOM_ELEMENT:Re}=EXPRESSIONS;let{IS_ALLOWED_URI:Ae}=EXPRESSIONS,H=null;const ie=addToSet({},[...html$1,...svg$1,...svgFilters,...mathMl$1,...text]);let ue=null;const be=addToSet({},[...html,...svg,...mathMl,...xml]);let me=Object.seal(create(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}})),Ee=null,Te=null;const ke=Object.seal(create(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Me=!0,Ve=!0,ft=!1,je=!0,vt=!1,At=!0,Ue=!1,dt=!1,un=!1,_n=!1,Ye=!1,Zt=!1,wt=!0,cn=!1;const Tt="user-content-";let ot=!0,An=!1,Xt={},Dt=null;const Pt=addToSet({},["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"]);let pn=null;const mn=addToSet({},["audio","video","img","source","image","track"]);let Yn=null;const at=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),gn="http://www.w3.org/1998/Math/MathML",bt="http://www.w3.org/2000/svg",pt="http://www.w3.org/1999/xhtml";let tt=pt,nt=!1,fn=null;const yn=addToSet({},[gn,bt,pt],stringToString);let qt=addToSet({},["mi","mo","mn","ms","mtext"]),rt=addToSet({},["annotation-xml"]);const Jt=addToSet({},["title","style","font","a","script"]);let Ct=null;const Cn=["application/xhtml+xml","text/html"],On="text/html";let mt=null,dn=null;const Kn=u.createElement("form"),wn=function(q){return q instanceof RegExp||q instanceof Function},Zn=function(){let q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(dn&&dn===q)){if((!q||typeof q!="object")&&(q={}),q=clone(q),Ct=Cn.indexOf(q.PARSER_MEDIA_TYPE)===-1?On:q.PARSER_MEDIA_TYPE,mt=Ct==="application/xhtml+xml"?stringToString:stringToLowerCase,H=objectHasOwnProperty(q,"ALLOWED_TAGS")?addToSet({},q.ALLOWED_TAGS,mt):ie,ue=objectHasOwnProperty(q,"ALLOWED_ATTR")?addToSet({},q.ALLOWED_ATTR,mt):be,fn=objectHasOwnProperty(q,"ALLOWED_NAMESPACES")?addToSet({},q.ALLOWED_NAMESPACES,stringToString):yn,Yn=objectHasOwnProperty(q,"ADD_URI_SAFE_ATTR")?addToSet(clone(at),q.ADD_URI_SAFE_ATTR,mt):at,pn=objectHasOwnProperty(q,"ADD_DATA_URI_TAGS")?addToSet(clone(mn),q.ADD_DATA_URI_TAGS,mt):mn,Dt=objectHasOwnProperty(q,"FORBID_CONTENTS")?addToSet({},q.FORBID_CONTENTS,mt):Pt,Ee=objectHasOwnProperty(q,"FORBID_TAGS")?addToSet({},q.FORBID_TAGS,mt):clone({}),Te=objectHasOwnProperty(q,"FORBID_ATTR")?addToSet({},q.FORBID_ATTR,mt):clone({}),Xt=objectHasOwnProperty(q,"USE_PROFILES")?q.USE_PROFILES:!1,Me=q.ALLOW_ARIA_ATTR!==!1,Ve=q.ALLOW_DATA_ATTR!==!1,ft=q.ALLOW_UNKNOWN_PROTOCOLS||!1,je=q.ALLOW_SELF_CLOSE_IN_ATTR!==!1,vt=q.SAFE_FOR_TEMPLATES||!1,At=q.SAFE_FOR_XML!==!1,Ue=q.WHOLE_DOCUMENT||!1,_n=q.RETURN_DOM||!1,Ye=q.RETURN_DOM_FRAGMENT||!1,Zt=q.RETURN_TRUSTED_TYPE||!1,un=q.FORCE_BODY||!1,wt=q.SANITIZE_DOM!==!1,cn=q.SANITIZE_NAMED_PROPS||!1,ot=q.KEEP_CONTENT!==!1,An=q.IN_PLACE||!1,Ae=q.ALLOWED_URI_REGEXP||IS_ALLOWED_URI,tt=q.NAMESPACE||pt,qt=q.MATHML_TEXT_INTEGRATION_POINTS||qt,rt=q.HTML_INTEGRATION_POINTS||rt,me=q.CUSTOM_ELEMENT_HANDLING||{},q.CUSTOM_ELEMENT_HANDLING&&wn(q.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(me.tagNameCheck=q.CUSTOM_ELEMENT_HANDLING.tagNameCheck),q.CUSTOM_ELEMENT_HANDLING&&wn(q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(me.attributeNameCheck=q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),q.CUSTOM_ELEMENT_HANDLING&&typeof q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(me.allowCustomizedBuiltInElements=q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),vt&&(Ve=!1),Ye&&(_n=!0),Xt&&(H=addToSet({},text),ue=[],Xt.html===!0&&(addToSet(H,html$1),addToSet(ue,html)),Xt.svg===!0&&(addToSet(H,svg$1),addToSet(ue,svg),addToSet(ue,xml)),Xt.svgFilters===!0&&(addToSet(H,svgFilters),addToSet(ue,svg),addToSet(ue,xml)),Xt.mathMl===!0&&(addToSet(H,mathMl$1),addToSet(ue,mathMl),addToSet(ue,xml))),q.ADD_TAGS&&(typeof q.ADD_TAGS=="function"?ke.tagCheck=q.ADD_TAGS:(H===ie&&(H=clone(H)),addToSet(H,q.ADD_TAGS,mt))),q.ADD_ATTR&&(typeof q.ADD_ATTR=="function"?ke.attributeCheck=q.ADD_ATTR:(ue===be&&(ue=clone(ue)),addToSet(ue,q.ADD_ATTR,mt))),q.ADD_URI_SAFE_ATTR&&addToSet(Yn,q.ADD_URI_SAFE_ATTR,mt),q.FORBID_CONTENTS&&(Dt===Pt&&(Dt=clone(Dt)),addToSet(Dt,q.FORBID_CONTENTS,mt)),q.ADD_FORBID_CONTENTS&&(Dt===Pt&&(Dt=clone(Dt)),addToSet(Dt,q.ADD_FORBID_CONTENTS,mt)),ot&&(H["#text"]=!0),Ue&&addToSet(H,["html","head","body"]),H.table&&(addToSet(H,["tbody"]),delete Ee.tbody),q.TRUSTED_TYPES_POLICY){if(typeof q.TRUSTED_TYPES_POLICY.createHTML!="function")throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof q.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');V=q.TRUSTED_TYPES_POLICY,Q=V.createHTML("")}else V===void 0&&(V=_createTrustedTypesPolicy(M,p)),V!==null&&typeof Q=="string"&&(Q=V.createHTML(""));freeze&&freeze(q),dn=q}},Ut=addToSet({},[...svg$1,...svgFilters,...svgDisallowed]),$t=addToSet({},[...mathMl$1,...mathMlDisallowed]),vn=function(q){let ge=U(q);(!ge||!ge.tagName)&&(ge={namespaceURI:tt,tagName:"template"});const ye=stringToLowerCase(q.tagName),De=stringToLowerCase(ge.tagName);return fn[q.namespaceURI]?q.namespaceURI===bt?ge.namespaceURI===pt?ye==="svg":ge.namespaceURI===gn?ye==="svg"&&(De==="annotation-xml"||qt[De]):!!Ut[ye]:q.namespaceURI===gn?ge.namespaceURI===pt?ye==="math":ge.namespaceURI===bt?ye==="math"&&rt[De]:!!$t[ye]:q.namespaceURI===pt?ge.namespaceURI===bt&&!rt[De]||ge.namespaceURI===gn&&!qt[De]?!1:!$t[ye]&&(Jt[ye]||!Ut[ye]):!!(Ct==="application/xhtml+xml"&&fn[q.namespaceURI]):!1},Nt=function(q){arrayPush(i.removed,{element:q});try{U(q).removeChild(q)}catch{D(q)}},Ie=function(q,ge){try{arrayPush(i.removed,{attribute:ge.getAttributeNode(q),from:ge})}catch{arrayPush(i.removed,{attribute:null,from:ge})}if(ge.removeAttribute(q),q==="is")if(_n||Ye)try{Nt(ge)}catch{}else try{ge.setAttribute(q,"")}catch{}},kt=function(q){let ge=null,ye=null;if(un)q="<remove></remove>"+q;else{const Ce=stringMatch(q,/^[\r\n\t ]+/);ye=Ce&&Ce[0]}Ct==="application/xhtml+xml"&&tt===pt&&(q='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+q+"</body></html>");const De=V?V.createHTML(q):q;if(tt===pt)try{ge=new R().parseFromString(De,Ct)}catch{}if(!ge||!ge.documentElement){ge=Z.createDocument(tt,"template",null);try{ge.documentElement.innerHTML=nt?Q:De}catch{}}const He=ge.body||ge.documentElement;return q&&ye&&He.insertBefore(u.createTextNode(ye),He.childNodes[0]||null),tt===pt?ne.call(ge,Ue?"html":"body")[0]:Ue?ge.documentElement:He},tn=function(q){return F.call(q.ownerDocument||q,q,_.SHOW_ELEMENT|_.SHOW_COMMENT|_.SHOW_TEXT|_.SHOW_PROCESSING_INSTRUCTION|_.SHOW_CDATA_SECTION,null)},It=function(q){return q instanceof w&&(typeof q.nodeName!="string"||typeof q.textContent!="string"||typeof q.removeChild!="function"||!(q.attributes instanceof T)||typeof q.removeAttribute!="function"||typeof q.setAttribute!="function"||typeof q.namespaceURI!="string"||typeof q.insertBefore!="function"||typeof q.hasChildNodes!="function")},ht=function(q){return typeof x=="function"&&q instanceof x};function Ke(xe,q,ge){arrayForEach(xe,ye=>{ye.call(i,q,ge,dn)})}const nn=function(q){let ge=null;if(Ke(oe.beforeSanitizeElements,q,null),It(q))return Nt(q),!0;const ye=mt(q.nodeName);if(Ke(oe.uponSanitizeElement,q,{tagName:ye,allowedTags:H}),At&&q.hasChildNodes()&&!ht(q.firstElementChild)&&regExpTest(/<[/\w!]/g,q.innerHTML)&&regExpTest(/<[/\w!]/g,q.textContent)||q.nodeType===NODE_TYPE.progressingInstruction||At&&q.nodeType===NODE_TYPE.comment&&regExpTest(/<[/\w]/g,q.data))return Nt(q),!0;if(!(ke.tagCheck instanceof Function&&ke.tagCheck(ye))&&(!H[ye]||Ee[ye])){if(!Ee[ye]&&Ze(ye)&&(me.tagNameCheck instanceof RegExp&&regExpTest(me.tagNameCheck,ye)||me.tagNameCheck instanceof Function&&me.tagNameCheck(ye)))return!1;if(ot&&!Dt[ye]){const De=U(q)||q.parentNode,He=L(q)||q.childNodes;if(He&&De){const Ce=He.length;for(let Ne=Ce-1;Ne>=0;--Ne){const We=A(He[Ne],!0);We.__removalCount=(q.__removalCount||0)+1,De.insertBefore(We,z(q))}}}return Nt(q),!0}return q instanceof E&&!vn(q)||(ye==="noscript"||ye==="noembed"||ye==="noframes")&&regExpTest(/<\/no(script|embed|frames)/i,q.innerHTML)?(Nt(q),!0):(vt&&q.nodeType===NODE_TYPE.text&&(ge=q.textContent,arrayForEach([le,Se,ve],De=>{ge=stringReplace(ge,De," ")}),q.textContent!==ge&&(arrayPush(i.removed,{element:q.cloneNode()}),q.textContent=ge)),Ke(oe.afterSanitizeElements,q,null),!1)},Lt=function(q,ge,ye){if(wt&&(ge==="id"||ge==="name")&&(ye in u||ye in Kn))return!1;if(!(Ve&&!Te[ge]&&regExpTest(_e,ge))){if(!(Me&&regExpTest(K,ge))){if(!(ke.attributeCheck instanceof Function&&ke.attributeCheck(ge,q))){if(!ue[ge]||Te[ge]){if(!(Ze(q)&&(me.tagNameCheck instanceof RegExp&&regExpTest(me.tagNameCheck,q)||me.tagNameCheck instanceof Function&&me.tagNameCheck(q))&&(me.attributeNameCheck instanceof RegExp&&regExpTest(me.attributeNameCheck,ge)||me.attributeNameCheck instanceof Function&&me.attributeNameCheck(ge,q))||ge==="is"&&me.allowCustomizedBuiltInElements&&(me.tagNameCheck instanceof RegExp&&regExpTest(me.tagNameCheck,ye)||me.tagNameCheck instanceof Function&&me.tagNameCheck(ye))))return!1}else if(!Yn[ge]){if(!regExpTest(Ae,stringReplace(ye,te,""))){if(!((ge==="src"||ge==="xlink:href"||ge==="href")&&q!=="script"&&stringIndexOf(ye,"data:")===0&&pn[q])){if(!(ft&&!regExpTest(pe,stringReplace(ye,te,"")))){if(ye)return!1}}}}}}}return!0},Ze=function(q){return q!=="annotation-xml"&&stringMatch(q,Re)},jn=function(q){Ke(oe.beforeSanitizeAttributes,q,null);const{attributes:ge}=q;if(!ge||It(q))return;const ye={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ue,forceKeepAttr:void 0};let De=ge.length;for(;De--;){const He=ge[De],{name:Ce,namespaceURI:Ne,value:We}=He,Et=mt(Ce),ze=We;let ut=Ce==="value"?ze:stringTrim(ze);if(ye.attrName=Et,ye.attrValue=ut,ye.keepAttr=!0,ye.forceKeepAttr=void 0,Ke(oe.uponSanitizeAttribute,q,ye),ut=ye.attrValue,cn&&(Et==="id"||Et==="name")&&(Ie(Ce,q),ut=Tt+ut),At&&regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i,ut)){Ie(Ce,q);continue}if(Et==="attributename"&&stringMatch(ut,"href")){Ie(Ce,q);continue}if(ye.forceKeepAttr)continue;if(!ye.keepAttr){Ie(Ce,q);continue}if(!je&&regExpTest(/\/>/i,ut)){Ie(Ce,q);continue}vt&&arrayForEach([le,Se,ve],Ot=>{ut=stringReplace(ut,Ot," ")});const Ge=mt(q.nodeName);if(!Lt(Ge,Et,ut)){Ie(Ce,q);continue}if(V&&typeof M=="object"&&typeof M.getAttributeType=="function"&&!Ne)switch(M.getAttributeType(Ge,Et)){case"TrustedHTML":{ut=V.createHTML(ut);break}case"TrustedScriptURL":{ut=V.createScriptURL(ut);break}}if(ut!==ze)try{Ne?q.setAttributeNS(Ne,Ce,ut):q.setAttribute(Ce,ut),It(q)?Nt(q):arrayPop(i.removed)}catch{Ie(Ce,q)}}Ke(oe.afterSanitizeAttributes,q,null)},Dn=function xe(q){let ge=null;const ye=tn(q);for(Ke(oe.beforeSanitizeShadowDOM,q,null);ge=ye.nextNode();)Ke(oe.uponSanitizeShadowNode,ge,null),nn(ge),jn(ge),ge.content instanceof g&&xe(ge.content);Ke(oe.afterSanitizeShadowDOM,q,null)};return i.sanitize=function(xe){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=null,ye=null,De=null,He=null;if(nt=!xe,nt&&(xe="<!-->"),typeof xe!="string"&&!ht(xe))if(typeof xe.toString=="function"){if(xe=xe.toString(),typeof xe!="string")throw typeErrorCreate("dirty is not a string, aborting")}else throw typeErrorCreate("toString is not a function");if(!i.isSupported)return xe;if(dt||Zn(q),i.removed=[],typeof xe=="string"&&(An=!1),An){if(xe.nodeName){const We=mt(xe.nodeName);if(!H[We]||Ee[We])throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place")}}else if(xe instanceof x)ge=kt("<!---->"),ye=ge.ownerDocument.importNode(xe,!0),ye.nodeType===NODE_TYPE.element&&ye.nodeName==="BODY"||ye.nodeName==="HTML"?ge=ye:ge.appendChild(ye);else{if(!_n&&!vt&&!Ue&&xe.indexOf("<")===-1)return V&&Zt?V.createHTML(xe):xe;if(ge=kt(xe),!ge)return _n?null:Zt?Q:""}ge&&un&&Nt(ge.firstChild);const Ce=tn(An?xe:ge);for(;De=Ce.nextNode();)nn(De),jn(De),De.content instanceof g&&Dn(De.content);if(An)return xe;if(_n){if(Ye)for(He=Y.call(ge.ownerDocument);ge.firstChild;)He.appendChild(ge.firstChild);else He=ge;return(ue.shadowroot||ue.shadowrootmode)&&(He=fe.call(c,He,!0)),He}let Ne=Ue?ge.outerHTML:ge.innerHTML;return Ue&&H["!doctype"]&&ge.ownerDocument&&ge.ownerDocument.doctype&&ge.ownerDocument.doctype.name&&regExpTest(DOCTYPE_NAME,ge.ownerDocument.doctype.name)&&(Ne="<!DOCTYPE "+ge.ownerDocument.doctype.name+`>
121
+ `+Ne),vt&&arrayForEach([le,Se,ve],We=>{Ne=stringReplace(Ne,We," ")}),V&&Zt?V.createHTML(Ne):Ne},i.setConfig=function(){let xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zn(xe),dt=!0},i.clearConfig=function(){dn=null,dt=!1},i.isValidAttribute=function(xe,q,ge){dn||Zn({});const ye=mt(xe),De=mt(q);return Lt(ye,De,ge)},i.addHook=function(xe,q){typeof q=="function"&&arrayPush(oe[xe],q)},i.removeHook=function(xe,q){if(q!==void 0){const ge=arrayLastIndexOf(oe[xe],q);return ge===-1?void 0:arraySplice(oe[xe],ge,1)[0]}return arrayPop(oe[xe])},i.removeHooks=function(xe){oe[xe]=[]},i.removeAllHooks=function(){oe=_createHooksMap()},i}var purify=createDOMPurify();const HighlightLoadingInfo=({onClose:t})=>{const i=useTranslation();return jsxRuntimeExports.jsxs("div",{className:styles$1.highlightLoadingInfo,onClick:t,children:[jsxRuntimeExports.jsx("div",{className:styles$1.highlightLoadingInfoCloseIcon,children:jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:jsxRuntimeExports.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"})})}),jsxRuntimeExports.jsxs("div",{className:styles$1.highlightLoadingInfoInnerContainer,children:[jsxRuntimeExports.jsxs("div",{className:styles$1.highlightLoadingInfoContent,children:[jsxRuntimeExports.jsx("h3",{children:i("source-infos.highlight-loading.title")}),jsxRuntimeExports.jsx("p",{children:i("source-infos.highlight-loading.description")})]}),jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#000000",viewBox:"0 0 256 256",children:jsxRuntimeExports.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"})})]})]})},MarkdownLink=({title:t,href:i,children:u})=>jsxRuntimeExports.jsx("a",{href:i,title:t,target:"_blank",rel:"noopener noreferrer",children:u}),DefaultLinkButton=({className:t,children:i,...u})=>jsxRuntimeExports.jsx("a",{className:clsx(styles$g.button,styles$g.buttonDefault,t),type:"button",role:"button",...u,children:i}),Text=t=>jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...t,children:jsxRuntimeExports.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"})}),KnowledgeBaseTypeIcon=({type:t,...i})=>{switch(t){case"WEBSITE":return jsxRuntimeExports.jsx(Web,{...i});case"PDF":return jsxRuntimeExports.jsx(Pdf,{...i});case"DOCX":return jsxRuntimeExports.jsx(Docx,{...i});case"TEXT":return jsxRuntimeExports.jsx(Text,{...i});default:return jsxRuntimeExports.jsx(File$1,{...i})}},OpenButton=({url:t,knowledgeBaseType:i})=>{const u=useTranslation();return jsxRuntimeExports.jsx(DefaultLinkButton,{className:styles$1.openSourceButton,href:t,target:"_blank",children:jsxRuntimeExports.jsxs("div",{className:styles$1.sourceButtonLabel,children:[jsxRuntimeExports.jsx("div",{className:styles$1.sourceHeaderIcon,children:jsxRuntimeExports.jsx(KnowledgeBaseTypeIcon,{type:i})}),jsxRuntimeExports.jsx("p",{children:u("source-infos.open-source")})]})})},LoadedSourceInfos=({sourceInfos:{content:t,url:i,knowledgeBaseType:u,highlighted:c}})=>{const[p,g]=reactExports.useState(!c);reactExports.useEffect(()=>{c&&g(!1)},[c]);const v=purify.sanitize(t,{USE_PROFILES:{html:!0}});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:clsx(styles$1.sourceContent,markdownStyle.markdown),children:[jsxRuntimeExports.jsx(X5,{options:{overrides:{a:MarkdownLink}},children:v}),p&&jsxRuntimeExports.jsx(HighlightLoadingInfo,{onClose:()=>g(!1)})]}),jsxRuntimeExports.jsx(OpenButton,{url:i,knowledgeBaseType:u})]})},fixingError=""+new URL("undraw_fixing-bugs-D_eYxJc6.svg",import.meta.url).href,LoadingError=()=>{const t=useTranslation();return jsxRuntimeExports.jsxs("div",{className:styles$1.loadingError,children:[jsxRuntimeExports.jsx("h1",{children:t("source-infos.error.title")}),jsxRuntimeExports.jsx("img",{src:fixingError,title:t("source-infos.error.title")}),jsxRuntimeExports.jsx("p",{children:t("source-infos.error.info")})]})},LoadingSourceInfos=()=>jsxRuntimeExports.jsx("div",{className:styles$1.loadingSourceInfos,children:jsxRuntimeExports.jsx("svg",{className:styles$1.loading,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:jsxRuntimeExports.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 useSwipeToClose({sourceInfos:t,onClose:i,threshold:u=100}){const c=reactExports.useRef(null),[p,g]=reactExports.useState(0),[v,x]=reactExports.useState(!1),E=reactExports.useRef(null),_=reactExports.useRef(null),T=reactExports.useCallback(k=>{E.current=k,x(!0)},[]),w=reactExports.useCallback(k=>{if(E.current!==null&&v){const A=k-E.current;A>0&&g(A)}},[v]),R=reactExports.useCallback(()=>{x(!1),p>u&&i(),g(0),E.current=null},[p,u,i]),M=reactExports.useCallback(k=>{const A=Q=>T(Q.touches[0].clientY),D=Q=>w(Q.touches[0].clientY),z=()=>R(),L=Q=>{Q.preventDefault(),T(Q.clientY),window.addEventListener("mousemove",U),window.addEventListener("mouseup",V)},U=Q=>w(Q.clientY),V=()=>{R(),window.removeEventListener("mousemove",U),window.removeEventListener("mouseup",V)};k.addEventListener("touchstart",A),k.addEventListener("touchmove",D),k.addEventListener("touchend",z),k.addEventListener("mousedown",L),_.current=()=>{k.removeEventListener("touchstart",A),k.removeEventListener("touchmove",D),k.removeEventListener("touchend",z),k.removeEventListener("mousedown",L),window.removeEventListener("mousemove",U),window.removeEventListener("mouseup",V)}},[T,w,R]);return reactExports.useEffect(()=>{let k;return c.current?(_.current?.(),M(c.current)):(k=new MutationObserver(()=>{c.current&&(_.current?.(),M(c.current),k?.disconnect())}),k.observe(document.body,{childList:!0,subtree:!0})),()=>{k?.disconnect(),_.current?.()}},[M,t]),{ref:c,dragOffsetY:p,isDragging:v}}const useWaitForLoadingEffect=t=>{const[i,u]=reactExports.useState(!0);return reactExports.useEffect(()=>{let c=null;return t?.type==="loading"?(u(!0),c=setTimeout(()=>{u(!1)},300)):u(!t),()=>{c&&clearTimeout(c)}},[t]),i},SourceInfos=()=>{const t=useAppDispatch(),i=useAppSelector(E=>E.chat.sourceInfos),u=useIsSmallScreen(),c=reactExports.useRef(null),p=useWaitForLoadingEffect(i);reactExports.useEffect(()=>{c.current&&i?.type==="loading"&&(u?c.current.showModal():(c.current.setAttribute("open","true"),c.current?.focus()))},[i,u]);const g=reactExports.useCallback(()=>{c.current&&(u?c.current.close():c.current.removeAttribute("open"),t(closeSourceInfos()))},[t,u]),{ref:v,dragOffsetY:x}=useSwipeToClose({onClose:g,sourceInfos:i});return i?jsxRuntimeExports.jsx("dialog",{ref:c,className:clsx(styles$1.sourceInfos,p?styles$1.waitForLoading:i.type==="loading"?styles$1.loadingContent:""),style:u&&x?{transform:`translateY(${x}px)`}:{},onClose:g,autoFocus:!0,role:"dialog","aria-labelledby":"source-info-title",children:p?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Header,{ref:v,tabIndex:-1,sourceInfos:i.type==="loaded"?i:void 0,onClose:g}),i.type==="loading"?jsxRuntimeExports.jsx(LoadingSourceInfos,{}):i.type==="loading-error"?jsxRuntimeExports.jsx(LoadingError,{}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(HighlightLoader,{loading:!i.highlighted}),jsxRuntimeExports.jsx(LoadedSourceInfos,{sourceInfos:i})]})]})}):null},container$1="_container_1hnv6_1",body="_body_1hnv6_7",intro="_intro_1hnv6_14",footer="_footer_1hnv6_48",footnote="_footnote_1hnv6_52",containerWithFootnote="_containerWithFootnote_1hnv6_67",startChatButton="_startChatButton_1hnv6_82",spinner="_spinner_1hnv6_97",formFields="_formFields_1hnv6_101",formField="_formField_1hnv6_101",radio="_radio_1hnv6_113",checkbox="_checkbox_1hnv6_120",input="_input_1hnv6_128",inputLabel="_inputLabel_1hnv6_162",selectWrapper="_selectWrapper_1hnv6_166",select="_select_1hnv6_166",selectLabel="_selectLabel_1hnv6_212",styles={container:container$1,body,intro,footer,footnote,containerWithFootnote,startChatButton,spinner,formFields,formField,radio,checkbox,input,inputLabel,selectWrapper,select,selectLabel},Checkbox=({name:t,label:i,defaultValue:u,required:c,onChange:p})=>{const g=v=>{p(v.currentTarget.checked?"true":"false")};return jsxRuntimeExports.jsxs("label",{className:clsx(styles.checkbox,"chat__startScreen__checkbox"),htmlFor:t,children:[jsxRuntimeExports.jsx("input",{type:"checkbox",id:t,name:t,defaultChecked:u==="true",required:c,onChange:g}),jsxRuntimeExports.jsx("div",{children:i})]})},Input=({type:t,name:i,label:u,defaultValue:c,placeholder:p,required:g,multiple:v,min:x,max:E,pattern:_,onChange:T})=>{const w=R=>{T(R.target.value)};return jsxRuntimeExports.jsxs("label",{className:clsx(styles.input,"chat__startScreen__input"),htmlFor:i,children:[jsxRuntimeExports.jsx("div",{className:clsx(styles.inputLabel),children:u}),jsxRuntimeExports.jsx("input",{type:t,id:i,name:i,defaultValue:c,placeholder:p,required:g,multiple:v,min:x,max:E,pattern:_,onChange:w})]})},Radio=({name:t,value:i,label:u,defaultChecked:c,required:p,onChange:g})=>{const v=`${t}-${i}`,x=E=>{g(E.target.value)};return jsxRuntimeExports.jsxs("label",{className:clsx(styles.radio,"chat__startScreen__radio"),htmlFor:v,children:[jsxRuntimeExports.jsx("input",{id:v,type:"radio",name:t,value:i,defaultChecked:c,required:p,onChange:x}),jsxRuntimeExports.jsx("span",{className:clsx(styles.label),children:u})]})},Select=({name:t,label:i,defaultValue:u,required:c,multiple:p,options:g,onChange:v})=>{const x=E=>{v(E.target.value)};return jsxRuntimeExports.jsxs("label",{className:clsx(styles.select,"chat__startScreen__select"),htmlFor:t,children:[jsxRuntimeExports.jsx("div",{className:clsx(styles.selectLabel),children:i}),jsxRuntimeExports.jsx("div",{className:clsx(styles.selectWrapper),children:jsxRuntimeExports.jsx("select",{id:t,name:t,defaultValue:u,required:c,multiple:p,onChange:x,children:Object.entries(g||{}).map(([E,_])=>jsxRuntimeExports.jsx("option",{value:E,selected:_===u,children:_}))})})]})},INTRO_KEY="start-screen.intro",START_CHAT_KEY="start-screen.start-chat",WAITING_FOR_LOGIN_KEY="start-screen.waiting-for-login",FOOTNOTE_KEY="start-screen.footnote",FORM_KEY="start-screen.form",FORM_FIELDS_KEY=`${FORM_KEY}.fields`,StartScreen=()=>{const t=useTranslation(),i=useAppDispatch(),u=useClientName(),c=useAppSelector(k=>k.startScreen.loginRequestToken),p=useAppSelector(k=>k.settings.requiresUserAuthentication);reactExports.useEffect(()=>{let k;if(c){const z=window.screenX+(window.outerWidth-600)/2,L=window.screenY+(window.outerHeight-700)/2,U=encodeURIComponent(u),V=new URL(window.location.origin);V.pathname=`/${U}/auth/login`,V.searchParams.set("loginRequestToken",c);const Q=window.open(V.href,"Login",`width=600,height=700,left=${z},top=${L},resizable=yes,scrollbars=yes`);k=setInterval(()=>{Q?.closed&&(i(loginWindowClosed()),clearInterval(k))},500)}return()=>{k&&clearInterval(k)}},[u,c,i]);const[g,v]=reactExports.useState({}),x=()=>{const k=Object.entries(g).reduce((A,[D,z])=>({...A,[D]:z.value}),{});i(p?requestLogin({loginRequestToken:v4(),formValues:k}):startChat$1({formValues:k}))},E=t(INTRO_KEY),_=t(c?WAITING_FOR_LOGIN_KEY:START_CHAT_KEY),T=t(FOOTNOTE_KEY),w=reactExports.useMemo(()=>t(FORM_FIELDS_KEY)?.split(";").map(k=>k.trim())??[],[t(FORM_FIELDS_KEY)]);reactExports.useEffect(()=>{w.length&&Object.keys(g).length===0&&v(w.reduce((k,A)=>({...k,[A]:toFormField(A,t)}),{}))},[t,w,g]);const R=k=>{k.preventDefault(),x()},M=k=>A=>{v(D=>({...D,[k]:{...D[k],value:A}}))};return jsxRuntimeExports.jsxs("form",{onSubmit:R,className:clsx(styles.container,T&&styles.containerWithFootnote,"chat__startScreen"),children:[jsxRuntimeExports.jsxs("div",{className:clsx(styles.body,"chat__startScreen__body"),children:[E&&jsxRuntimeExports.jsx("div",{className:clsx(styles.intro,"chat__startScreen__intro"),children:jsxRuntimeExports.jsx(X5,{options:{overrides:{a:Link}},children:E})}),jsxRuntimeExports.jsx("div",{className:clsx(styles.formFields,"chat__startScreen__fields"),children:Object.values(g).map(({type:k,name:A,label:D,placeholder:z,defaultValue:L,options:U,required:V,multiple:Q,min:Z,max:F,pattern:Y})=>jsxRuntimeExports.jsx("div",{className:clsx(styles.formField,"chat__startScreen__field"),children:(()=>{switch(k){case"radio":return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{children:D}),Object.entries(U||{}).map(([ne,fe])=>jsxRuntimeExports.jsx(Radio,{name:A,value:ne,label:fe,defaultChecked:ne===L,required:V,onChange:M(A)},ne))]});case"checkbox":return jsxRuntimeExports.jsx(Checkbox,{name:A,label:D,defaultValue:L,required:V,onChange:M(A)});case"select":return jsxRuntimeExports.jsx(Select,{name:A,label:D,defaultValue:L,required:V,multiple:Q,options:U,onChange:M(A)});default:return jsxRuntimeExports.jsx(Input,{type:k,name:A,label:D,placeholder:z,defaultValue:L,required:V,multiple:Q,min:Z,max:F,pattern:Y,onChange:M(A)})}})()},A))})]}),jsxRuntimeExports.jsxs("div",{className:clsx(styles.footer,"chat__startScreen__footer"),children:[jsxRuntimeExports.jsxs(PrimaryButton,{type:"submit",className:styles.startChatButton,disabled:!!c,children:[!!c&&jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",className:styles.spinner,children:jsxRuntimeExports.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"})}),jsxRuntimeExports.jsx("div",{children:_})]}),T&&jsxRuntimeExports.jsx("div",{className:styles.footnote,children:jsxRuntimeExports.jsx(X5,{options:{overrides:{a:Link}},children:T})})]})]})},Link=({title:t,href:i,children:u})=>jsxRuntimeExports.jsx("a",{href:i,title:t,target:"_blank",rel:"noopener noreferrer",children:u}),toFormField=(t,i)=>{const u=i(`${FORM_KEY}.${t}.type`)||"text",c=i(`${FORM_KEY}.${t}.required`)==="true",p=i(`${FORM_KEY}.${t}.multiple`)==="true",g=i(`${FORM_KEY}.${t}.placeholder`),v=i(`${FORM_KEY}.${t}.label`)||"",x=i(`${FORM_KEY}.${t}.defaultValue`),E=i(`${FORM_KEY}.${t}.min`),_=i(`${FORM_KEY}.${t}.max`),T=i(`${FORM_KEY}.${t}.pattern`),w=toFormFieldOptions(i(`${FORM_KEY}.${t}.options`));return{name:t,label:v,placeholder:g,value:getTypeSpecificValue(u,x,w)||"",defaultValue:x,options:w,type:u,required:c,multiple:p,min:E,max:_,pattern:T}},getTypeSpecificValue=(t,i,u)=>i||t==="select"&&Object.keys(u)[0]||"",toFormFieldOptions=(t="")=>t.split(";").map(i=>i.trim()).reduce((i,u)=>{const[c,p]=u.split(":").map(g=>g.trim());return{...i,[c]:p}},{}),useSetDocumentLanguageEffect=()=>{const t=useAppSelector(i=>i.intl.locale);reactExports.useEffect(()=>{window.document.documentElement.lang=t},[t])},INCOMING_EVENTS={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"},RootScene=({clientName:t})=>{useSetDocumentLanguageEffect();const i=useAppDispatch(),u=useAppSelector(T=>T.intl.messages),c=useTranslation(),p=useAppSelector(T=>T.settings.enableStartScreen),g=useAppSelector(T=>T.startScreen.startScreenStatus),v=useAppSelector(T=>T.connection.queryString),x=reactExports.useMemo(()=>new URLSearchParams(v||"?").get("cssClassName"),[v]);reactExports.useEffect(()=>{const T=new URLSearchParams(v||""),w=Object.fromEntries(T.entries()),R=M=>{if(!(!M.data?.type||!Object.values(INCOMING_EVENTS).includes(M.data.type))){if(M.origin!==window.location.origin&&M.source!==window.parent){console.warn("Rejected postMessage from untrusted origin:",M.origin);return}switch(M.data.type){case INCOMING_EVENTS.TRIGGER_ACTION:i(M.data.action);break;case INCOMING_EVENTS.TRIGGER_STORY:i(requestNLUEvent(M.data.story));break;case INCOMING_EVENTS.ON_CHAT_WINDOW_OPEN:i({type:"webclient.chatwindow.opened"});break;case INCOMING_EVENTS.ON_CHAT_WINDOW_CLOSE:i({type:"webclient.chatwindow.closed"});break;case INCOMING_EVENTS.CHAT_MESSAGE_FROM_GUEST:i(sendMessageFromUser(M.data.text));break;case INCOMING_EVENTS.RESTART_CHAT:i(restartChat());break}}};return i(connect(t,w)),window.addEventListener("message",R,!1),()=>window.removeEventListener("message",R)},[t,v,i]),reactExports.useEffect(()=>{const T=c("page.title");T&&document&&(document.title=T)},[u,c]);const E=p===void 0,_=p===!1||g==="HIDDEN";return jsxRuntimeExports.jsx("div",{className:clsx(styles$2.chatwindow,_&&styles$2.chatwindowWithAside,"chat__chatwindow",x),children:E?null:_?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("header",{children:jsxRuntimeExports.jsx(Header$1,{chatStarted:!0})}),jsxRuntimeExports.jsx("main",{children:jsxRuntimeExports.jsx(Chat,{clientName:t})}),jsxRuntimeExports.jsx("aside",{children:jsxRuntimeExports.jsx(SourceInfos,{})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("header",{children:jsxRuntimeExports.jsx(Header$1,{chatStarted:!1})}),jsxRuntimeExports.jsx("main",{children:jsxRuntimeExports.jsx(StartScreen,{})})]})})},App=()=>{const t=useClientName(),i=useIsSmallScreen();return jsxRuntimeExports.jsx("div",{className:clsx([styles$o.app,i?"chat__small":"chat__large"]),children:jsxRuntimeExports.jsx(RootScene,{clientName:t})})},de={"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:
122
122
 
123
123
  - Der Chatverlauf wird im EU-Raum gespeichert und kann nur von autorisierten Personen eingesehen werden.
124
- - Geben Sie im Chatfenster keine persönlichen Daten ein (Passwörter, Geburtsdatum usw.).`,"general-conditions.accept-conditions-note":"Mit der Verwendung des Chats erklären Sie sich mit den Nutzungsbedingungen einverstanden.","block-user-input.title":"Bitte auf die Antwort des Chatbots warten.","conversation-rating.call-to-action.title":"Bewerten Sie diesen Chat","conversation-rating.overlay.title":"Wie zufrieden sind Sie mit diesem Chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Feedback bitte hier eingeben (optional)","conversation-rating.overlay.star.very-bad":"Sehr schlecht","conversation-rating.overlay.star.very-good":"Sehr gut","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"Durchschnitt ist nicht mein Ziel, was kann ich noch verbessern?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Knapp daneben ist auch vorbei. Was kann ich noch verbessern, um das nächste Mal alle Sterne zu erreichen?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfekt! Dann hoffe ich, dass ich Sie wieder einmal so gut beraten kann.","conversation-rating.overlay.bot-message.submit-feedback":"Vielen Dank für die Rückmeldung. Ich bin bestrebt, mich ständig zu verbessern.","conversation-rating.overlay.action.submit":"Bewertung senden","conversation-rating.overlay.action.back-to-chat":"Zurück zum Chat","conversation-rating.overlay.action.close-chat":"Chat minimieren","conversation-rating.overlay.action.restart-chat":"Chat neu starten","conversation-rating.overlay.action.cancel":"Abbrechen","start-screen.intro":"","start-screen.start-chat":"Chat starten","start-screen.waiting-for-login":"Warte auf Login ...","header.close-chat":"Chat minimieren","header.menu.title":"Menü","header.menu.restart-chat":"Chat neu starten","header.menu.expand-chat-window":"Fenster maximieren","header.menu.download-transcript":"Chatverlauf herunterladen","header.menu.send-transcript":"Chatverlauf versenden","header.menu.export-transcript":"Chatverlauf exportieren","header.menu.rate-conversation":"Chat bewerten","source-infos.close":"Schliessen","source-infos.open-source":"Quelle öffnen","source-infos.error.title":"Fehler","source-infos.error.info":"Oops! Etwas ist schiefgelaufen. Bitte versuche es erneut oder kontaktiere den Support, falls das Problem weiterhin besteht.","source-infos.highlight-loading.title":"Relevante Inhalte werden markiert...","source-infos.highlight-loading.description":"Einen Moment – die Quelle wird analysiert.","commands.show-more.action":"Weitere ...","commands.show-more.tooltip":"Weitere Befehle anzeigen","commands.show-less.action":"Weniger ...","commands.show-less.tooltip":"Weniger Befehle anzeigen"},en={"page.title":"Bubble Chat Chatbot","message-input-label":"User input","message-input-placeholder":"Enter a message","message-input.actions.submit.label":"Send message","message-input.actions.start-audio-recording.label":"Start voice input","message-input.actions.stop-audio-recording.label":"Stop voice input","message-input.actions.submit-audio-recording.label":"Transmit voice input","guest-bubble.label":"Your message","message-input.actions.command.label":"Perform action","bot-bubble.label":"Message from the chatbot","bot-bubble.actions.label":"Message actions","bot-bubble.reaction.good":"I like","bot-bubble.reaction.bad":"I don't like it","bot-bubble.reaction.remove":"Remove marker","bot-bubble.reaction.say-more":"Please tell us more","bot-bubble.reaction.category.WRONG_INFORMATION":"Wrong","bot-bubble.reaction.category.MISSING_INFORMATION":"Incomplete","bot-bubble.reaction.category.OLD_INFORMATION":"Outdated","bot-bubble.reaction.category.UNCLEAR":"Unclear","bot-bubble.reaction.category.OFF_TOPIC":"Not relevant to the question","bot-bubble.reaction.comment":"Share your thoughts with us...","bot-bubble.reaction.close":"Close","bot-bubble.copy":"Copy","bot-bubble.sources":"Source list","bot-bubble.source.open":"Open source","agent-bubble.label":"Message from the live agent","conversation.label":"Chat history","chatbot.typing":"Chatbot is typing","export-transcript.email.title":"Receive chat history","export-transcript.email.description":"Please enter the e-mail address to which the chat history should be sent.","export-transcript.email.cancel":"Cancel","export-transcript.email.send":"Send","export-transcript.email.placeholder":"E-mail address","export-transcript.email.invalid":"Please enter a valid e-mail address.","export-transcript.email.success":"The chat history was sent to the e-mail address provided.","general-conditions.header":"**Terms of use**","general-conditions.body":`Please consider the following points:
124
+ - Geben Sie im Chatfenster keine persönlichen Daten ein (Passwörter, Geburtsdatum usw.).`,"general-conditions.accept-conditions-note":"Mit der Verwendung des Chats erklären Sie sich mit den Nutzungsbedingungen einverstanden.","block-user-input.title":"Bitte auf die Antwort des Chatbots warten.","conversation-rating.call-to-action.title":"Bewerten Sie diesen Chat","conversation-rating.overlay.title":"Wie zufrieden sind Sie mit diesem Chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Feedback bitte hier eingeben (optional)","conversation-rating.overlay.star.very-bad":"Sehr schlecht","conversation-rating.overlay.star.very-good":"Sehr gut","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"Durchschnitt ist nicht mein Ziel, was kann ich noch verbessern?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Knapp daneben ist auch vorbei. Was kann ich noch verbessern, um das nächste Mal alle Sterne zu erreichen?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfekt! Dann hoffe ich, dass ich Sie wieder einmal so gut beraten kann.","conversation-rating.overlay.bot-message.submit-feedback":"Vielen Dank für die Rückmeldung. Ich bin bestrebt, mich ständig zu verbessern.","conversation-rating.overlay.action.submit":"Bewertung senden","conversation-rating.overlay.action.back-to-chat":"Zurück zum Chat","conversation-rating.overlay.action.close-chat":"Chat minimieren","conversation-rating.overlay.action.restart-chat":"Chat neu starten","conversation-rating.overlay.action.cancel":"Abbrechen","start-screen.intro":"","start-screen.start-chat":"Chat starten","start-screen.waiting-for-login":"Warte auf Login ...","header.close-chat":"Chat minimieren","header.menu.title":"Menü","header.menu.restart-chat":"Chat neu starten","header.menu.expand-chat-window":"Fenster maximieren","header.menu.download-transcript":"Chatverlauf herunterladen","header.menu.send-transcript":"Chatverlauf versenden","header.menu.export-transcript":"Chatverlauf exportieren","header.menu.rate-conversation":"Chat bewerten","source-infos.close":"Schliessen","source-infos.open-source":"Quelle öffnen","source-infos.error.title":"Fehler","source-infos.error.info":"Oops! Etwas ist schiefgelaufen. Bitte versuche es erneut oder kontaktiere den Support, falls das Problem weiterhin besteht.","source-infos.highlight-loading.title":"Relevante Inhalte werden markiert...","source-infos.highlight-loading.description":"Einen Moment – die Quelle wird analysiert.","commands.show-more.action":"Weitere ...","commands.show-more.tooltip":"Weitere Befehle anzeigen","commands.show-less.action":"Weniger ...","commands.show-less.tooltip":"Weniger Befehle anzeigen"},en={"page.title":"Bubble Chat Chatbot","message-input-label":"User input","message-input-placeholder":"Enter a message","message-input.actions.submit.label":"Send message","message-input.actions.start-audio-recording.label":"Start voice input","message-input.actions.stop-audio-recording.label":"Stop voice input","message-input.actions.submit-audio-recording.label":"Transmit voice input","guest-bubble.label":"Your message","message-input.actions.command.label":"Perform action","bot-bubble.label":"Message from the chatbot","bot-bubble.actions.label":"Message actions","bot-bubble.reaction.good":"I like","bot-bubble.reaction.bad":"I don't like it","bot-bubble.reaction.remove":"Remove marker","bot-bubble.reaction.say-more":"Please tell us more","bot-bubble.reaction.category.WRONG_INFORMATION":"Wrong","bot-bubble.reaction.category.MISSING_INFORMATION":"Incomplete","bot-bubble.reaction.category.OLD_INFORMATION":"Outdated","bot-bubble.reaction.category.UNCLEAR":"Unclear","bot-bubble.reaction.category.OFF_TOPIC":"Not relevant to the question","bot-bubble.reaction.comment":"Share your thoughts with us...","bot-bubble.reaction.close":"Close","bot-bubble.copy":"Copy","bot-bubble.sources":"Source list","bot-bubble.source.open":"Open source","bot-bubble.footnote":"Footnote","agent-bubble.label":"Message from the live agent","conversation.label":"Chat history","chatbot.typing":"Chatbot is typing","export-transcript.email.title":"Receive chat history","export-transcript.email.description":"Please enter the e-mail address to which the chat history should be sent.","export-transcript.email.cancel":"Cancel","export-transcript.email.send":"Send","export-transcript.email.placeholder":"E-mail address","export-transcript.email.invalid":"Please enter a valid e-mail address.","export-transcript.email.success":"The chat history was sent to the e-mail address provided.","general-conditions.header":"**Terms of use**","general-conditions.body":`Please consider the following points:
125
125
 
126
126
  - The chat history is stored in the EU area and can only be viewed by authorized personnel.
127
- - Do not enter any personal information in the chat window (passwords, date of birth, etc.)`,"general-conditions.accept-conditions-note":"By using the chat you agree to the terms of use.","block-user-input.title":"Please wait for the chatbot's response.","conversation-rating.call-to-action.title":"Rate this chat","conversation-rating.overlay.title":"How satisfied are you with this chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Please enter feedback here (optional)","conversation-rating.overlay.star.very-bad":"Very bad","conversation-rating.overlay.star.very-good":"Very good","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, that doesn't sound good. Please give me some feedback so that I can learn more.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, that doesn't sound good. Please give me some feedback so that I can learn more.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"Average is not my goal, what can I still improve?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Just missed is also over. What can I improve to achieve all stars next time?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfect! Then I hope that I can once again advise you so well.","conversation-rating.overlay.bot-message.submit-feedback":"Thank you for the feedback. I am constantly striving to improve.","conversation-rating.overlay.action.submit":"Send rating","conversation-rating.overlay.action.back-to-chat":"Close","conversation-rating.overlay.action.close-chat":"Minimize chat","conversation-rating.overlay.action.restart-chat":"Restart chat","conversation-rating.overlay.action.cancel":"Cancel","start-screen.intro":"","start-screen.start-chat":"Start chat","start-screen.waiting-for-login":"Waiting for login ...","header.close-chat":"Minimize chat","header.menu.title":"Menu","header.menu.restart-chat":"Restart chat","header.menu.expand-chat-window":"Maximize window","header.menu.download-transcript":"Download chat history","header.menu.export-transcript":"Export chat history","header.menu.send-transcript":"Send chat history","header.menu.rate-conversation":"Rate chat","source-infos.close":"Close","source-infos.open-source":"Open source","source-infos.error.title":"Error","source-infos.error.info":"Oops! Something went wrong. Please try again or contact support if the problem persists.","source-infos.highlight-loading.title":"Relevant content is highlighted...","source-infos.highlight-loading.description":"One moment - the source is being analyzed.","commands.show-more.action":"More","commands.show-more.tooltip":"Show more commands","commands.show-less.action":"Less","commands.show-less.tooltip":"Show less commands"};function flattenObject(t,i="",u="."){const c={};for(const p in t)if(Object.prototype.hasOwnProperty.call(t,p)){const g=t[p],v=i?`${i}${u}${p}`:p;g!==null&&typeof g=="object"&&!Array.isArray(g)?Object.assign(c,flattenObject(g,v,u)):c[v]=String(g)}return c}const fr={"page.title":"Bubble Chat Chatbot","message-input-label":"Input dell'utente","message-input-placeholder":"Saisir un message","message-input.actions.submit.label":"Envoyer un message","message-input.actions.start-audio-recording.label":"Démarrer la saisie vocale","message-input.actions.stop-audio-recording.label":"Arrêt de la saisie vocale","message-input.actions.submit-audio-recording.label":"Transmettre une entrée vocale","message-input.actions.command.label":"Exécuter l'action","guest-bubble.label":"Votre message","bot-bubble.label":"Message du chatbot","bot-bubble.actions.label":"Actions du message","bot-bubble.reaction.good":"J'aime bien","bot-bubble.reaction.bad":"Je n'aime pas","bot-bubble.reaction.remove":"Retirer le marqueur","bot-bubble.reaction.say-more":"Dis-nous en plus, s'il te plaît","bot-bubble.reaction.category.WRONG_INFORMATION":"Faux","bot-bubble.reaction.category.MISSING_INFORMATION":"Incomplet","bot-bubble.reaction.category.OLD_INFORMATION":"Obsolète","bot-bubble.reaction.category.UNCLEAR":"Peu clair","bot-bubble.reaction.category.OFF_TOPIC":"Hors sujet","bot-bubble.reaction.comment":"Partager ses pensées avec nous...","bot-bubble.reaction.close":"Fermer","bot-bubble.copy":"Copie","bot-bubble.sources":"Liste des sources","bot-bubble.source.open":"Ouvrir la source","agent-bubble.label":"Message de l'agent en direct","conversation.label":"Historique du chat","chatbot.typing":"Le chatbot écrit","export-transcript.email.title":"Recevoir l'historique du chat","export-transcript.email.description":"Veuillez indiquer l'adresse e-mail à laquelle l'historique de chat doit être envoyé.","export-transcript.email.cancel":"Annuler","export-transcript.email.send":"Envoyer","export-transcript.email.placeholder":"E-mail","export-transcript.email.invalid":"Veuillez entrer une adresse électronique valide.","export-transcript.email.success":"L'historique du chat a été envoyé à l'adresse e-mail fournie.","general-conditions.header":"**Conditions d'utilisation**","general-conditions.body":`Veuillez considérer les points suivants:
127
+ - Do not enter any personal information in the chat window (passwords, date of birth, etc.)`,"general-conditions.accept-conditions-note":"By using the chat you agree to the terms of use.","block-user-input.title":"Please wait for the chatbot's response.","conversation-rating.call-to-action.title":"Rate this chat","conversation-rating.overlay.title":"How satisfied are you with this chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Please enter feedback here (optional)","conversation-rating.overlay.star.very-bad":"Very bad","conversation-rating.overlay.star.very-good":"Very good","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, that doesn't sound good. Please give me some feedback so that I can learn more.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, that doesn't sound good. Please give me some feedback so that I can learn more.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"Average is not my goal, what can I still improve?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Just missed is also over. What can I improve to achieve all stars next time?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfect! Then I hope that I can once again advise you so well.","conversation-rating.overlay.bot-message.submit-feedback":"Thank you for the feedback. I am constantly striving to improve.","conversation-rating.overlay.action.submit":"Send rating","conversation-rating.overlay.action.back-to-chat":"Close","conversation-rating.overlay.action.close-chat":"Minimize chat","conversation-rating.overlay.action.restart-chat":"Restart chat","conversation-rating.overlay.action.cancel":"Cancel","start-screen.intro":"","start-screen.start-chat":"Start chat","start-screen.waiting-for-login":"Waiting for login ...","header.close-chat":"Minimize chat","header.menu.title":"Menu","header.menu.restart-chat":"Restart chat","header.menu.expand-chat-window":"Maximize window","header.menu.download-transcript":"Download chat history","header.menu.export-transcript":"Export chat history","header.menu.send-transcript":"Send chat history","header.menu.rate-conversation":"Rate chat","source-infos.close":"Close","source-infos.open-source":"Open source","source-infos.error.title":"Error","source-infos.error.info":"Oops! Something went wrong. Please try again or contact support if the problem persists.","source-infos.highlight-loading.title":"Relevant content is highlighted...","source-infos.highlight-loading.description":"One moment - the source is being analyzed.","commands.show-more.action":"More","commands.show-more.tooltip":"Show more commands","commands.show-less.action":"Less","commands.show-less.tooltip":"Show less commands"};function flattenObject(t,i="",u="."){const c={};for(const p in t)if(Object.prototype.hasOwnProperty.call(t,p)){const g=t[p],v=i?`${i}${u}${p}`:p;g!==null&&typeof g=="object"&&!Array.isArray(g)?Object.assign(c,flattenObject(g,v,u)):c[v]=String(g)}return c}const fr={"page.title":"Bubble Chat Chatbot","message-input-label":"Input dell'utente","message-input-placeholder":"Saisir un message","message-input.actions.submit.label":"Envoyer un message","message-input.actions.start-audio-recording.label":"Démarrer la saisie vocale","message-input.actions.stop-audio-recording.label":"Arrêt de la saisie vocale","message-input.actions.submit-audio-recording.label":"Transmettre une entrée vocale","message-input.actions.command.label":"Exécuter l'action","guest-bubble.label":"Votre message","bot-bubble.label":"Message du chatbot","bot-bubble.actions.label":"Actions du message","bot-bubble.reaction.good":"J'aime bien","bot-bubble.reaction.bad":"Je n'aime pas","bot-bubble.reaction.remove":"Retirer le marqueur","bot-bubble.reaction.say-more":"Dis-nous en plus, s'il te plaît","bot-bubble.reaction.category.WRONG_INFORMATION":"Faux","bot-bubble.reaction.category.MISSING_INFORMATION":"Incomplet","bot-bubble.reaction.category.OLD_INFORMATION":"Obsolète","bot-bubble.reaction.category.UNCLEAR":"Peu clair","bot-bubble.reaction.category.OFF_TOPIC":"Hors sujet","bot-bubble.reaction.comment":"Partager ses pensées avec nous...","bot-bubble.reaction.close":"Fermer","bot-bubble.copy":"Copie","bot-bubble.sources":"Liste des sources","bot-bubble.source.open":"Ouvrir la source","bot-bubble.footnote":"Note de bas de page","agent-bubble.label":"Message de l'agent en direct","conversation.label":"Historique du chat","chatbot.typing":"Le chatbot écrit","export-transcript.email.title":"Recevoir l'historique du chat","export-transcript.email.description":"Veuillez indiquer l'adresse e-mail à laquelle l'historique de chat doit être envoyé.","export-transcript.email.cancel":"Annuler","export-transcript.email.send":"Envoyer","export-transcript.email.placeholder":"E-mail","export-transcript.email.invalid":"Veuillez entrer une adresse électronique valide.","export-transcript.email.success":"L'historique du chat a été envoyé à l'adresse e-mail fournie.","general-conditions.header":"**Conditions d'utilisation**","general-conditions.body":`Veuillez considérer les points suivants:
128
128
 
129
129
  - L'historique du chat est stocké dans l'espace UE et ne peut être consulté que par les personnes autorisées.
130
- - Ne saisissez aucune information personnelle dans la fenêtre de chat (mots de passe, date de naissance, etc.).`,"general-conditions.accept-conditions-note":"En utilisant le chat, vous acceptez les conditions d'utilisation.","block-user-input.title":"Veuillez attendre la réponse du chatbot.","conversation-rating.call-to-action.title":"Notez ce chat","conversation-rating.overlay.title":"Dans quelle mesure êtes-vous satisfait de ce chat ?","conversation-rating.overlay.guest-feedback.input-placeholder":"Veuillez saisir vos commentaires ici (facultatif)","conversation-rating.overlay.star.very-bad":"Très mauvais","conversation-rating.overlay.star.very-good":"Très bien","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, ça ne sonne pas bien. Merci de me donner un feedback pour que je puisse en apprendre davantage.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, ça ne sonne pas bien. Merci de me donner un feedback pour que je puisse en apprendre davantage.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"La moyenne n'est pas mon objectif, que puis-je encore améliorer ?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Le rater de peu, c'est le rater aussi. Que puis-je encore améliorer pour obtenir toutes les étoiles la prochaine fois ?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Parfait ! Alors j'espère pouvoir vous conseiller aussi bien une fois de plus.","conversation-rating.overlay.bot-message.submit-feedback":"Merci beaucoup pour votre feed-back. Je m'efforce de m'améliorer en permanence.","conversation-rating.overlay.action.submit":"Envoyer","conversation-rating.overlay.action.back-to-chat":"Fermer","conversation-rating.overlay.action.close-chat":"Minimiser le chat","conversation-rating.overlay.action.restart-chat":"Redémarrer le chat","conversation-rating.overlay.action.cancel":"Annuler","start-screen.intro":"","start-screen.start-chat":"Démarrer le chat","start-screen.waiting-for-login":"En attente de connexion ...","header.close-chat":"Minimiser le chat","header.menu.title":"Menu","header.menu.restart-chat":"Redémarrer le chat","header.menu.expand-chat-window":"Agrandir la fenêtre","header.menu.download-transcript":"Télécharger l'historique du chat","header.menu.send-transcript":"Envoyer l'historique du chat","header.menu.export-transcript":"Exporter l'historique du chat","header.menu.rate-conversation":"Évaluer le chat","source-infos.close":"Fermer","source-infos.open-source":"Ouvrir source","source-infos.error.title":"Erreur","source-infos.error.info":"Oups ! Quelque chose s'est mal passé. Merci de réessayer ou de contacter le support si le problème persiste.","source-infos.highlight-loading.title":"Contenus pertinents en surbrillance...","source-infos.highlight-loading.description":"Un instant - la source est analysée","commands.show-more.action":"Plus","commands.show-more.tooltip":"Afficher plus de commandes","commands.show-less.action":"Moins","commands.show-less.tooltip":"Afficher moins de commandes"},it={"page.title":"Bubble Chat Chatbot","message-input-label":"Input dell'utente","message-input-placeholder":"Inserire un messaggio","message-input.actions.submit.label":"Invia messaggio","message-input.actions.start-audio-recording.label":"Avviare l'input vocale","message-input.actions.stop-audio-recording.label":"Interrompere l'input vocale","message-input.actions.submit-audio-recording.label":"Trasmettere l'input vocale","message-input.actions.command.label":"Esegui azione","guest-bubble.label":"Il tuo messaggio","bot-bubble.label":"Messaggio del chatbot","bot-bubble.actions.label":"Azioni del messaggio","bot-bubble.reaction.good":"Mi piace","bot-bubble.reaction.bad":"Non mi piace","bot-bubble.reaction.remove":"Rimuovere il marcatore","bot-bubble.reaction.say-more":"Disci più, per favore","bot-bubble.reaction.category.WRONG_INFORMATION":"Errate","bot-bubble.reaction.category.MISSING_INFORMATION":"Incompleto","bot-bubble.reaction.category.OLD_INFORMATION":"Obsoleta","bot-bubble.reaction.category.UNCLEAR":"Poco chiaro","bot-bubble.reaction.category.OFF_TOPIC":"Non pertinente alla domanda","bot-bubble.reaction.comment":"Condividete con noi i vostri pensieri...","bot-bubble.reaction.close":"Chiudere","bot-bubble.copy":"Copia","bot-bubble.sources":"Elenco delle fonti","bot-bubble.source.open":"Fonte aperta","agent-bubble.label":"Messaggio dell'agente dal vivo","conversation.label":"Cronologia chat","chatbot.typing":"Il chatbot sta scrivendo","export-transcript.email.title":"Ricevere la cronologia della chat","export-transcript.email.description":"Inserire l'indirizzo e-mail a cui inviare la cronologia della chat.","export-transcript.email.cancel":"Annulla","export-transcript.email.send":"Invia","export-transcript.email.placeholder":"E-mail","export-transcript.email.invalid":"Inserire un indirizzo e-mail valido.","export-transcript.email.success":"La cronologia della chat è stata inviata all'indirizzo e-mail fornito.","general-conditions.header":"**Condizioni di utilizzo**","general-conditions.body":`Si prega di considerare i seguenti punti:
130
+ - Ne saisissez aucune information personnelle dans la fenêtre de chat (mots de passe, date de naissance, etc.).`,"general-conditions.accept-conditions-note":"En utilisant le chat, vous acceptez les conditions d'utilisation.","block-user-input.title":"Veuillez attendre la réponse du chatbot.","conversation-rating.call-to-action.title":"Notez ce chat","conversation-rating.overlay.title":"Dans quelle mesure êtes-vous satisfait de ce chat ?","conversation-rating.overlay.guest-feedback.input-placeholder":"Veuillez saisir vos commentaires ici (facultatif)","conversation-rating.overlay.star.very-bad":"Très mauvais","conversation-rating.overlay.star.very-good":"Très bien","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, ça ne sonne pas bien. Merci de me donner un feedback pour que je puisse en apprendre davantage.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, ça ne sonne pas bien. Merci de me donner un feedback pour que je puisse en apprendre davantage.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"La moyenne n'est pas mon objectif, que puis-je encore améliorer ?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Le rater de peu, c'est le rater aussi. Que puis-je encore améliorer pour obtenir toutes les étoiles la prochaine fois ?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Parfait ! Alors j'espère pouvoir vous conseiller aussi bien une fois de plus.","conversation-rating.overlay.bot-message.submit-feedback":"Merci beaucoup pour votre feed-back. Je m'efforce de m'améliorer en permanence.","conversation-rating.overlay.action.submit":"Envoyer","conversation-rating.overlay.action.back-to-chat":"Fermer","conversation-rating.overlay.action.close-chat":"Minimiser le chat","conversation-rating.overlay.action.restart-chat":"Redémarrer le chat","conversation-rating.overlay.action.cancel":"Annuler","start-screen.intro":"","start-screen.start-chat":"Démarrer le chat","start-screen.waiting-for-login":"En attente de connexion ...","header.close-chat":"Minimiser le chat","header.menu.title":"Menu","header.menu.restart-chat":"Redémarrer le chat","header.menu.expand-chat-window":"Agrandir la fenêtre","header.menu.download-transcript":"Télécharger l'historique du chat","header.menu.send-transcript":"Envoyer l'historique du chat","header.menu.export-transcript":"Exporter l'historique du chat","header.menu.rate-conversation":"Évaluer le chat","source-infos.close":"Fermer","source-infos.open-source":"Ouvrir source","source-infos.error.title":"Erreur","source-infos.error.info":"Oups ! Quelque chose s'est mal passé. Merci de réessayer ou de contacter le support si le problème persiste.","source-infos.highlight-loading.title":"Contenus pertinents en surbrillance...","source-infos.highlight-loading.description":"Un instant - la source est analysée","commands.show-more.action":"Plus","commands.show-more.tooltip":"Afficher plus de commandes","commands.show-less.action":"Moins","commands.show-less.tooltip":"Afficher moins de commandes"},it={"page.title":"Bubble Chat Chatbot","message-input-label":"Input dell'utente","message-input-placeholder":"Inserire un messaggio","message-input.actions.submit.label":"Invia messaggio","message-input.actions.start-audio-recording.label":"Avviare l'input vocale","message-input.actions.stop-audio-recording.label":"Interrompere l'input vocale","message-input.actions.submit-audio-recording.label":"Trasmettere l'input vocale","message-input.actions.command.label":"Esegui azione","guest-bubble.label":"Il tuo messaggio","bot-bubble.label":"Messaggio del chatbot","bot-bubble.actions.label":"Azioni del messaggio","bot-bubble.reaction.good":"Mi piace","bot-bubble.reaction.bad":"Non mi piace","bot-bubble.reaction.remove":"Rimuovere il marcatore","bot-bubble.reaction.say-more":"Disci più, per favore","bot-bubble.reaction.category.WRONG_INFORMATION":"Errate","bot-bubble.reaction.category.MISSING_INFORMATION":"Incompleto","bot-bubble.reaction.category.OLD_INFORMATION":"Obsoleta","bot-bubble.reaction.category.UNCLEAR":"Poco chiaro","bot-bubble.reaction.category.OFF_TOPIC":"Non pertinente alla domanda","bot-bubble.reaction.comment":"Condividete con noi i vostri pensieri...","bot-bubble.reaction.close":"Chiudere","bot-bubble.copy":"Copia","bot-bubble.sources":"Elenco delle fonti","bot-bubble.source.open":"Fonte aperta","bot-bubble.footnote":"Nota a piè di pagina","agent-bubble.label":"Messaggio dell'agente dal vivo","conversation.label":"Cronologia chat","chatbot.typing":"Il chatbot sta scrivendo","export-transcript.email.title":"Ricevere la cronologia della chat","export-transcript.email.description":"Inserire l'indirizzo e-mail a cui inviare la cronologia della chat.","export-transcript.email.cancel":"Annulla","export-transcript.email.send":"Invia","export-transcript.email.placeholder":"E-mail","export-transcript.email.invalid":"Inserire un indirizzo e-mail valido.","export-transcript.email.success":"La cronologia della chat è stata inviata all'indirizzo e-mail fornito.","general-conditions.header":"**Condizioni di utilizzo**","general-conditions.body":`Si prega di considerare i seguenti punti:
131
131
 
132
132
  - La cronologia delle chat è memorizzata nell'area UE e può essere visualizzata solo da persone autorizzate.
133
133
  - 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"},supportedLocales=["de","en","fr","it"],initialState$3={locale:"de",messages:de},mergeMessages=(t,i)=>{if(supportedLocales.includes(t)){const u=getMessagesByLanguage(t),c=flattenObject(i);return{...u,...c}}return i},getMessagesByLanguage=t=>{switch(t.toString()){case"en":return en;case"fr":return fr;case"it":return it;default:return de}},backendConnectionReducer=(t=initialState$2,i)=>{switch(i.type){case CONNECTING:return Object.assign({},t,{connectionState:ConnectionStateEnum.CONNECTING});case CONNECTED:return Object.assign({},t,{connectionState:ConnectionStateEnum.CONNECTED});case DISCONNECTED:return Object.assign({},t,{connectionState:ConnectionStateEnum.DISCONNECTED});case RECONNECTED:return Object.assign({},t,{connectionState:ConnectionStateEnum.RECONNECTED});case RESTORE_SESSION_ID:return Object.assign({},t,{sessionId:i.sessionId});case START:return Object.assign({},t,{sessionId:i.payload.sessionId,userId:i.payload.userId});case TERMINATE_SESSION:return Object.assign({},t,{sessionId:void 0});default:return t}},initialState$2={connectionState:ConnectionStateEnum.DISCONNECTED,sessionId:void 0,userId:void 0,queryString:window.location.search},chatReducer=(t=initialState$1,i)=>{switch(i.type){case RESET_CHAT_STATE:return initialState$1;case START:return sendToParentPage({type:"webclient.chat.started"}),t;case TERMINATE_SESSION:return sendToParentPage({type:"webclient.chat.ended"}),t;case TYPING_ON:return Object.assign({},t,{isBotTyping:!0});case TYPING_OFF:return Object.assign({},t,{isBotTyping:!1});case MESSAGE_FROM_GUEST:case MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return appendMessageFromGuestToState(t,i.message);case MESSAGE_TO_GUEST:{sendToParentPage(i);const u=Object.assign({},i.message,{_id:i.meta.actionId}),c=t.messages.filter(p=>p._id===i.meta.actionId).length>0;return Object.assign({},t,{isBotTyping:!1,messages:c?t.messages:t.messages.concat([u]),quickReplies:u.quickReplies?u.quickReplies:[]})}case RESTORE_PREVIOUS_CHAT_MESSAGES:{const u=i.messages,c=u.length?u[u.length-1]:void 0;return Object.assign({},t,{isBotTyping:!1,messages:u,quickReplies:c?.quickReplies||[]})}case MESSAGE_TO_PARENT_PAGE:return sendToParentPage(i.message),t;case EVENT_TO_GUEST:return sendToParentPage(i.event),t;case DRAWER_OPEN:return Object.assign({},t,{drawerContentUrl:i.payload.parameters.contentUrl});case DRAWER_CLOSE:return Object.assign({},t,{drawerContentUrl:void 0});case GUEST_LOCALE_CHANGED:return Object.assign({},t,{locale:i.payload.locale});case EXPAND_WINDOW:return sendToParentPage(i),t;case CLOSE_WINDOW:return sendToParentPage(i),{...t,conversationRating:{...t.conversationRating,opener:void 0}};case RECEIVE_SPEECH_TRANSCRIPTION:{const u=new TextMessage$1(i.transcription,new GuestUser),c=Object.assign({},u,{_id:v4()});return appendMessageFromGuestToState(t,c)}case TRANSCRIPT_ITEM_GUEST_REACTION:{const u=t.messages.map(c=>c._id===i.payload.actionId?Object.assign({},c,i.payload.reaction?{reaction:{type:i.payload.reaction,category:i.payload.category,comment:i.payload.comment}}:{reaction:void 0}):c);return Object.assign({},t,{messages:u})}case ENABLE_CONVERSATION_RATING:{const u={enabled:!0,rating:i.payload.rating};return Object.assign({},t,{conversationRating:u})}case CONVERSATION_RATING_FROM_GUEST:{const u={...t.conversationRating,rating:i.payload};return Object.assign({},t,{conversationRating:u})}case SHOW_CONVERSATION_RATING_OVERLAY:{const u={...t.conversationRating,opener:i.payload.opener,...i.payload.defaultRating?{rating:{value:i.payload.defaultRating,feedback:t.conversationRating.rating?.feedback||""}}:{}};return Object.assign({},t,{conversationRating:u})}case HIDE_CONVERSATION_RATING_OVERLAY:{const u={...t.conversationRating,opener:void 0};return Object.assign({},t,{conversationRating:u})}case LOAD_SOURCE_INFOS_REQUEST:return{...t,sourceInfos:{type:"loading",chunkId:i.payload.chunkId}};case LOAD_SOURCE_INFOS_ERROR:{const{highlighted:u}=i.payload;return t.sourceInfos?.type==="loaded"&&u?{...t,sourceInfos:{...t.sourceInfos,highlighted:!0}}:{...t,sourceInfos:{type:"loading-error"}}}case LOAD_SOURCE_INFOS_RESPONSE:{const u=t.sourceInfos?.type,{chunkId:c,knowledgeBaseType:p,title:g,content:v,highlighted:x,url:E}=i.payload,_=t.sourceInfos?.type==="loading"||t.sourceInfos?.type==="loaded"?t.sourceInfos?.chunkId:void 0;return _&&_!==c?t:u==="loading"||u==="loaded"&&x?{...t,sourceInfos:{type:"loaded",chunkId:c,knowledgeBaseType:p,title:g,content:v,highlighted:x,url:E}}:t}case CLOSE_SOURCE_INFOS:return{...t,sourceInfos:void 0};case TOGGLE_TRANSCRIPT_MAIL_OVERLAY:return{...t,showTranscriptMailOverlay:!t.showTranscriptMailOverlay,conversationRating:{...t.conversationRating,opener:void 0}};default:return t}},appendMessageFromGuestToState=(t,i)=>{const u=t.messages[t.messages.length-1],c=u?.text===i.text;return u&&u.sender.type===i.sender.type&&c?t:Object.assign({},t,{messages:t.messages.concat([i]),quickReplies:[]})},sendToParentPage=t=>{isIframe()?window.top?.postMessage(t,"*"):t.type==="webclient.change.url"&&window.open(t.url)},isIframe=()=>typeof window<"u"&&window.self!==window.top,initialState$1={messages:[],quickReplies:[],isBotTyping:!1,showTranscriptMailOverlay:!1,conversationRating:{enabled:!1}},counterSlice=createSlice({name:"intl",initialState:initialState$3,reducers:{updateIntl:(t,i)=>{t.locale=i.payload.language,t.messages=i.payload.messages}}}),{updateIntl}=counterSlice.actions,intlReducer=counterSlice.reducer,initialState={version:void 0,requiresUserAuthentication:!1,enableStartScreen:void 0,enableStandaloneView:!1,enableTranscriptExportEmail:!1,enableTranscriptExportPdf:!1,enableGeneralConditions:!1,enableSpeechSupport:!1,commands:[],menuItems:[]},settingsSlice=createSlice({name:"settings",initialState,reducers:{setSettings(t,i){t.version&&t.version!==i.payload.version?(console.log("version changed, reloading chat window"),window.location.reload()):(t.version=i.payload.version,t.requiresUserAuthentication=i.payload.requiresUserAuthentication,t.enableStartScreen=i.payload.enableStartScreen,t.enableStandaloneView=i.payload.enableStandaloneView,t.enableTranscriptExportEmail=i.payload.enableTranscriptExportEmail,t.enableTranscriptExportPdf=i.payload.enableTranscriptExportPdf,t.enableGeneralConditions=i.payload.enableGeneralConditions,t.enableSpeechSupport=i.payload.enableSpeechSupport,t.commands=i.payload.commands,t.menuItems=i.payload.menuItems||[])}}}),{setSettings}=settingsSlice.actions,settingsSlice$1=settingsSlice.reducer,rootReducer=combineReducers({settings:settingsSlice$1,chat:chatReducer,startScreen:startScreenReducer,connection:backendConnectionReducer,intl:intlReducer}),LOCAL_STORAGE_ITEM_PREFIX="bubble-chat",LOCAL_STORAGE_LAST_SAVED_ITEM_NAME="state-last-saved-at",LOCAL_STORAGE_STATE_ITEM_NAME="state",loadState=t=>{try{if(!supportsLocalStorage())return;const i=getStoreItem(t,LOCAL_STORAGE_LAST_SAVED_ITEM_NAME);if(isExpired(i))return;{const u=getStoreItem(t,LOCAL_STORAGE_STATE_ITEM_NAME);if(u===null)return;const c=JSON.parse(u),p=c.connection?.queryString;if(p!==void 0&&!queryStringsMatchIgnoringReferrer(p,window.location.search)){console.log("Ignoring persisted state due to different query string");return}else return c}}catch(i){console.error(i);return}},saveState=(t,i)=>{try{const u=JSON.stringify(i);setStoreItem(t,LOCAL_STORAGE_STATE_ITEM_NAME,u);const c=new Date().toISOString();setStoreItem(t,LOCAL_STORAGE_LAST_SAVED_ITEM_NAME,c)}catch(u){console.error(u)}},isExpired=t=>{if(t===null)return!1;const i=new Date(t);return i.setHours(i.getHours()+12),new Date>i},supportsLocalStorage=()=>typeof localStorage<"u",getStoreItem=(t,i)=>{const u=getStoreItemName(t,i);return localStorage.getItem(u)},setStoreItem=(t,i,u)=>{const c=getStoreItemName(t,i);return localStorage.setItem(c,u)},getStoreItemName=(t,i)=>`${LOCAL_STORAGE_ITEM_PREFIX}-${t}-${i}`,queryStringsMatchIgnoringReferrer=(t,i)=>{const u=new URLSearchParams(t),c=new URLSearchParams(i);u.delete("referrer"),c.delete("referrer");const p=Array.from(u.entries()).sort(),g=Array.from(c.entries()).sort();return p.length!==g.length?!1:p.every(([v,x],E)=>{const[_,T]=g[E];return v===_&&x===T})},PACKET_TYPES=Object.create(null);PACKET_TYPES.open="0";PACKET_TYPES.close="1";PACKET_TYPES.ping="2";PACKET_TYPES.pong="3";PACKET_TYPES.message="4";PACKET_TYPES.upgrade="5";PACKET_TYPES.noop="6";const PACKET_TYPES_REVERSE=Object.create(null);Object.keys(PACKET_TYPES).forEach(t=>{PACKET_TYPES_REVERSE[PACKET_TYPES[t]]=t});const ERROR_PACKET={type:"error",data:"parser error"},withNativeBlob$1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",withNativeArrayBuffer$2=typeof ArrayBuffer=="function",isView$1=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,encodePacket=({type:t,data:i},u,c)=>withNativeBlob$1&&i instanceof Blob?u?c(i):encodeBlobAsBase64(i,c):withNativeArrayBuffer$2&&(i instanceof ArrayBuffer||isView$1(i))?u?c(i):encodeBlobAsBase64(new Blob([i]),c):c(PACKET_TYPES[t]+(i||"")),encodeBlobAsBase64=(t,i)=>{const u=new FileReader;return u.onload=function(){const c=u.result.split(",")[1];i("b"+(c||""))},u.readAsDataURL(t)};function toArray(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let TEXT_ENCODER;function encodePacketToBinary(t,i){if(withNativeBlob$1&&t.data instanceof Blob)return t.data.arrayBuffer().then(toArray).then(i);if(withNativeArrayBuffer$2&&(t.data instanceof ArrayBuffer||isView$1(t.data)))return i(toArray(t.data));encodePacket(t,!1,u=>{TEXT_ENCODER||(TEXT_ENCODER=new TextEncoder),i(TEXT_ENCODER.encode(u))})}const chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup$1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<chars.length;t++)lookup$1[chars.charCodeAt(t)]=t;const decode$1=t=>{let i=t.length*.75,u=t.length,c,p=0,g,v,x,E;t[t.length-1]==="="&&(i--,t[t.length-2]==="="&&i--);const _=new ArrayBuffer(i),T=new Uint8Array(_);for(c=0;c<u;c+=4)g=lookup$1[t.charCodeAt(c)],v=lookup$1[t.charCodeAt(c+1)],x=lookup$1[t.charCodeAt(c+2)],E=lookup$1[t.charCodeAt(c+3)],T[p++]=g<<2|v>>4,T[p++]=(v&15)<<4|x>>2,T[p++]=(x&3)<<6|E&63;return _},withNativeArrayBuffer$1=typeof ArrayBuffer=="function",decodePacket=(t,i)=>{if(typeof t!="string")return{type:"message",data:mapBinary(t,i)};const u=t.charAt(0);return u==="b"?{type:"message",data:decodeBase64Packet(t.substring(1),i)}:PACKET_TYPES_REVERSE[u]?t.length>1?{type:PACKET_TYPES_REVERSE[u],data:t.substring(1)}:{type:PACKET_TYPES_REVERSE[u]}:ERROR_PACKET},decodeBase64Packet=(t,i)=>{if(withNativeArrayBuffer$1){const u=decode$1(t);return mapBinary(u,i)}else return{base64:!0,data:t}},mapBinary=(t,i)=>i==="blob"?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,SEPARATOR="",encodePayload=(t,i)=>{const u=t.length,c=new Array(u);let p=0;t.forEach((g,v)=>{encodePacket(g,!1,x=>{c[v]=x,++p===u&&i(c.join(SEPARATOR))})})},decodePayload=(t,i)=>{const u=t.split(SEPARATOR),c=[];for(let p=0;p<u.length;p++){const g=decodePacket(u[p],i);if(c.push(g),g.type==="error")break}return c};function createPacketEncoderStream(){return new TransformStream({transform(t,i){encodePacketToBinary(t,u=>{const c=u.length;let p;if(c<126)p=new Uint8Array(1),new DataView(p.buffer).setUint8(0,c);else if(c<65536){p=new Uint8Array(3);const g=new DataView(p.buffer);g.setUint8(0,126),g.setUint16(1,c)}else{p=new Uint8Array(9);const g=new DataView(p.buffer);g.setUint8(0,127),g.setBigUint64(1,BigInt(c))}t.data&&typeof t.data!="string"&&(p[0]|=128),i.enqueue(p),i.enqueue(u)})}})}let TEXT_DECODER;function totalLength(t){return t.reduce((i,u)=>i+u.length,0)}function concatChunks(t,i){if(t[0].length===i)return t.shift();const u=new Uint8Array(i);let c=0;for(let p=0;p<i;p++)u[p]=t[0][c++],c===t[0].length&&(t.shift(),c=0);return t.length&&c<t[0].length&&(t[0]=t[0].slice(c)),u}function createPacketDecoderStream(t,i){TEXT_DECODER||(TEXT_DECODER=new TextDecoder);const u=[];let c=0,p=-1,g=!1;return new TransformStream({transform(v,x){for(u.push(v);;){if(c===0){if(totalLength(u)<1)break;const E=concatChunks(u,1);g=(E[0]&128)===128,p=E[0]&127,p<126?c=3:p===126?c=1:c=2}else if(c===1){if(totalLength(u)<2)break;const E=concatChunks(u,2);p=new DataView(E.buffer,E.byteOffset,E.length).getUint16(0),c=3}else if(c===2){if(totalLength(u)<8)break;const E=concatChunks(u,8),_=new DataView(E.buffer,E.byteOffset,E.length),T=_.getUint32(0);if(T>Math.pow(2,21)-1){x.enqueue(ERROR_PACKET);break}p=T*Math.pow(2,32)+_.getUint32(4),c=3}else{if(totalLength(u)<p)break;const E=concatChunks(u,p);x.enqueue(decodePacket(g?E:TEXT_DECODER.decode(E),i)),c=0}if(p===0||p>t){x.enqueue(ERROR_PACKET);break}}}})}const protocol$1=4;function Emitter(t){if(t)return mixin(t)}function mixin(t){for(var i in Emitter.prototype)t[i]=Emitter.prototype[i];return t}Emitter.prototype.on=Emitter.prototype.addEventListener=function(t,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(i),this};Emitter.prototype.once=function(t,i){function u(){this.off(t,u),i.apply(this,arguments)}return u.fn=i,this.on(t,u),this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(t,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var u=this._callbacks["$"+t];if(!u)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var c,p=0;p<u.length;p++)if(c=u[p],c===i||c.fn===i){u.splice(p,1);break}return u.length===0&&delete this._callbacks["$"+t],this};Emitter.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),u=this._callbacks["$"+t],c=1;c<arguments.length;c++)i[c-1]=arguments[c];if(u){u=u.slice(0);for(var c=0,p=u.length;c<p;++c)u[c].apply(this,i)}return this};Emitter.prototype.emitReserved=Emitter.prototype.emit;Emitter.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};Emitter.prototype.hasListeners=function(t){return!!this.listeners(t).length};const nextTick=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,u)=>u(i,0),globalThisShim=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),defaultBinaryType="arraybuffer";function createCookieJar(){}function pick(t,...i){return i.reduce((u,c)=>(t.hasOwnProperty(c)&&(u[c]=t[c]),u),{})}const NATIVE_SET_TIMEOUT=globalThisShim.setTimeout,NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(t,i){i.useNativeTimers?(t.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim),t.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)):(t.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim),t.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim))}const BASE64_OVERHEAD=1.33;function byteLength(t){return typeof t=="string"?utf8Length(t):Math.ceil((t.byteLength||t.size)*BASE64_OVERHEAD)}function utf8Length(t){let i=0,u=0;for(let c=0,p=t.length;c<p;c++)i=t.charCodeAt(c),i<128?u+=1:i<2048?u+=2:i<55296||i>=57344?u+=3:(c++,u+=4);return u}function randomString(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function encode(t){let i="";for(let u in t)t.hasOwnProperty(u)&&(i.length&&(i+="&"),i+=encodeURIComponent(u)+"="+encodeURIComponent(t[u]));return i}function decode(t){let i={},u=t.split("&");for(let c=0,p=u.length;c<p;c++){let g=u[c].split("=");i[decodeURIComponent(g[0])]=decodeURIComponent(g[1])}return i}class TransportError extends Error{constructor(i,u,c){super(i),this.description=u,this.context=c,this.type="TransportError"}}class Transport extends Emitter{constructor(i){super(),this.writable=!1,installTimerFunctions(this,i),this.opts=i,this.query=i.query,this.socket=i.socket,this.supportsBinary=!i.forceBase64}onError(i,u,c){return super.emitReserved("error",new TransportError(i,u,c)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const u=decodePacket(i,this.socket.binaryType);this.onPacket(u)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,u={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(u)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_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(i){const u=encode(i);return u.length?"?"+u:""}}class Polling extends Transport{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(i){this.readyState="pausing";const u=()=>{this.readyState="paused",i()};if(this._polling||!this.writable){let c=0;this._polling&&(c++,this.once("pollComplete",function(){--c||u()})),this.writable||(c++,this.once("drain",function(){--c||u()}))}else u()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const u=c=>{if(this.readyState==="opening"&&c.type==="open"&&this.onOpen(),c.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(c)};decodePayload(i,this.socket.binaryType).forEach(u),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const i=()=>{this.write([{type:"close"}])};this.readyState==="open"?i():this.once("open",i)}write(i){this.writable=!1,encodePayload(i,u=>{this.doWrite(u,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",u=this.query||{};return this.opts.timestampRequests!==!1&&(u[this.opts.timestampParam]=randomString()),!this.supportsBinary&&!u.sid&&(u.b64=1),this.createUri(i,u)}}let value=!1;try{value=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch(t){}const hasCORS=value;function empty(){}class BaseXHR extends Polling{constructor(i){if(super(i),typeof location<"u"){const u=location.protocol==="https:";let c=location.port;c||(c=u?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||c!==i.port}}doWrite(i,u){const c=this.request({method:"POST",data:i});c.on("success",u),c.on("error",(p,g)=>{this.onError("xhr post error",p,g)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(u,c)=>{this.onError("xhr poll error",u,c)}),this.pollXhr=i}}class Request extends Emitter{constructor(i,u,c){super(),this.createRequest=i,installTimerFunctions(this,c),this._opts=c,this._method=c.method||"GET",this._uri=u,this._data=c.data!==void 0?c.data:null,this._create()}_create(){var i;const u=pick(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");u.xdomain=!!this._opts.xd;const c=this._xhr=this.createRequest(u);try{c.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){c.setDisableHeaderCheck&&c.setDisableHeaderCheck(!0);for(let p in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(p)&&c.setRequestHeader(p,this._opts.extraHeaders[p])}}catch{}if(this._method==="POST")try{c.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{c.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(c),"withCredentials"in c&&(c.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(c.timeout=this._opts.requestTimeout),c.onreadystatechange=()=>{var p;c.readyState===3&&((p=this._opts.cookieJar)===null||p===void 0||p.parseCookies(c.getResponseHeader("set-cookie"))),c.readyState===4&&(c.status===200||c.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof c.status=="number"?c.status:0)},0))},c.send(this._data)}catch(p){this.setTimeoutFn(()=>{this._onError(p)},0);return}typeof document<"u"&&(this._index=Request.requestsCount++,Request.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=empty,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Request.requests[this._index],this._xhr=null}}_onLoad(){const i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Request.requestsCount=0;Request.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",unloadHandler);else if(typeof addEventListener=="function"){const t="onpagehide"in globalThisShim?"pagehide":"unload";addEventListener(t,unloadHandler,!1)}}function unloadHandler(){for(let t in Request.requests)Request.requests.hasOwnProperty(t)&&Request.requests[t].abort()}const hasXHR2=(function(){const t=newRequest({xdomain:!1});return t&&t.responseType!==null})();class XHR extends BaseXHR{constructor(i){super(i);const u=i&&i.forceBase64;this.supportsBinary=hasXHR2&&!u}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new Request(newRequest,this.uri(),i)}}function newRequest(t){const i=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||hasCORS))return new XMLHttpRequest}catch{}if(!i)try{return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class BaseWS extends Transport{get name(){return"websocket"}doOpen(){const i=this.uri(),u=this.opts.protocols,c=isReactNative?{}:pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(c.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(i,u,c)}catch(p){return this.emitReserved("error",p)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=i=>this.onClose({description:"websocket connection closed",context:i}),this.ws.onmessage=i=>this.onData(i.data),this.ws.onerror=i=>this.onError("websocket error",i)}write(i){this.writable=!1;for(let u=0;u<i.length;u++){const c=i[u],p=u===i.length-1;encodePacket(c,this.supportsBinary,g=>{try{this.doWrite(c,g)}catch{}p&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const i=this.opts.secure?"wss":"ws",u=this.query||{};return this.opts.timestampRequests&&(u[this.opts.timestampParam]=randomString()),this.supportsBinary||(u.b64=1),this.createUri(i,u)}}const WebSocketCtor=globalThisShim.WebSocket||globalThisShim.MozWebSocket;class WS extends BaseWS{createSocket(i,u,c){return isReactNative?new WebSocketCtor(i,u,c):u?new WebSocketCtor(i,u):new WebSocketCtor(i)}doWrite(i,u){this.ws.send(u)}}class WT extends Transport{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(i){return this.emitReserved("error",i)}this._transport.closed.then(()=>{this.onClose()}).catch(i=>{this.onError("webtransport error",i)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(i=>{const u=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),c=i.readable.pipeThrough(u).getReader(),p=createPacketEncoderStream();p.readable.pipeTo(i.writable),this._writer=p.writable.getWriter();const g=()=>{c.read().then(({done:x,value:E})=>{x||(this.onPacket(E),g())}).catch(x=>{})};g();const v={type:"open"};this.query.sid&&(v.data=`{"sid":"${this.query.sid}"}`),this._writer.write(v).then(()=>this.onOpen())})})}write(i){this.writable=!1;for(let u=0;u<i.length;u++){const c=i[u],p=u===i.length-1;this._writer.write(c).then(()=>{p&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const transports={websocket:WS,webtransport:WT,polling:XHR},re=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function parse(t){if(t.length>8e3)throw"URI too long";const i=t,u=t.indexOf("["),c=t.indexOf("]");u!=-1&&c!=-1&&(t=t.substring(0,u)+t.substring(u,c).replace(/:/g,";")+t.substring(c,t.length));let p=re.exec(t||""),g={},v=14;for(;v--;)g[parts[v]]=p[v]||"";return u!=-1&&c!=-1&&(g.source=i,g.host=g.host.substring(1,g.host.length-1).replace(/;/g,":"),g.authority=g.authority.replace("[","").replace("]","").replace(/;/g,":"),g.ipv6uri=!0),g.pathNames=pathNames(g,g.path),g.queryKey=queryKey(g,g.query),g}function pathNames(t,i){const u=/\/{2,9}/g,c=i.replace(u,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&c.splice(0,1),i.slice(-1)=="/"&&c.splice(c.length-1,1),c}function queryKey(t,i){const u={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(c,p,g){p&&(u[p]=g)}),u}const withEventListeners=typeof addEventListener=="function"&&typeof removeEventListener=="function",OFFLINE_EVENT_LISTENERS=[];withEventListeners&&addEventListener("offline",()=>{OFFLINE_EVENT_LISTENERS.forEach(t=>t())},!1);class SocketWithoutUpgrade extends Emitter{constructor(i,u){if(super(),this.binaryType=defaultBinaryType,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(u=i,i=null),i){const c=parse(i);u.hostname=c.host,u.secure=c.protocol==="https"||c.protocol==="wss",u.port=c.port,c.query&&(u.query=c.query)}else u.host&&(u.hostname=parse(u.host).host);installTimerFunctions(this,u),this.secure=u.secure!=null?u.secure:typeof location<"u"&&location.protocol==="https:",u.hostname&&!u.port&&(u.port=this.secure?"443":"80"),this.hostname=u.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=u.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},u.transports.forEach(c=>{const p=c.prototype.name;this.transports.push(p),this._transportsByName[p]=c}),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},u),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=decode(this.opts.query)),withEventListeners&&(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"})},OFFLINE_EVENT_LISTENERS.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const u=Object.assign({},this.opts.query);u.EIO=protocol$1,u.transport=i,this.id&&(u.sid=this.id);const c=Object.assign({},this.opts,{query:u,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](c)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const i=this.opts.rememberUpgrade&&SocketWithoutUpgrade.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const u=this.createTransport(i);u.open(),this.setTransport(u)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",u=>this._onClose("transport close",u))}onOpen(){this.readyState="open",SocketWithoutUpgrade.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const u=new Error("server error");u.code=i.data,this._onError(u);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let u=1;for(let c=0;c<this.writeBuffer.length;c++){const p=this.writeBuffer[c].data;if(p&&(u+=byteLength(p)),c>0&&u>this._maxPayload)return this.writeBuffer.slice(0,c);u+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,nextTick(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,u,c){return this._sendPacket("message",i,u,c),this}send(i,u,c){return this._sendPacket("message",i,u,c),this}_sendPacket(i,u,c,p){if(typeof u=="function"&&(p=u,u=void 0),typeof c=="function"&&(p=c,c=null),this.readyState==="closing"||this.readyState==="closed")return;c=c||{},c.compress=c.compress!==!1;const g={type:i,data:u,options:c};this.emitReserved("packetCreate",g),this.writeBuffer.push(g),p&&this.once("flush",p),this.flush()}close(){const i=()=>{this._onClose("forced close"),this.transport.close()},u=()=>{this.off("upgrade",u),this.off("upgradeError",u),i()},c=()=>{this.once("upgrade",u),this.once("upgradeError",u)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?c():i()}):this.upgrading?c():i()),this}_onError(i){if(SocketWithoutUpgrade.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,u){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(),withEventListeners&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const c=OFFLINE_EVENT_LISTENERS.indexOf(this._offlineEventListener);c!==-1&&OFFLINE_EVENT_LISTENERS.splice(c,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,u),this.writeBuffer=[],this._prevBufferLen=0}}}SocketWithoutUpgrade.protocol=protocol$1;class SocketWithUpgrade extends SocketWithoutUpgrade{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let i=0;i<this._upgrades.length;i++)this._probe(this._upgrades[i])}_probe(i){let u=this.createTransport(i),c=!1;SocketWithoutUpgrade.priorWebsocketSuccess=!1;const p=()=>{c||(u.send([{type:"ping",data:"probe"}]),u.once("packet",w=>{if(!c)if(w.type==="pong"&&w.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",u),!u)return;SocketWithoutUpgrade.priorWebsocketSuccess=u.name==="websocket",this.transport.pause(()=>{c||this.readyState!=="closed"&&(T(),this.setTransport(u),u.send([{type:"upgrade"}]),this.emitReserved("upgrade",u),u=null,this.upgrading=!1,this.flush())})}else{const R=new Error("probe error");R.transport=u.name,this.emitReserved("upgradeError",R)}}))};function g(){c||(c=!0,T(),u.close(),u=null)}const v=w=>{const R=new Error("probe error: "+w);R.transport=u.name,g(),this.emitReserved("upgradeError",R)};function x(){v("transport closed")}function E(){v("socket closed")}function _(w){u&&w.name!==u.name&&g()}const T=()=>{u.removeListener("open",p),u.removeListener("error",v),u.removeListener("close",x),this.off("close",E),this.off("upgrading",_)};u.once("open",p),u.once("error",v),u.once("close",x),this.once("close",E),this.once("upgrading",_),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{c||u.open()},200):u.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const u=[];for(let c=0;c<i.length;c++)~this.transports.indexOf(i[c])&&u.push(i[c]);return u}}let Socket$1=class extends SocketWithUpgrade{constructor(i,u={}){const c=typeof i=="object"?i:u;(!c.transports||c.transports&&typeof c.transports[0]=="string")&&(c.transports=(c.transports||["polling","websocket","webtransport"]).map(p=>transports[p]).filter(p=>!!p)),super(i,c)}};function url(t,i="",u){let c=t;u=u||typeof location<"u"&&location,t==null&&(t=u.protocol+"//"+u.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=u.protocol+t:t=u.host+t),/^(https?|wss?):\/\//.test(t)||(typeof u<"u"?t=u.protocol+"//"+t:t="https://"+t),c=parse(t)),c.port||(/^(http|ws)$/.test(c.protocol)?c.port="80":/^(http|ws)s$/.test(c.protocol)&&(c.port="443")),c.path=c.path||"/";const g=c.host.indexOf(":")!==-1?"["+c.host+"]":c.host;return c.id=c.protocol+"://"+g+":"+c.port+i,c.href=c.protocol+"://"+g+(u&&u.port===c.port?"":":"+c.port),c}const withNativeArrayBuffer=typeof ArrayBuffer=="function",isView=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,toString=Object.prototype.toString,withNativeBlob=typeof Blob=="function"||typeof Blob<"u"&&toString.call(Blob)==="[object BlobConstructor]",withNativeFile=typeof File=="function"||typeof File<"u"&&toString.call(File)==="[object FileConstructor]";function isBinary(t){return withNativeArrayBuffer&&(t instanceof ArrayBuffer||isView(t))||withNativeBlob&&t instanceof Blob||withNativeFile&&t instanceof File}function hasBinary(t,i){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let u=0,c=t.length;u<c;u++)if(hasBinary(t[u]))return!0;return!1}if(isBinary(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return hasBinary(t.toJSON(),!0);for(const u in t)if(Object.prototype.hasOwnProperty.call(t,u)&&hasBinary(t[u]))return!0;return!1}function deconstructPacket(t){const i=[],u=t.data,c=t;return c.data=_deconstructPacket(u,i),c.attachments=i.length,{packet:c,buffers:i}}function _deconstructPacket(t,i){if(!t)return t;if(isBinary(t)){const u={_placeholder:!0,num:i.length};return i.push(t),u}else if(Array.isArray(t)){const u=new Array(t.length);for(let c=0;c<t.length;c++)u[c]=_deconstructPacket(t[c],i);return u}else if(typeof t=="object"&&!(t instanceof Date)){const u={};for(const c in t)Object.prototype.hasOwnProperty.call(t,c)&&(u[c]=_deconstructPacket(t[c],i));return u}return t}function reconstructPacket(t,i){return t.data=_reconstructPacket(t.data,i),delete t.attachments,t}function _reconstructPacket(t,i){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<i.length)return i[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let u=0;u<t.length;u++)t[u]=_reconstructPacket(t[u],i);else if(typeof t=="object")for(const u in t)Object.prototype.hasOwnProperty.call(t,u)&&(t[u]=_reconstructPacket(t[u],i));return t}const RESERVED_EVENTS$1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],protocol=5;var PacketType;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(PacketType||(PacketType={}));class Encoder{constructor(i){this.replacer=i}encode(i){return(i.type===PacketType.EVENT||i.type===PacketType.ACK)&&hasBinary(i)?this.encodeAsBinary({type:i.type===PacketType.EVENT?PacketType.BINARY_EVENT:PacketType.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let u=""+i.type;return(i.type===PacketType.BINARY_EVENT||i.type===PacketType.BINARY_ACK)&&(u+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(u+=i.nsp+","),i.id!=null&&(u+=i.id),i.data!=null&&(u+=JSON.stringify(i.data,this.replacer)),u}encodeAsBinary(i){const u=deconstructPacket(i),c=this.encodeAsString(u.packet),p=u.buffers;return p.unshift(c),p}}class Decoder extends Emitter{constructor(i){super(),this.reviver=i}add(i){let u;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");u=this.decodeString(i);const c=u.type===PacketType.BINARY_EVENT;c||u.type===PacketType.BINARY_ACK?(u.type=c?PacketType.EVENT:PacketType.ACK,this.reconstructor=new BinaryReconstructor(u),u.attachments===0&&super.emitReserved("decoded",u)):super.emitReserved("decoded",u)}else if(isBinary(i)||i.base64)if(this.reconstructor)u=this.reconstructor.takeBinaryData(i),u&&(this.reconstructor=null,super.emitReserved("decoded",u));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let u=0;const c={type:Number(i.charAt(0))};if(PacketType[c.type]===void 0)throw new Error("unknown packet type "+c.type);if(c.type===PacketType.BINARY_EVENT||c.type===PacketType.BINARY_ACK){const g=u+1;for(;i.charAt(++u)!=="-"&&u!=i.length;);const v=i.substring(g,u);if(v!=Number(v)||i.charAt(u)!=="-")throw new Error("Illegal attachments");c.attachments=Number(v)}if(i.charAt(u+1)==="/"){const g=u+1;for(;++u&&!(i.charAt(u)===","||u===i.length););c.nsp=i.substring(g,u)}else c.nsp="/";const p=i.charAt(u+1);if(p!==""&&Number(p)==p){const g=u+1;for(;++u;){const v=i.charAt(u);if(v==null||Number(v)!=v){--u;break}if(u===i.length)break}c.id=Number(i.substring(g,u+1))}if(i.charAt(++u)){const g=this.tryParse(i.substr(u));if(Decoder.isPayloadValid(c.type,g))c.data=g;else throw new Error("invalid payload")}return c}tryParse(i){try{return JSON.parse(i,this.reviver)}catch{return!1}}static isPayloadValid(i,u){switch(i){case PacketType.CONNECT:return isObject(u);case PacketType.DISCONNECT:return u===void 0;case PacketType.CONNECT_ERROR:return typeof u=="string"||isObject(u);case PacketType.EVENT:case PacketType.BINARY_EVENT:return Array.isArray(u)&&(typeof u[0]=="number"||typeof u[0]=="string"&&RESERVED_EVENTS$1.indexOf(u[0])===-1);case PacketType.ACK:case PacketType.BINARY_ACK:return Array.isArray(u)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class BinaryReconstructor{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const u=reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),u}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function isNamespaceValid(t){return typeof t=="string"}const isInteger=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};function isAckIdValid(t){return t===void 0||isInteger(t)}function isObject(t){return Object.prototype.toString.call(t)==="[object Object]"}function isDataValid(t,i){switch(t){case PacketType.CONNECT:return i===void 0||isObject(i);case PacketType.DISCONNECT:return i===void 0;case PacketType.EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&RESERVED_EVENTS$1.indexOf(i[0])===-1);case PacketType.ACK:return Array.isArray(i);case PacketType.CONNECT_ERROR:return typeof i=="string"||isObject(i);default:return!1}}function isPacketValid(t){return isNamespaceValid(t.nsp)&&isAckIdValid(t.id)&&isDataValid(t.type,t.data)}const parser=Object.freeze(Object.defineProperty({__proto__:null,Decoder,Encoder,get PacketType(){return PacketType},isPacketValid,protocol},Symbol.toStringTag,{value:"Module"}));function on(t,i,u){return t.on(i,u),function(){t.off(i,u)}}const RESERVED_EVENTS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Socket extends Emitter{constructor(i,u,c){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=i,this.nsp=u,c&&c.auth&&(this.auth=c.auth),this._opts=Object.assign({},c),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const i=this.io;this.subs=[on(i,"open",this.onopen.bind(this)),on(i,"packet",this.onpacket.bind(this)),on(i,"error",this.onerror.bind(this)),on(i,"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(...i){return i.unshift("message"),this.emit.apply(this,i),this}emit(i,...u){var c,p,g;if(RESERVED_EVENTS.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(u.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(u),this;const v={type:PacketType.EVENT,data:u};if(v.options={},v.options.compress=this.flags.compress!==!1,typeof u[u.length-1]=="function"){const T=this.ids++,w=u.pop();this._registerAckCallback(T,w),v.id=T}const x=(p=(c=this.io.engine)===null||c===void 0?void 0:c.transport)===null||p===void 0?void 0:p.writable,E=this.connected&&!(!((g=this.io.engine)===null||g===void 0)&&g._hasPingExpired());return this.flags.volatile&&!x||(E?(this.notifyOutgoingListeners(v),this.packet(v)):this.sendBuffer.push(v)),this.flags={},this}_registerAckCallback(i,u){var c;const p=(c=this.flags.timeout)!==null&&c!==void 0?c:this._opts.ackTimeout;if(p===void 0){this.acks[i]=u;return}const g=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let x=0;x<this.sendBuffer.length;x++)this.sendBuffer[x].id===i&&this.sendBuffer.splice(x,1);u.call(this,new Error("operation has timed out"))},p),v=(...x)=>{this.io.clearTimeoutFn(g),u.apply(this,x)};v.withError=!0,this.acks[i]=v}emitWithAck(i,...u){return new Promise((c,p)=>{const g=(v,x)=>v?p(v):c(x);g.withError=!0,u.push(g),this.emit(i,...u)})}_addToQueue(i){let u;typeof i[i.length-1]=="function"&&(u=i.pop());const c={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((p,...g)=>(this._queue[0],p!==null?c.tryCount>this._opts.retries&&(this._queue.shift(),u&&u(p)):(this._queue.shift(),u&&u(null,...g)),c.pending=!1,this._drainQueue())),this._queue.push(c),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const u=this._queue[0];u.pending&&!i||(u.pending=!0,u.tryCount++,this.flags=u.flags,this.emit.apply(this,u.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,u){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,u),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(i=>{if(!this.sendBuffer.some(c=>String(c.id)===i)){const c=this.acks[i];delete this.acks[i],c.withError&&c.call(this,new Error("socket has been disconnected"))}})}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case PacketType.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case PacketType.EVENT:case PacketType.BINARY_EVENT:this.onevent(i);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(i);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const c=new Error(i.data.message);c.data=i.data.data,this.emitReserved("connect_error",c);break}}onevent(i){const u=i.data||[];i.id!=null&&u.push(this.ack(i.id)),this.connected?this.emitEvent(u):this.receiveBuffer.push(Object.freeze(u))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const u=this._anyListeners.slice();for(const c of u)c.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const u=this;let c=!1;return function(...p){c||(c=!0,u.packet({type:PacketType.ACK,id:i,data:p}))}}onack(i){const u=this.acks[i.id];typeof u=="function"&&(delete this.acks[i.id],u.withError&&i.data.unshift(null),u.apply(this,i.data))}onconnect(i,u){this.id=i,this.recovered=u&&this._pid===u,this._pid=u,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const u=this._anyListeners;for(let c=0;c<u.length;c++)if(i===u[c])return u.splice(c,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const u=this._anyOutgoingListeners;for(let c=0;c<u.length;c++)if(i===u[c])return u.splice(c,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const u=this._anyOutgoingListeners.slice();for(const c of u)c.apply(this,i.data)}}}function Backoff(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),u=Math.floor(i*this.jitter*t);t=(Math.floor(i*10)&1)==0?t-u:t+u}return Math.min(t,this.max)|0};Backoff.prototype.reset=function(){this.attempts=0};Backoff.prototype.setMin=function(t){this.ms=t};Backoff.prototype.setMax=function(t){this.max=t};Backoff.prototype.setJitter=function(t){this.jitter=t};class Manager extends Emitter{constructor(i,u){var c;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(u=i,i=void 0),u=u||{},u.path=u.path||"/socket.io",this.opts=u,installTimerFunctions(this,u),this.reconnection(u.reconnection!==!1),this.reconnectionAttempts(u.reconnectionAttempts||1/0),this.reconnectionDelay(u.reconnectionDelay||1e3),this.reconnectionDelayMax(u.reconnectionDelayMax||5e3),this.randomizationFactor((c=u.randomizationFactor)!==null&&c!==void 0?c:.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(u.timeout==null?2e4:u.timeout),this._readyState="closed",this.uri=i;const p=u.parser||parser;this.encoder=new p.Encoder,this.decoder=new p.Decoder,this._autoConnect=u.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(i){return arguments.length?(this._reconnection=!!i,i||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(i){return i===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=i,this)}reconnectionDelay(i){var u;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(u=this.backoff)===null||u===void 0||u.setMin(i),this)}randomizationFactor(i){var u;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(u=this.backoff)===null||u===void 0||u.setJitter(i),this)}reconnectionDelayMax(i){var u;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(u=this.backoff)===null||u===void 0||u.setMax(i),this)}timeout(i){return arguments.length?(this._timeout=i,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(i){if(~this._readyState.indexOf("open"))return this;this.engine=new Socket$1(this.uri,this.opts);const u=this.engine,c=this;this._readyState="opening",this.skipReconnect=!1;const p=on(u,"open",function(){c.onopen(),i&&i()}),g=x=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",x),i?i(x):this.maybeReconnectOnOpen()},v=on(u,"error",g);if(this._timeout!==!1){const x=this._timeout,E=this.setTimeoutFn(()=>{p(),g(new Error("timeout")),u.close()},x);this.opts.autoUnref&&E.unref(),this.subs.push(()=>{this.clearTimeoutFn(E)})}return this.subs.push(p),this.subs.push(v),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(on(i,"ping",this.onping.bind(this)),on(i,"data",this.ondata.bind(this)),on(i,"error",this.onerror.bind(this)),on(i,"close",this.onclose.bind(this)),on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(u){this.onclose("parse error",u)}}ondecoded(i){nextTick(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,u){let c=this.nsps[i];return c?this._autoConnect&&!c.active&&c.connect():(c=new Socket(this,i,u),this.nsps[i]=c),c}_destroy(i){const u=Object.keys(this.nsps);for(const c of u)if(this.nsps[c].active)return;this._close()}_packet(i){const u=this.encoder.encode(i);for(let c=0;c<u.length;c++)this.engine.write(u[c],i.options)}cleanup(){this.subs.forEach(i=>i()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(i,u){var c;this.cleanup(),(c=this.engine)===null||c===void 0||c.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,u),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const i=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const u=this.backoff.duration();this._reconnecting=!0;const c=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(p=>{p?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",p)):i.onreconnect()}))},u);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const cache={};function lookup(t,i){typeof t=="object"&&(i=t,t=void 0),i=i||{};const u=url(t,i.path||"/socket.io"),c=u.source,p=u.id,g=u.path,v=cache[p]&&g in cache[p].nsps,x=i.forceNew||i["force new connection"]||i.multiplex===!1||v;let E;return x?E=new Manager(c,i):(cache[p]||(cache[p]=new Manager(c,i)),E=cache[p]),u.query&&!i.query&&(i.query=u.queryKey),E.socket(u.path,i)}Object.assign(lookup,{Manager,Socket,io:lookup,connect:lookup});const blacklist=[MESSAGE_TO_GUEST,EVENT_TO_GUEST,TYPING_ON,TYPING_OFF,RESTART_CHAT_REQUEST,...INTERNAL_ACTIONS,...INTERNAL_ACTIONS$1,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],socketMiddleware=({dispatch:t,getState:i})=>u=>{let c=null;return p=>{const g=u(p);if(p.type===CONNECT){c?.disconnect(),t(connecting());const v=`/chat?${new URLSearchParams(p.querystrings).toString()}`;c=lookup(`/${p.clientName}${v}`),c.on("action",t),c.on("connect",()=>t(connected())),c.on("disconnect",()=>t(disconnected())),c.on("reconnect",()=>t(reconnected())),c.on("set-translations",(x,E)=>{t(updateIntl({language:x,messages:mergeMessages(x,E)}))}),c.on("set-settings",x=>{t(setSettings(x))}),c.on("enable-conversation-rating",x=>t(enableConversationRating(x))),c.on("speech-transcription",x=>t(receiveSpeechTranscription(x))),c.on("restore-client-state",x=>{t(restoreSessionId(x.sessionId)),t(restorePreviousChatMessages(x.messages))}),c.on("expand-window",({devices:x,initial:E=!1})=>{t({type:EXPAND_WINDOW,devices:x,initial:E})}),c.on("restart-chat",()=>{t(restartChat())}),c.on("login-success",x=>{t(startAuthenticatedChat({loginToken:x.loginToken}))})}else if(p.type==="start-screen/requestLogin")c?.emit("login-requested",p.payload);else if(p.type===START)c?.emit("start-chat",p.payload);else if(p.type===TERMINATE_SESSION)c?.emit("terminate-session",p.payload);else if(p.type===GET_STARTED)c?.emit("get-started",JSON.stringify(p));else if(p.type===AUDIO_MESSAGE_FROM_USER)c?.emit("audio-message",p.buffer);else if(p.type===CONVERSATION_RATING_FROM_GUEST)c?.emit("conversation-rating",p.payload);else if(p.type===DOWNLOAD_TRANSCRIPT_PDF){const{connection:{sessionId:v}}=i();window.location.href=`/transcript-pdf/${v}`}else blacklist.indexOf(p.type)===-1&&p.meta===void 0&&c&&c.emit("action",JSON.stringify(p));return g}},clientName=getClientName(),preloadedState={...loadState(clientName),intl:initialState$3},store=configureStore({middleware:t=>t().concat(socketMiddleware),reducer:rootReducer,preloadedState});store.subscribe(throttle(()=>{const t=store.getState();saveState(clientName,{connection:t.connection,startScreen:t.startScreen})},1e3));const container=document.getElementById("root"),root=clientExports.createRoot(container);root.render(jsxRuntimeExports.jsx(Provider_default,{store,children:jsxRuntimeExports.jsx(App,{})}));
134
- //# sourceMappingURL=index-DphxIz_o.js.map
134
+ //# sourceMappingURL=index-CeSfMUE2.js.map