(this.webpackChunk_msteams_react_web_client=this.webpackChunk_msteams_react_web_client||[]).push([[344790],{707415:e=>{e.exports=[{types:{}},{types:{Query:[2,{teams:"[Team!]!",teamsLocal:"[Team!]!"}]}}]},43692:(e,t,a)=>{"use strict";a.r(t),a.d(t,{resolvers:()=>P,typeDefs:()=>n});var n=a(707415),r=a(401368),s=a(405826),o=a(259521),i=a(813135),c=a(852199);a(480354);const l=({accessType:e,channels:t,memberRole:a,teamSettings:n,teamGuestSettings:r,teamType:s,membershipSummary:o,groupInformation:i,...c},l)=>{let h={...c,visibility:f(e),memberRole:d(a),teamSettings:p(n),teamGuestSettings:m(r),teamType:b(s),groupInformation:{...i},membershipSummary:S(o),teamLockState:w(c.isTeamLocked,c.isUnlockMembershipSyncRequired),channels:[]};return h={...h,channels:t.map((e=>u(e,h,l)))},h},u=({consumptionHorizon:e,consumptionHorizonBookmark:t,tabs:a,channelType:n,isFavorite:r,isFavoriteByDefault:l,lastMessage:u,memberRole:m,membershipSummary:p,channelSettings:b,...g},f,w)=>({memberRole:d(m||s.b_.Undefined),membershipSummary:p&&S(p),channelSettings:h(b||void 0),consumptionHorizon:(0,i.f4)(g.id,o.Cr.Topic,{lastjoinat:g.lastJoinAt},e),tabs:a||[],channelType:C(n),isShown:r,isShownByDefault:l,lastMessage:u&&(0,i.qQ)(u,(0,i.TH)(u,g.id,w)),team:f,...g,importMetadata:(0,c.Cq)(g.importMetadata),archivalLevel:y(g.archivalLevel)}),d=e=>{switch(e){case s.b_.Admin:return"Admin";case s.b_.Guest:return"Guest";case s.b_.User:return"User";case s.b_.Undefined:default:return"Undefined"}},m=e=>{if(e)return p(e)},h=e=>{let t;switch(e?.channelPostPermissions){case s.Q8.Moderators:t="Moderators";break;case s.Q8.EveryoneButGuests:t="EveryoneButGuests";break;case s.Q8.Everyone:default:t="Everyone"}return{channelPostPermissions:t}},p=e=>{let t;if(!e)return{};switch(e?.generalChannelPosting){case s.N1.AnyonePost:t="AnyonePost";break;case s.N1.AnyoneWithWarning:t="AnyoneWithWarning";break;case s.N1.OwnersPost:t="OwnersPost"}return{generalChannelPosting:t,createAndDeleteTab:e.createTab&&e.deleteTab,createAndUpdateChannel:e.createTopic&&e.updateTopic,createPrivateChannel:e.isPrivateChannelCreationEnabled,createSharedChannel:e.isSharedChannelCreationEnabled,deleteChannel:e.deleteTopic,deleteMessagesEnabled:e.deleteEnabled,editMessagesEnabled:e.editEnabled,adminDeleteEnabled:e.adminDeleteEnabled,funControl:{customMemesEnabled:e.customMemesEnabled,giphyEnabled:e.giphyEnabled,stickersEnabled:e.stickersEnabled&&e.teamMemesEnabled,giphyRating:g(e.giphyRating)},mentions:{teamMention:e.teamMention,channelMention:e.channelMention},installAndUninstallApps:e.installApp&&e.uninstallApp,updateConnectors:e.updateIntegration,uploadCustomApp:e.uploadCustomApp}},b=e=>{switch(e){case s.YV.Class:return"Class";case s.YV.Edu:return"Edu";case s.YV.Plc:return"Plc";case s.YV.Staff:return"Staff";case s.YV.Standard:return"Team";case s.YV.HealthcareCareCoordination:return"HealthcareCareCoordination";default:return null}},C=e=>{switch(e){case s.Cu.Standard:return"Standard";case s.Cu.Private:return"Private";case s.Cu.Shared:return"Shared";default:return null}},y=e=>{switch(e){case"none":return"none";case"topic":return"topic";case"space":return"space";default:return}},S=e=>({memberCount:e.totalMemberCount,externalMemberCount:e.externalMemberCount,adminCount:e.adminRoleCount,guestCount:e.guestRoleCount,userCount:e.userRoleCount,botCount:e.botCount,readerCount:e.mutedMembersCount}),g=e=>{switch(e){case s.nP.Moderate:return"Moderate";case s.nP.NoRestriction:return"NoRestriction";case s.nP.Strict:default:return"Strict"}},f=e=>{switch(e){case s.S5.All:return"All";case s.S5.HiddenMembership:return"HiddenMembership";case s.S5.None:return"None";case s.S5.Private:return"Private";case s.S5.Public:return"Public";case s.S5.Secret:return"Secret";case s.S5.Unknown:default:return"Unknown"}},w=(e,t)=>{let a;return a=e?"Locked":t?"PartialSuccess":"Unlocked",a};var v=a(976651),M=a(767681);const P={Query:{async teams(e,t,{getCSAService:a,cache:n,coreSettings:s,localStorage:o,loggerFactory:i,authenticationUser:c,scenarioFactory:u}){const{enableChannelLocalCache:d,enableChannelIndexedDBCache:m,disableChannelIndexedDBNextCache:h}=s.get(r.w.Search);if(!d&&!m){return(await(await a()).getTeams()).map((e=>l(e,i)))}const p=await async function(e,t,a){if(!e)return!1;try{return void 0!==await(0,M.p9)(e.profile.objectId,e.profile.tenantId,a,t)}catch{return!1}}(c,!!h,u);return async function(e,t,a,n,r){const s=(await(await a()).getTeams()).map((e=>l(e,t))),o=s.map(M.fb);r&&(0,M.aC)(e,o);try{n.writeQuery({query:v.y,data:{teams:o}})}catch(e){t.newLogger("TeamsResolvers","data-resolvers-browser-teams").error(`Could not update apollo cache, ${e&&e.message}`)}return s}(o,i,a,n,!!d&&!p)},teamsLocal:async(e,t,{coreSettings:a,localStorage:n,authenticationUser:r,scenarioFactory:s})=>r&&await(0,M.DB)(r,a,n,s)||[]}}}}]);
//# sourceMappingURL=https://local.teams.office.com/sourcemaps/hashed-assets/r_data-resolvers-browser-teams-128d98a7cf8c5880.js.map