1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,440399,e=>{"use strict";var t=e.i(122724),a=e.i(907163),n=e.i(616420),i=e.i(652855),r=e.i(164678);let o=new WeakMap;function l(e,t){let a=new Set(e),n=new Set(t);return e===t||a.size===n.size&&Array.from(a).every(n.has.bind(n))}function d(e){return"write"in e}let c={},{read:p,write:m}=(0,i.atom)(null);e.s(["ScopeProvider",0,function(e){var i;let{atoms:x=[],atomFamilies:f=[],children:h,scope:g,name:v}=e,_=(0,a.useStore)(),b=Array.from(x,e=>Array.isArray(e)?e[0]:e);function y(){return[g??function({atoms:e=[],atomFamilies:t=[],parentStore:a,name:n}){let i=new Set(e),l=new Set(t),x=o.get(a),f=(null==x?void 0:x.baseStore)??a,h=new WeakMap,g=new WeakMap,v=new WeakMap,_={getAtom:j,baseStore:f,cleanup(){for(let e of y)e()},prepareWriteAtom(e,t,a,n){if(t.read===p&&d(t)&&d(e)&&t.write!==m&&_!==a){let{write:i}=t;return e.write=C(t.write.bind(t),a,n),()=>{e.write=i}}}},b=function(e){let t=[...(0,r.INTERNAL_getBuildingBlocksRev2)(e.baseStore)],a=t[21],n=t[22],i=t[23],o={};t[9]=(e,t)=>{var a;return null==(a=t.unstable_onInit)?void 0:a.call(t,l)}
1,t[21]=m(a),t[22]=function(t,a,...i){let[r,o]=e.getAtom(a),l=e.prepareWriteAtom(r,a,o,e);try{return n(t,r,...i)}finally{null==l||l()}},t[23]=m(i),t[24]=([...e])=>{var t;let a=[x(e[0],d),x(e[1],c),x(e[2]),f(e[3]),e[4],e[5],(t=e[6],Object.assign({get r(){return o.r??(o.r=h(t.r))},set r(u){t.r=u},get c(){return o.c??(o.c=h(t.c))},set c(u){t.c=u},get m(){return o.m??(o.m=h(t.m))},set m(u){t.m=u},get u(){return o.u??(o.u=h(t.u))},set u(u){t.u=u},get f(){return t.f},set f(u){t.f=u}},t)),m(e[7]),m(e[8]),e[9],m(e[10]),m(e[11],e=>{var t,n;return t=a[0],n=e,function(e,a){return t.get(a)||(t.set(a,n(e,a)),t.get(a))}}),e[12],e[13],m(e[14]),m(e[15]),m(e[16]),m(e[17]),m(e[18]),m(e[19]),m(e[20]),m(e[21]),m(e[22]),m(e[23]),void 0];return a};let l=(0,r.INTERNAL_buildStoreRev2)(...t);return l;function d(t){let a=new WeakMap;return function(n){let i=a.get(n);if(i)return i;let r=t(n);if(r)return i={...r,d:x(r.d,function(t){return a=>t(e.getAtom(a)[0])}),p:f(r.p),get n(){return r.n},set n(s){r.n=s},get v(){return r.v},set v(s){r.v=s},get e(){return r.e},set e(s){r.e=s}},a.set(n,i),i}}function c(e){let t=new WeakMap;return function(a){let n=t.get(a);if(n)return n;let i=e(a);if(i)return n={...i,d:f(i.d),t:f(i.t),get u(){return i.u},set u(s){i.u=s}},t.set(a,n),i}}function p(t,a){return function(n,...i){let[r]=e.getAtom(n);return(a?a(t):t)(r,...i)}}function m(t,a){return function(n,i,...r){let[o]=e.getAtom(i);return(a?a(t):t)(n,o,...r)}}function x(e,t){let a={get:p(e.get.bind(e),t),set:p(e.set.bind(e))};return"has"in e&&(a.has=p(e.has.bind(e))),"delete"in e&&(a.delete=p(e.delete.bind(e))),a}function f(t){return{get size(){return t.size},add:p(t.add.bind(t)),has:p(t.has.bind(t)),clear:t.clear.bind(t),forEach:e=>t.forEach(p(e)),*[Symbol.iterator](){for(let a of t)yield e.getAtom(a)[0]}}}function h(t){if(!t)return;let a=p(t);return a.add=function(a,n){if(void 0===a)return t.add(void 0,n);let[i]=e.getAtom(a);return t.add(i,n)},a}}(_);for(let e of(o.set(b,_),i))h.set(e,[E(e,_),_]);let y=new Set;for(let e of l){for(let t of e.getParams()){let a=e(t);h.has(a)||h.set(a,[E(a,_),_])}let t=e.unstable_listen(e=>{"CREATE"!==e.type||h.has(e.atom)?i.has(e.atom)||h.delete(e.atom):h.set(e.atom,[E(e.atom,_),_])});y.add(t)}return b;function j(e,t){var a,n;if(h.has(e))return h.get(e);if(t===_)return g.has(e)||g.set(e,[E(e,t),t]),g.get(e);let i=t??c;if(x){if(!(null!=(a=v.get(i))&&a.has(e))){let[a,n]=x.getAtom(e,t);w(N(a,e,n),e,t,n)}return v.get(i).get(e)}return null!=(n=v.get(i))&&n.has(e)||w(N(e,e),e),v.get(i).get(e)}function w(e,t,a,n){let i=a??c;v.has(i)||v.set(i,new WeakMap),v.get(i).set(t,[e,n].filter(Boolean))}function N(e,t,a){return t.read!==p?E(t,a):e}function E(e,t){var a,n;let i=Object.getOwnPropertyDescriptors(e);Object.keys(i).filter(e=>["read","write","debugLabel"].includes(e)).forEach(e=>i[e].configurable=!0);let r=Object.create(Object.getPrototypeOf(e),i);return r.originalAtom=e,r.read!==p&&(a=e.read.bind(e),n=t,r.read=function(e,t){return a(function(t){let[a]=j(t,n);return e(a)},t)}),d(r)&&d(e)&&r.write!==m&&(r.write=C(e.write.bind(e),t)),r}function C(e,t,a=t){return function(n,i,...r){return e(function(e){let[a]=j(e,t);return n(a)},function(e,...n){let[r]=j(e,t),o=_.prepareWriteAtom(r,e,t,a);try{return i(r,...n)}finally{null==o||o()}},...r)}}}({atoms:b,atomFamilies:f,parentStore:_,name:v}),function(e){return _!==e.parentStore||!l(b,e.atoms)||!l(f,e.atomFamilies)||g!==e.providedScope}]}let[[j,w],N]=(0,t.useState)(y);return w({atoms:b,atomFamilies:f,parentStore:_,providedScope:g})&&(null==(i=o.get(j))||i.cleanup(),N(y)),(0,n.useHydrateAtoms)(Array.from(x).filter(Array.isArray),{store:j}),(0,t.useEffect)(()=>{var e;return null==(e=o.get(j))?void 0:e.cleanup},[j]),(0,t.createElement)(a.Provider,{store:j},h)}])},374617,474762,e=>{"use strict";var t=e.i(9154),a=e.i(778733);let n=(0,t.atomWithStorage)(a.LOCAL_STORAGE_KEYS.REFERRAL_SIGNUP_ENABLED,!1);e.s(["referralSignupEnabledAtom",0,n],374617);let i=(0,t.atomWithStorage)(a.LOCAL_STORAGE_KEYS.SHARING_TOKEN_FLOW,null),r=(0,t.atomWithStorage)(a.LOCAL_STORAGE_KEYS.SHARING_TOKEN_DATA,null);e.s(["sharingTokenDataAtom",0,r,"sharingTokenFlowAtom",0,i],474762)},228975,e=>{"use strict";e.s(["CREATE_CHANNEL_MODAL_KEY",()=>U,"CombinedChannelsSection",()=>Q],228975);var t=e.i(648417),a=e.i(453484),n=e.i(197384),i=e.i(620368),r=e.i(701746),o=e.i(753700),l=e.i(832531),d=e.i(907163),c=e.i(522756),p=e.i(122724),m=e.i(469171),x=e.i(960135),f=e.i(730266);e.i(231143);var h=e.i(711286),g=e.i(530151),v=e.i(545250),_=e.i(122895),b=e.i(1396),y=e.i(328509),j=e.i(316057),w=e.i(341331),N=e.i(938954),E=e.i(674609),C=e.i(29246),S=e.i(491969),k=e.i(346172),A=e.i(404773),I=e.i(622712),M=e.i(491482),L=e.i(376217),T=e.i(194902),R=e.i(292784),D=e.i(158299),O=e.i(421756),B=e.i(538627),F=e.i(812632);let z=/^[A-Za-z0-9 ]+$/;function P(e){let a=(0,c.useTranslations)("left-nav.channels.createChannel"),{data:n}=(0,l.useQuery)((0,D.userQueryCreator)()),d=(0,T.useRouter)(),m=(0,L.useQueryClient)(),{onClose:x}=e,[f,h]=(0,p.useState)("public"),[g,v]=(0,p.useState)(""),[_,b]=(0,p.useState)([]),[P,$]=(0,p.useState)([]),[K,G]=(0,p.useState)(null),U=(0,O.useFocusOnMount)(),{isPublicChannelsBlocked:Q,isPrivateChannelsBlocked:H}=(0,y.useIsChannelBlocked)(),{workspace:W,adminStatus:V}=(0,B.useWorkspace)(),q=!V?.isAdmin&&W?.settings?.block_public_channel_creation_by_non_admin_member;(0,p.useEffect)(()=>{(q||Q)&&h("private")},[q,Q]);let Y=(0,p.useMemo)(()=>W?.members?.filter(e=>{if(e.member_email===n?.user?.email)return!1;if(W?.settings?.share_to_domain_only){var t=e.member_email;for(let e of W?.domains?.map(e=>e.domain)??[])if(t.endsWith(e))return!0;return!1}return!0})??[],[W,n?.user?.email]),X=(0,M.useMutation)({mutationFn:async()=>{let e=await I.createGroup({body:{group_name:g,discoverability:"public"===f?"workspace":"private",members:_.join(",")||""}});if(e.data?.status==="OK")return e.data;throw Error("Failed to create group")},onSuccess:e=>{(0,o.trackEvent)("NavBar_GroupsCreateGroup",{Screen:"group_list"}),(0,o.trackEvent)("Group_Create",{Type:"workspace"===e.group.discoverability||"globally_public"===e.group.discoverability?"public":"private"}),(0,R.invalidateListGroupsQuery)(m);let t=new URL(`/group/${e.group.id}`,window.location.origin);d.replace(t.toString())},onError:e=>{(0,j.addToast)((0,t.jsx)(S.ErrorToast,{description:e.message??"Failed to create Channel",showCloseIcon:!0}))}}),Z=(0,p.useMemo)(()=>{let e=[];return Q||q||e.push({value:"public",label:(0,t.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,t.jsx)(i.HashtagIcon,{className:"bg-primary-light text-button-soft-primary-text",size:"40px"}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"font-semibold text-sm",children:a("public")}),(0,t.jsx)("span",{className:"text-subtle font-regular text-sm",children:a("publicDescription")})]})]})}),H||e.push({value:"private",label:(0,t.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,t.jsx)(r.LockIcon,{className:"bg-primary-light text-button-soft-primary-text",size:"40px"}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"font-semibold text-sm",children:a("private")}),(0,t.jsx)("span",{className:"text-subtle font-regular text-sm",children:a("privateDescription")})]})]})}),e},[Q,H,q]);return(0,t.jsx)("div",{children:(0,t.jsx)(E["DialogÃ"],{onOpenChange:x,title:a("title"),description:a("description"),className:"p-4 w-full max-w-[650px] rounded-md","data-testid":"create-channel",Footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Button,{"data-testid":"create-channel-cancel-button",variant:"outlineNeutral",version:"legacy",onClick:()=>{v(""),x()},children:a("cancel")}),(0,t.jsx)(w.Button,{disabled:0===g.length||P.length>0||!!K||0===Z.length,variant:"primary","data-testid":"create-channel-create-button",onClick:()=>{X.mutate(),v(""),x()},children:a("createButton")})]}),children:(0,t.jsxs)(N.DialogContent,{className:"flex flex-col gap-2 px-6",children:[(0,t.jsx)("span",{className:"font-semibold text-lg",children:a("channelName")}
1),(0,t.jsx)(k.InputRoot,{children:(0,t.jsx)(k.InputText,{placeholder:a("channelNamePlaceholder"),"data-testid":"create-channel-name-input",ref:U,onChange:e=>{let t;e.stopPropagation(),0===(t=e.target.value).length&&G(null),v(t),t.length>0&&!z.test(t)?G(a("channelNameError")):G(null)},onKeyDown:F.stopPropagationForNonEscape,value:g})}),K&&(0,t.jsx)("span",{className:"text-palette-red-500 text-sm",children:K}),(0,t.jsx)("span",{className:"font-semibold text-lg pt-4",children:a("inviteOthers")}),(0,t.jsx)(C.EmailTagInputNew,{"data-testid":"create-channel-invite-input",autocompleteOptions:Y?.map(e=>({email:e.member_email,name:e.member.name,avatarUrl:e.member.avatar_url??null})),selectedEmails:b,errors:P,setErrors:e=>$(e.filter(e=>void 0!==e)),customErrorFn:W?.settings?.share_to_domain_only?(e,t)=>{if(!Y.some(t=>t.member_email===e.email))return{message:a("domainError",{email:e.email}),index:t}}:void 0,showFieldMessage:!1}),(0,t.jsx)("span",{className:"font-semibold text-lg pt-4",children:a("visibility")}),(0,t.jsx)(A["RadioGroupÃ"],{value:f,"data-testid":"create-channel-visibility-option",options:Z,onValueChange:e=>h(e)}),0===Z.length&&(0,t.jsx)("span",{className:"text-palette-red-500 text-sm",children:a("disabledError")})]})})})}var $=e.i(90045),K=e.i(776036);function G(e){let n=(0,c.useTranslations)("left-nav.channels"),{overlayView:r}=e,d=(0,m.useExperimentEnabled)("left_nav_channel_bolding_only"),{data:p}=(0,l.useQuery)((0,K.workspacePublicGroupsQueryCreator)());return 0===(p?.groups??[]).length?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"font-semibold text-xs pl-4 py-2","data-testid":"suggested-channels-section",children:n("suggested")}),p?.groups?.slice(0,3).map(e=>(0,t.jsx)(_.NewSectionLink,{"data-testId":e.name?.split(" ").join("-")??void 0,href:`/group/${e.id}`,onClick:()=>{(0,o.trackEvent)("Navigate_Group",{GroupID:String(e.id),UnreadCount:e.new_unread_msg_count??0,LiveStatus:e.has_live_speech?"live":"none",MemberCount:e.member_count??0,IsDirectMessage:"string"==typeof e.dm_name&&e.dm_name.length>0,Type:"suggested",Privacy:"workspace"===e.discoverability||"globally_public"===e.discoverability?"public":"private",Screen:"group_list",IsGeneral:"General"===e.name})},children:(0,t.jsx)(_.NewSectionRow,{"data-testid":e.name?.split(" ").join("-")??void 0,appendStart:(0,t.jsx)(i.HashtagIcon,{strokeWidth:d&&e.bolding?2:1.5,className:(0,a.cx)(d&&"text-subtle")}),count:!d&&e.new_unread_msg_count?e.new_unread_msg_count:void 0,forceExpanded:r,className:(0,a.cx)(d&&e.bolding?"font-semibold":"text-subtle"),children:e.name})},e.id)),(p?.groups?.length??0)>3&&(0,t.jsx)($.default,{href:"/suggested-channels","data-testid":"view-all-suggested-channels",children:(0,t.jsx)(_.NewSectionRow,{className:"text-xs font-semibold",forceExpanded:r,children:n("viewAllSuggested",{count:p?.groups?.length??0})})})]})}let U="createChannel";function Q(e){let j=(0,c.useTranslations)("left-nav.channels"),{overlayView:w}=e,[N,E]=(0,p.useState)(null),{isActive:C,showModal:S,hideModal:k,activeModalKey:A}=(0,h.useModalKey)(U),I=(0,g.useLeftNavBarResize)(),[M,L]=(0,d.useAtom)(b.overlayContentKeyAtom),{isPublicChannelsBlocked:T,isPrivateChannelsBlocked:R}=(0,y.useIsChannelBlocked)(),D=(0,m.useExperimentEnabled)("filtered_channels_left_nav"),O=(0,m.useExperimentEnabled)("list_groups_serializer_optimization_experiment"),B=(0,m.useExperimentEnabled)("list_groups_get_group_list_optimization_experiment"),F=(0,m.useExperimentInGroup)("channel_organization","treatment"),z=(0,m.useExperimentEnabled)("left_nav_channel_bolding_only"),$=O||B,K=(0,x.useListGroupsLiteQueryCreator)({enabled:$}),Q=(0,f.listGroupsQueryCreator)({enabled:!$}),{data:H}=(0,l.useQuery)(K),{data:W}=(0,l.useQuery)(Q),V=$?H:W,q=V?.groups?.filter(e=>e.new_unread_msg_count&&!("string"==typeof e?.dm_name&&e.dm_name.length>0)).length??0,Y=(0,p.useMemo)(()=>{if(D){if(!V?.groups)return[];let e=new Map;for(let t of V.groups)if(("string"!=typeof t.dm_name||!(t.dm_name.length>0))&&t.name)if(e.has(t.name)){let a=e.get(t.name);a&&new Date(t.latest_message_time)>new Date(a.latest_message_time)&&e.set(t.name,t)}else e.set(t.name,t);return Array.from(e.values()).sort((e,t)=>
1e.name&&t.name?e.name.localeCompare(t.name):0)}return V?.groups?.filter(e=>!("string"==typeof e?.dm_name&&e.dm_name.length>0)).sort((e,t)=>e.name&&t.name?e.name.localeCompare(t.name):0)||[]},[D,V?.groups]);return R&&T?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"data-tutorial":"channels-section-tutorial",children:(0,t.jsx)(_.NewSection,{forceExpanded:w,"data-testid":I.isExpanded?"channels-section":"channels-section-collapsed",className:"overflow-visible",Header:w?(0,t.jsx)(_.NewSectionHeader,{"data-testid":"section_header_title",forceExpanded:!0,appendEnd:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(v.MenuButtonPlusStatic,{"data-testid":"create-channel-modal-trigger",onClick:()=>S()}),(0,t.jsx)(v.CloseButton,{onClick:()=>k()})]}),children:j("titleUpper")}):(0,t.jsx)(n["TooltipÃ"],{caption:j("title"),side:"right",className:(0,a.cx)(I.isExpanded?"opacity-0":"opacity-100"),children:(0,t.jsx)(_.NewSectionLink,{href:"/group",onClick:e=>{if(!I.isExpanded){if(e.preventDefault(),"OverlayMenu"===A&&"channels"===M)return void k();S("OverlayMenu"),L("channels")}},children:(0,t.jsx)(_.NewSectionHeader,{isSelected:"channels"===M&&"OverlayMenu"===A,appendStart:!I.showExpanded&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.HashtagIcon,{size:24}),V?.groups?.some(e=>e.new_unread_msg_count)&&(0,t.jsx)(v.UnreadDot,{})]}),appendEnd:(0,t.jsx)(v.MenuButtonPlus,{"data-testid":"create-channel-modal-trigger","aria-label":j("createChannel.title"),onClick:()=>S()}),"data-testid":"section_header_title",count:q,children:j("titleUpper")})})}),children:(I.showExpanded||w)&&(0,t.jsxs)(t.Fragment,{children:[Y.map(e=>{if(T&&("workspace"===e.discoverability||"globally_public"===e.discoverability)||R&&"private"===e.discoverability)return null;let l=!!("favorite_section_id"in e&&e.favorite_section_id);return(0,t.jsx)(n["TooltipÃ"],{"data-testid":e.name?.split(" ").join("-").toLocaleLowerCase()??void 0,caption:e.name??"",className:(0,a.cx)(F&&"hidden"),side:"right",children:(0,t.jsx)(_.NewSectionLink,{"data-testid":e.name?.split(" ").join("-").toLocaleLowerCase()??void 0,href:e.is_public||"globally_public"===e.discoverability?`/${e.public_name}`:`/group/${e.id}`,onClick:()=>{(0,o.trackEvent)("Navigate_Group",{GroupID:String(e.id),UnreadCount:e.new_unread_msg_count??0,LiveStatus:e.has_live_speech?"live":"none",MemberCount:e.member_count??0,IsDirectMessage:"string"==typeof e.dm_name&&e.dm_name.length>0,Type:"joined",Privacy:"workspace"===e.discoverability||"globally_public"===e.discoverability?"public":"private",Screen:"group_list",IsGeneral:"General"===e.name,...F&&{IsFavorite:l}}),k()},children:(0,t.jsx)(_.NewSectionRow,{appendStart:null!==e.discoverability&&("workspace"===e.discoverability||"globally_public"===e.discoverability)?(0,t.jsx)(i.HashtagIcon,{size:24,strokeWidth:z&&e.bolding?2:1.5,className:(0,a.cx)(z&&"text-subtle")}):(0,t.jsx)(r.LockIcon,{size:24,strokeWidth:z&&e.bolding?2:1.5,className:(0,a.cx)(z&&"text-subtle")}),count:!z&&e.new_unread_msg_count?e.new_unread_msg_count>99?"99+":e.new_unread_msg_count:void 0,appendEnd:(0,_.sectionRowAppendEndContent)(N,e.id,"group",l,E,e.has_live_speech,F),className:(0,a.cx)(z?e.bolding?"font-semibold":"text-subtle":e.new_unread_msg_count&&"font-semibold"),"data-testid":"section_item_title",forceExpanded:w,children:e.name},`${e.id}${N===e.id?"-favorite-menu-expanded":""}`)},e.id)},e.id)}),T?null:(0,t.jsx)(G,{overlayView:w})]})})}),C&&(0,t.jsx)(P,{onClose:k})]})}},122895,982688,e=>{"use strict";var t=e.i(648417),a=e.i(976601),n=e.i(453484),i=e.i(555767),r=e.i(706816),o=e.i(652855),l=e.i(907163),d=e.i(440399),c=e.i(90045),p=e.i(194902),m=e.i(122724);let x={animation:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",position:"absolute",height:"6px",width:"6px",borderRadius:"9999px",backgroundColor:"#CD2A20",opacity:.75,top:0,left:0,transform:"scale(1)"},f=` 2 @keyframes ping { 3 75%, 100% { 4 transform: scale(2); 5 opacity: 0; 6 } 7 } 8`;function h({label:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{children:f}),(0,t.jsxs)("span",{className:"text-negative px-1 h-4 flex gap-1 items-center justify-center font-semibold rounded-sm text-xs",children:[(0,t.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,t.jsx)("span",{style:x}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-negative"})]}),e]})]})}e.s(["default",0,h],982688);var g=e.i(778733),v=e.i(530151),_=e.i(545250);let b=(0,o.atom)(!0);function y(e){let o=(0,m.useRef)(null),{count:l,className:d,children:c,appendStart:p,hoverAppendEnd:x,isSelected:f,forceExpanded:h,boldWhenActive:g=!0,"data-testid":b="new-section-row",...y}=e,j=b.split(" ").join("-").toLocaleLowerCase(),w=e.appendEnd||l&&(0,t.jsx)(a.Badge,{size:"sm",variant:"primary",children:(0,t.jsx)("span",{className:"text-center min-w-[7px]",children:l})}),[N,E]=(0,m.useState)(!1),{isDesktop:C}=(0,r.useDesktop)(),{showExpanded:S}=(0,v.useLeftNavBarResize)(),k=x&&(N||f)?(0,t.jsxs)("div",{className:"flex flex-row items-center justify-center gap-1",children:[w," ",x]}):w&&(0,t.jsx)("div",{className:"flex flex-row",children:w}),A=(0,m.useContext)(_.ActiveLinkContext),I=(0,n.cx)("p-2 font-regular h-9 rounded-full hover:bg-default-hover bg-inherit mx-0 first:mt-0 last:mb-0",S||h?"gap-2":"flex justify-center align-items gap-0 w-8 p-0 w-[40px]",d,(A||f)&&"!bg
8-palette-blue-100 hover:bg-palette-blue-100 text-palette-blue-800",(A||f)&&g&&"font-semibold",(A||f)&&C&&"!bg-default text-palette-blue-800 shadow-sm hover:shadow-md");return(0,t.jsx)(i.MenuListItem,{"data-testid":"new-section-row"===j?j:`${j}-row`,tabIndex:-1,ref:o,"data-label":"NewSectionRow",...y,className:I,appendStart:p&&(0,t.jsx)("div",{className:"w-6 h-6 flex justify-center text-lg shrink-0 items-center",children:p}),appendEnd:(S||h)&&k,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),onFocus:()=>E(!0),onBlur:e=>{o.current?.contains(e.relatedTarget)||E(!1)},children:(S||h)&&c})}function j({className:e,children:a,Header:r,forceExpanded:o,"data-testid":d="new-section"}){let c=(0,l.useAtomValue)(b),{showExpanded:p}=(0,v.useLeftNavBarResize)();return(0,t.jsxs)(i.MenuList,{className:(0,n.cx)("flex flex-col border-none bg-inherit mt-4 gap-1",p?"mt-4":"mt-0",e),"data-label":"NewSection","data-testid":d.toLocaleLowerCase(),children:[r,(c||o)&&a]})}let w=(0,m.forwardRef)(({children:e,href:a,"data-testId":n,...i},r)=>{let o=(0,p.usePathname)(),l=n?`${n.split(" ").join("-").toLocaleLowerCase()}-link`:"new-section-link";return(0,t.jsx)(c.default,{"data-testid":l,prefetch:!1,...i,ref:r,href:a,className:"rounded-full",children:(0,t.jsx)(_.ActiveLinkContext.Provider,{value:o===a,children:e})})});e.s(["NewSection",0,function(e){return(0,t.jsx)(d.ScopeProvider,{atoms:[b],children:(0,t.jsx)(j,{...e})})},"NewSectionHeader",0,function({children:e,appendStart:i,appendEnd:r,count:o,disableHoverBg:d,isEmpty:c=!1,...p}){let{forceExpanded:x,menuButtonProps:f}=p,h=(0,v.useLeftNavBarResize)(),[j,w]=(0,l.useAtom)(b),N=!c&&j,E=(0,l.useAtomValue)(_.showMouseControlsAtom)||N,C=o?(0,t.jsx)(a.Badge,{size:"sm",variant:"primary",children:(0,t.jsx)("span",{className:"text-center min-w-[7px]",children:o})}):null;return(0,m.useEffect)(()=>{let t=(0,g.getFromLocalStorage)(`${e}-left-nav-bar-toggle`,!0,!0)??!0;w(!c&&t)},[]),(0,t.jsx)(y,{className:(0,n.cx)("font-semibold text-xs",x&&"hover:bg-transparent",d&&"cursor-default hover:!bg-transparent"),"data-label":"NewSectionHeader",tabIndex:-1,"data-testid":e.toLocaleLowerCase(),appendStart:h.showExpanded?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_.MenuButtonExpand,{isOpen:N,disabled:c,toggleIsOpen:()=>{w(!j),(0,g.setInLocalStorage)(`${e}-left-nav-bar-toggle`,j?"false":"true",!0,!0)},"aria-label":c?`No ${e.toLowerCase()}`:`${N?"Collapse":"Expand"} ${e.toLowerCase()} list`,...f}),i]}):i,appendEnd:C&&r?(0,t.jsxs)("div",{className:"grid items-center justify-items-end",children:[(0,t.jsx)("div",{"aria-hidden":E,className:(0,n.cx)("col-start-1 row-start-1 transition-all duration-300",E?"opacity-0 scale-75 pointer-events-none":"opacity-100 scale-100"),children:C}),(0,t.jsx)("div",{"aria-hidden":!E,className:(0,n.cx)("col-start-1 row-start-1 transition-all duration-300",E?"opacity-100 scale-100":"opacity-0 scale-75 pointer-events-none"),children:r})]}):C??r,...p,children:e})},"NewSectionLink",0,w,"NewSectionRow",0,y,"sectionRowAppendEndContent",0,function(e,a,n,i,r,o,l){return l&&e===a||o?(0,t.jsx)("div",{className:"flex items-center gap-1",children:o&&(0,t.jsx)(h,{label:"LIVE"})}):null}],122895)},1396,711726,316073,694555,e=>{"use strict";e.s(["OverlayMenu",()=>ex,"overlayContentKeyAtom",()=>eu],1396),e.s(["CREATE_DM_MODAL_KEY",()=>z,"NewDmSection",()=>P],711726),e.s(["FavoritesSection",()=>et],316073),e.s(["CREATE_FOLDER_MODAL_KEY",()=>eo,"CreateFolderModalOwner",()=>el,"NewFolderSection",()=>ed],694555);var t=e.i(648417),a=e.i(938954),n=e.i(762787),i=e.i(706816),r=e.i(652855),o=e.i(907163);e.i(231143);var l=e.i(711286),d=e.i(228975),c=e.i(273289),p=e.i(453484),m=e.i(197384),x=e.i(223900),x=x,f=e.i(753700),h=e.i(832531),g=e.i(522756),v=e.i(122724),_=e.i(469171),b=e.i(197842),y=e.i(960135),j=e.i(730266),w=e.i(998028),N=e.i(530151),E=e.i(545250);function C(e){let{title:a,description:n,"data-testid":i}=e;return(0,t.jsxs)("div",{"data-testid":i,className:"flex flex-col items-center text-center px-4 py-8",children:[(0,t.jsx)("p",{className:"font-semibold text-palette-gray-950 text-sm mb-1",children:a}),(0,t.jsx)("p",{className:"text-palette-gray-600 text-center text-xs",children:n})]})}var S=e.i(122895),k=e.i(674609),A=e.i(45994),I=e.i(346172),M=e.i(640757),L=e.i(376217),T=e.i(816903),R=e.i(32121),D=e.i(421756),O=e.i(143859),B=e.i(812632);function F(e){let n=(0,g.useTranslations)("left-nav.directMessages.createDM"),i=(0,g.useTranslations)("recording.adhoc_recording"),{onClose:r,contacts:d}=e,x=(0,L.useQueryClient)(),[_,b]=(0,v.useState)(""),y=(0,D.useFocusOnMount)(),j=(0,o.useSetAtom)(O.recordInSharedModalAtom),N=(0,l.useModalController)(),{isManualRecordingBlocked:E,requestRecordingConfirmation:C}=(0,w.useManualRecordingPolicy)(),S=(0,v.useMemo)(()=>(0,T.validate)(_),[_]),{data:F}=(0,h.useQuery)((0,R.currentCalendarMeetingsQueryCreator)()),z=""===_?d:d.filter(e=>e.email.toLowerCase().includes(_.toLowerCase()));async function P(e,t){return!!await C()&&(j({emails:[e],type:"dm",n
8ame:t,currentMeetingPresent:(F?.calendar_meetings?.length??0)>0}),N.showModal("recordInShared"),x.invalidateQueries({queryKey:["channels"]}),x.invalidateQueries({queryKey:["channels_optimized_serializer"]}),!0)}return(0,t.jsx)(k["DialogÃ"],{onOpenChange:()=>{r(),(0,f.trackEvent)("General_ButtonAction",{UIElementID:"allContactsClose",UIInteractionType:"secondaryActivate",Screen:"navBar"})},title:n("title"),className:"max-h-[50vh]",size:"sm","data-testid":"create-dm",children:(0,t.jsxs)(a.DialogContent,{className:"px-4 gap-3 flex flex-col overflow-y-auto",children:[(0,t.jsxs)(I.InputRoot,{border:!1,size:"lg",children:[(0,t.jsx)(I.InputText,{placeholder:n("emailPlaceholder"),ref:y,onChange:e=>{e.stopPropagation(),b(e.target.value)},onKeyDown:B.stopPropagationForNonEscape,"data-testid":"create-dm-email-input",value:_,className:(0,p.cx)(S||""===_?"border-primary-strong border-[1px]":"border-negative-strong border-[1px]")}),(0,t.jsx)(I.InputAppend,{end:"end",children:(0,t.jsx)(m["TooltipÃ"],{caption:n("recordAndShare"),side:"bottom","data-testid":"record-and-share",children:(0,t.jsx)(A.IconButton,{disabled:!S||E,variant:"softPrimary",size:"md",title:E?i("manual_recording_disabled_tooltip"):void 0,onClick:async()=>{await P(_.trim(),_.trim())&&(0,f.trackEvent)("General_ButtonAction",{UIElementID:_.trim()&&d.filter(e=>e.email.toLowerCase().includes(_.trim().toLowerCase()))?"allContactsRecord":"allContactsRecordAndShareToNewContact",UIInteractionType:"primaryActivate",ContactsEmails:[_.trim()]})},"data-testid":"create-dm-create-button",children:(0,t.jsx)(M.MicrophoneIcon,{})})})})]}),(0,t.jsx)(a.DialogScrollArea,{children:z.length>0||""===_?z.map(e=>(0,t.jsxs)("button",{type:"button",onClick:async()=>{await P(e.email,`${e.first_name} ${e.last_name}`)&&(0,f.trackEvent)("General_ButtonAction",{UIElementID:"allContactsRecord",UIInteractionType:"primaryActivate",ContactsEmails:[e.email]})},onKeyDown:async t=>{(0,B.stopPropagationForNonEscape)(t),"Enter"!==t.key&&" "!==t.key||await P(e.email,`${e.first_name} ${e.last_name}`)&&(0,f.trackEvent)("General_ButtonAction",{UIElementID:"allContactsRecord",UIInteractionType:"primaryActivate",Screen:"navBar",ContactsEmails:[e.email]})},className:"p-2 w-full justify-between flex hover:bg-default-hover items-center cursor-pointer group",children:[(0,t.jsxs)("div",{className:"flex flex-row gap-4",children:[(0,t.jsx)(c.Avatar,{name:e.first_name||e.last_name?`${e?.first_name} ${e?.last_name}`:`${e.email}`,imageUrl:e?.avatar_url,className:"flex-none",size:"xl"}),(0,t.jsxs)("div",{className:"flex flex-col items-start",children:[(0,t.jsx)("span",{className:"font-semibold truncate",children:e.first_name||e.last_name?`${e?.first_name} ${e?.last_name}`:`${e.email}`}),(0,t.jsx)("span",{className:"text-sm text-subtle",children:e?.email})]})]}),(0,t.jsx)(M.MicrophoneIcon,{className:"group-hover:text-palette-blue-700"})]},e.id)):(0,t.jsxs)("div",{className:"p-2 text-center flex flex-col",children:[!S&&(0,t.jsx)("span",{children:n("notValidEmail")}),(0,t.jsx)("span",{className:"font-semibold",children:_})]})})]})})}let z="createDM";function P(e){let a=(0,g.useTranslations)("left-nav.directMessages"),n=(0,g.useTranslations)("channels.list"),{overlayView:i}=e,{isActive:r,showModal:d,hideModal:k,activeModalKey:A}=(0,l.useModalKey)(z),I=(0,N.useLeftNavBarResize)(),[M,L]=(0,o.useAtom)(eu),T=(0,_.useExperimentInGroup)("left_nav_channel_bolding_only","enabled"),R=(0,_.useExperimentInGroup)("list_groups_serializer_optimization_experiment","enabled"),D=(0,_.useExperimentInGroup)("list_groups_get_group_list_optimization_experiment","enabled"),O=R||D,B=(0,y.useListGroupsLiteQueryCreator)({enabled:O}),P=(0,j.listGroupsQueryCreator)({enabled:!O}),{data:$,isSuccess:K}=(0,h.useQuery)(B),{data:G,isSuccess:U}=(0,h.useQuery)(P),Q=O?$:G,{data:H}=(0,h.useQuery)((0,b.contactsQueryCreator)()),{isManualRecordingBlocked:W}=(0,w.useManualRecordingPolicy)(),[V,q]=(0,v.useState)(null),Y=(0,_.useExperimentInGroup)("channel_organization","treatment"),X=Q?.groups?.filter(e=>e.is_dm_visible&&2===e.member_count),Z=X?.filter(e=>e.new_unread_msg_count).length??0,J=(O?K:U)&&(X?.length??0)===0,ee=i&&J,et=(I.showExpanded||i)&&!ee;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(S.NewSection,{forceExpanded:i,"data-testid":I.isExpanded?"dms-section":"dms-section-collapsed",className:"overflow-visible",Header:i?(0,t.jsx)(S.NewSectionHeader,{"data-testid":"direct-messages",forceExpanded:!0,isEmpty:J,appendEnd:(0,t.jsx)("div",{className:"flex items-center gap-1",children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.MenuButtonPlusStatic,{"data-testid":"create-dm-modal-trigger",onClick:()=>{d()},disabled:W,tooltipCaption:W?a("manualRecordingDisabled"):void 0,tooltipSide:"bottom",tooltipDisabled:!W}),(0,t.jsx)(E.CloseButton,{onClick:()=>k()})]})}),children:a("titleUpper")}):(0,t.jsx)(m["TooltipÃ"],{caption:a("title"),"data-testid":"direct-messages",side:"right",className:(0,p.cx)(I.isExpanded?"opacity-0":"opacity-100"),children:(0,t.jsx)(S.NewSectionLink,{href:"/direct-messages",onClick:e=>{if(!I.isExpanded){if(e.preventDefault(),"OverlayMenu"===A&&"dms"===M)return void k();d("OverlayMenu"),L("dms")}},children:(0,t.jsx)(S.NewSectionHeader,{isSelected:"dms"===M&&"OverlayMenu"===A,isEmpty:J,appendStart:!I.showExpanded&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.default,{size:24}),X?.some(e=>e.new_unread_msg_count)&&(0,t.jsx)(E.UnreadDot,{})]}),appendEnd:(0,t.jsx)(E.MenuButtonPlus,{"data-testid":"create-dm-modal-trigger","aria-label":a("createDM.title"),onClick:()=>{d()},disabled:W,tooltipCaption:W?a("manualRecordingDisabled"):void 0,tooltipSide:"right",tooltipDisabled:!W}),count:Z,children:a("titleUpper")})})}),children:[ee&&(0,t.jsx)(C,{"data-testid":"dms-overlay-empty",title:n("empty.dms.title"),description:n("empty.dms.description")}),et&&X?.slice(0,20).map((e,a)=>(0,t.jsx)(m["TooltipÃ"],{caption:e.name??"","data-testid":e.name??`direct-message-${a}`,className:(0,p.cx)(Y&&"hidden"),side:"right",children:(0,t.jsx)(S.NewSectionLink,{"data-testid":e.name??`direct-message-name-${a}`,href:`/group/${e.id}`,onClick:()=>{(0,f.trackEvent)("Navigate_Group",{GroupID:String(e.id),UnreadCount:e.new_unread_msg_count??0,LiveStatus:e.has_live_speech?"live":"none",MemberCount:e.member_count??0,IsDirectMessage:"string"==typeof e.dm_name&&e.dm_name.length>0,Type:"dm",Privacy:"workspace"===e.discoverability||"globally_public"===e.discoverability?"public":"private",Screen:"group_list",IsGeneral:"General"===e.name,...Y&&{IsFavorite:!!("favorite_section_id"in e&&e.favorite_section_id)}}),k()},children:(0,t.jsx)(S.NewSectionRow,{"data-testid":e.name??`direct-message-row-${a}`,appendStart:(0,t.jsx)(c.Avatar,{size:"xs",name:e.name??"",imageUrl:e.first_member?.avatar_url??e.avatar_url}),count:T||e.has_live_speech||!e.new_unread_msg_count?void 0:e.new_unread_msg_count>99?"99+":e.new_unread_msg_count,appendEnd:(0,S.sectionRowAppendEndContent)(V,e.id,"group",!!("favorite_section_id"in e&&e.favorite_section_id),q,e.has_live_speech,Y),className:(0,p.cx)(T?e.bolding?"font-semibold":"text-subtle":e.new_unread_msg_count&&"font-semibold"),forceExpanded:i,children:e.name}
8,`${e.id}${V===e.id?"-favorite-menu-expanded":""}`)},e.id)},e.id))]}),r&&(0,t.jsx)(F,{contacts:H?.contacts??[],onClose:k})]})}var $=e.i(592755),K=e.i(226836),G=e.i(982688),U=e.i(170193);function Q(e){let{favorite:a,openMenuChannelId:n,overlayView:i}=e,{hideModal:r}=(0,l.useModalController)(),o=(0,_.useExperimentEnabled)("left_nav_channel_bolding_only"),d=n===a.id||a?.hasLiveSpeech?(0,t.jsx)("div",{className:"flex items-center gap-1",children:a.hasLiveSpeech&&(0,t.jsx)(G.default,{label:"LIVE"})}):null;return(0,t.jsx)(S.NewSectionLink,{"data-testid":a.name?.split(" ").join("-").toLocaleLowerCase(),href:(0,U.getFavoriteRoutePath)(a),onClick:()=>{r(),(0,U.trackFavoriteNavigateClick)(a)},children:(0,t.jsx)(S.NewSectionRow,{appendStart:(0,t.jsx)(U.FavoriteItemIcon,{favorite:a,strokeWidth:o&&a.bolding?2:1.5}),appendEnd:d,count:o?void 0:function(e){if(e)return e>99?"99+":e}(a.unreadMessageCount),className:(0,p.cx)(o?a.bolding&&"font-semibold":a.unreadMessageCount&&"font-semibold"),"data-testid":"section-item-title",forceExpanded:i,children:a.name})},a.id)}var H=e.i(929466),W=e.i(562208);function V({overlayView:e,page:a}){let{hideModal:n}=(0,l.useModalController)();return(0,t.jsx)(S.NewSectionLink,{"data-testid":`favorite-page-${a.page_otid}`,href:`/${W.PATH_URL.PAGES}/${a.page_otid}`,onClick:()=>n(),children:(0,t.jsx)(S.NewSectionRow,{appendStart:(0,t.jsx)(H.FileText_2Icon,{size:24,strokeWidth:1.5}),"data-testid":"favorite-page-item-title",forceExpanded:e,children:a.title})})}var q=e.i(329358),Y=e.i(440377);function X(e){let{favorite:a,overlayView:n}=e,{hideModal:i}=(0,l.useModalController)();return(0,t.jsx)(S.NewSectionLink,{"data-testid":`favorite-view-${a.name.split(" ").join("-").toLocaleLowerCase()}`,href:`/view/${a.property}/${encodeURIComponent(a.id)}`,onClick:()=>{i()},children:(0,t.jsx)(S.NewSectionRow,{appendStart:"person"===a.property?(0,t.jsx)(Y.UsersIcon,{size:24,strokeWidth:1.5}):(0,t.jsx)(q.Building_2Icon,{size:24,strokeWidth:1.5}),"data-testid":"favorite-view-item-title",forceExpanded:n,children:a.name})},a.id)}var Z=e.i(159745);let J="favorites",ee="OverlayMenu";function et(e){let{overlayView:a}=e,[n,i]=(0,v.useState)(null),[r,d]=(0,o.useAtom)(eu),{showModal:c,hideModal:p,activeModalKey:m}=(0,l.useModalController)(),x=(0,N.useLeftNavBarResize)(),{data:f}=(0,Z.useFavoritesList)(),{data:h}=(0,Z.useFavoriteViewList)(),g=(0,K.useFavoriteLivingPages)(),_=(0,U.getMergedFavorites)({favoritePages:g,favoriteViewList:h,favorites:f}),b=x.showExpanded||a;return _.length>0?(0,t.jsx)(S.NewSection,{forceExpanded:a,"data-testid":x.isExpanded?"favorites-section":"favorites-section-collapsed",className:"overflow-visible",Header:(0,t.jsx)(ea,{onCloseButtonClick:()=>p(),onHeaderClick:()=>{if(!x.isExpanded){if(m===ee&&r===J)return void p();c(ee),d(J)}},overlayView:a,isSelected:m===ee&&r===J}),children:b&&_.map(e=>"view"===e.kind?(0,t.jsx)(X,{favorite:e.data,overlayView:a},`view-${e.data.id}`):"page"===e.kind?(0,t.jsx)(V,{overlayView:a,page:e.data},`page-${e.data.page_otid}`):(0,t.jsx)(Q,{favorite:e.data,openMenuChannelId:n,setOpenMenuChannelId:i,overlayView:a},`channel-${e.data.id}`))}):null}function ea({onCloseButtonClick:e,onHeaderClick:a,overlayView:n,isSelected:i}){let r=(0,g.useTranslations)("left-nav.favorites"),o=(0,N.useLeftNavBarResize)();return n?(0,t.jsx)(S.NewSectionHeader,{"data-testid":"section-header-title",forceExpanded:!0,disableHoverBg:!0,appendEnd:(0,t.jsx)("div",{className:"flex items-center gap-1",children:(0,t.jsx)(E.CloseButton,{onClick:e})}),children:r("titleUpper")}):(0,t.jsx)(m["TooltipÃ"],{caption:r("title"),side:"right",className:(0,p.cx)(!o.showExpanded&&"cursor-pointer",o.isExpanded?"opacity-0":"opacity-100"),children:(0,t.jsx)(S.NewSectionHeader,{"data-testid":"section-header-title",disableHoverBg:o.showExpanded,appendStart:!o.showExpanded&&(0,t.jsx)($.StarIcon,{size:24}),onClick:a,isSelected:i,children:r("titleUpper")})})}var en=e.i(327617),ei=e.i(215435),es=e.i(610659),er=e.i(110137);let eo="createFolder";function el(){let{isActive:e,hideModal:a}=(0,l.useModalKey)(eo);return e?(0,t.jsx)(er.CreateFolder,{onClose:a}):null}function ed(e){let a=(0,g.useTranslations)("left-nav.folders"),n=(0,g.useTranslations)("folder"),{overlayView:i}=e,{showModal:r,hideModal:d,activeModalKey:c}=(0,l.useModalKey)(eo),x=(0,N.useLeftNavBarResize)(),[b,y]=(0,o.useAtom)(eu),[j,w]=(0,v.useState)(null),k=(0,_.useExperimentInGroup)("channel_organization","treatment"),{data:A,isSuccess:I}=(0,h.useQuery)((0,es.foldersQueryCreator)()),M=A?.folders??[],L=M.filter(e=>e.new_unread_msg_count).length??0,T=I&&0===M.length,R=i&&T,D=(x.showExpanded||i)&&!R;return(0,t.jsxs)(S.NewSection,{"data-testid":x.isExpanded?"folder-section":"folder-section-collapsed",forceExpanded:i,className:"pb-[120px] overflow-visible",Header:i?(0,t.jsx)(S.NewSectionHeader,{isSelected:"channels"===b&&"OverlayMenu"===c,forceExpanded:!0,isEmpty:T,appendEnd:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(E.MenuButtonPlusStatic,{"data-testid":"create-folder-modal-trigger",onClick:()=>{r()}}),(0,t.jsx)(E.CloseButton,{onClick:()=>d()})]}),children:a("titleUpper")}):(0,t.jsx)(m["TooltipÃ"],{caption:a("title"),side:"right",className:(0,p.cx)(x.isExpanded?"opacity-0":"opacity-100"),children:(0,t.jsx)(S.NewSectionLink,{href:"/folder",onClick:e=>{if(!x.isExpanded){if(e.preventDefault(),"OverlayMenu"===c&&"folders"===b)return void d();r("OverlayMenu"),y("folders")}},children:(0,t.jsx)(S.NewSectionHeader,{isSelected:"folders"===b&&"OverlayMenu"===c,isEmpty:T,appendStart:!x.showExpanded&&(0,t.jsx)(en.FolderIcon,{size:24}),appendEnd:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.MenuButtonPlus,{"data-testid":"create-folder-modal-trigger","aria-label":a("createFolder.title"),onClick:()=>{r()}}),M?.some(e=>e.new_unread_msg_count)&&(0,t.jsx)(E.UnreadDot,{})]}),count:L,children:a("titleUpper")})})}),children:[R&&(0,t.jsx)(C,{"data-testid":"folders-overlay-empty",title:n("list.empty_title"),description:n("list.empty_message")}),D&&M.sort((e,t)=>
8e.folder_name&&t.folder_name?e.folder_name.localeCompare(t.folder_name):0).map(e=>(0,t.jsx)(m["TooltipÃ"],{caption:e.folder_name,side:"right",className:(0,p.cx)(k&&"hidden"),"data-testid":e.folder_name,children:(0,t.jsx)(S.NewSectionLink,{"data-testid":e.folder_name,href:`/folder/${e.id}`,onClick:()=>{d(),(0,f.trackEvent)((0,ei.NavigateFolderEvent)({FolderID:`${e.id}`,...k&&{IsFavorite:!!e.favorite_section_id}}))},children:(0,t.jsx)(S.NewSectionRow,{"data-testid":e.folder_name,appendStart:(0,t.jsx)(en.FolderIcon,{size:24}),count:!e.has_live_speech&&e.new_unread_msg_count?e.new_unread_msg_count>99?"99+":e.new_unread_msg_count:void 0,appendEnd:(0,S.sectionRowAppendEndContent)(j,e.id,"folder",!!e.favorite_section_id,w,e.has_live_speech,k),className:(0,p.cx)(e.new_unread_msg_count&&"font-semibold"),forceExpanded:i,children:e.folder_name},`${e.id}${j===e.id?"-favorite-menu-expanded":""}`)},e.id)},e.id))]})}var ec=e.i(501055);(0,r.atom)({sharedWithMe:!0,trash:!0});let eu=(0,r.atom)(void 0),ep="OverlayMenu";function em(){let e=(0,o.useAtomValue)(eu),{hideModal:r}=(0,l.useModalKey)(ep),{isDesktop:c}=(0,i.useDesktop)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.DialogOverlay,{onClick:r,className:"z-[-1] bg-transparent translate-x-[56px]"}),(0,t.jsxs)("div",{className:"w-64 h-[100dvh] z-[1000] bg-default border-r border-subtle overflow-y-auto pb-24 px-4 pt-[11px] after:content-[''] after:absolute after:top-0 after:right-0 after:bottom-0 after:left-[10px] after:shadow-lg after:z-[-1]",style:{height:c?`calc(100dvh - ${n.DESKTOP_TITLE_BAR_HEIGHT}px - ${n.DESKTOP_WRAPPER_PADDING}px) `:"100dvh",top:c?`${n.DESKTOP_TITLE_BAR_HEIGHT}px`:0,borderTopLeftRadius:c?`${n.DESKTOP_OVERLAY_MENU_BORDER_RADIUS}px`:0,borderBottomLeftRadius:c?`${n.DESKTOP_OVERLAY_MENU_BORDER_RADIUS}px`:0},children:["channels"===e&&(0,t.jsx)(d.CombinedChannelsSection,{overlayView:!0}),"dms"===e&&(0,t.jsx)(P,{overlayView:!0}),"folders"===e&&(0,t.jsx)(ed,{overlayView:!0}),"favorites"===e&&(0,t.jsx)(et,{overlayView:!0})]})]})}function ex(e){let{children:a}=e,{isActive:r}=(0,l.useModalKey)(ep),o=(0,N.useLeftNavBarResize)(),{isDesktop:d}=(0,i.useDesktop)();return(0,t.jsx)(ec.RelativePortal,{content:r&&(0,t.jsx)(em,{}),offset:d?-1*n.DESKTOP_TITLE_BAR_HEIGHT:56*("web"!==o.screenWidth),offsetX:d?o.isExpanded?-1*n.DESKTOP_NAVBAR_MIN_WIDTH:-1*n.DESKTOP_NAVBAR_COLLAPSED_WIDTH:0,placement:d?"top-left":"right",children:a})}},119310,e=>{"use strict";var t=e.i(648417),a=e.i(273289),n=e.i(341331),i=e.i(453484),r=e.i(938954),o=e.i(45994),l=e.i(555767),d=e.i(716541),c=e.i(197384),p=e.i(497536),m=e.i(51524),x=e.i(941796),f=e.i(622712),h=e.i(753700),g=e.i(491482),v=e.i(832531),_=e.i(376217),b=e.i(911662),y=e.i(90045),j=e.i(522756),w=e.i(122724),N=e.i(909112),E=e.i(484315);e.i(231143);var C=e.i(711286),S=e.i(754799),k=e.i(530151),A=e.i(501055),I=e.i(460915),M=e.i(612162),L=e.i(486051);function T({notifs:e,modalKey:x,testId:v="notification-modal",overlayClassName:k,className:A}){let I=(0,j.useTranslations)("left-nav.notifications"),{hideModal:R}=(0,C.useModalKey)(x),[D,O]=(0,w.useState)(0),B=(0,_.useQueryClient)(),F=(0,w.useMemo)(()=>(0,M.groupNotifications)(e??[]),[e]),z=(0,w.useMemo)(()=>(0,M.groupNotifications)(e??[],!0),[e]);(0,E.useEscapeHandler)(R);let P=(0,g.useMutation)({mutationFn:async e=>{let t=await f.updateNotificationReadStatus({body:{notification_id:e,read:!0}});if(t.data?.status==="OK")return t.data;throw t.error},onMutate:async e=>{await B.cancelQueries({queryKey:(0,S.notificationQueryCreator)().queryKey});let t=B.getQueryData((0,S.notificationQueryCreator)().queryKey);return B.setQueryData((0,S.notificationQueryCreator)().queryKey,t=>{if(!t||!t.notifications)return t;let a=t.notifications.map(t=>t.notification_id===e?{...t,read:!0}:t);return{...t,notifications:a}}),{previousData:t}},onError:(e,t,a)=>{B.setQueryData((0,S.notificationQueryCreator)().queryKey,a?.previousData)}});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.DialogOverlay,{onClick:R,className:(0,i.cx)("z-[-1] bg-transparent",k)}),(0,t.jsxs)("div",{className:(0,i.cx)("flex flex-col shadow-lg rounded-md w-[400px] h-[500px] overflow-hidden border z-[100] bg-default max-w-[100dvw]",A),"data-testid":v,children:[(0,t.jsxs)("div",{className:"shrink-0 bg-default z-10 pt-3",children:[(0,t.jsxs)("div",{className:"flex flex-row justify-between items-center border-b-subtle w-full px-4 pb-2 border-b",children:[(0,t.jsx)("span",{className:"font-semibold text-md",children:I("title")}),(0,t.jsx)(n.Button,{"data-testid":"mark-all-as-read-button",onClick:()=>{let e=0;for(let t of z)for(let a of t.notifications)e++,P.mutate(a.notification_id);(0,h.trackEvent)("NotificationCenter_MarkAll",{NotificationCenterNumUnread:e})},variant:"ghost",className:"text-palette-blue-700 [-webkit-app-region:no-drag]",disabled:0===z.length,children:I("markAllAsRead")})]}),(0,t.jsx)(d["TabsÃ"],{className:"px-4 pt-1",tabIndex:D,onTabIndexChange:O,tabs:[I("tabs.inbox"),I("tabs.unread")]})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain otter-scrollbar bg-default pb-3","data-testid":"notification-center-body",children:(0,t.jsxs)(d["TabContentÃ"],{tabIndex:D,children:[(0,t.jsx)("div",{className:"font-regular",children:0===F.length?(0,t.jsx)("div",{"data-testid":"empty-inbox",className:"bg-default pt-14",children:(0,t.jsxs)("div",{className:"flex flex-col items-center text-center justify-center m-[32px] gap-2",children:[(0,t.jsx)("div",{className:"p-4 bg-default-hover rounded-full aspect-square mb-6",children:(0,t.jsx)(p.BellIcon,{size:45,className:"shrink-0"})}),(0,t.jsx)("span",{className:"font-semibold",children:I("empty.noNotifications")}),(0,t.jsx)("span",{className:"text-xs font-regular text-subtle px-6",children:I("empty.noNotificationsDescription")})]})}):(0,t.jsxs)(t.Fragment,{children:[$(F),(0,t.jsx)("div",{className:"bg-default flex w-full justify-center items-center py-8",children:(0,t.jsx)("span",{className:"text-sm text-subtle",children:I("footer.allNotifications")})})]})},"Inbox"),(0,t.jsx)("div",{className:"font-regular",children:0===z.length?(0,t.jsx)("div",{"data-testid":"empty-unread-inbox",className:"bg-default pt-14",children:(0,t.jsxs)("div",{className:"flex flex-col items-center text-center justify-center m-[32px] gap-2",children:[(0,t.jsx)("div",{className:"p-4 bg-default-hover rounded-full aspect-square mb-6",children:(0,t.jsx)(m.CheckmarkIcon,{size:45,className:"shrink-0"})}),(0,t.jsx)("span",{className:"font-semibold",children:I("empty.allCaughtUp")}),(0,t.jsx)("span",{className:"text-xs font-regular text-subtle px-6",children:I("empty.allCaughtUpDescription")})]})}):(0,t.jsxs)(t.Fragment,{children:[$(z),(0,t.jsx)("div",{className:" bg-default flex w-full justify-center items-center py-8",children:(0,t.jsx)("span",{className:"text-sm text-subtle",children:I.rich("footer.allUnreadNotifications",{bold:e=>(0,t.jsx)("strong",{children:e})})})})]})},"Unread")]})})]})]});function $(e){return(0,t.jsx)("div",{className:"border-t first:border-t-0",children:(0,t.jsx)(l.MenuList,{className:"border-none rounded-none",children:e.map(e=>(0,t.jsxs)("div",{className:"pt-2",children:[(0,t.jsx)("div",{"data-testid":`${e.displayDate}`,className:"border-b px-2 py-1 pb-3",children:(0,t.jsx)("span",{children:e.displayDate})}),e.notifications.map(e=>{let n=(0,b.fromUnixTime)(Number(e.timestamp)),r=(0,M.getTimeString)(n,!0);return(0,t.jsx)(y.default,{onClick:()=>{e.read||(P.mutate(e.notification_id),("request_approved"===e.action||"manual_share"===e.action)&&B.invalidateQueries({queryKey:(0,N.speechQueryCreator)(e.speech_otid).queryKey})),(0,h.trackEvent)("NotificationItem_Navigation",(0,M.notificationAnalyticsContext)(e)),R()},href:`/u/${e.speech_otid}`,children:(0,t.jsx)("div",{className:"group",children:(0,t.jsx)(l.MenuListItem,{"data-testid":"notification-items",appendStart:(0,t.jsxs)("div",{className:"relative self-start",children:[(0,t.jsx)(a.Avatar,{size:"md",imageUrl:e.payload.avatar.avatar_url}),!e.read&&(0,t.jsx)("div",{className:"absolute top-0 right-0 rounded-full h-1.5 w-1.5 bg-palette-red-600 translate-x-1 -translate-y-1"})]}),appendEnd:e.read?(0,t.jsx)(o.IconButton,{inert:!0,variant:"ghost"}):(0,t.jsx)(c["TooltipÃ"],{caption:I("markAsRead"),children:(0,t.jsx)(o.IconButton,{onClick:t=>{t.preventDefault(),t.stopPropagation(),P.mutate(e.notification_id),(0,h.trackEvent)("NotificationItem_MarkRead",(0,M.notificationAnalyticsContext)(e))},variant:"ghost",shape:"square",className:"text-palette-blue-700 opacity-0 group-hover:opacity-100 hover:bg-palette-blue-200","data-testid":"mark-read-button",children:(0,t.jsx)(m.CheckmarkIcon,{size:30})})}),className:(0,i.cx)("flex flex-row items-center m-0 p-4 h-fit roun
8ded-none text-wrap last:mb-0 first:mt-0 border-b",e.read?"bg-default":"bg-default-hover"),children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,t.jsx)("span",{className:"text-wrap",children:e.payload.content.title?.map(e=>(0,t.jsx)("span",{className:`${"bold"===e.type?"font-semibold":"font-regular"}`,children:e.text},e.text))}),(0,t.jsx)("span",{className:"text-xs font-regular text-subtle",children:r}),(0,t.jsx)("span",{className:"font-regular",children:e.payload.content.body?.map(e=>(0,L.richTextParser)(e))})]})})})},e.notification_id)})]},e.date))})})}}let R="notificationModal";e.s(["NOTIFICATION_MODAL_KEY",0,R,"NotificationBell",0,function(e){let{className:a,placement:n,tooltipPlacement:r,iconSize:o=24}=e,l=(0,k.useModalPosition)(),{isActive:d}=(0,C.useModalKey)(R),{data:m}=(0,v.useQuery)((0,S.notificationQueryCreator)()),f=(0,k.useLeftNavBarResize)(),h=(0,j.useTranslations)("left-nav.notifications"),g=n??("web"===f.screenWidth?"right":l),_="web"===f.screenWidth&&f.isExpanded?26:18;(0,I.useNotificationSessionUpdate)();let b=(0,w.useMemo)(()=>m?.notifications?.filter(e=>!e.read).length??0,[m]);return(0,w.useEffect)(()=>{(0,x.callElectronTabsStrip)("command",{type:"notificationUnread",unread:b>0})},[b]),(0,t.jsx)(A.RelativePortal,{content:d&&(0,t.jsx)(T,{modalKey:R,notifs:m?.notifications??void 0,overlayClassName:f.isExpanded?void 0:"translate-x-[56px]"}),offset:_,placement:g,children:(0,t.jsx)(C.ModalTrigger,{modalKey:R,children:(0,t.jsx)(c["TooltipÃ"],{caption:h("title"),side:r??"right",className:(0,i.cx)(f.showExpanded&&null==r?"opacity-0":"opacity-100"),children:(0,t.jsxs)("button",{className:(0,i.cx)("[-webkit-app-region:no-drag] relative flex items-center",a),"data-testid":"notification-trigger","aria-label":"Notifications",children:[(0,t.jsx)("div",{className:"p-1 hover:bg-default-hover rounded-full",children:(0,t.jsx)(p.BellIcon,{size:o})}),b>0&&(0,t.jsx)("div",{"data-testid":"notification-unread-badge",className:(0,i.cx)("size-2 bg-negative rounded-full flex top-1.5 right-1.5 absolute")})]})})})})}])},776036,e=>{"use strict";var t=e.i(622712);e.s(["workspacePublicGroupsQueryCreator",0,function(e={},a={}){let{filter_joined_only:n=!1,exclude_joined:i=!0,return_max_limit:r}=e,o="return_max_limit"in e?r:20,l={filter_joined_only:n,exclude_joined:i,...void 0!==o&&{return_max_limit:o}};return{...a,queryKey:["workspace_public_groups",l],queryFn:async()=>{let e=await t.listWorkspacePublicGroups({query:l});if(e.data?.status==="OK")return e.data;throw e.error}}}])}]); 9 10//# sourceMappingURL=1ohwinl2ttbz1.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.