diff --git a/pulls/pr-700/965.6b2c5c3d.iframe.bundle.js b/pulls/pr-700/965.6b2c5c3d.iframe.bundle.js new file mode 100644 index 000000000..b8e72cf8b --- /dev/null +++ b/pulls/pr-700/965.6b2c5c3d.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_embeddedchat_react=self.webpackChunk_embeddedchat_react||[]).push([[965],{"../markups/dist/esm/_virtual/_commonjsHelpers.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{t:()=>e});var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==__webpack_require__.g?__webpack_require__.g:"undefined"!=typeof self?self:{}},"../markups/dist/esm/_virtual/_rollupPluginBabelHelpers.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{function r(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function e(t){for(var e=1;e=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(c&&f){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),T(e),b}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;T(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:k(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),b}},r}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}function a(t){return function(){var r=this,e=arguments;return new Promise((function(n,o){var a=t.apply(r,e);function u(t){i(a,n,o,u,c,"next",t)}function c(t){i(a,n,o,u,c,"throw",t)}u(void 0)}))}}function u(t,r,e){return(r=function x(t){var r=function j(t,r){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==typeof r?r:String(r)}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function c(){return c=Object.assign?Object.assign.bind():function(t){for(var r=1;rt.length)&&(r=t.length);for(var e=0,n=new Array(r);e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw i}}}}__webpack_require__.d(__webpack_exports__,{Ac:()=>o,Ln:()=>s,ZQ:()=>y,Zj:()=>e,gY:()=>c,l5:()=>n,sf:()=>O,u:()=>h,x:()=>a})},"../markups/dist/esm/_virtual/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{p:()=>p});var p={exports:{}}},"../markups/dist/esm/_virtual/index2.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{s:()=>r});var r={exports:{}}},"../markups/dist/esm/_virtual/joypixels.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{j:()=>r});var r={exports:{}}},"../markups/dist/esm/_virtual/purify.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{p:()=>p});var p={exports:{}}},"../markups/dist/esm/_virtual/use-sync-external-store-shim.production.min.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{m:()=>r});var r={}},"../markups/dist/esm/_virtual/with-selector.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{w:()=>r});var r={exports:{}}},"../markups/dist/esm/_virtual/with-selector.production.min.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{m:()=>r});var r={}},"./src/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{x:()=>views_EmbeddedChat});var react=__webpack_require__("../../node_modules/react/index.js"),prop_types=__webpack_require__("../../node_modules/prop-types/index.js"),prop_types_default=__webpack_require__.n(prop_types),emotion_react_browser_esm=__webpack_require__("../../node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),sdk=__webpack_require__("../../node_modules/@rocket.chat/sdk/index.js");class ApiError extends Error{response;constructor(response,message,options,...other){super(message,options,...other),this.response=response}}class Api{baseUrl;constructor(baseUrl){this.baseUrl=baseUrl}getFetchConfig=config=>{const headers={"Content-Type":"application/json",...config?.headers||{}};return{...config,headers}};async request(method="GET",endpoint,data,config){const url=new URL(endpoint,this.baseUrl).toString(),response=await fetch(url,{body:data?JSON.stringify(data):void 0,method,headers:{...config.headers}});if(!response.ok)throw new ApiError(response,"Failed Api Request for "+endpoint);return{data:await response.json()}}async post(endpoint,data,config={}){return this.request("POST",endpoint,data,this.getFetchConfig(config))}async get(endpoint,config={}){return this.request("GET",endpoint,null,this.getFetchConfig(config))}async put(endpoint,data,config={}){return this.request("PUT",endpoint,data,this.getFetchConfig(config))}async delete(endpoint,config={}){return this.request("DELETE",endpoint,null,this.getFetchConfig(config))}}const getRCAppBaseURL=host=>new URL("api/apps/public/4c977b2e-eda2-4627-8bfe-2d0358304a79",host).toString(),getRCAppInfo=async host=>{const infoUrl=getRCAppBaseURL(host)+"/info",response=await fetch(infoUrl.toString());if(!response.ok)return null;return await response.json()},loginWithRocketChatOAuth=async config=>{const appInfo=await getRCAppInfo(config.api.baseUrl);if(!appInfo)throw new Error("EmbeddedChatApp not found on server");const{client_id,serviceName,allowedOrigins,redirect_uri}=appInfo.config;if(!client_id)throw new Error("client_id not found. Make sure you have configured the EmbeddedChatApp on Rocket.Chat server");if(!serviceName)throw new Error("custom_oauth_name not found. Make sure you have configured the EmbeddedChatApp on Rocket.Chat server");if(!redirect_uri)throw new Error("redirect_uri not found. Make sure you have configured the EmbeddedChatApp on Rocket.Chat server");if(allowedOrigins.length&&!allowedOrigins.includes(window.location.origin))throw new Error("Origin not allowed. Make sure you have configured the EmbeddedChatApp on Rocket.Chat server");const authorizeUrl=((host,redirectUri,clientId)=>{const url=new URL("oauth/authorize",host);return url.searchParams.set("response_type","code"),url.searchParams.set("client_id",clientId),url.searchParams.set("redirect_uri",redirectUri),url.searchParams.set("state",encodeURIComponent(window.location.origin)),url.toString()})(config.api.baseUrl,redirect_uri,client_id);const popup=window.open(authorizeUrl,"Login","scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,\nwidth=800,height=600,left=-1000,top=-1000,rel=opener");return new Promise((resolve=>{if(!popup)throw new Error("Popup blocked");{const onMessage=async e=>{if("rc-oauth-callback"===e.data.type){const{accessToken,expiresIn,serviceName:serviceName2}=e.data.credentials,response=await config.api.post("/api/v1/login",{accessToken,expiresIn,serviceName:serviceName2});popup.close(),resolve(response.data)}};window.addEventListener("message",onMessage);const checkInterval=setInterval((()=>{popup.closed&&(clearInterval(checkInterval),window.removeEventListener("message",onMessage))}),1e3)}}))};async function tokenRequestHandler(method="GET",url,token){try{const headers={"Content-Type":"application/json"},response=await fetch(url,{method,headers,credentials:"include",...token?{body:JSON.stringify({token})}:{}});if(!response.ok)throw new ApiError(response,"Failed Api Request for "+url);return response.json()}catch(error){console.error(`Error with ${method} request:`,error)}}class RocketChatAuth{host;api;currentUser;lastFetched;authListeners=[];deleteToken;saveToken;getToken;constructor({host,saveToken,getToken,deleteToken}){this.host=host,this.api=new Api(host),this.lastFetched=new Date(0),this.currentUser=null,this.getToken=getToken,this.saveToken=saveToken,this.deleteToken=deleteToken}async onAuthChange(callback){this.authListeners.push(callback);callback(await this.getCurrentUser())}async removeAuthListener(callback){this.authListeners=this.authListeners.filter((cb=>cb!==callback))}notifyAuthListeners(){this.authListeners.forEach((cb=>cb(this.currentUser)))}async loginWithPassword({user,password,code}){const response=await(async(config,{user,password,code})=>(await config.api.post("/api/v1/login",{user,password,code})).data)({api:this.api},{user,password,code});return this.setUser(response.data),this.currentUser}async loginWithOAuthServiceToken(credentials){const response=await(async(config,credentials)=>(await config.api.post("/api/v1/login",credentials)).data)({api:this.api},credentials);return this.setUser(response.data),this.currentUser}async loginWithRocketChatOAuth(){if("undefined"==typeof window)throw new Error("loginWithRocketChatOAuth can only be called in browser");const response=await loginWithRocketChatOAuth({api:this.api});return this.setUser(response.data),this.currentUser}async loginWithResumeToken(resume){const response=await(async(config,credentials)=>(await config.api.post("/api/v1/login",credentials)).data)({api:this.api},{resume});return this.setUser(response.data),this.currentUser}async handleSecureLogin(action,token){return await(async(config,action,token)=>{const appInfo=await getRCAppInfo(config.api.baseUrl);if(!appInfo)throw new Error("EmbeddedChatApp not found on the server.");const rcAppBaseUrl=getRCAppBaseURL(config.api.baseUrl),{allowedOrigins}=appInfo.config,currentOrigin=window.location.origin;if(!allowedOrigins.includes(currentOrigin))throw new Error("Origin configuration error. Please ensure the EmbeddedChatApp is correctly configured on the Rocket.Chat server.");const tokenUrl=`${rcAppBaseUrl}/auth-token`,handler={save:()=>tokenRequestHandler("POST",tokenUrl,token),get:()=>tokenRequestHandler("GET",tokenUrl),delete:()=>tokenRequestHandler("DELETE",tokenUrl)}[action];if(handler)return await handler();throw new Error(`Undefined action: ${action}`)})({api:this.api},action,token)}async getCurrentUser(refresh=!1){if(this.currentUser&&this.currentUser.authToken&&(refresh||new Date>=new Date(this.lastFetched.getTime()+354e4)))try{await this.loginWithResumeToken(this.currentUser.authToken)}catch(e){e instanceof ApiError&&401===e.response?.status&&await this.logout()}return this.currentUser}async setUser(user){this.lastFetched=new Date,this.currentUser=user,await this.save()}async save(){await this.saveToken(this.currentUser.authToken),this.notifyAuthListeners()}async load(){try{const token=await this.getToken();if(token){await this.loginWithResumeToken(token)&&(this.lastFetched=new Date,await this.getCurrentUser())}}catch(e){console.log("Failed to login user on initial load. Sign in."),this.notifyAuthListeners()}}async logout(){try{await this.api.post("/api/v1/logout",void 0,{headers:{"X-Auth-Token":this.currentUser.authToken,"X-User-Id":this.currentUser.userId}})}catch(err){console.error(err)}finally{await this.deleteToken()}this.lastFetched=new Date(0),this.currentUser=null,this.notifyAuthListeners()}}class EmbeddedChatApi{host;rid;rcClient;onMessageCallbacks;onMessageDeleteCallbacks;onTypingStatusCallbacks;onActionTriggeredCallbacks;onUiInteractionCallbacks;typingUsers;auth;constructor(host,rid,{getToken,saveToken,deleteToken}){this.host=host,this.rid=rid,this.rcClient=new sdk.Rocketchat({protocol:"ddp",host:this.host,useSsl:!/http:\/\//.test(host),reopen:2e4}),this.onMessageCallbacks=[],this.onMessageDeleteCallbacks=[],this.onTypingStatusCallbacks=[],this.typingUsers=[],this.onActionTriggeredCallbacks=[],this.onUiInteractionCallbacks=[],this.auth=new RocketChatAuth({host:this.host,deleteToken,getToken,saveToken})}setAuth(auth){this.auth=auth}getAuth(){return this.auth}getHost(){return this.host}async googleSSOLogin(signIn,acsCode){const tokens=await signIn();let acsPayload=null;"string"==typeof acsCode&&(acsPayload=acsCode);const payload=acsCode?JSON.stringify({serviceName:"google",accessToken:tokens.access_token,idToken:tokens.id_token,expiresIn:3600,totp:{code:acsPayload}}):JSON.stringify({serviceName:"google",accessToken:tokens.access_token,idToken:tokens.id_token,expiresIn:3600,scope:"profile"});try{const req=await fetch(`${this.host}/api/v1/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:payload}),response=await req.json();if("success"===response.status)return response.data.me.username||await this.updateUserUsername(response.data.userId,response.data.me.name),{status:response.status,me:response.data.me};if("totp-required"===response.error)return response}catch(err){console.error(err)}}async login(userOrEmail,password,code){let credentials;credentials=code?{user:userOrEmail.trim(),password,code}:credentials={user:userOrEmail.trim(),password};try{const data=await this.auth.loginWithPassword(credentials);return data.me.username||await this.updateUserUsername(data.userId,data.me.name),{status:"success",me:data.me}}catch(error){if(error instanceof ApiError&&401===error.response?.status){const authErrorRes=await error.response.json();return{error:authErrorRes?.error}}console.error(error)}}async autoLogin(auth){try{if(!auth||!auth.flow)return;switch(auth.flow){case"PASSWORD":case"OAUTH":await this.auth.load();break;case"TOKEN":if(!auth.credentials)return;await this.auth.loginWithOAuthServiceToken(auth.credentials)}}catch(error){console.error("Auto-login failed:",error)}}async logout(){try{await this.auth.logout()}catch(err){console.error(err)}}async connect(){try{await this.close(),await this.rcClient.connect({});const token=(await this.auth.getCurrentUser())?.authToken;await this.rcClient.resume({token}),await this.rcClient.subscribeRoom(this.rid),await this.rcClient.onMessage((data=>{if(!data)return;const message=JSON.parse(JSON.stringify(data));message.ts?.$date&&(console.log(message.ts?.$date),message.ts=message.ts.$date),message.ts||(message.ts=(new Date).toISOString()),this.onMessageCallbacks.map((callback=>callback(message)))})),await this.rcClient.subscribe("stream-notify-room",`${this.rid}/user-activity`),await this.rcClient.onStreamData("stream-notify-room",(ddpMessage=>{const[roomId,event]=ddpMessage.fields.eventName.split("/");if(roomId===this.rid){if("user-activity"===event){const typingUser=ddpMessage.fields.args[0],isTyping=ddpMessage.fields.args[1]?.includes("user-typing");this.handleTypingEvent({typingUser,isTyping})}if("typing"===event){const typingUser=ddpMessage.fields.args[0],isTyping=ddpMessage.fields.args[1];this.handleTypingEvent({typingUser,isTyping})}if("deleteMessage"===event){const messageId=ddpMessage.fields.args[0]?._id;this.onMessageDeleteCallbacks.map((callback=>callback(messageId)))}}})),await this.rcClient.subscribeNotifyUser(),await this.rcClient.onStreamData("stream-notify-user",(ddpMessage=>{const[,event]=ddpMessage.fields.eventName.split("/"),args=ddpMessage.fields.args?Array.isArray(ddpMessage.fields.args)?ddpMessage.fields.args:[ddpMessage.fields.args]:[];if("message"===event){const data=args[0];if(!data||data?.rid!==this.rid)return;const message=JSON.parse(JSON.stringify(data));message.ts?.$date&&(message.ts=message.ts.$date),message.ts||(message.ts=(new Date).toISOString()),message.renderType="blocks",this.onMessageCallbacks.map((callback=>callback(message)))}else"uiInteraction"===event&&this.onUiInteractionCallbacks.forEach((callback=>callback(args[0])))}))}catch(err){await this.close()}}async addMessageListener(callback){const idx=this.onMessageCallbacks.findIndex((c=>c===callback));-1!==idx?this.onMessageCallbacks[idx]=callback:this.onMessageCallbacks.push(callback)}async removeMessageListener(callback){this.onMessageCallbacks=this.onMessageCallbacks.filter((c=>c!==callback))}async addMessageDeleteListener(callback){const idx=this.onMessageDeleteCallbacks.findIndex((c=>c===callback));-1!==idx?this.onMessageDeleteCallbacks[idx]=callback:this.onMessageDeleteCallbacks.push(callback)}async removeMessageDeleteListener(callback){this.onMessageDeleteCallbacks=this.onMessageDeleteCallbacks.filter((c=>c!==callback))}async addTypingStatusListener(callback){const idx=this.onTypingStatusCallbacks.findIndex((c=>c===callback));-1!==idx?this.onTypingStatusCallbacks[idx]=callback:this.onTypingStatusCallbacks.push(callback)}async removeTypingStatusListener(callback){this.onTypingStatusCallbacks=this.onTypingStatusCallbacks.filter((c=>c!==callback))}async addActionTriggeredListener(callback){const idx=this.onActionTriggeredCallbacks.findIndex((c=>c===callback));-1!==idx?this.onActionTriggeredCallbacks[idx]=callback:this.onActionTriggeredCallbacks.push(callback)}async removeActionTriggeredListener(callback){this.onActionTriggeredCallbacks=this.onActionTriggeredCallbacks.filter((c=>c!==callback))}async addUiInteractionListener(callback){const idx=this.onUiInteractionCallbacks.findIndex((c=>c===callback));-1!==idx?this.onUiInteractionCallbacks[idx]=callback:this.onUiInteractionCallbacks.push(callback)}async removeUiInteractionListener(callback){this.onUiInteractionCallbacks=this.onUiInteractionCallbacks.filter((c=>c!==callback))}handleTypingEvent({typingUser,isTyping}){setTimeout((()=>{}),2e3);const idx=this.typingUsers.indexOf(typingUser);-1!==idx&&this.typingUsers.splice(idx,1),isTyping&&this.typingUsers.unshift(typingUser);const newTypingStatus=(array=this.typingUsers,[...array].map((item=>"object"==typeof item?{...item}:item)));var array;this.onTypingStatusCallbacks.forEach((callback=>callback(newTypingStatus)))}async getRCAppInfo(){try{const response=await fetch(`${this.host}/api/apps/public/4c977b2e-eda2-4627-8bfe-2d0358304a79/info`);return response.ok?await response.json():null}catch(err){console.error(err)}}async updateUserNameThroughSuggestion(userid){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/users.getUsernameSuggestion`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"}),suggestedUsername=await response.json();if(suggestedUsername.success){const response2=await fetch(`${this.host}/api/v1/users.update`,{body:`{"userId": "${userid}", "data": { "username": "${suggestedUsername.result}" }}`,headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"POST"});return await response2.json()}}catch(error){console.error(error)}}async updateUserUsername(userid,username){const newUserName=username.replace(/\s/g,".").toLowerCase();if(!/[0-9a-zA-Z-_.]+/.test(newUserName))return this.updateUserNameThroughSuggestion(userid);try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/users.update`,{body:`{"userId": "${userid}", "data": { "username": "${newUserName}" }}`,headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"POST"}),result=await response.json();return result.success||"error-could-not-save-identity"!==result.errorType?result:await this.updateUserNameThroughSuggestion(userid)}catch(err){console.error(err)}}async channelInfo(){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/rooms.info?roomId=${this.rid}`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await response.json()}catch(err){console.error(err)}}async permissionInfo(){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/permissions.listAll`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await response.json()}catch(err){console.error(err)}}async close(){await this.rcClient.unsubscribeAll(),await this.rcClient.disconnect()}async getMessages(anonymousMode=!1,options={query:void 0,field:void 0},isChannelPrivate=!1){const roomType=isChannelPrivate?"groups":"channels",endp=anonymousMode?"anonymousread":"messages",query=options?.query?`&query=${JSON.stringify(options.query)}`:"",field=options?.field?`&field=${JSON.stringify(options.field)}`:"";try{const{userId,authToken}=await this.auth.getCurrentUser()||{},messages=await fetch(`${this.host}/api/v1/${roomType}.${endp}?roomId=${this.rid}${query}${field}`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await messages.json()}catch(err){console.log(err)}}async getThreadMessages(tmid,isChannelPrivate=!1){return this.getMessages(!1,{query:{tmid}},isChannelPrivate)}async getChannelRoles(isChannelPrivate=!1){const roomType=isChannelPrivate?"groups":"channels";try{const{userId,authToken}=await this.auth.getCurrentUser()||{},roles=await fetch(`${this.host}/api/v1/${roomType}.roles?roomId=${this.rid}`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await roles.json()}catch(err){console.log(err)}}async getUsersInRole(role){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},roles=await fetch(`${this.host}/api/v1/roles.getUsersInRole?role=${role}`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await roles.json()}catch(err){console.log(err)}}async sendTypingStatus(username,typing){try{this.rcClient.methodCall("stream-notify-room",`${this.rid}/user-activity`,username,typing?["user-typing"]:[])}catch(err){console.error(err)}}async sendMessage(message,threadId){const messageObj="string"==typeof message?{rid:this.rid,msg:message}:{...message,rid:this.rid};threadId&&(messageObj.tmid=threadId);try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/chat.sendMessage`,{body:JSON.stringify({message:messageObj}),headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"POST"});return await response.json()}catch(err){console.error(err)}}async deleteMessage(msgId){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/chat.delete`,{body:`{"roomId": "${this.rid}", "msgId": "${msgId}","asUser" : true }`,headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"POST"});return await response.json()}catch(err){console.error(err)}}async updateMessage(msgId,text){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/chat.update`,{body:`{"roomId": "${this.rid}", "msgId": "${msgId}","text" : "${text}" }`,headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"POST"});return await response.json()}catch(err){console.error(err)}}async getAllFiles(isChannelPrivate=!1){const roomType=isChannelPrivate?"groups":"channels";try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/${roomType}.files?roomId=${this.rid}`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await response.json()}catch(err){console.error(err)}}async getAllImages(){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/channels.images?roomId=${this.rid}`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await response.json()}catch(err){console.error(err)}}async starMessage(mid){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/chat.starMessage`,{body:`{"messageId": "${mid}"}`,headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"POST"});return await response.json()}catch(err){console.error(err)}}async unstarMessage(mid){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/chat.unStarMessage`,{body:`{"messageId": "${mid}"}`,headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"POST"});return await response.json()}catch(err){console.error(err)}}async getStarredMessages(){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/chat.getStarredMessages?roomId=${this.rid}`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await response.json()}catch(err){console.error(err)}}async getPinnedMessages(){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/chat.getPinnedMessages?roomId=${this.rid}`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await response.json()}catch(err){console.error(err)}}async getMentionedMessages(){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/chat.getMentionedMessages?roomId=${this.rid}`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await response.json()}catch(err){console.error(err)}}async pinMessage(mid){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/chat.pinMessage`,{body:`{"messageId": "${mid}"}`,headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"POST"});return await response.json()}catch(err){return{error:err}}}async unpinMessage(mid){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/chat.unPinMessage`,{body:`{"messageId": "${mid}"}`,headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"POST"});return await response.json()}catch(err){console.error(err)}}async reactToMessage(emoji,messageId,shouldReact){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/chat.react`,{body:`{"messageId": "${messageId}", "emoji": "${emoji}", "shouldReact": ${shouldReact}}`,headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"POST"});return await response.json()}catch(err){console.error(err)}}async reportMessage(messageId,description){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/chat.reportMessage`,{body:`{"messageId": "${messageId}", "description": "${description}"}`,headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"POST"});return await response.json()}catch(err){console.error(err)}}async findOrCreateInvite(){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/findOrCreateInvite`,{method:"POST",body:JSON.stringify({rid:this.rid,days:1,maxUses:10}),headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId}});return await response.json()}catch(err){console.log(err)}}async sendAttachment(file,fileName,fileDescription="",threadId=void 0){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},form=new FormData;threadId&&form.append("tmid",threadId),form.append("file",file,fileName),form.append("description",0!==fileDescription.length?fileDescription:"");const response=fetch(`${this.host}/api/v1/rooms.upload/${this.rid}`,{method:"POST",body:form,headers:{"X-Auth-Token":authToken,"X-User-Id":userId}}).then((r=>r.json()));return response}catch(err){console.log(err)}}async me(){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/me`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await response.json()}catch(err){console.error(err)}}async getChannelMembers(isChannelPrivate=!1){const roomType=isChannelPrivate?"groups":"channels";try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/${roomType}.members?roomId=${this.rid}`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await response.json()}catch(err){console.error(err)}}async getSearchMessages(text){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/chat.search?roomId=${this.rid}&searchText=${text}`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await response.json()}catch(err){console.error(err)}}async getMessageLimit(){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/settings/Message_MaxAllowedSize`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await response.json()}catch(err){console.error(err)}}async handleUiKitInteraction(appId,userInteraction){try{const{userId,authToken}=await this.auth.getCurrentUser()||{},triggerId=Math.random().toString(32).slice(2,16),response=await fetch(`${this.host}/api/apps/ui.interaction/${appId}`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"POST",body:JSON.stringify({triggerId,...userInteraction})}),interaction=await response.json();return this.onActionTriggeredCallbacks.forEach((cb=>cb(interaction))),interaction}catch(e){console.error(e)}}async getCommandsList(){const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/commands.list`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"GET"});return await response.json()}async execCommand({command,params}){const{userId,authToken}=await this.auth.getCurrentUser()||{},response=await fetch(`${this.host}/api/v1/commands.run`,{headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId},method:"POST",body:JSON.stringify({command,params,roomId:this.rid,triggerId:Math.random().toString(32).slice(2,20)})});return await response.json()}async getUserStatus(reqUserId){const{userId,authToken}=await this.auth.getCurrentUser()||{};return(await fetch(`${this.host}/api/v1/users.getStatus?userId=${reqUserId}`,{method:"GET",headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId}})).json()}async userInfo(reqUserId){const{userId,authToken}=await this.auth.getCurrentUser()||{};return(await fetch(`${this.host}/api/v1/users.info?userId=${reqUserId}`,{method:"GET",headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId}})).json()}async userData(username){const{userId,authToken}=await this.auth.getCurrentUser()||{};return(await fetch(`${this.host}/api/v1/users.info?username=${username}`,{method:"GET",headers:{"Content-Type":"application/json","X-Auth-Token":authToken,"X-User-Id":userId}})).json()}}var _rollupPluginBabelHelpers=__webpack_require__("../ui-elements/dist/esm/_virtual/_rollupPluginBabelHelpers.js"),node_modules_prop_types=__webpack_require__("../ui-elements/dist/esm/node_modules/prop-types/index.js"),r={radius:"0.2rem",commonColors:{black:"hsl(0, 100%, 0%)",white:"hsl(0, 100%, 100%)"},schemes:{light:{background:"hsl(0, 0%, 100%)",foreground:"hsl(240, 10%, 3.9%)",card:"hsl(0, 0%, 100%)",cardForeground:"hsl(240, 10%, 3.9%)",popover:"hsl(0, 0%, 100%)",popoverForeground:"hsl(240, 10%, 3.9%)",primary:"hsl(240, 5.9%, 10%)",primaryForeground:"hsl(0, 0%, 98%)",secondary:"hsl(240, 4.8%, 95.9%)",secondaryForeground:"hsl(240, 5.9%, 10%)",muted:"hsl(240, 4.8%, 95.9%)",mutedForeground:"hsl(240, 3.8%, 46.1%)",accent:"hsl(240, 4.8%, 95.9%)",accentForeground:"hsl(240, 5.9%, 10%)",destructive:"hsl(0, 84.2%, 60.2%)",destructiveForeground:"hsl(0, 0%, 98%)",border:"hsl(240, 5.9%, 90%)",input:"hsl(240, 5.9%, 90%)",ring:"hsl(240, 5.9%, 10%)",warning:"hsl(38, 92%, 50%)",warningForeground:"hsl(48, 96%, 89%)",success:"hsl(91, 60.4%, 81.2%)",successForeground:"hsl(90, 61.1%, 14.1%)",info:"hsl(214, 76.4%, 50.2%)",infoForeground:"hsl(214.3, 77.8%, 92.9%)"},dark:{background:"hsl(240, 10%, 3.9%)",foreground:"hsl(0, 0%, 98%)",card:"hsl(240, 10%, 3.9%)",cardForeground:"hsl(0, 0%, 98%)",popover:"hsl(240, 10%, 3.9%)",popoverForeground:"hsl(0, 0%, 98%)",primary:"hsl(0, 0%, 98%)",primaryForeground:"hsl(240, 5.9%, 10%)",secondary:"hsl(240, 3.7%, 15.9%)",secondaryForeground:"hsl(0, 0%, 98%)",muted:"hsl(240, 3.7%, 15.9%)",mutedForeground:"hsl(240, 5%, 64.9%)",accent:"hsl(240, 3.7%, 15.9%)",accentForeground:"hsl(0, 0%, 98%)",destructive:"hsl(0, 62.8%, 30.6%)",destructiveForeground:"hsl(0, 0%, 98%)",border:"hsl(240, 3.7%, 15.9%)",input:"hsl(240, 3.7%, 15.9%)",ring:"hsl(240, 4.9%, 83.9%)",warning:"hsl(48, 96%, 89%)",warningForeground:"hsl(38, 92%, 50%)",success:"hsl(90, 61.1%, 14.1%)",successForeground:"hsl(90, 60%, 90.2%)",info:"hsl(214.3, 77.8%, 92.9%)",infoForeground:"hsl(214.4, 75.8%, 19.4%)"}},shadows:["none","rgba(17, 17, 26, 0.05) 0px 1px 0px, rgba(17, 17, 26, 0.1) 0px 0px 8px","rgba(100, 100, 111, 0.2) 0px 7px 29px 0px"],zIndex:{divider:1e3,body:1100,general:1200,menu:1300,tooltip:1400,modal:1500,toastbar:1600}},ThemeContextProvider_u=(0,react.createContext)(),a=function(n){var a,c,s=n.children,d=n.theme,f=n.mode,h=d||r,v=(0,react.useState)(f||"light"),p=(0,_rollupPluginBabelHelpers.ZQ)(v,2),g=p[0],j=p[1],T=(0,react.useState)(h),b=(0,_rollupPluginBabelHelpers.ZQ)(T,2),P=b[0],_=b[1],k=null===(a=P.schemes)||void 0===a?void 0:a[g],x=null===(c=P.schemes)||void 0===c?void 0:c[function(e){return"light"===e?"dark":"light"}(g)],y=(0,react.useMemo)((function(){return(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},P),{},{colors:k,invertedColors:x})}),[P,k,x]);(0,react.useEffect)((function(){d&&_(d)}),[d]),(0,react.useEffect)((function(){f&&j(f)}),[f]);var A=(0,react.useMemo)((function(){return{theme:y,mode:g,setMode:j,setTheme:_}}),[y,g]);return(0,emotion_react_browser_esm.tZ)(ThemeContextProvider_u.Provider,{value:A},s)},useTheme_i=function(){var l=(0,react.useContext)(ThemeContextProvider_u);if(!l){var m,n,s="light",a=r,u=null===(m=a.schemes)||void 0===m?void 0:m[s],d=null===(n=a.schemes)||void 0===n?void 0:n[(s,"dark")];return{theme:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},a),{},{colors:u,invertedColors:d}),mode:s,setMode:function(){},setTheme:function(){}}}return l},useComponentOverrides_l=function(l){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=useTheme_i().theme,v=(0,react.useMemo)((function(){var n;return"".concat(Array.isArray(e)?e.join(" "):e," ").concat((null==t||null===(n=t.components)||void 0===n||null===(n=n[l])||void 0===n?void 0:n.classNames)||"")}),[e,l,null==t?void 0:t.components]);return{styleOverrides:(0,react.useMemo)((function(){var o;return(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},i),(null==t?void 0:t.components)&&(null==t||null===(o=t.components[l])||void 0===o?void 0:o.styleOverrides)||{})}),[l,i,null==t?void 0:t.components]),classNames:v,configOverrides:(0,react.useMemo)((function(){var o;return(0,_rollupPluginBabelHelpers.Zj)({},(null==t?void 0:t.components)&&(null==t||null===(o=t.components[l])||void 0===o?void 0:o.configOverrides)||{})}),[l,null==t?void 0:t.components]),variantOverrides:(0,react.useMemo)((function(){return(null==t?void 0:t.variants)&&(null==t?void 0:t.variants[l])||""}),[l,null==t?void 0:t.variants])}},I=function(g){return"small"===g?"1.25rem":"large"===g?"2.75rem":"2rem"},n=["children","type","className","style","size","square","ghost","disabled"],Button_c=function(s){var c=s.children,d=s.type,m=void 0===d?"primary":d,p=s.className,u=void 0===p?"":p,b=s.style,y=void 0===b?{}:b,h=s.size,v=void 0===h?"medium":h,f=s.square,j=void 0!==f&&f,g=s.ghost,N=void 0!==g&&g,O=s.disabled,q=void 0!==O&&O,x=(0,_rollupPluginBabelHelpers.Kd)(s,n),z=useComponentOverrides_l("Button"),B=z.classNames,T=z.styleOverrides,k=function(C){return{main:function(A,b){return(0,emotion_react_browser_esm.iv)("cursor:pointer;display:inline-block;background-color:",C.colors[A]||"currentColor",";color:",C.colors["".concat(A,"Foreground")]||"currentColor",";border:none;font-size:0.875rem;font-weight:500;letter-spacing:0;line-height:1.25rem;min-width:80px;outline:none;overflow:hidden;padding-block:calc(18px - 0.625rem);padding:calc(18px - 0.625rem) 14px;padding-inline:14px;text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;align-self:flex-start;border-radius:",C.radius,";&.ec-button--small{font-size:0.75rem;font-weight:700;letter-spacing:0;line-height:1rem;min-width:56px;padding-block:calc(12px - 0.5rem);padding:calc(12px - 0.5rem) 6px;padding-inline:6px;}&.ec-button--large{font-size:1rem;font-weight:400;letter-spacing:0;line-height:1.5rem;min-width:96px;padding-block:calc(22px - 0.75rem);padding:calc(22px - 0.75rem) 22px;padding-inline:22px;}&.ec-button-square{display:inline-flex;align-items:center;justify-content:center;width:",I(b),";min-width:",I(b),";height:",I(b),";padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;}&:hover{filter:brightness(90%);}&.disabled:not(.ghost):hover{filter:none;}&.disabled:not(.ghost){background-color:",C.colors.muted,";color:",C.colors.mutedForeground,";border:none;cursor:not-allowed;}&.ghost{background:none;color:",C.colors["".concat(A)]||C.colors.accentForeground,";border:none;}&.disabled.ghost{color:",C.colors.mutedForeground,";border:none;background:none;cursor:not-allowed;}&.ghost:not(.disabled):hover{background:",C.colors.accent,";}","","","")}}}(useTheme_i().theme);return(0,emotion_react_browser_esm.tZ)("button",(0,_rollupPluginBabelHelpers.gY)({type:"button",css:k.main(m,v),className:"ec-button ec-button--".concat(v," ").concat(j?"ec-button-square":""," ").concat(N?"ghost":""," ").concat(q?"disabled":""," ").concat(u," ").concat(B),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},T),y)},x),c)};Button_c.propTypes={children:node_modules_prop_types.Z.oneOfType([node_modules_prop_types.Z.arrayOf(node_modules_prop_types.Z.node),node_modules_prop_types.Z.node]),size:node_modules_prop_types.Z.oneOf(["small","medium","large"]),className:node_modules_prop_types.Z.string,style:node_modules_prop_types.Z.object,square:node_modules_prop_types.Z.bool,ghost:node_modules_prop_types.Z.bool,disabled:node_modules_prop_types.Z.bool};var jr={file:function(e){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",className:"rcx-svg--directional",fill:"currentColor"},e),(0,emotion_react_browser_esm.tZ)("path",{d:"M11.6667 14C11.6667 13.4477 12.1144 13 12.6667 13H19.3333C19.8856 13 20.3333 13.4477 20.3333 14C20.3333 14.5523 19.8856 15 19.3333 15H12.6667C12.1144 15 11.6667 14.5523 11.6667 14Z M12.6667 17H19.3333C19.8856 17 20.3333 17.4477 20.3333 18C20.3333 18.5523 19.8856 19 19.3333 19H12.6667C12.1144 19 11.6667 18.5523 11.6667 18C11.6667 17.4477 12.1144 17 12.6667 17Z M8 4H19.4854C19.8083 4 20.1114 4.15597 20.2991 4.41876L24.8137 10.7392C24.9349 10.9088 25 11.112 25 11.3205V27C25 27.5523 24.5523 28 24 28H8C7.44772 28 7 27.5523 7 27V5C7 4.44772 7.44772 4 8 4ZM23 11.6409L18.9708 6H9V26H23V11.6409Z"}))},mobile:function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M7.33331 5.33317C7.33331 3.86041 8.52722 2.6665 9.99998 2.6665H22C23.4727 2.6665 24.6666 3.86041 24.6666 5.33317V26.6665C24.6666 28.1393 23.4727 29.3332 22 29.3332H9.99998C8.52722 29.3332 7.33331 28.1393 7.33331 26.6665V5.33317ZM9.33331 5.33317V26.6665C9.33331 27.0347 9.63179 27.3332 9.99998 27.3332H22C22.3682 27.3332 22.6666 27.0347 22.6666 26.6665V5.33317C22.6666 4.96498 22.3682 4.6665 22 4.6665H18.9909C18.908 5.41657 18.2721 6 17.5 6H14.5C13.7279 6 13.092 5.41657 13.0091 4.6665H9.99998C9.63179 4.6665 9.33331 4.96498 9.33331 5.33317Z"}))},star:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M14.4078 4.15153C14.9755 2.31929 17.5471 2.25961 18.1991 4.06355L20.3811 10.0999H26.4886C28.2971 10.0999 29.1769 12.3094 27.8634 13.5525L23.2418 17.9265L24.9101 24.7281C25.3529 26.5334 23.3086 27.9136 21.7997 26.828L16.2453 22.8319L10.6909 26.828C9.18201 27.9136 7.13762 26.5334 7.58044 24.7281L9.24322 17.9491L4.3185 13.5989C2.9379 12.3794 3.80047 10.0999 5.64257 10.0999H12.5648L14.4078 4.15153ZM18.5002 10.7798L16.3182 4.74343L14.4752 10.6919C14.2158 11.5292 13.4414 12.0999 12.5648 12.0999L5.64257 12.0999L10.5673 16.4501C11.1246 16.9424 11.3628 17.7033 11.1856 18.4255L9.52286 25.2045L15.0773 21.2084C15.775 20.7064 16.7155 20.7064 17.4133 21.2084L22.9677 25.2045L21.2994 18.403C21.1281 17.7047 21.3448 16.9682 21.867 16.4739L26.4886 12.0999H20.3811C19.5387 12.0999 18.7866 11.5721 18.5002 10.7798Z"}))},pin:function(r){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"},r),(0,emotion_react_browser_esm.tZ)("path",{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a6 6 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707s.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a6 6 0 0 1 1.013.16l3.134-3.133a3 3 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146m.122 2.112v-.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a5 5 0 0 0-.288-.076 5 5 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a5 5 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034q.172.002.343-.04L9.927 2.028q-.042.172-.04.343a1.8 1.8 0 0 0 .062.46z"}))},"reply-directly":function(e){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",className:"rcx-svg--directional",fill:"currentColor"},e),(0,emotion_react_browser_esm.tZ)("path",{d:"M11.7071 9.29289C11.3166 8.90237 10.6834 8.90237 10.2929 9.29289L4.29289 15.2929C3.90237 15.6834 3.90237 16.3166 4.29289 16.7071L10.2929 22.7071C10.6834 23.0976 11.3166 23.0976 11.7071 22.7071C12.0976 22.3166 12.0976 21.6834 11.7071 21.2929L7.41421 17H25.5V21C25.5 21.5523 25.9477 22 26.5 22C27.0523 22 27.5 21.5523 27.5 21V16C27.5 15.4477 27.0523 15 26.5 15H7.41421L11.7071 10.7071C12.0976 10.3166 12.0976 9.68342 11.7071 9.29289Z"}))},hash:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M10.5 4C11.0523 4 11.5 4.44772 11.5 5V9.5H20.5V5C20.5 4.44772 20.9477 4 21.5 4C22.0523 4 22.5 4.44772 22.5 5V9.5H27C27.5523 9.5 28 9.94772 28 10.5C28 11.0523 27.5523 11.5 27 11.5H22.5V20.5H27C27.5523 20.5 28 20.9477 28 21.5C28 22.0523 27.5523 22.5 27 22.5H22.5V27C22.5 27.5523 22.0523 28 21.5 28C20.9477 28 20.5 27.5523 20.5 27V22.5H11.5V27C11.5 27.5523 11.0523 28 10.5 28C9.94772 28 9.5 27.5523 9.5 27V22.5H5C4.44772 22.5 4 22.0523 4 21.5C4 20.9477 4.44772 20.5 5 20.5H9.5V11.5H5C4.44772 11.5 4 11.0523 4 10.5C4 9.94772 4.44772 9.5 5 9.5H9.5V5C9.5 4.44772 9.94772 4 10.5 4ZM11.5 11.5V20.5H20.5V11.5H11.5Z"}))},computer:function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M10.6667 24.3335H21.3334C21.8856 24.3335 22.3334 24.7812 22.3334 25.3335C22.3334 25.8858 21.8856 26.3335 21.3334 26.3335H10.6667C10.1144 26.3335 9.66669 25.8858 9.66669 25.3335C9.66669 24.7812 10.1144 24.3335 10.6667 24.3335Z M2.66669 9.3335C2.66669 7.12436 4.45755 5.3335 6.66669 5.3335H25.3334C27.5425 5.3335 29.3334 7.12436 29.3334 9.3335V18.6668C29.3334 20.876 27.5425 22.6668 25.3334 22.6668H6.66668C4.45754 22.6668 2.66669 20.876 2.66669 18.6668V9.3335ZM6.66669 7.3335C5.56212 7.3335 4.66669 8.22893 4.66669 9.3335V18.6668C4.66669 19.7714 5.56212 20.6668 6.66668 20.6668H25.3334C26.4379 20.6668 27.3334 19.7714 27.3334 18.6668V9.3335C27.3334 8.22892 26.4379 7.3335 25.3334 7.3335H6.66669Z"}))},cross:function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M25.2071 8.20711C25.5976 7.81658 25.5976 7.18342 25.2071 6.79289C24.8166 6.40237 24.1834 6.40237 23.7929 6.79289L16 14.5858L8.20711 6.79289C7.81658 6.40237 7.18342 6.40237 6.79289 6.79289C6.40237 7.18342 6.40237 7.81658 6.79289 8.20711L14.5858 16L6.79289 23.7929C6.40237 24.1834 6.40237 24.8166 6.79289 25.2071C7.18342 25.5976 7.81658 25.5976 8.20711 25.2071L16 17.4142L23.7929 25.2071C24.1834 25.5976 24.8166 25.5976 25.2071 25.2071C25.5976 24.8166 25.5976 24.1834 25.2071 23.7929L17.4142 16L25.2071 8.20711Z"}))},copy:function(r){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},r),(0,emotion_react_browser_esm.tZ)("path",{d:"M3,3 L3,14.2571429 C3,14.8094276 3.44771525,15.2571429 4,15.2571429 L6.61290323,15.2571429 L6.61290323,17 C6.61290323,17.5522847 7.06061848,18 7.61290323,18 L16,18 C16.5522847,18 17,17.5522847 17,17 L17,10.1263643 C17,9.86322398 16.8962817,9.61068815 16.7113319,9.42350804 L12.3800548,5.04000087 C12.1921856,4.8498662 11.9360168,4.74285714 11.6687229,4.74285714 L11.1832258,4.74285714 L8.76808469,2.2973277 C8.58020168,2.10708066 8.32395462,2 8.05657107,2 L4,2 C3.44771525,2 3,2.44771525 3,3 Z M4.85483871,3.37051429 L7.70455922,3.37051429 C7.83827986,3.37051429 7.96642858,3.42407767 8.06037453,3.51923738 L9.2683871,4.74285714 L6.61290323,4.74285714 L6.61290323,13.8857143 L4.85483871,13.8857143 C4.57869633,13.8857143 4.35483871,13.6618567 4.35483871,13.3857143 L4.35483871,3.87051429 C4.35483871,3.59437191 4.57869633,3.37051429 4.85483871,3.37051429 Z M8.46774194,6.11428571 L10.6290323,6.11428571 C10.9051746,6.11428571 11.1290323,6.33814334 11.1290323,6.61428571 L11.1290323,10.1848 C11.1290323,10.4609424 11.3528899,10.6848 11.6290323,10.6848 L15.1451613,10.6848 C15.4213037,10.6848 15.6451613,10.9086576 15.6451613,11.1848 L15.6451613,16.1276571 C15.6451613,16.4037995 15.4213037,16.6276571 15.1451613,16.6276571 L8.46774194,16.6276571 C8.19159956,16.6276571 7.96774194,16.4037995 7.96774194,16.1276571 L7.96774194,6.61428571 C7.96774194,6.33814334 8.19159956,6.11428571 8.46774194,6.11428571 Z M12.6550106,7.25666381 L14.5186194,9.14309234 C14.5574335,9.18238168 14.5570482,9.24569701 14.5177589,9.28451108 C14.4990414,9.3030021 14.4737906,9.31337143 14.4474798,9.31337143 L12.583871,9.31337143 C12.5286425,9.31337143 12.483871,9.2685999 12.483871,9.21337143 L12.483871,7.3269429 C12.483871,7.27171442 12.5286425,7.2269429 12.583871,7.2269429 C12.6106035,7.2269429 12.6362232,7.23764635 12.6550106,7.25666381 Z"}))},mic:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M19 9C19 7.34315 17.6569 6 16 6C14.3431 6 13 7.34315 13 9V13C13 14.6569 14.3431 16 16 16C17.6569 16 19 14.6569 19 13V9ZM11 9C11 6.23858 13.2386 4 16 4C18.7614 4 21 6.23858 21 9V13C21 15.7614 18.7614 18 16 18C13.2386 18 11 15.7614 11 13V9ZM8 12C8.55228 12 9 12.4477 9 13C9 15.8777 10.1799 17.676 11.6163 18.8C13.0683 19.9362 14.8268 20.4119 16 20.4977C17.1732 20.4119 18.9317 19.9362 20.3837 18.8C21.8201 17.676 23 15.8777 23 13C23 12.4477 23.4477 12 24 12C24.5523 12 25 12.4477 25 13C25 16.5223 23.5133 18.8906 21.6163 20.375C20.1193 21.5464 18.395 22.1488 17 22.3869V26H22C22.5523 26 23 26.4477 23 27C23 27.5523 22.5523 28 22 28H10C9.44772 28 9 27.5523 9 27C9 26.4477 9.44772 26 10 26H15V22.3869C13.605 22.1488 11.8807 21.5464 10.3837 20.375C8.48672 18.8906 7 16.5223 7 13C7 12.4477 7.44772 12 8 12Z"}))},"video-recorder":function(r){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"currentColor",className:"bi bi-camera-video",viewBox:"0 0 16 16"},r),(0,emotion_react_browser_esm.tZ)("path",{fillRule:"evenodd",d:"M0 5a2 2 0 0 1 2-2h7.5a2 2 0 0 1 1.983 1.738l3.11-1.382A1 1 0 0 1 16 4.269v7.462a1 1 0 0 1-1.406.913l-3.111-1.382A2 2 0 0 1 9.5 13H2a2 2 0 0 1-2-2V5zm11.5 5.175 3.5 1.556V4.269l-3.5 1.556v4.35zM2 4a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h7.5a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H2z"}))},"disabled-recorder":function(a){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",className:"bi bi-camera-video-off",viewBox:"0 0 16 16"},a),(0,emotion_react_browser_esm.tZ)("path",{fillRule:"evenodd",d:"M10.961 12.365a1.99 1.99 0 0 0 .522-1.103l3.11 1.382A1 1 0 0 0 16 11.731V4.269a1 1 0 0 0-1.406-.913l-3.111 1.382A2 2 0 0 0 9.5 3H4.272l.714 1H9.5a1 1 0 0 1 1 1v6a1 1 0 0 1-.144.518l.605.847zM1.428 4.18A.999.999 0 0 0 1 5v6a1 1 0 0 0 1 1h5.014l.714 1H2a2 2 0 0 1-2-2V5c0-.675.334-1.272.847-1.634l.58.814zM15 11.73l-3.5-1.555v-4.35L15 4.269v7.462zm-4.407 3.56-10-14 .814-.58 10 14-.814.58z"})," ")},"circle-cross":function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M16 27C22.0751 27 27 22.0751 27 16C27 9.92487 22.0751 5 16 5C9.92487 5 5 9.92487 5 16C5 22.0751 9.92487 27 16 27ZM16 29C8.8203 29 3 23.1797 3 16C3 8.8203 8.8203 3 16 3C23.1797 3 29 8.8203 29 16C29 23.1797 23.1797 29 16 29ZM20.7071 11.2929C21.0976 11.6834 21.0976 12.3166 20.7071 12.7071L17.4142 16L20.7071 19.2929C21.0976 19.6834 21.0976 20.3166 20.7071 20.7071C20.3166 21.0976 19.6834 21.0976 19.2929 20.7071L16 17.4142L12.7071 20.7071C12.3166 21.0976 11.6834 21.0976 11.2929 20.7071C10.9024 20.3166 10.9024 19.6834 11.2929 19.2929L14.5858 16L11.2929 12.7071C10.9024 12.3166 10.9024 11.6834 11.2929 11.2929C11.6834 10.9024 12.3166 10.9024 12.7071 11.2929L16 14.5858L19.2929 11.2929C19.6834 10.9024 20.3166 10.9024 20.7071 11.2929Z"}))},"circle-check":function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M16 27C22.0751 27 27 22.0751 27 16C27 14.5462 26.718 13.1584 26.2057 11.8881L27.7219 10.3719C28.541 12.0749 29 13.9838 29 16C29 23.1797 23.1797 29 16 29C8.8203 29 3 23.1797 3 16C3 8.8203 8.8203 3 16 3C18.9805 3 21.7267 4.003 23.9195 5.68988L22.491 7.11837C20.6716 5.78641 18.4276 5 16 5C9.92487 5 5 9.92487 5 16C5 22.0751 9.92487 27 16 27ZM28.2072 7.20698L16.7063 18.7119C16.5187 18.8995 16.2642 19.0049 15.9988 19.0049C15.7335 19.0048 15.479 18.8992 15.2915 18.7115L11.2924 14.7066C10.9021 14.3158 10.9026 13.6826 11.2934 13.2924C11.6842 12.9021 12.3174 12.9026 12.7076 13.2934L15.9995 16.59L26.7928 5.79302C27.1832 5.40242 27.8164 5.40231 28.207 5.79277C28.5976 6.18323 28.5977 6.81639 28.2072 7.20698Z"}))},send:function(e){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",className:"rcx-svg--directional",fill:"currentColor"},e),(0,emotion_react_browser_esm.tZ)("path",{d:"M27.4382 6.03045C27.6835 6.32799 27.7359 6.74008 27.5728 7.08955L18.2395 27.0895C18.0617 27.4707 17.6644 27.6998 17.2454 27.6628C16.8265 27.6258 16.4755 27.3307 16.3671 26.9243L13.8165 17.3596L4.88612 12.8944C4.51182 12.7073 4.29364 12.3069 4.3393 11.8909C4.38497 11.4749 4.68482 11.1313 5.0908 11.0299L26.4241 5.69652C26.7983 5.60299 27.1928 5.73292 27.4382 6.03045ZM15.8069 17.0615L17.5906 23.7506L24.8728 8.1459L8.19841 12.3145L14.5611 15.4958L16.7333 13.8667C17.1752 13.5353 17.802 13.6248 18.1333 14.0667C18.4647 14.5085 18.3752 15.1353 17.9333 15.4667L15.8069 17.0615Z"}))},emoji:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M27 16C27 22.0751 22.0751 27 16 27C9.92487 27 5 22.0751 5 16C5 9.92487 9.92487 5 16 5C22.0751 5 27 9.92487 27 16ZM29 16C29 8.8203 23.1797 3 16 3C8.8203 3 3 8.8203 3 16C3 23.1797 8.8203 29 16 29C23.1797 29 29 23.1797 29 16ZM10.3148 20.1527C11.1833 20.9427 12.0721 21.517 12.9718 21.9006C14.5285 22.5643 16.0559 22.63 17.4557 22.3258C19.0723 21.9745 20.506 21.1355 21.6595 20.1748C22.3851 19.5705 21.9039 18.5 20.9596 18.5C20.6905 18.5 20.4321 18.599 20.2219 18.767C19.3016 19.5024 18.207 20.1159 17.031 20.3714C16.0001 20.5954 14.8988 20.548 13.7562 20.0608C13.1293 19.7936 12.4719 19.3861 11.7968 18.7949C11.586 18.6103 11.3184 18.5 11.0383 18.5C10.127 18.5 9.64069 19.5396 10.3148 20.1527ZM12.5052 15C13.6098 15 14.5052 14.1046 14.5052 13C14.5052 11.8954 13.6098 11 12.5052 11C11.4007 11 10.5052 11.8954 10.5052 13C10.5052 14.1046 11.4007 15 12.5052 15ZM19.5052 15C20.6098 15 21.5052 14.1046 21.5052 13C21.5052 11.8954 20.6098 11 19.5052 11C18.4007 11 17.5052 11.8954 17.5052 13C17.5052 14.1046 18.4007 15 19.5052 15Z"}))},plus:function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M17 6.5C17 5.94772 16.5523 5.5 16 5.5C15.4477 5.5 15 5.94772 15 6.5V14.9999L6.50003 14.9999C5.94774 14.9999 5.50003 15.4476 5.50003 15.9999C5.50003 16.5522 5.94775 16.9999 6.50003 16.9999L15 16.9999V25.5C15 26.0523 15.4477 26.5 16 26.5C16.5523 26.5 17 26.0523 17 25.5V16.9999L25.5 16.9998C26.0523 16.9998 26.5 16.5521 26.5 15.9998C26.5 15.4475 26.0523 14.9998 25.5 14.9998L17 14.9999V6.5Z"}))},thread:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M7.07823 9.50093C5.52691 11.6555 5.00002 14.2711 5.00002 16V16.0453L4.99592 16.0905C4.69274 19.4254 5.88935 21.7758 7.81263 23.4032C9.77944 25.0675 12.5674 26.0198 15.4438 26.3394C18.3177 26.6587 21.4835 26.3846 23.9846 25.8557C25.2353 25.5912 26.285 25.2702 27.0297 24.947C27.3186 24.8216 27.5433 24.7037 27.7089 24.5993C27.6319 24.5504 27.5387 24.4961 27.4276 24.4369C27.1394 24.2834 26.8095 24.1376 26.4671 23.9879L26.4074 23.9618C26.1053 23.8299 25.7676 23.6824 25.5119 23.5394C25.0483 23.2801 24.5935 22.9852 24.2617 22.6715C24.0985 22.517 23.9127 22.3099 23.7884 22.0518C23.6568 21.7786 23.5626 21.3708 23.7475 20.9394C24.7469 18.6075 25.2219 17.3302 25.4519 16.4868C25.6667 15.6994 25.6667 15.3029 25.6667 14.6724V14.6666C25.6667 14.1655 25.3754 11.8692 23.9225 9.72813C22.5158 7.65506 19.9853 5.66663 15.3334 5.66663C11.1259 5.66663 8.59283 7.39732 7.07823 9.50093ZM5.45516 8.33232C7.34055 5.71371 10.4741 3.66663 15.3334 3.66663C20.6814 3.66663 23.8176 6.01152 25.5775 8.60512C27.2913 11.1307 27.6667 13.8344 27.6667 14.6666C27.6667 15.3661 27.666 15.9696 27.3815 17.0131C27.1274 17.9445 26.6476 19.2296 25.7582 21.3232C25.9226 21.4535 26.1666 21.614 26.4882 21.7939C26.6543 21.8868 26.9096 21.9986 27.2683 22.1554C27.6012 22.301 28.0007 22.4762 28.3675 22.6715C28.7193 22.8588 29.1305 23.11 29.4363 23.4384C29.756 23.7818 30.0917 24.371 29.8519 25.0903C29.6939 25.5643 29.327 25.9009 29.0213 26.1245C28.6892 26.3675 28.2771 26.5859 27.826 26.7817C26.9195 27.1751 25.7313 27.5305 24.3984 27.8124C21.7325 28.3762 18.349 28.6745 15.2229 28.3272C12.0993 27.9801 8.88728 26.9325 6.52075 24.93C4.11972 22.8984 2.65166 19.9302 3.00012 15.9543C3.00907 13.9059 3.62015 10.8809 5.45516 8.33232ZM10.6667 13.1656C10.6667 12.5955 11.1288 12.1333 11.6989 12.1333H17.6344C18.2045 12.1333 18.6667 12.5955 18.6667 13.1656C18.6667 13.7357 18.2045 14.1978 17.6344 14.1978H11.6989C11.1288 14.1978 10.6667 13.7357 10.6667 13.1656ZM11.6989 18H18.9678C19.5379 18 20 18.4622 20 19.0323C20 19.6024 19.5379 20.0645 18.9678 20.0645H11.6989C11.1288 20.0645 10.6667 19.6024 10.6667 19.0323C10.6667 18.4622 11.1288 18 11.6989 18Z"}))},user:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M19 10.5C19 8.84315 17.6569 7.5 16 7.5C14.3431 7.5 13 8.84315 13 10.5C13 12.1569 14.3431 13.5 16 13.5C17.6569 13.5 19 12.1569 19 10.5ZM21 10.5C21 13.2614 18.7614 15.5 16 15.5C13.2386 15.5 11 13.2614 11 10.5C11 7.73858 13.2386 5.5 16 5.5C18.7614 5.5 21 7.73858 21 10.5ZM12.8891 17.2438L15.0061 17.7399C15.6479 17.8904 16.317 17.8798 16.9538 17.7093L18.5046 17.2939C19.3006 17.0807 20.1369 17.0675 20.9392 17.2555L21.141 17.3028C23.4016 17.8326 25 19.849 25 22.1709V24C25 25.6569 23.6569 27 22 27H10C8.34315 27 7 25.6569 7 24V21.9122C7 19.7419 8.45785 17.8421 10.5543 17.2806C11.3177 17.0761 12.1197 17.0635 12.8891 17.2438ZM11.0718 19.2125C9.84977 19.5398 9 20.6471 9 21.9122V24C9 24.5523 9.44772 25 10 25H22C22.5523 25 23 24.5523 23 24V22.1709C23 20.7778 22.0409 19.5679 20.6846 19.25L20.4828 19.2028C20.0015 19.0899 19.4997 19.0978 19.0221 19.2258L17.4712 19.6412C16.5161 19.897 15.5124 19.9128 14.5497 19.6872L12.4327 19.191C11.9842 19.0859 11.5167 19.0933 11.0718 19.2125Z"}))},clock:function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M27 16C27 9.92487 22.0751 5 16 5C9.92487 5 5 9.92487 5 16C5 22.0751 9.92487 27 16 27C22.0751 27 27 22.0751 27 16ZM29 16C29 23.1797 23.1797 29 16 29C8.8203 29 3 23.1797 3 16C3 8.8203 8.8203 3 16 3C23.1797 3 29 8.8203 29 16ZM17 9V15.5858L19.7071 18.2929C20.0976 18.6834 20.0976 19.3166 19.7071 19.7071C19.3166 20.0976 18.6834 20.0976 18.2929 19.7071L15.2929 16.7071C15.1054 16.5196 15 16.2652 15 16V9C15 8.44772 15.4477 8 16 8C16.5523 8 17 8.44772 17 9Z"}))},back:function(e){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",className:"rcx-svg--directional",fill:"currentColor"},e),(0,emotion_react_browser_esm.tZ)("path",{d:"M11.7071 9.29289C11.3166 8.90237 10.6834 8.90237 10.2929 9.29289L4.29289 15.2929C3.90237 15.6834 3.90237 16.3166 4.29289 16.7071L10.2929 22.7071C10.6834 23.0976 11.3166 23.0976 11.7071 22.7071C12.0976 22.3166 12.0976 21.6834 11.7071 21.2929L7.41421 17H25.5V21C25.5 21.5523 25.9477 22 26.5 22C27.0523 22 27.5 21.5523 27.5 21V16C27.5 15.4477 27.0523 15 26.5 15H7.41421L11.7071 10.7071C12.0976 10.3166 12.0976 9.68342 11.7071 9.29289Z"}))},report:function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M16 11C16.5523 11 17 11.4477 17 12V19C17 19.5523 16.5523 20 16 20C15.4477 20 15 19.5523 15 19V12C15 11.4477 15.4477 11 16 11Z"}),(0,emotion_react_browser_esm.tZ)("path",{d:"M16 21C16.5523 21 17 21.4477 17 22C17 22.5523 16.5523 23 16 23C15.4477 23 15 22.5523 15 22C15 21.4477 15.4477 21 16 21Z"}),(0,emotion_react_browser_esm.tZ)("path",{d:"M17.7219 4.94824L28.9694 23.9826C29.7572 25.3158 28.7961 27 27.2476 27H4.75245C3.20385 27 2.24278 25.3158 3.0306 23.9826L14.2781 4.94824C15.0523 3.63818 16.9477 3.63819 17.7219 4.94824ZM4.75245 25L27.2476 25L16 5.9657L4.75245 25Z"}))},info:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M16 27C22.0751 27 27 22.0751 27 16C27 9.92487 22.0751 5 16 5C9.92487 5 5 9.92487 5 16C5 22.0751 9.92487 27 16 27ZM16 29C8.8203 29 3 23.1797 3 16C3 8.8203 8.8203 3 16 3C23.1797 3 29 8.8203 29 16C29 23.1797 23.1797 29 16 29ZM17 11C17 11.5523 16.5523 12 16 12C15.4477 12 15 11.5523 15 11C15 10.4477 15.4477 10 16 10C16.5523 10 17 10.4477 17 11ZM16 13C16.5523 13 17 13.4477 17 14V21C17 21.5523 16.5523 22 16 22C15.4477 22 15 21.5523 15 21V14C15 13.4477 15.4477 13 16 13Z"}))},members:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M11.5 12.9057C13.1748 12.9057 14.5 11.5658 14.5 9.95285C14.5 8.33986 13.1748 7 11.5 7C9.82524 7 8.5 8.33986 8.5 9.95285C8.5 11.5658 9.82524 12.9057 11.5 12.9057ZM11.5 14.9057C8.73858 14.9057 6.5 12.6882 6.5 9.95285C6.5 7.21747 8.73858 5 11.5 5C14.2614 5 16.5 7.21747 16.5 9.95285C16.5 12.6882 14.2614 14.9057 11.5 14.9057ZM22.3 12.4104C23.4225 12.4104 24.3 11.5141 24.3 10.4481C24.3 9.38222 23.4225 8.48586 22.3 8.48586C21.1775 8.48586 20.3 9.38222 20.3 10.4481C20.3 11.5141 21.1775 12.4104 22.3 12.4104ZM22.3 14.4104C20.0908 14.4104 18.3 12.6364 18.3 10.4481C18.3 8.25983 20.0908 6.48586 22.3 6.48586C24.5091 6.48586 26.3 8.25983 26.3 10.4481C26.3 12.6364 24.5091 14.4104 22.3 14.4104ZM6.17059 16.4771C7.02508 16.205 7.94154 16.1883 8.80557 16.429L10.3209 16.8512C11.0773 17.0619 11.8797 17.0473 12.6279 16.8091L13.5685 16.5096C14.4896 16.2163 15.4774 16.1983 16.4088 16.4578C18.5326 17.0495 20 18.9682 20 21.1537V24.0283C20 25.6695 18.6569 27 17 27H6C4.34315 27 3 25.6695 3 24.0283V20.7855C3 18.8197 4.28122 17.0787 6.17059 16.4771ZM8.26408 18.3362C7.77829 18.2008 7.26303 18.2102 6.78261 18.3632C5.72034 18.7014 5 19.6803 5 20.7855V24.0283C5 24.5754 5.44772 25.0189 6 25.0189H17C17.5523 25.0189 18 24.5754 18 24.0283V21.1537C18 19.8558 17.1286 18.7163 15.8673 18.3649C15.3142 18.2108 14.7275 18.2215 14.1805 18.3957L13.2399 18.6952C12.1177 19.0525 10.9141 19.0745 9.77937 18.7583L8.26408 18.3362ZM21.6 24.335V22.335H26C26.5523 22.335 27 21.8873 27 21.335V20.3784C27 19.5165 26.4148 18.7646 25.5793 18.553C25.255 18.4709 24.9148 18.4766 24.5934 18.5696L24.0809 18.718C23.0571 19.0143 21.9728 19.0326 20.9396 18.7709L20.8246 18.7418L20.7557 18.6075C20.5669 18.2398 20.3106 17.911 20 17.6383L19.53 17.2256L19.4541 17.1701C19.1616 16.9565 18.8434 16.7848 18.5086 16.6584C18.5415 16.6478 18.5746 16.6377 18.6079 16.6281C19.2243 16.4497 19.8771 16.4387 20.4991 16.5962L21.4306 16.8321C22.1195 17.0066 22.8423 16.9944 23.5249 16.7968L24.0374 16.6485C24.7 16.4567 25.4017 16.4449 26.0703 16.6142C27.7933 17.0506 29 18.6011 29 20.3784V21.335C29 22.9919 27.6569 24.335 26 24.335H21.6ZM16 20.085V21.3469L16 21.335V20.0979L16 20.085Z"}))},link:function(r){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",className:"rcx-svg--directional",fill:"currentColor"},r),(0,emotion_react_browser_esm.tZ)("path",{d:"M7.87931 8.61289L7.44268 9.05885C6.28356 10.2427 6.30364 12.1421 7.48753 13.3013L12.0382 17.7567C13.2221 18.9158 15.1215 18.8957 16.2806 17.7118L16.7172 17.2659C16.7398 17.2428 16.762 17.2194 16.7837 17.1958L16.7868 17.1989C16.9683 17.0144 17.2208 16.8999 17.5 16.8999C18.0523 16.8999 18.5 17.3476 18.5 17.8999C18.5 18.1999 18.3679 18.469 18.1587 18.6523L18.1463 18.6651L17.7097 19.111C15.7778 21.0842 12.6121 21.1177 10.639 19.1858L6.08834 14.7303C4.11519 12.7985 4.08172 9.63282 6.0136 7.65966L6.45022 7.21371C8.38209 5.24055 11.5477 5.20709 13.5209 7.13896L15.8551 9.42431C15.8856 9.45077 15.9145 9.47906 15.9416 9.50899L15.9532 9.52042L15.9525 9.52122C16.1066 9.69716 16.2 9.92763 16.2 10.1799C16.2 10.7322 15.7523 11.1799 15.2 11.1799C14.9553 11.1799 14.7312 11.092 14.5574 10.9461L14.5541 10.9495L12.1217 8.56805C10.9378 7.40892 9.03843 7.429 7.87931 8.61289ZM24.6207 24.0001L25.0573 23.5542C26.2164 22.3703 26.1964 20.4709 25.0125 19.3118L20.4618 14.8563C19.2779 13.6972 17.3785 13.7173 16.2194 14.9012L15.7828 15.3471C15.7602 15.3702 15.738 15.3936 15.7163 15.4172L15.7132 15.4141C15.5317 15.5987 15.2792 15.7131 15 15.7131C14.4477 15.7131 14 15.2654 14 14.7131C14 14.4131 14.1321 14.144 14.3413 13.9607L14.3537 13.948L14.7903 13.502C16.7222 11.5288 19.8879 11.4954 21.861 13.4273L26.4117 17.8827C28.3848 19.8146 28.4183 22.9802 26.4864 24.9534L26.0498 25.3993C24.1179 27.3725 20.9523 27.4059 18.9791 25.4741L16.6449 23.1887C16.6144 23.1623 16.5855 23.134 16.5584 23.104L16.5468 23.0926L16.5475 23.0918C16.3934 22.9159 16.3 22.6854 16.3 22.4331C16.3 21.8808 16.7477 21.4331 17.3 21.4331C17.5447 21.4331 17.7688 21.521 17.9426 21.6669L17.9459 21.6635L20.3783 24.045C21.5622 25.2041 23.4616 25.184 24.6207 24.0001Z"}))},magnifier:function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M20.3288 21.7429C18.6049 23.1536 16.4013 24 14 24C8.47715 24 4 19.5228 4 14C4 8.47715 8.47715 4 14 4C19.5228 4 24 8.47715 24 14C24 16.4012 23.1537 18.6048 21.743 20.3287L27.5313 26.117C27.9218 26.5075 27.9218 27.1407 27.5313 27.5312C27.1408 27.9217 26.5076 27.9217 26.1171 27.5312L20.3288 21.7429ZM22 14C22 9.58172 18.4183 6 14 6C9.58172 6 6 9.58172 6 14C6 18.4183 9.58172 22 14 22C18.4183 22 22 18.4183 22 14Z"}))},edit:function(e){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",className:"rcx-svg--directional",fill:"currentColor"},e),(0,emotion_react_browser_esm.tZ)("path",{d:"M24.841 4.0706L28.0554 7.47976C28.8023 8.2719 28.7783 9.51592 28.0016 10.2788L11.1961 26.7825C10.8868 27.0862 10.4872 27.2812 10.0576 27.3382L6.56885 27.8007C5.18073 27.9847 4.03809 26.7221 4.35934 25.3592L5.27696 21.4663C5.3607 21.111 5.54005 20.7854 5.79559 20.5248L21.9578 4.04235C22.7527 3.23172 24.0622 3.24455 24.841 4.0706ZM20.1534 8.73912L23.4045 11.9902L26.6002 8.85179L23.3859 5.44263L20.1534 8.73912ZM18.7531 10.1672L7.22361 21.9251L6.306 25.818L9.79471 25.3555L21.9774 13.3916L18.7531 10.1672Z"}))},"arrow-back":function(e){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",className:"rcx-svg--directional",fill:"currentColor"},e),(0,emotion_react_browser_esm.tZ)("path",{d:"M11.7071 9.29289C11.3166 8.90237 10.6834 8.90237 10.2929 9.29289L4.29289 15.2929C3.90237 15.6834 3.90237 16.3166 4.29289 16.7071L10.2929 22.7071C10.6834 23.0976 11.3166 23.0976 11.7071 22.7071C12.0976 22.3166 12.0976 21.6834 11.7071 21.2929L7.41421 17H25.5V21C25.5 21.5523 25.9477 22 26.5 22C27.0523 22 27.5 21.5523 27.5 21V16C27.5 15.4477 27.0523 15 26.5 15H7.41421L11.7071 10.7071C12.0976 10.3166 12.0976 9.68342 11.7071 9.29289Z"}))},google:function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M18,10.1866641 C18,14.751996 14.8225871,17.999995 10.1310019,17.999995 C7.97379233,18.0023573 5.9042462,17.1602614 4.37886773,15.6594585 C2.85348926,14.1586555 1.99760413,12.1224521 2.00000504,9.99999752 C2.00000504,5.57422112 5.63275375,2 10.1310019,2 C12.3209504,2 14.1639764,2.79111087 15.583287,4.09333268 L13.369849,6.18666537 C10.4752141,3.43999955 5.09159074,5.50311003 5.09159074,9.99999752 C5.09159074,12.7911078 7.35742853,15.0515515 10.1310019,15.0515515 C13.3508767,15.0515515 14.557878,12.7804411 14.7476012,11.6026637 L10.1310019,11.6026637 L10.1310019,8.85244232 L17.8717109,8.85244232 C17.9476002,9.26221997 18,9.65599763 18,10.187553 L18,10.1866641 Z"}))},multiline:function(r){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},r),(0,emotion_react_browser_esm.tZ)("path",{d:"M15.859 4.06668C16.3745 4.26494 16.6316 4.84353 16.4333 5.359L11.4333 18.359C11.2351 18.8745 10.6565 19.1316 10.141 18.9334C9.62555 18.7351 9.3684 18.1565 9.56665 17.641L14.5667 4.64105C14.7649 4.12557 15.3435 3.86842 15.859 4.06668Z"}),(0,emotion_react_browser_esm.tZ)("path",{d:"M8.70711 7.79292C9.09763 8.18344 9.09763 8.81661 8.70711 9.20713L6.41421 11.5L8.70711 13.7929C9.09763 14.1834 9.09763 14.8166 8.70711 15.2071C8.31658 15.5977 7.68342 15.5977 7.29289 15.2071L4.29289 12.2071C4.10536 12.0196 4 11.7652 4 11.5C4 11.2348 4.10536 10.9805 4.29289 10.7929L7.29289 7.79292C7.68342 7.40239 8.31658 7.40239 8.70711 7.79292Z"}),(0,emotion_react_browser_esm.tZ)("path",{d:"M17.2929 7.79292C17.6834 7.40239 18.3166 7.40239 18.7071 7.79292L21.7071 10.7929C21.8946 10.9805 22 11.2348 22 11.5C22 11.7652 21.8946 12.0196 21.7071 12.2071L18.7071 15.2071C18.3166 15.5977 17.6834 15.5977 17.2929 15.2071C16.9024 14.8166 16.9024 14.1834 17.2929 13.7929L19.5858 11.5L17.2929 9.20713C16.9024 8.81661 16.9024 8.18344 17.2929 7.79292Z"}),(0,emotion_react_browser_esm.tZ)("path",{d:"M21 5C21 4.44772 21.4477 4 22 4H25C26.6569 4 28 5.34315 28 7V25C28 26.6569 26.6569 28 25 28H7C5.34314 28 4 26.6569 4 25V20C4 19.4477 4.44772 19 5 19C5.55228 19 6 19.4477 6 20V26H26V6H22C21.4477 6 21 5.55228 21 5Z"}))},code:function(C){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},C),(0,emotion_react_browser_esm.tZ)("path",{d:"M19.6923 6.39999C20.2078 6.59825 20.4649 7.17684 20.2667 7.69232L13.6 25.0257C13.4018 25.5411 12.8232 25.7983 12.3077 25.6C11.7922 25.4018 11.5351 24.8232 11.7333 24.3077L18.4 6.97436C18.5982 6.45889 19.1768 6.20173 19.6923 6.39999ZM10.0404 11.2929C10.431 11.6834 10.431 12.3166 10.0404 12.7071L6.74755 16L10.0404 19.2929C10.431 19.6834 10.431 20.3166 10.0404 20.7071C9.64992 21.0976 9.01675 21.0976 8.62623 20.7071L4.62623 16.7071C4.2357 16.3166 4.2357 15.6834 4.62623 15.2929L8.62623 11.2929C9.01675 10.9024 9.64992 10.9024 10.0404 11.2929ZM21.9596 11.2929C22.3501 10.9024 22.9832 10.9024 23.3738 11.2929L27.3738 15.2929C27.7643 15.6834 27.7643 16.3166 27.3738 16.7071L23.3738 20.7071C22.9832 21.0976 22.3501 21.0976 21.9596 20.7071C21.569 20.3166 21.569 19.6834 21.9596 19.2929L25.2525 16L21.9596 12.7071C21.569 12.3166 21.569 11.6834 21.9596 11.2929Z"}))},strike:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M10.3888 11C10.3888 9.01438 12.4323 7 15.9999 7C18.7071 7 20.5963 8.19929 21.2919 9.62782C21.5337 10.1244 22.1323 10.3309 22.6288 10.0891C23.1254 9.84729 23.3319 9.24875 23.0901 8.75221C21.9677 6.44723 19.2373 5 15.9999 5C11.837 5 8.39129 7.46097 8.38877 10.9961C8.38569 11.4408 8.4535 11.8832 8.58965 12.3065C8.75874 12.8323 9.32203 13.1214 9.8478 12.9523C10.3736 12.7833 10.6627 12.22 10.4936 11.6942C10.4223 11.4725 10.3869 11.2408 10.3888 11.0079V11ZM5 15C4.44772 15 4 15.4477 4 16C4 16.5523 4.44772 17 5 17H17.1558C18.5894 17.4262 19.8138 17.886 20.6833 18.5225C21.5245 19.1382 22 19.8889 22 21.0001C22 21.9741 21.449 22.9501 20.3685 23.7219C19.2899 24.4923 17.7486 25.0001 16 25.0001C14.2514 25.0001 12.7101 24.4923 11.6315 23.7219C10.551 22.9501 10 21.9741 10 21.0001C10 20.4478 9.55228 20.0001 9 20.0001C8.44772 20.0001 8 20.4478 8 21.0001C8 22.7876 9.01603 24.3115 10.469 25.3494C11.9239 26.3886 13.8826 27.0001 16 27.0001C18.1174 27.0001 20.0761 26.3886 21.531 25.3494C22.984 24.3115 24 22.7876 24 21.0001C24 19.2012 23.1802 17.9165 21.9865 17H27C27.5523 17 28 16.5523 28 16C28 15.4477 27.5523 15 27 15H17.3219C17.3072 14.9997 17.2925 14.9997 17.2779 15H5Z"}))},bold:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M7.29243 5.29263C7.47998 5.10509 7.73435 4.99974 7.99958 4.99976L17.5002 5.00037C17.5003 5.00037 17.5002 5.00037 17.5002 5.00037C18.9589 5.00038 20.3579 5.57984 21.3893 6.61128C22.4208 7.64273 23.0002 9.04167 23.0002 10.5004C23.0002 11.9591 22.4208 13.358 21.3893 14.3895C21.3642 14.4146 21.3388 14.4395 21.3132 14.4641C22.0278 14.7626 22.6847 15.1995 23.2429 15.7577C24.3681 16.8829 25.0002 18.4091 25.0002 20.0004C25.0002 21.5917 24.3681 23.1178 23.2429 24.243C22.1177 25.3682 20.5915 26.0004 19.0002 26.0004L7.99946 25.9998C7.44719 25.9997 6.99951 25.552 6.99951 24.9998V5.99976C6.99951 5.73453 7.10488 5.48016 7.29243 5.29263ZM17.5002 14.0004C18.4285 14.0004 19.3187 13.6316 19.9751 12.9752C20.6315 12.3189 21.0002 11.4286 21.0002 10.5004C21.0002 9.57211 20.6315 8.68187 19.9751 8.02549C19.3187 7.36911 18.4285 7.00037 17.5002 7.00037L8.99951 6.99982V14.0004H17.5002ZM8.99951 16.0004V23.9998L19.0002 24.0004C19.0003 24.0004 19.0002 24.0004 19.0002 24.0004C20.0611 24.0004 21.0785 23.5789 21.8287 22.8288C22.5788 22.0786 23.0002 21.0612 23.0002 20.0004C23.0002 18.9395 22.5788 17.9221 21.8287 17.1719C21.0785 16.4218 20.0611 16.0004 19.0002 16.0004H8.99951Z"}))},italic:function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M17.6122 7.99976L12.2788 23.9998H7.99939C7.44711 23.9998 6.99939 24.4475 6.99939 24.9998C6.99939 25.552 7.44711 25.9998 7.99939 25.9998H17.9994C18.5517 25.9998 18.9994 25.552 18.9994 24.9998C18.9994 24.4475 18.5517 23.9998 17.9994 23.9998H14.387L19.7204 7.99976H23.9994C24.5517 7.99976 24.9994 7.55204 24.9994 6.99976C24.9994 6.44747 24.5517 5.99976 23.9994 5.99976H19.0306C19.0098 5.9991 18.9891 5.99911 18.9684 5.99976H13.9994C13.4471 5.99976 12.9994 6.44747 12.9994 6.99976C12.9994 7.55204 13.4471 7.99976 13.9994 7.99976H17.6122Z"}))},"star-filled":function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M18.1991 4.06355L20.3811 10.0999H26.4886C28.2971 10.0999 29.1769 12.3094 27.8634 13.5525L23.2418 17.9265L24.9101 24.7281C25.3529 26.5334 23.3086 27.9136 21.7997 26.828L16.2453 22.8319L10.6909 26.828C9.182 27.9136 7.13762 26.5334 7.58043 24.7281L9.24321 17.9491L4.3185 13.5989C2.9379 12.3794 3.80047 10.0999 5.64257 10.0999H12.5648L14.4078 4.15153C14.9755 2.31929 17.5471 2.25961 18.1991 4.06355Z"}))},trash:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M23 27H9V13H23V27ZM7 27C7 28.1046 7.89543 29 9 29H23C24.1046 29 25 28.1046 25 27V13C26.1046 13 27 12.1046 27 11V7C27 5.89543 26.1046 5 25 5H18C18 3.89543 17.1046 3 16 3C14.8954 3 14 3.89543 14 5H7C5.89543 5 5 5.89543 5 7V11C5 12.1046 5.89543 13 7 13V27ZM16 7H25V11H23H9H7L7 7H16ZM13 17V23C13 23.5523 13.4477 24 14 24C14.5523 24 15 23.5523 15 23V17C15 16.4477 14.5523 16 14 16C13.4477 16 13 16.4477 13 17ZM18 16C17.4477 16 17 16.4477 17 17V23C17 23.5523 17.4477 24 18 24C18.5523 24 19 23.5523 19 23V17C19 16.4477 18.5523 16 18 16Z"}))},kebab:function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M18 8C18 9.10457 17.1046 10 16 10C14.8954 10 14 9.10457 14 8C14 6.89543 14.8954 6 16 6C17.1046 6 18 6.89543 18 8Z M18 16C18 17.1046 17.1046 18 16 18C14.8954 18 14 17.1046 14 16C14 14.8954 14.8954 14 16 14C17.1046 14 18 14.8954 18 16Z M18 24C18 25.1046 17.1046 26 16 26C14.8954 26 14 25.1046 14 24C14 22.8954 14.8954 22 16 22C17.1046 22 18 22.8954 18 24Z"}))},check:function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M26.7033 7.28911C27.0959 7.67753 27.0993 8.31069 26.7109 8.7033L11.871 23.7033C11.6831 23.8932 11.427 24.0001 11.1599 24C10.8927 23.9999 10.6367 23.8929 10.4489 23.7029L5.28872 18.4814C4.90052 18.0886 4.90426 17.4554 5.29709 17.0672C5.68991 16.679 6.32307 16.6827 6.71128 17.0756L11.1605 21.5777L25.2891 7.2967C25.6775 6.90408 26.3107 6.90069 26.7033 7.28911Z"}))},"error-circle":function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M29 16C29 23.1797 23.1797 29 16 29C8.8203 29 3 23.1797 3 16C3 8.8203 8.8203 3 16 3C23.1797 3 29 8.8203 29 16ZM20.7071 11.2929C20.3166 10.9024 19.6834 10.9024 19.2929 11.2929L16 14.5858L12.7071 11.2929C12.3166 10.9024 11.6834 10.9024 11.2929 11.2929C10.9024 11.6834 10.9024 12.3166 11.2929 12.7071L14.5858 16L11.2929 19.2929C10.9024 19.6834 10.9024 20.3166 11.2929 20.7071C11.6834 21.0976 12.3166 21.0976 12.7071 20.7071L16 17.4142L19.2929 20.7071C19.6834 21.0976 20.3166 21.0976 20.7071 20.7071C21.0976 20.3166 21.0976 19.6834 20.7071 19.2929L17.4142 16L20.7071 12.7071C21.0976 12.3166 21.0976 11.6834 20.7071 11.2929Z"}))},"arrow-down":function(e){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:"rcx-svg--directional",fill:"currentColor"},e),(0,emotion_react_browser_esm.tZ)("path",{d:"M10,11.9512195 L14.4571429,7.51219512 C14.7415132,7.22898071 15.2013439,7.22898071 15.4857143,7.51219512 L15.4857143,7.51219512 C15.7685918,7.79392277 15.769524,8.25162572 15.4877964,8.53450327 C15.4871038,8.53519872 15.4864097,8.53589275 15.4857143,8.53658537 L10.7056652,13.2972034 C10.315473,13.6858094 9.68452704,13.6858094 9.29433482,13.2972034 L4.51428571,8.53658537 C4.23140816,8.25485772 4.23047597,7.79715477 4.51220362,7.51427722 C4.51289624,7.51358177 4.51359027,7.51288774 4.51428571,7.51219512 L4.51428571,7.51219512 C4.7986561,7.22898071 5.25848675,7.22898071 5.54285714,7.51219512 L7.51428571,9.47560976 L10,11.9512195 Z"}))},"pin-filled":function(l){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"},l),(0,emotion_react_browser_esm.tZ)("path",{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a6 6 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707s.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a6 6 0 0 1 1.013.16l3.134-3.133a3 3 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146"}))},clipboard:function(r){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),(0,emotion_react_browser_esm.tZ)("path",{d:"M3,3 L3,14.2571429 C3,14.8094276 3.44771525,15.2571429 4,15.2571429 L6.61290323,15.2571429 L6.61290323,17 C6.61290323,17.5522847 7.06061848,18 7.61290323,18 L16,18 C16.5522847,18 17,17.5522847 17,17 L17,10.1263643 C17,9.86322398 16.8962817,9.61068815 16.7113319,9.42350804 L12.3800548,5.04000087 C12.1921856,4.8498662 11.9360168,4.74285714 11.6687229,4.74285714 L11.1832258,4.74285714 L8.76808469,2.2973277 C8.58020168,2.10708066 8.32395462,2 8.05657107,2 L4,2 C3.44771525,2 3,2.44771525 3,3 Z M4.85483871,3.37051429 L7.70455922,3.37051429 C7.83827986,3.37051429 7.96642858,3.42407767 8.06037453,3.51923738 L9.2683871,4.74285714 L6.61290323,4.74285714 L6.61290323,13.8857143 L4.85483871,13.8857143 C4.57869633,13.8857143 4.35483871,13.6618567 4.35483871,13.3857143 L4.35483871,3.87051429 C4.35483871,3.59437191 4.57869633,3.37051429 4.85483871,3.37051429 Z M8.46774194,6.11428571 L10.6290323,6.11428571 C10.9051746,6.11428571 11.1290323,6.33814334 11.1290323,6.61428571 L11.1290323,10.1848 C11.1290323,10.4609424 11.3528899,10.6848 11.6290323,10.6848 L15.1451613,10.6848 C15.4213037,10.6848 15.6451613,10.9086576 15.6451613,11.1848 L15.6451613,16.1276571 C15.6451613,16.4037995 15.4213037,16.6276571 15.1451613,16.6276571 L8.46774194,16.6276571 C8.19159956,16.6276571 7.96774194,16.4037995 7.96774194,16.1276571 L7.96774194,6.61428571 C7.96774194,6.33814334 8.19159956,6.11428571 8.46774194,6.11428571 Z M12.6550106,7.25666381 L14.5186194,9.14309234 C14.5574335,9.18238168 14.5570482,9.24569701 14.5177589,9.28451108 C14.4990414,9.3030021 14.4737906,9.31337143 14.4474798,9.31337143 L12.583871,9.31337143 C12.5286425,9.31337143 12.483871,9.2685999 12.483871,9.21337143 L12.483871,7.3269429 C12.483871,7.27171442 12.5286425,7.2269429 12.583871,7.2269429 C12.6106035,7.2269429 12.6362232,7.23764635 12.6550106,7.25666381 Z"}))},clip:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M5.15879562,13.4638624 L5.15879562,13.4638624 C4.90599039,13.2480772 4.87287013,12.8694565 5.08437038,12.6130557 L10.5580734,5.97730965 C11.4745445,4.86627574 13.0944944,4.71955997 14.1887917,5.65361162 C15.2780481,6.58336059 15.4186756,8.24043454 14.5053645,9.34763752 L8.64526707,16.4518079 C7.31075341,18.0696329 4.93412315,18.2783509 3.34272418,16.9202886 C1.75000514,15.5610997 1.54554911,13.1390247 2.88321939,11.5173729 L9.25165016,3.79695237 C11.0084462,1.66719622 14.1363767,1.39165004 16.2300793,3.17904132 C18.3256583,4.96803453 18.5993827,8.14860581 16.8423124,10.2786944 L10.8542425,17.5380051 C10.6472844,17.7888995 10.2761216,17.8245169 10.0252273,17.6175588 C10.0226788,17.6154566 10.020148,17.613333 10.0176353,17.6111882 L10.0176353,17.6111882 C9.76483006,17.395403 9.73170981,17.0167823 9.94321006,16.7603815 L15.9312799,9.50107076 C17.2661487,7.88281524 17.0580903,5.46525642 15.465561,4.10571614 C13.8746589,2.74756498 11.496974,2.9570204 10.1626826,4.57457596 L3.79425183,12.2949965 C2.87823836,13.4054756 3.01826627,15.0643071 4.10707307,15.9934691 C5.1958048,16.9225671 6.8222928,16.7797273 7.73423463,15.6741843 L13.5943321,8.57001393 C14.0858446,7.97415549 14.0099812,7.080225 13.4243447,6.58034733 C12.8338231,6.07629989 11.9639083,6.15508641 11.4691058,6.75493324 L5.99540282,13.3906793 C5.78844473,13.6415736 5.41728196,13.6771911 5.16638758,13.470233 C5.1638391,13.4681308 5.16130836,13.4660072 5.15879562,13.4638624 Z"}))},download:function(r){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),(0,emotion_react_browser_esm.tZ)("path",{d:"M13.0661854,13.8691048 L13.0661854,13.8691048 C13.3204823,14.1197896 13.3234104,14.5291581 13.0727256,14.783455 C13.0705612,14.7856506 13.0683811,14.7878308 13.0661854,14.7899952 L10.6543517,17.1675709 C10.2650167,17.5513757 9.63962467,17.5513757 9.25028971,17.1675709 L6.83845596,14.7899952 C6.58415908,14.5393104 6.58123091,14.1299419 6.83191572,13.875645 C6.83408017,13.8734494 6.83626031,13.8712692 6.83845596,13.8691048 L6.83845596,13.8691048 C7.09749077,13.6137493 7.51358056,13.6137493 7.77261537,13.8691048 L9.25137581,15.3268606 L9.25137581,10.0339893 C9.25137581,9.66917735 9.54711432,9.37343883 9.91192627,9.37343883 L9.91192627,9.37343883 C10.2767382,9.37343883 10.5724767,9.66917735 10.5724767,10.0339893 L10.5724767,15.4065019 L12.132026,13.8691048 C12.3910608,13.6137493 12.8071506,13.6137493 13.0661854,13.8691048 Z M14.9987456,5.44238699 C16.7017593,5.72193582 18,7.18117469 18,8.93932691 C18,10.897313 16.3898681,12.4845743 14.4036697,12.4845743 L12.8484335,12.4845743 C12.4888034,12.4845743 12.1972656,12.1930365 12.1972656,11.8334064 L12.1972656,11.8334064 C12.1972656,11.4737763 12.4888034,11.1822385 12.8484335,11.1822385 L14.4036697,11.1822385 C15.6602442,11.1822385 16.6788991,10.1780528 16.6788991,8.93932691 C16.6788991,7.70060103 15.6602442,6.69641529 14.4036697,6.69641529 L13.7431193,6.69641529 L13.7431193,6.0452474 C13.7431193,5.20611051 13.0530627,4.52585566 12.2018349,4.52585566 C11.8271022,4.52585566 11.4747517,4.6573116 11.1968202,4.89324889 L10.6727099,5.33816841 L10.2459585,4.80158937 C9.74752164,4.17487601 8.98815837,3.80233578 8.16513761,3.80233578 C6.70588984,3.80233578 5.52293578,4.96848696 5.52293578,6.40700734 C5.52293578,6.70702583 5.574134,6.99923245 5.67311153,7.27528801 L5.98438594,8.14345504 L4.86238532,8.14345504 C4.01115745,8.14345504 3.32110092,8.8237099 3.32110092,9.66284679 C3.32110092,10.5019837 4.01115745,11.1822385 4.86238532,11.1822385 L6.77545553,11.1822385 C7.13508563,11.1822385 7.42662342,11.4737763 7.42662342,11.8334064 L7.42662342,11.8334064 C7.42662342,12.1930365 7.13508563,12.4845743 6.77545553,12.4845743 L4.86238532,12.4845743 C3.28153356,12.4845743 2,11.2212439 2,9.66284679 C2,8.31713817 2.95559925,7.19145146 4.23434884,6.90925214 C4.21276266,6.74369761 4.20183486,6.57602338 4.20183486,6.40700734 C4.20183486,4.24922677 5.97626595,2.5 8.16513761,2.5 C9.18633879,2.5 10.1442246,2.88377985 10.8671476,3.5484842 C11.2727861,3.3374289 11.7287839,3.22351988 12.2018349,3.22351988 C13.5727949,3.22351988 14.718642,4.17365257 14.9987456,5.44238699 Z"}))},"chevron-down":function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M8.79289 12.2929C9.18342 11.9024 9.81658 11.9024 10.2071 12.2929L16 18.0858L21.7929 12.2929C22.1834 11.9024 22.8166 11.9024 23.2071 12.2929C23.5976 12.6834 23.5976 13.3166 23.2071 13.7071L16.7071 20.2071C16.3166 20.5976 15.6834 20.5976 15.2929 20.2071L8.79289 13.7071C8.40237 13.3166 8.40237 12.6834 8.79289 12.2929Z"}))},"chevron-left":function(e){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",className:"rcx-svg--directional",fill:"currentColor"},e),(0,emotion_react_browser_esm.tZ)("path",{d:"M12.2929 23.2071C11.9024 22.8166 11.9024 22.1834 12.2929 21.7929L18.0858 16L12.2929 10.2071C11.9024 9.81658 11.9024 9.18342 12.2929 8.79289C12.6834 8.40237 13.3166 8.40237 13.7071 8.79289L20.2071 15.2929C20.5976 15.6834 20.5976 16.3166 20.2071 16.7071L13.7071 23.2071C13.3166 23.5976 12.6834 23.5976 12.2929 23.2071Z"}))},key:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",className:"rcx-svg--directional",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M11 16C12.1037 16 13.1238 15.6424 13.9509 15.0368L14.7071 15.7929L14.7071 15.7929L16.7071 17.7929C16.9435 18.0293 17.0462 18.3683 16.9806 18.6961C16.7108 20.0453 17.1795 20.4527 17.2972 20.5357L20.1644 21.0136C20.6466 21.094 21 21.5112 21 22C21 22.6432 21.3583 23.3281 21.9265 23.9512C22.4706 24.548 23.0705 24.9379 23.3369 25.0569C24.2214 25.3161 24.7277 25.2995 24.9875 25.2288C25.1923 25.1731 25.2689 25.0825 25.3242 24.9471C25.4003 24.7605 25.4344 24.4559 25.3827 24.0428C25.3412 23.7106 25.2513 23.3653 25.1409 23.0551L15.7929 13.7071L15.797 13.703L15.4247 13.3307C15.792 12.6348 16 11.8417 16 11C16 8.23858 13.7614 6 11 6C8.23858 6 6 8.23858 6 11C6 13.7614 8.23858 16 11 16ZM17.7554 12.8411L26.7071 21.7929C26.8029 21.8887 26.8782 22.0029 26.9285 22.1286C27.1204 22.6085 27.2922 23.1942 27.3673 23.7947C27.4407 24.3816 27.433 25.0728 27.1759 25.7029C26.8978 26.3842 26.3494 26.931 25.5125 27.1587C24.7355 27.37 23.7975 27.2833 22.7127 26.9578L22.67 26.945L22.6286 26.9285C22.041 26.6934 21.1711 26.0912 20.4486 25.2988C19.8841 24.6797 19.3188 23.8448 19.0975 22.8634L16.8356 22.4864L16.7582 22.4735L16.6838 22.4487C15.6845 22.1156 14.7111 20.8956 14.9347 18.8489L13.5907 17.5049C12.7894 17.8244 11.9152 18 11 18C7.13401 18 4 14.866 4 11C4 7.13401 7.13401 4 11 4C14.866 4 18 7.13401 18 11C18 11.6372 17.9149 12.2545 17.7554 12.8411ZM12 10.5C12 9.67157 11.3284 9 10.5 9C9.67157 9 9 9.67157 9 10.5C9 11.3284 9.67157 12 10.5 12C11.3284 12 12 11.3284 12 10.5Z"}))},attachment:function(r){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},r),(0,emotion_react_browser_esm.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3065 4.32407C20.8816 4.0958 21.4957 3.98589 22.1136 4.00145C22.7314 4.01701 23.3392 4.1577 23.9021 4.41463C24.4649 4.67152 24.9708 5.03913 25.3917 5.49488C25.8126 5.95056 26.1405 6.48548 26.3582 7.06836C26.5758 7.65118 26.6794 8.27153 26.6637 8.89426C26.648 9.51699 26.5134 10.1313 26.2667 10.7025C26.0205 11.2724 25.6671 11.7891 25.2251 12.2225L25.2222 12.2253L13.8569 23.5045C13.3043 24.0454 12.5588 24.3443 11.7828 24.3248C11.0069 24.3053 10.2774 23.9691 9.75275 23.4011C9.22909 22.8342 8.95126 22.0828 8.97064 21.3135C8.98997 20.5459 9.30395 19.811 9.85328 19.2715L19.3853 9.78688C19.8168 9.35746 20.5148 9.3592 20.9442 9.79076C21.3736 10.2223 21.3719 10.9203 20.9403 11.3497L11.399 20.8436C11.264 20.9757 11.1798 21.1641 11.1746 21.369C11.1694 21.574 11.244 21.7664 11.3722 21.9052C11.4994 22.0428 11.6679 22.1165 11.8383 22.1208C12.0079 22.1251 12.179 22.0607 12.3126 21.9309L23.6801 10.6497C23.9166 10.4182 24.1084 10.1393 24.2427 9.8282C24.3771 9.51706 24.4511 9.18076 24.4598 8.83875C24.4684 8.49674 24.4114 8.15714 24.2928 7.83963C24.1743 7.52217 23.9969 7.23399 23.7722 6.99081C23.5477 6.74769 23.2804 6.55435 22.9866 6.42024C22.6929 6.28617 22.3774 6.21347 22.058 6.20542C21.7386 6.19738 21.4199 6.25411 21.1198 6.37322C20.8207 6.49196 20.5449 6.67077 20.3089 6.90112L8.94114 18.1827C8.11955 18.9868 7.63584 20.1 7.60615 21.2792C7.57645 22.4583 8.00348 23.5944 8.78355 24.4389C9.56259 25.2823 10.6289 25.7659 11.7458 25.794C12.8627 25.8222 13.9521 25.3929 14.7726 24.5898L24.1601 15.4134C24.5955 14.9878 25.2934 14.9957 25.7189 15.4311C26.1445 15.8665 26.1366 16.5644 25.7012 16.9899L16.3147 26.1653C15.0755 27.3782 13.4127 28.0414 11.6903 27.998C9.96798 27.9546 8.3406 27.2086 7.16405 25.9349C5.98852 24.6622 5.35826 22.9671 5.40217 21.2237C5.44605 19.4816 6.15978 17.8215 7.39613 16.6099L18.7643 5.32794C19.2077 4.89396 19.7315 4.5523 20.3065 4.32407Z"}))},"circle-arrow-down":function(C){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},C),(0,emotion_react_browser_esm.tZ)("path",{d:"M27 16C27 9.92487 22.0751 5 16 5C9.92487 5 5 9.92487 5 16C5 22.0751 9.92487 27 16 27C22.0751 27 27 22.0751 27 16ZM29 16C29 23.1797 23.1797 29 16 29C8.8203 29 3 23.1797 3 16C3 8.8203 8.8203 3 16 3C23.1797 3 29 8.8203 29 16ZM21.6956 17.8553L16.6966 22.7214C16.3083 23.0993 15.6898 23.0993 15.3015 22.7214L10.3025 17.8553C9.90672 17.47 9.89819 16.8369 10.2834 16.4412C10.6686 16.0454 11.3018 16.0369 11.6975 16.4221L14.999 19.6359L14.999 11C14.999 10.4477 15.4468 10 15.999 10C16.5513 10 16.999 10.4477 16.999 11L16.999 19.6359L20.3006 16.4221C20.6963 16.0369 21.3294 16.0454 21.7147 16.4412C22.0999 16.8369 22.0914 17.47 21.6956 17.8553Z"}))},online:function(r){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({width:"800px",height:"800px",viewBox:"0 0 36 36",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",className:"iconify iconify--twemoji",preserveAspectRatio:"xMidYMid meet"},r),(0,emotion_react_browser_esm.tZ)("circle",{fill:"#78B159",cx:"18",cy:"18",r:"14"}))},offline:function(e){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,emotion_react_browser_esm.tZ)("path",{d:"M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"#000000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))},away:function(l){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FAB005"},l),(0,emotion_react_browser_esm.tZ)("path",{d:"M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10s10-4.477,10-10C22,6.477,17.523,2,12,2z M14.586,16l-3.293-3.293 C11.105,12.519,11,12.265,11,12V7c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4.586l3,3c0.39,0.39,0.39,1.024,0,1.414l0,0 C15.61,16.39,14.976,16.39,14.586,16z"}))},busy:function(r){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:"si-glyph si-glyph-circle-remove",fill:"#c75765"},r),(0,emotion_react_browser_esm.tZ)("g",{stroke:"none",strokeWidth:"1",fill:"#c75765",fillRule:"evenodd"},(0,emotion_react_browser_esm.tZ)("path",{d:"M8.021,1.097 C3.625,1.097 0.063,4.655 0.063,9.04 C0.063,13.428 3.625,16.985 8.021,16.985 C12.416,16.985 15.979,13.427 15.979,9.04 C15.979,4.654 12.415,1.097 8.021,1.097 L8.021,1.097 Z M10.271617,9.9995909 L5.728383,9.9995909 C4.77186126,9.9995909 4,10.0510388 4,9.00003127 C4,7.9471863 4.77186126,8.00047164 5.728383,8.00047164 L10.271617,8.00047164 C11.2281387,8.00047164 12,7.94626758 12,9.00003127 C12,10.0510388 11.2281387,9.9995909 10.271617,9.9995909 L10.271617,9.9995909 Z",fill:"#c75765",className:"si-glyph-fill"})))},quote:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",className:"rcx-svg--directional",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M5 7C4.63419 7 4.29758 7.19974 4.12229 7.52081C3.947 7.84188 3.96101 8.23305 4.15882 8.54076L7.66834 14H5.5C4.94772 14 4.5 14.4477 4.5 15V24C4.5 24.5523 4.94772 25 5.5 25H13.5C14.0523 25 14.5 24.5523 14.5 24V15C14.5 14.8082 14.4449 14.6205 14.3412 14.4592L9.84118 7.45924C9.65718 7.17302 9.34026 7 9 7H5ZM10.3412 14.4592L6.83167 9H8.45405L12.5 15.2937V23H6.5V16H9.5C9.86581 16 10.2024 15.8003 10.3777 15.4792C10.553 15.1581 10.539 14.767 10.3412 14.4592ZM18 7C17.6342 7 17.2976 7.19974 17.1223 7.52081C16.947 7.84188 16.961 8.23305 17.1588 8.54076L20.6683 14H18.5C17.9477 14 17.5 14.4477 17.5 15V24C17.5 24.5523 17.9477 25 18.5 25H26.5C27.0523 25 27.5 24.5523 27.5 24V15C27.5 14.8082 27.4449 14.6205 27.3412 14.4592L22.8412 7.45924C22.6572 7.17302 22.3403 7 22 7H18ZM23.3412 14.4592L19.8317 9H21.4541L25.5 15.2937V23H19.5V16H22.5C22.8658 16 23.2024 15.8003 23.3777 15.4792C23.553 15.1581 23.539 14.767 23.3412 14.4592Z"}))},eyeopen:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-eye"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,emotion_react_browser_esm.tZ)("circle",{cx:"12",cy:"12",r:"3"}))},eyeclose:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-eye-off"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),(0,emotion_react_browser_esm.tZ)("line",{x1:"1",y1:"1",x2:"23",y2:"23"}))},at:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M16 20C18.2091 20 20 18.2091 20 16C20 13.7909 18.2091 12 16 12C13.7909 12 12 13.7909 12 16C12 18.2091 13.7909 20 16 20ZM16 22C12.6863 22 10 19.3137 10 16C10 12.6863 12.6863 10 16 10C19.3137 10 22 12.6863 22 16C22 19.3137 19.3137 22 16 22Z M16.0313 3C17.049 3.00006 18.5662 3.00255 20.355 3.62721C22.1513 4.25447 24.1567 5.48361 26.2474 7.83564C27.9943 9.80083 28.7064 12.326 28.9123 14.5321C29.1171 16.7262 28.8348 18.7554 28.4398 19.8417C28.2268 20.4274 27.6481 21.076 26.9472 21.5609C26.2079 22.0724 25.196 22.5 24 22.5H23.9839L23.9679 22.4995C23.3504 22.4796 22.4903 22.2785 21.7095 21.6857C20.9046 21.0747 20.2527 20.0987 20.0136 18.6644L20 18.5828V11.5C20 10.9477 20.4477 10.5 21 10.5C21.5523 10.5 22 10.9477 22 11.5V18.4131C22.169 19.3288 22.5576 19.8186 22.9188 20.0927C23.3069 20.3874 23.7382 20.488 24.0171 20.5C24.7206 20.4959 25.3369 20.243 25.8093 19.9162C26.0467 19.7519 26.2362 19.5766 26.3709 19.4226C26.5134 19.2595 26.5584 19.1622 26.5602 19.1584C26.8318 18.4114 27.1051 16.6904 26.921 14.7179C26.738 12.7574 26.1169 10.6992 24.7526 9.16436C22.864 7.03975 21.1377 6.01895 19.6956 5.5154C18.2462 5.00926 17.0186 5.00006 16.0313 5M16.0313 3L16 3L16.0313 3ZM16.0313 5C13.5386 5.00002 8.09122 6.32574 5.91914 11.3939L5.91373 11.4066L5.90796 11.4191C5.46939 12.3693 5 14.1011 5 16C5 17.8971 5.46812 19.9286 6.36824 21.5039C6.97566 22.5668 8.8683 24.9984 11.3939 26.0809C14.0295 27.2104 16.9449 27.445 19.1286 26.5715C19.6414 26.3664 20.2234 26.6158 20.4285 27.1286C20.6336 27.6414 20.3842 28.2234 19.8714 28.4285C17.0551 29.555 13.5705 29.1896 10.6061 27.9191C7.53171 26.6016 5.35768 23.7665 4.63176 22.4961C3.53188 20.5714 3 18.1862 3 16C3 13.8231 3.52694 11.8114 4.0862 10.5936C6.70796 4.49451 13.1248 3.01068 16 3"}))},expand:function(C){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",className:"rcx-svg--directional",fill:"currentColor"},C),(0,emotion_react_browser_esm.tZ)("path",{d:"M26.832 12.4422C26.8261 12.9945 26.3737 13.4374 25.8214 13.4315C25.2692 13.4256 24.8262 12.9731 24.8321 12.4208L24.8734 8.56183L18.8284 14.6068C18.4379 14.9973 17.8047 14.9973 17.4142 14.6068C17.0237 14.2163 17.0237 13.5831 17.4142 13.1926L23.4591 7.14762L19.6001 7.18883C19.0479 7.19472 18.5954 6.75181 18.5895 6.19956C18.5836 5.64731 19.0265 5.19484 19.5788 5.18894L25.8888 5.12156C26.1577 5.11869 26.4164 5.22424 26.6066 5.4144C26.7967 5.60455 26.9023 5.86328 26.8994 6.13218L26.832 12.4422ZM5.18878 19.5788C5.19468 19.0265 5.64715 18.5836 6.1994 18.5895C6.75166 18.5954 7.19457 19.0479 7.18867 19.6002L7.14746 23.4592L13.1924 17.4142C13.5829 17.0237 14.2161 17.0237 14.6066 17.4142C14.9971 17.8047 14.9971 18.4379 14.6066 18.8284L8.56167 24.8734L12.4207 24.8322C12.9729 24.8263 13.4254 25.2692 13.4313 25.8214C13.4372 26.3737 12.9943 26.8262 12.442 26.8321L6.13202 26.8994C5.86312 26.9023 5.60439 26.7968 5.41424 26.6066C5.22408 26.4164 5.11853 26.1577 5.1214 25.8888L5.18878 19.5788Z"}))},collapse:function(C){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",className:"rcx-svg--directional",fill:"currentColor"},C),(0,emotion_react_browser_esm.tZ)("path",{d:"M17.1887 7.57831C17.1946 7.02606 17.6471 6.58315 18.1993 6.58904C18.7516 6.59494 19.1945 7.04741 19.1886 7.59967L19.1474 11.4587L25.1924 5.41373C25.5829 5.0232 26.216 5.0232 26.6066 5.41373C26.9971 5.80425 26.9971 6.43742 26.6066 6.82794L20.5616 12.8729L24.4206 12.8317C24.9729 12.8258 25.4253 13.2687 25.4312 13.8209C25.4371 14.3732 24.9942 14.8257 24.442 14.8316L18.132 14.899C17.8631 14.9018 17.6043 14.7963 17.4142 14.6061C17.224 14.416 17.1185 14.1572 17.1213 13.8883L17.1887 7.57831ZM14.8321 24.4422C14.8262 24.9945 14.3737 25.4374 13.8215 25.4315C13.2692 25.4256 12.8263 24.9731 12.8322 24.4208L12.8734 20.5618L6.82846 26.6068C6.43794 26.9973 5.80477 26.9973 5.41425 26.6068C5.02372 26.2163 5.02372 25.5831 5.41425 25.1926L11.4592 19.1476L7.60019 19.1888C7.04793 19.1947 6.59546 18.7518 6.58957 18.1996C6.58367 17.6473 7.02658 17.1948 7.57883 17.1889L13.8889 17.1216C14.1578 17.1187 14.4165 17.2242 14.6066 17.4144C14.7968 17.6046 14.9023 17.8633 14.8995 18.1322L14.8321 24.4422Z"}))},arc:function(o){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},o),(0,emotion_react_browser_esm.tZ)("path",{d:"M15 15C9.47715 15 5 10.5228 5 5",stroke:"#C4C7C5"}))},avatar:function(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M16 17.3131C13.9229 17.3131 12.2392 15.6727 12.2392 13.6493C12.2392 11.6258 13.9229 9.98549 16 9.98549C18.077 9.98549 19.7608 11.6258 19.7608 13.6493C19.7608 15.6727 18.077 17.3131 16 17.3131ZM16 15.3131C17.0221 15.3131 17.7608 14.5192 17.7608 13.6493C17.7608 12.7794 17.0221 11.9855 16 11.9855C14.9779 11.9855 14.2392 12.7794 14.2392 13.6493C14.2392 14.5192 14.9779 15.3131 16 15.3131Z M11.3787 27.942H6C5.44772 27.942 5 27.4943 5 26.942V5C5 4.44772 5.44772 4 6 4H26C26.5523 4 27 4.44772 27 5V26.942C27 27.4943 26.5523 27.942 26 27.942H20.6213C20.4262 27.9818 20.2242 28.0028 20.0173 28.0028H11.9827C11.7758 28.0028 11.5738 27.9818 11.3787 27.942ZM7 25.942H9.13261C9.03531 25.6465 8.98267 25.3308 8.98267 25.0028V22.0826C8.98267 20.3292 10.1664 18.7969 11.863 18.3542C12.4621 18.1978 13.0901 18.1882 13.6937 18.326L15.0304 18.6312C15.657 18.7743 16.3088 18.7642 16.9308 18.602L17.808 18.373C18.4546 18.2043 19.1324 18.1939 19.7839 18.3426C21.6756 18.7746 23.0173 20.4571 23.0173 22.3975V25.0028C23.0173 25.3308 22.9647 25.6465 22.8674 25.942H25V6H7V25.942ZM20.3615 25.942C20.7442 25.8017 21.0173 25.4341 21.0173 25.0028V22.3975C21.0173 21.3902 20.3208 20.5167 19.3387 20.2925C19.0005 20.2152 18.6486 20.2206 18.3129 20.3082L17.4357 20.5371C16.5029 20.7806 15.5251 20.7956 14.5852 20.581L13.2485 20.2758C12.9582 20.2095 12.6561 20.2142 12.368 20.2894C11.552 20.5023 10.9827 21.2393 10.9827 22.0826V25.0028C10.9827 25.4341 11.2557 25.8017 11.6384 25.942H20.3615Z"}))},"format-text":function FormatText_t(t){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em"},t),(0,emotion_react_browser_esm.tZ)("path",{d:"M18.5 4l1.16 4.35-.96.26c-.45-.87-.91-1.74-1.44-2.18C16.73 6 16.11 6 15.5 6H13v10.5c0 .5 0 1 .33 1.25.34.25 1 .25 1.67.25v1H9v-1c.67 0 1.33 0 1.67-.25.33-.25.33-.75.33-1.25V6H8.5c-.61 0-1.23 0-1.76.43-.53.44-.99 1.31-1.44 2.18l-.96-.26L5.5 4h13z"}))},cog:function(r){return(0,emotion_react_browser_esm.tZ)("svg",(0,_rollupPluginBabelHelpers.gY)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},r),(0,emotion_react_browser_esm.tZ)("path",{d:"M16 29C16.4442 29 16.8836 28.9777 17.317 28.934C17.8387 28.8815 18.2719 28.5425 18.4635 28.0779L19.7303 25.0059L22.7979 26.2821C23.2615 26.475 23.8072 26.4086 24.2132 26.0773C24.8957 25.5205 25.5204 24.8957 26.0773 24.2133C26.4085 23.8073 26.475 23.2616 26.2821 22.7979L25.0058 19.7304L28.0779 18.4635C28.5425 18.2719 28.8815 17.8387 28.934 17.317C28.9777 16.8836 29 16.4443 29 16C29 15.5558 28.9777 15.1164 28.934 14.6831C28.8815 14.1614 28.5425 13.7282 28.078 13.5366L25.0058 12.2697L26.2821 9.2021C26.475 8.73845 26.4086 8.19273 26.0773 7.78674C25.5205 7.10431 24.8957 6.47956 24.2133 5.92274C23.8073 5.59147 23.2616 5.52505 22.7979 5.71795L19.7303 6.9942L18.4634 3.92205C18.2719 3.45753 17.8386 3.11849 17.3169 3.06595C16.8836 3.02232 16.4442 3 16 3C15.5558 3 15.1164 3.02232 14.6831 3.06595C14.1614 3.11849 13.7281 3.45753 13.5366 3.92205L12.2697 6.9942L9.20205 5.71795C8.7384 5.52505 8.19267 5.59148 7.78668 5.92274C7.10426 6.47956 6.4795 7.10432 5.92269 7.78675C5.59143 8.19274 5.525 8.73846 5.7179 9.20211L6.99415 12.2697L3.92204 13.5366C3.45753 13.7282 3.11848 14.1614 3.06595 14.6831C3.02232 15.1164 3 15.5558 3 16C3 16.4443 3.02232 16.8836 3.06596 17.317C3.1185 17.8387 3.45754 18.2719 3.92205 18.4635L6.99415 19.7304L5.71793 22.7979C5.52503 23.2616 5.59145 23.8073 5.92272 24.2133C6.47955 24.8957 7.10432 25.5205 7.78677 26.0773C8.19276 26.4086 8.73848 26.475 9.20213 26.2821L12.2697 25.0059L13.5365 28.0779C13.7281 28.5425 14.1613 28.8815 14.683 28.934C15.1164 28.9777 15.5557 29 16 29ZM13.8891 23.687C13.5937 22.9706 12.7726 22.6305 12.0571 22.9281L8.77411 24.294C8.39424 23.9627 8.03731 23.6058 7.70604 23.2259L9.07191 19.9429C9.36957 19.2275 9.02944 18.4063 8.31305 18.1109L5.02547 16.7551C5.00859 16.5058 5 16.254 5 16C5 15.7461 5.00859 15.4943 5.02547 15.245L8.31305 13.8892C9.02944 13.5938 9.36957 12.7726 9.07191 12.0572L7.70602 8.7741C8.03726 8.39424 8.39418 8.03732 8.77404 7.70607L12.0571 9.07196C12.7726 9.36962 13.5937 9.02949 13.8891 8.31311L15.2449 5.02547C15.4943 5.00859 15.7461 5 16 5C16.2539 5 16.5057 5.00859 16.7551 5.02547L18.1108 8.31311C18.4063 9.02949 19.2274 9.36962 19.9429 9.07196L23.226 7.70607C23.6058 8.03732 23.9627 8.39423 24.294 8.77409L22.9281 12.0572C22.6304 12.7726 22.9706 13.5938 23.6869 13.8892L26.9745 15.245C26.9914 15.4943 27 15.7461 27 16C27 16.254 26.9914 16.5058 26.9745 16.7551L23.6869 18.1109C22.9706 18.4063 22.6304 19.2275 22.9281 19.9429L24.294 23.2259C23.9627 23.6058 23.6058 23.9627 23.2259 24.294L19.9429 22.9281C19.2274 22.6305 18.4063 22.9706 18.1108 23.687L16.7551 26.9745C16.5057 26.9914 16.2539 27 16 27C15.7461 27 15.4943 26.9914 15.2449 26.9745L13.8891 23.687ZM13 16C13 14.3431 14.3431 13 16 13C17.6569 13 19 14.3431 19 16C19 17.6569 17.6569 19 16 19C14.3431 19 13 17.6569 13 16ZM16 11C13.2386 11 11 13.2386 11 16C11 18.7614 13.2386 21 16 21C18.7614 21 21 18.7614 21 16C21 13.2386 18.7614 11 16 11Z"}))}},Icon_l=["size","name","className","style","color"],Icon_a=function(s){var a=s.size,c=void 0===a?24:a,m=s.name,p=s.className,u=void 0===p?"":p,d=s.style,f=void 0===d?{}:d,v=s.color,y=void 0===v?"currentColor":v,g=(0,_rollupPluginBabelHelpers.Kd)(s,Icon_l),j=useComponentOverrides_l("Button",u,f),N=j.classNames,h=j.styleOverrides,x=(0,react.useMemo)((function(){return jr[m]}),[m]);return m?x?(0,emotion_react_browser_esm.tZ)(x,(0,_rollupPluginBabelHelpers.gY)({x:"0",y:"0",width:c,height:c,color:y,className:"ec-icon ".concat(N),style:h},g)):(console.log("No icon found for ".concat(m)),null):null};Icon_a.propTypes={name:node_modules_prop_types.Z.string,size:node_modules_prop_types.Z.oneOfType([node_modules_prop_types.Z.string,node_modules_prop_types.Z.number]),className:node_modules_prop_types.Z.string,style:node_modules_prop_types.Z.object};var s=["icon","size","color","children","iconSize"],ActionButton_a=function(e){var o=e.small,r=e.large,i=e.size;return o?"1.25rem":r?"1.75rem":i||"1.5rem"},ActionButton_l=(0,react.forwardRef)((function(r,i){var l=r.icon,p=r.size,c=void 0===p?"medium":p,d=r.color,u=void 0===d?"default":d,f=r.children,z=r.iconSize,v=void 0===z?{}:z,y=(0,_rollupPluginBabelHelpers.Kd)(r,s);return(0,emotion_react_browser_esm.tZ)(Button_c,(0,_rollupPluginBabelHelpers.gY)({ref:i,square:!0,size:c,type:u},y),f,(0,emotion_react_browser_esm.tZ)(Icon_a,{name:l,size:ActionButton_a(v)}))}));ActionButton_l.displayName="ActionButton",ActionButton_l.propTypes={icon:node_modules_prop_types.Z.string,children:node_modules_prop_types.Z.oneOfType([node_modules_prop_types.Z.arrayOf(node_modules_prop_types.Z.node),node_modules_prop_types.Z.node]),size:node_modules_prop_types.Z.oneOf(["small","medium","large"])},ActionButton_l.__docgenInfo={description:"",methods:[],displayName:"ActionButton",props:{icon:{description:"",type:{name:"custom",raw:"i.string"},required:!1},children:{description:"",type:{name:"custom",raw:"i.oneOfType([i.arrayOf(i.node),i.node])"},required:!1},size:{description:"",type:{name:"custom",raw:'i.oneOf(["small","medium","large"])'},required:!1}}};var Box_style_o={box:{name:"w4tggu",styles:"margin:0;padding:0;border-width:0;box-sizing:border-box;border-style:solid;border-color:currentColor;outline:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;flex:0 1 auto"}},c=["children","className","style","is"],Box_n=(0,react.forwardRef)((function(r,t){var n=r.children,m=void 0===n?null:n,p=r.className,d=void 0===p?"":p,f=r.style,y=void 0===f?{}:f,u=r.is,v=void 0===u?"div":u,x=(0,_rollupPluginBabelHelpers.Kd)(r,c),j=useComponentOverrides_l("Box"),b=j.classNames,N=j.styleOverrides,h="".concat(v);return(0,emotion_react_browser_esm.tZ)(h,(0,_rollupPluginBabelHelpers.gY)({ref:t,css:Box_style_o.box,className:"ec-box ".concat(d," ").concat(b),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},N),y)},x),m)}));Box_n.propTypes={children:node_modules_prop_types.Z.oneOfType([node_modules_prop_types.Z.arrayOf(node_modules_prop_types.Z.node),node_modules_prop_types.Z.node]),className:node_modules_prop_types.Z.string,style:node_modules_prop_types.Z.object,is:node_modules_prop_types.Z.string},Box_n.displayName="Box",Box_n.__docgenInfo={description:"",methods:[],displayName:"Box",props:{children:{description:"",type:{name:"custom",raw:"t.oneOfType([t.arrayOf(t.node),t.node])"},required:!1},className:{description:"",type:{name:"custom",raw:"t.string"},required:!1},style:{description:"",type:{name:"custom",raw:"t.object"},required:!1},is:{description:"",type:{name:"custom",raw:"t.string"},required:!1}}};var appendClassNames_a=function(a,o){return t=o,Array.isArray(t)?[a].concat((0,_rollupPluginBabelHelpers.u)(o)):o?"".concat(a," ").concat(o):a;var t},CheckBox_a=["checked"],CheckBox_p=function(p){var n=p.checked,h=(0,_rollupPluginBabelHelpers.Kd)(p,CheckBox_a),k=function(c){return{main:function(o){return(0,emotion_react_browser_esm.iv)("display:inline-block;color:",c.colors.primaryForeground,";background-color:",o?c.colors.primary:"none",";height:1rem;width:1rem;box-sizing:border-box;border:",o?"none":"2px solid ".concat(c.colors.border),";border-radius:",c.radius,";cursor:pointer;outline:none;&:active{outline:0.3px solid ",c.colors.ring,";}","","","")}}}(useTheme_i().theme),f=useComponentOverrides_l("CheckBox"),u=f.classNames,j=f.styleOverrides;return(0,emotion_react_browser_esm.tZ)("label",{css:k.main(n),className:appendClassNames_a("ec-check-box",u),style:j},(0,emotion_react_browser_esm.tZ)("input",(0,_rollupPluginBabelHelpers.gY)({type:"checkbox"},h,{checked:n,style:{display:"none"}})),(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",style:{display:"inline-block",verticalAlign:"middle"}},n&&(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"check",size:"1rem"})))};var FlexItem_s=["children","order","grow","shrink","basis","align","style"];var Flex_o_Item=function FlexItem_a(a){var d=a.children,n=a.order,f=a.grow,v=a.shrink,x=a.basis,m=a.align,p=a.style,u=void 0===p?{}:p,c=(0,_rollupPluginBabelHelpers.Kd)(a,FlexItem_s),g=(0,react.useMemo)((function(){return void 0!==n&&void 0===u.order&&(u.order=n),void 0!==f&&void 0===u.flexGrow&&(u.flexGrow=f),void 0!==v&&void 0===u.flexShrink&&(u.flexShrink=v),void 0!==x&&void 0===u.flexBasis&&(u.flexBasis=x),void 0!==m&&void 0===u.alignSelf&&(u.alignSelf=("start"===m?"flex-start":"end"===m&&"flex-end")||m),u}),[m,x,f,n,v,u]);return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({style:(0,_rollupPluginBabelHelpers.Zj)({},g)},c)," ",d," ")},Grid_styles_c={container:{name:"13kk2tq",styles:"display:grid;height:100%"},dynamic:function(c,C,I,b,Y,t,A,i,G){return(0,emotion_react_browser_esm.iv)(c&&"grid-template-columns: repeat(".concat(c,", 1fr);")," ",C&&"gap: ".concat(C,";")," ",I&&"column-gap: ".concat(I,";")," ",b&&"row-gap: ".concat(b,";"),"@media (max-width: 600px){",Y&&Y.cols&&"grid-template-columns: repeat(".concat(Y.cols,", 1fr);"),";",Y&&Y.gapX&&"column-gap: ".concat(Y.gapX,";"),";}@media (min-width: 600px){",t&&t.cols&&"grid-template-columns: repeat(".concat(t.cols,", 1fr);"),";",t&&t.gapX&&"column-gap: ".concat(t.gapX,";"),";}@media (min-width: 768px){",A&&A.cols&&"grid-template-columns: repeat(".concat(A.cols,", 1fr);"),";",A&&A.gapX&&"column-gap: ".concat(A.gapX,";"),";}@media (min-width: 992px){",i&&i.cols&&"grid-template-columns: repeat(".concat(i.cols,", 1fr);"),";",i&&i.gapX&&"column-gap: ".concat(i.gapX,";"),";}@media (min-width: 1200px){",G&&G.cols&&"grid-template-columns: repeat(".concat(G.cols,", 1fr);"),";",G&&G.gapX&&"column-gap: ".concat(G.gapX,";"),";}","","","")}},Grid_styles_C_dynamicItem=function(c,C,I,b,Y,t){return(0,emotion_react_browser_esm.iv)(c&&c.colSpan&&"grid-column: span ".concat(c.colSpan),";",c&&c.rowSpan&&"grid-row: span ".concat(c.rowSpan),";",c&&c.colStart&&"grid-column-start: ".concat(c.colStart),";",c&&c.colEnd&&"grid-column-end: ".concat(c.colEnd),";",c&&c.rowStart&&"grid-row-start: ".concat(c.rowStart),";",c&&c.rowEnd&&"grid-row-end: ".concat(c.rowEnd),";@media (min-width: 600px){",C&&C.colSpan&&"grid-column: span ".concat(C.colSpan),";",C&&C.rowSpan&&"grid-row: span ".concat(C.rowSpan),";",C&&C.colStart&&"grid-column-start: ".concat(C.colStart),";",C&&C.colEnd&&"grid-column-end: ".concat(C.colEnd),";",C&&C.rowStart&&"grid-row-start: ".concat(C.rowStart),";",C&&C.rowEnd&&"grid-row-end: ".concat(C.rowEnd),";}@media (min-width: 600px){",I&&I.colSpan&&"grid-column: span ".concat(I.colSpan),";",I&&I.rowSpan&&"grid-row: span ".concat(I.rowSpan),";",I&&I.colStart&&"grid-column-start: ".concat(I.colStart),";",I&&I.colEnd&&"grid-column-end: ".concat(I.colEnd),";",I&&I.rowStart&&"grid-row-start: ".concat(I.rowStart),";",I&&I.rowEnd&&"grid-row-end: ".concat(I.rowEnd),";}@media (min-width: 768px){",b&&b.colSpan&&"grid-column: span ".concat(b.colSpan),";",b&&b.rowSpan&&"grid-row: span ".concat(b.rowSpan),";",b&&b.colStart&&"grid-column-start: ".concat(b.colStart),";",b&&b.colEnd&&"grid-column-end: ".concat(b.colEnd),";",b&&b.rowStart&&"grid-row-start: ".concat(b.rowStart),";",b&&b.rowEnd&&"grid-row-end: ".concat(b.rowEnd),";}@media (min-width: 992px){",Y&&Y.colSpan&&"grid-column: span ".concat(Y.colSpan),";",Y&&Y.rowSpan&&"grid-row: span ".concat(Y.rowSpan),";",Y&&Y.colStart&&"grid-column-start: ".concat(Y.colStart),";",Y&&Y.colEnd&&"grid-column-end: ".concat(Y.colEnd),";",Y&&Y.rowStart&&"grid-row-start: ".concat(Y.rowStart),";",Y&&Y.rowEnd&&"grid-row-end: ".concat(Y.rowEnd),";}@media (min-width: 1200px){",t&&t.colSpan&&"grid-column: span ".concat(t.colSpan),";",t&&t.rowSpan&&"grid-row: span ".concat(t.rowSpan),";",t&&t.colStart&&"grid-column-start: ".concat(t.colStart),";",t&&t.colEnd&&"grid-column-end: ".concat(t.colEnd),";",t&&t.rowStart&&"grid-row-start: ".concat(t.rowStart),";",t&&t.rowEnd&&"grid-row-end: ".concat(t.rowEnd),";}","","","")},u=["xs","md","lg","xl","xxl","children"],GridItem_a=function(e){var a=e.xs,l=e.md,b=e.lg,p=e.xl,s=e.xxl,d=e.children,c=(0,_rollupPluginBabelHelpers.Kd)(e,u);return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({css:Grid_styles_C_dynamicItem(a,l,b,p,s)},c),d)};GridItem_a.propTypes={xs:node_modules_prop_types.Z.shape({colSpan:node_modules_prop_types.Z.number,rowSpan:node_modules_prop_types.Z.number,colStart:node_modules_prop_types.Z.number,colEnd:node_modules_prop_types.Z.number,rowStart:node_modules_prop_types.Z.number,rowEnd:node_modules_prop_types.Z.number}),md:node_modules_prop_types.Z.shape({colSpan:node_modules_prop_types.Z.number,rowSpan:node_modules_prop_types.Z.number,colStart:node_modules_prop_types.Z.number,colEnd:node_modules_prop_types.Z.number,rowStart:node_modules_prop_types.Z.number,rowEnd:node_modules_prop_types.Z.number}),lg:node_modules_prop_types.Z.shape({colSpan:node_modules_prop_types.Z.number,rowSpan:node_modules_prop_types.Z.number,colStart:node_modules_prop_types.Z.number,colEnd:node_modules_prop_types.Z.number,rowStart:node_modules_prop_types.Z.number,rowEnd:node_modules_prop_types.Z.number}),xl:node_modules_prop_types.Z.shape({colSpan:node_modules_prop_types.Z.number,rowSpan:node_modules_prop_types.Z.number,colStart:node_modules_prop_types.Z.number,colEnd:node_modules_prop_types.Z.number,rowStart:node_modules_prop_types.Z.number,rowEnd:node_modules_prop_types.Z.number}),xxl:node_modules_prop_types.Z.shape({colSpan:node_modules_prop_types.Z.number,rowSpan:node_modules_prop_types.Z.number,colStart:node_modules_prop_types.Z.number,colEnd:node_modules_prop_types.Z.number,rowStart:node_modules_prop_types.Z.number,rowEnd:node_modules_prop_types.Z.number}),children:node_modules_prop_types.Z.node.isRequired};var B=["xs","md","lg","xl","xxl","cols","gap","gapX","gapY","children"],Grid_e=function(c){var G=c.xs,e=c.md,l=c.lg,i=c.xl,C=c.xxl,u=c.cols,x=c.gap,p=c.gapX,t=c.gapY,n=c.children,o=(0,_rollupPluginBabelHelpers.Kd)(c,B);return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({className:"ec-grid",css:[Grid_styles_c.container,Grid_styles_c.dynamic(u,x,p,t,G,e,l,i,C),"",""]},o),n)};Grid_e.Item=GridItem_a,Grid_e.propTypes={xs:node_modules_prop_types.Z.shape({cols:node_modules_prop_types.Z.number,gapX:node_modules_prop_types.Z.string}),md:node_modules_prop_types.Z.shape({cols:node_modules_prop_types.Z.number,gapX:node_modules_prop_types.Z.string}),lg:node_modules_prop_types.Z.shape({cols:node_modules_prop_types.Z.number,gapX:node_modules_prop_types.Z.string}),xl:node_modules_prop_types.Z.shape({cols:node_modules_prop_types.Z.number,gapX:node_modules_prop_types.Z.string}),xxl:node_modules_prop_types.Z.shape({cols:node_modules_prop_types.Z.number,gapX:node_modules_prop_types.Z.string}),cols:node_modules_prop_types.Z.number,gap:node_modules_prop_types.Z.string,gapX:node_modules_prop_types.Z.string,gapY:node_modules_prop_types.Z.string,children:node_modules_prop_types.Z.node.isRequired};var ListBox_styles_c={name:"e0dnmk",styles:"cursor:pointer"},b={name:"1bdbup8",styles:"padding:0.3rem;display:flex;align-items:center;justify-content:center"},G={name:"16ceglb",styles:"font-weight:600"},ListBox_e=["className","style","onSelect","options","multi","value"];var ListBox_t=function(g,I,C){if(C)return 0;if(I){var A=g.findIndex((function(g){return g.value===I}));return-1!==A?A:0}return 0},ListBox_n={name:"jkh04f",styles:"padding:0 0.3rem"},W={name:"1rmvtak",styles:"display:flex;gap:0.25rem"},ListBox_s=function(Z){var B=Z.className,s=void 0===B?"":B,x=Z.style,a=void 0===x?{}:x,o=Z.onSelect,p=Z.options,v=void 0===p?[]:p,J=Z.multi,H=void 0!==J&&J,y=Z.value,r=(0,_rollupPluginBabelHelpers.Kd)(Z,ListBox_e),S=useComponentOverrides_l("ListBox"),R=S.classNames,z=S.styleOverrides,h=useTheme_i().theme,k=function(g){return{main:(0,emotion_react_browser_esm.iv)("overflow:auto;overflow-x:hidden;max-height:145px;border:1px solid ",g.colors.border,";border-radius:0.2rem;color:",g.colors.secondaryForeground,";","","",""),listItem:(0,emotion_react_browser_esm.iv)("cursor:pointer;display:flex;theme. justify-content:space-between;align-items:center;padding:0.2rem;&:hover{background-color:",g.colors.secondary,";}","","",""),listText:G,checkContainer:b,checkbox:ListBox_styles_c}}(h),N=(0,react.useRef)([]),F=(0,react.useState)((function(){return ListBox_t(v,y,H)})),Y=(0,_rollupPluginBabelHelpers.ZQ)(F,2),P=Y[0],w=Y[1],L=(0,react.useCallback)((function(g){o&&o(g.value)}),[o]);return(0,react.useEffect)((function(){var g=function(g){switch(g.key){case"Enter":L(v[P]);break;case"ArrowDown":g.preventDefault(),w((function(g){return g0?g-1:g}))}};return document.addEventListener("keydown",g),function(){document.removeEventListener("keydown",g)}}),[v,P,L]),(0,react.useEffect)((function(){N.current[P]&&N.current[P].scrollIntoView({block:"nearest"})}),[P]),(0,react.useEffect)((function(){w(ListBox_t(v,y,H))}),[H,v,y]),(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({css:k.main,className:"ec-list-box ".concat(s," ").concat(R),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},z),a)},r),(0,emotion_react_browser_esm.tZ)("ul",{style:{listStyle:"none",margin:0,padding:0}},v.map((function(g,I){return(0,emotion_react_browser_esm.tZ)("li",{key:g.value,role:"presentation",css:k.listItem,ref:function(g){return function(g,I){N.current[I]=g}(g,I)},onClick:function(){return L(g)},style:{backgroundColor:I===P&&h.colors.primary,color:I===P&&h.colors.primaryForeground}},H?(0,emotion_react_browser_esm.tZ)(Box_n,{css:W},(0,emotion_react_browser_esm.tZ)(CheckBox_p,{value:g.value,css:k.checkbox,checked:null==y?void 0:y.includes(g.value),onChange:function(){}}),(0,emotion_react_browser_esm.tZ)(Box_n,{css:ListBox_n},g.label)):(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},g.label))}))))};ListBox_s.propTypes={className:node_modules_prop_types.Z.string,style:node_modules_prop_types.Z.object,onSelect:node_modules_prop_types.Z.func,options:node_modules_prop_types.Z.arrayOf(node_modules_prop_types.Z.shape({label:node_modules_prop_types.Z.string.isRequired,value:node_modules_prop_types.Z.any.isRequired})).isRequired,multi:node_modules_prop_types.Z.bool,value:node_modules_prop_types.Z.oneOfType([node_modules_prop_types.Z.string,node_modules_prop_types.Z.number,node_modules_prop_types.Z.arrayOf(node_modules_prop_types.Z.oneOfType([node_modules_prop_types.Z.string,node_modules_prop_types.Z.number]))])};var color=__webpack_require__("../ui-elements/dist/esm/node_modules/color/index.js");function color_e(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e=(0,color.Z)(e)).darken(r).hexa()}function color_r(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e=(0,color.Z)(e)).lighten(r).hexa()}function color_o(e,r){return(e=(0,color.Z)(e)).alpha(r).hexa()}var Modal_styles_C={content:{name:"1jrlee8",styles:"position:relative;overflow-y:auto;overflow-x:hidden"}},A={modalFooter:{name:"1epjjlu",styles:"-webkit-box-pack:end!important;-ms-flex-pack:end!important;-webkit-justify-content:end!important;justify-content:end!important;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:flex-end;width:100%;gap:0.5rem"}},Modal_styles_l={modalHeader:{name:"uqztsn",styles:"display:flex;flex-direction:row;justify-content:space-between;width:100%"}},Z={modalTitle:{name:"fpe1v",styles:"margin:0.25rem!important;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;font-size:1.5rem;font-weight:700;letter-spacing:0;line-height:2rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;align-items:center"}},X={modalThumb:{name:"s5xdrg",styles:"display:flex;align-items:center"}},i=(0,react.forwardRef)((function(o,i){var a=o.children,c=o.onClick,s=void 0===c?function(){}:c,p=function(b){var G;return{modalBackdrop:(0,emotion_react_browser_esm.iv)("position:absolute;top:0;right:0;z-index:",(null===(G=b.zIndex)||void 0===G?void 0:G.modal)||1500,";background:",color_o(b.commonColors.black,.5),";width:100%;height:100%;","","","")}}(useTheme_i().theme);return(0,emotion_react_browser_esm.tZ)(Box_n,{ref:i,onClick:s,css:p.modalBackdrop},a)}));i.displayName="ModalBackdrop",i.__docgenInfo={description:"",methods:[],displayName:"ModalBackdrop"};var react_dom=__webpack_require__("../../node_modules/react-dom/index.js");function reactPortal_o(o){var a=o.children,d=o.wrapperId,l=void 0===d?"react-portal-wrapper":d,i=(0,react.useState)(null),u=(0,_rollupPluginBabelHelpers.ZQ)(i,2),p=u[0],c=u[1];return(0,react.useEffect)((function(){var r=document.getElementById(l),e=!1;return r||(e=!0,r=function(r){var e=document.createElement("div");return e.setAttribute("id",r),document.body.appendChild(e),e}(l)),c(r),function(){e&&r.parentNode&&r.parentNode.removeChild(r)}}),[l]),p?(0,react_dom.createPortal)(a,p):null}var Modal_u=["className","style","open","children","onClose"],v=(0,react.forwardRef)((function(t,v){var y=t.className,j=void 0===y?"":y,h=t.style,k=void 0===h?{}:h,w=t.open,N=void 0===w||w,b=t.children,x=t.onClose,B=void 0===x?function(){}:x,C=(0,_rollupPluginBabelHelpers.Kd)(t,Modal_u),g=useComponentOverrides_l("Modal"),E=g.classNames,M=g.styleOverrides,P=(0,react.useRef)(null),O=function(I){return{main:(0,emotion_react_browser_esm.iv)("position:absolute;display:flex;display:-ms-flexbox;flex-direction:column;align-content:stretch;justify-content:strech;max-height:90%;width:100%;max-width:600px;padding:0.5rem;color:",I.colors.foreground,";background:",I.colors.background,";border-radius:",I.radius,";top:50%;left:50%;transform:translate(-50%, -50%);","","","")}}(useTheme_i().theme),_=(0,react.useCallback)((function(o){o.target===P.current&&B()}),[B]),H=(0,react.useCallback)((function(o){"Escape"===o.key&&B()}),[B]);return(0,react.useEffect)((function(){return window.addEventListener("keydown",H),function(){window.removeEventListener("keydown",H)}}),[H]),N?(0,emotion_react_browser_esm.tZ)(reactPortal_o,{wrapperId:"overlay-items"},(0,emotion_react_browser_esm.tZ)(i,{ref:P,onClick:_},(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({ref:v,is:"dialog",css:O.main,className:"ec-modal ".concat(j," ").concat(E),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},k),M)},C),b))):null}));v.displayName=v,v.__docgenInfo={description:"",methods:[]};var ModalClose_n=["className","style","children","onClick","tabIndex"],ModalClose_b={name:"z4ifre",styles:"margin:0.25rem!important"},ModalContent_c=["className","style","children"],m=["className","style","children"],ModalHeader_m=["className","style","children"],ModalTitle_i=["className","style","children"],Avatar_styles_g={avatarContainer:{name:"6ii2ik",styles:"display:inline-flex;vertical-align:middle;cursor:pointer"}},AvatarContainer_l=["title","children","className","style"],AvatarContainer_m=function(m){var n=m.title,p=m.children,c=m.className,v=void 0===c?"":c,d=m.style,f=void 0===d?{}:d,u=(0,_rollupPluginBabelHelpers.Kd)(m,AvatarContainer_l),j=useComponentOverrides_l("AvatarContainer",v,f),y=j.classNames,N=j.styleOverrides;return u.className=appendClassNames_a("ec-avatar-container",[y]),u.style=N,(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({is:"figure",css:Avatar_styles_g.avatarContainer,"aria-label":n},u),p)},f=["size","className","style","url","fallbackIcon","onClick"],Avatar_p=function(p){var v=p.size,u=void 0===v?"2.25rem":v,d=p.className,j=void 0===d?"":d,k=p.style,y=void 0===k?{}:k,C=p.url,b=p.fallbackIcon,h=void 0===b?"avatar":b,A=p.onClick,x=void 0===A?function(){}:A,z=(0,_rollupPluginBabelHelpers.Kd)(p,f),I=(0,react.useState)(!1),N=(0,_rollupPluginBabelHelpers.ZQ)(I,2),g=N[0],B=N[1],P=function(c){return{imageAvatar:function(g){return(0,emotion_react_browser_esm.iv)("border-radius:",c.radius,";height:",g,";width:",g,";","","","")},fallbackContainer:function(g){return(0,emotion_react_browser_esm.iv)("display:flex;justify-content:center;align-items:center;background-color:",c.colors.primary,";color:",c.colors.primaryForeground,";border-radius:",c.radius,";height:",g,";width:",g,";","","","")}}}(useTheme_i().theme),T=useComponentOverrides_l("Avatar",j,y),_=T.classNames,E=T.styleOverrides;return(0,emotion_react_browser_esm.tZ)(AvatarContainer_m,(0,_rollupPluginBabelHelpers.gY)({size:u},z),g?(0,emotion_react_browser_esm.tZ)(Box_n,{css:P.fallbackContainer(u)},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:h,size:"1.25rem"})):(0,emotion_react_browser_esm.tZ)("img",{role:"presentation",src:"".concat(C),css:P.imageAvatar(u),className:_,style:E,onError:function(){return B(!0)},onClick:x}))},ModalThumb_i=["className","style","url"];v.Footer=function(i){var c=i.className,d=void 0===c?"":c,n=i.style,p=void 0===n?{}:n,f=i.children,u=(0,_rollupPluginBabelHelpers.Kd)(i,m),v=useComponentOverrides_l("ModalFooter"),j=v.classNames,y=v.styleOverrides;return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({css:A.modalFooter,className:"ec-modal-footer ".concat(d," ").concat(j),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},p),y)},u),f)},v.Header=function(i){var c=i.className,d=void 0===c?"":c,n=i.style,p=void 0===n?{}:n,u=i.children,v=(0,_rollupPluginBabelHelpers.Kd)(i,ModalHeader_m),f=useComponentOverrides_l("ModalHeader"),j=f.classNames,h=f.styleOverrides;return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({css:Modal_styles_l.modalHeader,className:"ec-modal-header ".concat(d," ").concat(j),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},p),h)},v),u)},v.Content=function(i){var m=i.className,n=void 0===m?"":m,p=i.style,d=void 0===p?{}:p,u=i.children,v=(0,_rollupPluginBabelHelpers.Kd)(i,ModalContent_c),f=useComponentOverrides_l("ModalContent"),j=f.classNames,y=f.styleOverrides;return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({css:Modal_styles_C.content,className:"ec-modal-content ".concat(n," ").concat(j),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},d),y)},v),u)},v.Thumb=function(c){var p=c.className,u=void 0===p?"":p,n=c.style,d=void 0===n?{}:n,v=c.url,f=(0,_rollupPluginBabelHelpers.Kd)(c,ModalThumb_i),b=useComponentOverrides_l("ModalThumb"),j=b.classNames,h=b.styleOverrides;return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({css:X.modalThumb,className:"ec-modal-thumb ".concat(u," ").concat(j),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},d),h)},f),(0,emotion_react_browser_esm.tZ)(Avatar_p,{url:v,fallbackIcon:"",size:"1.75rem"}))},v.Title=function(m){var c=m.className,d=void 0===c?"":c,n=m.style,p=void 0===n?{}:n,u=m.children,v=(0,_rollupPluginBabelHelpers.Kd)(m,ModalTitle_i),f=useComponentOverrides_l("ModalTitle"),j=f.classNames,y=f.styleOverrides;return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({css:Z.modalTitle,className:"ec-modal-title ".concat(d," ").concat(j),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},p),y)},v),u)},v.Close=function(l){var r=l.className,I=void 0===r?"":r,u=l.style,m=void 0===u?{}:u;l.children;var g=l.onClick,d=void 0===g?function(){}:g,C=l.tabIndex,G=(0,_rollupPluginBabelHelpers.Kd)(l,ModalClose_n),v=useComponentOverrides_l("ModalClose"),p=v.classNames,y=v.styleOverrides;return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({css:ModalClose_b,className:"ec-modal-close ".concat(I," ").concat(p),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},m),y)},G),(0,emotion_react_browser_esm.tZ)(ActionButton_l,{ghost:!0,icon:"cross",onClick:d,tabIndex:C}))};var Popup_styles_A={name:"4feby2",styles:"overflow:auto;overflow-x:hidden"},Popup_styles_G={name:"pgp8a9",styles:"height:20px;border:none;flex:none;padding:none;&:focus{outline:none;}"},Popup_styles_c={name:"1f1ucwr",styles:"font-size:1.25rem;padding:0.1rem"},Popup_styles_Z={name:"1rmvtak",styles:"display:flex;gap:0.25rem"},Heading_C=["level","children"],Heading_l=function(l){var n,o=l.level,b=void 0===o?1:o,c=l.children,u=(0,_rollupPluginBabelHelpers.Kd)(l,Heading_C),h="h".concat(b),G=useTheme_i().theme,a=(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},{h1:{fontSize:"2rem",fontWeight:800,lineHeight:1.5},h2:{fontSize:"1.5rem",fontWeight:800,lineHeight:1.4},h3:{fontSize:"1.3rem",fontWeight:400,lineHeight:1.3},h4:{fontSize:"1rem",fontWeight:400,lineHeight:1.2},h5:{fontSize:"0.83rem",fontWeight:400,lineHeight:1.1},h6:{fontSize:"0.67rem",fontWeight:500,lineHeight:1}}[h]),(null===(n=G.typography)||void 0===n?void 0:n[h])||{});return(0,emotion_react_browser_esm.tZ)(h,(0,_rollupPluginBabelHelpers.gY)({css:(0,emotion_react_browser_esm.iv)("font-size:",a.fontSize,";font-weight:",a.fontWeight,";line-height:",a.lineHeight,";","","","")},u),c)},Input_l=["className","style","textArea"],Input_c=(0,react.forwardRef)((function(s,r){var c=s.className,n=void 0===c?"":c,u=s.style,d=void 0===u?{}:u,f=s.textArea,y=void 0!==f&&f,j=(0,_rollupPluginBabelHelpers.Kd)(s,Input_l),v=useComponentOverrides_l("Input"),x=v.classNames,N=v.styleOverrides,h=function(o){return{main:(0,emotion_react_browser_esm.iv)("position:relative;display:inline-flex;flex:1 0 auto;min-width:8rem;padding:0.5rem 0.9375rem;-webkit-user-select:initial;-moz-user-select:initial;user-select:initial;vertical-align:baseline;white-space:nowrap;word-break:break-all;background-color:",o.colors.background,";color:",o.colors.foreground,";letter-spacing:0rem;font-size:0.875rem;font-weight:400;line-height:1.25rem;overflow:hidden;text-overflow:ellipsis;border-radius:",o.radius,";box-shadow:none;border:1px solid ",o.colors.border,";outline:none;&:focus{outline:",o.colors.ring," solid 1px;}&::placeholder{color:",color_o(o.colors.foreground,.8),";}","","","")}}(useTheme_i().theme),g=y?"textarea":"input";return(0,emotion_react_browser_esm.tZ)(g,(0,_rollupPluginBabelHelpers.gY)({css:h.main,className:"ec-".concat(g," ").concat(n," ").concat(x),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},N),d),ref:r},j))}));Input_c.propTypes={className:node_modules_prop_types.Z.string,style:node_modules_prop_types.Z.object,color:node_modules_prop_types.Z.string,textArea:node_modules_prop_types.Z.bool},Input_c.displayName="Input",Input_c.__docgenInfo={description:"",methods:[],displayName:"Input",props:{className:{description:"",type:{name:"custom",raw:"r.string"},required:!1},style:{description:"",type:{name:"custom",raw:"r.object"},required:!1},color:{description:"",type:{name:"custom",raw:"r.string"},required:!1},textArea:{description:"",type:{name:"custom",raw:"r.bool"},required:!1}}};var PopupHeader_f=["className","style","title","iconName","searchProps","onClose"],PopupHeader_d=function(d){var h=d.className,v=void 0===h?"":h,j=d.style,g=void 0===j?{}:j,y=d.title,C=d.iconName,I=d.searchProps,B=d.onClose,N=void 0===B?function(){}:B,P=(0,_rollupPluginBabelHelpers.Kd)(d,PopupHeader_f),x=useComponentOverrides_l("PopupHeader"),H=x.classNames,b=x.styleOverrides,z=function(C){var A=C.theme,b=C.mode;return{popupHeader:(0,emotion_react_browser_esm.iv)("background-color:","light"===b?color_e(A.colors.background,.03):A.colors.secondary,";display:flex;justify-content:space-between;padding:0.75rem;margin-bottom:0.5rem;border-top-left-radius:inherit;border-top-right-radius:inherit;","","",""),titleContainer:Popup_styles_Z,icon:Popup_styles_c,searchContainer:(0,emotion_react_browser_esm.iv)("display:flex;align-items:center;justify-content:space-around;border:1px solid ",A.colors.border,";border-radius:",A.radius,";position:relative;margin:0 1rem;&.focused{outline:1px solid ",A.colors.ring,";}","","",""),textInput:Popup_styles_G,noInfoIcon:(0,emotion_react_browser_esm.iv)("background:",A.colors.background,";padding:0.125em;cursor:pointer;","","","")}}(useTheme_i()),A=I||{},L=A.isSearch,O=void 0!==L&&L,S=A.handleInputChange,W=A.placeholder,_=(0,react.useRef)(null);return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({css:z.popupHeader,className:"ec-popup-header ".concat(v," ").concat(H),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},g),b)},P),(0,emotion_react_browser_esm.tZ)(Box_n,{css:z.titleContainer},(0,emotion_react_browser_esm.tZ)(Icon_a,{css:z.icon,name:C,size:"1.25rem"}),(0,emotion_react_browser_esm.tZ)(Heading_l,{level:5,style:{display:"contents",fontWeight:700}},y),O&&(0,emotion_react_browser_esm.tZ)(Box_n,{css:z.searchContainer,style:{position:"relative"},ref:_},(0,emotion_react_browser_esm.tZ)(Input_c,{placeholder:W,onChange:S,css:z.textInput,onFocus:function(){_.current&&_.current.classList.add("focused")},onBlur:function(){_.current&&_.current.classList.remove("focused")}}),(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"magnifier",size:"1.25rem",css:z.noInfoIcon}))),(0,emotion_react_browser_esm.tZ)(ActionButton_l,{onClick:function(){return N()},ghost:!0,size:"small"},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"cross"})))},Popup_X={name:"lkkfip",styles:"position:absolute;top:2.75rem;right:2rem"},Popup_i=function(G){var i=G.positionStyles,Z=void 0===i?Popup_X:i,u=G.wrapperId,d=void 0===u?"overlay-items":u,B=G.isPopupHeader,V=void 0!==B&&B,o=G.searchProps,n=void 0===o?{}:o,s=G.children,y=G.onClose,p=void 0===y?function(){}:y,a=G.title,W=G.iconName,v=G.style,w=void 0===v?{}:v,x=G.width,N=void 0===x?"420px":x,J=G.height,r=void 0===J?"350px":J,z=useComponentOverrides_l("Popup"),S=z.classNames,H=z.styleOverrides,U=function(g){return{popup:function(C,A){var b;return(0,emotion_react_browser_esm.iv)("display:flex;flex-direction:column;z-index:",(null===(b=g.zIndex)||void 0===b?void 0:b.modal)||1500,";box-shadow:",g.shadows[2],";border-radius:",g.radius,";background:",g.colors.background,";border:1px solid ",g.colors.border,";width:",C,";height:",A,";","","","")},popupContent:Popup_styles_A}}(useTheme_i().theme),h=(0,react.useRef)(null);return(0,react.useEffect)((function(){var c=function(c){!h.current||h.current.contains(c.target)||c.target.classList.contains("ec-menu-item")||p()};return document.addEventListener("click",c),function(){document.removeEventListener("click",c)}}),[p]),(0,emotion_react_browser_esm.tZ)(reactPortal_o,{wrapperId:d},(0,emotion_react_browser_esm.tZ)(Box_n,{ref:h,css:[U.popup(N,r),Z,"",""],className:"ec-popup ".concat(S),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},H),w)},V&&(0,emotion_react_browser_esm.tZ)(PopupHeader_d,{title:a,iconName:W,searchProps:n,onClose:p}),(0,emotion_react_browser_esm.tZ)(Box_n,{css:U.popupContent},s)))};Popup_i.propTypes={children:node_modules_prop_types.Z.node.isRequired,positionStyles:node_modules_prop_types.Z.oneOfType([node_modules_prop_types.Z.string,node_modules_prop_types.Z.object]),wrapperId:node_modules_prop_types.Z.string,onClose:node_modules_prop_types.Z.func};var Skeleton_styles_c,Throbber_styles_l,Skeleton_styles_i=(0,emotion_react_browser_esm.F4)(Skeleton_styles_c||(Skeleton_styles_c=(0,_rollupPluginBabelHelpers.AI)(["\n0% {\n opacity: 0.1;\n}\n\n50% {\n opacity: 0.2;\n}\n\n100% {\n opacity: 0.1;\n}\n"]))),Skeleton_a=["variant","height","width"],Skeleton_l=function(l){var m=l.variant,n=void 0===m?"text":m,h=l.height,p=l.width,c=(0,_rollupPluginBabelHelpers.Kd)(l,Skeleton_a),d=function(I){return{skeleton:(0,emotion_react_browser_esm.iv)("height:1.2em;animation:",Skeleton_styles_i," 1s linear 0s infinite running;border-radius:0.25rem;background:",color_r(I.commonColors.black,2),";&.text{height:auto;margin-block:none;transform:scale(1, 0.6);transform-origin:0 60%;}&.circle{border-radius:50%;}","","","")}}(useTheme_i().theme);return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({css:d.skeleton,style:{display:"inlineBlock",height:h,width:p},className:"ec-skeleton ".concat(n)},c))},Throbber_styles_b=(0,emotion_react_browser_esm.F4)(Throbber_styles_l||(Throbber_styles_l=(0,_rollupPluginBabelHelpers.AI)(["\n0%,\n80%,\n100% {\n transform: scale(0);\n}\n\n40% {\n transform: scale(1);\n}\n"]))),Throbber_styles_t={name:"omopsz",styles:"display:flex;width:fit-content margin-block:-0.125rem"},Throbber_styles_e=function(I){return{circle:function(c,l,t){return(0,emotion_react_browser_esm.iv)("height:",c,";width:",c,";margin-inline:0.125rem;animation:",Throbber_styles_b," 1.4s infinite ease-in-out both;border-radius:100%;background-color:",I.colors.primary,";animation-duration:",.466*l,"s;animation-delay:",.16*t,"s;&.disabled{background-color:",I.colors.muted,";}&.inherit-color{background-color:currentColor;}","","","")},throbber:Throbber_styles_t}},Throbber_n=["disabled","circleCount","iteration","inheritColor","size"],Throbber_a=["disabled","size","circleCount","inheritColor"];function Throbber_c(o){var a=o.disabled,c=o.circleCount,m=o.iteration,d=o.inheritColor,u=o.size,h=(0,_rollupPluginBabelHelpers.Kd)(o,Throbber_n),b=useTheme_i().theme,f=Throbber_styles_e(b);return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({css:f.circle(u,c,m),className:"".concat(a?"disabled":""," ").concat(d?"inherit-color":"")},h))}var Throbber_m=(0,react.forwardRef)((function(o,n){var m=o.disabled,d=o.size,u=void 0===d?"16px":d,h=o.circleCount,b=void 0===h?3:h,f=o.inheritColor,p=(0,_rollupPluginBabelHelpers.Kd)(o,Throbber_a),C=useTheme_i().theme,v=Throbber_styles_e(C);return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({css:v.throbber,ref:n},p),Array.from({length:b||3},(function(r,e){return(0,emotion_react_browser_esm.tZ)(Throbber_c,{key:e,circleCount:b,iteration:e,disabled:!!m,size:u,inheritColor:!!f})})))}));Throbber_m.displayName="Throbber",Throbber_m.__docgenInfo={description:"",methods:[],displayName:"Throbber"};var Tooltip_l={name:"1nrevy2",styles:"position:relative;display:inline-block"},Tooltip_e=function(e){var i,C=e.children,G=e.text,a=e.position,s=(0,react.useState)(!1),u=(0,_rollupPluginBabelHelpers.ZQ)(s,2),n=u[0],A=u[1],p=function(g,b){var c;return{tooltip:(0,emotion_react_browser_esm.iv)("position:absolute;left:64%;transform:translateX(-50%);background-color:",g.invertedColors.secondary,";color:",g.invertedColors.secondaryForeground,";padding:8.5px;border-radius:",g.radius,";box-shadow:0 2px 10px rgba(0, 0, 0, 0.2);z-index:",(null===(c=g.zIndex)||void 0===c?void 0:c.tooltip)||1400,";font-size:12.5px;font-weight:500;white-space:nowrap;font-family:sans-serif;top:","top"===b?"calc(-100% - 20px)":"calc(100% + 10px)",";","","",""),tooltipArrow:(0,emotion_react_browser_esm.iv)("content:'';position:absolute;left:50%;margin-left:-4px;border-width:6px;border-style:solid;border-color:",g.invertedColors.secondary," transparent transparent transparent;top:","top"===b?"100%":"auto",";bottom:","bottom"===b?"100%":"auto",";transform:","bottom"===b?"translateX(-50%) rotate(180deg)":"translateX(-50%)",";","","","")}}(useTheme_i().theme,a);return(0,emotion_react_browser_esm.tZ)(Box_n,{onMouseEnter:function(){A(!0)},onMouseLeave:function(){A(!1)},onTouchStart:function(){i=setTimeout((function(){A(!0)}),500)},onTouchEnd:function(){clearTimeout(i),A(!1)},css:Tooltip_l},C,n&&(0,emotion_react_browser_esm.tZ)(Box_n,{css:p.tooltip},G.charAt(0).toUpperCase()+G.slice(1),(0,emotion_react_browser_esm.tZ)(Box_n,{css:p.tooltipArrow})))},Divider_l=["className","style"],p=function(o){var p=o.className,c=void 0===p?"":p,d=o.style,n=void 0===d?{}:d,v=(0,_rollupPluginBabelHelpers.Kd)(o,Divider_l),u=useComponentOverrides_l("Divider"),f=u.classNames,j=u.styleOverrides,h=function(I){return{divider:(0,emotion_react_browser_esm.iv)("height:2px;margin:0 8px 8px;border:0;border-radius:",I.radius,";background-color:",I.colors.secondary,";","","","")}}(useTheme_i().theme);return(0,emotion_react_browser_esm.tZ)("hr",(0,_rollupPluginBabelHelpers.gY)({css:h.divider,className:"ec-divider ".concat(c," ").concat(f),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},n),j)},v))};p.propTypes={className:node_modules_prop_types.Z.string,style:node_modules_prop_types.Z.object};var GenericModal_i={danger:"modal-warning",warning:"modal-warning",info:"info",success:"check"},GenericModal_l=function(o){var l=o.variant,t=void 0===l?"info":l,a=o.children,s=o.title,c=o.icon,d=o.onClose;return(0,emotion_react_browser_esm.tZ)(v,{onClose:d},(0,emotion_react_browser_esm.tZ)(v.Header,null,function(o,r){return null===o?null:void 0===o?(0,emotion_react_browser_esm.tZ)(Icon_a,{size:"30px",color:r,name:GenericModal_i[r]}):"string"==typeof o?(0,emotion_react_browser_esm.tZ)(Icon_a,{size:"30px",color:r,name:o}):o}(c,t),(0,emotion_react_browser_esm.tZ)(v.Title,null,null!=s?s:"Are_you_sure"),(0,emotion_react_browser_esm.tZ)(v.Close,{title:"Close",onClick:d})),(0,emotion_react_browser_esm.tZ)(v.Content,null,a))};GenericModal_l.propTypes={variant:node_modules_prop_types.Z.string,children:node_modules_prop_types.Z.object.isRequired,title:node_modules_prop_types.Z.oneOfType([node_modules_prop_types.Z.string,node_modules_prop_types.Z.element]),icon:node_modules_prop_types.Z.any,onClose:node_modules_prop_types.Z.func};var Menu_styles_A={name:"bjn8wh",styles:"position:relative"},MenuItem_i=function(i){var m=i.icon,t=i.label,C=i.action,G=i.disabled,g=useComponentOverrides_l("MenuItem",G&&"disabled"),n=g.classNames,o=g.styleOverrides,u=function(A){var C=A.theme,c=A.mode;return{item:(0,emotion_react_browser_esm.iv)("font-size:14px;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:0.25em 0.75em;white-space:nowrap;gap:0.2rem;color:",C.colors.foreground,";&:hover{background-color:","light"===c?color_e(C.colors.background,.05):color_r(C.colors.background,2),";cursor:pointer;}","","",""),disabled:(0,emotion_react_browser_esm.iv)("cursor:not-allowed!important;color:",C.colors.mutedForeground,";","","","")}}(useTheme_i());return(0,emotion_react_browser_esm.tZ)(Box_n,{css:[u.item,G&&u.disabled,"",""],className:appendClassNames_a("ec-menu-item",n),style:o,onClick:!G&&C},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:m,size:"1em"}),t)},Menu_o=function(o){var a=o.options,d=void 0===a?[]:a,V=o.className,N=void 0===V?"":V,e=o.style,p=void 0===e?{}:e,v=o.anchor,m=void 0===v?"right bottom":v,x=o.tooltip,H=void 0===x?{isToolTip:!0,position:"bottom",text:"Options"}:x,z=o.size,y=void 0===z?"medium":z,Y=o.useWrapper,R=void 0===Y||Y,J=useTheme_i().theme,r=function(g){var b;return{wrapper:Menu_styles_A,container:(0,emotion_react_browser_esm.iv)("position:absolute;top:100%;right:0;display:flex;flex-direction:column;width:fit-content;height:fit-content;z-index:",(null===(b=g.zIndex)||void 0===b?void 0:b.menu)||1300,";border-radius:0.2em;padding:0.5rem 0;box-shadow:",g.shadows[1],";background-color:",g.colors.background,";","","","")}}(J),w=useComponentOverrides_l("Menu",N,p),S=w.classNames,h=w.styleOverrides,L=(0,react.useMemo)((function(){var g=m.split(/\s+/),I={};return g.forEach((function(g){I[g]=0})),I}),[m]),F=(0,react.useMemo)((function(){return(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},L),h)}),[L,h]),P=useComponentOverrides_l("MenuWrapper"),K=P.classNames,U=P.styleOverrides,j=(0,react.useState)(!1),k=(0,_rollupPluginBabelHelpers.ZQ)(j,2),T=k[0],Q=k[1];(0,react.useEffect)((function(){var g=function(g){T&&!g.target.classList.contains("ec-menu-wrapper")&&Q(!1)};return document.addEventListener("click",g),function(){document.removeEventListener("click",g)}}),[T]);var f=(0,emotion_react_browser_esm.tZ)(react.Fragment,null,H.isToolTip?(0,emotion_react_browser_esm.tZ)(Tooltip_e,{text:H.text,position:H.position},(0,emotion_react_browser_esm.tZ)(ActionButton_l,{ghost:!0,icon:"kebab",size:y,onClick:function(g){g.stopPropagation(),Q((function(g){return!g}))}})):(0,emotion_react_browser_esm.tZ)(ActionButton_l,{ghost:!0,icon:"kebab",size:y,onClick:function(g){g.stopPropagation(),Q((function(g){return!g}))}}),T?(0,emotion_react_browser_esm.tZ)(Box_n,{css:[r.container,(0,emotion_react_browser_esm.iv)("box-shadow:",J.shadows[2],";","","",""),"",""],className:appendClassNames_a("ec-menu",S),style:F},d.map((function(g,I){return(0,emotion_react_browser_esm.tZ)(MenuItem_i,(0,_rollupPluginBabelHelpers.gY)({},g,{key:g.id||I,action:(A=g.action,c=g.disabled,function(){c||(A(),Q(!T))})}));var A,c}))):null);return R?(0,emotion_react_browser_esm.tZ)(Box_n,{css:r.wrapper,className:appendClassNames_a("ec-menu-wrapper",K),style:U},f):f};var MultiSelect_styles_b={name:"1gbu9vy",styles:"display:flex;flex-wrap:wrap;gap:0.5rem"},MultiSelect_styles_c={name:"1ix3x49",styles:"display:inline-flex;flex:1 0 auto;flex-direction:column;gap:0.25rem;min-width:8rem"},MultiSelect_o=["className","style","options","value","placeholder","disabled","onChange"],V=function(e){var V=e.className,n=void 0===V?"":V,W=e.style,X=void 0===W?{}:W,a=e.options,x=void 0===a?[]:a,p=e.value,B=e.placeholder,N=void 0===B?"":B,r=e.disabled,F=void 0!==r&&r,v=e.onChange,R=(0,_rollupPluginBabelHelpers.Kd)(e,MultiSelect_o),H=useComponentOverrides_l("MultiSelect"),z=H.classNames,y=H.styleOverrides,h=function(g){return{main:MultiSelect_styles_c,selectBox:(0,emotion_react_browser_esm.iv)("display:flex;cursor:pointer;justify-content:space-between;align-items:center;padding:0.5rem 5rem;background-color:transparent;letter-spacing:0rem;font-size:0.875rem;font-weight:400;line-height:1.25rem;color:",g.colors.foreground,";border-width:1px;border-color:",g.colors.border,";border-style:solid;border-radius:",g.radius,";background-color:",g.colors.background,";","","",""),clickStyle:(0,emotion_react_browser_esm.iv)("border-color:",g.colors.ring,";","","",""),disabled:(0,emotion_react_browser_esm.iv)("cursor:not-allowed!important;color:",g.colors.mutedForeground,";","","",""),selectedItemsContainer:MultiSelect_styles_b,selectedItems:(0,emotion_react_browser_esm.iv)("background:",g.colors.muted,";padding:0.2rem;display:flex;justify-self:flex-start;gap:0.2rem;","","","")}}(useTheme_i().theme),U=(0,react.useState)([]),Y=(0,_rollupPluginBabelHelpers.ZQ)(U,2),L=Y[0],j=Y[1],S=(0,react.useState)(!1),f=(0,_rollupPluginBabelHelpers.ZQ)(S,2),k=f[0],w=f[1],P=(0,react.useRef)(null);return(0,react.useEffect)((function(){j(p||[])}),[p]),(0,react.useEffect)((function(){var I=function(I){k&&P.current&&!P.current.contains(I.target)&&w(!1)};return document.addEventListener("click",I),function(){document.removeEventListener("click",I)}}),[k]),(0,emotion_react_browser_esm.tZ)(Box_n,{className:"ec-multi-select ".concat(n," ").concat(z),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},y),X),ref:P,css:h.main},(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({onClick:function(){F||w(!k)},css:[h.selectBox,k&&h.clickStyle,F&&h.disabled,"",""]},R),(0,emotion_react_browser_esm.tZ)(Box_n,{css:h.selectedItemsContainer},L.length>0?L.map((function(I,g){var C;return(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",key:g,css:h.selectedItems},(null===(C=x.find((function(g){return g.value===I})))||void 0===C?void 0:C.label)||I)})):(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},N)),(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"chevron-down"})),k&&(0,emotion_react_browser_esm.tZ)(ListBox_s,{options:x,onSelect:function(I){if(L.includes(I)){var g=L.filter((function(g){return g!==I}));j(g),v(g)}else{var C=[].concat((0,_rollupPluginBabelHelpers.u)(L),[I]);j(C),v(C)}},value:L,multi:!0}))};V.propTypes={className:node_modules_prop_types.Z.string,style:node_modules_prop_types.Z.object,options:node_modules_prop_types.Z.arrayOf(node_modules_prop_types.Z.shape({value:node_modules_prop_types.Z.string,label:node_modules_prop_types.Z.string})),value:node_modules_prop_types.Z.array,placeholder:node_modules_prop_types.Z.string,disabled:node_modules_prop_types.Z.bool,onChange:node_modules_prop_types.Z.func.isRequired};var Sidebar_styles_b=function(I){var b;return{sidebarContainer:(0,emotion_react_browser_esm.iv)("min-width:350px;height:100%;box-shadow:",I.shadows[2],";z-index:",(null===(b=I.zIndex)||void 0===b?void 0:b.sidebar)||1200,";display:flex;flex-direction:column;","","","")}},Sidebar_styles_G={name:"favlbc",styles:"padding:0.125em;cursor:pointer"},Sidebar_styles_A={name:"1qqn7zq",styles:"border:none;flex:1;padding:none;&:focus{outline:none;}"},Sidebar_styles_c={name:"i925pi",styles:"position:relative;display:flex;flex-direction:column;flex:1;overflow:auto;overflow-x:hidden"},Sidebar_styles_l={header:{name:"132f6ag",styles:"display:flex;flex-direction:row;align-items:center;gap:0.5rem;padding:1rem;margin-bottom:0.5rem"},titleContainer:{name:"1madqab",styles:"display:flex;align-items:center;flex:1;gap:0.5rem"},icon:{name:"p4q597",styles:"font-size:1.25rem"}},MinimalSidebar_t=function(t){var i=t.children,s=useTheme_i().theme,a=Sidebar_styles_b(s);return(0,emotion_react_browser_esm.tZ)(Box_n,{css:a.sidebarContainer,className:"ec-minimal-sidebar"},i)},SidebarContent_i=function(i){var a=i.children,m=i.searchProps,u=void 0===m?{}:m,l=i.style,f=u||{},p=f.isSearch,d=void 0!==p&&p,h=f.handleInputChange,I=f.placeholder,v=(0,react.useRef)(null),g=function(I){return{content:Sidebar_styles_c,searchContainer:(0,emotion_react_browser_esm.iv)("display:flex;align-items:center;justify-content:space-between;border:1px solid ",I.colors.border,";padding:0 0.5rem;border-radius:",I.radius,";position:relative;margin:0 1rem 1rem;&.focused{outline:1px solid ",I.colors.ring,";}","","",""),textInput:Sidebar_styles_A,noInfoIcon:Sidebar_styles_G}}(useTheme_i().theme);return(0,emotion_react_browser_esm.tZ)(Box_n,{css:g.content,style:l},d&&(0,emotion_react_browser_esm.tZ)(Box_n,{css:g.searchContainer,style:{position:"relative",margin:"0.5rem"},ref:v},(0,emotion_react_browser_esm.tZ)(Input_c,{placeholder:I,onChange:h,css:g.textInput,onFocus:function(){v.current&&v.current.classList.add("focused")},onBlur:function(){v.current&&v.current.classList.remove("focused")}}),(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"magnifier",size:"1.25rem",css:g.noInfoIcon})),a)},SidebarFooter_e=["children"],SidebarFooter_i=function(i){var a=i.children,l=(0,_rollupPluginBabelHelpers.Kd)(i,SidebarFooter_e);return(0,emotion_react_browser_esm.tZ)(Box_n,l,a)},SidebarHeader_n=function(n){var m=n.title,c=n.iconName,l=n.avatarUrl,f=n.onClose,p=void 0===f?function(){}:f;return(0,emotion_react_browser_esm.tZ)(Box_n,{css:Sidebar_styles_l.header},(0,emotion_react_browser_esm.tZ)(Box_n,{css:Sidebar_styles_l.titleContainer},c&&(0,emotion_react_browser_esm.tZ)(Icon_a,{css:Sidebar_styles_l.icon,name:c,size:"1.25rem"}),l&&(0,emotion_react_browser_esm.tZ)(Avatar_p,{url:l,fallbackIcon:"",size:"1.75rem"}),(0,emotion_react_browser_esm.tZ)(Heading_l,{level:3,style:{display:"contents"}},m)),(0,emotion_react_browser_esm.tZ)(ActionButton_l,{onClick:p,ghost:!0,size:"small"},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"cross"})))},Sidebar_n=function(n){var p=n.title,c=n.iconName,d=n.onClose,f=n.children,b=n.searchProps,j=void 0===b?{}:b,u=n.footer,h=n.style,v=void 0===h?{}:h,S=useTheme_i().theme,C=Sidebar_styles_b(S),y=useComponentOverrides_l("Sidebar"),N=y.classNames,x=y.styleOverrides;return(0,emotion_react_browser_esm.tZ)(Box_n,{css:C.sidebarContainer,className:"ec-sidebar ".concat(N),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},v),x)},(0,emotion_react_browser_esm.tZ)(SidebarHeader_n,{title:p,iconName:c,onClose:d}),(0,emotion_react_browser_esm.tZ)(SidebarContent_i,{searchProps:j},f),u&&(0,emotion_react_browser_esm.tZ)(SidebarFooter_i,null,u))},StaticSelect_n=["className","style","options","placeholder","value","onSelect","disabled"],StaticSelect_o=function(G){var o,m=G.className,d=void 0===m?"":m,a=G.style,N=void 0===a?{}:a,V=G.options,W=void 0===V?[]:V,x=G.placeholder,p=void 0===x?"":x,B=G.value,Y=G.onSelect,r=G.disabled,H=void 0!==r&&r,v=(0,_rollupPluginBabelHelpers.Kd)(G,StaticSelect_n),y=useComponentOverrides_l("StaticSelect"),h=y.classNames,J=y.styleOverrides,R=function(g){return{main:(0,emotion_react_browser_esm.iv)("display:inline-flex;flex:1 0 auto;flex-direction:column;gap:0.25rem;background-color:",g.colors.background,";min-width:8rem;","","",""),selectBox:(0,emotion_react_browser_esm.iv)("display:flex;cursor:pointer;justify-content:space-between;align-items:center;padding:0.5rem 0.9375rem;background-color:transparent;letter-spacing:0rem;font-size:0.875rem;font-weight:400;line-height:1.25rem;color:",g.colors.foreground,";border-width:1px;border-color:",g.colors.border,";border-style:solid;border-radius:",g.radius,";background-color:",g.colors.background,";","","",""),clickStyle:(0,emotion_react_browser_esm.iv)("border-color:",g.colors.ring,";","","",""),disabled:(0,emotion_react_browser_esm.iv)("cursor:not-allowed!important;color:",g.colors.mutedForeground,";","","","")}}(useTheme_i().theme),F=(0,react.useState)(!1),S=(0,_rollupPluginBabelHelpers.ZQ)(F,2),j=S[0],L=S[1],T=(0,react.useState)(""),f=(0,_rollupPluginBabelHelpers.ZQ)(T,2),w=f[0],U=f[1],P=(0,react.useRef)(null);return(0,react.useEffect)((function(){U(B||"")}),[B]),(0,react.useEffect)((function(){var c=function(c){j&&P.current&&!P.current.contains(c.target)&&L(!1)};return document.addEventListener("click",c),function(){document.removeEventListener("click",c)}}),[j]),(0,emotion_react_browser_esm.tZ)(Box_n,{className:"ec-static-select ".concat(d," ").concat(h),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},J),N),ref:P,css:R.main},(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({onClick:function(){H||L(!j)},css:[R.selectBox,j&&R.clickStyle,H&&R.disabled,"",""]},v),(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",className:"selected-option"},!j&&w?null===(o=W.find((function(c){return c.value===w})))||void 0===o?void 0:o.label:p),(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"chevron-down"})),j&&(0,emotion_react_browser_esm.tZ)(ListBox_s,{options:W,onSelect:function(c){U(c),L(!1),Y&&Y(c)},value:w}))};StaticSelect_o.propTypes={className:node_modules_prop_types.Z.string,style:node_modules_prop_types.Z.object,options:node_modules_prop_types.Z.arrayOf(node_modules_prop_types.Z.shape({value:node_modules_prop_types.Z.string,label:node_modules_prop_types.Z.string})).isRequired,placeholder:node_modules_prop_types.Z.string,value:node_modules_prop_types.Z.string,onSelect:node_modules_prop_types.Z.func,disabled:node_modules_prop_types.Z.bool};var ToastBar_styles_b,ToastBar_styles_c=(0,emotion_react_browser_esm.F4)(ToastBar_styles_b||(ToastBar_styles_b=(0,_rollupPluginBabelHelpers.AI)(["\n0% {\n opacity: 0;\n}\n20% {\n opacity: 1;\n}\n80% {\n opacity: 1;\n}\n100% {\n opacity: 0;\n}\n"]))),ToastBar_f=function(f){var u=f.toast,p=f.onClose,d=u.type,b=u.message,v=u.time,g=void 0===v?2e3:v,h=(0,react.useRef)(),j=useTheme_i().theme,k=useComponentOverrides_l("ToastBar"),B=k.classNames,C=k.styleOverrides,N=function(I){return{toastbar:function(g,b,G){var l;return(0,emotion_react_browser_esm.iv)("display:flex;flex-direction:row;gap:1em;align-items:center;justify-content:space-between;width:fit-content;max-width:20rem;color:",g,";background-color:",b,";border-radius:",I.radius,";padding:0.75em 1em;z-index:",(null===(l=I.zIndex)||void 0===l?void 0:l.toastbar)||1600,";animation:",ToastBar_styles_c," ",G,"ms ease-in-out forwards;","","","")}}}(j),y=(0,react.useMemo)((function(){var o="error"===d?j.colors.destructiveForeground:j.colors["".concat(d,"Foreground")],r="error"===d?j.colors.destructive:j.colors[d],e="success";switch(d){case"info":e="info";break;case"warning":e="report";break;case"error":e="error-circle";break;default:e="check"}return{iconName:e,color:o,bgColor:r}}),[j.colors,d]),T=y.iconName,x=y.bgColor,w=y.color;return(0,react.useEffect)((function(){setTimeout(p,g)}),[p,g]),(0,emotion_react_browser_esm.tZ)(Box_n,{ref:h,css:N.toastbar(w,x,g),className:appendClassNames_a("ec-toast-bar",B),style:C},(0,emotion_react_browser_esm.tZ)(Icon_a,{size:"1em",name:T}),b,(0,emotion_react_browser_esm.tZ)(ActionButton_l,{icon:"cross",size:"small",onClick:p,ghost:!0}))},ToastContext_a=(0,react.createContext)(),ToastContainer_f=function(){var c=function(I){var g;return{container:(0,emotion_react_browser_esm.iv)("position:absolute;z-index:",(null===(g=I.zIndex)||void 0===g?void 0:g.toastbar)||1600,";border-radius:",I.radius,";animation:",ToastBar_styles_c," ",2e3,"ms ease-in-out forwards;","","","")}}(useTheme_i().theme),u=(0,react.useContext)(ToastContext_a),l=u.position,p=u.toasts,h=u.setToasts,j=(0,react.useMemo)((function(){var t=l.split(/\s+/),o={};return t.forEach((function(t){o[t]="2rem"})),o}),[l]),x=(0,react.useMemo)((function(){return p[p.length-1]}),[p]),T=(0,react.useCallback)((function(){h(p.slice(0,p.length-1))}),[h,p]);return x?(0,emotion_react_browser_esm.tZ)(Box_n,{css:c.container,style:j},(0,emotion_react_browser_esm.tZ)(ToastBar_f,{toast:x,onClose:T})):null},ToastBarProvider_u=function(u){var l=u.position,m=void 0===l?"bottom right":l,c=u.children,p=(0,react.useState)([]),f=(0,_rollupPluginBabelHelpers.ZQ)(p,2),d=f[0],v=f[1],T=(0,react.useCallback)((function(o){v((function(r){return[o].concat((0,_rollupPluginBabelHelpers.u)(r))}))}),[v]),b=(0,react.useMemo)((function(){return{toasts:d,dispatchToast:T,position:m,setToasts:v}}),[d,T,m,v]);return(0,emotion_react_browser_esm.tZ)(ToastContext_a.Provider,{value:b},c,(0,emotion_react_browser_esm.tZ)(ToastContainer_f,null))},MessageGenericPreview_m=function(m){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=useComponentOverrides_l("MessageGenericPreview"),p=l.classNames,v=l.styleOverrides,u=function(c){return{container:(0,emotion_react_browser_esm.iv)("display:flex;overflow:hidden;flex-direction:column;padding:0.75rem;border:1px solid ",c.colors.border,";border-radius:",c.radius,";background-color:",c.colors.background,";","","","")}}(useTheme_i().theme);return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({css:u.container,className:"ec-message-generic-preview ".concat(n," ").concat(p),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},c),v)},m))},MessageGenericPreviewCoverImage_s=["className","style","url","width","height"],MessageGenericPreviewCoverImage_m=function(m){var i=m.className,b=void 0===i?"":i,o=m.style,n=void 0===o?{}:o,u=m.url,Z=m.width,r=m.height,d=(0,_rollupPluginBabelHelpers.Kd)(m,MessageGenericPreviewCoverImage_s),C=useComponentOverrides_l("MessageGenericPreviewCoverImage"),V=C.classNames,A=C.styleOverrides;return(0,emotion_react_browser_esm.tZ)(Box_n,(0,_rollupPluginBabelHelpers.gY)({css:(0,emotion_react_browser_esm.iv)("background-image:url(",u,");max-width:100%;","","",""),className:"ec-message-generic-preview__preview ".concat(b," ").concat(V),style:(0,_rollupPluginBabelHelpers.Zj)((0,_rollupPluginBabelHelpers.Zj)({},n),A)},d),(0,emotion_react_browser_esm.tZ)(Box_n,{style:{paddingTop:"".concat(r/Z*100,"%")}}))},MessageGenericPreviewThumb_a=function(){for(var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},m=useComponentOverrides_l("MessageGenericPreviewThumb"),n=m.classNames,l=m.styleOverrides,c=arguments.length,p=new Array(c>2?c-2:0),u=2;u[...array].map((item=>"object"==typeof item?{...item}:item)),upsertMessage=(messages,message)=>{const newMessages=lib_cloneArray(messages),idx=newMessages.findIndex((m=>m._id===message._id));return-1===idx?((messages,message)=>{const idx=messages.findIndex((m=>new Date(m.ts)({messages:[],isMessageLoaded:!1,threadMessages:[],filtered:!1,editMessage:{},quoteMessage:[],messageToReport:NaN,showReportMessage:!1,isRecordingMessage:!1,isThreadOpen:!1,threadMainMessage:null,headerTitle:null,setFilter:filter=>set((()=>({filtered:filter}))),setMessages:messages=>set((()=>({messages,isMessageLoaded:!0}))),upsertMessage:(message,enableThreads=!1)=>{message.tmid&&enableThreads?get().threadMainMessage?._id===message.tmid&&set((state=>({threadMessages:upsertMessage(state.threadMessages,message)}))):set((state=>({messages:upsertMessage(state.messages,message)})))},removeMessage:messageId=>{const threadMessage=get().threadMessages.find((m=>m._id===messageId)),message=get().messages.find((m=>m._id===messageId));return threadMessage?set((state=>({threadMessages:lib_cloneArray(state.threadMessages).filter((m=>m._id!==messageId))}))):message?set((state=>({messages:lib_cloneArray(state.messages).filter((m=>m._id!==messageId))}))):void 0},replaceMessage:(oldMessageId,newMessage)=>{const threadMessage=get().threadMessages.find((m=>m._id===oldMessageId)),message=get().messages.find((m=>m._id===oldMessageId));return threadMessage?set((state=>({threadMessages:lib_cloneArray(state.threadMessages).map((m=>m._id===oldMessageId?newMessage:m))}))):message?set((state=>({messages:lib_cloneArray(state.messages).map((m=>m._id===oldMessageId?newMessage:m))}))):void 0},setEditMessage:editMessage=>set((()=>({editMessage}))),editMessagePermissions:{},setEditMessagePermissions:editMessagePermissions=>set((state=>({...state,editMessagePermissions}))),addQuoteMessage:quoteMessage=>set((state=>({quoteMessage:[...state.quoteMessage,quoteMessage]}))),removeQuoteMessage:quoteMessage=>set((state=>({quoteMessage:state.quoteMessage.filter((i=>i!==quoteMessage))}))),clearQuoteMessages:()=>set({quoteMessage:[]}),setMessageToReport:messageId=>set((()=>({messageToReport:messageId}))),toggleShowReportMessage:()=>{set((state=>({showReportMessage:!state.showReportMessage})))},toogleRecordingMessage:()=>{set((state=>({isRecordingMessage:!state.isRecordingMessage})))},openThread:message=>{set((()=>({isThreadOpen:!0,threadMainMessage:message,threadMessages:[]})))},closeThread:()=>{set((()=>({isThreadOpen:!1,threadMainMessage:null,threadMessages:[]})))},setThreadMessages:messages=>set((()=>({threadMessages:messages}))),setHeaderTitle:title=>set((()=>({headerTitle:title})))}))),messageStore=useMessageStore,userStore=(0,esm.Ue)((set=>({userId:"",setUserId:userId=>{set({userId})},name:"",setName:name=>{set({name})},username:"",setUsername:username=>{set({username})},avatarUrl:"",setUserAvatarUrl:avatarUrl=>set((()=>({avatarUrl}))),isUserAuthenticated:!1,canSendMsg:!0,setIsUserAuthenticated:isUserAuthenticated=>set((()=>({isUserAuthenticated}))),setCanSendMsg:canSendMsg=>set((()=>({canSendMsg}))),password:null,setPassword:password=>set((()=>({password}))),emailoruser:null,setEmailorUser:emailoruser=>set((()=>({emailoruser}))),roles:[],setRoles:roles=>set((state=>({...state,roles}))),userPinPermissions:{},setUserPinPermissions:userPinPermissions=>set((state=>({...state,userPinPermissions}))),showCurrentUserInfo:!1,setShowCurrentUserInfo:showCurrentUserInfo=>set((()=>({showCurrentUserInfo}))),currentUser:{},setCurrentUser:currentUser=>set({currentUser})}))),memberStore=(0,esm.Ue)((set=>({members:[],showMembers:!1,setShowMembers:showMembers=>set((()=>({showMembers}))),memberRoles:{},admins:[],setMemberRoles:memberRoles=>set((state=>({...state,memberRoles}))),setAdmins:admins=>set((()=>({admins}))),setMembersHandler:memberList=>set((()=>({members:memberList})))}))),totpmodalStore=(0,esm.Ue)((set=>({isTotpModalOpen:!1,setIsTotpModalOpen:isTotpModalOpen=>set((()=>({isTotpModalOpen})))}))),searchMessageStore=(0,esm.Ue)((set=>({showSearch:!1,setShowSearch:showSearch=>set((()=>({showSearch})))}))),loginStore=(0,esm.Ue)((set=>({isLoginIn:!1,setIsLoginIn:isLoginIn=>set((()=>({isLoginIn}))),isLoginModalOpen:!1,setIsLoginModalOpen:isLoginModalOpen=>set((()=>({isLoginModalOpen})))}))),channelStore=(0,esm.Ue)((set=>({showChannelinfo:!1,isChannelPrivate:!1,isChannelReadOnly:!1,setShowChannelinfo:showChannelinfo=>set((()=>({showChannelinfo}))),channelInfo:{},setChannelInfo:channelInfo=>set((()=>({channelInfo}))),setIsChannelPrivate:isChannelPrivate=>set((()=>({isChannelPrivate}))),setIsChannelReadOnly:isChannelReadOnly=>set((()=>({isChannelReadOnly})))}))),threadsMessageStore=(0,esm.Ue)((set=>({showAllThreads:!1,setShowAllThreads:showAllThreads=>set((()=>({showAllThreads})))}))),fileStore=(0,esm.Ue)((set=>({showAllFiles:!1,setShowAllFiles:showAllFiles=>set((()=>({showAllFiles})))}))),mentionsStore=(0,esm.Ue)((set=>({showMentions:!1,setShowMentions:showMentions=>set((()=>({showMentions})))}))),pinnedMessageStore=(0,esm.Ue)((set=>({showPinned:!1,setShowPinned:showPinned=>set((()=>({showPinned})))}))),starredMessageStore=(0,esm.Ue)((set=>({showStarred:!1,setShowStarred:showStarred=>set((()=>({showStarred}))),starredMessages:[],setStarredMessages:messages=>set((()=>({starredMessages:messages})))}))),sidebarStore=(0,esm.Ue)((set=>({showSidebar:!1,setShowSidebar:showSidebar=>set((()=>({showSidebar})))}))),RCContext=(0,react.createContext)(),RCInstanceProvider=RCContext.Provider,useRCContext=()=>(0,react.useContext)(RCContext),context_RCInstance=RCContext;var _ref={name:"h1xy3v",styles:"flex:1;overflow-y:auto;margin-top:1rem"},_ref2={name:"12urymy",styles:"flex:1;border:none;padding:none;font-size:1rem;&:focus{outline:none;}"},_ref3={name:"xrcysx",styles:"display:flex;flex-direction:column;height:100%;width:100%;padding:0 1rem 1rem;box-sizing:border-box"};const RoomMemberItemStyles={container:{name:"1a8cu2",styles:"width:100%;padding-bottom:8px;padding-top:8px;display:flex;align-items:center"},icon:{name:"lw5r8p",styles:"padding:0.125em;margin-right:0.5rem;align-self:center"}},InviteMemberStyles={parentContainer:{name:"1d69x1f",styles:"width:100%;margin-top:1rem;display:flex;flex-direction:column"},childContainer:{name:"17wse3r",styles:"display:flex;justify-content:space-between;align-items:center;margin-bottom:10px"}},hooks_useSetExclusiveState=()=>{const setShowSidebar=sidebarStore((state=>state.setShowSidebar)),setShowMembers=memberStore((state=>state.setShowMembers)),setShowSearch=searchMessageStore((state=>state.setShowSearch)),setShowPinned=pinnedMessageStore((state=>state.setShowPinned)),setShowStarred=starredMessageStore((state=>state.setShowStarred)),setShowAllThreads=threadsMessageStore((state=>state.setShowAllThreads)),setShowAllFiles=fileStore((state=>state.setShowAllFiles)),setShowMentions=mentionsStore((state=>state.setShowMentions)),setShowCurrentUserInfo=userStore((state=>state.setShowCurrentUserInfo)),setShowChannelinfo=channelStore((state=>state.setShowChannelinfo)),stateSetters=(0,react.useMemo)((()=>[setShowStarred,setShowPinned,setShowMembers,setShowSearch,setShowChannelinfo,setShowAllThreads,setShowAllFiles,setShowMentions,setShowCurrentUserInfo]),[setShowAllFiles,setShowAllThreads,setShowChannelinfo,setShowCurrentUserInfo,setShowMembers,setShowMentions,setShowPinned,setShowSearch,setShowStarred]);return activeSetter=>{let isPanelActive=!1;stateSetters.forEach((setter=>{setter===activeSetter?(isPanelActive=!0,setter(!0)):setter(!1)})),setShowSidebar(isPanelActive)}};var RoomMemberItem_ref={name:"s5xdrg",styles:"display:flex;align-items:center"},RoomMemberItem_ref2={name:"u7ytkp",styles:"margin-right:0.5rem"};const RoomMemberItem=({user,host})=>{const{RCInstance}=(0,react.useContext)(context_RCInstance),[userStatus,setUserStatus]=(0,react.useState)(""),avatarUrl=new URL(`avatar/${user.username}`,host).toString();(0,react.useEffect)((()=>{(async()=>{try{const res=await RCInstance.getUserStatus(user._id);res.success&&setUserStatus(res.status)}catch(err){console.error("Error fetching user status:",err)}})()}),[RCInstance]);const setExclusiveState=hooks_useSetExclusiveState(),{setShowCurrentUserInfo,setCurrentUser}=userStore((state=>({setShowCurrentUserInfo:state.setShowCurrentUserInfo,setCurrentUser:state.setCurrentUser})));return(0,emotion_react_browser_esm.tZ)(Box_n,{css:RoomMemberItemStyles.container,style:{cursor:"pointer"},onClick:()=>{setExclusiveState(setShowCurrentUserInfo),setCurrentUser(user)}},(0,emotion_react_browser_esm.tZ)(Avatar_p,{url:avatarUrl,alt:"avatar",size:"1.5rem",css:RoomMemberItem_ref2}),(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:RoomMemberItem_ref},userStatus&&(0,emotion_react_browser_esm.tZ)(Icon_a,{name:userStatus,size:"1.25rem",css:RoomMemberItemStyles.icon}),(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},user.name," (",user.username,")")))};RoomMemberItem.displayName="RoomMemberItem",RoomMemberItem.__docgenInfo={description:"",methods:[],displayName:"RoomMemberItem",props:{user:{description:"",type:{name:"object"},required:!1}}};const RoomMembers_RoomMemberItem=RoomMemberItem;RoomMemberItem.propTypes={user:prop_types_default().object};const inviteStore=(0,esm.Ue)((set=>({showInvite:!1,toggleInviteView:()=>set((state=>({showInvite:!state.showInvite})))})));var MessageAggregator_styles_ref={name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"},MessageAggregator_styles_ref2={name:"sjczm1",styles:"justify-content:center;align-items:center"},MessageAggregator_styles_ref3={name:"o4s2vi",styles:"flex:1;display:flex;flex-direction:column;justify-content:initial;align-items:initial;max-width:100%"};const MessageAggregator_styles=()=>({listContainerStyles:MessageAggregator_styles_ref3,noMessageStyles:MessageAggregator_styles_ref2,centerColumnStyles:MessageAggregator_styles_ref}),LoadingIndicator=()=>{const styles=MessageAggregator_styles();return(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.centerColumnStyles},(0,emotion_react_browser_esm.tZ)(Throbber_m,null))};LoadingIndicator.displayName="LoadingIndicator",LoadingIndicator.__docgenInfo={description:"",methods:[],displayName:"LoadingIndicator"};const common_LoadingIndicator=LoadingIndicator;var InviteMembers_ref={name:"s2xak6",styles:"font-size:0.78em"},InviteMembers_ref2={name:"hkh81z",styles:"margin-top:8px"},InviteMembers_ref3={name:"yhe5ws",styles:"width:100%;display:flex;justify-content:space-between"},_ref4={name:"1fttcpj",styles:"display:flex;flex-direction:column"};const InviteMembers=()=>{const toggleInviteView=inviteStore((state=>state.toggleInviteView)),dispatchToastMessage=useToastBarDispatch_r(),[inviteData,setInviteData]=(0,react.useState)(null),[isLoading,setIsLoading]=(0,react.useState)(!0),{RCInstance}=(0,react.useContext)(context_RCInstance);(0,react.useEffect)((()=>{(async()=>{try{const res=await RCInstance.findOrCreateInvite();setInviteData(res),setIsLoading(!1)}catch(error){console.error("Error fetching user info:",error)}})()}),[RCInstance]);return(0,emotion_react_browser_esm.tZ)(react.Fragment,null,isLoading?(0,emotion_react_browser_esm.tZ)(common_LoadingIndicator,null):(0,emotion_react_browser_esm.tZ)(Box_n,{css:_ref4},(0,emotion_react_browser_esm.tZ)(Box_n,{css:InviteMembers_ref3},(0,emotion_react_browser_esm.tZ)(Heading_l,{level:3,style:{display:"contents"}},"Invite Members"),(0,emotion_react_browser_esm.tZ)(ActionButton_l,{onClick:()=>toggleInviteView(),ghost:!0,size:"small"},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"back",size:"1.25rem"}))),(0,emotion_react_browser_esm.tZ)(Box_n,{css:InviteMemberStyles.parentContainer},(0,emotion_react_browser_esm.tZ)(Box_n,{css:InviteMemberStyles.childContainer},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},(0,emotion_react_browser_esm.tZ)("b",null,"Invite Link")),(0,emotion_react_browser_esm.tZ)(ActionButton_l,{onClick:()=>{inviteData&&inviteData.url&&navigator.clipboard.writeText(inviteData.url).then((()=>{dispatchToastMessage({type:"success",message:"Copied to clipboard"})})).catch((error=>{console.error("Error copying to clipboard:",error)}))},ghost:!0,size:"small"},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"copy",size:"1.25rem"}))),(0,emotion_react_browser_esm.tZ)(Input_c,{readOnly:!0,value:inviteData.url})),(0,emotion_react_browser_esm.tZ)(Box_n,{css:InviteMembers_ref2},(0,emotion_react_browser_esm.tZ)("p",{css:InviteMembers_ref},(0,emotion_react_browser_esm.tZ)("b",null,"Your invite link will expire on"," ",new Date(inviteData.expires).toString().split("GMT")[0])))))};InviteMembers.__docgenInfo={description:"",methods:[],displayName:"InviteMembers"};const RoomMembers_InviteMembers=InviteMembers;function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{const{RCInstance}=(0,react.useContext)(context_RCInstance),{ECOptions}=useRCContext(),{host}=ECOptions,{theme}=useTheme_i(),styles=(theme=>({container:_ref3,searchContainer:(0,emotion_react_browser_esm.iv)("display:flex;align-items:center;justify-content:space-between;border:1px solid ",theme.colors.border,";padding:0 0.5rem;border-radius:",theme.radius,";position:relative;margin-top:1rem;",""),textInput:_ref2,searchIcon:(0,emotion_react_browser_esm.iv)("padding-left:0.5rem;font-size:1.25rem;color:",theme.colors.icon,";",""),memberList:_ref,noMembers:(0,emotion_react_browser_esm.iv)("text-align:center;color:",theme.colors.textSecondary,";margin-top:1rem;","")}))(theme),toggleInviteView=inviteStore((state=>state.toggleInviteView)),showInvite=inviteStore((state=>state.showInvite)),[isLoading,setIsLoading]=(0,react.useState)(!0),{variantOverrides}=useComponentOverrides_l("RoomMember"),viewType=variantOverrides.viewType||"Sidebar",[userInfo,setUserInfo]=(0,react.useState)(null),setExclusiveState=hooks_useSetExclusiveState(),[searchTerm,setSearchTerm]=(0,react.useState)(""),[filteredMembers,setFilteredMembers]=(0,react.useState)(members);(0,react.useEffect)((()=>{(async()=>{try{const res=await RCInstance.me();setUserInfo(res),setIsLoading(!1)}catch(error){console.error("Error fetching user info:",error)}})()}),[RCInstance]),(0,react.useEffect)((()=>{setFilteredMembers(members.filter((member=>member.name?.toLowerCase().includes(searchTerm.toLowerCase())||member.username?.toLowerCase().includes(searchTerm.toLowerCase()))))}),[searchTerm,members]);const isAdmin=(userInfo&&userInfo.roles?userInfo.roles:[]).includes("admin"),ViewComponent="Popup"===viewType?Popup_i:Sidebar_n;return(0,emotion_react_browser_esm.tZ)(ViewComponent,_extends({title:"Members",iconName:"members",onClose:()=>setExclusiveState(null),style:{width:"400px",zIndex:window.innerWidth<=780?1:null}},"Popup"===viewType?{isPopupHeader:!0}:{}),isLoading?(0,emotion_react_browser_esm.tZ)(common_LoadingIndicator,null):(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.container},showInvite?(0,emotion_react_browser_esm.tZ)(RoomMembers_InviteMembers,null):(0,emotion_react_browser_esm.tZ)(react.Fragment,null,isAdmin&&(0,emotion_react_browser_esm.tZ)(Button_c,{style:{marginTop:"10px",width:"100%"},onClick:async()=>{toggleInviteView()}},(0,emotion_react_browser_esm.tZ)(Icon_a,{size:"1em",name:"link"})," Invite Link"),(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.searchContainer},(0,emotion_react_browser_esm.tZ)(Input_c,{css:styles.textInput,value:searchTerm,onChange:e=>setSearchTerm(e.target.value),placeholder:"Search members"}),(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"magnifier",size:"1.5rem",css:styles.searchIcon})),(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.memberList},filteredMembers.length>0?filteredMembers.map((member=>(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(RoomMembers_RoomMemberItem,{user:member,host,key:member._id})))):(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.noMembers},"No members found")))))};RoomMembers.displayName="RoomMembers",RoomMembers.__docgenInfo={description:"",methods:[],displayName:"RoomMembers",props:{members:{description:"",type:{name:"arrayOf",value:{name:"custom",raw:"PropTypes.shape"}},required:!1}}};const RoomMember=RoomMembers;RoomMembers.propTypes={members:prop_types_default().arrayOf(prop_types_default().shape)};var isSameDay=__webpack_require__("../../node_modules/date-fns/esm/isSameDay/index.js"),format=__webpack_require__("../../node_modules/date-fns/esm/format/index.js");var _ref8={name:"1pbsm93",styles:"opacity:0.4!important;white-space:pre-line"};const MessageBodyStyles={messageBody:{name:"a7vyhb",styles:"position:relative;letter-spacing:0rem;font-size:0.875rem;font-weight:400;line-height:1.25rem;flex-shrink:1;transition:opacity 0.3s linear;word-break:break-word;opacity:1;margin-top:0.125rem;margin-bottom:0.125rem"}};var _ref7={name:"1ub65qx",styles:"letter-spacing:0rem;font-size:0.75rem;font-weight:700;line-height:1rem;position:relative;display:flex;z-index:1000;align-items:center;margin-top:0.5rem;margin-bottom:0.75rem;padding-left:1.25rem;padding-right:1.25rem;@media (max-width: 780px){z-index:1;}"};var _ref5={name:"1uhx23k",styles:"letter-spacing:0rem;font-size:0.875rem;font-weight:700;line-height:1.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:1"},_ref6={name:"tpzr4d",styles:"display:flex;flex-direction:row;flex-grow:0;flex-shrink:1;min-width:1px;margin-top:0.125rem;margin-bottom:0.125rem;gap:0.125rem;align-items:center"};const MessageMetricsStyles={metrics:{name:"1ap9rax",styles:"display:flex;margin-left:-0.25rem;margin-right:-0.25rem;margin-top:0.5rem"},metricsItem:(isFirstMessage=!1)=>(0,emotion_react_browser_esm.iv)("letter-spacing:0rem;font-size:0.625rem;font-weight:700;line-height:0.75rem;display:flex;justify-content:center;align-items:center;margin-left:",isFirstMessage?"0.5rem":"0.25rem",";",""),metricsItemLabel:{name:"rgv2oo",styles:"margin:0.25rem;margin-inline-start:0.25rem;white-space:nowrap"}};var Message_styles_ref4={name:"1l3g8cv",styles:"display:flex;flex-flow:row wrap;justify-content:flex-start"};var Message_styles_ref2={name:"5nmune",styles:"position:absolute;bottom:100%;right:1.5rem"},Message_styles_ref3={name:"l4u2h8",styles:"display:none;.ec-message:hover &{display:flex;position:absolute;bottom:100%;z-index:1101;right:2rem;}"};var Message_styles_ref={name:"mmi6v1",styles:"margin-left:5px;position:relative;width:100%"};function MessageDivider_extends(){return MessageDivider_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{const{classNames,styleOverrides}=useComponentOverrides_l("MessageDivider",className,style),{theme}=useTheme_i(),styles=(theme=>({divider:_ref7,dividerContent:(0,emotion_react_browser_esm.iv)("margin-top:0.5rem;margin-bottom:0.5rem;padding-left:0.5rem;padding-right:0.5rem;background-color:",theme.colors.secondary,";color:",theme.colors.secondaryForeground,";position:absolute;left:50%;transform:translateX(-50%);border-radius:",theme.radius,";",""),bar:(0,emotion_react_browser_esm.iv)("display:flex;justify-content:flex-end;align-items:center;flex-grow:1;height:1px;background-color:",theme.colors.secondary,";","")}))(theme);return(0,emotion_react_browser_esm.tZ)(Box_n,MessageDivider_extends({role:"separator",css:styles.divider,className:appendClassNames_a("ec-message-divider",classNames),style:styleOverrides},props),children&&(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.bar,className:"ec-message-divider-bar"}),(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.dividerContent,className:"ec-message-divider-content"},children)," "))};MessageDivider.displayName="MessageDivider",MessageDivider.__docgenInfo={description:"",methods:[],displayName:"MessageDivider",props:{className:{defaultValue:{value:"''",computed:!1},required:!1},style:{defaultValue:{value:"{}",computed:!1},required:!1}}};var AttachmentMetadata_ref={name:"vevmp3",styles:"margin-left:10px;margin-top:5px"},AttachmentMetadata_ref2={name:"18noe7j",styles:"margin:0;font-size:14px;opacity:0.7"},AttachmentMetadata_ref3={name:"fhxb3m",styles:"display:flex;flex-direction:row;align-items:center"},AttachmentMetadata_ref4={name:"3ku9uj",styles:"margin:9px 0 0"},AttachmentMetadata_ref5={name:"1fttcpj",styles:"display:flex;flex-direction:column"};const AttachmentMetadata=({attachment,url,variantStyles={}})=>(0,emotion_react_browser_esm.tZ)(Box_n,{css:[AttachmentMetadata_ref5,variantStyles.attachmentMetaContainer,"",""]},(0,emotion_react_browser_esm.tZ)("p",{css:[AttachmentMetadata_ref4,"",""]},attachment.description),(0,emotion_react_browser_esm.tZ)(Box_n,{css:AttachmentMetadata_ref3},(0,emotion_react_browser_esm.tZ)("p",{css:AttachmentMetadata_ref2},attachment.title),(0,emotion_react_browser_esm.tZ)(ActionButton_l,{ghost:!0,icon:"download",size:"small",onClick:async()=>{try{const response=await fetch(url),data=await response.blob(),downloadUrl=URL.createObjectURL(data),anchor=document.createElement("a");anchor.href=downloadUrl,anchor.download=attachment.title||"download",document.body.appendChild(anchor),anchor.click(),document.body.removeChild(anchor),URL.revokeObjectURL(downloadUrl)}catch(error){console.error("Error downloading the file:",error)}},css:AttachmentMetadata_ref})));AttachmentMetadata.displayName="AttachmentMetadata",AttachmentMetadata.__docgenInfo={description:"",methods:[],displayName:"AttachmentMetadata",props:{variantStyles:{defaultValue:{value:"{}",computed:!1},required:!1}}};const AttachmentHandler_AttachmentMetadata=AttachmentMetadata;var swiper_element_bundle=__webpack_require__("../../node_modules/swiper/swiper-element-bundle.mjs");function Swiper(props){const swiperRef=(0,react.useRef)(null),{children,...rest}=props;return(0,react.useEffect)((()=>{(0,swiper_element_bundle.z2)();const params={...rest};Object.assign(swiperRef.current,params),swiperRef.current.initialize()}),[]),(0,emotion_react_browser_esm.tZ)("swiper-container",{init:"false",ref:swiperRef},children)}function SwiperSlide(props){const{children,...rest}=props;return(0,emotion_react_browser_esm.tZ)("swiper-slide",rest,children)}Swiper.displayName="Swiper",SwiperSlide.displayName="SwiperSlide",Swiper.__docgenInfo={description:"",methods:[],displayName:"Swiper"},SwiperSlide.__docgenInfo={description:"",methods:[],displayName:"SwiperSlide"};var ImageGallery_styles_ref={name:"vxhryu",styles:"width:100%;height:100%;overflow:hidden"},ImageGallery_styles_ref2={name:"3eng59",styles:"height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center"},ImageGallery_styles_ref3={name:"1ichkjj",styles:"height:100%;display:flex;justify-content:center;align-items:center"},ImageGallery_styles_ref4={name:"1hauznb",styles:"max-width:100%;max-height:100%;object-fit:contain"},ImageGallery_styles_ref5={name:"1rsgk71",styles:"display:flex;height:100vh;justify-content:center;align-items:center"};const ImageGallery_styles=theme=>({overlay:(0,emotion_react_browser_esm.iv)("position:absolute;top:0;left:0;width:100%;height:100%;z-index:1500;background-color:",color_o(theme.commonColors.black,.5),";",""),exit:(0,emotion_react_browser_esm.iv)("position:absolute;top:16px;right:16px;background:",theme.colors.primary,";color:",theme.colors.primaryForeground,";border:none;border-radius:",theme.radius,";padding:8px 16px;cursor:pointer;z-index:1501;",""),imageContainer:ImageGallery_styles_ref5,image:ImageGallery_styles_ref4,throbberContainer:ImageGallery_styles_ref3,fetchErrorContainer:ImageGallery_styles_ref2,swiperContainer:ImageGallery_styles_ref,swiperInject:`\n .swiper-button-next,\n .swiper-button-prev {\n color: ${theme.colors.primary};\n }\n `}),ImageGallery=({currentFileId,setShowGallery})=>{const{theme}=useTheme_i(),styles=ImageGallery_styles(theme),{RCInstance}=useRCContext(),[files,setFiles]=(0,react.useState)([]),[currentFileIndex,setCurrentFileIndex]=(0,react.useState)(-1),[loading,setLoading]=(0,react.useState)(!0),[imgFetchErr,setImgFetchErr]=(0,react.useState)(!1);return(0,react.useEffect)((()=>{(async()=>{const res=await RCInstance.getAllImages();if(res){if(res?.files){setFiles(res.files);const fileIndex=res.files.findIndex((file=>file._id===currentFileId));setCurrentFileIndex(fileIndex),setLoading(!1)}}else setLoading(!1),setImgFetchErr(!0)})()}),[RCInstance,setFiles,setCurrentFileIndex,currentFileId]),(0,emotion_react_browser_esm.tZ)(reactPortal_o,{wrapperId:"overlay-items"},(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.overlay},(0,emotion_react_browser_esm.tZ)(ActionButton_l,{css:styles.exit,onClick:()=>setShowGallery(!1),size:"medium"},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"cross"})),loading&&(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.throbberContainer},(0,emotion_react_browser_esm.tZ)(Throbber_m,null)),imgFetchErr||-1===currentFileIndex?(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.fetchErrorContainer,style:{display:"flex",flexDirection:"column",alignItems:"center"}},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"magnifier",size:"3rem",style:{padding:"0.5rem",color:theme.colors.destructive}}),(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",style:{fontSize:"1.2rem",fontWeight:"bold",color:theme.colors.primaryForeground}},"Something went wrong"),(0,emotion_react_browser_esm.tZ)(Button_c,{type:"primary",onClick:()=>setShowGallery(!1),style:{alignSelf:"auto",margin:"10px"}},"Close")):(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.swiperContainer},(0,emotion_react_browser_esm.tZ)(Swiper,{navigation:!0,pagination:{clickable:!0},keyboard:!0,initialSlide:currentFileIndex,injectStyles:[styles.swiperInject]},files.map((({_id,url})=>(0,emotion_react_browser_esm.tZ)(SwiperSlide,{key:_id},(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.imageContainer},(0,emotion_react_browser_esm.tZ)("img",{src:url,css:styles.image})))))),")")))};ImageGallery.displayName="ImageGallery",ImageGallery.__docgenInfo={description:"",methods:[],displayName:"ImageGallery"};const ImageGallery_ImageGallery=ImageGallery;var ImageAttachment_ref={name:"14e1lrc",styles:"display:flex;gap:0.3rem;align-items:center"},ImageAttachment_ref2={name:"1p4hzw7",styles:"cursor:pointer;border-radius:inherit;line-height:0;padding:0.5rem"},ImageAttachment_ref3={name:"14e1lrc",styles:"display:flex;gap:0.3rem;align-items:center"},ImageAttachment_ref4={name:"1p4hzw7",styles:"cursor:pointer;border-radius:inherit;line-height:0;padding:0.5rem"};const ImageAttachment=({attachment,host,type,author,variantStyles={}})=>{const{RCInstance}=(0,react.useContext)(context_RCInstance),[showGallery,setShowGallery]=(0,react.useState)(!1),getUserAvatarUrl=icon=>`${RCInstance.getHost()}${icon}`,extractIdFromUrl=url=>{const match=url.match(/\/file-upload\/(.*?)\//);return match?match[1]:null},{theme}=useTheme_i(),{authorIcon,authorName}=author;return(0,emotion_react_browser_esm.tZ)(Box_n,{css:variantStyles.imageAttachmentContainer},(0,emotion_react_browser_esm.tZ)(Box_n,{onClick:()=>setShowGallery(!0),css:[ImageAttachment_ref4,(type?variantStyles.pinnedContainer:"")||(0,emotion_react_browser_esm.iv)("file"===type?`border: 2px solid ${theme.colors.border};`:"",";",""),"",""]},"file"===type?(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Box_n,{css:[ImageAttachment_ref3,variantStyles.textUserInfo,"",""]},(0,emotion_react_browser_esm.tZ)(Avatar_p,{url:getUserAvatarUrl(authorIcon),alt:"avatar",size:"1.2em"}),(0,emotion_react_browser_esm.tZ)(Box_n,null,"@",authorName))):"",(0,emotion_react_browser_esm.tZ)(AttachmentHandler_AttachmentMetadata,{attachment,url:host+(attachment.title_link||attachment.image_url),variantStyles}),(0,emotion_react_browser_esm.tZ)("img",{src:host+attachment.image_url,style:{maxWidth:"100%",objectFit:"contain",borderBottomLeftRadius:"inherit",borderBottomRightRadius:"inherit"}}),attachment.attachments&&attachment.attachments.map(((nestedAttachment,index)=>(0,emotion_react_browser_esm.tZ)(Box_n,{css:variantStyles.imageAttachmentContainer,key:index},(0,emotion_react_browser_esm.tZ)(Box_n,{onClick:()=>setShowGallery(!0),css:[ImageAttachment_ref2,(nestedAttachment.attachments[0].type?variantStyles.pinnedContainer:variantStyles.quoteContainer)||(0,emotion_react_browser_esm.iv)("file"===nestedAttachment.attachments[0].type?`border: 2px solid ${theme.colors.border};`:"",";",""),"",""]},"file"===nestedAttachment.type?(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Box_n,{css:[ImageAttachment_ref,variantStyles.textUserInfo,"",""]},(0,emotion_react_browser_esm.tZ)(Avatar_p,{url:getUserAvatarUrl(nestedAttachment.author_icon),alt:"avatar",size:"1.2em"}),(0,emotion_react_browser_esm.tZ)(Box_n,null,"@",nestedAttachment.author_name))):"",(0,emotion_react_browser_esm.tZ)(AttachmentHandler_AttachmentMetadata,{attachment:nestedAttachment,url:host+(nestedAttachment.title_link||nestedAttachment.image_url),variantStyles}),(0,emotion_react_browser_esm.tZ)("img",{src:host+nestedAttachment.image_url,style:{maxWidth:"100%",objectFit:"contain",borderBottomLeftRadius:"inherit",borderBottomRightRadius:"inherit"}})),showGallery&&(0,emotion_react_browser_esm.tZ)(ImageGallery_ImageGallery,{currentFileId:extractIdFromUrl(nestedAttachment.title_link),setShowGallery}))))),showGallery&&(0,emotion_react_browser_esm.tZ)(ImageGallery_ImageGallery,{currentFileId:extractIdFromUrl(attachment.title_link),setShowGallery}))};ImageAttachment.displayName="ImageAttachment",ImageAttachment.__docgenInfo={description:"",methods:[],displayName:"ImageAttachment",props:{variantStyles:{defaultValue:{value:"{}",computed:!1},required:!1},attachment:{description:"",type:{name:"object"},required:!1},host:{description:"",type:{name:"string"},required:!1}}};const AttachmentHandler_ImageAttachment=ImageAttachment;ImageAttachment.propTypes={attachment:prop_types_default().object,host:prop_types_default().string};var AudioAttachment_ref={name:"14e1lrc",styles:"display:flex;gap:0.3rem;align-items:center"},AudioAttachment_ref2={name:"2vkory",styles:"line-height:0;border-radius:inherit;padding:0.5rem"},AudioAttachment_ref3={name:"14e1lrc",styles:"display:flex;gap:0.3rem;align-items:center"},AudioAttachment_ref4={name:"2vkory",styles:"line-height:0;border-radius:inherit;padding:0.5rem"};const AudioAttachment=({attachment,host,type,author,variantStyles})=>{const{RCInstance}=(0,react.useContext)(context_RCInstance),{theme}=useTheme_i(),getUserAvatarUrl=icon=>`${RCInstance.getHost()}${icon}`,{authorIcon,authorName}=author;return(0,emotion_react_browser_esm.tZ)(Box_n,null,(0,emotion_react_browser_esm.tZ)(Box_n,{css:[AudioAttachment_ref4,(type?variantStyles.pinnedContainer:"")||(0,emotion_react_browser_esm.iv)("file"===type?`border: 3px solid ${theme.colors.border};`:"",";",""),"",""]},"file"===type?(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Box_n,{css:[AudioAttachment_ref3,variantStyles.textUserInfo,"",""]},(0,emotion_react_browser_esm.tZ)(Avatar_p,{url:getUserAvatarUrl(authorIcon),alt:"avatar",size:"1.2em"}),(0,emotion_react_browser_esm.tZ)(Box_n,null,"@",authorName))):"",(0,emotion_react_browser_esm.tZ)(AttachmentHandler_AttachmentMetadata,{attachment,url:host+(attachment.title_url||attachment.audio_url),variantStyles}),(0,emotion_react_browser_esm.tZ)("audio",{src:host+attachment.audio_url,width:"100%",controls:!0}),attachment.attachments&&attachment.attachments.map(((nestedAttachment,index)=>(0,emotion_react_browser_esm.tZ)(Box_n,{key:index},(0,emotion_react_browser_esm.tZ)(Box_n,{css:[AudioAttachment_ref2,(nestedAttachment.type?variantStyles.pinnedContainer:variantStyles.quoteContainer)||(0,emotion_react_browser_esm.iv)("file"===nestedAttachment.type?`border: 3px solid ${theme.colors.border};`:"",";",""),"",""]},"file"===nestedAttachment.type?(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Box_n,{css:[AudioAttachment_ref,variantStyles.textUserInfo,"",""]},(0,emotion_react_browser_esm.tZ)(Avatar_p,{url:getUserAvatarUrl(nestedAttachment.author_icon),alt:"avatar",size:"1.2em"}),(0,emotion_react_browser_esm.tZ)(Box_n,null,"@",nestedAttachment.author_name))):"",(0,emotion_react_browser_esm.tZ)(AttachmentHandler_AttachmentMetadata,{attachment:nestedAttachment,url:host+(nestedAttachment.title_url||nestedAttachment.audio_url),variantStyles}),(0,emotion_react_browser_esm.tZ)("audio",{src:host+nestedAttachment.audio_url,width:"100%",controls:!0})))))))};AudioAttachment.displayName="AudioAttachment",AudioAttachment.__docgenInfo={description:"",methods:[],displayName:"AudioAttachment",props:{attachment:{description:"",type:{name:"object"},required:!1},host:{description:"",type:{name:"string"},required:!1}}};const AttachmentHandler_AudioAttachment=AudioAttachment;AudioAttachment.propTypes={attachment:prop_types_default().object,host:prop_types_default().string};const userAgentMIMETypeFallback=type=>{const userAgent=navigator.userAgent.toLocaleLowerCase();return"video/quicktime"===type&&-1!==userAgent.indexOf("safari")?"video/mp4":type};var VideoAttachment_ref={name:"14e1lrc",styles:"display:flex;gap:0.3rem;align-items:center"},VideoAttachment_ref2={name:"2vkory",styles:"line-height:0;border-radius:inherit;padding:0.5rem"},VideoAttachment_ref3={name:"14e1lrc",styles:"display:flex;gap:0.3rem;align-items:center"},VideoAttachment_ref4={name:"2vkory",styles:"line-height:0;border-radius:inherit;padding:0.5rem"};const VideoAttachment=({attachment,host,type,author,variantStyles={}})=>{const{RCInstance}=(0,react.useContext)(context_RCInstance),{theme}=useTheme_i(),getUserAvatarUrl=icon=>`${RCInstance.getHost()}${icon}`,{authorIcon,authorName}=author;return(0,emotion_react_browser_esm.tZ)(Box_n,{css:variantStyles.videoAttachmentContainer},(0,emotion_react_browser_esm.tZ)(Box_n,{css:[VideoAttachment_ref4,(type?variantStyles.pinnedContainer:"")||(0,emotion_react_browser_esm.iv)("file"===type?`border: 3px solid ${theme.colors.border};`:"",";",""),"",""]},"file"===type?(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Box_n,{css:[VideoAttachment_ref3,variantStyles.textUserInfo,"",""]},(0,emotion_react_browser_esm.tZ)(Avatar_p,{url:getUserAvatarUrl(authorIcon),alt:"avatar",size:"1.2em"}),(0,emotion_react_browser_esm.tZ)(Box_n,null,"@",authorName))):"",(0,emotion_react_browser_esm.tZ)(AttachmentHandler_AttachmentMetadata,{attachment,url:host+(attachment.title_url||attachment.video_url),variantStyles}),(0,emotion_react_browser_esm.tZ)("video",{width:300,controls:!0,style:{borderBottomLeftRadius:"inherit",borderBottomRightRadius:"inherit"}},(0,emotion_react_browser_esm.tZ)("source",{src:host+attachment.video_url,type:userAgentMIMETypeFallback(attachment.video_type)})),attachment.attachments&&attachment.attachments.map(((nestedAttachment,index)=>(0,emotion_react_browser_esm.tZ)(Box_n,{css:variantStyles.videoAttachmentContainer,key:index},(0,emotion_react_browser_esm.tZ)(Box_n,{css:[VideoAttachment_ref2,(nestedAttachment.type?variantStyles.pinnedContainer:variantStyles.quoteContainer)||(0,emotion_react_browser_esm.iv)("file"===type?`border: 3px solid ${theme.colors.border};`:"",";",""),"",""]},"file"===nestedAttachment.type?(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Box_n,{css:[VideoAttachment_ref,variantStyles.textUserInfo,"",""]},(0,emotion_react_browser_esm.tZ)(Avatar_p,{url:getUserAvatarUrl(authorIcon),alt:"avatar",size:"1.2em"}),(0,emotion_react_browser_esm.tZ)(Box_n,null,"@",authorName))):"",(0,emotion_react_browser_esm.tZ)(AttachmentHandler_AttachmentMetadata,{attachment:nestedAttachment,url:host+(nestedAttachment.title_url||nestedAttachment.video_url),variantStyles}),(0,emotion_react_browser_esm.tZ)("video",{width:300,controls:!0,style:{borderBottomLeftRadius:"inherit",borderBottomRightRadius:"inherit"}},(0,emotion_react_browser_esm.tZ)("source",{src:host+attachment.video_url,type:userAgentMIMETypeFallback(nestedAttachment.video_type)}))))))))};VideoAttachment.displayName="VideoAttachment",VideoAttachment.__docgenInfo={description:"",methods:[],displayName:"VideoAttachment",props:{variantStyles:{defaultValue:{value:"{}",computed:!1},required:!1},attachment:{description:"",type:{name:"object"},required:!1},host:{description:"",type:{name:"string"},required:!1}}};const AttachmentHandler_VideoAttachment=VideoAttachment;VideoAttachment.propTypes={attachment:prop_types_default().object,host:prop_types_default().string};var TextAttachment_ref={name:"1nkwfge",styles:"margin-top:0.5rem;white-space:pre-line"},TextAttachment_ref2={name:"14e1lrc",styles:"display:flex;gap:0.3rem;align-items:center"},TextAttachment_ref3={name:"1nkwfge",styles:"margin-top:0.5rem;white-space:pre-line"},TextAttachment_ref4={name:"14e1lrc",styles:"display:flex;gap:0.3rem;align-items:center"};const TextAttachment=({attachment,type,variantStyles={}})=>{const{RCInstance}=(0,react.useContext)(context_RCInstance),getUserAvatarUrl=authorIcon=>`${RCInstance.getHost()}${authorIcon}`,{theme}=useTheme_i();return(0,emotion_react_browser_esm.tZ)(Box_n,{css:[(0,emotion_react_browser_esm.iv)("display:flex;flex-direction:column;letter-spacing:0rem;font-size:0.875rem;font-weight:400;word-break:break-word;border-inline-start:3px solid ",theme.colors.border,";margin-top:0.75rem;padding:0.5rem;",""),(type?variantStyles.pinnedContainer:variantStyles.quoteContainer)||(0,emotion_react_browser_esm.iv)(type?"":`border: 3px solid ${theme.colors.border};`,";",""),"",""]},(0,emotion_react_browser_esm.tZ)(Box_n,{css:[TextAttachment_ref4,variantStyles.textUserInfo,"",""]},attachment?.author_name&&(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Avatar_p,{url:getUserAvatarUrl(attachment?.author_icon),alt:"avatar",size:"1.2em"}),(0,emotion_react_browser_esm.tZ)(Box_n,null,"@",attachment?.author_name))),(0,emotion_react_browser_esm.tZ)(Box_n,{css:TextAttachment_ref3},attachment?.text?"["===attachment.text[0]?attachment.text.match(/\n(.*)/)?.[1]||"":attachment.text:"",attachment?.attachments&&attachment.attachments.map(((nestedAttachment,index)=>(0,emotion_react_browser_esm.tZ)(Box_n,{css:[(0,emotion_react_browser_esm.iv)("display:flex;flex-direction:column;letter-spacing:0rem;font-size:0.875rem;font-weight:400;word-break:break-word;border-inline-start:3px solid ",theme.colors.border,";margin-top:0.75rem;padding:0.5rem;",""),(nestedAttachment?.type?variantStyles.pinnedContainer:"")||(0,emotion_react_browser_esm.iv)(attachment?.type?"":`border: 2px solid ${theme.colors.border};`,";",""),(0,emotion_react_browser_esm.iv)(void 0!==variantStyles.name&&variantStyles.name.includes("bubble")?"border-bottom-left-radius: 0.75rem; border-bottom-right-radius: 0.75rem":"",";",""),"",""],key:index},(0,emotion_react_browser_esm.tZ)(Box_n,{css:[TextAttachment_ref2,variantStyles.textUserInfo,"",""]},nestedAttachment?.author_name&&(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Avatar_p,{url:getUserAvatarUrl(nestedAttachment?.author_icon),alt:"avatar",size:"1.2em"}),(0,emotion_react_browser_esm.tZ)(Box_n,null,"@",nestedAttachment?.author_name))),(0,emotion_react_browser_esm.tZ)(Box_n,{css:TextAttachment_ref},nestedAttachment?.text?"["===nestedAttachment.text[0]?nestedAttachment.text.match(/\n(.*)/)?.[1]||"":nestedAttachment.text:""))))))};TextAttachment.displayName="TextAttachment",TextAttachment.__docgenInfo={description:"",methods:[],displayName:"TextAttachment",props:{variantStyles:{defaultValue:{value:"{}",computed:!1},required:!1},attachment:{description:"",type:{name:"object"},required:!1}}};const AttachmentHandler_TextAttachment=TextAttachment;TextAttachment.propTypes={attachment:prop_types_default().object};var Attachment_ref={name:"zjik7",styles:"display:flex"};const Attachment=({attachment,host,type,variantStyles={}})=>{const author={authorIcon:attachment?.author_icon,authorName:attachment?.author_name};return attachment&&attachment.audio_url?(0,emotion_react_browser_esm.tZ)(AttachmentHandler_AudioAttachment,{attachment,host,author,variantStyles}):attachment&&attachment.video_url?(0,emotion_react_browser_esm.tZ)(AttachmentHandler_VideoAttachment,{attachment,host,author,variantStyles}):attachment&&attachment.image_url?(0,emotion_react_browser_esm.tZ)(AttachmentHandler_ImageAttachment,{attachment,host,author,variantStyles}):attachment&&attachment.text?(0,emotion_react_browser_esm.tZ)(AttachmentHandler_TextAttachment,{attachment,type,author,variantStyles}):attachment.attachments&&Array.isArray(attachment.attachments)&&attachment.attachments[0]?.image_url?(0,emotion_react_browser_esm.tZ)(AttachmentHandler_ImageAttachment,{attachment:attachment.attachments[0],host,type:attachment.attachments[0].type,variantStyles,author}):attachment.attachments&&Array.isArray(attachment.attachments)&&attachment.attachments[0]?.audio_url?(0,emotion_react_browser_esm.tZ)(AttachmentHandler_AudioAttachment,{attachment:attachment.attachments[0],host,type:attachment.attachments[0].type,variantStyles,author}):attachment.attachments&&Array.isArray(attachment.attachments)&&attachment.attachments[0]?.video_url?(0,emotion_react_browser_esm.tZ)(AttachmentHandler_VideoAttachment,{attachment:attachment.attachments[0],host,type:attachment.attachments[0].type,variantStyles,author}):(0,emotion_react_browser_esm.tZ)(Box_n,{css:Attachment_ref},attachment?.description,(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"file",size:"20px"}),(0,emotion_react_browser_esm.tZ)("a",{href:`${host}${attachment.title_link}`},attachment.title))};Attachment.displayName="Attachment",Attachment.__docgenInfo={description:"",methods:[],displayName:"Attachment",props:{variantStyles:{defaultValue:{value:"{}",computed:!1},required:!1},attachment:{description:"",type:{name:"object"},required:!1},host:{description:"",type:{name:"string"},required:!1}}};const AttachmentHandler_Attachment=Attachment;Attachment.propTypes={attachment:prop_types_default().object,host:prop_types_default().string};const Attachments=({attachments,type,variantStyles={}})=>{const{RCInstance}=(0,react.useContext)(context_RCInstance);let host=RCInstance.getHost();return host=host.replace(/\/$/,""),attachments.map(((attachment,idx)=>(0,emotion_react_browser_esm.tZ)(AttachmentHandler_Attachment,{key:idx,attachment,host,variantStyles,type})))},AttachmentHandler_Attachments=Attachments;Attachments.propTypes={attachment:prop_types_default().object};const MarkupInteractionContext=(0,react.createContext)();const CodeBlockStyles={copyonly:{name:"i5db5e",styles:"display:none;width:100%;height:0;user-select:none;vertical-align:baseline;font-size:0;-moz-box-orient:vertical"},prestyle:{name:"hwx96c",styles:"display:inline-block;max-width:100%;overflow-x:auto;white-space:pre-wrap"}},ColorElementStyles_colorBox=(r,g,b,a)=>(0,emotion_react_browser_esm.iv)("background-color:rgba(",r,", ",g,", ",b,", ",a/255*100,"%);display:inline-block;width:1em;height:1em;vertical-align:middle;margin-inline-end:0.5em;",""),EmojiStyles={emojiInMessage:{name:"cqakrv",styles:"img.joypixels{height:1.5rem;width:1.5rem;image-rendering:pixelated;font-size:inherit;vertical-align:middle;}img.joypixels_BigEmoji{height:2.25rem;width:2.25rem;image-rendering:pixelated;font-size:inherit;}"},emojione:{name:"q4176v",styles:"margin:0 0.15em;vertical-align:middle;white-space:nowrap;font-size:inherit;line-height:normal"}},elements_styles=(contents,username)=>{const{theme}=useTheme_i();return{mention:(0,emotion_react_browser_esm.iv)("background-color:","all"===contents.value||"here"===contents.value?theme.colors.warning:contents.value===username?theme.colors.destructive:theme.colors.muted,";color:","all"===contents.value||"here"===contents.value?theme.colors.warningForeground:contents.value===username?theme.colors.destructiveForeground:theme.colors.mutedForeground,";font-weight:bold;cursor:pointer;padding:1.5px;border-radius:3px;","")}},CodeBlock=({lines})=>{const code=(0,react.useMemo)((()=>lines.map((line=>line.value.value)).join("\n")),[lines]);return(0,emotion_react_browser_esm.tZ)("pre",{role:"region",css:CodeBlockStyles.prestyle},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:CodeBlockStyles.copyonly},"```"),(0,emotion_react_browser_esm.tZ)("code",null,code),(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:CodeBlockStyles.copyonly},"```"))};CodeBlock.displayName="CodeBlock",CodeBlock.__docgenInfo={description:"",methods:[],displayName:"CodeBlock",props:{lines:{description:"",type:{name:"any"},required:!1}}};const elements_CodeBlock=CodeBlock;CodeBlock.propTypes={lines:prop_types_default().any};var joypixels=__webpack_require__("../../node_modules/emoji-toolkit/lib/js/joypixels.js"),joypixels_default=__webpack_require__.n(joypixels),purify=__webpack_require__("../../node_modules/dompurify/dist/purify.js"),purify_default=__webpack_require__.n(purify);const Emoji=({big=!1,emoji})=>{const fallback=(0,react.useMemo)((()=>"unicode"in emoji?emoji.unicode:`:${emoji.shortCode??emoji.value.value}:`),[emoji]),emojiHtml=big?joypixels_default().toImage(fallback).replace("joypixels","joypixels_BigEmoji"):joypixels_default().toImage(fallback);return(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:[EmojiStyles.emojione,EmojiStyles.emojiInMessage,"",""],dangerouslySetInnerHTML:{__html:purify_default().sanitize(emojiHtml)}})};Emoji.displayName="Emoji",Emoji.__docgenInfo={description:"",methods:[],displayName:"Emoji",props:{big:{defaultValue:{value:"false",computed:!1},description:"",type:{name:"bool"},required:!1},emoji:{description:"",type:{name:"any"},required:!1}}};const elements_Emoji=Emoji;Emoji.propTypes={emoji:prop_types_default().any,big:prop_types_default().bool};const BigEmoji=({contents})=>(0,emotion_react_browser_esm.tZ)(react.Fragment,null,contents.map(((content,index)=>(0,emotion_react_browser_esm.tZ)(elements_Emoji,{big:!0,key:index,emoji:content}))));BigEmoji.__docgenInfo={description:"",methods:[],displayName:"BigEmoji",props:{contents:{description:"",type:{name:"any"},required:!1}}};const elements_BigEmoji=BigEmoji;BigEmoji.propTypes={contents:prop_types_default().any};const PlainSpan=({contents})=>(0,emotion_react_browser_esm.tZ)(react.Fragment,null,contents);PlainSpan.__docgenInfo={description:"",methods:[],displayName:"PlainSpan",props:{contents:{description:"",type:{name:"string"},required:!1}}};const elements_PlainSpan=PlainSpan;PlainSpan.propTypes={contents:prop_types_default().string};const HeadingBlock=({contents,level=1})=>{const HeadingTag=`h${level}`;return(0,emotion_react_browser_esm.tZ)(HeadingTag,null,contents.map(((content,index)=>(0,emotion_react_browser_esm.tZ)(elements_PlainSpan,{key:index,contents:content.value}))))};HeadingBlock.displayName="HeadingBlock",HeadingBlock.__docgenInfo={description:"",methods:[],displayName:"HeadingBlock",props:{level:{defaultValue:{value:"1",computed:!1},description:"",type:{name:"number"},required:!1},contents:{description:"",type:{name:"arrayOf",value:{name:"object"}},required:!1}}};const blocks_HeadingBlock=HeadingBlock;HeadingBlock.propTypes={contents:prop_types_default().arrayOf(prop_types_default().object),level:prop_types_default().number};const StrikeSpan=({contents})=>(0,emotion_react_browser_esm.tZ)("del",null,contents.map(((content,index)=>{switch(content.type){case"PLAIN_TEXT":return(0,emotion_react_browser_esm.tZ)(elements_PlainSpan,{key:index,contents:content.value});case"ITALIC":return(0,emotion_react_browser_esm.tZ)(elements_ItalicSpan,{key:index,contents:content.value});case"BOLD":return(0,emotion_react_browser_esm.tZ)(elements_BoldSpan,{key:index,contents:content.value});default:return null}})));StrikeSpan.displayName="StrikeSpan",StrikeSpan.__docgenInfo={description:"",methods:[],displayName:"StrikeSpan",props:{contents:{description:"",type:{name:"any"},required:!1}}};const elements_StrikeSpan=StrikeSpan;StrikeSpan.propTypes={contents:prop_types_default().any};const isExternal=href=>0!==href.indexOf((()=>{if(document.baseURI)return document.baseURI;const base=document.getElementsByTagName("base");return base.length>0?base[0].href:document.URL})()),LinkSpan=({href,label})=>{const contents=react.useMemo((()=>(Array.isArray(label)?label:[label]).map(((content,index)=>{switch(content.type){case"PLAIN_TEXT":return(0,emotion_react_browser_esm.tZ)(elements_PlainSpan,{key:index,contents:content.value});case"STRIKE":return(0,emotion_react_browser_esm.tZ)(elements_StrikeSpan,{key:index,contents:content.value});case"ITALIC":return(0,emotion_react_browser_esm.tZ)(elements_ItalicSpan,{key:index,contents:content.value});case"BOLD":return(0,emotion_react_browser_esm.tZ)(elements_BoldSpan,{key:index,contents:content.value});default:return null}}))),[label]);return isExternal(href)?(0,emotion_react_browser_esm.tZ)("a",{href,title:href,rel:"noopener noreferrer",target:"_blank"},contents):(0,emotion_react_browser_esm.tZ)("a",{href,title:href},contents)};LinkSpan.displayName="LinkSpan",LinkSpan.__docgenInfo={description:"",methods:[],displayName:"LinkSpan",props:{href:{description:"",type:{name:"string"},required:!1},label:{description:"",type:{name:"array"},required:!1}}};const elements_LinkSpan=LinkSpan;LinkSpan.propTypes={href:prop_types_default().string,label:prop_types_default().array};const BoldSpan=({contents})=>(0,emotion_react_browser_esm.tZ)("strong",null,contents.map(((content,index)=>{switch(content.type){case"PLAIN_TEXT":return(0,emotion_react_browser_esm.tZ)(elements_PlainSpan,{key:index,contents:content.value});case"STRIKE":return(0,emotion_react_browser_esm.tZ)(elements_StrikeSpan,{key:index,contents:content.value});case"ITALIC":return(0,emotion_react_browser_esm.tZ)(elements_ItalicSpan,{key:index,contents:content.value});case"LINK":return(0,emotion_react_browser_esm.tZ)(elements_LinkSpan,{key:index,href:content.value.src.value,label:Array.isArray(content.value.label)?content.value.label:[content.value.label]});default:return null}})));BoldSpan.displayName="BoldSpan",BoldSpan.__docgenInfo={description:"",methods:[],displayName:"BoldSpan",props:{contents:{description:"",type:{name:"any"},required:!1}}};const elements_BoldSpan=BoldSpan;BoldSpan.propTypes={contents:prop_types_default().any};const ItalicSpan=({contents})=>(0,emotion_react_browser_esm.tZ)("em",null,contents.map(((content,index)=>{switch(content.type){case"PLAIN_TEXT":return(0,emotion_react_browser_esm.tZ)(elements_PlainSpan,{key:index,contents:content.value});case"STRIKE":return(0,emotion_react_browser_esm.tZ)(elements_StrikeSpan,{key:index,contents:content.value});case"BOLD":return(0,emotion_react_browser_esm.tZ)(elements_BoldSpan,{key:index,contents:content.value});default:return null}})));ItalicSpan.displayName="ItalicSpan",ItalicSpan.__docgenInfo={description:"",methods:[],displayName:"ItalicSpan",props:{contents:{description:"",type:{name:"any"},required:!1}}};const elements_ItalicSpan=ItalicSpan;ItalicSpan.propTypes={contents:prop_types_default().any};const CodeElement=({contents})=>(0,emotion_react_browser_esm.tZ)("code",null,(0,emotion_react_browser_esm.tZ)(elements_PlainSpan,{contents:contents.value}));CodeElement.displayName="CodeElement",CodeElement.__docgenInfo={description:"",methods:[],displayName:"CodeElement",props:{contents:{description:"",type:{name:"any"},required:!1}}};const elements_CodeElement=CodeElement;CodeElement.propTypes={contents:prop_types_default().any};const ChannelMention=({mention})=>(0,emotion_react_browser_esm.tZ)(react.Fragment,null,"#",mention);ChannelMention.__docgenInfo={description:"",methods:[],displayName:"ChannelMention",props:{mention:{description:"",type:{name:"string"},required:!1}}};const mentions_ChannelMention=ChannelMention;ChannelMention.propTypes={mention:prop_types_default().string};const ColorElement=({r,g,b,a})=>(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:ColorElementStyles_colorBox(r,g,b,a)}),"rgba(",r,", ",g,", ",b,", ",a/255*100,"%)");ColorElement.displayName="ColorElement",ColorElement.__docgenInfo={description:"",methods:[],displayName:"ColorElement",props:{r:{description:"",type:{name:"number"},required:!1},g:{description:"",type:{name:"number"},required:!1},b:{description:"",type:{name:"number"},required:!1},a:{description:"",type:{name:"number"},required:!1}}};const elements_ColorElement=ColorElement;ColorElement.propTypes={r:prop_types_default().number,g:prop_types_default().number,b:prop_types_default().number,a:prop_types_default().number};const UserMention=({contents})=>{const{members,username}=(0,react.useContext)(MarkupInteractionContext),{RCInstance}=(0,react.useContext)(context_RCInstance),setExclusiveState=hooks_useSetExclusiveState(),{setShowCurrentUserInfo,setCurrentUser}=userStore((state=>({setShowCurrentUserInfo:state.setShowCurrentUserInfo,setCurrentUser:state.setCurrentUser}))),styles=elements_styles(contents,username);return(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(user=>{if("all"===user||"here"===user)return!0;let found=!1;return Object.keys(members).forEach((ele=>{members[ele].username===user&&(found=!0)})),found})(contents.value)?(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:styles.mention,onClick:["here","all"].includes(contents.value)?null:()=>(async uname=>{const data=await RCInstance.userData(uname);setCurrentUser({_id:data.user._id,username:data.user.username,name:data.user.name}),setExclusiveState(setShowCurrentUserInfo)})(contents.value)},contents.value):`@${contents.value}`)};UserMention.propTypes={contents:prop_types_default().any.isRequired},UserMention.__docgenInfo={description:"",methods:[],displayName:"UserMention",props:{contents:{description:"",type:{name:"any"},required:!0}}};const mentions_UserMention=UserMention;function InlineElements_extends(){return InlineElements_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;icontents.map(((content,index)=>{switch(content.type){case"BOLD":return(0,emotion_react_browser_esm.tZ)(elements_BoldSpan,{key:index,contents:content.value});case"PLAIN_TEXT":return(0,emotion_react_browser_esm.tZ)(elements_PlainSpan,{key:index,contents:content.value});case"STRIKE":return(0,emotion_react_browser_esm.tZ)(elements_StrikeSpan,{key:index,contents:content.value});case"ITALIC":return(0,emotion_react_browser_esm.tZ)(elements_ItalicSpan,{key:index,contents:content.value});case"INLINE_CODE":return(0,emotion_react_browser_esm.tZ)(elements_CodeElement,{key:index,contents:content.value});case"MENTION_CHANNEL":return(0,emotion_react_browser_esm.tZ)(mentions_ChannelMention,{key:index,mention:content.value.value});case"MENTION_USER":return(0,emotion_react_browser_esm.tZ)(mentions_UserMention,{key:index,contents:content.value});case"EMOJI":return(0,emotion_react_browser_esm.tZ)(elements_Emoji,{key:index,emoji:content});case"COLOR":return(0,emotion_react_browser_esm.tZ)(elements_ColorElement,InlineElements_extends({key:index},content.value));case"LINK":return(0,emotion_react_browser_esm.tZ)(elements_LinkSpan,{key:index,href:content.value.src.value,label:Array.isArray(content.value.label)?content.value.label:[content.value.label]});default:return null}})),elements_InlineElements=InlineElements;InlineElements.propTypes={contents:prop_types_default().any};const OrderedListBlock=({items})=>(0,emotion_react_browser_esm.tZ)("ol",null,items.map(((item,index)=>(0,emotion_react_browser_esm.tZ)("li",{key:index,value:item.number},(0,emotion_react_browser_esm.tZ)(elements_InlineElements,{contents:item.value})))));OrderedListBlock.displayName="OrderedListBlock",OrderedListBlock.__docgenInfo={description:"",methods:[],displayName:"OrderedListBlock",props:{items:{description:"",type:{name:"arrayOf",value:{name:"custom",raw:"PropTypes.shape"}},required:!1}}};const blocks_OrderedListBlock=OrderedListBlock;OrderedListBlock.propTypes={items:prop_types_default().arrayOf(prop_types_default().shape)};var ParagraphBlock_ref={name:"ti75j2",styles:"margin:0"};const ParagraphBlock=({contents})=>(0,emotion_react_browser_esm.tZ)("p",{css:ParagraphBlock_ref},(0,emotion_react_browser_esm.tZ)(elements_InlineElements,{contents}));ParagraphBlock.displayName="ParagraphBlock",ParagraphBlock.__docgenInfo={description:"",methods:[],displayName:"ParagraphBlock",props:{contents:{description:"",type:{name:"any"},required:!1}}};const blocks_ParagraphBlock=ParagraphBlock;ParagraphBlock.propTypes={contents:prop_types_default().any};const UnOrderedListBlock=({items})=>(0,emotion_react_browser_esm.tZ)("ul",null,items.map(((item,index)=>(0,emotion_react_browser_esm.tZ)("li",{key:index},(0,emotion_react_browser_esm.tZ)(elements_InlineElements,{contents:item.value})))));UnOrderedListBlock.displayName="UnOrderedListBlock",UnOrderedListBlock.__docgenInfo={description:"",methods:[],displayName:"UnOrderedListBlock",props:{items:{description:"",type:{name:"arrayOf",value:{name:"custom",raw:"PropTypes.shape"}},required:!1}}};const blocks_UnOrderedListBlock=UnOrderedListBlock;UnOrderedListBlock.propTypes={items:prop_types_default().arrayOf(prop_types_default().shape)};const QuoteBlock=({contents})=>(0,emotion_react_browser_esm.tZ)("blockquote",null,contents.map(((paragraph,index)=>(0,emotion_react_browser_esm.tZ)(blocks_ParagraphBlock,{key:index,contents:paragraph.value}))));QuoteBlock.displayName="QuoteBlock",QuoteBlock.__docgenInfo={description:"",methods:[],displayName:"QuoteBlock",props:{contents:{description:"",type:{name:"arrayOf",value:{name:"custom",raw:"PropTypes.shape"}},required:!1}}};const blocks_QuoteBlock=QuoteBlock;QuoteBlock.propTypes={contents:prop_types_default().arrayOf(prop_types_default().shape)};const TaskListBlockStyles={li:{name:"pwjvve",styles:"display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;gap:0.5em"}};var TaskListBlock_ref={name:"12o1yl",styles:"align-self:baseline"};const TaskListBlock=({tasks})=>(0,emotion_react_browser_esm.tZ)("ul",{className:"task-list"},tasks.map(((item,index)=>(0,emotion_react_browser_esm.tZ)("li",{key:index,css:TaskListBlockStyles.li},(0,emotion_react_browser_esm.tZ)(CheckBox_p,{checked:item.status,css:TaskListBlock_ref}),(0,emotion_react_browser_esm.tZ)(elements_InlineElements,{contents:item.value})))));TaskListBlock.displayName="TaskListBlock",TaskListBlock.__docgenInfo={description:"",methods:[],displayName:"TaskListBlock",props:{tasks:{description:"",type:{name:"arrayOf",value:{name:"object"}},required:!1}}};const blocks_TaskListBlock=TaskListBlock;TaskListBlock.propTypes={tasks:prop_types_default().arrayOf(prop_types_default().object)};const Markup=({tokens})=>tokens.map(((token,index)=>{switch(token.type){case"PARAGRAPH":return(0,emotion_react_browser_esm.tZ)(blocks_ParagraphBlock,{key:index,contents:token.value});case"CODE":return(0,emotion_react_browser_esm.tZ)(elements_CodeBlock,{key:index,lines:token.value});case"BIG_EMOJI":return(0,emotion_react_browser_esm.tZ)(elements_BigEmoji,{key:index,contents:token.value});case"HEADING":return(0,emotion_react_browser_esm.tZ)(blocks_HeadingBlock,{key:index,contents:token.value,level:token.level});case"UNORDERED_LIST":return(0,emotion_react_browser_esm.tZ)(blocks_UnOrderedListBlock,{key:index,items:token.value});case"ORDERED_LIST":return(0,emotion_react_browser_esm.tZ)(blocks_OrderedListBlock,{key:index,items:token.value});case"TASKS":return(0,emotion_react_browser_esm.tZ)(blocks_TaskListBlock,{key:index,tasks:token.value});case"QUOTE":return(0,emotion_react_browser_esm.tZ)(blocks_QuoteBlock,{key:index,contents:token.value});case"LINE_BREAK":return(0,emotion_react_browser_esm.tZ)("br",{key:index});default:return null}})),src_Markup=Markup;Markup.propTypes={tokens:prop_types_default().arrayOf(prop_types_default().object)};var EmojiReaction_ref={name:"rkiwex",styles:"font-size:1rem"};const EmojiReaction=({body})=>{const emojiHtml=joypixels_default().toImage(body);return(0,emotion_react_browser_esm.tZ)(Box_n,{css:EmojiReaction_ref,dangerouslySetInnerHTML:{__html:purify_default().sanitize(emojiHtml)}})};EmojiReaction.displayName="EmojiReaction",EmojiReaction.propTypes={body:prop_types_default().string.isRequired},EmojiReaction.__docgenInfo={description:"",methods:[],displayName:"EmojiReaction",props:{body:{description:"",type:{name:"string"},required:!0}}};const EmojiReaction_EmojiReaction=EmojiReaction;var Markdown_ref={name:"rkiwex",styles:"font-size:1rem"};const Markdown=({body,isReaction=!1})=>{const members=memberStore((state=>state.members)),username=userStore((state=>state.username)),value=(0,react.useMemo)((()=>({members,username})),[members,username]);return isReaction?(0,emotion_react_browser_esm.tZ)(Box_n,{css:Markdown_ref},(0,emotion_react_browser_esm.tZ)(EmojiReaction_EmojiReaction,{body})):body&&body.md?(0,emotion_react_browser_esm.tZ)(Box_n,null,(0,emotion_react_browser_esm.tZ)(MarkupInteractionContext.Provider,{value},(0,emotion_react_browser_esm.tZ)(src_Markup,{tokens:body.md}))):(0,emotion_react_browser_esm.tZ)(react.Fragment,null)};Markdown.displayName="Markdown",Markdown.propTypes={body:prop_types_default().any,isReaction:prop_types_default().bool},Markdown.__docgenInfo={description:"",methods:[],displayName:"Markdown",props:{isReaction:{defaultValue:{value:"false",computed:!1},description:"",type:{name:"bool"},required:!1},body:{description:"",type:{name:"any"},required:!1}}};const Markdown_Markdown=Markdown,hooks_useDisplayNameColor=()=>{const{theme,mode}=useTheme_i();return username=>{const hash=(str=>{if(!str)return 0;let hash=0;for(let i=0;i{const{styleOverrides,classNames,variantOverrides}=useComponentOverrides_l("MessageHeader"),{ECOptions}=useRCContext(),displayNameVariant=variantOverrides||"normal",{theme}=useTheme_i(),styles=(theme=>({header:_ref6,name:_ref5,userName:(0,emotion_react_browser_esm.iv)("color:",theme.colors.accentForeground,";font-weight:700;letter-spacing:0rem;font-size:0.875rem;line-height:1.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:1;",""),userRole:(0,emotion_react_browser_esm.iv)("letter-spacing:0rem;font-size:0.75rem;padding:0 0.25rem;margin:0 0.1rem;border-radius:",theme.radius,";font-weight:700;line-height:1rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:",theme.colors.secondary,";",""),userActions:(0,emotion_react_browser_esm.iv)("color:",theme.colors.accentForeground,";letter-spacing:0rem;font-size:0.875rem;line-height:1.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:1;",""),timestamp:(0,emotion_react_browser_esm.iv)("color:",theme.colors.accentForeground,";overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:0rem;font-size:0.75rem;font-weight:400;line-height:1rem;flex-shrink:0;margin-left:0.25rem;","")}))(theme),getDisplayNameColor=hooks_useDisplayNameColor(),authenticatedUserId=userStore((state=>state.userId)),showUsername=ECOptions?.showUsername,showName=ECOptions?.showName,channelLevelRoles=memberStore((state=>state.memberRoles)),admins=memberStore((state=>state.admins)),isPinned=message.pinned,isStarred=message.starred&&message.starred.find((u=>u._id===authenticatedUserId)),setExclusiveState=hooks_useSetExclusiveState(),{setShowCurrentUserInfo,setCurrentUser}=userStore((state=>({setShowCurrentUserInfo:state.setShowCurrentUserInfo,setCurrentUser:state.setCurrentUser}))),handleUsernameClick=()=>{setExclusiveState(setShowCurrentUserInfo),setCurrentUser(message?.u)};return(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.header,className:appendClassNames_a("ec-message-header",classNames),style:styleOverrides},showDisplayName&&showName&&(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:[styles.name,"cursor:pointer;",""],className:appendClassNames_a("ec-message-header-name"),style:"colorize"===displayNameVariant?{color:getDisplayNameColor(message.u.username)}:null,onClick:handleUsernameClick},message.u?.name),showDisplayName&&showUsername&&(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:styles.userName,className:appendClassNames_a("ec-message-header-username"),style:"colorize"===displayNameVariant?{color:getDisplayNameColor(message.u.username)}:null,onClick:handleUsernameClick},"@",message.u.username),!message.t&&ECOptions?.showRoles&&isRoles&&(0,emotion_react_browser_esm.tZ)(react.Fragment,null,admins?.includes(message?.u?.username)&&(0,emotion_react_browser_esm.tZ)(Box_n,{as:"span",css:styles.userRole,className:appendClassNames_a("ec-message-user-role")},"admin"),channelLevelRoles[message.u.username]?.roles?.map(((role,index)=>(0,emotion_react_browser_esm.tZ)(Box_n,{key:index,as:"span",css:styles.userRole,className:appendClassNames_a("ec-message-user-role")},role)))),message.t&&(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:styles.userActions,className:appendClassNames_a("ec-message-header-useractions"),style:{marginLeft:"2px"}},(()=>{switch(message.t){case"ul":return"left the channel";case"uj":return"joined the channel";case"ru":return`removed @${message.message||message.msg}`;case"au":return`added @${message.message||message.msg}`;case"message_pinned":return"Pinned a message:";case"rm":return"message removed";case"subscription-role-added":return`set ${message?.msg} as ${message?.role}`;case"subscription-role-removed":return`removed ${message?.msg} as ${message?.role}`;case"room_changed_privacy":return`changed room to ${message?.msg}`;case"room-set-read-only":return"set room to read only";case"room-removed-read-only":return"removed read only permission";case"room-archived":return"archived room";case"room-unarchived":return"unarchived room";case"room-allowed-reacting":return"allowed reactions";default:return""}})()),isTimeStamped&&(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:styles.timestamp,className:appendClassNames_a("ec-message-header-timestamp")},(0,format.Z)(new Date(message.ts),"h:mm a")),!message.t&&(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.messageStatus},message.editedAt&&(0,emotion_react_browser_esm.tZ)(Icon_a,{style:{marginInlineEnd:"0.4rem",opacity:.5},name:"edit",size:"1em",color:theme.colors.primary}),isStarred?(0,emotion_react_browser_esm.tZ)(Tooltip_e,{text:"Starred",position:"top"},(0,emotion_react_browser_esm.tZ)(Icon_a,{style:{marginInlineEnd:"0.4rem",opacity:.5},name:"star-filled",size:"1em",color:theme.colors.primary})):null,isPinned?(0,emotion_react_browser_esm.tZ)(Tooltip_e,{text:"Pinned",position:"top"},(0,emotion_react_browser_esm.tZ)(Icon_a,{style:{marginInlineEnd:"0.4rem",opacity:.5},name:"pin",size:"1em",color:theme.colors.primary})):null))};MessageHeader.displayName="MessageHeader",MessageHeader.__docgenInfo={description:"",methods:[],displayName:"MessageHeader",props:{isTimeStamped:{defaultValue:{value:"true",computed:!1},required:!1},isRoles:{defaultValue:{value:"false",computed:!1},required:!1},showDisplayName:{defaultValue:{value:"true",computed:!1},required:!1},message:{description:"",type:{name:"any"},required:!1}}};const Message_MessageHeader=MessageHeader;function MessageBody_extends(){return MessageBody_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{const{styleOverrides,classNames}=useComponentOverrides_l("MessageBody",className,style),messageBodyStyles=(isText?variantStyles.messageBody:variantStyles.attachmentBody)||MessageBodyStyles.messageBody;return(0,emotion_react_browser_esm.tZ)(Box_n,MessageBody_extends({css:[messageBodyStyles,sequential&&variantStyles.sequential,lastSequential&&variantStyles.lastSequential,"",""],className:appendClassNames_a("ec-message-body",classNames),style:styleOverrides},props),children)};MessageBody.displayName="MessageBody",MessageBody.__docgenInfo={description:"",methods:[],displayName:"MessageBody",props:{className:{defaultValue:{value:"''",computed:!1},required:!1},variantStyles:{defaultValue:{value:"{}",computed:!1},required:!1},isText:{defaultValue:{value:"true",computed:!1},required:!1},sequential:{defaultValue:{value:"false",computed:!1},required:!1},lastSequential:{defaultValue:{value:"false",computed:!1},required:!1},style:{defaultValue:{value:"{}",computed:!1},required:!1}}};const isSameUser=(reaction,username)=>reaction.usernames.find((u=>u===username));function MessageReactions_extends(){return MessageReactions_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{},className="",style={},...props})=>{const{styleOverrides,classNames}=useComponentOverrides_l("MessageReactions",className,style),{theme}=useTheme_i(),styles=(theme=>({container:Message_styles_ref4,reaction:(0,emotion_react_browser_esm.iv)("letter-spacing:0rem;font-size:0.6rem;display:inline-flex;gap:0.125rem;align-items:center;justify-content:center;padding:0.1rem;margin:0.125rem;cursor:pointer;img.joypixels{height:0.75em;width:0.75em;}p{margin:0;}border:1px solid ",theme.colors.border,";border-radius:0.2rem;",""),reactionMine:(0,emotion_react_browser_esm.iv)("background:",theme.colors.secondary,";","")}))(theme);return(0,emotion_react_browser_esm.tZ)(Box_n,MessageReactions_extends({css:styles.container,className:appendClassNames_a("ec-message-reactions",classNames),style:styleOverrides},props),message.reactions&&(reactions=>{const arr=[];return Object.keys(reactions).forEach((emoji=>arr.push({name:emoji,count:reactions[emoji].usernames.length,usernames:reactions[emoji].usernames}))),arr})(message.reactions).map((reaction=>(0,emotion_react_browser_esm.tZ)(Box_n,{css:isSameUser(reaction,authenticatedUserUsername)?[styles.reaction,styles.reactionMine]:[styles.reaction],key:reaction.name,mine:isSameUser(reaction,authenticatedUserUsername),onClick:()=>handleEmojiClick(reaction,message,!isSameUser(reaction,authenticatedUserUsername))},(0,emotion_react_browser_esm.tZ)(Markdown_Markdown,{body:reaction.name,isReaction:!0}),(0,emotion_react_browser_esm.tZ)("p",null,reaction.count)))))};MessageReactions.displayName="MessageReactions",MessageReactions.__docgenInfo={description:"",methods:[],displayName:"MessageReactions",props:{handleEmojiClick:{defaultValue:{value:"() => {}",computed:!1},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1},style:{defaultValue:{value:"{}",computed:!1},required:!1}}};var formatDistance=__webpack_require__("../../node_modules/date-fns/esm/formatDistance/index.js");const BubbleThreadBtn=({message,handleOpenThread,styles={}})=>{const{theme}=useTheme_i();return(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"arc",size:"30",fill:"none",color:`${theme.colors.accent}`,css:styles.arcIcon}),(0,emotion_react_browser_esm.tZ)(Button_c,{size:"small",onClick:handleOpenThread(message),css:styles&&styles.threadReplyButton},message.tcount," Replies",(0,emotion_react_browser_esm.tZ)("span",{style:{margin:"0 0.25rem"}},(0,format.Z)(new Date(message.tlm),"hh:mm a"))))};BubbleThreadBtn.__docgenInfo={description:"",methods:[],displayName:"BubbleThreadBtn",props:{styles:{defaultValue:{value:"{}",computed:!1},required:!1}}};const BubbleVariant_BubbleThreadBtn=BubbleThreadBtn;function MessageMetrics_extends(){return MessageMetrics_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{},isReplyButton=!0,variantStyles={},...props})=>{const{styleOverrides,classNames}=useComponentOverrides_l("MessageMetrics",className,style);return(0,emotion_react_browser_esm.tZ)(Box_n,MessageMetrics_extends({css:variantStyles.metricsContainer||MessageMetricsStyles.metrics,className:appendClassNames_a("ec-message-metrics",classNames),style:styleOverrides},props),isReplyButton&&(variantStyles?.name?.includes("bubble")?(0,emotion_react_browser_esm.tZ)(BubbleVariant_BubbleThreadBtn,{message,handleOpenThread,styles:variantStyles}):(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Button_c,{size:"small",onClick:handleOpenThread(message),css:variantStyles&&variantStyles.threadReplyButton},"Reply"),(0,emotion_react_browser_esm.tZ)(Box_n,{css:MessageMetricsStyles.metricsItem(!0),title:"Replies"},(0,emotion_react_browser_esm.tZ)(Icon_a,{size:"1.25rem",name:"thread"}),(0,emotion_react_browser_esm.tZ)(Box_n,{css:MessageMetricsStyles.metricsItemLabel},message.tcount)),!!message.tcount&&(0,emotion_react_browser_esm.tZ)(Box_n,{css:MessageMetricsStyles.metricsItem,title:"Participants"},(0,emotion_react_browser_esm.tZ)(Icon_a,{size:"1.25rem",name:"user"}),(0,emotion_react_browser_esm.tZ)(Box_n,{css:MessageMetricsStyles.metricsItemLabel},message.replies.length)),(0,emotion_react_browser_esm.tZ)(Box_n,{css:MessageMetricsStyles.metricsItem,title:new Date(message.tlm).toLocaleString()},(0,emotion_react_browser_esm.tZ)(Icon_a,{size:"1.25rem",name:"clock"}),(0,emotion_react_browser_esm.tZ)(Box_n,{css:MessageMetricsStyles.metricsItemLabel},(0,formatDistance.Z)(new Date(message.tlm),new Date,{addSuffix:!0}))))))};MessageMetrics.displayName="MessageMetrics",MessageMetrics.__docgenInfo={description:"",methods:[],displayName:"MessageMetrics",props:{className:{defaultValue:{value:"''",computed:!1},required:!1},style:{defaultValue:{value:"{}",computed:!1},required:!1},handleOpenThread:{defaultValue:{value:"() => {}",computed:!1},required:!1},isReplyButton:{defaultValue:{value:"true",computed:!1},required:!1},variantStyles:{defaultValue:{value:"{}",computed:!1},required:!1}}};var emoji_picker_react_esm=__webpack_require__("../../node_modules/emoji-picker-react/dist/emoji-picker-react.esm.js");const EmojiPicker_styles=({theme,mode})=>{const calculatedColors="light"===mode?color_e(theme.colors.background,.03):color_r(theme.colors.background,1);return{emojiPicker:(0,emotion_react_browser_esm.iv)(".EmojiPickerReact{--epr-bg-color:",theme.colors.background,";--epr-text-color:",theme.colors.foreground,";--epr-picker-border-color:",theme.colors.border,";--epr-category-label-bg-color:",theme.colors.background,";--epr-category-icon-active-color:",theme.colors.secondary,";--epr-emoji-size:20px;--epr-category-navigation-button-size:20px;--epr-emoji-gap:10px;--epr-hover-bg-color:",calculatedColors,";--epr-highlight-color:",calculatedColors,";--epr-focus-bg-color:",calculatedColors,";--epr-horizontal-padding:10px;--epr-picker-border-radius:",theme.radius,";--epr-search-border-color:var(--epr-highlight-color);--epr-header-padding:15px var(--epr-horizontal-padding);--epr-active-skin-tone-indicator-border-color:var(\n --epr-highlight-color\n );--epr-active-skin-hover-color:var(--epr-hover-bg-color);--epr-search-input-bg-color-active:var(--epr-search-input-bg-color);--epr-search-input-padding:0 30px;--epr-search-input-border-radius:",theme.radius,";--epr-search-input-height:40px;--epr-search-input-text-color:var(--epr-text-color);--epr-search-input-placeholder-color:var(--epr-text-color);--epr-search-bar-inner-padding:var(--epr-horizontal-padding);--epr-emoji-variation-picker-height:45px;--epr-emoji-variation-picker-bg-color:var(--epr-bg-color);--epr-preview-height:70px;--epr-preview-text-size:14px;--epr-preview-text-padding:0 var(--epr-horizontal-padding);--epr-preview-border-color:var(--epr-picker-border-color);--epr-preview-text-color:var(--epr-text-color);--epr-category-padding:0 var(--epr-horizontal-padding);--epr-category-label-text-color:var(--epr-text-color);--epr-category-label-padding:0 var(--epr-horizontal-padding);--epr-category-label-height:40px;--epr-emoji-padding:5px;--epr-emoji-fullsize:calc(\n var(--epr-emoji-size) + var(--epr-emoji-padding) * 2\n );--epr-emoji-hover-color:var(--epr-hover-bg-color);--epr-emoji-variation-indicator-color:var(--epr-picker-border-color);--epr-emoji-variation-indicator-color-hover:var(--epr-text-color);--epr-header-overlay-z-index:3;--epr-emoji-variations-indictator-z-index:1;--epr-category-label-z-index:2;--epr-skin-variation-picker-z-index:5;--epr-preview-z-index:6;}.EmojiPickerReact li.epr-emoji-category>.epr-emoji-category-label{font-size:12px;}.EmojiPickerReact.epr-dark-theme{}.EmojiPickerReact .epr-body::-webkit-scrollbar,.EmojiPickerReact .epr-emoji-list::-webkit-scrollbar{width:4px;height:7.7px;}.EmojiPickerReact .epr-body::-webkit-scrollbar-thumb,.EmojiPickerReact .epr-emoji-list::-webkit-scrollbar-thumb{background:",color_o(theme.colors.primary,.5),";border-radius:4px;}.EmojiPickerReact .epr-body::-webkit-scrollbar-thumb:hover,.EmojiPickerReact .epr-emoji-list::-webkit-scrollbar-thumb:hover{background:",theme.colors.primary,";}","")}};var EmojiPicker_ref={name:"1lby940",styles:"position:absolute;top:0;right:0"};const CustomEmojiPicker=({handleEmojiClick,positionStyles=EmojiPicker_ref,wrapperId="emoji-popup",onClose=()=>{}})=>{const theme=useTheme_i(),styles=EmojiPicker_styles(theme);return(0,emotion_react_browser_esm.tZ)(Popup_i,{positionStyles,wrapperId,onClose,height:"auto",width:"auto"},(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.emojiPicker},(0,emotion_react_browser_esm.tZ)(emoji_picker_react_esm.ZP,{height:350,width:300,onEmojiClick:handleEmojiClick,previewConfig:{defaultEmoji:"1f60d",defaultCaption:"None",showPreview:!1},searchDisabled:!0,emojiStyle:"facebook",lazyLoadEmojis:!0})))};CustomEmojiPicker.displayName="CustomEmojiPicker",CustomEmojiPicker.__docgenInfo={description:"",methods:[],displayName:"CustomEmojiPicker",props:{positionStyles:{defaultValue:{value:"css`\n position: absolute;\n top: 0;\n right: 0;\n`",computed:!1},required:!1},wrapperId:{defaultValue:{value:"'emoji-popup'",computed:!1},required:!1},onClose:{defaultValue:{value:"() => {}",computed:!1},required:!1},handleEmojiClick:{description:"",type:{name:"func"},required:!1}}};const EmojiPicker=CustomEmojiPicker;CustomEmojiPicker.propTypes={handleEmojiClick:prop_types_default().func};const SurfaceItem=({item,size})=>(0,emotion_react_browser_esm.tZ)(Tooltip_e,{text:item.label,position:"bottom",key:item.id},(0,emotion_react_browser_esm.tZ)(ActionButton_l,{square:!0,ghost:!0,onClick:item.onClick,icon:item.iconName,size,iconSize:"small",color:item.type}));SurfaceItem.displayName="SurfaceItem",SurfaceItem.__docgenInfo={description:"",methods:[],displayName:"SurfaceItem"};const SurfaceMenu_SurfaceItem=SurfaceItem,SurfaceMenu=({options,size="medium"})=>(0,emotion_react_browser_esm.tZ)(react.Fragment,null,options?.map(((item,idx)=>(0,emotion_react_browser_esm.tZ)(SurfaceMenu_SurfaceItem,{item,size,key:idx}))));SurfaceMenu.__docgenInfo={description:"",methods:[],displayName:"SurfaceMenu",props:{size:{defaultValue:{value:"'medium'",computed:!1},required:!1}}};const SurfaceMenu_SurfaceMenu=SurfaceMenu;function MessageToolbox_extends(){return MessageToolbox_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{const{styleOverrides,classNames,configOverrides}=useComponentOverrides_l("MessageToolbox",className,style),{theme}=useTheme_i(),styles=(theme=>({toolboxContainer:Message_styles_ref3,toolbox:(0,emotion_react_browser_esm.iv)("display:flex;margin-left:-0.25rem;margin-right:-0.25rem;margin-top:0.125rem;background-color:",theme.colors.background,";box-shadow:0 0 2px ",theme.colors.foreground,";gap:0.25rem;padding:0.25rem;border-radius:",theme.radius,";",""),emojiPickerStyles:Message_styles_ref2}))(theme),surfaceItems=configOverrides.optionConfig?.surfaceItems||optionConfig.surfaceItems,menuItems=configOverrides.optionConfig?.menuItems||optionConfig.menuItems,[isEmojiOpen,setEmojiOpen]=(0,react.useState)(!1),[showDeleteModal,setShowDeleteModal]=(0,react.useState)(!1),handleOnClose=()=>{setShowDeleteModal(!1)},isAllowedToPin=userRoles.some((role=>pinRoles.has(role))),isAllowedToEditMessage=!!userRoles.some((role=>editMessageRoles.has(role)))||message.u._id===authenticatedUserId,options=(0,react.useMemo)((()=>({reply:{label:"Reply in thread",id:"reply",onClick:handleOpenThread(message),iconName:"thread",visible:!isThreadMessage},quote:{label:"Quote",id:"quote",onClick:()=>handleQuoteMessage(message),iconName:"quote",visible:!0},star:{label:message.starred&&message.starred.find((u=>u._id===authenticatedUserId))?"Unstar":"Star",id:"star",onClick:()=>handleStarMessage(message),iconName:message.starred&&message.starred.find((u=>u._id===authenticatedUserId))?"star-filled":"star",visible:!0},reaction:{label:"Add reaction",id:"reaction",onClick:()=>setEmojiOpen(!0),iconName:"emoji",visible:!0},pin:{label:message.pinned?"Unpin":"Pin",id:"pin",onClick:()=>handlePinMessage(message),iconName:message.pinned?"pin-filled":"pin",visible:!isThreadMessage&&isAllowedToPin},edit:{label:"Edit",id:"edit",onClick:()=>handleEditMessage(message),iconName:"edit",visible:isAllowedToEditMessage,color:isEditing?"secondary":"default",ghost:!isEditing},copy:{label:"Copy message",id:"copy",onClick:()=>handleCopyMessage(message),iconName:"copy",visible:!0},link:{label:"Copy link",id:"link",onClick:()=>handleCopyMessageLink(message),iconName:"link",visible:!0},delete:{label:"Delete",id:"delete",onClick:()=>setShowDeleteModal(!0),iconName:"trash",visible:message.u._id===authenticatedUserId,type:"destructive"},report:{label:"Report",id:"report",onClick:()=>handlerReportMessage(message),iconName:"report",visible:!0,type:"destructive"}})),[handleOpenThread,message,isThreadMessage,authenticatedUserId,isEditing,handleQuoteMessage,handleStarMessage,handlePinMessage,handleEditMessage,handlerReportMessage,handleCopyMessage,isAllowedToPin]),menuOptions=menuItems?.map((item=>item in options&&options[item].visible?{id:options[item].id,action:options[item].onClick,label:options[item].label,icon:options[item].iconName}:null)).filter((option=>null!==option)),surfaceOptions=surfaceItems?.map((item=>item in options&&options[item].visible?{id:options[item].id,onClick:options[item].onClick,label:options[item].label,iconName:options[item].iconName,type:options[item].type}:null)).filter((option=>null!==option));return(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Box_n,{css:variantStyles.toolboxContainer||styles.toolboxContainer},(0,emotion_react_browser_esm.tZ)(Box_n,MessageToolbox_extends({css:styles.toolbox,className:appendClassNames_a("ec-message-toolbox",classNames),style:styleOverrides},props),surfaceOptions?.length>0&&(0,emotion_react_browser_esm.tZ)(SurfaceMenu_SurfaceMenu,{options:surfaceOptions,size:"small"}),menuOptions?.length>0&&(0,emotion_react_browser_esm.tZ)(Menu_o,{size:"small",options:menuOptions,tooltip:{isToolTip:!0,position:"top",text:"More"},useWrapper:!1,style:{top:"auto",bottom:"calc(100% + 2px)"}}),isEmojiOpen&&(0,emotion_react_browser_esm.tZ)(EmojiPicker,{handleEmojiClick:emoji=>{setEmojiOpen(!1),handleEmojiClick(emoji,message,!0)},onClose:()=>setEmojiOpen(!1),positionStyles:variantStyles.emojiPickerStyles||styles.emojiPickerStyles,wrapperId:`ec-message-body-${message._id}`}))),showDeleteModal&&(0,emotion_react_browser_esm.tZ)(v,{onClose:handleOnClose},(0,emotion_react_browser_esm.tZ)(v.Header,null,(0,emotion_react_browser_esm.tZ)(v.Title,null,(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"trash",size:"1.25rem",style:{marginRight:"0.5rem"}})," ","Delete this message?"),(0,emotion_react_browser_esm.tZ)(v.Close,{onClick:handleOnClose})),(0,emotion_react_browser_esm.tZ)(v.Content,{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0 0.5rem 0.5rem"}},(0,emotion_react_browser_esm.tZ)(Markdown_Markdown,{body:message,isReaction:!1})),(0,emotion_react_browser_esm.tZ)(v.Footer,null,(0,emotion_react_browser_esm.tZ)(Button_c,{type:"secondary",onClick:handleOnClose},"Cancel"),(0,emotion_react_browser_esm.tZ)(Button_c,{type:"destructive",onClick:()=>{handleDeleteMessage(message),handleOnClose()}},"Delete message"))))};MessageToolbox.__docgenInfo={description:"",methods:[],displayName:"MessageToolbox",props:{className:{defaultValue:{value:"''",computed:!1},required:!1},variantStyles:{defaultValue:{value:"{}",computed:!1},required:!1},style:{defaultValue:{value:"{}",computed:!1},required:!1},isThreadMessage:{defaultValue:{value:"false",computed:!1},required:!1},isEditing:{defaultValue:{value:"false",computed:!1},required:!1},optionConfig:{defaultValue:{value:"{\n surfaceItems: [\n 'reaction',\n 'reply',\n 'quote',\n 'star',\n 'copy',\n 'link',\n 'pin',\n 'edit',\n 'delete',\n 'report',\n ],\n\n menuItems: [],\n}",computed:!1},required:!1}}};const MessageAvatarContainer=({message,sequential,isStarred,isPinned})=>{const{RCInstance}=(0,react.useContext)(context_RCInstance),{theme}=useTheme_i(),styles=(theme=>({container:(0,emotion_react_browser_esm.iv)("margin:3px;width:2.25em;max-height:2.25em;display:flex;justify-content:flex-end;color:",theme.colors.primary,";","")}))(theme),setExclusiveState=hooks_useSetExclusiveState(),{setShowCurrentUserInfo,setCurrentUser}=userStore((state=>({setShowCurrentUserInfo:state.setShowCurrentUserInfo,setCurrentUser:state.setCurrentUser})));return(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.container},sequential?null:(0,emotion_react_browser_esm.tZ)(Avatar_p,{url:(username=message.u.username,`${RCInstance.getHost()}/avatar/${username}`),alt:"avatar",size:message.t?"1.2em":"2.25em",onClick:()=>{setExclusiveState(setShowCurrentUserInfo),setCurrentUser(message?.u)}}),isStarred&&sequential?(0,emotion_react_browser_esm.tZ)(Tooltip_e,{text:"Starred",position:"top"},(0,emotion_react_browser_esm.tZ)(Icon_a,{style:{opacity:.5},name:"star-filled",size:"1.2em"})):null,isPinned&&sequential?(0,emotion_react_browser_esm.tZ)(Tooltip_e,{text:"Pinned",position:"top"},(0,emotion_react_browser_esm.tZ)(Icon_a,{style:{opacity:.5},name:"pin",size:"1.2em"})):null);var username};MessageAvatarContainer.displayName="MessageAvatarContainer",MessageAvatarContainer.__docgenInfo={description:"",methods:[],displayName:"MessageAvatarContainer"};const Message_MessageAvatarContainer=MessageAvatarContainer,MessageBodyContainer=({children,className="",variantStyles={},style={}})=>{const{classNames,styleOverrides}=useComponentOverrides_l("MessageBodyContainer",className,style),{theme}=useTheme_i(),styles={bodyContainer:Message_styles_ref};return(0,emotion_react_browser_esm.tZ)(Box_n,{css:variantStyles.messageBodyContainer||styles.bodyContainer,className:appendClassNames_a("ec-message-body-container",classNames),style:styleOverrides},children)};MessageBodyContainer.displayName="MessageBodyContainer",MessageBodyContainer.__docgenInfo={description:"",methods:[],displayName:"MessageBodyContainer",props:{className:{defaultValue:{value:"''",computed:!1},required:!1},variantStyles:{defaultValue:{value:"{}",computed:!1},required:!1},style:{defaultValue:{value:"{}",computed:!1},required:!1}}};const Message_MessageBodyContainer=MessageBodyContainer;var LinkPreview_styles_ref={name:"eev240",styles:"text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin-block-start:0rem;margin-block-end:0rem"},LinkPreview_styles_ref2={name:"k7chvl",styles:"cursor:pointer;display:flex;align-items:center"};const LinkPreview_styles=theme=>({arrowDropDown:LinkPreview_styles_ref2,linkPreviewContainer:(0,emotion_react_browser_esm.iv)("max-width:16rem;border:1px solid ",theme.colors.border,";border-radius:",theme.radius,";margin-bottom:0.75rem;overflow:hidden;",""),textStyle:LinkPreview_styles_ref});function LinkPreview_extends(){return LinkPreview_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{const{classNames,styleOverrides}=useComponentOverrides_l("LinkPreview"),{theme}=useTheme_i(),styles=LinkPreview_styles(theme),[isPreviewOpen,setIsPreviewOpen]=(0,react.useState)(!0);if(!meta||"object"==typeof meta&&0===Object.keys(meta).length)return null;const isDescription=meta.oembedAuthorName||meta.ogDescription||meta.description,isTitle=meta.pageTitle||meta.ogTitle||meta.oembedTitle,isThumbnail=meta.oembedThumbnailUrl||meta.ogImage,isSiteName=meta.ogSiteName||meta.oembedProviderName;return(0,emotion_react_browser_esm.tZ)(react.Fragment,null,showDropdown&&(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.arrowDropDown},"Link Preview",(0,emotion_react_browser_esm.tZ)(ActionButton_l,{onClick:()=>{setIsPreviewOpen((prev=>!prev))},ghost:!0,display:"inline",square:!0,size:"small"},isPreviewOpen?(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"chevron-left",size:"1.25rem"}):(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"chevron-down",size:"1.25rem"}))),isPreviewOpen&&(0,emotion_react_browser_esm.tZ)(Box_n,LinkPreview_extends({css:[styles.linkPreviewContainer,"",""],className:`ec-linkpreview ${className} ${classNames}`,style:{...styleOverrides,...style}},props),isThumbnail&&(0,emotion_react_browser_esm.tZ)(Box_n,{style:{overflow:"hidden"}},(0,emotion_react_browser_esm.tZ)("a",{href:url,target:"_blank",rel:"noopener noreferrer"},(0,emotion_react_browser_esm.tZ)("img",{src:isThumbnail.startsWith("/")?`${url}${isThumbnail}`:isThumbnail,alt:meta.ogImageAlt,style:{width:"100%",height:"auto"}}))),(0,emotion_react_browser_esm.tZ)(Box_n,{style:{padding:"8px"}},(0,emotion_react_browser_esm.tZ)("a",{href:url,css:(0,emotion_react_browser_esm.iv)("color:",theme.colors.foreground,";",""),target:"_blank",rel:"noopener noreferrer"},isTitle&&(0,emotion_react_browser_esm.tZ)("p",{css:styles.textStyle},isTitle)),isDescription&&(0,emotion_react_browser_esm.tZ)("p",{css:styles.textStyle},isDescription),isSiteName&&(0,emotion_react_browser_esm.tZ)("a",{href:url,css:(0,emotion_react_browser_esm.iv)("color:",theme.colors.foreground,";",""),target:"_blank",rel:"noopener noreferrer"},isSiteName))))};LinkPreview.propTypes={className:prop_types_default().string,style:prop_types_default().object,color:prop_types_default().string,url:prop_types_default().string,meta:prop_types_default().object},LinkPreview.__docgenInfo={description:"",methods:[],displayName:"LinkPreview",props:{className:{defaultValue:{value:"''",computed:!1},description:"",type:{name:"string"},required:!1},style:{defaultValue:{value:"{}",computed:!1},description:"",type:{name:"object"},required:!1},showDropdown:{defaultValue:{value:"true",computed:!1},required:!1},color:{description:"",type:{name:"string"},required:!1},url:{description:"",type:{name:"string"},required:!1},meta:{description:"",type:{name:"object"},required:!1}}};const LinkPreview_LinkPreview=LinkPreview;var _ref9={name:"1o0tqmd",styles:"position:absolute;bottom:100%;left:calc(100% + 5px)"},_ref10={name:"7a8vm1",styles:"padding:2.5% 0 0"},_ref11={name:"xyzkeb",styles:"align-self:flex-start"},_ref12={name:"qhxz92",styles:"max-width:100%"},_ref13={name:"1mmgi17",styles:"display:none;.ec-message-body:hover &{display:flex;position:absolute;bottom:calc(100% - 20px);left:calc(100% - 20px);z-index:1101;}"},_ref14={name:"179q9ic",styles:"transform:none"},_ref15={name:"ypiz0r",styles:"display:flex;margin:0.25rem"},_ref16={name:"1yaoksn",styles:"display:flex;flex:1;align-items:flex-start;flex-direction:column"};var Bubble_styles_ref={name:"khu1rb",styles:"left:auto;right:calc(100% + 5px)"},Bubble_styles_ref2={name:"1duj7gx",styles:"align-self:flex-end"},Bubble_styles_ref3={name:"1tfjhq3",styles:"border-inline-start:none;border-inline-end:none"},Bubble_styles_ref4={name:"5z43n",styles:".ec-message-body:hover &{left:auto;right:calc(100% - 20px);}"},Bubble_styles_ref5={name:"13fmgtn",styles:"transform:scaleX(-1)"},Bubble_styles_ref6={name:"2b8jyz",styles:"flex-direction:row-reverse"},Bubble_styles_ref7={name:"1kx2ysr",styles:"align-items:flex-end"},Bubble_styles_ref8={name:"2b8jyz",styles:"flex-direction:row-reverse"};const BubbleVariant_useBubbleStyles=(isMe=!1)=>{const{theme}=useTheme_i(),styles=(theme=>({name:"bubble",messageParent:(0,emotion_react_browser_esm.iv)("display:flex;gap:0.25rem;flex-direction:row;align-items:flex-start;padding:0 2.25rem 0.25rem 2.25rem;a{color:",theme.colors.primaryForeground,";}",""),messageBodyContainer:_ref16,messageBody:(0,emotion_react_browser_esm.iv)("position:relative;letter-spacing:0rem;font-size:0.875rem;font-weight:400;line-height:1.25rem;transition:opacity 0.3s linear;word-break:break-word;opacity:1;margin-top:0.125rem;margin-bottom:0.125rem;width:fit-content;max-width:80%;padding:0.5rem 0.75rem;border-radius:",theme.radius," ",theme.radius," ",theme.radius," 0.2rem;background:",theme.colors.primary,";color:",theme.colors.primaryForeground,";&:hover{background:",color_o(theme.colors.primary,.8),";}",""),attachmentBody:(0,emotion_react_browser_esm.iv)("position:relative;width:fit-content;max-width:80%;border-radius:",theme.radius," ",theme.radius," ",theme.radius," 0.2rem;",""),sequential:(0,emotion_react_browser_esm.iv)("border-radius:0.2rem ",theme.radius," ",theme.radius," 0.2rem;",""),lastSequential:(0,emotion_react_browser_esm.iv)("border-radius:0.2rem ",theme.radius," ",theme.radius,";",""),metricsContainer:_ref15,threadReplyButton:(0,emotion_react_browser_esm.iv)("background-color:",theme.colors.accent,";color:",theme.colors.accentForeground,";border-radius:0.2rem;",""),arcIcon:_ref14,toolboxContainer:_ref13,videoAttachmentContainer:(0,emotion_react_browser_esm.iv)("border:1px solid ",theme.colors.border,";border-radius:inherit;",""),imageAttachmentContainer:(0,emotion_react_browser_esm.iv)("border:1px solid ",theme.colors.border,";border-radius:inherit;overflow:hidden;",""),pinnedContainer:_ref12,quoteContainer:(0,emotion_react_browser_esm.iv)("background-color:",theme.colors.background,";color:",theme.colors.foreground,";flex:1;border-bottom-right-radius:inherit;border-bottom-left-radius:inherit;border:2px solid ",theme.colors.border,";margin:0.2rem -0.75rem -0.5rem;",""),textUserInfo:_ref11,attachmentMetaContainer:_ref10,emojiPickerStyles:_ref9}))(theme),meStyles=(theme=>({messageParentMe:Bubble_styles_ref8,messageBodyContainerMe:Bubble_styles_ref7,messageBodyMe:(0,emotion_react_browser_esm.iv)("background:",theme.colors.secondary,";color:",theme.colors.secondaryForeground,";border-radius:",theme.radius," ",theme.radius," 0.2rem ",theme.radius,";&:hover{background:",color_o(theme.colors.secondary,.8),";}",""),attachmentBodyMe:(0,emotion_react_browser_esm.iv)("border-radius:",theme.radius," ",theme.radius," 0.2rem ",theme.radius,";",""),lastSequentialMe:(0,emotion_react_browser_esm.iv)("border-radius:",theme.radius," 0.2rem ",theme.radius," ",theme.radius,";",""),sequentialMe:(0,emotion_react_browser_esm.iv)("border-radius:",theme.radius," 0.2rem 0.2rem ",theme.radius,";",""),metricsContainerMe:Bubble_styles_ref6,arcIconMe:Bubble_styles_ref5,toolboxContainerMe:Bubble_styles_ref4,pinnedContainerMe:Bubble_styles_ref3,textUserInfoMe:Bubble_styles_ref2,emojiPickerStylesMe:Bubble_styles_ref}))(theme),mergedStyles={};return Object.keys(styles).forEach((key=>{mergedStyles[key]=[styles[key],isMe&&meStyles[`${key}Me`]].filter(Boolean)})),mergedStyles};var _virtual_rollupPluginBabelHelpers=__webpack_require__("../ui-kit/dist/esm/_virtual/_rollupPluginBabelHelpers.js"),index_module=__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/fuselage-hooks/dist/index.module.js"),BlockElementType=(__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/ui-kit/dist/esm/blocks/LayoutBlockType.js"),__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/ui-kit/dist/esm/blocks/BlockElementType.js")),TextObjectType=__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/ui-kit/dist/esm/blocks/TextObjectType.js"),BlockContext=__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/ui-kit/dist/esm/rendering/BlockContext.js"),SurfaceRenderer=(__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/ui-kit/dist/esm/blocks/ButtonStyle.js"),__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/ui-kit/dist/esm/rendering/ConditionalBlockFiltersEngine.js"),__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/ui-kit/dist/esm/blocks/ElementType.js"),__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/ui-kit/dist/esm/rendering/surfaces/UiKitParserAttachment.js"),__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/ui-kit/dist/esm/rendering/surfaces/UiKitParserBanner.js"),__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/ui-kit/dist/esm/rendering/surfaces/UiKitParserMessage.js"),__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/ui-kit/dist/esm/rendering/surfaces/UiKitParserModal.js"),__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/ui-kit/dist/esm/rendering/surfaces/UiKitParserContextualBar.js"),__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/ui-kit/dist/esm/rendering/SurfaceRenderer.js")),UiKitContext_a=(0,react.createContext)({action:function(){},updateState:function(){},appId:"core",values:{}}),getInitialValue_i=function(i){return function(i){return"initialValue"in i}(i)&&i.initialValue||function(i){return"initialTime"in i}(i)&&i.initialTime||function(i){return"initialDate"in i}(i)&&i.initialDate||function(i){return"initialOption"in i}(i)&&i.initialOption.value||function(i){return"initialOptions"in i}(i)&&i.initialOptions.map((function(i){return i.value}))||void 0},useUiKitState_p=function(p,m){var k=p.blockId,f=p.actionId,v=p.appId,h=p.dispatchActionConfig,I=(0,react.useContext)(UiKitContext_a),g=I.action,_=I.appId,y=void 0===_?"core":_,j=I.viewId,x=I.updateState,A=I.values,b=I.errors,C=getInitialValue_i(p),w=function(e,t,r){var i,n;return null!==(i=t&&((null===(n=t[e])||void 0===n?void 0:n.value)||r))&&void 0!==i?i:r}(f,A,C),T=null==b?void 0:b[f],B=(0,index_module.P)((0,react.useState)(w)),K=(0,_virtual_rollupPluginBabelHelpers.ZQ)(B,2),P=K[0],U=K[1],S=(0,index_module.P)((0,react.useState)(!1)),E=(0,_virtual_rollupPluginBabelHelpers.ZQ)(S,2),O=E[0],L=E[1],M=(0,react.useCallback)(function(){var e=(0,_virtual_rollupPluginBabelHelpers.x)((0,_virtual_rollupPluginBabelHelpers.l5)().mark((function e(t){var n,o;return(0,_virtual_rollupPluginBabelHelpers.l5)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.target.value,L(!0),Array.isArray(P)?(o=P.findIndex((function(e){return e===n})),U(o>-1?P.filter((function(e,t){return t!==o})):[].concat((0,_virtual_rollupPluginBabelHelpers.u)(P),[n]))):U(n),e.next=5,null==x?void 0:x({blockId:k,appId:v,actionId:f,value:n,viewId:j},t);case 5:return e.next=7,g({blockId:k,appId:v||y,actionId:f,value:n,viewId:j},t);case 7:L(!1);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[P,U,L,x,g,k,v,f,j,y]),N=(0,react.useCallback)(function(){var e=(0,_virtual_rollupPluginBabelHelpers.x)((0,_virtual_rollupPluginBabelHelpers.l5)().mark((function e(t){var i;return(0,_virtual_rollupPluginBabelHelpers.l5)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.target.value,U(i),e.t0=x,!e.t0){e.next=6;break}return e.next=6,x({blockId:k,appId:v,actionId:f,value:i,viewId:j},t);case 6:return e.next=8,g({blockId:k,appId:v||y,actionId:f,value:i,viewId:j,dispatchActionConfig:h},t);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[U,x,g,k,v,f,j,h,y]),R=(0,react.useCallback)(function(){var e=(0,_virtual_rollupPluginBabelHelpers.x)((0,_virtual_rollupPluginBabelHelpers.l5)().mark((function e(t){var i;return(0,_virtual_rollupPluginBabelHelpers.l5)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.target.value,U(i),e.next=4,null==x?void 0:x({blockId:k,appId:v||y,actionId:f,value:i,viewId:j},t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[U,x,k,v,f,j,y]),F=(0,react.useMemo)((function(){return{loading:O,setLoading:L,error:T,value:P}}),[O,L,T,P]);return"plain_text_input"===p.type&&Array.isArray(p.dispatchActionConfig)&&p.dispatchActionConfig.includes("on_character_entered")?[F,N]:m&&[BlockContext.Q.SECTION,BlockContext.Q.ACTION].includes(m)||Array.isArray(p.dispatchActionConfig)&&p.dispatchActionConfig.includes("on_item_selected")?[F,M]:[F,R]},SurfaceContext_e=(0,react.createContext)("message"),Surface_e=function(e){var o=e.children,i=e.type;return(0,emotion_react_browser_esm.tZ)(SurfaceContext_e.Provider,{value:i},o)},ModalSurface_a={name:"1ov017s",styles:"margin-block:1rem;display:flex;flex-direction:column;gap:1rem"},createSurfaceRenderer_t=function(t,o){return function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,emotion_react_browser_esm.tZ)(t,null,o.render(n,(0,_virtual_rollupPluginBabelHelpers.Zj)({engine:"rocket.chat"},i)))}},MarkupInteractionContext_o=(__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/message-parser/messageParser.js"),(0,react.createContext)()),esm_node_modules_prop_types=__webpack_require__("../markups/dist/esm/node_modules/prop-types/index.js");var elements_styles_c={copyonly:{name:"i5db5e",styles:"display:none;width:100%;height:0;user-select:none;vertical-align:baseline;font-size:0;-moz-box-orient:vertical"},prestyle:{name:"hwx96c",styles:"display:inline-block;max-width:100%;overflow-x:auto;white-space:pre-wrap"}},elements_styles_l_colorBox=function(I,b,c,l){return(0,emotion_react_browser_esm.iv)("background-color:rgba(",I,", ",b,", ",c,", ",l/255*100,"%);display:inline-block;width:1em;height:1em;vertical-align:middle;margin-inline-end:0.5em;","","","")},elements_styles_G={emojiInMessage:{name:"cqakrv",styles:"img.joypixels{height:1.5rem;width:1.5rem;image-rendering:pixelated;font-size:inherit;vertical-align:middle;}img.joypixels_BigEmoji{height:2.25rem;width:2.25rem;image-rendering:pixelated;font-size:inherit;}"},emojione:{name:"q4176v",styles:"margin:0 0.15em;vertical-align:middle;white-space:nowrap;font-size:inherit;line-height:normal"}},CodeBlock_t=function(o){var t=o.lines,p=(0,react.useMemo)((function(){return t.map((function(e){return e.value.value})).join("\n")}),[t]);return(0,emotion_react_browser_esm.tZ)("pre",{role:"region",css:elements_styles_c.prestyle},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:elements_styles_c.copyonly},"```"),(0,emotion_react_browser_esm.tZ)("code",null,p),(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:elements_styles_c.copyonly},"```"))};CodeBlock_t.propTypes={lines:esm_node_modules_prop_types.Z.any};var js_joypixels=__webpack_require__("../markups/dist/esm/node_modules/emoji-toolkit/lib/js/joypixels.js"),dist_purify=__webpack_require__("../markups/dist/esm/node_modules/dompurify/dist/purify.js"),elements_Emoji_t=function(e){var t=e.big,c=void 0!==t&&t,p=e.emoji,W=(0,react.useMemo)((function(){var b;return"unicode"in p?p.unicode:":".concat(null!==(b=p.shortCode)&&void 0!==b?b:p.value.value,":")}),[p]),a=c?js_joypixels.Z.toImage(W).replace("joypixels","joypixels_BigEmoji"):js_joypixels.Z.toImage(W);return(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:[elements_styles_G.emojione,elements_styles_G.emojiInMessage,"",""],dangerouslySetInnerHTML:{__html:dist_purify.Z.sanitize(a)}})};elements_Emoji_t.propTypes={emoji:esm_node_modules_prop_types.Z.any,big:esm_node_modules_prop_types.Z.bool};var BigEmoji_n=function(r){var n=r.contents;return(0,emotion_react_browser_esm.tZ)(react.Fragment,null,n.map((function(o,r){return(0,emotion_react_browser_esm.tZ)(elements_Emoji_t,{big:!0,key:r,emoji:o})})))};BigEmoji_n.propTypes={contents:esm_node_modules_prop_types.Z.any};var PlainSpan_e=function(t){var e=t.contents;return(0,emotion_react_browser_esm.tZ)(react.Fragment,null,e)};PlainSpan_e.propTypes={contents:esm_node_modules_prop_types.Z.string};var HeadingBlock_n=function(e){var n=e.contents,r=e.level,a="h".concat(void 0===r?1:r);return(0,emotion_react_browser_esm.tZ)(a,null,n.map((function(e,n){return(0,emotion_react_browser_esm.tZ)(PlainSpan_e,{key:n,contents:e.value})})))};HeadingBlock_n.propTypes={contents:esm_node_modules_prop_types.Z.arrayOf(esm_node_modules_prop_types.Z.object),level:esm_node_modules_prop_types.Z.number};var esm_virtual_rollupPluginBabelHelpers=__webpack_require__("../markups/dist/esm/_virtual/_rollupPluginBabelHelpers.js"),StrikeSpan_a=function(t){var a=t.contents;return(0,emotion_react_browser_esm.tZ)("del",null,a.map((function(t,a){switch(t.type){case"PLAIN_TEXT":return(0,emotion_react_browser_esm.tZ)(PlainSpan_e,{key:a,contents:t.value});case"ITALIC":return(0,emotion_react_browser_esm.tZ)(ItalicSpan_a,{key:a,contents:t.value});case"BOLD":return(0,emotion_react_browser_esm.tZ)(BoldSpan_l,{key:a,contents:t.value});default:return null}})))};StrikeSpan_a.propTypes={contents:esm_node_modules_prop_types.Z.any};var LinkSpan_i=function(r){var i=r.href,m=r.label,f=react.useMemo((function(){return(Array.isArray(m)?m:[m]).map((function(e,r){switch(e.type){case"PLAIN_TEXT":return(0,emotion_react_browser_esm.tZ)(PlainSpan_e,{key:r,contents:e.value});case"STRIKE":return(0,emotion_react_browser_esm.tZ)(StrikeSpan_a,{key:r,contents:e.value});case"ITALIC":return(0,emotion_react_browser_esm.tZ)(ItalicSpan_a,{key:r,contents:e.value});case"BOLD":return(0,emotion_react_browser_esm.tZ)(BoldSpan_l,{key:r,contents:e.value});default:return null}}))}),[m]);return function(e){return 0!==e.indexOf(function(){if(document.baseURI)return document.baseURI;var e=document.getElementsByTagName("base");return e.length>0?e[0].href:document.URL}())}(i)?(0,emotion_react_browser_esm.tZ)("a",{href:i,title:i,rel:"noopener noreferrer",target:"_blank"},f):(0,emotion_react_browser_esm.tZ)("a",{href:i,title:i},f)};LinkSpan_i.propTypes={href:esm_node_modules_prop_types.Z.string,label:esm_node_modules_prop_types.Z.array};var BoldSpan_l=function(e){var l=e.contents;return(0,emotion_react_browser_esm.tZ)("strong",null,l.map((function(e,l){switch(e.type){case"PLAIN_TEXT":return(0,emotion_react_browser_esm.tZ)(PlainSpan_e,{key:l,contents:e.value});case"STRIKE":return(0,emotion_react_browser_esm.tZ)(StrikeSpan_a,{key:l,contents:e.value});case"ITALIC":return(0,emotion_react_browser_esm.tZ)(ItalicSpan_a,{key:l,contents:e.value});case"LINK":return(0,emotion_react_browser_esm.tZ)(LinkSpan_i,{key:l,href:e.value.src.value,label:Array.isArray(e.value.label)?e.value.label:[e.value.label]});default:return null}})))};BoldSpan_l.propTypes={contents:esm_node_modules_prop_types.Z.any};var ItalicSpan_a=function(e){var a=e.contents;return(0,emotion_react_browser_esm.tZ)("em",null,a.map((function(e,a){switch(e.type){case"PLAIN_TEXT":return(0,emotion_react_browser_esm.tZ)(PlainSpan_e,{key:a,contents:e.value});case"STRIKE":return(0,emotion_react_browser_esm.tZ)(StrikeSpan_a,{key:a,contents:e.value});case"BOLD":return(0,emotion_react_browser_esm.tZ)(BoldSpan_l,{key:a,contents:e.value});default:return null}})))};ItalicSpan_a.propTypes={contents:esm_node_modules_prop_types.Z.any};var CodeElement_n=function(o){var n=o.contents;return(0,emotion_react_browser_esm.tZ)("code",null,(0,emotion_react_browser_esm.tZ)(PlainSpan_e,{contents:n.value}))};CodeElement_n.propTypes={contents:esm_node_modules_prop_types.Z.any};var ChannelMention_e=function(o){var e=o.mention;return(0,emotion_react_browser_esm.tZ)(react.Fragment,null,"#",e)};ChannelMention_e.propTypes={mention:esm_node_modules_prop_types.Z.string};var ColorElement_t=function(r){var t=r.r,s=r.g,n=r.b,p=r.a;return(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:elements_styles_l_colorBox(t,s,n,p)}),"rgba(",t,", ",s,", ",n,", ",p/255*100,"%)")};ColorElement_t.propTypes={r:esm_node_modules_prop_types.Z.number,g:esm_node_modules_prop_types.Z.number,b:esm_node_modules_prop_types.Z.number,a:esm_node_modules_prop_types.Z.number};var index_mjs=__webpack_require__("../markups/dist/esm/node_modules/zustand/esm/index.mjs.js"),cloneArray_t=function(t){return(0,esm_virtual_rollupPluginBabelHelpers.u)(t).map((function(r){return"object"===(0,esm_virtual_rollupPluginBabelHelpers.Ac)(r)?(0,esm_virtual_rollupPluginBabelHelpers.Zj)({},r):r}))},messageListHelpers_e=function(e,r){var i,o,u=cloneArray_t(e),d=u.findIndex((function(n){return n._id===r._id}));return-1===d?function(n,t){var e=n.findIndex((function(n){return new Date(n.ts)1&&void 0!==arguments[1]&&arguments[1];e.tmid&&t?(null===(s=i().threadMainMessage)||void 0===s?void 0:s._id)===e.tmid&&n((function(s){return{threadMessages:messageListHelpers_e(s.threadMessages,e)}})):n((function(s){return{messages:messageListHelpers_e(s.messages,e)}}))},removeMessage:function(e){var s=i().threadMessages.find((function(s){return s._id===e})),r=i().messages.find((function(s){return s._id===e}));return s?n((function(s){return{threadMessages:cloneArray_t(s.threadMessages).filter((function(s){return s._id!==e}))}})):r?n((function(s){return{messages:cloneArray_t(s.messages).filter((function(s){return s._id!==e}))}})):void 0},replaceMessage:function(e,s){var r=i().threadMessages.find((function(s){return s._id===e})),a=i().messages.find((function(s){return s._id===e}));return r?n((function(n){return{threadMessages:cloneArray_t(n.threadMessages).map((function(n){return n._id===e?s:n}))}})):a?n((function(n){return{messages:cloneArray_t(n.messages).map((function(n){return n._id===e?s:n}))}})):void 0},setEditMessage:function(e){return n((function(){return{editMessage:e}}))},editMessagePermissions:{},setEditMessagePermissions:function(s){return n((function(n){return(0,esm_virtual_rollupPluginBabelHelpers.Zj)((0,esm_virtual_rollupPluginBabelHelpers.Zj)({},n),{},{editMessagePermissions:s})}))},addQuoteMessage:function(e){return n((function(n){return{quoteMessage:[].concat((0,esm_virtual_rollupPluginBabelHelpers.u)(n.quoteMessage),[e])}}))},removeQuoteMessage:function(e){return n((function(s){return{quoteMessage:s.quoteMessage.filter((function(s){return s!==e}))}}))},clearQuoteMessages:function(){return n({quoteMessage:[]})},setMessageToReport:function(e){return n((function(){return{messageToReport:e}}))},toggleShowReportMessage:function(){n((function(e){return{showReportMessage:!e.showReportMessage}}))},toogleRecordingMessage:function(){n((function(e){return{isRecordingMessage:!e.isRecordingMessage}}))},openThread:function(e){n((function(){return{isThreadOpen:!0,threadMainMessage:e,threadMessages:[]}}))},closeThread:function(){n((function(){return{isThreadOpen:!1,threadMainMessage:null,threadMessages:[]}}))},setThreadMessages:function(e){return n((function(){return{threadMessages:e}}))},setHeaderTitle:function(e){return n((function(){return{headerTitle:e}}))}}}));var userStore_e=(0,index_mjs.Ue)((function(n){return{userId:"",setUserId:function(r){n({userId:r})},name:"",setName:function(r){n({name:r})},username:"",setUsername:function(r){n({username:r})},avatarUrl:"",setUserAvatarUrl:function(r){return n((function(){return{avatarUrl:r}}))},isUserAuthenticated:!1,canSendMsg:!0,setIsUserAuthenticated:function(r){return n((function(){return{isUserAuthenticated:r}}))},setCanSendMsg:function(r){return n((function(){return{canSendMsg:r}}))},password:null,setPassword:function(r){return n((function(){return{password:r}}))},emailoruser:null,setEmailorUser:function(r){return n((function(){return{emailoruser:r}}))},roles:[],setRoles:function(e){return n((function(n){return(0,esm_virtual_rollupPluginBabelHelpers.Zj)((0,esm_virtual_rollupPluginBabelHelpers.Zj)({},n),{},{roles:e})}))},userPinPermissions:{},setUserPinPermissions:function(e){return n((function(n){return(0,esm_virtual_rollupPluginBabelHelpers.Zj)((0,esm_virtual_rollupPluginBabelHelpers.Zj)({},n),{},{userPinPermissions:e})}))},showCurrentUserInfo:!1,setShowCurrentUserInfo:function(r){return n((function(){return{showCurrentUserInfo:r}}))},currentUser:{},setCurrentUser:function(r){return n({currentUser:r})}}})),memberStore_n=(0,index_mjs.Ue)((function(r){return{members:[],showMembers:!1,setShowMembers:function(e){return r((function(){return{showMembers:e}}))},memberRoles:{},admins:[],setMemberRoles:function(n){return r((function(r){return(0,esm_virtual_rollupPluginBabelHelpers.Zj)((0,esm_virtual_rollupPluginBabelHelpers.Zj)({},r),{},{memberRoles:n})}))},setAdmins:function(e){return r((function(){return{admins:e}}))},setMembersHandler:function(e){return r((function(){return{members:e}}))}}}));(0,index_mjs.Ue)((function(n){return{isTotpModalOpen:!1,setIsTotpModalOpen:function(o){return n((function(){return{isTotpModalOpen:o}}))}}}));var searchMessageStore_r=(0,index_mjs.Ue)((function(e){return{showSearch:!1,setShowSearch:function(r){return e((function(){return{showSearch:r}}))}}}));(0,index_mjs.Ue)((function(n){return{isLoginIn:!1,setIsLoginIn:function(o){return n((function(){return{isLoginIn:o}}))},isLoginModalOpen:!1,setIsLoginModalOpen:function(o){return n((function(){return{isLoginModalOpen:o}}))}}}));var channelStore_e=(0,index_mjs.Ue)((function(n){return{showChannelinfo:!1,isChannelPrivate:!1,isChannelReadOnly:!1,setShowChannelinfo:function(e){return n((function(){return{showChannelinfo:e}}))},channelInfo:{},setChannelInfo:function(e){return n((function(){return{channelInfo:e}}))},setIsChannelPrivate:function(e){return n((function(){return{isChannelPrivate:e}}))},setIsChannelReadOnly:function(e){return n((function(){return{isChannelReadOnly:e}}))}}})),threadsMessageStore_r=(0,index_mjs.Ue)((function(e){return{showAllThreads:!1,setShowAllThreads:function(r){return e((function(){return{showAllThreads:r}}))}}})),fileStore_n=(0,index_mjs.Ue)((function(e){return{showAllFiles:!1,setShowAllFiles:function(n){return e((function(){return{showAllFiles:n}}))}}})),mentionsStore_o=(0,index_mjs.Ue)((function(n){return{showMentions:!1,setShowMentions:function(o){return n((function(){return{showMentions:o}}))}}})),pinnedMessageStore_e=(0,index_mjs.Ue)((function(n){return{showPinned:!1,setShowPinned:function(e){return n((function(){return{showPinned:e}}))}}})),starredMessageStore_e=(0,index_mjs.Ue)((function(r){return{showStarred:!1,setShowStarred:function(e){return r((function(){return{showStarred:e}}))},starredMessages:[],setStarredMessages:function(e){return r((function(){return{starredMessages:e}}))}}})),sidebarStore_r=(0,index_mjs.Ue)((function(e){return{showSidebar:!1,setShowSidebar:function(r){return e((function(){return{showSidebar:r}}))}}})),RCInstance_a=(0,react.createContext)();RCInstance_a.Provider;var UserMention_l=function(a){var l=a.contents,f=(0,react.useContext)(MarkupInteractionContext_o),g=f.members,j=f.username,k=(0,react.useContext)(RCInstance_a).RCInstance,S=function(){var a=sidebarStore_r((function(r){return r.setShowSidebar})),c=memberStore_n((function(r){return r.setShowMembers})),h=searchMessageStore_r((function(r){return r.setShowSearch})),p=pinnedMessageStore_e((function(r){return r.setShowPinned})),j=starredMessageStore_e((function(r){return r.setShowStarred})),l=threadsMessageStore_r((function(r){return r.setShowAllThreads})),d=fileStore_n((function(r){return r.setShowAllFiles})),w=mentionsStore_o((function(r){return r.setShowMentions})),g=userStore_e((function(r){return r.setShowCurrentUserInfo})),M=channelStore_e((function(r){return r.setShowChannelinfo})),b=(0,react.useMemo)((function(){return[j,p,c,h,M,l,d,w,g]}),[d,l,M,g,c,w,p,h,j]);return function(r){var t=!1;b.forEach((function(e){e===r?(t=!0,e(!0)):e(!1)})),a(t)}}(),d=userStore_e((function(e){return{setShowCurrentUserInfo:e.setShowCurrentUserInfo,setCurrentUser:e.setCurrentUser}})),h=d.setShowCurrentUserInfo,v=d.setCurrentUser,C=function(){var t=(0,esm_virtual_rollupPluginBabelHelpers.x)((0,esm_virtual_rollupPluginBabelHelpers.l5)().mark((function e(t){var s;return(0,esm_virtual_rollupPluginBabelHelpers.l5)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k.userData(t);case 2:s=e.sent,v({_id:s.user._id,username:s.user.username,name:s.user.name}),S(h);case 5:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}(),x=function(b,c){var l=useTheme_i().theme;return{mention:(0,emotion_react_browser_esm.iv)("background-color:","all"===b.value||"here"===b.value?l.colors.warning:b.value===c?l.colors.destructive:l.colors.muted,";color:","all"===b.value||"here"===b.value?l.colors.warningForeground:b.value===c?l.colors.destructiveForeground:l.colors.mutedForeground,";font-weight:bold;cursor:pointer;padding:1.5px;border-radius:3px;","","","")}}(l,j);return(0,emotion_react_browser_esm.tZ)(react.Fragment,null,function(e){if("all"===e||"here"===e)return!0;var r=!1;return Object.keys(g).forEach((function(t){g[t].username===e&&(r=!0)})),r}(l.value)?(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:x.mention,onClick:["here","all"].includes(l.value)?null:function(){return C(l.value)}},l.value):"@".concat(l.value))};UserMention_l.propTypes={contents:esm_node_modules_prop_types.Z.any.isRequired};var InlineElements_f=function(r){return r.contents.map((function(r,f){switch(r.type){case"BOLD":return(0,emotion_react_browser_esm.tZ)(BoldSpan_l,{key:f,contents:r.value});case"PLAIN_TEXT":return(0,emotion_react_browser_esm.tZ)(PlainSpan_e,{key:f,contents:r.value});case"STRIKE":return(0,emotion_react_browser_esm.tZ)(StrikeSpan_a,{key:f,contents:r.value});case"ITALIC":return(0,emotion_react_browser_esm.tZ)(ItalicSpan_a,{key:f,contents:r.value});case"INLINE_CODE":return(0,emotion_react_browser_esm.tZ)(CodeElement_n,{key:f,contents:r.value});case"MENTION_CHANNEL":return(0,emotion_react_browser_esm.tZ)(ChannelMention_e,{key:f,mention:r.value.value});case"MENTION_USER":return(0,emotion_react_browser_esm.tZ)(UserMention_l,{key:f,contents:r.value});case"EMOJI":return(0,emotion_react_browser_esm.tZ)(elements_Emoji_t,{key:f,emoji:r});case"COLOR":return(0,emotion_react_browser_esm.tZ)(ColorElement_t,(0,esm_virtual_rollupPluginBabelHelpers.gY)({key:f},r.value));case"LINK":return(0,emotion_react_browser_esm.tZ)(LinkSpan_i,{key:f,href:r.value.src.value,label:Array.isArray(r.value.label)?r.value.label:[r.value.label]});default:return null}}))};InlineElements_f.propTypes={contents:esm_node_modules_prop_types.Z.any};var OrderedListBlock_o=function(e){var o=e.items;return(0,emotion_react_browser_esm.tZ)("ol",null,o.map((function(e,o){return(0,emotion_react_browser_esm.tZ)("li",{key:o,value:e.number},(0,emotion_react_browser_esm.tZ)(InlineElements_f,{contents:e.value}))})))};OrderedListBlock_o.propTypes={items:esm_node_modules_prop_types.Z.arrayOf(esm_node_modules_prop_types.Z.shape)};var ParagraphBlock_n={name:"ti75j2",styles:"margin:0"},ParagraphBlock_b=function(c){var b=c.contents;return(0,emotion_react_browser_esm.tZ)("p",{css:ParagraphBlock_n},(0,emotion_react_browser_esm.tZ)(InlineElements_f,{contents:b}))};ParagraphBlock_b.propTypes={contents:esm_node_modules_prop_types.Z.any};var UnOrderedListBlock_o=function(e){var o=e.items;return(0,emotion_react_browser_esm.tZ)("ul",null,o.map((function(e,o){return(0,emotion_react_browser_esm.tZ)("li",{key:o},(0,emotion_react_browser_esm.tZ)(InlineElements_f,{contents:e.value}))})))};UnOrderedListBlock_o.propTypes={items:esm_node_modules_prop_types.Z.arrayOf(esm_node_modules_prop_types.Z.shape)};var QuoteBlock_e=function(o){var e=o.contents;return(0,emotion_react_browser_esm.tZ)("blockquote",null,e.map((function(o,e){return(0,emotion_react_browser_esm.tZ)(ParagraphBlock_b,{key:e,contents:o.value})})))};QuoteBlock_e.propTypes={contents:esm_node_modules_prop_types.Z.arrayOf(esm_node_modules_prop_types.Z.shape)};var blocks_styles_t={li:{name:"pwjvve",styles:"display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;gap:0.5em"}},TaskListBlock_l={name:"12o1yl",styles:"align-self:baseline"},TaskListBlock_g=function(s){var g=s.tasks;return(0,emotion_react_browser_esm.tZ)("ul",{className:"task-list"},g.map((function(s,g){return(0,emotion_react_browser_esm.tZ)("li",{key:g,css:blocks_styles_t.li},(0,emotion_react_browser_esm.tZ)(CheckBox_p,{checked:s.status,css:TaskListBlock_l}),(0,emotion_react_browser_esm.tZ)(InlineElements_f,{contents:s.value}))})))};TaskListBlock_g.propTypes={tasks:esm_node_modules_prop_types.Z.arrayOf(esm_node_modules_prop_types.Z.object)};var k=function(e){return e.tokens.map((function(e,k){switch(e.type){case"PARAGRAPH":return(0,emotion_react_browser_esm.tZ)(ParagraphBlock_b,{key:k,contents:e.value});case"CODE":return(0,emotion_react_browser_esm.tZ)(CodeBlock_t,{key:k,lines:e.value});case"BIG_EMOJI":return(0,emotion_react_browser_esm.tZ)(BigEmoji_n,{key:k,contents:e.value});case"HEADING":return(0,emotion_react_browser_esm.tZ)(HeadingBlock_n,{key:k,contents:e.value,level:e.level});case"UNORDERED_LIST":return(0,emotion_react_browser_esm.tZ)(UnOrderedListBlock_o,{key:k,items:e.value});case"ORDERED_LIST":return(0,emotion_react_browser_esm.tZ)(OrderedListBlock_o,{key:k,items:e.value});case"TASKS":return(0,emotion_react_browser_esm.tZ)(TaskListBlock_g,{key:k,tasks:e.value});case"QUOTE":return(0,emotion_react_browser_esm.tZ)(QuoteBlock_e,{key:k,contents:e.value});case"LINE_BREAK":return(0,emotion_react_browser_esm.tZ)("br",{key:k});default:return null}}))};k.propTypes={tokens:esm_node_modules_prop_types.Z.arrayOf(esm_node_modules_prop_types.Z.object)};var ActionsBlock_Action_c=function(c){var r=c.element,l=c.parser,n=c.index,d=useComponentOverrides_l("ActionBlockAction"),b=d.classNames,m=d.styleOverrides,a=(0,emotion_react_browser_esm.iv)("display:flex;margin:0.25rem;",r.type!==BlockElementType.z.BUTTON?"flex-grow: 1;":"",";",r.type!==BlockElementType.z.BUTTON?"flex-basis: 45%;":"",";","","",""),u=l.renderActionsBlockElement(r,n);return u?(0,emotion_react_browser_esm.tZ)(Box_n,{css:a,style:m,className:b},u):null},d={name:"5kov97",styles:"display:flex;flex-wrap:wrap"},ActionsBlock_m=(0,react.memo)((function(i){var m=i.className,C=i.block,u=i.surfaceRenderer,A=useComponentOverrides_l("ActionBlock"),p=A.classNames,G=A.styleOverrides,V=d,W=(0,react.useContext)(SurfaceContext_e),N=(0,react.useState)((function(){return C.elements.length>5&&"banner"!==W})),Z=(0,_virtual_rollupPluginBabelHelpers.ZQ)(N,2),y=Z[0],k=Z[1],X=(0,react.useCallback)((function(){k(!1)}),[]),B=(0,react.useMemo)((function(){return(y?C.elements.slice(0,5):C.elements).map((function(e){var s,c;return(0,_virtual_rollupPluginBabelHelpers.Zj)((0,_virtual_rollupPluginBabelHelpers.Zj)({},e),{},{appId:null!==(s=e.appId)&&void 0!==s?s:C.appId,blockId:null!==(c=e.blockId)&&void 0!==c?c:C.blockId})}))}),[C.appId,C.blockId,C.elements,y]);return(0,emotion_react_browser_esm.tZ)(Box_n,{css:V,className:"ec-action-block ".concat(m," ").concat(p),style:G},B.map((function(e,t){return(0,emotion_react_browser_esm.tZ)(ActionsBlock_Action_c,{key:t,element:e,parser:u,index:t})})),y&&(0,emotion_react_browser_esm.tZ)(Box_n,{style:{display:"flex",margin:"0.125rem"}},(0,emotion_react_browser_esm.tZ)(Button_c,{size:"small",type:"secondary",onClick:X},u.renderTextObject({type:"plain_text",text:"Show more..."},0,BlockContext.Q.NONE))))})),blocks_styles_I={image:function(I,b,c){return(0,emotion_react_browser_esm.iv)("box-shadow:0 0 0px 1px rgba(204, 204, 204, 38%);background-repeat:no-repeat;background-position:50%;background-size:cover;background-color:rgba(204, 204, 204, 38%);background-image:url(",I,");width:",String(b),"px;height:",String(c),"px;overflow:hidden;","","","")},imageBlock:function(I){return(0,emotion_react_browser_esm.iv)("display:flex;flex-direction:column;flex-wrap:nowrap;align-items:",I,";","","","")},imageTitle:function(I){return(0,emotion_react_browser_esm.iv)("overflow:hidden;text-overflow:ellipsis;font-size:0.8rem;margin-block-end:-0.25rem;width:",I,";","","","")}},blocks_styles_b={ContextBlock:{name:"1f4awl1",styles:"display:inline-block;padding:0 0.75rem;font-size:0.8rem;margin:-0.25rem"}},ContextBlockItem_i=function(i){var c=i.block,d=i.surfaceRenderer,n=i.index,m=useComponentOverrides_l("ContextBlockItem"),a=m.classNames,l=m.styleOverrides,u=d.renderContextBlockElement(c,n);if(!u)return null;switch(c.type){case TextObjectType.n.PLAIN_TEXT:case TextObjectType.n.MARKDOWN:return(0,emotion_react_browser_esm.tZ)(Box_n,{css:blocks_styles_b.ContextBlock,className:"ec-context-block-item ".concat(a),style:l},u);default:return u}},ContextBlock_C={name:"epoicu",styles:"display:flex;align-items:center;margin:-0.25rem"},ContextBlock_a=(0,react.memo)((function(l){var a=l.className,n=l.block,s=l.surfaceRenderer,i=useComponentOverrides_l("ContextBlock"),o=i.classNames,m=i.styleOverrides,r=(0,react.useMemo)((function(){return n.elements.map((function(b){return(0,_virtual_rollupPluginBabelHelpers.Zj)((0,_virtual_rollupPluginBabelHelpers.Zj)({},b),{},{appId:n.appId,blockId:n.blockId})}))}),[n.appId,n.blockId,n.elements]);return(0,emotion_react_browser_esm.tZ)(Box_n,{css:ContextBlock_C,className:"ec-context-block ".concat(a," ").concat(o),style:m},r.map((function(e,l){return(0,emotion_react_browser_esm.tZ)(ContextBlockItem_i,{key:l,block:e,surfaceRenderer:s,index:l})})))})),DividerBlock_a=(0,react.memo)((function(e){var a=e.className;return(0,emotion_react_browser_esm.tZ)(p,{className:a})})),ImageBlock_l=function(e){if(!e.complete)return{loading:!0,width:360,height:3240/21};var t=e.naturalWidth,i=e.naturalHeight,r=t>i?Math.min(t,360)/t:Math.min(i,360)/i;return{loading:!1,width:t*r,height:i*r}},ImageBlock_u=(0,react.memo)((function(i){var d=i.className,u=i.block,k=i.surfaceRenderer,h=useComponentOverrides_l("ImageBlock"),g=h.classNames,p=h.styleOverrides,f=(0,react.useState)((function(){var e=document.createElement("img");return e.src=u.imageUrl,ImageBlock_l(e)})),j=(0,_virtual_rollupPluginBabelHelpers.ZQ)(f,2),_=j[0],v=_.loading,b=_.width,y=_.height,B=j[1];return(0,react.useEffect)((function(){var e=document.createElement("img"),t=function(){B(ImageBlock_l(e))};return e.addEventListener("load",t),e.src=u.imageUrl,e.complete&&(e.removeEventListener("load",t),B(ImageBlock_l(e))),function(){e.removeEventListener("load",t)}}),[u.imageUrl]),(0,emotion_react_browser_esm.tZ)(Box_n,{css:blocks_styles_I.imageBlock,className:"ec-image-block ".concat(d," ").concat(g),style:p},(0,emotion_react_browser_esm.tZ)(Box_n,{style:{overflow:"hidden",width:b}},u.title&&(0,emotion_react_browser_esm.tZ)(Box_n,{css:blocks_styles_I.imageTitle},k.renderTextObject(u.title,0,BlockContext.Q.NONE)),v?(0,emotion_react_browser_esm.tZ)(Skeleton_l,{variant:"rect",width:b,height:y}):(0,emotion_react_browser_esm.tZ)(Box_n,{css:blocks_styles_I.image(u.imageUrl,b,y),width:b,height:y,"aria-label":u.altText})))})),InputBlock_c=(0,react.memo)((function(r){var c=r.className,m=r.block,a=r.surfaceRenderer,u=r.context,k=useTheme_i().colors,p=(0,react.useMemo)((function(){var t,o;return(0,_virtual_rollupPluginBabelHelpers.Zj)((0,_virtual_rollupPluginBabelHelpers.Zj)({},m.element),{},{appId:null!==(t=m.element.appId)&&void 0!==t?t:m.appId,blockId:null!==(o=m.element.blockId)&&void 0!==o?o:m.blockId})}),[m.element,m.appId,m.blockId]),f=useUiKitState_p(p,u),h=(0,_virtual_rollupPluginBabelHelpers.ZQ)(f,1)[0].error;return(0,emotion_react_browser_esm.tZ)(Box_n,{className:c,style:{display:"flex",flexDirection:"column",gap:"0.1rem"}},m.label&&(0,emotion_react_browser_esm.tZ)(Box_n,null,a.renderTextObject(m.label,0,BlockContext.Q.NONE)),(0,emotion_react_browser_esm.tZ)(Box_n,{style:{display:"flex"}},a.renderInputBlockElement(p,0)),h&&(0,emotion_react_browser_esm.tZ)(Box_n,{style:{color:k.destructive}},h),m.hint&&(0,emotion_react_browser_esm.tZ)(Box_n,{style:{color:k.info}},m.hint))})),PreviewBlock=__webpack_require__("../ui-kit/dist/esm/node_modules/@rocket.chat/ui-kit/dist/esm/blocks/layout/PreviewBlock.js"),PreviewBlock_p=(0,react.memo)((function(i){var p,h=i.block,f=i.surfaceRenderer;return(0,emotion_react_browser_esm.tZ)(Box_n,null,(0,emotion_react_browser_esm.tZ)(MessageGenericPreview_m,null,(0,PreviewBlock.d)(h)&&(null===(p=h.preview)||void 0===p?void 0:p.dimensions)&&(0,emotion_react_browser_esm.tZ)(MessageGenericPreviewCoverImage_m,{width:h.preview.dimensions.width,height:h.preview.dimensions.height,url:h.preview.url}),(0,emotion_react_browser_esm.tZ)(MessageGenericPreviewContent_u,{thumb:(0,PreviewBlock.T)(h)?(0,emotion_react_browser_esm.tZ)(MessageGenericPreviewThumb_a,null,(0,emotion_react_browser_esm.tZ)(MessageGenericPreviewCoverImage_m,{height:192,width:368,url:h.thumb.url})):void 0},Array.isArray(h.title)?(0,emotion_react_browser_esm.tZ)(MessageGenericPreviewTitle_i,{externalUrl:(0,PreviewBlock.d)(h)?h.externalUrl:void 0},h.title.map((function(e,t){return f.renderTextObject(e,t,BlockContext.Q.NONE)}))):null,Array.isArray(h.description)?(0,emotion_react_browser_esm.tZ)(MessageGenericPreviewDescription_c,{clamp:!0},h.description.map((function(e){return f.renderTextObject(e,0,BlockContext.Q.NONE)}))):null,h.footer&&(0,emotion_react_browser_esm.tZ)(MessageGenericPreviewFooter_a,null,(0,emotion_react_browser_esm.tZ)(ContextBlock_a,{block:h.footer,surfaceRenderer:f,context:BlockContext.Q.BLOCK,index:0})))))})),SectionBlock_Fields_s={xs:4,sm:4,md:4,lg:6,xl:6},SectionBlock_Fields_o=function(o){var d=o.fields,m=o.surfaceRenderer;return(0,emotion_react_browser_esm.tZ)(Grid_e,null,d.map((function(o,d){return(0,emotion_react_browser_esm.tZ)(Grid_e.Item,(0,_virtual_rollupPluginBabelHelpers.gY)({},SectionBlock_Fields_s,{key:d}),m.renderTextObject(o,0,BlockContext.Q.NONE))})))},SectionBlock_n=(0,react.memo)((function(r){var n=r.className,m=r.block,d=r.surfaceRenderer,i=m.text,p=m.fields,f=(0,react.useMemo)((function(){return m.accessory?(0,_virtual_rollupPluginBabelHelpers.Zj)({appId:m.appId,blockId:m.blockId},m.accessory):void 0}),[m.appId,m.blockId,m.accessory]);return(0,emotion_react_browser_esm.tZ)(Grid_e,{className:n,cols:(i||p)&&m.accessory?2:1,gap:"10px"},(0,emotion_react_browser_esm.tZ)(Grid_e.Item,null,i&&(0,emotion_react_browser_esm.tZ)(Box_n,null,d.text(i)),p&&(0,emotion_react_browser_esm.tZ)(SectionBlock_Fields_o,{fields:p,surfaceRenderer:d})),m.accessory&&(0,emotion_react_browser_esm.tZ)(Flex_o_Item,{grow:0},(0,emotion_react_browser_esm.tZ)(Grid_e.Item,{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"0.25rem"}},f?d.renderSectionAccessoryBlockElement(f,0):null)))})),ButtonElement_r={name:"kuy98u",styles:"min-width:4ch"},ButtonElement_o=function(o){var c=o.block,l=o.context,n=o.surfaceRenderer,d=useUiKitState_p(c,l),A=(0,_virtual_rollupPluginBabelHelpers.ZQ)(d,2),C=A[0].loading,a=A[1];return c.url?(0,emotion_react_browser_esm.tZ)("a",{target:"_blank",href:c.url,rel:"noreferrer"},(0,emotion_react_browser_esm.tZ)(Button_c,{size:"small",disabled:C,color:"danger"===c.style?"error":"secondary",css:ButtonElement_r,onClick:a},C?(0,emotion_react_browser_esm.tZ)(Throbber_m,null):n.renderTextObject(c.text,0,BlockContext.Q.NONE))):(0,emotion_react_browser_esm.tZ)(Button_c,{disabled:C,size:"small",value:c.value,onClick:a},C?(0,emotion_react_browser_esm.tZ)(Throbber_m,null):n.renderTextObject(c.text,0,BlockContext.Q.NONE))},server_browser=__webpack_require__("../../node_modules/react-dom/server.browser.js"),fromTextObjectToString_i=function(i,r,s){var o=i.renderTextObject(r,s,BlockContext.Q.NONE);if(o)return(0,server_browser.renderToStaticMarkup)(o)},DatePickerElement_i=function(i){var l=i.block,m=i.context,d=i.surfaceRenderer,n=useUiKitState_p(l,m),s=(0,_virtual_rollupPluginBabelHelpers.ZQ)(n,2),p=s[0],u=p.loading,c=p.value,f=p.error,v=s[1],b=l.actionId,h=l.placeholder;return(0,emotion_react_browser_esm.tZ)(Input_c,{type:"date",error:f,value:c,disabled:u,id:b,name:b,rows:6,placeholder:h?fromTextObjectToString_i(d,h,0):void 0,onInput:v})};var elements_elements_styles_b_container=function(c,b){return(0,emotion_react_browser_esm.iv)("box-shadow:0 0 0px 1px rgba(204, 204, 204, 38%);background-repeat:no-repeat;background-position:50%;background-size:cover;background-color:rgba(204, 204, 204, 38%);background-image:url(",c,");width:",String(b),"px;height:",String(b),"px;border-radius:4px;overflow:hidden;margin-inline-start:4px;","","","")},elements_styles_g={parentContainer:{name:"1mtmxjr",styles:"display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center"},childContainer:{name:"trai5v",styles:"display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin-inline:-0.25rem;min-width:0"}},ImageElement_s=function(s){var r=s.block,d=s.context,m=(d===BlockContext.Q.SECTION?88:d===BlockContext.Q.CONTEXT&&20)||void 0;return m?(0,emotion_react_browser_esm.tZ)(Box_n,{css:elements_elements_styles_b_container(r.imageUrl,m),size:m}):null},LinearScaleElement_c={name:"129ozfu",styles:"margin-inline:0.25rem;flex-shrink:1"},LinearScaleElement_r=(0,react.memo)((function(e){var r=e.className,n=e.block,b=e.context,o=e.surfaceRenderer,d=n.minValue,a=void 0===d?0:d,m=n.maxValue,u=void 0===m?10:m,W=n.initialValue,p=n.preLabel,x=n.postLabel,Z=useUiKitState_p(n,b),h=(0,_virtual_rollupPluginBabelHelpers.ZQ)(Z,2),G=h[0],X=G.loading,V=G.value,k=void 0===V?W:V,y=G.error,B=h[1],J=(0,react.useMemo)((function(){return Array.from({length:Math.max(u-a+1,1)},(function(I,g){return String(a+g)}))}),[u,a]);return(0,emotion_react_browser_esm.tZ)(Box_n,{css:elements_styles_g.parentContainer},p&&(0,emotion_react_browser_esm.tZ)(Box_n,{fontScale:"c2",paddingInlineEnd:8,textAlign:"start"},o.renderTextObject(p,0,BlockContext.Q.NONE)),(0,emotion_react_browser_esm.tZ)(Box_n,null,(0,emotion_react_browser_esm.tZ)(Box_n,{className:r,css:elements_styles_g.childContainer},J.map((function(I,e){return(0,emotion_react_browser_esm.tZ)(Button_c,{key:e,className:I===String(k)?"active":void 0,disabled:X,size:"small",color:y?"error":"secondary",css:LinearScaleElement_c,value:I,onClick:B},o.renderTextObject({type:"plain_text",text:String(e+a)},0,BlockContext.Q.NONE))})))),x&&(0,emotion_react_browser_esm.tZ)(Box_n,{fontScale:"c2",paddingInlineStart:8,textAlign:"end"},o.renderTextObject(x,0,BlockContext.Q.NONE)))})),MultiStaticSelectElement_u=(0,react.memo)((function(o){var u=o.block,m=o.context,s=o.surfaceRenderer,p=useUiKitState_p(u,m),c=(0,_virtual_rollupPluginBabelHelpers.ZQ)(p,2),f=c[0],d=f.loading,v=f.value,b=c[1],g=(0,react.useMemo)((function(){return u.options.map((function(e,o){var r;return{value:e.value,label:null!==(r=fromTextObjectToString_i(s,e.text,o))&&void 0!==r?r:""}}))}),[u.options,s]),h=(0,react.useCallback)((function(e){b({target:{value:e}})}),[b]);return(0,emotion_react_browser_esm.tZ)(V,{options:g,value:v,placeholder:fromTextObjectToString_i(s,u.placeholder,0),disabled:d,onChange:h})})),OverflowElement_l=(0,react.memo)((function(t){var l=t.block,u=t.context,m=t.surfaceRenderer,p=useUiKitState_p(l,u),s=(0,_virtual_rollupPluginBabelHelpers.ZQ)(p,2);s[0].loading;var c=s[1],f=(0,react.useMemo)((function(){return l.options.map((function(o,t){var r,i=o.value,e=o.text,a=o.url;return{id:i,label:null!==(r=fromTextObjectToString_i(m,e,t))&&void 0!==r?r:"",icon:void 0,action:function(){a&&window.open(a),c({target:{value:String(i)}})}}}))}),[c,l.options,m]);return(0,emotion_react_browser_esm.tZ)(Menu_o,{options:f,tooltip:{isToolTip:!1,position:"bottom",text:"Options"}})})),PlainTextInputElement_i=(0,react.memo)((function(r){var i=r.block,d=r.context,n=r.surfaceRenderer,c=useUiKitState_p(i,d),m=(0,_virtual_rollupPluginBabelHelpers.ZQ)(c,2),p=m[0],s=p.loading,u=p.value,f=void 0===u?"":u,h=p.error,v=m[1];return i.multiline?(0,emotion_react_browser_esm.tZ)(Input_c,{textArea:!0,disabled:s,id:i.actionId,name:i.actionId,rows:6,error:h,value:f,onChange:v,placeholder:i.placeholder?fromTextObjectToString_i(n,i.placeholder,0):void 0}):(0,emotion_react_browser_esm.tZ)(Input_c,{disabled:s,id:i.actionId,name:i.actionId,error:h,value:f,onChange:v,placeholder:i.placeholder?fromTextObjectToString_i(n,i.placeholder,0):void 0})})),StaticSelectElement_u=(0,react.memo)((function(o){var u=o.block,m=o.context,s=o.surfaceRenderer,c=useUiKitState_p(u,m),p=(0,_virtual_rollupPluginBabelHelpers.ZQ)(c,2),f=p[0],d=f.loading,v=f.value,b=p[1],g=(0,react.useMemo)((function(){return u.options.map((function(e,o){var t;return{value:e.value,label:null!==(t=fromTextObjectToString_i(s,e.text,o))&&void 0!==t?t:""}}))}),[u.options,s]),h=(0,react.useCallback)((function(e){b({target:{value:e}})}),[b]);return(0,emotion_react_browser_esm.tZ)(StaticSelect_o,{value:v,options:g,disabled:d,placeholder:fromTextObjectToString_i(s,u.placeholder,0),onSelect:h})})),_virtual_messageParser=__webpack_require__("../ui-kit/dist/esm/_virtual/messageParser.js"),K=function(K){(0,_virtual_rollupPluginBabelHelpers.XW)(L,SurfaceRenderer.a);var g=(0,_virtual_rollupPluginBabelHelpers.WY)(L);function L(e){return(0,_virtual_rollupPluginBabelHelpers.PA)(this,L),g.call(this,e||["actions","context","divider","image","input","section","preview"])}return(0,_virtual_rollupPluginBabelHelpers.qH)(L,[{key:"plain_text",value:function(e,t,r){var n=e.text,i=void 0===n?"":n;return t===BlockContext.Q.BLOCK?null:i?(0,emotion_react_browser_esm.tZ)(react.Fragment,{key:r},i):null}},{key:"mrkdwn",value:function(e,t,r){var n=e.text,i=void 0===n?"":n;return t===BlockContext.Q.BLOCK?null:i?(0,emotion_react_browser_esm.tZ)(k,{key:r,tokens:_virtual_messageParser.m.exports.parse(i,{emoticons:!1})}):null}},{key:"text",value:function(e,t,r){return"mrkdwn"!==e.type?this.plain_text(e,t,r):this.mrkdwn(e,t,r)}},{key:"actions",value:function(e,t,r){return t===BlockContext.Q.BLOCK?(0,emotion_react_browser_esm.tZ)(ActionsBlock_m,{key:r,block:e,context:t,index:r,surfaceRenderer:this}):null}},{key:"preview",value:function(e,t,r){return t!==BlockContext.Q.BLOCK?null:(0,emotion_react_browser_esm.tZ)(PreviewBlock_p,{key:r,block:e,context:t,index:r,surfaceRenderer:this})}},{key:"context",value:function(e,t,r){return t===BlockContext.Q.BLOCK?(0,emotion_react_browser_esm.tZ)(ContextBlock_a,{key:r,block:e,context:t,index:r,surfaceRenderer:this}):null}},{key:"divider",value:function(e,t,r){return t===BlockContext.Q.BLOCK?(0,emotion_react_browser_esm.tZ)(DividerBlock_a,{key:r,block:e,context:t,index:r,surfaceRenderer:this}):null}},{key:"image",value:function(e,t,r){return t===BlockContext.Q.BLOCK?(0,emotion_react_browser_esm.tZ)(ImageBlock_u,{key:r,block:e,context:t,index:r,surfaceRenderer:this}):(0,emotion_react_browser_esm.tZ)(ImageElement_s,{key:r,block:e,context:t,index:r,surfaceRenderer:this})}},{key:"input",value:function(e,t,r){return t===BlockContext.Q.BLOCK?(0,emotion_react_browser_esm.tZ)(InputBlock_c,{key:e.element.actionId||r,block:e,context:t,index:r,surfaceRenderer:this}):null}},{key:"section",value:function(e,t,r){return t===BlockContext.Q.BLOCK?(0,emotion_react_browser_esm.tZ)(SectionBlock_n,{key:r,block:e,context:t,index:r,surfaceRenderer:this}):null}},{key:"button",value:function(e,t,r){return t===BlockContext.Q.BLOCK?null:(0,emotion_react_browser_esm.tZ)(ButtonElement_o,{key:r,block:e,context:t,index:r,surfaceRenderer:this})}},{key:"datepicker",value:function(e,t,r){return t===BlockContext.Q.BLOCK?null:(0,emotion_react_browser_esm.tZ)(DatePickerElement_i,{key:e.actionId||r,block:e,context:t,index:r,surfaceRenderer:this})}},{key:"static_select",value:function(e,t,r){return t===BlockContext.Q.BLOCK?null:(0,emotion_react_browser_esm.tZ)(StaticSelectElement_u,{key:e.actionId||r,block:e,context:t,index:r,surfaceRenderer:this})}},{key:"multi_static_select",value:function(e,t,r){return t===BlockContext.Q.BLOCK?null:(0,emotion_react_browser_esm.tZ)(MultiStaticSelectElement_u,{key:e.actionId||r,block:e,context:t,index:r,surfaceRenderer:this})}},{key:"overflow",value:function(e,t,r){return t===BlockContext.Q.BLOCK?null:(0,emotion_react_browser_esm.tZ)(OverflowElement_l,{key:r,block:e,context:t,index:r,surfaceRenderer:this})}},{key:"plain_text_input",value:function(e,t,r){return t===BlockContext.Q.BLOCK?null:(0,emotion_react_browser_esm.tZ)(PlainTextInputElement_i,{key:e.actionId||r,block:e,context:t,index:r,surfaceRenderer:this})}},{key:"linear_scale",value:function(e,t,r){return t===BlockContext.Q.BLOCK?null:(0,emotion_react_browser_esm.tZ)(LinearScaleElement_r,{key:e.actionId||r,block:e,context:t,index:r,surfaceRenderer:this})}}]),L}(),MessageSurfaceRenderer_n=function(n){(0,_virtual_rollupPluginBabelHelpers.XW)(l,K);var s=(0,_virtual_rollupPluginBabelHelpers.WY)(l);function l(){return(0,_virtual_rollupPluginBabelHelpers.PA)(this,l),s.call(this,["actions","context","divider","image","input","section","preview","video_conf"])}return(0,_virtual_rollupPluginBabelHelpers.qH)(l,[{key:"video_conf",value:function(){return null}}]),l}(),ModalSurfaceRenderer_s=function(s){(0,_virtual_rollupPluginBabelHelpers.XW)(n,K);var l=(0,_virtual_rollupPluginBabelHelpers.WY)(n);function n(){return(0,_virtual_rollupPluginBabelHelpers.PA)(this,n),l.call(this,["actions","context","divider","image","input","section","preview","callout"])}return(0,_virtual_rollupPluginBabelHelpers.qH)(n)}(),ContextualBarSurface_a={name:"4zk4ri",styles:"display:flex;flex-direction:column;gap:1rem"},ContextualBarSurfaceRenderer_s=function(s){(0,_virtual_rollupPluginBabelHelpers.XW)(n,K);var l=(0,_virtual_rollupPluginBabelHelpers.WY)(n);function n(){return(0,_virtual_rollupPluginBabelHelpers.PA)(this,n),l.call(this,["actions","context","divider","image","input","section","preview","callout","tab_navigation"])}return(0,_virtual_rollupPluginBabelHelpers.qH)(n)}(),surfaces_s=new MessageSurfaceRenderer_n,surfaces_n=new ModalSurfaceRenderer_s,surfaces_u=new ContextualBarSurfaceRenderer_s,surfaces_c=createSurfaceRenderer_t((function(m){var o=m.children;return(0,emotion_react_browser_esm.tZ)(Surface_e,{type:"message"},(0,emotion_react_browser_esm.tZ)(Box_n,{style:{marginBlock:"1rem"}},o))}),surfaces_s),surfaces_p=createSurfaceRenderer_t((function(m){var n=m.children;return(0,emotion_react_browser_esm.tZ)(Surface_e,{type:"modal"},(0,emotion_react_browser_esm.tZ)(Box_n,{css:ModalSurface_a},n))}),surfaces_n),surfaces_i=createSurfaceRenderer_t((function(c){var i=c.children;return(0,emotion_react_browser_esm.tZ)(Surface_e,{type:"contextualBar"},(0,emotion_react_browser_esm.tZ)(Box_n,{css:ContextualBarSurface_a},i))}),surfaces_u),UiKitComponent_r=function(r){return(0,r.render)(r.blocks)},extractInitialStateFromLayout_o=function(e){return"actionId"in e&&"string"==typeof e.actionId},extractInitialStateFromLayout_l=function(l,a){if(function(n){return function(n){return"element"in n}(n)}(a)&&extractInitialStateFromLayout_o(a.element)&&(l[a.element.actionId]={value:getInitialValue_i(a.element),blockId:a.blockId}),function(r){return function(r){return"elements"in r&&Array.isArray(r.elements)}(r)}(a)){var i,c=(0,_virtual_rollupPluginBabelHelpers.sf)(a.elements);try{for(c.s();!(i=c.n()).done;){var m=i.value;extractInitialStateFromLayout_o(m)&&(l[m.actionId]={value:getInitialValue_i(m),blockId:a.blockId})}}catch(e){c.e(e)}finally{c.f()}}return l},extractInitialStateFromLayout_a=function(e){return e.reduce(extractInitialStateFromLayout_l,{})},dist_index_module=__webpack_require__("../../node_modules/@rocket.chat/emitter/dist/index.module.js");const uiKitStore=(0,esm.Ue)((set=>({uiKitModalOpen:!1,setUiKitModalOpen:isOpen=>set({uiKitModalOpen:isOpen}),uiKitContextualBarOpen:!1,setUiKitContextualBarOpen:isOpen=>set({uiKitContextualBarOpen:isOpen}),uiKitModalData:null,setUiKitModalData:data=>set({uiKitModalData:data}),uiKitContextualBarData:null,setUiKitContextualBarData:data=>set({uiKitContextualBarData:data})}))),emitter=new dist_index_module.Q,uiKit_useUiKitActionManager=()=>{const{RCInstance}=(0,react.useContext)(context_RCInstance),{setUiKitModalOpen,setUiKitContextualBarOpen,setUiKitModalData,setUiKitContextualBarData}=uiKitStore((state=>({setUiKitModalOpen:state.setUiKitModalOpen,setUiKitContextualBarOpen:state.setUiKitContextualBarOpen,setUiKitModalData:state.setUiKitModalData,setUiKitContextualBarData:state.setUiKitContextualBarData}))),disposeView=(0,react.useCallback)((()=>{setUiKitModalOpen(!1),setUiKitModalData(null),setUiKitContextualBarOpen(!1),setUiKitContextualBarData(null)}),[setUiKitModalOpen,setUiKitModalData,setUiKitContextualBarOpen,setUiKitContextualBarData]),handleServerInteraction=(0,react.useCallback)((interaction=>{switch(interaction.type){case"modal.open":setUiKitModalData(interaction.view),setUiKitModalOpen(!0);break;case"contextual_bar.open":setUiKitContextualBarData(interaction.view),setUiKitContextualBarOpen(!0);break;case"modal.update":case"contextual_bar.update":{const{type,triggerId,appId,view}=interaction;emitter.emit(view.id,{type,triggerId,viewId:view.id,appId,view});break}}}),[setUiKitContextualBarData,setUiKitContextualBarOpen,setUiKitModalOpen,setUiKitModalData]),on=(0,react.useCallback)(((eventName,listener)=>(emitter.on(eventName,listener),()=>emitter.off(eventName,listener))),[]),off=(0,react.useCallback)(((eventName,listener)=>{emitter.off(eventName,listener)}),[]);return{handleServerInteraction,emitInteraction:async(appId,userInteraction)=>{const interaction=await(RCInstance?.handleUiKitInteraction(appId,userInteraction));switch(userInteraction.type){case"viewSubmit":interaction&&!["errors","modal.update","contextual_bar.update"].includes(interaction.type)&&disposeView();break;case"viewClosed":interaction&&"errors"!==interaction.type&&disposeView()}},disposeView,on,off}},UiKitMessageBlock=({rid,mid,blocks})=>{const contextValue=((rid,mid)=>{const{emitInteraction}=uiKit_useUiKitActionManager();return{action:async({appId,actionId,blockId,value})=>{await emitInteraction(appId,{type:"blockAction",actionId,payload:{blockId,value},container:{type:"message",id:mid},rid,mid})},rid,values:{}}})(rid,mid);return(0,emotion_react_browser_esm.tZ)(UiKitContext_a.Provider,{value:contextValue,mid},(0,emotion_react_browser_esm.tZ)(UiKitComponent_r,{render:surfaces_c,blocks}))};UiKitMessageBlock.displayName="UiKitMessageBlock",UiKitMessageBlock.__docgenInfo={description:"",methods:[],displayName:"UiKitMessageBlock"};const uiKit_UiKitMessageBlock=UiKitMessageBlock,hooks_useFetchChatData=showRoles=>{const{RCInstance,ECOptions}=(0,react.useContext)(context_RCInstance),setMemberRoles=memberStore((state=>state.setMemberRoles)),isChannelPrivate=channelStore((state=>state.isChannelPrivate)),setMessages=messageStore((state=>state.setMessages)),setAdmins=memberStore((state=>state.setAdmins)),setStarredMessages=starredMessageStore((state=>state.setStarredMessages)),isUserAuthenticated=userStore((state=>state.isUserAuthenticated)),getMessagesAndRoles=(0,react.useCallback)((async anonymousMode=>{try{if(!isUserAuthenticated&&!anonymousMode)return;const{messages}=await RCInstance.getMessages(anonymousMode,ECOptions?.enableThreads?{query:{tmid:{$exists:!1}}}:void 0,!anonymousMode&&isChannelPrivate);if(messages&&setMessages(messages.filter((message=>!0!==message._hidden))),!isUserAuthenticated)return;if(showRoles){const{roles}=await RCInstance.getChannelRoles(isChannelPrivate),fetchedAdmins=await RCInstance.getUsersInRole("admin"),adminUsernames=fetchedAdmins?.users?.map((user=>user.username));setAdmins(adminUsernames);const rolesObj=roles?.length>0?roles.reduce(((obj,item)=>({...obj,[item.u.username]:item})),{}):{};setMemberRoles(rolesObj)}}catch(e){console.error(e)}}),[isUserAuthenticated,RCInstance,ECOptions?.enableThreads,isChannelPrivate,showRoles,setMessages,setAdmins,setMemberRoles]),getStarredMessages=(0,react.useCallback)((async anonymousMode=>{if(isUserAuthenticated)try{if(!isUserAuthenticated&&!anonymousMode)return;const{messages}=await RCInstance.getStarredMessages();setStarredMessages(messages)}catch(e){console.error(e)}}),[isUserAuthenticated,RCInstance,setStarredMessages]);return{getMessagesAndRoles,getStarredMessages}};function Message_extends(){return Message_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{const{classNames,styleOverrides,variantOverrides}=useComponentOverrides_l("Message",[message.messageParentBox,className],style),{RCInstance,ECOptions}=(0,react.useContext)(context_RCInstance);showAvatar=ECOptions?.showAvatar&&showAvatar;const{showSidebar,setShowSidebar}=sidebarStore(),authenticatedUserId=userStore((state=>state.userId)),authenticatedUserUsername=userStore((state=>state.username)),userRoles=userStore((state=>state.roles)),pinPermissions=userStore((state=>state.userPinPermissions.roles)),editMessagePermissions=messageStore((state=>state.editMessagePermissions.roles)),[setMessageToReport,toggleShowReportMessage]=messageStore((state=>[state.setMessageToReport,state.toggleShowReportMessage])),addQuoteMessage=messageStore((state=>state.addQuoteMessage)),openThread=messageStore((state=>state.openThread)),{getStarredMessages}=hooks_useFetchChatData(),dispatchToastMessage=useToastBarDispatch_r(),{editMessage,setEditMessage}=messageStore((state=>({editMessage:state.editMessage,setEditMessage:state.setEditMessage}))),isMe=message.u._id===authenticatedUserId,styles=(({theme,mode})=>({main:(0,emotion_react_browser_esm.iv)("display:flex;flex-direction:row;align-items:flex-start;padding-top:0.5rem;padding-bottom:0.25rem;padding-left:2.25rem;padding-right:2.25rem;color:",theme.colors.foreground,";&:hover{background-color:","light"===mode?color_e(theme.colors.background,.03):color_r(theme.colors.background,1),";}",""),messageEditing:(0,emotion_react_browser_esm.iv)("background-color:",theme.colors.secondary,";&:hover{background-color:",theme.colors.secondary,";}",""),pendingMessageBody:_ref8}))(useTheme_i()),bubbleStyles=BubbleVariant_useBubbleStyles(isMe),pinRoles=new Set(pinPermissions),editMessageRoles=new Set(editMessagePermissions),variantStyles=isInSidebar||"bubble"!==variantOverrides?{}:bubbleStyles,handleEmojiClick=async(e,msg,canReact)=>{const emoji=(e.names?.[0]||e.name).replace(/\s/g,"_");await RCInstance.reactToMessage(emoji,msg._id,canReact)},handleOpenThread=msg=>async()=>{openThread(msg),setShowSidebar(!1)},isStarred=message.starred?.find((u=>u._id===authenticatedUserId)),isPinned=message.pinned,shouldShowHeader=!sequential||!showAvatar&&isStarred;return(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Box_n,{className:appendClassNames_a("ec-message",classNames),css:[variantStyles.messageParent||styles.main,editMessage._id===message._id&&styles.messageEditing,"",""],style:styleOverrides},showAvatar&&(0,emotion_react_browser_esm.tZ)(Message_MessageAvatarContainer,{message,sequential,isStarred,isPinned}),(0,emotion_react_browser_esm.tZ)(Message_MessageBodyContainer,{variantStyles},shouldShowHeader&&(0,emotion_react_browser_esm.tZ)(Message_MessageHeader,Message_extends({message,isRoles:showRoles},variantStyles?.name?.includes("bubble")&&{showDisplayName:!isMe})),message.t?(0,emotion_react_browser_esm.tZ)(react.Fragment,null,message.attachments&&(0,emotion_react_browser_esm.tZ)(AttachmentHandler_Attachments,{attachments:message.attachments,type:message.t,variantStyles})):(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(MessageBody,{className:"ec-message-body",id:`ec-message-body-${message._id}`,css:message.isPending&&styles.pendingMessageBody,variantStyles,isText:!!message.md,sequential,lastSequential},message.attachments&&message.attachments.length>0?(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Markdown_Markdown,{body:message,isReaction:!1}),(0,emotion_react_browser_esm.tZ)(AttachmentHandler_Attachments,{attachments:message.attachments,variantStyles})):(0,emotion_react_browser_esm.tZ)(Markdown_Markdown,{body:message,isReaction:!1}),message.blocks&&(0,emotion_react_browser_esm.tZ)(uiKit_UiKitMessageBlock,{rid:RCInstance.rid,mid:message._id,blocks:message.blocks}),!message.t&&showToolbox?(0,emotion_react_browser_esm.tZ)(MessageToolbox,{message,isEditing:editMessage._id===message._id,authenticatedUserId,userRoles,pinRoles,editMessageRoles,handleCopyMessage:async msg=>{navigator.clipboard.writeText(msg.msg).then((()=>{dispatchToastMessage({type:"success",message:"Message copied successfully"})})).catch((()=>{dispatchToastMessage({type:"error",message:"Error in copying message"})}))},handleCopyMessageLink:async msg=>{try{const messageLink=await(async id=>`${await RCInstance.getHost()}/channel/${(await RCInstance.channelInfo()).room.name}/?msg=${id}`)(msg._id);await navigator.clipboard.writeText(messageLink),dispatchToastMessage({type:"success",message:"Message link copied successfully"})}catch(err){dispatchToastMessage({type:"error",message:"Error in copying message link"})}},handleOpenThread,handleDeleteMessage:async msg=>{(await RCInstance.deleteMessage(msg._id)).success?dispatchToastMessage({type:"success",message:"Message deleted successfully"}):dispatchToastMessage({type:"error",message:"Error in deleting message"})},handleStarMessage:async msg=>{const isStarred=msg.starred&&msg.starred.find((u=>u._id===authenticatedUserId));isStarred?(await RCInstance.unstarMessage(msg._id),dispatchToastMessage({type:"success",message:"Message unstarred"})):(await RCInstance.starMessage(msg._id),dispatchToastMessage({type:"success",message:"Message starred"})),getStarredMessages()},handlePinMessage:async msg=>{const isPinned=msg.pinned;(isPinned?await RCInstance.unpinMessage(msg._id):await RCInstance.pinMessage(msg._id)).error?dispatchToastMessage({type:"error",message:"Error pinning message"}):dispatchToastMessage({type:"success",message:isPinned?"Message unpinned":"Message pinned"})},handleEditMessage:()=>{editMessage._id===message._id?setEditMessage({}):setEditMessage(message)},handleQuoteMessage:()=>addQuoteMessage(message),handleEmojiClick,handlerReportMessage:()=>{setMessageToReport(message._id),toggleShowReportMessage()},isThreadMessage:"thread"===type,variantStyles}):(0,emotion_react_browser_esm.tZ)(react.Fragment,null)),isLinkPreview&&message.urls&&message.urls.map(((url,index)=>url.meta&&(0,emotion_react_browser_esm.tZ)(LinkPreview_LinkPreview,Message_extends({key:index,url:url.url,meta:url.meta},variantStyles?.name?.includes("bubble")&&{showDropdown:!1})))),(0,emotion_react_browser_esm.tZ)(MessageReactions,{authenticatedUserUsername,message,handleEmojiClick})),message.tcount&&"thread"!==type?(0,emotion_react_browser_esm.tZ)(MessageMetrics,{message,handleOpenThread,variantStyles}):null)),newDay&&(0,emotion_react_browser_esm.tZ)(MessageDivider,null,(0,format.Z)(new Date(message.ts),"MMMM d, yyyy")))};Message.propTypes={message:prop_types_default().any,sequential:prop_types_default().bool,newDay:prop_types_default().bool,type:prop_types_default().oneOf(["thread","default"]),showAvatar:prop_types_default().bool},Message.__docgenInfo={description:"",methods:[],displayName:"Message",props:{type:{defaultValue:{value:"'default'",computed:!1},description:"",type:{name:"enum",value:[{value:"'thread'",computed:!1},{value:"'default'",computed:!1}]},required:!1},sequential:{defaultValue:{value:"false",computed:!1},description:"",type:{name:"bool"},required:!1},lastSequential:{defaultValue:{value:"false",computed:!1},required:!1},newDay:{defaultValue:{value:"false",computed:!1},description:"",type:{name:"bool"},required:!1},showAvatar:{defaultValue:{value:"false",computed:!1},description:"",type:{name:"bool"},required:!1},className:{defaultValue:{value:"''",computed:!1},required:!1},style:{defaultValue:{value:"{}",computed:!1},required:!1},showToolbox:{defaultValue:{value:"true",computed:!1},required:!1},showRoles:{defaultValue:{value:"true",computed:!1},required:!1},isLinkPreview:{defaultValue:{value:"true",computed:!1},required:!1},isInSidebar:{defaultValue:{value:"false",computed:!1},required:!1},message:{description:"",type:{name:"any"},required:!1}}};const Message_Message=(0,react.memo)(Message);var NoMessageIndicator_ref={name:"ma72jq",styles:"font-size:1.2rem;font-weight:bold"},NoMessageIndicator_ref2={name:"m1a2da",styles:"padding:0.5rem"};const NoMessagesIndicator=({iconName,message})=>{const styles=MessageAggregator_styles();return(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.centerColumnStyles},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:iconName,size:"3rem",css:NoMessageIndicator_ref2}),(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:NoMessageIndicator_ref},message))};NoMessagesIndicator.displayName="NoMessagesIndicator",NoMessagesIndicator.__docgenInfo={description:"",methods:[],displayName:"NoMessagesIndicator"};const NoMessageIndicator=NoMessagesIndicator;const fileMetricsStyles={metrics:{name:"dqreg2",styles:"display:flex;margin-left:-0.25rem;margin-right:-0.25rem;margin-inline:-0.25rem;margin-top:0.5rem"},metricsItem:{name:"mgt8no",styles:"letter-spacing:0rem;font-size:0.625rem;font-weight:700;line-height:0.75rem;display:flex;justify-content:center;align-items:center;margin-left:0.25rem"},metricsItemLabel:{name:"rgv2oo",styles:"margin:0.25rem;margin-inline-start:0.25rem;white-space:nowrap"}},filePreviewContainerStyles={previewContainer:{name:"7w8you",styles:"margin:3px;width:2.25em;max-height:2.25em;display:flex;justify-content:flex-end"}},filePreviewHeaderStyles={previewHeader:{name:"xe677o",styles:"display:flex;overflow-x:hidden;flex-direction:row;flex-grow:0;flex-shrink:1;min-width:1px;padding-right:3px;margin-top:0.125rem;margin-bottom:0.125rem;margin-block:0.125rem;gap:0.125rem;align-items:center;max-width:85%"},previewHeaderName:{name:"1dnn6wq",styles:"letter-spacing:0rem;display:inline-block;font-size:0.875rem;font-weight:700;line-height:1.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:1"},previewHeaderTimestap:{name:"1vd1naz",styles:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:0rem;font-size:0.75rem;font-weight:400;line-height:1rem;flex-shrink:0"}},fileDisplayStyles={message:{name:"dhg0h1",styles:"display:flex;position:relative;flex-direction:row;align-items:flex-start;justify-content:space-around;padding-top:0.5rem;-webkit-padding-before:0.5rem;padding-block-start:0.5rem;padding-bottom:0.25rem;-webkit-padding-after:0.25rem;padding-block-end:0.25rem;padding-left:1.25rem;padding-right:1.25rem;padding-inline:1.25rem;cursor:pointer"},previewUsername:{name:"3sbxdf",styles:"letter-spacing:0rem;font-size:0.875rem;font-weight:400;line-height:1.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:1"},modalContent:{name:"1m5h7rb",styles:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 0.5rem 0.5rem"},centeredColumnStyles:{name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"}},FilePreviewContainer=({file})=>(0,emotion_react_browser_esm.tZ)(Box_n,{css:filePreviewContainerStyles.previewContainer},(0,emotion_react_browser_esm.tZ)(Avatar_p,{url:file?.url,fallbackIcon:"attachment",size:"2.25em"}));FilePreviewContainer.displayName="FilePreviewContainer",FilePreviewContainer.__docgenInfo={description:"",methods:[],displayName:"FilePreviewContainer"};const FileMessage_FilePreviewContainer=FilePreviewContainer,FilePreviewHeader=({file,isTimeStamped=!0})=>{const{styleOverrides,classNames}=useComponentOverrides_l("MessageHeader"),authenticatedUserId=userStore((state=>state.userId)),isStarred=file?.starred&&file?.starred?.find((u=>u._id===authenticatedUserId));return(0,emotion_react_browser_esm.tZ)(Box_n,{css:filePreviewHeaderStyles.previewHeader,className:appendClassNames_a("ec-file-header",classNames),style:styleOverrides},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:filePreviewHeaderStyles.previewHeaderName,className:appendClassNames_a("ec-file-header-name")},file?.name),isTimeStamped&&(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:filePreviewHeaderStyles.previewHeaderTimestap,className:appendClassNames_a("ec-file-header-timestamp")},(0,format.Z)(new Date(file?.ts),"h:mm a")),isStarred?(0,emotion_react_browser_esm.tZ)(Icon_a,{style:{marginInlineEnd:"0.4rem",opacity:.5},name:"star-filled",size:"1em"}):null)};FilePreviewHeader.displayName="FilePreviewHeader",FilePreviewHeader.__docgenInfo={description:"",methods:[],displayName:"FilePreviewHeader",props:{isTimeStamped:{defaultValue:{value:"true",computed:!1},required:!1},file:{description:"",type:{name:"any"},required:!1}}};const FileMessage_FilePreviewHeader=FilePreviewHeader;function FileMetrics_extends(){return FileMetrics_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{const{styleOverrides,classNames}=useComponentOverrides_l("FileMetrics",className,style);return(0,emotion_react_browser_esm.tZ)(Box_n,FileMetrics_extends({css:fileMetricsStyles.metrics,className:appendClassNames_a("ec-file-metrics",classNames),style:styleOverrides},props),(0,emotion_react_browser_esm.tZ)(Box_n,{css:fileMetricsStyles.metricsItem,title:new Date(file?.uploadedAt).toLocaleString()},(0,emotion_react_browser_esm.tZ)(Icon_a,{size:"1.25rem",name:"clock"}),(0,emotion_react_browser_esm.tZ)(Box_n,{css:fileMetricsStyles.metricsItemLabel},(0,formatDistance.Z)(new Date(file?.uploadedAt),new Date,{addSuffix:!0}))))};FileMetrics.displayName="FileMetrics",FileMetrics.__docgenInfo={description:"",methods:[],displayName:"FileMetrics",props:{className:{defaultValue:{value:"''",computed:!1},required:!1},style:{defaultValue:{value:"{}",computed:!1},required:!1}}};const FileMessage=({fileMessage})=>{const{classNames,styleOverrides}=useComponentOverrides_l("FileMessage"),dispatchToastMessage=useToastBarDispatch_r(),{RCInstance}=useRCContext(),messages=messageStore((state=>state.messages)),[fileToDelete,setFileToDelete]=(0,react.useState)({}),downloadFile=(0,react.useCallback)(((url,title)=>{const anchor=document.createElement("a");anchor.href=url,anchor.download=title,document.body.appendChild(anchor),anchor.click(),document.body.removeChild(anchor)}),[]),deleteFile=(0,react.useCallback)((async file=>{messages.forEach((async message=>{if(message.file?._id===file._id){const res=await RCInstance.deleteMessage(message._id);setFileToDelete({}),res.success?dispatchToastMessage({type:"success",message:"File deleted"}):dispatchToastMessage({type:"error",message:"Error in deleting file"})}}))}),[messages,RCInstance,dispatchToastMessage]),handleOnClose=()=>{setFileToDelete({})};return(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Box_n,{className:appendClassNames_a("ec-file",classNames),style:styleOverrides,css:fileDisplayStyles.message},(0,emotion_react_browser_esm.tZ)(FileMessage_FilePreviewContainer,{file:fileMessage}),(0,emotion_react_browser_esm.tZ)(Message_MessageBodyContainer,{style:{width:"75%"}},(0,emotion_react_browser_esm.tZ)(FileMessage_FilePreviewHeader,{file:fileMessage,isTimeStamped:!1}),(0,emotion_react_browser_esm.tZ)(MessageBody,null,(0,emotion_react_browser_esm.tZ)(Box_n,{css:fileDisplayStyles.previewUsername},"@",fileMessage.user?.username)),(0,emotion_react_browser_esm.tZ)(FileMetrics,{file:fileMessage})),(0,emotion_react_browser_esm.tZ)(Menu_o,{isToolTip:!1,options:[{id:"download",action:()=>downloadFile(fileMessage?.url,fileMessage?.title),label:"Download",icon:"circle-arrow-down"},{id:"delete",action:()=>setFileToDelete(fileMessage),label:"Delete",icon:"trash"}]})),fileToDelete&&Object.keys(fileToDelete).length>0&&(0,emotion_react_browser_esm.tZ)(v,{onClose:handleOnClose},(0,emotion_react_browser_esm.tZ)(v.Header,null,(0,emotion_react_browser_esm.tZ)(v.Title,null,(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"trash",size:"1.25rem",style:{marginRight:"0.5rem"}}),"Are you sure?"),(0,emotion_react_browser_esm.tZ)(v.Close,{onClick:handleOnClose})),(0,emotion_react_browser_esm.tZ)(v.Content,{css:fileDisplayStyles.modalContent},"Deleting a file will delete it forever. This cannot be undone."),(0,emotion_react_browser_esm.tZ)(v.Footer,null,(0,emotion_react_browser_esm.tZ)(Button_c,{type:"secondary",onClick:handleOnClose},"Cancel"),(0,emotion_react_browser_esm.tZ)(Button_c,{type:"destructive",onClick:()=>deleteFile(fileToDelete)},"Delete"))))};FileMessage.propTypes={fileMessage:prop_types_default().any.isRequired},FileMessage.__docgenInfo={description:"",methods:[],displayName:"FileMessage",props:{fileMessage:{description:"",type:{name:"any"},required:!0}}};const FileMessage_FileMessage=(0,react.memo)(FileMessage);function MessageAggregator_extends(){return MessageAggregator_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{const{theme}=useTheme_i(),styles=MessageAggregator_styles(theme),setExclusiveState=hooks_useSetExclusiveState(),messages=messageStore((state=>state.messages)),threadMessages=messageStore((state=>state.threadMessages))||[],allMessages=(0,react.useMemo)((()=>[...messages,...threadMessages]),[messages,threadMessages]),[messageRendered,setMessageRendered]=(0,react.useState)(!1),{loading,messageList}=((messages,shouldRender)=>{const[loading,setLoading]=(0,react.useState)(!0),messageList=(0,react.useMemo)((()=>messages.filter(shouldRender)),[messages,shouldRender]);return(0,react.useEffect)((()=>{setLoading(!1)}),[messages,shouldRender]),{loading,messageList}})(fetchedMessageList||searchFiltered||allMessages,shouldRender),setShowSidebar=sidebarStore((state=>state.setShowSidebar)),noMessages=0===messageList?.length||!messageRendered,ViewComponent="Popup"===viewType?Popup_i:Sidebar_n;return(0,emotion_react_browser_esm.tZ)(ViewComponent,MessageAggregator_extends({title,iconName,searchProps,onClose:()=>setExclusiveState(null),style:{width:"400px",padding:0,zIndex:window.innerWidth<=780?1:null}},"Popup"===viewType?{isPopupHeader:!0}:{}),fetching||loading?(0,emotion_react_browser_esm.tZ)(common_LoadingIndicator,null):(0,emotion_react_browser_esm.tZ)(Box_n,{css:[styles.listContainerStyles,noMessages&&styles.noMessageStyles,"",""]},noMessages&&(0,emotion_react_browser_esm.tZ)(NoMessageIndicator,{iconName,message:noMessageInfo}),messageList.map(((msg,index,arr)=>{const newDay=(current=msg,!(previous=arr[index-1])||shouldRender(previous)||!(0,isSameDay.Z)(new Date(current.ts),new Date(previous.ts)));var current,previous;return!messageRendered&&shouldRender(msg)&&setMessageRendered(!0),(0,emotion_react_browser_esm.tZ)(react.Fragment,{key:msg._id},"message"===type&&newDay&&(0,emotion_react_browser_esm.tZ)(MessageDivider,null,(0,format.Z)(new Date(msg.ts),"MMMM d, yyyy")),"file"===type?(0,emotion_react_browser_esm.tZ)(FileMessage_FileMessage,{key:`${msg._id}-aggregated`,fileMessage:msg}):(0,emotion_react_browser_esm.tZ)(Box_n,{position:"relative",style:{display:"flex"}},(0,emotion_react_browser_esm.tZ)(Message_Message,{key:`${msg._id}-aggregated`,message:msg,newDay:!1,type:"default",showAvatar:!0,showToolbox:!1,showRoles:!1,isInSidebar:!0,style:{flex:1,padding:0,marginLeft:"15px",minWidth:0}}),(0,emotion_react_browser_esm.tZ)(ActionButton_l,{square:!0,ghost:!0,onClick:()=>(msgId=>{if(msgId){const element=document.getElementById(`ec-message-body-${msgId}`);element&&(setShowSidebar(!1),element.scrollIntoView({behavior:"smooth",block:"center"}))}})(msg._id),css:MessageAggregator_ref},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"arrow-back",size:"1.25rem"}))))}))))};MessageAggregator.displayName="MessageAggregator",MessageAggregator.__docgenInfo={description:"",methods:[],displayName:"MessageAggregator",props:{type:{defaultValue:{value:"'message'",computed:!1},required:!1},viewType:{defaultValue:{value:"'Sidebar'",computed:!1},required:!1}}};const MentionedMessages=()=>{const authenticatedUserId=userStore((state=>state.userId)),{variantOverrides}=useComponentOverrides_l("MentionedMessages"),viewType=variantOverrides.viewType||"Sidebar";return(0,emotion_react_browser_esm.tZ)(MessageAggregator,{title:"Mentions",iconName:"at",noMessageInfo:"No mentions found",shouldRender:msg=>msg.mentions&&msg.mentions.some((star=>star._id===authenticatedUserId)),viewType})};MentionedMessages.displayName="MentionedMessages",MentionedMessages.__docgenInfo={description:"",methods:[],displayName:"MentionedMessages"};const MessageAggregators_MentionedMessages=MentionedMessages,ThreadedMessages=()=>{const messages=messageStore((state=>state.messages)),{variantOverrides}=useComponentOverrides_l("ThreadedMessages"),viewType=variantOverrides.viewType||"Sidebar",[text,setText]=(0,react.useState)(""),searchFiltered=(0,react.useMemo)((()=>messages.filter((message=>message.msg?.toLowerCase().includes(text.toLowerCase())))),[messages,text]);return(0,emotion_react_browser_esm.tZ)(MessageAggregator,{title:"Threads",iconName:"thread",noMessageInfo:"No threads found",searchProps:{isSearch:!0,handleInputChange:e=>{setText(e.target.value)},placeholder:"Search Threads"},searchFiltered,shouldRender:msg=>!msg.t&&msg.tcount,viewType})};ThreadedMessages.displayName="ThreadedMessages",ThreadedMessages.__docgenInfo={description:"",methods:[],displayName:"ThreadedMessages"};const MessageAggregators_ThreadedMessages=ThreadedMessages,StarredMessages=()=>{const authenticatedUserId=userStore((state=>state.userId)),{variantOverrides}=useComponentOverrides_l("StarredMessages"),viewType=variantOverrides.viewType||"Sidebar",starredMessages=starredMessageStore((state=>state.starredMessages)),shouldRender=(0,react.useCallback)((msg=>msg.starred&&msg.starred.some((star=>star._id===authenticatedUserId))),[authenticatedUserId]);return(0,emotion_react_browser_esm.tZ)(MessageAggregator,{title:"Starred Messages",iconName:"star",noMessageInfo:"No Starred Messages",fetchedMessageList:starredMessages,shouldRender,viewType})};StarredMessages.displayName="StarredMessages",StarredMessages.__docgenInfo={description:"",methods:[],displayName:"StarredMessages"};const MessageAggregators_StarredMessages=StarredMessages,PinnedMessages=()=>{const{variantOverrides}=useComponentOverrides_l("PinnedMessages"),viewType=variantOverrides.viewType||"Sidebar";return(0,emotion_react_browser_esm.tZ)(MessageAggregator,{title:"Pinned Messages",iconName:"pin",noMessageInfo:"No Pinned Messages",shouldRender:msg=>msg.pinned,viewType})};PinnedMessages.displayName="PinnedMessages",PinnedMessages.__docgenInfo={description:"",methods:[],displayName:"PinnedMessages"};const MessageAggregators_PinnedMessages=PinnedMessages;var debounce=__webpack_require__("../../node_modules/lodash/debounce.js"),debounce_default=__webpack_require__.n(debounce);const SearchMessages=()=>{const{variantOverrides}=useComponentOverrides_l("SearchMessages"),viewType=variantOverrides.viewType||"Sidebar",{RCInstance}=(0,react.useContext)(context_RCInstance),[text,setText]=(0,react.useState)(""),[messageList,setMessageList]=(0,react.useState)([]),searchMessages=(0,react.useCallback)((async()=>{const{messages}=await RCInstance.getSearchMessages(text);setMessageList(messages)}),[text,RCInstance]),debouncedSearch=(0,react.useCallback)(debounce_default()((async()=>{await searchMessages()}),500),[searchMessages]);return(0,react.useEffect)((()=>(text.trim()?debouncedSearch():messageList.length>0&&setMessageList([]),()=>{debouncedSearch.cancel()})),[text,debouncedSearch,messageList.length]),(0,emotion_react_browser_esm.tZ)(MessageAggregator,{title:"Search Messages",iconName:"magnifier",noMessageInfo:"No results found",searchProps:{isSearch:!0,handleInputChange:e=>{setText(e.target.value)},placeholder:"Search Messages"},searchFiltered:messageList,shouldRender:msg=>!!msg,viewType})};SearchMessages.displayName="SearchMessages",SearchMessages.__docgenInfo={description:"",methods:[],displayName:"SearchMessages"};const MessageAggregators_SearchMessages=SearchMessages,FileGallery=()=>{const{RCInstance}=useRCContext(),{variantOverrides}=useComponentOverrides_l("FileGallery"),viewType=variantOverrides.viewType||"Sidebar",isChannelPrivate=channelStore((state=>state.isChannelPrivate)),messages=messageStore((state=>state.messages)),[text,setText]=(0,react.useState)(""),[isFetching,setIsFetching]=(0,react.useState)(!0),[files,setFiles]=(0,react.useState)([]),filteredFiles=(0,react.useMemo)((()=>files.filter((file=>file.name?.toLowerCase().includes(text.toLowerCase())))),[files,text]);return(0,react.useEffect)((()=>{(async()=>{const res=await RCInstance.getAllFiles(isChannelPrivate);if(res?.files){const sortedFiles=res.files.sort(((a,b)=>new Date(b.uploadedAt)-new Date(a.uploadedAt)));setFiles(sortedFiles),setIsFetching(!1)}})()}),[RCInstance,isChannelPrivate,messages]),(0,emotion_react_browser_esm.tZ)(MessageAggregator,{title:"Files",iconName:"attachment",noMessageInfo:"No Files Found",searchProps:{isSearch:!0,handleInputChange:e=>{setText(e.target.value)},placeholder:"Search Files"},fetching:isFetching,shouldRender:file=>file.path,type:"file",searchFiltered:filteredFiles,viewType})};FileGallery.displayName="FileGallery",FileGallery.__docgenInfo={description:"",methods:[],displayName:"FileGallery"};const MessageAggregators_FileGallery=FileGallery;function RoomInformation_extends(){return RoomInformation_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{const{RCInstance}=(0,react.useContext)(context_RCInstance),channelInfo=channelStore((state=>state.channelInfo)),{variantOverrides}=useComponentOverrides_l("RoomMember"),viewType=variantOverrides.viewType||"Sidebar",setExclusiveState=hooks_useSetExclusiveState(),ViewComponent="Popup"===viewType?Popup_i:Sidebar_n;return(0,emotion_react_browser_esm.tZ)(ViewComponent,RoomInformation_extends({title:"Room Information",iconName:"info",onClose:()=>setExclusiveState(null),style:{width:"400px",zIndex:window.innerWidth<=780?1:null}},"Popup"===viewType?{isPopupHeader:!0}:{}),(0,emotion_react_browser_esm.tZ)(Box_n,{css:RoomInformation_ref5},(0,emotion_react_browser_esm.tZ)(Avatar_p,{size:"100%",url:(channelname=channelInfo.name,`${RCInstance.getHost()}/avatar/${channelname}`)}),(0,emotion_react_browser_esm.tZ)(Box_n,{css:RoomInformation_ref4},(0,emotion_react_browser_esm.tZ)(Box_n,{css:RoomInformation_ref3},"# ",channelInfo.name),(0,emotion_react_browser_esm.tZ)(Box_n,{css:RoomInformation_ref2},"Description"),(0,emotion_react_browser_esm.tZ)(Box_n,{css:RoomInformation_ref},channelInfo.description))));var channelname};Roominfo.displayName="Roominfo",Roominfo.__docgenInfo={description:"",methods:[],displayName:"Roominfo"};const RoomInformation=Roominfo,lib_formatTimestamp=timestamp=>{const date=new Date(timestamp),now=new Date,isDifferentDay=date.getDate()!==now.getDate()||date.getMonth()!==now.getMonth()||date.getFullYear()!==now.getFullYear(),formattedTime=date.toLocaleTimeString("en-US",{hour:"numeric",minute:"numeric",hour12:!0});return isDifferentDay?`${date.toLocaleDateString("en-US",{weekday:"long"})} ${formattedTime}`:formattedTime};var UserInfoField_ref={name:"42kn7d",styles:"opacity:0.5rem"},UserInfoField_ref2={name:"ydhdz3",styles:"margin-block:5px;font-weight:bold"},UserInfoField_ref3={name:"17hu0cb",styles:"margin-block:15px"};const UserInfoField=({label,value,isAdmin,authenticatedUserId,currentUserInfo})=>isAdmin||authenticatedUserId===currentUserInfo._id?(0,emotion_react_browser_esm.tZ)(Box_n,{css:UserInfoField_ref3},(0,emotion_react_browser_esm.tZ)(Box_n,{css:UserInfoField_ref2},label),(0,emotion_react_browser_esm.tZ)(Box_n,{css:UserInfoField_ref},value)):null;UserInfoField.__docgenInfo={description:"",methods:[],displayName:"UserInfoField"};const UserInformation_UserInfoField=UserInfoField;var UserInformation_styles_ref={name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"},UserInformation_styles_ref2={name:"pzbzdf",styles:"display:flex;align-items:center;gap:0.5rem;margin-block:5px"},UserInformation_styles_ref3={name:"1dv556l",styles:"display:flex;flex-wrap:wrap;gap:0.5rem;width:100%"},UserInformation_styles_ref4={name:"1n401ak",styles:"padding:0 1rem 1rem;margin:0 auto;overflow:auto"};const UserInformation_styles=theme=>({userSidebar:UserInformation_styles_ref4,roleContainer:UserInformation_styles_ref3,userRole:(0,emotion_react_browser_esm.iv)("letter-spacing:0rem;font-size:0.75rem;padding:0 0.25rem;margin:0 0.1rem;border-radius:",theme.radius,";font-weight:700;line-height:1rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:",theme.colors.secondary,";",""),emailContainer:UserInformation_styles_ref2,centeredColumnStyles:UserInformation_styles_ref});function UserInformation_extends(){return UserInformation_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{const{variantOverrides}=useComponentOverrides_l("UserInformation"),viewType=variantOverrides.viewType||"Sidebar",setExclusiveState=hooks_useSetExclusiveState(),{RCInstance}=(0,react.useContext)(context_RCInstance),{theme}=useTheme_i(),styles=UserInformation_styles(theme),[currentUserInfo,setCurrentUserInfo]=(0,react.useState)({}),[isUserInfoFetched,setIsUserInfoFetched]=(0,react.useState)(!1),[error,setError]=(0,react.useState)(null),[loader,setLoader]=(0,react.useState)(!0),currentUser=userStore((state=>state.currentUser)),authenticatedUserRoles=userStore((state=>state.roles)),authenticatedUserId=userStore((state=>state.userId)),isAdmin=authenticatedUserRoles?.includes("admin");(0,react.useEffect)((()=>{(async()=>{try{setError(null);const res=await RCInstance.userInfo(currentUser._id);if(!res?.user)throw new Error("User info not found");setCurrentUserInfo(res.user),setIsUserInfoFetched(!0),setLoader(!1)}catch(err){setLoader(!1),setError(`${err}`),console.error("Error fetching current user info",err)}})()}),[RCInstance,setCurrentUserInfo]);const ViewComponent="Popup"===viewType?Popup_i:Sidebar_n;return(0,emotion_react_browser_esm.tZ)(ViewComponent,UserInformation_extends({title:"User Info",iconName:"user",onClose:()=>setExclusiveState(null),style:{width:"400px",zIndex:window.innerWidth<=780?1:null}},"Popup"===viewType?{isPopupHeader:!0}:{}),(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.centeredColumnStyles},loader?(0,emotion_react_browser_esm.tZ)(Throbber_m,null):null),isUserInfoFetched?(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.userSidebar},(0,emotion_react_browser_esm.tZ)(Avatar_p,{size:"100%",url:(username=currentUserInfo.username,`${RCInstance.getHost()}/avatar/${username}`)}),(0,emotion_react_browser_esm.tZ)(Box_n,null,(0,emotion_react_browser_esm.tZ)(Box_n,{css:UserInformation_ref2},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:currentUserInfo.status,size:"1.25rem",style:{padding:"0.125em",marginRight:"0.5rem",alignSelf:"center"}}),currentUserInfo?.username),currentUserInfo?.roles?.length&&(0,emotion_react_browser_esm.tZ)(UserInformation_UserInfoField,{label:"Roles",value:(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.roleContainer},currentUserInfo?.roles?.map(((role,index)=>(0,emotion_react_browser_esm.tZ)(Box_n,{key:index,as:"span",css:styles.userRole,className:appendClassNames_a("ec-message-user-role")},"admin"===role?"admin":role)))),isAdmin,authenticatedUserId,currentUserInfo}),(0,emotion_react_browser_esm.tZ)(UserInformation_UserInfoField,{label:"Username",value:currentUserInfo?.username,isAdmin,authenticatedUserId,currentUserInfo}),(0,emotion_react_browser_esm.tZ)(UserInformation_UserInfoField,{label:"Last login",value:"rocket.cat"===currentUserInfo?.username?"Never":lib_formatTimestamp(currentUserInfo.lastLogin),isAdmin,authenticatedUserId,currentUserInfo}),(0,emotion_react_browser_esm.tZ)(UserInformation_UserInfoField,{label:"Full Name",value:currentUserInfo.name,isAdmin,authenticatedUserId,currentUserInfo}),(0,emotion_react_browser_esm.tZ)(UserInformation_UserInfoField,{label:"Email",value:currentUserInfo.emails?.map(((email,index)=>(0,emotion_react_browser_esm.tZ)(Box_n,{key:index,css:styles.emailContainer},(0,emotion_react_browser_esm.tZ)("a",{href:`mailto:${email.address}`,style:{textDecoration:"none",color:"inherit"}},email.address),(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.userRole},email.verified?"Verified":"Not Verified")))),isAdmin,authenticatedUserId,currentUserInfo}),(0,emotion_react_browser_esm.tZ)(UserInformation_UserInfoField,{label:"Created at",value:lib_formatTimestamp(currentUserInfo.createdAt),isAdmin,authenticatedUserId,currentUserInfo}))):(0,emotion_react_browser_esm.tZ)(Box_n,{css:UserInformation_ref},"Failed to load user Info",(0,emotion_react_browser_esm.tZ)("br",null),error));var username};UserInformation.displayName="UserInformation",UserInformation.__docgenInfo={description:"",methods:[],displayName:"UserInformation"};const UserInformation_UserInformation=UserInformation;var ReportWindowButtons_ref={name:"u7ytkp",styles:"margin-right:0.5rem"};const ReportWindowButtons=({children,reportDescription,messageId})=>{const[toggleReportMessage,setMessageToReport]=messageStore((state=>[state.toggleShowReportMessage,state.setMessageToReport])),{RCInstance}=(0,react.useContext)(context_RCInstance),dispatchToastMessage=useToastBarDispatch_r(),handleOnClose=()=>{toggleReportMessage(),setMessageToReport(NaN)};return(0,emotion_react_browser_esm.tZ)(v,{onClose:handleOnClose},(0,emotion_react_browser_esm.tZ)(v.Header,null,(0,emotion_react_browser_esm.tZ)(v.Title,null,(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"report",size:"1.25rem",css:ReportWindowButtons_ref}),"Report this message?"),(0,emotion_react_browser_esm.tZ)(v.Close,{onClick:handleOnClose})),(0,emotion_react_browser_esm.tZ)(v.Content,null,children),(0,emotion_react_browser_esm.tZ)(v.Footer,null,(0,emotion_react_browser_esm.tZ)(Button_c,{type:"secondary",onClick:handleOnClose},"Cancel"),(0,emotion_react_browser_esm.tZ)(Button_c,{onClick:async()=>{(await RCInstance.reportMessage(messageId,reportDescription)).success?dispatchToastMessage({type:"success",message:"Message reported successfully"}):dispatchToastMessage({type:"error",message:"Error in reporting message"}),handleOnClose()},type:"destructive"},"Report message")))};ReportWindowButtons.displayName="ReportWindowButtons",ReportWindowButtons.propTypes={children:prop_types_default().object.isRequired,reportDescription:prop_types_default().string.isRequired,messageId:prop_types_default().string.isRequired},ReportWindowButtons.__docgenInfo={description:"",methods:[],displayName:"ReportWindowButtons",props:{children:{description:"",type:{name:"object"},required:!0},reportDescription:{description:"",type:{name:"string"},required:!0},messageId:{description:"",type:{name:"string"},required:!0}}};const ReportMessage_ReportWindowButtons=ReportWindowButtons;const ReportMessage_styles={conatiner:{name:"d53rwt",styles:"display:flex;justify-content:center;margin-bottom:0.125rem;padding:0.6rem 0.4rem"}},MessageReportWindow=({messageId})=>{const[reportDescription,setDescription]=(0,react.useState)("");return(0,emotion_react_browser_esm.tZ)(ReportMessage_ReportWindowButtons,{variant:"danger",title:"Report_this_message_question_mark",confirmText:"Report!",cancelText:"Cancel",reportDescription,messageId},(0,emotion_react_browser_esm.tZ)(Box_n,{css:ReportMessage_styles.conatiner},(0,emotion_react_browser_esm.tZ)(Input_c,{textArea:!0,placeholder:"Why do you want to report this message?",onChange:e=>{setDescription(e.target.value)}})))};MessageReportWindow.displayName="MessageReportWindow",MessageReportWindow.__docgenInfo={description:"",methods:[],displayName:"MessageReportWindow",props:{messageId:{description:"",type:{name:"string"},required:!0}}};const ReportMessage_MessageReportWindow=MessageReportWindow;MessageReportWindow.propTypes={messageId:prop_types_default().string.isRequired};var differenceInSeconds=__webpack_require__("../../node_modules/date-fns/esm/differenceInSeconds/index.js");const lib_isMessageSequential=(current,previous,groupingRange)=>{if(!previous)return!1;if(current.t||previous.t)return!1;if(!1===current.groupable)return!1;if(current.u._id!==previous.u._id)return!1;if(current.alias!==previous.alias)return!1;const isTimeDiffSmall=(0,differenceInSeconds.Z)(new Date(current.ts),new Date(previous.ts))!next||(current.u._id!==next.u._id||!lib_isMessageSequential(next,current,300));var MessageList_ref={name:"193h5r6",styles:"text-align:center;margin:auto"};const MessageList=({messages})=>{const showReportMessage=messageStore((state=>state.showReportMessage)),messageToReport=messageStore((state=>state.messageToReport)),isMessageLoaded=messageStore((state=>state.isMessageLoaded));return(0,emotion_react_browser_esm.tZ)(react.Fragment,null,0===messages.length?(0,emotion_react_browser_esm.tZ)(Box_n,{css:MessageList_ref},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"thread",size:"2rem"}),(0,emotion_react_browser_esm.tZ)(Box_n,null,isMessageLoaded?"No messages":"Ready to chat? Login now to join the fun.")):(0,emotion_react_browser_esm.tZ)(react.Fragment,null,messages.map(((msg,index,arr)=>{const prev=arr[index+1],next=arr[index-1];if(!msg)return null;const newDay=(current=msg,!(previous=prev)||!(0,isSameDay.Z)(new Date(current.ts),new Date(previous.ts)));var current,previous;const sequential=lib_isMessageSequential(msg,prev,300),lastSequential=sequential&&lib_isMessageLastSequential(msg,next);return(0,emotion_react_browser_esm.tZ)(Message_Message,{key:msg._id,message:msg,newDay,sequential,lastSequential,type:"default",showAvatar:!0})})),showReportMessage&&(0,emotion_react_browser_esm.tZ)(ReportMessage_MessageReportWindow,{messageId:messageToReport})))};MessageList.propTypes={messages:prop_types_default().arrayOf(prop_types_default().shape)},MessageList.__docgenInfo={description:"",methods:[],displayName:"MessageList",props:{messages:{description:"",type:{name:"arrayOf",value:{name:"custom",raw:"PropTypes.shape"}},required:!1}}};const MessageList_MessageList=MessageList;var TwoFactorTotpModal_ref={name:"bzr2wb",styles:"display:flex;padding:0.6rem 0.4rem"};function TotpModal({handleLogin}){const[accessCode,setAccessCode]=(0,react.useState)(null),isTotpModalOpen=totpmodalStore((state=>state.isTotpModalOpen)),setIsTotpModalOpen=totpmodalStore((state=>state.setIsTotpModalOpen)),password=userStore((state=>state.password)),emailoruser=userStore((state=>state.emailoruser)),handleClose=()=>{setIsTotpModalOpen(!1)};return isTotpModalOpen?(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(GenericModal_l,{variant:"info",title:"Enter TOTP",icon:"key",onClose:handleClose},(0,emotion_react_browser_esm.tZ)(Box_n,null,(0,emotion_react_browser_esm.tZ)(Box_n,{css:TwoFactorTotpModal_ref},(0,emotion_react_browser_esm.tZ)(Input_c,{type:"password",onChange:e=>{setAccessCode(e.target.value)},placeholder:"123456"})),(0,emotion_react_browser_esm.tZ)(v.Footer,null,(0,emotion_react_browser_esm.tZ)(Button_c,{type:"secondary",onClick:handleClose},"Cancel"),(0,emotion_react_browser_esm.tZ)(Button_c,{type:"primary",onClick:e=>{e.preventDefault(),null!==password&&null!==emailoruser&&handleLogin(emailoruser,password,accessCode),setAccessCode(void 0)}},"Submit"))))):null}TotpModal.propTypes={handleLogin:prop_types_default().func},TotpModal.__docgenInfo={description:"",methods:[],displayName:"TotpModal",props:{handleLogin:{description:"",type:{name:"func"},required:!1}}};const useRCAuth=()=>{const{RCInstance}=(0,react.useContext)(context_RCInstance),setIsTotpModalOpen=totpmodalStore((state=>state.setIsTotpModalOpen)),setUserAvatarUrl=userStore((state=>state.setUserAvatarUrl)),setIsLoginModalOpen=loginStore((state=>state.setIsLoginModalOpen)),setAuthenticatedUserUsername=userStore((state=>state.setUsername)),setIsUserAuthenticated=userStore((state=>state.setIsUserAuthenticated)),setPassword=userStore((state=>state.setPassword)),setEmailorUser=userStore((state=>state.setEmailorUser)),setUserPinPermissions=userStore((state=>state.setUserPinPermissions)),setEditMessagePermissions=messageStore((state=>state.setEditMessagePermissions)),dispatchToastMessage=useToastBarDispatch_r();return{handleLogin:async(userOrEmail,password,code)=>{try{const res=await RCInstance.login(userOrEmail,password,code),permissions=await RCInstance.permissionInfo();"Unauthorized"===res.error||403===res.error?dispatchToastMessage({type:"error",message:"Invalid username or password. Please check your credentials and try again"}):("totp-required"===res.error?(setPassword(password),setEmailorUser(userOrEmail),setIsLoginModalOpen(!1),setIsTotpModalOpen(!0),dispatchToastMessage({type:"info",message:"Please Open your authentication app and enter the code."})):"totp-invalid"===res.error&&dispatchToastMessage({type:"error",message:"Invalid TOTP Time-based One-time Password."}),"success"===res.status&&(setIsLoginModalOpen(!1),setUserAvatarUrl(res.me.avatarUrl),setAuthenticatedUserUsername(res.me.username),setIsUserAuthenticated(!0),setIsTotpModalOpen(!1),setEmailorUser(null),setPassword(null),setUserPinPermissions(permissions.update[150]),setEditMessagePermissions(permissions.update[28]),dispatchToastMessage({type:"success",message:"Successfully logged in"})))}catch(e){console.error("A error occurred while setting up user",e)}}}};const LoginForm_styles={fieldContainer:{name:"ah3yq2",styles:"display:flex;flex-direction:column;padding:0.2rem"},fieldLabel:{name:"ait9iy",styles:"margin-top:0.125rem;margin-bottom:0.125rem;margin-block:0.125rem;letter-spacing:0rem;font-size:0.875rem;font-weight:500;line-height:1.25rem"},fieldRow:{name:"ddvebj",styles:"display:flex;flex-flow:row nowrap;justify-content:space-between;align-items:center;margin-top:0.25rem;-webkit-margin-before:0.25rem;margin-block-start:0.25rem;margin-bottom:0.125rem;-webkit-margin-after:0.125rem;margin-block-end:0.125rem"},passwordEye:{name:"i4ivcj",styles:"cursor:pointer;position:absolute;right:1em"}};var LoginForm_ref={name:"45bbqm",styles:"margin:10px 0"};function LoginForm(){const[userOrEmail,setUserOrEmail]=(0,react.useState)(null),[password,setPassword]=(0,react.useState)(null),[showPassword,setShowPassword]=(0,react.useState)(!1),[usernameError,setUsernameError]=(0,react.useState)(!1),[passwordError,setPasswordError]=(0,react.useState)(!1),isLoginModalOpen=loginStore((state=>state.isLoginModalOpen)),setIsLoginModalOpen=loginStore((state=>state.setIsLoginModalOpen)),{handleLogin}=useRCAuth(),{theme}=useTheme_i();(0,react.useEffect)((()=>{null!==userOrEmail&&""===userOrEmail.trim()?setUsernameError(!0):setUsernameError(!1),null!==password&&""===password.trim()?setPasswordError(!0):setPasswordError(!1)}),[userOrEmail,password]);const handleSubmit=()=>{userOrEmail||setUserOrEmail(""),password||setPassword(""),handleLogin(userOrEmail,password)},handleTogglePassword=()=>{setShowPassword(!showPassword)},handleKeyPress=event=>{"Enter"===event.key&&handleSubmit()},iconName=showPassword?"eyeopen":"eyeclose",fields=[{label:"Email or username",onChange:e=>{setUserOrEmail(e.target.value)},placeholder:"example@example.com",error:usernameError},{label:"Password",type:showPassword?"text":"password",onChange:e=>{setPassword(e.target.value)},error:passwordError}];return isLoginModalOpen?(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(GenericModal_l,{variant:"info",title:"Login",icon:"key",onClose:()=>{setUserOrEmail(null),setPassword(null),setIsLoginModalOpen(!1)}},(0,emotion_react_browser_esm.tZ)(Box_n,null,fields.map(((field,index)=>(0,emotion_react_browser_esm.tZ)(Box_n,{key:index,css:LoginForm_styles.fieldContainer},(0,emotion_react_browser_esm.tZ)(Box_n,{css:LoginForm_styles.fieldLabel},field.label),(0,emotion_react_browser_esm.tZ)(Box_n,{css:LoginForm_styles.fieldRow},(0,emotion_react_browser_esm.tZ)(Input_c,{type:field.type||"text",onChange:field.onChange,placeholder:field.placeholder,onKeyPress:handleKeyPress,style:{...field.error&&{borderColor:theme.colors.destructive,outline:"none"}}}),"Password"===field.label&&(0,emotion_react_browser_esm.tZ)(Box_n,{type:"button",css:LoginForm_styles.passwordEye,onClick:handleTogglePassword},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:iconName,size:"1.25rem"}))),field.error&&(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:(0,emotion_react_browser_esm.iv)("color:",theme.colors.destructive,";font-size:13px;","")},"This field is required")))),(0,emotion_react_browser_esm.tZ)(Button_c,{type:"primary",onClick:handleSubmit,css:LoginForm_ref},"Login")))):null}LoginForm.__docgenInfo={description:"",methods:[],displayName:"LoginForm"};const ThreadMessageList=({threadMessages,threadMainMessage})=>{const showReportMessage=messageStore((state=>state.showReportMessage)),messageToReport=messageStore((state=>state.messageToReport));return(0,emotion_react_browser_esm.tZ)(react.Fragment,null,threadMessages?.concat(threadMainMessage).map(((msg,index,arr)=>{const prev=arr[index+1],next=arr[index-1],newDay=(current=msg,!(previous=prev)||!(0,isSameDay.Z)(new Date(current.ts),new Date(previous.ts)));var current,previous;const sequential=lib_isMessageSequential(msg,prev,300),lastSequential=sequential&&lib_isMessageLastSequential(msg,next);return msg&&(0,emotion_react_browser_esm.tZ)(Message_Message,{key:msg._id,message:msg,newDay,sequential,lastSequential,type:"thread",showAvatar:!0})})),showReportMessage&&(0,emotion_react_browser_esm.tZ)(ReportMessage_MessageReportWindow,{messageId:messageToReport}))};ThreadMessageList.__docgenInfo={description:"",methods:[],displayName:"ThreadMessageList",props:{threadMessages:{description:"",type:{name:"arrayOf",value:{name:"object"}},required:!1},threadMainMessage:{description:"",type:{name:"object"},required:!1}}};const Thread_ThreadMessageList=ThreadMessageList;ThreadMessageList.propTypes={threadMessages:prop_types_default().arrayOf(prop_types_default().object),threadMainMessage:prop_types_default().object};var ChatBody_styles_ref3={name:"jcxdt5",styles:"flex:1;word-break:break-all;overflow:auto;overflow-x:hidden;display:flex;flex-direction:column-reverse;max-height:100%;position:relative;padding-top:70px;margin-top:0.25rem"};var ChatBody_styles_ref={name:"19bjeck",styles:"display:flex;align-items:center;justify-content:center;font-weight:200"},ChatBody_styles_ref2={name:"1w53iw6",styles:"position:relative;z-index:1100;left:50%;transform:translateX(-50%);user-select:none;opacity:0;overflow:visible;animation:fadeInAndMoveUp 1s ease-in-out forwards;cursor:pointer;&.not{visibility:hidden;}&.clicked{animation:fadeOutAndMoveUp 1s ease-in-out forwards;}@keyframes fadeInAndMoveUp{from{opacity:0;transform:translateY(20px) translateX(-50%);}to{opacity:1;transform:translateY(0) translateX(-50%);}}@keyframes fadeOutAndMoveUp{50%{opacity:1;}100%{opacity:0;transform:translateY(-20px) translateX(-50%);visibility:hidden;}}"};const RecentMessageButton=({visible,onClick,text})=>{const[clicked,setClicked]=(0,react.useState)(!1),styles={button:ChatBody_styles_ref2,textIconContainer:ChatBody_styles_ref};return(0,emotion_react_browser_esm.tZ)(Button_c,{css:[styles.button,!visible&&"not",clicked&&"clicked","",""],type:"primary",size:"small",onClick:()=>{onClick(),setClicked(!0)}},(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.textIconContainer},text,(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"arrow-down",size:16})))};RecentMessageButton.displayName="RecentMessageButton",RecentMessageButton.__docgenInfo={description:"",methods:[],displayName:"RecentMessageButton"};const ChatBody_RecentMessageButton=RecentMessageButton;var fuselage_hooks_dist_index_module=__webpack_require__("../../node_modules/@rocket.chat/fuselage-hooks/dist/index.module.js");function ModalBlock({view,errors,onSubmit,onClose,onCancel}){const{RCInstance}=(0,react.useContext)(context_RCInstance),id=`modal_id_${(0,fuselage_hooks_dist_index_module.Ld)()}`,ref=(0,react.useRef)();(0,react.useEffect)((()=>{if(ref.current)if(errors&&Object.keys(errors).length){const element=ref.current.querySelector('\n\ta[href]:not([tabindex="-1"]):invalid,\n\tarea[href]:not([tabindex="-1"]):invalid,\n\tinput:not([disabled]):not([tabindex="-1"]):invalid,\n\tselect:not([disabled]):not([tabindex="-1"]):invalid,\n\ttextarea:not([disabled]):not([tabindex="-1"]):invalid,\n\tbutton:not([disabled]):not([tabindex="-1"]):invalid,\n\tiframe:invalid,\n\tobject:invalid,\n\tembed:invalid,\n\t[tabindex]:not([tabindex="-1"]):invalid,\n\t[contenteditable]:invalid');element&&element.focus()}else{const element=ref.current.querySelector('\n\ta[href]:not([tabindex="-1"]),\n\tarea[href]:not([tabindex="-1"]),\n\tinput:not([disabled]):not([tabindex="-1"]),\n\tselect:not([disabled]):not([tabindex="-1"]),\n\ttextarea:not([disabled]):not([tabindex="-1"]),\n\tbutton:not([disabled]):not([tabindex="-1"]),\n\tiframe,\n\tobject,\n\tembed,\n\t[tabindex]:not([tabindex="-1"]),\n\t[contenteditable]');element&&element.focus()}}),[errors]);const previousFocus=(0,react.useMemo)((()=>document.activeElement),[]);return(0,react.useEffect)((()=>()=>previousFocus&&previousFocus.focus()),[previousFocus]),(0,emotion_react_browser_esm.tZ)(v,{onClose,open:!0,id,ref,style:{maxWidth:"600px",maxHeight:"80vh"}},(0,emotion_react_browser_esm.tZ)(v.Header,null,view.showIcon&&(0,emotion_react_browser_esm.tZ)(v.Thumb,{url:`${RCInstance.getHost()}/api/apps/${view.appId}/icon`}),(0,emotion_react_browser_esm.tZ)(v.Title,null,surfaces_n.text(view.title)),(0,emotion_react_browser_esm.tZ)(v.Close,{tabIndex:-1,onClick:onClose})),(0,emotion_react_browser_esm.tZ)(v.Content,null,(0,emotion_react_browser_esm.tZ)(Box_n,{style:{padding:"0.25rem"}},(0,emotion_react_browser_esm.tZ)("form",{method:"post",action:"#",onSubmit},(0,emotion_react_browser_esm.tZ)(UiKitComponent_r,{render:surfaces_p,blocks:view.blocks})))),(0,emotion_react_browser_esm.tZ)(v.Footer,null,view.close&&(0,emotion_react_browser_esm.tZ)(Button_c,{type:"danger"===view.close.style?"destructive":"secondary",onClick:onCancel},surfaces_n.text(view.close.text)),view.submit&&(0,emotion_react_browser_esm.tZ)(Button_c,{type:"danger"===view.submit?.style?"destructive":"primary",onClick:onSubmit},surfaces_n.text(view.submit.text))))}ModalBlock.displayName="ModalBlock",ModalBlock.__docgenInfo={description:"",methods:[],displayName:"ModalBlock"};const uiKit_ModalBlock=ModalBlock,reduceValues=(values,{actionId,payload})=>({...values,[actionId]:payload}),getViewFromInteraction=interaction=>"view"in interaction&&"object"==typeof interaction.view?interaction.view:"banner.open"===interaction.type?interaction:void 0;const uiKit_useUiKitView=function useUiKitView(initialView){const[errors,setErrors]=(0,fuselage_hooks_dist_index_module.Po)((0,react.useState)(void 0)),[values,updateValues]=(0,fuselage_hooks_dist_index_module.Po)((0,react.useReducer)(reduceValues,initialView.blocks,extractInitialStateFromLayout_a)),[view,updateView]=(0,fuselage_hooks_dist_index_module.Po)((0,react.useState)(initialView)),actionManager=uiKit_useUiKitActionManager(),state=(0,react.useMemo)((()=>Object.entries(values).reduce(((obj,[key,payload])=>{if(!payload?.blockId)return obj;const{blockId,value}=payload;return obj[blockId]=obj[blockId]||{},obj[blockId][key]=value,obj}),{})),[values]),viewId=(view=>{if("id"in view&&"string"==typeof view.id)return view.id;if("viewId"in view&&"string"==typeof view.viewId)return view.viewId;throw new Error("Invalid view")})(view);return(0,react.useEffect)((()=>{const handleUpdate=interaction=>{"errors"!==interaction.type?updateView((view=>({...view,...getViewFromInteraction(interaction)}))):setErrors(interaction.errors)};return actionManager.on(viewId,handleUpdate),()=>{actionManager.off(viewId,handleUpdate)}}),[actionManager,setErrors,updateView,viewId]),{view,errors,values,updateValues,state}},UiKitModal=({initialView})=>{const{view,errors,values,updateValues,state}=uiKit_useUiKitView(initialView),contextValue=(({view,values,updateValues})=>{const{emitInteraction}=uiKit_useUiKitActionManager(),debouncedTriggerAction=(0,fuselage_hooks_dist_index_module.y1)((async(appId,params)=>{await emitInteraction(appId,params)}),700);return{action:async({actionId,viewId,appId,dispatchActionConfig,blockId,value})=>{if(!appId||!viewId)return;const emit=dispatchActionConfig?.includes("on_character_entered")?debouncedTriggerAction:async(appId,params)=>{await emitInteraction(appId,params)};await emit(appId,{type:"blockAction",actionId,container:{type:"view",id:viewId},payload:{blockId,value}})},updateState:({actionId,value,blockId="default"})=>{updateValues({actionId,payload:{blockId,value}})},...view,values,viewId:view.id}})({view,values,updateValues}),{emitInteraction}=uiKit_useUiKitActionManager(),handleSubmit=(0,fuselage_hooks_dist_index_module.iW)((e=>{e.preventDefault(),emitInteraction(view.appId,{type:"viewSubmit",payload:{view:{...view,state}},viewId:view.id})}),[view,state]),handleCancel=(0,fuselage_hooks_dist_index_module.iW)((e=>{e.preventDefault(),emitInteraction(view.appId,{type:"viewClosed",payload:{viewId:view.id,view:{...view,state},isCleared:!1}})}),[view,state]),handleClose=(0,fuselage_hooks_dist_index_module.iW)((()=>{emitInteraction(view.appId,{type:"viewClosed",payload:{viewId:view.id,view:{...view,state},isCleared:!0}})}),[view,state]);return(0,emotion_react_browser_esm.tZ)(UiKitContext_a.Provider,{value:contextValue},(0,emotion_react_browser_esm.tZ)(uiKit_ModalBlock,{view,errors,appId:initialView.appId,onSubmit:handleSubmit,onCancel:handleCancel,onClose:handleClose}))};UiKitModal.displayName="UiKitModal",UiKitModal.__docgenInfo={description:"",methods:[],displayName:"UiKitModal"};const uiKit_UiKitModal=UiKitModal;var ChatBody_ref={name:"bxqzz5",styles:"margin:auto;text-align:center"};const ChatBody=({anonymousMode,showRoles,messageListRef,scrollToBottom})=>{const{classNames,styleOverrides}=useComponentOverrides_l("ChatBody"),styles={chatbodyContainer:ChatBody_styles_ref3},[scrollPosition,setScrollPosition]=(0,react.useState)(0),[popupVisible,setPopupVisible]=(0,react.useState)(!1),[,setIsUserScrolledUp]=(0,react.useState)(!1),[otherUserMessage,setOtherUserMessage]=(0,react.useState)(!1),{RCInstance,ECOptions}=(0,react.useContext)(context_RCInstance),messages=messageStore((state=>state.messages)),threadMessages=messageStore((state=>state.threadMessages)),setThreadMessages=messageStore((state=>state.setThreadMessages)),upsertMessage=messageStore((state=>state.upsertMessage)),removeMessage=messageStore((state=>state.removeMessage)),isChannelPrivate=channelStore((state=>state.isChannelPrivate)),isLoginIn=loginStore((state=>state.isLoginIn)),[isThreadOpen,threadMainMessage]=messageStore((state=>[state.isThreadOpen,state.threadMainMessage])),{uiKitModalOpen,uiKitModalData}=uiKitStore((state=>({uiKitModalOpen:state.uiKitModalOpen,uiKitModalData:state.uiKitModalData}))),{handleLogin}=useRCAuth(),{handleServerInteraction}=uiKit_useUiKitActionManager(),isUserAuthenticated=userStore((state=>state.isUserAuthenticated)),username=userStore((state=>state.username)),{getMessagesAndRoles}=hooks_useFetchChatData(showRoles),getThreadMessages=(0,react.useCallback)((async()=>{if(isUserAuthenticated&&threadMainMessage?._id)try{if(!isUserAuthenticated&&!anonymousMode)return;const{messages}=await RCInstance.getThreadMessages(threadMainMessage._id,isChannelPrivate);setThreadMessages(messages)}catch(e){console.error(e)}}),[isUserAuthenticated,anonymousMode,RCInstance,threadMainMessage?._id,setThreadMessages,isChannelPrivate]);(0,react.useEffect)((()=>{isThreadOpen&&ECOptions.enableThreads&&getThreadMessages()}),[getThreadMessages,isThreadOpen,ECOptions?.enableThreads]);const addMessage=(0,react.useCallback)((message=>{if(message.u.username!==username){!(0!==messageListRef?.current?.scrollTop)||"pinned"in message||"starred"in message||setOtherUserMessage(!0)}upsertMessage(message,ECOptions?.enableThreads)}),[upsertMessage,ECOptions?.enableThreads,username,messageListRef]),onActionTriggerResponse=(0,react.useCallback)((data=>{handleServerInteraction(data)}),[handleServerInteraction]);(0,react.useEffect)((()=>(RCInstance.auth.onAuthChange((user=>{user&&(RCInstance.addMessageListener(addMessage),RCInstance.addMessageDeleteListener(removeMessage),RCInstance.addActionTriggeredListener(onActionTriggerResponse),RCInstance.addUiInteractionListener(onActionTriggerResponse))})),()=>{RCInstance.removeMessageListener(addMessage),RCInstance.removeMessageDeleteListener(removeMessage),RCInstance.removeActionTriggeredListener(onActionTriggerResponse),RCInstance.removeUiInteractionListener(onActionTriggerResponse)})),[RCInstance,addMessage,removeMessage,onActionTriggerResponse]),(0,react.useEffect)((()=>{RCInstance.auth.onAuthChange((user=>{user?getMessagesAndRoles():getMessagesAndRoles(anonymousMode)}))}),[RCInstance,anonymousMode,getMessagesAndRoles]);const handleScroll=(0,react.useCallback)((()=>{messageListRef&&messageListRef.current&&(setScrollPosition(messageListRef.current.scrollTop),setIsUserScrolledUp(messageListRef.current.scrollTop+messageListRef.current.clientHeight{const currentRef=messageListRef.current;return currentRef.addEventListener("scroll",handleScroll),()=>{currentRef.removeEventListener("scroll",handleScroll)}}),[handleScroll,messageListRef]),(0,react.useEffect)((()=>{scrollPosition+messageListRef.current.clientHeight{scrollToBottom(),setIsUserScrolledUp(!1),setOtherUserMessage(!1),setPopupVisible(!1)}}))};ChatBody.__docgenInfo={description:"",methods:[],displayName:"ChatBody",props:{anonymousMode:{description:"",type:{name:"bool"},required:!1},showRoles:{description:"",type:{name:"bool"},required:!1}}};const ChatBody_ChatBody=ChatBody;ChatBody.propTypes={anonymousMode:prop_types_default().bool,showRoles:prop_types_default().bool};const formatter=[{name:"bold",pattern:"*{{text}}*"},{name:"italic",pattern:"_{{text}}_"},{name:"strike",pattern:"~{{text}}~"},{name:"code",pattern:"`{{text}}`"},{name:"multiline",pattern:"```\n{{text}}\n``` "}];function useMediaRecorder({constraints,onStop,videoRef}){const[recorder,setRecorder]=(0,react.useState)(),{getStream}=function useUserMedia(constraints,videoRef){const[stream,setStream]=(0,react.useState)();return{stream,getStream:async function getStream(refresh=!1){if(stream&&!refresh)return stream;const _stream=await navigator.mediaDevices.getUserMedia(constraints);return setStream(_stream),videoRef.current&&(videoRef.current.srcObject=_stream),_stream}}}(constraints,videoRef),chunks=(0,react.useRef)([]);return[async function start(){const stream=await getStream(constraints,!0);chunks.current=[];const _recorder=new MediaRecorder(stream);_recorder.start(),setRecorder(_recorder),_recorder.addEventListener("dataavailable",(event=>{chunks.current.push(event.data)})),_recorder.addEventListener("stop",(()=>{onStop&&onStop(chunks.current)}))},async function stop(){recorder&&(recorder.stop(),(await getStream()).getTracks().forEach((track=>track.stop())))}]}var ChatInput_styles_ref4={name:"igwn2p",styles:"max-height:300px;overflow:scroll"},ChatInput_styles_ref5={name:"cbxtfi",styles:"flex:1;word-wrap:break-word;white-space:pre-wrap;overflow:auto;overflow-x:hidden;resize:none;border:none;outline:none;font-size:14px;&:focus{border:none;outline:none;}&:disabled{cursor:not-allowed;}&::placeholder{padding-left:5px;}@media (max-width: 383px){font-size:18px;}"},ChatInput_styles_ref6={name:"e0dnmk",styles:"cursor:pointer"},ChatInput_styles_ref7={name:"cwmsqy",styles:"display:flex;align-items:center;justify-content:center;flex-direction:row;padding:0.5rem;@media (max-width: 383px){min-height:100px;}"};var ChatInput_styles_ref={name:"1np0oea",styles:"display:flex;margin:auto"},ChatInput_styles_ref2={name:"y1f223",styles:"margin:auto"},ChatInput_styles_ref3={name:"1489l4r",styles:"display:flex;gap:0.15rem"};const getCommonRecorderStyles=theme=>({dot:(0,emotion_react_browser_esm.iv)("width:0.5rem;height:0.5rem;border-radius:50%;background-color:",theme.colors.destructive,";margin:auto;margin-right:8px;",""),controller:ChatInput_styles_ref3,timer:ChatInput_styles_ref2,record:ChatInput_styles_ref}),AudioMessageRecorder=()=>{const videoRef=(0,react.useRef)(null),{theme}=useTheme_i(),styles=getCommonRecorderStyles(theme),toogleRecordingMessage=messageStore((state=>state.toogleRecordingMessage)),{RCInstance,ECOptions}=(0,react.useContext)(context_RCInstance),[state,setRecordState]=(0,react.useState)("idle"),[time,setTime]=(0,react.useState)("00:00"),[recordingInterval,setRecordingInterval]=(0,react.useState)(null),[file,setFile]=(0,react.useState)(null),[isRecorded,setIsRecorded]=(0,react.useState)(!1),threadId=messageStore((_state=>_state.threadMainMessage?._id)),[start,stop]=useMediaRecorder({constraints:{audio:!0,video:!1},onStop:audioChunks=>{const audioBlob=new Blob(audioChunks,{type:"audio/mpeg"});setFile(new File([audioBlob],"Audio record.mp3",{type:"audio/mpeg"}))},videoRef}),stopRecording=async()=>{stop(),recordingInterval&&clearInterval(recordingInterval),setRecordingInterval(null),setTime("00:00"),setRecordState("idle")},handleRecordButtonClick=()=>{setRecordState("recording");try{start(),toogleRecordingMessage();const startTime=new Date;setRecordingInterval(setInterval((()=>{const distance=((new Date).getTime()-startTime.getTime())/1e3,minutes=Math.floor(distance/60),seconds=Math.floor(distance%60);setTime(`${String(minutes).padStart(2,"0")}:${String(seconds).padStart(2,"0")}`)}),1e3))}catch(error){console.log(error),setRecordState("idle")}},handleMount=(0,react.useCallback)((async()=>{if(navigator.permissions)try{return void await navigator.permissions.query({name:"microphone"})}catch(error){console.warn(error)}if(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)try{if(!(await navigator.mediaDevices.enumerateDevices()).some((({kind})=>"audioinput"===kind)))return null}catch(error){console.warn(error)}}));return(0,react.useEffect)((()=>{handleMount()}),[handleMount]),(0,react.useEffect)((()=>{isRecorded&&file&&((async()=>{await RCInstance.sendAttachment(file,void 0,void 0,ECOptions.enableThreads?threadId:void 0)})(),setIsRecorded(!1)),file&&setFile(null)}),[isRecorded,file]),"idle"===state?(0,emotion_react_browser_esm.tZ)(ActionButton_l,{ghost:!0,square:!0,onClick:handleRecordButtonClick},(0,emotion_react_browser_esm.tZ)(Icon_a,{size:"1.25rem",name:"mic"})):(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.controller},"recording"===state&&(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(ActionButton_l,{ghost:!0,onClick:async()=>{toogleRecordingMessage(),await stopRecording(),setIsRecorded(!1)}},(0,emotion_react_browser_esm.tZ)(Icon_a,{size:"1.25rem",name:"circle-cross"})),(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.record},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:styles.dot}),(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:styles.timer},time)),(0,emotion_react_browser_esm.tZ)(ActionButton_l,{ghost:!0,onClick:async()=>{toogleRecordingMessage(),setIsRecorded(!0),await stopRecording()}},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"circle-check",size:"1.25rem"}))))};AudioMessageRecorder.displayName="AudioMessageRecorder",AudioMessageRecorder.__docgenInfo={description:"",methods:[],displayName:"AudioMessageRecorder"};const ChatInput_AudioMessageRecorder=AudioMessageRecorder;AudioMessageRecorder.propTypes={};var VideoMessageRecoder_ref={name:"bpd7z7",styles:"margin-bottom:2px"};const VideoMessageRecorder=()=>{const videoRef=(0,react.useRef)(null),{theme}=useTheme_i(),styles=getCommonRecorderStyles(theme),toogleRecordingMessage=messageStore((state=>state.toogleRecordingMessage)),{RCInstance,ECOptions}=(0,react.useContext)(context_RCInstance),[state,setRecordState]=(0,react.useState)("idle"),[time,setTime]=(0,react.useState)("00:00"),[recordingInterval,setRecordingInterval]=(0,react.useState)(null),[file,setFile]=(0,react.useState)(null),[isRecorded,setIsRecorded]=(0,react.useState)(!1),threadId=messageStore((_state=>_state.threadMainMessage?._id)),[start,stop]=useMediaRecorder({constraints:{audio:!0,video:!0},onStop:videoChunks=>{const videoBlob=new Blob(videoChunks,{type:"video/mp4"});setFile(new File([videoBlob],"Video record.mp4",{type:"video/mp4"}))},videoRef}),stopRecording=async()=>{stop(),recordingInterval&&clearInterval(recordingInterval),setRecordingInterval(null),setTime("00:00"),setRecordState("idle")},handleCancelRecordButton=async()=>{toogleRecordingMessage(),await stopRecording(),setIsRecorded(!1)},handleMount=(0,react.useCallback)((async()=>{if(navigator.permissions)try{return await navigator.permissions.query({name:"microphone"}),void await navigator.permissions.query({name:"camera"})}catch(error){console.warn(error)}if(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)try{if(!(await navigator.mediaDevices.enumerateDevices()).some((({kind})=>"audioinput"===kind))&&!(await navigator.mediaDevices.enumerateDevices()).some((({kind})=>"videoinput"===kind)))return null}catch(error){console.warn(error)}}));return(0,react.useEffect)((()=>{handleMount()}),[handleMount]),(0,react.useEffect)((()=>{isRecorded&&file&&((async()=>{await RCInstance.sendAttachment(file,void 0,void 0,ECOptions.enableThreads?threadId:void 0)})(),setIsRecorded(!1)),file&&setFile(null)}),[isRecorded,file]),(0,emotion_react_browser_esm.tZ)(react.Fragment,null,"idle"===state&&(0,emotion_react_browser_esm.tZ)(ActionButton_l,{ghost:!0,square:!0,onClick:()=>{setRecordState("recording");try{start(videoRef.current),toogleRecordingMessage();const startTime=new Date;setRecordingInterval(setInterval((()=>{const distance=((new Date).getTime()-startTime.getTime())/1e3,minutes=Math.floor(distance/60),seconds=Math.floor(distance%60);setTime(`${String(minutes).padStart(2,"0")}:${String(seconds).padStart(2,"0")}`)}),1e3))}catch(error){console.log(error),setRecordState("idle")}}},(0,emotion_react_browser_esm.tZ)(Icon_a,{size:"1.25rem",name:"video-recorder"})),"recording"===state&&(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(ActionButton_l,{ghost:!0,square:!0},(0,emotion_react_browser_esm.tZ)(Icon_a,{size:"1.25rem",name:"disabled-recorder"})),(0,emotion_react_browser_esm.tZ)(v,{open:"recording"===state,onClose:handleCancelRecordButton,style:{display:"flex",width:"28rem"}},(0,emotion_react_browser_esm.tZ)("video",{muted:!0,autoPlay:!0,playsInline:!0,ref:videoRef,css:VideoMessageRecoder_ref}),(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.controller},(0,emotion_react_browser_esm.tZ)(ActionButton_l,{ghost:!0,onClick:handleCancelRecordButton},(0,emotion_react_browser_esm.tZ)(Icon_a,{size:"1.25rem",name:"circle-cross"})),(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.record},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:styles.dot}),(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.timer},time)),(0,emotion_react_browser_esm.tZ)(ActionButton_l,{ghost:!0,onClick:async()=>{toogleRecordingMessage(),setIsRecorded(!0),await stopRecording()}},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"circle-check",size:"1.25rem"}))))))};VideoMessageRecorder.__docgenInfo={description:"",methods:[],displayName:"VideoMessageRecorder"};const VideoMessageRecoder=VideoMessageRecorder,lib_formatSelection=(messageRef,pattern)=>{const input=messageRef.current;if(!input)return;const{selectionEnd=input.value.length,selectionStart=0}=input,initText=input.value.slice(0,selectionStart),selectedText=input.value.slice(selectionStart,selectionEnd),finalText=input.value.slice(selectionEnd,input.value.length),startPattern=pattern.slice(0,pattern.indexOf("{{text}}")),endPattern=pattern.slice(pattern.indexOf("{{text}}")+8),startPatternFound=initText.endsWith(startPattern),endPatternFound=finalText.startsWith(endPattern);if(startPatternFound&&endPatternFound)input.value=initText.slice(0,initText.length-startPattern.length)+selectedText+finalText.slice(endPattern.length),input.selectionStart=selectionStart-startPattern.length,input.selectionEnd=input.selectionStart+selectedText.length;else{const wrappedText=startPattern+selectedText+endPattern;input.value=initText+wrappedText+finalText,input.selectionStart=selectionStart+startPattern.length,input.selectionEnd=input.selectionStart+selectedText.length}input.focus()};var ChatInputFormattingToolbar_ref={name:"9c83gk",styles:"position:absolute;bottom:7rem;left:1.85rem"};const ChatInputFormattingToolbar=({messageRef,inputRef,triggerButton,optionConfig={surfaceItems:["emoji","formatter","audio","video","file"],formatters:["bold","italic","strike","code","multiline"]}})=>{const{classNames,styleOverrides,configOverrides}=useComponentOverrides_l("ChatInputFormattingToolbar"),styles=(({theme,mode})=>({chatFormat:(0,emotion_react_browser_esm.iv)("bottom:0;padding:0.2rem;align-items:center;background-color:","light"===mode?color_e(theme.colors.background,.03):color_r(theme.colors.background,1),";display:flex;position:relative;gap:0.1rem;border-radius:0 0 ",theme.radius," ",theme.radius,";@media (max-width: 383px){display:grid;grid-template-columns:repeat(5, 0.2fr);}","")}))(useTheme_i()),surfaceItems=configOverrides.optionConfig?.surfaceItems||optionConfig.surfaceItems,formatters=configOverrides.optionConfig?.formatters||optionConfig.formatters,isRecordingMessage=messageStore((state=>state.isRecordingMessage)),[isEmojiOpen,setEmojiOpen]=(0,react.useState)(!1),chatToolMap={emoji:(0,emotion_react_browser_esm.tZ)(Tooltip_e,{text:"Emoji",position:"top",key:"emoji-btn"},(0,emotion_react_browser_esm.tZ)(ActionButton_l,{square:!0,ghost:!0,disabled:isRecordingMessage,onClick:()=>{setEmojiOpen(!0)}},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"emoji",size:"1.25rem"}))),audio:(0,emotion_react_browser_esm.tZ)(Tooltip_e,{text:"Audio Message",position:"top",key:"audio"},(0,emotion_react_browser_esm.tZ)(ChatInput_AudioMessageRecorder,null)),video:(0,emotion_react_browser_esm.tZ)(Tooltip_e,{text:"Video Message",position:"top",key:"video"},(0,emotion_react_browser_esm.tZ)(VideoMessageRecoder,null)),file:(0,emotion_react_browser_esm.tZ)(Tooltip_e,{text:"Upload File",position:"top",key:"file"},(0,emotion_react_browser_esm.tZ)(ActionButton_l,{square:!0,ghost:!0,disabled:isRecordingMessage,onClick:()=>{inputRef.current.click()}},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"attachment",size:"1.25rem"}))),formatter:formatters.map((name=>formatter.find((item=>item.name===name)))).map((item=>(0,emotion_react_browser_esm.tZ)(Tooltip_e,{text:item.name,position:"top",key:`formatter-${item.name}`},(0,emotion_react_browser_esm.tZ)(ActionButton_l,{square:!0,disabled:isRecordingMessage,ghost:!0,onClick:()=>{lib_formatSelection(messageRef,item.pattern)}},(0,emotion_react_browser_esm.tZ)(Icon_a,{disabled:isRecordingMessage,name:item.name,size:"1.25rem"})))))};return(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.chatFormat,className:`ec-chat-input-formatting-toolbar ${classNames}`,style:styleOverrides},surfaceItems.map((key=>chatToolMap[key])),isEmojiOpen&&(0,emotion_react_browser_esm.tZ)(EmojiPicker,{key:"emoji-picker",handleEmojiClick:emoji=>{setEmojiOpen(!1),(emojiEvent=>{const[emoji]=emojiEvent.names,message=`${messageRef.current.value} :${emoji.replace(/[\s-]+/g,"_")}: `;triggerButton?.(null,message)})(emoji)},onClose:()=>setEmojiOpen(!1),positionStyles:ChatInputFormattingToolbar_ref}))};ChatInputFormattingToolbar.displayName="ChatInputFormattingToolbar",ChatInputFormattingToolbar.__docgenInfo={description:"",methods:[],displayName:"ChatInputFormattingToolbar",props:{optionConfig:{defaultValue:{value:"{\n surfaceItems: ['emoji', 'formatter', 'audio', 'video', 'file'],\n formatters: ['bold', 'italic', 'strike', 'code', 'multiline'],\n}",computed:!1},required:!1}}};const ChatInput_ChatInputFormattingToolbar=ChatInputFormattingToolbar,attachmentwindow=(0,esm.Ue)((set=>({attachmentWindowOpen:!1,data:null,toggle:()=>set((state=>({attachmentWindowOpen:!state.attachmentWindowOpen}))),setData:file=>{set({data:file})}})));var MembersList_styles_ref={name:"16ceglb",styles:"font-weight:600"};const MembersList_styles=theme=>({main:(0,emotion_react_browser_esm.iv)("margin:0.2rem 2rem;display:block;overflow:auto;max-height:10rem;overflow-x:hidden;border:1px solid ",theme.colors.border,";border-radius:0.2rem;color:",theme.colors.secondaryForeground,";",""),listItem:(0,emotion_react_browser_esm.iv)("cursor:pointer;display:flex;justify-content:space-between;align-items:center;padding:0.1rem 0.25rem;&:hover{background-color:",theme.colors.secondary,";}",""),listText:MembersList_styles_ref});function MembersList({mentionIndex,messageRef,filteredMembers=[],setFilteredMembers,setMentionIndex,setStartReadMentionUser,setShowMembersList}){const itemRefs=(0,react.useRef)([]),{theme}=useTheme_i(),styles=MembersList_styles(theme),handleMemberClick=(0,react.useCallback)((selectedItem=>{let insertionText;insertionText="all"===selectedItem?`${messageRef.current.value.substring(0,messageRef.current.value.lastIndexOf("@"))}@all `:"here"===selectedItem?`${messageRef.current.value.substring(0,messageRef.current.value.lastIndexOf("@"))}@here `:`${messageRef.current.value.substring(0,messageRef.current.value.lastIndexOf("@"))}@${selectedItem.username} `,messageRef.current.value=insertionText;const cursorPosition=insertionText.length;messageRef.current.setSelectionRange(cursorPosition,cursorPosition),messageRef.current.focus(),setFilteredMembers([]),setMentionIndex(-1),setStartReadMentionUser(!1),setShowMembersList(!1)}),[messageRef,setFilteredMembers,setMentionIndex,setShowMembersList,setStartReadMentionUser]),setItemRef=(el,index)=>{itemRefs.current[index]=el};return(0,react.useEffect)((()=>{const handleKeyPress=event=>{switch(event.key){case"Enter":{const selectedItem=mentionIndex=filteredMembers.length+2?0:mentionIndex+1)}};return document.addEventListener("keydown",handleKeyPress),()=>{document.removeEventListener("keydown",handleKeyPress)}}),[mentionIndex,filteredMembers,handleMemberClick,setMentionIndex]),(0,react.useEffect)((()=>{itemRefs.current[mentionIndex]&&itemRefs.current[mentionIndex].scrollIntoView({block:"nearest"})}),[mentionIndex]),(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.main},(0,emotion_react_browser_esm.tZ)("ul",{style:{listStyle:"none",margin:0,padding:0}},filteredMembers.map(((member,index)=>(0,emotion_react_browser_esm.tZ)("li",{key:member._id,role:"presentation",css:styles.listItem,onClick:()=>handleMemberClick(member),ref:el=>setItemRef(el,index),onKeyDown:e=>{"Enter"===e.key&&handleMemberClick(member)},style:{backgroundColor:index===mentionIndex&&theme.colors.primary,color:index===mentionIndex&&theme.colors.primaryForeground}},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:styles.listText},member.name),"   ",(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},"@",member.username))))),(0,emotion_react_browser_esm.tZ)("li",{key:"all",role:"presentation",css:styles.listItem,ref:el=>setItemRef(el,filteredMembers.length),onClick:()=>handleMemberClick("all"),onKeyDown:e=>{"Enter"===e.key&&handleMemberClick("all")},style:{backgroundColor:mentionIndex===filteredMembers.length&&theme.colors.primary,color:mentionIndex===filteredMembers.length&&theme.colors.primaryForeground}},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:styles.listText},"all")),(0,emotion_react_browser_esm.tZ)("li",{key:"here",role:"presentation",css:styles.listItem,ref:el=>setItemRef(el,filteredMembers.length+1),onClick:()=>handleMemberClick("here"),onKeyDown:e=>{"Enter"===e.key&&handleMemberClick("here")},style:{backgroundColor:mentionIndex===filteredMembers.length+1&&theme.colors.primary,color:mentionIndex===filteredMembers.length+1&&theme.colors.primaryForeground}},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:styles.listText},"here"))))}MembersList.displayName="MembersList",MembersList.propTypes={mentionIndex:prop_types_default().number,messageRef:prop_types_default().object.isRequired,filteredMembers:prop_types_default().array,setFilteredMembers:prop_types_default().func.isRequired,setMentionIndex:prop_types_default().func.isRequired,setStartReadMentionUser:prop_types_default().func.isRequired,setShowMembersList:prop_types_default().func.isRequired},MembersList.__docgenInfo={description:"",methods:[],displayName:"MembersList",props:{filteredMembers:{defaultValue:{value:"[]",computed:!1},description:"",type:{name:"array"},required:!1},mentionIndex:{description:"",type:{name:"number"},required:!1},messageRef:{description:"",type:{name:"object"},required:!0},setFilteredMembers:{description:"",type:{name:"func"},required:!0},setMentionIndex:{description:"",type:{name:"func"},required:!0},setStartReadMentionUser:{description:"",type:{name:"func"},required:!0},setShowMembersList:{description:"",type:{name:"func"},required:!0}}};const Mentions_MembersList=MembersList;function TypingUsers(){const{RCInstance}=(0,react.useContext)(context_RCInstance),currentUserName=userStore((state=>state.username)),[typingUsers,setTypingUsers]=(0,react.useState)([]),{theme}=useTheme_i();(0,react.useEffect)((()=>(RCInstance.addTypingStatusListener((t=>{setTypingUsers((t||[]).filter((u=>u!==currentUserName)))})),()=>RCInstance.removeTypingStatusListener(setTypingUsers))),[RCInstance,setTypingUsers,currentUserName]);const typingStatusMessage=(0,react.useMemo)((()=>0===typingUsers.length?"":1===typingUsers.length?(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},(0,emotion_react_browser_esm.tZ)("b",null,typingUsers[0])," is typing..."):2===typingUsers.length?(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},(0,emotion_react_browser_esm.tZ)("b",null,typingUsers[0])," and ",(0,emotion_react_browser_esm.tZ)("b",null,typingUsers[1])," are typing..."):(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},(0,emotion_react_browser_esm.tZ)("b",null,typingUsers[0]," "),", ",(0,emotion_react_browser_esm.tZ)("b",null,typingUsers[1]," "),`and ${typingUsers.length-2} more are typing...`)),[typingUsers]);return(0,emotion_react_browser_esm.tZ)(Box_n,{css:(0,emotion_react_browser_esm.iv)("height:",0!==typingUsers.length?"15px":"0px",";font-size:0.75rem;margin-inline-start:2.25rem;z-index:1200;","")},typingStatusMessage)}TypingUsers.displayName="TypingUsers",TypingUsers.__docgenInfo={description:"",methods:[],displayName:"TypingUsers"};const createRandomId=()=>{if("undefined"!=typeof window){if(window.crypto.randomUUID)return window.crypto.randomUUID().replaceAll("-","").slice(0,17);if(window.crypto.getRandomValues){const array=new window.BigUint64Array(2);return window.crypto.getRandomValues(array),(array[0]*array[1]).toString(36).slice(0,17)}}return(Math.random().toString(36).replace("0.","")+Math.random().toString(36).replace("0.","")).slice(2,19)},lib_createPendingMessage=(message,user={_id:void 0,username:void 0,name:void 0})=>{const now=new Date;return{isPending:!0,_id:`ec_${createRandomId()}`,rid:"GENERAL",msg:message,ts:now.toISOString(),u:{_id:user._id,username:user.username,name:user.name},_updatedAt:now.toISOString(),urls:[],mentions:[],channels:[],md:[{type:"PARAGRAPH",value:[{type:"PLAIN_TEXT",value:message}]}]}};var CommandList_style_ref={name:"16ceglb",styles:"font-weight:600"};const CommandList_style=theme=>({main:(0,emotion_react_browser_esm.iv)("margin:0.2rem 2rem;display:block;max-height:10rem;overflow:scroll;overflow-x:hidden;max-height:145px;border:1px solid ",theme.colors.border,";border-radius:0.2rem;color:",theme.colors.secondaryForeground,";",""),listItem:(0,emotion_react_browser_esm.iv)("cursor:pointer;display:flex;justify-content:space-between;align-items:center;padding:0.1rem 0.25rem;&:hover{background-color:",theme.colors.secondary,";}",""),listText:CommandList_style_ref});function CommandsList_extends(){return CommandsList_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i{const commandName=command.command,tokens=(messageRef.current.value||"").split(" "),firstTokenIdx=tokens.findIndex((token=>token.match(/^\/\w*$/)));if(-1!==firstTokenIdx){tokens[firstTokenIdx]=`/${commandName}`;const newMessageString=tokens.join(" ");messageRef.current.value=newMessageString,setFilteredCommands([]),setCommandIndex(0),setShowCommandList(!1)}}),[messageRef,setCommandIndex,setFilteredCommands,setShowCommandList]);return(0,react.useEffect)((()=>{const handleKeyPress=event=>{switch(event.key){case"Enter":{const selectedItem=filteredCommands[commandIndex];handleCommandClick(selectedItem);break}case"ArrowDown":event.preventDefault(),setCommandIndex(commandIndex+1>=filteredCommands.length?0:commandIndex+1);break;case"ArrowUp":event.preventDefault(),setCommandIndex(commandIndex-1<0?filteredCommands.length-1:commandIndex-1)}};return document.addEventListener("keydown",handleKeyPress),()=>{document.removeEventListener("keydown",handleKeyPress)}}),[commandIndex,filteredCommands,handleCommandClick,setCommandIndex]),(0,react.useEffect)((()=>{itemRefs.current[commandIndex]&&itemRefs.current[commandIndex].scrollIntoView({block:"nearest"})}),[commandIndex]),(0,emotion_react_browser_esm.tZ)(Box_n,CommandsList_extends({css:styles.main,className:`ec-commands-list ${className} ${classNames}`,style:{...styleOverrides,...style}},props),(0,emotion_react_browser_esm.tZ)("ul",{style:{listStyle:"none",margin:0,padding:0}},filteredCommands.map(((command,index)=>(0,emotion_react_browser_esm.tZ)("li",{key:command.command,role:"presentation",css:styles.listItem,ref:el=>((el,index)=>{itemRefs.current[index]=el})(el,index),onClick:()=>handleCommandClick(command),style:{backgroundColor:index===commandIndex&&theme.colors.primary,color:index===commandIndex&&theme.colors.primaryForeground}},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:CommandsList_ref},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},command.command),"   ",(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},command.params)),(0,emotion_react_browser_esm.tZ)(Box_n,null,command.description))))))}CommandsList.displayName="CommandsList",CommandsList.propTypes={className:prop_types_default().string,style:prop_types_default().object,messageRef:prop_types_default().object.isRequired,setFilteredCommands:prop_types_default().func.isRequired,filteredCommands:prop_types_default().array,execCommand:prop_types_default().func,commandIndex:prop_types_default().number.isRequired,setCommandIndex:prop_types_default().func.isRequired,setShowCommandList:prop_types_default().func.isRequired},CommandsList.__docgenInfo={description:"",methods:[],displayName:"CommandsList",props:{className:{defaultValue:{value:"''",computed:!1},description:"",type:{name:"string"},required:!1},style:{defaultValue:{value:"{}",computed:!1},description:"",type:{name:"object"},required:!1},messageRef:{description:"",type:{name:"object"},required:!0},setFilteredCommands:{description:"",type:{name:"func"},required:!0},filteredCommands:{description:"",type:{name:"array"},required:!1},execCommand:{description:"",type:{name:"func"},required:!1},commandIndex:{description:"",type:{name:"number"},required:!0},setCommandIndex:{description:"",type:{name:"func"},required:!0},setShowCommandList:{description:"",type:{name:"func"},required:!0}}};const CommandList_CommandsList=CommandsList,settingsStore=(0,esm.Ue)((set=>({messageLimit:5e3,setMessageLimit:messageLimit=>set((()=>({messageLimit})))})));var ChannelState_styles_ref={name:"167qh1j",styles:"font-size:0.75rem;padding:0.2rem 2rem;z-index:1200;display:flex;justify-content:space-between"};const ChannelState_styles=theme=>({channelStateContainer:ChannelState_styles_ref,channelStateMessage:(0,emotion_react_browser_esm.iv)("background-color:",theme.secondary,";display:flex;gap:0.1rem;padding:1.5px 5px;justify-content:center;align-items:center;border-radius:",theme.radius,";color:",theme.secondaryForeground,";","")}),ChannelState=({className="",style={},status,iconName,instructions})=>{const{classNames,styleOverrides}=useComponentOverrides_l("ChannelState"),{theme}=useTheme_i(),styles=ChannelState_styles(theme);return(0,emotion_react_browser_esm.tZ)(Box_n,{className:`ec-chat-info ${className} ${classNames}`,style:{...styleOverrides,...style},css:styles.channelStateContainer},(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.channelStateMessage},iconName&&(0,emotion_react_browser_esm.tZ)(Icon_a,{name:iconName,size:"10"}),(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},status)),(0,emotion_react_browser_esm.tZ)(Box_n,null,(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span"},instructions)))};ChannelState.displayName="ChannelState",ChannelState.__docgenInfo={description:"",methods:[],displayName:"ChannelState",props:{className:{defaultValue:{value:"''",computed:!1},required:!1},style:{defaultValue:{value:"{}",computed:!1},required:!1}}};const ChannelState_ChannelState=ChannelState;var QuoteMessage_styles_ref={name:"15a086r",styles:"position:absolute;top:0.75rem;right:0.75rem"},QuoteMessage_styles_ref2={name:"10f4ijn",styles:"padding:0.25rem;overflow-wrap:break-word;word-break:break-word;white-space:normal;width:100%"},QuoteMessage_styles_ref3={name:"gfnmd",styles:"padding:0.25rem;display:flex;gap:0.5rem"};const QuoteMessage_styles=theme=>({messageContainer:(0,emotion_react_browser_esm.iv)("margin:0.2rem 2rem;position:relative;font-size:0.85rem;background-color:",theme.colors.background,";color:",theme.colors.foreground,";padding:0.5rem;z-index:1200;border:1px solid ",theme.colors.border,";border-radius:",theme.radius,";max-width:100%;box-sizing:border-box;",""),avatarContainer:QuoteMessage_styles_ref3,message:QuoteMessage_styles_ref2,actionBtn:QuoteMessage_styles_ref}),QuoteMessage=({className="",style={},message})=>{const{RCInstance}=(0,react.useContext)(context_RCInstance),instanceHost=RCInstance.getHost(),{theme}=useTheme_i(),styles=QuoteMessage_styles(theme),removeQuoteMessage=messageStore((state=>state.removeQuoteMessage)),{classNames,styleOverrides}=useComponentOverrides_l("QuoteMessage");return(0,emotion_react_browser_esm.tZ)(Box_n,{className:`ec-quote-msg ${className} ${classNames}`,style:{...styleOverrides,...style},css:styles.messageContainer},(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.actionBtn},(0,emotion_react_browser_esm.tZ)(ActionButton_l,{ghost:!0,onClick:()=>removeQuoteMessage(message),size:"small"},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"cross",size:"0.75rem"}))),(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.avatarContainer},(0,emotion_react_browser_esm.tZ)(Avatar_p,{url:(username=message?.u.username,`${instanceHost}/avatar/${username}`),alt:"avatar",size:"1.5em"}),(0,emotion_react_browser_esm.tZ)(Box_n,null,message?.u.username),(0,emotion_react_browser_esm.tZ)(Box_n,null,(0,format.Z)(new Date(message.ts),"h:mm a"))),(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.message},message.file?message.file.type.startsWith("image/")?(0,emotion_react_browser_esm.tZ)("div",null,(0,emotion_react_browser_esm.tZ)("img",{src:`${instanceHost}/file-upload/${message.file._id}/${message.file.name}`,alt:message.file.name,style:{maxWidth:"100px",maxHeight:"100px"}}),(0,emotion_react_browser_esm.tZ)("div",null,`${message.file.name} (${(message.file.size/1024).toFixed(2)} kB)`)):message.file.type.startsWith("video/")?(0,emotion_react_browser_esm.tZ)("video",{controls:!0,style:{maxWidth:"100%",maxHeight:"200px"}},(0,emotion_react_browser_esm.tZ)("source",{src:`${instanceHost}/file-upload/${message.file._id}/${message.file.name}`,type:message.file.type}),"Your browser does not support the video tag."):message.file.type.startsWith("audio/")?(0,emotion_react_browser_esm.tZ)("audio",{controls:!0,style:{maxWidth:"100%"}},(0,emotion_react_browser_esm.tZ)("source",{src:`${instanceHost}/file-upload/${message.file._id}/${message.file.name}`,type:message.file.type}),"Your browser does not support the audio element."):(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.message},message.msg?(0,emotion_react_browser_esm.tZ)(Markdown_Markdown,{body:message,isReaction:!1}):`${message.file?.name} (${message.file?.size?(message.file.size/1024).toFixed(2):0} kB)`):"["===message?.msg[0]?message?.msg.match(/\n(.*)/)[1]:(0,emotion_react_browser_esm.tZ)(Markdown_Markdown,{body:message,isReaction:!1}),message.attachments&&message.attachments.length>0&&message.msg&&"["===message.msg[0]&&message.attachments.map(((attachment,index)=>(0,emotion_react_browser_esm.tZ)(AttachmentHandler_Attachment,{key:index,attachment,type:attachment.type,host:instanceHost})))));var username};QuoteMessage.displayName="QuoteMessage",QuoteMessage.__docgenInfo={description:"",methods:[],displayName:"QuoteMessage",props:{className:{defaultValue:{value:"''",computed:!1},required:!1},style:{defaultValue:{value:"{}",computed:!1},required:!1}}};const QuoteMessage_QuoteMessage=QuoteMessage,hooks_useShowCommands=(commands,setFilteredCommands,setShowCommandList)=>(0,react.useCallback)((async e=>{const cursor=e.target.selectionStart,tokens=e.target.value.slice(0,cursor).split(/\s+/);var cmd;1===tokens.length&&tokens[0].startsWith("/")?(setFilteredCommands((cmd=tokens[0],commands.filter((c=>c.command.startsWith(cmd.replace("/","")))))),setShowCommandList(!0)):(setFilteredCommands([]),setShowCommandList(!1))}),[commands,setFilteredCommands,setShowCommandList]),hooks_useSearchMentionUser=(members,startReadMentionUser,setStartReadMentionUser,setFilteredMembers,setMentionIndex,setShowMembersList)=>(0,react.useCallback)((message=>{const lastChar=message?message[message.length-1]:"";if(0===message.length)return setShowMembersList(!1),setStartReadMentionUser(!1),setFilteredMembers([]),void setMentionIndex(-1);if("@"===lastChar&&(1===message.length||" "===message[message.length-2]))return setStartReadMentionUser(!0),setFilteredMembers(members),setMentionIndex(0),void setShowMembersList(!0);if(startReadMentionUser)if(" "===lastChar)setStartReadMentionUser(!1),setFilteredMembers([]),setMentionIndex(-1),setShowMembersList(!1);else{const query=message.substring(message.lastIndexOf("@")+1).toLowerCase(),filteredMentionMembers=members.filter((member=>member.name.toLowerCase().includes(query)||member.username.toLowerCase().includes(query)));setFilteredMembers(filteredMentionMembers);const isValidUsername=filteredMentionMembers.length>0;setShowMembersList(isValidUsername),setMentionIndex(isValidUsername?0:-1)}}),[members,startReadMentionUser,setStartReadMentionUser,setFilteredMembers,setMentionIndex,setShowMembersList]),parseEmoji=text=>{const regx_data=text.match(/:([^:]*):/g);if(regx_data){const result=regx_data[regx_data.length-1],d=joypixels_default().shortnameToUnicode(result);void 0!==d&&(text=text.replace(result,d))}return text};var ChatInput_ref={name:"5ko0u5",styles:"margin:1em"},ChatInput_ref2={name:"66u5jz",styles:"padding:1em"},ChatInput_ref3={name:"1w6frfr",styles:"padding:0.25rem"};const ChatInput=({scrollToBottom})=>{const{styleOverrides,classNames}=useComponentOverrides_l("ChatInput"),{RCInstance,ECOptions}=useRCContext(),{theme}=useTheme_i(),styles=(theme=>({inputWithFormattingBox:(0,emotion_react_browser_esm.iv)("border:1px solid ",theme.colors.border,";border-radius:",theme.radius,";margin:0.5rem 2rem 1rem 2rem;&.focused{border:",`1.5px solid ${theme.colors.ring}`,";}",""),editMessage:(0,emotion_react_browser_esm.iv)("border:2px solid ",theme.colors.border,";",""),inputBox:ChatInput_styles_ref7,iconCursor:ChatInput_styles_ref6,textInput:ChatInput_styles_ref5,quoteContainer:ChatInput_styles_ref4}))(theme),inputRef=(0,react.useRef)(null),typingRef=(0,react.useRef)(),messageRef=(0,react.useRef)(null),chatInputContainer=(0,react.useRef)(null),timerRef=(0,react.useRef)(),[commands,setCommands]=(0,react.useState)([]),[disableButton,setDisableButton]=(0,react.useState)(!0),[filteredMembers,setFilteredMembers]=(0,react.useState)([]),[mentionIndex,setMentionIndex]=(0,react.useState)(-1),[commandIndex,setCommandIndex]=(0,react.useState)(0),[startReadMentionUser,setStartReadMentionUser]=(0,react.useState)(!1),[showMembersList,setShowMembersList]=(0,react.useState)(!1),[showCommandList,setShowCommandList]=(0,react.useState)(!1),[filteredCommands,setFilteredCommands]=(0,react.useState)([]),[isMsgLong,setIsMsgLong]=(0,react.useState)(!1),{isUserAuthenticated,canSendMsg,setIsUserAuthenticated,username,userId,name}=userStore((state=>({isUserAuthenticated:state.isUserAuthenticated,canSendMsg:state.canSendMsg,setIsUserAuthenticated:state.setIsUserAuthenticated,username:state.username,userId:state.userId,name:state.name}))),{isChannelPrivate,isChannelReadOnly}=channelStore((state=>({isChannelPrivate:state.isChannelPrivate,isChannelReadOnly:state.isChannelReadOnly}))),{members,setMembersHandler}=memberStore((state=>({members:state.members,setMembersHandler:state.setMembersHandler}))),msgMaxLength=settingsStore((state=>state.messageLimit)),{editMessage,setEditMessage,quoteMessage,isRecordingMessage,upsertMessage,replaceMessage,clearQuoteMessages,threadId}=messageStore((state=>({editMessage:state.editMessage,setEditMessage:state.setEditMessage,quoteMessage:state.quoteMessage,isRecordingMessage:state.isRecordingMessage,upsertMessage:state.upsertMessage,replaceMessage:state.replaceMessage,threadId:state.threadMainMessage?._id,clearQuoteMessages:state.clearQuoteMessages}))),setIsLoginModalOpen=loginStore((state=>state.setIsLoginModalOpen)),isLoginIn=loginStore((state=>state.isLoginIn)),{toggle,setData}=attachmentwindow((state=>({toggle:state.toggle,setData:state.setData}))),userInfo={_id:userId,username,name},dispatchToastMessage=useToastBarDispatch_r(),showCommands=hooks_useShowCommands(commands,setFilteredCommands,setShowCommandList),searchMentionUser=hooks_useSearchMentionUser(members,startReadMentionUser,setStartReadMentionUser,setFilteredMembers,setMentionIndex,setShowMembersList);(0,react.useEffect)((()=>{RCInstance.auth.onAuthChange((user=>{user&&(RCInstance.getCommandsList().then((data=>setCommands(data.commands||[]))).catch(console.error),RCInstance.getChannelMembers(isChannelPrivate).then((channelMembers=>setMembersHandler(channelMembers.members||[]))).catch(console.error))}))}),[RCInstance,isChannelPrivate,setMembersHandler]),(0,react.useEffect)((()=>{editMessage.attachments?messageRef.current.value=editMessage.attachments[0]?.description||editMessage.msg:editMessage.msg?messageRef.current.value=editMessage.msg:messageRef.current.value=""}),[editMessage]);const handleNewLine=(e,addLine=!0)=>{addLine&&(messageRef.current.value+="\n"),e.target.style.height="auto",e.target.scrollHeight<=150?(e.target.style.boxSizing="border-box",e.target.style.height=`${e.target.scrollHeight}px`):e.target.style.height="150px"},sendTypingStop=async()=>{try{typingRef.current=!1,await RCInstance.sendTypingStatus(username,!1)}catch(e){console.error(e)}},handleSendNewMessage=async message=>{messageRef.current.value="",setDisableButton(!0);let pendingMessage="",quotedMessages="";if(quoteMessage.length>0){const quoteArray=await Promise.all(quoteMessage.map((async quote=>{const{msg,attachments,_id}=quote;if(msg||attachments){const msgLink=await(async id=>{const host=RCInstance.getHost(),res=await RCInstance.channelInfo();return`${host}/channel/${res.room?.name}/?msg=${id}`})(_id);quotedMessages+=`[ ](${msgLink})`}return quotedMessages})));quotedMessages=quoteArray.join(""),pendingMessage=lib_createPendingMessage(`${quotedMessages}\n${message}`,userInfo)}else pendingMessage=lib_createPendingMessage(message,userInfo);ECOptions.enableThreads&&threadId&&(pendingMessage.tmid=threadId),upsertMessage(pendingMessage,ECOptions.enableThreads);const res=await RCInstance.sendMessage({msg:pendingMessage.msg,_id:pendingMessage._id},ECOptions.enableThreads?threadId:void 0);res.success&&(clearQuoteMessages(),replaceMessage(pendingMessage,res.message))},handleEditMessage=async message=>{messageRef.current.value="",setDisableButton(!0);const editMessageId=editMessage._id;setEditMessage({});(await RCInstance.updateMessage(editMessageId,message.replace(/\n/g,"\\n"))).success||(async errorMessage=>{await RCInstance.logout(),setIsUserAuthenticated(!1),dispatchToastMessage({type:"error",message:errorMessage})})("Error editing message, login again")},handleCommandExecution=async message=>{const[command,...paramsArray]=message.split(" "),params=paramsArray.join(" ");commands.find((c=>c.command===command.replace("/","")))&&(messageRef.current.value="",setDisableButton(!0),setEditMessage({}),await(async(command,params)=>{await RCInstance.execCommand({command,params}),setFilteredCommands([])})(command.replace("/",""),params))},sendMessage=async()=>{messageRef.current.focus(),messageRef.current.style.height="44px";const message=messageRef.current.value.trim();if(!message.length||!isUserAuthenticated)return messageRef.current.value="",void((editMessage.msg||editMessage.attachments)&&setEditMessage({}));message.length>msgMaxLength?setIsMsgLong(!0):editMessage.msg||editMessage.attachments?handleEditMessage(message):message.startsWith("/")?handleCommandExecution(message):(handleSendNewMessage(message),scrollToBottom())},onTextChange=(e,val)=>{(async()=>{try{if(typingRef.current&&messageRef.current.value?.length)return;messageRef.current.value?.length?(typingRef.current=!0,timerRef.current=setTimeout((()=>{typingRef.current=!1}),[15e3]),await RCInstance.sendTypingStatus(username,!0)):(clearTimeout(timerRef.current),typingRef.current=!1,await RCInstance.sendTypingStatus(username,!1))}catch(e){console.error(e)}})();const message=val||e.target.value;messageRef.current.value=parseEmoji(message),setDisableButton(!messageRef.current.value.length),null!==e&&(handleNewLine(e,!1),searchMentionUser(message),showCommands(e))};return(0,emotion_react_browser_esm.tZ)(Box_n,{className:`ec-chat-input ${classNames}`,style:styleOverrides},(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.quoteContainer},(0,emotion_react_browser_esm.tZ)("div",null,quoteMessage&"eMessage.length>0&"eMessage.map(((message,index)=>(0,emotion_react_browser_esm.tZ)(QuoteMessage_QuoteMessage,{message,key:index})))),editMessage.msg||editMessage.attachments||isChannelReadOnly?(0,emotion_react_browser_esm.tZ)(ChannelState_ChannelState,{status:editMessage.msg||editMessage.attachments?"Editing Message":isChannelReadOnly?"This room is read only":void 0,iconName:editMessage.msg||editMessage.attachments?"edit":void 0,instructions:editMessage.msg||editMessage.attachments?"esc to cancel · enter to save":void 0}):null,showMembersList&&(0,emotion_react_browser_esm.tZ)(Mentions_MembersList,{messageRef,mentionIndex,setMentionIndex,filteredMembers,setFilteredMembers,setStartReadMentionUser,setShowMembersList}),showCommandList&&(0,emotion_react_browser_esm.tZ)(CommandList_CommandsList,{commandIndex,filteredCommands,setCommandIndex,messageRef,setFilteredCommands,setShowCommandList}),(0,emotion_react_browser_esm.tZ)(TypingUsers,null)),(0,emotion_react_browser_esm.tZ)(Box_n,{ref:chatInputContainer,css:[styles.inputWithFormattingBox,(editMessage.msg||editMessage.attachments)&&styles.editMessage,"",""]},(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.inputBox},(0,emotion_react_browser_esm.tZ)(Input_c,{textArea:!0,rows:1,disabled:!isUserAuthenticated||!canSendMsg||isRecordingMessage,placeholder:isUserAuthenticated&&canSendMsg?"Message":isUserAuthenticated?"This room is read only":"Sign in to chat",css:styles.textInput,onChange:onTextChange,onBlur:()=>{sendTypingStop(),chatInputContainer.current&&chatInputContainer.current.classList.remove("focused")},onFocus:()=>{chatInputContainer.current&&chatInputContainer.current.classList.add("focused")},onKeyDown:e=>{switch(!0){case e.ctrlKey&&"KeyI"===e.code:e.preventDefault(),lib_formatSelection(messageRef,"_{{text}}_");break;case e.ctrlKey&&"KeyB"===e.code:e.preventDefault(),lib_formatSelection(messageRef,"*{{text}}*");break;case(e.ctrlKey||e.metaKey||e.shiftKey)&&"Enter"===e.code:e.preventDefault(),handleNewLine(e);break;case"Escape"===e.code:(editMessage.msg||editMessage.attachments)&&(e.preventDefault(),messageRef.current.value="",setDisableButton(!0),setEditMessage({}));break;case"Enter"===e.code:e.preventDefault(),showCommandList||showMembersList||(sendTypingStop(),sendMessage())}},ref:messageRef}),(0,emotion_react_browser_esm.tZ)("input",{type:"file",hidden:!0,ref:inputRef,onChange:event=>{event.target.files&&event.target.files[0]&&(toggle(),setData(event.target.files[0]))}}),(0,emotion_react_browser_esm.tZ)(Box_n,{css:ChatInput_ref3},isUserAuthenticated?(0,emotion_react_browser_esm.tZ)(ActionButton_l,{ghost:!0,size:"large",onClick:()=>sendMessage(),type:"primary",disabled:disableButton||isRecordingMessage,icon:"send"}):(0,emotion_react_browser_esm.tZ)(Button_c,{onClick:async()=>{if(!isUserAuthenticated)if("OAUTH"===ECOptions.authFlow)try{await RCInstance.auth.loginWithRocketChatOAuth()}catch(e){console.error(e),dispatchToastMessage({type:"error",message:e.message})}else setIsLoginModalOpen(!0)},type:"primary",disabled:isLoginIn},isLoginIn?(0,emotion_react_browser_esm.tZ)(Throbber_m,null):"JOIN"))),isUserAuthenticated&&(0,emotion_react_browser_esm.tZ)(ChatInput_ChatInputFormattingToolbar,{messageRef,inputRef,triggerButton:onTextChange})),isMsgLong&&(0,emotion_react_browser_esm.tZ)(v,{css:ChatInput_ref2,onClose:()=>setIsMsgLong(!1)},(0,emotion_react_browser_esm.tZ)(v.Header,null,(0,emotion_react_browser_esm.tZ)(v.Title,null,(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"report",size:"1.25rem"}),"Message Too Long!"),(0,emotion_react_browser_esm.tZ)(v.Close,{onClick:()=>setIsMsgLong(!1)})),(0,emotion_react_browser_esm.tZ)(v.Content,{css:ChatInput_ref},"Send it as attachment instead?"),(0,emotion_react_browser_esm.tZ)(v.Footer,null,(0,emotion_react_browser_esm.tZ)(Button_c,{type:"secondary",onClick:()=>setIsMsgLong(!1)},"Cancel"),(0,emotion_react_browser_esm.tZ)(Button_c,{onClick:()=>{const message=messageRef.current.value.trim();messageRef.current.value="",setEditMessage({}),setIsMsgLong(!1);const messageBlob=new Blob([message],{type:"text/plain"}),file=new File([messageBlob],"message.txt",{type:"text/plain",lastModified:Date.now()});toggle(),setData(file)},type:"primary"},"Ok"))))};ChatInput.displayName="ChatInput",ChatInput.__docgenInfo={description:"",methods:[],displayName:"ChatInput"};const ChatInput_ChatInput=ChatInput,hooks_useDropBox=()=>{const data=attachmentwindow((state=>state.data)),setData=attachmentwindow((state=>state.setData)),toggle=attachmentwindow((state=>state.toggle));return{data,handleDrag:e=>{e.preventDefault()},handleDragDrop:e=>{e.preventDefault(),toggle(),setData(e.dataTransfer.files[0])}}};function PreviewImage({previewURL}){const{theme}=useTheme_i();return(0,emotion_react_browser_esm.tZ)(Box_n,null,(0,emotion_react_browser_esm.tZ)("img",{src:previewURL,style:{maxWidth:"90%",objectFit:"contain",borderRadius:theme.radius}}))}PreviewImage.displayName="PreviewImage",PreviewImage.__docgenInfo={description:"",methods:[],displayName:"PreviewImage",props:{previewURL:{description:"",type:{name:"string"},required:!1}}};const PreviewType_image=PreviewImage;function PreviewAudio({previewURL}){return(0,emotion_react_browser_esm.tZ)(Box_n,null,(0,emotion_react_browser_esm.tZ)("audio",{src:previewURL,width:"100%",controls:!0}))}PreviewImage.propTypes={previewURL:prop_types_default().string},PreviewAudio.displayName="PreviewAudio",PreviewAudio.__docgenInfo={description:"",methods:[],displayName:"PreviewAudio",props:{previewURL:{description:"",type:{name:"string"},required:!1}}};const audio=PreviewAudio;PreviewAudio.propTypes={previewURL:prop_types_default().string};var default_ref={name:"11g4mt0",styles:"font-size:16px"},default_ref2={name:"1vcob1d",styles:"display:flex;justify-content:center;align-items:center"};function PreviewDefault({data}){return(0,emotion_react_browser_esm.tZ)(Box_n,null,(0,emotion_react_browser_esm.tZ)(Box_n,{css:default_ref2},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"file",size:"2.25rem"}),(0,emotion_react_browser_esm.tZ)(Box_n,{css:default_ref},data.name)))}PreviewDefault.displayName="PreviewDefault",PreviewDefault.__docgenInfo={description:"",methods:[],displayName:"PreviewDefault",props:{data:{description:"",type:{name:"object"},required:!1}}};const PreviewType_default=PreviewDefault;PreviewDefault.propTypes={data:prop_types_default().object};const CheckPreviewType=({data})=>{const type=data?data.type.split("/")[0]:"",[previewURL,setPreviewURL]=(0,react.useState)(""),dispatchToastMessage=useToastBarDispatch_r();if((0,react.useEffect)((()=>{data||dispatchToastMessage({type:"error",message:"Media Type Not Accepted"})}),[data,dispatchToastMessage]),!data)return null;const reader=new FileReader;switch(reader.onload=e=>{setPreviewURL(e.target.result)},reader.readAsDataURL(data),type){case"image":return data.size/1e3>=1e4?(0,emotion_react_browser_esm.tZ)(PreviewType_default,{data}):(0,emotion_react_browser_esm.tZ)(PreviewType_image,{previewURL});case"audio":return(0,emotion_react_browser_esm.tZ)(audio,{previewURL});default:return(0,emotion_react_browser_esm.tZ)(PreviewType_default,{data})}};CheckPreviewType.__docgenInfo={description:"",methods:[],displayName:"CheckPreviewType",props:{data:{description:"",type:{name:"object"},required:!1}}};const AttachmentPreview_CheckPreviewType=CheckPreviewType;CheckPreviewType.propTypes={data:prop_types_default().object};var AttachmentPreview_styles_ref={name:"12dcll6",styles:"overflow-y:auto;overflow-x:hidden;max-height:350px"},AttachmentPreview_styles_ref2={name:"15kdjvn",styles:"width:95.5%"},AttachmentPreview_styles_ref3={name:"1qg49cl",styles:"display:flex;flex-direction:column;justify-content:start;align-items:start;margin:20px 0 0 0!important"};const AttachmentPreview_styles=()=>({inputContainer:AttachmentPreview_styles_ref3,input:AttachmentPreview_styles_ref2,modalContent:AttachmentPreview_styles_ref});var AttachmentPreview_ref={name:"1fo50kt",styles:"margin-top:1.5rem"},AttachmentPreview_ref2={name:"sfdcrk",styles:"font-weight:550;margin-bottom:0.5rem"},AttachmentPreview_ref3={name:"sfdcrk",styles:"font-weight:550;margin-bottom:0.5rem"},AttachmentPreview_ref4={name:"5dxmz6",styles:"margin:30px"},AttachmentPreview_ref5={name:"df2tu9",styles:"text-align:center;margin-top:1rem"},AttachmentPreview_ref6={name:"u7ytkp",styles:"margin-right:0.5rem"};const AttachmentPreview=()=>{const{RCInstance,ECOptions}=(0,react.useContext)(context_RCInstance),styles=AttachmentPreview_styles(),toggle=attachmentwindow((state=>state.toggle)),data=attachmentwindow((state=>state.data)),setData=attachmentwindow((state=>state.setData)),[isPending,setIsPending]=(0,react.useState)(!1),[fileName,setFileName]=(0,react.useState)(data?.name),[fileDescription,setFileDescription]=(0,react.useState)(""),threadId=messageStore((state=>state.threadMainMessage?._id));return(0,emotion_react_browser_esm.tZ)(v,{onClose:toggle},(0,emotion_react_browser_esm.tZ)(v.Header,null,(0,emotion_react_browser_esm.tZ)(v.Title,null,(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"attachment",size:"1.25rem",css:AttachmentPreview_ref6})," ","File Upload"),(0,emotion_react_browser_esm.tZ)(v.Close,{onClick:toggle})),(0,emotion_react_browser_esm.tZ)(v.Content,null,(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.modalContent},(0,emotion_react_browser_esm.tZ)(Box_n,{css:AttachmentPreview_ref5},(0,emotion_react_browser_esm.tZ)(AttachmentPreview_CheckPreviewType,{data})),(0,emotion_react_browser_esm.tZ)(Box_n,{css:AttachmentPreview_ref4},(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.inputContainer},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:AttachmentPreview_ref3},"File name"),(0,emotion_react_browser_esm.tZ)(Input_c,{onChange:e=>{(e=>{setFileName(e.target.value)})(e)},value:fileName,css:styles.input,placeholder:"name"})),(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.inputContainer},(0,emotion_react_browser_esm.tZ)(Box_n,{is:"span",css:AttachmentPreview_ref2},"File description"),(0,emotion_react_browser_esm.tZ)(Input_c,{onChange:e=>{(e=>{setFileDescription(parseEmoji(e.target.value))})(e)},value:fileDescription,css:styles.input,placeholder:"Description"}))))),(0,emotion_react_browser_esm.tZ)(v.Footer,{css:AttachmentPreview_ref},(0,emotion_react_browser_esm.tZ)(Button_c,{type:"secondary",onClick:toggle},"Cancel"),(0,emotion_react_browser_esm.tZ)(Button_c,{disabled:isPending,onClick:()=>{(async()=>{setIsPending(!0),await RCInstance.sendAttachment(data,fileName,fileDescription,ECOptions?.enableThreads?threadId:void 0),toggle(),setData(null),setIsPending(!1)})()}},isPending?"Sending...":"Send")))};AttachmentPreview.displayName="AttachmentPreview",AttachmentPreview.__docgenInfo={description:"",methods:[],displayName:"AttachmentPreview"};const AttachmentPreview_AttachmentPreview=AttachmentPreview;var dist_esm=__webpack_require__("../../node_modules/@rocket.chat/ui-kit/dist/esm/index.js");const uiKit_useContextualBarContextValue=({view,values,updateValues})=>{const{emitInteraction}=uiKit_useUiKitActionManager(),debouncedTriggerAction=(0,fuselage_hooks_dist_index_module.y1)((async(appId,params)=>{await emitInteraction(appId,params)}),700);return{action:async({appId,viewId,actionId,dispatchActionConfig,blockId,value})=>{if(!appId||!viewId)return;const emit=dispatchActionConfig?.includes("on_character_entered")?debouncedTriggerAction:async(appId,params)=>{await emitInteraction(appId,params)};await emit(appId,{type:"blockAction",actionId,container:{type:"view",id:viewId},payload:{blockId,value}})},updateState:({actionId,value,blockId="default"})=>{updateValues({actionId,payload:{blockId,value}})},...view,values,viewId:view.id}};var UiKitContextualBar_ref={name:"1g505ur",styles:"margin:0.75rem;display:flex"};const UiKitContextualBar=({initialView})=>{const{RCInstance}=(0,react.useContext)(context_RCInstance),{emitInteraction}=uiKit_useUiKitActionManager(),{view,values,updateValues,state}=uiKit_useUiKitView(initialView),contextValue=uiKit_useContextualBarContextValue({view,values,updateValues}),handleSubmit=(0,fuselage_hooks_dist_index_module.iW)((e=>{e.preventDefault(),emitInteraction(view.appId,{type:"viewSubmit",payload:{view:{...view,state}},viewId:view.id})})),handleCancel=(0,fuselage_hooks_dist_index_module.iW)((e=>{e.preventDefault(),emitInteraction(view.appId,{type:"viewClosed",payload:{viewId:view.id,view:{...view,state},isCleared:!1}})})),handleClose=(0,fuselage_hooks_dist_index_module.iW)((e=>{e.preventDefault(),emitInteraction(view.appId,{type:"viewClosed",payload:{viewId:view.id,view:{...view,state},isCleared:!0}})}));return(0,emotion_react_browser_esm.tZ)(UiKitContext_a.Provider,{value:contextValue},(0,emotion_react_browser_esm.tZ)(MinimalSidebar_t,null,(0,emotion_react_browser_esm.tZ)(SidebarHeader_n,{title:surfaces_u.text(view.title,dist_esm.Qj.NONE,0),onClose:handleClose,avatarUrl:`${RCInstance.getHost()}/api/apps/${view.appId}/icon`}),(0,emotion_react_browser_esm.tZ)(SidebarContent_i,{style:{padding:"0.75rem",height:"90%"}},(0,emotion_react_browser_esm.tZ)("form",{method:"post",action:"#",onSubmit:handleSubmit},(0,emotion_react_browser_esm.tZ)(UiKitComponent_r,{render:surfaces_i,blocks:view.blocks}))),(0,emotion_react_browser_esm.tZ)(SidebarFooter_i,{css:UiKitContextualBar_ref},view.close&&(0,emotion_react_browser_esm.tZ)(Button_c,{type:"danger"===view.close.style?"destructive":"secondary",onClick:handleCancel,style:{flex:1}},surfaces_u.text(view.close.text)),view.submit&&(0,emotion_react_browser_esm.tZ)(Button_c,{type:"danger"===view.submit?.style?"destructive":"primary",style:{flex:1,marginLeft:"0.75rem"},onClick:handleSubmit},surfaces_u.text(view.submit.text)))))};UiKitContextualBar.displayName="UiKitContextualBar",UiKitContextualBar.__docgenInfo={description:"",methods:[],displayName:"UiKitContextualBar"};const uiKit_UiKitContextualBar=(0,react.memo)(UiKitContextualBar),ChatLayout=()=>{const messageListRef=(0,react.useRef)(null),{classNames,styleOverrides}=useComponentOverrides_l("ChatBody"),{RCInstance,ECOptions}=useRCContext(),anonymousMode=ECOptions?.anonymousMode,showRoles=ECOptions?.anonymousMode,setStarredMessages=starredMessageStore((state=>state.setStarredMessages)),showSidebar=(starredMessageStore((state=>state.starredMessages)),sidebarStore((state=>state.showSidebar))),showMentions=mentionsStore((state=>state.showMentions)),showAllFiles=fileStore((state=>state.showAllFiles)),showAllThreads=threadsMessageStore((state=>state.showAllThreads)),showPinned=pinnedMessageStore((state=>state.showPinned)),showStarred=starredMessageStore((state=>state.showStarred)),showSearch=searchMessageStore((state=>state.showSearch)),showChannelinfo=channelStore((state=>state.showChannelinfo)),showMembers=memberStore((state=>state.showMembers)),members=memberStore((state=>state.members)),showCurrentUserInfo=userStore((state=>state.showCurrentUserInfo)),attachmentWindowOpen=attachmentwindow((state=>state.attachmentWindowOpen)),isUserAuthenticated=userStore((state=>state.isUserAuthenticated)),{data,handleDrag,handleDragDrop}=hooks_useDropBox(),{uiKitContextualBarOpen,uiKitContextualBarData}=uiKitStore((state=>({uiKitContextualBarOpen:state.uiKitContextualBarOpen,uiKitContextualBarData:state.uiKitContextualBarData}))),scrollToBottom=()=>{messageListRef&&messageListRef.current&&requestAnimationFrame((()=>{messageListRef.current.scrollTop=messageListRef.current.scrollHeight}))},getStarredMessages=(0,react.useCallback)((async()=>{if(isUserAuthenticated)try{if(!isUserAuthenticated&&!anonymousMode)return;const{messages}=await RCInstance.getStarredMessages();setStarredMessages(messages)}catch(e){console.error(e)}}),[isUserAuthenticated,anonymousMode,RCInstance]);return(0,react.useEffect)((()=>{getStarredMessages()}),[showSidebar]),(0,emotion_react_browser_esm.tZ)(Box_n,{css:ChatLayout_styles.layout,style:{...styleOverrides},className:`ec-chat-layout ${classNames}`,onDragOver:e=>handleDrag(e),onDrop:e=>handleDragDrop(e)},(0,emotion_react_browser_esm.tZ)(Box_n,{css:ChatLayout_styles.chatMain},(0,emotion_react_browser_esm.tZ)(ChatBody_ChatBody,{anonymousMode,showRoles,messageListRef,scrollToBottom}),(0,emotion_react_browser_esm.tZ)(ChatInput_ChatInput,{scrollToBottom}),(0,emotion_react_browser_esm.tZ)("div",{id:"emoji-popup"})),showSidebar&&(0,emotion_react_browser_esm.tZ)(Box_n,{className:"ec-sidebar-view"},showMembers&&(0,emotion_react_browser_esm.tZ)(RoomMember,{members}),showSearch&&(0,emotion_react_browser_esm.tZ)(MessageAggregators_SearchMessages,null),showChannelinfo&&(0,emotion_react_browser_esm.tZ)(RoomInformation,null),showAllThreads&&(0,emotion_react_browser_esm.tZ)(MessageAggregators_ThreadedMessages,null),showAllFiles&&(0,emotion_react_browser_esm.tZ)(MessageAggregators_FileGallery,null),showMentions&&(0,emotion_react_browser_esm.tZ)(MessageAggregators_MentionedMessages,null),showPinned&&(0,emotion_react_browser_esm.tZ)(MessageAggregators_PinnedMessages,null),showStarred&&(0,emotion_react_browser_esm.tZ)(MessageAggregators_StarredMessages,null),showCurrentUserInfo&&(0,emotion_react_browser_esm.tZ)(UserInformation_UserInformation,null),uiKitContextualBarOpen&&(0,emotion_react_browser_esm.tZ)(uiKit_UiKitContextualBar,{key:Math.random(),initialView:uiKitContextualBarData})),attachmentWindowOpen?data?(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(AttachmentPreview_AttachmentPreview,null)):(0,emotion_react_browser_esm.tZ)(AttachmentPreview_CheckPreviewType,{data}):null)};ChatLayout.displayName="ChatLayout",ChatLayout.__docgenInfo={description:"",methods:[],displayName:"ChatLayout"};const ChatLayout_ChatLayout=ChatLayout;var DynamicHeader_styles_ref={name:"x7y8un",styles:"margin:0;padding:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden"},DynamicHeader_styles_ref2={name:"1ma6o0p",styles:"display:flex;justify-content:space-between;align-items:center;width:100%;z-index:1200;padding-block-start:10px"};const DynamicHeader_styles=()=>({container:DynamicHeader_styles_ref2,clearSpacing:DynamicHeader_styles_ref});var DynamicHeader_ref={name:"11kpvkp",styles:"display:flex;align-items:center;flex-direction:row;gap:0.5rem"};const DynamicHeader=({title,isHeaderIcon=!1,handleClose=()=>{},iconName,headerIconName})=>{const styles=DynamicHeader_styles();return(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.container},(0,emotion_react_browser_esm.tZ)(Box_n,{css:DynamicHeader_ref},(0,emotion_react_browser_esm.tZ)(ActionButton_l,{onClick:handleClose,ghost:!0,display:"inline",square:!0,size:"small"},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:iconName,size:"1.25rem"})),(0,emotion_react_browser_esm.tZ)(Heading_l,{level:6,css:styles.clearSpacing},title),isHeaderIcon&&(0,emotion_react_browser_esm.tZ)(Icon_a,{name:headerIconName,size:"1.25rem"})))};DynamicHeader.displayName="DynamicHeader",DynamicHeader.__docgenInfo={description:"",methods:[],displayName:"DynamicHeader",props:{isHeaderIcon:{defaultValue:{value:"false",computed:!1},description:"",type:{name:"bool"},required:!1},handleClose:{defaultValue:{value:"() => {}",computed:!1},description:"",type:{name:"func"},required:!1},title:{description:"",type:{name:"string"},required:!1},iconName:{description:"",type:{name:"string"},required:!1}}};const DynamicHeader_DynamicHeader=DynamicHeader;DynamicHeader.propTypes={handleClose:prop_types_default().func,title:prop_types_default().string,isHeaderIcon:prop_types_default().bool,iconName:prop_types_default().string};const rowCentreAlign={name:"fhxb3m",styles:"display:flex;flex-direction:row;align-items:center"};var ChatHeader_styles_ref={name:"1xclg2i",styles:"margin:0;padding:0"};const ChatHeader_styles=({theme,mode})=>({clearSpacing:ChatHeader_styles_ref,chatHeaderChild:(0,emotion_react_browser_esm.iv)(rowCentreAlign," padding:0 0.75rem;justify-content:space-between;width:100%;",""),chatHeaderParent:(0,emotion_react_browser_esm.iv)("background-color:","light"===mode?color_e(theme.colors.background,.03):color_r(theme.colors.background,1),";width:100%;z-index:1200;display:flex;flex-direction:column;padding:0.75rem;box-shadow:",theme.shadows[1],";",""),channelDescription:(0,emotion_react_browser_esm.iv)(rowCentreAlign," gap:0.5rem;",""),chatHeaderIconRow:(0,emotion_react_browser_esm.iv)(rowCentreAlign," position:relative;gap:0.5rem;","")}),ChatHeader=({isClosable,setClosableState,fullScreen,setFullScreen,className="",style={},optionConfig={surfaceItems:["minmax","close"],menuItems:["thread","mentions","starred","pinned","files","members","search","rInfo","logout"]}})=>{const{classNames,styleOverrides,configOverrides}=useComponentOverrides_l("ChatHeader"),surfaceItems=configOverrides.optionConfig?.surfaceItems||optionConfig.surfaceItems,menuItems=configOverrides.optionConfig?.menuItems||optionConfig.menuItems,theme=useTheme_i(),styles=ChatHeader_styles(theme),setExclusiveState=hooks_useSetExclusiveState(),channelInfo=channelStore((state=>state.channelInfo)),setChannelInfo=channelStore((state=>state.setChannelInfo)),setShowChannelinfo=channelStore((state=>state.setShowChannelinfo)),isChannelPrivate=channelStore((state=>state.isChannelPrivate)),setIsChannelPrivate=channelStore((state=>state.setIsChannelPrivate)),setIsChannelReadOnly=channelStore((state=>state.setIsChannelReadOnly)),workspaceLevelRoles=userStore((state=>state.roles)),{RCInstance,ECOptions}=useRCContext(),{channelName,anonymousMode,showRoles}=ECOptions??{},isUserAuthenticated=userStore((state=>state.isUserAuthenticated)),setIsUserAuthenticated=userStore((state=>state.setIsUserAuthenticated)),setShowSidebar=sidebarStore((state=>state.setShowSidebar)),dispatchToastMessage=useToastBarDispatch_r(),{getMessagesAndRoles}=hooks_useFetchChatData(showRoles),setMessageLimit=settingsStore((state=>state.setMessageLimit)),setMessages=messageStore((state=>state.setMessages)),avatarUrl=userStore((state=>state.avatarUrl)),setUserAvatarUrl=userStore((state=>state.setUserAvatarUrl)),headerTitle=messageStore((state=>state.headerTitle)),filtered=messageStore((state=>state.filtered)),setFilter=messageStore((state=>state.setFilter)),isThreadOpen=messageStore((state=>state.isThreadOpen)),threadMainMessage=messageStore((state=>state.threadMainMessage)),threadTitle=threadMainMessage?.msg||(threadMainMessage?.file?threadMainMessage.file.name:""),closeThread=messageStore((state=>state.closeThread)),setShowMembers=memberStore((state=>state.setShowMembers)),setShowSearch=searchMessageStore((state=>state.setShowSearch)),setShowPinned=pinnedMessageStore((state=>state.setShowPinned)),setShowStarred=starredMessageStore((state=>state.setShowStarred)),setShowAllThreads=threadsMessageStore((state=>state.setShowAllThreads)),setShowAllFiles=fileStore((state=>state.setShowAllFiles)),setShowMentions=mentionsStore((state=>state.setShowMentions)),setCanSendMsg=userStore((state=>state.setCanSendMsg)),authenticatedUserId=userStore((state=>state.userId)),handleLogout=(0,react.useCallback)((async()=>{try{await RCInstance.logout(),setMessages([]),setShowSidebar(!1),setUserAvatarUrl(null),messageStore.setState({isMessageLoaded:!1})}catch(e){console.error(e)}finally{setIsUserAuthenticated(!1)}}),[RCInstance,setIsUserAuthenticated]);(0,react.useEffect)((()=>{isUserAuthenticated&&((async()=>{const res=await RCInstance.channelInfo();res.success?(setChannelInfo(res.room),"p"===res.room.t&&setIsChannelPrivate(!0),res.room.ro&&(setIsChannelReadOnly(!0),(async()=>{const permissionRes=await RCInstance.permissionInfo(),channelRolesRes=await RCInstance.getChannelRoles(isChannelPrivate);if(permissionRes.success&&channelRolesRes.success){const postMsgRoles=permissionRes.update[140]?.roles||[],allRoles=[...channelRolesRes.roles.filter((chRole=>chRole.u?._id===authenticatedUserId)).flatMap((chRole=>chRole.roles)),...workspaceLevelRoles],canSendMsg=postMsgRoles.some((role=>allRoles.includes(role)));setCanSendMsg(canSendMsg)}})())):"errorType"in res&&"error-room-not-found"===res.errorType?(dispatchToastMessage({type:"error",message:"Channel doesn't exist. Logging out."}),await RCInstance.logout()):"errorType"in res&&"Not Allowed"===res.errorType&&(dispatchToastMessage({type:"error",message:"You don't have permission to access this channel. Logging out"}),await RCInstance.logout())})(),(async()=>{const messageLimitObj=await RCInstance.getMessageLimit();setMessageLimit(messageLimitObj?.value)})())}),[isUserAuthenticated,RCInstance,setChannelInfo,setIsChannelPrivate,dispatchToastMessage,isChannelPrivate,setCanSendMsg,authenticatedUserId,setMessageLimit,workspaceLevelRoles,setIsChannelReadOnly]);const options=(0,react.useMemo)((()=>({minmax:{label:""+(fullScreen?"Minimize":"Maximize"),id:"minmax",onClick:()=>setFullScreen((prev=>!prev)),iconName:""+(fullScreen?"collapse":"expand"),visible:!0},close:{label:"Close",id:"close",onClick:()=>setClosableState((prev=>!prev)),iconName:"cross",visible:isClosable},thread:{label:"Threads",id:"thread",onClick:()=>setExclusiveState(setShowAllThreads),iconName:"thread",visible:!0},mentions:{label:"Mentions",id:"mention",onClick:()=>setExclusiveState(setShowMentions),iconName:"at",visible:!0},starred:{label:"Starred Messages",id:"starred",onClick:()=>setExclusiveState(setShowStarred),iconName:"star",visible:!0},pinned:{label:"Pinned Messages",id:"pinned",onClick:()=>setExclusiveState(setShowPinned),iconName:"pin",visible:!0},members:{label:"Members",id:"members",onClick:()=>setExclusiveState(setShowMembers),iconName:"members",visible:isUserAuthenticated},files:{label:"Files",id:"files",onClick:()=>setExclusiveState(setShowAllFiles),iconName:"clip",visible:isUserAuthenticated},search:{label:"Search Messages",id:"search",onClick:()=>setExclusiveState(setShowSearch),iconName:"magnifier",visible:isUserAuthenticated},rInfo:{label:"Room Information",id:"rInfo",onClick:()=>setExclusiveState(setShowChannelinfo),iconName:"info",visible:isUserAuthenticated},logout:{label:"Logout",id:"logout",onClick:handleLogout,iconName:"reply-directly",visible:isUserAuthenticated}})),[fullScreen,isClosable,isUserAuthenticated,handleLogout,setFullScreen,setClosableState,setExclusiveState,setShowAllThreads,setShowMentions,setShowStarred,setShowPinned,setShowMembers,setShowAllFiles,setShowSearch,setShowChannelinfo]),menuOptions=menuItems?.map((item=>item in options&&options[item].visible?{id:options[item].id,action:options[item].onClick,label:options[item].label,icon:options[item].iconName}:null)).filter((option=>null!==option)),surfaceOptions=surfaceItems?.map((item=>item in options&&options[item].visible?{id:options[item].id,onClick:options[item].onClick,label:options[item].label,iconName:options[item].iconName}:null)).filter((option=>null!==option));return(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.chatHeaderParent,className:`ec-chat-header ${classNames} ${className}`,style:{...styleOverrides,...style}},(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.chatHeaderChild},(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.channelDescription},(0,emotion_react_browser_esm.tZ)(Icon_a,{name:"hash",size:fullScreen?"1.25rem":"1rem"}),(0,emotion_react_browser_esm.tZ)(Box_n,null,isUserAuthenticated?(0,emotion_react_browser_esm.tZ)(react.Fragment,null,(0,emotion_react_browser_esm.tZ)(Heading_l,{level:3,className:"ec-chat-header--channelName",css:styles.clearSpacing},channelInfo.name||channelName||"channelName"),fullScreen&&(0,emotion_react_browser_esm.tZ)("p",{className:"ec-chat-header--channelDescription",css:styles.clearSpacing},channelInfo.description||"")):(0,emotion_react_browser_esm.tZ)(Heading_l,{level:3,className:"ec-chat-header--channelName",css:styles.clearSpacing},channelName||"Login to chat"))),(0,emotion_react_browser_esm.tZ)(Box_n,{css:styles.chatHeaderIconRow},avatarUrl&&(0,emotion_react_browser_esm.tZ)("img",{width:"20px",height:"20px",src:avatarUrl,alt:"avatar"}),surfaceOptions.length>0&&(0,emotion_react_browser_esm.tZ)(SurfaceMenu_SurfaceMenu,{options:surfaceOptions}),menuOptions.length>0&&(0,emotion_react_browser_esm.tZ)(Menu_o,{options:menuOptions}))),isThreadOpen&&(0,emotion_react_browser_esm.tZ)(DynamicHeader_DynamicHeader,{title:threadTitle,handleClose:closeThread,iconName:"arrow-back"}),!isThreadOpen&&filtered&&(0,emotion_react_browser_esm.tZ)(DynamicHeader_DynamicHeader,{title:headerTitle,handleClose:async()=>{isUserAuthenticated?getMessagesAndRoles():getMessagesAndRoles(anonymousMode),setFilter(!1)},iconName:"arrow-back",isHeaderIcon:!0,headerIconName:headerTitle&&headerTitle.includes("Pin")?"pin":"star"}))};ChatHeader.displayName="ChatHeader",ChatHeader.__docgenInfo={description:"",methods:[],displayName:"ChatHeader",props:{className:{defaultValue:{value:"''",computed:!1},description:"",type:{name:"string"},required:!1},style:{defaultValue:{value:"{}",computed:!1},description:"",type:{name:"object"},required:!1},optionConfig:{defaultValue:{value:"{\n surfaceItems: ['minmax', 'close'],\n menuItems: [\n 'thread',\n 'mentions',\n 'starred',\n 'pinned',\n 'files',\n 'members',\n 'search',\n 'rInfo',\n 'logout',\n ],\n}",computed:!1},required:!1},isClosable:{description:"",type:{name:"bool"},required:!1},fullScreen:{description:"",type:{name:"bool"},required:!1},setClosableState:{description:"",type:{name:"func"},required:!1},setFullScreen:{description:"",type:{name:"func"},required:!1}}};const ChatHeader_ChatHeader=ChatHeader;ChatHeader.propTypes={isClosable:prop_types_default().bool,fullScreen:prop_types_default().bool,setClosableState:prop_types_default().func,setFullScreen:prop_types_default().func,className:prop_types_default().string,style:prop_types_default().object};var DefaultTheme=__webpack_require__("./src/theme/DefaultTheme.js");async function saveTokenLocalStorage(token){"undefined"!=typeof localStorage&&localStorage.setItem("ec_token",token)}async function getTokenLocalStorage(){return"undefined"!=typeof localStorage?localStorage.getItem("ec_token"):null}async function deleteTokenLocalStorage(){"undefined"!=typeof localStorage&&localStorage.removeItem("ec_token")}async function saveTokenSecure(token){this.handleSecureLogin("save",token)}async function getTokenSecure(){const response=await this.handleSecureLogin("get");return void 0!==response?.token?response.token:null}async function deleteTokenSecure(){this.handleSecureLogin("delete")}const EmbeddedChat_styles_styles={embeddedchat:(theme,dark)=>(0,emotion_react_browser_esm.iv)("background:",theme.schemes[dark?"dark":"light"].background,";color:",theme.schemes[dark?"dark":"light"].foreground,";display:flex;flex-direction:column;border:",`1.5px solid ${theme.schemes[dark?"dark":"light"].border}`,";border-radius:",theme.radius,";overflow:hidden;",""),fullscreen:{name:"rqloae",styles:"position:fixed;top:0;left:0;width:100vw!important;height:100vh!important;max-width:unset!important;max-height:unset!important;border-radius:0;border:none"}},GlobalStyles=()=>{const{theme}=useTheme_i(),styles=(theme=>(0,emotion_react_browser_esm.iv)(".ec-embedded-chat *{box-sizing:border-box;margin:0;padding:0;}.ec-embedded-chat body{font-family:",theme.typography.default.fontFamily,";font-size:",theme.typography.default.fontSize,"px;font-weight:",theme.typography.default.fontWeightRegular,";}.ec-embedded-chat a{color:",theme.colors.foreground,";}.ec-embedded-chat ::-webkit-scrollbar{width:4px;height:7.7px;}.ec-embedded-chat ::-webkit-scrollbar-thumb{background:",color_o(theme.colors.primary,.5),";border-radius:4px;}.ec-embedded-chat ::-webkit-scrollbar-thumb:hover{background:",theme.colors.primary,";}.ec-embedded-chat ::-webkit-scrollbar-button{display:none;}@media (max-width: 780px){.ec-sidebar{position:absolute;width:100%!important;height:calc(100% - 56.39px)!important;min-width:250px!important;left:0;bottom:0;background:",theme.colors.background,"!important;}}",""))(theme);return(0,emotion_react_browser_esm.tZ)(emotion_react_browser_esm.xB,{styles})};GlobalStyles.displayName="GlobalStyles",GlobalStyles.__docgenInfo={description:"",methods:[],displayName:"GlobalStyles"};const views_GlobalStyles=GlobalStyles;var dist=__webpack_require__("../../node_modules/json5/dist/index.js"),dist_default=__webpack_require__.n(dist);const overrideECProps=(prevConfig,remoteConfig)=>{if(!remoteConfig||0===Object.keys(remoteConfig).length)return prevConfig;const updatedConfig={...prevConfig,...Object.keys(remoteConfig).reduce(((acc,key)=>{if(""!==remoteConfig[key])if("theme"===key){const parsedTheme=(str=>{try{return dist_default().parse(str)}catch(e){return console.error("Failed to parse theme: ",e),null}})(remoteConfig[key]);acc[key]=parsedTheme||prevConfig[key]}else acc[key]=remoteConfig[key];return acc}),{})};return updatedConfig},EmbeddedChat=props=>{const[config,setConfig]=(0,react.useState)((()=>props));(0,react.useEffect)((()=>{setConfig(props)}),[props]);const{isClosable=!1,setClosableState=()=>{},width="100%",height="95vh",host="http://localhost:3000",roomId="GENERAL",channelName,anonymousMode=!1,toastBarPosition="bottom right",showRoles=!1,showAvatar=!0,showUsername=!1,showName=!0,enableThreads=!1,theme=null,className="",style={},hideHeader=!1,auth={flow:"PASSWORD"},secure=!1,dark=!1,remoteOpt=!1}=config,hasMounted=(0,react.useRef)(!1),{classNames,styleOverrides}=useComponentOverrides_l("EmbeddedChat"),[fullScreen,setFullScreen]=(0,react.useState)(!1),[isSynced,setIsSynced]=(0,react.useState)(!remoteOpt),{getToken,saveToken,deleteToken}=function getTokenStorage(secure=!1){return secure?{saveToken:saveTokenSecure,getToken:getTokenSecure,deleteToken:deleteTokenSecure}:{saveToken:saveTokenLocalStorage,getToken:getTokenLocalStorage,deleteToken:deleteTokenLocalStorage}}(secure),{isUserAuthenticated,setIsUserAuthenticated,setUsername:setAuthenticatedUsername,setUserAvatarUrl:setAuthenticatedAvatarUrl,setUserId:setAuthenticatedUserId,setName:setAuthenticatedName,setRoles:setAuthenticatedUserRoles}=userStore((state=>({isUserAuthenticated:state.isUserAuthenticated,setIsUserAuthenticated:state.setIsUserAuthenticated,setUserAvatarUrl:state.setUserAvatarUrl,setUserId:state.setUserId,setName:state.setName,setUsername:state.setUsername,setRoles:state.setRoles}))),setIsLoginIn=loginStore((state=>state.setIsLoginIn)),setUserPinPermissions=userStore((state=>state.setUserPinPermissions)),setEditMessagePermissions=messageStore((state=>state.setEditMessagePermissions));if(isClosable&&!setClosableState)throw Error("Please provide a setClosableState to props when isClosable = true");const initializeRCInstance=(0,react.useCallback)((()=>new EmbeddedChatApi(host,roomId,{getToken,deleteToken,saveToken})),[host,roomId,getToken,deleteToken,saveToken]),[RCInstance,setRCInstance]=(0,react.useState)((()=>initializeRCInstance()));(0,react.useEffect)((()=>{if(hasMounted.current)return RCInstance.close().then((()=>{const newRCInstance=initializeRCInstance();setRCInstance(newRCInstance)})).catch(console.error),()=>{RCInstance.close().catch(console.error)};hasMounted.current=!0}),[roomId,host,initializeRCInstance]),(0,react.useEffect)((()=>{(async()=>{setIsLoginIn(!0);try{await RCInstance.autoLogin(auth);const permissions=await RCInstance.permissionInfo();setUserPinPermissions(permissions.update[150]),setEditMessagePermissions(permissions.update[28])}catch(error){console.error(error)}finally{setIsLoginIn(!1)}})()}),[RCInstance,auth,setIsLoginIn]),(0,react.useEffect)((()=>{RCInstance.auth.onAuthChange((user=>{user?RCInstance.connect().then((()=>{console.log(`Connected to RocketChat ${RCInstance.host}`);const{me}=user;setAuthenticatedAvatarUrl(me.avatarUrl),setAuthenticatedUsername(me.username),setAuthenticatedUserId(me._id),setAuthenticatedName(me.name),setAuthenticatedUserRoles(me.roles),setIsUserAuthenticated(!0)})).catch(console.error):setIsUserAuthenticated(!1)}))}),[RCInstance,setAuthenticatedName,setAuthenticatedUserId,setAuthenticatedUserRoles,setIsUserAuthenticated,setAuthenticatedAvatarUrl,setAuthenticatedUsername]),(0,react.useEffect)((()=>{remoteOpt&&(async()=>{try{const appInfo=await RCInstance.getRCAppInfo();if(appInfo){const remoteConfig=appInfo.propConfig;setConfig((prevConfig=>overrideECProps(prevConfig,remoteConfig)))}}catch(error){console.error("Error fetching remote config:",error)}finally{setIsSynced(!0)}})()}),[RCInstance,remoteOpt,setConfig,setIsSynced]);const ECOptions=(0,react.useMemo)((()=>({enableThreads,authFlow:auth.flow,width,height,host,roomId,channelName,showName,showRoles,showAvatar,showUsername,hideHeader,anonymousMode})),[enableThreads,auth.flow,width,height,host,roomId,channelName,showName,showRoles,showAvatar,showUsername,hideHeader,anonymousMode]),RCContextValue=(0,react.useMemo)((()=>({RCInstance,ECOptions})),[RCInstance,ECOptions]);return isSynced?(0,emotion_react_browser_esm.tZ)(a,{theme:theme||DefaultTheme.Z,mode:dark?"dark":"light"},(0,emotion_react_browser_esm.tZ)(RCInstanceProvider,{value:RCContextValue},(0,emotion_react_browser_esm.tZ)(Box_n,{css:[EmbeddedChat_styles_styles.embeddedchat(theme||DefaultTheme.Z,dark),(0,emotion_react_browser_esm.iv)("width:",width,";height:",height,";position:relative;",""),fullScreen&&EmbeddedChat_styles_styles.fullscreen,"",""],className:`ec-embedded-chat ${className} ${classNames}`,style:{...style,...styleOverrides}},(0,emotion_react_browser_esm.tZ)(views_GlobalStyles,null),(0,emotion_react_browser_esm.tZ)(ToastBarProvider_u,{position:toastBarPosition},hideHeader?null:(0,emotion_react_browser_esm.tZ)(ChatHeader_ChatHeader,{isClosable,setClosableState,fullScreen,setFullScreen}),(0,emotion_react_browser_esm.tZ)(ChatLayout_ChatLayout,null),(0,emotion_react_browser_esm.tZ)("div",{id:"overlay-items"}))))):null};EmbeddedChat.displayName="EmbeddedChat",EmbeddedChat.propTypes={width:prop_types_default().string,height:prop_types_default().string,isClosable:prop_types_default().bool,setClosableState:prop_types_default().func,host:prop_types_default().string,roomId:prop_types_default().string,channelName:prop_types_default().string,anonymousMode:prop_types_default().bool,toastBarPosition:prop_types_default().string,showRoles:prop_types_default().bool,showAvatar:prop_types_default().bool,enableThreads:prop_types_default().bool,theme:prop_types_default().object,auth:prop_types_default().oneOfType([prop_types_default().shape({flow:prop_types_default().oneOf(["PASSWORD"])}),prop_types_default().shape({flow:prop_types_default().oneOf(["OAUTH"])}),prop_types_default().shape({flow:prop_types_default().oneOf(["TOKEN"]),credentials:prop_types_default().object})]),className:prop_types_default().string,style:prop_types_default().object,hideHeader:prop_types_default().bool,dark:prop_types_default().bool},EmbeddedChat.__docgenInfo={description:"",methods:[],displayName:"EmbeddedChat",props:{width:{description:"",type:{name:"string"},required:!1},height:{description:"",type:{name:"string"},required:!1},isClosable:{description:"",type:{name:"bool"},required:!1},setClosableState:{description:"",type:{name:"func"},required:!1},host:{description:"",type:{name:"string"},required:!1},roomId:{description:"",type:{name:"string"},required:!1},channelName:{description:"",type:{name:"string"},required:!1},anonymousMode:{description:"",type:{name:"bool"},required:!1},toastBarPosition:{description:"",type:{name:"string"},required:!1},showRoles:{description:"",type:{name:"bool"},required:!1},showAvatar:{description:"",type:{name:"bool"},required:!1},enableThreads:{description:"",type:{name:"bool"},required:!1},theme:{description:"",type:{name:"object"},required:!1},auth:{description:"",type:{name:"union",value:[{name:"shape",value:{flow:{name:"enum",value:[{value:"'PASSWORD'",computed:!1}],required:!1}}},{name:"shape",value:{flow:{name:"enum",value:[{value:"'OAUTH'",computed:!1}],required:!1}}},{name:"shape",value:{flow:{name:"enum",value:[{value:"'TOKEN'",computed:!1}],required:!1},credentials:{name:"object",required:!1}}}]},required:!1},className:{description:"",type:{name:"string"},required:!1},style:{description:"",type:{name:"object"},required:!1},hideHeader:{description:"",type:{name:"bool"},required:!1},dark:{description:"",type:{name:"bool"},required:!1}}};const views_EmbeddedChat=(0,react.memo)(EmbeddedChat)},"./src/theme/DefaultTheme.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});const __WEBPACK_DEFAULT_EXPORT__={radius:"0.2rem",commonColors:{black:"hsl(0, 100%, 0%)",white:"hsl(0, 100%, 100%)"},schemes:{light:{background:"hsl(0, 0%, 100%)",foreground:"hsl(240, 10%, 3.9%)",card:"hsl(0, 0%, 100%)",cardForeground:"hsl(240, 10%, 3.9%)",popover:"hsl(0, 0%, 100%)",popoverForeground:"hsl(240, 10%, 3.9%)",primary:"hsl(240, 5.9%, 10%)",primaryForeground:"hsl(0, 0%, 98%)",secondary:"hsl(240, 4.8%, 95.9%)",secondaryForeground:"hsl(240, 5.9%, 10%)",muted:"hsl(240, 4.8%, 95.9%)",mutedForeground:"hsl(240, 3.8%, 46.1%)",accent:"hsl(240, 4.8%, 95.9%)",accentForeground:"hsl(240, 5.9%, 10%)",destructive:"hsl(0, 84.2%, 60.2%)",destructiveForeground:"hsl(0, 0%, 98%)",border:"hsl(240, 5.9%, 90%)",input:"hsl(240, 5.9%, 90%)",ring:"hsl(240, 5.9%, 10%)",warning:"hsl(38, 92%, 50%)",warningForeground:"hsl(48, 96%, 89%)",success:"hsl(91, 60.4%, 81.2%)",successForeground:"hsl(90, 61.1%, 14.1%)",info:"hsl(214, 76.4%, 50.2%)",infoForeground:"hsl(214.3, 77.8%, 92.9%)"},dark:{background:"hsl(240, 10%, 3.9%)",foreground:"hsl(0, 0%, 98%)",card:"hsl(240, 10%, 3.9%)",cardForeground:"hsl(0, 0%, 98%)",popover:"hsl(240, 10%, 3.9%)",popoverForeground:"hsl(0, 0%, 98%)",primary:"hsl(0, 0%, 98%)",primaryForeground:"hsl(240, 5.9%, 10%)",secondary:"hsl(240, 3.7%, 15.9%)",secondaryForeground:"hsl(0, 0%, 98%)",muted:"hsl(240, 3.7%, 15.9%)",mutedForeground:"hsl(240, 5%, 64.9%)",accent:"hsl(240, 3.7%, 15.9%)",accentForeground:"hsl(0, 0%, 98%)",destructive:"hsl(0, 62.8%, 30.6%)",destructiveForeground:"hsl(0, 0%, 98%)",border:"hsl(240, 3.7%, 15.9%)",input:"hsl(240, 3.7%, 15.9%)",ring:"hsl(240, 4.9%, 83.9%)",warning:"hsl(48, 96%, 89%)",warningForeground:"hsl(38, 92%, 50%)",success:"hsl(90, 61.1%, 14.1%)",successForeground:"hsl(90, 60%, 90.2%)",info:"hsl(214.3, 77.8%, 92.9%)",infoForeground:"hsl(214.4, 75.8%, 19.4%)"}},typography:{default:{fontFamily:"'Times New Roman', serif",fontSize:16,fontWeightRegular:400},h1:{fontSize:"2rem",fontWeight:800},h2:{fontSize:"1.5rem",fontWeight:800},h3:{fontSize:"1.3rem",fontWeight:400},h4:{fontSize:"1rem",fontWeight:400},h5:{fontSize:"0.83rem",fontWeight:400},h6:{fontSize:"0.67rem",fontWeight:500}},shadows:["none","rgba(17, 17, 26, 0.05) 0px 1px 0px, rgba(17, 17, 26, 0.1) 0px 0px 8px","rgba(100, 100, 111, 0.2) 0px 7px 29px 0px"]}},"../ui-elements/dist/esm/_virtual/_rollupPluginBabelHelpers.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{function t(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function e(r){for(var e=1;e=0||(o[e]=r[e]);return o}(r,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(r,e)&&(o[e]=r[e])}return o}function l(r,t){return t||(t=r.slice(0)),Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(t)}}))}function f(t,e){return function s(r){if(Array.isArray(r))return r}(t)||function r(r,t){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var n,o,a,i,u=[],l=!0,f=!1;try{if(a=(e=e.call(r)).next,0===t){if(Object(e)!==e)return;l=!1}else for(;!(l=(n=a.call(e)).done)&&(u.push(n.value),u.length!==t);l=!0);}catch(r){f=!0,o=r}finally{try{if(!l&&null!=e.return&&(i=e.return(),Object(i)!==i))return}finally{if(f)throw o}}return u}}(t,e)||p(t,e)||function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(r){return function y(r){if(Array.isArray(r))return m(r)}(r)||function b(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||p(r)||function d(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(r,t){if(r){if("string"==typeof r)return m(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?m(r,t):void 0}}function m(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){e=e.call(r)},n:function(){var r=e.next();return i=r.done,r},e:function(r){u=!0,a=r},f:function(){try{i||null==e.return||e.return()}finally{if(u)throw a}}}}__webpack_require__.d(__webpack_exports__,{AI:()=>l,Ac:()=>n,Kd:()=>u,ZQ:()=>f,Zj:()=>e,gY:()=>a,sf:()=>O,u:()=>c})},"../ui-elements/dist/esm/_virtual/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{p:()=>p});var p={exports:{}}},"../ui-elements/dist/esm/_virtual/index2.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{c:()=>r});var r={exports:{}}},"../ui-elements/dist/esm/_virtual/index3.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{s:()=>r});var r={exports:{}}},"../ui-kit/dist/esm/_virtual/_rollupPluginBabelHelpers.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{function r(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function e(t){for(var e=1;e=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(c&&f){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),A(e),d}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;A(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:k(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),d}},r}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}function a(t){return function(){var r=this,e=arguments;return new Promise((function(n,o){var a=t.apply(r,e);function u(t){i(a,n,o,u,c,"next",t)}function c(t){i(a,n,o,u,c,"throw",t)}u(void 0)}))}}function u(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function c(t,r){for(var e=0;et.length)&&(r=t.length);for(var e=0,n=new Array(r);e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw i}}}}function A(t){var r=function T(t,r){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==typeof r?r:String(r)}__webpack_require__.d(__webpack_exports__,{Ac:()=>o,PA:()=>u,WY:()=>m,XW:()=>y,ZQ:()=>g,Zj:()=>e,gY:()=>s,l5:()=>n,qH:()=>f,sf:()=>_,u:()=>w,x:()=>a})},"../ui-kit/dist/esm/_virtual/messageParser.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{m:()=>r});var r={exports:{}}},"../ui-kit/dist/esm/_virtual/messageParser.production.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{m:()=>r});var r={exports:{}}}}]); \ No newline at end of file diff --git a/pulls/pr-700/docs/404.html b/pulls/pr-700/docs/404.html index 50cf1e2ba..f514afb5b 100644 --- a/pulls/pr-700/docs/404.html +++ b/pulls/pr-700/docs/404.html @@ -5,7 +5,7 @@ Page Not Found | Embedded Chat - + diff --git a/pulls/pr-700/docs/assets/js/17e39949.b872f66c.js b/pulls/pr-700/docs/assets/js/17e39949.b872f66c.js new file mode 100644 index 000000000..3f24c5f2b --- /dev/null +++ b/pulls/pr-700/docs/assets/js/17e39949.b872f66c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[328],{3961:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>l,default:()=>a,frontMatter:()=>r,metadata:()=>h,toc:()=>d});var s=n(4848),i=n(8453);const r={},l="GSoC-2022",h={permalink:"/EmbeddedChat/pulls/pr-700/docs/blog/EmbeddedChat-2022",source:"@site/blog/EmbeddedChat-2022.md",title:"GSoC-2022",description:"Create a ready-to-go easy to embed mini-chat React component.",date:"2024-12-23T08:26:21.000Z",tags:[],readingTime:3.965,hasTruncateMarker:!1,authors:[],frontMatter:{},unlisted:!1,nextItem:{title:"Google Summer of Code 2023, RocketChat",permalink:"/EmbeddedChat/pulls/pr-700/docs/blog/EmbeddedChat-2023"}},c={authorsImageUrls:[]},d=[{value:"\u2b50 Project Abstract",id:"-project-abstract",level:2},{value:"\ud83d\udea2 Deliverables",id:"-deliverables",level:2},{value:"\ud83d\udcfa Demo",id:"-demo",level:2},{value:"Sneak Peak",id:"sneak-peak",level:3},{value:"Providing real-time chat functionality using RocketChat node.js SDK",id:"providing-real-time-chat-functionality-using-rocketchat-nodejs-sdk",level:3},{value:"Authentication using RocketChat\u2019s Google SSO",id:"authentication-using-rocketchats-google-sso",level:3},{value:"Adding EmojiOne Emoji Picker to the component to ensure cross-platform functioning of emojis.",id:"adding-emojione-emoji-picker-to-the-component-to-ensure-cross-platform-functioning-of-emojis",level:3},{value:"Using Rocket.Chat\u2019s REST API",id:"using-rocketchats-rest-api",level:3},{value:"Providing the functionality to pin/star/react to any message and mention users.",id:"providing-the-functionality-to-pinstarreact-to-any-message-and-mention-users",level:3},{value:"\ud83d\ude80 Contributions",id:"-contributions",level:2},{value:"PRs",id:"prs",level:3},{value:"My overall contributions at Rocket.Chat",id:"my-overall-contributions-at-rocketchat",level:3},{value:"\ud83d\ude0e Blog",id:"-blog",level:2},{value:"\ud83c\udf93 Mentor",id:"-mentor",level:2},{value:"\ud83d\udd17 Links",id:"-links",level:2},{value:"\u2764\ufe0f Support",id:"\ufe0f-support",level:2},{value:"\ud83d\udcac Connect With Me",id:"-connect-with-me",level:2}];function o(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{align:"center",children:[(0,s.jsx)("a",{href:"https://summerofcode.withgoogle.com/projects/#6521788818784256",children:(0,s.jsx)("img",{src:"https://i.imgur.com/pgkUceb.png",width:"650",alt:"google-summer-of-code"})}),(0,s.jsx)("br",{}),(0,s.jsx)("b",{children:(0,s.jsx)("p",{children:(0,s.jsx)(t.p,{children:"Create a ready-to-go easy to embed mini-chat React component."})})})]}),"\n",(0,s.jsx)("p",{align:"center",children:(0,s.jsx)("code",{children:(0,s.jsxs)(t.p,{children:[(0,s.jsx)("a",{href:"#-project-abstract",children:"Project Abstract"}),"\xa0\xa0\xa0\n",(0,s.jsx)("a",{href:"#-deliverables",children:"Deliverables"}),"\xa0\xa0\xa0\n",(0,s.jsx)("a",{href:"#-demo",children:"Demo"}),"\xa0\xa0\xa0\n",(0,s.jsx)("a",{href:"#-contributions",children:"Contributions"}),"\xa0\xa0\xa0\n",(0,s.jsx)("a",{href:"#-blog",children:"Blog"}),"\xa0\xa0\xa0\n",(0,s.jsx)("a",{href:"#-mentor",children:"Mentor"}),"\xa0\xa0\xa0\n",(0,s.jsx)("a",{href:"#-links",children:"Links"})]})})}),"\n",(0,s.jsxs)(t.p,{children:["I got a chance to work on a project called ",(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat",children:"EmbeddedChat"})," which is an in-app chat solution to web applications needing a chat component to increase user engagement."]}),"\n",(0,s.jsx)(t.p,{children:"From just an idea (proposal) to a complete product - 3 months of Google Summer of Code passed."}),"\n",(0,s.jsx)(t.p,{children:"I intend to maintain this repository as a final report summary of my GSoC work and a quick guide for all future GSoC aspirants."}),"\n",(0,s.jsx)(t.h2,{id:"-project-abstract",children:"\u2b50 Project Abstract"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"EmbeddedChat allows users to integrate RocketChat into their React web-based applications easily also providing an amazing developer experience while introducing in-app chat solutions."})}),"\n",(0,s.jsx)(t.h2,{id:"-deliverables",children:"\ud83d\udea2 Deliverables"}),"\n",(0,s.jsx)(t.p,{children:"The following are the deliverables of this project:"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsx)(t.li,{children:"Creation of UI using RocketChat Fuselage design system. [NEW]"}),"\n",(0,s.jsx)(t.li,{children:"Providing real-time chat functionality using RocketChat node.js SDK. [NEW]"}),"\n",(0,s.jsxs)(t.li,{children:["Authentication using RocketChat\u2019s Google SSO with an additional choice for ",(0,s.jsx)(t.code,{children:""})," login (if the user already has an account). [NEW]"]}),"\n",(0,s.jsx)(t.li,{children:"Adding EmojiOne Emoji Picker to the component to ensure cross-platform functioning of emojis.[NEW]"}),"\n",(0,s.jsx)(t.li,{children:"Using Rocket.Chat\u2019s REST API to: [NEW]"}),"\n"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Get channel details"}),"\n",(0,s.jsx)(t.li,{children:"Get the channel\u2019s pinned messages"}),"\n",(0,s.jsx)(t.li,{children:"Get the channel\u2019s starred messages"}),"\n",(0,s.jsx)(t.li,{children:"Get the channel attachments"}),"\n",(0,s.jsx)(t.li,{children:"Send a message to the channel"}),"\n",(0,s.jsx)(t.li,{children:"Get messages of the channel"}),"\n"]}),"\n",(0,s.jsxs)(t.ol,{start:"6",children:["\n",(0,s.jsx)(t.li,{children:"Providing the functionality to pin/star/react to any message and mention users. [NEW]"}),"\n"]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"All of the above deliverables were completed within the GSoC period. Yay! \ud83c\udf89"})}),"\n",(0,s.jsx)(t.h2,{id:"-demo",children:"\ud83d\udcfa Demo"}),"\n",(0,s.jsx)(t.h3,{id:"sneak-peak",children:"Sneak Peak"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{src:"https://user-images.githubusercontent.com/73601258/189498365-90bcc80a-4fb1-461b-a89e-99f1f8d31d95.gif",alt:"randomgifec"})}),"\n",(0,s.jsx)(t.h3,{id:"providing-real-time-chat-functionality-using-rocketchat-nodejs-sdk",children:"Providing real-time chat functionality using RocketChat node.js SDK"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.a,{href:"https://user-images.githubusercontent.com/73601258/189498385-1346c5af-ec75-42a9-b864-f6f3b1e49d88.mp4",children:"https://user-images.githubusercontent.com/73601258/189498385-1346c5af-ec75-42a9-b864-f6f3b1e49d88.mp4"})}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.a,{href:"https://user-images.githubusercontent.com/73601258/189498400-942f337a-0ee8-48e5-b539-70dc49d1e3e7.mp4",children:"https://user-images.githubusercontent.com/73601258/189498400-942f337a-0ee8-48e5-b539-70dc49d1e3e7.mp4"})}),"\n",(0,s.jsx)(t.h3,{id:"authentication-using-rocketchats-google-sso",children:"Authentication using RocketChat\u2019s Google SSO"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.a,{href:"https://user-images.githubusercontent.com/73601258/180390437-b28ceacb-7f3f-4b80-84c1-4e1709b6cd35.mp4",children:"https://user-images.githubusercontent.com/73601258/180390437-b28ceacb-7f3f-4b80-84c1-4e1709b6cd35.mp4"})}),"\n",(0,s.jsx)(t.h3,{id:"adding-emojione-emoji-picker-to-the-component-to-ensure-cross-platform-functioning-of-emojis",children:"Adding EmojiOne Emoji Picker to the component to ensure cross-platform functioning of emojis."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{src:"https://user-images.githubusercontent.com/73601258/189498628-119c0417-a8cd-4775-acdf-41fdd3b7bc62.png",alt:"image"})}),"\n",(0,s.jsx)(t.h3,{id:"using-rocketchats-rest-api",children:"Using Rocket.Chat\u2019s REST API"}),"\n",(0,s.jsxs)(t.p,{children:["Took an object-oriented programming approach to build this. Created an API wrapper that is super simple to set up.\n",(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/blob/main/src/lib/api.js",children:"Here"})," is the code."]}),"\n",(0,s.jsx)(t.h3,{id:"providing-the-functionality-to-pinstarreact-to-any-message-and-mention-users",children:"Providing the functionality to pin/star/react to any message and mention users."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.a,{href:"https://user-images.githubusercontent.com/73601258/189498498-602ddade-2883-43ac-91b7-9f63dc41cf84.mp4",children:"https://user-images.githubusercontent.com/73601258/189498498-602ddade-2883-43ac-91b7-9f63dc41cf84.mp4"})}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.a,{href:"https://user-images.githubusercontent.com/73601258/189498502-1310fb1c-293e-4bb4-a208-7b523dfdd23f.mp4",children:"https://user-images.githubusercontent.com/73601258/189498502-1310fb1c-293e-4bb4-a208-7b523dfdd23f.mp4"})}),"\n",(0,s.jsx)(t.h2,{id:"-contributions",children:"\ud83d\ude80 Contributions"}),"\n",(0,s.jsx)(t.h3,{id:"prs",children:"PRs"}),"\n",(0,s.jsx)("div",{align:"center",children:(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{style:{textAlign:"center"},children:"PR Link"}),(0,s.jsx)(t.th,{style:{textAlign:"center"},children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/1",children:"PR #1"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"[NEW] initialize project and base setup"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/4",children:"PR #4"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"NEW: issue and pr template"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/5",children:"PR #5"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"IMPROVE: Responsiveness"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/7",children:"PR #7"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"NEW: sending and receiving msgs (the oop way)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/11",children:"PR #11"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"Parsing emojis in message box"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/12",children:"PR #12"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"NEW: AUTH (google SSO)"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/15",children:"PR #15"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"NEW: Development documentation"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/26",children:"PR #26"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"[IMPROVE] UI/UX improvements"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/40",children:"PR #40"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"FIX: when host is https set useSSL as true"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/41",children:"PR #41"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"[IMPROVE] more options to be present whether or not its fullscreen"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/46",children:"PR #46"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"FIX: when cookies are there assume user present"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/47",children:"PR #47"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"CHORE: remove tech.co.html"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/48",children:"PR #48"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"Handling attachments"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/44",children:"PR #44"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"NEW: react to message"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/42",children:"PR #42"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"NEW: Pin and star messages"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/39",children:"PR #39"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"Add format to all files"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"center"},children:(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat/pull/29",children:"PR #29"})}),(0,s.jsx)(t.td,{style:{textAlign:"center"},children:"NEW: CI/CD Pipeline to deploy the package"})]})]})]})}),"\n",(0,s.jsx)(t.h3,{id:"my-overall-contributions-at-rocketchat",children:"My overall contributions at Rocket.Chat"}),"\n",(0,s.jsxs)(t.p,{children:["Besides my GSoC project I have been contributing prolifically to other Rocket.Chat projects - ",(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/Rocket.Chat.js.SDK",children:"RocketChat.js.SDK"}),", ",(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/RC4Community",children:"RC4Community"}),", ",(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/fuselage",children:"fuselage"}),", ",(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/Rocket.Chat",children:"Rocket.Chat"}),"."]}),"\n",(0,s.jsx)(t.h2,{id:"-blog",children:"\ud83d\ude0e Blog"}),"\n",(0,s.jsx)(t.p,{children:"I have been writing blogs regarding my progress in GSoC."}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"https://dev.to/sidmohanty11/my-journey-with-open-source-and-lessons-learned-30e7",children:"My journey with open source and lessons learned"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"https://dev.to/sidmohanty11/part-i-gsoc-2022-rocketchat-embeddedchat-3njh",children:"[PART-I] GSoC 2022 | Rocket.Chat | EmbeddedChat"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"https://dev.to/sidmohanty11/part-ii-gsoc-2022-rocketchat-embeddedchat-15g3",children:"[PART-II] GSoC 2022 | Rocket.Chat | EmbeddedChat"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"https://dev.to/sidmohanty11/final-part-gsoc-2022-rocketchat-embeddedchat-37g8",children:"Final Part: GSoC 2022 | Rocket.Chat | EmbeddedChat"})}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"-mentor",children:"\ud83c\udf93 Mentor"}),"\n",(0,s.jsx)(t.p,{children:"A big big thank you to my mentor for the guidance before and throughout GSoC. \ud83d\ude4f"}),"\n",(0,s.jsx)(t.p,{children:"I learned beyond GSoC from him and am forever grateful to be mentored by him."}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"Rohan Lekhwani"})," - ",(0,s.jsx)(t.a,{href:"https://github.com/RonLek",children:"GitHub"}),". ",(0,s.jsx)(t.a,{href:"https://www.linkedin.com/in/rohanlekhwani",children:"LinkedIn"})]}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"-links",children:"\ud83d\udd17 Links"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Read my EmbeddedChat project proposal that got me accepted to GSoC ",(0,s.jsx)(t.a,{href:"https://docs.google.com/document/d/1YeAz-hzv-7NY5HApraz0lOCNj2_Vc-ys_w2qp3qd-nQ/edit?usp=sharing",children:"here"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["I also complemented it with Figma designs. Check them out ",(0,s.jsx)(t.a,{href:"https://www.figma.com/file/hj0BqzAvB15zBv7A8fMYc9/RocketChat-ReactJS-Component?node-id=0%3A1",children:"here"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["My GSoC Presentation can be found ",(0,s.jsx)(t.a,{href:"https://docs.google.com/presentation/d/1hNO-iGlA0nnyHS5o6XlgwGaYP7IgOtcHdg--HCFNABY/edit?usp=sharing",children:"here"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Watch the above presentation in video - ",(0,s.jsx)(t.a,{href:"https://www.youtube.com/watch?v=gcB5c6cvg9w&t=6s",children:"here"})," !"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"\ufe0f-support",children:"\u2764\ufe0f Support"}),"\n",(0,s.jsx)(t.p,{children:"Learned something new today? Reciprocate the love. \u2b50 this repo for good karma."}),"\n",(0,s.jsx)(t.h2,{id:"-connect-with-me",children:"\ud83d\udcac Connect With Me"}),"\n",(0,s.jsx)(t.p,{children:"Want to discuss about GSoC / Rocket.Chat / Open-source ? Let's connect!"}),"\n",(0,s.jsx)("div",{align:"center",children:(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{style:{textAlign:"left"},children:(0,s.jsx)(t.strong,{children:"Student"})}),(0,s.jsx)(t.th,{style:{textAlign:"left"},children:"Sidharth Mohanty"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.strong,{children:"Organization"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"https://rocket.chat/",children:"Rocket.Chat"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.strong,{children:"Project"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"https://docs.rocket.chat/contributors/annual-contribution-programs/google-summer-of-code/google-summer-of-code-2022#rocket.chat-reactjs-fullstack-component",children:"EmbeddedChat"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.strong,{children:"GitHub"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"https://github.com/sidmohanty11",children:"@sidmohanty11"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.strong,{children:"LinkedIn"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"https://www.linkedin.com/in/sidmohanty11",children:"sidmohanty11"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.strong,{children:"Twitter"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"https://www.twitter.com/sidmohanty11",children:"sidmohanty11"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.strong,{children:"Blogs"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"https://dev.to/sidmohanty11",children:"sidmohanty11"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.strong,{children:"Website"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"https://sidmohanty11.github.io",children:"sidmohanty11.github.io"})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.strong,{children:"Email"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)("a",{href:"mailto:sidmohanty11@gmail.com",children:(0,s.jsx)(t.a,{href:"mailto:sidmohanty11@gmail.com",children:"sidmohanty11@gmail.com"})})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.strong,{children:"Rocket.Chat"})}),(0,s.jsx)(t.td,{style:{textAlign:"left"},children:(0,s.jsx)(t.a,{href:"https://open.rocket.chat/direct/sidharth.mohanty",children:"sidharth.mohanty"})})]})]})]})})]})}function a(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(o,{...e})}):o(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>l,x:()=>h});var s=n(6540);const i={},r=s.createContext(i);function l(e){const t=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function h(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),s.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/pulls/pr-700/docs/assets/js/2496bf96.c8172afc.js b/pulls/pr-700/docs/assets/js/2496bf96.c8172afc.js new file mode 100644 index 000000000..a5ad3c41c --- /dev/null +++ b/pulls/pr-700/docs/assets/js/2496bf96.c8172afc.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[101],{4192:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>a,default:()=>l,frontMatter:()=>r,metadata:()=>d,toc:()=>h});var s=n(4848),i=n(8453);const r={},a="Google Summer of Code 2023, RocketChat",d={permalink:"/EmbeddedChat/pulls/pr-700/docs/blog/EmbeddedChat-2023",source:"@site/blog/EmbeddedChat-2023.md",title:"Google Summer of Code 2023, RocketChat",description:"Create a ready-to-go easy to embed mini-chat React component.",date:"2024-12-23T08:26:21.000Z",tags:[],readingTime:5.9,hasTruncateMarker:!1,authors:[],frontMatter:{},unlisted:!1,prevItem:{title:"GSoC-2022",permalink:"/EmbeddedChat/pulls/pr-700/docs/blog/EmbeddedChat-2022"},nextItem:{title:"Google Summer of Code 2024, RocketChat",permalink:"/EmbeddedChat/pulls/pr-700/docs/blog/EmbeddedChat-2024"}},o={authorsImageUrls:[]},h=[{value:"\u2b50 Project Abstract",id:"-project-abstract",level:2},{value:"\ud83d\udea2 Deliverables",id:"-deliverables",level:2},{value:"Demo",id:"demo",level:2},{value:"Sneak Peak",id:"sneak-peak",level:3},{value:"Moving to mono repo",id:"moving-to-mono-repo",level:3},{value:"Storybook setup",id:"storybook-setup",level:3},{value:"HTML Embedd Feature",id:"html-embedd-feature",level:3},{value:"Theming",id:"theming",level:3},{value:"Improving API",id:"improving-api",level:3},{value:"Support for slash commands",id:"support-for-slash-commands",level:3},{value:"React Native",id:"react-native",level:3},{value:"Improving Auth",id:"improving-auth",level:3},{value:"\ud83d\ude80 Contributions",id:"-contributions",level:2},{value:"Pull requests to Embeddedchat",id:"pull-requests-to-embeddedchat",level:3},{value:"My overall contributions to RocketChat",id:"my-overall-contributions-to-rocketchat",level:3},{value:"\ud83c\udf93 Mentor",id:"-mentor",level:2},{value:"\ud83d\udd17 Links",id:"-links",level:2},{value:"\u2764\ufe0f Support",id:"\ufe0f-support",level:2},{value:"\ud83d\udcac Connect With Me",id:"-connect-with-me",level:2}];function c(e){const t={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("a",{href:"https://summerofcode.withgoogle.com/projects/#6521788818784256",children:(0,s.jsx)("img",{src:"https://i.imgur.com/pgkUceb.png",width:"650",alt:"google-summer-of-code"})}),(0,s.jsx)("br",{}),(0,s.jsx)("b",{children:(0,s.jsx)("p",{children:(0,s.jsx)(t.p,{children:"Create a ready-to-go easy to embed mini-chat React component."})})})]}),"\n",(0,s.jsxs)(t.p,{children:["I worked on a project called ",(0,s.jsx)(t.a,{href:"https://github.com/RocketChat/EmbeddedChat",children:"EmbeddedChat"})," which is an in-app chat solution that utilizes the RocketChat chat engine through its REST and real-time APIs to support powerful chat features like reactions, online presence, typing status, threads, and much more."]}),"\n",(0,s.jsx)(t.p,{children:"I would maintain this repository as the final report summary of my GSoC 2023 project and a quick guide for all future GSoC aspirants."}),"\n",(0,s.jsx)(t.h2,{id:"-project-abstract",children:"\u2b50 Project Abstract"}),"\n",(0,s.jsx)(t.p,{children:"The goal of the project is to make a ready-to-use chat solution that could be integrated into any website, web app, or app. This project was a major refactoring and enhancement for the EmbeddedChat 2022 project."}),"\n",(0,s.jsx)(t.h2,{id:"-deliverables",children:"\ud83d\udea2 Deliverables"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Improve authentication - support all OAuth services"}),"\n",(0,s.jsx)(t.li,{children:"Move to a mono repo - auth, api, react, react-native, HTML embed"}),"\n",(0,s.jsx)(t.li,{children:"HTML embed feature"}),"\n",(0,s.jsx)(t.li,{children:"Theming"}),"\n",(0,s.jsx)(t.li,{children:"Improving API"}),"\n",(0,s.jsx)(t.li,{children:"Support for slash commands"}),"\n",(0,s.jsx)(t.li,{children:"Migrating from the fuselage to our own minimal components"}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"demo",children:"Demo"}),"\n",(0,s.jsx)(t.h3,{id:"sneak-peak",children:"Sneak Peak"}),"\n",(0,s.jsxs)(t.p,{children:["EmbeddedChat integrated into my esportsweb.in website.\n",(0,s.jsx)(t.img,{src:"https://github.com/abhinavkrin/GSoC-RocketChat-2023/assets/15830206/e42fd503-c7f7-4f30-abbb-9123d9c87257",alt:"EmbeddedChat Reac component"})]}),"\n",(0,s.jsx)(t.h3,{id:"moving-to-mono-repo",children:"Moving to mono repo"}),"\n",(0,s.jsxs)(t.p,{children:["EmbeddedChat's new mono repo structure\n",(0,s.jsx)(t.img,{src:"https://github.com/abhinavkrin/GSoC-RocketChat-2023/assets/15830206/ae7593e1-5479-465a-ab9a-e73c6ee85cd6",alt:"structure"})]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.em,{children:"auth"})," - The auth package includes functions to easily log into a Rocket chat server. Though it is used by embeddedchat's react and react-native client, developers can use this package for their own use cases."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.em,{children:"api"})," - The api package includes functions that are all required to create a chat application using the Rocketchat server. It has functions like connect, login, sendMesage, pinMessage, starMessage, deleteMessage, triggerBlockAction, etc. to perform various operations. One can listen to new/updated message events by attaching event listeners using ",(0,s.jsx)(t.code,{children:"addMessageListener"}),". There are other event listeners which could be added using ",(0,s.jsx)(t.code,{children:"addMessageDeleteListener"}),", ",(0,s.jsx)(t.code,{children:"addTypingStatusListener"}),", ",(0,s.jsx)(t.code,{children:"addActionTriggeredListener"}),", ",(0,s.jsx)(t.code,{children:"addUiInteractionListener"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.em,{children:"react"})," - The react package includes the react components to integrate EmbeddedChat."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.em,{children:"react-native"})," - The react-native project aims at using EmbeddedChat in react native mobile apps."]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.em,{children:"htmembed"})," - With this project EmbeddedChat could be integrated into any web app by simply embedding an HTML snippet."]}),"\n"]}),"\n",(0,s.jsx)(t.h3,{id:"storybook-setup",children:"Storybook setup"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{src:"https://github.com/abhinavkrin/GSoC-RocketChat-2023/assets/15830206/5e7e6f05-6ead-4d3b-bb0e-22befacf3cf1",alt:"Screenshot from 2023-09-25 12-09-07"})}),"\n",(0,s.jsx)(t.h3,{id:"html-embedd-feature",children:"HTML Embedd Feature"}),"\n",(0,s.jsx)(t.p,{children:"Simple integrate embedded chat by pasting html snippet into your website"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{children:"
\n +GSoC-2022 | Embedded Chat - + -

GSoC-2022

· 4 min read
google-summer-of-code

Create a ready-to-go easy to embed mini-chat React component.

+

GSoC-2022

· 4 min read
google-summer-of-code

Create a ready-to-go easy to embed mini-chat React component.

Project Abstract    Deliverables    Demo    diff --git a/pulls/pr-700/docs/blog/EmbeddedChat-2023/index.html b/pulls/pr-700/docs/blog/EmbeddedChat-2023/index.html index 63cd3a18a..f9060926e 100644 --- a/pulls/pr-700/docs/blog/EmbeddedChat-2023/index.html +++ b/pulls/pr-700/docs/blog/EmbeddedChat-2023/index.html @@ -3,13 +3,13 @@ -Google Summer of Code 2023, RocketChat | Embedded Chat +Google Summer of Code 2023, RocketChat | Embedded Chat - + -

Google Summer of Code 2023, RocketChat

· 6 min read
google-summer-of-code

Create a ready-to-go easy to embed mini-chat React component.

+

Google Summer of Code 2023, RocketChat

· 6 min read
google-summer-of-code

Create a ready-to-go easy to embed mini-chat React component.

I worked on a project called EmbeddedChat which is an in-app chat solution that utilizes the RocketChat chat engine through its REST and real-time APIs to support powerful chat features like reactions, online presence, typing status, threads, and much more.

I would maintain this repository as the final report summary of my GSoC 2023 project and a quick guide for all future GSoC aspirants.

⭐ Project Abstract

diff --git a/pulls/pr-700/docs/blog/EmbeddedChat-2024/index.html b/pulls/pr-700/docs/blog/EmbeddedChat-2024/index.html index ae80a94e5..bcc70373f 100644 --- a/pulls/pr-700/docs/blog/EmbeddedChat-2024/index.html +++ b/pulls/pr-700/docs/blog/EmbeddedChat-2024/index.html @@ -3,13 +3,13 @@ -Google Summer of Code 2024, RocketChat | Embedded Chat +Google Summer of Code 2024, RocketChat | Embedded Chat - + -

Google Summer of Code 2024, RocketChat

· 8 min read
google-summer-of-code
+

Google Summer of Code 2024, RocketChat

· 8 min read
google-summer-of-code

📘 Introduction

During my GSoC period, I worked on EmbeddedChat, a lightweight chat widget that uses the RocketChat engine's REST and real-time APIs to deliver comprehensive chat features, customizable options, and attractive theming capabilities.

⭐ Project Abstract

diff --git a/pulls/pr-700/docs/blog/archive/index.html b/pulls/pr-700/docs/blog/archive/index.html index b9dd94d62..5056c959e 100644 --- a/pulls/pr-700/docs/blog/archive/index.html +++ b/pulls/pr-700/docs/blog/archive/index.html @@ -5,10 +5,10 @@ Archive | Embedded Chat - + - + \ No newline at end of file diff --git a/pulls/pr-700/docs/blog/atom.xml b/pulls/pr-700/docs/blog/atom.xml index 43b3e0220..69756fad5 100644 --- a/pulls/pr-700/docs/blog/atom.xml +++ b/pulls/pr-700/docs/blog/atom.xml @@ -2,7 +2,7 @@ https://rocketchat.github.io/EmbeddedChat/pulls/pr-700/docs/blog Embedded Chat Blog - 2024-12-22T10:03:53.000Z + 2024-12-23T08:26:21.000Z https://github.com/jpmonette/feed Embedded Chat Blog @@ -11,7 +11,7 @@ <![CDATA[GSoC-2022]]> https://rocketchat.github.io/EmbeddedChat/pulls/pr-700/docs/blog/EmbeddedChat-2022 - 2024-12-22T10:03:53.000Z + 2024-12-23T08:26:21.000Z google-summer-of-code

Create a ready-to-go easy to embed mini-chat React component.

Project Abstract    @@ -107,7 +107,7 @@ <![CDATA[Google Summer of Code 2023, RocketChat]]> https://rocketchat.github.io/EmbeddedChat/pulls/pr-700/docs/blog/EmbeddedChat-2023 - 2024-12-22T10:03:53.000Z + 2024-12-23T08:26:21.000Z

google-summer-of-code

Create a ready-to-go easy to embed mini-chat React component.

I worked on a project called EmbeddedChat which is an in-app chat solution that utilizes the RocketChat chat engine through its REST and real-time APIs to support powerful chat features like reactions, online presence, typing status, threads, and much more.

@@ -195,7 +195,7 @@ I learned beyond GSoC from him and am forever grateful to be mentored by him.

https://rocketchat.github.io/EmbeddedChat/pulls/pr-700/docs/blog/EmbeddedChat-2024 - 2024-12-22T10:03:53.000Z + 2024-12-23T08:26:21.000Z google-summer-of-code

📘 Introduction

diff --git a/pulls/pr-700/docs/blog/index.html b/pulls/pr-700/docs/blog/index.html index 9d599b3d4..0fd2d1958 100644 --- a/pulls/pr-700/docs/blog/index.html +++ b/pulls/pr-700/docs/blog/index.html @@ -3,13 +3,13 @@ -Blog | Embedded Chat +Blog | Embedded Chat - + -

GSoC-2022

· 4 min read
google-summer-of-code

Create a ready-to-go easy to embed mini-chat React component.

+

GSoC-2022

· 4 min read
google-summer-of-code

Create a ready-to-go easy to embed mini-chat React component.

Project Abstract    Deliverables    Demo    @@ -97,7 +97,7 @@

❤️ SupportLearned something new today? Reciprocate the love. ⭐ this repo for good karma.

💬 Connect With Me

Want to discuss about GSoC / Rocket.Chat / Open-source ? Let's connect!

-
StudentSidharth Mohanty
OrganizationRocket.Chat
ProjectEmbeddedChat
GitHub@sidmohanty11
LinkedInsidmohanty11
Twittersidmohanty11
Blogssidmohanty11
Websitesidmohanty11.github.io
Emailsidmohanty11@gmail.com
Rocket.Chatsidharth.mohanty

Google Summer of Code 2023, RocketChat

· 6 min read
google-summer-of-code

Create a ready-to-go easy to embed mini-chat React component.

I worked on a project called EmbeddedChat which is an in-app chat solution that utilizes the RocketChat chat engine through its REST and real-time APIs to support powerful chat features like reactions, online presence, typing status, threads, and much more.

I would maintain this repository as the final report summary of my GSoC 2023 project and a quick guide for all future GSoC aspirants.

⭐ Project Abstract

@@ -177,7 +177,7 @@

❤️ SupportLearned something new today? Reciprocate the love. ⭐ this repo for good karma.

💬 Connect With Me

Want to discuss about GSoC / Rocket.Chat / Open-source ? Let's connect!

-
StudentAbhinav Kumar
OrganizationRocket.Chat
ProjectEmbeddedChat 2023
GitHub@abhinavkrin
LinkedInabhinavkrin
Twitterabhinavkr_in
Websiteavitechlab.com
Emailabhinav@avitechlab.com
Rocket.Chatabhinav.kumar30

Google Summer of Code 2024, RocketChat

· 8 min read
google-summer-of-code

📘 Introduction

During my GSoC period, I worked on EmbeddedChat, a lightweight chat widget that uses the RocketChat engine's REST and real-time APIs to deliver comprehensive chat features, customizable options, and attractive theming capabilities.

⭐ Project Abstract

diff --git a/pulls/pr-700/docs/blog/rss.xml b/pulls/pr-700/docs/blog/rss.xml index 40a321d4c..322c56c17 100644 --- a/pulls/pr-700/docs/blog/rss.xml +++ b/pulls/pr-700/docs/blog/rss.xml @@ -4,7 +4,7 @@ Embedded Chat Blog https://rocketchat.github.io/EmbeddedChat/pulls/pr-700/docs/blog Embedded Chat Blog - Sun, 22 Dec 2024 10:03:53 GMT + Mon, 23 Dec 2024 08:26:21 GMT https://validator.w3.org/feed/docs/rss2.html https://github.com/jpmonette/feed en @@ -12,7 +12,7 @@ <![CDATA[GSoC-2022]]> https://rocketchat.github.io/EmbeddedChat/pulls/pr-700/docs/blog/EmbeddedChat-2022 https://rocketchat.github.io/EmbeddedChat/pulls/pr-700/docs/blog/EmbeddedChat-2022 - Sun, 22 Dec 2024 10:03:53 GMT + Mon, 23 Dec 2024 08:26:21 GMT google-summer-of-code

Create a ready-to-go easy to embed mini-chat React component.

Project Abstract    @@ -108,7 +108,7 @@ <![CDATA[Google Summer of Code 2023, RocketChat]]> https://rocketchat.github.io/EmbeddedChat/pulls/pr-700/docs/blog/EmbeddedChat-2023 https://rocketchat.github.io/EmbeddedChat/pulls/pr-700/docs/blog/EmbeddedChat-2023 - Sun, 22 Dec 2024 10:03:53 GMT + Mon, 23 Dec 2024 08:26:21 GMT google-summer-of-code

Create a ready-to-go easy to embed mini-chat React component.

I worked on a project called EmbeddedChat which is an in-app chat solution that utilizes the RocketChat chat engine through its REST and real-time APIs to support powerful chat features like reactions, online presence, typing status, threads, and much more.

@@ -196,7 +196,7 @@ I learned beyond GSoC from him and am forever grateful to be mentored by him.

https://rocketchat.github.io/EmbeddedChat/pulls/pr-700/docs/blog/EmbeddedChat-2024 https://rocketchat.github.io/EmbeddedChat/pulls/pr-700/docs/blog/EmbeddedChat-2024 - Sun, 22 Dec 2024 10:03:53 GMT + Mon, 23 Dec 2024 08:26:21 GMT google-summer-of-code

📘 Introduction

diff --git a/pulls/pr-700/docs/docs/Development/dev_launch/index.html b/pulls/pr-700/docs/docs/Development/dev_launch/index.html index 98cf84251..296758825 100644 --- a/pulls/pr-700/docs/docs/Development/dev_launch/index.html +++ b/pulls/pr-700/docs/docs/Development/dev_launch/index.html @@ -5,7 +5,7 @@ Dev Launch | Embedded Chat - + diff --git a/pulls/pr-700/docs/docs/Development/theming_technical/index.html b/pulls/pr-700/docs/docs/Development/theming_technical/index.html index 4afd84880..626991586 100644 --- a/pulls/pr-700/docs/docs/Development/theming_technical/index.html +++ b/pulls/pr-700/docs/docs/Development/theming_technical/index.html @@ -5,7 +5,7 @@ Theme insights | Embedded Chat - + diff --git a/pulls/pr-700/docs/docs/Development/ui-elements/index.html b/pulls/pr-700/docs/docs/Development/ui-elements/index.html index 700f38129..4289e7e91 100644 --- a/pulls/pr-700/docs/docs/Development/ui-elements/index.html +++ b/pulls/pr-700/docs/docs/Development/ui-elements/index.html @@ -5,7 +5,7 @@ UI-Elements | Embedded Chat - + diff --git a/pulls/pr-700/docs/docs/Usage/authentication/index.html b/pulls/pr-700/docs/docs/Usage/authentication/index.html index 263d26bf4..19b498352 100644 --- a/pulls/pr-700/docs/docs/Usage/authentication/index.html +++ b/pulls/pr-700/docs/docs/Usage/authentication/index.html @@ -5,7 +5,7 @@ Authentication Guide | Embedded Chat - + diff --git a/pulls/pr-700/docs/docs/Usage/ec_rc_setup/index.html b/pulls/pr-700/docs/docs/Usage/ec_rc_setup/index.html index bd377ea46..237396d1c 100644 --- a/pulls/pr-700/docs/docs/Usage/ec_rc_setup/index.html +++ b/pulls/pr-700/docs/docs/Usage/ec_rc_setup/index.html @@ -5,7 +5,7 @@ Quick Control Guide | Embedded Chat - + diff --git a/pulls/pr-700/docs/docs/Usage/embeddedchat_setup/index.html b/pulls/pr-700/docs/docs/Usage/embeddedchat_setup/index.html index 13f305feb..8e91c376d 100644 --- a/pulls/pr-700/docs/docs/Usage/embeddedchat_setup/index.html +++ b/pulls/pr-700/docs/docs/Usage/embeddedchat_setup/index.html @@ -5,7 +5,7 @@ Installation | Embedded Chat - + diff --git a/pulls/pr-700/docs/docs/Usage/layout_editor/index.html b/pulls/pr-700/docs/docs/Usage/layout_editor/index.html index 4cb2c8abf..eb7f142b9 100644 --- a/pulls/pr-700/docs/docs/Usage/layout_editor/index.html +++ b/pulls/pr-700/docs/docs/Usage/layout_editor/index.html @@ -5,7 +5,7 @@ Layout Editor | Embedded Chat - + diff --git a/pulls/pr-700/docs/docs/Usage/theming/index.html b/pulls/pr-700/docs/docs/Usage/theming/index.html index 106a3cc05..d5b01e207 100644 --- a/pulls/pr-700/docs/docs/Usage/theming/index.html +++ b/pulls/pr-700/docs/docs/Usage/theming/index.html @@ -5,7 +5,7 @@ Theming Guide | Embedded Chat - + diff --git a/pulls/pr-700/docs/docs/introduction/index.html b/pulls/pr-700/docs/docs/introduction/index.html index 976441414..87bb7cdcb 100644 --- a/pulls/pr-700/docs/docs/introduction/index.html +++ b/pulls/pr-700/docs/docs/introduction/index.html @@ -5,7 +5,7 @@ Introduction | Embedded Chat - + diff --git a/pulls/pr-700/docs/index.html b/pulls/pr-700/docs/index.html index 70ab39375..648923d6b 100644 --- a/pulls/pr-700/docs/index.html +++ b/pulls/pr-700/docs/index.html @@ -5,7 +5,7 @@ Embedded Chat | Embedded Chat - + diff --git a/pulls/pr-700/docs/markdown-page/index.html b/pulls/pr-700/docs/markdown-page/index.html index 9bf831c4a..38f63dac1 100644 --- a/pulls/pr-700/docs/markdown-page/index.html +++ b/pulls/pr-700/docs/markdown-page/index.html @@ -5,7 +5,7 @@ Markdown page example | Embedded Chat - + diff --git a/pulls/pr-700/iframe.html b/pulls/pr-700/iframe.html index de96ffee6..aeb8d8f58 100644 --- a/pulls/pr-700/iframe.html +++ b/pulls/pr-700/iframe.html @@ -348,7 +348,7 @@ window['DOCS_OPTIONS'] = {"defaultName":"Docs","autodocs":"tag"};