![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /opt/mattermost/client/ |
Upload File : |
"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[4823],{66276:(t,e,o)=>{o.r(e),o.d(e,{TrackActionCategory:()=>d,TrackEnterpriseSKU:()=>i,TrackGroupsFeature:()=>n,TrackInviteGroupEvent:()=>a,TrackMiscCategory:()=>u,TrackPassiveKeywordsEvent:()=>r,TrackPassiveKeywordsFeature:()=>c,TrackProfessionalSKU:()=>s,TrackPropertyUser:()=>g,TrackPropertyUserAgent:()=>l,TrackScheduledPostsFeature:()=>h,eventCategory:()=>p,eventSKUs:()=>m});const s="professional",i="enterprise",n="custom_groups",c="passive_keywords",h="scheduled_posts",a="invite_group_to_channel__add_member",r="update_passive_keywords",d="action",u="miscellaneous",g="user_actual_id",l="user_agent",m={[a]:[s,i],[r]:[s,i]},p={[a]:d,[r]:d}},62814:(t,e,o)=>{const s=["fetchThreads","collapsedThreads","collapsedThreadsExtended","direction","fetchAll","perPage"];function i(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,s)}return o}function n(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?i(Object(o),!0).forEach((function(e){c(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function c(t,e,o){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,"string");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}o(43813),o(1112),o(12401),o(76685),o(3188),o(59297),o(29206),o(17046),o(6552),o(32773),o(4290),o(57406),o(55448),Object.defineProperty(e,"__esModule",{value:!0}),e.ClientError=e.DEFAULT_LIMIT_AFTER=e.DEFAULT_LIMIT_BEFORE=e.HEADER_X_VERSION_ID=e.HEADER_X_CLUSTER_ID=void 0,e.parseAndMergeNestedHeaders=m;const h=o(66276),a=o(10032),r=o(75904),d=o(60102),u="Content-Type",g="X-Requested-With";e.HEADER_X_CLUSTER_ID="X-Cluster-Id",e.HEADER_X_VERSION_ID="X-Version-Id";const l=60;function m(t){const e=new Map;let o=new Map;return t.forEach(((t,s)=>{const i=s.replace(/\b[a-z]/g,(t=>t.toUpperCase()));let n=t;if(t&&t.match(/\n\S+:\s\S+/)){const e=t.split("\n");n=e.shift();const s=new Map(e.map((t=>t.split(/:\s/))));o=new Map([...o,...s])}e.set(i,n)})),new Map([...e,...o])}e.DEFAULT_LIMIT_BEFORE=30,e.DEFAULT_LIMIT_AFTER=30,e.default=class{constructor(){var t=this;c(this,"logToConsole",!1),c(this,"serverVersion",""),c(this,"clusterId",""),c(this,"token",""),c(this,"csrf",""),c(this,"url",""),c(this,"urlVersion","/api/v4"),c(this,"userAgent",null),c(this,"enableLogging",!1),c(this,"defaultHeaders",{}),c(this,"userId",""),c(this,"diagnosticId",""),c(this,"includeCookies",!0),c(this,"setAuthHeader",!0),c(this,"translations",{connectionError:"There appears to be a problem with your internet connection.",unknownError:"We received an unexpected status code from the server."}),c(this,"userRoles",""),c(this,"createUser",((t,e,o,s)=>{const i={};return e&&(i.t=e),o&&(i.iid=o),s&&(i.r=s),this.doFetch("".concat(this.getUsersRoute()).concat((0,d.buildQueryString)(i)),{method:"post",body:JSON.stringify(t)})})),c(this,"patchMe",(t=>this.doFetch("".concat(this.getUserRoute("me"),"/patch"),{method:"put",body:JSON.stringify(t)}))),c(this,"patchUser",(t=>this.doFetch("".concat(this.getUserRoute(t.id),"/patch"),{method:"put",body:JSON.stringify(t)}))),c(this,"updateUser",(t=>this.doFetch("".concat(this.getUserRoute(t.id)),{method:"put",body:JSON.stringify(t)}))),c(this,"promoteGuestToUser",(t=>this.doFetch("".concat(this.getUserRoute(t),"/promote"),{method:"post"}))),c(this,"demoteUserToGuest",(t=>this.doFetch("".concat(this.getUserRoute(t),"/demote"),{method:"post"}))),c(this,"updateUserRoles",((t,e)=>this.doFetch("".concat(this.getUserRoute(t),"/roles"),{method:"put",body:JSON.stringify({roles:e})}))),c(this,"updateUserMfa",((t,e,o)=>{const s={activate:e};return e&&(s.code=o),this.doFetch("".concat(this.getUserRoute(t),"/mfa"),{method:"put",body:JSON.stringify(s)})})),c(this,"updateUserPassword",((t,e,o)=>this.doFetch("".concat(this.getUserRoute(t),"/password"),{method:"put",body:JSON.stringify({current_password:e,new_password:o})}))),c(this,"resetUserPassword",((t,e)=>this.doFetch("".concat(this.getUsersRoute(),"/password/reset"),{method:"post",body:JSON.stringify({token:t,new_password:e})}))),c(this,"getKnownUsers",(()=>this.doFetch("".concat(this.getUsersRoute(),"/known"),{method:"get"}))),c(this,"sendPasswordResetEmail",(t=>this.doFetch("".concat(this.getUsersRoute(),"/password/reset/send"),{method:"post",body:JSON.stringify({email:t})}))),c(this,"updateUserActive",((t,e)=>this.doFetch("".concat(this.getUserRoute(t),"/active"),{method:"put",body:JSON.stringify({active:e})}))),c(this,"uploadProfileImage",((t,e)=>{const o=new FormData;o.append("image",e);const s={method:"post",body:o};return this.doFetch("".concat(this.getUserRoute(t),"/image"),s)})),c(this,"setDefaultProfileImage",(t=>this.doFetch("".concat(this.getUserRoute(t),"/image"),{method:"delete"}))),c(this,"verifyUserEmail",(t=>this.doFetch("".concat(this.getUsersRoute(),"/email/verify"),{method:"post",body:JSON.stringify({token:t})}))),c(this,"updateMyTermsOfServiceStatus",((t,e)=>this.doFetch("".concat(this.getUserRoute("me"),"/terms_of_service"),{method:"post",body:JSON.stringify({termsOfServiceId:t,accepted:e})}))),c(this,"getTermsOfService",(()=>this.doFetch("".concat(this.getBaseRoute(),"/terms_of_service"),{method:"get"}))),c(this,"createTermsOfService",(t=>this.doFetch("".concat(this.getBaseRoute(),"/terms_of_service"),{method:"post",body:JSON.stringify({text:t})}))),c(this,"sendVerificationEmail",(t=>this.doFetch("".concat(this.getUsersRoute(),"/email/verify/send"),{method:"post",body:JSON.stringify({email:t})}))),c(this,"login",(async function(e,o){const s={login_id:e,password:o,token:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",deviceId:""};arguments.length>3&&void 0!==arguments[3]&&arguments[3]&&(s.ldap_only="true");const{data:i,headers:n}=await t.doFetchWithResponse("".concat(t.getUsersRoute(),"/login"),{method:"post",body:JSON.stringify(s)});return n.has("Token")&&t.setToken(n.get("Token")),i})),c(this,"loginWithDesktopToken",(async t=>{const e={token:t,deviceId:""};return this.doFetch("".concat(this.getUsersRoute(),"/login/desktop_token"),{method:"post",body:JSON.stringify(e)})})),c(this,"loginById",(function(e,o){const s={id:e,password:o,token:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",device_id:""};return t.doFetch("".concat(t.getUsersRoute(),"/login"),{method:"post",body:JSON.stringify(s)})})),c(this,"logout",(async()=>{const{response:t}=await this.doFetchWithResponse("".concat(this.getUsersRoute(),"/logout"),{method:"post"});return t.ok&&(this.token=""),this.serverVersion="",t})),c(this,"getProfiles",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.doFetch("".concat(t.getUsersRoute()).concat((0,d.buildQueryString)(n({page:e,per_page:o},s))),{method:"get"})})),c(this,"getProfilesByIds",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.doFetch("".concat(t.getUsersRoute(),"/ids").concat((0,d.buildQueryString)(o)),{method:"post",body:JSON.stringify(e)})})),c(this,"getProfilesByUsernames",(t=>this.doFetch("".concat(this.getUsersRoute(),"/usernames"),{method:"post",body:JSON.stringify(t)}))),c(this,"getProfilesInTeam",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return t.doFetch("".concat(t.getUsersRoute()).concat((0,d.buildQueryString)(n(n({},c),{},{in_team:e,page:o,per_page:s,sort:i}))),{method:"get"})})),c(this,"getProfilesNotInTeam",(function(e,o){const s={not_in_team:e,page:arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,per_page:arguments.length>3&&void 0!==arguments[3]?arguments[3]:l};return o&&(s.group_constrained=!0),t.doFetch("".concat(t.getUsersRoute()).concat((0,d.buildQueryString)(s)),{method:"get"})})),c(this,"getProfilesWithoutTeam",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.doFetch("".concat(t.getUsersRoute()).concat((0,d.buildQueryString)(n(n({},s),{},{without_team:1,page:e,per_page:o}))),{method:"get"})})),c(this,"getProfilesInChannel",(function(e){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const s={in_channel:e,page:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,per_page:arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,sort:arguments.length>3&&void 0!==arguments[3]?arguments[3]:""};return t.doFetch("".concat(t.getUsersRoute()).concat((0,d.buildQueryString)(n(n({},s),o))),{method:"get"})})),c(this,"getProfilesInGroupChannels",(t=>this.doFetch("".concat(this.getUsersRoute(),"/group_channels"),{method:"post",body:JSON.stringify(t)}))),c(this,"getProfilesNotInChannel",(function(e,o,s){const i={in_team:e,not_in_channel:o,page:arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,per_page:arguments.length>4&&void 0!==arguments[4]?arguments[4]:l};return s&&(i.group_constrained=!0),t.doFetch("".concat(t.getUsersRoute()).concat((0,d.buildQueryString)(i)),{method:"get"})})),c(this,"getProfilesInGroup",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return t.doFetch("".concat(t.getUsersRoute()).concat((0,d.buildQueryString)({in_group:e,page:o,per_page:s,sort:i})),{method:"get"})})),c(this,"getProfilesNotInGroup",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getUsersRoute()).concat((0,d.buildQueryString)({not_in_group:e,page:o,per_page:s})),{method:"get"})})),c(this,"getMe",(()=>this.doFetch("".concat(this.getUserRoute("me")),{method:"get"}))),c(this,"getUser",(t=>this.doFetch("".concat(this.getUserRoute(t)),{method:"get"}))),c(this,"getUserByUsername",(t=>this.doFetch("".concat(this.getUsersRoute(),"/username/").concat(t),{method:"get"}))),c(this,"getUserByEmail",(t=>this.doFetch("".concat(this.getUsersRoute(),"/email/").concat(t),{method:"get"}))),c(this,"getProfilePictureUrl",((t,e)=>{const o={};return e&&(o._=e),"".concat(this.getUserRoute(t),"/image").concat((0,d.buildQueryString)(o))})),c(this,"getDefaultProfilePictureUrl",(t=>"".concat(this.getUserRoute(t),"/image/default"))),c(this,"autocompleteUsers",(function(e,o,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{limit:25};return t.doFetch("".concat(t.getUsersRoute(),"/autocomplete").concat((0,d.buildQueryString)({in_team:o,in_channel:s,name:e,limit:i.limit})),{method:"get"})})),c(this,"getSessions",(t=>this.doFetch("".concat(this.getUserRoute(t),"/sessions"),{method:"get"}))),c(this,"revokeSession",((t,e)=>this.doFetch("".concat(this.getUserRoute(t),"/sessions/revoke"),{method:"post",body:JSON.stringify({session_id:e})}))),c(this,"revokeAllSessionsForUser",(t=>this.doFetch("".concat(this.getUserRoute(t),"/sessions/revoke/all"),{method:"post"}))),c(this,"revokeSessionsForAllUsers",(()=>this.doFetch("".concat(this.getUsersRoute(),"/sessions/revoke/all"),{method:"post"}))),c(this,"getUserAudits",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getUserRoute(e),"/audits").concat((0,d.buildQueryString)({page:o,per_page:s})),{method:"get"})})),c(this,"getUsersForReporting",(t=>{const e=(0,d.buildQueryString)(t);return this.doFetch("".concat(this.getReportsRoute(),"/users").concat(e),{method:"get"})})),c(this,"getUserCountForReporting",(t=>{const e=(0,d.buildQueryString)(t);return this.doFetch("".concat(this.getReportsRoute(),"/users/count").concat(e),{method:"get"})})),c(this,"startUsersBatchExport",(t=>{const e=(0,d.buildQueryString)(t);return this.doFetch("".concat(this.getReportsRoute(),"/users/export").concat(e),{method:"post"})})),c(this,"checkUserMfa",(t=>this.doFetch("".concat(this.getUsersRoute(),"/mfa"),{method:"post",body:JSON.stringify({login_id:t})}))),c(this,"generateMfaSecret",(t=>this.doFetch("".concat(this.getUserRoute(t),"/mfa/generate"),{method:"post"}))),c(this,"searchUsers",((t,e)=>this.doFetch("".concat(this.getUsersRoute(),"/search"),{method:"post",body:JSON.stringify(n({term:t},e))}))),c(this,"getStatusesByIds",(t=>this.doFetch("".concat(this.getUsersRoute(),"/status/ids"),{method:"post",body:JSON.stringify(t)}))),c(this,"getStatus",(t=>this.doFetch("".concat(this.getUserRoute(t),"/status"),{method:"get"}))),c(this,"updateStatus",(t=>this.doFetch("".concat(this.getUserRoute(t.user_id),"/status"),{method:"put",body:JSON.stringify(t)}))),c(this,"updateCustomStatus",(t=>this.doFetch("".concat(this.getUserRoute("me"),"/status/custom"),{method:"put",body:JSON.stringify(t)}))),c(this,"unsetCustomStatus",(()=>this.doFetch("".concat(this.getUserRoute("me"),"/status/custom"),{method:"delete"}))),c(this,"removeRecentCustomStatus",(t=>this.doFetch("".concat(this.getUserRoute("me"),"/status/custom/recent/delete"),{method:"post",body:JSON.stringify(t)}))),c(this,"moveThread",((t,e)=>{const o=this.getPostRoute(t)+"/move";return this.doFetch(o,{method:"post",body:JSON.stringify({channel_id:e})})})),c(this,"switchEmailToOAuth",(function(e,o,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return t.doFetch("".concat(t.getUsersRoute(),"/login/switch"),{method:"post",body:JSON.stringify({current_service:"email",new_service:e,email:o,password:s,mfa_code:i})})})),c(this,"switchOAuthToEmail",((t,e,o)=>this.doFetch("".concat(this.getUsersRoute(),"/login/switch"),{method:"post",body:JSON.stringify({current_service:t,new_service:"email",email:e,new_password:o})}))),c(this,"switchEmailToLdap",(function(e,o,s,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";return t.doFetch("".concat(t.getUsersRoute(),"/login/switch"),{method:"post",body:JSON.stringify({current_service:"email",new_service:"ldap",email:e,password:o,ldap_id:s,new_password:i,mfa_code:n})})})),c(this,"switchLdapToEmail",(function(e,o,s){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return t.doFetch("".concat(t.getUsersRoute(),"/login/switch"),{method:"post",body:JSON.stringify({current_service:"ldap",new_service:"email",email:o,password:e,new_password:s,mfa_code:i})})})),c(this,"getAuthorizedOAuthApps",(t=>this.doFetch("".concat(this.getUserRoute(t),"/oauth/apps/authorized"),{method:"get"}))),c(this,"authorizeOAuthApp",((t,e,o,s,i)=>this.doFetch("".concat(this.url,"/oauth/authorize"),{method:"post",body:JSON.stringify({client_id:e,response_type:t,redirect_uri:o,state:s,scope:i})}))),c(this,"deauthorizeOAuthApp",(t=>this.doFetch("".concat(this.url,"/oauth/deauthorize"),{method:"post",body:JSON.stringify({client_id:t})}))),c(this,"createUserAccessToken",((t,e)=>this.doFetch("".concat(this.getUserRoute(t),"/tokens"),{method:"post",body:JSON.stringify({description:e})}))),c(this,"getUserAccessToken",(t=>this.doFetch("".concat(this.getUsersRoute(),"/tokens/").concat(t),{method:"get"}))),c(this,"getUserAccessTokensForUser",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getUserRoute(e),"/tokens").concat((0,d.buildQueryString)({page:o,per_page:s})),{method:"get"})})),c(this,"getUserAccessTokens",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return t.doFetch("".concat(t.getUsersRoute(),"/tokens").concat((0,d.buildQueryString)({page:e,per_page:o})),{method:"get"})})),c(this,"revokeUserAccessToken",(t=>this.doFetch("".concat(this.getUsersRoute(),"/tokens/revoke"),{method:"post",body:JSON.stringify({token_id:t})}))),c(this,"disableUserAccessToken",(t=>this.doFetch("".concat(this.getUsersRoute(),"/tokens/disable"),{method:"post",body:JSON.stringify({token_id:t})}))),c(this,"enableUserAccessToken",(t=>this.doFetch("".concat(this.getUsersRoute(),"/tokens/enable"),{method:"post",body:JSON.stringify({token_id:t})}))),c(this,"getServerLimits",(()=>this.doFetchWithResponse("".concat(this.getServerLimitsRoute()),{method:"get"}))),c(this,"createTeam",(t=>this.doFetch("".concat(this.getTeamsRoute()),{method:"post",body:JSON.stringify(t)}))),c(this,"deleteTeam",(t=>this.doFetch("".concat(this.getTeamRoute(t)),{method:"delete"}))),c(this,"unarchiveTeam",(t=>this.doFetch("".concat(this.getTeamRoute(t),"/restore"),{method:"post"}))),c(this,"updateTeam",(t=>this.doFetch("".concat(this.getTeamRoute(t.id)),{method:"put",body:JSON.stringify(t)}))),c(this,"patchTeam",(t=>this.doFetch("".concat(this.getTeamRoute(t.id),"/patch"),{method:"put",body:JSON.stringify(t)}))),c(this,"regenerateTeamInviteId",(t=>this.doFetch("".concat(this.getTeamRoute(t),"/regenerate_invite_id"),{method:"post"}))),c(this,"updateTeamScheme",((t,e)=>{const o={scheme_id:e};return this.doFetch("".concat(this.getTeamSchemeRoute(t)),{method:"put",body:JSON.stringify(o)})})),c(this,"checkIfTeamExists",(t=>this.doFetch("".concat(this.getTeamNameRoute(t),"/exists"),{method:"get"}))),c(this,"getTeams",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t.doFetch("".concat(t.getTeamsRoute()).concat((0,d.buildQueryString)({page:e,per_page:o,include_total_count:s,exclude_policy_constrained:i})),{method:"get"})})),c(this,"getTeam",(t=>this.doFetch(this.getTeamRoute(t),{method:"get"}))),c(this,"getTeamByName",(t=>this.doFetch(this.getTeamNameRoute(t),{method:"get"}))),c(this,"getMyTeams",(()=>this.doFetch("".concat(this.getUserRoute("me"),"/teams"),{method:"get"}))),c(this,"getTeamsForUser",(t=>this.doFetch("".concat(this.getUserRoute(t),"/teams"),{method:"get"}))),c(this,"getMyTeamMembers",(()=>this.doFetch("".concat(this.getUserRoute("me"),"/teams/members"),{method:"get"}))),c(this,"getMyTeamUnreads",(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t.doFetch("".concat(t.getUserRoute("me"),"/teams/unread").concat((0,d.buildQueryString)({include_collapsed_threads:e})),{method:"get"})})),c(this,"getTeamMembers",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,i=arguments.length>3?arguments[3]:void 0;return t.doFetch("".concat(t.getTeamMembersRoute(e)).concat((0,d.buildQueryString)(n({page:o,per_page:s},i))),{method:"get"})})),c(this,"getTeamMembersForUser",(t=>this.doFetch("".concat(this.getUserRoute(t),"/teams/members"),{method:"get"}))),c(this,"getTeamMember",((t,e)=>this.doFetch("".concat(this.getTeamMemberRoute(t,e)),{method:"get"}))),c(this,"getTeamMembersByIds",((t,e)=>this.doFetch("".concat(this.getTeamMembersRoute(t),"/ids"),{method:"post",body:JSON.stringify(e)}))),c(this,"addToTeam",((t,e)=>{const o={user_id:e,team_id:t};return this.doFetch("".concat(this.getTeamMembersRoute(t)),{method:"post",body:JSON.stringify(o)})})),c(this,"addToTeamFromInvite",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const s=(0,d.buildQueryString)({token:e,invite_id:o});return t.doFetch("".concat(t.getTeamsRoute(),"/members/invite").concat(s),{method:"post"})})),c(this,"addUsersToTeam",((t,e)=>{const o=[];return e.forEach((e=>o.push({team_id:t,user_id:e}))),this.doFetch("".concat(this.getTeamMembersRoute(t),"/batch"),{method:"post",body:JSON.stringify(o)})})),c(this,"addUsersToTeamGracefully",((t,e)=>{const o=[];return e.forEach((e=>o.push({team_id:t,user_id:e}))),this.doFetch("".concat(this.getTeamMembersRoute(t),"/batch?graceful=true"),{method:"post",body:JSON.stringify(o)})})),c(this,"joinTeam",(t=>{const e=(0,d.buildQueryString)({invite_id:t});return this.doFetch("".concat(this.getTeamsRoute(),"/members/invite").concat(e),{method:"post"})})),c(this,"removeFromTeam",((t,e)=>this.doFetch("".concat(this.getTeamMemberRoute(t,e)),{method:"delete"}))),c(this,"getTeamStats",(t=>this.doFetch("".concat(this.getTeamRoute(t),"/stats"),{method:"get"}))),c(this,"getTotalUsersStats",(()=>this.doFetch("".concat(this.getUsersRoute(),"/stats"),{method:"get"}))),c(this,"getFilteredUsersStats",(t=>this.doFetch("".concat(this.getUsersRoute(),"/stats/filtered").concat((0,d.buildQueryString)(t)),{method:"get"}))),c(this,"invalidateAllEmailInvites",(()=>this.doFetch("".concat(this.getTeamsRoute(),"/invites/email"),{method:"delete"}))),c(this,"getTeamInviteInfo",(t=>this.doFetch("".concat(this.getTeamsRoute(),"/invite/").concat(t),{method:"get"}))),c(this,"updateTeamMemberRoles",((t,e,o)=>this.doFetch("".concat(this.getTeamMemberRoute(t,e),"/roles"),{method:"put",body:JSON.stringify({roles:o})}))),c(this,"sendEmailInvitesToTeam",((t,e)=>this.doFetch("".concat(this.getTeamRoute(t),"/invite/email"),{method:"post",body:JSON.stringify(e)}))),c(this,"sendEmailGuestInvitesToChannels",((t,e,o,s)=>(this.trackEvent("api","api_teams_invite_guests",{team_id:t,channel_ids:e}),this.doFetch("".concat(this.getTeamRoute(t),"/invite-guests/email"),{method:"post",body:JSON.stringify({emails:o,channels:e,message:s})})))),c(this,"sendEmailInvitesToTeamGracefully",((t,e)=>this.doFetch("".concat(this.getTeamRoute(t),"/invite/email?graceful=true"),{method:"post",body:JSON.stringify(e)}))),c(this,"sendEmailInvitesToTeamAndChannelsGracefully",((t,e,o,s)=>this.doFetch("".concat(this.getTeamRoute(t),"/invite/email?graceful=true"),{method:"post",body:JSON.stringify({emails:o,channelIds:e,message:s})}))),c(this,"sendEmailGuestInvitesToChannelsGracefully",(async(t,e,o,s)=>(this.trackEvent("api","api_teams_invite_guests",{team_id:t,channel_ids:e}),this.doFetch("".concat(this.getTeamRoute(t),"/invite-guests/email?graceful=true"),{method:"post",body:JSON.stringify({emails:o,channels:e,message:s})})))),c(this,"getTeamIconUrl",((t,e)=>{const o={};return e&&(o._=e),"".concat(this.getTeamRoute(t),"/image").concat((0,d.buildQueryString)(o))})),c(this,"setTeamIcon",((t,e)=>{const o=new FormData;o.append("image",e);const s={method:"post",body:o};return this.doFetch("".concat(this.getTeamRoute(t),"/image"),s)})),c(this,"removeTeamIcon",(t=>this.doFetch("".concat(this.getTeamRoute(t),"/image"),{method:"delete"}))),c(this,"updateTeamMemberSchemeRoles",((t,e,o,s)=>{const i={scheme_user:o,scheme_admin:s};return this.doFetch("".concat(this.getTeamRoute(t),"/members/").concat(e,"/schemeRoles"),{method:"put",body:JSON.stringify(i)})})),c(this,"createChannel",(t=>this.doFetch("".concat(this.getChannelsRoute()),{method:"post",body:JSON.stringify(t)}))),c(this,"createDirectChannel",(t=>this.doFetch("".concat(this.getChannelsRoute(),"/direct"),{method:"post",body:JSON.stringify(t)}))),c(this,"createGroupChannel",(t=>this.doFetch("".concat(this.getChannelsRoute(),"/group"),{method:"post",body:JSON.stringify(t)}))),c(this,"deleteChannel",(t=>this.doFetch("".concat(this.getChannelRoute(t)),{method:"delete"}))),c(this,"unarchiveChannel",(t=>this.doFetch("".concat(this.getChannelRoute(t),"/restore"),{method:"post"}))),c(this,"updateChannel",(t=>this.doFetch("".concat(this.getChannelRoute(t.id)),{method:"put",body:JSON.stringify(t)}))),c(this,"updateChannelPrivacy",((t,e)=>this.doFetch("".concat(this.getChannelRoute(t),"/privacy"),{method:"put",body:JSON.stringify({privacy:e})}))),c(this,"patchChannel",((t,e)=>this.doFetch("".concat(this.getChannelRoute(t),"/patch"),{method:"put",body:JSON.stringify(e)}))),c(this,"updateChannelNotifyProps",(t=>this.doFetch("".concat(this.getChannelMemberRoute(t.channel_id,t.user_id),"/notify_props"),{method:"put",body:JSON.stringify(t)}))),c(this,"updateChannelScheme",((t,e)=>{const o={scheme_id:e};return this.doFetch("".concat(this.getChannelSchemeRoute(t)),{method:"put",body:JSON.stringify(o)})})),c(this,"getChannel",(t=>this.doFetch("".concat(this.getChannelRoute(t)),{method:"get"}))),c(this,"getChannelByName",(function(e,o){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t.doFetch("".concat(t.getTeamRoute(e),"/channels/name/").concat(o,"?include_deleted=").concat(s),{method:"get"})})),c(this,"getChannelByNameAndTeamName",(function(e,o){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t.doFetch("".concat(t.getTeamNameRoute(e),"/channels/name/").concat(o,"?include_deleted=").concat(s),{method:"get"})})),c(this,"getChannels",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getTeamRoute(e),"/channels").concat((0,d.buildQueryString)({page:o,per_page:s})),{method:"get"})})),c(this,"getAllTeamsChannels",(()=>this.doFetch("".concat(this.getUsersRoute(),"/me/channels"),{method:"get"}))),c(this,"getArchivedChannels",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getTeamRoute(e),"/channels/deleted").concat((0,d.buildQueryString)({page:o,per_page:s})),{method:"get"})})),c(this,"getMyChannels",(function(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.doFetch("".concat(t.getUserRoute("me"),"/teams/").concat(e,"/channels").concat((0,d.buildQueryString)({include_deleted:o})),{method:"get"})})),c(this,"getAllChannelsMembers",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getUserRoute(e),"/channel_members").concat((0,d.buildQueryString)({page:o,per_page:s})),{method:"get"})})),c(this,"getMyChannelMember",(t=>this.doFetch("".concat(this.getChannelMemberRoute(t,"me")),{method:"get"}))),c(this,"getMyChannelMembers",(t=>this.doFetch("".concat(this.getUserRoute("me"),"/teams/").concat(t,"/channels/members"),{method:"get"}))),c(this,"getChannelMembers",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getChannelMembersRoute(e)).concat((0,d.buildQueryString)({page:o,per_page:s})),{method:"get"})})),c(this,"getChannelTimezones",(t=>this.doFetch("".concat(this.getChannelRoute(t),"/timezones"),{method:"get"}))),c(this,"getChannelMember",((t,e)=>this.doFetch("".concat(this.getChannelMemberRoute(t,e)),{method:"get"}))),c(this,"getChannelMembersByIds",((t,e)=>this.doFetch("".concat(this.getChannelMembersRoute(t),"/ids"),{method:"post",body:JSON.stringify(e)}))),c(this,"addToChannels",(function(e,o){const s={user_ids:e,channel_id:o,post_root_id:arguments.length>2&&void 0!==arguments[2]?arguments[2]:""};return t.doFetch("".concat(t.getChannelMembersRoute(o)),{method:"post",body:JSON.stringify(s)})})),c(this,"addToChannel",(function(e,o){const s={user_id:e,channel_id:o,post_root_id:arguments.length>2&&void 0!==arguments[2]?arguments[2]:""};return t.doFetch("".concat(t.getChannelMembersRoute(o)),{method:"post",body:JSON.stringify(s)})})),c(this,"removeFromChannel",((t,e)=>this.doFetch("".concat(this.getChannelMemberRoute(e,t)),{method:"delete"}))),c(this,"updateChannelMemberRoles",((t,e,o)=>this.doFetch("".concat(this.getChannelMemberRoute(t,e),"/roles"),{method:"put",body:JSON.stringify({roles:o})}))),c(this,"getChannelStats",(function(e){const o=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"":"?exclude_files_count=true";return t.doFetch("".concat(t.getChannelRoute(e),"/stats").concat(o),{method:"get"})})),c(this,"getChannelsMemberCount",(t=>this.doFetch("".concat(this.getChannelsRoute(),"/stats/member_count"),{method:"post",body:JSON.stringify(t)}))),c(this,"getChannelModerations",(t=>this.doFetch("".concat(this.getChannelRoute(t),"/moderations"),{method:"get"}))),c(this,"patchChannelModerations",((t,e)=>this.doFetch("".concat(this.getChannelRoute(t),"/moderations/patch"),{method:"put",body:JSON.stringify(e)}))),c(this,"getChannelMemberCountsByGroup",((t,e)=>this.doFetch("".concat(this.getChannelRoute(t),"/member_counts_by_group?include_timezones=").concat(e),{method:"get"}))),c(this,"viewMyChannel",(t=>{const e={channel_id:t,collapsed_threads_supported:!0};return this.doFetch("".concat(this.getChannelsRoute(),"/members/me/view"),{method:"post",body:JSON.stringify(e)})})),c(this,"readMultipleChannels",(t=>this.doFetch("".concat(this.getChannelsRoute(),"/members/me/mark_read"),{method:"post",body:JSON.stringify(t)}))),c(this,"autocompleteChannels",((t,e)=>this.doFetch("".concat(this.getTeamRoute(t),"/channels/autocomplete").concat((0,d.buildQueryString)({name:e})),{method:"get"}))),c(this,"autocompleteChannelsForSearch",((t,e)=>this.doFetch("".concat(this.getTeamRoute(t),"/channels/search_autocomplete").concat((0,d.buildQueryString)({name:e})),{method:"get"}))),c(this,"searchChannels",((t,e)=>this.doFetch("".concat(this.getTeamRoute(t),"/channels/search"),{method:"post",body:JSON.stringify({term:e})}))),c(this,"searchArchivedChannels",((t,e)=>this.doFetch("".concat(this.getTeamRoute(t),"/channels/search_archived"),{method:"post",body:JSON.stringify({term:e})}))),c(this,"searchGroupChannels",(t=>this.doFetch("".concat(this.getChannelsRoute(),"/group/search"),{method:"post",body:JSON.stringify({term:t})}))),c(this,"updateChannelMemberSchemeRoles",((t,e,o,s)=>{const i={scheme_user:o,scheme_admin:s};return this.doFetch("".concat(this.getChannelRoute(t),"/members/").concat(e,"/schemeRoles"),{method:"put",body:JSON.stringify(i)})})),c(this,"getChannelBookmarks",((t,e)=>this.doFetch("".concat(this.getChannelBookmarksRoute(t)).concat((0,d.buildQueryString)({bookmarks_since:e})),{method:"get"}))),c(this,"createChannelBookmark",((t,e,o)=>this.doFetch("".concat(this.getChannelBookmarksRoute(t)),{method:"post",body:JSON.stringify(e),headers:{"Connection-Id":o}}))),c(this,"deleteChannelBookmark",((t,e,o)=>this.doFetch("".concat(this.getChannelBookmarkRoute(t,e)),{method:"delete",headers:{"Connection-Id":o}}))),c(this,"updateChannelBookmark",((t,e,o,s)=>this.doFetch("".concat(this.getChannelBookmarkRoute(t,e)),{method:"PATCH",body:JSON.stringify(o),headers:{"Connection-Id":s}}))),c(this,"updateChannelBookmarkSortOrder",((t,e,o,s)=>this.doFetch("".concat(this.getChannelBookmarksRoute(t),"/").concat(e,"/sort_order"),{method:"post",body:JSON.stringify(o),headers:{"Connection-Id":s}}))),c(this,"getChannelCategories",((t,e)=>this.doFetch("".concat(this.getChannelCategoriesRoute(t,e)),{method:"get"}))),c(this,"createChannelCategory",((t,e,o)=>this.doFetch("".concat(this.getChannelCategoriesRoute(t,e)),{method:"post",body:JSON.stringify(o)}))),c(this,"updateChannelCategories",((t,e,o)=>this.doFetch("".concat(this.getChannelCategoriesRoute(t,e)),{method:"put",body:JSON.stringify(o)}))),c(this,"getChannelCategoryOrder",((t,e)=>this.doFetch("".concat(this.getChannelCategoriesRoute(t,e),"/order"),{method:"get"}))),c(this,"updateChannelCategoryOrder",((t,e,o)=>this.doFetch("".concat(this.getChannelCategoriesRoute(t,e),"/order"),{method:"put",body:JSON.stringify(o)}))),c(this,"getChannelCategory",((t,e,o)=>this.doFetch("".concat(this.getChannelCategoriesRoute(t,e),"/").concat(o),{method:"get"}))),c(this,"updateChannelCategory",((t,e,o)=>this.doFetch("".concat(this.getChannelCategoriesRoute(t,e),"/").concat(o.id),{method:"put",body:JSON.stringify(o)}))),c(this,"deleteChannelCategory",((t,e,o)=>this.doFetch("".concat(this.getChannelCategoriesRoute(t,e),"/").concat(o),{method:"delete"}))),c(this,"getRemoteClusters",(t=>this.doFetch("".concat(this.getRemoteClustersRoute()).concat((0,d.buildQueryString)({exclude_plugins:t.excludePlugins})),{method:"GET"}))),c(this,"getRemoteCluster",(t=>this.doFetch("".concat(this.getRemoteClusterRoute(t)),{method:"GET"}))),c(this,"createRemoteCluster",(t=>this.doFetch("".concat(this.getRemoteClustersRoute()),{method:"POST",body:JSON.stringify(t)}))),c(this,"patchRemoteCluster",((t,e)=>this.doFetch("".concat(this.getRemoteClusterRoute(t)),{method:"PATCH",body:JSON.stringify(e)}))),c(this,"deleteRemoteCluster",(t=>this.doFetch("".concat(this.getRemoteClusterRoute(t)),{method:"DELETE"}))),c(this,"acceptInviteRemoteCluster",(t=>this.doFetch("".concat(this.getRemoteClustersRoute(),"/accept_invite"),{method:"POST",body:JSON.stringify(t)}))),c(this,"generateInviteRemoteCluster",((t,e)=>this.doFetch("".concat(this.getRemoteClusterRoute(t),"/generate_invite"),{method:"POST",body:JSON.stringify(e)}))),c(this,"getSharedChannelRemotes",((t,e)=>this.doFetch("".concat(this.getRemoteClusterRoute(t),"/sharedchannelremotes").concat((0,d.buildQueryString)(e)),{method:"GET"}))),c(this,"sharedChannelRemoteInvite",((t,e)=>this.doFetch("".concat(this.getRemoteClusterRoute(t),"/channels/").concat(e,"/invite"),{method:"POST"}))),c(this,"sharedChannelRemoteUninvite",((t,e)=>this.doFetch("".concat(this.getRemoteClusterRoute(t),"/channels/").concat(e,"/uninvite"),{method:"POST"}))),c(this,"getCustomProfileAttributeFields",(async()=>this.doFetch("".concat(this.getCustomProfileAttributeFieldsRoute()),{method:"GET"}))),c(this,"createCustomProfileAttributeField",(async t=>this.doFetch("".concat(this.getCustomProfileAttributeFieldsRoute()),{method:"POST",body:JSON.stringify(t)}))),c(this,"patchCustomProfileAttributeField",(async(t,e)=>this.doFetch("".concat(this.getCustomProfileAttributeFieldRoute(t)),{method:"PATCH",body:JSON.stringify(e)}))),c(this,"deleteCustomProfileAttributeField",(async t=>this.doFetch("".concat(this.getCustomProfileAttributeFieldRoute(t)),{method:"DELETE"}))),c(this,"updateCustomProfileAttributeValues",(t=>this.doFetch("".concat(this.getCustomProfileAttributeValuesRoute()),{method:"PATCH",body:JSON.stringify(t)}))),c(this,"getUserCustomProfileAttributesValues",(async t=>await this.doFetch("".concat(this.getUserRoute(t),"/custom_profile_attributes"),{method:"GET"}))),c(this,"createPost",(async t=>{var e;const o=await this.doFetch("".concat(this.getPostsRoute()),{method:"post",body:JSON.stringify(t)}),s={channel_id:o.channel_id,post_id:o.id,[h.TrackPropertyUser]:o.user_id,root_id:o.root_id};return null!==(e=t.metadata)&&void 0!==e&&e.priority&&(s.priority=t.metadata.priority.priority,s.requested_ack=t.metadata.priority.requested_ack,s.persistent_notifications=t.metadata.priority.persistent_notifications,this.trackEvent("api","api_posts_create",s)),o})),c(this,"updatePost",(t=>this.doFetch("".concat(this.getPostRoute(t.id)),{method:"put",body:JSON.stringify(t)}))),c(this,"getPost",(t=>this.doFetch("".concat(this.getPostRoute(t)),{method:"get"}))),c(this,"patchPost",(t=>this.doFetch("".concat(this.getPostRoute(t.id),"/patch"),{method:"put",body:JSON.stringify(t)}))),c(this,"deletePost",(t=>this.doFetch("".concat(this.getPostRoute(t)),{method:"delete"}))),c(this,"getPostThread",(function(e){let o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t.getPaginatedPostThread(e,{fetchThreads:o,collapsedThreads:s,collapsedThreadsExtended:i})})),c(this,"getPaginatedPostThread",(async(t,e)=>{const{fetchThreads:o=!0,collapsedThreads:i=!1,collapsedThreadsExtended:c=!1,direction:h="down",fetchAll:a=!1,perPage:r=(a?void 0:l)}=e,u=function(t,e){if(null==t)return{};var o,s,i=function(t,e){if(null==t)return{};var o={};for(var s in t)if({}.hasOwnProperty.call(t,s)){if(e.includes(s))continue;o[s]=t[s]}return o}(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(s=0;s<n.length;s++)o=n[s],e.includes(o)||{}.propertyIsEnumerable.call(t,o)&&(i[o]=t[o])}return i}(e,s);return this.doFetch("".concat(this.getPostRoute(t),"/thread").concat((0,d.buildQueryString)(n({skipFetchThreads:!o,collapsedThreads:i,collapsedThreadsExtended:c,direction:h,perPage:r},u))),{method:"get"})})),c(this,"getPosts",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return t.doFetch("".concat(t.getChannelRoute(e),"/posts").concat((0,d.buildQueryString)({page:o,per_page:s,skipFetchThreads:!i,collapsedThreads:n,collapsedThreadsExtended:c})),{method:"get"})})),c(this,"getPostsUnread",(function(o,s){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.DEFAULT_LIMIT_AFTER,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DEFAULT_LIMIT_BEFORE,c=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],h=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return t.doFetch("".concat(t.getUserRoute(s),"/channels/").concat(o,"/posts/unread").concat((0,d.buildQueryString)({limit_after:i,limit_before:n,skipFetchThreads:!c,collapsedThreads:h,collapsedThreadsExtended:a})),{method:"get"})})),c(this,"getPostsSince",(function(e,o){let s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return t.doFetch("".concat(t.getChannelRoute(e),"/posts").concat((0,d.buildQueryString)({since:o,skipFetchThreads:!s,collapsedThreads:i,collapsedThreadsExtended:n})),{method:"get"})})),c(this,"getPostsBefore",(function(e,o){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l,n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],c=arguments.length>5&&void 0!==arguments[5]&&arguments[5],h=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return t.doFetch("".concat(t.getChannelRoute(e),"/posts").concat((0,d.buildQueryString)({before:o,page:s,per_page:i,skipFetchThreads:!n,collapsedThreads:c,collapsedThreadsExtended:h})),{method:"get"})})),c(this,"getPostsAfter",(function(e,o){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l,n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],c=arguments.length>5&&void 0!==arguments[5]&&arguments[5],h=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return t.doFetch("".concat(t.getChannelRoute(e),"/posts").concat((0,d.buildQueryString)({after:o,page:s,per_page:i,skipFetchThreads:!n,collapsedThreads:c,collapsedThreadsExtended:h})),{method:"get"})})),c(this,"getUserThreads",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"me",o=arguments.length>1?arguments[1]:void 0,{before:s="",after:i="",perPage:n=l,extended:c=!1,deleted:h=!1,unread:a=!1,since:r=0,totalsOnly:u=!1,threadsOnly:g=!1}=arguments.length>2?arguments[2]:void 0;return t.doFetch("".concat(t.getUserThreadsRoute(e,o)).concat((0,d.buildQueryString)({before:s,after:i,per_page:n,extended:c,deleted:h,unread:a,since:r,totalsOnly:u,threadsOnly:g})),{method:"get"})})),c(this,"getUserThread",(function(e,o,s){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const n="".concat(t.getUserThreadRoute(e,o,s));return t.doFetch("".concat(n).concat((0,d.buildQueryString)({extended:i})),{method:"get"})})),c(this,"updateThreadsReadForUser",((t,e)=>{const o="".concat(this.getUserThreadsRoute(t,e),"/read");return this.doFetch(o,{method:"put"})})),c(this,"updateThreadReadForUser",((t,e,o,s)=>{const i="".concat(this.getUserThreadRoute(t,e,o),"/read/").concat(s);return this.doFetch(i,{method:"put"})})),c(this,"markThreadAsUnreadForUser",((t,e,o,s)=>{const i="".concat(this.getUserThreadRoute(t,e,o),"/set_unread/").concat(s);return this.doFetch(i,{method:"post"})})),c(this,"updateThreadFollowForUser",((t,e,o,s)=>{const i=this.getUserThreadRoute(t,e,o)+"/following";return this.doFetch(i,{method:s?"put":"delete"})})),c(this,"getFileInfosForPost",(t=>this.doFetch("".concat(this.getPostRoute(t),"/files/info"),{method:"get"}))),c(this,"getFlaggedPosts",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:l;return t.doFetch("".concat(t.getUserRoute(e),"/posts/flagged").concat((0,d.buildQueryString)({channel_id:o,team_id:s,page:i,per_page:n})),{method:"get"})})),c(this,"getPinnedPosts",(t=>this.doFetch("".concat(this.getChannelRoute(t),"/pinned"),{method:"get"}))),c(this,"markPostAsUnread",((t,e)=>this.doFetch("".concat(this.getUserRoute(t),"/posts/").concat(e,"/set_unread"),{method:"post",body:JSON.stringify({collapsed_threads_supported:!0})}))),c(this,"addPostReminder",((t,e,o)=>this.doFetch("".concat(this.getUserRoute(t),"/posts/").concat(e,"/reminder"),{method:"post",body:JSON.stringify({target_time:o})}))),c(this,"pinPost",(t=>this.doFetch("".concat(this.getPostRoute(t),"/pin"),{method:"post"}))),c(this,"unpinPost",(t=>this.doFetch("".concat(this.getPostRoute(t),"/unpin"),{method:"post"}))),c(this,"getPostInfo",(t=>this.doFetch("".concat(this.getPostRoute(t),"/info"),{method:"get"}))),c(this,"getPostsByIds",(t=>this.doFetch("".concat(this.getPostsRoute(),"/ids"),{method:"post",body:JSON.stringify(t)}))),c(this,"getPostEditHistory",(t=>this.doFetch("".concat(this.getPostRoute(t),"/edit_history"),{method:"get"}))),c(this,"addReaction",((t,e,o)=>this.doFetch("".concat(this.getReactionsRoute()),{method:"post",body:JSON.stringify({user_id:t,post_id:e,emoji_name:o})}))),c(this,"removeReaction",((t,e,o)=>this.doFetch("".concat(this.getUserRoute(t),"/posts/").concat(e,"/reactions/").concat(o),{method:"delete"}))),c(this,"getReactionsForPost",(t=>this.doFetch("".concat(this.getPostRoute(t),"/reactions"),{method:"get"}))),c(this,"searchPostsWithParams",((t,e)=>{let o="".concat(this.getPostsRoute(),"/search");return t&&(o="".concat(this.getTeamRoute(t),"/posts/search")),this.doFetch(o,{method:"post",body:JSON.stringify(e)})})),c(this,"searchPosts",((t,e,o)=>this.searchPostsWithParams(t,{terms:e,is_or_search:o}))),c(this,"searchFilesWithParams",((t,e)=>{let o="".concat(this.getFilesRoute(),"/search");return t&&(o="".concat(this.getTeamRoute(t),"/files/search")),this.doFetch(o,{method:"post",body:JSON.stringify(e)})})),c(this,"searchFiles",((t,e,o)=>this.searchFilesWithParams(t,{terms:e,is_or_search:o}))),c(this,"doPostAction",(function(e,o){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t.doPostActionWithCookie(e,o,"",s)})),c(this,"doPostActionWithCookie",(function(e,o,s){const i={selected_option:arguments.length>3&&void 0!==arguments[3]?arguments[3]:""};return""!==s&&(i.cookie=s),t.doFetch("".concat(t.getPostRoute(e),"/actions/").concat(encodeURIComponent(o)),{method:"post",body:JSON.stringify(i)})})),c(this,"uploadFile",((t,e)=>{const o={method:"post",body:t};return this.doFetch("".concat(this.getFilesRoute()).concat((0,d.buildQueryString)({bookmark:e})),o)})),c(this,"getFilePublicLink",(t=>this.doFetch("".concat(this.getFileRoute(t),"/link"),{method:"get"}))),c(this,"acknowledgePost",((t,e)=>(this.trackEvent("api","api_posts_ack"),this.doFetch("".concat(this.getUserRoute(e),"/posts/").concat(t,"/ack"),{method:"post"})))),c(this,"unacknowledgePost",((t,e)=>this.doFetch("".concat(this.getUserRoute(e),"/posts/").concat(t,"/ack"),{method:"delete"}))),c(this,"savePreferences",((t,e)=>this.doFetch("".concat(this.getPreferencesRoute(t)),{method:"put",body:JSON.stringify(e)}))),c(this,"getMyPreferences",(()=>this.doFetch("".concat(this.getPreferencesRoute("me")),{method:"get"}))),c(this,"getUserPreferences",(t=>this.doFetch("".concat(this.getPreferencesRoute(t)),{method:"get"}))),c(this,"deletePreferences",((t,e)=>this.doFetch("".concat(this.getPreferencesRoute(t),"/delete"),{method:"post",body:JSON.stringify(e)}))),c(this,"ping",((t,e)=>this.doFetch("".concat(this.getBaseRoute(),"/system/ping").concat((0,d.buildQueryString)({get_server_status:t,device_id:e,use_rest_semantics:!0})),{method:"get"}))),c(this,"upgradeToEnterprise",(async()=>this.doFetch("".concat(this.getBaseRoute(),"/upgrade_to_enterprise"),{method:"post"}))),c(this,"upgradeToEnterpriseStatus",(async()=>this.doFetch("".concat(this.getBaseRoute(),"/upgrade_to_enterprise/status"),{method:"get"}))),c(this,"restartServer",(async()=>this.doFetch("".concat(this.getBaseRoute(),"/restart"),{method:"post"}))),c(this,"logClientError",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.LogLevel.Error;const s="".concat(t.getBaseRoute(),"/logs");if(!t.enableLogging)throw new p(t.getUrl(),{message:"Logging disabled.",url:s});return t.doFetch(s,{method:"post",body:JSON.stringify({message:e,level:o})})})),c(this,"getClientConfigOld",(()=>this.doFetch("".concat(this.getBaseRoute(),"/config/client?format=old"),{method:"get"}))),c(this,"getClientLicenseOld",(()=>this.doFetch("".concat(this.getBaseRoute(),"/license/client?format=old"),{method:"get"}))),c(this,"setFirstAdminVisitMarketplaceStatus",(async()=>this.doFetch("".concat(this.getPluginsRoute(),"/marketplace/first_admin_visit"),{method:"post",body:JSON.stringify({first_admin_visit_marketplace_status:!0})}))),c(this,"getFirstAdminVisitMarketplaceStatus",(async()=>this.doFetch("".concat(this.getPluginsRoute(),"/marketplace/first_admin_visit"),{method:"get"}))),c(this,"getFirstAdminSetupComplete",(async()=>this.doFetch("".concat(this.getSystemRoute(),"/onboarding/complete"),{method:"get"}))),c(this,"getTranslations",(t=>this.doFetch(t,{method:"get"}))),c(this,"getWebSocketUrl",(()=>"".concat(this.getBaseRoute(),"/websocket"))),c(this,"createIncomingWebhook",(t=>this.doFetch("".concat(this.getIncomingHooksRoute()),{method:"post",body:JSON.stringify(t)}))),c(this,"getIncomingWebhook",(t=>this.doFetch("".concat(this.getIncomingHookRoute(t)),{method:"get"}))),c(this,"getIncomingWebhooks",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const o={page:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,per_page:arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,include_total_count:arguments.length>3&&void 0!==arguments[3]&&arguments[3]};return e&&(o.team_id=e),t.doFetch("".concat(t.getIncomingHooksRoute()).concat((0,d.buildQueryString)(o)),{method:"get"})})),c(this,"removeIncomingWebhook",(t=>this.doFetch("".concat(this.getIncomingHookRoute(t)),{method:"delete"}))),c(this,"updateIncomingWebhook",(t=>this.doFetch("".concat(this.getIncomingHookRoute(t.id)),{method:"put",body:JSON.stringify(t)}))),c(this,"createOutgoingWebhook",(t=>this.doFetch("".concat(this.getOutgoingHooksRoute()),{method:"post",body:JSON.stringify(t)}))),c(this,"getOutgoingWebhook",(t=>this.doFetch("".concat(this.getOutgoingHookRoute(t)),{method:"get"}))),c(this,"getOutgoingWebhooks",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const s={page:arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,per_page:arguments.length>3&&void 0!==arguments[3]?arguments[3]:l};return e&&(s.channel_id=e),o&&(s.team_id=o),t.doFetch("".concat(t.getOutgoingHooksRoute()).concat((0,d.buildQueryString)(s)),{method:"get"})})),c(this,"removeOutgoingWebhook",(t=>this.doFetch("".concat(this.getOutgoingHookRoute(t)),{method:"delete"}))),c(this,"updateOutgoingWebhook",(t=>this.doFetch("".concat(this.getOutgoingHookRoute(t.id)),{method:"put",body:JSON.stringify(t)}))),c(this,"regenOutgoingHookToken",(t=>this.doFetch("".concat(this.getOutgoingHookRoute(t),"/regen_token"),{method:"post"}))),c(this,"getCommandsList",(t=>this.doFetch("".concat(this.getCommandsRoute(),"?team_id=").concat(t),{method:"get"}))),c(this,"getCommandAutocompleteSuggestionsList",((t,e,o)=>this.doFetch("".concat(this.getTeamRoute(e),"/commands/autocomplete_suggestions").concat((0,d.buildQueryString)(n(n({},o),{},{user_input:t}))),{method:"get"}))),c(this,"getAutocompleteCommandsList",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getTeamRoute(e),"/commands/autocomplete").concat((0,d.buildQueryString)({page:o,per_page:s})),{method:"get"})})),c(this,"getCustomTeamCommands",(t=>this.doFetch("".concat(this.getCommandsRoute(),"?team_id=").concat(t,"&custom_only=true"),{method:"get"}))),c(this,"executeCommand",((t,e)=>this.doFetch("".concat(this.getCommandsRoute(),"/execute"),{method:"post",body:JSON.stringify(n({command:t},e))}))),c(this,"addCommand",(t=>this.doFetch("".concat(this.getCommandsRoute()),{method:"post",body:JSON.stringify(t)}))),c(this,"editCommand",(t=>this.doFetch("".concat(this.getCommandsRoute(),"/").concat(t.id),{method:"put",body:JSON.stringify(t)}))),c(this,"regenCommandToken",(t=>this.doFetch("".concat(this.getCommandsRoute(),"/").concat(t,"/regen_token"),{method:"put"}))),c(this,"deleteCommand",(t=>this.doFetch("".concat(this.getCommandsRoute(),"/").concat(t),{method:"delete"}))),c(this,"createOAuthApp",(t=>this.doFetch("".concat(this.getOAuthAppsRoute()),{method:"post",body:JSON.stringify(t)}))),c(this,"editOAuthApp",(t=>this.doFetch("".concat(this.getOAuthAppsRoute(),"/").concat(t.id),{method:"put",body:JSON.stringify(t)}))),c(this,"getOAuthApps",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return t.doFetch("".concat(t.getOAuthAppsRoute()).concat((0,d.buildQueryString)({page:e,per_page:o})),{method:"get"})})),c(this,"getAppsOAuthAppIDs",(()=>this.doFetch("".concat(this.getAppsProxyRoute(),"/api/v1/oauth-app-ids"),{method:"get"}))),c(this,"getAppsBotIDs",(()=>this.doFetch("".concat(this.getAppsProxyRoute(),"/api/v1/bot-ids"),{method:"get"}))),c(this,"getOAuthApp",(t=>this.doFetch("".concat(this.getOAuthAppRoute(t)),{method:"get"}))),c(this,"getOutgoingOAuthConnections",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getOutgoingOAuthConnectionsRoute()).concat((0,d.buildQueryString)({team_id:e,page:o,per_page:s})),{method:"get"})})),c(this,"getOutgoingOAuthConnectionsForAudience",(function(e,o){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l;return t.doFetch("".concat(t.getOutgoingOAuthConnectionsRoute()).concat((0,d.buildQueryString)({team_id:e,page:s,per_page:i,audience:o})),{method:"get"})})),c(this,"getOutgoingOAuthConnection",((t,e)=>this.doFetch("".concat(this.getOutgoingOAuthConnectionRoute(e)).concat((0,d.buildQueryString)({team_id:t})),{method:"get"}))),c(this,"createOutgoingOAuthConnection",((t,e)=>this.doFetch("".concat(this.getOutgoingOAuthConnectionsRoute()).concat((0,d.buildQueryString)({team_id:t})),{method:"post",body:JSON.stringify(e)}))),c(this,"editOutgoingOAuthConnection",((t,e)=>this.doFetch("".concat(this.getOutgoingOAuthConnectionsRoute(),"/").concat(e.id).concat((0,d.buildQueryString)({team_id:t})),{method:"put",body:JSON.stringify(e)}))),c(this,"validateOutgoingOAuthConnection",((t,e)=>this.doFetch("".concat(this.getOutgoingOAuthConnectionsRoute(),"/validate").concat((0,d.buildQueryString)({team_id:t})),{method:"post",body:JSON.stringify(e)}))),c(this,"getOAuthAppInfo",(t=>this.doFetch("".concat(this.getOAuthAppRoute(t),"/info"),{method:"get"}))),c(this,"deleteOAuthApp",(t=>this.doFetch("".concat(this.getOAuthAppRoute(t)),{method:"delete"}))),c(this,"regenOAuthAppSecret",(t=>this.doFetch("".concat(this.getOAuthAppRoute(t),"/regen_secret"),{method:"post"}))),c(this,"deleteOutgoingOAuthConnection",(t=>this.doFetch("".concat(this.getOutgoingOAuthConnectionRoute(t)),{method:"delete"}))),c(this,"submitInteractiveDialog",(t=>this.doFetch("".concat(this.getBaseRoute(),"/actions/dialogs/submit"),{method:"post",body:JSON.stringify(t)}))),c(this,"createCustomEmoji",((t,e)=>{const o=new FormData;o.append("image",e),o.append("emoji",JSON.stringify(t));const s={method:"post",body:o};return this.doFetch("".concat(this.getEmojisRoute()),s)})),c(this,"getCustomEmoji",(t=>this.doFetch("".concat(this.getEmojisRoute(),"/").concat(t),{method:"get"}))),c(this,"getCustomEmojiByName",(t=>this.doFetch("".concat(this.getEmojisRoute(),"/name/").concat(t),{method:"get"}))),c(this,"getCustomEmojisByNames",(t=>this.doFetch("".concat(this.getEmojisRoute(),"/names"),{method:"post",body:JSON.stringify(t)}))),c(this,"getCustomEmojis",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t.doFetch("".concat(t.getEmojisRoute()).concat((0,d.buildQueryString)({page:e,per_page:o,sort:s})),{method:"get"})})),c(this,"deleteCustomEmoji",(t=>this.doFetch("".concat(this.getEmojiRoute(t)),{method:"delete"}))),c(this,"getSystemEmojiImageUrl",(t=>{const e=t.endsWith(".png")?"":".png";return"".concat(this.url,"/static/emoji/").concat(t).concat(e)})),c(this,"getCustomEmojiImageUrl",(t=>"".concat(this.getEmojiRoute(t),"/image"))),c(this,"searchCustomEmoji",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.doFetch("".concat(t.getEmojisRoute(),"/search"),{method:"post",body:JSON.stringify(n({term:e},o))})})),c(this,"autocompleteCustomEmoji",(t=>this.doFetch("".concat(this.getEmojisRoute(),"/autocomplete").concat((0,d.buildQueryString)({name:t})),{method:"get"}))),c(this,"getDataRetentionPolicy",(()=>this.doFetch("".concat(this.getDataRetentionRoute(),"/policy"),{method:"get"}))),c(this,"getDataRetentionCustomPolicies",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return t.doFetch("".concat(t.getDataRetentionRoute(),"/policies").concat((0,d.buildQueryString)({page:e,per_page:o})),{method:"get"})})),c(this,"getDataRetentionCustomPolicy",(t=>this.doFetch("".concat(this.getDataRetentionRoute(),"/policies/").concat(t),{method:"get"}))),c(this,"deleteDataRetentionCustomPolicy",(t=>this.doFetch("".concat(this.getDataRetentionRoute(),"/policies/").concat(t),{method:"delete"}))),c(this,"searchDataRetentionCustomPolicyChannels",((t,e,o)=>this.doFetch("".concat(this.getDataRetentionRoute(),"/policies/").concat(t,"/channels/search"),{method:"post",body:JSON.stringify(n({term:e},o))}))),c(this,"searchDataRetentionCustomPolicyTeams",((t,e,o)=>this.doFetch("".concat(this.getDataRetentionRoute(),"/policies/").concat(t,"/teams/search"),{method:"post",body:JSON.stringify(n({term:e},o))}))),c(this,"getDataRetentionCustomPolicyTeams",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getDataRetentionRoute(),"/policies/").concat(e,"/teams").concat((0,d.buildQueryString)({page:o,per_page:s})),{method:"get"})})),c(this,"getDataRetentionCustomPolicyChannels",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getDataRetentionRoute(),"/policies/").concat(e,"/channels").concat((0,d.buildQueryString)({page:o,per_page:s})),{method:"get"})})),c(this,"createDataRetentionPolicy",(t=>this.doFetch("".concat(this.getDataRetentionRoute(),"/policies"),{method:"post",body:JSON.stringify(t)}))),c(this,"updateDataRetentionPolicy",((t,e)=>this.doFetch("".concat(this.getDataRetentionRoute(),"/policies/").concat(t),{method:"PATCH",body:JSON.stringify(e)}))),c(this,"addDataRetentionPolicyTeams",((t,e)=>this.doFetch("".concat(this.getDataRetentionRoute(),"/policies/").concat(t,"/teams"),{method:"post",body:JSON.stringify(e)}))),c(this,"removeDataRetentionPolicyTeams",((t,e)=>this.doFetch("".concat(this.getDataRetentionRoute(),"/policies/").concat(t,"/teams"),{method:"delete",body:JSON.stringify(e)}))),c(this,"addDataRetentionPolicyChannels",((t,e)=>this.doFetch("".concat(this.getDataRetentionRoute(),"/policies/").concat(t,"/channels"),{method:"post",body:JSON.stringify(e)}))),c(this,"removeDataRetentionPolicyChannels",((t,e)=>this.doFetch("".concat(this.getDataRetentionRoute(),"/policies/").concat(t,"/channels"),{method:"delete",body:JSON.stringify(e)}))),c(this,"getJob",(t=>this.doFetch("".concat(this.getJobsRoute(),"/").concat(t),{method:"get"}))),c(this,"getJobs",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return t.doFetch("".concat(t.getJobsRoute()).concat((0,d.buildQueryString)({page:e,per_page:o})),{method:"get"})})),c(this,"getJobsByType",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getJobsRoute(),"/type/").concat(e).concat((0,d.buildQueryString)({page:o,per_page:s})),{method:"get"})})),c(this,"createJob",(t=>this.doFetch("".concat(this.getJobsRoute()),{method:"post",body:JSON.stringify(t)}))),c(this,"cancelJob",(t=>this.doFetch("".concat(this.getJobsRoute(),"/").concat(t,"/cancel"),{method:"post"}))),c(this,"getLogs",(t=>this.doFetch("".concat(this.getBaseRoute(),"/logs/query"),{method:"post",body:JSON.stringify(t)}))),c(this,"getPlainLogs",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e4;return t.doFetch("".concat(t.getBaseRoute(),"/logs").concat((0,d.buildQueryString)({page:e,logs_per_page:o})),{method:"get"})})),c(this,"getAudits",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return t.doFetch("".concat(t.getBaseRoute(),"/audits").concat((0,d.buildQueryString)({page:e,per_page:o})),{method:"get"})})),c(this,"getConfig",(()=>this.doFetch("".concat(this.getBaseRoute(),"/config"),{method:"get"}))),c(this,"updateConfig",(t=>this.doFetch("".concat(this.getBaseRoute(),"/config"),{method:"put",body:JSON.stringify(t)}))),c(this,"patchConfig",(t=>this.doFetch("".concat(this.getBaseRoute(),"/config/patch"),{method:"put",body:JSON.stringify(t)}))),c(this,"reloadConfig",(()=>this.doFetch("".concat(this.getBaseRoute(),"/config/reload"),{method:"post"}))),c(this,"getEnvironmentConfig",(()=>this.doFetch("".concat(this.getBaseRoute(),"/config/environment"),{method:"get"}))),c(this,"sendTestNotificaiton",(()=>this.doFetch("".concat(this.getBaseRoute(),"/notifications/test"),{method:"post"}))),c(this,"testEmail",(t=>this.doFetch("".concat(this.getBaseRoute(),"/email/test"),{method:"post",body:JSON.stringify(t)}))),c(this,"testSiteURL",(t=>this.doFetch("".concat(this.getBaseRoute(),"/site_url/test"),{method:"post",body:JSON.stringify({site_url:t})}))),c(this,"testS3Connection",(t=>this.doFetch("".concat(this.getBaseRoute(),"/file/s3_test"),{method:"post",body:JSON.stringify(t)}))),c(this,"invalidateCaches",(()=>this.doFetch("".concat(this.getBaseRoute(),"/caches/invalidate"),{method:"post"}))),c(this,"recycleDatabase",(()=>this.doFetch("".concat(this.getBaseRoute(),"/database/recycle"),{method:"post"}))),c(this,"createComplianceReport",(t=>this.doFetch("".concat(this.getBaseRoute(),"/compliance/reports"),{method:"post",body:JSON.stringify(t)}))),c(this,"getComplianceReport",(t=>this.doFetch("".concat(this.getBaseRoute(),"/compliance/reports/").concat(t),{method:"get"}))),c(this,"getComplianceReports",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return t.doFetch("".concat(t.getBaseRoute(),"/compliance/reports").concat((0,d.buildQueryString)({page:e,per_page:o})),{method:"get"})})),c(this,"uploadBrandImage",(t=>{const e=new FormData;e.append("image",t);const o={method:"post",body:e};return this.doFetch("".concat(this.getBrandRoute(),"/image"),o)})),c(this,"deleteBrandImage",(()=>this.doFetch("".concat(this.getBrandRoute(),"/image"),{method:"delete"}))),c(this,"getClusterStatus",(()=>this.doFetch("".concat(this.getBaseRoute(),"/cluster/status"),{method:"get"}))),c(this,"testLdap",(()=>this.doFetch("".concat(this.getBaseRoute(),"/ldap/test"),{method:"post"}))),c(this,"syncLdap",(()=>this.doFetch("".concat(this.getBaseRoute(),"/ldap/sync"),{method:"post"}))),c(this,"getLdapGroups",(function(){const e=n({page:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,per_page:arguments.length>1&&void 0!==arguments[1]?arguments[1]:l},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});return t.doFetch("".concat(t.getBaseRoute(),"/ldap/groups").concat((0,d.buildQueryString)(e)),{method:"get"})})),c(this,"linkLdapGroup",(t=>this.doFetch("".concat(this.getBaseRoute(),"/ldap/groups/").concat(encodeURI(t),"/link"),{method:"post"}))),c(this,"unlinkLdapGroup",(t=>this.doFetch("".concat(this.getBaseRoute(),"/ldap/groups/").concat(encodeURI(t),"/link"),{method:"delete"}))),c(this,"getSamlCertificateStatus",(()=>this.doFetch("".concat(this.getBaseRoute(),"/saml/certificate/status"),{method:"get"}))),c(this,"uploadPublicSamlCertificate",(t=>{const e=new FormData;return e.append("certificate",t),this.doFetch("".concat(this.getBaseRoute(),"/saml/certificate/public"),{method:"post",body:e})})),c(this,"uploadPrivateSamlCertificate",(t=>{const e=new FormData;return e.append("certificate",t),this.doFetch("".concat(this.getBaseRoute(),"/saml/certificate/private"),{method:"post",body:e})})),c(this,"uploadPublicLdapCertificate",(t=>{const e=new FormData;return e.append("certificate",t),this.doFetch("".concat(this.getBaseRoute(),"/ldap/certificate/public"),{method:"post",body:e})})),c(this,"uploadPrivateLdapCertificate",(t=>{const e=new FormData;return e.append("certificate",t),this.doFetch("".concat(this.getBaseRoute(),"/ldap/certificate/private"),{method:"post",body:e})})),c(this,"uploadIdpSamlCertificate",(t=>{const e=new FormData;return e.append("certificate",t),this.doFetch("".concat(this.getBaseRoute(),"/saml/certificate/idp"),{method:"post",body:e})})),c(this,"deletePublicSamlCertificate",(()=>this.doFetch("".concat(this.getBaseRoute(),"/saml/certificate/public"),{method:"delete"}))),c(this,"deletePrivateSamlCertificate",(()=>this.doFetch("".concat(this.getBaseRoute(),"/saml/certificate/private"),{method:"delete"}))),c(this,"deletePublicLdapCertificate",(()=>this.doFetch("".concat(this.getBaseRoute(),"/ldap/certificate/public"),{method:"delete"}))),c(this,"deletePrivateLdapCertificate",(()=>this.doFetch("".concat(this.getBaseRoute(),"/ldap/certificate/private"),{method:"delete"}))),c(this,"deleteIdpSamlCertificate",(()=>this.doFetch("".concat(this.getBaseRoute(),"/saml/certificate/idp"),{method:"delete"}))),c(this,"testElasticsearch",(t=>this.doFetch("".concat(this.getBaseRoute(),"/elasticsearch/test"),{method:"post",body:JSON.stringify(t)}))),c(this,"purgeElasticsearchIndexes",(t=>this.doFetch("".concat(this.getBaseRoute(),"/elasticsearch/purge_indexes").concat(t&&t.length>0?"?index="+t.join(","):""),{method:"post"}))),c(this,"purgeBleveIndexes",(()=>this.doFetch("".concat(this.getBaseRoute(),"/bleve/purge_indexes"),{method:"post"}))),c(this,"uploadLicense",(t=>{const e=new FormData;e.append("license",t);const o={method:"post",body:e};return this.doFetch("".concat(this.getBaseRoute(),"/license"),o)})),c(this,"requestTrialLicense",(t=>this.doFetchWithResponse("".concat(this.getBaseRoute(),"/trial-license"),{method:"POST",body:JSON.stringify(t)}))),c(this,"removeLicense",(()=>this.doFetch("".concat(this.getBaseRoute(),"/license"),{method:"delete"}))),c(this,"getPrevTrialLicense",(()=>this.doFetch("".concat(this.getBaseRoute(),"/trial-license/prev"),{method:"get"}))),c(this,"getAnalytics",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"standard",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t.doFetch("".concat(t.getBaseRoute(),"/analytics/old").concat((0,d.buildQueryString)({name:e,team_id:o})),{method:"get"})})),c(this,"getRole",(t=>this.doFetch("".concat(this.getRolesRoute(),"/").concat(t),{method:"get"}))),c(this,"getRoleByName",(t=>this.doFetch("".concat(this.getRolesRoute(),"/name/").concat(t),{method:"get"}))),c(this,"getRolesByNames",(t=>this.doFetch("".concat(this.getRolesRoute(),"/names"),{method:"post",body:JSON.stringify(t)}))),c(this,"patchRole",((t,e)=>this.doFetch("".concat(this.getRolesRoute(),"/").concat(t,"/patch"),{method:"put",body:JSON.stringify(e)}))),c(this,"getSchemes",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getSchemesRoute()).concat((0,d.buildQueryString)({scope:e,page:o,per_page:s})),{method:"get"})})),c(this,"createScheme",(t=>this.doFetch("".concat(this.getSchemesRoute()),{method:"post",body:JSON.stringify(t)}))),c(this,"getScheme",(t=>this.doFetch("".concat(this.getSchemesRoute(),"/").concat(t),{method:"get"}))),c(this,"deleteScheme",(t=>this.doFetch("".concat(this.getSchemesRoute(),"/").concat(t),{method:"delete"}))),c(this,"patchScheme",((t,e)=>this.doFetch("".concat(this.getSchemesRoute(),"/").concat(t,"/patch"),{method:"put",body:JSON.stringify(e)}))),c(this,"getSchemeTeams",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getSchemesRoute(),"/").concat(e,"/teams").concat((0,d.buildQueryString)({page:o,per_page:s})),{method:"get"})})),c(this,"getSchemeChannels",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l;return t.doFetch("".concat(t.getSchemesRoute(),"/").concat(e,"/channels").concat((0,d.buildQueryString)({page:o,per_page:s})),{method:"get"})})),c(this,"uploadPlugin",(async function(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=new FormData;o&&s.append("force","true"),s.append("plugin",e);const i={method:"post",body:s};return t.doFetch(t.getPluginsRoute(),i)})),c(this,"installPluginFromUrl",(function(e){const o={plugin_download_url:e,force:arguments.length>1&&void 0!==arguments[1]&&arguments[1]};return t.doFetch("".concat(t.getPluginsRoute(),"/install_from_url").concat((0,d.buildQueryString)(o)),{method:"post"})})),c(this,"getPlugins",(()=>this.doFetch(this.getPluginsRoute(),{method:"get"}))),c(this,"getRemoteMarketplacePlugins",(t=>this.doFetch("".concat(this.getPluginsMarketplaceRoute()).concat((0,d.buildQueryString)({filter:t||"",remote_only:!0})),{method:"get"}))),c(this,"getMarketplacePlugins",(function(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.doFetch("".concat(t.getPluginsMarketplaceRoute()).concat((0,d.buildQueryString)({filter:e||"",local_only:o})),{method:"get"})})),c(this,"installMarketplacePlugin",(t=>this.doFetch("".concat(this.getPluginsMarketplaceRoute()),{method:"post",body:JSON.stringify({id:t})}))),c(this,"getMarketplaceApps",(t=>this.doFetch("".concat(this.getAppsProxyRoute(),"/api/v1/marketplace").concat((0,d.buildQueryString)({filter:t||""})),{method:"get"}))),c(this,"getPluginStatuses",(()=>this.doFetch("".concat(this.getPluginsRoute(),"/statuses"),{method:"get"}))),c(this,"removePlugin",(t=>this.doFetch(this.getPluginRoute(t),{method:"delete"}))),c(this,"getWebappPlugins",(()=>this.doFetch("".concat(this.getPluginsRoute(),"/webapp"),{method:"get"}))),c(this,"enablePlugin",(t=>this.doFetch("".concat(this.getPluginRoute(t),"/enable"),{method:"post"}))),c(this,"disablePlugin",(t=>this.doFetch("".concat(this.getPluginRoute(t),"/disable"),{method:"post"}))),c(this,"linkGroupSyncable",((t,e,o,s)=>this.doFetch("".concat(this.getGroupRoute(t),"/").concat(o,"s/").concat(e,"/link"),{method:"post",body:JSON.stringify(s)}))),c(this,"unlinkGroupSyncable",((t,e,o)=>this.doFetch("".concat(this.getGroupRoute(t),"/").concat(o,"s/").concat(e,"/link"),{method:"delete"}))),c(this,"getGroupSyncables",((t,e)=>this.doFetch("".concat(this.getGroupRoute(t),"/").concat(e,"s"),{method:"get"}))),c(this,"getGroup",(function(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.doFetch("".concat(t.getGroupRoute(e)).concat((0,d.buildQueryString)({include_member_count:o})),{method:"get"})})),c(this,"getGroupStats",(t=>this.doFetch("".concat(this.getGroupRoute(t),"/stats"),{method:"get"}))),c(this,"getGroups",(t=>this.doFetch("".concat(this.getGroupsRoute()).concat((0,d.buildQueryString)(t)),{method:"get"}))),c(this,"getGroupsByUserId",(t=>this.doFetch("".concat(this.getUsersRoute(),"/").concat(t,"/groups"),{method:"get"}))),c(this,"getGroupsNotAssociatedToTeam",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"ldap";return t.doFetch("".concat(t.getGroupsRoute()).concat((0,d.buildQueryString)({not_associated_to_team:e,page:s,per_page:i,q:o,include_member_count:!0,group_source:n})),{method:"get"})})),c(this,"getGroupsNotAssociatedToChannel",(function(e){const o={not_associated_to_channel:e,page:arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,per_page:arguments.length>3&&void 0!==arguments[3]?arguments[3]:l,q:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",include_member_count:!0,filter_parent_team_permitted:arguments.length>4&&void 0!==arguments[4]&&arguments[4],group_source:arguments.length>5&&void 0!==arguments[5]?arguments[5]:"ldap"};return t.doFetch("".concat(t.getGroupsRoute()).concat((0,d.buildQueryString)(o)),{method:"get"})})),c(this,"createGroupWithUserIds",(t=>this.doFetch(this.getGroupsRoute(),{method:"post",body:JSON.stringify(t)}))),c(this,"addUsersToGroup",((t,e)=>this.doFetch("".concat(this.getGroupRoute(t),"/members"),{method:"post",body:JSON.stringify({user_ids:e})}))),c(this,"removeUsersFromGroup",((t,e)=>this.doFetch("".concat(this.getGroupRoute(t),"/members"),{method:"delete",body:JSON.stringify({user_ids:e})}))),c(this,"searchGroups",(t=>this.doFetch("".concat(this.getGroupsRoute()).concat((0,d.buildQueryString)(t)),{method:"get"}))),c(this,"executeAppCall",(async(t,e)=>{const o=n(n({},t),{},{context:n(n({},t.context),{},{track_as_submit:e,[h.TrackPropertyUserAgent]:"webapp"})});return this.doFetch("".concat(this.getAppsProxyRoute(),"/api/v1/call"),{method:"post",body:JSON.stringify(o)})})),c(this,"getAppsBindings",(async(t,e)=>{const o={channel_id:t,team_id:e,[h.TrackPropertyUserAgent]:"webapp"};return this.doFetch("".concat(this.getAppsProxyRoute(),"/api/v1/bindings").concat((0,d.buildQueryString)(o)),{method:"get"})})),c(this,"getGroupsAssociatedToTeam",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return t.doFetch("".concat(t.getBaseRoute(),"/teams/").concat(e,"/groups").concat((0,d.buildQueryString)({page:s,per_page:i,q:o,include_member_count:!0,filter_allow_reference:n})),{method:"get"})})),c(this,"getGroupsAssociatedToChannel",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return t.trackEvent("api","api_groups_get_associated_to_channel",{channel_id:e}),t.doFetch("".concat(t.getBaseRoute(),"/channels/").concat(e,"/groups").concat((0,d.buildQueryString)({page:s,per_page:i,q:o,include_member_count:!0,filter_allow_reference:n})),{method:"get"})})),c(this,"getAllGroupsAssociatedToTeam",(function(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t.doFetch("".concat(t.getBaseRoute(),"/teams/").concat(e,"/groups").concat((0,d.buildQueryString)({paginate:!1,filter_allow_reference:o,include_member_count:s})),{method:"get"})})),c(this,"getAllGroupsAssociatedToChannelsInTeam",(function(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.doFetch("".concat(t.getBaseRoute(),"/teams/").concat(e,"/groups_by_channels").concat((0,d.buildQueryString)({paginate:!1,filter_allow_reference:o})),{method:"get"})})),c(this,"getAllGroupsAssociatedToChannel",(function(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t.doFetch("".concat(t.getBaseRoute(),"/channels/").concat(e,"/groups").concat((0,d.buildQueryString)({paginate:!1,filter_allow_reference:o,include_member_count:s})),{method:"get"})})),c(this,"patchGroupSyncable",((t,e,o,s)=>this.doFetch("".concat(this.getGroupRoute(t),"/").concat(o,"s/").concat(e,"/patch"),{method:"put",body:JSON.stringify(s)}))),c(this,"patchGroup",((t,e)=>this.doFetch("".concat(this.getGroupRoute(t),"/patch"),{method:"put",body:JSON.stringify(e)}))),c(this,"archiveGroup",(t=>this.doFetch("".concat(this.getGroupRoute(t)),{method:"delete"}))),c(this,"restoreGroup",(t=>this.doFetch("".concat(this.getGroupRoute(t),"/restore"),{method:"post"}))),c(this,"createGroupTeamsAndChannels",(t=>this.doFetch("".concat(this.getBaseRoute(),"/ldap/users/").concat(t,"/group_sync_memberships"),{method:"post"}))),c(this,"createBot",(t=>this.doFetch("".concat(this.getBotsRoute()),{method:"post",body:JSON.stringify(t)}))),c(this,"patchBot",((t,e)=>this.doFetch("".concat(this.getBotRoute(t)),{method:"put",body:JSON.stringify(e)}))),c(this,"getBot",(t=>this.doFetch("".concat(this.getBotRoute(t)),{method:"get"}))),c(this,"getBots",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return t.doFetch("".concat(t.getBotsRoute()).concat((0,d.buildQueryString)({page:e,per_page:o})),{method:"get"})})),c(this,"getBotsIncludeDeleted",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return t.doFetch("".concat(t.getBotsRoute()).concat((0,d.buildQueryString)({include_deleted:!0,page:e,per_page:o})),{method:"get"})})),c(this,"getBotsOrphaned",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return t.doFetch("".concat(t.getBotsRoute()).concat((0,d.buildQueryString)({only_orphaned:!0,page:e,per_page:o})),{method:"get"})})),c(this,"disableBot",(t=>this.doFetch("".concat(this.getBotRoute(t),"/disable"),{method:"post"}))),c(this,"enableBot",(t=>this.doFetch("".concat(this.getBotRoute(t),"/enable"),{method:"post"}))),c(this,"assignBot",((t,e)=>this.doFetch("".concat(this.getBotRoute(t),"/assign/").concat(e),{method:"post"}))),c(this,"getCloudProducts",(t=>{let e="";return t&&(e="?include_legacy=true"),this.doFetch("".concat(this.getCloudRoute(),"/products").concat(e),{method:"get"})})),c(this,"getSelfHostedProducts",(()=>this.doFetch("".concat(this.getCloudRoute(),"/products/selfhosted"),{method:"get"}))),c(this,"subscribeToNewsletter",(t=>this.doFetch("".concat(this.getHostedCustomerRoute(),"/subscribe-newsletter"),{method:"post",body:JSON.stringify(t)}))),c(this,"cwsAvailabilityCheck",(()=>this.doFetchWithResponse("".concat(this.getCloudRoute(),"/check-cws-connection"),{method:"get"}))),c(this,"getCloudCustomer",(()=>this.doFetch("".concat(this.getCloudRoute(),"/customer"),{method:"get"}))),c(this,"updateCloudCustomer",(t=>this.doFetch("".concat(this.getCloudRoute(),"/customer"),{method:"put",body:JSON.stringify(t)}))),c(this,"updateCloudCustomerAddress",(t=>this.doFetch("".concat(this.getCloudRoute(),"/customer/address"),{method:"put",body:JSON.stringify(t)}))),c(this,"notifyAdmin",(t=>this.doFetchWithResponse("".concat(this.getUsersRoute(),"/notify-admin"),{method:"post",body:JSON.stringify(t)}))),c(this,"validateBusinessEmail",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.doFetchWithResponse("".concat(t.getCloudRoute(),"/validate-business-email"),{method:"post",body:JSON.stringify({email:e})})})),c(this,"validateWorkspaceBusinessEmail",(()=>this.doFetchWithResponse("".concat(this.getCloudRoute(),"/validate-workspace-business-email"),{method:"post"}))),c(this,"getSubscription",(()=>this.doFetch("".concat(this.getCloudRoute(),"/subscription"),{method:"get"}))),c(this,"getInstallation",(()=>this.doFetch("".concat(this.getCloudRoute(),"/installation"),{method:"get"}))),c(this,"getInvoices",(()=>this.doFetch("".concat(this.getCloudRoute(),"/subscription/invoices"),{method:"get"}))),c(this,"getInvoicePdfUrl",(t=>"".concat(this.getCloudRoute(),"/subscription/invoices/").concat(t,"/pdf"))),c(this,"getCloudLimits",(()=>this.doFetch("".concat(this.getCloudRoute(),"/limits"),{method:"get"}))),c(this,"getPostsUsage",(()=>this.doFetch("".concat(this.getUsageRoute(),"/posts"),{method:"get"}))),c(this,"getFilesUsage",(()=>this.doFetch("".concat(this.getUsageRoute(),"/storage"),{method:"get"}))),c(this,"getTeamsUsage",(()=>this.doFetch("".concat(this.getUsageRoute(),"/teams"),{method:"get"}))),c(this,"teamMembersMinusGroupMembers",((t,e,o,s)=>{const i="group_ids=".concat(e.join(","),"&page=").concat(o,"&per_page=").concat(s);return this.doFetch("".concat(this.getTeamRoute(t),"/members_minus_group_members?").concat(i),{method:"get"})})),c(this,"channelMembersMinusGroupMembers",((t,e,o,s)=>{const i="group_ids=".concat(e.join(","),"&page=").concat(o,"&per_page=").concat(s);return this.doFetch("".concat(this.getChannelRoute(t),"/members_minus_group_members?").concat(i),{method:"get"})})),c(this,"getSamlMetadataFromIdp",(t=>this.doFetch("".concat(this.getBaseRoute(),"/saml/metadatafromidp"),{method:"post",body:JSON.stringify({saml_metadata_url:t})}))),c(this,"setSamlIdpCertificateFromMetadata",(t=>{const e={method:"post",body:t,headers:{"Content-Type":"application/x-pem-file"}};return this.doFetch("".concat(this.getBaseRoute(),"/saml/certificate/idp"),e)})),c(this,"getInProductNotices",((t,e,o)=>this.doFetch("".concat(this.getNoticesRoute(),"/").concat(t,"?client=").concat(e,"&clientVersion=").concat(o),{method:"get"}))),c(this,"updateNoticesAsViewed",(t=>(this.trackEvent("ui","notice_seen_".concat(t[0])),this.doFetch("".concat(this.getNoticesRoute(),"/view"),{method:"put",body:JSON.stringify(t)})))),c(this,"getAncillaryPermissions",(t=>this.doFetch("".concat(this.getPermissionsRoute(),"/ancillary"),{method:"post",body:JSON.stringify(t)}))),c(this,"completeSetup",(t=>this.doFetch("".concat(this.getSystemRoute(),"/onboarding/complete"),{method:"post",body:JSON.stringify(t)}))),c(this,"getAppliedSchemaMigrations",(()=>this.doFetch("".concat(this.getSystemRoute(),"/schema/version"),{method:"get"}))),c(this,"getCallsChannelState",(t=>this.doFetch("".concat(this.url,"/plugins/","com.mattermost.calls","/").concat(t),{method:"get"}))),c(this,"doFetch",(async(t,e)=>{const{data:o}=await this.doFetchWithResponse(t,e);return o})),c(this,"doFetchWithResponse",(async(t,o)=>{const s=await fetch(t,this.getOptions(o)),i=m(s.headers);let n;try{n="application/json"===i.get("Content-Type")?await s.json():await s.text()}catch(e){throw new p(this.getUrl(),{message:"Received invalid response from the server.",url:t},e)}if(i.has(e.HEADER_X_VERSION_ID)&&!i.get("Cache-Control")){const t=i.get(e.HEADER_X_VERSION_ID);t&&this.serverVersion!==t&&(this.serverVersion=t)}if(i.has(e.HEADER_X_CLUSTER_ID)){const t=i.get(e.HEADER_X_CLUSTER_ID);t&&this.clusterId!==t&&(this.clusterId=t)}if(s.ok||o.ignoreStatus)return{response:s,headers:i,data:n};const c=n.message||"";throw this.logToConsole&&console.error(c),new p(this.getUrl(),{message:c,server_error_id:n.id,status_code:n.status_code,url:t})})),c(this,"upsertDraft",(async(t,e)=>await this.doFetch("".concat(this.getDraftsRoute()),{method:"post",body:JSON.stringify(t),headers:{"Connection-Id":"".concat(e)}}))),c(this,"getUserDrafts",(t=>this.doFetch("".concat(this.getUserRoute("me"),"/teams/").concat(t,"/drafts"),{method:"get"}))),c(this,"deleteDraft",(function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2?arguments[2]:void 0,i="".concat(t.getUserRoute("me"),"/channels/").concat(e,"/drafts");return""!==o&&(i+="/".concat(o)),t.doFetch(i,{method:"delete",headers:{"Connection-Id":"".concat(s)}})})),c(this,"getIPFilters",(()=>this.doFetch("".concat(this.getBaseRoute(),"/ip_filtering"),{method:"get"}))),c(this,"getCurrentIP",(()=>this.doFetch("".concat(this.getBaseRoute(),"/ip_filtering/my_ip"),{method:"get"}))),c(this,"applyIPFilters",(t=>this.doFetch("".concat(this.getBaseRoute(),"/ip_filtering"),{method:"post",body:JSON.stringify(t)}))),c(this,"getGroupMessageMembersCommonTeams",(t=>this.doFetchWithResponse("".concat(this.getChannelRoute(t),"/common_teams"),{method:"get"}))),c(this,"convertGroupMessageToPrivateChannel",((t,e,o,s)=>{const i={channel_id:t,team_id:e,display_name:o,name:s};return this.doFetchWithResponse("".concat(this.getChannelRoute(t),"/convert_to_channel?team_id=").concat(e),{method:"post",body:JSON.stringify(i)})})),c(this,"createScheduledPost",((t,e)=>(this.trackFeatureEvent(h.TrackScheduledPostsFeature,"create_scheduled_post",{[h.TrackPropertyUser]:t.user_id,[h.TrackPropertyUserAgent]:"desktop"}),this.doFetchWithResponse("".concat(this.getPostsRoute(),"/schedule"),{method:"post",body:JSON.stringify(t),headers:{"Connection-Id":e}})))),c(this,"getScheduledPosts",((t,e)=>this.doFetchWithResponse("".concat(this.getPostsRoute(),"/scheduled/team/").concat(t,"?includeDirectChannels=").concat(e),{method:"get"}))),c(this,"updateScheduledPost",((t,e)=>(this.trackFeatureEvent(h.TrackScheduledPostsFeature,"update_scheduled_post",{[h.TrackPropertyUser]:t.user_id,[h.TrackPropertyUserAgent]:"desktop"}),this.doFetchWithResponse("".concat(this.getPostsRoute(),"/schedule/").concat(t.id),{method:"put",body:JSON.stringify(t),headers:{"Connection-Id":e}})))),c(this,"deleteScheduledPost",((t,e,o)=>(this.trackFeatureEvent(h.TrackScheduledPostsFeature,"delete_scheduled_post",{[h.TrackPropertyUser]:t,[h.TrackPropertyUserAgent]:"desktop"}),this.doFetchWithResponse("".concat(this.getPostsRoute(),"/schedule/").concat(e),{method:"delete",headers:{"Connection-Id":o}})))),c(this,"restorePostVersion",((t,e,o)=>this.doFetchWithResponse("".concat(this.getPostRoute(t),"/restore/").concat(e),{method:"post",headers:{"Connection-Id":o}})))}getUrl(){return this.url}getAbsoluteUrl(t){return"string"==typeof t&&t.startsWith("/")?this.getUrl()+t:t}setUrl(t){this.url=t}setUserAgent(t){this.userAgent=t}getToken(){return this.token}setToken(t){this.token=t}setCSRF(t){this.csrf=t}setAcceptLanguage(t){this.defaultHeaders["Accept-Language"]=t}setHeader(t,e){this.defaultHeaders[t]=e}removeHeader(t){delete this.defaultHeaders[t]}setEnableLogging(t){this.enableLogging=t}setIncludeCookies(t){this.includeCookies=t}setUserId(t){this.userId=t}setUserRoles(t){this.userRoles=t}setDiagnosticId(t){this.diagnosticId=t}setTelemetryHandler(t){this.telemetryHandler=t}getServerVersion(){return this.serverVersion}getUrlVersion(){return this.urlVersion}getBaseRoute(){return"".concat(this.url).concat(this.urlVersion)}getAppsProxyRoute(){return"".concat(this.url,"/plugins/com.mattermost.apps")}getUsersRoute(){return"".concat(this.getBaseRoute(),"/users")}getUserRoute(t){return"".concat(this.getUsersRoute(),"/").concat(t)}getTeamsRoute(){return"".concat(this.getBaseRoute(),"/teams")}getTeamRoute(t){return"".concat(this.getTeamsRoute(),"/").concat(t)}getTeamSchemeRoute(t){return"".concat(this.getTeamRoute(t),"/scheme")}getTeamNameRoute(t){return"".concat(this.getTeamsRoute(),"/name/").concat(t)}getTeamMembersRoute(t){return"".concat(this.getTeamRoute(t),"/members")}getTeamMemberRoute(t,e){return"".concat(this.getTeamMembersRoute(t),"/").concat(e)}getChannelsRoute(){return"".concat(this.getBaseRoute(),"/channels")}getChannelRoute(t){return"".concat(this.getChannelsRoute(),"/").concat(t)}getChannelMembersRoute(t){return"".concat(this.getChannelRoute(t),"/members")}getChannelMemberRoute(t,e){return"".concat(this.getChannelMembersRoute(t),"/").concat(e)}getChannelSchemeRoute(t){return"".concat(this.getChannelRoute(t),"/scheme")}getChannelBookmarksRoute(t){return"".concat(this.getChannelRoute(t),"/bookmarks")}getChannelBookmarkRoute(t,e){return"".concat(this.getChannelRoute(t),"/bookmarks/").concat(e)}getChannelCategoriesRoute(t,e){return"".concat(this.getBaseRoute(),"/users/").concat(t,"/teams/").concat(e,"/channels/categories")}getRemoteClustersRoute(){return"".concat(this.getBaseRoute(),"/remotecluster")}getRemoteClusterRoute(t){return"".concat(this.getRemoteClustersRoute(),"/").concat(t)}getCustomProfileAttributeFieldsRoute(){return"".concat(this.getBaseRoute(),"/custom_profile_attributes/fields")}getCustomProfileAttributeFieldRoute(t){return"".concat(this.getCustomProfileAttributeFieldsRoute(),"/").concat(t)}getCustomProfileAttributeValuesRoute(){return"".concat(this.getBaseRoute(),"/custom_profile_attributes/values")}getPostsRoute(){return"".concat(this.getBaseRoute(),"/posts")}getPostRoute(t){return"".concat(this.getPostsRoute(),"/").concat(t)}getReactionsRoute(){return"".concat(this.getBaseRoute(),"/reactions")}getCommandsRoute(){return"".concat(this.getBaseRoute(),"/commands")}getFilesRoute(){return"".concat(this.getBaseRoute(),"/files")}getFileRoute(t){return"".concat(this.getFilesRoute(),"/").concat(t)}getPreferencesRoute(t){return"".concat(this.getUserRoute(t),"/preferences")}getIncomingHooksRoute(){return"".concat(this.getBaseRoute(),"/hooks/incoming")}getIncomingHookRoute(t){return"".concat(this.getBaseRoute(),"/hooks/incoming/").concat(t)}getOutgoingHooksRoute(){return"".concat(this.getBaseRoute(),"/hooks/outgoing")}getOutgoingHookRoute(t){return"".concat(this.getBaseRoute(),"/hooks/outgoing/").concat(t)}getOAuthRoute(){return"".concat(this.url,"/oauth")}getOAuthAppsRoute(){return"".concat(this.getBaseRoute(),"/oauth/apps")}getOAuthAppRoute(t){return"".concat(this.getOAuthAppsRoute(),"/").concat(t)}getOutgoingOAuthConnectionsRoute(){return"".concat(this.getBaseRoute(),"/oauth/outgoing_connections")}getOutgoingOAuthConnectionRoute(t){return"".concat(this.getBaseRoute(),"/oauth/outgoing_connections/").concat(t)}getEmojisRoute(){return"".concat(this.getBaseRoute(),"/emoji")}getEmojiRoute(t){return"".concat(this.getEmojisRoute(),"/").concat(t)}getBrandRoute(){return"".concat(this.getBaseRoute(),"/brand")}getBrandImageUrl(t){return"".concat(this.getBrandRoute(),"/image?t=").concat(t)}getDataRetentionRoute(){return"".concat(this.getBaseRoute(),"/data_retention")}getJobsRoute(){return"".concat(this.getBaseRoute(),"/jobs")}getPluginsRoute(){return"".concat(this.getBaseRoute(),"/plugins")}getPluginRoute(t){return"".concat(this.getPluginsRoute(),"/").concat(t)}getPluginsMarketplaceRoute(){return"".concat(this.getPluginsRoute(),"/marketplace")}getRolesRoute(){return"".concat(this.getBaseRoute(),"/roles")}getSchemesRoute(){return"".concat(this.getBaseRoute(),"/schemes")}getBotsRoute(){return"".concat(this.getBaseRoute(),"/bots")}getBotRoute(t){return"".concat(this.getBotsRoute(),"/").concat(t)}getGroupsRoute(){return"".concat(this.getBaseRoute(),"/groups")}getGroupRoute(t){return"".concat(this.getGroupsRoute(),"/").concat(t)}getNoticesRoute(){return"".concat(this.getBaseRoute(),"/system/notices")}getCloudRoute(){return"".concat(this.getBaseRoute(),"/cloud")}getHostedCustomerRoute(){return"".concat(this.getBaseRoute(),"/hosted_customer")}getUsageRoute(){return"".concat(this.getBaseRoute(),"/usage")}getPermissionsRoute(){return"".concat(this.getBaseRoute(),"/permissions")}getUserThreadsRoute(t,e){return"".concat(this.getUserRoute(t),"/teams/").concat(e,"/threads")}getUserThreadRoute(t,e,o){return"".concat(this.getUserThreadsRoute(t,e),"/").concat(o)}getSystemRoute(){return"".concat(this.getBaseRoute(),"/system")}getDraftsRoute(){return"".concat(this.getBaseRoute(),"/drafts")}getReportsRoute(){return"".concat(this.getBaseRoute(),"/reports")}getLimitsRoute(){return"".concat(this.getBaseRoute(),"/limits")}getServerLimitsRoute(){return"".concat(this.getLimitsRoute(),"/server")}getClientMetricsRoute(){return"".concat(this.getBaseRoute(),"/client_perf")}getCSRFFromCookie(){if("undefined"!=typeof document&&void 0!==document.cookie){const t=document.cookie.split(";");for(let e=0;e<t.length;e++){const o=t[e].trim();if(o.startsWith("MMCSRF="))return o.replace("MMCSRF=","")}}return""}getOptions(t){const e=n({},t),o=n({[g]:"XMLHttpRequest"},this.defaultHeaders);this.setAuthHeader&&this.token&&(o.Authorization="".concat("BEARER"," ").concat(this.token));const s=this.csrf||this.getCSRFFromCookie();return t.method&&"get"!==t.method.toLowerCase()&&s&&(o["X-CSRF-Token"]=s),this.includeCookies&&(e.credentials="include"),this.userAgent&&(o["User-Agent"]=this.userAgent),!o[u]&&t.body&&(t.body instanceof FormData||(o[u]="application/json")),e.headers&&Object.assign(o,e.headers),n(n({},e),{},{headers:o})}searchTeams(t,e){return this.doFetch("".concat(this.getTeamsRoute(),"/search"),{method:"post",body:JSON.stringify(n({term:t},e))})}getAllChannels(){const t={page:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,per_page:arguments.length>1&&void 0!==arguments[1]?arguments[1]:l,not_associated_to_group:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",exclude_default_channels:arguments.length>3&&void 0!==arguments[3]&&arguments[3],include_total_count:arguments.length>4&&void 0!==arguments[4]&&arguments[4],include_deleted:arguments.length>5&&void 0!==arguments[5]&&arguments[5],exclude_policy_constrained:arguments.length>6&&void 0!==arguments[6]&&arguments[6]};return this.doFetch("".concat(this.getChannelsRoute()).concat((0,d.buildQueryString)(t)),{method:"get"})}searchAllChannels(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=n({term:t},e),s=Boolean(e.include_deleted),i=Boolean(e.nonAdminSearch);let c={include_deleted:s,exclude_remote:Boolean(e.exclude_remote)};return i&&(c={system_console:!1},delete o.nonAdminSearch),this.doFetch("".concat(this.getChannelsRoute(),"/search").concat((0,d.buildQueryString)(c)),{method:"post",body:JSON.stringify(o),signal:e.signal})}getFileUrl(t,e){let o="".concat(this.getFileRoute(t));return e&&(o+="?".concat(e)),o}getFileThumbnailUrl(t,e){let o="".concat(this.getFileRoute(t),"/thumbnail");return e&&(o+="?".concat(e)),o}getFilePreviewUrl(t,e){let o="".concat(this.getFileRoute(t),"/preview");return e&&(o+="?".concat(e)),o}trackEvent(t,e,o){this.telemetryHandler&&this.telemetryHandler.trackEvent(this.userId,this.userRoles,t,e,o)}trackFeatureEvent(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.telemetryHandler&&this.telemetryHandler.trackFeatureEvent(this.userId,this.userRoles,t,e,o)}pageVisited(t,e){this.telemetryHandler&&this.telemetryHandler.pageVisited(this.userId,this.userRoles,t,e)}};class p extends Error{constructor(t,e,o){super(e.message+": "+(0,r.cleanUrlForLogging)(t,e.url||""),{cause:o}),this.message=e.message,this.url=e.url,this.server_error_id=e.server_error_id,this.status_code=e.status_code,Object.defineProperty(this,"message",{enumerable:!0})}}e.ClientError=p},75904:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.cleanUrlForLogging=function(t,e){let o=e;o=o.substring(t.length);const s=o.indexOf("?");-1!==s&&(o=o.substring(0,s));const i=["api","v4","users","teams","scheme","name","members","channels","posts","reactions","commands","files","preferences","hooks","incoming","outgoing","oauth","apps","emoji","brand","image","data_retention","jobs","plugins","roles","system","timezones","schemes","redirect_location","patch","mfa","password","reset","send","active","verify","terms_of_service","login","logout","ids","usernames","me","username","email","default","sessions","revoke","all","audits","device","status","search","switch","authorized","authorize","deauthorize","tokens","disable","enable","exists","unread","invite","batch","stats","import","schemeRoles","direct","group","convert","view","search_autocomplete","thread","info","flagged","pinned","pin","unpin","opengraph","actions","thumbnail","preview","link","delete","logs","ping","config","client","license","websocket","webrtc","token","regen_token","autocomplete","execute","regen_secret","policy","type","cancel","reload","environment","s3_test","file","caches","invalidate","database","recycle","compliance","reports","cluster","ldap","test","sync","saml","certificate","public","private","idp","elasticsearch","purge_indexes","analytics","old","webapp","fake"];return o=o.split("/").map((t=>""!==t&&-1===i.indexOf(t)?"<filtered>":t)).join("/"),-1!==s&&(o+="?<filtered>"),o}},60102:(t,e,o)=>{o(17046),Object.defineProperty(e,"__esModule",{value:!0}),e.buildQueryString=function(t){if(0===Object.keys(t).length)return"";const e=Object.entries(t).filter((t=>{let[e,o]=t;return void 0!==o})).map((t=>{let[e,o]=t;return"".concat(e,"=").concat(encodeURIComponent(o))})).join("&");return e.length>0?"?".concat(e):""}},94823:function(t,e,o){var s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.WebSocketClient=e.DEFAULT_LIMIT_BEFORE=e.DEFAULT_LIMIT_AFTER=e.ClientError=e.Client4=void 0;var i=o(62814);Object.defineProperty(e,"Client4",{enumerable:!0,get:function(){return s(i).default}}),Object.defineProperty(e,"ClientError",{enumerable:!0,get:function(){return i.ClientError}}),Object.defineProperty(e,"DEFAULT_LIMIT_AFTER",{enumerable:!0,get:function(){return i.DEFAULT_LIMIT_AFTER}}),Object.defineProperty(e,"DEFAULT_LIMIT_BEFORE",{enumerable:!0,get:function(){return i.DEFAULT_LIMIT_BEFORE}});var n=o(86952);Object.defineProperty(e,"WebSocketClient",{enumerable:!0,get:function(){return s(n).default}})},86952:(t,e,o)=>{function s(t,e,o){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,"string");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}o(17046),o(4290),Object.defineProperty(e,"__esModule",{value:!0});const i=3e5;e.default=class{constructor(){s(this,"eventCallback",null),s(this,"firstConnectCallback",null),s(this,"reconnectCallback",null),s(this,"missedEventCallback",null),s(this,"errorCallback",null),s(this,"closeCallback",null),s(this,"messageListeners",new Set),s(this,"firstConnectListeners",new Set),s(this,"reconnectListeners",new Set),s(this,"missedMessageListeners",new Set),s(this,"errorListeners",new Set),s(this,"closeListeners",new Set),this.conn=null,this.connectionUrl=null,this.responseSequence=1,this.serverSequence=0,this.connectFailCount=0,this.responseCallbacks={},this.connectionId="",this.serverHostname="",this.postedAck=!1}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.connectionUrl,e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0;this.conn||(null!=t?(0===this.connectFailCount&&console.log("websocket connecting to "+t),void 0!==o&&(this.postedAck=o),this.conn=new WebSocket("".concat(t,"?connection_id=").concat(this.connectionId,"&sequence_number=").concat(this.serverSequence).concat(this.postedAck?"&posted_ack=true":"")),this.connectionUrl=t,this.conn.onopen=()=>{var t;if(e&&this.sendMessage("authentication_challenge",{token:e}),this.connectFailCount>0)console.log("websocket re-established connection"),null===(t=this.reconnectCallback)||void 0===t||t.call(this),this.reconnectListeners.forEach((t=>t()));else if(this.firstConnectCallback||this.firstConnectListeners.size>0){var o;null===(o=this.firstConnectCallback)||void 0===o||o.call(this),this.firstConnectListeners.forEach((t=>t()))}this.connectFailCount=0},this.conn.onclose=()=>{var s;this.conn=null,this.responseSequence=1,0===this.connectFailCount&&console.log("websocket closed"),this.connectFailCount++,null===(s=this.closeCallback)||void 0===s||s.call(this,this.connectFailCount),this.closeListeners.forEach((t=>t(this.connectFailCount)));let n=3e3;this.connectFailCount>7&&(n=3e3*this.connectFailCount*this.connectFailCount,n>i&&(n=i)),n+=2e3*Math.random(),setTimeout((()=>{this.initialize(t,e,o)}),n)},this.conn.onerror=t=>{var e;this.connectFailCount<=1&&(console.log("websocket error"),console.log(t)),null===(e=this.errorCallback)||void 0===e||e.call(this,t),this.errorListeners.forEach((e=>e(t)))},this.conn.onmessage=t=>{const e=JSON.parse(t.data);if(e.seq_reply)e.error&&console.log(e),this.responseCallbacks[e.seq_reply]&&(this.responseCallbacks[e.seq_reply](e),Reflect.deleteProperty(this.responseCallbacks,e.seq_reply));else if(this.eventCallback||this.messageListeners.size>0){var o,s;if("hello"===e.event&&(this.missedEventCallback||this.missedMessageListeners.size>0)){if(console.log("got connection id ",e.data.connection_id),""!==this.connectionId&&this.connectionId!==e.data.connection_id){var i;console.log("long timeout, or server restart, or sequence number is not found."),null===(i=this.missedEventCallback)||void 0===i||i.call(this);for(const t of this.missedMessageListeners)try{t()}catch(e){console.log('missed message listener "'.concat(t.name,'" failed: ').concat(e))}this.serverSequence=0}this.connectionId=e.data.connection_id,this.serverHostname=e.data.server_hostname}if(e.seq!==this.serverSequence)return console.log("missed websocket event, act_seq="+e.seq+" exp_seq="+this.serverSequence),this.connectFailCount=0,this.responseSequence=1,void(null===(s=this.conn)||void 0===s||s.close());this.serverSequence=e.seq+1,null===(o=this.eventCallback)||void 0===o||o.call(this,e),this.messageListeners.forEach((t=>t(e)))}}):console.log("websocket must have connection url"))}setEventCallback(t){this.eventCallback=t}addMessageListener(t){this.messageListeners.add(t),this.messageListeners.size>5&&console.warn("WebSocketClient has ".concat(this.messageListeners.size," message listeners registered"))}removeMessageListener(t){this.messageListeners.delete(t)}setFirstConnectCallback(t){this.firstConnectCallback=t}addFirstConnectListener(t){this.firstConnectListeners.add(t),this.firstConnectListeners.size>5&&console.warn("WebSocketClient has ".concat(this.firstConnectListeners.size," first connect listeners registered"))}removeFirstConnectListener(t){this.firstConnectListeners.delete(t)}setReconnectCallback(t){this.reconnectCallback=t}addReconnectListener(t){this.reconnectListeners.add(t),this.reconnectListeners.size>5&&console.warn("WebSocketClient has ".concat(this.reconnectListeners.size," reconnect listeners registered"))}removeReconnectListener(t){this.reconnectListeners.delete(t)}setMissedEventCallback(t){this.missedEventCallback=t}addMissedMessageListener(t){this.missedMessageListeners.add(t),this.missedMessageListeners.size>5&&console.warn("WebSocketClient has ".concat(this.missedMessageListeners.size," missed message listeners registered"))}removeMissedMessageListener(t){this.missedMessageListeners.delete(t)}setErrorCallback(t){this.errorCallback=t}addErrorListener(t){this.errorListeners.add(t),this.errorListeners.size>5&&console.warn("WebSocketClient has ".concat(this.errorListeners.size," error listeners registered"))}removeErrorListener(t){this.errorListeners.delete(t)}setCloseCallback(t){this.closeCallback=t}addCloseListener(t){this.closeListeners.add(t),this.closeListeners.size>5&&console.warn("WebSocketClient has ".concat(this.closeListeners.size," close listeners registered"))}removeCloseListener(t){this.closeListeners.delete(t)}close(){this.connectFailCount=0,this.responseSequence=1,this.conn&&this.conn.readyState===WebSocket.OPEN&&(this.conn.onclose=()=>{},this.conn.close(),this.conn=null,console.log("websocket closed"))}sendMessage(t,e,o){const s={action:t,seq:this.responseSequence++,data:e};o&&(this.responseCallbacks[s.seq]=o),this.conn&&this.conn.readyState===WebSocket.OPEN?this.conn.send(JSON.stringify(s)):this.conn&&this.conn.readyState!==WebSocket.CLOSED||(this.conn=null,this.initialize())}userTyping(t,e,o){const s={channel_id:t,parent_id:e};this.sendMessage("user_typing",s,o)}updateActiveChannel(t,e){const o={channel_id:t};this.sendMessage("presence",o,e)}updateActiveTeam(t,e){const o={team_id:t};this.sendMessage("presence",o,e)}updateActiveThread(t,e,o){const s={thread_channel_id:e,is_thread_view:t};this.sendMessage("presence",s,o)}userUpdateActiveStatus(t,e,o){const s={user_is_active:t,manual:e};this.sendMessage("user_update_active_status",s,o)}acknowledgePostedNotification(t,e,o,s){const i={post_id:t,user_agent:window.navigator.userAgent,status:e,reason:o,data:s};this.sendMessage("posted_notify_ack",i)}getStatuses(t){this.sendMessage("get_statuses",null,t)}getStatusesByIds(t,e){const o={user_ids:t};this.sendMessage("get_statuses_by_ids",o,e)}}}}]); //# sourceMappingURL=4823.b494245355c3faecb383.js.map