"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk6LDWPPMNjs = require('./chunk-6LDWPPMN.js');var _chunkZZILP3JHjs = require('./chunk-ZZILP3JH.js');var _chunkWU2BEBARjs = require('./chunk-WU2BEBAR.js');var _chunkBUTRJNO3js = require('./chunk-BUTRJNO3.js');var _chunkSYNQ4BWLjs = require('./chunk-SYNQ4BWL.js');var _chunkMBKDZBVUjs = require('./chunk-MBKDZBVU.js');var _chunk74X4UOY6js = require('./chunk-74X4UOY6.js');var _chunkTQO5DI2Sjs = require('./chunk-TQO5DI2S.js');var _react = require('react');var _authentication = require('@baseapp-frontend/authentication');var _avatars = require('@baseapp-frontend/design-system/components/web/avatars');var _buttons = require('@baseapp-frontend/design-system/components/web/buttons');var _icons = require('@baseapp-frontend/design-system/components/web/icons');var _images = require('@baseapp-frontend/design-system/components/web/images');var _popovers = require('@baseapp-frontend/design-system/components/web/popovers');var _typographies = require('@baseapp-frontend/design-system/components/web/typographies');var _common = require('@baseapp-frontend/design-system/hooks/common');var _web = require('@baseapp-frontend/design-system/hooks/web');var _material = require('@mui/material');var _reactrelay = require('react-relay');var _jsxruntime = require('react/jsx-runtime');function M(o,t){return no(o)||io(o,t)||eo(o,t)||to()}function to(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eo(o,t){if(o){if(typeof o=="string")return G(o,t);var r={}.toString.call(o).slice(8,-1);return r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set"?Array.from(o):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?G(o,t):void 0}}function G(o,t){(t==null||t>o.length)&&(t=o.length);for(var r=0,n=Array(t);r<t;r++)n[r]=o[r];return n}function io(o,t){var r=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(r!=null){var n,m,f,u,l=[],a=!0,s=!1;try{if(f=(r=r.call(o)).next,t===0){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=f.call(r)).done)&&(l.push(n.value),l.length!==t);a=!0);}catch(C){s=!0,m=C}finally{try{if(!a&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(s)throw m}}return l}}function no(o){if(Array.isArray(o))return o}var yo=function(t){var r,n,m=t.isArchived,f=t.participantsCount,u=t.roomTitleRef,l=t.onDisplayGroupDetailsClicked,a=t.roomId,s=_reactrelay.useFragment.call(void 0, _chunkBUTRJNO3js.a,u),C=_react.useState.call(void 0, !1),y=M(C,2),B=y[0],A=y[1],N=_authentication.useCurrentProfile.call(void 0, ),i=N.currentProfile,g=_web.useResponsive.call(void 0, "up","md"),$=_chunkMBKDZBVUjs.a.call(void 0, ),E=$.resetChatRoom,h=s.isGroup,b=_chunk74X4UOY6js.b.call(void 0, s),U=b.title,z=b.avatar,q=_reactrelay.useFragment.call(void 0, _chunkTQO5DI2Sjs.a,s),J=q.participants,K=_chunk74X4UOY6js.e.call(void 0, J),Q=K.isSoleAdmin,V=_chunk74X4UOY6js.c.call(void 0, f),c=_common.usePopover.call(void 0, ),X=_chunkSYNQ4BWLjs.b.call(void 0, ),k=M(X,2),Y=k[0],Z=k[1],oo=function(){c.onClose(),i!=null&&i.id&&a&&Y({variables:{input:{roomId:a,profileId:i.id,archive:!m}}})},ro=function(v){v.stopPropagation(),c.onOpen(v)};return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkWU2BEBARjs.a,{open:B,onClose:function(){return A(!1)},profileId:(r=_optionalChain([i, 'optionalAccess', _2 => _2.id]))!==null&&r!==void 0?r:"",roomId:a,removingParticipantId:(n=_optionalChain([i, 'optionalAccess', _3 => _3.id]))!==null&&n!==void 0?n:"",isSoleAdmin:Q}),_jsxruntime.jsxs.call(void 0, _chunkZZILP3JHjs.a,{children:[g?_jsxruntime.jsx.call(void 0, "div",{}):_jsxruntime.jsx.call(void 0, _chunkZZILP3JHjs.c,{children:_jsxruntime.jsx.call(void 0, _buttons.IconButton,{"aria-label":"return to chat room list",onClick:E,sx:{maxWidth:"fit-content"},children:_jsxruntime.jsx.call(void 0, _images.Iconify,{icon:"eva:arrow-ios-back-fill",width:24})})}),_jsxruntime.jsxs.call(void 0, _chunkZZILP3JHjs.b,{onClick:h?l:void 0,isClickable:h,children:[_jsxruntime.jsx.call(void 0, _avatars.AvatarWithPlaceholder,{className:"self-start justify-self-center",width:32,height:32,src:z,sx:{border:"none",alignSelf:"center"}}),_jsxruntime.jsxs.call(void 0, _material.Box,{children:[_jsxruntime.jsx.call(void 0, _typographies.TypographyWithEllipsis,{component:"span",variant:"subtitle2",maxWidth:g?"300px":"200px",sx:{float:"left",clear:"left"},children:U}),h&&_jsxruntime.jsx.call(void 0, _material.Typography,{component:"span",variant:"caption",sx:{float:"left",clear:"left"},children:V})]}),_jsxruntime.jsxs.call(void 0, _material.Box,{children:[_jsxruntime.jsx.call(void 0, _buttons.IconButton,{onClick:ro,"aria-label":"Show chatroom options",children:_jsxruntime.jsx.call(void 0, _icons.ThreeDotsIcon,{sx:{fontSize:"24px"}})}),_jsxruntime.jsx.call(void 0, _popovers.Popover,{open:c.open,onClose:c.onClose,slotProps:{root:{onClick:function(v){return v.stopPropagation()}}},children:_jsxruntime.jsx.call(void 0, _chunk6LDWPPMNjs.a,{isArchived:m,isArchiveMutationInFlight:Z,isGroup:h,onArchiveClicked:oo,onDetailsClicked:function(){c.onClose(),l()},onLeaveClicked:function(){c.onClose(),A(!0)}})})]})]})]})]})},Ho= exports.a =yo;exports.a = Ho;
//# sourceMappingURL=chunk-VY6SH5RS.js.map