diff --git a/assets/__bundle-2aa1a987-1FXQuQ_P.js b/assets/__bundle-2aa1a987-DhydpHT3.js similarity index 98% rename from assets/__bundle-2aa1a987-1FXQuQ_P.js rename to assets/__bundle-2aa1a987-DhydpHT3.js index 007633047..e36ab662b 100644 --- a/assets/__bundle-2aa1a987-1FXQuQ_P.js +++ b/assets/__bundle-2aa1a987-DhydpHT3.js @@ -1 +1 @@ -import{c as F}from"./index-BVjpnZM5.js";function I(s,h){for(var b=0;bc[u]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}var A={},T;T=function(){function s(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function h(t,r){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,e=c(t);if(r){var o=c(this).constructor;n=Reflect.construct(e,arguments,o)}else n=e.apply(this,arguments);return function(i,a){if(a&&(typeof a=="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(i)}(this,n)}}function O(){return O=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(t,r,n){var e=function(i,a){for(;!Object.prototype.hasOwnProperty.call(i,a)&&(i=c(i))!==null;);return i}(t,r);if(e){var o=Object.getOwnPropertyDescriptor(e,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},O.apply(this,arguments)}var _=function(){function t(){s(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return b(t,[{key:"addEventListener",value:function(r,n,e){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:e})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var e=this.listeners[r],o=0,i=e.length;o"u")(e=new Error("This operation was aborted")).name="AbortError";else try{e=new DOMException("signal is aborted without reason")}catch{(e=new Error("This operation was aborted")).name="AbortError"}this.signal.reason=e,this.signal.dispatchEvent(n)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();function E(t){return t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof t.Request=="function"&&!t.Request.prototype.hasOwnProperty("signal")||!t.AbortController}typeof Symbol<"u"&&Symbol.toStringTag&&(m.prototype[Symbol.toStringTag]="AbortController",w.prototype[Symbol.toStringTag]="AbortSignal"),function(t){if(E(t))if(t.fetch){var r=function(o){typeof o=="function"&&(o={fetch:o});var i=o,a=i.fetch,P=i.Request,g=P===void 0?a.Request:P,C=i.AbortController,R=i.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,L=R!==void 0&&R;if(!E({fetch:a,Request:g,AbortController:C,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:L}))return{fetch:a,Request:p};var p=g;(p&&!p.prototype.hasOwnProperty("signal")||L)&&((p=function(d,l){var y;l&&l.signal&&(y=l.signal,delete l.signal);var v=new g(d,l);return y&&Object.defineProperty(v,"signal",{writable:!1,enumerable:!1,configurable:!0,value:y}),v}).prototype=g.prototype);var j=a;return{fetch:function(d,l){var y=p&&p.prototype.isPrototypeOf(d)?d.signal:l?l.signal:void 0;if(y){var v;try{v=new DOMException("Aborted","AbortError")}catch{(v=new Error("Aborted")).name="AbortError"}if(y.aborted)return Promise.reject(v);var k=new Promise(function(q,N){y.addEventListener("abort",function(){return N(v)},{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([k,j(d,l)])}return j(d,l)},Request:p}}(t),n=r.fetch,e=r.Request;t.fetch=n,t.Request=e,Object.defineProperty(t,"AbortController",{writable:!0,enumerable:!1,configurable:!0,value:m}),Object.defineProperty(t,"AbortSignal",{writable:!0,enumerable:!1,configurable:!0,value:w})}else console.warn("fetch() is not available, cannot install abortcontroller-polyfill")}(typeof self<"u"?self:F)},T();const x=I({__proto__:null,default:A},[A]);export{x as _}; +import{c as F}from"./index-C2_Os5Hc.js";function I(s,h){for(var b=0;bc[u]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}var A={},T;T=function(){function s(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function h(t,r){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,e=c(t);if(r){var o=c(this).constructor;n=Reflect.construct(e,arguments,o)}else n=e.apply(this,arguments);return function(i,a){if(a&&(typeof a=="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(i)}(this,n)}}function O(){return O=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(t,r,n){var e=function(i,a){for(;!Object.prototype.hasOwnProperty.call(i,a)&&(i=c(i))!==null;);return i}(t,r);if(e){var o=Object.getOwnPropertyDescriptor(e,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},O.apply(this,arguments)}var _=function(){function t(){s(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return b(t,[{key:"addEventListener",value:function(r,n,e){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:e})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var e=this.listeners[r],o=0,i=e.length;o"u")(e=new Error("This operation was aborted")).name="AbortError";else try{e=new DOMException("signal is aborted without reason")}catch{(e=new Error("This operation was aborted")).name="AbortError"}this.signal.reason=e,this.signal.dispatchEvent(n)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();function E(t){return t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof t.Request=="function"&&!t.Request.prototype.hasOwnProperty("signal")||!t.AbortController}typeof Symbol<"u"&&Symbol.toStringTag&&(m.prototype[Symbol.toStringTag]="AbortController",w.prototype[Symbol.toStringTag]="AbortSignal"),function(t){if(E(t))if(t.fetch){var r=function(o){typeof o=="function"&&(o={fetch:o});var i=o,a=i.fetch,P=i.Request,g=P===void 0?a.Request:P,C=i.AbortController,R=i.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,L=R!==void 0&&R;if(!E({fetch:a,Request:g,AbortController:C,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:L}))return{fetch:a,Request:p};var p=g;(p&&!p.prototype.hasOwnProperty("signal")||L)&&((p=function(d,l){var y;l&&l.signal&&(y=l.signal,delete l.signal);var v=new g(d,l);return y&&Object.defineProperty(v,"signal",{writable:!1,enumerable:!1,configurable:!0,value:y}),v}).prototype=g.prototype);var j=a;return{fetch:function(d,l){var y=p&&p.prototype.isPrototypeOf(d)?d.signal:l?l.signal:void 0;if(y){var v;try{v=new DOMException("Aborted","AbortError")}catch{(v=new Error("Aborted")).name="AbortError"}if(y.aborted)return Promise.reject(v);var k=new Promise(function(q,N){y.addEventListener("abort",function(){return N(v)},{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([k,j(d,l)])}return j(d,l)},Request:p}}(t),n=r.fetch,e=r.Request;t.fetch=n,t.Request=e,Object.defineProperty(t,"AbortController",{writable:!0,enumerable:!1,configurable:!0,value:m}),Object.defineProperty(t,"AbortSignal",{writable:!0,enumerable:!1,configurable:!0,value:w})}else console.warn("fetch() is not available, cannot install abortcontroller-polyfill")}(typeof self<"u"?self:F)},T();const x=I({__proto__:null,default:A},[A]);export{x as _}; diff --git a/assets/__bundle-347d730c-Bwy3z4rj.js b/assets/__bundle-347d730c-BfmsRuYe.js similarity index 99% rename from assets/__bundle-347d730c-Bwy3z4rj.js rename to assets/__bundle-347d730c-BfmsRuYe.js index 095cfc25f..972cffb1c 100644 --- a/assets/__bundle-347d730c-Bwy3z4rj.js +++ b/assets/__bundle-347d730c-BfmsRuYe.js @@ -1,2 +1,2 @@ -import{c as g}from"./index-BVjpnZM5.js";function H(e,t){for(var o=0;os[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var x={},u=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof g<"u"&&g||{},P="URLSearchParams"in u,D="Symbol"in u&&"iterator"in Symbol,m="FileReader"in u&&"Blob"in u&&function(){try{return new Blob,!0}catch{return!1}}(),j="FormData"in u,_="ArrayBuffer"in u;if(_)var L=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],q=ArrayBuffer.isView||function(e){return e&&L.indexOf(Object.prototype.toString.call(e))>-1};function y(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function E(e){return typeof e!="string"&&(e=String(e)),e}function v(e){var t={next:function(){var o=e.shift();return{done:o===void 0,value:o}}};return D&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(t,o){this.append(o,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function A(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function S(e){return new Promise(function(t,o){e.onload=function(){t(e.result)},e.onerror=function(){o(e.error)}})}function N(e){var t=new FileReader,o=S(t);return t.readAsArrayBuffer(e),o}function U(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function R(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:m&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:j&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:P&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():_&&m&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=U(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):_&&(ArrayBuffer.prototype.isPrototypeOf(e)||q(e))?this._bodyArrayBuffer=U(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):P&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},m&&(this.blob=function(){var e=A(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=A(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(m)return this.blob().then(N);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,o,s,n,r=A(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,o=S(t),s=/charset=([A-Za-z0-9_-]+)/.exec(e.type),n=s?s[1]:"utf-8",t.readAsText(e,n),o;if(this._bodyArrayBuffer)return Promise.resolve(function(w){for(var c=new Uint8Array(w),a=new Array(c.length),h=0;h-1?s:o),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in u)return new AbortController().signal}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!(this.method!=="GET"&&this.method!=="HEAD"||t.cache!=="no-store"&&t.cache!=="no-cache")){var r=/([?&])_=[^&]*/;r.test(this.url)?this.url=this.url.replace(r,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function G(e){var t=new FormData;return e.trim().split("&").forEach(function(o){if(o){var s=o.split("="),n=s.shift().replace(/\+/g," "),r=s.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(r))}}),t}function f(e,t){if(!(this instanceof f))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}d.prototype.clone=function(){return new d(this,{body:this._bodyInit})},R.call(d.prototype),R.call(f.prototype),f.prototype.clone=function(){return new f(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},f.error=function(){var e=new f(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var M=[301,302,303,307,308];f.redirect=function(e,t){if(M.indexOf(t)===-1)throw new RangeError("Invalid status code");return new f(null,{status:t,headers:{location:e}})};var p=u.DOMException;try{new p}catch{(p=function(t,o){this.message=t,this.name=o;var s=Error(t);this.stack=s.stack}).prototype=Object.create(Error.prototype),p.prototype.constructor=p}function T(e,t){return new Promise(function(o,s){var n=new d(e,t);if(n.signal&&n.signal.aborted)return s(new p("Aborted","AbortError"));var r=new XMLHttpRequest;function w(){r.abort()}if(r.onload=function(){var a,h,b={statusText:r.statusText,headers:(a=r.getAllResponseHeaders()||"",h=new i,a.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(l){return l.indexOf(` +import{c as g}from"./index-C2_Os5Hc.js";function H(e,t){for(var o=0;os[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var x={},u=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof g<"u"&&g||{},P="URLSearchParams"in u,D="Symbol"in u&&"iterator"in Symbol,m="FileReader"in u&&"Blob"in u&&function(){try{return new Blob,!0}catch{return!1}}(),j="FormData"in u,_="ArrayBuffer"in u;if(_)var L=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],q=ArrayBuffer.isView||function(e){return e&&L.indexOf(Object.prototype.toString.call(e))>-1};function y(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function E(e){return typeof e!="string"&&(e=String(e)),e}function v(e){var t={next:function(){var o=e.shift();return{done:o===void 0,value:o}}};return D&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(t,o){this.append(o,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function A(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function S(e){return new Promise(function(t,o){e.onload=function(){t(e.result)},e.onerror=function(){o(e.error)}})}function N(e){var t=new FileReader,o=S(t);return t.readAsArrayBuffer(e),o}function U(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function R(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:m&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:j&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:P&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():_&&m&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=U(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):_&&(ArrayBuffer.prototype.isPrototypeOf(e)||q(e))?this._bodyArrayBuffer=U(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):P&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},m&&(this.blob=function(){var e=A(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=A(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(m)return this.blob().then(N);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,o,s,n,r=A(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,o=S(t),s=/charset=([A-Za-z0-9_-]+)/.exec(e.type),n=s?s[1]:"utf-8",t.readAsText(e,n),o;if(this._bodyArrayBuffer)return Promise.resolve(function(w){for(var c=new Uint8Array(w),a=new Array(c.length),h=0;h-1?s:o),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in u)return new AbortController().signal}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!(this.method!=="GET"&&this.method!=="HEAD"||t.cache!=="no-store"&&t.cache!=="no-cache")){var r=/([?&])_=[^&]*/;r.test(this.url)?this.url=this.url.replace(r,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function G(e){var t=new FormData;return e.trim().split("&").forEach(function(o){if(o){var s=o.split("="),n=s.shift().replace(/\+/g," "),r=s.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(r))}}),t}function f(e,t){if(!(this instanceof f))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}d.prototype.clone=function(){return new d(this,{body:this._bodyInit})},R.call(d.prototype),R.call(f.prototype),f.prototype.clone=function(){return new f(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},f.error=function(){var e=new f(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var M=[301,302,303,307,308];f.redirect=function(e,t){if(M.indexOf(t)===-1)throw new RangeError("Invalid status code");return new f(null,{status:t,headers:{location:e}})};var p=u.DOMException;try{new p}catch{(p=function(t,o){this.message=t,this.name=o;var s=Error(t);this.stack=s.stack}).prototype=Object.create(Error.prototype),p.prototype.constructor=p}function T(e,t){return new Promise(function(o,s){var n=new d(e,t);if(n.signal&&n.signal.aborted)return s(new p("Aborted","AbortError"));var r=new XMLHttpRequest;function w(){r.abort()}if(r.onload=function(){var a,h,b={statusText:r.statusText,headers:(a=r.getAllResponseHeaders()||"",h=new i,a.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(l){return l.indexOf(` `)===0?l.substr(1,l.length):l}).forEach(function(l){var B=l.split(":"),O=B.shift().trim();if(O){var I=B.join(":").trim();try{h.append(O,I)}catch(C){console.warn("Response "+C.message)}}}),h)};n.url.indexOf("file://")===0&&(r.status<200||r.status>599)?b.status=200:b.status=r.status,b.url="responseURL"in r?r.responseURL:b.headers.get("X-Request-URL");var F="response"in r?r.response:r.responseText;setTimeout(function(){o(new f(F,b))},0)},r.onerror=function(){setTimeout(function(){s(new TypeError("Network request failed"))},0)},r.ontimeout=function(){setTimeout(function(){s(new TypeError("Network request timed out"))},0)},r.onabort=function(){setTimeout(function(){s(new p("Aborted","AbortError"))},0)},r.open(n.method,function(a){try{return a===""&&u.location.href?u.location.href:a}catch{return a}}(n.url),!0),n.credentials==="include"?r.withCredentials=!0:n.credentials==="omit"&&(r.withCredentials=!1),"responseType"in r&&(m?r.responseType="blob":_&&(r.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof i||u.Headers&&t.headers instanceof u.Headers)){var c=[];Object.getOwnPropertyNames(t.headers).forEach(function(a){c.push(y(a)),r.setRequestHeader(a,E(t.headers[a]))}),n.headers.forEach(function(a,h){c.indexOf(h)===-1&&r.setRequestHeader(h,a)})}else n.headers.forEach(function(a,h){r.setRequestHeader(h,a)});n.signal&&(n.signal.addEventListener("abort",w),r.onreadystatechange=function(){r.readyState===4&&n.signal.removeEventListener("abort",w)}),r.send(n._bodyInit===void 0?null:n._bodyInit)})}T.polyfill=!0,u.fetch||(u.fetch=T,u.Headers=i,u.Request=d,u.Response=f),(typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof g<"u"&&g||{fetch:null}).fetch=T;const V=H({__proto__:null,default:x},[x]);export{V as _}; diff --git a/assets/__bundle-a2788ee7-CBMEyvBY.js b/assets/__bundle-a2788ee7-qI2cAaF_.js similarity index 95% rename from assets/__bundle-a2788ee7-CBMEyvBY.js rename to assets/__bundle-a2788ee7-qI2cAaF_.js index 839407fe1..9c6ea5bdd 100644 --- a/assets/__bundle-a2788ee7-CBMEyvBY.js +++ b/assets/__bundle-a2788ee7-qI2cAaF_.js @@ -1 +1 @@ -import{j as y,v as a,R as L,x as h,M,X,z as b,J as I}from"./index-BVjpnZM5.js";var N=function(i,n){return new Promise(function(v,r){if(typeof XMLHttpRequest<"u"){var d=y.of(i),o=d.dispatcher,w=d.logger,c=n.requestId,E=n.method,R=n.url,u=n.headers,f=u===void 0?{}:u,p=n.data,x=p===void 0?"":p,l=n.uploadProgressHandler,g=!1,e=new XMLHttpRequest;e.open(E,R),Object.keys(f).forEach(function(t){e.setRequestHeader(t,f[t])}),l&&e.upload.addEventListener("progress",function(t){t.lengthComputable?l(c,t.loaded,t.total):w.debug("Progress computing failed: `Content-Length` header is not given.")}),e.onabort=function(){r(a.requestCanceled)},e.onerror=function(t){r(a.networkError)},e.onreadystatechange=function(){if(e.readyState===XMLHttpRequest.DONE&&!g)if(e.status===0||e.status>=200&&e.status<400)try{var t=JSON.parse(e.responseText);v(new L(i,t))}catch{r(a.networkError)}else try{var m=JSON.parse(e.responseText);if(m){var s=new a(m);if(s.isSessionExpiredError){if(o.dispatch(new h({reason:s.code,message:s.message})),!(e instanceof M)){var q=new X;return o.dispatch(new b({request:e,deferred:q,error:s})),q.promise}}else s.isSessionInvalidatedError&&o.dispatch(new h({reason:s.code,message:s.message}));r(s)}else r(a.requestFailed)}catch{r(a.requestFailed)}},o.on(function(t){t instanceof I&&(t.requestId&&t.requestId!==c||(g=!0,e.abort()))}),e.send(x)}else r(a.xmlHttpRequestNotSupported)})};export{N as xmlHttpRequest}; +import{j as y,v as a,R as L,x as h,M,X,z as b,J as I}from"./index-C2_Os5Hc.js";var N=function(i,n){return new Promise(function(v,r){if(typeof XMLHttpRequest<"u"){var d=y.of(i),o=d.dispatcher,w=d.logger,c=n.requestId,E=n.method,R=n.url,u=n.headers,f=u===void 0?{}:u,p=n.data,x=p===void 0?"":p,l=n.uploadProgressHandler,g=!1,e=new XMLHttpRequest;e.open(E,R),Object.keys(f).forEach(function(t){e.setRequestHeader(t,f[t])}),l&&e.upload.addEventListener("progress",function(t){t.lengthComputable?l(c,t.loaded,t.total):w.debug("Progress computing failed: `Content-Length` header is not given.")}),e.onabort=function(){r(a.requestCanceled)},e.onerror=function(t){r(a.networkError)},e.onreadystatechange=function(){if(e.readyState===XMLHttpRequest.DONE&&!g)if(e.status===0||e.status>=200&&e.status<400)try{var t=JSON.parse(e.responseText);v(new L(i,t))}catch{r(a.networkError)}else try{var m=JSON.parse(e.responseText);if(m){var s=new a(m);if(s.isSessionExpiredError){if(o.dispatch(new h({reason:s.code,message:s.message})),!(e instanceof M)){var q=new X;return o.dispatch(new b({request:e,deferred:q,error:s})),q.promise}}else s.isSessionInvalidatedError&&o.dispatch(new h({reason:s.code,message:s.message}));r(s)}else r(a.requestFailed)}catch{r(a.requestFailed)}},o.on(function(t){t instanceof I&&(t.requestId&&t.requestId!==c||(g=!0,e.abort()))}),e.send(x)}else r(a.xmlHttpRequestNotSupported)})};export{N as xmlHttpRequest}; diff --git a/assets/index-BVjpnZM5.js b/assets/index-C2_Os5Hc.js similarity index 99% rename from assets/index-BVjpnZM5.js rename to assets/index-C2_Os5Hc.js index e264218d9..f9fa45dbd 100644 --- a/assets/index-BVjpnZM5.js +++ b/assets/index-C2_Os5Hc.js @@ -49,7 +49,7 @@ Error generating stack: `+s.message+` `),r=[],i=0,s=t.length;i=0;u--){var c=l[u];if(c&&c.nodeType===1&&c.hasAttribute(kl))return c}}(t),s=i!==void 0?i.nextSibling:null;r.setAttribute(kl,"active"),r.setAttribute("data-styled-version","5.3.11");var o=c4();return o&&r.setAttribute("nonce",o),t.insertBefore(r,s),r},d4=function(){function e(t){var r=this.element=Qb(t);r.appendChild(document.createTextNode("")),this.sheet=function(i){if(i.sheet)return i.sheet;for(var s=document.styleSheets,o=0,a=s.length;o=0){var i=document.createTextNode(r),s=this.nodes[t];return this.element.insertBefore(i,s||null),this.length++,!0}return!1},n.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},n.getRule=function(t){return t0&&(d+=h+",")}),s+=""+u+c+'{content:"'+d+`"}/*!sc*/ `}}}return s}(this)},e}(),_4=/(a)(d)/gi,Q2=function(e){return String.fromCharCode(e+(e>25?39:97))};function z_(e){var n,t="";for(n=Math.abs(e);n>52;n=n/52|0)t=Q2(n%52)+t;return(Q2(n%52)+t).replace(_4,"$1-$2")}var dl=function(e,n){for(var t=n.length;t;)e=33*e^n.charCodeAt(--t);return e},Zb=function(e){return dl(5381,e)};function m4(e){for(var n=0;n>>0);if(!t.hasNameForId(i,a)){var l=r(o,"."+a,void 0,i);t.insertRules(i,a,l)}s.push(a),this.staticRulesId=a}else{for(var u=this.rules.length,c=dl(this.baseHash,r.hash),d="",h=0;h>>0);if(!t.hasNameForId(i,b)){var m=r(d,"."+b,void 0,i);t.insertRules(i,b,m)}s.push(b)}}return s.join(" ")},e}(),y4=/^\s*\/\/.*$/gm,E4=[":","[",".","#"];function Xb(e){var n,t,r,i,s=e===void 0?Eo:e,o=s.options,a=o===void 0?Eo:o,l=s.plugins,u=l===void 0?Kh:l,c=new GI(a),d=[],h=function(g){function b(m){if(m)try{g(m+"}")}catch{}}return function(m,_,E,S,w,N,A,k,I,M){switch(m){case 1:if(I===0&&_.charCodeAt(0)===64)return g(_+";"),"";break;case 2:if(k===0)return _+"/*|*/";break;case 3:switch(k){case 102:case 112:return g(E[0]+_),"";default:return _+(M===0?"/*|*/":"")}case-2:_.split("/*|*/}").forEach(b)}}}(function(g){d.push(g)}),f=function(g,b,m){return b===0&&E4.indexOf(m[t.length])!==-1||m.match(i)?g:"."+n};function p(g,b,m,_){_===void 0&&(_="&");var E=g.replace(y4,""),S=b&&m?m+" "+b+" { "+E+" }":E;return n=_,t=b,r=new RegExp("\\"+t+"\\b","g"),i=new RegExp("(\\"+t+"\\b){2,}"),c(m||!b?"":b,S)}return c.use([].concat(u,[function(g,b,m){g===2&&m.length&&m[0].lastIndexOf(t)>0&&(m[0]=m[0].replace(r,f))},h,function(g){if(g===-2){var b=d;return d=[],b}}])),p.hash=u.length?u.reduce(function(g,b){return b.name||Ta(15),dl(g,b.name)},5381).toString():"",p}var Bg=mt.createContext();Bg.Consumer;var $g=mt.createContext(),b4=($g.Consumer,new Yb),V_=Xb();function Jb(){return D.useContext(Bg)||b4}function C4(){return D.useContext($g)||V_}function S4(e){var n=D.useState(e.stylisPlugins),t=n[0],r=n[1],i=Jb(),s=D.useMemo(function(){var a=i;return e.sheet?a=e.sheet:e.target&&(a=a.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(a=a.reconstructWithOptions({useCSSOMInjection:!1})),a},[e.disableCSSOMInjection,e.sheet,e.target]),o=D.useMemo(function(){return Xb({options:{prefix:!e.disableVendorPrefixes},plugins:t})},[e.disableVendorPrefixes,t]);return D.useEffect(function(){$I(t,e.stylisPlugins)||r(e.stylisPlugins)},[e.stylisPlugins]),mt.createElement(Bg.Provider,{value:s},mt.createElement($g.Provider,{value:o},e.children))}var eC=function(){function e(n,t){var r=this;this.inject=function(i,s){s===void 0&&(s=V_);var o=r.name+s.hash;i.hasNameForId(r.id,o)||i.insertRules(r.id,o,s(r.rules,o,"@keyframes"))},this.toString=function(){return Ta(12,String(r.name))},this.name=n,this.id="sc-keyframes-"+n,this.rules=t}return e.prototype.getName=function(n){return n===void 0&&(n=V_),this.name+n.hash},e}(),T4=/([A-Z])/,w4=/([A-Z])/g,N4=/^ms-/,I4=function(e){return"-"+e.toLowerCase()};function Y2(e){return T4.test(e)?e.replace(w4,I4).replace(N4,"-ms-"):e}var Z2=function(e){return e==null||e===!1||e===""};function Rl(e,n,t,r){if(Array.isArray(e)){for(var i,s=[],o=0,a=e.length;o1?n-1:0),r=1;r?@[\\\]^`{|}~-]+/g,x4=/(^-|-$)/g;function np(e){return e.replace(M4,"-").replace(x4,"")}var tC=function(e){return z_(Zb(e)>>>0)};function Sd(e){return typeof e=="string"&&!0}var q_=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},O4=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function k4(e,n,t){var r=e[t];q_(n)&&q_(r)?nC(r,n):e[t]=n}function nC(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r=0||(M[k]=N[k]);return M}(n,["componentId"]),w=E&&E+"-"+(Sd(_)?_:np(W2(_)));return rC(_,us({},S,{attrs:h,componentId:w}),t)},Object.defineProperty(p,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(_){this._foldedDefaultProps=r?nC({},e.defaultProps,_):_}}),Object.defineProperty(p,"toString",{value:function(){return"."+p.styledComponentId}}),i&&t4(p,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),p}var be=function(e){return function n(t,r,i){if(i===void 0&&(i=Eo),!Ug.isValidElementType(r))return Ta(1,String(r));var s=function(){return t(r,i,Oo.apply(void 0,arguments))};return s.withConfig=function(o){return n(t,r,us({},i,{},o))},s.attrs=function(o){return n(t,r,us({},i,{attrs:Array.prototype.concat(i.attrs,o).filter(Boolean)}))},s}(rC,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){be[e]=be(e)});function L4(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.all(t.map(a=>{if(a=P4(a),a in J2)return;J2[a]=!0;const l=a.endsWith(".css"),u=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${u}`))return;const c=document.createElement("link");if(c.rel=l?"stylesheet":U4,l||(c.as="script",c.crossOrigin=""),c.href=a,o&&c.setAttribute("nonce",o),document.head.appendChild(c),l)return new Promise((d,h)=>{c.addEventListener("load",d),c.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${a}`)))})}))}return i.then(()=>n()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};var W_=function(e,n){return W_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},W_(e,n)};function T(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}W_(e,n),e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var x=function(){return x=Object.assign||function(e){for(var n,t=1,r=arguments.length;t0&&i[i.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ae(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var r,i,s=t.call(e),o=[];try{for(;(n===void 0||n-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(t=s.return)&&t.call(s)}finally{if(i)throw i.error}}return o}function De(e,n,t){if(arguments.length===2)for(var r,i=0,s=n.length;i0&&H4.indexOf(e)>=0},Yh=function(e){return e>0&&j4.indexOf(e)>=0},pr=function(e,n){if(n===void 0&&(n=!1),n&&Kc(e))return!0;var t=typeof e=="object"&&e!==null&&e.hasOwnProperty("name")&&typeof e.name=="string"&&e.hasOwnProperty("uri")&&typeof e.uri=="string"&&e.hasOwnProperty("type")&&typeof e.type=="string";if(!t){if(typeof Blob<"u")return e instanceof Blob;if(typeof File<"u")return e instanceof File}return t},G4=function(e,n){if(e===n)return!0;if(e==null||n==null||e.length!==n.length)return!1;for(var t=De([],Ae(e),!1).sort(),r=De([],Ae(n),!1).sort(),i=0;i=1e3&&n<=9e3&&(this._typingIndicatorThrottle=n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"websocketResponseTimeout",{get:function(){return this._websocketResponseTimeout},set:function(n){R("number",n)&&n>=5e3&&n<=3e4&&(this._websocketResponseTimeout=n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionTokenRefreshTimeout",{get:function(){return this._sessionTokenRefreshTimeout},set:function(n){R("number",n)&&(n<60?n=60:n>1800&&(n=1800),this._sessionTokenRefreshTimeout=n)},enumerable:!1,configurable:!0}),e}(),aC={encrypt:function(e){return e},decrypt:function(e){return e}},t1=function(){function e(n){var t=n.store;this._preference=new Map,this._store=t}return e.prototype._savePreferenceKeys=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return[4,this._store.set({key:this._keysAddress,value:De([],Ae(this._preference.keys()),!1)})];case 1:return n.sent(),[2]}})})},e.prototype.init=function(n,t){var r;return t===void 0&&(t=1),y(this,void 0,void 0,function(){var i,s,o,a,l,u,c,d,h,f;return v(this,function(p){switch(p.label){case 0:return this._version=t,this._keysAddress=n,i="".concat(n,".metadata.version"),[4,this._store.get(i)];case 1:return s=p.sent(),[4,this._store.get(n)];case 2:return o=(r=p.sent())!==null&&r!==void 0?r:[],!s||s.versiond.channel.messageCollectionLastAccessedAt?1:-1},this._maxSize=Math.max(i,64),a?(this._clearOrder=o,this._customClearOrderComparator=a):this._clearOrder=zu.MESSAGE_COLLECTION_ACCESSED_AT,this._enableAutoResend=u}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 n;return this._clearOrder===zu.MESSAGE_COLLECTION_ACCESSED_AT?this._clearOrderComparatorUseMessageCollectionAccessedAt:(n=this._customClearOrderComparator)!==null&&n!==void 0?n: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"})(xc||(xc={}));var Ze,Ni,ss,Ct,tr,Ll,rr,Dn,Wi,ut,n1,Q_,Y_,q4=function(){function e(){this.isRefreshing=!1}return Object.defineProperty(e.prototype,"hasSession",{get:function(){return!!this.sessionKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasChatServicePermission",{get:function(){var n;return!!(!((n=this.services)===null||n===void 0)&&n.includes(xc.CHAT))},enumerable:!1,configurable:!0}),e.prototype.clear=function(){this.authToken=void 0,this.sessionKey=void 0,this.services=[]},e}(),Bs=function(){var e=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(n==="x"?t:3&t|8).toString(16)})},r1=function(){function e(n){var t=n.container;this._container={},this._container=t,this.key=Bs()}return e.prototype._register=function(n,t,r){var i;return n in this._container||(this._container[n]=new Map),(i=this._container[n])===null||i===void 0||i.set(this.key,{occurence:t,handler:r}),this},e.prototype.on=function(n,t){return this._register(n,-1,t)},e.prototype.once=function(n,t){return this._register(n,1,t)},e.prototype.close=function(){var n=this;Object.keys(this._container).forEach(function(t){var r;(r=n._container[t])===null||r===void 0||r.delete(n.key)})},e}(),La=function(){function e(){this._container={}}return e.prototype.on=function(n,t){return new r1({container:this._container}).on(n,t)},e.prototype.once=function(n,t){return new r1({container:this._container}).once(n,t)},e.prototype.dispatch=function(n,t){var r,i,s=this._container[n];if(s){var o=[];try{for(var a=pe(s.keys()),l=a.next();!l.done;l=a.next()){var u=l.value,c=s.get(u);c.handler(t),c.occurence>0&&(c.occurence--,c.occurence===0&&o.push(u))}}catch(d){r={error:d}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}o.forEach(function(d){return s.delete(d)})}},e}(),W4=function(){function e(){this._dispatcher=new La}return e.prototype.on=function(n){return this._dispatcher.on("event",n)},e.prototype.once=function(n){return this._dispatcher.once("event",n)},e.prototype.dispatch=function(n){this._dispatcher.dispatch("event",n)},e}(),Tt=function(){},ye=function(e){var n={};return e&&Object.keys(e).forEach(function(t){e[t]===void 0||Number.isNaN(e[t])||e[t]===null||(n[t]=e[t])}),n},Ie=function(e){if(e!=null){if(typeof e=="object"){if(Array.isArray(e)){for(var n=De([],Ae(e),!1),t=0;t"u"&&typeof navigator<"u"&&navigator.product=="ReactNative"},i1=function(){return!(typeof navigator>"u"||!/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"})(X_||(X_={})),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"}(fa||(fa={})),function(e){e.ANDROID="android",e.IOS="ios",e.WEB="web",e.MOBILE_WEB="mobile_web",e.WINDOWS="windows"}(lo||(lo={}));var oA="^(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-]+)*))?$",Zh=function(){function e(){}return e.sendbirdSdkUserAgentWithExtension=function(n){var t=J_()?fa.REACT_NATIVE:fa.JS,r={main_sdk_info:"chat/".concat(t,"/").concat(bo.SDK_VERSION),device_os_platform:i1()?"mobile-web":"web",os_version:bo.OS_VERSION};if(n){var i=n.sendbirdExtensions,s=n.deviceOS,o=n.customData,a=o===void 0?{}:o;s.version&&(r.os_version=s.version),s.platform&&(r.device_os_platform=s.platform),i.length>0&&(r.extension_sdk_info=i.map(function(l){var u=l.product,c=l.platform,d=l.version;return"".concat(u,"/").concat(c,"/").concat(d)}).join(",")),Object.keys(r).forEach(function(l){return delete a[l]}),Object.keys(a).length>0&&(r=x(x({},r),a))}return Object.entries(r).map(function(l){var u=Ae(l,2),c=u[0],d=u[1];return"".concat(c,"=").concat(d)}).join("&")},e.userAgentWithExtension=function(n){var t=J_()?"reactnative":"JS",r=n.sb_syncmanager?"s".concat(n.sb_syncmanager):"",i=n.sb_uikit?"u".concat(n.sb_uikit):"",s=n["device-os-platform"]?"o".concat(n["device-os-platform"]):i1()?"omobile-web":"oweb";return"".concat(t,"/c").concat(bo.SDK_VERSION,"/").concat(r,"/").concat(i,"/").concat(s)},e}(),Tr=function(){var e=this;this.promise=new Promise(function(n,t){e.resolve=n,e.reject=function(r){t(r)}})},Xh=function(e){function n(t){var r=e.call(this)||this;return r.requestId=t.requestId,r}return T(n,e),n}(Tt),_C=function(e){function n(t){var r=e.call(this)||this;return r.method=Z.DELETE,r.path="".concat(Je(t.channelType),"/").concat(t.channelUrl,"/messages/").concat(t.messageId),t.messageToken&&(r.params=ye({mesg_token:t.messageToken})),r}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var aA=function(e){function n(t,r,i){var s,o=this;return(o=e.call(this,t,"DELM",i)||this).channelUrl=i.channel_url,o.channelType=i.channel_type,o.messageId=Number(i.msg_id),o.silent=i.silent,o.messageCreatedAt=i.message_created_at?Number(i.message_created_at):-1,o.senderId=(s=i.sender_id)!==null&&s!==void 0?s:void 0,o}return T(n,e),n}(gt),lA=function(){function e(n,t){var r=t.session,i=t.sdkState,s=t.dispatcher,o=t.logger,a=t.useFetchCompat,l=a!==void 0&&a,u=this;this._abortControl=new Map,this._shouldImportFetchCompat=!1,this._iid=n,this._session=r,this._sdkState=i,this._dispatcher=s,this._dispatcher.on(function(c){c instanceof nA&&u.cancel(c.requestId)}),this._logger=o,this._shouldImportFetchCompat=l}return e.prototype._createHeader=function(n,t){var r=this._sdkState,i=r.appId,s=r.appVersion,o=r.sendbirdRuntimeEnvironment,a=x(x({},n.headers),{SendBird:"JS,".concat(bo.OS_VERSION,",").concat(bo.SDK_VERSION,",").concat(i).concat(s?",".concat(s):""),"SB-User-Agent":Zh.userAgentWithExtension(this._sdkState.extensions),"Request-Sent-Timestamp":Date.now().toString(),"SB-SDK-User-Agent":Zh.sendbirdSdkUserAgentWithExtension(o)});return t||(a["Content-Type"]="application/json; charset=utf-8"),n.requireAuth&&!n.hasSessionKey&&this._session.hasSession&&(a["Session-Key"]=this._session.sessionKey),a["App-Id"]=i,this._session&&this._session.authToken&&(a["Access-Token"]=this._session.authToken),a},e.prototype._statLogApiResult=function(n,t,r){this._dispatcher.dispatch(new Vg(new $t({type:Et.API_RESULT,data:{endpoint:n.path,method:n.method,success:!r,latency:Date.now()-t,error_code:r==null?void 0:r.code,error_description:r==null?void 0:r.message}})))},e.prototype._isBodyRequired=function(n){var t=n.method;return t!==Z.GET&&(t!==Z.DELETE||n instanceof _C)},e.prototype.send=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S,w;return v(this,function(N){switch(N.label){case 0:t=n.path,r=n.method,i=n.uploadProgressHandler,s=this._isBodyRequired(n),o=this._sdkState.api,a="".concat(o.host).concat(t).concat(s?"":n.query),l=s?n.payload:null,u=this._createHeader(n,l instanceof FormData?l:void 0),c=new AbortController,d=c.signal,this._abortControl.set(n.requestId,c),h=Date.now(),N.label=1;case 1:return N.trys.push([1,13,,14]),i?[4,ip(()=>import("./__bundle-a2788ee7-CBMEyvBY.js"),[])]:[3,6];case 2:f=N.sent().xmlHttpRequest,N.label=3;case 3:return N.trys.push([3,5,,6]),[4,f(this._iid,{requestId:n.requestId,method:n.method,url:a,headers:u,data:l??void 0,uploadProgressHandler:i})];case 4:return p=N.sent(),this._logger.debug("receive api response",n.requestId),this._statLogApiResult(n,h),[2,p];case 5:if(!((g=N.sent())instanceof L&&g.code===Te.XMLHTTPREQUEST_NOT_SUPPORTED))throw g;return this._logger.debug("XMLHttpRequest is not available in this environment. progressHandler is ignored."),[3,6];case 6:return this._shouldImportFetchCompat&&(this._shouldImportFetchCompat=!1,(typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{fetch:null}).fetch=null),typeof AbortController<"u"?[3,8]:[4,ip(()=>import("./__bundle-2aa1a987-1FXQuQ_P.js").then(A=>A._),[])];case 7:N.sent(),N.label=8;case 8:return typeof fetch=="function"?[3,10]:[4,ip(()=>import("./__bundle-347d730c-Bwy3z4rj.js").then(A=>A._),[])];case 9:N.sent(),N.label=10;case 10:return[4,fetch(a,{method:r,body:l,headers:u,signal:d})];case 11:return[4,(b=N.sent()).json()];case 12:if(m=N.sent(),b.ok||b.redirected)return this._logger.debug("receive api response",n.requestId),this._statLogApiResult(n,h),[2,new se(this._iid,m)];if(m){if((_=new L(m)).isSessionExpiredError){if(this._dispatcher.dispatch(new Ul({reason:_.code,message:_.message})),!(n instanceof zg))return E=new Tr,this._dispatcher.dispatch(new pC({request:n,deferred:E,error:_})),[2,E.promise];throw _}throw _.isSessionInvalidatedError&&this._dispatcher.dispatch(new Ul({reason:_.code,message:_.message})),_}throw L.requestFailed;case 13:throw S=N.sent(),this._statLogApiResult(n,h,S),S instanceof L?(this._logger.debug("fail api request",S),S):(S==null?void 0:S.name)==="AbortError"?L.requestCanceled:(w=L.networkError,this._logger.debug("fail api request",w),w);case 14:return[2]}})})},e.prototype.cancel=function(n){this._abortControl.has(n)&&(this._abortControl.get(n).abort(),this._abortControl.delete(n)),this._dispatcher.dispatch(new Xh({requestId:n}))},e.prototype.cancelAll=function(){var n,t;try{for(var r=pe(this._abortControl.values()),i=r.next();!i.done;i=r.next())i.value.abort()}catch(s){n={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(n)throw n.error}}this._abortControl.clear(),this._dispatcher.dispatch(new Xh({}))},e}(),qe=function(){};function Wl(e){let n=e.length;for(;--n>=0;)e[n]=0}const qg=256,mC=286,Vu=30,qu=15,em=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]),ch=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]),uA=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),s1=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ss=new Array(576);Wl(Ss);const Wu=new Array(60);Wl(Wu);const Oc=new Array(512);Wl(Oc);const Ku=new Array(256);Wl(Ku);const Wg=new Array(29);Wl(Wg);const Jh=new Array(Vu);function sp(e,n,t,r,i){this.static_tree=e,this.extra_bits=n,this.extra_base=t,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let o1,a1,l1;function op(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}Wl(Jh);const gC=e=>e<256?Oc[e]:Oc[256+(e>>>7)],kc=(e,n)=>{e.pending_buf[e.pending++]=255&n,e.pending_buf[e.pending++]=n>>>8&255},zr=(e,n,t)=>{e.bi_valid>16-t?(e.bi_buf|=n<>16-e.bi_valid,e.bi_valid+=t-16):(e.bi_buf|=n<{zr(e,t[2*n],t[2*n+1])},vC=(e,n)=>{let t=0;do t|=1&e,e>>>=1,t<<=1;while(--n>0);return t>>>1},yC=(e,n,t)=>{const r=new Array(16);let i,s,o=0;for(i=1;i<=qu;i++)o=o+t[i-1]<<1,r[i]=o;for(s=0;s<=n;s++){let a=e[2*s+1];a!==0&&(e[2*s]=vC(r[a]++,a))}},EC=e=>{let n;for(n=0;n{e.bi_valid>8?kc(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},u1=(e,n,t,r)=>{const i=2*n,s=2*t;return e[i]{const r=e.heap[t];let i=t<<1;for(;i<=e.heap_len&&(i{let r,i,s,o,a=0;if(e.sym_next!==0)do r=255&e.pending_buf[e.sym_buf+a++],r+=(255&e.pending_buf[e.sym_buf+a++])<<8,i=e.pending_buf[e.sym_buf+a++],r===0?os(e,i,n):(s=Ku[i],os(e,s+qg+1,n),o=em[s],o!==0&&(i-=Wg[s],zr(e,i,o)),r--,s=gC(r),os(e,s,t),o=ch[s],o!==0&&(r-=Jh[s],zr(e,r,o)));while(a{const t=n.dyn_tree,r=n.stat_desc.static_tree,i=n.stat_desc.has_stree,s=n.stat_desc.elems;let o,a,l,u=-1;for(e.heap_len=0,e.heap_max=573,o=0;o>1;o>=1;o--)ap(e,t,o);l=s;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ap(e,t,1),a=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=a,t[2*l]=t[2*o]+t[2*a],e.depth[l]=(e.depth[o]>=e.depth[a]?e.depth[o]:e.depth[a])+1,t[2*o+1]=t[2*a+1]=l,e.heap[1]=l++,ap(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((c,d)=>{const h=d.dyn_tree,f=d.max_code,p=d.stat_desc.static_tree,g=d.stat_desc.has_stree,b=d.stat_desc.extra_bits,m=d.stat_desc.extra_base,_=d.stat_desc.max_length;let E,S,w,N,A,k,I=0;for(N=0;N<=qu;N++)c.bl_count[N]=0;for(h[2*c.heap[c.heap_max]+1]=0,E=c.heap_max+1;E<573;E++)S=c.heap[E],N=h[2*h[2*S+1]+1]+1,N>_&&(N=_,I++),h[2*S+1]=N,S>f||(c.bl_count[N]++,A=0,S>=m&&(A=b[S-m]),k=h[2*S],c.opt_len+=k*(N+A),g&&(c.static_len+=k*(p[2*S+1]+A)));if(I!==0){do{for(N=_-1;c.bl_count[N]===0;)N--;c.bl_count[N]--,c.bl_count[N+1]+=2,c.bl_count[_]--,I-=2}while(I>0);for(N=_;N!==0;N--)for(S=c.bl_count[N];S!==0;)w=c.heap[--E],w>f||(h[2*w+1]!==N&&(c.opt_len+=(N-h[2*w+1])*h[2*w],h[2*w+1]=N),S--)}})(e,n),yC(t,u,e.bl_count)},d1=(e,n,t)=>{let r,i,s=-1,o=n[1],a=0,l=7,u=4;for(o===0&&(l=138,u=3),n[2*(t+1)+1]=65535,r=0;r<=t;r++)i=o,o=n[2*(r+1)+1],++a{let r,i,s=-1,o=n[1],a=0,l=7,u=4;for(o===0&&(l=138,u=3),r=0;r<=t;r++)if(i=o,o=n[2*(r+1)+1],!(++a{zr(e,0+(r?1:0),3),bC(e),kc(e,t),kc(e,~t),t&&e.pending_buf.set(e.window.subarray(n,n+t),e.pending),e.pending+=t};var cA=(e,n,t,r)=>{let i,s,o=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=(a=>{let l,u=4093624447;for(l=0;l<=31;l++,u>>>=1)if(1&u&&a.dyn_ltree[2*l]!==0)return 0;if(a.dyn_ltree[18]!==0||a.dyn_ltree[20]!==0||a.dyn_ltree[26]!==0)return 1;for(l=32;l{let l;for(d1(a,a.dyn_ltree,a.l_desc.max_code),d1(a,a.dyn_dtree,a.d_desc.max_code),lp(a,a.bl_desc),l=18;l>=3&&a.bl_tree[2*s1[l]+1]===0;l--);return a.opt_len+=3*(l+1)+5+5+4,l})(e),i=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=i&&(i=s)):i=s=t+5,t+4<=i&&n!==-1?CC(e,n,t,r):e.strategy===4||s===i?(zr(e,2+(r?1:0),3),c1(e,Ss,Wu)):(zr(e,4+(r?1:0),3),((a,l,u,c)=>{let d;for(zr(a,l-257,5),zr(a,u-1,5),zr(a,c-4,4),d=0;d{f1||((()=>{let n,t,r,i,s;const o=new Array(16);for(r=0,i=0;i<28;i++)for(Wg[i]=r,n=0;n<1<>=7;i(e.pending_buf[e.sym_buf+e.sym_next++]=n,e.pending_buf[e.sym_buf+e.sym_next++]=n>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,n===0?e.dyn_ltree[2*t]++:(e.matches++,n--,e.dyn_ltree[2*(Ku[t]+qg+1)]++,e.dyn_dtree[2*gC(n)]++),e.sym_next===e.sym_end),_tr_align:e=>{zr(e,2,3),os(e,256,Ss),(n=>{n.bi_valid===16?(kc(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=255&n.bi_buf,n.bi_buf>>=8,n.bi_valid-=8)})(e)}},Qu=(e,n,t,r)=>{let i=65535&e,s=e>>>16&65535,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do i=i+n[r++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16};const hA=new Uint32Array((()=>{let e,n=[];for(var t=0;t<256;t++){e=t;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;n[t]=e}return n})());var Xn=(e,n,t,r)=>{const i=hA,s=r+t;e^=-1;for(let o=r;o>>8^i[255&(e^n[o])];return~e},wa={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"},Da={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:fA,_tr_stored_block:tm,_tr_flush_block:pA,_tr_tally:Co,_tr_align:_A}=dA,{Z_NO_FLUSH:So,Z_PARTIAL_FLUSH:mA,Z_FULL_FLUSH:gA,Z_FINISH:Ci,Z_BLOCK:p1,Z_OK:lr,Z_STREAM_END:_1,Z_STREAM_ERROR:es,Z_DATA_ERROR:vA,Z_BUF_ERROR:up,Z_DEFAULT_COMPRESSION:yA,Z_FILTERED:EA,Z_HUFFMAN_ONLY:Td,Z_RLE:bA,Z_FIXED:CA,Z_DEFAULT_STRATEGY:SA,Z_UNKNOWN:TA,Z_DEFLATED:ef}=Da,ra=258,fs=262,Cl=42,Ko=113,wu=666,Qo=(e,n)=>(e.msg=wa[n],n),m1=e=>2*e-(e>4?9:0),io=e=>{let n=e.length;for(;--n>=0;)e[n]=0},wA=e=>{let n,t,r,i=e.w_size;n=e.hash_size,r=n;do t=e.head[--r],e.head[r]=t>=i?t-i:0;while(--n);n=i,r=n;do t=e.prev[--r],e.prev[r]=t>=i?t-i:0;while(--n)};let To=(e,n,t)=>(n<{const n=e.state;let t=n.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(n.pending_buf.subarray(n.pending_out,n.pending_out+t),e.next_out),e.next_out+=t,n.pending_out+=t,e.total_out+=t,e.avail_out-=t,n.pending-=t,n.pending===0&&(n.pending_out=0))},ri=(e,n)=>{pA(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,n),e.block_start=e.strstart,ei(e.strm)},yt=(e,n)=>{e.pending_buf[e.pending++]=n},lu=(e,n)=>{e.pending_buf[e.pending++]=n>>>8&255,e.pending_buf[e.pending++]=255&n},nm=(e,n,t,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,n.set(e.input.subarray(e.next_in,e.next_in+i),t),e.state.wrap===1?e.adler=Qu(e.adler,n,i,t):e.state.wrap===2&&(e.adler=Xn(e.adler,n,i,t)),e.next_in+=i,e.total_in+=i,i)},SC=(e,n)=>{let t,r,i=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match;const l=e.strstart>e.w_size-fs?e.strstart-(e.w_size-fs):0,u=e.window,c=e.w_mask,d=e.prev,h=e.strstart+ra;let f=u[s+o-1],p=u[s+o];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do if(t=n,u[t+o]===p&&u[t+o-1]===f&&u[t]===u[s]&&u[++t]===u[s+1]){s+=2,t++;do;while(u[++s]===u[++t]&&u[++s]===u[++t]&&u[++s]===u[++t]&&u[++s]===u[++t]&&u[++s]===u[++t]&&u[++s]===u[++t]&&u[++s]===u[++t]&&u[++s]===u[++t]&&so){if(e.match_start=n,o=r,r>=a)break;f=u[s+o-1],p=u[s+o]}}while((n=d[n&c])>l&&--i!=0);return o<=e.lookahead?o:e.lookahead},hl=e=>{const n=e.w_size;let t,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-fs)&&(e.window.set(e.window.subarray(n,n+n-r),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,e.insert>e.strstart&&(e.insert=e.strstart),wA(e),r+=n),e.strm.avail_in===0)break;if(t=nm(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=t,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=To(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=To(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead{let t,r,i,s=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,o=0,a=e.strm.avail_in;do{if(t=65535,i=e.bi_valid+42>>3,e.strm.avail_outr+e.strm.avail_in&&(t=r+e.strm.avail_in),t>i&&(t=i),t>8,e.pending_buf[e.pending-2]=~t,e.pending_buf[e.pending-1]=~t>>8,ei(e.strm),r&&(r>t&&(r=t),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,t-=r),t&&(nm(e.strm,e.strm.output,e.strm.next_out,t),e.strm.next_out+=t,e.strm.avail_out-=t,e.strm.total_out+=t)}while(o===0);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.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_wateri&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,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++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(nm(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,s=i>e.w_size?e.w_size:i,r=e.strstart-e.block_start,(r>=s||(r||n===Ci)&&n!==So&&e.strm.avail_in===0&&r<=i)&&(t=r>i?i:r,o=n===Ci&&e.strm.avail_in===0&&t===r?1:0,tm(e,e.block_start,t,o),e.block_start+=t,ei(e.strm)),o?3:1)},cp=(e,n)=>{let t,r;for(;;){if(e.lookahead=3&&(e.ins_h=To(e,e.ins_h,e.window[e.strstart+3-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-fs&&(e.match_length=SC(e,t)),e.match_length>=3)if(r=Co(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do e.strstart++,e.ins_h=To(e,e.ins_h,e.window[e.strstart+3-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!=0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=To(e,e.ins_h,e.window[e.strstart+1]);else r=Co(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(ri(e,!1),e.strm.avail_out===0))return 1}return e.insert=e.strstart<2?e.strstart:2,n===Ci?(ri(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(ri(e,!1),e.strm.avail_out===0)?1:2},qa=(e,n)=>{let t,r,i;for(;;){if(e.lookahead=3&&(e.ins_h=To(e,e.ins_h,e.window[e.strstart+3-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,t!==0&&e.prev_length4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=Co(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=To(e,e.ins_h,e.window[e.strstart+3-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!=0);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(ri(e,!1),e.strm.avail_out===0))return 1}else if(e.match_available){if(r=Co(e,0,e.window[e.strstart-1]),r&&ri(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Co(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,n===Ci?(ri(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(ri(e,!1),e.strm.avail_out===0)?1:2};function Xi(e,n,t,r,i){this.good_length=e,this.max_lazy=n,this.nice_length=t,this.max_chain=r,this.func=i}const Nu=[new Xi(0,0,0,0,TC),new Xi(4,4,8,4,cp),new Xi(4,5,16,8,cp),new Xi(4,6,32,32,cp),new Xi(4,4,16,16,qa),new Xi(8,16,32,32,qa),new Xi(8,16,128,128,qa),new Xi(8,32,128,256,qa),new Xi(32,128,258,1024,qa),new Xi(32,258,258,4096,qa)];function NA(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ef,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),io(this.dyn_ltree),io(this.dyn_dtree),io(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),io(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),io(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Iu=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.status!==Cl&&n.status!==57&&n.status!==69&&n.status!==73&&n.status!==91&&n.status!==103&&n.status!==Ko&&n.status!==wu?1:0},wC=e=>{if(Iu(e))return Qo(e,es);e.total_in=e.total_out=0,e.data_type=TA;const n=e.state;return n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap===2?57:n.wrap?Cl:Ko,e.adler=n.wrap===2?0:1,n.last_flush=-2,fA(n),lr},NC=e=>{const n=wC(e);var t;return n===lr&&((t=e.state).window_size=2*t.w_size,io(t.head),t.max_lazy_match=Nu[t.level].max_lazy,t.good_match=Nu[t.level].good_length,t.nice_match=Nu[t.level].nice_length,t.max_chain_length=Nu[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),n},g1=(e,n,t,r,i,s)=>{if(!e)return es;let o=1;if(n===yA&&(n=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>9||t!==ef||r<8||r>15||n<0||n>9||s<0||s>CA||r===8&&o!==1)return Qo(e,es);r===8&&(r=9);const a=new NA;return e.state=a,a.strm=e,a.status=Cl,a.wrap=o,a.gzhead=null,a.w_bits=r,a.w_size=1<g1(e,n,ef,15,8,SA),deflateInit2:g1,deflateReset:NC,deflateResetKeep:wC,deflateSetHeader:(e,n)=>Iu(e)||e.state.wrap!==2?es:(e.state.gzhead=n,lr),deflate:(e,n)=>{if(Iu(e)||n>p1||n<0)return e?Qo(e,es):es;const t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===wu&&n!==Ci)return Qo(e,e.avail_out===0?up:es);const r=t.last_flush;if(t.last_flush=n,t.pending!==0){if(ei(e),e.avail_out===0)return t.last_flush=-1,lr}else if(e.avail_in===0&&m1(n)<=m1(r)&&n!==Ci)return Qo(e,up);if(t.status===wu&&e.avail_in!==0)return Qo(e,up);if(t.status===Cl&&t.wrap===0&&(t.status=Ko),t.status===Cl){let i=ef+(t.w_bits-8<<4)<<8,s=-1;if(s=t.strategy>=Td||t.level<2?0:t.level<6?1:t.level===6?2:3,i|=s<<6,t.strstart!==0&&(i|=32),i+=31-i%31,lu(t,i),t.strstart!==0&&(lu(t,e.adler>>>16),lu(t,65535&e.adler)),e.adler=1,t.status=Ko,ei(e),t.pending!==0)return t.last_flush=-1,lr}if(t.status===57){if(e.adler=0,yt(t,31),yt(t,139),yt(t,8),t.gzhead)yt(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),yt(t,255&t.gzhead.time),yt(t,t.gzhead.time>>8&255),yt(t,t.gzhead.time>>16&255),yt(t,t.gzhead.time>>24&255),yt(t,t.level===9?2:t.strategy>=Td||t.level<2?4:0),yt(t,255&t.gzhead.os),t.gzhead.extra&&t.gzhead.extra.length&&(yt(t,255&t.gzhead.extra.length),yt(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=Xn(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=69;else if(yt(t,0),yt(t,0),yt(t,0),yt(t,0),yt(t,0),yt(t,t.level===9?2:t.strategy>=Td||t.level<2?4:0),yt(t,3),t.status=Ko,ei(e),t.pending!==0)return t.last_flush=-1,lr}if(t.status===69){if(t.gzhead.extra){let i=t.pending,s=(65535&t.gzhead.extra.length)-t.gzindex;for(;t.pending+s>t.pending_buf_size;){let a=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>i&&(e.adler=Xn(e.adler,t.pending_buf,t.pending-i,i)),t.gzindex+=a,ei(e),t.pending!==0)return t.last_flush=-1,lr;i=0,s-=a}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending+=s,t.gzhead.hcrc&&t.pending>i&&(e.adler=Xn(e.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=73}if(t.status===73){if(t.gzhead.name){let i,s=t.pending;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>s&&(e.adler=Xn(e.adler,t.pending_buf,t.pending-s,s)),ei(e),t.pending!==0)return t.last_flush=-1,lr;s=0}i=t.gzindexs&&(e.adler=Xn(e.adler,t.pending_buf,t.pending-s,s)),t.gzindex=0}t.status=91}if(t.status===91){if(t.gzhead.comment){let i,s=t.pending;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>s&&(e.adler=Xn(e.adler,t.pending_buf,t.pending-s,s)),ei(e),t.pending!==0)return t.last_flush=-1,lr;s=0}i=t.gzindexs&&(e.adler=Xn(e.adler,t.pending_buf,t.pending-s,s))}t.status=103}if(t.status===103){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(ei(e),t.pending!==0))return t.last_flush=-1,lr;yt(t,255&e.adler),yt(t,e.adler>>8&255),e.adler=0}if(t.status=Ko,ei(e),t.pending!==0)return t.last_flush=-1,lr}if(e.avail_in!==0||t.lookahead!==0||n!==So&&t.status!==wu){let i=t.level===0?TC(t,n):t.strategy===Td?((s,o)=>{let a;for(;;){if(s.lookahead===0&&(hl(s),s.lookahead===0)){if(o===So)return 1;break}if(s.match_length=0,a=Co(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++,a&&(ri(s,!1),s.strm.avail_out===0))return 1}return s.insert=0,o===Ci?(ri(s,!0),s.strm.avail_out===0?3:4):s.sym_next&&(ri(s,!1),s.strm.avail_out===0)?1:2})(t,n):t.strategy===bA?((s,o)=>{let a,l,u,c;const d=s.window;for(;;){if(s.lookahead<=ra){if(hl(s),s.lookahead<=ra&&o===So)return 1;if(s.lookahead===0)break}if(s.match_length=0,s.lookahead>=3&&s.strstart>0&&(u=s.strstart-1,l=d[u],l===d[++u]&&l===d[++u]&&l===d[++u])){c=s.strstart+ra;do;while(l===d[++u]&&l===d[++u]&&l===d[++u]&&l===d[++u]&&l===d[++u]&&l===d[++u]&&l===d[++u]&&l===d[++u]&&us.lookahead&&(s.match_length=s.lookahead)}if(s.match_length>=3?(a=Co(s,1,s.match_length-3),s.lookahead-=s.match_length,s.strstart+=s.match_length,s.match_length=0):(a=Co(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++),a&&(ri(s,!1),s.strm.avail_out===0))return 1}return s.insert=0,o===Ci?(ri(s,!0),s.strm.avail_out===0?3:4):s.sym_next&&(ri(s,!1),s.strm.avail_out===0)?1:2})(t,n):Nu[t.level].func(t,n);if(i!==3&&i!==4||(t.status=wu),i===1||i===3)return e.avail_out===0&&(t.last_flush=-1),lr;if(i===2&&(n===mA?_A(t):n!==p1&&(tm(t,0,0,!1),n===gA&&(io(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),ei(e),e.avail_out===0))return t.last_flush=-1,lr}return n!==Ci?lr:t.wrap<=0?_1:(t.wrap===2?(yt(t,255&e.adler),yt(t,e.adler>>8&255),yt(t,e.adler>>16&255),yt(t,e.adler>>24&255),yt(t,255&e.total_in),yt(t,e.total_in>>8&255),yt(t,e.total_in>>16&255),yt(t,e.total_in>>24&255)):(lu(t,e.adler>>>16),lu(t,65535&e.adler)),ei(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?lr:_1)},deflateEnd:e=>{if(Iu(e))return es;const n=e.state.status;return e.state=null,n===Ko?Qo(e,vA):lr},deflateSetDictionary:(e,n)=>{let t=n.length;if(Iu(e))return es;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==Cl||r.lookahead)return es;if(i===1&&(e.adler=Qu(e.adler,n,t,0)),r.wrap=0,t>=r.w_size){i===0&&(io(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(n.subarray(t-r.w_size,t),0),n=l,t=r.w_size}const s=e.avail_in,o=e.next_in,a=e.input;for(e.avail_in=t,e.next_in=0,e.input=n,hl(r);r.lookahead>=3;){let l=r.strstart,u=r.lookahead-2;do r.ins_h=To(r,r.ins_h,r.window[l+3-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--u);r.strstart=l,r.lookahead=2,hl(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=o,e.input=a,e.avail_in=s,r.wrap=i,lr},deflateInfo:"pako deflate (from Nodeca project)"};const IA=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var r0={assign:function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const t=n.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const r in t)IA(t,r)&&(e[r]=t[r])}}return e},flattenChunks:e=>{let n=0;for(let r=0,i=e.length;r=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Rc[254]=Rc[254]=1;var Lc={string2buf:e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let n,t,r,i,s,o=e.length,a=0;for(i=0;i>>6,n[s++]=128|63&t):t<65536?(n[s++]=224|t>>>12,n[s++]=128|t>>>6&63,n[s++]=128|63&t):(n[s++]=240|t>>>18,n[s++]=128|t>>>12&63,n[s++]=128|t>>>6&63,n[s++]=128|63&t);return n},buf2string:(e,n)=>{const t=n||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,n));let r,i;const s=new Array(2*t);for(i=0,r=0;r4)s[i++]=65533,r+=a-1;else{for(o&=a===2?31:a===3?15:7;a>1&&r1?s[i++]=65533:o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|1023&o)}}return((o,a)=>{if(a<65534&&o.subarray&&IC)return String.fromCharCode.apply(null,o.length===a?o:o.subarray(0,a));let l="";for(let u=0;u{(n=n||e.length)>e.length&&(n=e.length);let t=n-1;for(;t>=0&&(192&e[t])==128;)t--;return t<0||t===0?n:t+Rc[e[t]]>n?t:n}},AC=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const MC=Object.prototype.toString,{Z_NO_FLUSH:AA,Z_SYNC_FLUSH:MA,Z_FULL_FLUSH:xA,Z_FINISH:OA,Z_OK:tf,Z_STREAM_END:kA,Z_DEFAULT_COMPRESSION:RA,Z_DEFAULT_STRATEGY:LA,Z_DEFLATED:DA}=Da;function Zu(e){this.options=r0.assign({level:RA,method:DA,chunkSize:16384,windowBits:15,memLevel:8,strategy:LA},e||{});let n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new AC,this.strm.avail_out=0;let t=Yu.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(t!==tf)throw new Error(wa[t]);if(n.header&&Yu.deflateSetHeader(this.strm,n.header),n.dictionary){let r;if(r=typeof n.dictionary=="string"?Lc.string2buf(n.dictionary):MC.call(n.dictionary)==="[object ArrayBuffer]"?new Uint8Array(n.dictionary):n.dictionary,t=Yu.deflateSetDictionary(this.strm,r),t!==tf)throw new Error(wa[t]);this._dict_set=!0}}function dp(e,n){const t=new Zu(n);if(t.push(e,!0),t.err)throw t.msg||wa[t.err];return t.result}Zu.prototype.push=function(e,n){const t=this.strm,r=this.options.chunkSize;let i,s;if(this.ended)return!1;for(s=n===~~n?n:n===!0?OA:AA,typeof e=="string"?t.input=Lc.string2buf(e):MC.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;)if(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),(s===MA||s===xA)&&t.avail_out<=6)this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;else{if(i=Yu.deflate(t,s),i===kA)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),i=Yu.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===tf;if(t.avail_out!==0){if(s>0&&t.next_out>0)this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;else if(t.avail_in===0)break}else this.onData(t.output)}return!0},Zu.prototype.onData=function(e){this.chunks.push(e)},Zu.prototype.onEnd=function(e){e===tf&&(this.result=r0.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var UA={Deflate:Zu,deflate:dp,deflateRaw:function(e,n){return(n=n||{}).raw=!0,dp(e,n)},gzip:function(e,n){return(n=n||{}).gzip=!0,dp(e,n)},constants:Da};const wd=16209;var PA=function(e,n){let t,r,i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S,w,N,A,k,I;const M=e.state;t=e.next_in,k=e.input,r=t+(e.avail_in-5),i=e.next_out,I=e.output,s=i-(n-e.avail_out),o=i+(e.avail_out-257),a=M.dmax,l=M.wsize,u=M.whave,c=M.wnext,d=M.window,h=M.hold,f=M.bits,p=M.lencode,g=M.distcode,b=(1<>>24,h>>>=E,f-=E,E=_>>>16&255,E===0)I[i++]=65535&_;else{if(!(16&E)){if(64&E){if(32&E){M.mode=16191;break e}e.msg="invalid literal/length code",M.mode=wd;break e}_=p[(65535&_)+(h&(1<>>=E,f-=E),f<15&&(h+=k[t++]<>>24,h>>>=E,f-=E,E=_>>>16&255,16&E){if(w=65535&_,E&=15,fa){e.msg="invalid distance too far back",M.mode=wd;break e}if(h>>>=E,f-=E,E=i-s,w>E){if(E=w-E,E>u&&M.sane){e.msg="invalid distance too far back",M.mode=wd;break e}if(N=0,A=d,c===0){if(N+=l-E,E2;)I[i++]=A[N++],I[i++]=A[N++],I[i++]=A[N++],S-=3;S&&(I[i++]=A[N++],S>1&&(I[i++]=A[N++]))}else{N=i-w;do I[i++]=I[N++],I[i++]=I[N++],I[i++]=I[N++],S-=3;while(S>2);S&&(I[i++]=I[N++],S>1&&(I[i++]=I[N++]))}break}if(64&E){e.msg="invalid distance code",M.mode=wd;break e}_=g[(65535&_)+(h&(1<>3,t-=S,f-=S<<3,h&=(1<{const l=a.bits;let u,c,d,h,f,p,g=0,b=0,m=0,_=0,E=0,S=0,w=0,N=0,A=0,k=0,I=null;const M=new Uint16Array(16),U=new Uint16Array(16);let z,H,W,Q=null;for(g=0;g<=Nd;g++)M[g]=0;for(b=0;b=1&&M[_]===0;_--);if(E>_&&(E=_),_===0)return i[s++]=20971520,i[s++]=20971520,a.bits=1,0;for(m=1;m<_&&M[m]===0;m++);for(E0&&(e===0||_!==1))return-1;for(U[1]=0,g=1;g852||e===2&&A>592)return 1;for(;;){z=g-w,o[b]+1=p?(H=Q[o[b]-p],W=I[o[b]-p]):(H=96,W=0),u=1<>w)+c]=z<<24|H<<16|W;while(c!==0);for(u=1<>=1;if(u!==0?(k&=u-1,k+=u):k=0,b++,--M[g]==0){if(g===_)break;g=n[t+o[b]]}if(g>E&&(k&h)!==d){for(w===0&&(w=E),f+=m,S=g-w,N=1<852||e===2&&A>592)return 1;d=k&h,i[d]=E<<24|S<<16|f-s}}return k!==0&&(i[f+k]=g-w<<24|64<<16),a.bits=E,0};const{Z_FINISH:v1,Z_BLOCK:$A,Z_TREES:Id,Z_OK:Yo,Z_STREAM_END:GA,Z_NEED_DICT:zA,Z_STREAM_ERROR:yi,Z_DATA_ERROR:y1,Z_MEM_ERROR:E1,Z_BUF_ERROR:VA,Z_DEFLATED:b1}=Da,i0=16180,Ad=16190,vs=16191,hp=16192,fp=16194,Md=16199,xd=16200,pp=16206,Zt=16209,C1=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function qA(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const ia=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.mode16211?1:0},xC=e=>{if(ia(e))return yi;const n=e.state;return e.total_in=e.total_out=n.total=0,e.msg="",n.wrap&&(e.adler=1&n.wrap),n.mode=i0,n.last=0,n.havedict=0,n.flags=-1,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new Int32Array(852),n.distcode=n.distdyn=new Int32Array(592),n.sane=1,n.back=-1,Yo},OC=e=>{if(ia(e))return yi;const n=e.state;return n.wsize=0,n.whave=0,n.wnext=0,xC(e)},kC=(e,n)=>{let t;if(ia(e))return yi;const r=e.state;return n<0?(t=0,n=-n):(t=5+(n>>4),n<48&&(n&=15)),n&&(n<8||n>15)?yi:(r.window!==null&&r.wbits!==n&&(r.window=null),r.wrap=t,r.wbits=n,OC(e))},S1=(e,n)=>{if(!e)return yi;const t=new qA;e.state=t,t.strm=e,t.window=null,t.mode=i0;const r=kC(e,n);return r!==Yo&&(e.state=null),r};let _p,mp,T1=!0;const WA=e=>{if(T1){_p=new Int32Array(512),mp=new Int32Array(32);let n=0;for(;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(Xu(1,e.lens,0,288,_p,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;Xu(2,e.lens,0,32,mp,0,e.work,{bits:5}),T1=!1}e.lencode=_p,e.lenbits=9,e.distcode=mp,e.distbits=5},w1=(e,n,t,r)=>{let i;const s=e.state;return s.window===null&&(s.wsize=1<=s.wsize?(s.window.set(n.subarray(t-s.wsize,t),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),s.window.set(n.subarray(t-r,t-r+i),s.wnext),(r-=i)?(s.window.set(n.subarray(t-r,t),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whaveS1(e,15),inflateInit2:S1,inflate:(e,n)=>{let t,r,i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S,w,N,A,k=0;const I=new Uint8Array(4);let M,U;const z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ia(e)||!e.output||!e.input&&e.avail_in!==0)return yi;t=e.state,t.mode===vs&&(t.mode=hp),o=e.next_out,i=e.output,l=e.avail_out,s=e.next_in,r=e.input,a=e.avail_in,u=t.hold,c=t.bits,d=a,h=l,A=Yo;e:for(;;)switch(t.mode){case i0:if(t.wrap===0){t.mode=hp;break}for(;c<16;){if(a===0)break e;a--,u+=r[s++]<>>8&255,t.check=Xn(t.check,I,2,0),u=0,c=0,t.mode=16181;break}if(t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",t.mode=Zt;break}if((15&u)!==b1){e.msg="unknown compression method",t.mode=Zt;break}if(u>>>=4,c-=4,N=8+(15&u),t.wbits===0&&(t.wbits=N),N>15||N>t.wbits){e.msg="invalid window size",t.mode=Zt;break}t.dmax=1<>8&1),512&t.flags&&4&t.wrap&&(I[0]=255&u,I[1]=u>>>8&255,t.check=Xn(t.check,I,2,0)),u=0,c=0,t.mode=16182;case 16182:for(;c<32;){if(a===0)break e;a--,u+=r[s++]<>>8&255,I[2]=u>>>16&255,I[3]=u>>>24&255,t.check=Xn(t.check,I,4,0)),u=0,c=0,t.mode=16183;case 16183:for(;c<16;){if(a===0)break e;a--,u+=r[s++]<>8),512&t.flags&&4&t.wrap&&(I[0]=255&u,I[1]=u>>>8&255,t.check=Xn(t.check,I,2,0)),u=0,c=0,t.mode=16184;case 16184:if(1024&t.flags){for(;c<16;){if(a===0)break e;a--,u+=r[s++]<>>8&255,t.check=Xn(t.check,I,2,0)),u=0,c=0}else t.head&&(t.head.extra=null);t.mode=16185;case 16185:if(1024&t.flags&&(f=t.length,f>a&&(f=a),f&&(t.head&&(N=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(r.subarray(s,s+f),N)),512&t.flags&&4&t.wrap&&(t.check=Xn(t.check,r,f,s)),a-=f,s+=f,t.length-=f),t.length))break e;t.length=0,t.mode=16186;case 16186:if(2048&t.flags){if(a===0)break e;f=0;do N=r[s+f++],t.head&&N&&t.length<65536&&(t.head.name+=String.fromCharCode(N));while(N&&f>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=vs;break;case 16189:for(;c<32;){if(a===0)break e;a--,u+=r[s++]<>>=7&c,c-=7&c,t.mode=pp;break}for(;c<3;){if(a===0)break e;a--,u+=r[s++]<>>=1,c-=1,3&u){case 0:t.mode=16193;break;case 1:if(WA(t),t.mode=Md,n===Id){u>>>=2,c-=2;break e}break;case 2:t.mode=16196;break;case 3:e.msg="invalid block type",t.mode=Zt}u>>>=2,c-=2;break;case 16193:for(u>>>=7&c,c-=7&c;c<32;){if(a===0)break e;a--,u+=r[s++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=Zt;break}if(t.length=65535&u,u=0,c=0,t.mode=fp,n===Id)break e;case fp:t.mode=16195;case 16195:if(f=t.length,f){if(f>a&&(f=a),f>l&&(f=l),f===0)break e;i.set(r.subarray(s,s+f),o),a-=f,s+=f,l-=f,o+=f,t.length-=f;break}t.mode=vs;break;case 16196:for(;c<14;){if(a===0)break e;a--,u+=r[s++]<>>=5,c-=5,t.ndist=1+(31&u),u>>>=5,c-=5,t.ncode=4+(15&u),u>>>=4,c-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=Zt;break}t.have=0,t.mode=16197;case 16197:for(;t.have>>=3,c-=3}for(;t.have<19;)t.lens[z[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,M={bits:t.lenbits},A=Xu(0,t.lens,0,19,t.lencode,0,t.work,M),t.lenbits=M.bits,A){e.msg="invalid code lengths set",t.mode=Zt;break}t.have=0,t.mode=16198;case 16198:for(;t.have>>24,m=k>>>16&255,_=65535&k,!(b<=c);){if(a===0)break e;a--,u+=r[s++]<>>=b,c-=b,t.lens[t.have++]=_;else{if(_===16){for(U=b+2;c>>=b,c-=b,t.have===0){e.msg="invalid bit length repeat",t.mode=Zt;break}N=t.lens[t.have-1],f=3+(3&u),u>>>=2,c-=2}else if(_===17){for(U=b+3;c>>=b,c-=b,N=0,f=3+(7&u),u>>>=3,c-=3}else{for(U=b+7;c>>=b,c-=b,N=0,f=11+(127&u),u>>>=7,c-=7}if(t.have+f>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=Zt;break}for(;f--;)t.lens[t.have++]=N}}if(t.mode===Zt)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=Zt;break}if(t.lenbits=9,M={bits:t.lenbits},A=Xu(1,t.lens,0,t.nlen,t.lencode,0,t.work,M),t.lenbits=M.bits,A){e.msg="invalid literal/lengths set",t.mode=Zt;break}if(t.distbits=6,t.distcode=t.distdyn,M={bits:t.distbits},A=Xu(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,M),t.distbits=M.bits,A){e.msg="invalid distances set",t.mode=Zt;break}if(t.mode=Md,n===Id)break e;case Md:t.mode=xd;case xd:if(a>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=s,e.avail_in=a,t.hold=u,t.bits=c,PA(e,h),o=e.next_out,i=e.output,l=e.avail_out,s=e.next_in,r=e.input,a=e.avail_in,u=t.hold,c=t.bits,t.mode===vs&&(t.back=-1);break}for(t.back=0;k=t.lencode[u&(1<>>24,m=k>>>16&255,_=65535&k,!(b<=c);){if(a===0)break e;a--,u+=r[s++]<>E)],b=k>>>24,m=k>>>16&255,_=65535&k,!(E+b<=c);){if(a===0)break e;a--,u+=r[s++]<>>=E,c-=E,t.back+=E}if(u>>>=b,c-=b,t.back+=b,t.length=_,m===0){t.mode=16205;break}if(32&m){t.back=-1,t.mode=vs;break}if(64&m){e.msg="invalid literal/length code",t.mode=Zt;break}t.extra=15&m,t.mode=16201;case 16201:if(t.extra){for(U=t.extra;c>>=t.extra,c-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=16202;case 16202:for(;k=t.distcode[u&(1<>>24,m=k>>>16&255,_=65535&k,!(b<=c);){if(a===0)break e;a--,u+=r[s++]<>E)],b=k>>>24,m=k>>>16&255,_=65535&k,!(E+b<=c);){if(a===0)break e;a--,u+=r[s++]<>>=E,c-=E,t.back+=E}if(u>>>=b,c-=b,t.back+=b,64&m){e.msg="invalid distance code",t.mode=Zt;break}t.offset=_,t.extra=15&m,t.mode=16203;case 16203:if(t.extra){for(U=t.extra;c>>=t.extra,c-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=Zt;break}t.mode=16204;case 16204:if(l===0)break e;if(f=h-l,t.offset>f){if(f=t.offset-f,f>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=Zt;break}f>t.wnext?(f-=t.wnext,p=t.wsize-f):p=t.wnext-f,f>t.length&&(f=t.length),g=t.window}else g=i,p=o-t.offset,f=t.length;f>l&&(f=l),l-=f,t.length-=f;do i[o++]=g[p++];while(--f);t.length===0&&(t.mode=xd);break;case 16205:if(l===0)break e;i[o++]=t.length,l--,t.mode=xd;break;case pp:if(t.wrap){for(;c<32;){if(a===0)break e;a--,u|=r[s++]<{if(ia(e))return yi;let n=e.state;return n.window&&(n.window=null),e.state=null,Yo},inflateGetHeader:(e,n)=>{if(ia(e))return yi;const t=e.state;return 2&t.wrap?(t.head=n,n.done=!1,Yo):yi},inflateSetDictionary:(e,n)=>{const t=n.length;let r,i,s;return ia(e)?yi:(r=e.state,r.wrap!==0&&r.mode!==Ad?yi:r.mode===Ad&&(i=1,i=Qu(i,n,t,0),i!==r.check)?y1:(s=w1(e,n,t,t),s?(r.mode=16210,E1):(r.havedict=1,Yo)))},inflateInfo:"pako inflate (from Nodeca project)"},KA=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const RC=Object.prototype.toString,{Z_NO_FLUSH:QA,Z_FINISH:YA,Z_OK:Ju,Z_STREAM_END:gp,Z_NEED_DICT:vp,Z_STREAM_ERROR:ZA,Z_DATA_ERROR:N1,Z_MEM_ERROR:XA}=Da;function ec(e){this.options=r0.assign({chunkSize:65536,windowBits:15,to:""},e||{});const n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),!(n.windowBits>=0&&n.windowBits<16)||e&&e.windowBits||(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(15&n.windowBits||(n.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new AC,this.strm.avail_out=0;let t=Is.inflateInit2(this.strm,n.windowBits);if(t!==Ju)throw new Error(wa[t]);if(this.header=new KA,Is.inflateGetHeader(this.strm,this.header),n.dictionary&&(typeof n.dictionary=="string"?n.dictionary=Lc.string2buf(n.dictionary):RC.call(n.dictionary)==="[object ArrayBuffer]"&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(t=Is.inflateSetDictionary(this.strm,n.dictionary),t!==Ju)))throw new Error(wa[t])}function yp(e,n){const t=new ec(n);if(t.push(e),t.err)throw t.msg||wa[t.err];return t.result}ec.prototype.push=function(e,n){const t=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let s,o,a;if(this.ended)return!1;for(o=n===~~n?n:n===!0?YA:QA,RC.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),s=Is.inflate(t,o),s===vp&&i&&(s=Is.inflateSetDictionary(t,i),s===Ju?s=Is.inflate(t,o):s===N1&&(s=vp));t.avail_in>0&&s===gp&&t.state.wrap>0&&e[t.next_in]!==0;)Is.inflateReset(t),s=Is.inflate(t,o);switch(s){case ZA:case N1:case vp:case XA:return this.onEnd(s),this.ended=!0,!1}if(a=t.avail_out,t.next_out&&(t.avail_out===0||s===gp))if(this.options.to==="string"){let l=Lc.utf8border(t.output,t.next_out),u=t.next_out-l,c=Lc.buf2string(t.output,l);t.next_out=u,t.avail_out=r-u,u&&t.output.set(t.output.subarray(l,l+u),0),this.onData(c)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(s!==Ju||a!==0){if(s===gp)return s=Is.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},ec.prototype.onData=function(e){this.chunks.push(e)},ec.prototype.onEnd=function(e){e===Ju&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=r0.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var JA={Inflate:ec,inflate:yp,inflateRaw:function(e,n){return(n=n||{}).raw=!0,yp(e,n)},ungzip:yp,constants:Da};const{Deflate:e6,deflate:t6,deflateRaw:n6,gzip:r6}=UA,{Inflate:i6,inflate:s6,inflateRaw:o6,ungzip:a6}=JA;var as,l6={Deflate:e6,deflate:t6,deflateRaw:n6,gzip:r6,Inflate:i6,inflate:s6,inflateRaw:o6,ungzip:a6,constants:Da},I1=function(e){return y(void 0,void 0,void 0,function(){var n;return v(this,function(t){return n=l6.ungzip(e),[2,String.fromCharCode.apply(null,n)]})})};(function(e){e.CONNECTING="CONNECTING",e.OPEN="OPEN",e.CLOSED="CLOSED"})(as||(as={}));var rt,u6=function(e){function n(t,r){var i=r.sdkState,s=r.dispatcher,o=r.logger,a=e.call(this)||this;return a.lastActive=0,a._iid=t,a._sdkState=i,a._dispatcher=s,a._logger=o,a}return T(n,e),Object.defineProperty(n.prototype,"isOpen",{get:function(){return this.connectionState===as.OPEN},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"connectionState",{get:function(){if(this._ws)switch(this._ws.readyState){case 0:return as.CONNECTING;case 1:return as.OPEN}return as.CLOSED},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ws",{get:function(){var t;return(t=this._ws)!==null&&t!==void 0?t:null},enumerable:!1,configurable:!0}),n.prototype._handleMessage=function(t){var r=this;t.split(` +`)},n}(Tt),zg=function(e){function n(t){var r=t.userId,i=t.authToken,s=t.services,o=t.expiringSession,a=o===void 0||o,l=e.call(this)||this;return l.path="".concat(Xe,"/").concat(r,"/session_key"),l.method=Z.POST,l.params=ye({token:i,services:s,expiring_session:!!a}),l.requireAuth=!1,l}return T(n,e),n}(J),rA=function(e){function n(t){var r=t.authToken,i=t.expiringSession,s=i===void 0||i,o=t.requestId,a=o===void 0?void 0:o;return e.call(this,{code:"LOGI",payload:ye({token:r,expiring_session:s?1:0,req_id:a}),ackRequired:!0})||this}return T(n,e),n}(wr),iA=function(e){function n(t,r){var i=e.call(this,t,r)||this,s=r.key,o=r.expires_at,a=r.services;return i.key=s,i.expiresAt=o,i.services=a,i}return T(n,e),n}(se),sA=function(e){function n(t,r,i){var s,o=this;return(o=e.call(this,t,"LOGI",i)||this).error=null,o.newKey=null,o.newKey=(s=i.new_key)!==null&&s!==void 0?s:null,o.error=i.error?new L(i):null,o}return T(n,e),n}(gt),Vg=function(e){function n(t){var r=e.call(this)||this;return r.statLog=t,r}return T(n,e),n}(Tt),pC=function(e){function n(t){var r=t.request,i=t.deferred,s=t.error,o=s===void 0?L.requestFailed:s,a=e.call(this)||this;return a.request=r,a.deferred=i,a.error=o,a}return T(n,e),n}(Tt);(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"})(Et||(Et={}));var X_,fa,lo,$t=function(){function e(n){var t=n.type,r=n.data,i=n.ts,s=i===void 0?Date.now():i;this.type=t,this.createdAt=s,this.data=r}return e.payloadify=function(n){return ye({stat_type:n.type,ts:n.createdAt,data:ye(n.data)})},e}(),J_=function(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product=="ReactNative"},i1=function(){return!(typeof navigator>"u"||!/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"})(X_||(X_={})),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"}(fa||(fa={})),function(e){e.ANDROID="android",e.IOS="ios",e.WEB="web",e.MOBILE_WEB="mobile_web",e.WINDOWS="windows"}(lo||(lo={}));var oA="^(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-]+)*))?$",Zh=function(){function e(){}return e.sendbirdSdkUserAgentWithExtension=function(n){var t=J_()?fa.REACT_NATIVE:fa.JS,r={main_sdk_info:"chat/".concat(t,"/").concat(bo.SDK_VERSION),device_os_platform:i1()?"mobile-web":"web",os_version:bo.OS_VERSION};if(n){var i=n.sendbirdExtensions,s=n.deviceOS,o=n.customData,a=o===void 0?{}:o;s.version&&(r.os_version=s.version),s.platform&&(r.device_os_platform=s.platform),i.length>0&&(r.extension_sdk_info=i.map(function(l){var u=l.product,c=l.platform,d=l.version;return"".concat(u,"/").concat(c,"/").concat(d)}).join(",")),Object.keys(r).forEach(function(l){return delete a[l]}),Object.keys(a).length>0&&(r=x(x({},r),a))}return Object.entries(r).map(function(l){var u=Ae(l,2),c=u[0],d=u[1];return"".concat(c,"=").concat(d)}).join("&")},e.userAgentWithExtension=function(n){var t=J_()?"reactnative":"JS",r=n.sb_syncmanager?"s".concat(n.sb_syncmanager):"",i=n.sb_uikit?"u".concat(n.sb_uikit):"",s=n["device-os-platform"]?"o".concat(n["device-os-platform"]):i1()?"omobile-web":"oweb";return"".concat(t,"/c").concat(bo.SDK_VERSION,"/").concat(r,"/").concat(i,"/").concat(s)},e}(),Tr=function(){var e=this;this.promise=new Promise(function(n,t){e.resolve=n,e.reject=function(r){t(r)}})},Xh=function(e){function n(t){var r=e.call(this)||this;return r.requestId=t.requestId,r}return T(n,e),n}(Tt),_C=function(e){function n(t){var r=e.call(this)||this;return r.method=Z.DELETE,r.path="".concat(Je(t.channelType),"/").concat(t.channelUrl,"/messages/").concat(t.messageId),t.messageToken&&(r.params=ye({mesg_token:t.messageToken})),r}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var aA=function(e){function n(t,r,i){var s,o=this;return(o=e.call(this,t,"DELM",i)||this).channelUrl=i.channel_url,o.channelType=i.channel_type,o.messageId=Number(i.msg_id),o.silent=i.silent,o.messageCreatedAt=i.message_created_at?Number(i.message_created_at):-1,o.senderId=(s=i.sender_id)!==null&&s!==void 0?s:void 0,o}return T(n,e),n}(gt),lA=function(){function e(n,t){var r=t.session,i=t.sdkState,s=t.dispatcher,o=t.logger,a=t.useFetchCompat,l=a!==void 0&&a,u=this;this._abortControl=new Map,this._shouldImportFetchCompat=!1,this._iid=n,this._session=r,this._sdkState=i,this._dispatcher=s,this._dispatcher.on(function(c){c instanceof nA&&u.cancel(c.requestId)}),this._logger=o,this._shouldImportFetchCompat=l}return e.prototype._createHeader=function(n,t){var r=this._sdkState,i=r.appId,s=r.appVersion,o=r.sendbirdRuntimeEnvironment,a=x(x({},n.headers),{SendBird:"JS,".concat(bo.OS_VERSION,",").concat(bo.SDK_VERSION,",").concat(i).concat(s?",".concat(s):""),"SB-User-Agent":Zh.userAgentWithExtension(this._sdkState.extensions),"Request-Sent-Timestamp":Date.now().toString(),"SB-SDK-User-Agent":Zh.sendbirdSdkUserAgentWithExtension(o)});return t||(a["Content-Type"]="application/json; charset=utf-8"),n.requireAuth&&!n.hasSessionKey&&this._session.hasSession&&(a["Session-Key"]=this._session.sessionKey),a["App-Id"]=i,this._session&&this._session.authToken&&(a["Access-Token"]=this._session.authToken),a},e.prototype._statLogApiResult=function(n,t,r){this._dispatcher.dispatch(new Vg(new $t({type:Et.API_RESULT,data:{endpoint:n.path,method:n.method,success:!r,latency:Date.now()-t,error_code:r==null?void 0:r.code,error_description:r==null?void 0:r.message}})))},e.prototype._isBodyRequired=function(n){var t=n.method;return t!==Z.GET&&(t!==Z.DELETE||n instanceof _C)},e.prototype.send=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S,w;return v(this,function(N){switch(N.label){case 0:t=n.path,r=n.method,i=n.uploadProgressHandler,s=this._isBodyRequired(n),o=this._sdkState.api,a="".concat(o.host).concat(t).concat(s?"":n.query),l=s?n.payload:null,u=this._createHeader(n,l instanceof FormData?l:void 0),c=new AbortController,d=c.signal,this._abortControl.set(n.requestId,c),h=Date.now(),N.label=1;case 1:return N.trys.push([1,13,,14]),i?[4,ip(()=>import("./__bundle-a2788ee7-qI2cAaF_.js"),[])]:[3,6];case 2:f=N.sent().xmlHttpRequest,N.label=3;case 3:return N.trys.push([3,5,,6]),[4,f(this._iid,{requestId:n.requestId,method:n.method,url:a,headers:u,data:l??void 0,uploadProgressHandler:i})];case 4:return p=N.sent(),this._logger.debug("receive api response",n.requestId),this._statLogApiResult(n,h),[2,p];case 5:if(!((g=N.sent())instanceof L&&g.code===Te.XMLHTTPREQUEST_NOT_SUPPORTED))throw g;return this._logger.debug("XMLHttpRequest is not available in this environment. progressHandler is ignored."),[3,6];case 6:return this._shouldImportFetchCompat&&(this._shouldImportFetchCompat=!1,(typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{fetch:null}).fetch=null),typeof AbortController<"u"?[3,8]:[4,ip(()=>import("./__bundle-2aa1a987-DhydpHT3.js").then(A=>A._),[])];case 7:N.sent(),N.label=8;case 8:return typeof fetch=="function"?[3,10]:[4,ip(()=>import("./__bundle-347d730c-BfmsRuYe.js").then(A=>A._),[])];case 9:N.sent(),N.label=10;case 10:return[4,fetch(a,{method:r,body:l,headers:u,signal:d})];case 11:return[4,(b=N.sent()).json()];case 12:if(m=N.sent(),b.ok||b.redirected)return this._logger.debug("receive api response",n.requestId),this._statLogApiResult(n,h),[2,new se(this._iid,m)];if(m){if((_=new L(m)).isSessionExpiredError){if(this._dispatcher.dispatch(new Ul({reason:_.code,message:_.message})),!(n instanceof zg))return E=new Tr,this._dispatcher.dispatch(new pC({request:n,deferred:E,error:_})),[2,E.promise];throw _}throw _.isSessionInvalidatedError&&this._dispatcher.dispatch(new Ul({reason:_.code,message:_.message})),_}throw L.requestFailed;case 13:throw S=N.sent(),this._statLogApiResult(n,h,S),S instanceof L?(this._logger.debug("fail api request",S),S):(S==null?void 0:S.name)==="AbortError"?L.requestCanceled:(w=L.networkError,this._logger.debug("fail api request",w),w);case 14:return[2]}})})},e.prototype.cancel=function(n){this._abortControl.has(n)&&(this._abortControl.get(n).abort(),this._abortControl.delete(n)),this._dispatcher.dispatch(new Xh({requestId:n}))},e.prototype.cancelAll=function(){var n,t;try{for(var r=pe(this._abortControl.values()),i=r.next();!i.done;i=r.next())i.value.abort()}catch(s){n={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(n)throw n.error}}this._abortControl.clear(),this._dispatcher.dispatch(new Xh({}))},e}(),qe=function(){};function Wl(e){let n=e.length;for(;--n>=0;)e[n]=0}const qg=256,mC=286,Vu=30,qu=15,em=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]),ch=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]),uA=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),s1=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ss=new Array(576);Wl(Ss);const Wu=new Array(60);Wl(Wu);const Oc=new Array(512);Wl(Oc);const Ku=new Array(256);Wl(Ku);const Wg=new Array(29);Wl(Wg);const Jh=new Array(Vu);function sp(e,n,t,r,i){this.static_tree=e,this.extra_bits=n,this.extra_base=t,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let o1,a1,l1;function op(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}Wl(Jh);const gC=e=>e<256?Oc[e]:Oc[256+(e>>>7)],kc=(e,n)=>{e.pending_buf[e.pending++]=255&n,e.pending_buf[e.pending++]=n>>>8&255},zr=(e,n,t)=>{e.bi_valid>16-t?(e.bi_buf|=n<>16-e.bi_valid,e.bi_valid+=t-16):(e.bi_buf|=n<{zr(e,t[2*n],t[2*n+1])},vC=(e,n)=>{let t=0;do t|=1&e,e>>>=1,t<<=1;while(--n>0);return t>>>1},yC=(e,n,t)=>{const r=new Array(16);let i,s,o=0;for(i=1;i<=qu;i++)o=o+t[i-1]<<1,r[i]=o;for(s=0;s<=n;s++){let a=e[2*s+1];a!==0&&(e[2*s]=vC(r[a]++,a))}},EC=e=>{let n;for(n=0;n{e.bi_valid>8?kc(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},u1=(e,n,t,r)=>{const i=2*n,s=2*t;return e[i]{const r=e.heap[t];let i=t<<1;for(;i<=e.heap_len&&(i{let r,i,s,o,a=0;if(e.sym_next!==0)do r=255&e.pending_buf[e.sym_buf+a++],r+=(255&e.pending_buf[e.sym_buf+a++])<<8,i=e.pending_buf[e.sym_buf+a++],r===0?os(e,i,n):(s=Ku[i],os(e,s+qg+1,n),o=em[s],o!==0&&(i-=Wg[s],zr(e,i,o)),r--,s=gC(r),os(e,s,t),o=ch[s],o!==0&&(r-=Jh[s],zr(e,r,o)));while(a{const t=n.dyn_tree,r=n.stat_desc.static_tree,i=n.stat_desc.has_stree,s=n.stat_desc.elems;let o,a,l,u=-1;for(e.heap_len=0,e.heap_max=573,o=0;o>1;o>=1;o--)ap(e,t,o);l=s;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ap(e,t,1),a=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=a,t[2*l]=t[2*o]+t[2*a],e.depth[l]=(e.depth[o]>=e.depth[a]?e.depth[o]:e.depth[a])+1,t[2*o+1]=t[2*a+1]=l,e.heap[1]=l++,ap(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((c,d)=>{const h=d.dyn_tree,f=d.max_code,p=d.stat_desc.static_tree,g=d.stat_desc.has_stree,b=d.stat_desc.extra_bits,m=d.stat_desc.extra_base,_=d.stat_desc.max_length;let E,S,w,N,A,k,I=0;for(N=0;N<=qu;N++)c.bl_count[N]=0;for(h[2*c.heap[c.heap_max]+1]=0,E=c.heap_max+1;E<573;E++)S=c.heap[E],N=h[2*h[2*S+1]+1]+1,N>_&&(N=_,I++),h[2*S+1]=N,S>f||(c.bl_count[N]++,A=0,S>=m&&(A=b[S-m]),k=h[2*S],c.opt_len+=k*(N+A),g&&(c.static_len+=k*(p[2*S+1]+A)));if(I!==0){do{for(N=_-1;c.bl_count[N]===0;)N--;c.bl_count[N]--,c.bl_count[N+1]+=2,c.bl_count[_]--,I-=2}while(I>0);for(N=_;N!==0;N--)for(S=c.bl_count[N];S!==0;)w=c.heap[--E],w>f||(h[2*w+1]!==N&&(c.opt_len+=(N-h[2*w+1])*h[2*w],h[2*w+1]=N),S--)}})(e,n),yC(t,u,e.bl_count)},d1=(e,n,t)=>{let r,i,s=-1,o=n[1],a=0,l=7,u=4;for(o===0&&(l=138,u=3),n[2*(t+1)+1]=65535,r=0;r<=t;r++)i=o,o=n[2*(r+1)+1],++a{let r,i,s=-1,o=n[1],a=0,l=7,u=4;for(o===0&&(l=138,u=3),r=0;r<=t;r++)if(i=o,o=n[2*(r+1)+1],!(++a{zr(e,0+(r?1:0),3),bC(e),kc(e,t),kc(e,~t),t&&e.pending_buf.set(e.window.subarray(n,n+t),e.pending),e.pending+=t};var cA=(e,n,t,r)=>{let i,s,o=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=(a=>{let l,u=4093624447;for(l=0;l<=31;l++,u>>>=1)if(1&u&&a.dyn_ltree[2*l]!==0)return 0;if(a.dyn_ltree[18]!==0||a.dyn_ltree[20]!==0||a.dyn_ltree[26]!==0)return 1;for(l=32;l{let l;for(d1(a,a.dyn_ltree,a.l_desc.max_code),d1(a,a.dyn_dtree,a.d_desc.max_code),lp(a,a.bl_desc),l=18;l>=3&&a.bl_tree[2*s1[l]+1]===0;l--);return a.opt_len+=3*(l+1)+5+5+4,l})(e),i=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=i&&(i=s)):i=s=t+5,t+4<=i&&n!==-1?CC(e,n,t,r):e.strategy===4||s===i?(zr(e,2+(r?1:0),3),c1(e,Ss,Wu)):(zr(e,4+(r?1:0),3),((a,l,u,c)=>{let d;for(zr(a,l-257,5),zr(a,u-1,5),zr(a,c-4,4),d=0;d{f1||((()=>{let n,t,r,i,s;const o=new Array(16);for(r=0,i=0;i<28;i++)for(Wg[i]=r,n=0;n<1<>=7;i(e.pending_buf[e.sym_buf+e.sym_next++]=n,e.pending_buf[e.sym_buf+e.sym_next++]=n>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,n===0?e.dyn_ltree[2*t]++:(e.matches++,n--,e.dyn_ltree[2*(Ku[t]+qg+1)]++,e.dyn_dtree[2*gC(n)]++),e.sym_next===e.sym_end),_tr_align:e=>{zr(e,2,3),os(e,256,Ss),(n=>{n.bi_valid===16?(kc(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=255&n.bi_buf,n.bi_buf>>=8,n.bi_valid-=8)})(e)}},Qu=(e,n,t,r)=>{let i=65535&e,s=e>>>16&65535,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do i=i+n[r++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16};const hA=new Uint32Array((()=>{let e,n=[];for(var t=0;t<256;t++){e=t;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;n[t]=e}return n})());var Xn=(e,n,t,r)=>{const i=hA,s=r+t;e^=-1;for(let o=r;o>>8^i[255&(e^n[o])];return~e},wa={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"},Da={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:fA,_tr_stored_block:tm,_tr_flush_block:pA,_tr_tally:Co,_tr_align:_A}=dA,{Z_NO_FLUSH:So,Z_PARTIAL_FLUSH:mA,Z_FULL_FLUSH:gA,Z_FINISH:Ci,Z_BLOCK:p1,Z_OK:lr,Z_STREAM_END:_1,Z_STREAM_ERROR:es,Z_DATA_ERROR:vA,Z_BUF_ERROR:up,Z_DEFAULT_COMPRESSION:yA,Z_FILTERED:EA,Z_HUFFMAN_ONLY:Td,Z_RLE:bA,Z_FIXED:CA,Z_DEFAULT_STRATEGY:SA,Z_UNKNOWN:TA,Z_DEFLATED:ef}=Da,ra=258,fs=262,Cl=42,Ko=113,wu=666,Qo=(e,n)=>(e.msg=wa[n],n),m1=e=>2*e-(e>4?9:0),io=e=>{let n=e.length;for(;--n>=0;)e[n]=0},wA=e=>{let n,t,r,i=e.w_size;n=e.hash_size,r=n;do t=e.head[--r],e.head[r]=t>=i?t-i:0;while(--n);n=i,r=n;do t=e.prev[--r],e.prev[r]=t>=i?t-i:0;while(--n)};let To=(e,n,t)=>(n<{const n=e.state;let t=n.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(n.pending_buf.subarray(n.pending_out,n.pending_out+t),e.next_out),e.next_out+=t,n.pending_out+=t,e.total_out+=t,e.avail_out-=t,n.pending-=t,n.pending===0&&(n.pending_out=0))},ri=(e,n)=>{pA(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,n),e.block_start=e.strstart,ei(e.strm)},yt=(e,n)=>{e.pending_buf[e.pending++]=n},lu=(e,n)=>{e.pending_buf[e.pending++]=n>>>8&255,e.pending_buf[e.pending++]=255&n},nm=(e,n,t,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,n.set(e.input.subarray(e.next_in,e.next_in+i),t),e.state.wrap===1?e.adler=Qu(e.adler,n,i,t):e.state.wrap===2&&(e.adler=Xn(e.adler,n,i,t)),e.next_in+=i,e.total_in+=i,i)},SC=(e,n)=>{let t,r,i=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match;const l=e.strstart>e.w_size-fs?e.strstart-(e.w_size-fs):0,u=e.window,c=e.w_mask,d=e.prev,h=e.strstart+ra;let f=u[s+o-1],p=u[s+o];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do if(t=n,u[t+o]===p&&u[t+o-1]===f&&u[t]===u[s]&&u[++t]===u[s+1]){s+=2,t++;do;while(u[++s]===u[++t]&&u[++s]===u[++t]&&u[++s]===u[++t]&&u[++s]===u[++t]&&u[++s]===u[++t]&&u[++s]===u[++t]&&u[++s]===u[++t]&&u[++s]===u[++t]&&so){if(e.match_start=n,o=r,r>=a)break;f=u[s+o-1],p=u[s+o]}}while((n=d[n&c])>l&&--i!=0);return o<=e.lookahead?o:e.lookahead},hl=e=>{const n=e.w_size;let t,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-fs)&&(e.window.set(e.window.subarray(n,n+n-r),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,e.insert>e.strstart&&(e.insert=e.strstart),wA(e),r+=n),e.strm.avail_in===0)break;if(t=nm(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=t,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=To(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=To(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead{let t,r,i,s=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,o=0,a=e.strm.avail_in;do{if(t=65535,i=e.bi_valid+42>>3,e.strm.avail_outr+e.strm.avail_in&&(t=r+e.strm.avail_in),t>i&&(t=i),t>8,e.pending_buf[e.pending-2]=~t,e.pending_buf[e.pending-1]=~t>>8,ei(e.strm),r&&(r>t&&(r=t),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,t-=r),t&&(nm(e.strm,e.strm.output,e.strm.next_out,t),e.strm.next_out+=t,e.strm.avail_out-=t,e.strm.total_out+=t)}while(o===0);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.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_wateri&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,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++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(nm(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,s=i>e.w_size?e.w_size:i,r=e.strstart-e.block_start,(r>=s||(r||n===Ci)&&n!==So&&e.strm.avail_in===0&&r<=i)&&(t=r>i?i:r,o=n===Ci&&e.strm.avail_in===0&&t===r?1:0,tm(e,e.block_start,t,o),e.block_start+=t,ei(e.strm)),o?3:1)},cp=(e,n)=>{let t,r;for(;;){if(e.lookahead=3&&(e.ins_h=To(e,e.ins_h,e.window[e.strstart+3-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-fs&&(e.match_length=SC(e,t)),e.match_length>=3)if(r=Co(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do e.strstart++,e.ins_h=To(e,e.ins_h,e.window[e.strstart+3-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!=0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=To(e,e.ins_h,e.window[e.strstart+1]);else r=Co(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(ri(e,!1),e.strm.avail_out===0))return 1}return e.insert=e.strstart<2?e.strstart:2,n===Ci?(ri(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(ri(e,!1),e.strm.avail_out===0)?1:2},qa=(e,n)=>{let t,r,i;for(;;){if(e.lookahead=3&&(e.ins_h=To(e,e.ins_h,e.window[e.strstart+3-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,t!==0&&e.prev_length4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=Co(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=To(e,e.ins_h,e.window[e.strstart+3-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!=0);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(ri(e,!1),e.strm.avail_out===0))return 1}else if(e.match_available){if(r=Co(e,0,e.window[e.strstart-1]),r&&ri(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Co(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,n===Ci?(ri(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(ri(e,!1),e.strm.avail_out===0)?1:2};function Xi(e,n,t,r,i){this.good_length=e,this.max_lazy=n,this.nice_length=t,this.max_chain=r,this.func=i}const Nu=[new Xi(0,0,0,0,TC),new Xi(4,4,8,4,cp),new Xi(4,5,16,8,cp),new Xi(4,6,32,32,cp),new Xi(4,4,16,16,qa),new Xi(8,16,32,32,qa),new Xi(8,16,128,128,qa),new Xi(8,32,128,256,qa),new Xi(32,128,258,1024,qa),new Xi(32,258,258,4096,qa)];function NA(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ef,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),io(this.dyn_ltree),io(this.dyn_dtree),io(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),io(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),io(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Iu=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.status!==Cl&&n.status!==57&&n.status!==69&&n.status!==73&&n.status!==91&&n.status!==103&&n.status!==Ko&&n.status!==wu?1:0},wC=e=>{if(Iu(e))return Qo(e,es);e.total_in=e.total_out=0,e.data_type=TA;const n=e.state;return n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap===2?57:n.wrap?Cl:Ko,e.adler=n.wrap===2?0:1,n.last_flush=-2,fA(n),lr},NC=e=>{const n=wC(e);var t;return n===lr&&((t=e.state).window_size=2*t.w_size,io(t.head),t.max_lazy_match=Nu[t.level].max_lazy,t.good_match=Nu[t.level].good_length,t.nice_match=Nu[t.level].nice_length,t.max_chain_length=Nu[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),n},g1=(e,n,t,r,i,s)=>{if(!e)return es;let o=1;if(n===yA&&(n=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>9||t!==ef||r<8||r>15||n<0||n>9||s<0||s>CA||r===8&&o!==1)return Qo(e,es);r===8&&(r=9);const a=new NA;return e.state=a,a.strm=e,a.status=Cl,a.wrap=o,a.gzhead=null,a.w_bits=r,a.w_size=1<g1(e,n,ef,15,8,SA),deflateInit2:g1,deflateReset:NC,deflateResetKeep:wC,deflateSetHeader:(e,n)=>Iu(e)||e.state.wrap!==2?es:(e.state.gzhead=n,lr),deflate:(e,n)=>{if(Iu(e)||n>p1||n<0)return e?Qo(e,es):es;const t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===wu&&n!==Ci)return Qo(e,e.avail_out===0?up:es);const r=t.last_flush;if(t.last_flush=n,t.pending!==0){if(ei(e),e.avail_out===0)return t.last_flush=-1,lr}else if(e.avail_in===0&&m1(n)<=m1(r)&&n!==Ci)return Qo(e,up);if(t.status===wu&&e.avail_in!==0)return Qo(e,up);if(t.status===Cl&&t.wrap===0&&(t.status=Ko),t.status===Cl){let i=ef+(t.w_bits-8<<4)<<8,s=-1;if(s=t.strategy>=Td||t.level<2?0:t.level<6?1:t.level===6?2:3,i|=s<<6,t.strstart!==0&&(i|=32),i+=31-i%31,lu(t,i),t.strstart!==0&&(lu(t,e.adler>>>16),lu(t,65535&e.adler)),e.adler=1,t.status=Ko,ei(e),t.pending!==0)return t.last_flush=-1,lr}if(t.status===57){if(e.adler=0,yt(t,31),yt(t,139),yt(t,8),t.gzhead)yt(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),yt(t,255&t.gzhead.time),yt(t,t.gzhead.time>>8&255),yt(t,t.gzhead.time>>16&255),yt(t,t.gzhead.time>>24&255),yt(t,t.level===9?2:t.strategy>=Td||t.level<2?4:0),yt(t,255&t.gzhead.os),t.gzhead.extra&&t.gzhead.extra.length&&(yt(t,255&t.gzhead.extra.length),yt(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=Xn(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=69;else if(yt(t,0),yt(t,0),yt(t,0),yt(t,0),yt(t,0),yt(t,t.level===9?2:t.strategy>=Td||t.level<2?4:0),yt(t,3),t.status=Ko,ei(e),t.pending!==0)return t.last_flush=-1,lr}if(t.status===69){if(t.gzhead.extra){let i=t.pending,s=(65535&t.gzhead.extra.length)-t.gzindex;for(;t.pending+s>t.pending_buf_size;){let a=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>i&&(e.adler=Xn(e.adler,t.pending_buf,t.pending-i,i)),t.gzindex+=a,ei(e),t.pending!==0)return t.last_flush=-1,lr;i=0,s-=a}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending+=s,t.gzhead.hcrc&&t.pending>i&&(e.adler=Xn(e.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=73}if(t.status===73){if(t.gzhead.name){let i,s=t.pending;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>s&&(e.adler=Xn(e.adler,t.pending_buf,t.pending-s,s)),ei(e),t.pending!==0)return t.last_flush=-1,lr;s=0}i=t.gzindexs&&(e.adler=Xn(e.adler,t.pending_buf,t.pending-s,s)),t.gzindex=0}t.status=91}if(t.status===91){if(t.gzhead.comment){let i,s=t.pending;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>s&&(e.adler=Xn(e.adler,t.pending_buf,t.pending-s,s)),ei(e),t.pending!==0)return t.last_flush=-1,lr;s=0}i=t.gzindexs&&(e.adler=Xn(e.adler,t.pending_buf,t.pending-s,s))}t.status=103}if(t.status===103){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(ei(e),t.pending!==0))return t.last_flush=-1,lr;yt(t,255&e.adler),yt(t,e.adler>>8&255),e.adler=0}if(t.status=Ko,ei(e),t.pending!==0)return t.last_flush=-1,lr}if(e.avail_in!==0||t.lookahead!==0||n!==So&&t.status!==wu){let i=t.level===0?TC(t,n):t.strategy===Td?((s,o)=>{let a;for(;;){if(s.lookahead===0&&(hl(s),s.lookahead===0)){if(o===So)return 1;break}if(s.match_length=0,a=Co(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++,a&&(ri(s,!1),s.strm.avail_out===0))return 1}return s.insert=0,o===Ci?(ri(s,!0),s.strm.avail_out===0?3:4):s.sym_next&&(ri(s,!1),s.strm.avail_out===0)?1:2})(t,n):t.strategy===bA?((s,o)=>{let a,l,u,c;const d=s.window;for(;;){if(s.lookahead<=ra){if(hl(s),s.lookahead<=ra&&o===So)return 1;if(s.lookahead===0)break}if(s.match_length=0,s.lookahead>=3&&s.strstart>0&&(u=s.strstart-1,l=d[u],l===d[++u]&&l===d[++u]&&l===d[++u])){c=s.strstart+ra;do;while(l===d[++u]&&l===d[++u]&&l===d[++u]&&l===d[++u]&&l===d[++u]&&l===d[++u]&&l===d[++u]&&l===d[++u]&&us.lookahead&&(s.match_length=s.lookahead)}if(s.match_length>=3?(a=Co(s,1,s.match_length-3),s.lookahead-=s.match_length,s.strstart+=s.match_length,s.match_length=0):(a=Co(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++),a&&(ri(s,!1),s.strm.avail_out===0))return 1}return s.insert=0,o===Ci?(ri(s,!0),s.strm.avail_out===0?3:4):s.sym_next&&(ri(s,!1),s.strm.avail_out===0)?1:2})(t,n):Nu[t.level].func(t,n);if(i!==3&&i!==4||(t.status=wu),i===1||i===3)return e.avail_out===0&&(t.last_flush=-1),lr;if(i===2&&(n===mA?_A(t):n!==p1&&(tm(t,0,0,!1),n===gA&&(io(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),ei(e),e.avail_out===0))return t.last_flush=-1,lr}return n!==Ci?lr:t.wrap<=0?_1:(t.wrap===2?(yt(t,255&e.adler),yt(t,e.adler>>8&255),yt(t,e.adler>>16&255),yt(t,e.adler>>24&255),yt(t,255&e.total_in),yt(t,e.total_in>>8&255),yt(t,e.total_in>>16&255),yt(t,e.total_in>>24&255)):(lu(t,e.adler>>>16),lu(t,65535&e.adler)),ei(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?lr:_1)},deflateEnd:e=>{if(Iu(e))return es;const n=e.state.status;return e.state=null,n===Ko?Qo(e,vA):lr},deflateSetDictionary:(e,n)=>{let t=n.length;if(Iu(e))return es;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==Cl||r.lookahead)return es;if(i===1&&(e.adler=Qu(e.adler,n,t,0)),r.wrap=0,t>=r.w_size){i===0&&(io(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(n.subarray(t-r.w_size,t),0),n=l,t=r.w_size}const s=e.avail_in,o=e.next_in,a=e.input;for(e.avail_in=t,e.next_in=0,e.input=n,hl(r);r.lookahead>=3;){let l=r.strstart,u=r.lookahead-2;do r.ins_h=To(r,r.ins_h,r.window[l+3-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--u);r.strstart=l,r.lookahead=2,hl(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=o,e.input=a,e.avail_in=s,r.wrap=i,lr},deflateInfo:"pako deflate (from Nodeca project)"};const IA=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var r0={assign:function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const t=n.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const r in t)IA(t,r)&&(e[r]=t[r])}}return e},flattenChunks:e=>{let n=0;for(let r=0,i=e.length;r=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Rc[254]=Rc[254]=1;var Lc={string2buf:e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let n,t,r,i,s,o=e.length,a=0;for(i=0;i>>6,n[s++]=128|63&t):t<65536?(n[s++]=224|t>>>12,n[s++]=128|t>>>6&63,n[s++]=128|63&t):(n[s++]=240|t>>>18,n[s++]=128|t>>>12&63,n[s++]=128|t>>>6&63,n[s++]=128|63&t);return n},buf2string:(e,n)=>{const t=n||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,n));let r,i;const s=new Array(2*t);for(i=0,r=0;r4)s[i++]=65533,r+=a-1;else{for(o&=a===2?31:a===3?15:7;a>1&&r1?s[i++]=65533:o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|1023&o)}}return((o,a)=>{if(a<65534&&o.subarray&&IC)return String.fromCharCode.apply(null,o.length===a?o:o.subarray(0,a));let l="";for(let u=0;u{(n=n||e.length)>e.length&&(n=e.length);let t=n-1;for(;t>=0&&(192&e[t])==128;)t--;return t<0||t===0?n:t+Rc[e[t]]>n?t:n}},AC=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const MC=Object.prototype.toString,{Z_NO_FLUSH:AA,Z_SYNC_FLUSH:MA,Z_FULL_FLUSH:xA,Z_FINISH:OA,Z_OK:tf,Z_STREAM_END:kA,Z_DEFAULT_COMPRESSION:RA,Z_DEFAULT_STRATEGY:LA,Z_DEFLATED:DA}=Da;function Zu(e){this.options=r0.assign({level:RA,method:DA,chunkSize:16384,windowBits:15,memLevel:8,strategy:LA},e||{});let n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new AC,this.strm.avail_out=0;let t=Yu.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(t!==tf)throw new Error(wa[t]);if(n.header&&Yu.deflateSetHeader(this.strm,n.header),n.dictionary){let r;if(r=typeof n.dictionary=="string"?Lc.string2buf(n.dictionary):MC.call(n.dictionary)==="[object ArrayBuffer]"?new Uint8Array(n.dictionary):n.dictionary,t=Yu.deflateSetDictionary(this.strm,r),t!==tf)throw new Error(wa[t]);this._dict_set=!0}}function dp(e,n){const t=new Zu(n);if(t.push(e,!0),t.err)throw t.msg||wa[t.err];return t.result}Zu.prototype.push=function(e,n){const t=this.strm,r=this.options.chunkSize;let i,s;if(this.ended)return!1;for(s=n===~~n?n:n===!0?OA:AA,typeof e=="string"?t.input=Lc.string2buf(e):MC.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;)if(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),(s===MA||s===xA)&&t.avail_out<=6)this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;else{if(i=Yu.deflate(t,s),i===kA)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),i=Yu.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===tf;if(t.avail_out!==0){if(s>0&&t.next_out>0)this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;else if(t.avail_in===0)break}else this.onData(t.output)}return!0},Zu.prototype.onData=function(e){this.chunks.push(e)},Zu.prototype.onEnd=function(e){e===tf&&(this.result=r0.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var UA={Deflate:Zu,deflate:dp,deflateRaw:function(e,n){return(n=n||{}).raw=!0,dp(e,n)},gzip:function(e,n){return(n=n||{}).gzip=!0,dp(e,n)},constants:Da};const wd=16209;var PA=function(e,n){let t,r,i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S,w,N,A,k,I;const M=e.state;t=e.next_in,k=e.input,r=t+(e.avail_in-5),i=e.next_out,I=e.output,s=i-(n-e.avail_out),o=i+(e.avail_out-257),a=M.dmax,l=M.wsize,u=M.whave,c=M.wnext,d=M.window,h=M.hold,f=M.bits,p=M.lencode,g=M.distcode,b=(1<>>24,h>>>=E,f-=E,E=_>>>16&255,E===0)I[i++]=65535&_;else{if(!(16&E)){if(64&E){if(32&E){M.mode=16191;break e}e.msg="invalid literal/length code",M.mode=wd;break e}_=p[(65535&_)+(h&(1<>>=E,f-=E),f<15&&(h+=k[t++]<>>24,h>>>=E,f-=E,E=_>>>16&255,16&E){if(w=65535&_,E&=15,fa){e.msg="invalid distance too far back",M.mode=wd;break e}if(h>>>=E,f-=E,E=i-s,w>E){if(E=w-E,E>u&&M.sane){e.msg="invalid distance too far back",M.mode=wd;break e}if(N=0,A=d,c===0){if(N+=l-E,E2;)I[i++]=A[N++],I[i++]=A[N++],I[i++]=A[N++],S-=3;S&&(I[i++]=A[N++],S>1&&(I[i++]=A[N++]))}else{N=i-w;do I[i++]=I[N++],I[i++]=I[N++],I[i++]=I[N++],S-=3;while(S>2);S&&(I[i++]=I[N++],S>1&&(I[i++]=I[N++]))}break}if(64&E){e.msg="invalid distance code",M.mode=wd;break e}_=g[(65535&_)+(h&(1<>3,t-=S,f-=S<<3,h&=(1<{const l=a.bits;let u,c,d,h,f,p,g=0,b=0,m=0,_=0,E=0,S=0,w=0,N=0,A=0,k=0,I=null;const M=new Uint16Array(16),U=new Uint16Array(16);let z,H,W,Q=null;for(g=0;g<=Nd;g++)M[g]=0;for(b=0;b=1&&M[_]===0;_--);if(E>_&&(E=_),_===0)return i[s++]=20971520,i[s++]=20971520,a.bits=1,0;for(m=1;m<_&&M[m]===0;m++);for(E0&&(e===0||_!==1))return-1;for(U[1]=0,g=1;g852||e===2&&A>592)return 1;for(;;){z=g-w,o[b]+1=p?(H=Q[o[b]-p],W=I[o[b]-p]):(H=96,W=0),u=1<>w)+c]=z<<24|H<<16|W;while(c!==0);for(u=1<>=1;if(u!==0?(k&=u-1,k+=u):k=0,b++,--M[g]==0){if(g===_)break;g=n[t+o[b]]}if(g>E&&(k&h)!==d){for(w===0&&(w=E),f+=m,S=g-w,N=1<852||e===2&&A>592)return 1;d=k&h,i[d]=E<<24|S<<16|f-s}}return k!==0&&(i[f+k]=g-w<<24|64<<16),a.bits=E,0};const{Z_FINISH:v1,Z_BLOCK:$A,Z_TREES:Id,Z_OK:Yo,Z_STREAM_END:GA,Z_NEED_DICT:zA,Z_STREAM_ERROR:yi,Z_DATA_ERROR:y1,Z_MEM_ERROR:E1,Z_BUF_ERROR:VA,Z_DEFLATED:b1}=Da,i0=16180,Ad=16190,vs=16191,hp=16192,fp=16194,Md=16199,xd=16200,pp=16206,Zt=16209,C1=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function qA(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const ia=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.mode16211?1:0},xC=e=>{if(ia(e))return yi;const n=e.state;return e.total_in=e.total_out=n.total=0,e.msg="",n.wrap&&(e.adler=1&n.wrap),n.mode=i0,n.last=0,n.havedict=0,n.flags=-1,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new Int32Array(852),n.distcode=n.distdyn=new Int32Array(592),n.sane=1,n.back=-1,Yo},OC=e=>{if(ia(e))return yi;const n=e.state;return n.wsize=0,n.whave=0,n.wnext=0,xC(e)},kC=(e,n)=>{let t;if(ia(e))return yi;const r=e.state;return n<0?(t=0,n=-n):(t=5+(n>>4),n<48&&(n&=15)),n&&(n<8||n>15)?yi:(r.window!==null&&r.wbits!==n&&(r.window=null),r.wrap=t,r.wbits=n,OC(e))},S1=(e,n)=>{if(!e)return yi;const t=new qA;e.state=t,t.strm=e,t.window=null,t.mode=i0;const r=kC(e,n);return r!==Yo&&(e.state=null),r};let _p,mp,T1=!0;const WA=e=>{if(T1){_p=new Int32Array(512),mp=new Int32Array(32);let n=0;for(;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(Xu(1,e.lens,0,288,_p,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;Xu(2,e.lens,0,32,mp,0,e.work,{bits:5}),T1=!1}e.lencode=_p,e.lenbits=9,e.distcode=mp,e.distbits=5},w1=(e,n,t,r)=>{let i;const s=e.state;return s.window===null&&(s.wsize=1<=s.wsize?(s.window.set(n.subarray(t-s.wsize,t),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),s.window.set(n.subarray(t-r,t-r+i),s.wnext),(r-=i)?(s.window.set(n.subarray(t-r,t),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whaveS1(e,15),inflateInit2:S1,inflate:(e,n)=>{let t,r,i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S,w,N,A,k=0;const I=new Uint8Array(4);let M,U;const z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ia(e)||!e.output||!e.input&&e.avail_in!==0)return yi;t=e.state,t.mode===vs&&(t.mode=hp),o=e.next_out,i=e.output,l=e.avail_out,s=e.next_in,r=e.input,a=e.avail_in,u=t.hold,c=t.bits,d=a,h=l,A=Yo;e:for(;;)switch(t.mode){case i0:if(t.wrap===0){t.mode=hp;break}for(;c<16;){if(a===0)break e;a--,u+=r[s++]<>>8&255,t.check=Xn(t.check,I,2,0),u=0,c=0,t.mode=16181;break}if(t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",t.mode=Zt;break}if((15&u)!==b1){e.msg="unknown compression method",t.mode=Zt;break}if(u>>>=4,c-=4,N=8+(15&u),t.wbits===0&&(t.wbits=N),N>15||N>t.wbits){e.msg="invalid window size",t.mode=Zt;break}t.dmax=1<>8&1),512&t.flags&&4&t.wrap&&(I[0]=255&u,I[1]=u>>>8&255,t.check=Xn(t.check,I,2,0)),u=0,c=0,t.mode=16182;case 16182:for(;c<32;){if(a===0)break e;a--,u+=r[s++]<>>8&255,I[2]=u>>>16&255,I[3]=u>>>24&255,t.check=Xn(t.check,I,4,0)),u=0,c=0,t.mode=16183;case 16183:for(;c<16;){if(a===0)break e;a--,u+=r[s++]<>8),512&t.flags&&4&t.wrap&&(I[0]=255&u,I[1]=u>>>8&255,t.check=Xn(t.check,I,2,0)),u=0,c=0,t.mode=16184;case 16184:if(1024&t.flags){for(;c<16;){if(a===0)break e;a--,u+=r[s++]<>>8&255,t.check=Xn(t.check,I,2,0)),u=0,c=0}else t.head&&(t.head.extra=null);t.mode=16185;case 16185:if(1024&t.flags&&(f=t.length,f>a&&(f=a),f&&(t.head&&(N=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(r.subarray(s,s+f),N)),512&t.flags&&4&t.wrap&&(t.check=Xn(t.check,r,f,s)),a-=f,s+=f,t.length-=f),t.length))break e;t.length=0,t.mode=16186;case 16186:if(2048&t.flags){if(a===0)break e;f=0;do N=r[s+f++],t.head&&N&&t.length<65536&&(t.head.name+=String.fromCharCode(N));while(N&&f>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=vs;break;case 16189:for(;c<32;){if(a===0)break e;a--,u+=r[s++]<>>=7&c,c-=7&c,t.mode=pp;break}for(;c<3;){if(a===0)break e;a--,u+=r[s++]<>>=1,c-=1,3&u){case 0:t.mode=16193;break;case 1:if(WA(t),t.mode=Md,n===Id){u>>>=2,c-=2;break e}break;case 2:t.mode=16196;break;case 3:e.msg="invalid block type",t.mode=Zt}u>>>=2,c-=2;break;case 16193:for(u>>>=7&c,c-=7&c;c<32;){if(a===0)break e;a--,u+=r[s++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=Zt;break}if(t.length=65535&u,u=0,c=0,t.mode=fp,n===Id)break e;case fp:t.mode=16195;case 16195:if(f=t.length,f){if(f>a&&(f=a),f>l&&(f=l),f===0)break e;i.set(r.subarray(s,s+f),o),a-=f,s+=f,l-=f,o+=f,t.length-=f;break}t.mode=vs;break;case 16196:for(;c<14;){if(a===0)break e;a--,u+=r[s++]<>>=5,c-=5,t.ndist=1+(31&u),u>>>=5,c-=5,t.ncode=4+(15&u),u>>>=4,c-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=Zt;break}t.have=0,t.mode=16197;case 16197:for(;t.have>>=3,c-=3}for(;t.have<19;)t.lens[z[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,M={bits:t.lenbits},A=Xu(0,t.lens,0,19,t.lencode,0,t.work,M),t.lenbits=M.bits,A){e.msg="invalid code lengths set",t.mode=Zt;break}t.have=0,t.mode=16198;case 16198:for(;t.have>>24,m=k>>>16&255,_=65535&k,!(b<=c);){if(a===0)break e;a--,u+=r[s++]<>>=b,c-=b,t.lens[t.have++]=_;else{if(_===16){for(U=b+2;c>>=b,c-=b,t.have===0){e.msg="invalid bit length repeat",t.mode=Zt;break}N=t.lens[t.have-1],f=3+(3&u),u>>>=2,c-=2}else if(_===17){for(U=b+3;c>>=b,c-=b,N=0,f=3+(7&u),u>>>=3,c-=3}else{for(U=b+7;c>>=b,c-=b,N=0,f=11+(127&u),u>>>=7,c-=7}if(t.have+f>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=Zt;break}for(;f--;)t.lens[t.have++]=N}}if(t.mode===Zt)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=Zt;break}if(t.lenbits=9,M={bits:t.lenbits},A=Xu(1,t.lens,0,t.nlen,t.lencode,0,t.work,M),t.lenbits=M.bits,A){e.msg="invalid literal/lengths set",t.mode=Zt;break}if(t.distbits=6,t.distcode=t.distdyn,M={bits:t.distbits},A=Xu(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,M),t.distbits=M.bits,A){e.msg="invalid distances set",t.mode=Zt;break}if(t.mode=Md,n===Id)break e;case Md:t.mode=xd;case xd:if(a>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=s,e.avail_in=a,t.hold=u,t.bits=c,PA(e,h),o=e.next_out,i=e.output,l=e.avail_out,s=e.next_in,r=e.input,a=e.avail_in,u=t.hold,c=t.bits,t.mode===vs&&(t.back=-1);break}for(t.back=0;k=t.lencode[u&(1<>>24,m=k>>>16&255,_=65535&k,!(b<=c);){if(a===0)break e;a--,u+=r[s++]<>E)],b=k>>>24,m=k>>>16&255,_=65535&k,!(E+b<=c);){if(a===0)break e;a--,u+=r[s++]<>>=E,c-=E,t.back+=E}if(u>>>=b,c-=b,t.back+=b,t.length=_,m===0){t.mode=16205;break}if(32&m){t.back=-1,t.mode=vs;break}if(64&m){e.msg="invalid literal/length code",t.mode=Zt;break}t.extra=15&m,t.mode=16201;case 16201:if(t.extra){for(U=t.extra;c>>=t.extra,c-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=16202;case 16202:for(;k=t.distcode[u&(1<>>24,m=k>>>16&255,_=65535&k,!(b<=c);){if(a===0)break e;a--,u+=r[s++]<>E)],b=k>>>24,m=k>>>16&255,_=65535&k,!(E+b<=c);){if(a===0)break e;a--,u+=r[s++]<>>=E,c-=E,t.back+=E}if(u>>>=b,c-=b,t.back+=b,64&m){e.msg="invalid distance code",t.mode=Zt;break}t.offset=_,t.extra=15&m,t.mode=16203;case 16203:if(t.extra){for(U=t.extra;c>>=t.extra,c-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=Zt;break}t.mode=16204;case 16204:if(l===0)break e;if(f=h-l,t.offset>f){if(f=t.offset-f,f>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=Zt;break}f>t.wnext?(f-=t.wnext,p=t.wsize-f):p=t.wnext-f,f>t.length&&(f=t.length),g=t.window}else g=i,p=o-t.offset,f=t.length;f>l&&(f=l),l-=f,t.length-=f;do i[o++]=g[p++];while(--f);t.length===0&&(t.mode=xd);break;case 16205:if(l===0)break e;i[o++]=t.length,l--,t.mode=xd;break;case pp:if(t.wrap){for(;c<32;){if(a===0)break e;a--,u|=r[s++]<{if(ia(e))return yi;let n=e.state;return n.window&&(n.window=null),e.state=null,Yo},inflateGetHeader:(e,n)=>{if(ia(e))return yi;const t=e.state;return 2&t.wrap?(t.head=n,n.done=!1,Yo):yi},inflateSetDictionary:(e,n)=>{const t=n.length;let r,i,s;return ia(e)?yi:(r=e.state,r.wrap!==0&&r.mode!==Ad?yi:r.mode===Ad&&(i=1,i=Qu(i,n,t,0),i!==r.check)?y1:(s=w1(e,n,t,t),s?(r.mode=16210,E1):(r.havedict=1,Yo)))},inflateInfo:"pako inflate (from Nodeca project)"},KA=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const RC=Object.prototype.toString,{Z_NO_FLUSH:QA,Z_FINISH:YA,Z_OK:Ju,Z_STREAM_END:gp,Z_NEED_DICT:vp,Z_STREAM_ERROR:ZA,Z_DATA_ERROR:N1,Z_MEM_ERROR:XA}=Da;function ec(e){this.options=r0.assign({chunkSize:65536,windowBits:15,to:""},e||{});const n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),!(n.windowBits>=0&&n.windowBits<16)||e&&e.windowBits||(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(15&n.windowBits||(n.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new AC,this.strm.avail_out=0;let t=Is.inflateInit2(this.strm,n.windowBits);if(t!==Ju)throw new Error(wa[t]);if(this.header=new KA,Is.inflateGetHeader(this.strm,this.header),n.dictionary&&(typeof n.dictionary=="string"?n.dictionary=Lc.string2buf(n.dictionary):RC.call(n.dictionary)==="[object ArrayBuffer]"&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(t=Is.inflateSetDictionary(this.strm,n.dictionary),t!==Ju)))throw new Error(wa[t])}function yp(e,n){const t=new ec(n);if(t.push(e),t.err)throw t.msg||wa[t.err];return t.result}ec.prototype.push=function(e,n){const t=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let s,o,a;if(this.ended)return!1;for(o=n===~~n?n:n===!0?YA:QA,RC.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),s=Is.inflate(t,o),s===vp&&i&&(s=Is.inflateSetDictionary(t,i),s===Ju?s=Is.inflate(t,o):s===N1&&(s=vp));t.avail_in>0&&s===gp&&t.state.wrap>0&&e[t.next_in]!==0;)Is.inflateReset(t),s=Is.inflate(t,o);switch(s){case ZA:case N1:case vp:case XA:return this.onEnd(s),this.ended=!0,!1}if(a=t.avail_out,t.next_out&&(t.avail_out===0||s===gp))if(this.options.to==="string"){let l=Lc.utf8border(t.output,t.next_out),u=t.next_out-l,c=Lc.buf2string(t.output,l);t.next_out=u,t.avail_out=r-u,u&&t.output.set(t.output.subarray(l,l+u),0),this.onData(c)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(s!==Ju||a!==0){if(s===gp)return s=Is.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},ec.prototype.onData=function(e){this.chunks.push(e)},ec.prototype.onEnd=function(e){e===Ju&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=r0.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var JA={Inflate:ec,inflate:yp,inflateRaw:function(e,n){return(n=n||{}).raw=!0,yp(e,n)},ungzip:yp,constants:Da};const{Deflate:e6,deflate:t6,deflateRaw:n6,gzip:r6}=UA,{Inflate:i6,inflate:s6,inflateRaw:o6,ungzip:a6}=JA;var as,l6={Deflate:e6,deflate:t6,deflateRaw:n6,gzip:r6,Inflate:i6,inflate:s6,inflateRaw:o6,ungzip:a6,constants:Da},I1=function(e){return y(void 0,void 0,void 0,function(){var n;return v(this,function(t){return n=l6.ungzip(e),[2,String.fromCharCode.apply(null,n)]})})};(function(e){e.CONNECTING="CONNECTING",e.OPEN="OPEN",e.CLOSED="CLOSED"})(as||(as={}));var rt,u6=function(e){function n(t,r){var i=r.sdkState,s=r.dispatcher,o=r.logger,a=e.call(this)||this;return a.lastActive=0,a._iid=t,a._sdkState=i,a._dispatcher=s,a._logger=o,a}return T(n,e),Object.defineProperty(n.prototype,"isOpen",{get:function(){return this.connectionState===as.OPEN},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"connectionState",{get:function(){if(this._ws)switch(this._ws.readyState){case 0:return as.CONNECTING;case 1:return as.OPEN}return as.CLOSED},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ws",{get:function(){var t;return(t=this._ws)!==null&&t!==void 0?t:null},enumerable:!1,configurable:!0}),n.prototype._handleMessage=function(t){var r=this;t.split(` `).forEach(function(i){if(i){var s=gt.createFromRawMessage(r._iid,i);if(r._logger.debug("receive websocket event",s),s.code==="LOGI")r.dispatch("message",s);else if(s.code==="PONG")r.dispatch("pong");else if(s.code==="EXPR"){if(s.payload){var o=new Ul(s.payload);o.expiresIn>=0&&r._dispatcher.dispatch(o)}}else s.code==="NOOP"||r.dispatch("message",s)}})},n.prototype.connect=function(t,r){var i=this;r===void 0&&(r=""),this._ws=new WebSocket(t,encodeURIComponent(r)),this._ws.onopen=function(){i._logger.debug("websocket open"),i.dispatch("open")},this._ws.onmessage=function(s){return y(i,void 0,void 0,function(){var o,a,l,u,c=this;return v(this,function(d){switch(d.label){case 0:return!((u=this._sdkState.websocket)===null||u===void 0)&&u.compression?s.data instanceof Blob?((o=new FileReader).readAsArrayBuffer(s.data),o.onloadend=function(){return y(c,void 0,void 0,function(){var h,f;return v(this,function(p){switch(p.label){case 0:return p.trys.push([0,2,,3]),[4,I1(o.result)];case 1:return h=p.sent(),this._handleMessage(h),[3,3];case 2:return f=p.sent(),this.error(f),[3,3];case 3:return[2]}})})},[3,7]):[3,1]:[3,8];case 1:if(!(s.data instanceof ArrayBuffer))return[3,6];d.label=2;case 2:return d.trys.push([2,4,,5]),[4,I1(new Uint8Array(s.data))];case 3:return a=d.sent(),this._handleMessage(a),[3,5];case 4:return l=d.sent(),this.error(l),[3,5];case 5:return[3,7];case 6:typeof s.data=="string"&&this._handleMessage(s.data),d.label=7;case 7:return[3,9];case 8:this._handleMessage(s.data),d.label=9;case 9:return[2]}})})},this._ws.onerror=function(){i._logger.debug("websocket error"),i.dispatch("error",L.networkError)},this._ws.onclose=function(){i._logger.debug("websocket close"),i.dispatch("close")},this.lastActive=Date.now()},n.prototype.disconnect=function(){var t=this;return new Promise(function(r){t._logger.debug("websocket disconnect"),t._ws?(t._ws.onopen=qe,t._ws.onmessage=qe,t._ws.onerror=qe,t.connectionState!==as.CLOSED?(t._ws.onclose=function(){t.dispatch("close"),r()},t._ws.close(),t._ws=void 0):r()):r()})},n.prototype.send=function(t){if(!this._ws)throw L.connectionClosed;t.code!=="PING"?this.dispatch("ping-refresh"):this._logger.debug("send ping",t),this._ws.send(t.convertToMessage())},n.prototype.error=function(t){this._logger.debug("websocket error",t),this.dispatch("error",t)},n}(La),LC=function(e){function n(t){var r=t.all,i=t.feed,s=t.custom_types,o=t.ts,a=e.call(this)||this;return a.all=r,a.feed=i,a.customTypes=s,a.ts=o,a}return T(n,e),n}(Tt),c6=function(){function e(n,t){var r=t.session,i=t.sdkState,s=t.dispatcher,o=t.logger,a=t.useFetchCompat,l=a!==void 0&&a,u=this;this._ackStateMap=new Map,this._sdkState=i,this._dispatcher=s,this._logger=o,this.apiClient=new lA(n,{session:r,sdkState:i,dispatcher:s,logger:o,useFetchCompat:l}),this.websocketClient=new u6(n,{sdkState:i,dispatcher:s,logger:o}),this.websocketClient.on("message",function(c){if(c.payload.unread_cnt&&u._dispatcher.dispatch(new LC(c.payload.unread_cnt)),c.requestId){if(u._ackStateMap.has(c.requestId)){var d=u._ackStateMap.get(c.requestId);c.code!=="EROR"?d.resolve(c):d.reject(new L({code:c.payload.code,message:c.payload.message}))}}else u._dispatcher.dispatch(c)}).on("close",function(){u._ackStateMap.forEach(function(c){c.reject(L.connectionClosed)}),u._ackStateMap.clear()})}return e.prototype._sendApiRequest=function(n){return y(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return[4,this.apiClient.send(n)];case 1:return[2,t.sent()]}})})},e.prototype._sendWebsocketRequest=function(n){return y(this,void 0,void 0,function(){var t,r,i,s=this;return v(this,function(o){if(!this._sdkState.websocket)throw L.connectionRequired;if(t=new Tr,n.ackRequired){i=function(a,l){s._ackStateMap.has(n.requestId)&&(s._ackStateMap.delete(n.requestId),r&&(clearTimeout(r),r=null),a?(s._logger.debug("fail websocket request",n.requestId,a),t.reject(a)):(s._logger.debug("receive websocket ack",n.requestId,n),s._logger.debug("receive websocket ack",l),t.resolve(l)))};try{r=setTimeout(function(){return i(L.noAckTimeout)},this._sdkState.websocket.responseTimeout),this._ackStateMap.set(n.requestId,{resolve:function(a){return i(void 0,a)},reject:function(a){return i(a)}}),this.websocketClient.send(n)}catch(a){i(a)}}else try{this.websocketClient.send(n),t.resolve()}catch(a){t.reject(a)}return[2,t.promise]})})},e.prototype.send=function(n){return y(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return n instanceof J?[4,this._sendApiRequest(n)]:[3,2];case 1:case 3:return[2,t.sent()];case 2:return n instanceof wr?[4,this._sendWebsocketRequest(n)]:[3,4];case 4:throw L.invalidParameters}})})},e.prototype.cancel=function(n){this.apiClient.cancel(n)},e.prototype.cancelAll=function(){this.apiClient.cancelAll()},e}();(function(e){e[e.NONE=0]="NONE",e[e.INITIALIZED=1]="INITIALIZED",e[e.CONNECTING=2]="CONNECTING",e[e.CONNECTED=3]="CONNECTED",e[e.RECONNECTING=4]="RECONNECTING",e[e.INTERNAL_DISCONNECTED=5]="INTERNAL_DISCONNECTED",e[e.EXTERNAL_DISCONNECTED=6]="EXTERNAL_DISCONNECTED",e[e.LOGOUT=7]="LOGOUT"})(rt||(rt={}));var sa,oa,_i=function(e){function n(t){var r=t.stateType,i=e.call(this)||this;return i.stateType=r,i}return T(n,e),n}(Tt),DC=function(e){function n(){return e!==null&&e.apply(this,arguments)||this}return T(n,e),n}(Tt),rm=function(e){function n(){return e!==null&&e.apply(this,arguments)||this}return T(n,e),n}(Tt),UC=function(e){function n(){return e!==null&&e.apply(this,arguments)||this}return T(n,e),n}(Tt),A1=function(){function e(n){var t,r,i,s;this.isEnabled=(t=n.enabled)!==null&&t!==void 0&&t,this.feedChannels=(r=n.feed_channels)!==null&&r!==void 0?r:{},this.templateListToken=(i=n.template_list_token)!==null&&i!==void 0?i:null,this.settingsUpdatedAt=(s=n.settings_updated_at)!==null&&s!==void 0?s:0}return e.payloadify=function(n){return ye(Ie({enabled:n.isEnabled,feed_channels:n.feedChannels,template_list_token:n.templateListToken,settings_updated_at:n.settingsUpdatedAt}))},e}(),Kg=function(e){return"sendbird@".concat(e,"/changelog_include_chat_notifications")},M1=function(){function e(n){var t;this.lastUpdatedAt=(t=n.last_updated_at)!==null&&t!==void 0?t:0}return e.payloadify=function(n){return ye(Ie({last_updated_at:n.lastUpdatedAt}))},e}(),x1=function(){function e(n){var t;this.token=(t=n.template_list_token)!==null&&t!==void 0?t:""}return e.payloadify=function(n){return ye(Ie({template_list_token:n.token}))},e}(),Od=function(){function e(n){n===void 0&&(n={min_stat_count:100,min_interval:10800,max_stat_count_per_request:1e3,lower_threshold:10,request_delay_range:180}),this.minStatCount=n.min_stat_count,this.minInterval=1e3*n.min_interval,this.maxStatCountPerRequest=n.max_stat_count_per_request,this.lowerThreshold=n.lower_threshold,this.requestDelayRange=1e3*n.request_delay_range}return e.payloadify=function(n){return ye(Ie({min_stat_count:n.minStatCount,min_interval:n.minInterval/1e3,max_stat_count_per_request:n.maxStatCountPerRequest,lower_threshold:n.lowerThreshold,request_delay_range:n.requestDelayRange/1e3}))},e}(),Ep=function(){function e(n){n===void 0&&(n={default:{min_stat_count:100,min_interval:10800,max_stat_count_per_request:1e3,lower_threshold:10,request_delay_range:180}}),this.default=new Od(n.default),this.realTime=new Od(n.realtime)}return e.payloadify=function(n){return ye(Ie({default:Od.payloadify(n.default),realtime:Od.payloadify(n.realTime)}))},e}(),O1=1048576,d6=5;(function(e){e[e.NONE=0]="NONE",e[e.INCLUDE_REPLY=1]="INCLUDE_REPLY",e[e.EXCLUDE_REPLY=2]="EXCLUDE_REPLY",e[e.INCLUDE_REPLY_TO_CHANNEL=3]="INCLUDE_REPLY_TO_CHANNEL"})(sa||(sa={})),function(e){e[e.NONE=0]="NONE",e[e.INCLUDE_REPLY=1]="INCLUDE_REPLY",e[e.EXCLUDE_REPLY=2]="EXCLUDE_REPLY",e[e.INCLUDE_REPLY_TO_CHANNEL=3]="INCLUDE_REPLY_TO_CHANNEL"}(oa||(oa={}));var k1=function(){function e(n){var t,r,i,s,o,a,l;n===void 0&&(n={}),this.emojiHash=n.emoji_hash||"",this.uploadSizeLimit=n.file_upload_size_limit?n.file_upload_size_limit*O1:Number.MAX_SAFE_INTEGER,this.useReaction=!!n.use_reaction,this.applicationAttributes=(t=n.application_attributes)!==null&&t!==void 0?t:[],this.premiumFeatureList=(r=n.premium_feature_list)!==null&&r!==void 0?r:[],this.deviceTokenCache=this.applicationAttributes.includes("sdk_device_token_cache"),this.enabledChannelMemberShipHistory=this.applicationAttributes.includes("channel_membership_history"),this.multipleFilesMessageFileCountLimit=(i=n.multiple_file_send_max_size)!==null&&i!==void 0?i:5,this.allowSdkStatsUpload=(s=n.allow_sdk_log_ingestion)===null||s===void 0||s,this.unreadCountThreadingPolicy=(o=n.unread_cnt_threading_policy)!==null&&o!==void 0?o:sa.NONE,this.lastMessageThreadingPolicy=(a=n.last_msg_threading_policy)!==null&&a!==void 0?a:oa.NONE,this.uikitConfigInfo=new M1((l=n.uikit_config)!==null&&l!==void 0?l:{}),this.notificationInfo=n.notifications?new A1(n.notifications):null,this.messageTemplateInfo=n.message_template?new x1(n.message_template):null,this.statConfigInfo=n.log_publish_config?new Ep(n.log_publish_config):new Ep}return e.payloadify=function(n){return ye(Ie({emoji_hash:n.emojiHash,file_upload_size_limit:n.uploadSizeLimit/O1,application_attributes:n.applicationAttributes,premium_feature_list:n.premiumFeatureList,use_reaction:n.useReaction,allow_sdk_log_ingestion:n.allowSdkStatsUpload,unread_cnt_threading_policy:n.unreadCountThreadingPolicy,last_msg_threading_policy:n.lastMessageThreadingPolicy,uikit_config:n.uikitConfigInfo?M1.payloadify(n.uikitConfigInfo):null,notifications:n.notificationInfo?A1.payloadify(n.notificationInfo):null,message_template:n.messageTemplateInfo?x1.payloadify(n.messageTemplateInfo):null,log_publish_config:n.statConfigInfo?Ep.payloadify(n.statConfigInfo):null}))},e}(),Kn=function(){function e(n){this._iid="",this._iid=n}return e.payloadify=function(n){return{}},e}(),h6=function(e){function n(t){var r=t.userId,i=t.metadata,s=e.call(this)||this;return s.method=Z.POST,s.path="".concat(Xe,"/").concat(r,"/metadata"),s.params={metadata:i},s}return T(n,e),n}(J),f6=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.metaData=r,i}return T(n,e),n}(se),p6=function(e){function n(t){var r=t.userId,i=t.metadata,s=t.upsert,o=e.call(this)||this;return o.method=Z.PUT,o.path="".concat(Xe,"/").concat(r,"/metadata"),o.params={metadata:i,upsert:s},o}return T(n,e),n}(J),_6=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.metadata=r,i}return T(n,e),n}(se),m6=function(e){function n(t){var r=t.userId,i=t.metadataKey,s=e.call(this)||this;return s.method=Z.DELETE,s.path="".concat(Xe,"/").concat(r,"/metadata/").concat(i),s}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var g6=function(e){function n(t){var r=t.userId,i=e.call(this)||this;return i.method=Z.DELETE,i.path="".concat(Xe,"/").concat(r,"/metadata"),i}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var fl,Qc=function(e,n){var t=JSON.parse(JSON.stringify(e));return t._iid&&delete t._iid,n&&n(t),t},pa=function(e,n){var t=JSON.parse(JSON.stringify(e));return t},Y=function(e){return{do:function(n){e||n()},throw:function(n){if(!e)throw n}}};(function(e){e.ONLINE="online",e.OFFLINE="offline",e.NON_AVAILABLE="nonavailable"})(fl||(fl={}));var Pl,Ke=function(e){function n(t,r){var i,s,o,a,l,u,c,d,h,f,p,g,b=this;return(b=e.call(this,t)||this).userId=(s=(i=r.guest_id)!==null&&i!==void 0?i:r.user_id)!==null&&s!==void 0?s:"",b.nickname=(a=(o=r.nickname)!==null&&o!==void 0?o:r.name)!==null&&a!==void 0?a:"",b.plainProfileUrl=(u=(l=r.profile_url)!==null&&l!==void 0?l:r.image)!==null&&u!==void 0?u:"",b.requireAuth=(c=r.require_auth_for_profile_image)!==null&&c!==void 0&&c,b.metaData=(d=r.metadata)!==null&&d!==void 0?d:{},b.connectionStatus=fl.NON_AVAILABLE,$e(fl,r.is_online)?b.connectionStatus=r.is_online:R("boolean",r.is_online)&&(b.connectionStatus=r.is_online?fl.ONLINE:fl.OFFLINE),b.isActive=(h=r.is_active)===null||h===void 0||h,b.lastSeenAt=(f=r.last_seen_at)!==null&&f!==void 0?f:null,b.preferredLanguages=r.preferred_languages?De([],Ae(r.preferred_languages),!1):null,b.friendDiscoveryKey=(p=r.friend_discovery_key)!==null&&p!==void 0?p:null,b.friendName=(g=r.friend_name)!==null&&g!==void 0?g:null,b}return T(n,e),n.payloadify=function(t){return ye(Ie(x(x({},e.payloadify.call(this,t)),{user_id:t.userId,nickname:t.nickname,profile_url:t.plainProfileUrl,require_auth_for_profile_image:t.requireAuth,metadata:t.metaData,is_online:t.connectionStatus,is_active:t.isActive,last_seen_at:t.lastSeenAt,preferred_languages:t.preferredLanguages,friend_discovery_key:t.friendDiscoveryKey,friend_name:t.friendName})))},Object.defineProperty(n.prototype,"profileUrl",{get:function(){var t=O.of(this._iid).sessionManager;return this.requireAuth&&t.ekey?"".concat(this.plainProfileUrl,"?auth=").concat(t.ekey):this.plainProfileUrl},enumerable:!1,configurable:!0}),n.prototype.serialize=function(){return Qc(this)},n.prototype._isValidMetaData=function(t){return!Array.isArray(t)&&Object.keys(t).length>0&&Object.keys(t).map(function(r){return t[r]}).every(function(r){return R("string",r)})},n.prototype._applyMetaData=function(t,r){var i=this;r===void 0&&(r=!1),Object.keys(t).forEach(function(s){r?delete i.metaData[s]:i.metaData[s]=t[s]})},n.prototype.createMetaData=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:return Y(this._isValidMetaData(t)).throw(L.invalidParameters),r=O.of(this._iid),i=r.sdkState,s=r.requestQueue,o=new h6({userId:i.userId,metadata:t}),[4,s.send(o)];case 1:return a=u.sent(),l=a.as(f6).metaData,this._applyMetaData(l),[2,this.metaData]}})})},n.prototype.updateMetaData=function(t,r){return r===void 0&&(r=!1),y(this,void 0,void 0,function(){var i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return Y(this._isValidMetaData(t)).throw(L.invalidParameters),i=O.of(this._iid),s=i.sdkState,o=i.requestQueue,a=new p6({userId:s.userId,metadata:t,upsert:r}),[4,o.send(a)];case 1:return l=c.sent(),u=l.as(_6).metadata,this._applyMetaData(u),[2,this.metaData]}})})},n.prototype.deleteMetaData=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return Y(R("string",t)).throw(L.invalidParameters),r=O.of(this._iid),i=r.sdkState,s=r.requestQueue,o=new m6({userId:i.userId,metadataKey:t}),[4,s.send(o)];case 1:return l.sent(),this._applyMetaData(((a={})[t]=!0,a),!0),[2,this.metaData]}})})},n.prototype.deleteAllMetaData=function(){return y(this,void 0,void 0,function(){var t,r,i,s;return v(this,function(o){switch(o.label){case 0:return t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new g6({userId:r.userId}),[4,i.send(s)];case 1:return o.sent(),this.metaData={},[2]}})})},n}(Kn),PC=function(e){function n(t){var r=t.userProfile,i=e.call(this)||this;return i.userProfile=r,i}return T(n,e),n}(Tt),im=function(){function e(n,t){var r,i,s,o,a,l,u,c,d,h,f,p,g,b;this._iid=n,this.appInfo=new k1(t),this.user=new Ke(n,t),this.connectedAt=(r=t.login_ts)!==null&&r!==void 0?r:0,this.firstConnectedAt=0,this.pingInterval=(i=t.ping_interval)!==null&&i!==void 0?i:15e3,this.pongTimeout=(s=t.pong_timeout)!==null&&s!==void 0?s:5e3,this.reconnectInterval=(a=(o=t.reconnect)===null||o===void 0?void 0:o.interval)!==null&&a!==void 0?a:3e3,this.reconnectMaxInterval=(u=(l=t.reconnect)===null||l===void 0?void 0:l.max_interval)!==null&&u!==void 0?u:6e4,this.reconnectRetryCount=(d=(c=t.reconnect)===null||c===void 0?void 0:c.retry_cnt)!==null&&d!==void 0?d:5,this.reconnectIntervalMultiple=(f=(h=t.reconnect)===null||h===void 0?void 0:h.mul)!==null&&f!==void 0?f:2,this.maxUnreadCountOnSuperGroup=(p=t.max_unread_cnt_on_super_group)!==null&&p!==void 0?p:100,this.profileImageEncryption=!!t.profile_image_encryption,this.concurrentCallLimit=(g=t.concurrent_call_limit)!==null&&g!==void 0?g:5,this.backOffDelay=(b=t.back_off_delay)!==null&&b!==void 0?b:100}return e.payloadify=function(n){return ye(Ie(x(x(x({},Ke.payloadify(n.user)),k1.payloadify(n.appInfo)),{login_ts:n.connectedAt,ping_interval:n.pingInterval,pong_timeout:n.pongTimeout,reconnect:{interval:n.reconnectInterval,max_interval:n.reconnectMaxInterval,retry_cnt:n.reconnectRetryCount,mul:n.reconnectIntervalMultiple},max_unread_cnt_on_super_group:n.maxUnreadCountOnSuperGroup,profile_image_encryption:n.profileImageEncryption,concurrent_call_limit:n.concurrentCallLimit,back_off_delay:n.backOffDelay})))},e.prototype.apply=function(){var n=this.reconnectInterval,t=this.reconnectMaxInterval,r=this.reconnectIntervalMultiple,i=O.of(this._iid);i.sdkState.websocket&&(i.sdkState.websocket.pingInterval=1e3*this.pingInterval,i.sdkState.websocket.pongTimeout=1e3*this.pongTimeout,i.sdkState.websocket.reconnectMaxRetry=this.reconnectRetryCount,i.sdkState.websocket.reconnectRetryStrategy={calcTimeout:function(s){return s>0?1e3*Math.min(n*Math.pow(r,s-1),t):10}}),i.appInfo=this.appInfo,i.sessionManager.currentUser=this.user,i.connectedAt=this.connectedAt,this.firstConnectedAt||(i.firstConnectedAt=this.connectedAt),i.maxSuperGroupChannelUnreadCount=this.maxUnreadCountOnSuperGroup,i.concurrentCallLimit=this.concurrentCallLimit,i.backOffDelay=this.backOffDelay,i.dispatcher.dispatch(new PC({userProfile:this}))},e}(),FC=function(e){function n(t){var r=t.request,i=r===void 0||r,s=t.features,o=s===void 0?{}:s,a=t.options,l=a===void 0?{}:a,u=t.statConfigInfo,c=e.call(this)||this;return c.request=i,c.features=x({localCache:!0,notification:!0},o),c.options=x({ingestion:!0},l),c.statConfigInfo=u,c}return T(n,e),n}(Tt),dh=function(e){function n(t,r,i){var s,o,a,l,u=this;return(u=e.call(this,t,r,i)||this).error=null,u.services=[],u.userProfile=new im(t,i),u.deviceTokenLastDeletedAt=(s=i.device_token_last_deleted_at)!==null&&s!==void 0?s:0,u.key=(o=i.key)!==null&&o!==void 0?o:"",u.ekey=(a=i.ekey)!==null&&a!==void 0?a:"",u.error=i.error?new L(i):null,u.services=(l=i.services)!==null&&l!==void 0?l:[],u}return T(n,e),n.asError=function(t){return new n("","LOGI",x({user_id:"",error:!0},t))},n.prototype.applyTo=function(t){return y(this,void 0,void 0,function(){var r,i,s;return v(this,function(o){switch(o.label){case 0:return this.error?[3,4]:(r=O.of(t))?(i=r.sessionManager,s=r.dispatcher,[4,i.login(this)]):[3,2];case 1:return o.sent(),this.userProfile.apply(),s.dispatch(new FC({request:this.userProfile.appInfo.applicationAttributes.includes("allow_sdk_request_log_publish"),features:{localCache:this.userProfile.appInfo.applicationAttributes.includes("allow_sdk_feature_local_cache_log_publish"),notification:this.userProfile.appInfo.applicationAttributes.includes("allow_sdk_noti_stats_log_publish")},options:{ingestion:this.userProfile.appInfo.allowSdkStatsUpload},statConfigInfo:this.userProfile.appInfo.statConfigInfo})),[3,3];case 2:throw L.lostInstance;case 3:return[3,5];case 4:throw this.error;case 5:return[2]}})})},n}(gt),Ua=function(){function e(){this.type=rt.NONE,this.name="none"}return e.prototype.run=function(n){return y(this,void 0,void 0,function(){return v(this,function(t){return[2]})})},e.prototype.onConnect=function(n,t){return y(this,void 0,void 0,function(){return v(this,function(r){return[2]})})},e.prototype.onReconnect=function(n,t){return t.resetReconnectCount,y(this,void 0,void 0,function(){return v(this,function(r){return[2]})})},e.prototype.onDisconnect=function(n,t){return t.error,t.autoReconnect,t.cause,y(this,void 0,void 0,function(){return v(this,function(r){return[2]})})},e.prototype.onDisconnectWebSocket=function(n,t){return y(this,void 0,void 0,function(){return v(this,function(r){return[2]})})},e.prototype.onLogout=function(n,t){return y(this,void 0,void 0,function(){return v(this,function(r){return[2]})})},e}(),Re=function(e){return y(void 0,void 0,void 0,function(){var n;return v(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e()];case 1:return t.sent(),[3,3];case 2:if(!((n=t.sent())instanceof L))throw n;return n.throwOutside(),[3,3];case 3:return[2]}})})},kt=function(e){return y(void 0,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e()];case 1:case 2:return n.sent(),[3,3];case 3:return[2]}})})},wo=function(e){function n(t){t===void 0&&(t={});var r,i=this;return(i=e.call(this)||this).type=rt.LOGOUT,i.name="logout",i._wasPreviouslyConnected=(r=t.wasPreviouslyConnected)===null||r===void 0||r,i}return T(n,e),n.prototype.run=function(t){return y(this,void 0,void 0,function(){var r,i,s=this;return v(this,function(o){switch(o.label){case 0:return r=Date.now(),i=t.sdkState.userId,[4,t.logout()];case 1:return o.sent(),[4,t.changeState(new Qg,r)];case 2:return o.sent(),this._wasPreviouslyConnected&&Re(function(){return y(s,void 0,void 0,function(){return v(this,function(a){return t.connectionHandlers.forEach(function(l){l.onDisconnected&&l.onDisconnected(i)}),[2]})})}),[2]}})})},n}(Ua),s0=function(e){function n(){var t=e.call(this)||this;return t.type=rt.EXTERNAL_DISCONNECTED,t.name="externaldisconnected",t}return T(n,e),n.prototype.run=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return[4,t.disconnect()];case 1:return r.sent(),[2]}})})},n.prototype.onConnect=function(t,r){return y(this,void 0,void 0,function(){var i;return v(this,function(s){switch(s.label){case 0:return i=Date.now(),[4,t.disconnect()];case 1:return s.sent(),[4,t.changeState(new a0({authToken:r}),i)];case 2:return s.sent(),[2]}})})},n.prototype.onReconnect=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return r=Date.now(),[4,t.changeState(new rf,r)];case 1:return i.sent(),[2]}})})},n.prototype.onLogout=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return r=Date.now(),[4,t.changeState(new wo,r)];case 1:return i.sent(),[2]}})})},n}(Ua),nf=function(e){function n(t){var r=t.autoReconnect,i=e.call(this)||this;return i.type=rt.INTERNAL_DISCONNECTED,i.name="internaldisconnected",i._autoReconnect=!1,i._autoReconnect=r,i}return T(n,e),n.prototype.run=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return r=Date.now(),[4,t.disconnect()];case 1:return i.sent(),this._autoReconnect?[4,t.changeState(new rf,r)]:[3,3];case 2:i.sent(),i.label=3;case 3:return[2]}})})},n.prototype.onConnect=function(t,r){return y(this,void 0,void 0,function(){var i;return v(this,function(s){switch(s.label){case 0:return i=Date.now(),[4,t.disconnect()];case 1:return s.sent(),[4,t.changeState(new a0({authToken:r}),i)];case 2:return s.sent(),[2]}})})},n.prototype.onReconnect=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return r=Date.now(),[4,t.changeState(new rf,r)];case 1:return i.sent(),[2]}})})},n.prototype.onDisconnectWebSocket=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return r=Date.now(),[4,t.changeState(new s0,r)];case 1:return i.sent(),[2]}})})},n.prototype.onLogout=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return r=Date.now(),[4,t.changeState(new wo,r)];case 1:return i.sent(),[2]}})})},n}(Ua),Or=function(e){return y(void 0,void 0,void 0,function(){return v(this,function(n){return[2,new Promise(function(t){return setTimeout(t,e)})]})})},HC=function(){function e(){}return e.prototype.calcTimeout=function(){return 0},e}(),o0=function(e,n,t){return t===void 0&&(t=new HC),y(void 0,void 0,void 0,function(){var r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:r=0,i=null,s=function(c){return i=c??new Error("Halted")},o=function(){r=0},u.label=1;case 1:if(!(n===-1||r=this._stateUpdatedAt?(this._currentState=t,this._stateUpdatedAt=r,this._dispatcher.dispatch(new _i({stateType:t.type})),this._logger.debug("connection state changes to ".concat(t.name)),[4,this._currentState.run(this)]):[3,2];case 1:return i.sent(),[2,!0];case 2:return[2,!1]}})})},n.prototype._tryResolveConnectionRequest=function(){var t;return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return r=this._unresolvedLogi,this._websocketClient.isOpen&&r?(this._unresolvedLogi=void 0,r.error?[3,2]:[4,r.applyTo(this._iid)]):[3,3];case 1:return i.sent(),this._statLogConnection(),(t=this._pinger)===null||t===void 0||t.start(),this._connectionRequestQueue.forEach(function(s){return s.resolve()}),this._connectionRequestQueue=[],this.sdkState.appState="foreground",[3,3];case 2:this._sessionManager.session.authToken=void 0,(r.error.isSessionExpiredError||r.error.isSessionInvalidatedError)&&this._dispatcher.dispatch(new Ul({reason:r.error.code,message:r.error.message})),this._rejectConnectionRequest(r.error),i.label=3;case 3:return[2]}})})},n.prototype._rejectConnectionRequest=function(t){var r;if((r=this._pinger)===null||r===void 0||r.stop(),this.clearLoginTimer(),this._connectionRequestQueue.length>0){var i=this._connectionRequestQueue;this._connectionRequestQueue=[],i.forEach(function(s){return s.reject(t)}),this._statLogConnection(t)}},n.prototype._url=function(){var t,r=this.sdkState,i=r.appId,s=r.appVersion,o=r.userId,a=r.extensions,l=r.sendbirdRuntimeEnvironment,u=this.cacheContext.localCacheEnabled,c=this._sessionManager.session,d=(t=this.sdkState.websocket)===null||t===void 0?void 0:t.compression,h=!!(a??{}).sb_uikit,f=Zh.userAgentWithExtension(a);return"".concat(this.sdkState.websocket.host,"/?p=JS&pv=").concat(encodeURIComponent(bo.OS_VERSION),"&sv=").concat(encodeURIComponent(bo.SDK_VERSION),"&ai=").concat(i).concat(s?"&av=".concat(s):"").concat(c.hasSession?"":"&user_id=".concat(encodeURIComponent(o)),"&pmce=").concat(d?1:0,"&active=1&device_token_types=").concat(encodeURIComponent(["gcm","huawei","apns"].join(",")),"&SB-User-Agent=").concat(f,"&SB-SDK-User-Agent=").concat(encodeURIComponent(Zh.sendbirdSdkUserAgentWithExtension(l)),"&Request-Sent-Timestamp=").concat(Date.now().toString(),"&include_extra_data=").concat(encodeURIComponent(String(BC))).concat(this._sessionManager.handler?"&expiring_session=1":"","&use_local_cache=").concat(u?1:0,"&include_poll_details=1").concat(h?"&uikit_config=1":"")},n.prototype._statLogConnection=function(t){var r;this._dispatcher.dispatch(new Vg(new $t({type:Et.WEBSOCKET_CONNECT,data:{host_url:(r=this.sdkState.websocket)===null||r===void 0?void 0:r.host,success:!t,latency:Date.now()-this._connectingAt,error_code:t==null?void 0:t.code,error_description:t==null?void 0:t.message}})))},n.prototype.connect=function(t){var r;return t===void 0&&(t=""),y(this,void 0,void 0,function(){var i,s,o,a=this;return v(this,function(l){return this._logiProcessingTimer&&(clearTimeout(this._logiProcessingTimer),this._logiProcessingTimer=void 0,this._rejectConnectionRequest(L.connectionCanceled)),i=this._url(),s=new Tr,this._connectionRequestQueue.push(s),this._connectionRequestQueue.length===1&&(this._connectingAt=Date.now(),this._loginTimer=setTimeout(function(){a._loginTimer=void 0,a._rejectConnectionRequest(L.loginTimeout)},(r=this.sdkState.websocket)===null||r===void 0?void 0:r.responseTimeout),o=this._sessionManager.session,t&&(o.authToken=t),o.sessionKey||o.authToken?this._websocketClient.connect(i,JSON.stringify(o.hasSession?{auth:o.sessionKey}:{token:o.authToken})):this._websocketClient.connect(i,JSON.stringify({}))),[2,s.promise]})})},n.prototype.cancelConnectForRetry=function(){this._dispatcher.dispatch(dh.asError(L.connectionRenew))},n.prototype.disconnect=function(){return y(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return[4,this._websocketClient.disconnect()];case 1:return t.sent(),[2]}})})},n.prototype.logout=function(){return y(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return this.sdkState.userId=void 0,this._unresolvedLogi=void 0,[4,this.disconnect()];case 1:return t.sent(),[4,this._sessionManager.clear()];case 2:return t.sent(),[2]}})})},n.prototype.clearLoginTimer=function(){this._loginTimer&&(clearTimeout(this._loginTimer),this._loginTimer=void 0)},n}(La),$C=function(e){function n(t){var r=t.appId,i=t.userId,s=t.services,o=t.includeUIKitConfig,a=o!==void 0&&o,l=t.localCacheEnabled,u=l===void 0||l,c=t.expiringSession,d=c===void 0||c,h=e.call(this)||this;return h.path="".concat(Xe,"/").concat(i,"/login"),h.method=Z.POST,h.params=ye({expiring_session:!!d,services:s,include_logi:!0,include_extra_data:String(BC),uikit_config:a,use_local_cache:u,app_id:r}),h.requireAuth=!1,h}return T(n,e),n}(J),C6=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.logi=new dh(t,"LOGI",r),i}return T(n,e),n}(se);(function(e){e[e.ALL=0]="ALL",e[e.WEBSOCKET=1]="WEBSOCKET",e[e.API=2]="API"})(eo||(eo={}));var Ht,L1,S6=[zg,$C],T6=function(){function e(n,t){var r=t.session,i=t.sdkState,s=t.dispatcher,o=t.logger,a=t.useFetchCompat,l=a!==void 0&&a,u=this;this._currentConnectionStateType=rt.INITIALIZED,this._lazyCallQueue=[],this.commandRouter=new c6(n,{session:r,sdkState:i,dispatcher:s,logger:o,useFetchCompat:l}),this._session=r,this._logger=o,this._dispatcher=s,this._dispatcher.on(function(c){var d,h,f;if(c instanceof _i){var p=c.stateType;switch(u._currentConnectionStateType=p,p){case rt.CONNECTED:u._resolveLazyCallQueue();break;case rt.INITIALIZED:case rt.INTERNAL_DISCONNECTED:case rt.EXTERNAL_DISCONNECTED:case rt.LOGOUT:u._rejectLazyCallQueue(!((f=u._session)===null||f===void 0)&&f.hasSession?L.connectionClosed:L.connectionRequired)}}else if(c instanceof DC)u._session.hasChatServicePermission||u._resolveLazyCallQueue(eo.API);else if(c instanceof rm||c instanceof UC)u._rejectLazyCallQueue(L.connectionClosed);else if(c instanceof pC){var g=c.request,b=c.deferred,m=c.error;try{for(var _=pe(S6),E=_.next();!E.done;E=_.next())if(g instanceof E.value)return void b.reject(m)}catch(S){d={error:S}}finally{try{E&&!E.done&&(h=_.return)&&h.call(_)}finally{if(d)throw d.error}}u._lazyCallQueue.push({command:g,deferred:b})}})}return Object.defineProperty(e.prototype,"isReady",{get:function(){return this._currentConnectionStateType===rt.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLazyCallActivated",{get:function(){return this._currentConnectionStateType===rt.CONNECTING||this._currentConnectionStateType===rt.RECONNECTING||this._session.isRefreshing},enumerable:!1,configurable:!0}),e.prototype._classifyLazyCallQueueByScope=function(n){var t,r=[],i=[];switch(n){case eo.ALL:t=null;break;case eo.WEBSOCKET:t=wr;break;case eo.API:t=J}var s=!1;return this._lazyCallQueue.forEach(function(o){!t||o.command instanceof t||(s=!0),s?i.push(o):r.push(o)}),[r,i]},e.prototype._resolveLazyCallQueue=function(n){var t=this;n===void 0&&(n=eo.ALL);var r=Ae(this._classifyLazyCallQueueByScope(n),2),i=r[0],s=r[1];this._lazyCallQueue=s,i.forEach(function(o){return y(t,void 0,void 0,function(){var a,l,u,c,d;return v(this,function(h){switch(h.label){case 0:a=o.command,l=o.deferred,(u=o.timeout)&&clearTimeout(u),h.label=1;case 1:return h.trys.push([1,3,,4]),[4,this.send(a)];case 2:return c=h.sent(),l.resolve(c),[3,4];case 3:return d=h.sent(),l.reject(d),[3,4];case 4:return[2]}})})})},e.prototype._rejectLazyCallQueue=function(n,t){var r=this;t===void 0&&(t=eo.ALL);var i=Ae(this._classifyLazyCallQueueByScope(t),2),s=i[0],o=i[1];this._lazyCallQueue=o,s.forEach(function(a){return y(r,void 0,void 0,function(){var l,u;return v(this,function(c){return l=a.deferred,u=a.timeout,clearTimeout(u),l.reject(n),[2]})})})},e.prototype.send=function(n){return y(this,void 0,void 0,function(){var t,r,i=this;return v(this,function(s){switch(s.label){case 0:return n instanceof wr?this.isReady?(this._logger.debug("send websocket request",n),[4,this.commandRouter.send(n)]):[3,2]:[3,4];case 1:case 5:case 7:return[2,s.sent()];case 2:if(this.isLazyCallActivated)return this._logger.debug("wait websocket request",n),t=new Tr,this._lazyCallQueue.push({command:n,deferred:t,timeout:setTimeout(function(){return i.timeout(n.requestId)},1e4)}),[2,t.promise];throw this._logger.debug("fail websocket request"),L.connectionRequired;case 3:case 9:return[3,11];case 4:return n instanceof J?this._session.hasSession?(this._logger.debug("send api request",n),[4,this.commandRouter.send(n)]):[3,6]:[3,10];case 6:return n.hasSessionKey?(this._logger.debug("send api request with tmp session key",n),[4,this.commandRouter.send(n)]):[3,8];case 8:if(this.isLazyCallActivated)return this._logger.debug("wait api request",n),t=new Tr,this._lazyCallQueue.push({command:n,deferred:t,timeout:setTimeout(function(){return i.timeout(n.requestId)},1e4)}),[2,t.promise];throw r=L.connectionRequired,this._logger.debug("fail api request",r),r;case 10:throw L.invalidCommand;case 11:return[2]}})})},e.prototype.forceSend=function(n){return y(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return this._logger.debug("send forced request",n),n instanceof wr||n instanceof J?[4,this.commandRouter.send(n)]:[3,2];case 1:return[2,t.sent()];case 2:throw L.invalidCommand}})})},e.prototype.timeout=function(n){this._logger.debug("timeout request",n);var t=this._lazyCallQueue.findIndex(function(r){return r.command.requestId===n});t>-1&&(this._lazyCallQueue[t].deferred.reject(L.connectionRequired),this._lazyCallQueue.splice(t,1))},e.prototype.cancel=function(n){this._logger.debug("cancel api request",n),this.commandRouter.cancel(n)},e.prototype.cancelAll=function(){this._logger.debug("cancel all api requests"),this.commandRouter.cancelAll()},e}(),bp="sendbird@devicetokens",Cp=function(){function e(n){var t=n.type,r=n.token,i=n.device_os,s=n.device_manufacturer,o=n.system_push_enabled;this.type=t,this.token=r,this.deviceOS=i,this.deviceManufacturer=s,this.systemPushEnabled=o}return e.payloadify=function(n){return ye(Ie({type:n.type,token:n.token,device_os:n.deviceOS,device_manufacturer:n.deviceManufacturer,system_push_enabled:n.systemPushEnabled}))},e}(),Sp=new WeakMap,w6=function(e){function n(t){var r=t._iid,i=t.session,s=t.cacheContext,o=t.sdkState,a=t.dispatcher,l=t.requestQueue,u=t.logger,c=t.pushNotificationAckManager,d=e.call(this)||this;return d._currentConnectionStateType=rt.INITIALIZED,d._isRefreshingAuthToken=!1,d.currentUser=null,d.session=i,d._iid=r,d._cacheContext=s,d._sdkState=o,d._dispatcher=a,d._requestQueue=l,d._logger=u,d._pushNotificationAckManager=c,d._deviceTokens=[],d._dispatcher.on(function(h){var f,p,g;if(h instanceof _i){var b=h.stateType;d._currentConnectionStateType=b}else if(h instanceof Ul&&d.handler&&!d.isSessionKeyRefreshing){if(d._currentConnectionStateType===rt.CONNECTING)return;!((f=h.error)===null||f===void 0)&&f.isSessionInvalidatedError?d.close():(!((p=h.error)===null||p===void 0)&&p.isSessionTokenExpiredError&&d.refreshAuthToken().catch(function(m){if(Lr(m)&&d._sdkState.appState==="foreground")throw m}),!((g=h.error)===null||g===void 0)&&g.isSessionKeyExpiredError&&(d._logger.debug("session expired"),d.handler.onSessionExpired&&d.handler.onSessionExpired(),d.refreshSessionKey().catch(function(m){if(Lr(m)&&d._sdkState.appState==="foreground")throw m})))}}),d}return T(n,e),Object.defineProperty(n.prototype,"ekey",{get:function(){return Sp.get(this)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"deviceTokens",{get:function(){return this._deviceTokens},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"deviceTokenLastDeletedAt",{get:function(){return this._deviceTokenLastDeletedAt},enumerable:!1,configurable:!0}),n.prototype.indexOfDeviceToken=function(t,r){return this._deviceTokens.findIndex(function(i){return i.type===t&&i.token===r})},n.prototype.hasDeviceToken=function(t,r){return this.indexOfDeviceToken(t,r)>=0},n.prototype.createRefreshWebsocketCommand=function(t,r){return new rA({authToken:t,expiringSession:!0,requestId:r})},n.prototype._refreshSessionKeyByWebSocket=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return r=this.createRefreshWebsocketCommand(t),[4,this._requestQueue.forceSend(r)];case 1:if(i=l.sent(),s=i.as(sA),o=s.newKey,a=s.error)throw a;return this.session.sessionKey=o??this.session.sessionKey,[2]}})})},n.prototype._refreshSessionKeyByApi=function(t){return y(this,void 0,void 0,function(){var r,i=this;return v(this,function(s){switch(s.label){case 0:return r=new zg({userId:this._sdkState.userId,authToken:t,services:this.session.services&&this.session.services.length>0?this.session.services:void 0,expiringSession:!0}),[4,o0(function(o){return y(i,void 0,void 0,function(){var a,l,u,c,d;return v(this,function(h){switch(h.label){case 0:return h.trys.push([0,2,,3]),[4,this._requestQueue.forceSend(r)];case 1:return a=h.sent(),l=a.as(iA),u=l.key,c=l.services,this.session.sessionKey=u,this.session.services=c,[3,3];case 2:if(d=h.sent(),!this._isSessionRelatedError(d))throw d;return o(d),[3,3];case 3:return[2]}})})},3)];case 1:return s.sent(),[2]}})})},n.prototype._refreshSessionKey=function(t,r){return r===void 0&&(r=!0),y(this,void 0,void 0,function(){var i,s;return v(this,function(o){switch(o.label){case 0:if(this._currentConnectionStateType!==rt.CONNECTED)return[3,8];o.label=1;case 1:return o.trys.push([1,3,,8]),[4,this._refreshSessionKeyByWebSocket(t)];case 2:return o.sent(),this.complete(),[2];case 3:i=o.sent(),o.label=4;case 4:return o.trys.push([4,6,,7]),[4,this._handleSessionRefreshError(i,r)];case 5:return o.sent(),[2];case 6:return o.sent(),[3,7];case 7:return[3,8];case 8:return o.trys.push([8,10,,12]),[4,this._refreshSessionKeyByApi(t)];case 9:return o.sent(),this.complete(),[3,12];case 10:return s=o.sent(),[4,this._handleSessionRefreshError(s,r)];case 11:return o.sent(),[3,12];case 12:return[2]}})})},n.prototype._receiveNewAuthToken=function(){var t,r=this,i=new Tr;if(this._isRefreshingAuthToken=!0,this.session.sessionKey=void 0,this.session.authToken=void 0,(t=this.handler)===null||t===void 0?void 0:t.onSessionTokenRequired){var s=null,o=function(){s&&(clearTimeout(s),s=null)},a=function(u){o(),r._isRefreshingAuthToken&&(r._isRefreshingAuthToken=!1,i.resolve(u))},l=function(u){o(),r._isRefreshingAuthToken&&(r._isRefreshingAuthToken=!1,i.reject(u))};s=setTimeout(function(){return l()},1e3*this._sdkState.sessionTokenRefreshTimeout),Re(function(){return y(r,void 0,void 0,function(){var u;return v(this,function(c){return!((u=this.handler)===null||u===void 0)&&u.onSessionTokenRequired&&this.handler.onSessionTokenRequired(a,l),[2]})})})}else i.resolve(null);return i.promise},n.prototype._handleSessionRefreshError=function(t,r){return r===void 0&&(r=!1),y(this,void 0,void 0,function(){var i;return v(this,function(s){switch(s.label){case 0:return t instanceof L&&(t.isSessionTokenExpiredError||t.code===Te.APPLICATION_NOT_FOUND)?(this.session.authToken=void 0,r?[4,this._receiveNewAuthToken()]:[3,6]):[3,6];case 1:return(i=s.sent())?(this.session.authToken=i,[4,this._refreshSessionKey(this.session.authToken,!1)]):[3,3];case 2:return s.sent(),[3,5];case 3:return[4,this.clear()];case 4:s.sent(),s.label=5;case 5:return[2];case 6:throw t}})})},n.prototype._isSessionRelatedError=function(t){return t instanceof L&&(t.isSessionExpiredError||t.isSessionInvalidatedError)},Object.defineProperty(n.prototype,"isSessionKeyRefreshing",{get:function(){return this.session.isRefreshing},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRefreshingAuthToken",{get:function(){return this._isRefreshingAuthToken},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isSessionExpiring",{get:function(){return!!this.handler},enumerable:!1,configurable:!0}),n.prototype.authenticateFeed=function(t,r){var i;return y(this,void 0,void 0,function(){var s,o,a;return v(this,function(l){switch(l.label){case 0:return this.session.authToken=r,s=new $C({appId:this._sdkState.appId,userId:t,services:[xc.FEED],includeUIKitConfig:!!((i=this._sdkState.extensions)!==null&&i!==void 0?i:{}).sb_uikit,localCacheEnabled:this._cacheContext.localCacheEnabled,expiringSession:!r||this.isSessionExpiring}),[4,this._requestQueue.commandRouter.send(s)];case 1:return o=l.sent(),(a=o.as(C6).logi).error?[3,4]:this.session.hasChatServicePermission?[3,3]:[4,a.applyTo(this._iid)];case 2:l.sent(),l.label=3;case 3:return[3,5];case 4:throw a.error;case 5:return[2]}})})},n.prototype.login=function(t){var r;return y(this,void 0,void 0,function(){var i,s,o,a,l,u,c,d;return v(this,function(h){switch(h.label){case 0:return i=t.key,s=t.ekey,o=t.services,a=t.userProfile,l=t.deviceTokenLastDeletedAt,u=l===void 0?0:l,this.session.sessionKey=i,this.session.services=o,Sp.set(this,s),this._deviceTokenCacheEnabled=(r=a==null?void 0:a.appInfo)===null||r===void 0?void 0:r.deviceTokenCache,c=this._cacheContext.preference,this._deviceTokenCacheEnabled?[4,c.get(bp)]:[3,5];case 1:return!(d=h.sent())||d.lastDeletedAt0&&(this.queue=this.queue.concat(this.flushWaitQueue),this.flushWaitQueue=[])},e.prototype._isDuplicateStat=function(n){var t=this._sentLogStats.find(function(r){var i;return r.channelUrl===n.data.channel_url&&r.messageId===((i=n.data.notificationId)!==null&&i!==void 0?i:n.data.message_id)&&r.action===n.data.action});return t||this._sentLogStats.push({channelUrl:n.data.channel_url,messageId:n.data.message_id,action:n.data.action}),!!t},e.prototype._flush=function(n){return y(this,void 0,void 0,function(){var t,r,i,s;return v(this,function(o){switch(o.label){case 0:if(t=!0,!(n.length>0))return[3,10];if(this.isFlushing)return[3,9];this.isFlushing=!0,o.label=1;case 1:return o.trys.push([1,4,8,9]),r=De([],Ae(n),!1).slice(0,Math.min(this.limit,this.statConfig.maxStatCountPerRequest)),i=new N6({deviceId:this.deviceId,statLogs:r}),[4,this.requestQueue.send(i)];case 2:return o.sent(),this.queue=De([],Ae(n),!1).slice(r.length).concat(this.flushWaitQueue),this.flushWaitQueue=[],this.limit=100,this.logInfo.lastFlushedAt=Date.now(),[4,this._save()];case 3:return o.sent(),[3,9];case 4:return(s=o.sent())instanceof L?s.code!==Te.NON_AUTHORIZED?[3,6]:[4,this.clear()]:[3,7];case 5:return o.sent(),this.enabledState=Ht.DISABLED,[3,7];case 6:s.code===Te.STAT_UPLOAD_NOT_ALLOWED&&(this.enabledState=Ht.COLLECT_ONLY),o.label=7;case 7:return this.limit=this.limit+20,t=!1,[3,9];case 8:return this.isFlushing=!1,[7];case 9:return[3,11];case 10:this.isFlushing=!1,o.label=11;case 11:return[2,t]}})})},e.prototype._save=function(){return y(this,void 0,void 0,function(){var n;return v(this,function(t){switch(t.label){case 0:return n=De(De([],Ae(this.queue),!1),Ae(this.flushWaitQueue),!1),[4,this.cacheContext.preference.set(this.key,{deviceId:this.logInfo.deviceId,statLogs:n.map(function(r){return $t.payloadify(r)}),generation:this.logInfo.generation++,lastFlushedAt:this.logInfo.lastFlushedAt})];case 1:return t.sent(),[2]}})})},e.prototype.clear=function(){return y(this,void 0,void 0,function(){return v(this,function(n){return this.queue=[],this.flushWaitQueue=[],this.logInfo.generation=1,this._save(),[2]})})},e}(),Fl=function(e){function n(t){var r,i,s,o,a=t.type,l=t.data,u=t.ts,c=u===void 0?Date.now():u,d=e.call(this,{type:a,data:l,ts:c})||this;return d.date=new Date(c),d.key="".concat((r=d.date,i=r.getFullYear(),s=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0"),"".concat(i).concat(s).concat(o)),"_").concat(a),d}return T(n,e),n}($t),I6=function(e){function n(t){var r=t.deviceId,i=t.cacheContext,s=t.requestQueue;return e.call(this,{deviceId:r,cacheContext:i,requestQueue:s})||this}return T(n,e),Object.defineProperty(n.prototype,"_isSendable",{get:function(){return this.queue.length!==0&&Date.now()-this.logInfo.lastFlushedAt>=this.statConfig.minInterval},enumerable:!1,configurable:!0}),n.prototype.init=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return[4,e.prototype.init.call(this,t+".daily")];case 1:return r.sent(),this.queue=this.logInfo.statLogs.map(function(i){return new $t({type:i.stat_type,ts:i.ts,data:i.data})}),[2]}})})},n.prototype.setConfig=function(t,r){return y(this,void 0,void 0,function(){var i,s,o,a;return v(this,function(l){switch(l.label){case 0:return this.statConfig=t,this.statConfig.minInterval=864e5,this._mergeQueue(),r.localCacheStat?(this.enabledState=r.enabledStat?Ht.ENABLED:Ht.COLLECT_ONLY,[3,3]):[3,1];case 1:return this.enabledState=Ht.DISABLED,[4,this.clear()];case 2:l.sent(),l.label=3;case 3:return this.isEnabled&&this._isSendable?[4,this._getUploadStats()]:[3,9];case 4:i=l.sent(),s=Math.max(Math.floor(Math.random()*this.statConfig.requestDelayRange),100),o=0,l.label=5;case 5:return o=this.statConfig.minStatCount&&this.queue.length>this.statConfig.lowerThreshold||this.logInfo.lastFlushedAt>0&&Date.now()-this.logInfo.lastFlushedAt>=this.statConfig.minInterval},enumerable:!1,configurable:!0}),n.prototype.init=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return[4,e.prototype.init.call(this,t+".realtime")];case 1:return r.sent(),this.queue=this.logInfo.statLogs.map(function(i){var s;return i.data=ye(x(x({},i.data),{message_id:(s=i.data.notificationId)!==null&&s!==void 0?s:i.data.message_id,notificationId:void 0})),new $t({type:i.stat_type,ts:i.ts,data:i.data})}),this._sentLogStats=this.queue.map(function(i){var s;return{channelUrl:i.data.channelUrl,messageId:(s=i.data.notificationId)!==null&&s!==void 0?s:i.data.message_id,action:i.data.action}}),[2]}})})},n.prototype.setConfig=function(t,r){return y(this,void 0,void 0,function(){var i;return v(this,function(s){switch(s.label){case 0:return this.statConfig=t,this._mergeQueue(),r.notificationStat?(this.enabledState=r.enabledStat?Ht.ENABLED:Ht.COLLECT_ONLY,[3,3]):[3,1];case 1:return this.enabledState=Ht.DISABLED,[4,this.clear()];case 2:s.sent(),s.label=3;case 3:return this.isEnabled&&this._isSendable?(i=Math.max(Math.floor(Math.random()*this.statConfig.requestDelayRange),100),[4,Or(i)]):[3,6];case 4:return s.sent(),[4,this._flush(this.queue)];case 5:s.sent(),s.label=6;case 6:return[2]}})})},n.prototype.put=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return this.enabledState===Ht.DISABLED?[2,!0]:(r=this.enabledState===Ht.PENDING||this.isFlushing?this.flushWaitQueue:this.queue,this._isDuplicateStat(t)?[2,!0]:(r.push(t),this.enabledState===Ht.PENDING?[3,2]:[4,this._save()]));case 1:i.sent(),i.label=2;case 2:return this.isEnabled?(this._mergeQueue(),this.isEnabled&&this._isSendable?[4,this._flush(r)]:[3,4]):[3,4];case 3:return[2,i.sent()];case 4:return[2,!0]}})})},n}(Yg),x6=function(){function e(n){var t=n.cacheContext,r=n.requestQueue,i=n.dispatcher,s=n.logger;this._collectRequestStat=!0,this._collectFeatureLocalCacheStat=!0,this._collectionNotificationStat=!0,this._retryCount=0,this.deviceId=Bs(),this.cacheContext=t,this.requestQueue=r,this.dispatcher=i,this.logger=s,this._dailyStatCollector=new I6({deviceId:this.deviceId,cacheContext:this.cacheContext,requestQueue:this.requestQueue}),this._defaultStatCollector=new A6({deviceId:this.deviceId,cacheContext:this.cacheContext,requestQueue:this.requestQueue}),this._realTimeStatCollector=new M6({deviceId:this.deviceId,cacheContext:this.cacheContext,requestQueue:this.requestQueue})}return e.prototype._migration=function(){return y(this,void 0,void 0,function(){var n,t,r,i;return v(this,function(s){switch(s.label){case 0:return[4,this.cacheContext.preference.get(this.key)];case 1:return(n=s.sent())?(t=[],n.statLogs.forEach(function(o){o.stat_type===Et.FEATURE_LOCALCACHE&&t.push(new $t({type:o.stat_type,ts:o.ts,data:o.data}))}),[4,this.cacheContext.preference.set(this.key+".daily",{deviceId:n.deviceId,statLogs:t.map(function(o){return $t.payloadify(o)}),generation:n.generation,lastFlushedAt:n.lastFlushedAt})]):[3,6];case 2:return s.sent(),r=[],n.statLogs.forEach(function(o){o.stat_type!==Et.FEATURE_LOCALCACHE&&o.stat_type!==Et.NOTIFICATION&&(o.stat_type===Et.FEATURE_LOCALCACHE_EVENT&&(o.data=x({message_init_policy:"",starting_point:0},o.data)),r.push(new $t({type:o.stat_type,ts:o.ts,data:o.data})))}),[4,this.cacheContext.preference.set(this.key+".default",{deviceId:n.deviceId,statLogs:r.map(function(o){return $t.payloadify(o)}),generation:n.generation,lastFlushedAt:n.lastFlushedAt})];case 3:return s.sent(),i=[],n.statLogs.forEach(function(o){var a;o.stat_type===Et.NOTIFICATION&&(o.data=ye(x(x({},o.data),{message_id:(a=o.data.notificationId)!==null&&a!==void 0?a:o.data.message_id,notificationId:void 0})),i.push(new $t({type:o.stat_type,ts:o.ts,data:o.data})))}),[4,this.cacheContext.preference.set(this.key+".realtime",{deviceId:n.deviceId,statLogs:i.map(function(o){return $t.payloadify(o)}),generation:n.generation,lastFlushedAt:n.lastFlushedAt})];case 4:return s.sent(),[4,this.cacheContext.preference.remove(this.key)];case 5:s.sent(),s.label=6;case 6:return[2]}})})},e.prototype.init=function(n){return y(this,void 0,void 0,function(){var t=this;return v(this,function(r){switch(r.label){case 0:return this.key=n,[4,this._migration()];case 1:return r.sent(),[4,this._dailyStatCollector.init(this.key)];case 2:return r.sent(),[4,this._defaultStatCollector.init(this.key)];case 3:return r.sent(),[4,this._realTimeStatCollector.init(this.key)];case 4:return r.sent(),this.commandEventContext||(this.commandEventContext=this.dispatcher.on(function(i){return y(t,void 0,void 0,function(){var s,o,a,l,u,c;return v(this,function(d){return i instanceof Vg?(s=i.statLog,this.put(s)):i instanceof FC&&(o=i.request,a=i.features,l=i.options,u=i.statConfigInfo,this._retryCount=0,this._collectRequestStat=o,this._collectFeatureLocalCacheStat=a==null?void 0:a.localCache,this._collectionNotificationStat=a==null?void 0:a.notification,this._statConfig=u,this._dailyStatCollector.setConfig(this._statConfig.default,{localCacheStat:this._collectFeatureLocalCacheStat,enabledStat:l.ingestion}),this._defaultStatCollector.setConfig(this._statConfig.default,{requestStat:this._collectRequestStat,localCacheStat:this._collectFeatureLocalCacheStat,enabledStat:l.ingestion}),this._realTimeStatCollector.setConfig((c=this._statConfig.realTime)!==null&&c!==void 0?c:this._statConfig.default,{notificationStat:this._collectionNotificationStat,enabledStat:l.ingestion})),[2]})})})),[2]}})})},e.prototype.put=function(n){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return t=!0,n instanceof Fl?this._collectFeatureLocalCacheStat?[4,this._dailyStatCollector.put(n)]:[3,2]:[3,3];case 1:t=r.sent(),r.label=2;case 2:return[3,13];case 3:switch(n.type){case Et.API_RESULT:case Et.WEBSOCKET_CONNECT:return[3,4];case Et.FEATURE_LOCALCACHE:case Et.FEATURE_LOCALCACHE_EVENT:return[3,7];case Et.NOTIFICATION:return[3,10]}return[3,13];case 4:return this._collectRequestStat?[4,this._defaultStatCollector.put(n)]:[3,6];case 5:t=r.sent(),r.label=6;case 6:return[3,13];case 7:return this._collectFeatureLocalCacheStat?[4,this._defaultStatCollector.put(n)]:[3,9];case 8:t=r.sent(),r.label=9;case 9:return[3,13];case 10:return this._collectionNotificationStat?[4,this._realTimeStatCollector.put(n)]:[3,12];case 11:t=r.sent(),r.label=12;case 12:return[3,13];case 13:return t?this._retryCount=0:(this._retryCount++,this._retryCount>20&&(this._dailyStatCollector.enabledState=Ht.COLLECT_ONLY,this._defaultStatCollector.enabledState=Ht.COLLECT_ONLY,this._realTimeStatCollector.enabledState=Ht.COLLECT_ONLY,this.logger.debug(L.statLogUploadLimitExceededError))),[2]}})})},e.prototype.close=function(){this.commandEventContext&&(this.commandEventContext.close(),this.commandEventContext=void 0)},e}();(function(e){e.DELIVERY_RECEIPT="delivery_receipt",e.PUSH_ACKNOWLEDGEMENT="push_acknowledgement"})(sf||(sf={}));var G,O6=function(e){function n(){var t=e!==null&&e.apply(this,arguments)||this;return t._pushAckedCache={},t}return T(n,e),n.prototype.isAcked=function(t,r){var i,s="".concat(t,"_").concat(r);return(i=this._pushAckedCache[s])!==null&&i!==void 0&&i},n.prototype.markAsAcked=function(t,r){var i="".concat(t,"_").concat(r);this._pushAckedCache[i]=!0},n.prototype.clear=function(){O.of(this._iid).logger.debug("clear push acked cache"),this._pushAckedCache={}},n.prototype.parseData=function(t){var r,i,s,o,a=O.of(this._iid).logger,l=t.sendbird;if(typeof l=="string")try{l=JSON.parse(l)}catch{throw a.info("push notification payload does not contain sendbird payload in JSON format."),L.malformedDataError}if(!l||typeof l!="object")throw a.info("push notification payload does not contain sendbird payload in JSON format."),L.malformedDataError;var u=(r=l.push_tracking_id)!==null&&r!==void 0?r:"",c=l.notification_message_id,d=l.notification_channel_key,h=l.notification_template_key,f=l.notification_event_deadline,p=(i=l.session_key)!==null&&i!==void 0?i:{},g=(s=p==null?void 0:p.key)!==null&&s!==void 0?s:"",b=(o=p==null?void 0:p.topics)!==null&&o!==void 0?o:[];if(typeof u!="string"||u.length===0)throw a.info("push tracking id is not available"),L.malformedDataError;if(typeof c!="string"||c.length===0)throw a.info("message id is not available"),L.malformedDataError;return{pushTrackingId:u,sessionKey:g,sessionTopics:b,messageId:c,channelKey:d,templateKey:h,notificationEventDeadline:f}},n}(Kn),Ho={},O=function(){function e(n,t){var r,i,s,o,a,l,u,c,d;if(this.connectedAt=0,this.firstConnectedAt=0,this.connectionHandlers=new Map,this.userEventHandlers=new Map,!Ho[n]){Ho[n]=this;var h=(r=t.options)!==null&&r!==void 0?r:new oC,f=this.sdkState={appId:t.appId,appVersion:(i=t.appVersion)!==null&&i!==void 0?i:"",appState:"foreground",userId:void 0,extensions:{},api:{host:(s=t.apiHost)!==null&&s!==void 0?s:"https://api-".concat(t.appId,".sendbird.com")},websocket:{host:(o=t.websocketHost)!==null&&o!==void 0?o:"wss://ws-".concat(t.appId,".sendbird.com"),pingerDisabled:!!t.noPingpong,pingInterval:void 0,pongTimeout:void 0,connectMaxRetry:2,compression:!0,reconnectMaxRetry:-1,reconnectRetryStrategy:new HC,responseTimeout:h.websocketResponseTimeout},sessionTokenRefreshTimeout:h.sessionTokenRefreshTimeout};this.appInfo=void 0,this.subscribedUnreadMessageCount={all:0,feed:0,customTypes:{},ts:0};var p=this.logger=t.logger;this.connectedAt=0,this.firstConnectedAt=0,this.connectionHandlers=new Map,this.userEventHandlers=new Map;var g=this.cacheContext=new z4({encryption:t.encryption,store:t.store,localCacheEnabled:(a=t.localCacheEnabled)!==null&&a!==void 0&&a,localCacheConfig:(l=t.localCacheConfig)!==null&&l!==void 0?l:new lC});this.debugMode=(u=t.debugMode)!==null&&u!==void 0&&u,this.maxSuperGroupChannelUnreadCount=bo.DEFAULT_MAX_UNREAD_COUNT_OF_SUPER_GROUP_CHANNEL,this.useMemberInfoInMessage=h.useMemberInfoInMessage,this.typingIndicatorInvalidateTime=h.typingIndicatorInvalidateTime,this.typingIndicatorThrottle=h.typingIndicatorThrottle,this.concurrentCallLimit=void 0,this.backOffDelay=void 0;var b=this.dispatcher=new W4,m=new q4;this.requestQueue=new T6(n,{session:m,sdkState:f,dispatcher:b,logger:p,useFetchCompat:t.useFetchCompat}),this.pushNotificationAckManager=new O6(n),this.sessionManager=new w6({_iid:n,session:m,cacheContext:g,sdkState:f,dispatcher:b,requestQueue:this.requestQueue,logger:p,pushNotificationAckManager:this.pushNotificationAckManager}),this.connectionManager=new v6(n,{sdkState:f,cacheContext:this.cacheContext,connectionHandlers:this.connectionHandlers,dispatcher:b,sessionManager:this.sessionManager,websocketClient:this.requestQueue.commandRouter.websocketClient,disableWebSocketCloseEventHandling:(c=t.disableWebSocketCloseEventHandling)!==null&&c!==void 0&&c,logger:p}),this.statManager=new x6({cacheContext:this.cacheContext,requestQueue:this.requestQueue,dispatcher:this.dispatcher,logger:p}),this.appStateToggleEnabled=(d=t.appStateToggleEnabled)===null||d===void 0||d}return Ho[n]}return e.of=function(n){if(Ho[n])return Ho[n];throw L.lostInstance},e.clear=function(n){Ho[n]&&delete Ho[n]},e.prototype.hasExtension=function(n){return this.sdkState.extensions&&this.sdkState.extensions[n]},e}(),Zg=function(){function e(){}return e.prototype.init=function(n,t){var r=t.sdkState,i=t.dispatcher,s=t.sessionManager,o=t.requestQueue,a=t.logger;t.onlineDetector;var l=t.cacheContext;this._iid=n,this._cacheContext=l,this._sdkState=r,this._dispatcher=i,this._sessionManager=s,this._requestQueue=o,this._logger=a},e}();(function(e){e.UNKNOWN="UNKNOWN",e.EVENT_CHANNEL_CREATED="EVENT_CHANNEL_CREATED",e.EVENT_CHANNEL_UPDATED="EVENT_CHANNEL_UPDATED",e.EVENT_CHANNEL_DELETED="EVENT_CHANNEL_DELETED",e.EVENT_CHANNEL_READ="EVENT_CHANNEL_READ",e.EVENT_CHANNEL_DELIVERED="EVENT_CHANNEL_DELIVERED",e.EVENT_CHANNEL_INVITED="EVENT_CHANNEL_INVITED",e.EVENT_CHANNEL_JOINED="EVENT_CHANNEL_JOINED",e.EVENT_CHANNEL_LEFT="EVENT_CHANNEL_LEFT",e.EVENT_CHANNEL_ACCEPTED_INVITE="EVENT_CHANNEL_ACCEPTED_INVITE",e.EVENT_CHANNEL_DECLINED_INVITE="EVENT_CHANNEL_DECLINED_INVITE",e.EVENT_CHANNEL_OPERATOR_UPDATED="EVENT_CHANNEL_OPERATOR_UPDATED",e.EVENT_CHANNEL_BANNED="EVENT_CHANNEL_BANNED",e.EVENT_CHANNEL_UNBANNED="EVENT_CHANNEL_UNBANNED",e.EVENT_CHANNEL_MUTED="EVENT_CHANNEL_MUTED",e.EVENT_CHANNEL_UNMUTED="EVENT_CHANNEL_UNMUTED",e.EVENT_CHANNEL_FROZEN="EVENT_CHANNEL_FROZEN",e.EVENT_CHANNEL_UNFROZEN="EVENT_CHANNEL_UNFROZEN",e.EVENT_CHANNEL_HIDDEN="EVENT_CHANNEL_HIDDEN",e.EVENT_CHANNEL_UNHIDDEN="EVENT_CHANNEL_UNHIDDEN",e.EVENT_CHANNEL_RESET_HISTORY="EVENT_CHANNEL_RESET_HISTORY",e.EVENT_CHANNEL_TYPING_STATUS_UPDATE="EVENT_CHANNEL_TYPING_STATUS_UPDATE",e.EVENT_CHANNEL_MEMBER_COUNT_UPDATED="EVENT_CHANNEL_MEMBER_COUNT_UPDATED",e.EVENT_CHANNEL_METADATA_CREATED="EVENT_CHANNEL_METADATA_CREATED",e.EVENT_CHANNEL_METADATA_UPDATED="EVENT_CHANNEL_METADATA_UPDATED",e.EVENT_CHANNEL_METADATA_DELETED="EVENT_CHANNEL_METADATA_DELETED",e.EVENT_CHANNEL_METACOUNTER_CREATED="EVENT_CHANNEL_METACOUNTER_CREATED",e.EVENT_CHANNEL_METACOUNTER_UPDATED="EVENT_CHANNEL_METACOUNTER_UPDATED",e.EVENT_CHANNEL_METACOUNTER_DELETED="EVENT_CHANNEL_METACOUNTER_DELETED",e.EVENT_MESSAGE_SENT="EVENT_MESSAGE_SENT",e.EVENT_MESSAGE_RECEIVED="EVENT_MESSAGE_RECEIVED",e.EVENT_MESSAGE_UPDATED="EVENT_MESSAGE_UPDATED",e.EVENT_PINNED_MESSAGE_UPDATED="EVENT_PINNED_MESSAGE_UPDATED",e.REQUEST_CHANNEL="REQUEST_CHANNEL",e.REQUEST_CHANNEL_CHANGELOGS="REQUEST_CHANNEL_CHANGELOGS",e.REFRESH_CHANNEL="REFRESH_CHANNEL",e.CHANNEL_LASTACCESSEDAT_UPDATED="CHANNEL_LASTACCESSEDAT_UPDATED",e.SYNC_CHANNEL_BACKGROUND="SYNC_CHANNEL_BACKGROUND",e.SYNC_CHANNEL_CHANGELOGS="SYNC_CHANNEL_CHANGELOGS",e.EVENT_MESSAGE_SENT_SUCCESS="EVENT_MESSAGE_SENT_SUCCESS",e.EVENT_MESSAGE_SENT_FAILED="EVENT_MESSAGE_SENT_FAILED",e.EVENT_MESSAGE_SENT_PENDING="EVENT_MESSAGE_SENT_PENDING",e.EVENT_MESSAGE_DELETED="EVENT_MESSAGE_DELETED",e.EVENT_MESSAGE_FEEDBACK_ADDED="EVENT_MESSAGE_FEEDBACK_ADDED",e.EVENT_MESSAGE_FEEDBACK_UPDATED="EVENT_MESSAGE_FEEDBACK_UPDATED",e.EVENT_MESSAGE_FEEDBACK_DELETED="EVENT_MESSAGE_FEEDBACK_DELETED",e.EVENT_MESSAGE_READ="EVENT_MESSAGE_READ",e.EVENT_MESSAGE_DELIVERED="EVENT_MESSAGE_DELIVERED",e.EVENT_MESSAGE_REACTION_UPDATED="EVENT_MESSAGE_REACTION_UPDATED",e.EVENT_MESSAGE_THREADINFO_UPDATED="EVENT_MESSAGE_THREADINFO_UPDATED",e.EVENT_MESSAGE_OFFSET_UPDATED="EVENT_MESSAGE_OFFSET_UPDATED",e.REQUEST_MESSAGE="REQUEST_MESSAGE",e.EVENT_THREAD_INFO_UPDATED="EVENT_THREADINFO_UPDATED",e.EVENT_POLL_UPDATED="EVENT_POLL_UPDATED",e.EVENT_POLL_VOTED="EVENT_POLL_VOTED",e.SYNC_POLL_CHANGELOGS="SYNC_POLL_CHANGELOGS",e.REQUEST_RESEND_MESSAGE="REQUEST_RESEND_MESSAGE",e.REQUEST_THREADED_MESSAGE="REQUEST_THREADED_MESSAGE",e.REQUEST_MESSAGE_CHANGELOGS="REQUEST_MESSAGE_CHANGELOGS",e.SYNC_MESSAGE_FILL="SYNC_MESSAGE_FILL",e.SYNC_MESSAGE_BACKGROUND="SYNC_MESSAGE_BACKGROUND",e.SYNC_MESSAGE_CHANGELOGS="SYNC_MESSAGE_CHANGELOGS",e.LOCAL_MESSAGE_PENDING_CREATED="LOCAL_MESSAGE_PENDING_CREATED",e.LOCAL_MESSAGE_FAILED="LOCAL_MESSAGE_FAILED",e.LOCAL_MESSAGE_CANCELED="LOCAL_MESSAGE_CANCELED",e.LOCAL_MESSAGE_RESEND_STARTED="LOCAL_MESSAGE_RESEND_STARTED"})(G||(G={}));var Hl;x({},G);var Ts=function(e){return e.startsWith("EVENT_")||e.startsWith("LOCAL_MESSAGE_")||e===G.SYNC_MESSAGE_FILL||e===G.SYNC_MESSAGE_CHANGELOGS||e===G.SYNC_POLL_CHANGELOGS},bt=function(e){function n(t){var r=t.messages,i=t.source,s=t.isWebSocketEventComing,o=s!==void 0&&s,a=e.call(this)||this;return a.messages=r,a.source=i,a.isWebSocketEventComing=o,a}return T(n,e),n}(Tt),Xg=function(e){function n(t){var r=t.messageIds,i=t.source,s=t.isWebSocketEventComing,o=s!==void 0&&s,a=e.call(this)||this;return a.messageIds=r,a.source=i,a.isWebSocketEventComing=o,a}return T(n,e),n}(Tt),zC=function(e){function n(t){var r=t.event,i=t.source,s=t.isWebSocketEventComing,o=s!==void 0&&s,a=e.call(this)||this;return a.event=r,a.source=i,a.isWebSocketEventComing=o,a}return T(n,e),n}(Tt),VC=function(e){function n(t){var r=t.event,i=t.source,s=t.isWebSocketEventComing,o=s!==void 0&&s,a=e.call(this)||this;return a.event=r,a.source=i,a.isWebSocketEventComing=o,a}return T(n,e),n}(Tt),qC=function(e){function n(t){var r=t.reqId,i=t.source,s=e.call(this)||this;return s.reqId=r,s.source=i,s}return T(n,e),n}(Tt),WC=function(e){function n(t){var r=t.polls,i=t.source,s=e.call(this)||this;return s.polls=r,s.source=i,s}return T(n,e),n}(Tt),KC=function(e){function n(t){var r=t.event,i=t.source,s=e.call(this)||this;return s.event=r,s.source=i,s}return T(n,e),n}(Tt),Jg=function(e){function n(t){var r=t.event,i=t.source,s=e.call(this)||this;return s.event=r,s.source=i,s}return T(n,e),n}(Tt);(function(e){e.OPEN="open",e.CLOSED="closed"})(Hl||(Hl={}));var k6="removed",sm=function(e){switch(e){case"open":return Hl.OPEN;case"closed":return Hl.CLOSED;default:return null}},QC=function(e){return!e||!!e.text&&R("string",e.text)},hh=function(e){function n(t,r){var i,s,o,a,l,u,c,d=this;return(d=e.call(this,t)||this).pollId=0,d.id=0,d.text=null,d.voteCount=0,d.createdBy=null,d.createdAt=0,d.updatedAt=0,d._lastVotedAt=0,d.pollId=(i=r.poll_id)!==null&&i!==void 0?i:0,d.id=(s=r.id)!==null&&s!==void 0?s:0,d.text=(o=r.text)!==null&&o!==void 0?o:null,d.voteCount=(a=r.vote_count)!==null&&a!==void 0?a:0,d.createdBy=(l=r.created_by)!==null&&l!==void 0?l:null,d.createdAt=(u=r.created_at)!==null&&u!==void 0?u:0,d.updatedAt=(c=r.updated_at)!==null&&c!==void 0?c:0,d}return T(n,e),n.payloadify=function(t){return ye(Ie(x(x({},e.payloadify.call(this,t)),{vote_count:t.voteCount,poll_id:t.pollId,text:t.text,created_at:t.createdAt,id:t.id,created_by:t.createdBy,updated_at:t.updatedAt})))},n}(Kn),xi=function(e){function n(t,r){var i,s,o,a,l,u,c,d,h,f,p,g,b,m=this;return(m=e.call(this,t)||this).id=0,m.title=null,m.createdAt=0,m.updatedAt=0,m.closeAt=-1,m.status=Hl.CLOSED,m.messageId=0,m.data=null,m.voterCount=-1,m.options=[],m.createdBy=null,m.allowUserSuggestion=!1,m.allowMultipleVotes=!1,m.votedPollOptionIds=[],m.id=(i=r.id)!==null&&i!==void 0?i:0,m.title=(s=r.title)!==null&&s!==void 0?s:null,m.createdAt=(o=r.created_at)!==null&&o!==void 0?o:0,m.updatedAt=(a=r.updated_at)!==null&&a!==void 0?a:0,m.closeAt=(l=r.close_at)!==null&&l!==void 0?l:-1,m.status=(u=sm(r.status))!==null&&u!==void 0?u:Hl.CLOSED,m.messageId=(c=r.message_id)!==null&&c!==void 0?c:0,m.data=(d=r.data)!==null&&d!==void 0?d:null,m.voterCount=(h=r.voter_count)!==null&&h!==void 0?h:-1,m.options=r.options?r.options.map(function(_){return new hh(m._iid,_)}):[],m.createdBy=(f=r.created_by)!==null&&f!==void 0?f:null,m.allowUserSuggestion=(p=r.allow_user_suggestion)!==null&&p!==void 0&&p,m.allowMultipleVotes=(g=r.allow_multiple_votes)!==null&&g!==void 0&&g,m.votedPollOptionIds=(b=r.voted_option_ids)!==null&&b!==void 0?b:[],m}return T(n,e),n.prototype._applyPollUpdatePayload=function(t){var r,i,s,o,a,l,u,c,d=this;this.title=(r=t.title)!==null&&r!==void 0?r:this.title,this.updatedAt=(i=t.updated_at)!==null&&i!==void 0?i:this.updatedAt,this.closeAt=(s=t.close_at)!==null&&s!==void 0?s:this.closeAt,this.status=(o=sm(t.status))!==null&&o!==void 0?o:this.status,this.data=(a=t.data)!==null&&a!==void 0?a:this.data,this.voterCount=(l=t.voter_count)!==null&&l!==void 0?l:this.voterCount,t.options&&(this.options=t.options.map(function(h){return new hh(d._iid,h)}),this.votedPollOptionIds=t.options.filter(function(h){return h.vote_count>0}).map(function(h){return h.id})),this.allowUserSuggestion=(u=t.allow_user_suggestion)!==null&&u!==void 0?u:this.allowUserSuggestion,this.allowMultipleVotes=(c=t.allow_multiple_votes)!==null&&c!==void 0?c:this.allowMultipleVotes},n.payloadify=function(t){return ye(Ie(x(x({},e.payloadify.call(this,t)),{id:t.id,title:t.title,created_at:t.createdAt,updated_at:t.updatedAt,close_at:t.closeAt,status:t.status,message_id:t.messageId,data:t.data,voter_count:t.voterCount,options:t.options.map(function(r){return hh.payloadify(r)}),created_by:t.createdBy,allow_user_suggestion:t.allowUserSuggestion,allow_multiple_votes:t.allowMultipleVotes,voted_option_ids:t.votedPollOptionIds})))},n.prototype.applyPollUpdateEvent=function(t){var r=t._payload.poll;return!(!r||this.id!==r.id||r.updated_at-1){var u=r[l];o>=u._lastVotedAt&&(u.voteCount=a.vote_count,u._lastVotedAt=o)}}),s.req_id&&s.voted_option_ids&&(this.votedPollOptionIds=s.voted_option_ids),typeof s.voter_count=="number"&&(this.voterCount=s.voter_count),!0},n.prototype.serialize=function(){return Qc(this)},n}(Kn),Uo=function(){function e(n,t){var r;this.limit=20,this._isLoading=!1,this._hasNext=!0,this._token="",this._iid=n,this.limit=(r=t.limit)!==null&&r!==void 0?r:20}return Object.defineProperty(e.prototype,"hasNext",{get:function(){return this._hasNext},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),e.prototype._validate=function(){return R("number",this.limit)&&this.limit>0},e}(),Gs=function(e){function n(t,r,i,s){var o=e.call(this,t,s)||this;return o.channelUrl=r,o.channelType=i,o}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)&&R("string",this.channelUrl)&&$e(Ze,this.channelType)},n}(Uo),R6=function(e){this.pollId=0,this.messageId=0,this.pollId=e.poll_id,this.messageId=e.message_id,this._payload=e},L6=function(e){function n(t){var r=t.title,i=t.optionTexts,s=t.data,o=t.allowUserSuggestion,a=t.allowMultipleVotes,l=t.closeAt,u=e.call(this)||this;return u.method=Z.POST,u.path=Ki,u.params={title:r,options:i,data:s,allow_user_suggestion:o,allow_multiple_votes:a,close_at:l},u}return T(n,e),n}(J),D6=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.poll=new xi(t,r),i}return T(n,e),n}(se),U6=function(e){function n(t){var r=t.channelUrl,i=t.channelType,s=t.pollId,o=e.call(this)||this;return o.method=Z.GET,o.path="".concat(Ki,"/").concat(encodeURIComponent(s)),o.params={channel_url:r,channel_type:i},o}return T(n,e),n}(J),P6=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.poll=new xi(t,r),i}return T(n,e),n}(se),F6=function(e){function n(t){var r=t.channelUrl,i=t.channelType,s=t.pollId,o=t.pollOptionId,a=e.call(this)||this;return a.method=Z.GET,a.path="".concat(Ki,"/").concat(encodeURIComponent(s),"/options/").concat(encodeURIComponent(o)),a.params={channel_url:r,channel_type:i},a}return T(n,e),n}(J),H6=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.pollOption=new hh(t,r),i}return T(n,e),n}(se),j6=function(e){function n(t){var r=t.channelType,i=t.channelUrl,s=t.timestamp,o=t.token,a=e.call(this)||this;return a.method=Z.GET,a.path="".concat(Je(r),"/").concat(encodeURIComponent(i),"/polls/changelogs"),a.params=ye({change_ts:s,token:o}),a}return T(n,e),n}(J),B6=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.updatedPolls=r.updated.map(function(s){return function(o,a){return new xi(o,a)}(t,s)}),i.deletedPollIds=r.deleted.map(function(s){return s}),i.hasMore=r.has_more,i.nextToken=r.next,i}return T(n,e),n}(se),$6={title:"",optionTexts:[],data:void 0,allowUserSuggestion:void 0,allowMultipleVotes:void 0,closeAt:-1},YC=function(e){return R("string",e.title)&&(n=e.optionTexts,We("string",n)&&n.every(function(t){return t.trim()!==""}))&&QC(e.data)&&R("boolean",e.allowUserSuggestion,!0)&&R("boolean",e.allowMultipleVotes,!0)&&R("number",e.closeAt,!0);var n},G6={channelUrl:"",channelType:Ze.BASE,pollId:0,pollOptionId:0},ZC=function(e){return R("string",e.channelUrl)&&e.channelUrl!==""&&$e(Ze,e.channelType)&&R("number",e.pollId)&&e.pollId>0&&R("number",e.pollOptionId)&&e.pollOptionId>0},z6={channelUrl:"",channelType:Ze.BASE,pollId:0},XC=function(e){return R("string",e.channelUrl)&&e.channelUrl!==""&&$e(Ze,e.channelType)&&R("number",e.pollId)},D1={},of=function(){function e(n,t){var r=t.sdkState,i=t.dispatcher,s=t.sessionManager,o=t.requestQueue,a=t.logger;this._iid=n,this._sdkState=r,this._sessionManager=s,this._requestQueue=o,this._dispatcher=i,this._logger=a,D1[n]=this}return e.of=function(n){return D1[n]},e.prototype.buildPollFromSerializedData=function(n){var t=pa(n);return new xi(this._iid,xi.payloadify(t))},e.prototype.get=function(n){return y(this,void 0,void 0,function(){var t,r;return v(this,function(i){switch(i.label){case 0:return Y(XC(n)).throw(L.invalidParameters),t=new U6(x({},n)),[4,this._requestQueue.send(t)];case 1:return r=i.sent(),[2,r.as(P6).poll]}})})},e.prototype.create=function(n){return y(this,void 0,void 0,function(){var t,r;return v(this,function(i){switch(i.label){case 0:return Y(YC(n)).throw(L.invalidParameters),t=new L6(x({},n)),[4,this._requestQueue.send(t)];case 1:return r=i.sent(),[2,r.as(D6).poll]}})})},e.prototype.getOption=function(n){return y(this,void 0,void 0,function(){var t,r;return v(this,function(i){switch(i.label){case 0:return Y(ZC(n)).throw(L.invalidParameters),t=new F6(x({},n)),[4,this._requestQueue.send(t)];case 1:return r=i.sent(),[2,r.as(H6).pollOption]}})})},e.prototype.getPollChangeLogs=function(n,t,r,i){return i===void 0&&(i=G.SYNC_POLL_CHANGELOGS),y(this,void 0,void 0,function(){var s,o,a,l,u,c,d;return v(this,function(h){switch(h.label){case 0:return s=new j6(Ie({channelType:t,channelUrl:n,timestamp:typeof r=="number"?r:null,token:typeof r=="string"?r:null})),[4,this._requestQueue.send(s)];case 1:return o=h.sent(),a=o.as(B6),l=a.updatedPolls,u=a.deletedPollIds,c=a.hasMore,d=a.nextToken,l.length>0&&this._dispatcher.dispatch(new WC({polls:l,source:i})),[2,{updatedPolls:l,deletedPollIds:u,hasMore:c,token:d}]}})})},e}(),V6=function(e){function n(t){var r=t.channelUrl,i=t.channelType,s=t.token,o=t.limit,a=e.call(this)||this;return a.method=Z.GET,a.path=Ki,a.params={channel_url:r,channel_type:i,token:s,limit:o},a}return T(n,e),n}(J),q6=function(e){function n(t,r){var i,s=this;return(s=e.call(this,t,r)||this).polls=((i=r.polls)!==null&&i!==void 0?i:[]).map(function(o){return new xi(t,o)}),s.token=r.next,s}return T(n,e),n}(se),JC=function(e){function n(t,r){return e.call(this,t,r.channelUrl,r.channelType,r)||this}return T(n,e),n.prototype.next=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,t=O.of(this._iid).requestQueue,r=new V6(x(x({},this),{token:this._token})),[4,t.send(r)]):[3,2]:[3,5];case 1:return i=l.sent(),s=i.as(q6),o=s.polls,a=s.token,this._token=a,this._hasNext=!!a,this._isLoading=!1,[2,o];case 2:return[2,[]];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Gs),W6=function(e){function n(t){var r=t.channelUrl,i=t.channelType,s=t.pollId,o=t.pollOptionId,a=t.token,l=t.limit,u=e.call(this)||this;return u.method=Z.GET,u.path="".concat(Ki,"/").concat(encodeURIComponent(s),"/options/").concat(encodeURIComponent(o),"/voters"),u.params={channel_url:r,channel_type:i,token:a,limit:l},u}return T(n,e),n}(J),K6=function(e){function n(t,r){var i,s=this;return(s=e.call(this,t,r)||this).voters=((i=r.voters)!==null&&i!==void 0?i:[]).map(function(o){return new Ke(t,o)}),s.token=r.next,s}return T(n,e),n}(se),eS=function(e){function n(t,r){var i=e.call(this,t,r.channelUrl,r.channelType,r)||this;return i.pollId=r.pollId,i.pollOptionId=r.pollOptionId,i}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)&&R("number",this.pollId)&&R("number",this.pollOptionId)},n.prototype.next=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,t=O.of(this._iid).requestQueue,r=new W6(x(x({},this),{pollId:this.pollId,pollOptionId:this.pollOptionId,token:this._token})),[4,t.send(r)]):[3,2]:[3,5];case 1:return i=l.sent(),s=i.as(K6),o=s.voters,a=s.token,this._token=a,this._hasNext=!!a,this._isLoading=!1,[2,o];case 2:return[2,[]];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Gs),Dc,zs=function(){function e(n,t,r){var i,s;this.width=0,this.height=0,this.realWidth=0,this.realHeight=0,this._requireAuth=!1,this._iid=n,this.plainUrl=t.url,this.width=t.width,this.height=t.height,this.realWidth=(i=t.real_width)!==null&&i!==void 0?i:t.width,this.realHeight=(s=t.real_height)!==null&&s!==void 0?s:t.height,this._requireAuth=r}return e.payloadify=function(n){return ye(Ie(n instanceof e?{url:n.plainUrl,width:n.width,height:n.height,real_width:n.realWidth,real_height:n.realHeight}:{url:"",width:n.maxWidth,height:n.maxHeight,real_width:0,real_height:0}))},Object.defineProperty(e.prototype,"url",{get:function(){var n=O.of(this._iid).sessionManager;return this._requireAuth&&n.ekey?"".concat(this.plainUrl,"?auth=").concat(n.ekey):this.plainUrl},enumerable:!1,configurable:!0}),e}(),af=function(e){function n(t){var r=e.call(this)||this;if(r.method=Z.POST,r.path="".concat(K4),r.params=ye({file:t.file,channel_url:t.channelUrl}),t.thumbnailSizes)for(var i=0;i0:void 0,u.lastRepliedAt=(a=r.last_replied_at)!==null&&a!==void 0?a:0,u.updatedAt=(l=r.updated_at)!==null&&l!==void 0?l:0,u}return T(n,e),n.payloadify=function(t){return ye(Ie(x(x({},e.payloadify.call(this,t)),{reply_count:t.replyCount,unread_message_count:t.unreadReplyCount,member_count:t.memberCount,most_replies:Array.isArray(t.mostRepliedUsers)?t.mostRepliedUsers.map(function(r){return Ke.payloadify(r)}):[],push_enabled:typeof t.isPushNotificationEnabled=="boolean"?t.isPushNotificationEnabled?1:0:void 0,last_replied_at:t.lastRepliedAt,updated_at:t.updatedAt})))},Object.defineProperty(n.prototype,"_isUpdateRequired",{get:function(){return this.unreadReplyCount===void 0||this.isPushNotificationEnabled===void 0},enumerable:!1,configurable:!0}),n.prototype._updateFrom=function(t){var r,i;this.unreadReplyCount=(r=t.unreadReplyCount)!==null&&r!==void 0?r:this.unreadReplyCount,this.isPushNotificationEnabled=(i=t.isPushNotificationEnabled)!==null&&i!==void 0?i:this.isPushNotificationEnabled},n}(Kn);(function(e){e.ADD="add",e.DELETE="delete"})(Dc||(Dc={}));var to,ev=function(e){this.messageId=0,this.operation=null,this.updatedAt=0;var n=R("string",e.msg_id)?parseInt(e.msg_id):e.msg_id,t=e.user_id,r=e.operation?e.operation.toLowerCase():null,i=e.reaction,s=e.updated_at;n&&R("string",t)&&R("string",r)&&$e(Dc,r)&&R("string",i)&&i&&R("number",s)&&(this.messageId=n,this.userId=t,this.key=i,this.operation=r,this.updatedAt=s)},kd=function(){function e(n){var t,r,i,s=n.key,o=(i=De([],Ae(n.user_ids),!1))!==null&&i!==void 0?i:[],a=n.updated_at;R("string",s)&&s&&We("string",o)&&o.length>0&&R("number",a)&&(this.key=s,this.userIds=o,this.updatedAt=a);var l={};try{for(var u=pe(this.userIds),c=u.next();!c.done;c=u.next())l[c.value]=this.updatedAt}catch(d){t={error:d}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}this._version=l}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.userIds.length===0},enumerable:!1,configurable:!0}),e.payloadify=function(n){return ye(Ie({key:n.key,user_ids:n.userIds,updated_at:n.updatedAt}))},e.prototype.applyEvent=function(n){if(n.key===this.key&&this.updatedAt<=n.updatedAt){if(!this._version[n.userId]||this._version[n.userId]<=n.updatedAt){var t=this.userIds.indexOf(n.userId);switch(n.operation){case Dc.ADD:t<0&&this.userIds.push(n.userId);break;case Dc.DELETE:t>=0&&this.userIds.splice(t,1)}this._version[n.userId]=n.updatedAt}this.updatedAt=Math.max(this.updatedAt,n.updatedAt)}},e}(),U1=function(){function e(n){this.secureUrl=null,this.type=null,this.width=0,this.height=0,this.alt=null,this.url=n.url,n.secure_url&&(this.secureUrl=n.secure_url),n.type&&(this.type=n.type),n.width&&(this.width=n.width),n.height&&(this.height=n.height),n.alt&&(this.alt=n.alt)}return e.payloadify=function(n){var t,r;return ye(Ie({url:n.url,secure_url:n.secureUrl,type:n.type,width:(t=n.width)!==null&&t!==void 0?t:0,height:(r=n.height)!==null&&r!==void 0?r:0,alt:n.alt}))},e}(),P1=function(){function e(n){this.title=null,this.url=null,this.description=null,this.defaultImage=null,n["og:title"]&&(this.title=n["og:title"]),n["og:url"]&&(this.url=n["og:url"]),n["og:description"]&&(this.description=n["og:description"]),n["og:image"]&&(this.defaultImage=new U1(n["og:image"]))}return e.payloadify=function(n){return ye(Ie({"og:title":n.title,"og:url":n.url,"og:description":n.description,"og:image":n.defaultImage?U1.payloadify(n.defaultImage):null}))},e}(),Oi=function(){function e(n){var t,r;this.volume=0,this.name=(t=n.name)!==null&&t!==void 0?t:"default",this.volume=(r=n.volume)!==null&&r!==void 0?r:1}return e.prototype.serialize=function(){return{name:this.name,volume:this.volume}},e.payloadify=function(n){return ye(Ie({name:n.name,volume:n.volume}))},e}();(function(e){e.GOOD="good",e.BAD="bad"})(to||(to={}));var F1,Ms=function(){function e(n){this.id=n.id,this.rating=n.rating,this.comment=n.comment}return e._getStatus=function(n){return n?"id"in n?"SUBMITTED":"NO_FEEDBACK":"NOT_APPLICABLE"},e._isSubmitted=function(n){return e._getStatus(n)==="SUBMITTED"},e._getPayloadByStatus=function(n){return n==="NO_FEEDBACK"?{}:null},e.payloadify=function(n){return ye(Ie({id:n.id,rating:n.rating,comment:n.comment}))},e}(),jl=function(e){function n(t,r){var i,s=this;return(s=e.call(this,t,r)||this).isBlockedByMe=!1,s.role=$e(Ni,r.role)?r.role:Ni.NONE,s.isBlockedByMe=(i=r.is_blocked_by_me)!==null&&i!==void 0&&i,s}return T(n,e),n.payloadify=function(t){return ye(Ie(x(x({},e.payloadify.call(this,t)),{role:t.role,is_blocked_by_me:t.isBlockedByMe})))},n}(Ke),_r=function(){function e(n){this.key=n.key,this.value=We("string",n.value)?De([],Ae(n.value),!1):[]}return e.payloadify=function(n){var t;return ye(Ie({key:n.key,value:(t=n.value)!==null&&t!==void 0?t:[]}))},e}(),tS=function(e){switch(e){case Ct.BASE:return"";case Ct.USER:return"MESG";case Ct.FILE:return"FILE";case Ct.ADMIN:return"ADMM"}},nS=function(e){function n(t,r){var i,s,o,a,l,u,c,d,h,f,p=this;(p=e.call(this,t)||this).channelType=Ze.BASE,p.messageType=Ct.BASE,p.mentionType=null,p.mentionedUsers=null,p.mentionedUserIds=null,p.metaArrays=[],p.extendedMessage={},p.createdAt=0,p.updatedAt=0,p.channelUrl=r.channel_url,p.channelType=$e(Ze,r.channel_type)?r.channel_type:Ze.GROUP,r.channel&&(r.channel.channel_url&&(p.channelUrl=r.channel.channel_url),r.channel.channel_type&&(p.channelType=r.channel.channel_type)),p.data=(i=r.data)!==null&&i!==void 0?i:"",p.customType=(s=r.custom_type)!==null&&s!==void 0?s:"",p.mentionType=$e(rr,r.mention_type)?r.mention_type:null,p.mentionedUsers=r.mentioned_users?r.mentioned_users.map(function(E){return new Ke(p._iid,E)}):null,p.mentionedUserIds=(o=r.mentioned_user_ids)!==null&&o!==void 0?o:null,p.mentionedUsers&&!p.mentionedUserIds&&(p.mentionedUserIds=p.mentionedUsers.map(function(E){return E.userId})),p.mentionedMessageTemplate=(a=r.mentioned_message_template)!==null&&a!==void 0?a:"";var g=(l=r.metaarray)!==null&&l!==void 0?l:{},b=(u=r.metaarray_key_order)!==null&&u!==void 0?u:Object.keys(g).sort(function(E,S){return E.localeCompare(S)});p.metaArrays=[];for(var m=0;m0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSubmittable",{get:function(){return this.fields.every(function(n){return n.isSubmittable})},enumerable:!1,configurable:!0}),e.prototype.getFieldAnswer=function(n){var t;return(t=this.answers)===null||t===void 0?void 0:t[n]},e.payloadify=function(n){var t;return ye(Ie({key:(t=n.formKey)!==null&&t!==void 0?t:n.key,fields:n.fields.map(function(r){return rS.payloadify(r)})}))},e.isFormPayload=function(n){var t;return!!(!((t=n==null?void 0:n.forms)===null||t===void 0)&&t[0])},e}(),rS=function(){function e(n){this.key=n.key,this.inputType=n.input_type,this.title=n.title,this.required=n.required,this.regex=n.regex,this.placeholder=n.placeholder,this.fieldKey=n.key}return e.prototype.isValid=function(n){if(!this.regex)return!0;try{return new RegExp(this.regex).test(n)}catch{return!0}},Object.defineProperty(e.prototype,"isSubmittable",{get:function(){return!(this.temporaryAnswer!=null&&!this.isValid(this.temporaryAnswer)||this.required&&this.temporaryAnswer==null)},enumerable:!1,configurable:!0}),e.payloadify=function(n){var t;return ye(Ie({key:(t=n.fieldKey)!==null&&t!==void 0?t:n.key,input_type:n.inputType,title:n.title,required:n.required,regex:n.regex,placeholder:n.placeholder}))},e}(),iS=function(e){function n(t,r){var i,s,o=this;return(o=e.call(this,t)||this).channelUrl=(i=r.channel_url)!==null&&i!==void 0?i:"",o.channelType=(s=r.channel_type)!==null&&s!==void 0?s:Ze.GROUP,o.reader=new Ke(o._iid,r.user),o.readAt=r.ts,o}return T(n,e),n}(Kn),Q6=function(e){function n(t){var r=t.channelUrl;return e.call(this,{code:"READ",ackRequired:!0,payload:{channel_url:r}})||this}return T(n,e),n}(wr);(function(e){function n(t){var r=e.call(this)||this,i=t.channelUrl,s=t.channelType,o=t.userId,a=t.notificationIds;return r.method=Z.PUT,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/messages/mark_as_read"),r.params=ye(Ie({user_id:o,message_ids:a})),r}return T(n,e),n})(J);var sS=function(e){function n(t,r,i){var s=e.call(this,t,"READ",i)||this;return s.readStatus=new iS(t,i),s}return T(n,e),n}(gt);(function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.readAt=r.ts,i.unreadMessageCount=r.unread_message_count,i}return T(n,e),n})(se);var Y6=function(e){function n(t){var r=t.channelUrl,i=t.messageId;return e.call(this,{code:"READ",ackRequired:!0,payload:{channel_url:r,parent_message_id:i}})||this}return T(n,e),n}(wr),Z6=function(e){function n(t){var r=t.channelType,i=t.channelUrl,s=t.messageId,o=t.pushEnabled,a=e.call(this)||this;return a.method=Z.PUT,a.path="".concat(Je(r),"/").concat(encodeURIComponent(i),"/messages/").concat(s,"/thread_push"),a.params={push_enabled:o},a}return T(n,e),n}(J);(function(e){function n(t,r){return e.call(this,t,r)||this}T(n,e)})(se);var H1=function(e){function n(t){var r=e.call(this)||this;return r.method=Z.POST,r.path="".concat(sr,"/").concat(encodeURIComponent(t.channelUrl),"/messages/").concat(t.messageId,"/submit_forms"),r.params=ye({forms:t.forms}),r}return T(n,e),n}(J),X6=function(e){function n(t){var r=t.channelType,i=t.channelUrl,s=t.messageId,o=t.rating,a=t.comment,l=e.call(this)||this;return l.method=Z.POST,l.path="".concat(Je(r),"/").concat(encodeURIComponent(i),"/messages/").concat(s,"/feedbacks"),l.params={rating:o,comment:a},l}return T(n,e),n}(J),J6=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.feedback=new Ms(r),i}return T(n,e),n}(se),eM=function(e){function n(t){var r=t.channelType,i=t.channelUrl,s=t.messageId,o=t.feedbackId,a=t.rating,l=t.comment,u=e.call(this)||this;return u.method=Z.PUT,u.path="".concat(Je(r),"/").concat(encodeURIComponent(i),"/messages/").concat(s,"/feedbacks/").concat(o),u.params={rating:a,comment:l},u}return T(n,e),n}(J),tM=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.feedback=new Ms(r),i}return T(n,e),n}(se),nM=function(e){function n(t){var r=t.channelType,i=t.channelUrl,s=t.messageId,o=t.feedbackId,a=e.call(this)||this;return a.method=Z.DELETE,a.path="".concat(Je(r),"/").concat(encodeURIComponent(i),"/messages/").concat(s,"/feedbacks/").concat(o),a}return T(n,e),n}(J);(function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.feedback=new Ms(r),i}T(n,e)})(se);var uo,ii,om=function(e){function n(t,r){var i,s,o,a,l,u=this;return(u=e.call(this,t)||this).plainUrl="",u.fileName=null,u.mimeType=null,u.fileSize=0,u.thumbnails=[],u._requireAuth=!1,u.plainUrl=(i=r.url)!==null&&i!==void 0?i:"",u.fileName=(s=r.file_name)!==null&&s!==void 0?s:null,u.mimeType=(o=r.file_type)!==null&&o!==void 0?o:null,u.fileSize=(a=r.file_size)!==null&&a!==void 0?a:0,u._requireAuth=(l=r.require_auth)!==null&&l!==void 0&&l,u.thumbnails=r.thumbnails?r.thumbnails.map(function(c){var d;return new zs(u._iid,typeof c=="string"?{url:c,width:0,height:0}:x(x({},c),{url:((d=c.url)!==null&&d!==void 0?d:"").split("auth=")[0]}),u._requireAuth)}):[],u}return T(n,e),n.payloadify=function(t){var r;return ye(Ie({url:t.plainUrl,file_name:t.fileName,file_type:t.mimeType,file_size:t.fileSize,thumbnails:(r=t.thumbnails)===null||r===void 0?void 0:r.map(function(i){var s;return{url:((s=i.plainUrl)!==null&&s!==void 0?s:"").split("auth=")[0],width:i.width,height:i.height,real_width:i.realWidth,real_height:i.realHeight}}),require_auth:t._requireAuth}))},Object.defineProperty(n.prototype,"url",{get:function(){var t=O.of(this._iid).sessionManager;return this._requireAuth&&t.ekey?"".concat(this.plainUrl,"?auth=").concat(t.ekey):this.plainUrl},enumerable:!1,configurable:!0}),n}(Kn),oS=function(e){var n=e.channelUrl,t=e.channelType,r=e.parentMessage;this.channelUrl=n,this.channelType=t,this.parentMessage=r};(function(e){e.PENDING="pending",e.SENT="sent",e.FAILED="failed",e.CANCELED="canceled"})(uo||(uo={})),function(e){e.PENDING="pending",e.IN_QUEUE="in_queue",e.SENT="sent",e.FAILED="failed",e.CANCELED="canceled",e.REMOVED="removed"}(ii||(ii={}));var aa,hr=function(e){function n(t,r){var i,s,o,a,l,u,c,d,h=this;return(h=e.call(this,t,r)||this).parentMessage=null,h.silent=!1,h.isOperatorMessage=!1,h.threadInfo=null,h.reactions=[],h.appleCriticalAlertOptions=null,h.scheduledInfo=null,h.suggestedReplies=null,h.myFeedback=null,h.myFeedbackStatus="NOT_APPLICABLE",h.forms=null,h._isContinuousMessages=!1,h._scheduledStatus=null,h.messageId=(s=(i=r.msg_id)!==null&&i!==void 0?i:r.message_id)!==null&&s!==void 0?s:0,h.parentMessageId=(o=typeof r.parent_message_id=="string"?parseInt(r.parent_message_id):r.parent_message_id)!==null&&o!==void 0?o:0,h.threadInfo=r.thread_info?new uf(h._iid,r.thread_info):null,h.reactions=r.reactions?r.reactions.map(function(f){return new kd(f)}):[],h.ogMetaData=r.og_tag?new P1(r.og_tag):null,h.silent=(a=r.silent)!==null&&a!==void 0&&a,h.isOperatorMessage=(l=r.is_op_msg)!==null&&l!==void 0&&l,h.appleCriticalAlertOptions=r.apple_critical_alert_options?new Oi(r.apple_critical_alert_options):null,typeof r.scheduled_message_id=="number"&&typeof r.scheduled_at=="number"&&r.scheduled_status&&(h.scheduledInfo={scheduledMessageId:r.scheduled_message_id,scheduledAt:r.scheduled_at},h._scheduledStatus=r.scheduled_status),h._isContinuousMessages=(u=r.is_continuous_messages)!==null&&u!==void 0&&u,h.myFeedback=Ms._isSubmitted(r.feedback)?new Ms(r.feedback):null,h.myFeedbackStatus=Ms._getStatus(r.feedback),h.suggestedReplies=(d=(c=r.extended_message_payload)===null||c===void 0?void 0:c.suggested_replies)!==null&&d!==void 0?d:null,h.forms=Rd.isFormPayload(r.extended_message_payload)?r.extended_message_payload.forms.map(function(f){return new Rd(h.messageId,f.key,f.fields.map(function(p){return new rS(p)}))}):null,h}return T(n,e),n.payloadify=function(t){var r,i;return ye(Ie(x(x({},e.payloadify.call(this,t)),{message_id:t.messageId,parent_message_id:t.parentMessageId,thread_info:t.threadInfo?uf.payloadify(t.threadInfo):null,reactions:t.reactions.map(function(s){return kd.payloadify(s)}),og_tag:t.ogMetaData?P1.payloadify(t.ogMetaData):null,silent:t.silent,is_op_msg:t.isOperatorMessage,apple_critical_alert_options:t.appleCriticalAlertOptions?Oi.payloadify(t.appleCriticalAlertOptions):null,scheduled_message_id:(r=t.scheduledInfo)===null||r===void 0?void 0:r.scheduledMessageId,scheduled_at:(i=t.scheduledInfo)===null||i===void 0?void 0:i.scheduledAt,scheduled_status:t._scheduledStatus,feedback:t.myFeedback?Ms.payloadify(t.myFeedback):Ms._getPayloadByStatus(t.myFeedbackStatus),forms:t.forms?t.forms.map(function(s){return Rd.payloadify(s)}):null})))},n._getParentMessageInfoPayload=function(t){return ye(Ie({type:tS(t.messageType),ts:t.createdAt,user:t.sender?jl.payloadify(t.sender):null,message:t.message,file:{url:t.plainUrl,name:t.name,type:t.type,require_auth:t.requireAuth},files:Array.isArray(t.fileInfoList)?t.fileInfoList.map(function(r){return om.payloadify(r)}):null}))},n.prototype.isIdentical=function(t){return this.messageId===t.messageId},n.prototype.applyThreadInfoUpdateEvent=function(t){return this.messageId===t.targetMessageId&&(t.threadInfo._isUpdateRequired&&this.threadInfo&&t.threadInfo._updateFrom(this.threadInfo),this.threadInfo=t.threadInfo,!0)},n.prototype.applyReactionEvent=function(t){if(this.messageId===t.messageId){for(var r=!1,i=0;i=r)return this.parentMessage=t,!0}return!1},n.prototype._triggerThreadInfoUpdatedEvent=function(){return y(this,void 0,void 0,function(){var t;return v(this,function(r){return(t=O.of(this._iid).dispatcher).dispatch(new oS({channelType:Ze.GROUP,channelUrl:this.channelUrl,parentMessage:this})),t.dispatch(new bt({messages:[this],source:G.EVENT_MESSAGE_THREADINFO_UPDATED})),[2]})})},n.prototype.markThreadAsRead=function(){return y(this,void 0,void 0,function(){var t,r;return v(this,function(i){switch(i.label){case 0:return t=O.of(this._iid).requestQueue,r=new Y6({channelUrl:this.channelUrl,messageId:this.messageId}),[4,t.send(r)];case 1:return i.sent(),this.threadInfo&&this.threadInfo.unreadReplyCount!==0?(this.threadInfo.unreadReplyCount=0,[4,this._triggerThreadInfoUpdatedEvent()]):[3,3];case 2:i.sent(),i.label=3;case 3:return[2]}})})},n.prototype.setPushNotificationEnabled=function(t){return y(this,void 0,void 0,function(){var r,i;return v(this,function(s){switch(s.label){case 0:return r=O.of(this._iid).requestQueue,i=new Z6({channelUrl:this.channelUrl,channelType:this.channelType,messageId:this.messageId,pushEnabled:t}),[4,r.send(i)];case 1:return s.sent(),this.threadInfo&&this.threadInfo.isPushNotificationEnabled!==t&&(this.threadInfo.isPushNotificationEnabled=t),[2]}})})},n.prototype.submitForm=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:if(Y(t.form&&t.form instanceof Rd||R("string",t.formId)&&R("object",t.answers)).throw(L.invalidParameters),r=O.of(this._iid),i=r.requestQueue,s=r.sdkState,o=r.logger,!t.form)return[3,2];if(!(a=t.form).isSubmittable)throw new L({code:Te.INVALID_PARAMETER,message:"The given form is not submittable."});if(a.isSubmitted)throw new L({code:Te.INVALID_PARAMETER,message:"The given form is already submitted."});if(a.messageId!=this.messageId)throw new L({code:Te.INVALID_PARAMETER,message:"This form does not belong to the message."});return l=a.fields.reduce(function(d,h){return d[h.key]=h.temporaryAnswer,d},{}),u=new H1({userId:s.userId,channelUrl:this.channelUrl,channelType:this.channelType,messageId:this.messageId,forms:[{form_key:a.key,data:l}]}),[4,i.send(u)];case 1:return c.sent(),[3,4];case 2:return t.formId&&t.answers?(o.warn("The submitForm method with formId and answers is deprecated. Use submitForm({ form: Form }) instead."),u=new H1({userId:s.userId,channelUrl:this.channelUrl,channelType:this.channelType,messageId:this.messageId,forms:[{form_key:t.formId,data:t.answers}]}),[4,i.send(u)]):[3,4];case 3:c.sent(),c.label=4;case 4:return[2]}})})},n.prototype.submitFeedback=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:return r=O.of(this._iid),i=r.requestQueue,s=r.dispatcher,o=new X6({channelUrl:this.channelUrl,channelType:this.channelType,messageId:this.messageId,rating:t.rating,comment:t.comment}),[4,i.send(o)];case 1:return a=u.sent(),l=a.as(J6),this.myFeedback=l.feedback,this.myFeedbackStatus="SUBMITTED",s.dispatch(new bt({messages:[this],source:G.EVENT_MESSAGE_FEEDBACK_ADDED})),[2]}})})},n.prototype.updateFeedback=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:return r=O.of(this._iid),i=r.requestQueue,s=r.dispatcher,o=new eM({channelUrl:this.channelUrl,channelType:this.channelType,messageId:this.messageId,feedbackId:t.id,rating:t.rating,comment:t.comment}),[4,i.send(o)];case 1:return a=u.sent(),l=a.as(tM),this.myFeedback=l.feedback,this.myFeedbackStatus="SUBMITTED",s.dispatch(new bt({messages:[this],source:G.EVENT_MESSAGE_FEEDBACK_UPDATED})),[2]}})})},n.prototype.deleteFeedback=function(t){return y(this,void 0,void 0,function(){var r,i,s,o;return v(this,function(a){switch(a.label){case 0:return r=O.of(this._iid),i=r.requestQueue,s=r.dispatcher,o=new nM({channelUrl:this.channelUrl,channelType:this.channelType,messageId:this.messageId,feedbackId:t}),[4,i.send(o)];case 1:return a.sent(),this.myFeedback=null,this.myFeedbackStatus="NO_FEEDBACK",s.dispatch(new bt({messages:[this],source:G.EVENT_MESSAGE_FEEDBACK_DELETED})),[2]}})})},n}(nS),Ft=function(e){function n(t,r){var i,s,o,a,l=this;if((l=e.call(this,t,r)||this).reqId="",l.replyToChannel=!1,l.errorCode=0,l.sender=r.user?new jl(l._iid,r.user):r.sender_id,l.reqId=(s=(i=r.req_id)!==null&&i!==void 0?i:r.request_id)!==null&&s!==void 0?s:"",l.replyToChannel=(o=r.is_reply_to_channel)!==null&&o!==void 0&&o,r.request_state&&$e(ut,r.request_state)&&(l.sendingStatus=r.request_state),!l.sendingStatus)if(l.messageId>0)l.sendingStatus=ut.SUCCEEDED;else if(l.scheduledInfo)switch(r.scheduled_status&&(l._scheduledStatus=r.scheduled_status),r.scheduled_status){case ii.SENT:case ii.IN_QUEUE:l.sendingStatus=ut.SUCCEEDED;break;case ii.PENDING:l.sendingStatus=ut.SCHEDULED;break;case ii.FAILED:case ii.REMOVED:l.sendingStatus=ut.FAILED;break;case ii.CANCELED:l.sendingStatus=ut.CANCELED}else l.sendingStatus=ut.PENDING;return l.errorCode=(a=r.error_code)!==null&&a!==void 0?a:0,l._messageToken=r.mesg_token,l}return T(n,e),n.payloadify=function(t){return ye(Ie(x(x({},e.payloadify.call(this,t)),{user:jl.payloadify(t.sender),req_id:t.reqId,is_reply_to_channel:t.replyToChannel,request_state:t.sendingStatus,error_code:t.errorCode,mesg_token:t._messageToken})))},Object.defineProperty(n.prototype,"isResendable",{get:function(){return(this.sendingStatus===ut.FAILED||this.sendingStatus===ut.CANCELED)&&$4(this.errorCode)},enumerable:!1,configurable:!0}),n.prototype.isIdentical=function(t){return this.messageId>0&&t.messageId>0?this.messageId===t.messageId:this.reqId===t.reqId},n}(hr),Yc={prevResultSize:0,nextResultSize:0,isInclusive:!1,reverse:!1,messageTypeFilter:tr.ALL,customTypesFilter:void 0,senderUserIdsFilter:void 0,includeReactions:!1,includeMetaArray:!1,includeParentMessageInfo:!1},l0=function(e){return R("number",e.prevResultSize)&&R("number",e.nextResultSize)&&R("boolean",e.isInclusive)&&R("boolean",e.reverse)&&R("string",e.messageTypeFilter)&&$e(tr,e.messageTypeFilter)&&We("string",e.customTypesFilter,!0)&&We("string",e.senderUserIdsFilter,!0)&&R("boolean",e.includeMetaArray)&&R("boolean",e.includeReactions)&&R("boolean",e.includeParentMessageInfo)},Bl=function(e){function n(t,r){var i,s,o,a,l=this;if((l=e.call(this,t,r)||this).translations={},l.message=(i=r.message)!==null&&i!==void 0?i:"",l.messageType=Ct.ADMIN,l.translations=(s=r.translations)!==null&&s!==void 0?s:{},r.parent_message_info){var u=r.parent_message_info;l.parentMessage=yr(t,ye(Ie(x(x({},u),{message_id:l.parentMessageId,channel_url:l.channelUrl,channel_type:l.channelType,file:u.file,url:(o=u.file)===null||o===void 0?void 0:o.url,require_auth:(a=u.file)===null||a===void 0?void 0:a.require_auth}))))}return l}return T(n,e),n.payloadify=function(t){return ye(Ie(x(x({},e.payloadify.call(this,t)),{message:t.message,translations:t.translations,parent_message_info:t.parentMessage?e._getParentMessageInfoPayload.call(this,t.parentMessage):null})))},n.prototype.getThreadedMessagesByTimestamp=function(t,r){return y(this,void 0,void 0,function(){var i;return v(this,function(s){switch(s.label){case 0:return i=x(x({},Yc),r),Y(this.messageId>0&&R("number",t)&&l0(i)).throw(L.invalidParameters),[4,An.of(this._iid).getThreadedMessagesByTimestamp(this,t,i)];case 1:return[2,s.sent()]}})})},n}(hr),j1=function(){function e(n){var t,r;this.detail={},this.type=(t=n.type)!==null&&t!==void 0?t:"",this.vendor=(r=n.vendor)!==null&&r!==void 0?r:"",n.detail&&R("object",n.detail)&&!Array.isArray(n.detail)&&(this.detail=n.detail)}return e.payloadify=function(n){return ye(Ie({type:n.type,vendor:n.vendor,detail:n.detail}))},e}(),B1=function(){function e(n){this.status=n.status,n.original_message_info&&(this.originalMessageInfo={createdAt:n.original_message_info.ts,messageId:n.original_message_info.id})}return e.payloadify=function(n){return ye({status:n.status,original_message_info:n.originalMessageInfo?{id:n.originalMessageInfo.messageId,ts:n.originalMessageInfo.createdAt}:void 0})},e}(),er=function(e){function n(t,r){var i,s,o,a,l,u,c,d=this;if((d=e.call(this,t,r)||this).message="",d.messageParams=null,d.translations={},d.translationTargetLanguages=[],d.messageSurvivalSeconds=-1,d.plugins=[],d._poll=null,d.message=r.message,d.messageType=Ct.USER,d.translations=(o=r.translations)!==null&&o!==void 0?o:{},d.translationTargetLanguages=(a=r.target_langs)!==null&&a!==void 0?a:[],Object.keys(d.translations).length===0&&d.translationTargetLanguages.length>0)try{for(var h=pe(d.translationTargetLanguages),f=h.next();!f.done;f=h.next()){var p=f.value;d.translations[p]=""}}catch(b){i={error:b}}finally{try{f&&!f.done&&(s=h.return)&&s.call(h)}finally{if(i)throw i.error}}if(d.messageSurvivalSeconds=(l=r.message_survival_seconds)!==null&&l!==void 0?l:-1,d.plugins=r.plugins?r.plugins.map(function(b){return new j1(b)}):[],d._poll=r.poll?new xi(d._iid,r.poll):null,r.parent_message_info){var g=r.parent_message_info;d.parentMessage=yr(t,ye(Ie(x(x({},g),{created_at:g.ts,message_id:d.parentMessageId,channel_url:d.channelUrl,channel_type:d.channelType,file:g.file,url:(u=g.file)===null||u===void 0?void 0:u.url,require_auth:(c=g.file)===null||c===void 0?void 0:c.require_auth}))))}return r.review_info&&(d.messageReviewInfo=new B1(r.review_info)),d}return T(n,e),n.payloadify=function(t){return ye(Ie(x(x({},e.payloadify.call(this,t)),{message:t.message,translations:t.translations,message_survival_seconds:t.messageSurvivalSeconds,plugins:t.plugins.map(function(r){return j1.payloadify(r)}),poll:t._poll?xi.payloadify(t._poll):null,parent_message_info:t.parentMessage?e._getParentMessageInfoPayload.call(this,t.parentMessage):null,review_info:t.messageReviewInfo?B1.payloadify(t.messageReviewInfo):void 0})))},n.prototype.getThreadedMessagesByTimestamp=function(t,r){return y(this,void 0,void 0,function(){var i;return v(this,function(s){switch(s.label){case 0:return i=x(x({},Yc),r),Y(this.messageId>0&&R("number",t)&&l0(i)).throw(L.invalidParameters),[4,An.of(this._iid).getThreadedMessagesByTimestamp(this,t,i)];case 1:return[2,s.sent()]}})})},n.prototype.applyPoll=function(t){return!(this._poll&&this._poll.id===t.id&&this._poll.updatedAt>t.updatedAt)&&(this._poll=t,!0)},Object.defineProperty(n.prototype,"poll",{get:function(){return this._poll},enumerable:!1,configurable:!0}),n}(Ft),li=function(e){function n(t,r){var i,s,o,a,l,u,c,d,h=this;if((h=e.call(this,t,r)||this).messageParams=null,h.fileInfoList=[],h.messageSurvivalSeconds=-1,h.messageType=Ct.FILE,h.data=(o=(s=(i=r.file)===null||i===void 0?void 0:i.data)!==null&&s!==void 0?s:r.custom)!==null&&o!==void 0?o:"",h.fileInfoList=(l=(a=r.files)===null||a===void 0?void 0:a.map(function(p){return new om(t,p)}))!==null&&l!==void 0?l:[],h.messageSurvivalSeconds=(u=r.message_survival_seconds)!==null&&u!==void 0?u:-1,r.parent_message_info){var f=r.parent_message_info;h.parentMessage=yr(t,ye(Ie(x(x({},f),{created_at:f.ts,message_id:h.parentMessageId,channel_url:h.channelUrl,channel_type:h.channelType,file:f.file,url:(c=f.file)===null||c===void 0?void 0:c.url,require_auth:(d=f.file)===null||d===void 0?void 0:d.require_auth}))))}return h}return T(n,e),n.prototype.getThreadedMessagesByTimestamp=function(t,r){return y(this,void 0,void 0,function(){var i;return v(this,function(s){switch(s.label){case 0:return i=x(x({},Yc),r),Y(this.messageId>0&&R("number",t)&&l0(i)).throw(L.invalidParameters),[4,An.of(this._iid).getThreadedMessagesByTimestamp(this,t,i)];case 1:return[2,s.sent()]}})})},n.payloadify=function(t){var r,i,s,o,a,l;return ye(Ie(x(x({},e.payloadify.call(this,t)),{file:{name:(i=(r=t.fileInfoList[0])===null||r===void 0?void 0:r.fileName)!==null&&i!==void 0?i:"",size:(o=(s=t.fileInfoList[0])===null||s===void 0?void 0:s.fileSize)!==null&&o!==void 0?o:0,type:(l=(a=t.fileInfoList[0])===null||a===void 0?void 0:a.mimeType)!==null&&l!==void 0?l:"",data:t.data},files:Array.isArray(t.fileInfoList)?t.fileInfoList.map(function(u){return om.payloadify(u)}):null,message_survival_seconds:t.messageSurvivalSeconds,parent_message_info:t.parentMessage?e._getParentMessageInfoPayload.call(this,t.parentMessage):null})))},n._isMultipleFilesMessagePayload=function(t){var r=t.files;return Array.isArray(r)&&r.length>=2},n._isMultipleFilesMessageSerializedData=function(t){var r=t.fileInfoList;return Array.isArray(r)},n}(Ft);(function(e){e.SENT="SENT",e.READ="READ"})(aa||(aa={}));var Na=function(e){function n(t,r){var i,s,o=this;if((o=e.call(this,t,r)||this).notificationData=null,o.notificationId=r.notification_message_id,o.messageType=Ct.ADMIN,o.messageStatus=(i=r.message_status)!==null&&i!==void 0?i:aa.SENT,o.priority=(s=r.priority)!==null&&s!==void 0?s:Q_.NORMAL,o.notificationEventDeadline=r.notification_event_deadline,o.extendedMessage.sub_type===0)try{var a=JSON.parse(o.extendedMessage.sub_data),l=a.label,u=a.tags,c=u===void 0?[]:u,d=a.template_key,h=a.template_variables;o.notificationData={label:l,tags:c,templateKey:d,templateVariables:h}}catch{}return o}return T(n,e),n.payloadify=function(t){return ye(Ie(x(x({},e.payloadify.call(this,t)),{notification_message_id:t.notificationId,message_status:t.messageStatus,priority:t.priority,notification_event_deadline:t.notificationEventDeadline})))},n.prototype.isIdentical=function(t){return this.notificationId===t.notificationId},n}(nS),$1=function(e){if(e.notificationId)return Na.payloadify(e);switch(e.messageType){case Ct.USER:return er.payloadify(e);case Ct.FILE:return e.fileInfoList?li.payloadify(e):Jt.payloadify(e);case Ct.ADMIN:return Bl.payloadify(e);default:throw L.unknown}},yr=function(e,n){if(n.notification_message_id)return new Na(e,n);switch(n.type){case"MESG":return new er(e,n);case"FILE":return li._isMultipleFilesMessagePayload(n)?new li(e,n):new Jt(e,n);case"ADMM":case"BRDM":return new Bl(e,n);default:return null}},Jt=function(e){function n(t,r){var i,s,o,a,l,u,c,d,h,f,p,g,b,m,_=this;(_=e.call(this,t,r)||this).messageParams=null,_.plainUrl="",_.requireAuth=!1,_.thumbnails=[],_.messageSurvivalSeconds=-1,_.messageType=Ct.FILE;var E=r.file;if(_.plainUrl=((s=(i=E==null?void 0:E.url)!==null&&i!==void 0?i:r.url)!==null&&s!==void 0?s:"").split("?auth=")[0],_.name=(a=(o=E==null?void 0:E.name)!==null&&o!==void 0?o:r.name)!==null&&a!==void 0?a:"File",_.size=(u=(l=E==null?void 0:E.size)!==null&&l!==void 0?l:r.size)!==null&&u!==void 0?u:0,_.data=(d=(c=E==null?void 0:E.data)!==null&&c!==void 0?c:r.custom)!==null&&d!==void 0?d:"",_.type=E?(h=E.type)!==null&&h!==void 0?h:"":(f=r.type)!==null&&f!==void 0?f:"",_.requireAuth=(p=r.require_auth)!==null&&p!==void 0&&p,_.thumbnails=r.thumbnails?r.thumbnails.map(function(w){var N;return new zs(_._iid,typeof w=="string"?{url:w,width:0,height:0}:x(x({},w),{url:((N=w.url)!==null&&N!==void 0?N:"").split("auth=")[0]}),_.requireAuth)}):[],_.messageSurvivalSeconds=(g=r.message_survival_seconds)!==null&&g!==void 0?g:-1,r.parent_message_info){var S=r.parent_message_info;_.parentMessage=yr(t,ye(Ie(x(x({},S),{created_at:S.ts,message_id:_.parentMessageId,channel_url:_.channelUrl,channel_type:_.channelType,file:S.file,url:(b=S.file)===null||b===void 0?void 0:b.url,require_auth:(m=S.file)===null||m===void 0?void 0:m.require_auth}))))}return _}return T(n,e),n.payloadify=function(t){var r;return ye(Ie(x(x({},e.payloadify.call(this,t)),{url:t.plainUrl,require_auth:t.requireAuth,file:{name:t.name,size:t.size,type:t.type,data:t.data},thumbnails:(r=t.thumbnails)===null||r===void 0?void 0:r.map(function(i){return{url:i.plainUrl,width:i.width,height:i.height,real_width:i.realWidth,real_height:i.realHeight}}),message_survival_seconds:t.messageSurvivalSeconds,parent_message_info:t.parentMessage?e._getParentMessageInfoPayload.call(this,t.parentMessage):null})))},Object.defineProperty(n.prototype,"url",{get:function(){var t=O.of(this._iid).sessionManager;return this.requireAuth&&t.ekey?"".concat(this.plainUrl,"?auth=").concat(t.ekey):this.plainUrl},enumerable:!1,configurable:!0}),n.prototype.getThreadedMessagesByTimestamp=function(t,r){return y(this,void 0,void 0,function(){var i;return v(this,function(s){switch(s.label){case 0:return i=x(x({},Yc),r),Y(this.messageId>0&&R("number",t)&&l0(i)).throw(L.invalidParameters),[4,An.of(this._iid).getThreadedMessagesByTimestamp(this,t,i)];case 1:return[2,s.sent()]}})})},n}(Ft),cf=function(e){function n(t,r){var i=r.file,s=r.fileUrl,o=r.fileName,a=r.fileSize,l=r.mimeType,u=r.thumbnailSizes,c=r._uploadedMetaData,d=r._thumbnails,h=e.call(this,t)||this;return h._plainUrl=s,h.file=i,h.fileName=o,h.fileSize=a,h.mimeType=l,h.thumbnailSizes=u,h._uploadedMetaData=c,h._thumbnails=d,h}return T(n,e),n.getPlainUrl=function(t){return t instanceof n?t._plainUrl:t.fileUrl},Object.defineProperty(n.prototype,"fileUrl",{get:function(){var t,r=O.of(this._iid).sessionManager;return this._plainUrl&&(!((t=this._uploadedMetaData)===null||t===void 0)&&t.requireAuth)&&r.ekey?"".concat(this._plainUrl,"?auth=").concat(r.ekey):this._plainUrl},set:function(t){this._plainUrl=t},enumerable:!1,configurable:!0}),n.prototype.toJSON=function(){return{file:this.file,fileUrl:this._plainUrl,fileName:this.fileName,fileSize:this.fileSize,mimeType:this.mimeType,thumbnailSizes:this.thumbnailSizes,_thumbnails:this._thumbnails,_uploadedMetaData:this._uploadedMetaData}},n}(Kn),rM=function(e){function n(t){var r,i,s,o,a=[];return t.mentionType===rr.USERS&&(t.mentionedUserIds?a=t.mentionedUserIds:t.mentionedUsers&&(a=t.mentionedUsers.map(function(l){return l.userId}))),e.call(this,{code:"FILE",ackRequired:!0,payload:ye(Ie({channel_url:t.channelUrl,files:t.files?lS(t.files):null,url:t.url,name:(r=t.fileName)!==null&&r!==void 0?r:"",type:(i=t.mimeType)!==null&&i!==void 0?i:"",size:(s=t.fileSize)!==null&&s!==void 0?s:0,custom:t.data,custom_type:t.customType,thumbnails:(o=t._thumbnails)===null||o===void 0?void 0:o.map(function(l){return zs.payloadify(l)}),require_auth:t.requireAuth,metaarray:t.metaArrays,mention_type:t.mentionType,mentioned_user_ids:a,push_option:t.pushNotificationDeliveryOption&&t.pushNotificationDeliveryOption!==Wi.DEFAULT?t.pushNotificationDeliveryOption:void 0,apple_critical_alert_options:t.appleCriticalAlertOptions?Oi.payloadify(t.appleCriticalAlertOptions):null,silent:t.silent,reply_to_channel:t.isReplyToChannel,parent_message_id:t.parentMessageId?t.parentMessageId:null,req_id:t.reqId,pin_message:t.isPinnedMessage}))})||this}return T(n,e),n}(wr),iM=function(e){function n(t){var r,i,s=this;s=e.call(this)||this;var o=[];return t.mentionType===rr.USERS&&(t.mentionedUserIds?o=t.mentionedUserIds:t.mentionedUsers&&(o=t.mentionedUsers.map(function(a){return a.userId}))),s.method=Z.POST,s.path="".concat(Je(t.channelType),"/").concat(encodeURIComponent(t.channelUrl),"/messages"),s.params=ye(Ie({message_type:Ct.FILE,user_id:t.userId,files:t.files?lS(t.files):null,url:t.fileUrl,mention_type:t.mentionType,mentioned_user_ids:o,file_name:t.fileName,file_size:t.fileSize,file_type:t.mimeType,data:t.data,custom_type:t.customType,thumbnails:(r=t._thumbnails)===null||r===void 0?void 0:r.map(function(a){return zs.payloadify(a)}),require_auth:t.requireAuth,sorted_metaarray:(i=t.metaArrays)===null||i===void 0?void 0:i.map(function(a){return _r.payloadify(a)}),push_option:t.pushNotificationDeliveryOption,parent_message_id:t.parentMessageId?t.parentMessageId:null,apple_critical_alert_options:t.appleCriticalAlertOptions?Oi.payloadify(t.appleCriticalAlertOptions):null,reply_to_channel:t.isReplyToChannel,req_id:t.reqId,pin_message:t.isPinnedMessage})),s}return T(n,e),n}(J),aS=function(e){function n(t,r,i){var s,o,a,l,u=this;(u=e.call(this,t,"FILE",i)||this).message=i.files&&i.files.length>=2?new li(t,i):new Jt(t,i);var c=O.of(t).sdkState;return u.isMentioned=Dl(u.message.mentionType,(a=(s=u.message.mentionedUserIds)!==null&&s!==void 0?s:(o=u.message.mentionedUsers)===null||o===void 0?void 0:o.map(function(d){return d.userId}))!==null&&a!==void 0?a:[],c.userId),u.forceUpdateLastMessage=(l=i.force_update_last_message)!==null&&l!==void 0&&l,u}return T(n,e),n}(gt),sM=function(e){function n(t,r){var i,s,o,a,l=this;(l=e.call(this,t,r)||this).message=r.files&&r.files.length>=2?new li(t,r):new Jt(t,r);var u=O.of(t).sdkState;return l.isMentioned=Dl(l.message.mentionType,(o=(i=l.message.mentionedUserIds)!==null&&i!==void 0?i:(s=l.message.mentionedUsers)===null||s===void 0?void 0:s.map(function(c){return c.userId}))!==null&&o!==void 0?o:[],u.userId),l.forceUpdateLastMessage=(a=r.force_update_last_message)!==null&&a!==void 0&&a,l}return T(n,e),n}(se);function lS(e){return e.map(function(n){var t,r;return ye(Ie({url:cf.getPlainUrl(n),file_name:n.fileName,file_type:n.mimeType,file_size:n.fileSize,thumbnails:(t=n._thumbnails)===null||t===void 0?void 0:t.map(function(i){return zs.payloadify(i)}),require_auth:(r=n._uploadedMetaData)===null||r===void 0?void 0:r.requireAuth}))})}var Sn;(function(e){e[e.PENDING=0]="PENDING",e[e.UPLOADING=1]="UPLOADING",e[e.UPLOADED=2]="UPLOADED",e[e.SENDING=3]="SENDING",e[e.FAILED=4]="FAILED"})(Sn||(Sn={}));var oM=function(){function e(n,t){var r=t.sdkState,i=t.dispatcher,s=t.requestQueue,o=t.onlineDetector,a=t.cacheContext,l=this;this._queueMap=new Map,this._iid=n,this._sdkState=r,this._requestQueue=s,this._cacheContext=a,this._dispatcher=i,this._dispatcher.on(function(u){u instanceof _i&&(l._connectionState=u.stateType)}),this._onlineDetector=o}return Object.defineProperty(e.prototype,"_shouldSendThroughWebSocket",{get:function(){return this._connectionState===rt.CONNECTED||this._connectionState===rt.CONNECTING||this._connectionState===rt.RECONNECTING},enumerable:!1,configurable:!0}),e.prototype._sendFileMessage=function(n,t){return y(this,void 0,void 0,function(){var r,i,s;return v(this,function(o){switch(o.label){case 0:return r=this._createSendFileMessageRequestParams(n,t),this._shouldSendThroughWebSocket?(i=new rM(r),[4,this._requestQueue.send(i)]):[3,2];case 1:return s=o.sent(),[2,s.as(aS).message];case 2:return i=new iM(x(x({},r),{userId:this._sdkState.userId})),[4,this._requestQueue.send(i)];case 3:return s=o.sent(),[2,s.as(sM).message]}})})},e.prototype._createSendFileMessageRequestParams=function(n,t){var r=x(x({},t.params),{channelUrl:n.url,channelType:n.channelType,reqId:t.requestId,url:""});if(t.multipleFileUploadInfo){var i=t.params;r.files=i.fileInfoList}else i=t.params,r.url=i.fileUrl,r.requireAuth=i.requireAuth;return r},e.prototype._resolveMessageQueue=function(n){var t;return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u,c,d,h,f,p,g;return v(this,function(b){switch(b.label){case 0:if(!(r=this._queueMap.get(n.url)))return[3,21];if(r.isResolving)return[3,20];r.isResolving=!0,i=[],s=!0,b.label=1;case 1:b.trys.push([1,15,16,17]),o=pe(r.messageQueue),a=o.next(),b.label=2;case 2:if(a.done)return[3,14];switch(l=a.value,l.state){case Sn.PENDING:case Sn.UPLOADING:return[3,3];case Sn.UPLOADED:return[3,4];case Sn.FAILED:return[3,12]}return[3,13];case 3:return s=!1,i.push(l),[3,13];case 4:if(!s)return[3,10];b.label=5;case 5:return b.trys.push([5,8,,9]),l.state=Sn.SENDING,[4,this._sendFileMessage(n,l)];case 6:return u=b.sent(),l.deferred.resolve(u),[4,Or(100)];case 7:return b.sent(),[3,9];case 8:return c=b.sent(),l.deferred.reject(c),[3,9];case 9:return[3,11];case 10:i.push(l),b.label=11;case 11:return[3,13];case 12:return d=(t=l.error)!==null&&t!==void 0?t:L.unknown,l.deferred.reject(d.code===Te.REQUEST_CANCELED?L.fileUploadCanceled:d),[3,13];case 13:return a=o.next(),[3,2];case 14:return[3,17];case 15:return h=b.sent(),p={error:h},[3,17];case 16:try{a&&!a.done&&(g=o.return)&&g.call(o)}finally{if(p)throw p.error}return[7];case 17:return f=r.isResolveRequestPending,r.messageQueue=i,r.isResolving=!1,r.isResolveRequestPending=!1,f?[4,this._resolveMessageQueue(n)]:[3,19];case 18:b.sent(),b.label=19;case 19:return[3,21];case 20:r.isResolveRequestPending=!0,b.label=21;case 21:return[2]}})})},e.prototype._uploadNextPendingItem=function(n){var t;return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u,c,d,h;return v(this,function(f){switch(f.label){case 0:return(r=this._queueMap.get(n.url))&&(i=r.messageQueue.find(function(p){return p.state===Sn.PENDING}))?i.multipleFileUploadInfo?(s=i.multipleFileUploadInfo,o=s.uploadIndex,a=s.uploadCount,l=s.requestHandler,h=i.params,u=h.fileInfoList[o],!pr(u.file)||!((t=u._uploadedMetaData)===null||t===void 0)&&t.isUploaded?[3,2]:[4,this._tryUploadNextItemAndUpdateItemState(n,r,i)]):[3,4]:[3,9];case 1:return f.sent(),[3,3];case 2:i.state=o=0&&n.uploadQueue.splice(r,1)},e.prototype._uploadNextFileForSingleFileItemAndUpdateParams=function(n,t,r){var i,s,o;return y(this,void 0,void 0,function(){var a,l,u,c,d,h,f,p,g,b;return v(this,function(m){switch(m.label){case 0:return a=new af({file:r.file,channelUrl:n.url,thumbnailSizes:r.thumbnailSizes,requestId:t.requestId}),[4,this._requestQueue.send(a)];case 1:return l=m.sent(),u=l.as(lf),c=u.url,d=u.fileSize,h=d===void 0?r.fileSize:d,f=u.thumbnails,p=f===void 0?[]:f,g=u.requireAuth,b=g!==void 0&&g,r.fileName=(i=r.fileName)!==null&&i!==void 0?i:r.file.name,r.mimeType=(s=r.mimeType)!==null&&s!==void 0?s:r.file.type,r.fileSize=(o=r.fileSize)!==null&&o!==void 0?o:r.file.size,r.fileUrl=c,r.fileSize=h,r.requireAuth=b,r._thumbnails=p,[2]}})})},e.prototype._uploadNextFileForMultipleFilesItemAndUpdateParams=function(n,t,r){var i,s,o;return y(this,void 0,void 0,function(){var a,l,u,c,d,h,f,p,g,b,m;return v(this,function(_){switch(_.label){case 0:return a=t.multipleFileUploadInfo.uploadIndex,l=r.fileInfoList[a],u=new af({file:l.file,channelUrl:n.url,thumbnailSizes:l.thumbnailSizes,requestId:t.requestId}),[4,this._requestQueue.send(u)];case 1:return c=_.sent(),d=c.as(lf),h=d.url,f=d.fileSize,p=f===void 0?l.fileSize:f,g=d.thumbnails,b=d.requireAuth,m=b!==void 0&&b,l.fileName=(i=l.fileName)!==null&&i!==void 0?i:l.file.name,l.mimeType=(s=l.mimeType)!==null&&s!==void 0?s:l.file.type,l.fileSize=(o=l.fileSize)!==null&&o!==void 0?o:l.file.size,l.file=void 0,l.fileUrl=h,l.fileSize=p,l._thumbnails=g,l._uploadedMetaData=x(x({},l._uploadedMetaData),{requireAuth:m,isUploaded:!0}),l instanceof cf||(r.fileInfoList[a]=new cf(this._iid,l)),[2]}})})},e.prototype.request=function(n,t,r,i){return i===void 0&&(i={}),y(this,void 0,void 0,function(){var s,o,a,l,u;return v(this,function(c){return this._queueMap.has(n.url)||(s={messageQueue:[],uploadQueue:[],isResolving:!1,isResolveRequestPending:!1},this._queueMap.set(n.url,s)),o=this._queueMap.get(n.url),a=new Tr,l={requestId:t,params:r,state:Sn.PENDING,deferred:a},function(d){return"fileInfoList"in d}(r)&&(u=x({uploadIndex:0,uploadCount:r.fileInfoList.length},i),l.multipleFileUploadInfo=u),o.messageQueue.push(l),this._uploadNextPendingItem(n),[2,a.promise]})})},e.prototype.cancel=function(n,t){var r,i,s=this._queueMap.get(n.url);if(s){var o=t?[s.messageQueue.find(function(p){return p.requestId===t})]:De([],Ae(s.messageQueue),!1);try{for(var a=pe(o),l=a.next();!l.done;l=a.next()){var u=l.value;if(u)switch(u.state){case Sn.PENDING:if(u.state=Sn.FAILED,u.error=L.requestCanceled,u.multipleFileUploadInfo&&!u.multipleFileUploadInfo.isCopy){var c=u.multipleFileUploadInfo,d=c.uploadIndex,h=c.requestHandler,f=u.params.fileInfoList[d];h==null||h._triggerOnFileUploaded(u.requestId,d,f,L.fileUploadCanceled)}this._resolveMessageQueue(n);break;case Sn.UPLOADING:this._requestQueue.cancel(u.requestId),this._dispatcher.dispatch(new Xh({requestId:u.requestId}))}}}catch(p){r={error:p}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}}else t&&(this._requestQueue.cancel(t),this._dispatcher.dispatch(new Xh({requestId:t})))},e}(),am,tc={prevResultSize:0,nextResultSize:0,isInclusive:!1,reverse:!1,messageTypeFilter:tr.ALL,customTypesFilter:void 0,senderUserIdsFilter:void 0,replyType:Dn.NONE,includeReactions:!1,includeMetaArray:!1,includeParentMessageInfo:!1,includeThreadInfo:!1,showSubchannelMessagesOnly:!1},G1=function(e){return R("number",e.prevResultSize)&&R("number",e.nextResultSize)&&R("boolean",e.isInclusive)&&R("boolean",e.reverse)&&R("string",e.messageTypeFilter)&&$e(tr,e.messageTypeFilter)&&We("string",e.customTypesFilter,!0)&&We("string",e.senderUserIdsFilter,!0)&&$e(Dn,e.replyType)&&R("boolean",e.includeMetaArray)&&R("boolean",e.includeReactions)&&R("boolean",e.includeParentMessageInfo)&&R("boolean",e.includeThreadInfo)&&R("boolean",e.showSubchannelMessagesOnly)},lm={replyType:Dn.NONE,includeReactions:!1,includeThreadInfo:!1,includeMetaArray:!1,includeParentMessageInfo:!1},z1=function(e){return $e(Dn,e.replyType)&&R("boolean",e.includeReactions)&&R("boolean",e.includeMetaArray)&&R("boolean",e.includeParentMessageInfo)&&R("boolean",e.includeThreadInfo)},aM=function(e){function n(t){var r=t.channelType,i=t.channelUrl,s=t.messageId,o=t.includeMetaArray,a=t.includeReactions,l=t.includeThreadInfo,u=t.includeParentMessageInfo,c=e.call(this)||this;return c.method=Z.GET,c.path="".concat(Je(r),"/").concat(encodeURIComponent(i),"/messages/").concat(encodeURIComponent(s)),c.params={is_sdk:!0,with_sorted_meta_array:o,include_reactions:a,include_thread_info:l,include_parent_message_info:u,include_poll_details:!0},c}return T(n,e),n}(J),lM=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.message=r?yr(t,x({},r)):null,i}return T(n,e),n}(se),Ld=function(e){function n(t){var r=t.channelType,i=t.channelUrl,s=t.timestamp,o=t.token,a=t.prevResultSize,l=t.nextResultSize,u=t.isInclusive,c=t.reverse,d=t.messageTypeFilter,h=t.customTypesFilter,f=t.senderUserIdsFilter,p=t.replyType,g=t.includeMetaArray,b=t.includeReactions,m=t.parentMessageId,_=t.includeThreadInfo,E=t.includeParentMessageInfo,S=t.showSubchannelMessagesOnly,w=t.checkingHasNext,N=t.checkingContinuousMessages,A=e.call(this)||this;return A.method=Z.GET,A.path="".concat(Je(r),"/").concat(encodeURIComponent(i),"/messages"),A.params=ye(Ie({is_sdk:!0,prev_limit:a,next_limit:l,include:u,reverse:c,message_ts:s,message_id:o,message_type:d??null,custom_types:h,sender_ids:f,include_reply_type:p,with_sorted_meta_array:g,include_reactions:b,parent_message_id:m,include_thread_info:_,include_parent_message_info:E,show_subchannel_message_only:S,include_poll_details:!0,checking_has_next:w,checking_continuous_messages:N})),A}return T(n,e),n}(J),Dd=function(e){function n(t,r){var i=e.call(this,t,r)||this;return r.is_continuous_messages!==void 0&&(i.isContinuousMessages=r.is_continuous_messages),r.has_next!==void 0&&(i.hasNext=r.has_next),i.messages=r.messages.map(function(s){return yr(t,s)}),i}return T(n,e),n}(se),uM=function(e){function n(t){var r=t.channelType,i=t.channelUrl,s=t.timestamp,o=t.token,a=t.replyType,l=t.includeMetaArray,u=t.includeReactions,c=t.includeThreadInfo,d=t.includeParentMessageInfo,h=e.call(this)||this;return h.method=Z.GET,h.path="".concat(Je(r),"/").concat(encodeURIComponent(i),"/messages/changelogs"),h.params={change_ts:s,token:o,with_sorted_meta_array:l,include_reactions:u,include_thread_info:c,include_reply_type:a,include_parent_message_info:d,include_poll_details:!0},h}return T(n,e),n}(J),cM=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.updatedMessages=r.updated.map(function(s){return yr(t,s)}),i.deletedMessagesInfo=r.deleted.map(function(s){return{messageId:s.message_id,deletedAt:s.deleted_at}}),i.hasMore=r.has_more,i.nextToken=r.next,i}return T(n,e),n}(se),dM=function(e){function n(t){var r=t.channelUrl,i=t.scheduledMessageId,s=e.call(this)||this;return s.method=Z.GET,s.path="".concat(sr,"/").concat(encodeURIComponent(r),"/scheduled_messages/").concat(encodeURIComponent(i)),s.params={},s}return T(n,e),n}(J),hM=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.message=r?yr(t,x({},r)):null,i}return T(n,e),n}(se);(function(e){e.MUTED="muted",e.BANNED="banned"})(am||(am={}));var V1=function(){function e(n){var t,r,i,s;this.restrictionType=null,$e(am,n.restriction_type)&&(this.restrictionType=n.restriction_type),this.description=(t=n.description)!==null&&t!==void 0?t:null,this.endAt=(i=(r=n.end_at)!==null&&r!==void 0?r:n.muted_end_at)!==null&&i!==void 0?i:-1,this.remainingDuration=(s=n.remaining_duration)!==null&&s!==void 0?s:-1}return e.payloadify=function(n){return ye(Ie({restriction_type:n.restrictionType,description:n.description,end_at:n.endAt,remaining_duration:n.remainingDuration}))},e}(),Pa=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.restrictionInfo=new V1(r),i}return T(n,e),n.payloadify=function(t){return ye(Ie(x(x({},e.payloadify.call(this,t)),V1.payloadify(t.restrictionInfo))))},n}(Ke);(function(e){function n(t,r){var i,s=this;return(s=e.call(this,t,r)||this).isMuted=!1,s.isMuted=(i=r.is_muted)!==null&&i!==void 0&&i,s}return T(n,e),n})(Ke);var Br=function(){function e(){this._onPending=qe,this._onFailed=qe,this._onSucceeded=qe}return e.prototype._trigger=function(n){switch(n==null?void 0:n.sendingStatus){case ut.PENDING:n.errorCode===0&&this._onPending(n);break;case ut.SCHEDULED:case ut.SUCCEEDED:this._onSucceeded(n)}},e.prototype._triggerFailed=function(n,t){switch(t==null?void 0:t.sendingStatus){case ut.FAILED:case ut.CANCELED:this._onFailed(n,t.scheduledInfo?null:t)}},e.prototype.onPending=function(n){return this._onPending=n,this},e.prototype.onFailed=function(n){return this._onFailed=n,this},e.prototype.onSucceeded=function(n){return this._onSucceeded=n,this},e}(),u0={data:void 0,customType:void 0,mentionType:rr.USERS,mentionedUserIds:void 0,mentionedUsers:void 0,mentionedMessageTemplate:void 0,metaArrays:void 0,parentMessageId:void 0,isReplyToChannel:!1,pushNotificationDeliveryOption:void 0,appleCriticalAlertOptions:void 0,isPinnedMessage:!1},c0=function(e){return R("string",e.data,!0)&&R("string",e.customType,!0)&&$e(rr,e.mentionType)&&We("string",e.mentionedUserIds,!0)&&We(Ke,e.mentionedUsers,!0)&&R("string",e.mentionedMessageTemplate,!0)&&We(_r,e.metaArrays,!0)&&R("number",e.parentMessageId,!0)&&R("boolean",e.isReplyToChannel)&&$e(Wi,e.pushNotificationDeliveryOption,!0)&&R(Oi,e.appleCriticalAlertOptions,!0)&&R("boolean",e.isPinnedMessage,!0)},q1=function(e){return{isReplyToChannel:e.isReplyToChannel,pushNotificationDeliveryOption:e.pushNotificationDeliveryOption,pollId:e.pollId}},uS=x(x({},u0),{message:"",translationTargetLanguages:void 0,pollId:void 0,extendedMessagePayload:void 0});function cS(e){var n,t,r;return(n=e.messageParams)!==null&&n!==void 0?n:Ie(x(x({},e),{mentionType:e.mentionType,mentionedUserIds:(t=e.mentionedUserIds)!==null&&t!==void 0?t:(r=e.mentionedUsers)===null||r===void 0?void 0:r.map(function(i){return i.userId}),translationTargetLanguages:Object.keys(e.translations),pushNotificationDeliveryOption:Wi.DEFAULT,parentMessageId:null,isReplyToChannel:!1,isPinnedMessage:!1}))}var _a,um=function(e){var n;return ye(Ie({data:e.data,customType:e.customType,mentionType:e.mentionType,mentionedUsers:e.mentionedUsers,mentionedUserIds:e.mentionedUserIds,mentionedMessageTemplate:e.mentionedMessageTemplate,metaArrays:e.metaArrays,pollId:(n=e.poll)===null||n===void 0?void 0:n.id,parentMessageId:e.parentMessageId,appleCriticalAlertOptions:e.appleCriticalAlertOptions,message:e.message,translationTargetLanguages:Object.keys(e.translations),extendedMessagePayload:e.extendedMessagePayload}))},dS=function(e){return c0(e)&&R("string",e.message)&&We("string",e.translationTargetLanguages,!0)&&R("number",e.pollId,!0)&&R("object",e.extendedMessagePayload,!0)};(function(e){e.FILE="file",e.BLOB="blob",e.BLOB_LIKE_OBJECT="blobLikeObject",e.URL="url"})(_a||(_a={}));var fh=function(e){return typeof window<"u"&&"Blob"in window&&typeof Blob<"u"&&e instanceof Blob},Tp=function(e){return e===_a.BLOB||e===_a.FILE},W1=function(e){return{file:e.file,fileKey:e.fileKey,fileType:e.fileType,isReplyToChannel:e.isReplyToChannel,pushNotificationDeliveryOption:e.pushNotificationDeliveryOption}},K1=x(x({},u0),{file:void 0,fileKey:void 0,fileUrl:void 0,fileName:void 0,fileType:void 0,fileSize:void 0,mimeType:void 0,thumbnailSizes:void 0,requireAuth:!1});function hS(e){var n,t,r,i;return(n=e.messageParams)!==null&&n!==void 0?n:Ie(x(x({},e),{fileUrl:e.plainUrl,fileName:e.name,fileSize:e.size,mimeType:e.type,mentionType:e.mentionType,mentionedUserIds:(t=e.mentionedUserIds)!==null&&t!==void 0?t:(r=e.mentionedUsers)===null||r===void 0?void 0:r.map(function(s){return s.userId}),pushNotificationDeliveryOption:Wi.DEFAULT,parentMessageId:null,isReplyToChannel:!1,thumbnailSizes:(i=e.thumbnails)===null||i===void 0?void 0:i.map(function(s){return{maxWidth:s.width,maxHeight:s.height}}),requireAuth:e.requireAuth,isPinnedMessage:!1,_thumbnails:e.thumbnails}))}var nc,cm=function(e,n){var t;return e.messageParams?(!e.url&&pr(n)&&(e.messageParams.file=n),e.messageParams):ye(Ie({data:e.data,customType:e.customType,mentionType:e.mentionType,mentionedUsers:e.mentionedUsers,mentionedUserIds:e.mentionedUserIds,metaArrays:e.metaArrays,parentMessageId:e.parentMessageId,appleCriticalAlertOptions:e.appleCriticalAlertOptions,file:n,fileUrl:e.url,fileName:e.name,fileSize:e.size,mimeType:e.type,thumbnailSizes:(t=e.thumbnails)===null||t===void 0?void 0:t.map(function(r){return{maxWidth:r.width,maxHeight:r.height}})}))},Q1=function(e){return c0(e)&&(pr(e.file)||R("string",e.fileUrl))&&R("string",e.fileName,!0)&&R("string",e.mimeType,!0)&&R("number",e.fileSize,!0)&&(e.thumbnailSizes===null||e.thumbnailSizes===void 0||Array.isArray(e.thumbnailSizes)&&e.thumbnailSizes.every(function(n){return R("object",n)&&n.maxWidth>0&&n.maxHeight>0}))},tv={data:void 0,customType:void 0,mentionType:rr.USERS,mentionedUserIds:void 0,mentionedUsers:void 0,mentionedMessageTemplate:void 0,metaArrays:void 0,pushNotificationDeliveryOption:void 0,appleCriticalAlertOptions:void 0},nv=function(e){return R("string",e.data,!0)&&R("string",e.customType,!0)&&$e(rr,e.mentionType)&&We("string",e.mentionedUserIds,!0)&&We(Ke,e.mentionedUsers,!0)&&R("string",e.mentionedMessageTemplate,!0)&&We(_r,e.metaArrays,!0)&&$e(Wi,e.pushNotificationDeliveryOption,!0)&&R(Oi,e.appleCriticalAlertOptions,!0)},fS=x(x({},tv),{message:void 0,translationTargetLanguages:void 0,pollId:void 0}),pS=function(e){return nv(e)&&R("string",e.message,!0)&&We("string",e.translationTargetLanguages,!0)&&R("number",e.pollId,!0)},fM=x({},tv),pM=function(e){function n(t){var r=t.channelUrl,i=t.channelType,s=t.token,o=t.limit,a=e.call(this)||this;return a.method=Z.GET,a.path="".concat(Je(i),"/").concat(encodeURIComponent(r),"/operators"),a.params={token:s,limit:o},a}return T(n,e),n}(J),_M=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.operators=r.operators.map(function(s){return new Ke(t,s)}),i.token=r.next,i}return T(n,e),n}(se),mM=function(e){function n(t,r,i,s){return e.call(this,t,r,i,s)||this}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)},n.prototype.next=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:return this._validate()?this._isLoading?[3,3]:(t=[],this._hasNext?(this._isLoading=!0,r=O.of(this._iid).requestQueue,i=new pM(x(x({},this),{channelUrl:this.channelUrl,token:this._token})),[4,r.send(i)]):[3,2]):[3,5];case 1:return s=u.sent(),o=s.as(_M),a=o.operators,l=o.token,this._token=l,this._hasNext=!!l,this._isLoading=!1,[2,a];case 2:return[2,t];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Gs),gM=function(e){function n(t,r,i,s){var o,a,l,u,c,d,h,f,p,g,b=this;return(b=e.call(this,t,r,i,s)||this).reverse=!1,b.messageTypeFilter=tr.ALL,b.customTypesFilter=null,b.senderUserIdsFilter=null,b.replyType=Dn.NONE,b.includeMetaArray=!1,b.includeReactions=!1,b.includeParentMessageInfo=!1,b.includeThreadInfo=!1,b.showSubchannelMessagesOnly=!1,b._edge=Number.MAX_SAFE_INTEGER,b.reverse=(o=s.reverse)!==null&&o!==void 0&&o,b.messageTypeFilter=(a=s.messageTypeFilter)!==null&&a!==void 0?a:tr.ALL,b.customTypesFilter=(l=s.customTypesFilter)!==null&&l!==void 0?l:null,b.senderUserIdsFilter=(u=s.senderUserIdsFilter)!==null&&u!==void 0?u:null,b.replyType=(c=s.replyType)!==null&&c!==void 0?c:Dn.NONE,b.includeMetaArray=(d=s.includeMetaArray)!==null&&d!==void 0&&d,b.includeReactions=(h=s.includeReactions)!==null&&h!==void 0&&h,b.includeParentMessageInfo=(f=s.includeParentMessageInfo)!==null&&f!==void 0&&f,b.includeThreadInfo=(p=s.includeThreadInfo)!==null&&p!==void 0&&p,b.showSubchannelMessagesOnly=(g=s.showSubchannelMessagesOnly)!==null&&g!==void 0&&g,b}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)&&R("boolean",this.reverse)&&$e(tr,this.messageTypeFilter)&&$e(Dn,this.replyType)&&We("string",this.customTypesFilter,!0)&&We("string",this.senderUserIdsFilter,!0)&&R("boolean",this.includeMetaArray)&&R("boolean",this.includeReactions)&&R("boolean",this.includeParentMessageInfo)&&R("boolean",this.includeThreadInfo)&&R("boolean",this.showSubchannelMessagesOnly)},n.prototype.load=function(){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,[4,An.of(this._iid).getMessagesByTimestamp(this.channelUrl,this.channelType,this._edge,Ie({prevResultSize:this.limit,nextResultSize:0,isInclusive:!1,reverse:this.reverse,messageTypeFilter:this.messageTypeFilter,customTypesFilter:this.customTypesFilter,replyType:this.replyType,senderUserIdsFilter:this.senderUserIdsFilter,includeReactions:this.includeReactions,includeMetaArray:this.includeMetaArray,includeParentMessageInfo:this.includeParentMessageInfo,includeThreadInfo:this.includeThreadInfo,showSubchannelMessagesOnly:this.showSubchannelMessagesOnly}))]):[3,2]:[3,5];case 1:return t=r.sent(),this._edge=Math.min.apply(Math,De([Number.MAX_SAFE_INTEGER],Ae(t.map(function(i){return i.createdAt})),!1)),this._hasNext=t.length>=this.limit,this._isLoading=!1,[2,t];case 2:return[2,[]];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Gs),vM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.limit,a=t.token;return(r=e.call(this)||this).method=Z.GET,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/mute"),r.params={limit:o,token:a},r}return T(n,e),n}(J),yM=function(e){function n(t,r){var i=e.call(this,t,r)||this;i.mutedUsers=[];var s=r.next,o=r.muted_list;return i.token=s,o&&o.length>0&&(i.mutedUsers=o.map(function(a){return new Pa(t,a)})),i}return T(n,e),n}(se),EM=function(e){function n(t,r,i,s){return e.call(this,t,r,i,s)||this}return T(n,e),n.prototype.next=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,t=O.of(this._iid).requestQueue,r=new vM(x(x({},this),{token:this._token})),[4,t.send(r)]):[3,2]:[3,5];case 1:return i=l.sent(),s=i.as(yM),o=s.mutedUsers,a=s.token,this._token=a,this._hasNext=!!a,this._isLoading=!1,[2,o];case 2:return[2,[]];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Gs),bM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.limit,a=t.token;return(r=e.call(this)||this).method=Z.GET,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/ban"),r.params=ye({limit:o,token:a}),r}return T(n,e),n}(J),CM=function(e){function n(t,r){var i=e.call(this,t,r)||this;i.bannedUsers=[];var s=r.next,o=r.banned_list;return i.token=s,o&&o.length>0&&(i.bannedUsers=o.map(function(a){return new Pa(t,a.user)})),i}return T(n,e),n}(se),SM=function(e){function n(t,r,i,s){return e.call(this,t,r,i,s)||this}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)},n.prototype.next=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,t=O.of(this._iid).requestQueue,r=new bM(x(x({},this),{token:this._token})),[4,t.send(r)]):[3,2]:[3,5];case 1:return i=l.sent(),s=i.as(CM),o=s.bannedUsers,a=s.token,this._token=a,this._hasNext=!!a,this._isLoading=!1,[2,o];case 2:return[2,[]];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Gs);(function(e){e.SPAM="spam",e.HARASSING="harassing",e.SUSPICIOUS="suspicious",e.INAPPROPRIATE="inappropriate"})(nc||(nc={}));var TM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.operatorUserIds;return(r=e.call(this)||this).method=Z.POST,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/operators"),r.params={operator_ids:o},r}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var wM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.operatorUserIds;return(r=e.call(this)||this).method=Z.DELETE,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/operators"),r.params={operator_ids:o},r}return T(n,e),n}(J);(function(e){function n(t,r){return e.call(this,t,r)||this}T(n,e)})(se);var NM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.userId;return(r=e.call(this)||this).method=Z.GET,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/mute/").concat(o),r}return T(n,e),n}(J),IM=function(e){function n(t,r){var i=e.call(this,t,r)||this;i.isMuted=!1,i.startAt=0,i.endAt=0;var s=r.is_muted,o=r.start_at,a=r.end_at,l=r.remaining_duration,u=r.description;return i.isMuted=s,i.startAt=o,i.endAt=a,i.remainingDuration=l,i.description=u,i}return T(n,e),n}(se),Y1=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.keys;return(r=e.call(this)||this).method=Z.GET,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/metadata"),r.params={keys:o,include_ts:!0},r}return T(n,e),n}(J),Z1=function(e){function n(t,r){var i=e.call(this,t,r)||this,s=r.metadata,o=r.ts;return i.metadata=s,i.ts=o,i}return T(n,e),n}(se),AM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.metadata;return(r=e.call(this)||this).method=Z.POST,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/metadata"),r.params={metadata:o,include_ts:!0},r}return T(n,e),n}(J),MM=function(e){function n(t,r){var i,s,o=this;return(o=e.call(this,t,r)||this).metaData=(i=r.metadata)!==null&&i!==void 0?i:{},o.ts=(s=r.ts)!==null&&s!==void 0?s:null,o}return T(n,e),n}(se),xM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.metadata,a=t.upsert;return(r=e.call(this)||this).method=Z.PUT,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/metadata"),r.params={metadata:o,include_ts:!0,upsert:a!=null&&a},r}return T(n,e),n}(J),OM=function(e){function n(t,r){var i=e.call(this,t,r)||this,s=r.metadata,o=r.ts;return i.metadata=s,i.ts=o,i}return T(n,e),n}(se),kM=function(e){function n(t,r,i){var s=e.call(this,t,"SYEV",i)||this;return i.data&&(s.created=i.data.created,s.updated=i.data.updated,s.deleted=i.data.deleted),s}return T(n,e),n}(gt),RM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.key;return(r=e.call(this)||this).method=Z.DELETE,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/metadata/").concat(o),r.params={include_ts:!0},r}return T(n,e),n}(J),LM=function(e){function n(t,r){var i=e.call(this,t,r)||this,s=r.ts;return i.ts=s,i}return T(n,e),n}(se),DM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType;return(r=e.call(this)||this).method=Z.DELETE,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/metadata"),r.params={include_ts:!0},r}return T(n,e),n}(J),UM=function(e){function n(t,r){var i=e.call(this,t,r)||this,s=r.ts;return i.ts=s,i}return T(n,e),n}(se),X1=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.keys;return(r=e.call(this)||this).method=Z.GET,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/metacounter"),r.params={keys:o},r}return T(n,e),n}(J),J1=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.metaCounter=r,i}return T(n,e),n}(se),PM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.metaCounter;return(r=e.call(this)||this).method=Z.POST,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/metacounter"),r.params={metacounter:o},r}return T(n,e),n}(J),FM=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.metaCounter=r,i}return T(n,e),n}(se),wp=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.metaCounter,a=t.upsert,l=a!==void 0&&a,u=t.mode,c=u===void 0?"set":u;return(r=e.call(this)||this).method=Z.PUT,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/metacounter"),r.params={metacounter:o,upsert:l,mode:c},r}return T(n,e),n}(J),Np=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.metaCounter=r,i}return T(n,e),n}(se),HM=function(e){function n(t,r,i){var s=e.call(this,t,"SYEV",i)||this;return i.data&&(s.created=i.data.created,s.updated=i.data.updated,s.deleted=i.data.deleted),s}return T(n,e),n}(gt),jM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.key;return(r=e.call(this)||this).method=Z.DELETE,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/metacounter/").concat(o),r.params={},r}return T(n,e),n}(J);(function(e){function n(t,r){return e.call(this,t,r)||this}T(n,e)})(se);var BM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType;return(r=e.call(this)||this).method=Z.DELETE,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/metacounter"),r.params={},r}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var $M=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.userId,a=t.seconds,l=t.description;return(r=e.call(this)||this).method=Z.POST,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/mute"),r.params={user_id:o,seconds:a,description:l},r}return T(n,e),n}(J);(function(e){function n(t,r){return e.call(this,t,r)||this}T(n,e)})(se);var GM=function(e){function n(t,r,i){var s=e.call(this,t,"SYEV",i)||this;return s.user=new Pa(t,i.data),s}return T(n,e),n}(gt),zM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.userId;return(r=e.call(this)||this).method=Z.DELETE,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/mute/").concat(encodeURIComponent(o)),r}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var VM=function(e){function n(t,r,i){var s=e.call(this,t,"SYEV",i)||this;return s.user=new Pa(t,i.data),s}return T(n,e),n}(gt),qM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.userId,a=t.seconds,l=t.description;return(r=e.call(this)||this).method=Z.POST,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/ban"),r.params=ye({user_id:o,seconds:a,description:l}),r}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var WM=function(e){function n(t,r,i){var s=e.call(this,t,"SYEV",i)||this;return s.user=new Pa(t,i.data),i.data.member_count&&(s.memberCount=i.data.member_count),i.data.joined_member_count&&(s.joinedMemberCount=i.data.joined_member_count),s}return T(n,e),n}(gt),KM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.userId;return(r=e.call(this)||this).method=Z.DELETE,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/ban/").concat(encodeURIComponent(o)),r}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var QM=function(e){function n(t,r,i){var s=e.call(this,t,"SYEV",i)||this;return s.user=new Pa(t,i.data),s}return T(n,e),n}(gt),ey=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.freezing;return(r=e.call(this)||this).method=Z.PUT,r.path="".concat(Je(s),"/").concat(encodeURIComponent(i),"/freeze"),r.params={freeze:o},r}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var YM=function(e){function n(t,r,i){var s=e.call(this,t,"SYEV",i)||this;return s.freeze=i.data.freeze,s}return T(n,e),n}(gt),ZM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.category,a=t.userId,l=t.description;return(r=e.call(this)||this).method=Z.POST,r.path="".concat(hC(s),"/").concat(encodeURIComponent(i)),r.params={report_category:o,reporting_user_id:a,report_description:l},r}return T(n,e),n}(J),XM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.category,a=t.userId,l=t.offendingUserId,u=t.description;return(r=e.call(this)||this).method=Z.POST,r.path="".concat(Z_,"/users/").concat(l),r.params={channel_url:i,channel_type:s===Ze.OPEN?"open_channels":"group_channels",report_category:o,reporting_user_id:a,report_description:u},r}return T(n,e),n}(J),JM=function(e){function n(t){var r=this,i=t.channelUrl,s=t.channelType,o=t.category,a=t.userId,l=t.offendingUserId,u=t.messageId,c=t.description,d=t.messageToken;return(r=e.call(this)||this).method=Z.POST,r.path="".concat(hC(s),"/").concat(encodeURIComponent(i),"/messages/").concat(u),r.params=ye({report_category:o,reporting_user_id:a,report_description:c,offending_user_id:l,mesg_token:d}),r}return T(n,e),n}(J),ex=function(e){function n(t){var r=[];return t.mentionType===rr.USERS&&(t.mentionedUserIds?r=t.mentionedUserIds:t.mentionedUsers&&(r=t.mentionedUsers.map(function(i){return i.userId}))),e.call(this,{code:"MESG",ackRequired:!0,payload:ye(Ie({channel_url:t.channelUrl,message:t.message,data:t.data,custom_type:t.customType,metaarray:t.metaArrays,mention_type:t.mentionType,mentioned_user_ids:r,mentioned_message_template:t.mentionedMessageTemplate,target_langs:t.translationTargetLanguages,push_option:t.pushNotificationDeliveryOption&&t.pushNotificationDeliveryOption!==Wi.DEFAULT?t.pushNotificationDeliveryOption:void 0,apple_critical_alert_options:t.appleCriticalAlertOptions,silent:t.silent,reply_to_channel:t.isReplyToChannel,parent_message_id:t.parentMessageId?t.parentMessageId:null,req_id:t.reqId,poll_id:t.pollId,pin_message:t.isPinnedMessage,extended_message_payload:t.extendedMessagePayload}))})||this}return T(n,e),n}(wr),_S=function(e){function n(t,r,i){var s,o,a,l,u=this;(u=e.call(this,t,"MESG",i)||this).message=new er(t,i);var c=O.of(t).sdkState;return u.isMentioned=Dl(u.message.mentionType,(a=(s=u.message.mentionedUserIds)!==null&&s!==void 0?s:(o=u.message.mentionedUsers)===null||o===void 0?void 0:o.map(function(d){return d.userId}))!==null&&a!==void 0?a:[],c.userId),u.forceUpdateLastMessage=(l=i.force_update_last_message)!==null&&l!==void 0&&l,u}return T(n,e),n}(gt),ty=function(e){function n(t){var r=null;return t.mentionType===rr.USERS&&(t.mentionedUserIds?r=t.mentionedUserIds:t.mentionedUsers&&(r=t.mentionedUsers.map(function(i){return i.userId}))),e.call(this,{code:"MEDI",ackRequired:!0,payload:ye(Ie({channel_url:t.channelUrl,msg_id:t.messageId,message:t.message,data:t.data,custom_type:t.customType,metaarray:t.metaArrayParams,mention_type:t.mentionType,mentioned_user_ids:r,mentioned_message_template:t.mentionedMessageTemplate,apple_critical_alert_options:t.appleCriticalAlertOptions?Oi.payloadify(t.appleCriticalAlertOptions):null,poll_id:t.pollId}))})||this}return T(n,e),n}(wr),dm=function(e){function n(t,r,i){var s,o,a,l,u,c=this;(c=e.call(this,t,"MEDI",i)||this).message=new er(t,i);var d=O.of(t).sdkState;return c.mentionCountChange=Gg({mentionType:(s=i.old_values)===null||s===void 0?void 0:s.mention_type,mentionedUserIds:(a=(o=i.old_values)===null||o===void 0?void 0:o.mentioned_user_ids)!==null&&a!==void 0?a:[]},Ie({mentionType:c.message.mentionType,mentionedUserIds:(l=c.message.mentionedUserIds)!==null&&l!==void 0?l:(u=c.message.mentionedUsers)===null||u===void 0?void 0:u.map(function(h){return h.userId})}),d.userId),c}return T(n,e),n}(gt),ny=function(e){function n(t){var r=null;return t.mentionType===rr.USERS&&(t.mentionedUserIds?r=t.mentionedUserIds:t.mentionedUsers&&(r=t.mentionedUsers.map(function(i){return i.userId}))),e.call(this,{code:"FEDI",ackRequired:!0,payload:ye(Ie({channel_url:t.channelUrl,msg_id:t.messageId,data:t.data,custom_type:t.customType,metaarray:t.metaArrayParams,mention_type:t.mentionType,mentioned_user_ids:r,apple_critical_alert_options:t.appleCriticalAlertOptions}))})||this}return T(n,e),n}(wr),hm=function(e){function n(t,r,i){var s,o,a,l,u,c=this;(c=e.call(this,t,"FEDI",i)||this).message=new Jt(t,i);var d=O.of(t).sdkState;return c.mentionCountChange=Gg({mentionType:(s=i.old_values)===null||s===void 0?void 0:s.mention_type,mentionedUserIds:(a=(o=i.old_values)===null||o===void 0?void 0:o.mentioned_user_ids)!==null&&a!==void 0?a:[]},Ie({mentionType:c.message.mentionType,mentionedUserIds:(l=c.message.mentionedUserIds)!==null&&l!==void 0?l:(u=c.message.mentionedUsers)===null||u===void 0?void 0:u.map(function(h){return h.userId})}),d.userId),c}return T(n,e),n}(gt),tx=function(e){function n(t){var r=t.channelType,i=t.channelUrl,s=t.messageId,o=t.reactionKey,a=e.call(this)||this;return a.method=Z.POST,a.path="".concat(Je(r),"/").concat(encodeURIComponent(i),"/messages/").concat(s,"/reactions"),a.params={reaction:o},a}return T(n,e),n}(J),nx=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.reactionEvent=new ev(r),i}return T(n,e),n}(se),rx=function(e){function n(t){var r=t.channelType,i=t.channelUrl,s=t.messageId,o=t.reactionKey,a=e.call(this)||this;return a.method=Z.DELETE,a.path="".concat(Je(r),"/").concat(encodeURIComponent(i),"/messages/").concat(s,"/reactions"),a.params={reaction:o},a}return T(n,e),n}(J),ix=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.reactionEvent=new ev(x({},r)),i}return T(n,e),n}(se),sx=function(e){function n(t){var r=t.channelType,i=t.channelUrl,s=t.messageId,o=t.translationTargetLanguages,a=e.call(this)||this;return a.method=Z.POST,a.path="".concat(Je(r),"/").concat(encodeURIComponent(i),"/messages/").concat(encodeURIComponent(s),"/translation"),a.params={target_langs:o},a}return T(n,e),n}(J),ox=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.message=new er(t,r),i}return T(n,e),n}(se),ax=function(e){function n(t){var r,i=this;i=e.call(this)||this;var s=[];t.mentionType===rr.USERS&&(t.mentionedUserIds?s=t.mentionedUserIds:t.mentionedUsers&&(s=t.mentionedUsers.map(function(l){return l.userId})));var o=t.channelType,a=t.channelUrl;return i.method=Z.POST,i.path="".concat(Je(o),"/").concat(encodeURIComponent(a),"/scheduled_messages"),i.params=ye(Ie({req_id:t.reqId,scheduled_at:t.scheduledAt,message_type:Ll.USER,message:t.message,custom_type:t.customType,data:t.data,mention_type:t.mentionType,mentioned_user_ids:s,sorted_metaarray:(r=t.metaArrays)===null||r===void 0?void 0:r.map(function(l){return _r.payloadify(l)}),apple_critical_alert_options:t.appleCriticalAlertOptions?Oi.payloadify(t.appleCriticalAlertOptions):null,target_langs:t.translationTargetLanguages,push_option:t.pushNotificationDeliveryOption})),i}return T(n,e),n}(J),mS=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.message=new er(t,r),i}return T(n,e),n}(se),lx=function(e){function n(t){var r,i,s=this;s=e.call(this)||this;var o=[];t.mentionType===rr.USERS&&(t.mentionedUserIds?o=t.mentionedUserIds:t.mentionedUsers&&(o=t.mentionedUsers.map(function(u){return u.userId})));var a=t.channelType,l=t.channelUrl;return s.method=Z.POST,s.path="".concat(Je(a),"/").concat(encodeURIComponent(l),"/scheduled_messages"),s.params=Ie({req_id:t.reqId,scheduled_at:t.scheduledAt,message_type:Ll.FILE,url:t.fileUrl,file_name:t.fileName,file_size:t.fileSize,file_type:t.mimeType,thumbnails:(r=t._thumbnails)===null||r===void 0?void 0:r.map(function(u){return zs.payloadify(u)}),custom_type:t.customType,data:t.data,require_auth:t.requireAuth,mention_type:t.mentionType,mentioned_user_ids:o,sorted_metaarray:(i=t.metaArrays)===null||i===void 0?void 0:i.map(function(u){return _r.payloadify(u)}),apple_critical_alert_options:t.appleCriticalAlertOptions?Oi.payloadify(t.appleCriticalAlertOptions):null,push_option:t.pushNotificationDeliveryOption}),s}return T(n,e),n}(J),ux=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.message=new Jt(t,r),i}return T(n,e),n}(se),cx=function(e){function n(t){var r=t.pollId,i=t.title,s=t.data,o=t.allowUserSuggestion,a=t.allowMultipleVotes,l=t.closeAt,u=e.call(this)||this;return u.method=Z.PUT,u.path="".concat(Ki,"/").concat(encodeURIComponent(r)),u.params={title:i,data:s,allow_user_suggestion:o,allow_multiple_votes:a,close_at:l},u}return T(n,e),n}(J),dx=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.poll=new xi(t,r),i}return T(n,e),n}(se),hx=function(e){function n(t){var r=t.pollId,i=e.call(this)||this;return i.method=Z.DELETE,i.path="".concat(Ki,"/").concat(encodeURIComponent(r)),i}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var fx=function(e){function n(t){var r=t.pollId,i=e.call(this)||this;return i.method=Z.PUT,i.path="".concat(Ki,"/").concat(encodeURIComponent(r),"/close"),i}return T(n,e),n}(J),px=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.poll=new xi(t,r),i}return T(n,e),n}(se),_x=function(e){function n(t){var r=t.channelUrl,i=t.channelType,s=t.pollId,o=t.optionText,a=e.call(this)||this;return a.method=Z.POST,a.path="".concat(Ki,"/").concat(encodeURIComponent(s),"/options"),a.params={channel_url:r,channel_type:i,text:o},a}return T(n,e),n}(J),mx=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.poll=new xi(t,r),i}return T(n,e),n}(se),gx=function(e){function n(t){var r=t.pollId,i=t.pollOptionId,s=t.optionText,o=e.call(this)||this;return o.method=Z.PUT,o.path="".concat(Ki,"/").concat(encodeURIComponent(r),"/options/").concat(encodeURIComponent(i)),o.params={text:s},o}return T(n,e),n}(J),vx=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.poll=new xi(t,r),i}return T(n,e),n}(se),yx=function(e){function n(t){var r=t.pollId,i=t.pollOptionId,s=e.call(this)||this;return s.method=Z.DELETE,s.path="".concat(Ki,"/").concat(encodeURIComponent(r),"/options/").concat(encodeURIComponent(i)),s}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var Ex=function(e){function n(t){var r=t.reqId,i=t.channelType,s=t.channelUrl,o=t.pollId,a=t.pollOptionIds;return e.call(this,{code:"VOTE",ackRequired:!0,payload:ye({req_id:r,channel_type:i===Ze.OPEN?"open_channels":"group_channels",channel_url:s,poll_id:o,option_ids:a})})||this}return T(n,e),n}(wr),gS=function(e){function n(t,r,i){var s=e.call(this,t,"VOTE",i)||this;return s.event=new R6(i),s.channelUrl=i.channel_url,s.channelType=i.channel_type,s}return T(n,e),n}(gt),vS=100,yS="GroupChannel",bx="url",ES=100,fm="Message",Cx="messageId",bS="NotificationMessage",Sx="notificationId",Tx="Poll",wx="pollId",Nx="FeedChannel",Ix="url";function Ax(e){var n,t,r;return(n=e.messageParams)!==null&&n!==void 0?n:Ie(x(x({},e),{isReplyToChannel:!1,mentionedUserIds:(t=e.mentionedUserIds)!==null&&t!==void 0?t:(r=e.mentionedUsers)===null||r===void 0?void 0:r.map(function(i){return i.userId}),pushNotificationDeliveryOption:Wi.DEFAULT,isPinnedMessage:!1,fileInfoList:e.fileInfoList.map(function(i){var s;return{fileUrl:i.plainUrl,fileName:i.fileName,fileSize:i.fileSize,mimeType:i.mimeType,thumbnailSizes:(s=i.thumbnails)===null||s===void 0?void 0:s.map(function(o){return{maxWidth:o.width,maxHeight:o.height}}),_thumbnails:i.thumbnails,_uploadedMetaData:{requireAuth:i._requireAuth,isUploaded:!0}}})}))}var Zn,Mx=x(x({},u0),{fileInfoList:[]}),xx=function(e){return(pr(e.file)||R("string",e.fileUrl))&&R("string",e.fileName,!0)&&R("string",e.mimeType,!0)&&R("number",e.fileSize,!0)&&(e.thumbnailSizes===void 0||Array.isArray(e.thumbnailSizes)&&e.thumbnailSizes.every(function(n){return n.maxWidth>0&&n.maxHeight>0}))},ph=function(e){function n(){var t=e!==null&&e.apply(this,arguments)||this;return t._onFileUploaded=qe,t}return T(n,e),n.prototype._triggerOnFileUploaded=function(t,r,i,s){this._onFileUploaded(t,r,i,s)},n.prototype.onFileUploaded=function(t){return this._onFileUploaded=t,this},n.prototype.onPending=function(t){return e.prototype.onPending.call(this,t),this},n.prototype.onFailed=function(t){return e.prototype.onFailed.call(this,t),this},n.prototype.onSucceeded=function(t){return e.prototype.onSucceeded.call(this,t),this},n}(Br),Ox=2;(function(e){e.SEND="send",e.RESEND="resend",e.COPY="copy"})(Zn||(Zn={}));var St,ry=function(e){function n(t,r){var i,s,o,a,l,u,c=this;return(c=e.call(this,t)||this)._name="",c._createdAt=0,c.channelType=Ze.BASE,c.coverUrl="",c.customType="",c.data="",c.isFrozen=!1,c.isEphemeral=!1,c.creator=null,c._messageCollectionLastAccessedAt=0,c._url=r.channel_url,c._name=(i=r.name)!==null&&i!==void 0?i:"",c._createdAt=1e3*r.created_at,c.coverUrl=(s=r.cover_url)!==null&&s!==void 0?s:"",c.customType=(o=r.custom_type)!==null&&o!==void 0?o:"",c.data=(a=r.data)!==null&&a!==void 0?a:"",c.isFrozen=(l=r.freeze)!==null&&l!==void 0&&l,c.isEphemeral=(u=r.is_ephemeral)!==null&&u!==void 0&&u,c.creator=r.created_by?new Ke(c._iid,r.created_by):null,r.metadata&&Object.keys(r.metadata).length>0&&r.ts&&(c._cachedMetaData=new Map,Object.keys(r.metadata).forEach(function(d){c._cachedMetaData.set(d,{value:r.metadata[d],isRemoved:!1,updatedAt:r.ts})})),c}return T(n,e),Object.defineProperty(n.prototype,"url",{get:function(){return this._url},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"createdAt",{get:function(){return this._createdAt},enumerable:!1,configurable:!0}),n.prototype.toJSON=function(){return x(x({},this),{url:this._url,name:this._name,createdAt:this._createdAt})},n.payloadify=function(t){return ye(Ie(x(x({},e.payloadify.call(this,t)),{channel_url:t.url,name:t.name,cover_url:t.coverUrl,custom_type:t.customType,data:t.data,freeze:t.isFrozen,is_ephemeral:t.isEphemeral,created_by:t.creator?Ke.payloadify(t.creator):null,created_at:t.createdAt/1e3})))},n.prototype.isGroupChannel=function(){return this.channelType===Ze.GROUP},n.prototype.isOpenChannel=function(){return this.channelType===Ze.OPEN},n.prototype.isFeedChannel=function(){return this.channelType===Ze.FEED},Object.defineProperty(n.prototype,"cachedMetaData",{get:function(){var t={};return this._cachedMetaData&&this._cachedMetaData.forEach(function(r,i){r.isRemoved||(t[i]=r.value)}),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"messageCollectionLastAccessedAt",{get:function(){return this._messageCollectionLastAccessedAt},enumerable:!1,configurable:!0}),n.prototype._updateMessageCollectionLastAccessedAt=function(){this._messageCollectionLastAccessedAt=Date.now()},n.prototype._update=function(t){var r=ye(t);Object.assign(this,r)},n.prototype._upsertCachedMetaData=function(t,r){var i=this;Object.keys(t).forEach(function(s){i._cachedMetaData||(i._cachedMetaData=new Map);var o=i._cachedMetaData.get(s);(!o||o.updatedAt<=r)&&i._cachedMetaData.set(s,{value:t[s],isRemoved:!1,updatedAt:r})})},n.prototype._updateCachedMetaData=function(t,r){var i=this,s=!1;return this._cachedMetaData?this._cachedMetaData.forEach(function(o,a){var l;o.updatedAt<=r&&(i._cachedMetaData.set(a,{value:(l=t[a])!==null&&l!==void 0?l:o.value,isRemoved:!t[a],updatedAt:r}),s=!0)}):(this._cachedMetaData=new Map,Object.keys(t).forEach(function(o){i._cachedMetaData.set(o,{value:t[o],isRemoved:!1,updatedAt:r})}),s=!0),{isUpdated:s}},n.prototype._removeFromCachedMetaData=function(t,r){var i=this;this._cachedMetaData&&t.forEach(function(s){var o=i._cachedMetaData.get(s);o&&o.updatedAt0?{name:t.fileInfoList[0].fileName,size:t.fileInfoList[0].fileSize,type:t.fileInfoList[0].mimeType,data:t.data}:void 0})),o=new li(this._iid,s);return o.messageParams=t,o},n.prototype._validateFailedFileMessageHasFile=function(t,r){var i;return!!t.url||pr(r)||pr((i=t.messageParams)===null||i===void 0?void 0:i.file)},n.prototype._createPendingScheduledFileMessage=function(t,r,i){var s=this._createPendingFileMessage(t,r,i);return s.scheduledInfo={scheduledMessageId:0,scheduledAt:t.scheduledAt,scheduledMessageParams:t},s},n.prototype._markMessageAsFailed=function(t,r,i){i===void 0&&(i=!1),t.errorCode=r.code,r.code===Te.REQUEST_CANCELED||r.code===Te.FILE_UPLOAD_CANCEL_FAILED?t.sendingStatus=ut.CANCELED:i||(t.sendingStatus=ut.FAILED)},n.prototype.sendUserMessage=function(t){var r=x(x({},uS),t);return Y(dS(r)).throw(L.invalidParameters),this._sendUserMessage(r)},n.prototype._sendUserMessage=function(t,r,i){var s=this;r===void 0&&(r=Zn.SEND);var o=O.of(this._iid),a=o.dispatcher,l=o.requestQueue,u=i??this._generateRequestId(),c=Date.now(),d=new Br;return Or(2).then(function(){var h=s._createPendingUserMessage(t,u,c);a.dispatch(new bt({messages:[h],source:r===Zn.RESEND?G.LOCAL_MESSAGE_RESEND_STARTED:G.EVENT_MESSAGE_SENT_PENDING})),Re(function(){return y(s,void 0,void 0,function(){return v(this,function(p){return[2,d._trigger(h)]})})});var f=new ex(x(x({},t),{channelUrl:s.url,channelType:s.channelType,reqId:u}));l.send(f).then(function(p){var g=p.as(_S).message;a.dispatch(new bt({messages:[g],source:G.EVENT_MESSAGE_SENT_SUCCESS})),Re(function(){return y(s,void 0,void 0,function(){return v(this,function(b){return[2,d._trigger(g)]})})})}).catch(function(p){if(Lr(p))throw p;Or(2).then(function(){var g=s._createPendingUserMessage(t,u,c),b=O.of(s._iid).cacheContext,m=b.localCacheEnabled&&b.localCacheConfig.enableAutoResend&&Yh(p.code);s._markMessageAsFailed(g,p,m),a.dispatch(new bt({messages:[g],source:g.sendingStatus===ut.PENDING?G.REQUEST_RESEND_MESSAGE:G.EVENT_MESSAGE_SENT_FAILED})),Re(function(){return y(s,void 0,void 0,function(){return v(this,function(_){return[2,d._triggerFailed(p,g)]})})})})})}),d},n.prototype._autoResendUserMessage=function(t){return Y(t instanceof er&&!!t.messageParams).throw(L.invalidParameters),this._sendUserMessage(t.messageParams,Zn.SEND,t.reqId)},n.prototype.resendUserMessage=function(t){var r;return y(this,void 0,void 0,function(){var i,s;return v(this,function(o){return Y(t instanceof er&&!t.scheduledInfo).throw(L.invalidParameters),i=new Tr,s=(r=t.messageParams)!==null&&r!==void 0?r:um(t),this._sendUserMessage(s,Zn.RESEND,t.reqId).onFailed(function(a){return i.reject(a)}).onSucceeded(function(a){return i.resolve(a)}),[2,i.promise]})})},n.prototype.updateUserMessage=function(t,r){return y(this,void 0,void 0,function(){var i,s,o,a;return v(this,function(l){switch(l.label){case 0:return i=x(x({},fS),r),Y(R("number",t)&&pS(i)).throw(L.invalidParameters),s=O.of(this._iid).requestQueue,o=new ty(x({channelType:this.channelType,channelUrl:this.url,messageId:t,metaArrayParams:i.metaArrays?{array:i.metaArrays,mode:"add",upsert:!0}:void 0},i)),[4,s.send(o)];case 1:return a=l.sent(),[2,a.as(dm).message]}})})},n.prototype.copyUserMessage=function(t,r){var i,s,o;return y(this,void 0,void 0,function(){var a,l;return v(this,function(u){return Y(t instanceof n&&r instanceof er&&r.sendingStatus===ut.SUCCEEDED&&this.url===r.channelUrl&&!r.scheduledInfo).throw(L.invalidParameters),Y(!r.poll).throw(L.notSupportedError),a=new Tr,l=(i=r.messageParams)!==null&&i!==void 0?i:Ie(x(x({},r),{mentionType:r.mentionType,mentionedUserIds:(s=r.mentionedUserIds)!==null&&s!==void 0?s:(o=r.mentionedUsers)===null||o===void 0?void 0:o.map(function(c){return c.userId}),translationTargetLanguages:Object.keys(r.translations),pushNotificationDeliveryOption:Wi.DEFAULT,parentMessageId:null,isReplyToChannel:!1,isPinnedMessage:!1})),t._sendUserMessage(l).onSucceeded(function(c){a.resolve(c)}).onFailed(function(c){return a.reject(c)}),[2,a.promise]})})},n.prototype.translateUserMessage=function(t,r){return y(this,void 0,void 0,function(){var i,s,o;return v(this,function(a){switch(a.label){case 0:return Y(t instanceof er&&t.messageId>0&&We("string",r)).throw(L.invalidParameters),i=O.of(this._iid).requestQueue,s=new sx({channelType:this.channelType,channelUrl:this.url,messageId:t.messageId,translationTargetLanguages:r}),[4,i.send(s)];case 1:return o=a.sent(),[2,o.as(ox).message]}})})},n.prototype._createScheduledUserMessage=function(t,r){var i=this,s=O.of(this._iid).requestQueue,o=Date.now(),a=this._generateRequestId();Or(2).then(function(){var u=i._createPendingScheduledUserMessage(t,a,o);Re(function(){return y(i,void 0,void 0,function(){return v(this,function(c){return[2,r._trigger(u)]})})})});var l=new ax(x({reqId:a,channelType:this.channelType,channelUrl:this.url},t));s.send(l).then(function(u){var c=u.as(mS).message;Re(function(){return y(i,void 0,void 0,function(){return v(this,function(d){return[2,r._trigger(c)]})})})}).catch(function(u){if(Lr(u))throw u;Or(2).then(function(){var c=i._createPendingScheduledUserMessage(t,a,o);i._markMessageAsFailed(c,u),Re(function(){return y(i,void 0,void 0,function(){return v(this,function(d){return[2,r._triggerFailed(u,c)]})})})})})},n.prototype.sendFileMessage=function(t){var r=x(x({},K1),t);return Y(Q1(r)).throw(L.invalidParameters),this._sendFileMessage(r)},n.prototype.sendMultipleFilesMessage=function(t){var r,i=x(x({},Mx),t),s=O.of(this._iid);Y(function(a,l){return l===void 0&&(l=d6),c0(a)&&Array.isArray(a.fileInfoList)&&a.fileInfoList.length>=2&&a.fileInfoList.length<=l&&a.fileInfoList.every(function(u){return xx(u)})}(i,(r=s.appInfo)===null||r===void 0?void 0:r.multipleFilesMessageFileCountLimit)).throw(L.invalidParameters);var o=!!t.fileInfoList.find(function(a){var l=s.appInfo.uploadSizeLimit;return a.file instanceof Blob&&a.file.size>l||a.fileSize>l});return Y(!o).throw(L.fileSizeLimitExceededError),this._sendMultipleFilesMessage(i)},n.prototype._sendFileMessage=function(t,r,i){var s=this;r===void 0&&(r=Zn.SEND);var o=O.of(this._iid).dispatcher,a=An.of(this._iid).fileMessageQueue,l=i??this._generateRequestId(),u=Date.now(),c=new Br;return Or(2).then(function(){var d=s._createPendingFileMessage(t,l,u);o.dispatch(new bt({messages:[d],source:r===Zn.RESEND?G.LOCAL_MESSAGE_RESEND_STARTED:G.EVENT_MESSAGE_SENT_PENDING})),Re(function(){return y(s,void 0,void 0,function(){return v(this,function(h){return[2,c._trigger(d)]})})}),a.request(s,l,t).then(function(h){o.dispatch(new bt({messages:[h],source:G.EVENT_MESSAGE_SENT_SUCCESS})),Re(function(){return y(s,void 0,void 0,function(){return v(this,function(f){return[2,c._trigger(h)]})})})}).catch(function(h){if(Lr(h))throw h;Or(2).then(function(){var f=s._createPendingFileMessage(t,l,u),p=O.of(s._iid).cacheContext,g=p.localCacheEnabled&&p.localCacheConfig.enableAutoResend&&Yh(h.code);s._markMessageAsFailed(f,h,g),o.dispatch(new bt({messages:[f],source:f.sendingStatus===ut.PENDING?G.REQUEST_RESEND_MESSAGE:h.code===Te.FILE_UPLOAD_CANCEL_FAILED?G.LOCAL_MESSAGE_CANCELED:G.EVENT_MESSAGE_SENT_FAILED})),Re(function(){return y(s,void 0,void 0,function(){return v(this,function(b){return[2,c._triggerFailed(h,f)]})})})})})}),c},n.prototype._autoResendFileMessage=function(t){Y(t instanceof Jt&&!!t.messageParams).throw(L.invalidParameters);var r=O.of(this._iid).logger;return r.debug("autoResendFileMessage pending",t),this._sendFileMessage(t.messageParams,Zn.SEND,t.reqId).onFailed(function(i){r.debug("autoResendFileMessage failed",i)}).onSucceeded(function(i){r.debug("autoResendFileMessage success",i)})},n.prototype._sendMultipleFilesMessage=function(t,r,i){var s=this,o=O.of(this._iid).dispatcher,a=An.of(this._iid).fileMessageQueue,l=i??this._generateRequestId(),u=Date.now(),c=new ph;return Or(2).then(function(){var d=s._createPendingMultipleFilesMessage(t,l,u);o.dispatch(new bt({messages:[d],source:r===Zn.RESEND?G.LOCAL_MESSAGE_RESEND_STARTED:G.EVENT_MESSAGE_SENT_PENDING})),Re(function(){return y(s,void 0,void 0,function(){return v(this,function(h){return[2,c._trigger(d)]})})}),a.request(s,l,t,{requestHandler:c,isCopy:r===Zn.COPY}).then(function(h){o.dispatch(new bt({messages:[h],source:G.EVENT_MESSAGE_SENT_SUCCESS})),Re(function(){return y(s,void 0,void 0,function(){return v(this,function(f){return[2,c._trigger(h)]})})})}).catch(function(h){if(Lr(h))throw h;Or(2).then(function(){var f=s._createPendingMultipleFilesMessage(t,l,u);s._markMessageAsFailed(f,h),o.dispatch(new bt({messages:[f],source:G.EVENT_MESSAGE_SENT_FAILED})),Re(function(){return y(s,void 0,void 0,function(){return v(this,function(p){return[2,c._triggerFailed(h,f)]})})})})})}),c},n.prototype._createScheduledFileMessage=function(t,r,i,s){var o=this,a=O.of(this._iid).requestQueue,l=new lx(x(x({reqId:i,channelType:this.channelType,channelUrl:this.url},t),{fileUrl:t.fileUrl,requireAuth:t.requireAuth}));a.send(l).then(function(u){var c=u.as(ux).message;Re(function(){return y(o,void 0,void 0,function(){return v(this,function(d){return[2,r._trigger(c)]})})})}).catch(function(u){if(Lr(u))throw u;Or(2).then(function(){var c=o._createPendingScheduledFileMessage(t,i,s);o._markMessageAsFailed(c,u),Re(function(){return y(o,void 0,void 0,function(){return v(this,function(d){return[2,r._triggerFailed(u,c)]})})})})})},n.prototype.sendFileMessages=function(t){var r,i;Y(t.every(function(u){return Q1(x(x({},K1),u))})).throw(L.invalidParameters);var s=new Br;try{for(var o=pe(t),a=o.next();!a.done;a=o.next()){var l=a.value;this.sendFileMessage(l).onPending(function(u){return s._trigger(u)}).onFailed(function(u,c){return s._triggerFailed(u,c)}).onSucceeded(function(u){return s._trigger(u)})}}catch(u){r={error:u}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s},n.prototype.resendFileMessage=function(t,r){return y(this,void 0,void 0,function(){var i,s,o;return v(this,function(a){return i=this._validateFailedFileMessageHasFile(t,r),Y(t instanceof Jt&&i&&!t.scheduledInfo).throw(L.invalidParameters),s=new Tr,o=cm(t,r),this._sendFileMessage(o,Zn.RESEND,t.reqId).onFailed(function(l){return s.reject(l)}).onSucceeded(function(l){return s.resolve(l)}),[2,s.promise]})})},n.prototype.resendMessage=function(t,r){var i,s;if(Y(t instanceof Ft&&!t.scheduledInfo&&t.isResendable).throw(L.invalidParameters),t.isUserMessage()){var o=(i=t.messageParams)!==null&&i!==void 0?i:um(t);return this._sendUserMessage(o,Zn.RESEND,t.reqId)}if(t.isFileMessage()){var a=this._validateFailedFileMessageHasFile(t,r);return Y(a).throw(L.invalidParameters),o=(s=t.messageParams)!==null&&s!==void 0?s:cm(t,r),this._sendFileMessage(o,Zn.RESEND,t.reqId)}if(t.isMultipleFilesMessage())throw L.channelTypeNotSupportedError},n.prototype.updateFileMessage=function(t,r){return y(this,void 0,void 0,function(){var i,s,o,a;return v(this,function(l){switch(l.label){case 0:return i=x(x({},fM),r),Y(R("number",t)&&function(u){return nv(u)}(i)).throw(L.invalidParameters),s=O.of(this._iid).requestQueue,o=new ny(x({channelType:this.channelType,channelUrl:this.url,messageId:t,metaArrayParams:i.metaArrays?{array:i.metaArrays,mode:"add",upsert:!0}:void 0},i)),[4,s.send(o)];case 1:return a=l.sent(),[2,a.as(hm).message]}})})},n.prototype.uploadFile=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return r=O.of(this._iid).requestQueue,i=Bs(),(s=new af({file:t.file,channelUrl:this.url,thumbnailSizes:t.thumbnailSizes,requestId:i})).uploadProgressHandler=t.progressHandler,t.uploadStartedHandler&&t.uploadStartedHandler(i),[4,r.send(s)];case 1:return o=c.sent(),a=o.as(lf),l=a.url,u=a.thumbnails,[2,{requestId:i,url:l,thumbnails:u}]}})})},n.prototype.cancelUploadingFileMessage=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){return Y(R("string",t)).throw(L.invalidParameters),An.of(this._iid).fileMessageQueue.cancel(this,t),[2,!0]})})},n.prototype.copyFileMessage=function(t,r){var i,s,o;return y(this,void 0,void 0,function(){var a,l;return v(this,function(u){return Y(t instanceof n&&r instanceof Jt&&r.sendingStatus===ut.SUCCEEDED&&this.url===r.channelUrl&&!r.scheduledInfo).throw(L.invalidParameters),a=new Tr,l=Ie(x(x({},r),{fileUrl:r.url,fileName:r.name,fileSize:r.size,mimeType:r.type,mentionType:r.mentionType,mentionedUserIds:(i=r.mentionedUserIds)!==null&&i!==void 0?i:(s=r.mentionedUsers)===null||s===void 0?void 0:s.map(function(c){return c.userId}),pushNotificationDeliveryOption:Wi.DEFAULT,parentMessageId:null,isReplyToChannel:!1,thumbnailSizes:(o=r.thumbnails)===null||o===void 0?void 0:o.map(function(c){return{maxWidth:c.width,maxHeight:c.height}}),requireAuth:r.requireAuth,isPinnedMessage:!1})),t._sendFileMessage(l).onSucceeded(function(c){return a.resolve(c)}).onFailed(function(c){return a.reject(c)}),[2,a.promise]})})},n.prototype.copyMessage=function(t,r){Y(t instanceof n&&r instanceof Ft&&r.sendingStatus===ut.SUCCEEDED&&this.url===r.channelUrl&&!r.scheduledInfo).throw(L.invalidParameters);var i=r,s=t;if(i.isUserMessage()){Y(!i.poll).throw(L.notSupportedError);var o=cS(i);return s._sendUserMessage(o)}if(i.isFileMessage())return o=hS(i),s._sendFileMessage(o);if(r.isMultipleFilesMessage())throw L.channelTypeNotSupportedError},n.prototype.deleteMessage=function(t){return y(this,void 0,void 0,function(){var r,i;return v(this,function(s){switch(s.label){case 0:return Y(t instanceof hr).throw(L.invalidParameters),t.messageId>0?(r=O.of(this._iid).requestQueue,i=new _C({channelType:this.channelType,channelUrl:this.url,messageId:t.messageId,messageToken:t instanceof Ft?t._messageToken:void 0}),[4,r.send(i)]):[3,2];case 1:s.sent(),s.label=2;case 2:return[2]}})})},n.prototype.addReaction=function(t,r){return y(this,void 0,void 0,function(){var i,s,o;return v(this,function(a){switch(a.label){case 0:return Y(t instanceof hr&&t.messageId>0&&R("string",r)).throw(L.invalidParameters),i=O.of(this._iid).requestQueue,s=new tx({channelType:this.channelType,channelUrl:this.url,messageId:t.messageId,reactionKey:r}),[4,i.send(s)];case 1:return o=a.sent(),[2,o.as(nx).reactionEvent]}})})},n.prototype.deleteReaction=function(t,r){return y(this,void 0,void 0,function(){var i,s,o;return v(this,function(a){switch(a.label){case 0:return Y(t instanceof hr&&t.messageId>0&&R("string",r)).throw(L.invalidParameters),i=O.of(this._iid).requestQueue,s=new rx({channelType:this.channelType,channelUrl:this.url,messageId:t.messageId,reactionKey:r}),[4,i.send(s)];case 1:return o=a.sent(),[2,o.as(ix).reactionEvent]}})})},n.prototype._updateUserMessageMetaArray=function(t,r,i,s){return y(this,void 0,void 0,function(){var o,a,l,u,c,d;return v(this,function(h){switch(h.label){case 0:return o=O.of(this._iid),a=o.dispatcher,l=o.requestQueue,u=new ty({channelType:this.channelType,channelUrl:this.url,messageId:t,metaArrayParams:{array:r,mode:i,upsert:s}}),[4,l.send(u)];case 1:return c=h.sent(),d=c.as(dm).message,a.dispatch(new bt({messages:[d],source:G.EVENT_MESSAGE_UPDATED})),[2,d]}})})},n.prototype._updateFileMessageMetaArray=function(t,r,i,s){return y(this,void 0,void 0,function(){var o,a,l,u,c,d;return v(this,function(h){switch(h.label){case 0:return o=O.of(this._iid),a=o.dispatcher,l=o.requestQueue,u=new ny({channelType:this.channelType,channelUrl:this.url,messageId:t,metaArrayParams:{array:r,mode:i,upsert:s}}),[4,l.send(u)];case 1:return c=h.sent(),d=c.as(hm).message,a.dispatch(new bt({messages:[d],source:G.EVENT_MESSAGE_UPDATED})),[2,d]}})})},n.prototype.createMessageMetaArrayKeys=function(t,r){return y(this,void 0,void 0,function(){var i;return v(this,function(s){return Y(t instanceof hr&&t.messageId>0&&We("string",r)).throw(L.invalidParameters),i=r.map(function(o){return new _r({key:o})}),t instanceof Jt?[2,this._updateFileMessageMetaArray(t.messageId,i,"add",!0)]:[2,this._updateUserMessageMetaArray(t.messageId,i,"add",!0)]})})},n.prototype.deleteMessageMetaArrayKeys=function(t,r){return y(this,void 0,void 0,function(){var i;return v(this,function(s){return Y(t instanceof hr&&t.messageId>0&&We("string",r)).throw(L.invalidParameters),i=r.map(function(o){return new _r({key:o})}),t instanceof Jt?[2,this._updateFileMessageMetaArray(t.messageId,i,"remove",!0)]:[2,this._updateUserMessageMetaArray(t.messageId,i,"remove",!0)]})})},n.prototype.addMessageMetaArrayValues=function(t,r){return y(this,void 0,void 0,function(){return v(this,function(i){return Y(t instanceof hr&&t.messageId>0&&r.every(function(s){return s instanceof _r})).throw(L.invalidParameters),t instanceof Jt?[2,this._updateFileMessageMetaArray(t.messageId,r,"add",!0)]:[2,this._updateUserMessageMetaArray(t.messageId,r,"add",!0)]})})},n.prototype.removeMessageMetaArrayValues=function(t,r){return y(this,void 0,void 0,function(){return v(this,function(i){return Y(t instanceof hr&&t.messageId>0&&r.every(function(s){return s instanceof _r})).throw(L.invalidParameters),t instanceof Jt?[2,this._updateFileMessageMetaArray(t.messageId,r,"remove",!0)]:[2,this._updateUserMessageMetaArray(t.messageId,r,"remove",!0)]})})},n.prototype.report=function(t,r){return y(this,void 0,void 0,function(){var i,s,o,a;return v(this,function(l){switch(l.label){case 0:return Y($e(nc,t)&&R("string",r)).throw(L.invalidParameters),i=O.of(this._iid),s=i.sdkState,o=i.requestQueue,a=new ZM({channelUrl:this.url,channelType:this.channelType,userId:s.userId,category:t,description:r}),[4,o.send(a)];case 1:return l.sent(),[2]}})})},n.prototype.reportUser=function(t,r,i){return y(this,void 0,void 0,function(){var s,o,a,l;return v(this,function(u){switch(u.label){case 0:return Y(t instanceof Ke&&$e(nc,r)&&R("string",i)).throw(L.invalidParameters),s=O.of(this._iid),o=s.sdkState,a=s.requestQueue,l=new XM({channelUrl:this.url,channelType:this.channelType,userId:o.userId,offendingUserId:t.userId,category:r,description:i}),[4,a.send(l)];case 1:return u.sent(),[2]}})})},n.prototype.reportMessage=function(t,r,i){return y(this,void 0,void 0,function(){var s,o,a,l;return v(this,function(u){switch(u.label){case 0:return Y(t instanceof Ft&&$e(nc,r)&&R("string",i)).throw(L.invalidParameters),s=O.of(this._iid),o=s.sdkState,a=s.requestQueue,l=new JM({channelUrl:this.url,channelType:this.channelType,userId:o.userId,offendingUserId:t.sender.userId,messageId:t.messageId,category:r,description:i,messageToken:t._messageToken}),[4,a.send(l)];case 1:return u.sent(),[2]}})})},n.prototype.updatePoll=function(t,r){return y(this,void 0,void 0,function(){var i,s,o;return v(this,function(a){switch(a.label){case 0:return Y(R("number",t)&&function(l){return R("string",l.title,!0)&&QC(l.data)&&R("boolean",l.allowUserSuggestion,!0)&&R("boolean",l.allowMultipleVotes,!0)&&R("number",l.closeAt,!0)}(r)).throw(L.invalidParameters),i=O.of(this._iid).requestQueue,s=new cx(x({pollId:t},r)),[4,i.send(s)];case 1:return o=a.sent(),[2,o.as(dx).poll]}})})},n.prototype.deletePoll=function(t){return y(this,void 0,void 0,function(){var r,i,s;return v(this,function(o){switch(o.label){case 0:return r=R("number",t),Y(r).throw(L.invalidParameters),i=O.of(this._iid).requestQueue,s=new hx({pollId:t}),[4,i.send(s)];case 1:return o.sent(),[2]}})})},n.prototype.closePoll=function(t){return y(this,void 0,void 0,function(){var r,i,s,o;return v(this,function(a){switch(a.label){case 0:return r=R("number",t),Y(r).throw(L.invalidParameters),i=O.of(this._iid).requestQueue,s=new fx({pollId:t}),[4,i.send(s)];case 1:return o=a.sent(),[2,o.as(px).poll]}})})},n.prototype.addPollOption=function(t,r){return y(this,void 0,void 0,function(){var i,s,o,a;return v(this,function(l){switch(l.label){case 0:return i=R("number",t)&&R("string",r)&&r.trim()!=="",Y(i).throw(L.invalidParameters),s=O.of(this._iid).requestQueue,o=new _x({channelUrl:this.url,channelType:this.channelType,pollId:t,optionText:r}),[4,s.send(o)];case 1:return a=l.sent(),[2,a.as(mx).poll]}})})},n.prototype.updatePollOption=function(t,r,i){return y(this,void 0,void 0,function(){var s,o,a,l;return v(this,function(u){switch(u.label){case 0:return s=R("number",t)&&R("number",r)&&R("string",i)&&i.trim()!=="",Y(s).throw(L.invalidParameters),o=O.of(this._iid).requestQueue,a=new gx({pollId:t,pollOptionId:r,optionText:i}),[4,o.send(a)];case 1:return l=u.sent(),[2,l.as(vx).poll]}})})},n.prototype.deletePollOption=function(t,r){return y(this,void 0,void 0,function(){var i,s,o;return v(this,function(a){switch(a.label){case 0:return i=R("number",t)&&R("number",r),Y(i).throw(L.invalidParameters),s=O.of(this._iid).requestQueue,o=new yx({pollId:t,pollOptionId:r}),[4,s.send(o)];case 1:return a.sent(),[2]}})})},n.prototype.votePoll=function(t,r){return y(this,void 0,void 0,function(){var i,s,o,a,l,u,c;return v(this,function(d){switch(d.label){case 0:return i=R("number",t)&&We("number",r),Y(i).throw(L.invalidParameters),s=O.of(this._iid),o=s.requestQueue,a=s.dispatcher,l=new Ex({reqId:this._generateRequestId(),channelUrl:this.url,channelType:this.channelType,pollId:t,pollOptionIds:r}),[4,o.send(l)];case 1:return u=d.sent(),c=u.as(gS).event,a.dispatch(new Jg({event:c,source:G.EVENT_POLL_VOTED})),[2,c]}})})},n.prototype.getPollChangeLogsSinceTimestamp=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return Y(R("number",t)).throw(L.invalidParameters),[4,of.of(this._iid).getPollChangeLogs(this.url,this.channelType,t)];case 1:return[2,r.sent()]}})})},n.prototype.getPollChangeLogsSinceToken=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return Y(R("string",t,!0)),[4,of.of(this._iid).getPollChangeLogs(this.url,this.channelType,t)];case 1:return[2,r.sent()]}})})},n.prototype.createPollListQuery=function(t){return t===void 0&&(t=10),new JC(this._iid,{channelUrl:this.url,channelType:this.channelType,limit:t})},n.prototype.createPollVoterListQuery=function(t,r,i){return i===void 0&&(i=20),new eS(this._iid,{channelUrl:this.url,channelType:this.channelType,pollId:t,pollOptionId:r,limit:i})},n}(Kn),CS=function(e){function n(t){t===void 0&&(t={});var r=e.call(this)||this;return Object.keys(t).forEach(function(i){r.hasOwnProperty(i)&&(r[i]=t[i])}),r}return T(n,e),n}(function(){this.onConnected=qe,this.onReconnectStarted=qe,this.onReconnectSucceeded=qe,this.onReconnectFailed=qe,this.onDisconnected=qe}),df=function(e){function n(t){t===void 0&&(t={});var r=e.call(this)||this;return Object.keys(t).forEach(function(i){r.hasOwnProperty(i)&&(r[i]=t[i])}),r}return T(n,e),n}(function(){this.onSessionExpired=qe,this.onSessionTokenRequired=function(e){return e(null)},this.onSessionError=qe,this.onSessionRefreshed=qe,this.onSessionClosed=qe}),kx=function(e){function n(t){t===void 0&&(t={});var r=e.call(this)||this;return Object.keys(t).forEach(function(i){r.hasOwnProperty(i)&&(r[i]=t[i])}),r}return T(n,e),n}(function(){this.onFriendsDiscovered=qe,this.onTotalUnreadMessageCountChanged=qe,this.onTotalUnreadMessageCountUpdated=qe}),Rx=function(e){function n(t){var r=t.limit,i=t.token,s=t.userIdsFilter,o=t.metaDataKeyFilter,a=t.metaDataValuesFilter,l=t.nicknameStartsWithFilter,u=e.call(this)||this;return u.method=Z.GET,u.path=Xe,u.params=ye({limit:r,token:i,user_ids:s,metadatakey:o,metadatavalues_in:a,nickname_startswith:l}),u}return T(n,e),n}(J),Lx=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.users=r.users.map(function(s){return new Ke(t,s)}),i.next=r.next,i}return T(n,e),n}(se),Dx=function(e){function n(t,r){var i,s,o,a=this;return(a=e.call(this,t,r)||this).userIdsFilter=null,a.metaDataKeyFilter=null,a.metaDataValuesFilter=null,a.nicknameStartsWithFilter=null,a.userIdsFilter=(i=r.userIdsFilter)!==null&&i!==void 0?i:null,a.metaDataKeyFilter=(s=r.metaDataKeyFilter)!==null&&s!==void 0?s:null,a.metaDataValuesFilter=(o=r.metaDataValuesFilter)!==null&&o!==void 0?o:null,a.nicknameStartsWithFilter=r.nicknameStartsWithFilter||null,a}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)&&We("string",this.userIdsFilter,!0)&&R("string",this.metaDataKeyFilter,!0)&&We("string",this.metaDataValuesFilter,!0)&&R("string",this.nicknameStartsWithFilter,!0)},n.prototype.next=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,t=O.of(this._iid).requestQueue,r=new Rx(Ie(x(x({},this),{token:this._token}))),[4,t.send(r)]):[3,2]:[3,5];case 1:return i=l.sent(),s=i.as(Lx),o=s.users,a=s.next,this._token=a,this._hasNext=!!a,this._isLoading=!1,[2,o];case 2:return[2,[]];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Uo),Ux=function(e){function n(t){var r=t.userId,i=t.limit,s=t.token,o=t.userIdsFilter,a=e.call(this)||this;return a.method=Z.GET,a.path="".concat(Xe,"/").concat(r,"/block"),a.params=ye({limit:i,token:s,user_ids:o}),a}return T(n,e),n}(J),Px=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.users=r.users.map(function(s){return new Ke(t,s)}),i.next=r.next,i}return T(n,e),n}(se),Fx=function(e){function n(t,r){var i,s=this;return(s=e.call(this,t,r)||this).userIdsFilter=null,s.userIdsFilter=(i=r.userIdsFilter)!==null&&i!==void 0?i:null,s}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)&&We("string",this.userIdsFilter,!0)},n.prototype.next=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new Ux(Ie(x(x({},this),{userId:r.userId,token:this._token}))),[4,i.send(s)]):[3,2]:[3,5];case 1:return o=c.sent(),a=o.as(Px),l=a.users,u=a.next,this._token=u,this._hasNext=!!u,this._isLoading=!1,[2,l];case 2:return[2,[]];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Uo),Hx=function(e){function n(t){var r=t.userId,i=t.limit,s=t.token,o=e.call(this)||this;return o.method=Z.GET,o.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/friends"),o.params={limit:i,token:s},o}return T(n,e),n}(J),jx=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.hasMore=r.has_more,i.users=r.users.map(function(s){return new Ke(t,s)}),i.next=r.next,i}return T(n,e),n}(se),Bx=function(e){function n(){return e!==null&&e.apply(this,arguments)||this}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)},n.prototype.next=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u,c;return v(this,function(d){switch(d.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new Hx(x(x({},this),{userId:r.userId,token:this._token})),[4,i.send(s)]):[3,2]:[3,5];case 1:return o=d.sent(),a=o.as(jx),l=a.users,u=a.hasMore,c=a.next,this._token=c,this._hasNext=u,this._isLoading=!1,[2,l];case 2:return[2,[]];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Uo),Ud={},Zc=function(){function e(n){var t=n.dbname,r=n.itemSizeLimit,i=r===void 0?1048576:r,s=n.cacheLimit,o=s===void 0?256:s,a=n.blockHashBase,l=a===void 0?2:a,u=n.blockHashMultiplier,c=u===void 0?10:u,d=n.blockHashConstant,h=d===void 0?11:d,f=n.transactionApplyDelay,p=f===void 0?200:f,g=n.disableLogger,b=g!==void 0&&g;return Ud[t]||(this.itemSizeLimit=i,this.cacheLimit=o,this.blockHashBase=l,this.blockHashMultiplier=c,this.blockHashConstant=h,this.transactionApplyDelay=p,this.disableLogger=b,Ud[t]=this),Ud[t]}return e.get=function(n){return Ud[n]},e}();(function(e){e[e.UNKNOWN_ERROR=6e7]="UNKNOWN_ERROR",e[e.STORE_NOT_DEFINED=61001e3]="STORE_NOT_DEFINED",e[e.STORE_NOT_AVAILABLE=61001001]="STORE_NOT_AVAILABLE",e[e.STORE_NOT_AVAILABLE_IN_PRIVATE_BROWSING=61001002]="STORE_NOT_AVAILABLE_IN_PRIVATE_BROWSING",e[e.STORE_IS_FULL=61001003]="STORE_IS_FULL",e[e.STORE_NOT_INITIALIZED=61001004]="STORE_NOT_INITIALIZED",e[e.STORE_INVALID_KEY_TYPE=61002e3]="STORE_INVALID_KEY_TYPE",e[e.STORE_BROKEN_INTEGRITY=61002001]="STORE_BROKEN_INTEGRITY",e[e.STORE_BROKEN_BLOB=61002002]="STORE_BROKEN_BLOB",e[e.STORE_ENCRYPTION_INVALID=61002003]="STORE_ENCRYPTION_INVALID",e[e.STORE_ITEM_SIZE_LIMIT_EXCEEDED=61017e3]="STORE_ITEM_SIZE_LIMIT_EXCEEDED",e[e.STORE_READ_FAILED=61017001]="STORE_READ_FAILED",e[e.STORE_WRITE_FAILED=61017002]="STORE_WRITE_FAILED",e[e.DATABASE_SCHEMA_NOT_ON_UPGRADE=62002e3]="DATABASE_SCHEMA_NOT_ON_UPGRADE",e[e.COLLECTION_NOT_READY=63001e3]="COLLECTION_NOT_READY",e[e.COLLECTION_KEY_NOT_MATCH=63002e3]="COLLECTION_KEY_NOT_MATCH",e[e.COLLECTION_QUERY_NOT_VALID=63002001]="COLLECTION_QUERY_NOT_VALID",e[e.COLLECTION_KEY_NOT_FOUND=63004e3]="COLLECTION_KEY_NOT_FOUND",e[e.COLLECTION_KEY_NOT_GIVEN=63004001]="COLLECTION_KEY_NOT_GIVEN",e[e.COLLECTION_INSERT_DUPLICATE=63009e3]="COLLECTION_INSERT_DUPLICATE",e[e.COLLECTION_WRITE_FAILED=63017e3]="COLLECTION_WRITE_FAILED",e[e.COLLECTION_ITEM_SIZE_LIMIT_EXCEEDED=63017001]="COLLECTION_ITEM_SIZE_LIMIT_EXCEEDED",e[e.INDEX_TABLE_IS_REQUIRED=65001e3]="INDEX_TABLE_IS_REQUIRED",e[e.INDEX_TYPE_NOT_MATCH=65002e3]="INDEX_TYPE_NOT_MATCH",e[e.COMPARE_TYPE_NOT_MATCH=69002001]="COMPARE_TYPE_NOT_MATCH",e[e.CIRCULAR_REFERENCE_FOUND=69002002]="CIRCULAR_REFERENCE_FOUND"})(St||(St={}));var la,st=function(e){function n(t){var r=t.code,i=r===void 0?St.UNKNOWN_ERROR:r,s=t.message,o=s===void 0?"Unknown error occurred.":s,a=e.call(this,o)||this;return a.code=i,Object.setPrototypeOf(a,n.prototype),a}return T(n,e),Object.defineProperty(n,"storeNotDefined",{get:function(){return new n({code:St.STORE_NOT_DEFINED,message:"Store is not defined. Specify the store on NestDB()"})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"storeNotAvailable",{get:function(){return new n({code:St.STORE_NOT_AVAILABLE,message:"Store is not available. Check your environment settings."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"storeNotAvailableInPrivateBrowsing",{get:function(){return new n({code:St.STORE_NOT_AVAILABLE_IN_PRIVATE_BROWSING,message:"Store is not available because it is in private browsing."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"storeIsFull",{get:function(){return new n({code:St.STORE_IS_FULL,message:"Store is full."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"storeNotInitialized",{get:function(){return new n({code:St.STORE_NOT_INITIALIZED,message:"Store is not initialized."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"storeKeyTypeIsInvalid",{get:function(){return new n({code:St.STORE_INVALID_KEY_TYPE,message:"Store key should be string type."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"storeBrokenIntegrity",{get:function(){return new n({code:St.STORE_BROKEN_INTEGRITY,message:"Data should be in a store but it does not. Integrity is broken."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"storeBrokenBlob",{get:function(){return new n({code:St.STORE_BROKEN_BLOB,message:"Data should be in a store but it does not. Blob data is broken."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"storeEncryptionInvalid",{get:function(){return new n({code:St.STORE_ENCRYPTION_INVALID,message:"Encryption algorithm has changed. All the store should reset."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"storeItemSizeExceeded",{get:function(){return new n({code:St.STORE_ITEM_SIZE_LIMIT_EXCEEDED,message:"The size of the item exceeds the limit that the store allows."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"storeReadFailed",{get:function(){return new n({code:St.STORE_READ_FAILED,message:"Failed to read from store."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"storeWriteFailed",{get:function(){return new n({code:St.STORE_WRITE_FAILED,message:"Failed to write to store."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"databaseSchemaNotOnUpgrade",{get:function(){return new n({code:St.DATABASE_SCHEMA_NOT_ON_UPGRADE,message:"Committing schema is not allowed when upgrade is not running."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"collectionNotReady",{get:function(){return new n({code:St.COLLECTION_NOT_READY,message:"Collection is not ready due to an error during initialization."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"collectionKeyNotMatch",{get:function(){return new n({code:St.COLLECTION_KEY_NOT_MATCH,message:"keyName of collection could not change."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"collectionQueryNotValid",{get:function(){return new n({code:St.COLLECTION_QUERY_NOT_VALID,message:"Query parameter is not a valid format."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"collectionInsertDuplicate",{get:function(){return new n({code:St.COLLECTION_INSERT_DUPLICATE,message:"The key already exists."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"collectionKeyNotFound",{get:function(){return new n({code:St.COLLECTION_KEY_NOT_FOUND,message:"The key is not found."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"collectionKeyNotGiven",{get:function(){return new n({code:St.COLLECTION_KEY_NOT_GIVEN,message:"The item should contain [keyName] property."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"collectionWriteFailed",{get:function(){return new n({code:St.COLLECTION_WRITE_FAILED,message:"Failed to write an item."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"collectionItemSizeExceeded",{get:function(){return new n({code:St.COLLECTION_ITEM_SIZE_LIMIT_EXCEEDED,message:"The size of the item exceeds the limit that a collection allows."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"indexTableIsRequired",{get:function(){return new n({code:St.INDEX_TABLE_IS_REQUIRED,message:"Index table is required."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"indexTypesNotMatch",{get:function(){return new n({code:St.INDEX_TYPE_NOT_MATCH,message:"Indexed column should have primitive type."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"compareTypesNotMatch",{get:function(){return new n({code:St.COMPARE_TYPE_NOT_MATCH,message:"Values to compare have different types."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"circularReferenceFound",{get:function(){return new n({code:St.CIRCULAR_REFERENCE_FOUND,message:"Cannot handle circular referenced object."})},enumerable:!1,configurable:!0}),n}(Error);(function(e){e.INIT="init",e.READY="ready",e.CLOSED="closed"})(la||(la={}));var iy,kr=function(e,n){if(n===void 0&&(n=new WeakMap),typeof e=="object"&&e!==null){if(n.has(e))throw st.circularReferenceFound;n.set(e,!0);var t=void 0;if(Array.isArray(e))t=e.map(function(i){return kr(i,n)});else if(e instanceof RegExp)t=e;else if(e instanceof Date)t=e;else for(var r in t={},e)t[r]=kr(e[r],n);return n.delete(e),t}return e},Rs=function(e,n){if(n==null)return 1;if(e==null)return-1;if(typeof e!=typeof n)throw st.compareTypesNotMatch;var t=0;switch(typeof e){case"boolean":case"number":t=e-n;break;case"string":t=e.localeCompare(n)}return t},sy=function(e,n){for(var t=0,r=0;r>>0)%n},Pd=function(e){return new Promise(function(n){setTimeout(function(){return n()},e)})},ma=function(e,n){if(!n)return!1;if(typeof e!="function"){for(var t in e)if(["/and","&&"].includes(t)){if(e[t].some(function(l){return!ma(l,n)}))return!1}else if(["/or","||"].includes(t)){if(e[t].every(function(l){return!ma(l,n)}))return!1}else if(t==="/where"){if(!(0,e[t])(n))return!1}else{var r=t;if(typeof e[r]=="object"){var i=e[r];for(var s in i)switch(s){case"/eq":case"=":if((o=n[r])!==(a=i[s]))return!1;break;case"/neq":case"!=":if((o=n[r])===(a=i[s]))return!1;break;case"/gt":case">":var o=n[r],a=i[s];if(!(Rs(o,a)>0))return!1;break;case"/gte":case">=":if(o=n[r],a=i[s],!(Rs(o,a)>=0))return!1;break;case"/lt":case"<":if(o=n[r],a=i[s],!(Rs(o,a)<0))return!1;break;case"/lte":case"<=":if(o=n[r],a=i[s],!(Rs(o,a)<=0))return!1;break;case"/in":if(o=n[r],!(a=i[s]).includes(o))return!1;break;case"/nin":if(o=n[r],(a=i[s]).includes(o))return!1;break;case"/contain":if(o=n[r],a=i[s],!o.includes(a))return!1;break;case"/regex":if(o=n[r],!(a=i[s]).test(o))return!1;break;case"/where":if(o=n[r],!(0,i[s])(o))return!1}}else if(typeof e[r]=="function"){if(!e[r](n[r]))return!1}else if(e[r]!==n[r])return!1}return!0}return e(n)},Au=function(){},oy=function(){return Promise.resolve()},$x=function(e){return e},ay=function(e,n){n()};(function(e){e[e.FORWARD=0]="FORWARD",e[e.BACKWARD=1]="BACKWARD"})(iy||(iy={}));var ga,fr,ts,Gx=function(){function e(n){var t=n.initialPrevValue,r=t===void 0?null:t,i=n.initialNextValue,s=i===void 0?null:i,o=n.iterator,a=n.map,l=a===void 0?$x:a,u=n.backward,c=u===void 0?oy:u,d=n.forward,h=d===void 0?oy:d,f=n.complete,p=f===void 0?Au:f;this._prevValue=r,this._nextValue=s,this._error=null,this._map=l,this._backward=c,this._forward=h,this._iterator=o,this._complete=p}return Object.defineProperty(e.prototype,"prevValue",{get:function(){return this._map(this._prevValue)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextValue",{get:function(){return this._map(this._nextValue)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"error",{get:function(){return this._error},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasPrevious",{get:function(){return!!this._prevValue},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasNext",{get:function(){return!!this._nextValue},enumerable:!1,configurable:!0}),e.prototype.prev=function(){return y(this,void 0,void 0,function(){var n,t,r;return v(this,function(i){switch(i.label){case 0:if(!this.hasPrevious)return[3,6];i.label=1;case 1:return i.trys.push([1,3,,4]),n=this._prevValue,t=this,[4,this._backward()];case 2:return t._prevValue=i.sent()||null,this._nextValue=n,[3,4];case 3:return r=i.sent(),this._error=r,[3,4];case 4:return[4,this._iterator(this)];case 5:return[2,i.sent()];case 6:this._complete(),i.label=7;case 7:return[2]}})})},e.prototype.next=function(){return y(this,void 0,void 0,function(){var n,t,r;return v(this,function(i){switch(i.label){case 0:if(!this.hasNext)return[3,6];i.label=1;case 1:return i.trys.push([1,3,,4]),n=this._nextValue,t=this,[4,this._forward()];case 2:return t._nextValue=i.sent()||null,this._prevValue=n,[3,4];case 3:return r=i.sent(),this._error=r,[3,4];case 4:return[4,this._iterator(this)];case 5:return[2,i.sent()];case 6:this._complete(),i.label=7;case 7:return[2]}})})},e.prototype.stop=function(){this._prevValue=null,this._nextValue=null,this._complete()},e}(),pm=function(){function e(n){var t=n.condition,r=t===void 0?{}:t,i=n.backward,s=i!==void 0&&i,o=n.blockManager,a=n.indexer;this.condition=r,this.backward=s,this._blockManager=o,this._indexer=a}return e.prototype.findOptimizedStartPosition=function(){var n=this,t=["=","/eq",">",">=","/gt","/gte"],r=["=","/eq","<","<=","/lt","/lte"];if(this.backward){var i=this._indexer.origin.length-1;if(typeof this.condition!="function")for(var s in this._indexer.fields){var o=this._indexer.fields[s],a=1;if(o[0]==="-"&&(o=o.slice(1),a=-1),this.condition[o]){if(typeof this.condition[o]=="object"){var l=a>0?r:t;for(var u in this.condition[o])if(l.includes(u)){for(var c=i;c>=0;c--)if(a*Rs(this._indexer.origin[c].columnValues[s],this.condition[o][u])<=0){i=c;break}}}else for(c=i;c>=0;c--)if(a*Rs(this._indexer.origin[c].columnValues[s],this.condition[o])<=0){i=c;break}}}return Math.min(i+1,this._indexer.origin.length-1)}var d=0;if(typeof this.condition!="function")for(var h=function(g){var b=f._indexer.fields[g],m=1;if(b[0]==="-"&&(b=b.slice(1),m=-1),f.condition[b]){if(typeof f.condition[b]=="object")Object.keys(f.condition[b]).forEach(function(E){if((m>0?t:r).includes(E)){for(var S=d;S=0){d=S;break}}});else for(var _=d;_=0){d=_;break}}},f=this,s=0;s"u"?[3,4]:[4,fetch(r)]):[3,5];case 2:return[4,d.sent().blob()];case 3:return[2,d.sent()];case 4:for(s=[],o=atob(r.split(",")[1]),a=0;a-1){var i=this._items[r];return t===ts.PERSISTENT&&(i.state=fr.PERSISTENT),t!==ts.NO_CACHE&&this.put(i),i}return null},e.prototype.put=function(n){var t,r;if(this._limit>0){var i=this._items.map(function(d){return d.key}).indexOf(n.key);if(i>-1)uy.includes(this._items[i].state)&&uy.includes(n.state)?(this._items.splice(i,1),this._items.push(n)):(this._items[i].state=n.state,this._items[i].value=n.value);else{this._items.push(n);var s=this._items.filter(function(d){return d.state===fr.VOLATILE}),o=s.length-this._limit;if(o>0){var a=[];try{for(var l=pe(this._items),u=l.next();!u.done;u=l.next()){var c=u.value;c.state===fr.VOLATILE&&o>0?o--:a.push(c)}}catch(d){t={error:d}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}this._items=a}}}},e.prototype.remove=function(n){var t=this._items.map(function(r){return r.key}).indexOf(n);t>-1&&this._items.splice(t,1)},e.prototype.clearByCondition=function(n){this._items=this._items.filter(function(t){return!n(t)})},e.prototype.clear=function(n){n===void 0&&(n=!1),this._items=n?[]:this._items.filter(function(t){return t.state!==fr.VOLATILE})},e}(),qx=function(){function e(n){var t=n.dbname,r=n.collectionName,i=n.store;this._requests=[],this._onCommit=new Map,this._onWrite=new Map,this._onError=new Map,this.dbname=t,this.collectionName=r,this.metadataKey=function(s,o){return"".concat(Ia(s,o),"/trans.metadata")}(t,r),this.recordsetKey=function(s,o){return"".concat(Ia(s,o),"/trans.recordset")}(t,r),this._store=i}return Object.defineProperty(e.prototype,"generation",{get:function(){return this._metadata?this._metadata.generation:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"requestCount",{get:function(){return this._requests.length},enumerable:!1,configurable:!0}),e.prototype._getReducedRecordset=function(n){return n===void 0&&(n=[]),y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return[4,this._store.get(this.recordsetKey)];case 1:return(t=r.sent()||[]).push.apply(t,De([],Ae(n),!1)),[2,this._reduceRecordSet(t)]}})})},e.prototype._reduceRecordSet=function(n){for(var t=[],r={},i=n.length-1;i>=0;i--){for(var s=n[i],o=[],a=s.requests.length-1;a>=0;a--){var l=s.requests[a],u=l.data;r[u.key]||(o.unshift(l),r[u.key]=!0)}o.length>0&&(s.requests=o,t.unshift(s))}return t},e.prototype._applyRecord=function(n,t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u,c,d;return v(this,function(h){switch(h.label){case 0:r=Si.get(this.dbname),i=t.generation,s=t.requests,o=null,h.label=1;case 1:return h.trys.push([1,3,,4]),[4,this._store.setMany(s.map(function(f){return x(x({},f.data),{generation:i})}))];case 2:for(a=h.sent(),l=0;l0))return[3,4];for(t=[],r={},l=n.length-1;l>=0;l--)i=n[l],c=i.data,r[c.key]||(r[c.key]=!0,t.unshift(i));return s={generation:this.generation,requests:t},[4,this._getReducedRecordset([s])];case 1:return o=p.sent(),[4,this._store.set({key:this.recordsetKey,value:o})];case 2:return p.sent(),this._metadata.generation++,[4,this._store.set({key:this.metadataKey,value:this._metadata})];case 3:for(p.sent(),a=Si.get(this.dbname),l=0;l0?(i=this.createBlockId(n,r),[4,t.find(this._store,i)]):[3,4];case 2:if((s=a.sent())&&(o=_h.createFromCacheItem(s),o==null?void 0:o.getItemByKey(n)))return[2,o];a.label=3;case 3:return r--,[3,1];case 4:return[2,null]}})})},e.prototype.getFromBlock=function(n){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return[4,this._findBlock(n)];case 1:return[2,(t=r.sent())?t.getItemByKey(n):null]}})})},e.prototype.putToBlock=function(n,t){return y(this,void 0,void 0,function(){var r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return r=Zc.get(this.dbname),i=this.createBlockId(n),s=Math.floor(this._store.itemSizeLimit/r.itemSizeLimit),[4,Si.get(this.dbname).find(this._store,i)];case 1:return o=l.sent(),(a=o?_h.createFromCacheItem(o):new _h({blockId:i,keyName:this.keyName,items:[],limit:s}))!=null&&a.add(t)?(this._transaction.requestWrite({key:a.blockId,value:a.serialize()}),[2,!0]):[2,!1]}})})},e.prototype.removeFromBlock=function(n){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return[4,this._findBlock(n)];case 1:return(t=r.sent())&&t.remove(n)?(this._transaction.requestWrite({key:t.blockId,value:t.serialize()}),[2,!0]):[2,!1]}})})},e.prototype.clearAllBlocks=function(){return y(this,void 0,void 0,function(){var n,t,r;return v(this,function(i){switch(i.label){case 0:return n=mm(this.dbname,this.collectionName),[4,this._store.getAllKeys()];case 1:return t=i.sent(),r=t.filter(function(s){return s.startsWith(n)}),[4,this._store.removeMany(r)];case 2:return i.sent(),[4,this._transaction.clear()];case 3:return i.sent(),Si.get(this.dbname).clearByCondition(function(s){return s.key.startsWith(n)}),[2]}})})},e}(),Wa={},Ws=function(){function e(n){var t=n.dbname,r=n.collectionName,i=n.keyName,s=n.fields,o=n.transaction,a=n.store,l=this;this._origin=[],this._table=[];var u=function(c,d,h){return"".concat(Ia(c,d),"/index.").concat(h)}(t,r,s.join(">"));return Wa[u]||(this.dbname=t,this.collectionName=r,this.keyName=i,this.fields=s,this.indexerKey=u,this._transaction=o,this._store=a,this._transaction.on(ga.COMMIT,this.indexerKey,function(){return l.commit()}),this._transaction.on(ga.ERROR,this.indexerKey,function(){return l.abort()})),Wa[u]}return e.createKey=function(n){return n.join(">")},e.parseKey=function(n){return n.split(">")},e.clearIndexerMap=function(){for(var n in Wa)delete Wa[n]},e.prototype._addItem=function(n){var t=n[this.keyName],r=this.getColumnValues(n),i=Ae(this.indexOf(r),2),s=i[0];return i[1]?!this._table[s].keys.includes(t)&&(this._table[s].keys.push(t),!0):(this._table.splice(s,0,{columnValues:r,keys:[t]}),!0)},e.prototype._removeItem=function(n){var t=n[this.keyName],r=this.getColumnValues(n),i=Ae(this.indexOf(r),2),s=i[0];if(i[1]){var o=this._table[s].keys.indexOf(t);if(o>-1)return this._table[s].keys.splice(o,1),this._table[s].keys.length===0&&this._table.splice(s,1),!0}return!1},Object.defineProperty(e.prototype,"origin",{get:function(){return this._origin},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"table",{get:function(){return this._table},enumerable:!1,configurable:!0}),e.prototype.getColumnValues=function(n){var t,r,i,s,o=[];try{for(var a=pe(this.fields),l=a.next();!l.done;l=a.next()){var u=l.value;if(u[0]==="-"&&(u=u.slice(1)),i=n[u],s=void 0,s=typeof i,i!==null&&s!=="undefined"&&s!=="boolean"&&s!=="number"&&s!=="string")throw st.indexTypesNotMatch;o.push(n[u])}}catch(c){t={error:c}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},e.prototype.diff=function(n,t){for(var r in this.fields){var i=this.fields[r][0]==="-"?-1:1,s=Rs(n[r],t[r]);if(s!==0)return i*s}return 0},e.prototype.indexOf=function(n){if(this._table.length>0){for(var t=0,r=this._table.length-1;t<=r;){var i=Math.floor((t+r)/2),s=this.diff(n,this._table[i].columnValues);if(s>0)t=i+1;else{if(!(s<0))return[i,!0];r=i-1}}return[t,!1]}return[0,!1]},e.prototype.ensure=function(){return y(this,void 0,void 0,function(){var n,t,r,i,s,o,a,l,u,c,d,h,f,p,g,b,m;return v(this,function(_){switch(_.label){case 0:return[4,(n=Si.get(this.dbname)).find(this._store,this.indexerKey,ts.PERSISTENT)];case 1:return(t=_.sent())?[3,11]:(r=mm(this.dbname,this.collectionName),[4,this._store.getAllKeys()]);case 2:i=_.sent(),_.label=3;case 3:_.trys.push([3,8,9,10]),s=pe(i),o=s.next(),_.label=4;case 4:return o.done?[3,7]:(a=o.value).startsWith(r)?[4,n.find(this._store,a,ts.NO_CACHE)]:[3,6];case 5:if(l=_.sent(),u=_h.createFromCacheItem(l))try{for(b=void 0,c=pe(u.items),d=c.next();!d.done;d=c.next())h=d.value,this._addItem(h)}catch(E){b={error:E}}finally{try{d&&!d.done&&(m=c.return)&&m.call(c)}finally{if(b)throw b.error}}_.label=6;case 6:return o=s.next(),[3,4];case 7:return[3,10];case 8:return f=_.sent(),p={error:f},[3,10];case 9:try{o&&!o.done&&(g=s.return)&&g.call(s)}finally{if(p)throw p.error}return[7];case 10:return this._transaction.requestWrite({key:this.indexerKey,value:this._table},{persistent:!0}),[3,12];case 11:this._origin=t.value,this._table=kr(this._origin),_.label=12;case 12:return Wa[this.indexerKey]=this,[2]}})})},e.prototype.drop=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return Si.get(this.dbname).remove(this.indexerKey),[4,this._store.remove(this.indexerKey)];case 1:return n.sent(),delete Wa[this.indexerKey],[2]}})})},e.prototype.addItem=function(n){return y(this,void 0,void 0,function(){return v(this,function(t){return this._addItem(n)&&this._transaction.requestWrite({key:this.indexerKey,value:this._table},{persistent:!0}),[2]})})},e.prototype.removeItem=function(n){return y(this,void 0,void 0,function(){return v(this,function(t){return this._removeItem(n)&&this._transaction.requestWrite({key:this.indexerKey,value:this._table},{persistent:!0}),[2]})})},e.prototype.clear=function(){return y(this,void 0,void 0,function(){return v(this,function(n){return this._table=[],this._transaction.requestWrite({key:this.indexerKey,value:this._table},{persistent:!0}),[2]})})},e.prototype.commit=function(){this._origin=this._table,this._table=kr(this._origin)},e.prototype.abort=function(){this._table=kr(this._origin)},e}(),hf=function(){return typeof document<"u"&&typeof navigator<"u"&&navigator.product!=="ReactNative"},cy=function(){var e=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(n==="x"?t:3&t|8).toString(16)})};(function(e){e[e.PROCESSING=0]="PROCESSING",e[e.DONE=1]="DONE"})(rc||(rc={})),function(e){e.NEWNODE="newnode",e.REMOVENODE="removenode",e.CLAIM_HOST="claimhost",e.SYNC_HOST="synchost",e.REQUEST_LOCK="requestlock",e.ACQUIRE_LOCK="acquirelock",e.RELEASE_LOCK="releaselock"}(ur||(ur={}));var Fi,Ap={},rv=function(){function e(n,t){t===void 0&&(t={});var r=this;return this._state=rc.PROCESSING,this._queue=[],this._activationQueue=[],Ap[n]&&!t.forceCreate||(this.nodeId=cy(),this.key=n,hf()&&(t.startAsInvisible?this.registerNode():document.visibilityState==="visible"?this.claimHost():this.registerNode(),document.addEventListener("visibilitychange",function(){document.visibilityState==="visible"&&r.claimHost()}),window.addEventListener("message",function(i){var s,o,a=i.data;if(a!=null&&a.isNestDbMessage){var l=a.nodeId,u=a.requestId,c=a.key,d=a.op,h=a.data;if(l!==r.nodeId&&c===r.key)switch(d){case ur.NEWNODE:r._sendSync();break;case ur.CLAIM_HOST:r._sendSync(),r._hostId=l;break;case ur.SYNC_HOST:if(!r.isInSync){r._activationTimeout&&clearTimeout(r._activationTimeout);var f=h,p=f.currentItemRequestId,g=f.queue,b=function(S){var w=r._queue.findIndex(function(N){return N.requestId===S.requestId});w<0&&r._requestLock({isNestDbMessage:!0,nodeId:S.nodeId,requestId:S.requestId,key:r.key,op:ur.REQUEST_LOCK,ts:S.ts})};try{for(var m=pe(g),_=m.next();!_.done;_=m.next())b(_.value)}catch(S){s={error:S}}finally{try{_&&!_.done&&(o=m.return)&&o.call(m)}finally{if(s)throw s.error}}r._currentItem=r._queue.find(function(S){return S.requestId===p}),r._completeSync()}break;case ur.REMOVENODE:r._queue=r._queue.filter(function(S){return S.nodeId!==a.nodeId}),r._currentItem&&r._currentItem.nodeId===a.nodeId&&(r._currentItem=void 0,r._acquire(r._queue[0]));break;case ur.REQUEST_LOCK:r._requestLock(a);break;case ur.ACQUIRE_LOCK:var E=r._queue.find(function(S){return S.requestId===u});r._acquire(E);break;case ur.RELEASE_LOCK:r._release(u)}}}),window.addEventListener("beforeunload",function(){r._send(ur.REMOVENODE)})),Ap[n]=this),Ap[n]}return Object.defineProperty(e.prototype,"locked",{get:function(){return!!this._currentItem},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isHost",{get:function(){return this._hostId===this.nodeId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInSync",{get:function(){return this._state==rc.DONE},enumerable:!1,configurable:!0}),e.prototype._send=function(n,t){var r;t===void 0&&(t={});var i={isNestDbMessage:!0,nodeId:this.nodeId,requestId:(r=t==null?void 0:t.requestId)!==null&&r!==void 0?r:cy(),key:this.key,op:n,data:t.data,ts:Date.now()};return hf()&&window.postMessage(i,"*"),i},e.prototype._acquire=function(n){n?(this._currentItem=n,this._currentItem.onAcquired&&this._currentItem.onAcquired(n.requestId)):this._currentItem=void 0},e.prototype._release=function(n){if(this._currentItem&&this._currentItem.requestId===n){var t=this._currentItem;this._currentItem=void 0,t.nodeId===this.nodeId&&this._send(ur.RELEASE_LOCK,{requestId:t.requestId});var r=this._queue.findIndex(function(i){return i.requestId===n});r>-1&&this._queue.splice(r,1),t.onReleased&&t.onReleased(n)}},e.prototype._requestLock=function(n){var t=this;return new Promise(function(r){var i={nodeId:n.nodeId,requestId:n.requestId,ts:n.ts,onAcquired:function(a){t.isHost&&t._send(ur.ACQUIRE_LOCK,{requestId:a}),r()},onReleased:function(){t._acquire(t._queue[0])}},s=!1;for(var o in t._queue)if(t._queue[o].ts>i.ts){t._queue.splice(parseInt(o),0,i),s=!0;break}s||t._queue.push(i),t._currentItem||t._acquire(t._queue[0])})},e.prototype._sendSync=function(){var n;this.isHost&&this._send(ur.SYNC_HOST,{data:{currentItemRequestId:(n=this._currentItem)===null||n===void 0?void 0:n.requestId,queue:this._queue.map(function(t){return{nodeId:t.nodeId,requestId:t.requestId,ts:t.ts}})}})},e.prototype._waitUntilSyncCompleted=function(){return y(this,void 0,void 0,function(){var n=this;return v(this,function(t){return this.isHost&&!this.isInSync?[2,new Promise(function(r){n._activationQueue.push(r)})]:[2]})})},e.prototype._waitSync=function(){var n=this;this.isInSync||(this._activationTimeout=setTimeout(function(){n._completeSync()},8))},e.prototype._completeSync=function(){this.isInSync||(this._state=rc.DONE,this._activationQueue.forEach(function(n){return n()}),this._activationQueue=[])},e.prototype.registerNode=function(){this._send(ur.NEWNODE),this._waitSync()},e.prototype.claimHost=function(){this._hostId=this.nodeId,this._send(ur.CLAIM_HOST),this._waitSync()},e.prototype.lock=function(){return y(this,void 0,void 0,function(){var n;return v(this,function(t){switch(t.label){case 0:return[4,this._waitUntilSyncCompleted()];case 1:return t.sent(),n=this._send(ur.REQUEST_LOCK),[4,this._requestLock(n)];case 2:return t.sent(),[2]}})})},e.prototype.unlock=function(){var n;!((n=this._currentItem)===null||n===void 0)&&n.requestId&&this._release(this._currentItem.requestId)},e}(),Mp=function(){function e(n){var t=n.dbname,r=n.collectionName,i=n.keyName,s=n.keyHash,o=n.indexes,a=n.store,l=this;this._state=la.INIT,this._indexers=[],this.dbname=t,this.name=r,this.keyName=i,this.indexes=De([[i]],Ae(o.filter(function(u){return Ws.createKey(u)!==l.keyName})),!1),this._keyHash=s,this._store=a,this._mutex=new rv(function(u,c){return"".concat(Ia(u,c),".lock")}(t,r)),this._blobContainer=new Vx({dbname:t,collectionName:r,store:a}),this._transaction=new qx({dbname:t,collectionName:r,store:a})}return e.metadataOf=function(n,t,r){return y(this,void 0,void 0,function(){var i;return v(this,function(s){switch(s.label){case 0:return i=Ip(n,t),[4,r.get(i)];case 1:return[2,s.sent()]}})})},Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isReady",{get:function(){return this._state===la.READY},enumerable:!1,configurable:!0}),e.prototype.init=function(){return y(this,void 0,void 0,function(){var n,t,r,i,s,o,a,l,u,c,d,h,f,p,g=this;return v(this,function(b){switch(b.label){case 0:return[4,this._mutex.lock()];case 1:b.sent(),b.label=2;case 2:return b.trys.push([2,9,,10]),n=Zc.get(this.dbname),[4,e.metadataOf(this.dbname,this.name,this._store)];case 3:return t=b.sent(),this._metadata=t||{keyName:this.keyName,blockLevel:1,blockHashBase:n.blockHashBase,blockHashMultiplier:n.blockHashMultiplier,blockHashConstant:n.blockHashConstant,indexes:this.indexes},[4,this._transaction.init()];case 4:b.sent(),this._blockManager=new Wx({dbname:this.dbname,collectionName:this.name,hashFunction:this._keyHash,metadata:this._metadata,transaction:this._transaction,store:this._store}),r=De([],Ae(this.indexes),!1),i=[],s=r.map(function(m){return Ws.createKey(m)}),o=t?t.indexes.map(function(m){return Ws.createKey(m)}):[];try{for(a=pe(o),l=a.next();!l.done;l=a.next())u=l.value,s.includes(u)||i.push(Ws.parseKey(u))}catch(m){f={error:m}}finally{try{l&&!l.done&&(p=a.return)&&p.call(a)}finally{if(f)throw f.error}}return(c=[]).push.apply(c,De([],Ae(r.map(function(m){var _=new Ws({dbname:g.dbname,collectionName:g.name,keyName:g.keyName,fields:m,transaction:g._transaction,store:g._store});return g._indexers.push(_),_.ensure()})),!1)),c.push.apply(c,De([],Ae(i.map(function(m){return new Ws({dbname:g.dbname,collectionName:g.name,keyName:g.keyName,fields:m,transaction:g._transaction,store:g._store}).drop()})),!1)),[4,Promise.all(c)];case 5:return b.sent(),[4,this._transaction.commit()];case 6:return b.sent(),s.sort().join(",")===o.sort().join(",")?[3,8]:(d=Ip(this.dbname,this.name),this._metadata.indexes=r,[4,this._store.set({key:d,value:this._metadata})]);case 7:b.sent(),b.label=8;case 8:return this._state=la.READY,this._mutex.unlock(),[3,10];case 9:throw h=b.sent(),this._mutex.unlock(),h;case 10:return[2]}})})},e.prototype.close=function(){this._state=la.CLOSED},e.prototype._hasPropertyOfKeyName=function(n){var t=n[this.keyName];return typeof t=="string"&&!!t},e.prototype._getIndexerBy=function(n){var t,r;n===void 0&&(n=null),n||(n=[this.keyName]);var i=Ws.createKey(n);try{for(var s=pe(this._indexers),o=s.next();!o.done;o=s.next()){var a=o.value;if(i===Ws.createKey(a.fields))return a}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}throw st.indexTableIsRequired},e.prototype._upgradeBlockLevel=function(){return y(this,void 0,void 0,function(){var n;return v(this,function(t){switch(t.label){case 0:return n=Ip(this.dbname,this.name),this._metadata.blockLevel++,[4,this._store.set({key:n,value:this._metadata})];case 1:return t.sent(),[2]}})})},e.prototype._requestInsert=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return t=n[this.keyName],[4,this._blockManager.getFromBlock(t)];case 1:return l.sent()?[3,13]:[4,this._blockManager.putToBlock(t,n)];case 2:return l.sent()?[3,5]:[4,this._upgradeBlockLevel()];case 3:return l.sent(),[4,this._blockManager.putToBlock(t,n)];case 4:l.sent(),l.label=5;case 5:l.trys.push([5,10,11,12]),r=pe(this._indexers),i=r.next(),l.label=6;case 6:return i.done?[3,9]:[4,i.value.addItem(n)];case 7:l.sent(),l.label=8;case 8:return i=r.next(),[3,6];case 9:return[3,12];case 10:return s=l.sent(),o={error:s},[3,12];case 11:try{i&&!i.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}return[7];case 12:return[3,14];case 13:throw st.collectionInsertDuplicate;case 14:return[2]}})})},e.prototype._requestUpsert=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u,c,d,h,f,p;return v(this,function(g){switch(g.label){case 0:return t=n[this.keyName],[4,this._blockManager.getFromBlock(t)];case 1:return(r=g.sent())?[3,13]:[4,this._blockManager.putToBlock(t,n)];case 2:return g.sent()?[3,5]:[4,this._upgradeBlockLevel()];case 3:return g.sent(),[4,this._blockManager.putToBlock(t,n)];case 4:g.sent(),g.label=5;case 5:g.trys.push([5,10,11,12]),i=pe(this._indexers),s=i.next(),g.label=6;case 6:return s.done?[3,9]:[4,(u=s.value).addItem(n)];case 7:g.sent(),g.label=8;case 8:return s=i.next(),[3,6];case 9:return[3,12];case 10:return o=g.sent(),d={error:o},[3,12];case 11:try{s&&!s.done&&(h=i.return)&&h.call(i)}finally{if(d)throw d.error}return[7];case 12:return[3,23];case 13:return[4,this._blockManager.putToBlock(t,n)];case 14:g.sent(),g.label=15;case 15:g.trys.push([15,21,22,23]),a=pe(this._indexers),l=a.next(),g.label=16;case 16:return l.done?[3,20]:(u=l.value).diff(u.getColumnValues(r),u.getColumnValues(n))===0?[3,19]:[4,u.removeItem(r)];case 17:return g.sent(),[4,u.addItem(n)];case 18:g.sent(),g.label=19;case 19:return l=a.next(),[3,16];case 20:return[3,23];case 21:return c=g.sent(),f={error:c},[3,23];case 22:try{l&&!l.done&&(p=a.return)&&p.call(a)}finally{if(f)throw f.error}return[7];case 23:return[2]}})})},e.prototype._requestUpdate=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return t=n[this.keyName],[4,this._blockManager.getFromBlock(t)];case 1:return(r=c.sent())?[4,this._blockManager.putToBlock(t,n)]:[3,11];case 2:c.sent(),c.label=3;case 3:c.trys.push([3,9,10,11]),i=pe(this._indexers),s=i.next(),c.label=4;case 4:return s.done?[3,8]:(o=s.value).diff(o.getColumnValues(r),o.getColumnValues(n))===0?[3,7]:[4,o.removeItem(r)];case 5:return c.sent(),[4,o.addItem(n)];case 6:c.sent(),c.label=7;case 7:return s=i.next(),[3,4];case 8:return[3,11];case 9:return a=c.sent(),l={error:a},[3,11];case 10:try{s&&!s.done&&(u=i.return)&&u.call(i)}finally{if(l)throw l.error}return[7];case 11:return[2]}})})},e.prototype._requestRemove=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return[4,this._blockManager.getFromBlock(n)];case 1:return(t=l.sent())?[4,this._blockManager.removeFromBlock(n)]:[3,10];case 2:l.sent(),l.label=3;case 3:l.trys.push([3,8,9,10]),r=pe(this._indexers),i=r.next(),l.label=4;case 4:return i.done?[3,7]:[4,i.value.removeItem(t)];case 5:l.sent(),l.label=6;case 6:return i=r.next(),[3,4];case 7:return[3,10];case 8:return s=l.sent(),o={error:s},[3,10];case 9:try{i&&!i.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}return[7];case 10:return[2]}})})},e.prototype._requestClear=function(){return y(this,void 0,void 0,function(){var n,t,r,i,s;return v(this,function(o){switch(o.label){case 0:return[4,this._blockManager.clearAllBlocks()];case 1:o.sent(),o.label=2;case 2:o.trys.push([2,7,8,9]),n=pe(this._indexers),t=n.next(),o.label=3;case 3:return t.done?[3,6]:[4,t.value.clear()];case 4:o.sent(),o.label=5;case 5:return t=n.next(),[3,3];case 6:return[3,9];case 7:return r=o.sent(),i={error:r},[3,9];case 8:try{t&&!t.done&&(s=n.return)&&s.call(n)}finally{if(i)throw i.error}return[7];case 9:return[2]}})})},e.prototype.getByKey=function(n){return y(this,void 0,void 0,function(){var t,r;return v(this,function(i){switch(i.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,6];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this._blockManager.getFromBlock(n)];case 3:return t=i.sent(),this._mutex.unlock(),[2,kr(t)];case 4:throw r=i.sent(),this._mutex.unlock(),r;case 5:return[3,7];case 6:throw st.collectionNotReady;case 7:return[2]}})})},e.prototype.query=function(n){if(n===void 0&&(n={}),this.isReady)return new zx({condition:n.where,mutex:this._mutex,blockManager:this._blockManager,indexer:this._getIndexerBy(n.index),backward:!!n.backward});throw st.collectionNotReady},e.prototype.insertOne=function(n){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,8];case 1:r.sent(),r.label=2;case 2:if(r.trys.push([2,5,,7]),!this._hasPropertyOfKeyName(n))throw st.collectionKeyNotGiven;return[4,this._requestInsert(kr(n))];case 3:return r.sent(),[4,this._transaction.commit()];case 4:return r.sent(),this._mutex.unlock(),[2,n];case 5:return t=r.sent(),[4,this._transaction.clear()];case 6:throw r.sent(),this._mutex.unlock(),t;case 7:return[3,9];case 8:throw st.collectionNotReady;case 9:return[2]}})})},e.prototype.insertMany=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u=this;return v(this,function(c){switch(c.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,15];case 1:c.sent(),c.label=2;case 2:if(c.trys.push([2,12,,14]),n.some(function(d){return!u._hasPropertyOfKeyName(d)}))throw st.collectionKeyNotGiven;c.label=3;case 3:c.trys.push([3,8,9,10]),t=pe(n),r=t.next(),c.label=4;case 4:return r.done?[3,7]:(i=r.value,[4,this._requestInsert(kr(i))]);case 5:c.sent(),c.label=6;case 6:return r=t.next(),[3,4];case 7:return[3,10];case 8:return s=c.sent(),a={error:s},[3,10];case 9:try{r&&!r.done&&(l=t.return)&&l.call(t)}finally{if(a)throw a.error}return[7];case 10:return[4,this._transaction.commit()];case 11:return c.sent(),this._mutex.unlock(),[2,n];case 12:return o=c.sent(),[4,this._transaction.clear()];case 13:throw c.sent(),this._mutex.unlock(),o;case 14:return[3,16];case 15:throw st.collectionNotReady;case 16:return[2]}})})},e.prototype.upsertOne=function(n){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,8];case 1:r.sent(),r.label=2;case 2:if(r.trys.push([2,5,,7]),!this._hasPropertyOfKeyName(n))throw st.collectionKeyNotGiven;return[4,this._requestUpsert(kr(n))];case 3:return r.sent(),[4,this._transaction.commit()];case 4:return r.sent(),this._mutex.unlock(),[2,n];case 5:return t=r.sent(),[4,this._transaction.clear()];case 6:throw r.sent(),this._mutex.unlock(),t;case 7:return[3,9];case 8:throw st.collectionNotReady;case 9:return[2]}})})},e.prototype.upsertMany=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u=this;return v(this,function(c){switch(c.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,15];case 1:c.sent(),c.label=2;case 2:if(c.trys.push([2,12,,14]),n.some(function(d){return!u._hasPropertyOfKeyName(d)}))throw st.collectionKeyNotGiven;c.label=3;case 3:c.trys.push([3,8,9,10]),t=pe(n),r=t.next(),c.label=4;case 4:return r.done?[3,7]:(i=r.value,[4,this._requestUpsert(kr(i))]);case 5:c.sent(),c.label=6;case 6:return r=t.next(),[3,4];case 7:return[3,10];case 8:return s=c.sent(),a={error:s},[3,10];case 9:try{r&&!r.done&&(l=t.return)&&l.call(t)}finally{if(a)throw a.error}return[7];case 10:return[4,this._transaction.commit()];case 11:return c.sent(),this._mutex.unlock(),[2,n];case 12:return o=c.sent(),[4,this._transaction.clear()];case 13:throw c.sent(),this._mutex.unlock(),o;case 14:return[3,16];case 15:throw st.collectionNotReady;case 16:return[2]}})})},e.prototype.update=function(n){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,8];case 1:r.sent(),r.label=2;case 2:if(r.trys.push([2,5,,7]),!this._hasPropertyOfKeyName(n))throw st.collectionKeyNotGiven;return[4,this._requestUpdate(kr(n))];case 3:return r.sent(),[4,this._transaction.commit()];case 4:return r.sent(),this._mutex.unlock(),[2,n];case 5:return t=r.sent(),[4,this._transaction.clear()];case 6:throw r.sent(),this._mutex.unlock(),t;case 7:return[3,9];case 8:throw st.collectionNotReady;case 9:return[2]}})})},e.prototype.updateIf=function(n,t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u,c,d,h,f,p,g,b,m=this;return v(this,function(_){switch(_.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,16];case 1:_.sent(),_.label=2;case 2:return _.trys.push([2,13,,15]),r=n.where,i=r===void 0?{}:r,s=n.index,o=s===void 0?null:s,a=n.backward,l=a!==void 0&&a,u=[],[4,new pm({condition:i,blockManager:this._blockManager,backward:l,indexer:this._getIndexerBy(o)}).each(function(E){return y(m,void 0,void 0,function(){var S,w;return v(this,function(N){if(E.error)throw E.stop(),E.error;if(E.hasNext){if(S=E.nextValue,ma(i,S)&&t.set){if(typeof t.set!="function")for(w in t.set)S[w]=t.set[w];else t.set(S);u.push(S)}E.next()}else E.stop();return[2]})})})];case 3:_.sent(),_.label=4;case 4:_.trys.push([4,9,10,11]),c=pe(u),d=c.next(),_.label=5;case 5:return d.done?[3,8]:(h=d.value,[4,this._requestUpdate(kr(h))]);case 6:_.sent(),_.label=7;case 7:return d=c.next(),[3,5];case 8:return[3,11];case 9:return f=_.sent(),g={error:f},[3,11];case 10:try{d&&!d.done&&(b=c.return)&&b.call(c)}finally{if(g)throw g.error}return[7];case 11:return[4,this._transaction.commit()];case 12:return _.sent(),this._mutex.unlock(),[2,u];case 13:return p=_.sent(),[4,this._transaction.clear()];case 14:throw _.sent(),this._mutex.unlock(),p;case 15:return[3,17];case 16:throw this._transaction.clear(),st.collectionNotReady;case 17:return[2]}})})},e.prototype.remove=function(n){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,8];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,5,,7]),[4,this._requestRemove(n)];case 3:return r.sent(),[4,this._transaction.commit()];case 4:return r.sent(),this._mutex.unlock(),[3,7];case 5:return t=r.sent(),[4,this._transaction.clear()];case 6:throw r.sent(),this._mutex.unlock(),t;case 7:return[3,9];case 8:throw st.collectionNotReady;case 9:return[2]}})})},e.prototype.removeIf=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u,c,d,h,f,p,g,b=this;return v(this,function(m){switch(m.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,15];case 1:m.sent(),m.label=2;case 2:return m.trys.push([2,13,,14]),t=n.where,r=t===void 0?{}:t,i=n.index,s=i===void 0?null:i,o=n.backward,a=o!==void 0&&o,l=[],[4,new pm({condition:r,blockManager:this._blockManager,backward:a,indexer:this._getIndexerBy(s)}).each(function(_){return y(b,void 0,void 0,function(){var E,S;return v(this,function(w){if(_.error)throw _.stop(),_.error;return _.hasNext?(E=_.nextValue,ma(r,E)&&(S=E[this.keyName],l.push(S)),_.next()):_.stop(),[2]})})})];case 3:m.sent(),m.label=4;case 4:m.trys.push([4,9,10,11]),u=pe(l),c=u.next(),m.label=5;case 5:return c.done?[3,8]:(d=c.value,[4,this._requestRemove(d)]);case 6:m.sent(),m.label=7;case 7:return c=u.next(),[3,5];case 8:return[3,11];case 9:return h=m.sent(),p={error:h},[3,11];case 10:try{c&&!c.done&&(g=u.return)&&g.call(u)}finally{if(p)throw p.error}return[7];case 11:return[4,this._transaction.commit()];case 12:return m.sent(),this._mutex.unlock(),[2,l];case 13:throw f=m.sent(),this._mutex.unlock(),f;case 14:return[3,16];case 15:throw this._transaction.clear(),st.collectionNotReady;case 16:return[2]}})})},e.prototype.clear=function(){return y(this,void 0,void 0,function(){var n;return v(this,function(t){switch(t.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,8];case 1:t.sent(),t.label=2;case 2:return t.trys.push([2,5,,7]),[4,this._requestClear()];case 3:return t.sent(),[4,this._transaction.commit()];case 4:return t.sent(),this._mutex.unlock(),[3,7];case 5:return n=t.sent(),[4,this._transaction.clear()];case 6:throw t.sent(),this._mutex.unlock(),n;case 7:return[3,9];case 8:throw st.collectionNotReady;case 9:return[2]}})})},e.prototype.getBlob=function(n){return y(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return[4,this._blobContainer.get(n)];case 1:return[2,t.sent()]}})})},e.prototype.saveBlob=function(n,t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return[4,this._blobContainer.save(n,t)];case 1:return[2,r.sent()]}})})},e.prototype.removeBlob=function(n){return y(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return[4,this._blobContainer.remove(n)];case 1:return t.sent(),[2]}})})},e.prototype.removeAllBlobs=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return[4,this._blobContainer.clear()];case 1:return n.sent(),[2]}})})},e}(),xp="[NESTDB]",Hd=!0,Vo=function(){function e(){}return e.off=function(){Hd=!1},e.log=function(){for(var n=[],t=0;t1?[4,Promise.all(this._generateShardPostfixArray(s==null?void 0:s.shards).map(function(c){return y(l,void 0,void 0,function(){var d,h;return v(this,function(f){switch(f.label){case 0:return c>0?(d=this._getRawKey(n,".".concat(c)),[4,this._getRaw(d)]):[3,2];case 1:if(!(h=f.sent()))throw st.storeBrokenIntegrity;return[2,h.data];case 2:return[2,i]}})})}))]:[3,4];case 3:return a=u.sent(),[3,5];case 4:a=[i],u.label=5;case 5:return o=a,[2,this.encryption.decrypt(JSON.parse(o.join("")))];case 6:return u.sent(),[2,null];case 7:return[2,null]}})})},e.prototype.set=function(n){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return t=this._shardify(n),[4,this._setRaw(t)];case 1:return r.sent(),[2,x({},n.value)]}})})},e.prototype.setMany=function(n){return y(this,void 0,void 0,function(){var t,r=this;return v(this,function(i){switch(i.label){case 0:return t=[],[4,this._setRaw(t.concat.apply(t,De([],Ae(n.map(function(s){return r._shardify(s)})),!1)))];case 1:return i.sent(),[2,n.map(function(s){return s.value})]}})})},e.prototype.remove=function(n){return y(this,void 0,void 0,function(){var t,r,i,s=this;return v(this,function(o){switch(o.label){case 0:return t=this._getRawKey(n,".0"),[4,this._getRaw(t)];case 1:return(r=o.sent())?(i=r.metadata,[4,this._removeRaw(this._generateShardPostfixArray(i==null?void 0:i.shards).map(function(a){return s._getRawKey(n,".".concat(a))}))]):[3,3];case 2:return o.sent(),[2,!0];case 3:return[2,!1]}})})},e.prototype.removeMany=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u,c,d=this;return v(this,function(h){switch(h.label){case 0:t=[],r=function(f){var p,g,b;return v(this,function(m){switch(m.label){case 0:return p=i._getRawKey(f,".0"),[4,i._getRaw(p)];case 1:return(g=m.sent())&&(b=g.metadata,t.push.apply(t,De([],Ae(i._generateShardPostfixArray(b==null?void 0:b.shards).map(function(_){return d._getRawKey(f,".".concat(_))})),!1))),[2]}})},i=this,h.label=1;case 1:h.trys.push([1,6,7,8]),s=pe(n),o=s.next(),h.label=2;case 2:return o.done?[3,5]:(a=o.value,[5,r(a)]);case 3:h.sent(),h.label=4;case 4:return o=s.next(),[3,2];case 5:return[3,8];case 6:return l=h.sent(),u={error:l},[3,8];case 7:try{o&&!o.done&&(c=s.return)&&c.call(s)}finally{if(u)throw u.error}return[7];case 8:return t.length>0?[4,this._removeRaw(t)]:[3,10];case 9:h.sent(),h.label=10;case 10:return[2,n]}})})},e}(),Ir={},Zo=function(e){function n(t){t===void 0&&(t={});var r,i=this;i=e.call(this,x(x({},t),{itemSizeLimit:(r=t.itemSizeLimit)!==null&&r!==void 0?r:4194304}))||this;var s=t.delay,o=s===void 0?1:s;return i.delay=o,i.observer={},i}return T(n,e),Object.defineProperty(n.prototype,"rawData",{get:function(){return Ir[this.dbname]},set:function(t){Ir[this.dbname]=t},enumerable:!1,configurable:!0}),n.prototype._getAllRawKeys=function(){return y(this,void 0,void 0,function(){return v(this,function(t){if(Ir[this.dbname])return[2,Object.keys(Ir[this.dbname])];throw st.storeNotAvailable})})},n.prototype._getRaw=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return Ir[this.dbname]?[4,Pd(this.delay)]:[3,2];case 1:return r.sent(),[2,Ir[this.dbname][t]?x({key:t},Ir[this.dbname][t]):null];case 2:throw st.storeNotAvailable}})})},n.prototype._setRaw=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u,c;return v(this,function(d){switch(d.label){case 0:return Ir[this.dbname]?[4,Pd(this.delay)]:[3,2];case 1:d.sent();try{for(r=pe(t),i=r.next();!i.done;i=r.next())s=i.value,o=s.key,a=s.data,l=s.metadata,Ir[this.dbname][o]=Object.freeze({data:a,metadata:l})}catch(h){u={error:h}}finally{try{i&&!i.done&&(c=r.return)&&c.call(r)}finally{if(u)throw u.error}}return[3,3];case 2:throw st.storeNotAvailable;case 3:return[2]}})})},n.prototype._removeRaw=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return Ir[this.dbname]?[4,Pd(this.delay)]:[3,2];case 1:l.sent();try{for(r=pe(t),i=r.next();!i.done;i=r.next())s=i.value,Ir[this.dbname][s]&&delete Ir[this.dbname][s]}catch(u){o={error:u}}finally{try{i&&!i.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}}return[3,3];case 2:throw st.storeNotAvailable;case 3:return[2]}})})},n.prototype.observe=function(t,r,i){var s=this;this.observer[t]||(this.observer[t]={}),r.forEach(function(o){return s.observer[t][o]=i})},n.prototype.checkAvailability=function(){return y(this,void 0,void 0,function(){return v(this,function(t){return[2]})})},n.prototype.init=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return this.dbname=t,Ir[this.dbname]||(Ir[this.dbname]={}),[4,this._resetIfEncryptionChanged()];case 1:return r.sent(),[2]}})})},n.prototype.set=function(t){return y(this,void 0,void 0,function(){var r,i;return v(this,function(s){if((r=this.observer[t.key])&&typeof r.set=="function"&&(i=r.set()))throw i;return[2,e.prototype.set.call(this,t)]})})},n.prototype.setMany=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u;return v(this,function(c){try{for(r=pe(t),i=r.next();!i.done;i=r.next())if(s=i.value,(o=this.observer[s.key])&&typeof o.set=="function"&&(a=o.set()))throw a}catch(d){l={error:d}}finally{try{i&&!i.done&&(u=r.return)&&u.call(r)}finally{if(l)throw l.error}}return[2,e.prototype.setMany.call(this,t)]})})},n.prototype.clear=function(){return y(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return[4,Pd(this.delay)];case 1:return t.sent(),Ir[this.dbname]={},[2]}})})},n}(d0),dy="NestDBStore";(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.OPENING=1]="OPENING",e[e.OPEN=2]="OPEN",e[e.CLOSED=3]="CLOSED"})(Fi||(Fi={}));var ns,Qx=function(e){function n(t){t===void 0&&(t={});var r,i=this;return(i=e.call(this,x(x({},t),{itemSizeLimit:(r=t.itemSizeLimit)!==null&&r!==void 0?r:104857600}))||this)._storeName=dy,i._state=Fi.UNINITIALIZED,i._openJobQueue=[],i._window=typeof window<"u"?window:void 0,i._indexedDb=i._window?i._window.indexedDB||i._window.mozIndexedDB||i._window.webkitIndexedDB||i._window.msIndexedDB:void 0,i}return T(n,e),Object.defineProperty(n.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),n.prototype.isTransactionInactiveError=function(t){return t instanceof Error&&t.message.includes("The transaction is inactive")},n.prototype._putToObjectStore=function(t,r){return y(this,void 0,void 0,function(){return v(this,function(i){return[2,new Promise(function(s,o){var a=t.put(r);a.addEventListener("success",function(l){s(l.target.result)}),a.addEventListener("error",function(){o("Failed to write.")})})]})})},n.prototype._deleteFromObjectStore=function(t,r){return y(this,void 0,void 0,function(){return v(this,function(i){return[2,new Promise(function(s,o){var a=t.delete(r);a.addEventListener("success",function(){return s(r)}),a.addEventListener("error",function(l){return o(l.target.error)})})]})})},n.prototype._openDatabase=function(t){var r=this;return new Promise(function(i,s){if(r._indexedDb){r._state=Fi.OPENING;var o=r._indexedDb.open(t);o.addEventListener("upgradeneeded",function(a){a.target.result.createObjectStore(dy,{keyPath:"key"})}),o.addEventListener("success",function(a){r._state=Fi.OPEN,r._database=a.target.result,r._openJobQueue.forEach(function(l){return l()}),r._openJobQueue=[],r._database.onclose=function(){r._database=void 0,r._state=Fi.OPENING,setTimeout(function(){r._openDatabase(t)},5)},i(r._database)}),o.addEventListener("error",function(a){r._state=Fi.UNINITIALIZED,s(a.target.error)})}else s(st.storeNotAvailable)})},n.prototype._getObjectStore=function(t){return y(this,void 0,void 0,function(){var r=this;return v(this,function(i){switch(i.label){case 0:return this._database?[2,this._database.transaction(this._storeName,t).objectStore(this._storeName)]:[3,1];case 1:switch(this._state){case Fi.UNINITIALIZED:case Fi.OPEN:return[3,2];case Fi.OPENING:case Fi.CLOSED:return[3,3]}return[3,4];case 2:throw st.storeNotInitialized;case 3:return[2,new Promise(function(s){r._openJobQueue.push(function(){return s(r._getObjectStore(t))})})];case 4:return[4,this._getObjectStore(t)];case 5:return[2,i.sent()]}})})},n.prototype._getAllRawKeys=function(){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return[4,this._getObjectStore("readonly")];case 1:return t=r.sent(),[4,new Promise(function(i,s){var o=t.getAllKeys();o.addEventListener("success",function(a){i(a.target.result)}),o.addEventListener("error",function(a){return s(a.target.error)})})];case 2:return[2,r.sent()]}})})},n.prototype._getRaw=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return[4,this._getObjectStore("readonly")];case 1:return r=i.sent(),[4,new Promise(function(s,o){var a=r.get(t);a.addEventListener("success",function(l){var u;s((u=l==null?void 0:l.target)===null||u===void 0?void 0:u.result)}),a.addEventListener("error",function(l){return o(l.target.error)})})];case 2:return[2,i.sent()]}})})},n.prototype._setRaw=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u,c,d=this;return v(this,function(h){switch(h.label){case 0:return[4,this._getObjectStore("readwrite")];case 1:r=h.sent(),h.label=2;case 2:return h.trys.push([2,4,,15]),[4,Promise.all(t.map(function(f){return d._putToObjectStore(r,f)}))];case 3:return h.sent(),[3,15];case 4:if(i=h.sent(),!this.isTransactionInactiveError(i))return[3,13];h.label=5;case 5:h.trys.push([5,10,11,12]),s=pe(t),o=s.next(),h.label=6;case 6:return o.done?[3,9]:(a=o.value,[4,this._putToObjectStore(r,a)]);case 7:h.sent(),h.label=8;case 8:return o=s.next(),[3,6];case 9:return[3,12];case 10:return l=h.sent(),u={error:l},[3,12];case 11:try{o&&!o.done&&(c=s.return)&&c.call(s)}finally{if(u)throw u.error}return[7];case 12:return[3,14];case 13:throw i;case 14:return[3,15];case 15:return[2]}})})},n.prototype._removeRaw=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u,c,d=this;return v(this,function(h){switch(h.label){case 0:return[4,this._getObjectStore("readwrite")];case 1:r=h.sent(),h.label=2;case 2:return h.trys.push([2,4,,15]),[4,Promise.all(t.map(function(f){return d._deleteFromObjectStore(r,f)}))];case 3:return h.sent(),[3,15];case 4:if(i=h.sent(),!this.isTransactionInactiveError(i))return[3,13];h.label=5;case 5:h.trys.push([5,10,11,12]),s=pe(t),o=s.next(),h.label=6;case 6:return o.done?[3,9]:(a=o.value,[4,this._deleteFromObjectStore(r,a)]);case 7:h.sent(),h.label=8;case 8:return o=s.next(),[3,6];case 9:return[3,12];case 10:return l=h.sent(),u={error:l},[3,12];case 11:try{o&&!o.done&&(c=s.return)&&c.call(s)}finally{if(u)throw u.error}return[7];case 12:return[3,14];case 13:throw i;case 14:return[3,15];case 15:return[2]}})})},n.prototype._triggerDatabaseClose=function(){this._database&&this._database.onclose&&this._database.onclose(new Event("dummy"))},n.prototype.checkAvailability=function(){return y(this,void 0,void 0,function(){var t,r=this;return v(this,function(i){switch(i.label){case 0:if(!((t=typeof window<"u"?window:null)!=null&&t.indexedDB||t!=null&&t.mozIndexedDB||t!=null&&t.webkitIndexedDB||t!=null&&t.msIndexedDB))return[3,6];if(this._indexedDb=t.indexedDB||t.mozIndexedDB||t.webkitIndexedDB||t.msIndexedDB,!this._window||!hf())return[3,4];if(!(hf()&&navigator.userAgent&&navigator.userAgent.includes("Edge/")))return[3,1];if(!this._window.indexedDB&&(t.PointerEvent||t.MSPointerEvent))throw st.storeNotAvailableInPrivateBrowsing;return[3,3];case 1:return[4,new Promise(function(s,o){if(r._indexedDb)try{var a=r._indexedDb.open("_testMozilla");a.onerror=function(){return o(st.storeNotAvailableInPrivateBrowsing)},a.onsuccess=function(l){if(l.target.result.close(),r._indexedDb){var u=r._indexedDb.deleteDatabase("_testMozilla");u.onerror=function(){return s()},u.onsuccess=function(){return s()}}else o(st.storeNotAvailable)}}catch{o(st.storeNotAvailableInPrivateBrowsing)}else o(st.storeNotAvailable)})];case 2:i.sent(),i.label=3;case 3:return[3,5];case 4:throw st.storeNotAvailable;case 5:return[3,7];case 6:throw st.storeNotAvailable;case 7:return[2]}})})},n.prototype.init=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return this.dbname=t,[4,this.checkAvailability()];case 1:return r.sent(),[4,this._openDatabase(t)];case 2:return r.sent(),[4,this._resetIfEncryptionChanged()];case 3:return r.sent(),[2]}})})},n.prototype.clear=function(){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return[4,this._getObjectStore("readwrite")];case 1:return t=r.sent(),[4,new Promise(function(i,s){var o=t.clear();o.addEventListener("success",function(){return i()}),o.addEventListener("error",function(a){return s(a.target.error)})})];case 2:return[2,r.sent()]}})})},n}(d0),Yx=function(e){function n(t){var r=this,i=t.AsyncStorage,s=t.itemSizeLimit,o=s===void 0?2097152:s,a=F4(t,["AsyncStorage","itemSizeLimit"]);return(r=e.call(this,x(x({},a),{itemSizeLimit:o}))||this)._asyncStorage=i,r}return T(n,e),n.prototype._isBelonging=function(t){return t.startsWith("".concat(this.dbname,"/"))},n.prototype._getActualKey=function(t){return"".concat(this.dbname,"/").concat(t)},n.prototype._getAllRawKeys=function(){return y(this,void 0,void 0,function(){var t,r=this;return v(this,function(i){switch(i.label){case 0:return[4,this._asyncStorage.getAllKeys()];case 1:return t=i.sent(),[2,t.filter(function(s){return r._isBelonging(s)}).map(function(s){return s.substring("".concat(r.dbname,"/").length)})]}})})},n.prototype._getRaw=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return[4,this._asyncStorage.getItem(this._getActualKey(t))];case 1:return[2,(r=i.sent())?JSON.parse(r):null]}})})},n.prototype._setRaw=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:r=[];try{for(i=pe(t),s=i.next();!s.done;s=i.next())o=s.value,a=o.key,o.data.length<=this.adjustedItemSizeLimit&&r.push([this._getActualKey(a),JSON.stringify(o)])}catch(d){l={error:d}}finally{try{s&&!s.done&&(u=i.return)&&u.call(i)}finally{if(l)throw l.error}}return[4,this._asyncStorage.multiSet(r)];case 1:return c.sent(),[2]}})})},n.prototype._removeRaw=function(t){return y(this,void 0,void 0,function(){var r=this;return v(this,function(i){switch(i.label){case 0:return[4,this._asyncStorage.multiRemove(t.map(function(s){return r._getActualKey(s)}))];case 1:return i.sent(),[2]}})})},n.prototype.checkAvailability=function(){return y(this,void 0,void 0,function(){return v(this,function(t){if(!this._asyncStorage)throw st.storeNotAvailable;return[2]})})},n.prototype.init=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return this.dbname=t,[4,this._resetIfEncryptionChanged()];case 1:return r.sent(),[2]}})})},n.prototype.clear=function(){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return[4,this.getAllKeys()];case 1:return t=r.sent(),[4,this.removeMany(t)];case 2:return r.sent(),[2]}})})},n}(d0),Zx=function(e){function n(t){var r,i=this;return(i=e.call(this,x(x({},t),{itemSizeLimit:(r=t.itemSizeLimit)!==null&&r!==void 0?r:6291456}))||this)._mmkv=t.MMKV,i}return T(n,e),n.prototype._isBelonging=function(t){return t.startsWith("".concat(this.dbname,"/"))},n.prototype._getActualKey=function(t){return"".concat(this.dbname,"/").concat(t)},n.prototype._getAllRawKeys=function(){return y(this,void 0,void 0,function(){var t,r=this;return v(this,function(i){switch(i.label){case 0:return[4,this._mmkv.getAllKeys()];case 1:return t=i.sent(),[2,t.filter(function(s){return r._isBelonging(s)}).map(function(s){return s.substring("".concat(r.dbname,"/").length)})]}})})},n.prototype._getRaw=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return[4,this._mmkv.getString(this._getActualKey(t))];case 1:return[2,(r=i.sent())?JSON.parse(r):null]}})})},n.prototype._setRaw=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l;return v(this,function(u){try{for(r=pe(t),i=r.next();!i.done;i=r.next())s=i.value,o=s.key,s.data.length<=this.adjustedItemSizeLimit&&this._mmkv.set(this._getActualKey(o),JSON.stringify(s))}catch(c){a={error:c}}finally{try{i&&!i.done&&(l=r.return)&&l.call(r)}finally{if(a)throw a.error}}return[2]})})},n.prototype._removeRaw=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a;return v(this,function(l){try{for(r=pe(t),i=r.next();!i.done;i=r.next())s=i.value,this._mmkv.delete(this._getActualKey(s))}catch(u){o={error:u}}finally{try{i&&!i.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}}return[2]})})},n.prototype.checkAvailability=function(){return y(this,void 0,void 0,function(){return v(this,function(t){if(!this._mmkv)throw st.storeNotAvailable;return[2]})})},n.prototype.init=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return this.dbname=t,[4,this._resetIfEncryptionChanged()];case 1:return r.sent(),[2]}})})},n.prototype.clear=function(){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return[4,this.getAllKeys()];case 1:return t=r.sent(),[4,this.removeMany(t)];case 2:return r.sent(),[2]}})})},n}(d0);(function(e){e.INIT="INIT",e.OPENING="OPENING",e.OPENED="OPENED",e.CLOSED="CLOSED"})(ns||(ns={}));var As,Xx=function(){function e(n){var t=n.name,r=n.version,i=n.store,s=n.config;this.name=t,this._version=r,this._state=ns.INIT,this._config=s||new Zc({dbname:t}),this._store=i,this._event={success:Au,error:Au,storeReplaced:Au,upgrade:ay},this._collections=new Map,this._globalMutex=new rv("".concat(this.name,".lock")),this._config.disableLogger&&Vo.off(),new Si({dbname:t,limit:this._config.cacheLimit})}return Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"store",{get:function(){return this._store},enumerable:!1,configurable:!0}),e.prototype.estimateUsage=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return[4,(t=this._store,y(void 0,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return[4,t.usage()];case 1:return[2,r.sent()]}})}))];case 1:return[2,n.sent()]}var t})})},e.prototype.commitSchema=function(n){return y(this,void 0,void 0,function(){var t=this;return v(this,function(r){switch(r.label){case 0:return this._state!==ns.OPENING?[3,2]:[4,Promise.all(n.map(function(i){return y(t,void 0,void 0,function(){var s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return s=i.collectionName,o=i.keyName,a=i.index,l=a===void 0?[]:a,this._collections.has(s)||this._collections.set(s,new Mp({dbname:this.name,collectionName:s,keyName:o,indexes:l,store:this._store})),(u=this._collections.get(s))?[4,u.init()]:[3,2];case 1:c.sent(),c.label=2;case 2:return[2]}})})}))];case 1:return r.sent(),[3,3];case 2:throw st.databaseSchemaNotOnUpgrade;case 3:return[2]}})})},e.prototype.open=function(){var n;return y(this,void 0,void 0,function(){var t,r,i,s,o=this;return v(this,function(a){switch(a.label){case 0:return[4,this._globalMutex.lock()];case 1:if(a.sent(),this._state===ns.OPENED)return[3,12];this._state=ns.OPENING,a.label=2;case 2:return a.trys.push([2,5,,12]),[4,this._store.init(this.name)];case 3:return a.sent(),l=this.name,t="".concat(_m(l),".metadata"),r={version:0,collectionNames:[]},[4,this._store.get(t)];case 4:return i=(n=a.sent())!==null&&n!==void 0?n:r,[2,new Promise(function(u,c){var d=function(f){i.version0&&!this.customTypesFilter.includes("*")&&!this.customTypesFilter.includes(n.customType)||this.senderUserIdsFilter&&this.senderUserIdsFilter.length>0&&(!(n instanceof Ft)||!this.senderUserIdsFilter.includes(n.sender.userId)))return!1;if(n instanceof hr)switch(this.replyType){case Dn.NONE:if(n.parentMessageId>0)return!1;break;case Dn.ONLY_REPLY_TO_CHANNEL:if(n instanceof Ft&&n.parentMessageId>0&&!n.replyToChannel)return!1}return!0},e}();(function(e){e.CHANNEL_LATEST="channel_latest",e.NEWEST_CHILD_MESSAGE="newest_child_message"})(Vn||(Vn={}));var ic,cs=function(e){switch(e){case Vn.CHANNEL_LATEST:return["channelUrl","-createdAt","-messageId"];case Vn.NEWEST_CHILD_MESSAGE:return["channelUrl","-parentMessageId","-createdAt","-messageId"]}},eO=function(){return["channelUrl","-createdAt","-notificationId"]},tO=x(x({},uS),{scheduledAt:void 0}),nO=function(e){return dS(e)&&R("number",e.scheduledAt,!0)},rO=x(x({},u0),{scheduledAt:0,file:void 0,fileUrl:void 0,fileName:void 0,mimeType:void 0,fileSize:void 0,thumbnailSizes:void 0,requireAuth:!1}),iO=function(e){return c0(e)&&R("number",e.scheduledAt)&&(pr(e.file)||R("string",e.fileUrl))&&R("string",e.fileName,!0)&&R("string",e.mimeType,!0)&&R("number",e.fileSize,!0)&&(e.thumbnailSizes===null||e.thumbnailSizes===void 0||e.thumbnailSizes.every(function(n){return R("object",n)&&n.maxWidth>0&&n.maxHeight>0}))},SS="UnsentMessage",sO="reqId",jd={},Aa=function(e){function n(t){var r=e.call(this,t)||this;return r._mutex=new rv("unsendmessagecache.lock"),jd[t]=r,r}return T(n,e),Object.defineProperty(n.prototype,"_cacheContext",{get:function(){return O.of(this._iid).cacheContext},enumerable:!1,configurable:!0}),n.of=function(t,r){return r===void 0&&(r=!1),jd[t]&&!r||(jd[t]=new n(t)),jd[t]},Object.defineProperty(n.prototype,"collection",{get:function(){var t=this._cacheContext.nestdb,r=t==null?void 0:t.collection(SS);if(!r)throw L.databaseError;return r},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localCacheEnabled",{get:function(){return this._cacheContext.localCacheEnabled&&!!this.collection},enumerable:!1,configurable:!0}),n.prototype._serialize=function(t){if(t.messageId>0)throw L.invalidParameters;var r,i=x({},t.serialize());return t instanceof er?(t.messageParams&&(i.messageParams=q1(t.messageParams)),t.scheduledInfo&&t.scheduledInfo.scheduledMessageParams&&(i.scheduledInfo.scheduledMessageParams=(r=t.scheduledInfo.scheduledMessageParams,x(x({},q1(r)),{scheduledAt:r.scheduledAt})))):t instanceof Jt?(t.messageParams&&(i.messageParams=W1(t.messageParams)),t.scheduledInfo&&t.scheduledInfo.scheduledMessageParams&&(i.scheduledInfo.scheduledMessageParams=function(s){return x(x({},W1(s)),{scheduledAt:s.scheduledAt})}(t.scheduledInfo.scheduledMessageParams))):t instanceof li&&t.messageParams&&(i.messageParams=function(s){return ye({fileInfoList:s.fileInfoList,isReplyToChannel:s.isReplyToChannel,pushNotificationDeliveryOption:s.pushNotificationDeliveryOption})}(t.messageParams)),i},n.prototype._deserialize=function(t){return t=x(x({},t),{messageId:parseInt(t.messageId)}),An.of(this._iid).buildMessageFromSerializedData(t)},n.prototype._deserializeWithMessageCreateParams=function(t){var r,i,s;return y(this,void 0,void 0,function(){var o,a,l,u,c,d,h=this;return v(this,function(f){switch(f.label){case 0:return o=An.of(this._iid),a=this._deserialize(t),t.messageParams?a instanceof er?(u=t.messageParams,a.messageParams=o.buildUserMessageCreateParamsFromSerializedData(u,a),[3,6]):[3,1]:[3,6];case 1:return a instanceof Jt?(u=t.messageParams).fileKey&&typeof u.fileKey=="string"&&Tp((r=u.fileType)!==null&&r!==void 0?r:"")?(l=u,[4,this.collection.getBlob(u.fileKey)]):[3,3]:[3,4];case 2:l.file=(i=f.sent())!==null&&i!==void 0?i:void 0,f.label=3;case 3:return a.messageParams=o.buildFileMessageCreateParamsFromSerializedData(u,a),[3,6];case 4:return a instanceof li&&(u=t.messageParams)&&u.fileInfoList?(a.messageParams=o.buildMultipleFilesMessageCreateParamsFromSerializedData(u,a),[4,Promise.all(a.messageParams.fileInfoList.map(function(p){return y(h,void 0,void 0,function(){var g,b,m,_,E;return v(this,function(S){switch(S.label){case 0:return typeof((b=p._uploadedMetaData)===null||b===void 0?void 0:b.fileKey)=="string"&&Tp((_=(m=p._uploadedMetaData)===null||m===void 0?void 0:m.fileType)!==null&&_!==void 0?_:"")?(g=p,[4,this.collection.getBlob(p._uploadedMetaData.fileKey)]):[3,2];case 1:g.file=(E=S.sent())!==null&&E!==void 0?E:void 0,S.label=2;case 2:return[2]}})})}))]):[3,6];case 5:f.sent(),f.label=6;case 6:return a.scheduledInfo&&t.scheduledInfo&&t.scheduledInfo.scheduledMessageParams?a instanceof er?(c=t.scheduledInfo.scheduledMessageParams,a.scheduledInfo.scheduledMessageParams=o.buildScheduledUserMessageCreateParamsFromSerializedData(c,a),[3,10]):[3,7]:[3,10];case 7:return a instanceof Jt?(c=t.scheduledInfo.scheduledMessageParams).fileKey&&typeof c.fileKey=="string"&&typeof c.fileType=="string"&&Tp(c.fileType)?(d=c,[4,this.collection.getBlob(c.fileKey)]):[3,9]:[3,10];case 8:d.file=(s=f.sent())!==null&&s!==void 0?s:void 0,f.label=9;case 9:a.scheduledInfo.scheduledMessageParams=o.buildScheduledFileMessageCreateParamsFromSerializedData(c,a),f.label=10;case 10:return[2,a]}})})},n.prototype._getFileInfoBlobKey=function(t,r){return"".concat(t,".").concat(r)},n.prototype.get=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return this.localCacheEnabled?[4,this.collection.getByKey("".concat(t))]:[3,2];case 1:if(r=i.sent())return[2,this._deserializeWithMessageCreateParams(r)];i.label=2;case 2:return[2,void 0]}})})},n.prototype.fetch=function(t){var r=t.channelUrl,i=t.filter,s=i===void 0?new _s:i,o=t.order,a=o===void 0?Vn.CHANNEL_LATEST:o,l=t.sendingStatus,u=t.backward,c=u!==void 0&&u,d=t.parentMessageId;return y(this,void 0,void 0,function(){var h,f,p,g,b=this;return v(this,function(m){switch(m.label){case 0:return this.localCacheEnabled?(h=cs(a),f={"/where":function(_){return!!(a!==Vn.NEWEST_CHILD_MESSAGE||d&&_.parentMessageId!==0&&_.parentMessageId===d)&&s.match(b._deserialize(_))}},r&&(f.channelUrl=r),l&&(f.sendingStatus=l),p={where:f,index:h,backward:c},[4,this.collection.query(p)]):[3,3];case 1:return[4,m.sent().fetch({})];case 2:return g=m.sent(),[2,Promise.all(g.map(function(_){return y(b,void 0,void 0,function(){return v(this,function(E){switch(E.label){case 0:return[4,this._deserializeWithMessageCreateParams(_)];case 1:return[2,E.sent()]}})})}))];case 3:return[2,[]]}})})},n.prototype.getAllChildMessages=function(t,r){return r===void 0&&(r=new _s),y(this,void 0,void 0,function(){return v(this,function(i){switch(i.label){case 0:return[4,this.fetch({filter:r,order:Vn.NEWEST_CHILD_MESSAGE,channelUrl:t.channelUrl,backward:!1,parentMessageId:t.messageId})];case 1:return[2,i.sent()]}})})},n.prototype.upsert=function(t){return y(this,void 0,void 0,function(){var r=this;return v(this,function(i){switch(i.label){case 0:return this.localCacheEnabled?[4,Promise.all(t.map(function(s){return y(r,void 0,void 0,function(){var o;return v(this,function(a){switch(a.label){case 0:return s instanceof Jt||s instanceof li?[4,this._mutex.lock()]:[3,4];case 1:return a.sent(),[4,this.saveBlob(s)];case 2:return a.sent(),[4,this._mutex.unlock()];case 3:a.sent(),a.label=4;case 4:return o=this._serialize(s),[4,this.collection.upsertOne(o)];case 5:return a.sent(),[2]}})})}))]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},n.prototype.upsertChildMessages=function(t){return y(this,void 0,void 0,function(){var r=this;return v(this,function(i){switch(i.label){case 0:return this.localCacheEnabled?[4,Promise.all(t.map(function(s){return y(r,void 0,void 0,function(){var o;return v(this,function(a){switch(a.label){case 0:return o=[],s.threadInfo&&s.threadInfo.replyCount>0?[4,this.getAllChildMessages(s)]:[3,2];case 1:o=a.sent(),a.label=2;case 2:return o.length>0?(o.forEach(function(l){return l.applyParentMessage(s)}),[4,this.upsert(o)]):[3,4];case 3:a.sent(),a.label=4;case 4:return[2]}})})}))]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},n.prototype.remove=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:if(!this.localCacheEnabled)return[3,8];u.label=1;case 1:u.trys.push([1,6,7,8]),r=pe(t),i=r.next(),u.label=2;case 2:return i.done?[3,5]:(s=i.value,[4,this.collection.remove(s)]);case 3:u.sent(),u.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return o=u.sent(),a={error:o},[3,8];case 7:try{i&&!i.done&&(l=r.return)&&l.call(r)}finally{if(a)throw a.error}return[7];case 8:return[2]}})})},n.prototype.removeMessagesOfChannel=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return this.localCacheEnabled?[4,this.collection.removeIf({where:{channelUrl:t}})]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}})})},n.prototype.clear=function(){return y(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return this.localCacheEnabled?[4,this.collection.clear()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},n.prototype.saveBlob=function(t){return y(this,void 0,void 0,function(){var r,i,s,o=this;return v(this,function(a){switch(a.label){case 0:return t instanceof Jt?t.messageParams&&(s=t.messageParams).file&&fh(s.file)?[4,this.collection.saveBlob(s.file,t.reqId)]:[3,2]:[3,5];case 1:i=a.sent(),s.fileKey=i,s.fileType=_a.BLOB,a.label=2;case 2:return t.scheduledInfo&&t.scheduledInfo.scheduledMessageParams&&(r=t.scheduledInfo.scheduledMessageParams).file&&fh(r.file)?[4,this.collection.saveBlob(r.file,t.reqId)]:[3,4];case 3:i=a.sent(),r.fileKey=i,r.fileType=_a.BLOB,a.label=4;case 4:return[3,7];case 5:return t instanceof li&&(s=t.messageParams)&&s.fileInfoList&&Array.isArray(s.fileInfoList)?[4,Promise.all(s.fileInfoList.map(function(l,u){return y(o,void 0,void 0,function(){var c;return v(this,function(d){switch(d.label){case 0:return l.file&&fh(l.file)?[4,this.collection.saveBlob(l.file,this._getFileInfoBlobKey(t.reqId,u))]:[3,2];case 1:c=d.sent(),l._uploadedMetaData||(l._uploadedMetaData={}),l._uploadedMetaData.fileKey=c,l._uploadedMetaData.fileType=_a.BLOB,d.label=2;case 2:return[2]}})})}))]:[3,7];case 6:a.sent(),a.label=7;case 7:return[2]}})})},n}(Kn),Bd={},Sl=function(e){function n(t){var r=e.call(this,t)||this;return Bd[t]=r,r}return T(n,e),Object.defineProperty(n.prototype,"_sdkState",{get:function(){return O.of(this._iid).sdkState},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_cacheContext",{get:function(){return O.of(this._iid).cacheContext},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_unsentMessageCache",{get:function(){return Aa.of(this._iid)},enumerable:!1,configurable:!0}),n.of=function(t,r){return r===void 0&&(r=!1),Bd[t]&&!r||(Bd[t]=new n(t)),Bd[t]},Object.defineProperty(n.prototype,"collection",{get:function(){var t=this._cacheContext.nestdb;return Y(!!t).throw(L.databaseError),t.collection(fm)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localCacheEnabled",{get:function(){return this._cacheContext.localCacheEnabled&&!!this.collection},enumerable:!1,configurable:!0}),n.prototype._serialize=function(t){return x(x({},t.serialize()),{messageId:"".concat(t.messageId)})},n.prototype._deserialize=function(t){return t=x(x({},t),{messageId:parseInt(t.messageId)}),An.of(this._iid).buildMessageFromSerializedData(t)},n.prototype.get=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return this.localCacheEnabled?[4,this.collection.getByKey("".concat(t))]:[3,2];case 1:if(r=i.sent())return[2,this._deserialize(r)];i.label=2;case 2:return[2,void 0]}})})},n.prototype.fetch=function(t){var r=t.channelUrl,i=t.token,s=t.limit,o=s===void 0?100:s,a=t.filter,l=a===void 0?new _s:a,u=t.order,c=u===void 0?Vn.CHANNEL_LATEST:u,d=t.backward,h=d!==void 0&&d,f=t.parentMessageId,p=t.isPollOnly,g=p!==void 0&&p,b=t.exactMatch,m=b!==void 0&&b,_=t.inclusive,E=_===void 0||_;return y(this,void 0,void 0,function(){var S,w,N,A=this;return v(this,function(k){switch(k.label){case 0:return this.localCacheEnabled?(S=cs(c),w={where:{channelUrl:r,"/where":function(I){if(i)switch(c){case Vn.CHANNEL_LATEST:if(m&&I.createdAt!==i)return!1;if(h){if(E&&I.createdAti||!E&&I.createdAt>=i)return!1;break;case Vn.NEWEST_CHILD_MESSAGE:if(!f||I.parentMessageId===0||I.parentMessageId!==f)return!1}return!(g&&!I._poll)&&l.match(A._deserialize(I))}},index:S,backward:h},[4,this.collection.query(w)]):[3,3];case 1:return[4,k.sent().fetch({limit:o??void 0})];case 2:return N=k.sent(),[2,Promise.all(N.map(function(I){return y(A,void 0,void 0,function(){return v(this,function(M){return[2,this._deserialize(I)]})})}))];case 3:return[2,[]]}})})},n.prototype.getAllChildMessages=function(t,r){return r===void 0&&(r=new _s),y(this,void 0,void 0,function(){return v(this,function(i){switch(i.label){case 0:return[4,this.fetch({channelUrl:t.channelUrl,token:Date.now(),limit:null,backward:!1,filter:r,order:Vn.NEWEST_CHILD_MESSAGE,parentMessageId:t.messageId})];case 1:return[2,i.sent()]}})})},n.prototype.upsert=function(t){var r;return y(this,void 0,void 0,function(){var i,s,o,a,l,u,c,d,h=this;return v(this,function(f){switch(f.label){case 0:return this.localCacheEnabled?[4,this.saveBlobs(t)]:[3,13];case 1:f.sent(),f.label=2;case 2:f.trys.push([2,7,8,9]),i=pe(t),s=i.next(),f.label=3;case 3:return s.done?[3,6]:(o=s.value,!((r=o.threadInfo)===null||r===void 0)&&r._isUpdateRequired?[4,this.get(o.messageId)]:[3,5]);case 4:(a=f.sent())!=null&&a.threadInfo&&o.threadInfo._updateFrom(a.threadInfo),f.label=5;case 5:return s=i.next(),[3,3];case 6:return[3,9];case 7:return l=f.sent(),c={error:l},[3,9];case 8:try{s&&!s.done&&(d=i.return)&&d.call(i)}finally{if(c)throw c.error}return[7];case 9:return u=t.map(function(p){return h._serialize(p)}),[4,this.collection.upsertMany(u)];case 10:return f.sent(),[4,this.upsertChildMessages(t)];case 11:return f.sent(),[4,this._unsentMessageCache.upsertChildMessages(t)];case 12:f.sent(),f.label=13;case 13:return[2]}})})},n.prototype.upsertChildMessages=function(t){return y(this,void 0,void 0,function(){var r=this;return v(this,function(i){switch(i.label){case 0:return this.localCacheEnabled?[4,Promise.all(t.map(function(s){return y(r,void 0,void 0,function(){var o,a;return v(this,function(l){switch(l.label){case 0:return o=[],!((a=s.threadInfo)===null||a===void 0)&&a.replyCount&&s.threadInfo.replyCount>0?[4,this.getAllChildMessages(s)]:[3,2];case 1:o=l.sent(),l.label=2;case 2:return o.length>0?(o.forEach(function(u){return u.applyParentMessage(s)}),[4,this.upsert(o)]):[3,4];case 3:l.sent(),l.label=4;case 4:return[2]}})})}))]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},n.prototype.remove=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:if(!this.localCacheEnabled)return[3,8];u.label=1;case 1:u.trys.push([1,6,7,8]),r=pe(t),i=r.next(),u.label=2;case 2:return i.done?[3,5]:(s=i.value,[4,this.collection.remove("".concat(s))]);case 3:u.sent(),u.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return o=u.sent(),a={error:o},[3,8];case 7:try{i&&!i.done&&(l=r.return)&&l.call(r)}finally{if(a)throw a.error}return[7];case 8:return[2]}})})},n.prototype.removeMessagesOfChannel=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return this.localCacheEnabled?[4,this.collection.removeIf({where:{channelUrl:t},index:cs(Vn.CHANNEL_LATEST)})]:[3,6];case 1:return i.sent(),[4,(r=this._cacheContext.preference).remove("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(t,"/message/sync"))];case 2:return i.sent(),[4,r.remove("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(t,"/message/sync.meta"))];case 3:return i.sent(),[4,r.remove("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(t,"/message/changelogs"))];case 4:return i.sent(),[4,r.remove("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(t,"/message/changelogs.meta"))];case 5:i.sent(),i.label=6;case 6:return[2]}})})},n.prototype.removeUnderOffset=function(t,r){return y(this,void 0,void 0,function(){return v(this,function(i){switch(i.label){case 0:return this.localCacheEnabled?[4,this.collection.removeIf({where:{channelUrl:t,createdAt:{"<":r}},index:cs(Vn.CHANNEL_LATEST)})]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},n.prototype.clear=function(){return y(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return this.localCacheEnabled?[4,this.collection.clear()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},n.prototype.countBetween=function(t,r,i){return y(this,void 0,void 0,function(){var s,o=this;return v(this,function(a){switch(a.label){case 0:return this.localCacheEnabled?(s=cs(Vn.CHANNEL_LATEST),[4,this.collection.query({where:{channelUrl:t,"/where":function(l){var u=o._deserialize(l);return i.includes(u.createdAt)&&r.match(u)}},index:s}).count()]):[3,2];case 1:return[2,a.sent()];case 2:return[2,0]}})})},n.prototype.saveBlobs=function(t){return y(this,void 0,void 0,function(){var r=this;return v(this,function(i){switch(i.label){case 0:return[4,Promise.all(t.map(function(s){return y(r,void 0,void 0,function(){var o,a;return v(this,function(l){switch(l.label){case 0:return s instanceof Jt&&s.messageParams&&(o=s.messageParams).file&&fh(o.file)?[4,this.collection.saveBlob(o.file,s.reqId)]:[3,2];case 1:a=l.sent(),o.fileKey=a,l.label=2;case 2:return[2]}})})}))];case 1:return i.sent(),[2]}})})},n.prototype._getGroupChannelPreferenceSize=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:return r=0,[4,(i=this._cacheContext.preference).get("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(t,"/message/sync"))];case 1:return s=u.sent(),[4,i.get("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(t,"/message/sync.meta"))];case 2:return o=u.sent(),[4,i.get("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(t,"/message/changelogs"))];case 3:return a=u.sent(),[4,i.get("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(t,"/message/changelogs.meta"))];case 4:return l=u.sent(),s&&(r+=JSON.stringify(s).length),o&&(r+=JSON.stringify(o).length),a&&(r+=JSON.stringify(a).length),l&&(r+=JSON.stringify(l).length),[2,r]}})})},n}(Kn),$d={},oO=function(e){function n(t){var r=e.call(this,t)||this;return $d[t]=r,r}return T(n,e),Object.defineProperty(n.prototype,"_sdkState",{get:function(){return O.of(this._iid).sdkState},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_cacheContext",{get:function(){return O.of(this._iid).cacheContext},enumerable:!1,configurable:!0}),n.of=function(t,r){return r===void 0&&(r=!1),$d[t]&&!r||($d[t]=new n(t)),$d[t]},Object.defineProperty(n.prototype,"collection",{get:function(){var t=this._cacheContext.nestdb;return Y(!!t).throw(L.databaseError),t.collection(bS)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localCacheEnabled",{get:function(){return this._cacheContext.localCacheEnabled&&!!this.collection},enumerable:!1,configurable:!0}),n.prototype._serialize=function(t){return x({},t.serialize())},n.prototype._deserialize=function(t){return An.of(this._iid).buildMessageFromSerializedData(t)},n.prototype.get=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return this.localCacheEnabled?[4,this.collection.getByKey(t)]:[3,2];case 1:if(r=i.sent())return[2,this._deserialize(r)];i.label=2;case 2:return[2,void 0]}})})},n.prototype.fetch=function(t){var r=t.channelUrl,i=t.token,s=t.limit,o=s===void 0?100:s,a=t.filter,l=a===void 0?new _s:a,u=t.backward,c=u!==void 0&&u,d=t.exactMatch,h=d!==void 0&&d,f=t.inclusive,p=f===void 0||f;return y(this,void 0,void 0,function(){var g,b=this;return v(this,function(m){switch(m.label){case 0:return this.localCacheEnabled?(g={where:{channelUrl:r,"/where":function(_){if(i){if(h&&_.createdAt!==i)return!1;if(c){if(p&&_.createdAti||!p&&_.createdAt>=i)return!1}return l.match(b._deserialize(_))}},index:["channelUrl","-createdAt","-notificationId"],backward:c},[4,this.collection.query(g)]):[3,3];case 1:return[4,m.sent().fetch({limit:o??void 0})];case 2:return[2,m.sent().map(function(_){return b._deserialize(_)})];case 3:return[2,[]]}})})},n.prototype.upsert=function(t){return y(this,void 0,void 0,function(){var r,i=this;return v(this,function(s){switch(s.label){case 0:return this.localCacheEnabled?(r=t.map(function(o){return i._serialize(o)}),[4,this.collection.upsertMany(r)]):[3,2];case 1:s.sent(),s.label=2;case 2:return[2]}})})},n.prototype.remove=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:if(!this.localCacheEnabled)return[3,8];u.label=1;case 1:u.trys.push([1,6,7,8]),r=pe(t),i=r.next(),u.label=2;case 2:return i.done?[3,5]:(s=i.value,[4,this.collection.remove(s)]);case 3:u.sent(),u.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return o=u.sent(),a={error:o},[3,8];case 7:try{i&&!i.done&&(l=r.return)&&l.call(r)}finally{if(a)throw a.error}return[7];case 8:return[2]}})})},n.prototype.markAsReadByTimestamp=function(t,r){return y(this,void 0,void 0,function(){return v(this,function(i){switch(i.label){case 0:return this.localCacheEnabled?[4,this.collection.updateIf({where:{channelUrl:t,messageStatus:aa.SENT,createdAt:{"<":r}}},{set:{messageStatus:aa.READ}})]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},n.prototype.markAsReadByMessageIds=function(t,r){return y(this,void 0,void 0,function(){return v(this,function(i){switch(i.label){case 0:return this.localCacheEnabled?[4,this.collection.updateIf({where:{channelUrl:t,notificationId:{"/in":r},messageStatus:aa.SENT}},{set:{messageStatus:aa.READ}})]:[3,2];case 1:return[2,i.sent().length];case 2:return[2,0]}})})},n.prototype.removeMessagesOfChannel=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return this.localCacheEnabled?[4,this.collection.removeIf({where:{channelUrl:t},index:["channelUrl","-createdAt","-notificationId"]})]:[3,6];case 1:return i.sent(),[4,(r=this._cacheContext.preference).remove("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(t,"/message/sync"))];case 2:return i.sent(),[4,r.remove("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(t,"/message/sync.meta"))];case 3:return i.sent(),[4,r.remove("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(t,"/message/changelogs"))];case 4:return i.sent(),[4,r.remove("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(t,"/message/changelogs.meta"))];case 5:i.sent(),i.label=6;case 6:return[2]}})})},n.prototype.removeUnderOffset=function(t,r){return y(this,void 0,void 0,function(){return v(this,function(i){switch(i.label){case 0:return this.localCacheEnabled?[4,this.collection.removeIf({where:{channelUrl:t,createdAt:{"<":r}},index:cs(Vn.CHANNEL_LATEST)})]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},n.prototype.clear=function(){return y(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return this.localCacheEnabled?[4,this.collection.clear()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},n.prototype.countBetween=function(t,r,i){return y(this,void 0,void 0,function(){var s,o=this;return v(this,function(a){switch(a.label){case 0:return this.localCacheEnabled?(s=["channelUrl","-createdAt","-notificationId"],[4,this.collection.query({where:{channelUrl:t,"/where":function(l){var u=o._deserialize(l);return i.includes(u.createdAt)&&r.match(u)}},index:s}).count()]):[3,2];case 1:return[2,a.sent()];case 2:return[2,0]}})})},n}(Kn),uu={},TS=function(e){function n(t){var r=e.call(this,t)||this;return r._observers=new Map,r._dispatcherContext=r._dispatcher.on(function(i){return y(r,void 0,void 0,function(){var s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S,w,N,A,k=this;return v(this,function(I){switch(I.label){case 0:return i instanceof bt?(s=i.messages,A=i.source,c=i.isWebSocketEventComing,o=s.filter(function(M){return M instanceof hr&&M.channelType!==Ze.OPEN&&M.messageId>0}),a=s.filter(function(M){return M instanceof hr&&M.channelType!==Ze.OPEN&&M.messageId===0}),l=s.filter(function(M){return M instanceof Na}),o.length>0?[4,kt(function(){return y(k,void 0,void 0,function(){return v(this,function(M){switch(M.label){case 0:return[4,this._messageCache.upsert(o)];case 1:return M.sent(),[4,this._unsentMessageCache.remove(o.map(function(U){return U instanceof Ft?U.reqId:null}).filter(function(U){return U!==null}))];case 2:return M.sent(),[2]}})})})]:[3,2]):[3,7];case 1:I.sent(),c||this._broadcastUpdateEvent(o,A),I.label=2;case 2:return a.length>0?[4,kt(function(){return y(k,void 0,void 0,function(){return v(this,function(M){switch(M.label){case 0:return[4,this._unsentMessageCache.upsert(a)];case 1:return M.sent(),[2]}})})})]:[3,4];case 3:I.sent(),c||this._broadcastUpdateEvent(a,A),I.label=4;case 4:return l.length>0?[4,kt(function(){return y(k,void 0,void 0,function(){return v(this,function(M){switch(M.label){case 0:return[4,this._notificationCache.upsert(l)];case 1:return M.sent(),[2]}})})})]:[3,6];case 5:I.sent(),c||this._broadcastUpdateEvent(l,A),I.label=6;case 6:return[3,24];case 7:return i instanceof Xg?(u=i.messageIds,A=i.source,c=i.isWebSocketEventComing,d=u.filter(function(M){return typeof M=="number"}),h=u.filter(function(M){return typeof M=="string"}),[4,kt(function(){return y(k,void 0,void 0,function(){return v(this,function(M){switch(M.label){case 0:return d.length>0?[4,this._messageCache.remove(d)]:[3,2];case 1:M.sent(),M.label=2;case 2:return h.length>0?[4,this._notificationCache.remove(h)]:[3,4];case 3:M.sent(),M.label=4;case 4:return[2]}})})})]):[3,9];case 8:return I.sent(),c||this._broadcastRemoveEvent(u,A),[3,24];case 9:return i instanceof qC?(f=i.reqId,A=i.source,[4,kt(function(){return y(k,void 0,void 0,function(){return v(this,function(M){switch(M.label){case 0:return[4,this._unsentMessageCache.remove([f])];case 1:return M.sent(),[2]}})})})]):[3,11];case 10:return I.sent(),this._broadcastRemoveUnsentEvent(f,A),[3,24];case 11:return i instanceof WC?(p=i.polls,A=i.source,this._cacheContext.localCacheEnabled?(g=p.map(function(M){return M.messageId}),[4,Promise.all(g.map(function(M){return k._messageCache.get(M)}))]):[3,14]):[3,15];case 12:return(b=I.sent().filter(function(M){return M})).length>0&&p.forEach(function(M){var U=b.find(function(z){return z.messageId===M.messageId});U&&U.applyPoll(M)}),[4,kt(function(){return y(k,void 0,void 0,function(){return v(this,function(M){switch(M.label){case 0:return[4,this._messageCache.upsert(b)];case 1:return[2,M.sent()]}})})})];case 13:I.sent(),I.label=14;case 14:return this._broadcastPollChangeLogEvent(p,A),[3,24];case 15:return i instanceof KC?(m=i.event,A=i.source,[4,this._messageCache.get(m.messageId)]):[3,19];case 16:return(_=I.sent())&&_.isUserMessage()&&_.poll&&_.poll.applyPollUpdateEvent(m)?[4,kt(function(){return y(k,void 0,void 0,function(){return v(this,function(M){switch(M.label){case 0:return[4,this._messageCache.upsert([_])];case 1:return[2,M.sent()]}})})})]:[3,18];case 17:I.sent(),I.label=18;case 18:return this._broadcastPollUpdateEvent(m,A),[3,24];case 19:return i instanceof Jg?(E=i.event,A=i.source,[4,this._messageCache.get(E.messageId)]):[3,23];case 20:return(S=I.sent())&&S.isUserMessage()&&S.poll&&S.poll.applyPollVoteEvent(E)?[4,kt(function(){return y(k,void 0,void 0,function(){return v(this,function(M){switch(M.label){case 0:return[4,this._messageCache.upsert([S])];case 1:return[2,M.sent()]}})})})]:[3,22];case 21:I.sent(),I.label=22;case 22:return this._broadcastPollVoteEvent(E,A),[3,24];case 23:i instanceof zC?(w=i.event,A=i.source,w.messageId>0&&this._broadcastReactionUpdateEvent(w,A)):i instanceof VC&&(N=i.event,A=i.source,this._broadcastThreadUpdateEvent(N,A)),I.label=24;case 24:return[2]}})})}),r}return T(n,e),Object.defineProperty(n.prototype,"_cacheContext",{get:function(){return O.of(this._iid).cacheContext},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_dispatcher",{get:function(){return O.of(this._iid).dispatcher},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_messageCache",{get:function(){return Sl.of(this._iid)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_unsentMessageCache",{get:function(){return Aa.of(this._iid)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_notificationCache",{get:function(){return oO.of(this._iid)},enumerable:!1,configurable:!0}),n.of=function(t,r){var i;return r===void 0&&(r=!1),uu[t]&&!r||(uu[t]&&((i=uu[t]._dispatcherContext)===null||i===void 0||i.close()),uu[t]=new n(t)),uu[t]},n.prototype._broadcastUpdateEvent=function(t,r){var i,s;try{for(var o=pe(this._observers.values()),a=o.next();!a.done;a=o.next()){var l=a.value;l.onUpdate&&l.onUpdate(t,r)}}catch(u){i={error:u}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}},n.prototype._broadcastPollChangeLogEvent=function(t,r){var i,s;try{for(var o=pe(this._observers.values()),a=o.next();!a.done;a=o.next()){var l=a.value;l.onPollChangeLogUpdate&&l.onPollChangeLogUpdate(t,r)}}catch(u){i={error:u}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}},n.prototype._broadcastPollUpdateEvent=function(t,r){var i,s;try{for(var o=pe(this._observers.values()),a=o.next();!a.done;a=o.next()){var l=a.value;l.onPollUpdate&&l.onPollUpdate(t,r)}}catch(u){i={error:u}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}},n.prototype._broadcastPollVoteEvent=function(t,r){var i,s;try{for(var o=pe(this._observers.values()),a=o.next();!a.done;a=o.next()){var l=a.value;l.onPollVote&&l.onPollVote(t,r)}}catch(u){i={error:u}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}},n.prototype._broadcastRemoveEvent=function(t,r){var i,s;try{for(var o=pe(this._observers.values()),a=o.next();!a.done;a=o.next()){var l=a.value;l.onRemove&&l.onRemove(t,r)}}catch(u){i={error:u}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}},n.prototype._broadcastRemoveUnsentEvent=function(t,r){var i,s;try{for(var o=pe(this._observers.values()),a=o.next();!a.done;a=o.next()){var l=a.value;l.onRemoveUnsent&&l.onRemoveUnsent(t,r)}}catch(u){i={error:u}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}},n.prototype._broadcastReactionUpdateEvent=function(t,r){var i,s;try{for(var o=pe(this._observers.values()),a=o.next();!a.done;a=o.next()){var l=a.value;l.onReactionUpdate&&l.onReactionUpdate(t,r)}}catch(u){i={error:u}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}},n.prototype._broadcastThreadUpdateEvent=function(t,r){var i,s;try{for(var o=pe(this._observers.values()),a=o.next();!a.done;a=o.next()){var l=a.value;l.onThreadInfoUpdate&&l.onThreadInfoUpdate(t,r)}}catch(u){i={error:u}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}},n.prototype.subscribe=function(t,r){this._observers.set(t,r)},n.prototype.unsubscribe=function(t){this._observers.delete(t)},n.prototype.unsubscribeAll=function(){this._observers.clear()},n}(Kn),aO=function(e){function n(t){var r=this,i=t.reverse,s=i!==void 0&&i,o=t.limit,a=o===void 0?20:o,l=t.keys,u=t.token;return(r=e.call(this)||this).method=Z.GET,r.path="".concat(dC),r.params=ye({token:u,limit:a,reverse:s,order:Y_.UPDATED_AT,show_ui_template:!0,show_color_variables:!0,keys:l}),r}return T(n,e),n}(J),lO=function(e){function n(t,r){var i=e.call(this,t,r)||this,s=r.next,o=r.has_more,a=o!==void 0&&o,l=r.templates;return i.nextToken=s,i.hasMore=a,i.templates=l.map(function(u){return{template:JSON.stringify(u)}}),i}return T(n,e),n}(se),uO=function(e){function n(t){var r=this,i=t.key;return(r=e.call(this)||this).method=Z.GET,r.path="".concat(dC,"/").concat(i),r}return T(n,e),n}(J),cO=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.template=JSON.stringify(r),i}return T(n,e),n}(se),hy={},An=function(){function e(n,t){var r=t.sdkState,i=t.dispatcher,s=t.requestQueue,o=t.onlineDetector,a=t.cacheContext;this._iid=n,this._sdkState=r,this._requestQueue=s,this._dispatcher=i,this._cacheContext=a,Sl.of(n),Aa.of(n),TS.of(n),this.fileMessageQueue=new oM(n,{sdkState:r,dispatcher:i,requestQueue:s,onlineDetector:o,cacheContext:a}),hy[n]=this}return e.of=function(n){return hy[n]},e.prototype.buildMessageFromSerializedData=function(n){var t=pa(n);if(t.notificationId)return new Na(this._iid,Na.payloadify(t));switch(t.messageType){case Ct.USER:return new er(this._iid,er.payloadify(t));case Ct.FILE:return li._isMultipleFilesMessageSerializedData(t)?new li(this._iid,li.payloadify(t)):new Jt(this._iid,Jt.payloadify(t));case Ct.ADMIN:return new Bl(this._iid,Bl.payloadify(t))}throw L.invalidParameters},e.prototype.buildUserMessageCreateParamsFromSerializedData=function(n,t){return ye(Ie({data:t.data,customType:t.customType,mentionType:t.mentionType,mentionedUserIds:t.mentionedUserIds,mentionedUsers:t.mentionedUsers,mentionedMessageTemplate:t.mentionedMessageTemplate,metaArrays:t.metaArrays,parentMessageId:t.parentMessageId,isReplyToChannel:n.isReplyToChannel,pushNotificationDeliveryOption:n.pushNotificationDeliveryOption,appleCriticalAlertOptions:t.appleCriticalAlertOptions,reqId:t.reqId,message:t.message,translationTargetLanguages:Object.keys(t.translations),pollId:n.pollId}))},e.prototype.buildFileMessageCreateParamsFromSerializedData=function(n,t){var r;return ye(Ie({data:t.data,customType:t.customType,mentionType:t.mentionType,mentionedUserIds:t.mentionedUserIds,mentionedUsers:t.mentionedUsers,mentionedMessageTemplate:t.mentionedMessageTemplate,metaArrays:t.metaArrays,parentMessageId:t.parentMessageId,isReplyToChannel:n.isReplyToChannel,pushNotificationDeliveryOption:n.pushNotificationDeliveryOption,appleCriticalAlertOptions:t.appleCriticalAlertOptions,reqId:t.reqId,file:n.file,fileKey:n.fileKey,fileUrl:t.plainUrl,fileName:t.name,fileSize:t.size,mimeType:t.type,thumbnailSizes:(r=t.thumbnails)===null||r===void 0?void 0:r.map(function(i){return{maxWidth:i.width,maxHeight:i.height}}),fileType:n.fileType,requireAuth:t.requireAuth}))},e.prototype.buildMultipleFilesMessageCreateParamsFromSerializedData=function(n,t){var r=this;return ye({data:t.data,customType:t.customType,mentionType:t.mentionType,mentionedUserIds:t.mentionedUserIds,mentionedUsers:t.mentionedUsers,mentionedMessageTemplate:t.mentionedMessageTemplate,metaArrays:t.metaArrays,parentMessageId:t.parentMessageId,isReplyToChannel:n.isReplyToChannel,pushNotificationDeliveryOption:n.pushNotificationDeliveryOption,appleCriticalAlertOptions:t.appleCriticalAlertOptions,reqId:t.reqId,fileInfoList:n.fileInfoList.map(function(i){return new cf(r._iid,i)})})},e.prototype.buildScheduledUserMessageCreateParamsFromSerializedData=function(n,t){return x(x({},this.buildUserMessageCreateParamsFromSerializedData(n,t)),{scheduledAt:n.scheduledAt})},e.prototype.buildScheduledFileMessageCreateParamsFromSerializedData=function(n,t){return x(x({},this.buildFileMessageCreateParamsFromSerializedData(n,t)),{scheduledAt:n.scheduledAt})},e.prototype.buildSenderFromSerializedData=function(n){var t=pa(n);return new jl(this._iid,jl.payloadify(t))},e.prototype.getMessage=function(n){return y(this,void 0,void 0,function(){var t,r;return v(this,function(i){switch(i.label){case 0:return t=new aM(n),[4,this._requestQueue.send(t)];case 1:return r=i.sent(),[2,r.as(lM).message]}})})},e.prototype.getScheduledMessage=function(n){return y(this,void 0,void 0,function(){var t,r;return v(this,function(i){switch(i.label){case 0:return t=new dM(n),[4,this._requestQueue.send(t)];case 1:return r=i.sent(),[2,r.as(hM).message]}})})},e.prototype.getMessagesByMessageId=function(n,t,r,i,s){return s===void 0&&(s=G.REQUEST_MESSAGE),y(this,void 0,void 0,function(){var o,a,l;return v(this,function(u){switch(u.label){case 0:return o=new Ld(x(x({channelType:t,channelUrl:n,token:String(r)},tc),i)),[4,this._requestQueue.send(o)];case 1:return a=u.sent(),l=a.as(Dd).messages,this._dispatcher.dispatch(new bt({messages:l,source:s})),[2,l]}})})},e.prototype.getMessagesByTimestamp=function(n,t,r,i,s){return s===void 0&&(s=G.REQUEST_MESSAGE),y(this,void 0,void 0,function(){var o,a,l;return v(this,function(u){switch(u.label){case 0:return o=new Ld(x(x({channelType:t,channelUrl:n,timestamp:r},tc),i)),[4,this._requestQueue.send(o)];case 1:return a=u.sent(),l=a.as(Dd).messages,this._dispatcher.dispatch(new bt({messages:l,source:s})),[2,l]}})})},e.prototype._getMessagesByTimestampForCollection=function(n,t,r,i,s,o,a){return s===void 0&&(s=G.REQUEST_MESSAGE),y(this,void 0,void 0,function(){var l,u,c,d,h,f;return v(this,function(p){switch(p.label){case 0:return l=new Ld(x(x(x({channelType:t,channelUrl:n,timestamp:r},tc),i),{checkingHasNext:o,checkingContinuousMessages:a})),[4,this._requestQueue.send(l)];case 1:return u=p.sent(),c=u.as(Dd),d=c.messages,h=c.isContinuousMessages,f=c.hasNext,this._dispatcher.dispatch(new bt({messages:d,source:s})),[2,{messages:d,isContinuousMessages:h,hasNext:f}]}})})},e.prototype.getThreadedMessagesByTimestamp=function(n,t,r,i){return i===void 0&&(i=G.REQUEST_THREADED_MESSAGE),y(this,void 0,void 0,function(){var s,o,a,l;return v(this,function(u){switch(u.label){case 0:return s=new Ld(x(x(x({channelUrl:n.channelUrl,channelType:n.channelType,timestamp:t},Yc),r),{replyType:Dn.ALL,parentMessageId:n.messageId,includeThreadInfo:!0})),[4,this._requestQueue.send(s)];case 1:return o=u.sent(),a=o.as(Dd).messages,(l=a.slice(1)).forEach(function(c){c.parentMessage=n}),this._dispatcher.dispatch(new bt({messages:l,source:i})),[2,{parentMessage:a[0],threadedMessages:l}]}})})},e.prototype.getMessageTemplatesByToken=function(n,t){return t===void 0&&(t={}),y(this,void 0,void 0,function(){var r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:return r=new aO(x({token:n},t)),[4,this._requestQueue.send(r)];case 1:return i=u.sent(),s=i.as(lO),o=s.hasMore,a=s.nextToken,l=s.templates,[2,{hasMore:o,token:a,templates:l}]}})})},e.prototype.getMessageTemplate=function(n){return y(this,void 0,void 0,function(){var t,r;return v(this,function(i){switch(i.label){case 0:return t=new uO({key:n}),[4,this._requestQueue.send(t)];case 1:return r=i.sent(),[2,{template:r.as(cO).template}]}})})},e.prototype.getMessageChangelogs=function(n,t,r,i,s){return s===void 0&&(s=G.REQUEST_MESSAGE_CHANGELOGS),y(this,void 0,void 0,function(){var o,a,l,u,c,d,h,f;return v(this,function(p){switch(p.label){case 0:return o=new uM(ye(Ie(x(x({channelType:t,channelUrl:n,timestamp:typeof r=="number"?r:null,token:typeof r=="string"?r:null},lm),i)))),[4,this._requestQueue.send(o)];case 1:return a=p.sent(),l=a.as(cM),u=l.updatedMessages,c=l.deletedMessagesInfo,d=l.hasMore,h=l.nextToken,f=c.map(function(g){return g.messageId}),u.length>0&&this._dispatcher.dispatch(new bt({messages:u,source:s})),f.length>0&&this._dispatcher.dispatch(new Xg({messageIds:f,source:s})),[2,{updatedMessages:u,deletedMessageIds:f,hasMore:d,token:h}]}})})},e}(),wS=function(e){function n(t,r){var i=e.call(this,t)||this;i.targetMessageId=0;var s=r.thread_info,o=r.parent_message_id,a=r.channel_url,l=r.channel_type;return s&&R("object",s)&&R("number",o)&&R("string",a)&&R("string",l)&&(i.threadInfo=new uf(t,s),i.targetMessageId=o,i.channelUrl=a,i.channelType=l),i}return T(n,e),n}(Kn),dO={channelUrl:"",channelType:Ze.BASE,messageId:0,includeReactions:!1,includeMetaArray:!1,includeParentMessageInfo:!1,includeThreadInfo:!1},hO=function(e){function n(t){var r=t.channelCustomType,i=t.keyword,s=t.limit,o=t.reverse,a=t.exactMatch,l=t.channelUrl,u=t.order,c=t.messageTimestampFrom,d=t.messageTimestampTo,h=t.advancedQuery,f=t.targetFields,p=t.nextToken,g=e.call(this)||this;return g.method=Z.GET,g.path="".concat(Z4,"/messages"),g.params={custom_type:r,query:i,limit:s,reverse:o,exact_match:a,channel_url:l,message_ts_from:c,message_ts_to:d,sort_field:u,advanced_query:h,target_fields:f,after:p},g}return T(n,e),n}(J),fO=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.messages=r.results.map(function(s){return yr(t,s)}),i.hasNext=r.has_next,i.nextToken=r.end_cursor,i.totalCount=r.total_count,i}return T(n,e),n}(se);(function(e){e.SCORE="score",e.TIMESTAMP="ts"})(ic||(ic={}));var pO=function(e){function n(t,r){var i,s,o,a,l,u,c,d,h,f=this;return(f=e.call(this,t,r)||this).keyword="",f.reverse=!1,f.exactMatch=!1,f.channelUrl="",f.channelCustomType="",f.messageTimestampFrom=null,f.messageTimestampTo=null,f.order=ic.SCORE,f.advancedQuery=!1,f.targetFields=null,f._nextToken="",f.totalCount=-1,f.keyword=r.keyword,f.reverse=(i=r.reverse)!==null&&i!==void 0&&i,f.exactMatch=(s=r.exactMatch)!==null&&s!==void 0&&s,f.channelUrl=(o=r.channelUrl)!==null&&o!==void 0?o:"",f.channelCustomType=(a=r.channelCustomType)!==null&&a!==void 0?a:"",f.messageTimestampFrom=(l=r.messageTimestampFrom)!==null&&l!==void 0?l:null,f.messageTimestampTo=(u=r.messageTimestampTo)!==null&&u!==void 0?u:null,f.order=(c=r.order)!==null&&c!==void 0?c:ic.SCORE,f.advancedQuery=(d=r.advancedQuery)!==null&&d!==void 0&&d,f.targetFields=(h=r.targetFields)!==null&&h!==void 0?h:null,f}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)&&R("string",this.keyword)&&this.keyword.length>0&&R("boolean",this.reverse)&&R("boolean",this.exactMatch)&&R("string",this.channelUrl)&&R("string",this.channelCustomType)&&(R("number",this.messageTimestampFrom)||this.messageTimestampFrom===null)&&(R("number",this.messageTimestampTo)||this.messageTimestampTo===null)&&$e(ic,this.order)&&R("boolean",this.advancedQuery)&&We("string",this.targetFields,!0)},n.prototype.next=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,t=O.of(this._iid).requestQueue,r=new hO(Ie(x(x({},this),{nextToken:this._nextToken?this._nextToken:null}))),[4,t.send(r)]):[3,2]:[3,5];case 1:return i=c.sent(),s=i.as(fO),o=s.messages,a=s.hasNext,l=s.nextToken,u=s.totalCount,this._nextToken=l,this._hasNext=a,this._isLoading=!1,this.totalCount=u,[2,o];case 2:return[2,[]];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Uo),_O=function(e){function n(t){var r=t.channelType,i=t.channelUrl,s=t.limit,o=t.token,a=e.call(this)||this;return a.method=Z.GET,a.path="".concat(Je(r),"/").concat(encodeURIComponent(i),"/messages/parent_thread_message"),a.params=ye(Ie({limit:s,token:o})),a}return T(n,e),n}(J),mO=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.token=r.next,i.messages=r.messages.map(function(s){return yr(t,s)}),i}return T(n,e),n}(se),gO=function(e){function n(t,r,i,s){var o=e.call(this,t,r,i,s)||this;return o._edge="",o}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)},n.prototype.load=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,t=O.of(this._iid).requestQueue,r=new _O({channelType:this.channelType,channelUrl:this.channelUrl,token:this._edge,limit:this.limit}),[4,t.send(r)]):[3,2]:[3,5];case 1:return i=l.sent(),s=i.as(mO),o=s.messages,a=s.token,this._edge=a,this._hasNext=!!a,this._isLoading=!1,[2,o];case 2:return[2,[]];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Gs),vO={channelUrl:"",scheduledMessageId:0},yO={reverse:!1,limit:20},EO=function(e){function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.name="message",t}return T(n,e),n.prototype.init=function(t,r){var i=r.sdkState,s=r.dispatcher,o=r.sessionManager,a=r.requestQueue,l=r.logger,u=r.onlineDetector,c=r.cacheContext;e.prototype.init.call(this,t,{sdkState:i,dispatcher:s,sessionManager:o,requestQueue:a,logger:l,onlineDetector:u,cacheContext:c}),this._manager=new An(t,{sdkState:i,dispatcher:s,requestQueue:a,onlineDetector:u,cacheContext:c})},n.prototype.buildMessageFromSerializedData=function(t){return this._manager.buildMessageFromSerializedData(t)},n.prototype.buildSenderFromSerializedData=function(t){return this._manager.buildSenderFromSerializedData(t)},n.prototype.getMessage=function(t){return y(this,void 0,void 0,function(){var r,i;return v(this,function(s){switch(s.label){case 0:return r=x(x({},dO),t),Y(function(o){return R("string",o.channelUrl)&&$e(Ze,o.channelType)&&R("number",o.messageId)&&R("boolean",o.includeReactions,!0)&&R("boolean",o.includeMetaArray,!0)&&R("boolean",o.includeParentMessageInfo,!0)&&R("boolean",o.includeThreadInfo,!0)}(r)).throw(L.invalidParameters),[4,this._manager.getMessage(r)];case 1:if((i=s.sent())instanceof hr||i instanceof Na||i===null)return[2,i];throw"Unknown message type is given."}})})},n.prototype.getScheduledMessage=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){return r=x(x({},vO),t),Y(function(s){return R("string",s.channelUrl)&&s.channelUrl!==""&&R("number",s.scheduledMessageId)&&s.scheduledMessageId>0}(r)).throw(L.invalidParameters),[2,this._manager.getScheduledMessage(r)]})})},n.prototype.getMessageTemplatesByToken=function(t,r){return r===void 0&&(r={}),y(this,void 0,void 0,function(){var i;return v(this,function(s){return i=x(x({},yO),r),Y(R("string",t,!0)&&function(o){return R("boolean",o.reverse,!0)&&R("number",o.limit,!0)&&We("string",o.keys,!0)}(i)).throw(L.invalidParameters),[2,this._manager.getMessageTemplatesByToken(t,i)]})})},n.prototype.getMessageTemplate=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){return Y(R("string",t)).throw(L.invalidParameters),[2,this._manager.getMessageTemplate(t)]})})},n}(Zg),jt,sc,gm;(function(e){e.LATEST_LAST_MESSAGE="latest_last_message",e.CHRONOLOGICAL="chronological",e.CHANNEL_NAME_ALPHABETICAL="channel_name_alphabetical",e.METADATA_VALUE_ALPHABETICAL="metadata_value_alphabetical"})(jt||(jt={})),function(e){e.CHRONOLOGICAL="chronological",e.CHANNEL_NAME_ALPHABETICAL="channel_name_alphabetical",e.METADATA_VALUE_ALPHABETICAL="metadata_value_alphabetical"}(sc||(sc={})),function(e){e.CREATED_AT="created_at",e.SCHEDULED_AT="scheduled_at"}(gm||(gm={}));var Uc,mh=function(e){switch(e){case jt.LATEST_LAST_MESSAGE:return["-lastMessageUpdatedAt","-createdAt","syncIndex"];case jt.CHRONOLOGICAL:return["-createdAt","syncIndex"];case jt.CHANNEL_NAME_ALPHABETICAL:return["name"];default:return["-lastMessageUpdatedAt","-createdAt","syncIndex"]}},NS=function(e){function n(t){var r=t.message,i=e.call(this)||this;return i.message=r,i}return T(n,e),n}(Tt),fy={},Mu=function(){function e(n,t){var r=t.localCacheEnabled,i=t.enableAutoResend,s=t.dispatcher,o=t.sdkState,a=t.logger,l=this;this._iid=n,fy[n]=this,this._localCacheEnabled=r,this._enableAutoResend=i,this._isProcessingAutoResend=!1,this._autoResendQueue=[],this._dispatcher=s,this._logger=a,this._sdkState=o,this._localCacheEnabled&&s.on(function(u){if(u instanceof _i)switch(u.stateType){case rt.CONNECTED:l._isProcessingAutoResend||l.processAutoResendRegisteredPendingMessages().then(function(){return l._processNextAutoResend()});break;case rt.INTERNAL_DISCONNECTED:case rt.EXTERNAL_DISCONNECTED:l._isProcessingAutoResend=!1}})}return e.of=function(n){return fy[n]},e.prototype.processNonAutoResendRegisteredPendingMessages=function(){return y(this,void 0,void 0,function(){var n,t,r,i,s,o;return v(this,function(a){switch(a.label){case 0:return this._enableAutoResend?[4,this._fetchAllCachedPendingMessages()]:[2];case 1:n=a.sent();try{for(t=pe(n),r=t.next();!r.done;r=t.next())(i=r.value).errorCode===0&&(this._logger.debug("cached pending message is not auto-resend registered. changing its sending status to failed: ",i.reqId),i.sendingStatus=ut.FAILED,i.errorCode=Te.ACK_TIMEOUT,this._dispatcher.dispatch(new bt({messages:[i],source:G.LOCAL_MESSAGE_FAILED})))}catch(l){s={error:l}}finally{try{r&&!r.done&&(o=t.return)&&o.call(t)}finally{if(s)throw s.error}}return[2]}})})},e.prototype.processAutoResendRegisteredPendingMessages=function(){return y(this,void 0,void 0,function(){var n,t,r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:return[4,this._fetchAllCachedPendingMessages()];case 1:n=u.sent();try{for(t=pe(n),r=t.next();!r.done;r=t.next())i=r.value,this._enableAutoResend&&i.errorCode&&Yh(i.errorCode)&&(s=new Date().getTime(),o=i.createdAt+2592e5,this._enableAutoResend&&s<=o?this._autoResendQueue.map(function(c){return c.reqId}).indexOf(i.reqId)<0&&this._autoResendQueue.push(i):(this._logger.debug("auto-resend registered pending messaged expired. expiration date: ",new Date(o).toLocaleString()),i.sendingStatus=ut.FAILED,this._dispatcher.dispatch(new bt({messages:[i],source:G.LOCAL_MESSAGE_FAILED}))))}catch(c){a={error:c}}finally{try{r&&!r.done&&(l=t.return)&&l.call(t)}finally{if(a)throw a.error}}return[2]}})})},e.prototype.completeCurrentAndProcessNextAutoResend=function(n){if(this._localCacheEnabled&&this._enableAutoResend&&(n.sendingStatus===ut.SUCCEEDED||n.sendingStatus===ut.FAILED&&!Yh(n.errorCode))){var t=this.indexOf(n);t>=0&&this._autoResendQueue.splice(t,1),t===0&&this._processNextAutoResend()}},e.prototype._fetchAllCachedPendingMessages=function(){return y(this,void 0,void 0,function(){var n,t;return v(this,function(r){switch(r.label){case 0:return n=Aa.of(this._iid),(t=new _s).replyType=Dn.ALL,[4,n.fetch({sendingStatus:ut.PENDING,backward:!0,filter:t})];case 1:return[2,r.sent()]}})})},e.prototype.indexOf=function(n){return this._autoResendQueue.length>0?this._autoResendQueue.map(function(t){return t.reqId}).indexOf(n.reqId):-1},e.prototype._isNotInQueue=function(n){return this._autoResendQueue.map(function(t){return t.reqId}).indexOf(n.reqId)===-1},e.prototype._processNextAutoResend=function(){return y(this,void 0,void 0,function(){var n;return v(this,function(t){if(this._localCacheEnabled&&this._enableAutoResend&&this._sdkState.appState==="foreground")try{this._autoResendQueue.length>0?(this._isProcessingAutoResend||(this._logger.debug("auto-resend queue started."),this._isProcessingAutoResend=!0),n=this._autoResendQueue[0],this._dispatcher.dispatch(new NS({message:n})),this._logger.debug("processing auto-resend for message request id: ",n.reqId)):(this._logger.debug("auto-resend queue finished."),this._isProcessingAutoResend=!1)}catch(r){this._logger.warn("process auto-resend error: ",r),this._isProcessingAutoResend=!1}return[2]})})},e}();(function(e){e[e.USER_BLOCK=20001]="USER_BLOCK",e[e.USER_UNBLOCK=2e4]="USER_UNBLOCK",e[e.FRIEND_DISCOVERED=20900]="FRIEND_DISCOVERED"})(Uc||(Uc={}));var ff=function(){function e(n){this.category=n.cat,this.data=n.data}return e.getDataAsUserBlockEvent=function(n,t){var r=t.data,i=r.blocker,s=r.blockee;return{blocker:new Ke(n,i),blockee:new Ke(n,s)}},e.getDataAsFriendDiscoveredEvent=function(n,t){var r=t.data.friend_discoveries;return{friendDiscoveries:Array.isArray(r)?r.map(function(i){return new Ke(n,i)}):[]}},e}(),IS=function(e){function n(t,r){var i=r.userId,s=e.call(this)||this;return s._iid=t,s.userId=i,s}return T(n,e),n}(Tt),AS=function(e){function n(){return e.call(this)||this}return T(n,e),n}(Tt),MS=function(e){function n(t,r,i){var s=e.call(this,t,"USEV",i)||this;return s.event=new ff(i),s}return T(n,e),n}(gt),bO=function(e,n){this.pollId=0,this.messageId=0,this.pollId=n.poll.id,this.messageId=n.poll.message_id,this._iid=e,this._payload=n},Xt;(function(e){e[e.NONE=0]="NONE",e[e.CHANNEL_ENTER=10102]="CHANNEL_ENTER",e[e.CHANNEL_EXIT=10103]="CHANNEL_EXIT",e[e.USER_CHANNEL_MUTE=10201]="USER_CHANNEL_MUTE",e[e.USER_CHANNEL_UNMUTE=10200]="USER_CHANNEL_UNMUTE",e[e.USER_CHANNEL_BAN=10601]="USER_CHANNEL_BAN",e[e.USER_CHANNEL_UNBAN=10600]="USER_CHANNEL_UNBAN",e[e.CHANNEL_FREEZE=10701]="CHANNEL_FREEZE",e[e.CHANNEL_UNFREEZE=10700]="CHANNEL_UNFREEZE",e[e.TYPING_START=10900]="TYPING_START",e[e.TYPING_END=10901]="TYPING_END",e[e.CHANNEL_JOIN=1e4]="CHANNEL_JOIN",e[e.CHANNEL_LEAVE=10001]="CHANNEL_LEAVE",e[e.CHANNEL_OPERATOR_UPDATE=10002]="CHANNEL_OPERATOR_UPDATE",e[e.CHANNEL_INVITE=10020]="CHANNEL_INVITE",e[e.CHANNEL_ACCEPT_INVITE=10021]="CHANNEL_ACCEPT_INVITE",e[e.CHANNEL_DECLINE_INVITE=10022]="CHANNEL_DECLINE_INVITE",e[e.CHANNEL_PROP_CHANGED=11e3]="CHANNEL_PROP_CHANGED",e[e.CHANNEL_DELETED=12e3]="CHANNEL_DELETED",e[e.CHANNEL_META_DATA_CHANGED=11100]="CHANNEL_META_DATA_CHANGED",e[e.CHANNEL_META_COUNTERS_CHANGED=11200]="CHANNEL_META_COUNTERS_CHANGED",e[e.CHANNEL_HIDE=13e3]="CHANNEL_HIDE",e[e.CHANNEL_UNHIDE=13001]="CHANNEL_UNHIDE",e[e.PINNED_MESSAGE_CHANGED=11300]="PINNED_MESSAGE_CHANGED"})(Xt||(Xt={}));var CO=function(){function e(n){var t;this.channelUrl=n.channel_url,this.channelType=n.channel_type,this.category=n.cat,this.data=(t=n.data)!==null&&t!==void 0?t:{},this.ts=n.ts}return Object.defineProperty(e.prototype,"isGroupChannelEvent",{get:function(){return this.channelType===Ze.GROUP},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpenChannelEvent",{get:function(){return this.channelType===Ze.OPEN},enumerable:!1,configurable:!0}),e}(),Kl=function(e){function n(t,r,i){var s=e.call(this,t,"SYEV",i)||this;return s.event=new CO(i),s}return T(n,e),n}(gt),SO=function(e){function n(t,r,i){var s=e.call(this,t,r,i)||this,o=i.data.operators,a=o===void 0?[]:o;return s.operators=a.map(function(l){return new Ke(s._iid,l)}),s}return T(n,e),n}(Kl),TO=function(e){function n(t,r){var i=e.call(this,t)||this;return i._logger=r.logger,i._sdkState=r.sdkState,i._sessionManager=r.sessionManager,i._requestQueue=r.requestQueue,i._dispatcher=r.dispatcher,i._cacheContext=r.cacheContext,i._channelType=r.channelType,i}return T(n,e),Object.defineProperty(n.prototype,"_messageBroadcast",{get:function(){return TS.of(this._iid)},enumerable:!1,configurable:!0}),n.prototype.subscribeMessageEvent=function(t,r){this._messageBroadcast.subscribe(t,r)},n.prototype.unsubscribeMessageEvent=function(t){this._messageBroadcast.unsubscribe(t)},n.prototype.getMessageFromCache=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){return[2,null]})})},n.prototype.getExactlyMatchingMessagesForTokenFromCache=function(t,r,i){return y(this,void 0,void 0,function(){return v(this,function(s){return[2,[]]})})},n.prototype.getMessagesFromCache=function(t,r,i,s,o,a){return y(this,void 0,void 0,function(){return v(this,function(l){return[2,[]]})})},n.prototype.getPollMessagesFromCache=function(t,r,i,s){return y(this,void 0,void 0,function(){return v(this,function(o){return[2,[]]})})},n.prototype.getCachedMessageCountBetween=function(t,r,i,s){return y(this,void 0,void 0,function(){return v(this,function(o){return[2,0]})})},n.prototype.getUnsentMessagesFromCache=function(t,r){return y(this,void 0,void 0,function(){return v(this,function(i){return[2,[]]})})},n.prototype.removeFailedMessageFromCache=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){return[2]})})},n}(Kn),wO=function(e){function n(t,r,i){var s,o,a,l,u=this;(u=e.call(this,t,"ADMM",i)||this).message=new Bl(t,i);var c=O.of(t).sdkState;return u.isMentioned=Dl(u.message.mentionType,(a=(s=u.message.mentionedUserIds)!==null&&s!==void 0?s:(o=u.message.mentionedUsers)===null||o===void 0?void 0:o.map(function(d){return d.userId}))!==null&&a!==void 0?a:[],c.userId),u.forceUpdateLastMessage=(l=i.force_update_last_message)!==null&&l!==void 0&&l,u}return T(n,e),n}(gt),NO=function(e){function n(t,r,i){var s,o,a,l,u,c=this;(c=e.call(this,t,"AEDI",i)||this).message=new Bl(t,i);var d=O.of(t).sdkState;return c.mentionCountChange=Gg({mentionType:(s=i.old_values)===null||s===void 0?void 0:s.mention_type,mentionedUserIds:(a=(o=i.old_values)===null||o===void 0?void 0:o.mentioned_user_ids)!==null&&a!==void 0?a:[]},Ie({mentionType:c.message.mentionType,mentionedUserIds:(l=c.message.mentionedUserIds)!==null&&l!==void 0?l:(u=c.message.mentionedUsers)===null||u===void 0?void 0:u.map(function(h){return h.userId})}),d.userId),c}return T(n,e),n}(gt),IO=function(e){function n(t,r,i){var s=e.call(this,t,"MRCT",i)||this;return s.channelUrl=i.channel_url,s.channelType=i.channel_type,s.event=new ev(i),s}return T(n,e),n}(gt),AO=function(e){function n(t,r,i){var s=e.call(this,t,"MTHD",i)||this;return s.event=new wS(t,i),s}return T(n,e),n}(gt),MO=function(e){function n(t,r,i){var s=e.call(this,t,"MCNT",i)||this;return s.groupChannelMemberCounts=i.group_channels.map(function(o){return{channelUrl:o.channel_url,memberCount:o.member_count,joinedMemberCount:o.joined_member_count,updatedAt:o.ts}}),s.openChannelMemberCounts=i.open_channels.map(function(o){return{channelUrl:o.channel_url,participantCount:o.participant_count,updatedAt:o.ts}}),s}return T(n,e),n}(gt),xO=function(e){function n(t,r,i){var s=e.call(this,t,"PEDI",i)||this;return s.event=new bO(t,i),s.status=sm(i.poll.status)||i.poll.status,s.channelUrl=i.channel_url,s.channelType=i.channel_type,s}return T(n,e),n}(gt),Gt;(function(e){e.NONE="none",e.JOINED="joined",e.INVITED="invited",e.LEFT="left"})(Gt||(Gt={}));var ps,Rr,Ur,No,Gi,pf,Ds,Pc,si=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.state=null,i.role=null,i.isMuted=!1,i.isBlockedByMe=!1,i.isBlockingMe=!1,i.state=$e(Gt,r.state)?r.state:null,i.role=$e(Ni,r.role)?r.role:null,typeof r.is_muted=="boolean"&&(i.isMuted=r.is_muted),typeof r.is_blocked_by_me=="boolean"&&(i.isBlockedByMe=r.is_blocked_by_me),typeof r.is_blocking_me=="boolean"&&(i.isBlockingMe=r.is_blocking_me),i}return T(n,e),n.payloadify=function(t){return ye(Ie(x(x({},e.payloadify.call(this,t)),{state:t.state,role:t.role,is_muted:t.isMuted,is_blocked_by_me:t.isBlockedByMe,is_blocking_me:t.isBlockingMe})))},n}(Pa),OO=function(e){function n(t,r){var i,s,o=this;return(o=e.call(this,t)||this).channelUrl=(i=r.channel_url)!==null&&i!==void 0?i:"",o.channelType=(s=r.channel_type)!==null&&s!==void 0?s:Ze.GROUP,o.member=new Ke(o._iid,r.user),o.deliveryAt=r.ts,o}return T(n,e),n}(Kn);(function(e){e.ALL="all",e.PUBLIC="public",e.PRIVATE="private"})(ps||(ps={})),function(e){e.ALL="all",e.JOINED="joined_only",e.INVITED="invited_only",e.INVITED_BY_FRIEND="invited_by_friend",e.INVITED_BY_NON_FRIEND="invited_by_non_friend"}(Rr||(Rr={})),function(e){e.ALL="all",e.SUPER="super",e.NON_SUPER="nonsuper",e.BROADCAST_ONLY="broadcast_only",e.EXCLUSIVE_ONLY="exclusive_only"}(Ur||(Ur={})),function(e){e.ALL="all",e.UNREAD_MESSAGE="unread_message"}(No||(No={})),function(e){e.ALL="all",e.UNHIDDEN="unhidden_only",e.HIDDEN="hidden_only",e.HIDDEN_ALLOW_AUTO_UNHIDE="hidden_allow_auto_unhide",e.HIDDEN_PREVENT_AUTO_UNHIDE="hidden_prevent_auto_unhide"}(Gi||(Gi={})),function(e){e.ALL="all",e.OPERATOR="operator",e.NONOPERATOR="nonoperator"}(pf||(pf={})),function(e){e.AND="AND",e.OR="OR"}(Ds||(Ds={})),function(e){e.MEMBER_NICKNAME="member_nickname",e.CHANNEL_NAME="channel_name"}(Pc||(Pc={}));var Tn,xS=function(){function e(n){var t,r,i,s,o,a,l,u,c,d,h,f,p,g;this._searchFilter=null,this._userIdsFilter=null,this.includeEmpty=(t=n==null?void 0:n.includeEmpty)!==null&&t!==void 0&&t,this.nicknameContainsFilter=(r=n==null?void 0:n.nicknameContainsFilter)!==null&&r!==void 0?r:null,this.nicknameStartsWithFilter=(i=n==null?void 0:n.nicknameStartsWithFilter)!==null&&i!==void 0?i:null,this.nicknameExactMatchFilter=(s=n==null?void 0:n.nicknameExactMatchFilter)!==null&&s!==void 0?s:null,this.channelNameContainsFilter=(o=n==null?void 0:n.channelNameContainsFilter)!==null&&o!==void 0?o:"",this.myMemberStateFilter=(a=n==null?void 0:n.myMemberStateFilter)!==null&&a!==void 0?a:Rr.ALL,this.customTypesFilter=(l=n==null?void 0:n.customTypesFilter)!==null&&l!==void 0?l:null,this.channelUrlsFilter=(u=n==null?void 0:n.channelUrlsFilter)!==null&&u!==void 0?u:null,this.superChannelFilter=(c=n==null?void 0:n.superChannelFilter)!==null&&c!==void 0?c:Ur.ALL,this.publicChannelFilter=(d=n==null?void 0:n.publicChannelFilter)!==null&&d!==void 0?d:ps.ALL,this.customTypeStartsWithFilter=(h=n==null?void 0:n.customTypeStartsWithFilter)!==null&&h!==void 0?h:null,this.unreadChannelFilter=(f=n==null?void 0:n.unreadChannelFilter)!==null&&f!==void 0?f:No.ALL,this.hiddenChannelFilter=(p=n==null?void 0:n.hiddenChannelFilter)!==null&&p!==void 0?p:Gi.UNHIDDEN,this.includeFrozen=(g=n==null?void 0:n.includeFrozen)===null||g===void 0||g,n!=null&&n.createdAfter&&(this.createdAfter=n.createdAfter),n!=null&&n.createdBefore&&(this.createdBefore=n.createdBefore)}return e.prototype._isFriend=function(n){return!(!n||!n.friendDiscoveryKey&&!n.friendName)},Object.defineProperty(e.prototype,"searchFilter",{get:function(){return this._searchFilter},enumerable:!1,configurable:!0}),e.prototype.setSearchFilter=function(n,t){Array.isArray(n)&&n.length!==0&&typeof t=="string"&&t&&(this._searchFilter={query:t,fields:n})},Object.defineProperty(e.prototype,"userIdsFilter",{get:function(){return this._userIdsFilter},enumerable:!1,configurable:!0}),e.prototype.setUserIdsFilter=function(n,t,r){r===void 0&&(r=Ds.AND),this._userIdsFilter={userIds:n,includeMode:t,queryType:r}},e.prototype.clone=function(){var n,t=new e;this.searchFilter&&t.setSearchFilter(this.searchFilter.fields,(n=this.searchFilter.query)!==null&&n!==void 0?n:void 0),this.userIdsFilter&&t.setUserIdsFilter(this.userIdsFilter.userIds,this.userIdsFilter.includeMode,this.userIdsFilter.queryType);var r=JSON.parse(JSON.stringify(this));return Object.keys(r).forEach(function(i){t[i]=r[i]}),t},e.prototype.match=function(n,t){if(this._searchFilter){var r=this._searchFilter,i=r.query,s=r.fields;if(i&&s&&s.length>0&&!s.some(function(p){switch(p){case Pc.CHANNEL_NAME:return n.name.toLowerCase().includes(i.toLowerCase());case Pc.MEMBER_NICKNAME:return n.members.some(function(g){return g.nickname.toLowerCase().includes(i.toLowerCase())});default:return!0}}))return!1}if(this._userIdsFilter){var o=this._userIdsFilter,a=o.userIds,l=o.includeMode,u=o.queryType,c=n.members.map(function(p){return p.userId});if(l){if(a.length>0)switch(u){case Ds.AND:if(a.some(function(p){return!c.includes(p)}))return!1;break;case Ds.OR:if(a.every(function(p){return!c.includes(p)}))return!1}}else if(a.includes(t)||a.push(t),n.members.length>a.length||!G4(a,c))return!1}if(!this.includeEmpty&&!n.lastMessage||!this.includeFrozen&&n.isFrozen||this.customTypesFilter&&this.customTypesFilter.length>0&&!this.customTypesFilter.includes("*")&&!this.customTypesFilter.includes(n.customType)||this.customTypeStartsWithFilter&&!new RegExp("^".concat(this.customTypeStartsWithFilter)).test(n.customType)||this.channelNameContainsFilter&&!n.name.toLowerCase().includes(this.channelNameContainsFilter.toLowerCase()))return!1;if(this.nicknameContainsFilter){var d=this.nicknameContainsFilter.toLowerCase();if(!n.members.some(function(p){return p.userId!==t&&p.nickname.toLowerCase().includes(d)}))return!1}if(this.nicknameStartsWithFilter){var h=this.nicknameStartsWithFilter.toLowerCase();if(!n.members.some(function(p){return p.userId!==t&&p.nickname.toLowerCase().startsWith(h)}))return!1}if(this.nicknameExactMatchFilter){var f=this.nicknameExactMatchFilter.toLowerCase();if(!n.members.some(function(p){return p.userId!==t&&p.nickname.toLowerCase()!=f}))return!1}if(this.channelUrlsFilter&&this.channelUrlsFilter.length>0&&!this.channelUrlsFilter.includes(n.url))return!1;if(this.myMemberStateFilter)switch(this.myMemberStateFilter){case Rr.ALL:if(n.myMemberState==="none")return!1;break;case Rr.JOINED:if(n.myMemberState!=="joined")return!1;break;case Rr.INVITED:if(n.myMemberState!=="invited")return!1;break;case Rr.INVITED_BY_FRIEND:if(n.myMemberState!=="invited"||!this._isFriend(n.inviter))return!1;break;case Rr.INVITED_BY_NON_FRIEND:if(n.myMemberState!=="invited"||this._isFriend(n.inviter))return!1}if(this.hiddenChannelFilter)switch(this.hiddenChannelFilter){case Gi.UNHIDDEN:if(n.isHidden||n.hiddenState!=="unhidden")return!1;break;case Gi.HIDDEN:if(!n.isHidden)return!1;break;case Gi.HIDDEN_ALLOW_AUTO_UNHIDE:if(!n.isHidden||n.hiddenState!=="hidden_allow_auto_unhide")return!1;break;case Gi.HIDDEN_PREVENT_AUTO_UNHIDE:if(!n.isHidden||n.hiddenState!=="hidden_prevent_auto_unhide")return!1}if(this.unreadChannelFilter&&this.unreadChannelFilter===No.UNREAD_MESSAGE&&n.unreadMessageCount===0)return!1;if(this.publicChannelFilter)switch(this.publicChannelFilter){case ps.PUBLIC:if(!n.isPublic)return!1;break;case ps.PRIVATE:if(n.isPublic)return!1}if(this.superChannelFilter)switch(this.superChannelFilter){case Ur.SUPER:if(!n.isSuper)return!1;break;case Ur.NON_SUPER:if(n.isSuper)return!1}return!(this.createdAfter&&n.createdAtthis.createdBefore)},e}(),kO=function(e){function n(t,r){var i=r.sdkState,s=r.cacheContext,o=e.call(this,t)||this;return o._channels=new Map,o._sdkState=i,o._cacheContext=s,o}return T(n,e),Object.defineProperty(n.prototype,"collection",{get:function(){var t=this._cacheContext.nestdb;return Y(!!t).throw(L.databaseError),t.collection(yS)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localCacheEnabled",{get:function(){return this._cacheContext.localCacheEnabled&&!!this.collection},enumerable:!1,configurable:!0}),n.prototype._serialize=function(t,r){return r===void 0&&(r=0),x(x({},t.serialize()),{lastMessageUpdatedAt:t.lastMessage?t.lastMessage.createdAt:0,syncIndex:r})},n.prototype._deserialize=function(t){return Nn.of(this._iid).buildGroupChannelFromSerializedData(t)},Object.defineProperty(n.prototype,"channels",{get:function(){return De([],Ae(this._channels.values()),!1)},enumerable:!1,configurable:!0}),n.prototype.isCachedInMemory=function(t){return this._channels.has(t)},n.prototype.filterOffsetChanged=function(t){var r=this;return t.filter(function(i){if(r._channels.has(i.url))return r._channels.get(i.url).messageOffsetTimestamp0)return!1;break;case jt.CHRONOLOGICAL:if(!a&&S.createdAt>r||a&&S.createdAtr||a&&S.lastMessageUpdatedAtu._messageCollectionLastAccessedAt&&Object.assign(u,{_messageCollectionLastAccessedAt:void 0}),u.cachedMetaData&&r&&(c._updateCachedMetaData(u.cachedMetaData,r).isUpdated||Object.assign(u,{_cachedMetaData:void 0})),c._update(u),i.push(c)}else a._channels.set(u.url,u),i.push(u)}),!this.localCacheEnabled)return[3,2];for(s=[],o=0;o0?[4,this.upsert(s)]:[3,2];case 1:k.sent(),k.label=2;case 2:return[2]}})})},n.prototype.block=function(t,r){return y(this,void 0,void 0,function(){return v(this,function(i){switch(i.label){case 0:return[4,this._setBlockStateOfAllChannels(t,r,!0)];case 1:return i.sent(),[2]}})})},n.prototype.unblock=function(t,r){return y(this,void 0,void 0,function(){return v(this,function(i){switch(i.label){case 0:return[4,this._setBlockStateOfAllChannels(t,r,!1)];case 1:return i.sent(),[2]}})})},n.prototype.markAsRead=function(t,r){return r===void 0&&(r=De([],Ae(this._channels.keys()),!1)),y(this,void 0,void 0,function(){var i,s,o,a,l,u,c,d;return v(this,function(h){switch(h.label){case 0:i=[],h.label=1;case 1:h.trys.push([1,6,7,8]),s=pe(r),o=s.next(),h.label=2;case 2:return o.done?[3,5]:(a=o.value,[4,this.get(a)]);case 3:(l=h.sent())!=null&&l._updateUnreadMemberState(this._sdkState.userId,t)&&(l._updateUnreadCount(0,0),i.push(l)),h.label=4;case 4:return o=s.next(),[3,2];case 5:return[3,8];case 6:return u=h.sent(),c={error:u},[3,8];case 7:try{o&&!o.done&&(d=s.return)&&d.call(s)}finally{if(c)throw c.error}return[7];case 8:return i.length>0?[4,this.upsert(i)]:[3,10];case 9:h.sent(),h.label=10;case 10:return[2]}})})},n}(Kn),gh={invitedUserIds:void 0,channelUrl:void 0,coverUrl:void 0,coverImage:void 0,isDistinct:void 0,isSuper:void 0,isBroadcast:void 0,isExclusive:void 0,isPublic:void 0,isDiscoverable:void 0,isStrict:void 0,isEphemeral:void 0,accessCode:void 0,name:void 0,data:void 0,customType:void 0,operatorUserIds:void 0,messageSurvivalSeconds:void 0},vm=function(e){return We("string",e.invitedUserIds,!0)&&R("string",e.channelUrl,!0)&&R("string",e.coverUrl,!0)&&(pr(e.coverImage)||R("string",e.coverImage,!0))&&R("boolean",e.isDistinct,!0)&&R("boolean",e.isSuper,!0)&&R("boolean",e.isBroadcast,!0)&&R("boolean",e.isExclusive,!0)&&R("boolean",e.isPublic,!0)&&R("boolean",e.isStrict,!0)&&R("boolean",e.isDiscoverable,!0)&&R("boolean",e.isEphemeral,!0)&&R("string",e.accessCode,!0)&&R("string",e.name,!0)&&R("string",e.data,!0)&&R("string",e.customType,!0)&&We("string",e.operatorUserIds,!0)&&R("number",e.messageSurvivalSeconds,!0)},_f={customTypes:void 0,includeEmpty:!1,includeFrozen:!0,includeChatNotification:!1},ym=function(e){return We("string",e.customTypes,!0)&&R("boolean",e.includeEmpty)&&R("boolean",e.includeFrozen)&&R("boolean",e.includeChatNotification)},OS={myMemberStateFilter:Rr.ALL},kS=function(e){return $e(Rr,e.myMemberStateFilter)};(function(e){e.GROUP_CHANNEL_UNREAD_MENTION_COUNT="group_channel_unread_mention_count",e.NONSUPER_UNREAD_MENTION_COUNT="non_super_group_channel_unread_mention_count",e.SUPER_UNREAD_MENTION_COUNT="super_group_channel_unread_mention_count",e.GROUP_CHANNEL_UNREAD_MESSAGE_COUNT="group_channel_unread_message_count",e.NONSUPER_UNREAD_MESSAGE_COUNT="non_super_group_channel_unread_message_count",e.SUPER_UNREAD_MESSAGE_COUNT="super_group_channel_unread_message_count",e.GROUP_CHANNEL_INVITATION_COUNT="group_channel_invitation_count",e.NONSUPER_INVITATION_COUNT="non_super_group_channel_invitation_count",e.SUPER_INVITATION_COUNT="super_group_channel_invitation_count"})(Tn||(Tn={}));var RO={keys:[]},LO={channelCustomTypesFilter:void 0,superChannelFilter:Ur.ALL},DO=function(e){return We("string",e.channelCustomTypesFilter,!0)&&$e(Ur,e.superChannelFilter)},UO={channelUrl:void 0,scheduledStatus:void 0,messageTypeFilter:tr.ALL};x({},G);var vh=function(e){return e.startsWith("EVENT_")||e===G.SYNC_CHANNEL_CHANGELOGS||e===G.REFRESH_CHANNEL},Ve=function(e){function n(t){var r=t.channels,i=t.context,s=t.isWebSocketEventComing,o=s!==void 0&&s,a=t.ts,l=e.call(this)||this;return l.channels=r,l.context=i,l.isWebSocketEventComing=o,l.ts=a,l}return T(n,e),n}(Tt),bs=function(e){function n(t){var r=t.channelUrls,i=t.context,s=t.isWebSocketEventComing,o=s!==void 0&&s,a=e.call(this)||this;return a.channelUrls=r,a.context=i,a.isWebSocketEventComing=o,a}return T(n,e),n}(Tt),PO=function(){function e(n){var t=n.groupChannelCache,r=n.messageCache,i=n.unsentMessageCache,s=n.dispatcher,o=this;this._observers=new Map,s.on(function(a){return y(o,void 0,void 0,function(){var l,u,c,d,h,f,p,g,b,m,_,E,S,w,N,A,k,I,M=this;return v(this,function(U){switch(U.label){case 0:if(!(a instanceof Ve))return[3,19];if(l=a.channels,S=a.context,w=a.isWebSocketEventComing,u=l.filter(function(z){return z instanceof di}),S.source!==G.EVENT_CHANNEL_RESET_HISTORY&&S.source!==G.EVENT_CHANNEL_HIDDEN)return[3,9];U.label=1;case 1:U.trys.push([1,6,7,8]),c=pe(u),d=c.next(),U.label=2;case 2:return d.done?[3,5]:(b=d.value,[4,r.removeUnderOffset(b.url,b.messageOffsetTimestamp)]);case 3:U.sent(),U.label=4;case 4:return d=c.next(),[3,2];case 5:return[3,8];case 6:return h=U.sent(),N={error:h},[3,8];case 7:try{d&&!d.done&&(A=c.return)&&A.call(c)}finally{if(N)throw N.error}return[7];case 8:return[3,17];case 9:f=t.filterOffsetChanged(u),U.label=10;case 10:U.trys.push([10,15,16,17]),p=pe(f),g=p.next(),U.label=11;case 11:return g.done?[3,14]:(b=g.value,[4,r.removeUnderOffset(b.url,b.messageOffsetTimestamp)]);case 12:U.sent(),U.label=13;case 13:return g=p.next(),[3,11];case 14:return[3,17];case 15:return m=U.sent(),k={error:m},[3,17];case 16:try{g&&!g.done&&(I=p.return)&&I.call(p)}finally{if(k)throw k.error}return[7];case 17:return[4,t.upsert(u,a.ts)];case 18:return _=U.sent(),w||this._broadcastUpdateEvent(_,S),[3,24];case 19:return a instanceof bs?(E=a.channelUrls,S=a.context,w=a.isWebSocketEventComing,[4,t.remove(E)]):[3,22];case 20:return U.sent(),[4,kt(function(){return y(M,void 0,void 0,function(){var z,H,W,Q,$,Ne;return v(this,function(X){switch(X.label){case 0:X.trys.push([0,6,7,8]),z=pe(E),H=z.next(),X.label=1;case 1:return H.done?[3,5]:(W=H.value,[4,r.removeMessagesOfChannel(W)]);case 2:return X.sent(),[4,i.removeMessagesOfChannel(W)];case 3:X.sent(),X.label=4;case 4:return H=z.next(),[3,1];case 5:return[3,8];case 6:return Q=X.sent(),$={error:Q},[3,8];case 7:try{H&&!H.done&&(Ne=z.return)&&Ne.call(z)}finally{if($)throw $.error}return[7];case 8:return[2]}})})})];case 21:return U.sent(),w||this._broadcastRemoveEvent(E,S),[3,24];case 22:return a instanceof IS?[4,t.fetch({token:Number.MAX_SAFE_INTEGER,limit:Number.MAX_SAFE_INTEGER})]:[3,24];case 23:U.sent(),U.label=24;case 24:return[2]}})})})}return e.prototype._broadcastUpdateEvent=function(n,t){var r,i;try{for(var s=pe(this._observers.values()),o=s.next();!o.done;o=s.next()){var a=o.value;a.onUpdate&&a.onUpdate(n,t)}}catch(l){r={error:l}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}},e.prototype._broadcastRemoveEvent=function(n,t){var r,i;try{for(var s=pe(this._observers.values()),o=s.next();!o.done;o=s.next()){var a=o.value;a.onRemove&&a.onRemove(n,t)}}catch(l){r={error:l}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}},e.prototype.subscribe=function(n,t){this._observers.set(n,t)},e.prototype.unsubscribe=function(n){this._observers.delete(n)},e.prototype.unsubscribeAll=function(){this._observers.clear()},e}(),FO=function(e){function n(t){var r=t.userId,i=t.ts,s=t.token,o=t.filter,a=t.includeChatNotification,l=a!==void 0&&a,u=e.call(this)||this,c=x(x({},_f),o),d=c.customTypes,h=c.includeEmpty,f=c.includeFrozen;return u.method=Z.GET,u.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/my_group_channels/changelogs"),u.params=ye(Ie({show_delivery_receipt:!0,show_member:!0,show_read_receipt:!0,change_ts:i||null,token:s,custom_types:d,show_empty:h,show_frozen:f,include_chat_notification:l})),u}return T(n,e),n}(J),HO=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.updatedChannels=r.updated.map(function(s){return new di(t,Object.assign(s,{ts:r.ts}))}),i.deletedChannelUrls=r.deleted,i.hasMore=r.has_more,i.token=r.next,i.ts=r.ts,i}return T(n,e),n}(se),Em=function(e){function n(t){var r=t.channelUrl,i=t.isInternalCall,s=e.call(this)||this;return s.method=Z.GET,s.path="".concat(i?Q4:sr,"/").concat(encodeURIComponent(r)),s.params={show_member:!0,show_read_receipt:!0,show_delivery_receipt:!0},s}return T(n,e),n}(J),bm=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.channel=new di(t,r),i}return T(n,e),n}(se),Ka={includeEmpty:!1,includeFrozen:!0,includeMetaData:!0,includeChatNotification:!1,channelUrlsFilter:void 0,customTypesFilter:void 0,customTypeStartsWithFilter:void 0,nicknameContainsFilter:void 0,nicknameStartsWithFilter:void 0,nicknameExactMatchFilter:void 0,channelNameContainsFilter:void 0,myMemberStateFilter:Rr.ALL,unreadChannelFilter:No.ALL,superChannelFilter:Ur.ALL,publicChannelFilter:ps.ALL,hiddenChannelFilter:Gi.ALL,userIdsFilter:{userIds:[],includeMode:!0,queryType:Ds.AND},searchFilter:{query:void 0,fields:[]},metadataKey:void 0,metadataValues:void 0,metadataOrderKeyFilter:void 0,metadataValueStartsWith:void 0,order:jt.LATEST_LAST_MESSAGE,createdAfter:void 0,createdBefore:void 0},jO=function(e){function n(t){var r=this,i=t.userId,s=t.token,o=t.limit,a=t.order,l=t.includeEmpty,u=t.myMemberStateFilter,c=t.superChannelFilter,d=t.publicChannelFilter,h=t.unreadChannelFilter,f=t.nicknameContainsFilter,p=t.nicknameStartsWithFilter,g=t.nicknameExactMatchFilter,b=t.channelNameContainsFilter,m=t.channelUrlsFilter,_=t.customTypesFilter,E=t.customTypeStartsWithFilter,S=t.hiddenChannelFilter,w=t.metadataOrderKeyFilter,N=t.metadataKey,A=t.metadataValues,k=t.metadataValueStartsWith,I=t.includeFrozen,M=t.includeMetaData,U=t.searchFilter,z=t.userIdsFilter,H=t.includeChatNotification,W=H!==void 0&&H,Q=t.includeLeftChannel,$=Q!==void 0&&Q,Ne=t.createdAfter,X=t.createdBefore;return(r=e.call(this)||this).method=Z.GET,r.path="".concat(Xe,"/").concat(encodeURIComponent(i),"/my_group_channels"),r.params=ye({token:s,limit:o,order:a??Ka.order,show_member:!0,show_read_receipt:!0,show_delivery_receipt:!0,show_empty:l??Ka.includeEmpty,member_state_filter:u??Ka.myMemberStateFilter,super_mode:c??Ka.superChannelFilter,public_mode:d??Ka.publicChannelFilter,unread_filter:h??Ka.unreadChannelFilter,members_nickname_contains:f,members_nickname_startswith:p,members_nickname:g,name_contains:b,channel_urls:m,custom_types:_,custom_type_startswith:E,hidden_mode:S,metadata_order_key:w,metadata_key:N,metadata_values:A,metadata_value_startswith:k,show_frozen:I,show_metadata:M,include_chat_notification:W,include_left_channel:$,created_after:Ne,created_before:X}),U&&U.query&&U.fields&&(r.params.search_query=U.query,r.params.search_fields=U.fields),z&&z.userIds&&z.userIds.length>0&&(z.includeMode?(r.params.members_include_in=z.userIds,r.params.query_type=z.queryType.toUpperCase()):r.params.members_exactly_in=z.userIds),r}return T(n,e),n}(J),BO=function(e){function n(t,r){var i=e.call(this,t,r)||this;i.channels=[];var s=r.next,o=r.channels,a=r.ts;return i.token=s,o&&o.length>0&&(i.channels=o.map(function(l){return l.ts=a,new di(t,l)})),i.ts=a??0,i}return T(n,e),n}(se),$O=function(e){function n(t){var r=t.userId,i=t.filter,s=e.call(this)||this,o=i.myMemberStateFilter;return s.method=Z.GET,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/group_channel_count"),s.params={state:o??Rr.ALL},s}return T(n,e),n}(J),GO=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.groupChannelCount=r.group_channel_count,i}return T(n,e),n}(se),zO=function(e){function n(t){var r=t.userId,i=t.filter,s=e.call(this)||this,o=i.keys;return s.method=Z.GET,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/unread_item_count"),s.params=ye({item_keys:o}),s}return T(n,e),n}(J),VO=function(e){function n(t,r){var i=e.call(this,t,r)||this;return typeof r[Tn.GROUP_CHANNEL_UNREAD_MENTION_COUNT]=="number"&&(i.groupChannelUnreadMentionCount=r[Tn.GROUP_CHANNEL_UNREAD_MENTION_COUNT]),typeof r[Tn.GROUP_CHANNEL_UNREAD_MESSAGE_COUNT]=="number"&&(i.groupChannelUnreadMessageCount=r[Tn.GROUP_CHANNEL_UNREAD_MESSAGE_COUNT]),typeof r[Tn.GROUP_CHANNEL_INVITATION_COUNT]=="number"&&(i.groupChannelInvitationCount=r[Tn.GROUP_CHANNEL_INVITATION_COUNT]),typeof r[Tn.SUPER_UNREAD_MENTION_COUNT]=="number"&&(i.superGroupChannelUnreadMentionCount=r[Tn.SUPER_UNREAD_MENTION_COUNT]),typeof r[Tn.SUPER_UNREAD_MESSAGE_COUNT]=="number"&&(i.superGroupChannelUnreadMessageCount=r[Tn.SUPER_UNREAD_MESSAGE_COUNT]),typeof r[Tn.SUPER_INVITATION_COUNT]=="number"&&(i.superGroupChannelInvitationCount=r[Tn.SUPER_INVITATION_COUNT]),typeof r[Tn.NONSUPER_UNREAD_MENTION_COUNT]=="number"&&(i.nonSuperGroupChannelUnreadMentionCount=r[Tn.NONSUPER_UNREAD_MENTION_COUNT]),typeof r[Tn.NONSUPER_UNREAD_MESSAGE_COUNT]=="number"&&(i.nonSuperGroupChannelUnreadMessageCount=r[Tn.NONSUPER_UNREAD_MESSAGE_COUNT]),typeof r[Tn.NONSUPER_INVITATION_COUNT]=="number"&&(i.nonSuperGroupChannelInvitationCount=r[Tn.NONSUPER_INVITATION_COUNT]),i}return T(n,e),n}(se),qO=function(e){function n(t){var r=t.userId,i=e.call(this)||this;return i.method=Z.GET,i.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/unread_channel_count"),i}return T(n,e),n}(J),WO=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.unreadCount=r.unread_count,i}return T(n,e),n}(se),KO=function(e){function n(t){var r=t.userId,i=t.filter,s=t.includeFeedChannel,o=s!==void 0&&s,a=e.call(this)||this,l=i.channelCustomTypesFilter,u=i.superChannelFilter;return a.method=Z.GET,a.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/unread_message_count"),a.params={super_mode:u??Ur.ALL,custom_types:l,include_feed_channel:o},a}return T(n,e),n}(J),QO=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.unreadCount=r.unread_count,i.unreadFeedCount=r.unread_feed_count,i}return T(n,e),n}(se),YO=function(e){function n(t){var r=t.channelUrl,i=t.scheduledStatus,s=t.messageTypeFilter,o=e.call(this)||this;return o.method=Z.GET,o.path="".concat(cC,"/count"),o.params={channel_url:r,status:XO(i)},s&&(o.params.message_type=s),o}return T(n,e),n}(J),ZO=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.count=r.count,i}return T(n,e),n}(se),XO=function(e){if(!e)return[];var n=[];return e.forEach(function(t){switch(t){case uo.PENDING:n.push(ii.PENDING);break;case uo.SENT:n.push(ii.IN_QUEUE),n.push(ii.SENT);break;case uo.CANCELED:n.push(ii.CANCELED);break;case uo.FAILED:n.push(ii.FAILED)}}),n},JO=function(e){function n(t){var r=this,i=t.userId,s=t.channelUrl,o=t.coverUrl,a=t.coverImage,l=t.isDistinct,u=t.isSuper,c=t.isBroadcast,d=t.isPublic,h=t.isExclusive,f=t.isDiscoverable,p=t.isStrict,g=t.isEphemeral,b=t.accessCode,m=t.name,_=t.data,E=t.customType,S=t.messageSurvivalSeconds,w=t.invitedUserIds,N=t.operatorUserIds;return(r=e.call(this)||this).method=Z.POST,r.path=sr,r.params=ye({user_ids:De([i],Ae(w??[]),!1).filter(function(A,k,I){return k===I.indexOf(A)}),channel_url:s,cover_url:o,cover_file:a,is_distinct:l,is_super:u,is_broadcast:c,is_exclusive:h,is_public:d,is_discoverable:f,strict:p,is_ephemeral:g,access_code:b,name:m,data:_,custom_type:E,operator_ids:N,message_survival_seconds:S}),r}return T(n,e),n}(J),ek=function(e){function n(t,r){var i,s=this;return(s=e.call(this,t,r)||this).channel=new di(t,r),s.isCreated=(i=r.is_created)===null||i===void 0||i,s}return T(n,e),n}(se),py=function(e){function n(t){var r=t.userId,i=t.channelUrls,s=e.call(this)||this;return s.method=Z.PUT,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/mark_as_read_all"),s.params={channel_urls:i},s}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var tk=function(e){function n(t){var r=this,i=t.channelUrl,s=t.userId,o=t.accessCode;return(r=e.call(this)||this).method=Z.PUT,r.path="".concat(sr,"/").concat(encodeURIComponent(i),"/join"),r.params={user_id:s,access_code:o},r}return T(n,e),n}(J),nk=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.channel=new di(t,r),i}return T(n,e),n}(se),rk=function(e){function n(t,r,i){var s=e.call(this,t,r,i)||this,o=i.data,a=o.member_count,l=a===void 0?0:a,u=o.joined_member_count,c=u===void 0?0:u,d=o.users,h=d===void 0?null:d;return s.memberCount=l,s.joinedMemberCount=c,s.members=Array.isArray(h)?h.map(function(f){return new si(t,f)}):[new si(t,i.data)],s}return T(n,e),n}(Kl),ik=function(e){function n(t){var r=this,i=t.channelUrl,s=t.userId,o=t.shouldRemoveOperatorStatus;return(r=e.call(this)||this).method=Z.PUT,r.path="".concat(sr,"/").concat(encodeURIComponent(i),"/leave"),r.params={user_id:s,should_remove_operator_status:o},r}return T(n,e),n}(J);(function(e){function n(t,r){return e.call(this,t,r)||this}T(n,e)})(se);var sk=function(e){function n(t,r,i){var s=e.call(this,t,r,i)||this,o=i.data,a=o.member_count,l=a===void 0?0:a,u=o.joined_member_count,c=u===void 0?0:u;return s.memberCount=l,s.joinedMemberCount=c,s.member=new si(s._iid,i.data),s}return T(n,e),n}(Kl),ok=function(e){function n(t){var r=this,i=t.channelUrl,s=t.userIds;return(r=e.call(this)||this).method=Z.POST,r.path="".concat(sr,"/").concat(encodeURIComponent(i),"/invite"),r.params={user_ids:s},r}return T(n,e),n}(J),ak=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.channel=new di(t,r),i}return T(n,e),n}(se),lk=function(e){function n(t,r,i){var s=e.call(this,t,r,i)||this;s.inviter=null;var o=i.data,a=o.member_count,l=a===void 0?0:a,u=o.joined_member_count,c=u===void 0?0:u,d=o.inviter,h=o.invitees,f=h===void 0?[]:h;return s.memberCount=l,s.joinedMemberCount=c,d&&Object.keys(d).length>0&&(s.inviter=new Ke(t,d)),s.invitees=f.map(function(p){return new si(t,p)}),s}return T(n,e),n}(Kl),uk=function(e){function n(t){var r=this,i=t.channelUrl,s=t.userId;return(r=e.call(this)||this).method=Z.PUT,r.path="".concat(sr,"/").concat(encodeURIComponent(i),"/decline"),r.params={user_id:s},r}return T(n,e),n}(J);(function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.channel=new di(t,r),i.channel.myMemberState=Gt.NONE,i}T(n,e)})(se);var ck=function(e){function n(t,r,i){var s=e.call(this,t,r,i)||this,o=i.data,a=o.member_count,l=o.joined_member_count,u=o.inviter,c=o.invitee;return s.memberCount=a??0,s.joinedMemberCount=l??0,s.inviter=new Ke(t,u),s.invitee=new si(t,c),s}return T(n,e),n}(Kl),Cm={hidePreviousMessages:!1,allowAutoUnhide:!0},dk=function(e){function n(t){var r=this,i=t.channelUrl,s=t.userId,o=t.hidePreviousMessages,a=t.allowAutoUnhide;return(r=e.call(this)||this).method=Z.PUT,r.path="".concat(sr,"/").concat(encodeURIComponent(i),"/hide"),r.params={user_id:s,hide_previous_messages:o??Cm.hidePreviousMessages,allow_auto_unhide:a??Cm.allowAutoUnhide},r}return T(n,e),n}(J),hk=function(e){function n(t,r){var i=e.call(this,t,r)||this,s=r.ts_message_offset;return i.messageOffsetTimestamp=s,i}return T(n,e),n}(se),fk=function(e){function n(t,r,i){var s,o,a,l=this;return(l=e.call(this,t,"SYEV",i)||this).allowAutoUnhide=null,l.hidePreviousMessages=null,l.messageOffsetTimestamp=null,i.data&&(l.allowAutoUnhide=(s=i.data.allow_auto_unhide)!==null&&s!==void 0?s:null,l.hidePreviousMessages=(o=i.data.hide_previous_messages)!==null&&o!==void 0?o:null),l.messageOffsetTimestamp=(a=i.ts_message_offset)!==null&&a!==void 0?a:null,l}return T(n,e),n}(gt),pk=function(e){function n(t){var r=t.channelUrl,i=t.time;return e.call(this,{code:"TPST",ackRequired:!1,payload:{channel_url:r,time:i}})||this}return T(n,e),n}(wr),_k=function(e){function n(t,r,i){var s=e.call(this,t,"SYEV",i)||this;return s.user=new Ke(t,i.data),s}return T(n,e),n}(gt),mk=function(e){function n(t){var r=t.channelUrl,i=t.time;return e.call(this,{code:"TPEN",ackRequired:!1,payload:{channel_url:r,time:i}})||this}return T(n,e),n}(wr),gk=function(e){function n(t,r,i){var s=e.call(this,t,"SYEV",i)||this;return s.user=new Ke(t,i.data),s}return T(n,e),n}(gt),vk=function(e){function n(t){var r=t.channelUrl,i=t.messageId;return e.call(this,{code:"MACK",ackRequired:!1,payload:{channel_url:r,msg_id:i}})||this}return T(n,e),n}(wr),RS=function(e){function n(t,r){var i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S,w,N,A,k,I,M,U=this;return(U=e.call(this,t,r)||this).includeEmpty=!1,U.includeFrozen=!0,U.includeMetaData=!0,U.includeChatNotification=!1,U.channelUrlsFilter=null,U.customTypesFilter=null,U.customTypeStartsWithFilter=null,U.nicknameContainsFilter=null,U.nicknameStartsWithFilter=null,U.nicknameExactMatchFilter=null,U.channelNameContainsFilter="",U.myMemberStateFilter=Rr.ALL,U.unreadChannelFilter=No.ALL,U.superChannelFilter=Ur.ALL,U.publicChannelFilter=ps.ALL,U.hiddenChannelFilter=Gi.UNHIDDEN,U.searchFilter={fields:[],query:null},U.userIdsFilter={userIds:[],includeMode:!0,queryType:Ds.AND},U.metadataKey=null,U.metadataValues=null,U.metadataOrderKeyFilter=null,U.metadataValueStartsWith=null,U.order=jt.LATEST_LAST_MESSAGE,U.includeEmpty=(i=r.includeEmpty)!==null&&i!==void 0&&i,U.includeFrozen=(s=r.includeFrozen)===null||s===void 0||s,U.includeMetaData=(o=r.includeMetaData)===null||o===void 0||o,U.includeChatNotification=(a=r.includeChatNotification)!==null&&a!==void 0&&a,U.channelUrlsFilter=(l=r.channelUrlsFilter)!==null&&l!==void 0?l:null,U.customTypesFilter=(u=r.customTypesFilter)!==null&&u!==void 0?u:null,U.customTypeStartsWithFilter=(c=r.customTypeStartsWithFilter)!==null&&c!==void 0?c:"",U.nicknameContainsFilter=(d=r.nicknameContainsFilter)!==null&&d!==void 0?d:null,U.nicknameStartsWithFilter=(h=r.nicknameStartsWithFilter)!==null&&h!==void 0?h:null,U.nicknameExactMatchFilter=(f=r.nicknameExactMatchFilter)!==null&&f!==void 0?f:null,U.channelNameContainsFilter=(p=r.channelNameContainsFilter)!==null&&p!==void 0?p:"",U.myMemberStateFilter=(g=r.myMemberStateFilter)!==null&&g!==void 0?g:Rr.ALL,U.unreadChannelFilter=(b=r.unreadChannelFilter)!==null&&b!==void 0?b:No.ALL,U.superChannelFilter=(m=r.superChannelFilter)!==null&&m!==void 0?m:Ur.ALL,U.publicChannelFilter=(_=r.publicChannelFilter)!==null&&_!==void 0?_:ps.ALL,U.hiddenChannelFilter=(E=r.hiddenChannelFilter)!==null&&E!==void 0?E:Gi.UNHIDDEN,U.searchFilter=(S=r.searchFilter)!==null&&S!==void 0?S:{fields:[],query:null},U.userIdsFilter=(w=r.userIdsFilter)!==null&&w!==void 0?w:{userIds:[],includeMode:!0,queryType:Ds.AND},U.metadataKey=(N=r.metadataKey)!==null&&N!==void 0?N:null,U.metadataValues=(A=r.metadataValues)!==null&&A!==void 0?A:null,U.metadataOrderKeyFilter=(k=r.metadataOrderKeyFilter)!==null&&k!==void 0?k:null,U.metadataValueStartsWith=(I=r.metadataValueStartsWith)!==null&&I!==void 0?I:null,U.order=(M=r.order)!==null&&M!==void 0?M:jt.LATEST_LAST_MESSAGE,r.createdAfter&&(U.createdAfter=r.createdAfter),r.createdBefore&&(U.createdBefore=r.createdBefore),U}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)&&R("boolean",this.includeEmpty)&&R("boolean",this.includeFrozen)&&R("boolean",this.includeMetaData)&&R("string",this.channelNameContainsFilter)&&We("string",this.channelUrlsFilter,!0)&&We("string",this.customTypesFilter,!0)&&R("string",this.customTypeStartsWithFilter)&&R("string",this.nicknameContainsFilter,!0)&&R("string",this.nicknameStartsWithFilter,!0)&&R("string",this.nicknameExactMatchFilter,!0)&&$e(Rr,this.myMemberStateFilter)&&$e(Ur,this.superChannelFilter)&&$e(ps,this.publicChannelFilter)&&$e(No,this.unreadChannelFilter)&&$e(Gi,this.hiddenChannelFilter)&&We(Pc,this.searchFilter.fields)&&R("string",this.searchFilter.query,!0)&&We("string",this.userIdsFilter.userIds)&&R("boolean",this.userIdsFilter.includeMode)&&$e(Ds,this.userIdsFilter.queryType)&&$e(jt,this.order)&&R("string",this.metadataOrderKeyFilter,!0)&&R("string",this.metadataKey,!0)&&We("string",this.metadataValues,!0)&&R("string",this.metadataValueStartsWith,!0)&&e1(this.createdAfter,!0)&&e1(this.createdBefore,!0)},n.prototype.serialize=function(){return Qc(this)},n.prototype.next=function(){return y(this,void 0,void 0,function(){var t,r,i;return v(this,function(s){switch(s.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,[4,Nn.of(this._iid).getMyGroupChannels(this._token,Ie(x({},this)),this.limit,G.REQUEST_CHANNEL,!0)]):[3,2]:[3,5];case 1:return t=s.sent(),r=t.channels,i=t.token,this._token=i,this._hasNext=!!i,this._isLoading=!1,[2,r];case 2:return[2,[]];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Uo),yk=function(e){function n(t,r,i){var s,o=this;return(o=e.call(this,t,"SYEV",i)||this).pinnedMessageIds=[],o.latestPinnedMessage=null,o.ts=0,i.data&&(o.pinnedMessageIds=(s=i.data.pinned_message_ids)!==null&&s!==void 0?s:[],o.latestPinnedMessage=i.data.latest_pinned_message?yr(t,x({},i.data.latest_pinned_message)):null),o.ts=i.ts,o}return T(n,e),n}(gt),Ek=function(e){function n(t){var r=t.channelUrl,i=t.userId,s=e.call(this)||this;return s.method=Z.PUT,s.path="".concat(sr,"/").concat(encodeURIComponent(r),"/messages/mark_as_delivered"),s.params=ye({userId:i}),s}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var ws,bk=function(e){function n(t,r,i){var s=e.call(this,t,"DLVR",i)||this;return s.channelUrl=i.channel_url,s.deliveredStateUpdate=i.updated,s}return T(n,e),n}(gt),ls=function(){function e(n){var t=n.top,r=t===void 0?Number.MAX_SAFE_INTEGER:t,i=n.bottom,s=i===void 0?0:i;this.top=r,this.bottom=s}return e.prototype.includes=function(){for(var n=this,t=[],r=0;r0&&He.onMentionReceived&&He.onMentionReceived(g,f)}catch(ct){ke={error:ct}}finally{try{j&&!j.done&&(je=q.return)&&je.call(q)}finally{if(ke)throw ke.error}}return[2]})})}),Qe.label=6;case 6:return[3,79];case 7:return S=t.as(aA),Ee=S.channelUrl,Be=S.channelType,w=S.messageId,N=S.silent,A=S.messageCreatedAt,k=S.senderId,Be!==Ze.GROUP?[3,9]:[4,this.getChannel(Ee,!0)];case 8:I=Qe.sent(),M=k===this._sdkState.userId,N||M||A>0&&I.myLastRead0&&I._updateUnreadCount(I.unreadMessageCount-1,0),this._dispatcher.dispatch(new Xg({messageIds:[w],source:G.EVENT_MESSAGE_DELETED})),Re(function(){return y(lt,void 0,void 0,function(){var q,j,He,ke,je;return v(this,function(Pt){try{for(q=pe(this._groupChannelHandlers.values()),j=q.next();!j.done;j=q.next())(He=j.value).onMessageDeleted&&He.onMessageDeleted(I,w)}catch(ct){ke={error:ct}}finally{try{j&&!j.done&&(je=q.return)&&je.call(q)}finally{if(ke)throw ke.error}}return[2]})})}),Qe.label=9;case 9:return[3,79];case 10:return(U=t.as(sS).readStatus).channelType!==Ze.GROUP?[3,12]:($=this._groupChannelCache.isCachedInMemory(U.channelUrl),[4,this.getChannel(U.channelUrl,!0)]);case 11:z=Qe.sent(),$&&z._updateUnreadMemberState(U.reader.userId,U.readAt),U.reader.userId===this._sdkState.userId?$?(z.unreadMessageCount>0||z.unreadMentionCount>0)&&(z._updateUnreadCount(0,0),this._dispatcher.dispatch(new Ve({channels:[z],context:{source:G.EVENT_CHANNEL_READ}})),Re(function(){return y(lt,void 0,void 0,function(){var q,j,He,ke,je;return v(this,function(Pt){try{for(q=pe(this._groupChannelHandlers.values()),j=q.next();!j.done;j=q.next())(He=j.value).onChannelChanged&&He.onChannelChanged(z)}catch(ct){ke={error:ct}}finally{try{j&&!j.done&&(je=q.return)&&je.call(q)}finally{if(ke)throw ke.error}}return[2]})})})):z.unreadMessageCount!==0&&z.unreadMentionCount!==0||(this._dispatcher.dispatch(new Ve({channels:[z],context:{source:G.EVENT_CHANNEL_READ}})),Re(function(){return y(lt,void 0,void 0,function(){var q,j,He,ke,je;return v(this,function(Pt){try{for(q=pe(this._groupChannelHandlers.values()),j=q.next();!j.done;j=q.next())(He=j.value).onChannelChanged&&He.onChannelChanged(z)}catch(ct){ke={error:ct}}finally{try{j&&!j.done&&(je=q.return)&&je.call(q)}finally{if(ke)throw ke.error}}return[2]})})})):(this._dispatcher.dispatch(new Ve({channels:[z],context:{source:G.EVENT_CHANNEL_READ}})),Re(function(){return y(lt,void 0,void 0,function(){var q,j,He,ke,je;return v(this,function(Pt){try{for(q=pe(this._groupChannelHandlers.values()),j=q.next();!j.done;j=q.next())(He=j.value).onUnreadMemberStatusUpdated&&He.onUnreadMemberStatusUpdated(z)}catch(ct){ke={error:ct}}finally{try{j&&!j.done&&(je=q.return)&&je.call(q)}finally{if(ke)throw ke.error}}return[2]})})})),Qe.label=12;case 12:return[3,79];case 13:return H=t.as(bk),Ee=H.channelUrl,W=H.deliveredStateUpdate,Q=W===void 0?{}:W,$=this._groupChannelCache.isCachedInMemory(Ee),[4,this.getChannel(Ee,!0)];case 14:return Ne=Qe.sent(),$&&Object.keys(Q).forEach(function(q){Ne._updateUndeliveredMemberState(q,Q[q])}),Object.keys(Q).some(function(q){return q!==lt._sdkState.userId})&&(this._dispatcher.dispatch(new Ve({channels:[Ne],context:{source:G.EVENT_CHANNEL_DELIVERED}})),Re(function(){return y(lt,void 0,void 0,function(){var q,j,He,ke,je;return v(this,function(Pt){try{for(q=pe(this._groupChannelHandlers.values()),j=q.next();!j.done;j=q.next())(He=j.value).onUndeliveredMemberStatusUpdated&&He.onUndeliveredMemberStatusUpdated(Ne)}catch(ct){ke={error:ct}}finally{try{j&&!j.done&&(je=q.return)&&je.call(q)}finally{if(ke)throw ke.error}}return[2]})})})),[3,79];case 15:return X=t.as(IO),Ee=X.channelUrl,Be=X.channelType,ae=X.event,Be!==Ze.GROUP?[3,18]:[4,this.getChannel(Ee,!0)];case 16:return ne=Qe.sent(),[4,this.getMessageFromCache(ae.messageId)];case 17:(ie=Qe.sent())?ie instanceof hr&&(ie.applyReactionEvent(ae),this._dispatcher.dispatch(new bt({messages:[ie],source:G.EVENT_MESSAGE_REACTION_UPDATED}))):this._dispatcher.dispatch(new zC({event:ae,source:G.EVENT_MESSAGE_REACTION_UPDATED})),Re(function(){return y(lt,void 0,void 0,function(){var q,j,He,ke,je;return v(this,function(Pt){try{for(q=pe(this._groupChannelHandlers.values()),j=q.next();!j.done;j=q.next())(He=j.value).onReactionUpdated&&He.onReactionUpdated(ne,ae)}catch(ct){ke={error:ct}}finally{try{j&&!j.done&&(je=q.return)&&je.call(q)}finally{if(ke)throw ke.error}}return[2]})})}),Qe.label=18;case 18:return[3,79];case 19:return(Ce=t.as(AO).event).channelType!==Ze.GROUP?[3,22]:[4,this.getChannel(Ce.channelUrl,!0)];case 20:return K=Qe.sent(),[4,this.getMessageFromCache(Ce.targetMessageId)];case 21:(ie=Qe.sent())?ie instanceof hr&&(ie.applyThreadInfoUpdateEvent(Ce),this._dispatcher.dispatch(new bt({messages:[ie],source:G.EVENT_MESSAGE_THREADINFO_UPDATED}))):this._dispatcher.dispatch(new VC({event:Ce,source:G.EVENT_MESSAGE_THREADINFO_UPDATED})),Re(function(){return y(lt,void 0,void 0,function(){var q,j,He,ke,je;return v(this,function(Pt){try{for(q=pe(this._groupChannelHandlers.values()),j=q.next();!j.done;j=q.next())(He=j.value).onThreadInfoUpdated&&He.onThreadInfoUpdated(K,Ce)}catch(ct){ke={error:ct}}finally{try{j&&!j.done&&(je=q.return)&&je.call(q)}finally{if(ke)throw ke.error}}return[2]})})}),Qe.label=22;case 22:return[3,79];case 23:ee=t.as(MO).groupChannelMemberCounts,ue=[],Qe.label=24;case 24:Qe.trys.push([24,29,30,31]),P=pe(ee),xe=P.next(),Qe.label=25;case 25:return xe.done?[3,28]:(B=xe.value,Ee=B.channelUrl,rn=B.memberCount,sn=B.joinedMemberCount,te=B.updatedAt,[4,this.getChannelFromCache(Ee)]);case 26:(oe=Qe.sent())&&oe._setLatestMemberCount(rn,sn,te)&&ue.push(oe),Qe.label=27;case 27:return xe=P.next(),[3,25];case 28:return[3,31];case 29:return me=Qe.sent(),N0={error:me},[3,31];case 30:try{xe&&!xe.done&&(Mv=P.return)&&Mv.call(P)}finally{if(N0)throw N0.error}return[7];case 31:return ue.length>0&&(this._dispatcher.dispatch(new Ve({channels:ue,context:{source:G.EVENT_CHANNEL_MEMBER_COUNT_UPDATED}})),Re(function(){return y(lt,void 0,void 0,function(){var q,j,He,ke,je;return v(this,function(Pt){try{for(q=pe(this._groupChannelHandlers.values()),j=q.next();!j.done;j=q.next())(He=j.value).onChannelMemberCountChanged&&He.onChannelMemberCountChanged(ue)}catch(ct){ke={error:ct}}finally{try{j&&!j.done&&(je=q.return)&&je.call(q)}finally{if(ke)throw ke.error}}return[2]})})})),[3,79];case 32:return re=t.as(xO),ce=re.event,de=re.status,Ee=re.channelUrl,Be=re.channelType,Ee&&Be===Ze.GROUP?[4,this.getChannel(Ee,!0)]:[3,34];case 33:fe=Qe.sent(),this._dispatcher.dispatch(new KC({event:ce,source:G.EVENT_POLL_UPDATED})),Re(de===k6?function(){return y(lt,void 0,void 0,function(){var q,j,He,ke,je;return v(this,function(Pt){try{for(q=pe(this._groupChannelHandlers.values()),j=q.next();!j.done;j=q.next())(He=j.value).onPollDeleted&&He.onPollDeleted(fe,ce.pollId)}catch(ct){ke={error:ct}}finally{try{j&&!j.done&&(je=q.return)&&je.call(q)}finally{if(ke)throw ke.error}}return[2]})})}:function(){return y(lt,void 0,void 0,function(){var q,j,He,ke,je;return v(this,function(Pt){try{for(q=pe(this._groupChannelHandlers.values()),j=q.next();!j.done;j=q.next())(He=j.value).onPollUpdated&&He.onPollUpdated(fe,ce)}catch(ct){ke={error:ct}}finally{try{j&&!j.done&&(je=q.return)&&je.call(q)}finally{if(ke)throw ke.error}}return[2]})})}),Qe.label=34;case 34:return[3,79];case 35:return ve=t.as(gS),_e=ve.event,Ee=ve.channelUrl,Be=ve.channelType,Ee&&Be===Ze.GROUP?[4,this.getChannel(Ee,!0)]:[3,37];case 36:ze=Qe.sent(),this._dispatcher.dispatch(new Jg({event:_e,source:G.EVENT_POLL_VOTED})),Re(function(){return y(lt,void 0,void 0,function(){var q,j,He,ke,je;return v(this,function(Pt){try{for(q=pe(this._groupChannelHandlers.values()),j=q.next();!j.done;j=q.next())(He=j.value).onPollVoted&&He.onPollVoted(ze,_e)}catch(ct){ke={error:ct}}finally{try{j&&!j.done&&(je=q.return)&&je.call(q)}finally{if(ke)throw ke.error}}return[2]})})}),Qe.label=37;case 37:return[3,79];case 38:if(!(V=t.as(Kl).event).isGroupChannelEvent)return[3,77];switch(V.category){case Xt.CHANNEL_JOIN:return[3,39];case Xt.CHANNEL_LEAVE:return[3,41];case Xt.CHANNEL_OPERATOR_UPDATE:return[3,45];case Xt.CHANNEL_INVITE:return[3,47];case Xt.CHANNEL_DECLINE_INVITE:return[3,49];case Xt.TYPING_START:case Xt.TYPING_END:return[3,51];case Xt.USER_CHANNEL_MUTE:case Xt.USER_CHANNEL_UNMUTE:return[3,53];case Xt.USER_CHANNEL_BAN:return[3,55];case Xt.USER_CHANNEL_UNBAN:return[3,59];case Xt.CHANNEL_FREEZE:case Xt.CHANNEL_UNFREEZE:return[3,61];case Xt.CHANNEL_HIDE:return[3,63];case Xt.CHANNEL_UNHIDE:return[3,65];case Xt.CHANNEL_DELETED:return[3,67];case Xt.CHANNEL_PROP_CHANGED:return[3,69];case Xt.CHANNEL_META_DATA_CHANGED:return[3,71];case Xt.CHANNEL_META_COUNTERS_CHANGED:return[3,73];case Xt.PINNED_MESSAGE_CHANGED:return[3,75]}return[3,77];case 39:return[4,this.getChannel(V.channelUrl,!0)];case 40:return Se=Qe.sent(),Ue=t.as(rk),le=Ue.memberCount,Oe=Ue.joinedMemberCount,tt=Ue.members,at=!1,tt.forEach(function(q){Se.isExclusive||Se.isSuper||Se.isBroadcast?at=at||Se._setLatestMemberCount(le,Oe,V.ts):(q.state=Gt.JOINED,Se.addMember(q,V.ts),lt._updateJoinedMemberCount(Se)),q.userId===lt._sdkState.userId&&(Se.myMemberState=Gt.JOINED)}),this._dispatcher.dispatch(new Ve({channels:[Se],context:{source:G.EVENT_CHANNEL_JOINED,users:tt}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){var He,ke;try{for(var je=pe(tt),Pt=je.next();!Pt.done;Pt=je.next()){var ct=Pt.value;j.onUserJoined&&j.onUserJoined(Se,ct)}}catch(cw){He={error:cw}}finally{try{Pt&&!Pt.done&&(ke=je.return)&&ke.call(je)}finally{if(He)throw He.error}}Se.isBroadcast&&at&&j.onChannelMemberCountChanged&&j.onChannelMemberCountChanged([Se])}),[2]})})}),[3,77];case 41:return(Hn=this._leftChannels.get(V.channelUrl))?(Ye=Hn.channel,[3,44]):[3,42];case 42:return[4,this.getChannel(V.channelUrl,!0)];case 43:Ye=Qe.sent(),Qe.label=44;case 44:return Pe=Ye,wt=t.as(sk),rn=wt.memberCount,sn=wt.joinedMemberCount,_t=wt.member,Rt=!1,Lt=O.of(this._iid).appInfo,Pe.isExclusive||Pe.isSuper||Pe.isBroadcast?Rt=Pe._setLatestMemberCount(rn,sn,V.ts):(Lt!=null&&Lt.enabledChannelMemberShipHistory?((nn=Pe.members.find(function(q){return q.userId===_t.userId}))&&(nn.state=Gt.LEFT),Pe.memberCount=rn):Pe.removeMember(_t),this._updateJoinedMemberCount(Pe)),_t.userId===this._sdkState.userId?(Pe.myMemberState=Gt.NONE,Pe.invitedAt=0,Pe.joinedAt=0,Pe._updateUnreadCount(0,0),Pe.isPublic?this._dispatcher.dispatch(new Ve({channels:[Pe],context:{source:G.EVENT_CHANNEL_LEFT,user:_t}})):(this._markAsLeave(Pe),this._dispatcher.dispatch(new bs({channelUrls:[Pe.url],context:{source:G.EVENT_CHANNEL_LEFT,user:_t}})))):this._dispatcher.dispatch(new Ve({channels:[Pe],context:{source:G.EVENT_CHANNEL_LEFT,user:_t}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){j.onUserLeft&&j.onUserLeft(Pe,_t),Pe.isBroadcast&&Rt&&j.onChannelMemberCountChanged&&j.onChannelMemberCountChanged([Pe])}),[2]})})}),[3,77];case 45:return[4,this.getChannel(V.channelUrl,!0)];case 46:Qt=Qe.sent(),un=t.as(SO).operators,Dt=un.map(function(q){return q.userId});try{for(Nt=pe(Qt.members),xn=Nt.next();!xn.done;xn=Nt.next())(Yt=xn.value).role=Dt.includes(Yt.userId)?Ni.OPERATOR:Ni.NONE}catch(q){I0={error:q}}finally{try{xn&&!xn.done&&(xv=Nt.return)&&xv.call(Nt)}finally{if(I0)throw I0.error}}return Qt.myRole=Dt.includes(this._sdkState.userId)?Ni.OPERATOR:Ni.NONE,this._dispatcher.dispatch(new Ve({channels:[Qt],context:{source:G.EVENT_CHANNEL_OPERATOR_UPDATED,operators:un}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){j.onOperatorUpdated&&j.onOperatorUpdated(Qt,un)}),[2]})})}),[3,77];case 47:return[4,this.getChannel(V.channelUrl,!0)];case 48:Bt=Qe.sent(),ft=t.as(lk),rn=ft.memberCount,sn=ft.joinedMemberCount,cn=ft.inviter,(Un=ft.invitees).forEach(function(q){return q.state=Gt.INVITED});try{for(Pn=pe(Un),vn=Pn.next();!vn.done;vn=Pn.next())Fn=vn.value,Bt.isExclusive||Bt.isSuper||Bt.isBroadcast?Bt._setLatestMemberCount(rn,sn,V.ts):Bt.addMember(Fn,V.ts),this._sdkState.userId===Fn.userId&&(Bt.hiddenState=dr.UNHIDDEN,Bt.myMemberState!==Gt.JOINED&&(Bt.myMemberState=Gt.INVITED),Bt.invitedAt=V.ts)}catch(q){A0={error:q}}finally{try{vn&&!vn.done&&(Ov=Pn.return)&&Ov.call(Pn)}finally{if(A0)throw A0.error}}return this._dispatcher.dispatch(new Ve({channels:[Bt],context:{source:G.EVENT_CHANNEL_INVITED,inviter:cn,invitees:Un}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){j.onUserReceivedInvitation&&j.onUserReceivedInvitation(Bt,cn,Un)}),[2]})})}),[3,77];case 49:return[4,this.getChannel(V.channelUrl,!0)];case 50:return Ot=Qe.sent(),On=t.as(ck),rn=On.memberCount,sn=On.joinedMemberCount,kn=On.inviter,yn=On.invitee,Ot.isExclusive||Ot.isSuper||Ot.isBroadcast?Ot._setLatestMemberCount(rn,sn,V.ts):Ot.removeMember(yn),this._sdkState.userId===yn.userId?(Ot.invitedAt=0,Ot.myMemberState=Gt.NONE,Ot.isPublic?this._dispatcher.dispatch(new Ve({channels:[Ot],context:{source:G.EVENT_CHANNEL_DECLINED_INVITE,inviter:kn,invitee:yn}})):this._dispatcher.dispatch(new bs({channelUrls:[Ot.url],context:{source:G.EVENT_CHANNEL_DECLINED_INVITE,inviter:kn,invitee:yn}}))):this._dispatcher.dispatch(new Ve({channels:[Ot],context:{source:G.EVENT_CHANNEL_DECLINED_INVITE,inviter:kn,invitee:yn}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){j.onUserDeclinedInvitation&&j.onUserDeclinedInvitation(Ot,kn,yn)}),[2]})})}),[3,77];case 51:return[4,this.getChannel(V.channelUrl,!0)];case 52:return It=Qe.sent(),Rn=V.category===Xt.TYPING_START,or=t.as(Rn?_k:gk).user,It._updateTypingStatus(or,Rn?V.ts:0),this._dispatcher.dispatch(new Ve({channels:[It],context:{source:G.EVENT_CHANNEL_TYPING_STATUS_UPDATE}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){j.onTypingStatusUpdated&&j.onTypingStatusUpdated(It)}),[2]})})}),[3,77];case 53:return[4,this.getChannel(V.channelUrl,!0)];case 54:dn=Qe.sent(),En=V.category===Xt.USER_CHANNEL_MUTE,(bn=t.as(En?GM:VM).user).userId===this._sdkState.userId&&(dn.myMutedState=En?ss.MUTED:ss.UNMUTED,dn._myMutedRemainingTime=bn.restrictionInfo.remainingDuration);try{for(Ut=pe(dn.members),Cn=Ut.next();!Cn.done;Cn=Ut.next())if((Yt=Cn.value).userId===bn.userId){Yt.isMuted=En;break}}catch(q){M0={error:q}}finally{try{Cn&&!Cn.done&&(kv=Ut.return)&&kv.call(Ut)}finally{if(M0)throw M0.error}}return this._dispatcher.dispatch(new Ve({channels:[dn],context:{source:En?G.EVENT_CHANNEL_MUTED:G.EVENT_CHANNEL_UNMUTED,user:bn}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){En?j.onUserMuted&&j.onUserMuted(dn,bn):j.onUserUnmuted&&j.onUserUnmuted(dn,bn)}),[2]})})}),[3,77];case 55:return(Hn=this._leftChannels.get(V.channelUrl))?(ar=Hn.channel,[3,58]):[3,56];case 56:return[4,this.getChannel(V.channelUrl,!0)];case 57:ar=Qe.sent(),Qe.label=58;case 58:return jn=ar,this._markAsLeave(jn),Le=t.as(WM).user,Le.userId===this._sdkState.userId&&this._dispatcher.dispatch(new bs({channelUrls:[jn.url],context:{source:G.EVENT_CHANNEL_BANNED,user:Le}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){j.onUserBanned&&j.onUserBanned(jn,Le)}),[2]})})}),[3,77];case 59:return[4,this.getChannel(V.channelUrl,!0)];case 60:return F=Qe.sent(),he=t.as(QM).user,he.userId===this._sdkState.userId&&this._dispatcher.dispatch(new bs({channelUrls:[F.url],context:{source:G.EVENT_CHANNEL_UNBANNED,user:he}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){j.onUserUnbanned&&j.onUserUnbanned(F,he)}),[2]})})}),[3,77];case 61:return[4,this.getChannel(V.channelUrl,!0)];case 62:return Me=Qe.sent(),Ge=t.as(YM).freeze,Me.isFrozen=Ge,this._dispatcher.dispatch(new Ve({channels:[Me],context:{source:Ge?G.EVENT_CHANNEL_FROZEN:G.EVENT_CHANNEL_UNFROZEN}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){Ge?j.onChannelFrozen&&j.onChannelFrozen(Me):j.onChannelUnfrozen&&j.onChannelUnfrozen(Me)}),[2]})})}),[3,77];case 63:return[4,this.getChannel(V.channelUrl,!0)];case 64:return vt=Qe.sent(),hn=t.as(fk),Qn=hn.allowAutoUnhide,Yn=hn.hidePreviousMessages,gs=hn.messageOffsetTimestamp,Qn!==null&&(vt.hiddenState=Qn?dr.HIDDEN_ALLOW_AUTO_UNHIDE:dr.HIDDEN_PREVENT_AUTO_UNHIDE),Yn!==null&&Yn&&vt._updateUnreadCount(0,0),gs!==null&&(vt.messageOffsetTimestamp=gs),this._dispatcher.dispatch(new Ve({channels:[vt],context:{source:G.EVENT_CHANNEL_HIDDEN}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){j.onChannelHidden&&j.onChannelHidden(vt)}),[2]})})}),[3,77];case 65:return[4,this.getChannel(V.channelUrl,!0)];case 66:return(Bn=Qe.sent()).hiddenState=dr.UNHIDDEN,this._dispatcher.dispatch(new Ve({channels:[Bn],context:{source:G.EVENT_CHANNEL_UNHIDDEN}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){j.onChannelChanged&&j.onChannelChanged(Bn)}),[2]})})}),[3,77];case 67:return[4,this.getChannel(V.channelUrl,!0)];case 68:return ja=Qe.sent(),this._dispatcher.dispatch(new bs({channelUrls:[V.channelUrl],context:{source:G.EVENT_CHANNEL_DELETED}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){j.onChannelDeleted&&j.onChannelDeleted(ja.url,ja.channelType)}),[2]})})}),[3,77];case 69:return[4,this.getChannelWithoutCache(V.channelUrl,!0)];case 70:return Ba=Qe.sent(),this._dispatcher.dispatch(new Ve({channels:[Ba],context:{source:G.EVENT_CHANNEL_UPDATED}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){j.onChannelChanged&&j.onChannelChanged(Ba)}),[2]})})}),[3,77];case 71:return[4,this.getChannel(V.channelUrl,!0)];case 72:return Yi=Qe.sent(),ed=t.as(kM),$a=ed.created,Ga=ed.updated,za=ed.deleted,$a&&(Yi._upsertCachedMetaData($a,V.ts),this._dispatcher.dispatch(new Ve({channels:[Yi],context:{source:G.EVENT_CHANNEL_METADATA_CREATED,metaData:$a}}))),Ga&&(Yi._upsertCachedMetaData(Ga,V.ts),this._dispatcher.dispatch(new Ve({channels:[Yi],context:{source:G.EVENT_CHANNEL_METADATA_UPDATED,metaData:Ga}}))),za&&(Yi._removeFromCachedMetaData(za,V.ts),this._dispatcher.dispatch(new Ve({channels:[Yi],context:{source:G.EVENT_CHANNEL_METADATA_DELETED,metaDataKeys:za}}))),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){$a&&j.onMetaDataCreated&&j.onMetaDataCreated(Yi,$a),Ga&&j.onMetaDataUpdated&&j.onMetaDataUpdated(Yi,Ga),za&&j.onMetaDataDeleted&&j.onMetaDataDeleted(Yi,za)}),[2]})})}),[3,77];case 73:return[4,this.getChannel(V.channelUrl,!0)];case 74:return Fo=Qe.sent(),td=t.as(HM),Yl=td.created,Zl=td.updated,Xl=td.deleted,Yl&&this._dispatcher.dispatch(new Ve({channels:[Fo],context:{source:G.EVENT_CHANNEL_METACOUNTER_CREATED,metaCounters:Yl}})),Zl&&this._dispatcher.dispatch(new Ve({channels:[Fo],context:{source:G.EVENT_CHANNEL_METACOUNTER_UPDATED,metaCounters:Zl}})),Xl&&this._dispatcher.dispatch(new Ve({channels:[Fo],context:{source:G.EVENT_CHANNEL_METACOUNTER_DELETED,metaCounterKeys:Xl}})),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){Yl&&j.onMetaCounterCreated&&j.onMetaCounterCreated(Fo,Yl),Zl&&j.onMetaCounterUpdated&&j.onMetaCounterUpdated(Fo,Zl),Xl&&j.onMetaCounterDeleted&&j.onMetaCounterDeleted(Fo,Xl)}),[2]})})}),[3,77];case 75:return[4,this.getChannel(V.channelUrl,!0)];case 76:return Vs=Qe.sent(),nd=t.as(yk),wv=nd.pinnedMessageIds,Nv=nd.latestPinnedMessage,(Iv=nd.ts)>Vs._pinnedMessagesUpdatedAt&&(Vs.pinnedMessageIds=wv,Vs.lastPinnedMessage=Nv,Vs._pinnedMessagesUpdatedAt=Iv,this._dispatcher.dispatch(new Ve({channels:[Vs],context:{source:G.EVENT_PINNED_MESSAGE_UPDATED}})),Re(function(){return y(lt,void 0,void 0,function(){var q,j,He,ke,je;return v(this,function(Pt){try{for(q=pe(this._groupChannelHandlers.values()),j=q.next();!j.done;j=q.next())(He=j.value).onChannelChanged&&He.onChannelChanged(Vs)}catch(ct){ke={error:ct}}finally{try{j&&!j.done&&(je=q.return)&&je.call(q)}finally{if(ke)throw ke.error}}return[2]})})}),Re(function(){return y(lt,void 0,void 0,function(){return v(this,function(q){return this._groupChannelHandlers.forEach(function(j){j.onPinnedMessageUpdated&&j.onPinnedMessageUpdated(Vs)}),[2]})})})),[3,77];case 77:return[3,79];case 78:switch((b0=t.as(MS).event).category){case Uc.USER_BLOCK:C0=ff.getDataAsUserBlockEvent(this._iid,b0),rd=C0.blocker,id=C0.blockee,this._groupChannelCache.block(rd.userId,id.userId);break;case Uc.USER_UNBLOCK:S0=ff.getDataAsUserBlockEvent(this._iid,b0),rd=S0.blocker,id=S0.blockee,this._groupChannelCache.unblock(rd.userId,id.userId)}return[3,79];case 79:return[3,81];case 80:if(T0=Qe.sent(),Lr(T0))throw T0;return[3,81];case 81:return[2]}})})},n.prototype._markAsLeave=function(t){var r,i=this,s=(r=this._leftChannels.get(t.url))!==null&&r!==void 0?r:{channel:t,ref:0};s.ref++,this._leftChannels.set(t.url,s),setTimeout(function(){s.ref--,s.ref===0&&i._leftChannels.delete(t.url)},1e4)},n.prototype.addHandler=function(t,r){this._groupChannelHandlers.set(t,r)},n.prototype.removeHandler=function(t){this._groupChannelHandlers.delete(t)},n.prototype.clearHandler=function(){this._groupChannelHandlers.clear()},n.prototype.subscribeChannelEvent=function(t,r){this._groupChannelBroadcast.subscribe(t,r)},n.prototype.unsubscribeChannelEvent=function(t){this._groupChannelBroadcast.unsubscribe(t)},n.prototype._updateJoinedMemberCount=function(t){t.joinedMemberCount=t.members.filter(function(r){return r.state===Gt.JOINED}).length},n.prototype.getChannel=function(t,r){return r===void 0&&(r=!1),y(this,void 0,void 0,function(){var i;return v(this,function(s){switch(s.label){case 0:Y(R("string",t)).throw(L.invalidParameters),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.getChannelFromCache(t)];case 2:return(i=s.sent())?[2,i]:[3,4];case 3:return s.sent(),[3,4];case 4:return[4,this.getChannelWithoutCache(t,r)];case 5:return[2,s.sent()]}})})},n.prototype.getChannelWithoutCache=function(t,r){return r===void 0&&(r=!1),y(this,void 0,void 0,function(){var i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:return Y(R("string",t)).throw(L.invalidParameters),i=new Em({channelUrl:t,isInternalCall:r}),[4,this._requestQueue.send(i)];case 1:switch(s=u.sent(),o=s.as(bm).channel,a=o.unreadMessageCount,l=o.unreadMentionCount,o.myCountPreference){case ni.UNREAD_MESSAGE_COUNT_ONLY:l=0;break;case ni.UNREAD_MENTION_COUNT_ONLY:a=0;break;case ni.OFF:a=0,l=0}return o._updateUnreadCount(a,l),[4,this.upsertChannelsToCache([o])];case 2:return[2,u.sent()[0]]}})})},n.prototype.refreshChannel=function(t,r,i){return r===void 0&&(r=!0),i===void 0&&(i=G.REFRESH_CHANNEL),y(this,void 0,void 0,function(){var s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return c.trys.push([0,5,,6]),s=new Em({channelUrl:t,isInternalCall:r}),[4,this._requestQueue.send(s)];case 1:return o=c.sent(),(a=o.as(bm).channel).myMemberState!==Gt.NONE?[3,2]:(this._dispatcher.dispatch(new bs({channelUrls:[a.url],context:{source:i}})),[3,4]);case 2:return[4,this.upsertChannelsToCache([a])];case 3:l=c.sent(),this._dispatcher.dispatch(new Ve({channels:l,context:{source:i}})),c.label=4;case 4:return[3,6];case 5:return(u=c.sent()).code!==Te.NON_AUTHORIZED&&u.code!==Te.NOT_FOUND_IN_DATABASE||this._dispatcher.dispatch(new bs({channelUrls:[t],context:{source:i}})),[3,6];case 6:return[2]}})})},n.prototype.getMyGroupChannels=function(t,r,i,s,o){return s===void 0&&(s=G.REQUEST_CHANNEL),o===void 0&&(o=!1),y(this,void 0,void 0,function(){var a,l,u,c,d,h,f,p,g;return v(this,function(b){switch(b.label){case 0:return r.createdAfter&&(r.createdAfter=Math.floor(r.createdAfter/1e3)),r.createdBefore&&(r.createdBefore=Math.floor(r.createdBefore/1e3)),a=!1,o&&(l=O.of(this._iid),u=l.appInfo,(c=l.cacheContext)&&!c.localCacheEnabled&&(u!=null&&u.enabledChannelMemberShipHistory)&&(u!=null&&u.applicationAttributes.includes("left_user_view_support"))&&(a=!0)),d=new jO(x(x({},r),{userId:this._sdkState.userId,token:t,limit:i,includeLeftChannel:o&&a})),[4,this._requestQueue.send(d)];case 1:return h=b.sent(),f=h.as(BO),p=f.channels,g=f.token,this._dispatcher.dispatch(new Ve({channels:p,context:{source:s}})),[2,{channels:p,token:g}]}})})},n.prototype.getMyGroupChannelChangeLogs=function(t,r,i){return i===void 0&&(i=G.REQUEST_CHANNEL_CHANGELOGS),y(this,void 0,void 0,function(){var s,o,a,l,u,c,d,h;return v(this,function(f){switch(f.label){case 0:return s=x(x({},_f),r),Y((R("string",t)||R("number",t))&&ym(s)).throw(L.invalidParameters),o=new FO(Ie({userId:this._sdkState.userId,ts:typeof t=="number"?t:null,token:typeof t=="string"?t:null,filter:s})),[4,this._requestQueue.send(o)];case 1:return a=f.sent(),l=a.as(HO),u=l.updatedChannels,c=l.deletedChannelUrls,d=l.hasMore,h=l.ts,u.length>0&&this._dispatcher.dispatch(new Ve({channels:u,context:{source:i},ts:h})),c.length>0&&this._dispatcher.dispatch(new bs({channelUrls:c,context:{source:i}})),[2,{updatedChannels:u,deletedChannelUrls:c,hasMore:d,token:l.token}]}})})},n.prototype.getGroupChannelCount=function(t){return y(this,void 0,void 0,function(){var r,i,s;return v(this,function(o){switch(o.label){case 0:return r=x(x({},OS),t),Y(kS(r)).throw(L.invalidParameters),i=new $O({userId:this._sdkState.userId,filter:r}),[4,this._requestQueue.send(i)];case 1:return s=o.sent(),[2,s.as(GO).groupChannelCount]}})})},n.prototype.getUnreadItemCount=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u,c,d,h,f,p,g,b,m,_;return v(this,function(E){switch(E.label){case 0:return r=x(x({},RO),t),Y(function(S){return We(Tn,S.keys)}(r)).throw(L.invalidParameters),i=O.of(this._iid),s=i.sdkState,o=i.requestQueue,a=new zO({userId:s.userId,filter:r}),[4,o.send(a)];case 1:return l=E.sent(),u=l.as(VO),c=u.groupChannelUnreadMentionCount,d=u.groupChannelUnreadMessageCount,h=u.groupChannelInvitationCount,f=u.superGroupChannelUnreadMentionCount,p=u.superGroupChannelUnreadMessageCount,g=u.superGroupChannelInvitationCount,b=u.nonSuperGroupChannelUnreadMentionCount,m=u.nonSuperGroupChannelUnreadMessageCount,_=u.nonSuperGroupChannelInvitationCount,[2,ye({groupChannelUnreadMentionCount:c,groupChannelUnreadMessageCount:d,groupChannelInvitationCount:h,superGroupChannelUnreadMentionCount:f,superGroupChannelUnreadMessageCount:p,superGroupChannelInvitationCount:g,nonSuperGroupChannelUnreadMentionCount:b,nonSuperGroupChannelUnreadMessageCount:m,nonSuperGroupChannelInvitationCount:_})]}})})},n.prototype.getTotalUnreadChannelCount=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o;return v(this,function(a){switch(a.label){case 0:return t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new qO({userId:r.userId}),[4,i.send(s)];case 1:return o=a.sent(),[2,o.as(WO).unreadCount]}})})},n.prototype.getTotalUnreadMessageCount=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:return r=x(x({},LO),t),Y(DO(r)).throw(L.invalidParameters),i=O.of(this._iid),s=i.sdkState,o=i.requestQueue,a=new KO({userId:s.userId,filter:r}),[4,o.send(a)];case 1:return l=u.sent(),[2,l.as(QO).unreadCount]}})})},n.prototype.getTotalScheduledMessageCount=function(t){return t===void 0&&(t={}),y(this,void 0,void 0,function(){var r,i,s,o;return v(this,function(a){switch(a.label){case 0:return r=x(x({},UO),t),Y(function(l){return R("string",l.channelUrl,!0)&&We(uo,l.scheduledStatus,!0)&&$e(tr,l.messageTypeFilter)}(r)).throw(L.invalidParameters),i=O.of(this._iid).requestQueue,s=new YO(r),[4,i.send(s)];case 1:return o=a.sent(),[2,o.as(ZO).count]}})})},n.prototype.getSubscribedTotalUnreadMessageCount=function(){var t=O.of(this._iid).subscribedUnreadMessageCount;return t.all>=0?t.all:0},n.prototype.getSubscribedCustomTypeTotalUnreadMessageCount=function(){var t=0,r=O.of(this._iid).subscribedUnreadMessageCount;return Object.keys(r.customTypes).forEach(function(i){t+=r.customTypes[i]}),t},n.prototype.getSubscribedCustomTypeUnreadMessageCount=function(t){var r;return(r=O.of(this._iid).subscribedUnreadMessageCount.customTypes[t])!==null&&r!==void 0?r:0},n.prototype.createChannel=function(t){return y(this,void 0,void 0,function(){var r,i,s,o;return v(this,function(a){switch(a.label){case 0:return r=x(x({},gh),t),Y(vm(r)).throw(L.invalidParameters),r.isPublic||(r.accessCode=void 0),i=new JO(x({userId:this._sdkState.userId},r)),[4,this._requestQueue.send(i)];case 1:return s=a.sent(),o=s.as(ek).channel,[4,this.upsertChannelsToCache([o])];case 2:return a.sent(),[2,o]}})})},n.prototype.markAsReadAll=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return t=Date.now(),Y(t-this._markAsReadAllLastSentAt>=1e3).throw(L.markAsReadAllRateLimitExceeded),this._markAsReadAllLastSentAt=t,r=new py({userId:this._sdkState.userId}),[4,this._requestQueue.send(r)];case 1:c.sent(),i=this._groupChannelCache.channels;try{for(s=pe(i),o=s.next();!o.done;o=s.next())(a=o.value)._updateUnreadMemberState(this._sdkState.userId,t),a._updateUnreadCount(0,0)}catch(d){l={error:d}}finally{try{o&&!o.done&&(u=s.return)&&u.call(s)}finally{if(l)throw l.error}}return i.length>0?[4,this.upsertChannelsToCache(i)]:[3,3];case 2:c.sent(),c.label=3;case 3:return[2]}})})},n.prototype.markAsReadWithChannelUrls=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u,c,d;return v(this,function(h){switch(h.label){case 0:return r=Date.now(),Y(We("string",t)&&r-this._markAsReadAllLastSentAt>=1e3).throw(L.markAsReadAllRateLimitExceeded),this._markAsReadAllLastSentAt=r,i=new py({userId:this._sdkState.userId,channelUrls:t}),[4,this._requestQueue.send(i)];case 1:h.sent(),s=this._groupChannelCache.channels,o=[];try{for(a=pe(s),l=a.next();!l.done;l=a.next())u=l.value,t.includes(u.url)&&(u._updateUnreadMemberState(this._sdkState.userId,r),u._updateUnreadCount(0,0),o.push(u))}catch(f){c={error:f}}finally{try{l&&!l.done&&(d=a.return)&&d.call(a)}finally{if(c)throw c.error}}return o.length>0?[4,this.upsertChannelsToCache(o)]:[3,3];case 2:h.sent(),h.label=3;case 3:return[2]}})})},n.prototype.markAsDelivered=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return[4,this.getChannel(t)];case 1:return[4,r.sent().markAsDelivered()];case 2:return r.sent(),[2]}})})},n.prototype.getMessageFromCache=function(t){var r;return y(this,void 0,void 0,function(){return v(this,function(i){switch(i.label){case 0:return[4,this._messageCache.get(t)];case 1:return[2,(r=i.sent())!==null&&r!==void 0?r:null]}})})},n.prototype.getExactlyMatchingMessagesForTokenFromCache=function(t,r,i){return y(this,void 0,void 0,function(){return v(this,function(s){switch(s.label){case 0:return[4,this._messageCache.fetch({channelUrl:t,token:r,filter:i,exactMatch:!0})];case 1:return[2,s.sent()]}})})},n.prototype.getMessagesFromCache=function(t,r,i,s,o,a){return o===void 0&&(o=ES),a===void 0&&(a=!0),y(this,void 0,void 0,function(){return v(this,function(l){switch(l.label){case 0:return[4,this._messageCache.fetch({channelUrl:t,token:r,limit:o,filter:s,backward:i==="next",inclusive:a})];case 1:return[2,l.sent()]}})})},n.prototype.getPollMessagesFromCache=function(t,r,i,s){return y(this,void 0,void 0,function(){return v(this,function(o){switch(o.label){case 0:return[4,this._messageCache.fetch({channelUrl:t,token:r,limit:s,filter:i,backward:!1,isPollOnly:!0})];case 1:return[2,o.sent()]}})})},n.prototype.getCachedMessageCountBetween=function(t,r,i,s){return y(this,void 0,void 0,function(){return v(this,function(o){switch(o.label){case 0:return[4,this._messageCache.countBetween(t,r,new ls({top:i,bottom:s}))];case 1:return[2,o.sent()]}})})},n.prototype.getUnsentMessagesFromCache=function(t,r){return y(this,void 0,void 0,function(){return v(this,function(i){switch(i.label){case 0:return[4,this._unsentMessageCache.fetch({channelUrl:t,filter:r})];case 1:return[2,i.sent()]}})})},n.prototype.removeFailedMessageFromCache=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return[4,this._unsentMessageCache.remove([t])];case 1:return r.sent(),[2]}})})},n}(TO),Xr=function(e,n){return n instanceof Ft?e.findIndex(function(t){return t instanceof Ft&&n.isIdentical(t)}):e.findIndex(function(t){return t.isIdentical(n)})},cu=function(e,n){return e.findIndex(function(t){return t instanceof hr?t.messageId===n:t instanceof Na?t.notificationId===n:void 0})},Op=function(e,n){if(e.length>0){for(var t=0,r=e.length-1,i=Math.floor((t+r)/2);t0)r=i,i=Math.floor((t+r)/2);else{if(!(s<0))return i;t=i+1,i=Math.floor((t+r)/2)}}return e[i].createdAt>n.createdAt?i:i+1}return e.length};(function(e){e[e.IDLE=0]="IDLE",e[e.RUNNING=1]="RUNNING",e[e.END=2]="END"})(ws||(ws={}));var mf,ko=function(e){function n(t,r,i,s){var o=e.call(this)||this;return o._state=ws.IDLE,o._retryCount=0,o._retryLimit=3,o.priority=0,o._worker=r,o}return T(n,e),Object.defineProperty(n.prototype,"isIdle",{get:function(){return this._state===ws.IDLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRunning",{get:function(){return this._state===ws.RUNNING},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDone",{get:function(){return this._state===ws.END},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"retryCount",{get:function(){return this._retryCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"retryLimit",{get:function(){return this._retryLimit},enumerable:!1,configurable:!0}),n.prototype._run=function(t){return y(this,void 0,void 0,function(){var r,i;return v(this,function(s){switch(s.label){case 0:if(!this.isRunning)return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this._worker(t)];case 2:return r=s.sent(),this._retryCount=0,this.dispatch("progress",r),r.hasNext?this._run(r.nextToken):this.end(),[3,4];case 3:return i=s.sent(),this.dispatch("error",i),this._retryCount0&&(E=_.map(function(W){return W.createdAt}),!((M=this._metadata)===null||M===void 0)&&(w=M.range).intersect.apply(w,De([],Ae(E),!1))?this.extendRange(_):this._metadata={range:new ls({top:Math.min.apply(Math,De([],Ae(E),!1)),bottom:Math.max.apply(Math,De([],Ae(E),!1))}),previousComplete:!1}),m.hasNext=_.length>=this._limit&&this._prevSyncLoopCount<1,this._metadata&&(m.nextToken=this._metadata.range.top,this._metadata.previousComplete=_.length0&&(E=_.map(function(H){return H.createdAt}),!((I=this._metadata)===null||I===void 0)&&(w=I.range).intersect.apply(w,De([],Ae(E),!1))?this.extendRange(_):this._metadata={range:new ls({top:Math.min.apply(Math,De([],Ae(E),!1)),bottom:Math.max.apply(Math,De([],Ae(E),!1))}),previousComplete:!1}),m.hasNext=_.length>=this._limit,this._metadata&&(m.nextToken=this._metadata.range.bottom),f.debug("message background next sync progress",m),[4,this.saveMetadata()];case 4:return z.sent(),[3,7];case 5:throw S=z.sent(),f.debug("message background next sync error",S),S;case 6:return p.put(new $t({type:Et.FEATURE_LOCALCACHE_EVENT,ts:Date.now(),data:{channel_url:r.url,measured_on:"back_sync",event:"cache_fetch",max_db_size:(U=(M=d.localCacheConfig)===null||M===void 0?void 0:M.maxSize)!==null&&U!==void 0?U:0,use_local_cache:d.localCacheEnabled,starting_point:0,message_init_policy:""}})),[7];case 7:return[2,m]}})})}),this._connectionEventContext=h.on(function(b){b instanceof _i&&(b.stateType===rt.CONNECTED?o.resume():o.pause())})}return e.of=function(n,t){return Di[n]||(Di[n]={}),Di[n][t.url]||(Di[n][t.url]=new e({_iid:n,channel:t})),Di[n][t.url].ref++,Di[n][t.url]},e.clear=function(n,t){Di[n]&&Di[n][t]&&(Di[n][t].close(),delete Di[n])},Object.defineProperty(e.prototype,"range",{get:function(){var n,t;return(t=(n=this._metadata)===null||n===void 0?void 0:n.range)!==null&&t!==void 0?t:new ls({})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousComplete",{get:function(){var n;return!!(!((n=this._metadata)===null||n===void 0)&&n.previousComplete)},enumerable:!1,configurable:!0}),e.prototype.isWrappingMessages=function(n){var t;return(t=this.range)===null||t===void 0?void 0:t.includes.apply(t,De([],Ae(n.map(function(r){return r.createdAt})),!1))},e.prototype.extendRange=function(n){var t;this._metadata&&(t=this._metadata.range).extends.apply(t,De([],Ae(n.map(function(r){return r.createdAt})),!1))},e.prototype.loadMetadata=function(n){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:return this._metadata?[3,2]:[4,O.of(this._iid).cacheContext.preference.get(this._metadataKey)];case 1:t=r.sent(),this._metadata=t?{range:new ls(t.range),previousComplete:t.previousComplete}:{range:new ls({}),previousComplete:!1},r.label=2;case 2:return[2,this._metadata]}})})},e.prototype.saveMetadata=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return this._metadata?[4,O.of(this._iid).cacheContext.preference.set(this._metadataKey,this._metadata)]:[3,2];case 1:return n.sent(),[2,!0];case 2:return[2,!1]}})})},e.prototype.clearMetadata=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return[4,O.of(this._iid).cacheContext.preference.remove(this._metadataKey)];case 1:return n.sent(),this._metadata=void 0,[2]}})})},e.prototype.resume=function(n){var t,r,i,s;n===void 0&&(n=Date.now());var o=O.of(this._iid),a=o.logger;o.sessionManager.session.hasSession&&(a.debug("message background sync resume()"),this._prevSyncLoopCount=0,this._metadata&&this._metadata.previousComplete||this._prevSync.start((r=(t=this._metadata)===null||t===void 0?void 0:t.range.top)!==null&&r!==void 0?r:n),this._nextSync.start((s=(i=this._metadata)===null||i===void 0?void 0:i.range.bottom)!==null&&s!==void 0?s:n))},e.prototype.pause=function(){O.of(this._iid).logger.debug("message background sync stop()"),this._prevSync.stop(),this._nextSync.stop()},e.prototype.close=function(){this.ref--,this.ref<=0&&(this.ref=0,this.pause(),this._connectionEventContext.close(),delete Di[this._iid][this._channel.url])},e}(),Ui={},Sk=function(){function e(n){var t=n._iid,r=n.channel,i=n.includeParams,s=this;this.ref=0,this._iid=t,this._channel=r,this._includeParams=i;var o,a,l=O.of(this._iid),u=l.logger,c=l.sdkState,d=l.dispatcher;this._metadataKey=(o=c.userId,a=r.url,"sendbird:".concat(o,"@groupchannel/").concat(a,"/message/changelogs.meta"));var h=function(f,p){return"sendbird:".concat(f,"@groupchannel/").concat(p,"/message/changelogs")}(c.userId,this._channel.url);this._sync=new ko(h,function(){return y(s,void 0,void 0,function(){var f,p,g,b,m,_,E,S;return v(this,function(w){switch(w.label){case 0:return f={hasNext:!0,nextToken:0},[4,this.loadMetadata()];case 1:w.sent(),u.debug("message changelog sync from",(S=this._metadata)===null||S===void 0?void 0:S.token),w.label=2;case 2:return w.trys.push([2,5,,8]),[4,An.of(this._iid).getMessageChangelogs(this._channel.url,this._channel.channelType,this._metadata.token,x({replyType:Dn.ALL},this._includeParams),G.SYNC_MESSAGE_CHANGELOGS)];case 3:return p=w.sent(),g=p.updatedMessages,b=p.deletedMessageIds,m=p.hasMore,_=p.token,f.hasNext=m,f.nextToken=_,(g.length>0||b.length>0)&&this._metadata&&(this._metadata.token=_),u.debug("message changelog sync progress",f),[4,this.saveMetadata()];case 4:return w.sent(),[3,8];case 5:return E=w.sent(),u.debug("message changelog sync error",E),E instanceof L&&E.isInvalidTokenError?[4,this.clearMetadata()]:[3,7];case 6:w.sent(),w.label=7;case 7:throw E;case 8:return[2,f]}})})}),this._connectionEventContext=d.on(function(f){f instanceof _i&&(f.stateType===rt.CONNECTED?s.resume():s.pause())})}return e.of=function(n,t,r){return Ui[n]||(Ui[n]={}),Ui[n][t.url]||(Ui[n][t.url]=new e({_iid:n,channel:t,includeParams:r})),Ui[n][t.url].ref++,Ui[n][t.url]},e.clear=function(n,t){Ui[n]&&Ui[n][t]&&(Ui[n][t].close(),delete Ui[n])},e.prototype.loadMetadata=function(){return y(this,void 0,void 0,function(){var n,t,r,i;return v(this,function(s){switch(s.label){case 0:return this._metadata?[3,2]:(n=O.of(this._iid),t=n.cacheContext,r=n.firstConnectedAt,[4,t.preference.get(this._metadataKey)]);case 1:i=s.sent(),this._metadata={token:i?i.token:r},s.label=2;case 2:return[2,this._metadata]}})})},e.prototype.saveMetadata=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return this._metadata?[4,O.of(this._iid).cacheContext.preference.set(this._metadataKey,this._metadata)]:[3,2];case 1:return n.sent(),[2,!0];case 2:return[2,!1]}})})},e.prototype.clearMetadata=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return[4,O.of(this._iid).cacheContext.preference.remove(this._metadataKey)];case 1:return n.sent(),this._metadata=void 0,[2]}})})},e.prototype.resume=function(){var n=O.of(this._iid),t=n.logger;n.sessionManager.session.hasSession&&(t.debug("message changelog sync resume()"),this._sync.start(0))},e.prototype.pause=function(){O.of(this._iid).logger.debug("message changelog sync pause()"),this._sync.stop()},e.prototype.close=function(){this.ref--,this.ref<=0&&(this.ref=0,this.pause(),this._connectionEventContext.close(),delete Ui[this._iid][this._channel.url])},e}(),Bo={},Tk=function(){function e(n){var t=n._iid,r=n.channel,i=n.hasPollMessage,s=this;this.ref=0,this._iid=t,this._channel=r;var o,a,l=O.of(this._iid),u=l.logger,c=l.sdkState,d=l.dispatcher;this._metadataKey=(o=c.userId,a=r.url,"sendbird:".concat(o,"@groupchannel/").concat(a,"/poll/changelogs.meta"));var h=function(f,p){return"sendbird:".concat(f,"@groupchannel/").concat(p,"/poll/changelogs")}(c.userId,this._channel.url);this._sync=new ko(h,function(){return y(s,void 0,void 0,function(){var f,p,g,b,m,_,E,S;return v(this,function(w){switch(w.label){case 0:return f={hasNext:!0,nextToken:0},[4,this.loadMetadata()];case 1:return w.sent(),u.debug("poll changelog sync from",(S=this._metadata)===null||S===void 0?void 0:S.token),(p=!this._metadata||!this._metadata.token)?[4,i()]:[3,3];case 2:p=!w.sent(),w.label=3;case 3:if(p)return[2,{hasNext:!1,nextToken:0}];this._metadata||(g=O.of(this._iid).firstConnectedAt,this._metadata={token:g}),w.label=4;case 4:return w.trys.push([4,7,,10]),[4,of.of(this._iid).getPollChangeLogs(this._channel.url,this._channel.channelType,this._metadata.token)];case 5:return b=w.sent(),m=b.hasMore,_=b.token,f.hasNext=m,f.nextToken=_,this._metadata.token=_,u.debug("poll changelog sync progress",f),[4,this.saveMetadata()];case 6:return w.sent(),[3,10];case 7:return E=w.sent(),u.debug("poll changelog sync error",E),E instanceof L&&E.isInvalidTokenError?[4,this.clearMetadata()]:[3,9];case 8:w.sent(),w.label=9;case 9:throw E;case 10:return[2,f]}})})}),this._connectionEventContext=d.on(function(f){f instanceof _i&&(f.stateType===rt.CONNECTED?s.resume():s.pause())})}return e.of=function(n,t,r){return Bo[n]||(Bo[n]={}),Bo[n][t.url]||(Bo[n][t.url]=new e({_iid:n,channel:t,hasPollMessage:r})),Bo[n][t.url].ref++,Bo[n][t.url]},e.prototype.loadMetadata=function(){return y(this,void 0,void 0,function(){var n;return v(this,function(t){switch(t.label){case 0:return this._metadata?[3,2]:[4,O.of(this._iid).cacheContext.preference.get(this._metadataKey)];case 1:n=t.sent(),this._metadata=n?{token:n.token}:void 0,t.label=2;case 2:return[2]}})})},e.prototype.saveMetadata=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return this._metadata?[4,O.of(this._iid).cacheContext.preference.set(this._metadataKey,this._metadata)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},e.prototype.clearMetadata=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return[4,O.of(this._iid).cacheContext.preference.remove(this._metadataKey)];case 1:return n.sent(),this._metadata=void 0,[2]}})})},e.prototype.resume=function(){O.of(this._iid).logger.debug("poll changelog sync resume()"),this._sync.start(0)},e.prototype.pause=function(){O.of(this._iid).logger.debug("poll changelog sync pause()"),this._sync.stop()},e.prototype.close=function(){this.ref--,this.ref<=0&&(this.ref=0,this.pause(),this._connectionEventContext.close(),delete Bo[this._iid][this._channel.url])},e}(),wk=function(e){function n(t){var r,i,s,o,a,l,u,c,d,h,f=this;return(f=e.call(this)||this).method=Z.GET,f.path="".concat(Je(t.channelType),"/").concat(t.channelUrl,"/messages_gap"),f.params=ye({prev_start_ts:t.prevStart,prev_end_ts:t.prevEnd,prev_cache_count:t.prevCount,next_start_ts:t.nextStart,next_end_ts:t.nextEnd,next_cache_count:t.nextCount,huge_gap_threshold:(r=t.threshold)!==null&&r!==void 0?r:null,reverse:!0,custom_types:(i=t.customTypes)!==null&&i!==void 0?i:["*"],message_type:(s=t.messageType)!==null&&s!==void 0?s:null,include_reply_type:(o=t.replyType)!==null&&o!==void 0?o:Dn.NONE,include_reactions:(a=t.includeReactions)===null||a===void 0||a,include_meta_array:(l=t.includeMetaArray)===null||l===void 0||l,include_thread_info:(u=t.includeThreadInfo)===null||u===void 0||u,include_parent_message_info:(c=t.includeParentMessageInfo)===null||c===void 0||c,with_sorted_meta_array:(d=t.includeMetaArray)===null||d===void 0||d,show_subchannel_messages_only:(h=t.showSubchannelMessagesOnly)!==null&&h!==void 0&&h,include_poll_details:!0,checking_continuous_messages:t.checkingContinuousMessages}),f}return T(n,e),n}(J),Nk=function(e){function n(t,r){var i,s,o,a,l,u,c=this;return(c=e.call(this,t,r)||this).isHugeGap=r.is_huge_gap,c.prevMessages=((i=r.prev_messages)!==null&&i!==void 0?i:[]).map(function(d){return yr(t,d)}),c.prevHasMore=(s=r.prev_hasmore)!==null&&s!==void 0&&s,c.isContinuousPrevMessages=(o=r.is_continuous_prev_messages)!==null&&o!==void 0&&o,c.nextMessages=((a=r.next_messages)!==null&&a!==void 0?a:[]).map(function(d){return yr(t,d)}),c.nextHasmore=(l=r.next_hasmore)!==null&&l!==void 0&&l,c.isContinuousNextMessages=(u=r.is_continuous_next_messages)!==null&&u!==void 0&&u,c}return T(n,e),n}(se),_y={includeMetaArray:!0,includeReactions:!0,includeThreadInfo:!0,includeParentMessageInfo:!0};(function(e){e.CACHE_AND_REPLACE_BY_API="cache_and_replace_by_api"})(mf||(mf={}));var oc,ac,lc,Ik=function(){function e(){this._onCacheResult=qe,this._onApiResult=qe}return e.prototype._invokeResponse=function(n,t,r){var i=this;Re(function(){return y(i,void 0,void 0,function(){return v(this,function(s){switch(n){case"local":this._onCacheResult(t,r);break;case"remote":this._onApiResult(t,r)}return[2]})})})},e.prototype.onCacheResult=function(n){return this._onCacheResult=n,this},e.prototype.onApiResult=function(n){return this._onApiResult=n,this},e}(),Ak=function(){function e(n,t){var r=t.filter,i=t.startingPoint,s=t.limit,o=t.prevResultLimit,a=t.nextResultLimit,l=t.channel,u=t.channelManager,c=t.disableBackgroundSync,d=c!==void 0&&c,h=this;this._messages=[],this._unsentMessages=[],this._isLoadingPrevious=!1,this._isLoadingNext=!1,this._iid=n,this._key="mc-".concat(Bs()),this._isDisposed=!1,this.filter=r??new _s,this._channel=l,this._syncRange=new ls({}),this._hasPrevious=!0,this._hasNext=!0,this._startingPoint=typeof i=="number"&&Number.isFinite(i)?i:Number.MAX_SAFE_INTEGER,this._limit=s||ES,this._prevResultLimit=o??Math.floor(this._limit/2),this._nextResultLimit=a??Math.floor(this._limit/2),this._channelManager=u,this._channelManager.subscribeChannelEvent(this._key,{onUpdate:function(m,_){var E=_.source,S=m.findIndex(function(w){return w.isIdentical(h.channel)});S>=0&&(h._replaceChannelOfCollection(m[S]),h.channel._runIfHandleableWithGroupChannel(function(w){switch(E){case G.EVENT_CHANNEL_UPDATED:for(var N=!1,A=0;A=w.messageOffsetTimestamp){N=!0;var k=A;if(k>0){var I=h._messages.splice(0,k);h._removeMessagesFromView(I.map(function(z){return h.keyOf(z)}),G.EVENT_MESSAGE_OFFSET_UPDATED)}break}!N&&h._messages.length>0&&h._removeMessagesFromView(h._messages.map(function(z){return h.keyOf(z)}),G.EVENT_MESSAGE_OFFSET_UPDATED);break;case G.EVENT_CHANNEL_UNMUTED:var M=O.of(h._iid).sdkState,U=_.user;M.userId===U.userId&&h._clearCheckMyMutedTimer();break;case G.EVENT_CHANNEL_MUTED:M=O.of(h._iid).sdkState,U=_.user,M.userId===U.userId&&w._myMutedRemainingTime!==-1&&h._startCheckMyMutedTimer(w._myMutedRemainingTime);break;case G.EVENT_CHANNEL_LEFT:w.isPublic&&h._clearCheckMyMutedTimer()}Re(function(){return y(h,void 0,void 0,function(){var z;return v(this,function(H){return vh(E)&&(!((z=this._handler)===null||z===void 0)&&z.onChannelUpdated)&&this._handler.onChannelUpdated(_,this.channel),[2]})})})}),h._postprocessChannelUpdateEvent(m[S],E))},onRemove:function(m,_){var E=m.indexOf(h.channel.url);E>=0&&(h._clearCheckMyMutedTimer(),Re(function(){return y(h,void 0,void 0,function(){var S;return v(this,function(w){return!((S=this._handler)===null||S===void 0)&&S.onChannelDeleted&&this._handler.onChannelDeleted(_,this.channel.url),[2]})})}),h._postprocessChannelRemoveEvent(m[E]))}}),this._channelManager.subscribeMessageEvent(this._key,{onUpdate:function(m,_){var E,S,w=[],N=[];try{for(var A=pe(m),k=A.next();!k.done;k=A.next()){var I=k.value;I.channelUrl===h._channel.url&&(h.filter.match(I)?w.push(I):N.push(h.keyOf(I)))}}catch(M){E={error:M}}finally{try{k&&!k.done&&(S=A.return)&&S.call(A)}finally{if(E)throw E.error}}if(Ts(_)){if(w.length>0)switch(_){case G.LOCAL_MESSAGE_CANCELED:case G.LOCAL_MESSAGE_RESEND_STARTED:case G.EVENT_MESSAGE_SENT_FAILED:case G.EVENT_MESSAGE_SENT_SUCCESS:case G.EVENT_MESSAGE_UPDATED:case G.EVENT_MESSAGE_THREADINFO_UPDATED:case G.EVENT_MESSAGE_REACTION_UPDATED:case G.EVENT_MESSAGE_FEEDBACK_ADDED:case G.EVENT_MESSAGE_FEEDBACK_UPDATED:case G.EVENT_MESSAGE_FEEDBACK_DELETED:case G.SYNC_MESSAGE_CHANGELOGS:h._updateMessagesToView(w,_);break;case G.EVENT_MESSAGE_SENT_PENDING:h._addMessagesToView(w,_);break;case G.EVENT_MESSAGE_RECEIVED:h.hasNext||h._addMessagesToView(w,_);break;case G.SYNC_MESSAGE_FILL:h._addMessagesToView(w,_)}N.length>0&&h._removeMessagesFromView(N,_)}h._postprocessMessageUpdateEvent(m,_)},onRemove:function(m,_){h._removeMessagesFromView(m,_),h._postprocessMessageRemoveEvent(m)},onRemoveUnsent:function(m,_){h._removeUnsentMessageFromView(m,_)},onPollChangeLogUpdate:function(m,_){h._updatePollsToView(m,_)},onPollUpdate:function(m,_){h._applyPollUpdateEventToView(m,_)},onPollVote:function(m,_){h._applyPollVoteEventToView(m,_)},onReactionUpdate:function(m,_){h._applyReactionEventToView(m,_)},onThreadInfoUpdate:function(m,_){h._applyThreadInfoEventToView(m,_)}});var f=O.of(this._iid),p=f.cacheContext,g=f.dispatcher;this._channel._updateMessageCollectionLastAccessedAt(),g.dispatch(new Ve({channels:[this._channel],context:{source:G.CHANNEL_LASTACCESSEDAT_UPDATED}})),!d&&this._shouldStartBackgroundSync()&&(this._backgroundSync=Ck.of(this._iid,this._channel),this._backgroundSync.resume(this._startingPoint)),this._changelogSync=Sk.of(this._iid,this._channel,this.changelogIncludeParams),this._changelogSync.resume(),this._pollChangelogSync=Tk.of(this._iid,this._channel,this._hasPollMessage.bind(this)),this._pollChangelogSync.resume(),this._prevFill=new ko(this._key,function(m){return y(h,void 0,void 0,function(){var _,E,S,w,N,A,k;return v(this,function(I){switch(I.label){case 0:return[4,this._getRemoteMessages(m,{prevLimit:this._prevResultLimit,source:G.SYNC_MESSAGE_FILL,checkingContinuousMessages:p.localCacheEnabled})];case 1:return _=I.sent(),E=_.messages,S=_.isContinuousMessages,E.length>0?(w=Math.min.apply(Math,De([],Ae(E.map(function(M){return M.createdAt})),!1)),this._syncRange.extends(w),S&&((N=this._backgroundSync)===null||N===void 0||N.range.extends(w)),[2,{hasNext:E.length>=this._prevResultLimit&&this.viewTop0?(w=Math.max.apply(Math,De([],Ae(E.map(function(M){return M.createdAt})),!1)),this._syncRange.extends(w),S&&((N=this._backgroundSync)===null||N===void 0||N.range.extends(w)),[2,{hasNext:!(E.length>=this._nextResultLimit&&this._hasNext)||this.viewBottom>w,nextToken:this._syncRange.bottom}]):(b.put(new $t({type:Et.FEATURE_LOCALCACHE_EVENT,ts:Date.now(),data:{channel_url:this.channel.url,measured_on:"gap_check",event:"cache_fetch",max_db_size:(k=(A=p.localCacheConfig)===null||A===void 0?void 0:A.maxSize)!==null&&k!==void 0?k:0,use_local_cache:p.localCacheEnabled,starting_point:0,message_init_policy:""}})),[2,{hasNext:!1,nextToken:0}])}})})}),this._connectionEventContext=g.on(function(m){if(m instanceof _i)switch(m.stateType){case rt.CONNECTED:kt(function(){return y(h,void 0,void 0,function(){return v(this,function(_){return this._activate(),[2]})})});break;case rt.LOGOUT:h.dispose();break;default:h._clearCheckMyMutedTimer(),h._prevFill.stop(),h._nextFill.stop()}});var b=O.of(this._iid).statManager;b.put(new Fl({type:Et.FEATURE_LOCALCACHE,data:{use_local_cache:p.localCacheEnabled,collection_interface:{message:!0}}}))}return e.prototype.keyOf=function(n){return 0},Object.defineProperty(e.prototype,"changelogIncludeParams",{get:function(){return{includeReactions:!0,includeThreadInfo:!0,includeMetaArray:!0,includeParentMessageInfo:!0}},enumerable:!1,configurable:!0}),e.prototype._postprocessChannelUpdateEvent=function(n,t){},e.prototype._postprocessChannelRemoveEvent=function(n){},e.prototype._postprocessMessageUpdateEvent=function(n,t){},e.prototype._postprocessMessageRemoveEvent=function(n){},Object.defineProperty(e.prototype,"channel",{get:function(){return this._channel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"succeededMessages",{get:function(){return De([],Ae(this._messages),!1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"failedMessages",{get:function(){return this._unsentMessages.filter(function(n){return n.sendingStatus===ut.FAILED})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pendingMessages",{get:function(){return this._unsentMessages.filter(function(n){return n.sendingStatus===ut.PENDING})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasPrevious",{get:function(){return this._hasPrevious},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasNext",{get:function(){return this._hasNext},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewTop",{get:function(){return Math.min.apply(Math,De(De([],Ae(this._messages.map(function(n){return n.createdAt})),!1),[Number.MAX_SAFE_INTEGER],!1))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewBottom",{get:function(){return Math.max.apply(Math,De(De([],Ae(this._messages.map(function(n){return n.createdAt})),!1),[0],!1))},enumerable:!1,configurable:!0}),e.prototype._activate=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return O.of(this._iid).logger.debug("check huge gap"),this._checkHugeGap(),[4,this._refreshChannel(G.SYNC_CHANNEL_CHANGELOGS)];case 1:return n.sent(),[2]}})})},e.prototype._replaceChannelOfCollection=function(n){this._channel.isGroupChannel()?this._channel=n:this._channel.isFeedChannel()&&(this._channel._groupChannel=n._groupChannel)},e.prototype._shouldStartBackgroundSync=function(){var n=O.of(this._iid).cacheContext;return this.channel.isGroupChannel()?n.localCacheEnabled&&!this.channel.isSuper:n.localCacheEnabled},e.prototype._setBaseMessageCollectionHandler=function(n){this._handler=n},e.prototype._filterUnderOffsetMessage=function(n){return n},e.prototype._updateChildMessagesInView=function(n){var t=[];return this._messages.forEach(function(r){r instanceof hr&&r.parentMessageId===n.messageId&&r.applyParentMessage(n)&&t.push(r)}),t},e.prototype._updatePollsToView=function(n,t){var r,i,s=this,o=[];try{for(var a=pe(n),l=a.next();!l.done;l=a.next()){var u=l.value,c=cu(this._messages,u.messageId);if(c>=0){var d=this._messages[c];d.isUserMessage()&&d.applyPoll(u),o.push(d)}}}catch(h){r={error:h}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o.length>0&&Ts(t)&&Re(function(){return y(s,void 0,void 0,function(){var h,f,p;return v(this,function(g){return h={source:t},o.length>0&&((p=(f=this._handler).onMessagesUpdated)===null||p===void 0||p.call(f,h,this.channel,o)),[2]})})}),o},e.prototype._applyPollUpdateEventToView=function(n,t){var r=this,i=cu(this._messages,n.messageId);if(i>=0){var s=this._messages[i];s&&s.isUserMessage()&&s.poll&&s.poll.applyPollUpdateEvent(n)&&Ts(t)&&Re(function(){return y(r,void 0,void 0,function(){var o,a,l;return v(this,function(u){return o={source:t},(l=(a=this._handler)===null||a===void 0?void 0:a.onMessagesUpdated)===null||l===void 0||l.call(a,o,this.channel,[s]),[2]})})})}},e.prototype._applyPollVoteEventToView=function(n,t){var r=this,i=cu(this._messages,n.messageId);if(i>=0){var s=this._messages[i];s&&s.isUserMessage()&&s.poll&&s.poll.applyPollVoteEvent(n)&&Ts(t)&&Re(function(){return y(r,void 0,void 0,function(){var o,a,l;return v(this,function(u){return o={source:t},(l=(a=this._handler)===null||a===void 0?void 0:a.onMessagesUpdated)===null||l===void 0||l.call(a,o,this.channel,[s]),[2]})})})}},e.prototype._applyReactionEventToView=function(n,t){var r=this,i=cu(this._messages,n.messageId);if(i>=0){var s=this._messages[i];s&&(s.isUserMessage()||s.isFileMessage()||s.isMultipleFilesMessage())&&Ts(t)&&(s.applyReactionEvent(n),Re(function(){return y(r,void 0,void 0,function(){var o,a,l;return v(this,function(u){return o={source:t},(l=(a=this._handler)===null||a===void 0?void 0:a.onMessagesUpdated)===null||l===void 0||l.call(a,o,this.channel,[s]),[2]})})}))}},e.prototype._applyThreadInfoEventToView=function(n,t){var r=this,i=cu(this._messages,n.targetMessageId);if(i>=0){var s=this._messages[i];s&&(s.isUserMessage()||s.isFileMessage()||s.isMultipleFilesMessage())&&Ts(t)&&(s.applyThreadInfoUpdateEvent(n),Re(function(){return y(r,void 0,void 0,function(){var o,a,l;return v(this,function(u){return o={source:t},(l=(a=this._handler)===null||a===void 0?void 0:a.onMessagesUpdated)===null||l===void 0||l.call(a,o,this.channel,[s]),[2]})})}))}},e.prototype._removeMessagesFromView=function(n,t){var r,i,s=this,o=[],a=[],l=function(h){var f=u._messages.findIndex(function(g){return s.keyOf(g)===h});if(f>=0){var p=u._messages[f];o.push(u.keyOf(p)),a.push(p),u._messages.splice(f,1)}},u=this;try{for(var c=pe(n),d=c.next();!d.done;d=c.next())l(d.value)}catch(h){r={error:h}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return Ts(t)&&a.length>0&&Re(function(){return y(s,void 0,void 0,function(){var h,f,p;return v(this,function(g){return h={source:t},(p=(f=this._handler)===null||f===void 0?void 0:f.onMessagesDeleted)===null||p===void 0||p.call(f,h,this.channel,o,a),[2]})})}),o},e.prototype._removeUnsentMessageFromView=function(n,t){var r=this._unsentMessages.findIndex(function(i){return i.reqId===n});r>=0&&this._unsentMessages.splice(r,1)},e.prototype._getLocalMessages=function(n,t){var r=t.prevLimit,i=r===void 0?0:r,s=t.nextLimit,o=s===void 0?0:s,a=t.inclusive,l=a===void 0||a;return y(this,void 0,void 0,function(){var u,c,d,h,f;return v(this,function(p){switch(p.label){case 0:return u=[],l?[4,this._channelManager.getExactlyMatchingMessagesForTokenFromCache(this._channel.url,n,this.filter)]:[3,2];case 1:u=p.sent(),p.label=2;case 2:return i>0?[4,this._channelManager.getMessagesFromCache(this._channel.url,n,"prev",this.filter,i,!1)]:[3,4];case 3:return d=p.sent(),[3,5];case 4:d=[],p.label=5;case 5:return c=d,o>0?[4,this._channelManager.getMessagesFromCache(this._channel.url,n,"next",this.filter,o,!1)]:[3,7];case 6:return f=p.sent(),[3,8];case 7:f=[],p.label=8;case 8:return h=f,[2,De(De(De([],Ae(u),!1),Ae(c),!1),Ae(h),!1).sort(function(g,b){return b.createdAt-g.createdAt})]}})})},e.prototype._getRemoteMessages=function(n,t){var r=t.prevLimit,i=r===void 0?0:r,s=t.nextLimit,o=s===void 0?0:s,a=t.source,l=a===void 0?G.REQUEST_MESSAGE:a,u=t.reverse,c=u!==void 0&&u,d=t.checkingHasNext,h=d!==void 0&&d,f=t.checkingContinuousMessages,p=f!==void 0&&f;return y(this,void 0,void 0,function(){var g,b;return v(this,function(m){switch(m.label){case 0:return g=An.of(this._iid),i>0||o>0?[4,g._getMessagesByTimestampForCollection(this._channel.url,this._channel.channelType,n,Ie(x(x(x({},this.filter),_y),{isInclusive:!0,reverse:c,prevResultSize:i,nextResultSize:o})),l,h,p)]:[3,2];case 1:return b=m.sent(),[3,3];case 2:b={messages:[],isContinuousMessages:!1},m.label=3;case 3:return[2,b]}})})},e.prototype._checkHugeGap=function(){var n,t,r,i,s;return y(this,void 0,void 0,function(){var o,a,l,u,c,d,h,f,p,g,b,m,_,E,S,w,N,A,k,I,M,U,z,H,W,Q=this;return v(this,function($){switch($.label){case 0:return o=O.of(this._iid),a=o.dispatcher,l=o.requestQueue,u=o.cacheContext,c=o.statManager,d=o.logger,this._messages.length>0?(h=this._syncRange.top,f=this.viewTop,p=this._syncRange.bottom,g=this.hasNext?this.viewBottom:Number.MAX_SAFE_INTEGER,[4,this._channelManager.getCachedMessageCountBetween(this._channel.url,this.filter,f,h)]):[3,8];case 1:return b=$.sent(),[4,this._channelManager.getCachedMessageCountBetween(this._channel.url,this.filter,p,g)];case 2:m=$.sent(),$.label=3;case 3:return $.trys.push([3,5,6,7]),[4,o0(function(){return y(Q,void 0,void 0,function(){var Ne,X,ae,ne,Ce,K,ie,ee,ue,P,xe,B,te,oe,me,re,ce,de=this;return v(this,function(fe){switch(fe.label){case 0:return Ne=new wk(x(x({channelUrl:this._channel.url,channelType:this._channel.channelType,prevStart:f,prevEnd:h,prevCount:b,nextStart:p,nextEnd:g,nextCount:m,checkingContinuousMessages:u.localCacheEnabled},this.filter),_y)),[4,l.send(Ne)];case 1:return X=fe.sent(),ae=X.as(Nk),ne=ae.isHugeGap,Ce=ae.prevMessages,K=Ce===void 0?[]:Ce,ie=ae.prevHasMore,ee=ae.isContinuousPrevMessages,ue=ae.nextMessages,P=ue===void 0?[]:ue,xe=ae.nextHasmore,B=ae.isContinuousNextMessages,ne?Re(function(){return y(de,void 0,void 0,function(){var ve;return v(this,function(_e){return!((ve=this._handler)===null||ve===void 0)&&ve.onHugeGapDetected&&this._handler.onHugeGapDetected(),[2]})})}):(te=this.viewTop,oe=this.viewBottom,me=Math.min.apply(Math,De([Number.MAX_SAFE_INTEGER,te],Ae(K.map(function(ve){return ve.createdAt})),!1)),re=Math.max.apply(Math,De([0,oe],Ae(P.map(function(ve){return ve.createdAt})),!1)),a.dispatch(new bt({messages:K,source:G.SYNC_MESSAGE_FILL})),a.dispatch(new bt({messages:P,source:G.SYNC_MESSAGE_FILL})),this._syncRange.extends(me,re),(ee||B)&&((ce=this._backgroundSync)===null||ce===void 0||ce.range.extends(me,re)),ie&&this._prevFill.start(me),xe&&this._nextFill.start(re)),[2]}})})},1)];case 4:return $.sent(),[3,7];case 5:return _=$.sent(),d.debug("Failed HugeGap Check ",_),[3,7];case 6:return c.put(new $t({type:Et.FEATURE_LOCALCACHE_EVENT,ts:Date.now(),data:{channel_url:this.channel.url,measured_on:"gap_check",event:"cache_fetch",max_db_size:(t=(n=u.localCacheConfig)===null||n===void 0?void 0:n.maxSize)!==null&&t!==void 0?t:0,use_local_cache:u.localCacheEnabled,starting_point:0,message_init_policy:""}})),[7];case 7:return[3,13];case 8:E=Date.now(),$.label=9;case 9:return $.trys.push([9,11,12,13]),[4,this._getRemoteMessages(E,{prevLimit:this._prevResultLimit,nextLimit:this._nextResultLimit,source:G.SYNC_MESSAGE_FILL,checkingHasNext:!0,checkingContinuousMessages:u.localCacheEnabled})];case 10:if(S=$.sent(),w=S.messages,N=S.isContinuousMessages,A=S.hasNext,w.length>0){for(k=w.map(function(Ne){return Ne.createdAt}),I=0,M=0,U=0;U=E&&M++;this._hasPrevious=I>=this._prevResultLimit,this._hasNext=A??M>=this._nextResultLimit,(W=this._syncRange).extends.apply(W,De([],Ae(k),!1)),N&&((r=this._backgroundSync)===null||r===void 0||r.range.extends(this._syncRange.top,this._syncRange.bottom)),this._addMessagesToView(w,G.SYNC_MESSAGE_FILL)}else this._hasPrevious=!1,this._hasNext=!1;return[3,13];case 11:return(H=$.sent())instanceof L&&H.code===Te.NOT_FOUND_IN_DATABASE&&(this._hasPrevious=!1,this._hasNext=!1),[3,13];case 12:return c.put(new $t({type:Et.FEATURE_LOCALCACHE_EVENT,ts:Date.now(),data:{channel_url:this.channel.url,measured_on:"gap_check",event:"cache_fetch",max_db_size:(s=(i=u.localCacheConfig)===null||i===void 0?void 0:i.maxSize)!==null&&s!==void 0?s:0,use_local_cache:u.localCacheEnabled,starting_point:0,message_init_policy:""}})),[7];case 13:return[2]}})})},e.prototype._loadUnsentMessages=function(){return y(this,void 0,void 0,function(){var n;return v(this,function(t){switch(t.label){case 0:return n=this,[4,this._channelManager.getUnsentMessagesFromCache(this._channel.url,this.filter)];case 1:return n._unsentMessages=t.sent(),[2]}})})},e.prototype._hasPollMessage=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return[4,this._channelManager.getPollMessagesFromCache(this._channel.url,Date.now()+6e5,this.filter,1)];case 1:return n.sent().length>0?[2,!0]:[2,!1]}})})},e.prototype._refreshChannel=function(n){var t=this;kt(function(){return y(t,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return[4,this._channelManager.refreshChannel(this.channel.url,!0,n)];case 1:return r.sent(),[2]}})})})},e.prototype._startCheckMyMutedTimer=function(n){var t=this;this._clearCheckMyMutedTimer(),this._checkMyMutedStateTimer=setTimeout(function(){return y(t,void 0,void 0,function(){var r,i,s,o=this;return v(this,function(a){switch(a.label){case 0:this._checkMyMutedStateTimer=void 0,r=!0,a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,this._channel.getMyMutedInfo()];case 2:return i=a.sent(),r=!i.isMuted,[3,5];case 3:return a.sent(),r=!0,[3,5];case 4:return r&&(s=O.of(this._iid).sessionManager,this.channel._runIfHandleableWithGroupChannel(function(l){var u,c;l.myMutedState=ss.UNMUTED;var d={source:G.EVENT_CHANNEL_UNMUTED,user:s.currentUser};(c=(u=o._handler)===null||u===void 0?void 0:u.onChannelUpdated)===null||c===void 0||c.call(u,d,o.channel)})),[7];case 5:return[2]}})})},n+1e3)},e.prototype._clearCheckMyMutedTimer=function(){this._checkMyMutedStateTimer&&(clearTimeout(this._checkMyMutedStateTimer),this._checkMyMutedStateTimer=void 0)},e.prototype.initialize=function(n){var t=this,r=new Ik;this._messages=[],this._unsentMessages=[],this._syncRange=new ls({}),this._hasNext=!0,this._hasPrevious=!0,this._refreshChannel(G.REFRESH_CHANNEL);var i=O.of(this._iid),s=i.cacheContext,o=i.statManager;return n===mf.CACHE_AND_REPLACE_BY_API&&this._getLocalMessages(this._startingPoint,{prevLimit:this._prevResultLimit,nextLimit:this._nextResultLimit}).then(function(a){return y(t,void 0,void 0,function(){var l;return v(this,function(u){switch(u.label){case 0:return l=this._filterUnderOffsetMessage(a),this._addMessagesToView(l,G.REQUEST_MESSAGE),[4,this._loadUnsentMessages()];case 1:return u.sent(),r._invokeResponse("local",null,l),[2]}})})}).catch(function(a){if(Lr(a))throw a;r._invokeResponse("local",a,null)}).finally(function(){var a=O.of(t._iid).cacheContext;t._getRemoteMessages(t._startingPoint,{prevLimit:t._prevResultLimit,nextLimit:t._nextResultLimit,reverse:!0,checkingHasNext:!0,checkingContinuousMessages:a.localCacheEnabled}).then(function(l){var u,c,d,h,f,p,g=l.messages,b=l.isContinuousMessages,m=l.hasNext,_=t._filterUnderOffsetMessage(g),E=!0;if(t._messages.length===_.length){for(var S=t._messages.map(function(M){return t.keyOf(M)}),w=0;w<_.length;w++)if(!S.includes(t.keyOf(_[w]))){E=!1;break}}else E=!1;if(t._messages=[],_.length>0){var N=_.map(function(M){return M.createdAt}),A=0,k=0;for(w=0;wt._startingPoint&&k++}t._hasPrevious=A>=t._prevResultLimit,t._hasNext=m??k>=t._nextResultLimit,(u=t._syncRange).extends.apply(u,De([],Ae(_.map(function(M){return M.createdAt})),!1)),b&&((c=t._backgroundSync)===null||c===void 0||c.range.extends(t._syncRange.top,t._syncRange.bottom)),t._addMessagesToView(_,G.REQUEST_MESSAGE)}else t._hasPrevious=!1,t._hasNext=!1;o.put(new $t({type:Et.FEATURE_LOCALCACHE_EVENT,ts:Date.now(),data:{channel_url:t.channel.url,starting_point:t._startingPoint,measured_on:"initial_load",event:E?"cache_hit":"cache_miss",max_db_size:(h=(d=a.localCacheConfig)===null||d===void 0?void 0:d.maxSize)!==null&&h!==void 0?h:0,message_init_policy:n,use_local_cache:a.localCacheEnabled,collection_id:t._key}})),o.put(new $t({type:Et.FEATURE_LOCALCACHE_EVENT,ts:Date.now(),data:{channel_url:t.channel.url,starting_point:t._startingPoint,measured_on:"initial_load",event:"cache_fetch",max_db_size:(p=(f=a.localCacheConfig)===null||f===void 0?void 0:f.maxSize)!==null&&p!==void 0?p:0,message_init_policy:n,use_local_cache:a.localCacheEnabled,collection_id:t._key}})),r._invokeResponse("remote",null,_)}).catch(function(l){if(Lr(l))throw l;r._invokeResponse("remote",l,null)})}),o.put(new Fl({type:Et.FEATURE_LOCALCACHE,data:{use_local_cache:s.localCacheEnabled,collection_interface:{message_init_policy:n}}})),r},e.prototype.loadPrevious=function(){var n,t,r;return y(this,void 0,void 0,function(){var i,s,o,a,l,u,c,d,h=this;return v(this,function(f){switch(f.label){case 0:if(this._isDisposed)throw new L({code:Te.COLLECTION_DISPOSED,message:"Collection has been disposed."});return i=O.of(this._iid),s=i.cacheContext,o=i.statManager,a=i.logger,this._hasPrevious?this._isLoadingPrevious?(a.warn("Messages are already fetching."),[2,[]]):(this._isLoadingPrevious=!0,l=this.viewTop,u=[],[4,kt(function(){return y(h,void 0,void 0,function(){var p;return v(this,function(g){switch(g.label){case 0:return p=this._filterUnderOffsetMessage,[4,this._getLocalMessages(l,{prevLimit:this._prevResultLimit,inclusive:!1})];case 1:return u=p.apply(this,[g.sent()]),[2]}})})})]):[2,[]];case 1:return f.sent(),c=u.length>=this._prevResultLimit,o.put(new $t({type:Et.FEATURE_LOCALCACHE_EVENT,ts:Date.now(),data:{channel_url:this.channel.url,starting_point:this._startingPoint,measured_on:"load_prev",event:s.localCacheEnabled&&c?"cache_hit":"cache_miss",max_db_size:(t=(n=s.localCacheConfig)===null||n===void 0?void 0:n.maxSize)!==null&&t!==void 0?t:0,use_local_cache:s.localCacheEnabled,collection_id:this._key,message_init_policy:""}})),c&&(!((r=this._backgroundSync)===null||r===void 0)&&r.isWrappingMessages(u))?[3,3]:(d=!1,[4,kt(function(){return y(h,void 0,void 0,function(){var p,g,b,m,_,E,S,w=this;return v(this,function(N){switch(N.label){case 0:return p=O.of(this._iid).cacheContext,[4,this._getRemoteMessages(l,{prevLimit:this._prevResultLimit,reverse:!0,checkingContinuousMessages:p.localCacheEnabled})];case 1:return g=N.sent(),(u=this._filterUnderOffsetMessage(g.messages)).length>0&&((b=this._syncRange).extends.apply(b,De([],Ae(u.map(function(A){return A.createdAt})),!1)),!((m=this._backgroundSync)===null||m===void 0)&&m.range.overlap(this._syncRange)&&g.isContinuousMessages&&(d=!0,(_=this._backgroundSync)===null||_===void 0||_.range.extends(this._syncRange.top))),u=u.filter(function(A){return Xr(w._messages,A)<0}),this._hasPrevious=u.length>=this._prevResultLimit,d&&o.put(new $t({type:Et.FEATURE_LOCALCACHE_EVENT,ts:Date.now(),data:{channel_url:this.channel.url,starting_point:this._startingPoint,measured_on:"load_prev",event:"cache_fetch",max_db_size:(S=(E=p.localCacheConfig)===null||E===void 0?void 0:E.maxSize)!==null&&S!==void 0?S:0,use_local_cache:p.localCacheEnabled,collection_id:this._key,message_init_policy:""}})),[2]}})})})]);case 2:return f.sent(),this._addMessagesToView(u,G.REQUEST_MESSAGE),[3,4];case 3:this._hasPrevious=u.length>=this._prevResultLimit,u.length>0&&this._addMessagesToView(u,G.REQUEST_MESSAGE),f.label=4;case 4:return this._isLoadingPrevious=!1,[2,u]}})})},e.prototype.loadNext=function(){var n,t,r;return y(this,void 0,void 0,function(){var i,s,o,a,l,u,c,d,h=this;return v(this,function(f){switch(f.label){case 0:if(this._isDisposed)throw new L({code:Te.COLLECTION_DISPOSED,message:"Collection has been disposed."});return i=O.of(this._iid),s=i.cacheContext,o=i.statManager,a=i.logger,this._hasNext?this._isLoadingNext?(a.warn("Messages are already fetching."),[2,[]]):(this._isLoadingNext=!0,l=this.viewBottom,u=[],[4,kt(function(){return y(h,void 0,void 0,function(){var p;return v(this,function(g){switch(g.label){case 0:return p=this._filterUnderOffsetMessage,[4,this._getLocalMessages(l,{nextLimit:this._nextResultLimit,inclusive:!1})];case 1:return u=p.apply(this,[g.sent()]),[2]}})})})]):[2,[]];case 1:return f.sent(),c=u.length>=this._nextResultLimit,o.put(new $t({type:Et.FEATURE_LOCALCACHE_EVENT,ts:Date.now(),data:{channel_url:this.channel.url,starting_point:this._startingPoint,measured_on:"load_next",event:s.localCacheEnabled&&c?"cache_hit":"cache_miss",max_db_size:(t=(n=s.localCacheConfig)===null||n===void 0?void 0:n.maxSize)!==null&&t!==void 0?t:0,use_local_cache:s.localCacheEnabled,collection_id:this._key,message_init_policy:""}})),c&&(!((r=this._backgroundSync)===null||r===void 0)&&r.isWrappingMessages(u))?[3,3]:(d=!1,[4,kt(function(){return y(h,void 0,void 0,function(){var p,g,b,m,_,E,S,w,N=this;return v(this,function(A){switch(A.label){case 0:return p=O.of(this._iid).cacheContext,[4,this._getRemoteMessages(l,{nextLimit:this._nextResultLimit,reverse:!0,checkingHasNext:!0,checkingContinuousMessages:p.localCacheEnabled})];case 1:return g=A.sent(),(u=this._filterUnderOffsetMessage(g.messages)).length>0&&((b=this._syncRange).extends.apply(b,De([],Ae(u.map(function(k){return k.createdAt})),!1)),!((m=this._backgroundSync)===null||m===void 0)&&m.range.overlap(this._syncRange)&&g.isContinuousMessages&&(d=!0,(_=this._backgroundSync)===null||_===void 0||_.range.extends(this._syncRange.bottom))),u=u.filter(function(k){return Xr(N._messages,k)<0}),this._hasNext=(E=g.hasNext)!==null&&E!==void 0?E:u.length>=this._nextResultLimit,d&&o.put(new $t({type:Et.FEATURE_LOCALCACHE_EVENT,ts:Date.now(),data:{channel_url:this.channel.url,starting_point:this._startingPoint,measured_on:"load_next",event:"cache_fetch",max_db_size:(w=(S=p.localCacheConfig)===null||S===void 0?void 0:S.maxSize)!==null&&w!==void 0?w:0,use_local_cache:p.localCacheEnabled,collection_id:this._key,message_init_policy:""}})),[2]}})})})]);case 2:return f.sent(),this._addMessagesToView(u,G.REQUEST_MESSAGE),[3,4];case 3:this._hasNext=u.length>=this._nextResultLimit,u.length>0&&this._addMessagesToView(u,G.REQUEST_MESSAGE),f.label=4;case 4:return this._isLoadingNext=!1,[2,u]}})})},e.prototype.removeFailedMessage=function(n){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:if(this._isDisposed)throw new L({code:Te.COLLECTION_DISPOSED,message:"Collection has been disposed."});return[4,this._channelManager.removeFailedMessageFromCache(n)];case 1:return r.sent(),(t=this._unsentMessages.findIndex(function(i){return i.reqId===n}))>-1&&this._unsentMessages.splice(t,1),[2]}})})},e.prototype.dispose=function(){var n,t,r,i=this;if(!this._isDisposed){this._isDisposed=!0;var s=O.of(this._iid),o=s.cacheContext,a=s.dispatcher;this._messages=[],this._clearCheckMyMutedTimer(),this._channel._runIfHandleableWithGroupChannel(function(l){l.myMemberState!==Gt.NONE&&(i._channel._updateMessageCollectionLastAccessedAt(),a.dispatch(new Ve({channels:[i._channel],context:{source:G.CHANNEL_LASTACCESSEDAT_UPDATED}})))}),o.localCacheEnabled&&(this._prevFill.stop(),this._nextFill.stop()),(n=this._backgroundSync)===null||n===void 0||n.close(),(t=this._changelogSync)===null||t===void 0||t.close(),(r=this._pollChangelogSync)===null||r===void 0||r.close(),this._channelManager.unsubscribeChannelEvent(this._key),this._channelManager.unsubscribeMessageEvent(this._key),this._connectionEventContext&&this._connectionEventContext.close()}},e}(),Mk=function(e){function n(t,r){return e.call(this,t,x(x({},r),{channelManager:Nn.of(t)}))||this}return T(n,e),n.prototype.keyOf=function(t){return t.messageId},n.prototype.initialize=function(t){var r=this;return kt(function(){return y(r,void 0,void 0,function(){var i;return v(this,function(s){switch(s.label){case 0:return[4,this.channel.getMyMutedInfo()];case 1:return(i=s.sent()).isMuted&&i.remainingDuration!==-1&&this._startCheckMyMutedTimer(i.remainingDuration),[2]}})})}),e.prototype.initialize.call(this,t)},n.prototype.setMessageCollectionHandler=function(t){this._setBaseMessageCollectionHandler(t)},n.prototype._activate=function(){return y(this,void 0,void 0,function(){var t=this;return v(this,function(r){switch(r.label){case 0:return[4,e.prototype._activate.call(this)];case 1:return r.sent(),[4,kt(function(){return y(t,void 0,void 0,function(){var i;return v(this,function(s){switch(s.label){case 0:return[4,this.channel.getMyMutedInfo()];case 1:return(i=s.sent()).isMuted&&i.remainingDuration!==-1&&this._startCheckMyMutedTimer(i.remainingDuration),[2]}})})})];case 2:return r.sent(),[2]}})})},n.prototype._addMessagesToView=function(t,r){var i,s,o=this,a=this._filterUnderOffsetMessage(t),l=[],u=[];try{for(var c=pe(a),d=c.next();!d.done;d=c.next()){var h=d.value;if(r===G.SYNC_MESSAGE_FILL)if(h.messageId>0){if((b=Xr(this._messages,h))<0){Xr(this._unsentMessages,h)<0&&l.push(h);var f=Op(this._messages,h);this._messages.splice(f,0,h)}}else h instanceof Ft&&(b=Xr(this._unsentMessages,h))<0&&Xr(this._messages,h)<0&&(this._unsentMessages.push(h),l.push(h));else if(h.messageId>0){if((b=Xr(this._messages,h))<0){var p=Xr(this._unsentMessages,h);p<0?l.push(h):(this._unsentMessages.splice(p,1),u.push(h)),f=Op(this._messages,h),this._messages.splice(f,0,h)}else u.push(h),this._messages[b]=h;if(h.updatedAt>0){var g=this._updateChildMessagesInView(h);u.push.apply(u,De([],Ae(g),!1))}}else if(h instanceof Ft){var b;(b=Xr(this._unsentMessages,h))<0?Xr(this._messages,h)<0&&(this._unsentMessages.push(h),l.push(h)):(u.push(h),this._unsentMessages[b]=h)}}}catch(m){i={error:m}}finally{try{d&&!d.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}Ts(r)&&Re(function(){return y(o,void 0,void 0,function(){var m,_,E,S,w;return v(this,function(N){return m={source:r},l.length>0&&((E=(_=this._handler)===null||_===void 0?void 0:_.onMessagesAdded)===null||E===void 0||E.call(_,m,this.channel,l)),u.length>0&&((w=(S=this._handler)===null||S===void 0?void 0:S.onMessagesUpdated)===null||w===void 0||w.call(S,m,this.channel,u)),[2]})})})},n.prototype._updateMessagesToView=function(t,r){var i,s,o=this,a=[],l=[],u=[];try{for(var c=pe(t),d=c.next();!d.done;d=c.next()){var h,f=d.value;if(f.messageId>0)if((h=Xr(this._messages,f))>=0)l.push(f),this._messages[h]=f;else{var p=Xr(this._unsentMessages,f);if(p>=0){var g=Ae(this._unsentMessages.splice(p,1),1)[0];if(this.hasNext&&g)u.push(g);else{l.push(f);var b=Op(this._messages,f);this._messages.splice(b,0,f)}}else{var m=this._messages.map(function(_){return _.createdAt});(f.createdAtMath.max.apply(Math,De([],Ae(m),!1))&&!this._hasNext)&&a.push(f)}}else f instanceof Ft&&(h=Xr(this._unsentMessages,f))>=0&&(l.push(f),this._unsentMessages[h]=f)}}catch(_){i={error:_}}finally{try{d&&!d.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}return Ts(r)&&Re(function(){return y(o,void 0,void 0,function(){var _,E,S,w,N;return v(this,function(A){return _={source:r},l.length>0?(S=(E=this._handler)===null||E===void 0?void 0:E.onMessagesUpdated)===null||S===void 0||S.call(E,_,this.channel,l):u.length>0?(N=(w=this._handler)===null||w===void 0?void 0:w.onMessagesDeleted)===null||N===void 0||N.call(w,_,this.channel,[],u):a.length>0&&this._addMessagesToView(a,r),[2]})})}),l},n}(Ak),xk={coverUrl:void 0,coverImage:void 0,isDistinct:void 0,isPublic:void 0,isDiscoverable:void 0,accessCode:void 0,name:void 0,data:void 0,customType:void 0,operatorUserIds:void 0,messageSurvivalSeconds:void 0},Ok=function(e){function n(t){var r=this,i=t.channelUrl,s=t.token,o=t.limit,a=t.order,l=t.mutedMemberFilter,u=t.memberStateFilter,c=t.nicknameStartsWithFilter,d=t.operatorFilter;return(r=e.call(this)||this).method=Z.GET,r.path="".concat(sr,"/").concat(encodeURIComponent(i),"/members"),r.params={token:s,limit:o,order:a,muted_member_filter:l,member_state_filter:u,nickname_startswith:c,operator_filter:d,show_member_is_muted:!0,show_read_receipt:!0,show_delivery_receipt:!0},r}return T(n,e),n}(J),kk=function(e){function n(t,r){var i=e.call(this,t,r)||this;i.members=[];var s=r.next,o=r.members;return i.token=s,o&&o.length>0&&(i.members=o.map(function(a){return new si(t,a)})),i}return T(n,e),n}(se);(function(e){e.ALL="all",e.MUTED="muted",e.UNMUTED="unmuted"})(oc||(oc={})),function(e){e.MEMBER_NICKNAME_ALPHABETICAL="member_nickname_alphabetical",e.OPERATOR_THEN_MEMBER_ALPHABETICAL="operator_then_member_alphabetical"}(ac||(ac={})),function(e){e.ALL="all",e.JOINED="joined_only",e.INVITED="invited_only",e.INVITED_BY_FRIEND="invited_by_friend",e.INVITED_BY_NON_FRIEND="invited_by_non_friend"}(lc||(lc={}));var Rk=function(e){function n(t,r,i){var s,o,a,l,u=this;return(u=e.call(this,t,r,Ze.GROUP,i)||this).mutedMemberFilter=oc.ALL,u.memberStateFilter=lc.ALL,u.nicknameStartsWithFilter=null,u.operatorFilter=pf.ALL,u.order=ac.MEMBER_NICKNAME_ALPHABETICAL,u.mutedMemberFilter=(s=i.mutedMemberFilter)!==null&&s!==void 0?s:oc.ALL,u.memberStateFilter=(o=i.memberStateFilter)!==null&&o!==void 0?o:lc.ALL,u.nicknameStartsWithFilter=(a=i.nicknameStartsWithFilter)!==null&&a!==void 0?a:null,u.order=(l=i.order)!==null&&l!==void 0?l:ac.MEMBER_NICKNAME_ALPHABETICAL,u}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)&&$e(oc,this.mutedMemberFilter)&&$e(lc,this.memberStateFilter)&&(R("string",this.nicknameStartsWithFilter)||this.nicknameStartsWithFilter===null)&&$e(pf,this.operatorFilter)&&$e(ac,this.order)},n.prototype.next=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,t=O.of(this._iid).requestQueue,r=new Ok(Ie(x(x({},this),{token:this._token}))),[4,t.send(r)]):[3,2]:[3,5];case 1:return i=l.sent(),s=i.as(kk),o=s.members,a=s.token,this._token=a,this._hasNext=!!a,this._isLoading=!1,[2,o];case 2:return[2,[]];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Gs),Lk=function(e){function n(t){var r=this,i=t.channelUrl,s=t.userId,o=t.accessCode;return(r=e.call(this)||this).method=Z.PUT,r.path="".concat(sr,"/").concat(encodeURIComponent(i),"/accept"),r.params={user_id:s,access_code:o},r}return T(n,e),n}(J),Dk=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.channel=new di(t,r),i.channel.myMemberState=Gt.JOINED,i}return T(n,e),n}(se),Uk=function(e){function n(t){var r=this,i=t.channelUrl,s=t.isDistinct,o=t.isPublic,a=t.isDiscoverable,l=t.coverUrl,u=t.coverImage,c=t.accessCode,d=t.name,h=t.data,f=t.customType,p=t.operatorUserIds,g=t.messageSurvivalSeconds;return(r=e.call(this)||this).method=Z.PUT,r.path="".concat(sr,"/").concat(encodeURIComponent(i)),r.params=ye({is_distinct:s,is_public:o,is_discoverable:a,name:d,data:h,custom_type:f,cover_url:l,cover_file:u,access_code:c,operator_ids:p,message_survival_seconds:g}),r}return T(n,e),n}(J),Pk=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.channel=new di(t,r),i}return T(n,e),n}(se),Fk=function(e){function n(t){var r=this,i=t.channelUrl;return(r=e.call(this)||this).method=Z.DELETE,r.path="".concat(sr,"/").concat(encodeURIComponent(i)),r}return T(n,e),n}(J);(function(e){function n(t,r){return e.call(this,t,r)||this}T(n,e)})(se);var Hk=function(e){function n(t){var r=this,i=t.channelUrl;return(r=e.call(this)||this).method=Z.DELETE,r.path="".concat(sr,"/").concat(encodeURIComponent(i),"/hide"),r}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var jk=function(e){function n(t){var r=t.userId,i=t.channelUrl,s=t.countPreference,o=e.call(this)||this;return o.method=Z.PUT,o.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/count_preference/").concat(encodeURIComponent(i)),o.params={count_preference:s},o}return T(n,e),n}(J),Bk=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.countPreference=r.count_preference,i}return T(n,e),n}(se),$k=function(e){function n(t){var r=this,i=t.channelUrl;return(r=e.call(this)||this).method=Z.PUT,r.path="".concat(sr,"/").concat(encodeURIComponent(i),"/reset_user_history"),r}return T(n,e),n}(J),Gk=function(e){function n(t,r){var i=e.call(this,t,r)||this,s=r.ts_message_offset;return i.messageOffsetTimestamp=s,i}return T(n,e),n}(se),zk=x(x({},tv),{scheduledAt:void 0,file:void 0,fileUrl:void 0,fileName:void 0,mimeType:void 0,fileSize:void 0,thumbnailSizes:void 0,requireAuth:!1}),Vk=x(x({},fS),{scheduledAt:void 0}),qk=function(e){function n(t){var r,i,s=this;s=e.call(this)||this;var o=[];t.mentionType===rr.USERS&&(t.mentionedUserIds?o=t.mentionedUserIds:t.mentionedUsers&&(o=t.mentionedUsers.map(function(c){return c.userId})));var a=t.channelType,l=t.channelUrl,u=t.scheduledMessageId;return s.method=Z.PUT,s.path="".concat(Je(a),"/").concat(encodeURIComponent(l),"/scheduled_messages/").concat(encodeURIComponent(u)),s.params=ye(Ie({req_id:t.reqId,scheduled_at:t.scheduledAt,message_type:Ll.FILE,url:t.fileUrl,file_name:t.fileName,file_size:t.fileSize,file_type:t.mimeType,thumbnails:(r=t._thumbnails)===null||r===void 0?void 0:r.map(function(c){return zs.payloadify(c)}),custom_type:t.customType,data:t.data,require_auth:t.requireAuth,mention_type:t.mentionType,mentioned_user_ids:o,sorted_metaarray:(i=t.metaArrays)===null||i===void 0?void 0:i.map(function(c){return _r.payloadify(c)}),apple_critical_alert_options:t.appleCriticalAlertOptions?Oi.payloadify(t.appleCriticalAlertOptions):null,push_option:t.pushNotificationDeliveryOption})),s}return T(n,e),n}(J),Wk=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.message=new Jt(t,r),i}return T(n,e),n}(se),Kk=function(e){function n(t){var r,i=this;i=e.call(this)||this;var s=[];t.mentionType===rr.USERS&&(t.mentionedUserIds?s=t.mentionedUserIds:t.mentionedUsers&&(s=t.mentionedUsers.map(function(u){return u.userId})));var o=t.channelType,a=t.channelUrl,l=t.scheduledMessageId;return i.method=Z.PUT,i.path="".concat(Je(o),"/").concat(encodeURIComponent(a),"/scheduled_messages/").concat(encodeURIComponent(l)),i.params=ye(Ie({req_id:t.reqId,scheduled_at:t.scheduledAt,message_type:Ll.USER,message:t.message,custom_type:t.customType,data:t.data,mention_type:t.mentionType,mentioned_user_ids:s,sorted_metaarray:(r=t.metaArrays)===null||r===void 0?void 0:r.map(function(u){return _r.payloadify(u)}),apple_critical_alert_options:t.appleCriticalAlertOptions?Oi.payloadify(t.appleCriticalAlertOptions):null,target_langs:t.translationTargetLanguages,push_option:t.pushNotificationDeliveryOption})),i}return T(n,e),n}(J);(function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.message=new er(t,r),i}T(n,e)})(se);var Qk=function(e){function n(t){var r=e.call(this)||this,i=t.channelType,s=t.channelUrl,o=t.scheduledMessageId;return r.method=Z.DELETE,r.path="".concat(Je(i),"/").concat(encodeURIComponent(s),"/scheduled_messages/").concat(encodeURIComponent(o)),r}return T(n,e),n}(J),Yk=function(e){function n(t){var r=e.call(this)||this,i=t.channelType,s=t.channelUrl,o=t.scheduledMessageId;return r.method=Z.POST,r.path="".concat(Je(i),"/").concat(encodeURIComponent(s),"/scheduled_messages/").concat(encodeURIComponent(o),"/send_now"),r}return T(n,e),n}(J),Zk=function(e){function n(t){var r=t.userId,i=t.channelUrl,s=t.pushTriggerOption,o=e.call(this)||this;return o.method=Z.PUT,o.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push_preference/").concat(encodeURIComponent(i)),o.params={push_trigger_option:s},o}return T(n,e),n}(J),Xk=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.pushTriggerOption=r.push_trigger_option,i.enabled=r.enable,i}return T(n,e),n}(se),Jk=function(e){function n(t){var r=t.userId,i=t.channelUrl,s=e.call(this)||this;return s.method=Z.GET,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push_preference/").concat(encodeURIComponent(i)),s}return T(n,e),n}(J),eR=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.pushTriggerOption=r.push_trigger_option,i.enabled=r.enable,i}return T(n,e),n}(se),tR=function(e){function n(t){var r=t.channelType,i=t.channelUrl,s=t.messageId,o=e.call(this)||this;return o.method=Z.POST,o.path="".concat(Je(r),"/").concat(encodeURIComponent(i),"/messages/").concat(s,"/pin"),o}return T(n,e),n}(J);(function(e){function n(t,r){return e.call(this,t,r)||this}T(n,e)})(se);var nR=function(e){function n(t){var r=t.channelType,i=t.channelUrl,s=t.messageId,o=e.call(this)||this;return o.method=Z.DELETE,o.path="".concat(Je(r),"/").concat(encodeURIComponent(i),"/messages/").concat(s,"/pin"),o}return T(n,e),n}(J);(function(e){function n(t,r){return e.call(this,t,r)||this}T(n,e)})(se);var ni,dr,rR=function(e){function n(t,r){var i=e.call(this,t)||this;return i.message=null,i.message=yr(t,r.message),i}return T(n,e),n}(Kn),iR=function(e){function n(t){var r=this,i=t.channelType,s=t.channelUrl,o=t.limit,a=t.token,l=t.includeReactions,u=t.includeMetaArray,c=t.includeParentMessageInfo,d=t.includeThreadInfo,h=t.includePollDetails;return(r=e.call(this)||this).method=Z.GET,r.path="".concat(Je(i),"/").concat(encodeURIComponent(s),"/pinned_messages"),r.params=ye({limit:o,token:a,include_reactions:l,with_sorted_meta_array:u,include_thread_info:d,include_parent_message_info:c,include_poll_details:h}),r}return T(n,e),n}(J),sR=function(e){function n(t,r){var i=e.call(this,t,r)||this,s=r.pinned_messages,o=r.has_more,a=r.next;return i.pinnedMessages=s.map(function(l){return new rR(t,l)}),i.hasMore=o,i.token=a,i}return T(n,e),n}(se),oR=function(e){function n(t,r,i,s){var o=e.call(this,t,r,i,s)||this;return o.includeMetaArray=s.includeMetaArray,o.includeReactions=s.includeReactions,o.includeParentMessageInfo=s.includeParentMessageInfo,o.includeThreadInfo=s.includeThreadInfo,o.includePollDetails=s.includePollDetails,o}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)&&R("boolean",this.includeMetaArray,!0)&&R("boolean",this.includeReactions,!0)&&R("boolean",this.includeParentMessageInfo,!0)&&R("boolean",this.includeThreadInfo,!0)&&R("boolean",this.includePollDetails,!0)},n.prototype.next=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,t=O.of(this._iid).requestQueue,r=new iR(x(x({},this),{token:this._token})),[4,t.send(r)]):[3,2]:[3,5];case 1:return i=u.sent(),s=i.as(sR),o=s.pinnedMessages,a=s.hasMore,l=s.token,this._token=l,this._hasNext=!!a,this._isLoading=!1,[2,o];case 2:return[2,[]];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Gs);(function(e){e.ALL="all",e.UNREAD_MESSAGE_COUNT_ONLY="unread_message_count_only",e.UNREAD_MENTION_COUNT_ONLY="unread_mention_count_only",e.OFF="off"})(ni||(ni={})),function(e){e.UNHIDDEN="unhidden",e.HIDDEN_ALLOW_AUTO_UNHIDE="hidden_allow_auto_unhide",e.HIDDEN_PREVENT_AUTO_UNHIDE="hidden_prevent_auto_unhide"}(dr||(dr={}));var di=function(e){function n(t,r){var i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S,w,N,A,k,I=this;return(I=e.call(this,t,r)||this)._unreadMemberStateMap=new Map,I._undeliveredMemberStateMap=new Map,I._typingStatus=new Map,I._lastMemberCountUpdated=0,I._typingStarted=0,I._typingEnded=0,I.isDistinct=!1,I.isSuper=!1,I.isBroadcast=!1,I.isExclusive=!1,I.isPublic=!1,I.isDiscoverable=!0,I.isChatNotification=!1,I.isAccessCodeRequired=!1,I.isPushEnabled=!1,I.unreadMessageCount=0,I.unreadMentionCount=0,I.totalUnreadReplyCount=0,I.members=[],I.memberCount=0,I.joinedMemberCount=0,I.hiddenState=dr.UNHIDDEN,I.lastMessage=null,I.messageOffsetTimestamp=0,I.messageSurvivalSeconds=-1,I.myMemberState=Gt.NONE,I.myRole=Ni.NONE,I.myMutedState=ss.UNMUTED,I.myLastRead=0,I.myCountPreference=ni.ALL,I.myPushTriggerOption=na.DEFAULT,I.inviter=null,I.invitedAt=0,I.joinedAt=0,I.pinnedMessageIds=[],I.lastPinnedMessage=null,I._pinnedMessagesUpdatedAt=0,I._myMutedRemainingTime=-1,I.channelType=Ze.GROUP,I.isDistinct=(s=r.is_distinct)!==null&&s!==void 0&&s,I.isSuper=(o=r.is_super)!==null&&o!==void 0&&o,I.isBroadcast=(a=r.is_broadcast)!==null&&a!==void 0&&a,I.isExclusive=(l=r.is_exclusive)!==null&&l!==void 0&&l,I.isPublic=(u=r.is_public)!==null&&u!==void 0&&u,I.isDiscoverable=(c=r.is_discoverable)!==null&&c!==void 0?c:I.isPublic,I.isChatNotification=(d=r.is_chat_notification)!==null&&d!==void 0&&d,I.isAccessCodeRequired=(h=r.is_access_code_required)!==null&&h!==void 0&&h,I.isPushEnabled=(f=r.is_push_enabled)!==null&&f!==void 0&&f,Array.isArray(r.members)&&(i=I.members).push.apply(i,De([],Ae(r.members.map(function(M){return new si(I._iid,M)})),!1)),I.memberCount=(p=r.member_count)!==null&&p!==void 0?p:0,I.joinedMemberCount=(g=r.joined_member_count)!==null&&g!==void 0?g:0,I.hiddenState=$e(dr,r.hidden_state)?r.hidden_state:dr.UNHIDDEN,I.messageOffsetTimestamp=(b=r.ts_message_offset)!==null&&b!==void 0?b:0,I.messageSurvivalSeconds=(m=r.message_survival_seconds)!==null&&m!==void 0?m:-1,I.lastMessage=r.last_message?yr(I._iid,x({channel_type:I.channelType},r.last_message)):null,r.read_receipt&&Object.keys(r.read_receipt).forEach(function(M){R("number",r.read_receipt[M])&&I._updateUnreadMemberState(M,r.read_receipt[M])}),r.delivery_receipt&&Object.keys(r.delivery_receipt).forEach(function(M){R("number",r.delivery_receipt[M])&&I._updateUndeliveredMemberState(M,r.delivery_receipt[M])}),I.myMemberState=$e(Gt,r.member_state)?r.member_state:Gt.NONE,I.myRole=$e(Ni,r.my_role)?r.my_role:Ni.NONE,$e(ss,r.is_muted)?I.myMutedState=r.is_muted:R("boolean",r.is_muted)?I.myMutedState=r.is_muted?ss.MUTED:ss.UNMUTED:I.myMutedState=ss.UNMUTED,I.myCountPreference=$e(ni,r.count_preference)?r.count_preference:ni.ALL,I.myPushTriggerOption=$e(na,r.push_trigger_option)?r.push_trigger_option:na.ALL,I.myLastRead=(_=r.user_last_read)!==null&&_!==void 0?_:0,I.inviter=r.inviter?new Ke(I._iid,r.inviter):null,I.invitedAt=(E=r.invited_at)!==null&&E!==void 0?E:0,I.joinedAt=(S=r.joined_ts)!==null&&S!==void 0?S:0,I._updateUnreadCount((w=r.unread_message_count)!==null&&w!==void 0?w:0,(N=r.unread_mention_count)!==null&&N!==void 0?N:0),I.totalUnreadReplyCount=(A=r.total_unread_thread_message_count)!==null&&A!==void 0?A:0,I.pinnedMessageIds=(k=r.pinned_message_ids)!==null&&k!==void 0?k:[],I.lastPinnedMessage=r.latest_pinned_message?yr(I._iid,x({channel_type:I.channelType},r.latest_pinned_message)):null,I}return T(n,e),Object.defineProperty(n.prototype,"isHidden",{get:function(){return this.hiddenState!==dr.UNHIDDEN},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isTyping",{get:function(){return this._typingStatus.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cachedUnreadMemberState",{get:function(){var t,r,i={};try{for(var s=pe(this._unreadMemberStateMap),o=s.next();!o.done;o=s.next()){var a=Ae(o.value,2),l=a[0],u=a[1];i[l]=u}}catch(c){t={error:c}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cachedUndeliveredMemberState",{get:function(){var t,r,i={};try{for(var s=pe(this._undeliveredMemberStateMap),o=s.next();!o.done;o=s.next()){var a=Ae(o.value,2),l=a[0],u=a[1];i[l]=u}}catch(c){t={error:c}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return i},enumerable:!1,configurable:!0}),n.payloadify=function(t){return ye(Ie(x(x({},e.payloadify.call(this,t)),{is_access_code_required:t.isAccessCodeRequired,is_distinct:t.isDistinct,is_super:t.isSuper,is_broadcast:t.isBroadcast,is_exclusive:t.isExclusive,is_public:t.isPublic,is_discoverable:t.isDiscoverable,is_muted:t.myMutedState,is_push_enabled:t.isPushEnabled,unread_message_count:t.unreadMessageCount,unread_mention_count:t.unreadMentionCount,total_unread_thread_message_count:t.totalUnreadReplyCount,push_trigger_option:t.myPushTriggerOption,count_preference:t.myCountPreference,hidden_state:t.hiddenState,member_count:t.memberCount,joined_member_count:t.joinedMemberCount,member_state:t.myMemberState,my_role:t.myRole,user_last_read:t.myLastRead,ts_message_offset:t.messageOffsetTimestamp,message_survival_seconds:t.messageSurvivalSeconds,read_receipt:t.cachedUnreadMemberState,delivery_receipt:t.cachedUndeliveredMemberState,members:t.members.map(function(r){return si.payloadify(r)}),last_message:t.lastMessage?$1(t.lastMessage):null,inviter:t.inviter?Ke.payloadify(t.inviter):null,invited_at:t.invitedAt,joined_ts:t.joinedAt,pinned_message_ids:t.pinnedMessageIds,latest_pinned_message:t.lastPinnedMessage?$1(t.lastPinnedMessage):null})))},n.prototype._shouldUpdateLastMessageWith=function(t){if(t.silent)return!1;var r=O.of(this._iid).appInfo;switch(r==null?void 0:r.lastMessageThreadingPolicy){case oa.NONE:case oa.INCLUDE_REPLY:break;case oa.EXCLUDE_REPLY:if(t.parentMessageId>0)return!1;break;case oa.INCLUDE_REPLY_TO_CHANNEL:if(t instanceof Ft&&t.parentMessageId>0&&!t.replyToChannel)return!1}return!this.lastMessage||this.lastMessage.createdAt0)return!1;break;case sa.INCLUDE_REPLY_TO_CHANNEL:if(t instanceof Ft&&t.parentMessageId>0&&!t.replyToChannel)return!1}return!0},n.prototype._updateLastMessage=function(t){return!!this._shouldUpdateLastMessageWith(t)&&(this.lastMessage=t,!0)},n.prototype._updateUnreadCount=function(t,r){if(typeof t=="number"&&t>=0)if(this.myCountPreference===ni.ALL||this.myCountPreference===ni.UNREAD_MESSAGE_COUNT_ONLY)if(this.isExclusive||this.isSuper||this.isBroadcast){var i=O.of(this._iid).maxSuperGroupChannelUnreadCount;this.unreadMessageCount=i&&t>=i?i:t}else this.unreadMessageCount=t;else this.unreadMessageCount=0;else this.unreadMessageCount=0;typeof r=="number"&&r>=0&&(this.myCountPreference===ni.ALL||this.myCountPreference===ni.UNREAD_MENTION_COUNT_ONLY)?this.unreadMentionCount=r:this.unreadMentionCount=0},n.prototype._updateUnreadMemberState=function(t,r){var i=this._unreadMemberStateMap.get(t);return(!i||i0?this._typingStatus.set(t.userId,{user:t,ts:r}):this._typingStatus.delete(t.userId)},n.prototype._clearTypingStatus=function(){this._typingStatus.clear(),this._typingStarted=0,this._typingEnded=0},n.prototype._setLatestMemberCount=function(t,r,i){var s=!1;return i>=this._lastMemberCountUpdated&&(this._lastMemberCountUpdated=i,s=t!==this.memberCount||r!==this.joinedMemberCount,this.memberCount=t,this.joinedMemberCount=r),s},n.prototype.isReadMessage=function(t){var r=O.of(this._iid).sdkState,i=this._unreadMemberStateMap.get(r.userId);return!!i&&i>=t.createdAt},n.prototype.serialize=function(){var t=this;return Qc(this,function(r){r.cachedUnreadMemberState=t.cachedUnreadMemberState,r.cachedUndeliveredMemberState=t.cachedUndeliveredMemberState})},n.prototype.createMessageCollection=function(t){return t===void 0&&(t={}),new Mk(this._iid,x(x({},t),{channel:this}))},n.prototype.createMemberListQuery=function(t){return t===void 0&&(t={}),new Rk(this._iid,this.url,t)},n.prototype.createThreadedParentMessageListQuery=function(t){return t===void 0&&(t={}),new gO(this._iid,this.url,this.channelType,t)},n.prototype.createPinnedMessageListQuery=function(t){return t===void 0&&(t={}),new oR(this._iid,this.url,this.channelType,t)},n.prototype.addMember=function(t,r){if(r===void 0&&(r=0),!this.isExclusive&&!this.isSuper&&!this.isBroadcast){var i=this.members.findIndex(function(o){return o.userId===t.userId});if(i>-1){var s=this.members[i];s.state===Gt.JOINED&&(t.state=s.state),this.members.splice(i,1),this.memberCount--}this.members.push(t),this.memberCount++,this._updateUnreadMemberState(t.userId,r),this._updateUndeliveredMemberState(t.userId,r)}},n.prototype.removeMember=function(t){if(!this.isExclusive&&!this.isSuper&&!this.isBroadcast){var r=t instanceof si?t.userId:t,i=this.members.findIndex(function(s){return s.userId===r});if(i>-1)return this.members.splice(i,1),this.memberCount--,!0}return!1},n.prototype.getUnreadMemberCount=function(t){var r,i;if(t instanceof Ft&&!this.isExclusive&&!this.isSuper&&!this.isBroadcast){var s=O.of(this._iid).sdkState,o=t.createdAt,a=0;try{for(var l=pe(this.members),u=l.next();!u.done;u=l.next()){var c=u.value;s.userId!==c.userId&&c.state===Gt.JOINED&&t.sender.userId!==c.userId&&(this.cachedUnreadMemberState[c.userId]||0)=t.createdAt&&a.push(l)}}),a},n.prototype.getUnreadMembers=function(t,r){var i=this;r===void 0&&(r=!1);var s=O.of(this._iid).sdkState;if(!s.userId||this.isExclusive||this.isSuper||this.isBroadcast)return[];var o=t instanceof Ft?t.sender:null,a=[];return this.members.forEach(function(l){if(r||l.userId!==s.userId&&l.userId!==(o==null?void 0:o.userId)){var u=i._unreadMemberStateMap.get(l.userId);u&&u=r&&(t._typingStatus.delete(a),s=!0)}),s},n.prototype.refresh=function(){return y(this,void 0,void 0,function(){return v(this,function(t){return[2,this._refresh()]})})},n.prototype._refresh=function(t){return t===void 0&&(t=!1),y(this,void 0,void 0,function(){var r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:return r=O.of(this._iid),i=r.requestQueue,s=r.dispatcher,o=new Em({channelUrl:this.url}),[4,i.send(o)];case 1:return a=u.sent(),l=a.as(bm).channel,this._update(l),t||s.dispatch(new Ve({channels:[l],context:{source:G.REFRESH_CHANNEL}})),[2,this]}})})},n.prototype.freeze=function(){return y(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return[4,e.prototype.freeze.call(this)];case 1:return t.sent(),O.of(this._iid).dispatcher.dispatch(new Ve({channels:[this],context:{source:G.EVENT_CHANNEL_FROZEN},isWebSocketEventComing:!0})),[2]}})})},n.prototype.unfreeze=function(){return y(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return[4,e.prototype.unfreeze.call(this)];case 1:return t.sent(),O.of(this._iid).dispatcher.dispatch(new Ve({channels:[this],context:{source:G.EVENT_CHANNEL_UNFROZEN},isWebSocketEventComing:!0})),[2]}})})},n.prototype.updateChannel=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return r=x(x({},xk),t),Y(function(d){return R("string",d.coverUrl,!0)&&(pr(d.coverImage)||R("string",d.coverImage,!0))&&R("boolean",d.isDistinct,!0)&&R("boolean",d.isPublic,!0)&&R("boolean",d.isDiscoverable,!0)&&R("string",d.accessCode,!0)&&R("string",d.name,!0)&&R("string",d.data,!0)&&R("string",d.customType,!0)&&We("string",d.operatorUserIds,!0)&&R("number",d.messageSurvivalSeconds,!0)}(r)).throw(L.invalidParameters),i=O.of(this._iid),s=i.dispatcher,o=i.requestQueue,a=new Uk(x({channelUrl:this.url},r)),[4,o.send(a)];case 1:return l=c.sent(),u=l.as(Pk).channel,this._update(u),s.dispatch(new Ve({channels:[u],context:{source:G.EVENT_CHANNEL_UPDATED},isWebSocketEventComing:!0})),[2,this]}})})},n.prototype.invite=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){return Y(t.every(function(i){return i instanceof Ke})).throw(L.invalidParameters),[2,this.inviteWithUserIds(t.map(function(i){return i.userId}))]})})},n.prototype.inviteWithUserIds=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return Y(We("string",t)).throw(L.invalidParameters),r=O.of(this._iid),i=r.dispatcher,s=r.requestQueue,o=r.sessionManager,a=new ok({channelUrl:this.url,userIds:t}),[4,s.send(a)];case 1:return l=c.sent(),u=l.as(ak).channel,this._update(u),i.dispatch(new Ve({channels:[u],context:{source:G.EVENT_CHANNEL_INVITED,inviter:o.currentUser,invitees:[]},isWebSocketEventComing:!0})),[2,this]}})})},n.prototype.join=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return Y(R("string",t,!0)).throw(L.invalidParameters),r=O.of(this._iid),i=r.dispatcher,s=r.sdkState,o=r.requestQueue,a=new tk({channelUrl:this.url,userId:s.userId,accessCode:t}),[4,o.send(a)];case 1:return l=c.sent(),(u=l.as(nk).channel).myMemberState=this.myMemberState=Gt.JOINED,this._update(u),i.dispatch(new Ve({channels:[u],context:{source:G.EVENT_CHANNEL_JOINED,users:[]},isWebSocketEventComing:!0})),[2,this]}})})},n.prototype.leave=function(t){return t===void 0&&(t=!1),y(this,void 0,void 0,function(){var r,i,s,o;return v(this,function(a){switch(a.label){case 0:return r=O.of(this._iid),i=r.sdkState,s=r.requestQueue,o=new ik({channelUrl:this.url,userId:i.userId,shouldRemoveOperatorStatus:t}),[4,s.send(o)];case 1:return a.sent(),this.myMemberState=Gt.NONE,[2]}})})},n.prototype.acceptInvitation=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return Y(R("string",t,!0)).throw(L.invalidParameters),r=O.of(this._iid),i=r.dispatcher,s=r.sdkState,o=r.requestQueue,a=new Lk({channelUrl:this.url,userId:s.userId,accessCode:t}),[4,o.send(a)];case 1:return l=c.sent(),(u=l.as(Dk).channel).myMemberState=this.myMemberState=Gt.JOINED,this._update(u),i.dispatch(new Ve({channels:[u],context:{source:G.EVENT_CHANNEL_ACCEPTED_INVITE},isWebSocketEventComing:!0})),[2,this]}})})},n.prototype.declineInvitation=function(){return y(this,void 0,void 0,function(){var t,r,i,s;return v(this,function(o){switch(o.label){case 0:return t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new uk({channelUrl:this.url,userId:r.userId}),[4,i.send(s)];case 1:return o.sent(),this.myMemberState=Gt.NONE,[2,this]}})})},n.prototype.sendUserMessage=function(t){var r=this,i=new Br,s=O.of(this._iid).dispatcher,o=Mu.of(this._iid);return e.prototype.sendUserMessage.call(this,t).onPending(function(a){o.completeCurrentAndProcessNextAutoResend(a),i._trigger(a)}).onFailed(function(a,l){l&&o.completeCurrentAndProcessNextAutoResend(l),i._triggerFailed(a,l)}).onSucceeded(function(a){r.hiddenState===dr.HIDDEN_ALLOW_AUTO_UNHIDE&&(r.hiddenState=dr.UNHIDDEN),o.completeCurrentAndProcessNextAutoResend(a),r._updateLastMessage(a),Nn.of(r._iid).handlers.map(function(l){l.onChannelChanged&&l.onChannelChanged(r)}),s.dispatch(new Ve({channels:[r],context:{source:G.EVENT_MESSAGE_SENT}})),i._trigger(a)}),i},n.prototype.updateUserMessage=function(t,r){return y(this,void 0,void 0,function(){var i,s,o,a,l=this;return v(this,function(u){switch(u.label){case 0:return i=O.of(this._iid).dispatcher,[4,e.prototype.updateUserMessage.call(this,t,r)];case 1:return s=u.sent(),o=this._updateLastMessage(s),a=!1,this.lastPinnedMessage&&this.lastPinnedMessage.messageId===s.messageId&&(this.lastPinnedMessage=s,o=!0,a=!0),o&&(Nn.of(this._iid).handlers.map(function(c){c.onChannelChanged&&c.onChannelChanged(l)}),i.dispatch(new Ve({channels:[this],context:{source:a?G.EVENT_PINNED_MESSAGE_UPDATED:G.EVENT_MESSAGE_UPDATED}}))),a&&Nn.of(this._iid).handlers.map(function(c){c.onPinnedMessageUpdated&&c.onPinnedMessageUpdated(l)}),i.dispatch(new bt({messages:[s],source:G.EVENT_MESSAGE_UPDATED})),[2,s]}})})},n.prototype._autoResendUserMessage=function(t){var r=this,i=new Br,s=O.of(this._iid).dispatcher,o=Mu.of(this._iid);return e.prototype._autoResendUserMessage.call(this,t).onPending(function(a){o.completeCurrentAndProcessNextAutoResend(a),i._trigger(a)}).onFailed(function(a,l){o.completeCurrentAndProcessNextAutoResend(l),i._triggerFailed(a,l)}).onSucceeded(function(a){var l=Nn.of(r._iid);o.completeCurrentAndProcessNextAutoResend(a),r._updateLastMessage(a),l.handlers.map(function(u){u.onChannelChanged&&u.onChannelChanged(r)}),s.dispatch(new Ve({channels:[r],context:{source:G.EVENT_MESSAGE_SENT}})),i._trigger(a)}),i},n.prototype.sendFileMessage=function(t){var r=this,i=new Br,s=O.of(this._iid).dispatcher,o=Mu.of(this._iid);return e.prototype.sendFileMessage.call(this,t).onPending(function(a){o.completeCurrentAndProcessNextAutoResend(a),i._trigger(a)}).onFailed(function(a,l){l&&o.completeCurrentAndProcessNextAutoResend(l),i._triggerFailed(a,l)}).onSucceeded(function(a){var l=Nn.of(r._iid);o.completeCurrentAndProcessNextAutoResend(a),r._updateLastMessage(a),l.handlers.map(function(u){u.onChannelChanged&&u.onChannelChanged(r)}),s.dispatch(new Ve({channels:[r],context:{source:G.EVENT_MESSAGE_SENT}})),i._trigger(a)}),i},n.prototype.sendMultipleFilesMessage=function(t){var r=this,i=new ph,s=O.of(this._iid).dispatcher;return e.prototype.sendMultipleFilesMessage.call(this,t).onPending(function(o){i._trigger(o)}).onFailed(function(o,a){i._triggerFailed(o,a)}).onSucceeded(function(o){var a=Nn.of(r._iid);r._updateLastMessage(o),a.handlers.map(function(l){l.onChannelChanged&&l.onChannelChanged(r)}),s.dispatch(new Ve({channels:[r],context:{source:G.EVENT_MESSAGE_SENT}})),i._trigger(o)}).onFileUploaded(function(o,a,l,u){i._triggerOnFileUploaded(o,a,l,u)}),i},n.prototype.updateFileMessage=function(t,r){return y(this,void 0,void 0,function(){var i,s,o,a,l=this;return v(this,function(u){switch(u.label){case 0:return i=O.of(this._iid).dispatcher,[4,e.prototype.updateFileMessage.call(this,t,r)];case 1:return s=u.sent(),o=this._updateLastMessage(s),a=!1,this.lastPinnedMessage&&this.lastPinnedMessage.messageId===s.messageId&&(this.lastPinnedMessage=s,o=!0,a=!0),o&&(Nn.of(this._iid).handlers.map(function(c){c.onChannelChanged&&c.onChannelChanged(l)}),i.dispatch(new Ve({channels:[this],context:{source:a?G.EVENT_PINNED_MESSAGE_UPDATED:G.EVENT_MESSAGE_UPDATED}}))),a&&Nn.of(this._iid).handlers.map(function(c){c.onPinnedMessageUpdated&&c.onPinnedMessageUpdated(l)}),i.dispatch(new bt({messages:[s],source:G.EVENT_MESSAGE_UPDATED})),[2,s]}})})},n.prototype._autoResendFileMessage=function(t){var r=this,i=new Br,s=O.of(this._iid).dispatcher,o=Mu.of(this._iid);return e.prototype._autoResendFileMessage.call(this,t).onPending(function(a){o.completeCurrentAndProcessNextAutoResend(a),i._trigger(a)}).onFailed(function(a,l){o.completeCurrentAndProcessNextAutoResend(l),i._triggerFailed(a,l)}).onSucceeded(function(a){var l=Nn.of(r._iid);o.completeCurrentAndProcessNextAutoResend(a),r._updateLastMessage(a),l.handlers.map(function(u){u.onChannelChanged&&u.onChannelChanged(r)}),s.dispatch(new Ve({channels:[r],context:{source:G.EVENT_MESSAGE_SENT}})),i._trigger(a)}),i},n.prototype.deleteMessage=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return[4,e.prototype.deleteMessage.call(this,t)];case 1:return r.sent(),t.messageId===0&&t instanceof Ft&&O.of(this._iid).dispatcher.dispatch(new qC({reqId:t.reqId,source:G.EVENT_MESSAGE_DELETED})),[2]}})})},n.prototype.hide=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u,c;return v(this,function(d){switch(d.label){case 0:return r=x(x({},Cm),t),Y(function(h){return R("boolean",h.hidePreviousMessages,!0)&&R("boolean",h.allowAutoUnhide,!0)}(r)).throw(L.invalidParameters),i=O.of(this._iid),s=i.dispatcher,o=i.sdkState,a=i.requestQueue,l=new dk(x({channelUrl:this.url,userId:o.userId},r)),[4,a.send(l)];case 1:return u=d.sent(),c=u.as(hk).messageOffsetTimestamp,this.hiddenState=r.allowAutoUnhide?dr.HIDDEN_ALLOW_AUTO_UNHIDE:dr.HIDDEN_PREVENT_AUTO_UNHIDE,r.hidePreviousMessages&&this._updateUnreadCount(0,0),c&&(this.messageOffsetTimestamp=c),s.dispatch(new Ve({channels:[this],context:{source:G.EVENT_CHANNEL_HIDDEN},isWebSocketEventComing:!0})),[2,this]}})})},n.prototype.unhide=function(){return y(this,void 0,void 0,function(){var t,r,i,s;return v(this,function(o){switch(o.label){case 0:return t=O.of(this._iid),r=t.dispatcher,i=t.requestQueue,s=new Hk({channelUrl:this.url}),[4,i.send(s)];case 1:return o.sent(),this.hiddenState=dr.UNHIDDEN,r.dispatch(new Ve({channels:[this],context:{source:G.EVENT_CHANNEL_UNHIDDEN},isWebSocketEventComing:!0})),[2,this]}})})},n.prototype.delete=function(){return y(this,void 0,void 0,function(){var t,r;return v(this,function(i){switch(i.label){case 0:return t=O.of(this._iid).requestQueue,r=new Fk({channelUrl:this.url}),[4,t.send(r)];case 1:return i.sent(),[2]}})})},n.prototype.markAsRead=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u=this;return v(this,function(c){switch(c.label){case 0:return t=O.of(this._iid),r=t.sdkState,i=t.dispatcher,s=t.requestQueue,o=new Q6({channelUrl:this.url}),[4,s.send(o)];case 1:return a=c.sent(),l=a.as(sS).readStatus,this._updateUnreadMemberState(r.userId,l.readAt),(this.unreadMessageCount>0||this.unreadMentionCount>0)&&(this._updateUnreadCount(0,0),Nn.of(this._iid).handlers.map(function(d){d.onChannelChanged&&d.onChannelChanged(u)})),i.dispatch(new Ve({channels:[this],context:{source:G.EVENT_CHANNEL_READ}})),[2]}})})},n.prototype.markAsDelivered=function(){return y(this,void 0,void 0,function(){var t,r,i,s;return v(this,function(o){switch(o.label){case 0:return t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new Ek({channelUrl:this.url,userId:r.userId}),[4,i.send(s)];case 1:return o.sent(),[2]}})})},n.prototype.startTyping=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o;return v(this,function(a){switch(a.label){case 0:return t=O.of(this._iid),r=t.requestQueue,i=t.typingIndicatorThrottle,(s=new Date().getTime())-this._typingStarted>=i?(this._typingStarted=s,this._typingEnded=0,o=new pk({channelUrl:this.url,time:this._typingStarted}),[4,r.send(o)]):[3,2];case 1:a.sent(),a.label=2;case 2:return[2]}})})},n.prototype.endTyping=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o;return v(this,function(a){switch(a.label){case 0:return t=O.of(this._iid),r=t.requestQueue,i=t.typingIndicatorThrottle,(s=new Date().getTime())-this._typingEnded>=i?(this._typingStarted=0,this._typingEnded=s,o=new mk({channelUrl:this.url,time:this._typingStarted}),[4,r.send(o)]):[3,2];case 1:a.sent(),a.label=2;case 2:return[2]}})})},n.prototype.createScheduledUserMessage=function(t){t=x(x({},tO),t),Y(nO(t)).throw(L.invalidParameters);var r=new Br;return this._createScheduledUserMessage(t,r),r},n.prototype.updateScheduledUserMessage=function(t,r){return y(this,void 0,void 0,function(){var i,s,o,a;return v(this,function(l){switch(l.label){case 0:return i=x(x({},Vk),r),Y(function(u){return pS(u)&&R("number",u.scheduledAt,!0)}(i)).throw(L.invalidParameters),s=O.of(this._iid).requestQueue,o=new Kk(x({reqId:this._generateRequestId(),scheduledMessageId:t,channelType:this.channelType,channelUrl:this.url},i)),[4,s.send(o)];case 1:return a=l.sent(),[2,a.as(mS).message]}})})},n.prototype.createScheduledFileMessage=function(t){var r=this;t=x(x({},rO),t),Y(iO(t)).throw(L.invalidParameters);var i=Date.now(),s=this._generateRequestId(),o=new Br;return Or(Ox).then(function(){var a=r._createPendingScheduledFileMessage(t,s,i);Re(function(){return y(r,void 0,void 0,function(){return v(this,function(l){return[2,o._trigger(a)]})})})}),pr(t.file)?this._uploadFileAndUpdateParams(t).then(function(){return r._createScheduledFileMessage(t,o,s,i)}):this._createScheduledFileMessage(t,o,s,i),o},n.prototype.updateScheduledFileMessage=function(t,r){return y(this,void 0,void 0,function(){var i,s,o;return v(this,function(a){switch(a.label){case 0:return i=x(x({},zk),r),Y(function(l){return nv(l)&&R("number",l.scheduledAt,!0)&&(pr(l.file)||R("string",l.fileUrl))&&R("string",l.fileName,!0)&&R("string",l.mimeType,!0)&&R("number",l.fileSize,!0)&&(l.thumbnailSizes===null||l.thumbnailSizes===void 0||l.thumbnailSizes.every(function(u){return R("object",u)&&u.maxWidth>0&&u.maxHeight>0}))}(i)).throw(L.invalidParameters),pr(i.file)?[4,this._uploadFileAndUpdateParams(i)]:[3,2];case 1:a.sent(),a.label=2;case 2:return s=new qk(x({reqId:this._generateRequestId(),scheduledMessageId:t,channelType:this.channelType,channelUrl:this.url},i)),[4,O.of(this._iid).requestQueue.send(s)];case 3:return o=a.sent(),[2,o.as(Wk).message]}})})},n.prototype.cancelScheduledMessage=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return r=new Qk({scheduledMessageId:t,channelType:this.channelType,channelUrl:this.url}),[4,O.of(this._iid).requestQueue.send(r)];case 1:return i.sent(),[2]}})})},n.prototype.sendScheduledMessageNow=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){switch(i.label){case 0:return r=new Yk({scheduledMessageId:t,channelType:this.channelType,channelUrl:this.url}),[4,O.of(this._iid).requestQueue.send(r)];case 1:return i.sent(),[2]}})})},n.prototype.getMyPushTriggerOption=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new Jk({userId:r.userId,channelUrl:this.url}),[4,i.send(s)];case 1:return o=l.sent(),a=o.as(eR).pushTriggerOption,this.myPushTriggerOption=a,[2,a]}})})},n.prototype.setMyPushTriggerOption=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return Y($e(na,t)).throw(L.invalidParameters),r=O.of(this._iid),i=r.dispatcher,s=r.sdkState,o=r.requestQueue,a=new Zk({userId:s.userId,channelUrl:this.url,pushTriggerOption:t}),[4,o.send(a)];case 1:return l=c.sent(),u=l.as(Xk).pushTriggerOption,this.myPushTriggerOption=u,i.dispatch(new Ve({channels:[this],context:{source:G.EVENT_CHANNEL_UPDATED},isWebSocketEventComing:!0})),[2,u]}})})},n.prototype.setMyCountPreference=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return Y($e(ni,t)).throw(L.invalidParameters),r=O.of(this._iid),i=r.dispatcher,s=r.sdkState,o=r.requestQueue,a=new jk({channelUrl:this.url,userId:s.userId,countPreference:t}),[4,o.send(a)];case 1:return l=c.sent(),u=l.as(Bk).countPreference,this.myCountPreference=u,this._updateUnreadCount(this.unreadMessageCount,this.unreadMentionCount),i.dispatch(new Ve({channels:[this],context:{source:G.EVENT_CHANNEL_UPDATED},isWebSocketEventComing:!0})),[2,u]}})})},n.prototype.resetMyHistory=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return t=O.of(this._iid),r=t.dispatcher,i=t.requestQueue,s=new $k({channelUrl:this.url}),[4,i.send(s)];case 1:return o=l.sent(),a=o.as(Gk).messageOffsetTimestamp,this.messageOffsetTimestamp=a,this.lastMessage&&this.lastMessage.createdAt0).throw(L.invalidParameters),r=O.of(this._iid).requestQueue,i=new tR({channelType:this.channelType,channelUrl:this.url,messageId:t}),[4,r.send(i)];case 1:return s.sent(),[2]}})})},n.prototype.unpinMessage=function(t){return y(this,void 0,void 0,function(){var r,i;return v(this,function(s){switch(s.label){case 0:return Y(R("number",t)&&t>0).throw(L.invalidParameters),r=O.of(this._iid).requestQueue,i=new nR({channelType:this.channelType,channelUrl:this.url,messageId:t}),[4,r.send(i)];case 1:return s.sent(),[2]}})})},n.prototype._uploadFileAndUpdateParams=function(t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u,c,d,h;return v(this,function(f){switch(f.label){case 0:return pr(t.file)?(r=O.of(this._iid).requestQueue,i=new af({file:t.file,channelUrl:this.url,thumbnailSizes:t.thumbnailSizes,requestId:this._generateRequestId()}),[4,r.send(i)]):[3,2];case 1:s=f.sent(),o=s.as(lf),a=o.url,l=o.fileSize,u=l===void 0?t.fileSize:l,c=o.thumbnails,d=o.requireAuth,h=d!==void 0&&d,t.fileUrl=a,t.fileSize=u,t.requireAuth=h,t._thumbnails=c,f.label=2;case 2:return[2]}})})},n.prototype.resendMessage=function(t,r){var i,s=this;if(Y(t instanceof Ft&&!t.scheduledInfo&&t.isResendable).throw(L.invalidParameters),t.isUserMessage()){var o=(i=t.messageParams)!==null&&i!==void 0?i:um(t),a=new Br;return this._sendUserMessage(o,Zn.RESEND,t.reqId).onPending(function(d){a._trigger(d)}).onFailed(function(d,h){a._triggerFailed(d,h)}).onSucceeded(function(d){s._tryUpdateLastMessageAndCallEvents(s,d),a._trigger(d)}),a}if(t.isFileMessage()){var l=this._validateFailedFileMessageHasFile(t,r);Y(l).throw(L.invalidParameters),o=cm(t,r);var u=new Br;return this._sendFileMessage(o,Zn.RESEND,t.reqId).onPending(function(d){u._trigger(d)}).onFailed(function(d,h){u._triggerFailed(d,h)}).onSucceeded(function(d){s._tryUpdateLastMessageAndCallEvents(s,d),u._trigger(d)}),u}if(t.isMultipleFilesMessage()){o=t.messageParams;var c=new ph;return this._sendMultipleFilesMessage(o,Zn.RESEND,t.reqId).onPending(function(d){c._trigger(d)}).onFailed(function(d,h){c._triggerFailed(d,h)}).onSucceeded(function(d){s._tryUpdateLastMessageAndCallEvents(s,d),c._trigger(d)}).onFileUploaded(function(d,h,f,p){c._triggerOnFileUploaded(d,h,f,p)}),c}},n.prototype.copyMessage=function(t,r){var i=this;if(Y(t instanceof ry&&r instanceof Ft&&r.sendingStatus===ut.SUCCEEDED&&this.url===r.channelUrl&&!r.scheduledInfo).throw(L.invalidParameters),r.isUserMessage()){Y(!r.poll).throw(L.notSupportedError);var s=cS(r),o=new Br;return t._sendUserMessage(s).onPending(function(u){o._trigger(u)}).onFailed(function(u,c){o._triggerFailed(u,c)}).onSucceeded(function(u){t.isGroupChannel()&&i._tryUpdateLastMessageAndCallEvents(t,u),o._trigger(u)}),o}if(r.isFileMessage()){s=hS(r);var a=new Br;return t._sendFileMessage(s).onPending(function(u){a._trigger(u)}).onFailed(function(u,c){a._triggerFailed(u,c)}).onSucceeded(function(u){t.isGroupChannel()&&i._tryUpdateLastMessageAndCallEvents(t,u),a._trigger(u)}),a}if(r.isMultipleFilesMessage()){if(t.isGroupChannel()){s=Ax(r);var l=new ph;return t._sendMultipleFilesMessage(s,Zn.COPY).onPending(function(u){l._trigger(u)}).onFailed(function(u,c){l._triggerFailed(u,c)}).onSucceeded(function(u){i._tryUpdateLastMessageAndCallEvents(t,u),l._trigger(u)}).onFileUploaded(function(u,c,d,h){l._triggerOnFileUploaded(u,c,d,h)}),l}throw L.channelTypeNotSupportedError}},n}(ry),aR=function(){this.onUserMuted=qe,this.onUserUnmuted=qe,this.onUserBanned=qe,this.onUserUnbanned=qe,this.onChannelChanged=qe,this.onChannelDeleted=qe,this.onChannelFrozen=qe,this.onChannelUnfrozen=qe,this.onOperatorUpdated=qe,this.onChannelMemberCountChanged=qe,this.onMetaDataCreated=qe,this.onMetaDataUpdated=qe,this.onMetaDataDeleted=qe,this.onMetaCounterCreated=qe,this.onMetaCounterUpdated=qe,this.onMetaCounterDeleted=qe,this.onMessageReceived=qe,this.onMessageUpdated=qe,this.onMessageDeleted=qe,this.onMentionReceived=qe,this.onReactionUpdated=qe,this.onThreadInfoUpdated=qe},uc,Ks={},lR=function(){function e(n){var t=n._iid,r=n.limit,i=r===void 0?100:r,s=this;this.ref=0,this._iid=t,this._limit=i;var o,a=O.of(this._iid),l=a.sdkState,u=a.dispatcher,c=a.logger,d=a.cacheContext;this._metadataKey=(o=l.userId,"sendbird:".concat(o,"@groupchannel/sync.meta"));var h=function(f){return"sendbird:".concat(f,"@groupchannel/sync")}(l.userId);this._sync=new ko(h,function(){return y(s,void 0,void 0,function(){var f,p,g,b,m,_,E,S,w,N,A,k;return v(this,function(I){switch(I.label){case 0:return f={hasNext:!0,nextToken:""},[4,this.loadMetadata()];case 1:if(I.sent(),c.debug("channel background sync from",(w=this._metadata)===null||w===void 0?void 0:w.token),(N=this._metadata)===null||N===void 0?void 0:N.completed)return[3,13];I.label=2;case 2:if(I.trys.push([2,9,,12]),(p={includeEmpty:!0,order:jt.CHRONOLOGICAL}).order!==jt.LATEST_LAST_MESSAGE)return[3,6];I.label=3;case 3:return I.trys.push([3,5,,6]),[4,d.preference.get(Kg(l.appId))];case 4:return g=I.sent(),p.includeChatNotification=!!g,[3,6];case 5:return I.sent(),p.includeChatNotification=!1,[3,6];case 6:return[4,Nn.of(this._iid).getMyGroupChannels((k=(A=this._metadata)===null||A===void 0?void 0:A.token)!==null&&k!==void 0?k:"",p,this._limit,G.SYNC_CHANNEL_BACKGROUND)];case 7:return b=I.sent(),m=b.channels,_=b.token,f.hasNext=m.length>=this._limit&&!!_,f.nextToken=_,this._metadata&&(this._metadata.token=_,(S=this._metadata.range).extends.apply(S,De([],Ae(m.map(function(M){return M.createdAt})),!1)),this._metadata.completed=!f.hasNext),c.debug("channel background sync progress",f),[4,this.saveMetadata()];case 8:return I.sent(),[3,12];case 9:return E=I.sent(),c.debug("channel background sync error",E),E instanceof L&&E.isInvalidTokenError?[4,this.clearMetaData()]:[3,11];case 10:I.sent(),I.label=11;case 11:throw E;case 12:return[3,14];case 13:f.hasNext=!1,f.nextToken="",I.label=14;case 14:return[2,f]}})})}),this._connectionEventContext=u.on(function(f){f instanceof _i&&(f.stateType===rt.CONNECTED?s.resume():s.pause())})}return e.of=function(n){return Ks[n]||(Ks[n]=new e({_iid:n})),Ks[n].ref++,Ks[n]},e.clear=function(n){Ks[n]&&(Ks[n].close(),delete Ks[n])},Object.defineProperty(e.prototype,"range",{get:function(){var n,t;return(t=(n=this._metadata)===null||n===void 0?void 0:n.range)!==null&&t!==void 0?t:new ls({})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"completed",{get:function(){var n;return!!(!((n=this._metadata)===null||n===void 0)&&n.completed)},enumerable:!1,configurable:!0}),e.prototype.loadMetadata=function(){return y(this,void 0,void 0,function(){var n;return v(this,function(t){switch(t.label){case 0:return this._metadata?[3,2]:[4,O.of(this._iid).cacheContext.preference.get(this._metadataKey)];case 1:n=t.sent(),this._metadata={token:n?n.token:"",range:new ls(n?n.range:{top:Number.MAX_SAFE_INTEGER,bottom:0}),completed:!!n&&n.completed},t.label=2;case 2:return[2,this._metadata]}})})},e.prototype.saveMetadata=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return this._metadata?[4,O.of(this._iid).cacheContext.preference.set(this._metadataKey,this._metadata)]:[3,2];case 1:return n.sent(),[2,!0];case 2:return[2,!1]}})})},e.prototype.clearMetaData=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return[4,O.of(this._iid).cacheContext.preference.remove(this._metadataKey)];case 1:return n.sent(),this._metadata=void 0,[2]}})})},e.prototype.resume=function(){var n,t,r=O.of(this._iid),i=r.logger;r.sessionManager.session.hasSession&&(i.debug("channel background sync resume()"),this._sync.start((t=(n=this._metadata)===null||n===void 0?void 0:n.token)!==null&&t!==void 0?t:""))},e.prototype.pause=function(){O.of(this._iid).logger.debug("channel background sync stop()"),this._sync.stop()},e.prototype.close=function(){this.ref--,this.ref<=0&&(this.ref=0,this.pause(),this._connectionEventContext.close(),delete Ks[this._iid])},e}(),Qs={},uR=function(){function e(n){var t=n._iid,r=this;this.ref=0,this._iid=t;var i,s=O.of(this._iid),o=s.logger,a=s.sdkState,l=s.dispatcher,u=s.cacheContext;this._metadataKey=(i=a.userId,"sendbird:".concat(i,"@groupchannel/changelogs.meta")),this._subscribers=new La;var c=function(d){return"sendbird:".concat(d,"@groupchannel/changelogs")}(a.userId);this._sync=new ko(c,function(){return y(r,void 0,void 0,function(){var d,h,f,p,g,b,m,_,E,S,w,N;return v(this,function(A){switch(A.label){case 0:return d={hasNext:!0,nextToken:0},[4,this.loadMetadata()];case 1:A.sent(),o.debug("channel changelog sync from",(S=this._metadata)===null||S===void 0?void 0:S.token),A.label=2;case 2:A.trys.push([2,9,,12]),h={includeEmpty:!0},A.label=3;case 3:return A.trys.push([3,5,,6]),[4,u.preference.get(Kg(a.appId))];case 4:return f=A.sent(),h.includeChatNotification=!!f,[3,6];case 5:return A.sent(),h.includeChatNotification=!1,[3,6];case 6:return[4,Nn.of(this._iid).getMyGroupChannelChangeLogs((N=(w=this._metadata)===null||w===void 0?void 0:w.token)!==null&&N!==void 0?N:"",h,G.SYNC_CHANNEL_CHANGELOGS)];case 7:return p=A.sent(),g=p.updatedChannels,b=p.deletedChannelUrls,m=p.hasMore,_=p.token,this._subscribers.dispatch("progress",{updatedChannels:g,deletedChannelUrls:b,hasMore:m,token:_}),d.hasNext=m,d.nextToken=_,this._metadata&&(this._metadata.token=_),o.debug("channel changelog sync progress",d),[4,this.saveMetadata()];case 8:return A.sent(),[3,12];case 9:return E=A.sent(),o.debug("channel changelog sync error",E),E instanceof L&&E.isInvalidTokenError?[4,this.clearMetadata()]:[3,11];case 10:A.sent(),A.label=11;case 11:throw E;case 12:return[2,d]}})})}),this._sync.on("stop",function(){r._subscribers.dispatch("pause")}),this._connectionEventContext=l.on(function(d){d instanceof _i&&(d.stateType===rt.CONNECTED?r.resume():r.pause())})}return e.of=function(n){return Qs[n]||(Qs[n]=new e({_iid:n})),Qs[n].ref++,Qs[n]},e.clear=function(n){Qs[n]&&(Qs[n].close(),delete Qs[n])},Object.defineProperty(e.prototype,"isRunning",{get:function(){return this._sync.isRunning},enumerable:!1,configurable:!0}),e.prototype.loadMetadata=function(){return y(this,void 0,void 0,function(){var n,t,r,i;return v(this,function(s){switch(s.label){case 0:return this._metadata?[3,2]:(n=O.of(this._iid),t=n.cacheContext,r=n.firstConnectedAt,[4,t.preference.get(this._metadataKey)]);case 1:i=s.sent(),this._metadata={token:i?i.token:r},s.label=2;case 2:return[2,this._metadata]}})})},e.prototype.saveMetadata=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return this._metadata?[4,O.of(this._iid).cacheContext.preference.set(this._metadataKey,this._metadata)]:[3,2];case 1:return n.sent(),[2,!0];case 2:return[2,!1]}})})},e.prototype.clearMetadata=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return[4,O.of(this._iid).cacheContext.preference.remove(this._metadataKey)];case 1:return n.sent(),this._metadata=void 0,[2]}})})},e.prototype.on=function(n,t){return this._subscribers.on(n,t)},e.prototype.resume=function(){O.of(this._iid).sessionManager.session.hasSession&&this._sync.start(0)},e.prototype.pause=function(){this._sync.stop()},e.prototype.close=function(){this.ref--,this.ref<=0&&(this.ref=0,this.pause(),this._connectionEventContext.close(),delete Qs[this._iid])},e}(),yh=function(e,n){return e.findIndex(function(t){return t.isIdentical(n)})},my=function(e,n,t){if(e.length>0){for(var r=yh(e,n),i=0,s=e.length-1,o=Math.floor((i+s)/2);i0)s=o,o=Math.floor((i+s)/2);else{if(!(a<0))return{place:o,oldPosition:r};i=o+1,o=Math.floor((i+s)/2)}}return{place:gy(e[o],n,t)>=0?o:o+1,oldPosition:r}}return{place:e.length,oldPosition:-1}},gy=function(e,n,t){switch(t){case jt.LATEST_LAST_MESSAGE:return e.lastMessage&&n.lastMessage?(r=n.lastMessage.createdAt-e.lastMessage.createdAt)===0?n.createdAt-e.createdAt:r:e.lastMessage?-1:n.lastMessage?1:n.createdAt-e.createdAt;case jt.CHRONOLOGICAL:return n.createdAt-e.createdAt;case jt.CHANNEL_NAME_ALPHABETICAL:var r;return(r=e.name.localeCompare(n.name))===0?e.createdAt-n.createdAt:r;default:return 0}},cR=function(){function e(n,t){var r=t.filter,i=r===void 0?new xS:r,s=t.order,o=s===void 0?jt.LATEST_LAST_MESSAGE:s,a=t.limit,l=a===void 0?vS:a,u=t.includeChangesOnInitialLoad,c=u!==void 0&&u,d=this;this.channels=[],this._iid=n,this._key="gcc-".concat(Bs()),this._isDisposed=!1,this._isGetRemoteChannelsSucceeded=!0,this._includeChangesOnInitialLoad=c,this.filter=i,this.order=o,this._hasMore=!0,this._token="",this._limit=l;var h=O.of(this._iid),f=h.sdkState,p=h.cacheContext,g=h.dispatcher;p.localCacheEnabled&&(this._backgroundSync=lR.of(n),this._backgroundSync.resume()),this._changelogSync=uR.of(n),this._changelogSync.resume(),Nn.of(this._iid).subscribeChannelEvent(this._key,{onUpdate:function(b,m){var _=m.source;if(vh(_)){var E=b.filter(function(w){return d.filter.match(w,f.userId)}),S=b.filter(function(w){return!d.filter.match(w,f.userId)}).map(function(w){return w.url});E.length>0&&d._addChannelsToView(E,m),S.length>0&&d._removeChannelsFromView(S,m)}},onRemove:function(b,m){d._removeChannelsFromView(b,m)}}),O.of(this._iid).statManager.put(new Fl({type:Et.FEATURE_LOCALCACHE,data:{use_local_cache:p.localCacheEnabled,collection_interface:{group_channel:!0}}})),g.on(function(b){b instanceof _i&&(b.stateType===rt.CONNECTED?d._isGetRemoteChannelsSucceeded||y(d,void 0,void 0,function(){return v(this,function(m){switch(m.label){case 0:return[4,this._revokeLoadMore()];case 1:return m.sent(),[2]}})}):b.stateType===rt.LOGOUT&&d.dispose())})}return Object.defineProperty(e.prototype,"hasMore",{get:function(){return!this._isDisposed&&this._hasMore},enumerable:!1,configurable:!0}),e.prototype.setGroupChannelCollectionHandler=function(n){this._handler=n},e.prototype._addChannelsToView=function(n,t,r){var i,s,o,a,l=this;r===void 0&&(r=!1);var u=[],c=[],d=[];try{for(var h=pe(n),f=h.next();!f.done;f=h.next()){var p=f.value,g=yh(this.channels,p);g>=0&&this.channels.splice(g,1);var b=my(this.channels,p,this.order).place;if(g<0)b===this.channels.length?!r&&this._hasMore||(u.push(p),this.channels.push(p)):(u.push(p),this.channels.splice(b,0,p));else switch(t.source){case G.EVENT_CHANNEL_UPDATED:case G.EVENT_MESSAGE_RECEIVED:case G.SYNC_CHANNEL_CHANGELOGS:case G.EVENT_MESSAGE_SENT:this.order===jt.CHANNEL_NAME_ALPHABETICAL&&this._hasMore&&b===this.channels.length?d.push(p):(this.channels.splice(b,0,p),c.push(p));break;default:this.channels.splice(b,0,p),c.push(p)}}}catch(S){i={error:S}}finally{try{f&&!f.done&&(s=h.return)&&s.call(h)}finally{if(i)throw i.error}}if(d.length>0)try{for(var m=pe(d),_=m.next();!_.done;_=m.next()){p=_.value;var E=yh(this.channels,p);E!==-1&&this.channels.splice(E,1)}}catch(S){o={error:S}}finally{try{_&&!_.done&&(a=m.return)&&a.call(m)}finally{if(o)throw o.error}}vh(t.source)&&Re(function(){return y(l,void 0,void 0,function(){var S,w,N;return v(this,function(A){return u.length>0&&(!((S=this._handler)===null||S===void 0)&&S.onChannelsAdded)&&this._handler.onChannelsAdded(t,u),c.length>0&&(!((w=this._handler)===null||w===void 0)&&w.onChannelsUpdated)&&this._handler.onChannelsUpdated(t,c),d.length>0&&(!((N=this._handler)===null||N===void 0)&&N.onChannelsDeleted)&&this._handler.onChannelsDeleted(t,d.map(function(k){return k.url})),[2]})})})},e.prototype._removeChannelsFromView=function(n,t){var r,i,s=this,o=[],a=function(d){var h=l.channels.findIndex(function(f){return f.url===d});h>=0&&(o.push(l.channels[h].url),l.channels.splice(h,1))},l=this;try{for(var u=pe(n),c=u.next();!c.done;c=u.next())a(c.value)}catch(d){r={error:d}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}return vh(t.source)&&o.length>0&&Re(function(){return y(s,void 0,void 0,function(){var d;return v(this,function(h){return!((d=this._handler)===null||d===void 0)&&d.onChannelsDeleted&&this._handler.onChannelsDeleted(t,o),[2]})})}),o},e.prototype._getLocalChannels=function(){return y(this,void 0,void 0,function(){var n,t;return v(this,function(r){switch(r.label){case 0:return n=Nn.of(this._iid),t=this.channels.length>0?function(i,s){var o,a,l,u;switch(s){case jt.LATEST_LAST_MESSAGE:return(a=(o=i.lastMessage)===null||o===void 0?void 0:o.createdAt)!==null&&a!==void 0?a:i.createdAt;case jt.CHRONOLOGICAL:return i.createdAt;case jt.CHANNEL_NAME_ALPHABETICAL:return i.name;default:return(u=(l=i.lastMessage)===null||l===void 0?void 0:l.createdAt)!==null&&u!==void 0?u:i.createdAt}}(this.channels[this.channels.length-1],this.order):null,[4,n.getChannelsFromCache(t,this.filter,this.order,this._limit,t?this.channels[this.channels.length-1].url:void 0)];case 1:return[2,r.sent()]}})})},e.prototype._getRemoteChannels=function(){return y(this,void 0,void 0,function(){var n,t,r;return v(this,function(i){switch(i.label){case 0:return[4,Nn.of(this._iid).getMyGroupChannels(this._token,Ie(x(x({},this.filter),{order:this.order})),this._limit)];case 1:return n=i.sent(),t=n.channels,r=n.token,this._token=r,this._hasMore=!!r,[2,t]}})})},e.prototype._revokeLoadMore=function(){return y(this,void 0,void 0,function(){var n;return v(this,function(t){switch(t.label){case 0:if(this._isDisposed)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this._getRemoteChannels()];case 2:return n=t.sent(),this._isGetRemoteChannelsSucceeded=!0,this._addChannelsToView(n,{source:G.REQUEST_CHANNEL},!0),[3,4];case 3:return t.sent(),this._isGetRemoteChannelsSucceeded=!1,[3,4];case 4:return[2]}})})},e.prototype.loadMore=function(){var n;return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S=this;return v(this,function(w){switch(w.label){case 0:if(this._isDisposed)throw new L({code:Te.COLLECTION_DISPOSED,message:"Collection has been disposed."});return t=null,this._includeChangesOnInitialLoad&&this.channels.length===0&&this._changelogSync.isRunning?[4,new Promise(function(N){S._changelogSyncSubscriberContext=S._changelogSync.on("progress",function(A){return N(A)}).on("pause",function(){return N(null)})})]:[3,2];case 1:t=w.sent(),(n=this._changelogSyncSubscriberContext)===null||n===void 0||n.close(),w.label=2;case 2:return r=[],this._hasMore?(i=O.of(this._iid),s=i.cacheContext,o=i.connectionManager,!s.localCacheEnabled||o.isConnected&&!this._backgroundSync.completed?[3,4]:[4,kt(function(){return y(S,void 0,void 0,function(){return v(this,function(N){switch(N.label){case 0:return[4,this._getLocalChannels()];case 1:return r=N.sent(),[2]}})})})]):[3,8];case 3:return w.sent(),this._hasMore=r.length>=this._limit,[3,7];case 4:return w.trys.push([4,6,,7]),[4,this._getRemoteChannels()];case 5:return r=w.sent(),this._isGetRemoteChannelsSucceeded=!0,[3,7];case 6:return w.sent(),this._isGetRemoteChannelsSucceeded=!1,[3,7];case 7:this._addChannelsToView(r,{source:G.REQUEST_CHANNEL},!0),w.label=8;case 8:if(t){try{for(a=pe(t.updatedChannels),l=a.next();!l.done;l=a.next())u=l.value,(g=yh(r,u))>=0?r[g]=u:(c=my(r,u,this.order).place,r.splice(c,0,u))}catch(N){b={error:N}}finally{try{l&&!l.done&&(m=a.return)&&m.call(a)}finally{if(b)throw b.error}}d=r.map(function(N){return N.url});try{for(h=pe(t.deletedChannelUrls),f=h.next();!f.done;f=h.next())p=f.value,(g=d.indexOf(p))>=0&&(r.splice(g,1),d.splice(g,1))}catch(N){_={error:N}}finally{try{f&&!f.done&&(E=h.return)&&E.call(h)}finally{if(_)throw _.error}}}return[2,r]}})})},e.prototype.dispose=function(){var n,t,r;this._isDisposed||(this._isDisposed=!0,this.channels.length>0&&this.channels.splice(0,this.channels.length),(n=this._backgroundSync)===null||n===void 0||n.close(),(t=this._changelogSync)===null||t===void 0||t.close(),(r=this._changelogSyncSubscriberContext)===null||r===void 0||r.close(),Nn.of(this._iid).unsubscribeChannelEvent(this._key))},e}(),dR=function(e){function n(t){var r=this,i=t.token,s=t.limit,o=t.order,a=t.includeEmpty,l=t.membershipFilter,u=t.channelNameContainsFilter,c=t.channelUrlsFilter,d=t.customTypesFilter,h=t.customTypeStartsWithFilter,f=t.superChannelFilter,p=t.metadataOrderKeyFilter,g=t.metadataKey,b=t.metadataValues,m=t.metadataValueStartsWith,_=t.includeFrozen,E=t.includeMetaData;return(r=e.call(this)||this).method=Z.GET,r.path=sr,r.params=ye(Ie({token:i,limit:s,order:o,show_member:!0,show_read_receipt:!0,show_delivery_receipt:!0,show_empty:a,public_mode:ps.PUBLIC,public_membership_mode:l,name_contains:u,channel_urls:c,custom_types:d,custom_type_startswith:h,super_mode:f,metadata_order_key:p,metadata_key:g,metadata_values:b,metadata_value_startswith:m,show_frozen:_,show_metadata:E})),r}return T(n,e),n}(J),hR=function(e){function n(t,r){var i=e.call(this,t,r)||this;i.channels=[];var s=r.next,o=r.channels,a=r.ts;return i.token=s,o&&o.length>0&&(i.channels=o.map(function(l){return l.ts=a,new di(t,l)})),i.ts=typeof a=="number"?a:0,i}return T(n,e),n}(se);(function(e){e.ALL="all",e.JOINED="joined"})(uc||(uc={}));var fR=function(e){function n(t,r){var i,s,o,a,l,u,c,d,h,f,p,g,b,m,_=this;return(_=e.call(this,t,r)||this).includeEmpty=!1,_.includeFrozen=!0,_.includeMetaData=!0,_.channelUrlsFilter=null,_.customTypesFilter=null,_.customTypeStartsWithFilter=null,_.channelNameContainsFilter=null,_.membershipFilter=uc.ALL,_.superChannelFilter=Ur.ALL,_.metadataKey=null,_.metadataValues=null,_.metadataOrderKeyFilter=null,_.metadataValueStartsWith=null,_.order=sc.CHRONOLOGICAL,_.includeEmpty=(i=r.includeEmpty)!==null&&i!==void 0&&i,_.includeFrozen=(s=r.includeFrozen)===null||s===void 0||s,_.includeMetaData=(o=r.includeMetaData)===null||o===void 0||o,_.channelUrlsFilter=(a=r.channelUrlsFilter)!==null&&a!==void 0?a:null,_.customTypesFilter=(l=r.customTypesFilter)!==null&&l!==void 0?l:null,_.customTypeStartsWithFilter=(u=r.customTypeStartsWithFilter)!==null&&u!==void 0?u:null,_.channelNameContainsFilter=(c=r.channelNameContainsFilter)!==null&&c!==void 0?c:null,_.membershipFilter=(d=r.membershipFilter)!==null&&d!==void 0?d:uc.ALL,_.superChannelFilter=(h=r.superChannelFilter)!==null&&h!==void 0?h:Ur.ALL,_.metadataKey=(f=r.metadataKey)!==null&&f!==void 0?f:null,_.metadataValues=(p=r.metadataValues)!==null&&p!==void 0?p:null,_.metadataOrderKeyFilter=(g=r.metadataOrderKeyFilter)!==null&&g!==void 0?g:null,_.metadataValueStartsWith=(b=r.metadataValueStartsWith)!==null&&b!==void 0?b:null,_.order=(m=r.order)!==null&&m!==void 0?m:sc.CHRONOLOGICAL,_}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)&&R("boolean",this.includeEmpty)&&R("boolean",this.includeFrozen)&&R("boolean",this.includeMetaData)&&R("string",this.channelNameContainsFilter,!0)&&We("string",this.channelUrlsFilter,!0)&&We("string",this.customTypesFilter,!0)&&R("string",this.customTypeStartsWithFilter,!0)&&$e(uc,this.membershipFilter)&&$e(Ur,this.superChannelFilter)&&$e(sc,this.order)&&R("string",this.metadataOrderKeyFilter,!0)&&R("string",this.metadataKey,!0)&&We("string",this.metadataValues,!0)&&R("string",this.metadataValueStartsWith,!0)},n.prototype.next=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:return this._validate()?this._isLoading?[3,3]:(t=[],this._hasNext?(this._isLoading=!0,r=O.of(this._iid).requestQueue,i=new dR(Ie(x(x({},this),{token:this._token}))),[4,r.send(i)]):[3,2]):[3,5];case 1:return s=u.sent(),o=s.as(hR),a=o.channels,l=o.token,this._token=l,this._hasNext=!!l,this._isLoading=!1,[2,a];case 2:return[2,t];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Uo),iv=function(e){function n(t){t===void 0&&(t={});var r=e.call(this)||this;return Object.keys(t).forEach(function(i){r.hasOwnProperty(i)&&(r[i]=t[i])}),r}return T(n,e),n}(function(e){function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.onUserJoined=qe,t.onUserLeft=qe,t.onUserReceivedInvitation=qe,t.onUserDeclinedInvitation=qe,t.onChannelHidden=qe,t.onUnreadMemberStatusUpdated=qe,t.onUndeliveredMemberStatusUpdated=qe,t.onTypingStatusUpdated=qe,t.onPollUpdated=qe,t.onPollVoted=qe,t.onPollDeleted=qe,t.onPinnedMessageUpdated=qe,t}return T(n,e),n}(aR)),pR=function(e){function n(t){var r=this,i=t.token,s=t.limit,o=t.order,a=t.reverse,l=t.channelUrl,u=t.messageTypeFilter,c=t.scheduledStatus;return(r=e.call(this)||this).method=Z.GET,r.path="".concat(cC),r.params=ye(Ie({token:i,limit:s,reverse:a,channel_url:l,order:o,message_type:u,status:c})),r}return T(n,e),n}(J),_R=function(e){function n(t,r){var i=e.call(this,t,r)||this;i.scheduledMessages=[];var s=r.next,o=r.scheduled_messages;return i.token=s,i.scheduledMessages=o.map(function(a){return yr(t,a)}),i}return T(n,e),n}(se),mR=function(e){function n(t,r){var i,s,o,a,l,u=this;return(u=e.call(this,t,r)||this).channelUrl=null,u.order=null,u.reverse=!1,u.scheduledStatus=null,u.messageTypeFilter=tr.ALL,u.channelUrl=(i=r.channelUrl)!==null&&i!==void 0?i:null,u.order=(s=r.order)!==null&&s!==void 0?s:null,u.reverse=(o=r.reverse)!==null&&o!==void 0&&o,u.scheduledStatus=(a=r.scheduledStatus)!==null&&a!==void 0?a:null,u.messageTypeFilter=(l=r.messageTypeFilter)!==null&&l!==void 0?l:tr.ALL,u}return T(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)&&R("string",this.channelUrl,!0)&&($e(gm,this.order)||this.order===null)&&R("boolean",this.reverse)&&(We(uo,this.scheduledStatus)||this.scheduledStatus===null)&&$e(tr,this.messageTypeFilter)},n.prototype.next=function(){return y(this,void 0,void 0,function(){var t,r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,t=O.of(this._iid).requestQueue,r=new pR(Ie(x(x({},this),{token:this._token}))),[4,t.send(r)]):[3,2]:[3,5];case 1:return i=l.sent(),s=i.as(_R),o=s.scheduledMessages,a=s.token,this._token=a,this._hasNext=!!a,this._isLoading=!1,[2,o];case 2:return[2,[]];case 3:throw L.queryInProgress;case 4:return[3,6];case 5:throw L.invalidParameters;case 6:return[2]}})})},n}(Uo),gR=function(e){function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.name="groupChannel",t}return T(n,e),n.prototype.init=function(t,r){var i=r.sdkState,s=r.dispatcher,o=r.sessionManager,a=r.requestQueue,l=r.logger,u=r.onlineDetector,c=r.cacheContext;e.prototype.init.call(this,t,{sdkState:i,dispatcher:s,sessionManager:o,requestQueue:a,logger:l,onlineDetector:u,cacheContext:c}),this._manager=new Nn(t,{sdkState:i,cacheContext:c,dispatcher:s,sessionManager:o,requestQueue:a,logger:l})},n.prototype.createGroupChannelCollection=function(t){return t===void 0&&(t={}),new cR(this._iid,t)},n.prototype.createMyGroupChannelListQuery=function(t){return t===void 0&&(t={}),new RS(this._iid,t)},n.prototype.createPublicGroupChannelListQuery=function(t){return t===void 0&&(t={}),new fR(this._iid,t)},n.prototype.createScheduledMessageListQuery=function(t){return t===void 0&&(t={}),new mR(this._iid,t)},n.prototype.addGroupChannelHandler=function(t,r){Y(R("string",t)&&r instanceof iv).throw(L.invalidParameters),this._manager.addHandler(t,r)},n.prototype.removeGroupChannelHandler=function(t){Y(R("string",t)).throw(L.invalidParameters),this._manager.removeHandler(t)},n.prototype.removeAllGroupChannelHandlers=function(){this._manager.clearHandler()},n.prototype.buildGroupChannelFromSerializedData=function(t){return this._manager.buildGroupChannelFromSerializedData(t)},n.prototype.buildGroupChannelListQueryFromSerializedData=function(t){return this._manager.buildGroupChannelListQueryFromSerializedData(t)},n.prototype.buildMemberFromSerializedData=function(t){return this._manager.buildMemberFromSerializedData(t)},n.prototype.getChannel=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){return Y(R("string",t)).throw(L.invalidParameters),[2,this._manager.getChannel(t)]})})},n.prototype.getChannelWithoutCache=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){return Y(R("string",t)).throw(L.invalidParameters),[2,this._manager.getChannelWithoutCache(t)]})})},n.prototype.getMyGroupChannelChangeLogsByToken=function(t,r){return r===void 0&&(r={}),y(this,void 0,void 0,function(){var i;return v(this,function(s){switch(s.label){case 0:return i=x(x({},_f),r),Y(R("string",t)&&ym(i)).throw(L.invalidParameters),[4,this._manager.getMyGroupChannelChangeLogs(t,i)];case 1:return[2,s.sent()]}})})},n.prototype.getMyGroupChannelChangeLogsByTimestamp=function(t,r){return r===void 0&&(r={}),y(this,void 0,void 0,function(){var i;return v(this,function(s){switch(s.label){case 0:return i=x(x({},_f),r),Y(R("number",t)&&ym(i)).throw(L.invalidParameters),[4,this._manager.getMyGroupChannelChangeLogs(t,i)];case 1:return[2,s.sent()]}})})},n.prototype.getGroupChannelCount=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){return r=x(x({},OS),t),Y(kS(r)).throw(L.invalidParameters),[2,this._manager.getGroupChannelCount(r)]})})},n.prototype.getUnreadItemCount=function(t){return t===void 0&&(t={}),y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return[4,this._manager.getUnreadItemCount(t)];case 1:return[2,r.sent()]}})})},n.prototype.getTotalUnreadChannelCount=function(){return y(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return[4,this._manager.getTotalUnreadChannelCount()];case 1:return[2,t.sent()]}})})},n.prototype.getTotalUnreadMessageCount=function(t){return t===void 0&&(t={}),y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return[4,this._manager.getTotalUnreadMessageCount(t)];case 1:return[2,r.sent()]}})})},n.prototype.getTotalScheduledMessageCount=function(t){return t===void 0&&(t={}),y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return[4,this._manager.getTotalScheduledMessageCount(t)];case 1:return[2,r.sent()]}})})},n.prototype.getSubscribedTotalUnreadMessageCount=function(){return this._manager.getSubscribedTotalUnreadMessageCount()},n.prototype.getSubscribedCustomTypeTotalUnreadMessageCount=function(){return this._manager.getSubscribedCustomTypeTotalUnreadMessageCount()},n.prototype.getSubscribedCustomTypeUnreadMessageCount=function(t){return this._manager.getSubscribedCustomTypeUnreadMessageCount(t)},n.prototype.createChannel=function(t){return t===void 0&&(t={}),y(this,void 0,void 0,function(){var r;return v(this,function(i){return r=x(x({},gh),t),Y(vm(r)).throw(L.invalidParameters),[2,this._manager.createChannel(r)]})})},n.prototype.createDistinctChannelIfNotExist=function(t){return t===void 0&&(t={}),y(this,void 0,void 0,function(){var r;return v(this,function(i){return r=x(x({},gh),t),Y(vm(r)).throw(L.invalidParameters),r&&(r.isDistinct=!0),[2,this.createChannel(r)]})})},n.prototype.createChannelWithUserIds=function(t,r,i,s,o,a){return r===void 0&&(r=!1),o===void 0&&(o=""),a===void 0&&(a=""),y(this,void 0,void 0,function(){var l;return v(this,function(u){return l=x(x({},gh),{invitedUserIds:t,isDistinct:r,name:i,data:o,customType:a}),typeof s=="string"?l.coverUrl=s:l.coverImage=s,[2,this.createChannel(l)]})})},n.prototype.markAsReadAll=function(){return y(this,void 0,void 0,function(){return v(this,function(t){return this._manager.markAsReadAll(),[2]})})},n.prototype.markAsReadWithChannelUrls=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){return Y(We("string",t)).throw(L.invalidParameters),this._manager.markAsReadWithChannelUrls(t),[2]})})},n.prototype.markAsDelivered=function(t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return Y(R("string",t)).throw(L.invalidParameters),[4,this.getChannel(t)];case 1:return[4,r.sent().markAsDelivered()];case 2:return r.sent(),[2]}})})},n}(Zg);const gf={collection:{groupChannel:{defaultLimit:20,defaultOrder:jt.LATEST_LAST_MESSAGE,defaultIncludeEmpty:!1},message:{defaultLimit:{next:25,prev:25},searchLimit:{next:10,prev:10}}}};var vR=function(e,n,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((r=r.apply(e,n||[])).next())})};const yR=(e,n)=>{D.useEffect(LS(e),n)},ER=(e,n)=>{D.useLayoutEffect(LS(e),n)},kp=e=>e(),LS=e=>()=>{const n=kp(e);return()=>{n&&(n instanceof Promise?kp(()=>vR(void 0,void 0,void 0,function*(){const t=yield n;t&&t()})):kp(n))}};let bR=0;function CR(){return D.useState(()=>`${bR++}`)[0]}const DS=(e,n,t)=>{const r=D.useRef(n),s=CR();r.current=n,D.useEffect(()=>{var o;const a=l=>(Object.keys(l).forEach(c=>{l[c]=(...d)=>{var h,f;return(f=(h=r.current)===null||h===void 0?void 0:h[c])===null||f===void 0?void 0:f.call(h,...d)}}),l);return(o=e==null?void 0:e.groupChannel)===null||o===void 0||o.addGroupChannelHandler(s,a(new iv)),()=>{var l;(l=e==null?void 0:e.groupChannel)===null||l===void 0||l.removeGroupChannelHandler(s)}},[e==null?void 0:e.groupChannel,s])};function fn(e){const n=D.useRef(e);return n.current=e,D.useCallback((...t)=>n.current(...t),[n])}var SR=function(e){function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.name="poll",t}return T(n,e),n.prototype.init=function(t,r){var i=r.sdkState,s=r.dispatcher,o=r.sessionManager,a=r.requestQueue,l=r.logger,u=r.onlineDetector,c=r.cacheContext;e.prototype.init.call(this,t,{sdkState:i,dispatcher:s,sessionManager:o,requestQueue:a,logger:l,onlineDetector:u,cacheContext:c}),this._manager=new of(t,{sdkState:i,dispatcher:s,sessionManager:o,requestQueue:a,logger:l,onlineDetector:u,cacheContext:c})},n.prototype.create=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){return r=x(x({},$6),t),Y(YC(r)).throw(L.invalidParameters),[2,this._manager.create(r)]})})},n.prototype.get=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){return r=x(x({},z6),t),Y(XC(r)).throw(L.invalidParameters),[2,this._manager.get(r)]})})},n.prototype.getOption=function(t){return y(this,void 0,void 0,function(){var r;return v(this,function(i){return r=x(x({},G6),t),Y(ZC(r)).throw(L.invalidParameters),[2,this._manager.getOption(r)]})})},n.prototype.buildPollFromSerializedData=function(t){return this._manager.buildPollFromSerializedData(t)},n}(Zg),TR=function(e){return["-lastMessageUpdatedAt","-createdAt","syncIndex"]},vy=function(e){function n(){return e!==null&&e.apply(this,arguments)||this}return T(n,e),n}(Tt),US=function(e){this.key=e.key,this.url=e.url},PS=function(e){this.id=e.id,this.name=e.name,this.url=e.url,this.emojis=e.emojis?e.emojis.map(function(n){return new US(n)}):[]},wR=function(e){this.emojiHash=e.emoji_hash||"",this.emojiCategories=e.emoji_categories?e.emoji_categories.map(function(n){return new PS(n)}):[]},NR={profileImage:void 0,profileUrl:void 0,nickname:void 0},yy=function(e){return function(n,t){return y(void 0,void 0,void 0,function(){var r,i,s,o;return v(this,function(a){switch(a.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]}return[3,11];case 1:return t(),[3,12];case 2:return[4,e.store.clear()];case 3:return a.sent(),t(),[3,12];case 4:return a.trys.push([4,9,,10]),r=function(l){return{v2:function(){return y(void 0,void 0,void 0,function(){return v(this,function(u){switch(u.label){case 0:return[4,l.commitSchema([{collectionName:yS,keyName:bx,index:[mh(jt.LATEST_LAST_MESSAGE),mh(jt.CHRONOLOGICAL),mh(jt.CHANNEL_NAME_ALPHABETICAL)]},{collectionName:fm,keyName:Cx,index:[cs(Vn.CHANNEL_LATEST),cs(Vn.NEWEST_CHILD_MESSAGE)]},{collectionName:SS,keyName:sO,index:[cs(Vn.CHANNEL_LATEST),cs(Vn.NEWEST_CHILD_MESSAGE)]},{collectionName:Tx,keyName:wx}])];case 1:return[2,u.sent()]}})})},v3:function(){return y(void 0,void 0,void 0,function(){return v(this,function(u){switch(u.label){case 0:return[4,l.commitSchema([{collectionName:Nx,keyName:Ix,index:[TR()]}])];case 1:return[2,u.sent()]}})})},v4:function(){return y(void 0,void 0,void 0,function(){return v(this,function(u){switch(u.label){case 0:return[4,l.commitSchema([{collectionName:bS,keyName:Sx,index:[eO()]}])];case 1:return[2,u.sent()]}})})}}}(e),i=r.v2,s=r.v3,o=r.v4,[4,i()];case 5:return a.sent(),[4,s()];case 6:return a.sent(),[4,o()];case 7:return a.sent(),[4,e.collection(fm).removeIf({where:{channelType:Ze.OPEN}})];case 8:case 9:return a.sent(),[3,10];case 10:return t(),[3,12];case 11:t(),a.label=12;case 12:return[2]}})})}},IR=function(){return typeof document<"u"?document.visibilityState:"visible"},AR=function(e){function n(t){var r=t.getVisibilityState,i=r===void 0?IR:r,s=t.initialState,o=s===void 0?"visible":s,a=t.isEnabled,l=a===void 0||a,u=t.pauseCheckDelay,c=u===void 0?3e4:u,d=e.call(this)||this;return d._pauseCheckDelay=3e4,d._currentState="visible",d._getVisibilityState=i,d._pauseCheckDelay=c,d._currentState=o,d._isEnabled=l,d._boundToggleState=d._toggleState.bind(d),d}return T(n,e),Object.defineProperty(n.prototype,"currentState",{get:function(){return this._currentState},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isAvailable",{get:function(){return typeof window<"u"&&!!window.addEventListener&&!!window.removeEventListener},enumerable:!1,configurable:!0}),n.prototype._toggleState=function(){var t=this,r=this._getVisibilityState();r!=="hidden"?this._currentState==="hidden"&&(this._pauseDelayTimer&&(clearTimeout(this._pauseDelayTimer),this._pauseDelayTimer=void 0),this.dispatch("resume")):this._currentState!=="hidden"&&(this._pauseDelayTimer=setTimeout(function(){t._pauseDelayTimer=void 0,t.dispatch("pause")},this._pauseCheckDelay)),this._currentState=r},n.prototype.start=function(){this._isEnabled&&this.isAvailable&&(this._boundToggleState=this._toggleState.bind(this),window.addEventListener("visibilitychange",this._boundToggleState,{capture:!0}))},n.prototype.stop=function(){this._isEnabled&&this.isAvailable&&this._boundToggleState&&window.removeEventListener("visibilitychange",this._boundToggleState,{capture:!0})},n}(La),MR=function(){function e(n){var t=n.logger,r=n.connectionDelegate,i=r===void 0?null:r,s=this;this._onlineWorker=function(){var o;return(o=s.connectionDelegate)===null||o===void 0?void 0:o.reconnect()},this._offlineWorker=function(){var o;return(o=s.connectionDelegate)===null||o===void 0?void 0:o.disconnect()},this.unsubscribes=[],this._onlineListener=function(o){if(s.isAvailableOnWeb)return window.addEventListener("online",o),function(){return window.removeEventListener("online",o,!1)}},this._offlineListener=function(o){if(s.isAvailableOnWeb)return window.addEventListener("offline",o),function(){return window.removeEventListener("offline",o,!1)}},this.logger=t,i&&(this.connectionDelegate=i)}return Object.defineProperty(e.prototype,"isAvailableOnWeb",{get:function(){return typeof window<"u"&&!!window.addEventListener&&"ononline"in window&&"onoffline"in window&&typeof navigator<"u"&&navigator.onLine!==void 0},enumerable:!1,configurable:!0}),e.prototype.setOnlineListener=function(n){n&&typeof n=="function"&&(this._onlineListener=n)},e.prototype.setOfflineListener=function(n){n&&typeof n=="function"&&(this._offlineListener=n)},e.prototype.start=function(){this.unsubscribes=[this._onlineListener(this._onlineWorker),this._offlineListener(this._offlineWorker)]},e.prototype.stop=function(){var n=this;this.unsubscribes.forEach(function(t){try{t==null||t()}catch(r){n.logger.warn(r.message)}}),this.unsubscribes=[]},e.prototype.isOnline=function(){return y(this,void 0,void 0,function(){return v(this,function(n){return this.isAvailableOnWeb?[2,navigator.onLine]:[2,new Promise(function(t){fetch("https://www.google.com",{method:Z.GET,mode:"no-cors"}).then(function(){return t(!0)}).catch(function(){return t(!1)})})]})})},e}(),Ey=function(e){function n(t){var r=t.userId,i=t.nickname,s=t.profileUrl,o=t.profileImage,a=t.preferredLanguages,l=e.call(this)||this;return l.method=Z.PUT,l.path="".concat(Xe,"/").concat(encodeURIComponent(r)),l.params=ye(Ie({nickname:i,profile_url:s,profile_file:o,preferred_languages:a})),l}return T(n,e),n}(J),by=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.user=new Ke(t,x({},r)),i}return T(n,e),n}(se),xR=function(e){function n(t){var r=t.userId,i=t.token,s=t.deviceOS,o=t.deviceManufacturer,a=t.systemPushEnabled,l=e.call(this)||this;return l.method=Z.POST,l.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push/apns"),l.params=ye({apns_device_token:i,always_push:!0,device_os:s,device_manufacturer:o,system_push_enabled:a}),l}return T(n,e),n}(J);(function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.token=r.token,i.type=r.type?In[r.type.toLowerCase()]:In.UNKNOWN,i.user=new Ke(t,r.user),i}T(n,e)})(se);var OR=function(e){function n(t){var r=t.userId,i=t.token,s=t.deviceOS,o=t.deviceManufacturer,a=t.systemPushEnabled,l=e.call(this)||this;return l.method=Z.POST,l.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push/gcm"),l.params=ye({gcm_reg_token:i,always_push:!0,device_os:s,device_manufacturer:o,system_push_enabled:a}),l}return T(n,e),n}(J);(function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.token=r.token,i.type=r.type?In[r.type.toLowerCase()]:In.UNKNOWN,i.user=new Ke(t,r.user),i}T(n,e)})(se);var kR=function(e){function n(t){var r=t.userId,i=t.token,s=e.call(this)||this;return s.method=Z.DELETE,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push/apns/").concat(encodeURIComponent(i)),s}return T(n,e),n}(J);(function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.token=r.token,i.user=new Ke(t,r.user),i.lastDeletedAt=r.device_token_last_deleted_at,i}T(n,e)})(se);var RR=function(e){function n(t){var r=t.userId,i=t.token,s=e.call(this)||this;return s.method=Z.DELETE,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push/gcm/").concat(encodeURIComponent(i)),s}return T(n,e),n}(J);(function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.token=r.token,i.user=new Ke(t,r.user),i.lastDeletedAt=r.device_token_last_deleted_at,i}T(n,e)})(se);var LR=function(e){function n(t){var r=t.userId,i=e.call(this)||this;return i.method=Z.DELETE,i.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push/apns"),i}return T(n,e),n}(J);(function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.type=r.type?In[r.type.toLowerCase()]:In.UNKNOWN,i.user=new Ke(t,r.user),i.lastDeletedAt=r.device_token_last_deleted_at,i}T(n,e)})(se);var DR=function(e){function n(t){var r=t.userId,i=e.call(this)||this;return i.method=Z.DELETE,i.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push/gcm"),i}return T(n,e),n}(J);(function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.type=r.type?In[r.type.toLowerCase()]:In.UNKNOWN,i.user=new Ke(t,r.user),i.lastDeletedAt=r.device_token_last_deleted_at,i}T(n,e)})(se);var UR=function(e){function n(t){var r=t.userId,i=t.type,s=t.token,o=t.ts,a=e.call(this)||this;return a.method=Z.GET,a.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push/").concat(encodeURIComponent(i),"/device_tokens"),a.params={created_ts:o,token:s},a}return T(n,e),n}(J),PR=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.pushTokens={type:r.type?In[r.type.toLowerCase()]:In.UNKNOWN,deviceTokens:r.device_tokens,hasMore:r.has_more,token:r.token},i}return T(n,e),n}(se),FR=function(e){function n(t){var r=t.userId,i=e.call(this)||this;return i.method=Z.GET,i.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/channel_invitation_preference"),i}return T(n,e),n}(J),HR=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.autoAccept=r.auto_accept,i}return T(n,e),n}(se),jR=function(e){function n(t){var r=t.userId,i=t.willAutoAccept,s=e.call(this)||this;return s.method=Z.PUT,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/channel_invitation_preference"),s.params={auto_accept:i},s}return T(n,e),n}(J),BR=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.autoAccept=r.auto_accept,i}return T(n,e),n}(se),$R=function(e){function n(t){var r=t.userId,i=e.call(this)||this;return i.method=Z.GET,i.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push_preference"),i}return T(n,e),n}(J),GR=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.preference={doNotDisturbOn:r.do_not_disturb,startHour:r.start_hour,startMin:r.start_min,endHour:r.end_hour,endMin:r.end_min,timezone:r.timezone},i}return T(n,e),n}(se),zR=function(e){function n(t){var r=t.userId,i=t.doNotDisturbOn,s=t.startHour,o=t.startMin,a=t.endHour,l=t.endMin,u=t.timezone,c=e.call(this)||this;return c.method=Z.PUT,c.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push_preference"),c.params={do_not_disturb:i,start_hour:s,start_min:o,end_hour:a,end_min:l,timezone:u},c}return T(n,e),n}(J),VR=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.preference={doNotDisturbOn:r.do_not_disturb,startHour:r.start_hour,startMin:r.start_min,endHour:r.end_hour,endMin:r.end_min,timezone:r.timezone},i}return T(n,e),n}(se),qR=function(e){function n(t){var r=t.userId,i=e.call(this)||this;return i.method=Z.GET,i.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push_preference"),i}return T(n,e),n}(J),WR=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.snoozePeriod={isSnoozeOn:r.snooze_enabled},typeof r.snooze_start_ts=="number"&&(i.snoozePeriod.startTs=r.snooze_start_ts),typeof r.snooze_end_ts=="number"&&(i.snoozePeriod.endTs=r.snooze_end_ts),i}return T(n,e),n}(se),KR=function(e){function n(t){var r=t.userId,i=t.snoozeOn,s=t.startTs,o=t.endTs,a=e.call(this)||this;return a.method=Z.PUT,a.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push_preference"),a.params={snooze_enabled:i,snooze_start_ts:s,snooze_end_ts:o},a}return T(n,e),n}(J),QR=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.snoozePeriod={isSnoozeOn:r.snooze_enabled},typeof r.snooze_start_ts=="number"&&(i.snoozePeriod.startTs=r.snooze_start_ts),typeof r.snooze_end_ts=="number"&&(i.snoozePeriod.endTs=r.snooze_end_ts),i}return T(n,e),n}(se),YR=function(e){function n(t){var r=t.userId,i=t.blockedUserId,s=e.call(this)||this;return s.method=Z.POST,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/block"),s.params={target_id:i},s}return T(n,e),n}(J);(function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.user=new Ke(t,r),i}T(n,e)})(se);var ZR=function(e){function n(t){var r=t.userId,i=t.unblockedUserId,s=e.call(this)||this;return s.method=Z.DELETE,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/block/").concat(encodeURIComponent(i)),s}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var XR=function(e){function n(t){var r=t.userId,i=e.call(this)||this;return i.method=Z.GET,i.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push_preference"),i}return T(n,e),n}(J),JR=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.pushTriggerOption=r.push_trigger_option,i}return T(n,e),n}(se),eL=function(e){function n(t){var r=t.userId,i=t.pushTriggerOption,s=e.call(this)||this;return s.method=Z.PUT,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push_preference"),s.params={push_trigger_option:i},s}return T(n,e),n}(J),tL=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.pushTriggerOption=r.push_trigger_option,i}return T(n,e),n}(se),nL=function(e){function n(t){var r=t.userId,i=e.call(this)||this;return i.method=Z.GET,i.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push/template"),i}return T(n,e),n}(J),rL=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.name=r.name,i}return T(n,e),n}(se),iL=function(e){function n(t){var r=t.userId,i=t.templateName,s=e.call(this)||this;return s.method=Z.PUT,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/push/template"),s.params={name:i},s}return T(n,e),n}(J),sL=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.name=r.name,i}return T(n,e),n}(se),oL=function(e){function n(t){var r=t.userId,i=t.token,s=e.call(this)||this;return s.method=Z.GET,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/friends/changelogs"),s.params={token:i},s}return T(n,e),n}(J),aL=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.changelogs={addedUsers:r.added.map(function(s){return new Ke(t,s)}),updatedUsers:r.updated.map(function(s){return new Ke(t,s)}),deletedUserIds:r.deleted,hasMore:r.has_more,token:r.next},i}return T(n,e),n}(se),lL=function(e){function n(t){var r=t.userId,i=t.discoveries,s=e.call(this)||this;return s.method=Z.PUT,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/friend_discoveries"),s.params={friend_discoveries:i.map(function(o){return{friend_discovery_key:o.friendDiscoveryKey,friend_name:o.friendName}})},s}return T(n,e),n}(J),uL=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.friendDiscoveryRequestId=r.friend_discovery_request_id,i}return T(n,e),n}(se),cL=function(e){function n(t){var r=t.userId,i=t.discoveryKeys,s=e.call(this)||this;return s.method=Z.DELETE,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/friend_discoveries"),s.params={friend_discovery_keys:i},s}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var dL=function(e){function n(t){var r=t.userId,i=t.userIds,s=e.call(this)||this;return s.method=Z.POST,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/friends"),s.params={user_ids:i},s}return T(n,e),n}(J),hL=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.users=r.users.map(function(s){return new Ke(t,s)}),i}return T(n,e),n}(se),fL=function(e){function n(t){var r=t.userId,i=t.userIds,s=e.call(this)||this;return s.method=Z.DELETE,s.path="".concat(Xe,"/").concat(encodeURIComponent(r),"/friends"),s.params={user_ids:i},s}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var pL=function(e){function n(t){var r=t.userId,i=e.call(this)||this;return i.method=Z.GET,i.path="".concat(Xe,"/").concat(r,"/allow_friend_discovery"),i.params={},i}return T(n,e),n}(J),_L=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.allowFriendDiscovery=r.allow_friend_discovery,i}return T(n,e),n}(se),mL=function(e){function n(t){var r=t.userId,i=t.allowFriendDiscovery,s=e.call(this)||this;return s.method=Z.PUT,s.path="".concat(Xe,"/").concat(r,"/allow_friend_discovery"),s.params={allow_friend_discovery:i},s}return T(n,e),n}(J);(function(e){function n(){return e!==null&&e.apply(this,arguments)||this}T(n,e)})(se);var vf,gL=function(e){function n(){var t=e.call(this)||this;return t.method=Z.GET,t.path=uC,t}return T(n,e),n}(J),vL=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.emojiContainer=new wR(r),i}return T(n,e),n}(se),yL=function(e){function n(t){var r=t.categoryId,i=e.call(this)||this;return i.method=Z.GET,i.path="".concat(uC,"/").concat(r),i}return T(n,e),n}(J),EL=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.emojiCategory=new PS(r),i}return T(n,e),n}(se),bL=function(e){function n(t){var r=t.key,i=e.call(this)||this;return i.method=Z.GET,i.path="".concat(X4,"/").concat(r),i}return T(n,e),n}(J),CL=function(e){function n(t,r){var i=e.call(this,t,r)||this;return i.emoji=new US(r),i}return T(n,e),n}(se),SL=function(e){function n(){var t=e.call(this)||this;return t.method=Z.GET,t.path="".concat(J4),t}return T(n,e),n}(J),TL=function(e){function n(t,r){var i,s=this,o=r??{};return(s=e.call(this,t,r)||this).uikitConfiguration={string:JSON.stringify(o),json:o},s.updatedAt=(i=r==null?void 0:r.updated_at)!==null&&i!==void 0?i:0,s}return T(n,e),n}(se);(function(e){e.DELIVERED="DELIVERED",e.CLICKED="CLICKED"})(vf||(vf={}));var du,Cy=function(e){function n(t){var r=t.deviceToken,i=t.pushTrackingId,s=t.messageId,o=t.allowedPushNotification,a=t.channelKey,l=t.templateKey,u=t.eventType,c=t.notificationEventDeadline,d=e.call(this)||this;return d.method=Z.POST,d.path=tA,d.params=ye({device_token:r,push_tracking_id:i,message_id:s,allowed_push_notification:o,channel_key:a,template_key:l,event_type:u,notification_event_deadline:c}),d}return T(n,e),n}(J),wL=function(){function e(n,t,r){var i=this;this._storeInitialized=!1,this._iid=n,this.options=t;var s=O.of(n),o=s.sdkState,a=s.cacheContext,l=s.dispatcher,u=s.sessionManager,c=s.requestQueue,d=s.logger,h=s.userEventHandlers,f=s.appStateToggleEnabled;this._onlineDetector=new MR({logger:d,connectionDelegate:{reconnect:function(){return y(i,void 0,void 0,function(){var g,b,m,_,E,S;return v(this,function(w){switch(w.label){case 0:if(g=O.of(n),b=g.sdkState,m=g.connectionManager,(_=g.sessionManager).session.hasSession)return[3,5];w.label=1;case 1:return w.trys.push([1,3,,4]),[4,m.connect(_.session.authToken)];case 2:return w.sent(),[3,4];case 3:if(E=w.sent(),Lr(E))throw E;return d.debug("connect failed by reconnect event = ",E),[3,4];case 4:return[3,9];case 5:if(b.appState!=="foreground")return[3,9];w.label=6;case 6:return w.trys.push([6,8,,9]),[4,m.resetAndReconnect()];case 7:return w.sent(),[3,9];case 8:if(S=w.sent(),Lr(S))throw S;return d.debug("resetAndReconnect failed by reconnect event = ",S),[3,9];case 9:return l.dispatch(new vy),[2]}})})},disconnect:function(){kt(function(){return y(i,void 0,void 0,function(){return v(this,function(g){switch(g.label){case 0:return[4,O.of(n).connectionManager.disconnect()];case 1:return g.sent(),[2]}})})})}}});var p=new Mu(n,{localCacheEnabled:a.localCacheEnabled,enableAutoResend:a.localCacheConfig.enableAutoResend,dispatcher:l,sdkState:o,logger:d});r.forEach(function(g){g.init(n,{sdkState:o,cacheContext:a,dispatcher:l,sessionManager:u,requestQueue:c,logger:d,onlineDetector:i._onlineDetector}),i[g.name]=g}),this._appStateChangeDetector=new AR({isEnabled:f}),this._appStateChangeDetector.on("resume",function(){d.debug("the page resumes from freeze"),i.setForegroundState()}).on("pause",function(){d.debug("the page freezes"),i.setBackgroundState()}),l.on(function(g){var b;if(g instanceof _i)g.stateType===rt.CONNECTED&&p.processNonAutoResendRegisteredPendingMessages();else if(g instanceof gt){if(g.code==="USEV"){var m=g.as(MS).event;if(m.category===Uc.FRIEND_DISCOVERED){var _=ff.getDataAsFriendDiscoveredEvent(n,m).friendDiscoveries;Re(function(){return y(i,void 0,void 0,function(){return v(this,function(N){return[2,h.forEach(function(A){A.onFriendsDiscovered&&A.onFriendsDiscovered(_)})]})})})}}}else if(g instanceof LC){var E=O.of(i._iid).subscribedUnreadMessageCount,S=!1,w=g.ts;typeof w=="number"&&w>E.ts&&(E.all!==g.all&&(S=!0),E.all=g.all>=0?g.all:0,g.customTypes&&Object.keys(g.customTypes).forEach(function(N){E.customTypes[N]!==g.customTypes[N]&&(S=!0),E.customTypes[N]=g.customTypes[N]}),S=S&&E.ts>0,E.ts=w),S&&Re(function(){return y(i,void 0,void 0,function(){return v(this,function(N){return[2,h.forEach(function(A){A.onTotalUnreadMessageCountChanged&&A.onTotalUnreadMessageCountChanged({groupChannelCount:E.all,feedChannelCount:E.feed,customTypeUnreadCount:E.customTypes}),A.onTotalUnreadMessageCountUpdated&&A.onTotalUnreadMessageCountUpdated(E.all,E.customTypes)})]})})})}else g instanceof PC?(a.preference.set(i._getUserProfileCacheKey(o.userId),im.payloadify(g.userProfile)),!((b=g.userProfile.appInfo.notificationInfo)===null||b===void 0)&&b.isEnabled&&a.preference.set(Kg(i.appId),{value:!0})):g instanceof Ul&&g.error&&g.error.isSessionInvalidatedError&&(d.debug("session revoked."),i._internalDisconnect(g.error))})}return e.init=function(n){var t=n.appId,r=n.appVersion,i=n.modules,s=i===void 0?[]:i,o=n.options,a=o===void 0?new oC:o,l=n.debugMode,u=l!==void 0&&l,c=n.customApiHost,d=n.customWebSocketHost,h=n.newInstance,f=h!==void 0&&h,p=n.logLevel,g=n.localCacheEnabled,b=g!==void 0&&g,m=n.localCacheConfig,_=m===void 0?new lC:m,E=n.localCacheEncryption,S=n.useAsyncStorageStore,w=S===void 0?null:S,N=n.useMMKVStorageStore,A=N===void 0?null:N,k=n.appStateToggleEnabled,I=k===void 0||k;if(!du||f){var M="su-".concat(Bs()),U=E??{encrypt:function($){return $},decrypt:function($){return $}},z=new Jx;z.level=p??As.WARN;var H=new Zo({encryption:U});u||(J_()?A?H=new Zx({MMKV:A,encryption:U}):w&&(H=new Yx({AsyncStorage:w,encryption:U}),z.warn("AsyncStorage store is deprecated due to the small size limit. Please use MMKVStorage store instead.")):H=new Qx({encryption:U})),new O(M,{appId:t,appVersion:r,options:a,apiHost:c??"https://api-".concat(t,".sendbird.com"),websocketHost:d??"wss://ws-".concat(t,".sendbird.com"),store:H,encryption:U,logger:z,localCacheEnabled:b,localCacheConfig:_,debugMode:u,appStateToggleEnabled:I});var W=[new EO,new SR],Q=new e(M,a,De(De([],Ae(s),!1),Ae(W),!1));return du||(du=Q),Q}return du},Object.defineProperty(e,"instance",{get:function(){return du},enumerable:!1,configurable:!0}),Object.defineProperty(e,"version",{get:function(){return iC},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"appId",{get:function(){return O.of(this._iid).sdkState.appId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"appInfo",{get:function(){var n=O.of(this._iid).appInfo;return n??null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"appVersion",{get:function(){var n;return(n=O.of(this._iid).sdkState.appVersion)!==null&&n!==void 0?n:""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"debugMode",{get:function(){return!!O.of(this._iid).debugMode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"logLevel",{get:function(){return O.of(this._iid).logger.level},set:function(n){O.of(this._iid).logger.level=n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isCacheEnabled",{get:function(){return O.of(this._iid).cacheContext.localCacheEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localCacheConfig",{get:function(){var n=O.of(this._iid).cacheContext;return n.localCacheEnabled?n.localCacheConfig:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ekey",{get:function(){return O.of(this._iid).sessionManager.ekey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentUser",{get:function(){var n;return(n=O.of(this._iid).sessionManager.currentUser)!==null&&n!==void 0?n:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connectionState",{get:function(){var n=O.of(this._iid).connectionManager;return n.isConnected?as.OPEN:n.isConnecting?as.CONNECTING:as.CLOSED},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastConnectedAt",{get:function(){var n=O.of(this._iid),t=n.connectedAt;return n.connectionManager.isConnected?t:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fcmPushToken",{get:function(){var n;return(n=this._fcmPushToken)!==null&&n!==void 0?n:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"apnsPushToken",{get:function(){var n;return(n=this._apnsPushToken)!==null&&n!==void 0?n:null},enumerable:!1,configurable:!0}),e.prototype._getNestDBVersion=function(){return 7},e.prototype._getPreferenceCacheKey=function(n){return"sendbird@".concat(this.appId,"/").concat(n,".pref")},e.prototype._getUserProfileCacheKey=function(n){return"sendbird@".concat(this.appId,"/").concat(n,".profile")},e.prototype._internalDisconnect=function(n){return y(this,void 0,void 0,function(){var t,r,i,s;return v(this,function(o){switch(o.label){case 0:return t=O.of(this._iid),r=t.connectionManager,i=t.sdkState,s=t.requestQueue,this._appStateChangeDetector.stop(),this._onlineDetector.stop(),s.cancelAll(),[4,r.logout(n)];case 1:return o.sent(),[4,this.clearCachedData()];case 2:return o.sent(),i.appState="foreground",[2]}})})},e.prototype.getMemoryStoreForDebugging=function(){var n=O.of(this._iid),t=n.debugMode,r=n.cacheContext;if(t)return r.store instanceof Zo?r.store:null;throw L.debugModeRequired},e.prototype.addExtension=function(n,t){var r=O.of(this._iid).sdkState;["sb_uikit","sb_syncmanager","device-os-platform"].indexOf(n)>-1&&r.extensions&&(r.extensions[n]=t)},e.prototype.addSendbirdExtensions=function(n,t,r){var i,s,o=O.of(this._iid),a=o.logger,l=o.sdkState,u=new RegExp(oA);if(n.length===0)return a.debug("sb.addSendbirdExtensions() has failed because the given sendbirdExtensions is empty."),!1;if(n.find(function(g){return!u.test(g.version)}))return a.debug("sb.addSendbirdExtensions() has failed because the given version did not satisfy the SemVer specification."),!1;if(r)try{for(var c=pe(Object.entries(r)),d=c.next();!d.done;d=c.next()){var h=Ae(d.value,2),f=h[0],p=h[1];if(/&|=/.test(f)||/&|=/.test(p))return a.debug("sb.addSendbirdExtensions() has failed because the given customData includes at least one invalid character: = or &."),!1}}catch(g){i={error:g}}finally{try{d&&!d.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}return l.sendbirdRuntimeEnvironment={sendbirdExtensions:n,deviceOS:t,customData:r},!0},e.prototype.setOnlineListener=function(n){this._onlineDetector.setOnlineListener(n)},e.prototype.setOfflineListener=function(n){this._onlineDetector.setOfflineListener(n)},e.prototype._safeInitializeStore=function(n){return y(this,void 0,void 0,function(){var t;return v(this,function(r){switch(r.label){case 0:t=O.of(this._iid).cacheContext,r.label=1;case 1:return r.trys.push([1,3,,5]),[4,t.store.init(n)];case 2:return r.sent(),this._storeInitialized=!0,[3,5];case 3:return r.sent(),t.replaceStore(new Zo),[4,this._safeInitializeStore(n)];case 4:return r.sent(),[3,5];case 5:return[2]}})})},e.prototype.initializeCache=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l,u,c;return v(this,function(d){switch(d.label){case 0:if(t=O.of(this._iid),r=t.sdkState,i=t.cacheContext,s=t.dispatcher,o=t.logger,r.userId&&r.userId===n)return[3,11];if(a="sendbird@".concat(r.appId,"/").concat(n,".db"),!i.localCacheEnabled)return[3,9];d.label=1;case 1:return d.trys.push([1,6,,8]),i.nestdb&&i.nestdb.state!==ns.CLOSED&&i.nestdb.name===a?[3,3]:(l="sendbird@".concat(r.appId,"/").concat(n,".db"),(u=i.nestdb=new Xx({name:l,version:this._getNestDBVersion(),store:i.store,config:new Zc({dbname:l,itemSizeLimit:61440})})).on("upgrade",yy(u)),u.on("storeReplaced",function(h){i.replaceStore(h),i.localCacheEnabled=!1,u.on("upgrade",yy(u))}),[4,u.open()]);case 2:return d.sent(),this._storeInitialized=!0,s.dispatch(new IS(this._iid,{userId:n})),[3,5];case 3:return[4,this._safeInitializeStore(a)];case 4:d.sent(),d.label=5;case 5:return r.userId=n,[3,8];case 6:return c=d.sent(),o.warn("Nest DB Open Failed. ",c),i.store instanceof Zo||(i.replaceStore(new Zo),i.localCacheEnabled=!1),[4,this._safeInitializeStore(a)];case 7:throw d.sent(),r.userId=n,L.databaseError;case 8:return[3,11];case 9:return[4,this._safeInitializeStore(a)];case 10:d.sent(),r.userId=n,d.label=11;case 11:return[2]}})})},e.prototype.getCacheDataSize=function(){return y(this,void 0,void 0,function(){var n;return v(this,function(t){switch(t.label){case 0:return(n=O.of(this._iid).cacheContext).localCacheEnabled&&n.nestdb?[4,n.nestdb.estimateUsage()]:[3,2];case 1:return[2,t.sent()];case 2:return[2,0]}})})},e.prototype.clearCachedData=function(){return y(this,void 0,void 0,function(){var n;return v(this,function(t){switch(t.label){case 0:return(n=O.of(this._iid).cacheContext).localCacheEnabled&&n.nestdb?[4,n.nestdb.clear()]:[3,2];case 1:t.sent(),t.label=2;case 2:return this._storeInitialized?[4,n.preference.clear()]:[3,4];case 3:t.sent(),t.label=4;case 4:return[2]}})})},e.prototype.clearCachedMessages=function(n){return y(this,void 0,void 0,function(){var t,r,i=this;return v(this,function(s){switch(s.label){case 0:return Y(We("string",n)).throw(L.invalidParameters),t=Sl.of(this._iid),r=Aa.of(this._iid),t&&r?[4,Promise.all(n.map(function(o){return y(i,void 0,void 0,function(){return v(this,function(a){switch(a.label){case 0:return[4,t.removeMessagesOfChannel(o)];case 1:return a.sent(),[4,r.removeMessagesOfChannel(o)];case 2:return a.sent(),[2]}})})}))]:[3,2];case 1:s.sent(),s.label=2;case 2:return[2]}})})},e.prototype._setupPreference=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o;return v(this,function(a){switch(a.label){case 0:return t=O.of(this._iid),r=t.sdkState,i=t.cacheContext,s=t.statManager,[4,i.preference.init(this._getPreferenceCacheKey(n),this._getNestDBVersion())];case 1:return a.sent(),[4,i.preference.get(this._getUserProfileCacheKey(n))];case 2:return(o=a.sent())&&new im(this._iid,o).apply(),[4,s.init("sendbird@".concat(r.appId,"/").concat(n,".statlog"))];case 3:return a.sent(),[2]}})})},e.prototype._ready=function(n,t,r){return r===void 0&&(r={}),y(this,void 0,void 0,function(){var i,s,o,a,l,u;return v(this,function(c){switch(c.label){case 0:return Y(R("string",n)&&R("string",t,!0)).throw(L.invalidParameters),i=O.of(this._iid),s=i.sdkState,o=i.cacheContext,a=i.connectionManager,l=r.errorForOtherUser,s.userId&&s.userId!==n?l?[3,2]:[4,a.logout()]:[3,3];case 1:return c.sent(),[3,3];case 2:throw l;case 3:return c.trys.push([3,5,6,8]),[4,this.initializeCache(n)];case 4:return c.sent(),O.of(this._iid).dispatcher.dispatch(new AS),[3,8];case 5:return c.sent(),u=O.of(this._iid).logger,o.localCacheEnabled=!1,u.warn("Cache initialization failed - cache is not available."),[3,8];case 6:return[4,this._setupPreference(n)];case 7:return c.sent(),[7];case 8:return[2]}})})},e.prototype.authenticateFeed=function(n,t){var r;return y(this,void 0,void 0,function(){var i,s,o,a;return v(this,function(l){switch(l.label){case 0:return i=O.of(this._iid),s=i.sessionManager,o=i.connectionManager,[4,this._ready(n,t,{errorForOtherUser:o.isConnected?L.alreadyConnectedAsAnotherUser:void 0})];case 1:return l.sent(),!((r=s.session.services)===null||r===void 0)&&r.includes(xc.CHAT)?[3,3]:(t||s.handler||(a=new df,this.setSessionHandler(a)),[4,s.authenticateFeed(n,t)]);case 2:l.sent(),l.label=3;case 3:return[2,this.currentUser]}})})},e.prototype.connect=function(n,t){return y(this,void 0,void 0,function(){return v(this,function(r){switch(r.label){case 0:return[4,this._ready(n,t)];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,,4,5]),[4,O.of(this._iid).connectionManager.connect(t)];case 3:return r.sent(),[3,5];case 4:return this._onlineDetector.start(),this._appStateChangeDetector.start(),[7];case 5:return[2,this.currentUser]}})})},e.prototype.reconnect=function(){var n=O.of(this._iid),t=n.connectionManager,r=n.sdkState,i=n.sessionManager.session.hasSession;return i&&(this._appStateChangeDetector.start(),this._onlineDetector.start(),t.resetAndReconnect().then(function(){r.appState="foreground"}).catch(function(){})),i},e.prototype.disconnect=function(){return y(this,void 0,void 0,function(){return v(this,function(n){switch(n.label){case 0:return[4,this._internalDisconnect()];case 1:return n.sent(),[2]}})})},e.prototype.disconnectWebSocket=function(){return y(this,void 0,void 0,function(){var n,t,r;return v(this,function(i){switch(i.label){case 0:return n=O.of(this._iid),t=n.connectionManager,r=n.requestQueue,this._appStateChangeDetector.stop(),this._onlineDetector.stop(),r.cancelAll(),[4,t.disconnectWebSocket(!0)];case 1:return i.sent(),[2]}})})},e.prototype.setBackgroundState=function(){var n=O.of(this._iid),t=n.connectionManager,r=n.sdkState,i=n.logger;r.appState==="foreground"&&(r.appState="background",i.debug("going background state"),t.background().catch(function(s){i.debug("setBackgroundState error = ",s)}))},e.prototype.setForegroundState=function(){var n=O.of(this._iid),t=n.connectionManager,r=n.sdkState,i=n.dispatcher,s=n.logger;r.appState==="background"&&(r.appState="foreground",s.debug("going foreground state"),t.resetAndReconnect().catch(function(o){s.debug("setForgroundState error = ",o)}),i.dispatch(new vy))},e.prototype.setSessionHandler=function(n){Y(n instanceof df).throw(L.invalidParameters),O.of(this._iid).sessionManager.handler=n},e.prototype.addUserEventHandler=function(n,t){Y(R("string",n)&&t instanceof kx).throw(L.invalidParameters),O.of(this._iid).userEventHandlers.set(n,t)},e.prototype.removeUserEventHandler=function(n){O.of(this._iid).userEventHandlers.delete(n)},e.prototype.removeAllUserEventHandler=function(){O.of(this._iid).userEventHandlers.clear()},e.prototype.addConnectionHandler=function(n,t){Y(R("string",n)&&t instanceof CS).throw(L.invalidParameters),O.of(this._iid).connectionHandlers.set(n,t)},e.prototype.removeConnectionHandler=function(n){O.of(this._iid).connectionHandlers.delete(n)},e.prototype.removeAllConnectionHandler=function(){O.of(this._iid).connectionHandlers.clear()},e.prototype.createApplicationUserListQuery=function(n){return n===void 0&&(n={}),new Dx(this._iid,n)},e.prototype.createBlockedUserListQuery=function(n){return n===void 0&&(n={}),new Fx(this._iid,n)},e.prototype.createFriendListQuery=function(n){return n===void 0&&(n={}),new Bx(this._iid,n)},e.prototype.createMessageSearchQuery=function(n){return new pO(this._iid,n)},e.prototype.createPollListQuery=function(n){return new JC(this._iid,x({},n))},e.prototype.createPollVoterListQuery=function(n){return new eS(this._iid,x({},n))},e.prototype.buildUserFromSerializedData=function(n){var t=pa(n);return new Ke(this._iid,Ke.payloadify(t))},e.prototype.updateCurrentUserInfo=function(n){return n===void 0&&(n={}),y(this,void 0,void 0,function(){var t,r,i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:return t=x(x({},NR),n),Y(function(c){return pr(c.profileImage,!0)&&R("string",c.profileUrl,!0)&&R("string",c.nickname,!0)}(t)).throw(L.invalidParameters),this.currentUser?(r=O.of(this._iid),i=r.sdkState,s=r.requestQueue,o=new Ey(x({userId:i.userId},t)),[4,s.send(o)]):[3,2];case 1:return a=u.sent(),l=a.as(by).user,this.currentUser&&(t.nickname&&(this.currentUser.nickname=l.nickname),(t.profileUrl||t.profileImage)&&(this.currentUser.plainProfileUrl=l.profileUrl)),[2,l];case 2:throw L.connectionRequired}})})},e.prototype.updateCurrentUserInfoWithPreferredLanguages=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o,a;return v(this,function(l){switch(l.label){case 0:return Y(We("string",n)).throw(L.invalidParameters),this.currentUser?(t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new Ey({userId:r.userId,preferredLanguages:n}),[4,i.send(s)]):[3,2];case 1:return o=l.sent(),a=o.as(by).user,this.currentUser&&(this.currentUser.preferredLanguages=a.preferredLanguages),[2,a];case 2:throw L.connectionRequired}})})},e.prototype.registerFCMPushTokenForCurrentUser=function(n,t){var r,i;return y(this,void 0,void 0,function(){var s,o,a,l,u,c,d=this;return v(this,function(h){switch(h.label){case 0:if(Y(R("string",n)&&R("string",t==null?void 0:t.deviceManufacturer,!0)).throw(L.invalidParameters),t!=null&&t.deviceOS&&Y($e(lo,t.deviceOS.platform,!0)&&R("string",t.deviceOS.version,!0)).throw(L.invalidParameters),!this.currentUser)return[3,6];s={deviceOS:"".concat(((r=t==null?void 0:t.deviceOS)===null||r===void 0?void 0:r.platform)||lo.ANDROID,"-").concat(((i=t==null?void 0:t.deviceOS)===null||i===void 0?void 0:i.version)||"unknown"),deviceManufacturer:t==null?void 0:t.deviceManufacturer,systemPushEnabled:t==null?void 0:t.systemPushEnabled},h.label=1;case 1:return h.trys.push([1,4,,5]),o=O.of(this._iid),a=o.sessionManager,l=o.sdkState,u=o.requestQueue,a.hasDeviceToken(In.FCM,n)?[2,Cr.SUCCESS]:(c=new OR({userId:l.userId,token:n,deviceOS:s.deviceOS,deviceManufacturer:s.deviceManufacturer,systemPushEnabled:s.systemPushEnabled}),[4,u.send(c)]);case 2:return h.sent(),[4,kt(function(){return y(d,void 0,void 0,function(){return v(this,function(f){switch(f.label){case 0:return a.setDeviceToken(In.FCM,n,s),[4,a.saveDeviceToken()];case 1:return f.sent(),[2]}})})})];case 3:return h.sent(),this._fcmPushToken="",[2,Cr.SUCCESS];case 4:return h.sent(),[2,Cr.ERROR];case 5:return[3,7];case 6:return this._fcmPushToken=n,[2,Cr.PENDING];case 7:return[2]}})})},e.prototype.unregisterFCMPushTokenForCurrentUser=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l=this;return v(this,function(u){switch(u.label){case 0:if(Y(R("string",n)).throw(L.invalidParameters),!this.currentUser)return[3,6];u.label=1;case 1:return u.trys.push([1,4,,5]),t=O.of(this._iid),r=t.sessionManager,i=t.sdkState,s=t.requestQueue,o=new RR({userId:i.userId,token:n}),[4,s.send(o)];case 2:return a=u.sent().lastDeletedAt,[4,kt(function(){return y(l,void 0,void 0,function(){return v(this,function(c){switch(c.label){case 0:return r.unsetDeviceToken(In.FCM,n),r.setDeviceTokenDeletedAt(a),[4,r.saveDeviceToken()];case 1:return c.sent(),[2]}})})})];case 3:return u.sent(),this._fcmPushToken="",[2,Cr.SUCCESS];case 4:return u.sent(),[2,Cr.ERROR];case 5:return[3,7];case 6:return this._fcmPushToken=n,[2,Cr.PENDING];case 7:return[2]}})})},e.prototype.unregisterFCMPushTokenAllForCurrentUser=function(){return y(this,void 0,void 0,function(){var n,t,r,i,s,o,a=this;return v(this,function(l){switch(l.label){case 0:return this.currentUser?(n=O.of(this._iid),t=n.sessionManager,r=n.sdkState,i=n.requestQueue,s=new DR({userId:r.userId}),[4,i.send(s)]):[3,3];case 1:return o=l.sent().lastDeletedAt,[4,kt(function(){return y(a,void 0,void 0,function(){return v(this,function(u){switch(u.label){case 0:return t.unsetDeviceTokens(In.FCM),t.setDeviceTokenDeletedAt(o),[4,t.saveDeviceToken()];case 1:return u.sent(),[2]}})})})];case 2:l.sent(),l.label=3;case 3:return[2]}})})},e.prototype.registerAPNSPushTokenForCurrentUser=function(n,t){var r,i;return y(this,void 0,void 0,function(){var s,o,a,l,u,c,d=this;return v(this,function(h){switch(h.label){case 0:if(Y(R("string",n)&&R("string",t==null?void 0:t.deviceManufacturer,!0)).throw(L.invalidParameters),t!=null&&t.deviceOS&&Y($e(lo,t.deviceOS.platform,!0)&&R("string",t.deviceOS.version,!0)).throw(L.invalidParameters),!this.currentUser)return[3,6];s={deviceOS:"".concat(((r=t==null?void 0:t.deviceOS)===null||r===void 0?void 0:r.platform)||lo.IOS,"-").concat(((i=t==null?void 0:t.deviceOS)===null||i===void 0?void 0:i.version)||"unknown"),deviceManufacturer:t==null?void 0:t.deviceManufacturer,systemPushEnabled:t==null?void 0:t.systemPushEnabled},h.label=1;case 1:return h.trys.push([1,4,,5]),o=O.of(this._iid),a=o.sessionManager,l=o.sdkState,u=o.requestQueue,a.hasDeviceToken(In.APNS,n)?[2,Cr.SUCCESS]:(c=new xR({userId:l.userId,token:n,deviceOS:s.deviceOS,deviceManufacturer:s.deviceManufacturer,systemPushEnabled:s.systemPushEnabled}),[4,u.send(c)]);case 2:return h.sent(),[4,kt(function(){return y(d,void 0,void 0,function(){return v(this,function(f){switch(f.label){case 0:return a.setDeviceToken(In.APNS,n,s),[4,a.saveDeviceToken()];case 1:return f.sent(),[2]}})})})];case 3:return h.sent(),this._apnsPushToken="",[2,Cr.SUCCESS];case 4:return h.sent(),[2,Cr.ERROR];case 5:return[3,7];case 6:return this._apnsPushToken=n,[2,Cr.PENDING];case 7:return[2]}})})},e.prototype.unregisterAPNSPushTokenForCurrentUser=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o,a,l=this;return v(this,function(u){switch(u.label){case 0:if(Y(R("string",n)).throw(L.invalidParameters),!this.currentUser)return[3,6];u.label=1;case 1:return u.trys.push([1,4,,5]),t=O.of(this._iid),r=t.sessionManager,i=t.sdkState,s=t.requestQueue,o=new kR({userId:i.userId,token:n}),[4,s.send(o)];case 2:return a=u.sent().lastDeletedAt,[4,kt(function(){return y(l,void 0,void 0,function(){return v(this,function(c){switch(c.label){case 0:return r.unsetDeviceToken(In.APNS,n),r.setDeviceTokenDeletedAt(a),[4,r.saveDeviceToken()];case 1:return c.sent(),[2]}})})})];case 3:return u.sent(),this._apnsPushToken="",[2,Cr.SUCCESS];case 4:return u.sent(),[2,Cr.ERROR];case 5:return[3,7];case 6:return this._apnsPushToken=n,[2,Cr.PENDING];case 7:return[2]}})})},e.prototype.unregisterAPNSPushTokenAllForCurrentUser=function(){return y(this,void 0,void 0,function(){var n,t,r,i,s,o,a=this;return v(this,function(l){switch(l.label){case 0:return this.currentUser?(n=O.of(this._iid),t=n.sessionManager,r=n.sdkState,i=n.requestQueue,s=new LR({userId:r.userId}),[4,i.send(s)]):[3,3];case 1:return o=l.sent().lastDeletedAt,[4,kt(function(){return y(a,void 0,void 0,function(){return v(this,function(u){switch(u.label){case 0:return t.unsetDeviceTokens(In.APNS),t.setDeviceTokenDeletedAt(o),[4,t.saveDeviceToken()];case 1:return u.sent(),[2]}})})})];case 2:l.sent(),l.label=3;case 3:return[2]}})})},e.prototype.markPushNotificationAsDelivered=function(n,t){var r;return t===void 0&&(t=!0),y(this,void 0,void 0,function(){var i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S,w,N;return v(this,function(A){switch(A.label){case 0:if(i=O.of(this._iid),s=i.logger,o=i.sessionManager,a=i.requestQueue,l=i.pushNotificationAckManager,s.debug("markPushNotificationAsDelivered:",n),u=vf.DELIVERED,c=l.parseData(n),d=c.pushTrackingId,h=c.sessionTopics,f=c.sessionKey,p=c.messageId,g=c.channelKey,b=c.templateKey,m=c.notificationEventDeadline,!f||!h.includes(sf.PUSH_ACKNOWLEDGEMENT))throw s.info("Can't use markPushNotificationAsDelivered() feature."),L.malformedDataError;if(l.isAcked(d,u))return s.info("already delivered push notification:",d),[2];_=!!g,E=t&&_,S=(r=o.deviceTokens[0])===null||r===void 0?void 0:r.token,w=new Cy({deviceToken:S??"",pushTrackingId:d,eventType:u,messageId:p,channelKey:g,templateKey:b,notificationEventDeadline:m,allowedPushNotification:E}),f&&(w.headers["Session-Key"]=f),A.label=1;case 1:return A.trys.push([1,3,,4]),[4,a.send(w)];case 2:return A.sent(),l.markAsAcked(d,u),[3,4];case 3:throw N=A.sent(),s.debug("failed to mark push notification as delivered. push tracking id: ".concat(d,". error: ").concat(N)),N;case 4:return[2]}})})},e.prototype.markPushNotificationAsClicked=function(n){var t;return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E;return v(this,function(S){switch(S.label){case 0:if(r=O.of(this._iid),i=r.logger,s=r.sessionManager,o=r.requestQueue,a=r.pushNotificationAckManager,i.debug("markPushNotificationAsClicked:",n),l=vf.CLICKED,u=a.parseData(n),c=u.pushTrackingId,d=u.sessionTopics,h=u.sessionKey,f=u.messageId,p=u.channelKey,g=u.templateKey,b=u.notificationEventDeadline,!h||!d.includes(sf.PUSH_ACKNOWLEDGEMENT))throw i.info("Can't use markPushNotificationAsDelivered() feature."),L.malformedDataError;if(a.isAcked(c,l))return i.info("already clicked push notification:",c),[2];m=(t=s.deviceTokens[0])===null||t===void 0?void 0:t.token,_=new Cy({deviceToken:m??"",pushTrackingId:c,eventType:l,messageId:f,channelKey:p,templateKey:g,notificationEventDeadline:b}),h&&(_.headers["Session-Key"]=h),S.label=1;case 1:return S.trys.push([1,3,,4]),[4,o.send(_)];case 2:return S.sent(),a.markAsAcked(c,l),[3,4];case 3:throw E=S.sent(),i.debug("failed to mark push notification as clicked. push tracking id: ".concat(c,". error: ").concat(E)),E;case 4:return[2]}})})},e.prototype.getChannelInvitationPreference=function(){return y(this,void 0,void 0,function(){var n,t,r,i,s;return v(this,function(o){switch(o.label){case 0:return n=O.of(this._iid),t=n.sdkState,r=n.requestQueue,i=new FR({userId:t.userId}),[4,r.send(i)];case 1:return s=o.sent(),[2,{autoAccept:s.as(HR).autoAccept}]}})})},e.prototype.setChannelInvitationPreference=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o;return v(this,function(a){switch(a.label){case 0:return Y(R("boolean",n)).throw(L.invalidParameters),t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new jR({userId:r.userId,willAutoAccept:n}),[4,i.send(s)];case 1:return o=a.sent(),[2,{autoAccept:o.as(BR).autoAccept}]}})})},e.prototype.getDoNotDisturb=function(){return y(this,void 0,void 0,function(){var n,t,r,i,s;return v(this,function(o){switch(o.label){case 0:return n=O.of(this._iid),t=n.sdkState,r=n.requestQueue,i=new $R({userId:t.userId}),[4,r.send(i)];case 1:return s=o.sent(),[2,s.as(GR).preference]}})})},e.prototype.setDoNotDisturb=function(n,t,r,i,s,o){return t===void 0&&(t=0),r===void 0&&(r=0),i===void 0&&(i=0),s===void 0&&(s=0),o===void 0&&(o=""),y(this,void 0,void 0,function(){var a,l,u,c,d;return v(this,function(h){switch(h.label){case 0:return Y(R("boolean",n)&&R("number",t)&&R("number",r)&&R("number",i)&&R("number",s)&&R("string",o)).throw(L.invalidParameters),a=O.of(this._iid),l=a.sdkState,u=a.requestQueue,c=new zR({userId:l.userId,doNotDisturbOn:n,startHour:t,startMin:r,endHour:i,endMin:s,timezone:o}),[4,u.send(c)];case 1:return d=h.sent(),[2,d.as(VR).preference]}})})},e.prototype.getSnoozePeriod=function(){return y(this,void 0,void 0,function(){var n,t,r,i,s;return v(this,function(o){switch(o.label){case 0:return n=O.of(this._iid),t=n.sdkState,r=n.requestQueue,i=new qR({userId:t.userId}),[4,r.send(i)];case 1:return s=o.sent(),[2,s.as(WR).snoozePeriod]}})})},e.prototype.setSnoozePeriod=function(n,t,r){return t===void 0&&(t=0),r===void 0&&(r=0),y(this,void 0,void 0,function(){var i,s,o,a,l;return v(this,function(u){switch(u.label){case 0:return Y(R("boolean",n)&&R("number",t)&&R("number",r)).throw(L.invalidParameters),i=O.of(this._iid),s=i.sdkState,o=i.requestQueue,a=new KR({userId:s.userId,snoozeOn:n,startTs:t,endTs:r}),[4,o.send(a)];case 1:return l=u.sent(),[2,l.as(QR).snoozePeriod]}})})},e.prototype.getMyPushTokensByToken=function(n,t){return y(this,void 0,void 0,function(){var r,i,s,o,a,l,u,c,d,h,f,p;return v(this,function(g){switch(g.label){case 0:return Y(R("string",n)&&$e(In,t)).throw(L.invalidParameters),r=O.of(this._iid),i=r.sdkState,s=r.requestQueue,o=r.sessionManager,a=new UR({userId:i.userId,type:t,token:n}),[4,s.send(a)];case 1:l=g.sent(),u=l.as(PR).pushTokens;try{for(c=pe(u.deviceTokens),d=c.next();!d.done;d=c.next())h=d.value,o.setDeviceToken(u.type,h)}catch(b){f={error:b}}finally{try{d&&!d.done&&(p=c.return)&&p.call(c)}finally{if(f)throw f.error}}return[4,o.saveDeviceToken()];case 2:return g.sent(),[2,u]}})})},e.prototype.getPushTriggerOption=function(){return y(this,void 0,void 0,function(){var n,t,r,i;return v(this,function(s){switch(s.label){case 0:return n=O.of(this._iid),t=n.sdkState,r=n.requestQueue,i=new XR({userId:t.userId}),[4,r.send(i)];case 1:return[2,s.sent().as(JR).pushTriggerOption]}})})},e.prototype.setPushTriggerOption=function(n){return y(this,void 0,void 0,function(){var t,r,i,s;return v(this,function(o){switch(o.label){case 0:return Y($e(na,n)).throw(L.invalidParameters),t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new eL({userId:r.userId,pushTriggerOption:n}),[4,i.send(s)];case 1:return[2,o.sent().as(tL).pushTriggerOption]}})})},e.prototype.getPushTemplate=function(){return y(this,void 0,void 0,function(){var n,t,r,i;return v(this,function(s){switch(s.label){case 0:return n=O.of(this._iid),t=n.sdkState,r=n.requestQueue,i=new nL({userId:t.userId}),[4,r.send(i)];case 1:return[2,s.sent().as(rL).name]}})})},e.prototype.setPushTemplate=function(n){return y(this,void 0,void 0,function(){var t,r,i,s;return v(this,function(o){switch(o.label){case 0:return Y($e(K_,n)).throw(L.invalidParameters),t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new iL({userId:r.userId,templateName:n}),[4,i.send(s)];case 1:return[2,o.sent().as(sL).name]}})})},e.prototype.blockUser=function(n){return y(this,void 0,void 0,function(){var t,r,i,s;return v(this,function(o){switch(o.label){case 0:return Y(n instanceof Ke||R("string",n)).throw(L.invalidParameters),t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new YR({userId:r.userId,blockedUserId:n instanceof Ke?n.userId:n}),[4,i.send(s)];case 1:return o.sent(),[2]}})})},e.prototype.blockUserWithUserId=function(n){return y(this,void 0,void 0,function(){return v(this,function(t){return[2,this.blockUser(n)]})})},e.prototype.unblockUser=function(n){return y(this,void 0,void 0,function(){var t,r,i,s;return v(this,function(o){switch(o.label){case 0:return Y(n instanceof Ke||R("string",n)).throw(L.invalidParameters),t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new ZR({userId:r.userId,unblockedUserId:n instanceof Ke?n.userId:n}),[4,i.send(s)];case 1:return o.sent(),[2]}})})},e.prototype.unblockUserWithUserId=function(n){return y(this,void 0,void 0,function(){return v(this,function(t){return[2,this.unblockUser(n)]})})},e.prototype.getFriendChangeLogsByToken=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o;return v(this,function(a){switch(a.label){case 0:return Y(R("string",n)).throw(L.invalidParameters),t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new oL({userId:r.userId,token:n}),[4,i.send(s)];case 1:return o=a.sent(),[2,o.as(aL).changelogs]}})})},e.prototype.getAllowFriendDiscovery=function(){return y(this,void 0,void 0,function(){var n,t,r,i,s;return v(this,function(o){switch(o.label){case 0:return n=O.of(this._iid),t=n.sdkState,r=n.requestQueue,i=new pL({userId:t.userId}),[4,r.send(i)];case 1:return s=o.sent(),[2,s.as(_L).allowFriendDiscovery]}})})},e.prototype.setAllowFriendDiscovery=function(n){return y(this,void 0,void 0,function(){var t,r,i,s;return v(this,function(o){switch(o.label){case 0:return Y(R("boolean",n)).throw(L.invalidParameters),t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new mL({userId:r.userId,allowFriendDiscovery:n}),[4,i.send(s)];case 1:return o.sent(),[2,n]}})})},e.prototype.uploadFriendDiscoveries=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o;return v(this,function(a){switch(a.label){case 0:return t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new lL({userId:r.userId,discoveries:n}),[4,i.send(s)];case 1:return o=a.sent(),[2,o.as(uL).friendDiscoveryRequestId]}})})},e.prototype.deleteFriendDiscovery=function(n){return y(this,void 0,void 0,function(){return v(this,function(t){return[2,this.deleteFriendDiscoveries([n])]})})},e.prototype.deleteFriendDiscoveries=function(n){return y(this,void 0,void 0,function(){var t,r,i,s;return v(this,function(o){switch(o.label){case 0:return Y(We("string",n)).throw(L.invalidParameters),t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new cL({userId:r.userId,discoveryKeys:n}),[4,i.send(s)];case 1:return o.sent(),[2]}})})},e.prototype.addFriends=function(n){return y(this,void 0,void 0,function(){var t,r,i,s,o;return v(this,function(a){switch(a.label){case 0:return Y(We("string",n)).throw(L.invalidParameters),t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new dL({userId:r.userId,userIds:n}),[4,i.send(s)];case 1:return o=a.sent(),[2,o.as(hL).users]}})})},e.prototype.deleteFriend=function(n){return y(this,void 0,void 0,function(){return v(this,function(t){return[2,this.deleteFriends([n])]})})},e.prototype.deleteFriends=function(n){return y(this,void 0,void 0,function(){var t,r,i,s;return v(this,function(o){switch(o.label){case 0:return Y(We("string",n)).throw(L.invalidParameters),t=O.of(this._iid),r=t.sdkState,i=t.requestQueue,s=new fL({userId:r.userId,userIds:n}),[4,i.send(s)];case 1:return o.sent(),[2]}})})},e.prototype.getAllEmoji=function(){return y(this,void 0,void 0,function(){var n,t,r;return v(this,function(i){switch(i.label){case 0:return n=O.of(this._iid).requestQueue,t=new gL,[4,n.send(t)];case 1:return r=i.sent(),[2,r.as(vL).emojiContainer]}})})},e.prototype.getEmojiCategory=function(n){return y(this,void 0,void 0,function(){var t,r,i;return v(this,function(s){switch(s.label){case 0:return t=O.of(this._iid).requestQueue,r=new yL({categoryId:n}),[4,t.send(r)];case 1:return i=s.sent(),[2,i.as(EL).emojiCategory]}})})},e.prototype.getEmoji=function(n){return y(this,void 0,void 0,function(){var t,r,i;return v(this,function(s){switch(s.label){case 0:return t=O.of(this._iid).requestQueue,r=new bL({key:n}),[4,t.send(r)];case 1:return i=s.sent(),[2,i.as(CL).emoji]}})})},e.prototype.getUIKitConfiguration=function(){return y(this,void 0,void 0,function(){var n,t,r,i;return v(this,function(s){switch(s.label){case 0:return n=O.of(this._iid),Y(n.hasExtension("sb_uikit")).throw(L.notSupportedError),t=n.requestQueue,r=new SL,[4,t.send(r)];case 1:return i=s.sent(),[2,i.as(TL).uikitConfiguration]}})})},e}();function NL(e,n){return!e||!n?!0:e.url!==n.url}function Ma(e){return e!=null&&"sendingStatus"in e}function yf(e,n="##__USER_ID_IS_NOT_PROVIDED__##"){var t;return Ma(e)?((t=e.sender)===null||t===void 0?void 0:t.userId)===n:!1}function IL(e,n){return yf(e,n)||e.isAdminMessage()?!1:e.updatedAt===0}function Sy(e){return"sendingStatus"in e?e.sendingStatus==="succeeded"?String(e.messageId):e.reqId:String(e.messageId)}function et(e){return typeof e=="boolean"}function Qa(e,n){return n.includes(e)}function AL(e){return e instanceof Set}function Ty(e){return!e||!Array.isArray(e)?!1:e.length!==0}function ML(e,n){return Object.prototype.toString.call(e)===Object.prototype.toString.call(n)}const xL=()=>{const[,e]=D.useState(0);return D.useCallback(()=>e(n=>n+1),[])};function Sm(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(t=>Sm(t));const n={};return Object.keys(e).forEach(t=>{const r=t.replace(/_\w/g,i=>i[1].toUpperCase());n[r]=Sm(e[t])}),n}function wy(e,n){return e.reduce((t,r)=>{const i=n(r);return t[i]=r,t},{})}var OL=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i{var t=OL(e,[]);switch(n.type){case"update_initialized":return t.initialized=n.value.status,t;case"update_refreshing":return t.refreshing=n.value.status,t;case"update_loading":return t.loading=n.value.status,t;case"update_messages":{const r=n.value.currentUserId;if(n.value.clearBeforeAction)t.messageMap=Ny(n.value.messages);else{const i=n.value.messages.filter(o=>{var a;if(yf(o,r)){const l=(a=t.messageMap[o.reqId])!==null&&a!==void 0?a:t.messageMap[o.messageId];if(yf(l,r)){const u=RL(l,o);return u&&(delete t.messageMap[l.reqId],delete t.messageMap[l.messageId]),u}}return!0}),s=Ny(i);t.messageMap=Object.assign(Object.assign({},t.messageMap),s)}return t}case"update_new_messages":{const r=n.value.currentUserId,i=n.value.messages.filter(s=>IL(s,r));return n.value.clearBeforeAction?t.newMessageMap=wy(i,Sy):(i.map(o=>o.messageId).forEach(o=>delete t.newMessageMap[o]),t.newMessageMap=Object.assign(Object.assign({},t.newMessageMap),wy(i,Sy))),t}case"delete_messages":case"delete_new_messages":{const r=n.type==="delete_messages"?"messageMap":"newMessageMap";return t[r]=Object.assign({},t[r]),n.value.messageIds.forEach(i=>{const s=t[r][i];s&&(Ma(s)&&delete t[r][s.reqId],delete t[r][s.messageId])}),n.value.reqIds.forEach(i=>{const s=t[r][i];s&&(Ma(s)&&delete t[r][s.reqId],delete t[r][s.messageId])}),t}}},Ny=e=>e.reduce((n,t)=>(Ma(t)?(n[t.reqId]=t,t.sendingStatus===ut.SUCCEEDED&&(n[t.messageId]=t)):n[t.messageId]=t,n),{}),RL=(e,n)=>e.sendingStatus===ut.SUCCEEDED?n.sendingStatus===ut.SUCCEEDED:e.sendingStatus!==n.sendingStatus,LL=(e=DL)=>{const[{initialized:n,loading:t,refreshing:r,messageMap:i,newMessageMap:s},o]=D.useReducer(kL,{initialized:!1,loading:!0,refreshing:!1,messageMap:{},newMessageMap:{}}),a=(b,m,_)=>{o({type:"update_messages",value:{messages:b,clearBeforeAction:m,currentUserId:_}})},l=(b,m)=>{o({type:"delete_messages",value:{messageIds:b,reqIds:m}})},u=(b,m,_)=>{o({type:"update_new_messages",value:{messages:b,clearBeforeAction:m,currentUserId:_}})},c=(b,m)=>{o({type:"delete_new_messages",value:{messageIds:b,reqIds:m}})},d=b=>{o({type:"update_initialized",value:{status:b}})},h=b=>{o({type:"update_loading",value:{status:b}})},f=b=>{o({type:"update_refreshing",value:{status:b}})},p=Object.values(s),g=D.useMemo(()=>Array.from(new Set(Object.values(i))).sort(e),[i]);return{updateInitialized:d,updateLoading:h,updateRefreshing:f,updateMessages:a,deleteMessages:l,initialized:n,loading:t,refreshing:r,messages:g,newMessages:p,updateNewMessages:u,deleteNewMessages:c}},Iy=Math.floor(Number.MAX_SAFE_INTEGER/10);function DL(e,n){let t=0,r=0;return Ma(e)&&e.sendingStatus!=="succeeded"&&(t=Iy),Ma(n)&&n.sendingStatus!=="succeeded"&&(r=Iy),e.createdAt+t-(n.createdAt+r)}var Pi=function(e,n,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((r=r.apply(e,n||[])).next())})};const UL=(e,n,t)=>{var r;const i={prevResultLimit:n.prev,nextResultLimit:n.next,startingPoint:t==null?void 0:t.startingPoint,replyType:t==null?void 0:t.replyType},s=(r=t==null?void 0:t.collectionCreator)===null||r===void 0?void 0:r.call(t,i);return s||e.createMessageCollection(Object.assign(Object.assign({},i),{filter:new _s(i)}))};function Ay(e){return e{var r,i,s;const o=D.useRef(t);o.current=t;const a=D.useRef(n);a.current=n;const l=o.current.logger,u=(r=o.current.startingPoint)!==null&&r!==void 0?r:Number.MAX_SAFE_INTEGER,c=Ay(u),d=D.useRef({prev:!1,next:!1}),h=xL(),f=D.useRef({initialized:!1,apiInitialized:!1,instance:null}),{initialized:p,loading:g,refreshing:b,messages:m,newMessages:_,updateMessages:E,updateNewMessages:S,deleteNewMessages:w,deleteMessages:N,updateInitialized:A,updateLoading:k,updateRefreshing:I}=LL(t==null?void 0:t.sortComparator),M=fn(B=>{var te,oe,me,re;if(!a.current||!a.current.url)return(te=l==null?void 0:l.error)===null||te===void 0?void 0:te.call(l,"[useGroupChannelMessages] channel is required");try{switch(B){case G.EVENT_MESSAGE_RECEIVED:case G.EVENT_MESSAGE_SENT_SUCCESS:case G.SYNC_MESSAGE_FILL:case void 0:(me=(oe=o.current).markAsRead)===null||me===void 0||me.call(oe,[a.current]);break}}catch(ce){(re=l==null?void 0:l.warn)===null||re===void 0||re.call(l,"[useGroupChannelMessages/markAsReadBySource]",ce)}}),U=fn((B,te)=>{var oe,me,re,ce,de;const fe=te.filter(ve=>{var _e;return!yf(ve,(_e=e.currentUser)===null||_e===void 0?void 0:_e.userId)});if(fe.length>0)switch(B){case G.EVENT_MESSAGE_RECEIVED:case G.SYNC_MESSAGE_FILL:{!((me=(oe=o.current).shouldCountNewMessages)===null||me===void 0)&&me.call(oe)&&S(fe,!1,(re=e.currentUser)===null||re===void 0?void 0:re.userId),(de=(ce=o.current).onMessagesReceived)===null||de===void 0||de.call(ce,fe);break}}}),z=fn((B,te)=>Pi(void 0,void 0,void 0,function*(){return new Promise(oe=>{var me,re;if(!a.current||!a.current.url)return(me=l==null?void 0:l.error)===null||me===void 0?void 0:me.call(l,"[useGroupChannelMessages] channel is required");f.current.instance&&f.current.instance.dispose(),M(),S([],!0,(re=e.currentUser)===null||re===void 0?void 0:re.userId);const ce=()=>{var fe,ve,_e;const{pendingMessages:Ee,failedMessages:Be}=(fe=f.current.instance)!==null&&fe!==void 0?fe:{};Ty(Ee)&&E(Ee,!1,(ve=e.currentUser)===null||ve===void 0?void 0:ve.userId),Ty(Be)&&E(Be,!1,(_e=e.currentUser)===null||_e===void 0?void 0:_e.userId)},de=UL(a.current,te,Object.assign(Object.assign({},o.current),{startingPoint:B}));f.current={apiInitialized:!1,initialized:!1,instance:de},de.setMessageCollectionHandler({onMessagesAdded:(fe,ve,_e)=>{var Ee;M(fe.source),U(fe.source,_e),E(_e,!1,(Ee=e.currentUser)===null||Ee===void 0?void 0:Ee.userId)},onMessagesUpdated:(fe,ve,_e)=>{var Ee,Be,ze;M(fe.source),U(fe.source,_e),E(_e,!1,(Ee=e.currentUser)===null||Ee===void 0?void 0:Ee.userId),fe.source===G.EVENT_MESSAGE_UPDATED&&((ze=(Be=o.current).onMessagesUpdated)===null||ze===void 0||ze.call(Be,_e))},onMessagesDeleted:(fe,ve,_e,Ee)=>{const Be=Ee.map(V=>V.messageId),ze=Ee.filter(Ma).map(V=>V.reqId);N(Be,ze),w(Be,ze)},onChannelDeleted:(fe,ve)=>{var _e,Ee;(Ee=(_e=o.current).onChannelDeleted)===null||Ee===void 0||Ee.call(_e,ve)},onChannelUpdated:(fe,ve)=>{var _e,Ee;h(),(Ee=(_e=o.current).onChannelUpdated)===null||Ee===void 0||Ee.call(_e,ve)},onHugeGapDetected:()=>{z(Number.MAX_SAFE_INTEGER,gf.collection.message.defaultLimit)}}),de.initialize(mf.CACHE_AND_REPLACE_BY_API).onCacheResult((fe,ve)=>{var _e,Ee,Be;fe?e.isCacheEnabled&&((_e=l==null?void 0:l.error)===null||_e===void 0||_e.call(l,"[useGroupChannelMessages/onCacheResult]",fe)):ve&&((Ee=l==null?void 0:l.debug)===null||Ee===void 0||Ee.call(l,"[useGroupChannelMessages/onCacheResult]","message length:",ve.length),E(ve,!0,(Be=e.currentUser)===null||Be===void 0?void 0:Be.userId),ce(),ve.length>0&&(f.current.initialized=!0,oe()))}).onApiResult((fe,ve)=>{var _e,Ee,Be,ze,V;fe?(_e=l==null?void 0:l.warn)===null||_e===void 0||_e.call(l,"[useGroupChannelMessages/onApiResult]",fe):ve&&((Ee=l==null?void 0:l.debug)===null||Ee===void 0||Ee.call(l,"[useGroupChannelMessages/onApiResult]","message length:",ve.length),E(ve,!0,(Be=e.currentUser)===null||Be===void 0?void 0:Be.userId),o.current.startingPoint||(V=(ze=o.current).onMessagesReceived)===null||V===void 0||V.call(ze,ve),e.isCacheEnabled&&ce()),f.current.initialized=!0,f.current.apiInitialized=!0,oe()})})}));DS(e,{onUserBanned(B,te){var oe,me,re;B.isGroupChannel()&&!NL(B,a.current)&&(te.userId===((oe=e.currentUser)===null||oe===void 0?void 0:oe.userId)?(re=(me=o.current).onCurrentUserBanned)===null||re===void 0||re.call(me):h())}}),D.useLayoutEffect(()=>{const B=setTimeout(()=>Pi(void 0,void 0,void 0,function*(){e.currentUser&&a.current&&(A(!1),k(!0),yield z(u,c),k(!1),A(!0))}));return()=>clearTimeout(B)},[e,(i=e.currentUser)===null||i===void 0?void 0:i.userId,(s=a.current)===null||s===void 0?void 0:s.url,o.current.replyType]),D.useEffect(()=>()=>{f.current.instance&&f.current.instance.dispose()},[]);const H=fn(()=>Pi(void 0,void 0,void 0,function*(){e.currentUser&&a.current&&(I(!0),yield z(Number.MAX_SAFE_INTEGER,gf.collection.message.defaultLimit),I(!1))})),W=fn(()=>Pi(void 0,void 0,void 0,function*(){var B;const te=f.current.instance;if(te!=null&&te.hasPrevious&&!d.current.prev)try{d.current.prev=!0;const oe=yield te.loadPrevious();E(oe,!1,(B=e.currentUser)===null||B===void 0?void 0:B.userId)}catch{}finally{d.current.prev=!1}})),Q=fn(()=>{const{initialized:B,instance:te}=f.current;return B&&te?te.hasPrevious:!1}),$=fn(()=>Pi(void 0,void 0,void 0,function*(){var B;const te=f.current.instance;if(te!=null&&te.hasNext&&!d.current.next)try{d.current.next=!0;const oe=yield te.loadNext();E(oe,!1,(B=e.currentUser)===null||B===void 0?void 0:B.userId)}catch{}finally{d.current.next=!1}})),Ne=fn(()=>{const{initialized:B,apiInitialized:te,instance:oe}=f.current;return te&&B&&oe?oe.hasNext:!1}),X=fn((B,te)=>{var oe;if(!a.current||!a.current.url)throw(oe=l==null?void 0:l.error)===null||oe===void 0||oe.call(l,"[useGroupChannelMessages] channel is required"),new Error("Channel is required");return new Promise((me,re)=>{a.current.sendUserMessage(B).onPending(ce=>{var de;ce.channelUrl===a.current.url&&E([ce],!1,(de=e.currentUser)===null||de===void 0?void 0:de.userId),te==null||te(ce)}).onSucceeded(ce=>{var de;ce.channelUrl===a.current.url&&E([ce],!1,(de=e.currentUser)===null||de===void 0?void 0:de.userId),me(ce)}).onFailed((ce,de)=>{var fe;de&&de.channelUrl===a.current.url&&E([de],!1,(fe=e.currentUser)===null||fe===void 0?void 0:fe.userId),re(ce)})})}),ae=fn((B,te)=>{var oe;if(!a.current||!a.current.url)throw(oe=l==null?void 0:l.error)===null||oe===void 0||oe.call(l,"[useGroupChannelMessages] channel is required"),new Error("Channel is required");return new Promise((me,re)=>{a.current.sendFileMessage(B).onPending(ce=>{var de;ce.channelUrl===a.current.url&&E([ce],!1,(de=e.currentUser)===null||de===void 0?void 0:de.userId),te==null||te(ce)}).onSucceeded(ce=>{var de;ce.channelUrl===a.current.url&&E([ce],!1,(de=e.currentUser)===null||de===void 0?void 0:de.userId),me(ce)}).onFailed((ce,de)=>{var fe;de&&de.channelUrl===a.current.url&&E([de],!1,(fe=e.currentUser)===null||fe===void 0?void 0:fe.userId),re(ce)})})}),ne=fn((B,te)=>Pi(void 0,void 0,void 0,function*(){var oe;if(!a.current||!a.current.url)throw(oe=l==null?void 0:l.error)===null||oe===void 0||oe.call(l,"[useGroupChannelMessages] channel is required"),new Error("Channel is required");return new Promise(me=>{const re=[];a.current.sendFileMessages(B).onPending(ce=>{var de;ce.channelUrl===a.current.url&&E([ce],!1,(de=e.currentUser)===null||de===void 0?void 0:de.userId),te==null||te(ce)}).onSucceeded(ce=>{var de;ce.isFileMessage()&&ce.channelUrl===a.current.url&&(E([ce],!1,(de=e.currentUser)===null||de===void 0?void 0:de.userId),re.push(ce)),re.length===B.length&&me(re)}).onFailed((ce,de)=>{var fe;de&&de.channelUrl===a.current.url?(E([de],!1,(fe=e.currentUser)===null||fe===void 0?void 0:fe.userId),re.push(de)):re.push(null),re.length===B.length&&me(re)})})})),Ce=fn((B,te)=>{var oe;if(!a.current||!a.current.url)throw(oe=l==null?void 0:l.error)===null||oe===void 0||oe.call(l,"[useGroupChannelMessages] channel is required"),new Error("Channel is required");return new Promise((me,re)=>{a.current.sendMultipleFilesMessage(B).onPending(ce=>{var de;ce.channelUrl===a.current.url&&E([ce],!1,(de=e.currentUser)===null||de===void 0?void 0:de.userId),te==null||te(ce)}).onFileUploaded(()=>{h()}).onSucceeded(ce=>{var de;ce.channelUrl===a.current.url&&E([ce],!1,(de=e.currentUser)===null||de===void 0?void 0:de.userId),me(ce)}).onFailed((ce,de)=>{var fe;de&&de.channelUrl===a.current.url&&E([de],!1,(fe=e.currentUser)===null||fe===void 0?void 0:fe.userId),re(ce)})})}),K=fn((B,te)=>Pi(void 0,void 0,void 0,function*(){var oe,me;if(!a.current||!a.current.url)throw(oe=l==null?void 0:l.error)===null||oe===void 0||oe.call(l,"[useGroupChannelMessages] channel is required"),new Error("Channel is required");const re=yield a.current.updateUserMessage(B,te);return re.channelUrl===a.current.url&&E([re],!1,(me=e.currentUser)===null||me===void 0?void 0:me.userId),re})),ie=fn((B,te)=>Pi(void 0,void 0,void 0,function*(){var oe,me;if(!a.current||!a.current.url)throw(oe=l==null?void 0:l.error)===null||oe===void 0||oe.call(l,"[useGroupChannelMessages] channel is required"),new Error("Channel is required");const re=yield a.current.updateFileMessage(B,te);return re.channelUrl===a.current.url&&E([re],!1,(me=e.currentUser)===null||me===void 0?void 0:me.userId),re})),ee=fn(B=>Pi(void 0,void 0,void 0,function*(){var te;if(!a.current||!a.current.url)throw(te=l==null?void 0:l.error)===null||te===void 0||te.call(l,"[useGroupChannelMessages] channel is required"),new Error("Channel is required");return new Promise((oe,me)=>{let re;B.isUserMessage()&&(re=a.current.resendMessage(B)),B.isFileMessage()&&(re=a.current.resendMessage(B)),B.isMultipleFilesMessage()&&(re=a.current.resendMessage(B)),re&&("onPending"in re&&re.onPending(ce=>{var de;ce.channelUrl===a.current.url&&E([ce],!1,(de=e.currentUser)===null||de===void 0?void 0:de.userId)}),"onFileUploaded"in re&&re.onFileUploaded(()=>{h()}),"onSucceeded"in re&&re.onSucceeded(ce=>{var de;ce.channelUrl===a.current.url&&E([ce],!1,(de=e.currentUser)===null||de===void 0?void 0:de.userId),oe(ce)}),"onFailed"in re&&re.onFailed((ce,de)=>{var fe;de&&de.channelUrl===a.current.url&&E([de],!1,(fe=e.currentUser)===null||fe===void 0?void 0:fe.userId),me(ce)}))})})),ue=fn(B=>Pi(void 0,void 0,void 0,function*(){var te,oe;if(!a.current||!a.current.url)throw(te=l==null?void 0:l.error)===null||te===void 0||te.call(l,"[useGroupChannelMessages] channel is required"),new Error("Channel is required");if(B.sendingStatus==="succeeded")B.isUserMessage()&&(yield a.current.deleteMessage(B)),B.isFileMessage()&&(yield a.current.deleteMessage(B)),B.isMultipleFilesMessage()&&(yield a.current.deleteMessage(B));else try{yield(oe=f.current.instance)===null||oe===void 0?void 0:oe.removeFailedMessage(B.reqId)}finally{N([B.messageId],[B.reqId])}})),P=fn(()=>{var B;S([],!0,(B=e.currentUser)===null||B===void 0?void 0:B.userId)}),xe=fn(B=>Pi(void 0,void 0,void 0,function*(){var te;if(e.currentUser&&a.current){const oe=Ay(B);k(!0),E([],!0,(te=e.currentUser)===null||te===void 0?void 0:te.userId),yield z(B,oe),k(!1)}}));return{initialized:p,loading:g,refreshing:b,messages:m,newMessages:_,resetNewMessages:P,refresh:H,loadPrevious:W,hasPrevious:Q,loadNext:$,hasNext:Ne,sendUserMessage:X,sendFileMessage:ae,sendFileMessages:ne,sendMultipleFilesMessage:Ce,updateUserMessage:K,updateFileMessage:ie,resendMessage:ee,deleteMessage:ue,resetWithStartingPoint:xe,_dangerous_reducer_updateMessages:E,_dangerous_reducer_deleteMessages:N}},sv=e=>FL(e),FL=e=>e();function FS(e,n){const t=Object.assign({},e);return Object.keys(n).forEach(r=>{Object.prototype.hasOwnProperty.call(t,r)&&ML(t[r],n[r])&&(typeof n[r]=="object"&&!Array.isArray(n[r])?t[r]=FS(t[r],n[r]):t[r]=n[r])}),t}const ov=()=>({common:{enableUsingDefaultUserProfile:!1},groupChannel:{channel:{enableMention:!1,enableOgtag:!0,enableReactions:!0,enableReactionsSupergroup:!1,enableTypingIndicator:!0,enableVoiceMessage:!1,input:{camera:{enablePhoto:!0,enableVideo:!0},enableDocument:!0,gallery:{enablePhoto:!0,enableVideo:!0}},replyType:"quote_reply",threadReplySelectType:"thread",typingIndicatorTypes:new Set(["text"]),enableFeedback:!1,enableSuggestedReplies:!1,showSuggestedRepliesFor:"last_message_only",suggestedRepliesDirection:"vertical"},channelList:{enableMessageReceiptStatus:!1,enableTypingIndicator:!1},setting:{enableMessageSearch:!1}},openChannel:{channel:{enableOgtag:!0,input:{camera:{enablePhoto:!0,enableVideo:!0},enableDocument:!0,gallery:{enablePhoto:!0,enableVideo:!0}}}}});function HL(e){return delete e.groupChannel.channel.typingIndicatorTypes,delete e.groupChannel.channel.enableFeedback,delete e.groupChannel.channel.enableSuggestedReplies,delete e.groupChannel.channel.showSuggestedRepliesFor,delete e.groupChannel.channel.suggestedRepliesDirection,e}const HS=()=>{const e=ov();return HL(e)},My=ov(),jL=HS();var Ef=function(e,n,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((r=r.apply(e,n||[])).next())})};const Tm={items:{},getItem(e){var n;return Ef(this,void 0,void 0,function*(){return(n=Tm.items[e])!==null&&n!==void 0?n:null})},setItem(e,n){return Ef(this,void 0,void 0,function*(){Tm.items[e]=n})}};class BL{constructor(n){this.storage=n??Tm}init(n){return this.key=`sbu@${n}.uikitConfiguration`,this.get()}get safeKey(){if(!this.key)throw new Error("Please UIKitConfigManager.init() first");return this.key}update(n){return Ef(this,void 0,void 0,function*(){const t=yield this.get(),r={updatedAt:n.updatedAt,configuration:FS(t.configuration,n.configuration)};return yield this.storage.setItem(this.safeKey,JSON.stringify(r)),r})}get(){return Ef(this,void 0,void 0,function*(){const n={updatedAt:0,configuration:jL};try{const t=yield this.storage.getItem(this.safeKey);return t?JSON.parse(t):n}catch{return n}})}}function $L(e,n,t){var r,i;t.common&&et((r=t.common)===null||r===void 0?void 0:r.enableUsingDefaultUserProfile)&&(e.enableUsingDefaultUserProfile=t.common.enableUsingDefaultUserProfile),n.common&&et((i=n.common)===null||i===void 0?void 0:i.enableUsingDefaultUserProfile)&&(e.enableUsingDefaultUserProfile=n.common.enableUsingDefaultUserProfile)}function GL(e,n,t){zL(e,n,t),VL(e,n,t),qL(e,n,t),WL(e,n,t)}function zL(e,n,t){var r,i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S,w,N,A,k,I,M,U,z,H,W,Q,$,Ne,X,ae,ne,Ce,K,ie,ee,ue,P,xe,B,te,oe,me,re,ce,de,fe,ve,_e,Ee,Be,ze,V,Se,Ue,le,Oe,tt,at,Pe,Ye,wt,_t,Rt,Lt,nn,Qt,un,Dt,Nt,xn,Bt,ft,cn,Un,Pn,vn,Fn,Ot,On,rn,sn,kn,yn,It,Rn,or,dn,En,bn,Ut,Cn,Yt,Hn,jn,ar,Le,F,he,Me,Ge;!((r=t.groupChannel)===null||r===void 0)&&r.channel&&et((s=(i=t.groupChannel)===null||i===void 0?void 0:i.channel)===null||s===void 0?void 0:s.enableOgtag)&&(e.channel.enableOgtag=t.groupChannel.channel.enableOgtag),!((o=n.groupChannel)===null||o===void 0)&&o.channel&&et((l=(a=n.groupChannel)===null||a===void 0?void 0:a.channel)===null||l===void 0?void 0:l.enableOgtag)&&(e.channel.enableOgtag=(c=(u=n.groupChannel)===null||u===void 0?void 0:u.channel)===null||c===void 0?void 0:c.enableOgtag),!((d=t.groupChannel)===null||d===void 0)&&d.channel&&et((f=(h=t.groupChannel)===null||h===void 0?void 0:h.channel)===null||f===void 0?void 0:f.enableTypingIndicator)&&(e.channel.enableTypingIndicator=(g=(p=t.groupChannel)===null||p===void 0?void 0:p.channel)===null||g===void 0?void 0:g.enableTypingIndicator),!((b=n.groupChannel)===null||b===void 0)&&b.channel&&et((_=(m=n.groupChannel)===null||m===void 0?void 0:m.channel)===null||_===void 0?void 0:_.enableTypingIndicator)&&(e.channel.enableTypingIndicator=(S=(E=n.groupChannel)===null||E===void 0?void 0:E.channel)===null||S===void 0?void 0:S.enableTypingIndicator),!((w=t.groupChannel)===null||w===void 0)&&w.channel&&et((A=(N=t.groupChannel)===null||N===void 0?void 0:N.channel)===null||A===void 0?void 0:A.enableReactions)&&(e.channel.enableReactions=(I=(k=t.groupChannel)===null||k===void 0?void 0:k.channel)===null||I===void 0?void 0:I.enableReactions),!((M=n.groupChannel)===null||M===void 0)&&M.channel&&et((z=(U=n.groupChannel)===null||U===void 0?void 0:U.channel)===null||z===void 0?void 0:z.enableReactions)&&(e.channel.enableReactions=(W=(H=n.groupChannel)===null||H===void 0?void 0:H.channel)===null||W===void 0?void 0:W.enableReactions),!((Q=t.groupChannel)===null||Q===void 0)&&Q.channel&&et((Ne=($=t.groupChannel)===null||$===void 0?void 0:$.channel)===null||Ne===void 0?void 0:Ne.enableReactionsSupergroup)&&(e.channel.enableReactionsSupergroup=(ae=(X=t.groupChannel)===null||X===void 0?void 0:X.channel)===null||ae===void 0?void 0:ae.enableReactionsSupergroup),!((ne=n.groupChannel)===null||ne===void 0)&&ne.channel&&et((K=(Ce=n.groupChannel)===null||Ce===void 0?void 0:Ce.channel)===null||K===void 0?void 0:K.enableReactionsSupergroup)&&(e.channel.enableReactionsSupergroup=(ee=(ie=n.groupChannel)===null||ie===void 0?void 0:ie.channel)===null||ee===void 0?void 0:ee.enableReactionsSupergroup),!((ue=t.groupChannel)===null||ue===void 0)&&ue.channel&&et((xe=(P=t.groupChannel)===null||P===void 0?void 0:P.channel)===null||xe===void 0?void 0:xe.enableMention)&&(e.channel.enableMention=(te=(B=t.groupChannel)===null||B===void 0?void 0:B.channel)===null||te===void 0?void 0:te.enableMention),!((oe=n.groupChannel)===null||oe===void 0)&&oe.channel&&et((re=(me=n.groupChannel)===null||me===void 0?void 0:me.channel)===null||re===void 0?void 0:re.enableMention)&&(e.channel.enableMention=(de=(ce=n.groupChannel)===null||ce===void 0?void 0:ce.channel)===null||de===void 0?void 0:de.enableMention),!((fe=t.groupChannel)===null||fe===void 0)&&fe.channel&&Qa((_e=(ve=t.groupChannel)===null||ve===void 0?void 0:ve.channel)===null||_e===void 0?void 0:_e.replyType,["none","quote_reply","thread"])&&(e.channel.replyType=(Be=(Ee=t.groupChannel)===null||Ee===void 0?void 0:Ee.channel)===null||Be===void 0?void 0:Be.replyType),!((ze=n.groupChannel)===null||ze===void 0)&&ze.channel&&Qa((Se=(V=n.groupChannel)===null||V===void 0?void 0:V.channel)===null||Se===void 0?void 0:Se.replyType,["none","quote_reply","thread"])&&(e.channel.replyType=(le=(Ue=n.groupChannel)===null||Ue===void 0?void 0:Ue.channel)===null||le===void 0?void 0:le.replyType),!((Oe=t.groupChannel)===null||Oe===void 0)&&Oe.channel&&Qa((at=(tt=t.groupChannel)===null||tt===void 0?void 0:tt.channel)===null||at===void 0?void 0:at.threadReplySelectType,["thread","parent"])&&(e.channel.threadReplySelectType=(Ye=(Pe=t.groupChannel)===null||Pe===void 0?void 0:Pe.channel)===null||Ye===void 0?void 0:Ye.threadReplySelectType),!((wt=n.groupChannel)===null||wt===void 0)&&wt.channel&&Qa((Rt=(_t=n.groupChannel)===null||_t===void 0?void 0:_t.channel)===null||Rt===void 0?void 0:Rt.threadReplySelectType,["thread","parent"])&&(e.channel.threadReplySelectType=(nn=(Lt=n.groupChannel)===null||Lt===void 0?void 0:Lt.channel)===null||nn===void 0?void 0:nn.threadReplySelectType),!((Qt=t.groupChannel)===null||Qt===void 0)&&Qt.channel&&et((Dt=(un=t.groupChannel)===null||un===void 0?void 0:un.channel)===null||Dt===void 0?void 0:Dt.enableVoiceMessage)&&(e.channel.enableVoiceMessage=(xn=(Nt=t.groupChannel)===null||Nt===void 0?void 0:Nt.channel)===null||xn===void 0?void 0:xn.enableVoiceMessage),!((Bt=n.groupChannel)===null||Bt===void 0)&&Bt.channel&&et((cn=(ft=n.groupChannel)===null||ft===void 0?void 0:ft.channel)===null||cn===void 0?void 0:cn.enableVoiceMessage)&&(e.channel.enableVoiceMessage=(Pn=(Un=n.groupChannel)===null||Un===void 0?void 0:Un.channel)===null||Pn===void 0?void 0:Pn.enableVoiceMessage),!((vn=n.groupChannel)===null||vn===void 0)&&vn.channel&&AL((Ot=(Fn=n.groupChannel)===null||Fn===void 0?void 0:Fn.channel)===null||Ot===void 0?void 0:Ot.typingIndicatorTypes)&&(e.channel.typingIndicatorTypes=(rn=(On=n.groupChannel)===null||On===void 0?void 0:On.channel)===null||rn===void 0?void 0:rn.typingIndicatorTypes),!((sn=n.groupChannel)===null||sn===void 0)&&sn.channel&&et((yn=(kn=n.groupChannel)===null||kn===void 0?void 0:kn.channel)===null||yn===void 0?void 0:yn.enableFeedback)&&(e.channel.enableFeedback=(Rn=(It=n.groupChannel)===null||It===void 0?void 0:It.channel)===null||Rn===void 0?void 0:Rn.enableFeedback),!((or=n.groupChannel)===null||or===void 0)&&or.channel&&et((En=(dn=n.groupChannel)===null||dn===void 0?void 0:dn.channel)===null||En===void 0?void 0:En.enableSuggestedReplies)&&(e.channel.enableSuggestedReplies=(Ut=(bn=n.groupChannel)===null||bn===void 0?void 0:bn.channel)===null||Ut===void 0?void 0:Ut.enableSuggestedReplies),!((Cn=n.groupChannel)===null||Cn===void 0)&&Cn.channel&&Qa((Hn=(Yt=n.groupChannel)===null||Yt===void 0?void 0:Yt.channel)===null||Hn===void 0?void 0:Hn.showSuggestedRepliesFor,["all_messages","last_message_only"])&&(e.channel.showSuggestedRepliesFor=(ar=(jn=n.groupChannel)===null||jn===void 0?void 0:jn.channel)===null||ar===void 0?void 0:ar.showSuggestedRepliesFor),!((Le=n.groupChannel)===null||Le===void 0)&&Le.channel&&Qa((he=(F=n.groupChannel)===null||F===void 0?void 0:F.channel)===null||he===void 0?void 0:he.suggestedRepliesDirection,["vertical","horizontal"])&&(e.channel.suggestedRepliesDirection=(Ge=(Me=n.groupChannel)===null||Me===void 0?void 0:Me.channel)===null||Ge===void 0?void 0:Ge.suggestedRepliesDirection)}function VL(e,n,t){var r,i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S,w,N,A,k,I,M,U,z,H,W,Q,$,Ne,X,ae,ne,Ce,K,ie,ee,ue,P,xe,B,te,oe,me,re,ce,de,fe,ve,_e,Ee,Be,ze,V,Se,Ue,le,Oe,tt,at,Pe,Ye,wt,_t,Rt,Lt,nn,Qt,un,Dt,Nt,xn,Bt,ft,cn,Un,Pn,vn,Fn,Ot,On,rn,sn,kn,yn,It,Rn,or,dn,En,bn,Ut,Cn,Yt,Hn,jn,ar,Le,F,he,Me,Ge,vt;!((i=(r=t.groupChannel)===null||r===void 0?void 0:r.channel)===null||i===void 0)&&i.input&&et((a=(o=(s=t.groupChannel)===null||s===void 0?void 0:s.channel)===null||o===void 0?void 0:o.input)===null||a===void 0?void 0:a.enableDocument)&&(e.channel.input.enableDocument=(c=(u=(l=t.groupChannel)===null||l===void 0?void 0:l.channel)===null||u===void 0?void 0:u.input)===null||c===void 0?void 0:c.enableDocument),!((h=(d=n.groupChannel)===null||d===void 0?void 0:d.channel)===null||h===void 0)&&h.input&&et((g=(p=(f=n.groupChannel)===null||f===void 0?void 0:f.channel)===null||p===void 0?void 0:p.input)===null||g===void 0?void 0:g.enableDocument)&&(e.channel.input.enableDocument=(_=(m=(b=n.groupChannel)===null||b===void 0?void 0:b.channel)===null||m===void 0?void 0:m.input)===null||_===void 0?void 0:_.enableDocument),!((w=(S=(E=t.groupChannel)===null||E===void 0?void 0:E.channel)===null||S===void 0?void 0:S.input)===null||w===void 0)&&w.camera&&et((I=(k=(A=(N=t.groupChannel)===null||N===void 0?void 0:N.channel)===null||A===void 0?void 0:A.input)===null||k===void 0?void 0:k.camera)===null||I===void 0?void 0:I.enablePhoto)&&(e.channel.input.camera.enablePhoto=(H=(z=(U=(M=t.groupChannel)===null||M===void 0?void 0:M.channel)===null||U===void 0?void 0:U.input)===null||z===void 0?void 0:z.camera)===null||H===void 0?void 0:H.enablePhoto),!(($=(Q=(W=n.groupChannel)===null||W===void 0?void 0:W.channel)===null||Q===void 0?void 0:Q.input)===null||$===void 0)&&$.camera&&et((ne=(ae=(X=(Ne=n.groupChannel)===null||Ne===void 0?void 0:Ne.channel)===null||X===void 0?void 0:X.input)===null||ae===void 0?void 0:ae.camera)===null||ne===void 0?void 0:ne.enablePhoto)&&(e.channel.input.camera.enablePhoto=(ee=(ie=(K=(Ce=n.groupChannel)===null||Ce===void 0?void 0:Ce.channel)===null||K===void 0?void 0:K.input)===null||ie===void 0?void 0:ie.camera)===null||ee===void 0?void 0:ee.enablePhoto),!((xe=(P=(ue=t.groupChannel)===null||ue===void 0?void 0:ue.channel)===null||P===void 0?void 0:P.input)===null||xe===void 0)&&xe.camera&&et((me=(oe=(te=(B=t.groupChannel)===null||B===void 0?void 0:B.channel)===null||te===void 0?void 0:te.input)===null||oe===void 0?void 0:oe.camera)===null||me===void 0?void 0:me.enableVideo)&&(e.channel.input.camera.enableVideo=(fe=(de=(ce=(re=t.groupChannel)===null||re===void 0?void 0:re.channel)===null||ce===void 0?void 0:ce.input)===null||de===void 0?void 0:de.camera)===null||fe===void 0?void 0:fe.enableVideo),!((Ee=(_e=(ve=n.groupChannel)===null||ve===void 0?void 0:ve.channel)===null||_e===void 0?void 0:_e.input)===null||Ee===void 0)&&Ee.camera&&et((Se=(V=(ze=(Be=n.groupChannel)===null||Be===void 0?void 0:Be.channel)===null||ze===void 0?void 0:ze.input)===null||V===void 0?void 0:V.camera)===null||Se===void 0?void 0:Se.enableVideo)&&(e.channel.input.camera.enableVideo=(tt=(Oe=(le=(Ue=n.groupChannel)===null||Ue===void 0?void 0:Ue.channel)===null||le===void 0?void 0:le.input)===null||Oe===void 0?void 0:Oe.camera)===null||tt===void 0?void 0:tt.enableVideo),!((Ye=(Pe=(at=t.groupChannel)===null||at===void 0?void 0:at.channel)===null||Pe===void 0?void 0:Pe.input)===null||Ye===void 0)&&Ye.gallery&&et((Lt=(Rt=(_t=(wt=t.groupChannel)===null||wt===void 0?void 0:wt.channel)===null||_t===void 0?void 0:_t.input)===null||Rt===void 0?void 0:Rt.gallery)===null||Lt===void 0?void 0:Lt.enablePhoto)&&(e.channel.input.gallery.enablePhoto=(Dt=(un=(Qt=(nn=t.groupChannel)===null||nn===void 0?void 0:nn.channel)===null||Qt===void 0?void 0:Qt.input)===null||un===void 0?void 0:un.gallery)===null||Dt===void 0?void 0:Dt.enablePhoto),!((Bt=(xn=(Nt=n.groupChannel)===null||Nt===void 0?void 0:Nt.channel)===null||xn===void 0?void 0:xn.input)===null||Bt===void 0)&&Bt.gallery&&et((Pn=(Un=(cn=(ft=n.groupChannel)===null||ft===void 0?void 0:ft.channel)===null||cn===void 0?void 0:cn.input)===null||Un===void 0?void 0:Un.gallery)===null||Pn===void 0?void 0:Pn.enablePhoto)&&(e.channel.input.gallery.enablePhoto=(On=(Ot=(Fn=(vn=n.groupChannel)===null||vn===void 0?void 0:vn.channel)===null||Fn===void 0?void 0:Fn.input)===null||Ot===void 0?void 0:Ot.gallery)===null||On===void 0?void 0:On.enablePhoto),!((kn=(sn=(rn=t.groupChannel)===null||rn===void 0?void 0:rn.channel)===null||sn===void 0?void 0:sn.input)===null||kn===void 0)&&kn.gallery&&et((or=(Rn=(It=(yn=t.groupChannel)===null||yn===void 0?void 0:yn.channel)===null||It===void 0?void 0:It.input)===null||Rn===void 0?void 0:Rn.gallery)===null||or===void 0?void 0:or.enableVideo)&&(e.channel.input.gallery.enableVideo=(Ut=(bn=(En=(dn=t.groupChannel)===null||dn===void 0?void 0:dn.channel)===null||En===void 0?void 0:En.input)===null||bn===void 0?void 0:bn.gallery)===null||Ut===void 0?void 0:Ut.enableVideo),!((Hn=(Yt=(Cn=n.groupChannel)===null||Cn===void 0?void 0:Cn.channel)===null||Yt===void 0?void 0:Yt.input)===null||Hn===void 0)&&Hn.gallery&&et((F=(Le=(ar=(jn=n.groupChannel)===null||jn===void 0?void 0:jn.channel)===null||ar===void 0?void 0:ar.input)===null||Le===void 0?void 0:Le.gallery)===null||F===void 0?void 0:F.enableVideo)&&(e.channel.input.gallery.enableVideo=(vt=(Ge=(Me=(he=n.groupChannel)===null||he===void 0?void 0:he.channel)===null||Me===void 0?void 0:Me.input)===null||Ge===void 0?void 0:Ge.gallery)===null||vt===void 0?void 0:vt.enableVideo)}function qL(e,n,t){var r,i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S;!((r=t.groupChannel)===null||r===void 0)&&r.channelList&&et((s=(i=t.groupChannel)===null||i===void 0?void 0:i.channelList)===null||s===void 0?void 0:s.enableTypingIndicator)&&(e.channelList.enableTypingIndicator=t.groupChannel.channelList.enableTypingIndicator),!((o=n.groupChannel)===null||o===void 0)&&o.channelList&&et((l=(a=n.groupChannel)===null||a===void 0?void 0:a.channelList)===null||l===void 0?void 0:l.enableTypingIndicator)&&(e.channelList.enableTypingIndicator=(c=(u=n.groupChannel)===null||u===void 0?void 0:u.channelList)===null||c===void 0?void 0:c.enableTypingIndicator),!((d=t.groupChannel)===null||d===void 0)&&d.channelList&&et((f=(h=t.groupChannel)===null||h===void 0?void 0:h.channelList)===null||f===void 0?void 0:f.enableMessageReceiptStatus)&&(e.channelList.enableMessageReceiptStatus=(g=(p=t.groupChannel)===null||p===void 0?void 0:p.channelList)===null||g===void 0?void 0:g.enableMessageReceiptStatus),!((b=n.groupChannel)===null||b===void 0)&&b.channelList&&et((_=(m=n.groupChannel)===null||m===void 0?void 0:m.channelList)===null||_===void 0?void 0:_.enableMessageReceiptStatus)&&(e.channelList.enableMessageReceiptStatus=(S=(E=n.groupChannel)===null||E===void 0?void 0:E.channelList)===null||S===void 0?void 0:S.enableMessageReceiptStatus)}function WL(e,n,t){var r,i,s,o,a,l,u,c;!((r=t.groupChannel)===null||r===void 0)&&r.setting&&et((s=(i=t.groupChannel)===null||i===void 0?void 0:i.setting)===null||s===void 0?void 0:s.enableMessageSearch)&&(e.setting.enableMessageSearch=t.groupChannel.setting.enableMessageSearch),!((o=n.groupChannel)===null||o===void 0)&&o.setting&&et((l=(a=n.groupChannel)===null||a===void 0?void 0:a.setting)===null||l===void 0?void 0:l.enableMessageSearch)&&(e.setting.enableMessageSearch=(c=(u=n.groupChannel)===null||u===void 0?void 0:u.setting)===null||c===void 0?void 0:c.enableMessageSearch)}function KL(e,n,t){QL(e,n,t),YL(e,n,t)}function QL(e,n,t){var r,i,s,o,a,l,u,c;!((r=t.openChannel)===null||r===void 0)&&r.channel&&et((s=(i=t.openChannel)===null||i===void 0?void 0:i.channel)===null||s===void 0?void 0:s.enableOgtag)&&(e.channel.enableOgtag=t.openChannel.channel.enableOgtag),!((o=n.openChannel)===null||o===void 0)&&o.channel&&et((l=(a=n.openChannel)===null||a===void 0?void 0:a.channel)===null||l===void 0?void 0:l.enableOgtag)&&(e.channel.enableOgtag=(c=(u=n.openChannel)===null||u===void 0?void 0:u.channel)===null||c===void 0?void 0:c.enableOgtag)}function YL(e,n,t){var r,i,s,o,a,l,u,c,d,h,f,p,g,b,m,_,E,S,w,N,A,k,I,M,U,z,H,W,Q,$,Ne,X,ae,ne,Ce,K,ie,ee,ue,P,xe,B,te,oe,me,re,ce,de,fe,ve,_e,Ee,Be,ze,V,Se,Ue,le,Oe,tt,at,Pe,Ye,wt,_t,Rt,Lt,nn,Qt,un,Dt,Nt,xn,Bt,ft,cn,Un,Pn,vn,Fn,Ot,On,rn,sn,kn,yn,It,Rn,or,dn,En,bn,Ut,Cn,Yt,Hn,jn,ar,Le,F,he,Me,Ge,vt;!((i=(r=t.openChannel)===null||r===void 0?void 0:r.channel)===null||i===void 0)&&i.input&&et((a=(o=(s=t.openChannel)===null||s===void 0?void 0:s.channel)===null||o===void 0?void 0:o.input)===null||a===void 0?void 0:a.enableDocument)&&(e.channel.input.enableDocument=(c=(u=(l=t.openChannel)===null||l===void 0?void 0:l.channel)===null||u===void 0?void 0:u.input)===null||c===void 0?void 0:c.enableDocument),!((h=(d=n.openChannel)===null||d===void 0?void 0:d.channel)===null||h===void 0)&&h.input&&et((g=(p=(f=n.openChannel)===null||f===void 0?void 0:f.channel)===null||p===void 0?void 0:p.input)===null||g===void 0?void 0:g.enableDocument)&&(e.channel.input.enableDocument=(_=(m=(b=n.openChannel)===null||b===void 0?void 0:b.channel)===null||m===void 0?void 0:m.input)===null||_===void 0?void 0:_.enableDocument),!((w=(S=(E=t.openChannel)===null||E===void 0?void 0:E.channel)===null||S===void 0?void 0:S.input)===null||w===void 0)&&w.camera&&et((I=(k=(A=(N=t.openChannel)===null||N===void 0?void 0:N.channel)===null||A===void 0?void 0:A.input)===null||k===void 0?void 0:k.camera)===null||I===void 0?void 0:I.enablePhoto)&&(e.channel.input.camera.enablePhoto=(H=(z=(U=(M=t.openChannel)===null||M===void 0?void 0:M.channel)===null||U===void 0?void 0:U.input)===null||z===void 0?void 0:z.camera)===null||H===void 0?void 0:H.enablePhoto),!(($=(Q=(W=n.openChannel)===null||W===void 0?void 0:W.channel)===null||Q===void 0?void 0:Q.input)===null||$===void 0)&&$.camera&&et((ne=(ae=(X=(Ne=n.openChannel)===null||Ne===void 0?void 0:Ne.channel)===null||X===void 0?void 0:X.input)===null||ae===void 0?void 0:ae.camera)===null||ne===void 0?void 0:ne.enablePhoto)&&(e.channel.input.camera.enablePhoto=(ee=(ie=(K=(Ce=n.openChannel)===null||Ce===void 0?void 0:Ce.channel)===null||K===void 0?void 0:K.input)===null||ie===void 0?void 0:ie.camera)===null||ee===void 0?void 0:ee.enablePhoto),!((xe=(P=(ue=t.openChannel)===null||ue===void 0?void 0:ue.channel)===null||P===void 0?void 0:P.input)===null||xe===void 0)&&xe.camera&&et((me=(oe=(te=(B=t.openChannel)===null||B===void 0?void 0:B.channel)===null||te===void 0?void 0:te.input)===null||oe===void 0?void 0:oe.camera)===null||me===void 0?void 0:me.enableVideo)&&(e.channel.input.camera.enableVideo=(fe=(de=(ce=(re=t.openChannel)===null||re===void 0?void 0:re.channel)===null||ce===void 0?void 0:ce.input)===null||de===void 0?void 0:de.camera)===null||fe===void 0?void 0:fe.enableVideo),!((Ee=(_e=(ve=n.openChannel)===null||ve===void 0?void 0:ve.channel)===null||_e===void 0?void 0:_e.input)===null||Ee===void 0)&&Ee.camera&&et((Se=(V=(ze=(Be=n.openChannel)===null||Be===void 0?void 0:Be.channel)===null||ze===void 0?void 0:ze.input)===null||V===void 0?void 0:V.camera)===null||Se===void 0?void 0:Se.enableVideo)&&(e.channel.input.camera.enableVideo=(tt=(Oe=(le=(Ue=n.openChannel)===null||Ue===void 0?void 0:Ue.channel)===null||le===void 0?void 0:le.input)===null||Oe===void 0?void 0:Oe.camera)===null||tt===void 0?void 0:tt.enableVideo),!((Ye=(Pe=(at=t.openChannel)===null||at===void 0?void 0:at.channel)===null||Pe===void 0?void 0:Pe.input)===null||Ye===void 0)&&Ye.gallery&&et((Lt=(Rt=(_t=(wt=t.openChannel)===null||wt===void 0?void 0:wt.channel)===null||_t===void 0?void 0:_t.input)===null||Rt===void 0?void 0:Rt.gallery)===null||Lt===void 0?void 0:Lt.enablePhoto)&&(e.channel.input.gallery.enablePhoto=(Dt=(un=(Qt=(nn=t.openChannel)===null||nn===void 0?void 0:nn.channel)===null||Qt===void 0?void 0:Qt.input)===null||un===void 0?void 0:un.gallery)===null||Dt===void 0?void 0:Dt.enablePhoto),!((Bt=(xn=(Nt=n.openChannel)===null||Nt===void 0?void 0:Nt.channel)===null||xn===void 0?void 0:xn.input)===null||Bt===void 0)&&Bt.gallery&&et((Pn=(Un=(cn=(ft=n.openChannel)===null||ft===void 0?void 0:ft.channel)===null||cn===void 0?void 0:cn.input)===null||Un===void 0?void 0:Un.gallery)===null||Pn===void 0?void 0:Pn.enablePhoto)&&(e.channel.input.gallery.enablePhoto=(On=(Ot=(Fn=(vn=n.openChannel)===null||vn===void 0?void 0:vn.channel)===null||Fn===void 0?void 0:Fn.input)===null||Ot===void 0?void 0:Ot.gallery)===null||On===void 0?void 0:On.enablePhoto),!((kn=(sn=(rn=t.openChannel)===null||rn===void 0?void 0:rn.channel)===null||sn===void 0?void 0:sn.input)===null||kn===void 0)&&kn.gallery&&et((or=(Rn=(It=(yn=t.openChannel)===null||yn===void 0?void 0:yn.channel)===null||It===void 0?void 0:It.input)===null||Rn===void 0?void 0:Rn.gallery)===null||or===void 0?void 0:or.enableVideo)&&(e.channel.input.gallery.enableVideo=(Ut=(bn=(En=(dn=t.openChannel)===null||dn===void 0?void 0:dn.channel)===null||En===void 0?void 0:En.input)===null||bn===void 0?void 0:bn.gallery)===null||Ut===void 0?void 0:Ut.enableVideo),!((Hn=(Yt=(Cn=n.openChannel)===null||Cn===void 0?void 0:Cn.channel)===null||Yt===void 0?void 0:Yt.input)===null||Hn===void 0)&&Hn.gallery&&et((F=(Le=(ar=(jn=n.openChannel)===null||jn===void 0?void 0:jn.channel)===null||ar===void 0?void 0:ar.input)===null||Le===void 0?void 0:Le.gallery)===null||F===void 0?void 0:F.enableVideo)&&(e.channel.input.gallery.enableVideo=(vt=(Ge=(Me=(he=n.openChannel)===null||he===void 0?void 0:he.channel)===null||Me===void 0?void 0:Me.input)===null||Ge===void 0?void 0:Ge.gallery)===null||vt===void 0?void 0:vt.enableVideo)}function ZL(e,n){const t=ov();return $L(t.common,e,n),GL(t.groupChannel,e,n),KL(t.openChannel,e,n),t}function XL(e){return typeof e=="object"&&"configuration"in e&&"updated_at"in e}var JL=function(e,n,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((r=r.apply(e,n||[])).next())})};function hu(e){var n,t;return(t=(n=e.appInfo)===null||n===void 0?void 0:n.applicationAttributes)!==null&&t!==void 0?t:[]}const jS=D.createContext({initDashboardConfigs:()=>Promise.resolve(),configs:My,configsWithAppAttr:()=>My}),e5=({storage:e,children:n,localConfigs:t={}})=>{const[r,i]=D.useState(HS),[s]=D.useState(()=>new BL(e)),o=D.useCallback(u=>JL(void 0,void 0,void 0,function*(){const c=yield s.init(u.appId);if(u.appInfo&&u.appInfo.uikitConfigInfo.lastUpdatedAt===c.updatedAt)i(c.configuration);else try{const d=yield u.getUIKitConfiguration();if(XL(d.json)){const h=Sm(d.json),f=yield s.update(h);i(f.configuration)}}catch{i(c.configuration)}}),[s]),a=ZL(t,r),l=fn(u=>({groupChannel:{channel:{get enableReactions(){return a.groupChannel.channel.enableReactions&&hu(u).includes(au.reactions)},get enableReactionsSupergroup(){return a.groupChannel.channel.enableReactionsSupergroup&&hu(u).includes(au.reactions)},get enableOgtag(){return a.groupChannel.channel.enableOgtag&&hu(u).includes(au.enable_og_tag)}},setting:{get enableMessageSearch(){return a.groupChannel.setting.enableMessageSearch&&hu(u).includes(au.message_search_v3)}}},openChannel:{channel:{get enableOgtag(){return a.openChannel.channel.enableOgtag&&hu(u).includes(au.enable_og_tag)}}}}));return mt.createElement(jS.Provider,{value:{initDashboardConfigs:o,configs:a,configsWithAppAttr:l}},n)},t5=()=>D.useContext(jS),BS=mt.createContext(null);/*! * css-vars-ponyfill * v2.4.9 diff --git a/assets/index-CN2QRy4k.css b/assets/index-CN2QRy4k.css new file mode 100644 index 000000000..75e158fa8 --- /dev/null +++ b/assets/index-CN2QRy4k.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css?family=Open+Sans:400,600,700&display=swap";.sendbird-message-content-menu__reaction-menu{display:none}.sendbird-theme--light{margin:0!important}.sendbird-conversation__footer{padding-bottom:0!important;margin:0!important}#root{height:100%;border:none!important}.sendbird-conversation{border:none!important}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.loading-spinner{width:50px;height:50px;border:10px solid #b771fd;border-top:10px solid white;border-radius:50%;animation:spinner 1.5s linear infinite}.spinner-container{display:grid;justify-content:center;align-items:center;height:350px}.sendbird-conversation__messages-padding{padding:0 16px!important}.sendbird-message-input .sendbird-message-input-text-field{overflow-y:hidden}.sendbird-modal__content{width:calc(100% - 20px)}.sendbird-fileviewer__header__left{max-width:272px}.sendbird-fileviewer{outline:none}textarea:focus:active,input:focus:active{outline:none}.sendbird-ai-widget-file-message-root{width:100%}.sendbird-ai-widget-file-message{border-radius:16px;width:100%}.sendbird-word__url{font-weight:700;color:#000;text-decoration:underline}.sendbird-message-content__middle__body-container__feedback-buttons-container{margin-top:4px;position:relative;display:flex;gap:4px}.sendbird-modal-root{position:absolute;z-index:2147483647}:root{--sendbird-light-primary-500: #491389;--sendbird-light-primary-400: #6211c8;--sendbird-light-primary-300: #742ddd;--sendbird-light-primary-200: #c2a9fa;--sendbird-light-primary-100: #dbd1ff;--sendbird-light-secondary-500: #066858;--sendbird-light-secondary-400: #027d69;--sendbird-light-secondary-300: #259c72;--sendbird-light-secondary-200: #69c085;--sendbird-light-secondary-100: #a8e2ab;--sendbird-light-information-100: #adc9ff;--sendbird-highlight-100: #fff2b6;--sendbird-light-error-500: #9d091e;--sendbird-light-error-400: #bf0711;--sendbird-light-error-300: #de360b;--sendbird-light-error-200: #f66161;--sendbird-light-error-100: #fdaaaa;--sendbird-light-background-700: #000000;--sendbird-light-background-600: #161616;--sendbird-light-background-500: #2C2C2C;--sendbird-light-background-400: #393939;--sendbird-light-background-300: #bdbdbd;--sendbird-light-background-200: #e0e0e0;--sendbird-light-background-100: #eeeeee;--sendbird-light-background-50: #FFFFFF;--sendbird-light-overlay-01: rgba(0, 0, 0, .55);--sendbird-light-overlay-02: rgba(0, 0, 0, .32);--sendbird-light-onlight-01: rgba(0, 0, 0, .88);--sendbird-light-onlight-02: rgba(0, 0, 0, .5);--sendbird-light-onlight-03: rgba(0, 0, 0, .38);--sendbird-light-onlight-04: rgba(0, 0, 0, .12);--sendbird-light-onlight-05: rgba(0, 0, 0, .44);--sendbird-light-ondark-01: rgba(255, 255, 255, .88);--sendbird-light-ondark-02: rgba(255, 255, 255, .5);--sendbird-light-ondark-03: rgba(255, 255, 255, .38);--sendbird-light-ondark-04: rgba(255, 255, 255, .12);--sendbird-light-shadow-01: 0 1px 5px 0 rgba(33, 34, 66, .04), 0 0 3px 0 rgba(0, 0, 0, .08), 0 2px 1px 0 rgba(0, 0, 0, .12);--sendbird-light-shadow-02: 0 3px 5px -3px rgba(33, 34, 66, .04), 0 3px 14px 2px rgba(0, 0, 0, .08), 0 8px 10px 1px rgba(0, 0, 0, .12);--sendbird-light-shadow-03: 0 6px 10px -5px rgba(0, 0, 0, .04), 0 6px 30px 5px rgba(0, 0, 0, .08), 0 16px 24px 2px rgba(0, 0, 0, .12);--sendbird-light-shadow-04: 0 9px 15px -7px rgba(0, 0, 0, .04), 0 9px 46px 8px rgba(0, 0, 0, .08), 0 24px 38px 3px rgba(0, 0, 0, .12);--sendbird-light-shadow-05: 0 2px 8px 0 rgba(0, 0, 0, .08), 0 4px 6px 0 rgba(0, 0, 0, .12);--sendbird-light-shadow-message-input: 0 1px 5px 0 rgba(33, 34, 66, .12), 0 0 1px 0 rgba(33, 34, 66, .16), 0 2px 1px 0 rgba(33, 34, 66, .08), 0 1px 5px 0 rgba(0, 0, 0, .12)}:root{--sendbird-dark-primary-500: #491389;--sendbird-dark-primary-400: #6211c8;--sendbird-dark-primary-300: #742ddd;--sendbird-dark-primary-200: #c2a9fa;--sendbird-dark-primary-100: #dbd1ff;--sendbird-dark-secondary-500: #066858;--sendbird-dark-secondary-400: #027d69;--sendbird-dark-secondary-300: #259c72;--sendbird-dark-secondary-200: #69c085;--sendbird-dark-secondary-100: #a8e2ab;--sendbird-dark-information-100: #adc9ff;--sendbird-highlight-100: #fff2b6;--sendbird-dark-error-500: #9d091e;--sendbird-dark-error-400: #bf0711;--sendbird-dark-error-300: #de360b;--sendbird-dark-error-200: #f66161;--sendbird-dark-error-100: #fdaaaa;--sendbird-dark-background-700: #000000;--sendbird-dark-background-600: #161616;--sendbird-dark-background-500: #2C2C2C;--sendbird-dark-background-400: #393939;--sendbird-dark-background-300: #bdbdbd;--sendbird-dark-background-200: #e0e0e0;--sendbird-dark-background-100: #eeeeee;--sendbird-dark-background-50: #FFFFFF;--sendbird-dark-overlay-01: rgba(0, 0, 0, .55);--sendbird-dark-overlay-02: rgba(0, 0, 0, .32);--sendbird-dark-onlight-01: rgba(0, 0, 0, .88);--sendbird-dark-onlight-02: rgba(0, 0, 0, .5);--sendbird-dark-onlight-03: rgba(0, 0, 0, .38);--sendbird-dark-onlight-04: rgba(0, 0, 0, .12);--sendbird-dark-ondark-01: rgba(255, 255, 255, .88);--sendbird-dark-ondark-02: rgba(255, 255, 255, .5);--sendbird-dark-ondark-03: rgba(255, 255, 255, .38);--sendbird-dark-ondark-04: rgba(255, 255, 255, .12);--sendbird-dark-ondark-05: rgba(255, 255, 255, .44);--sendbird-dark-shadow-01: 0 1px 5px 0 rgba(33, 34, 66, .04), 0 0 3px 0 rgba(0, 0, 0, .08), 0 2px 1px 0 rgba(0, 0, 0, .12);--sendbird-dark-shadow-02: 0 3px 5px -3px rgba(33, 34, 66, .04), 0 3px 14px 2px rgba(0, 0, 0, .08), 0 8px 10px 1px rgba(0, 0, 0, .12);--sendbird-dark-shadow-03: 0 6px 10px -5px rgba(0, 0, 0, .04), 0 6px 30px 5px rgba(0, 0, 0, .08), 0 16px 24px 2px rgba(0, 0, 0, .12);--sendbird-dark-shadow-04: 0 9px 15px -7px rgba(0, 0, 0, .04), 0 9px 46px 8px rgba(0, 0, 0, .08), 0 24px 38px 3px rgba(0, 0, 0, .12);--sendbird-light-shadow-05: 0 2px 8px 0 rgba(0, 0, 0, .08), 0 4px 6px 0 rgba(0, 0, 0, .12);--sendbird-dark-shadow-message-input: 0 1px 5px 0 rgba(33, 34, 66, .12), 0 0 1px 0 rgba(33, 34, 66, .16), 0 2px 1px 0 rgba(33, 34, 66, .08), 0 1px 5px 0 rgba(0, 0, 0, .12)}:root{--sendbird-iconbutton-color: #825eeb;--sendbird-message-input-border-active: #7B53EF;--sendbird-selected-reaction-button-border-hover: #9E8CF5;--sendbird-add-reaction-button-border-hover: #9E8CF5;--sendbird-tooltip-background: #000000;--sendbird-tooltip-text-color: rgba(255, 255, 255, .88);--sendbird-button-border-focus: #FFFFFF;--sendbird-file-message-icon-background: #FFFFFF;--sendbird-font-family-default: "Roboto", sans-serif;--sendbird-message-balloon-width: 404px}.sendbird-experimental__rem__units .sendbird-label--h-1{font-size:1.25rem}.sendbird-experimental__rem__units .sendbird-label--h-2{font-size:1.125rem}.sendbird-experimental__rem__units .sendbird-label--subtitle-1{font-size:1rem}.sendbird-experimental__rem__units .sendbird-label--subtitle-2,.sendbird-experimental__rem__units .sendbird-label--body-1{font-size:.875rem}.sendbird-experimental__rem__units .sendbird-label--body-2{font-size:.75rem}.sendbird-experimental__rem__units .sendbird-label--button-1,.sendbird-experimental__rem__units .sendbird-label--button-2,.sendbird-experimental__rem__units .sendbird-label--caption-1{font-size:.875rem}.sendbird-experimental__rem__units .sendbird-label--caption-2,.sendbird-experimental__rem__units .sendbird-label--caption-3{font-size:.75rem}.sendbird-experimental__rem__units .sendbird-message-search-pannel .sendbird-message-search-pannel__input__container__input-area{font-size:.875rem}.sendbird-experimental__rem__units .sendbird-checkbox{font-size:1.375rem}.sendbird-experimental__rem__units .sendbird-mention-user-label{font-size:.875rem}.sendbird-experimental__rem__units .sendbird-mention-user-label.purple{font-size:1.125rem}.sendbird-experimental__rem__units .sendbird-message-input .sendbird-message-input--textarea,.sendbird-experimental__rem__units .sendbird-message-input .sendbird-message-input--placeholder,.sendbird-experimental__rem__units .sendbird-input .sendbird-input__input,.sendbird-experimental__rem__units .sendbird-input .sendbird-input__placeholder{font-size:.875rem}.sendbird-experimental__rem__units .sendbird-tooltip__text,.sendbird-experimental__rem__units .sendbird-quote-message .sendbird-quote-message__replied-to .sendbird-quote-message__replied-to__text,.sendbird-experimental__rem__units .sendbird-quote-message .sendbird-quote-message__replied-message .sendbird-quote-message__replied-message__text-message,.sendbird-experimental__rem__units .sendbird-quote-message .sendbird-quote-message__replied-message__file-message{font-size:.75rem}.sendbird-modal--full-mobile .sendbird-modal__content{width:100vw;max-width:100%;height:100%}.sendbird-modal{position:fixed;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.sendbird-modal__backdrop--clickoutside{cursor:pointer}.sendbird-modal__content{width:480px;border-radius:4px;z-index:10001;padding:18px 24px 24px;position:relative;box-sizing:border-box}.sendbird-theme--light .sendbird-modal__content{background-color:var(--sendbird-light-background-50);box-shadow:var(--sendbird-light-shadow-04)}.sendbird-theme--dark .sendbird-modal__content{background-color:var(--sendbird-dark-background-500);box-shadow:var(--sendbird-dark-shadow-04)}.sendbird-modal__content .sendbird-modal__close{position:absolute;top:16px;right:16px;cursor:pointer}.sendbird-theme--light .sendbird-modal__content .sendbird-modal__close path{fill:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-modal__content .sendbird-modal__close path{fill:var(--sendbird-dark-ondark-01)}.sendbird-modal__content .sendbird-modal__header{margin-bottom:16px}.sendbird-modal__content .sendbird-modal__body{height:calc(100% - 116px)}.sendbird-modal__content .sendbird-modal__footer{display:flex;flex-direction:row;justify-content:flex-end;margin-top:32px;text-align:right}.sendbird--mobile-mode .sendbird-modal__content .sendbird-modal__footer{position:sticky;bottom:24px}.sendbird-modal__content .sendbird-modal__footer .sendbird-button:last-child{margin-left:8px;min-width:80px;height:40px}.sendbird-modal__backdrop{position:fixed;z-index:10000;height:100%;width:100%;top:0;left:0}.sendbird-theme--light .sendbird-modal__backdrop{background-color:var(--sendbird-light-overlay-02)}.sendbird-theme--dark .sendbird-modal__backdrop{background-color:var(--sendbird-dark-overlay-02)}.sendbird-iconbutton{color:var(--sendbird-iconbutton-color);display:inline-flex;justify-content:center;align-items:center;padding:3px;background-color:transparent;cursor:pointer;-webkit-user-select:none;user-select:none;border:1px solid transparent;border-radius:4px;outline:0px}.sendbird-iconbutton .sendbird-iconbutton__inner{height:100%}.sendbird-theme--light .sendbird-iconbutton .sendbird-iconbutton__inner svg{fill:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-iconbutton .sendbird-iconbutton__inner svg{fill:var(--sendbird-dark-ondark-01)}.sendbird-theme--light .sendbird-iconbutton:hover{background-color:var(--sendbird-light-background-100)}.sendbird-theme--dark .sendbird-iconbutton:hover{background-color:var(--sendbird-dark-background-500)}.sendbird-theme--light .sendbird-iconbutton:active{background-color:var(--sendbird-light-background-200)}.sendbird-theme--dark .sendbird-iconbutton:active{background-color:var(--sendbird-dark-background-400)}.sendbird-iconbutton:disabled{cursor:not-allowed!important}.sendbird-theme--light .sendbird-iconbutton:disabled .sendbird-iconbutton__inner svg,.sendbird-theme--light .sendbird-iconbutton:disabled .sendbird-iconbutton__inner path{fill:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-iconbutton:disabled .sendbird-iconbutton__inner svg,.sendbird-theme--dark .sendbird-iconbutton:disabled .sendbird-iconbutton__inner path{fill:var(--sendbird-dark-ondark-02)}.sendbird-theme--light .sendbird-iconbutton--pressed{background-color:var(--sendbird-light-primary-100)}.sendbird-theme--dark .sendbird-iconbutton--pressed{background-color:var(--sendbird-dark-background-700)}.sendbird-button{border-radius:4px;box-shadow:none;cursor:pointer;font-family:var(--sendbird-font-family-default);padding:0;display:inline-flex;justify-content:center;align-items:center}.sendbird-button:hover{box-shadow:none}.sendbird-button:focus{outline:none}.sendbird-button:active{box-shadow:none}.sendbird-button.sendbird-button__disabled{cursor:not-allowed}.sendbird-theme--light .sendbird-button.sendbird-button__disabled{background-color:var(--sendbird-light-background-200);border:none}.sendbird-theme--dark .sendbird-button.sendbird-button__disabled{background-color:var(--sendbird-dark-background-400);border:none}.sendbird-theme--light .sendbird-button.sendbird-button__disabled:hover{background-color:var(--sendbird-light-background-200)}.sendbird-theme--dark .sendbird-button.sendbird-button__disabled:hover{background-color:var(--sendbird-dark-background-400)}.sendbird-button--big{height:40px}.sendbird-button--big .sendbird-button__text{margin:10px 16px}.sendbird-button--small{height:32px}.sendbird-button--small .sendbird-button__text{margin:6px 16px}.sendbird-theme--light .sendbird-button--primary{background-color:var(--sendbird-light-primary-300);border:1px solid var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-button--primary{background-color:var(--sendbird-dark-primary-200);border:1px solid var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-button--primary .sendbird-button__text{color:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-button--primary .sendbird-button__text{color:var(--sendbird-dark-onlight-01)}.sendbird-theme--light .sendbird-button--primary:hover{background-color:var(--sendbird-light-primary-400);border-color:var(--sendbird-light-primary-400)}.sendbird-theme--dark .sendbird-button--primary:hover{background-color:var(--sendbird-dark-primary-300);border-color:var(--sendbird-dark-primary-300)}.sendbird-theme--light .sendbird-button--primary:focus{border:1px solid var(--sendbird-button-border-focus);box-shadow:0 0 0 2px var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-button--primary:focus{border:1px solid var(--sendbird-button-border-focus);box-shadow:0 0 0 2px var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-button--primary:active{background-color:var(--sendbird-light-primary-500)}.sendbird-theme--dark .sendbird-button--primary:active{background-color:var(--sendbird-dark-primary-400)}.sendbird-theme--light .sendbird-button--primary:focus .sendbird-button--primary:hover{box-shadow:0 0 0 2px var(--sendbird-light-primary-400)}.sendbird-theme--dark .sendbird-button--primary:focus .sendbird-button--primary:hover{box-shadow:0 0 0 2px var(--sendbird-dark-primary-300)}.sendbird-theme--light .sendbird-button--primary:focus .sendbird-button--primary:active{box-shadow:0 0 0 2px var(--sendbird-light-primary-500)}.sendbird-theme--dark .sendbird-button--primary:focus .sendbird-button--primary:active{box-shadow:0 0 0 2px var(--sendbird-dark-primary-400)}.sendbird-button--secondary{background-color:transparent}.sendbird-theme--light .sendbird-button--secondary{border:1px solid var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-button--secondary{border:1px solid var(--sendbird-dark-ondark-03)}.sendbird-theme--light .sendbird-button--secondary .sendbird-button__text{color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-button--secondary .sendbird-button__text{color:var(--sendbird-dark-ondark-01)}.sendbird-button--secondary:hover{background-color:transparent}.sendbird-theme--light .sendbird-button--secondary:hover{border:1px solid var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-button--secondary:hover{border:1px solid var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-button--secondary:hover .sendbird-button__text{color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-button--secondary:hover .sendbird-button__text{color:var(--sendbird-dark-primary-200)}.sendbird-button--secondary.sendbird-button__disabled{border:none;cursor:not-allowed}.sendbird-theme--light .sendbird-button--secondary.sendbird-button__disabled{background-color:var(--sendbird-light-background-200)}.sendbird-theme--dark .sendbird-button--secondary.sendbird-button__disabled{background-color:var(--sendbird-dark-background-400)}.sendbird-theme--light .sendbird-button--secondary.sendbird-button__disabled .sendbird-button__text{color:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-button--secondary.sendbird-button__disabled .sendbird-button__text{color:var(--sendbird-dark-ondark-02)}.sendbird-button--secondary.sendbird-button__disabled:hover{border:none}.sendbird-theme--light .sendbird-button--secondary.sendbird-button__disabled:hover{background-color:var(--sendbird-light-background-200)}.sendbird-theme--dark .sendbird-button--secondary.sendbird-button__disabled:hover{background-color:var(--sendbird-dark-background-400)}.sendbird-theme--light .sendbird-button--secondary.sendbird-button__disabled:hover .sendbird-button__text{color:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-button--secondary.sendbird-button__disabled:hover .sendbird-button__text{color:var(--sendbird-dark-ondark-02)}.sendbird-theme--light .sendbird-button--secondary:hover .sendbird-button--secondary:focus .sendbird-button__text{color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-button--secondary:hover .sendbird-button--secondary:focus .sendbird-button__text{color:var(--sendbird-dark-primary-200)}.sendbird-button--secondary:focus{background-color:transparent;border:1px solid transparent}.sendbird-theme--light .sendbird-button--secondary:focus{box-shadow:var(--sendbird-light-primary-300) 0 0 0 2px}.sendbird-theme--dark .sendbird-button--secondary:focus{box-shadow:var(--sendbird-dark-primary-200) 0 0 0 2px}.sendbird-theme--light .sendbird-button--secondary:focus .sendbird-button__text{color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-button--secondary:focus .sendbird-button__text{color:var(--sendbird-dark-ondark-01)}.sendbird-button--secondary:active{box-shadow:none}.sendbird-theme--light .sendbird-button--secondary:active{border:1px solid var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-button--secondary:active{border:1px solid var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-button--secondary:active .sendbird-button__text{color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-button--secondary:active .sendbird-button__text{color:var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-button--warning{background-color:transparent;border:1px solid var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-button--warning{background-color:transparent;border:1px solid var(--sendbird-dark-error-200)}.sendbird-theme--light .sendbird-button--warning .sendbird-button__text{color:var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-button--warning .sendbird-button__text{color:var(--sendbird-dark-error-200)}.sendbird-theme--light .sendbird-button--warning:hover{border-color:var(--sendbird-light-error-400)}.sendbird-theme--dark .sendbird-button--warning:hover{border-color:var(--sendbird-dark-error-100)}.sendbird-theme--light .sendbird-button--warning:hover .sendbird-button__text{color:var(--sendbird-light-error-400)}.sendbird-theme--dark .sendbird-button--warning:hover .sendbird-button__text{color:var(--sendbird-dark-error-100)}.sendbird-theme--light .sendbird-button--warning:focus{border-color:var(--sendbird-light-primary-300)}.sendbird-theme--light .sendbird-theme--light .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-theme--light .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-dark-error-200)}.sendbird-theme--dark .sendbird-button--warning:focus{border-color:var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-theme--dark .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-theme--dark .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-dark-error-200)}.sendbird-theme--light .sendbird-button--warning:hover .sendbird-button--warning:focus{border-color:var(--sendbird-light-primary-300)}.sendbird-theme--light .sendbird-theme--light .sendbird-button--warning:hover .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-light-error-400)}.sendbird-theme--dark .sendbird-theme--light .sendbird-button--warning:hover .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-dark-error-100)}.sendbird-theme--dark .sendbird-button--warning:hover .sendbird-button--warning:focus{border-color:var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-theme--dark .sendbird-button--warning:hover .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-light-error-400)}.sendbird-theme--dark .sendbird-theme--dark .sendbird-button--warning:hover .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-dark-error-100)}.sendbird-theme--light .sendbird-button--danger{background-color:var(--sendbird-light-error-300);border:1px solid var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-button--danger{background-color:var(--sendbird-dark-error-200);border:1px solid var(--sendbird-dark-error-200)}.sendbird-theme--light .sendbird-button--danger .sendbird-button__text{color:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-button--danger .sendbird-button__text{color:var(--sendbird-dark-onlight-01)}.sendbird-theme--light .sendbird-button--danger:hover{background-color:var(--sendbird-light-error-400);border-color:var(--sendbird-light-error-400)}.sendbird-theme--dark .sendbird-button--danger:hover{background-color:var(--sendbird-dark-error-400);border-color:var(--sendbird-dark-error-400)}.sendbird-theme--light .sendbird-button--danger:focus{border-color:var(--sendbird-button-border-focus);box-shadow:0 0 0 2px var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-button--danger:focus{border-color:var(--sendbird-button-border-focus);box-shadow:0 0 0 2px var(--sendbird-dark-error-300)}.sendbird-button--danger:active{box-shadow:none}.sendbird-theme--light .sendbird-button--danger:active{background-color:var(--sendbird-light-error-500)}.sendbird-theme--dark .sendbird-button--danger:active{background-color:var(--sendbird-dark-error-500)}.sendbird-theme--light .sendbird-button--danger:hover .sendbird-button--danger:focus{box-shadow:0 0 0 2px var(--sendbird-light-error-400)}.sendbird-theme--dark .sendbird-button--danger:hover .sendbird-button--danger:focus{box-shadow:0 0 0 2px var(--sendbird-dark-error-400)}.sendbird-theme--light .sendbird-button--danger:active .sendbird-button--danger:focus{box-shadow:0 0 0 2px var(--sendbird-light-error-500)}.sendbird-theme--dark .sendbird-button--danger:active .sendbird-button--danger:focus{box-shadow:0 0 0 2px var(--sendbird-dark-error-500)}.sendbird-button--disabled{border:1px solid transparent;cursor:not-allowed}.sendbird-theme--light .sendbird-button--disabled{background-color:var(--sendbird-light-background-200);color:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-button--disabled{background-color:var(--sendbird-dark-background-400);color:var(--sendbird-dark-onlight-01)}.sendbird--mobile-mode .sendbird-label{-webkit-user-select:none;-webkit-touch-callout:none}[class*=sendbird-label]{font-family:var(--sendbird-font-family-default)}.sendbird-label--h-1{font-size:20px;font-weight:600;font-stretch:normal;font-style:normal;line-height:1.4;letter-spacing:-.2px}.sendbird-label--h-2{font-size:18px;font-weight:600;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:-.2px}.sendbird-label--subtitle-1{font-size:16px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1.38;letter-spacing:-.2px}.sendbird-label--subtitle-2{font-size:14px;font-weight:500;font-stretch:normal;font-style:normal;line-height:1.14;letter-spacing:-.2px}.sendbird-label--body-1{font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal}.sendbird-label--body-2{font-size:12px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1.33;letter-spacing:normal}.sendbird-label--button-1{font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal}.sendbird-label--button-2{font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal}.sendbird-label--button-3{font-size:14px;font-weight:500;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal}.sendbird-label--caption-1{font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal}.sendbird-label--caption-2{font-size:12px;font-weight:700;font-style:normal;line-height:1;letter-spacing:normal}.sendbird-label--caption-3{font-size:12px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1;letter-spacing:normal}.sendbird-theme--light .sendbird-label--color-onbackground-1{color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-label--color-onbackground-1{color:var(--sendbird-dark-ondark-01)}.sendbird-theme--light .sendbird-label--color-onbackground-2{color:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-label--color-onbackground-2{color:var(--sendbird-dark-ondark-02)}.sendbird-theme--light .sendbird-label--color-onbackground-3{color:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-label--color-onbackground-3{color:var(--sendbird-dark-ondark-03)}.sendbird-theme--light .sendbird-label--color-onbackground-4{color:var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-label--color-onbackground-4{color:var(--sendbird-dark-ondark-04)}.sendbird-theme--light .sendbird-label--color-oncontent-1{color:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-label--color-oncontent-1{color:var(--sendbird-dark-onlight-01)}.sendbird-theme--light .sendbird-label--color-oncontent-2{color:var(--sendbird-light-ondark-02)}.sendbird-theme--dark .sendbird-label--color-oncontent-2{color:var(--sendbird-dark-onlight-02)}.sendbird-theme--light .sendbird-label--color-oncontent-inverse-1{color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-label--color-oncontent-inverse-1{color:var(--sendbird-dark-ondark-01)}.sendbird-theme--light .sendbird-label--color-oncontent-inverse-5{color:var(--sendbird-light-onlight-05)}.sendbird-theme--dark .sendbird-label--color-oncontent-inverse-5{color:var(--sendbird-dark-ondark-05)}.sendbird-theme--light .sendbird-label--color-primary{color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-label--color-primary{color:var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-label--color-error{color:var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-label--color-error{color:var(--sendbird-dark-error-200)}.sendbird-theme--light .sendbird-label--color-secondary-3{color:var(--sendbird-light-secondary-300)}.sendbird-theme--dark .sendbird-label--color-secondary-3{color:var(--sendbird-dark-secondary-200)}.sendbird-icon{display:inline-block}.sendbird-icon:focus{outline:none}.sendbird-theme--light .sendbird-icon-color--primary [class*=fill]{fill:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-icon-color--primary [class*=fill]{fill:var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-icon-color--primary-2 [class*=fill]{fill:var(--sendbird-light-primary-200)}.sendbird-theme--dark .sendbird-icon-color--primary-2 [class*=fill]{fill:var(--sendbird-dark-primary-400)}.sendbird-theme--light .sendbird-icon-color--primary [class*=stroke]{stroke:var(--sendbird-light-primary-300);stroke-width:2px;stroke-linejoin:round}.sendbird-theme--dark .sendbird-icon-color--primary [class*=stroke]{stroke:var(--sendbird-dark-primary-200);stroke-width:2px;stroke-linejoin:round}.sendbird-theme--light .sendbird-icon-color--secondary [class*=fill]{fill:var(--sendbird-light-secondary-300)}.sendbird-theme--dark .sendbird-icon-color--secondary [class*=fill]{fill:var(--sendbird-dark-secondary-200)}.sendbird-theme--light .sendbird-icon-color--content [class*=fill]{fill:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-icon-color--content [class*=fill]{fill:var(--sendbird-dark-onlight-01)}.sendbird-theme--light .sendbird-icon-color--content-inverse [class*=fill]{fill:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-icon-color--content-inverse [class*=fill]{fill:var(--sendbird-dark-ondark-01)}.sendbird-theme--light .sendbird-icon-color--content-inverse-5 [class*=fill]{fill:var(--sendbird-light-onlight-05)}.sendbird-theme--dark .sendbird-icon-color--content-inverse-5 [class*=fill]{fill:var(--sendbird-dark-ondark-05)}.sendbird-icon-color--white [class*=fill]{fill:#fff}.sendbird-icon-color--gray [class*=fill]{fill:var(--sendbird-light-onlight-04)}.sendbird-icon-color--thumbnail-icon [class*=fill]{fill:var(--sendbird-light-onlight-02)}.sendbird-theme--light .sendbird-icon-color--sent [class*=fill]{fill:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-icon-color--sent [class*=fill]{fill:var(--sendbird-dark-ondark-03)}.sendbird-theme--light .sendbird-icon-color--read [class*=fill]{fill:var(--sendbird-light-secondary-300)}.sendbird-theme--dark .sendbird-icon-color--read [class*=fill]{fill:var(--sendbird-dark-secondary-200)}.sendbird-theme--light .sendbird-icon-color--on-background-1 [class*=fill]{fill:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-icon-color--on-background-1 [class*=fill]{fill:var(--sendbird-dark-ondark-01)}.sendbird-theme--light .sendbird-icon-color--on-background-2 [class*=fill]{fill:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-icon-color--on-background-2 [class*=fill]{fill:var(--sendbird-dark-ondark-02)}.sendbird-theme--light .sendbird-icon-color--on-background-3 [class*=fill]{fill:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-icon-color--on-background-3 [class*=fill]{fill:var(--sendbird-dark-ondark-03)}.sendbird-theme--light .sendbird-icon-color--on-background-4 [class*=fill]{fill:var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-icon-color--on-background-4 [class*=fill]{fill:var(--sendbird-dark-ondark-04)}.sendbird-theme--light .sendbird-icon-color--background-3 [class*=fill]{fill:var(--sendbird-light-background-300)}.sendbird-theme--dark .sendbird-icon-color--background-3 [class*=fill]{fill:var(--sendbird-dark-background-400)}.sendbird-theme--light .sendbird-icon-color--error [class*=fill]{fill:var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-icon-color--error [class*=fill]{fill:var(--sendbird-dark-error-200)}.sendbird-conversation{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box}.sendbird-theme--light .sendbird-conversation{background-color:var(--sendbird-light-background-50);border:1px solid var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-conversation{background-color:var(--sendbird-dark-background-600);border:1px solid var(--sendbird-dark-ondark-04)}.sendbird-conversation__messages{overflow:hidden;flex:1 1 0}.sendbird-conversation__messages-list{display:flex;flex-direction:column;height:100%;justify-content:flex-end}.sendbird-conversation__footer{width:100%;padding:0 0 24px}.sendbird-msg-hoc__animated .sendbird-message-content{animation:bounce 1s ease}@keyframes bounce{50%{transform:translateY(-10px)}60%{transform:translateY(0)}90%{transform:translateY(-10px)}to{transform:translateY(0)}}.sendbird-conversation__scroll-container{display:flex;height:100%;overflow-y:auto;overflow-x:hidden;flex-direction:column}.sendbird-conversation__scroll-container .sendbird-conversation__padding{flex:1 1 0}.sendbird-conversation__footer{position:relative;box-sizing:border-box;margin-top:6px}.sendbird-conversation__footer .sendbird-conversation__footer__typing-indicator{position:absolute;display:inline-flex;bottom:8px}.sendbird-conversation__footer .sendbird-conversation__footer__typing-indicator .sendbird-conversation__footer__typing-indicator__text{margin-left:24px;margin-right:10px}.sendbird-connection-status{display:flex;align-items:center;padding-top:5px}.sendbird-place-holder{position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%}.sendbird-place-holder .sendbird-place-holder__body{display:flex;flex-direction:column;height:104px;align-items:center}.sendbird-place-holder .sendbird-place-holder__body .sendbird-place-holder__body__icon{margin-bottom:10px}.sendbird-place-holder .sendbird-place-holder__body .sendbird-place-holder__body__text{margin-top:10px}.sendbird-place-holder .sendbird-place-holder__body__reconnect{margin-top:18px;display:flex;flex-direction:row;cursor:pointer}.sendbird-place-holder .sendbird-place-holder__body__reconnect .sendbird-place-holder__body__reconnect__icon{margin-right:4px}.sendbird-place-holder .sendbird-place-holder__body--align-top{position:absolute;top:24px;display:flex;width:100%;flex-direction:column;justify-content:center}.sendbird-place-holder .sendbird-place-holder__body--align-top .sendbird-place-holder__body--align-top__text{display:flex;flex-direction:row;justify-content:center;padding-left:16px;padding-right:16px}.sendbird-place-holder .sendbird-place-holder__body--align-top .sendbird-place-holder__body--align-top__text .sendbird-place-holder__body--align-top__text__search-in{display:flex;min-width:60px;margin-right:2px}.sendbird-place-holder .sendbird-place-holder__body--align-top .sendbird-place-holder__body--align-top__text .sendbird-place-holder__body--align-top__text__channel-name{display:block;max-width:calc(100% - 62px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sendbird-place-holder .sendbird-place-holder__body--align-top .sendbird-place-hlder__body--align-top__searching,.sendbird-place-holder .sendbird-place-holder__body--align-top .sendbird-place-hlder__body--align-top__no-result{display:flex;justify-content:center}.sendbird-loader{display:inline-block;animation:1s infinite linear;animation-name:rotate}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.sendbird-chat-header{position:relative;display:flex;flex-direction:row;justify-content:space-between;align-items:center;height:64px;min-height:64px;padding-left:20px;padding-right:16px;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box}.sendbird-theme--light .sendbird-chat-header{border-bottom:1px solid var(--sendbird-light-onlight-04);background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-chat-header{border-bottom:1px solid var(--sendbird-dark-ondark-04);background-color:var(--sendbird-dark-background-600)}.sendbird-chat-header__left{margin-right:24px}.sendbird-chat-header__left,.sendbird-chat-header__right{overflow:hidden;display:flex;flex-direction:row;align-items:center}.sendbird-chat-header .sendbird-chat-header__left__title{margin-left:8px;margin-right:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:780px}.sendbird--mobile-mode .sendbird-chat-header .sendbird-chat-header__left__title{max-width:calc(100vw - 240px)}.sendbird-chat-header .sendbird-chat-header__left__subtitle{max-width:240px;overflow:hidden;text-overflow:ellipsis}.sendbird-chat-header .sendbird-chat-header__right__mute{margin-right:18px}.sendbird-chat-header .sendbird-iconbutton--pressed{background-color:inherit}.sendbird-chat-header .sendbird-chat-header__right__info{margin-left:16px}.sendbird-chat-header__icon_back{margin-right:8px}.sendbird-chat-header--default-avatar{width:56px;height:56px;display:flex;justify-content:center;align-items:center;border-radius:50%}.sendbird-theme--light .sendbird-chat-header--default-avatar{background-color:var(--sendbird-light-secondary-300)}.sendbird-theme--dark .sendbird-chat-header--default-avatar{background-color:var(--sendbird-dark-secondary-200)}.sendbird-image-renderer{overflow:hidden;position:relative}.sendbird-image-renderer__hidden-image-loader{display:none}.sendbird-image-renderer,.sendbird-image-renderer__image{width:320px;height:180px}.sendbird-multiple-files-image-renderer__image-cover{position:absolute;top:0;display:none;width:100%;height:100%;border-radius:16px;background-color:var(--sendbird-light-overlay-01)}.sendbird-image-renderer:hover .sendbird-multiple-files-image-renderer__image-cover{display:inline-flex}.sendbird-multiple-files-image-renderer__icon-wrapper{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center;z-index:1}.sendbird-multiple-files-image-renderer__icon-wrapper .sendbird-multiple-files-image-renderer__icon-wrapper__icon{display:flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:50%;background-color:var(--sendbird-light-ondark-01);z-index:2}.sendbird-avatar{border-radius:50%;display:inline-block;overflow:hidden;position:relative}.sendbird-avatar:focus{outline:none}.sendbird-avatar .sendbird-avatar-img{align-items:center;display:flex;justify-content:center;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.sendbird-theme--light .sendbird-avatar .sendbird-avatar-img{background-color:var(--sendbird-light-background-300)}.sendbird-theme--dark .sendbird-avatar .sendbird-avatar-img{background-color:var(--sendbird-dark-background-300)}.sendbird-avatar .sendbird-avatar--inner__two-child .sendbird-avatar-img:first-child{transform:translate(2%,-50%)}.sendbird-avatar .sendbird-avatar--inner__two-child .sendbird-avatar-img:last-child{transform:translate(-102%,-50%)}.sendbird-avatar .sendbird-avatar--inner__three-child--upper .sendbird-avatar-img:first-child{transform:translate(-50%,-102%)}.sendbird-avatar .sendbird-avatar--inner__three-child--lower .sendbird-avatar-img:first-child{transform:translate(-77%,-23%) scale(.5)}.sendbird-avatar .sendbird-avatar--inner__three-child--lower .sendbird-avatar-img:last-child{transform:translate(-23%,-23%) scale(.5)}.sendbird-avatar .sendbird-avatar--inner__four-child .sendbird-avatar-img:first-child{transform:translate(-77%,-77%) scale(.5)}.sendbird-avatar .sendbird-avatar--inner__four-child .sendbird-avatar-img:nth-child(2){transform:translate(-23%,-77%) scale(.5)}.sendbird-avatar .sendbird-avatar--inner__four-child .sendbird-avatar-img:nth-child(3){transform:translate(-77%,-23%) scale(.5)}.sendbird-avatar .sendbird-avatar--inner__four-child .sendbird-avatar-img:last-child{transform:translate(-23%,-23%) scale(.5)}.sendbird-avatar .sendbird-avatar-img--default{align-items:center;display:flex;justify-content:center}.sendbird-theme--light .sendbird-avatar .sendbird-avatar-img--default{background-color:var(--sendbird-light-background-300)}.sendbird-theme--dark .sendbird-avatar .sendbird-avatar-img--default{background-color:var(--sendbird-dark-background-300)}.sendbird-theme--light .sendbird-avatar .sendbird-avatar-img--default.text{background-color:var(--sendbird-light-background-100)}.sendbird-theme--dark .sendbird-avatar .sendbird-avatar-img--default.text{background-color:var(--sendbird-dark-background-400)}.sendbird-avatar .sendbird-avatar-text{font-family:Roboto;font-size:8px;font-style:normal;font-weight:700;font-weight:400;line-height:12px;text-align:center}.sendbird-theme--light .sendbird-avatar .sendbird-avatar-text{color:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-avatar .sendbird-avatar-text{color:var(--sendbird-dark-ondark-02)}.sendbird-ui-header{position:relative;display:flex;flex-direction:row;justify-content:space-between;align-items:center;height:64px;min-height:64px;padding-left:16px;padding-right:16px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}.sendbird-theme--light .sendbird-ui-header{border-bottom:1px solid var(--sendbird-light-onlight-04);background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-ui-header{border-bottom:1px solid var(--sendbird-dark-ondark-04);background-color:var(--sendbird-dark-background-600)}.sendbird-ui-header--is-desktop{max-width:176px}.sendbird-ui-header--is-mobile{max-width:80px}.sendbird-ui-header__left{position:relative;left:0;flex:0 0 auto;display:inline-flex;align-items:center;margin-right:8px}.sendbird-ui-header__middle{flex:1;display:inline-flex;flex-direction:column;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.sendbird-ui-header__middle__subtitle__container{display:flex;width:100%}.sendbird-ui-header__middle__title,.sendbird-ui-header__middle__subtitle{overflow:hidden;text-wrap:nowrap;text-overflow:ellipsis;width:100%}.sendbird-ui-header__right{position:relative;right:0;flex:0 0 auto;display:inline-flex;align-items:center;margin-left:8px}.sendbird-textbutton{text-decoration:underline;cursor:pointer;display:inline-block}.sendbird-textbutton--not-underline{text-decoration:none;cursor:pointer}.sendbird-textbutton--disabled{cursor:not-allowed}.sendbird-theme--light .sendbird-textbutton--disabled{color:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-textbutton--disabled{color:var(--sendbird-dark-ondark-03)}.sendbird-theme--light .sendbird-color--onbackground-1{color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-color--onbackground-1{color:var(--sendbird-dark-ondark-01)}.sendbird-theme--light .sendbird-color--onbackground-1--background-color{background-color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-color--onbackground-1--background-color{background-color:var(--sendbird-dark-ondark-01)}.sendbird-theme--light .sendbird-color--onbackground-2{color:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-color--onbackground-2{color:var(--sendbird-dark-ondark-02)}.sendbird-theme--light .sendbird-color--onbackground-2--background-color{background-color:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-color--onbackground-2--background-color{background-color:var(--sendbird-dark-ondark-02)}.sendbird-theme--light .sendbird-color--onbackground-3{color:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-color--onbackground-3{color:var(--sendbird-dark-ondark-03)}.sendbird-theme--light .sendbird-color--onbackground-3--background-color{background-color:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-color--onbackground-3--background-color{background-color:var(--sendbird-dark-ondark-03)}.sendbird-theme--light .sendbird-color--onbackground-4{color:var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-color--onbackground-4{color:var(--sendbird-dark-ondark-04)}.sendbird-theme--light .sendbird-color--onbackground-4--background-color{background-color:var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-color--onbackground-4--background-color{background-color:var(--sendbird-dark-ondark-04)}.sendbird-theme--light .sendbird-color--oncontent-1{color:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-color--oncontent-1{color:var(--sendbird-dark-onlight-01)}.sendbird-theme--light .sendbird-color--oncontent-1--background-color{background-color:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-color--oncontent-1--background-color{background-color:var(--sendbird-dark-onlight-01)}.sendbird-theme--light .sendbird-color--primary{color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-color--primary{color:var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-color--primary--background-color{background-color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-color--primary--background-color{background-color:var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-color--error{color:var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-color--error{color:var(--sendbird-dark-error-200)}.sendbird-theme--light .sendbird-color--error--background-color{background-color:var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-color--error--background-color{background-color:var(--sendbird-dark-error-300)}.sendbird-conversation__messages{position:relative}.sendbird-conversation__messages .sendbird-conversation__messages-padding{position:relative;height:100%;overflow-x:hidden;padding:0 24px}.sendbird--mobile-mode .sendbird-conversation__messages .sendbird-conversation__messages-padding{padding:0 12px}.sendbird-conversation__messages .sendbird-separator,.sendbird-conversation__messages .sendbird-admin-message{padding-top:8px;padding-bottom:8px}.sendbird-conversation__messages__notification{position:fixed;top:0;width:calc(100% - 50px);margin-left:25px}.sendbird-conversation__scroll-bottom-button{position:sticky;display:flex;align-items:center;justify-content:center;bottom:30px;left:calc(100% - 65px);width:40px;height:40px;border-radius:24px}.sendbird-theme--light .sendbird-conversation__scroll-bottom-button{background-color:var(--sendbird-light-background-50);box-shadow:var(--sendbird-light-shadow-05)}.sendbird-theme--dark .sendbird-conversation__scroll-bottom-button{background-color:var(--sendbird-dark-background-400);box-shadow:var(--sendbird-dark-shadow-05)}.sendbird-conversation__scroll-bottom-button:hover{cursor:pointer}.sendbird-theme--light .sendbird-conversation__scroll-bottom-button:hover{background-color:var(--sendbird-light-background-100)}.sendbird-theme--dark .sendbird-conversation__scroll-bottom-button:hover{background-color:var(--sendbird-dark-background-500)}.sendbird-theme--light .sendbird-conversation__scroll-bottom-button:active{background-color:var(--sendbird-light-background-200)}.sendbird-theme--dark .sendbird-conversation__scroll-bottom-button:active{background-color:var(--sendbird-dark-background-700)}.sendbird-conversation__scroll-bottom-button:focus{outline:none}.sendbird-separator{width:100%;display:flex;align-items:center}.sendbird-separator .sendbird-separator__left,.sendbird-separator .sendbird-separator__right{border:none;height:1px;display:inline-block;width:100%}.sendbird-separator .sendbird-separator__text{margin:0 16px;display:flex;white-space:nowrap}.sendbird-fileviewer__header__right__actions__download,.sendbird-fileviewer__header__right__actions__delete,.sendbird-fileviewer__header__right__actions__close{width:64px;padding:21px;box-sizing:border-box;cursor:pointer}.sendbird-fileviewer__header__right__actions__download .disabled,.sendbird-fileviewer__header__right__actions__delete .disabled,.sendbird-fileviewer__header__right__actions__close .disabled{cursor:not-allowed}.sendbird-fileviewer{width:100%;height:100%;position:fixed;top:0;left:0;z-index:100000}.sendbird-theme--light .sendbird-fileviewer{background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-fileviewer{background-color:var(--sendbird-dark-background-600)}.sendbird-fileviewer .sendbird-fileviewer__header{height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between}.sendbird--mobile-mode .sendbird-fileviewer .sendbird-fileviewer__header{position:relative}.sendbird-theme--light .sendbird-fileviewer .sendbird-fileviewer__header{border-bottom:1px solid var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-fileviewer .sendbird-fileviewer__header{border-bottom:1px solid var(--sendbird-dark-ondark-04)}.sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__left{box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px}.sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__left .sendbird-fileviewer__header__left__avatar{margin-right:8px}.sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__left .sendbird-fileviewer__header__left__filename{max-width:500px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block}.sendbird--mobile-mode .sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__left .sendbird-fileviewer__header__left__filename{position:absolute;left:64px;top:10px;display:block;max-width:calc(100vw - 240px)}.sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__left .sendbird-fileviewer__header__left__sender-name{max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-flex;margin-left:8px;padding-top:5px}.sendbird--mobile-mode .sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__left .sendbird-fileviewer__header__left__sender-name{position:absolute;left:56px;top:24px}.sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__right{display:flex;width:160px;justify-content:flex-end}.sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__right .sendbird-fileviewer__header__right__actions{right:0;display:flex;flex-direction:row}.sendbird-theme--light .sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__right .sendbird-fileviewer__header__right__actions__close{border-left:1px solid var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__right .sendbird-fileviewer__header__right__actions__close{border-left:1px solid var(--sendbird-dark-ondark-04)}.sendbird-fileviewer .sendbird-fileviewer__content{height:calc(100% - 72px);margin-top:4px;overflow-y:auto;display:flex;align-items:center;justify-content:center}.sendbird-fileviewer .sendbird-fileviewer__content .sendbird-fileviewer__content__video{max-width:100%;max-height:100%}.sendbird-fileviewer .sendbird-fileviewer__content .sendbird-fileviewer__content__img{max-width:90%;max-height:90%}.sendbird-fileviewer .sendbird-fileviewer__content .sendbird-fileviewer__content__unsupported{max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center}.sendbird-notification--hide,.sendbird-notification{position:absolute}.sendbird-notification--hide{display:none}.sendbird-notification{margin-top:8px;margin-left:24px;margin-right:24px;border-radius:4px;padding:0 2px;height:32px;display:flex;align-items:center;justify-content:center}.sendbird-theme--light .sendbird-notification{background-color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-notification{background-color:var(--sendbird-dark-primary-200)}.sendbird-notification:hover{cursor:pointer}.sendbird-theme--light .sendbird-notification:hover{background-color:var(--sendbird-light-primary-400)}.sendbird-theme--dark .sendbird-notification:hover{background-color:var(--sendbird-dark-primary-300)}.sendbird-theme--light .sendbird-notification.sendbird-notification--frozen{background-color:var(--sendbird-light-information-100)}.sendbird-theme--dark .sendbird-notification.sendbird-notification--frozen{background-color:var(--sendbird-dark-information-100)}.sendbird-theme--light .sendbird-notification.sendbird-notification--frozen .sendbird-notification__text{color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-notification.sendbird-notification--frozen .sendbird-notification__text{color:var(--sendbird-dark-onlight-01)}.sendbird-notification .sendbird-notification__text{display:flex;align-items:center;justify-content:center;margin-right:8px}.typing-dots-container{align-items:center;border-radius:16px;display:flex;gap:6px;justify-content:center;padding:16px 12px}.sendbird-theme--light .typing-dots-container{background-color:var(--sendbird-light-background-100)}.sendbird-theme--dark .typing-dots-container{background-color:var(--sendbird-dark-background-400)}.typing-dots-container span{animation:blink 1.4s infinite;animation-fill-mode:both;border-radius:50%;height:8px;width:8px}.sendbird-theme--light .typing-dots-container span{background-color:var(--sendbird-light-background-700)}.sendbird-theme--dark .typing-dots-container span{background-color:var(--sendbird-dark-background-50)}.typing-dots-container span:nth-child(1){animation-delay:.4s}.typing-dots-container span:nth-child(2){animation-delay:.6s}.typing-dots-container span:nth-child(3){animation-delay:.8s}@keyframes blink{0%{opacity:.12;transform:scale(1)}21.43%{opacity:.38;transform:scale(1.2)}42.86%{opacity:.12;transform:scale(1)}to{opacity:.12;transform:scale(1)}}.sendbird-message-input-wrapper--voice-message,.sendbird-message-input-wrapper,.sendbird-message-input-wrapper--voice-message .sendbird-message-input-wrapper__quote-message-input,.sendbird-message-input-wrapper .sendbird-message-input-wrapper__quote-message-input{position:relative;width:100%}.sendbird-theme--light .sendbird-message-input-wrapper--voice-message .sendbird-message-input-wrapper__quote-message-input,.sendbird-theme--light .sendbird-message-input-wrapper .sendbird-message-input-wrapper__quote-message-input{border-top:solid 1px var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-message-input-wrapper--voice-message .sendbird-message-input-wrapper__quote-message-input,.sendbird-theme--dark .sendbird-message-input-wrapper .sendbird-message-input-wrapper__quote-message-input{border-top:solid 1px var(--sendbird-dark-ondark-04)}.sendbird-message-input-wrapper--voice-message .sendbird-message-input-wrapper__message-input,.sendbird-message-input-wrapper .sendbird-message-input-wrapper__message-input{position:relative;width:100%;box-sizing:border-box;padding:0 24px}.sendbird--mobile-mode .sendbird-message-input-wrapper--voice-message .sendbird-message-input-wrapper__message-input,.sendbird--mobile-mode .sendbird-message-input-wrapper .sendbird-message-input-wrapper__message-input{padding:0 16px}.sendbird-theme--light .sendbird-message-input-wrapper--voice-message{border-top:1px solid var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-message-input-wrapper--voice-message{border-top:1px solid var(--sendbird-dark-ondark-04)}.sendbird-mention-suggest-list{position:relative;display:flex;flex-direction:column;width:calc(100% - 56px);max-height:260px;overflow:scroll;margin-left:28px;margin-right:28px}.sendbird-theme--light .sendbird-mention-suggest-list{border:1px solid var(--sendbird-light-background-100)}.sendbird-theme--dark .sendbird-mention-suggest-list{border:1px solid var(--sendbird-dark-background-500)}.sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item{position:relative;display:flex;align-items:center;padding:16px 8px}.sendbird-theme--light .sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item{background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item{background-color:var(--sendbird-dark-background-600)}.sendbird-theme--light .sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item.focused{background-color:var(--sendbird-light-background-100)}.sendbird-theme--dark .sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item.focused{background-color:var(--sendbird-dark-background-500)}.sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item .sendbird-mention-suggest-list__user-item__avatar{position:relative;display:inline-block}.sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item .sendbird-mention-suggest-list__user-item__nickname{position:relative;display:inline-block;margin-left:16px;max-width:calc(100% - 250px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sendbird--mobile-mode .sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item .sendbird-mention-suggest-list__user-item__nickname{max-width:calc(100% - 150px)}.sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item .sendbird-mention-suggest-list__user-item__user-id{position:absolute;display:inline-block;right:16px;max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sendbird--mobile-mode .sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item .sendbird-mention-suggest-list__user-item__user-id{max-width:100px}.sendbird-mention-suggest-list .sendbird-mention-suggest-list__notice-item{position:relative;display:flex;align-items:center;padding:16px 8px}.sendbird-theme--light .sendbird-mention-suggest-list .sendbird-mention-suggest-list__notice-item{background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-mention-suggest-list .sendbird-mention-suggest-list__notice-item{background-color:var(--sendbird-dark-background-600)}.sendbird-mention-suggest-list .sendbird-mention-suggest-list__notice-item .sendbird-mention-suggest-list__notice-item__icon{margin-right:4px}.sendbird-message-input{display:inline-block;width:100%;position:relative}.sendbird-message-input .sendbird-message-input--textarea{position:relative;width:100%;border-radius:4px;font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1.43;height:56px;overflow-y:scroll;letter-spacing:normal;padding:18px 64px 18px 16px;box-sizing:border-box;resize:none;font-family:var(--sendbird-font-family-default);background-color:inherit;white-space:pre-wrap}.sendbird-theme--light .sendbird-message-input .sendbird-message-input--textarea{color:var(--sendbird-light-onlight-01);caret-color:var(--sendbird-light-primary-300);border:solid 1px var(--sendbird-light-onlight-03);background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-message-input .sendbird-message-input--textarea{color:var(--sendbird-dark-ondark-01);caret-color:var(--sendbird-dark-primary-200);border:solid 1px var(--sendbird-dark-ondark-03);background-color:var(--sendbird-dark-background-500)}.sendbird-message-input .sendbird-message-input--textarea:focus{outline:none}.sendbird-theme--light .sendbird-message-input .sendbird-message-input--textarea:focus{color:var(--sendbird-light-onlight-01);border:solid 1px var(--sendbird-light-primary-300);box-shadow:var(--sendbird-light-shadow-message-input)}.sendbird-theme--dark .sendbird-message-input .sendbird-message-input--textarea:focus{color:var(--sendbird-dark-ondark-01);border:solid 1px var(--sendbird-dark-primary-200);box-shadow:var(--sendbird-dark-shadow-message-input)}.sendbird-theme--light .sendbird-message-input .sendbird-message-input--textarea:active{border:solid 1px var(--sendbird-message-input-border-active);color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-message-input .sendbird-message-input--textarea:active{border:solid 1px var(--sendbird-message-input-border-active);color:var(--sendbird-dark-ondark-01)}.sendbird-message-input .sendbird-message-input--placeholder{position:absolute;pointer-events:none;top:18px;left:16px;font-family:var(--sendbird-font-family-default);font-size:14px;line-height:1.43}.sendbird-message-input .sendbird-message-input--attach{position:absolute;padding:6px;right:16px;bottom:14px}.sendbird-message-input .sendbird-message-input--attach.is-voice-message-enabled{right:48px}.sendbird-message-input .sendbird-message-input--voice-message,.sendbird-message-input .sendbird-message-input--send{position:absolute;padding:6px;right:16px;bottom:14px}.sendbird-message-input .sendbird-message-input--attach-input{display:none}.sendbird-message-input__edit{padding:16px;box-sizing:border-box}.sendbird-theme--light .sendbird-message-input__edit{background-color:var(--sendbird-light-primary-100)}.sendbird-theme--dark .sendbird-message-input__edit{background-color:var(--sendbird-dark-background-700)}.sendbird-message-input--edit-action{text-align:right;margin-top:4px}.sendbird-message-input--edit-action button:last-child{margin-left:8px}.sendbird-message-input--edit-action .sendbird-message-input--edit-action__cancel{width:80px}.sendbird-theme--light .sendbird-message-input--edit-action .sendbird-message-input--edit-action__cancel{border:solid 1px var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-message-input--edit-action .sendbird-message-input--edit-action__cancel{border:solid 1px var(--sendbird-dark-ondark-03)}.sendbird-message-input--edit-action .sendbird-message-input--edit-action__save{width:80px}.sendbird-message-input-form__disabled{cursor:not-allowed}.sendbird-message-input__disabled{pointer-events:none;cursor:not-allowed}.sendbird-theme--light .sendbird-message-input__disabled .sendbird-message-input--textarea{color:var(--sendbird-light-onlight-04);border:1px solid var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-message-input__disabled .sendbird-message-input--textarea{color:var(--sendbird-dark-ondark-04);border:1px solid var(--sendbird-dark-ondark-04)}.sendbird-input{display:inline-block;width:100%;height:40px;position:relative}.sendbird-input .sendbird-input__input{width:100%;height:100%;border-radius:4px;font-family:var(--sendbird-font-family-default);font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal;padding:10px 16px;box-sizing:border-box;background-color:inherit}.sendbird-theme--light .sendbird-input .sendbird-input__input{color:var(--sendbird-light-onlight-01);caret-color:var(--sendbird-light-primary-300);border:solid 1px var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-input .sendbird-input__input{color:var(--sendbird-dark-ondark-01);caret-color:var(--sendbird-dark-primary-200);border:solid 1px var(--sendbird-dark-ondark-03)}.sendbird-input .sendbird-input__input:focus{outline:none}.sendbird-theme--light .sendbird-input .sendbird-input__input:focus{box-shadow:0 1px 5px 0 var(--sendbird-light-onlight-04),0 0 1px #00000029,0 2px 1px #00000014;color:var(--sendbird-light-onlight-01);border:solid 2px var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-input .sendbird-input__input:focus{box-shadow:0 1px 5px 0 var(--sendbird-dark-ondark-04),0 0 1px #00000029,0 2px 1px #00000014;color:var(--sendbird-dark-ondark-01);border:solid 2px var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-input .sendbird-input__input:active{box-shadow:0 1px 5px 0 var(--sendbird-light-onlight-04),0 0 1px #00000029,0 2px 1px #00000014;color:var(--sendbird-light-onlight-01);border:solid 1px var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-input .sendbird-input__input:active{box-shadow:0 1px 5px 0 var(--sendbird-dark-ondark-04),0 0 1px #00000029,0 2px 1px #00000014;color:var(--sendbird-dark-ondark-01);border:solid 1px var(--sendbird-dark-primary-200)}.sendbird-input .sendbird-input__input:disabled{cursor:not-allowed}.sendbird-theme--light .sendbird-input .sendbird-input__input:disabled{background-color:var(--sendbird-light-background-100);color:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-input .sendbird-input__input:disabled{background-color:var(--sendbird-dark-background-500);color:var(--sendbird-dark-ondark-03)}.sendbird-input .sendbird-input__placeholder{position:absolute;pointer-events:none;top:10px;left:16px;font-family:var(--sendbird-font-family-default);font-size:14px;line-height:1.43}.sendbird-theme--light .sendbird-input .sendbird-input__placeholder{color:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-input .sendbird-input__placeholder{color:var(--sendbird-dark-ondark-03)}.sendbird-input-label{margin:4px 0}.sendbird-iconbutton__feedback{display:flex;justify-content:center;align-items:center;background-color:transparent;cursor:pointer;border-radius:18px;border:1px solid;padding:5px 8px}.sendbird-theme--light .sendbird-iconbutton__feedback{border-color:var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-iconbutton__feedback{border-color:var(--sendbird-dark-ondark-04)}.sendbird-theme--light .sendbird-iconbutton__feedback:hover{background-color:var(--sendbird-light-background-100)}.sendbird-theme--dark .sendbird-iconbutton__feedback:hover{background-color:var(--sendbird-dark-background-500)}.sendbird-iconbutton__feedback.sendbird-iconbutton__feedback__disabled{cursor:not-allowed}.sendbird-iconbutton__feedback.sendbird-iconbutton__feedback__disabled:hover,.sendbird-iconbutton__feedback.sendbird-iconbutton__feedback__pressed:hover{background-color:transparent}.sendbird-theme--light .sendbird-iconbutton__feedback.sendbird-iconbutton__feedback__pressed{border-color:var(--sendbird-light-primary-300);background-color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-iconbutton__feedback.sendbird-iconbutton__feedback__pressed{border-color:var(--sendbird-dark-primary-200);background-color:var(--sendbird-dark-primary-200)}.sendbird-iconbutton__feedback__inner{display:flex;justify-content:center;align-items:center}.sendbird-theme--light .sendbird-iconbutton__feedback__inner svg path{fill:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-iconbutton__feedback__inner svg path{fill:var(--sendbird-dark-ondark-02)}.sendbird-theme--light .sendbird-iconbutton__feedback__inner.sendbird-iconbutton__feedback__inner__disabled svg path{fill:var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-iconbutton__feedback__inner.sendbird-iconbutton__feedback__inner__disabled svg path{fill:var(--sendbird-dark-ondark-04)}.sendbird-theme--light .sendbird-iconbutton__feedback__inner__pressed svg path{fill:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-iconbutton__feedback__inner__pressed svg path{fill:var(--sendbird-dark-onlight-01)}.sendbird--mobile-mode .sendbird-message-feedback-modal-content__mobile{max-width:280px;padding:16px}.sendbird-message-feedback-modal-footer__root{display:flex;justify-content:space-between;align-items:center}.sendbird-message-feedback-modal-footer__root_failed{display:flex;justify-content:flex-end;align-items:center;margin-top:48px}.sendbird-message-feedback-modal-footer__right-content{display:flex;gap:8px}.sendbird-message-feedback-modal-body__root{margin:21px 0}.sendbird--mobile-mode .sendbird-message-feedback-modal-header{font-size:18px;line-height:1.33}.sendbird-bottomsheet{position:fixed;top:0;left:0;width:100%;height:100%}.sendbird-bottomsheet__content{position:fixed;z-index:10001;bottom:0;left:0;width:100%}.sendbird-bottomsheet__backdrop{position:fixed;z-index:10000;height:100%;width:100%;top:0;left:0}.sendbird-theme--light .sendbird-bottomsheet__backdrop{background-color:var(--sendbird-light-overlay-02)}.sendbird-theme--dark .sendbird-bottomsheet__backdrop{background-color:var(--sendbird-dark-overlay-02)}.sendbird-message__bottomsheet--feedback-options-menu{width:100vw;border-radius:8px 8px 0 0}.sendbird-theme--light .sendbird-message__bottomsheet--feedback-options-menu{background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-message__bottomsheet--feedback-options-menu{background-color:var(--sendbird-dark-background-500)}.sendbird-message__bottomsheet--feedback-options-menu :first-child{border-radius:8px 8px 0 0}.sendbird-message__bottomsheet--feedback-option{cursor:pointer;height:48px;display:flex;align-items:center;padding:0 24px}.sendbird-suggested-replies{position:relative;display:flex;margin-top:8px;margin-bottom:16px}.sendbird-suggested-replies.vertical{justify-content:flex-end;align-items:flex-end;flex-wrap:wrap;flex-direction:column}.sendbird-suggested-replies.vertical .sendbird-suggested-replies__option:not(:first-child){margin-top:8px}.sendbird-suggested-replies.horizontal{display:flex;flex-direction:row;overflow-x:scroll;margin-left:-24px;margin-right:-24px;padding-left:24px;padding-right:24px}.sendbird--mobile-mode .sendbird-suggested-replies.horizontal{margin-left:-12px;margin-right:-12px;padding-left:52px;padding-right:12px}.sendbird-suggested-replies.horizontal .sendbird-suggested-replies__option:not(:last-child){margin-right:8px}.sendbird-suggested-replies::-webkit-scrollbar{display:none}.sendbird-theme--light .sendbird-suggested-replies,.sendbird-theme--dark .sendbird-suggested-replies{font-family:var(--sendbird-font-family-default)}.sendbird-suggested-replies__option{white-space:pre-wrap;font-size:12px;padding:8px 14px;display:flex;align-items:center;border-radius:18px;cursor:pointer;word-break:break-word}.sendbird-theme--light .sendbird-suggested-replies__option{color:var(--sendbird-light-primary-300);border:1px solid var(--sendbird-light-primary-300);background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-suggested-replies__option{color:var(--sendbird-dark-primary-200);border:1px solid var(--sendbird-dark-primary-200);background-color:var(--sendbird-dark-background-600)}.sendbird-theme--light .sendbird-suggested-replies__option:hover{background-color:var(--sendbird-light-background-100)}.sendbird-theme--dark .sendbird-suggested-replies__option:hover{background-color:var(--sendbird-dark-background-500)}.sendbird-theme--light .sendbird-suggested-replies__option:active{background-color:var(--sendbird-light-primary-300);color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-suggested-replies__option:active{background-color:var(--sendbird-dark-primary-200);color:var(--sendbird-dark-background-600)}.sendbird-suggested-replies__option.horizontal{white-space:nowrap}.sendbird-suggested-replies__option.vertical{white-space:pre-wrap;max-width:calc(100% - 70px)} diff --git a/assets/index-bPChiOkk.css b/assets/index-bPChiOkk.css deleted file mode 100644 index dcfb4d56c..000000000 --- a/assets/index-bPChiOkk.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css?family=Open+Sans:400,600,700&display=swap";.sendbird-message-content-menu__reaction-menu{display:none}.sendbird-theme--light{margin:0!important}.sendbird-conversation__footer{padding-bottom:0!important;margin:0!important}#root{height:100%;border:none!important}.sendbird-conversation{border:none!important}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.loading-spinner{width:50px;height:50px;border:10px solid #b771fd;border-top:10px solid white;border-radius:50%;animation:spinner 1.5s linear infinite}.spinner-container{display:grid;justify-content:center;align-items:center;height:350px}.sendbird-conversation__messages-padding{padding:0 16px!important}.sendbird-message-input .sendbird-message-input-text-field{overflow-y:hidden}.sendbird-modal__content{width:calc(100% - 20px)}.sendbird-fileviewer__header__left{max-width:272px}.sendbird-fileviewer{outline:none}textarea:focus:active,input:focus:active{outline:none}.sendbird-ai-widget-file-message-root{width:100%}.sendbird-ai-widget-file-message{border-radius:16px;width:100%}.sendbird-word__url{font-weight:700;color:#000}.sendbird-message-content__middle__body-container__feedback-buttons-container{margin-top:4px;position:relative;display:flex;gap:4px}.sendbird-modal-root{position:absolute;z-index:2147483647}:root{--sendbird-light-primary-500: #491389;--sendbird-light-primary-400: #6211c8;--sendbird-light-primary-300: #742ddd;--sendbird-light-primary-200: #c2a9fa;--sendbird-light-primary-100: #dbd1ff;--sendbird-light-secondary-500: #066858;--sendbird-light-secondary-400: #027d69;--sendbird-light-secondary-300: #259c72;--sendbird-light-secondary-200: #69c085;--sendbird-light-secondary-100: #a8e2ab;--sendbird-light-information-100: #adc9ff;--sendbird-highlight-100: #fff2b6;--sendbird-light-error-500: #9d091e;--sendbird-light-error-400: #bf0711;--sendbird-light-error-300: #de360b;--sendbird-light-error-200: #f66161;--sendbird-light-error-100: #fdaaaa;--sendbird-light-background-700: #000000;--sendbird-light-background-600: #161616;--sendbird-light-background-500: #2C2C2C;--sendbird-light-background-400: #393939;--sendbird-light-background-300: #bdbdbd;--sendbird-light-background-200: #e0e0e0;--sendbird-light-background-100: #eeeeee;--sendbird-light-background-50: #FFFFFF;--sendbird-light-overlay-01: rgba(0, 0, 0, .55);--sendbird-light-overlay-02: rgba(0, 0, 0, .32);--sendbird-light-onlight-01: rgba(0, 0, 0, .88);--sendbird-light-onlight-02: rgba(0, 0, 0, .5);--sendbird-light-onlight-03: rgba(0, 0, 0, .38);--sendbird-light-onlight-04: rgba(0, 0, 0, .12);--sendbird-light-onlight-05: rgba(0, 0, 0, .44);--sendbird-light-ondark-01: rgba(255, 255, 255, .88);--sendbird-light-ondark-02: rgba(255, 255, 255, .5);--sendbird-light-ondark-03: rgba(255, 255, 255, .38);--sendbird-light-ondark-04: rgba(255, 255, 255, .12);--sendbird-light-shadow-01: 0 1px 5px 0 rgba(33, 34, 66, .04), 0 0 3px 0 rgba(0, 0, 0, .08), 0 2px 1px 0 rgba(0, 0, 0, .12);--sendbird-light-shadow-02: 0 3px 5px -3px rgba(33, 34, 66, .04), 0 3px 14px 2px rgba(0, 0, 0, .08), 0 8px 10px 1px rgba(0, 0, 0, .12);--sendbird-light-shadow-03: 0 6px 10px -5px rgba(0, 0, 0, .04), 0 6px 30px 5px rgba(0, 0, 0, .08), 0 16px 24px 2px rgba(0, 0, 0, .12);--sendbird-light-shadow-04: 0 9px 15px -7px rgba(0, 0, 0, .04), 0 9px 46px 8px rgba(0, 0, 0, .08), 0 24px 38px 3px rgba(0, 0, 0, .12);--sendbird-light-shadow-05: 0 2px 8px 0 rgba(0, 0, 0, .08), 0 4px 6px 0 rgba(0, 0, 0, .12);--sendbird-light-shadow-message-input: 0 1px 5px 0 rgba(33, 34, 66, .12), 0 0 1px 0 rgba(33, 34, 66, .16), 0 2px 1px 0 rgba(33, 34, 66, .08), 0 1px 5px 0 rgba(0, 0, 0, .12)}:root{--sendbird-dark-primary-500: #491389;--sendbird-dark-primary-400: #6211c8;--sendbird-dark-primary-300: #742ddd;--sendbird-dark-primary-200: #c2a9fa;--sendbird-dark-primary-100: #dbd1ff;--sendbird-dark-secondary-500: #066858;--sendbird-dark-secondary-400: #027d69;--sendbird-dark-secondary-300: #259c72;--sendbird-dark-secondary-200: #69c085;--sendbird-dark-secondary-100: #a8e2ab;--sendbird-dark-information-100: #adc9ff;--sendbird-highlight-100: #fff2b6;--sendbird-dark-error-500: #9d091e;--sendbird-dark-error-400: #bf0711;--sendbird-dark-error-300: #de360b;--sendbird-dark-error-200: #f66161;--sendbird-dark-error-100: #fdaaaa;--sendbird-dark-background-700: #000000;--sendbird-dark-background-600: #161616;--sendbird-dark-background-500: #2C2C2C;--sendbird-dark-background-400: #393939;--sendbird-dark-background-300: #bdbdbd;--sendbird-dark-background-200: #e0e0e0;--sendbird-dark-background-100: #eeeeee;--sendbird-dark-background-50: #FFFFFF;--sendbird-dark-overlay-01: rgba(0, 0, 0, .55);--sendbird-dark-overlay-02: rgba(0, 0, 0, .32);--sendbird-dark-onlight-01: rgba(0, 0, 0, .88);--sendbird-dark-onlight-02: rgba(0, 0, 0, .5);--sendbird-dark-onlight-03: rgba(0, 0, 0, .38);--sendbird-dark-onlight-04: rgba(0, 0, 0, .12);--sendbird-dark-ondark-01: rgba(255, 255, 255, .88);--sendbird-dark-ondark-02: rgba(255, 255, 255, .5);--sendbird-dark-ondark-03: rgba(255, 255, 255, .38);--sendbird-dark-ondark-04: rgba(255, 255, 255, .12);--sendbird-dark-ondark-05: rgba(255, 255, 255, .44);--sendbird-dark-shadow-01: 0 1px 5px 0 rgba(33, 34, 66, .04), 0 0 3px 0 rgba(0, 0, 0, .08), 0 2px 1px 0 rgba(0, 0, 0, .12);--sendbird-dark-shadow-02: 0 3px 5px -3px rgba(33, 34, 66, .04), 0 3px 14px 2px rgba(0, 0, 0, .08), 0 8px 10px 1px rgba(0, 0, 0, .12);--sendbird-dark-shadow-03: 0 6px 10px -5px rgba(0, 0, 0, .04), 0 6px 30px 5px rgba(0, 0, 0, .08), 0 16px 24px 2px rgba(0, 0, 0, .12);--sendbird-dark-shadow-04: 0 9px 15px -7px rgba(0, 0, 0, .04), 0 9px 46px 8px rgba(0, 0, 0, .08), 0 24px 38px 3px rgba(0, 0, 0, .12);--sendbird-light-shadow-05: 0 2px 8px 0 rgba(0, 0, 0, .08), 0 4px 6px 0 rgba(0, 0, 0, .12);--sendbird-dark-shadow-message-input: 0 1px 5px 0 rgba(33, 34, 66, .12), 0 0 1px 0 rgba(33, 34, 66, .16), 0 2px 1px 0 rgba(33, 34, 66, .08), 0 1px 5px 0 rgba(0, 0, 0, .12)}:root{--sendbird-iconbutton-color: #825eeb;--sendbird-message-input-border-active: #7B53EF;--sendbird-selected-reaction-button-border-hover: #9E8CF5;--sendbird-add-reaction-button-border-hover: #9E8CF5;--sendbird-tooltip-background: #000000;--sendbird-tooltip-text-color: rgba(255, 255, 255, .88);--sendbird-button-border-focus: #FFFFFF;--sendbird-file-message-icon-background: #FFFFFF;--sendbird-font-family-default: "Roboto", sans-serif;--sendbird-message-balloon-width: 404px}.sendbird-experimental__rem__units .sendbird-label--h-1{font-size:1.25rem}.sendbird-experimental__rem__units .sendbird-label--h-2{font-size:1.125rem}.sendbird-experimental__rem__units .sendbird-label--subtitle-1{font-size:1rem}.sendbird-experimental__rem__units .sendbird-label--subtitle-2,.sendbird-experimental__rem__units .sendbird-label--body-1{font-size:.875rem}.sendbird-experimental__rem__units .sendbird-label--body-2{font-size:.75rem}.sendbird-experimental__rem__units .sendbird-label--button-1,.sendbird-experimental__rem__units .sendbird-label--button-2,.sendbird-experimental__rem__units .sendbird-label--caption-1{font-size:.875rem}.sendbird-experimental__rem__units .sendbird-label--caption-2,.sendbird-experimental__rem__units .sendbird-label--caption-3{font-size:.75rem}.sendbird-experimental__rem__units .sendbird-message-search-pannel .sendbird-message-search-pannel__input__container__input-area{font-size:.875rem}.sendbird-experimental__rem__units .sendbird-checkbox{font-size:1.375rem}.sendbird-experimental__rem__units .sendbird-mention-user-label{font-size:.875rem}.sendbird-experimental__rem__units .sendbird-mention-user-label.purple{font-size:1.125rem}.sendbird-experimental__rem__units .sendbird-message-input .sendbird-message-input--textarea,.sendbird-experimental__rem__units .sendbird-message-input .sendbird-message-input--placeholder,.sendbird-experimental__rem__units .sendbird-input .sendbird-input__input,.sendbird-experimental__rem__units .sendbird-input .sendbird-input__placeholder{font-size:.875rem}.sendbird-experimental__rem__units .sendbird-tooltip__text,.sendbird-experimental__rem__units .sendbird-quote-message .sendbird-quote-message__replied-to .sendbird-quote-message__replied-to__text,.sendbird-experimental__rem__units .sendbird-quote-message .sendbird-quote-message__replied-message .sendbird-quote-message__replied-message__text-message,.sendbird-experimental__rem__units .sendbird-quote-message .sendbird-quote-message__replied-message__file-message{font-size:.75rem}.sendbird-modal--full-mobile .sendbird-modal__content{width:100vw;max-width:100%;height:100%}.sendbird-modal{position:fixed;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.sendbird-modal__backdrop--clickoutside{cursor:pointer}.sendbird-modal__content{width:480px;border-radius:4px;z-index:10001;padding:18px 24px 24px;position:relative;box-sizing:border-box}.sendbird-theme--light .sendbird-modal__content{background-color:var(--sendbird-light-background-50);box-shadow:var(--sendbird-light-shadow-04)}.sendbird-theme--dark .sendbird-modal__content{background-color:var(--sendbird-dark-background-500);box-shadow:var(--sendbird-dark-shadow-04)}.sendbird-modal__content .sendbird-modal__close{position:absolute;top:16px;right:16px;cursor:pointer}.sendbird-theme--light .sendbird-modal__content .sendbird-modal__close path{fill:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-modal__content .sendbird-modal__close path{fill:var(--sendbird-dark-ondark-01)}.sendbird-modal__content .sendbird-modal__header{margin-bottom:16px}.sendbird-modal__content .sendbird-modal__body{height:calc(100% - 116px)}.sendbird-modal__content .sendbird-modal__footer{display:flex;flex-direction:row;justify-content:flex-end;margin-top:32px;text-align:right}.sendbird--mobile-mode .sendbird-modal__content .sendbird-modal__footer{position:sticky;bottom:24px}.sendbird-modal__content .sendbird-modal__footer .sendbird-button:last-child{margin-left:8px;min-width:80px;height:40px}.sendbird-modal__backdrop{position:fixed;z-index:10000;height:100%;width:100%;top:0;left:0}.sendbird-theme--light .sendbird-modal__backdrop{background-color:var(--sendbird-light-overlay-02)}.sendbird-theme--dark .sendbird-modal__backdrop{background-color:var(--sendbird-dark-overlay-02)}.sendbird-iconbutton{color:var(--sendbird-iconbutton-color);display:inline-flex;justify-content:center;align-items:center;padding:3px;background-color:transparent;cursor:pointer;-webkit-user-select:none;user-select:none;border:1px solid transparent;border-radius:4px;outline:0px}.sendbird-iconbutton .sendbird-iconbutton__inner{height:100%}.sendbird-theme--light .sendbird-iconbutton .sendbird-iconbutton__inner svg{fill:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-iconbutton .sendbird-iconbutton__inner svg{fill:var(--sendbird-dark-ondark-01)}.sendbird-theme--light .sendbird-iconbutton:hover{background-color:var(--sendbird-light-background-100)}.sendbird-theme--dark .sendbird-iconbutton:hover{background-color:var(--sendbird-dark-background-500)}.sendbird-theme--light .sendbird-iconbutton:active{background-color:var(--sendbird-light-background-200)}.sendbird-theme--dark .sendbird-iconbutton:active{background-color:var(--sendbird-dark-background-400)}.sendbird-iconbutton:disabled{cursor:not-allowed!important}.sendbird-theme--light .sendbird-iconbutton:disabled .sendbird-iconbutton__inner svg,.sendbird-theme--light .sendbird-iconbutton:disabled .sendbird-iconbutton__inner path{fill:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-iconbutton:disabled .sendbird-iconbutton__inner svg,.sendbird-theme--dark .sendbird-iconbutton:disabled .sendbird-iconbutton__inner path{fill:var(--sendbird-dark-ondark-02)}.sendbird-theme--light .sendbird-iconbutton--pressed{background-color:var(--sendbird-light-primary-100)}.sendbird-theme--dark .sendbird-iconbutton--pressed{background-color:var(--sendbird-dark-background-700)}.sendbird-button{border-radius:4px;box-shadow:none;cursor:pointer;font-family:var(--sendbird-font-family-default);padding:0;display:inline-flex;justify-content:center;align-items:center}.sendbird-button:hover{box-shadow:none}.sendbird-button:focus{outline:none}.sendbird-button:active{box-shadow:none}.sendbird-button.sendbird-button__disabled{cursor:not-allowed}.sendbird-theme--light .sendbird-button.sendbird-button__disabled{background-color:var(--sendbird-light-background-200);border:none}.sendbird-theme--dark .sendbird-button.sendbird-button__disabled{background-color:var(--sendbird-dark-background-400);border:none}.sendbird-theme--light .sendbird-button.sendbird-button__disabled:hover{background-color:var(--sendbird-light-background-200)}.sendbird-theme--dark .sendbird-button.sendbird-button__disabled:hover{background-color:var(--sendbird-dark-background-400)}.sendbird-button--big{height:40px}.sendbird-button--big .sendbird-button__text{margin:10px 16px}.sendbird-button--small{height:32px}.sendbird-button--small .sendbird-button__text{margin:6px 16px}.sendbird-theme--light .sendbird-button--primary{background-color:var(--sendbird-light-primary-300);border:1px solid var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-button--primary{background-color:var(--sendbird-dark-primary-200);border:1px solid var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-button--primary .sendbird-button__text{color:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-button--primary .sendbird-button__text{color:var(--sendbird-dark-onlight-01)}.sendbird-theme--light .sendbird-button--primary:hover{background-color:var(--sendbird-light-primary-400);border-color:var(--sendbird-light-primary-400)}.sendbird-theme--dark .sendbird-button--primary:hover{background-color:var(--sendbird-dark-primary-300);border-color:var(--sendbird-dark-primary-300)}.sendbird-theme--light .sendbird-button--primary:focus{border:1px solid var(--sendbird-button-border-focus);box-shadow:0 0 0 2px var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-button--primary:focus{border:1px solid var(--sendbird-button-border-focus);box-shadow:0 0 0 2px var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-button--primary:active{background-color:var(--sendbird-light-primary-500)}.sendbird-theme--dark .sendbird-button--primary:active{background-color:var(--sendbird-dark-primary-400)}.sendbird-theme--light .sendbird-button--primary:focus .sendbird-button--primary:hover{box-shadow:0 0 0 2px var(--sendbird-light-primary-400)}.sendbird-theme--dark .sendbird-button--primary:focus .sendbird-button--primary:hover{box-shadow:0 0 0 2px var(--sendbird-dark-primary-300)}.sendbird-theme--light .sendbird-button--primary:focus .sendbird-button--primary:active{box-shadow:0 0 0 2px var(--sendbird-light-primary-500)}.sendbird-theme--dark .sendbird-button--primary:focus .sendbird-button--primary:active{box-shadow:0 0 0 2px var(--sendbird-dark-primary-400)}.sendbird-button--secondary{background-color:transparent}.sendbird-theme--light .sendbird-button--secondary{border:1px solid var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-button--secondary{border:1px solid var(--sendbird-dark-ondark-03)}.sendbird-theme--light .sendbird-button--secondary .sendbird-button__text{color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-button--secondary .sendbird-button__text{color:var(--sendbird-dark-ondark-01)}.sendbird-button--secondary:hover{background-color:transparent}.sendbird-theme--light .sendbird-button--secondary:hover{border:1px solid var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-button--secondary:hover{border:1px solid var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-button--secondary:hover .sendbird-button__text{color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-button--secondary:hover .sendbird-button__text{color:var(--sendbird-dark-primary-200)}.sendbird-button--secondary.sendbird-button__disabled{border:none;cursor:not-allowed}.sendbird-theme--light .sendbird-button--secondary.sendbird-button__disabled{background-color:var(--sendbird-light-background-200)}.sendbird-theme--dark .sendbird-button--secondary.sendbird-button__disabled{background-color:var(--sendbird-dark-background-400)}.sendbird-theme--light .sendbird-button--secondary.sendbird-button__disabled .sendbird-button__text{color:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-button--secondary.sendbird-button__disabled .sendbird-button__text{color:var(--sendbird-dark-ondark-02)}.sendbird-button--secondary.sendbird-button__disabled:hover{border:none}.sendbird-theme--light .sendbird-button--secondary.sendbird-button__disabled:hover{background-color:var(--sendbird-light-background-200)}.sendbird-theme--dark .sendbird-button--secondary.sendbird-button__disabled:hover{background-color:var(--sendbird-dark-background-400)}.sendbird-theme--light .sendbird-button--secondary.sendbird-button__disabled:hover .sendbird-button__text{color:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-button--secondary.sendbird-button__disabled:hover .sendbird-button__text{color:var(--sendbird-dark-ondark-02)}.sendbird-theme--light .sendbird-button--secondary:hover .sendbird-button--secondary:focus .sendbird-button__text{color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-button--secondary:hover .sendbird-button--secondary:focus .sendbird-button__text{color:var(--sendbird-dark-primary-200)}.sendbird-button--secondary:focus{background-color:transparent;border:1px solid transparent}.sendbird-theme--light .sendbird-button--secondary:focus{box-shadow:var(--sendbird-light-primary-300) 0 0 0 2px}.sendbird-theme--dark .sendbird-button--secondary:focus{box-shadow:var(--sendbird-dark-primary-200) 0 0 0 2px}.sendbird-theme--light .sendbird-button--secondary:focus .sendbird-button__text{color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-button--secondary:focus .sendbird-button__text{color:var(--sendbird-dark-ondark-01)}.sendbird-button--secondary:active{box-shadow:none}.sendbird-theme--light .sendbird-button--secondary:active{border:1px solid var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-button--secondary:active{border:1px solid var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-button--secondary:active .sendbird-button__text{color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-button--secondary:active .sendbird-button__text{color:var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-button--warning{background-color:transparent;border:1px solid var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-button--warning{background-color:transparent;border:1px solid var(--sendbird-dark-error-200)}.sendbird-theme--light .sendbird-button--warning .sendbird-button__text{color:var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-button--warning .sendbird-button__text{color:var(--sendbird-dark-error-200)}.sendbird-theme--light .sendbird-button--warning:hover{border-color:var(--sendbird-light-error-400)}.sendbird-theme--dark .sendbird-button--warning:hover{border-color:var(--sendbird-dark-error-100)}.sendbird-theme--light .sendbird-button--warning:hover .sendbird-button__text{color:var(--sendbird-light-error-400)}.sendbird-theme--dark .sendbird-button--warning:hover .sendbird-button__text{color:var(--sendbird-dark-error-100)}.sendbird-theme--light .sendbird-button--warning:focus{border-color:var(--sendbird-light-primary-300)}.sendbird-theme--light .sendbird-theme--light .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-theme--light .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-dark-error-200)}.sendbird-theme--dark .sendbird-button--warning:focus{border-color:var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-theme--dark .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-theme--dark .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-dark-error-200)}.sendbird-theme--light .sendbird-button--warning:hover .sendbird-button--warning:focus{border-color:var(--sendbird-light-primary-300)}.sendbird-theme--light .sendbird-theme--light .sendbird-button--warning:hover .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-light-error-400)}.sendbird-theme--dark .sendbird-theme--light .sendbird-button--warning:hover .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-dark-error-100)}.sendbird-theme--dark .sendbird-button--warning:hover .sendbird-button--warning:focus{border-color:var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-theme--dark .sendbird-button--warning:hover .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-light-error-400)}.sendbird-theme--dark .sendbird-theme--dark .sendbird-button--warning:hover .sendbird-button--warning:focus .sendbird-button__text{color:var(--sendbird-dark-error-100)}.sendbird-theme--light .sendbird-button--danger{background-color:var(--sendbird-light-error-300);border:1px solid var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-button--danger{background-color:var(--sendbird-dark-error-200);border:1px solid var(--sendbird-dark-error-200)}.sendbird-theme--light .sendbird-button--danger .sendbird-button__text{color:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-button--danger .sendbird-button__text{color:var(--sendbird-dark-onlight-01)}.sendbird-theme--light .sendbird-button--danger:hover{background-color:var(--sendbird-light-error-400);border-color:var(--sendbird-light-error-400)}.sendbird-theme--dark .sendbird-button--danger:hover{background-color:var(--sendbird-dark-error-400);border-color:var(--sendbird-dark-error-400)}.sendbird-theme--light .sendbird-button--danger:focus{border-color:var(--sendbird-button-border-focus);box-shadow:0 0 0 2px var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-button--danger:focus{border-color:var(--sendbird-button-border-focus);box-shadow:0 0 0 2px var(--sendbird-dark-error-300)}.sendbird-button--danger:active{box-shadow:none}.sendbird-theme--light .sendbird-button--danger:active{background-color:var(--sendbird-light-error-500)}.sendbird-theme--dark .sendbird-button--danger:active{background-color:var(--sendbird-dark-error-500)}.sendbird-theme--light .sendbird-button--danger:hover .sendbird-button--danger:focus{box-shadow:0 0 0 2px var(--sendbird-light-error-400)}.sendbird-theme--dark .sendbird-button--danger:hover .sendbird-button--danger:focus{box-shadow:0 0 0 2px var(--sendbird-dark-error-400)}.sendbird-theme--light .sendbird-button--danger:active .sendbird-button--danger:focus{box-shadow:0 0 0 2px var(--sendbird-light-error-500)}.sendbird-theme--dark .sendbird-button--danger:active .sendbird-button--danger:focus{box-shadow:0 0 0 2px var(--sendbird-dark-error-500)}.sendbird-button--disabled{border:1px solid transparent;cursor:not-allowed}.sendbird-theme--light .sendbird-button--disabled{background-color:var(--sendbird-light-background-200);color:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-button--disabled{background-color:var(--sendbird-dark-background-400);color:var(--sendbird-dark-onlight-01)}.sendbird--mobile-mode .sendbird-label{-webkit-user-select:none;-webkit-touch-callout:none}[class*=sendbird-label]{font-family:var(--sendbird-font-family-default)}.sendbird-label--h-1{font-size:20px;font-weight:600;font-stretch:normal;font-style:normal;line-height:1.4;letter-spacing:-.2px}.sendbird-label--h-2{font-size:18px;font-weight:600;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:-.2px}.sendbird-label--subtitle-1{font-size:16px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1.38;letter-spacing:-.2px}.sendbird-label--subtitle-2{font-size:14px;font-weight:500;font-stretch:normal;font-style:normal;line-height:1.14;letter-spacing:-.2px}.sendbird-label--body-1{font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal}.sendbird-label--body-2{font-size:12px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1.33;letter-spacing:normal}.sendbird-label--button-1{font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal}.sendbird-label--button-2{font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal}.sendbird-label--button-3{font-size:14px;font-weight:500;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal}.sendbird-label--caption-1{font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal}.sendbird-label--caption-2{font-size:12px;font-weight:700;font-style:normal;line-height:1;letter-spacing:normal}.sendbird-label--caption-3{font-size:12px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1;letter-spacing:normal}.sendbird-theme--light .sendbird-label--color-onbackground-1{color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-label--color-onbackground-1{color:var(--sendbird-dark-ondark-01)}.sendbird-theme--light .sendbird-label--color-onbackground-2{color:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-label--color-onbackground-2{color:var(--sendbird-dark-ondark-02)}.sendbird-theme--light .sendbird-label--color-onbackground-3{color:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-label--color-onbackground-3{color:var(--sendbird-dark-ondark-03)}.sendbird-theme--light .sendbird-label--color-onbackground-4{color:var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-label--color-onbackground-4{color:var(--sendbird-dark-ondark-04)}.sendbird-theme--light .sendbird-label--color-oncontent-1{color:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-label--color-oncontent-1{color:var(--sendbird-dark-onlight-01)}.sendbird-theme--light .sendbird-label--color-oncontent-2{color:var(--sendbird-light-ondark-02)}.sendbird-theme--dark .sendbird-label--color-oncontent-2{color:var(--sendbird-dark-onlight-02)}.sendbird-theme--light .sendbird-label--color-oncontent-inverse-1{color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-label--color-oncontent-inverse-1{color:var(--sendbird-dark-ondark-01)}.sendbird-theme--light .sendbird-label--color-oncontent-inverse-5{color:var(--sendbird-light-onlight-05)}.sendbird-theme--dark .sendbird-label--color-oncontent-inverse-5{color:var(--sendbird-dark-ondark-05)}.sendbird-theme--light .sendbird-label--color-primary{color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-label--color-primary{color:var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-label--color-error{color:var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-label--color-error{color:var(--sendbird-dark-error-200)}.sendbird-theme--light .sendbird-label--color-secondary-3{color:var(--sendbird-light-secondary-300)}.sendbird-theme--dark .sendbird-label--color-secondary-3{color:var(--sendbird-dark-secondary-200)}.sendbird-icon{display:inline-block}.sendbird-icon:focus{outline:none}.sendbird-theme--light .sendbird-icon-color--primary [class*=fill]{fill:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-icon-color--primary [class*=fill]{fill:var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-icon-color--primary-2 [class*=fill]{fill:var(--sendbird-light-primary-200)}.sendbird-theme--dark .sendbird-icon-color--primary-2 [class*=fill]{fill:var(--sendbird-dark-primary-400)}.sendbird-theme--light .sendbird-icon-color--primary [class*=stroke]{stroke:var(--sendbird-light-primary-300);stroke-width:2px;stroke-linejoin:round}.sendbird-theme--dark .sendbird-icon-color--primary [class*=stroke]{stroke:var(--sendbird-dark-primary-200);stroke-width:2px;stroke-linejoin:round}.sendbird-theme--light .sendbird-icon-color--secondary [class*=fill]{fill:var(--sendbird-light-secondary-300)}.sendbird-theme--dark .sendbird-icon-color--secondary [class*=fill]{fill:var(--sendbird-dark-secondary-200)}.sendbird-theme--light .sendbird-icon-color--content [class*=fill]{fill:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-icon-color--content [class*=fill]{fill:var(--sendbird-dark-onlight-01)}.sendbird-theme--light .sendbird-icon-color--content-inverse [class*=fill]{fill:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-icon-color--content-inverse [class*=fill]{fill:var(--sendbird-dark-ondark-01)}.sendbird-theme--light .sendbird-icon-color--content-inverse-5 [class*=fill]{fill:var(--sendbird-light-onlight-05)}.sendbird-theme--dark .sendbird-icon-color--content-inverse-5 [class*=fill]{fill:var(--sendbird-dark-ondark-05)}.sendbird-icon-color--white [class*=fill]{fill:#fff}.sendbird-icon-color--gray [class*=fill]{fill:var(--sendbird-light-onlight-04)}.sendbird-icon-color--thumbnail-icon [class*=fill]{fill:var(--sendbird-light-onlight-02)}.sendbird-theme--light .sendbird-icon-color--sent [class*=fill]{fill:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-icon-color--sent [class*=fill]{fill:var(--sendbird-dark-ondark-03)}.sendbird-theme--light .sendbird-icon-color--read [class*=fill]{fill:var(--sendbird-light-secondary-300)}.sendbird-theme--dark .sendbird-icon-color--read [class*=fill]{fill:var(--sendbird-dark-secondary-200)}.sendbird-theme--light .sendbird-icon-color--on-background-1 [class*=fill]{fill:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-icon-color--on-background-1 [class*=fill]{fill:var(--sendbird-dark-ondark-01)}.sendbird-theme--light .sendbird-icon-color--on-background-2 [class*=fill]{fill:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-icon-color--on-background-2 [class*=fill]{fill:var(--sendbird-dark-ondark-02)}.sendbird-theme--light .sendbird-icon-color--on-background-3 [class*=fill]{fill:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-icon-color--on-background-3 [class*=fill]{fill:var(--sendbird-dark-ondark-03)}.sendbird-theme--light .sendbird-icon-color--on-background-4 [class*=fill]{fill:var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-icon-color--on-background-4 [class*=fill]{fill:var(--sendbird-dark-ondark-04)}.sendbird-theme--light .sendbird-icon-color--background-3 [class*=fill]{fill:var(--sendbird-light-background-300)}.sendbird-theme--dark .sendbird-icon-color--background-3 [class*=fill]{fill:var(--sendbird-dark-background-400)}.sendbird-theme--light .sendbird-icon-color--error [class*=fill]{fill:var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-icon-color--error [class*=fill]{fill:var(--sendbird-dark-error-200)}.sendbird-conversation{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box}.sendbird-theme--light .sendbird-conversation{background-color:var(--sendbird-light-background-50);border:1px solid var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-conversation{background-color:var(--sendbird-dark-background-600);border:1px solid var(--sendbird-dark-ondark-04)}.sendbird-conversation__messages{overflow:hidden;flex:1 1 0}.sendbird-conversation__messages-list{display:flex;flex-direction:column;height:100%;justify-content:flex-end}.sendbird-conversation__footer{width:100%;padding:0 0 24px}.sendbird-msg-hoc__animated .sendbird-message-content{animation:bounce 1s ease}@keyframes bounce{50%{transform:translateY(-10px)}60%{transform:translateY(0)}90%{transform:translateY(-10px)}to{transform:translateY(0)}}.sendbird-conversation__scroll-container{display:flex;height:100%;overflow-y:auto;overflow-x:hidden;flex-direction:column}.sendbird-conversation__scroll-container .sendbird-conversation__padding{flex:1 1 0}.sendbird-conversation__footer{position:relative;box-sizing:border-box;margin-top:6px}.sendbird-conversation__footer .sendbird-conversation__footer__typing-indicator{position:absolute;display:inline-flex;bottom:8px}.sendbird-conversation__footer .sendbird-conversation__footer__typing-indicator .sendbird-conversation__footer__typing-indicator__text{margin-left:24px;margin-right:10px}.sendbird-connection-status{display:flex;align-items:center;padding-top:5px}.sendbird-place-holder{position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%}.sendbird-place-holder .sendbird-place-holder__body{display:flex;flex-direction:column;height:104px;align-items:center}.sendbird-place-holder .sendbird-place-holder__body .sendbird-place-holder__body__icon{margin-bottom:10px}.sendbird-place-holder .sendbird-place-holder__body .sendbird-place-holder__body__text{margin-top:10px}.sendbird-place-holder .sendbird-place-holder__body__reconnect{margin-top:18px;display:flex;flex-direction:row;cursor:pointer}.sendbird-place-holder .sendbird-place-holder__body__reconnect .sendbird-place-holder__body__reconnect__icon{margin-right:4px}.sendbird-place-holder .sendbird-place-holder__body--align-top{position:absolute;top:24px;display:flex;width:100%;flex-direction:column;justify-content:center}.sendbird-place-holder .sendbird-place-holder__body--align-top .sendbird-place-holder__body--align-top__text{display:flex;flex-direction:row;justify-content:center;padding-left:16px;padding-right:16px}.sendbird-place-holder .sendbird-place-holder__body--align-top .sendbird-place-holder__body--align-top__text .sendbird-place-holder__body--align-top__text__search-in{display:flex;min-width:60px;margin-right:2px}.sendbird-place-holder .sendbird-place-holder__body--align-top .sendbird-place-holder__body--align-top__text .sendbird-place-holder__body--align-top__text__channel-name{display:block;max-width:calc(100% - 62px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sendbird-place-holder .sendbird-place-holder__body--align-top .sendbird-place-hlder__body--align-top__searching,.sendbird-place-holder .sendbird-place-holder__body--align-top .sendbird-place-hlder__body--align-top__no-result{display:flex;justify-content:center}.sendbird-loader{display:inline-block;animation:1s infinite linear;animation-name:rotate}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.sendbird-chat-header{position:relative;display:flex;flex-direction:row;justify-content:space-between;align-items:center;height:64px;min-height:64px;padding-left:20px;padding-right:16px;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box}.sendbird-theme--light .sendbird-chat-header{border-bottom:1px solid var(--sendbird-light-onlight-04);background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-chat-header{border-bottom:1px solid var(--sendbird-dark-ondark-04);background-color:var(--sendbird-dark-background-600)}.sendbird-chat-header__left{margin-right:24px}.sendbird-chat-header__left,.sendbird-chat-header__right{overflow:hidden;display:flex;flex-direction:row;align-items:center}.sendbird-chat-header .sendbird-chat-header__left__title{margin-left:8px;margin-right:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:780px}.sendbird--mobile-mode .sendbird-chat-header .sendbird-chat-header__left__title{max-width:calc(100vw - 240px)}.sendbird-chat-header .sendbird-chat-header__left__subtitle{max-width:240px;overflow:hidden;text-overflow:ellipsis}.sendbird-chat-header .sendbird-chat-header__right__mute{margin-right:18px}.sendbird-chat-header .sendbird-iconbutton--pressed{background-color:inherit}.sendbird-chat-header .sendbird-chat-header__right__info{margin-left:16px}.sendbird-chat-header__icon_back{margin-right:8px}.sendbird-chat-header--default-avatar{width:56px;height:56px;display:flex;justify-content:center;align-items:center;border-radius:50%}.sendbird-theme--light .sendbird-chat-header--default-avatar{background-color:var(--sendbird-light-secondary-300)}.sendbird-theme--dark .sendbird-chat-header--default-avatar{background-color:var(--sendbird-dark-secondary-200)}.sendbird-image-renderer{overflow:hidden;position:relative}.sendbird-image-renderer__hidden-image-loader{display:none}.sendbird-image-renderer,.sendbird-image-renderer__image{width:320px;height:180px}.sendbird-multiple-files-image-renderer__image-cover{position:absolute;top:0;display:none;width:100%;height:100%;border-radius:16px;background-color:var(--sendbird-light-overlay-01)}.sendbird-image-renderer:hover .sendbird-multiple-files-image-renderer__image-cover{display:inline-flex}.sendbird-multiple-files-image-renderer__icon-wrapper{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center;z-index:1}.sendbird-multiple-files-image-renderer__icon-wrapper .sendbird-multiple-files-image-renderer__icon-wrapper__icon{display:flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:50%;background-color:var(--sendbird-light-ondark-01);z-index:2}.sendbird-avatar{border-radius:50%;display:inline-block;overflow:hidden;position:relative}.sendbird-avatar:focus{outline:none}.sendbird-avatar .sendbird-avatar-img{align-items:center;display:flex;justify-content:center;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.sendbird-theme--light .sendbird-avatar .sendbird-avatar-img{background-color:var(--sendbird-light-background-300)}.sendbird-theme--dark .sendbird-avatar .sendbird-avatar-img{background-color:var(--sendbird-dark-background-300)}.sendbird-avatar .sendbird-avatar--inner__two-child .sendbird-avatar-img:first-child{transform:translate(2%,-50%)}.sendbird-avatar .sendbird-avatar--inner__two-child .sendbird-avatar-img:last-child{transform:translate(-102%,-50%)}.sendbird-avatar .sendbird-avatar--inner__three-child--upper .sendbird-avatar-img:first-child{transform:translate(-50%,-102%)}.sendbird-avatar .sendbird-avatar--inner__three-child--lower .sendbird-avatar-img:first-child{transform:translate(-77%,-23%) scale(.5)}.sendbird-avatar .sendbird-avatar--inner__three-child--lower .sendbird-avatar-img:last-child{transform:translate(-23%,-23%) scale(.5)}.sendbird-avatar .sendbird-avatar--inner__four-child .sendbird-avatar-img:first-child{transform:translate(-77%,-77%) scale(.5)}.sendbird-avatar .sendbird-avatar--inner__four-child .sendbird-avatar-img:nth-child(2){transform:translate(-23%,-77%) scale(.5)}.sendbird-avatar .sendbird-avatar--inner__four-child .sendbird-avatar-img:nth-child(3){transform:translate(-77%,-23%) scale(.5)}.sendbird-avatar .sendbird-avatar--inner__four-child .sendbird-avatar-img:last-child{transform:translate(-23%,-23%) scale(.5)}.sendbird-avatar .sendbird-avatar-img--default{align-items:center;display:flex;justify-content:center}.sendbird-theme--light .sendbird-avatar .sendbird-avatar-img--default{background-color:var(--sendbird-light-background-300)}.sendbird-theme--dark .sendbird-avatar .sendbird-avatar-img--default{background-color:var(--sendbird-dark-background-300)}.sendbird-theme--light .sendbird-avatar .sendbird-avatar-img--default.text{background-color:var(--sendbird-light-background-100)}.sendbird-theme--dark .sendbird-avatar .sendbird-avatar-img--default.text{background-color:var(--sendbird-dark-background-400)}.sendbird-avatar .sendbird-avatar-text{font-family:Roboto;font-size:8px;font-style:normal;font-weight:700;font-weight:400;line-height:12px;text-align:center}.sendbird-theme--light .sendbird-avatar .sendbird-avatar-text{color:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-avatar .sendbird-avatar-text{color:var(--sendbird-dark-ondark-02)}.sendbird-ui-header{position:relative;display:flex;flex-direction:row;justify-content:space-between;align-items:center;height:64px;min-height:64px;padding-left:16px;padding-right:16px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}.sendbird-theme--light .sendbird-ui-header{border-bottom:1px solid var(--sendbird-light-onlight-04);background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-ui-header{border-bottom:1px solid var(--sendbird-dark-ondark-04);background-color:var(--sendbird-dark-background-600)}.sendbird-ui-header--is-desktop{max-width:176px}.sendbird-ui-header--is-mobile{max-width:80px}.sendbird-ui-header__left{position:relative;left:0;flex:0 0 auto;display:inline-flex;align-items:center;margin-right:8px}.sendbird-ui-header__middle{flex:1;display:inline-flex;flex-direction:column;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.sendbird-ui-header__middle__subtitle__container{display:flex;width:100%}.sendbird-ui-header__middle__title,.sendbird-ui-header__middle__subtitle{overflow:hidden;text-wrap:nowrap;text-overflow:ellipsis;width:100%}.sendbird-ui-header__right{position:relative;right:0;flex:0 0 auto;display:inline-flex;align-items:center;margin-left:8px}.sendbird-textbutton{text-decoration:underline;cursor:pointer;display:inline-block}.sendbird-textbutton--not-underline{text-decoration:none;cursor:pointer}.sendbird-textbutton--disabled{cursor:not-allowed}.sendbird-theme--light .sendbird-textbutton--disabled{color:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-textbutton--disabled{color:var(--sendbird-dark-ondark-03)}.sendbird-theme--light .sendbird-color--onbackground-1{color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-color--onbackground-1{color:var(--sendbird-dark-ondark-01)}.sendbird-theme--light .sendbird-color--onbackground-1--background-color{background-color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-color--onbackground-1--background-color{background-color:var(--sendbird-dark-ondark-01)}.sendbird-theme--light .sendbird-color--onbackground-2{color:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-color--onbackground-2{color:var(--sendbird-dark-ondark-02)}.sendbird-theme--light .sendbird-color--onbackground-2--background-color{background-color:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-color--onbackground-2--background-color{background-color:var(--sendbird-dark-ondark-02)}.sendbird-theme--light .sendbird-color--onbackground-3{color:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-color--onbackground-3{color:var(--sendbird-dark-ondark-03)}.sendbird-theme--light .sendbird-color--onbackground-3--background-color{background-color:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-color--onbackground-3--background-color{background-color:var(--sendbird-dark-ondark-03)}.sendbird-theme--light .sendbird-color--onbackground-4{color:var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-color--onbackground-4{color:var(--sendbird-dark-ondark-04)}.sendbird-theme--light .sendbird-color--onbackground-4--background-color{background-color:var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-color--onbackground-4--background-color{background-color:var(--sendbird-dark-ondark-04)}.sendbird-theme--light .sendbird-color--oncontent-1{color:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-color--oncontent-1{color:var(--sendbird-dark-onlight-01)}.sendbird-theme--light .sendbird-color--oncontent-1--background-color{background-color:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-color--oncontent-1--background-color{background-color:var(--sendbird-dark-onlight-01)}.sendbird-theme--light .sendbird-color--primary{color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-color--primary{color:var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-color--primary--background-color{background-color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-color--primary--background-color{background-color:var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-color--error{color:var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-color--error{color:var(--sendbird-dark-error-200)}.sendbird-theme--light .sendbird-color--error--background-color{background-color:var(--sendbird-light-error-300)}.sendbird-theme--dark .sendbird-color--error--background-color{background-color:var(--sendbird-dark-error-300)}.sendbird-conversation__messages{position:relative}.sendbird-conversation__messages .sendbird-conversation__messages-padding{position:relative;height:100%;overflow-x:hidden;padding:0 24px}.sendbird--mobile-mode .sendbird-conversation__messages .sendbird-conversation__messages-padding{padding:0 12px}.sendbird-conversation__messages .sendbird-separator,.sendbird-conversation__messages .sendbird-admin-message{padding-top:8px;padding-bottom:8px}.sendbird-conversation__messages__notification{position:fixed;top:0;width:calc(100% - 50px);margin-left:25px}.sendbird-conversation__scroll-bottom-button{position:sticky;display:flex;align-items:center;justify-content:center;bottom:30px;left:calc(100% - 65px);width:40px;height:40px;border-radius:24px}.sendbird-theme--light .sendbird-conversation__scroll-bottom-button{background-color:var(--sendbird-light-background-50);box-shadow:var(--sendbird-light-shadow-05)}.sendbird-theme--dark .sendbird-conversation__scroll-bottom-button{background-color:var(--sendbird-dark-background-400);box-shadow:var(--sendbird-dark-shadow-05)}.sendbird-conversation__scroll-bottom-button:hover{cursor:pointer}.sendbird-theme--light .sendbird-conversation__scroll-bottom-button:hover{background-color:var(--sendbird-light-background-100)}.sendbird-theme--dark .sendbird-conversation__scroll-bottom-button:hover{background-color:var(--sendbird-dark-background-500)}.sendbird-theme--light .sendbird-conversation__scroll-bottom-button:active{background-color:var(--sendbird-light-background-200)}.sendbird-theme--dark .sendbird-conversation__scroll-bottom-button:active{background-color:var(--sendbird-dark-background-700)}.sendbird-conversation__scroll-bottom-button:focus{outline:none}.sendbird-separator{width:100%;display:flex;align-items:center}.sendbird-separator .sendbird-separator__left,.sendbird-separator .sendbird-separator__right{border:none;height:1px;display:inline-block;width:100%}.sendbird-separator .sendbird-separator__text{margin:0 16px;display:flex;white-space:nowrap}.sendbird-fileviewer__header__right__actions__download,.sendbird-fileviewer__header__right__actions__delete,.sendbird-fileviewer__header__right__actions__close{width:64px;padding:21px;box-sizing:border-box;cursor:pointer}.sendbird-fileviewer__header__right__actions__download .disabled,.sendbird-fileviewer__header__right__actions__delete .disabled,.sendbird-fileviewer__header__right__actions__close .disabled{cursor:not-allowed}.sendbird-fileviewer{width:100%;height:100%;position:fixed;top:0;left:0;z-index:100000}.sendbird-theme--light .sendbird-fileviewer{background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-fileviewer{background-color:var(--sendbird-dark-background-600)}.sendbird-fileviewer .sendbird-fileviewer__header{height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between}.sendbird--mobile-mode .sendbird-fileviewer .sendbird-fileviewer__header{position:relative}.sendbird-theme--light .sendbird-fileviewer .sendbird-fileviewer__header{border-bottom:1px solid var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-fileviewer .sendbird-fileviewer__header{border-bottom:1px solid var(--sendbird-dark-ondark-04)}.sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__left{box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px}.sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__left .sendbird-fileviewer__header__left__avatar{margin-right:8px}.sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__left .sendbird-fileviewer__header__left__filename{max-width:500px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block}.sendbird--mobile-mode .sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__left .sendbird-fileviewer__header__left__filename{position:absolute;left:64px;top:10px;display:block;max-width:calc(100vw - 240px)}.sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__left .sendbird-fileviewer__header__left__sender-name{max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-flex;margin-left:8px;padding-top:5px}.sendbird--mobile-mode .sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__left .sendbird-fileviewer__header__left__sender-name{position:absolute;left:56px;top:24px}.sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__right{display:flex;width:160px;justify-content:flex-end}.sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__right .sendbird-fileviewer__header__right__actions{right:0;display:flex;flex-direction:row}.sendbird-theme--light .sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__right .sendbird-fileviewer__header__right__actions__close{border-left:1px solid var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-fileviewer .sendbird-fileviewer__header .sendbird-fileviewer__header__right .sendbird-fileviewer__header__right__actions__close{border-left:1px solid var(--sendbird-dark-ondark-04)}.sendbird-fileviewer .sendbird-fileviewer__content{height:calc(100% - 72px);margin-top:4px;overflow-y:auto;display:flex;align-items:center;justify-content:center}.sendbird-fileviewer .sendbird-fileviewer__content .sendbird-fileviewer__content__video{max-width:100%;max-height:100%}.sendbird-fileviewer .sendbird-fileviewer__content .sendbird-fileviewer__content__img{max-width:90%;max-height:90%}.sendbird-fileviewer .sendbird-fileviewer__content .sendbird-fileviewer__content__unsupported{max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center}.sendbird-notification--hide,.sendbird-notification{position:absolute}.sendbird-notification--hide{display:none}.sendbird-notification{margin-top:8px;margin-left:24px;margin-right:24px;border-radius:4px;padding:0 2px;height:32px;display:flex;align-items:center;justify-content:center}.sendbird-theme--light .sendbird-notification{background-color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-notification{background-color:var(--sendbird-dark-primary-200)}.sendbird-notification:hover{cursor:pointer}.sendbird-theme--light .sendbird-notification:hover{background-color:var(--sendbird-light-primary-400)}.sendbird-theme--dark .sendbird-notification:hover{background-color:var(--sendbird-dark-primary-300)}.sendbird-theme--light .sendbird-notification.sendbird-notification--frozen{background-color:var(--sendbird-light-information-100)}.sendbird-theme--dark .sendbird-notification.sendbird-notification--frozen{background-color:var(--sendbird-dark-information-100)}.sendbird-theme--light .sendbird-notification.sendbird-notification--frozen .sendbird-notification__text{color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-notification.sendbird-notification--frozen .sendbird-notification__text{color:var(--sendbird-dark-onlight-01)}.sendbird-notification .sendbird-notification__text{display:flex;align-items:center;justify-content:center;margin-right:8px}.typing-dots-container{align-items:center;border-radius:16px;display:flex;gap:6px;justify-content:center;padding:16px 12px}.sendbird-theme--light .typing-dots-container{background-color:var(--sendbird-light-background-100)}.sendbird-theme--dark .typing-dots-container{background-color:var(--sendbird-dark-background-400)}.typing-dots-container span{animation:blink 1.4s infinite;animation-fill-mode:both;border-radius:50%;height:8px;width:8px}.sendbird-theme--light .typing-dots-container span{background-color:var(--sendbird-light-background-700)}.sendbird-theme--dark .typing-dots-container span{background-color:var(--sendbird-dark-background-50)}.typing-dots-container span:nth-child(1){animation-delay:.4s}.typing-dots-container span:nth-child(2){animation-delay:.6s}.typing-dots-container span:nth-child(3){animation-delay:.8s}@keyframes blink{0%{opacity:.12;transform:scale(1)}21.43%{opacity:.38;transform:scale(1.2)}42.86%{opacity:.12;transform:scale(1)}to{opacity:.12;transform:scale(1)}}.sendbird-message-input-wrapper--voice-message,.sendbird-message-input-wrapper,.sendbird-message-input-wrapper--voice-message .sendbird-message-input-wrapper__quote-message-input,.sendbird-message-input-wrapper .sendbird-message-input-wrapper__quote-message-input{position:relative;width:100%}.sendbird-theme--light .sendbird-message-input-wrapper--voice-message .sendbird-message-input-wrapper__quote-message-input,.sendbird-theme--light .sendbird-message-input-wrapper .sendbird-message-input-wrapper__quote-message-input{border-top:solid 1px var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-message-input-wrapper--voice-message .sendbird-message-input-wrapper__quote-message-input,.sendbird-theme--dark .sendbird-message-input-wrapper .sendbird-message-input-wrapper__quote-message-input{border-top:solid 1px var(--sendbird-dark-ondark-04)}.sendbird-message-input-wrapper--voice-message .sendbird-message-input-wrapper__message-input,.sendbird-message-input-wrapper .sendbird-message-input-wrapper__message-input{position:relative;width:100%;box-sizing:border-box;padding:0 24px}.sendbird--mobile-mode .sendbird-message-input-wrapper--voice-message .sendbird-message-input-wrapper__message-input,.sendbird--mobile-mode .sendbird-message-input-wrapper .sendbird-message-input-wrapper__message-input{padding:0 16px}.sendbird-theme--light .sendbird-message-input-wrapper--voice-message{border-top:1px solid var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-message-input-wrapper--voice-message{border-top:1px solid var(--sendbird-dark-ondark-04)}.sendbird-mention-suggest-list{position:relative;display:flex;flex-direction:column;width:calc(100% - 56px);max-height:260px;overflow:scroll;margin-left:28px;margin-right:28px}.sendbird-theme--light .sendbird-mention-suggest-list{border:1px solid var(--sendbird-light-background-100)}.sendbird-theme--dark .sendbird-mention-suggest-list{border:1px solid var(--sendbird-dark-background-500)}.sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item{position:relative;display:flex;align-items:center;padding:16px 8px}.sendbird-theme--light .sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item{background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item{background-color:var(--sendbird-dark-background-600)}.sendbird-theme--light .sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item.focused{background-color:var(--sendbird-light-background-100)}.sendbird-theme--dark .sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item.focused{background-color:var(--sendbird-dark-background-500)}.sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item .sendbird-mention-suggest-list__user-item__avatar{position:relative;display:inline-block}.sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item .sendbird-mention-suggest-list__user-item__nickname{position:relative;display:inline-block;margin-left:16px;max-width:calc(100% - 250px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sendbird--mobile-mode .sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item .sendbird-mention-suggest-list__user-item__nickname{max-width:calc(100% - 150px)}.sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item .sendbird-mention-suggest-list__user-item__user-id{position:absolute;display:inline-block;right:16px;max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sendbird--mobile-mode .sendbird-mention-suggest-list .sendbird-mention-suggest-list__user-item .sendbird-mention-suggest-list__user-item__user-id{max-width:100px}.sendbird-mention-suggest-list .sendbird-mention-suggest-list__notice-item{position:relative;display:flex;align-items:center;padding:16px 8px}.sendbird-theme--light .sendbird-mention-suggest-list .sendbird-mention-suggest-list__notice-item{background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-mention-suggest-list .sendbird-mention-suggest-list__notice-item{background-color:var(--sendbird-dark-background-600)}.sendbird-mention-suggest-list .sendbird-mention-suggest-list__notice-item .sendbird-mention-suggest-list__notice-item__icon{margin-right:4px}.sendbird-message-input{display:inline-block;width:100%;position:relative}.sendbird-message-input .sendbird-message-input--textarea{position:relative;width:100%;border-radius:4px;font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1.43;height:56px;overflow-y:scroll;letter-spacing:normal;padding:18px 64px 18px 16px;box-sizing:border-box;resize:none;font-family:var(--sendbird-font-family-default);background-color:inherit;white-space:pre-wrap}.sendbird-theme--light .sendbird-message-input .sendbird-message-input--textarea{color:var(--sendbird-light-onlight-01);caret-color:var(--sendbird-light-primary-300);border:solid 1px var(--sendbird-light-onlight-03);background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-message-input .sendbird-message-input--textarea{color:var(--sendbird-dark-ondark-01);caret-color:var(--sendbird-dark-primary-200);border:solid 1px var(--sendbird-dark-ondark-03);background-color:var(--sendbird-dark-background-500)}.sendbird-message-input .sendbird-message-input--textarea:focus{outline:none}.sendbird-theme--light .sendbird-message-input .sendbird-message-input--textarea:focus{color:var(--sendbird-light-onlight-01);border:solid 1px var(--sendbird-light-primary-300);box-shadow:var(--sendbird-light-shadow-message-input)}.sendbird-theme--dark .sendbird-message-input .sendbird-message-input--textarea:focus{color:var(--sendbird-dark-ondark-01);border:solid 1px var(--sendbird-dark-primary-200);box-shadow:var(--sendbird-dark-shadow-message-input)}.sendbird-theme--light .sendbird-message-input .sendbird-message-input--textarea:active{border:solid 1px var(--sendbird-message-input-border-active);color:var(--sendbird-light-onlight-01)}.sendbird-theme--dark .sendbird-message-input .sendbird-message-input--textarea:active{border:solid 1px var(--sendbird-message-input-border-active);color:var(--sendbird-dark-ondark-01)}.sendbird-message-input .sendbird-message-input--placeholder{position:absolute;pointer-events:none;top:18px;left:16px;font-family:var(--sendbird-font-family-default);font-size:14px;line-height:1.43}.sendbird-message-input .sendbird-message-input--attach{position:absolute;padding:6px;right:16px;bottom:14px}.sendbird-message-input .sendbird-message-input--attach.is-voice-message-enabled{right:48px}.sendbird-message-input .sendbird-message-input--voice-message,.sendbird-message-input .sendbird-message-input--send{position:absolute;padding:6px;right:16px;bottom:14px}.sendbird-message-input .sendbird-message-input--attach-input{display:none}.sendbird-message-input__edit{padding:16px;box-sizing:border-box}.sendbird-theme--light .sendbird-message-input__edit{background-color:var(--sendbird-light-primary-100)}.sendbird-theme--dark .sendbird-message-input__edit{background-color:var(--sendbird-dark-background-700)}.sendbird-message-input--edit-action{text-align:right;margin-top:4px}.sendbird-message-input--edit-action button:last-child{margin-left:8px}.sendbird-message-input--edit-action .sendbird-message-input--edit-action__cancel{width:80px}.sendbird-theme--light .sendbird-message-input--edit-action .sendbird-message-input--edit-action__cancel{border:solid 1px var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-message-input--edit-action .sendbird-message-input--edit-action__cancel{border:solid 1px var(--sendbird-dark-ondark-03)}.sendbird-message-input--edit-action .sendbird-message-input--edit-action__save{width:80px}.sendbird-message-input-form__disabled{cursor:not-allowed}.sendbird-message-input__disabled{pointer-events:none;cursor:not-allowed}.sendbird-theme--light .sendbird-message-input__disabled .sendbird-message-input--textarea{color:var(--sendbird-light-onlight-04);border:1px solid var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-message-input__disabled .sendbird-message-input--textarea{color:var(--sendbird-dark-ondark-04);border:1px solid var(--sendbird-dark-ondark-04)}.sendbird-input{display:inline-block;width:100%;height:40px;position:relative}.sendbird-input .sendbird-input__input{width:100%;height:100%;border-radius:4px;font-family:var(--sendbird-font-family-default);font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal;padding:10px 16px;box-sizing:border-box;background-color:inherit}.sendbird-theme--light .sendbird-input .sendbird-input__input{color:var(--sendbird-light-onlight-01);caret-color:var(--sendbird-light-primary-300);border:solid 1px var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-input .sendbird-input__input{color:var(--sendbird-dark-ondark-01);caret-color:var(--sendbird-dark-primary-200);border:solid 1px var(--sendbird-dark-ondark-03)}.sendbird-input .sendbird-input__input:focus{outline:none}.sendbird-theme--light .sendbird-input .sendbird-input__input:focus{box-shadow:0 1px 5px 0 var(--sendbird-light-onlight-04),0 0 1px #00000029,0 2px 1px #00000014;color:var(--sendbird-light-onlight-01);border:solid 2px var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-input .sendbird-input__input:focus{box-shadow:0 1px 5px 0 var(--sendbird-dark-ondark-04),0 0 1px #00000029,0 2px 1px #00000014;color:var(--sendbird-dark-ondark-01);border:solid 2px var(--sendbird-dark-primary-200)}.sendbird-theme--light .sendbird-input .sendbird-input__input:active{box-shadow:0 1px 5px 0 var(--sendbird-light-onlight-04),0 0 1px #00000029,0 2px 1px #00000014;color:var(--sendbird-light-onlight-01);border:solid 1px var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-input .sendbird-input__input:active{box-shadow:0 1px 5px 0 var(--sendbird-dark-ondark-04),0 0 1px #00000029,0 2px 1px #00000014;color:var(--sendbird-dark-ondark-01);border:solid 1px var(--sendbird-dark-primary-200)}.sendbird-input .sendbird-input__input:disabled{cursor:not-allowed}.sendbird-theme--light .sendbird-input .sendbird-input__input:disabled{background-color:var(--sendbird-light-background-100);color:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-input .sendbird-input__input:disabled{background-color:var(--sendbird-dark-background-500);color:var(--sendbird-dark-ondark-03)}.sendbird-input .sendbird-input__placeholder{position:absolute;pointer-events:none;top:10px;left:16px;font-family:var(--sendbird-font-family-default);font-size:14px;line-height:1.43}.sendbird-theme--light .sendbird-input .sendbird-input__placeholder{color:var(--sendbird-light-onlight-03)}.sendbird-theme--dark .sendbird-input .sendbird-input__placeholder{color:var(--sendbird-dark-ondark-03)}.sendbird-input-label{margin:4px 0}.sendbird-iconbutton__feedback{display:flex;justify-content:center;align-items:center;background-color:transparent;cursor:pointer;border-radius:18px;border:1px solid;padding:5px 8px}.sendbird-theme--light .sendbird-iconbutton__feedback{border-color:var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-iconbutton__feedback{border-color:var(--sendbird-dark-ondark-04)}.sendbird-theme--light .sendbird-iconbutton__feedback:hover{background-color:var(--sendbird-light-background-100)}.sendbird-theme--dark .sendbird-iconbutton__feedback:hover{background-color:var(--sendbird-dark-background-500)}.sendbird-iconbutton__feedback.sendbird-iconbutton__feedback__disabled{cursor:not-allowed}.sendbird-iconbutton__feedback.sendbird-iconbutton__feedback__disabled:hover,.sendbird-iconbutton__feedback.sendbird-iconbutton__feedback__pressed:hover{background-color:transparent}.sendbird-theme--light .sendbird-iconbutton__feedback.sendbird-iconbutton__feedback__pressed{border-color:var(--sendbird-light-primary-300);background-color:var(--sendbird-light-primary-300)}.sendbird-theme--dark .sendbird-iconbutton__feedback.sendbird-iconbutton__feedback__pressed{border-color:var(--sendbird-dark-primary-200);background-color:var(--sendbird-dark-primary-200)}.sendbird-iconbutton__feedback__inner{display:flex;justify-content:center;align-items:center}.sendbird-theme--light .sendbird-iconbutton__feedback__inner svg path{fill:var(--sendbird-light-onlight-02)}.sendbird-theme--dark .sendbird-iconbutton__feedback__inner svg path{fill:var(--sendbird-dark-ondark-02)}.sendbird-theme--light .sendbird-iconbutton__feedback__inner.sendbird-iconbutton__feedback__inner__disabled svg path{fill:var(--sendbird-light-onlight-04)}.sendbird-theme--dark .sendbird-iconbutton__feedback__inner.sendbird-iconbutton__feedback__inner__disabled svg path{fill:var(--sendbird-dark-ondark-04)}.sendbird-theme--light .sendbird-iconbutton__feedback__inner__pressed svg path{fill:var(--sendbird-light-ondark-01)}.sendbird-theme--dark .sendbird-iconbutton__feedback__inner__pressed svg path{fill:var(--sendbird-dark-onlight-01)}.sendbird--mobile-mode .sendbird-message-feedback-modal-content__mobile{max-width:280px;padding:16px}.sendbird-message-feedback-modal-footer__root{display:flex;justify-content:space-between;align-items:center}.sendbird-message-feedback-modal-footer__root_failed{display:flex;justify-content:flex-end;align-items:center;margin-top:48px}.sendbird-message-feedback-modal-footer__right-content{display:flex;gap:8px}.sendbird-message-feedback-modal-body__root{margin:21px 0}.sendbird--mobile-mode .sendbird-message-feedback-modal-header{font-size:18px;line-height:1.33}.sendbird-bottomsheet{position:fixed;top:0;left:0;width:100%;height:100%}.sendbird-bottomsheet__content{position:fixed;z-index:10001;bottom:0;left:0;width:100%}.sendbird-bottomsheet__backdrop{position:fixed;z-index:10000;height:100%;width:100%;top:0;left:0}.sendbird-theme--light .sendbird-bottomsheet__backdrop{background-color:var(--sendbird-light-overlay-02)}.sendbird-theme--dark .sendbird-bottomsheet__backdrop{background-color:var(--sendbird-dark-overlay-02)}.sendbird-message__bottomsheet--feedback-options-menu{width:100vw;border-radius:8px 8px 0 0}.sendbird-theme--light .sendbird-message__bottomsheet--feedback-options-menu{background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-message__bottomsheet--feedback-options-menu{background-color:var(--sendbird-dark-background-500)}.sendbird-message__bottomsheet--feedback-options-menu :first-child{border-radius:8px 8px 0 0}.sendbird-message__bottomsheet--feedback-option{cursor:pointer;height:48px;display:flex;align-items:center;padding:0 24px}.sendbird-suggested-replies{position:relative;display:flex;margin-top:8px;margin-bottom:16px}.sendbird-suggested-replies.vertical{justify-content:flex-end;align-items:flex-end;flex-wrap:wrap;flex-direction:column}.sendbird-suggested-replies.vertical .sendbird-suggested-replies__option:not(:first-child){margin-top:8px}.sendbird-suggested-replies.horizontal{display:flex;flex-direction:row;overflow-x:scroll;margin-left:-24px;margin-right:-24px;padding-left:24px;padding-right:24px}.sendbird--mobile-mode .sendbird-suggested-replies.horizontal{margin-left:-12px;margin-right:-12px;padding-left:52px;padding-right:12px}.sendbird-suggested-replies.horizontal .sendbird-suggested-replies__option:not(:last-child){margin-right:8px}.sendbird-suggested-replies::-webkit-scrollbar{display:none}.sendbird-theme--light .sendbird-suggested-replies,.sendbird-theme--dark .sendbird-suggested-replies{font-family:var(--sendbird-font-family-default)}.sendbird-suggested-replies__option{white-space:pre-wrap;font-size:12px;padding:8px 14px;display:flex;align-items:center;border-radius:18px;cursor:pointer;word-break:break-word}.sendbird-theme--light .sendbird-suggested-replies__option{color:var(--sendbird-light-primary-300);border:1px solid var(--sendbird-light-primary-300);background-color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-suggested-replies__option{color:var(--sendbird-dark-primary-200);border:1px solid var(--sendbird-dark-primary-200);background-color:var(--sendbird-dark-background-600)}.sendbird-theme--light .sendbird-suggested-replies__option:hover{background-color:var(--sendbird-light-background-100)}.sendbird-theme--dark .sendbird-suggested-replies__option:hover{background-color:var(--sendbird-dark-background-500)}.sendbird-theme--light .sendbird-suggested-replies__option:active{background-color:var(--sendbird-light-primary-300);color:var(--sendbird-light-background-50)}.sendbird-theme--dark .sendbird-suggested-replies__option:active{background-color:var(--sendbird-dark-primary-200);color:var(--sendbird-dark-background-600)}.sendbird-suggested-replies__option.horizontal{white-space:nowrap}.sendbird-suggested-replies__option.vertical{white-space:pre-wrap;max-width:calc(100% - 70px)} diff --git a/index.html b/index.html index dfc70fe38..9cd7689ec 100644 --- a/index.html +++ b/index.html @@ -85,8 +85,8 @@ font-size: 1.1em; } - - + +