-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathindex.js
More file actions
1 lines (1 loc) · 64.5 KB
/
index.js
File metadata and controls
1 lines (1 loc) · 64.5 KB
1
import{i as e,a as n,_ as r,b as i,C as o,c as a,u as c,d,E as l,A as h,e as f,f as v,g as _,h as g,j as b,k as m,U as y,P as w,l as I,m as k,n as A,o as N,S as M,L as z,p as j,V,q as W,r as X,v as Y,s as Z,t as $,w as ee,x as te,y as ne,z as re,B as ie,D as se,F as oe,G as ce,H as ue,I as de,J as le,K as he,M as fe,W as pe,N as ve,O as _e,Q as ge,R as be,T as me,X as ye,Y as we,Z as Ce,$ as Ie,a0 as Se,a1 as ke,a2 as Ee,a3 as Te,a4 as De,a5 as Pe,a6 as Ae,a7 as Ue,a8 as Oe,a9 as Ne}from"./lib/__bundle-667ebc2f.js";export{aa as AppInfo,x as AuthTokenType,ac as CachedChannelInfo,ad as CachedDataClearOrder,C as ChannelType,ab as CollectionEventSource,s as ConnectionState,ae as DayOfWeek,a6 as DeviceOsPlatform,af as LastMessageThreadingPolicy,L as LocalCacheConfig,ag as NotificationInfo,a9 as PushTemplate,a4 as PushTokenRegistrationState,P as PushTokenType,a8 as PushTriggerOption,ah as ReportCategoryInfo,ai as Role,S as SendbirdChatOptions,t as SendbirdError,D as SendbirdErrorCode,an as SendbirdPlatform,am as SendbirdProduct,aj as UIKitConfigInfo,ak as UnreadCountThreadingPolicy,U as User,al as UserOnlineState}from"./lib/__bundle-667ebc2f.js";import{L as Me,N as Le,a as Re,b as ze,c as Fe,g as Qe,M as je,d as xe,e as qe,f as Ke,h as Ve,i as He,j as We,k as Be,l as Ge,m as Je,n as Xe,o as Ye,D as Ze,p as $e,q as et,r as tt,A as nt,I as rt,s as it,t as st,U as ot,C as at,u as ct,B as ut,F as dt,v as lt,S as ht,w as ft,x as pt,y as vt,z as _t}from"./lib/__bundle-471dda46.js";export{u as ApplicationUserListQuery,E as BannedUserListQuery,G as BaseChannel,B as BlockedUserListQuery,C as ConnectionHandler,D as DndSchedule,F as FriendListQuery,p as LogLevel,q as MemoryStore,H as MutedUserListQuery,O as OperatorListQuery,P as Participant,J as Plugin,R as ReportCategory,K as RestrictedUser,Q as RestrictionInfo,T as RestrictionType,S as SessionHandler,U as UserEventHandler}from"./lib/__bundle-471dda46.js";import{PollModule as gt}from"./poll.js";import{g as bt,G as mt,A as yt,F as wt,U as Ct,a as It,b as St,S as kt,c as Et,d as Tt,D as Dt,R as Pt}from"./lib/__bundle-aa3838f4.js";import{g as At,N as Ut}from"./lib/__bundle-a456edee.js";import"./lib/__bundle-acd77193.js";var Ot=function(e){this.key=e.key,this.url=e.url},Nt=function(e){this.id=e.id,this.name=e.name,this.url=e.url,this.emojis=e.emojis?e.emojis.map((function(e){return new Ot(e)})):[]},Mt=function(e){this.emojiHash=e.emoji_hash||"",this.emojiCategories=e.emoji_categories?e.emoji_categories.map((function(e){return new Nt(e)})):[]},Lt={profileImage:void 0,profileUrl:void 0,nickname:void 0},Rt=function(e){return{v2:function(){return r(void 0,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:Re,keyName:ze,index:[bt(mt.LATEST_LAST_MESSAGE),bt(mt.CHRONOLOGICAL),bt(mt.CHANNEL_NAME_ALPHABETICAL)]},{collectionName:Le,keyName:Fe,index:[Qe(je.CHANNEL_LATEST),Qe(je.NEWEST_CHILD_MESSAGE)]},{collectionName:xe,keyName:qe,index:[Qe(je.CHANNEL_LATEST),Qe(je.NEWEST_CHILD_MESSAGE)]},{collectionName:Ke,keyName:Ve}])];case 1:return[2,t.sent()]}}))}))},v3:function(){return r(void 0,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:He,keyName:We,index:[At("latest_last_message")]}])];case 1:return[2,t.sent()]}}))}))},v4:function(){return r(void 0,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:Be,keyName:Ge,index:[Je()]}])];case 1:return[2,t.sent()]}}))}))},v5:function(){return r(void 0,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,e.commitSchema([{collectionName:Xe,keyName:Ye,index:[["-userId","-updatedAt"]]}])];case 1:return[2,t.sent()]}}))}))}}},zt=function(e){var t=new Me;return function(n,s){return r(void 0,void 0,void 0,(function(){var r,a,c,u;return i(this,(function(i){switch(i.label){case 0:switch(n){case 1:case 2:case 3:case 4:return[3,1];case 5:return[3,2];case 6:return[3,4];case 7:return[3,11]}return[3,15];case 1:return s(),[3,16];case 2:return[4,e.reset()];case 3:return i.sent(),s(),[3,16];case 4:return i.trys.push([4,9,,10]),r=Rt(e),a=r.v2,c=r.v3,u=r.v4,[4,a()];case 5:return i.sent(),[4,c()];case 6:return i.sent(),[4,u()];case 7:return i.sent(),[4,e.collection(Le).removeIf({where:{channelType:o.OPEN}})];case 8:return i.sent(),[3,10];case 9:return i.sent(),t.warn("Failed to migrate to v2, v3, v4"),[3,10];case 10:return s(),[3,16];case 11:return i.trys.push([11,13,,14]),[4,(0,Rt(e).v5)()];case 12:return i.sent(),[3,14];case 13:return i.sent(),t.warn("Failed to migrate to v5"),[3,14];case 14:return s(),[3,16];case 15:s(),i.label=16;case 16:return[2]}}))}))}},Ft=function(){return"undefined"!=typeof document?document.visibilityState:"visible"},Qt=function(e){function t(t){var n=t.getVisibilityState,r=void 0===n?Ft:n,i=t.initialState,s=void 0===i?"visible":i,o=t.isEnabled,a=void 0===o||o,c=t.pauseCheckDelay,u=t.supportMultipleTabs,l=void 0!==u&&u,h=t.localCacheEnabled,f=void 0!==h&&h,p=e.call(this)||this;return p._currentVisibility="visible",p._activeTimestamp=0,p._storageKey="",p._onMessage=function(e){if(p.isActive){var t=e.data;if(t.tabId!==p._tabId&&"SB_ACTIVE_APP"===t.type){if(t.timestamp<=p._activeTimestamp)return;p._changeAppStateToInactive()}}},p._onStorage=function(e){if(p.isActive&&e.key===p._storageKey&&e.newValue)try{var t=JSON.parse(e.newValue);if(t.tabId===p._tabId||t.timestamp<=p._activeTimestamp)return;p._changeAppStateToInactive()}catch(e){console.warn("failed to parse active tab info from storage",e)}},p._toggleFocusState=function(){p.isActive||"visible"===p._currentVisibility&&p._changeAppStateToActive()},p._toggleStateByVisibilityState=function(){var e=p._getVisibilityState();if("visible"===e){if("hidden"===p._currentVisibility){if(p.isActive)return;p._changeAppStateToActive(),p._dispatchAppStateEvent()}}else if("hidden"===e&&"visible"===p._currentVisibility){if(!p.isActive)return;p._changeAppStateToInactive()}p._currentVisibility=e},p._dispatchAppStateEvent=function(){p.isActive?p.dispatch("resume"):(p._clearPauseTimer(),p._pauseCheckDelay&&(p._pauseDelayTimer=setTimeout((function(){p._pauseDelayTimer=void 0,p.dispatch("pause")}),p._pauseCheckDelay)))},p._dispatchLocalCacheEvent=function(){p.isActive?p.dispatch("enable_local_cache"):p.dispatch("disable_local_cache")},p._changeAppStateToActive=function(){if(p._clearPauseTimer(),p._activeTimestamp=Date.now(),p._currentState="ACTIVE",!p._supportMultipleTabs&&p._pauseCheckDelay||p._dispatchLocalCacheEvent(),p._supportMultipleTabs){var e={tabId:p._tabId,timestamp:p._activeTimestamp};p._broadcastChannel?p._broadcastChannel.postMessage(d({type:"SB_ACTIVE_APP"},e)):localStorage.setItem(p._storageKey,JSON.stringify(e))}},p._changeAppStateToInactive=function(){var e=p._getVisibilityState();p._currentState="INACTIVE",!p._supportMultipleTabs&&p._pauseCheckDelay||p._dispatchLocalCacheEvent(),"hidden"===e&&p._dispatchAppStateEvent()},p._clearPauseTimer=function(){p._pauseDelayTimer&&(clearTimeout(p._pauseDelayTimer),p._pauseDelayTimer=void 0)},p._getVisibilityState=r,p._isEnabled=a,p._supportMultipleTabs=!!f&&l,p._pauseCheckDelay=c,p._currentVisibility=s,p}return a(t,e),Object.defineProperty(t.prototype,"isActive",{get:function(){return"ACTIVE"===this._currentState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentVisibility",{get:function(){return this._currentVisibility},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAvailableBroadCast",{get:function(){return"undefined"!=typeof BroadcastChannel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAvailable",{get:function(){return"undefined"!=typeof window&&!!window.addEventListener&&!!window.removeEventListener},enumerable:!1,configurable:!0}),t.prototype.start=function(e){var t=e.appId,n=e.userId,r=e.backgroundConnectionCloseTimeout;if(this._isEnabled&&this.isAvailable){if(void 0!==r&&-1!==r&&(this._pauseCheckDelay=0===r?10:1e3*r),this._supportMultipleTabs){var i="sendbird-".concat(t,"-").concat(n);if(this._tabId="".concat(i,"-").concat(c()),this._storageKey="".concat("sendbird-active-app:").concat(t,"-").concat(n),this.isAvailableBroadCast)try{this._broadcastChannel=new BroadcastChannel(i),this._broadcastChannel.onmessage=this._onMessage}catch(e){window.addEventListener("storage",this._onStorage,{capture:!0})}else window.addEventListener("storage",this._onStorage,{capture:!0});window.addEventListener("focus",this._toggleFocusState,{capture:!0}),window.addEventListener("pointerdown",this._toggleFocusState,{capture:!0})}window.addEventListener("visibilitychange",this._toggleStateByVisibilityState,{capture:!0}),"hidden"!==this.currentVisibility?this._changeAppStateToActive():this._currentState="INACTIVE"}},t.prototype.stop=function(){this._isEnabled&&this.isAvailable&&(this._clearPauseTimer(),this._supportMultipleTabs&&(this._broadcastChannel?(this._broadcastChannel.onmessage=null,this._broadcastChannel.close(),this._broadcastChannel=void 0):window.removeEventListener("storage",this._onStorage,{capture:!0}),window.removeEventListener("focus",this._toggleFocusState,{capture:!0}),window.removeEventListener("pointerdown",this._toggleFocusState,{capture:!0})),window.removeEventListener("visibilitychange",this._toggleStateByVisibilityState,{capture:!0}),this._tabId="",this._currentState="INACTIVE",this._activeTimestamp=0)},t}(l),jt=function(){function e(e){var t=e.logger,n=e.connectionDelegate,r=void 0===n?null:n,i=this;this._onlineWorker=function(){var e;return null===(e=i.connectionDelegate)||void 0===e?void 0:e.reconnect()},this._offlineWorker=function(){var e;return null===(e=i.connectionDelegate)||void 0===e?void 0:e.disconnect()},this.unsubscribes=[],this._onlineListener=function(e){if(i.isAvailableOnWeb)return window.addEventListener("online",e),function(){return window.removeEventListener("online",e,!1)}},this._offlineListener=function(e){if(i.isAvailableOnWeb)return window.addEventListener("offline",e),function(){return window.removeEventListener("offline",e,!1)}},this.logger=t,r&&(this.connectionDelegate=r)}return Object.defineProperty(e.prototype,"isAvailableOnWeb",{get:function(){return"undefined"!=typeof window&&!!window.addEventListener&&"ononline"in window&&"onoffline"in window&&"undefined"!=typeof navigator&&void 0!==navigator.onLine},enumerable:!1,configurable:!0}),e.prototype.setOnlineListener=function(e){Boolean(e)&&"function"==typeof e&&(this._onlineListener=e)},e.prototype.setOfflineListener=function(e){Boolean(e)&&"function"==typeof e&&(this._offlineListener=e)},e.prototype.start=function(){this.unsubscribes=[this._onlineListener(this._onlineWorker),this._offlineListener(this._offlineWorker)]},e.prototype.stop=function(){var e=this;this.unsubscribes.forEach((function(t){try{null==t||t()}catch(t){e.logger.warn(t.message)}})),this.unsubscribes=[]},e.prototype.isOnline=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return this.isAvailableOnWeb?[2,navigator.onLine]:[2,new Promise((function(e){fetch("https://www.google.com",{method:h.GET,mode:"no-cors"}).then((function(){return e(!0)})).catch((function(){return e(!1)}))}))]}))}))},e}(),xt=function(e){function t(t){var n,r=this;return(r=e.call(this)||this).method=h.GET,r.path=f,r.params=v(_({ts:"number"==typeof t.token?t.token:void 0,token:"string"==typeof t.token?t.token:void 0,limit:null!==(n=t.limit)&&void 0!==n?n:100})),r}return a(t,e),t}(g),qt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.configs=n.configs,r.hasMore=n.has_more,r.nextToken=n.next,r.ts=n.ts,r}return a(t,e),t}(b),Kt=function(e){function t(t){var n=t.userId,r=t.nickname,i=t.profileUrl,s=t.profileImage,o=t.preferredLanguages,a=e.call(this)||this;return a.method=h.PUT,a.path="".concat(m,"/").concat(encodeURIComponent(n)),a.params=v(_({nickname:r,profile_url:i,profile_file:s,preferred_languages:o})),a}return a(t,e),t}(g),Vt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.user=new y(t,d({},n)),r}return a(t,e),t}(b),Ht=function(e){function t(t){var n=t.userId,r=t.token,i=t.deviceOS,s=t.deviceManufacturer,o=t.systemPushEnabled,a=e.call(this)||this;return a.method=h.POST,a.path="".concat(m,"/").concat(encodeURIComponent(n),"/push/apns"),a.params=v({apns_device_token:r,always_push:!0,device_os:i,device_manufacturer:s,system_push_enabled:o}),a}return a(t,e),t}(g);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.type=n.type?w[n.type.toLowerCase()]:w.UNKNOWN,r.user=new y(t,n.user),r}a(t,e)}(b);var Wt=function(e){function t(t){var n=t.userId,r=t.token,i=t.deviceOS,s=t.deviceManufacturer,o=t.systemPushEnabled,a=e.call(this)||this;return a.method=h.POST,a.path="".concat(m,"/").concat(encodeURIComponent(n),"/push/gcm"),a.params=v({gcm_reg_token:r,always_push:!0,device_os:i,device_manufacturer:s,system_push_enabled:o}),a}return a(t,e),t}(g);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.type=n.type?w[n.type.toLowerCase()]:w.UNKNOWN,r.user=new y(t,n.user),r}a(t,e)}(b);var Bt=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=h.DELETE,i.path="".concat(m,"/").concat(encodeURIComponent(n),"/push/apns/").concat(encodeURIComponent(r)),i}return a(t,e),t}(g),Gt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.user=new y(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}return a(t,e),t}(b),Jt=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=h.DELETE,i.path="".concat(m,"/").concat(encodeURIComponent(n),"/push/gcm/").concat(encodeURIComponent(r)),i}return a(t,e),t}(g),Xt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.user=new y(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}return a(t,e),t}(b),Yt=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=h.DELETE,r.path="".concat(m,"/").concat(encodeURIComponent(n),"/push/apns"),r}return a(t,e),t}(g),Zt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type=n.type?w[n.type.toLowerCase()]:w.UNKNOWN,r.user=new y(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}return a(t,e),t}(b),$t=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=h.DELETE,r.path="".concat(m,"/").concat(encodeURIComponent(n),"/push/gcm"),r}return a(t,e),t}(g),en=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type=n.type?w[n.type.toLowerCase()]:w.UNKNOWN,r.user=new y(t,n.user),r.lastDeletedAt=n.device_token_last_deleted_at,r}return a(t,e),t}(b),tn=function(e){function t(t){var n=t.userId,r=t.type,i=t.token,s=t.ts,o=e.call(this)||this;return o.method=h.GET,o.path="".concat(m,"/").concat(encodeURIComponent(n),"/push/").concat(encodeURIComponent(r),"/device_tokens"),o.params={created_ts:s,token:i},o}return a(t,e),t}(g),nn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.pushTokens={type:n.type?w[n.type.toLowerCase()]:w.UNKNOWN,deviceTokens:n.device_tokens,hasMore:n.has_more,token:n.token},r}return a(t,e),t}(b),rn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=h.GET,r.path="".concat(m,"/").concat(encodeURIComponent(n),"/channel_invitation_preference"),r}return a(t,e),t}(g),sn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.autoAccept=n.auto_accept,r}return a(t,e),t}(b),on=function(e){function t(t){var n=t.userId,r=t.willAutoAccept,i=e.call(this)||this;return i.method=h.PUT,i.path="".concat(m,"/").concat(encodeURIComponent(n),"/channel_invitation_preference"),i.params={auto_accept:r},i}return a(t,e),t}(g),cn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.autoAccept=n.auto_accept,r}return a(t,e),t}(b),un=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=h.GET,r.path="".concat(m,"/").concat(encodeURIComponent(n),"/push_preference"),r}return a(t,e),t}(g),dn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.preference={doNotDisturbOn:n.do_not_disturb,startHour:n.start_hour,startMin:n.start_min,endHour:n.end_hour,endMin:n.end_min,timezone:n.timezone},r}return a(t,e),t}(b),ln=function(e){function t(t){var n=t.userId,r=t.doNotDisturbOn,i=t.startHour,s=t.startMin,o=t.endHour,a=t.endMin,c=t.timezone,u=e.call(this)||this;return u.method=h.PUT,u.path="".concat(m,"/").concat(encodeURIComponent(n),"/push_preference"),u.params={do_not_disturb:r,start_hour:i,start_min:s,end_hour:o,end_min:a,timezone:c},u}return a(t,e),t}(g),hn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.preference={doNotDisturbOn:n.do_not_disturb,startHour:n.start_hour,startMin:n.start_min,endHour:n.end_hour,endMin:n.end_min,timezone:n.timezone},r}return a(t,e),t}(b),fn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=h.GET,r.path="".concat(m,"/").concat(encodeURIComponent(n),"/push_preference"),r}return a(t,e),t}(g),pn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.snoozePeriod={isSnoozeOn:n.snooze_enabled},"number"==typeof n.snooze_start_ts&&(r.snoozePeriod.startTs=n.snooze_start_ts),"number"==typeof n.snooze_end_ts&&(r.snoozePeriod.endTs=n.snooze_end_ts),r}return a(t,e),t}(b),vn=function(e){function t(t){var n=t.userId,r=t.snoozeOn,i=t.startTs,s=t.endTs,o=e.call(this)||this;return o.method=h.PUT,o.path="".concat(m,"/").concat(encodeURIComponent(n),"/push_preference"),o.params={snooze_enabled:r,snooze_start_ts:i,snooze_end_ts:s},o}return a(t,e),t}(g),_n=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.snoozePeriod={isSnoozeOn:n.snooze_enabled},"number"==typeof n.snooze_start_ts&&(r.snoozePeriod.startTs=n.snooze_start_ts),"number"==typeof n.snooze_end_ts&&(r.snoozePeriod.endTs=n.snooze_end_ts),r}return a(t,e),t}(b),gn=function(e){function t(t){var n=t.userId,r=t.blockedUserId,i=e.call(this)||this;return i.method=h.POST,i.path="".concat(m,"/").concat(encodeURIComponent(n),"/block"),i.params={target_id:r},i}return a(t,e),t}(g);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.user=new y(t,n),r}a(t,e)}(b);var bn=function(e){function t(t){var n=t.userId,r=t.unblockedUserId,i=e.call(this)||this;return i.method=h.DELETE,i.path="".concat(m,"/").concat(encodeURIComponent(n),"/block/").concat(encodeURIComponent(r)),i}return a(t,e),t}(g);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e)}(b);var mn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=h.GET,r.path="".concat(m,"/").concat(encodeURIComponent(n),"/push_preference"),r}return a(t,e),t}(g),yn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.pushTriggerOption=n.push_trigger_option,r}return a(t,e),t}(b),wn=function(e){function t(t){var n=t.userId,r=t.pushTriggerOption,i=e.call(this)||this;return i.method=h.PUT,i.path="".concat(m,"/").concat(encodeURIComponent(n),"/push_preference"),i.params={push_trigger_option:r},i}return a(t,e),t}(g),Cn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.pushTriggerOption=n.push_trigger_option,r}return a(t,e),t}(b),In=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=h.GET,r.path="".concat(m,"/").concat(encodeURIComponent(n),"/push/template"),r}return a(t,e),t}(g),Sn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.name=n.name,r}return a(t,e),t}(b),kn=function(e){function t(t){var n=t.userId,r=t.templateName,i=e.call(this)||this;return i.method=h.PUT,i.path="".concat(m,"/").concat(encodeURIComponent(n),"/push/template"),i.params={name:r},i}return a(t,e),t}(g),En=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.name=n.name,r}return a(t,e),t}(b),Tn=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=h.GET,i.path="".concat(m,"/").concat(encodeURIComponent(n),"/friends/changelogs"),i.params={token:r},i}return a(t,e),t}(g),Dn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.changelogs={addedUsers:n.added.map((function(e){return new y(t,e)})),updatedUsers:n.updated.map((function(e){return new y(t,e)})),deletedUserIds:n.deleted,hasMore:n.has_more,token:n.next},r}return a(t,e),t}(b),Pn=function(e){function t(t){var n=t.userId,r=t.discoveries,i=e.call(this)||this;return i.method=h.PUT,i.path="".concat(m,"/").concat(encodeURIComponent(n),"/friend_discoveries"),i.params={friend_discoveries:r.map((function(e){return{friend_discovery_key:e.friendDiscoveryKey,friend_name:e.friendName}}))},i}return a(t,e),t}(g),An=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.friendDiscoveryRequestId=n.friend_discovery_request_id,r}return a(t,e),t}(b),Un=function(e){function t(t){var n=t.userId,r=t.discoveryKeys,i=e.call(this)||this;return i.method=h.DELETE,i.path="".concat(m,"/").concat(encodeURIComponent(n),"/friend_discoveries"),i.params={friend_discovery_keys:r},i}return a(t,e),t}(g);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e)}(b);var On=function(e){function t(t){var n=t.userId,r=t.userIds,i=e.call(this)||this;return i.method=h.POST,i.path="".concat(m,"/").concat(encodeURIComponent(n),"/friends"),i.params={user_ids:r},i}return a(t,e),t}(g),Nn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.users=n.users.map((function(e){return new y(t,e)})),r}return a(t,e),t}(b),Mn=function(e){function t(t){var n=t.userId,r=t.userIds,i=e.call(this)||this;return i.method=h.DELETE,i.path="".concat(m,"/").concat(encodeURIComponent(n),"/friends"),i.params={user_ids:r},i}return a(t,e),t}(g);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e)}(b);var Ln=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=h.GET,r.path="".concat(m,"/").concat(encodeURIComponent(n),"/allow_friend_discovery"),r.params={},r}return a(t,e),t}(g),Rn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.allowFriendDiscovery=n.allow_friend_discovery,r}return a(t,e),t}(b),zn=function(e){function t(t){var n=t.userId,r=t.allowFriendDiscovery,i=e.call(this)||this;return i.method=h.PUT,i.path="".concat(m,"/").concat(encodeURIComponent(n),"/allow_friend_discovery"),i.params={allow_friend_discovery:r},i}return a(t,e),t}(g);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e)}(b);var Fn,Qn=function(e){function t(t){var n=t.doNotDisturbOn,r=void 0===n||n,i=t.userId,s=t.weeklyDndSchedules,o=t.timezone,a=e.call(this)||this;return a.method=h.PUT,a.path="".concat(m,"/").concat(encodeURIComponent(i),"/push_preference"),a.params=v({do_not_disturb:r,dnd_schedules:s?Ze.payloadify(s):[],timezone:o}),a}return a(t,e),t}(g),jn=function(e){function t(t,n){var r,i=this;return(i=e.call(this,t,n)||this).preference={doNotDisturbOn:n.do_not_disturb,dndSchedules:Ze.buildDndScheduleFromPayload(null!==(r=n.dnd_schedules)&&void 0!==r?r:[]),timezone:n.timezone},i}return a(t,e),t}(b),xn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=h.GET,r.path="".concat(m,"/").concat(encodeURIComponent(n),"/push_preference"),r}return a(t,e),t}(g),qn=function(e){function t(t,n){var r,i=this;return(i=e.call(this,t,n)||this).preference={doNotDisturbOn:n.do_not_disturb,dndSchedules:Ze.buildDndScheduleFromPayload(null!==(r=n.dnd_schedules)&&void 0!==r?r:[]),timezone:n.timezone},i}return a(t,e),t}(b),Kn=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=h.DELETE,r.path="".concat(m,"/").concat(encodeURIComponent(n),"/push_preference"),r}return a(t,e),t}(g),Vn=function(e){function t(){var t=e.call(this)||this;return t.method=h.GET,t.path=I,t}return a(t,e),t}(g),Hn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emojiContainer=new Mt(n),r}return a(t,e),t}(b),Wn=function(e){function t(t){var n=t.categoryId,r=e.call(this)||this;return r.method=h.GET,r.path="".concat(I,"/").concat(n),r}return a(t,e),t}(g),Bn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emojiCategory=new Nt(n),r}return a(t,e),t}(b),Gn=function(e){function t(t){var n=t.key,r=e.call(this)||this;return r.method=h.GET,r.path="".concat(k,"/").concat(n),r}return a(t,e),t}(g),Jn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emoji=new Ot(n),r}return a(t,e),t}(b),Xn=function(e){function t(){var t=e.call(this)||this;return t.method=h.GET,t.path="".concat(A),t}return a(t,e),t}(g),Yn=function(e){function t(t,n){var r,i=this,s=null!=n?n:{};return(i=e.call(this,t,n)||this).uikitConfiguration={string:JSON.stringify(s),json:s},i.updatedAt=null!==(r=null==n?void 0:n.updated_at)&&void 0!==r?r:0,i}return a(t,e),t}(b);!function(e){e.DELIVERED="DELIVERED",e.CLICKED="CLICKED"}(Fn||(Fn={}));var Zn,$n=function(e){function t(t){var n=t.deviceToken,r=t.pushTrackingId,i=t.messageId,s=t.allowedPushNotification,o=t.channelKey,a=t.templateKey,c=t.eventType,u=t.notificationEventDeadline,d=e.call(this)||this;return d.method=h.POST,d.path=N,d.params=v({device_token:n,push_tracking_id:r,message_id:i,allowed_push_notification:s,channel_key:o,template_key:a,event_type:c,notification_event_deadline:u}),d}return a(t,e),t}(g),er=function(){function t(e,t,n){var s=this;this._storeInitialized=!1,this._iid=e,this.options=t;var o=V.of(e),a=o.sdkState,c=o.cacheContext,u=o.dispatcher,d=o.sessionManager,l=o.requestQueue,h=o.logger,f=o.userEventHandlers,p=o.appStateToggleEnabled,v=o.supportMultipleTabs;this._onlineDetector=new jt({logger:h,connectionDelegate:{reconnect:function(){return r(s,void 0,void 0,(function(){var t,n,r,s,o,a;return i(this,(function(i){switch(i.label){case 0:if(t=V.of(e),n=t.sdkState,r=t.connectionManager,(s=t.sessionManager).session.hasSession)return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.connect(s.session.authToken)];case 2:return i.sent(),[3,4];case 3:if(o=i.sent(),ke(o))throw o;return h.debug("connect failed by reconnect event = ",o),[3,4];case 4:return[3,9];case 5:if("foreground"!==n.appState)return[3,9];i.label=6;case 6:return i.trys.push([6,8,,9]),[4,r.resetAndReconnect()];case 7:return i.sent(),[3,9];case 8:if(a=i.sent(),ke(a))throw a;return h.debug("resetAndReconnect failed by reconnect event = ",a),[3,9];case 9:return u.dispatch(new Ut),[2]}}))}))},disconnect:function(){le((function(){return r(s,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=V.of(e),n=t.connectionManager,r=t.dispatcher,[4,n.disconnect()];case 1:return i.sent(),r.dispatch(new ne(new re({type:ie.WEBSOCKET_DISCONNECT,data:{success:!0,error_code:se.NETWORK_ERROR,error_description:"cause=network_closed"}}))),[2]}}))}))}))}}});var _=new yt(e,{localCacheEnabled:c.localCacheEnabled,enableAutoResend:c.localCacheConfig.enableAutoResend,dispatcher:u,sdkState:a,logger:h});n.forEach((function(t){t.init(e,{sdkState:a,cacheContext:c,dispatcher:u,sessionManager:d,requestQueue:l,logger:h,onlineDetector:s._onlineDetector}),s[t.name]=t})),this._appStateChangeDetector=new Qt({isEnabled:p,supportMultipleTabs:v,localCacheEnabled:c.localCacheEnabled}),this._appStateChangeDetector.on("resume",(function(){h.debug("the page resumes from freeze"),s.setForegroundState()})).on("pause",(function(){h.debug("the page freezes"),s.setBackgroundState()})).on("enable_local_cache",(function(){h.debug("the local cache is enabled because the page is active"),c.localCacheEnabled=!0,s._setAppActiveState(!0),"foreground"===a.appState&&u.dispatch(new wt)})).on("disable_local_cache",(function(){h.debug("the local cache is disabled because the page is inactive"),c.localCacheEnabled=!1,s._setAppActiveState(!1)})),u.on((function(t){var n;if(t instanceof he){if(t.stateType===fe.CONNECTED)_.processNonAutoResendRegisteredPendingMessages()}else if(t instanceof pe){if("USEV"===t.code){var o=t.as(Ct).event;if(o.category===It.FRIEND_DISCOVERED){var u=St.getDataAsFriendDiscoveredEvent(e,o).friendDiscoveries;ve((function(){return r(s,void 0,void 0,(function(){return i(this,(function(e){return[2,f.forEach((function(e){e.onFriendsDiscovered&&e.onFriendsDiscovered(u)}))]}))}))}))}}}else if(t instanceof _e){var d=V.of(s._iid).subscribedUnreadMessageCount,l=!1,p=t.ts;"number"==typeof p&&p>d.ts&&(d.all!==t.all&&(l=!0),d.all=t.all>=0?t.all:0,t.customTypes&&Object.keys(t.customTypes).forEach((function(e){d.customTypes[e]!==t.customTypes[e]&&(l=!0),d.customTypes[e]=t.customTypes[e]})),l=l&&d.ts>0,d.ts=p),l&&ve((function(){return r(s,void 0,void 0,(function(){return i(this,(function(e){return[2,f.forEach((function(e){e.onTotalUnreadMessageCountChanged&&e.onTotalUnreadMessageCountChanged({groupChannelCount:d.all,feedChannelCount:d.feed,customTypeUnreadCount:d.customTypes}),e.onTotalUnreadMessageCountUpdated&&e.onTotalUnreadMessageCountUpdated(d.all,d.customTypes)}))]}))}))}))}else if(t instanceof ge)c.preference.set(s._getUserProfileCacheKey(a.userId),be.payloadify(t.userProfile)),(null===(n=t.userProfile.appInfo.notificationInfo)||void 0===n?void 0:n.isEnabled)&&c.preference.set(me(s.appId),{value:!0});else if(t instanceof ye)t.configSyncNeeded&&le((function(){return r(s,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this._getAppConfigsInfo()];case 1:return e.sent(),[2]}}))}))}));else if(t instanceof kt)c.preference.set(we(s.appId),{configTs:t.configTs});else if(t instanceof Ce)t.error&&t.error.isSessionInvalidatedError&&(h.debug("session revoked."),s._internalDisconnect(t.error));else if(t instanceof Ie)switch(t.event){case"resume":s.setForegroundState();break;case"pause":s.setBackgroundState()}}))}return t.init=function(e){var n=e.appId,r=e.appVersion,i=e.modules,s=void 0===i?[]:i,o=e.options,a=void 0===o?new M:o,u=e.debugMode,d=void 0!==u&&u,l=e.customApiHost,h=e.customWebSocketHost,f=e.newInstance,p=void 0!==f&&f,v=e.logLevel,_=e.localCacheEnabled,g=void 0!==_&&_,b=e.localCacheConfig,m=void 0===b?new z:b,y=e.localCacheEncryption,w=e.supportMultipleTabs,C=void 0!==w&&w,I=e.useAsyncStorageStore,S=void 0===I?null:I,k=e.useMMKVStorageStore,E=void 0===k?null:k,T=e.appStateToggleEnabled,D=void 0===T||T;if(!Zn||p){var P="su-".concat(c()),A=null!=y?y:{encrypt:function(e){return e},decrypt:function(e){return e}},U=new Me;U.level=null!=v?v:$e.WARN;var O=new et({encryption:A});d||(j()?E?O=new tt({MMKV:E,encryption:A}):S&&(O=new nt({AsyncStorage:S,encryption:A}),U.warn("AsyncStorage store is deprecated due to the small size limit. Please use MMKVStorage store instead.")):O=new rt({encryption:A})),new V(P,{appId:n,appVersion:r,options:a,apiHost:null!=l?l:"https://api-".concat(n,".sendbird.com"),websocketHost:null!=h?h:"wss://ws-".concat(n,".sendbird.com"),store:O,encryption:A,logger:U,localCacheEnabled:g,localCacheConfig:m,debugMode:d,appStateToggleEnabled:D,supportMultipleTabs:C});var N=[new it,new gt],L=new t(P,a,W(W([],X(s),!1),X(N),!1));return Zn||(Zn=L),L}return Zn},Object.defineProperty(t,"instance",{get:function(){return Zn},enumerable:!1,configurable:!0}),Object.defineProperty(t,"version",{get:function(){return Y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"appId",{get:function(){return V.of(this._iid).sdkState.appId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"appInfo",{get:function(){var e=V.of(this._iid).appInfo;return null!=e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"appVersion",{get:function(){var e;return null!==(e=V.of(this._iid).sdkState.appVersion)&&void 0!==e?e:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugMode",{get:function(){return!!V.of(this._iid).debugMode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"logLevel",{get:function(){return V.of(this._iid).logger.level},set:function(e){V.of(this._iid).logger.level=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isCacheEnabled",{get:function(){return V.of(this._iid).cacheContext.localCacheEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localCacheConfig",{get:function(){var e=V.of(this._iid).cacheContext;return e.localCacheEnabled?e.localCacheConfig:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ekey",{get:function(){return V.of(this._iid).sessionManager.ekey},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentUser",{get:function(){var e;return null!==(e=V.of(this._iid).sessionManager.currentUser)&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectionState",{get:function(){var e=V.of(this._iid).connectionManager;return e.isConnected?Z.OPEN:e.isConnecting?Z.CONNECTING:Z.CLOSED},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastConnectedAt",{get:function(){var e=V.of(this._iid),t=e.connectedAt;return e.connectionManager.isConnected?t:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fcmPushToken",{get:function(){var e;return null!==(e=this._fcmPushToken)&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"apnsPushToken",{get:function(){var e;return null!==(e=this._apnsPushToken)&&void 0!==e?e:null},enumerable:!1,configurable:!0}),t.prototype._getNestDBVersion=function(){return 8},t.prototype._getPreferenceVersion=function(){return 9},t.prototype._getPreferenceCacheKey=function(e){return"sendbird@".concat(this.appId,"/").concat(e,".pref")},t.prototype._getUserProfileCacheKey=function(e){return"sendbird@".concat(this.appId,"/").concat(e,".profile")},t.prototype._internalDisconnect=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return t=V.of(this._iid),n=t.connectionManager,r=t.sdkState,s=t.requestQueue,this._appStateChangeDetector.stop(),this._onlineDetector.stop(),s.cancelAll(),[4,n.logout(e)];case 1:return i.sent(),[4,this.clearCachedData()];case 2:return i.sent(),r.appState="foreground",r.isAppActive=!1,[2]}}))}))},t.prototype._getAppConfigsInfo=function(){return r(this,void 0,void 0,(function(){var e,t,n,s,o,a,c,u,d=this;return i(this,(function(l){switch(l.label){case 0:return e=V.of(this._iid),t=e.requestQueue,n=e.dispatcher,s=e.cacheContext,o=e.sdkState,a={},[4,s.preference.get(we(o.appId))];case 1:return(u=l.sent())&&(c=u.configTs),new Et("appConfigsInfo",(function(e){return r(d,void 0,void 0,(function(){var r,s,o,c,u,d,l,h;return i(this,(function(i){switch(i.label){case 0:return r={hasNext:!0,nextToken:e},s=new xt({token:e}),[4,t.send(s)];case 1:return o=i.sent(),c=o.as(qt),u=c.configs,d=c.hasMore,l=c.nextToken,h=c.ts,Object.keys(u).forEach((function(e){a[e]=u[e]})),r.hasNext=d,r.nextToken=l,d||n.dispatch(new Tt({appConfigsInfo:a,configTs:h})),[2,r]}}))}))})).start(c),[2]}}))}))},t.prototype.getMemoryStoreForDebugging=function(){var e=V.of(this._iid),t=e.debugMode,n=e.cacheContext;if(t)return n.store instanceof et?n.store:null;throw $.debugModeRequired},t.prototype.addExtension=function(e,t){var n=V.of(this._iid).sdkState;["sb_uikit","sb_syncmanager","device-os-platform"].indexOf(e)>-1&&n.extensions&&(n.extensions[e]=t)},t.prototype.addSendbirdExtensions=function(e,t,n){var r,i,s=V.of(this._iid),o=s.logger,a=s.sdkState,c=new RegExp(Se);if(0===e.length)return o.debug("sb.addSendbirdExtensions() has failed because the given sendbirdExtensions is empty."),!1;if(e.find((function(e){return!c.test(e.version)})))return o.debug("sb.addSendbirdExtensions() has failed because the given version did not satisfy the SemVer specification."),!1;if(n)try{for(var u=ee(Object.entries(n)),d=u.next();!d.done;d=u.next()){var l=X(d.value,2),h=l[0],f=l[1];if(/&|=/.test(h)||/&|=/.test(f))return o.debug("sb.addSendbirdExtensions() has failed because the given customData includes at least one invalid character: = or &."),!1}}catch(e){r={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}return a.sendbirdRuntimeEnvironment={sendbirdExtensions:e,deviceOS:t,customData:n},!0},t.prototype.setOnlineListener=function(e){this._onlineDetector.setOnlineListener(e)},t.prototype.setOfflineListener=function(e){this._onlineDetector.setOfflineListener(e)},t.prototype._safeInitializeStore=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:t=V.of(this._iid).cacheContext,n.label=1;case 1:return n.trys.push([1,3,,5]),[4,t.store.init(e)];case 2:return n.sent(),this._storeInitialized=!0,[3,5];case 3:return n.sent(),t.replaceStore(new et),[4,this._safeInitializeStore(e)];case 4:return n.sent(),[3,5];case 5:return[2]}}))}))},t.prototype.initializeCache=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o,a,c,u,d;return i(this,(function(i){switch(i.label){case 0:if(t=V.of(this._iid),n=t.sdkState,r=t.cacheContext,s=t.dispatcher,o=t.logger,n.userId&&n.userId===e)return[3,13];a="sendbird@".concat(n.appId,"/").concat(e,".db"),i.label=1;case 1:return i.trys.push([1,9,11,13]),r.localCacheEnabled?r.nestdb&&r.nestdb.state!==st.CLOSED&&r.nestdb.name===a?[3,3]:(c="sendbird@".concat(n.appId,"/").concat(e,".db"),(u=r.nestdb=new vt({name:c,version:this._getNestDBVersion(),store:r.store,config:new _t({dbname:c,cacheLimit:64,itemSizeLimit:61440})})).on("upgrade",zt(u)),u.on("storeReplaced",(function(e){r.replaceStore(e),r.localCacheEnabled=!1,u.on("upgrade",zt(u))})),[4,u.open()]):[3,6];case 2:return i.sent(),this._storeInitialized=!0,s.dispatch(new Dt(this._iid,{userId:e})),[3,5];case 3:return[4,this._safeInitializeStore(a)];case 4:i.sent(),i.label=5;case 5:return n.userId=e,[3,8];case 6:return[4,this._safeInitializeStore(a)];case 7:i.sent(),n.userId=e,i.label=8;case 8:return[3,13];case 9:return d=i.sent(),o.warn("Nest DB Open Failed. ",d),r.store instanceof et||(r.replaceStore(new et),r.localCacheEnabled=!1),[4,this._safeInitializeStore(a)];case 10:throw i.sent(),n.userId=e,$.databaseError;case 11:return[4,this._setupPreference(e)];case 12:return i.sent(),[7];case 13:return[2]}}))}))},t.prototype.getCacheDataSize=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return(e=V.of(this._iid).cacheContext).localCacheEnabled&&e.nestdb?[4,e.nestdb.estimateUsage()]:[3,2];case 1:return[2,t.sent()];case 2:return[2,0]}}))}))},t.prototype.clearCachedData=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return(e=V.of(this._iid).cacheContext).localCacheEnabled&&e.nestdb?[4,e.nestdb.clear()]:[3,2];case 1:t.sent(),e.nestdb.trim(),t.label=2;case 2:return this._storeInitialized?[4,e.preference.clear()]:[3,4];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))},t.prototype.clearCachedMessages=function(e){return r(this,void 0,void 0,(function(){var t,n,s,o=this;return i(this,(function(a){switch(a.label){case 0:return oe(Ee("string",e)).throw($.invalidParameters),t=V.of(this._iid).cacheContext,n=ft.of(this._iid),s=pt.of(this._iid),n&&s?[4,Promise.all(e.map((function(e){return r(o,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,n.removeMessagesOfChannel(e)];case 1:return t.sent(),[4,s.removeMessagesOfChannel(e)];case 2:return t.sent(),[2]}}))}))})))]:[3,2];case 1:a.sent(),a.label=2;case 2:return t.localCacheEnabled&&t.nestdb&&t.nestdb.trim(),[2]}}))}))},t.prototype._setupPreference=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o;return i(this,(function(i){switch(i.label){case 0:return t=V.of(this._iid),n=t.sdkState,r=t.cacheContext,s=t.statManager,[4,r.preference.init(this._getPreferenceCacheKey(e),this._getPreferenceVersion())];case 1:return i.sent(),[4,r.preference.get(this._getUserProfileCacheKey(e))];case 2:return(o=i.sent())&&new be(this._iid,o).apply(),[4,s.init("sendbird@".concat(n.appId,"/").concat(e,".statlog"))];case 3:return i.sent(),[2]}}))}))},t.prototype._willReuseOpenedCacheDatabase=function(e){var t=V.of(this._iid),n=t.sdkState,r=t.cacheContext,i="sendbird@".concat(n.appId,"/").concat(e,".db");return!(!r.localCacheConfig||!r.nestdb||r.nestdb.state===st.CLOSED||r.nestdb.name!==i)},t.prototype._ready=function(e,t,s){return void 0===s&&(s={}),r(this,void 0,void 0,(function(){var r,o,a,c,u,d,l,h;return i(this,(function(i){switch(i.label){case 0:return oe(n("string",e)&&n("string",t,!0)).throw($.invalidParameters),r=V.of(this._iid),o=r.sdkState,a=r.cacheContext,c=r.connectionManager,u=r.dispatcher,d=s.errorForOtherUser,o.userId&&o.userId!==e?d?[3,2]:[4,c.logout()]:[3,3];case 1:return i.sent(),[3,3];case 2:throw d;case 3:return i.trys.push([3,5,,6]),l=this._willReuseOpenedCacheDatabase(e),[4,this.initializeCache(e)];case 4:return i.sent(),a.localCacheEnabled&&l&&u.dispatch(new Pt),[3,6];case 5:return i.sent(),h=V.of(this._iid).logger,a.localCacheEnabled=!1,h.warn("Cache initialization failed - cache is not available."),[3,6];case 6:return[2]}}))}))},t.prototype.authenticateFeed=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this.authenticate(e,t)];case 1:return[2,n.sent()]}}))}))},t.prototype.authenticate=function(e,t,n){var s;return void 0===n&&(n=te.SESSION_TOKEN),r(this,void 0,void 0,(function(){var r,o,a;return i(this,(function(i){switch(i.label){case 0:return r=V.of(this._iid),o=r.sessionManager,a=r.connectionManager,[4,this._ready(e,t,{errorForOtherUser:a.isConnected?$.alreadyConnectedAsAnotherUser:void 0})];case 1:return i.sent(),(null===(s=o.session.services)||void 0===s?void 0:s.includes(Te.CHAT))?[3,3]:(o.handler||t&&n!==te.ACCESS_TOKEN||this.setSessionHandler(new ht),[4,o.authenticate(e,t)]);case 2:i.sent(),i.label=3;case 3:return[2,this.currentUser]}}))}))},t.prototype.connect=function(e,t){var n;return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,this._ready(e,t)];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,,4,5]),[4,V.of(this._iid).connectionManager.connect(t)];case 3:return r.sent(),[3,5];case 4:return this._onlineDetector.start(),this._appStateChangeDetector.start({appId:this.appId,userId:e,backgroundConnectionCloseTimeout:null===(n=this.appInfo)||void 0===n?void 0:n.backgroundConnectionCloseTimeout}),[7];case 5:return[2,this.currentUser]}}))}))},t.prototype.reconnect=function(){var e=V.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.sessionManager,i=e.dispatcher,s=r.session.hasSession;return s&&(i.dispatch(new ne(new re({type:ie.WEBSOCKET_DISCONNECT,data:{success:!0,error_code:0,error_description:"cause=explicit_reconnect"}}))),this._appStateChangeDetector.start({appId:this.appId,userId:this.currentUser.userId,backgroundConnectionCloseTimeout:this.appInfo.backgroundConnectionCloseTimeout}),this._onlineDetector.start(),t.resetAndReconnect().then((function(){n.appState="foreground"})).catch((function(){}))),s},t.prototype.disconnect=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this._internalDisconnect()];case 1:return e.sent(),[2]}}))}))},t.prototype.disconnectWebSocket=function(){return r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return e=V.of(this._iid),t=e.connectionManager,n=e.requestQueue,e.dispatcher.dispatch(new ne(new re({type:ie.WEBSOCKET_DISCONNECT,data:{success:!0,error_code:0,error_description:"cause=explicit_disconnect_websocket"}}))),this._appStateChangeDetector.stop(),this._onlineDetector.stop(),n.cancelAll(),[4,t.disconnectWebSocket(!0)];case 1:return r.sent(),[2]}}))}))},t.prototype.setBackgroundState=function(){var e=V.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.logger,i=e.dispatcher;"foreground"===n.appState&&(n.appState="background",n.isAppActive=!1,r.debug("going background state"),i.dispatch(new ne(new re({type:ie.WEBSOCKET_DISCONNECT,data:{success:!0,error_code:se.WEBSOCKET_CONNECTION_CLOSED,error_description:"cause=background"}}))),t.background().catch((function(e){r.debug("setBackgroundState error = ",e)})))},t.prototype.setForegroundState=function(){var e=V.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.dispatcher,i=e.logger;"background"===n.appState&&(n.appState="foreground",n.isAppActive=!0,i.debug("going foreground state"),t.resetAndReconnect().catch((function(e){i.debug("setForgroundState error = ",e)})),r.dispatch(new Ut))},t.prototype._setAppActiveState=function(e){V.of(this._iid).sdkState.isAppActive=e},t.prototype.setSessionHandler=function(e){oe(e instanceof ht).throw($.invalidParameters),V.of(this._iid).sessionManager.handler=e},t.prototype.addUserEventHandler=function(e,t){oe(n("string",e)&&t instanceof ot).throw($.invalidParameters),V.of(this._iid).userEventHandlers.set(e,t)},t.prototype.removeUserEventHandler=function(e){V.of(this._iid).userEventHandlers.delete(e)},t.prototype.removeAllUserEventHandler=function(){V.of(this._iid).userEventHandlers.clear()},t.prototype.addConnectionHandler=function(e,t){oe(n("string",e)&&t instanceof at).throw($.invalidParameters),V.of(this._iid).connectionHandlers.set(e,t)},t.prototype.removeConnectionHandler=function(e){V.of(this._iid).connectionHandlers.delete(e)},t.prototype.removeAllConnectionHandler=function(){V.of(this._iid).connectionHandlers.clear()},t.prototype.createApplicationUserListQuery=function(e){return void 0===e&&(e={}),new ct(this._iid,e)},t.prototype.createBlockedUserListQuery=function(e){return void 0===e&&(e={}),new ut(this._iid,e)},t.prototype.createFriendListQuery=function(e){return void 0===e&&(e={}),new dt(this._iid,e)},t.prototype.createMessageSearchQuery=function(e){return new lt(this._iid,e)},t.prototype.createPollListQuery=function(e){return new ce(this._iid,d({},e))},t.prototype.createPollVoterListQuery=function(e){return new ue(this._iid,d({},e))},t.prototype.buildUserFromSerializedData=function(e){var t=de(e);return new y(this._iid,y.payloadify(t))},t.prototype.updateCurrentUserInfo=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var r,s,o,a,c,u,l;return i(this,(function(i){switch(i.label){case 0:return r=d(d({},Lt),t),oe(function(t){return e(t.profileImage,!0)&&n("string",t.profileUrl,!0)&&n("string",t.nickname,!0)}(r)).throw($.invalidParameters),this.currentUser?(s=V.of(this._iid),o=s.sdkState,a=s.requestQueue,c=new Kt(d({userId:o.userId},r)),[4,a.send(c)]):[3,2];case 1:return u=i.sent(),l=u.as(Vt).user,this.currentUser&&(r.nickname&&(this.currentUser.nickname=l.nickname),(r.profileUrl||r.profileImage)&&(this.currentUser.plainProfileUrl=l.profileUrl)),[2,l];case 2:throw $.connectionRequired}}))}))},t.prototype.updateCurrentUserInfoWithPreferredLanguages=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o,a;return i(this,(function(i){switch(i.label){case 0:return oe(Ee("string",e)).throw($.invalidParameters),this.currentUser?(t=V.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new Kt({userId:n.userId,preferredLanguages:e}),[4,r.send(s)]):[3,2];case 1:return o=i.sent(),a=o.as(Vt).user,this.currentUser&&(this.currentUser.preferredLanguages=a.preferredLanguages),[2,a];case 2:throw $.connectionRequired}}))}))},t.prototype.registerFCMPushTokenForCurrentUser=function(e,t){var s,o;return r(this,void 0,void 0,(function(){var a,c,u,d,l,h,f=this;return i(this,(function(p){switch(p.label){case 0:if(oe(n("string",e)&&n("string",null==t?void 0:t.deviceManufacturer,!0)).throw($.invalidParameters),(null==t?void 0:t.deviceOS)&&oe(Pe(Ae,t.deviceOS.platform,!0)&&n("string",t.deviceOS.version,!0)).throw($.invalidParameters),!this.currentUser)return[3,6];a={deviceOS:"".concat((null===(s=null==t?void 0:t.deviceOS)||void 0===s?void 0:s.platform)||Ae.ANDROID,"-").concat((null===(o=null==t?void 0:t.deviceOS)||void 0===o?void 0:o.version)||"unknown"),deviceManufacturer:null==t?void 0:t.deviceManufacturer,systemPushEnabled:null==t?void 0:t.systemPushEnabled},p.label=1;case 1:return p.trys.push([1,4,,5]),c=V.of(this._iid),u=c.sessionManager,d=c.sdkState,l=c.requestQueue,u.hasDeviceToken(w.FCM,e)?[2,De.SUCCESS]:(h=new Wt({userId:d.userId,token:e,deviceOS:a.deviceOS,deviceManufacturer:a.deviceManufacturer,systemPushEnabled:a.systemPushEnabled}),[4,l.send(h)]);case 2:return p.sent(),[4,le((function(){return r(f,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return u.setDeviceToken(w.FCM,e,a),[4,u.saveDeviceToken()];case 1:return t.sent(),[2]}}))}))}))];case 3:return p.sent(),this._fcmPushToken="",[2,De.SUCCESS];case 4:return p.sent(),[2,De.ERROR];case 5:return[3,7];case 6:return this._fcmPushToken=e,[2,De.PENDING];case 7:return[2]}}))}))},t.prototype.unregisterFCMPushTokenForCurrentUser=function(e){return r(this,void 0,void 0,(function(){var t,s,o,a,c,u,d,l=this;return i(this,(function(h){switch(h.label){case 0:if(oe(n("string",e)).throw($.invalidParameters),!this.currentUser)return[3,6];h.label=1;case 1:return h.trys.push([1,4,,5]),t=V.of(this._iid),s=t.sessionManager,o=t.sdkState,a=t.requestQueue,c=new Jt({userId:o.userId,token:e}),[4,a.send(c)];case 2:return u=h.sent(),d=u.as(Xt).lastDeletedAt,[4,le((function(){return r(l,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return s.unsetDeviceToken(w.FCM,e),s.setDeviceTokenDeletedAt(d),[4,s.saveDeviceToken()];case 1:return t.sent(),[2]}}))}))}))];case 3:return h.sent(),this._fcmPushToken="",[2,De.SUCCESS];case 4:return h.sent(),[2,De.ERROR];case 5:return[3,7];case 6:return this._fcmPushToken=e,[2,De.PENDING];case 7:return[2]}}))}))},t.prototype.unregisterFCMPushTokenAllForCurrentUser=function(){return r(this,void 0,void 0,(function(){var e,t,n,s,o,a,c,u=this;return i(this,(function(d){switch(d.label){case 0:return this.currentUser?(e=V.of(this._iid),t=e.sessionManager,n=e.sdkState,s=e.requestQueue,o=new $t({userId:n.userId}),[4,s.send(o)]):[3,3];case 1:return a=d.sent(),c=a.as(en).lastDeletedAt,[4,le((function(){return r(u,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return t.unsetDeviceTokens(w.FCM),t.setDeviceTokenDeletedAt(c),[4,t.saveDeviceToken()];case 1:return e.sent(),[2]}}))}))}))];case 2:d.sent(),d.label=3;case 3:return[2]}}))}))},t.prototype.registerAPNSPushTokenForCurrentUser=function(e,t){var s,o;return r(this,void 0,void 0,(function(){var a,c,u,d,l,h,f=this;return i(this,(function(p){switch(p.label){case 0:if(oe(n("string",e)&&n("string",null==t?void 0:t.deviceManufacturer,!0)).throw($.invalidParameters),(null==t?void 0:t.deviceOS)&&oe(Pe(Ae,t.deviceOS.platform,!0)&&n("string",t.deviceOS.version,!0)).throw($.invalidParameters),!this.currentUser)return[3,6];a={deviceOS:"".concat((null===(s=null==t?void 0:t.deviceOS)||void 0===s?void 0:s.platform)||Ae.IOS,"-").concat((null===(o=null==t?void 0:t.deviceOS)||void 0===o?void 0:o.version)||"unknown"),deviceManufacturer:null==t?void 0:t.deviceManufacturer,systemPushEnabled:null==t?void 0:t.systemPushEnabled},p.label=1;case 1:return p.trys.push([1,4,,5]),c=V.of(this._iid),u=c.sessionManager,d=c.sdkState,l=c.requestQueue,u.hasDeviceToken(w.APNS,e)?[2,De.SUCCESS]:(h=new Ht({userId:d.userId,token:e,deviceOS:a.deviceOS,deviceManufacturer:a.deviceManufacturer,systemPushEnabled:a.systemPushEnabled}),[4,l.send(h)]);case 2:return p.sent(),[4,le((function(){return r(f,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return u.setDeviceToken(w.APNS,e,a),[4,u.saveDeviceToken()];case 1:return t.sent(),[2]}}))}))}))];case 3:return p.sent(),this._apnsPushToken="",[2,De.SUCCESS];case 4:return p.sent(),[2,De.ERROR];case 5:return[3,7];case 6:return this._apnsPushToken=e,[2,De.PENDING];case 7:return[2]}}))}))},t.prototype.unregisterAPNSPushTokenForCurrentUser=function(e){return r(this,void 0,void 0,(function(){var t,s,o,a,c,u,d,l=this;return i(this,(function(h){switch(h.label){case 0:if(oe(n("string",e)).throw($.invalidParameters),!this.currentUser)return[3,6];h.label=1;case 1:return h.trys.push([1,4,,5]),t=V.of(this._iid),s=t.sessionManager,o=t.sdkState,a=t.requestQueue,c=new Bt({userId:o.userId,token:e}),[4,a.send(c)];case 2:return u=h.sent(),d=u.as(Gt).lastDeletedAt,[4,le((function(){return r(l,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return s.unsetDeviceToken(w.APNS,e),s.setDeviceTokenDeletedAt(d),[4,s.saveDeviceToken()];case 1:return t.sent(),[2]}}))}))}))];case 3:return h.sent(),this._apnsPushToken="",[2,De.SUCCESS];case 4:return h.sent(),[2,De.ERROR];case 5:return[3,7];case 6:return this._apnsPushToken=e,[2,De.PENDING];case 7:return[2]}}))}))},t.prototype.unregisterAPNSPushTokenAllForCurrentUser=function(){return r(this,void 0,void 0,(function(){var e,t,n,s,o,a,c,u=this;return i(this,(function(d){switch(d.label){case 0:return this.currentUser?(e=V.of(this._iid),t=e.sessionManager,n=e.sdkState,s=e.requestQueue,o=new Yt({userId:n.userId}),[4,s.send(o)]):[3,3];case 1:return a=d.sent(),c=a.as(Zt).lastDeletedAt,[4,le((function(){return r(u,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return t.unsetDeviceTokens(w.APNS),t.setDeviceTokenDeletedAt(c),[4,t.saveDeviceToken()];case 1:return e.sent(),[2]}}))}))}))];case 2:d.sent(),d.label=3;case 3:return[2]}}))}))},t.prototype.markPushNotificationAsDelivered=function(e,t){var n;return void 0===t&&(t=!0),r(this,void 0,void 0,(function(){var r,s,o,a,c,u,d,l,h,f,p,v,_,g,b,m,y,w,C;return i(this,(function(i){switch(i.label){case 0:if(r=V.of(this._iid),s=r.logger,o=r.sessionManager,a=r.requestQueue,c=r.pushNotificationAckManager,s.debug("markPushNotificationAsDelivered:",e),u=Fn.DELIVERED,d=c.parseData(e),l=d.pushTrackingId,h=d.sessionTopics,f=d.sessionKey,p=d.messageId,v=d.channelKey,_=d.templateKey,g=d.notificationEventDeadline,!f)throw s.info("Can't use markPushNotificationAsDelivered() feature."),$.malformedDataError;if(!h.includes(Ue.PUSH_ACKNOWLEDGEMENT))throw s.info("Can't use markPushNotificationAsDelivered() feature."),$.malformedDataError;if(c.isAcked(l,u))return s.info("already delivered push notification:",l),[2];b=Boolean(v),m=t&&b,y=null===(n=o.deviceTokens[0])||void 0===n?void 0:n.token,w=new $n({deviceToken:null!=y?y:"",pushTrackingId:l,eventType:u,messageId:p,channelKey:v,templateKey:_,notificationEventDeadline:g,allowedPushNotification:m}),f&&(w.headers["Session-Key"]=f),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,a.send(w)];case 2:return i.sent(),c.markAsAcked(l,u),[3,4];case 3:throw C=i.sent(),s.debug("failed to mark push notification as delivered. push tracking id: ".concat(l,". error: ").concat(C)),C;case 4:return[2]}}))}))},t.prototype.markPushNotificationAsClicked=function(e){var t;return r(this,void 0,void 0,(function(){var n,r,s,o,a,c,u,d,l,h,f,p,v,_,g,b,m;return i(this,(function(i){switch(i.label){case 0:if(n=V.of(this._iid),r=n.logger,s=n.sessionManager,o=n.requestQueue,a=n.pushNotificationAckManager,r.debug("markPushNotificationAsClicked:",e),c=Fn.CLICKED,u=a.parseData(e),d=u.pushTrackingId,l=u.sessionTopics,h=u.sessionKey,f=u.messageId,p=u.channelKey,v=u.templateKey,_=u.notificationEventDeadline,!h)throw r.info("Can't use markPushNotificationAsClicked() feature."),$.malformedDataError;if(!l.includes(Ue.PUSH_ACKNOWLEDGEMENT))throw r.info("Can't use markPushNotificationAsClicked() feature."),$.malformedDataError;if(a.isAcked(d,c))return r.info("already clicked push notification:",d),[2];g=null===(t=s.deviceTokens[0])||void 0===t?void 0:t.token,b=new $n({deviceToken:null!=g?g:"",pushTrackingId:d,eventType:c,messageId:f,channelKey:p,templateKey:v,notificationEventDeadline:_}),h&&(b.headers["Session-Key"]=h),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,o.send(b)];case 2:return i.sent(),a.markAsAcked(d,c),[3,4];case 3:throw m=i.sent(),r.debug("failed to mark push notification as clicked. push tracking id: ".concat(d,". error: ").concat(m)),m;case 4:return[2]}}))}))},t.prototype.getChannelInvitationPreference=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new rn({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,{autoAccept:s.as(sn).autoAccept}]}}))}))},t.prototype.setChannelInvitationPreference=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o,a;return i(this,(function(i){switch(i.label){case 0:return oe(n("boolean",e)).throw($.invalidParameters),t=V.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new on({userId:r.userId,willAutoAccept:e}),[4,s.send(o)];case 1:return a=i.sent(),[2,{autoAccept:a.as(cn).autoAccept}]}}))}))},t.prototype.getDoNotDisturb=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new un({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,s.as(dn).preference]}}))}))},t.prototype.setDoNotDisturb=function(e,t,s,o,a,c){return void 0===t&&(t=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===c&&(c=""),r(this,void 0,void 0,(function(){var r,u,d,l,h;return i(this,(function(i){switch(i.label){case 0:return oe(n("boolean",e)&&n("number",t)&&n("number",s)&&n("number",o)&&n("number",a)&&n("string",c)).throw($.invalidParameters),r=V.of(this._iid),u=r.sdkState,d=r.requestQueue,l=new ln({userId:u.userId,doNotDisturbOn:e,startHour:t,startMin:s,endHour:o,endMin:a,timezone:c}),[4,d.send(l)];case 1:return h=i.sent(),[2,h.as(hn).preference]}}))}))},t.prototype.setWeeklyDoNotDisturb=function(e,t){return void 0===t&&(t=""),r(this,void 0,void 0,(function(){var r,s,o,a,c;return i(this,(function(i){switch(i.label){case 0:return oe(e instanceof Ze&&e.isValid()&&n("string",t)).throw($.invalidParameters),r=V.of(this._iid),s=r.sdkState,o=r.requestQueue,a=new Qn({userId:s.userId,weeklyDndSchedules:e,timezone:t}),[4,o.send(a)];case 1:return c=i.sent(),[2,c.as(jn).preference]}}))}))},t.prototype.getWeeklyDoNotDisturb=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new xn({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,s.as(qn).preference]}}))}))},t.prototype.clearWeeklyDoNotDisturb=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Kn({userId:t.userId}),[4,n.send(r)];case 1:return i.sent(),[2]}}))}))},t.prototype.getSnoozePeriod=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new fn({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,s.as(pn).snoozePeriod]}}))}))},t.prototype.setSnoozePeriod=function(e,t,s){return void 0===t&&(t=0),void 0===s&&(s=0),r(this,void 0,void 0,(function(){var r,o,a,c,u;return i(this,(function(i){switch(i.label){case 0:return oe(n("boolean",e)&&n("number",t)&&n("number",s)).throw($.invalidParameters),r=V.of(this._iid),o=r.sdkState,a=r.requestQueue,c=new vn({userId:o.userId,snoozeOn:e,startTs:t,endTs:s}),[4,a.send(c)];case 1:return u=i.sent(),[2,u.as(_n).snoozePeriod]}}))}))},t.prototype.getMyPushTokensByToken=function(e,t){return r(this,void 0,void 0,(function(){var r,s,o,a,c,u,d,l,h,f,p,v;return i(this,(function(i){switch(i.label){case 0:return oe(n("string",e)&&Pe(w,t)).throw($.invalidParameters),r=V.of(this._iid),s=r.sdkState,o=r.requestQueue,a=r.sessionManager,c=new tn({userId:s.userId,type:t,token:e}),[4,o.send(c)];case 1:u=i.sent(),d=u.as(nn).pushTokens;try{for(l=ee(d.deviceTokens),h=l.next();!h.done;h=l.next())f=h.value,a.setDeviceToken(d.type,f)}catch(e){p={error:e}}finally{try{h&&!h.done&&(v=l.return)&&v.call(l)}finally{if(p)throw p.error}}return[4,a.saveDeviceToken()];case 2:return i.sent(),[2,d]}}))}))},t.prototype.getPushTriggerOption=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new mn({userId:t.userId}),[4,n.send(r)];case 1:return[2,i.sent().as(yn).pushTriggerOption]}}))}))},t.prototype.setPushTriggerOption=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return oe(Pe(Oe,e)).throw($.invalidParameters),t=V.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new wn({userId:n.userId,pushTriggerOption:e}),[4,r.send(s)];case 1:return[2,i.sent().as(Cn).pushTriggerOption]}}))}))},t.prototype.getPushTemplate=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new In({userId:t.userId}),[4,n.send(r)];case 1:return[2,i.sent().as(Sn).name]}}))}))},t.prototype.setPushTemplate=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return oe(Pe(Ne,e)).throw($.invalidParameters),t=V.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new kn({userId:n.userId,templateName:e}),[4,r.send(s)];case 1:return[2,i.sent().as(En).name]}}))}))},t.prototype.blockUser=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o;return i(this,(function(i){switch(i.label){case 0:return oe(e instanceof y||n("string",e)).throw($.invalidParameters),t=V.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new gn({userId:r.userId,blockedUserId:e instanceof y?e.userId:e}),[4,s.send(o)];case 1:return i.sent(),[2]}}))}))},t.prototype.blockUserWithUserId=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.blockUser(e)]}))}))},t.prototype.unblockUser=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o;return i(this,(function(i){switch(i.label){case 0:return oe(e instanceof y||n("string",e)).throw($.invalidParameters),t=V.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new bn({userId:r.userId,unblockedUserId:e instanceof y?e.userId:e}),[4,s.send(o)];case 1:return i.sent(),[2]}}))}))},t.prototype.unblockUserWithUserId=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.unblockUser(e)]}))}))},t.prototype.getFriendChangeLogsByToken=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o,a;return i(this,(function(i){switch(i.label){case 0:return oe(n("string",e)).throw($.invalidParameters),t=V.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new Tn({userId:r.userId,token:e}),[4,s.send(o)];case 1:return a=i.sent(),[2,a.as(Dn).changelogs]}}))}))},t.prototype.getAllowFriendDiscovery=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Ln({userId:t.userId}),[4,n.send(r)];case 1:return s=i.sent(),[2,s.as(Rn).allowFriendDiscovery]}}))}))},t.prototype.setAllowFriendDiscovery=function(e){return r(this,void 0,void 0,(function(){var t,r,s,o;return i(this,(function(i){switch(i.label){case 0:return oe(n("boolean",e)).throw($.invalidParameters),t=V.of(this._iid),r=t.sdkState,s=t.requestQueue,o=new zn({userId:r.userId,allowFriendDiscovery:e}),[4,s.send(o)];case 1:return i.sent(),[2,e]}}))}))},t.prototype.uploadFriendDiscoveries=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o;return i(this,(function(i){switch(i.label){case 0:return t=V.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new Pn({userId:n.userId,discoveries:e}),[4,r.send(s)];case 1:return o=i.sent(),[2,o.as(An).friendDiscoveryRequestId]}}))}))},t.prototype.deleteFriendDiscovery=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.deleteFriendDiscoveries([e])]}))}))},t.prototype.deleteFriendDiscoveries=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return oe(Ee("string",e)).throw($.invalidParameters),t=V.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new Un({userId:n.userId,discoveryKeys:e}),[4,r.send(s)];case 1:return i.sent(),[2]}}))}))},t.prototype.addFriends=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o;return i(this,(function(i){switch(i.label){case 0:return oe(Ee("string",e)).throw($.invalidParameters),t=V.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new On({userId:n.userId,userIds:e}),[4,r.send(s)];case 1:return o=i.sent(),[2,o.as(Nn).users]}}))}))},t.prototype.deleteFriend=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.deleteFriends([e])]}))}))},t.prototype.deleteFriends=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s;return i(this,(function(i){switch(i.label){case 0:return oe(Ee("string",e)).throw($.invalidParameters),t=V.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new Mn({userId:n.userId,userIds:e}),[4,r.send(s)];case 1:return i.sent(),[2]}}))}))},t.prototype.getAllEmoji=function(){return r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return e=V.of(this._iid).requestQueue,t=new Vn,[4,e.send(t)];case 1:return n=r.sent(),[2,n.as(Hn).emojiContainer]}}))}))},t.prototype.getEmojiCategory=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=V.of(this._iid).requestQueue,n=new Wn({categoryId:e}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(Bn).emojiCategory]}}))}))},t.prototype.getEmoji=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=V.of(this._iid).requestQueue,n=new Gn({key:e}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(Jn).emoji]}}))}))},t.prototype.getUIKitConfiguration=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=V.of(this._iid),oe(e.hasExtension("sb_uikit")).throw($.notSupportedError),t=e.requestQueue,n=new Xn,[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(Yn).uikitConfiguration]}}))}))},t.prototype.getReportCategoryInfoList=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,V.of(this._iid).reportCategoryManager.categories()];case 1:return[2,e.sent()]}}))}))},t}();export{Ot as Emoji,Nt as EmojiCategory,Mt as EmojiContainer,er as default};