UNPKG

laudantiumculpa

Version:
1 lines 175 kB
var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var n=function(){return n=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};function i(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}function r(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))}function o(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,i=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}function c(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var u,l="4.11.2",d=function(){function e(){}return Object.defineProperty(e,"OS_VERSION",{get:function(){return"undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.replace(/,/g,"."):"noAgent"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"SDK_VERSION",{get:function(){return l},enumerable:!1,configurable:!0}),Object.defineProperty(e,"SDK_MAJOR_VERSION",{get:function(){return e.SDK_VERSION.split(".")[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e,"DEFAULT_MAX_UNREAD_COUNT_OF_SUPER_GROUP_CHANNEL",{get:function(){return 100},enumerable:!1,configurable:!0}),Object.defineProperty(e,"INTERNAL_CALL",{get:function(){return"ic"},enumerable:!1,configurable:!0}),e}();!function(e){e[e.NON_AUTHORIZED=400108]="NON_AUTHORIZED",e[e.INVALID_TOKEN=400111]="INVALID_TOKEN",e[e.NOT_FOUND_IN_DATABASE=400201]="NOT_FOUND_IN_DATABASE",e[e.USER_AUTH_DEACTIVATED=400300]="USER_AUTH_DEACTIVATED",e[e.USER_AUTH_DELETED_OR_NOT_FOUND=400301]="USER_AUTH_DELETED_OR_NOT_FOUND",e[e.SESSION_TOKEN_EXPIRED=400302]="SESSION_TOKEN_EXPIRED",e[e.APPLICATION_NOT_FOUND=400304]="APPLICATION_NOT_FOUND",e[e.SESSION_KEY_EXPIRED=400309]="SESSION_KEY_EXPIRED",e[e.SESSION_REVOKED=400310]="SESSION_REVOKED",e[e.INVALID_SESSION_TYPE=400312]="INVALID_SESSION_TYPE",e[e.STAT_UPLOAD_NOT_ALLOWED=403200]="STAT_UPLOAD_NOT_ALLOWED",e[e.NOT_SUPPORTED_PINNED_MESSAGE_IN_REVIEW_MESSAGE=400940]="NOT_SUPPORTED_PINNED_MESSAGE_IN_REVIEW_MESSAGE",e[e.INTERNAL_SERVER_ERROR=500901]="INTERNAL_SERVER_ERROR",e[e.RATE_LIMIT_EXCEEDED=500910]="RATE_LIMIT_EXCEEDED",e[e.INVALID_FORM_KEY=400111]="INVALID_FORM_KEY",e[e.INVALID_REQUIRED_FORM_VALUE=400105]="INVALID_REQUIRED_FORM_VALUE",e[e.UNKNOWN_SERVER_ERROR=900200]="UNKNOWN_SERVER_ERROR",e[e.NOT_SUPPORTED_FEATURE_IN_IN_REVIEW_MESSAGE=901500]="NOT_SUPPORTED_FEATURE_IN_IN_REVIEW_MESSAGE",e[e.ERR_DUPLICATED_DATA=400202]="ERR_DUPLICATED_DATA",e[e.DEBUG_MODE_REQUIRED=7e5]="DEBUG_MODE_REQUIRED",e[e.LOST_INSTANCE=700100]="LOST_INSTANCE",e[e.CONNECTION_RENEW=700102]="CONNECTION_RENEW",e[e.INVALID_CONNECTION_STATE_TRANSITION=700200]="INVALID_CONNECTION_STATE_TRANSITION",e[e.INVALID_COMMAND=700700]="INVALID_COMMAND",e[e.XMLHTTPREQUEST_NOT_SUPPORTED=700800]="XMLHTTPREQUEST_NOT_SUPPORTED",e[e.UNKNOWN_ERROR=77e4]="UNKNOWN_ERROR",e[e.INVALID_INITIALIZATION=800100]="INVALID_INITIALIZATION",e[e.CONNECTION_REQUIRED=800101]="CONNECTION_REQUIRED",e[e.CONNECTION_CANCELED=800102]="CONNECTION_CANCELED",e[e.INVALID_PARAMETER=800110]="INVALID_PARAMETER",e[e.NOT_SUPPORTED_ERROR=800111]="NOT_SUPPORTED_ERROR",e[e.NETWORK_ERROR=800120]="NETWORK_ERROR",e[e.NETWORK_ROUTING_ERROR=800121]="NETWORK_ROUTING_ERROR",e[e.MALFORMED_DATA=800130]="MALFORMED_DATA",e[e.MALFORMED_ERROR_DATA=800140]="MALFORMED_ERROR_DATA",e[e.WRONG_CHANNEL_TYPE=800150]="WRONG_CHANNEL_TYPE",e[e.MARK_AS_READ_RATE_LIMIT_EXCEEDED=800160]="MARK_AS_READ_RATE_LIMIT_EXCEEDED",e[e.QUERY_IN_PROGRESS=800170]="QUERY_IN_PROGRESS",e[e.ACK_TIMEOUT=800180]="ACK_TIMEOUT",e[e.LOGIN_TIMEOUT=800190]="LOGIN_TIMEOUT",e[e.WEBSOCKET_CONNECTION_CLOSED=800200]="WEBSOCKET_CONNECTION_CLOSED",e[e.WEBSOCKET_CONNECTION_FAILED=800210]="WEBSOCKET_CONNECTION_FAILED",e[e.REQUEST_FAILED=800220]="REQUEST_FAILED",e[e.FILE_UPLOAD_CANCEL_FAILED=800230]="FILE_UPLOAD_CANCEL_FAILED",e[e.REQUEST_CANCELED=800240]="REQUEST_CANCELED",e[e.REQUEST_DUPLICATED=800250]="REQUEST_DUPLICATED",e[e.FILE_SIZE_LIMIT_EXCEEDED=800260]="FILE_SIZE_LIMIT_EXCEEDED",e[e.SESSION_TOKEN_REQUEST_FAILED=800500]="SESSION_TOKEN_REQUEST_FAILED",e[e.SESSION_TOKEN_REFRESHED=800501]="SESSION_TOKEN_REFRESHED",e[e.SESSION_TOKEN_REFRESH_FAILED=800502]="SESSION_TOKEN_REFRESH_FAILED",e[e.COLLECTION_DISPOSED=800600]="COLLECTION_DISPOSED",e[e.DATABASE_ERROR=800700]="DATABASE_ERROR"}(u||(u={}));var h,_,f,p,E,v=function(e){return!(e instanceof g&&!e.shouldThrowOutside)},g=function(e){function n(t){var i=t.code,r=void 0===i?0:i,o=t.message,s=void 0===o?"":o,a=e.call(this,s)||this;return a.shouldThrowOutside=!1,a._detail="",a.name="SendbirdError",a.code=r,Object.setPrototypeOf(a,n.prototype),a}return t(n,e),Object.defineProperty(n.prototype,"detail",{get:function(){return this._detail},enumerable:!1,configurable:!0}),n.prototype.setDetail=function(e){this._detail=e},Object.defineProperty(n.prototype,"isInvalidTokenError",{get:function(){return this.code===u.INVALID_TOKEN},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isSessionExpiredError",{get:function(){return this.isSessionTokenExpiredError||this.isSessionKeyExpiredError},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isSessionTokenExpiredError",{get:function(){return this.code===u.SESSION_TOKEN_EXPIRED},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isSessionKeyExpiredError",{get:function(){return this.code===u.SESSION_KEY_EXPIRED},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isSessionInvalidatedError",{get:function(){return this.isSessionRevokedError||this.isUserAuthDeactivedError||this.isUserAuthDeletedOrNotFoundError},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isSessionRevokedError",{get:function(){return this.code===u.SESSION_REVOKED},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUserAuthDeactivedError",{get:function(){return this.code===u.USER_AUTH_DEACTIVATED},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUserAuthDeletedOrNotFoundError",{get:function(){return this.code===u.USER_AUTH_DELETED_OR_NOT_FOUND},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isNetworkError",{get:function(){return this.code===u.NETWORK_ERROR||this.code===u.NETWORK_ROUTING_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(n,"debugModeRequired",{get:function(){return new n({code:u.DEBUG_MODE_REQUIRED,message:"Cannot run this operation in production mode."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"lostInstance",{get:function(){return new n({code:u.LOST_INSTANCE,message:"Instance ID is missing. It should belong to an instance."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"invalidCommand",{get:function(){return new n({code:u.INVALID_COMMAND,message:"Cannot send invalid command."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"unknown",{get:function(){return new n({code:u.UNKNOWN_ERROR,message:"Unknown error occurred."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"connectionRenew",{get:function(){return new n({code:u.CONNECTION_RENEW,message:"Connection restarts."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"invalidConnectionStateTransition",{get:function(){return new n({code:u.INVALID_CONNECTION_STATE_TRANSITION,message:"Invalid connection state transition."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"xmlHttpRequestNotSupported",{get:function(){return new n({code:u.XMLHTTPREQUEST_NOT_SUPPORTED,message:"Cannot upload file. XMLHttpRequest is not defined in this environment."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"connectionRequired",{get:function(){return new n({code:u.CONNECTION_REQUIRED,message:"Connection is required."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"connectionCanceled",{get:function(){return new n({code:u.CONNECTION_CANCELED,message:"Connection is canceled."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"invalidParameters",{get:function(){return new n({code:u.INVALID_PARAMETER,message:"Invalid parameters."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"notSupportedError",{get:function(){return new n({code:u.NOT_SUPPORTED_ERROR,message:"Given parameters are not supported."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"channelTypeNotSupportedError",{get:function(){return new n({code:u.NOT_SUPPORTED_ERROR,message:"Called method is not supported in the current channel's channel type."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"networkError",{get:function(){return new n({code:u.NETWORK_ERROR,message:"There was a network error."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"markAsReadAllRateLimitExceeded",{get:function(){return new n({code:u.MARK_AS_READ_RATE_LIMIT_EXCEEDED,message:"markAsRead rate limit exceeded."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"queryInProgress",{get:function(){return new n({code:u.QUERY_IN_PROGRESS,message:"Query in progress."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"noAckTimeout",{get:function(){return new n({code:u.ACK_TIMEOUT,message:"Command received no ack."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"loginTimeout",{get:function(){return new n({code:u.LOGIN_TIMEOUT,message:"Connection timeout."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"connectionClosed",{get:function(){return new n({code:u.WEBSOCKET_CONNECTION_CLOSED,message:"Connection is closed. Please reconnect."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"requestFailed",{get:function(){return new n({code:u.REQUEST_FAILED,message:"Request failed."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"alreadyConnectedAsAnotherUser",{get:function(){return new n({code:u.REQUEST_FAILED,message:"Already logged in as a different user. Call disconnect() first."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"fileUploadCanceled",{get:function(){return new n({code:u.FILE_UPLOAD_CANCEL_FAILED,message:"File upload has been canceled."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"requestCanceled",{get:function(){return new n({code:u.REQUEST_CANCELED,message:"Request has been canceled."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"sessionTokenRefreshFailed",{get:function(){return new n({code:u.SESSION_TOKEN_REFRESH_FAILED,message:"Failed to refresh the session key."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"sessionTokenRequestFailed",{get:function(){return new n({code:u.SESSION_TOKEN_REQUEST_FAILED,message:"Failed to get the session token."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"databaseError",{get:function(){return new n({code:u.DATABASE_ERROR,message:"Database error."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"fileSizeLimitExceededError",{get:function(){return new n({code:u.FILE_SIZE_LIMIT_EXCEEDED,message:"File size exceeds the file size limit."})},enumerable:!1,configurable:!0}),n.prototype.throwOutside=function(){throw this.shouldThrowOutside=!0,this},n}(Error),b=[u.CONNECTION_REQUIRED,u.NETWORK_ERROR,u.ACK_TIMEOUT,u.WEBSOCKET_CONNECTION_CLOSED,u.WEBSOCKET_CONNECTION_FAILED,u.FILE_UPLOAD_CANCEL_FAILED,u.REQUEST_CANCELED,u.INTERNAL_SERVER_ERROR,u.RATE_LIMIT_EXCEEDED,u.UNKNOWN_SERVER_ERROR],m=[u.WEBSOCKET_CONNECTION_CLOSED,u.WEBSOCKET_CONNECTION_FAILED,u.CONNECTION_REQUIRED],y=function(e,t){if(e!==t){var i=n({},e),r=n({},t);return(!i.hasOwnProperty("messageId")||!r.hasOwnProperty("messageId")||i.messageId===r.messageId)&&((!i.hasOwnProperty("reqId")||!r.hasOwnProperty("reqId")||i.reqId===r.reqId)&&(i.hasOwnProperty("messageId")&&delete i.messageId,i.hasOwnProperty("reqId")&&delete i.reqId,r.hasOwnProperty("messageId")&&delete r.messageId,r.hasOwnProperty("reqId")&&delete r.reqId,JSON.stringify(i)===JSON.stringify(r)))}return!0},w=function(e,t,n){return void 0===n&&(n=!1),!(!n||!R(t))||("string"!=typeof e?"object"==typeof e?T(e,t):S(e,t):typeof t===e)},T=function(e,t,n){return void 0===n&&(n=!1),!(!n||!R(t))||Object.values(e).includes(t)},S=function(e,t){return t instanceof e},N=function(e,t,n){return void 0===n&&(n=!1),!(!n||!R(t))||Array.isArray(t)&&t.every((function(t){return w(e,t)}))},A=function(e,t){return void 0===t&&(t=!1),!(!t||!R(e))||"number"==typeof e&&13===e.toString().length},C=function(e){return e>0&&b.indexOf(e)>=0},O=function(e){return e>0&&m.indexOf(e)>=0},k=function(e,t){if(void 0===t&&(t=!1),t&&R(e))return!0;var n="object"==typeof e&&null!==e&&e.hasOwnProperty("name")&&"string"==typeof e.name&&e.hasOwnProperty("uri")&&"string"==typeof e.uri&&e.hasOwnProperty("type")&&"string"==typeof e.type;if(!n){if("undefined"!=typeof Blob)return e instanceof Blob;if("undefined"!=typeof File)return e instanceof File}return n},I=function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var n=c([],a(e),!1).sort(),i=c([],a(t),!1).sort(),r=0;r<n.length;++r)if(n[r]!==i[r])return!1;return!0},R=function(e){return null==e},D=function(){function e(e){var t=void 0===e?{}:e,n=t.useMemberInfoInMessage,i=void 0===n||n,r=t.typingIndicatorInvalidateTime,o=void 0===r?1e4:r,s=t.typingIndicatorThrottle,a=void 0===s?1e3:s,c=t.websocketResponseTimeout,u=void 0===c?1e4:c,l=t.websocketPayloadDecompression,d=void 0===l||l,h=t.sessionTokenRefreshTimeout,_=void 0===h?60:h;this._useMemberInfoInMessage=!0,this._typingIndicatorInvalidateTime=1e4,this._typingIndicatorThrottle=1e3,this._websocketResponseTimeout=1e4,this._sessionTokenRefreshTimeout=60,this._useMemberInfoInMessage=i,this._typingIndicatorInvalidateTime=o,this._typingIndicatorThrottle=a,this._websocketResponseTimeout=u,this._sessionTokenRefreshTimeout=_,this.websocketPayloadDecompression=d}return Object.defineProperty(e.prototype,"useMemberInfoInMessage",{get:function(){return this._useMemberInfoInMessage},set:function(e){w("boolean",e)&&(this._useMemberInfoInMessage=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typingIndicatorInvalidateTime",{get:function(){return this._typingIndicatorInvalidateTime},set:function(e){w("number",e)&&(this._typingIndicatorInvalidateTime=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typingIndicatorThrottle",{get:function(){return this._typingIndicatorThrottle},set:function(e){w("number",e)&&e>=1e3&&e<=9e3&&(this._typingIndicatorThrottle=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"websocketResponseTimeout",{get:function(){return this._websocketResponseTimeout},set:function(e){w("number",e)&&e>=5e3&&e<=3e4&&(this._websocketResponseTimeout=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionTokenRefreshTimeout",{get:function(){return this._sessionTokenRefreshTimeout},set:function(e){w("number",e)&&(e<60?e=60:e>1800&&(e=1800),this._sessionTokenRefreshTimeout=e)},enumerable:!1,configurable:!0}),e}(),L={encrypt:function(e){return e},decrypt:function(e){return e}},x=function(){function e(e){var t=e.store;this._preference=new Map,this._store=t}return e.prototype._savePreferenceKeys=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._store.set({key:this._keysAddress,value:c([],a(this._preference.keys()),!1)})];case 1:return e.sent(),[2]}}))}))},e.prototype.init=function(e,t){var n;return void 0===t&&(t=1),r(this,void 0,void 0,(function(){var i,r,a,c,u,l,d,h,_,f;return o(this,(function(o){switch(o.label){case 0:return this._version=t,this._keysAddress=e,i="".concat(e,".metadata.version"),[4,this._store.get(i)];case 1:return r=o.sent(),[4,this._store.get(e)];case 2:return a=null!==(n=o.sent())&&void 0!==n?n:[],!r||r.version<this._version?[4,this._resetPreferenceData(a,i)]:[3,4];case 3:return o.sent(),[3,11];case 4:o.trys.push([4,9,10,11]),c=s(a),u=c.next(),o.label=5;case 5:return u.done?[3,8]:(l=u.value,[4,this._store.get(l)]);case 6:(d=o.sent())&&this._preference.set(l,d),o.label=7;case 7:return u=c.next(),[3,5];case 8:return[3,11];case 9:return h=o.sent(),_={error:h},[3,11];case 10:try{u&&!u.done&&(f=c.return)&&f.call(c)}finally{if(_)throw _.error}return[7];case 11:return[2]}}))}))},e.prototype._resetPreferenceData=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return this._preference=new Map,[4,this._store.removeMany(e)];case 1:return n.sent(),[4,this._store.set({key:t,value:{version:this._version}})];case 2:return n.sent(),[2]}}))}))},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this._preference.get(e)]}))}))},e.prototype.set=function(e,t){return r(this,void 0,void 0,(function(){var n;return o(this,(function(i){switch(i.label){case 0:return n=!this._preference.has(e),[4,this._store.set({key:e,value:t})];case 1:return i.sent(),this._preference.set(e,t),n?[4,this._savePreferenceKeys()]:[3,3];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this._store.remove(e)];case 1:return t.sent(),this._preference.delete(e),[4,this._savePreferenceKeys()];case 2:return t.sent(),[2]}}))}))},e.prototype.clear=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this._store.removeMany(c([],a(this._preference.keys()),!1))];case 1:return e.sent(),this._preference.clear(),[4,this._savePreferenceKeys()];case 2:return e.sent(),[2]}}))}))},e}(),U=function(){function e(e){var t=e.encryption,n=e.store,i=e.localCacheEnabled,r=e.localCacheConfig;this.store=n,this.preference=new x({store:n}),this.encryption=null!=t?t:L,this.localCacheEnabled=i,this.localCacheConfig=r}return e.prototype.replaceStore=function(e){this.store=e,this.preference=new x({store:e})},e}();!function(e){e.SUCCESS="success",e.PENDING="pending",e.ERROR="error"}(h||(h={})),function(e){e.DEFAULT="default",e.ALL="all",e.MENTION_ONLY="mention_only",e.OFF="off"}(_||(_={})),function(e){e.FCM="gcm",e.APNS="apns",e.UNKNOWN="unknown"}(f||(f={})),function(e){e.ALTERNATIVE="alternative",e.DEFAULT="default"}(p||(p={})),function(e){e.CUSTOM="custom",e.MESSAGE_COLLECTION_ACCESSED_AT="messagecollection_accessed_at"}(E||(E={}));var P,M=function(){function e(e){var t=e.channel,n=e.cachedMessageCount;this._cachedMessageCount=0,this._channel=t,this._cachedMessageCount=n}return Object.defineProperty(e.prototype,"channel",{get:function(){return this._channel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cachedMessageCount",{get:function(){return this._cachedMessageCount},enumerable:!1,configurable:!0}),e}(),F=function(){function e(e){var t=void 0===e?{}:e,n=t.maxSize,i=void 0===n?256:n,r=t.clearOrder,o=void 0===r?E.MESSAGE_COLLECTION_ACCESSED_AT:r,s=t.customClearOrderComparator,a=t.enableAutoResend,c=void 0===a||a;this._clearOrderComparatorUseMessageCollectionAccessedAt=function(e,t){return e.channel.messageCollectionLastAccessedAt===t.channel.messageCollectionLastAccessedAt?e.channel.lastMessage&&!t.channel.lastMessage?1:!e.channel.lastMessage&&t.channel.lastMessage?-1:e.channel.lastMessage||t.channel.lastMessage?e.channel.lastMessage.createdAt-t.channel.lastMessage.createdAt:0:e.channel.messageCollectionLastAccessedAt>t.channel.messageCollectionLastAccessedAt?1:-1},this._maxSize=Math.max(i,64),s?(this._clearOrder=o,this._customClearOrderComparator=s):this._clearOrder=E.MESSAGE_COLLECTION_ACCESSED_AT,this._enableAutoResend=c}return Object.defineProperty(e.prototype,"maxSize",{get:function(){return this._maxSize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clearOrder",{get:function(){return this._clearOrder},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clearOrderComparator",{get:function(){var e;return this._clearOrder===E.MESSAGE_COLLECTION_ACCESSED_AT?this._clearOrderComparatorUseMessageCollectionAccessedAt:null!==(e=this._customClearOrderComparator)&&void 0!==e?e:this._clearOrderComparatorUseMessageCollectionAccessedAt},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enableAutoResend",{get:function(){return this._enableAutoResend},enumerable:!1,configurable:!0}),e}();!function(e){e.FEED="feed",e.CHAT="chat"}(P||(P={}));var z,V,H,G,q,j,K,B,W,Q,Z,Y,X,J=function(){function e(){this.isRefreshing=!1}return Object.defineProperty(e.prototype,"hasSession",{get:function(){return!!this.sessionKey},enumerable:!1,configurable:!0}),e.prototype.clear=function(){this.authToken=void 0,this.sessionKey=void 0,this.services=[]},e}(),$=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))},ee=function(){function e(e){var t=e.container;this._container={},this._container=t,this.key=$()}return e.prototype._register=function(e,t,n){var i;return e in this._container||(this._container[e]=new Map),null===(i=this._container[e])||void 0===i||i.set(this.key,{occurence:t,handler:n}),this},e.prototype.on=function(e,t){return this._register(e,-1,t)},e.prototype.once=function(e,t){return this._register(e,1,t)},e.prototype.close=function(){var e;for(var t in this._container)null===(e=this._container[t])||void 0===e||e.delete(this.key)},e}(),te=function(){function e(){this._container={}}return e.prototype.on=function(e,t){return new ee({container:this._container}).on(e,t)},e.prototype.once=function(e,t){return new ee({container:this._container}).once(e,t)},e.prototype.dispatch=function(e,t){var n,i,r=this._container[e];if(r){var o=[];try{for(var a=s(r.keys()),c=a.next();!c.done;c=a.next()){var u=c.value,l=r.get(u);l.handler(t),l.occurence>0&&(l.occurence--,0===l.occurence&&o.push(u))}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}o.forEach((function(e){return r.delete(e)}))}},e}(),ne=function(){function e(){this._dispatcher=new te}return e.prototype.on=function(e){return this._dispatcher.on("event",e)},e.prototype.once=function(e){return this._dispatcher.once("event",e)},e.prototype.dispatch=function(e){this._dispatcher.dispatch("event",e)},e}(),ie=function(){},re=function(e){var t={};return e&&Object.keys(e).forEach((function(n){void 0===e[n]||Number.isNaN(e[n])||null===e[n]||(t[n]=e[n])})),t},oe=function(e){if(null!=e){if("object"==typeof e){if(Array.isArray(e)){var t=c([],a(e),!1);for(var n in t)t[n]=oe(t[n]);return t}for(var i in e)null===e[i]&&delete e[i];return e}return e}};!function(e){e.BASE="base",e.GROUP="group",e.OPEN="open",e.FEED="feed"}(z||(z={})),function(e){e.OPERATOR="operator",e.NONE="none"}(V||(V={})),function(e){e.MUTED="muted",e.UNMUTED="unmuted"}(H||(H={})),function(e){e.BASE="base",e.USER="user",e.FILE="file",e.ADMIN="admin"}(G||(G={})),function(e){e.ALL="",e.USER="MESG",e.FILE="FILE",e.ADMIN="ADMM"}(q||(q={})),function(e){e.USER="MESG",e.FILE="FILE",e.ADMIN="ADMM"}(j||(j={})),function(e){e.USERS="users",e.CHANNEL="channel"}(K||(K={})),function(e){e.ALL="all",e.NONE="none",e.ONLY_REPLY_TO_CHANNEL="only_reply_to_channel"}(B||(B={})),function(e){e.DEFAULT="default",e.SUPPRESS="suppress"}(W||(W={})),function(e){e.PENDING="pending",e.SCHEDULED="scheduled",e.SUCCEEDED="succeeded",e.FAILED="failed",e.CANCELED="canceled"}(Q||(Q={})),function(e){e.INREVIEW="InReview",e.APPROVED="Approved"}(Z||(Z={})),function(e){e.HIGH="high",e.NORMAL="normal",e.LOW="low"}(Y||(Y={})),function(e){e.CREATED_AT="created_at",e.UPDATED_AT="updated_at"}(X||(X={}));var se,ae="v3",ce="/".concat(ae,"/users"),ue="/".concat(ae,"/storage/file"),le="/".concat(ae,"/group_channels"),de="/".concat(ae,"/sdk/group_channels"),he="/".concat(ae,"/open_channels"),_e="/".concat(ae,"/sdk/open_channels"),fe="/".concat(ae,"/search"),pe="/".concat(ae,"/report"),Ee="/".concat(ae,"/emojis"),ve="/".concat(ae,"/emoji_categories"),ge="/".concat(ae,"/polls"),be="/".concat(ae,"/scheduled_messages"),me="/".concat(ae,"/sdk/ui_kit/configuration"),ye="/".concat(ae,"/sdk/statistics"),we="/".concat(ae,"/notifications"),Te="/".concat(ae,"/message_templates"),Se=function(e){switch(e){case z.FEED:case z.GROUP:return le;case z.OPEN:return he;default:return null}},Ne=function(e){switch(e){case z.GROUP:return"".concat(pe,"/group_channels");case z.OPEN:return"".concat(pe,"/open_channels");default:return null}},Ae=function(e,t,n){var i,r;switch(e){case K.CHANNEL:return!0;case K.USERS:if(t)try{for(var o=s(t),a=o.next();!a.done;a=o.next()){if(a.value===n)return!0}}catch(e){i={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}}return!1},Ce=function(e,t,n){var i,r,o,s,a=Ae(null!==(i=e.mentionType)&&void 0!==i?i:null,null!==(r=e.mentionedUserIds)&&void 0!==r?r:[],n),c=Ae(null!==(o=t.mentionType)&&void 0!==o?o:null,null!==(s=t.mentionedUserIds)&&void 0!==s?s:[],n);return!a&&c?1:a&&!c?-1:0},Oe=function(e,t,n){var i,r=t||new FormData;for(var o in e)if(e.hasOwnProperty(o)){var s=e[o],a=n?"".concat(n,"[").concat(o,"]"):o;k(s)?r.append(a,s,null!==(i=s.name)&&void 0!==i?i:"filename"):"object"!=typeof s||null===s||Array.isArray(s)||s instanceof Blob?r.append(a,String(s)):r=Oe(s,r,a)}return r};!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"}(se||(se={}));var ke,Ie=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.params={},t.requireAuth=!0,t.headers={},t.requestId=$(),t}return t(n,e),n.prototype.encodeParams=function(e){var t=this;return null==e||""===e?encodeURIComponent(""):Array.isArray(e)?e.map((function(e){return t.encodeParams(e)})).join(","):"object"==typeof e?encodeURIComponent(JSON.stringify(e)):encodeURIComponent(String(e))},Object.defineProperty(n.prototype,"query",{get:function(){var e=this,t=re(this.params);return"?".concat(Object.keys(t).map((function(n){return"".concat(encodeURIComponent(n),"=").concat(e.encodeParams(t[n]))})).join("&"))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"payload",{get:function(){var e=re(this.params);return Object.keys(e).some((function(t){return k(e[t])}))?Oe(e):JSON.stringify(e)},enumerable:!1,configurable:!0}),n}(ie),Re=function(e){function i(t,n){var i=e.call(this)||this;return i._iid=t,i._payload=n,i}return t(i,e),Object.defineProperty(i.prototype,"payload",{get:function(){return n({},this._payload)},enumerable:!1,configurable:!0}),i.prototype.as=function(e){return new e(this._iid,this.payload)},i}(ie),De=function(e){function n(t){var n=e.call(this)||this;return n.requestId=t,n}return t(n,e),n}(ie),Le=function(e){function n(t){var n=t.expires_in,i=t.reason,r=void 0===i?u.SESSION_KEY_EXPIRED:i,o=e.call(this)||this;switch(o.expiresIn=null!=n?n:0,r){case u.SESSION_KEY_EXPIRED:case u.SESSION_TOKEN_EXPIRED:case u.SESSION_REVOKED:case u.USER_AUTH_DEACTIVATED:case u.USER_AUTH_DELETED_OR_NOT_FOUND:o.error=new g({code:r})}return o}return t(n,e),Object.defineProperty(n.prototype,"invalidateSessionToken",{get:function(){var e;return!!(null===(e=this.error)||void 0===e?void 0:e.isSessionTokenExpiredError)},enumerable:!1,configurable:!0}),n}(ie),xe=function(e){function n(t,n,i,r){void 0===r&&(r="");var o,s=this;return(s=e.call(this)||this)._iid=t,s.code=n,s.payload=i,s.requestId=null!==(o=i.req_id)&&void 0!==o?o:r,s}return t(n,e),n.createFromRawMessage=function(e,t){var i=t.substring(0,4),r={};try{r=JSON.parse(t.substring(4))}catch(e){i="NOOP"}finally{return new n(e,i,r)}},n.prototype.convertToMessage=function(){return"".concat(this.code).concat(JSON.stringify(this.payload),"\n")},n.prototype.as=function(e){return new e(this._iid,this.code,this.payload)},n}(ie),Ue=function(e){function n(t){var n,i=t.code,r=t.ackRequired,o=t.payload,s=void 0===o?{}:o,a=this;return(a=e.call(this)||this).code=i,a.payload=s,a.requestId=null!==(n=a.payload.req_id)&&void 0!==n?n:$(),a.ackRequired=r,a.payload.req_id=a.requestId,a}return t(n,e),n.prototype.convertToMessage=function(){return"".concat(this.code).concat(JSON.stringify(this.payload),"\n")},n}(ie),Pe=function(e){function n(t){var n=t.userId,i=t.authToken,r=t.services,o=t.expiringSession,s=void 0===o||o,a=e.call(this)||this;return a.path="".concat(ce,"/").concat(n,"/session_key"),a.method=se.POST,a.params=re({token:i,services:r,expiring_session:!!s}),a.requireAuth=!1,a}return t(n,e),n}(Ie),Me=function(e){function n(t){var n=t.authToken,i=t.expiringSession,r=void 0===i||i,o=t.requestId,s=void 0===o?void 0:o;return e.call(this,{code:"LOGI",payload:{token:n,expiring_session:r?1:0,req_id:s},ackRequired:!0})||this}return t(n,e),n}(Ue),Fe=function(e){function n(t,n){var i=e.call(this,t,n)||this,r=n.key,o=n.expires_at,s=n.services;return i.key=r,i.expiresAt=o,i.services=s,i}return t(n,e),n}(Re),ze=function(e){function n(t,n,i){var r,o=this;return(o=e.call(this,t,"LOGI",i)||this).error=null,o.newKey=null,o.newKey=null!==(r=i.new_key)&&void 0!==r?r:null,o.error=i.error?new g(i):null,o}return t(n,e),n}(xe),Ve=function(e){function n(t){var n=e.call(this)||this;return n.statLog=t,n}return t(n,e),n}(ie),He=function(e){function n(t){var n=t.request,i=t.deferred,r=t.error,o=void 0===r?g.requestFailed:r,s=e.call(this)||this;return s.request=n,s.deferred=i,s.error=o,s}return t(n,e),n}(ie);!function(e){e.FEATURE_LOCALCACHE="feature:local_cache",e.FEATURE_LOCALCACHE_EVENT="feature:local_cache_event",e.NOTIFICATION="noti:stats",e.WEBSOCKET_CONNECT="ws:connect",e.API_RESULT="api:result"}(ke||(ke={}));var Ge,qe,je,Ke=function(){function e(e){var t=e.type,n=e.data,i=e.ts,r=void 0===i?Date.now():i;this.type=t,this.createdAt=r,this.data=n}return e.payloadify=function(e){return re({stat_type:e.type,ts:e.createdAt,data:re(e.data)})},e}(),Be=function(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"==navigator.product},We=function(){return!("undefined"==typeof navigator||!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Windows Phone/i.test(navigator.userAgent))};!function(e){e.CHAT="chat",e.CALLS="calls",e.DESK="desk",e.LIVE="live",e.UIKIT_CHAT="uikit-chat",e.UIKIT_LIVE="uikit-live"}(Ge||(Ge={})),function(e){e.ANDROID="android",e.IOS="ios",e.JS="js",e.UNREAL="unreal",e.UNITY="unity",e.REACT_NATIVE="react-native",e.FLUTTER="flutter"}(qe||(qe={})),function(e){e.ANDROID="android",e.IOS="ios",e.WEB="web",e.MOBILE_WEB="mobile_web",e.WINDOWS="windows"}(je||(je={}));var Qe="^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",Ze=function(){function e(){}return e.sendbirdSdkUserAgentWithExtension=function(e){var t=Be()?qe.REACT_NATIVE:qe.JS,i={main_sdk_info:"chat/".concat(t,"/").concat(d.SDK_VERSION),device_os_platform:We()?"mobile-web":"web",os_version:d.OS_VERSION};if(e){var r=e.sendbirdExtensions,o=e.deviceOS,s=e.customData,c=void 0===s?{}:s;o.version&&(i.os_version=o.version),o.platform&&(i.device_os_platform=o.platform),r.length>0&&(i.extension_sdk_info=r.map((function(e){var t=e.product,n=e.platform,i=e.version;return"".concat(t,"/").concat(n,"/").concat(i)})).join(",")),Object.keys(i).forEach((function(e){return delete c[e]})),Object.keys(c).length>0&&(i=n(n({},i),c))}return Object.entries(i).map((function(e){var t=a(e,2),n=t[0],i=t[1];return"".concat(n,"=").concat(i)})).join("&")},e.userAgentWithExtension=function(e){var t=Be()?"reactnative":"JS",n=e.sb_syncmanager?"s".concat(e.sb_syncmanager):"",i=e.sb_uikit?"u".concat(e.sb_uikit):"",r=e["device-os-platform"]?"o".concat(e["device-os-platform"]):We()?"omobile-web":"oweb";return"".concat(t,"/c").concat(d.SDK_VERSION,"/").concat(n,"/").concat(i,"/").concat(r)},e}(),Ye=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=function(e){n(e)}}))},Xe=function(e){function n(t){var n=e.call(this)||this;return n.requestId=t.requestId,n}return t(n,e),n}(ie),Je=function(){function e(e,t){var n=t.session,i=t.sdkState,r=t.dispatcher,o=t.logger,s=t.useFetchCompat,a=void 0!==s&&s,c=this;this._abortControl=new Map,this._shouldImportFetchCompat=!1,this._iid=e,this._session=n,this._sdkState=i,this._dispatcher=r,this._dispatcher.on((function(e){e instanceof De&&c.cancel(e.requestId)})),this._logger=o,this._shouldImportFetchCompat=a}return e.prototype._createHeader=function(e,t){var i=this._sdkState,r=i.appId,o=i.appVersion,s=i.sendbirdRuntimeEnvironment,a=n(n({},e.headers),{SendBird:"JS,".concat(d.OS_VERSION,",").concat(d.SDK_VERSION,",").concat(r).concat(o?",".concat(o):""),"SB-User-Agent":Ze.userAgentWithExtension(this._sdkState.extensions),"Request-Sent-Timestamp":Date.now().toString(),"SB-SDK-User-Agent":Ze.sendbirdSdkUserAgentWithExtension(s)});return t||(a["Content-Type"]="application/json; charset=utf-8"),e.requireAuth&&this._session.hasSession&&(a["Session-Key"]=this._session.sessionKey),this._session&&this._session.authToken&&(a["App-Id"]=r,a["Access-Token"]=this._session.authToken),a},e.prototype._statLogApiResult=function(e,t,n){this._dispatcher.dispatch(new Ve(new Ke({type:ke.API_RESULT,data:{endpoint:e.path,method:e.method,success:!n,latency:Date.now()-t,error_code:null==n?void 0:n.code,error_description:null==n?void 0:n.message}})))},e.prototype.send=function(e){return r(this,void 0,void 0,(function(){var t,n,i,r,s,a,c,l,d,h,_,f,p,E,v,b,m,y,w,T;return o(this,(function(o){switch(o.label){case 0:t=e.path,n=e.method,i=e.uploadProgressHandler,r=![se.GET,se.DELETE].includes(n),s=this._sdkState.api,a="".concat(s.host).concat(t).concat(r?"":e.query),c=r?e.payload:null,l=this._createHeader(e,c instanceof FormData?c:void 0),d=new AbortController,h=d.signal,this._abortControl.set(e.requestId,d),_=Date.now(),o.label=1;case 1:return o.trys.push([1,13,,14]),i?[4,import("./__bundle-aece11ae.js")]:[3,6];case 2:f=o.sent().xmlHttpRequest,o.label=3;case 3:return o.trys.push([3,5,,6]),[4,f(this._iid,{requestId:e.requestId,method:e.method,url:a,headers:l,data:null!=c?c:void 0,uploadProgressHandler:i})];case 4:return p=o.sent(),this._logger.debug("receive api response",e.requestId),this._statLogApiResult(e,_),[2,p];case 5:if(!((E=o.sent())instanceof g&&E.code===u.XMLHTTPREQUEST_NOT_SUPPORTED))throw E;return this._logger.debug("XMLHttpRequest is not available in this environment. progressHandler is ignored."),[3,6];case 6:return this._shouldImportFetchCompat&&(this._shouldImportFetchCompat=!1,("undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{fetch:null}).fetch=null),"undefined"!=typeof AbortController?[3,8]:[4,import("./__bundle-2aa1a987.js")];case 7:o.sent(),o.label=8;case 8:return"function"==typeof fetch?[3,10]:[4,import("./__bundle-ba2b9764.js")];case 9:o.sent(),o.label=10;case 10:return[4,fetch(a,{method:n,body:c,headers:l,signal:h})];case 11:return[4,(v=o.sent()).json()];case 12:if(b=o.sent(),v.ok||v.redirected)return this._logger.debug("receive api response",e.requestId),this._statLogApiResult(e,_),[2,new Re(this._iid,b)];if(b){if((m=new g(b)).isSessionExpiredError){if(this._dispatcher.dispatch(new Le({reason:m.code})),!(e instanceof Pe))return y=new Ye,this._dispatcher.dispatch(new He({request:e,deferred:y,error:m})),[2,y.promise];throw m}throw m.isSessionInvalidatedError?(this._dispatcher.dispatch(new Le({reason:m.code})),m):m}throw g.requestFailed;case 13:throw w=o.sent(),this._statLogApiResult(e,_,w),w instanceof g?(this._logger.debug("fail api request",w),w):"AbortError"===(null==w?void 0:w.name)?g.requestCanceled:(T=g.networkError,this._logger.debug("fail api request",T),T);case 14:return[2]}}))}))},e.prototype.cancel=function(e){this._abortControl.has(e)&&(this._abortControl.get(e).abort(),this._abortControl.delete(e));this._dispatcher.dispatch(new Xe({requestId:e}))},e.prototype.cancelAll=function(){var e,t;try{for(var n=s(this._abortControl.values()),i=n.next();!i.done;i=n.next()){i.value.abort()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this._abortControl.clear(),this._dispatcher.dispatch(new Xe({}))},e}(),$e=function(){};function et(e){let t=e.length;for(;--t>=0;)e[t]=0}const tt=256,nt=286,it=30,rt=15,ot=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),st=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),at=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ct=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ut=new Array(576);et(ut);const lt=new Array(60);et(lt);const dt=new Array(512);et(dt);const ht=new Array(256);et(ht);const _t=new Array(29);et(_t);const ft=new Array(it);function pt(e,t,n,i,r){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=e&&e.length}let Et,vt,gt;function bt(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}et(ft);const mt=e=>e<256?dt[e]:dt[256+(e>>>7)],yt=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},wt=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,yt(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Tt=(e,t,n)=>{wt(e,n[2*t],n[2*t+1])},St=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},Nt=(e,t,n)=>{const i=new Array(16);let r,o,s=0;for(r=1;r<=rt;r++)s=s+n[r-1]<<1,i[r]=s;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=St(i[t]++,t))}},At=e=>{let t;for(t=0;t<nt;t++)e.dyn_ltree[2*t]=0;for(t=0;t<it;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Ct=e=>{e.bi_valid>8?yt(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Ot=(e,t,n,i)=>{const r=2*t,o=2*n;return e[r]<e[o]||e[r]===e[o]&&i[t]<=i[n]},kt=(e,t,n)=>{const i=e.heap[n];let r=n<<1;for(;r<=e.heap_len&&(r<e.heap_len&&Ot(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!Ot(t,i,e.heap[r],e.depth));)e.heap[n]=e.heap[r],n=r,r<<=1;e.heap[n]=i},It=(e,t,n)=>{let i,r,o,s,a=0;if(0!==e.sym_next)do{i=255&e.pending_buf[e.sym_buf+a++],i+=(255&e.pending_buf[e.sym_buf+a++])<<8,r=e.pending_buf[e.sym_buf+a++],0===i?Tt(e,r,t):(o=ht[r],Tt(e,o+tt+1,t),s=ot[o],0!==s&&(r-=_t[o],wt(e,r,s)),i--,o=mt(i),Tt(e,o,n),s=st[o],0!==s&&(i-=ft[o],wt(e,i,s)))}while(a<e.sym_next);Tt(e,256,t)},Rt=(e,t)=>{const n=t.dyn_tree,i=t.stat_desc.static_tree,r=t.stat_desc.has_stree,o=t.stat_desc.elems;let s,a,c,u=-1;for(e.heap_len=0,e.heap_max=573,s=0;s<o;s++)0!==n[2*s]?(e.heap[++e.heap_len]=u=s,e.depth[s]=0):n[2*s+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=u<2?++u:0,n[2*c]=1,e.depth[c]=0,e.opt_len--,r&&(e.static_len-=i[2*c+1]);for(t.max_code=u,s=e.heap_len>>1;s>=1;s--)kt(e,n,s);c=o;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],kt(e,n,1),a=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=a,n[2*c]=n[2*s]+n[2*a],e.depth[c]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1,n[2*s+1]=n[2*a+1]=c,e.heap[1]=c++,kt(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,i=t.max_code,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,l,d,h,_,f,p=0;for(h=0;h<=rt;h++)e.bl_count[h]=0;for(n[2*e.heap[e.heap_max]+1]=0,u=e.heap_max+1;u<573;u++)l=e.heap[u],h=n[2*n[2*l+1]+1]+1,h>c&&(h=c,p++),n[2*l+1]=h,l>i||(e.bl_count[h]++,_=0,l>=a&&(_=s[l-a]),f=n[2*l],e.opt_len+=f*(h+_),o&&(e.static_len+=f*(r[2*l+1]+_)));if(0!==p){do{for(h=c-1;0===e.bl_count[h];)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[c]--,p-=2}while(p>0);for(h=c;0!==h;h--)for(l=e.bl_count[h];0!==l;)d=e.heap[--u],d>i||(n[2*d+1]!==h&&(e.opt_len+=(h-n[2*d+1])*n[2*d],n[2*d+1]=h),l--)}})(e,t),Nt(n,u,e.bl_count)},Dt=(e,t,n)=>{let i,r,o=-1,s=t[1],a=0,c=7,u=4;for(0===s&&(c=138,u=3),t[2*(n+1)+1]=65535,i=0;i<=n;i++)r=s,s=t[2*(i+1)+1],++a<c&&r===s||(a<u?e.bl_tree[2*r]+=a:0!==r?(r!==o&&e.bl_tree[2*r]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,o=r,0===s?(c=138,u=3):r===s?(c=6,u=3):(c=7,u=4))},Lt=(e,t,n)=>{let i,r,o=-1,s=t[1],a=0,c=7,u=4;for(0===s&&(c=138,u=3),i=0;i<=n;i++)if(r=s,s=t[2*(i+1)+1],!(++a<c&&r===s)){if(a<u)do{Tt(e,r,e.bl_tree)}while(0!=--a);else 0!==r?(r!==o&&(Tt(e,r,e.bl_tree),a--),Tt(e,16,e.bl_tree),wt(e,a-3,2)):a<=10?(Tt(e,17,e.bl_tree),wt(e,a-3,3)):(Tt(e,18,e.bl_tree),wt(e,a-11,7));a=0,o=r,0===s?(c=138,u=3):r===s?(c=6,u=3):(c=7,u=4)}};let xt=!1;const Ut=(e,t,n,i)=>{wt(e,0+(i?1:0),3),Ct(e),yt(e,n),yt(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};var Pt=(e,t,n,i)=>{let r,o,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<tt;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),Rt(e,e.l_desc),Rt(e,e.d_desc),s=(e=>{let t;for(Dt(e,e.dyn_ltree,e.l_desc.max_code),Dt(e,e.dyn_dtree,e.d_desc.max_code),Rt(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*ct[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),r=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=r&&(r=o)):r=o=n+5,n+4<=r&&-1!==t?Ut(e,t,n,i):4===e.strategy||o===r?(wt(e,2+(i?1:0),3),It(e,ut,lt)):(wt(e,4+(i?1:0),3),((e,t,n,i)=>{let r;for(wt(e,t-257,5),wt(e,n-1,5),wt(e,i-4,4),r=0;r<i;r++)wt(e,e.bl_tree[2*ct[r]+1],3);Lt(e,e.dyn_ltree,t-1),Lt(e,e.dyn_dtree,n-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),It(e,e.dyn_ltree,e.dyn_dtree)),At(e),i&&Ct(e)},Mt={_tr_init:e=>{xt||((()=>{let e,t,n,i,r;const o=new Array(16);for(n=0,i=0;i<28;i++)for(_t[i]=n,e=0;e<1<<ot[i];e++)ht[n++]=i;for(ht[n-1]=i,r=0,i=0;i<16;i++)for(ft[i]=r,e=0;e<1<<st[i];e++)dt[r++]=i;for(r>>=7;i<it;i++)for(ft[i]=r<<7,e=0;e<1<<st[i]-7;e++)dt[256+r++]=i;for(t=0;t<=rt;t++)o[t]=0;for(e=0;e<=143;)ut[2*e+1]=8,e++,o[8]++;for(;e<=255;)ut[2*e+1]=9,e++,o[9]++;for(;e<=279;)ut[2*e+1]=7,e++,o[7]++;for(;e<=287;)ut[2*e+1]=8,e++,o[8]++;for(Nt(ut,287,o),e=0;e<it;e++)lt[2*e+1]=5,lt[2*e]=St(e,5);Et=new pt(ut,ot,257,nt,rt),vt=new pt(lt,st,0,it,rt),gt=new pt(new Array(0),at,0,19,7)})(),xt=!0),e.l_desc=new bt(e.dyn_ltree,Et),e.d_desc=new bt(e.dyn_dtree,vt),e.bl_desc=new bt(e.bl_tree,gt),e.bi_buf=0,e.bi_valid=0,At(e)},_tr_stored_block:Ut,_tr_flush_block:Pt,_tr_tally:(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(ht[n]+tt+1)]++,e.dyn_dtree[2*mt(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{wt(e,2,3),Tt(e,256,ut),(e=>{16===e.bi_valid?(yt(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var Ft=(e,t,n,i)=>{let r=65535&e|0,o=e>>>16&65535|0,s=0;for(;0!==n;){s=n>2e3?2e3:n,n-=s;do{r=r+t[i++]|0,o=o+r|0}while(--s);r%=65521,o%=65521}return r|o<<16|0};const zt=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var Vt=(e,t,n,i)=>{const r=zt,o=i+n;e^=-1;for(let n=i;n<o;n++)e=e>>>8^r[255&(e^t[n])];return-1^e},Ht={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Gt={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:qt,_tr_stored_block:jt,_tr_flush_block:Kt,_tr_tally:Bt,_tr_align:Wt}=Mt,{Z_NO_FLUSH:Qt,Z_PARTIAL_FLUSH:Zt,Z_FULL_FLUSH:Yt,Z_FINISH:Xt,Z_BLOCK:Jt,Z_OK:$t,Z_STREAM_END:en,Z_STREAM_ERROR:tn,Z_DATA_ERROR:nn,Z_BUF_ERROR:rn,Z_DEFAULT_COMPRESSION:on,Z_FILTERED:sn,Z_HUFFMAN_ONLY:an,Z_RLE:cn,Z_FIXED:un,Z_DEFAULT_STRATEGY:ln,Z_UNKNOWN:dn,Z_DEFLATED:hn}=Gt,_n=258,fn=262,pn=42,En=113,vn=666,gn=(e,t)=>(e.msg=Ht[t],t),bn=e=>2*e-(e>4?9:0),mn=e=>{let t=e.length;for(;--t>=0;)e[t]=0},yn=e=>{let t,n,i,r=e.w_size;t=e.hash_size,i=t;do{n=e.head[--i],e.head[i]=n>=r?n-r:0}while(--t);t=r,i=t;do{n=e.prev[--i],e.prev[i]=n>=r?n-r:0}while(--t)};let wn=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const Tn=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},Sn=(e,t)=>{Kt(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Tn(e.strm)},Nn=(e,t)=>{e.pending_buf[e.pending++]=t},An=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Cn=(e,t,n,i)=>{let r=e.avail_in;return r>i&&(r=i),0===r?0:(e.avail_in-=r,t.set(e.input.subarray(e.next_in,e.next_in+r),n),1===e.state.wrap?e.adler=Ft(e.adler,t,r,n):2===e.state.wrap&&(e.adler=Vt(e.adler,t,r,n)),e.next_in+=r,e.total_in+=r,r)},On=(e,t)=>{let n,i,r=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match;const c=e.strstart>e.w_size-fn?e.strstart-(e.w_size-fn):0,u=e.window,l=e.w_mask,d=e.prev,h=e.strstart+_n;let _=u[o+s-1],f=u[o+s];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do{if(n=t,u[n+s]===f&&u[n+s-1]===_&&u[n]===u[o]&&u[++n]===u[o+1]){o+=2,n++;do{}while(u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&o<h);if(i=_n-(h-o),o=h-_n,i>s){if(e.match_start=t,s=i,i>=a)break;_=u[o+s-1],f=u[o+s]}}}while((t=d[t&l])>c&&0!=--r);return s<=e.lookahead?s:e.lookahead},kn=e=>{const t=e.w_size;let n,i,r;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-fn)&&(e.window.set(e.window.subarray(t,t+t-i),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),yn(e),i+=t),0===e.strm.avail_in)break;if(n=Cn(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=n,e.lookahead+e.insert>=3)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=wn(e,e.ins_h,e.window[r+1]);e.insert&&(e.ins_h=wn(e,e.ins_h,e.window[r+3-1]),e.prev[r&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=r,r++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<fn&&0!==e.strm.avail_in)},In=(e,t)=>{let n,i,r,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,a=e.strm.avail_in;do{if(n=65535,r=e.bi_valid+42>>3,e.strm.avail_out<r)break;if(r=e.strm.avail_out-r,i=e.strstart-e.block_start,n>i+e.strm.avail_in&&(n=i+e.strm.avail_in),n>r&&(n=r),n<o&&(0===n&&t!==Xt||t===Qt||n!==i+e.strm.avail_in))break;s=t===Xt&&n===i+e.strm.avail_in?1:0,jt(e,0,0,s),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,Tn(e.strm),i&&(i>n&&(i=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,n-=i),n&&(Cn(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===s);return a-=e.strm.avail_in,a&&(a>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=a&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.in