"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 _chunkS2ORYRA2js = require('./chunk-S2ORYRA2.js');var _chunkEVQXPO7Njs = require('./chunk-EVQXPO7N.js');var _authentication = require('@baseapp-frontend/authentication');var _avatars = require('@baseapp-frontend/design-system/components/web/avatars');var _icons = require('@baseapp-frontend/design-system/components/web/icons');var _material = require('@mui/material');var _reactrelay = require('react-relay');var _jsxruntime = require('react/jsx-runtime');function l(e){"@babel/helpers - typeof";return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},l(e)}function h(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function $(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?h(Object(t),!0).forEach(function(o){C(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}function C(e,r,t){return(r=I(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function I(e){var r=k(e,"string");return l(r)=="symbol"?r:r+""}function k(e,r){if(l(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var o=t.call(e,r||"default");if(l(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}var F=function(r){var t,o,n,f,u,j=r.profileRef,O=r.onProfileChange,p=r.avatarProps,w=p===void 0?{}:p,m=r.width,x=m===void 0?36:m,s=r.height,S=s===void 0?36:s,_=_authentication.useCurrentProfile.call(void 0, ),c=_.currentProfile,i=_reactrelay.useFragment.call(void 0, _chunkEVQXPO7Njs.a,j);if(!i)return null;var v=(t=i.urlPath)===null||t===void 0?void 0:t.path,y=i.id===_optionalChain([c, 'optionalAccess', _2 => _2.id]);return _jsxruntime.jsxs.call(void 0, _chunkS2ORYRA2js.a,{tabIndex:0,active:y,onClick:function(){return O(i)},"aria-label":"Switch to ".concat((o=i.name)!==null&&o!==void 0?o:"this profile"),children:[_jsxruntime.jsx.call(void 0, _avatars.AvatarWithPlaceholder,$({width:x,height:S,src:(n=(f=i.image)===null||f===void 0?void 0:f.url)!==null&&n!==void 0?n:"",alt:"Profile avatar",color:"secondary"},w)),_jsxruntime.jsxs.call(void 0, _material.Box,{display:"flex",flexDirection:"column",flexGrow:1,overflow:"hidden",children:[_jsxruntime.jsx.call(void 0, _material.Typography,{component:"p",variant:"subtitle2",noWrap:!0,children:(u=i.name)!==null&&u!==void 0?u:""}),v&&_jsxruntime.jsx.call(void 0, _material.Typography,{variant:"subtitle2",sx:{color:"text.secondary"},noWrap:!0,children:v})]}),y&&_jsxruntime.jsx.call(void 0, _icons.CheckMarkIcon,{sx:{fontSize:24}})]})},H= exports.a =F;exports.a = H;
//# sourceMappingURL=chunk-A5QQA2V7.js.map